From cf45eb824817b39ce84604642a47930230e9a745 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 24 Sep 2014 19:29:30 +0100 Subject: [PATCH] bash (4.3-9.1) unstable; urgency=high * Non-maintainer upload by the security team * Apply upstream patch bash43-025, fixing CVE-2014-6271. # imported from the archive --- .pc/.quilt_patches | 1 + .pc/.quilt_series | 1 + .pc/.version | 1 + .pc/applied-patches | 45 + .../examples/startup-files/Bash_aliases | 63 + .pc/bash-default-editor.diff/bashline.c | 4219 ++++ .pc/bash-default-editor.diff/builtins/fc.def | 698 + .pc/bash-subst-param-length.diff/subst.c | 9759 ++++++++ .pc/bash43-001.diff/patchlevel.h | 30 + .pc/bash43-001.diff/test.c | 879 + .pc/bash43-002.diff/patchlevel.h | 30 + .pc/bash43-002.diff/trap.c | 1263 + .pc/bash43-003.diff/lib/readline/readline.c | 1363 + .pc/bash43-003.diff/patchlevel.h | 30 + .pc/bash43-004.diff/lib/readline/readline.c | 1364 + .pc/bash43-004.diff/patchlevel.h | 30 + .pc/bash43-005.diff/parse.y | 6227 +++++ .pc/bash43-005.diff/patchlevel.h | 30 + .pc/bash43-005.diff/y.tab.c | 8540 +++++++ .pc/bash43-006.diff/jobs.c | 4475 ++++ .pc/bash43-006.diff/patchlevel.h | 30 + .pc/bash43-007.diff/arrayfunc.c | 1141 + .pc/bash43-007.diff/patchlevel.h | 30 + .pc/bash43-008.diff/lib/glob/glob.c | 1365 + .pc/bash43-008.diff/lib/glob/gmisc.c | 376 + .pc/bash43-008.diff/patchlevel.h | 30 + .pc/bash43-009.diff/parse.y | 6227 +++++ .pc/bash43-009.diff/patchlevel.h | 30 + .pc/bash43-009.diff/y.tab.c | 8540 +++++++ .pc/bash43-010.diff/externs.h | 516 + .pc/bash43-010.diff/lib/sh/shquote.c | 313 + .pc/bash43-010.diff/patchlevel.h | 30 + .pc/bash43-010.diff/pcomplete.c | 1632 ++ .pc/bash43-011.diff/lib/readline/display.c | 2818 +++ .pc/bash43-011.diff/patchlevel.h | 30 + .pc/bash43-012.diff/jobs.c | 4475 ++++ .pc/bash43-012.diff/patchlevel.h | 30 + .pc/bash43-013.diff/lib/readline/display.c | 2819 +++ .pc/bash43-013.diff/patchlevel.h | 30 + .pc/bash43-014.diff/patchlevel.h | 30 + .pc/bash43-014.diff/subst.c | 9713 ++++++++ .pc/bash43-015.diff/bashline.c | 4212 ++++ .pc/bash43-015.diff/patchlevel.h | 30 + .pc/bash43-016.diff/lib/glob/glob.c | 1374 ++ .pc/bash43-016.diff/lib/glob/gmisc.c | 377 + .pc/bash43-016.diff/patchlevel.h | 30 + .pc/bash43-017.diff/patchlevel.h | 30 + .pc/bash43-017.diff/variables.c | 5334 ++++ .pc/bash43-018.diff/arrayfunc.c | 1146 + .pc/bash43-018.diff/patchlevel.h | 30 + .pc/bash43-019.diff/builtins/read.def | 1091 + .pc/bash43-019.diff/lib/readline/input.c | 625 + .pc/bash43-019.diff/patchlevel.h | 30 + .pc/bash43-020.diff/parse.y | 6227 +++++ .pc/bash43-020.diff/patchlevel.h | 30 + .pc/bash43-020.diff/shell.h | 186 + .pc/bash43-020.diff/y.tab.c | 8540 +++++++ .pc/bash43-021.diff/lib/readline/misc.c | 692 + .pc/bash43-021.diff/patchlevel.h | 30 + .pc/bash43-022.diff/execute_cmd.c | 5445 ++++ .pc/bash43-022.diff/patchlevel.h | 30 + .pc/bash43-023.diff/patchlevel.h | 30 + .pc/bash43-023.diff/subst.c | 9745 ++++++++ .pc/bash43-023.diff/subst.h | 317 + .pc/bash43-024.diff/patchlevel.h | 30 + .pc/bash43-024.diff/subst.c | 9751 ++++++++ .pc/bash43-025.diff/builtins/common.h | 178 + .pc/bash43-025.diff/builtins/evalstring.c | 615 + .pc/bash43-025.diff/patchlevel.h | 30 + .pc/bash43-025.diff/subst.c | 9757 ++++++++ .pc/bash43-025.diff/variables.c | 5331 ++++ .pc/bashbug-editor.diff/support/bashbug.sh | 271 + .pc/bzero.diff/lib/sh/oslib.c | 301 + .pc/deb-bash-config.diff/config-bot.h | 199 + .pc/deb-bash-config.diff/config-top.h | 134 + .../examples/loadables/README | 66 + .pc/exec-redirections-doc.diff/doc/bash.1 | 10357 ++++++++ .../doc/bashref.texi | 8747 +++++++ .pc/input-err.diff/input.c | 666 + .pc/man-arithmetic.diff/doc/bash.1 | 10331 ++++++++ .pc/man-bashlogout.diff/doc/bash.1 | 10346 ++++++++ .pc/man-bashrc.diff/doc/bash.1 | 10336 ++++++++ .pc/man-fignore.diff/doc/bash.1 | 10334 ++++++++ .pc/man-nocaseglob.diff/doc/bash.1 | 10349 ++++++++ .pc/man-test.diff/builtins/test.def | 159 + .pc/man-test2.diff/builtins/test.def | 162 + .pc/man-test2.diff/doc/bash.1 | 10353 ++++++++ .pc/man-test2.diff/doc/bashref.texi | 8743 +++++++ .pc/pgrp-pipe.diff/config-bot.h | 199 + .pc/privmode.diff/shell.c | 1888 ++ .pc/rbash-manpage.diff/doc/rbash.1 | 8 + .pc/use-system-texi2html.diff/doc/Makefile.in | 316 + ABOUT-NLS | 625 + AUTHORS | 466 + CHANGES | 7829 ++++++ COMPAT | 425 + COPYING | 674 + CWRU/PLATFORMS | 31 + CWRU/README | 20 + CWRU/changelog | 5850 +++++ CWRU/misc/bison | 26 + CWRU/misc/errlist.c | 57 + CWRU/misc/hpux10-dlfcn.h | 63 + CWRU/misc/open-files.c | 39 + CWRU/misc/sigs.c | 47 + CWRU/misc/sigstat.c | 226 + CWRU/sh-redir-hack | 15 + ChangeLog | 1 + INSTALL | 421 + MANIFEST | 1287 + Makefile.in | 1554 ++ NEWS | 1815 ++ NOTES | 352 + POSIX | 216 + RBASH | 49 + README | 99 + Y2K | 4 + aclocal.m4 | 4195 ++++ alias.c | 580 + alias.h | 70 + array.c | 1148 + array.h | 119 + arrayfunc.c | 1147 + arrayfunc.h | 77 + assoc.c | 559 + assoc.h | 62 + bashansi.h | 41 + bashhist.c | 923 + bashhist.h | 71 + bashintl.h | 50 + bashjmp.h | 43 + bashline.c | 4219 ++++ bashline.h | 57 + bashtypes.h | 42 + bracecomp.c | 221 + braces.c | 835 + builtins.h | 61 + builtins/Makefile.in | 686 + builtins/alias.def | 241 + builtins/bashgetopt.c | 175 + builtins/bashgetopt.h | 39 + builtins/bind.def | 341 + builtins/break.def | 141 + builtins/builtin.def | 85 + builtins/caller.def | 154 + builtins/cd.def | 661 + builtins/colon.def | 67 + builtins/command.def | 219 + builtins/common.c | 890 + builtins/common.h | 180 + builtins/complete.def | 871 + builtins/declare.def | 696 + builtins/echo.def | 200 + builtins/enable.def | 483 + builtins/eval.def | 57 + builtins/evalfile.c | 356 + builtins/evalstring.c | 626 + builtins/exec.def | 252 + builtins/exit.def | 168 + builtins/fc.def | 698 + builtins/fg_bg.def | 186 + builtins/gen-helpfiles.c | 197 + builtins/getopt.c | 309 + builtins/getopt.h | 65 + builtins/getopts.def | 331 + builtins/hash.def | 283 + builtins/help.def | 517 + builtins/history.def | 381 + builtins/inlib.def | 80 + builtins/jobs.def | 298 + builtins/kill.def | 265 + builtins/let.def | 129 + builtins/mapfile.def | 361 + builtins/mkbuiltins.c | 1628 ++ builtins/printf.def | 1270 + builtins/psize.c | 79 + builtins/psize.sh | 45 + builtins/pushd.def | 784 + builtins/read.def | 1096 + builtins/reserved.def | 288 + builtins/return.def | 78 + builtins/set.def | 885 + builtins/setattr.def | 551 + builtins/shift.def | 101 + builtins/shopt.def | 777 + builtins/source.def | 197 + builtins/suspend.def | 127 + builtins/test.def | 165 + builtins/times.def | 119 + builtins/trap.def | 304 + builtins/type.def | 405 + builtins/ulimit.def | 783 + builtins/umask.def | 312 + builtins/wait.def | 216 + command.h | 392 + config-bot.h | 202 + config-top.h | 134 + config.h.in | 1154 + configure | 17467 +++++++++++++ configure.ac | 1212 + conftypes.h | 58 + copy_cmd.c | 450 + cross-build/cygwin32.cache | 251 + cross-build/opennt.cache | 169 + cross-build/x86-beos.cache | 45 + debian/FAQ | 35 + debian/README | 122 + debian/README.abs-guide | 26 + debian/README.bash_completion | 18 + debian/README.commands | 189 + debian/bash-builtins.7 | 18 + debian/bash-doc.doc-base.bash | 14 + debian/bash-doc.doc-base.bashref | 10 + debian/bash-static.overrides | 5 + debian/bash-static.postinst | 13 + debian/bash-static.postrm | 21 + debian/bash.menu | 2 + debian/bash.overrides | 5 + debian/bash.postinst | 26 + debian/bash.postrm | 22 + debian/bash.preinst-lib.c | 131 + debian/bash.preinst.c | 170 + debian/bash.preinst.h | 37 + debian/bash.prerm | 22 + debian/bashbug.1 | 68 + debian/changelog | 2293 ++ debian/clear_console.1 | 50 + debian/clear_console.c | 285 + debian/compat | 1 + debian/control | 72 + debian/copyright | 224 + debian/etc.bash.bashrc | 55 + debian/etc.inputrc | 17 + debian/etc.profile | 27 + debian/inputrc.arrows | 30 + debian/locale-gen | 30 + debian/patches/bash-aliases-repeat.diff | 28 + debian/patches/bash-default-editor.diff | 35 + debian/patches/bash-minimal.dpatch | 62 + debian/patches/bash-subst-param-length.diff | 13 + debian/patches/bash43-001.diff | 52 + debian/patches/bash43-002.diff | 52 + debian/patches/bash43-003.diff | 42 + debian/patches/bash43-004.diff | 41 + debian/patches/bash43-005.diff | 55 + debian/patches/bash43-006.diff | 42 + debian/patches/bash43-007.diff | 48 + debian/patches/bash43-008.diff | 153 + debian/patches/bash43-009.diff | 55 + debian/patches/bash43-010.diff | 153 + debian/patches/bash43-011.diff | 42 + debian/patches/bash43-012.diff | 44 + debian/patches/bash43-013.diff | 58 + debian/patches/bash43-014.diff | 101 + debian/patches/bash43-015.diff | 54 + debian/patches/bash43-016.diff | 129 + debian/patches/bash43-017.diff | 47 + debian/patches/bash43-018.diff | 44 + debian/patches/bash43-019.diff | 83 + debian/patches/bash43-020.diff | 103 + debian/patches/bash43-021.diff | 52 + debian/patches/bash43-022.diff | 53 + debian/patches/bash43-023.diff | 86 + debian/patches/bash43-024.diff | 51 + debian/patches/bash43-025.diff | 119 + debian/patches/bashbug-editor.diff | 12 + debian/patches/bzero.diff | 13 + debian/patches/deb-bash-config.diff | 52 + debian/patches/deb-examples.diff | 14 + debian/patches/exec-redirections-doc.diff | 29 + debian/patches/input-err.diff | 15 + debian/patches/man-arithmetic.diff | 16 + debian/patches/man-bash.diff | 11 + debian/patches/man-bashlogout.diff | 16 + debian/patches/man-bashrc.diff | 66 + debian/patches/man-builtin.dpatch | 29 + debian/patches/man-fignore.diff | 17 + debian/patches/man-nocaseglob.diff | 17 + debian/patches/man-test.diff | 15 + debian/patches/man-test2.diff | 46 + debian/patches/man-vx-opts.dpatch | 34 + debian/patches/no-brk-caching.diff | 47 + debian/patches/pgrp-pipe.diff | 11 + debian/patches/privmode.diff | 19 + debian/patches/random.dpatch | 107 + debian/patches/rbash-manpage.diff | 12 + debian/patches/rl-del-backspace-policy.dpatch | 48 + debian/patches/rl-examples-bdb.dpatch | 30 + debian/patches/rl-header.dpatch | 28 + debian/patches/rl-setenv.dpatch | 30 + debian/patches/series | 46 + debian/patches/use-system-texi2html.diff | 15 + debian/rules | 450 + debian/run-my-gprof | 32 + debian/skel.bash_logout | 7 + debian/skel.bashrc | 113 + debian/skel.profile | 22 + debian/source/format | 1 + debian/source/lintian-overrides | 2 + debian/watch | 2 + dispose_cmd.c | 342 + dispose_cmd.h | 40 + doc/INTRO | 187 + doc/Makefile.in | 316 + doc/README | 36 + doc/bash.0 | 5729 +++++ doc/bash.1 | 10361 ++++++++ doc/bash.html | 13275 ++++++++++ doc/bash.pdf | Bin 0 -> 312770 bytes doc/bash.ps | 8914 +++++++ doc/bashbug.0 | 50 + doc/bashbug.1 | 64 + doc/bashbug.ps | 284 + doc/bashref.dvi | Bin 0 -> 721984 bytes doc/bashref.html | 17481 +++++++++++++ doc/bashref.info | 11298 +++++++++ doc/bashref.pdf | Bin 0 -> 463824 bytes doc/bashref.ps | 20604 ++++++++++++++++ doc/bashref.texi | 8750 +++++++ doc/builtins.0 | 1734 ++ doc/builtins.1 | 24 + doc/builtins.ps | 2910 +++ doc/fdl.texi | 506 + doc/fdl.txt | 451 + doc/htmlpost.sh | 19 + doc/infopost.sh | 8 + doc/rbash.0 | 59 + doc/rbash.1 | 8 + doc/rbash.ps | 280 + doc/texinfo.tex | 10145 ++++++++ doc/version.texi | 10 + error.c | 489 + error.h | 70 + eval.c | 291 + examples/INDEX.html | 828 + examples/INDEX.txt | 199 + examples/complete/bash_completion | 9401 +++++++ examples/complete/bashcc-1.0.1.tar.gz | Bin 0 -> 4609 bytes examples/complete/cdfunc | 76 + examples/complete/complete-examples | 512 + examples/functions/array-stuff | 122 + examples/functions/array-to-string | 15 + examples/functions/autoload | 111 + examples/functions/autoload.v2 | 192 + examples/functions/autoload.v3 | 125 + examples/functions/basename | 23 + examples/functions/csh-compat | 48 + examples/functions/dirname | 21 + examples/functions/exitstat | 22 + examples/functions/external | 50 + examples/functions/fact | 13 + examples/functions/fstty | 77 + examples/functions/func | 43 + examples/functions/inetaddr | 79 + examples/functions/inpath | 14 + examples/functions/isnum2 | 41 + examples/functions/isvalidip | 14 + examples/functions/ksh-cd | 54 + examples/functions/ksh-compat-test | 58 + examples/functions/kshenv | 246 + examples/functions/login | 11 + examples/functions/notify.bash | 77 + examples/functions/seq | 48 + examples/functions/seq2 | 56 + examples/functions/shcat | 7 + examples/functions/shcat2 | 19 + examples/functions/sort-pos-params | 69 + examples/functions/substr | 97 + examples/functions/substr2 | 99 + examples/functions/whatis | 71 + examples/functions/whence | 78 + examples/functions/which | 62 + examples/loadables/Makefile.in | 237 + examples/loadables/README | 69 + examples/loadables/basename.c | 129 + examples/loadables/cat.c | 120 + examples/loadables/dirname.c | 116 + examples/loadables/finfo.c | 620 + examples/loadables/head.c | 164 + examples/loadables/hello.c | 82 + examples/loadables/id.c | 328 + examples/loadables/ln.c | 226 + examples/loadables/logname.c | 73 + examples/loadables/mkdir.c | 237 + examples/loadables/mypid.c | 74 + examples/loadables/necho.c | 53 + examples/loadables/pathchk.c | 379 + examples/loadables/perl/Makefile.in | 99 + examples/loadables/perl/README | 6 + examples/loadables/perl/bperl.c | 46 + examples/loadables/perl/iperl.c | 24 + examples/loadables/print.c | 191 + examples/loadables/printenv.c | 93 + examples/loadables/push.c | 116 + examples/loadables/realpath.c | 140 + examples/loadables/rmdir.c | 71 + examples/loadables/sleep.c | 101 + examples/loadables/strftime.c | 125 + examples/loadables/sync.c | 52 + examples/loadables/tee.c | 178 + examples/loadables/template.c | 59 + examples/loadables/truefalse.c | 70 + examples/loadables/tty.c | 80 + examples/loadables/uname.c | 160 + examples/loadables/unlink.c | 73 + examples/loadables/whoami.c | 73 + examples/misc/aliasconv.bash | 44 + examples/misc/aliasconv.sh | 42 + examples/misc/cshtobash | 139 + examples/scripts/cat.sh | 12 + examples/scripts/center | 41 + examples/scripts/inpath | 19 + examples/scripts/shprompt | 153 + examples/scripts/spin.bash | 37 + examples/scripts/xterm_title | 44 + examples/scripts/zprintf | 43 + examples/startup-files/Bash_aliases | 63 + examples/startup-files/Bash_profile | 18 + examples/startup-files/Bashrc.bfox | 70 + examples/startup-files/README | 12 + examples/startup-files/bash-profile | 39 + examples/startup-files/bashrc | 133 + execute_cmd.c | 5454 ++++ execute_cmd.h | 68 + expr.c | 1567 ++ externs.h | 517 + findcmd.c | 623 + findcmd.h | 35 + flags.c | 365 + flags.h | 80 + general.c | 1177 + general.h | 327 + hashcmd.c | 196 + hashcmd.h | 43 + hashlib.c | 442 + hashlib.h | 92 + include/ansi_stdlib.h | 54 + include/chartypes.h | 113 + include/filecntl.h | 53 + include/gettext.h | 70 + include/maxpath.h | 75 + include/memalloc.h | 62 + include/ocache.h | 133 + include/posixdir.h | 71 + include/posixjmp.h | 42 + include/posixselect.h | 47 + include/posixstat.h | 142 + include/posixtime.h | 49 + include/posixwait.h | 103 + include/shmbchar.h | 353 + include/shmbutil.h | 503 + include/shtty.h | 112 + include/stat-time.h | 214 + include/stdc.h | 89 + include/systimes.h | 55 + include/typemax.h | 103 + include/unionwait.h | 98 + input.c | 666 + input.h | 133 + jobs.c | 4476 ++++ jobs.h | 253 + lib/glob/Makefile.in | 167 + lib/glob/collsyms.h | 140 + lib/glob/doc/Makefile | 5 + lib/glob/doc/glob.texi | 1 + lib/glob/glob.c | 1391 ++ lib/glob/glob.h | 44 + lib/glob/glob_loop.c | 67 + lib/glob/gmisc.c | 410 + lib/glob/ndir.h | 50 + lib/glob/sm_loop.c | 802 + lib/glob/smatch.c | 415 + lib/glob/strmatch.c | 79 + lib/glob/strmatch.h | 62 + lib/glob/xmbsrtowcs.c | 409 + lib/intl/ChangeLog | 4 + lib/intl/Makefile.in | 472 + lib/intl/VERSION | 1 + lib/intl/bindtextdom.c | 376 + lib/intl/config.charset | 465 + lib/intl/dcgettext.c | 61 + lib/intl/dcigettext.c | 1248 + lib/intl/dcngettext.c | 62 + lib/intl/dgettext.c | 61 + lib/intl/dngettext.c | 63 + lib/intl/eval-plural.h | 116 + lib/intl/explodename.c | 195 + lib/intl/finddomain.c | 197 + lib/intl/gettext.c | 66 + lib/intl/gettextP.h | 226 + lib/intl/gmo.h | 150 + lib/intl/hash-string.h | 61 + lib/intl/intl-compat.c | 152 + lib/intl/l10nflist.c | 456 + lib/intl/libgnuintl.h.in | 311 + lib/intl/loadinfo.h | 159 + lib/intl/loadmsgcat.c | 1324 + lib/intl/localcharset.c | 399 + lib/intl/localcharset.h | 43 + lib/intl/locale.alias | 78 + lib/intl/localealias.c | 424 + lib/intl/localename.c | 774 + lib/intl/log.c | 106 + lib/intl/ngettext.c | 70 + lib/intl/os2compat.c | 100 + lib/intl/os2compat.h | 48 + lib/intl/osdep.c | 26 + lib/intl/plural-exp.c | 158 + lib/intl/plural-exp.h | 128 + lib/intl/plural.c | 1679 ++ lib/intl/plural.y | 411 + lib/intl/ref-add.sin | 29 + lib/intl/ref-del.sin | 24 + lib/intl/relocatable.c | 440 + lib/intl/relocatable.h | 69 + lib/intl/textdomain.c | 144 + lib/malloc/Makefile.in | 138 + lib/malloc/alloca.c | 482 + lib/malloc/getpagesize.h | 60 + lib/malloc/i386-alloca.s | 16 + lib/malloc/imalloc.h | 173 + lib/malloc/malloc.c | 1307 + lib/malloc/mstats.h | 110 + lib/malloc/shmalloc.h | 70 + lib/malloc/stats.c | 205 + lib/malloc/stub.c | 22 + lib/malloc/table.c | 331 + lib/malloc/table.h | 105 + lib/malloc/trace.c | 126 + lib/malloc/watch.c | 151 + lib/malloc/watch.h | 41 + lib/malloc/x386-alloca.s | 63 + lib/malloc/xleaktrace | 47 + lib/malloc/xmalloc.c | 94 + lib/readline/COPYING | 674 + lib/readline/ChangeLog | 403 + lib/readline/Makefile.in | 391 + lib/readline/README | 6 + lib/readline/STANDALONE | 2 + lib/readline/ansi_stdlib.h | 54 + lib/readline/bind.c | 2483 ++ lib/readline/callback.c | 293 + lib/readline/chardefs.h | 164 + lib/readline/colors.c | 251 + lib/readline/colors.h | 122 + lib/readline/compat.c | 113 + lib/readline/complete.c | 2891 +++ lib/readline/display.c | 2824 +++ lib/readline/doc/Makefile | 145 + lib/readline/doc/fdl.texi | 506 + lib/readline/doc/history.texi | 85 + lib/readline/doc/hstech.texi | 577 + lib/readline/doc/hsuser.texi | 475 + lib/readline/doc/rlman.texi | 84 + lib/readline/doc/rltech.texi | 2590 ++ lib/readline/doc/rluser.texi | 2229 ++ lib/readline/doc/rluserman.texi | 70 + lib/readline/doc/version.texi | 10 + lib/readline/emacs_keymap.c | 872 + lib/readline/examples/Inputrc | 81 + lib/readline/examples/Makefile | 44 + lib/readline/examples/excallback.c | 196 + lib/readline/examples/fileman.c | 488 + lib/readline/examples/histexamp.c | 125 + lib/readline/examples/manexamp.c | 111 + lib/readline/examples/rl-callbacktest.c | 81 + lib/readline/examples/rl.c | 157 + lib/readline/examples/rlcat.c | 179 + lib/readline/examples/rltest.c | 92 + lib/readline/funmap.c | 266 + lib/readline/histexpand.c | 1658 ++ lib/readline/histfile.c | 584 + lib/readline/histlib.h | 82 + lib/readline/history.c | 519 + lib/readline/history.h | 266 + lib/readline/histsearch.c | 194 + lib/readline/input.c | 633 + lib/readline/isearch.c | 789 + lib/readline/keymaps.c | 162 + lib/readline/keymaps.h | 97 + lib/readline/kill.c | 694 + lib/readline/macro.c | 307 + lib/readline/mbutil.c | 378 + lib/readline/misc.c | 692 + lib/readline/nls.c | 281 + lib/readline/parens.c | 173 + lib/readline/parse-colors.c | 440 + lib/readline/parse-colors.h | 46 + lib/readline/posixdir.h | 71 + lib/readline/posixjmp.h | 42 + lib/readline/posixselect.h | 47 + lib/readline/posixstat.h | 142 + lib/readline/readline.c | 1364 + lib/readline/readline.h | 923 + lib/readline/rlconf.h | 69 + lib/readline/rldefs.h | 166 + lib/readline/rlmbutil.h | 163 + lib/readline/rlprivate.h | 535 + lib/readline/rlshell.h | 33 + lib/readline/rlstdc.h | 57 + lib/readline/rltty.c | 975 + lib/readline/rltty.h | 80 + lib/readline/rltypedefs.h | 81 + lib/readline/rlwinsize.h | 58 + lib/readline/savestring.c | 41 + lib/readline/search.c | 631 + lib/readline/shell.c | 218 + lib/readline/signals.c | 709 + lib/readline/tcap.h | 58 + lib/readline/terminal.c | 794 + lib/readline/text.c | 1705 ++ lib/readline/tilde.c | 502 + lib/readline/tilde.h | 80 + lib/readline/undo.c | 354 + lib/readline/util.c | 591 + lib/readline/vi_keymap.c | 875 + lib/readline/vi_mode.c | 2178 ++ lib/readline/xfree.c | 50 + lib/readline/xmalloc.c | 79 + lib/readline/xmalloc.h | 45 + lib/sh/Makefile.in | 571 + lib/sh/casemod.c | 265 + lib/sh/clktck.c | 61 + lib/sh/clock.c | 81 + lib/sh/dprintf.c | 70 + lib/sh/eaccess.c | 242 + lib/sh/fmtullong.c | 31 + lib/sh/fmtulong.c | 191 + lib/sh/fmtumax.c | 27 + lib/sh/fnxform.c | 199 + lib/sh/fpurge.c | 232 + lib/sh/getcwd.c | 356 + lib/sh/getenv.c | 233 + lib/sh/inet_aton.c | 214 + lib/sh/input_avail.c | 98 + lib/sh/itos.c | 84 + lib/sh/mailstat.c | 159 + lib/sh/makepath.c | 128 + lib/sh/mbscasecmp.c | 78 + lib/sh/mbschr.c | 85 + lib/sh/mbscmp.c | 72 + lib/sh/memset.c | 29 + lib/sh/mktime.c | 423 + lib/sh/netconn.c | 82 + lib/sh/netopen.c | 350 + lib/sh/oslib.c | 301 + lib/sh/pathcanon.c | 234 + lib/sh/pathphys.c | 296 + lib/sh/rename.c | 76 + lib/sh/setlinebuf.c | 63 + lib/sh/shmatch.c | 120 + lib/sh/shmbchar.c | 113 + lib/sh/shquote.c | 327 + lib/sh/shtty.c | 330 + lib/sh/snprintf.c | 2219 ++ lib/sh/spell.c | 212 + lib/sh/strcasecmp.c | 84 + lib/sh/strcasestr.c | 46 + lib/sh/strchrnul.c | 35 + lib/sh/strdup.c | 42 + lib/sh/strerror.c | 74 + lib/sh/strftime.c | 1006 + lib/sh/stringlist.c | 297 + lib/sh/stringvec.c | 248 + lib/sh/strnlen.c | 49 + lib/sh/strpbrk.c | 49 + lib/sh/strstr.c | 125 + lib/sh/strtod.c | 201 + lib/sh/strtoimax.c | 113 + lib/sh/strtol.c | 259 + lib/sh/strtoll.c | 30 + lib/sh/strtoul.c | 30 + lib/sh/strtoull.c | 31 + lib/sh/strtoumax.c | 113 + lib/sh/strtrans.c | 380 + lib/sh/times.c | 77 + lib/sh/timeval.c | 145 + lib/sh/tmpfile.c | 222 + lib/sh/uconvert.c | 116 + lib/sh/ufuncs.c | 104 + lib/sh/unicode.c | 341 + lib/sh/vprint.c | 85 + lib/sh/wcsdup.c | 44 + lib/sh/wcsnwidth.c | 56 + lib/sh/wcswidth.c | 46 + lib/sh/winsize.c | 96 + lib/sh/zcatfd.c | 70 + lib/sh/zgetline.c | 121 + lib/sh/zmapfd.c | 89 + lib/sh/zread.c | 218 + lib/sh/zwrite.c | 64 + lib/termcap/Makefile.in | 90 + lib/termcap/ltcap.h | 30 + lib/termcap/termcap.c | 815 + lib/termcap/termcap.h | 63 + lib/termcap/tparam.c | 345 + lib/termcap/version.c | 22 + lib/tilde/Makefile.in | 126 + lib/tilde/README | 5 + lib/tilde/shell.c | 80 + lib/tilde/tilde.c | 502 + lib/tilde/tilde.h | 80 + list.c | 136 + locale.c | 563 + m4/stat-time.m4 | 61 + m4/timespec.m4 | 71 + mailcheck.c | 491 + mailcheck.h | 34 + make_cmd.c | 891 + make_cmd.h | 70 + mksyntax.c | 415 + nojobs.c | 974 + parse.y | 6229 +++++ parser-built | 164 + parser.h | 73 + patchlevel.h | 30 + pathexp.c | 609 + pathexp.h | 102 + pathnames.h.in | 33 + pcomplete.c | 1662 ++ pcomplete.h | 164 + pcomplib.c | 228 + po/._bg.po | Bin 0 -> 4096 bytes po/LINGUAS | 2 + po/Makefile.in.in | 359 + po/Makevars | 41 + po/POTFILES.in | 81 + po/README | 1 + po/Rules-builtins | 19 + po/Rules-quot | 42 + po/af.gmo | Bin 0 -> 1244 bytes po/af.po | 4701 ++++ po/bash.pot | 4041 +++ po/bg.gmo | Bin 0 -> 235979 bytes po/bg.po | 5476 ++++ po/boldquot.sed | 10 + po/ca.gmo | Bin 0 -> 9739 bytes po/ca.po | 6614 +++++ po/cs.gmo | Bin 0 -> 173589 bytes po/cs.po | 6332 +++++ po/da.gmo | Bin 0 -> 100735 bytes po/da.po | 5795 +++++ po/de.gmo | Bin 0 -> 89921 bytes po/de.po | 4778 ++++ po/el.gmo | Bin 0 -> 37185 bytes po/el.po | 4104 +++ po/en@boldquot.gmo | Bin 0 -> 165724 bytes po/en@boldquot.header | 25 + po/en@boldquot.po | 5649 +++++ po/en@quot.gmo | Bin 0 -> 164132 bytes po/en@quot.header | 22 + po/en@quot.po | 5611 +++++ po/eo.gmo | Bin 0 -> 161232 bytes po/eo.po | 5799 +++++ po/es.gmo | Bin 0 -> 122470 bytes po/es.po | 8666 +++++++ po/et.gmo | Bin 0 -> 12133 bytes po/et.po | 4066 +++ po/fi.gmo | Bin 0 -> 102765 bytes po/fi.po | 5636 +++++ po/fr.gmo | Bin 0 -> 126213 bytes po/fr.po | 6731 +++++ po/ga.gmo | Bin 0 -> 58471 bytes po/ga.po | 4475 ++++ po/gl.gmo | Bin 0 -> 63233 bytes po/gl.po | 4488 ++++ po/hr.gmo | Bin 0 -> 34075 bytes po/hr.po | 4125 ++++ po/hu.gmo | Bin 0 -> 110947 bytes po/hu.po | 5531 +++++ po/id.gmo | Bin 0 -> 108579 bytes po/id.po | 6493 +++++ po/insert-header.sin | 23 + po/it.gmo | Bin 0 -> 122520 bytes po/it.po | 5853 +++++ po/ja.gmo | Bin 0 -> 133748 bytes po/ja.po | 5620 +++++ po/lt.gmo | Bin 0 -> 29354 bytes po/lt.po | 4466 ++++ po/nl.gmo | Bin 0 -> 170658 bytes po/nl.po | 5637 +++++ po/pl.gmo | Bin 0 -> 173751 bytes po/pl.po | 5711 +++++ po/pt_BR.gmo | Bin 0 -> 9580 bytes po/pt_BR.po | 6429 +++++ po/quot.sed | 6 + po/remove-potcdate.sin | 19 + po/ro.gmo | Bin 0 -> 9358 bytes po/ro.po | 6537 +++++ po/ru.gmo | Bin 0 -> 9155 bytes po/ru.po | 4095 +++ po/sk.gmo | Bin 0 -> 121115 bytes po/sk.po | 6229 +++++ po/sl.gmo | Bin 0 -> 117289 bytes po/sl.po | 5593 +++++ po/sr.gmo | Bin 0 -> 219040 bytes po/sr.po | 5661 +++++ po/sv.gmo | Bin 0 -> 165974 bytes po/sv.po | 5617 +++++ po/tr.gmo | Bin 0 -> 88390 bytes po/tr.po | 5967 +++++ po/uk.gmo | Bin 0 -> 222687 bytes po/uk.po | 5709 +++++ po/vi.gmo | Bin 0 -> 179349 bytes po/vi.po | 5545 +++++ po/zh_CN.gmo | Bin 0 -> 102094 bytes po/zh_CN.po | 5441 ++++ po/zh_TW.gmo | Bin 0 -> 5876 bytes po/zh_TW.po | 4065 +++ print_cmd.c | 1591 ++ quit.h | 79 + redir.c | 1397 ++ redir.h | 40 + shell.c | 1888 ++ shell.h | 187 + sig.c | 737 + sig.h | 139 + siglist.c | 229 + siglist.h | 44 + stringlib.c | 287 + subst.c | 9759 ++++++++ subst.h | 317 + support/Makefile.in | 87 + support/SYMLINKS | 18 + support/bash.xbm | 60 + support/bashbug.sh | 272 + support/bashversion.c | 148 + support/checkbashisms | 170 + support/config.guess | 1568 ++ support/config.rpath | 547 + support/config.sub | 1793 ++ support/fixlinks | 89 + support/install.sh | 247 + support/man2html.c | 4074 +++ support/missing | 187 + support/mkclone | 122 + support/mkconffiles | 79 + support/mkdirs | 47 + support/mkinstalldirs | 111 + support/mksignames.c | 111 + support/mkversion.sh | 168 + support/printenv.c | 72 + support/printenv.sh | 27 + support/recho.c | 67 + support/rlvers.sh | 113 + support/shobj-conf | 594 + support/signames.c | 401 + support/texi2dvi | 658 + support/texi2html | 5428 ++++ support/xcase.c | 96 + support/xenix-link.sh | 84 + support/zecho.c | 43 + syntax.h | 104 + test.c | 880 + test.h | 39 + tests/COPYRIGHT | 9 + tests/README | 3 + tests/alias.right | 12 + tests/alias.tests | 39 + tests/alias1.sub | 20 + tests/appendop.right | 28 + tests/appendop.tests | 87 + tests/appendop1.sub | 15 + tests/appendop2.sub | 18 + tests/arith-for.right | 86 + tests/arith-for.tests | 113 + tests/arith.right | 247 + tests/arith.tests | 302 + tests/arith1.sub | 38 + tests/arith2.sub | 45 + tests/arith3.sub | 45 + tests/arith4.sub | 10 + tests/arith5.sub | 56 + tests/arith6.sub | 52 + tests/array-at-star | 120 + tests/array.right | 390 + tests/array.tests | 402 + tests/array1.sub | 1 + tests/array10.sub | 52 + tests/array11.sub | 35 + tests/array12.sub | 21 + tests/array13.sub | 13 + tests/array14.sub | 30 + tests/array15.sub | 24 + tests/array16.sub | 21 + tests/array2.right | 74 + tests/array2.sub | 4 + tests/array3.sub | 9 + tests/array4.sub | 32 + tests/array5.sub | 34 + tests/array6.sub | 115 + tests/array7.sub | 14 + tests/array8.sub | 23 + tests/array9.sub | 27 + tests/assoc.right | 192 + tests/assoc.tests | 188 + tests/assoc1.sub | 16 + tests/assoc2.sub | 15 + tests/assoc3.sub | 15 + tests/assoc4.sub | 22 + tests/assoc5.sub | 27 + tests/assoc6.sub | 146 + tests/assoc7.sub | 16 + tests/braces.right | 77 + tests/braces.tests | 119 + tests/builtins.right | 171 + tests/builtins.tests | 262 + tests/builtins1.sub | 14 + tests/builtins2.sub | 10 + tests/builtins3.sub | 14 + tests/builtins4.sub | 44 + tests/case.right | 20 + tests/case.tests | 33 + tests/case1.sub | 64 + tests/casemod.right | 45 + tests/casemod.tests | 99 + tests/comsub-eof.right | 13 + tests/comsub-eof.tests | 11 + tests/comsub-eof0.sub | 4 + tests/comsub-eof1.sub | 4 + tests/comsub-eof2.sub | 2 + tests/comsub-eof3.sub | 4 + tests/comsub-eof4.sub | 4 + tests/comsub-eof5.sub | 9 + tests/comsub-posix.right | 73 + tests/comsub-posix.tests | 219 + tests/comsub-posix1.sub | 3 + tests/comsub-posix2.sub | 16 + tests/comsub-posix3.sub | 22 + tests/comsub.right | 29 + tests/comsub.tests | 44 + tests/comsub1.sub | 48 + tests/cond-regexp1.sub | 56 + tests/cond-regexp2.sub | 30 + tests/cond-regexp3.sub | 73 + tests/cond.right | 131 + tests/cond.tests | 187 + tests/coproc.right | 13 + tests/coproc.tests | 45 + tests/cprint.right | 72 + tests/cprint.tests | 67 + tests/dbg-support.right | 371 + tests/dbg-support.sub | 26 + tests/dbg-support.tests | 142 + tests/dbg-support2.right | 7 + tests/dbg-support2.tests | 26 + tests/dbg-support3.sub | 39 + tests/dollar-at-star | 260 + tests/dollar-at-star1.sub | 23 + tests/dollar-at1.sub | 29 + tests/dollar-at2.sub | 19 + tests/dollar-at3.sub | 9 + tests/dollar-at4.sub | 10 + tests/dollar-at5.sub | 82 + tests/dollar-at6.sub | 30 + tests/dollar-star1.sub | 31 + tests/dollar-star2.sub | 26 + tests/dollar-star3.sub | 18 + tests/dollar-star4.sub | 9 + tests/dollar-star5.sub | 16 + tests/dollar-star6.sub | 19 + tests/dollar-star7.sub | 30 + tests/dollar.right | 284 + tests/dstack.right | 55 + tests/dstack.tests | 87 + tests/dstack2.right | 24 + tests/dstack2.tests | 33 + tests/errors.right | 113 + tests/errors.tests | 274 + tests/errors1.sub | 27 + tests/errors2.sub | 3 + tests/errors3.sub | 7 + tests/exec.right | 63 + tests/exec1.sub | 1 + tests/exec2.sub | 5 + tests/exec3.sub | 6 + tests/exec4.sub | 8 + tests/exec5.sub | 9 + tests/exec6.sub | 54 + tests/exec7.sub | 20 + tests/exec8.sub | 1 + tests/exec9.sub | 20 + tests/execscript | 127 + tests/exp.right | 207 + tests/exp.tests | 392 + tests/exp1.sub | 21 + tests/exp2.sub | 12 + tests/exp3.sub | 7 + tests/exp4.sub | 10 + tests/exp5.sub | 22 + tests/exp6.sub | 30 + tests/extglob.right | 94 + tests/extglob.tests | 373 + tests/extglob1.sub | 37 + tests/extglob1a.sub | 16 + tests/extglob2.right | 70 + tests/extglob2.tests | 90 + tests/extglob3.right | 27 + tests/extglob3.tests | 56 + tests/func.right | 169 + tests/func.tests | 179 + tests/func1.sub | 55 + tests/func2.sub | 27 + tests/func3.sub | 54 + tests/func4.sub | 39 + tests/getopts.right | 56 + tests/getopts.tests | 38 + tests/getopts1.sub | 26 + tests/getopts2.sub | 26 + tests/getopts3.sub | 27 + tests/getopts4.sub | 30 + tests/getopts5.sub | 50 + tests/getopts6.sub | 27 + tests/getopts7.sub | 30 + tests/glob.right | 135 + tests/glob.tests | 388 + tests/glob1.sub | 14 + tests/globstar.right | 585 + tests/globstar.tests | 42 + tests/globstar1.sub | 21 + tests/globstar2.sub | 80 + tests/heredoc.right | 91 + tests/heredoc.tests | 105 + tests/heredoc1.sub | 16 + tests/heredoc2.sub | 9 + tests/heredoc3.sub | 74 + tests/herestr.right | 28 + tests/herestr.tests | 39 + tests/histexp.right | 129 + tests/histexp.tests | 124 + tests/history.list | 4 + tests/history.right | 146 + tests/history.tests | 114 + tests/history1.sub | 15 + tests/history2.sub | 10 + tests/ifs-posix.right | 1 + tests/ifs-posix.tests | 257 + tests/ifs.right | 10 + tests/ifs.tests | 61 + tests/input-line.sh | 4 + tests/input-line.sub | 2 + tests/input.right | 3 + tests/intl.right | 51 + tests/intl.tests | 50 + tests/intl1.sub | 11 + tests/intl2.sub | 11 + tests/invert.right | 10 + tests/invert.tests | 19 + tests/iquote.right | 92 + tests/iquote.tests | 145 + tests/iquote1.sub | 43 + tests/jobs.right | 108 + tests/jobs.tests | 188 + tests/jobs1.sub | 17 + tests/jobs2.sub | 13 + tests/jobs3.sub | 26 + tests/jobs4.sub | 24 + tests/jobs5.sub | 12 + tests/lastpipe.right | 10 + tests/lastpipe.tests | 58 + tests/lastpipe1.sub | 5 + tests/mapfile.data | 17 + tests/mapfile.right | 164 + tests/mapfile.tests | 42 + tests/mapfile1.sub | 11 + tests/misc/dev-tcp.tests | 16 + tests/misc/perf-script | 81 + tests/misc/perftest | 10 + tests/misc/read-nchars.tests | 11 + tests/misc/redir-t2.sh | 17 + tests/misc/run-r2.sh | 1 + tests/misc/sigint-1.sh | 9 + tests/misc/sigint-2.sh | 7 + tests/misc/sigint-3.sh | 11 + tests/misc/sigint-4.sh | 13 + tests/misc/test-minus-e.1 | 9 + tests/misc/test-minus-e.2 | 11 + tests/misc/wait-bg.tests | 25 + tests/more-exp.right | 214 + tests/more-exp.tests | 504 + tests/nameref.right | 129 + tests/nameref.tests | 118 + tests/nameref1.sub | 13 + tests/nameref2.sub | 7 + tests/nameref3.sub | 37 + tests/nameref4.sub | 212 + tests/nameref5.sub | 50 + tests/nameref6.sub | 44 + tests/nameref7.sub | 18 + tests/nameref8.sub | 57 + tests/new-exp.right | 575 + tests/new-exp.tests | 584 + tests/new-exp1.sub | 11 + tests/new-exp2.sub | 42 + tests/new-exp3.sub | 26 + tests/new-exp4.sub | 31 + tests/new-exp5.sub | 40 + tests/new-exp6.sub | 29 + tests/new-exp7.sub | 13 + tests/new-exp8.sub | 95 + tests/new-exp9.sub | 31 + tests/nquote.right | 58 + tests/nquote.tests | 119 + tests/nquote1.right | 121 + tests/nquote1.sub | 6 + tests/nquote1.tests | 97 + tests/nquote2.right | 76 + tests/nquote2.sub | 29 + tests/nquote2.tests | 82 + tests/nquote3.right | 60 + tests/nquote3.tests | 85 + tests/nquote4.right | 18 + tests/nquote4.tests | 24 + tests/nquote5.right | 86 + tests/nquote5.tests | 63 + tests/posix2.right | 2 + tests/posix2.tests | 179 + tests/posixexp.right | 41 + tests/posixexp.tests | 77 + tests/posixexp1.sub | 30 + tests/posixexp2.right | 40 + tests/posixexp2.sub | 21 + tests/posixexp2.tests | 47 + tests/posixpat.right | 42 + tests/posixpat.tests | 233 + tests/posixpipe.right | 41 + tests/posixpipe.tests | 43 + tests/prec.right | 28 + tests/precedence | 75 + tests/printf.right | 297 + tests/printf.tests | 319 + tests/printf1.sub | 335 + tests/printf2.sub | 7 + tests/printf3.sub | 62 + tests/printf4.sub | 69 + tests/quote.right | 82 + tests/quote.tests | 112 + tests/quote1.sub | 49 + tests/read.right | 66 + tests/read.tests | 98 + tests/read1.sub | 23 + tests/read2.sub | 32 + tests/read3.sub | 24 + tests/read4.sub | 4 + tests/read5.sub | 35 + tests/read6.sub | 10 + tests/redir.right | 142 + tests/redir.tests | 191 + tests/redir1.sub | 8 + tests/redir10.sub | 25 + tests/redir2.sub | 1 + tests/redir3.in1 | 2 + tests/redir3.in2 | 2 + tests/redir3.sub | 26 + tests/redir4.in1 | 1 + tests/redir4.sub | 56 + tests/redir5.sub | 31 + tests/redir6.sub | 8 + tests/redir7.sub | 69 + tests/redir8.sub | 59 + tests/redir9.sub | 50 + tests/rhs-exp.right | 105 + tests/rhs-exp.tests | 51 + tests/rhs-exp1.sub | 103 + tests/rsh.right | 13 + tests/rsh.tests | 33 + tests/run-alias | 2 + tests/run-all | 29 + tests/run-appendop | 2 + tests/run-arith | 2 + tests/run-arith-for | 2 + tests/run-array | 6 + tests/run-array2 | 4 + tests/run-assoc | 4 + tests/run-braces | 2 + tests/run-builtins | 6 + tests/run-case | 2 + tests/run-casemod | 2 + tests/run-comsub | 2 + tests/run-comsub-eof | 2 + tests/run-comsub-posix | 2 + tests/run-cond | 7 + tests/run-coproc | 4 + tests/run-cprint | 2 + tests/run-dbg-support | 11 + tests/run-dbg-support2 | 16 + tests/run-dirstack | 5 + tests/run-dollars | 2 + tests/run-errors | 2 + tests/run-execscript | 9 + tests/run-exp-tests | 2 + tests/run-extglob | 4 + tests/run-extglob2 | 4 + tests/run-extglob3 | 4 + tests/run-func | 5 + tests/run-getopts | 2 + tests/run-glob-test | 4 + tests/run-globstar | 4 + tests/run-heredoc | 6 + tests/run-herestr | 2 + tests/run-histexpand | 4 + tests/run-history | 4 + tests/run-ifs | 2 + tests/run-ifs-posix | 2 + tests/run-input-test | 2 + tests/run-intl | 8 + tests/run-invert | 2 + tests/run-iquote | 2 + tests/run-jobs | 7 + tests/run-lastpipe | 2 + tests/run-mapfile | 2 + tests/run-minimal | 36 + tests/run-more-exp | 2 + tests/run-nameref | 4 + tests/run-new-exp | 10 + tests/run-nquote | 2 + tests/run-nquote1 | 4 + tests/run-nquote2 | 4 + tests/run-nquote3 | 4 + tests/run-nquote4 | 4 + tests/run-nquote5 | 2 + tests/run-posix2 | 2 + tests/run-posixexp | 2 + tests/run-posixexp2 | 2 + tests/run-posixpat | 2 + tests/run-posixpipe | 2 + tests/run-precedence | 2 + tests/run-printf | 7 + tests/run-quote | 2 + tests/run-read | 4 + tests/run-redir | 7 + tests/run-rhs-exp | 2 + tests/run-rsh | 2 + tests/run-set-e | 2 + tests/run-set-x | 11 + tests/run-shopt | 2 + tests/run-strip | 2 + tests/run-test | 4 + tests/run-tilde | 2 + tests/run-tilde2 | 2 + tests/run-trap | 6 + tests/run-type | 2 + tests/run-varenv | 2 + tests/run-vredir | 2 + tests/set-e.right | 72 + tests/set-e.tests | 111 + tests/set-e1.sub | 59 + tests/set-e2.sub | 10 + tests/set-e3.sub | 10 + tests/set-e3a.sub | 7 + tests/set-x.right | 56 + tests/set-x.tests | 20 + tests/set-x1.sub | 25 + tests/shopt.right | 276 + tests/shopt.tests | 94 + tests/source1.sub | 1 + tests/source2.sub | 5 + tests/source3.sub | 1 + tests/source4.sub | 1 + tests/source5.sub | 19 + tests/source6.sub | 31 + tests/source7.sub | 40 + tests/strip.right | 12 + tests/strip.tests | 22 + tests/test.right | 291 + tests/test.tests | 438 + tests/tilde.right | 26 + tests/tilde.tests | 71 + tests/tilde2.right | 24 + tests/tilde2.tests | 70 + tests/trap.right | 104 + tests/trap.tests | 97 + tests/trap1.sub | 4 + tests/trap2.sub | 25 + tests/trap2a.sub | 3 + tests/trap3.sub | 9 + tests/trap4.sub | 42 + tests/trap5.sub | 18 + tests/type.right | 135 + tests/type.tests | 97 + tests/type1.sub | 10 + tests/type2.sub | 16 + tests/type3.sub | 18 + tests/type4.sub | 43 + tests/unicode1.sub | 583 + tests/unicode2.sub | 22 + tests/unicode3.sub | 7 + tests/varenv.right | 71 + tests/varenv.sh | 219 + tests/varenv1.sub | 28 + tests/varenv2.sub | 44 + tests/varenv3.sub | 32 + tests/varenv4.sub | 44 + tests/varenv5.sub | 16 + tests/varenv6.sub | 28 + tests/version | 8 + tests/version.mini | 8 + tests/vredir.right | 92 + tests/vredir.tests | 46 + tests/vredir1.sub | 17 + tests/vredir2.sub | 52 + tests/vredir3.sub | 8 + tests/vredir4.sub | 22 + tests/vredir5.sub | 23 + tests/vredir6.sub | 14 + trap.c | 1265 + trap.h | 113 + unwind_prot.c | 357 + unwind_prot.h | 49 + variables.c | 5325 ++++ variables.h | 413 + version.c | 94 + xmalloc.c | 223 + xmalloc.h | 58 + y.tab.c | 8542 +++++++ y.tab.h | 164 + 1316 files changed, 855686 insertions(+) create mode 100644 .pc/.quilt_patches create mode 100644 .pc/.quilt_series create mode 100644 .pc/.version create mode 100644 .pc/applied-patches create mode 100644 .pc/bash-aliases-repeat.diff/examples/startup-files/Bash_aliases create mode 100644 .pc/bash-default-editor.diff/bashline.c create mode 100644 .pc/bash-default-editor.diff/builtins/fc.def create mode 100644 .pc/bash-subst-param-length.diff/subst.c create mode 100644 .pc/bash43-001.diff/patchlevel.h create mode 100644 .pc/bash43-001.diff/test.c create mode 100644 .pc/bash43-002.diff/patchlevel.h create mode 100644 .pc/bash43-002.diff/trap.c create mode 100644 .pc/bash43-003.diff/lib/readline/readline.c create mode 100644 .pc/bash43-003.diff/patchlevel.h create mode 100644 .pc/bash43-004.diff/lib/readline/readline.c create mode 100644 .pc/bash43-004.diff/patchlevel.h create mode 100644 .pc/bash43-005.diff/parse.y create mode 100644 .pc/bash43-005.diff/patchlevel.h create mode 100644 .pc/bash43-005.diff/y.tab.c create mode 100644 .pc/bash43-006.diff/jobs.c create mode 100644 .pc/bash43-006.diff/patchlevel.h create mode 100644 .pc/bash43-007.diff/arrayfunc.c create mode 100644 .pc/bash43-007.diff/patchlevel.h create mode 100644 .pc/bash43-008.diff/lib/glob/glob.c create mode 100644 .pc/bash43-008.diff/lib/glob/gmisc.c create mode 100644 .pc/bash43-008.diff/patchlevel.h create mode 100644 .pc/bash43-009.diff/parse.y create mode 100644 .pc/bash43-009.diff/patchlevel.h create mode 100644 .pc/bash43-009.diff/y.tab.c create mode 100644 .pc/bash43-010.diff/externs.h create mode 100644 .pc/bash43-010.diff/lib/sh/shquote.c create mode 100644 .pc/bash43-010.diff/patchlevel.h create mode 100644 .pc/bash43-010.diff/pcomplete.c create mode 100644 .pc/bash43-011.diff/lib/readline/display.c create mode 100644 .pc/bash43-011.diff/patchlevel.h create mode 100644 .pc/bash43-012.diff/jobs.c create mode 100644 .pc/bash43-012.diff/patchlevel.h create mode 100644 .pc/bash43-013.diff/lib/readline/display.c create mode 100644 .pc/bash43-013.diff/patchlevel.h create mode 100644 .pc/bash43-014.diff/patchlevel.h create mode 100644 .pc/bash43-014.diff/subst.c create mode 100644 .pc/bash43-015.diff/bashline.c create mode 100644 .pc/bash43-015.diff/patchlevel.h create mode 100644 .pc/bash43-016.diff/lib/glob/glob.c create mode 100644 .pc/bash43-016.diff/lib/glob/gmisc.c create mode 100644 .pc/bash43-016.diff/patchlevel.h create mode 100644 .pc/bash43-017.diff/patchlevel.h create mode 100644 .pc/bash43-017.diff/variables.c create mode 100644 .pc/bash43-018.diff/arrayfunc.c create mode 100644 .pc/bash43-018.diff/patchlevel.h create mode 100644 .pc/bash43-019.diff/builtins/read.def create mode 100644 .pc/bash43-019.diff/lib/readline/input.c create mode 100644 .pc/bash43-019.diff/patchlevel.h create mode 100644 .pc/bash43-020.diff/parse.y create mode 100644 .pc/bash43-020.diff/patchlevel.h create mode 100644 .pc/bash43-020.diff/shell.h create mode 100644 .pc/bash43-020.diff/y.tab.c create mode 100644 .pc/bash43-021.diff/lib/readline/misc.c create mode 100644 .pc/bash43-021.diff/patchlevel.h create mode 100644 .pc/bash43-022.diff/execute_cmd.c create mode 100644 .pc/bash43-022.diff/patchlevel.h create mode 100644 .pc/bash43-023.diff/patchlevel.h create mode 100644 .pc/bash43-023.diff/subst.c create mode 100644 .pc/bash43-023.diff/subst.h create mode 100644 .pc/bash43-024.diff/patchlevel.h create mode 100644 .pc/bash43-024.diff/subst.c create mode 100644 .pc/bash43-025.diff/builtins/common.h create mode 100644 .pc/bash43-025.diff/builtins/evalstring.c create mode 100644 .pc/bash43-025.diff/patchlevel.h create mode 100644 .pc/bash43-025.diff/subst.c create mode 100644 .pc/bash43-025.diff/variables.c create mode 100644 .pc/bashbug-editor.diff/support/bashbug.sh create mode 100644 .pc/bzero.diff/lib/sh/oslib.c create mode 100644 .pc/deb-bash-config.diff/config-bot.h create mode 100644 .pc/deb-bash-config.diff/config-top.h create mode 100644 .pc/deb-examples.diff/examples/loadables/README create mode 100644 .pc/exec-redirections-doc.diff/doc/bash.1 create mode 100644 .pc/exec-redirections-doc.diff/doc/bashref.texi create mode 100644 .pc/input-err.diff/input.c create mode 100644 .pc/man-arithmetic.diff/doc/bash.1 create mode 100644 .pc/man-bashlogout.diff/doc/bash.1 create mode 100644 .pc/man-bashrc.diff/doc/bash.1 create mode 100644 .pc/man-fignore.diff/doc/bash.1 create mode 100644 .pc/man-nocaseglob.diff/doc/bash.1 create mode 100644 .pc/man-test.diff/builtins/test.def create mode 100644 .pc/man-test2.diff/builtins/test.def create mode 100644 .pc/man-test2.diff/doc/bash.1 create mode 100644 .pc/man-test2.diff/doc/bashref.texi create mode 100644 .pc/pgrp-pipe.diff/config-bot.h create mode 100644 .pc/privmode.diff/shell.c create mode 100644 .pc/rbash-manpage.diff/doc/rbash.1 create mode 100644 .pc/use-system-texi2html.diff/doc/Makefile.in create mode 100644 ABOUT-NLS create mode 100644 AUTHORS create mode 100644 CHANGES create mode 100644 COMPAT create mode 100644 COPYING create mode 100644 CWRU/PLATFORMS create mode 100644 CWRU/README create mode 100644 CWRU/changelog create mode 100755 CWRU/misc/bison create mode 100644 CWRU/misc/errlist.c create mode 100644 CWRU/misc/hpux10-dlfcn.h create mode 100644 CWRU/misc/open-files.c create mode 100644 CWRU/misc/sigs.c create mode 100644 CWRU/misc/sigstat.c create mode 100644 CWRU/sh-redir-hack create mode 120000 ChangeLog create mode 100644 INSTALL create mode 100644 MANIFEST create mode 100644 Makefile.in create mode 100644 NEWS create mode 100644 NOTES create mode 100644 POSIX create mode 100644 RBASH create mode 100644 README create mode 100644 Y2K create mode 100644 aclocal.m4 create mode 100644 alias.c create mode 100644 alias.h create mode 100644 array.c create mode 100644 array.h create mode 100644 arrayfunc.c create mode 100644 arrayfunc.h create mode 100644 assoc.c create mode 100644 assoc.h create mode 100644 bashansi.h create mode 100644 bashhist.c create mode 100644 bashhist.h create mode 100644 bashintl.h create mode 100644 bashjmp.h create mode 100644 bashline.c create mode 100644 bashline.h create mode 100644 bashtypes.h create mode 100644 bracecomp.c create mode 100644 braces.c create mode 100644 builtins.h create mode 100644 builtins/Makefile.in create mode 100644 builtins/alias.def create mode 100644 builtins/bashgetopt.c create mode 100644 builtins/bashgetopt.h create mode 100644 builtins/bind.def create mode 100644 builtins/break.def create mode 100644 builtins/builtin.def create mode 100644 builtins/caller.def create mode 100644 builtins/cd.def create mode 100644 builtins/colon.def create mode 100644 builtins/command.def create mode 100644 builtins/common.c create mode 100644 builtins/common.h create mode 100644 builtins/complete.def create mode 100644 builtins/declare.def create mode 100644 builtins/echo.def create mode 100644 builtins/enable.def create mode 100644 builtins/eval.def create mode 100644 builtins/evalfile.c create mode 100644 builtins/evalstring.c create mode 100644 builtins/exec.def create mode 100644 builtins/exit.def create mode 100644 builtins/fc.def create mode 100644 builtins/fg_bg.def create mode 100644 builtins/gen-helpfiles.c create mode 100644 builtins/getopt.c create mode 100644 builtins/getopt.h create mode 100644 builtins/getopts.def create mode 100644 builtins/hash.def create mode 100644 builtins/help.def create mode 100644 builtins/history.def create mode 100644 builtins/inlib.def create mode 100644 builtins/jobs.def create mode 100644 builtins/kill.def create mode 100644 builtins/let.def create mode 100644 builtins/mapfile.def create mode 100644 builtins/mkbuiltins.c create mode 100644 builtins/printf.def create mode 100644 builtins/psize.c create mode 100644 builtins/psize.sh create mode 100644 builtins/pushd.def create mode 100644 builtins/read.def create mode 100644 builtins/reserved.def create mode 100644 builtins/return.def create mode 100644 builtins/set.def create mode 100644 builtins/setattr.def create mode 100644 builtins/shift.def create mode 100644 builtins/shopt.def create mode 100644 builtins/source.def create mode 100644 builtins/suspend.def create mode 100644 builtins/test.def create mode 100644 builtins/times.def create mode 100644 builtins/trap.def create mode 100644 builtins/type.def create mode 100644 builtins/ulimit.def create mode 100644 builtins/umask.def create mode 100644 builtins/wait.def create mode 100644 command.h create mode 100644 config-bot.h create mode 100644 config-top.h create mode 100644 config.h.in create mode 100755 configure create mode 100644 configure.ac create mode 100644 conftypes.h create mode 100644 copy_cmd.c create mode 100644 cross-build/cygwin32.cache create mode 100644 cross-build/opennt.cache create mode 100644 cross-build/x86-beos.cache create mode 100644 debian/FAQ create mode 100644 debian/README create mode 100644 debian/README.abs-guide create mode 100644 debian/README.bash_completion create mode 100644 debian/README.commands create mode 100644 debian/bash-builtins.7 create mode 100644 debian/bash-doc.doc-base.bash create mode 100644 debian/bash-doc.doc-base.bashref create mode 100644 debian/bash-static.overrides create mode 100644 debian/bash-static.postinst create mode 100644 debian/bash-static.postrm create mode 100644 debian/bash.menu create mode 100644 debian/bash.overrides create mode 100644 debian/bash.postinst create mode 100644 debian/bash.postrm create mode 100644 debian/bash.preinst-lib.c create mode 100644 debian/bash.preinst.c create mode 100644 debian/bash.preinst.h create mode 100644 debian/bash.prerm create mode 100644 debian/bashbug.1 create mode 100644 debian/changelog create mode 100644 debian/clear_console.1 create mode 100644 debian/clear_console.c create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/etc.bash.bashrc create mode 100644 debian/etc.inputrc create mode 100644 debian/etc.profile create mode 100644 debian/inputrc.arrows create mode 100644 debian/locale-gen create mode 100644 debian/patches/bash-aliases-repeat.diff create mode 100644 debian/patches/bash-default-editor.diff create mode 100644 debian/patches/bash-minimal.dpatch create mode 100644 debian/patches/bash-subst-param-length.diff create mode 100644 debian/patches/bash43-001.diff create mode 100644 debian/patches/bash43-002.diff create mode 100644 debian/patches/bash43-003.diff create mode 100644 debian/patches/bash43-004.diff create mode 100644 debian/patches/bash43-005.diff create mode 100644 debian/patches/bash43-006.diff create mode 100644 debian/patches/bash43-007.diff create mode 100644 debian/patches/bash43-008.diff create mode 100644 debian/patches/bash43-009.diff create mode 100644 debian/patches/bash43-010.diff create mode 100644 debian/patches/bash43-011.diff create mode 100644 debian/patches/bash43-012.diff create mode 100644 debian/patches/bash43-013.diff create mode 100644 debian/patches/bash43-014.diff create mode 100644 debian/patches/bash43-015.diff create mode 100644 debian/patches/bash43-016.diff create mode 100644 debian/patches/bash43-017.diff create mode 100644 debian/patches/bash43-018.diff create mode 100644 debian/patches/bash43-019.diff create mode 100644 debian/patches/bash43-020.diff create mode 100644 debian/patches/bash43-021.diff create mode 100644 debian/patches/bash43-022.diff create mode 100644 debian/patches/bash43-023.diff create mode 100644 debian/patches/bash43-024.diff create mode 100644 debian/patches/bash43-025.diff create mode 100644 debian/patches/bashbug-editor.diff create mode 100644 debian/patches/bzero.diff create mode 100644 debian/patches/deb-bash-config.diff create mode 100644 debian/patches/deb-examples.diff create mode 100644 debian/patches/exec-redirections-doc.diff create mode 100644 debian/patches/input-err.diff create mode 100644 debian/patches/man-arithmetic.diff create mode 100644 debian/patches/man-bash.diff create mode 100644 debian/patches/man-bashlogout.diff create mode 100644 debian/patches/man-bashrc.diff create mode 100644 debian/patches/man-builtin.dpatch create mode 100644 debian/patches/man-fignore.diff create mode 100644 debian/patches/man-nocaseglob.diff create mode 100644 debian/patches/man-test.diff create mode 100644 debian/patches/man-test2.diff create mode 100644 debian/patches/man-vx-opts.dpatch create mode 100644 debian/patches/no-brk-caching.diff create mode 100644 debian/patches/pgrp-pipe.diff create mode 100644 debian/patches/privmode.diff create mode 100644 debian/patches/random.dpatch create mode 100644 debian/patches/rbash-manpage.diff create mode 100644 debian/patches/rl-del-backspace-policy.dpatch create mode 100644 debian/patches/rl-examples-bdb.dpatch create mode 100644 debian/patches/rl-header.dpatch create mode 100644 debian/patches/rl-setenv.dpatch create mode 100644 debian/patches/series create mode 100644 debian/patches/use-system-texi2html.diff create mode 100755 debian/rules create mode 100644 debian/run-my-gprof create mode 100644 debian/skel.bash_logout create mode 100644 debian/skel.bashrc create mode 100644 debian/skel.profile create mode 100644 debian/source/format create mode 100644 debian/source/lintian-overrides create mode 100644 debian/watch create mode 100644 dispose_cmd.c create mode 100644 dispose_cmd.h create mode 100644 doc/INTRO create mode 100644 doc/Makefile.in create mode 100644 doc/README create mode 100644 doc/bash.0 create mode 100644 doc/bash.1 create mode 100644 doc/bash.html create mode 100644 doc/bash.pdf create mode 100644 doc/bash.ps create mode 100644 doc/bashbug.0 create mode 100644 doc/bashbug.1 create mode 100644 doc/bashbug.ps create mode 100644 doc/bashref.dvi create mode 100644 doc/bashref.html create mode 100644 doc/bashref.info create mode 100644 doc/bashref.pdf create mode 100644 doc/bashref.ps create mode 100644 doc/bashref.texi create mode 100644 doc/builtins.0 create mode 100644 doc/builtins.1 create mode 100644 doc/builtins.ps create mode 100644 doc/fdl.texi create mode 100644 doc/fdl.txt create mode 100755 doc/htmlpost.sh create mode 100755 doc/infopost.sh create mode 100644 doc/rbash.0 create mode 100644 doc/rbash.1 create mode 100644 doc/rbash.ps create mode 100644 doc/texinfo.tex create mode 100644 doc/version.texi create mode 100644 error.c create mode 100644 error.h create mode 100644 eval.c create mode 100644 examples/INDEX.html create mode 100644 examples/INDEX.txt create mode 100644 examples/complete/bash_completion create mode 100644 examples/complete/bashcc-1.0.1.tar.gz create mode 100644 examples/complete/cdfunc create mode 100644 examples/complete/complete-examples create mode 100644 examples/functions/array-stuff create mode 100644 examples/functions/array-to-string create mode 100644 examples/functions/autoload create mode 100644 examples/functions/autoload.v2 create mode 100644 examples/functions/autoload.v3 create mode 100644 examples/functions/basename create mode 100644 examples/functions/csh-compat create mode 100644 examples/functions/dirname create mode 100644 examples/functions/exitstat create mode 100644 examples/functions/external create mode 100644 examples/functions/fact create mode 100644 examples/functions/fstty create mode 100644 examples/functions/func create mode 100644 examples/functions/inetaddr create mode 100644 examples/functions/inpath create mode 100644 examples/functions/isnum2 create mode 100644 examples/functions/isvalidip create mode 100644 examples/functions/ksh-cd create mode 100644 examples/functions/ksh-compat-test create mode 100644 examples/functions/kshenv create mode 100644 examples/functions/login create mode 100644 examples/functions/notify.bash create mode 100644 examples/functions/seq create mode 100644 examples/functions/seq2 create mode 100644 examples/functions/shcat create mode 100644 examples/functions/shcat2 create mode 100644 examples/functions/sort-pos-params create mode 100644 examples/functions/substr create mode 100644 examples/functions/substr2 create mode 100644 examples/functions/whatis create mode 100644 examples/functions/whence create mode 100644 examples/functions/which create mode 100644 examples/loadables/Makefile.in create mode 100644 examples/loadables/README create mode 100644 examples/loadables/basename.c create mode 100644 examples/loadables/cat.c create mode 100644 examples/loadables/dirname.c create mode 100644 examples/loadables/finfo.c create mode 100644 examples/loadables/head.c create mode 100644 examples/loadables/hello.c create mode 100644 examples/loadables/id.c create mode 100644 examples/loadables/ln.c create mode 100644 examples/loadables/logname.c create mode 100644 examples/loadables/mkdir.c create mode 100644 examples/loadables/mypid.c create mode 100644 examples/loadables/necho.c create mode 100644 examples/loadables/pathchk.c create mode 100644 examples/loadables/perl/Makefile.in create mode 100644 examples/loadables/perl/README create mode 100644 examples/loadables/perl/bperl.c create mode 100644 examples/loadables/perl/iperl.c create mode 100644 examples/loadables/print.c create mode 100644 examples/loadables/printenv.c create mode 100644 examples/loadables/push.c create mode 100644 examples/loadables/realpath.c create mode 100644 examples/loadables/rmdir.c create mode 100644 examples/loadables/sleep.c create mode 100644 examples/loadables/strftime.c create mode 100644 examples/loadables/sync.c create mode 100644 examples/loadables/tee.c create mode 100644 examples/loadables/template.c create mode 100644 examples/loadables/truefalse.c create mode 100644 examples/loadables/tty.c create mode 100644 examples/loadables/uname.c create mode 100644 examples/loadables/unlink.c create mode 100644 examples/loadables/whoami.c create mode 100755 examples/misc/aliasconv.bash create mode 100755 examples/misc/aliasconv.sh create mode 100755 examples/misc/cshtobash create mode 100644 examples/scripts/cat.sh create mode 100644 examples/scripts/center create mode 100755 examples/scripts/inpath create mode 100755 examples/scripts/shprompt create mode 100644 examples/scripts/spin.bash create mode 100755 examples/scripts/xterm_title create mode 100755 examples/scripts/zprintf create mode 100644 examples/startup-files/Bash_aliases create mode 100644 examples/startup-files/Bash_profile create mode 100644 examples/startup-files/Bashrc.bfox create mode 100644 examples/startup-files/README create mode 100644 examples/startup-files/bash-profile create mode 100644 examples/startup-files/bashrc create mode 100644 execute_cmd.c create mode 100644 execute_cmd.h create mode 100644 expr.c create mode 100644 externs.h create mode 100644 findcmd.c create mode 100644 findcmd.h create mode 100644 flags.c create mode 100644 flags.h create mode 100644 general.c create mode 100644 general.h create mode 100644 hashcmd.c create mode 100644 hashcmd.h create mode 100644 hashlib.c create mode 100644 hashlib.h create mode 100644 include/ansi_stdlib.h create mode 100644 include/chartypes.h create mode 100644 include/filecntl.h create mode 100644 include/gettext.h create mode 100644 include/maxpath.h create mode 100644 include/memalloc.h create mode 100644 include/ocache.h create mode 100644 include/posixdir.h create mode 100644 include/posixjmp.h create mode 100644 include/posixselect.h create mode 100644 include/posixstat.h create mode 100644 include/posixtime.h create mode 100644 include/posixwait.h create mode 100644 include/shmbchar.h create mode 100644 include/shmbutil.h create mode 100644 include/shtty.h create mode 100644 include/stat-time.h create mode 100644 include/stdc.h create mode 100644 include/systimes.h create mode 100644 include/typemax.h create mode 100644 include/unionwait.h create mode 100644 input.c create mode 100644 input.h create mode 100644 jobs.c create mode 100644 jobs.h create mode 100644 lib/glob/Makefile.in create mode 100644 lib/glob/collsyms.h create mode 100644 lib/glob/doc/Makefile create mode 100644 lib/glob/doc/glob.texi create mode 100644 lib/glob/glob.c create mode 100644 lib/glob/glob.h create mode 100644 lib/glob/glob_loop.c create mode 100644 lib/glob/gmisc.c create mode 100644 lib/glob/ndir.h create mode 100644 lib/glob/sm_loop.c create mode 100644 lib/glob/smatch.c create mode 100644 lib/glob/strmatch.c create mode 100644 lib/glob/strmatch.h create mode 100644 lib/glob/xmbsrtowcs.c create mode 100644 lib/intl/ChangeLog create mode 100644 lib/intl/Makefile.in create mode 100644 lib/intl/VERSION create mode 100644 lib/intl/bindtextdom.c create mode 100644 lib/intl/config.charset create mode 100644 lib/intl/dcgettext.c create mode 100644 lib/intl/dcigettext.c create mode 100644 lib/intl/dcngettext.c create mode 100644 lib/intl/dgettext.c create mode 100644 lib/intl/dngettext.c create mode 100644 lib/intl/eval-plural.h create mode 100644 lib/intl/explodename.c create mode 100644 lib/intl/finddomain.c create mode 100644 lib/intl/gettext.c create mode 100644 lib/intl/gettextP.h create mode 100644 lib/intl/gmo.h create mode 100644 lib/intl/hash-string.h create mode 100644 lib/intl/intl-compat.c create mode 100644 lib/intl/l10nflist.c create mode 100644 lib/intl/libgnuintl.h.in create mode 100644 lib/intl/loadinfo.h create mode 100644 lib/intl/loadmsgcat.c create mode 100644 lib/intl/localcharset.c create mode 100644 lib/intl/localcharset.h create mode 100644 lib/intl/locale.alias create mode 100644 lib/intl/localealias.c create mode 100644 lib/intl/localename.c create mode 100644 lib/intl/log.c create mode 100644 lib/intl/ngettext.c create mode 100644 lib/intl/os2compat.c create mode 100644 lib/intl/os2compat.h create mode 100644 lib/intl/osdep.c create mode 100644 lib/intl/plural-exp.c create mode 100644 lib/intl/plural-exp.h create mode 100644 lib/intl/plural.c create mode 100644 lib/intl/plural.y create mode 100755 lib/intl/ref-add.sin create mode 100755 lib/intl/ref-del.sin create mode 100644 lib/intl/relocatable.c create mode 100644 lib/intl/relocatable.h create mode 100644 lib/intl/textdomain.c create mode 100644 lib/malloc/Makefile.in create mode 100644 lib/malloc/alloca.c create mode 100644 lib/malloc/getpagesize.h create mode 100644 lib/malloc/i386-alloca.s create mode 100644 lib/malloc/imalloc.h create mode 100644 lib/malloc/malloc.c create mode 100644 lib/malloc/mstats.h create mode 100644 lib/malloc/shmalloc.h create mode 100644 lib/malloc/stats.c create mode 100644 lib/malloc/stub.c create mode 100644 lib/malloc/table.c create mode 100644 lib/malloc/table.h create mode 100644 lib/malloc/trace.c create mode 100644 lib/malloc/watch.c create mode 100644 lib/malloc/watch.h create mode 100644 lib/malloc/x386-alloca.s create mode 100755 lib/malloc/xleaktrace create mode 100644 lib/malloc/xmalloc.c create mode 100644 lib/readline/COPYING create mode 100644 lib/readline/ChangeLog create mode 100644 lib/readline/Makefile.in create mode 100644 lib/readline/README create mode 100644 lib/readline/STANDALONE create mode 100644 lib/readline/ansi_stdlib.h create mode 100644 lib/readline/bind.c create mode 100644 lib/readline/callback.c create mode 100644 lib/readline/chardefs.h create mode 100644 lib/readline/colors.c create mode 100644 lib/readline/colors.h create mode 100644 lib/readline/compat.c create mode 100644 lib/readline/complete.c create mode 100644 lib/readline/display.c create mode 100644 lib/readline/doc/Makefile create mode 100644 lib/readline/doc/fdl.texi create mode 100644 lib/readline/doc/history.texi create mode 100644 lib/readline/doc/hstech.texi create mode 100644 lib/readline/doc/hsuser.texi create mode 100644 lib/readline/doc/rlman.texi create mode 100644 lib/readline/doc/rltech.texi create mode 100644 lib/readline/doc/rluser.texi create mode 100644 lib/readline/doc/rluserman.texi create mode 100644 lib/readline/doc/version.texi create mode 100644 lib/readline/emacs_keymap.c create mode 100644 lib/readline/examples/Inputrc create mode 100644 lib/readline/examples/Makefile create mode 100644 lib/readline/examples/excallback.c create mode 100644 lib/readline/examples/fileman.c create mode 100644 lib/readline/examples/histexamp.c create mode 100644 lib/readline/examples/manexamp.c create mode 100644 lib/readline/examples/rl-callbacktest.c create mode 100644 lib/readline/examples/rl.c create mode 100644 lib/readline/examples/rlcat.c create mode 100644 lib/readline/examples/rltest.c create mode 100644 lib/readline/funmap.c create mode 100644 lib/readline/histexpand.c create mode 100644 lib/readline/histfile.c create mode 100644 lib/readline/histlib.h create mode 100644 lib/readline/history.c create mode 100644 lib/readline/history.h create mode 100644 lib/readline/histsearch.c create mode 100644 lib/readline/input.c create mode 100644 lib/readline/isearch.c create mode 100644 lib/readline/keymaps.c create mode 100644 lib/readline/keymaps.h create mode 100644 lib/readline/kill.c create mode 100644 lib/readline/macro.c create mode 100644 lib/readline/mbutil.c create mode 100644 lib/readline/misc.c create mode 100644 lib/readline/nls.c create mode 100644 lib/readline/parens.c create mode 100644 lib/readline/parse-colors.c create mode 100644 lib/readline/parse-colors.h create mode 100644 lib/readline/posixdir.h create mode 100644 lib/readline/posixjmp.h create mode 100644 lib/readline/posixselect.h create mode 100644 lib/readline/posixstat.h create mode 100644 lib/readline/readline.c create mode 100644 lib/readline/readline.h create mode 100644 lib/readline/rlconf.h create mode 100644 lib/readline/rldefs.h create mode 100644 lib/readline/rlmbutil.h create mode 100644 lib/readline/rlprivate.h create mode 100644 lib/readline/rlshell.h create mode 100644 lib/readline/rlstdc.h create mode 100644 lib/readline/rltty.c create mode 100644 lib/readline/rltty.h create mode 100644 lib/readline/rltypedefs.h create mode 100644 lib/readline/rlwinsize.h create mode 100644 lib/readline/savestring.c create mode 100644 lib/readline/search.c create mode 100644 lib/readline/shell.c create mode 100644 lib/readline/signals.c create mode 100644 lib/readline/tcap.h create mode 100644 lib/readline/terminal.c create mode 100644 lib/readline/text.c create mode 100644 lib/readline/tilde.c create mode 100644 lib/readline/tilde.h create mode 100644 lib/readline/undo.c create mode 100644 lib/readline/util.c create mode 100644 lib/readline/vi_keymap.c create mode 100644 lib/readline/vi_mode.c create mode 100644 lib/readline/xfree.c create mode 100644 lib/readline/xmalloc.c create mode 100644 lib/readline/xmalloc.h create mode 100644 lib/sh/Makefile.in create mode 100644 lib/sh/casemod.c create mode 100644 lib/sh/clktck.c create mode 100644 lib/sh/clock.c create mode 100644 lib/sh/dprintf.c create mode 100644 lib/sh/eaccess.c create mode 100644 lib/sh/fmtullong.c create mode 100644 lib/sh/fmtulong.c create mode 100644 lib/sh/fmtumax.c create mode 100644 lib/sh/fnxform.c create mode 100644 lib/sh/fpurge.c create mode 100644 lib/sh/getcwd.c create mode 100644 lib/sh/getenv.c create mode 100644 lib/sh/inet_aton.c create mode 100644 lib/sh/input_avail.c create mode 100644 lib/sh/itos.c create mode 100644 lib/sh/mailstat.c create mode 100644 lib/sh/makepath.c create mode 100644 lib/sh/mbscasecmp.c create mode 100644 lib/sh/mbschr.c create mode 100644 lib/sh/mbscmp.c create mode 100644 lib/sh/memset.c create mode 100644 lib/sh/mktime.c create mode 100644 lib/sh/netconn.c create mode 100644 lib/sh/netopen.c create mode 100644 lib/sh/oslib.c create mode 100644 lib/sh/pathcanon.c create mode 100644 lib/sh/pathphys.c create mode 100644 lib/sh/rename.c create mode 100644 lib/sh/setlinebuf.c create mode 100644 lib/sh/shmatch.c create mode 100644 lib/sh/shmbchar.c create mode 100644 lib/sh/shquote.c create mode 100644 lib/sh/shtty.c create mode 100644 lib/sh/snprintf.c create mode 100644 lib/sh/spell.c create mode 100644 lib/sh/strcasecmp.c create mode 100644 lib/sh/strcasestr.c create mode 100644 lib/sh/strchrnul.c create mode 100644 lib/sh/strdup.c create mode 100644 lib/sh/strerror.c create mode 100644 lib/sh/strftime.c create mode 100644 lib/sh/stringlist.c create mode 100644 lib/sh/stringvec.c create mode 100644 lib/sh/strnlen.c create mode 100644 lib/sh/strpbrk.c create mode 100644 lib/sh/strstr.c create mode 100644 lib/sh/strtod.c create mode 100644 lib/sh/strtoimax.c create mode 100644 lib/sh/strtol.c create mode 100644 lib/sh/strtoll.c create mode 100644 lib/sh/strtoul.c create mode 100644 lib/sh/strtoull.c create mode 100644 lib/sh/strtoumax.c create mode 100644 lib/sh/strtrans.c create mode 100644 lib/sh/times.c create mode 100644 lib/sh/timeval.c create mode 100644 lib/sh/tmpfile.c create mode 100644 lib/sh/uconvert.c create mode 100644 lib/sh/ufuncs.c create mode 100644 lib/sh/unicode.c create mode 100644 lib/sh/vprint.c create mode 100644 lib/sh/wcsdup.c create mode 100644 lib/sh/wcsnwidth.c create mode 100644 lib/sh/wcswidth.c create mode 100644 lib/sh/winsize.c create mode 100644 lib/sh/zcatfd.c create mode 100644 lib/sh/zgetline.c create mode 100644 lib/sh/zmapfd.c create mode 100644 lib/sh/zread.c create mode 100644 lib/sh/zwrite.c create mode 100644 lib/termcap/Makefile.in create mode 100644 lib/termcap/ltcap.h create mode 100644 lib/termcap/termcap.c create mode 100644 lib/termcap/termcap.h create mode 100644 lib/termcap/tparam.c create mode 100644 lib/termcap/version.c create mode 100644 lib/tilde/Makefile.in create mode 100644 lib/tilde/README create mode 100644 lib/tilde/shell.c create mode 100644 lib/tilde/tilde.c create mode 100644 lib/tilde/tilde.h create mode 100644 list.c create mode 100644 locale.c create mode 100644 m4/stat-time.m4 create mode 100644 m4/timespec.m4 create mode 100644 mailcheck.c create mode 100644 mailcheck.h create mode 100644 make_cmd.c create mode 100644 make_cmd.h create mode 100644 mksyntax.c create mode 100644 nojobs.c create mode 100644 parse.y create mode 100644 parser-built create mode 100644 parser.h create mode 100644 patchlevel.h create mode 100644 pathexp.c create mode 100644 pathexp.h create mode 100644 pathnames.h.in create mode 100644 pcomplete.c create mode 100644 pcomplete.h create mode 100644 pcomplib.c create mode 100644 po/._bg.po create mode 100644 po/LINGUAS create mode 100644 po/Makefile.in.in create mode 100644 po/Makevars create mode 100644 po/POTFILES.in create mode 100644 po/README create mode 100644 po/Rules-builtins create mode 100644 po/Rules-quot create mode 100644 po/af.gmo create mode 100644 po/af.po create mode 100644 po/bash.pot create mode 100644 po/bg.gmo create mode 100644 po/bg.po create mode 100644 po/boldquot.sed create mode 100644 po/ca.gmo create mode 100644 po/ca.po create mode 100644 po/cs.gmo create mode 100644 po/cs.po create mode 100644 po/da.gmo create mode 100644 po/da.po create mode 100644 po/de.gmo create mode 100644 po/de.po create mode 100644 po/el.gmo create mode 100644 po/el.po create mode 100644 po/en@boldquot.gmo create mode 100644 po/en@boldquot.header create mode 100644 po/en@boldquot.po create mode 100644 po/en@quot.gmo create mode 100644 po/en@quot.header create mode 100644 po/en@quot.po create mode 100644 po/eo.gmo create mode 100644 po/eo.po create mode 100644 po/es.gmo create mode 100644 po/es.po create mode 100644 po/et.gmo create mode 100644 po/et.po create mode 100644 po/fi.gmo create mode 100644 po/fi.po create mode 100644 po/fr.gmo create mode 100644 po/fr.po create mode 100644 po/ga.gmo create mode 100644 po/ga.po create mode 100644 po/gl.gmo create mode 100644 po/gl.po create mode 100644 po/hr.gmo create mode 100644 po/hr.po create mode 100644 po/hu.gmo create mode 100644 po/hu.po create mode 100644 po/id.gmo create mode 100644 po/id.po create mode 100644 po/insert-header.sin create mode 100644 po/it.gmo create mode 100644 po/it.po create mode 100644 po/ja.gmo create mode 100644 po/ja.po create mode 100644 po/lt.gmo create mode 100644 po/lt.po create mode 100644 po/nl.gmo create mode 100644 po/nl.po create mode 100644 po/pl.gmo create mode 100644 po/pl.po create mode 100644 po/pt_BR.gmo create mode 100644 po/pt_BR.po create mode 100644 po/quot.sed create mode 100644 po/remove-potcdate.sin create mode 100644 po/ro.gmo create mode 100644 po/ro.po create mode 100644 po/ru.gmo create mode 100644 po/ru.po create mode 100644 po/sk.gmo create mode 100644 po/sk.po create mode 100644 po/sl.gmo create mode 100644 po/sl.po create mode 100644 po/sr.gmo create mode 100644 po/sr.po create mode 100644 po/sv.gmo create mode 100644 po/sv.po create mode 100644 po/tr.gmo create mode 100644 po/tr.po create mode 100644 po/uk.gmo create mode 100644 po/uk.po create mode 100644 po/vi.gmo create mode 100644 po/vi.po create mode 100644 po/zh_CN.gmo create mode 100644 po/zh_CN.po create mode 100644 po/zh_TW.gmo create mode 100644 po/zh_TW.po create mode 100644 print_cmd.c create mode 100644 quit.h create mode 100644 redir.c create mode 100644 redir.h create mode 100644 shell.c create mode 100644 shell.h create mode 100644 sig.c create mode 100644 sig.h create mode 100644 siglist.c create mode 100644 siglist.h create mode 100644 stringlib.c create mode 100644 subst.c create mode 100644 subst.h create mode 100644 support/Makefile.in create mode 100644 support/SYMLINKS create mode 100644 support/bash.xbm create mode 100644 support/bashbug.sh create mode 100644 support/bashversion.c create mode 100755 support/checkbashisms create mode 100644 support/config.guess create mode 100755 support/config.rpath create mode 100644 support/config.sub create mode 100755 support/fixlinks create mode 100755 support/install.sh create mode 100644 support/man2html.c create mode 100755 support/missing create mode 100755 support/mkclone create mode 100755 support/mkconffiles create mode 100755 support/mkdirs create mode 100755 support/mkinstalldirs create mode 100644 support/mksignames.c create mode 100755 support/mkversion.sh create mode 100644 support/printenv.c create mode 100755 support/printenv.sh create mode 100644 support/recho.c create mode 100755 support/rlvers.sh create mode 100755 support/shobj-conf create mode 100644 support/signames.c create mode 100755 support/texi2dvi create mode 100755 support/texi2html create mode 100644 support/xcase.c create mode 100755 support/xenix-link.sh create mode 100644 support/zecho.c create mode 100644 syntax.h create mode 100644 test.c create mode 100644 test.h create mode 100644 tests/COPYRIGHT create mode 100644 tests/README create mode 100644 tests/alias.right create mode 100644 tests/alias.tests create mode 100644 tests/alias1.sub create mode 100644 tests/appendop.right create mode 100644 tests/appendop.tests create mode 100644 tests/appendop1.sub create mode 100644 tests/appendop2.sub create mode 100644 tests/arith-for.right create mode 100644 tests/arith-for.tests create mode 100644 tests/arith.right create mode 100644 tests/arith.tests create mode 100644 tests/arith1.sub create mode 100644 tests/arith2.sub create mode 100644 tests/arith3.sub create mode 100644 tests/arith4.sub create mode 100644 tests/arith5.sub create mode 100644 tests/arith6.sub create mode 100755 tests/array-at-star create mode 100644 tests/array.right create mode 100644 tests/array.tests create mode 100644 tests/array1.sub create mode 100644 tests/array10.sub create mode 100644 tests/array11.sub create mode 100644 tests/array12.sub create mode 100644 tests/array13.sub create mode 100644 tests/array14.sub create mode 100644 tests/array15.sub create mode 100644 tests/array16.sub create mode 100644 tests/array2.right create mode 100644 tests/array2.sub create mode 100644 tests/array3.sub create mode 100644 tests/array4.sub create mode 100644 tests/array5.sub create mode 100644 tests/array6.sub create mode 100644 tests/array7.sub create mode 100644 tests/array8.sub create mode 100644 tests/array9.sub create mode 100644 tests/assoc.right create mode 100644 tests/assoc.tests create mode 100644 tests/assoc1.sub create mode 100644 tests/assoc2.sub create mode 100644 tests/assoc3.sub create mode 100644 tests/assoc4.sub create mode 100644 tests/assoc5.sub create mode 100644 tests/assoc6.sub create mode 100644 tests/assoc7.sub create mode 100644 tests/braces.right create mode 100644 tests/braces.tests create mode 100644 tests/builtins.right create mode 100644 tests/builtins.tests create mode 100644 tests/builtins1.sub create mode 100644 tests/builtins2.sub create mode 100644 tests/builtins3.sub create mode 100644 tests/builtins4.sub create mode 100644 tests/case.right create mode 100644 tests/case.tests create mode 100644 tests/case1.sub create mode 100644 tests/casemod.right create mode 100644 tests/casemod.tests create mode 100644 tests/comsub-eof.right create mode 100644 tests/comsub-eof.tests create mode 100644 tests/comsub-eof0.sub create mode 100644 tests/comsub-eof1.sub create mode 100644 tests/comsub-eof2.sub create mode 100644 tests/comsub-eof3.sub create mode 100644 tests/comsub-eof4.sub create mode 100644 tests/comsub-eof5.sub create mode 100644 tests/comsub-posix.right create mode 100644 tests/comsub-posix.tests create mode 100644 tests/comsub-posix1.sub create mode 100644 tests/comsub-posix2.sub create mode 100644 tests/comsub-posix3.sub create mode 100644 tests/comsub.right create mode 100644 tests/comsub.tests create mode 100644 tests/comsub1.sub create mode 100644 tests/cond-regexp1.sub create mode 100644 tests/cond-regexp2.sub create mode 100644 tests/cond-regexp3.sub create mode 100644 tests/cond.right create mode 100755 tests/cond.tests create mode 100644 tests/coproc.right create mode 100644 tests/coproc.tests create mode 100644 tests/cprint.right create mode 100644 tests/cprint.tests create mode 100644 tests/dbg-support.right create mode 100644 tests/dbg-support.sub create mode 100755 tests/dbg-support.tests create mode 100644 tests/dbg-support2.right create mode 100755 tests/dbg-support2.tests create mode 100644 tests/dbg-support3.sub create mode 100755 tests/dollar-at-star create mode 100644 tests/dollar-at-star1.sub create mode 100644 tests/dollar-at1.sub create mode 100644 tests/dollar-at2.sub create mode 100644 tests/dollar-at3.sub create mode 100644 tests/dollar-at4.sub create mode 100644 tests/dollar-at5.sub create mode 100644 tests/dollar-at6.sub create mode 100644 tests/dollar-star1.sub create mode 100644 tests/dollar-star2.sub create mode 100644 tests/dollar-star3.sub create mode 100644 tests/dollar-star4.sub create mode 100644 tests/dollar-star5.sub create mode 100644 tests/dollar-star6.sub create mode 100644 tests/dollar-star7.sub create mode 100644 tests/dollar.right create mode 100644 tests/dstack.right create mode 100644 tests/dstack.tests create mode 100644 tests/dstack2.right create mode 100644 tests/dstack2.tests create mode 100644 tests/errors.right create mode 100644 tests/errors.tests create mode 100644 tests/errors1.sub create mode 100644 tests/errors2.sub create mode 100644 tests/errors3.sub create mode 100644 tests/exec.right create mode 100755 tests/exec1.sub create mode 100644 tests/exec2.sub create mode 100644 tests/exec3.sub create mode 100644 tests/exec4.sub create mode 100644 tests/exec5.sub create mode 100644 tests/exec6.sub create mode 100644 tests/exec7.sub create mode 100644 tests/exec8.sub create mode 100644 tests/exec9.sub create mode 100644 tests/execscript create mode 100644 tests/exp.right create mode 100644 tests/exp.tests create mode 100644 tests/exp1.sub create mode 100644 tests/exp2.sub create mode 100644 tests/exp3.sub create mode 100644 tests/exp4.sub create mode 100644 tests/exp5.sub create mode 100644 tests/exp6.sub create mode 100644 tests/extglob.right create mode 100644 tests/extglob.tests create mode 100644 tests/extglob1.sub create mode 100644 tests/extglob1a.sub create mode 100644 tests/extglob2.right create mode 100755 tests/extglob2.tests create mode 100644 tests/extglob3.right create mode 100644 tests/extglob3.tests create mode 100644 tests/func.right create mode 100644 tests/func.tests create mode 100644 tests/func1.sub create mode 100644 tests/func2.sub create mode 100644 tests/func3.sub create mode 100644 tests/func4.sub create mode 100644 tests/getopts.right create mode 100644 tests/getopts.tests create mode 100644 tests/getopts1.sub create mode 100644 tests/getopts2.sub create mode 100644 tests/getopts3.sub create mode 100644 tests/getopts4.sub create mode 100644 tests/getopts5.sub create mode 100644 tests/getopts6.sub create mode 100644 tests/getopts7.sub create mode 100644 tests/glob.right create mode 100644 tests/glob.tests create mode 100644 tests/glob1.sub create mode 100644 tests/globstar.right create mode 100644 tests/globstar.tests create mode 100644 tests/globstar1.sub create mode 100644 tests/globstar2.sub create mode 100644 tests/heredoc.right create mode 100644 tests/heredoc.tests create mode 100644 tests/heredoc1.sub create mode 100644 tests/heredoc2.sub create mode 100644 tests/heredoc3.sub create mode 100644 tests/herestr.right create mode 100644 tests/herestr.tests create mode 100644 tests/histexp.right create mode 100644 tests/histexp.tests create mode 100644 tests/history.list create mode 100644 tests/history.right create mode 100644 tests/history.tests create mode 100644 tests/history1.sub create mode 100644 tests/history2.sub create mode 100644 tests/ifs-posix.right create mode 100644 tests/ifs-posix.tests create mode 100644 tests/ifs.right create mode 100644 tests/ifs.tests create mode 100644 tests/input-line.sh create mode 100644 tests/input-line.sub create mode 100644 tests/input.right create mode 100644 tests/intl.right create mode 100644 tests/intl.tests create mode 100644 tests/intl1.sub create mode 100644 tests/intl2.sub create mode 100644 tests/invert.right create mode 100644 tests/invert.tests create mode 100644 tests/iquote.right create mode 100644 tests/iquote.tests create mode 100644 tests/iquote1.sub create mode 100644 tests/jobs.right create mode 100644 tests/jobs.tests create mode 100644 tests/jobs1.sub create mode 100644 tests/jobs2.sub create mode 100644 tests/jobs3.sub create mode 100644 tests/jobs4.sub create mode 100644 tests/jobs5.sub create mode 100644 tests/lastpipe.right create mode 100644 tests/lastpipe.tests create mode 100644 tests/lastpipe1.sub create mode 100644 tests/mapfile.data create mode 100644 tests/mapfile.right create mode 100644 tests/mapfile.tests create mode 100644 tests/mapfile1.sub create mode 100644 tests/misc/dev-tcp.tests create mode 100644 tests/misc/perf-script create mode 100644 tests/misc/perftest create mode 100644 tests/misc/read-nchars.tests create mode 100644 tests/misc/redir-t2.sh create mode 100755 tests/misc/run-r2.sh create mode 100755 tests/misc/sigint-1.sh create mode 100755 tests/misc/sigint-2.sh create mode 100755 tests/misc/sigint-3.sh create mode 100755 tests/misc/sigint-4.sh create mode 100644 tests/misc/test-minus-e.1 create mode 100644 tests/misc/test-minus-e.2 create mode 100644 tests/misc/wait-bg.tests create mode 100644 tests/more-exp.right create mode 100644 tests/more-exp.tests create mode 100644 tests/nameref.right create mode 100644 tests/nameref.tests create mode 100644 tests/nameref1.sub create mode 100644 tests/nameref2.sub create mode 100644 tests/nameref3.sub create mode 100644 tests/nameref4.sub create mode 100644 tests/nameref5.sub create mode 100644 tests/nameref6.sub create mode 100644 tests/nameref7.sub create mode 100644 tests/nameref8.sub create mode 100644 tests/new-exp.right create mode 100644 tests/new-exp.tests create mode 100644 tests/new-exp1.sub create mode 100644 tests/new-exp2.sub create mode 100644 tests/new-exp3.sub create mode 100644 tests/new-exp4.sub create mode 100644 tests/new-exp5.sub create mode 100644 tests/new-exp6.sub create mode 100644 tests/new-exp7.sub create mode 100644 tests/new-exp8.sub create mode 100644 tests/new-exp9.sub create mode 100644 tests/nquote.right create mode 100644 tests/nquote.tests create mode 100644 tests/nquote1.right create mode 100644 tests/nquote1.sub create mode 100644 tests/nquote1.tests create mode 100644 tests/nquote2.right create mode 100644 tests/nquote2.sub create mode 100644 tests/nquote2.tests create mode 100644 tests/nquote3.right create mode 100644 tests/nquote3.tests create mode 100644 tests/nquote4.right create mode 100644 tests/nquote4.tests create mode 100644 tests/nquote5.right create mode 100644 tests/nquote5.tests create mode 100644 tests/posix2.right create mode 100644 tests/posix2.tests create mode 100644 tests/posixexp.right create mode 100644 tests/posixexp.tests create mode 100644 tests/posixexp1.sub create mode 100644 tests/posixexp2.right create mode 100644 tests/posixexp2.sub create mode 100644 tests/posixexp2.tests create mode 100644 tests/posixpat.right create mode 100644 tests/posixpat.tests create mode 100644 tests/posixpipe.right create mode 100644 tests/posixpipe.tests create mode 100644 tests/prec.right create mode 100755 tests/precedence create mode 100644 tests/printf.right create mode 100644 tests/printf.tests create mode 100644 tests/printf1.sub create mode 100644 tests/printf2.sub create mode 100644 tests/printf3.sub create mode 100644 tests/printf4.sub create mode 100644 tests/quote.right create mode 100644 tests/quote.tests create mode 100644 tests/quote1.sub create mode 100644 tests/read.right create mode 100644 tests/read.tests create mode 100644 tests/read1.sub create mode 100644 tests/read2.sub create mode 100644 tests/read3.sub create mode 100644 tests/read4.sub create mode 100644 tests/read5.sub create mode 100644 tests/read6.sub create mode 100644 tests/redir.right create mode 100644 tests/redir.tests create mode 100644 tests/redir1.sub create mode 100644 tests/redir10.sub create mode 100644 tests/redir2.sub create mode 100644 tests/redir3.in1 create mode 100644 tests/redir3.in2 create mode 100644 tests/redir3.sub create mode 100644 tests/redir4.in1 create mode 100644 tests/redir4.sub create mode 100644 tests/redir5.sub create mode 100644 tests/redir6.sub create mode 100644 tests/redir7.sub create mode 100644 tests/redir8.sub create mode 100644 tests/redir9.sub create mode 100644 tests/rhs-exp.right create mode 100644 tests/rhs-exp.tests create mode 100644 tests/rhs-exp1.sub create mode 100644 tests/rsh.right create mode 100644 tests/rsh.tests create mode 100644 tests/run-alias create mode 100644 tests/run-all create mode 100644 tests/run-appendop create mode 100644 tests/run-arith create mode 100644 tests/run-arith-for create mode 100644 tests/run-array create mode 100644 tests/run-array2 create mode 100644 tests/run-assoc create mode 100644 tests/run-braces create mode 100644 tests/run-builtins create mode 100644 tests/run-case create mode 100644 tests/run-casemod create mode 100644 tests/run-comsub create mode 100644 tests/run-comsub-eof create mode 100644 tests/run-comsub-posix create mode 100644 tests/run-cond create mode 100644 tests/run-coproc create mode 100644 tests/run-cprint create mode 100755 tests/run-dbg-support create mode 100755 tests/run-dbg-support2 create mode 100644 tests/run-dirstack create mode 100644 tests/run-dollars create mode 100644 tests/run-errors create mode 100644 tests/run-execscript create mode 100644 tests/run-exp-tests create mode 100644 tests/run-extglob create mode 100644 tests/run-extglob2 create mode 100644 tests/run-extglob3 create mode 100644 tests/run-func create mode 100644 tests/run-getopts create mode 100644 tests/run-glob-test create mode 100644 tests/run-globstar create mode 100644 tests/run-heredoc create mode 100644 tests/run-herestr create mode 100644 tests/run-histexpand create mode 100644 tests/run-history create mode 100644 tests/run-ifs create mode 100644 tests/run-ifs-posix create mode 100644 tests/run-input-test create mode 100644 tests/run-intl create mode 100644 tests/run-invert create mode 100644 tests/run-iquote create mode 100644 tests/run-jobs create mode 100644 tests/run-lastpipe create mode 100644 tests/run-mapfile create mode 100644 tests/run-minimal create mode 100644 tests/run-more-exp create mode 100644 tests/run-nameref create mode 100644 tests/run-new-exp create mode 100644 tests/run-nquote create mode 100644 tests/run-nquote1 create mode 100644 tests/run-nquote2 create mode 100644 tests/run-nquote3 create mode 100644 tests/run-nquote4 create mode 100644 tests/run-nquote5 create mode 100644 tests/run-posix2 create mode 100644 tests/run-posixexp create mode 100644 tests/run-posixexp2 create mode 100644 tests/run-posixpat create mode 100644 tests/run-posixpipe create mode 100644 tests/run-precedence create mode 100644 tests/run-printf create mode 100644 tests/run-quote create mode 100644 tests/run-read create mode 100644 tests/run-redir create mode 100644 tests/run-rhs-exp create mode 100644 tests/run-rsh create mode 100644 tests/run-set-e create mode 100755 tests/run-set-x create mode 100644 tests/run-shopt create mode 100644 tests/run-strip create mode 100644 tests/run-test create mode 100644 tests/run-tilde create mode 100644 tests/run-tilde2 create mode 100644 tests/run-trap create mode 100644 tests/run-type create mode 100644 tests/run-varenv create mode 100644 tests/run-vredir create mode 100644 tests/set-e.right create mode 100644 tests/set-e.tests create mode 100644 tests/set-e1.sub create mode 100644 tests/set-e2.sub create mode 100644 tests/set-e3.sub create mode 100644 tests/set-e3a.sub create mode 100644 tests/set-x.right create mode 100755 tests/set-x.tests create mode 100644 tests/set-x1.sub create mode 100644 tests/shopt.right create mode 100644 tests/shopt.tests create mode 100644 tests/source1.sub create mode 100644 tests/source2.sub create mode 100644 tests/source3.sub create mode 100644 tests/source4.sub create mode 100644 tests/source5.sub create mode 100644 tests/source6.sub create mode 100644 tests/source7.sub create mode 100644 tests/strip.right create mode 100644 tests/strip.tests create mode 100644 tests/test.right create mode 100644 tests/test.tests create mode 100644 tests/tilde.right create mode 100644 tests/tilde.tests create mode 100644 tests/tilde2.right create mode 100644 tests/tilde2.tests create mode 100644 tests/trap.right create mode 100644 tests/trap.tests create mode 100755 tests/trap1.sub create mode 100755 tests/trap2.sub create mode 100755 tests/trap2a.sub create mode 100644 tests/trap3.sub create mode 100644 tests/trap4.sub create mode 100644 tests/trap5.sub create mode 100644 tests/type.right create mode 100644 tests/type.tests create mode 100644 tests/type1.sub create mode 100644 tests/type2.sub create mode 100644 tests/type3.sub create mode 100644 tests/type4.sub create mode 100644 tests/unicode1.sub create mode 100644 tests/unicode2.sub create mode 100644 tests/unicode3.sub create mode 100644 tests/varenv.right create mode 100644 tests/varenv.sh create mode 100644 tests/varenv1.sub create mode 100644 tests/varenv2.sub create mode 100644 tests/varenv3.sub create mode 100644 tests/varenv4.sub create mode 100644 tests/varenv5.sub create mode 100644 tests/varenv6.sub create mode 100644 tests/version create mode 100644 tests/version.mini create mode 100644 tests/vredir.right create mode 100644 tests/vredir.tests create mode 100644 tests/vredir1.sub create mode 100644 tests/vredir2.sub create mode 100644 tests/vredir3.sub create mode 100644 tests/vredir4.sub create mode 100644 tests/vredir5.sub create mode 100644 tests/vredir6.sub create mode 100644 trap.c create mode 100644 trap.h create mode 100644 unwind_prot.c create mode 100644 unwind_prot.h create mode 100644 variables.c create mode 100644 variables.h create mode 100644 version.c create mode 100644 xmalloc.c create mode 100644 xmalloc.h create mode 100644 y.tab.c create mode 100644 y.tab.h diff --git a/.pc/.quilt_patches b/.pc/.quilt_patches new file mode 100644 index 0000000..6857a8d --- /dev/null +++ b/.pc/.quilt_patches @@ -0,0 +1 @@ +debian/patches diff --git a/.pc/.quilt_series b/.pc/.quilt_series new file mode 100644 index 0000000..c206706 --- /dev/null +++ b/.pc/.quilt_series @@ -0,0 +1 @@ +series diff --git a/.pc/.version b/.pc/.version new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/.pc/.version @@ -0,0 +1 @@ +2 diff --git a/.pc/applied-patches b/.pc/applied-patches new file mode 100644 index 0000000..931b7cd --- /dev/null +++ b/.pc/applied-patches @@ -0,0 +1,45 @@ +bash43-001.diff +bash43-002.diff +bash43-003.diff +bash43-004.diff +bash43-005.diff +bash43-006.diff +bash43-007.diff +bash43-008.diff +bash43-009.diff +bash43-010.diff +bash43-011.diff +bash43-012.diff +bash43-013.diff +bash43-014.diff +bash43-015.diff +bash43-016.diff +bash43-017.diff +bash43-018.diff +bash43-019.diff +bash43-020.diff +bash43-021.diff +bash43-022.diff +bash43-023.diff +bash43-024.diff +bash43-025.diff +bashbug-editor.diff +deb-bash-config.diff +deb-examples.diff +man-arithmetic.diff +man-fignore.diff +man-bashrc.diff +man-bashlogout.diff +man-nocaseglob.diff +man-test.diff +man-test2.diff +privmode.diff +rbash-manpage.diff +bash-default-editor.diff +bash-subst-param-length.diff +pgrp-pipe.diff +input-err.diff +exec-redirections-doc.diff +bash-aliases-repeat.diff +use-system-texi2html.diff +bzero.diff diff --git a/.pc/bash-aliases-repeat.diff/examples/startup-files/Bash_aliases b/.pc/bash-aliases-repeat.diff/examples/startup-files/Bash_aliases new file mode 100644 index 0000000..bb9c01e --- /dev/null +++ b/.pc/bash-aliases-repeat.diff/examples/startup-files/Bash_aliases @@ -0,0 +1,63 @@ +# Some useful aliases. +alias texclean='rm -f *.toc *.aux *.log *.cp *.fn *.tp *.vr *.pg *.ky' +alias clean='echo -n "Really clean this directory?"; + read yorn; + if test "$yorn" = "y"; then + rm -f \#* *~ .*~ *.bak .*.bak *.tmp .*.tmp core a.out; + echo "Cleaned."; + else + echo "Not cleaned."; + fi' +alias h='history' +alias j="jobs -l" +alias l="ls -l " +alias ll="ls -l" +alias ls="ls -F" +alias pu="pushd" +alias po="popd" + +# +# Csh compatability: +# +alias unsetenv=unset +function setenv () { + export $1="$2" +} + +# Function which adds an alias to the current shell and to +# the ~/.bash_aliases file. +add-alias () +{ + local name=$1 value="$2" + echo alias $name=\'$value\' >>~/.bash_aliases + eval alias $name=\'$value\' + alias $name +} + +# "repeat" command. Like: +# +# repeat 10 echo foo +repeat () +{ + local count="$1" i; + shift; + for i in $(seq 1 "$count"); + do + eval "$@"; + done +} + +# Subfunction needed by `repeat'. +seq () +{ + local lower upper output; + lower=$1 upper=$2; + + if [ $lower -ge $upper ]; then return; fi + while [ $lower -le $upper ]; + do + echo -n "$lower " + lower=$(($lower + 1)) + done + echo "$lower" +} diff --git a/.pc/bash-default-editor.diff/bashline.c b/.pc/bash-default-editor.diff/bashline.c new file mode 100644 index 0000000..77ca033 --- /dev/null +++ b/.pc/bash-default-editor.diff/bashline.c @@ -0,0 +1,4219 @@ +/* bashline.c -- Bash's interface to the readline library. */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#if defined (READLINE) + +#include "bashtypes.h" +#include "posixstat.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (HAVE_GRP_H) +# include +#endif + +#if defined (HAVE_NETDB_H) +# include +#endif + +#include + +#include +#include "chartypes.h" +#include "bashansi.h" +#include "bashintl.h" + +#include "shell.h" +#include "input.h" +#include "builtins.h" +#include "bashhist.h" +#include "bashline.h" +#include "execute_cmd.h" +#include "findcmd.h" +#include "pathexp.h" +#include "shmbutil.h" +#include "trap.h" + +#include "builtins/common.h" + +#include +#include +#include + +#include + +#if defined (ALIAS) +# include "alias.h" +#endif + +#if defined (PROGRAMMABLE_COMPLETION) +# include "pcomplete.h" +#endif + +/* These should agree with the defines for emacs_mode and vi_mode in + rldefs.h, even though that's not a public readline header file. */ +#ifndef EMACS_EDITING_MODE +# define NO_EDITING_MODE -1 +# define EMACS_EDITING_MODE 1 +# define VI_EDITING_MODE 0 +#endif + +#define RL_BOOLEAN_VARIABLE_VALUE(s) ((s)[0] == 'o' && (s)[1] == 'n' && (s)[2] == '\0') + +#if defined (BRACE_COMPLETION) +extern int bash_brace_completion __P((int, int)); +#endif /* BRACE_COMPLETION */ + +/* To avoid including curses.h/term.h/termcap.h and that whole mess. */ +#ifdef _MINIX +extern int tputs __P((const char *string, int nlines, void (*outx)(int))); +#else +extern int tputs __P((const char *string, int nlines, int (*outx)(int))); +#endif + +/* Forward declarations */ + +/* Functions bound to keys in Readline for Bash users. */ +static int shell_expand_line __P((int, int)); +static int display_shell_version __P((int, int)); +static int operate_and_get_next __P((int, int)); + +static int bash_ignore_filenames __P((char **)); +static int bash_ignore_everything __P((char **)); + +#if defined (BANG_HISTORY) +static char *history_expand_line_internal __P((char *)); +static int history_expand_line __P((int, int)); +static int tcsh_magic_space __P((int, int)); +#endif /* BANG_HISTORY */ +#ifdef ALIAS +static int alias_expand_line __P((int, int)); +#endif +#if defined (BANG_HISTORY) && defined (ALIAS) +static int history_and_alias_expand_line __P((int, int)); +#endif + +static int bash_forward_shellword __P((int, int)); +static int bash_backward_shellword __P((int, int)); +static int bash_kill_shellword __P((int, int)); +static int bash_backward_kill_shellword __P((int, int)); + +/* Helper functions for Readline. */ +static char *restore_tilde __P((char *, char *)); +static char *maybe_restore_tilde __P((char *, char *)); + +static char *bash_filename_rewrite_hook __P((char *, int)); + +static void bash_directory_expansion __P((char **)); +static int bash_filename_stat_hook __P((char **)); +static int bash_command_name_stat_hook __P((char **)); +static int bash_directory_completion_hook __P((char **)); +static int filename_completion_ignore __P((char **)); +static int bash_push_line __P((void)); + +static int executable_completion __P((const char *, int)); + +static rl_icppfunc_t *save_directory_hook __P((void)); +static void restore_directory_hook __P((rl_icppfunc_t)); + +static void cleanup_expansion_error __P((void)); +static void maybe_make_readline_line __P((char *)); +static void set_up_new_line __P((char *)); + +static int check_redir __P((int)); +static char **attempt_shell_completion __P((const char *, int, int)); +static char *variable_completion_function __P((const char *, int)); +static char *hostname_completion_function __P((const char *, int)); +static char *command_subst_completion_function __P((const char *, int)); + +static void build_history_completion_array __P((void)); +static char *history_completion_generator __P((const char *, int)); +static int dynamic_complete_history __P((int, int)); +static int bash_dabbrev_expand __P((int, int)); + +static void initialize_hostname_list __P((void)); +static void add_host_name __P((char *)); +static void snarf_hosts_from_file __P((char *)); +static char **hostnames_matching __P((char *)); + +static void _ignore_completion_names __P((char **, sh_ignore_func_t *)); +static int name_is_acceptable __P((const char *)); +static int test_for_directory __P((const char *)); +static int return_zero __P((const char *)); + +static char *bash_dequote_filename __P((char *, int)); +static char *quote_word_break_chars __P((char *)); +static void set_filename_bstab __P((const char *)); +static char *bash_quote_filename __P((char *, int, char *)); + +#ifdef _MINIX +static void putx __P((int)); +#else +static int putx __P((int)); +#endif +static int bash_execute_unix_command __P((int, int)); +static void init_unix_command_map __P((void)); +static int isolate_sequence __P((char *, int, int, int *)); + +static int set_saved_history __P((void)); + +#if defined (ALIAS) +static int posix_edit_macros __P((int, int)); +#endif + +static int bash_event_hook __P((void)); + +#if defined (PROGRAMMABLE_COMPLETION) +static int find_cmd_start __P((int)); +static int find_cmd_end __P((int)); +static char *find_cmd_name __P((int, int *, int *)); +static char *prog_complete_return __P((const char *, int)); + +static char **prog_complete_matches; +#endif + +/* Variables used here but defined in other files. */ +#if defined (BANG_HISTORY) +extern int hist_verify; +#endif + +extern int current_command_line_count, saved_command_line_count; +extern int last_command_exit_value; +extern int array_needs_making; +extern int posixly_correct, no_symbolic_links; +extern char *current_prompt_string, *ps1_prompt; +extern STRING_INT_ALIST word_token_alist[]; +extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin; + +/* SPECIFIC_COMPLETION_FUNCTIONS specifies that we have individual + completion functions which indicate what type of completion should be + done (at or before point) that can be bound to key sequences with + the readline library. */ +#define SPECIFIC_COMPLETION_FUNCTIONS + +#if defined (SPECIFIC_COMPLETION_FUNCTIONS) +static int bash_specific_completion __P((int, rl_compentry_func_t *)); + +static int bash_complete_filename_internal __P((int)); +static int bash_complete_username_internal __P((int)); +static int bash_complete_hostname_internal __P((int)); +static int bash_complete_variable_internal __P((int)); +static int bash_complete_command_internal __P((int)); + +static int bash_complete_filename __P((int, int)); +static int bash_possible_filename_completions __P((int, int)); +static int bash_complete_username __P((int, int)); +static int bash_possible_username_completions __P((int, int)); +static int bash_complete_hostname __P((int, int)); +static int bash_possible_hostname_completions __P((int, int)); +static int bash_complete_variable __P((int, int)); +static int bash_possible_variable_completions __P((int, int)); +static int bash_complete_command __P((int, int)); +static int bash_possible_command_completions __P((int, int)); + +static char *glob_complete_word __P((const char *, int)); +static int bash_glob_completion_internal __P((int)); +static int bash_glob_complete_word __P((int, int)); +static int bash_glob_expand_word __P((int, int)); +static int bash_glob_list_expansions __P((int, int)); + +#endif /* SPECIFIC_COMPLETION_FUNCTIONS */ + +static int edit_and_execute_command __P((int, int, int, char *)); +#if defined (VI_MODE) +static int vi_edit_and_execute_command __P((int, int)); +static int bash_vi_complete __P((int, int)); +#endif +static int emacs_edit_and_execute_command __P((int, int)); + +/* Non-zero once initalize_readline () has been called. */ +int bash_readline_initialized = 0; + +/* If non-zero, we do hostname completion, breaking words at `@' and + trying to complete the stuff after the `@' from our own internal + host list. */ +int perform_hostname_completion = 1; + +/* If non-zero, we don't do command completion on an empty line. */ +int no_empty_command_completion; + +/* Set FORCE_FIGNORE if you want to honor FIGNORE even if it ignores the + only possible matches. Set to 0 if you want to match filenames if they + are the only possible matches, even if FIGNORE says to. */ +int force_fignore = 1; + +/* Perform spelling correction on directory names during word completion */ +int dircomplete_spelling = 0; + +/* Expand directory names during word/filename completion. */ +#if DIRCOMPLETE_EXPAND_DEFAULT +int dircomplete_expand = 1; +int dircomplete_expand_relpath = 1; +#else +int dircomplete_expand = 0; +int dircomplete_expand_relpath = 0; +#endif + +/* When non-zero, perform `normal' shell quoting on completed filenames + even when the completed name contains a directory name with a shell + variable referene, so dollar signs in a filename get quoted appropriately. + Set to zero to remove dollar sign (and braces or parens as needed) from + the set of characters that will be quoted. */ +int complete_fullquote = 1; + +static char *bash_completer_word_break_characters = " \t\n\"'@><=;|&(:"; +static char *bash_nohostname_word_break_characters = " \t\n\"'><=;|&(:"; +/* )) */ + +static const char *default_filename_quote_characters = " \t\n\\\"'@<>=;|&()#$`?*[!:{~"; /*}*/ +static char *custom_filename_quote_characters = 0; +static char filename_bstab[256]; + +static rl_hook_func_t *old_rl_startup_hook = (rl_hook_func_t *)NULL; + +static int dot_in_path = 0; + +/* Set to non-zero when dabbrev-expand is running */ +static int dabbrev_expand_active = 0; + +/* What kind of quoting is performed by bash_quote_filename: + COMPLETE_DQUOTE = double-quoting the filename + COMPLETE_SQUOTE = single_quoting the filename + COMPLETE_BSQUOTE = backslash-quoting special chars in the filename +*/ +#define COMPLETE_DQUOTE 1 +#define COMPLETE_SQUOTE 2 +#define COMPLETE_BSQUOTE 3 +static int completion_quoting_style = COMPLETE_BSQUOTE; + +/* Flag values for the final argument to bash_default_completion */ +#define DEFCOMP_CMDPOS 1 + +/* Change the readline VI-mode keymaps into or out of Posix.2 compliance. + Called when the shell is put into or out of `posix' mode. */ +void +posix_readline_initialize (on_or_off) + int on_or_off; +{ + if (on_or_off) + rl_variable_bind ("comment-begin", "#"); +#if defined (VI_MODE) + rl_bind_key_in_map (CTRL ('I'), on_or_off ? rl_insert : rl_complete, vi_insertion_keymap); +#endif +} + +void +reset_completer_word_break_chars () +{ + rl_completer_word_break_characters = perform_hostname_completion ? savestring (bash_completer_word_break_characters) : savestring (bash_nohostname_word_break_characters); +} + +/* When this function returns, rl_completer_word_break_characters points to + dynamically allocated memory. */ +int +enable_hostname_completion (on_or_off) + int on_or_off; +{ + int old_value; + char *at, *nv, *nval; + + old_value = perform_hostname_completion; + + if (on_or_off) + { + perform_hostname_completion = 1; + rl_special_prefixes = "$@"; + } + else + { + perform_hostname_completion = 0; + rl_special_prefixes = "$"; + } + + /* Now we need to figure out how to appropriately modify and assign + rl_completer_word_break_characters depending on whether we want + hostname completion on or off. */ + + /* If this is the first time this has been called + (bash_readline_initialized == 0), use the sames values as before, but + allocate new memory for rl_completer_word_break_characters. */ + + if (bash_readline_initialized == 0 && + (rl_completer_word_break_characters == 0 || + rl_completer_word_break_characters == rl_basic_word_break_characters)) + { + if (on_or_off) + rl_completer_word_break_characters = savestring (bash_completer_word_break_characters); + else + rl_completer_word_break_characters = savestring (bash_nohostname_word_break_characters); + } + else + { + /* See if we have anything to do. */ + at = strchr (rl_completer_word_break_characters, '@'); + if ((at == 0 && on_or_off == 0) || (at != 0 && on_or_off != 0)) + return old_value; + + /* We have something to do. Do it. */ + nval = (char *)xmalloc (strlen (rl_completer_word_break_characters) + 1 + on_or_off); + + if (on_or_off == 0) + { + /* Turn it off -- just remove `@' from word break chars. We want + to remove all occurrences of `@' from the char list, so we loop + rather than just copy the rest of the list over AT. */ + for (nv = nval, at = rl_completer_word_break_characters; *at; ) + if (*at != '@') + *nv++ = *at++; + else + at++; + *nv = '\0'; + } + else + { + nval[0] = '@'; + strcpy (nval + 1, rl_completer_word_break_characters); + } + + free (rl_completer_word_break_characters); + rl_completer_word_break_characters = nval; + } + + return (old_value); +} + +/* Called once from parse.y if we are going to use readline. */ +void +initialize_readline () +{ + rl_command_func_t *func; + char kseq[2]; + + if (bash_readline_initialized) + return; + + rl_terminal_name = get_string_value ("TERM"); + rl_instream = stdin; + rl_outstream = stderr; + + /* Allow conditional parsing of the ~/.inputrc file. */ + rl_readline_name = "Bash"; + + /* Add bindable names before calling rl_initialize so they may be + referenced in the various inputrc files. */ + rl_add_defun ("shell-expand-line", shell_expand_line, -1); +#ifdef BANG_HISTORY + rl_add_defun ("history-expand-line", history_expand_line, -1); + rl_add_defun ("magic-space", tcsh_magic_space, -1); +#endif + + rl_add_defun ("shell-forward-word", bash_forward_shellword, -1); + rl_add_defun ("shell-backward-word", bash_backward_shellword, -1); + rl_add_defun ("shell-kill-word", bash_kill_shellword, -1); + rl_add_defun ("shell-backward-kill-word", bash_backward_kill_shellword, -1); + +#ifdef ALIAS + rl_add_defun ("alias-expand-line", alias_expand_line, -1); +# ifdef BANG_HISTORY + rl_add_defun ("history-and-alias-expand-line", history_and_alias_expand_line, -1); +# endif +#endif + + /* Backwards compatibility. */ + rl_add_defun ("insert-last-argument", rl_yank_last_arg, -1); + + rl_add_defun ("operate-and-get-next", operate_and_get_next, -1); + rl_add_defun ("display-shell-version", display_shell_version, -1); + rl_add_defun ("edit-and-execute-command", emacs_edit_and_execute_command, -1); + +#if defined (BRACE_COMPLETION) + rl_add_defun ("complete-into-braces", bash_brace_completion, -1); +#endif + +#if defined (SPECIFIC_COMPLETION_FUNCTIONS) + rl_add_defun ("complete-filename", bash_complete_filename, -1); + rl_add_defun ("possible-filename-completions", bash_possible_filename_completions, -1); + rl_add_defun ("complete-username", bash_complete_username, -1); + rl_add_defun ("possible-username-completions", bash_possible_username_completions, -1); + rl_add_defun ("complete-hostname", bash_complete_hostname, -1); + rl_add_defun ("possible-hostname-completions", bash_possible_hostname_completions, -1); + rl_add_defun ("complete-variable", bash_complete_variable, -1); + rl_add_defun ("possible-variable-completions", bash_possible_variable_completions, -1); + rl_add_defun ("complete-command", bash_complete_command, -1); + rl_add_defun ("possible-command-completions", bash_possible_command_completions, -1); + rl_add_defun ("glob-complete-word", bash_glob_complete_word, -1); + rl_add_defun ("glob-expand-word", bash_glob_expand_word, -1); + rl_add_defun ("glob-list-expansions", bash_glob_list_expansions, -1); +#endif + + rl_add_defun ("dynamic-complete-history", dynamic_complete_history, -1); + rl_add_defun ("dabbrev-expand", bash_dabbrev_expand, -1); + + /* Bind defaults before binding our custom shell keybindings. */ + if (RL_ISSTATE(RL_STATE_INITIALIZED) == 0) + rl_initialize (); + + /* Bind up our special shell functions. */ + rl_bind_key_if_unbound_in_map (CTRL('E'), shell_expand_line, emacs_meta_keymap); + +#ifdef BANG_HISTORY + rl_bind_key_if_unbound_in_map ('^', history_expand_line, emacs_meta_keymap); +#endif + + rl_bind_key_if_unbound_in_map (CTRL ('O'), operate_and_get_next, emacs_standard_keymap); + rl_bind_key_if_unbound_in_map (CTRL ('V'), display_shell_version, emacs_ctlx_keymap); + + /* In Bash, the user can switch editing modes with "set -o [vi emacs]", + so it is not necessary to allow C-M-j for context switching. Turn + off this occasionally confusing behaviour. */ + kseq[0] = CTRL('J'); + kseq[1] = '\0'; + func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL); + if (func == rl_vi_editing_mode) + rl_unbind_key_in_map (CTRL('J'), emacs_meta_keymap); + kseq[0] = CTRL('M'); + func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL); + if (func == rl_vi_editing_mode) + rl_unbind_key_in_map (CTRL('M'), emacs_meta_keymap); +#if defined (VI_MODE) + rl_unbind_key_in_map (CTRL('E'), vi_movement_keymap); +#endif + +#if defined (BRACE_COMPLETION) + rl_bind_key_if_unbound_in_map ('{', bash_brace_completion, emacs_meta_keymap); /*}*/ +#endif /* BRACE_COMPLETION */ + +#if defined (SPECIFIC_COMPLETION_FUNCTIONS) + rl_bind_key_if_unbound_in_map ('/', bash_complete_filename, emacs_meta_keymap); + rl_bind_key_if_unbound_in_map ('/', bash_possible_filename_completions, emacs_ctlx_keymap); + + /* Have to jump through hoops here because there is a default binding for + M-~ (rl_tilde_expand) */ + kseq[0] = '~'; + kseq[1] = '\0'; + func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL); + if (func == 0 || func == rl_tilde_expand) + rl_bind_keyseq_in_map (kseq, bash_complete_username, emacs_meta_keymap); + + rl_bind_key_if_unbound_in_map ('~', bash_possible_username_completions, emacs_ctlx_keymap); + + rl_bind_key_if_unbound_in_map ('@', bash_complete_hostname, emacs_meta_keymap); + rl_bind_key_if_unbound_in_map ('@', bash_possible_hostname_completions, emacs_ctlx_keymap); + + rl_bind_key_if_unbound_in_map ('$', bash_complete_variable, emacs_meta_keymap); + rl_bind_key_if_unbound_in_map ('$', bash_possible_variable_completions, emacs_ctlx_keymap); + + rl_bind_key_if_unbound_in_map ('!', bash_complete_command, emacs_meta_keymap); + rl_bind_key_if_unbound_in_map ('!', bash_possible_command_completions, emacs_ctlx_keymap); + + rl_bind_key_if_unbound_in_map ('g', bash_glob_complete_word, emacs_meta_keymap); + rl_bind_key_if_unbound_in_map ('*', bash_glob_expand_word, emacs_ctlx_keymap); + rl_bind_key_if_unbound_in_map ('g', bash_glob_list_expansions, emacs_ctlx_keymap); + +#endif /* SPECIFIC_COMPLETION_FUNCTIONS */ + + kseq[0] = TAB; + kseq[1] = '\0'; + func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL); + if (func == 0 || func == rl_tab_insert) + rl_bind_key_in_map (TAB, dynamic_complete_history, emacs_meta_keymap); + + /* Tell the completer that we want a crack first. */ + rl_attempted_completion_function = attempt_shell_completion; + + /* Tell the completer that we might want to follow symbolic links or + do other expansion on directory names. */ + set_directory_hook (); + + rl_filename_rewrite_hook = bash_filename_rewrite_hook; + + rl_filename_stat_hook = bash_filename_stat_hook; + + /* Tell the filename completer we want a chance to ignore some names. */ + rl_ignore_some_completions_function = filename_completion_ignore; + + /* Bind C-xC-e to invoke emacs and run result as commands. */ + rl_bind_key_if_unbound_in_map (CTRL ('E'), emacs_edit_and_execute_command, emacs_ctlx_keymap); +#if defined (VI_MODE) + rl_bind_key_if_unbound_in_map ('v', vi_edit_and_execute_command, vi_movement_keymap); +# if defined (ALIAS) + rl_bind_key_if_unbound_in_map ('@', posix_edit_macros, vi_movement_keymap); +# endif + + rl_bind_key_in_map ('\\', bash_vi_complete, vi_movement_keymap); + rl_bind_key_in_map ('*', bash_vi_complete, vi_movement_keymap); + rl_bind_key_in_map ('=', bash_vi_complete, vi_movement_keymap); +#endif + + rl_completer_quote_characters = "'\""; + + /* This sets rl_completer_word_break_characters and rl_special_prefixes + to the appropriate values, depending on whether or not hostname + completion is enabled. */ + enable_hostname_completion (perform_hostname_completion); + + /* characters that need to be quoted when appearing in filenames. */ + rl_filename_quote_characters = default_filename_quote_characters; + set_filename_bstab (rl_filename_quote_characters); + + rl_filename_quoting_function = bash_quote_filename; + rl_filename_dequoting_function = bash_dequote_filename; + rl_char_is_quoted_p = char_is_quoted; + +#if 0 + /* This is superfluous and makes it impossible to use tab completion in + vi mode even when explicitly binding it in ~/.inputrc. sv_strict_posix() + should already have called posix_readline_initialize() when + posixly_correct was set. */ + if (posixly_correct) + posix_readline_initialize (1); +#endif + + bash_readline_initialized = 1; +} + +void +bashline_reinitialize () +{ + bash_readline_initialized = 0; +} + +void +bashline_set_event_hook () +{ + rl_signal_event_hook = bash_event_hook; +} + +void +bashline_reset_event_hook () +{ + rl_signal_event_hook = 0; +} + +/* On Sun systems at least, rl_attempted_completion_function can end up + getting set to NULL, and rl_completion_entry_function set to do command + word completion if Bash is interrupted while trying to complete a command + word. This just resets all the completion functions to the right thing. + It's called from throw_to_top_level(). */ +void +bashline_reset () +{ + tilde_initialize (); + rl_attempted_completion_function = attempt_shell_completion; + rl_completion_entry_function = NULL; + rl_ignore_some_completions_function = filename_completion_ignore; + rl_filename_quote_characters = default_filename_quote_characters; + set_filename_bstab (rl_filename_quote_characters); + + set_directory_hook (); + rl_filename_stat_hook = bash_filename_stat_hook; + + bashline_reset_event_hook (); +} + +/* Contains the line to push into readline. */ +static char *push_to_readline = (char *)NULL; + +/* Push the contents of push_to_readline into the + readline buffer. */ +static int +bash_push_line () +{ + if (push_to_readline) + { + rl_insert_text (push_to_readline); + free (push_to_readline); + push_to_readline = (char *)NULL; + rl_startup_hook = old_rl_startup_hook; + } + return 0; +} + +/* Call this to set the initial text for the next line to read + from readline. */ +int +bash_re_edit (line) + char *line; +{ + FREE (push_to_readline); + + push_to_readline = savestring (line); + old_rl_startup_hook = rl_startup_hook; + rl_startup_hook = bash_push_line; + + return (0); +} + +static int +display_shell_version (count, c) + int count, c; +{ + rl_crlf (); + show_shell_version (0); + putc ('\r', rl_outstream); + fflush (rl_outstream); + rl_on_new_line (); + rl_redisplay (); + return 0; +} + +/* **************************************************************** */ +/* */ +/* Readline Stuff */ +/* */ +/* **************************************************************** */ + +/* If the user requests hostname completion, then simply build a list + of hosts, and complete from that forever more, or at least until + HOSTFILE is unset. */ + +/* THIS SHOULD BE A STRINGLIST. */ +/* The kept list of hostnames. */ +static char **hostname_list = (char **)NULL; + +/* The physical size of the above list. */ +static int hostname_list_size; + +/* The number of hostnames in the above list. */ +static int hostname_list_length; + +/* Whether or not HOSTNAME_LIST has been initialized. */ +int hostname_list_initialized = 0; + +/* Initialize the hostname completion table. */ +static void +initialize_hostname_list () +{ + char *temp; + + temp = get_string_value ("HOSTFILE"); + if (temp == 0) + temp = get_string_value ("hostname_completion_file"); + if (temp == 0) + temp = DEFAULT_HOSTS_FILE; + + snarf_hosts_from_file (temp); + + if (hostname_list) + hostname_list_initialized++; +} + +/* Add NAME to the list of hosts. */ +static void +add_host_name (name) + char *name; +{ + if (hostname_list_length + 2 > hostname_list_size) + { + hostname_list_size = (hostname_list_size + 32) - (hostname_list_size % 32); + hostname_list = strvec_resize (hostname_list, hostname_list_size); + } + + hostname_list[hostname_list_length++] = savestring (name); + hostname_list[hostname_list_length] = (char *)NULL; +} + +#define cr_whitespace(c) ((c) == '\r' || (c) == '\n' || whitespace(c)) + +static void +snarf_hosts_from_file (filename) + char *filename; +{ + FILE *file; + char *temp, buffer[256], name[256]; + register int i, start; + + file = fopen (filename, "r"); + if (file == 0) + return; + + while (temp = fgets (buffer, 255, file)) + { + /* Skip to first character. */ + for (i = 0; buffer[i] && cr_whitespace (buffer[i]); i++) + ; + + /* If comment or blank line, ignore. */ + if (buffer[i] == '\0' || buffer[i] == '#') + continue; + + /* If `preprocessor' directive, do the include. */ + if (strncmp (buffer + i, "$include ", 9) == 0) + { + char *incfile, *t; + + /* Find start of filename. */ + for (incfile = buffer + i + 9; *incfile && whitespace (*incfile); incfile++) + ; + + /* Find end of filename. */ + for (t = incfile; *t && cr_whitespace (*t) == 0; t++) + ; + + *t = '\0'; + + snarf_hosts_from_file (incfile); + continue; + } + + /* Skip internet address if present. */ + if (DIGIT (buffer[i])) + for (; buffer[i] && cr_whitespace (buffer[i]) == 0; i++); + + /* Gobble up names. Each name is separated with whitespace. */ + while (buffer[i]) + { + for (; cr_whitespace (buffer[i]); i++) + ; + if (buffer[i] == '\0' || buffer[i] == '#') + break; + + /* Isolate the current word. */ + for (start = i; buffer[i] && cr_whitespace (buffer[i]) == 0; i++) + ; + if (i == start) + continue; + strncpy (name, buffer + start, i - start); + name[i - start] = '\0'; + add_host_name (name); + } + } + fclose (file); +} + +/* Return the hostname list. */ +char ** +get_hostname_list () +{ + if (hostname_list_initialized == 0) + initialize_hostname_list (); + return (hostname_list); +} + +void +clear_hostname_list () +{ + register int i; + + if (hostname_list_initialized == 0) + return; + for (i = 0; i < hostname_list_length; i++) + free (hostname_list[i]); + hostname_list_length = hostname_list_initialized = 0; +} + +/* Return a NULL terminated list of hostnames which begin with TEXT. + Initialize the hostname list the first time if necessary. + The array is malloc ()'ed, but not the individual strings. */ +static char ** +hostnames_matching (text) + char *text; +{ + register int i, len, nmatch, rsize; + char **result; + + if (hostname_list_initialized == 0) + initialize_hostname_list (); + + if (hostname_list_initialized == 0) + return ((char **)NULL); + + /* Special case. If TEXT consists of nothing, then the whole list is + what is desired. */ + if (*text == '\0') + { + result = strvec_create (1 + hostname_list_length); + for (i = 0; i < hostname_list_length; i++) + result[i] = hostname_list[i]; + result[i] = (char *)NULL; + return (result); + } + + /* Scan until found, or failure. */ + len = strlen (text); + result = (char **)NULL; + for (i = nmatch = rsize = 0; i < hostname_list_length; i++) + { + if (STREQN (text, hostname_list[i], len) == 0) + continue; + + /* OK, it matches. Add it to the list. */ + if (nmatch >= (rsize - 1)) + { + rsize = (rsize + 16) - (rsize % 16); + result = strvec_resize (result, rsize); + } + + result[nmatch++] = hostname_list[i]; + } + if (nmatch) + result[nmatch] = (char *)NULL; + return (result); +} + +/* The equivalent of the Korn shell C-o operate-and-get-next-history-line + editing command. */ +static int saved_history_line_to_use = -1; +static int last_saved_history_line = -1; + +#define HISTORY_FULL() (history_is_stifled () && history_length >= history_max_entries) + +static int +set_saved_history () +{ + /* XXX - compensate for assumption that history was `shuffled' if it was + actually not. */ + if (HISTORY_FULL () && + hist_last_line_added == 0 && + saved_history_line_to_use < history_length - 1) + saved_history_line_to_use++; + + if (saved_history_line_to_use >= 0) + { + rl_get_previous_history (history_length - saved_history_line_to_use, 0); + last_saved_history_line = saved_history_line_to_use; + } + saved_history_line_to_use = -1; + rl_startup_hook = old_rl_startup_hook; + return (0); +} + +static int +operate_and_get_next (count, c) + int count, c; +{ + int where; + + /* Accept the current line. */ + rl_newline (1, c); + + /* Find the current line, and find the next line to use. */ + where = where_history (); + + if (HISTORY_FULL () || (where >= history_length - 1)) + saved_history_line_to_use = where; + else + saved_history_line_to_use = where + 1; + + old_rl_startup_hook = rl_startup_hook; + rl_startup_hook = set_saved_history; + + return 0; +} + +/* This vi mode command causes VI_EDIT_COMMAND to be run on the current + command being entered (if no explicit argument is given), otherwise on + a command from the history file. */ + +#define VI_EDIT_COMMAND "fc -e \"${VISUAL:-${EDITOR:-vi}}\"" +#define EMACS_EDIT_COMMAND "fc -e \"${VISUAL:-${EDITOR:-emacs}}\"" +#define POSIX_VI_EDIT_COMMAND "fc -e vi" + +static int +edit_and_execute_command (count, c, editing_mode, edit_command) + int count, c, editing_mode; + char *edit_command; +{ + char *command, *metaval; + int r, rrs, metaflag; + sh_parser_state_t ps; + + rrs = rl_readline_state; + saved_command_line_count = current_command_line_count; + + /* Accept the current line. */ + rl_newline (1, c); + + if (rl_explicit_arg) + { + command = (char *)xmalloc (strlen (edit_command) + 8); + sprintf (command, "%s %d", edit_command, count); + } + else + { + /* Take the command we were just editing, add it to the history file, + then call fc to operate on it. We have to add a dummy command to + the end of the history because fc ignores the last command (assumes + it's supposed to deal with the command before the `fc'). */ + /* This breaks down when using command-oriented history and are not + finished with the command, so we should not ignore the last command */ + using_history (); + current_command_line_count++; /* for rl_newline above */ + bash_add_history (rl_line_buffer); + current_command_line_count = 0; /* for dummy history entry */ + bash_add_history (""); + history_lines_this_session++; + using_history (); + command = savestring (edit_command); + } + + metaval = rl_variable_value ("input-meta"); + metaflag = RL_BOOLEAN_VARIABLE_VALUE (metaval); + + /* Now, POSIX.1-2001 and SUSv3 say that the commands executed from the + temporary file should be placed into the history. We don't do that + yet. */ + if (rl_deprep_term_function) + (*rl_deprep_term_function) (); + save_parser_state (&ps); + r = parse_and_execute (command, (editing_mode == VI_EDITING_MODE) ? "v" : "C-xC-e", SEVAL_NOHIST); + restore_parser_state (&ps); + if (rl_prep_term_function) + (*rl_prep_term_function) (metaflag); + + current_command_line_count = saved_command_line_count; + + /* Now erase the contents of the current line and undo the effects of the + rl_accept_line() above. We don't even want to make the text we just + executed available for undoing. */ + rl_line_buffer[0] = '\0'; /* XXX */ + rl_point = rl_end = 0; + rl_done = 0; + rl_readline_state = rrs; + + rl_forced_update_display (); + + return r; +} + +#if defined (VI_MODE) +static int +vi_edit_and_execute_command (count, c) + int count, c; +{ + if (posixly_correct) + return (edit_and_execute_command (count, c, VI_EDITING_MODE, POSIX_VI_EDIT_COMMAND)); + else + return (edit_and_execute_command (count, c, VI_EDITING_MODE, VI_EDIT_COMMAND)); +} +#endif /* VI_MODE */ + +static int +emacs_edit_and_execute_command (count, c) + int count, c; +{ + return (edit_and_execute_command (count, c, EMACS_EDITING_MODE, EMACS_EDIT_COMMAND)); +} + +#if defined (ALIAS) +static int +posix_edit_macros (count, key) + int count, key; +{ + int c; + char alias_name[3], *alias_value, *macro; + + c = rl_read_key (); + alias_name[0] = '_'; + alias_name[1] = c; + alias_name[2] = '\0'; + + alias_value = get_alias_value (alias_name); + if (alias_value && *alias_value) + { + macro = savestring (alias_value); + rl_push_macro_input (macro); + } + return 0; +} +#endif + +/* Bindable commands that move `shell-words': that is, sequences of + non-unquoted-metacharacters. */ + +#define WORDDELIM(c) (shellmeta(c) || shellblank(c)) + +static int +bash_forward_shellword (count, key) + int count, key; +{ + size_t slen; + int sindex, c, p; + DECLARE_MBSTATE; + + if (count < 0) + return (bash_backward_shellword (-count, key)); + + /* The tricky part of this is deciding whether or not the first character + we're on is an unquoted metacharacter. Not completely handled yet. */ + /* XXX - need to test this stuff with backslash-escaped shell + metacharacters and unclosed single- and double-quoted strings. */ + + p = rl_point; + slen = rl_end; + + while (count) + { + if (p == rl_end) + { + rl_point = rl_end; + return 0; + } + + /* Are we in a quoted string? If we are, move to the end of the quoted + string and continue the outer loop. We only want quoted strings, not + backslash-escaped characters, but char_is_quoted doesn't + differentiate. */ + if (char_is_quoted (rl_line_buffer, p) && p > 0 && rl_line_buffer[p-1] != '\\') + { + do + ADVANCE_CHAR (rl_line_buffer, slen, p); + while (p < rl_end && char_is_quoted (rl_line_buffer, p)); + count--; + continue; + } + + /* Rest of code assumes we are not in a quoted string. */ + /* Move forward until we hit a non-metacharacter. */ + while (p < rl_end && (c = rl_line_buffer[p]) && WORDDELIM (c)) + { + switch (c) + { + default: + ADVANCE_CHAR (rl_line_buffer, slen, p); + continue; /* straight back to loop, don't increment p */ + case '\\': + if (p < rl_end && rl_line_buffer[p]) + ADVANCE_CHAR (rl_line_buffer, slen, p); + break; + case '\'': + p = skip_to_delim (rl_line_buffer, ++p, "'", SD_NOJMP); + break; + case '"': + p = skip_to_delim (rl_line_buffer, ++p, "\"", SD_NOJMP); + break; + } + + if (p < rl_end) + p++; + } + + if (rl_line_buffer[p] == 0 || p == rl_end) + { + rl_point = rl_end; + rl_ding (); + return 0; + } + + /* Now move forward until we hit a non-quoted metacharacter or EOL */ + while (p < rl_end && (c = rl_line_buffer[p]) && WORDDELIM (c) == 0) + { + switch (c) + { + default: + ADVANCE_CHAR (rl_line_buffer, slen, p); + continue; /* straight back to loop, don't increment p */ + case '\\': + if (p < rl_end && rl_line_buffer[p]) + ADVANCE_CHAR (rl_line_buffer, slen, p); + break; + case '\'': + p = skip_to_delim (rl_line_buffer, ++p, "'", SD_NOJMP); + break; + case '"': + p = skip_to_delim (rl_line_buffer, ++p, "\"", SD_NOJMP); + break; + } + + if (p < rl_end) + p++; + } + + if (p == rl_end || rl_line_buffer[p] == 0) + { + rl_point = rl_end; + return (0); + } + + count--; + } + + rl_point = p; + return (0); +} + +static int +bash_backward_shellword (count, key) + int count, key; +{ + size_t slen; + int sindex, c, p; + DECLARE_MBSTATE; + + if (count < 0) + return (bash_forward_shellword (-count, key)); + + p = rl_point; + slen = rl_end; + + while (count) + { + if (p == 0) + { + rl_point = 0; + return 0; + } + + /* Move backward until we hit a non-metacharacter. */ + while (p > 0) + { + c = rl_line_buffer[p]; + if (WORDDELIM (c) && char_is_quoted (rl_line_buffer, p) == 0) + BACKUP_CHAR (rl_line_buffer, slen, p); + break; + } + + if (p == 0) + { + rl_point = 0; + return 0; + } + + /* Now move backward until we hit a metacharacter or BOL. */ + while (p > 0) + { + c = rl_line_buffer[p]; + if (WORDDELIM (c) && char_is_quoted (rl_line_buffer, p) == 0) + break; + BACKUP_CHAR (rl_line_buffer, slen, p); + } + + count--; + } + + rl_point = p; + return 0; +} + +static int +bash_kill_shellword (count, key) + int count, key; +{ + int p; + + if (count < 0) + return (bash_backward_kill_shellword (-count, key)); + + p = rl_point; + bash_forward_shellword (count, key); + + if (rl_point != p) + rl_kill_text (p, rl_point); + + rl_point = p; + if (rl_editing_mode == 1) /* 1 == emacs_mode */ + rl_mark = rl_point; + + return 0; +} + +static int +bash_backward_kill_shellword (count, key) + int count, key; +{ + int p; + + if (count < 0) + return (bash_kill_shellword (-count, key)); + + p = rl_point; + bash_backward_shellword (count, key); + + if (rl_point != p) + rl_kill_text (p, rl_point); + + if (rl_editing_mode == 1) /* 1 == emacs_mode */ + rl_mark = rl_point; + + return 0; +} + + +/* **************************************************************** */ +/* */ +/* How To Do Shell Completion */ +/* */ +/* **************************************************************** */ + +#define COMMAND_SEPARATORS ";|&{(`" +/* )} */ +#define COMMAND_SEPARATORS_PLUS_WS ";|&{(` \t" +/* )} */ + +/* check for redirections and other character combinations that are not + command separators */ +static int +check_redir (ti) + int ti; +{ + register int this_char, prev_char; + + /* Handle the two character tokens `>&', `<&', and `>|'. + We are not in a command position after one of these. */ + this_char = rl_line_buffer[ti]; + prev_char = rl_line_buffer[ti - 1]; + + if ((this_char == '&' && (prev_char == '<' || prev_char == '>')) || + (this_char == '|' && prev_char == '>')) + return (1); + else if (this_char == '{' && prev_char == '$') /*}*/ + return (1); +#if 0 /* Not yet */ + else if (this_char == '(' && prev_char == '$') /*)*/ + return (1); + else if (this_char == '(' && prev_char == '<') /*)*/ + return (1); +#if defined (EXTENDED_GLOB) + else if (extended_glob && this_char == '(' && prev_char == '!') /*)*/ + return (1); +#endif +#endif + else if (char_is_quoted (rl_line_buffer, ti)) + return (1); + return (0); +} + +#if defined (PROGRAMMABLE_COMPLETION) +/* + * XXX - because of the <= start test, and setting os = s+1, this can + * potentially return os > start. This is probably not what we want to + * happen, but fix later after 2.05a-release. + */ +static int +find_cmd_start (start) + int start; +{ + register int s, os; + + os = 0; + /* Flags == SD_NOJMP only because we want to skip over command substitutions + in assignment statements. Have to test whether this affects `standalone' + command substitutions as individual words. */ + while (((s = skip_to_delim (rl_line_buffer, os, COMMAND_SEPARATORS, SD_NOJMP/*|SD_NOSKIPCMD*/)) <= start) && + rl_line_buffer[s]) + os = s+1; + return os; +} + +static int +find_cmd_end (end) + int end; +{ + register int e; + + e = skip_to_delim (rl_line_buffer, end, COMMAND_SEPARATORS, SD_NOJMP); + return e; +} + +static char * +find_cmd_name (start, sp, ep) + int start; + int *sp, *ep; +{ + char *name; + register int s, e; + + for (s = start; whitespace (rl_line_buffer[s]); s++) + ; + + /* skip until a shell break character */ + e = skip_to_delim (rl_line_buffer, s, "()<>;&| \t\n", SD_NOJMP); + + name = substring (rl_line_buffer, s, e); + + if (sp) + *sp = s; + if (ep) + *ep = e; + + return (name); +} + +static char * +prog_complete_return (text, matchnum) + const char *text; + int matchnum; +{ + static int ind; + + if (matchnum == 0) + ind = 0; + + if (prog_complete_matches == 0 || prog_complete_matches[ind] == 0) + return (char *)NULL; + return (prog_complete_matches[ind++]); +} + +#endif /* PROGRAMMABLE_COMPLETION */ + +/* Do some completion on TEXT. The indices of TEXT in RL_LINE_BUFFER are + at START and END. Return an array of matches, or NULL if none. */ +static char ** +attempt_shell_completion (text, start, end) + const char *text; + int start, end; +{ + int in_command_position, ti, saveti, qc, dflags; + char **matches, *command_separator_chars; +#if defined (PROGRAMMABLE_COMPLETION) + int have_progcomps, was_assignment; +#endif + + command_separator_chars = COMMAND_SEPARATORS; + matches = (char **)NULL; + rl_ignore_some_completions_function = filename_completion_ignore; + + rl_filename_quote_characters = default_filename_quote_characters; + set_filename_bstab (rl_filename_quote_characters); + set_directory_hook (); + rl_filename_stat_hook = bash_filename_stat_hook; + + /* Determine if this could be a command word. It is if it appears at + the start of the line (ignoring preceding whitespace), or if it + appears after a character that separates commands. It cannot be a + command word if we aren't at the top-level prompt. */ + ti = start - 1; + saveti = qc = -1; + + while ((ti > -1) && (whitespace (rl_line_buffer[ti]))) + ti--; + +#if 1 + /* If this is an open quote, maybe we're trying to complete a quoted + command name. */ + if (ti >= 0 && (rl_line_buffer[ti] == '"' || rl_line_buffer[ti] == '\'')) + { + qc = rl_line_buffer[ti]; + saveti = ti--; + while (ti > -1 && (whitespace (rl_line_buffer[ti]))) + ti--; + } +#endif + + in_command_position = 0; + if (ti < 0) + { + /* Only do command completion at the start of a line when we + are prompting at the top level. */ + if (current_prompt_string == ps1_prompt) + in_command_position++; + else if (parser_in_command_position ()) + in_command_position++; + } + else if (member (rl_line_buffer[ti], command_separator_chars)) + { + in_command_position++; + + if (check_redir (ti) == 1) + in_command_position = 0; + } + else + { + /* This still could be in command position. It is possible + that all of the previous words on the line are variable + assignments. */ + } + + /* Check that we haven't incorrectly flagged a closed command substitution + as indicating we're in a command position. */ + if (in_command_position && ti >= 0 && rl_line_buffer[ti] == '`' && + *text != '`' && unclosed_pair (rl_line_buffer, end, "`") == 0) + in_command_position = 0; + + /* Special handling for command substitution. If *TEXT is a backquote, + it can be the start or end of an old-style command substitution, or + unmatched. If it's unmatched, both calls to unclosed_pair will + succeed. Don't bother if readline found a single quote and we are + completing on the substring. */ + if (*text == '`' && rl_completion_quote_character != '\'' && + (in_command_position || (unclosed_pair (rl_line_buffer, start, "`") && + unclosed_pair (rl_line_buffer, end, "`")))) + matches = rl_completion_matches (text, command_subst_completion_function); + +#if defined (PROGRAMMABLE_COMPLETION) + /* Attempt programmable completion. */ + have_progcomps = prog_completion_enabled && (progcomp_size () > 0); + if (matches == 0 && (in_command_position == 0 || text[0] == '\0') && + current_prompt_string == ps1_prompt) + { + int s, e, s1, e1, os, foundcs; + char *n; + + /* XXX - don't free the members */ + if (prog_complete_matches) + free (prog_complete_matches); + prog_complete_matches = (char **)NULL; + + os = start; + n = 0; + s = find_cmd_start (os); + e = find_cmd_end (end); + do + { + /* Skip over assignment statements preceding a command name. If we + don't find a command name at all, we can perform command name + completion. If we find a partial command name, we should perform + command name completion on it. */ + FREE (n); + n = find_cmd_name (s, &s1, &e1); + s = e1 + 1; + } + while (was_assignment = assignment (n, 0)); + s = s1; /* reset to index where name begins */ + + /* s == index of where command name begins (reset above) + e == end of current command, may be end of line + s1 = index of where command name begins + e1 == index of where command name ends + start == index of where word to be completed begins + end == index of where word to be completed ends + if (s == start) we are doing command word completion for sure + if (e1 == end) we are at the end of the command name and completing it */ + if (start == 0 && end == 0 && e != 0 && text[0] == '\0') /* beginning of non-empty line */ + foundcs = 0; + else if (start == end && start == s1 && e != 0 && e1 > end) /* beginning of command name, leading whitespace */ + foundcs = 0; + else if (e == 0 && e == s && text[0] == '\0' && have_progcomps) /* beginning of empty line */ + prog_complete_matches = programmable_completions ("_EmptycmD_", text, s, e, &foundcs); + else if (start == end && text[0] == '\0' && s1 > start && whitespace (rl_line_buffer[start])) + foundcs = 0; /* whitespace before command name */ + else if (e > s && was_assignment == 0 && e1 == end && rl_line_buffer[e] == 0 && whitespace (rl_line_buffer[e-1]) == 0) + { + /* not assignment statement, but still want to perform command + completion if we are composing command word. */ + foundcs = 0; + in_command_position = s == start && STREQ (n, text); /* XXX */ + } + else if (e > s && was_assignment == 0 && have_progcomps) + { + prog_complete_matches = programmable_completions (n, text, s, e, &foundcs); + /* command completion if programmable completion fails */ + in_command_position = s == start && STREQ (n, text); /* XXX */ + } + else if (s >= e && n[0] == '\0' && text[0] == '\0' && start > 0) + { + foundcs = 0; /* empty command name following assignments */ + in_command_position = was_assignment; + } + else if (s == start && e == end && STREQ (n, text) && start > 0) + { + foundcs = 0; /* partial command name following assignments */ + in_command_position = 1; + } + else + foundcs = 0; + FREE (n); + /* XXX - if we found a COMPSPEC for the command, just return whatever + the programmable completion code returns, and disable the default + filename completion that readline will do unless the COPT_DEFAULT + option has been set with the `-o default' option to complete or + compopt. */ + if (foundcs) + { + pcomp_set_readline_variables (foundcs, 1); + /* Turn what the programmable completion code returns into what + readline wants. I should have made compute_lcd_of_matches + external... */ + matches = rl_completion_matches (text, prog_complete_return); + if ((foundcs & COPT_DEFAULT) == 0) + rl_attempted_completion_over = 1; /* no default */ + if (matches || ((foundcs & COPT_BASHDEFAULT) == 0)) + return (matches); + } + } +#endif + + if (matches == 0) + { + dflags = 0; + if (in_command_position) + dflags |= DEFCOMP_CMDPOS; + matches = bash_default_completion (text, start, end, qc, dflags); + } + + return matches; +} + +char ** +bash_default_completion (text, start, end, qc, compflags) + const char *text; + int start, end, qc, compflags; +{ + char **matches, *t; + + matches = (char **)NULL; + + /* New posix-style command substitution or variable name? */ + if (!matches && *text == '$') + { + if (qc != '\'' && text[1] == '(') /* ) */ + matches = rl_completion_matches (text, command_subst_completion_function); + else + { + matches = rl_completion_matches (text, variable_completion_function); + if (matches && matches[0] && matches[1] == 0) + { + t = savestring (matches[0]); + bash_filename_stat_hook (&t); + /* doesn't use test_for_directory because that performs tilde + expansion */ + if (file_isdir (t)) + rl_completion_append_character = '/'; + free (t); + } + } + } + + /* If the word starts in `~', and there is no slash in the word, then + try completing this word as a username. */ + if (matches == 0 && *text == '~' && mbschr (text, '/') == 0) + matches = rl_completion_matches (text, rl_username_completion_function); + + /* Another one. Why not? If the word starts in '@', then look through + the world of known hostnames for completion first. */ + if (matches == 0 && perform_hostname_completion && *text == '@') + matches = rl_completion_matches (text, hostname_completion_function); + + /* And last, (but not least) if this word is in a command position, then + complete over possible command names, including aliases, functions, + and command names. */ + if (matches == 0 && (compflags & DEFCOMP_CMDPOS)) + { + /* If END == START and text[0] == 0, we are trying to complete an empty + command word. */ + if (no_empty_command_completion && end == start && text[0] == '\0') + { + matches = (char **)NULL; + rl_ignore_some_completions_function = bash_ignore_everything; + } + else + { +#define CMD_IS_DIR(x) (absolute_pathname(x) == 0 && absolute_program(x) == 0 && *(x) != '~' && test_for_directory (x)) + + dot_in_path = 0; + matches = rl_completion_matches (text, command_word_completion_function); + + /* If we are attempting command completion and nothing matches, we + do not want readline to perform filename completion for us. We + still want to be able to complete partial pathnames, so set the + completion ignore function to something which will remove + filenames and leave directories in the match list. */ + if (matches == (char **)NULL) + rl_ignore_some_completions_function = bash_ignore_filenames; + else if (matches[1] == 0 && CMD_IS_DIR(matches[0]) && dot_in_path == 0) + /* If we found a single match, without looking in the current + directory (because it's not in $PATH), but the found name is + also a command in the current directory, suppress appending any + terminating character, since it's ambiguous. */ + { + rl_completion_suppress_append = 1; + rl_filename_completion_desired = 0; + } + else if (matches[0] && matches[1] && STREQ (matches[0], matches[1]) && CMD_IS_DIR (matches[0])) + /* There are multiple instances of the same match (duplicate + completions haven't yet been removed). In this case, all of + the matches will be the same, and the duplicate removal code + will distill them all down to one. We turn on + rl_completion_suppress_append for the same reason as above. + Remember: we only care if there's eventually a single unique + completion. If there are multiple completions this won't + make a difference and the problem won't occur. */ + { + rl_completion_suppress_append = 1; + rl_filename_completion_desired = 0; + } + } + } + + /* This could be a globbing pattern, so try to expand it using pathname + expansion. */ + if (!matches && glob_pattern_p (text)) + { + matches = rl_completion_matches (text, glob_complete_word); + /* A glob expression that matches more than one filename is problematic. + If we match more than one filename, punt. */ + if (matches && matches[1] && rl_completion_type == TAB) + { + strvec_dispose (matches); + matches = (char **)0; + } + else if (matches && matches[1] && rl_completion_type == '!') + { + rl_completion_suppress_append = 1; + rl_filename_completion_desired = 0; + } + } + + return (matches); +} + +static int +bash_command_name_stat_hook (name) + char **name; +{ + char *cname, *result; + + /* If it's not something we're going to look up in $PATH, just call the + normal filename stat hook. */ + if (absolute_program (*name)) + return (bash_filename_stat_hook (name)); + + cname = *name; + /* XXX - we could do something here with converting aliases, builtins, + and functions into something that came out as executable, but we don't. */ + result = search_for_command (cname, 0); + if (result) + { + *name = result; + return 1; + } + return 0; +} + +static int +executable_completion (filename, searching_path) + const char *filename; + int searching_path; +{ + char *f; + int r; + + f = savestring (filename); + bash_directory_completion_hook (&f); + + r = searching_path ? executable_file (f) : executable_or_directory (f); + free (f); + return r; +} + +/* This is the function to call when the word to complete is in a position + where a command word can be found. It grovels $PATH, looking for commands + that match. It also scans aliases, function names, and the shell_builtin + table. */ +char * +command_word_completion_function (hint_text, state) + const char *hint_text; + int state; +{ + static char *hint = (char *)NULL; + static char *path = (char *)NULL; + static char *val = (char *)NULL; + static char *filename_hint = (char *)NULL; + static char *fnhint = (char *)NULL; + static char *dequoted_hint = (char *)NULL; + static char *directory_part = (char *)NULL; + static char **glob_matches = (char **)NULL; + static int path_index, hint_len, dequoted_len, istate, igncase; + static int mapping_over, local_index, searching_path, hint_is_dir; + static int old_glob_ignore_case, globpat; + static SHELL_VAR **varlist = (SHELL_VAR **)NULL; +#if defined (ALIAS) + static alias_t **alias_list = (alias_t **)NULL; +#endif /* ALIAS */ + char *temp, *cval; + + /* We have to map over the possibilities for command words. If we have + no state, then make one just for that purpose. */ + if (state == 0) + { + rl_filename_stat_hook = bash_command_name_stat_hook; + + if (dequoted_hint && dequoted_hint != hint) + free (dequoted_hint); + if (hint) + free (hint); + + mapping_over = searching_path = 0; + hint_is_dir = CMD_IS_DIR (hint_text); + val = (char *)NULL; + + temp = rl_variable_value ("completion-ignore-case"); + igncase = RL_BOOLEAN_VARIABLE_VALUE (temp); + + if (glob_matches) + { + free (glob_matches); + glob_matches = (char **)NULL; + } + + globpat = glob_pattern_p (hint_text); + + /* If this is an absolute program name, do not check it against + aliases, reserved words, functions or builtins. We must check + whether or not it is unique, and, if so, whether that filename + is executable. */ + if (globpat || absolute_program (hint_text)) + { + /* Perform tilde expansion on what's passed, so we don't end up + passing filenames with tildes directly to stat(). */ + if (*hint_text == '~') + { + hint = bash_tilde_expand (hint_text, 0); + directory_part = savestring (hint_text); + temp = strchr (directory_part, '/'); + if (temp) + *temp = 0; + else + { + free (directory_part); + directory_part = (char *)NULL; + } + } + else + hint = savestring (hint_text); + + dequoted_hint = hint; + /* If readline's completer found a quote character somewhere, but + didn't set the quote character, there must have been a quote + character embedded in the filename. It can't be at the start of + the filename, so we need to dequote the filename before we look + in the file system for it. */ + if (rl_completion_found_quote && rl_completion_quote_character == 0) + { + dequoted_hint = bash_dequote_filename (hint, 0); + free (hint); + hint = dequoted_hint; + } + dequoted_len = hint_len = strlen (hint); + + if (filename_hint) + free (filename_hint); + + fnhint = filename_hint = savestring (hint); + + istate = 0; + + if (globpat) + { + mapping_over = 5; + goto globword; + } + else + { + if (dircomplete_expand && path_dot_or_dotdot (filename_hint)) + { + dircomplete_expand = 0; + set_directory_hook (); + dircomplete_expand = 1; + } + mapping_over = 4; + goto inner; + } + } + + dequoted_hint = hint = savestring (hint_text); + dequoted_len = hint_len = strlen (hint); + + if (rl_completion_found_quote && rl_completion_quote_character == 0) + { + dequoted_hint = bash_dequote_filename (hint, 0); + dequoted_len = strlen (dequoted_hint); + } + + path = get_string_value ("PATH"); + path_index = dot_in_path = 0; + + /* Initialize the variables for each type of command word. */ + local_index = 0; + + if (varlist) + free (varlist); + + varlist = all_visible_functions (); + +#if defined (ALIAS) + if (alias_list) + free (alias_list); + + alias_list = all_aliases (); +#endif /* ALIAS */ + } + + /* mapping_over says what we are currently hacking. Note that every case + in this list must fall through when there are no more possibilities. */ + + switch (mapping_over) + { + case 0: /* Aliases come first. */ +#if defined (ALIAS) + while (alias_list && alias_list[local_index]) + { + register char *alias; + + alias = alias_list[local_index++]->name; + + if (STREQN (alias, hint, hint_len)) + return (savestring (alias)); + } +#endif /* ALIAS */ + local_index = 0; + mapping_over++; + + case 1: /* Then shell reserved words. */ + { + while (word_token_alist[local_index].word) + { + register char *reserved_word; + + reserved_word = word_token_alist[local_index++].word; + + if (STREQN (reserved_word, hint, hint_len)) + return (savestring (reserved_word)); + } + local_index = 0; + mapping_over++; + } + + case 2: /* Then function names. */ + while (varlist && varlist[local_index]) + { + register char *varname; + + varname = varlist[local_index++]->name; + + if (STREQN (varname, hint, hint_len)) + return (savestring (varname)); + } + local_index = 0; + mapping_over++; + + case 3: /* Then shell builtins. */ + for (; local_index < num_shell_builtins; local_index++) + { + /* Ignore it if it doesn't have a function pointer or if it + is not currently enabled. */ + if (!shell_builtins[local_index].function || + (shell_builtins[local_index].flags & BUILTIN_ENABLED) == 0) + continue; + + if (STREQN (shell_builtins[local_index].name, hint, hint_len)) + { + int i = local_index++; + + return (savestring (shell_builtins[i].name)); + } + } + local_index = 0; + mapping_over++; + } + +globword: + /* Limited support for completing command words with globbing chars. Only + a single match (multiple matches that end up reducing the number of + characters in the common prefix are bad) will ever be returned on + regular completion. */ + if (globpat) + { + if (state == 0) + { + glob_ignore_case = igncase; + glob_matches = shell_glob_filename (hint); + glob_ignore_case = old_glob_ignore_case; + + if (GLOB_FAILED (glob_matches) || glob_matches == 0) + { + glob_matches = (char **)NULL; + return ((char *)NULL); + } + + local_index = 0; + + if (glob_matches[1] && rl_completion_type == TAB) /* multiple matches are bad */ + return ((char *)NULL); + } + + while (val = glob_matches[local_index++]) + { + if (executable_or_directory (val)) + { + if (*hint_text == '~' && directory_part) + { + temp = maybe_restore_tilde (val, directory_part); + free (val); + val = temp; + } + return (val); + } + free (val); + } + + glob_ignore_case = old_glob_ignore_case; + return ((char *)NULL); + } + + /* If the text passed is a directory in the current directory, return it + as a possible match. Executables in directories in the current + directory can be specified using relative pathnames and successfully + executed even when `.' is not in $PATH. */ + if (hint_is_dir) + { + hint_is_dir = 0; /* only return the hint text once */ + return (savestring (hint_text)); + } + + /* Repeatedly call filename_completion_function while we have + members of PATH left. Question: should we stat each file? + Answer: we call executable_file () on each file. */ + outer: + + istate = (val != (char *)NULL); + + if (istate == 0) + { + char *current_path; + + /* Get the next directory from the path. If there is none, then we + are all done. */ + if (path == 0 || path[path_index] == 0 || + (current_path = extract_colon_unit (path, &path_index)) == 0) + return ((char *)NULL); + + searching_path = 1; + if (*current_path == 0) + { + free (current_path); + current_path = savestring ("."); + } + + if (*current_path == '~') + { + char *t; + + t = bash_tilde_expand (current_path, 0); + free (current_path); + current_path = t; + } + + if (current_path[0] == '.' && current_path[1] == '\0') + dot_in_path = 1; + + if (fnhint && fnhint != filename_hint) + free (fnhint); + if (filename_hint) + free (filename_hint); + + filename_hint = sh_makepath (current_path, hint, 0); + /* Need a quoted version (though it doesn't matter much in most + cases) because rl_filename_completion_function dequotes the + filename it gets, assuming that it's been quoted as part of + the input line buffer. */ + if (strpbrk (filename_hint, "\"'\\")) + fnhint = sh_backslash_quote (filename_hint, filename_bstab, 0); + else + fnhint = filename_hint; + free (current_path); /* XXX */ + } + + inner: + val = rl_filename_completion_function (fnhint, istate); + if (mapping_over == 4 && dircomplete_expand) + set_directory_hook (); + + istate = 1; + + if (val == 0) + { + /* If the hint text is an absolute program, then don't bother + searching through PATH. */ + if (absolute_program (hint)) + return ((char *)NULL); + + goto outer; + } + else + { + int match, freetemp; + + if (absolute_program (hint)) + { + if (igncase == 0) + match = strncmp (val, hint, hint_len) == 0; + else + match = strncasecmp (val, hint, hint_len) == 0; + + /* If we performed tilde expansion, restore the original + filename. */ + if (*hint_text == '~') + temp = maybe_restore_tilde (val, directory_part); + else + temp = savestring (val); + freetemp = 1; + } + else + { + temp = strrchr (val, '/'); + + if (temp) + { + temp++; + if (igncase == 0) + freetemp = match = strncmp (temp, hint, hint_len) == 0; + else + freetemp = match = strncasecmp (temp, hint, hint_len) == 0; + if (match) + temp = savestring (temp); + } + else + freetemp = match = 0; + } + + /* If we have found a match, and it is an executable file, return it. + We don't return directory names when searching $PATH, since the + bash execution code won't find executables in directories which + appear in directories in $PATH when they're specified using + relative pathnames. */ +#if 0 + /* If we're not searching $PATH and we have a relative pathname, we + need to re-canonicalize it before testing whether or not it's an + executable or a directory so the shell treats .. relative to $PWD + according to the physical/logical option. The shell already + canonicalizes the directory name in order to tell readline where + to look, so not doing it here will be inconsistent. */ + /* XXX -- currently not used -- will introduce more inconsistency, + since shell does not canonicalize ../foo before passing it to + shell_execve(). */ + if (match && searching_path == 0 && *val == '.') + { + char *t, *t1; + + t = get_working_directory ("command-word-completion"); + t1 = make_absolute (val, t); + free (t); + cval = sh_canonpath (t1, PATH_CHECKDOTDOT|PATH_CHECKEXISTS); + } + else +#endif + cval = val; + + if (match && executable_completion ((searching_path ? val : cval), searching_path)) + { + if (cval != val) + free (cval); + free (val); + val = ""; /* So it won't be NULL. */ + return (temp); + } + else + { + if (freetemp) + free (temp); + if (cval != val) + free (cval); + free (val); + goto inner; + } + } +} + +/* Completion inside an unterminated command substitution. */ +static char * +command_subst_completion_function (text, state) + const char *text; + int state; +{ + static char **matches = (char **)NULL; + static const char *orig_start; + static char *filename_text = (char *)NULL; + static int cmd_index, start_len; + char *value; + + if (state == 0) + { + if (filename_text) + free (filename_text); + orig_start = text; + if (*text == '`') + text++; + else if (*text == '$' && text[1] == '(') /* ) */ + text += 2; + /* If the text was quoted, suppress any quote character that the + readline completion code would insert. */ + rl_completion_suppress_quote = 1; + start_len = text - orig_start; + filename_text = savestring (text); + if (matches) + free (matches); + + /* + * At this point we can entertain the idea of re-parsing + * `filename_text' into a (possibly incomplete) command name and + * arguments, and doing completion based on that. This is + * currently very rudimentary, but it is a small improvement. + */ + for (value = filename_text + strlen (filename_text) - 1; value > filename_text; value--) + if (whitespace (*value) || member (*value, COMMAND_SEPARATORS)) + break; + if (value <= filename_text) + matches = rl_completion_matches (filename_text, command_word_completion_function); + else + { + value++; + start_len += value - filename_text; + if (whitespace (value[-1])) + matches = rl_completion_matches (value, rl_filename_completion_function); + else + matches = rl_completion_matches (value, command_word_completion_function); + } + + /* If there is more than one match, rl_completion_matches has already + put the lcd in matches[0]. Skip over it. */ + cmd_index = matches && matches[0] && matches[1]; + + /* If there's a single match and it's a directory, set the append char + to the expected `/'. Otherwise, don't append anything. */ + if (matches && matches[0] && matches[1] == 0 && test_for_directory (matches[0])) + rl_completion_append_character = '/'; + else + rl_completion_suppress_append = 1; + } + + if (matches == 0 || matches[cmd_index] == 0) + { + rl_filename_quoting_desired = 0; /* disable quoting */ + return ((char *)NULL); + } + else + { + value = (char *)xmalloc (1 + start_len + strlen (matches[cmd_index])); + + if (start_len == 1) + value[0] = *orig_start; + else + strncpy (value, orig_start, start_len); + + strcpy (value + start_len, matches[cmd_index]); + + cmd_index++; + return (value); + } +} + +/* Okay, now we write the entry_function for variable completion. */ +static char * +variable_completion_function (text, state) + const char *text; + int state; +{ + static char **varlist = (char **)NULL; + static int varlist_index; + static char *varname = (char *)NULL; + static int namelen; + static int first_char, first_char_loc; + + if (!state) + { + if (varname) + free (varname); + + first_char_loc = 0; + first_char = text[0]; + + if (first_char == '$') + first_char_loc++; + + if (text[first_char_loc] == '{') + first_char_loc++; + + varname = savestring (text + first_char_loc); + + namelen = strlen (varname); + if (varlist) + strvec_dispose (varlist); + + varlist = all_variables_matching_prefix (varname); + varlist_index = 0; + } + + if (!varlist || !varlist[varlist_index]) + { + return ((char *)NULL); + } + else + { + char *value; + + value = (char *)xmalloc (4 + strlen (varlist[varlist_index])); + + if (first_char_loc) + { + value[0] = first_char; + if (first_char_loc == 2) + value[1] = '{'; + } + + strcpy (value + first_char_loc, varlist[varlist_index]); + if (first_char_loc == 2) + strcat (value, "}"); + + varlist_index++; + return (value); + } +} + +/* How about a completion function for hostnames? */ +static char * +hostname_completion_function (text, state) + const char *text; + int state; +{ + static char **list = (char **)NULL; + static int list_index = 0; + static int first_char, first_char_loc; + + /* If we don't have any state, make some. */ + if (state == 0) + { + FREE (list); + + list = (char **)NULL; + + first_char_loc = 0; + first_char = *text; + + if (first_char == '@') + first_char_loc++; + + list = hostnames_matching ((char *)text+first_char_loc); + list_index = 0; + } + + if (list && list[list_index]) + { + char *t; + + t = (char *)xmalloc (2 + strlen (list[list_index])); + *t = first_char; + strcpy (t + first_char_loc, list[list_index]); + list_index++; + return (t); + } + + return ((char *)NULL); +} + +/* + * A completion function for service names from /etc/services (or wherever). + */ +char * +bash_servicename_completion_function (text, state) + const char *text; + int state; +{ +#if defined (__WIN32__) || defined (__OPENNT) || !defined (HAVE_GETSERVENT) + return ((char *)NULL); +#else + static char *sname = (char *)NULL; + static struct servent *srvent; + static int snamelen, firstc; + char *value; + char **alist, *aentry; + int afound; + + if (state == 0) + { + FREE (sname); + firstc = *text; + + sname = savestring (text); + snamelen = strlen (sname); + setservent (0); + } + + while (srvent = getservent ()) + { + afound = 0; + if (snamelen == 0 || (STREQN (sname, srvent->s_name, snamelen))) + break; + /* Not primary, check aliases */ + for (alist = srvent->s_aliases; *alist; alist++) + { + aentry = *alist; + if (STREQN (sname, aentry, snamelen)) + { + afound = 1; + break; + } + } + + if (afound) + break; + } + + if (srvent == 0) + { + endservent (); + return ((char *)NULL); + } + + value = afound ? savestring (aentry) : savestring (srvent->s_name); + return value; +#endif +} + +/* + * A completion function for group names from /etc/group (or wherever). + */ +char * +bash_groupname_completion_function (text, state) + const char *text; + int state; +{ +#if defined (__WIN32__) || defined (__OPENNT) || !defined (HAVE_GRP_H) + return ((char *)NULL); +#else + static char *gname = (char *)NULL; + static struct group *grent; + static int gnamelen; + char *value; + + if (state == 0) + { + FREE (gname); + gname = savestring (text); + gnamelen = strlen (gname); + + setgrent (); + } + + while (grent = getgrent ()) + { + if (gnamelen == 0 || (STREQN (gname, grent->gr_name, gnamelen))) + break; + } + + if (grent == 0) + { + endgrent (); + return ((char *)NULL); + } + + value = savestring (grent->gr_name); + return (value); +#endif +} + +/* Functions to perform history and alias expansions on the current line. */ + +#if defined (BANG_HISTORY) +/* Perform history expansion on the current line. If no history expansion + is done, pre_process_line() returns what it was passed, so we need to + allocate a new line here. */ +static char * +history_expand_line_internal (line) + char *line; +{ + char *new_line; + int old_verify; + + old_verify = hist_verify; + hist_verify = 0; + new_line = pre_process_line (line, 0, 0); + hist_verify = old_verify; + + return (new_line == line) ? savestring (line) : new_line; +} +#endif + +/* There was an error in expansion. Let the preprocessor print + the error here. */ +static void +cleanup_expansion_error () +{ + char *to_free; +#if defined (BANG_HISTORY) + int old_verify; + + old_verify = hist_verify; + hist_verify = 0; +#endif + + fprintf (rl_outstream, "\r\n"); + to_free = pre_process_line (rl_line_buffer, 1, 0); +#if defined (BANG_HISTORY) + hist_verify = old_verify; +#endif + if (to_free != rl_line_buffer) + FREE (to_free); + putc ('\r', rl_outstream); + rl_forced_update_display (); +} + +/* If NEW_LINE differs from what is in the readline line buffer, add an + undo record to get from the readline line buffer contents to the new + line and make NEW_LINE the current readline line. */ +static void +maybe_make_readline_line (new_line) + char *new_line; +{ + if (strcmp (new_line, rl_line_buffer) != 0) + { + rl_point = rl_end; + + rl_add_undo (UNDO_BEGIN, 0, 0, 0); + rl_delete_text (0, rl_point); + rl_point = rl_end = rl_mark = 0; + rl_insert_text (new_line); + rl_add_undo (UNDO_END, 0, 0, 0); + } +} + +/* Make NEW_LINE be the current readline line. This frees NEW_LINE. */ +static void +set_up_new_line (new_line) + char *new_line; +{ + int old_point, at_end; + + old_point = rl_point; + at_end = rl_point == rl_end; + + /* If the line was history and alias expanded, then make that + be one thing to undo. */ + maybe_make_readline_line (new_line); + free (new_line); + + /* Place rl_point where we think it should go. */ + if (at_end) + rl_point = rl_end; + else if (old_point < rl_end) + { + rl_point = old_point; + if (!whitespace (rl_line_buffer[rl_point])) + rl_forward_word (1, 0); + } +} + +#if defined (ALIAS) +/* Expand aliases in the current readline line. */ +static int +alias_expand_line (count, ignore) + int count, ignore; +{ + char *new_line; + + new_line = alias_expand (rl_line_buffer); + + if (new_line) + { + set_up_new_line (new_line); + return (0); + } + else + { + cleanup_expansion_error (); + return (1); + } +} +#endif + +#if defined (BANG_HISTORY) +/* History expand the line. */ +static int +history_expand_line (count, ignore) + int count, ignore; +{ + char *new_line; + + new_line = history_expand_line_internal (rl_line_buffer); + + if (new_line) + { + set_up_new_line (new_line); + return (0); + } + else + { + cleanup_expansion_error (); + return (1); + } +} + +/* Expand history substitutions in the current line and then insert a + space (hopefully close to where we were before). */ +static int +tcsh_magic_space (count, ignore) + int count, ignore; +{ + int dist_from_end, old_point; + + old_point = rl_point; + dist_from_end = rl_end - rl_point; + if (history_expand_line (count, ignore) == 0) + { + /* Try a simple heuristic from Stephen Gildea . + This works if all expansions were before rl_point or if no expansions + were performed. */ + rl_point = (old_point == 0) ? old_point : rl_end - dist_from_end; + rl_insert (1, ' '); + return (0); + } + else + return (1); +} +#endif /* BANG_HISTORY */ + +/* History and alias expand the line. */ +static int +history_and_alias_expand_line (count, ignore) + int count, ignore; +{ + char *new_line; + + new_line = 0; +#if defined (BANG_HISTORY) + new_line = history_expand_line_internal (rl_line_buffer); +#endif + +#if defined (ALIAS) + if (new_line) + { + char *alias_line; + + alias_line = alias_expand (new_line); + free (new_line); + new_line = alias_line; + } +#endif /* ALIAS */ + + if (new_line) + { + set_up_new_line (new_line); + return (0); + } + else + { + cleanup_expansion_error (); + return (1); + } +} + +/* History and alias expand the line, then perform the shell word + expansions by calling expand_string. This can't use set_up_new_line() + because we want the variable expansions as a separate undo'able + set of operations. */ +static int +shell_expand_line (count, ignore) + int count, ignore; +{ + char *new_line; + WORD_LIST *expanded_string; + + new_line = 0; +#if defined (BANG_HISTORY) + new_line = history_expand_line_internal (rl_line_buffer); +#endif + +#if defined (ALIAS) + if (new_line) + { + char *alias_line; + + alias_line = alias_expand (new_line); + free (new_line); + new_line = alias_line; + } +#endif /* ALIAS */ + + if (new_line) + { + int old_point = rl_point; + int at_end = rl_point == rl_end; + + /* If the line was history and alias expanded, then make that + be one thing to undo. */ + maybe_make_readline_line (new_line); + free (new_line); + + /* If there is variable expansion to perform, do that as a separate + operation to be undone. */ + new_line = savestring (rl_line_buffer); + expanded_string = expand_string (new_line, 0); + FREE (new_line); + if (expanded_string == 0) + { + new_line = (char *)xmalloc (1); + new_line[0] = '\0'; + } + else + { + new_line = string_list (expanded_string); + dispose_words (expanded_string); + } + + maybe_make_readline_line (new_line); + free (new_line); + + /* Place rl_point where we think it should go. */ + if (at_end) + rl_point = rl_end; + else if (old_point < rl_end) + { + rl_point = old_point; + if (!whitespace (rl_line_buffer[rl_point])) + rl_forward_word (1, 0); + } + return 0; + } + else + { + cleanup_expansion_error (); + return 1; + } +} + +/* If FIGNORE is set, then don't match files with the given suffixes when + completing filenames. If only one of the possibilities has an acceptable + suffix, delete the others, else just return and let the completer + signal an error. It is called by the completer when real + completions are done on filenames by the completer's internal + function, not for completion lists (M-?) and not on "other" + completion types, such as hostnames or commands. */ + +static struct ignorevar fignore = +{ + "FIGNORE", + (struct ign *)0, + 0, + (char *)0, + (sh_iv_item_func_t *) 0, +}; + +static void +_ignore_completion_names (names, name_func) + char **names; + sh_ignore_func_t *name_func; +{ + char **newnames; + int idx, nidx; + char **oldnames; + int oidx; + + /* If there is only one completion, see if it is acceptable. If it is + not, free it up. In any case, short-circuit and return. This is a + special case because names[0] is not the prefix of the list of names + if there is only one completion; it is the completion itself. */ + if (names[1] == (char *)0) + { + if (force_fignore) + if ((*name_func) (names[0]) == 0) + { + free (names[0]); + names[0] = (char *)NULL; + } + + return; + } + + /* Allocate space for array to hold list of pointers to matching + filenames. The pointers are copied back to NAMES when done. */ + for (nidx = 1; names[nidx]; nidx++) + ; + newnames = strvec_create (nidx + 1); + + if (force_fignore == 0) + { + oldnames = strvec_create (nidx - 1); + oidx = 0; + } + + newnames[0] = names[0]; + for (idx = nidx = 1; names[idx]; idx++) + { + if ((*name_func) (names[idx])) + newnames[nidx++] = names[idx]; + else if (force_fignore == 0) + oldnames[oidx++] = names[idx]; + else + free (names[idx]); + } + + newnames[nidx] = (char *)NULL; + + /* If none are acceptable then let the completer handle it. */ + if (nidx == 1) + { + if (force_fignore) + { + free (names[0]); + names[0] = (char *)NULL; + } + else + free (oldnames); + + free (newnames); + return; + } + + if (force_fignore == 0) + { + while (oidx) + free (oldnames[--oidx]); + free (oldnames); + } + + /* If only one is acceptable, copy it to names[0] and return. */ + if (nidx == 2) + { + free (names[0]); + names[0] = newnames[1]; + names[1] = (char *)NULL; + free (newnames); + return; + } + + /* Copy the acceptable names back to NAMES, set the new array end, + and return. */ + for (nidx = 1; newnames[nidx]; nidx++) + names[nidx] = newnames[nidx]; + names[nidx] = (char *)NULL; + free (newnames); +} + +static int +name_is_acceptable (name) + const char *name; +{ + struct ign *p; + int nlen; + + for (nlen = strlen (name), p = fignore.ignores; p->val; p++) + { + if (nlen > p->len && p->len > 0 && STREQ (p->val, &name[nlen - p->len])) + return (0); + } + + return (1); +} + +#if 0 +static int +ignore_dot_names (name) + char *name; +{ + return (name[0] != '.'); +} +#endif + +static int +filename_completion_ignore (names) + char **names; +{ +#if 0 + if (glob_dot_filenames == 0) + _ignore_completion_names (names, ignore_dot_names); +#endif + + setup_ignore_patterns (&fignore); + + if (fignore.num_ignores == 0) + return 0; + + _ignore_completion_names (names, name_is_acceptable); + + return 0; +} + +/* Return 1 if NAME is a directory. NAME undergoes tilde expansion. */ +static int +test_for_directory (name) + const char *name; +{ + char *fn; + int r; + + fn = bash_tilde_expand (name, 0); + r = file_isdir (fn); + free (fn); + + return (r); +} + +/* Remove files from NAMES, leaving directories. */ +static int +bash_ignore_filenames (names) + char **names; +{ + _ignore_completion_names (names, test_for_directory); + return 0; +} + +static int +return_zero (name) + const char *name; +{ + return 0; +} + +static int +bash_ignore_everything (names) + char **names; +{ + _ignore_completion_names (names, return_zero); + return 0; +} + +/* Replace a tilde-prefix in VAL with a `~', assuming the user typed it. VAL + is an expanded filename. DIRECTORY_PART is the tilde-prefix portion + of the un-tilde-expanded version of VAL (what the user typed). */ +static char * +restore_tilde (val, directory_part) + char *val, *directory_part; +{ + int l, vl, dl2, xl; + char *dh2, *expdir, *ret; + + vl = strlen (val); + + /* We need to duplicate the expansions readline performs on the directory + portion before passing it to our completion function. */ + dh2 = directory_part ? bash_dequote_filename (directory_part, 0) : 0; + bash_directory_expansion (&dh2); + dl2 = strlen (dh2); + + expdir = bash_tilde_expand (directory_part, 0); + xl = strlen (expdir); + free (expdir); + + /* + dh2 = unexpanded but dequoted tilde-prefix + dl2 = length of tilde-prefix + expdir = tilde-expanded tilde-prefix + xl = length of expanded tilde-prefix + l = length of remainder after tilde-prefix + */ + l = (vl - xl) + 1; + + ret = (char *)xmalloc (dl2 + 2 + l); + strcpy (ret, dh2); + strcpy (ret + dl2, val + xl); + + free (dh2); + return (ret); +} + +static char * +maybe_restore_tilde (val, directory_part) + char *val, *directory_part; +{ + rl_icppfunc_t *save; + char *ret; + + save = (dircomplete_expand == 0) ? save_directory_hook () : (rl_icppfunc_t *)0; + ret = restore_tilde (val, directory_part); + if (save) + restore_directory_hook (save); + return ret; +} + +/* Simulate the expansions that will be performed by + rl_filename_completion_function. This must be called with the address of + a pointer to malloc'd memory. */ +static void +bash_directory_expansion (dirname) + char **dirname; +{ + char *d, *nd; + + d = savestring (*dirname); + + if ((rl_directory_rewrite_hook) && (*rl_directory_rewrite_hook) (&d)) + { + free (*dirname); + *dirname = d; + } + else if (rl_directory_completion_hook && (*rl_directory_completion_hook) (&d)) + { + free (*dirname); + *dirname = d; + } + else if (rl_completion_found_quote) + { + nd = bash_dequote_filename (d, rl_completion_quote_character); + free (*dirname); + free (d); + *dirname = nd; + } +} + +/* If necessary, rewrite directory entry */ +static char * +bash_filename_rewrite_hook (fname, fnlen) + char *fname; + int fnlen; +{ + char *conv; + + conv = fnx_fromfs (fname, fnlen); + if (conv != fname) + conv = savestring (conv); + return conv; +} + +/* Functions to save and restore the appropriate directory hook */ +/* This is not static so the shopt code can call it */ +void +set_directory_hook () +{ + if (dircomplete_expand) + { + rl_directory_completion_hook = bash_directory_completion_hook; + rl_directory_rewrite_hook = (rl_icppfunc_t *)0; + } + else + { + rl_directory_rewrite_hook = bash_directory_completion_hook; + rl_directory_completion_hook = (rl_icppfunc_t *)0; + } +} + +static rl_icppfunc_t * +save_directory_hook () +{ + rl_icppfunc_t *ret; + + if (dircomplete_expand) + { + ret = rl_directory_completion_hook; + rl_directory_completion_hook = (rl_icppfunc_t *)NULL; + } + else + { + ret = rl_directory_rewrite_hook; + rl_directory_rewrite_hook = (rl_icppfunc_t *)NULL; + } + + return ret; +} + +static void +restore_directory_hook (hookf) + rl_icppfunc_t *hookf; +{ + if (dircomplete_expand) + rl_directory_completion_hook = hookf; + else + rl_directory_rewrite_hook = hookf; +} + +/* Expand a filename before the readline completion code passes it to stat(2). + The filename will already have had tilde expansion performed. */ +static int +bash_filename_stat_hook (dirname) + char **dirname; +{ + char *local_dirname, *new_dirname, *t; + int should_expand_dirname, return_value; + WORD_LIST *wl; + struct stat sb; + + local_dirname = *dirname; + should_expand_dirname = return_value = 0; + if (t = mbschr (local_dirname, '$')) + should_expand_dirname = '$'; + else if (t = mbschr (local_dirname, '`')) /* XXX */ + should_expand_dirname = '`'; + +#if defined (HAVE_LSTAT) + if (should_expand_dirname && lstat (local_dirname, &sb) == 0) +#else + if (should_expand_dirname && stat (local_dirname, &sb) == 0) +#endif + should_expand_dirname = 0; + + if (should_expand_dirname) + { + new_dirname = savestring (local_dirname); + wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB); /* does the right thing */ + if (wl) + { + free (new_dirname); + new_dirname = string_list (wl); + /* Tell the completer we actually expanded something and change + *dirname only if we expanded to something non-null -- stat + behaves unpredictably when passed null or empty strings */ + if (new_dirname && *new_dirname) + { + free (local_dirname); /* XXX */ + local_dirname = *dirname = new_dirname; + return_value = STREQ (local_dirname, *dirname) == 0; + } + else + free (new_dirname); + dispose_words (wl); + } + else + free (new_dirname); + } + + /* This is very similar to the code in bash_directory_completion_hook below, + but without spelling correction and not worrying about whether or not + we change relative pathnames. */ + if (no_symbolic_links == 0 && (local_dirname[0] != '.' || local_dirname[1])) + { + char *temp1, *temp2; + + t = get_working_directory ("symlink-hook"); + temp1 = make_absolute (local_dirname, t); + free (t); + temp2 = sh_canonpath (temp1, PATH_CHECKDOTDOT|PATH_CHECKEXISTS); + + /* If we can't canonicalize, bail. */ + if (temp2 == 0) + { + free (temp1); + return return_value; + } + + free (local_dirname); + *dirname = temp2; + free (temp1); + } + + return (return_value); +} + +/* Handle symbolic link references and other directory name + expansions while hacking completion. This should return 1 if it modifies + the DIRNAME argument, 0 otherwise. It should make sure not to modify + DIRNAME if it returns 0. */ +static int +bash_directory_completion_hook (dirname) + char **dirname; +{ + char *local_dirname, *new_dirname, *t; + int return_value, should_expand_dirname, nextch, closer; + WORD_LIST *wl; + struct stat sb; + + return_value = should_expand_dirname = nextch = closer = 0; + local_dirname = *dirname; + + if (t = mbschr (local_dirname, '$')) + { + should_expand_dirname = '$'; + nextch = t[1]; + /* Deliberately does not handle the deprecated $[...] arithmetic + expansion syntax */ + if (nextch == '(') + closer = ')'; + else if (nextch == '{') + closer = '}'; + else + nextch = 0; + } + else if (local_dirname[0] == '~') + should_expand_dirname = '~'; + else + { + t = mbschr (local_dirname, '`'); + if (t && unclosed_pair (local_dirname, strlen (local_dirname), "`") == 0) + should_expand_dirname = '`'; + } + +#if defined (HAVE_LSTAT) + if (should_expand_dirname && lstat (local_dirname, &sb) == 0) +#else + if (should_expand_dirname && stat (local_dirname, &sb) == 0) +#endif + should_expand_dirname = 0; + + if (should_expand_dirname) + { + new_dirname = savestring (local_dirname); + wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB); /* does the right thing */ + if (wl) + { + *dirname = string_list (wl); + /* Tell the completer to replace the directory name only if we + actually expanded something. */ + return_value = STREQ (local_dirname, *dirname) == 0; + free (local_dirname); + free (new_dirname); + dispose_words (wl); + local_dirname = *dirname; + /* XXX - change rl_filename_quote_characters here based on + should_expand_dirname/nextch/closer. This is the only place + custom_filename_quote_characters is modified. */ + if (rl_filename_quote_characters && *rl_filename_quote_characters) + { + int i, j, c; + i = strlen (default_filename_quote_characters); + custom_filename_quote_characters = xrealloc (custom_filename_quote_characters, i+1); + for (i = j = 0; c = default_filename_quote_characters[i]; i++) + { + if (c == should_expand_dirname || c == nextch || c == closer) + continue; + custom_filename_quote_characters[j++] = c; + } + custom_filename_quote_characters[j] = '\0'; + rl_filename_quote_characters = custom_filename_quote_characters; + set_filename_bstab (rl_filename_quote_characters); + } + } + else + { + free (new_dirname); + free (local_dirname); + *dirname = (char *)xmalloc (1); + **dirname = '\0'; + return 1; + } + } + else + { + /* Dequote the filename even if we don't expand it. */ + new_dirname = bash_dequote_filename (local_dirname, rl_completion_quote_character); + return_value = STREQ (local_dirname, new_dirname) == 0; + free (local_dirname); + local_dirname = *dirname = new_dirname; + } + + /* no_symbolic_links == 0 -> use (default) logical view of the file system. + local_dirname[0] == '.' && local_dirname[1] == '/' means files in the + current directory (./). + local_dirname[0] == '.' && local_dirname[1] == 0 means relative pathnames + in the current directory (e.g., lib/sh). + XXX - should we do spelling correction on these? */ + + /* This is test as it was in bash-4.2: skip relative pathnames in current + directory. Change test to + (local_dirname[0] != '.' || (local_dirname[1] && local_dirname[1] != '/')) + if we want to skip paths beginning with ./ also. */ + if (no_symbolic_links == 0 && (local_dirname[0] != '.' || local_dirname[1])) + { + char *temp1, *temp2; + int len1, len2; + + /* If we have a relative path + (local_dirname[0] != '/' && local_dirname[0] != '.') + that is canonical after appending it to the current directory, then + temp1 = temp2+'/' + That is, + strcmp (temp1, temp2) == 0 + after adding a slash to temp2 below. It should be safe to not + change those. + */ + t = get_working_directory ("symlink-hook"); + temp1 = make_absolute (local_dirname, t); + free (t); + temp2 = sh_canonpath (temp1, PATH_CHECKDOTDOT|PATH_CHECKEXISTS); + + /* Try spelling correction if initial canonicalization fails. Make + sure we are set to replace the directory name with the results so + subsequent directory checks don't fail. */ + if (temp2 == 0 && dircomplete_spelling && dircomplete_expand) + { + temp2 = dirspell (temp1); + if (temp2) + { + free (temp1); + temp1 = temp2; + temp2 = sh_canonpath (temp1, PATH_CHECKDOTDOT|PATH_CHECKEXISTS); + return_value |= temp2 != 0; + } + } + /* If we can't canonicalize, bail. */ + if (temp2 == 0) + { + free (temp1); + return return_value; + } + len1 = strlen (temp1); + if (temp1[len1 - 1] == '/') + { + len2 = strlen (temp2); + if (len2 > 2) /* don't append `/' to `/' or `//' */ + { + temp2 = (char *)xrealloc (temp2, len2 + 2); + temp2[len2] = '/'; + temp2[len2 + 1] = '\0'; + } + } + + /* dircomplete_expand_relpath == 0 means we want to leave relative + pathnames that are unchanged by canonicalization alone. + *local_dirname != '/' && *local_dirname != '.' == relative pathname + (consistent with general.c:absolute_pathname()) + temp1 == temp2 (after appending a slash to temp2) means the pathname + is not changed by canonicalization as described above. */ + if (dircomplete_expand_relpath || ((local_dirname[0] != '/' && local_dirname[0] != '.') && STREQ (temp1, temp2) == 0)) + return_value |= STREQ (local_dirname, temp2) == 0; + free (local_dirname); + *dirname = temp2; + free (temp1); + } + + return (return_value); +} + +static char **history_completion_array = (char **)NULL; +static int harry_size; +static int harry_len; + +static void +build_history_completion_array () +{ + register int i, j; + HIST_ENTRY **hlist; + char **tokens; + + /* First, clear out the current dynamic history completion list. */ + if (harry_size) + { + strvec_dispose (history_completion_array); + history_completion_array = (char **)NULL; + harry_size = 0; + harry_len = 0; + } + + /* Next, grovel each line of history, making each shell-sized token + a separate entry in the history_completion_array. */ + hlist = history_list (); + + if (hlist) + { + for (i = 0; hlist[i]; i++) + ; + for ( --i; i >= 0; i--) + { + /* Separate each token, and place into an array. */ + tokens = history_tokenize (hlist[i]->line); + + for (j = 0; tokens && tokens[j]; j++) + { + if (harry_len + 2 > harry_size) + history_completion_array = strvec_resize (history_completion_array, harry_size += 10); + + history_completion_array[harry_len++] = tokens[j]; + history_completion_array[harry_len] = (char *)NULL; + } + free (tokens); + } + + /* Sort the complete list of tokens. */ + if (dabbrev_expand_active == 0) + qsort (history_completion_array, harry_len, sizeof (char *), (QSFUNC *)strvec_strcmp); + } +} + +static char * +history_completion_generator (hint_text, state) + const char *hint_text; + int state; +{ + static int local_index, len; + static const char *text; + + /* If this is the first call to the generator, then initialize the + list of strings to complete over. */ + if (state == 0) + { + if (dabbrev_expand_active) /* This is kind of messy */ + rl_completion_suppress_append = 1; + local_index = 0; + build_history_completion_array (); + text = hint_text; + len = strlen (text); + } + + while (history_completion_array && history_completion_array[local_index]) + { + if (strncmp (text, history_completion_array[local_index++], len) == 0) + return (savestring (history_completion_array[local_index - 1])); + } + return ((char *)NULL); +} + +static int +dynamic_complete_history (count, key) + int count, key; +{ + int r; + rl_compentry_func_t *orig_func; + rl_completion_func_t *orig_attempt_func; + rl_compignore_func_t *orig_ignore_func; + + orig_func = rl_completion_entry_function; + orig_attempt_func = rl_attempted_completion_function; + orig_ignore_func = rl_ignore_some_completions_function; + + rl_completion_entry_function = history_completion_generator; + rl_attempted_completion_function = (rl_completion_func_t *)NULL; + rl_ignore_some_completions_function = filename_completion_ignore; + + /* XXX - use rl_completion_mode here? */ + if (rl_last_func == dynamic_complete_history) + r = rl_complete_internal ('?'); + else + r = rl_complete_internal (TAB); + + rl_completion_entry_function = orig_func; + rl_attempted_completion_function = orig_attempt_func; + rl_ignore_some_completions_function = orig_ignore_func; + + return r; +} + +static int +bash_dabbrev_expand (count, key) + int count, key; +{ + int r, orig_suppress, orig_sort; + rl_compentry_func_t *orig_func; + rl_completion_func_t *orig_attempt_func; + rl_compignore_func_t *orig_ignore_func; + + orig_func = rl_menu_completion_entry_function; + orig_attempt_func = rl_attempted_completion_function; + orig_ignore_func = rl_ignore_some_completions_function; + orig_suppress = rl_completion_suppress_append; + orig_sort = rl_sort_completion_matches; + + rl_menu_completion_entry_function = history_completion_generator; + rl_attempted_completion_function = (rl_completion_func_t *)NULL; + rl_ignore_some_completions_function = filename_completion_ignore; + rl_filename_completion_desired = 0; + rl_completion_suppress_append = 1; + rl_sort_completion_matches = 0; + + /* XXX - use rl_completion_mode here? */ + dabbrev_expand_active = 1; + if (rl_last_func == bash_dabbrev_expand) + rl_last_func = rl_menu_complete; + r = rl_menu_complete (count, key); + dabbrev_expand_active = 0; + + rl_last_func = bash_dabbrev_expand; + rl_menu_completion_entry_function = orig_func; + rl_attempted_completion_function = orig_attempt_func; + rl_ignore_some_completions_function = orig_ignore_func; + rl_completion_suppress_append = orig_suppress; + rl_sort_completion_matches = orig_sort; + + return r; +} + +#if defined (SPECIFIC_COMPLETION_FUNCTIONS) +static int +bash_complete_username (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_username_internal (rl_completion_mode (bash_complete_username)); +} + +static int +bash_possible_username_completions (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_username_internal ('?'); +} + +static int +bash_complete_username_internal (what_to_do) + int what_to_do; +{ + return bash_specific_completion (what_to_do, rl_username_completion_function); +} + +static int +bash_complete_filename (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_filename_internal (rl_completion_mode (bash_complete_filename)); +} + +static int +bash_possible_filename_completions (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_filename_internal ('?'); +} + +static int +bash_complete_filename_internal (what_to_do) + int what_to_do; +{ + rl_compentry_func_t *orig_func; + rl_completion_func_t *orig_attempt_func; + rl_icppfunc_t *orig_dir_func; + rl_compignore_func_t *orig_ignore_func; + /*const*/ char *orig_rl_completer_word_break_characters; + int r; + + orig_func = rl_completion_entry_function; + orig_attempt_func = rl_attempted_completion_function; + orig_ignore_func = rl_ignore_some_completions_function; + orig_rl_completer_word_break_characters = rl_completer_word_break_characters; + + orig_dir_func = save_directory_hook (); + + rl_completion_entry_function = rl_filename_completion_function; + rl_attempted_completion_function = (rl_completion_func_t *)NULL; + rl_ignore_some_completions_function = filename_completion_ignore; + rl_completer_word_break_characters = " \t\n\"\'"; + + r = rl_complete_internal (what_to_do); + + rl_completion_entry_function = orig_func; + rl_attempted_completion_function = orig_attempt_func; + rl_ignore_some_completions_function = orig_ignore_func; + rl_completer_word_break_characters = orig_rl_completer_word_break_characters; + + restore_directory_hook (orig_dir_func); + + return r; +} + +static int +bash_complete_hostname (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_hostname_internal (rl_completion_mode (bash_complete_hostname)); +} + +static int +bash_possible_hostname_completions (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_hostname_internal ('?'); +} + +static int +bash_complete_variable (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_variable_internal (rl_completion_mode (bash_complete_variable)); +} + +static int +bash_possible_variable_completions (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_variable_internal ('?'); +} + +static int +bash_complete_command (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_command_internal (rl_completion_mode (bash_complete_command)); +} + +static int +bash_possible_command_completions (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_command_internal ('?'); +} + +static int +bash_complete_hostname_internal (what_to_do) + int what_to_do; +{ + return bash_specific_completion (what_to_do, hostname_completion_function); +} + +static int +bash_complete_variable_internal (what_to_do) + int what_to_do; +{ + return bash_specific_completion (what_to_do, variable_completion_function); +} + +static int +bash_complete_command_internal (what_to_do) + int what_to_do; +{ + return bash_specific_completion (what_to_do, command_word_completion_function); +} + +static char *globtext; +static char *globorig; + +static char * +glob_complete_word (text, state) + const char *text; + int state; +{ + static char **matches = (char **)NULL; + static int ind; + int glen; + char *ret, *ttext; + + if (state == 0) + { + rl_filename_completion_desired = 1; + FREE (matches); + if (globorig != globtext) + FREE (globorig); + FREE (globtext); + + ttext = bash_tilde_expand (text, 0); + + if (rl_explicit_arg) + { + globorig = savestring (ttext); + glen = strlen (ttext); + globtext = (char *)xmalloc (glen + 2); + strcpy (globtext, ttext); + globtext[glen] = '*'; + globtext[glen+1] = '\0'; + } + else + globtext = globorig = savestring (ttext); + + if (ttext != text) + free (ttext); + + matches = shell_glob_filename (globtext); + if (GLOB_FAILED (matches)) + matches = (char **)NULL; + ind = 0; + } + + ret = matches ? matches[ind] : (char *)NULL; + ind++; + return ret; +} + +static int +bash_glob_completion_internal (what_to_do) + int what_to_do; +{ + return bash_specific_completion (what_to_do, glob_complete_word); +} + +/* A special quoting function so we don't end up quoting globbing characters + in the word if there are no matches or multiple matches. */ +static char * +bash_glob_quote_filename (s, rtype, qcp) + char *s; + int rtype; + char *qcp; +{ + if (globorig && qcp && *qcp == '\0' && STREQ (s, globorig)) + return (savestring (s)); + else + return (bash_quote_filename (s, rtype, qcp)); +} + +static int +bash_glob_complete_word (count, key) + int count, key; +{ + int r; + rl_quote_func_t *orig_quoting_function; + + if (rl_editing_mode == EMACS_EDITING_MODE) + rl_explicit_arg = 1; /* force `*' append */ + orig_quoting_function = rl_filename_quoting_function; + rl_filename_quoting_function = bash_glob_quote_filename; + + r = bash_glob_completion_internal (rl_completion_mode (bash_glob_complete_word)); + + rl_filename_quoting_function = orig_quoting_function; + return r; +} + +static int +bash_glob_expand_word (count, key) + int count, key; +{ + return bash_glob_completion_internal ('*'); +} + +static int +bash_glob_list_expansions (count, key) + int count, key; +{ + return bash_glob_completion_internal ('?'); +} + +static int +bash_specific_completion (what_to_do, generator) + int what_to_do; + rl_compentry_func_t *generator; +{ + rl_compentry_func_t *orig_func; + rl_completion_func_t *orig_attempt_func; + rl_compignore_func_t *orig_ignore_func; + int r; + + orig_func = rl_completion_entry_function; + orig_attempt_func = rl_attempted_completion_function; + orig_ignore_func = rl_ignore_some_completions_function; + rl_completion_entry_function = generator; + rl_attempted_completion_function = NULL; + rl_ignore_some_completions_function = orig_ignore_func; + + r = rl_complete_internal (what_to_do); + + rl_completion_entry_function = orig_func; + rl_attempted_completion_function = orig_attempt_func; + rl_ignore_some_completions_function = orig_ignore_func; + + return r; +} + +#endif /* SPECIFIC_COMPLETION_FUNCTIONS */ + +#if defined (VI_MODE) +/* Completion, from vi mode's point of view. This is a modified version of + rl_vi_complete which uses the bash globbing code to implement what POSIX + specifies, which is to append a `*' and attempt filename generation (which + has the side effect of expanding any globbing characters in the word). */ +static int +bash_vi_complete (count, key) + int count, key; +{ +#if defined (SPECIFIC_COMPLETION_FUNCTIONS) + int p, r; + char *t; + + if ((rl_point < rl_end) && (!whitespace (rl_line_buffer[rl_point]))) + { + if (!whitespace (rl_line_buffer[rl_point + 1])) + rl_vi_end_word (1, 'E'); + rl_point++; + } + + /* Find boundaries of current word, according to vi definition of a + `bigword'. */ + t = 0; + if (rl_point > 0) + { + p = rl_point; + rl_vi_bWord (1, 'B'); + r = rl_point; + rl_point = p; + p = r; + + t = substring (rl_line_buffer, p, rl_point); + } + + if (t && glob_pattern_p (t) == 0) + rl_explicit_arg = 1; /* XXX - force glob_complete_word to append `*' */ + FREE (t); + + if (key == '*') /* Expansion and replacement. */ + r = bash_glob_expand_word (count, key); + else if (key == '=') /* List possible completions. */ + r = bash_glob_list_expansions (count, key); + else if (key == '\\') /* Standard completion */ + r = bash_glob_complete_word (count, key); + else + r = rl_complete (0, key); + + if (key == '*' || key == '\\') + rl_vi_start_inserting (key, 1, 1); + + return (r); +#else + return rl_vi_complete (count, key); +#endif /* !SPECIFIC_COMPLETION_FUNCTIONS */ +} +#endif /* VI_MODE */ + +/* Filename quoting for completion. */ +/* A function to strip unquoted quote characters (single quotes, double + quotes, and backslashes). It allows single quotes to appear + within double quotes, and vice versa. It should be smarter. */ +static char * +bash_dequote_filename (text, quote_char) + char *text; + int quote_char; +{ + char *ret, *p, *r; + int l, quoted; + + l = strlen (text); + ret = (char *)xmalloc (l + 1); + for (quoted = quote_char, p = text, r = ret; p && *p; p++) + { + /* Allow backslash-escaped characters to pass through unscathed. */ + if (*p == '\\') + { + /* Backslashes are preserved within single quotes. */ + if (quoted == '\'') + *r++ = *p; + /* Backslashes are preserved within double quotes unless the + character is one that is defined to be escaped */ + else if (quoted == '"' && ((sh_syntaxtab[p[1]] & CBSDQUOTE) == 0)) + *r++ = *p; + + *r++ = *++p; + if (*p == '\0') + return ret; /* XXX - was break; */ + continue; + } + /* Close quote. */ + if (quoted && *p == quoted) + { + quoted = 0; + continue; + } + /* Open quote. */ + if (quoted == 0 && (*p == '\'' || *p == '"')) + { + quoted = *p; + continue; + } + *r++ = *p; + } + *r = '\0'; + return ret; +} + +/* Quote characters that the readline completion code would treat as + word break characters with backslashes. Pass backslash-quoted + characters through without examination. */ +static char * +quote_word_break_chars (text) + char *text; +{ + char *ret, *r, *s; + int l; + + l = strlen (text); + ret = (char *)xmalloc ((2 * l) + 1); + for (s = text, r = ret; *s; s++) + { + /* Pass backslash-quoted characters through, including the backslash. */ + if (*s == '\\') + { + *r++ = '\\'; + *r++ = *++s; + if (*s == '\0') + break; + continue; + } + /* OK, we have an unquoted character. Check its presence in + rl_completer_word_break_characters. */ + if (mbschr (rl_completer_word_break_characters, *s)) + *r++ = '\\'; + /* XXX -- check for standalone tildes here and backslash-quote them */ + if (s == text && *s == '~' && file_exists (text)) + *r++ = '\\'; + *r++ = *s; + } + *r = '\0'; + return ret; +} + +/* Use characters in STRING to populate the table of characters that should + be backslash-quoted. The table will be used for sh_backslash_quote from + this file. */ +static void +set_filename_bstab (string) + const char *string; +{ + const char *s; + + memset (filename_bstab, 0, sizeof (filename_bstab)); + for (s = string; s && *s; s++) + filename_bstab[*s] = 1; +} + +/* Quote a filename using double quotes, single quotes, or backslashes + depending on the value of completion_quoting_style. If we're + completing using backslashes, we need to quote some additional + characters (those that readline treats as word breaks), so we call + quote_word_break_chars on the result. This returns newly-allocated + memory. */ +static char * +bash_quote_filename (s, rtype, qcp) + char *s; + int rtype; + char *qcp; +{ + char *rtext, *mtext, *ret; + int rlen, cs; + + rtext = (char *)NULL; + + /* If RTYPE == MULT_MATCH, it means that there is + more than one match. In this case, we do not add + the closing quote or attempt to perform tilde + expansion. If RTYPE == SINGLE_MATCH, we try + to perform tilde expansion, because single and double + quotes inhibit tilde expansion by the shell. */ + + cs = completion_quoting_style; + /* Might need to modify the default completion style based on *qcp, + since it's set to any user-provided opening quote. We also change + to single-quoting if there is no user-provided opening quote and + the word being completed contains newlines, since those are not + quoted correctly using backslashes (a backslash-newline pair is + special to the shell parser). */ + if (*qcp == '\0' && cs == COMPLETE_BSQUOTE && mbschr (s, '\n')) + cs = COMPLETE_SQUOTE; + else if (*qcp == '"') + cs = COMPLETE_DQUOTE; + else if (*qcp == '\'') + cs = COMPLETE_SQUOTE; +#if defined (BANG_HISTORY) + else if (*qcp == '\0' && history_expansion && cs == COMPLETE_DQUOTE && + history_expansion_inhibited == 0 && mbschr (s, '!')) + cs = COMPLETE_BSQUOTE; + + if (*qcp == '"' && history_expansion && cs == COMPLETE_DQUOTE && + history_expansion_inhibited == 0 && mbschr (s, '!')) + { + cs = COMPLETE_BSQUOTE; + *qcp = '\0'; + } +#endif + + /* Don't tilde-expand backslash-quoted filenames, since only single and + double quotes inhibit tilde expansion. */ + mtext = s; + if (mtext[0] == '~' && rtype == SINGLE_MATCH && cs != COMPLETE_BSQUOTE) + mtext = bash_tilde_expand (s, 0); + + switch (cs) + { + case COMPLETE_DQUOTE: + rtext = sh_double_quote (mtext); + break; + case COMPLETE_SQUOTE: + rtext = sh_single_quote (mtext); + break; + case COMPLETE_BSQUOTE: + rtext = sh_backslash_quote (mtext, complete_fullquote ? 0 : filename_bstab, 0); + break; + } + + if (mtext != s) + free (mtext); + + /* We may need to quote additional characters: those that readline treats + as word breaks that are not quoted by backslash_quote. */ + if (rtext && cs == COMPLETE_BSQUOTE) + { + mtext = quote_word_break_chars (rtext); + free (rtext); + rtext = mtext; + } + + /* Leave the opening quote intact. The readline completion code takes + care of avoiding doubled opening quotes. */ + if (rtext) + { + rlen = strlen (rtext); + ret = (char *)xmalloc (rlen + 1); + strcpy (ret, rtext); + } + else + { + ret = (char *)xmalloc (rlen = 1); + ret[0] = '\0'; + } + + /* If there are multiple matches, cut off the closing quote. */ + if (rtype == MULT_MATCH && cs != COMPLETE_BSQUOTE) + ret[rlen - 1] = '\0'; + free (rtext); + return ret; +} + +/* Support for binding readline key sequences to Unix commands. */ +static Keymap cmd_xmap; + +#ifdef _MINIX +static void +#else +static int +#endif +putx(c) + int c; +{ + int x; + x = putc (c, rl_outstream); +#ifndef _MINIX + return x; +#endif +} + +static int +bash_execute_unix_command (count, key) + int count; /* ignored */ + int key; +{ + Keymap ckmap; /* current keymap */ + Keymap xkmap; /* unix command executing keymap */ + rl_command_func_t *func; + int type; + register int i, r; + intmax_t mi; + sh_parser_state_t ps; + char *cmd, *value, *l, *l1, *ce; + SHELL_VAR *v; + char ibuf[INT_STRLEN_BOUND(int) + 1]; + + /* First, we need to find the right command to execute. This is tricky, + because we might have already indirected into another keymap, so we + have to walk cmd_xmap using the entire key sequence. */ + cmd = (char *)rl_function_of_keyseq (rl_executing_keyseq, cmd_xmap, &type); + + if (cmd == 0 || type != ISMACR) + { + rl_crlf (); + internal_error (_("bash_execute_unix_command: cannot find keymap for command")); + rl_forced_update_display (); + return 1; + } + + ce = rl_get_termcap ("ce"); + if (ce) /* clear current line */ + { + fprintf (rl_outstream, "\r"); + tputs (ce, 1, putx); + fflush (rl_outstream); + } + else + rl_crlf (); /* move to a new line */ + + v = bind_variable ("READLINE_LINE", rl_line_buffer, 0); + if (v) + VSETATTR (v, att_exported); + l = v ? value_cell (v) : 0; + value = inttostr (rl_point, ibuf, sizeof (ibuf)); + v = bind_int_variable ("READLINE_POINT", value); + if (v) + VSETATTR (v, att_exported); + array_needs_making = 1; + + save_parser_state (&ps); + r = parse_and_execute (cmd, "bash_execute_unix_command", SEVAL_NOHIST|SEVAL_NOFREE); + restore_parser_state (&ps); + + v = find_variable ("READLINE_LINE"); + l1 = v ? value_cell (v) : 0; + if (l1 != l) + maybe_make_readline_line (value_cell (v)); + v = find_variable ("READLINE_POINT"); + if (v && legal_number (value_cell (v), &mi)) + { + i = mi; + if (i != rl_point) + { + rl_point = i; + if (rl_point > rl_end) + rl_point = rl_end; + else if (rl_point < 0) + rl_point = 0; + } + } + + unbind_variable ("READLINE_LINE"); + unbind_variable ("READLINE_POINT"); + array_needs_making = 1; + + /* and restore the readline buffer and display after command execution. */ + rl_forced_update_display (); + return 0; +} + +int +print_unix_command_map () +{ + Keymap save; + + save = rl_get_keymap (); + rl_set_keymap (cmd_xmap); + rl_macro_dumper (1); + rl_set_keymap (save); + return 0; +} + +static void +init_unix_command_map () +{ + cmd_xmap = rl_make_bare_keymap (); +} + +static int +isolate_sequence (string, ind, need_dquote, startp) + char *string; + int ind, need_dquote, *startp; +{ + register int i; + int c, passc, delim; + + for (i = ind; string[i] && whitespace (string[i]); i++) + ; + /* NEED_DQUOTE means that the first non-white character *must* be `"'. */ + if (need_dquote && string[i] != '"') + { + builtin_error (_("%s: first non-whitespace character is not `\"'"), string); + return -1; + } + + /* We can have delimited strings even if NEED_DQUOTE == 0, like the command + string to bind the key sequence to. */ + delim = (string[i] == '"' || string[i] == '\'') ? string[i] : 0; + + if (startp) + *startp = delim ? ++i : i; + + for (passc = 0; c = string[i]; i++) + { + if (passc) + { + passc = 0; + continue; + } + if (c == '\\') + { + passc++; + continue; + } + if (c == delim) + break; + } + + if (delim && string[i] != delim) + { + builtin_error (_("no closing `%c' in %s"), delim, string); + return -1; + } + + return i; +} + +int +bind_keyseq_to_unix_command (line) + char *line; +{ + Keymap kmap; + char *kseq, *value; + int i, kstart; + + if (cmd_xmap == 0) + init_unix_command_map (); + + kmap = rl_get_keymap (); + + /* We duplicate some of the work done by rl_parse_and_bind here, but + this code only has to handle `"keyseq": ["]command["]' and can + generate an error for anything else. */ + i = isolate_sequence (line, 0, 1, &kstart); + if (i < 0) + return -1; + + /* Create the key sequence string to pass to rl_generic_bind */ + kseq = substring (line, kstart, i); + + for ( ; line[i] && line[i] != ':'; i++) + ; + if (line[i] != ':') + { + builtin_error (_("%s: missing colon separator"), line); + FREE (kseq); + return -1; + } + + i = isolate_sequence (line, i + 1, 0, &kstart); + if (i < 0) + { + FREE (kseq); + return -1; + } + + /* Create the value string containing the command to execute. */ + value = substring (line, kstart, i); + + /* Save the command to execute and the key sequence in the CMD_XMAP */ + rl_generic_bind (ISMACR, kseq, value, cmd_xmap); + + /* and bind the key sequence in the current keymap to a function that + understands how to execute from CMD_XMAP */ + rl_bind_keyseq_in_map (kseq, bash_execute_unix_command, kmap); + + free (kseq); + return 0; +} + +/* Used by the programmable completion code. Complete TEXT as a filename, + but return only directories as matches. Dequotes the filename before + attempting to find matches. */ +char ** +bash_directory_completion_matches (text) + const char *text; +{ + char **m1; + char *dfn; + int qc; + + qc = rl_dispatching ? rl_completion_quote_character : 0; + /* If rl_completion_found_quote != 0, rl_completion_matches will call the + filename dequoting function, causing the directory name to be dequoted + twice. */ + if (rl_dispatching && rl_completion_found_quote == 0) + dfn = bash_dequote_filename ((char *)text, qc); + else + dfn = (char *)text; + m1 = rl_completion_matches (dfn, rl_filename_completion_function); + if (dfn != text) + free (dfn); + + if (m1 == 0 || m1[0] == 0) + return m1; + /* We don't bother recomputing the lcd of the matches, because it will just + get thrown away by the programmable completion code and recomputed + later. */ + (void)bash_ignore_filenames (m1); + return m1; +} + +char * +bash_dequote_text (text) + const char *text; +{ + char *dtxt; + int qc; + + qc = (text[0] == '"' || text[0] == '\'') ? text[0] : 0; + dtxt = bash_dequote_filename ((char *)text, qc); + return (dtxt); +} + +/* This event hook is designed to be called after readline receives a signal + that interrupts read(2). It gives reasonable responsiveness to interrupts + and fatal signals without executing too much code in a signal handler + context. */ +static int +bash_event_hook () +{ + /* If we're going to longjmp to top_level, make sure we clean up readline. + check_signals will call QUIT, which will eventually longjmp to top_level, + calling run_interrupt_trap along the way. */ + if (interrupt_state) + rl_cleanup_after_signal (); + bashline_reset_event_hook (); + check_signals_and_traps (); /* XXX */ + return 0; +} + +#endif /* READLINE */ diff --git a/.pc/bash-default-editor.diff/builtins/fc.def b/.pc/bash-default-editor.diff/builtins/fc.def new file mode 100644 index 0000000..cf6b72c --- /dev/null +++ b/.pc/bash-default-editor.diff/builtins/fc.def @@ -0,0 +1,698 @@ +This file is fc.def, from which is created fc.c. +It implements the builtin "fc" in Bash. + +Copyright (C) 1987-2011 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES fc.c + +$BUILTIN fc +$FUNCTION fc_builtin +$DEPENDS_ON HISTORY +$SHORT_DOC fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command] +Display or execute commands from the history list. + +fc is used to list or edit and re-execute commands from the history list. +FIRST and LAST can be numbers specifying the range, or FIRST can be a +string, which means the most recent command beginning with that +string. + +Options: + -e ENAME select which editor to use. Default is FCEDIT, then EDITOR, + then vi + -l list lines instead of editing + -n omit line numbers when listing + -r reverse the order of the lines (newest listed first) + +With the `fc -s [pat=rep ...] [command]' format, COMMAND is +re-executed after the substitution OLD=NEW is performed. + +A useful alias to use with this is r='fc -s', so that typing `r cc' +runs the last command beginning with `cc' and typing `r' re-executes +the last command. + +Exit Status: +Returns success or status of executed command; non-zero if an error occurs. +$END + +#include + +#if defined (HISTORY) +#if defined (HAVE_SYS_PARAM_H) +# include +#endif +#include "../bashtypes.h" +#include "posixstat.h" +#if ! defined(_MINIX) && defined (HAVE_SYS_FILE_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include + +#include "../bashansi.h" +#include "../bashintl.h" +#include + +#include "../shell.h" +#include "../builtins.h" +#include "../flags.h" +#include "../bashhist.h" +#include "maxpath.h" +#include +#include "bashgetopt.h" +#include "common.h" + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +extern int current_command_line_count; +extern int literal_history; +extern int posixly_correct; +extern int subshell_environment, interactive_shell; + +extern int unlink __P((const char *)); + +extern FILE *sh_mktmpfp __P((char *, int, char **)); + +/* **************************************************************** */ +/* */ +/* The K*rn shell style fc command (Fix Command) */ +/* */ +/* **************************************************************** */ + +/* fc builtin command (fix command) for Bash for those who + like K*rn-style history better than csh-style. + + fc [-e ename] [-nlr] [first] [last] + + FIRST and LAST can be numbers specifying the range, or FIRST can be + a string, which means the most recent command beginning with that + string. + + -e ENAME selects which editor to use. Default is FCEDIT, then EDITOR, + then the editor which corresponds to the current readline editing + mode, then vi. + + -l means list lines instead of editing. + -n means no line numbers listed. + -r means reverse the order of the lines (making it newest listed first). + + fc -e - [pat=rep ...] [command] + fc -s [pat=rep ...] [command] + + Equivalent to !command:sg/pat/rep execpt there can be multiple PAT=REP's. +*/ + +/* Data structure describing a list of global replacements to perform. */ +typedef struct repl { + struct repl *next; + char *pat; + char *rep; +} REPL; + +/* Accessors for HIST_ENTRY lists that are called HLIST. */ +#define histline(i) (hlist[(i)]->line) +#define histdata(i) (hlist[(i)]->data) + +#define FREE_RLIST() \ + do { \ + for (rl = rlist; rl; ) { \ + REPL *r; \ + r = rl->next; \ + if (rl->pat) \ + free (rl->pat); \ + if (rl->rep) \ + free (rl->rep); \ + free (rl); \ + rl = r; \ + } \ + } while (0) + +static char *fc_dosubs __P((char *, REPL *)); +static char *fc_gethist __P((char *, HIST_ENTRY **)); +static int fc_gethnum __P((char *, HIST_ENTRY **)); +static int fc_number __P((WORD_LIST *)); +static void fc_replhist __P((char *)); +#ifdef INCLUDE_UNUSED +static char *fc_readline __P((FILE *)); +static void fc_addhist __P((char *)); +#endif + +/* String to execute on a file that we want to edit. */ +#define FC_EDIT_COMMAND "${FCEDIT:-${EDITOR:-vi}}" +#if defined (STRICT_POSIX) +# define POSIX_FC_EDIT_COMMAND "${FCEDIT:-ed}" +#else +# define POSIX_FC_EDIT_COMMAND "${FCEDIT:-${EDITOR:-ed}}" +#endif + +int +fc_builtin (list) + WORD_LIST *list; +{ + register int i; + register char *sep; + int numbering, reverse, listing, execute; + int histbeg, histend, last_hist, retval, opt, rh, real_last; + FILE *stream; + REPL *rlist, *rl; + char *ename, *command, *newcom, *fcedit; + HIST_ENTRY **hlist; + char *fn; + + numbering = 1; + reverse = listing = execute = 0; + ename = (char *)NULL; + + /* Parse out the options and set which of the two forms we're in. */ + reset_internal_getopt (); + lcurrent = list; /* XXX */ + while (fc_number (loptend = lcurrent) == 0 && + (opt = internal_getopt (list, ":e:lnrs")) != -1) + { + switch (opt) + { + case 'n': + numbering = 0; + break; + + case 'l': + listing = 1; + break; + + case 'r': + reverse = 1; + break; + + case 's': + execute = 1; + break; + + case 'e': + ename = list_optarg; + break; + + default: + builtin_usage (); + return (EX_USAGE); + } + } + + list = loptend; + + if (ename && (*ename == '-') && (ename[1] == '\0')) + execute = 1; + + /* The "execute" form of the command (re-run, with possible string + substitutions). */ + if (execute) + { + rlist = (REPL *)NULL; + while (list && ((sep = (char *)strchr (list->word->word, '=')) != NULL)) + { + *sep++ = '\0'; + rl = (REPL *)xmalloc (sizeof (REPL)); + rl->next = (REPL *)NULL; + rl->pat = savestring (list->word->word); + rl->rep = savestring (sep); + + if (rlist == NULL) + rlist = rl; + else + { + rl->next = rlist; + rlist = rl; + } + list = list->next; + } + + /* If we have a list of substitutions to do, then reverse it + to get the replacements in the proper order. */ + + rlist = REVERSE_LIST (rlist, REPL *); + + hlist = history_list (); + + /* If we still have something in list, it is a command spec. + Otherwise, we use the most recent command in time. */ + command = fc_gethist (list ? list->word->word : (char *)NULL, hlist); + + if (command == NULL) + { + builtin_error (_("no command found")); + if (rlist) + FREE_RLIST (); + + return (EXECUTION_FAILURE); + } + + if (rlist) + { + newcom = fc_dosubs (command, rlist); + free (command); + FREE_RLIST (); + command = newcom; + } + + fprintf (stderr, "%s\n", command); + fc_replhist (command); /* replace `fc -s' with command */ + /* Posix says that the re-executed commands should be entered into the + history. */ + return (parse_and_execute (command, "fc", SEVAL_NOHIST)); + } + + /* This is the second form of the command (the list-or-edit-and-rerun + form). */ + hlist = history_list (); + if (hlist == 0) + return (EXECUTION_SUCCESS); + for (i = 0; hlist[i]; i++); + + /* With the Bash implementation of history, the current command line + ("fc blah..." and so on) is already part of the history list by + the time we get to this point. This just skips over that command + and makes the last command that this deals with be the last command + the user entered before the fc. We need to check whether the + line was actually added (HISTIGNORE may have caused it to not be), + so we check hist_last_line_added. */ + + /* Even though command substitution through parse_and_execute turns off + remember_on_history, command substitution in a shell when set -o history + has been enabled (interactive or not) should use it in the last_hist + calculation as if it were on. */ + rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && enable_history_list); + last_hist = i - rh - hist_last_line_added; + + /* Make sure that real_last is calculated the same way here and in + fc_gethnum. The return value from fc_gethnum is treated specially if + it is == real_last and we are listing commands. */ + real_last = i; + /* back up from the end to the last non-null history entry */ + while (hlist[real_last] == 0 && real_last > 0) + real_last--; + + /* XXX */ + if (i == last_hist && hlist[last_hist] == 0) + while (last_hist >= 0 && hlist[last_hist] == 0) + last_hist--; + if (last_hist < 0) + { + sh_erange ((char *)NULL, _("history specification")); + return (EXECUTION_FAILURE); + } + + if (list) + { + histbeg = fc_gethnum (list->word->word, hlist); + list = list->next; + + if (list) + histend = fc_gethnum (list->word->word, hlist); + else if (histbeg == real_last) + histend = listing ? real_last : histbeg; + else + histend = listing ? last_hist : histbeg; + } + else + { + /* The default for listing is the last 16 history items. */ + if (listing) + { + histend = last_hist; + histbeg = histend - 16 + 1; /* +1 because loop below uses >= */ + if (histbeg < 0) + histbeg = 0; + } + else + /* For editing, it is the last history command. */ + histbeg = histend = last_hist; + } + + /* "When not listing, the fc command that caused the editing shall not be + entered into the history list." */ + if (listing == 0 && hist_last_line_added) + { + bash_delete_last_history (); + /* If we're editing a single command -- the last command in the + history -- and we just removed the dummy command added by + edit_and_execute_command (), we need to check whether or not we + just removed the last command in the history and need to back + the pointer up. remember_on_history is off because we're running + in parse_and_execute(). */ + if (histbeg == histend && histend == last_hist && hlist[last_hist] == 0) + last_hist = histbeg = --histend; + } + + /* We print error messages for line specifications out of range. */ + if ((histbeg < 0) || (histend < 0)) + { + sh_erange ((char *)NULL, _("history specification")); + return (EXECUTION_FAILURE); + } + + if (histend < histbeg) + { + i = histend; + histend = histbeg; + histbeg = i; + + reverse = 1; + } + + if (listing) + stream = stdout; + else + { + numbering = 0; + stream = sh_mktmpfp ("bash-fc", MT_USERANDOM|MT_USETMPDIR, &fn); + if (stream == 0) + { + builtin_error (_("%s: cannot open temp file: %s"), fn ? fn : "", strerror (errno)); + FREE (fn); + return (EXECUTION_FAILURE); + } + } + + for (i = reverse ? histend : histbeg; reverse ? i >= histbeg : i <= histend; reverse ? i-- : i++) + { + QUIT; + if (numbering) + fprintf (stream, "%d", i + history_base); + if (listing) + { + if (posixly_correct) + fputs ("\t", stream); + else + fprintf (stream, "\t%c", histdata (i) ? '*' : ' '); + } + fprintf (stream, "%s\n", histline (i)); + } + + if (listing) + return (sh_chkwrite (EXECUTION_SUCCESS)); + + fflush (stream); + if (ferror (stream)) + { + sh_wrerror (); + fclose (stream); + return (EXECUTION_FAILURE); + } + fclose (stream); + + /* Now edit the file of commands. */ + if (ename) + { + command = (char *)xmalloc (strlen (ename) + strlen (fn) + 2); + sprintf (command, "%s %s", ename, fn); + } + else + { + fcedit = posixly_correct ? POSIX_FC_EDIT_COMMAND : FC_EDIT_COMMAND; + command = (char *)xmalloc (3 + strlen (fcedit) + strlen (fn)); + sprintf (command, "%s %s", fcedit, fn); + } + retval = parse_and_execute (command, "fc", SEVAL_NOHIST); + if (retval != EXECUTION_SUCCESS) + { + unlink (fn); + free (fn); + return (EXECUTION_FAILURE); + } + + /* Make sure parse_and_execute doesn't turn this off, even though a + call to parse_and_execute farther up the function call stack (e.g., + if this is called by vi_edit_and_execute_command) may have already + called bash_history_disable. */ + remember_on_history = 1; + + /* Turn on the `v' flag while fc_execute_file runs so the commands + will be echoed as they are read by the parser. */ + begin_unwind_frame ("fc builtin"); + add_unwind_protect ((Function *)xfree, fn); + add_unwind_protect (unlink, fn); + unwind_protect_int (echo_input_at_read); + echo_input_at_read = 1; + + retval = fc_execute_file (fn); + + run_unwind_frame ("fc builtin"); + + return (retval); +} + +/* Return 1 if LIST->word->word is a legal number for fc's use. */ +static int +fc_number (list) + WORD_LIST *list; +{ + char *s; + + if (list == 0) + return 0; + s = list->word->word; + if (*s == '-') + s++; + return (legal_number (s, (intmax_t *)NULL)); +} + +/* Return an absolute index into HLIST which corresponds to COMMAND. If + COMMAND is a number, then it was specified in relative terms. If it + is a string, then it is the start of a command line present in HLIST. */ +static int +fc_gethnum (command, hlist) + char *command; + HIST_ENTRY **hlist; +{ + int sign, n, clen, rh; + register int i, j, last_hist, real_last; + register char *s; + + sign = 1; + /* Count history elements. */ + for (i = 0; hlist[i]; i++); + + /* With the Bash implementation of history, the current command line + ("fc blah..." and so on) is already part of the history list by + the time we get to this point. This just skips over that command + and makes the last command that this deals with be the last command + the user entered before the fc. We need to check whether the + line was actually added (HISTIGNORE may have caused it to not be), + so we check hist_last_line_added. This needs to agree with the + calculation of last_hist in fc_builtin above. */ + /* Even though command substitution through parse_and_execute turns off + remember_on_history, command substitution in a shell when set -o history + has been enabled (interactive or not) should use it in the last_hist + calculation as if it were on. */ + rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && enable_history_list); + last_hist = i - rh - hist_last_line_added; + + if (i == last_hist && hlist[last_hist] == 0) + while (last_hist >= 0 && hlist[last_hist] == 0) + last_hist--; + if (last_hist < 0) + return (-1); + + real_last = i; + i = last_hist; + + /* No specification defaults to most recent command. */ + if (command == NULL) + return (i); + + /* back up from the end to the last non-null history entry */ + while (hlist[real_last] == 0 && real_last > 0) + real_last--; + + /* Otherwise, there is a specification. It can be a number relative to + the current position, or an absolute history number. */ + s = command; + + /* Handle possible leading minus sign. */ + if (s && (*s == '-')) + { + sign = -1; + s++; + } + + if (s && DIGIT(*s)) + { + n = atoi (s); + n *= sign; + + /* If the value is negative or zero, then it is an offset from + the current history item. */ + if (n < 0) + { + n += i + 1; + return (n < 0 ? 0 : n); + } + else if (n == 0) + return ((sign == -1) ? real_last : i); + else + { + n -= history_base; + return (i < n ? i : n); + } + } + + clen = strlen (command); + for (j = i; j >= 0; j--) + { + if (STREQN (command, histline (j), clen)) + return (j); + } + return (-1); +} + +/* Locate the most recent history line which begins with + COMMAND in HLIST, and return a malloc()'ed copy of it. */ +static char * +fc_gethist (command, hlist) + char *command; + HIST_ENTRY **hlist; +{ + int i; + + if (hlist == 0) + return ((char *)NULL); + + i = fc_gethnum (command, hlist); + + if (i >= 0) + return (savestring (histline (i))); + else + return ((char *)NULL); +} + +#ifdef INCLUDE_UNUSED +/* Read the edited history lines from STREAM and return them + one at a time. This can read unlimited length lines. The + caller should free the storage. */ +static char * +fc_readline (stream) + FILE *stream; +{ + register int c; + int line_len = 0, lindex = 0; + char *line = (char *)NULL; + + while ((c = getc (stream)) != EOF) + { + if ((lindex + 2) >= line_len) + line = (char *)xrealloc (line, (line_len += 128)); + + if (c == '\n') + { + line[lindex++] = '\n'; + line[lindex++] = '\0'; + return (line); + } + else + line[lindex++] = c; + } + + if (!lindex) + { + if (line) + free (line); + + return ((char *)NULL); + } + + if (lindex + 2 >= line_len) + line = (char *)xrealloc (line, lindex + 3); + + line[lindex++] = '\n'; /* Finish with newline if none in file */ + line[lindex++] = '\0'; + return (line); +} +#endif + +/* Perform the SUBS on COMMAND. + SUBS is a list of substitutions, and COMMAND is a simple string. + Return a pointer to a malloc'ed string which contains the substituted + command. */ +static char * +fc_dosubs (command, subs) + char *command; + REPL *subs; +{ + register char *new, *t; + register REPL *r; + + for (new = savestring (command), r = subs; r; r = r->next) + { + t = strsub (new, r->pat, r->rep, 1); + free (new); + new = t; + } + return (new); +} + +/* Use `command' to replace the last entry in the history list, which, + by this time, is `fc blah...'. The intent is that the new command + become the history entry, and that `fc' should never appear in the + history list. This way you can do `r' to your heart's content. */ +static void +fc_replhist (command) + char *command; +{ + int n; + + if (command == 0 || *command == '\0') + return; + + n = strlen (command); + if (command[n - 1] == '\n') + command[n - 1] = '\0'; + + if (command && *command) + { + bash_delete_last_history (); + maybe_add_history (command); /* Obeys HISTCONTROL setting. */ + } +} + +#ifdef INCLUDE_UNUSED +/* Add LINE to the history, after removing a single trailing newline. */ +static void +fc_addhist (line) + char *line; +{ + register int n; + + if (line == 0 || *line == 0) + return; + + n = strlen (line); + + if (line[n - 1] == '\n') + line[n - 1] = '\0'; + + if (line && *line) + maybe_add_history (line); /* Obeys HISTCONTROL setting. */ +} +#endif + +#endif /* HISTORY */ diff --git a/.pc/bash-subst-param-length.diff/subst.c b/.pc/bash-subst-param-length.diff/subst.c new file mode 100644 index 0000000..9e8447a --- /dev/null +++ b/.pc/bash-subst-param-length.diff/subst.c @@ -0,0 +1,9759 @@ +/* subst.c -- The part of the shell that does parameter, command, arithmetic, + and globbing substitutions. */ + +/* ``Have a little faith, there's magic in the night. You ain't a + beauty, but, hey, you're alright.'' */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" +#include +#include "chartypes.h" +#if defined (HAVE_PWD_H) +# include +#endif +#include +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" +#include "posixstat.h" +#include "bashintl.h" + +#include "shell.h" +#include "parser.h" +#include "flags.h" +#include "jobs.h" +#include "execute_cmd.h" +#include "filecntl.h" +#include "trap.h" +#include "pathexp.h" +#include "mailcheck.h" + +#include "shmbutil.h" +#include "typemax.h" + +#include "builtins/getopt.h" +#include "builtins/common.h" + +#include "builtins/builtext.h" + +#include +#include + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +/* The size that strings change by. */ +#define DEFAULT_INITIAL_ARRAY_SIZE 112 +#define DEFAULT_ARRAY_SIZE 128 + +/* Variable types. */ +#define VT_VARIABLE 0 +#define VT_POSPARMS 1 +#define VT_ARRAYVAR 2 +#define VT_ARRAYMEMBER 3 +#define VT_ASSOCVAR 4 + +#define VT_STARSUB 128 /* $* or ${array[*]} -- used to split */ + +/* Flags for quoted_strchr */ +#define ST_BACKSL 0x01 +#define ST_CTLESC 0x02 +#define ST_SQUOTE 0x04 /* unused yet */ +#define ST_DQUOTE 0x08 /* unused yet */ + +/* Flags for the `pflags' argument to param_expand() */ +#define PF_NOCOMSUB 0x01 /* Do not perform command substitution */ +#define PF_IGNUNBOUND 0x02 /* ignore unbound vars even if -u set */ +#define PF_NOSPLIT2 0x04 /* same as W_NOSPLIT2 */ +#define PF_ASSIGNRHS 0x08 /* same as W_ASSIGNRHS */ + +/* These defs make it easier to use the editor. */ +#define LBRACE '{' +#define RBRACE '}' +#define LPAREN '(' +#define RPAREN ')' +#define LBRACK '[' +#define RBRACK ']' + +#if defined (HANDLE_MULTIBYTE) +#define WLPAREN L'(' +#define WRPAREN L')' +#endif + +/* Evaluates to 1 if C is one of the shell's special parameters whose length + can be taken, but is also one of the special expansion characters. */ +#define VALID_SPECIAL_LENGTH_PARAM(c) \ + ((c) == '-' || (c) == '?' || (c) == '#') + +/* Evaluates to 1 if C is one of the shell's special parameters for which an + indirect variable reference may be made. */ +#define VALID_INDIR_PARAM(c) \ + ((posixly_correct == 0 && (c) == '#') || (posixly_correct == 0 && (c) == '?') || (c) == '@' || (c) == '*') + +/* Evaluates to 1 if C is one of the OP characters that follows the parameter + in ${parameter[:]OPword}. */ +#define VALID_PARAM_EXPAND_CHAR(c) (sh_syntaxtab[(unsigned char)c] & CSUBSTOP) + +/* Evaluates to 1 if this is one of the shell's special variables. */ +#define SPECIAL_VAR(name, wi) \ + ((DIGIT (*name) && all_digits (name)) || \ + (name[1] == '\0' && (sh_syntaxtab[(unsigned char)*name] & CSPECVAR)) || \ + (wi && name[2] == '\0' && VALID_INDIR_PARAM (name[1]))) + +/* An expansion function that takes a string and a quoted flag and returns + a WORD_LIST *. Used as the type of the third argument to + expand_string_if_necessary(). */ +typedef WORD_LIST *EXPFUNC __P((char *, int)); + +/* Process ID of the last command executed within command substitution. */ +pid_t last_command_subst_pid = NO_PID; +pid_t current_command_subst_pid = NO_PID; + +/* Variables used to keep track of the characters in IFS. */ +SHELL_VAR *ifs_var; +char *ifs_value; +unsigned char ifs_cmap[UCHAR_MAX + 1]; +int ifs_is_set, ifs_is_null; + +#if defined (HANDLE_MULTIBYTE) +unsigned char ifs_firstc[MB_LEN_MAX]; +size_t ifs_firstc_len; +#else +unsigned char ifs_firstc; +#endif + +/* Sentinel to tell when we are performing variable assignments preceding a + command name and putting them into the environment. Used to make sure + we use the temporary environment when looking up variable values. */ +int assigning_in_environment; + +/* Used to hold a list of variable assignments preceding a command. Global + so the SIGCHLD handler in jobs.c can unwind-protect it when it runs a + SIGCHLD trap and so it can be saved and restored by the trap handlers. */ +WORD_LIST *subst_assign_varlist = (WORD_LIST *)NULL; + +/* Extern functions and variables from different files. */ +extern int last_command_exit_value, last_command_exit_signal; +extern int subshell_environment, line_number; +extern int subshell_level, parse_and_execute_level, sourcelevel; +extern int eof_encountered; +extern int return_catch_flag, return_catch_value; +extern pid_t dollar_dollar_pid; +extern int posixly_correct; +extern char *this_command_name; +extern struct fd_bitmap *current_fds_to_close; +extern int wordexp_only; +extern int expanding_redir; +extern int tempenv_assign_error; +extern int builtin_ignoring_errexit; + +#if !defined (HAVE_WCSDUP) && defined (HANDLE_MULTIBYTE) +extern wchar_t *wcsdup __P((const wchar_t *)); +#endif + +/* Non-zero means to allow unmatched globbed filenames to expand to + a null file. */ +int allow_null_glob_expansion; + +/* Non-zero means to throw an error when globbing fails to match anything. */ +int fail_glob_expansion; + +#if 0 +/* Variables to keep track of which words in an expanded word list (the + output of expand_word_list_internal) are the result of globbing + expansions. GLOB_ARGV_FLAGS is used by execute_cmd.c. + (CURRENTLY UNUSED). */ +char *glob_argv_flags; +static int glob_argv_flags_size; +#endif + +static WORD_LIST expand_word_error, expand_word_fatal; +static WORD_DESC expand_wdesc_error, expand_wdesc_fatal; +static char expand_param_error, expand_param_fatal; +static char extract_string_error, extract_string_fatal; + +/* Tell the expansion functions to not longjmp back to top_level on fatal + errors. Enabled when doing completion and prompt string expansion. */ +static int no_longjmp_on_fatal_error = 0; + +/* Set by expand_word_unsplit; used to inhibit splitting and re-joining + $* on $IFS, primarily when doing assignment statements. */ +static int expand_no_split_dollar_star = 0; + +/* A WORD_LIST of words to be expanded by expand_word_list_internal, + without any leading variable assignments. */ +static WORD_LIST *garglist = (WORD_LIST *)NULL; + +static char *quoted_substring __P((char *, int, int)); +static int quoted_strlen __P((char *)); +static char *quoted_strchr __P((char *, int, int)); + +static char *expand_string_if_necessary __P((char *, int, EXPFUNC *)); +static inline char *expand_string_to_string_internal __P((char *, int, EXPFUNC *)); +static WORD_LIST *call_expand_word_internal __P((WORD_DESC *, int, int, int *, int *)); +static WORD_LIST *expand_string_internal __P((char *, int)); +static WORD_LIST *expand_string_leave_quoted __P((char *, int)); +static WORD_LIST *expand_string_for_rhs __P((char *, int, int *, int *)); + +static WORD_LIST *list_quote_escapes __P((WORD_LIST *)); +static WORD_LIST *list_dequote_escapes __P((WORD_LIST *)); + +static char *make_quoted_char __P((int)); +static WORD_LIST *quote_list __P((WORD_LIST *)); + +static int unquoted_substring __P((char *, char *)); +static int unquoted_member __P((int, char *)); + +#if defined (ARRAY_VARS) +static SHELL_VAR *do_compound_assignment __P((char *, char *, int)); +#endif +static int do_assignment_internal __P((const WORD_DESC *, int)); + +static char *string_extract_verbatim __P((char *, size_t, int *, char *, int)); +static char *string_extract __P((char *, int *, char *, int)); +static char *string_extract_double_quoted __P((char *, int *, int)); +static inline char *string_extract_single_quoted __P((char *, int *)); +static inline int skip_single_quoted __P((const char *, size_t, int)); +static int skip_double_quoted __P((char *, size_t, int)); +static char *extract_delimited_string __P((char *, int *, char *, char *, char *, int)); +static char *extract_dollar_brace_string __P((char *, int *, int, int)); +static int skip_matched_pair __P((const char *, int, int, int, int)); + +static char *pos_params __P((char *, int, int, int)); + +static unsigned char *mb_getcharlens __P((char *, int)); + +static char *remove_upattern __P((char *, char *, int)); +#if defined (HANDLE_MULTIBYTE) +static wchar_t *remove_wpattern __P((wchar_t *, size_t, wchar_t *, int)); +#endif +static char *remove_pattern __P((char *, char *, int)); + +static int match_upattern __P((char *, char *, int, char **, char **)); +#if defined (HANDLE_MULTIBYTE) +static int match_wpattern __P((wchar_t *, char **, size_t, wchar_t *, int, char **, char **)); +#endif +static int match_pattern __P((char *, char *, int, char **, char **)); +static int getpatspec __P((int, char *)); +static char *getpattern __P((char *, int, int)); +static char *variable_remove_pattern __P((char *, char *, int, int)); +static char *list_remove_pattern __P((WORD_LIST *, char *, int, int, int)); +static char *parameter_list_remove_pattern __P((int, char *, int, int)); +#ifdef ARRAY_VARS +static char *array_remove_pattern __P((SHELL_VAR *, char *, int, char *, int)); +#endif +static char *parameter_brace_remove_pattern __P((char *, char *, int, char *, int, int, int)); + +static char *process_substitute __P((char *, int)); + +static char *read_comsub __P((int, int, int *)); + +#ifdef ARRAY_VARS +static arrayind_t array_length_reference __P((char *)); +#endif + +static int valid_brace_expansion_word __P((char *, int)); +static int chk_atstar __P((char *, int, int *, int *)); +static int chk_arithsub __P((const char *, int)); + +static WORD_DESC *parameter_brace_expand_word __P((char *, int, int, int, arrayind_t *)); +static char *parameter_brace_find_indir __P((char *, int, int, int)); +static WORD_DESC *parameter_brace_expand_indir __P((char *, int, int, int *, int *)); +static WORD_DESC *parameter_brace_expand_rhs __P((char *, char *, int, int, int *, int *)); +static void parameter_brace_expand_error __P((char *, char *)); + +static int valid_length_expression __P((char *)); +static intmax_t parameter_brace_expand_length __P((char *)); + +static char *skiparith __P((char *, int)); +static int verify_substring_values __P((SHELL_VAR *, char *, char *, int, intmax_t *, intmax_t *)); +static int get_var_and_type __P((char *, char *, arrayind_t, int, int, SHELL_VAR **, char **)); +static char *mb_substring __P((char *, int, int)); +static char *parameter_brace_substring __P((char *, char *, int, char *, int, int)); + +static int shouldexp_replacement __P((char *)); + +static char *pos_params_pat_subst __P((char *, char *, char *, int)); + +static char *parameter_brace_patsub __P((char *, char *, int, char *, int, int)); + +static char *pos_params_casemod __P((char *, char *, int, int)); +static char *parameter_brace_casemod __P((char *, char *, int, int, char *, int, int)); + +static WORD_DESC *parameter_brace_expand __P((char *, int *, int, int, int *, int *)); +static WORD_DESC *param_expand __P((char *, int *, int, int *, int *, int *, int *, int)); + +static WORD_LIST *expand_word_internal __P((WORD_DESC *, int, int, int *, int *)); + +static WORD_LIST *word_list_split __P((WORD_LIST *)); + +static void exp_jump_to_top_level __P((int)); + +static WORD_LIST *separate_out_assignments __P((WORD_LIST *)); +static WORD_LIST *glob_expand_word_list __P((WORD_LIST *, int)); +#ifdef BRACE_EXPANSION +static WORD_LIST *brace_expand_word_list __P((WORD_LIST *, int)); +#endif +#if defined (ARRAY_VARS) +static int make_internal_declare __P((char *, char *)); +#endif +static WORD_LIST *shell_expand_word_list __P((WORD_LIST *, int)); +static WORD_LIST *expand_word_list_internal __P((WORD_LIST *, int)); + +/* **************************************************************** */ +/* */ +/* Utility Functions */ +/* */ +/* **************************************************************** */ + +#if defined (DEBUG) +void +dump_word_flags (flags) + int flags; +{ + int f; + + f = flags; + fprintf (stderr, "%d -> ", f); + if (f & W_ASSIGNASSOC) + { + f &= ~W_ASSIGNASSOC; + fprintf (stderr, "W_ASSIGNASSOC%s", f ? "|" : ""); + } + if (f & W_ASSIGNARRAY) + { + f &= ~W_ASSIGNARRAY; + fprintf (stderr, "W_ASSIGNARRAY%s", f ? "|" : ""); + } + if (f & W_HASCTLESC) + { + f &= ~W_HASCTLESC; + fprintf (stderr, "W_HASCTLESC%s", f ? "|" : ""); + } + if (f & W_NOPROCSUB) + { + f &= ~W_NOPROCSUB; + fprintf (stderr, "W_NOPROCSUB%s", f ? "|" : ""); + } + if (f & W_DQUOTE) + { + f &= ~W_DQUOTE; + fprintf (stderr, "W_DQUOTE%s", f ? "|" : ""); + } + if (f & W_HASQUOTEDNULL) + { + f &= ~W_HASQUOTEDNULL; + fprintf (stderr, "W_HASQUOTEDNULL%s", f ? "|" : ""); + } + if (f & W_ASSIGNARG) + { + f &= ~W_ASSIGNARG; + fprintf (stderr, "W_ASSIGNARG%s", f ? "|" : ""); + } + if (f & W_ASSNBLTIN) + { + f &= ~W_ASSNBLTIN; + fprintf (stderr, "W_ASSNBLTIN%s", f ? "|" : ""); + } + if (f & W_ASSNGLOBAL) + { + f &= ~W_ASSNGLOBAL; + fprintf (stderr, "W_ASSNGLOBAL%s", f ? "|" : ""); + } + if (f & W_ASSIGNINT) + { + f &= ~W_ASSIGNINT; + fprintf (stderr, "W_ASSIGNINT%s", f ? "|" : ""); + } + if (f & W_COMPASSIGN) + { + f &= ~W_COMPASSIGN; + fprintf (stderr, "W_COMPASSIGN%s", f ? "|" : ""); + } + if (f & W_NOEXPAND) + { + f &= ~W_NOEXPAND; + fprintf (stderr, "W_NOEXPAND%s", f ? "|" : ""); + } + if (f & W_ITILDE) + { + f &= ~W_ITILDE; + fprintf (stderr, "W_ITILDE%s", f ? "|" : ""); + } + if (f & W_NOTILDE) + { + f &= ~W_NOTILDE; + fprintf (stderr, "W_NOTILDE%s", f ? "|" : ""); + } + if (f & W_ASSIGNRHS) + { + f &= ~W_ASSIGNRHS; + fprintf (stderr, "W_ASSIGNRHS%s", f ? "|" : ""); + } + if (f & W_NOCOMSUB) + { + f &= ~W_NOCOMSUB; + fprintf (stderr, "W_NOCOMSUB%s", f ? "|" : ""); + } + if (f & W_DOLLARSTAR) + { + f &= ~W_DOLLARSTAR; + fprintf (stderr, "W_DOLLARSTAR%s", f ? "|" : ""); + } + if (f & W_DOLLARAT) + { + f &= ~W_DOLLARAT; + fprintf (stderr, "W_DOLLARAT%s", f ? "|" : ""); + } + if (f & W_TILDEEXP) + { + f &= ~W_TILDEEXP; + fprintf (stderr, "W_TILDEEXP%s", f ? "|" : ""); + } + if (f & W_NOSPLIT2) + { + f &= ~W_NOSPLIT2; + fprintf (stderr, "W_NOSPLIT2%s", f ? "|" : ""); + } + if (f & W_NOSPLIT) + { + f &= ~W_NOSPLIT; + fprintf (stderr, "W_NOSPLIT%s", f ? "|" : ""); + } + if (f & W_NOBRACE) + { + f &= ~W_NOBRACE; + fprintf (stderr, "W_NOBRACE%s", f ? "|" : ""); + } + if (f & W_NOGLOB) + { + f &= ~W_NOGLOB; + fprintf (stderr, "W_NOGLOB%s", f ? "|" : ""); + } + if (f & W_SPLITSPACE) + { + f &= ~W_SPLITSPACE; + fprintf (stderr, "W_SPLITSPACE%s", f ? "|" : ""); + } + if (f & W_ASSIGNMENT) + { + f &= ~W_ASSIGNMENT; + fprintf (stderr, "W_ASSIGNMENT%s", f ? "|" : ""); + } + if (f & W_QUOTED) + { + f &= ~W_QUOTED; + fprintf (stderr, "W_QUOTED%s", f ? "|" : ""); + } + if (f & W_HASDOLLAR) + { + f &= ~W_HASDOLLAR; + fprintf (stderr, "W_HASDOLLAR%s", f ? "|" : ""); + } + fprintf (stderr, "\n"); + fflush (stderr); +} +#endif + +#ifdef INCLUDE_UNUSED +static char * +quoted_substring (string, start, end) + char *string; + int start, end; +{ + register int len, l; + register char *result, *s, *r; + + len = end - start; + + /* Move to string[start], skipping quoted characters. */ + for (s = string, l = 0; *s && l < start; ) + { + if (*s == CTLESC) + { + s++; + continue; + } + l++; + if (*s == 0) + break; + } + + r = result = (char *)xmalloc (2*len + 1); /* save room for quotes */ + + /* Copy LEN characters, including quote characters. */ + s = string + l; + for (l = 0; l < len; s++) + { + if (*s == CTLESC) + *r++ = *s++; + *r++ = *s; + l++; + if (*s == 0) + break; + } + *r = '\0'; + return result; +} +#endif + +#ifdef INCLUDE_UNUSED +/* Return the length of S, skipping over quoted characters */ +static int +quoted_strlen (s) + char *s; +{ + register char *p; + int i; + + i = 0; + for (p = s; *p; p++) + { + if (*p == CTLESC) + { + p++; + if (*p == 0) + return (i + 1); + } + i++; + } + + return i; +} +#endif + +/* Find the first occurrence of character C in string S, obeying shell + quoting rules. If (FLAGS & ST_BACKSL) is non-zero, backslash-escaped + characters are skipped. If (FLAGS & ST_CTLESC) is non-zero, characters + escaped with CTLESC are skipped. */ +static char * +quoted_strchr (s, c, flags) + char *s; + int c, flags; +{ + register char *p; + + for (p = s; *p; p++) + { + if (((flags & ST_BACKSL) && *p == '\\') + || ((flags & ST_CTLESC) && *p == CTLESC)) + { + p++; + if (*p == '\0') + return ((char *)NULL); + continue; + } + else if (*p == c) + return p; + } + return ((char *)NULL); +} + +/* Return 1 if CHARACTER appears in an unquoted portion of + STRING. Return 0 otherwise. CHARACTER must be a single-byte character. */ +static int +unquoted_member (character, string) + int character; + char *string; +{ + size_t slen; + int sindex, c; + DECLARE_MBSTATE; + + slen = strlen (string); + sindex = 0; + while (c = string[sindex]) + { + if (c == character) + return (1); + + switch (c) + { + default: + ADVANCE_CHAR (string, slen, sindex); + break; + + case '\\': + sindex++; + if (string[sindex]) + ADVANCE_CHAR (string, slen, sindex); + break; + + case '\'': + sindex = skip_single_quoted (string, slen, ++sindex); + break; + + case '"': + sindex = skip_double_quoted (string, slen, ++sindex); + break; + } + } + return (0); +} + +/* Return 1 if SUBSTR appears in an unquoted portion of STRING. */ +static int +unquoted_substring (substr, string) + char *substr, *string; +{ + size_t slen; + int sindex, c, sublen; + DECLARE_MBSTATE; + + if (substr == 0 || *substr == '\0') + return (0); + + slen = strlen (string); + sublen = strlen (substr); + for (sindex = 0; c = string[sindex]; ) + { + if (STREQN (string + sindex, substr, sublen)) + return (1); + + switch (c) + { + case '\\': + sindex++; + if (string[sindex]) + ADVANCE_CHAR (string, slen, sindex); + break; + + case '\'': + sindex = skip_single_quoted (string, slen, ++sindex); + break; + + case '"': + sindex = skip_double_quoted (string, slen, ++sindex); + break; + + default: + ADVANCE_CHAR (string, slen, sindex); + break; + } + } + return (0); +} + +/* Most of the substitutions must be done in parallel. In order + to avoid using tons of unclear goto's, I have some functions + for manipulating malloc'ed strings. They all take INDX, a + pointer to an integer which is the offset into the string + where manipulation is taking place. They also take SIZE, a + pointer to an integer which is the current length of the + character array for this string. */ + +/* Append SOURCE to TARGET at INDEX. SIZE is the current amount + of space allocated to TARGET. SOURCE can be NULL, in which + case nothing happens. Gets rid of SOURCE by freeing it. + Returns TARGET in case the location has changed. */ +INLINE char * +sub_append_string (source, target, indx, size) + char *source, *target; + int *indx, *size; +{ + if (source) + { + int srclen, n; + + srclen = STRLEN (source); + if (srclen >= (int)(*size - *indx)) + { + n = srclen + *indx; + n = (n + DEFAULT_ARRAY_SIZE) - (n % DEFAULT_ARRAY_SIZE); + target = (char *)xrealloc (target, (*size = n)); + } + + FASTCOPY (source, target + *indx, srclen); + *indx += srclen; + target[*indx] = '\0'; + + free (source); + } + return (target); +} + +#if 0 +/* UNUSED */ +/* Append the textual representation of NUMBER to TARGET. + INDX and SIZE are as in SUB_APPEND_STRING. */ +char * +sub_append_number (number, target, indx, size) + intmax_t number; + int *indx, *size; + char *target; +{ + char *temp; + + temp = itos (number); + return (sub_append_string (temp, target, indx, size)); +} +#endif + +/* Extract a substring from STRING, starting at SINDEX and ending with + one of the characters in CHARLIST. Don't make the ending character + part of the string. Leave SINDEX pointing at the ending character. + Understand about backslashes in the string. If (flags & SX_VARNAME) + is non-zero, and array variables have been compiled into the shell, + everything between a `[' and a corresponding `]' is skipped over. + If (flags & SX_NOALLOC) is non-zero, don't return the substring, just + update SINDEX. If (flags & SX_REQMATCH) is non-zero, the string must + contain a closing character from CHARLIST. */ +static char * +string_extract (string, sindex, charlist, flags) + char *string; + int *sindex; + char *charlist; + int flags; +{ + register int c, i; + int found; + size_t slen; + char *temp; + DECLARE_MBSTATE; + + slen = (MB_CUR_MAX > 1) ? strlen (string + *sindex) + *sindex : 0; + i = *sindex; + found = 0; + while (c = string[i]) + { + if (c == '\\') + { + if (string[i + 1]) + i++; + else + break; + } +#if defined (ARRAY_VARS) + else if ((flags & SX_VARNAME) && c == '[') + { + int ni; + /* If this is an array subscript, skip over it and continue. */ + ni = skipsubscript (string, i, 0); + if (string[ni] == ']') + i = ni; + } +#endif + else if (MEMBER (c, charlist)) + { + found = 1; + break; + } + + ADVANCE_CHAR (string, slen, i); + } + + /* If we had to have a matching delimiter and didn't find one, return an + error and let the caller deal with it. */ + if ((flags & SX_REQMATCH) && found == 0) + { + *sindex = i; + return (&extract_string_error); + } + + temp = (flags & SX_NOALLOC) ? (char *)NULL : substring (string, *sindex, i); + *sindex = i; + + return (temp); +} + +/* Extract the contents of STRING as if it is enclosed in double quotes. + SINDEX, when passed in, is the offset of the character immediately + following the opening double quote; on exit, SINDEX is left pointing after + the closing double quote. If STRIPDQ is non-zero, unquoted double + quotes are stripped and the string is terminated by a null byte. + Backslashes between the embedded double quotes are processed. If STRIPDQ + is zero, an unquoted `"' terminates the string. */ +static char * +string_extract_double_quoted (string, sindex, stripdq) + char *string; + int *sindex, stripdq; +{ + size_t slen; + char *send; + int j, i, t; + unsigned char c; + char *temp, *ret; /* The new string we return. */ + int pass_next, backquote, si; /* State variables for the machine. */ + int dquote; + DECLARE_MBSTATE; + + slen = strlen (string + *sindex) + *sindex; + send = string + slen; + + pass_next = backquote = dquote = 0; + temp = (char *)xmalloc (1 + slen - *sindex); + + j = 0; + i = *sindex; + while (c = string[i]) + { + /* Process a character that was quoted by a backslash. */ + if (pass_next) + { + /* XXX - take another look at this in light of Interp 221 */ + /* Posix.2 sez: + + ``The backslash shall retain its special meaning as an escape + character only when followed by one of the characters: + $ ` " \ ''. + + If STRIPDQ is zero, we handle the double quotes here and let + expand_word_internal handle the rest. If STRIPDQ is non-zero, + we have already been through one round of backslash stripping, + and want to strip these backslashes only if DQUOTE is non-zero, + indicating that we are inside an embedded double-quoted string. */ + + /* If we are in an embedded quoted string, then don't strip + backslashes before characters for which the backslash + retains its special meaning, but remove backslashes in + front of other characters. If we are not in an + embedded quoted string, don't strip backslashes at all. + This mess is necessary because the string was already + surrounded by double quotes (and sh has some really weird + quoting rules). + The returned string will be run through expansion as if + it were double-quoted. */ + if ((stripdq == 0 && c != '"') || + (stripdq && ((dquote && (sh_syntaxtab[c] & CBSDQUOTE)) || dquote == 0))) + temp[j++] = '\\'; + pass_next = 0; + +add_one_character: + COPY_CHAR_I (temp, j, string, send, i); + continue; + } + + /* A backslash protects the next character. The code just above + handles preserving the backslash in front of any character but + a double quote. */ + if (c == '\\') + { + pass_next++; + i++; + continue; + } + + /* Inside backquotes, ``the portion of the quoted string from the + initial backquote and the characters up to the next backquote + that is not preceded by a backslash, having escape characters + removed, defines that command''. */ + if (backquote) + { + if (c == '`') + backquote = 0; + temp[j++] = c; + i++; + continue; + } + + if (c == '`') + { + temp[j++] = c; + backquote++; + i++; + continue; + } + + /* Pass everything between `$(' and the matching `)' or a quoted + ${ ... } pair through according to the Posix.2 specification. */ + if (c == '$' && ((string[i + 1] == LPAREN) || (string[i + 1] == LBRACE))) + { + int free_ret = 1; + + si = i + 2; + if (string[i + 1] == LPAREN) + ret = extract_command_subst (string, &si, 0); + else + ret = extract_dollar_brace_string (string, &si, Q_DOUBLE_QUOTES, 0); + + temp[j++] = '$'; + temp[j++] = string[i + 1]; + + /* Just paranoia; ret will not be 0 unless no_longjmp_on_fatal_error + is set. */ + if (ret == 0 && no_longjmp_on_fatal_error) + { + free_ret = 0; + ret = string + i + 2; + } + + for (t = 0; ret[t]; t++, j++) + temp[j] = ret[t]; + temp[j] = string[si]; + + if (string[si]) + { + j++; + i = si + 1; + } + else + i = si; + + if (free_ret) + free (ret); + continue; + } + + /* Add any character but a double quote to the quoted string we're + accumulating. */ + if (c != '"') + goto add_one_character; + + /* c == '"' */ + if (stripdq) + { + dquote ^= 1; + i++; + continue; + } + + break; + } + temp[j] = '\0'; + + /* Point to after the closing quote. */ + if (c) + i++; + *sindex = i; + + return (temp); +} + +/* This should really be another option to string_extract_double_quoted. */ +static int +skip_double_quoted (string, slen, sind) + char *string; + size_t slen; + int sind; +{ + int c, i; + char *ret; + int pass_next, backquote, si; + DECLARE_MBSTATE; + + pass_next = backquote = 0; + i = sind; + while (c = string[i]) + { + if (pass_next) + { + pass_next = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next++; + i++; + continue; + } + else if (backquote) + { + if (c == '`') + backquote = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '`') + { + backquote++; + i++; + continue; + } + else if (c == '$' && ((string[i + 1] == LPAREN) || (string[i + 1] == LBRACE))) + { + si = i + 2; + if (string[i + 1] == LPAREN) + ret = extract_command_subst (string, &si, SX_NOALLOC); + else + ret = extract_dollar_brace_string (string, &si, Q_DOUBLE_QUOTES, SX_NOALLOC); + + i = si + 1; + continue; + } + else if (c != '"') + { + ADVANCE_CHAR (string, slen, i); + continue; + } + else + break; + } + + if (c) + i++; + + return (i); +} + +/* Extract the contents of STRING as if it is enclosed in single quotes. + SINDEX, when passed in, is the offset of the character immediately + following the opening single quote; on exit, SINDEX is left pointing after + the closing single quote. */ +static inline char * +string_extract_single_quoted (string, sindex) + char *string; + int *sindex; +{ + register int i; + size_t slen; + char *t; + DECLARE_MBSTATE; + + /* Don't need slen for ADVANCE_CHAR unless multibyte chars possible. */ + slen = (MB_CUR_MAX > 1) ? strlen (string + *sindex) + *sindex : 0; + i = *sindex; + while (string[i] && string[i] != '\'') + ADVANCE_CHAR (string, slen, i); + + t = substring (string, *sindex, i); + + if (string[i]) + i++; + *sindex = i; + + return (t); +} + +static inline int +skip_single_quoted (string, slen, sind) + const char *string; + size_t slen; + int sind; +{ + register int c; + DECLARE_MBSTATE; + + c = sind; + while (string[c] && string[c] != '\'') + ADVANCE_CHAR (string, slen, c); + + if (string[c]) + c++; + return c; +} + +/* Just like string_extract, but doesn't hack backslashes or any of + that other stuff. Obeys CTLESC quoting. Used to do splitting on $IFS. */ +static char * +string_extract_verbatim (string, slen, sindex, charlist, flags) + char *string; + size_t slen; + int *sindex; + char *charlist; + int flags; +{ + register int i; +#if defined (HANDLE_MULTIBYTE) + size_t clen; + wchar_t *wcharlist; +#endif + int c; + char *temp; + DECLARE_MBSTATE; + + if (charlist[0] == '\'' && charlist[1] == '\0') + { + temp = string_extract_single_quoted (string, sindex); + --*sindex; /* leave *sindex at separator character */ + return temp; + } + + i = *sindex; +#if 0 + /* See how the MBLEN and ADVANCE_CHAR macros work to understand why we need + this only if MB_CUR_MAX > 1. */ + slen = (MB_CUR_MAX > 1) ? strlen (string + *sindex) + *sindex : 1; +#endif +#if defined (HANDLE_MULTIBYTE) + clen = strlen (charlist); + wcharlist = 0; +#endif + while (c = string[i]) + { +#if defined (HANDLE_MULTIBYTE) + size_t mblength; +#endif + if ((flags & SX_NOCTLESC) == 0 && c == CTLESC) + { + i += 2; + continue; + } + /* Even if flags contains SX_NOCTLESC, we let CTLESC quoting CTLNUL + through, to protect the CTLNULs from later calls to + remove_quoted_nulls. */ + else if ((flags & SX_NOESCCTLNUL) == 0 && c == CTLESC && string[i+1] == CTLNUL) + { + i += 2; + continue; + } + +#if defined (HANDLE_MULTIBYTE) + mblength = MBLEN (string + i, slen - i); + if (mblength > 1) + { + wchar_t wc; + mblength = mbtowc (&wc, string + i, slen - i); + if (MB_INVALIDCH (mblength)) + { + if (MEMBER (c, charlist)) + break; + } + else + { + if (wcharlist == 0) + { + size_t len; + len = mbstowcs (wcharlist, charlist, 0); + if (len == -1) + len = 0; + wcharlist = (wchar_t *)xmalloc (sizeof (wchar_t) * (len + 1)); + mbstowcs (wcharlist, charlist, len + 1); + } + + if (wcschr (wcharlist, wc)) + break; + } + } + else +#endif + if (MEMBER (c, charlist)) + break; + + ADVANCE_CHAR (string, slen, i); + } + +#if defined (HANDLE_MULTIBYTE) + FREE (wcharlist); +#endif + + temp = substring (string, *sindex, i); + *sindex = i; + + return (temp); +} + +/* Extract the $( construct in STRING, and return a new string. + Start extracting at (SINDEX) as if we had just seen "$(". + Make (SINDEX) get the position of the matching ")". ) + XFLAGS is additional flags to pass to other extraction functions. */ +char * +extract_command_subst (string, sindex, xflags) + char *string; + int *sindex; + int xflags; +{ + if (string[*sindex] == LPAREN) + return (extract_delimited_string (string, sindex, "$(", "(", ")", xflags|SX_COMMAND)); /*)*/ + else + { + xflags |= (no_longjmp_on_fatal_error ? SX_NOLONGJMP : 0); + return (xparse_dolparen (string, string+*sindex, sindex, xflags)); + } +} + +/* Extract the $[ construct in STRING, and return a new string. (]) + Start extracting at (SINDEX) as if we had just seen "$[". + Make (SINDEX) get the position of the matching "]". */ +char * +extract_arithmetic_subst (string, sindex) + char *string; + int *sindex; +{ + return (extract_delimited_string (string, sindex, "$[", "[", "]", 0)); /*]*/ +} + +#if defined (PROCESS_SUBSTITUTION) +/* Extract the <( or >( construct in STRING, and return a new string. + Start extracting at (SINDEX) as if we had just seen "<(". + Make (SINDEX) get the position of the matching ")". */ /*))*/ +char * +extract_process_subst (string, starter, sindex, xflags) + char *string; + char *starter; + int *sindex; + int xflags; +{ +#if 0 + return (extract_delimited_string (string, sindex, starter, "(", ")", SX_COMMAND)); +#else + xflags |= (no_longjmp_on_fatal_error ? SX_NOLONGJMP : 0); + return (xparse_dolparen (string, string+*sindex, sindex, xflags)); +#endif +} +#endif /* PROCESS_SUBSTITUTION */ + +#if defined (ARRAY_VARS) +/* This can be fooled by unquoted right parens in the passed string. If + each caller verifies that the last character in STRING is a right paren, + we don't even need to call extract_delimited_string. */ +char * +extract_array_assignment_list (string, sindex) + char *string; + int *sindex; +{ + int slen; + char *ret; + + slen = strlen (string); /* ( */ + if (string[slen - 1] == ')') + { + ret = substring (string, *sindex, slen - 1); + *sindex = slen - 1; + return ret; + } + return 0; +} +#endif + +/* Extract and create a new string from the contents of STRING, a + character string delimited with OPENER and CLOSER. SINDEX is + the address of an int describing the current offset in STRING; + it should point to just after the first OPENER found. On exit, + SINDEX gets the position of the last character of the matching CLOSER. + If OPENER is more than a single character, ALT_OPENER, if non-null, + contains a character string that can also match CLOSER and thus + needs to be skipped. */ +static char * +extract_delimited_string (string, sindex, opener, alt_opener, closer, flags) + char *string; + int *sindex; + char *opener, *alt_opener, *closer; + int flags; +{ + int i, c, si; + size_t slen; + char *t, *result; + int pass_character, nesting_level, in_comment; + int len_closer, len_opener, len_alt_opener; + DECLARE_MBSTATE; + + slen = strlen (string + *sindex) + *sindex; + len_opener = STRLEN (opener); + len_alt_opener = STRLEN (alt_opener); + len_closer = STRLEN (closer); + + pass_character = in_comment = 0; + + nesting_level = 1; + i = *sindex; + + while (nesting_level) + { + c = string[i]; + + if (c == 0) + break; + + if (in_comment) + { + if (c == '\n') + in_comment = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + + if (pass_character) /* previous char was backslash */ + { + pass_character = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + + /* Not exactly right yet; should handle shell metacharacters and + multibyte characters, too. See COMMENT_BEGIN define in parse.y */ + if ((flags & SX_COMMAND) && c == '#' && (i == 0 || string[i - 1] == '\n' || shellblank (string[i - 1]))) + { + in_comment = 1; + ADVANCE_CHAR (string, slen, i); + continue; + } + + if (c == CTLESC || c == '\\') + { + pass_character++; + i++; + continue; + } + + /* Process a nested command substitution, but only if we're parsing an + arithmetic substitution. */ + if ((flags & SX_COMMAND) && string[i] == '$' && string[i+1] == LPAREN) + { + si = i + 2; + t = extract_command_subst (string, &si, flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Process a nested OPENER. */ + if (STREQN (string + i, opener, len_opener)) + { + si = i + len_opener; + t = extract_delimited_string (string, &si, opener, alt_opener, closer, flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Process a nested ALT_OPENER */ + if (len_alt_opener && STREQN (string + i, alt_opener, len_alt_opener)) + { + si = i + len_alt_opener; + t = extract_delimited_string (string, &si, alt_opener, alt_opener, closer, flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* If the current substring terminates the delimited string, decrement + the nesting level. */ + if (STREQN (string + i, closer, len_closer)) + { + i += len_closer - 1; /* move to last byte of the closer */ + nesting_level--; + if (nesting_level == 0) + break; + } + + /* Pass old-style command substitution through verbatim. */ + if (c == '`') + { + si = i + 1; + t = string_extract (string, &si, "`", flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Pass single-quoted and double-quoted strings through verbatim. */ + if (c == '\'' || c == '"') + { + si = i + 1; + i = (c == '\'') ? skip_single_quoted (string, slen, si) + : skip_double_quoted (string, slen, si); + continue; + } + + /* move past this character, which was not special. */ + ADVANCE_CHAR (string, slen, i); + } + + if (c == 0 && nesting_level) + { + if (no_longjmp_on_fatal_error == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("bad substitution: no closing `%s' in %s"), closer, string); + exp_jump_to_top_level (DISCARD); + } + else + { + *sindex = i; + return (char *)NULL; + } + } + + si = i - *sindex - len_closer + 1; + if (flags & SX_NOALLOC) + result = (char *)NULL; + else + { + result = (char *)xmalloc (1 + si); + strncpy (result, string + *sindex, si); + result[si] = '\0'; + } + *sindex = i; + + return (result); +} + +/* Extract a parameter expansion expression within ${ and } from STRING. + Obey the Posix.2 rules for finding the ending `}': count braces while + skipping over enclosed quoted strings and command substitutions. + SINDEX is the address of an int describing the current offset in STRING; + it should point to just after the first `{' found. On exit, SINDEX + gets the position of the matching `}'. QUOTED is non-zero if this + occurs inside double quotes. */ +/* XXX -- this is very similar to extract_delimited_string -- XXX */ +static char * +extract_dollar_brace_string (string, sindex, quoted, flags) + char *string; + int *sindex, quoted, flags; +{ + register int i, c; + size_t slen; + int pass_character, nesting_level, si, dolbrace_state; + char *result, *t; + DECLARE_MBSTATE; + + pass_character = 0; + nesting_level = 1; + slen = strlen (string + *sindex) + *sindex; + + /* The handling of dolbrace_state needs to agree with the code in parse.y: + parse_matched_pair(). The different initial value is to handle the + case where this function is called to parse the word in + ${param op word} (SX_WORD). */ + dolbrace_state = (flags & SX_WORD) ? DOLBRACE_WORD : DOLBRACE_PARAM; + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && (flags & SX_POSIXEXP)) + dolbrace_state = DOLBRACE_QUOTE; + + i = *sindex; + while (c = string[i]) + { + if (pass_character) + { + pass_character = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + + /* CTLESCs and backslashes quote the next character. */ + if (c == CTLESC || c == '\\') + { + pass_character++; + i++; + continue; + } + + if (string[i] == '$' && string[i+1] == LBRACE) + { + nesting_level++; + i += 2; + continue; + } + + if (c == RBRACE) + { + nesting_level--; + if (nesting_level == 0) + break; + i++; + continue; + } + + /* Pass the contents of old-style command substitutions through + verbatim. */ + if (c == '`') + { + si = i + 1; + t = string_extract (string, &si, "`", flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Pass the contents of new-style command substitutions and + arithmetic substitutions through verbatim. */ + if (string[i] == '$' && string[i+1] == LPAREN) + { + si = i + 2; + t = extract_command_subst (string, &si, flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Pass the contents of double-quoted strings through verbatim. */ + if (c == '"') + { + si = i + 1; + i = skip_double_quoted (string, slen, si); + /* skip_XXX_quoted leaves index one past close quote */ + continue; + } + + if (c == '\'') + { +/*itrace("extract_dollar_brace_string: c == single quote flags = %d quoted = %d dolbrace_state = %d", flags, quoted, dolbrace_state);*/ + if (posixly_correct && shell_compatibility_level > 42 && dolbrace_state != DOLBRACE_QUOTE && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ADVANCE_CHAR (string, slen, i); + else + { + si = i + 1; + i = skip_single_quoted (string, slen, si); + } + + continue; + } + + /* move past this character, which was not special. */ + ADVANCE_CHAR (string, slen, i); + + /* This logic must agree with parse.y:parse_matched_pair, since they + share the same defines. */ + if (dolbrace_state == DOLBRACE_PARAM && c == '%' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if (dolbrace_state == DOLBRACE_PARAM && c == '#' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if (dolbrace_state == DOLBRACE_PARAM && c == '/' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE2; /* XXX */ + else if (dolbrace_state == DOLBRACE_PARAM && c == '^' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if (dolbrace_state == DOLBRACE_PARAM && c == ',' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if (dolbrace_state == DOLBRACE_PARAM && strchr ("#%^,~:-=?+/", c) != 0) + dolbrace_state = DOLBRACE_OP; + else if (dolbrace_state == DOLBRACE_OP && strchr ("#%^,~:-=?+/", c) == 0) + dolbrace_state = DOLBRACE_WORD; + } + + if (c == 0 && nesting_level) + { + if (no_longjmp_on_fatal_error == 0) + { /* { */ + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("bad substitution: no closing `%s' in %s"), "}", string); + exp_jump_to_top_level (DISCARD); + } + else + { + *sindex = i; + return ((char *)NULL); + } + } + + result = (flags & SX_NOALLOC) ? (char *)NULL : substring (string, *sindex, i); + *sindex = i; + + return (result); +} + +/* Remove backslashes which are quoting backquotes from STRING. Modifies + STRING, and returns a pointer to it. */ +char * +de_backslash (string) + char *string; +{ + register size_t slen; + register int i, j, prev_i; + DECLARE_MBSTATE; + + slen = strlen (string); + i = j = 0; + + /* Loop copying string[i] to string[j], i >= j. */ + while (i < slen) + { + if (string[i] == '\\' && (string[i + 1] == '`' || string[i + 1] == '\\' || + string[i + 1] == '$')) + i++; + prev_i = i; + ADVANCE_CHAR (string, slen, i); + if (j < prev_i) + do string[j++] = string[prev_i++]; while (prev_i < i); + else + j = i; + } + string[j] = '\0'; + + return (string); +} + +#if 0 +/*UNUSED*/ +/* Replace instances of \! in a string with !. */ +void +unquote_bang (string) + char *string; +{ + register int i, j; + register char *temp; + + temp = (char *)xmalloc (1 + strlen (string)); + + for (i = 0, j = 0; (temp[j] = string[i]); i++, j++) + { + if (string[i] == '\\' && string[i + 1] == '!') + { + temp[j] = '!'; + i++; + } + } + strcpy (string, temp); + free (temp); +} +#endif + +#define CQ_RETURN(x) do { no_longjmp_on_fatal_error = 0; return (x); } while (0) + +/* This function assumes s[i] == open; returns with s[ret] == close; used to + parse array subscripts. FLAGS & 1 means to not attempt to skip over + matched pairs of quotes or backquotes, or skip word expansions; it is + intended to be used after expansion has been performed and during final + assignment parsing (see arrayfunc.c:assign_compound_array_list()). */ +static int +skip_matched_pair (string, start, open, close, flags) + const char *string; + int start, open, close, flags; +{ + int i, pass_next, backq, si, c, count; + size_t slen; + char *temp, *ss; + DECLARE_MBSTATE; + + slen = strlen (string + start) + start; + no_longjmp_on_fatal_error = 1; + + i = start + 1; /* skip over leading bracket */ + count = 1; + pass_next = backq = 0; + ss = (char *)string; + while (c = string[i]) + { + if (pass_next) + { + pass_next = 0; + if (c == 0) + CQ_RETURN(i); + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (backq) + { + if (c == '`') + backq = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if ((flags & 1) == 0 && c == '`') + { + backq = 1; + i++; + continue; + } + else if ((flags & 1) == 0 && c == open) + { + count++; + i++; + continue; + } + else if (c == close) + { + count--; + if (count == 0) + break; + i++; + continue; + } + else if ((flags & 1) == 0 && (c == '\'' || c == '"')) + { + i = (c == '\'') ? skip_single_quoted (ss, slen, ++i) + : skip_double_quoted (ss, slen, ++i); + /* no increment, the skip functions increment past the closing quote. */ + } + else if ((flags&1) == 0 && c == '$' && (string[i+1] == LPAREN || string[i+1] == LBRACE)) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + + if (string[i+1] == LPAREN) + temp = extract_delimited_string (ss, &si, "$(", "(", ")", SX_NOALLOC|SX_COMMAND); /* ) */ + else + temp = extract_dollar_brace_string (ss, &si, 0, SX_NOALLOC); + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } + else + ADVANCE_CHAR (string, slen, i); + } + + CQ_RETURN(i); +} + +#if defined (ARRAY_VARS) +int +skipsubscript (string, start, flags) + const char *string; + int start, flags; +{ + return (skip_matched_pair (string, start, '[', ']', flags)); +} +#endif + +/* Skip characters in STRING until we find a character in DELIMS, and return + the index of that character. START is the index into string at which we + begin. This is similar in spirit to strpbrk, but it returns an index into + STRING and takes a starting index. This little piece of code knows quite + a lot of shell syntax. It's very similar to skip_double_quoted and other + functions of that ilk. */ +int +skip_to_delim (string, start, delims, flags) + char *string; + int start; + char *delims; + int flags; +{ + int i, pass_next, backq, si, c, invert, skipquote, skipcmd; + size_t slen; + char *temp, open[3]; + DECLARE_MBSTATE; + + slen = strlen (string + start) + start; + if (flags & SD_NOJMP) + no_longjmp_on_fatal_error = 1; + invert = (flags & SD_INVERT); + skipcmd = (flags & SD_NOSKIPCMD) == 0; + + i = start; + pass_next = backq = 0; + while (c = string[i]) + { + /* If this is non-zero, we should not let quote characters be delimiters + and the current character is a single or double quote. We should not + test whether or not it's a delimiter until after we skip single- or + double-quoted strings. */ + skipquote = ((flags & SD_NOQUOTEDELIM) && (c == '\'' || c =='"')); + if (pass_next) + { + pass_next = 0; + if (c == 0) + CQ_RETURN(i); + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (backq) + { + if (c == '`') + backq = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '`') + { + backq = 1; + i++; + continue; + } + else if (skipquote == 0 && invert == 0 && member (c, delims)) + break; + else if (c == '\'' || c == '"') + { + i = (c == '\'') ? skip_single_quoted (string, slen, ++i) + : skip_double_quoted (string, slen, ++i); + /* no increment, the skip functions increment past the closing quote. */ + } + else if (c == '$' && ((skipcmd && string[i+1] == LPAREN) || string[i+1] == LBRACE)) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + + if (string[i+1] == LPAREN) + temp = extract_delimited_string (string, &si, "$(", "(", ")", SX_NOALLOC|SX_COMMAND); /* ) */ + else + temp = extract_dollar_brace_string (string, &si, 0, SX_NOALLOC); + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } +#if defined (PROCESS_SUBSTITUTION) + else if (skipcmd && (c == '<' || c == '>') && string[i+1] == LPAREN) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + temp = extract_process_subst (string, (c == '<') ? "<(" : ">(", &si, 0); + free (temp); /* no SX_ALLOC here */ + i = si; + if (string[i] == '\0') + break; + i++; + continue; + } +#endif /* PROCESS_SUBSTITUTION */ +#if defined (EXTENDED_GLOB) + else if ((flags & SD_EXTGLOB) && extended_glob && string[i+1] == LPAREN && member (c, "?*+!@")) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + + open[0] = c; + open[1] = LPAREN; + open[2] = '\0'; + temp = extract_delimited_string (string, &si, open, "(", ")", SX_NOALLOC); /* ) */ + + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } +#endif + else if ((flags & SD_GLOB) && c == LBRACK) + { + si = i + 1; + if (string[si] == '\0') + CQ_RETURN(si); + + temp = extract_delimited_string (string, &si, "[", "[", "]", SX_NOALLOC); /* ] */ + + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } + else if ((skipquote || invert) && (member (c, delims) == 0)) + break; + else + ADVANCE_CHAR (string, slen, i); + } + + CQ_RETURN(i); +} + +#if defined (READLINE) +/* Return 1 if the portion of STRING ending at EINDEX is quoted (there is + an unclosed quoted string), or if the character at EINDEX is quoted + by a backslash. NO_LONGJMP_ON_FATAL_ERROR is used to flag that the various + single and double-quoted string parsing functions should not return an + error if there are unclosed quotes or braces. The characters that this + recognizes need to be the same as the contents of + rl_completer_quote_characters. */ + +int +char_is_quoted (string, eindex) + char *string; + int eindex; +{ + int i, pass_next, c; + size_t slen; + DECLARE_MBSTATE; + + slen = strlen (string); + no_longjmp_on_fatal_error = 1; + i = pass_next = 0; + while (i <= eindex) + { + c = string[i]; + + if (pass_next) + { + pass_next = 0; + if (i >= eindex) /* XXX was if (i >= eindex - 1) */ + CQ_RETURN(1); + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (c == '\'' || c == '"') + { + i = (c == '\'') ? skip_single_quoted (string, slen, ++i) + : skip_double_quoted (string, slen, ++i); + if (i > eindex) + CQ_RETURN(1); + /* no increment, the skip_xxx functions go one past end */ + } + else + ADVANCE_CHAR (string, slen, i); + } + + CQ_RETURN(0); +} + +int +unclosed_pair (string, eindex, openstr) + char *string; + int eindex; + char *openstr; +{ + int i, pass_next, openc, olen; + size_t slen; + DECLARE_MBSTATE; + + slen = strlen (string); + olen = strlen (openstr); + i = pass_next = openc = 0; + while (i <= eindex) + { + if (pass_next) + { + pass_next = 0; + if (i >= eindex) /* XXX was if (i >= eindex - 1) */ + return 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (string[i] == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (STREQN (string + i, openstr, olen)) + { + openc = 1 - openc; + i += olen; + } + else if (string[i] == '\'' || string[i] == '"') + { + i = (string[i] == '\'') ? skip_single_quoted (string, slen, i) + : skip_double_quoted (string, slen, i); + if (i > eindex) + return 0; + } + else + ADVANCE_CHAR (string, slen, i); + } + return (openc); +} + +/* Split STRING (length SLEN) at DELIMS, and return a WORD_LIST with the + individual words. If DELIMS is NULL, the current value of $IFS is used + to split the string, and the function follows the shell field splitting + rules. SENTINEL is an index to look for. NWP, if non-NULL, + gets the number of words in the returned list. CWP, if non-NULL, gets + the index of the word containing SENTINEL. Non-whitespace chars in + DELIMS delimit separate fields. */ +WORD_LIST * +split_at_delims (string, slen, delims, sentinel, flags, nwp, cwp) + char *string; + int slen; + char *delims; + int sentinel, flags; + int *nwp, *cwp; +{ + int ts, te, i, nw, cw, ifs_split, dflags; + char *token, *d, *d2; + WORD_LIST *ret, *tl; + + if (string == 0 || *string == '\0') + { + if (nwp) + *nwp = 0; + if (cwp) + *cwp = 0; + return ((WORD_LIST *)NULL); + } + + d = (delims == 0) ? ifs_value : delims; + ifs_split = delims == 0; + + /* Make d2 the non-whitespace characters in delims */ + d2 = 0; + if (delims) + { + size_t slength; +#if defined (HANDLE_MULTIBYTE) + size_t mblength = 1; +#endif + DECLARE_MBSTATE; + + slength = strlen (delims); + d2 = (char *)xmalloc (slength + 1); + i = ts = 0; + while (delims[i]) + { +#if defined (HANDLE_MULTIBYTE) + mbstate_t state_bak; + state_bak = state; + mblength = MBRLEN (delims + i, slength, &state); + if (MB_INVALIDCH (mblength)) + state = state_bak; + else if (mblength > 1) + { + memcpy (d2 + ts, delims + i, mblength); + ts += mblength; + i += mblength; + slength -= mblength; + continue; + } +#endif + if (whitespace (delims[i]) == 0) + d2[ts++] = delims[i]; + + i++; + slength--; + } + d2[ts] = '\0'; + } + + ret = (WORD_LIST *)NULL; + + /* Remove sequences of whitespace characters at the start of the string, as + long as those characters are delimiters. */ + for (i = 0; member (string[i], d) && spctabnl (string[i]); i++) + ; + if (string[i] == '\0') + return (ret); + + ts = i; + nw = 0; + cw = -1; + dflags = flags|SD_NOJMP; + while (1) + { + te = skip_to_delim (string, ts, d, dflags); + + /* If we have a non-whitespace delimiter character, use it to make a + separate field. This is just about what $IFS splitting does and + is closer to the behavior of the shell parser. */ + if (ts == te && d2 && member (string[ts], d2)) + { + te = ts + 1; + /* If we're using IFS splitting, the non-whitespace delimiter char + and any additional IFS whitespace delimits a field. */ + if (ifs_split) + while (member (string[te], d) && spctabnl (string[te])) + te++; + else + while (member (string[te], d2)) + te++; + } + + token = substring (string, ts, te); + + ret = add_string_to_list (token, ret); + free (token); + nw++; + + if (sentinel >= ts && sentinel <= te) + cw = nw; + + /* If the cursor is at whitespace just before word start, set the + sentinel word to the current word. */ + if (cwp && cw == -1 && sentinel == ts-1) + cw = nw; + + /* If the cursor is at whitespace between two words, make a new, empty + word, add it before (well, after, since the list is in reverse order) + the word we just added, and set the current word to that one. */ + if (cwp && cw == -1 && sentinel < ts) + { + tl = make_word_list (make_word (""), ret->next); + ret->next = tl; + cw = nw; + nw++; + } + + if (string[te] == 0) + break; + + i = te; + while (member (string[i], d) && (ifs_split || spctabnl(string[i]))) + i++; + + if (string[i]) + ts = i; + else + break; + } + + /* Special case for SENTINEL at the end of STRING. If we haven't found + the word containing SENTINEL yet, and the index we're looking for is at + the end of STRING (or past the end of the previously-found token, + possible if the end of the line is composed solely of IFS whitespace) + add an additional null argument and set the current word pointer to that. */ + if (cwp && cw == -1 && (sentinel >= slen || sentinel >= te)) + { + if (whitespace (string[sentinel - 1])) + { + token = ""; + ret = add_string_to_list (token, ret); + nw++; + } + cw = nw; + } + + if (nwp) + *nwp = nw; + if (cwp) + *cwp = cw; + + FREE (d2); + + return (REVERSE_LIST (ret, WORD_LIST *)); +} +#endif /* READLINE */ + +#if 0 +/* UNUSED */ +/* Extract the name of the variable to bind to from the assignment string. */ +char * +assignment_name (string) + char *string; +{ + int offset; + char *temp; + + offset = assignment (string, 0); + if (offset == 0) + return (char *)NULL; + temp = substring (string, 0, offset); + return (temp); +} +#endif + +/* **************************************************************** */ +/* */ +/* Functions to convert strings to WORD_LISTs and vice versa */ +/* */ +/* **************************************************************** */ + +/* Return a single string of all the words in LIST. SEP is the separator + to put between individual elements of LIST in the output string. */ +char * +string_list_internal (list, sep) + WORD_LIST *list; + char *sep; +{ + register WORD_LIST *t; + char *result, *r; + int word_len, sep_len, result_size; + + if (list == 0) + return ((char *)NULL); + + /* Short-circuit quickly if we don't need to separate anything. */ + if (list->next == 0) + return (savestring (list->word->word)); + + /* This is nearly always called with either sep[0] == 0 or sep[1] == 0. */ + sep_len = STRLEN (sep); + result_size = 0; + + for (t = list; t; t = t->next) + { + if (t != list) + result_size += sep_len; + result_size += strlen (t->word->word); + } + + r = result = (char *)xmalloc (result_size + 1); + + for (t = list; t; t = t->next) + { + if (t != list && sep_len) + { + if (sep_len > 1) + { + FASTCOPY (sep, r, sep_len); + r += sep_len; + } + else + *r++ = sep[0]; + } + + word_len = strlen (t->word->word); + FASTCOPY (t->word->word, r, word_len); + r += word_len; + } + + *r = '\0'; + return (result); +} + +/* Return a single string of all the words present in LIST, separating + each word with a space. */ +char * +string_list (list) + WORD_LIST *list; +{ + return (string_list_internal (list, " ")); +} + +/* An external interface that can be used by the rest of the shell to + obtain a string containing the first character in $IFS. Handles all + the multibyte complications. If LENP is non-null, it is set to the + length of the returned string. */ +char * +ifs_firstchar (lenp) + int *lenp; +{ + char *ret; + int len; + + ret = xmalloc (MB_LEN_MAX + 1); +#if defined (HANDLE_MULTIBYTE) + if (ifs_firstc_len == 1) + { + ret[0] = ifs_firstc[0]; + ret[1] = '\0'; + len = ret[0] ? 1 : 0; + } + else + { + memcpy (ret, ifs_firstc, ifs_firstc_len); + ret[len = ifs_firstc_len] = '\0'; + } +#else + ret[0] = ifs_firstc; + ret[1] = '\0'; + len = ret[0] ? 0 : 1; +#endif + + if (lenp) + *lenp = len; + + return ret; +} + +/* Return a single string of all the words present in LIST, obeying the + quoting rules for "$*", to wit: (P1003.2, draft 11, 3.5.2) "If the + expansion [of $*] appears within a double quoted string, it expands + to a single field with the value of each parameter separated by the + first character of the IFS variable, or by a if IFS is unset." */ +char * +string_list_dollar_star (list) + WORD_LIST *list; +{ + char *ret; +#if defined (HANDLE_MULTIBYTE) +# if defined (__GNUC__) + char sep[MB_CUR_MAX + 1]; +# else + char *sep = 0; +# endif +#else + char sep[2]; +#endif + +#if defined (HANDLE_MULTIBYTE) +# if !defined (__GNUC__) + sep = (char *)xmalloc (MB_CUR_MAX + 1); +# endif /* !__GNUC__ */ + if (ifs_firstc_len == 1) + { + sep[0] = ifs_firstc[0]; + sep[1] = '\0'; + } + else + { + memcpy (sep, ifs_firstc, ifs_firstc_len); + sep[ifs_firstc_len] = '\0'; + } +#else + sep[0] = ifs_firstc; + sep[1] = '\0'; +#endif + + ret = string_list_internal (list, sep); +#if defined (HANDLE_MULTIBYTE) && !defined (__GNUC__) + free (sep); +#endif + return ret; +} + +/* Turn $@ into a string. If (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + is non-zero, the $@ appears within double quotes, and we should quote + the list before converting it into a string. If IFS is unset, and the + word is not quoted, we just need to quote CTLESC and CTLNUL characters + in the words in the list, because the default value of $IFS is + , IFS characters in the words in the list should + also be split. If IFS is null, and the word is not quoted, we need + to quote the words in the list to preserve the positional parameters + exactly. */ +char * +string_list_dollar_at (list, quoted) + WORD_LIST *list; + int quoted; +{ + char *ifs, *ret; +#if defined (HANDLE_MULTIBYTE) +# if defined (__GNUC__) + char sep[MB_CUR_MAX + 1]; +# else + char *sep = 0; +# endif /* !__GNUC__ */ +#else + char sep[2]; +#endif + WORD_LIST *tlist; + + /* XXX this could just be ifs = ifs_value; */ + ifs = ifs_var ? value_cell (ifs_var) : (char *)0; + +#if defined (HANDLE_MULTIBYTE) +# if !defined (__GNUC__) + sep = (char *)xmalloc (MB_CUR_MAX + 1); +# endif /* !__GNUC__ */ + if (ifs && *ifs) + { + if (ifs_firstc_len == 1) + { + sep[0] = ifs_firstc[0]; + sep[1] = '\0'; + } + else + { + memcpy (sep, ifs_firstc, ifs_firstc_len); + sep[ifs_firstc_len] = '\0'; + } + } + else + { + sep[0] = ' '; + sep[1] = '\0'; + } +#else + sep[0] = (ifs == 0 || *ifs == 0) ? ' ' : *ifs; + sep[1] = '\0'; +#endif + + /* XXX -- why call quote_list if ifs == 0? we can get away without doing + it now that quote_escapes quotes spaces */ + tlist = (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES|Q_PATQUOTE)) + ? quote_list (list) + : list_quote_escapes (list); + + ret = string_list_internal (tlist, sep); +#if defined (HANDLE_MULTIBYTE) && !defined (__GNUC__) + free (sep); +#endif + return ret; +} + +/* Turn the positional parameters into a string, understanding quoting and + the various subtleties of using the first character of $IFS as the + separator. Calls string_list_dollar_at, string_list_dollar_star, and + string_list as appropriate. */ +char * +string_list_pos_params (pchar, list, quoted) + int pchar; + WORD_LIST *list; + int quoted; +{ + char *ret; + WORD_LIST *tlist; + + if (pchar == '*' && (quoted & Q_DOUBLE_QUOTES)) + { + tlist = quote_list (list); + word_list_remove_quoted_nulls (tlist); + ret = string_list_dollar_star (tlist); + } + else if (pchar == '*' && (quoted & Q_HERE_DOCUMENT)) + { + tlist = quote_list (list); + word_list_remove_quoted_nulls (tlist); + ret = string_list (tlist); + } + else if (pchar == '*') + { + /* Even when unquoted, string_list_dollar_star does the right thing + making sure that the first character of $IFS is used as the + separator. */ + ret = string_list_dollar_star (list); + } + else if (pchar == '@' && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + /* We use string_list_dollar_at, but only if the string is quoted, since + that quotes the escapes if it's not, which we don't want. We could + use string_list (the old code did), but that doesn't do the right + thing if the first character of $IFS is not a space. We use + string_list_dollar_star if the string is unquoted so we make sure that + the elements of $@ are separated by the first character of $IFS for + later splitting. */ + ret = string_list_dollar_at (list, quoted); + else if (pchar == '@') + ret = string_list_dollar_star (list); + else + ret = string_list ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) ? quote_list (list) : list); + + return ret; +} + +/* Return the list of words present in STRING. Separate the string into + words at any of the characters found in SEPARATORS. If QUOTED is + non-zero then word in the list will have its quoted flag set, otherwise + the quoted flag is left as make_word () deemed fit. + + This obeys the P1003.2 word splitting semantics. If `separators' is + exactly , then the splitting algorithm is that of + the Bourne shell, which treats any sequence of characters from `separators' + as a delimiter. If IFS is unset, which results in `separators' being set + to "", no splitting occurs. If separators has some other value, the + following rules are applied (`IFS white space' means zero or more + occurrences of , , or , as long as those characters + are in `separators'): + + 1) IFS white space is ignored at the start and the end of the + string. + 2) Each occurrence of a character in `separators' that is not + IFS white space, along with any adjacent occurrences of + IFS white space delimits a field. + 3) Any nonzero-length sequence of IFS white space delimits a field. + */ + +/* BEWARE! list_string strips null arguments. Don't call it twice and + expect to have "" preserved! */ + +/* This performs word splitting and quoted null character removal on + STRING. */ +#define issep(c) \ + (((separators)[0]) ? ((separators)[1] ? isifs(c) \ + : (c) == (separators)[0]) \ + : 0) + +WORD_LIST * +list_string (string, separators, quoted) + register char *string, *separators; + int quoted; +{ + WORD_LIST *result; + WORD_DESC *t; + char *current_word, *s; + int sindex, sh_style_split, whitesep, xflags; + size_t slen; + + if (!string || !*string) + return ((WORD_LIST *)NULL); + + sh_style_split = separators && separators[0] == ' ' && + separators[1] == '\t' && + separators[2] == '\n' && + separators[3] == '\0'; + for (xflags = 0, s = ifs_value; s && *s; s++) + { + if (*s == CTLESC) xflags |= SX_NOCTLESC; + else if (*s == CTLNUL) xflags |= SX_NOESCCTLNUL; + } + + slen = 0; + /* Remove sequences of whitespace at the beginning of STRING, as + long as those characters appear in IFS. Do not do this if + STRING is quoted or if there are no separator characters. */ + if (!quoted || !separators || !*separators) + { + for (s = string; *s && spctabnl (*s) && issep (*s); s++); + + if (!*s) + return ((WORD_LIST *)NULL); + + string = s; + } + + /* OK, now STRING points to a word that does not begin with white space. + The splitting algorithm is: + extract a word, stopping at a separator + skip sequences of spc, tab, or nl as long as they are separators + This obeys the field splitting rules in Posix.2. */ + slen = (MB_CUR_MAX > 1) ? strlen (string) : 1; + for (result = (WORD_LIST *)NULL, sindex = 0; string[sindex]; ) + { + /* Don't need string length in ADVANCE_CHAR or string_extract_verbatim + unless multibyte chars are possible. */ + current_word = string_extract_verbatim (string, slen, &sindex, separators, xflags); + if (current_word == 0) + break; + + /* If we have a quoted empty string, add a quoted null argument. We + want to preserve the quoted null character iff this is a quoted + empty string; otherwise the quoted null characters are removed + below. */ + if (QUOTED_NULL (current_word)) + { + t = alloc_word_desc (); + t->word = make_quoted_char ('\0'); + t->flags |= W_QUOTED|W_HASQUOTEDNULL; + result = make_word_list (t, result); + } + else if (current_word[0] != '\0') + { + /* If we have something, then add it regardless. However, + perform quoted null character removal on the current word. */ + remove_quoted_nulls (current_word); + result = add_string_to_list (current_word, result); + result->word->flags &= ~W_HASQUOTEDNULL; /* just to be sure */ + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + result->word->flags |= W_QUOTED; + } + + /* If we're not doing sequences of separators in the traditional + Bourne shell style, then add a quoted null argument. */ + else if (!sh_style_split && !spctabnl (string[sindex])) + { + t = alloc_word_desc (); + t->word = make_quoted_char ('\0'); + t->flags |= W_QUOTED|W_HASQUOTEDNULL; + result = make_word_list (t, result); + } + + free (current_word); + + /* Note whether or not the separator is IFS whitespace, used later. */ + whitesep = string[sindex] && spctabnl (string[sindex]); + + /* Move past the current separator character. */ + if (string[sindex]) + { + DECLARE_MBSTATE; + ADVANCE_CHAR (string, slen, sindex); + } + + /* Now skip sequences of space, tab, or newline characters if they are + in the list of separators. */ + while (string[sindex] && spctabnl (string[sindex]) && issep (string[sindex])) + sindex++; + + /* If the first separator was IFS whitespace and the current character + is a non-whitespace IFS character, it should be part of the current + field delimiter, not a separate delimiter that would result in an + empty field. Look at POSIX.2, 3.6.5, (3)(b). */ + if (string[sindex] && whitesep && issep (string[sindex]) && !spctabnl (string[sindex])) + { + sindex++; + /* An IFS character that is not IFS white space, along with any + adjacent IFS white space, shall delimit a field. (SUSv3) */ + while (string[sindex] && spctabnl (string[sindex]) && isifs (string[sindex])) + sindex++; + } + } + return (REVERSE_LIST (result, WORD_LIST *)); +} + +/* Parse a single word from STRING, using SEPARATORS to separate fields. + ENDPTR is set to the first character after the word. This is used by + the `read' builtin. This is never called with SEPARATORS != $IFS; + it should be simplified. + + XXX - this function is very similar to list_string; they should be + combined - XXX */ +char * +get_word_from_string (stringp, separators, endptr) + char **stringp, *separators, **endptr; +{ + register char *s; + char *current_word; + int sindex, sh_style_split, whitesep, xflags; + size_t slen; + + if (!stringp || !*stringp || !**stringp) + return ((char *)NULL); + + sh_style_split = separators && separators[0] == ' ' && + separators[1] == '\t' && + separators[2] == '\n' && + separators[3] == '\0'; + for (xflags = 0, s = ifs_value; s && *s; s++) + { + if (*s == CTLESC) xflags |= SX_NOCTLESC; + if (*s == CTLNUL) xflags |= SX_NOESCCTLNUL; + } + + s = *stringp; + slen = 0; + + /* Remove sequences of whitespace at the beginning of STRING, as + long as those characters appear in IFS. */ + if (sh_style_split || !separators || !*separators) + { + for (; *s && spctabnl (*s) && isifs (*s); s++); + + /* If the string is nothing but whitespace, update it and return. */ + if (!*s) + { + *stringp = s; + if (endptr) + *endptr = s; + return ((char *)NULL); + } + } + + /* OK, S points to a word that does not begin with white space. + Now extract a word, stopping at a separator, save a pointer to + the first character after the word, then skip sequences of spc, + tab, or nl as long as they are separators. + + This obeys the field splitting rules in Posix.2. */ + sindex = 0; + /* Don't need string length in ADVANCE_CHAR or string_extract_verbatim + unless multibyte chars are possible. */ + slen = (MB_CUR_MAX > 1) ? strlen (s) : 1; + current_word = string_extract_verbatim (s, slen, &sindex, separators, xflags); + + /* Set ENDPTR to the first character after the end of the word. */ + if (endptr) + *endptr = s + sindex; + + /* Note whether or not the separator is IFS whitespace, used later. */ + whitesep = s[sindex] && spctabnl (s[sindex]); + + /* Move past the current separator character. */ + if (s[sindex]) + { + DECLARE_MBSTATE; + ADVANCE_CHAR (s, slen, sindex); + } + + /* Now skip sequences of space, tab, or newline characters if they are + in the list of separators. */ + while (s[sindex] && spctabnl (s[sindex]) && isifs (s[sindex])) + sindex++; + + /* If the first separator was IFS whitespace and the current character is + a non-whitespace IFS character, it should be part of the current field + delimiter, not a separate delimiter that would result in an empty field. + Look at POSIX.2, 3.6.5, (3)(b). */ + if (s[sindex] && whitesep && isifs (s[sindex]) && !spctabnl (s[sindex])) + { + sindex++; + /* An IFS character that is not IFS white space, along with any adjacent + IFS white space, shall delimit a field. */ + while (s[sindex] && spctabnl (s[sindex]) && isifs (s[sindex])) + sindex++; + } + + /* Update STRING to point to the next field. */ + *stringp = s + sindex; + return (current_word); +} + +/* Remove IFS white space at the end of STRING. Start at the end + of the string and walk backwards until the beginning of the string + or we find a character that's not IFS white space and not CTLESC. + Only let CTLESC escape a white space character if SAW_ESCAPE is + non-zero. */ +char * +strip_trailing_ifs_whitespace (string, separators, saw_escape) + char *string, *separators; + int saw_escape; +{ + char *s; + + s = string + STRLEN (string) - 1; + while (s > string && ((spctabnl (*s) && isifs (*s)) || + (saw_escape && *s == CTLESC && spctabnl (s[1])))) + s--; + *++s = '\0'; + return string; +} + +#if 0 +/* UNUSED */ +/* Split STRING into words at whitespace. Obeys shell-style quoting with + backslashes, single and double quotes. */ +WORD_LIST * +list_string_with_quotes (string) + char *string; +{ + WORD_LIST *list; + char *token, *s; + size_t s_len; + int c, i, tokstart, len; + + for (s = string; s && *s && spctabnl (*s); s++) + ; + if (s == 0 || *s == 0) + return ((WORD_LIST *)NULL); + + s_len = strlen (s); + tokstart = i = 0; + list = (WORD_LIST *)NULL; + while (1) + { + c = s[i]; + if (c == '\\') + { + i++; + if (s[i]) + i++; + } + else if (c == '\'') + i = skip_single_quoted (s, s_len, ++i); + else if (c == '"') + i = skip_double_quoted (s, s_len, ++i); + else if (c == 0 || spctabnl (c)) + { + /* We have found the end of a token. Make a word out of it and + add it to the word list. */ + token = substring (s, tokstart, i); + list = add_string_to_list (token, list); + free (token); + while (spctabnl (s[i])) + i++; + if (s[i]) + tokstart = i; + else + break; + } + else + i++; /* normal character */ + } + return (REVERSE_LIST (list, WORD_LIST *)); +} +#endif + +/********************************************************/ +/* */ +/* Functions to perform assignment statements */ +/* */ +/********************************************************/ + +#if defined (ARRAY_VARS) +static SHELL_VAR * +do_compound_assignment (name, value, flags) + char *name, *value; + int flags; +{ + SHELL_VAR *v; + int mklocal, mkassoc, mkglobal; + WORD_LIST *list; + + mklocal = flags & ASS_MKLOCAL; + mkassoc = flags & ASS_MKASSOC; + mkglobal = flags & ASS_MKGLOBAL; + + if (mklocal && variable_context) + { + v = find_variable (name); + list = expand_compound_array_assignment (v, value, flags); + if (mkassoc) + v = make_local_assoc_variable (name); + else if (v == 0 || (array_p (v) == 0 && assoc_p (v) == 0) || v->context != variable_context) + v = make_local_array_variable (name, 0); + if (v) + assign_compound_array_list (v, list, flags); + } + /* In a function but forcing assignment in global context */ + else if (mkglobal && variable_context) + { + v = find_global_variable (name); + list = expand_compound_array_assignment (v, value, flags); + if (v == 0 && mkassoc) + v = make_new_assoc_variable (name); + else if (v && mkassoc && assoc_p (v) == 0) + v = convert_var_to_assoc (v); + else if (v == 0) + v = make_new_array_variable (name); + else if (v && mkassoc == 0 && array_p (v) == 0) + v = convert_var_to_array (v); + if (v) + assign_compound_array_list (v, list, flags); + } + else + v = assign_array_from_string (name, value, flags); + + return (v); +} +#endif + +/* Given STRING, an assignment string, get the value of the right side + of the `=', and bind it to the left side. If EXPAND is true, then + perform parameter expansion, command substitution, and arithmetic + expansion on the right-hand side. Perform tilde expansion in any + case. Do not perform word splitting on the result of expansion. */ +static int +do_assignment_internal (word, expand) + const WORD_DESC *word; + int expand; +{ + int offset, appendop, assign_list, aflags, retval; + char *name, *value, *temp; + SHELL_VAR *entry; +#if defined (ARRAY_VARS) + char *t; + int ni; +#endif + const char *string; + + if (word == 0 || word->word == 0) + return 0; + + appendop = assign_list = aflags = 0; + string = word->word; + offset = assignment (string, 0); + name = savestring (string); + value = (char *)NULL; + + if (name[offset] == '=') + { + if (name[offset - 1] == '+') + { + appendop = 1; + name[offset - 1] = '\0'; + } + + name[offset] = 0; /* might need this set later */ + temp = name + offset + 1; + +#if defined (ARRAY_VARS) + if (expand && (word->flags & W_COMPASSIGN)) + { + assign_list = ni = 1; + value = extract_array_assignment_list (temp, &ni); + } + else +#endif + if (expand && temp[0]) + value = expand_string_if_necessary (temp, 0, expand_string_assignment); + else + value = savestring (temp); + } + + if (value == 0) + { + value = (char *)xmalloc (1); + value[0] = '\0'; + } + + if (echo_command_at_execute) + { + if (appendop) + name[offset - 1] = '+'; + xtrace_print_assignment (name, value, assign_list, 1); + if (appendop) + name[offset - 1] = '\0'; + } + +#define ASSIGN_RETURN(r) do { FREE (value); free (name); return (r); } while (0) + + if (appendop) + aflags |= ASS_APPEND; + +#if defined (ARRAY_VARS) + if (t = mbschr (name, '[')) /*]*/ + { + if (assign_list) + { + report_error (_("%s: cannot assign list to array member"), name); + ASSIGN_RETURN (0); + } + entry = assign_array_element (name, value, aflags); + if (entry == 0) + ASSIGN_RETURN (0); + } + else if (assign_list) + { + if ((word->flags & W_ASSIGNARG) && (word->flags & W_ASSNGLOBAL) == 0) + aflags |= ASS_MKLOCAL; + if ((word->flags & W_ASSIGNARG) && (word->flags & W_ASSNGLOBAL)) + aflags |= ASS_MKGLOBAL; + if (word->flags & W_ASSIGNASSOC) + aflags |= ASS_MKASSOC; + entry = do_compound_assignment (name, value, aflags); + } + else +#endif /* ARRAY_VARS */ + entry = bind_variable (name, value, aflags); + + stupidly_hack_special_variables (name); + + /* Return 1 if the assignment seems to have been performed correctly. */ + if (entry == 0 || readonly_p (entry)) + retval = 0; /* assignment failure */ + else if (noassign_p (entry)) + { + last_command_exit_value = EXECUTION_FAILURE; + retval = 1; /* error status, but not assignment failure */ + } + else + retval = 1; + + if (entry && retval != 0 && noassign_p (entry) == 0) + VUNSETATTR (entry, att_invisible); + + ASSIGN_RETURN (retval); +} + +/* Perform the assignment statement in STRING, and expand the + right side by doing tilde, command and parameter expansion. */ +int +do_assignment (string) + char *string; +{ + WORD_DESC td; + + td.flags = W_ASSIGNMENT; + td.word = string; + + return do_assignment_internal (&td, 1); +} + +int +do_word_assignment (word, flags) + WORD_DESC *word; + int flags; +{ + return do_assignment_internal (word, 1); +} + +/* Given STRING, an assignment string, get the value of the right side + of the `=', and bind it to the left side. Do not perform any word + expansions on the right hand side. */ +int +do_assignment_no_expand (string) + char *string; +{ + WORD_DESC td; + + td.flags = W_ASSIGNMENT; + td.word = string; + + return (do_assignment_internal (&td, 0)); +} + +/*************************************************** + * * + * Functions to manage the positional parameters * + * * + ***************************************************/ + +/* Return the word list that corresponds to `$*'. */ +WORD_LIST * +list_rest_of_args () +{ + register WORD_LIST *list, *args; + int i; + + /* Break out of the loop as soon as one of the dollar variables is null. */ + for (i = 1, list = (WORD_LIST *)NULL; i < 10 && dollar_vars[i]; i++) + list = make_word_list (make_bare_word (dollar_vars[i]), list); + + for (args = rest_of_args; args; args = args->next) + list = make_word_list (make_bare_word (args->word->word), list); + + return (REVERSE_LIST (list, WORD_LIST *)); +} + +int +number_of_args () +{ + register WORD_LIST *list; + int n; + + for (n = 0; n < 9 && dollar_vars[n+1]; n++) + ; + for (list = rest_of_args; list; list = list->next) + n++; + return n; +} + +/* Return the value of a positional parameter. This handles values > 10. */ +char * +get_dollar_var_value (ind) + intmax_t ind; +{ + char *temp; + WORD_LIST *p; + + if (ind < 10) + temp = dollar_vars[ind] ? savestring (dollar_vars[ind]) : (char *)NULL; + else /* We want something like ${11} */ + { + ind -= 10; + for (p = rest_of_args; p && ind--; p = p->next) + ; + temp = p ? savestring (p->word->word) : (char *)NULL; + } + return (temp); +} + +/* Make a single large string out of the dollar digit variables, + and the rest_of_args. If DOLLAR_STAR is 1, then obey the special + case of "$*" with respect to IFS. */ +char * +string_rest_of_args (dollar_star) + int dollar_star; +{ + register WORD_LIST *list; + char *string; + + list = list_rest_of_args (); + string = dollar_star ? string_list_dollar_star (list) : string_list (list); + dispose_words (list); + return (string); +} + +/* Return a string containing the positional parameters from START to + END, inclusive. If STRING[0] == '*', we obey the rules for $*, + which only makes a difference if QUOTED is non-zero. If QUOTED includes + Q_HERE_DOCUMENT or Q_DOUBLE_QUOTES, this returns a quoted list, otherwise + no quoting chars are added. */ +static char * +pos_params (string, start, end, quoted) + char *string; + int start, end, quoted; +{ + WORD_LIST *save, *params, *h, *t; + char *ret; + int i; + + /* see if we can short-circuit. if start == end, we want 0 parameters. */ + if (start == end) + return ((char *)NULL); + + save = params = list_rest_of_args (); + if (save == 0) + return ((char *)NULL); + + if (start == 0) /* handle ${@:0[:x]} specially */ + { + t = make_word_list (make_word (dollar_vars[0]), params); + save = params = t; + } + + for (i = start ? 1 : 0; params && i < start; i++) + params = params->next; + if (params == 0) + return ((char *)NULL); + for (h = t = params; params && i < end; i++) + { + t = params; + params = params->next; + } + + t->next = (WORD_LIST *)NULL; + + ret = string_list_pos_params (string[0], h, quoted); + + if (t != params) + t->next = params; + + dispose_words (save); + return (ret); +} + +/******************************************************************/ +/* */ +/* Functions to expand strings to strings or WORD_LISTs */ +/* */ +/******************************************************************/ + +#if defined (PROCESS_SUBSTITUTION) +#define EXP_CHAR(s) (s == '$' || s == '`' || s == '<' || s == '>' || s == CTLESC || s == '~') +#else +#define EXP_CHAR(s) (s == '$' || s == '`' || s == CTLESC || s == '~') +#endif + +/* If there are any characters in STRING that require full expansion, + then call FUNC to expand STRING; otherwise just perform quote + removal if necessary. This returns a new string. */ +static char * +expand_string_if_necessary (string, quoted, func) + char *string; + int quoted; + EXPFUNC *func; +{ + WORD_LIST *list; + size_t slen; + int i, saw_quote; + char *ret; + DECLARE_MBSTATE; + + /* Don't need string length for ADVANCE_CHAR unless multibyte chars possible. */ + slen = (MB_CUR_MAX > 1) ? strlen (string) : 0; + i = saw_quote = 0; + while (string[i]) + { + if (EXP_CHAR (string[i])) + break; + else if (string[i] == '\'' || string[i] == '\\' || string[i] == '"') + saw_quote = 1; + ADVANCE_CHAR (string, slen, i); + } + + if (string[i]) + { + list = (*func) (string, quoted); + if (list) + { + ret = string_list (list); + dispose_words (list); + } + else + ret = (char *)NULL; + } + else if (saw_quote && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + ret = string_quote_removal (string, quoted); + else + ret = savestring (string); + + return ret; +} + +static inline char * +expand_string_to_string_internal (string, quoted, func) + char *string; + int quoted; + EXPFUNC *func; +{ + WORD_LIST *list; + char *ret; + + if (string == 0 || *string == '\0') + return ((char *)NULL); + + list = (*func) (string, quoted); + if (list) + { + ret = string_list (list); + dispose_words (list); + } + else + ret = (char *)NULL; + + return (ret); +} + +char * +expand_string_to_string (string, quoted) + char *string; + int quoted; +{ + return (expand_string_to_string_internal (string, quoted, expand_string)); +} + +char * +expand_string_unsplit_to_string (string, quoted) + char *string; + int quoted; +{ + return (expand_string_to_string_internal (string, quoted, expand_string_unsplit)); +} + +char * +expand_assignment_string_to_string (string, quoted) + char *string; + int quoted; +{ + return (expand_string_to_string_internal (string, quoted, expand_string_assignment)); +} + +char * +expand_arith_string (string, quoted) + char *string; + int quoted; +{ + WORD_DESC td; + WORD_LIST *list, *tlist; + size_t slen; + int i, saw_quote; + char *ret; + DECLARE_MBSTATE; + + /* Don't need string length for ADVANCE_CHAR unless multibyte chars possible. */ + slen = (MB_CUR_MAX > 1) ? strlen (string) : 0; + i = saw_quote = 0; + while (string[i]) + { + if (EXP_CHAR (string[i])) + break; + else if (string[i] == '\'' || string[i] == '\\' || string[i] == '"') + saw_quote = 1; + ADVANCE_CHAR (string, slen, i); + } + + if (string[i]) + { + /* This is expanded version of expand_string_internal as it's called by + expand_string_leave_quoted */ + td.flags = W_NOPROCSUB; /* don't want process substitution */ + td.word = savestring (string); + list = call_expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + /* This takes care of the calls from expand_string_leave_quoted and + expand_string */ + if (list) + { + tlist = word_list_split (list); + dispose_words (list); + list = tlist; + if (list) + dequote_list (list); + } + /* This comes from expand_string_if_necessary */ + if (list) + { + ret = string_list (list); + dispose_words (list); + } + else + ret = (char *)NULL; + FREE (td.word); + } + else if (saw_quote && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + ret = string_quote_removal (string, quoted); + else + ret = savestring (string); + + return ret; +} + +#if defined (COND_COMMAND) +/* Just remove backslashes in STRING. Returns a new string. */ +char * +remove_backslashes (string) + char *string; +{ + char *r, *ret, *s; + + r = ret = (char *)xmalloc (strlen (string) + 1); + for (s = string; s && *s; ) + { + if (*s == '\\') + s++; + if (*s == 0) + break; + *r++ = *s++; + } + *r = '\0'; + return ret; +} + +/* This needs better error handling. */ +/* Expand W for use as an argument to a unary or binary operator in a + [[...]] expression. If SPECIAL is 1, this is the rhs argument + to the != or == operator, and should be treated as a pattern. In + this case, we quote the string specially for the globbing code. If + SPECIAL is 2, this is an rhs argument for the =~ operator, and should + be quoted appropriately for regcomp/regexec. The caller is responsible + for removing the backslashes if the unquoted word is needed later. */ +char * +cond_expand_word (w, special) + WORD_DESC *w; + int special; +{ + char *r, *p; + WORD_LIST *l; + int qflags; + + if (w->word == 0 || w->word[0] == '\0') + return ((char *)NULL); + + expand_no_split_dollar_star = 1; + w->flags |= W_NOSPLIT2; + l = call_expand_word_internal (w, 0, 0, (int *)0, (int *)0); + expand_no_split_dollar_star = 0; + if (l) + { + if (special == 0) /* LHS */ + { + dequote_list (l); + r = string_list (l); + } + else + { + /* Need to figure out whether or not we should call dequote_escapes + or a new dequote_ctlnul function here, and under what + circumstances. */ + qflags = QGLOB_CVTNULL; + if (special == 2) + qflags |= QGLOB_REGEXP; + p = string_list (l); + r = quote_string_for_globbing (p, qflags); + free (p); + } + dispose_words (l); + } + else + r = (char *)NULL; + + return r; +} +#endif + +/* Call expand_word_internal to expand W and handle error returns. + A convenience function for functions that don't want to handle + any errors or free any memory before aborting. */ +static WORD_LIST * +call_expand_word_internal (w, q, i, c, e) + WORD_DESC *w; + int q, i, *c, *e; +{ + WORD_LIST *result; + + result = expand_word_internal (w, q, i, c, e); + if (result == &expand_word_error || result == &expand_word_fatal) + { + /* By convention, each time this error is returned, w->word has + already been freed (it sometimes may not be in the fatal case, + but that doesn't result in a memory leak because we're going + to exit in most cases). */ + w->word = (char *)NULL; + last_command_exit_value = EXECUTION_FAILURE; + exp_jump_to_top_level ((result == &expand_word_error) ? DISCARD : FORCE_EOF); + /* NOTREACHED */ + return (NULL); + } + else + return (result); +} + +/* Perform parameter expansion, command substitution, and arithmetic + expansion on STRING, as if it were a word. Leave the result quoted. + Since this does not perform word splitting, it leaves quoted nulls + in the result. */ +static WORD_LIST * +expand_string_internal (string, quoted) + char *string; + int quoted; +{ + WORD_DESC td; + WORD_LIST *tresult; + + if (string == 0 || *string == 0) + return ((WORD_LIST *)NULL); + + td.flags = 0; + td.word = savestring (string); + + tresult = call_expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + + FREE (td.word); + return (tresult); +} + +/* Expand STRING by performing parameter expansion, command substitution, + and arithmetic expansion. Dequote the resulting WORD_LIST before + returning it, but do not perform word splitting. The call to + remove_quoted_nulls () is in here because word splitting normally + takes care of quote removal. */ +WORD_LIST * +expand_string_unsplit (string, quoted) + char *string; + int quoted; +{ + WORD_LIST *value; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + expand_no_split_dollar_star = 1; + value = expand_string_internal (string, quoted); + expand_no_split_dollar_star = 0; + + if (value) + { + if (value->word) + { + remove_quoted_nulls (value->word->word); + value->word->flags &= ~W_HASQUOTEDNULL; + } + dequote_list (value); + } + return (value); +} + +/* Expand the rhs of an assignment statement */ +WORD_LIST * +expand_string_assignment (string, quoted) + char *string; + int quoted; +{ + WORD_DESC td; + WORD_LIST *value; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + expand_no_split_dollar_star = 1; + + td.flags = W_ASSIGNRHS; + td.word = savestring (string); + value = call_expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + FREE (td.word); + + expand_no_split_dollar_star = 0; + + if (value) + { + if (value->word) + { + remove_quoted_nulls (value->word->word); + value->word->flags &= ~W_HASQUOTEDNULL; + } + dequote_list (value); + } + return (value); +} + + +/* Expand one of the PS? prompt strings. This is a sort of combination of + expand_string_unsplit and expand_string_internal, but returns the + passed string when an error occurs. Might want to trap other calls + to jump_to_top_level here so we don't endlessly loop. */ +WORD_LIST * +expand_prompt_string (string, quoted, wflags) + char *string; + int quoted; + int wflags; +{ + WORD_LIST *value; + WORD_DESC td; + + if (string == 0 || *string == 0) + return ((WORD_LIST *)NULL); + + td.flags = wflags; + td.word = savestring (string); + + no_longjmp_on_fatal_error = 1; + value = expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + no_longjmp_on_fatal_error = 0; + + if (value == &expand_word_error || value == &expand_word_fatal) + { + value = make_word_list (make_bare_word (string), (WORD_LIST *)NULL); + return value; + } + FREE (td.word); + if (value) + { + if (value->word) + { + remove_quoted_nulls (value->word->word); + value->word->flags &= ~W_HASQUOTEDNULL; + } + dequote_list (value); + } + return (value); +} + +/* Expand STRING just as if you were expanding a word, but do not dequote + the resultant WORD_LIST. This is called only from within this file, + and is used to correctly preserve quoted characters when expanding + things like ${1+"$@"}. This does parameter expansion, command + substitution, arithmetic expansion, and word splitting. */ +static WORD_LIST * +expand_string_leave_quoted (string, quoted) + char *string; + int quoted; +{ + WORD_LIST *tlist; + WORD_LIST *tresult; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + tlist = expand_string_internal (string, quoted); + + if (tlist) + { + tresult = word_list_split (tlist); + dispose_words (tlist); + return (tresult); + } + return ((WORD_LIST *)NULL); +} + +/* This does not perform word splitting or dequote the WORD_LIST + it returns. */ +static WORD_LIST * +expand_string_for_rhs (string, quoted, dollar_at_p, has_dollar_at) + char *string; + int quoted, *dollar_at_p, *has_dollar_at; +{ + WORD_DESC td; + WORD_LIST *tresult; + + if (string == 0 || *string == '\0') + return (WORD_LIST *)NULL; + + td.flags = W_NOSPLIT2; /* no splitting, remove "" and '' */ + td.word = string; + tresult = call_expand_word_internal (&td, quoted, 1, dollar_at_p, has_dollar_at); + return (tresult); +} + +/* Expand STRING just as if you were expanding a word. This also returns + a list of words. Note that filename globbing is *NOT* done for word + or string expansion, just when the shell is expanding a command. This + does parameter expansion, command substitution, arithmetic expansion, + and word splitting. Dequote the resultant WORD_LIST before returning. */ +WORD_LIST * +expand_string (string, quoted) + char *string; + int quoted; +{ + WORD_LIST *result; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + result = expand_string_leave_quoted (string, quoted); + return (result ? dequote_list (result) : result); +} + +/*************************************************** + * * + * Functions to handle quoting chars * + * * + ***************************************************/ + +/* Conventions: + + A string with s[0] == CTLNUL && s[1] == 0 is a quoted null string. + The parser passes CTLNUL as CTLESC CTLNUL. */ + +/* Quote escape characters in string s, but no other characters. This is + used to protect CTLESC and CTLNUL in variable values from the rest of + the word expansion process after the variable is expanded (word splitting + and filename generation). If IFS is null, we quote spaces as well, just + in case we split on spaces later (in the case of unquoted $@, we will + eventually attempt to split the entire word on spaces). Corresponding + code exists in dequote_escapes. Even if we don't end up splitting on + spaces, quoting spaces is not a problem. This should never be called on + a string that is quoted with single or double quotes or part of a here + document (effectively double-quoted). */ +char * +quote_escapes (string) + char *string; +{ + register char *s, *t; + size_t slen; + char *result, *send; + int quote_spaces, skip_ctlesc, skip_ctlnul; + DECLARE_MBSTATE; + + slen = strlen (string); + send = string + slen; + + quote_spaces = (ifs_value && *ifs_value == 0); + + for (skip_ctlesc = skip_ctlnul = 0, s = ifs_value; s && *s; s++) + skip_ctlesc |= *s == CTLESC, skip_ctlnul |= *s == CTLNUL; + + t = result = (char *)xmalloc ((slen * 2) + 1); + s = string; + + while (*s) + { + if ((skip_ctlesc == 0 && *s == CTLESC) || (skip_ctlnul == 0 && *s == CTLNUL) || (quote_spaces && *s == ' ')) + *t++ = CTLESC; + COPY_CHAR_P (t, s, send); + } + *t = '\0'; + + return (result); +} + +static WORD_LIST * +list_quote_escapes (list) + WORD_LIST *list; +{ + register WORD_LIST *w; + char *t; + + for (w = list; w; w = w->next) + { + t = w->word->word; + w->word->word = quote_escapes (t); + free (t); + } + return list; +} + +/* Inverse of quote_escapes; remove CTLESC protecting CTLESC or CTLNUL. + + The parser passes us CTLESC as CTLESC CTLESC and CTLNUL as CTLESC CTLNUL. + This is necessary to make unquoted CTLESC and CTLNUL characters in the + data stream pass through properly. + + We need to remove doubled CTLESC characters inside quoted strings before + quoting the entire string, so we do not double the number of CTLESC + characters. + + Also used by parts of the pattern substitution code. */ +char * +dequote_escapes (string) + char *string; +{ + register char *s, *t, *s1; + size_t slen; + char *result, *send; + int quote_spaces; + DECLARE_MBSTATE; + + if (string == 0) + return string; + + slen = strlen (string); + send = string + slen; + + t = result = (char *)xmalloc (slen + 1); + + if (strchr (string, CTLESC) == 0) + return (strcpy (result, string)); + + quote_spaces = (ifs_value && *ifs_value == 0); + + s = string; + while (*s) + { + if (*s == CTLESC && (s[1] == CTLESC || s[1] == CTLNUL || (quote_spaces && s[1] == ' '))) + { + s++; + if (*s == '\0') + break; + } + COPY_CHAR_P (t, s, send); + } + *t = '\0'; + + return result; +} + +static WORD_LIST * +list_dequote_escapes (list) + WORD_LIST *list; +{ + register WORD_LIST *w; + char *t; + + for (w = list; w; w = w->next) + { + t = w->word->word; + w->word->word = dequote_escapes (t); + free (t); + } + return list; +} + +/* Return a new string with the quoted representation of character C. + This turns "" into QUOTED_NULL, so the W_HASQUOTEDNULL flag needs to be + set in any resultant WORD_DESC where this value is the word. */ +static char * +make_quoted_char (c) + int c; +{ + char *temp; + + temp = (char *)xmalloc (3); + if (c == 0) + { + temp[0] = CTLNUL; + temp[1] = '\0'; + } + else + { + temp[0] = CTLESC; + temp[1] = c; + temp[2] = '\0'; + } + return (temp); +} + +/* Quote STRING, returning a new string. This turns "" into QUOTED_NULL, so + the W_HASQUOTEDNULL flag needs to be set in any resultant WORD_DESC where + this value is the word. */ +char * +quote_string (string) + char *string; +{ + register char *t; + size_t slen; + char *result, *send; + + if (*string == 0) + { + result = (char *)xmalloc (2); + result[0] = CTLNUL; + result[1] = '\0'; + } + else + { + DECLARE_MBSTATE; + + slen = strlen (string); + send = string + slen; + + result = (char *)xmalloc ((slen * 2) + 1); + + for (t = result; string < send; ) + { + *t++ = CTLESC; + COPY_CHAR_P (t, string, send); + } + *t = '\0'; + } + return (result); +} + +/* De-quote quoted characters in STRING. */ +char * +dequote_string (string) + char *string; +{ + register char *s, *t; + size_t slen; + char *result, *send; + DECLARE_MBSTATE; + + slen = strlen (string); + + t = result = (char *)xmalloc (slen + 1); + + if (QUOTED_NULL (string)) + { + result[0] = '\0'; + return (result); + } + + /* If no character in the string can be quoted, don't bother examining + each character. Just return a copy of the string passed to us. */ + if (strchr (string, CTLESC) == NULL) + return (strcpy (result, string)); + + send = string + slen; + s = string; + while (*s) + { + if (*s == CTLESC) + { + s++; + if (*s == '\0') + break; + } + COPY_CHAR_P (t, s, send); + } + + *t = '\0'; + return (result); +} + +/* Quote the entire WORD_LIST list. */ +static WORD_LIST * +quote_list (list) + WORD_LIST *list; +{ + register WORD_LIST *w; + char *t; + + for (w = list; w; w = w->next) + { + t = w->word->word; + w->word->word = quote_string (t); + if (*t == 0) + w->word->flags |= W_HASQUOTEDNULL; /* XXX - turn on W_HASQUOTEDNULL here? */ + w->word->flags |= W_QUOTED; + free (t); + } + return list; +} + +/* De-quote quoted characters in each word in LIST. */ +WORD_LIST * +dequote_list (list) + WORD_LIST *list; +{ + register char *s; + register WORD_LIST *tlist; + + for (tlist = list; tlist; tlist = tlist->next) + { + s = dequote_string (tlist->word->word); + if (QUOTED_NULL (tlist->word->word)) + tlist->word->flags &= ~W_HASQUOTEDNULL; + free (tlist->word->word); + tlist->word->word = s; + } + return list; +} + +/* Remove CTLESC protecting a CTLESC or CTLNUL in place. Return the passed + string. */ +char * +remove_quoted_escapes (string) + char *string; +{ + char *t; + + if (string) + { + t = dequote_escapes (string); + strcpy (string, t); + free (t); + } + + return (string); +} + +/* Perform quoted null character removal on STRING. We don't allow any + quoted null characters in the middle or at the ends of strings because + of how expand_word_internal works. remove_quoted_nulls () turns + STRING into an empty string iff it only consists of a quoted null, + and removes all unquoted CTLNUL characters. */ +char * +remove_quoted_nulls (string) + char *string; +{ + register size_t slen; + register int i, j, prev_i; + DECLARE_MBSTATE; + + if (strchr (string, CTLNUL) == 0) /* XXX */ + return string; /* XXX */ + + slen = strlen (string); + i = j = 0; + + while (i < slen) + { + if (string[i] == CTLESC) + { + /* Old code had j++, but we cannot assume that i == j at this + point -- what if a CTLNUL has already been removed from the + string? We don't want to drop the CTLESC or recopy characters + that we've already copied down. */ + i++; string[j++] = CTLESC; + if (i == slen) + break; + } + else if (string[i] == CTLNUL) + { + i++; + continue; + } + + prev_i = i; + ADVANCE_CHAR (string, slen, i); + if (j < prev_i) + { + do string[j++] = string[prev_i++]; while (prev_i < i); + } + else + j = i; + } + string[j] = '\0'; + + return (string); +} + +/* Perform quoted null character removal on each element of LIST. + This modifies LIST. */ +void +word_list_remove_quoted_nulls (list) + WORD_LIST *list; +{ + register WORD_LIST *t; + + for (t = list; t; t = t->next) + { + remove_quoted_nulls (t->word->word); + t->word->flags &= ~W_HASQUOTEDNULL; + } +} + +/* **************************************************************** */ +/* */ +/* Functions for Matching and Removing Patterns */ +/* */ +/* **************************************************************** */ + +#if defined (HANDLE_MULTIBYTE) +#if 0 /* Currently unused */ +static unsigned char * +mb_getcharlens (string, len) + char *string; + int len; +{ + int i, offset, last; + unsigned char *ret; + char *p; + DECLARE_MBSTATE; + + i = offset = 0; + last = 0; + ret = (unsigned char *)xmalloc (len); + memset (ret, 0, len); + while (string[last]) + { + ADVANCE_CHAR (string, len, offset); + ret[last] = offset - last; + last = offset; + } + return ret; +} +#endif +#endif + +/* Remove the portion of PARAM matched by PATTERN according to OP, where OP + can have one of 4 values: + RP_LONG_LEFT remove longest matching portion at start of PARAM + RP_SHORT_LEFT remove shortest matching portion at start of PARAM + RP_LONG_RIGHT remove longest matching portion at end of PARAM + RP_SHORT_RIGHT remove shortest matching portion at end of PARAM +*/ + +#define RP_LONG_LEFT 1 +#define RP_SHORT_LEFT 2 +#define RP_LONG_RIGHT 3 +#define RP_SHORT_RIGHT 4 + +/* Returns its first argument if nothing matched; new memory otherwise */ +static char * +remove_upattern (param, pattern, op) + char *param, *pattern; + int op; +{ + register int len; + register char *end; + register char *p, *ret, c; + + len = STRLEN (param); + end = param + len; + + switch (op) + { + case RP_LONG_LEFT: /* remove longest match at start */ + for (p = end; p >= param; p--) + { + c = *p; *p = '\0'; + if (strmatch (pattern, param, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + *p = c; + return (savestring (p)); + } + *p = c; + + } + break; + + case RP_SHORT_LEFT: /* remove shortest match at start */ + for (p = param; p <= end; p++) + { + c = *p; *p = '\0'; + if (strmatch (pattern, param, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + *p = c; + return (savestring (p)); + } + *p = c; + } + break; + + case RP_LONG_RIGHT: /* remove longest match at end */ + for (p = param; p <= end; p++) + { + if (strmatch (pattern, p, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + c = *p; *p = '\0'; + ret = savestring (param); + *p = c; + return (ret); + } + } + break; + + case RP_SHORT_RIGHT: /* remove shortest match at end */ + for (p = end; p >= param; p--) + { + if (strmatch (pattern, p, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + c = *p; *p = '\0'; + ret = savestring (param); + *p = c; + return (ret); + } + } + break; + } + + return (param); /* no match, return original string */ +} + +#if defined (HANDLE_MULTIBYTE) +/* Returns its first argument if nothing matched; new memory otherwise */ +static wchar_t * +remove_wpattern (wparam, wstrlen, wpattern, op) + wchar_t *wparam; + size_t wstrlen; + wchar_t *wpattern; + int op; +{ + wchar_t wc, *ret; + int n; + + switch (op) + { + case RP_LONG_LEFT: /* remove longest match at start */ + for (n = wstrlen; n >= 0; n--) + { + wc = wparam[n]; wparam[n] = L'\0'; + if (wcsmatch (wpattern, wparam, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wparam[n] = wc; + return (wcsdup (wparam + n)); + } + wparam[n] = wc; + } + break; + + case RP_SHORT_LEFT: /* remove shortest match at start */ + for (n = 0; n <= wstrlen; n++) + { + wc = wparam[n]; wparam[n] = L'\0'; + if (wcsmatch (wpattern, wparam, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wparam[n] = wc; + return (wcsdup (wparam + n)); + } + wparam[n] = wc; + } + break; + + case RP_LONG_RIGHT: /* remove longest match at end */ + for (n = 0; n <= wstrlen; n++) + { + if (wcsmatch (wpattern, wparam + n, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wc = wparam[n]; wparam[n] = L'\0'; + ret = wcsdup (wparam); + wparam[n] = wc; + return (ret); + } + } + break; + + case RP_SHORT_RIGHT: /* remove shortest match at end */ + for (n = wstrlen; n >= 0; n--) + { + if (wcsmatch (wpattern, wparam + n, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wc = wparam[n]; wparam[n] = L'\0'; + ret = wcsdup (wparam); + wparam[n] = wc; + return (ret); + } + } + break; + } + + return (wparam); /* no match, return original string */ +} +#endif /* HANDLE_MULTIBYTE */ + +static char * +remove_pattern (param, pattern, op) + char *param, *pattern; + int op; +{ + char *xret; + + if (param == NULL) + return (param); + if (*param == '\0' || pattern == NULL || *pattern == '\0') /* minor optimization */ + return (savestring (param)); + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1) + { + wchar_t *ret, *oret; + size_t n; + wchar_t *wparam, *wpattern; + mbstate_t ps; + + n = xdupmbstowcs (&wpattern, NULL, pattern); + if (n == (size_t)-1) + { + xret = remove_upattern (param, pattern, op); + return ((xret == param) ? savestring (param) : xret); + } + n = xdupmbstowcs (&wparam, NULL, param); + + if (n == (size_t)-1) + { + free (wpattern); + xret = remove_upattern (param, pattern, op); + return ((xret == param) ? savestring (param) : xret); + } + oret = ret = remove_wpattern (wparam, n, wpattern, op); + /* Don't bother to convert wparam back to multibyte string if nothing + matched; just return copy of original string */ + if (ret == wparam) + { + free (wparam); + free (wpattern); + return (savestring (param)); + } + + free (wparam); + free (wpattern); + + n = strlen (param); + xret = (char *)xmalloc (n + 1); + memset (&ps, '\0', sizeof (mbstate_t)); + n = wcsrtombs (xret, (const wchar_t **)&ret, n, &ps); + xret[n] = '\0'; /* just to make sure */ + free (oret); + return xret; + } + else +#endif + { + xret = remove_upattern (param, pattern, op); + return ((xret == param) ? savestring (param) : xret); + } +} + +/* Match PAT anywhere in STRING and return the match boundaries. + This returns 1 in case of a successful match, 0 otherwise. SP + and EP are pointers into the string where the match begins and + ends, respectively. MTYPE controls what kind of match is attempted. + MATCH_BEG and MATCH_END anchor the match at the beginning and end + of the string, respectively. The longest match is returned. */ +static int +match_upattern (string, pat, mtype, sp, ep) + char *string, *pat; + int mtype; + char **sp, **ep; +{ + int c, len, mlen; + register char *p, *p1, *npat; + char *end; + int n1; + + /* If the pattern doesn't match anywhere in the string, go ahead and + short-circuit right away. A minor optimization, saves a bunch of + unnecessary calls to strmatch (up to N calls for a string of N + characters) if the match is unsuccessful. To preserve the semantics + of the substring matches below, we make sure that the pattern has + `*' as first and last character, making a new pattern if necessary. */ + /* XXX - check this later if I ever implement `**' with special meaning, + since this will potentially result in `**' at the beginning or end */ + len = STRLEN (pat); + if (pat[0] != '*' || (pat[0] == '*' && pat[1] == LPAREN && extended_glob) || pat[len - 1] != '*') + { + p = npat = (char *)xmalloc (len + 3); + p1 = pat; + if (*p1 != '*' || (*p1 == '*' && p1[1] == LPAREN && extended_glob)) + *p++ = '*'; + while (*p1) + *p++ = *p1++; + if (p1[-1] != '*' || p[-2] == '\\') + *p++ = '*'; + *p = '\0'; + } + else + npat = pat; + c = strmatch (npat, string, FNMATCH_EXTFLAG); + if (npat != pat) + free (npat); + if (c == FNM_NOMATCH) + return (0); + + len = STRLEN (string); + end = string + len; + + mlen = umatchlen (pat, len); + + switch (mtype) + { + case MATCH_ANY: + for (p = string; p <= end; p++) + { + if (match_pattern_char (pat, p)) + { + p1 = (mlen == -1) ? end : p + mlen; + /* p1 - p = length of portion of string to be considered + p = current position in string + mlen = number of characters consumed by match (-1 for entire string) + end = end of string + we want to break immediately if the potential match len + is greater than the number of characters remaining in the + string + */ + if (p1 > end) + break; + for ( ; p1 >= p; p1--) + { + c = *p1; *p1 = '\0'; + if (strmatch (pat, p, FNMATCH_EXTFLAG) == 0) + { + *p1 = c; + *sp = p; + *ep = p1; + return 1; + } + *p1 = c; +#if 1 + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; +#endif + } + } + } + + return (0); + + case MATCH_BEG: + if (match_pattern_char (pat, string) == 0) + return (0); + + for (p = (mlen == -1) ? end : string + mlen; p >= string; p--) + { + c = *p; *p = '\0'; + if (strmatch (pat, string, FNMATCH_EXTFLAG) == 0) + { + *p = c; + *sp = string; + *ep = p; + return 1; + } + *p = c; + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + + return (0); + + case MATCH_END: + for (p = end - ((mlen == -1) ? len : mlen); p <= end; p++) + { + if (strmatch (pat, p, FNMATCH_EXTFLAG) == 0) + { + *sp = p; + *ep = end; + return 1; + } + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + + return (0); + } + + return (0); +} + +#if defined (HANDLE_MULTIBYTE) +/* Match WPAT anywhere in WSTRING and return the match boundaries. + This returns 1 in case of a successful match, 0 otherwise. Wide + character version. */ +static int +match_wpattern (wstring, indices, wstrlen, wpat, mtype, sp, ep) + wchar_t *wstring; + char **indices; + size_t wstrlen; + wchar_t *wpat; + int mtype; + char **sp, **ep; +{ + wchar_t wc, *wp, *nwpat, *wp1; + size_t len; + int mlen; + int n, n1, n2, simple; + + simple = (wpat[0] != L'\\' && wpat[0] != L'*' && wpat[0] != L'?' && wpat[0] != L'['); +#if defined (EXTENDED_GLOB) + if (extended_glob) + simple &= (wpat[1] != L'(' || (wpat[0] != L'*' && wpat[0] != L'?' && wpat[0] != L'+' && wpat[0] != L'!' && wpat[0] != L'@')); /*)*/ +#endif + + /* If the pattern doesn't match anywhere in the string, go ahead and + short-circuit right away. A minor optimization, saves a bunch of + unnecessary calls to strmatch (up to N calls for a string of N + characters) if the match is unsuccessful. To preserve the semantics + of the substring matches below, we make sure that the pattern has + `*' as first and last character, making a new pattern if necessary. */ + len = wcslen (wpat); + if (wpat[0] != L'*' || (wpat[0] == L'*' && wpat[1] == WLPAREN && extended_glob) || wpat[len - 1] != L'*') + { + wp = nwpat = (wchar_t *)xmalloc ((len + 3) * sizeof (wchar_t)); + wp1 = wpat; + if (*wp1 != L'*' || (*wp1 == '*' && wp1[1] == WLPAREN && extended_glob)) + *wp++ = L'*'; + while (*wp1 != L'\0') + *wp++ = *wp1++; + if (wp1[-1] != L'*' || wp1[-2] == L'\\') + *wp++ = L'*'; + *wp = '\0'; + } + else + nwpat = wpat; + len = wcsmatch (nwpat, wstring, FNMATCH_EXTFLAG); + if (nwpat != wpat) + free (nwpat); + if (len == FNM_NOMATCH) + return (0); + + mlen = wmatchlen (wpat, wstrlen); + +/* itrace("wmatchlen (%ls) -> %d", wpat, mlen); */ + switch (mtype) + { + case MATCH_ANY: + for (n = 0; n <= wstrlen; n++) + { + n2 = simple ? (*wpat == wstring[n]) : match_pattern_wchar (wpat, wstring + n); + if (n2) + { + n1 = (mlen == -1) ? wstrlen : n + mlen; + if (n1 > wstrlen) + break; + + for ( ; n1 >= n; n1--) + { + wc = wstring[n1]; wstring[n1] = L'\0'; + if (wcsmatch (wpat, wstring + n, FNMATCH_EXTFLAG) == 0) + { + wstring[n1] = wc; + *sp = indices[n]; + *ep = indices[n1]; + return 1; + } + wstring[n1] = wc; + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + } + } + + return (0); + + case MATCH_BEG: + if (match_pattern_wchar (wpat, wstring) == 0) + return (0); + + for (n = (mlen == -1) ? wstrlen : mlen; n >= 0; n--) + { + wc = wstring[n]; wstring[n] = L'\0'; + if (wcsmatch (wpat, wstring, FNMATCH_EXTFLAG) == 0) + { + wstring[n] = wc; + *sp = indices[0]; + *ep = indices[n]; + return 1; + } + wstring[n] = wc; + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + + return (0); + + case MATCH_END: + for (n = wstrlen - ((mlen == -1) ? wstrlen : mlen); n <= wstrlen; n++) + { + if (wcsmatch (wpat, wstring + n, FNMATCH_EXTFLAG) == 0) + { + *sp = indices[n]; + *ep = indices[wstrlen]; + return 1; + } + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + + return (0); + } + + return (0); +} +#endif /* HANDLE_MULTIBYTE */ + +static int +match_pattern (string, pat, mtype, sp, ep) + char *string, *pat; + int mtype; + char **sp, **ep; +{ +#if defined (HANDLE_MULTIBYTE) + int ret; + size_t n; + wchar_t *wstring, *wpat; + char **indices; + size_t slen, plen, mslen, mplen; +#endif + + if (string == 0 || *string == 0 || pat == 0 || *pat == 0) + return (0); + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1) + { + if (mbsmbchar (string) == 0 && mbsmbchar (pat) == 0) + return (match_upattern (string, pat, mtype, sp, ep)); + + n = xdupmbstowcs (&wpat, NULL, pat); + if (n == (size_t)-1) + return (match_upattern (string, pat, mtype, sp, ep)); + n = xdupmbstowcs (&wstring, &indices, string); + if (n == (size_t)-1) + { + free (wpat); + return (match_upattern (string, pat, mtype, sp, ep)); + } + ret = match_wpattern (wstring, indices, n, wpat, mtype, sp, ep); + + free (wpat); + free (wstring); + free (indices); + + return (ret); + } + else +#endif + return (match_upattern (string, pat, mtype, sp, ep)); +} + +static int +getpatspec (c, value) + int c; + char *value; +{ + if (c == '#') + return ((*value == '#') ? RP_LONG_LEFT : RP_SHORT_LEFT); + else /* c == '%' */ + return ((*value == '%') ? RP_LONG_RIGHT : RP_SHORT_RIGHT); +} + +/* Posix.2 says that the WORD should be run through tilde expansion, + parameter expansion, command substitution and arithmetic expansion. + This leaves the result quoted, so quote_string_for_globbing () has + to be called to fix it up for strmatch (). If QUOTED is non-zero, + it means that the entire expression was enclosed in double quotes. + This means that quoting characters in the pattern do not make any + special pattern characters quoted. For example, the `*' in the + following retains its special meaning: "${foo#'*'}". */ +static char * +getpattern (value, quoted, expandpat) + char *value; + int quoted, expandpat; +{ + char *pat, *tword; + WORD_LIST *l; +#if 0 + int i; +#endif + /* There is a problem here: how to handle single or double quotes in the + pattern string when the whole expression is between double quotes? + POSIX.2 says that enclosing double quotes do not cause the pattern to + be quoted, but does that leave us a problem with @ and array[@] and their + expansions inside a pattern? */ +#if 0 + if (expandpat && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && *tword) + { + i = 0; + pat = string_extract_double_quoted (tword, &i, 1); + free (tword); + tword = pat; + } +#endif + + /* expand_string_for_rhs () leaves WORD quoted and does not perform + word splitting. */ + l = *value ? expand_string_for_rhs (value, + (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) ? Q_PATQUOTE : quoted, + (int *)NULL, (int *)NULL) + : (WORD_LIST *)0; + pat = string_list (l); + dispose_words (l); + if (pat) + { + tword = quote_string_for_globbing (pat, QGLOB_CVTNULL); + free (pat); + pat = tword; + } + return (pat); +} + +#if 0 +/* Handle removing a pattern from a string as a result of ${name%[%]value} + or ${name#[#]value}. */ +static char * +variable_remove_pattern (value, pattern, patspec, quoted) + char *value, *pattern; + int patspec, quoted; +{ + char *tword; + + tword = remove_pattern (value, pattern, patspec); + + return (tword); +} +#endif + +static char * +list_remove_pattern (list, pattern, patspec, itype, quoted) + WORD_LIST *list; + char *pattern; + int patspec, itype, quoted; +{ + WORD_LIST *new, *l; + WORD_DESC *w; + char *tword; + + for (new = (WORD_LIST *)NULL, l = list; l; l = l->next) + { + tword = remove_pattern (l->word->word, pattern, patspec); + w = alloc_word_desc (); + w->word = tword ? tword : savestring (""); + new = make_word_list (w, new); + } + + l = REVERSE_LIST (new, WORD_LIST *); + tword = string_list_pos_params (itype, l, quoted); + dispose_words (l); + + return (tword); +} + +static char * +parameter_list_remove_pattern (itype, pattern, patspec, quoted) + int itype; + char *pattern; + int patspec, quoted; +{ + char *ret; + WORD_LIST *list; + + list = list_rest_of_args (); + if (list == 0) + return ((char *)NULL); + ret = list_remove_pattern (list, pattern, patspec, itype, quoted); + dispose_words (list); + return (ret); +} + +#if defined (ARRAY_VARS) +static char * +array_remove_pattern (var, pattern, patspec, varname, quoted) + SHELL_VAR *var; + char *pattern; + int patspec; + char *varname; /* so we can figure out how it's indexed */ + int quoted; +{ + ARRAY *a; + HASH_TABLE *h; + int itype; + char *ret; + WORD_LIST *list; + SHELL_VAR *v; + + /* compute itype from varname here */ + v = array_variable_part (varname, &ret, 0); + + /* XXX */ + if (v && invisible_p (var)) + return ((char *)NULL); + + itype = ret[0]; + + a = (v && array_p (v)) ? array_cell (v) : 0; + h = (v && assoc_p (v)) ? assoc_cell (v) : 0; + + list = a ? array_to_word_list (a) : (h ? assoc_to_word_list (h) : 0); + if (list == 0) + return ((char *)NULL); + ret = list_remove_pattern (list, pattern, patspec, itype, quoted); + dispose_words (list); + + return ret; +} +#endif /* ARRAY_VARS */ + +static char * +parameter_brace_remove_pattern (varname, value, ind, patstr, rtype, quoted, flags) + char *varname, *value; + int ind; + char *patstr; + int rtype, quoted, flags; +{ + int vtype, patspec, starsub; + char *temp1, *val, *pattern; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + this_command_name = varname; + + vtype = get_var_and_type (varname, value, ind, quoted, flags, &v, &val); + if (vtype == -1) + return ((char *)NULL); + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + patspec = getpatspec (rtype, patstr); + if (patspec == RP_LONG_LEFT || patspec == RP_LONG_RIGHT) + patstr++; + + /* Need to pass getpattern newly-allocated memory in case of expansion -- + the expansion code will free the passed string on an error. */ + temp1 = savestring (patstr); + pattern = getpattern (temp1, quoted, 1); + free (temp1); + + temp1 = (char *)NULL; /* shut up gcc */ + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + temp1 = remove_pattern (val, pattern, patspec); + if (vtype == VT_VARIABLE) + FREE (val); + if (temp1) + { + val = (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + ? quote_string (temp1) + : quote_escapes (temp1); + free (temp1); + temp1 = val; + } + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + temp1 = array_remove_pattern (v, pattern, patspec, varname, quoted); + if (temp1 && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + { + val = quote_escapes (temp1); + free (temp1); + temp1 = val; + } + break; +#endif + case VT_POSPARMS: + temp1 = parameter_list_remove_pattern (varname[0], pattern, patspec, quoted); + if (temp1 && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + { + val = quote_escapes (temp1); + free (temp1); + temp1 = val; + } + break; + } + + FREE (pattern); + return temp1; +} + +/******************************************* + * * + * Functions to expand WORD_DESCs * + * * + *******************************************/ + +/* Expand WORD, performing word splitting on the result. This does + parameter expansion, command substitution, arithmetic expansion, + word splitting, and quote removal. */ + +WORD_LIST * +expand_word (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_LIST *result, *tresult; + + tresult = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); + result = word_list_split (tresult); + dispose_words (tresult); + return (result ? dequote_list (result) : result); +} + +/* Expand WORD, but do not perform word splitting on the result. This + does parameter expansion, command substitution, arithmetic expansion, + and quote removal. */ +WORD_LIST * +expand_word_unsplit (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_LIST *result; + + expand_no_split_dollar_star = 1; +#if defined (HANDLE_MULTIBYTE) + if (ifs_firstc[0] == 0) +#else + if (ifs_firstc == 0) +#endif + word->flags |= W_NOSPLIT; + word->flags |= W_NOSPLIT2; + result = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); + expand_no_split_dollar_star = 0; + + return (result ? dequote_list (result) : result); +} + +/* Perform shell expansions on WORD, but do not perform word splitting or + quote removal on the result. Virtually identical to expand_word_unsplit; + could be combined if implementations don't diverge. */ +WORD_LIST * +expand_word_leave_quoted (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_LIST *result; + + expand_no_split_dollar_star = 1; +#if defined (HANDLE_MULTIBYTE) + if (ifs_firstc[0] == 0) +#else + if (ifs_firstc == 0) +#endif + word->flags |= W_NOSPLIT; + word->flags |= W_NOSPLIT2; + result = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); + expand_no_split_dollar_star = 0; + + return result; +} + +#if defined (PROCESS_SUBSTITUTION) + +/*****************************************************************/ +/* */ +/* Hacking Process Substitution */ +/* */ +/*****************************************************************/ + +#if !defined (HAVE_DEV_FD) +/* Named pipes must be removed explicitly with `unlink'. This keeps a list + of FIFOs the shell has open. unlink_fifo_list will walk the list and + unlink all of them. add_fifo_list adds the name of an open FIFO to the + list. NFIFO is a count of the number of FIFOs in the list. */ +#define FIFO_INCR 20 + +struct temp_fifo { + char *file; + pid_t proc; +}; + +static struct temp_fifo *fifo_list = (struct temp_fifo *)NULL; +static int nfifo; +static int fifo_list_size; + +char * +copy_fifo_list (sizep) + int *sizep; +{ + if (sizep) + *sizep = 0; + return (char *)NULL; +} + +static void +add_fifo_list (pathname) + char *pathname; +{ + if (nfifo >= fifo_list_size - 1) + { + fifo_list_size += FIFO_INCR; + fifo_list = (struct temp_fifo *)xrealloc (fifo_list, + fifo_list_size * sizeof (struct temp_fifo)); + } + + fifo_list[nfifo].file = savestring (pathname); + nfifo++; +} + +void +unlink_fifo (i) + int i; +{ + if ((fifo_list[i].proc == -1) || (kill(fifo_list[i].proc, 0) == -1)) + { + unlink (fifo_list[i].file); + free (fifo_list[i].file); + fifo_list[i].file = (char *)NULL; + fifo_list[i].proc = -1; + } +} + +void +unlink_fifo_list () +{ + int saved, i, j; + + if (nfifo == 0) + return; + + for (i = saved = 0; i < nfifo; i++) + { + if ((fifo_list[i].proc == -1) || (kill(fifo_list[i].proc, 0) == -1)) + { + unlink (fifo_list[i].file); + free (fifo_list[i].file); + fifo_list[i].file = (char *)NULL; + fifo_list[i].proc = -1; + } + else + saved++; + } + + /* If we didn't remove some of the FIFOs, compact the list. */ + if (saved) + { + for (i = j = 0; i < nfifo; i++) + if (fifo_list[i].file) + { + fifo_list[j].file = fifo_list[i].file; + fifo_list[j].proc = fifo_list[i].proc; + j++; + } + nfifo = j; + } + else + nfifo = 0; +} + +/* Take LIST, which is a bitmap denoting active FIFOs in fifo_list + from some point in the past, and close all open FIFOs in fifo_list + that are not marked as active in LIST. If LIST is NULL, close + everything in fifo_list. LSIZE is the number of elements in LIST, in + case it's larger than fifo_list_size (size of fifo_list). */ +void +close_new_fifos (list, lsize) + char *list; + int lsize; +{ + int i; + + if (list == 0) + { + unlink_fifo_list (); + return; + } + + for (i = 0; i < lsize; i++) + if (list[i] == 0 && i < fifo_list_size && fifo_list[i].proc != -1) + unlink_fifo (i); + + for (i = lsize; i < fifo_list_size; i++) + unlink_fifo (i); +} + +int +fifos_pending () +{ + return nfifo; +} + +int +num_fifos () +{ + return nfifo; +} + +static char * +make_named_pipe () +{ + char *tname; + + tname = sh_mktmpname ("sh-np", MT_USERANDOM|MT_USETMPDIR); + if (mkfifo (tname, 0600) < 0) + { + free (tname); + return ((char *)NULL); + } + + add_fifo_list (tname); + return (tname); +} + +#else /* HAVE_DEV_FD */ + +/* DEV_FD_LIST is a bitmap of file descriptors attached to pipes the shell + has open to children. NFDS is a count of the number of bits currently + set in DEV_FD_LIST. TOTFDS is a count of the highest possible number + of open files. */ +static char *dev_fd_list = (char *)NULL; +static int nfds; +static int totfds; /* The highest possible number of open files. */ + +char * +copy_fifo_list (sizep) + int *sizep; +{ + char *ret; + + if (nfds == 0 || totfds == 0) + { + if (sizep) + *sizep = 0; + return (char *)NULL; + } + + if (sizep) + *sizep = totfds; + ret = (char *)xmalloc (totfds); + return (memcpy (ret, dev_fd_list, totfds)); +} + +static void +add_fifo_list (fd) + int fd; +{ + if (dev_fd_list == 0 || fd >= totfds) + { + int ofds; + + ofds = totfds; + totfds = getdtablesize (); + if (totfds < 0 || totfds > 256) + totfds = 256; + if (fd >= totfds) + totfds = fd + 2; + + dev_fd_list = (char *)xrealloc (dev_fd_list, totfds); + memset (dev_fd_list + ofds, '\0', totfds - ofds); + } + + dev_fd_list[fd] = 1; + nfds++; +} + +int +fifos_pending () +{ + return 0; /* used for cleanup; not needed with /dev/fd */ +} + +int +num_fifos () +{ + return nfds; +} + +void +unlink_fifo (fd) + int fd; +{ + if (dev_fd_list[fd]) + { + close (fd); + dev_fd_list[fd] = 0; + nfds--; + } +} + +void +unlink_fifo_list () +{ + register int i; + + if (nfds == 0) + return; + + for (i = 0; nfds && i < totfds; i++) + unlink_fifo (i); + + nfds = 0; +} + +/* Take LIST, which is a snapshot copy of dev_fd_list from some point in + the past, and close all open fds in dev_fd_list that are not marked + as open in LIST. If LIST is NULL, close everything in dev_fd_list. + LSIZE is the number of elements in LIST, in case it's larger than + totfds (size of dev_fd_list). */ +void +close_new_fifos (list, lsize) + char *list; + int lsize; +{ + int i; + + if (list == 0) + { + unlink_fifo_list (); + return; + } + + for (i = 0; i < lsize; i++) + if (list[i] == 0 && i < totfds && dev_fd_list[i]) + unlink_fifo (i); + + for (i = lsize; i < totfds; i++) + unlink_fifo (i); +} + +#if defined (NOTDEF) +print_dev_fd_list () +{ + register int i; + + fprintf (stderr, "pid %ld: dev_fd_list:", (long)getpid ()); + fflush (stderr); + + for (i = 0; i < totfds; i++) + { + if (dev_fd_list[i]) + fprintf (stderr, " %d", i); + } + fprintf (stderr, "\n"); +} +#endif /* NOTDEF */ + +static char * +make_dev_fd_filename (fd) + int fd; +{ + char *ret, intbuf[INT_STRLEN_BOUND (int) + 1], *p; + + ret = (char *)xmalloc (sizeof (DEV_FD_PREFIX) + 8); + + strcpy (ret, DEV_FD_PREFIX); + p = inttostr (fd, intbuf, sizeof (intbuf)); + strcpy (ret + sizeof (DEV_FD_PREFIX) - 1, p); + + add_fifo_list (fd); + return (ret); +} + +#endif /* HAVE_DEV_FD */ + +/* Return a filename that will open a connection to the process defined by + executing STRING. HAVE_DEV_FD, if defined, means open a pipe and return + a filename in /dev/fd corresponding to a descriptor that is one of the + ends of the pipe. If not defined, we use named pipes on systems that have + them. Systems without /dev/fd and named pipes are out of luck. + + OPEN_FOR_READ_IN_CHILD, if 1, means open the named pipe for reading or + use the read end of the pipe and dup that file descriptor to fd 0 in + the child. If OPEN_FOR_READ_IN_CHILD is 0, we open the named pipe for + writing or use the write end of the pipe in the child, and dup that + file descriptor to fd 1 in the child. The parent does the opposite. */ + +static char * +process_substitute (string, open_for_read_in_child) + char *string; + int open_for_read_in_child; +{ + char *pathname; + int fd, result; + pid_t old_pid, pid; +#if defined (HAVE_DEV_FD) + int parent_pipe_fd, child_pipe_fd; + int fildes[2]; +#endif /* HAVE_DEV_FD */ +#if defined (JOB_CONTROL) + pid_t old_pipeline_pgrp; +#endif + + if (!string || !*string || wordexp_only) + return ((char *)NULL); + +#if !defined (HAVE_DEV_FD) + pathname = make_named_pipe (); +#else /* HAVE_DEV_FD */ + if (pipe (fildes) < 0) + { + sys_error (_("cannot make pipe for process substitution")); + return ((char *)NULL); + } + /* If OPEN_FOR_READ_IN_CHILD == 1, we want to use the write end of + the pipe in the parent, otherwise the read end. */ + parent_pipe_fd = fildes[open_for_read_in_child]; + child_pipe_fd = fildes[1 - open_for_read_in_child]; + /* Move the parent end of the pipe to some high file descriptor, to + avoid clashes with FDs used by the script. */ + parent_pipe_fd = move_to_high_fd (parent_pipe_fd, 1, 64); + + pathname = make_dev_fd_filename (parent_pipe_fd); +#endif /* HAVE_DEV_FD */ + + if (pathname == 0) + { + sys_error (_("cannot make pipe for process substitution")); + return ((char *)NULL); + } + + old_pid = last_made_pid; + +#if defined (JOB_CONTROL) + old_pipeline_pgrp = pipeline_pgrp; + pipeline_pgrp = shell_pgrp; + save_pipeline (1); +#endif /* JOB_CONTROL */ + + pid = make_child ((char *)NULL, 1); + if (pid == 0) + { + reset_terminating_signals (); /* XXX */ + free_pushed_string_input (); + /* Cancel traps, in trap.c. */ + restore_original_signals (); /* XXX - what about special builtins? bash-4.2 */ + setup_async_signals (); + subshell_environment |= SUBSHELL_COMSUB|SUBSHELL_PROCSUB; + } + +#if defined (JOB_CONTROL) + set_sigchld_handler (); + stop_making_children (); + /* XXX - should we only do this in the parent? (as in command subst) */ + pipeline_pgrp = old_pipeline_pgrp; +#endif /* JOB_CONTROL */ + + if (pid < 0) + { + sys_error (_("cannot make child for process substitution")); + free (pathname); +#if defined (HAVE_DEV_FD) + close (parent_pipe_fd); + close (child_pipe_fd); +#endif /* HAVE_DEV_FD */ + return ((char *)NULL); + } + + if (pid > 0) + { +#if defined (JOB_CONTROL) + restore_pipeline (1); +#endif + +#if !defined (HAVE_DEV_FD) + fifo_list[nfifo-1].proc = pid; +#endif + + last_made_pid = old_pid; + +#if defined (JOB_CONTROL) && defined (PGRP_PIPE) + close_pgrp_pipe (); +#endif /* JOB_CONTROL && PGRP_PIPE */ + +#if defined (HAVE_DEV_FD) + close (child_pipe_fd); +#endif /* HAVE_DEV_FD */ + + return (pathname); + } + + set_sigint_handler (); + +#if defined (JOB_CONTROL) + set_job_control (0); +#endif /* JOB_CONTROL */ + +#if !defined (HAVE_DEV_FD) + /* Open the named pipe in the child. */ + fd = open (pathname, open_for_read_in_child ? O_RDONLY : O_WRONLY); + if (fd < 0) + { + /* Two separate strings for ease of translation. */ + if (open_for_read_in_child) + sys_error (_("cannot open named pipe %s for reading"), pathname); + else + sys_error (_("cannot open named pipe %s for writing"), pathname); + + exit (127); + } + if (open_for_read_in_child) + { + if (sh_unset_nodelay_mode (fd) < 0) + { + sys_error (_("cannot reset nodelay mode for fd %d"), fd); + exit (127); + } + } +#else /* HAVE_DEV_FD */ + fd = child_pipe_fd; +#endif /* HAVE_DEV_FD */ + + if (dup2 (fd, open_for_read_in_child ? 0 : 1) < 0) + { + sys_error (_("cannot duplicate named pipe %s as fd %d"), pathname, + open_for_read_in_child ? 0 : 1); + exit (127); + } + + if (fd != (open_for_read_in_child ? 0 : 1)) + close (fd); + + /* Need to close any files that this process has open to pipes inherited + from its parent. */ + if (current_fds_to_close) + { + close_fd_bitmap (current_fds_to_close); + current_fds_to_close = (struct fd_bitmap *)NULL; + } + +#if defined (HAVE_DEV_FD) + /* Make sure we close the parent's end of the pipe and clear the slot + in the fd list so it is not closed later, if reallocated by, for + instance, pipe(2). */ + close (parent_pipe_fd); + dev_fd_list[parent_pipe_fd] = 0; +#endif /* HAVE_DEV_FD */ + + /* subshells shouldn't have this flag, which controls using the temporary + environment for variable lookups. */ + expanding_redir = 0; + + result = parse_and_execute (string, "process substitution", (SEVAL_NONINT|SEVAL_NOHIST)); + +#if !defined (HAVE_DEV_FD) + /* Make sure we close the named pipe in the child before we exit. */ + close (open_for_read_in_child ? 0 : 1); +#endif /* !HAVE_DEV_FD */ + + last_command_exit_value = result; + result = run_exit_trap (); + exit (result); + /*NOTREACHED*/ +} +#endif /* PROCESS_SUBSTITUTION */ + +/***********************************/ +/* */ +/* Command Substitution */ +/* */ +/***********************************/ + +static char * +read_comsub (fd, quoted, rflag) + int fd, quoted; + int *rflag; +{ + char *istring, buf[128], *bufp, *s; + int istring_index, istring_size, c, tflag, skip_ctlesc, skip_ctlnul; + ssize_t bufn; + + istring = (char *)NULL; + istring_index = istring_size = bufn = tflag = 0; + + for (skip_ctlesc = skip_ctlnul = 0, s = ifs_value; s && *s; s++) + skip_ctlesc |= *s == CTLESC, skip_ctlnul |= *s == CTLNUL; + + /* Read the output of the command through the pipe. This may need to be + changed to understand multibyte characters in the future. */ + while (1) + { + if (fd < 0) + break; + if (--bufn <= 0) + { + bufn = zread (fd, buf, sizeof (buf)); + if (bufn <= 0) + break; + bufp = buf; + } + c = *bufp++; + + if (c == 0) + { +#if 0 + internal_warning ("read_comsub: ignored null byte in input"); +#endif + continue; + } + + /* Add the character to ISTRING, possibly after resizing it. */ + RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, DEFAULT_ARRAY_SIZE); + + /* This is essentially quote_string inline */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) /* || c == CTLESC || c == CTLNUL */) + istring[istring_index++] = CTLESC; + /* Escape CTLESC and CTLNUL in the output to protect those characters + from the rest of the word expansions (word splitting and globbing.) + This is essentially quote_escapes inline. */ + else if (skip_ctlesc == 0 && c == CTLESC) + { + tflag |= W_HASCTLESC; + istring[istring_index++] = CTLESC; + } + else if ((skip_ctlnul == 0 && c == CTLNUL) || (c == ' ' && (ifs_value && *ifs_value == 0))) + istring[istring_index++] = CTLESC; + + istring[istring_index++] = c; + +#if 0 +#if defined (__CYGWIN__) + if (c == '\n' && istring_index > 1 && istring[istring_index - 2] == '\r') + { + istring_index--; + istring[istring_index - 1] = '\n'; + } +#endif +#endif + } + + if (istring) + istring[istring_index] = '\0'; + + /* If we read no output, just return now and save ourselves some + trouble. */ + if (istring_index == 0) + { + FREE (istring); + if (rflag) + *rflag = tflag; + return (char *)NULL; + } + + /* Strip trailing newlines from the output of the command. */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + { + while (istring_index > 0) + { + if (istring[istring_index - 1] == '\n') + { + --istring_index; + + /* If the newline was quoted, remove the quoting char. */ + if (istring[istring_index - 1] == CTLESC) + --istring_index; + } + else + break; + } + istring[istring_index] = '\0'; + } + else + strip_trailing (istring, istring_index - 1, 1); + + if (rflag) + *rflag = tflag; + return istring; +} + +/* Perform command substitution on STRING. This returns a WORD_DESC * with the + contained string possibly quoted. */ +WORD_DESC * +command_substitute (string, quoted) + char *string; + int quoted; +{ + pid_t pid, old_pid, old_pipeline_pgrp, old_async_pid; + char *istring; + int result, fildes[2], function_value, pflags, rc, tflag; + WORD_DESC *ret; + + istring = (char *)NULL; + + /* Don't fork () if there is no need to. In the case of no command to + run, just return NULL. */ + if (!string || !*string || (string[0] == '\n' && !string[1])) + return ((WORD_DESC *)NULL); + + if (wordexp_only && read_but_dont_execute) + { + last_command_exit_value = EX_WEXPCOMSUB; + jump_to_top_level (EXITPROG); + } + + /* We're making the assumption here that the command substitution will + eventually run a command from the file system. Since we'll run + maybe_make_export_env in this subshell before executing that command, + the parent shell and any other shells it starts will have to remake + the environment. If we make it before we fork, other shells won't + have to. Don't bother if we have any temporary variable assignments, + though, because the export environment will be remade after this + command completes anyway, but do it if all the words to be expanded + are variable assignments. */ + if (subst_assign_varlist == 0 || garglist == 0) + maybe_make_export_env (); /* XXX */ + + /* Flags to pass to parse_and_execute() */ + pflags = (interactive && sourcelevel == 0) ? SEVAL_RESETLINE : 0; + + /* Pipe the output of executing STRING into the current shell. */ + if (pipe (fildes) < 0) + { + sys_error (_("cannot make pipe for command substitution")); + goto error_exit; + } + + old_pid = last_made_pid; +#if defined (JOB_CONTROL) + old_pipeline_pgrp = pipeline_pgrp; + /* Don't reset the pipeline pgrp if we're already a subshell in a pipeline. */ + if ((subshell_environment & SUBSHELL_PIPE) == 0) + pipeline_pgrp = shell_pgrp; + cleanup_the_pipeline (); +#endif /* JOB_CONTROL */ + + old_async_pid = last_asynchronous_pid; + pid = make_child ((char *)NULL, subshell_environment&SUBSHELL_ASYNC); + last_asynchronous_pid = old_async_pid; + + if (pid == 0) + { + /* Reset the signal handlers in the child, but don't free the + trap strings. Set a flag noting that we have to free the + trap strings if we run trap to change a signal disposition. */ + reset_signal_handlers (); + subshell_environment |= SUBSHELL_RESETTRAP; + } + +#if defined (JOB_CONTROL) + /* XXX DO THIS ONLY IN PARENT ? XXX */ + set_sigchld_handler (); + stop_making_children (); + if (pid != 0) + pipeline_pgrp = old_pipeline_pgrp; +#else + stop_making_children (); +#endif /* JOB_CONTROL */ + + if (pid < 0) + { + sys_error (_("cannot make child for command substitution")); + error_exit: + + last_made_pid = old_pid; + + FREE (istring); + close (fildes[0]); + close (fildes[1]); + return ((WORD_DESC *)NULL); + } + + if (pid == 0) + { + set_sigint_handler (); /* XXX */ + + free_pushed_string_input (); + + if (dup2 (fildes[1], 1) < 0) + { + sys_error (_("command_substitute: cannot duplicate pipe as fd 1")); + exit (EXECUTION_FAILURE); + } + + /* If standard output is closed in the parent shell + (such as after `exec >&-'), file descriptor 1 will be + the lowest available file descriptor, and end up in + fildes[0]. This can happen for stdin and stderr as well, + but stdout is more important -- it will cause no output + to be generated from this command. */ + if ((fildes[1] != fileno (stdin)) && + (fildes[1] != fileno (stdout)) && + (fildes[1] != fileno (stderr))) + close (fildes[1]); + + if ((fildes[0] != fileno (stdin)) && + (fildes[0] != fileno (stdout)) && + (fildes[0] != fileno (stderr))) + close (fildes[0]); + +#ifdef __CYGWIN__ + /* Let stdio know the fd may have changed from text to binary mode, and + make sure to preserve stdout line buffering. */ + freopen (NULL, "w", stdout); + sh_setlinebuf (stdout); +#endif /* __CYGWIN__ */ + + /* The currently executing shell is not interactive. */ + interactive = 0; + + /* This is a subshell environment. */ + subshell_environment |= SUBSHELL_COMSUB; + + /* When not in POSIX mode, command substitution does not inherit + the -e flag. */ + if (posixly_correct == 0) + { + builtin_ignoring_errexit = 0; + change_flag ('e', FLAG_OFF); + set_shellopts (); + } + + remove_quoted_escapes (string); + + startup_state = 2; /* see if we can avoid a fork */ + /* Give command substitution a place to jump back to on failure, + so we don't go back up to main (). */ + result = setjmp_nosigs (top_level); + + /* If we're running a command substitution inside a shell function, + trap `return' so we don't return from the function in the subshell + and go off to never-never land. */ + if (result == 0 && return_catch_flag) + function_value = setjmp_nosigs (return_catch); + else + function_value = 0; + + if (result == ERREXIT) + rc = last_command_exit_value; + else if (result == EXITPROG) + rc = last_command_exit_value; + else if (result) + rc = EXECUTION_FAILURE; + else if (function_value) + rc = return_catch_value; + else + { + subshell_level++; + rc = parse_and_execute (string, "command substitution", pflags|SEVAL_NOHIST); + subshell_level--; + } + + last_command_exit_value = rc; + rc = run_exit_trap (); +#if defined (PROCESS_SUBSTITUTION) + unlink_fifo_list (); +#endif + exit (rc); + } + else + { +#if defined (JOB_CONTROL) && defined (PGRP_PIPE) + close_pgrp_pipe (); +#endif /* JOB_CONTROL && PGRP_PIPE */ + + close (fildes[1]); + + tflag = 0; + istring = read_comsub (fildes[0], quoted, &tflag); + + close (fildes[0]); + + current_command_subst_pid = pid; + last_command_exit_value = wait_for (pid); + last_command_subst_pid = pid; + last_made_pid = old_pid; + +#if defined (JOB_CONTROL) + /* If last_command_exit_value > 128, then the substituted command + was terminated by a signal. If that signal was SIGINT, then send + SIGINT to ourselves. This will break out of loops, for instance. */ + if (last_command_exit_value == (128 + SIGINT) && last_command_exit_signal == SIGINT) + kill (getpid (), SIGINT); + + /* wait_for gives the terminal back to shell_pgrp. If some other + process group should have it, give it away to that group here. + pipeline_pgrp is non-zero only while we are constructing a + pipeline, so what we are concerned about is whether or not that + pipeline was started in the background. A pipeline started in + the background should never get the tty back here. */ + if (interactive && pipeline_pgrp != (pid_t)0 && (subshell_environment & SUBSHELL_ASYNC) == 0) + give_terminal_to (pipeline_pgrp, 0); +#endif /* JOB_CONTROL */ + + ret = alloc_word_desc (); + ret->word = istring; + ret->flags = tflag; + + return ret; + } +} + +/******************************************************** + * * + * Utility functions for parameter expansion * + * * + ********************************************************/ + +#if defined (ARRAY_VARS) + +static arrayind_t +array_length_reference (s) + char *s; +{ + int len; + arrayind_t ind; + char *akey; + char *t, c; + ARRAY *array; + HASH_TABLE *h; + SHELL_VAR *var; + + var = array_variable_part (s, &t, &len); + + /* If unbound variables should generate an error, report one and return + failure. */ + if ((var == 0 || invisible_p (var) || (assoc_p (var) == 0 && array_p (var) == 0)) && unbound_vars_is_error) + { + c = *--t; + *t = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (s); + *t = c; + return (-1); + } + else if (var == 0 || invisible_p (var)) + return 0; + + /* We support a couple of expansions for variables that are not arrays. + We'll return the length of the value for v[0], and 1 for v[@] or + v[*]. Return 0 for everything else. */ + + array = array_p (var) ? array_cell (var) : (ARRAY *)NULL; + h = assoc_p (var) ? assoc_cell (var) : (HASH_TABLE *)NULL; + + if (ALL_ELEMENT_SUB (t[0]) && t[1] == ']') + { + if (assoc_p (var)) + return (h ? assoc_num_elements (h) : 0); + else if (array_p (var)) + return (array ? array_num_elements (array) : 0); + else + return (var_isset (var) ? 1 : 0); + } + + if (assoc_p (var)) + { + t[len - 1] = '\0'; + akey = expand_assignment_string_to_string (t, 0); /* [ */ + t[len - 1] = ']'; + if (akey == 0 || *akey == 0) + { + err_badarraysub (t); + FREE (akey); + return (-1); + } + t = assoc_reference (assoc_cell (var), akey); + free (akey); + } + else + { + ind = array_expand_index (var, t, len); + /* negative subscripts to indexed arrays count back from end */ + if (var && array_p (var) && ind < 0) + ind = array_max_index (array_cell (var)) + 1 + ind; + if (ind < 0) + { + err_badarraysub (t); + return (-1); + } + if (array_p (var)) + t = array_reference (array, ind); + else + t = (ind == 0) ? value_cell (var) : (char *)NULL; + } + + len = MB_STRLEN (t); + return (len); +} +#endif /* ARRAY_VARS */ + +static int +valid_brace_expansion_word (name, var_is_special) + char *name; + int var_is_special; +{ + if (DIGIT (*name) && all_digits (name)) + return 1; + else if (var_is_special) + return 1; +#if defined (ARRAY_VARS) + else if (valid_array_reference (name)) + return 1; +#endif /* ARRAY_VARS */ + else if (legal_identifier (name)) + return 1; + else + return 0; +} + +static int +chk_atstar (name, quoted, quoted_dollar_atp, contains_dollar_at) + char *name; + int quoted; + int *quoted_dollar_atp, *contains_dollar_at; +{ + char *temp1; + + if (name == 0) + { + if (quoted_dollar_atp) + *quoted_dollar_atp = 0; + if (contains_dollar_at) + *contains_dollar_at = 0; + return 0; + } + + /* check for $@ and $* */ + if (name[0] == '@' && name[1] == 0) + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } + else if (name[0] == '*' && name[1] == '\0' && quoted == 0) + { + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } + + /* Now check for ${array[@]} and ${array[*]} */ +#if defined (ARRAY_VARS) + else if (valid_array_reference (name)) + { + temp1 = mbschr (name, '['); + if (temp1 && temp1[1] == '@' && temp1[2] == ']') + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } /* [ */ + /* ${array[*]}, when unquoted, should be treated like ${array[@]}, + which should result in separate words even when IFS is unset. */ + if (temp1 && temp1[1] == '*' && temp1[2] == ']' && quoted == 0) + { + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } + } +#endif + return 0; +} + +/* Parameter expand NAME, and return a new string which is the expansion, + or NULL if there was no expansion. + VAR_IS_SPECIAL is non-zero if NAME is one of the special variables in + the shell, e.g., "@", "$", "*", etc. QUOTED, if non-zero, means that + NAME was found inside of a double-quoted expression. */ +static WORD_DESC * +parameter_brace_expand_word (name, var_is_special, quoted, pflags, indp) + char *name; + int var_is_special, quoted, pflags; + arrayind_t *indp; +{ + WORD_DESC *ret; + char *temp, *tt; + intmax_t arg_index; + SHELL_VAR *var; + int atype, rflags; + arrayind_t ind; + + ret = 0; + temp = 0; + rflags = 0; + + if (indp) + *indp = INTMAX_MIN; + + /* Handle multiple digit arguments, as in ${11}. */ + if (legal_number (name, &arg_index)) + { + tt = get_dollar_var_value (arg_index); + if (tt) + temp = (*tt && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + ? quote_string (tt) + : quote_escapes (tt); + else + temp = (char *)NULL; + FREE (tt); + } + else if (var_is_special) /* ${@} */ + { + int sindex; + tt = (char *)xmalloc (2 + strlen (name)); + tt[sindex = 0] = '$'; + strcpy (tt + 1, name); + + ret = param_expand (tt, &sindex, quoted, (int *)NULL, (int *)NULL, + (int *)NULL, (int *)NULL, pflags); + free (tt); + } +#if defined (ARRAY_VARS) + else if (valid_array_reference (name)) + { +expand_arrayref: + /* XXX - does this leak if name[@] or name[*]? */ + if (pflags & PF_ASSIGNRHS) + { + temp = array_variable_name (name, &tt, (int *)0); + if (ALL_ELEMENT_SUB (tt[0]) && tt[1] == ']') + temp = array_value (name, quoted|Q_DOUBLE_QUOTES, 0, &atype, &ind); + else + temp = array_value (name, quoted, 0, &atype, &ind); + } + else + temp = array_value (name, quoted, 0, &atype, &ind); + if (atype == 0 && temp) + { + temp = (*temp && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + ? quote_string (temp) + : quote_escapes (temp); + rflags |= W_ARRAYIND; + if (indp) + *indp = ind; + } + else if (atype == 1 && temp && QUOTED_NULL (temp) && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + rflags |= W_HASQUOTEDNULL; + } +#endif + else if (var = find_variable (name)) + { + if (var_isset (var) && invisible_p (var) == 0) + { +#if defined (ARRAY_VARS) + if (assoc_p (var)) + temp = assoc_reference (assoc_cell (var), "0"); + else if (array_p (var)) + temp = array_reference (array_cell (var), 0); + else + temp = value_cell (var); +#else + temp = value_cell (var); +#endif + + if (temp) + temp = (*temp && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + ? quote_string (temp) + : quote_escapes (temp); + } + else + temp = (char *)NULL; + } + else if (var = find_variable_last_nameref (name)) + { + temp = nameref_cell (var); +#if defined (ARRAY_VARS) + /* Handle expanding nameref whose value is x[n] */ + if (temp && *temp && valid_array_reference (temp)) + { + name = temp; + goto expand_arrayref; + } + else +#endif + /* y=2 ; typeset -n x=y; echo ${x} is not the same as echo ${2} in ksh */ + if (temp && *temp && legal_identifier (temp) == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("%s: invalid variable name for name reference"), temp); + temp = &expand_param_error; + } + else + temp = (char *)NULL; + } + else + temp = (char *)NULL; + + if (ret == 0) + { + ret = alloc_word_desc (); + ret->word = temp; + ret->flags |= rflags; + } + return ret; +} + +static char * +parameter_brace_find_indir (name, var_is_special, quoted, find_nameref) + char *name; + int var_is_special, quoted, find_nameref; +{ + char *temp, *t; + WORD_DESC *w; + SHELL_VAR *v; + + if (find_nameref && var_is_special == 0 && (v = find_variable_last_nameref (name)) && + nameref_p (v) && (t = nameref_cell (v)) && *t) + return (savestring (t)); + + /* If var_is_special == 0, and name is not an array reference, this does + more expansion than necessary. It should really look up the variable's + value and not try to expand it. */ + w = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND, 0); + t = w->word; + /* Have to dequote here if necessary */ + if (t) + { + temp = (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + ? dequote_string (t) + : dequote_escapes (t); + free (t); + t = temp; + } + dispose_word_desc (w); + + return t; +} + +/* Expand an indirect reference to a variable: ${!NAME} expands to the + value of the variable whose name is the value of NAME. */ +static WORD_DESC * +parameter_brace_expand_indir (name, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at) + char *name; + int var_is_special, quoted; + int *quoted_dollar_atp, *contains_dollar_at; +{ + char *temp, *t; + WORD_DESC *w; + SHELL_VAR *v; + + /* See if it's a nameref first, behave in ksh93-compatible fashion. + There is at least one incompatibility: given ${!foo[0]} where foo=bar, + bash performs an indirect lookup on foo[0] and expands the result; + ksh93 expands bar[0]. We could do that here -- there are enough usable + primitives to do that -- but do not at this point. */ + if (var_is_special == 0 && (v = find_variable_last_nameref (name))) + { + if (nameref_p (v) && (t = nameref_cell (v)) && *t) + { + w = alloc_word_desc (); + w->word = savestring (t); + w->flags = 0; + return w; + } + } + + t = parameter_brace_find_indir (name, var_is_special, quoted, 0); + + chk_atstar (t, quoted, quoted_dollar_atp, contains_dollar_at); + if (t == 0) + return (WORD_DESC *)NULL; + + w = parameter_brace_expand_word (t, SPECIAL_VAR(t, 0), quoted, 0, 0); + free (t); + + return w; +} + +/* Expand the right side of a parameter expansion of the form ${NAMEcVALUE}, + depending on the value of C, the separating character. C can be one of + "-", "+", or "=". QUOTED is true if the entire brace expression occurs + between double quotes. */ +static WORD_DESC * +parameter_brace_expand_rhs (name, value, c, quoted, qdollaratp, hasdollarat) + char *name, *value; + int c, quoted, *qdollaratp, *hasdollarat; +{ + WORD_DESC *w; + WORD_LIST *l; + char *t, *t1, *temp; + int hasdol; + + /* If the entire expression is between double quotes, we want to treat + the value as a double-quoted string, with the exception that we strip + embedded unescaped double quotes (for sh backwards compatibility). */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && *value) + { + hasdol = 0; + temp = string_extract_double_quoted (value, &hasdol, 1); + } + else + temp = value; + + w = alloc_word_desc (); + hasdol = 0; + /* XXX was 0 not quoted */ + l = *temp ? expand_string_for_rhs (temp, quoted, &hasdol, (int *)NULL) + : (WORD_LIST *)0; + if (hasdollarat) + *hasdollarat = hasdol || (l && l->next); + if (temp != value) + free (temp); + if (l) + { + /* The expansion of TEMP returned something. We need to treat things + slightly differently if HASDOL is non-zero. If we have "$@", the + individual words have already been quoted. We need to turn them + into a string with the words separated by the first character of + $IFS without any additional quoting, so string_list_dollar_at won't + do the right thing. We use string_list_dollar_star instead. */ + temp = (hasdol || l->next) ? string_list_dollar_star (l) : string_list (l); + + /* If l->next is not null, we know that TEMP contained "$@", since that + is the only expansion that creates more than one word. */ + if (qdollaratp && ((hasdol && quoted) || l->next)) + *qdollaratp = 1; + /* If we have a quoted null result (QUOTED_NULL(temp)) and the word is + a quoted null (l->next == 0 && QUOTED_NULL(l->word->word)), the + flags indicate it (l->word->flags & W_HASQUOTEDNULL), and the + expansion is quoted (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + (which is more paranoia than anything else), we need to return the + quoted null string and set the flags to indicate it. */ + if (l->next == 0 && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && QUOTED_NULL (temp) && QUOTED_NULL (l->word->word) && (l->word->flags & W_HASQUOTEDNULL)) + { + w->flags |= W_HASQUOTEDNULL; + } + dispose_words (l); + } + else if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && hasdol) + { + /* The brace expansion occurred between double quotes and there was + a $@ in TEMP. It does not matter if the $@ is quoted, as long as + it does not expand to anything. In this case, we want to return + a quoted empty string. */ + temp = make_quoted_char ('\0'); + w->flags |= W_HASQUOTEDNULL; + } + else + temp = (char *)NULL; + + if (c == '-' || c == '+') + { + w->word = temp; + return w; + } + + /* c == '=' */ + t = temp ? savestring (temp) : savestring (""); + t1 = dequote_string (t); + free (t); +#if defined (ARRAY_VARS) + if (valid_array_reference (name)) + assign_array_element (name, t1, 0); + else +#endif /* ARRAY_VARS */ + bind_variable (name, t1, 0); +#if 0 + if (STREQ (name, "IFS") == 0) +#endif + stupidly_hack_special_variables (name); + + /* From Posix group discussion Feb-March 2010. Issue 7 0000221 */ + free (temp); + + w->word = t1; + return w; +} + +/* Deal with the right hand side of a ${name:?value} expansion in the case + that NAME is null or not set. If VALUE is non-null it is expanded and + used as the error message to print, otherwise a standard message is + printed. */ +static void +parameter_brace_expand_error (name, value) + char *name, *value; +{ + WORD_LIST *l; + char *temp; + + last_command_exit_value = EXECUTION_FAILURE; /* ensure it's non-zero */ + if (value && *value) + { + l = expand_string (value, 0); + temp = string_list (l); + report_error ("%s: %s", name, temp ? temp : ""); /* XXX was value not "" */ + FREE (temp); + dispose_words (l); + } + else + report_error (_("%s: parameter null or not set"), name); + + /* Free the data we have allocated during this expansion, since we + are about to longjmp out. */ + free (name); + FREE (value); +} + +/* Return 1 if NAME is something for which parameter_brace_expand_length is + OK to do. */ +static int +valid_length_expression (name) + char *name; +{ + return (name[1] == '\0' || /* ${#} */ + ((sh_syntaxtab[(unsigned char) name[1]] & CSPECVAR) && name[2] == '\0') || /* special param */ + (DIGIT (name[1]) && all_digits (name + 1)) || /* ${#11} */ +#if defined (ARRAY_VARS) + valid_array_reference (name + 1) || /* ${#a[7]} */ +#endif + legal_identifier (name + 1)); /* ${#PS1} */ +} + +/* Handle the parameter brace expansion that requires us to return the + length of a parameter. */ +static intmax_t +parameter_brace_expand_length (name) + char *name; +{ + char *t, *newname; + intmax_t number, arg_index; + WORD_LIST *list; +#if defined (ARRAY_VARS) + SHELL_VAR *var; +#endif + + if (name[1] == '\0') /* ${#} */ + number = number_of_args (); + else if ((name[1] == '@' || name[1] == '*') && name[2] == '\0') /* ${#@}, ${#*} */ + number = number_of_args (); + else if ((sh_syntaxtab[(unsigned char) name[1]] & CSPECVAR) && name[2] == '\0') + { + /* Take the lengths of some of the shell's special parameters. */ + switch (name[1]) + { + case '-': + t = which_set_flags (); + break; + case '?': + t = itos (last_command_exit_value); + break; + case '$': + t = itos (dollar_dollar_pid); + break; + case '!': + if (last_asynchronous_pid == NO_PID) + t = (char *)NULL; /* XXX - error if set -u set? */ + else + t = itos (last_asynchronous_pid); + break; + case '#': + t = itos (number_of_args ()); + break; + } + number = STRLEN (t); + FREE (t); + } +#if defined (ARRAY_VARS) + else if (valid_array_reference (name + 1)) + number = array_length_reference (name + 1); +#endif /* ARRAY_VARS */ + else + { + number = 0; + + if (legal_number (name + 1, &arg_index)) /* ${#1} */ + { + t = get_dollar_var_value (arg_index); + if (t == 0 && unbound_vars_is_error) + return INTMAX_MIN; + number = MB_STRLEN (t); + FREE (t); + } +#if defined (ARRAY_VARS) + else if ((var = find_variable (name + 1)) && (invisible_p (var) == 0) && (array_p (var) || assoc_p (var))) + { + if (assoc_p (var)) + t = assoc_reference (assoc_cell (var), "0"); + else + t = array_reference (array_cell (var), 0); + if (t == 0 && unbound_vars_is_error) + return INTMAX_MIN; + number = MB_STRLEN (t); + } +#endif + else /* ${#PS1} */ + { + newname = savestring (name); + newname[0] = '$'; + list = expand_string (newname, Q_DOUBLE_QUOTES); + t = list ? string_list (list) : (char *)NULL; + free (newname); + if (list) + dispose_words (list); + + number = t ? MB_STRLEN (t) : 0; + FREE (t); + } + } + + return (number); +} + +/* Skip characters in SUBSTR until DELIM. SUBSTR is an arithmetic expression, + so we do some ad-hoc parsing of an arithmetic expression to find + the first DELIM, instead of using strchr(3). Two rules: + 1. If the substring contains a `(', read until closing `)'. + 2. If the substring contains a `?', read past one `:' for each `?'. +*/ + +static char * +skiparith (substr, delim) + char *substr; + int delim; +{ + size_t sublen; + int skipcol, pcount, i; + DECLARE_MBSTATE; + + sublen = strlen (substr); + i = skipcol = pcount = 0; + while (substr[i]) + { + /* Balance parens */ + if (substr[i] == LPAREN) + { + pcount++; + i++; + continue; + } + if (substr[i] == RPAREN && pcount) + { + pcount--; + i++; + continue; + } + if (pcount) + { + ADVANCE_CHAR (substr, sublen, i); + continue; + } + + /* Skip one `:' for each `?' */ + if (substr[i] == ':' && skipcol) + { + skipcol--; + i++; + continue; + } + if (substr[i] == delim) + break; + if (substr[i] == '?') + { + skipcol++; + i++; + continue; + } + ADVANCE_CHAR (substr, sublen, i); + } + + return (substr + i); +} + +/* Verify and limit the start and end of the desired substring. If + VTYPE == 0, a regular shell variable is being used; if it is 1, + then the positional parameters are being used; if it is 2, then + VALUE is really a pointer to an array variable that should be used. + Return value is 1 if both values were OK, 0 if there was a problem + with an invalid expression, or -1 if the values were out of range. */ +static int +verify_substring_values (v, value, substr, vtype, e1p, e2p) + SHELL_VAR *v; + char *value, *substr; + int vtype; + intmax_t *e1p, *e2p; +{ + char *t, *temp1, *temp2; + arrayind_t len; + int expok; +#if defined (ARRAY_VARS) + ARRAY *a; + HASH_TABLE *h; +#endif + + /* duplicate behavior of strchr(3) */ + t = skiparith (substr, ':'); + if (*t && *t == ':') + *t = '\0'; + else + t = (char *)0; + + temp1 = expand_arith_string (substr, Q_DOUBLE_QUOTES); + *e1p = evalexp (temp1, &expok); + free (temp1); + if (expok == 0) + return (0); + + len = -1; /* paranoia */ + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + len = MB_STRLEN (value); + break; + case VT_POSPARMS: + len = number_of_args () + 1; + if (*e1p == 0) + len++; /* add one arg if counting from $0 */ + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + /* For arrays, the first value deals with array indices. Negative + offsets count from one past the array's maximum index. Associative + arrays treat the number of elements as the maximum index. */ + if (assoc_p (v)) + { + h = assoc_cell (v); + len = assoc_num_elements (h) + (*e1p < 0); + } + else + { + a = (ARRAY *)value; + len = array_max_index (a) + (*e1p < 0); /* arrays index from 0 to n - 1 */ + } + break; +#endif + } + + if (len == -1) /* paranoia */ + return -1; + + if (*e1p < 0) /* negative offsets count from end */ + *e1p += len; + + if (*e1p > len || *e1p < 0) + return (-1); + +#if defined (ARRAY_VARS) + /* For arrays, the second offset deals with the number of elements. */ + if (vtype == VT_ARRAYVAR) + len = assoc_p (v) ? assoc_num_elements (h) : array_num_elements (a); +#endif + + if (t) + { + t++; + temp2 = savestring (t); + temp1 = expand_arith_string (temp2, Q_DOUBLE_QUOTES); + free (temp2); + t[-1] = ':'; + *e2p = evalexp (temp1, &expok); + free (temp1); + if (expok == 0) + return (0); +#if 1 + if ((vtype == VT_ARRAYVAR || vtype == VT_POSPARMS) && *e2p < 0) +#else + /* bash-4.3: allow positional parameter length < 0 to count backwards + from end of positional parameters */ + if (vtype == VT_ARRAYVAR && *e2p < 0) +#endif + { + internal_error (_("%s: substring expression < 0"), t); + return (0); + } +#if defined (ARRAY_VARS) + /* In order to deal with sparse arrays, push the intelligence about how + to deal with the number of elements desired down to the array- + specific functions. */ + if (vtype != VT_ARRAYVAR) +#endif + { + if (*e2p < 0) + { + *e2p += len; + if (*e2p < 0 || *e2p < *e1p) + { + internal_error (_("%s: substring expression < 0"), t); + return (0); + } + } + else + *e2p += *e1p; /* want E2 chars starting at E1 */ + if (*e2p > len) + *e2p = len; + } + } + else + *e2p = len; + + return (1); +} + +/* Return the type of variable specified by VARNAME (simple variable, + positional param, or array variable). Also return the value specified + by VARNAME (value of a variable or a reference to an array element). + QUOTED is the standard description of quoting state, using Q_* defines. + FLAGS is currently a set of flags to pass to array_value. If IND is + non-null and not INTMAX_MIN, and FLAGS includes AV_USEIND, IND is + passed to array_value so the array index is not computed again. + If this returns VT_VARIABLE, the caller assumes that CTLESC and CTLNUL + characters in the value are quoted with CTLESC and takes appropriate + steps. For convenience, *VALP is set to the dequoted VALUE. */ +static int +get_var_and_type (varname, value, ind, quoted, flags, varp, valp) + char *varname, *value; + arrayind_t ind; + int quoted, flags; + SHELL_VAR **varp; + char **valp; +{ + int vtype, want_indir; + char *temp, *vname; + WORD_DESC *wd; +#if defined (ARRAY_VARS) + SHELL_VAR *v; +#endif + arrayind_t lind; + + want_indir = *varname == '!' && + (legal_variable_starter ((unsigned char)varname[1]) || DIGIT (varname[1]) + || VALID_INDIR_PARAM (varname[1])); + if (want_indir) + vname = parameter_brace_find_indir (varname+1, SPECIAL_VAR (varname, 1), quoted, 1); + else + vname = varname; + + /* This sets vtype to VT_VARIABLE or VT_POSPARMS */ + vtype = (vname[0] == '@' || vname[0] == '*') && vname[1] == '\0'; + if (vtype == VT_POSPARMS && vname[0] == '*') + vtype |= VT_STARSUB; + *varp = (SHELL_VAR *)NULL; + +#if defined (ARRAY_VARS) + if (valid_array_reference (vname)) + { + v = array_variable_part (vname, &temp, (int *)0); + /* If we want to signal array_value to use an already-computed index, + set LIND to that index */ + lind = (ind != INTMAX_MIN && (flags & AV_USEIND)) ? ind : 0; + if (v && invisible_p (v)) + { + vtype = VT_ARRAYMEMBER; + *varp = (SHELL_VAR *)NULL; + *valp = (char *)NULL; + } + if (v && (array_p (v) || assoc_p (v))) + { /* [ */ + if (ALL_ELEMENT_SUB (temp[0]) && temp[1] == ']') + { + /* Callers have to differentiate between indexed and associative */ + vtype = VT_ARRAYVAR; + if (temp[0] == '*') + vtype |= VT_STARSUB; + *valp = array_p (v) ? (char *)array_cell (v) : (char *)assoc_cell (v); + } + else + { + vtype = VT_ARRAYMEMBER; + *valp = array_value (vname, Q_DOUBLE_QUOTES, flags, (int *)NULL, &lind); + } + *varp = v; + } + else if (v && (ALL_ELEMENT_SUB (temp[0]) && temp[1] == ']')) + { + vtype = VT_VARIABLE; + *varp = v; + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + *valp = dequote_string (value); + else + *valp = dequote_escapes (value); + } + else + { + vtype = VT_ARRAYMEMBER; + *varp = v; + *valp = array_value (vname, Q_DOUBLE_QUOTES, flags, (int *)NULL, &lind); + } + } + else if ((v = find_variable (vname)) && (invisible_p (v) == 0) && (assoc_p (v) || array_p (v))) + { + vtype = VT_ARRAYMEMBER; + *varp = v; + *valp = assoc_p (v) ? assoc_reference (assoc_cell (v), "0") : array_reference (array_cell (v), 0); + } + else +#endif + { + if (value && vtype == VT_VARIABLE) + { + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + *valp = dequote_string (value); + else + *valp = dequote_escapes (value); + } + else + *valp = value; + } + + if (want_indir) + free (vname); + + return vtype; +} + +/******************************************************/ +/* */ +/* Functions to extract substrings of variable values */ +/* */ +/******************************************************/ + +#if defined (HANDLE_MULTIBYTE) +/* Character-oriented rather than strictly byte-oriented substrings. S and + E, rather being strict indices into STRING, indicate character (possibly + multibyte character) positions that require calculation. + Used by the ${param:offset[:length]} expansion. */ +static char * +mb_substring (string, s, e) + char *string; + int s, e; +{ + char *tt; + int start, stop, i, slen; + DECLARE_MBSTATE; + + start = 0; + /* Don't need string length in ADVANCE_CHAR unless multibyte chars possible. */ + slen = (MB_CUR_MAX > 1) ? STRLEN (string) : 0; + + i = s; + while (string[start] && i--) + ADVANCE_CHAR (string, slen, start); + stop = start; + i = e - s; + while (string[stop] && i--) + ADVANCE_CHAR (string, slen, stop); + tt = substring (string, start, stop); + return tt; +} +#endif + +/* Process a variable substring expansion: ${name:e1[:e2]}. If VARNAME + is `@', use the positional parameters; otherwise, use the value of + VARNAME. If VARNAME is an array variable, use the array elements. */ + +static char * +parameter_brace_substring (varname, value, ind, substr, quoted, flags) + char *varname, *value; + int ind; + char *substr; + int quoted, flags; +{ + intmax_t e1, e2; + int vtype, r, starsub; + char *temp, *val, *tt, *oname; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + oname = this_command_name; + this_command_name = varname; + + vtype = get_var_and_type (varname, value, ind, quoted, flags, &v, &val); + if (vtype == -1) + { + this_command_name = oname; + return ((char *)NULL); + } + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + r = verify_substring_values (v, val, substr, vtype, &e1, &e2); + this_command_name = oname; + if (r <= 0) + { + if (vtype == VT_VARIABLE) + FREE (val); + return ((r == 0) ? &expand_param_error : (char *)NULL); + } + + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1) + tt = mb_substring (val, e1, e2); + else +#endif + tt = substring (val, e1, e2); + + if (vtype == VT_VARIABLE) + FREE (val); + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + temp = quote_string (tt); + else + temp = tt ? quote_escapes (tt) : (char *)NULL; + FREE (tt); + break; + case VT_POSPARMS: + tt = pos_params (varname, e1, e2, quoted); + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) == 0) + { + temp = tt ? quote_escapes (tt) : (char *)NULL; + FREE (tt); + } + else + temp = tt; + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + if (assoc_p (v)) + /* we convert to list and take first e2 elements starting at e1th + element -- officially undefined for now */ + temp = assoc_subrange (assoc_cell (v), e1, e2, starsub, quoted); + else + /* We want E2 to be the number of elements desired (arrays can be sparse, + so verify_substring_values just returns the numbers specified and we + rely on array_subrange to understand how to deal with them). */ + temp = array_subrange (array_cell (v), e1, e2, starsub, quoted); + /* array_subrange now calls array_quote_escapes as appropriate, so the + caller no longer needs to. */ + break; +#endif + default: + temp = (char *)NULL; + } + + return temp; +} + +/****************************************************************/ +/* */ +/* Functions to perform pattern substitution on variable values */ +/* */ +/****************************************************************/ + +static int +shouldexp_replacement (s) + char *s; +{ + register char *p; + + for (p = s; p && *p; p++) + { + if (*p == '\\') + p++; + else if (*p == '&') + return 1; + } + return 0; +} + +char * +pat_subst (string, pat, rep, mflags) + char *string, *pat, *rep; + int mflags; +{ + char *ret, *s, *e, *str, *rstr, *mstr; + int rsize, rptr, l, replen, mtype, rxpand, rslen, mlen; + + if (string == 0) + return (savestring ("")); + + mtype = mflags & MATCH_TYPEMASK; + +#if 0 /* bash-4.2 ? */ + rxpand = (rep && *rep) ? shouldexp_replacement (rep) : 0; +#else + rxpand = 0; +#endif + + /* Special cases: + * 1. A null pattern with mtype == MATCH_BEG means to prefix STRING + * with REP and return the result. + * 2. A null pattern with mtype == MATCH_END means to append REP to + * STRING and return the result. + * These don't understand or process `&' in the replacement string. + */ + if ((pat == 0 || *pat == 0) && (mtype == MATCH_BEG || mtype == MATCH_END)) + { + replen = STRLEN (rep); + l = STRLEN (string); + ret = (char *)xmalloc (replen + l + 2); + if (replen == 0) + strcpy (ret, string); + else if (mtype == MATCH_BEG) + { + strcpy (ret, rep); + strcpy (ret + replen, string); + } + else + { + strcpy (ret, string); + strcpy (ret + l, rep); + } + return (ret); + } + + ret = (char *)xmalloc (rsize = 64); + ret[0] = '\0'; + + for (replen = STRLEN (rep), rptr = 0, str = string;;) + { + if (match_pattern (str, pat, mtype, &s, &e) == 0) + break; + l = s - str; + + if (rxpand) + { + int x; + mlen = e - s; + mstr = xmalloc (mlen + 1); + for (x = 0; x < mlen; x++) + mstr[x] = s[x]; + mstr[mlen] = '\0'; + rstr = strcreplace (rep, '&', mstr, 0); + rslen = strlen (rstr); + } + else + { + rstr = rep; + rslen = replen; + } + + RESIZE_MALLOCED_BUFFER (ret, rptr, (l + rslen), rsize, 64); + + /* OK, now copy the leading unmatched portion of the string (from + str to s) to ret starting at rptr (the current offset). Then copy + the replacement string at ret + rptr + (s - str). Increment + rptr (if necessary) and str and go on. */ + if (l) + { + strncpy (ret + rptr, str, l); + rptr += l; + } + if (replen) + { + strncpy (ret + rptr, rstr, rslen); + rptr += rslen; + } + str = e; /* e == end of match */ + + if (rstr != rep) + free (rstr); + + if (((mflags & MATCH_GLOBREP) == 0) || mtype != MATCH_ANY) + break; + + if (s == e) + { + /* On a zero-length match, make sure we copy one character, since + we increment one character to avoid infinite recursion. */ + RESIZE_MALLOCED_BUFFER (ret, rptr, 1, rsize, 64); + ret[rptr++] = *str++; + e++; /* avoid infinite recursion on zero-length match */ + } + } + + /* Now copy the unmatched portion of the input string */ + if (str && *str) + { + RESIZE_MALLOCED_BUFFER (ret, rptr, STRLEN(str) + 1, rsize, 64); + strcpy (ret + rptr, str); + } + else + ret[rptr] = '\0'; + + return ret; +} + +/* Do pattern match and replacement on the positional parameters. */ +static char * +pos_params_pat_subst (string, pat, rep, mflags) + char *string, *pat, *rep; + int mflags; +{ + WORD_LIST *save, *params; + WORD_DESC *w; + char *ret; + int pchar, qflags; + + save = params = list_rest_of_args (); + if (save == 0) + return ((char *)NULL); + + for ( ; params; params = params->next) + { + ret = pat_subst (params->word->word, pat, rep, mflags); + w = alloc_word_desc (); + w->word = ret ? ret : savestring (""); + dispose_word (params->word); + params->word = w; + } + + pchar = (mflags & MATCH_STARSUB) == MATCH_STARSUB ? '*' : '@'; + qflags = (mflags & MATCH_QUOTED) == MATCH_QUOTED ? Q_DOUBLE_QUOTES : 0; + + ret = string_list_pos_params (pchar, save, qflags); + + dispose_words (save); + + return (ret); +} + +/* Perform pattern substitution on VALUE, which is the expansion of + VARNAME. PATSUB is an expression supplying the pattern to match + and the string to substitute. QUOTED is a flags word containing + the type of quoting currently in effect. */ +static char * +parameter_brace_patsub (varname, value, ind, patsub, quoted, flags) + char *varname, *value; + int ind; + char *patsub; + int quoted, flags; +{ + int vtype, mflags, starsub, delim; + char *val, *temp, *pat, *rep, *p, *lpatsub, *tt; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + this_command_name = varname; + + vtype = get_var_and_type (varname, value, ind, quoted, flags, &v, &val); + if (vtype == -1) + return ((char *)NULL); + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + mflags = 0; + /* PATSUB is never NULL when this is called. */ + if (*patsub == '/') + { + mflags |= MATCH_GLOBREP; + patsub++; + } + + /* Malloc this because expand_string_if_necessary or one of the expansion + functions in its call chain may free it on a substitution error. */ + lpatsub = savestring (patsub); + + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + mflags |= MATCH_QUOTED; + + if (starsub) + mflags |= MATCH_STARSUB; + + /* If the pattern starts with a `/', make sure we skip over it when looking + for the replacement delimiter. */ + delim = skip_to_delim (lpatsub, ((*patsub == '/') ? 1 : 0), "/", 0); + if (lpatsub[delim] == '/') + { + lpatsub[delim] = 0; + rep = lpatsub + delim + 1; + } + else + rep = (char *)NULL; + + if (rep && *rep == '\0') + rep = (char *)NULL; + + /* Perform the same expansions on the pattern as performed by the + pattern removal expansions. */ + pat = getpattern (lpatsub, quoted, 1); + + if (rep) + { + /* We want to perform quote removal on the expanded replacement even if + the entire expansion is double-quoted because the parser and string + extraction functions treated quotes in the replacement string as + special. THIS IS NOT BACKWARDS COMPATIBLE WITH BASH-4.2. */ + if (shell_compatibility_level > 42) + rep = expand_string_if_necessary (rep, quoted & ~(Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT), expand_string_unsplit); + /* This is the bash-4.2 code. */ + else if ((mflags & MATCH_QUOTED) == 0) + rep = expand_string_if_necessary (rep, quoted, expand_string_unsplit); + else + rep = expand_string_to_string_internal (rep, quoted, expand_string_unsplit); + } + + /* ksh93 doesn't allow the match specifier to be a part of the expanded + pattern. This is an extension. Make sure we don't anchor the pattern + at the beginning or end of the string if we're doing global replacement, + though. */ + p = pat; + if (mflags & MATCH_GLOBREP) + mflags |= MATCH_ANY; + else if (pat && pat[0] == '#') + { + mflags |= MATCH_BEG; + p++; + } + else if (pat && pat[0] == '%') + { + mflags |= MATCH_END; + p++; + } + else + mflags |= MATCH_ANY; + + /* OK, we now want to substitute REP for PAT in VAL. If + flags & MATCH_GLOBREP is non-zero, the substitution is done + everywhere, otherwise only the first occurrence of PAT is + replaced. The pattern matching code doesn't understand + CTLESC quoting CTLESC and CTLNUL so we use the dequoted variable + values passed in (VT_VARIABLE) so the pattern substitution + code works right. We need to requote special chars after + we're done for VT_VARIABLE and VT_ARRAYMEMBER, and for the + other cases if QUOTED == 0, since the posparams and arrays + indexed by * or @ do special things when QUOTED != 0. */ + + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + temp = pat_subst (val, p, rep, mflags); + if (vtype == VT_VARIABLE) + FREE (val); + if (temp) + { + tt = (mflags & MATCH_QUOTED) ? quote_string (temp) : quote_escapes (temp); + free (temp); + temp = tt; + } + break; + case VT_POSPARMS: + temp = pos_params_pat_subst (val, p, rep, mflags); + if (temp && (mflags & MATCH_QUOTED) == 0) + { + tt = quote_escapes (temp); + free (temp); + temp = tt; + } + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + temp = assoc_p (v) ? assoc_patsub (assoc_cell (v), p, rep, mflags) + : array_patsub (array_cell (v), p, rep, mflags); + /* Don't call quote_escapes anymore; array_patsub calls + array_quote_escapes as appropriate before adding the + space separators; ditto for assoc_patsub. */ + break; +#endif + } + + FREE (pat); + FREE (rep); + free (lpatsub); + + return temp; +} + +/****************************************************************/ +/* */ +/* Functions to perform case modification on variable values */ +/* */ +/****************************************************************/ + +/* Do case modification on the positional parameters. */ + +static char * +pos_params_modcase (string, pat, modop, mflags) + char *string, *pat; + int modop; + int mflags; +{ + WORD_LIST *save, *params; + WORD_DESC *w; + char *ret; + int pchar, qflags; + + save = params = list_rest_of_args (); + if (save == 0) + return ((char *)NULL); + + for ( ; params; params = params->next) + { + ret = sh_modcase (params->word->word, pat, modop); + w = alloc_word_desc (); + w->word = ret ? ret : savestring (""); + dispose_word (params->word); + params->word = w; + } + + pchar = (mflags & MATCH_STARSUB) == MATCH_STARSUB ? '*' : '@'; + qflags = (mflags & MATCH_QUOTED) == MATCH_QUOTED ? Q_DOUBLE_QUOTES : 0; + + ret = string_list_pos_params (pchar, save, qflags); + dispose_words (save); + + return (ret); +} + +/* Perform case modification on VALUE, which is the expansion of + VARNAME. MODSPEC is an expression supplying the type of modification + to perform. QUOTED is a flags word containing the type of quoting + currently in effect. */ +static char * +parameter_brace_casemod (varname, value, ind, modspec, patspec, quoted, flags) + char *varname, *value; + int ind, modspec; + char *patspec; + int quoted, flags; +{ + int vtype, starsub, modop, mflags, x; + char *val, *temp, *pat, *p, *lpat, *tt; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + this_command_name = varname; + + vtype = get_var_and_type (varname, value, ind, quoted, flags, &v, &val); + if (vtype == -1) + return ((char *)NULL); + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + modop = 0; + mflags = 0; + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + mflags |= MATCH_QUOTED; + if (starsub) + mflags |= MATCH_STARSUB; + + p = patspec; + if (modspec == '^') + { + x = p && p[0] == modspec; + modop = x ? CASE_UPPER : CASE_UPFIRST; + p += x; + } + else if (modspec == ',') + { + x = p && p[0] == modspec; + modop = x ? CASE_LOWER : CASE_LOWFIRST; + p += x; + } + else if (modspec == '~') + { + x = p && p[0] == modspec; + modop = x ? CASE_TOGGLEALL : CASE_TOGGLE; + p += x; + } + + lpat = p ? savestring (p) : 0; + /* Perform the same expansions on the pattern as performed by the + pattern removal expansions. FOR LATER */ + pat = lpat ? getpattern (lpat, quoted, 1) : 0; + + /* OK, now we do the case modification. */ + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + temp = sh_modcase (val, pat, modop); + if (vtype == VT_VARIABLE) + FREE (val); + if (temp) + { + tt = (mflags & MATCH_QUOTED) ? quote_string (temp) : quote_escapes (temp); + free (temp); + temp = tt; + } + break; + + case VT_POSPARMS: + temp = pos_params_modcase (val, pat, modop, mflags); + if (temp && (mflags & MATCH_QUOTED) == 0) + { + tt = quote_escapes (temp); + free (temp); + temp = tt; + } + break; + +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + temp = assoc_p (v) ? assoc_modcase (assoc_cell (v), pat, modop, mflags) + : array_modcase (array_cell (v), pat, modop, mflags); + /* Don't call quote_escapes; array_modcase calls array_quote_escapes + as appropriate before adding the space separators; ditto for + assoc_modcase. */ + break; +#endif + } + + FREE (pat); + free (lpat); + + return temp; +} + +/* Check for unbalanced parens in S, which is the contents of $(( ... )). If + any occur, this must be a nested command substitution, so return 0. + Otherwise, return 1. A valid arithmetic expression must always have a + ( before a matching ), so any cases where there are more right parens + means that this must not be an arithmetic expression, though the parser + will not accept it without a balanced total number of parens. */ +static int +chk_arithsub (s, len) + const char *s; + int len; +{ + int i, count; + DECLARE_MBSTATE; + + i = count = 0; + while (i < len) + { + if (s[i] == LPAREN) + count++; + else if (s[i] == RPAREN) + { + count--; + if (count < 0) + return 0; + } + + switch (s[i]) + { + default: + ADVANCE_CHAR (s, len, i); + break; + + case '\\': + i++; + if (s[i]) + ADVANCE_CHAR (s, len, i); + break; + + case '\'': + i = skip_single_quoted (s, len, ++i); + break; + + case '"': + i = skip_double_quoted ((char *)s, len, ++i); + break; + } + } + + return (count == 0); +} + +/****************************************************************/ +/* */ +/* Functions to perform parameter expansion on a string */ +/* */ +/****************************************************************/ + +/* ${[#][!]name[[:][^[^]][,[,]]#[#]%[%]-=?+[word][:e1[:e2]]]} */ +static WORD_DESC * +parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, contains_dollar_at) + char *string; + int *indexp, quoted, *quoted_dollar_atp, *contains_dollar_at, pflags; +{ + int check_nullness, var_is_set, var_is_null, var_is_special; + int want_substring, want_indir, want_patsub, want_casemod; + char *name, *value, *temp, *temp1; + WORD_DESC *tdesc, *ret; + int t_index, sindex, c, tflag, modspec; + intmax_t number; + arrayind_t ind; + + temp = temp1 = value = (char *)NULL; + var_is_set = var_is_null = var_is_special = check_nullness = 0; + want_substring = want_indir = want_patsub = want_casemod = 0; + + sindex = *indexp; + t_index = ++sindex; + /* ${#var} doesn't have any of the other parameter expansions on it. */ + if (string[t_index] == '#' && legal_variable_starter (string[t_index+1])) /* {{ */ + name = string_extract (string, &t_index, "}", SX_VARNAME); + else +#if defined (CASEMOD_EXPANSIONS) + /* To enable case-toggling expansions using the `~' operator character + change the 1 to 0. */ +# if defined (CASEMOD_CAPCASE) + name = string_extract (string, &t_index, "#%^,~:-=?+/}", SX_VARNAME); +# else + name = string_extract (string, &t_index, "#%^,:-=?+/}", SX_VARNAME); +# endif /* CASEMOD_CAPCASE */ +#else + name = string_extract (string, &t_index, "#%:-=?+/}", SX_VARNAME); +#endif /* CASEMOD_EXPANSIONS */ + + ret = 0; + tflag = 0; + + ind = INTMAX_MIN; + + /* If the name really consists of a special variable, then make sure + that we have the entire name. We don't allow indirect references + to special variables except `#', `?', `@' and `*'. */ + if ((sindex == t_index && VALID_SPECIAL_LENGTH_PARAM (string[t_index])) || + (sindex == t_index - 1 && string[sindex] == '!' && VALID_INDIR_PARAM (string[t_index]))) + { + t_index++; + temp1 = string_extract (string, &t_index, "#%:-=?+/}", 0); + name = (char *)xrealloc (name, 3 + (strlen (temp1))); + *name = string[sindex]; + if (string[sindex] == '!') + { + /* indirect reference of $#, $?, $@, or $* */ + name[1] = string[sindex + 1]; + strcpy (name + 2, temp1); + } + else + strcpy (name + 1, temp1); + free (temp1); + } + sindex = t_index; + + /* Find out what character ended the variable name. Then + do the appropriate thing. */ + if (c = string[sindex]) + sindex++; + + /* If c is followed by one of the valid parameter expansion + characters, move past it as normal. If not, assume that + a substring specification is being given, and do not move + past it. */ + if (c == ':' && VALID_PARAM_EXPAND_CHAR (string[sindex])) + { + check_nullness++; + if (c = string[sindex]) + sindex++; + } + else if (c == ':' && string[sindex] != RBRACE) + want_substring = 1; + else if (c == '/' /* && string[sindex] != RBRACE */) /* XXX */ + want_patsub = 1; +#if defined (CASEMOD_EXPANSIONS) + else if (c == '^' || c == ',' || c == '~') + { + modspec = c; + want_casemod = 1; + } +#endif + + /* Catch the valid and invalid brace expressions that made it through the + tests above. */ + /* ${#-} is a valid expansion and means to take the length of $-. + Similarly for ${#?} and ${##}... */ + if (name[0] == '#' && name[1] == '\0' && check_nullness == 0 && + VALID_SPECIAL_LENGTH_PARAM (c) && string[sindex] == RBRACE) + { + name = (char *)xrealloc (name, 3); + name[1] = c; + name[2] = '\0'; + c = string[sindex++]; + } + + /* ...but ${#%}, ${#:}, ${#=}, ${#+}, and ${#/} are errors. */ + if (name[0] == '#' && name[1] == '\0' && check_nullness == 0 && + member (c, "%:=+/") && string[sindex] == RBRACE) + { + temp = (char *)NULL; + goto bad_substitution; + } + + /* Indirect expansion begins with a `!'. A valid indirect expansion is + either a variable name, one of the positional parameters or a special + variable that expands to one of the positional parameters. */ + want_indir = *name == '!' && + (legal_variable_starter ((unsigned char)name[1]) || DIGIT (name[1]) + || VALID_INDIR_PARAM (name[1])); + + /* Determine the value of this variable. */ + + /* Check for special variables, directly referenced. */ + if (SPECIAL_VAR (name, want_indir)) + var_is_special++; + + /* Check for special expansion things, like the length of a parameter */ + if (*name == '#' && name[1]) + { + /* If we are not pointing at the character just after the + closing brace, then we haven't gotten all of the name. + Since it begins with a special character, this is a bad + substitution. Also check NAME for validity before trying + to go on. */ + if (string[sindex - 1] != RBRACE || (valid_length_expression (name) == 0)) + { + temp = (char *)NULL; + goto bad_substitution; + } + + number = parameter_brace_expand_length (name); + if (number == INTMAX_MIN && unbound_vars_is_error) + { + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (name+1); + free (name); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + free (name); + + *indexp = sindex; + if (number < 0) + return (&expand_wdesc_error); + else + { + ret = alloc_word_desc (); + ret->word = itos (number); + return ret; + } + } + + /* ${@} is identical to $@. */ + if (name[0] == '@' && name[1] == '\0') + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + + if (contains_dollar_at) + *contains_dollar_at = 1; + + tflag |= W_DOLLARAT; + } + + /* Process ${!PREFIX*} expansion. */ + if (want_indir && string[sindex - 1] == RBRACE && + (string[sindex - 2] == '*' || string[sindex - 2] == '@') && + legal_variable_starter ((unsigned char) name[1])) + { + char **x; + WORD_LIST *xlist; + + temp1 = savestring (name + 1); + number = strlen (temp1); + temp1[number - 1] = '\0'; + x = all_variables_matching_prefix (temp1); + xlist = strvec_to_word_list (x, 0, 0); + if (string[sindex - 2] == '*') + temp = string_list_dollar_star (xlist); + else + { + temp = string_list_dollar_at (xlist, quoted); + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + + tflag |= W_DOLLARAT; + } + free (x); + dispose_words (xlist); + free (temp1); + *indexp = sindex; + + free (name); + + ret = alloc_word_desc (); + ret->word = temp; + ret->flags = tflag; /* XXX */ + return ret; + } + +#if defined (ARRAY_VARS) + /* Process ${!ARRAY[@]} and ${!ARRAY[*]} expansion. */ /* [ */ + if (want_indir && string[sindex - 1] == RBRACE && + string[sindex - 2] == ']' && valid_array_reference (name+1)) + { + char *x, *x1; + + temp1 = savestring (name + 1); + x = array_variable_name (temp1, &x1, (int *)0); /* [ */ + FREE (x); + if (ALL_ELEMENT_SUB (x1[0]) && x1[1] == ']') + { + temp = array_keys (temp1, quoted); /* handles assoc vars too */ + if (x1[0] == '@') + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + + tflag |= W_DOLLARAT; + } + + free (temp1); + *indexp = sindex; + + ret = alloc_word_desc (); + ret->word = temp; + ret->flags = tflag; /* XXX */ + return ret; + } + + free (temp1); + } +#endif /* ARRAY_VARS */ + + /* Make sure that NAME is valid before trying to go on. */ + if (valid_brace_expansion_word (want_indir ? name + 1 : name, + var_is_special) == 0) + { + temp = (char *)NULL; + goto bad_substitution; + } + + if (want_indir) + { + tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at); + /* Turn off the W_ARRAYIND flag because there is no way for this function + to return the index we're supposed to be using. */ + if (tdesc && tdesc->flags) + tdesc->flags &= ~W_ARRAYIND; + } + else + tdesc = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND|(pflags&(PF_NOSPLIT2|PF_ASSIGNRHS)), &ind); + + if (tdesc) + { + temp = tdesc->word; + tflag = tdesc->flags; + dispose_word_desc (tdesc); + } + else + temp = (char *)0; + + if (temp == &expand_param_error || temp == &expand_param_fatal) + { + FREE (name); + FREE (value); + return (temp == &expand_param_error ? &expand_wdesc_error : &expand_wdesc_fatal); + } + +#if defined (ARRAY_VARS) + if (valid_array_reference (name)) + chk_atstar (name, quoted, quoted_dollar_atp, contains_dollar_at); +#endif + + var_is_set = temp != (char *)0; + var_is_null = check_nullness && (var_is_set == 0 || *temp == 0); + /* XXX - this may not need to be restricted to special variables */ + if (check_nullness) + var_is_null |= var_is_set && var_is_special && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && QUOTED_NULL (temp); + + /* Get the rest of the stuff inside the braces. */ + if (c && c != RBRACE) + { + /* Extract the contents of the ${ ... } expansion + according to the Posix.2 rules. */ + value = extract_dollar_brace_string (string, &sindex, quoted, (c == '%' || c == '#' || c =='/' || c == '^' || c == ',' || c ==':') ? SX_POSIXEXP|SX_WORD : SX_WORD); + if (string[sindex] == RBRACE) + sindex++; + else + goto bad_substitution; + } + else + value = (char *)NULL; + + *indexp = sindex; + + /* All the cases where an expansion can possibly generate an unbound + variable error. */ + if (want_substring || want_patsub || want_casemod || c == '#' || c == '%' || c == RBRACE) + { + if (var_is_set == 0 && unbound_vars_is_error && ((name[0] != '@' && name[0] != '*') || name[1])) + { + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (name); + FREE (value); + FREE (temp); + free (name); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + } + + /* If this is a substring spec, process it and add the result. */ + if (want_substring) + { + temp1 = parameter_brace_substring (name, temp, ind, value, quoted, (tflag & W_ARRAYIND) ? AV_USEIND : 0); + FREE (name); + FREE (value); + FREE (temp); + + if (temp1 == &expand_param_error) + return (&expand_wdesc_error); + else if (temp1 == &expand_param_fatal) + return (&expand_wdesc_fatal); + + ret = alloc_word_desc (); + ret->word = temp1; + /* We test quoted_dollar_atp because we want variants with double-quoted + "$@" to take a different code path. In fact, we make sure at the end + of expand_word_internal that we're only looking at these flags if + quoted_dollar_at == 0. */ + if (temp1 && + (quoted_dollar_atp == 0 || *quoted_dollar_atp == 0) && + QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ret->flags |= W_QUOTED|W_HASQUOTEDNULL; + return ret; + } + else if (want_patsub) + { + temp1 = parameter_brace_patsub (name, temp, ind, value, quoted, (tflag & W_ARRAYIND) ? AV_USEIND : 0); + FREE (name); + FREE (value); + FREE (temp); + + if (temp1 == &expand_param_error) + return (&expand_wdesc_error); + else if (temp1 == &expand_param_fatal) + return (&expand_wdesc_fatal); + + ret = alloc_word_desc (); + ret->word = temp1; + if (temp1 && + (quoted_dollar_atp == 0 || *quoted_dollar_atp == 0) && + QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ret->flags |= W_QUOTED|W_HASQUOTEDNULL; + return ret; + } +#if defined (CASEMOD_EXPANSIONS) + else if (want_casemod) + { + temp1 = parameter_brace_casemod (name, temp, ind, modspec, value, quoted, (tflag & W_ARRAYIND) ? AV_USEIND : 0); + FREE (name); + FREE (value); + FREE (temp); + + if (temp1 == &expand_param_error) + return (&expand_wdesc_error); + else if (temp1 == &expand_param_fatal) + return (&expand_wdesc_fatal); + + ret = alloc_word_desc (); + ret->word = temp1; + if (temp1 && + (quoted_dollar_atp == 0 || *quoted_dollar_atp == 0) && + QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ret->flags |= W_QUOTED|W_HASQUOTEDNULL; + return ret; + } +#endif + + /* Do the right thing based on which character ended the variable name. */ + switch (c) + { + default: + case '\0': + bad_substitution: + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("%s: bad substitution"), string ? string : "??"); + FREE (value); + FREE (temp); + free (name); + return &expand_wdesc_error; + + case RBRACE: + break; + + case '#': /* ${param#[#]pattern} */ + case '%': /* ${param%[%]pattern} */ + if (value == 0 || *value == '\0' || temp == 0 || *temp == '\0') + { + FREE (value); + break; + } + temp1 = parameter_brace_remove_pattern (name, temp, ind, value, c, quoted, (tflag & W_ARRAYIND) ? AV_USEIND : 0); + free (temp); + free (value); + free (name); + + ret = alloc_word_desc (); + ret->word = temp1; + if (temp1 && QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ret->flags |= W_QUOTED|W_HASQUOTEDNULL; + return ret; + + case '-': + case '=': + case '?': + case '+': + if (var_is_set && var_is_null == 0) + { + /* If the operator is `+', we don't want the value of the named + variable for anything, just the value of the right hand side. */ + if (c == '+') + { + /* XXX -- if we're double-quoted and the named variable is "$@", + we want to turn off any special handling of "$@" -- + we're not using it, so whatever is on the rhs applies. */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 0; + if (contains_dollar_at) + *contains_dollar_at = 0; + + FREE (temp); + if (value) + { + /* From Posix discussion on austin-group list. Issue 221 + requires that backslashes escaping `}' inside + double-quoted ${...} be removed. */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + quoted |= Q_DOLBRACE; + ret = parameter_brace_expand_rhs (name, value, c, + quoted, + quoted_dollar_atp, + contains_dollar_at); + /* XXX - fix up later, esp. noting presence of + W_HASQUOTEDNULL in ret->flags */ + free (value); + } + else + temp = (char *)NULL; + } + else + { + FREE (value); + } + /* Otherwise do nothing; just use the value in TEMP. */ + } + else /* VAR not set or VAR is NULL. */ + { + FREE (temp); + temp = (char *)NULL; + if (c == '=' && var_is_special) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("$%s: cannot assign in this way"), name); + free (name); + free (value); + return &expand_wdesc_error; + } + else if (c == '?') + { + parameter_brace_expand_error (name, value); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + else if (c != '+') + { + /* XXX -- if we're double-quoted and the named variable is "$@", + we want to turn off any special handling of "$@" -- + we're not using it, so whatever is on the rhs applies. */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 0; + if (contains_dollar_at) + *contains_dollar_at = 0; + + /* From Posix discussion on austin-group list. Issue 221 requires + that backslashes escaping `}' inside double-quoted ${...} be + removed. */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + quoted |= Q_DOLBRACE; + ret = parameter_brace_expand_rhs (name, value, c, quoted, + quoted_dollar_atp, + contains_dollar_at); + /* XXX - fix up later, esp. noting presence of + W_HASQUOTEDNULL in tdesc->flags */ + } + free (value); + } + + break; + } + free (name); + + if (ret == 0) + { + ret = alloc_word_desc (); + ret->flags = tflag; + ret->word = temp; + } + return (ret); +} + +/* Expand a single ${xxx} expansion. The braces are optional. When + the braces are used, parameter_brace_expand() does the work, + possibly calling param_expand recursively. */ +static WORD_DESC * +param_expand (string, sindex, quoted, expanded_something, + contains_dollar_at, quoted_dollar_at_p, had_quoted_null_p, + pflags) + char *string; + int *sindex, quoted, *expanded_something, *contains_dollar_at; + int *quoted_dollar_at_p, *had_quoted_null_p, pflags; +{ + char *temp, *temp1, uerror[3]; + int zindex, t_index, expok; + unsigned char c; + intmax_t number; + SHELL_VAR *var; + WORD_LIST *list; + WORD_DESC *tdesc, *ret; + int tflag; + + zindex = *sindex; + c = string[++zindex]; + + temp = (char *)NULL; + ret = tdesc = (WORD_DESC *)NULL; + tflag = 0; + + /* Do simple cases first. Switch on what follows '$'. */ + switch (c) + { + /* $0 .. $9? */ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + temp1 = dollar_vars[TODIGIT (c)]; + if (unbound_vars_is_error && temp1 == (char *)NULL) + { + uerror[0] = '$'; + uerror[1] = c; + uerror[2] = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (uerror); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + if (temp1) + temp = (*temp1 && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ? quote_string (temp1) + : quote_escapes (temp1); + else + temp = (char *)NULL; + + break; + + /* $$ -- pid of the invoking shell. */ + case '$': + temp = itos (dollar_dollar_pid); + break; + + /* $# -- number of positional parameters. */ + case '#': + temp = itos (number_of_args ()); + break; + + /* $? -- return value of the last synchronous command. */ + case '?': + temp = itos (last_command_exit_value); + break; + + /* $- -- flags supplied to the shell on invocation or by `set'. */ + case '-': + temp = which_set_flags (); + break; + + /* $! -- Pid of the last asynchronous command. */ + case '!': + /* If no asynchronous pids have been created, expand to nothing. + If `set -u' has been executed, and no async processes have + been created, this is an expansion error. */ + if (last_asynchronous_pid == NO_PID) + { + if (expanded_something) + *expanded_something = 0; + temp = (char *)NULL; + if (unbound_vars_is_error) + { + uerror[0] = '$'; + uerror[1] = c; + uerror[2] = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (uerror); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + } + else + temp = itos (last_asynchronous_pid); + break; + + /* The only difference between this and $@ is when the arg is quoted. */ + case '*': /* `$*' */ + list = list_rest_of_args (); + +#if 0 + /* According to austin-group posix proposal by Geoff Clare in + <20090505091501.GA10097@squonk.masqnet> of 5 May 2009: + + "The shell shall write a message to standard error and + immediately exit when it tries to expand an unset parameter + other than the '@' and '*' special parameters." + */ + + if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) + { + uerror[0] = '$'; + uerror[1] = '*'; + uerror[2] = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (uerror); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } +#endif + + /* If there are no command-line arguments, this should just + disappear if there are other characters in the expansion, + even if it's quoted. */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && list == 0) + temp = (char *)NULL; + else if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES|Q_PATQUOTE)) + { + /* If we have "$*" we want to make a string of the positional + parameters, separated by the first character of $IFS, and + quote the whole string, including the separators. If IFS + is unset, the parameters are separated by ' '; if $IFS is + null, the parameters are concatenated. */ + temp = (quoted & (Q_DOUBLE_QUOTES|Q_PATQUOTE)) ? string_list_dollar_star (list) : string_list (list); + if (temp) + { + temp1 = quote_string (temp); + if (*temp == 0) + tflag |= W_HASQUOTEDNULL; + free (temp); + temp = temp1; + } + } + else + { + /* We check whether or not we're eventually going to split $* here, + for example when IFS is empty and we are processing the rhs of + an assignment statement. In that case, we don't separate the + arguments at all. Otherwise, if the $* is not quoted it is + identical to $@ */ +# if defined (HANDLE_MULTIBYTE) + if (expand_no_split_dollar_star && ifs_firstc[0] == 0) +# else + if (expand_no_split_dollar_star && ifs_firstc == 0) +# endif + temp = string_list_dollar_star (list); + else + { + temp = string_list_dollar_at (list, quoted); + if (quoted == 0 && (ifs_is_set == 0 || ifs_is_null)) + tflag |= W_SPLITSPACE; + } + + if (expand_no_split_dollar_star == 0 && contains_dollar_at) + *contains_dollar_at = 1; + } + + dispose_words (list); + break; + + /* When we have "$@" what we want is "$1" "$2" "$3" ... This + means that we have to turn quoting off after we split into + the individually quoted arguments so that the final split + on the first character of $IFS is still done. */ + case '@': /* `$@' */ + list = list_rest_of_args (); + +#if 0 + /* According to austin-group posix proposal by Geoff Clare in + <20090505091501.GA10097@squonk.masqnet> of 5 May 2009: + + "The shell shall write a message to standard error and + immediately exit when it tries to expand an unset parameter + other than the '@' and '*' special parameters." + */ + + if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) + { + uerror[0] = '$'; + uerror[1] = '@'; + uerror[2] = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (uerror); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } +#endif + + /* We want to flag the fact that we saw this. We can't turn + off quoting entirely, because other characters in the + string might need it (consider "\"$@\""), but we need some + way to signal that the final split on the first character + of $IFS should be done, even though QUOTED is 1. */ + /* XXX - should this test include Q_PATQUOTE? */ + if (quoted_dollar_at_p && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + *quoted_dollar_at_p = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + + /* We want to separate the positional parameters with the first + character of $IFS in case $IFS is something other than a space. + We also want to make sure that splitting is done no matter what -- + according to POSIX.2, this expands to a list of the positional + parameters no matter what IFS is set to. */ + /* XXX - what to do when in a context where word splitting is not + performed? Even when IFS is not the default, posix seems to imply + that we behave like unquoted $* ? Maybe we should use PF_NOSPLIT2 + here. */ + temp = string_list_dollar_at (list, (pflags & PF_ASSIGNRHS) ? (quoted|Q_DOUBLE_QUOTES) : quoted); + + tflag |= W_DOLLARAT; + dispose_words (list); + break; + + case LBRACE: + tdesc = parameter_brace_expand (string, &zindex, quoted, pflags, + quoted_dollar_at_p, + contains_dollar_at); + + if (tdesc == &expand_wdesc_error || tdesc == &expand_wdesc_fatal) + return (tdesc); + temp = tdesc ? tdesc->word : (char *)0; + + /* XXX */ + /* Quoted nulls should be removed if there is anything else + in the string. */ + /* Note that we saw the quoted null so we can add one back at + the end of this function if there are no other characters + in the string, discard TEMP, and go on. The exception to + this is when we have "${@}" and $1 is '', since $@ needs + special handling. */ + if (tdesc && tdesc->word && (tdesc->flags & W_HASQUOTEDNULL) && QUOTED_NULL (temp)) + { + if (had_quoted_null_p) + *had_quoted_null_p = 1; + if (*quoted_dollar_at_p == 0) + { + free (temp); + tdesc->word = temp = (char *)NULL; + } + + } + + ret = tdesc; + goto return0; + + /* Do command or arithmetic substitution. */ + case LPAREN: + /* We have to extract the contents of this paren substitution. */ + t_index = zindex + 1; + temp = extract_command_subst (string, &t_index, 0); + zindex = t_index; + + /* For Posix.2-style `$(( ))' arithmetic substitution, + extract the expression and pass it to the evaluator. */ + if (temp && *temp == LPAREN) + { + char *temp2; + temp1 = temp + 1; + temp2 = savestring (temp1); + t_index = strlen (temp2) - 1; + + if (temp2[t_index] != RPAREN) + { + free (temp2); + goto comsub; + } + + /* Cut off ending `)' */ + temp2[t_index] = '\0'; + + if (chk_arithsub (temp2, t_index) == 0) + { + free (temp2); +#if 0 + internal_warning (_("future versions of the shell will force evaluation as an arithmetic substitution")); +#endif + goto comsub; + } + + /* Expand variables found inside the expression. */ + temp1 = expand_arith_string (temp2, Q_DOUBLE_QUOTES); + free (temp2); + +arithsub: + /* No error messages. */ + this_command_name = (char *)NULL; + number = evalexp (temp1, &expok); + free (temp); + free (temp1); + if (expok == 0) + { + if (interactive_shell == 0 && posixly_correct) + { + last_command_exit_value = EXECUTION_FAILURE; + return (&expand_wdesc_fatal); + } + else + return (&expand_wdesc_error); + } + temp = itos (number); + break; + } + +comsub: + if (pflags & PF_NOCOMSUB) + /* we need zindex+1 because string[zindex] == RPAREN */ + temp1 = substring (string, *sindex, zindex+1); + else + { + tdesc = command_substitute (temp, quoted); + temp1 = tdesc ? tdesc->word : (char *)NULL; + if (tdesc) + dispose_word_desc (tdesc); + } + FREE (temp); + temp = temp1; + break; + + /* Do POSIX.2d9-style arithmetic substitution. This will probably go + away in a future bash release. */ + case '[': + /* Extract the contents of this arithmetic substitution. */ + t_index = zindex + 1; + temp = extract_arithmetic_subst (string, &t_index); + zindex = t_index; + if (temp == 0) + { + temp = savestring (string); + if (expanded_something) + *expanded_something = 0; + goto return0; + } + + /* Do initial variable expansion. */ + temp1 = expand_arith_string (temp, Q_DOUBLE_QUOTES); + + goto arithsub; + + default: + /* Find the variable in VARIABLE_LIST. */ + temp = (char *)NULL; + + for (t_index = zindex; (c = string[zindex]) && legal_variable_char (c); zindex++) + ; + temp1 = (zindex > t_index) ? substring (string, t_index, zindex) : (char *)NULL; + + /* If this isn't a variable name, then just output the `$'. */ + if (temp1 == 0 || *temp1 == '\0') + { + FREE (temp1); + temp = (char *)xmalloc (2); + temp[0] = '$'; + temp[1] = '\0'; + if (expanded_something) + *expanded_something = 0; + goto return0; + } + + /* If the variable exists, return its value cell. */ + var = find_variable (temp1); + + if (var && invisible_p (var) == 0 && var_isset (var)) + { +#if defined (ARRAY_VARS) + if (assoc_p (var) || array_p (var)) + { + temp = array_p (var) ? array_reference (array_cell (var), 0) + : assoc_reference (assoc_cell (var), "0"); + if (temp) + temp = (*temp && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ? quote_string (temp) + : quote_escapes (temp); + else if (unbound_vars_is_error) + goto unbound_variable; + } + else +#endif + { + temp = value_cell (var); + + temp = (*temp && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ? quote_string (temp) + : quote_escapes (temp); + } + + free (temp1); + + goto return0; + } + else if (var && (invisible_p (var) || var_isset (var) == 0)) + temp = (char *)NULL; + else if ((var = find_variable_last_nameref (temp1)) && var_isset (var) && invisible_p (var) == 0) + { + temp = nameref_cell (var); +#if defined (ARRAY_VARS) + if (temp && *temp && valid_array_reference (temp)) + { + tdesc = parameter_brace_expand_word (temp, SPECIAL_VAR (temp, 0), quoted, pflags, (arrayind_t *)NULL); + if (tdesc == &expand_wdesc_error || tdesc == &expand_wdesc_fatal) + return (tdesc); + ret = tdesc; + goto return0; + } + else +#endif + /* y=2 ; typeset -n x=y; echo $x is not the same as echo $2 in ksh */ + if (temp && *temp && legal_identifier (temp) == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("%s: invalid variable name for name reference"), temp); + return (&expand_wdesc_error); /* XXX */ + } + else + temp = (char *)NULL; + } + + temp = (char *)NULL; + +unbound_variable: + if (unbound_vars_is_error) + { + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (temp1); + } + else + { + free (temp1); + goto return0; + } + + free (temp1); + last_command_exit_value = EXECUTION_FAILURE; + return ((unbound_vars_is_error && interactive_shell == 0) + ? &expand_wdesc_fatal + : &expand_wdesc_error); + } + + if (string[zindex]) + zindex++; + +return0: + *sindex = zindex; + + if (ret == 0) + { + ret = alloc_word_desc (); + ret->flags = tflag; /* XXX */ + ret->word = temp; + } + return ret; +} + +/* Make a word list which is the result of parameter and variable + expansion, command substitution, arithmetic substitution, and + quote removal of WORD. Return a pointer to a WORD_LIST which is + the result of the expansion. If WORD contains a null word, the + word list returned is also null. + + QUOTED contains flag values defined in shell.h. + + ISEXP is used to tell expand_word_internal that the word should be + treated as the result of an expansion. This has implications for + how IFS characters in the word are treated. + + CONTAINS_DOLLAR_AT and EXPANDED_SOMETHING are return values; when non-null + they point to an integer value which receives information about expansion. + CONTAINS_DOLLAR_AT gets non-zero if WORD contained "$@", else zero. + EXPANDED_SOMETHING get non-zero if WORD contained any parameter expansions, + else zero. + + This only does word splitting in the case of $@ expansion. In that + case, we split on ' '. */ + +/* Values for the local variable quoted_state. */ +#define UNQUOTED 0 +#define PARTIALLY_QUOTED 1 +#define WHOLLY_QUOTED 2 + +static WORD_LIST * +expand_word_internal (word, quoted, isexp, contains_dollar_at, expanded_something) + WORD_DESC *word; + int quoted, isexp; + int *contains_dollar_at; + int *expanded_something; +{ + WORD_LIST *list; + WORD_DESC *tword; + + /* The intermediate string that we build while expanding. */ + char *istring; + + /* The current size of the above object. */ + int istring_size; + + /* Index into ISTRING. */ + int istring_index; + + /* Temporary string storage. */ + char *temp, *temp1; + + /* The text of WORD. */ + register char *string; + + /* The size of STRING. */ + size_t string_size; + + /* The index into STRING. */ + int sindex; + + /* This gets 1 if we see a $@ while quoted. */ + int quoted_dollar_at; + + /* One of UNQUOTED, PARTIALLY_QUOTED, or WHOLLY_QUOTED, depending on + whether WORD contains no quoting characters, a partially quoted + string (e.g., "xx"ab), or is fully quoted (e.g., "xxab"). */ + int quoted_state; + + /* State flags */ + int had_quoted_null; + int has_dollar_at, temp_has_dollar_at; + int split_on_spaces; + int tflag; + int pflags; /* flags passed to param_expand */ + + int assignoff; /* If assignment, offset of `=' */ + + register unsigned char c; /* Current character. */ + int t_index; /* For calls to string_extract_xxx. */ + + char twochars[2]; + + DECLARE_MBSTATE; + + istring = (char *)xmalloc (istring_size = DEFAULT_INITIAL_ARRAY_SIZE); + istring[istring_index = 0] = '\0'; + quoted_dollar_at = had_quoted_null = has_dollar_at = 0; + split_on_spaces = 0; + quoted_state = UNQUOTED; + + string = word->word; + if (string == 0) + goto finished_with_string; + /* Don't need the string length for the SADD... and COPY_ macros unless + multibyte characters are possible. */ + string_size = (MB_CUR_MAX > 1) ? strlen (string) : 1; + + if (contains_dollar_at) + *contains_dollar_at = 0; + + assignoff = -1; + + /* Begin the expansion. */ + + for (sindex = 0; ;) + { + c = string[sindex]; + + /* Case on top-level character. */ + switch (c) + { + case '\0': + goto finished_with_string; + + case CTLESC: + sindex++; +#if HANDLE_MULTIBYTE + if (MB_CUR_MAX > 1 && string[sindex]) + { + SADD_MBQCHAR_BODY(temp, string, sindex, string_size); + } + else +#endif + { + temp = (char *)xmalloc (3); + temp[0] = CTLESC; + temp[1] = c = string[sindex]; + temp[2] = '\0'; + } + +dollar_add_string: + if (string[sindex]) + sindex++; + +add_string: + if (temp) + { + istring = sub_append_string (temp, istring, &istring_index, &istring_size); + temp = (char *)0; + } + + break; + +#if defined (PROCESS_SUBSTITUTION) + /* Process substitution. */ + case '<': + case '>': + { + if (string[++sindex] != LPAREN || (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || (word->flags & (W_DQUOTE|W_NOPROCSUB)) || posixly_correct) + { + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + else + t_index = sindex + 1; /* skip past both '<' and LPAREN */ + + temp1 = extract_process_subst (string, (c == '<') ? "<(" : ">(", &t_index, 0); /*))*/ + sindex = t_index; + + /* If the process substitution specification is `<()', we want to + open the pipe for writing in the child and produce output; if + it is `>()', we want to open the pipe for reading in the child + and consume input. */ + temp = temp1 ? process_substitute (temp1, (c == '>')) : (char *)0; + + FREE (temp1); + + goto dollar_add_string; + } +#endif /* PROCESS_SUBSTITUTION */ + + case '=': + /* Posix.2 section 3.6.1 says that tildes following `=' in words + which are not assignment statements are not expanded. If the + shell isn't in posix mode, though, we perform tilde expansion + on `likely candidate' unquoted assignment statements (flags + include W_ASSIGNMENT but not W_QUOTED). A likely candidate + contains an unquoted :~ or =~. Something to think about: we + now have a flag that says to perform tilde expansion on arguments + to `assignment builtins' like declare and export that look like + assignment statements. We now do tilde expansion on such words + even in POSIX mode. */ + if (word->flags & (W_ASSIGNRHS|W_NOTILDE)) + { + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c)) + goto add_ifs_character; + else + goto add_character; + } + /* If we're not in posix mode or forcing assignment-statement tilde + expansion, note where the `=' appears in the word and prepare to + do tilde expansion following the first `='. */ + if ((word->flags & W_ASSIGNMENT) && + (posixly_correct == 0 || (word->flags & W_TILDEEXP)) && + assignoff == -1 && sindex > 0) + assignoff = sindex; + if (sindex == assignoff && string[sindex+1] == '~') /* XXX */ + word->flags |= W_ITILDE; +#if 0 + else if ((word->flags & W_ASSIGNMENT) && + (posixly_correct == 0 || (word->flags & W_TILDEEXP)) && + string[sindex+1] == '~') + word->flags |= W_ITILDE; +#endif + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c)) + goto add_ifs_character; + else + goto add_character; + + case ':': + if (word->flags & W_NOTILDE) + { + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c)) + goto add_ifs_character; + else + goto add_character; + } + + if ((word->flags & (W_ASSIGNMENT|W_ASSIGNRHS|W_TILDEEXP)) && + string[sindex+1] == '~') + word->flags |= W_ITILDE; + + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c)) + goto add_ifs_character; + else + goto add_character; + + case '~': + /* If the word isn't supposed to be tilde expanded, or we're not + at the start of a word or after an unquoted : or = in an + assignment statement, we don't do tilde expansion. */ + if ((word->flags & (W_NOTILDE|W_DQUOTE)) || + (sindex > 0 && ((word->flags & W_ITILDE) == 0)) || + (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + { + word->flags &= ~W_ITILDE; + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c) && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) == 0) + goto add_ifs_character; + else + goto add_character; + } + + if (word->flags & W_ASSIGNRHS) + tflag = 2; + else if (word->flags & (W_ASSIGNMENT|W_TILDEEXP)) + tflag = 1; + else + tflag = 0; + + temp = bash_tilde_find_word (string + sindex, tflag, &t_index); + + word->flags &= ~W_ITILDE; + + if (temp && *temp && t_index > 0) + { + temp1 = bash_tilde_expand (temp, tflag); + if (temp1 && *temp1 == '~' && STREQ (temp, temp1)) + { + FREE (temp); + FREE (temp1); + goto add_character; /* tilde expansion failed */ + } + free (temp); + temp = temp1; + sindex += t_index; + goto add_quoted_string; /* XXX was add_string */ + } + else + { + FREE (temp); + goto add_character; + } + + case '$': + if (expanded_something) + *expanded_something = 1; + + temp_has_dollar_at = 0; + pflags = (word->flags & W_NOCOMSUB) ? PF_NOCOMSUB : 0; + if (word->flags & W_NOSPLIT2) + pflags |= PF_NOSPLIT2; + if (word->flags & W_ASSIGNRHS) + pflags |= PF_ASSIGNRHS; + tword = param_expand (string, &sindex, quoted, expanded_something, + &temp_has_dollar_at, "ed_dollar_at, + &had_quoted_null, pflags); + has_dollar_at += temp_has_dollar_at; + split_on_spaces += (tword->flags & W_SPLITSPACE); + + if (tword == &expand_wdesc_error || tword == &expand_wdesc_fatal) + { + free (string); + free (istring); + return ((tword == &expand_wdesc_error) ? &expand_word_error + : &expand_word_fatal); + } + if (contains_dollar_at && has_dollar_at) + *contains_dollar_at = 1; + + if (tword && (tword->flags & W_HASQUOTEDNULL)) + had_quoted_null = 1; + + temp = tword ? tword->word : (char *)NULL; + dispose_word_desc (tword); + + /* Kill quoted nulls; we will add them back at the end of + expand_word_internal if nothing else in the string */ + if (had_quoted_null && temp && QUOTED_NULL (temp)) + { + FREE (temp); + temp = (char *)NULL; + } + + goto add_string; + break; + + case '`': /* Backquoted command substitution. */ + { + t_index = sindex++; + + temp = string_extract (string, &sindex, "`", SX_REQMATCH); + /* The test of sindex against t_index is to allow bare instances of + ` to pass through, for backwards compatibility. */ + if (temp == &extract_string_error || temp == &extract_string_fatal) + { + if (sindex - 1 == t_index) + { + sindex = t_index; + goto add_character; + } + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("bad substitution: no closing \"`\" in %s") , string+t_index); + free (string); + free (istring); + return ((temp == &extract_string_error) ? &expand_word_error + : &expand_word_fatal); + } + + if (expanded_something) + *expanded_something = 1; + + if (word->flags & W_NOCOMSUB) + /* sindex + 1 because string[sindex] == '`' */ + temp1 = substring (string, t_index, sindex + 1); + else + { + de_backslash (temp); + tword = command_substitute (temp, quoted); + temp1 = tword ? tword->word : (char *)NULL; + if (tword) + dispose_word_desc (tword); + } + FREE (temp); + temp = temp1; + goto dollar_add_string; + } + + case '\\': + if (string[sindex + 1] == '\n') + { + sindex += 2; + continue; + } + + c = string[++sindex]; + + if (quoted & Q_HERE_DOCUMENT) + tflag = CBSHDOC; + else if (quoted & Q_DOUBLE_QUOTES) + tflag = CBSDQUOTE; + else + tflag = 0; + + /* From Posix discussion on austin-group list: Backslash escaping + a } in ${...} is removed. Issue 0000221 */ + if ((quoted & Q_DOLBRACE) && c == RBRACE) + { + SCOPY_CHAR_I (twochars, CTLESC, c, string, sindex, string_size); + } + /* This is the fix for " $@\ " */ + else if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && ((sh_syntaxtab[c] & tflag) == 0) && isexp == 0 && isifs (c)) + { + RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, + DEFAULT_ARRAY_SIZE); + istring[istring_index++] = CTLESC; + istring[istring_index++] = '\\'; + istring[istring_index] = '\0'; + + SCOPY_CHAR_I (twochars, CTLESC, c, string, sindex, string_size); + } + else if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && ((sh_syntaxtab[c] & tflag) == 0)) + { + SCOPY_CHAR_I (twochars, '\\', c, string, sindex, string_size); + } + else if (c == 0) + { + c = CTLNUL; + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + else + { + SCOPY_CHAR_I (twochars, CTLESC, c, string, sindex, string_size); + } + + sindex++; +add_twochars: + /* BEFORE jumping here, we need to increment sindex if appropriate */ + RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, + DEFAULT_ARRAY_SIZE); + istring[istring_index++] = twochars[0]; + istring[istring_index++] = twochars[1]; + istring[istring_index] = '\0'; + + break; + + case '"': + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + goto add_character; + + t_index = ++sindex; + temp = string_extract_double_quoted (string, &sindex, 0); + + /* If the quotes surrounded the entire string, then the + whole word was quoted. */ + quoted_state = (t_index == 1 && string[sindex] == '\0') + ? WHOLLY_QUOTED + : PARTIALLY_QUOTED; + + if (temp && *temp) + { + tword = alloc_word_desc (); + tword->word = temp; + + temp = (char *)NULL; + + temp_has_dollar_at = 0; /* XXX */ + /* Need to get W_HASQUOTEDNULL flag through this function. */ + list = expand_word_internal (tword, Q_DOUBLE_QUOTES, 0, &temp_has_dollar_at, (int *)NULL); + has_dollar_at += temp_has_dollar_at; + + if (list == &expand_word_error || list == &expand_word_fatal) + { + free (istring); + free (string); + /* expand_word_internal has already freed temp_word->word + for us because of the way it prints error messages. */ + tword->word = (char *)NULL; + dispose_word (tword); + return list; + } + + dispose_word (tword); + + /* "$@" (a double-quoted dollar-at) expands into nothing, + not even a NULL word, when there are no positional + parameters. */ + if (list == 0 && has_dollar_at) + { + quoted_dollar_at++; + break; + } + + /* If we get "$@", we know we have expanded something, so we + need to remember it for the final split on $IFS. This is + a special case; it's the only case where a quoted string + can expand into more than one word. It's going to come back + from the above call to expand_word_internal as a list with + a single word, in which all characters are quoted and + separated by blanks. What we want to do is to turn it back + into a list for the next piece of code. */ + if (list) + dequote_list (list); + + if (list && list->word && (list->word->flags & W_HASQUOTEDNULL)) + had_quoted_null = 1; /* XXX */ + + if (has_dollar_at) + { + quoted_dollar_at++; + if (contains_dollar_at) + *contains_dollar_at = 1; + if (expanded_something) + *expanded_something = 1; + } + } + else + { + /* What we have is "". This is a minor optimization. */ + FREE (temp); + list = (WORD_LIST *)NULL; + } + + /* The code above *might* return a list (consider the case of "$@", + where it returns "$1", "$2", etc.). We can't throw away the + rest of the list, and we have to make sure each word gets added + as quoted. We test on tresult->next: if it is non-NULL, we + quote the whole list, save it to a string with string_list, and + add that string. We don't need to quote the results of this + (and it would be wrong, since that would quote the separators + as well), so we go directly to add_string. */ + if (list) + { + if (list->next) + { + /* Testing quoted_dollar_at makes sure that "$@" is + split correctly when $IFS does not contain a space. */ + temp = quoted_dollar_at + ? string_list_dollar_at (list, Q_DOUBLE_QUOTES) + : string_list (quote_list (list)); + dispose_words (list); + goto add_string; + } + else + { + temp = savestring (list->word->word); + tflag = list->word->flags; + dispose_words (list); + + /* If the string is not a quoted null string, we want + to remove any embedded unquoted CTLNUL characters. + We do not want to turn quoted null strings back into + the empty string, though. We do this because we + want to remove any quoted nulls from expansions that + contain other characters. For example, if we have + x"$*"y or "x$*y" and there are no positional parameters, + the $* should expand into nothing. */ + /* We use the W_HASQUOTEDNULL flag to differentiate the + cases: a quoted null character as above and when + CTLNUL is contained in the (non-null) expansion + of some variable. We use the had_quoted_null flag to + pass the value through this function to its caller. */ + if ((tflag & W_HASQUOTEDNULL) && QUOTED_NULL (temp) == 0) + remove_quoted_nulls (temp); /* XXX */ + } + } + else + temp = (char *)NULL; + + /* We do not want to add quoted nulls to strings that are only + partially quoted; we can throw them away. The exception to + this is when we are going to be performing word splitting, + since we have to preserve a null argument if the next character + will cause word splitting. */ + if (temp == 0 && quoted_state == PARTIALLY_QUOTED && (word->flags & (W_NOSPLIT|W_NOSPLIT2))) + continue; + + add_quoted_string: + + if (temp) + { + temp1 = temp; + temp = quote_string (temp); + free (temp1); + goto add_string; + } + else + { + /* Add NULL arg. */ + c = CTLNUL; + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + + /* break; */ + + case '\'': + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + goto add_character; + + t_index = ++sindex; + temp = string_extract_single_quoted (string, &sindex); + + /* If the entire STRING was surrounded by single quotes, + then the string is wholly quoted. */ + quoted_state = (t_index == 1 && string[sindex] == '\0') + ? WHOLLY_QUOTED + : PARTIALLY_QUOTED; + + /* If all we had was '', it is a null expansion. */ + if (*temp == '\0') + { + free (temp); + temp = (char *)NULL; + } + else + remove_quoted_escapes (temp); /* ??? */ + + /* We do not want to add quoted nulls to strings that are only + partially quoted; such nulls are discarded. */ + if (temp == 0 && (quoted_state == PARTIALLY_QUOTED)) + continue; + + /* If we have a quoted null expansion, add a quoted NULL to istring. */ + if (temp == 0) + { + c = CTLNUL; + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + else + goto add_quoted_string; + + /* break; */ + + default: + /* This is the fix for " $@ " */ + add_ifs_character: + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || (isexp == 0 && isifs (c))) + { + if (string[sindex]) /* from old goto dollar_add_string */ + sindex++; + if (c == 0) + { + c = CTLNUL; + goto add_character; + } + else + { +#if HANDLE_MULTIBYTE + if (MB_CUR_MAX > 1) + sindex--; + + if (MB_CUR_MAX > 1) + { + SADD_MBQCHAR_BODY(temp, string, sindex, string_size); + } + else +#endif + { + twochars[0] = CTLESC; + twochars[1] = c; + goto add_twochars; + } + } + } + + SADD_MBCHAR (temp, string, sindex, string_size); + + add_character: + RESIZE_MALLOCED_BUFFER (istring, istring_index, 1, istring_size, + DEFAULT_ARRAY_SIZE); + istring[istring_index++] = c; + istring[istring_index] = '\0'; + + /* Next character. */ + sindex++; + } + } + +finished_with_string: + /* OK, we're ready to return. If we have a quoted string, and + quoted_dollar_at is not set, we do no splitting at all; otherwise + we split on ' '. The routines that call this will handle what to + do if nothing has been expanded. */ + + /* Partially and wholly quoted strings which expand to the empty + string are retained as an empty arguments. Unquoted strings + which expand to the empty string are discarded. The single + exception is the case of expanding "$@" when there are no + positional parameters. In that case, we discard the expansion. */ + + /* Because of how the code that handles "" and '' in partially + quoted strings works, we need to make ISTRING into a QUOTED_NULL + if we saw quoting characters, but the expansion was empty. + "" and '' are tossed away before we get to this point when + processing partially quoted strings. This makes "" and $xxx"" + equivalent when xxx is unset. We also look to see whether we + saw a quoted null from a ${} expansion and add one back if we + need to. */ + + /* If we expand to nothing and there were no single or double quotes + in the word, we throw it away. Otherwise, we return a NULL word. + The single exception is for $@ surrounded by double quotes when + there are no positional parameters. In that case, we also throw + the word away. */ + + if (*istring == '\0') + { + if (quoted_dollar_at == 0 && (had_quoted_null || quoted_state == PARTIALLY_QUOTED)) + { + istring[0] = CTLNUL; + istring[1] = '\0'; + tword = make_bare_word (istring); + tword->flags |= W_HASQUOTEDNULL; /* XXX */ + list = make_word_list (tword, (WORD_LIST *)NULL); + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + tword->flags |= W_QUOTED; + } + /* According to sh, ksh, and Posix.2, if a word expands into nothing + and a double-quoted "$@" appears anywhere in it, then the entire + word is removed. */ + else if (quoted_state == UNQUOTED || quoted_dollar_at) + list = (WORD_LIST *)NULL; +#if 0 + else + { + tword = make_bare_word (istring); + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + tword->flags |= W_QUOTED; + list = make_word_list (tword, (WORD_LIST *)NULL); + } +#else + else + list = (WORD_LIST *)NULL; +#endif + } + else if (word->flags & W_NOSPLIT) + { + tword = make_bare_word (istring); + if (word->flags & W_ASSIGNMENT) + tword->flags |= W_ASSIGNMENT; /* XXX */ + if (word->flags & W_COMPASSIGN) + tword->flags |= W_COMPASSIGN; /* XXX */ + if (word->flags & W_NOGLOB) + tword->flags |= W_NOGLOB; /* XXX */ + if (word->flags & W_NOBRACE) + tword->flags |= W_NOBRACE; /* XXX */ + if (word->flags & W_NOEXPAND) + tword->flags |= W_NOEXPAND; /* XXX */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + tword->flags |= W_QUOTED; + if (had_quoted_null && QUOTED_NULL (istring)) + tword->flags |= W_HASQUOTEDNULL; + list = make_word_list (tword, (WORD_LIST *)NULL); + } + else + { + char *ifs_chars; + char *tstring; + + ifs_chars = (quoted_dollar_at || has_dollar_at) ? ifs_value : (char *)NULL; + + /* If we have $@, we need to split the results no matter what. If + IFS is unset or NULL, string_list_dollar_at has separated the + positional parameters with a space, so we split on space (we have + set ifs_chars to " \t\n" above if ifs is unset). If IFS is set, + string_list_dollar_at has separated the positional parameters + with the first character of $IFS, so we split on $IFS. If + SPLIT_ON_SPACES is set, we expanded $* (unquoted) with IFS either + unset or null, and we want to make sure that we split on spaces + regardless of what else has happened to IFS since the expansion. */ + if (split_on_spaces) + list = list_string (istring, " ", 1); /* XXX quoted == 1? */ + /* If we have $@ (has_dollar_at != 0) and we are in a context where we + don't want to split the result (W_NOSPLIT2), and we are not quoted, + we have already separated the arguments with the first character of + $IFS. In this case, we want to return a list with a single word + with the separator possibly replaced with a space (it's what other + shells seem to do). + quoted_dollar_at is internal to this function and is set if we are + passed an argument that is unquoted (quoted == 0) but we encounter a + double-quoted $@ while expanding it. */ + else if (has_dollar_at && quoted_dollar_at == 0 && ifs_chars && quoted == 0 && (word->flags & W_NOSPLIT2)) + { + /* Only split and rejoin if we have to */ + if (*ifs_chars && *ifs_chars != ' ') + { + list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1); + tstring = string_list (list); + } + else + tstring = istring; + tword = make_bare_word (tstring); + if (tstring != istring) + free (tstring); + goto set_word_flags; + } + else if (has_dollar_at && ifs_chars) + list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1); + else + { + tword = make_bare_word (istring); +set_word_flags: + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) || (quoted_state == WHOLLY_QUOTED)) + tword->flags |= W_QUOTED; + if (word->flags & W_ASSIGNMENT) + tword->flags |= W_ASSIGNMENT; + if (word->flags & W_COMPASSIGN) + tword->flags |= W_COMPASSIGN; + if (word->flags & W_NOGLOB) + tword->flags |= W_NOGLOB; + if (word->flags & W_NOBRACE) + tword->flags |= W_NOBRACE; + if (word->flags & W_NOEXPAND) + tword->flags |= W_NOEXPAND; + if (had_quoted_null && QUOTED_NULL (istring)) + tword->flags |= W_HASQUOTEDNULL; /* XXX */ + list = make_word_list (tword, (WORD_LIST *)NULL); + } + } + + free (istring); + return (list); +} + +/* **************************************************************** */ +/* */ +/* Functions for Quote Removal */ +/* */ +/* **************************************************************** */ + +/* Perform quote removal on STRING. If QUOTED > 0, assume we are obeying the + backslash quoting rules for within double quotes or a here document. */ +char * +string_quote_removal (string, quoted) + char *string; + int quoted; +{ + size_t slen; + char *r, *result_string, *temp, *send; + int sindex, tindex, dquote; + unsigned char c; + DECLARE_MBSTATE; + + /* The result can be no longer than the original string. */ + slen = strlen (string); + send = string + slen; + + r = result_string = (char *)xmalloc (slen + 1); + + for (dquote = sindex = 0; c = string[sindex];) + { + switch (c) + { + case '\\': + c = string[++sindex]; + if (c == 0) + { + *r++ = '\\'; + break; + } + if (((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || dquote) && (sh_syntaxtab[c] & CBSDQUOTE) == 0) + *r++ = '\\'; + /* FALLTHROUGH */ + + default: + SCOPY_CHAR_M (r, string, send, sindex); + break; + + case '\'': + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || dquote) + { + *r++ = c; + sindex++; + break; + } + tindex = sindex + 1; + temp = string_extract_single_quoted (string, &tindex); + if (temp) + { + strcpy (r, temp); + r += strlen (r); + free (temp); + } + sindex = tindex; + break; + + case '"': + dquote = 1 - dquote; + sindex++; + break; + } + } + *r = '\0'; + return (result_string); +} + +#if 0 +/* UNUSED */ +/* Perform quote removal on word WORD. This allocates and returns a new + WORD_DESC *. */ +WORD_DESC * +word_quote_removal (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_DESC *w; + char *t; + + t = string_quote_removal (word->word, quoted); + w = alloc_word_desc (); + w->word = t ? t : savestring (""); + return (w); +} + +/* Perform quote removal on all words in LIST. If QUOTED is non-zero, + the members of the list are treated as if they are surrounded by + double quotes. Return a new list, or NULL if LIST is NULL. */ +WORD_LIST * +word_list_quote_removal (list, quoted) + WORD_LIST *list; + int quoted; +{ + WORD_LIST *result, *t, *tresult, *e; + + for (t = list, result = (WORD_LIST *)NULL; t; t = t->next) + { + tresult = make_word_list (word_quote_removal (t->word, quoted), (WORD_LIST *)NULL); +#if 0 + result = (WORD_LIST *) list_append (result, tresult); +#else + if (result == 0) + result = e = tresult; + else + { + e->next = tresult; + while (e->next) + e = e->next; + } +#endif + } + return (result); +} +#endif + +/******************************************* + * * + * Functions to perform word splitting * + * * + *******************************************/ + +void +setifs (v) + SHELL_VAR *v; +{ + char *t; + unsigned char uc; + + ifs_var = v; + ifs_value = (v && value_cell (v)) ? value_cell (v) : " \t\n"; + + ifs_is_set = ifs_var != 0; + ifs_is_null = ifs_is_set && (*ifs_value == 0); + + /* Should really merge ifs_cmap with sh_syntaxtab. XXX - doesn't yet + handle multibyte chars in IFS */ + memset (ifs_cmap, '\0', sizeof (ifs_cmap)); + for (t = ifs_value ; t && *t; t++) + { + uc = *t; + ifs_cmap[uc] = 1; + } + +#if defined (HANDLE_MULTIBYTE) + if (ifs_value == 0) + { + ifs_firstc[0] = '\0'; + ifs_firstc_len = 1; + } + else + { + size_t ifs_len; + ifs_len = strnlen (ifs_value, MB_CUR_MAX); + ifs_firstc_len = MBLEN (ifs_value, ifs_len); + if (ifs_firstc_len == 1 || ifs_firstc_len == 0 || MB_INVALIDCH (ifs_firstc_len)) + { + ifs_firstc[0] = ifs_value[0]; + ifs_firstc[1] = '\0'; + ifs_firstc_len = 1; + } + else + memcpy (ifs_firstc, ifs_value, ifs_firstc_len); + } +#else + ifs_firstc = ifs_value ? *ifs_value : 0; +#endif +} + +char * +getifs () +{ + return ifs_value; +} + +/* This splits a single word into a WORD LIST on $IFS, but only if the word + is not quoted. list_string () performs quote removal for us, even if we + don't do any splitting. */ +WORD_LIST * +word_split (w, ifs_chars) + WORD_DESC *w; + char *ifs_chars; +{ + WORD_LIST *result; + + if (w) + { + char *xifs; + + xifs = ((w->flags & W_QUOTED) || ifs_chars == 0) ? "" : ifs_chars; + result = list_string (w->word, xifs, w->flags & W_QUOTED); + } + else + result = (WORD_LIST *)NULL; + + return (result); +} + +/* Perform word splitting on LIST and return the RESULT. It is possible + to return (WORD_LIST *)NULL. */ +static WORD_LIST * +word_list_split (list) + WORD_LIST *list; +{ + WORD_LIST *result, *t, *tresult, *e; + + for (t = list, result = (WORD_LIST *)NULL; t; t = t->next) + { + tresult = word_split (t->word, ifs_value); + if (result == 0) + result = e = tresult; + else + { + e->next = tresult; + while (e->next) + e = e->next; + } + } + return (result); +} + +/************************************************** + * * + * Functions to expand an entire WORD_LIST * + * * + **************************************************/ + +/* Do any word-expansion-specific cleanup and jump to top_level */ +static void +exp_jump_to_top_level (v) + int v; +{ + set_pipestatus_from_exit (last_command_exit_value); + + /* Cleanup code goes here. */ + expand_no_split_dollar_star = 0; /* XXX */ + expanding_redir = 0; + assigning_in_environment = 0; + + if (parse_and_execute_level == 0) + top_level_cleanup (); /* from sig.c */ + + jump_to_top_level (v); +} + +/* Put NLIST (which is a WORD_LIST * of only one element) at the front of + ELIST, and set ELIST to the new list. */ +#define PREPEND_LIST(nlist, elist) \ + do { nlist->next = elist; elist = nlist; } while (0) + +/* Separate out any initial variable assignments from TLIST. If set -k has + been executed, remove all assignment statements from TLIST. Initial + variable assignments and other environment assignments are placed + on SUBST_ASSIGN_VARLIST. */ +static WORD_LIST * +separate_out_assignments (tlist) + WORD_LIST *tlist; +{ + register WORD_LIST *vp, *lp; + + if (tlist == 0) + return ((WORD_LIST *)NULL); + + if (subst_assign_varlist) + dispose_words (subst_assign_varlist); /* Clean up after previous error */ + + subst_assign_varlist = (WORD_LIST *)NULL; + vp = lp = tlist; + + /* Separate out variable assignments at the start of the command. + Loop invariant: vp->next == lp + Loop postcondition: + lp = list of words left after assignment statements skipped + tlist = original list of words + */ + while (lp && (lp->word->flags & W_ASSIGNMENT)) + { + vp = lp; + lp = lp->next; + } + + /* If lp != tlist, we have some initial assignment statements. + We make SUBST_ASSIGN_VARLIST point to the list of assignment + words and TLIST point to the remaining words. */ + if (lp != tlist) + { + subst_assign_varlist = tlist; + /* ASSERT(vp->next == lp); */ + vp->next = (WORD_LIST *)NULL; /* terminate variable list */ + tlist = lp; /* remainder of word list */ + } + + /* vp == end of variable list */ + /* tlist == remainder of original word list without variable assignments */ + if (!tlist) + /* All the words in tlist were assignment statements */ + return ((WORD_LIST *)NULL); + + /* ASSERT(tlist != NULL); */ + /* ASSERT((tlist->word->flags & W_ASSIGNMENT) == 0); */ + + /* If the -k option is in effect, we need to go through the remaining + words, separate out the assignment words, and place them on + SUBST_ASSIGN_VARLIST. */ + if (place_keywords_in_env) + { + WORD_LIST *tp; /* tp == running pointer into tlist */ + + tp = tlist; + lp = tlist->next; + + /* Loop Invariant: tp->next == lp */ + /* Loop postcondition: tlist == word list without assignment statements */ + while (lp) + { + if (lp->word->flags & W_ASSIGNMENT) + { + /* Found an assignment statement, add this word to end of + subst_assign_varlist (vp). */ + if (!subst_assign_varlist) + subst_assign_varlist = vp = lp; + else + { + vp->next = lp; + vp = lp; + } + + /* Remove the word pointed to by LP from TLIST. */ + tp->next = lp->next; + /* ASSERT(vp == lp); */ + lp->next = (WORD_LIST *)NULL; + lp = tp->next; + } + else + { + tp = lp; + lp = lp->next; + } + } + } + return (tlist); +} + +#define WEXP_VARASSIGN 0x001 +#define WEXP_BRACEEXP 0x002 +#define WEXP_TILDEEXP 0x004 +#define WEXP_PARAMEXP 0x008 +#define WEXP_PATHEXP 0x010 + +/* All of the expansions, including variable assignments at the start of + the list. */ +#define WEXP_ALL (WEXP_VARASSIGN|WEXP_BRACEEXP|WEXP_TILDEEXP|WEXP_PARAMEXP|WEXP_PATHEXP) + +/* All of the expansions except variable assignments at the start of + the list. */ +#define WEXP_NOVARS (WEXP_BRACEEXP|WEXP_TILDEEXP|WEXP_PARAMEXP|WEXP_PATHEXP) + +/* All of the `shell expansions': brace expansion, tilde expansion, parameter + expansion, command substitution, arithmetic expansion, word splitting, and + quote removal. */ +#define WEXP_SHELLEXP (WEXP_BRACEEXP|WEXP_TILDEEXP|WEXP_PARAMEXP) + +/* Take the list of words in LIST and do the various substitutions. Return + a new list of words which is the expanded list, and without things like + variable assignments. */ + +WORD_LIST * +expand_words (list) + WORD_LIST *list; +{ + return (expand_word_list_internal (list, WEXP_ALL)); +} + +/* Same as expand_words (), but doesn't hack variable or environment + variables. */ +WORD_LIST * +expand_words_no_vars (list) + WORD_LIST *list; +{ + return (expand_word_list_internal (list, WEXP_NOVARS)); +} + +WORD_LIST * +expand_words_shellexp (list) + WORD_LIST *list; +{ + return (expand_word_list_internal (list, WEXP_SHELLEXP)); +} + +static WORD_LIST * +glob_expand_word_list (tlist, eflags) + WORD_LIST *tlist; + int eflags; +{ + char **glob_array, *temp_string; + register int glob_index; + WORD_LIST *glob_list, *output_list, *disposables, *next; + WORD_DESC *tword; + + output_list = disposables = (WORD_LIST *)NULL; + glob_array = (char **)NULL; + while (tlist) + { + /* For each word, either globbing is attempted or the word is + added to orig_list. If globbing succeeds, the results are + added to orig_list and the word (tlist) is added to the list + of disposable words. If globbing fails and failed glob + expansions are left unchanged (the shell default), the + original word is added to orig_list. If globbing fails and + failed glob expansions are removed, the original word is + added to the list of disposable words. orig_list ends up + in reverse order and requires a call to REVERSE_LIST to + be set right. After all words are examined, the disposable + words are freed. */ + next = tlist->next; + + /* If the word isn't an assignment and contains an unquoted + pattern matching character, then glob it. */ + if ((tlist->word->flags & W_NOGLOB) == 0 && + unquoted_glob_pattern_p (tlist->word->word)) + { + glob_array = shell_glob_filename (tlist->word->word); + + /* Handle error cases. + I don't think we should report errors like "No such file + or directory". However, I would like to report errors + like "Read failed". */ + + if (glob_array == 0 || GLOB_FAILED (glob_array)) + { + glob_array = (char **)xmalloc (sizeof (char *)); + glob_array[0] = (char *)NULL; + } + + /* Dequote the current word in case we have to use it. */ + if (glob_array[0] == NULL) + { + temp_string = dequote_string (tlist->word->word); + free (tlist->word->word); + tlist->word->word = temp_string; + } + + /* Make the array into a word list. */ + glob_list = (WORD_LIST *)NULL; + for (glob_index = 0; glob_array[glob_index]; glob_index++) + { + tword = make_bare_word (glob_array[glob_index]); + glob_list = make_word_list (tword, glob_list); + } + + if (glob_list) + { + output_list = (WORD_LIST *)list_append (glob_list, output_list); + PREPEND_LIST (tlist, disposables); + } + else if (fail_glob_expansion != 0) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("no match: %s"), tlist->word->word); + exp_jump_to_top_level (DISCARD); + } + else if (allow_null_glob_expansion == 0) + { + /* Failed glob expressions are left unchanged. */ + PREPEND_LIST (tlist, output_list); + } + else + { + /* Failed glob expressions are removed. */ + PREPEND_LIST (tlist, disposables); + } + } + else + { + /* Dequote the string. */ + temp_string = dequote_string (tlist->word->word); + free (tlist->word->word); + tlist->word->word = temp_string; + PREPEND_LIST (tlist, output_list); + } + + strvec_dispose (glob_array); + glob_array = (char **)NULL; + + tlist = next; + } + + if (disposables) + dispose_words (disposables); + + if (output_list) + output_list = REVERSE_LIST (output_list, WORD_LIST *); + + return (output_list); +} + +#if defined (BRACE_EXPANSION) +static WORD_LIST * +brace_expand_word_list (tlist, eflags) + WORD_LIST *tlist; + int eflags; +{ + register char **expansions; + char *temp_string; + WORD_LIST *disposables, *output_list, *next; + WORD_DESC *w; + int eindex; + + for (disposables = output_list = (WORD_LIST *)NULL; tlist; tlist = next) + { + next = tlist->next; + + if (tlist->word->flags & W_NOBRACE) + { +/*itrace("brace_expand_word_list: %s: W_NOBRACE", tlist->word->word);*/ + PREPEND_LIST (tlist, output_list); + continue; + } + + if ((tlist->word->flags & (W_COMPASSIGN|W_ASSIGNARG)) == (W_COMPASSIGN|W_ASSIGNARG)) + { +/*itrace("brace_expand_word_list: %s: W_COMPASSIGN|W_ASSIGNARG", tlist->word->word);*/ + PREPEND_LIST (tlist, output_list); + continue; + } + + /* Only do brace expansion if the word has a brace character. If + not, just add the word list element to BRACES and continue. In + the common case, at least when running shell scripts, this will + degenerate to a bunch of calls to `mbschr', and then what is + basically a reversal of TLIST into BRACES, which is corrected + by a call to REVERSE_LIST () on BRACES when the end of TLIST + is reached. */ + if (mbschr (tlist->word->word, LBRACE)) + { + expansions = brace_expand (tlist->word->word); + + for (eindex = 0; temp_string = expansions[eindex]; eindex++) + { + w = alloc_word_desc (); + w->word = temp_string; + + /* If brace expansion didn't change the word, preserve + the flags. We may want to preserve the flags + unconditionally someday -- XXX */ + if (STREQ (temp_string, tlist->word->word)) + w->flags = tlist->word->flags; + else + w = make_word_flags (w, temp_string); + + output_list = make_word_list (w, output_list); + } + free (expansions); + + /* Add TLIST to the list of words to be freed after brace + expansion has been performed. */ + PREPEND_LIST (tlist, disposables); + } + else + PREPEND_LIST (tlist, output_list); + } + + if (disposables) + dispose_words (disposables); + + if (output_list) + output_list = REVERSE_LIST (output_list, WORD_LIST *); + + return (output_list); +} +#endif + +#if defined (ARRAY_VARS) +/* Take WORD, a compound associative array assignment, and internally run + 'declare -A w', where W is the variable name portion of WORD. */ +static int +make_internal_declare (word, option) + char *word; + char *option; +{ + int t; + WORD_LIST *wl; + WORD_DESC *w; + + w = make_word (word); + + t = assignment (w->word, 0); + w->word[t] = '\0'; + + wl = make_word_list (w, (WORD_LIST *)NULL); + wl = make_word_list (make_word (option), wl); + + return (declare_builtin (wl)); +} +#endif + +static WORD_LIST * +shell_expand_word_list (tlist, eflags) + WORD_LIST *tlist; + int eflags; +{ + WORD_LIST *expanded, *orig_list, *new_list, *next, *temp_list; + int expanded_something, has_dollar_at; + char *temp_string; + + /* We do tilde expansion all the time. This is what 1003.2 says. */ + new_list = (WORD_LIST *)NULL; + for (orig_list = tlist; tlist; tlist = next) + { + temp_string = tlist->word->word; + + next = tlist->next; + +#if defined (ARRAY_VARS) + /* If this is a compound array assignment to a builtin that accepts + such assignments (e.g., `declare'), take the assignment and perform + it separately, handling the semantics of declarations inside shell + functions. This avoids the double-evaluation of such arguments, + because `declare' does some evaluation of compound assignments on + its own. */ + if ((tlist->word->flags & (W_COMPASSIGN|W_ASSIGNARG)) == (W_COMPASSIGN|W_ASSIGNARG)) + { + int t; + char opts[8], opti; + + opti = 0; + if (tlist->word->flags & (W_ASSIGNASSOC|W_ASSNGLOBAL|W_ASSIGNARRAY)) + opts[opti++] = '-'; + + if ((tlist->word->flags & (W_ASSIGNASSOC|W_ASSNGLOBAL)) == (W_ASSIGNASSOC|W_ASSNGLOBAL)) + { + opts[opti++] = 'g'; + opts[opti++] = 'A'; + } + else if (tlist->word->flags & W_ASSIGNASSOC) + opts[opti++] = 'A'; + else if ((tlist->word->flags & (W_ASSIGNARRAY|W_ASSNGLOBAL)) == (W_ASSIGNARRAY|W_ASSNGLOBAL)) + { + opts[opti++] = 'g'; + opts[opti++] = 'a'; + } + else if (tlist->word->flags & W_ASSIGNARRAY) + opts[opti++] = 'a'; + else if (tlist->word->flags & W_ASSNGLOBAL) + opts[opti++] = 'g'; + +#if 0 + /* If we have special handling note the integer attribute */ + if (opti > 0 && (tlist->word->flags & W_ASSIGNINT)) + opts[opti++] = 'i'; +#endif + + opts[opti] = '\0'; + if (opti > 0) + make_internal_declare (tlist->word->word, opts); + + t = do_word_assignment (tlist->word, 0); + if (t == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + exp_jump_to_top_level (DISCARD); + } + + /* Now transform the word as ksh93 appears to do and go on */ + t = assignment (tlist->word->word, 0); + tlist->word->word[t] = '\0'; + tlist->word->flags &= ~(W_ASSIGNMENT|W_NOSPLIT|W_COMPASSIGN|W_ASSIGNARG|W_ASSIGNASSOC|W_ASSIGNARRAY); + } +#endif + + expanded_something = 0; + expanded = expand_word_internal + (tlist->word, 0, 0, &has_dollar_at, &expanded_something); + + if (expanded == &expand_word_error || expanded == &expand_word_fatal) + { + /* By convention, each time this error is returned, + tlist->word->word has already been freed. */ + tlist->word->word = (char *)NULL; + + /* Dispose our copy of the original list. */ + dispose_words (orig_list); + /* Dispose the new list we're building. */ + dispose_words (new_list); + + last_command_exit_value = EXECUTION_FAILURE; + if (expanded == &expand_word_error) + exp_jump_to_top_level (DISCARD); + else + exp_jump_to_top_level (FORCE_EOF); + } + + /* Don't split words marked W_NOSPLIT. */ + if (expanded_something && (tlist->word->flags & W_NOSPLIT) == 0) + { + temp_list = word_list_split (expanded); + dispose_words (expanded); + } + else + { + /* If no parameter expansion, command substitution, process + substitution, or arithmetic substitution took place, then + do not do word splitting. We still have to remove quoted + null characters from the result. */ + word_list_remove_quoted_nulls (expanded); + temp_list = expanded; + } + + expanded = REVERSE_LIST (temp_list, WORD_LIST *); + new_list = (WORD_LIST *)list_append (expanded, new_list); + } + + if (orig_list) + dispose_words (orig_list); + + if (new_list) + new_list = REVERSE_LIST (new_list, WORD_LIST *); + + return (new_list); +} + +/* The workhorse for expand_words () and expand_words_no_vars (). + First arg is LIST, a WORD_LIST of words. + Second arg EFLAGS is a flags word controlling which expansions are + performed. + + This does all of the substitutions: brace expansion, tilde expansion, + parameter expansion, command substitution, arithmetic expansion, + process substitution, word splitting, and pathname expansion, according + to the bits set in EFLAGS. Words with the W_QUOTED or W_NOSPLIT bits + set, or for which no expansion is done, do not undergo word splitting. + Words with the W_NOGLOB bit set do not undergo pathname expansion; words + with W_NOBRACE set do not undergo brace expansion (see + brace_expand_word_list above). */ +static WORD_LIST * +expand_word_list_internal (list, eflags) + WORD_LIST *list; + int eflags; +{ + WORD_LIST *new_list, *temp_list; + int tint; + + tempenv_assign_error = 0; + if (list == 0) + return ((WORD_LIST *)NULL); + + garglist = new_list = copy_word_list (list); + if (eflags & WEXP_VARASSIGN) + { + garglist = new_list = separate_out_assignments (new_list); + if (new_list == 0) + { + if (subst_assign_varlist) + { + /* All the words were variable assignments, so they are placed + into the shell's environment. */ + for (temp_list = subst_assign_varlist; temp_list; temp_list = temp_list->next) + { + this_command_name = (char *)NULL; /* no arithmetic errors */ + tint = do_word_assignment (temp_list->word, 0); + /* Variable assignment errors in non-interactive shells + running in Posix.2 mode cause the shell to exit. */ + if (tint == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + if (interactive_shell == 0 && posixly_correct) + exp_jump_to_top_level (FORCE_EOF); + else + exp_jump_to_top_level (DISCARD); + } + } + dispose_words (subst_assign_varlist); + subst_assign_varlist = (WORD_LIST *)NULL; + } + return ((WORD_LIST *)NULL); + } + } + + /* Begin expanding the words that remain. The expansions take place on + things that aren't really variable assignments. */ + +#if defined (BRACE_EXPANSION) + /* Do brace expansion on this word if there are any brace characters + in the string. */ + if ((eflags & WEXP_BRACEEXP) && brace_expansion && new_list) + new_list = brace_expand_word_list (new_list, eflags); +#endif /* BRACE_EXPANSION */ + + /* Perform the `normal' shell expansions: tilde expansion, parameter and + variable substitution, command substitution, arithmetic expansion, + and word splitting. */ + new_list = shell_expand_word_list (new_list, eflags); + + /* Okay, we're almost done. Now let's just do some filename + globbing. */ + if (new_list) + { + if ((eflags & WEXP_PATHEXP) && disallow_filename_globbing == 0) + /* Glob expand the word list unless globbing has been disabled. */ + new_list = glob_expand_word_list (new_list, eflags); + else + /* Dequote the words, because we're not performing globbing. */ + new_list = dequote_list (new_list); + } + + if ((eflags & WEXP_VARASSIGN) && subst_assign_varlist) + { + sh_wassign_func_t *assign_func; + int is_special_builtin, is_builtin_or_func; + + /* If the remainder of the words expand to nothing, Posix.2 requires + that the variable and environment assignments affect the shell's + environment. */ + assign_func = new_list ? assign_in_env : do_word_assignment; + tempenv_assign_error = 0; + + is_builtin_or_func = (new_list && new_list->word && (find_shell_builtin (new_list->word->word) || find_function (new_list->word->word))); + /* Posix says that special builtins exit if a variable assignment error + occurs in an assignment preceding it. */ + is_special_builtin = (posixly_correct && new_list && new_list->word && find_special_builtin (new_list->word->word)); + + for (temp_list = subst_assign_varlist; temp_list; temp_list = temp_list->next) + { + this_command_name = (char *)NULL; + assigning_in_environment = (assign_func == assign_in_env); + tint = (*assign_func) (temp_list->word, is_builtin_or_func); + assigning_in_environment = 0; + /* Variable assignment errors in non-interactive shells running + in Posix.2 mode cause the shell to exit. */ + if (tint == 0) + { + if (assign_func == do_word_assignment) + { + last_command_exit_value = EXECUTION_FAILURE; + if (interactive_shell == 0 && posixly_correct && is_special_builtin) + exp_jump_to_top_level (FORCE_EOF); + else + exp_jump_to_top_level (DISCARD); + } + else + tempenv_assign_error++; + } + } + + dispose_words (subst_assign_varlist); + subst_assign_varlist = (WORD_LIST *)NULL; + } + + return (new_list); +} diff --git a/.pc/bash43-001.diff/patchlevel.h b/.pc/bash43-001.diff/patchlevel.h new file mode 100644 index 0000000..d3516b2 --- /dev/null +++ b/.pc/bash43-001.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 0 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-001.diff/test.c b/.pc/bash43-001.diff/test.c new file mode 100644 index 0000000..7f0b28d --- /dev/null +++ b/.pc/bash43-001.diff/test.c @@ -0,0 +1,879 @@ +/* test.c - GNU test program (ksb and mjb) */ + +/* Modified to run with the GNU shell Apr 25, 1988 by bfox. */ + +/* Copyright (C) 1987-2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Define PATTERN_MATCHING to get the csh-like =~ and !~ pattern-matching + binary operators. */ +/* #define PATTERN_MATCHING */ + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include + +#include "bashtypes.h" + +#if !defined (HAVE_LIMITS_H) && defined (HAVE_SYS_PARAM_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +#if !defined (_POSIX_VERSION) && defined (HAVE_SYS_FILE_H) +# include +#endif /* !_POSIX_VERSION */ +#include "posixstat.h" +#include "filecntl.h" +#include "stat-time.h" + +#include "bashintl.h" + +#include "shell.h" +#include "pathexp.h" +#include "test.h" +#include "builtins/common.h" + +#include + +#if !defined (STRLEN) +# define STRLEN(s) ((s)[0] ? ((s)[1] ? ((s)[2] ? strlen(s) : 2) : 1) : 0) +#endif + +#if !defined (STREQ) +# define STREQ(a, b) ((a)[0] == (b)[0] && strcmp ((a), (b)) == 0) +#endif /* !STREQ */ +#define STRCOLLEQ(a, b) ((a)[0] == (b)[0] && strcoll ((a), (b)) == 0) + +#if !defined (R_OK) +#define R_OK 4 +#define W_OK 2 +#define X_OK 1 +#define F_OK 0 +#endif /* R_OK */ + +#define EQ 0 +#define NE 1 +#define LT 2 +#define GT 3 +#define LE 4 +#define GE 5 + +#define NT 0 +#define OT 1 +#define EF 2 + +/* The following few defines control the truth and false output of each stage. + TRUE and FALSE are what we use to compute the final output value. + SHELL_BOOLEAN is the form which returns truth or falseness in shell terms. + Default is TRUE = 1, FALSE = 0, SHELL_BOOLEAN = (!value). */ +#define TRUE 1 +#define FALSE 0 +#define SHELL_BOOLEAN(value) (!(value)) + +#define TEST_ERREXIT_STATUS 2 + +static procenv_t test_exit_buf; +static int test_error_return; +#define test_exit(val) \ + do { test_error_return = val; longjmp (test_exit_buf, 1); } while (0) + +extern int sh_stat __P((const char *, struct stat *)); + +static int pos; /* The offset of the current argument in ARGV. */ +static int argc; /* The number of arguments present in ARGV. */ +static char **argv; /* The argument list. */ +static int noeval; + +static void test_syntax_error __P((char *, char *)) __attribute__((__noreturn__)); +static void beyond __P((void)) __attribute__((__noreturn__)); +static void integer_expected_error __P((char *)) __attribute__((__noreturn__)); + +static int unary_operator __P((void)); +static int binary_operator __P((void)); +static int two_arguments __P((void)); +static int three_arguments __P((void)); +static int posixtest __P((void)); + +static int expr __P((void)); +static int term __P((void)); +static int and __P((void)); +static int or __P((void)); + +static int filecomp __P((char *, char *, int)); +static int arithcomp __P((char *, char *, int, int)); +static int patcomp __P((char *, char *, int)); + +static void +test_syntax_error (format, arg) + char *format, *arg; +{ + builtin_error (format, arg); + test_exit (TEST_ERREXIT_STATUS); +} + +/* + * beyond - call when we're beyond the end of the argument list (an + * error condition) + */ +static void +beyond () +{ + test_syntax_error (_("argument expected"), (char *)NULL); +} + +/* Syntax error for when an integer argument was expected, but + something else was found. */ +static void +integer_expected_error (pch) + char *pch; +{ + test_syntax_error (_("%s: integer expression expected"), pch); +} + +/* Increment our position in the argument list. Check that we're not + past the end of the argument list. This check is suppressed if the + argument is FALSE. Made a macro for efficiency. */ +#define advance(f) do { ++pos; if (f && pos >= argc) beyond (); } while (0) +#define unary_advance() do { advance (1); ++pos; } while (0) + +/* + * expr: + * or + */ +static int +expr () +{ + if (pos >= argc) + beyond (); + + return (FALSE ^ or ()); /* Same with this. */ +} + +/* + * or: + * and + * and '-o' or + */ +static int +or () +{ + int value, v2; + + value = and (); + if (pos < argc && argv[pos][0] == '-' && argv[pos][1] == 'o' && !argv[pos][2]) + { + advance (0); + v2 = or (); + return (value || v2); + } + + return (value); +} + +/* + * and: + * term + * term '-a' and + */ +static int +and () +{ + int value, v2; + + value = term (); + if (pos < argc && argv[pos][0] == '-' && argv[pos][1] == 'a' && !argv[pos][2]) + { + advance (0); + v2 = and (); + return (value && v2); + } + return (value); +} + +/* + * term - parse a term and return 1 or 0 depending on whether the term + * evaluates to true or false, respectively. + * + * term ::= + * '-'('a'|'b'|'c'|'d'|'e'|'f'|'g'|'h'|'k'|'p'|'r'|'s'|'u'|'w'|'x') filename + * '-'('G'|'L'|'O'|'S'|'N') filename + * '-t' [int] + * '-'('z'|'n') string + * '-o' option + * string + * string ('!='|'='|'==') string + * '-'(eq|ne|le|lt|ge|gt) + * file '-'(nt|ot|ef) file + * '(' ')' + * int ::= + * positive and negative integers + */ +static int +term () +{ + int value; + + if (pos >= argc) + beyond (); + + /* Deal with leading `not's. */ + if (argv[pos][0] == '!' && argv[pos][1] == '\0') + { + value = 0; + while (pos < argc && argv[pos][0] == '!' && argv[pos][1] == '\0') + { + advance (1); + value = 1 - value; + } + + return (value ? !term() : term()); + } + + /* A paren-bracketed argument. */ + if (argv[pos][0] == '(' && argv[pos][1] == '\0') /* ) */ + { + advance (1); + value = expr (); + if (argv[pos] == 0) /* ( */ + test_syntax_error (_("`)' expected"), (char *)NULL); + else if (argv[pos][0] != ')' || argv[pos][1]) /* ( */ + test_syntax_error (_("`)' expected, found %s"), argv[pos]); + advance (0); + return (value); + } + + /* are there enough arguments left that this could be dyadic? */ + if ((pos + 3 <= argc) && test_binop (argv[pos + 1])) + value = binary_operator (); + + /* Might be a switch type argument */ + else if (argv[pos][0] == '-' && argv[pos][2] == '\0') + { + if (test_unop (argv[pos])) + value = unary_operator (); + else + test_syntax_error (_("%s: unary operator expected"), argv[pos]); + } + else + { + value = argv[pos][0] != '\0'; + advance (0); + } + + return (value); +} + +static int +stat_mtime (fn, st, ts) + char *fn; + struct stat *st; + struct timespec *ts; +{ + int r; + + r = sh_stat (fn, st); + if (r < 0) + return r; + *ts = get_stat_mtime (st); + return 0; +} + +static int +filecomp (s, t, op) + char *s, *t; + int op; +{ + struct stat st1, st2; + struct timespec ts1, ts2; + int r1, r2; + + if ((r1 = stat_mtime (s, &st1, &ts1)) < 0) + { + if (op == EF) + return (FALSE); + } + if ((r2 = stat_mtime (t, &st2, &ts2)) < 0) + { + if (op == EF) + return (FALSE); + } + + switch (op) + { + case OT: return (r1 < r2 || (r2 == 0 && timespec_cmp (ts1, ts2) < 0)); + case NT: return (r1 > r2 || (r1 == 0 && timespec_cmp (ts1, ts2) > 0)); + case EF: return (same_file (s, t, &st1, &st2)); + } + return (FALSE); +} + +static int +arithcomp (s, t, op, flags) + char *s, *t; + int op, flags; +{ + intmax_t l, r; + int expok; + + if (flags & TEST_ARITHEXP) + { + l = evalexp (s, &expok); + if (expok == 0) + return (FALSE); /* should probably longjmp here */ + r = evalexp (t, &expok); + if (expok == 0) + return (FALSE); /* ditto */ + } + else + { + if (legal_number (s, &l) == 0) + integer_expected_error (s); + if (legal_number (t, &r) == 0) + integer_expected_error (t); + } + + switch (op) + { + case EQ: return (l == r); + case NE: return (l != r); + case LT: return (l < r); + case GT: return (l > r); + case LE: return (l <= r); + case GE: return (l >= r); + } + + return (FALSE); +} + +static int +patcomp (string, pat, op) + char *string, *pat; + int op; +{ + int m; + + m = strmatch (pat, string, FNMATCH_EXTFLAG|FNMATCH_IGNCASE); + return ((op == EQ) ? (m == 0) : (m != 0)); +} + +int +binary_test (op, arg1, arg2, flags) + char *op, *arg1, *arg2; + int flags; +{ + int patmatch; + + patmatch = (flags & TEST_PATMATCH); + + if (op[0] == '=' && (op[1] == '\0' || (op[1] == '=' && op[2] == '\0'))) + return (patmatch ? patcomp (arg1, arg2, EQ) : STREQ (arg1, arg2)); + else if ((op[0] == '>' || op[0] == '<') && op[1] == '\0') + { +#if defined (HAVE_STRCOLL) + if (shell_compatibility_level > 40 && flags & TEST_LOCALE) + return ((op[0] == '>') ? (strcoll (arg1, arg2) > 0) : (strcoll (arg1, arg2) < 0)); + else +#endif + return ((op[0] == '>') ? (strcmp (arg1, arg2) > 0) : (strcmp (arg1, arg2) < 0)); + } + else if (op[0] == '!' && op[1] == '=' && op[2] == '\0') + return (patmatch ? patcomp (arg1, arg2, NE) : (STREQ (arg1, arg2) == 0)); + + + else if (op[2] == 't') + { + switch (op[1]) + { + case 'n': return (filecomp (arg1, arg2, NT)); /* -nt */ + case 'o': return (filecomp (arg1, arg2, OT)); /* -ot */ + case 'l': return (arithcomp (arg1, arg2, LT, flags)); /* -lt */ + case 'g': return (arithcomp (arg1, arg2, GT, flags)); /* -gt */ + } + } + else if (op[1] == 'e') + { + switch (op[2]) + { + case 'f': return (filecomp (arg1, arg2, EF)); /* -ef */ + case 'q': return (arithcomp (arg1, arg2, EQ, flags)); /* -eq */ + } + } + else if (op[2] == 'e') + { + switch (op[1]) + { + case 'n': return (arithcomp (arg1, arg2, NE, flags)); /* -ne */ + case 'g': return (arithcomp (arg1, arg2, GE, flags)); /* -ge */ + case 'l': return (arithcomp (arg1, arg2, LE, flags)); /* -le */ + } + } + + return (FALSE); /* should never get here */ +} + + +static int +binary_operator () +{ + int value; + char *w; + + w = argv[pos + 1]; + if ((w[0] == '=' && (w[1] == '\0' || (w[1] == '=' && w[2] == '\0'))) || /* =, == */ + ((w[0] == '>' || w[0] == '<') && w[1] == '\0') || /* <, > */ + (w[0] == '!' && w[1] == '=' && w[2] == '\0')) /* != */ + { + value = binary_test (w, argv[pos], argv[pos + 2], 0); + pos += 3; + return (value); + } + +#if defined (PATTERN_MATCHING) + if ((w[0] == '=' || w[0] == '!') && w[1] == '~' && w[2] == '\0') + { + value = patcomp (argv[pos], argv[pos + 2], w[0] == '=' ? EQ : NE); + pos += 3; + return (value); + } +#endif + + if ((w[0] != '-' || w[3] != '\0') || test_binop (w) == 0) + { + test_syntax_error (_("%s: binary operator expected"), w); + /* NOTREACHED */ + return (FALSE); + } + + value = binary_test (w, argv[pos], argv[pos + 2], 0); + pos += 3; + return value; +} + +static int +unary_operator () +{ + char *op; + intmax_t r; + + op = argv[pos]; + if (test_unop (op) == 0) + return (FALSE); + + /* the only tricky case is `-t', which may or may not take an argument. */ + if (op[1] == 't') + { + advance (0); + if (pos < argc) + { + if (legal_number (argv[pos], &r)) + { + advance (0); + return (unary_test (op, argv[pos - 1])); + } + else + return (FALSE); + } + else + return (unary_test (op, "1")); + } + + /* All of the unary operators take an argument, so we first call + unary_advance (), which checks to make sure that there is an + argument, and then advances pos right past it. This means that + pos - 1 is the location of the argument. */ + unary_advance (); + return (unary_test (op, argv[pos - 1])); +} + +int +unary_test (op, arg) + char *op, *arg; +{ + intmax_t r; + struct stat stat_buf; + SHELL_VAR *v; + + switch (op[1]) + { + case 'a': /* file exists in the file system? */ + case 'e': + return (sh_stat (arg, &stat_buf) == 0); + + case 'r': /* file is readable? */ + return (sh_eaccess (arg, R_OK) == 0); + + case 'w': /* File is writeable? */ + return (sh_eaccess (arg, W_OK) == 0); + + case 'x': /* File is executable? */ + return (sh_eaccess (arg, X_OK) == 0); + + case 'O': /* File is owned by you? */ + return (sh_stat (arg, &stat_buf) == 0 && + (uid_t) current_user.euid == (uid_t) stat_buf.st_uid); + + case 'G': /* File is owned by your group? */ + return (sh_stat (arg, &stat_buf) == 0 && + (gid_t) current_user.egid == (gid_t) stat_buf.st_gid); + + case 'N': + return (sh_stat (arg, &stat_buf) == 0 && + stat_buf.st_atime <= stat_buf.st_mtime); + + case 'f': /* File is a file? */ + if (sh_stat (arg, &stat_buf) < 0) + return (FALSE); + + /* -f is true if the given file exists and is a regular file. */ +#if defined (S_IFMT) + return (S_ISREG (stat_buf.st_mode) || (stat_buf.st_mode & S_IFMT) == 0); +#else + return (S_ISREG (stat_buf.st_mode)); +#endif /* !S_IFMT */ + + case 'd': /* File is a directory? */ + return (sh_stat (arg, &stat_buf) == 0 && (S_ISDIR (stat_buf.st_mode))); + + case 's': /* File has something in it? */ + return (sh_stat (arg, &stat_buf) == 0 && stat_buf.st_size > (off_t) 0); + + case 'S': /* File is a socket? */ +#if !defined (S_ISSOCK) + return (FALSE); +#else + return (sh_stat (arg, &stat_buf) == 0 && S_ISSOCK (stat_buf.st_mode)); +#endif /* S_ISSOCK */ + + case 'c': /* File is character special? */ + return (sh_stat (arg, &stat_buf) == 0 && S_ISCHR (stat_buf.st_mode)); + + case 'b': /* File is block special? */ + return (sh_stat (arg, &stat_buf) == 0 && S_ISBLK (stat_buf.st_mode)); + + case 'p': /* File is a named pipe? */ +#ifndef S_ISFIFO + return (FALSE); +#else + return (sh_stat (arg, &stat_buf) == 0 && S_ISFIFO (stat_buf.st_mode)); +#endif /* S_ISFIFO */ + + case 'L': /* Same as -h */ + case 'h': /* File is a symbolic link? */ +#if !defined (S_ISLNK) || !defined (HAVE_LSTAT) + return (FALSE); +#else + return ((arg[0] != '\0') && + (lstat (arg, &stat_buf) == 0) && S_ISLNK (stat_buf.st_mode)); +#endif /* S_IFLNK && HAVE_LSTAT */ + + case 'u': /* File is setuid? */ + return (sh_stat (arg, &stat_buf) == 0 && (stat_buf.st_mode & S_ISUID) != 0); + + case 'g': /* File is setgid? */ + return (sh_stat (arg, &stat_buf) == 0 && (stat_buf.st_mode & S_ISGID) != 0); + + case 'k': /* File has sticky bit set? */ +#if !defined (S_ISVTX) + /* This is not Posix, and is not defined on some Posix systems. */ + return (FALSE); +#else + return (sh_stat (arg, &stat_buf) == 0 && (stat_buf.st_mode & S_ISVTX) != 0); +#endif + + case 't': /* File fd is a terminal? */ + if (legal_number (arg, &r) == 0) + return (FALSE); + return ((r == (int)r) && isatty ((int)r)); + + case 'n': /* True if arg has some length. */ + return (arg[0] != '\0'); + + case 'z': /* True if arg has no length. */ + return (arg[0] == '\0'); + + case 'o': /* True if option `arg' is set. */ + return (minus_o_option_value (arg) == 1); + + case 'v': + v = find_variable (arg); +#if defined (ARRAY_VARS) + if (v == 0 && valid_array_reference (arg)) + { + char *t; + t = array_value (arg, 0, 0, (int *)0, (arrayind_t *)0); + return (t ? TRUE : FALSE); + } + else if (v && invisible_p (v) == 0 && array_p (v)) + { + char *t; + /* [[ -v foo ]] == [[ -v foo[0] ]] */ + t = array_reference (array_cell (v), 0); + return (t ? TRUE : FALSE); + } + else if (v && invisible_p (v) == 0 && assoc_p (v)) + { + char *t; + t = assoc_reference (assoc_cell (v), "0"); + return (t ? TRUE : FALSE); + } +#endif + return (v && invisible_p (v) == 0 && var_isset (v) ? TRUE : FALSE); + + case 'R': + v = find_variable (arg); + return (v && invisible_p (v) == 0 && var_isset (v) && nameref_p (v) ? TRUE : FALSE); + } + + /* We can't actually get here, but this shuts up gcc. */ + return (FALSE); +} + +/* Return TRUE if OP is one of the test command's binary operators. */ +int +test_binop (op) + char *op; +{ + if (op[0] == '=' && op[1] == '\0') + return (1); /* '=' */ + else if ((op[0] == '<' || op[0] == '>') && op[1] == '\0') /* string <, > */ + return (1); + else if ((op[0] == '=' || op[0] == '!') && op[1] == '=' && op[2] == '\0') + return (1); /* `==' and `!=' */ +#if defined (PATTERN_MATCHING) + else if (op[2] == '\0' && op[1] == '~' && (op[0] == '=' || op[0] == '!')) + return (1); +#endif + else if (op[0] != '-' || op[2] == '\0' || op[3] != '\0') + return (0); + else + { + if (op[2] == 't') + switch (op[1]) + { + case 'n': /* -nt */ + case 'o': /* -ot */ + case 'l': /* -lt */ + case 'g': /* -gt */ + return (1); + default: + return (0); + } + else if (op[1] == 'e') + switch (op[2]) + { + case 'q': /* -eq */ + case 'f': /* -ef */ + return (1); + default: + return (0); + } + else if (op[2] == 'e') + switch (op[1]) + { + case 'n': /* -ne */ + case 'g': /* -ge */ + case 'l': /* -le */ + return (1); + default: + return (0); + } + else + return (0); + } +} + +/* Return non-zero if OP is one of the test command's unary operators. */ +int +test_unop (op) + char *op; +{ + if (op[0] != '-' || op[2] != 0) + return (0); + + switch (op[1]) + { + case 'a': case 'b': case 'c': case 'd': case 'e': + case 'f': case 'g': case 'h': case 'k': case 'n': + case 'o': case 'p': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': case 'z': + case 'G': case 'L': case 'O': case 'S': case 'N': + return (1); + } + + return (0); +} + +static int +two_arguments () +{ + if (argv[pos][0] == '!' && argv[pos][1] == '\0') + return (argv[pos + 1][0] == '\0'); + else if (argv[pos][0] == '-' && argv[pos][2] == '\0') + { + if (test_unop (argv[pos])) + return (unary_operator ()); + else + test_syntax_error (_("%s: unary operator expected"), argv[pos]); + } + else + test_syntax_error (_("%s: unary operator expected"), argv[pos]); + + return (0); +} + +#define ANDOR(s) (s[0] == '-' && !s[2] && (s[1] == 'a' || s[1] == 'o')) + +/* This could be augmented to handle `-t' as equivalent to `-t 1', but + POSIX requires that `-t' be given an argument. */ +#define ONE_ARG_TEST(s) ((s)[0] != '\0') + +static int +three_arguments () +{ + int value; + + if (test_binop (argv[pos+1])) + { + value = binary_operator (); + pos = argc; + } + else if (ANDOR (argv[pos+1])) + { + if (argv[pos+1][1] == 'a') + value = ONE_ARG_TEST(argv[pos]) && ONE_ARG_TEST(argv[pos+2]); + else + value = ONE_ARG_TEST(argv[pos]) || ONE_ARG_TEST(argv[pos+2]); + pos = argc; + } + else if (argv[pos][0] == '!' && argv[pos][1] == '\0') + { + advance (1); + value = !two_arguments (); + } + else if (argv[pos][0] == '(' && argv[pos+2][0] == ')') + { + value = ONE_ARG_TEST(argv[pos+1]); + pos = argc; + } + else + test_syntax_error (_("%s: binary operator expected"), argv[pos+1]); + + return (value); +} + +/* This is an implementation of a Posix.2 proposal by David Korn. */ +static int +posixtest () +{ + int value; + + switch (argc - 1) /* one extra passed in */ + { + case 0: + value = FALSE; + pos = argc; + break; + + case 1: + value = ONE_ARG_TEST(argv[1]); + pos = argc; + break; + + case 2: + value = two_arguments (); + pos = argc; + break; + + case 3: + value = three_arguments (); + break; + + case 4: + if (argv[pos][0] == '!' && argv[pos][1] == '\0') + { + advance (1); + value = !three_arguments (); + break; + } + /* FALLTHROUGH */ + default: + value = expr (); + } + + return (value); +} + +/* + * [: + * '[' expr ']' + * test: + * test expr + */ +int +test_command (margc, margv) + int margc; + char **margv; +{ + int value; + int code; + + USE_VAR(margc); + + code = setjmp_nosigs (test_exit_buf); + + if (code) + return (test_error_return); + + argv = margv; + + if (margv[0] && margv[0][0] == '[' && margv[0][1] == '\0') + { + --margc; + + if (margv[margc] && (margv[margc][0] != ']' || margv[margc][1])) + test_syntax_error (_("missing `]'"), (char *)NULL); + + if (margc < 2) + test_exit (SHELL_BOOLEAN (FALSE)); + } + + argc = margc; + pos = 1; + + if (pos >= argc) + test_exit (SHELL_BOOLEAN (FALSE)); + + noeval = 0; + value = posixtest (); + + if (pos != argc) + test_syntax_error (_("too many arguments"), (char *)NULL); + + test_exit (SHELL_BOOLEAN (value)); +} diff --git a/.pc/bash43-002.diff/patchlevel.h b/.pc/bash43-002.diff/patchlevel.h new file mode 100644 index 0000000..15f3c51 --- /dev/null +++ b/.pc/bash43-002.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 1 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-002.diff/trap.c b/.pc/bash43-002.diff/trap.c new file mode 100644 index 0000000..15d3fc8 --- /dev/null +++ b/.pc/bash43-002.diff/trap.c @@ -0,0 +1,1263 @@ +/* trap.c -- Not the trap command, but useful functions for manipulating + those objects. The trap command is in builtins/trap.def. */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashtypes.h" +#include "bashansi.h" + +#include +#include + +#include "bashintl.h" + +#include + +#include "trap.h" + +#include "shell.h" +#include "flags.h" +#include "input.h" /* for save_token_state, restore_token_state */ +#include "jobs.h" +#include "signames.h" +#include "builtins.h" +#include "builtins/common.h" +#include "builtins/builtext.h" + +#if defined (READLINE) +# include +# include "bashline.h" +#endif + +#ifndef errno +extern int errno; +#endif + +/* Flags which describe the current handling state of a signal. */ +#define SIG_INHERITED 0x0 /* Value inherited from parent. */ +#define SIG_TRAPPED 0x1 /* Currently trapped. */ +#define SIG_HARD_IGNORE 0x2 /* Signal was ignored on shell entry. */ +#define SIG_SPECIAL 0x4 /* Treat this signal specially. */ +#define SIG_NO_TRAP 0x8 /* Signal cannot be trapped. */ +#define SIG_INPROGRESS 0x10 /* Signal handler currently executing. */ +#define SIG_CHANGED 0x20 /* Trap value changed in trap handler. */ +#define SIG_IGNORED 0x40 /* The signal is currently being ignored. */ + +#define SPECIAL_TRAP(s) ((s) == EXIT_TRAP || (s) == DEBUG_TRAP || (s) == ERROR_TRAP || (s) == RETURN_TRAP) + +/* An array of such flags, one for each signal, describing what the + shell will do with a signal. DEBUG_TRAP == NSIG; some code below + assumes this. */ +static int sigmodes[BASH_NSIG]; + +static void free_trap_command __P((int)); +static void change_signal __P((int, char *)); + +static int _run_trap_internal __P((int, char *)); + +static void free_trap_string __P((int)); +static void reset_signal __P((int)); +static void restore_signal __P((int)); +static void reset_or_restore_signal_handlers __P((sh_resetsig_func_t *)); + +/* Variables used here but defined in other files. */ +extern int last_command_exit_value; +extern int line_number; + +extern int sigalrm_seen; +extern procenv_t alrmbuf; + +extern char *this_command_name; +extern sh_builtin_func_t *this_shell_builtin; +extern procenv_t wait_intr_buf; +extern int return_catch_flag, return_catch_value; +extern int subshell_level; +extern WORD_LIST *subst_assign_varlist; + +/* The list of things to do originally, before we started trapping. */ +SigHandler *original_signals[NSIG]; + +/* For each signal, a slot for a string, which is a command to be + executed when that signal is received. The slot can also contain + DEFAULT_SIG, which means do whatever you were going to do before + you were so rudely interrupted, or IGNORE_SIG, which says ignore + this signal. */ +char *trap_list[BASH_NSIG]; + +/* A bitmap of signals received for which we have trap handlers. */ +int pending_traps[NSIG]; + +/* Set to the number of the signal we're running the trap for + 1. + Used in execute_cmd.c and builtins/common.c to clean up when + parse_and_execute does not return normally after executing the + trap command (e.g., when `return' is executed in the trap command). */ +int running_trap; + +/* Set to last_command_exit_value before running a trap. */ +int trap_saved_exit_value; + +/* The (trapped) signal received while executing in the `wait' builtin */ +int wait_signal_received; + +int trapped_signal_received; + +#define GETORIGSIG(sig) \ + do { \ + original_signals[sig] = (SigHandler *)set_signal_handler (sig, SIG_DFL); \ + set_signal_handler (sig, original_signals[sig]); \ + if (original_signals[sig] == SIG_IGN) \ + sigmodes[sig] |= SIG_HARD_IGNORE; \ + } while (0) + +#define SETORIGSIG(sig,handler) \ + do { \ + original_signals[sig] = handler; \ + if (original_signals[sig] == SIG_IGN) \ + sigmodes[sig] |= SIG_HARD_IGNORE; \ + } while (0) + +#define GET_ORIGINAL_SIGNAL(sig) \ + if (sig && sig < NSIG && original_signals[sig] == IMPOSSIBLE_TRAP_HANDLER) \ + GETORIGSIG(sig) + +void +initialize_traps () +{ + register int i; + + initialize_signames(); + + trap_list[EXIT_TRAP] = trap_list[DEBUG_TRAP] = trap_list[ERROR_TRAP] = trap_list[RETURN_TRAP] = (char *)NULL; + sigmodes[EXIT_TRAP] = sigmodes[DEBUG_TRAP] = sigmodes[ERROR_TRAP] = sigmodes[RETURN_TRAP] = SIG_INHERITED; + original_signals[EXIT_TRAP] = IMPOSSIBLE_TRAP_HANDLER; + + for (i = 1; i < NSIG; i++) + { + pending_traps[i] = 0; + trap_list[i] = (char *)DEFAULT_SIG; + sigmodes[i] = SIG_INHERITED; /* XXX - only set, not used */ + original_signals[i] = IMPOSSIBLE_TRAP_HANDLER; + } + + /* Show which signals are treated specially by the shell. */ +#if defined (SIGCHLD) + GETORIGSIG (SIGCHLD); + sigmodes[SIGCHLD] |= (SIG_SPECIAL | SIG_NO_TRAP); +#endif /* SIGCHLD */ + + GETORIGSIG (SIGINT); + sigmodes[SIGINT] |= SIG_SPECIAL; + +#if defined (__BEOS__) + /* BeOS sets SIGINT to SIG_IGN! */ + original_signals[SIGINT] = SIG_DFL; + sigmodes[SIGINT] &= ~SIG_HARD_IGNORE; +#endif + + GETORIGSIG (SIGQUIT); + sigmodes[SIGQUIT] |= SIG_SPECIAL; + + if (interactive) + { + GETORIGSIG (SIGTERM); + sigmodes[SIGTERM] |= SIG_SPECIAL; + } +} + +#ifdef DEBUG +/* Return a printable representation of the trap handler for SIG. */ +static char * +trap_handler_string (sig) + int sig; +{ + if (trap_list[sig] == (char *)DEFAULT_SIG) + return "DEFAULT_SIG"; + else if (trap_list[sig] == (char *)IGNORE_SIG) + return "IGNORE_SIG"; + else if (trap_list[sig] == (char *)IMPOSSIBLE_TRAP_HANDLER) + return "IMPOSSIBLE_TRAP_HANDLER"; + else if (trap_list[sig]) + return trap_list[sig]; + else + return "NULL"; +} +#endif + +/* Return the print name of this signal. */ +char * +signal_name (sig) + int sig; +{ + char *ret; + + /* on cygwin32, signal_names[sig] could be null */ + ret = (sig >= BASH_NSIG || sig < 0 || signal_names[sig] == NULL) + ? _("invalid signal number") + : signal_names[sig]; + + return ret; +} + +/* Turn a string into a signal number, or a number into + a signal number. If STRING is "2", "SIGINT", or "INT", + then (int)2 is returned. Return NO_SIG if STRING doesn't + contain a valid signal descriptor. */ +int +decode_signal (string, flags) + char *string; + int flags; +{ + intmax_t sig; + char *name; + + if (legal_number (string, &sig)) + return ((sig >= 0 && sig < NSIG) ? (int)sig : NO_SIG); + + /* A leading `SIG' may be omitted. */ + for (sig = 0; sig < BASH_NSIG; sig++) + { + name = signal_names[sig]; + if (name == 0 || name[0] == '\0') + continue; + + /* Check name without the SIG prefix first case sensitively or + insensitively depending on whether flags includes DSIG_NOCASE */ + if (STREQN (name, "SIG", 3)) + { + name += 3; + + if ((flags & DSIG_NOCASE) && strcasecmp (string, name) == 0) + return ((int)sig); + else if ((flags & DSIG_NOCASE) == 0 && strcmp (string, name) == 0) + return ((int)sig); + /* If we can't use the `SIG' prefix to match, punt on this + name now. */ + else if ((flags & DSIG_SIGPREFIX) == 0) + continue; + } + + /* Check name with SIG prefix case sensitively or insensitively + depending on whether flags includes DSIG_NOCASE */ + name = signal_names[sig]; + if ((flags & DSIG_NOCASE) && strcasecmp (string, name) == 0) + return ((int)sig); + else if ((flags & DSIG_NOCASE) == 0 && strcmp (string, name) == 0) + return ((int)sig); + } + + return (NO_SIG); +} + +/* Non-zero when we catch a trapped signal. */ +static int catch_flag; + +void +run_pending_traps () +{ + register int sig; + int old_exit_value; + WORD_LIST *save_subst_varlist; + sh_parser_state_t pstate; +#if defined (ARRAY_VARS) + ARRAY *ps; +#endif + + if (catch_flag == 0) /* simple optimization */ + return; + + if (running_trap > 0) + { +#if defined (DEBUG) + internal_warning ("run_pending_traps: recursive invocation while running trap for signal %d", running_trap-1); +#endif +#if 0 + return; /* no recursive trap invocations */ +#else + ; +#endif + } + + catch_flag = trapped_signal_received = 0; + + /* Preserve $? when running trap. */ + old_exit_value = last_command_exit_value; +#if defined (ARRAY_VARS) + ps = save_pipestatus_array (); +#endif + + for (sig = 1; sig < NSIG; sig++) + { + /* XXX this could be made into a counter by using + while (pending_traps[sig]--) instead of the if statement. */ + if (pending_traps[sig]) + { + if (running_trap == sig+1) + /*continue*/; + + running_trap = sig + 1; + + if (sig == SIGINT) + { + pending_traps[sig] = 0; /* XXX */ + run_interrupt_trap (); + CLRINTERRUPT; + } +#if defined (JOB_CONTROL) && defined (SIGCHLD) + else if (sig == SIGCHLD && + trap_list[SIGCHLD] != (char *)IMPOSSIBLE_TRAP_HANDLER && + (sigmodes[SIGCHLD] & SIG_INPROGRESS) == 0) + { + sigmodes[SIGCHLD] |= SIG_INPROGRESS; + run_sigchld_trap (pending_traps[sig]); /* use as counter */ + sigmodes[SIGCHLD] &= ~SIG_INPROGRESS; + } + else if (sig == SIGCHLD && + trap_list[SIGCHLD] == (char *)IMPOSSIBLE_TRAP_HANDLER && + (sigmodes[SIGCHLD] & SIG_INPROGRESS) != 0) + { + /* This can happen when run_pending_traps is called while + running a SIGCHLD trap handler. */ + running_trap = 0; + /* want to leave pending_traps[SIGCHLD] alone here */ + continue; /* XXX */ + } + else if (sig == SIGCHLD && (sigmodes[SIGCHLD] & SIG_INPROGRESS)) + { + /* whoops -- print warning? */ + running_trap = 0; /* XXX */ + /* want to leave pending_traps[SIGCHLD] alone here */ + continue; + } +#endif + else if (trap_list[sig] == (char *)DEFAULT_SIG || + trap_list[sig] == (char *)IGNORE_SIG || + trap_list[sig] == (char *)IMPOSSIBLE_TRAP_HANDLER) + { + /* This is possible due to a race condition. Say a bash + process has SIGTERM trapped. A subshell is spawned + using { list; } & and the parent does something and kills + the subshell with SIGTERM. It's possible for the subshell + to set pending_traps[SIGTERM] to 1 before the code in + execute_cmd.c eventually calls restore_original_signals + to reset the SIGTERM signal handler in the subshell. The + next time run_pending_traps is called, pending_traps[SIGTERM] + will be 1, but the trap handler in trap_list[SIGTERM] will + be invalid (probably DEFAULT_SIG, but it could be IGNORE_SIG). + Unless we catch this, the subshell will dump core when + trap_list[SIGTERM] == DEFAULT_SIG, because DEFAULT_SIG is + usually 0x0. */ + internal_warning (_("run_pending_traps: bad value in trap_list[%d]: %p"), + sig, trap_list[sig]); + if (trap_list[sig] == (char *)DEFAULT_SIG) + { + internal_warning (_("run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself"), sig, signal_name (sig)); + kill (getpid (), sig); + } + } + else + { + /* XXX - should we use save_parser_state/restore_parser_state? */ + save_parser_state (&pstate); + save_subst_varlist = subst_assign_varlist; + subst_assign_varlist = 0; + +#if defined (JOB_CONTROL) + save_pipeline (1); /* XXX only provides one save level */ +#endif + /* XXX - set pending_traps[sig] = 0 here? */ + pending_traps[sig] = 0; + evalstring (savestring (trap_list[sig]), "trap", SEVAL_NONINT|SEVAL_NOHIST|SEVAL_RESETLINE); +#if defined (JOB_CONTROL) + restore_pipeline (1); +#endif + + subst_assign_varlist = save_subst_varlist; + restore_parser_state (&pstate); + } + + pending_traps[sig] = 0; /* XXX - move before evalstring? */ + running_trap = 0; + } + } + +#if defined (ARRAY_VARS) + restore_pipestatus_array (ps); +#endif + last_command_exit_value = old_exit_value; +} + +sighandler +trap_handler (sig) + int sig; +{ + int oerrno; + + if ((sigmodes[sig] & SIG_TRAPPED) == 0) + { +#if defined (DEBUG) + internal_warning ("trap_handler: signal %d: signal not trapped", sig); +#endif + SIGRETURN (0); + } + + if ((sig >= NSIG) || + (trap_list[sig] == (char *)DEFAULT_SIG) || + (trap_list[sig] == (char *)IGNORE_SIG)) + programming_error (_("trap_handler: bad signal %d"), sig); + else + { + oerrno = errno; +#if defined (MUST_REINSTALL_SIGHANDLERS) +# if defined (JOB_CONTROL) && defined (SIGCHLD) + if (sig != SIGCHLD) +# endif /* JOB_CONTROL && SIGCHLD */ + set_signal_handler (sig, trap_handler); +#endif /* MUST_REINSTALL_SIGHANDLERS */ + + catch_flag = 1; + pending_traps[sig]++; + + trapped_signal_received = sig; + + if (this_shell_builtin && (this_shell_builtin == wait_builtin)) + { + wait_signal_received = sig; + if (interrupt_immediately) + longjmp (wait_intr_buf, 1); + } + +#if defined (READLINE) + /* Set the event hook so readline will call it after the signal handlers + finish executing, so if this interrupted character input we can get + quick response. */ + if (RL_ISSTATE (RL_STATE_SIGHANDLER) && interrupt_immediately == 0) + bashline_set_event_hook (); +#endif + + if (interrupt_immediately) + run_pending_traps (); + + errno = oerrno; + } + + SIGRETURN (0); +} + +int +first_pending_trap () +{ + register int i; + + for (i = 1; i < NSIG; i++) + if (pending_traps[i]) + return i; + return -1; +} + +int +any_signals_trapped () +{ + register int i; + + for (i = 1; i < NSIG; i++) + if (sigmodes[i] & SIG_TRAPPED) + return i; + return -1; +} + +void +check_signals () +{ + CHECK_ALRM; /* set by the read builtin */ + QUIT; +} + +/* Convenience functions the rest of the shell can use */ +void +check_signals_and_traps () +{ + check_signals (); + + run_pending_traps (); +} + +#if defined (JOB_CONTROL) && defined (SIGCHLD) + +#ifdef INCLUDE_UNUSED +/* Make COMMAND_STRING be executed when SIGCHLD is caught. */ +void +set_sigchld_trap (command_string) + char *command_string; +{ + set_signal (SIGCHLD, command_string); +} +#endif + +/* Make COMMAND_STRING be executed when SIGCHLD is caught iff SIGCHLD + is not already trapped. IMPOSSIBLE_TRAP_HANDLER is used as a sentinel + to make sure that a SIGCHLD trap handler run via run_sigchld_trap can + reset the disposition to the default and not have the original signal + accidentally restored, undoing the user's command. */ +void +maybe_set_sigchld_trap (command_string) + char *command_string; +{ + if ((sigmodes[SIGCHLD] & SIG_TRAPPED) == 0 && trap_list[SIGCHLD] == (char *)IMPOSSIBLE_TRAP_HANDLER) + set_signal (SIGCHLD, command_string); +} + +/* Temporarily set the SIGCHLD trap string to IMPOSSIBLE_TRAP_HANDLER. Used + as a sentinel in run_sigchld_trap and maybe_set_sigchld_trap to see whether + or not a SIGCHLD trap handler reset SIGCHLD disposition to the default. */ +void +set_impossible_sigchld_trap () +{ + restore_default_signal (SIGCHLD); + change_signal (SIGCHLD, (char *)IMPOSSIBLE_TRAP_HANDLER); + sigmodes[SIGCHLD] &= ~SIG_TRAPPED; /* maybe_set_sigchld_trap checks this */ +} + +/* Act as if we received SIGCHLD NCHILD times and increment + pending_traps[SIGCHLD] by that amount. This allows us to still run the + SIGCHLD trap once for each exited child. */ +void +queue_sigchld_trap (nchild) + int nchild; +{ + if (nchild > 0) + { + catch_flag = 1; + pending_traps[SIGCHLD] += nchild; + trapped_signal_received = SIGCHLD; + } +} +#endif /* JOB_CONTROL && SIGCHLD */ + +void +set_debug_trap (command) + char *command; +{ + set_signal (DEBUG_TRAP, command); +} + +void +set_error_trap (command) + char *command; +{ + set_signal (ERROR_TRAP, command); +} + +void +set_return_trap (command) + char *command; +{ + set_signal (RETURN_TRAP, command); +} + +#ifdef INCLUDE_UNUSED +void +set_sigint_trap (command) + char *command; +{ + set_signal (SIGINT, command); +} +#endif + +/* Reset the SIGINT handler so that subshells that are doing `shellsy' + things, like waiting for command substitution or executing commands + in explicit subshells ( ( cmd ) ), can catch interrupts properly. */ +SigHandler * +set_sigint_handler () +{ + if (sigmodes[SIGINT] & SIG_HARD_IGNORE) + return ((SigHandler *)SIG_IGN); + + else if (sigmodes[SIGINT] & SIG_IGNORED) + return ((SigHandler *)set_signal_handler (SIGINT, SIG_IGN)); /* XXX */ + + else if (sigmodes[SIGINT] & SIG_TRAPPED) + return ((SigHandler *)set_signal_handler (SIGINT, trap_handler)); + + /* The signal is not trapped, so set the handler to the shell's special + interrupt handler. */ + else if (interactive) /* XXX - was interactive_shell */ + return (set_signal_handler (SIGINT, sigint_sighandler)); + else + return (set_signal_handler (SIGINT, termsig_sighandler)); +} + +/* Return the correct handler for signal SIG according to the values in + sigmodes[SIG]. */ +SigHandler * +trap_to_sighandler (sig) + int sig; +{ + if (sigmodes[sig] & (SIG_IGNORED|SIG_HARD_IGNORE)) + return (SIG_IGN); + else if (sigmodes[sig] & SIG_TRAPPED) + return (trap_handler); + else + return (SIG_DFL); +} + +/* Set SIG to call STRING as a command. */ +void +set_signal (sig, string) + int sig; + char *string; +{ + sigset_t set, oset; + + if (SPECIAL_TRAP (sig)) + { + change_signal (sig, savestring (string)); + if (sig == EXIT_TRAP && interactive == 0) + initialize_terminating_signals (); + return; + } + + /* A signal ignored on entry to the shell cannot be trapped or reset, but + no error is reported when attempting to do so. -- Posix.2 */ + if (sigmodes[sig] & SIG_HARD_IGNORE) + return; + + /* Make sure we have original_signals[sig] if the signal has not yet + been trapped. */ + if ((sigmodes[sig] & SIG_TRAPPED) == 0) + { + /* If we aren't sure of the original value, check it. */ + if (original_signals[sig] == IMPOSSIBLE_TRAP_HANDLER) + GETORIGSIG (sig); + if (original_signals[sig] == SIG_IGN) + return; + } + + /* Only change the system signal handler if SIG_NO_TRAP is not set. + The trap command string is changed in either case. The shell signal + handlers for SIGINT and SIGCHLD run the user specified traps in an + environment in which it is safe to do so. */ + if ((sigmodes[sig] & SIG_NO_TRAP) == 0) + { + BLOCK_SIGNAL (sig, set, oset); + change_signal (sig, savestring (string)); + set_signal_handler (sig, trap_handler); + UNBLOCK_SIGNAL (oset); + } + else + change_signal (sig, savestring (string)); +} + +static void +free_trap_command (sig) + int sig; +{ + if ((sigmodes[sig] & SIG_TRAPPED) && trap_list[sig] && + (trap_list[sig] != (char *)IGNORE_SIG) && + (trap_list[sig] != (char *)DEFAULT_SIG) && + (trap_list[sig] != (char *)IMPOSSIBLE_TRAP_HANDLER)) + free (trap_list[sig]); +} + +/* If SIG has a string assigned to it, get rid of it. Then give it + VALUE. */ +static void +change_signal (sig, value) + int sig; + char *value; +{ + if ((sigmodes[sig] & SIG_INPROGRESS) == 0) + free_trap_command (sig); + trap_list[sig] = value; + + sigmodes[sig] |= SIG_TRAPPED; + if (value == (char *)IGNORE_SIG) + sigmodes[sig] |= SIG_IGNORED; + else + sigmodes[sig] &= ~SIG_IGNORED; + if (sigmodes[sig] & SIG_INPROGRESS) + sigmodes[sig] |= SIG_CHANGED; +} + +void +get_original_signal (sig) + int sig; +{ + /* If we aren't sure the of the original value, then get it. */ + if (sig > 0 && sig < NSIG && original_signals[sig] == (SigHandler *)IMPOSSIBLE_TRAP_HANDLER) + GETORIGSIG (sig); +} + +void +get_all_original_signals () +{ + register int i; + + for (i = 1; i < NSIG; i++) + GET_ORIGINAL_SIGNAL (i); +} + +void +set_original_signal (sig, handler) + int sig; + SigHandler *handler; +{ + if (sig > 0 && sig < NSIG && original_signals[sig] == (SigHandler *)IMPOSSIBLE_TRAP_HANDLER) + SETORIGSIG (sig, handler); +} + +/* Restore the default action for SIG; i.e., the action the shell + would have taken before you used the trap command. This is called + from trap_builtin (), which takes care to restore the handlers for + the signals the shell treats specially. */ +void +restore_default_signal (sig) + int sig; +{ + if (SPECIAL_TRAP (sig)) + { + if ((sig != DEBUG_TRAP && sig != ERROR_TRAP && sig != RETURN_TRAP) || + (sigmodes[sig] & SIG_INPROGRESS) == 0) + free_trap_command (sig); + trap_list[sig] = (char *)NULL; + sigmodes[sig] &= ~SIG_TRAPPED; + if (sigmodes[sig] & SIG_INPROGRESS) + sigmodes[sig] |= SIG_CHANGED; + return; + } + + GET_ORIGINAL_SIGNAL (sig); + + /* A signal ignored on entry to the shell cannot be trapped or reset, but + no error is reported when attempting to do so. Thanks Posix.2. */ + if (sigmodes[sig] & SIG_HARD_IGNORE) + return; + + /* If we aren't trapping this signal, don't bother doing anything else. */ + /* We special-case SIGCHLD and IMPOSSIBLE_TRAP_HANDLER (see above) as a + sentinel to determine whether or not disposition is reset to the default + while the trap handler is executing. */ + if (((sigmodes[sig] & SIG_TRAPPED) == 0) && + (sig != SIGCHLD || (sigmodes[sig] & SIG_INPROGRESS) == 0 || trap_list[sig] != (char *)IMPOSSIBLE_TRAP_HANDLER)) + return; + + /* Only change the signal handler for SIG if it allows it. */ + if ((sigmodes[sig] & SIG_NO_TRAP) == 0) + set_signal_handler (sig, original_signals[sig]); + + /* Change the trap command in either case. */ + change_signal (sig, (char *)DEFAULT_SIG); + + /* Mark the signal as no longer trapped. */ + sigmodes[sig] &= ~SIG_TRAPPED; +} + +/* Make this signal be ignored. */ +void +ignore_signal (sig) + int sig; +{ + if (SPECIAL_TRAP (sig) && ((sigmodes[sig] & SIG_IGNORED) == 0)) + { + change_signal (sig, (char *)IGNORE_SIG); + return; + } + + GET_ORIGINAL_SIGNAL (sig); + + /* A signal ignored on entry to the shell cannot be trapped or reset. + No error is reported when the user attempts to do so. */ + if (sigmodes[sig] & SIG_HARD_IGNORE) + return; + + /* If already trapped and ignored, no change necessary. */ + if (sigmodes[sig] & SIG_IGNORED) + return; + + /* Only change the signal handler for SIG if it allows it. */ + if ((sigmodes[sig] & SIG_NO_TRAP) == 0) + set_signal_handler (sig, SIG_IGN); + + /* Change the trap command in either case. */ + change_signal (sig, (char *)IGNORE_SIG); +} + +/* Handle the calling of "trap 0". The only sticky situation is when + the command to be executed includes an "exit". This is why we have + to provide our own place for top_level to jump to. */ +int +run_exit_trap () +{ + char *trap_command; + int code, function_code, retval; +#if defined (ARRAY_VARS) + ARRAY *ps; +#endif + + trap_saved_exit_value = last_command_exit_value; +#if defined (ARRAY_VARS) + ps = save_pipestatus_array (); +#endif + function_code = 0; + + /* Run the trap only if signal 0 is trapped and not ignored, and we are not + currently running in the trap handler (call to exit in the list of + commands given to trap 0). */ + if ((sigmodes[EXIT_TRAP] & SIG_TRAPPED) && + (sigmodes[EXIT_TRAP] & (SIG_IGNORED|SIG_INPROGRESS)) == 0) + { + trap_command = savestring (trap_list[EXIT_TRAP]); + sigmodes[EXIT_TRAP] &= ~SIG_TRAPPED; + sigmodes[EXIT_TRAP] |= SIG_INPROGRESS; + + retval = trap_saved_exit_value; + running_trap = 1; + + code = setjmp_nosigs (top_level); + + /* If we're in a function, make sure return longjmps come here, too. */ + if (return_catch_flag) + function_code = setjmp_nosigs (return_catch); + + if (code == 0 && function_code == 0) + { + reset_parser (); + parse_and_execute (trap_command, "exit trap", SEVAL_NONINT|SEVAL_NOHIST|SEVAL_RESETLINE); + } + else if (code == ERREXIT) + retval = last_command_exit_value; + else if (code == EXITPROG) + retval = last_command_exit_value; + else if (function_code != 0) + retval = return_catch_value; + else + retval = trap_saved_exit_value; + + running_trap = 0; + return retval; + } + +#if defined (ARRAY_VARS) + restore_pipestatus_array (ps); +#endif + return (trap_saved_exit_value); +} + +void +run_trap_cleanup (sig) + int sig; +{ + sigmodes[sig] &= ~(SIG_INPROGRESS|SIG_CHANGED); +} + +#define RECURSIVE_SIG(s) (SPECIAL_TRAP(s) == 0) + +/* Run a trap command for SIG. SIG is one of the signals the shell treats + specially. Returns the exit status of the executed trap command list. */ +static int +_run_trap_internal (sig, tag) + int sig; + char *tag; +{ + char *trap_command, *old_trap; + int trap_exit_value, *token_state; + volatile int save_return_catch_flag, function_code; + int flags; + procenv_t save_return_catch; + WORD_LIST *save_subst_varlist; + sh_parser_state_t pstate; +#if defined (ARRAY_VARS) + ARRAY *ps; +#endif + + trap_exit_value = function_code = 0; + /* Run the trap only if SIG is trapped and not ignored, and we are not + currently executing in the trap handler. */ + if ((sigmodes[sig] & SIG_TRAPPED) && ((sigmodes[sig] & SIG_IGNORED) == 0) && + (trap_list[sig] != (char *)IMPOSSIBLE_TRAP_HANDLER) && +#if 0 + /* Uncomment this to allow some special signals to recursively execute + trap handlers. */ + (RECURSIVE_SIG (sig) || (sigmodes[sig] & SIG_INPROGRESS) == 0)) +#else + ((sigmodes[sig] & SIG_INPROGRESS) == 0)) +#endif + { + old_trap = trap_list[sig]; + sigmodes[sig] |= SIG_INPROGRESS; + sigmodes[sig] &= ~SIG_CHANGED; /* just to be sure */ + trap_command = savestring (old_trap); + + running_trap = sig + 1; + +#if defined (ARRAY_VARS) + ps = save_pipestatus_array (); +#endif + + save_parser_state (&pstate); + save_subst_varlist = subst_assign_varlist; + subst_assign_varlist = 0; + +#if defined (JOB_CONTROL) + save_pipeline (1); /* XXX only provides one save level */ +#endif + + /* If we're in a function, make sure return longjmps come here, too. */ + save_return_catch_flag = return_catch_flag; + if (return_catch_flag) + { + COPY_PROCENV (return_catch, save_return_catch); + function_code = setjmp_nosigs (return_catch); + } + + flags = SEVAL_NONINT|SEVAL_NOHIST; + if (sig != DEBUG_TRAP && sig != RETURN_TRAP && sig != ERROR_TRAP) + flags |= SEVAL_RESETLINE; + if (function_code == 0) + parse_and_execute (trap_command, tag, flags); + + trap_exit_value = last_command_exit_value; + +#if defined (JOB_CONTROL) + restore_pipeline (1); +#endif + + subst_assign_varlist = save_subst_varlist; + restore_parser_state (&pstate); + +#if defined (ARRAY_VARS) + restore_pipestatus_array (ps); +#endif + running_trap = 0; + + sigmodes[sig] &= ~SIG_INPROGRESS; + + if (sigmodes[sig] & SIG_CHANGED) + { +#if 0 + /* Special traps like EXIT, DEBUG, RETURN are handled explicitly in + the places where they can be changed using unwind-protects. For + example, look at execute_cmd.c:execute_function(). */ + if (SPECIAL_TRAP (sig) == 0) +#endif + free (old_trap); + sigmodes[sig] &= ~SIG_CHANGED; + } + + if (save_return_catch_flag) + { + return_catch_flag = save_return_catch_flag; + return_catch_value = trap_exit_value; + COPY_PROCENV (save_return_catch, return_catch); + if (function_code) + longjmp (return_catch, 1); + } + } + + return trap_exit_value; +} + +int +run_debug_trap () +{ + int trap_exit_value; + pid_t save_pgrp; + int save_pipe[2]; + + /* XXX - question: should the DEBUG trap inherit the RETURN trap? */ + trap_exit_value = 0; + if ((sigmodes[DEBUG_TRAP] & SIG_TRAPPED) && ((sigmodes[DEBUG_TRAP] & SIG_IGNORED) == 0) && ((sigmodes[DEBUG_TRAP] & SIG_INPROGRESS) == 0)) + { +#if defined (JOB_CONTROL) + save_pgrp = pipeline_pgrp; + pipeline_pgrp = 0; + save_pipeline (1); +# if defined (PGRP_PIPE) + save_pgrp_pipe (save_pipe, 1); +# endif + stop_making_children (); +#endif + + trap_exit_value = _run_trap_internal (DEBUG_TRAP, "debug trap"); + +#if defined (JOB_CONTROL) + pipeline_pgrp = save_pgrp; + restore_pipeline (1); +# if defined (PGRP_PIPE) + close_pgrp_pipe (); + restore_pgrp_pipe (save_pipe); +# endif + if (pipeline_pgrp > 0) + give_terminal_to (pipeline_pgrp, 1); + notify_and_cleanup (); +#endif + +#if defined (DEBUGGER) + /* If we're in the debugger and the DEBUG trap returns 2 while we're in + a function or sourced script, we force a `return'. */ + if (debugging_mode && trap_exit_value == 2 && return_catch_flag) + { + return_catch_value = trap_exit_value; + longjmp (return_catch, 1); + } +#endif + } + return trap_exit_value; +} + +void +run_error_trap () +{ + if ((sigmodes[ERROR_TRAP] & SIG_TRAPPED) && ((sigmodes[ERROR_TRAP] & SIG_IGNORED) == 0) && (sigmodes[ERROR_TRAP] & SIG_INPROGRESS) == 0) + _run_trap_internal (ERROR_TRAP, "error trap"); +} + +void +run_return_trap () +{ + int old_exit_value; + +#if 0 + if ((sigmodes[DEBUG_TRAP] & SIG_TRAPPED) && (sigmodes[DEBUG_TRAP] & SIG_INPROGRESS)) + return; +#endif + + if ((sigmodes[RETURN_TRAP] & SIG_TRAPPED) && ((sigmodes[RETURN_TRAP] & SIG_IGNORED) == 0) && (sigmodes[RETURN_TRAP] & SIG_INPROGRESS) == 0) + { + old_exit_value = last_command_exit_value; + _run_trap_internal (RETURN_TRAP, "return trap"); + last_command_exit_value = old_exit_value; + } +} + +/* Run a trap set on SIGINT. This is called from throw_to_top_level (), and + declared here to localize the trap functions. */ +void +run_interrupt_trap () +{ + _run_trap_internal (SIGINT, "interrupt trap"); +} + +/* Free all the allocated strings in the list of traps and reset the trap + values to the default. Intended to be called from subshells that want + to complete work done by reset_signal_handlers upon execution of a + subsequent `trap' command that changes a signal's disposition. We need + to make sure that we duplicate the behavior of + reset_or_restore_signal_handlers and not change the disposition of signals + that are set to be ignored. */ +void +free_trap_strings () +{ + register int i; + + for (i = 0; i < BASH_NSIG; i++) + { + if (trap_list[i] != (char *)IGNORE_SIG) + free_trap_string (i); + } + trap_list[DEBUG_TRAP] = trap_list[EXIT_TRAP] = trap_list[ERROR_TRAP] = trap_list[RETURN_TRAP] = (char *)NULL; +} + +/* Free a trap command string associated with SIG without changing signal + disposition. Intended to be called from free_trap_strings() */ +static void +free_trap_string (sig) + int sig; +{ + change_signal (sig, (char *)DEFAULT_SIG); + sigmodes[sig] &= ~SIG_TRAPPED; +} + +/* Reset the handler for SIG to the original value but leave the trap string + in place. */ +static void +reset_signal (sig) + int sig; +{ + set_signal_handler (sig, original_signals[sig]); + sigmodes[sig] &= ~SIG_TRAPPED; +} + +/* Set the handler signal SIG to the original and free any trap + command associated with it. */ +static void +restore_signal (sig) + int sig; +{ + set_signal_handler (sig, original_signals[sig]); + change_signal (sig, (char *)DEFAULT_SIG); + sigmodes[sig] &= ~SIG_TRAPPED; +} + +static void +reset_or_restore_signal_handlers (reset) + sh_resetsig_func_t *reset; +{ + register int i; + + /* Take care of the exit trap first */ + if (sigmodes[EXIT_TRAP] & SIG_TRAPPED) + { + sigmodes[EXIT_TRAP] &= ~SIG_TRAPPED; + if (reset != reset_signal) + { + free_trap_command (EXIT_TRAP); + trap_list[EXIT_TRAP] = (char *)NULL; + } + } + + for (i = 1; i < NSIG; i++) + { + if (sigmodes[i] & SIG_TRAPPED) + { + if (trap_list[i] == (char *)IGNORE_SIG) + set_signal_handler (i, SIG_IGN); + else + (*reset) (i); + } + else if (sigmodes[i] & SIG_SPECIAL) + (*reset) (i); + } + + /* Command substitution and other child processes don't inherit the + debug, error, or return traps. If we're in the debugger, and the + `functrace' or `errtrace' options have been set, then let command + substitutions inherit them. Let command substitution inherit the + RETURN trap if we're in the debugger and tracing functions. */ + if (function_trace_mode == 0) + { + sigmodes[DEBUG_TRAP] &= ~SIG_TRAPPED; + sigmodes[RETURN_TRAP] &= ~SIG_TRAPPED; + } + if (error_trace_mode == 0) + sigmodes[ERROR_TRAP] &= ~SIG_TRAPPED; +} + +/* Reset trapped signals to their original values, but don't free the + trap strings. Called by the command substitution code and other places + that create a "subshell environment". */ +void +reset_signal_handlers () +{ + reset_or_restore_signal_handlers (reset_signal); +} + +/* Reset all trapped signals to their original values. Signals set to be + ignored with trap '' SIGNAL should be ignored, so we make sure that they + are. Called by child processes after they are forked. */ +void +restore_original_signals () +{ + reset_or_restore_signal_handlers (restore_signal); +} + +/* If a trap handler exists for signal SIG, then call it; otherwise just + return failure. Returns 1 if it called the trap handler. */ +int +maybe_call_trap_handler (sig) + int sig; +{ + /* Call the trap handler for SIG if the signal is trapped and not ignored. */ + if ((sigmodes[sig] & SIG_TRAPPED) && ((sigmodes[sig] & SIG_IGNORED) == 0)) + { + switch (sig) + { + case SIGINT: + run_interrupt_trap (); + break; + case EXIT_TRAP: + run_exit_trap (); + break; + case DEBUG_TRAP: + run_debug_trap (); + break; + case ERROR_TRAP: + run_error_trap (); + break; + default: + trap_handler (sig); + break; + } + return (1); + } + else + return (0); +} + +int +signal_is_trapped (sig) + int sig; +{ + return (sigmodes[sig] & SIG_TRAPPED); +} + +int +signal_is_pending (sig) + int sig; +{ + return (pending_traps[sig]); +} + +int +signal_is_special (sig) + int sig; +{ + return (sigmodes[sig] & SIG_SPECIAL); +} + +int +signal_is_ignored (sig) + int sig; +{ + return (sigmodes[sig] & SIG_IGNORED); +} + +int +signal_is_hard_ignored (sig) + int sig; +{ + return (sigmodes[sig] & SIG_HARD_IGNORE); +} + +void +set_signal_hard_ignored (sig) + int sig; +{ + sigmodes[sig] |= SIG_HARD_IGNORE; + original_signals[sig] = SIG_IGN; +} + +void +set_signal_ignored (sig) + int sig; +{ + original_signals[sig] = SIG_IGN; +} + +int +signal_in_progress (sig) + int sig; +{ + return (sigmodes[sig] & SIG_INPROGRESS); +} diff --git a/.pc/bash43-003.diff/lib/readline/readline.c b/.pc/bash43-003.diff/lib/readline/readline.c new file mode 100644 index 0000000..03eefa6 --- /dev/null +++ b/.pc/bash43-003.diff/lib/readline/readline.c @@ -0,0 +1,1363 @@ +/* readline.c -- a general facility for reading lines of input + with emacs style editing and completion. */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include +#include "posixstat.h" +#include +#if defined (HAVE_SYS_FILE_H) +# include +#endif /* HAVE_SYS_FILE_H */ + +#if defined (HAVE_UNISTD_H) +# include +#endif /* HAVE_UNISTD_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#if defined (HAVE_LOCALE_H) +# include +#endif + +#include +#include "posixjmp.h" +#include + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" +#include "rlmbutil.h" + +#if defined (__EMX__) +# define INCL_DOSPROCESS +# include +#endif /* __EMX__ */ + +/* Some standard library routines. */ +#include "readline.h" +#include "history.h" + +#include "rlprivate.h" +#include "rlshell.h" +#include "xmalloc.h" + +#ifndef RL_LIBRARY_VERSION +# define RL_LIBRARY_VERSION "5.1" +#endif + +#ifndef RL_READLINE_VERSION +# define RL_READLINE_VERSION 0x0501 +#endif + +extern void _rl_free_history_entry PARAMS((HIST_ENTRY *)); + +#if defined (COLOR_SUPPORT) +extern void _rl_parse_colors PARAMS((void)); /* XXX */ +#endif + + +/* Forward declarations used in this file. */ +static char *readline_internal PARAMS((void)); +static void readline_initialize_everything PARAMS((void)); + +static void bind_arrow_keys_internal PARAMS((Keymap)); +static void bind_arrow_keys PARAMS((void)); + +static void readline_default_bindings PARAMS((void)); +static void reset_default_bindings PARAMS((void)); + +static int _rl_subseq_result PARAMS((int, Keymap, int, int)); +static int _rl_subseq_getchar PARAMS((int)); + +/* **************************************************************** */ +/* */ +/* Line editing input utility */ +/* */ +/* **************************************************************** */ + +const char *rl_library_version = RL_LIBRARY_VERSION; + +int rl_readline_version = RL_READLINE_VERSION; + +/* True if this is `real' readline as opposed to some stub substitute. */ +int rl_gnu_readline_p = 1; + +/* A pointer to the keymap that is currently in use. + By default, it is the standard emacs keymap. */ +Keymap _rl_keymap = emacs_standard_keymap; + +/* The current style of editing. */ +int rl_editing_mode = emacs_mode; + +/* The current insert mode: input (the default) or overwrite */ +int rl_insert_mode = RL_IM_DEFAULT; + +/* Non-zero if we called this function from _rl_dispatch(). It's present + so functions can find out whether they were called from a key binding + or directly from an application. */ +int rl_dispatching; + +/* Non-zero if the previous command was a kill command. */ +int _rl_last_command_was_kill = 0; + +/* The current value of the numeric argument specified by the user. */ +int rl_numeric_arg = 1; + +/* Non-zero if an argument was typed. */ +int rl_explicit_arg = 0; + +/* Temporary value used while generating the argument. */ +int rl_arg_sign = 1; + +/* Non-zero means we have been called at least once before. */ +static int rl_initialized; + +#if 0 +/* If non-zero, this program is running in an EMACS buffer. */ +static int running_in_emacs; +#endif + +/* Flags word encapsulating the current readline state. */ +int rl_readline_state = RL_STATE_NONE; + +/* The current offset in the current input line. */ +int rl_point; + +/* Mark in the current input line. */ +int rl_mark; + +/* Length of the current input line. */ +int rl_end; + +/* Make this non-zero to return the current input_line. */ +int rl_done; + +/* The last function executed by readline. */ +rl_command_func_t *rl_last_func = (rl_command_func_t *)NULL; + +/* Top level environment for readline_internal (). */ +procenv_t _rl_top_level; + +/* The streams we interact with. */ +FILE *_rl_in_stream, *_rl_out_stream; + +/* The names of the streams that we do input and output to. */ +FILE *rl_instream = (FILE *)NULL; +FILE *rl_outstream = (FILE *)NULL; + +/* Non-zero means echo characters as they are read. Defaults to no echo; + set to 1 if there is a controlling terminal, we can get its attributes, + and the attributes include `echo'. Look at rltty.c:prepare_terminal_settings + for the code that sets it. */ +int _rl_echoing_p = 0; + +/* Current prompt. */ +char *rl_prompt = (char *)NULL; +int rl_visible_prompt_length = 0; + +/* Set to non-zero by calling application if it has already printed rl_prompt + and does not want readline to do it the first time. */ +int rl_already_prompted = 0; + +/* The number of characters read in order to type this complete command. */ +int rl_key_sequence_length = 0; + +/* If non-zero, then this is the address of a function to call just + before readline_internal_setup () prints the first prompt. */ +rl_hook_func_t *rl_startup_hook = (rl_hook_func_t *)NULL; + +/* If non-zero, this is the address of a function to call just before + readline_internal_setup () returns and readline_internal starts + reading input characters. */ +rl_hook_func_t *rl_pre_input_hook = (rl_hook_func_t *)NULL; + +/* What we use internally. You should always refer to RL_LINE_BUFFER. */ +static char *the_line; + +/* The character that can generate an EOF. Really read from + the terminal driver... just defaulted here. */ +int _rl_eof_char = CTRL ('D'); + +/* Non-zero makes this the next keystroke to read. */ +int rl_pending_input = 0; + +/* Pointer to a useful terminal name. */ +const char *rl_terminal_name = (const char *)NULL; + +/* Non-zero means to always use horizontal scrolling in line display. */ +int _rl_horizontal_scroll_mode = 0; + +/* Non-zero means to display an asterisk at the starts of history lines + which have been modified. */ +int _rl_mark_modified_lines = 0; + +/* The style of `bell' notification preferred. This can be set to NO_BELL, + AUDIBLE_BELL, or VISIBLE_BELL. */ +int _rl_bell_preference = AUDIBLE_BELL; + +/* String inserted into the line by rl_insert_comment (). */ +char *_rl_comment_begin; + +/* Keymap holding the function currently being executed. */ +Keymap rl_executing_keymap; + +/* Keymap we're currently using to dispatch. */ +Keymap _rl_dispatching_keymap; + +/* Non-zero means to erase entire line, including prompt, on empty input lines. */ +int rl_erase_empty_line = 0; + +/* Non-zero means to read only this many characters rather than up to a + character bound to accept-line. */ +int rl_num_chars_to_read; + +/* Line buffer and maintenance. */ +char *rl_line_buffer = (char *)NULL; +int rl_line_buffer_len = 0; + +/* Key sequence `contexts' */ +_rl_keyseq_cxt *_rl_kscxt = 0; + +int rl_executing_key; +char *rl_executing_keyseq = 0; +int _rl_executing_keyseq_size = 0; + +/* Timeout (specified in milliseconds) when reading characters making up an + ambiguous multiple-key sequence */ +int _rl_keyseq_timeout = 500; + +#define RESIZE_KEYSEQ_BUFFER() \ + do \ + { \ + if (rl_key_sequence_length + 2 >= _rl_executing_keyseq_size) \ + { \ + _rl_executing_keyseq_size += 16; \ + rl_executing_keyseq = xrealloc (rl_executing_keyseq, _rl_executing_keyseq_size); \ + } \ + } \ + while (0); + +/* Forward declarations used by the display, termcap, and history code. */ + +/* **************************************************************** */ +/* */ +/* `Forward' declarations */ +/* */ +/* **************************************************************** */ + +/* Non-zero means do not parse any lines other than comments and + parser directives. */ +unsigned char _rl_parsing_conditionalized_out = 0; + +/* Non-zero means to convert characters with the meta bit set to + escape-prefixed characters so we can indirect through + emacs_meta_keymap or vi_escape_keymap. */ +int _rl_convert_meta_chars_to_ascii = 1; + +/* Non-zero means to output characters with the meta bit set directly + rather than as a meta-prefixed escape sequence. */ +int _rl_output_meta_chars = 0; + +/* Non-zero means to look at the termios special characters and bind + them to equivalent readline functions at startup. */ +int _rl_bind_stty_chars = 1; + +/* Non-zero means to go through the history list at every newline (or + whenever rl_done is set and readline returns) and revert each line to + its initial state. */ +int _rl_revert_all_at_newline = 0; + +/* Non-zero means to honor the termios ECHOCTL bit and echo control + characters corresponding to keyboard-generated signals. */ +int _rl_echo_control_chars = 1; + +/* Non-zero means to prefix the displayed prompt with a character indicating + the editing mode: @ for emacs, : for vi-command, + for vi-insert. */ +int _rl_show_mode_in_prompt = 0; + +/* **************************************************************** */ +/* */ +/* Top Level Functions */ +/* */ +/* **************************************************************** */ + +/* Non-zero means treat 0200 bit in terminal input as Meta bit. */ +int _rl_meta_flag = 0; /* Forward declaration */ + +/* Set up the prompt and expand it. Called from readline() and + rl_callback_handler_install (). */ +int +rl_set_prompt (prompt) + const char *prompt; +{ + FREE (rl_prompt); + rl_prompt = prompt ? savestring (prompt) : (char *)NULL; + rl_display_prompt = rl_prompt ? rl_prompt : ""; + + rl_visible_prompt_length = rl_expand_prompt (rl_prompt); + return 0; +} + +/* Read a line of input. Prompt with PROMPT. An empty PROMPT means + none. A return value of NULL means that EOF was encountered. */ +char * +readline (prompt) + const char *prompt; +{ + char *value; +#if 0 + int in_callback; +#endif + + /* If we are at EOF return a NULL string. */ + if (rl_pending_input == EOF) + { + rl_clear_pending_input (); + return ((char *)NULL); + } + +#if 0 + /* If readline() is called after installing a callback handler, temporarily + turn off the callback state to avoid ensuing messiness. Patch supplied + by the gdb folks. XXX -- disabled. This can be fooled and readline + left in a strange state by a poorly-timed longjmp. */ + if (in_callback = RL_ISSTATE (RL_STATE_CALLBACK)) + RL_UNSETSTATE (RL_STATE_CALLBACK); +#endif + + rl_set_prompt (prompt); + + rl_initialize (); + if (rl_prep_term_function) + (*rl_prep_term_function) (_rl_meta_flag); + +#if defined (HANDLE_SIGNALS) + rl_set_signals (); +#endif + + value = readline_internal (); + if (rl_deprep_term_function) + (*rl_deprep_term_function) (); + +#if defined (HANDLE_SIGNALS) + rl_clear_signals (); +#endif + +#if 0 + if (in_callback) + RL_SETSTATE (RL_STATE_CALLBACK); +#endif + +#if HAVE_DECL_AUDIT_TTY && defined (ENABLE_TTY_AUDIT_SUPPORT) + if (value) + _rl_audit_tty (value); +#endif + + return (value); +} + +#if defined (READLINE_CALLBACKS) +# define STATIC_CALLBACK +#else +# define STATIC_CALLBACK static +#endif + +STATIC_CALLBACK void +readline_internal_setup () +{ + char *nprompt; + + _rl_in_stream = rl_instream; + _rl_out_stream = rl_outstream; + + /* Enable the meta key only for the duration of readline(), if this + terminal has one and the terminal has been initialized */ + if (_rl_enable_meta & RL_ISSTATE (RL_STATE_TERMPREPPED)) + _rl_enable_meta_key (); + + if (rl_startup_hook) + (*rl_startup_hook) (); + +#if defined (VI_MODE) + if (rl_editing_mode == vi_mode) + rl_vi_insertion_mode (1, 'i'); /* don't want to reset last */ +#endif /* VI_MODE */ + + /* If we're not echoing, we still want to at least print a prompt, because + rl_redisplay will not do it for us. If the calling application has a + custom redisplay function, though, let that function handle it. */ + if (_rl_echoing_p == 0 && rl_redisplay_function == rl_redisplay) + { + if (rl_prompt && rl_already_prompted == 0) + { + nprompt = _rl_strip_prompt (rl_prompt); + fprintf (_rl_out_stream, "%s", nprompt); + fflush (_rl_out_stream); + xfree (nprompt); + } + } + else + { + if (rl_prompt && rl_already_prompted) + rl_on_new_line_with_prompt (); + else + rl_on_new_line (); + (*rl_redisplay_function) (); + } + + if (rl_pre_input_hook) + (*rl_pre_input_hook) (); + + RL_CHECK_SIGNALS (); +} + +STATIC_CALLBACK char * +readline_internal_teardown (eof) + int eof; +{ + char *temp; + HIST_ENTRY *entry; + + RL_CHECK_SIGNALS (); + + /* Restore the original of this history line, iff the line that we + are editing was originally in the history, AND the line has changed. */ + entry = current_history (); + + if (entry && rl_undo_list) + { + temp = savestring (the_line); + rl_revert_line (1, 0); + entry = replace_history_entry (where_history (), the_line, (histdata_t)NULL); + _rl_free_history_entry (entry); + + strcpy (the_line, temp); + xfree (temp); + } + + if (_rl_revert_all_at_newline) + _rl_revert_all_lines (); + + /* At any rate, it is highly likely that this line has an undo list. Get + rid of it now. */ + if (rl_undo_list) + rl_free_undo_list (); + + /* Disable the meta key, if this terminal has one and we were told to use it. + The check whether or not we sent the enable string is in + _rl_disable_meta_key(); the flag is set in _rl_enable_meta_key */ + _rl_disable_meta_key (); + + /* Restore normal cursor, if available. */ + _rl_set_insert_mode (RL_IM_INSERT, 0); + + return (eof ? (char *)NULL : savestring (the_line)); +} + +void +_rl_internal_char_cleanup () +{ +#if defined (VI_MODE) + /* In vi mode, when you exit insert mode, the cursor moves back + over the previous character. We explicitly check for that here. */ + if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap) + rl_vi_check (); +#endif /* VI_MODE */ + + if (rl_num_chars_to_read && rl_end >= rl_num_chars_to_read) + { + (*rl_redisplay_function) (); + _rl_want_redisplay = 0; + rl_newline (1, '\n'); + } + + if (rl_done == 0) + { + (*rl_redisplay_function) (); + _rl_want_redisplay = 0; + } + + /* If the application writer has told us to erase the entire line if + the only character typed was something bound to rl_newline, do so. */ + if (rl_erase_empty_line && rl_done && rl_last_func == rl_newline && + rl_point == 0 && rl_end == 0) + _rl_erase_entire_line (); +} + +STATIC_CALLBACK int +#if defined (READLINE_CALLBACKS) +readline_internal_char () +#else +readline_internal_charloop () +#endif +{ + static int lastc, eof_found; + int c, code, lk; + + lastc = -1; + eof_found = 0; + +#if !defined (READLINE_CALLBACKS) + while (rl_done == 0) + { +#endif + lk = _rl_last_command_was_kill; + +#if defined (HAVE_POSIX_SIGSETJMP) + code = sigsetjmp (_rl_top_level, 0); +#else + code = setjmp (_rl_top_level); +#endif + + if (code) + { + (*rl_redisplay_function) (); + _rl_want_redisplay = 0; + /* If we get here, we're not being called from something dispatched + from _rl_callback_read_char(), which sets up its own value of + _rl_top_level (saving and restoring the old, of course), so + we can just return here. */ + if (RL_ISSTATE (RL_STATE_CALLBACK)) + return (0); + } + + if (rl_pending_input == 0) + { + /* Then initialize the argument and number of keys read. */ + _rl_reset_argument (); + rl_key_sequence_length = 0; + rl_executing_keyseq[0] = 0; + } + + RL_SETSTATE(RL_STATE_READCMD); + c = rl_read_key (); + RL_UNSETSTATE(RL_STATE_READCMD); + + /* look at input.c:rl_getc() for the circumstances under which this will + be returned; punt immediately on read error without converting it to + a newline; assume that rl_read_key has already called the signal + handler. */ + if (c == READERR) + { +#if defined (READLINE_CALLBACKS) + RL_SETSTATE(RL_STATE_DONE); + return (rl_done = 1); +#else + eof_found = 1; + break; +#endif + } + + /* EOF typed to a non-blank line is a . If we want to change this, + to force any existing line to be ignored when read(2) reads EOF, + for example, this is the place to change. */ + if (c == EOF && rl_end) + c = NEWLINE; + + /* The character _rl_eof_char typed to blank line, and not as the + previous character is interpreted as EOF. */ + if (((c == _rl_eof_char && lastc != c) || c == EOF) && !rl_end) + { +#if defined (READLINE_CALLBACKS) + RL_SETSTATE(RL_STATE_DONE); + return (rl_done = 1); +#else + eof_found = 1; + break; +#endif + } + + lastc = c; + _rl_dispatch ((unsigned char)c, _rl_keymap); + RL_CHECK_SIGNALS (); + + /* If there was no change in _rl_last_command_was_kill, then no kill + has taken place. Note that if input is pending we are reading + a prefix command, so nothing has changed yet. */ + if (rl_pending_input == 0 && lk == _rl_last_command_was_kill) + _rl_last_command_was_kill = 0; + + _rl_internal_char_cleanup (); + +#if defined (READLINE_CALLBACKS) + return 0; +#else + } + + return (eof_found); +#endif +} + +#if defined (READLINE_CALLBACKS) +static int +readline_internal_charloop () +{ + int eof = 1; + + while (rl_done == 0) + eof = readline_internal_char (); + return (eof); +} +#endif /* READLINE_CALLBACKS */ + +/* Read a line of input from the global rl_instream, doing output on + the global rl_outstream. + If rl_prompt is non-null, then that is our prompt. */ +static char * +readline_internal () +{ + int eof; + + readline_internal_setup (); + eof = readline_internal_charloop (); + return (readline_internal_teardown (eof)); +} + +void +_rl_init_line_state () +{ + rl_point = rl_end = rl_mark = 0; + the_line = rl_line_buffer; + the_line[0] = 0; +} + +void +_rl_set_the_line () +{ + the_line = rl_line_buffer; +} + +#if defined (READLINE_CALLBACKS) +_rl_keyseq_cxt * +_rl_keyseq_cxt_alloc () +{ + _rl_keyseq_cxt *cxt; + + cxt = (_rl_keyseq_cxt *)xmalloc (sizeof (_rl_keyseq_cxt)); + + cxt->flags = cxt->subseq_arg = cxt->subseq_retval = 0; + + cxt->okey = 0; + cxt->ocxt = _rl_kscxt; + cxt->childval = 42; /* sentinel value */ + + return cxt; +} + +void +_rl_keyseq_cxt_dispose (cxt) + _rl_keyseq_cxt *cxt; +{ + xfree (cxt); +} + +void +_rl_keyseq_chain_dispose () +{ + _rl_keyseq_cxt *cxt; + + while (_rl_kscxt) + { + cxt = _rl_kscxt; + _rl_kscxt = _rl_kscxt->ocxt; + _rl_keyseq_cxt_dispose (cxt); + } +} +#endif + +static int +_rl_subseq_getchar (key) + int key; +{ + int k; + + if (key == ESC) + RL_SETSTATE(RL_STATE_METANEXT); + RL_SETSTATE(RL_STATE_MOREINPUT); + k = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + if (key == ESC) + RL_UNSETSTATE(RL_STATE_METANEXT); + + return k; +} + +#if defined (READLINE_CALLBACKS) +int +_rl_dispatch_callback (cxt) + _rl_keyseq_cxt *cxt; +{ + int nkey, r; + + /* For now */ + /* The first time this context is used, we want to read input and dispatch + on it. When traversing the chain of contexts back `up', we want to use + the value from the next context down. We're simulating recursion using + a chain of contexts. */ + if ((cxt->flags & KSEQ_DISPATCHED) == 0) + { + nkey = _rl_subseq_getchar (cxt->okey); + if (nkey < 0) + { + _rl_abort_internal (); + return -1; + } + r = _rl_dispatch_subseq (nkey, cxt->dmap, cxt->subseq_arg); + cxt->flags |= KSEQ_DISPATCHED; + } + else + r = cxt->childval; + + /* For now */ + if (r != -3) /* don't do this if we indicate there will be other matches */ + r = _rl_subseq_result (r, cxt->oldmap, cxt->okey, (cxt->flags & KSEQ_SUBSEQ)); + + RL_CHECK_SIGNALS (); + if (r == 0) /* success! */ + { + _rl_keyseq_chain_dispose (); + RL_UNSETSTATE (RL_STATE_MULTIKEY); + return r; + } + + if (r != -3) /* magic value that says we added to the chain */ + _rl_kscxt = cxt->ocxt; + if (_rl_kscxt) + _rl_kscxt->childval = r; + if (r != -3) + _rl_keyseq_cxt_dispose (cxt); + + return r; +} +#endif /* READLINE_CALLBACKS */ + +/* Do the command associated with KEY in MAP. + If the associated command is really a keymap, then read + another key, and dispatch into that map. */ +int +_rl_dispatch (key, map) + register int key; + Keymap map; +{ + _rl_dispatching_keymap = map; + return _rl_dispatch_subseq (key, map, 0); +} + +int +_rl_dispatch_subseq (key, map, got_subseq) + register int key; + Keymap map; + int got_subseq; +{ + int r, newkey; + char *macro; + rl_command_func_t *func; +#if defined (READLINE_CALLBACKS) + _rl_keyseq_cxt *cxt; +#endif + + if (META_CHAR (key) && _rl_convert_meta_chars_to_ascii) + { + if (map[ESC].type == ISKMAP) + { + if (RL_ISSTATE (RL_STATE_MACRODEF)) + _rl_add_macro_char (ESC); + RESIZE_KEYSEQ_BUFFER (); + rl_executing_keyseq[rl_key_sequence_length++] = ESC; + map = FUNCTION_TO_KEYMAP (map, ESC); + key = UNMETA (key); + return (_rl_dispatch (key, map)); + } + else + rl_ding (); + return 0; + } + + if (RL_ISSTATE (RL_STATE_MACRODEF)) + _rl_add_macro_char (key); + + r = 0; + switch (map[key].type) + { + case ISFUNC: + func = map[key].function; + if (func) + { + /* Special case rl_do_lowercase_version (). */ + if (func == rl_do_lowercase_version) + /* Should we do anything special if key == ANYOTHERKEY? */ + return (_rl_dispatch (_rl_to_lower (key), map)); + + rl_executing_keymap = map; + rl_executing_key = key; + + RESIZE_KEYSEQ_BUFFER(); + rl_executing_keyseq[rl_key_sequence_length++] = key; + rl_executing_keyseq[rl_key_sequence_length] = '\0'; + + rl_dispatching = 1; + RL_SETSTATE(RL_STATE_DISPATCHING); + r = (*func) (rl_numeric_arg * rl_arg_sign, key); + RL_UNSETSTATE(RL_STATE_DISPATCHING); + rl_dispatching = 0; + + /* If we have input pending, then the last command was a prefix + command. Don't change the state of rl_last_func. Otherwise, + remember the last command executed in this variable. */ + if (rl_pending_input == 0 && map[key].function != rl_digit_argument) + rl_last_func = map[key].function; + + RL_CHECK_SIGNALS (); + } + else if (map[ANYOTHERKEY].function) + { + /* OK, there's no function bound in this map, but there is a + shadow function that was overridden when the current keymap + was created. Return -2 to note that. */ + if (RL_ISSTATE (RL_STATE_MACROINPUT)) + _rl_prev_macro_key (); + else + _rl_unget_char (key); + return -2; + } + else if (got_subseq) + { + /* Return -1 to note that we're in a subsequence, but we don't + have a matching key, nor was one overridden. This means + we need to back up the recursion chain and find the last + subsequence that is bound to a function. */ + if (RL_ISSTATE (RL_STATE_MACROINPUT)) + _rl_prev_macro_key (); + else + _rl_unget_char (key); + return -1; + } + else + { +#if defined (READLINE_CALLBACKS) + RL_UNSETSTATE (RL_STATE_MULTIKEY); + _rl_keyseq_chain_dispose (); +#endif + _rl_abort_internal (); + return -1; + } + break; + + case ISKMAP: + if (map[key].function != 0) + { +#if defined (VI_MODE) + /* The only way this test will be true is if a subsequence has been + bound starting with ESC, generally the arrow keys. What we do is + check whether there's input in the queue, which there generally + will be if an arrow key has been pressed, and, if there's not, + just dispatch to (what we assume is) rl_vi_movement_mode right + away. This is essentially an input test with a zero timeout (by + default) or a timeout determined by the value of `keyseq-timeout' */ + /* _rl_keyseq_timeout specified in milliseconds; _rl_input_queued + takes microseconds, so multiply by 1000 */ + if (rl_editing_mode == vi_mode && key == ESC && map == vi_insertion_keymap + && _rl_input_queued ((_rl_keyseq_timeout > 0) ? _rl_keyseq_timeout*1000 : 0) == 0) + return (_rl_dispatch (ANYOTHERKEY, FUNCTION_TO_KEYMAP (map, key))); +#endif + + RESIZE_KEYSEQ_BUFFER (); + rl_executing_keyseq[rl_key_sequence_length++] = key; + _rl_dispatching_keymap = FUNCTION_TO_KEYMAP (map, key); + + /* Allocate new context here. Use linked contexts (linked through + cxt->ocxt) to simulate recursion */ +#if defined (READLINE_CALLBACKS) + if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + /* Return 0 only the first time, to indicate success to + _rl_callback_read_char. The rest of the time, we're called + from _rl_dispatch_callback, so we return -3 to indicate + special handling is necessary. */ + r = RL_ISSTATE (RL_STATE_MULTIKEY) ? -3 : 0; + cxt = _rl_keyseq_cxt_alloc (); + + if (got_subseq) + cxt->flags |= KSEQ_SUBSEQ; + cxt->okey = key; + cxt->oldmap = map; + cxt->dmap = _rl_dispatching_keymap; + cxt->subseq_arg = got_subseq || cxt->dmap[ANYOTHERKEY].function; + + RL_SETSTATE (RL_STATE_MULTIKEY); + _rl_kscxt = cxt; + + return r; /* don't indicate immediate success */ + } +#endif + + /* Tentative inter-character timeout for potential multi-key + sequences? If no input within timeout, abort sequence and + act as if we got non-matching input. */ + /* _rl_keyseq_timeout specified in milliseconds; _rl_input_queued + takes microseconds, so multiply by 1000 */ + if (_rl_keyseq_timeout > 0 && + (RL_ISSTATE (RL_STATE_INPUTPENDING|RL_STATE_MACROINPUT) == 0) && + _rl_pushed_input_available () == 0 && + _rl_dispatching_keymap[ANYOTHERKEY].function && + _rl_input_queued (_rl_keyseq_timeout*1000) == 0) + return (_rl_subseq_result (-2, map, key, got_subseq)); + + newkey = _rl_subseq_getchar (key); + if (newkey < 0) + { + _rl_abort_internal (); + return -1; + } + + r = _rl_dispatch_subseq (newkey, _rl_dispatching_keymap, got_subseq || map[ANYOTHERKEY].function); + return _rl_subseq_result (r, map, key, got_subseq); + } + else + { + _rl_abort_internal (); + return -1; + } + break; + + case ISMACR: + if (map[key].function != 0) + { + rl_executing_keyseq[rl_key_sequence_length] = '\0'; + macro = savestring ((char *)map[key].function); + _rl_with_macro_input (macro); + return 0; + } + break; + } +#if defined (VI_MODE) + if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap && + key != ANYOTHERKEY && + rl_key_sequence_length == 1 && /* XXX */ + _rl_vi_textmod_command (key)) + _rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign); +#endif + + return (r); +} + +static int +_rl_subseq_result (r, map, key, got_subseq) + int r; + Keymap map; + int key, got_subseq; +{ + Keymap m; + int type, nt; + rl_command_func_t *func, *nf; + + if (r == -2) + /* We didn't match anything, and the keymap we're indexed into + shadowed a function previously bound to that prefix. Call + the function. The recursive call to _rl_dispatch_subseq has + already taken care of pushing any necessary input back onto + the input queue with _rl_unget_char. */ + { + m = _rl_dispatching_keymap; + type = m[ANYOTHERKEY].type; + func = m[ANYOTHERKEY].function; + if (type == ISFUNC && func == rl_do_lowercase_version) + r = _rl_dispatch (_rl_to_lower (key), map); + else if (type == ISFUNC && func == rl_insert) + { + /* If the function that was shadowed was self-insert, we + somehow need a keymap with map[key].func == self-insert. + Let's use this one. */ + nt = m[key].type; + nf = m[key].function; + + m[key].type = type; + m[key].function = func; + r = _rl_dispatch (key, m); + m[key].type = nt; + m[key].function = nf; + } + else + r = _rl_dispatch (ANYOTHERKEY, m); + } + else if (r && map[ANYOTHERKEY].function) + { + /* We didn't match (r is probably -1), so return something to + tell the caller that it should try ANYOTHERKEY for an + overridden function. */ + if (RL_ISSTATE (RL_STATE_MACROINPUT)) + _rl_prev_macro_key (); + else + _rl_unget_char (key); + _rl_dispatching_keymap = map; + return -2; + } + else if (r && got_subseq) + { + /* OK, back up the chain. */ + if (RL_ISSTATE (RL_STATE_MACROINPUT)) + _rl_prev_macro_key (); + else + _rl_unget_char (key); + _rl_dispatching_keymap = map; + return -1; + } + + return r; +} + +/* **************************************************************** */ +/* */ +/* Initializations */ +/* */ +/* **************************************************************** */ + +/* Initialize readline (and terminal if not already). */ +int +rl_initialize () +{ + /* If we have never been called before, initialize the + terminal and data structures. */ + if (!rl_initialized) + { + RL_SETSTATE(RL_STATE_INITIALIZING); + readline_initialize_everything (); + RL_UNSETSTATE(RL_STATE_INITIALIZING); + rl_initialized++; + RL_SETSTATE(RL_STATE_INITIALIZED); + } + + /* Initialize the current line information. */ + _rl_init_line_state (); + + /* We aren't done yet. We haven't even gotten started yet! */ + rl_done = 0; + RL_UNSETSTATE(RL_STATE_DONE); + + /* Tell the history routines what is going on. */ + _rl_start_using_history (); + + /* Make the display buffer match the state of the line. */ + rl_reset_line_state (); + + /* No such function typed yet. */ + rl_last_func = (rl_command_func_t *)NULL; + + /* Parsing of key-bindings begins in an enabled state. */ + _rl_parsing_conditionalized_out = 0; + +#if defined (VI_MODE) + if (rl_editing_mode == vi_mode) + _rl_vi_initialize_line (); +#endif + + /* Each line starts in insert mode (the default). */ + _rl_set_insert_mode (RL_IM_DEFAULT, 1); + + return 0; +} + +#if 0 +#if defined (__EMX__) +static void +_emx_build_environ () +{ + TIB *tibp; + PIB *pibp; + char *t, **tp; + int c; + + DosGetInfoBlocks (&tibp, &pibp); + t = pibp->pib_pchenv; + for (c = 1; *t; c++) + t += strlen (t) + 1; + tp = environ = (char **)xmalloc ((c + 1) * sizeof (char *)); + t = pibp->pib_pchenv; + while (*t) + { + *tp++ = t; + t += strlen (t) + 1; + } + *tp = 0; +} +#endif /* __EMX__ */ +#endif + +/* Initialize the entire state of the world. */ +static void +readline_initialize_everything () +{ +#if 0 +#if defined (__EMX__) + if (environ == 0) + _emx_build_environ (); +#endif +#endif + +#if 0 + /* Find out if we are running in Emacs -- UNUSED. */ + running_in_emacs = sh_get_env_value ("EMACS") != (char *)0; +#endif + + /* Set up input and output if they are not already set up. */ + if (!rl_instream) + rl_instream = stdin; + + if (!rl_outstream) + rl_outstream = stdout; + + /* Bind _rl_in_stream and _rl_out_stream immediately. These values + may change, but they may also be used before readline_internal () + is called. */ + _rl_in_stream = rl_instream; + _rl_out_stream = rl_outstream; + + /* Allocate data structures. */ + if (rl_line_buffer == 0) + rl_line_buffer = (char *)xmalloc (rl_line_buffer_len = DEFAULT_BUFFER_SIZE); + + /* Initialize the terminal interface. */ + if (rl_terminal_name == 0) + rl_terminal_name = sh_get_env_value ("TERM"); + _rl_init_terminal_io (rl_terminal_name); + + /* Bind tty characters to readline functions. */ + readline_default_bindings (); + + /* Initialize the function names. */ + rl_initialize_funmap (); + + /* Decide whether we should automatically go into eight-bit mode. */ + _rl_init_eightbit (); + + /* Read in the init file. */ + rl_read_init_file ((char *)NULL); + + /* XXX */ + if (_rl_horizontal_scroll_mode && _rl_term_autowrap) + { + _rl_screenwidth--; + _rl_screenchars -= _rl_screenheight; + } + + /* Override the effect of any `set keymap' assignments in the + inputrc file. */ + rl_set_keymap_from_edit_mode (); + + /* Try to bind a common arrow key prefix, if not already bound. */ + bind_arrow_keys (); + + /* If the completion parser's default word break characters haven't + been set yet, then do so now. */ + if (rl_completer_word_break_characters == (char *)NULL) + rl_completer_word_break_characters = (char *)rl_basic_word_break_characters; + +#if defined (COLOR_SUPPORT) + if (_rl_colored_stats) + _rl_parse_colors (); +#endif + + rl_executing_keyseq = malloc (_rl_executing_keyseq_size = 16); + if (rl_executing_keyseq) + rl_executing_keyseq[0] = '\0'; +} + +/* If this system allows us to look at the values of the regular + input editing characters, then bind them to their readline + equivalents, iff the characters are not bound to keymaps. */ +static void +readline_default_bindings () +{ + if (_rl_bind_stty_chars) + rl_tty_set_default_bindings (_rl_keymap); +} + +/* Reset the default bindings for the terminal special characters we're + interested in back to rl_insert and read the new ones. */ +static void +reset_default_bindings () +{ + if (_rl_bind_stty_chars) + { + rl_tty_unset_default_bindings (_rl_keymap); + rl_tty_set_default_bindings (_rl_keymap); + } +} + +/* Bind some common arrow key sequences in MAP. */ +static void +bind_arrow_keys_internal (map) + Keymap map; +{ + Keymap xkeymap; + + xkeymap = _rl_keymap; + _rl_keymap = map; + +#if defined (__MSDOS__) + rl_bind_keyseq_if_unbound ("\033[0A", rl_get_previous_history); + rl_bind_keyseq_if_unbound ("\033[0B", rl_backward_char); + rl_bind_keyseq_if_unbound ("\033[0C", rl_forward_char); + rl_bind_keyseq_if_unbound ("\033[0D", rl_get_next_history); +#endif + + rl_bind_keyseq_if_unbound ("\033[A", rl_get_previous_history); + rl_bind_keyseq_if_unbound ("\033[B", rl_get_next_history); + rl_bind_keyseq_if_unbound ("\033[C", rl_forward_char); + rl_bind_keyseq_if_unbound ("\033[D", rl_backward_char); + rl_bind_keyseq_if_unbound ("\033[H", rl_beg_of_line); + rl_bind_keyseq_if_unbound ("\033[F", rl_end_of_line); + + rl_bind_keyseq_if_unbound ("\033OA", rl_get_previous_history); + rl_bind_keyseq_if_unbound ("\033OB", rl_get_next_history); + rl_bind_keyseq_if_unbound ("\033OC", rl_forward_char); + rl_bind_keyseq_if_unbound ("\033OD", rl_backward_char); + rl_bind_keyseq_if_unbound ("\033OH", rl_beg_of_line); + rl_bind_keyseq_if_unbound ("\033OF", rl_end_of_line); + +#if defined (__MINGW32__) + rl_bind_keyseq_if_unbound ("\340H", rl_get_previous_history); + rl_bind_keyseq_if_unbound ("\340P", rl_get_next_history); + rl_bind_keyseq_if_unbound ("\340M", rl_forward_char); + rl_bind_keyseq_if_unbound ("\340K", rl_backward_char); + rl_bind_keyseq_if_unbound ("\340G", rl_beg_of_line); + rl_bind_keyseq_if_unbound ("\340O", rl_end_of_line); + rl_bind_keyseq_if_unbound ("\340S", rl_delete); + rl_bind_keyseq_if_unbound ("\340R", rl_overwrite_mode); + + /* These may or may not work because of the embedded NUL. */ + rl_bind_keyseq_if_unbound ("\\000H", rl_get_previous_history); + rl_bind_keyseq_if_unbound ("\\000P", rl_get_next_history); + rl_bind_keyseq_if_unbound ("\\000M", rl_forward_char); + rl_bind_keyseq_if_unbound ("\\000K", rl_backward_char); + rl_bind_keyseq_if_unbound ("\\000G", rl_beg_of_line); + rl_bind_keyseq_if_unbound ("\\000O", rl_end_of_line); + rl_bind_keyseq_if_unbound ("\\000S", rl_delete); + rl_bind_keyseq_if_unbound ("\\000R", rl_overwrite_mode); +#endif + + _rl_keymap = xkeymap; +} + +/* Try and bind the common arrow key prefixes after giving termcap and + the inputrc file a chance to bind them and create `real' keymaps + for the arrow key prefix. */ +static void +bind_arrow_keys () +{ + bind_arrow_keys_internal (emacs_standard_keymap); + +#if defined (VI_MODE) + bind_arrow_keys_internal (vi_movement_keymap); + /* Unbind vi_movement_keymap[ESC] to allow users to repeatedly hit ESC + in vi command mode while still allowing the arrow keys to work. */ + if (vi_movement_keymap[ESC].type == ISKMAP) + rl_bind_keyseq_in_map ("\033", (rl_command_func_t *)NULL, vi_movement_keymap); + bind_arrow_keys_internal (vi_insertion_keymap); +#endif +} + +/* **************************************************************** */ +/* */ +/* Saving and Restoring Readline's state */ +/* */ +/* **************************************************************** */ + +int +rl_save_state (sp) + struct readline_state *sp; +{ + if (sp == 0) + return -1; + + sp->point = rl_point; + sp->end = rl_end; + sp->mark = rl_mark; + sp->buffer = rl_line_buffer; + sp->buflen = rl_line_buffer_len; + sp->ul = rl_undo_list; + sp->prompt = rl_prompt; + + sp->rlstate = rl_readline_state; + sp->done = rl_done; + sp->kmap = _rl_keymap; + + sp->lastfunc = rl_last_func; + sp->insmode = rl_insert_mode; + sp->edmode = rl_editing_mode; + sp->kseqlen = rl_key_sequence_length; + sp->inf = rl_instream; + sp->outf = rl_outstream; + sp->pendingin = rl_pending_input; + sp->macro = rl_executing_macro; + + sp->catchsigs = rl_catch_signals; + sp->catchsigwinch = rl_catch_sigwinch; + + return (0); +} + +int +rl_restore_state (sp) + struct readline_state *sp; +{ + if (sp == 0) + return -1; + + rl_point = sp->point; + rl_end = sp->end; + rl_mark = sp->mark; + the_line = rl_line_buffer = sp->buffer; + rl_line_buffer_len = sp->buflen; + rl_undo_list = sp->ul; + rl_prompt = sp->prompt; + + rl_readline_state = sp->rlstate; + rl_done = sp->done; + _rl_keymap = sp->kmap; + + rl_last_func = sp->lastfunc; + rl_insert_mode = sp->insmode; + rl_editing_mode = sp->edmode; + rl_key_sequence_length = sp->kseqlen; + rl_instream = sp->inf; + rl_outstream = sp->outf; + rl_pending_input = sp->pendingin; + rl_executing_macro = sp->macro; + + rl_catch_signals = sp->catchsigs; + rl_catch_sigwinch = sp->catchsigwinch; + + return (0); +} diff --git a/.pc/bash43-003.diff/patchlevel.h b/.pc/bash43-003.diff/patchlevel.h new file mode 100644 index 0000000..1146585 --- /dev/null +++ b/.pc/bash43-003.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 2 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-004.diff/lib/readline/readline.c b/.pc/bash43-004.diff/lib/readline/readline.c new file mode 100644 index 0000000..55c0522 --- /dev/null +++ b/.pc/bash43-004.diff/lib/readline/readline.c @@ -0,0 +1,1364 @@ +/* readline.c -- a general facility for reading lines of input + with emacs style editing and completion. */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include +#include "posixstat.h" +#include +#if defined (HAVE_SYS_FILE_H) +# include +#endif /* HAVE_SYS_FILE_H */ + +#if defined (HAVE_UNISTD_H) +# include +#endif /* HAVE_UNISTD_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#if defined (HAVE_LOCALE_H) +# include +#endif + +#include +#include "posixjmp.h" +#include + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" +#include "rlmbutil.h" + +#if defined (__EMX__) +# define INCL_DOSPROCESS +# include +#endif /* __EMX__ */ + +/* Some standard library routines. */ +#include "readline.h" +#include "history.h" + +#include "rlprivate.h" +#include "rlshell.h" +#include "xmalloc.h" + +#ifndef RL_LIBRARY_VERSION +# define RL_LIBRARY_VERSION "5.1" +#endif + +#ifndef RL_READLINE_VERSION +# define RL_READLINE_VERSION 0x0501 +#endif + +extern void _rl_free_history_entry PARAMS((HIST_ENTRY *)); + +#if defined (COLOR_SUPPORT) +extern void _rl_parse_colors PARAMS((void)); /* XXX */ +#endif + + +/* Forward declarations used in this file. */ +static char *readline_internal PARAMS((void)); +static void readline_initialize_everything PARAMS((void)); + +static void bind_arrow_keys_internal PARAMS((Keymap)); +static void bind_arrow_keys PARAMS((void)); + +static void readline_default_bindings PARAMS((void)); +static void reset_default_bindings PARAMS((void)); + +static int _rl_subseq_result PARAMS((int, Keymap, int, int)); +static int _rl_subseq_getchar PARAMS((int)); + +/* **************************************************************** */ +/* */ +/* Line editing input utility */ +/* */ +/* **************************************************************** */ + +const char *rl_library_version = RL_LIBRARY_VERSION; + +int rl_readline_version = RL_READLINE_VERSION; + +/* True if this is `real' readline as opposed to some stub substitute. */ +int rl_gnu_readline_p = 1; + +/* A pointer to the keymap that is currently in use. + By default, it is the standard emacs keymap. */ +Keymap _rl_keymap = emacs_standard_keymap; + +/* The current style of editing. */ +int rl_editing_mode = emacs_mode; + +/* The current insert mode: input (the default) or overwrite */ +int rl_insert_mode = RL_IM_DEFAULT; + +/* Non-zero if we called this function from _rl_dispatch(). It's present + so functions can find out whether they were called from a key binding + or directly from an application. */ +int rl_dispatching; + +/* Non-zero if the previous command was a kill command. */ +int _rl_last_command_was_kill = 0; + +/* The current value of the numeric argument specified by the user. */ +int rl_numeric_arg = 1; + +/* Non-zero if an argument was typed. */ +int rl_explicit_arg = 0; + +/* Temporary value used while generating the argument. */ +int rl_arg_sign = 1; + +/* Non-zero means we have been called at least once before. */ +static int rl_initialized; + +#if 0 +/* If non-zero, this program is running in an EMACS buffer. */ +static int running_in_emacs; +#endif + +/* Flags word encapsulating the current readline state. */ +int rl_readline_state = RL_STATE_NONE; + +/* The current offset in the current input line. */ +int rl_point; + +/* Mark in the current input line. */ +int rl_mark; + +/* Length of the current input line. */ +int rl_end; + +/* Make this non-zero to return the current input_line. */ +int rl_done; + +/* The last function executed by readline. */ +rl_command_func_t *rl_last_func = (rl_command_func_t *)NULL; + +/* Top level environment for readline_internal (). */ +procenv_t _rl_top_level; + +/* The streams we interact with. */ +FILE *_rl_in_stream, *_rl_out_stream; + +/* The names of the streams that we do input and output to. */ +FILE *rl_instream = (FILE *)NULL; +FILE *rl_outstream = (FILE *)NULL; + +/* Non-zero means echo characters as they are read. Defaults to no echo; + set to 1 if there is a controlling terminal, we can get its attributes, + and the attributes include `echo'. Look at rltty.c:prepare_terminal_settings + for the code that sets it. */ +int _rl_echoing_p = 0; + +/* Current prompt. */ +char *rl_prompt = (char *)NULL; +int rl_visible_prompt_length = 0; + +/* Set to non-zero by calling application if it has already printed rl_prompt + and does not want readline to do it the first time. */ +int rl_already_prompted = 0; + +/* The number of characters read in order to type this complete command. */ +int rl_key_sequence_length = 0; + +/* If non-zero, then this is the address of a function to call just + before readline_internal_setup () prints the first prompt. */ +rl_hook_func_t *rl_startup_hook = (rl_hook_func_t *)NULL; + +/* If non-zero, this is the address of a function to call just before + readline_internal_setup () returns and readline_internal starts + reading input characters. */ +rl_hook_func_t *rl_pre_input_hook = (rl_hook_func_t *)NULL; + +/* What we use internally. You should always refer to RL_LINE_BUFFER. */ +static char *the_line; + +/* The character that can generate an EOF. Really read from + the terminal driver... just defaulted here. */ +int _rl_eof_char = CTRL ('D'); + +/* Non-zero makes this the next keystroke to read. */ +int rl_pending_input = 0; + +/* Pointer to a useful terminal name. */ +const char *rl_terminal_name = (const char *)NULL; + +/* Non-zero means to always use horizontal scrolling in line display. */ +int _rl_horizontal_scroll_mode = 0; + +/* Non-zero means to display an asterisk at the starts of history lines + which have been modified. */ +int _rl_mark_modified_lines = 0; + +/* The style of `bell' notification preferred. This can be set to NO_BELL, + AUDIBLE_BELL, or VISIBLE_BELL. */ +int _rl_bell_preference = AUDIBLE_BELL; + +/* String inserted into the line by rl_insert_comment (). */ +char *_rl_comment_begin; + +/* Keymap holding the function currently being executed. */ +Keymap rl_executing_keymap; + +/* Keymap we're currently using to dispatch. */ +Keymap _rl_dispatching_keymap; + +/* Non-zero means to erase entire line, including prompt, on empty input lines. */ +int rl_erase_empty_line = 0; + +/* Non-zero means to read only this many characters rather than up to a + character bound to accept-line. */ +int rl_num_chars_to_read; + +/* Line buffer and maintenance. */ +char *rl_line_buffer = (char *)NULL; +int rl_line_buffer_len = 0; + +/* Key sequence `contexts' */ +_rl_keyseq_cxt *_rl_kscxt = 0; + +int rl_executing_key; +char *rl_executing_keyseq = 0; +int _rl_executing_keyseq_size = 0; + +/* Timeout (specified in milliseconds) when reading characters making up an + ambiguous multiple-key sequence */ +int _rl_keyseq_timeout = 500; + +#define RESIZE_KEYSEQ_BUFFER() \ + do \ + { \ + if (rl_key_sequence_length + 2 >= _rl_executing_keyseq_size) \ + { \ + _rl_executing_keyseq_size += 16; \ + rl_executing_keyseq = xrealloc (rl_executing_keyseq, _rl_executing_keyseq_size); \ + } \ + } \ + while (0); + +/* Forward declarations used by the display, termcap, and history code. */ + +/* **************************************************************** */ +/* */ +/* `Forward' declarations */ +/* */ +/* **************************************************************** */ + +/* Non-zero means do not parse any lines other than comments and + parser directives. */ +unsigned char _rl_parsing_conditionalized_out = 0; + +/* Non-zero means to convert characters with the meta bit set to + escape-prefixed characters so we can indirect through + emacs_meta_keymap or vi_escape_keymap. */ +int _rl_convert_meta_chars_to_ascii = 1; + +/* Non-zero means to output characters with the meta bit set directly + rather than as a meta-prefixed escape sequence. */ +int _rl_output_meta_chars = 0; + +/* Non-zero means to look at the termios special characters and bind + them to equivalent readline functions at startup. */ +int _rl_bind_stty_chars = 1; + +/* Non-zero means to go through the history list at every newline (or + whenever rl_done is set and readline returns) and revert each line to + its initial state. */ +int _rl_revert_all_at_newline = 0; + +/* Non-zero means to honor the termios ECHOCTL bit and echo control + characters corresponding to keyboard-generated signals. */ +int _rl_echo_control_chars = 1; + +/* Non-zero means to prefix the displayed prompt with a character indicating + the editing mode: @ for emacs, : for vi-command, + for vi-insert. */ +int _rl_show_mode_in_prompt = 0; + +/* **************************************************************** */ +/* */ +/* Top Level Functions */ +/* */ +/* **************************************************************** */ + +/* Non-zero means treat 0200 bit in terminal input as Meta bit. */ +int _rl_meta_flag = 0; /* Forward declaration */ + +/* Set up the prompt and expand it. Called from readline() and + rl_callback_handler_install (). */ +int +rl_set_prompt (prompt) + const char *prompt; +{ + FREE (rl_prompt); + rl_prompt = prompt ? savestring (prompt) : (char *)NULL; + rl_display_prompt = rl_prompt ? rl_prompt : ""; + + rl_visible_prompt_length = rl_expand_prompt (rl_prompt); + return 0; +} + +/* Read a line of input. Prompt with PROMPT. An empty PROMPT means + none. A return value of NULL means that EOF was encountered. */ +char * +readline (prompt) + const char *prompt; +{ + char *value; +#if 0 + int in_callback; +#endif + + /* If we are at EOF return a NULL string. */ + if (rl_pending_input == EOF) + { + rl_clear_pending_input (); + return ((char *)NULL); + } + +#if 0 + /* If readline() is called after installing a callback handler, temporarily + turn off the callback state to avoid ensuing messiness. Patch supplied + by the gdb folks. XXX -- disabled. This can be fooled and readline + left in a strange state by a poorly-timed longjmp. */ + if (in_callback = RL_ISSTATE (RL_STATE_CALLBACK)) + RL_UNSETSTATE (RL_STATE_CALLBACK); +#endif + + rl_set_prompt (prompt); + + rl_initialize (); + if (rl_prep_term_function) + (*rl_prep_term_function) (_rl_meta_flag); + +#if defined (HANDLE_SIGNALS) + rl_set_signals (); +#endif + + value = readline_internal (); + if (rl_deprep_term_function) + (*rl_deprep_term_function) (); + +#if defined (HANDLE_SIGNALS) + rl_clear_signals (); +#endif + +#if 0 + if (in_callback) + RL_SETSTATE (RL_STATE_CALLBACK); +#endif + +#if HAVE_DECL_AUDIT_TTY && defined (ENABLE_TTY_AUDIT_SUPPORT) + if (value) + _rl_audit_tty (value); +#endif + + return (value); +} + +#if defined (READLINE_CALLBACKS) +# define STATIC_CALLBACK +#else +# define STATIC_CALLBACK static +#endif + +STATIC_CALLBACK void +readline_internal_setup () +{ + char *nprompt; + + _rl_in_stream = rl_instream; + _rl_out_stream = rl_outstream; + + /* Enable the meta key only for the duration of readline(), if this + terminal has one and the terminal has been initialized */ + if (_rl_enable_meta & RL_ISSTATE (RL_STATE_TERMPREPPED)) + _rl_enable_meta_key (); + + if (rl_startup_hook) + (*rl_startup_hook) (); + +#if defined (VI_MODE) + if (rl_editing_mode == vi_mode) + rl_vi_insertion_mode (1, 'i'); /* don't want to reset last */ +#endif /* VI_MODE */ + + /* If we're not echoing, we still want to at least print a prompt, because + rl_redisplay will not do it for us. If the calling application has a + custom redisplay function, though, let that function handle it. */ + if (_rl_echoing_p == 0 && rl_redisplay_function == rl_redisplay) + { + if (rl_prompt && rl_already_prompted == 0) + { + nprompt = _rl_strip_prompt (rl_prompt); + fprintf (_rl_out_stream, "%s", nprompt); + fflush (_rl_out_stream); + xfree (nprompt); + } + } + else + { + if (rl_prompt && rl_already_prompted) + rl_on_new_line_with_prompt (); + else + rl_on_new_line (); + (*rl_redisplay_function) (); + } + + if (rl_pre_input_hook) + (*rl_pre_input_hook) (); + + RL_CHECK_SIGNALS (); +} + +STATIC_CALLBACK char * +readline_internal_teardown (eof) + int eof; +{ + char *temp; + HIST_ENTRY *entry; + + RL_CHECK_SIGNALS (); + + /* Restore the original of this history line, iff the line that we + are editing was originally in the history, AND the line has changed. */ + entry = current_history (); + + if (entry && rl_undo_list) + { + temp = savestring (the_line); + rl_revert_line (1, 0); + entry = replace_history_entry (where_history (), the_line, (histdata_t)NULL); + _rl_free_history_entry (entry); + + strcpy (the_line, temp); + xfree (temp); + } + + if (_rl_revert_all_at_newline) + _rl_revert_all_lines (); + + /* At any rate, it is highly likely that this line has an undo list. Get + rid of it now. */ + if (rl_undo_list) + rl_free_undo_list (); + + /* Disable the meta key, if this terminal has one and we were told to use it. + The check whether or not we sent the enable string is in + _rl_disable_meta_key(); the flag is set in _rl_enable_meta_key */ + _rl_disable_meta_key (); + + /* Restore normal cursor, if available. */ + _rl_set_insert_mode (RL_IM_INSERT, 0); + + return (eof ? (char *)NULL : savestring (the_line)); +} + +void +_rl_internal_char_cleanup () +{ +#if defined (VI_MODE) + /* In vi mode, when you exit insert mode, the cursor moves back + over the previous character. We explicitly check for that here. */ + if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap) + rl_vi_check (); +#endif /* VI_MODE */ + + if (rl_num_chars_to_read && rl_end >= rl_num_chars_to_read) + { + (*rl_redisplay_function) (); + _rl_want_redisplay = 0; + rl_newline (1, '\n'); + } + + if (rl_done == 0) + { + (*rl_redisplay_function) (); + _rl_want_redisplay = 0; + } + + /* If the application writer has told us to erase the entire line if + the only character typed was something bound to rl_newline, do so. */ + if (rl_erase_empty_line && rl_done && rl_last_func == rl_newline && + rl_point == 0 && rl_end == 0) + _rl_erase_entire_line (); +} + +STATIC_CALLBACK int +#if defined (READLINE_CALLBACKS) +readline_internal_char () +#else +readline_internal_charloop () +#endif +{ + static int lastc, eof_found; + int c, code, lk; + + lastc = -1; + eof_found = 0; + +#if !defined (READLINE_CALLBACKS) + while (rl_done == 0) + { +#endif + lk = _rl_last_command_was_kill; + +#if defined (HAVE_POSIX_SIGSETJMP) + code = sigsetjmp (_rl_top_level, 0); +#else + code = setjmp (_rl_top_level); +#endif + + if (code) + { + (*rl_redisplay_function) (); + _rl_want_redisplay = 0; + /* If we get here, we're not being called from something dispatched + from _rl_callback_read_char(), which sets up its own value of + _rl_top_level (saving and restoring the old, of course), so + we can just return here. */ + if (RL_ISSTATE (RL_STATE_CALLBACK)) + return (0); + } + + if (rl_pending_input == 0) + { + /* Then initialize the argument and number of keys read. */ + _rl_reset_argument (); + rl_key_sequence_length = 0; + rl_executing_keyseq[0] = 0; + } + + RL_SETSTATE(RL_STATE_READCMD); + c = rl_read_key (); + RL_UNSETSTATE(RL_STATE_READCMD); + + /* look at input.c:rl_getc() for the circumstances under which this will + be returned; punt immediately on read error without converting it to + a newline; assume that rl_read_key has already called the signal + handler. */ + if (c == READERR) + { +#if defined (READLINE_CALLBACKS) + RL_SETSTATE(RL_STATE_DONE); + return (rl_done = 1); +#else + eof_found = 1; + break; +#endif + } + + /* EOF typed to a non-blank line is a . If we want to change this, + to force any existing line to be ignored when read(2) reads EOF, + for example, this is the place to change. */ + if (c == EOF && rl_end) + c = NEWLINE; + + /* The character _rl_eof_char typed to blank line, and not as the + previous character is interpreted as EOF. */ + if (((c == _rl_eof_char && lastc != c) || c == EOF) && !rl_end) + { +#if defined (READLINE_CALLBACKS) + RL_SETSTATE(RL_STATE_DONE); + return (rl_done = 1); +#else + eof_found = 1; + break; +#endif + } + + lastc = c; + _rl_dispatch ((unsigned char)c, _rl_keymap); + RL_CHECK_SIGNALS (); + + /* If there was no change in _rl_last_command_was_kill, then no kill + has taken place. Note that if input is pending we are reading + a prefix command, so nothing has changed yet. */ + if (rl_pending_input == 0 && lk == _rl_last_command_was_kill) + _rl_last_command_was_kill = 0; + + _rl_internal_char_cleanup (); + +#if defined (READLINE_CALLBACKS) + return 0; +#else + } + + return (eof_found); +#endif +} + +#if defined (READLINE_CALLBACKS) +static int +readline_internal_charloop () +{ + int eof = 1; + + while (rl_done == 0) + eof = readline_internal_char (); + return (eof); +} +#endif /* READLINE_CALLBACKS */ + +/* Read a line of input from the global rl_instream, doing output on + the global rl_outstream. + If rl_prompt is non-null, then that is our prompt. */ +static char * +readline_internal () +{ + int eof; + + readline_internal_setup (); + eof = readline_internal_charloop (); + return (readline_internal_teardown (eof)); +} + +void +_rl_init_line_state () +{ + rl_point = rl_end = rl_mark = 0; + the_line = rl_line_buffer; + the_line[0] = 0; +} + +void +_rl_set_the_line () +{ + the_line = rl_line_buffer; +} + +#if defined (READLINE_CALLBACKS) +_rl_keyseq_cxt * +_rl_keyseq_cxt_alloc () +{ + _rl_keyseq_cxt *cxt; + + cxt = (_rl_keyseq_cxt *)xmalloc (sizeof (_rl_keyseq_cxt)); + + cxt->flags = cxt->subseq_arg = cxt->subseq_retval = 0; + + cxt->okey = 0; + cxt->ocxt = _rl_kscxt; + cxt->childval = 42; /* sentinel value */ + + return cxt; +} + +void +_rl_keyseq_cxt_dispose (cxt) + _rl_keyseq_cxt *cxt; +{ + xfree (cxt); +} + +void +_rl_keyseq_chain_dispose () +{ + _rl_keyseq_cxt *cxt; + + while (_rl_kscxt) + { + cxt = _rl_kscxt; + _rl_kscxt = _rl_kscxt->ocxt; + _rl_keyseq_cxt_dispose (cxt); + } +} +#endif + +static int +_rl_subseq_getchar (key) + int key; +{ + int k; + + if (key == ESC) + RL_SETSTATE(RL_STATE_METANEXT); + RL_SETSTATE(RL_STATE_MOREINPUT); + k = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + if (key == ESC) + RL_UNSETSTATE(RL_STATE_METANEXT); + + return k; +} + +#if defined (READLINE_CALLBACKS) +int +_rl_dispatch_callback (cxt) + _rl_keyseq_cxt *cxt; +{ + int nkey, r; + + /* For now */ + /* The first time this context is used, we want to read input and dispatch + on it. When traversing the chain of contexts back `up', we want to use + the value from the next context down. We're simulating recursion using + a chain of contexts. */ + if ((cxt->flags & KSEQ_DISPATCHED) == 0) + { + nkey = _rl_subseq_getchar (cxt->okey); + if (nkey < 0) + { + _rl_abort_internal (); + return -1; + } + r = _rl_dispatch_subseq (nkey, cxt->dmap, cxt->subseq_arg); + cxt->flags |= KSEQ_DISPATCHED; + } + else + r = cxt->childval; + + /* For now */ + if (r != -3) /* don't do this if we indicate there will be other matches */ + r = _rl_subseq_result (r, cxt->oldmap, cxt->okey, (cxt->flags & KSEQ_SUBSEQ)); + + RL_CHECK_SIGNALS (); + /* We only treat values < 0 specially to simulate recursion. */ + if (r >= 0 || (r == -1 && (cxt->flags & KSEQ_SUBSEQ) == 0)) /* success! or failure! */ + { + _rl_keyseq_chain_dispose (); + RL_UNSETSTATE (RL_STATE_MULTIKEY); + return r; + } + + if (r != -3) /* magic value that says we added to the chain */ + _rl_kscxt = cxt->ocxt; + if (_rl_kscxt) + _rl_kscxt->childval = r; + if (r != -3) + _rl_keyseq_cxt_dispose (cxt); + + return r; +} +#endif /* READLINE_CALLBACKS */ + +/* Do the command associated with KEY in MAP. + If the associated command is really a keymap, then read + another key, and dispatch into that map. */ +int +_rl_dispatch (key, map) + register int key; + Keymap map; +{ + _rl_dispatching_keymap = map; + return _rl_dispatch_subseq (key, map, 0); +} + +int +_rl_dispatch_subseq (key, map, got_subseq) + register int key; + Keymap map; + int got_subseq; +{ + int r, newkey; + char *macro; + rl_command_func_t *func; +#if defined (READLINE_CALLBACKS) + _rl_keyseq_cxt *cxt; +#endif + + if (META_CHAR (key) && _rl_convert_meta_chars_to_ascii) + { + if (map[ESC].type == ISKMAP) + { + if (RL_ISSTATE (RL_STATE_MACRODEF)) + _rl_add_macro_char (ESC); + RESIZE_KEYSEQ_BUFFER (); + rl_executing_keyseq[rl_key_sequence_length++] = ESC; + map = FUNCTION_TO_KEYMAP (map, ESC); + key = UNMETA (key); + return (_rl_dispatch (key, map)); + } + else + rl_ding (); + return 0; + } + + if (RL_ISSTATE (RL_STATE_MACRODEF)) + _rl_add_macro_char (key); + + r = 0; + switch (map[key].type) + { + case ISFUNC: + func = map[key].function; + if (func) + { + /* Special case rl_do_lowercase_version (). */ + if (func == rl_do_lowercase_version) + /* Should we do anything special if key == ANYOTHERKEY? */ + return (_rl_dispatch (_rl_to_lower (key), map)); + + rl_executing_keymap = map; + rl_executing_key = key; + + RESIZE_KEYSEQ_BUFFER(); + rl_executing_keyseq[rl_key_sequence_length++] = key; + rl_executing_keyseq[rl_key_sequence_length] = '\0'; + + rl_dispatching = 1; + RL_SETSTATE(RL_STATE_DISPATCHING); + r = (*func) (rl_numeric_arg * rl_arg_sign, key); + RL_UNSETSTATE(RL_STATE_DISPATCHING); + rl_dispatching = 0; + + /* If we have input pending, then the last command was a prefix + command. Don't change the state of rl_last_func. Otherwise, + remember the last command executed in this variable. */ + if (rl_pending_input == 0 && map[key].function != rl_digit_argument) + rl_last_func = map[key].function; + + RL_CHECK_SIGNALS (); + } + else if (map[ANYOTHERKEY].function) + { + /* OK, there's no function bound in this map, but there is a + shadow function that was overridden when the current keymap + was created. Return -2 to note that. */ + if (RL_ISSTATE (RL_STATE_MACROINPUT)) + _rl_prev_macro_key (); + else + _rl_unget_char (key); + return -2; + } + else if (got_subseq) + { + /* Return -1 to note that we're in a subsequence, but we don't + have a matching key, nor was one overridden. This means + we need to back up the recursion chain and find the last + subsequence that is bound to a function. */ + if (RL_ISSTATE (RL_STATE_MACROINPUT)) + _rl_prev_macro_key (); + else + _rl_unget_char (key); + return -1; + } + else + { +#if defined (READLINE_CALLBACKS) + RL_UNSETSTATE (RL_STATE_MULTIKEY); + _rl_keyseq_chain_dispose (); +#endif + _rl_abort_internal (); + return -1; + } + break; + + case ISKMAP: + if (map[key].function != 0) + { +#if defined (VI_MODE) + /* The only way this test will be true is if a subsequence has been + bound starting with ESC, generally the arrow keys. What we do is + check whether there's input in the queue, which there generally + will be if an arrow key has been pressed, and, if there's not, + just dispatch to (what we assume is) rl_vi_movement_mode right + away. This is essentially an input test with a zero timeout (by + default) or a timeout determined by the value of `keyseq-timeout' */ + /* _rl_keyseq_timeout specified in milliseconds; _rl_input_queued + takes microseconds, so multiply by 1000 */ + if (rl_editing_mode == vi_mode && key == ESC && map == vi_insertion_keymap + && _rl_input_queued ((_rl_keyseq_timeout > 0) ? _rl_keyseq_timeout*1000 : 0) == 0) + return (_rl_dispatch (ANYOTHERKEY, FUNCTION_TO_KEYMAP (map, key))); +#endif + + RESIZE_KEYSEQ_BUFFER (); + rl_executing_keyseq[rl_key_sequence_length++] = key; + _rl_dispatching_keymap = FUNCTION_TO_KEYMAP (map, key); + + /* Allocate new context here. Use linked contexts (linked through + cxt->ocxt) to simulate recursion */ +#if defined (READLINE_CALLBACKS) + if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + /* Return 0 only the first time, to indicate success to + _rl_callback_read_char. The rest of the time, we're called + from _rl_dispatch_callback, so we return -3 to indicate + special handling is necessary. */ + r = RL_ISSTATE (RL_STATE_MULTIKEY) ? -3 : 0; + cxt = _rl_keyseq_cxt_alloc (); + + if (got_subseq) + cxt->flags |= KSEQ_SUBSEQ; + cxt->okey = key; + cxt->oldmap = map; + cxt->dmap = _rl_dispatching_keymap; + cxt->subseq_arg = got_subseq || cxt->dmap[ANYOTHERKEY].function; + + RL_SETSTATE (RL_STATE_MULTIKEY); + _rl_kscxt = cxt; + + return r; /* don't indicate immediate success */ + } +#endif + + /* Tentative inter-character timeout for potential multi-key + sequences? If no input within timeout, abort sequence and + act as if we got non-matching input. */ + /* _rl_keyseq_timeout specified in milliseconds; _rl_input_queued + takes microseconds, so multiply by 1000 */ + if (_rl_keyseq_timeout > 0 && + (RL_ISSTATE (RL_STATE_INPUTPENDING|RL_STATE_MACROINPUT) == 0) && + _rl_pushed_input_available () == 0 && + _rl_dispatching_keymap[ANYOTHERKEY].function && + _rl_input_queued (_rl_keyseq_timeout*1000) == 0) + return (_rl_subseq_result (-2, map, key, got_subseq)); + + newkey = _rl_subseq_getchar (key); + if (newkey < 0) + { + _rl_abort_internal (); + return -1; + } + + r = _rl_dispatch_subseq (newkey, _rl_dispatching_keymap, got_subseq || map[ANYOTHERKEY].function); + return _rl_subseq_result (r, map, key, got_subseq); + } + else + { + _rl_abort_internal (); + return -1; + } + break; + + case ISMACR: + if (map[key].function != 0) + { + rl_executing_keyseq[rl_key_sequence_length] = '\0'; + macro = savestring ((char *)map[key].function); + _rl_with_macro_input (macro); + return 0; + } + break; + } +#if defined (VI_MODE) + if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap && + key != ANYOTHERKEY && + rl_key_sequence_length == 1 && /* XXX */ + _rl_vi_textmod_command (key)) + _rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign); +#endif + + return (r); +} + +static int +_rl_subseq_result (r, map, key, got_subseq) + int r; + Keymap map; + int key, got_subseq; +{ + Keymap m; + int type, nt; + rl_command_func_t *func, *nf; + + if (r == -2) + /* We didn't match anything, and the keymap we're indexed into + shadowed a function previously bound to that prefix. Call + the function. The recursive call to _rl_dispatch_subseq has + already taken care of pushing any necessary input back onto + the input queue with _rl_unget_char. */ + { + m = _rl_dispatching_keymap; + type = m[ANYOTHERKEY].type; + func = m[ANYOTHERKEY].function; + if (type == ISFUNC && func == rl_do_lowercase_version) + r = _rl_dispatch (_rl_to_lower (key), map); + else if (type == ISFUNC && func == rl_insert) + { + /* If the function that was shadowed was self-insert, we + somehow need a keymap with map[key].func == self-insert. + Let's use this one. */ + nt = m[key].type; + nf = m[key].function; + + m[key].type = type; + m[key].function = func; + r = _rl_dispatch (key, m); + m[key].type = nt; + m[key].function = nf; + } + else + r = _rl_dispatch (ANYOTHERKEY, m); + } + else if (r && map[ANYOTHERKEY].function) + { + /* We didn't match (r is probably -1), so return something to + tell the caller that it should try ANYOTHERKEY for an + overridden function. */ + if (RL_ISSTATE (RL_STATE_MACROINPUT)) + _rl_prev_macro_key (); + else + _rl_unget_char (key); + _rl_dispatching_keymap = map; + return -2; + } + else if (r && got_subseq) + { + /* OK, back up the chain. */ + if (RL_ISSTATE (RL_STATE_MACROINPUT)) + _rl_prev_macro_key (); + else + _rl_unget_char (key); + _rl_dispatching_keymap = map; + return -1; + } + + return r; +} + +/* **************************************************************** */ +/* */ +/* Initializations */ +/* */ +/* **************************************************************** */ + +/* Initialize readline (and terminal if not already). */ +int +rl_initialize () +{ + /* If we have never been called before, initialize the + terminal and data structures. */ + if (!rl_initialized) + { + RL_SETSTATE(RL_STATE_INITIALIZING); + readline_initialize_everything (); + RL_UNSETSTATE(RL_STATE_INITIALIZING); + rl_initialized++; + RL_SETSTATE(RL_STATE_INITIALIZED); + } + + /* Initialize the current line information. */ + _rl_init_line_state (); + + /* We aren't done yet. We haven't even gotten started yet! */ + rl_done = 0; + RL_UNSETSTATE(RL_STATE_DONE); + + /* Tell the history routines what is going on. */ + _rl_start_using_history (); + + /* Make the display buffer match the state of the line. */ + rl_reset_line_state (); + + /* No such function typed yet. */ + rl_last_func = (rl_command_func_t *)NULL; + + /* Parsing of key-bindings begins in an enabled state. */ + _rl_parsing_conditionalized_out = 0; + +#if defined (VI_MODE) + if (rl_editing_mode == vi_mode) + _rl_vi_initialize_line (); +#endif + + /* Each line starts in insert mode (the default). */ + _rl_set_insert_mode (RL_IM_DEFAULT, 1); + + return 0; +} + +#if 0 +#if defined (__EMX__) +static void +_emx_build_environ () +{ + TIB *tibp; + PIB *pibp; + char *t, **tp; + int c; + + DosGetInfoBlocks (&tibp, &pibp); + t = pibp->pib_pchenv; + for (c = 1; *t; c++) + t += strlen (t) + 1; + tp = environ = (char **)xmalloc ((c + 1) * sizeof (char *)); + t = pibp->pib_pchenv; + while (*t) + { + *tp++ = t; + t += strlen (t) + 1; + } + *tp = 0; +} +#endif /* __EMX__ */ +#endif + +/* Initialize the entire state of the world. */ +static void +readline_initialize_everything () +{ +#if 0 +#if defined (__EMX__) + if (environ == 0) + _emx_build_environ (); +#endif +#endif + +#if 0 + /* Find out if we are running in Emacs -- UNUSED. */ + running_in_emacs = sh_get_env_value ("EMACS") != (char *)0; +#endif + + /* Set up input and output if they are not already set up. */ + if (!rl_instream) + rl_instream = stdin; + + if (!rl_outstream) + rl_outstream = stdout; + + /* Bind _rl_in_stream and _rl_out_stream immediately. These values + may change, but they may also be used before readline_internal () + is called. */ + _rl_in_stream = rl_instream; + _rl_out_stream = rl_outstream; + + /* Allocate data structures. */ + if (rl_line_buffer == 0) + rl_line_buffer = (char *)xmalloc (rl_line_buffer_len = DEFAULT_BUFFER_SIZE); + + /* Initialize the terminal interface. */ + if (rl_terminal_name == 0) + rl_terminal_name = sh_get_env_value ("TERM"); + _rl_init_terminal_io (rl_terminal_name); + + /* Bind tty characters to readline functions. */ + readline_default_bindings (); + + /* Initialize the function names. */ + rl_initialize_funmap (); + + /* Decide whether we should automatically go into eight-bit mode. */ + _rl_init_eightbit (); + + /* Read in the init file. */ + rl_read_init_file ((char *)NULL); + + /* XXX */ + if (_rl_horizontal_scroll_mode && _rl_term_autowrap) + { + _rl_screenwidth--; + _rl_screenchars -= _rl_screenheight; + } + + /* Override the effect of any `set keymap' assignments in the + inputrc file. */ + rl_set_keymap_from_edit_mode (); + + /* Try to bind a common arrow key prefix, if not already bound. */ + bind_arrow_keys (); + + /* If the completion parser's default word break characters haven't + been set yet, then do so now. */ + if (rl_completer_word_break_characters == (char *)NULL) + rl_completer_word_break_characters = (char *)rl_basic_word_break_characters; + +#if defined (COLOR_SUPPORT) + if (_rl_colored_stats) + _rl_parse_colors (); +#endif + + rl_executing_keyseq = malloc (_rl_executing_keyseq_size = 16); + if (rl_executing_keyseq) + rl_executing_keyseq[0] = '\0'; +} + +/* If this system allows us to look at the values of the regular + input editing characters, then bind them to their readline + equivalents, iff the characters are not bound to keymaps. */ +static void +readline_default_bindings () +{ + if (_rl_bind_stty_chars) + rl_tty_set_default_bindings (_rl_keymap); +} + +/* Reset the default bindings for the terminal special characters we're + interested in back to rl_insert and read the new ones. */ +static void +reset_default_bindings () +{ + if (_rl_bind_stty_chars) + { + rl_tty_unset_default_bindings (_rl_keymap); + rl_tty_set_default_bindings (_rl_keymap); + } +} + +/* Bind some common arrow key sequences in MAP. */ +static void +bind_arrow_keys_internal (map) + Keymap map; +{ + Keymap xkeymap; + + xkeymap = _rl_keymap; + _rl_keymap = map; + +#if defined (__MSDOS__) + rl_bind_keyseq_if_unbound ("\033[0A", rl_get_previous_history); + rl_bind_keyseq_if_unbound ("\033[0B", rl_backward_char); + rl_bind_keyseq_if_unbound ("\033[0C", rl_forward_char); + rl_bind_keyseq_if_unbound ("\033[0D", rl_get_next_history); +#endif + + rl_bind_keyseq_if_unbound ("\033[A", rl_get_previous_history); + rl_bind_keyseq_if_unbound ("\033[B", rl_get_next_history); + rl_bind_keyseq_if_unbound ("\033[C", rl_forward_char); + rl_bind_keyseq_if_unbound ("\033[D", rl_backward_char); + rl_bind_keyseq_if_unbound ("\033[H", rl_beg_of_line); + rl_bind_keyseq_if_unbound ("\033[F", rl_end_of_line); + + rl_bind_keyseq_if_unbound ("\033OA", rl_get_previous_history); + rl_bind_keyseq_if_unbound ("\033OB", rl_get_next_history); + rl_bind_keyseq_if_unbound ("\033OC", rl_forward_char); + rl_bind_keyseq_if_unbound ("\033OD", rl_backward_char); + rl_bind_keyseq_if_unbound ("\033OH", rl_beg_of_line); + rl_bind_keyseq_if_unbound ("\033OF", rl_end_of_line); + +#if defined (__MINGW32__) + rl_bind_keyseq_if_unbound ("\340H", rl_get_previous_history); + rl_bind_keyseq_if_unbound ("\340P", rl_get_next_history); + rl_bind_keyseq_if_unbound ("\340M", rl_forward_char); + rl_bind_keyseq_if_unbound ("\340K", rl_backward_char); + rl_bind_keyseq_if_unbound ("\340G", rl_beg_of_line); + rl_bind_keyseq_if_unbound ("\340O", rl_end_of_line); + rl_bind_keyseq_if_unbound ("\340S", rl_delete); + rl_bind_keyseq_if_unbound ("\340R", rl_overwrite_mode); + + /* These may or may not work because of the embedded NUL. */ + rl_bind_keyseq_if_unbound ("\\000H", rl_get_previous_history); + rl_bind_keyseq_if_unbound ("\\000P", rl_get_next_history); + rl_bind_keyseq_if_unbound ("\\000M", rl_forward_char); + rl_bind_keyseq_if_unbound ("\\000K", rl_backward_char); + rl_bind_keyseq_if_unbound ("\\000G", rl_beg_of_line); + rl_bind_keyseq_if_unbound ("\\000O", rl_end_of_line); + rl_bind_keyseq_if_unbound ("\\000S", rl_delete); + rl_bind_keyseq_if_unbound ("\\000R", rl_overwrite_mode); +#endif + + _rl_keymap = xkeymap; +} + +/* Try and bind the common arrow key prefixes after giving termcap and + the inputrc file a chance to bind them and create `real' keymaps + for the arrow key prefix. */ +static void +bind_arrow_keys () +{ + bind_arrow_keys_internal (emacs_standard_keymap); + +#if defined (VI_MODE) + bind_arrow_keys_internal (vi_movement_keymap); + /* Unbind vi_movement_keymap[ESC] to allow users to repeatedly hit ESC + in vi command mode while still allowing the arrow keys to work. */ + if (vi_movement_keymap[ESC].type == ISKMAP) + rl_bind_keyseq_in_map ("\033", (rl_command_func_t *)NULL, vi_movement_keymap); + bind_arrow_keys_internal (vi_insertion_keymap); +#endif +} + +/* **************************************************************** */ +/* */ +/* Saving and Restoring Readline's state */ +/* */ +/* **************************************************************** */ + +int +rl_save_state (sp) + struct readline_state *sp; +{ + if (sp == 0) + return -1; + + sp->point = rl_point; + sp->end = rl_end; + sp->mark = rl_mark; + sp->buffer = rl_line_buffer; + sp->buflen = rl_line_buffer_len; + sp->ul = rl_undo_list; + sp->prompt = rl_prompt; + + sp->rlstate = rl_readline_state; + sp->done = rl_done; + sp->kmap = _rl_keymap; + + sp->lastfunc = rl_last_func; + sp->insmode = rl_insert_mode; + sp->edmode = rl_editing_mode; + sp->kseqlen = rl_key_sequence_length; + sp->inf = rl_instream; + sp->outf = rl_outstream; + sp->pendingin = rl_pending_input; + sp->macro = rl_executing_macro; + + sp->catchsigs = rl_catch_signals; + sp->catchsigwinch = rl_catch_sigwinch; + + return (0); +} + +int +rl_restore_state (sp) + struct readline_state *sp; +{ + if (sp == 0) + return -1; + + rl_point = sp->point; + rl_end = sp->end; + rl_mark = sp->mark; + the_line = rl_line_buffer = sp->buffer; + rl_line_buffer_len = sp->buflen; + rl_undo_list = sp->ul; + rl_prompt = sp->prompt; + + rl_readline_state = sp->rlstate; + rl_done = sp->done; + _rl_keymap = sp->kmap; + + rl_last_func = sp->lastfunc; + rl_insert_mode = sp->insmode; + rl_editing_mode = sp->edmode; + rl_key_sequence_length = sp->kseqlen; + rl_instream = sp->inf; + rl_outstream = sp->outf; + rl_pending_input = sp->pendingin; + rl_executing_macro = sp->macro; + + rl_catch_signals = sp->catchsigs; + rl_catch_sigwinch = sp->catchsigwinch; + + return (0); +} diff --git a/.pc/bash43-004.diff/patchlevel.h b/.pc/bash43-004.diff/patchlevel.h new file mode 100644 index 0000000..a73336e --- /dev/null +++ b/.pc/bash43-004.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 3 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-005.diff/parse.y b/.pc/bash43-005.diff/parse.y new file mode 100644 index 0000000..82595de --- /dev/null +++ b/.pc/bash43-005.diff/parse.y @@ -0,0 +1,6227 @@ +/* parse.y - Yacc grammar for bash. */ + +/* Copyright (C) 1989-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +%{ +#include "config.h" + +#include "bashtypes.h" +#include "bashansi.h" + +#include "filecntl.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (HAVE_LOCALE_H) +# include +#endif + +#include +#include "chartypes.h" +#include + +#include "memalloc.h" + +#include "bashintl.h" + +#define NEED_STRFTIME_DECL /* used in externs.h */ + +#include "shell.h" +#include "typemax.h" /* SIZE_MAX if needed */ +#include "trap.h" +#include "flags.h" +#include "parser.h" +#include "mailcheck.h" +#include "test.h" +#include "builtins.h" +#include "builtins/common.h" +#include "builtins/builtext.h" + +#include "shmbutil.h" + +#if defined (READLINE) +# include "bashline.h" +# include +#endif /* READLINE */ + +#if defined (HISTORY) +# include "bashhist.h" +# include +#endif /* HISTORY */ + +#if defined (JOB_CONTROL) +# include "jobs.h" +#endif /* JOB_CONTROL */ + +#if defined (ALIAS) +# include "alias.h" +#else +typedef void *alias_t; +#endif /* ALIAS */ + +#if defined (PROMPT_STRING_DECODE) +# ifndef _MINIX +# include +# endif +# include +# if defined (TM_IN_SYS_TIME) +# include +# include +# endif /* TM_IN_SYS_TIME */ +# include "maxpath.h" +#endif /* PROMPT_STRING_DECODE */ + +#define RE_READ_TOKEN -99 +#define NO_EXPANSION -100 + +#ifdef DEBUG +# define YYDEBUG 1 +#else +# define YYDEBUG 0 +#endif + +#if defined (HANDLE_MULTIBYTE) +# define last_shell_getc_is_singlebyte \ + ((shell_input_line_index > 1) \ + ? shell_input_line_property[shell_input_line_index - 1] \ + : 1) +# define MBTEST(x) ((x) && last_shell_getc_is_singlebyte) +#else +# define last_shell_getc_is_singlebyte 1 +# define MBTEST(x) ((x)) +#endif + +#if defined (EXTENDED_GLOB) +extern int extended_glob; +#endif + +extern int eof_encountered; +extern int no_line_editing, running_under_emacs; +extern int current_command_number; +extern int sourcelevel, parse_and_execute_level; +extern int posixly_correct; +extern int last_command_exit_value; +extern pid_t last_command_subst_pid; +extern char *shell_name, *current_host_name; +extern char *dist_version; +extern int patch_level; +extern int dump_translatable_strings, dump_po_strings; +extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin; +#if defined (BUFFERED_INPUT) +extern int bash_input_fd_changed; +#endif + +extern int errno; +/* **************************************************************** */ +/* */ +/* "Forward" declarations */ +/* */ +/* **************************************************************** */ + +#ifdef DEBUG +static void debug_parser __P((int)); +#endif + +static int yy_getc __P((void)); +static int yy_ungetc __P((int)); + +#if defined (READLINE) +static int yy_readline_get __P((void)); +static int yy_readline_unget __P((int)); +#endif + +static int yy_string_get __P((void)); +static int yy_string_unget __P((int)); +static void rewind_input_string __P((void)); +static int yy_stream_get __P((void)); +static int yy_stream_unget __P((int)); + +static int shell_getc __P((int)); +static void shell_ungetc __P((int)); +static void discard_until __P((int)); + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) +static void push_string __P((char *, int, alias_t *)); +static void pop_string __P((void)); +static void free_string_list __P((void)); +#endif + +static char *read_a_line __P((int)); + +static int reserved_word_acceptable __P((int)); +static int yylex __P((void)); +static int alias_expand_token __P((char *)); +static int time_command_acceptable __P((void)); +static int special_case_tokens __P((char *)); +static int read_token __P((int)); +static char *parse_matched_pair __P((int, int, int, int *, int)); +static char *parse_comsub __P((int, int, int, int *, int)); +#if defined (ARRAY_VARS) +static char *parse_compound_assignment __P((int *)); +#endif +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) +static int parse_dparen __P((int)); +static int parse_arith_cmd __P((char **, int)); +#endif +#if defined (COND_COMMAND) +static void cond_error __P((void)); +static COND_COM *cond_expr __P((void)); +static COND_COM *cond_or __P((void)); +static COND_COM *cond_and __P((void)); +static COND_COM *cond_term __P((void)); +static int cond_skip_newlines __P((void)); +static COMMAND *parse_cond_command __P((void)); +#endif +#if defined (ARRAY_VARS) +static int token_is_assignment __P((char *, int)); +static int token_is_ident __P((char *, int)); +#endif +static int read_token_word __P((int)); +static void discard_parser_constructs __P((int)); + +static char *error_token_from_token __P((int)); +static char *error_token_from_text __P((void)); +static void print_offending_line __P((void)); +static void report_syntax_error __P((char *)); + +static void handle_eof_input_unit __P((void)); +static void prompt_again __P((void)); +#if 0 +static void reset_readline_prompt __P((void)); +#endif +static void print_prompt __P((void)); + +#if defined (HANDLE_MULTIBYTE) +static void set_line_mbstate __P((void)); +static char *shell_input_line_property = NULL; +#else +# define set_line_mbstate() +#endif + +extern int yyerror __P((const char *)); + +#ifdef DEBUG +extern int yydebug; +#endif + +/* Default prompt strings */ +char *primary_prompt = PPROMPT; +char *secondary_prompt = SPROMPT; + +/* PROMPT_STRING_POINTER points to one of these, never to an actual string. */ +char *ps1_prompt, *ps2_prompt; + +/* Handle on the current prompt string. Indirectly points through + ps1_ or ps2_prompt. */ +char **prompt_string_pointer = (char **)NULL; +char *current_prompt_string; + +/* Non-zero means we expand aliases in commands. */ +int expand_aliases = 0; + +/* If non-zero, the decoded prompt string undergoes parameter and + variable substitution, command substitution, arithmetic substitution, + string expansion, process substitution, and quote removal in + decode_prompt_string. */ +int promptvars = 1; + +/* If non-zero, $'...' and $"..." are expanded when they appear within + a ${...} expansion, even when the expansion appears within double + quotes. */ +int extended_quote = 1; + +/* The number of lines read from input while creating the current command. */ +int current_command_line_count; + +/* The number of lines in a command saved while we run parse_and_execute */ +int saved_command_line_count; + +/* The token that currently denotes the end of parse. */ +int shell_eof_token; + +/* The token currently being read. */ +int current_token; + +/* The current parser state. */ +int parser_state; + +/* Variables to manage the task of reading here documents, because we need to + defer the reading until after a complete command has been collected. */ +static REDIRECT *redir_stack[10]; +int need_here_doc; + +/* Where shell input comes from. History expansion is performed on each + line when the shell is interactive. */ +static char *shell_input_line = (char *)NULL; +static size_t shell_input_line_index; +static size_t shell_input_line_size; /* Amount allocated for shell_input_line. */ +static size_t shell_input_line_len; /* strlen (shell_input_line) */ + +/* Either zero or EOF. */ +static int shell_input_line_terminator; + +/* The line number in a script on which a function definition starts. */ +static int function_dstart; + +/* The line number in a script on which a function body starts. */ +static int function_bstart; + +/* The line number in a script at which an arithmetic for command starts. */ +static int arith_for_lineno; + +/* The decoded prompt string. Used if READLINE is not defined or if + editing is turned off. Analogous to current_readline_prompt. */ +static char *current_decoded_prompt; + +/* The last read token, or NULL. read_token () uses this for context + checking. */ +static int last_read_token; + +/* The token read prior to last_read_token. */ +static int token_before_that; + +/* The token read prior to token_before_that. */ +static int two_tokens_ago; + +static int global_extglob; + +/* The line number in a script where the word in a `case WORD', `select WORD' + or `for WORD' begins. This is a nested command maximum, since the array + index is decremented after a case, select, or for command is parsed. */ +#define MAX_CASE_NEST 128 +static int word_lineno[MAX_CASE_NEST]; +static int word_top = -1; + +/* If non-zero, it is the token that we want read_token to return + regardless of what text is (or isn't) present to be read. This + is reset by read_token. If token_to_read == WORD or + ASSIGNMENT_WORD, yylval.word should be set to word_desc_to_read. */ +static int token_to_read; +static WORD_DESC *word_desc_to_read; + +static REDIRECTEE source; +static REDIRECTEE redir; +%} + +%union { + WORD_DESC *word; /* the word that we read. */ + int number; /* the number that we read. */ + WORD_LIST *word_list; + COMMAND *command; + REDIRECT *redirect; + ELEMENT element; + PATTERN_LIST *pattern; +} + +/* Reserved words. Members of the first group are only recognized + in the case that they are preceded by a list_terminator. Members + of the second group are for [[...]] commands. Members of the + third group are recognized only under special circumstances. */ +%token IF THEN ELSE ELIF FI CASE ESAC FOR SELECT WHILE UNTIL DO DONE FUNCTION COPROC +%token COND_START COND_END COND_ERROR +%token IN BANG TIME TIMEOPT TIMEIGN + +/* More general tokens. yylex () knows how to make these. */ +%token WORD ASSIGNMENT_WORD REDIR_WORD +%token NUMBER +%token ARITH_CMD ARITH_FOR_EXPRS +%token COND_CMD +%token AND_AND OR_OR GREATER_GREATER LESS_LESS LESS_AND LESS_LESS_LESS +%token GREATER_AND SEMI_SEMI SEMI_AND SEMI_SEMI_AND +%token LESS_LESS_MINUS AND_GREATER AND_GREATER_GREATER LESS_GREATER +%token GREATER_BAR BAR_AND + +/* The types that the various syntactical units return. */ + +%type inputunit command pipeline pipeline_command +%type list list0 list1 compound_list simple_list simple_list1 +%type simple_command shell_command +%type for_command select_command case_command group_command +%type arith_command +%type cond_command +%type arith_for_command +%type coproc +%type function_def function_body if_command elif_clause subshell +%type redirection redirection_list +%type simple_command_element +%type word_list pattern +%type pattern_list case_clause_sequence case_clause +%type timespec +%type list_terminator + +%start inputunit + +%left '&' ';' '\n' yacc_EOF +%left AND_AND OR_OR +%right '|' BAR_AND +%% + +inputunit: simple_list simple_list_terminator + { + /* Case of regular command. Discard the error + safety net,and return the command just parsed. */ + global_command = $1; + eof_encountered = 0; + /* discard_parser_constructs (0); */ + if (parser_state & PST_CMDSUBST) + parser_state |= PST_EOFTOKEN; + YYACCEPT; + } + | '\n' + { + /* Case of regular command, but not a very + interesting one. Return a NULL command. */ + global_command = (COMMAND *)NULL; + if (parser_state & PST_CMDSUBST) + parser_state |= PST_EOFTOKEN; + YYACCEPT; + } + | error '\n' + { + /* Error during parsing. Return NULL command. */ + global_command = (COMMAND *)NULL; + eof_encountered = 0; + /* discard_parser_constructs (1); */ + if (interactive && parse_and_execute_level == 0) + { + YYACCEPT; + } + else + { + YYABORT; + } + } + | yacc_EOF + { + /* Case of EOF seen by itself. Do ignoreeof or + not. */ + global_command = (COMMAND *)NULL; + handle_eof_input_unit (); + YYACCEPT; + } + ; + +word_list: WORD + { $$ = make_word_list ($1, (WORD_LIST *)NULL); } + | word_list WORD + { $$ = make_word_list ($2, $1); } + ; + +redirection: '>' WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_output_direction, redir, 0); + } + | '<' WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_input_direction, redir, 0); + } + | NUMBER '>' WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_output_direction, redir, 0); + } + | NUMBER '<' WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_input_direction, redir, 0); + } + | REDIR_WORD '>' WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_output_direction, redir, REDIR_VARASSIGN); + } + | REDIR_WORD '<' WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_input_direction, redir, REDIR_VARASSIGN); + } + | GREATER_GREATER WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_appending_to, redir, 0); + } + | NUMBER GREATER_GREATER WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_appending_to, redir, 0); + } + | REDIR_WORD GREATER_GREATER WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_appending_to, redir, REDIR_VARASSIGN); + } + | GREATER_BAR WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_output_force, redir, 0); + } + | NUMBER GREATER_BAR WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_output_force, redir, 0); + } + | REDIR_WORD GREATER_BAR WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_output_force, redir, REDIR_VARASSIGN); + } + | LESS_GREATER WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_input_output, redir, 0); + } + | NUMBER LESS_GREATER WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_input_output, redir, 0); + } + | REDIR_WORD LESS_GREATER WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_input_output, redir, REDIR_VARASSIGN); + } + | LESS_LESS WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_reading_until, redir, 0); + redir_stack[need_here_doc++] = $$; + } + | NUMBER LESS_LESS WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_reading_until, redir, 0); + redir_stack[need_here_doc++] = $$; + } + | REDIR_WORD LESS_LESS WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN); + redir_stack[need_here_doc++] = $$; + } + | LESS_LESS_MINUS WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_deblank_reading_until, redir, 0); + redir_stack[need_here_doc++] = $$; + } + | NUMBER LESS_LESS_MINUS WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_deblank_reading_until, redir, 0); + redir_stack[need_here_doc++] = $$; + } + | REDIR_WORD LESS_LESS_MINUS WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN); + redir_stack[need_here_doc++] = $$; + } + | LESS_LESS_LESS WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_reading_string, redir, 0); + } + | NUMBER LESS_LESS_LESS WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_reading_string, redir, 0); + } + | REDIR_WORD LESS_LESS_LESS WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_reading_string, redir, REDIR_VARASSIGN); + } + | LESS_AND NUMBER + { + source.dest = 0; + redir.dest = $2; + $$ = make_redirection (source, r_duplicating_input, redir, 0); + } + | NUMBER LESS_AND NUMBER + { + source.dest = $1; + redir.dest = $3; + $$ = make_redirection (source, r_duplicating_input, redir, 0); + } + | REDIR_WORD LESS_AND NUMBER + { + source.filename = $1; + redir.dest = $3; + $$ = make_redirection (source, r_duplicating_input, redir, REDIR_VARASSIGN); + } + | GREATER_AND NUMBER + { + source.dest = 1; + redir.dest = $2; + $$ = make_redirection (source, r_duplicating_output, redir, 0); + } + | NUMBER GREATER_AND NUMBER + { + source.dest = $1; + redir.dest = $3; + $$ = make_redirection (source, r_duplicating_output, redir, 0); + } + | REDIR_WORD GREATER_AND NUMBER + { + source.filename = $1; + redir.dest = $3; + $$ = make_redirection (source, r_duplicating_output, redir, REDIR_VARASSIGN); + } + | LESS_AND WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_duplicating_input_word, redir, 0); + } + | NUMBER LESS_AND WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_duplicating_input_word, redir, 0); + } + | REDIR_WORD LESS_AND WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_duplicating_input_word, redir, REDIR_VARASSIGN); + } + | GREATER_AND WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_duplicating_output_word, redir, 0); + } + | NUMBER GREATER_AND WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_duplicating_output_word, redir, 0); + } + | REDIR_WORD GREATER_AND WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_duplicating_output_word, redir, REDIR_VARASSIGN); + } + | GREATER_AND '-' + { + source.dest = 1; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, 0); + } + | NUMBER GREATER_AND '-' + { + source.dest = $1; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, 0); + } + | REDIR_WORD GREATER_AND '-' + { + source.filename = $1; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, REDIR_VARASSIGN); + } + | LESS_AND '-' + { + source.dest = 0; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, 0); + } + | NUMBER LESS_AND '-' + { + source.dest = $1; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, 0); + } + | REDIR_WORD LESS_AND '-' + { + source.filename = $1; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, REDIR_VARASSIGN); + } + | AND_GREATER WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_err_and_out, redir, 0); + } + | AND_GREATER_GREATER WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_append_err_and_out, redir, 0); + } + ; + +simple_command_element: WORD + { $$.word = $1; $$.redirect = 0; } + | ASSIGNMENT_WORD + { $$.word = $1; $$.redirect = 0; } + | redirection + { $$.redirect = $1; $$.word = 0; } + ; + +redirection_list: redirection + { + $$ = $1; + } + | redirection_list redirection + { + register REDIRECT *t; + + for (t = $1; t->next; t = t->next) + ; + t->next = $2; + $$ = $1; + } + ; + +simple_command: simple_command_element + { $$ = make_simple_command ($1, (COMMAND *)NULL); } + | simple_command simple_command_element + { $$ = make_simple_command ($2, $1); } + ; + +command: simple_command + { $$ = clean_simple_command ($1); } + | shell_command + { $$ = $1; } + | shell_command redirection_list + { + COMMAND *tc; + + tc = $1; + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = $2; + } + else + tc->redirects = $2; + $$ = $1; + } + | function_def + { $$ = $1; } + | coproc + { $$ = $1; } + ; + +shell_command: for_command + { $$ = $1; } + | case_command + { $$ = $1; } + | WHILE compound_list DO compound_list DONE + { $$ = make_while_command ($2, $4); } + | UNTIL compound_list DO compound_list DONE + { $$ = make_until_command ($2, $4); } + | select_command + { $$ = $1; } + | if_command + { $$ = $1; } + | subshell + { $$ = $1; } + | group_command + { $$ = $1; } + | arith_command + { $$ = $1; } + | cond_command + { $$ = $1; } + | arith_for_command + { $$ = $1; } + ; + +for_command: FOR WORD newline_list DO compound_list DONE + { + $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD newline_list '{' compound_list '}' + { + $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD ';' newline_list DO compound_list DONE + { + $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD ';' newline_list '{' compound_list '}' + { + $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD newline_list IN word_list list_terminator newline_list DO compound_list DONE + { + $$ = make_for_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD newline_list IN word_list list_terminator newline_list '{' compound_list '}' + { + $$ = make_for_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD newline_list IN list_terminator newline_list DO compound_list DONE + { + $$ = make_for_command ($2, (WORD_LIST *)NULL, $8, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD newline_list IN list_terminator newline_list '{' compound_list '}' + { + $$ = make_for_command ($2, (WORD_LIST *)NULL, $8, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + ; + +arith_for_command: FOR ARITH_FOR_EXPRS list_terminator newline_list DO compound_list DONE + { + $$ = make_arith_for_command ($2, $6, arith_for_lineno); + if (word_top > 0) word_top--; + } + | FOR ARITH_FOR_EXPRS list_terminator newline_list '{' compound_list '}' + { + $$ = make_arith_for_command ($2, $6, arith_for_lineno); + if (word_top > 0) word_top--; + } + | FOR ARITH_FOR_EXPRS DO compound_list DONE + { + $$ = make_arith_for_command ($2, $4, arith_for_lineno); + if (word_top > 0) word_top--; + } + | FOR ARITH_FOR_EXPRS '{' compound_list '}' + { + $$ = make_arith_for_command ($2, $4, arith_for_lineno); + if (word_top > 0) word_top--; + } + ; + +select_command: SELECT WORD newline_list DO list DONE + { + $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | SELECT WORD newline_list '{' list '}' + { + $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | SELECT WORD ';' newline_list DO list DONE + { + $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | SELECT WORD ';' newline_list '{' list '}' + { + $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | SELECT WORD newline_list IN word_list list_terminator newline_list DO list DONE + { + $$ = make_select_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | SELECT WORD newline_list IN word_list list_terminator newline_list '{' list '}' + { + $$ = make_select_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + ; + +case_command: CASE WORD newline_list IN newline_list ESAC + { + $$ = make_case_command ($2, (PATTERN_LIST *)NULL, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | CASE WORD newline_list IN case_clause_sequence newline_list ESAC + { + $$ = make_case_command ($2, $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | CASE WORD newline_list IN case_clause ESAC + { + $$ = make_case_command ($2, $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + ; + +function_def: WORD '(' ')' newline_list function_body + { $$ = make_function_def ($1, $5, function_dstart, function_bstart); } + + | FUNCTION WORD '(' ')' newline_list function_body + { $$ = make_function_def ($2, $6, function_dstart, function_bstart); } + + | FUNCTION WORD newline_list function_body + { $$ = make_function_def ($2, $4, function_dstart, function_bstart); } + ; + +function_body: shell_command + { $$ = $1; } + | shell_command redirection_list + { + COMMAND *tc; + + tc = $1; + /* According to Posix.2 3.9.5, redirections + specified after the body of a function should + be attached to the function and performed when + the function is executed, not as part of the + function definition command. */ + /* XXX - I don't think it matters, but we might + want to change this in the future to avoid + problems differentiating between a function + definition with a redirection and a function + definition containing a single command with a + redirection. The two are semantically equivalent, + though -- the only difference is in how the + command printing code displays the redirections. */ + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = $2; + } + else + tc->redirects = $2; + $$ = $1; + } + ; + +subshell: '(' compound_list ')' + { + $$ = make_subshell_command ($2); + $$->flags |= CMD_WANT_SUBSHELL; + } + ; + +coproc: COPROC shell_command + { + $$ = make_coproc_command ("COPROC", $2); + $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + | COPROC shell_command redirection_list + { + COMMAND *tc; + + tc = $2; + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = $3; + } + else + tc->redirects = $3; + $$ = make_coproc_command ("COPROC", $2); + $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + | COPROC WORD shell_command + { + $$ = make_coproc_command ($2->word, $3); + $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + | COPROC WORD shell_command redirection_list + { + COMMAND *tc; + + tc = $3; + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = $4; + } + else + tc->redirects = $4; + $$ = make_coproc_command ($2->word, $3); + $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + | COPROC simple_command + { + $$ = make_coproc_command ("COPROC", clean_simple_command ($2)); + $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + ; + +if_command: IF compound_list THEN compound_list FI + { $$ = make_if_command ($2, $4, (COMMAND *)NULL); } + | IF compound_list THEN compound_list ELSE compound_list FI + { $$ = make_if_command ($2, $4, $6); } + | IF compound_list THEN compound_list elif_clause FI + { $$ = make_if_command ($2, $4, $5); } + ; + + +group_command: '{' compound_list '}' + { $$ = make_group_command ($2); } + ; + +arith_command: ARITH_CMD + { $$ = make_arith_command ($1); } + ; + +cond_command: COND_START COND_CMD COND_END + { $$ = $2; } + ; + +elif_clause: ELIF compound_list THEN compound_list + { $$ = make_if_command ($2, $4, (COMMAND *)NULL); } + | ELIF compound_list THEN compound_list ELSE compound_list + { $$ = make_if_command ($2, $4, $6); } + | ELIF compound_list THEN compound_list elif_clause + { $$ = make_if_command ($2, $4, $5); } + ; + +case_clause: pattern_list + | case_clause_sequence pattern_list + { $2->next = $1; $$ = $2; } + ; + +pattern_list: newline_list pattern ')' compound_list + { $$ = make_pattern_list ($2, $4); } + | newline_list pattern ')' newline_list + { $$ = make_pattern_list ($2, (COMMAND *)NULL); } + | newline_list '(' pattern ')' compound_list + { $$ = make_pattern_list ($3, $5); } + | newline_list '(' pattern ')' newline_list + { $$ = make_pattern_list ($3, (COMMAND *)NULL); } + ; + +case_clause_sequence: pattern_list SEMI_SEMI + { $$ = $1; } + | case_clause_sequence pattern_list SEMI_SEMI + { $2->next = $1; $$ = $2; } + | pattern_list SEMI_AND + { $1->flags |= CASEPAT_FALLTHROUGH; $$ = $1; } + | case_clause_sequence pattern_list SEMI_AND + { $2->flags |= CASEPAT_FALLTHROUGH; $2->next = $1; $$ = $2; } + | pattern_list SEMI_SEMI_AND + { $1->flags |= CASEPAT_TESTNEXT; $$ = $1; } + | case_clause_sequence pattern_list SEMI_SEMI_AND + { $2->flags |= CASEPAT_TESTNEXT; $2->next = $1; $$ = $2; } + ; + +pattern: WORD + { $$ = make_word_list ($1, (WORD_LIST *)NULL); } + | pattern '|' WORD + { $$ = make_word_list ($3, $1); } + ; + +/* A list allows leading or trailing newlines and + newlines as operators (equivalent to semicolons). + It must end with a newline or semicolon. + Lists are used within commands such as if, for, while. */ + +list: newline_list list0 + { + $$ = $2; + if (need_here_doc) + gather_here_documents (); + } + ; + +compound_list: list + | newline_list list1 + { + $$ = $2; + } + ; + +list0: list1 '\n' newline_list + | list1 '&' newline_list + { + if ($1->type == cm_connection) + $$ = connect_async_list ($1, (COMMAND *)NULL, '&'); + else + $$ = command_connect ($1, (COMMAND *)NULL, '&'); + } + | list1 ';' newline_list + + ; + +list1: list1 AND_AND newline_list list1 + { $$ = command_connect ($1, $4, AND_AND); } + | list1 OR_OR newline_list list1 + { $$ = command_connect ($1, $4, OR_OR); } + | list1 '&' newline_list list1 + { + if ($1->type == cm_connection) + $$ = connect_async_list ($1, $4, '&'); + else + $$ = command_connect ($1, $4, '&'); + } + | list1 ';' newline_list list1 + { $$ = command_connect ($1, $4, ';'); } + | list1 '\n' newline_list list1 + { $$ = command_connect ($1, $4, ';'); } + | pipeline_command + { $$ = $1; } + ; + +simple_list_terminator: '\n' + | yacc_EOF + ; + +list_terminator:'\n' + { $$ = '\n'; } + | ';' + { $$ = ';'; } + | yacc_EOF + { $$ = yacc_EOF; } + ; + +newline_list: + | newline_list '\n' + ; + +/* A simple_list is a list that contains no significant newlines + and no leading or trailing newlines. Newlines are allowed + only following operators, where they are not significant. + + This is what an inputunit consists of. */ + +simple_list: simple_list1 + { + $$ = $1; + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = $1; + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + | simple_list1 '&' + { + if ($1->type == cm_connection) + $$ = connect_async_list ($1, (COMMAND *)NULL, '&'); + else + $$ = command_connect ($1, (COMMAND *)NULL, '&'); + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = $1; + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + | simple_list1 ';' + { + $$ = $1; + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = $1; + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + ; + +simple_list1: simple_list1 AND_AND newline_list simple_list1 + { $$ = command_connect ($1, $4, AND_AND); } + | simple_list1 OR_OR newline_list simple_list1 + { $$ = command_connect ($1, $4, OR_OR); } + | simple_list1 '&' simple_list1 + { + if ($1->type == cm_connection) + $$ = connect_async_list ($1, $3, '&'); + else + $$ = command_connect ($1, $3, '&'); + } + | simple_list1 ';' simple_list1 + { $$ = command_connect ($1, $3, ';'); } + + | pipeline_command + { $$ = $1; } + ; + +pipeline_command: pipeline + { $$ = $1; } + | BANG pipeline_command + { + if ($2) + $2->flags ^= CMD_INVERT_RETURN; /* toggle */ + $$ = $2; + } + | timespec pipeline_command + { + if ($2) + $2->flags |= $1; + $$ = $2; + } + | timespec list_terminator + { + ELEMENT x; + + /* Boy, this is unclean. `time' by itself can + time a null command. We cheat and push a + newline back if the list_terminator was a newline + to avoid the double-newline problem (one to + terminate this, one to terminate the command) */ + x.word = 0; + x.redirect = 0; + $$ = make_simple_command (x, (COMMAND *)NULL); + $$->flags |= $1; + /* XXX - let's cheat and push a newline back */ + if ($2 == '\n') + token_to_read = '\n'; + } + | BANG list_terminator + { + ELEMENT x; + + /* This is just as unclean. Posix says that `!' + by itself should be equivalent to `false'. + We cheat and push a + newline back if the list_terminator was a newline + to avoid the double-newline problem (one to + terminate this, one to terminate the command) */ + x.word = 0; + x.redirect = 0; + $$ = make_simple_command (x, (COMMAND *)NULL); + $$->flags |= CMD_INVERT_RETURN; + /* XXX - let's cheat and push a newline back */ + if ($2 == '\n') + token_to_read = '\n'; + } + ; + +pipeline: pipeline '|' newline_list pipeline + { $$ = command_connect ($1, $4, '|'); } + | pipeline BAR_AND newline_list pipeline + { + /* Make cmd1 |& cmd2 equivalent to cmd1 2>&1 | cmd2 */ + COMMAND *tc; + REDIRECTEE rd, sd; + REDIRECT *r; + + tc = $1->type == cm_simple ? (COMMAND *)$1->value.Simple : $1; + sd.dest = 2; + rd.dest = 1; + r = make_redirection (sd, r_duplicating_output, rd, 0); + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = r; + } + else + tc->redirects = r; + + $$ = command_connect ($1, $4, '|'); + } + | command + { $$ = $1; } + ; + +timespec: TIME + { $$ = CMD_TIME_PIPELINE; } + | TIME TIMEOPT + { $$ = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } + | TIME TIMEOPT TIMEIGN + { $$ = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } + ; +%% + +/* Initial size to allocate for tokens, and the + amount to grow them by. */ +#define TOKEN_DEFAULT_INITIAL_SIZE 496 +#define TOKEN_DEFAULT_GROW_SIZE 512 + +/* Should we call prompt_again? */ +#define SHOULD_PROMPT() \ + (interactive && (bash_input.type == st_stdin || bash_input.type == st_stream)) + +#if defined (ALIAS) +# define expanding_alias() (pushed_string_list && pushed_string_list->expander) +#else +# define expanding_alias() 0 +#endif + +/* Global var is non-zero when end of file has been reached. */ +int EOF_Reached = 0; + +#ifdef DEBUG +static void +debug_parser (i) + int i; +{ +#if YYDEBUG != 0 + yydebug = i; +#endif +} +#endif + +/* yy_getc () returns the next available character from input or EOF. + yy_ungetc (c) makes `c' the next character to read. + init_yy_io (get, unget, type, location) makes the function GET the + installed function for getting the next character, makes UNGET the + installed function for un-getting a character, sets the type of stream + (either string or file) from TYPE, and makes LOCATION point to where + the input is coming from. */ + +/* Unconditionally returns end-of-file. */ +int +return_EOF () +{ + return (EOF); +} + +/* Variable containing the current get and unget functions. + See ./input.h for a clearer description. */ +BASH_INPUT bash_input; + +/* Set all of the fields in BASH_INPUT to NULL. Free bash_input.name if it + is non-null, avoiding a memory leak. */ +void +initialize_bash_input () +{ + bash_input.type = st_none; + FREE (bash_input.name); + bash_input.name = (char *)NULL; + bash_input.location.file = (FILE *)NULL; + bash_input.location.string = (char *)NULL; + bash_input.getter = (sh_cget_func_t *)NULL; + bash_input.ungetter = (sh_cunget_func_t *)NULL; +} + +/* Set the contents of the current bash input stream from + GET, UNGET, TYPE, NAME, and LOCATION. */ +void +init_yy_io (get, unget, type, name, location) + sh_cget_func_t *get; + sh_cunget_func_t *unget; + enum stream_type type; + const char *name; + INPUT_STREAM location; +{ + bash_input.type = type; + FREE (bash_input.name); + bash_input.name = name ? savestring (name) : (char *)NULL; + + /* XXX */ +#if defined (CRAY) + memcpy((char *)&bash_input.location.string, (char *)&location.string, sizeof(location)); +#else + bash_input.location = location; +#endif + bash_input.getter = get; + bash_input.ungetter = unget; +} + +char * +yy_input_name () +{ + return (bash_input.name ? bash_input.name : "stdin"); +} + +/* Call this to get the next character of input. */ +static int +yy_getc () +{ + return (*(bash_input.getter)) (); +} + +/* Call this to unget C. That is, to make C the next character + to be read. */ +static int +yy_ungetc (c) + int c; +{ + return (*(bash_input.ungetter)) (c); +} + +#if defined (BUFFERED_INPUT) +#ifdef INCLUDE_UNUSED +int +input_file_descriptor () +{ + switch (bash_input.type) + { + case st_stream: + return (fileno (bash_input.location.file)); + case st_bstream: + return (bash_input.location.buffered_fd); + case st_stdin: + default: + return (fileno (stdin)); + } +} +#endif +#endif /* BUFFERED_INPUT */ + +/* **************************************************************** */ +/* */ +/* Let input be read from readline (). */ +/* */ +/* **************************************************************** */ + +#if defined (READLINE) +char *current_readline_prompt = (char *)NULL; +char *current_readline_line = (char *)NULL; +int current_readline_line_index = 0; + +static int +yy_readline_get () +{ + SigHandler *old_sigint; + int line_len; + unsigned char c; + + if (!current_readline_line) + { + if (!bash_readline_initialized) + initialize_readline (); + +#if defined (JOB_CONTROL) + if (job_control) + give_terminal_to (shell_pgrp, 0); +#endif /* JOB_CONTROL */ + + old_sigint = (SigHandler *)IMPOSSIBLE_TRAP_HANDLER; + if (signal_is_ignored (SIGINT) == 0) + { + /* interrupt_immediately++; */ + old_sigint = (SigHandler *)set_signal_handler (SIGINT, sigint_sighandler); + } + + current_readline_line = readline (current_readline_prompt ? + current_readline_prompt : ""); + + CHECK_TERMSIG; + if (signal_is_ignored (SIGINT) == 0) + { + /* interrupt_immediately--; */ + if (old_sigint != IMPOSSIBLE_TRAP_HANDLER) + set_signal_handler (SIGINT, old_sigint); + } + +#if 0 + /* Reset the prompt to the decoded value of prompt_string_pointer. */ + reset_readline_prompt (); +#endif + + if (current_readline_line == 0) + return (EOF); + + current_readline_line_index = 0; + line_len = strlen (current_readline_line); + + current_readline_line = (char *)xrealloc (current_readline_line, 2 + line_len); + current_readline_line[line_len++] = '\n'; + current_readline_line[line_len] = '\0'; + } + + if (current_readline_line[current_readline_line_index] == 0) + { + free (current_readline_line); + current_readline_line = (char *)NULL; + return (yy_readline_get ()); + } + else + { + c = current_readline_line[current_readline_line_index++]; + return (c); + } +} + +static int +yy_readline_unget (c) + int c; +{ + if (current_readline_line_index && current_readline_line) + current_readline_line[--current_readline_line_index] = c; + return (c); +} + +void +with_input_from_stdin () +{ + INPUT_STREAM location; + + if (bash_input.type != st_stdin && stream_on_stack (st_stdin) == 0) + { + location.string = current_readline_line; + init_yy_io (yy_readline_get, yy_readline_unget, + st_stdin, "readline stdin", location); + } +} + +#else /* !READLINE */ + +void +with_input_from_stdin () +{ + with_input_from_stream (stdin, "stdin"); +} +#endif /* !READLINE */ + +/* **************************************************************** */ +/* */ +/* Let input come from STRING. STRING is zero terminated. */ +/* */ +/* **************************************************************** */ + +static int +yy_string_get () +{ + register char *string; + register unsigned char c; + + string = bash_input.location.string; + + /* If the string doesn't exist, or is empty, EOF found. */ + if (string && *string) + { + c = *string++; + bash_input.location.string = string; + return (c); + } + else + return (EOF); +} + +static int +yy_string_unget (c) + int c; +{ + *(--bash_input.location.string) = c; + return (c); +} + +void +with_input_from_string (string, name) + char *string; + const char *name; +{ + INPUT_STREAM location; + + location.string = string; + init_yy_io (yy_string_get, yy_string_unget, st_string, name, location); +} + +/* Count the number of characters we've consumed from bash_input.location.string + and read into shell_input_line, but have not returned from shell_getc. + That is the true input location. Rewind bash_input.location.string by + that number of characters, so it points to the last character actually + consumed by the parser. */ +static void +rewind_input_string () +{ + int xchars; + + /* number of unconsumed characters in the input -- XXX need to take newlines + into account, e.g., $(...\n) */ + xchars = shell_input_line_len - shell_input_line_index; + if (bash_input.location.string[-1] == '\n') + xchars++; + + /* XXX - how to reflect bash_input.location.string back to string passed to + parse_and_execute or xparse_dolparen? xparse_dolparen needs to know how + far into the string we parsed. parse_and_execute knows where bash_input. + location.string is, and how far from orig_string that is -- that's the + number of characters the command consumed. */ + + /* bash_input.location.string - xchars should be where we parsed to */ + /* need to do more validation on xchars value for sanity -- test cases. */ + bash_input.location.string -= xchars; +} + +/* **************************************************************** */ +/* */ +/* Let input come from STREAM. */ +/* */ +/* **************************************************************** */ + +/* These two functions used to test the value of the HAVE_RESTARTABLE_SYSCALLS + define, and just use getc/ungetc if it was defined, but since bash + installs its signal handlers without the SA_RESTART flag, some signals + (like SIGCHLD, SIGWINCH, etc.) received during a read(2) will not cause + the read to be restarted. We need to restart it ourselves. */ + +static int +yy_stream_get () +{ + int result; + + result = EOF; + if (bash_input.location.file) + { +#if 0 + if (interactive) + interrupt_immediately++; +#endif + + /* XXX - don't need terminate_immediately; getc_with_restart checks + for terminating signals itself if read returns < 0 */ + result = getc_with_restart (bash_input.location.file); + +#if 0 + if (interactive) + interrupt_immediately--; +#endif + } + return (result); +} + +static int +yy_stream_unget (c) + int c; +{ + return (ungetc_with_restart (c, bash_input.location.file)); +} + +void +with_input_from_stream (stream, name) + FILE *stream; + const char *name; +{ + INPUT_STREAM location; + + location.file = stream; + init_yy_io (yy_stream_get, yy_stream_unget, st_stream, name, location); +} + +typedef struct stream_saver { + struct stream_saver *next; + BASH_INPUT bash_input; + int line; +#if defined (BUFFERED_INPUT) + BUFFERED_STREAM *bstream; +#endif /* BUFFERED_INPUT */ +} STREAM_SAVER; + +/* The globally known line number. */ +int line_number = 0; + +/* The line number offset set by assigning to LINENO. Not currently used. */ +int line_number_base = 0; + +#if defined (COND_COMMAND) +static int cond_lineno; +static int cond_token; +#endif + +STREAM_SAVER *stream_list = (STREAM_SAVER *)NULL; + +void +push_stream (reset_lineno) + int reset_lineno; +{ + STREAM_SAVER *saver = (STREAM_SAVER *)xmalloc (sizeof (STREAM_SAVER)); + + xbcopy ((char *)&bash_input, (char *)&(saver->bash_input), sizeof (BASH_INPUT)); + +#if defined (BUFFERED_INPUT) + saver->bstream = (BUFFERED_STREAM *)NULL; + /* If we have a buffered stream, clear out buffers[fd]. */ + if (bash_input.type == st_bstream && bash_input.location.buffered_fd >= 0) + saver->bstream = set_buffered_stream (bash_input.location.buffered_fd, + (BUFFERED_STREAM *)NULL); +#endif /* BUFFERED_INPUT */ + + saver->line = line_number; + bash_input.name = (char *)NULL; + saver->next = stream_list; + stream_list = saver; + EOF_Reached = 0; + if (reset_lineno) + line_number = 0; +} + +void +pop_stream () +{ + if (!stream_list) + EOF_Reached = 1; + else + { + STREAM_SAVER *saver = stream_list; + + EOF_Reached = 0; + stream_list = stream_list->next; + + init_yy_io (saver->bash_input.getter, + saver->bash_input.ungetter, + saver->bash_input.type, + saver->bash_input.name, + saver->bash_input.location); + +#if defined (BUFFERED_INPUT) + /* If we have a buffered stream, restore buffers[fd]. */ + /* If the input file descriptor was changed while this was on the + save stack, update the buffered fd to the new file descriptor and + re-establish the buffer <-> bash_input fd correspondence. */ + if (bash_input.type == st_bstream && bash_input.location.buffered_fd >= 0) + { + if (bash_input_fd_changed) + { + bash_input_fd_changed = 0; + if (default_buffered_input >= 0) + { + bash_input.location.buffered_fd = default_buffered_input; + saver->bstream->b_fd = default_buffered_input; + SET_CLOSE_ON_EXEC (default_buffered_input); + } + } + /* XXX could free buffered stream returned as result here. */ + set_buffered_stream (bash_input.location.buffered_fd, saver->bstream); + } +#endif /* BUFFERED_INPUT */ + + line_number = saver->line; + + FREE (saver->bash_input.name); + free (saver); + } +} + +/* Return 1 if a stream of type TYPE is saved on the stack. */ +int +stream_on_stack (type) + enum stream_type type; +{ + register STREAM_SAVER *s; + + for (s = stream_list; s; s = s->next) + if (s->bash_input.type == type) + return 1; + return 0; +} + +/* Save the current token state and return it in a malloced array. */ +int * +save_token_state () +{ + int *ret; + + ret = (int *)xmalloc (4 * sizeof (int)); + ret[0] = last_read_token; + ret[1] = token_before_that; + ret[2] = two_tokens_ago; + ret[3] = current_token; + return ret; +} + +void +restore_token_state (ts) + int *ts; +{ + if (ts == 0) + return; + last_read_token = ts[0]; + token_before_that = ts[1]; + two_tokens_ago = ts[2]; + current_token = ts[3]; +} + +/* + * This is used to inhibit alias expansion and reserved word recognition + * inside case statement pattern lists. A `case statement pattern list' is: + * + * everything between the `in' in a `case word in' and the next ')' + * or `esac' + * everything between a `;;' and the next `)' or `esac' + */ + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + +#define END_OF_ALIAS 0 + +/* + * Pseudo-global variables used in implementing token-wise alias expansion. + */ + +/* + * Pushing and popping strings. This works together with shell_getc to + * implement alias expansion on a per-token basis. + */ + +#define PSH_ALIAS 0x01 +#define PSH_DPAREN 0x02 +#define PSH_SOURCE 0x04 + +typedef struct string_saver { + struct string_saver *next; + int expand_alias; /* Value to set expand_alias to when string is popped. */ + char *saved_line; +#if defined (ALIAS) + alias_t *expander; /* alias that caused this line to be pushed. */ +#endif + size_t saved_line_size, saved_line_index; + int saved_line_terminator; + int flags; +} STRING_SAVER; + +STRING_SAVER *pushed_string_list = (STRING_SAVER *)NULL; + +/* + * Push the current shell_input_line onto a stack of such lines and make S + * the current input. Used when expanding aliases. EXPAND is used to set + * the value of expand_next_token when the string is popped, so that the + * word after the alias in the original line is handled correctly when the + * alias expands to multiple words. TOKEN is the token that was expanded + * into S; it is saved and used to prevent infinite recursive expansion. + */ +static void +push_string (s, expand, ap) + char *s; + int expand; + alias_t *ap; +{ + STRING_SAVER *temp = (STRING_SAVER *)xmalloc (sizeof (STRING_SAVER)); + + temp->expand_alias = expand; + temp->saved_line = shell_input_line; + temp->saved_line_size = shell_input_line_size; + temp->saved_line_index = shell_input_line_index; + temp->saved_line_terminator = shell_input_line_terminator; + temp->flags = 0; +#if defined (ALIAS) + temp->expander = ap; + if (ap) + temp->flags = PSH_ALIAS; +#endif + temp->next = pushed_string_list; + pushed_string_list = temp; + +#if defined (ALIAS) + if (ap) + ap->flags |= AL_BEINGEXPANDED; +#endif + + shell_input_line = s; + shell_input_line_size = STRLEN (s); + shell_input_line_index = 0; + shell_input_line_terminator = '\0'; +#if 0 + parser_state &= ~PST_ALEXPNEXT; /* XXX */ +#endif + + set_line_mbstate (); +} + +/* + * Make the top of the pushed_string stack be the current shell input. + * Only called when there is something on the stack. Called from shell_getc + * when it thinks it has consumed the string generated by an alias expansion + * and needs to return to the original input line. + */ +static void +pop_string () +{ + STRING_SAVER *t; + + FREE (shell_input_line); + shell_input_line = pushed_string_list->saved_line; + shell_input_line_index = pushed_string_list->saved_line_index; + shell_input_line_size = pushed_string_list->saved_line_size; + shell_input_line_terminator = pushed_string_list->saved_line_terminator; + + if (pushed_string_list->expand_alias) + parser_state |= PST_ALEXPNEXT; + else + parser_state &= ~PST_ALEXPNEXT; + + t = pushed_string_list; + pushed_string_list = pushed_string_list->next; + +#if defined (ALIAS) + if (t->expander) + t->expander->flags &= ~AL_BEINGEXPANDED; +#endif + + free ((char *)t); + + set_line_mbstate (); +} + +static void +free_string_list () +{ + register STRING_SAVER *t, *t1; + + for (t = pushed_string_list; t; ) + { + t1 = t->next; + FREE (t->saved_line); +#if defined (ALIAS) + if (t->expander) + t->expander->flags &= ~AL_BEINGEXPANDED; +#endif + free ((char *)t); + t = t1; + } + pushed_string_list = (STRING_SAVER *)NULL; +} + +#endif /* ALIAS || DPAREN_ARITHMETIC */ + +void +free_pushed_string_input () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + free_string_list (); +#endif +} + +int +parser_expanding_alias () +{ + return (expanding_alias ()); +} + +void +parser_save_alias () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + push_string ((char *)NULL, 0, (alias_t *)NULL); + pushed_string_list->flags = PSH_SOURCE; /* XXX - for now */ +#else + ; +#endif +} + +void +parser_restore_alias () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + if (pushed_string_list) + pop_string (); +#else + ; +#endif +} + +/* Return a line of text, taken from wherever yylex () reads input. + If there is no more input, then we return NULL. If REMOVE_QUOTED_NEWLINE + is non-zero, we remove unquoted \ pairs. This is used by + read_secondary_line to read here documents. */ +static char * +read_a_line (remove_quoted_newline) + int remove_quoted_newline; +{ + static char *line_buffer = (char *)NULL; + static int buffer_size = 0; + int indx, c, peekc, pass_next; + +#if defined (READLINE) + if (no_line_editing && SHOULD_PROMPT ()) +#else + if (SHOULD_PROMPT ()) +#endif + print_prompt (); + + pass_next = indx = 0; + while (1) + { + /* Allow immediate exit if interrupted during input. */ + QUIT; + + c = yy_getc (); + + /* Ignore null bytes in input. */ + if (c == 0) + { +#if 0 + internal_warning ("read_a_line: ignored null byte in input"); +#endif + continue; + } + + /* If there is no more input, then we return NULL. */ + if (c == EOF) + { + if (interactive && bash_input.type == st_stream) + clearerr (stdin); + if (indx == 0) + return ((char *)NULL); + c = '\n'; + } + + /* `+2' in case the final character in the buffer is a newline. */ + RESIZE_MALLOCED_BUFFER (line_buffer, indx, 2, buffer_size, 128); + + /* IF REMOVE_QUOTED_NEWLINES is non-zero, we are reading a + here document with an unquoted delimiter. In this case, + the line will be expanded as if it were in double quotes. + We allow a backslash to escape the next character, but we + need to treat the backslash specially only if a backslash + quoting a backslash-newline pair appears in the line. */ + if (pass_next) + { + line_buffer[indx++] = c; + pass_next = 0; + } + else if (c == '\\' && remove_quoted_newline) + { + QUIT; + peekc = yy_getc (); + if (peekc == '\n') + { + line_number++; + continue; /* Make the unquoted \ pair disappear. */ + } + else + { + yy_ungetc (peekc); + pass_next = 1; + line_buffer[indx++] = c; /* Preserve the backslash. */ + } + } + else + line_buffer[indx++] = c; + + if (c == '\n') + { + line_buffer[indx] = '\0'; + return (line_buffer); + } + } +} + +/* Return a line as in read_a_line (), but insure that the prompt is + the secondary prompt. This is used to read the lines of a here + document. REMOVE_QUOTED_NEWLINE is non-zero if we should remove + newlines quoted with backslashes while reading the line. It is + non-zero unless the delimiter of the here document was quoted. */ +char * +read_secondary_line (remove_quoted_newline) + int remove_quoted_newline; +{ + char *ret; + int n, c; + + prompt_string_pointer = &ps2_prompt; + if (SHOULD_PROMPT()) + prompt_again (); + ret = read_a_line (remove_quoted_newline); +#if defined (HISTORY) + if (ret && remember_on_history && (parser_state & PST_HEREDOC)) + { + /* To make adding the the here-document body right, we need to rely + on history_delimiting_chars() returning \n for the first line of + the here-document body and the null string for the second and + subsequent lines, so we avoid double newlines. + current_command_line_count == 2 for the first line of the body. */ + + current_command_line_count++; + maybe_add_history (ret); + } +#endif /* HISTORY */ + return ret; +} + +/* **************************************************************** */ +/* */ +/* YYLEX () */ +/* */ +/* **************************************************************** */ + +/* Reserved words. These are only recognized as the first word of a + command. */ +STRING_INT_ALIST word_token_alist[] = { + { "if", IF }, + { "then", THEN }, + { "else", ELSE }, + { "elif", ELIF }, + { "fi", FI }, + { "case", CASE }, + { "esac", ESAC }, + { "for", FOR }, +#if defined (SELECT_COMMAND) + { "select", SELECT }, +#endif + { "while", WHILE }, + { "until", UNTIL }, + { "do", DO }, + { "done", DONE }, + { "in", IN }, + { "function", FUNCTION }, +#if defined (COMMAND_TIMING) + { "time", TIME }, +#endif + { "{", '{' }, + { "}", '}' }, + { "!", BANG }, +#if defined (COND_COMMAND) + { "[[", COND_START }, + { "]]", COND_END }, +#endif +#if defined (COPROCESS_SUPPORT) + { "coproc", COPROC }, +#endif + { (char *)NULL, 0} +}; + +/* other tokens that can be returned by read_token() */ +STRING_INT_ALIST other_token_alist[] = { + /* Multiple-character tokens with special values */ + { "--", TIMEIGN }, + { "-p", TIMEOPT }, + { "&&", AND_AND }, + { "||", OR_OR }, + { ">>", GREATER_GREATER }, + { "<<", LESS_LESS }, + { "<&", LESS_AND }, + { ">&", GREATER_AND }, + { ";;", SEMI_SEMI }, + { ";&", SEMI_AND }, + { ";;&", SEMI_SEMI_AND }, + { "<<-", LESS_LESS_MINUS }, + { "<<<", LESS_LESS_LESS }, + { "&>", AND_GREATER }, + { "&>>", AND_GREATER_GREATER }, + { "<>", LESS_GREATER }, + { ">|", GREATER_BAR }, + { "|&", BAR_AND }, + { "EOF", yacc_EOF }, + /* Tokens whose value is the character itself */ + { ">", '>' }, + { "<", '<' }, + { "-", '-' }, + { "{", '{' }, + { "}", '}' }, + { ";", ';' }, + { "(", '(' }, + { ")", ')' }, + { "|", '|' }, + { "&", '&' }, + { "newline", '\n' }, + { (char *)NULL, 0} +}; + +/* others not listed here: + WORD look at yylval.word + ASSIGNMENT_WORD look at yylval.word + NUMBER look at yylval.number + ARITH_CMD look at yylval.word_list + ARITH_FOR_EXPRS look at yylval.word_list + COND_CMD look at yylval.command +*/ + +/* These are used by read_token_word, but appear up here so that shell_getc + can use them to decide when to add otherwise blank lines to the history. */ + +/* The primary delimiter stack. */ +struct dstack dstack = { (char *)NULL, 0, 0 }; + +/* A temporary delimiter stack to be used when decoding prompt strings. + This is needed because command substitutions in prompt strings (e.g., PS2) + can screw up the parser's quoting state. */ +static struct dstack temp_dstack = { (char *)NULL, 0, 0 }; + +/* Macro for accessing the top delimiter on the stack. Returns the + delimiter or zero if none. */ +#define current_delimiter(ds) \ + (ds.delimiter_depth ? ds.delimiters[ds.delimiter_depth - 1] : 0) + +#define push_delimiter(ds, character) \ + do \ + { \ + if (ds.delimiter_depth + 2 > ds.delimiter_space) \ + ds.delimiters = (char *)xrealloc \ + (ds.delimiters, (ds.delimiter_space += 10) * sizeof (char)); \ + ds.delimiters[ds.delimiter_depth] = character; \ + ds.delimiter_depth++; \ + } \ + while (0) + +#define pop_delimiter(ds) ds.delimiter_depth-- + +/* Return the next shell input character. This always reads characters + from shell_input_line; when that line is exhausted, it is time to + read the next line. This is called by read_token when the shell is + processing normal command input. */ + +/* This implements one-character lookahead/lookbehind across physical input + lines, to avoid something being lost because it's pushed back with + shell_ungetc when we're at the start of a line. */ +static int eol_ungetc_lookahead = 0; + +static int +shell_getc (remove_quoted_newline) + int remove_quoted_newline; +{ + register int i; + int c, truncating; + unsigned char uc; + + QUIT; + + if (sigwinch_received) + { + sigwinch_received = 0; + get_new_window_size (0, (int *)0, (int *)0); + } + + if (eol_ungetc_lookahead) + { + c = eol_ungetc_lookahead; + eol_ungetc_lookahead = 0; + return (c); + } + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* If shell_input_line[shell_input_line_index] == 0, but there is + something on the pushed list of strings, then we don't want to go + off and get another line. We let the code down below handle it. */ + + if (!shell_input_line || ((!shell_input_line[shell_input_line_index]) && + (pushed_string_list == (STRING_SAVER *)NULL))) +#else /* !ALIAS && !DPAREN_ARITHMETIC */ + if (!shell_input_line || !shell_input_line[shell_input_line_index]) +#endif /* !ALIAS && !DPAREN_ARITHMETIC */ + { + line_number++; + + /* Let's not let one really really long line blow up memory allocation */ + if (shell_input_line && shell_input_line_size >= 32768) + { + free (shell_input_line); + shell_input_line = 0; + shell_input_line_size = 0; + } + + restart_read: + + /* Allow immediate exit if interrupted during input. */ + QUIT; + + i = truncating = 0; + shell_input_line_terminator = 0; + + /* If the shell is interatctive, but not currently printing a prompt + (interactive_shell && interactive == 0), we don't want to print + notifies or cleanup the jobs -- we want to defer it until we do + print the next prompt. */ + if (interactive_shell == 0 || SHOULD_PROMPT()) + { +#if defined (JOB_CONTROL) + /* This can cause a problem when reading a command as the result + of a trap, when the trap is called from flush_child. This call + had better not cause jobs to disappear from the job table in + that case, or we will have big trouble. */ + notify_and_cleanup (); +#else /* !JOB_CONTROL */ + cleanup_dead_jobs (); +#endif /* !JOB_CONTROL */ + } + +#if defined (READLINE) + if (no_line_editing && SHOULD_PROMPT()) +#else + if (SHOULD_PROMPT()) +#endif + print_prompt (); + + if (bash_input.type == st_stream) + clearerr (stdin); + + while (1) + { + c = yy_getc (); + + /* Allow immediate exit if interrupted during input. */ + QUIT; + + if (c == '\0') + { +#if 0 + internal_warning ("shell_getc: ignored null byte in input"); +#endif + continue; + } + + /* Theoretical overflow */ + /* If we can't put 256 bytes more into the buffer, allocate + everything we can and fill it as full as we can. */ + /* XXX - we ignore rest of line using `truncating' flag */ + if (shell_input_line_size > (SIZE_MAX - 256)) + { + size_t n; + + n = SIZE_MAX - i; /* how much more can we put into the buffer? */ + if (n <= 2) /* we have to save 1 for the newline added below */ + { + if (truncating == 0) + internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%llu): line truncated", shell_input_line_size, SIZE_MAX); + shell_input_line[i] = '\0'; + truncating = 1; + } + if (shell_input_line_size < SIZE_MAX) + { + shell_input_line_size = SIZE_MAX; + shell_input_line = xrealloc (shell_input_line, shell_input_line_size); + } + } + else + RESIZE_MALLOCED_BUFFER (shell_input_line, i, 2, shell_input_line_size, 256); + + if (c == EOF) + { + if (bash_input.type == st_stream) + clearerr (stdin); + + if (i == 0) + shell_input_line_terminator = EOF; + + shell_input_line[i] = '\0'; + break; + } + + if (truncating == 0 || c == '\n') + shell_input_line[i++] = c; + + if (c == '\n') + { + shell_input_line[--i] = '\0'; + current_command_line_count++; + break; + } + } + + shell_input_line_index = 0; + shell_input_line_len = i; /* == strlen (shell_input_line) */ + + set_line_mbstate (); + +#if defined (HISTORY) + if (remember_on_history && shell_input_line && shell_input_line[0]) + { + char *expansions; +# if defined (BANG_HISTORY) + int old_hist; + + /* If the current delimiter is a single quote, we should not be + performing history expansion, even if we're on a different + line from the original single quote. */ + old_hist = history_expansion_inhibited; + if (current_delimiter (dstack) == '\'') + history_expansion_inhibited = 1; +# endif + expansions = pre_process_line (shell_input_line, 1, 1); +# if defined (BANG_HISTORY) + history_expansion_inhibited = old_hist; +# endif + if (expansions != shell_input_line) + { + free (shell_input_line); + shell_input_line = expansions; + shell_input_line_len = shell_input_line ? + strlen (shell_input_line) : 0; + if (shell_input_line_len == 0) + current_command_line_count--; + + /* We have to force the xrealloc below because we don't know + the true allocated size of shell_input_line anymore. */ + shell_input_line_size = shell_input_line_len; + + set_line_mbstate (); + } + } + /* Try to do something intelligent with blank lines encountered while + entering multi-line commands. XXX - this is grotesque */ + else if (remember_on_history && shell_input_line && + shell_input_line[0] == '\0' && + current_command_line_count > 1) + { + if (current_delimiter (dstack)) + /* We know shell_input_line[0] == 0 and we're reading some sort of + quoted string. This means we've got a line consisting of only + a newline in a quoted string. We want to make sure this line + gets added to the history. */ + maybe_add_history (shell_input_line); + else + { + char *hdcs; + hdcs = history_delimiting_chars (shell_input_line); + if (hdcs && hdcs[0] == ';') + maybe_add_history (shell_input_line); + } + } + +#endif /* HISTORY */ + + if (shell_input_line) + { + /* Lines that signify the end of the shell's input should not be + echoed. We should not echo lines while parsing command + substitutions with recursive calls into the parsing engine; those + should only be echoed once when we read the word. That is the + reason for the test against shell_eof_token, which is set to a + right paren when parsing the contents of command substitutions. */ + if (echo_input_at_read && (shell_input_line[0] || + shell_input_line_terminator != EOF) && + shell_eof_token == 0) + fprintf (stderr, "%s\n", shell_input_line); + } + else + { + shell_input_line_size = 0; + prompt_string_pointer = ¤t_prompt_string; + if (SHOULD_PROMPT ()) + prompt_again (); + goto restart_read; + } + + /* Add the newline to the end of this string, iff the string does + not already end in an EOF character. */ + if (shell_input_line_terminator != EOF) + { + if (shell_input_line_size < SIZE_MAX && shell_input_line_len > shell_input_line_size - 3) + shell_input_line = (char *)xrealloc (shell_input_line, + 1 + (shell_input_line_size += 2)); + + shell_input_line[shell_input_line_len] = '\n'; + shell_input_line[shell_input_line_len + 1] = '\0'; + + set_line_mbstate (); + } + } + +next_alias_char: + uc = shell_input_line[shell_input_line_index]; + + if (uc) + shell_input_line_index++; + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* If UC is NULL, we have reached the end of the current input string. If + pushed_string_list is non-empty, it's time to pop to the previous string + because we have fully consumed the result of the last alias expansion. + Do it transparently; just return the next character of the string popped + to. */ + /* If pushed_string_list != 0 but pushed_string_list->expander == 0 (not + currently tested) and the flags value is not PSH_SOURCE, we are not + parsing an alias, we have just saved one (push_string, when called by + the parse_dparen code) In this case, just go on as well. The PSH_SOURCE + case is handled below. */ +pop_alias: + if (uc == 0 && pushed_string_list && pushed_string_list->flags != PSH_SOURCE) + { + pop_string (); + uc = shell_input_line[shell_input_line_index]; + if (uc) + shell_input_line_index++; + } +#endif /* ALIAS || DPAREN_ARITHMETIC */ + + if MBTEST(uc == '\\' && remove_quoted_newline && shell_input_line[shell_input_line_index] == '\n') + { + if (SHOULD_PROMPT ()) + prompt_again (); + line_number++; + /* What do we do here if we're expanding an alias whose definition + includes an escaped newline? If that's the last character in the + alias expansion, we just pop the pushed string list (recall that + we inhibit the appending of a space in mk_alexpansion() if newline + is the last character). If it's not the last character, we need + to consume the quoted newline and move to the next character in + the expansion. */ +#if defined (ALIAS) + if (expanding_alias () && shell_input_line[shell_input_line_index+1] == '\0') + { + uc = 0; + goto pop_alias; + } + else if (expanding_alias () && shell_input_line[shell_input_line_index+1] != '\0') + { + shell_input_line_index++; /* skip newline */ + goto next_alias_char; /* and get next character */ + } + else +#endif + goto restart_read; + } + + if (uc == 0 && shell_input_line_terminator == EOF) + return ((shell_input_line_index != 0) ? '\n' : EOF); + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* We already know that we are not parsing an alias expansion because of the + check for expanding_alias() above. This knows how parse_and_execute + handles switching to st_string input while an alias is being expanded, + hence the check for pushed_string_list without pushed_string_list->expander + and the check for PSH_SOURCE as pushed_string_list->flags. + parse_and_execute and parse_string both change the input type to st_string + and place the string to be parsed and executed into location.string, so + we should not stop reading that until the pointer is '\0'. + The check for shell_input_line_terminator may be superfluous. + + This solves the problem of `.' inside a multi-line alias with embedded + newlines executing things out of order. */ + if (uc == 0 && bash_input.type == st_string && *bash_input.location.string && + pushed_string_list && pushed_string_list->flags == PSH_SOURCE && + shell_input_line_terminator == 0) + { + shell_input_line_index = 0; + goto restart_read; + } +#endif + + return (uc); +} + +/* Put C back into the input for the shell. This might need changes for + HANDLE_MULTIBYTE around EOLs. Since we (currently) never push back a + character different than we read, shell_input_line_property doesn't need + to change when manipulating shell_input_line. The define for + last_shell_getc_is_singlebyte should take care of it, though. */ +static void +shell_ungetc (c) + int c; +{ + if (shell_input_line && shell_input_line_index) + shell_input_line[--shell_input_line_index] = c; + else + eol_ungetc_lookahead = c; +} + +#ifdef INCLUDE_UNUSED +/* Back the input pointer up by one, effectively `ungetting' a character. */ +static void +shell_ungetchar () +{ + if (shell_input_line && shell_input_line_index) + shell_input_line_index--; +} +#endif + +/* Discard input until CHARACTER is seen, then push that character back + onto the input stream. */ +static void +discard_until (character) + int character; +{ + int c; + + while ((c = shell_getc (0)) != EOF && c != character) + ; + + if (c != EOF) + shell_ungetc (c); +} + +void +execute_variable_command (command, vname) + char *command, *vname; +{ + char *last_lastarg; + sh_parser_state_t ps; + + save_parser_state (&ps); + last_lastarg = get_string_value ("_"); + if (last_lastarg) + last_lastarg = savestring (last_lastarg); + + parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEVAL_NOHIST); + + restore_parser_state (&ps); + bind_variable ("_", last_lastarg, 0); + FREE (last_lastarg); + + if (token_to_read == '\n') /* reset_parser was called */ + token_to_read = 0; +} + +/* Place to remember the token. We try to keep the buffer + at a reasonable size, but it can grow. */ +static char *token = (char *)NULL; + +/* Current size of the token buffer. */ +static int token_buffer_size; + +/* Command to read_token () explaining what we want it to do. */ +#define READ 0 +#define RESET 1 +#define prompt_is_ps1 \ + (!prompt_string_pointer || prompt_string_pointer == &ps1_prompt) + +/* Function for yyparse to call. yylex keeps track of + the last two tokens read, and calls read_token. */ +static int +yylex () +{ + if (interactive && (current_token == 0 || current_token == '\n')) + { + /* Before we print a prompt, we might have to check mailboxes. + We do this only if it is time to do so. Notice that only here + is the mail alarm reset; nothing takes place in check_mail () + except the checking of mail. Please don't change this. */ + if (prompt_is_ps1 && parse_and_execute_level == 0 && time_to_check_mail ()) + { + check_mail (); + reset_mail_timer (); + } + + /* Avoid printing a prompt if we're not going to read anything, e.g. + after resetting the parser with read_token (RESET). */ + if (token_to_read == 0 && SHOULD_PROMPT ()) + prompt_again (); + } + + two_tokens_ago = token_before_that; + token_before_that = last_read_token; + last_read_token = current_token; + current_token = read_token (READ); + + if ((parser_state & PST_EOFTOKEN) && current_token == shell_eof_token) + { + current_token = yacc_EOF; + if (bash_input.type == st_string) + rewind_input_string (); + } + parser_state &= ~PST_EOFTOKEN; + + return (current_token); +} + +/* When non-zero, we have read the required tokens + which allow ESAC to be the next one read. */ +static int esacs_needed_count; + +void +gather_here_documents () +{ + int r; + + r = 0; + while (need_here_doc) + { + parser_state |= PST_HEREDOC; + make_here_document (redir_stack[r++], line_number); + parser_state &= ~PST_HEREDOC; + need_here_doc--; + } +} + +/* When non-zero, an open-brace used to create a group is awaiting a close + brace partner. */ +static int open_brace_count; + +#define command_token_position(token) \ + (((token) == ASSIGNMENT_WORD) || (parser_state&PST_REDIRLIST) || \ + ((token) != SEMI_SEMI && (token) != SEMI_AND && (token) != SEMI_SEMI_AND && reserved_word_acceptable(token))) + +#define assignment_acceptable(token) \ + (command_token_position(token) && ((parser_state & PST_CASEPAT) == 0)) + +/* Check to see if TOKEN is a reserved word and return the token + value if it is. */ +#define CHECK_FOR_RESERVED_WORD(tok) \ + do { \ + if (!dollar_present && !quoted && \ + reserved_word_acceptable (last_read_token)) \ + { \ + int i; \ + for (i = 0; word_token_alist[i].word != (char *)NULL; i++) \ + if (STREQ (tok, word_token_alist[i].word)) \ + { \ + if ((parser_state & PST_CASEPAT) && (word_token_alist[i].token != ESAC)) \ + break; \ + if (word_token_alist[i].token == TIME && time_command_acceptable () == 0) \ + break; \ + if (word_token_alist[i].token == ESAC) \ + parser_state &= ~(PST_CASEPAT|PST_CASESTMT); \ + else if (word_token_alist[i].token == CASE) \ + parser_state |= PST_CASESTMT; \ + else if (word_token_alist[i].token == COND_END) \ + parser_state &= ~(PST_CONDCMD|PST_CONDEXPR); \ + else if (word_token_alist[i].token == COND_START) \ + parser_state |= PST_CONDCMD; \ + else if (word_token_alist[i].token == '{') \ + open_brace_count++; \ + else if (word_token_alist[i].token == '}' && open_brace_count) \ + open_brace_count--; \ + return (word_token_alist[i].token); \ + } \ + } \ + } while (0) + +#if defined (ALIAS) + + /* OK, we have a token. Let's try to alias expand it, if (and only if) + it's eligible. + + It is eligible for expansion if EXPAND_ALIASES is set, and + the token is unquoted and the last token read was a command + separator (or expand_next_token is set), and we are currently + processing an alias (pushed_string_list is non-empty) and this + token is not the same as the current or any previously + processed alias. + + Special cases that disqualify: + In a pattern list in a case statement (parser_state & PST_CASEPAT). */ + +static char * +mk_alexpansion (s) + char *s; +{ + int l; + char *r; + + l = strlen (s); + r = xmalloc (l + 2); + strcpy (r, s); + /* If the last character in the alias is a newline, don't add a trailing + space to the expansion. Works with shell_getc above. */ + if (r[l - 1] != ' ' && r[l - 1] != '\n') + r[l++] = ' '; + r[l] = '\0'; + return r; +} + +static int +alias_expand_token (tokstr) + char *tokstr; +{ + char *expanded; + alias_t *ap; + + if (((parser_state & PST_ALEXPNEXT) || command_token_position (last_read_token)) && + (parser_state & PST_CASEPAT) == 0) + { + ap = find_alias (tokstr); + + /* Currently expanding this token. */ + if (ap && (ap->flags & AL_BEINGEXPANDED)) + return (NO_EXPANSION); + + /* mk_alexpansion puts an extra space on the end of the alias expansion, + so the lookahead by the parser works right. If this gets changed, + make sure the code in shell_getc that deals with reaching the end of + an expanded alias is changed with it. */ + expanded = ap ? mk_alexpansion (ap->value) : (char *)NULL; + + if (expanded) + { + push_string (expanded, ap->flags & AL_EXPANDNEXT, ap); + return (RE_READ_TOKEN); + } + else + /* This is an eligible token that does not have an expansion. */ + return (NO_EXPANSION); + } + return (NO_EXPANSION); +} +#endif /* ALIAS */ + +static int +time_command_acceptable () +{ +#if defined (COMMAND_TIMING) + int i; + + if (posixly_correct && shell_compatibility_level > 41) + { + /* Quick check of the rest of the line to find the next token. If it + begins with a `-', Posix says to not return `time' as the token. + This was interp 267. */ + i = shell_input_line_index; + while (i < shell_input_line_len && (shell_input_line[i] == ' ' || shell_input_line[i] == '\t')) + i++; + if (shell_input_line[i] == '-') + return 0; + } + + switch (last_read_token) + { + case 0: + case ';': + case '\n': + case AND_AND: + case OR_OR: + case '&': + case DO: + case THEN: + case ELSE: + case '{': /* } */ + case '(': /* ) */ + case BANG: /* ! time pipeline */ + case TIME: /* time time pipeline */ + case TIMEOPT: /* time -p time pipeline */ + case TIMEIGN: /* time -p -- ... */ + return 1; + default: + return 0; + } +#else + return 0; +#endif /* COMMAND_TIMING */ +} + +/* Handle special cases of token recognition: + IN is recognized if the last token was WORD and the token + before that was FOR or CASE or SELECT. + + DO is recognized if the last token was WORD and the token + before that was FOR or SELECT. + + ESAC is recognized if the last token caused `esacs_needed_count' + to be set + + `{' is recognized if the last token as WORD and the token + before that was FUNCTION, or if we just parsed an arithmetic + `for' command. + + `}' is recognized if there is an unclosed `{' present. + + `-p' is returned as TIMEOPT if the last read token was TIME. + `--' is returned as TIMEIGN if the last read token was TIMEOPT. + + ']]' is returned as COND_END if the parser is currently parsing + a conditional expression ((parser_state & PST_CONDEXPR) != 0) + + `time' is returned as TIME if and only if it is immediately + preceded by one of `;', `\n', `||', `&&', or `&'. +*/ + +static int +special_case_tokens (tokstr) + char *tokstr; +{ + if ((last_read_token == WORD) && +#if defined (SELECT_COMMAND) + ((token_before_that == FOR) || (token_before_that == CASE) || (token_before_that == SELECT)) && +#else + ((token_before_that == FOR) || (token_before_that == CASE)) && +#endif + (tokstr[0] == 'i' && tokstr[1] == 'n' && tokstr[2] == 0)) + { + if (token_before_that == CASE) + { + parser_state |= PST_CASEPAT; + esacs_needed_count++; + } + return (IN); + } + + if (last_read_token == WORD && +#if defined (SELECT_COMMAND) + (token_before_that == FOR || token_before_that == SELECT) && +#else + (token_before_that == FOR) && +#endif + (tokstr[0] == 'd' && tokstr[1] == 'o' && tokstr[2] == '\0')) + return (DO); + + /* Ditto for ESAC in the CASE case. + Specifically, this handles "case word in esac", which is a legal + construct, certainly because someone will pass an empty arg to the + case construct, and we don't want it to barf. Of course, we should + insist that the case construct has at least one pattern in it, but + the designers disagree. */ + if (esacs_needed_count) + { + esacs_needed_count--; + if (STREQ (tokstr, "esac")) + { + parser_state &= ~PST_CASEPAT; + return (ESAC); + } + } + + /* The start of a shell function definition. */ + if (parser_state & PST_ALLOWOPNBRC) + { + parser_state &= ~PST_ALLOWOPNBRC; + if (tokstr[0] == '{' && tokstr[1] == '\0') /* } */ + { + open_brace_count++; + function_bstart = line_number; + return ('{'); /* } */ + } + } + + /* We allow a `do' after a for ((...)) without an intervening + list_terminator */ + if (last_read_token == ARITH_FOR_EXPRS && tokstr[0] == 'd' && tokstr[1] == 'o' && !tokstr[2]) + return (DO); + if (last_read_token == ARITH_FOR_EXPRS && tokstr[0] == '{' && tokstr[1] == '\0') /* } */ + { + open_brace_count++; + return ('{'); /* } */ + } + + if (open_brace_count && reserved_word_acceptable (last_read_token) && tokstr[0] == '}' && !tokstr[1]) + { + open_brace_count--; /* { */ + return ('}'); + } + +#if defined (COMMAND_TIMING) + /* Handle -p after `time'. */ + if (last_read_token == TIME && tokstr[0] == '-' && tokstr[1] == 'p' && !tokstr[2]) + return (TIMEOPT); + /* Handle -- after `time -p'. */ + if (last_read_token == TIMEOPT && tokstr[0] == '-' && tokstr[1] == '-' && !tokstr[2]) + return (TIMEIGN); +#endif + +#if defined (COND_COMMAND) /* [[ */ + if ((parser_state & PST_CONDEXPR) && tokstr[0] == ']' && tokstr[1] == ']' && tokstr[2] == '\0') + return (COND_END); +#endif + + return (-1); +} + +/* Called from shell.c when Control-C is typed at top level. Or + by the error rule at top level. */ +void +reset_parser () +{ + dstack.delimiter_depth = 0; /* No delimiters found so far. */ + open_brace_count = 0; + +#if defined (EXTENDED_GLOB) + /* Reset to global value of extended glob */ + if (parser_state & PST_EXTPAT) + extended_glob = global_extglob; +#endif + + parser_state = 0; + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + if (pushed_string_list) + free_string_list (); +#endif /* ALIAS || DPAREN_ARITHMETIC */ + + if (shell_input_line) + { + free (shell_input_line); + shell_input_line = (char *)NULL; + shell_input_line_size = shell_input_line_index = 0; + } + + FREE (word_desc_to_read); + word_desc_to_read = (WORD_DESC *)NULL; + + current_token = '\n'; /* XXX */ + last_read_token = '\n'; + token_to_read = '\n'; +} + +/* Read the next token. Command can be READ (normal operation) or + RESET (to normalize state). */ +static int +read_token (command) + int command; +{ + int character; /* Current character. */ + int peek_char; /* Temporary look-ahead character. */ + int result; /* The thing to return. */ + + if (command == RESET) + { + reset_parser (); + return ('\n'); + } + + if (token_to_read) + { + result = token_to_read; + if (token_to_read == WORD || token_to_read == ASSIGNMENT_WORD) + { + yylval.word = word_desc_to_read; + word_desc_to_read = (WORD_DESC *)NULL; + } + token_to_read = 0; + return (result); + } + +#if defined (COND_COMMAND) + if ((parser_state & (PST_CONDCMD|PST_CONDEXPR)) == PST_CONDCMD) + { + cond_lineno = line_number; + parser_state |= PST_CONDEXPR; + yylval.command = parse_cond_command (); + if (cond_token != COND_END) + { + cond_error (); + return (-1); + } + token_to_read = COND_END; + parser_state &= ~(PST_CONDEXPR|PST_CONDCMD); + return (COND_CMD); + } +#endif + +#if defined (ALIAS) + /* This is a place to jump back to once we have successfully expanded a + token with an alias and pushed the string with push_string () */ + re_read_token: +#endif /* ALIAS */ + + /* Read a single word from input. Start by skipping blanks. */ + while ((character = shell_getc (1)) != EOF && shellblank (character)) + ; + + if (character == EOF) + { + EOF_Reached = 1; + return (yacc_EOF); + } + + if MBTEST(character == '#' && (!interactive || interactive_comments)) + { + /* A comment. Discard until EOL or EOF, and then return a newline. */ + discard_until ('\n'); + shell_getc (0); + character = '\n'; /* this will take the next if statement and return. */ + } + + if (character == '\n') + { + /* If we're about to return an unquoted newline, we can go and collect + the text of any pending here document. */ + if (need_here_doc) + gather_here_documents (); + +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + parser_state &= ~PST_ASSIGNOK; + + return (character); + } + + if (parser_state & PST_REGEXP) + goto tokword; + + /* Shell meta-characters. */ + if MBTEST(shellmeta (character) && ((parser_state & PST_DBLPAREN) == 0)) + { +#if defined (ALIAS) + /* Turn off alias tokenization iff this character sequence would + not leave us ready to read a command. */ + if (character == '<' || character == '>') + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + parser_state &= ~PST_ASSIGNOK; + + peek_char = shell_getc (1); + if (character == peek_char) + { + switch (character) + { + case '<': + /* If '<' then we could be at "<<" or at "<<-". We have to + look ahead one more character. */ + peek_char = shell_getc (1); + if MBTEST(peek_char == '-') + return (LESS_LESS_MINUS); + else if MBTEST(peek_char == '<') + return (LESS_LESS_LESS); + else + { + shell_ungetc (peek_char); + return (LESS_LESS); + } + + case '>': + return (GREATER_GREATER); + + case ';': + parser_state |= PST_CASEPAT; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + peek_char = shell_getc (1); + if MBTEST(peek_char == '&') + return (SEMI_SEMI_AND); + else + { + shell_ungetc (peek_char); + return (SEMI_SEMI); + } + + case '&': + return (AND_AND); + + case '|': + return (OR_OR); + +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) + case '(': /* ) */ + result = parse_dparen (character); + if (result == -2) + break; + else + return result; +#endif + } + } + else if MBTEST(character == '<' && peek_char == '&') + return (LESS_AND); + else if MBTEST(character == '>' && peek_char == '&') + return (GREATER_AND); + else if MBTEST(character == '<' && peek_char == '>') + return (LESS_GREATER); + else if MBTEST(character == '>' && peek_char == '|') + return (GREATER_BAR); + else if MBTEST(character == '&' && peek_char == '>') + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '>') + return (AND_GREATER_GREATER); + else + { + shell_ungetc (peek_char); + return (AND_GREATER); + } + } + else if MBTEST(character == '|' && peek_char == '&') + return (BAR_AND); + else if MBTEST(character == ';' && peek_char == '&') + { + parser_state |= PST_CASEPAT; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + return (SEMI_AND); + } + + shell_ungetc (peek_char); + + /* If we look like we are reading the start of a function + definition, then let the reader know about it so that + we will do the right thing with `{'. */ + if MBTEST(character == ')' && last_read_token == '(' && token_before_that == WORD) + { + parser_state |= PST_ALLOWOPNBRC; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + function_dstart = line_number; + } + + /* case pattern lists may be preceded by an optional left paren. If + we're not trying to parse a case pattern list, the left paren + indicates a subshell. */ + if MBTEST(character == '(' && (parser_state & PST_CASEPAT) == 0) /* ) */ + parser_state |= PST_SUBSHELL; + /*(*/ + else if MBTEST((parser_state & PST_CASEPAT) && character == ')') + parser_state &= ~PST_CASEPAT; + /*(*/ + else if MBTEST((parser_state & PST_SUBSHELL) && character == ')') + parser_state &= ~PST_SUBSHELL; + +#if defined (PROCESS_SUBSTITUTION) + /* Check for the constructs which introduce process substitution. + Shells running in `posix mode' don't do process substitution. */ + if MBTEST(posixly_correct || ((character != '>' && character != '<') || peek_char != '(')) /*)*/ +#endif /* PROCESS_SUBSTITUTION */ + return (character); + } + + /* Hack <&- (close stdin) case. Also <&N- (dup and close). */ + if MBTEST(character == '-' && (last_read_token == LESS_AND || last_read_token == GREATER_AND)) + return (character); + +tokword: + /* Okay, if we got this far, we have to read a word. Read one, + and then check it against the known ones. */ + result = read_token_word (character); +#if defined (ALIAS) + if (result == RE_READ_TOKEN) + goto re_read_token; +#endif + return result; +} + +/* + * Match a $(...) or other grouping construct. This has to handle embedded + * quoted strings ('', ``, "") and nested constructs. It also must handle + * reprompting the user, if necessary, after reading a newline, and returning + * correct error values if it reads EOF. + */ +#define P_FIRSTCLOSE 0x0001 +#define P_ALLOWESC 0x0002 +#define P_DQUOTE 0x0004 +#define P_COMMAND 0x0008 /* parsing a command, so look for comments */ +#define P_BACKQUOTE 0x0010 /* parsing a backquoted command substitution */ +#define P_ARRAYSUB 0x0020 /* parsing a [...] array subscript for assignment */ +#define P_DOLBRACE 0x0040 /* parsing a ${...} construct */ + +/* Lexical state while parsing a grouping construct or $(...). */ +#define LEX_WASDOL 0x001 +#define LEX_CKCOMMENT 0x002 +#define LEX_INCOMMENT 0x004 +#define LEX_PASSNEXT 0x008 +#define LEX_RESWDOK 0x010 +#define LEX_CKCASE 0x020 +#define LEX_INCASE 0x040 +#define LEX_INHEREDOC 0x080 +#define LEX_HEREDELIM 0x100 /* reading here-doc delimiter */ +#define LEX_STRIPDOC 0x200 /* <<- strip tabs from here doc delim */ +#define LEX_INWORD 0x400 + +#define COMSUB_META(ch) ((ch) == ';' || (ch) == '&' || (ch) == '|') + +#define CHECK_NESTRET_ERROR() \ + do { \ + if (nestret == &matched_pair_error) \ + { \ + free (ret); \ + return &matched_pair_error; \ + } \ + } while (0) + +#define APPEND_NESTRET() \ + do { \ + if (nestlen) \ + { \ + RESIZE_MALLOCED_BUFFER (ret, retind, nestlen, retsize, 64); \ + strcpy (ret + retind, nestret); \ + retind += nestlen; \ + } \ + } while (0) + +static char matched_pair_error; + +static char * +parse_matched_pair (qc, open, close, lenp, flags) + int qc; /* `"' if this construct is within double quotes */ + int open, close; + int *lenp, flags; +{ + int count, ch, tflags; + int nestlen, ttranslen, start_lineno; + char *ret, *nestret, *ttrans; + int retind, retsize, rflags; + int dolbrace_state; + + dolbrace_state = (flags & P_DOLBRACE) ? DOLBRACE_PARAM : 0; + +/*itrace("parse_matched_pair[%d]: open = %c close = %c flags = %d", line_number, open, close, flags);*/ + count = 1; + tflags = 0; + + if ((flags & P_COMMAND) && qc != '`' && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0) + tflags |= LEX_CKCOMMENT; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ + rflags = (qc == '"') ? P_DQUOTE : (flags & P_DQUOTE); + + ret = (char *)xmalloc (retsize = 64); + retind = 0; + + start_lineno = line_number; + while (count) + { + ch = shell_getc (qc != '\'' && (tflags & (LEX_PASSNEXT)) == 0); + + if (ch == EOF) + { + free (ret); + parser_error (start_lineno, _("unexpected EOF while looking for matching `%c'"), close); + EOF_Reached = 1; /* XXX */ + return (&matched_pair_error); + } + + /* Possible reprompting. */ + if (ch == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* Don't bother counting parens or doing anything else if in a comment + or part of a case statement */ + if (tflags & LEX_INCOMMENT) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + if (ch == '\n') + tflags &= ~LEX_INCOMMENT; + + continue; + } + + /* Not exactly right yet, should handle shell metacharacters, too. If + any changes are made to this test, make analogous changes to subst.c: + extract_delimited_string(). */ + else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || shellblank (ret[retind - 1]))) + tflags |= LEX_INCOMMENT; + + if (tflags & LEX_PASSNEXT) /* last char was backslash */ + { + tflags &= ~LEX_PASSNEXT; + if (qc != '\'' && ch == '\n') /* double-quoted \ disappears. */ + { + if (retind > 0) + retind--; /* swallow previously-added backslash */ + continue; + } + + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + if MBTEST(ch == CTLESC) + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + /* If we're reparsing the input (e.g., from parse_string_to_word_list), + we've already prepended CTLESC to single-quoted results of $'...'. + We may want to do this for other CTLESC-quoted characters in + reparse, too. */ + else if MBTEST((parser_state & PST_REPARSE) && open == '\'' && (ch == CTLESC || ch == CTLNUL)) + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + continue; + } + else if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + else if MBTEST(ch == close) /* ending delimiter */ + count--; + /* handle nested ${...} specially. */ + else if MBTEST(open != close && (tflags & LEX_WASDOL) && open == '{' && ch == open) /* } */ + count++; + else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && ch == open) /* nested begin */ + count++; + + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + /* If we just read the ending character, don't bother continuing. */ + if (count == 0) + break; + + if (open == '\'') /* '' inside grouping construct */ + { + if MBTEST((flags & P_ALLOWESC) && ch == '\\') + tflags |= LEX_PASSNEXT; + continue; + } + + if MBTEST(ch == '\\') /* backslashes */ + tflags |= LEX_PASSNEXT; + + /* Based on which dolstate is currently in (param, op, or word), + decide what the op is. We're really only concerned if it's % or + #, so we can turn on a flag that says whether or not we should + treat single quotes as special when inside a double-quoted + ${...}. This logic must agree with subst.c:extract_dollar_brace_string + since they share the same defines. */ + /* FLAG POSIX INTERP 221 */ + if (flags & P_DOLBRACE) + { + /* ${param%[%]word} */ + if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '%' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param#[#]word} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '#' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param/[/]pat/rep} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '/' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE2; /* XXX */ + /* ${param^[^]pat} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '^' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param,[,]pat} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == ',' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && strchr ("#%^,~:-=?+/", ch) != 0) + dolbrace_state = DOLBRACE_OP; + else if MBTEST(dolbrace_state == DOLBRACE_OP && strchr ("#%^,~:-=?+/", ch) == 0) + dolbrace_state = DOLBRACE_WORD; + } + + /* The big hammer. Single quotes aren't special in double quotes. The + problem is that Posix used to say the single quotes are semi-special: + within a double-quoted ${...} construct "an even number of + unescaped double-quotes or single-quotes, if any, shall occur." */ + /* This was changed in Austin Group Interp 221 */ + if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'') + continue; + + /* Could also check open == '`' if we want to parse grouping constructs + inside old-style command substitution. */ + if (open != close) /* a grouping construct */ + { + if MBTEST(shellquote (ch)) + { + /* '', ``, or "" inside $(...) or other grouping construct. */ + push_delimiter (dstack, ch); + if MBTEST((tflags & LEX_WASDOL) && ch == '\'') /* $'...' inside group */ + nestret = parse_matched_pair (ch, ch, ch, &nestlen, P_ALLOWESC|rflags); + else + nestret = parse_matched_pair (ch, ch, ch, &nestlen, rflags); + pop_delimiter (dstack); + CHECK_NESTRET_ERROR (); + + if MBTEST((tflags & LEX_WASDOL) && ch == '\'' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Translate $'...' here. */ + ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen); + xfree (nestret); + + /* If we're parsing a double-quoted brace expansion and we are + not in a place where single quotes are treated specially, + make sure we single-quote the results of the ansi + expansion because quote removal should remove them later */ + /* FLAG POSIX INTERP 221 */ + if ((shell_compatibility_level > 42) && (rflags & P_DQUOTE) && (dolbrace_state == DOLBRACE_QUOTE2) && (flags & P_DOLBRACE)) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else if ((rflags & P_DQUOTE) == 0) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else + { + nestret = ttrans; + nestlen = ttranslen; + } + retind -= 2; /* back up before the $' */ + } + else if MBTEST((tflags & LEX_WASDOL) && ch == '"' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Locale expand $"..." here. */ + ttrans = localeexpand (nestret, 0, nestlen - 1, start_lineno, &ttranslen); + xfree (nestret); + + nestret = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + nestlen = ttranslen + 2; + retind -= 2; /* back up before the $" */ + } + + APPEND_NESTRET (); + FREE (nestret); + } + else if ((flags & P_ARRAYSUB) && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + goto parse_dollar_word; + } + /* Parse an old-style command substitution within double quotes as a + single word. */ + /* XXX - sh and ksh93 don't do this - XXX */ + else if MBTEST(open == '"' && ch == '`') + { + nestret = parse_matched_pair (0, '`', '`', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + else if MBTEST(open != '`' && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + /* check for $(), $[], or ${} inside quoted string. */ + { +parse_dollar_word: + if (open == ch) /* undo previous increment */ + count--; + if (ch == '(') /* ) */ + nestret = parse_comsub (0, '(', ')', &nestlen, (rflags|P_COMMAND) & ~P_DQUOTE); + else if (ch == '{') /* } */ + nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|P_DOLBRACE|rflags); + else if (ch == '[') /* ] */ + nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + if MBTEST(ch == '$') + tflags |= LEX_WASDOL; + else + tflags &= ~LEX_WASDOL; + } + + ret[retind] = '\0'; + if (lenp) + *lenp = retind; +/*itrace("parse_matched_pair[%d]: returning %s", line_number, ret);*/ + return ret; +} + +/* Parse a $(...) command substitution. This is messier than I'd like, and + reproduces a lot more of the token-reading code than I'd like. */ +static char * +parse_comsub (qc, open, close, lenp, flags) + int qc; /* `"' if this construct is within double quotes */ + int open, close; + int *lenp, flags; +{ + int count, ch, peekc, tflags, lex_rwlen, lex_wlen, lex_firstind; + int nestlen, ttranslen, start_lineno; + char *ret, *nestret, *ttrans, *heredelim; + int retind, retsize, rflags, hdlen; + + /* Posix interp 217 says arithmetic expressions have precedence, so + assume $(( introduces arithmetic expansion and parse accordingly. */ + peekc = shell_getc (0); + shell_ungetc (peekc); + if (peekc == '(') + return (parse_matched_pair (qc, open, close, lenp, 0)); + +/*itrace("parse_comsub: qc = `%c' open = %c close = %c", qc, open, close);*/ + count = 1; + tflags = LEX_RESWDOK; + + if ((flags & P_COMMAND) && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0) + tflags |= LEX_CKCASE; + if ((tflags & LEX_CKCASE) && (interactive == 0 || interactive_comments)) + tflags |= LEX_CKCOMMENT; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ + rflags = (flags & P_DQUOTE); + + ret = (char *)xmalloc (retsize = 64); + retind = 0; + + start_lineno = line_number; + lex_rwlen = lex_wlen = 0; + + heredelim = 0; + lex_firstind = -1; + + while (count) + { +comsub_readchar: + ch = shell_getc (qc != '\'' && (tflags & (LEX_INCOMMENT|LEX_PASSNEXT)) == 0); + + if (ch == EOF) + { +eof_error: + free (ret); + FREE (heredelim); + parser_error (start_lineno, _("unexpected EOF while looking for matching `%c'"), close); + EOF_Reached = 1; /* XXX */ + return (&matched_pair_error); + } + + /* If we hit the end of a line and are reading the contents of a here + document, and it's not the same line that the document starts on, + check for this line being the here doc delimiter. Otherwise, if + we're in a here document, mark the next character as the beginning + of a line. */ + if (ch == '\n') + { + if ((tflags & LEX_HEREDELIM) && heredelim) + { + tflags &= ~LEX_HEREDELIM; + tflags |= LEX_INHEREDOC; + lex_firstind = retind + 1; + } + else if (tflags & LEX_INHEREDOC) + { + int tind; + tind = lex_firstind; + while ((tflags & LEX_STRIPDOC) && ret[tind] == '\t') + tind++; + if (STREQN (ret + tind, heredelim, hdlen)) + { + tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC); +/*itrace("parse_comsub:%d: found here doc end `%s'", line_number, ret + tind);*/ + free (heredelim); + heredelim = 0; + lex_firstind = -1; + } + else + lex_firstind = retind + 1; + } + } + + /* Possible reprompting. */ + if (ch == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* XXX -- possibly allow here doc to be delimited by ending right + paren. */ + if ((tflags & LEX_INHEREDOC) && ch == close && count == 1) + { + int tind; +/*itrace("parse_comsub: in here doc, ch == close, retind - firstind = %d hdlen = %d retind = %d", retind-lex_firstind, hdlen, retind);*/ + tind = lex_firstind; + while ((tflags & LEX_STRIPDOC) && ret[tind] == '\t') + tind++; + if (retind-tind == hdlen && STREQN (ret + tind, heredelim, hdlen)) + { + tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC); +/*itrace("parse_comsub:%d: found here doc end `%s'", line_number, ret + tind);*/ + free (heredelim); + heredelim = 0; + lex_firstind = -1; + } + } + + /* Don't bother counting parens or doing anything else if in a comment */ + if (tflags & (LEX_INCOMMENT|LEX_INHEREDOC)) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + if ((tflags & LEX_INCOMMENT) && ch == '\n') + { +/*itrace("parse_comsub:%d: lex_incomment -> 0 ch = `%c'", line_number, ch);*/ + tflags &= ~LEX_INCOMMENT; + } + + continue; + } + + if (tflags & LEX_PASSNEXT) /* last char was backslash */ + { +/*itrace("parse_comsub:%d: lex_passnext -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + tflags &= ~LEX_PASSNEXT; + if (qc != '\'' && ch == '\n') /* double-quoted \ disappears. */ + { + if (retind > 0) + retind--; /* swallow previously-added backslash */ + continue; + } + + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + if MBTEST(ch == CTLESC) + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + + /* If this is a shell break character, we are not in a word. If not, + we either start or continue a word. */ + if MBTEST(shellbreak (ch)) + { + tflags &= ~LEX_INWORD; +/*itrace("parse_comsub:%d: lex_inword -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + } + else + { + if (tflags & LEX_INWORD) + { + lex_wlen++; +/*itrace("parse_comsub:%d: lex_inword == 1 ch = `%c' lex_wlen = %d (%d)", line_number, ch, lex_wlen, __LINE__);*/ + } + else + { +/*itrace("parse_comsub:%d: lex_inword -> 1 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + tflags |= LEX_INWORD; + lex_wlen = 0; + } + } + + /* Skip whitespace */ + if MBTEST(shellblank (ch) && (tflags & LEX_HEREDELIM) == 0 && lex_rwlen == 0) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + continue; + } + + /* Either we are looking for the start of the here-doc delimiter + (lex_firstind == -1) or we are reading one (lex_firstind >= 0). + If this character is a shell break character and we are reading + the delimiter, save it and note that we are now reading a here + document. If we've found the start of the delimiter, note it by + setting lex_firstind. Backslashes can quote shell metacharacters + in here-doc delimiters. */ + if (tflags & LEX_HEREDELIM) + { + if (lex_firstind == -1 && shellbreak (ch) == 0) + lex_firstind = retind; +#if 0 + else if (heredelim && (tflags & LEX_PASSNEXT) == 0 && ch == '\n') + { + tflags |= LEX_INHEREDOC; + tflags &= ~LEX_HEREDELIM; + lex_firstind = retind + 1; + } +#endif + else if (lex_firstind >= 0 && (tflags & LEX_PASSNEXT) == 0 && shellbreak (ch)) + { + if (heredelim == 0) + { + nestret = substring (ret, lex_firstind, retind); + heredelim = string_quote_removal (nestret, 0); + free (nestret); + hdlen = STRLEN(heredelim); +/*itrace("parse_comsub:%d: found here doc delimiter `%s' (%d)", line_number, heredelim, hdlen);*/ + } + if (ch == '\n') + { + tflags |= LEX_INHEREDOC; + tflags &= ~LEX_HEREDELIM; + lex_firstind = retind + 1; + } + else + lex_firstind = -1; + } + } + + /* Meta-characters that can introduce a reserved word. Not perfect yet. */ + if MBTEST((tflags & LEX_RESWDOK) == 0 && (tflags & LEX_CKCASE) && (tflags & LEX_INCOMMENT) == 0 && (shellmeta(ch) || ch == '\n')) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + peekc = shell_getc (1); + if (ch == peekc && (ch == '&' || ch == '|' || ch == ';')) /* two-character tokens */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; +/*itrace("parse_comsub:%d: set lex_reswordok = 1, ch = `%c'", line_number, ch);*/ + tflags |= LEX_RESWDOK; + lex_rwlen = 0; + continue; + } + else if (ch == '\n' || COMSUB_META(ch)) + { + shell_ungetc (peekc); +/*itrace("parse_comsub:%d: set lex_reswordok = 1, ch = `%c'", line_number, ch);*/ + tflags |= LEX_RESWDOK; + lex_rwlen = 0; + continue; + } + else if (ch == EOF) + goto eof_error; + else + { + /* `unget' the character we just added and fall through */ + retind--; + shell_ungetc (peekc); + } + } + + /* If we can read a reserved word, try to read one. */ + if (tflags & LEX_RESWDOK) + { + if MBTEST(islower (ch)) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + lex_rwlen++; + continue; + } + else if MBTEST(lex_rwlen == 4 && shellbreak (ch)) + { + if (STREQN (ret + retind - 4, "case", 4)) + { + tflags |= LEX_INCASE; +/*itrace("parse_comsub:%d: found `case', lex_incase -> 1 lex_reswdok -> 0", line_number);*/ + } + else if (STREQN (ret + retind - 4, "esac", 4)) + { + tflags &= ~LEX_INCASE; +/*itrace("parse_comsub:%d: found `esac', lex_incase -> 0 lex_reswdok -> 0", line_number);*/ + } + tflags &= ~LEX_RESWDOK; + } + else if MBTEST((tflags & LEX_CKCOMMENT) && ch == '#' && (lex_rwlen == 0 || ((tflags & LEX_INWORD) && lex_wlen == 0))) + ; /* don't modify LEX_RESWDOK if we're starting a comment */ + /* Allow `do' followed by space, tab, or newline to preserve the + RESWDOK flag, but reset the reserved word length counter so we + can read another one. */ + else if MBTEST(((tflags & LEX_INCASE) == 0) && + (isblank(ch) || ch == '\n') && + lex_rwlen == 2 && + STREQN (ret + retind - 2, "do", 2)) + { +/*itrace("parse_comsub:%d: lex_incase == 1 found `%c', found \"do\"", line_number, ch);*/ + lex_rwlen = 0; + } + else if MBTEST((tflags & LEX_INCASE) && ch != '\n') + /* If we can read a reserved word and we're in case, we're at the + point where we can read a new pattern list or an esac. We + handle the esac case above. If we read a newline, we want to + leave LEX_RESWDOK alone. If we read anything else, we want to + turn off LEX_RESWDOK, since we're going to read a pattern list. */ + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: lex_incase == 1 found `%c', lex_reswordok -> 0", line_number, ch);*/ + } + else if MBTEST(shellbreak (ch) == 0) + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/ + } +#if 0 + /* If we find a space or tab but have read something and it's not + `do', turn off the reserved-word-ok flag */ + else if MBTEST(isblank (ch) && lex_rwlen > 0) + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/ + } +#endif + } + + /* Might be the start of a here-doc delimiter */ + if MBTEST((tflags & LEX_INCOMMENT) == 0 && (tflags & LEX_CKCASE) && ch == '<') + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + peekc = shell_getc (1); + if (peekc == EOF) + goto eof_error; + if (peekc == ch) + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; + peekc = shell_getc (1); + if (peekc == EOF) + goto eof_error; + if (peekc == '-') + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; + tflags |= LEX_STRIPDOC; + } + else + shell_ungetc (peekc); + if (peekc != '<') + { + tflags |= LEX_HEREDELIM; + lex_firstind = -1; + } + continue; + } + else + ch = peekc; /* fall through and continue XXX */ + } + else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (((tflags & LEX_RESWDOK) && lex_rwlen == 0) || ((tflags & LEX_INWORD) && lex_wlen == 0))) + { +/*itrace("parse_comsub:%d: lex_incomment -> 1 (%d)", line_number, __LINE__);*/ + tflags |= LEX_INCOMMENT; + } + + if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } +#if 0 + else if MBTEST((tflags & LEX_INCASE) && ch == close && close == ')') + tflags &= ~LEX_INCASE; /* XXX */ +#endif + else if MBTEST(ch == close && (tflags & LEX_INCASE) == 0) /* ending delimiter */ + { + count--; +/*itrace("parse_comsub:%d: found close: count = %d", line_number, count);*/ + } + else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && (tflags & LEX_INCASE) == 0 && ch == open) /* nested begin */ + { + count++; +/*itrace("parse_comsub:%d: found open: count = %d", line_number, count);*/ + } + + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + /* If we just read the ending character, don't bother continuing. */ + if (count == 0) + break; + + if MBTEST(ch == '\\') /* backslashes */ + tflags |= LEX_PASSNEXT; + + if MBTEST(shellquote (ch)) + { + /* '', ``, or "" inside $(...). */ + push_delimiter (dstack, ch); + if MBTEST((tflags & LEX_WASDOL) && ch == '\'') /* $'...' inside group */ + nestret = parse_matched_pair (ch, ch, ch, &nestlen, P_ALLOWESC|rflags); + else + nestret = parse_matched_pair (ch, ch, ch, &nestlen, rflags); + pop_delimiter (dstack); + CHECK_NESTRET_ERROR (); + + if MBTEST((tflags & LEX_WASDOL) && ch == '\'' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Translate $'...' here. */ + ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen); + xfree (nestret); + + if ((rflags & P_DQUOTE) == 0) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else + { + nestret = ttrans; + nestlen = ttranslen; + } + retind -= 2; /* back up before the $' */ + } + else if MBTEST((tflags & LEX_WASDOL) && ch == '"' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Locale expand $"..." here. */ + ttrans = localeexpand (nestret, 0, nestlen - 1, start_lineno, &ttranslen); + xfree (nestret); + + nestret = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + nestlen = ttranslen + 2; + retind -= 2; /* back up before the $" */ + } + + APPEND_NESTRET (); + FREE (nestret); + } + else if MBTEST((tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + /* check for $(), $[], or ${} inside command substitution. */ + { + if ((tflags & LEX_INCASE) == 0 && open == ch) /* undo previous increment */ + count--; + if (ch == '(') /* ) */ + nestret = parse_comsub (0, '(', ')', &nestlen, (rflags|P_COMMAND) & ~P_DQUOTE); + else if (ch == '{') /* } */ + nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|P_DOLBRACE|rflags); + else if (ch == '[') /* ] */ + nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + if MBTEST(ch == '$') + tflags |= LEX_WASDOL; + else + tflags &= ~LEX_WASDOL; + } + + FREE (heredelim); + ret[retind] = '\0'; + if (lenp) + *lenp = retind; +/*itrace("parse_comsub:%d: returning `%s'", line_number, ret);*/ + return ret; +} + +/* Recursively call the parser to parse a $(...) command substitution. */ +char * +xparse_dolparen (base, string, indp, flags) + char *base; + char *string; + int *indp; + int flags; +{ + sh_parser_state_t ps; + sh_input_line_state_t ls; + int orig_ind, nc, sflags, orig_eof_token; + char *ret, *s, *ep, *ostring; + + /*yydebug = 1;*/ + orig_ind = *indp; + ostring = string; + +/*itrace("xparse_dolparen: size = %d shell_input_line = `%s'", shell_input_line_size, shell_input_line);*/ + sflags = SEVAL_NONINT|SEVAL_NOHIST|SEVAL_NOFREE; + if (flags & SX_NOLONGJMP) + sflags |= SEVAL_NOLONGJMP; + save_parser_state (&ps); + save_input_line_state (&ls); + orig_eof_token = shell_eof_token; + + /*(*/ + parser_state |= PST_CMDSUBST|PST_EOFTOKEN; /* allow instant ')' */ /*(*/ + shell_eof_token = ')'; + parse_string (string, "command substitution", sflags, &ep); + + shell_eof_token = orig_eof_token; + restore_parser_state (&ps); + reset_parser (); + /* reset_parser clears shell_input_line and associated variables */ + restore_input_line_state (&ls); + if (interactive) + token_to_read = 0; + + /* Need to find how many characters parse_and_execute consumed, update + *indp, if flags != 0, copy the portion of the string parsed into RET + and return it. If flags & 1 (EX_NOALLOC) we can return NULL. */ + + /*(*/ + if (ep[-1] != ')') + { +#if DEBUG + if (ep[-1] != '\n') + itrace("xparse_dolparen:%d: ep[-1] != RPAREN (%d), ep = `%s'", line_number, ep[-1], ep); +#endif + while (ep > ostring && ep[-1] == '\n') ep--; + } + + nc = ep - ostring; + *indp = ep - base - 1; + + /*(*/ +#if DEBUG + if (base[*indp] != ')') + itrace("xparse_dolparen:%d: base[%d] != RPAREN (%d), base = `%s'", line_number, *indp, base[*indp], base); +#endif + + if (flags & SX_NOALLOC) + return (char *)NULL; + + if (nc == 0) + { + ret = xmalloc (1); + ret[0] = '\0'; + } + else + ret = substring (ostring, 0, nc - 1); + + return ret; +} + +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) +/* Parse a double-paren construct. It can be either an arithmetic + command, an arithmetic `for' command, or a nested subshell. Returns + the parsed token, -1 on error, or -2 if we didn't do anything and + should just go on. */ +static int +parse_dparen (c) + int c; +{ + int cmdtyp, sline; + char *wval; + WORD_DESC *wd; + +#if defined (ARITH_FOR_COMMAND) + if (last_read_token == FOR) + { + arith_for_lineno = line_number; + cmdtyp = parse_arith_cmd (&wval, 0); + if (cmdtyp == 1) + { + wd = alloc_word_desc (); + wd->word = wval; + yylval.word_list = make_word_list (wd, (WORD_LIST *)NULL); + return (ARITH_FOR_EXPRS); + } + else + return -1; /* ERROR */ + } +#endif + +#if defined (DPAREN_ARITHMETIC) + if (reserved_word_acceptable (last_read_token)) + { + sline = line_number; + + cmdtyp = parse_arith_cmd (&wval, 0); + if (cmdtyp == 1) /* arithmetic command */ + { + wd = alloc_word_desc (); + wd->word = wval; + wd->flags = W_QUOTED|W_NOSPLIT|W_NOGLOB|W_DQUOTE; + yylval.word_list = make_word_list (wd, (WORD_LIST *)NULL); + return (ARITH_CMD); + } + else if (cmdtyp == 0) /* nested subshell */ + { + push_string (wval, 0, (alias_t *)NULL); + pushed_string_list->flags = PSH_DPAREN; + if ((parser_state & PST_CASEPAT) == 0) + parser_state |= PST_SUBSHELL; + return (c); + } + else /* ERROR */ + return -1; + } +#endif + + return -2; /* XXX */ +} + +/* We've seen a `(('. Look for the matching `))'. If we get it, return 1. + If not, assume it's a nested subshell for backwards compatibility and + return 0. In any case, put the characters we've consumed into a locally- + allocated buffer and make *ep point to that buffer. Return -1 on an + error, for example EOF. */ +static int +parse_arith_cmd (ep, adddq) + char **ep; + int adddq; +{ + int exp_lineno, rval, c; + char *ttok, *tokstr; + int ttoklen; + + exp_lineno = line_number; + ttok = parse_matched_pair (0, '(', ')', &ttoklen, 0); + rval = 1; + if (ttok == &matched_pair_error) + return -1; + /* Check that the next character is the closing right paren. If + not, this is a syntax error. ( */ + c = shell_getc (0); + if MBTEST(c != ')') + rval = 0; + + tokstr = (char *)xmalloc (ttoklen + 4); + + /* if ADDDQ != 0 then (( ... )) -> "..." */ + if (rval == 1 && adddq) /* arith cmd, add double quotes */ + { + tokstr[0] = '"'; + strncpy (tokstr + 1, ttok, ttoklen - 1); + tokstr[ttoklen] = '"'; + tokstr[ttoklen+1] = '\0'; + } + else if (rval == 1) /* arith cmd, don't add double quotes */ + { + strncpy (tokstr, ttok, ttoklen - 1); + tokstr[ttoklen-1] = '\0'; + } + else /* nested subshell */ + { + tokstr[0] = '('; + strncpy (tokstr + 1, ttok, ttoklen - 1); + tokstr[ttoklen] = ')'; + tokstr[ttoklen+1] = c; + tokstr[ttoklen+2] = '\0'; + } + + *ep = tokstr; + FREE (ttok); + return rval; +} +#endif /* DPAREN_ARITHMETIC || ARITH_FOR_COMMAND */ + +#if defined (COND_COMMAND) +static void +cond_error () +{ + char *etext; + + if (EOF_Reached && cond_token != COND_ERROR) /* [[ */ + parser_error (cond_lineno, _("unexpected EOF while looking for `]]'")); + else if (cond_token != COND_ERROR) + { + if (etext = error_token_from_token (cond_token)) + { + parser_error (cond_lineno, _("syntax error in conditional expression: unexpected token `%s'"), etext); + free (etext); + } + else + parser_error (cond_lineno, _("syntax error in conditional expression")); + } +} + +static COND_COM * +cond_expr () +{ + return (cond_or ()); +} + +static COND_COM * +cond_or () +{ + COND_COM *l, *r; + + l = cond_and (); + if (cond_token == OR_OR) + { + r = cond_or (); + l = make_cond_node (COND_OR, (WORD_DESC *)NULL, l, r); + } + return l; +} + +static COND_COM * +cond_and () +{ + COND_COM *l, *r; + + l = cond_term (); + if (cond_token == AND_AND) + { + r = cond_and (); + l = make_cond_node (COND_AND, (WORD_DESC *)NULL, l, r); + } + return l; +} + +static int +cond_skip_newlines () +{ + while ((cond_token = read_token (READ)) == '\n') + { + if (SHOULD_PROMPT ()) + prompt_again (); + } + return (cond_token); +} + +#define COND_RETURN_ERROR() \ + do { cond_token = COND_ERROR; return ((COND_COM *)NULL); } while (0) + +static COND_COM * +cond_term () +{ + WORD_DESC *op; + COND_COM *term, *tleft, *tright; + int tok, lineno; + char *etext; + + /* Read a token. It can be a left paren, a `!', a unary operator, or a + word that should be the first argument of a binary operator. Start by + skipping newlines, since this is a compound command. */ + tok = cond_skip_newlines (); + lineno = line_number; + if (tok == COND_END) + { + COND_RETURN_ERROR (); + } + else if (tok == '(') + { + term = cond_expr (); + if (cond_token != ')') + { + if (term) + dispose_cond_node (term); /* ( */ + if (etext = error_token_from_token (cond_token)) + { + parser_error (lineno, _("unexpected token `%s', expected `)'"), etext); + free (etext); + } + else + parser_error (lineno, _("expected `)'")); + COND_RETURN_ERROR (); + } + term = make_cond_node (COND_EXPR, (WORD_DESC *)NULL, term, (COND_COM *)NULL); + (void)cond_skip_newlines (); + } + else if (tok == BANG || (tok == WORD && (yylval.word->word[0] == '!' && yylval.word->word[1] == '\0'))) + { + if (tok == WORD) + dispose_word (yylval.word); /* not needed */ + term = cond_term (); + if (term) + term->flags |= CMD_INVERT_RETURN; + } + else if (tok == WORD && yylval.word->word[0] == '-' && yylval.word->word[2] == 0 && test_unop (yylval.word->word)) + { + op = yylval.word; + tok = read_token (READ); + if (tok == WORD) + { + tleft = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + term = make_cond_node (COND_UNARY, op, tleft, (COND_COM *)NULL); + } + else + { + dispose_word (op); + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected argument `%s' to conditional unary operator"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected argument to conditional unary operator")); + COND_RETURN_ERROR (); + } + + (void)cond_skip_newlines (); + } + else if (tok == WORD) /* left argument to binary operator */ + { + /* lhs */ + tleft = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + + /* binop */ + tok = read_token (READ); + if (tok == WORD && test_binop (yylval.word->word)) + { + op = yylval.word; + if (op->word[0] == '=' && (op->word[1] == '\0' || (op->word[1] == '=' && op->word[2] == '\0'))) + parser_state |= PST_EXTPAT; + else if (op->word[0] == '!' && op->word[1] == '=' && op->word[2] == '\0') + parser_state |= PST_EXTPAT; + } +#if defined (COND_REGEXP) + else if (tok == WORD && STREQ (yylval.word->word, "=~")) + { + op = yylval.word; + parser_state |= PST_REGEXP; + } +#endif + else if (tok == '<' || tok == '>') + op = make_word_from_token (tok); /* ( */ + /* There should be a check before blindly accepting the `)' that we have + seen the opening `('. */ + else if (tok == COND_END || tok == AND_AND || tok == OR_OR || tok == ')') + { + /* Special case. [[ x ]] is equivalent to [[ -n x ]], just like + the test command. Similarly for [[ x && expr ]] or + [[ x || expr ]] or [[ (x) ]]. */ + op = make_word ("-n"); + term = make_cond_node (COND_UNARY, op, tleft, (COND_COM *)NULL); + cond_token = tok; + return (term); + } + else + { + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected token `%s', conditional binary operator expected"), etext); + free (etext); + } + else + parser_error (line_number, _("conditional binary operator expected")); + dispose_cond_node (tleft); + COND_RETURN_ERROR (); + } + + /* rhs */ + if (parser_state & PST_EXTPAT) + extended_glob = 1; + tok = read_token (READ); + if (parser_state & PST_EXTPAT) + extended_glob = global_extglob; + parser_state &= ~(PST_REGEXP|PST_EXTPAT); + + if (tok == WORD) + { + tright = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + term = make_cond_node (COND_BINARY, op, tleft, tright); + } + else + { + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected argument `%s' to conditional binary operator"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected argument to conditional binary operator")); + dispose_cond_node (tleft); + dispose_word (op); + COND_RETURN_ERROR (); + } + + (void)cond_skip_newlines (); + } + else + { + if (tok < 256) + parser_error (line_number, _("unexpected token `%c' in conditional command"), tok); + else if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected token `%s' in conditional command"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected token %d in conditional command"), tok); + COND_RETURN_ERROR (); + } + return (term); +} + +/* This is kind of bogus -- we slip a mini recursive-descent parser in + here to handle the conditional statement syntax. */ +static COMMAND * +parse_cond_command () +{ + COND_COM *cexp; + + global_extglob = extended_glob; + cexp = cond_expr (); + return (make_cond_command (cexp)); +} +#endif + +#if defined (ARRAY_VARS) +/* When this is called, it's guaranteed that we don't care about anything + in t beyond i. We do save and restore the chars, though. */ +static int +token_is_assignment (t, i) + char *t; + int i; +{ + unsigned char c, c1; + int r; + + c = t[i]; c1 = t[i+1]; + t[i] = '='; t[i+1] = '\0'; + r = assignment (t, (parser_state & PST_COMPASSIGN) != 0); + t[i] = c; t[i+1] = c1; + return r; +} + +/* XXX - possible changes here for `+=' */ +static int +token_is_ident (t, i) + char *t; + int i; +{ + unsigned char c; + int r; + + c = t[i]; + t[i] = '\0'; + r = legal_identifier (t); + t[i] = c; + return r; +} +#endif + +static int +read_token_word (character) + int character; +{ + /* The value for YYLVAL when a WORD is read. */ + WORD_DESC *the_word; + + /* Index into the token that we are building. */ + int token_index; + + /* ALL_DIGITS becomes zero when we see a non-digit. */ + int all_digit_token; + + /* DOLLAR_PRESENT becomes non-zero if we see a `$'. */ + int dollar_present; + + /* COMPOUND_ASSIGNMENT becomes non-zero if we are parsing a compound + assignment. */ + int compound_assignment; + + /* QUOTED becomes non-zero if we see one of ("), ('), (`), or (\). */ + int quoted; + + /* Non-zero means to ignore the value of the next character, and just + to add it no matter what. */ + int pass_next_character; + + /* The current delimiting character. */ + int cd; + int result, peek_char; + char *ttok, *ttrans; + int ttoklen, ttranslen; + intmax_t lvalue; + + if (token_buffer_size < TOKEN_DEFAULT_INITIAL_SIZE) + token = (char *)xrealloc (token, token_buffer_size = TOKEN_DEFAULT_INITIAL_SIZE); + + token_index = 0; + all_digit_token = DIGIT (character); + dollar_present = quoted = pass_next_character = compound_assignment = 0; + + for (;;) + { + if (character == EOF) + goto got_token; + + if (pass_next_character) + { + pass_next_character = 0; + goto got_escaped_character; + } + + cd = current_delimiter (dstack); + + /* Handle backslashes. Quote lots of things when not inside of + double-quotes, quote some things inside of double-quotes. */ + if MBTEST(character == '\\') + { + peek_char = shell_getc (0); + + /* Backslash-newline is ignored in all cases except + when quoted with single quotes. */ + if (peek_char == '\n') + { + character = '\n'; + goto next_character; + } + else + { + shell_ungetc (peek_char); + + /* If the next character is to be quoted, note it now. */ + if (cd == 0 || cd == '`' || + (cd == '"' && peek_char >= 0 && (sh_syntaxtab[peek_char] & CBSDQUOTE))) + pass_next_character++; + + quoted = 1; + goto got_character; + } + } + + /* Parse a matched pair of quote characters. */ + if MBTEST(shellquote (character)) + { + push_delimiter (dstack, character); + ttok = parse_matched_pair (character, character, character, &ttoklen, (character == '`') ? P_COMMAND : 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + all_digit_token = 0; + quoted = 1; + dollar_present |= (character == '"' && strchr (ttok, '$') != 0); + FREE (ttok); + goto next_character; + } + +#ifdef COND_REGEXP + /* When parsing a regexp as a single word inside a conditional command, + we need to special-case characters special to both the shell and + regular expressions. Right now, that is only '(' and '|'. */ /*)*/ + if MBTEST((parser_state & PST_REGEXP) && (character == '(' || character == '|')) /*)*/ + { + if (character == '|') + goto got_character; + + push_delimiter (dstack, character); + ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = all_digit_token = 0; + goto next_character; + } +#endif /* COND_REGEXP */ + +#ifdef EXTENDED_GLOB + /* Parse a ksh-style extended pattern matching specification. */ + if MBTEST(extended_glob && PATTERN_CHAR (character)) + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '(') /* ) */ + { + push_delimiter (dstack, peek_char); + ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + token[token_index++] = peek_char; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = all_digit_token = 0; + goto next_character; + } + else + shell_ungetc (peek_char); + } +#endif /* EXTENDED_GLOB */ + + /* If the delimiter character is not single quote, parse some of + the shell expansions that must be read as a single word. */ + if (shellexp (character)) + { + peek_char = shell_getc (1); + /* $(...), <(...), >(...), $((...)), ${...}, and $[...] constructs */ + if MBTEST(peek_char == '(' || + ((peek_char == '{' || peek_char == '[') && character == '$')) /* ) ] } */ + { + if (peek_char == '{') /* } */ + ttok = parse_matched_pair (cd, '{', '}', &ttoklen, P_FIRSTCLOSE|P_DOLBRACE); + else if (peek_char == '(') /* ) */ + { + /* XXX - push and pop the `(' as a delimiter for use by + the command-oriented-history code. This way newlines + appearing in the $(...) string get added to the + history literally rather than causing a possibly- + incorrect `;' to be added. ) */ + push_delimiter (dstack, peek_char); + ttok = parse_comsub (cd, '(', ')', &ttoklen, P_COMMAND); + pop_delimiter (dstack); + } + else + ttok = parse_matched_pair (cd, '[', ']', &ttoklen, 0); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + token[token_index++] = peek_char; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = 1; + all_digit_token = 0; + goto next_character; + } + /* This handles $'...' and $"..." new-style quoted strings. */ + else if MBTEST(character == '$' && (peek_char == '\'' || peek_char == '"')) + { + int first_line; + + first_line = line_number; + push_delimiter (dstack, peek_char); + ttok = parse_matched_pair (peek_char, peek_char, peek_char, + &ttoklen, + (peek_char == '\'') ? P_ALLOWESC : 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; + if (peek_char == '\'') + { + ttrans = ansiexpand (ttok, 0, ttoklen - 1, &ttranslen); + free (ttok); + + /* Insert the single quotes and correctly quote any + embedded single quotes (allowed because P_ALLOWESC was + passed to parse_matched_pair). */ + ttok = sh_single_quote (ttrans); + free (ttrans); + ttranslen = strlen (ttok); + ttrans = ttok; + } + else + { + /* Try to locale-expand the converted string. */ + ttrans = localeexpand (ttok, 0, ttoklen - 1, first_line, &ttranslen); + free (ttok); + + /* Add the double quotes back */ + ttok = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + ttranslen += 2; + ttrans = ttok; + } + + RESIZE_MALLOCED_BUFFER (token, token_index, ttranslen + 1, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + strcpy (token + token_index, ttrans); + token_index += ttranslen; + FREE (ttrans); + quoted = 1; + all_digit_token = 0; + goto next_character; + } + /* This could eventually be extended to recognize all of the + shell's single-character parameter expansions, and set flags.*/ + else if MBTEST(character == '$' && peek_char == '$') + { + RESIZE_MALLOCED_BUFFER (token, token_index, 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = '$'; + token[token_index++] = peek_char; + dollar_present = 1; + all_digit_token = 0; + goto next_character; + } + else + shell_ungetc (peek_char); + } + +#if defined (ARRAY_VARS) + /* Identify possible array subscript assignment; match [...]. If + parser_state&PST_COMPASSIGN, we need to parse [sub]=words treating + `sub' as if it were enclosed in double quotes. */ + else if MBTEST(character == '[' && /* ] */ + ((token_index > 0 && assignment_acceptable (last_read_token) && token_is_ident (token, token_index)) || + (token_index == 0 && (parser_state&PST_COMPASSIGN)))) + { + ttok = parse_matched_pair (cd, '[', ']', &ttoklen, P_ARRAYSUB); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + all_digit_token = 0; + goto next_character; + } + /* Identify possible compound array variable assignment. */ + else if MBTEST(character == '=' && token_index > 0 && (assignment_acceptable (last_read_token) || (parser_state & PST_ASSIGNOK)) && token_is_assignment (token, token_index)) + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '(') /* ) */ + { + ttok = parse_compound_assignment (&ttoklen); + + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 4, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + + token[token_index++] = '='; + token[token_index++] = '('; + if (ttok) + { + strcpy (token + token_index, ttok); + token_index += ttoklen; + } + token[token_index++] = ')'; + FREE (ttok); + all_digit_token = 0; + compound_assignment = 1; +#if 1 + goto next_character; +#else + goto got_token; /* ksh93 seems to do this */ +#endif + } + else + shell_ungetc (peek_char); + } +#endif + + /* When not parsing a multi-character word construct, shell meta- + characters break words. */ + if MBTEST(shellbreak (character)) + { + shell_ungetc (character); + goto got_token; + } + +got_character: + + if (character == CTLESC || character == CTLNUL) + { + RESIZE_MALLOCED_BUFFER (token, token_index, 2, token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = CTLESC; + } + else +got_escaped_character: + RESIZE_MALLOCED_BUFFER (token, token_index, 1, token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + + token[token_index++] = character; + + all_digit_token &= DIGIT (character); + dollar_present |= character == '$'; + + next_character: + if (character == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* We want to remove quoted newlines (that is, a \ pair) + unless we are within single quotes or pass_next_character is + set (the shell equivalent of literal-next). */ + cd = current_delimiter (dstack); + character = shell_getc (cd != '\'' && pass_next_character == 0); + } /* end for (;;) */ + +got_token: + + /* Calls to RESIZE_MALLOCED_BUFFER ensure there is sufficient room. */ + token[token_index] = '\0'; + + /* Check to see what thing we should return. If the last_read_token + is a `<', or a `&', or the character which ended this token is + a '>' or '<', then, and ONLY then, is this input token a NUMBER. + Otherwise, it is just a word, and should be returned as such. */ + if MBTEST(all_digit_token && (character == '<' || character == '>' || + last_read_token == LESS_AND || + last_read_token == GREATER_AND)) + { + if (legal_number (token, &lvalue) && (int)lvalue == lvalue) + { + yylval.number = lvalue; + return (NUMBER); + } + } + + /* Check for special case tokens. */ + result = (last_shell_getc_is_singlebyte) ? special_case_tokens (token) : -1; + if (result >= 0) + return result; + +#if defined (ALIAS) + /* Posix.2 does not allow reserved words to be aliased, so check for all + of them, including special cases, before expanding the current token + as an alias. */ + if MBTEST(posixly_correct) + CHECK_FOR_RESERVED_WORD (token); + + /* Aliases are expanded iff EXPAND_ALIASES is non-zero, and quoting + inhibits alias expansion. */ + if (expand_aliases && quoted == 0) + { + result = alias_expand_token (token); + if (result == RE_READ_TOKEN) + return (RE_READ_TOKEN); + else if (result == NO_EXPANSION) + parser_state &= ~PST_ALEXPNEXT; + } + + /* If not in Posix.2 mode, check for reserved words after alias + expansion. */ + if MBTEST(posixly_correct == 0) +#endif + CHECK_FOR_RESERVED_WORD (token); + + the_word = (WORD_DESC *)xmalloc (sizeof (WORD_DESC)); + the_word->word = (char *)xmalloc (1 + token_index); + the_word->flags = 0; + strcpy (the_word->word, token); + if (dollar_present) + the_word->flags |= W_HASDOLLAR; + if (quoted) + the_word->flags |= W_QUOTED; /*(*/ + if (compound_assignment && token[token_index-1] == ')') + the_word->flags |= W_COMPASSIGN; + /* A word is an assignment if it appears at the beginning of a + simple command, or after another assignment word. This is + context-dependent, so it cannot be handled in the grammar. */ + if (assignment (token, (parser_state & PST_COMPASSIGN) != 0)) + { + the_word->flags |= W_ASSIGNMENT; + /* Don't perform word splitting on assignment statements. */ + if (assignment_acceptable (last_read_token) || (parser_state & PST_COMPASSIGN) != 0) + { + the_word->flags |= W_NOSPLIT; + if (parser_state & PST_COMPASSIGN) + the_word->flags |= W_NOGLOB; /* XXX - W_NOBRACE? */ + } + } + + if (command_token_position (last_read_token)) + { + struct builtin *b; + b = builtin_address_internal (token, 0); + if (b && (b->flags & ASSIGNMENT_BUILTIN)) + parser_state |= PST_ASSIGNOK; + else if (STREQ (token, "eval") || STREQ (token, "let")) + parser_state |= PST_ASSIGNOK; + } + + yylval.word = the_word; + + if (token[0] == '{' && token[token_index-1] == '}' && + (character == '<' || character == '>')) + { + /* can use token; already copied to the_word */ + token[token_index-1] = '\0'; +#if defined (ARRAY_VARS) + if (legal_identifier (token+1) || valid_array_reference (token+1)) +#else + if (legal_identifier (token+1)) +#endif + { + strcpy (the_word->word, token+1); +/*itrace("read_token_word: returning REDIR_WORD for %s", the_word->word);*/ + return (REDIR_WORD); + } + } + + result = ((the_word->flags & (W_ASSIGNMENT|W_NOSPLIT)) == (W_ASSIGNMENT|W_NOSPLIT)) + ? ASSIGNMENT_WORD : WORD; + + switch (last_read_token) + { + case FUNCTION: + parser_state |= PST_ALLOWOPNBRC; + function_dstart = line_number; + break; + case CASE: + case SELECT: + case FOR: + if (word_top < MAX_CASE_NEST) + word_top++; + word_lineno[word_top] = line_number; + break; + } + + return (result); +} + +/* Return 1 if TOKSYM is a token that after being read would allow + a reserved word to be seen, else 0. */ +static int +reserved_word_acceptable (toksym) + int toksym; +{ + switch (toksym) + { + case '\n': + case ';': + case '(': + case ')': + case '|': + case '&': + case '{': + case '}': /* XXX */ + case AND_AND: + case BANG: + case BAR_AND: + case DO: + case DONE: + case ELIF: + case ELSE: + case ESAC: + case FI: + case IF: + case OR_OR: + case SEMI_SEMI: + case SEMI_AND: + case SEMI_SEMI_AND: + case THEN: + case TIME: + case TIMEOPT: + case TIMEIGN: + case COPROC: + case UNTIL: + case WHILE: + case 0: + return 1; + default: +#if defined (COPROCESS_SUPPORT) + if (last_read_token == WORD && token_before_that == COPROC) + return 1; +#endif + if (last_read_token == WORD && token_before_that == FUNCTION) + return 1; + return 0; + } +} + +/* Return the index of TOKEN in the alist of reserved words, or -1 if + TOKEN is not a shell reserved word. */ +int +find_reserved_word (tokstr) + char *tokstr; +{ + int i; + for (i = 0; word_token_alist[i].word; i++) + if (STREQ (tokstr, word_token_alist[i].word)) + return i; + return -1; +} + +/* An interface to let the rest of the shell (primarily the completion + system) know what the parser is expecting. */ +int +parser_in_command_position () +{ + return (command_token_position (last_read_token)); +} + +#if 0 +#if defined (READLINE) +/* Called after each time readline is called. This insures that whatever + the new prompt string is gets propagated to readline's local prompt + variable. */ +static void +reset_readline_prompt () +{ + char *temp_prompt; + + if (prompt_string_pointer) + { + temp_prompt = (*prompt_string_pointer) + ? decode_prompt_string (*prompt_string_pointer) + : (char *)NULL; + + if (temp_prompt == 0) + { + temp_prompt = (char *)xmalloc (1); + temp_prompt[0] = '\0'; + } + + FREE (current_readline_prompt); + current_readline_prompt = temp_prompt; + } +} +#endif /* READLINE */ +#endif /* 0 */ + +#if defined (HISTORY) +/* A list of tokens which can be followed by newlines, but not by + semi-colons. When concatenating multiple lines of history, the + newline separator for such tokens is replaced with a space. */ +static const int no_semi_successors[] = { + '\n', '{', '(', ')', ';', '&', '|', + CASE, DO, ELSE, IF, SEMI_SEMI, SEMI_AND, SEMI_SEMI_AND, THEN, UNTIL, + WHILE, AND_AND, OR_OR, IN, + 0 +}; + +/* If we are not within a delimited expression, try to be smart + about which separators can be semi-colons and which must be + newlines. Returns the string that should be added into the + history entry. LINE is the line we're about to add; it helps + make some more intelligent decisions in certain cases. */ +char * +history_delimiting_chars (line) + const char *line; +{ + static int last_was_heredoc = 0; /* was the last entry the start of a here document? */ + register int i; + + if ((parser_state & PST_HEREDOC) == 0) + last_was_heredoc = 0; + + if (dstack.delimiter_depth != 0) + return ("\n"); + + /* We look for current_command_line_count == 2 because we are looking to + add the first line of the body of the here document (the second line + of the command). We also keep LAST_WAS_HEREDOC as a private sentinel + variable to note when we think we added the first line of a here doc + (the one with a "<<" somewhere in it) */ + if (parser_state & PST_HEREDOC) + { + if (last_was_heredoc) + { + last_was_heredoc = 0; + return "\n"; + } + return (current_command_line_count == 2 ? "\n" : ""); + } + + if (parser_state & PST_COMPASSIGN) + return (" "); + + /* First, handle some special cases. */ + /*(*/ + /* If we just read `()', assume it's a function definition, and don't + add a semicolon. If the token before the `)' was not `(', and we're + not in the midst of parsing a case statement, assume it's a + parenthesized command and add the semicolon. */ + /*)(*/ + if (token_before_that == ')') + { + if (two_tokens_ago == '(') /*)*/ /* function def */ + return " "; + /* This does not work for subshells inside case statement + command lists. It's a suboptimal solution. */ + else if (parser_state & PST_CASESTMT) /* case statement pattern */ + return " "; + else + return "; "; /* (...) subshell */ + } + else if (token_before_that == WORD && two_tokens_ago == FUNCTION) + return " "; /* function def using `function name' without `()' */ + + /* If we're not in a here document, but we think we're about to parse one, + and we would otherwise return a `;', return a newline to delimit the + line with the here-doc delimiter */ + else if ((parser_state & PST_HEREDOC) == 0 && current_command_line_count > 1 && last_read_token == '\n' && strstr (line, "<<")) + { + last_was_heredoc = 1; + return "\n"; + } + + else if (token_before_that == WORD && two_tokens_ago == FOR) + { + /* Tricky. `for i\nin ...' should not have a semicolon, but + `for i\ndo ...' should. We do what we can. */ + for (i = shell_input_line_index; whitespace (shell_input_line[i]); i++) + ; + if (shell_input_line[i] && shell_input_line[i] == 'i' && shell_input_line[i+1] == 'n') + return " "; + return ";"; + } + else if (two_tokens_ago == CASE && token_before_that == WORD && (parser_state & PST_CASESTMT)) + return " "; + + for (i = 0; no_semi_successors[i]; i++) + { + if (token_before_that == no_semi_successors[i]) + return (" "); + } + + return ("; "); +} +#endif /* HISTORY */ + +/* Issue a prompt, or prepare to issue a prompt when the next character + is read. */ +static void +prompt_again () +{ + char *temp_prompt; + + if (interactive == 0 || expanding_alias ()) /* XXX */ + return; + + ps1_prompt = get_string_value ("PS1"); + ps2_prompt = get_string_value ("PS2"); + + if (!prompt_string_pointer) + prompt_string_pointer = &ps1_prompt; + + temp_prompt = *prompt_string_pointer + ? decode_prompt_string (*prompt_string_pointer) + : (char *)NULL; + + if (temp_prompt == 0) + { + temp_prompt = (char *)xmalloc (1); + temp_prompt[0] = '\0'; + } + + current_prompt_string = *prompt_string_pointer; + prompt_string_pointer = &ps2_prompt; + +#if defined (READLINE) + if (!no_line_editing) + { + FREE (current_readline_prompt); + current_readline_prompt = temp_prompt; + } + else +#endif /* READLINE */ + { + FREE (current_decoded_prompt); + current_decoded_prompt = temp_prompt; + } +} + +int +get_current_prompt_level () +{ + return ((current_prompt_string && current_prompt_string == ps2_prompt) ? 2 : 1); +} + +void +set_current_prompt_level (x) + int x; +{ + prompt_string_pointer = (x == 2) ? &ps2_prompt : &ps1_prompt; + current_prompt_string = *prompt_string_pointer; +} + +static void +print_prompt () +{ + fprintf (stderr, "%s", current_decoded_prompt); + fflush (stderr); +} + +/* Return a string which will be printed as a prompt. The string + may contain special characters which are decoded as follows: + + \a bell (ascii 07) + \d the date in Day Mon Date format + \e escape (ascii 033) + \h the hostname up to the first `.' + \H the hostname + \j the number of active jobs + \l the basename of the shell's tty device name + \n CRLF + \r CR + \s the name of the shell + \t the time in 24-hour hh:mm:ss format + \T the time in 12-hour hh:mm:ss format + \@ the time in 12-hour hh:mm am/pm format + \A the time in 24-hour hh:mm format + \D{fmt} the result of passing FMT to strftime(3) + \u your username + \v the version of bash (e.g., 2.00) + \V the release of bash, version + patchlevel (e.g., 2.00.0) + \w the current working directory + \W the last element of $PWD + \! the history number of this command + \# the command number of this command + \$ a $ or a # if you are root + \nnn character code nnn in octal + \\ a backslash + \[ begin a sequence of non-printing chars + \] end a sequence of non-printing chars +*/ +#define PROMPT_GROWTH 48 +char * +decode_prompt_string (string) + char *string; +{ + WORD_LIST *list; + char *result, *t; + struct dstack save_dstack; + int last_exit_value, last_comsub_pid; +#if defined (PROMPT_STRING_DECODE) + int result_size, result_index; + int c, n, i; + char *temp, octal_string[4]; + struct tm *tm; + time_t the_time; + char timebuf[128]; + char *timefmt; + + result = (char *)xmalloc (result_size = PROMPT_GROWTH); + result[result_index = 0] = 0; + temp = (char *)NULL; + + while (c = *string++) + { + if (posixly_correct && c == '!') + { + if (*string == '!') + { + temp = savestring ("!"); + goto add_string; + } + else + { +#if !defined (HISTORY) + temp = savestring ("1"); +#else /* HISTORY */ + temp = itos (history_number ()); +#endif /* HISTORY */ + string--; /* add_string increments string again. */ + goto add_string; + } + } + if (c == '\\') + { + c = *string; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + strncpy (octal_string, string, 3); + octal_string[3] = '\0'; + + n = read_octal (octal_string); + temp = (char *)xmalloc (3); + + if (n == CTLESC || n == CTLNUL) + { + temp[0] = CTLESC; + temp[1] = n; + temp[2] = '\0'; + } + else if (n == -1) + { + temp[0] = '\\'; + temp[1] = '\0'; + } + else + { + temp[0] = n; + temp[1] = '\0'; + } + + for (c = 0; n != -1 && c < 3 && ISOCTAL (*string); c++) + string++; + + c = 0; /* tested at add_string: */ + goto add_string; + + case 'd': + case 't': + case 'T': + case '@': + case 'A': + /* Make the current time/date into a string. */ + (void) time (&the_time); +#if defined (HAVE_TZSET) + sv_tz ("TZ"); /* XXX -- just make sure */ +#endif + tm = localtime (&the_time); + + if (c == 'd') + n = strftime (timebuf, sizeof (timebuf), "%a %b %d", tm); + else if (c == 't') + n = strftime (timebuf, sizeof (timebuf), "%H:%M:%S", tm); + else if (c == 'T') + n = strftime (timebuf, sizeof (timebuf), "%I:%M:%S", tm); + else if (c == '@') + n = strftime (timebuf, sizeof (timebuf), "%I:%M %p", tm); + else if (c == 'A') + n = strftime (timebuf, sizeof (timebuf), "%H:%M", tm); + + if (n == 0) + timebuf[0] = '\0'; + else + timebuf[sizeof(timebuf) - 1] = '\0'; + + temp = savestring (timebuf); + goto add_string; + + case 'D': /* strftime format */ + if (string[1] != '{') /* } */ + goto not_escape; + + (void) time (&the_time); + tm = localtime (&the_time); + string += 2; /* skip { */ + timefmt = xmalloc (strlen (string) + 3); + for (t = timefmt; *string && *string != '}'; ) + *t++ = *string++; + *t = '\0'; + c = *string; /* tested at add_string */ + if (timefmt[0] == '\0') + { + timefmt[0] = '%'; + timefmt[1] = 'X'; /* locale-specific current time */ + timefmt[2] = '\0'; + } + n = strftime (timebuf, sizeof (timebuf), timefmt, tm); + free (timefmt); + + if (n == 0) + timebuf[0] = '\0'; + else + timebuf[sizeof(timebuf) - 1] = '\0'; + + if (promptvars || posixly_correct) + /* Make sure that expand_prompt_string is called with a + second argument of Q_DOUBLE_QUOTES if we use this + function here. */ + temp = sh_backslash_quote_for_double_quotes (timebuf); + else + temp = savestring (timebuf); + goto add_string; + + case 'n': + temp = (char *)xmalloc (3); + temp[0] = no_line_editing ? '\n' : '\r'; + temp[1] = no_line_editing ? '\0' : '\n'; + temp[2] = '\0'; + goto add_string; + + case 's': + temp = base_pathname (shell_name); + temp = savestring (temp); + goto add_string; + + case 'v': + case 'V': + temp = (char *)xmalloc (16); + if (c == 'v') + strcpy (temp, dist_version); + else + sprintf (temp, "%s.%d", dist_version, patch_level); + goto add_string; + + case 'w': + case 'W': + { + /* Use the value of PWD because it is much more efficient. */ + char t_string[PATH_MAX]; + int tlen; + + temp = get_string_value ("PWD"); + + if (temp == 0) + { + if (getcwd (t_string, sizeof(t_string)) == 0) + { + t_string[0] = '.'; + tlen = 1; + } + else + tlen = strlen (t_string); + } + else + { + tlen = sizeof (t_string) - 1; + strncpy (t_string, temp, tlen); + } + t_string[tlen] = '\0'; + +#if defined (MACOSX) + /* Convert from "fs" format to "input" format */ + temp = fnx_fromfs (t_string, strlen (t_string)); + if (temp != t_string) + strcpy (t_string, temp); +#endif + +#define ROOT_PATH(x) ((x)[0] == '/' && (x)[1] == 0) +#define DOUBLE_SLASH_ROOT(x) ((x)[0] == '/' && (x)[1] == '/' && (x)[2] == 0) + /* Abbreviate \W as ~ if $PWD == $HOME */ + if (c == 'W' && (((t = get_string_value ("HOME")) == 0) || STREQ (t, t_string) == 0)) + { + if (ROOT_PATH (t_string) == 0 && DOUBLE_SLASH_ROOT (t_string) == 0) + { + t = strrchr (t_string, '/'); + if (t) + memmove (t_string, t + 1, strlen (t)); /* strlen(t) to copy NULL */ + } + } +#undef ROOT_PATH +#undef DOUBLE_SLASH_ROOT + else + { + /* polite_directory_format is guaranteed to return a string + no longer than PATH_MAX - 1 characters. */ + temp = polite_directory_format (t_string); + if (temp != t_string) + strcpy (t_string, temp); + } + + temp = trim_pathname (t_string, PATH_MAX - 1); + /* If we're going to be expanding the prompt string later, + quote the directory name. */ + if (promptvars || posixly_correct) + /* Make sure that expand_prompt_string is called with a + second argument of Q_DOUBLE_QUOTES if we use this + function here. */ + temp = sh_backslash_quote_for_double_quotes (t_string); + else + temp = savestring (t_string); + + goto add_string; + } + + case 'u': + if (current_user.user_name == 0) + get_current_user_info (); + temp = savestring (current_user.user_name); + goto add_string; + + case 'h': + case 'H': + temp = savestring (current_host_name); + if (c == 'h' && (t = (char *)strchr (temp, '.'))) + *t = '\0'; + goto add_string; + + case '#': + temp = itos (current_command_number); + goto add_string; + + case '!': +#if !defined (HISTORY) + temp = savestring ("1"); +#else /* HISTORY */ + temp = itos (history_number ()); +#endif /* HISTORY */ + goto add_string; + + case '$': + t = temp = (char *)xmalloc (3); + if ((promptvars || posixly_correct) && (current_user.euid != 0)) + *t++ = '\\'; + *t++ = current_user.euid == 0 ? '#' : '$'; + *t = '\0'; + goto add_string; + + case 'j': + temp = itos (count_all_jobs ()); + goto add_string; + + case 'l': +#if defined (HAVE_TTYNAME) + temp = (char *)ttyname (fileno (stdin)); + t = temp ? base_pathname (temp) : "tty"; + temp = savestring (t); +#else + temp = savestring ("tty"); +#endif /* !HAVE_TTYNAME */ + goto add_string; + +#if defined (READLINE) + case '[': + case ']': + if (no_line_editing) + { + string++; + break; + } + temp = (char *)xmalloc (3); + n = (c == '[') ? RL_PROMPT_START_IGNORE : RL_PROMPT_END_IGNORE; + i = 0; + if (n == CTLESC || n == CTLNUL) + temp[i++] = CTLESC; + temp[i++] = n; + temp[i] = '\0'; + goto add_string; +#endif /* READLINE */ + + case '\\': + case 'a': + case 'e': + case 'r': + temp = (char *)xmalloc (2); + if (c == 'a') + temp[0] = '\07'; + else if (c == 'e') + temp[0] = '\033'; + else if (c == 'r') + temp[0] = '\r'; + else /* (c == '\\') */ + temp[0] = c; + temp[1] = '\0'; + goto add_string; + + default: +not_escape: + temp = (char *)xmalloc (3); + temp[0] = '\\'; + temp[1] = c; + temp[2] = '\0'; + + add_string: + if (c) + string++; + result = + sub_append_string (temp, result, &result_index, &result_size); + temp = (char *)NULL; /* Freed in sub_append_string (). */ + result[result_index] = '\0'; + break; + } + } + else + { + RESIZE_MALLOCED_BUFFER (result, result_index, 3, result_size, PROMPT_GROWTH); + result[result_index++] = c; + result[result_index] = '\0'; + } + } +#else /* !PROMPT_STRING_DECODE */ + result = savestring (string); +#endif /* !PROMPT_STRING_DECODE */ + + /* Save the delimiter stack and point `dstack' to temp space so any + command substitutions in the prompt string won't result in screwing + up the parser's quoting state. */ + save_dstack = dstack; + dstack = temp_dstack; + dstack.delimiter_depth = 0; + + /* Perform variable and parameter expansion and command substitution on + the prompt string. */ + if (promptvars || posixly_correct) + { + last_exit_value = last_command_exit_value; + last_comsub_pid = last_command_subst_pid; + list = expand_prompt_string (result, Q_DOUBLE_QUOTES, 0); + free (result); + result = string_list (list); + dispose_words (list); + last_command_exit_value = last_exit_value; + last_command_subst_pid = last_comsub_pid; + } + else + { + t = dequote_string (result); + free (result); + result = t; + } + + dstack = save_dstack; + + return (result); +} + +/************************************************ + * * + * ERROR HANDLING * + * * + ************************************************/ + +/* Report a syntax error, and restart the parser. Call here for fatal + errors. */ +int +yyerror (msg) + const char *msg; +{ + report_syntax_error ((char *)NULL); + reset_parser (); + return (0); +} + +static char * +error_token_from_token (tok) + int tok; +{ + char *t; + + if (t = find_token_in_alist (tok, word_token_alist, 0)) + return t; + + if (t = find_token_in_alist (tok, other_token_alist, 0)) + return t; + + t = (char *)NULL; + /* This stuff is dicy and needs closer inspection */ + switch (current_token) + { + case WORD: + case ASSIGNMENT_WORD: + if (yylval.word) + t = savestring (yylval.word->word); + break; + case NUMBER: + t = itos (yylval.number); + break; + case ARITH_CMD: + if (yylval.word_list) + t = string_list (yylval.word_list); + break; + case ARITH_FOR_EXPRS: + if (yylval.word_list) + t = string_list_internal (yylval.word_list, " ; "); + break; + case COND_CMD: + t = (char *)NULL; /* punt */ + break; + } + + return t; +} + +static char * +error_token_from_text () +{ + char *msg, *t; + int token_end, i; + + t = shell_input_line; + i = shell_input_line_index; + token_end = 0; + msg = (char *)NULL; + + if (i && t[i] == '\0') + i--; + + while (i && (whitespace (t[i]) || t[i] == '\n')) + i--; + + if (i) + token_end = i + 1; + + while (i && (member (t[i], " \n\t;|&") == 0)) + i--; + + while (i != token_end && (whitespace (t[i]) || t[i] == '\n')) + i++; + + /* Return our idea of the offending token. */ + if (token_end || (i == 0 && token_end == 0)) + { + if (token_end) + msg = substring (t, i, token_end); + else /* one-character token */ + { + msg = (char *)xmalloc (2); + msg[0] = t[i]; + msg[1] = '\0'; + } + } + + return (msg); +} + +static void +print_offending_line () +{ + char *msg; + int token_end; + + msg = savestring (shell_input_line); + token_end = strlen (msg); + while (token_end && msg[token_end - 1] == '\n') + msg[--token_end] = '\0'; + + parser_error (line_number, "`%s'", msg); + free (msg); +} + +/* Report a syntax error with line numbers, etc. + Call here for recoverable errors. If you have a message to print, + then place it in MESSAGE, otherwise pass NULL and this will figure + out an appropriate message for you. */ +static void +report_syntax_error (message) + char *message; +{ + char *msg, *p; + + if (message) + { + parser_error (line_number, "%s", message); + if (interactive && EOF_Reached) + EOF_Reached = 0; + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; + return; + } + + /* If the line of input we're reading is not null, try to find the + objectionable token. First, try to figure out what token the + parser's complaining about by looking at current_token. */ + if (current_token != 0 && EOF_Reached == 0 && (msg = error_token_from_token (current_token))) + { + if (ansic_shouldquote (msg)) + { + p = ansic_quote (msg, 0, NULL); + free (msg); + msg = p; + } + parser_error (line_number, _("syntax error near unexpected token `%s'"), msg); + free (msg); + + if (interactive == 0) + print_offending_line (); + + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; + return; + } + + /* If looking at the current token doesn't prove fruitful, try to find the + offending token by analyzing the text of the input line near the current + input line index and report what we find. */ + if (shell_input_line && *shell_input_line) + { + msg = error_token_from_text (); + if (msg) + { + parser_error (line_number, _("syntax error near `%s'"), msg); + free (msg); + } + + /* If not interactive, print the line containing the error. */ + if (interactive == 0) + print_offending_line (); + } + else + { + msg = EOF_Reached ? _("syntax error: unexpected end of file") : _("syntax error"); + parser_error (line_number, "%s", msg); + /* When the shell is interactive, this file uses EOF_Reached + only for error reporting. Other mechanisms are used to + decide whether or not to exit. */ + if (interactive && EOF_Reached) + EOF_Reached = 0; + } + + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; +} + +/* ??? Needed function. ??? We have to be able to discard the constructs + created during parsing. In the case of error, we want to return + allocated objects to the memory pool. In the case of no error, we want + to throw away the information about where the allocated objects live. + (dispose_command () will actually free the command.) */ +static void +discard_parser_constructs (error_p) + int error_p; +{ +} + +/************************************************ + * * + * EOF HANDLING * + * * + ************************************************/ + +/* Do that silly `type "bye" to exit' stuff. You know, "ignoreeof". */ + +/* A flag denoting whether or not ignoreeof is set. */ +int ignoreeof = 0; + +/* The number of times that we have encountered an EOF character without + another character intervening. When this gets above the limit, the + shell terminates. */ +int eof_encountered = 0; + +/* The limit for eof_encountered. */ +int eof_encountered_limit = 10; + +/* If we have EOF as the only input unit, this user wants to leave + the shell. If the shell is not interactive, then just leave. + Otherwise, if ignoreeof is set, and we haven't done this the + required number of times in a row, print a message. */ +static void +handle_eof_input_unit () +{ + if (interactive) + { + /* shell.c may use this to decide whether or not to write out the + history, among other things. We use it only for error reporting + in this file. */ + if (EOF_Reached) + EOF_Reached = 0; + + /* If the user wants to "ignore" eof, then let her do so, kind of. */ + if (ignoreeof) + { + if (eof_encountered < eof_encountered_limit) + { + fprintf (stderr, _("Use \"%s\" to leave the shell.\n"), + login_shell ? "logout" : "exit"); + eof_encountered++; + /* Reset the parsing state. */ + last_read_token = current_token = '\n'; + /* Reset the prompt string to be $PS1. */ + prompt_string_pointer = (char **)NULL; + prompt_again (); + return; + } + } + + /* In this case EOF should exit the shell. Do it now. */ + reset_parser (); + exit_builtin ((WORD_LIST *)NULL); + } + else + { + /* We don't write history files, etc., for non-interactive shells. */ + EOF_Reached = 1; + } +} + +/************************************************ + * * + * STRING PARSING FUNCTIONS * + * * + ************************************************/ + +/* It's very important that these two functions treat the characters + between ( and ) identically. */ + +static WORD_LIST parse_string_error; + +/* Take a string and run it through the shell parser, returning the + resultant word list. Used by compound array assignment. */ +WORD_LIST * +parse_string_to_word_list (s, flags, whom) + char *s; + int flags; + const char *whom; +{ + WORD_LIST *wl; + int tok, orig_current_token, orig_line_number, orig_input_terminator; + int orig_line_count; + int old_echo_input, old_expand_aliases; +#if defined (HISTORY) + int old_remember_on_history, old_history_expansion_inhibited; +#endif + +#if defined (HISTORY) + old_remember_on_history = remember_on_history; +# if defined (BANG_HISTORY) + old_history_expansion_inhibited = history_expansion_inhibited; +# endif + bash_history_disable (); +#endif + + orig_line_number = line_number; + orig_line_count = current_command_line_count; + orig_input_terminator = shell_input_line_terminator; + old_echo_input = echo_input_at_read; + old_expand_aliases = expand_aliases; + + push_stream (1); + last_read_token = WORD; /* WORD to allow reserved words here */ + current_command_line_count = 0; + echo_input_at_read = expand_aliases = 0; + + with_input_from_string (s, whom); + wl = (WORD_LIST *)NULL; + + if (flags & 1) + parser_state |= PST_COMPASSIGN|PST_REPARSE; + + while ((tok = read_token (READ)) != yacc_EOF) + { + if (tok == '\n' && *bash_input.location.string == '\0') + break; + if (tok == '\n') /* Allow newlines in compound assignments */ + continue; + if (tok != WORD && tok != ASSIGNMENT_WORD) + { + line_number = orig_line_number + line_number - 1; + orig_current_token = current_token; + current_token = tok; + yyerror (NULL); /* does the right thing */ + current_token = orig_current_token; + if (wl) + dispose_words (wl); + wl = &parse_string_error; + break; + } + wl = make_word_list (yylval.word, wl); + } + + last_read_token = '\n'; + pop_stream (); + +#if defined (HISTORY) + remember_on_history = old_remember_on_history; +# if defined (BANG_HISTORY) + history_expansion_inhibited = old_history_expansion_inhibited; +# endif /* BANG_HISTORY */ +#endif /* HISTORY */ + + echo_input_at_read = old_echo_input; + expand_aliases = old_expand_aliases; + + current_command_line_count = orig_line_count; + shell_input_line_terminator = orig_input_terminator; + + if (flags & 1) + parser_state &= ~(PST_COMPASSIGN|PST_REPARSE); + + if (wl == &parse_string_error) + { + last_command_exit_value = EXECUTION_FAILURE; + if (interactive_shell == 0 && posixly_correct) + jump_to_top_level (FORCE_EOF); + else + jump_to_top_level (DISCARD); + } + + return (REVERSE_LIST (wl, WORD_LIST *)); +} + +static char * +parse_compound_assignment (retlenp) + int *retlenp; +{ + WORD_LIST *wl, *rl; + int tok, orig_line_number, orig_token_size, orig_last_token, assignok; + char *saved_token, *ret; + + saved_token = token; + orig_token_size = token_buffer_size; + orig_line_number = line_number; + orig_last_token = last_read_token; + + last_read_token = WORD; /* WORD to allow reserved words here */ + + token = (char *)NULL; + token_buffer_size = 0; + + assignok = parser_state&PST_ASSIGNOK; /* XXX */ + + wl = (WORD_LIST *)NULL; /* ( */ + parser_state |= PST_COMPASSIGN; + + while ((tok = read_token (READ)) != ')') + { + if (tok == '\n') /* Allow newlines in compound assignments */ + { + if (SHOULD_PROMPT ()) + prompt_again (); + continue; + } + if (tok != WORD && tok != ASSIGNMENT_WORD) + { + current_token = tok; /* for error reporting */ + if (tok == yacc_EOF) /* ( */ + parser_error (orig_line_number, _("unexpected EOF while looking for matching `)'")); + else + yyerror(NULL); /* does the right thing */ + if (wl) + dispose_words (wl); + wl = &parse_string_error; + break; + } + wl = make_word_list (yylval.word, wl); + } + + FREE (token); + token = saved_token; + token_buffer_size = orig_token_size; + + parser_state &= ~PST_COMPASSIGN; + + if (wl == &parse_string_error) + { + last_command_exit_value = EXECUTION_FAILURE; + last_read_token = '\n'; /* XXX */ + if (interactive_shell == 0 && posixly_correct) + jump_to_top_level (FORCE_EOF); + else + jump_to_top_level (DISCARD); + } + + last_read_token = orig_last_token; /* XXX - was WORD? */ + + if (wl) + { + rl = REVERSE_LIST (wl, WORD_LIST *); + ret = string_list (rl); + dispose_words (rl); + } + else + ret = (char *)NULL; + + if (retlenp) + *retlenp = (ret && *ret) ? strlen (ret) : 0; + + if (assignok) + parser_state |= PST_ASSIGNOK; + + return ret; +} + +/************************************************ + * * + * SAVING AND RESTORING PARTIAL PARSE STATE * + * * + ************************************************/ + +sh_parser_state_t * +save_parser_state (ps) + sh_parser_state_t *ps; +{ + if (ps == 0) + ps = (sh_parser_state_t *)xmalloc (sizeof (sh_parser_state_t)); + if (ps == 0) + return ((sh_parser_state_t *)NULL); + + ps->parser_state = parser_state; + ps->token_state = save_token_state (); + + ps->input_line_terminator = shell_input_line_terminator; + ps->eof_encountered = eof_encountered; + + ps->prompt_string_pointer = prompt_string_pointer; + + ps->current_command_line_count = current_command_line_count; + +#if defined (HISTORY) + ps->remember_on_history = remember_on_history; +# if defined (BANG_HISTORY) + ps->history_expansion_inhibited = history_expansion_inhibited; +# endif +#endif + + ps->last_command_exit_value = last_command_exit_value; +#if defined (ARRAY_VARS) + ps->pipestatus = save_pipestatus_array (); +#endif + + ps->last_shell_builtin = last_shell_builtin; + ps->this_shell_builtin = this_shell_builtin; + + ps->expand_aliases = expand_aliases; + ps->echo_input_at_read = echo_input_at_read; + + ps->token = token; + ps->token_buffer_size = token_buffer_size; + /* Force reallocation on next call to read_token_word */ + token = 0; + token_buffer_size = 0; + + return (ps); +} + +void +restore_parser_state (ps) + sh_parser_state_t *ps; +{ + if (ps == 0) + return; + + parser_state = ps->parser_state; + if (ps->token_state) + { + restore_token_state (ps->token_state); + free (ps->token_state); + } + + shell_input_line_terminator = ps->input_line_terminator; + eof_encountered = ps->eof_encountered; + + prompt_string_pointer = ps->prompt_string_pointer; + + current_command_line_count = ps->current_command_line_count; + +#if defined (HISTORY) + remember_on_history = ps->remember_on_history; +# if defined (BANG_HISTORY) + history_expansion_inhibited = ps->history_expansion_inhibited; +# endif +#endif + + last_command_exit_value = ps->last_command_exit_value; +#if defined (ARRAY_VARS) + restore_pipestatus_array (ps->pipestatus); +#endif + + last_shell_builtin = ps->last_shell_builtin; + this_shell_builtin = ps->this_shell_builtin; + + expand_aliases = ps->expand_aliases; + echo_input_at_read = ps->echo_input_at_read; + + FREE (token); + token = ps->token; + token_buffer_size = ps->token_buffer_size; +} + +sh_input_line_state_t * +save_input_line_state (ls) + sh_input_line_state_t *ls; +{ + if (ls == 0) + ls = (sh_input_line_state_t *)xmalloc (sizeof (sh_input_line_state_t)); + if (ls == 0) + return ((sh_input_line_state_t *)NULL); + + ls->input_line = shell_input_line; + ls->input_line_size = shell_input_line_size; + ls->input_line_len = shell_input_line_len; + ls->input_line_index = shell_input_line_index; + + /* force reallocation */ + shell_input_line = 0; + shell_input_line_size = shell_input_line_len = shell_input_line_index = 0; + + return ls; +} + +void +restore_input_line_state (ls) + sh_input_line_state_t *ls; +{ + FREE (shell_input_line); + shell_input_line = ls->input_line; + shell_input_line_size = ls->input_line_size; + shell_input_line_len = ls->input_line_len; + shell_input_line_index = ls->input_line_index; + + set_line_mbstate (); +} + +/************************************************ + * * + * MULTIBYTE CHARACTER HANDLING * + * * + ************************************************/ + +#if defined (HANDLE_MULTIBYTE) +static void +set_line_mbstate () +{ + int c; + size_t i, previ, len; + mbstate_t mbs, prevs; + size_t mbclen; + + if (shell_input_line == NULL) + return; + len = strlen (shell_input_line); /* XXX - shell_input_line_len ? */ + FREE (shell_input_line_property); + shell_input_line_property = (char *)xmalloc (len + 1); + + memset (&prevs, '\0', sizeof (mbstate_t)); + for (i = previ = 0; i < len; i++) + { + mbs = prevs; + + c = shell_input_line[i]; + if (c == EOF) + { + size_t j; + for (j = i; j < len; j++) + shell_input_line_property[j] = 1; + break; + } + + mbclen = mbrlen (shell_input_line + previ, i - previ + 1, &mbs); + if (mbclen == 1 || mbclen == (size_t)-1) + { + mbclen = 1; + previ = i + 1; + } + else if (mbclen == (size_t)-2) + mbclen = 0; + else if (mbclen > 1) + { + mbclen = 0; + previ = i + 1; + prevs = mbs; + } + else + { + /* XXX - what to do if mbrlen returns 0? (null wide character) */ + size_t j; + for (j = i; j < len; j++) + shell_input_line_property[j] = 1; + break; + } + + shell_input_line_property[i] = mbclen; + } +} +#endif /* HANDLE_MULTIBYTE */ diff --git a/.pc/bash43-005.diff/patchlevel.h b/.pc/bash43-005.diff/patchlevel.h new file mode 100644 index 0000000..9a65c37 --- /dev/null +++ b/.pc/bash43-005.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 4 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-005.diff/y.tab.c b/.pc/bash43-005.diff/y.tab.c new file mode 100644 index 0000000..f77131b --- /dev/null +++ b/.pc/bash43-005.diff/y.tab.c @@ -0,0 +1,8540 @@ +/* A Bison parser, made by GNU Bison 2.3. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.3" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + IF = 258, + THEN = 259, + ELSE = 260, + ELIF = 261, + FI = 262, + CASE = 263, + ESAC = 264, + FOR = 265, + SELECT = 266, + WHILE = 267, + UNTIL = 268, + DO = 269, + DONE = 270, + FUNCTION = 271, + COPROC = 272, + COND_START = 273, + COND_END = 274, + COND_ERROR = 275, + IN = 276, + BANG = 277, + TIME = 278, + TIMEOPT = 279, + TIMEIGN = 280, + WORD = 281, + ASSIGNMENT_WORD = 282, + REDIR_WORD = 283, + NUMBER = 284, + ARITH_CMD = 285, + ARITH_FOR_EXPRS = 286, + COND_CMD = 287, + AND_AND = 288, + OR_OR = 289, + GREATER_GREATER = 290, + LESS_LESS = 291, + LESS_AND = 292, + LESS_LESS_LESS = 293, + GREATER_AND = 294, + SEMI_SEMI = 295, + SEMI_AND = 296, + SEMI_SEMI_AND = 297, + LESS_LESS_MINUS = 298, + AND_GREATER = 299, + AND_GREATER_GREATER = 300, + LESS_GREATER = 301, + GREATER_BAR = 302, + BAR_AND = 303, + yacc_EOF = 304 + }; +#endif +/* Tokens. */ +#define IF 258 +#define THEN 259 +#define ELSE 260 +#define ELIF 261 +#define FI 262 +#define CASE 263 +#define ESAC 264 +#define FOR 265 +#define SELECT 266 +#define WHILE 267 +#define UNTIL 268 +#define DO 269 +#define DONE 270 +#define FUNCTION 271 +#define COPROC 272 +#define COND_START 273 +#define COND_END 274 +#define COND_ERROR 275 +#define IN 276 +#define BANG 277 +#define TIME 278 +#define TIMEOPT 279 +#define TIMEIGN 280 +#define WORD 281 +#define ASSIGNMENT_WORD 282 +#define REDIR_WORD 283 +#define NUMBER 284 +#define ARITH_CMD 285 +#define ARITH_FOR_EXPRS 286 +#define COND_CMD 287 +#define AND_AND 288 +#define OR_OR 289 +#define GREATER_GREATER 290 +#define LESS_LESS 291 +#define LESS_AND 292 +#define LESS_LESS_LESS 293 +#define GREATER_AND 294 +#define SEMI_SEMI 295 +#define SEMI_AND 296 +#define SEMI_SEMI_AND 297 +#define LESS_LESS_MINUS 298 +#define AND_GREATER 299 +#define AND_GREATER_GREATER 300 +#define LESS_GREATER 301 +#define GREATER_BAR 302 +#define BAR_AND 303 +#define yacc_EOF 304 + + + + +/* Copy the first part of user declarations. */ +#line 21 "/usr/homes/chet/src/bash/src/parse.y" + +#include "config.h" + +#include "bashtypes.h" +#include "bashansi.h" + +#include "filecntl.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (HAVE_LOCALE_H) +# include +#endif + +#include +#include "chartypes.h" +#include + +#include "memalloc.h" + +#include "bashintl.h" + +#define NEED_STRFTIME_DECL /* used in externs.h */ + +#include "shell.h" +#include "typemax.h" /* SIZE_MAX if needed */ +#include "trap.h" +#include "flags.h" +#include "parser.h" +#include "mailcheck.h" +#include "test.h" +#include "builtins.h" +#include "builtins/common.h" +#include "builtins/builtext.h" + +#include "shmbutil.h" + +#if defined (READLINE) +# include "bashline.h" +# include +#endif /* READLINE */ + +#if defined (HISTORY) +# include "bashhist.h" +# include +#endif /* HISTORY */ + +#if defined (JOB_CONTROL) +# include "jobs.h" +#endif /* JOB_CONTROL */ + +#if defined (ALIAS) +# include "alias.h" +#else +typedef void *alias_t; +#endif /* ALIAS */ + +#if defined (PROMPT_STRING_DECODE) +# ifndef _MINIX +# include +# endif +# include +# if defined (TM_IN_SYS_TIME) +# include +# include +# endif /* TM_IN_SYS_TIME */ +# include "maxpath.h" +#endif /* PROMPT_STRING_DECODE */ + +#define RE_READ_TOKEN -99 +#define NO_EXPANSION -100 + +#ifdef DEBUG +# define YYDEBUG 1 +#else +# define YYDEBUG 0 +#endif + +#if defined (HANDLE_MULTIBYTE) +# define last_shell_getc_is_singlebyte \ + ((shell_input_line_index > 1) \ + ? shell_input_line_property[shell_input_line_index - 1] \ + : 1) +# define MBTEST(x) ((x) && last_shell_getc_is_singlebyte) +#else +# define last_shell_getc_is_singlebyte 1 +# define MBTEST(x) ((x)) +#endif + +#if defined (EXTENDED_GLOB) +extern int extended_glob; +#endif + +extern int eof_encountered; +extern int no_line_editing, running_under_emacs; +extern int current_command_number; +extern int sourcelevel, parse_and_execute_level; +extern int posixly_correct; +extern int last_command_exit_value; +extern pid_t last_command_subst_pid; +extern char *shell_name, *current_host_name; +extern char *dist_version; +extern int patch_level; +extern int dump_translatable_strings, dump_po_strings; +extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin; +#if defined (BUFFERED_INPUT) +extern int bash_input_fd_changed; +#endif + +extern int errno; +/* **************************************************************** */ +/* */ +/* "Forward" declarations */ +/* */ +/* **************************************************************** */ + +#ifdef DEBUG +static void debug_parser __P((int)); +#endif + +static int yy_getc __P((void)); +static int yy_ungetc __P((int)); + +#if defined (READLINE) +static int yy_readline_get __P((void)); +static int yy_readline_unget __P((int)); +#endif + +static int yy_string_get __P((void)); +static int yy_string_unget __P((int)); +static void rewind_input_string __P((void)); +static int yy_stream_get __P((void)); +static int yy_stream_unget __P((int)); + +static int shell_getc __P((int)); +static void shell_ungetc __P((int)); +static void discard_until __P((int)); + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) +static void push_string __P((char *, int, alias_t *)); +static void pop_string __P((void)); +static void free_string_list __P((void)); +#endif + +static char *read_a_line __P((int)); + +static int reserved_word_acceptable __P((int)); +static int yylex __P((void)); +static int alias_expand_token __P((char *)); +static int time_command_acceptable __P((void)); +static int special_case_tokens __P((char *)); +static int read_token __P((int)); +static char *parse_matched_pair __P((int, int, int, int *, int)); +static char *parse_comsub __P((int, int, int, int *, int)); +#if defined (ARRAY_VARS) +static char *parse_compound_assignment __P((int *)); +#endif +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) +static int parse_dparen __P((int)); +static int parse_arith_cmd __P((char **, int)); +#endif +#if defined (COND_COMMAND) +static void cond_error __P((void)); +static COND_COM *cond_expr __P((void)); +static COND_COM *cond_or __P((void)); +static COND_COM *cond_and __P((void)); +static COND_COM *cond_term __P((void)); +static int cond_skip_newlines __P((void)); +static COMMAND *parse_cond_command __P((void)); +#endif +#if defined (ARRAY_VARS) +static int token_is_assignment __P((char *, int)); +static int token_is_ident __P((char *, int)); +#endif +static int read_token_word __P((int)); +static void discard_parser_constructs __P((int)); + +static char *error_token_from_token __P((int)); +static char *error_token_from_text __P((void)); +static void print_offending_line __P((void)); +static void report_syntax_error __P((char *)); + +static void handle_eof_input_unit __P((void)); +static void prompt_again __P((void)); +#if 0 +static void reset_readline_prompt __P((void)); +#endif +static void print_prompt __P((void)); + +#if defined (HANDLE_MULTIBYTE) +static void set_line_mbstate __P((void)); +static char *shell_input_line_property = NULL; +#else +# define set_line_mbstate() +#endif + +extern int yyerror __P((const char *)); + +#ifdef DEBUG +extern int yydebug; +#endif + +/* Default prompt strings */ +char *primary_prompt = PPROMPT; +char *secondary_prompt = SPROMPT; + +/* PROMPT_STRING_POINTER points to one of these, never to an actual string. */ +char *ps1_prompt, *ps2_prompt; + +/* Handle on the current prompt string. Indirectly points through + ps1_ or ps2_prompt. */ +char **prompt_string_pointer = (char **)NULL; +char *current_prompt_string; + +/* Non-zero means we expand aliases in commands. */ +int expand_aliases = 0; + +/* If non-zero, the decoded prompt string undergoes parameter and + variable substitution, command substitution, arithmetic substitution, + string expansion, process substitution, and quote removal in + decode_prompt_string. */ +int promptvars = 1; + +/* If non-zero, $'...' and $"..." are expanded when they appear within + a ${...} expansion, even when the expansion appears within double + quotes. */ +int extended_quote = 1; + +/* The number of lines read from input while creating the current command. */ +int current_command_line_count; + +/* The number of lines in a command saved while we run parse_and_execute */ +int saved_command_line_count; + +/* The token that currently denotes the end of parse. */ +int shell_eof_token; + +/* The token currently being read. */ +int current_token; + +/* The current parser state. */ +int parser_state; + +/* Variables to manage the task of reading here documents, because we need to + defer the reading until after a complete command has been collected. */ +static REDIRECT *redir_stack[10]; +int need_here_doc; + +/* Where shell input comes from. History expansion is performed on each + line when the shell is interactive. */ +static char *shell_input_line = (char *)NULL; +static size_t shell_input_line_index; +static size_t shell_input_line_size; /* Amount allocated for shell_input_line. */ +static size_t shell_input_line_len; /* strlen (shell_input_line) */ + +/* Either zero or EOF. */ +static int shell_input_line_terminator; + +/* The line number in a script on which a function definition starts. */ +static int function_dstart; + +/* The line number in a script on which a function body starts. */ +static int function_bstart; + +/* The line number in a script at which an arithmetic for command starts. */ +static int arith_for_lineno; + +/* The decoded prompt string. Used if READLINE is not defined or if + editing is turned off. Analogous to current_readline_prompt. */ +static char *current_decoded_prompt; + +/* The last read token, or NULL. read_token () uses this for context + checking. */ +static int last_read_token; + +/* The token read prior to last_read_token. */ +static int token_before_that; + +/* The token read prior to token_before_that. */ +static int two_tokens_ago; + +static int global_extglob; + +/* The line number in a script where the word in a `case WORD', `select WORD' + or `for WORD' begins. This is a nested command maximum, since the array + index is decremented after a case, select, or for command is parsed. */ +#define MAX_CASE_NEST 128 +static int word_lineno[MAX_CASE_NEST]; +static int word_top = -1; + +/* If non-zero, it is the token that we want read_token to return + regardless of what text is (or isn't) present to be read. This + is reset by read_token. If token_to_read == WORD or + ASSIGNMENT_WORD, yylval.word should be set to word_desc_to_read. */ +static int token_to_read; +static WORD_DESC *word_desc_to_read; + +static REDIRECTEE source; +static REDIRECTEE redir; + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 324 "/usr/homes/chet/src/bash/src/parse.y" +{ + WORD_DESC *word; /* the word that we read. */ + int number; /* the number that we read. */ + WORD_LIST *word_list; + COMMAND *command; + REDIRECT *redirect; + ELEMENT element; + PATTERN_LIST *pattern; +} +/* Line 193 of yacc.c. */ +#line 507 "y.tab.c" + YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + + + +/* Copy the second part of user declarations. */ + + +/* Line 216 of yacc.c. */ +#line 520 "y.tab.c" + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss; + YYSTYPE yyvs; + }; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 116 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 659 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 61 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 38 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 167 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 342 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 304 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 51, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 49, 2, + 59, 60, 2, 2, 2, 56, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 50, + 55, 2, 54, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 57, 53, 58, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 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, 52 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 6, 8, 11, 13, 15, 18, 21, + 24, 28, 32, 36, 40, 43, 47, 51, 54, 58, + 62, 65, 69, 73, 76, 80, 84, 87, 91, 95, + 98, 102, 106, 109, 113, 117, 120, 124, 128, 131, + 135, 139, 142, 146, 150, 153, 157, 161, 164, 168, + 172, 175, 178, 180, 182, 184, 186, 189, 191, 194, + 196, 198, 201, 203, 205, 207, 209, 215, 221, 223, + 225, 227, 229, 231, 233, 235, 242, 249, 257, 265, + 276, 287, 297, 307, 315, 323, 329, 335, 342, 349, + 357, 365, 376, 387, 394, 402, 409, 415, 422, 427, + 429, 432, 436, 439, 443, 447, 452, 455, 461, 469, + 476, 480, 482, 486, 491, 498, 504, 506, 509, 514, + 519, 525, 531, 534, 538, 541, 545, 548, 552, 554, + 558, 561, 563, 566, 570, 574, 578, 583, 588, 593, + 598, 603, 605, 607, 609, 611, 613, 615, 616, 619, + 621, 624, 627, 632, 637, 641, 645, 647, 649, 652, + 655, 658, 661, 666, 671, 673, 675, 678 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int8 yyrhs[] = +{ + 62, 0, -1, 94, 91, -1, 51, -1, 1, 51, + -1, 52, -1, 26, -1, 63, 26, -1, 54, 26, + -1, 55, 26, -1, 29, 54, 26, -1, 29, 55, + 26, -1, 28, 54, 26, -1, 28, 55, 26, -1, + 35, 26, -1, 29, 35, 26, -1, 28, 35, 26, + -1, 47, 26, -1, 29, 47, 26, -1, 28, 47, + 26, -1, 46, 26, -1, 29, 46, 26, -1, 28, + 46, 26, -1, 36, 26, -1, 29, 36, 26, -1, + 28, 36, 26, -1, 43, 26, -1, 29, 43, 26, + -1, 28, 43, 26, -1, 38, 26, -1, 29, 38, + 26, -1, 28, 38, 26, -1, 37, 29, -1, 29, + 37, 29, -1, 28, 37, 29, -1, 39, 29, -1, + 29, 39, 29, -1, 28, 39, 29, -1, 37, 26, + -1, 29, 37, 26, -1, 28, 37, 26, -1, 39, + 26, -1, 29, 39, 26, -1, 28, 39, 26, -1, + 39, 56, -1, 29, 39, 56, -1, 28, 39, 56, + -1, 37, 56, -1, 29, 37, 56, -1, 28, 37, + 56, -1, 44, 26, -1, 45, 26, -1, 26, -1, + 27, -1, 64, -1, 64, -1, 66, 64, -1, 65, + -1, 67, 65, -1, 67, -1, 69, -1, 69, 66, + -1, 74, -1, 77, -1, 70, -1, 73, -1, 12, + 88, 14, 88, 15, -1, 13, 88, 14, 88, 15, + -1, 72, -1, 78, -1, 76, -1, 79, -1, 80, + -1, 81, -1, 71, -1, 10, 26, 93, 14, 88, + 15, -1, 10, 26, 93, 57, 88, 58, -1, 10, + 26, 50, 93, 14, 88, 15, -1, 10, 26, 50, + 93, 57, 88, 58, -1, 10, 26, 93, 21, 63, + 92, 93, 14, 88, 15, -1, 10, 26, 93, 21, + 63, 92, 93, 57, 88, 58, -1, 10, 26, 93, + 21, 92, 93, 14, 88, 15, -1, 10, 26, 93, + 21, 92, 93, 57, 88, 58, -1, 10, 31, 92, + 93, 14, 88, 15, -1, 10, 31, 92, 93, 57, + 88, 58, -1, 10, 31, 14, 88, 15, -1, 10, + 31, 57, 88, 58, -1, 11, 26, 93, 14, 87, + 15, -1, 11, 26, 93, 57, 87, 58, -1, 11, + 26, 50, 93, 14, 87, 15, -1, 11, 26, 50, + 93, 57, 87, 58, -1, 11, 26, 93, 21, 63, + 92, 93, 14, 87, 15, -1, 11, 26, 93, 21, + 63, 92, 93, 57, 87, 58, -1, 8, 26, 93, + 21, 93, 9, -1, 8, 26, 93, 21, 85, 93, + 9, -1, 8, 26, 93, 21, 83, 9, -1, 26, + 59, 60, 93, 75, -1, 16, 26, 59, 60, 93, + 75, -1, 16, 26, 93, 75, -1, 69, -1, 69, + 66, -1, 59, 88, 60, -1, 17, 69, -1, 17, + 69, 66, -1, 17, 26, 69, -1, 17, 26, 69, + 66, -1, 17, 67, -1, 3, 88, 4, 88, 7, + -1, 3, 88, 4, 88, 5, 88, 7, -1, 3, + 88, 4, 88, 82, 7, -1, 57, 88, 58, -1, + 30, -1, 18, 32, 19, -1, 6, 88, 4, 88, + -1, 6, 88, 4, 88, 5, 88, -1, 6, 88, + 4, 88, 82, -1, 84, -1, 85, 84, -1, 93, + 86, 60, 88, -1, 93, 86, 60, 93, -1, 93, + 59, 86, 60, 88, -1, 93, 59, 86, 60, 93, + -1, 84, 40, -1, 85, 84, 40, -1, 84, 41, + -1, 85, 84, 41, -1, 84, 42, -1, 85, 84, + 42, -1, 26, -1, 86, 53, 26, -1, 93, 89, + -1, 87, -1, 93, 90, -1, 90, 51, 93, -1, + 90, 49, 93, -1, 90, 50, 93, -1, 90, 33, + 93, 90, -1, 90, 34, 93, 90, -1, 90, 49, + 93, 90, -1, 90, 50, 93, 90, -1, 90, 51, + 93, 90, -1, 96, -1, 51, -1, 52, -1, 51, + -1, 50, -1, 52, -1, -1, 93, 51, -1, 95, + -1, 95, 49, -1, 95, 50, -1, 95, 33, 93, + 95, -1, 95, 34, 93, 95, -1, 95, 49, 95, + -1, 95, 50, 95, -1, 96, -1, 97, -1, 22, + 96, -1, 98, 96, -1, 98, 92, -1, 22, 92, + -1, 97, 53, 93, 97, -1, 97, 48, 93, 97, + -1, 68, -1, 23, -1, 23, 24, -1, 23, 24, + 25, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 377, 377, 388, 397, 412, 422, 424, 428, 434, + 440, 446, 452, 458, 464, 470, 476, 482, 488, 494, + 500, 506, 512, 518, 525, 532, 539, 546, 553, 560, + 566, 572, 578, 584, 590, 596, 602, 608, 614, 620, + 626, 632, 638, 644, 650, 656, 662, 668, 674, 680, + 686, 692, 700, 702, 704, 708, 712, 723, 725, 729, + 731, 733, 749, 751, 755, 757, 759, 761, 763, 765, + 767, 769, 771, 773, 775, 779, 784, 789, 794, 799, + 804, 809, 814, 821, 826, 831, 836, 843, 848, 853, + 858, 863, 868, 875, 880, 885, 892, 895, 898, 902, + 904, 935, 942, 947, 964, 969, 986, 993, 995, 997, + 1002, 1006, 1010, 1014, 1016, 1018, 1022, 1023, 1027, 1029, + 1031, 1033, 1037, 1039, 1041, 1043, 1045, 1047, 1051, 1053, + 1062, 1070, 1071, 1077, 1078, 1085, 1089, 1091, 1093, 1100, + 1102, 1104, 1108, 1109, 1112, 1114, 1116, 1120, 1121, 1130, + 1143, 1159, 1174, 1176, 1178, 1185, 1188, 1192, 1194, 1200, + 1206, 1223, 1243, 1245, 1268, 1272, 1274, 1276 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "IF", "THEN", "ELSE", "ELIF", "FI", + "CASE", "ESAC", "FOR", "SELECT", "WHILE", "UNTIL", "DO", "DONE", + "FUNCTION", "COPROC", "COND_START", "COND_END", "COND_ERROR", "IN", + "BANG", "TIME", "TIMEOPT", "TIMEIGN", "WORD", "ASSIGNMENT_WORD", + "REDIR_WORD", "NUMBER", "ARITH_CMD", "ARITH_FOR_EXPRS", "COND_CMD", + "AND_AND", "OR_OR", "GREATER_GREATER", "LESS_LESS", "LESS_AND", + "LESS_LESS_LESS", "GREATER_AND", "SEMI_SEMI", "SEMI_AND", + "SEMI_SEMI_AND", "LESS_LESS_MINUS", "AND_GREATER", "AND_GREATER_GREATER", + "LESS_GREATER", "GREATER_BAR", "BAR_AND", "'&'", "';'", "'\\n'", + "yacc_EOF", "'|'", "'>'", "'<'", "'-'", "'{'", "'}'", "'('", "')'", + "$accept", "inputunit", "word_list", "redirection", + "simple_command_element", "redirection_list", "simple_command", + "command", "shell_command", "for_command", "arith_for_command", + "select_command", "case_command", "function_def", "function_body", + "subshell", "coproc", "if_command", "group_command", "arith_command", + "cond_command", "elif_clause", "case_clause", "pattern_list", + "case_clause_sequence", "pattern", "list", "compound_list", "list0", + "list1", "simple_list_terminator", "list_terminator", "newline_list", + "simple_list", "simple_list1", "pipeline_command", "pipeline", + "timespec", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 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, 38, + 59, 10, 304, 124, 62, 60, 45, 123, 125, 40, + 41 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 61, 62, 62, 62, 62, 63, 63, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 65, 65, 65, 66, 66, 67, 67, 68, + 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, + 70, 70, 70, 71, 71, 71, 71, 72, 72, 72, + 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, + 75, 76, 77, 77, 77, 77, 77, 78, 78, 78, + 79, 80, 81, 82, 82, 82, 83, 83, 84, 84, + 84, 84, 85, 85, 85, 85, 85, 85, 86, 86, + 87, 88, 88, 89, 89, 89, 90, 90, 90, 90, + 90, 90, 91, 91, 92, 92, 92, 93, 93, 94, + 94, 94, 95, 95, 95, 95, 95, 96, 96, 96, + 96, 96, 97, 97, 97, 98, 98, 98 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 2, 1, 2, 1, 1, 2, 2, 2, + 3, 3, 3, 3, 2, 3, 3, 2, 3, 3, + 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, + 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, + 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, + 2, 2, 1, 1, 1, 1, 2, 1, 2, 1, + 1, 2, 1, 1, 1, 1, 5, 5, 1, 1, + 1, 1, 1, 1, 1, 6, 6, 7, 7, 10, + 10, 9, 9, 7, 7, 5, 5, 6, 6, 7, + 7, 10, 10, 6, 7, 6, 5, 6, 4, 1, + 2, 3, 2, 3, 3, 4, 2, 5, 7, 6, + 3, 1, 3, 4, 6, 5, 1, 2, 4, 4, + 5, 5, 2, 3, 2, 3, 2, 3, 1, 3, + 2, 1, 2, 3, 3, 3, 4, 4, 4, 4, + 4, 1, 1, 1, 1, 1, 1, 0, 2, 1, + 2, 2, 4, 4, 3, 3, 1, 1, 2, 2, + 2, 2, 4, 4, 1, 1, 2, 3 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 0, 0, 147, 0, 0, 0, 147, 147, 0, 0, + 0, 0, 165, 52, 53, 0, 0, 111, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, + 0, 0, 147, 147, 0, 54, 57, 59, 164, 60, + 64, 74, 68, 65, 62, 70, 63, 69, 71, 72, + 73, 0, 149, 156, 157, 0, 4, 131, 0, 0, + 147, 147, 0, 147, 0, 0, 147, 52, 106, 102, + 0, 145, 144, 146, 161, 158, 166, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 14, 23, + 38, 32, 47, 29, 41, 35, 44, 26, 50, 51, + 20, 17, 8, 9, 0, 0, 1, 52, 58, 55, + 61, 142, 143, 2, 147, 147, 150, 151, 147, 147, + 160, 159, 147, 148, 130, 132, 141, 0, 147, 0, + 147, 147, 147, 147, 0, 147, 147, 0, 0, 104, + 103, 112, 167, 147, 16, 25, 40, 34, 49, 31, + 43, 37, 46, 28, 22, 19, 12, 13, 15, 24, + 39, 33, 48, 30, 42, 36, 45, 27, 21, 18, + 10, 11, 110, 101, 56, 0, 0, 154, 155, 0, + 0, 0, 147, 147, 147, 147, 147, 147, 0, 147, + 0, 147, 0, 0, 0, 0, 147, 0, 147, 0, + 0, 147, 99, 98, 105, 0, 152, 153, 0, 0, + 163, 162, 147, 147, 107, 0, 0, 0, 134, 135, + 133, 0, 116, 147, 0, 147, 147, 0, 6, 0, + 147, 0, 85, 86, 147, 147, 147, 147, 0, 0, + 0, 0, 66, 67, 0, 100, 96, 0, 0, 109, + 136, 137, 138, 139, 140, 95, 122, 124, 126, 117, + 0, 93, 128, 0, 0, 0, 0, 75, 7, 147, + 0, 76, 0, 0, 0, 0, 87, 0, 147, 88, + 97, 108, 147, 147, 147, 147, 123, 125, 127, 94, + 0, 0, 147, 77, 78, 0, 147, 147, 83, 84, + 89, 90, 0, 113, 0, 0, 0, 147, 129, 118, + 119, 147, 147, 0, 0, 147, 147, 147, 115, 120, + 121, 0, 0, 81, 82, 0, 0, 114, 79, 80, + 91, 92 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 34, 239, 35, 36, 120, 37, 38, 39, 40, + 41, 42, 43, 44, 213, 45, 46, 47, 48, 49, + 50, 225, 231, 232, 233, 274, 57, 58, 134, 135, + 123, 74, 59, 51, 187, 136, 54, 55 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -208 +static const yytype_int16 yypact[] = +{ + 296, -35, -208, -2, 38, 10, -208, -208, 24, 546, + 31, 346, 51, 47, -208, 591, 604, -208, 56, 71, + -18, 112, 130, 115, 128, 136, 143, 154, -208, -208, + 157, 170, -208, -208, 111, -208, -208, 229, -208, 578, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -12, -3, -208, 48, 346, -208, -208, 208, 396, + -208, 73, 15, 163, 190, 201, 160, 107, 229, 578, + 204, -208, -208, -208, -208, -208, 195, 165, 202, 215, + 152, 216, 153, 222, 227, 236, 237, 244, 245, 253, + 158, 254, 171, 255, 256, 259, 261, 262, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, 231, 230, -208, -208, -208, -208, + 578, -208, -208, -208, -208, -208, 446, 446, -208, -208, + -208, -208, -208, -208, -208, 210, -208, 4, -208, 65, + -208, -208, -208, -208, 70, -208, -208, 232, 41, 578, + 578, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, 396, 396, 23, 23, 496, + 496, 97, -208, -208, -208, -208, -208, -208, 85, -208, + 185, -208, 276, 235, 100, 110, -208, 268, -208, 280, + 283, -208, 578, -208, 578, 41, -208, -208, 446, 446, + 48, 48, -208, -208, -208, 295, 396, 396, 396, 396, + 396, 294, 161, -208, 19, -208, -208, 290, -208, 200, + -208, 252, -208, -208, -208, -208, -208, -208, 302, 396, + 200, 269, -208, -208, 41, 578, -208, 313, 324, -208, + -208, -208, 55, 55, 55, -208, -208, -208, -208, 192, + 34, -208, -208, 303, -19, 315, 278, -208, -208, -208, + 114, -208, 322, 286, 323, 287, -208, 210, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + 8, 320, -208, -208, -208, 117, -208, -208, -208, -208, + -208, -208, 119, 167, 396, 396, 396, -208, -208, -208, + 396, -208, -208, 337, 307, -208, -208, -208, -208, -208, + 396, 345, 308, -208, -208, 352, 312, -208, -208, -208, + -208, -208 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -208, -208, 164, -37, -31, -62, 368, -208, -5, -208, + -208, -208, -208, -208, -206, -208, -208, -208, -208, -208, + -208, 66, -208, 145, -208, 88, -173, -6, -208, -207, + -208, -45, -48, -208, 5, 3, 17, -208 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -1 +static const yytype_uint16 yytable[] = +{ + 64, 65, 119, 53, 69, 52, 118, 150, 100, 256, + 130, 101, 137, 139, 75, 144, 56, 142, 148, 260, + 261, 262, 263, 264, 60, 197, 114, 115, 271, 140, + 124, 125, 119, 248, 301, 251, 63, 118, 102, 121, + 122, 302, 287, 299, 2, 272, 126, 127, 290, 3, + 66, 4, 5, 6, 7, 133, 124, 125, 131, 10, + 272, 301, 149, 70, 61, 71, 72, 73, 317, 62, + 133, 17, 141, 284, 285, 76, 185, 186, 273, 199, + 189, 190, 98, 184, 206, 133, 200, 214, 192, 193, + 198, 207, 133, 273, 204, 205, 128, 99, 32, 235, + 33, 129, 222, 223, 224, 215, 77, 262, 263, 264, + 2, 116, 119, 184, 244, 3, 133, 4, 5, 6, + 7, 133, 201, 138, 246, 10, 191, 208, 306, 53, + 53, 321, 188, 325, 202, 203, 133, 17, 103, 209, + 210, 107, 236, 212, 226, 227, 228, 229, 230, 234, + 255, 133, 335, 336, 108, 240, 104, 245, 249, 105, + 249, 133, 109, 254, 32, 133, 33, 247, 133, 110, + 133, 307, 327, 223, 322, 119, 326, 184, 156, 160, + 111, 157, 161, 112, 170, 270, 106, 171, 53, 53, + 216, 217, 280, 237, 279, 241, 113, 174, 249, 249, + 175, 266, 267, 268, 145, 288, 220, 221, 158, 162, + 212, 238, 132, 143, 172, 146, 257, 258, 184, 147, + 152, 53, 53, 151, 188, 153, 278, 176, 154, 275, + 276, 305, 296, 297, 298, 71, 72, 73, 282, 283, + 312, 155, 159, 192, 193, 314, 315, 316, 163, 212, + 71, 72, 73, 164, 320, 117, 14, 15, 16, 194, + 195, 196, 165, 166, 18, 19, 20, 21, 22, 330, + 167, 168, 23, 24, 25, 26, 27, 249, 249, 169, + 173, 177, 178, 30, 31, 179, 313, 180, 181, 182, + 183, 242, 211, 243, 238, 252, 319, 1, 253, 2, + 323, 324, 259, 265, 3, 277, 4, 5, 6, 7, + 281, 329, 8, 9, 10, 331, 332, 286, 11, 12, + 291, 337, 13, 14, 15, 16, 17, 289, 292, 272, + 303, 18, 19, 20, 21, 22, 304, 308, 310, 23, + 24, 25, 26, 27, 309, 311, 318, 28, 29, 2, + 30, 31, 333, 32, 3, 33, 4, 5, 6, 7, + 338, 300, 8, 9, 10, 334, 339, 340, 11, 12, + 341, 250, 13, 14, 15, 16, 17, 68, 269, 328, + 0, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 27, 0, 0, 71, 72, 73, 2, + 30, 31, 0, 32, 3, 33, 4, 5, 6, 7, + 0, 0, 8, 9, 10, 0, 0, 0, 11, 12, + 0, 0, 13, 14, 15, 16, 17, 0, 0, 0, + 0, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 27, 0, 0, 0, 133, 0, 2, + 30, 31, 0, 32, 3, 33, 4, 5, 6, 7, + 0, 0, 8, 9, 10, 0, 0, 0, 11, 12, + 0, 0, 13, 14, 15, 16, 17, 0, 0, 0, + 0, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 27, 0, 0, 0, 0, 0, 2, + 30, 31, 0, 32, 3, 33, 4, 5, 6, 7, + 0, 0, 8, 9, 10, 0, 0, 0, 0, 0, + 0, 0, 13, 14, 15, 16, 17, 0, 0, 0, + 0, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 27, 0, 0, 0, 133, 0, 2, + 30, 31, 0, 32, 3, 33, 4, 5, 6, 7, + 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, + 0, 0, 67, 14, 15, 16, 17, 0, 0, 0, + 0, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 27, 0, 0, 0, 0, 0, 0, + 30, 31, 0, 32, 0, 33, 15, 16, 0, 0, + 0, 0, 0, 18, 19, 20, 21, 22, 0, 0, + 0, 23, 24, 25, 26, 27, 78, 79, 80, 81, + 82, 0, 30, 31, 83, 0, 0, 84, 85, 88, + 89, 90, 91, 92, 0, 86, 87, 93, 0, 0, + 94, 95, 0, 0, 0, 0, 0, 0, 96, 97 +}; + +static const yytype_int16 yycheck[] = +{ + 6, 7, 39, 0, 9, 0, 37, 69, 26, 215, + 55, 29, 60, 61, 11, 63, 51, 62, 66, 226, + 227, 228, 229, 230, 26, 21, 32, 33, 9, 14, + 33, 34, 69, 206, 53, 208, 26, 68, 56, 51, + 52, 60, 249, 9, 3, 26, 49, 50, 254, 8, + 26, 10, 11, 12, 13, 51, 33, 34, 55, 18, + 26, 53, 67, 32, 26, 50, 51, 52, 60, 31, + 51, 30, 57, 246, 247, 24, 124, 125, 59, 14, + 128, 129, 26, 120, 14, 51, 21, 149, 33, 34, + 138, 21, 51, 59, 142, 143, 48, 26, 57, 14, + 59, 53, 5, 6, 7, 153, 59, 314, 315, 316, + 3, 0, 149, 150, 14, 8, 51, 10, 11, 12, + 13, 51, 57, 50, 14, 18, 132, 57, 14, 126, + 127, 14, 127, 14, 140, 141, 51, 30, 26, 145, + 146, 26, 57, 148, 192, 193, 194, 195, 196, 197, + 212, 51, 325, 326, 26, 200, 26, 57, 206, 29, + 208, 51, 26, 211, 57, 51, 59, 57, 51, 26, + 51, 57, 5, 6, 57, 212, 57, 214, 26, 26, + 26, 29, 29, 26, 26, 233, 56, 29, 185, 186, + 185, 186, 240, 199, 239, 201, 26, 26, 246, 247, + 29, 40, 41, 42, 14, 250, 189, 190, 56, 56, + 215, 26, 4, 50, 56, 14, 222, 223, 255, 59, + 25, 218, 219, 19, 219, 60, 26, 56, 26, 235, + 236, 279, 40, 41, 42, 50, 51, 52, 244, 245, + 288, 26, 26, 33, 34, 293, 294, 295, 26, 254, + 50, 51, 52, 26, 302, 26, 27, 28, 29, 49, + 50, 51, 26, 26, 35, 36, 37, 38, 39, 317, + 26, 26, 43, 44, 45, 46, 47, 325, 326, 26, + 26, 26, 26, 54, 55, 26, 292, 26, 26, 58, + 60, 15, 60, 58, 26, 15, 302, 1, 15, 3, + 306, 307, 7, 9, 8, 15, 10, 11, 12, 13, + 58, 317, 16, 17, 18, 321, 322, 15, 22, 23, + 7, 327, 26, 27, 28, 29, 30, 58, 4, 26, + 15, 35, 36, 37, 38, 39, 58, 15, 15, 43, + 44, 45, 46, 47, 58, 58, 26, 51, 52, 3, + 54, 55, 15, 57, 8, 59, 10, 11, 12, 13, + 15, 273, 16, 17, 18, 58, 58, 15, 22, 23, + 58, 207, 26, 27, 28, 29, 30, 9, 233, 313, + -1, 35, 36, 37, 38, 39, -1, -1, -1, 43, + 44, 45, 46, 47, -1, -1, 50, 51, 52, 3, + 54, 55, -1, 57, 8, 59, 10, 11, 12, 13, + -1, -1, 16, 17, 18, -1, -1, -1, 22, 23, + -1, -1, 26, 27, 28, 29, 30, -1, -1, -1, + -1, 35, 36, 37, 38, 39, -1, -1, -1, 43, + 44, 45, 46, 47, -1, -1, -1, 51, -1, 3, + 54, 55, -1, 57, 8, 59, 10, 11, 12, 13, + -1, -1, 16, 17, 18, -1, -1, -1, 22, 23, + -1, -1, 26, 27, 28, 29, 30, -1, -1, -1, + -1, 35, 36, 37, 38, 39, -1, -1, -1, 43, + 44, 45, 46, 47, -1, -1, -1, -1, -1, 3, + 54, 55, -1, 57, 8, 59, 10, 11, 12, 13, + -1, -1, 16, 17, 18, -1, -1, -1, -1, -1, + -1, -1, 26, 27, 28, 29, 30, -1, -1, -1, + -1, 35, 36, 37, 38, 39, -1, -1, -1, 43, + 44, 45, 46, 47, -1, -1, -1, 51, -1, 3, + 54, 55, -1, 57, 8, 59, 10, 11, 12, 13, + -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, + -1, -1, 26, 27, 28, 29, 30, -1, -1, -1, + -1, 35, 36, 37, 38, 39, -1, -1, -1, 43, + 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, + 54, 55, -1, 57, -1, 59, 28, 29, -1, -1, + -1, -1, -1, 35, 36, 37, 38, 39, -1, -1, + -1, 43, 44, 45, 46, 47, 35, 36, 37, 38, + 39, -1, 54, 55, 43, -1, -1, 46, 47, 35, + 36, 37, 38, 39, -1, 54, 55, 43, -1, -1, + 46, 47, -1, -1, -1, -1, -1, -1, 54, 55 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 1, 3, 8, 10, 11, 12, 13, 16, 17, + 18, 22, 23, 26, 27, 28, 29, 30, 35, 36, + 37, 38, 39, 43, 44, 45, 46, 47, 51, 52, + 54, 55, 57, 59, 62, 64, 65, 67, 68, 69, + 70, 71, 72, 73, 74, 76, 77, 78, 79, 80, + 81, 94, 95, 96, 97, 98, 51, 87, 88, 93, + 26, 26, 31, 26, 88, 88, 26, 26, 67, 69, + 32, 50, 51, 52, 92, 96, 24, 59, 35, 36, + 37, 38, 39, 43, 46, 47, 54, 55, 35, 36, + 37, 38, 39, 43, 46, 47, 54, 55, 26, 26, + 26, 29, 56, 26, 26, 29, 56, 26, 26, 26, + 26, 26, 26, 26, 88, 88, 0, 26, 65, 64, + 66, 51, 52, 91, 33, 34, 49, 50, 48, 53, + 92, 96, 4, 51, 89, 90, 96, 93, 50, 93, + 14, 57, 92, 50, 93, 14, 14, 59, 93, 69, + 66, 19, 25, 60, 26, 26, 26, 29, 56, 26, + 26, 29, 56, 26, 26, 26, 26, 26, 26, 26, + 26, 29, 56, 26, 26, 29, 56, 26, 26, 26, + 26, 26, 58, 60, 64, 93, 93, 95, 95, 93, + 93, 88, 33, 34, 49, 50, 51, 21, 93, 14, + 21, 57, 88, 88, 93, 93, 14, 21, 57, 88, + 88, 60, 69, 75, 66, 93, 95, 95, 49, 50, + 97, 97, 5, 6, 7, 82, 93, 93, 93, 93, + 93, 83, 84, 85, 93, 14, 57, 88, 26, 63, + 92, 88, 15, 58, 14, 57, 14, 57, 87, 93, + 63, 87, 15, 15, 93, 66, 75, 88, 88, 7, + 90, 90, 90, 90, 90, 9, 40, 41, 42, 84, + 93, 9, 26, 59, 86, 88, 88, 15, 26, 92, + 93, 58, 88, 88, 87, 87, 15, 90, 92, 58, + 75, 7, 4, 49, 50, 51, 40, 41, 42, 9, + 86, 53, 60, 15, 58, 93, 14, 57, 15, 58, + 15, 58, 93, 88, 93, 93, 93, 60, 26, 88, + 93, 14, 57, 88, 88, 14, 57, 5, 82, 88, + 93, 88, 88, 15, 58, 87, 87, 88, 15, 58, + 15, 58 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +#else +static void +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; +#endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + fprintf (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) +{ + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } +} +#endif /* YYERROR_VERBOSE */ + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + YYUSE (yyvaluep); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} + + +/* Prevent warnings from -Wmissing-prototypes. */ + +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + + +/* The look-ahead symbol. */ +int yychar; + +/* The semantic value of the look-ahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void) +#else +int +yyparse () + +#endif +#endif +{ + + int yystate; + int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to look-ahead token. */ + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a look-ahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + if (yyn == YYFINAL) + YYACCEPT; + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + yystate = yyn; + *++yyvsp = yylval; + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: +#line 378 "/usr/homes/chet/src/bash/src/parse.y" + { + /* Case of regular command. Discard the error + safety net,and return the command just parsed. */ + global_command = (yyvsp[(1) - (2)].command); + eof_encountered = 0; + /* discard_parser_constructs (0); */ + if (parser_state & PST_CMDSUBST) + parser_state |= PST_EOFTOKEN; + YYACCEPT; + } + break; + + case 3: +#line 389 "/usr/homes/chet/src/bash/src/parse.y" + { + /* Case of regular command, but not a very + interesting one. Return a NULL command. */ + global_command = (COMMAND *)NULL; + if (parser_state & PST_CMDSUBST) + parser_state |= PST_EOFTOKEN; + YYACCEPT; + } + break; + + case 4: +#line 398 "/usr/homes/chet/src/bash/src/parse.y" + { + /* Error during parsing. Return NULL command. */ + global_command = (COMMAND *)NULL; + eof_encountered = 0; + /* discard_parser_constructs (1); */ + if (interactive && parse_and_execute_level == 0) + { + YYACCEPT; + } + else + { + YYABORT; + } + } + break; + + case 5: +#line 413 "/usr/homes/chet/src/bash/src/parse.y" + { + /* Case of EOF seen by itself. Do ignoreeof or + not. */ + global_command = (COMMAND *)NULL; + handle_eof_input_unit (); + YYACCEPT; + } + break; + + case 6: +#line 423 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); } + break; + + case 7: +#line 425 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(2) - (2)].word), (yyvsp[(1) - (2)].word_list)); } + break; + + case 8: +#line 429 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_output_direction, redir, 0); + } + break; + + case 9: +#line 435 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_input_direction, redir, 0); + } + break; + + case 10: +#line 441 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_output_direction, redir, 0); + } + break; + + case 11: +#line 447 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_input_direction, redir, 0); + } + break; + + case 12: +#line 453 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_output_direction, redir, REDIR_VARASSIGN); + } + break; + + case 13: +#line 459 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_input_direction, redir, REDIR_VARASSIGN); + } + break; + + case 14: +#line 465 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_appending_to, redir, 0); + } + break; + + case 15: +#line 471 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_appending_to, redir, 0); + } + break; + + case 16: +#line 477 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_appending_to, redir, REDIR_VARASSIGN); + } + break; + + case 17: +#line 483 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_output_force, redir, 0); + } + break; + + case 18: +#line 489 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_output_force, redir, 0); + } + break; + + case 19: +#line 495 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_output_force, redir, REDIR_VARASSIGN); + } + break; + + case 20: +#line 501 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_input_output, redir, 0); + } + break; + + case 21: +#line 507 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_input_output, redir, 0); + } + break; + + case 22: +#line 513 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_input_output, redir, REDIR_VARASSIGN); + } + break; + + case 23: +#line 519 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_reading_until, redir, 0); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 24: +#line 526 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_reading_until, redir, 0); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 25: +#line 533 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 26: +#line 540 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, 0); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 27: +#line 547 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, 0); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 28: +#line 554 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 29: +#line 561 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_reading_string, redir, 0); + } + break; + + case 30: +#line 567 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_reading_string, redir, 0); + } + break; + + case 31: +#line 573 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_reading_string, redir, REDIR_VARASSIGN); + } + break; + + case 32: +#line 579 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.dest = (yyvsp[(2) - (2)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_input, redir, 0); + } + break; + + case 33: +#line 585 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = (yyvsp[(3) - (3)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_input, redir, 0); + } + break; + + case 34: +#line 591 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = (yyvsp[(3) - (3)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_input, redir, REDIR_VARASSIGN); + } + break; + + case 35: +#line 597 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.dest = (yyvsp[(2) - (2)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_output, redir, 0); + } + break; + + case 36: +#line 603 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = (yyvsp[(3) - (3)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_output, redir, 0); + } + break; + + case 37: +#line 609 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = (yyvsp[(3) - (3)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_output, redir, REDIR_VARASSIGN); + } + break; + + case 38: +#line 615 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_input_word, redir, 0); + } + break; + + case 39: +#line 621 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_input_word, redir, 0); + } + break; + + case 40: +#line 627 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_input_word, redir, REDIR_VARASSIGN); + } + break; + + case 41: +#line 633 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_output_word, redir, 0); + } + break; + + case 42: +#line 639 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_output_word, redir, 0); + } + break; + + case 43: +#line 645 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_output_word, redir, REDIR_VARASSIGN); + } + break; + + case 44: +#line 651 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, 0); + } + break; + + case 45: +#line 657 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, 0); + } + break; + + case 46: +#line 663 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, REDIR_VARASSIGN); + } + break; + + case 47: +#line 669 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, 0); + } + break; + + case 48: +#line 675 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, 0); + } + break; + + case 49: +#line 681 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, REDIR_VARASSIGN); + } + break; + + case 50: +#line 687 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_err_and_out, redir, 0); + } + break; + + case 51: +#line 693 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_append_err_and_out, redir, 0); + } + break; + + case 52: +#line 701 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; } + break; + + case 53: +#line 703 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; } + break; + + case 54: +#line 705 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.element).redirect = (yyvsp[(1) - (1)].redirect); (yyval.element).word = 0; } + break; + + case 55: +#line 709 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.redirect) = (yyvsp[(1) - (1)].redirect); + } + break; + + case 56: +#line 713 "/usr/homes/chet/src/bash/src/parse.y" + { + register REDIRECT *t; + + for (t = (yyvsp[(1) - (2)].redirect); t->next; t = t->next) + ; + t->next = (yyvsp[(2) - (2)].redirect); + (yyval.redirect) = (yyvsp[(1) - (2)].redirect); + } + break; + + case 57: +#line 724 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_simple_command ((yyvsp[(1) - (1)].element), (COMMAND *)NULL); } + break; + + case 58: +#line 726 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_simple_command ((yyvsp[(2) - (2)].element), (yyvsp[(1) - (2)].command)); } + break; + + case 59: +#line 730 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = clean_simple_command ((yyvsp[(1) - (1)].command)); } + break; + + case 60: +#line 732 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 61: +#line 734 "/usr/homes/chet/src/bash/src/parse.y" + { + COMMAND *tc; + + tc = (yyvsp[(1) - (2)].command); + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = (yyvsp[(2) - (2)].redirect); + } + else + tc->redirects = (yyvsp[(2) - (2)].redirect); + (yyval.command) = (yyvsp[(1) - (2)].command); + } + break; + + case 62: +#line 750 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 63: +#line 752 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 64: +#line 756 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 65: +#line 758 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 66: +#line 760 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_while_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); } + break; + + case 67: +#line 762 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_until_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); } + break; + + case 68: +#line 764 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 69: +#line 766 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 70: +#line 768 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 71: +#line 770 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 72: +#line 772 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 73: +#line 774 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 74: +#line 776 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 75: +#line 780 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 76: +#line 785 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 77: +#line 790 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 78: +#line 795 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 79: +#line 800 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 80: +#line 805 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 81: +#line 810 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 82: +#line 815 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 83: +#line 822 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno); + if (word_top > 0) word_top--; + } + break; + + case 84: +#line 827 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno); + if (word_top > 0) word_top--; + } + break; + + case 85: +#line 832 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno); + if (word_top > 0) word_top--; + } + break; + + case 86: +#line 837 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno); + if (word_top > 0) word_top--; + } + break; + + case 87: +#line 844 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 88: +#line 849 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 89: +#line 854 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 90: +#line 859 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 91: +#line 864 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 92: +#line 869 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 93: +#line 876 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (PATTERN_LIST *)NULL, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 94: +#line 881 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_case_command ((yyvsp[(2) - (7)].word), (yyvsp[(5) - (7)].pattern), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 95: +#line 886 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (yyvsp[(5) - (6)].pattern), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 96: +#line 893 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_function_def ((yyvsp[(1) - (5)].word), (yyvsp[(5) - (5)].command), function_dstart, function_bstart); } + break; + + case 97: +#line 896 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_function_def ((yyvsp[(2) - (6)].word), (yyvsp[(6) - (6)].command), function_dstart, function_bstart); } + break; + + case 98: +#line 899 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_function_def ((yyvsp[(2) - (4)].word), (yyvsp[(4) - (4)].command), function_dstart, function_bstart); } + break; + + case 99: +#line 903 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 100: +#line 905 "/usr/homes/chet/src/bash/src/parse.y" + { + COMMAND *tc; + + tc = (yyvsp[(1) - (2)].command); + /* According to Posix.2 3.9.5, redirections + specified after the body of a function should + be attached to the function and performed when + the function is executed, not as part of the + function definition command. */ + /* XXX - I don't think it matters, but we might + want to change this in the future to avoid + problems differentiating between a function + definition with a redirection and a function + definition containing a single command with a + redirection. The two are semantically equivalent, + though -- the only difference is in how the + command printing code displays the redirections. */ + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = (yyvsp[(2) - (2)].redirect); + } + else + tc->redirects = (yyvsp[(2) - (2)].redirect); + (yyval.command) = (yyvsp[(1) - (2)].command); + } + break; + + case 101: +#line 936 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_subshell_command ((yyvsp[(2) - (3)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL; + } + break; + + case 102: +#line 943 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_coproc_command ("COPROC", (yyvsp[(2) - (2)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + break; + + case 103: +#line 948 "/usr/homes/chet/src/bash/src/parse.y" + { + COMMAND *tc; + + tc = (yyvsp[(2) - (3)].command); + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = (yyvsp[(3) - (3)].redirect); + } + else + tc->redirects = (yyvsp[(3) - (3)].redirect); + (yyval.command) = make_coproc_command ("COPROC", (yyvsp[(2) - (3)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + break; + + case 104: +#line 965 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_coproc_command ((yyvsp[(2) - (3)].word)->word, (yyvsp[(3) - (3)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + break; + + case 105: +#line 970 "/usr/homes/chet/src/bash/src/parse.y" + { + COMMAND *tc; + + tc = (yyvsp[(3) - (4)].command); + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = (yyvsp[(4) - (4)].redirect); + } + else + tc->redirects = (yyvsp[(4) - (4)].redirect); + (yyval.command) = make_coproc_command ((yyvsp[(2) - (4)].word)->word, (yyvsp[(3) - (4)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + break; + + case 106: +#line 987 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_coproc_command ("COPROC", clean_simple_command ((yyvsp[(2) - (2)].command))); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + break; + + case 107: +#line 994 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (COMMAND *)NULL); } + break; + + case 108: +#line 996 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (7)].command), (yyvsp[(4) - (7)].command), (yyvsp[(6) - (7)].command)); } + break; + + case 109: +#line 998 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(5) - (6)].command)); } + break; + + case 110: +#line 1003 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_group_command ((yyvsp[(2) - (3)].command)); } + break; + + case 111: +#line 1007 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_arith_command ((yyvsp[(1) - (1)].word_list)); } + break; + + case 112: +#line 1011 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(2) - (3)].command); } + break; + + case 113: +#line 1015 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (4)].command), (yyvsp[(4) - (4)].command), (COMMAND *)NULL); } + break; + + case 114: +#line 1017 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(6) - (6)].command)); } + break; + + case 115: +#line 1019 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (yyvsp[(5) - (5)].command)); } + break; + + case 117: +#line 1024 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(2) - (2)].pattern)->next = (yyvsp[(1) - (2)].pattern); (yyval.pattern) = (yyvsp[(2) - (2)].pattern); } + break; + + case 118: +#line 1028 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (yyvsp[(4) - (4)].command)); } + break; + + case 119: +#line 1030 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (COMMAND *)NULL); } + break; + + case 120: +#line 1032 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (yyvsp[(5) - (5)].command)); } + break; + + case 121: +#line 1034 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (COMMAND *)NULL); } + break; + + case 122: +#line 1038 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.pattern) = (yyvsp[(1) - (2)].pattern); } + break; + + case 123: +#line 1040 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); } + break; + + case 124: +#line 1042 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); } + break; + + case 125: +#line 1044 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); } + break; + + case 126: +#line 1046 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_TESTNEXT; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); } + break; + + case 127: +#line 1048 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_TESTNEXT; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); } + break; + + case 128: +#line 1052 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); } + break; + + case 129: +#line 1054 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(3) - (3)].word), (yyvsp[(1) - (3)].word_list)); } + break; + + case 130: +#line 1063 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = (yyvsp[(2) - (2)].command); + if (need_here_doc) + gather_here_documents (); + } + break; + + case 132: +#line 1072 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = (yyvsp[(2) - (2)].command); + } + break; + + case 134: +#line 1079 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(1) - (3)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (3)].command), (COMMAND *)NULL, '&'); + else + (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (COMMAND *)NULL, '&'); + } + break; + + case 136: +#line 1090 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); } + break; + + case 137: +#line 1092 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); } + break; + + case 138: +#line 1094 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(1) - (4)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '&'); + else + (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '&'); + } + break; + + case 139: +#line 1101 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); } + break; + + case 140: +#line 1103 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); } + break; + + case 141: +#line 1105 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 144: +#line 1113 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = '\n'; } + break; + + case 145: +#line 1115 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = ';'; } + break; + + case 146: +#line 1117 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = yacc_EOF; } + break; + + case 149: +#line 1131 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = (yyvsp[(1) - (1)].command); + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = (yyvsp[(1) - (1)].command); + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + break; + + case 150: +#line 1144 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(1) - (2)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (2)].command), (COMMAND *)NULL, '&'); + else + (yyval.command) = command_connect ((yyvsp[(1) - (2)].command), (COMMAND *)NULL, '&'); + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = (yyvsp[(1) - (2)].command); + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + break; + + case 151: +#line 1160 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = (yyvsp[(1) - (2)].command); + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = (yyvsp[(1) - (2)].command); + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + break; + + case 152: +#line 1175 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); } + break; + + case 153: +#line 1177 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); } + break; + + case 154: +#line 1179 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(1) - (3)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), '&'); + else + (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), '&'); + } + break; + + case 155: +#line 1186 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), ';'); } + break; + + case 156: +#line 1189 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 157: +#line 1193 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 158: +#line 1195 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(2) - (2)].command)) + (yyvsp[(2) - (2)].command)->flags ^= CMD_INVERT_RETURN; /* toggle */ + (yyval.command) = (yyvsp[(2) - (2)].command); + } + break; + + case 159: +#line 1201 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(2) - (2)].command)) + (yyvsp[(2) - (2)].command)->flags |= (yyvsp[(1) - (2)].number); + (yyval.command) = (yyvsp[(2) - (2)].command); + } + break; + + case 160: +#line 1207 "/usr/homes/chet/src/bash/src/parse.y" + { + ELEMENT x; + + /* Boy, this is unclean. `time' by itself can + time a null command. We cheat and push a + newline back if the list_terminator was a newline + to avoid the double-newline problem (one to + terminate this, one to terminate the command) */ + x.word = 0; + x.redirect = 0; + (yyval.command) = make_simple_command (x, (COMMAND *)NULL); + (yyval.command)->flags |= (yyvsp[(1) - (2)].number); + /* XXX - let's cheat and push a newline back */ + if ((yyvsp[(2) - (2)].number) == '\n') + token_to_read = '\n'; + } + break; + + case 161: +#line 1224 "/usr/homes/chet/src/bash/src/parse.y" + { + ELEMENT x; + + /* This is just as unclean. Posix says that `!' + by itself should be equivalent to `false'. + We cheat and push a + newline back if the list_terminator was a newline + to avoid the double-newline problem (one to + terminate this, one to terminate the command) */ + x.word = 0; + x.redirect = 0; + (yyval.command) = make_simple_command (x, (COMMAND *)NULL); + (yyval.command)->flags |= CMD_INVERT_RETURN; + /* XXX - let's cheat and push a newline back */ + if ((yyvsp[(2) - (2)].number) == '\n') + token_to_read = '\n'; + } + break; + + case 162: +#line 1244 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '|'); } + break; + + case 163: +#line 1246 "/usr/homes/chet/src/bash/src/parse.y" + { + /* Make cmd1 |& cmd2 equivalent to cmd1 2>&1 | cmd2 */ + COMMAND *tc; + REDIRECTEE rd, sd; + REDIRECT *r; + + tc = (yyvsp[(1) - (4)].command)->type == cm_simple ? (COMMAND *)(yyvsp[(1) - (4)].command)->value.Simple : (yyvsp[(1) - (4)].command); + sd.dest = 2; + rd.dest = 1; + r = make_redirection (sd, r_duplicating_output, rd, 0); + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = r; + } + else + tc->redirects = r; + + (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '|'); + } + break; + + case 164: +#line 1269 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 165: +#line 1273 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = CMD_TIME_PIPELINE; } + break; + + case 166: +#line 1275 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } + break; + + case 167: +#line 1277 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } + break; + + +/* Line 1267 of yacc.c. */ +#line 3377 "y.tab.c" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse look-ahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse look-ahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + if (yyn == YYFINAL) + YYACCEPT; + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#ifndef yyoverflow +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); +} + + +#line 1279 "/usr/homes/chet/src/bash/src/parse.y" + + +/* Initial size to allocate for tokens, and the + amount to grow them by. */ +#define TOKEN_DEFAULT_INITIAL_SIZE 496 +#define TOKEN_DEFAULT_GROW_SIZE 512 + +/* Should we call prompt_again? */ +#define SHOULD_PROMPT() \ + (interactive && (bash_input.type == st_stdin || bash_input.type == st_stream)) + +#if defined (ALIAS) +# define expanding_alias() (pushed_string_list && pushed_string_list->expander) +#else +# define expanding_alias() 0 +#endif + +/* Global var is non-zero when end of file has been reached. */ +int EOF_Reached = 0; + +#ifdef DEBUG +static void +debug_parser (i) + int i; +{ +#if YYDEBUG != 0 + yydebug = i; +#endif +} +#endif + +/* yy_getc () returns the next available character from input or EOF. + yy_ungetc (c) makes `c' the next character to read. + init_yy_io (get, unget, type, location) makes the function GET the + installed function for getting the next character, makes UNGET the + installed function for un-getting a character, sets the type of stream + (either string or file) from TYPE, and makes LOCATION point to where + the input is coming from. */ + +/* Unconditionally returns end-of-file. */ +int +return_EOF () +{ + return (EOF); +} + +/* Variable containing the current get and unget functions. + See ./input.h for a clearer description. */ +BASH_INPUT bash_input; + +/* Set all of the fields in BASH_INPUT to NULL. Free bash_input.name if it + is non-null, avoiding a memory leak. */ +void +initialize_bash_input () +{ + bash_input.type = st_none; + FREE (bash_input.name); + bash_input.name = (char *)NULL; + bash_input.location.file = (FILE *)NULL; + bash_input.location.string = (char *)NULL; + bash_input.getter = (sh_cget_func_t *)NULL; + bash_input.ungetter = (sh_cunget_func_t *)NULL; +} + +/* Set the contents of the current bash input stream from + GET, UNGET, TYPE, NAME, and LOCATION. */ +void +init_yy_io (get, unget, type, name, location) + sh_cget_func_t *get; + sh_cunget_func_t *unget; + enum stream_type type; + const char *name; + INPUT_STREAM location; +{ + bash_input.type = type; + FREE (bash_input.name); + bash_input.name = name ? savestring (name) : (char *)NULL; + + /* XXX */ +#if defined (CRAY) + memcpy((char *)&bash_input.location.string, (char *)&location.string, sizeof(location)); +#else + bash_input.location = location; +#endif + bash_input.getter = get; + bash_input.ungetter = unget; +} + +char * +yy_input_name () +{ + return (bash_input.name ? bash_input.name : "stdin"); +} + +/* Call this to get the next character of input. */ +static int +yy_getc () +{ + return (*(bash_input.getter)) (); +} + +/* Call this to unget C. That is, to make C the next character + to be read. */ +static int +yy_ungetc (c) + int c; +{ + return (*(bash_input.ungetter)) (c); +} + +#if defined (BUFFERED_INPUT) +#ifdef INCLUDE_UNUSED +int +input_file_descriptor () +{ + switch (bash_input.type) + { + case st_stream: + return (fileno (bash_input.location.file)); + case st_bstream: + return (bash_input.location.buffered_fd); + case st_stdin: + default: + return (fileno (stdin)); + } +} +#endif +#endif /* BUFFERED_INPUT */ + +/* **************************************************************** */ +/* */ +/* Let input be read from readline (). */ +/* */ +/* **************************************************************** */ + +#if defined (READLINE) +char *current_readline_prompt = (char *)NULL; +char *current_readline_line = (char *)NULL; +int current_readline_line_index = 0; + +static int +yy_readline_get () +{ + SigHandler *old_sigint; + int line_len; + unsigned char c; + + if (!current_readline_line) + { + if (!bash_readline_initialized) + initialize_readline (); + +#if defined (JOB_CONTROL) + if (job_control) + give_terminal_to (shell_pgrp, 0); +#endif /* JOB_CONTROL */ + + old_sigint = (SigHandler *)IMPOSSIBLE_TRAP_HANDLER; + if (signal_is_ignored (SIGINT) == 0) + { + /* interrupt_immediately++; */ + old_sigint = (SigHandler *)set_signal_handler (SIGINT, sigint_sighandler); + } + + current_readline_line = readline (current_readline_prompt ? + current_readline_prompt : ""); + + CHECK_TERMSIG; + if (signal_is_ignored (SIGINT) == 0) + { + /* interrupt_immediately--; */ + if (old_sigint != IMPOSSIBLE_TRAP_HANDLER) + set_signal_handler (SIGINT, old_sigint); + } + +#if 0 + /* Reset the prompt to the decoded value of prompt_string_pointer. */ + reset_readline_prompt (); +#endif + + if (current_readline_line == 0) + return (EOF); + + current_readline_line_index = 0; + line_len = strlen (current_readline_line); + + current_readline_line = (char *)xrealloc (current_readline_line, 2 + line_len); + current_readline_line[line_len++] = '\n'; + current_readline_line[line_len] = '\0'; + } + + if (current_readline_line[current_readline_line_index] == 0) + { + free (current_readline_line); + current_readline_line = (char *)NULL; + return (yy_readline_get ()); + } + else + { + c = current_readline_line[current_readline_line_index++]; + return (c); + } +} + +static int +yy_readline_unget (c) + int c; +{ + if (current_readline_line_index && current_readline_line) + current_readline_line[--current_readline_line_index] = c; + return (c); +} + +void +with_input_from_stdin () +{ + INPUT_STREAM location; + + if (bash_input.type != st_stdin && stream_on_stack (st_stdin) == 0) + { + location.string = current_readline_line; + init_yy_io (yy_readline_get, yy_readline_unget, + st_stdin, "readline stdin", location); + } +} + +#else /* !READLINE */ + +void +with_input_from_stdin () +{ + with_input_from_stream (stdin, "stdin"); +} +#endif /* !READLINE */ + +/* **************************************************************** */ +/* */ +/* Let input come from STRING. STRING is zero terminated. */ +/* */ +/* **************************************************************** */ + +static int +yy_string_get () +{ + register char *string; + register unsigned char c; + + string = bash_input.location.string; + + /* If the string doesn't exist, or is empty, EOF found. */ + if (string && *string) + { + c = *string++; + bash_input.location.string = string; + return (c); + } + else + return (EOF); +} + +static int +yy_string_unget (c) + int c; +{ + *(--bash_input.location.string) = c; + return (c); +} + +void +with_input_from_string (string, name) + char *string; + const char *name; +{ + INPUT_STREAM location; + + location.string = string; + init_yy_io (yy_string_get, yy_string_unget, st_string, name, location); +} + +/* Count the number of characters we've consumed from bash_input.location.string + and read into shell_input_line, but have not returned from shell_getc. + That is the true input location. Rewind bash_input.location.string by + that number of characters, so it points to the last character actually + consumed by the parser. */ +static void +rewind_input_string () +{ + int xchars; + + /* number of unconsumed characters in the input -- XXX need to take newlines + into account, e.g., $(...\n) */ + xchars = shell_input_line_len - shell_input_line_index; + if (bash_input.location.string[-1] == '\n') + xchars++; + + /* XXX - how to reflect bash_input.location.string back to string passed to + parse_and_execute or xparse_dolparen? xparse_dolparen needs to know how + far into the string we parsed. parse_and_execute knows where bash_input. + location.string is, and how far from orig_string that is -- that's the + number of characters the command consumed. */ + + /* bash_input.location.string - xchars should be where we parsed to */ + /* need to do more validation on xchars value for sanity -- test cases. */ + bash_input.location.string -= xchars; +} + +/* **************************************************************** */ +/* */ +/* Let input come from STREAM. */ +/* */ +/* **************************************************************** */ + +/* These two functions used to test the value of the HAVE_RESTARTABLE_SYSCALLS + define, and just use getc/ungetc if it was defined, but since bash + installs its signal handlers without the SA_RESTART flag, some signals + (like SIGCHLD, SIGWINCH, etc.) received during a read(2) will not cause + the read to be restarted. We need to restart it ourselves. */ + +static int +yy_stream_get () +{ + int result; + + result = EOF; + if (bash_input.location.file) + { +#if 0 + if (interactive) + interrupt_immediately++; +#endif + + /* XXX - don't need terminate_immediately; getc_with_restart checks + for terminating signals itself if read returns < 0 */ + result = getc_with_restart (bash_input.location.file); + +#if 0 + if (interactive) + interrupt_immediately--; +#endif + } + return (result); +} + +static int +yy_stream_unget (c) + int c; +{ + return (ungetc_with_restart (c, bash_input.location.file)); +} + +void +with_input_from_stream (stream, name) + FILE *stream; + const char *name; +{ + INPUT_STREAM location; + + location.file = stream; + init_yy_io (yy_stream_get, yy_stream_unget, st_stream, name, location); +} + +typedef struct stream_saver { + struct stream_saver *next; + BASH_INPUT bash_input; + int line; +#if defined (BUFFERED_INPUT) + BUFFERED_STREAM *bstream; +#endif /* BUFFERED_INPUT */ +} STREAM_SAVER; + +/* The globally known line number. */ +int line_number = 0; + +/* The line number offset set by assigning to LINENO. Not currently used. */ +int line_number_base = 0; + +#if defined (COND_COMMAND) +static int cond_lineno; +static int cond_token; +#endif + +STREAM_SAVER *stream_list = (STREAM_SAVER *)NULL; + +void +push_stream (reset_lineno) + int reset_lineno; +{ + STREAM_SAVER *saver = (STREAM_SAVER *)xmalloc (sizeof (STREAM_SAVER)); + + xbcopy ((char *)&bash_input, (char *)&(saver->bash_input), sizeof (BASH_INPUT)); + +#if defined (BUFFERED_INPUT) + saver->bstream = (BUFFERED_STREAM *)NULL; + /* If we have a buffered stream, clear out buffers[fd]. */ + if (bash_input.type == st_bstream && bash_input.location.buffered_fd >= 0) + saver->bstream = set_buffered_stream (bash_input.location.buffered_fd, + (BUFFERED_STREAM *)NULL); +#endif /* BUFFERED_INPUT */ + + saver->line = line_number; + bash_input.name = (char *)NULL; + saver->next = stream_list; + stream_list = saver; + EOF_Reached = 0; + if (reset_lineno) + line_number = 0; +} + +void +pop_stream () +{ + if (!stream_list) + EOF_Reached = 1; + else + { + STREAM_SAVER *saver = stream_list; + + EOF_Reached = 0; + stream_list = stream_list->next; + + init_yy_io (saver->bash_input.getter, + saver->bash_input.ungetter, + saver->bash_input.type, + saver->bash_input.name, + saver->bash_input.location); + +#if defined (BUFFERED_INPUT) + /* If we have a buffered stream, restore buffers[fd]. */ + /* If the input file descriptor was changed while this was on the + save stack, update the buffered fd to the new file descriptor and + re-establish the buffer <-> bash_input fd correspondence. */ + if (bash_input.type == st_bstream && bash_input.location.buffered_fd >= 0) + { + if (bash_input_fd_changed) + { + bash_input_fd_changed = 0; + if (default_buffered_input >= 0) + { + bash_input.location.buffered_fd = default_buffered_input; + saver->bstream->b_fd = default_buffered_input; + SET_CLOSE_ON_EXEC (default_buffered_input); + } + } + /* XXX could free buffered stream returned as result here. */ + set_buffered_stream (bash_input.location.buffered_fd, saver->bstream); + } +#endif /* BUFFERED_INPUT */ + + line_number = saver->line; + + FREE (saver->bash_input.name); + free (saver); + } +} + +/* Return 1 if a stream of type TYPE is saved on the stack. */ +int +stream_on_stack (type) + enum stream_type type; +{ + register STREAM_SAVER *s; + + for (s = stream_list; s; s = s->next) + if (s->bash_input.type == type) + return 1; + return 0; +} + +/* Save the current token state and return it in a malloced array. */ +int * +save_token_state () +{ + int *ret; + + ret = (int *)xmalloc (4 * sizeof (int)); + ret[0] = last_read_token; + ret[1] = token_before_that; + ret[2] = two_tokens_ago; + ret[3] = current_token; + return ret; +} + +void +restore_token_state (ts) + int *ts; +{ + if (ts == 0) + return; + last_read_token = ts[0]; + token_before_that = ts[1]; + two_tokens_ago = ts[2]; + current_token = ts[3]; +} + +/* + * This is used to inhibit alias expansion and reserved word recognition + * inside case statement pattern lists. A `case statement pattern list' is: + * + * everything between the `in' in a `case word in' and the next ')' + * or `esac' + * everything between a `;;' and the next `)' or `esac' + */ + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + +#define END_OF_ALIAS 0 + +/* + * Pseudo-global variables used in implementing token-wise alias expansion. + */ + +/* + * Pushing and popping strings. This works together with shell_getc to + * implement alias expansion on a per-token basis. + */ + +#define PSH_ALIAS 0x01 +#define PSH_DPAREN 0x02 +#define PSH_SOURCE 0x04 + +typedef struct string_saver { + struct string_saver *next; + int expand_alias; /* Value to set expand_alias to when string is popped. */ + char *saved_line; +#if defined (ALIAS) + alias_t *expander; /* alias that caused this line to be pushed. */ +#endif + size_t saved_line_size, saved_line_index; + int saved_line_terminator; + int flags; +} STRING_SAVER; + +STRING_SAVER *pushed_string_list = (STRING_SAVER *)NULL; + +/* + * Push the current shell_input_line onto a stack of such lines and make S + * the current input. Used when expanding aliases. EXPAND is used to set + * the value of expand_next_token when the string is popped, so that the + * word after the alias in the original line is handled correctly when the + * alias expands to multiple words. TOKEN is the token that was expanded + * into S; it is saved and used to prevent infinite recursive expansion. + */ +static void +push_string (s, expand, ap) + char *s; + int expand; + alias_t *ap; +{ + STRING_SAVER *temp = (STRING_SAVER *)xmalloc (sizeof (STRING_SAVER)); + + temp->expand_alias = expand; + temp->saved_line = shell_input_line; + temp->saved_line_size = shell_input_line_size; + temp->saved_line_index = shell_input_line_index; + temp->saved_line_terminator = shell_input_line_terminator; + temp->flags = 0; +#if defined (ALIAS) + temp->expander = ap; + if (ap) + temp->flags = PSH_ALIAS; +#endif + temp->next = pushed_string_list; + pushed_string_list = temp; + +#if defined (ALIAS) + if (ap) + ap->flags |= AL_BEINGEXPANDED; +#endif + + shell_input_line = s; + shell_input_line_size = STRLEN (s); + shell_input_line_index = 0; + shell_input_line_terminator = '\0'; +#if 0 + parser_state &= ~PST_ALEXPNEXT; /* XXX */ +#endif + + set_line_mbstate (); +} + +/* + * Make the top of the pushed_string stack be the current shell input. + * Only called when there is something on the stack. Called from shell_getc + * when it thinks it has consumed the string generated by an alias expansion + * and needs to return to the original input line. + */ +static void +pop_string () +{ + STRING_SAVER *t; + + FREE (shell_input_line); + shell_input_line = pushed_string_list->saved_line; + shell_input_line_index = pushed_string_list->saved_line_index; + shell_input_line_size = pushed_string_list->saved_line_size; + shell_input_line_terminator = pushed_string_list->saved_line_terminator; + + if (pushed_string_list->expand_alias) + parser_state |= PST_ALEXPNEXT; + else + parser_state &= ~PST_ALEXPNEXT; + + t = pushed_string_list; + pushed_string_list = pushed_string_list->next; + +#if defined (ALIAS) + if (t->expander) + t->expander->flags &= ~AL_BEINGEXPANDED; +#endif + + free ((char *)t); + + set_line_mbstate (); +} + +static void +free_string_list () +{ + register STRING_SAVER *t, *t1; + + for (t = pushed_string_list; t; ) + { + t1 = t->next; + FREE (t->saved_line); +#if defined (ALIAS) + if (t->expander) + t->expander->flags &= ~AL_BEINGEXPANDED; +#endif + free ((char *)t); + t = t1; + } + pushed_string_list = (STRING_SAVER *)NULL; +} + +#endif /* ALIAS || DPAREN_ARITHMETIC */ + +void +free_pushed_string_input () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + free_string_list (); +#endif +} + +int +parser_expanding_alias () +{ + return (expanding_alias ()); +} + +void +parser_save_alias () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + push_string ((char *)NULL, 0, (alias_t *)NULL); + pushed_string_list->flags = PSH_SOURCE; /* XXX - for now */ +#else + ; +#endif +} + +void +parser_restore_alias () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + if (pushed_string_list) + pop_string (); +#else + ; +#endif +} + +/* Return a line of text, taken from wherever yylex () reads input. + If there is no more input, then we return NULL. If REMOVE_QUOTED_NEWLINE + is non-zero, we remove unquoted \ pairs. This is used by + read_secondary_line to read here documents. */ +static char * +read_a_line (remove_quoted_newline) + int remove_quoted_newline; +{ + static char *line_buffer = (char *)NULL; + static int buffer_size = 0; + int indx, c, peekc, pass_next; + +#if defined (READLINE) + if (no_line_editing && SHOULD_PROMPT ()) +#else + if (SHOULD_PROMPT ()) +#endif + print_prompt (); + + pass_next = indx = 0; + while (1) + { + /* Allow immediate exit if interrupted during input. */ + QUIT; + + c = yy_getc (); + + /* Ignore null bytes in input. */ + if (c == 0) + { +#if 0 + internal_warning ("read_a_line: ignored null byte in input"); +#endif + continue; + } + + /* If there is no more input, then we return NULL. */ + if (c == EOF) + { + if (interactive && bash_input.type == st_stream) + clearerr (stdin); + if (indx == 0) + return ((char *)NULL); + c = '\n'; + } + + /* `+2' in case the final character in the buffer is a newline. */ + RESIZE_MALLOCED_BUFFER (line_buffer, indx, 2, buffer_size, 128); + + /* IF REMOVE_QUOTED_NEWLINES is non-zero, we are reading a + here document with an unquoted delimiter. In this case, + the line will be expanded as if it were in double quotes. + We allow a backslash to escape the next character, but we + need to treat the backslash specially only if a backslash + quoting a backslash-newline pair appears in the line. */ + if (pass_next) + { + line_buffer[indx++] = c; + pass_next = 0; + } + else if (c == '\\' && remove_quoted_newline) + { + QUIT; + peekc = yy_getc (); + if (peekc == '\n') + { + line_number++; + continue; /* Make the unquoted \ pair disappear. */ + } + else + { + yy_ungetc (peekc); + pass_next = 1; + line_buffer[indx++] = c; /* Preserve the backslash. */ + } + } + else + line_buffer[indx++] = c; + + if (c == '\n') + { + line_buffer[indx] = '\0'; + return (line_buffer); + } + } +} + +/* Return a line as in read_a_line (), but insure that the prompt is + the secondary prompt. This is used to read the lines of a here + document. REMOVE_QUOTED_NEWLINE is non-zero if we should remove + newlines quoted with backslashes while reading the line. It is + non-zero unless the delimiter of the here document was quoted. */ +char * +read_secondary_line (remove_quoted_newline) + int remove_quoted_newline; +{ + char *ret; + int n, c; + + prompt_string_pointer = &ps2_prompt; + if (SHOULD_PROMPT()) + prompt_again (); + ret = read_a_line (remove_quoted_newline); +#if defined (HISTORY) + if (ret && remember_on_history && (parser_state & PST_HEREDOC)) + { + /* To make adding the the here-document body right, we need to rely + on history_delimiting_chars() returning \n for the first line of + the here-document body and the null string for the second and + subsequent lines, so we avoid double newlines. + current_command_line_count == 2 for the first line of the body. */ + + current_command_line_count++; + maybe_add_history (ret); + } +#endif /* HISTORY */ + return ret; +} + +/* **************************************************************** */ +/* */ +/* YYLEX () */ +/* */ +/* **************************************************************** */ + +/* Reserved words. These are only recognized as the first word of a + command. */ +STRING_INT_ALIST word_token_alist[] = { + { "if", IF }, + { "then", THEN }, + { "else", ELSE }, + { "elif", ELIF }, + { "fi", FI }, + { "case", CASE }, + { "esac", ESAC }, + { "for", FOR }, +#if defined (SELECT_COMMAND) + { "select", SELECT }, +#endif + { "while", WHILE }, + { "until", UNTIL }, + { "do", DO }, + { "done", DONE }, + { "in", IN }, + { "function", FUNCTION }, +#if defined (COMMAND_TIMING) + { "time", TIME }, +#endif + { "{", '{' }, + { "}", '}' }, + { "!", BANG }, +#if defined (COND_COMMAND) + { "[[", COND_START }, + { "]]", COND_END }, +#endif +#if defined (COPROCESS_SUPPORT) + { "coproc", COPROC }, +#endif + { (char *)NULL, 0} +}; + +/* other tokens that can be returned by read_token() */ +STRING_INT_ALIST other_token_alist[] = { + /* Multiple-character tokens with special values */ + { "--", TIMEIGN }, + { "-p", TIMEOPT }, + { "&&", AND_AND }, + { "||", OR_OR }, + { ">>", GREATER_GREATER }, + { "<<", LESS_LESS }, + { "<&", LESS_AND }, + { ">&", GREATER_AND }, + { ";;", SEMI_SEMI }, + { ";&", SEMI_AND }, + { ";;&", SEMI_SEMI_AND }, + { "<<-", LESS_LESS_MINUS }, + { "<<<", LESS_LESS_LESS }, + { "&>", AND_GREATER }, + { "&>>", AND_GREATER_GREATER }, + { "<>", LESS_GREATER }, + { ">|", GREATER_BAR }, + { "|&", BAR_AND }, + { "EOF", yacc_EOF }, + /* Tokens whose value is the character itself */ + { ">", '>' }, + { "<", '<' }, + { "-", '-' }, + { "{", '{' }, + { "}", '}' }, + { ";", ';' }, + { "(", '(' }, + { ")", ')' }, + { "|", '|' }, + { "&", '&' }, + { "newline", '\n' }, + { (char *)NULL, 0} +}; + +/* others not listed here: + WORD look at yylval.word + ASSIGNMENT_WORD look at yylval.word + NUMBER look at yylval.number + ARITH_CMD look at yylval.word_list + ARITH_FOR_EXPRS look at yylval.word_list + COND_CMD look at yylval.command +*/ + +/* These are used by read_token_word, but appear up here so that shell_getc + can use them to decide when to add otherwise blank lines to the history. */ + +/* The primary delimiter stack. */ +struct dstack dstack = { (char *)NULL, 0, 0 }; + +/* A temporary delimiter stack to be used when decoding prompt strings. + This is needed because command substitutions in prompt strings (e.g., PS2) + can screw up the parser's quoting state. */ +static struct dstack temp_dstack = { (char *)NULL, 0, 0 }; + +/* Macro for accessing the top delimiter on the stack. Returns the + delimiter or zero if none. */ +#define current_delimiter(ds) \ + (ds.delimiter_depth ? ds.delimiters[ds.delimiter_depth - 1] : 0) + +#define push_delimiter(ds, character) \ + do \ + { \ + if (ds.delimiter_depth + 2 > ds.delimiter_space) \ + ds.delimiters = (char *)xrealloc \ + (ds.delimiters, (ds.delimiter_space += 10) * sizeof (char)); \ + ds.delimiters[ds.delimiter_depth] = character; \ + ds.delimiter_depth++; \ + } \ + while (0) + +#define pop_delimiter(ds) ds.delimiter_depth-- + +/* Return the next shell input character. This always reads characters + from shell_input_line; when that line is exhausted, it is time to + read the next line. This is called by read_token when the shell is + processing normal command input. */ + +/* This implements one-character lookahead/lookbehind across physical input + lines, to avoid something being lost because it's pushed back with + shell_ungetc when we're at the start of a line. */ +static int eol_ungetc_lookahead = 0; + +static int +shell_getc (remove_quoted_newline) + int remove_quoted_newline; +{ + register int i; + int c, truncating; + unsigned char uc; + + QUIT; + + if (sigwinch_received) + { + sigwinch_received = 0; + get_new_window_size (0, (int *)0, (int *)0); + } + + if (eol_ungetc_lookahead) + { + c = eol_ungetc_lookahead; + eol_ungetc_lookahead = 0; + return (c); + } + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* If shell_input_line[shell_input_line_index] == 0, but there is + something on the pushed list of strings, then we don't want to go + off and get another line. We let the code down below handle it. */ + + if (!shell_input_line || ((!shell_input_line[shell_input_line_index]) && + (pushed_string_list == (STRING_SAVER *)NULL))) +#else /* !ALIAS && !DPAREN_ARITHMETIC */ + if (!shell_input_line || !shell_input_line[shell_input_line_index]) +#endif /* !ALIAS && !DPAREN_ARITHMETIC */ + { + line_number++; + + /* Let's not let one really really long line blow up memory allocation */ + if (shell_input_line && shell_input_line_size >= 32768) + { + free (shell_input_line); + shell_input_line = 0; + shell_input_line_size = 0; + } + + restart_read: + + /* Allow immediate exit if interrupted during input. */ + QUIT; + + i = truncating = 0; + shell_input_line_terminator = 0; + + /* If the shell is interatctive, but not currently printing a prompt + (interactive_shell && interactive == 0), we don't want to print + notifies or cleanup the jobs -- we want to defer it until we do + print the next prompt. */ + if (interactive_shell == 0 || SHOULD_PROMPT()) + { +#if defined (JOB_CONTROL) + /* This can cause a problem when reading a command as the result + of a trap, when the trap is called from flush_child. This call + had better not cause jobs to disappear from the job table in + that case, or we will have big trouble. */ + notify_and_cleanup (); +#else /* !JOB_CONTROL */ + cleanup_dead_jobs (); +#endif /* !JOB_CONTROL */ + } + +#if defined (READLINE) + if (no_line_editing && SHOULD_PROMPT()) +#else + if (SHOULD_PROMPT()) +#endif + print_prompt (); + + if (bash_input.type == st_stream) + clearerr (stdin); + + while (1) + { + c = yy_getc (); + + /* Allow immediate exit if interrupted during input. */ + QUIT; + + if (c == '\0') + { +#if 0 + internal_warning ("shell_getc: ignored null byte in input"); +#endif + continue; + } + + /* Theoretical overflow */ + /* If we can't put 256 bytes more into the buffer, allocate + everything we can and fill it as full as we can. */ + /* XXX - we ignore rest of line using `truncating' flag */ + if (shell_input_line_size > (SIZE_MAX - 256)) + { + size_t n; + + n = SIZE_MAX - i; /* how much more can we put into the buffer? */ + if (n <= 2) /* we have to save 1 for the newline added below */ + { + if (truncating == 0) + internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%llu): line truncated", shell_input_line_size, SIZE_MAX); + shell_input_line[i] = '\0'; + truncating = 1; + } + if (shell_input_line_size < SIZE_MAX) + { + shell_input_line_size = SIZE_MAX; + shell_input_line = xrealloc (shell_input_line, shell_input_line_size); + } + } + else + RESIZE_MALLOCED_BUFFER (shell_input_line, i, 2, shell_input_line_size, 256); + + if (c == EOF) + { + if (bash_input.type == st_stream) + clearerr (stdin); + + if (i == 0) + shell_input_line_terminator = EOF; + + shell_input_line[i] = '\0'; + break; + } + + if (truncating == 0 || c == '\n') + shell_input_line[i++] = c; + + if (c == '\n') + { + shell_input_line[--i] = '\0'; + current_command_line_count++; + break; + } + } + + shell_input_line_index = 0; + shell_input_line_len = i; /* == strlen (shell_input_line) */ + + set_line_mbstate (); + +#if defined (HISTORY) + if (remember_on_history && shell_input_line && shell_input_line[0]) + { + char *expansions; +# if defined (BANG_HISTORY) + int old_hist; + + /* If the current delimiter is a single quote, we should not be + performing history expansion, even if we're on a different + line from the original single quote. */ + old_hist = history_expansion_inhibited; + if (current_delimiter (dstack) == '\'') + history_expansion_inhibited = 1; +# endif + expansions = pre_process_line (shell_input_line, 1, 1); +# if defined (BANG_HISTORY) + history_expansion_inhibited = old_hist; +# endif + if (expansions != shell_input_line) + { + free (shell_input_line); + shell_input_line = expansions; + shell_input_line_len = shell_input_line ? + strlen (shell_input_line) : 0; + if (shell_input_line_len == 0) + current_command_line_count--; + + /* We have to force the xrealloc below because we don't know + the true allocated size of shell_input_line anymore. */ + shell_input_line_size = shell_input_line_len; + + set_line_mbstate (); + } + } + /* Try to do something intelligent with blank lines encountered while + entering multi-line commands. XXX - this is grotesque */ + else if (remember_on_history && shell_input_line && + shell_input_line[0] == '\0' && + current_command_line_count > 1) + { + if (current_delimiter (dstack)) + /* We know shell_input_line[0] == 0 and we're reading some sort of + quoted string. This means we've got a line consisting of only + a newline in a quoted string. We want to make sure this line + gets added to the history. */ + maybe_add_history (shell_input_line); + else + { + char *hdcs; + hdcs = history_delimiting_chars (shell_input_line); + if (hdcs && hdcs[0] == ';') + maybe_add_history (shell_input_line); + } + } + +#endif /* HISTORY */ + + if (shell_input_line) + { + /* Lines that signify the end of the shell's input should not be + echoed. We should not echo lines while parsing command + substitutions with recursive calls into the parsing engine; those + should only be echoed once when we read the word. That is the + reason for the test against shell_eof_token, which is set to a + right paren when parsing the contents of command substitutions. */ + if (echo_input_at_read && (shell_input_line[0] || + shell_input_line_terminator != EOF) && + shell_eof_token == 0) + fprintf (stderr, "%s\n", shell_input_line); + } + else + { + shell_input_line_size = 0; + prompt_string_pointer = ¤t_prompt_string; + if (SHOULD_PROMPT ()) + prompt_again (); + goto restart_read; + } + + /* Add the newline to the end of this string, iff the string does + not already end in an EOF character. */ + if (shell_input_line_terminator != EOF) + { + if (shell_input_line_size < SIZE_MAX && shell_input_line_len > shell_input_line_size - 3) + shell_input_line = (char *)xrealloc (shell_input_line, + 1 + (shell_input_line_size += 2)); + + shell_input_line[shell_input_line_len] = '\n'; + shell_input_line[shell_input_line_len + 1] = '\0'; + + set_line_mbstate (); + } + } + +next_alias_char: + uc = shell_input_line[shell_input_line_index]; + + if (uc) + shell_input_line_index++; + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* If UC is NULL, we have reached the end of the current input string. If + pushed_string_list is non-empty, it's time to pop to the previous string + because we have fully consumed the result of the last alias expansion. + Do it transparently; just return the next character of the string popped + to. */ + /* If pushed_string_list != 0 but pushed_string_list->expander == 0 (not + currently tested) and the flags value is not PSH_SOURCE, we are not + parsing an alias, we have just saved one (push_string, when called by + the parse_dparen code) In this case, just go on as well. The PSH_SOURCE + case is handled below. */ +pop_alias: + if (uc == 0 && pushed_string_list && pushed_string_list->flags != PSH_SOURCE) + { + pop_string (); + uc = shell_input_line[shell_input_line_index]; + if (uc) + shell_input_line_index++; + } +#endif /* ALIAS || DPAREN_ARITHMETIC */ + + if MBTEST(uc == '\\' && remove_quoted_newline && shell_input_line[shell_input_line_index] == '\n') + { + if (SHOULD_PROMPT ()) + prompt_again (); + line_number++; + /* What do we do here if we're expanding an alias whose definition + includes an escaped newline? If that's the last character in the + alias expansion, we just pop the pushed string list (recall that + we inhibit the appending of a space in mk_alexpansion() if newline + is the last character). If it's not the last character, we need + to consume the quoted newline and move to the next character in + the expansion. */ +#if defined (ALIAS) + if (expanding_alias () && shell_input_line[shell_input_line_index+1] == '\0') + { + uc = 0; + goto pop_alias; + } + else if (expanding_alias () && shell_input_line[shell_input_line_index+1] != '\0') + { + shell_input_line_index++; /* skip newline */ + goto next_alias_char; /* and get next character */ + } + else +#endif + goto restart_read; + } + + if (uc == 0 && shell_input_line_terminator == EOF) + return ((shell_input_line_index != 0) ? '\n' : EOF); + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* We already know that we are not parsing an alias expansion because of the + check for expanding_alias() above. This knows how parse_and_execute + handles switching to st_string input while an alias is being expanded, + hence the check for pushed_string_list without pushed_string_list->expander + and the check for PSH_SOURCE as pushed_string_list->flags. + parse_and_execute and parse_string both change the input type to st_string + and place the string to be parsed and executed into location.string, so + we should not stop reading that until the pointer is '\0'. + The check for shell_input_line_terminator may be superfluous. + + This solves the problem of `.' inside a multi-line alias with embedded + newlines executing things out of order. */ + if (uc == 0 && bash_input.type == st_string && *bash_input.location.string && + pushed_string_list && pushed_string_list->flags == PSH_SOURCE && + shell_input_line_terminator == 0) + { + shell_input_line_index = 0; + goto restart_read; + } +#endif + + return (uc); +} + +/* Put C back into the input for the shell. This might need changes for + HANDLE_MULTIBYTE around EOLs. Since we (currently) never push back a + character different than we read, shell_input_line_property doesn't need + to change when manipulating shell_input_line. The define for + last_shell_getc_is_singlebyte should take care of it, though. */ +static void +shell_ungetc (c) + int c; +{ + if (shell_input_line && shell_input_line_index) + shell_input_line[--shell_input_line_index] = c; + else + eol_ungetc_lookahead = c; +} + +#ifdef INCLUDE_UNUSED +/* Back the input pointer up by one, effectively `ungetting' a character. */ +static void +shell_ungetchar () +{ + if (shell_input_line && shell_input_line_index) + shell_input_line_index--; +} +#endif + +/* Discard input until CHARACTER is seen, then push that character back + onto the input stream. */ +static void +discard_until (character) + int character; +{ + int c; + + while ((c = shell_getc (0)) != EOF && c != character) + ; + + if (c != EOF) + shell_ungetc (c); +} + +void +execute_variable_command (command, vname) + char *command, *vname; +{ + char *last_lastarg; + sh_parser_state_t ps; + + save_parser_state (&ps); + last_lastarg = get_string_value ("_"); + if (last_lastarg) + last_lastarg = savestring (last_lastarg); + + parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEVAL_NOHIST); + + restore_parser_state (&ps); + bind_variable ("_", last_lastarg, 0); + FREE (last_lastarg); + + if (token_to_read == '\n') /* reset_parser was called */ + token_to_read = 0; +} + +/* Place to remember the token. We try to keep the buffer + at a reasonable size, but it can grow. */ +static char *token = (char *)NULL; + +/* Current size of the token buffer. */ +static int token_buffer_size; + +/* Command to read_token () explaining what we want it to do. */ +#define READ 0 +#define RESET 1 +#define prompt_is_ps1 \ + (!prompt_string_pointer || prompt_string_pointer == &ps1_prompt) + +/* Function for yyparse to call. yylex keeps track of + the last two tokens read, and calls read_token. */ +static int +yylex () +{ + if (interactive && (current_token == 0 || current_token == '\n')) + { + /* Before we print a prompt, we might have to check mailboxes. + We do this only if it is time to do so. Notice that only here + is the mail alarm reset; nothing takes place in check_mail () + except the checking of mail. Please don't change this. */ + if (prompt_is_ps1 && parse_and_execute_level == 0 && time_to_check_mail ()) + { + check_mail (); + reset_mail_timer (); + } + + /* Avoid printing a prompt if we're not going to read anything, e.g. + after resetting the parser with read_token (RESET). */ + if (token_to_read == 0 && SHOULD_PROMPT ()) + prompt_again (); + } + + two_tokens_ago = token_before_that; + token_before_that = last_read_token; + last_read_token = current_token; + current_token = read_token (READ); + + if ((parser_state & PST_EOFTOKEN) && current_token == shell_eof_token) + { + current_token = yacc_EOF; + if (bash_input.type == st_string) + rewind_input_string (); + } + parser_state &= ~PST_EOFTOKEN; + + return (current_token); +} + +/* When non-zero, we have read the required tokens + which allow ESAC to be the next one read. */ +static int esacs_needed_count; + +void +gather_here_documents () +{ + int r; + + r = 0; + while (need_here_doc) + { + parser_state |= PST_HEREDOC; + make_here_document (redir_stack[r++], line_number); + parser_state &= ~PST_HEREDOC; + need_here_doc--; + } +} + +/* When non-zero, an open-brace used to create a group is awaiting a close + brace partner. */ +static int open_brace_count; + +#define command_token_position(token) \ + (((token) == ASSIGNMENT_WORD) || (parser_state&PST_REDIRLIST) || \ + ((token) != SEMI_SEMI && (token) != SEMI_AND && (token) != SEMI_SEMI_AND && reserved_word_acceptable(token))) + +#define assignment_acceptable(token) \ + (command_token_position(token) && ((parser_state & PST_CASEPAT) == 0)) + +/* Check to see if TOKEN is a reserved word and return the token + value if it is. */ +#define CHECK_FOR_RESERVED_WORD(tok) \ + do { \ + if (!dollar_present && !quoted && \ + reserved_word_acceptable (last_read_token)) \ + { \ + int i; \ + for (i = 0; word_token_alist[i].word != (char *)NULL; i++) \ + if (STREQ (tok, word_token_alist[i].word)) \ + { \ + if ((parser_state & PST_CASEPAT) && (word_token_alist[i].token != ESAC)) \ + break; \ + if (word_token_alist[i].token == TIME && time_command_acceptable () == 0) \ + break; \ + if (word_token_alist[i].token == ESAC) \ + parser_state &= ~(PST_CASEPAT|PST_CASESTMT); \ + else if (word_token_alist[i].token == CASE) \ + parser_state |= PST_CASESTMT; \ + else if (word_token_alist[i].token == COND_END) \ + parser_state &= ~(PST_CONDCMD|PST_CONDEXPR); \ + else if (word_token_alist[i].token == COND_START) \ + parser_state |= PST_CONDCMD; \ + else if (word_token_alist[i].token == '{') \ + open_brace_count++; \ + else if (word_token_alist[i].token == '}' && open_brace_count) \ + open_brace_count--; \ + return (word_token_alist[i].token); \ + } \ + } \ + } while (0) + +#if defined (ALIAS) + + /* OK, we have a token. Let's try to alias expand it, if (and only if) + it's eligible. + + It is eligible for expansion if EXPAND_ALIASES is set, and + the token is unquoted and the last token read was a command + separator (or expand_next_token is set), and we are currently + processing an alias (pushed_string_list is non-empty) and this + token is not the same as the current or any previously + processed alias. + + Special cases that disqualify: + In a pattern list in a case statement (parser_state & PST_CASEPAT). */ + +static char * +mk_alexpansion (s) + char *s; +{ + int l; + char *r; + + l = strlen (s); + r = xmalloc (l + 2); + strcpy (r, s); + /* If the last character in the alias is a newline, don't add a trailing + space to the expansion. Works with shell_getc above. */ + if (r[l - 1] != ' ' && r[l - 1] != '\n') + r[l++] = ' '; + r[l] = '\0'; + return r; +} + +static int +alias_expand_token (tokstr) + char *tokstr; +{ + char *expanded; + alias_t *ap; + + if (((parser_state & PST_ALEXPNEXT) || command_token_position (last_read_token)) && + (parser_state & PST_CASEPAT) == 0) + { + ap = find_alias (tokstr); + + /* Currently expanding this token. */ + if (ap && (ap->flags & AL_BEINGEXPANDED)) + return (NO_EXPANSION); + + /* mk_alexpansion puts an extra space on the end of the alias expansion, + so the lookahead by the parser works right. If this gets changed, + make sure the code in shell_getc that deals with reaching the end of + an expanded alias is changed with it. */ + expanded = ap ? mk_alexpansion (ap->value) : (char *)NULL; + + if (expanded) + { + push_string (expanded, ap->flags & AL_EXPANDNEXT, ap); + return (RE_READ_TOKEN); + } + else + /* This is an eligible token that does not have an expansion. */ + return (NO_EXPANSION); + } + return (NO_EXPANSION); +} +#endif /* ALIAS */ + +static int +time_command_acceptable () +{ +#if defined (COMMAND_TIMING) + int i; + + if (posixly_correct && shell_compatibility_level > 41) + { + /* Quick check of the rest of the line to find the next token. If it + begins with a `-', Posix says to not return `time' as the token. + This was interp 267. */ + i = shell_input_line_index; + while (i < shell_input_line_len && (shell_input_line[i] == ' ' || shell_input_line[i] == '\t')) + i++; + if (shell_input_line[i] == '-') + return 0; + } + + switch (last_read_token) + { + case 0: + case ';': + case '\n': + case AND_AND: + case OR_OR: + case '&': + case DO: + case THEN: + case ELSE: + case '{': /* } */ + case '(': /* ) */ + case BANG: /* ! time pipeline */ + case TIME: /* time time pipeline */ + case TIMEOPT: /* time -p time pipeline */ + case TIMEIGN: /* time -p -- ... */ + return 1; + default: + return 0; + } +#else + return 0; +#endif /* COMMAND_TIMING */ +} + +/* Handle special cases of token recognition: + IN is recognized if the last token was WORD and the token + before that was FOR or CASE or SELECT. + + DO is recognized if the last token was WORD and the token + before that was FOR or SELECT. + + ESAC is recognized if the last token caused `esacs_needed_count' + to be set + + `{' is recognized if the last token as WORD and the token + before that was FUNCTION, or if we just parsed an arithmetic + `for' command. + + `}' is recognized if there is an unclosed `{' present. + + `-p' is returned as TIMEOPT if the last read token was TIME. + `--' is returned as TIMEIGN if the last read token was TIMEOPT. + + ']]' is returned as COND_END if the parser is currently parsing + a conditional expression ((parser_state & PST_CONDEXPR) != 0) + + `time' is returned as TIME if and only if it is immediately + preceded by one of `;', `\n', `||', `&&', or `&'. +*/ + +static int +special_case_tokens (tokstr) + char *tokstr; +{ + if ((last_read_token == WORD) && +#if defined (SELECT_COMMAND) + ((token_before_that == FOR) || (token_before_that == CASE) || (token_before_that == SELECT)) && +#else + ((token_before_that == FOR) || (token_before_that == CASE)) && +#endif + (tokstr[0] == 'i' && tokstr[1] == 'n' && tokstr[2] == 0)) + { + if (token_before_that == CASE) + { + parser_state |= PST_CASEPAT; + esacs_needed_count++; + } + return (IN); + } + + if (last_read_token == WORD && +#if defined (SELECT_COMMAND) + (token_before_that == FOR || token_before_that == SELECT) && +#else + (token_before_that == FOR) && +#endif + (tokstr[0] == 'd' && tokstr[1] == 'o' && tokstr[2] == '\0')) + return (DO); + + /* Ditto for ESAC in the CASE case. + Specifically, this handles "case word in esac", which is a legal + construct, certainly because someone will pass an empty arg to the + case construct, and we don't want it to barf. Of course, we should + insist that the case construct has at least one pattern in it, but + the designers disagree. */ + if (esacs_needed_count) + { + esacs_needed_count--; + if (STREQ (tokstr, "esac")) + { + parser_state &= ~PST_CASEPAT; + return (ESAC); + } + } + + /* The start of a shell function definition. */ + if (parser_state & PST_ALLOWOPNBRC) + { + parser_state &= ~PST_ALLOWOPNBRC; + if (tokstr[0] == '{' && tokstr[1] == '\0') /* } */ + { + open_brace_count++; + function_bstart = line_number; + return ('{'); /* } */ + } + } + + /* We allow a `do' after a for ((...)) without an intervening + list_terminator */ + if (last_read_token == ARITH_FOR_EXPRS && tokstr[0] == 'd' && tokstr[1] == 'o' && !tokstr[2]) + return (DO); + if (last_read_token == ARITH_FOR_EXPRS && tokstr[0] == '{' && tokstr[1] == '\0') /* } */ + { + open_brace_count++; + return ('{'); /* } */ + } + + if (open_brace_count && reserved_word_acceptable (last_read_token) && tokstr[0] == '}' && !tokstr[1]) + { + open_brace_count--; /* { */ + return ('}'); + } + +#if defined (COMMAND_TIMING) + /* Handle -p after `time'. */ + if (last_read_token == TIME && tokstr[0] == '-' && tokstr[1] == 'p' && !tokstr[2]) + return (TIMEOPT); + /* Handle -- after `time -p'. */ + if (last_read_token == TIMEOPT && tokstr[0] == '-' && tokstr[1] == '-' && !tokstr[2]) + return (TIMEIGN); +#endif + +#if defined (COND_COMMAND) /* [[ */ + if ((parser_state & PST_CONDEXPR) && tokstr[0] == ']' && tokstr[1] == ']' && tokstr[2] == '\0') + return (COND_END); +#endif + + return (-1); +} + +/* Called from shell.c when Control-C is typed at top level. Or + by the error rule at top level. */ +void +reset_parser () +{ + dstack.delimiter_depth = 0; /* No delimiters found so far. */ + open_brace_count = 0; + +#if defined (EXTENDED_GLOB) + /* Reset to global value of extended glob */ + if (parser_state & PST_EXTPAT) + extended_glob = global_extglob; +#endif + + parser_state = 0; + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + if (pushed_string_list) + free_string_list (); +#endif /* ALIAS || DPAREN_ARITHMETIC */ + + if (shell_input_line) + { + free (shell_input_line); + shell_input_line = (char *)NULL; + shell_input_line_size = shell_input_line_index = 0; + } + + FREE (word_desc_to_read); + word_desc_to_read = (WORD_DESC *)NULL; + + current_token = '\n'; /* XXX */ + last_read_token = '\n'; + token_to_read = '\n'; +} + +/* Read the next token. Command can be READ (normal operation) or + RESET (to normalize state). */ +static int +read_token (command) + int command; +{ + int character; /* Current character. */ + int peek_char; /* Temporary look-ahead character. */ + int result; /* The thing to return. */ + + if (command == RESET) + { + reset_parser (); + return ('\n'); + } + + if (token_to_read) + { + result = token_to_read; + if (token_to_read == WORD || token_to_read == ASSIGNMENT_WORD) + { + yylval.word = word_desc_to_read; + word_desc_to_read = (WORD_DESC *)NULL; + } + token_to_read = 0; + return (result); + } + +#if defined (COND_COMMAND) + if ((parser_state & (PST_CONDCMD|PST_CONDEXPR)) == PST_CONDCMD) + { + cond_lineno = line_number; + parser_state |= PST_CONDEXPR; + yylval.command = parse_cond_command (); + if (cond_token != COND_END) + { + cond_error (); + return (-1); + } + token_to_read = COND_END; + parser_state &= ~(PST_CONDEXPR|PST_CONDCMD); + return (COND_CMD); + } +#endif + +#if defined (ALIAS) + /* This is a place to jump back to once we have successfully expanded a + token with an alias and pushed the string with push_string () */ + re_read_token: +#endif /* ALIAS */ + + /* Read a single word from input. Start by skipping blanks. */ + while ((character = shell_getc (1)) != EOF && shellblank (character)) + ; + + if (character == EOF) + { + EOF_Reached = 1; + return (yacc_EOF); + } + + if MBTEST(character == '#' && (!interactive || interactive_comments)) + { + /* A comment. Discard until EOL or EOF, and then return a newline. */ + discard_until ('\n'); + shell_getc (0); + character = '\n'; /* this will take the next if statement and return. */ + } + + if (character == '\n') + { + /* If we're about to return an unquoted newline, we can go and collect + the text of any pending here document. */ + if (need_here_doc) + gather_here_documents (); + +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + parser_state &= ~PST_ASSIGNOK; + + return (character); + } + + if (parser_state & PST_REGEXP) + goto tokword; + + /* Shell meta-characters. */ + if MBTEST(shellmeta (character) && ((parser_state & PST_DBLPAREN) == 0)) + { +#if defined (ALIAS) + /* Turn off alias tokenization iff this character sequence would + not leave us ready to read a command. */ + if (character == '<' || character == '>') + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + parser_state &= ~PST_ASSIGNOK; + + peek_char = shell_getc (1); + if (character == peek_char) + { + switch (character) + { + case '<': + /* If '<' then we could be at "<<" or at "<<-". We have to + look ahead one more character. */ + peek_char = shell_getc (1); + if MBTEST(peek_char == '-') + return (LESS_LESS_MINUS); + else if MBTEST(peek_char == '<') + return (LESS_LESS_LESS); + else + { + shell_ungetc (peek_char); + return (LESS_LESS); + } + + case '>': + return (GREATER_GREATER); + + case ';': + parser_state |= PST_CASEPAT; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + peek_char = shell_getc (1); + if MBTEST(peek_char == '&') + return (SEMI_SEMI_AND); + else + { + shell_ungetc (peek_char); + return (SEMI_SEMI); + } + + case '&': + return (AND_AND); + + case '|': + return (OR_OR); + +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) + case '(': /* ) */ + result = parse_dparen (character); + if (result == -2) + break; + else + return result; +#endif + } + } + else if MBTEST(character == '<' && peek_char == '&') + return (LESS_AND); + else if MBTEST(character == '>' && peek_char == '&') + return (GREATER_AND); + else if MBTEST(character == '<' && peek_char == '>') + return (LESS_GREATER); + else if MBTEST(character == '>' && peek_char == '|') + return (GREATER_BAR); + else if MBTEST(character == '&' && peek_char == '>') + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '>') + return (AND_GREATER_GREATER); + else + { + shell_ungetc (peek_char); + return (AND_GREATER); + } + } + else if MBTEST(character == '|' && peek_char == '&') + return (BAR_AND); + else if MBTEST(character == ';' && peek_char == '&') + { + parser_state |= PST_CASEPAT; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + return (SEMI_AND); + } + + shell_ungetc (peek_char); + + /* If we look like we are reading the start of a function + definition, then let the reader know about it so that + we will do the right thing with `{'. */ + if MBTEST(character == ')' && last_read_token == '(' && token_before_that == WORD) + { + parser_state |= PST_ALLOWOPNBRC; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + function_dstart = line_number; + } + + /* case pattern lists may be preceded by an optional left paren. If + we're not trying to parse a case pattern list, the left paren + indicates a subshell. */ + if MBTEST(character == '(' && (parser_state & PST_CASEPAT) == 0) /* ) */ + parser_state |= PST_SUBSHELL; + /*(*/ + else if MBTEST((parser_state & PST_CASEPAT) && character == ')') + parser_state &= ~PST_CASEPAT; + /*(*/ + else if MBTEST((parser_state & PST_SUBSHELL) && character == ')') + parser_state &= ~PST_SUBSHELL; + +#if defined (PROCESS_SUBSTITUTION) + /* Check for the constructs which introduce process substitution. + Shells running in `posix mode' don't do process substitution. */ + if MBTEST(posixly_correct || ((character != '>' && character != '<') || peek_char != '(')) /*)*/ +#endif /* PROCESS_SUBSTITUTION */ + return (character); + } + + /* Hack <&- (close stdin) case. Also <&N- (dup and close). */ + if MBTEST(character == '-' && (last_read_token == LESS_AND || last_read_token == GREATER_AND)) + return (character); + +tokword: + /* Okay, if we got this far, we have to read a word. Read one, + and then check it against the known ones. */ + result = read_token_word (character); +#if defined (ALIAS) + if (result == RE_READ_TOKEN) + goto re_read_token; +#endif + return result; +} + +/* + * Match a $(...) or other grouping construct. This has to handle embedded + * quoted strings ('', ``, "") and nested constructs. It also must handle + * reprompting the user, if necessary, after reading a newline, and returning + * correct error values if it reads EOF. + */ +#define P_FIRSTCLOSE 0x0001 +#define P_ALLOWESC 0x0002 +#define P_DQUOTE 0x0004 +#define P_COMMAND 0x0008 /* parsing a command, so look for comments */ +#define P_BACKQUOTE 0x0010 /* parsing a backquoted command substitution */ +#define P_ARRAYSUB 0x0020 /* parsing a [...] array subscript for assignment */ +#define P_DOLBRACE 0x0040 /* parsing a ${...} construct */ + +/* Lexical state while parsing a grouping construct or $(...). */ +#define LEX_WASDOL 0x001 +#define LEX_CKCOMMENT 0x002 +#define LEX_INCOMMENT 0x004 +#define LEX_PASSNEXT 0x008 +#define LEX_RESWDOK 0x010 +#define LEX_CKCASE 0x020 +#define LEX_INCASE 0x040 +#define LEX_INHEREDOC 0x080 +#define LEX_HEREDELIM 0x100 /* reading here-doc delimiter */ +#define LEX_STRIPDOC 0x200 /* <<- strip tabs from here doc delim */ +#define LEX_INWORD 0x400 + +#define COMSUB_META(ch) ((ch) == ';' || (ch) == '&' || (ch) == '|') + +#define CHECK_NESTRET_ERROR() \ + do { \ + if (nestret == &matched_pair_error) \ + { \ + free (ret); \ + return &matched_pair_error; \ + } \ + } while (0) + +#define APPEND_NESTRET() \ + do { \ + if (nestlen) \ + { \ + RESIZE_MALLOCED_BUFFER (ret, retind, nestlen, retsize, 64); \ + strcpy (ret + retind, nestret); \ + retind += nestlen; \ + } \ + } while (0) + +static char matched_pair_error; + +static char * +parse_matched_pair (qc, open, close, lenp, flags) + int qc; /* `"' if this construct is within double quotes */ + int open, close; + int *lenp, flags; +{ + int count, ch, tflags; + int nestlen, ttranslen, start_lineno; + char *ret, *nestret, *ttrans; + int retind, retsize, rflags; + int dolbrace_state; + + dolbrace_state = (flags & P_DOLBRACE) ? DOLBRACE_PARAM : 0; + +/*itrace("parse_matched_pair[%d]: open = %c close = %c flags = %d", line_number, open, close, flags);*/ + count = 1; + tflags = 0; + + if ((flags & P_COMMAND) && qc != '`' && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0) + tflags |= LEX_CKCOMMENT; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ + rflags = (qc == '"') ? P_DQUOTE : (flags & P_DQUOTE); + + ret = (char *)xmalloc (retsize = 64); + retind = 0; + + start_lineno = line_number; + while (count) + { + ch = shell_getc (qc != '\'' && (tflags & (LEX_PASSNEXT)) == 0); + + if (ch == EOF) + { + free (ret); + parser_error (start_lineno, _("unexpected EOF while looking for matching `%c'"), close); + EOF_Reached = 1; /* XXX */ + return (&matched_pair_error); + } + + /* Possible reprompting. */ + if (ch == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* Don't bother counting parens or doing anything else if in a comment + or part of a case statement */ + if (tflags & LEX_INCOMMENT) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + if (ch == '\n') + tflags &= ~LEX_INCOMMENT; + + continue; + } + + /* Not exactly right yet, should handle shell metacharacters, too. If + any changes are made to this test, make analogous changes to subst.c: + extract_delimited_string(). */ + else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || shellblank (ret[retind - 1]))) + tflags |= LEX_INCOMMENT; + + if (tflags & LEX_PASSNEXT) /* last char was backslash */ + { + tflags &= ~LEX_PASSNEXT; + if (qc != '\'' && ch == '\n') /* double-quoted \ disappears. */ + { + if (retind > 0) + retind--; /* swallow previously-added backslash */ + continue; + } + + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + if MBTEST(ch == CTLESC) + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + /* If we're reparsing the input (e.g., from parse_string_to_word_list), + we've already prepended CTLESC to single-quoted results of $'...'. + We may want to do this for other CTLESC-quoted characters in + reparse, too. */ + else if MBTEST((parser_state & PST_REPARSE) && open == '\'' && (ch == CTLESC || ch == CTLNUL)) + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + continue; + } + else if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + else if MBTEST(ch == close) /* ending delimiter */ + count--; + /* handle nested ${...} specially. */ + else if MBTEST(open != close && (tflags & LEX_WASDOL) && open == '{' && ch == open) /* } */ + count++; + else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && ch == open) /* nested begin */ + count++; + + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + /* If we just read the ending character, don't bother continuing. */ + if (count == 0) + break; + + if (open == '\'') /* '' inside grouping construct */ + { + if MBTEST((flags & P_ALLOWESC) && ch == '\\') + tflags |= LEX_PASSNEXT; + continue; + } + + if MBTEST(ch == '\\') /* backslashes */ + tflags |= LEX_PASSNEXT; + + /* Based on which dolstate is currently in (param, op, or word), + decide what the op is. We're really only concerned if it's % or + #, so we can turn on a flag that says whether or not we should + treat single quotes as special when inside a double-quoted + ${...}. This logic must agree with subst.c:extract_dollar_brace_string + since they share the same defines. */ + /* FLAG POSIX INTERP 221 */ + if (flags & P_DOLBRACE) + { + /* ${param%[%]word} */ + if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '%' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param#[#]word} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '#' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param/[/]pat/rep} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '/' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE2; /* XXX */ + /* ${param^[^]pat} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '^' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param,[,]pat} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == ',' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && strchr ("#%^,~:-=?+/", ch) != 0) + dolbrace_state = DOLBRACE_OP; + else if MBTEST(dolbrace_state == DOLBRACE_OP && strchr ("#%^,~:-=?+/", ch) == 0) + dolbrace_state = DOLBRACE_WORD; + } + + /* The big hammer. Single quotes aren't special in double quotes. The + problem is that Posix used to say the single quotes are semi-special: + within a double-quoted ${...} construct "an even number of + unescaped double-quotes or single-quotes, if any, shall occur." */ + /* This was changed in Austin Group Interp 221 */ + if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'') + continue; + + /* Could also check open == '`' if we want to parse grouping constructs + inside old-style command substitution. */ + if (open != close) /* a grouping construct */ + { + if MBTEST(shellquote (ch)) + { + /* '', ``, or "" inside $(...) or other grouping construct. */ + push_delimiter (dstack, ch); + if MBTEST((tflags & LEX_WASDOL) && ch == '\'') /* $'...' inside group */ + nestret = parse_matched_pair (ch, ch, ch, &nestlen, P_ALLOWESC|rflags); + else + nestret = parse_matched_pair (ch, ch, ch, &nestlen, rflags); + pop_delimiter (dstack); + CHECK_NESTRET_ERROR (); + + if MBTEST((tflags & LEX_WASDOL) && ch == '\'' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Translate $'...' here. */ + ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen); + xfree (nestret); + + /* If we're parsing a double-quoted brace expansion and we are + not in a place where single quotes are treated specially, + make sure we single-quote the results of the ansi + expansion because quote removal should remove them later */ + /* FLAG POSIX INTERP 221 */ + if ((shell_compatibility_level > 42) && (rflags & P_DQUOTE) && (dolbrace_state == DOLBRACE_QUOTE2) && (flags & P_DOLBRACE)) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else if ((rflags & P_DQUOTE) == 0) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else + { + nestret = ttrans; + nestlen = ttranslen; + } + retind -= 2; /* back up before the $' */ + } + else if MBTEST((tflags & LEX_WASDOL) && ch == '"' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Locale expand $"..." here. */ + ttrans = localeexpand (nestret, 0, nestlen - 1, start_lineno, &ttranslen); + xfree (nestret); + + nestret = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + nestlen = ttranslen + 2; + retind -= 2; /* back up before the $" */ + } + + APPEND_NESTRET (); + FREE (nestret); + } + else if ((flags & P_ARRAYSUB) && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + goto parse_dollar_word; + } + /* Parse an old-style command substitution within double quotes as a + single word. */ + /* XXX - sh and ksh93 don't do this - XXX */ + else if MBTEST(open == '"' && ch == '`') + { + nestret = parse_matched_pair (0, '`', '`', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + else if MBTEST(open != '`' && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + /* check for $(), $[], or ${} inside quoted string. */ + { +parse_dollar_word: + if (open == ch) /* undo previous increment */ + count--; + if (ch == '(') /* ) */ + nestret = parse_comsub (0, '(', ')', &nestlen, (rflags|P_COMMAND) & ~P_DQUOTE); + else if (ch == '{') /* } */ + nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|P_DOLBRACE|rflags); + else if (ch == '[') /* ] */ + nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + if MBTEST(ch == '$') + tflags |= LEX_WASDOL; + else + tflags &= ~LEX_WASDOL; + } + + ret[retind] = '\0'; + if (lenp) + *lenp = retind; +/*itrace("parse_matched_pair[%d]: returning %s", line_number, ret);*/ + return ret; +} + +/* Parse a $(...) command substitution. This is messier than I'd like, and + reproduces a lot more of the token-reading code than I'd like. */ +static char * +parse_comsub (qc, open, close, lenp, flags) + int qc; /* `"' if this construct is within double quotes */ + int open, close; + int *lenp, flags; +{ + int count, ch, peekc, tflags, lex_rwlen, lex_wlen, lex_firstind; + int nestlen, ttranslen, start_lineno; + char *ret, *nestret, *ttrans, *heredelim; + int retind, retsize, rflags, hdlen; + + /* Posix interp 217 says arithmetic expressions have precedence, so + assume $(( introduces arithmetic expansion and parse accordingly. */ + peekc = shell_getc (0); + shell_ungetc (peekc); + if (peekc == '(') + return (parse_matched_pair (qc, open, close, lenp, 0)); + +/*itrace("parse_comsub: qc = `%c' open = %c close = %c", qc, open, close);*/ + count = 1; + tflags = LEX_RESWDOK; + + if ((flags & P_COMMAND) && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0) + tflags |= LEX_CKCASE; + if ((tflags & LEX_CKCASE) && (interactive == 0 || interactive_comments)) + tflags |= LEX_CKCOMMENT; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ + rflags = (flags & P_DQUOTE); + + ret = (char *)xmalloc (retsize = 64); + retind = 0; + + start_lineno = line_number; + lex_rwlen = lex_wlen = 0; + + heredelim = 0; + lex_firstind = -1; + + while (count) + { +comsub_readchar: + ch = shell_getc (qc != '\'' && (tflags & (LEX_INCOMMENT|LEX_PASSNEXT)) == 0); + + if (ch == EOF) + { +eof_error: + free (ret); + FREE (heredelim); + parser_error (start_lineno, _("unexpected EOF while looking for matching `%c'"), close); + EOF_Reached = 1; /* XXX */ + return (&matched_pair_error); + } + + /* If we hit the end of a line and are reading the contents of a here + document, and it's not the same line that the document starts on, + check for this line being the here doc delimiter. Otherwise, if + we're in a here document, mark the next character as the beginning + of a line. */ + if (ch == '\n') + { + if ((tflags & LEX_HEREDELIM) && heredelim) + { + tflags &= ~LEX_HEREDELIM; + tflags |= LEX_INHEREDOC; + lex_firstind = retind + 1; + } + else if (tflags & LEX_INHEREDOC) + { + int tind; + tind = lex_firstind; + while ((tflags & LEX_STRIPDOC) && ret[tind] == '\t') + tind++; + if (STREQN (ret + tind, heredelim, hdlen)) + { + tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC); +/*itrace("parse_comsub:%d: found here doc end `%s'", line_number, ret + tind);*/ + free (heredelim); + heredelim = 0; + lex_firstind = -1; + } + else + lex_firstind = retind + 1; + } + } + + /* Possible reprompting. */ + if (ch == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* XXX -- possibly allow here doc to be delimited by ending right + paren. */ + if ((tflags & LEX_INHEREDOC) && ch == close && count == 1) + { + int tind; +/*itrace("parse_comsub: in here doc, ch == close, retind - firstind = %d hdlen = %d retind = %d", retind-lex_firstind, hdlen, retind);*/ + tind = lex_firstind; + while ((tflags & LEX_STRIPDOC) && ret[tind] == '\t') + tind++; + if (retind-tind == hdlen && STREQN (ret + tind, heredelim, hdlen)) + { + tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC); +/*itrace("parse_comsub:%d: found here doc end `%s'", line_number, ret + tind);*/ + free (heredelim); + heredelim = 0; + lex_firstind = -1; + } + } + + /* Don't bother counting parens or doing anything else if in a comment */ + if (tflags & (LEX_INCOMMENT|LEX_INHEREDOC)) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + if ((tflags & LEX_INCOMMENT) && ch == '\n') + { +/*itrace("parse_comsub:%d: lex_incomment -> 0 ch = `%c'", line_number, ch);*/ + tflags &= ~LEX_INCOMMENT; + } + + continue; + } + + if (tflags & LEX_PASSNEXT) /* last char was backslash */ + { +/*itrace("parse_comsub:%d: lex_passnext -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + tflags &= ~LEX_PASSNEXT; + if (qc != '\'' && ch == '\n') /* double-quoted \ disappears. */ + { + if (retind > 0) + retind--; /* swallow previously-added backslash */ + continue; + } + + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + if MBTEST(ch == CTLESC) + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + + /* If this is a shell break character, we are not in a word. If not, + we either start or continue a word. */ + if MBTEST(shellbreak (ch)) + { + tflags &= ~LEX_INWORD; +/*itrace("parse_comsub:%d: lex_inword -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + } + else + { + if (tflags & LEX_INWORD) + { + lex_wlen++; +/*itrace("parse_comsub:%d: lex_inword == 1 ch = `%c' lex_wlen = %d (%d)", line_number, ch, lex_wlen, __LINE__);*/ + } + else + { +/*itrace("parse_comsub:%d: lex_inword -> 1 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + tflags |= LEX_INWORD; + lex_wlen = 0; + } + } + + /* Skip whitespace */ + if MBTEST(shellblank (ch) && (tflags & LEX_HEREDELIM) == 0 && lex_rwlen == 0) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + continue; + } + + /* Either we are looking for the start of the here-doc delimiter + (lex_firstind == -1) or we are reading one (lex_firstind >= 0). + If this character is a shell break character and we are reading + the delimiter, save it and note that we are now reading a here + document. If we've found the start of the delimiter, note it by + setting lex_firstind. Backslashes can quote shell metacharacters + in here-doc delimiters. */ + if (tflags & LEX_HEREDELIM) + { + if (lex_firstind == -1 && shellbreak (ch) == 0) + lex_firstind = retind; +#if 0 + else if (heredelim && (tflags & LEX_PASSNEXT) == 0 && ch == '\n') + { + tflags |= LEX_INHEREDOC; + tflags &= ~LEX_HEREDELIM; + lex_firstind = retind + 1; + } +#endif + else if (lex_firstind >= 0 && (tflags & LEX_PASSNEXT) == 0 && shellbreak (ch)) + { + if (heredelim == 0) + { + nestret = substring (ret, lex_firstind, retind); + heredelim = string_quote_removal (nestret, 0); + free (nestret); + hdlen = STRLEN(heredelim); +/*itrace("parse_comsub:%d: found here doc delimiter `%s' (%d)", line_number, heredelim, hdlen);*/ + } + if (ch == '\n') + { + tflags |= LEX_INHEREDOC; + tflags &= ~LEX_HEREDELIM; + lex_firstind = retind + 1; + } + else + lex_firstind = -1; + } + } + + /* Meta-characters that can introduce a reserved word. Not perfect yet. */ + if MBTEST((tflags & LEX_RESWDOK) == 0 && (tflags & LEX_CKCASE) && (tflags & LEX_INCOMMENT) == 0 && (shellmeta(ch) || ch == '\n')) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + peekc = shell_getc (1); + if (ch == peekc && (ch == '&' || ch == '|' || ch == ';')) /* two-character tokens */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; +/*itrace("parse_comsub:%d: set lex_reswordok = 1, ch = `%c'", line_number, ch);*/ + tflags |= LEX_RESWDOK; + lex_rwlen = 0; + continue; + } + else if (ch == '\n' || COMSUB_META(ch)) + { + shell_ungetc (peekc); +/*itrace("parse_comsub:%d: set lex_reswordok = 1, ch = `%c'", line_number, ch);*/ + tflags |= LEX_RESWDOK; + lex_rwlen = 0; + continue; + } + else if (ch == EOF) + goto eof_error; + else + { + /* `unget' the character we just added and fall through */ + retind--; + shell_ungetc (peekc); + } + } + + /* If we can read a reserved word, try to read one. */ + if (tflags & LEX_RESWDOK) + { + if MBTEST(islower (ch)) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + lex_rwlen++; + continue; + } + else if MBTEST(lex_rwlen == 4 && shellbreak (ch)) + { + if (STREQN (ret + retind - 4, "case", 4)) + { + tflags |= LEX_INCASE; +/*itrace("parse_comsub:%d: found `case', lex_incase -> 1 lex_reswdok -> 0", line_number);*/ + } + else if (STREQN (ret + retind - 4, "esac", 4)) + { + tflags &= ~LEX_INCASE; +/*itrace("parse_comsub:%d: found `esac', lex_incase -> 0 lex_reswdok -> 0", line_number);*/ + } + tflags &= ~LEX_RESWDOK; + } + else if MBTEST((tflags & LEX_CKCOMMENT) && ch == '#' && (lex_rwlen == 0 || ((tflags & LEX_INWORD) && lex_wlen == 0))) + ; /* don't modify LEX_RESWDOK if we're starting a comment */ + /* Allow `do' followed by space, tab, or newline to preserve the + RESWDOK flag, but reset the reserved word length counter so we + can read another one. */ + else if MBTEST(((tflags & LEX_INCASE) == 0) && + (isblank(ch) || ch == '\n') && + lex_rwlen == 2 && + STREQN (ret + retind - 2, "do", 2)) + { +/*itrace("parse_comsub:%d: lex_incase == 1 found `%c', found \"do\"", line_number, ch);*/ + lex_rwlen = 0; + } + else if MBTEST((tflags & LEX_INCASE) && ch != '\n') + /* If we can read a reserved word and we're in case, we're at the + point where we can read a new pattern list or an esac. We + handle the esac case above. If we read a newline, we want to + leave LEX_RESWDOK alone. If we read anything else, we want to + turn off LEX_RESWDOK, since we're going to read a pattern list. */ + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: lex_incase == 1 found `%c', lex_reswordok -> 0", line_number, ch);*/ + } + else if MBTEST(shellbreak (ch) == 0) + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/ + } +#if 0 + /* If we find a space or tab but have read something and it's not + `do', turn off the reserved-word-ok flag */ + else if MBTEST(isblank (ch) && lex_rwlen > 0) + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/ + } +#endif + } + + /* Might be the start of a here-doc delimiter */ + if MBTEST((tflags & LEX_INCOMMENT) == 0 && (tflags & LEX_CKCASE) && ch == '<') + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + peekc = shell_getc (1); + if (peekc == EOF) + goto eof_error; + if (peekc == ch) + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; + peekc = shell_getc (1); + if (peekc == EOF) + goto eof_error; + if (peekc == '-') + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; + tflags |= LEX_STRIPDOC; + } + else + shell_ungetc (peekc); + if (peekc != '<') + { + tflags |= LEX_HEREDELIM; + lex_firstind = -1; + } + continue; + } + else + ch = peekc; /* fall through and continue XXX */ + } + else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (((tflags & LEX_RESWDOK) && lex_rwlen == 0) || ((tflags & LEX_INWORD) && lex_wlen == 0))) + { +/*itrace("parse_comsub:%d: lex_incomment -> 1 (%d)", line_number, __LINE__);*/ + tflags |= LEX_INCOMMENT; + } + + if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } +#if 0 + else if MBTEST((tflags & LEX_INCASE) && ch == close && close == ')') + tflags &= ~LEX_INCASE; /* XXX */ +#endif + else if MBTEST(ch == close && (tflags & LEX_INCASE) == 0) /* ending delimiter */ + { + count--; +/*itrace("parse_comsub:%d: found close: count = %d", line_number, count);*/ + } + else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && (tflags & LEX_INCASE) == 0 && ch == open) /* nested begin */ + { + count++; +/*itrace("parse_comsub:%d: found open: count = %d", line_number, count);*/ + } + + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + /* If we just read the ending character, don't bother continuing. */ + if (count == 0) + break; + + if MBTEST(ch == '\\') /* backslashes */ + tflags |= LEX_PASSNEXT; + + if MBTEST(shellquote (ch)) + { + /* '', ``, or "" inside $(...). */ + push_delimiter (dstack, ch); + if MBTEST((tflags & LEX_WASDOL) && ch == '\'') /* $'...' inside group */ + nestret = parse_matched_pair (ch, ch, ch, &nestlen, P_ALLOWESC|rflags); + else + nestret = parse_matched_pair (ch, ch, ch, &nestlen, rflags); + pop_delimiter (dstack); + CHECK_NESTRET_ERROR (); + + if MBTEST((tflags & LEX_WASDOL) && ch == '\'' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Translate $'...' here. */ + ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen); + xfree (nestret); + + if ((rflags & P_DQUOTE) == 0) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else + { + nestret = ttrans; + nestlen = ttranslen; + } + retind -= 2; /* back up before the $' */ + } + else if MBTEST((tflags & LEX_WASDOL) && ch == '"' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Locale expand $"..." here. */ + ttrans = localeexpand (nestret, 0, nestlen - 1, start_lineno, &ttranslen); + xfree (nestret); + + nestret = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + nestlen = ttranslen + 2; + retind -= 2; /* back up before the $" */ + } + + APPEND_NESTRET (); + FREE (nestret); + } + else if MBTEST((tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + /* check for $(), $[], or ${} inside command substitution. */ + { + if ((tflags & LEX_INCASE) == 0 && open == ch) /* undo previous increment */ + count--; + if (ch == '(') /* ) */ + nestret = parse_comsub (0, '(', ')', &nestlen, (rflags|P_COMMAND) & ~P_DQUOTE); + else if (ch == '{') /* } */ + nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|P_DOLBRACE|rflags); + else if (ch == '[') /* ] */ + nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + if MBTEST(ch == '$') + tflags |= LEX_WASDOL; + else + tflags &= ~LEX_WASDOL; + } + + FREE (heredelim); + ret[retind] = '\0'; + if (lenp) + *lenp = retind; +/*itrace("parse_comsub:%d: returning `%s'", line_number, ret);*/ + return ret; +} + +/* Recursively call the parser to parse a $(...) command substitution. */ +char * +xparse_dolparen (base, string, indp, flags) + char *base; + char *string; + int *indp; + int flags; +{ + sh_parser_state_t ps; + sh_input_line_state_t ls; + int orig_ind, nc, sflags, orig_eof_token; + char *ret, *s, *ep, *ostring; + + /*yydebug = 1;*/ + orig_ind = *indp; + ostring = string; + +/*itrace("xparse_dolparen: size = %d shell_input_line = `%s'", shell_input_line_size, shell_input_line);*/ + sflags = SEVAL_NONINT|SEVAL_NOHIST|SEVAL_NOFREE; + if (flags & SX_NOLONGJMP) + sflags |= SEVAL_NOLONGJMP; + save_parser_state (&ps); + save_input_line_state (&ls); + orig_eof_token = shell_eof_token; + + /*(*/ + parser_state |= PST_CMDSUBST|PST_EOFTOKEN; /* allow instant ')' */ /*(*/ + shell_eof_token = ')'; + parse_string (string, "command substitution", sflags, &ep); + + shell_eof_token = orig_eof_token; + restore_parser_state (&ps); + reset_parser (); + /* reset_parser clears shell_input_line and associated variables */ + restore_input_line_state (&ls); + if (interactive) + token_to_read = 0; + + /* Need to find how many characters parse_and_execute consumed, update + *indp, if flags != 0, copy the portion of the string parsed into RET + and return it. If flags & 1 (EX_NOALLOC) we can return NULL. */ + + /*(*/ + if (ep[-1] != ')') + { +#if DEBUG + if (ep[-1] != '\n') + itrace("xparse_dolparen:%d: ep[-1] != RPAREN (%d), ep = `%s'", line_number, ep[-1], ep); +#endif + while (ep > ostring && ep[-1] == '\n') ep--; + } + + nc = ep - ostring; + *indp = ep - base - 1; + + /*(*/ +#if DEBUG + if (base[*indp] != ')') + itrace("xparse_dolparen:%d: base[%d] != RPAREN (%d), base = `%s'", line_number, *indp, base[*indp], base); +#endif + + if (flags & SX_NOALLOC) + return (char *)NULL; + + if (nc == 0) + { + ret = xmalloc (1); + ret[0] = '\0'; + } + else + ret = substring (ostring, 0, nc - 1); + + return ret; +} + +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) +/* Parse a double-paren construct. It can be either an arithmetic + command, an arithmetic `for' command, or a nested subshell. Returns + the parsed token, -1 on error, or -2 if we didn't do anything and + should just go on. */ +static int +parse_dparen (c) + int c; +{ + int cmdtyp, sline; + char *wval; + WORD_DESC *wd; + +#if defined (ARITH_FOR_COMMAND) + if (last_read_token == FOR) + { + arith_for_lineno = line_number; + cmdtyp = parse_arith_cmd (&wval, 0); + if (cmdtyp == 1) + { + wd = alloc_word_desc (); + wd->word = wval; + yylval.word_list = make_word_list (wd, (WORD_LIST *)NULL); + return (ARITH_FOR_EXPRS); + } + else + return -1; /* ERROR */ + } +#endif + +#if defined (DPAREN_ARITHMETIC) + if (reserved_word_acceptable (last_read_token)) + { + sline = line_number; + + cmdtyp = parse_arith_cmd (&wval, 0); + if (cmdtyp == 1) /* arithmetic command */ + { + wd = alloc_word_desc (); + wd->word = wval; + wd->flags = W_QUOTED|W_NOSPLIT|W_NOGLOB|W_DQUOTE; + yylval.word_list = make_word_list (wd, (WORD_LIST *)NULL); + return (ARITH_CMD); + } + else if (cmdtyp == 0) /* nested subshell */ + { + push_string (wval, 0, (alias_t *)NULL); + pushed_string_list->flags = PSH_DPAREN; + if ((parser_state & PST_CASEPAT) == 0) + parser_state |= PST_SUBSHELL; + return (c); + } + else /* ERROR */ + return -1; + } +#endif + + return -2; /* XXX */ +} + +/* We've seen a `(('. Look for the matching `))'. If we get it, return 1. + If not, assume it's a nested subshell for backwards compatibility and + return 0. In any case, put the characters we've consumed into a locally- + allocated buffer and make *ep point to that buffer. Return -1 on an + error, for example EOF. */ +static int +parse_arith_cmd (ep, adddq) + char **ep; + int adddq; +{ + int exp_lineno, rval, c; + char *ttok, *tokstr; + int ttoklen; + + exp_lineno = line_number; + ttok = parse_matched_pair (0, '(', ')', &ttoklen, 0); + rval = 1; + if (ttok == &matched_pair_error) + return -1; + /* Check that the next character is the closing right paren. If + not, this is a syntax error. ( */ + c = shell_getc (0); + if MBTEST(c != ')') + rval = 0; + + tokstr = (char *)xmalloc (ttoklen + 4); + + /* if ADDDQ != 0 then (( ... )) -> "..." */ + if (rval == 1 && adddq) /* arith cmd, add double quotes */ + { + tokstr[0] = '"'; + strncpy (tokstr + 1, ttok, ttoklen - 1); + tokstr[ttoklen] = '"'; + tokstr[ttoklen+1] = '\0'; + } + else if (rval == 1) /* arith cmd, don't add double quotes */ + { + strncpy (tokstr, ttok, ttoklen - 1); + tokstr[ttoklen-1] = '\0'; + } + else /* nested subshell */ + { + tokstr[0] = '('; + strncpy (tokstr + 1, ttok, ttoklen - 1); + tokstr[ttoklen] = ')'; + tokstr[ttoklen+1] = c; + tokstr[ttoklen+2] = '\0'; + } + + *ep = tokstr; + FREE (ttok); + return rval; +} +#endif /* DPAREN_ARITHMETIC || ARITH_FOR_COMMAND */ + +#if defined (COND_COMMAND) +static void +cond_error () +{ + char *etext; + + if (EOF_Reached && cond_token != COND_ERROR) /* [[ */ + parser_error (cond_lineno, _("unexpected EOF while looking for `]]'")); + else if (cond_token != COND_ERROR) + { + if (etext = error_token_from_token (cond_token)) + { + parser_error (cond_lineno, _("syntax error in conditional expression: unexpected token `%s'"), etext); + free (etext); + } + else + parser_error (cond_lineno, _("syntax error in conditional expression")); + } +} + +static COND_COM * +cond_expr () +{ + return (cond_or ()); +} + +static COND_COM * +cond_or () +{ + COND_COM *l, *r; + + l = cond_and (); + if (cond_token == OR_OR) + { + r = cond_or (); + l = make_cond_node (COND_OR, (WORD_DESC *)NULL, l, r); + } + return l; +} + +static COND_COM * +cond_and () +{ + COND_COM *l, *r; + + l = cond_term (); + if (cond_token == AND_AND) + { + r = cond_and (); + l = make_cond_node (COND_AND, (WORD_DESC *)NULL, l, r); + } + return l; +} + +static int +cond_skip_newlines () +{ + while ((cond_token = read_token (READ)) == '\n') + { + if (SHOULD_PROMPT ()) + prompt_again (); + } + return (cond_token); +} + +#define COND_RETURN_ERROR() \ + do { cond_token = COND_ERROR; return ((COND_COM *)NULL); } while (0) + +static COND_COM * +cond_term () +{ + WORD_DESC *op; + COND_COM *term, *tleft, *tright; + int tok, lineno; + char *etext; + + /* Read a token. It can be a left paren, a `!', a unary operator, or a + word that should be the first argument of a binary operator. Start by + skipping newlines, since this is a compound command. */ + tok = cond_skip_newlines (); + lineno = line_number; + if (tok == COND_END) + { + COND_RETURN_ERROR (); + } + else if (tok == '(') + { + term = cond_expr (); + if (cond_token != ')') + { + if (term) + dispose_cond_node (term); /* ( */ + if (etext = error_token_from_token (cond_token)) + { + parser_error (lineno, _("unexpected token `%s', expected `)'"), etext); + free (etext); + } + else + parser_error (lineno, _("expected `)'")); + COND_RETURN_ERROR (); + } + term = make_cond_node (COND_EXPR, (WORD_DESC *)NULL, term, (COND_COM *)NULL); + (void)cond_skip_newlines (); + } + else if (tok == BANG || (tok == WORD && (yylval.word->word[0] == '!' && yylval.word->word[1] == '\0'))) + { + if (tok == WORD) + dispose_word (yylval.word); /* not needed */ + term = cond_term (); + if (term) + term->flags |= CMD_INVERT_RETURN; + } + else if (tok == WORD && yylval.word->word[0] == '-' && yylval.word->word[2] == 0 && test_unop (yylval.word->word)) + { + op = yylval.word; + tok = read_token (READ); + if (tok == WORD) + { + tleft = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + term = make_cond_node (COND_UNARY, op, tleft, (COND_COM *)NULL); + } + else + { + dispose_word (op); + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected argument `%s' to conditional unary operator"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected argument to conditional unary operator")); + COND_RETURN_ERROR (); + } + + (void)cond_skip_newlines (); + } + else if (tok == WORD) /* left argument to binary operator */ + { + /* lhs */ + tleft = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + + /* binop */ + tok = read_token (READ); + if (tok == WORD && test_binop (yylval.word->word)) + { + op = yylval.word; + if (op->word[0] == '=' && (op->word[1] == '\0' || (op->word[1] == '=' && op->word[2] == '\0'))) + parser_state |= PST_EXTPAT; + else if (op->word[0] == '!' && op->word[1] == '=' && op->word[2] == '\0') + parser_state |= PST_EXTPAT; + } +#if defined (COND_REGEXP) + else if (tok == WORD && STREQ (yylval.word->word, "=~")) + { + op = yylval.word; + parser_state |= PST_REGEXP; + } +#endif + else if (tok == '<' || tok == '>') + op = make_word_from_token (tok); /* ( */ + /* There should be a check before blindly accepting the `)' that we have + seen the opening `('. */ + else if (tok == COND_END || tok == AND_AND || tok == OR_OR || tok == ')') + { + /* Special case. [[ x ]] is equivalent to [[ -n x ]], just like + the test command. Similarly for [[ x && expr ]] or + [[ x || expr ]] or [[ (x) ]]. */ + op = make_word ("-n"); + term = make_cond_node (COND_UNARY, op, tleft, (COND_COM *)NULL); + cond_token = tok; + return (term); + } + else + { + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected token `%s', conditional binary operator expected"), etext); + free (etext); + } + else + parser_error (line_number, _("conditional binary operator expected")); + dispose_cond_node (tleft); + COND_RETURN_ERROR (); + } + + /* rhs */ + if (parser_state & PST_EXTPAT) + extended_glob = 1; + tok = read_token (READ); + if (parser_state & PST_EXTPAT) + extended_glob = global_extglob; + parser_state &= ~(PST_REGEXP|PST_EXTPAT); + + if (tok == WORD) + { + tright = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + term = make_cond_node (COND_BINARY, op, tleft, tright); + } + else + { + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected argument `%s' to conditional binary operator"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected argument to conditional binary operator")); + dispose_cond_node (tleft); + dispose_word (op); + COND_RETURN_ERROR (); + } + + (void)cond_skip_newlines (); + } + else + { + if (tok < 256) + parser_error (line_number, _("unexpected token `%c' in conditional command"), tok); + else if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected token `%s' in conditional command"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected token %d in conditional command"), tok); + COND_RETURN_ERROR (); + } + return (term); +} + +/* This is kind of bogus -- we slip a mini recursive-descent parser in + here to handle the conditional statement syntax. */ +static COMMAND * +parse_cond_command () +{ + COND_COM *cexp; + + global_extglob = extended_glob; + cexp = cond_expr (); + return (make_cond_command (cexp)); +} +#endif + +#if defined (ARRAY_VARS) +/* When this is called, it's guaranteed that we don't care about anything + in t beyond i. We do save and restore the chars, though. */ +static int +token_is_assignment (t, i) + char *t; + int i; +{ + unsigned char c, c1; + int r; + + c = t[i]; c1 = t[i+1]; + t[i] = '='; t[i+1] = '\0'; + r = assignment (t, (parser_state & PST_COMPASSIGN) != 0); + t[i] = c; t[i+1] = c1; + return r; +} + +/* XXX - possible changes here for `+=' */ +static int +token_is_ident (t, i) + char *t; + int i; +{ + unsigned char c; + int r; + + c = t[i]; + t[i] = '\0'; + r = legal_identifier (t); + t[i] = c; + return r; +} +#endif + +static int +read_token_word (character) + int character; +{ + /* The value for YYLVAL when a WORD is read. */ + WORD_DESC *the_word; + + /* Index into the token that we are building. */ + int token_index; + + /* ALL_DIGITS becomes zero when we see a non-digit. */ + int all_digit_token; + + /* DOLLAR_PRESENT becomes non-zero if we see a `$'. */ + int dollar_present; + + /* COMPOUND_ASSIGNMENT becomes non-zero if we are parsing a compound + assignment. */ + int compound_assignment; + + /* QUOTED becomes non-zero if we see one of ("), ('), (`), or (\). */ + int quoted; + + /* Non-zero means to ignore the value of the next character, and just + to add it no matter what. */ + int pass_next_character; + + /* The current delimiting character. */ + int cd; + int result, peek_char; + char *ttok, *ttrans; + int ttoklen, ttranslen; + intmax_t lvalue; + + if (token_buffer_size < TOKEN_DEFAULT_INITIAL_SIZE) + token = (char *)xrealloc (token, token_buffer_size = TOKEN_DEFAULT_INITIAL_SIZE); + + token_index = 0; + all_digit_token = DIGIT (character); + dollar_present = quoted = pass_next_character = compound_assignment = 0; + + for (;;) + { + if (character == EOF) + goto got_token; + + if (pass_next_character) + { + pass_next_character = 0; + goto got_escaped_character; + } + + cd = current_delimiter (dstack); + + /* Handle backslashes. Quote lots of things when not inside of + double-quotes, quote some things inside of double-quotes. */ + if MBTEST(character == '\\') + { + peek_char = shell_getc (0); + + /* Backslash-newline is ignored in all cases except + when quoted with single quotes. */ + if (peek_char == '\n') + { + character = '\n'; + goto next_character; + } + else + { + shell_ungetc (peek_char); + + /* If the next character is to be quoted, note it now. */ + if (cd == 0 || cd == '`' || + (cd == '"' && peek_char >= 0 && (sh_syntaxtab[peek_char] & CBSDQUOTE))) + pass_next_character++; + + quoted = 1; + goto got_character; + } + } + + /* Parse a matched pair of quote characters. */ + if MBTEST(shellquote (character)) + { + push_delimiter (dstack, character); + ttok = parse_matched_pair (character, character, character, &ttoklen, (character == '`') ? P_COMMAND : 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + all_digit_token = 0; + quoted = 1; + dollar_present |= (character == '"' && strchr (ttok, '$') != 0); + FREE (ttok); + goto next_character; + } + +#ifdef COND_REGEXP + /* When parsing a regexp as a single word inside a conditional command, + we need to special-case characters special to both the shell and + regular expressions. Right now, that is only '(' and '|'. */ /*)*/ + if MBTEST((parser_state & PST_REGEXP) && (character == '(' || character == '|')) /*)*/ + { + if (character == '|') + goto got_character; + + push_delimiter (dstack, character); + ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = all_digit_token = 0; + goto next_character; + } +#endif /* COND_REGEXP */ + +#ifdef EXTENDED_GLOB + /* Parse a ksh-style extended pattern matching specification. */ + if MBTEST(extended_glob && PATTERN_CHAR (character)) + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '(') /* ) */ + { + push_delimiter (dstack, peek_char); + ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + token[token_index++] = peek_char; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = all_digit_token = 0; + goto next_character; + } + else + shell_ungetc (peek_char); + } +#endif /* EXTENDED_GLOB */ + + /* If the delimiter character is not single quote, parse some of + the shell expansions that must be read as a single word. */ + if (shellexp (character)) + { + peek_char = shell_getc (1); + /* $(...), <(...), >(...), $((...)), ${...}, and $[...] constructs */ + if MBTEST(peek_char == '(' || + ((peek_char == '{' || peek_char == '[') && character == '$')) /* ) ] } */ + { + if (peek_char == '{') /* } */ + ttok = parse_matched_pair (cd, '{', '}', &ttoklen, P_FIRSTCLOSE|P_DOLBRACE); + else if (peek_char == '(') /* ) */ + { + /* XXX - push and pop the `(' as a delimiter for use by + the command-oriented-history code. This way newlines + appearing in the $(...) string get added to the + history literally rather than causing a possibly- + incorrect `;' to be added. ) */ + push_delimiter (dstack, peek_char); + ttok = parse_comsub (cd, '(', ')', &ttoklen, P_COMMAND); + pop_delimiter (dstack); + } + else + ttok = parse_matched_pair (cd, '[', ']', &ttoklen, 0); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + token[token_index++] = peek_char; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = 1; + all_digit_token = 0; + goto next_character; + } + /* This handles $'...' and $"..." new-style quoted strings. */ + else if MBTEST(character == '$' && (peek_char == '\'' || peek_char == '"')) + { + int first_line; + + first_line = line_number; + push_delimiter (dstack, peek_char); + ttok = parse_matched_pair (peek_char, peek_char, peek_char, + &ttoklen, + (peek_char == '\'') ? P_ALLOWESC : 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; + if (peek_char == '\'') + { + ttrans = ansiexpand (ttok, 0, ttoklen - 1, &ttranslen); + free (ttok); + + /* Insert the single quotes and correctly quote any + embedded single quotes (allowed because P_ALLOWESC was + passed to parse_matched_pair). */ + ttok = sh_single_quote (ttrans); + free (ttrans); + ttranslen = strlen (ttok); + ttrans = ttok; + } + else + { + /* Try to locale-expand the converted string. */ + ttrans = localeexpand (ttok, 0, ttoklen - 1, first_line, &ttranslen); + free (ttok); + + /* Add the double quotes back */ + ttok = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + ttranslen += 2; + ttrans = ttok; + } + + RESIZE_MALLOCED_BUFFER (token, token_index, ttranslen + 1, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + strcpy (token + token_index, ttrans); + token_index += ttranslen; + FREE (ttrans); + quoted = 1; + all_digit_token = 0; + goto next_character; + } + /* This could eventually be extended to recognize all of the + shell's single-character parameter expansions, and set flags.*/ + else if MBTEST(character == '$' && peek_char == '$') + { + RESIZE_MALLOCED_BUFFER (token, token_index, 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = '$'; + token[token_index++] = peek_char; + dollar_present = 1; + all_digit_token = 0; + goto next_character; + } + else + shell_ungetc (peek_char); + } + +#if defined (ARRAY_VARS) + /* Identify possible array subscript assignment; match [...]. If + parser_state&PST_COMPASSIGN, we need to parse [sub]=words treating + `sub' as if it were enclosed in double quotes. */ + else if MBTEST(character == '[' && /* ] */ + ((token_index > 0 && assignment_acceptable (last_read_token) && token_is_ident (token, token_index)) || + (token_index == 0 && (parser_state&PST_COMPASSIGN)))) + { + ttok = parse_matched_pair (cd, '[', ']', &ttoklen, P_ARRAYSUB); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + all_digit_token = 0; + goto next_character; + } + /* Identify possible compound array variable assignment. */ + else if MBTEST(character == '=' && token_index > 0 && (assignment_acceptable (last_read_token) || (parser_state & PST_ASSIGNOK)) && token_is_assignment (token, token_index)) + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '(') /* ) */ + { + ttok = parse_compound_assignment (&ttoklen); + + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 4, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + + token[token_index++] = '='; + token[token_index++] = '('; + if (ttok) + { + strcpy (token + token_index, ttok); + token_index += ttoklen; + } + token[token_index++] = ')'; + FREE (ttok); + all_digit_token = 0; + compound_assignment = 1; +#if 1 + goto next_character; +#else + goto got_token; /* ksh93 seems to do this */ +#endif + } + else + shell_ungetc (peek_char); + } +#endif + + /* When not parsing a multi-character word construct, shell meta- + characters break words. */ + if MBTEST(shellbreak (character)) + { + shell_ungetc (character); + goto got_token; + } + +got_character: + + if (character == CTLESC || character == CTLNUL) + { + RESIZE_MALLOCED_BUFFER (token, token_index, 2, token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = CTLESC; + } + else +got_escaped_character: + RESIZE_MALLOCED_BUFFER (token, token_index, 1, token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + + token[token_index++] = character; + + all_digit_token &= DIGIT (character); + dollar_present |= character == '$'; + + next_character: + if (character == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* We want to remove quoted newlines (that is, a \ pair) + unless we are within single quotes or pass_next_character is + set (the shell equivalent of literal-next). */ + cd = current_delimiter (dstack); + character = shell_getc (cd != '\'' && pass_next_character == 0); + } /* end for (;;) */ + +got_token: + + /* Calls to RESIZE_MALLOCED_BUFFER ensure there is sufficient room. */ + token[token_index] = '\0'; + + /* Check to see what thing we should return. If the last_read_token + is a `<', or a `&', or the character which ended this token is + a '>' or '<', then, and ONLY then, is this input token a NUMBER. + Otherwise, it is just a word, and should be returned as such. */ + if MBTEST(all_digit_token && (character == '<' || character == '>' || + last_read_token == LESS_AND || + last_read_token == GREATER_AND)) + { + if (legal_number (token, &lvalue) && (int)lvalue == lvalue) + { + yylval.number = lvalue; + return (NUMBER); + } + } + + /* Check for special case tokens. */ + result = (last_shell_getc_is_singlebyte) ? special_case_tokens (token) : -1; + if (result >= 0) + return result; + +#if defined (ALIAS) + /* Posix.2 does not allow reserved words to be aliased, so check for all + of them, including special cases, before expanding the current token + as an alias. */ + if MBTEST(posixly_correct) + CHECK_FOR_RESERVED_WORD (token); + + /* Aliases are expanded iff EXPAND_ALIASES is non-zero, and quoting + inhibits alias expansion. */ + if (expand_aliases && quoted == 0) + { + result = alias_expand_token (token); + if (result == RE_READ_TOKEN) + return (RE_READ_TOKEN); + else if (result == NO_EXPANSION) + parser_state &= ~PST_ALEXPNEXT; + } + + /* If not in Posix.2 mode, check for reserved words after alias + expansion. */ + if MBTEST(posixly_correct == 0) +#endif + CHECK_FOR_RESERVED_WORD (token); + + the_word = (WORD_DESC *)xmalloc (sizeof (WORD_DESC)); + the_word->word = (char *)xmalloc (1 + token_index); + the_word->flags = 0; + strcpy (the_word->word, token); + if (dollar_present) + the_word->flags |= W_HASDOLLAR; + if (quoted) + the_word->flags |= W_QUOTED; /*(*/ + if (compound_assignment && token[token_index-1] == ')') + the_word->flags |= W_COMPASSIGN; + /* A word is an assignment if it appears at the beginning of a + simple command, or after another assignment word. This is + context-dependent, so it cannot be handled in the grammar. */ + if (assignment (token, (parser_state & PST_COMPASSIGN) != 0)) + { + the_word->flags |= W_ASSIGNMENT; + /* Don't perform word splitting on assignment statements. */ + if (assignment_acceptable (last_read_token) || (parser_state & PST_COMPASSIGN) != 0) + { + the_word->flags |= W_NOSPLIT; + if (parser_state & PST_COMPASSIGN) + the_word->flags |= W_NOGLOB; /* XXX - W_NOBRACE? */ + } + } + + if (command_token_position (last_read_token)) + { + struct builtin *b; + b = builtin_address_internal (token, 0); + if (b && (b->flags & ASSIGNMENT_BUILTIN)) + parser_state |= PST_ASSIGNOK; + else if (STREQ (token, "eval") || STREQ (token, "let")) + parser_state |= PST_ASSIGNOK; + } + + yylval.word = the_word; + + if (token[0] == '{' && token[token_index-1] == '}' && + (character == '<' || character == '>')) + { + /* can use token; already copied to the_word */ + token[token_index-1] = '\0'; +#if defined (ARRAY_VARS) + if (legal_identifier (token+1) || valid_array_reference (token+1)) +#else + if (legal_identifier (token+1)) +#endif + { + strcpy (the_word->word, token+1); +/*itrace("read_token_word: returning REDIR_WORD for %s", the_word->word);*/ + return (REDIR_WORD); + } + } + + result = ((the_word->flags & (W_ASSIGNMENT|W_NOSPLIT)) == (W_ASSIGNMENT|W_NOSPLIT)) + ? ASSIGNMENT_WORD : WORD; + + switch (last_read_token) + { + case FUNCTION: + parser_state |= PST_ALLOWOPNBRC; + function_dstart = line_number; + break; + case CASE: + case SELECT: + case FOR: + if (word_top < MAX_CASE_NEST) + word_top++; + word_lineno[word_top] = line_number; + break; + } + + return (result); +} + +/* Return 1 if TOKSYM is a token that after being read would allow + a reserved word to be seen, else 0. */ +static int +reserved_word_acceptable (toksym) + int toksym; +{ + switch (toksym) + { + case '\n': + case ';': + case '(': + case ')': + case '|': + case '&': + case '{': + case '}': /* XXX */ + case AND_AND: + case BANG: + case BAR_AND: + case DO: + case DONE: + case ELIF: + case ELSE: + case ESAC: + case FI: + case IF: + case OR_OR: + case SEMI_SEMI: + case SEMI_AND: + case SEMI_SEMI_AND: + case THEN: + case TIME: + case TIMEOPT: + case TIMEIGN: + case COPROC: + case UNTIL: + case WHILE: + case 0: + return 1; + default: +#if defined (COPROCESS_SUPPORT) + if (last_read_token == WORD && token_before_that == COPROC) + return 1; +#endif + if (last_read_token == WORD && token_before_that == FUNCTION) + return 1; + return 0; + } +} + +/* Return the index of TOKEN in the alist of reserved words, or -1 if + TOKEN is not a shell reserved word. */ +int +find_reserved_word (tokstr) + char *tokstr; +{ + int i; + for (i = 0; word_token_alist[i].word; i++) + if (STREQ (tokstr, word_token_alist[i].word)) + return i; + return -1; +} + +/* An interface to let the rest of the shell (primarily the completion + system) know what the parser is expecting. */ +int +parser_in_command_position () +{ + return (command_token_position (last_read_token)); +} + +#if 0 +#if defined (READLINE) +/* Called after each time readline is called. This insures that whatever + the new prompt string is gets propagated to readline's local prompt + variable. */ +static void +reset_readline_prompt () +{ + char *temp_prompt; + + if (prompt_string_pointer) + { + temp_prompt = (*prompt_string_pointer) + ? decode_prompt_string (*prompt_string_pointer) + : (char *)NULL; + + if (temp_prompt == 0) + { + temp_prompt = (char *)xmalloc (1); + temp_prompt[0] = '\0'; + } + + FREE (current_readline_prompt); + current_readline_prompt = temp_prompt; + } +} +#endif /* READLINE */ +#endif /* 0 */ + +#if defined (HISTORY) +/* A list of tokens which can be followed by newlines, but not by + semi-colons. When concatenating multiple lines of history, the + newline separator for such tokens is replaced with a space. */ +static const int no_semi_successors[] = { + '\n', '{', '(', ')', ';', '&', '|', + CASE, DO, ELSE, IF, SEMI_SEMI, SEMI_AND, SEMI_SEMI_AND, THEN, UNTIL, + WHILE, AND_AND, OR_OR, IN, + 0 +}; + +/* If we are not within a delimited expression, try to be smart + about which separators can be semi-colons and which must be + newlines. Returns the string that should be added into the + history entry. LINE is the line we're about to add; it helps + make some more intelligent decisions in certain cases. */ +char * +history_delimiting_chars (line) + const char *line; +{ + static int last_was_heredoc = 0; /* was the last entry the start of a here document? */ + register int i; + + if ((parser_state & PST_HEREDOC) == 0) + last_was_heredoc = 0; + + if (dstack.delimiter_depth != 0) + return ("\n"); + + /* We look for current_command_line_count == 2 because we are looking to + add the first line of the body of the here document (the second line + of the command). We also keep LAST_WAS_HEREDOC as a private sentinel + variable to note when we think we added the first line of a here doc + (the one with a "<<" somewhere in it) */ + if (parser_state & PST_HEREDOC) + { + if (last_was_heredoc) + { + last_was_heredoc = 0; + return "\n"; + } + return (current_command_line_count == 2 ? "\n" : ""); + } + + if (parser_state & PST_COMPASSIGN) + return (" "); + + /* First, handle some special cases. */ + /*(*/ + /* If we just read `()', assume it's a function definition, and don't + add a semicolon. If the token before the `)' was not `(', and we're + not in the midst of parsing a case statement, assume it's a + parenthesized command and add the semicolon. */ + /*)(*/ + if (token_before_that == ')') + { + if (two_tokens_ago == '(') /*)*/ /* function def */ + return " "; + /* This does not work for subshells inside case statement + command lists. It's a suboptimal solution. */ + else if (parser_state & PST_CASESTMT) /* case statement pattern */ + return " "; + else + return "; "; /* (...) subshell */ + } + else if (token_before_that == WORD && two_tokens_ago == FUNCTION) + return " "; /* function def using `function name' without `()' */ + + /* If we're not in a here document, but we think we're about to parse one, + and we would otherwise return a `;', return a newline to delimit the + line with the here-doc delimiter */ + else if ((parser_state & PST_HEREDOC) == 0 && current_command_line_count > 1 && last_read_token == '\n' && strstr (line, "<<")) + { + last_was_heredoc = 1; + return "\n"; + } + + else if (token_before_that == WORD && two_tokens_ago == FOR) + { + /* Tricky. `for i\nin ...' should not have a semicolon, but + `for i\ndo ...' should. We do what we can. */ + for (i = shell_input_line_index; whitespace (shell_input_line[i]); i++) + ; + if (shell_input_line[i] && shell_input_line[i] == 'i' && shell_input_line[i+1] == 'n') + return " "; + return ";"; + } + else if (two_tokens_ago == CASE && token_before_that == WORD && (parser_state & PST_CASESTMT)) + return " "; + + for (i = 0; no_semi_successors[i]; i++) + { + if (token_before_that == no_semi_successors[i]) + return (" "); + } + + return ("; "); +} +#endif /* HISTORY */ + +/* Issue a prompt, or prepare to issue a prompt when the next character + is read. */ +static void +prompt_again () +{ + char *temp_prompt; + + if (interactive == 0 || expanding_alias ()) /* XXX */ + return; + + ps1_prompt = get_string_value ("PS1"); + ps2_prompt = get_string_value ("PS2"); + + if (!prompt_string_pointer) + prompt_string_pointer = &ps1_prompt; + + temp_prompt = *prompt_string_pointer + ? decode_prompt_string (*prompt_string_pointer) + : (char *)NULL; + + if (temp_prompt == 0) + { + temp_prompt = (char *)xmalloc (1); + temp_prompt[0] = '\0'; + } + + current_prompt_string = *prompt_string_pointer; + prompt_string_pointer = &ps2_prompt; + +#if defined (READLINE) + if (!no_line_editing) + { + FREE (current_readline_prompt); + current_readline_prompt = temp_prompt; + } + else +#endif /* READLINE */ + { + FREE (current_decoded_prompt); + current_decoded_prompt = temp_prompt; + } +} + +int +get_current_prompt_level () +{ + return ((current_prompt_string && current_prompt_string == ps2_prompt) ? 2 : 1); +} + +void +set_current_prompt_level (x) + int x; +{ + prompt_string_pointer = (x == 2) ? &ps2_prompt : &ps1_prompt; + current_prompt_string = *prompt_string_pointer; +} + +static void +print_prompt () +{ + fprintf (stderr, "%s", current_decoded_prompt); + fflush (stderr); +} + +/* Return a string which will be printed as a prompt. The string + may contain special characters which are decoded as follows: + + \a bell (ascii 07) + \d the date in Day Mon Date format + \e escape (ascii 033) + \h the hostname up to the first `.' + \H the hostname + \j the number of active jobs + \l the basename of the shell's tty device name + \n CRLF + \r CR + \s the name of the shell + \t the time in 24-hour hh:mm:ss format + \T the time in 12-hour hh:mm:ss format + \@ the time in 12-hour hh:mm am/pm format + \A the time in 24-hour hh:mm format + \D{fmt} the result of passing FMT to strftime(3) + \u your username + \v the version of bash (e.g., 2.00) + \V the release of bash, version + patchlevel (e.g., 2.00.0) + \w the current working directory + \W the last element of $PWD + \! the history number of this command + \# the command number of this command + \$ a $ or a # if you are root + \nnn character code nnn in octal + \\ a backslash + \[ begin a sequence of non-printing chars + \] end a sequence of non-printing chars +*/ +#define PROMPT_GROWTH 48 +char * +decode_prompt_string (string) + char *string; +{ + WORD_LIST *list; + char *result, *t; + struct dstack save_dstack; + int last_exit_value, last_comsub_pid; +#if defined (PROMPT_STRING_DECODE) + int result_size, result_index; + int c, n, i; + char *temp, octal_string[4]; + struct tm *tm; + time_t the_time; + char timebuf[128]; + char *timefmt; + + result = (char *)xmalloc (result_size = PROMPT_GROWTH); + result[result_index = 0] = 0; + temp = (char *)NULL; + + while (c = *string++) + { + if (posixly_correct && c == '!') + { + if (*string == '!') + { + temp = savestring ("!"); + goto add_string; + } + else + { +#if !defined (HISTORY) + temp = savestring ("1"); +#else /* HISTORY */ + temp = itos (history_number ()); +#endif /* HISTORY */ + string--; /* add_string increments string again. */ + goto add_string; + } + } + if (c == '\\') + { + c = *string; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + strncpy (octal_string, string, 3); + octal_string[3] = '\0'; + + n = read_octal (octal_string); + temp = (char *)xmalloc (3); + + if (n == CTLESC || n == CTLNUL) + { + temp[0] = CTLESC; + temp[1] = n; + temp[2] = '\0'; + } + else if (n == -1) + { + temp[0] = '\\'; + temp[1] = '\0'; + } + else + { + temp[0] = n; + temp[1] = '\0'; + } + + for (c = 0; n != -1 && c < 3 && ISOCTAL (*string); c++) + string++; + + c = 0; /* tested at add_string: */ + goto add_string; + + case 'd': + case 't': + case 'T': + case '@': + case 'A': + /* Make the current time/date into a string. */ + (void) time (&the_time); +#if defined (HAVE_TZSET) + sv_tz ("TZ"); /* XXX -- just make sure */ +#endif + tm = localtime (&the_time); + + if (c == 'd') + n = strftime (timebuf, sizeof (timebuf), "%a %b %d", tm); + else if (c == 't') + n = strftime (timebuf, sizeof (timebuf), "%H:%M:%S", tm); + else if (c == 'T') + n = strftime (timebuf, sizeof (timebuf), "%I:%M:%S", tm); + else if (c == '@') + n = strftime (timebuf, sizeof (timebuf), "%I:%M %p", tm); + else if (c == 'A') + n = strftime (timebuf, sizeof (timebuf), "%H:%M", tm); + + if (n == 0) + timebuf[0] = '\0'; + else + timebuf[sizeof(timebuf) - 1] = '\0'; + + temp = savestring (timebuf); + goto add_string; + + case 'D': /* strftime format */ + if (string[1] != '{') /* } */ + goto not_escape; + + (void) time (&the_time); + tm = localtime (&the_time); + string += 2; /* skip { */ + timefmt = xmalloc (strlen (string) + 3); + for (t = timefmt; *string && *string != '}'; ) + *t++ = *string++; + *t = '\0'; + c = *string; /* tested at add_string */ + if (timefmt[0] == '\0') + { + timefmt[0] = '%'; + timefmt[1] = 'X'; /* locale-specific current time */ + timefmt[2] = '\0'; + } + n = strftime (timebuf, sizeof (timebuf), timefmt, tm); + free (timefmt); + + if (n == 0) + timebuf[0] = '\0'; + else + timebuf[sizeof(timebuf) - 1] = '\0'; + + if (promptvars || posixly_correct) + /* Make sure that expand_prompt_string is called with a + second argument of Q_DOUBLE_QUOTES if we use this + function here. */ + temp = sh_backslash_quote_for_double_quotes (timebuf); + else + temp = savestring (timebuf); + goto add_string; + + case 'n': + temp = (char *)xmalloc (3); + temp[0] = no_line_editing ? '\n' : '\r'; + temp[1] = no_line_editing ? '\0' : '\n'; + temp[2] = '\0'; + goto add_string; + + case 's': + temp = base_pathname (shell_name); + temp = savestring (temp); + goto add_string; + + case 'v': + case 'V': + temp = (char *)xmalloc (16); + if (c == 'v') + strcpy (temp, dist_version); + else + sprintf (temp, "%s.%d", dist_version, patch_level); + goto add_string; + + case 'w': + case 'W': + { + /* Use the value of PWD because it is much more efficient. */ + char t_string[PATH_MAX]; + int tlen; + + temp = get_string_value ("PWD"); + + if (temp == 0) + { + if (getcwd (t_string, sizeof(t_string)) == 0) + { + t_string[0] = '.'; + tlen = 1; + } + else + tlen = strlen (t_string); + } + else + { + tlen = sizeof (t_string) - 1; + strncpy (t_string, temp, tlen); + } + t_string[tlen] = '\0'; + +#if defined (MACOSX) + /* Convert from "fs" format to "input" format */ + temp = fnx_fromfs (t_string, strlen (t_string)); + if (temp != t_string) + strcpy (t_string, temp); +#endif + +#define ROOT_PATH(x) ((x)[0] == '/' && (x)[1] == 0) +#define DOUBLE_SLASH_ROOT(x) ((x)[0] == '/' && (x)[1] == '/' && (x)[2] == 0) + /* Abbreviate \W as ~ if $PWD == $HOME */ + if (c == 'W' && (((t = get_string_value ("HOME")) == 0) || STREQ (t, t_string) == 0)) + { + if (ROOT_PATH (t_string) == 0 && DOUBLE_SLASH_ROOT (t_string) == 0) + { + t = strrchr (t_string, '/'); + if (t) + memmove (t_string, t + 1, strlen (t)); /* strlen(t) to copy NULL */ + } + } +#undef ROOT_PATH +#undef DOUBLE_SLASH_ROOT + else + { + /* polite_directory_format is guaranteed to return a string + no longer than PATH_MAX - 1 characters. */ + temp = polite_directory_format (t_string); + if (temp != t_string) + strcpy (t_string, temp); + } + + temp = trim_pathname (t_string, PATH_MAX - 1); + /* If we're going to be expanding the prompt string later, + quote the directory name. */ + if (promptvars || posixly_correct) + /* Make sure that expand_prompt_string is called with a + second argument of Q_DOUBLE_QUOTES if we use this + function here. */ + temp = sh_backslash_quote_for_double_quotes (t_string); + else + temp = savestring (t_string); + + goto add_string; + } + + case 'u': + if (current_user.user_name == 0) + get_current_user_info (); + temp = savestring (current_user.user_name); + goto add_string; + + case 'h': + case 'H': + temp = savestring (current_host_name); + if (c == 'h' && (t = (char *)strchr (temp, '.'))) + *t = '\0'; + goto add_string; + + case '#': + temp = itos (current_command_number); + goto add_string; + + case '!': +#if !defined (HISTORY) + temp = savestring ("1"); +#else /* HISTORY */ + temp = itos (history_number ()); +#endif /* HISTORY */ + goto add_string; + + case '$': + t = temp = (char *)xmalloc (3); + if ((promptvars || posixly_correct) && (current_user.euid != 0)) + *t++ = '\\'; + *t++ = current_user.euid == 0 ? '#' : '$'; + *t = '\0'; + goto add_string; + + case 'j': + temp = itos (count_all_jobs ()); + goto add_string; + + case 'l': +#if defined (HAVE_TTYNAME) + temp = (char *)ttyname (fileno (stdin)); + t = temp ? base_pathname (temp) : "tty"; + temp = savestring (t); +#else + temp = savestring ("tty"); +#endif /* !HAVE_TTYNAME */ + goto add_string; + +#if defined (READLINE) + case '[': + case ']': + if (no_line_editing) + { + string++; + break; + } + temp = (char *)xmalloc (3); + n = (c == '[') ? RL_PROMPT_START_IGNORE : RL_PROMPT_END_IGNORE; + i = 0; + if (n == CTLESC || n == CTLNUL) + temp[i++] = CTLESC; + temp[i++] = n; + temp[i] = '\0'; + goto add_string; +#endif /* READLINE */ + + case '\\': + case 'a': + case 'e': + case 'r': + temp = (char *)xmalloc (2); + if (c == 'a') + temp[0] = '\07'; + else if (c == 'e') + temp[0] = '\033'; + else if (c == 'r') + temp[0] = '\r'; + else /* (c == '\\') */ + temp[0] = c; + temp[1] = '\0'; + goto add_string; + + default: +not_escape: + temp = (char *)xmalloc (3); + temp[0] = '\\'; + temp[1] = c; + temp[2] = '\0'; + + add_string: + if (c) + string++; + result = + sub_append_string (temp, result, &result_index, &result_size); + temp = (char *)NULL; /* Freed in sub_append_string (). */ + result[result_index] = '\0'; + break; + } + } + else + { + RESIZE_MALLOCED_BUFFER (result, result_index, 3, result_size, PROMPT_GROWTH); + result[result_index++] = c; + result[result_index] = '\0'; + } + } +#else /* !PROMPT_STRING_DECODE */ + result = savestring (string); +#endif /* !PROMPT_STRING_DECODE */ + + /* Save the delimiter stack and point `dstack' to temp space so any + command substitutions in the prompt string won't result in screwing + up the parser's quoting state. */ + save_dstack = dstack; + dstack = temp_dstack; + dstack.delimiter_depth = 0; + + /* Perform variable and parameter expansion and command substitution on + the prompt string. */ + if (promptvars || posixly_correct) + { + last_exit_value = last_command_exit_value; + last_comsub_pid = last_command_subst_pid; + list = expand_prompt_string (result, Q_DOUBLE_QUOTES, 0); + free (result); + result = string_list (list); + dispose_words (list); + last_command_exit_value = last_exit_value; + last_command_subst_pid = last_comsub_pid; + } + else + { + t = dequote_string (result); + free (result); + result = t; + } + + dstack = save_dstack; + + return (result); +} + +/************************************************ + * * + * ERROR HANDLING * + * * + ************************************************/ + +/* Report a syntax error, and restart the parser. Call here for fatal + errors. */ +int +yyerror (msg) + const char *msg; +{ + report_syntax_error ((char *)NULL); + reset_parser (); + return (0); +} + +static char * +error_token_from_token (tok) + int tok; +{ + char *t; + + if (t = find_token_in_alist (tok, word_token_alist, 0)) + return t; + + if (t = find_token_in_alist (tok, other_token_alist, 0)) + return t; + + t = (char *)NULL; + /* This stuff is dicy and needs closer inspection */ + switch (current_token) + { + case WORD: + case ASSIGNMENT_WORD: + if (yylval.word) + t = savestring (yylval.word->word); + break; + case NUMBER: + t = itos (yylval.number); + break; + case ARITH_CMD: + if (yylval.word_list) + t = string_list (yylval.word_list); + break; + case ARITH_FOR_EXPRS: + if (yylval.word_list) + t = string_list_internal (yylval.word_list, " ; "); + break; + case COND_CMD: + t = (char *)NULL; /* punt */ + break; + } + + return t; +} + +static char * +error_token_from_text () +{ + char *msg, *t; + int token_end, i; + + t = shell_input_line; + i = shell_input_line_index; + token_end = 0; + msg = (char *)NULL; + + if (i && t[i] == '\0') + i--; + + while (i && (whitespace (t[i]) || t[i] == '\n')) + i--; + + if (i) + token_end = i + 1; + + while (i && (member (t[i], " \n\t;|&") == 0)) + i--; + + while (i != token_end && (whitespace (t[i]) || t[i] == '\n')) + i++; + + /* Return our idea of the offending token. */ + if (token_end || (i == 0 && token_end == 0)) + { + if (token_end) + msg = substring (t, i, token_end); + else /* one-character token */ + { + msg = (char *)xmalloc (2); + msg[0] = t[i]; + msg[1] = '\0'; + } + } + + return (msg); +} + +static void +print_offending_line () +{ + char *msg; + int token_end; + + msg = savestring (shell_input_line); + token_end = strlen (msg); + while (token_end && msg[token_end - 1] == '\n') + msg[--token_end] = '\0'; + + parser_error (line_number, "`%s'", msg); + free (msg); +} + +/* Report a syntax error with line numbers, etc. + Call here for recoverable errors. If you have a message to print, + then place it in MESSAGE, otherwise pass NULL and this will figure + out an appropriate message for you. */ +static void +report_syntax_error (message) + char *message; +{ + char *msg, *p; + + if (message) + { + parser_error (line_number, "%s", message); + if (interactive && EOF_Reached) + EOF_Reached = 0; + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; + return; + } + + /* If the line of input we're reading is not null, try to find the + objectionable token. First, try to figure out what token the + parser's complaining about by looking at current_token. */ + if (current_token != 0 && EOF_Reached == 0 && (msg = error_token_from_token (current_token))) + { + if (ansic_shouldquote (msg)) + { + p = ansic_quote (msg, 0, NULL); + free (msg); + msg = p; + } + parser_error (line_number, _("syntax error near unexpected token `%s'"), msg); + free (msg); + + if (interactive == 0) + print_offending_line (); + + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; + return; + } + + /* If looking at the current token doesn't prove fruitful, try to find the + offending token by analyzing the text of the input line near the current + input line index and report what we find. */ + if (shell_input_line && *shell_input_line) + { + msg = error_token_from_text (); + if (msg) + { + parser_error (line_number, _("syntax error near `%s'"), msg); + free (msg); + } + + /* If not interactive, print the line containing the error. */ + if (interactive == 0) + print_offending_line (); + } + else + { + msg = EOF_Reached ? _("syntax error: unexpected end of file") : _("syntax error"); + parser_error (line_number, "%s", msg); + /* When the shell is interactive, this file uses EOF_Reached + only for error reporting. Other mechanisms are used to + decide whether or not to exit. */ + if (interactive && EOF_Reached) + EOF_Reached = 0; + } + + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; +} + +/* ??? Needed function. ??? We have to be able to discard the constructs + created during parsing. In the case of error, we want to return + allocated objects to the memory pool. In the case of no error, we want + to throw away the information about where the allocated objects live. + (dispose_command () will actually free the command.) */ +static void +discard_parser_constructs (error_p) + int error_p; +{ +} + +/************************************************ + * * + * EOF HANDLING * + * * + ************************************************/ + +/* Do that silly `type "bye" to exit' stuff. You know, "ignoreeof". */ + +/* A flag denoting whether or not ignoreeof is set. */ +int ignoreeof = 0; + +/* The number of times that we have encountered an EOF character without + another character intervening. When this gets above the limit, the + shell terminates. */ +int eof_encountered = 0; + +/* The limit for eof_encountered. */ +int eof_encountered_limit = 10; + +/* If we have EOF as the only input unit, this user wants to leave + the shell. If the shell is not interactive, then just leave. + Otherwise, if ignoreeof is set, and we haven't done this the + required number of times in a row, print a message. */ +static void +handle_eof_input_unit () +{ + if (interactive) + { + /* shell.c may use this to decide whether or not to write out the + history, among other things. We use it only for error reporting + in this file. */ + if (EOF_Reached) + EOF_Reached = 0; + + /* If the user wants to "ignore" eof, then let her do so, kind of. */ + if (ignoreeof) + { + if (eof_encountered < eof_encountered_limit) + { + fprintf (stderr, _("Use \"%s\" to leave the shell.\n"), + login_shell ? "logout" : "exit"); + eof_encountered++; + /* Reset the parsing state. */ + last_read_token = current_token = '\n'; + /* Reset the prompt string to be $PS1. */ + prompt_string_pointer = (char **)NULL; + prompt_again (); + return; + } + } + + /* In this case EOF should exit the shell. Do it now. */ + reset_parser (); + exit_builtin ((WORD_LIST *)NULL); + } + else + { + /* We don't write history files, etc., for non-interactive shells. */ + EOF_Reached = 1; + } +} + +/************************************************ + * * + * STRING PARSING FUNCTIONS * + * * + ************************************************/ + +/* It's very important that these two functions treat the characters + between ( and ) identically. */ + +static WORD_LIST parse_string_error; + +/* Take a string and run it through the shell parser, returning the + resultant word list. Used by compound array assignment. */ +WORD_LIST * +parse_string_to_word_list (s, flags, whom) + char *s; + int flags; + const char *whom; +{ + WORD_LIST *wl; + int tok, orig_current_token, orig_line_number, orig_input_terminator; + int orig_line_count; + int old_echo_input, old_expand_aliases; +#if defined (HISTORY) + int old_remember_on_history, old_history_expansion_inhibited; +#endif + +#if defined (HISTORY) + old_remember_on_history = remember_on_history; +# if defined (BANG_HISTORY) + old_history_expansion_inhibited = history_expansion_inhibited; +# endif + bash_history_disable (); +#endif + + orig_line_number = line_number; + orig_line_count = current_command_line_count; + orig_input_terminator = shell_input_line_terminator; + old_echo_input = echo_input_at_read; + old_expand_aliases = expand_aliases; + + push_stream (1); + last_read_token = WORD; /* WORD to allow reserved words here */ + current_command_line_count = 0; + echo_input_at_read = expand_aliases = 0; + + with_input_from_string (s, whom); + wl = (WORD_LIST *)NULL; + + if (flags & 1) + parser_state |= PST_COMPASSIGN|PST_REPARSE; + + while ((tok = read_token (READ)) != yacc_EOF) + { + if (tok == '\n' && *bash_input.location.string == '\0') + break; + if (tok == '\n') /* Allow newlines in compound assignments */ + continue; + if (tok != WORD && tok != ASSIGNMENT_WORD) + { + line_number = orig_line_number + line_number - 1; + orig_current_token = current_token; + current_token = tok; + yyerror (NULL); /* does the right thing */ + current_token = orig_current_token; + if (wl) + dispose_words (wl); + wl = &parse_string_error; + break; + } + wl = make_word_list (yylval.word, wl); + } + + last_read_token = '\n'; + pop_stream (); + +#if defined (HISTORY) + remember_on_history = old_remember_on_history; +# if defined (BANG_HISTORY) + history_expansion_inhibited = old_history_expansion_inhibited; +# endif /* BANG_HISTORY */ +#endif /* HISTORY */ + + echo_input_at_read = old_echo_input; + expand_aliases = old_expand_aliases; + + current_command_line_count = orig_line_count; + shell_input_line_terminator = orig_input_terminator; + + if (flags & 1) + parser_state &= ~(PST_COMPASSIGN|PST_REPARSE); + + if (wl == &parse_string_error) + { + last_command_exit_value = EXECUTION_FAILURE; + if (interactive_shell == 0 && posixly_correct) + jump_to_top_level (FORCE_EOF); + else + jump_to_top_level (DISCARD); + } + + return (REVERSE_LIST (wl, WORD_LIST *)); +} + +static char * +parse_compound_assignment (retlenp) + int *retlenp; +{ + WORD_LIST *wl, *rl; + int tok, orig_line_number, orig_token_size, orig_last_token, assignok; + char *saved_token, *ret; + + saved_token = token; + orig_token_size = token_buffer_size; + orig_line_number = line_number; + orig_last_token = last_read_token; + + last_read_token = WORD; /* WORD to allow reserved words here */ + + token = (char *)NULL; + token_buffer_size = 0; + + assignok = parser_state&PST_ASSIGNOK; /* XXX */ + + wl = (WORD_LIST *)NULL; /* ( */ + parser_state |= PST_COMPASSIGN; + + while ((tok = read_token (READ)) != ')') + { + if (tok == '\n') /* Allow newlines in compound assignments */ + { + if (SHOULD_PROMPT ()) + prompt_again (); + continue; + } + if (tok != WORD && tok != ASSIGNMENT_WORD) + { + current_token = tok; /* for error reporting */ + if (tok == yacc_EOF) /* ( */ + parser_error (orig_line_number, _("unexpected EOF while looking for matching `)'")); + else + yyerror(NULL); /* does the right thing */ + if (wl) + dispose_words (wl); + wl = &parse_string_error; + break; + } + wl = make_word_list (yylval.word, wl); + } + + FREE (token); + token = saved_token; + token_buffer_size = orig_token_size; + + parser_state &= ~PST_COMPASSIGN; + + if (wl == &parse_string_error) + { + last_command_exit_value = EXECUTION_FAILURE; + last_read_token = '\n'; /* XXX */ + if (interactive_shell == 0 && posixly_correct) + jump_to_top_level (FORCE_EOF); + else + jump_to_top_level (DISCARD); + } + + last_read_token = orig_last_token; /* XXX - was WORD? */ + + if (wl) + { + rl = REVERSE_LIST (wl, WORD_LIST *); + ret = string_list (rl); + dispose_words (rl); + } + else + ret = (char *)NULL; + + if (retlenp) + *retlenp = (ret && *ret) ? strlen (ret) : 0; + + if (assignok) + parser_state |= PST_ASSIGNOK; + + return ret; +} + +/************************************************ + * * + * SAVING AND RESTORING PARTIAL PARSE STATE * + * * + ************************************************/ + +sh_parser_state_t * +save_parser_state (ps) + sh_parser_state_t *ps; +{ + if (ps == 0) + ps = (sh_parser_state_t *)xmalloc (sizeof (sh_parser_state_t)); + if (ps == 0) + return ((sh_parser_state_t *)NULL); + + ps->parser_state = parser_state; + ps->token_state = save_token_state (); + + ps->input_line_terminator = shell_input_line_terminator; + ps->eof_encountered = eof_encountered; + + ps->prompt_string_pointer = prompt_string_pointer; + + ps->current_command_line_count = current_command_line_count; + +#if defined (HISTORY) + ps->remember_on_history = remember_on_history; +# if defined (BANG_HISTORY) + ps->history_expansion_inhibited = history_expansion_inhibited; +# endif +#endif + + ps->last_command_exit_value = last_command_exit_value; +#if defined (ARRAY_VARS) + ps->pipestatus = save_pipestatus_array (); +#endif + + ps->last_shell_builtin = last_shell_builtin; + ps->this_shell_builtin = this_shell_builtin; + + ps->expand_aliases = expand_aliases; + ps->echo_input_at_read = echo_input_at_read; + + ps->token = token; + ps->token_buffer_size = token_buffer_size; + /* Force reallocation on next call to read_token_word */ + token = 0; + token_buffer_size = 0; + + return (ps); +} + +void +restore_parser_state (ps) + sh_parser_state_t *ps; +{ + if (ps == 0) + return; + + parser_state = ps->parser_state; + if (ps->token_state) + { + restore_token_state (ps->token_state); + free (ps->token_state); + } + + shell_input_line_terminator = ps->input_line_terminator; + eof_encountered = ps->eof_encountered; + + prompt_string_pointer = ps->prompt_string_pointer; + + current_command_line_count = ps->current_command_line_count; + +#if defined (HISTORY) + remember_on_history = ps->remember_on_history; +# if defined (BANG_HISTORY) + history_expansion_inhibited = ps->history_expansion_inhibited; +# endif +#endif + + last_command_exit_value = ps->last_command_exit_value; +#if defined (ARRAY_VARS) + restore_pipestatus_array (ps->pipestatus); +#endif + + last_shell_builtin = ps->last_shell_builtin; + this_shell_builtin = ps->this_shell_builtin; + + expand_aliases = ps->expand_aliases; + echo_input_at_read = ps->echo_input_at_read; + + FREE (token); + token = ps->token; + token_buffer_size = ps->token_buffer_size; +} + +sh_input_line_state_t * +save_input_line_state (ls) + sh_input_line_state_t *ls; +{ + if (ls == 0) + ls = (sh_input_line_state_t *)xmalloc (sizeof (sh_input_line_state_t)); + if (ls == 0) + return ((sh_input_line_state_t *)NULL); + + ls->input_line = shell_input_line; + ls->input_line_size = shell_input_line_size; + ls->input_line_len = shell_input_line_len; + ls->input_line_index = shell_input_line_index; + + /* force reallocation */ + shell_input_line = 0; + shell_input_line_size = shell_input_line_len = shell_input_line_index = 0; + + return ls; +} + +void +restore_input_line_state (ls) + sh_input_line_state_t *ls; +{ + FREE (shell_input_line); + shell_input_line = ls->input_line; + shell_input_line_size = ls->input_line_size; + shell_input_line_len = ls->input_line_len; + shell_input_line_index = ls->input_line_index; + + set_line_mbstate (); +} + +/************************************************ + * * + * MULTIBYTE CHARACTER HANDLING * + * * + ************************************************/ + +#if defined (HANDLE_MULTIBYTE) +static void +set_line_mbstate () +{ + int c; + size_t i, previ, len; + mbstate_t mbs, prevs; + size_t mbclen; + + if (shell_input_line == NULL) + return; + len = strlen (shell_input_line); /* XXX - shell_input_line_len ? */ + FREE (shell_input_line_property); + shell_input_line_property = (char *)xmalloc (len + 1); + + memset (&prevs, '\0', sizeof (mbstate_t)); + for (i = previ = 0; i < len; i++) + { + mbs = prevs; + + c = shell_input_line[i]; + if (c == EOF) + { + size_t j; + for (j = i; j < len; j++) + shell_input_line_property[j] = 1; + break; + } + + mbclen = mbrlen (shell_input_line + previ, i - previ + 1, &mbs); + if (mbclen == 1 || mbclen == (size_t)-1) + { + mbclen = 1; + previ = i + 1; + } + else if (mbclen == (size_t)-2) + mbclen = 0; + else if (mbclen > 1) + { + mbclen = 0; + previ = i + 1; + prevs = mbs; + } + else + { + /* XXX - what to do if mbrlen returns 0? (null wide character) */ + size_t j; + for (j = i; j < len; j++) + shell_input_line_property[j] = 1; + break; + } + + shell_input_line_property[i] = mbclen; + } +} +#endif /* HANDLE_MULTIBYTE */ + diff --git a/.pc/bash43-006.diff/jobs.c b/.pc/bash43-006.diff/jobs.c new file mode 100644 index 0000000..2452779 --- /dev/null +++ b/.pc/bash43-006.diff/jobs.c @@ -0,0 +1,4475 @@ +/* jobs.c - functions that make children, remember them, and handle their termination. */ + +/* This file works with both POSIX and BSD systems. It implements job + control. */ + +/* Copyright (C) 1989-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" +#include "trap.h" +#include +#include +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "posixtime.h" + +#if defined (HAVE_SYS_RESOURCE_H) && defined (HAVE_WAIT3) && !defined (_POSIX_VERSION) && !defined (RLIMTYPE) +# include +#endif /* !_POSIX_VERSION && HAVE_SYS_RESOURCE_H && HAVE_WAIT3 && !RLIMTYPE */ + +#if defined (HAVE_SYS_FILE_H) +# include +#endif + +#include "filecntl.h" +#include +#if defined (HAVE_SYS_PARAM_H) +#include +#endif + +#if defined (BUFFERED_INPUT) +# include "input.h" +#endif + +/* Need to include this up here for *_TTY_DRIVER definitions. */ +#include "shtty.h" + +/* Define this if your output is getting swallowed. It's a no-op on + machines with the termio or termios tty drivers. */ +/* #define DRAIN_OUTPUT */ + +/* For the TIOCGPGRP and TIOCSPGRP ioctl parameters on HP-UX */ +#if defined (hpux) && !defined (TERMIOS_TTY_DRIVER) +# include +#endif /* hpux && !TERMIOS_TTY_DRIVER */ + +#include "bashansi.h" +#include "bashintl.h" +#include "shell.h" +#include "jobs.h" +#include "execute_cmd.h" +#include "flags.h" + +#include "builtins/builtext.h" +#include "builtins/common.h" + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +#if !defined (HAVE_KILLPG) +extern int killpg __P((pid_t, int)); +#endif + +#if !DEFAULT_CHILD_MAX +# define DEFAULT_CHILD_MAX 32 +#endif + +#if !MAX_CHILD_MAX +# define MAX_CHILD_MAX 8192 +#endif + +#if !defined (DEBUG) +#define MAX_JOBS_IN_ARRAY 4096 /* production */ +#else +#define MAX_JOBS_IN_ARRAY 128 /* testing */ +#endif + +/* Flag values for second argument to delete_job */ +#define DEL_WARNSTOPPED 1 /* warn about deleting stopped jobs */ +#define DEL_NOBGPID 2 /* don't add pgrp leader to bgpids */ + +/* Take care of system dependencies that must be handled when waiting for + children. The arguments to the WAITPID macro match those to the Posix.1 + waitpid() function. */ + +#if defined (ultrix) && defined (mips) && defined (_POSIX_VERSION) +# define WAITPID(pid, statusp, options) \ + wait3 ((union wait *)statusp, options, (struct rusage *)0) +#else +# if defined (_POSIX_VERSION) || defined (HAVE_WAITPID) +# define WAITPID(pid, statusp, options) \ + waitpid ((pid_t)pid, statusp, options) +# else +# if defined (HAVE_WAIT3) +# define WAITPID(pid, statusp, options) \ + wait3 (statusp, options, (struct rusage *)0) +# else +# define WAITPID(pid, statusp, options) \ + wait3 (statusp, options, (int *)0) +# endif /* HAVE_WAIT3 */ +# endif /* !_POSIX_VERSION && !HAVE_WAITPID*/ +#endif /* !(Ultrix && mips && _POSIX_VERSION) */ + +/* getpgrp () varies between systems. Even systems that claim to be + Posix.1 compatible lie sometimes (Ultrix, SunOS4, apollo). */ +#if defined (GETPGRP_VOID) +# define getpgid(p) getpgrp () +#else +# define getpgid(p) getpgrp (p) +#endif /* !GETPGRP_VOID */ + +/* If the system needs it, REINSTALL_SIGCHLD_HANDLER will reinstall the + handler for SIGCHLD. */ +#if defined (MUST_REINSTALL_SIGHANDLERS) +# define REINSTALL_SIGCHLD_HANDLER signal (SIGCHLD, sigchld_handler) +#else +# define REINSTALL_SIGCHLD_HANDLER +#endif /* !MUST_REINSTALL_SIGHANDLERS */ + +/* Some systems let waitpid(2) tell callers about stopped children. */ +#if !defined (WCONTINUED) || defined (WCONTINUED_BROKEN) +# undef WCONTINUED +# define WCONTINUED 0 +#endif +#if !defined (WIFCONTINUED) +# define WIFCONTINUED(s) (0) +#endif + +/* The number of additional slots to allocate when we run out. */ +#define JOB_SLOTS 8 + +typedef int sh_job_map_func_t __P((JOB *, int, int, int)); + +/* Variables used here but defined in other files. */ +extern int subshell_environment, line_number; +extern int posixly_correct, shell_level; +extern int last_command_exit_value, last_command_exit_signal; +extern int loop_level, breaking; +extern int executing_list; +extern int sourcelevel; +extern int running_trap; +extern sh_builtin_func_t *this_shell_builtin; +extern char *shell_name, *this_command_name; +extern sigset_t top_level_mask; +extern procenv_t wait_intr_buf; +extern int wait_signal_received; +extern WORD_LIST *subst_assign_varlist; + +static struct jobstats zerojs = { -1L, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NO_JOB, NO_JOB, 0, 0 }; +struct jobstats js = { -1L, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NO_JOB, NO_JOB, 0, 0 }; + +struct bgpids bgpids = { 0, 0, 0 }; + +/* The array of known jobs. */ +JOB **jobs = (JOB **)NULL; + +#if 0 +/* The number of slots currently allocated to JOBS. */ +int job_slots = 0; +#endif + +/* The controlling tty for this shell. */ +int shell_tty = -1; + +/* The shell's process group. */ +pid_t shell_pgrp = NO_PID; + +/* The terminal's process group. */ +pid_t terminal_pgrp = NO_PID; + +/* The process group of the shell's parent. */ +pid_t original_pgrp = NO_PID; + +/* The process group of the pipeline currently being made. */ +pid_t pipeline_pgrp = (pid_t)0; + +#if defined (PGRP_PIPE) +/* Pipes which each shell uses to communicate with the process group leader + until all of the processes in a pipeline have been started. Then the + process leader is allowed to continue. */ +int pgrp_pipe[2] = { -1, -1 }; +#endif + +#if 0 +/* The job which is current; i.e. the one that `%+' stands for. */ +int current_job = NO_JOB; + +/* The previous job; i.e. the one that `%-' stands for. */ +int previous_job = NO_JOB; +#endif + +/* Last child made by the shell. */ +volatile pid_t last_made_pid = NO_PID; + +/* Pid of the last asynchronous child. */ +volatile pid_t last_asynchronous_pid = NO_PID; + +/* The pipeline currently being built. */ +PROCESS *the_pipeline = (PROCESS *)NULL; + +/* If this is non-zero, do job control. */ +int job_control = 1; + +/* Call this when you start making children. */ +int already_making_children = 0; + +/* If this is non-zero, $LINES and $COLUMNS are reset after every process + exits from get_tty_state(). */ +int check_window_size = CHECKWINSIZE_DEFAULT; + +/* Functions local to this file. */ + +static sighandler wait_sigint_handler __P((int)); +static sighandler sigchld_handler __P((int)); +static sighandler sigcont_sighandler __P((int)); +static sighandler sigstop_sighandler __P((int)); + +static int waitchld __P((pid_t, int)); + +static PROCESS *find_pipeline __P((pid_t, int, int *)); +static PROCESS *find_process __P((pid_t, int, int *)); + +static char *current_working_directory __P((void)); +static char *job_working_directory __P((void)); +static char *j_strsignal __P((int)); +static char *printable_job_status __P((int, PROCESS *, int)); + +static PROCESS *find_last_proc __P((int, int)); +static pid_t find_last_pid __P((int, int)); + +static int set_new_line_discipline __P((int)); +static int map_over_jobs __P((sh_job_map_func_t *, int, int)); +static int job_last_stopped __P((int)); +static int job_last_running __P((int)); +static int most_recent_job_in_state __P((int, JOB_STATE)); +static int find_job __P((pid_t, int, PROCESS **)); +static int print_job __P((JOB *, int, int, int)); +static int process_exit_status __P((WAIT)); +static int process_exit_signal __P((WAIT)); +static int set_job_status_and_cleanup __P((int)); + +static WAIT job_signal_status __P((int)); +static WAIT raw_job_exit_status __P((int)); + +static void notify_of_job_status __P((void)); +static void reset_job_indices __P((void)); +static void cleanup_dead_jobs __P((void)); +static int processes_in_job __P((int)); +static void realloc_jobs_list __P((void)); +static int compact_jobs_list __P((int)); +static int discard_pipeline __P((PROCESS *)); +static void add_process __P((char *, pid_t)); +static void print_pipeline __P((PROCESS *, int, int, FILE *)); +static void pretty_print_job __P((int, int, FILE *)); +static void set_current_job __P((int)); +static void reset_current __P((void)); +static void set_job_running __P((int)); +static void setjstatus __P((int)); +static int maybe_give_terminal_to __P((pid_t, pid_t, int)); +static void mark_all_jobs_as_dead __P((void)); +static void mark_dead_jobs_as_notified __P((int)); +static void restore_sigint_handler __P((void)); +#if defined (PGRP_PIPE) +static void pipe_read __P((int *)); +#endif + +static struct pidstat *bgp_alloc __P((pid_t, int)); +static struct pidstat *bgp_add __P((pid_t, int)); +static int bgp_delete __P((pid_t)); +static void bgp_clear __P((void)); +static int bgp_search __P((pid_t)); +static void bgp_prune __P((void)); + +#if defined (ARRAY_VARS) +static int *pstatuses; /* list of pipeline statuses */ +static int statsize; +#endif + +/* Used to synchronize between wait_for and other functions and the SIGCHLD + signal handler. */ +static int sigchld; +static int queue_sigchld; + +#define QUEUE_SIGCHLD(os) (os) = sigchld, queue_sigchld++ + +#define UNQUEUE_SIGCHLD(os) \ + do { \ + queue_sigchld--; \ + if (queue_sigchld == 0 && os != sigchld) \ + waitchld (-1, 0); \ + } while (0) + +static SigHandler *old_tstp, *old_ttou, *old_ttin; +static SigHandler *old_cont = (SigHandler *)SIG_DFL; + +/* A place to temporarily save the current pipeline. */ +static PROCESS *saved_pipeline; +static int saved_already_making_children; + +/* Set this to non-zero whenever you don't want the jobs list to change at + all: no jobs deleted and no status change notifications. This is used, + for example, when executing SIGCHLD traps, which may run arbitrary + commands. */ +static int jobs_list_frozen; + +static char retcode_name_buffer[64]; + +#if !defined (_POSIX_VERSION) + +/* These are definitions to map POSIX 1003.1 functions onto existing BSD + library functions and system calls. */ +#define setpgid(pid, pgrp) setpgrp (pid, pgrp) +#define tcsetpgrp(fd, pgrp) ioctl ((fd), TIOCSPGRP, &(pgrp)) + +pid_t +tcgetpgrp (fd) + int fd; +{ + pid_t pgrp; + + /* ioctl will handle setting errno correctly. */ + if (ioctl (fd, TIOCGPGRP, &pgrp) < 0) + return (-1); + return (pgrp); +} + +#endif /* !_POSIX_VERSION */ + +/* Initialize the global job stats structure and other bookkeeping variables */ +void +init_job_stats () +{ + js = zerojs; +} + +/* Return the working directory for the current process. Unlike + job_working_directory, this does not call malloc (), nor do any + of the functions it calls. This is so that it can safely be called + from a signal handler. */ +static char * +current_working_directory () +{ + char *dir; + static char d[PATH_MAX]; + + dir = get_string_value ("PWD"); + + if (dir == 0 && the_current_working_directory && no_symbolic_links) + dir = the_current_working_directory; + + if (dir == 0) + { + dir = getcwd (d, sizeof(d)); + if (dir) + dir = d; + } + + return (dir == 0) ? "" : dir; +} + +/* Return the working directory for the current process. */ +static char * +job_working_directory () +{ + char *dir; + + dir = get_string_value ("PWD"); + if (dir) + return (savestring (dir)); + + dir = get_working_directory ("job-working-directory"); + if (dir) + return (dir); + + return (savestring ("")); +} + +void +making_children () +{ + if (already_making_children) + return; + + already_making_children = 1; + start_pipeline (); +} + +void +stop_making_children () +{ + already_making_children = 0; +} + +void +cleanup_the_pipeline () +{ + PROCESS *disposer; + sigset_t set, oset; + + BLOCK_CHILD (set, oset); + disposer = the_pipeline; + the_pipeline = (PROCESS *)NULL; + UNBLOCK_CHILD (oset); + + if (disposer) + discard_pipeline (disposer); +} + +void +save_pipeline (clear) + int clear; +{ + saved_pipeline = the_pipeline; + if (clear) + the_pipeline = (PROCESS *)NULL; + saved_already_making_children = already_making_children; +} + +void +restore_pipeline (discard) + int discard; +{ + PROCESS *old_pipeline; + + old_pipeline = the_pipeline; + the_pipeline = saved_pipeline; + already_making_children = saved_already_making_children; + if (discard && old_pipeline) + discard_pipeline (old_pipeline); +} + +/* Start building a pipeline. */ +void +start_pipeline () +{ + if (the_pipeline) + { + cleanup_the_pipeline (); + pipeline_pgrp = 0; +#if defined (PGRP_PIPE) + sh_closepipe (pgrp_pipe); +#endif + } + +#if defined (PGRP_PIPE) + if (job_control) + { + if (pipe (pgrp_pipe) == -1) + sys_error (_("start_pipeline: pgrp pipe")); + } +#endif +} + +/* Stop building a pipeline. Install the process list in the job array. + This returns the index of the newly installed job. + DEFERRED is a command structure to be executed upon satisfactory + execution exit of this pipeline. */ +int +stop_pipeline (async, deferred) + int async; + COMMAND *deferred; +{ + register int i, j; + JOB *newjob; + sigset_t set, oset; + + BLOCK_CHILD (set, oset); + +#if defined (PGRP_PIPE) + /* The parent closes the process group synchronization pipe. */ + sh_closepipe (pgrp_pipe); +#endif + + cleanup_dead_jobs (); + + if (js.j_jobslots == 0) + { + js.j_jobslots = JOB_SLOTS; + jobs = (JOB **)xmalloc (js.j_jobslots * sizeof (JOB *)); + + /* Now blank out these new entries. */ + for (i = 0; i < js.j_jobslots; i++) + jobs[i] = (JOB *)NULL; + + js.j_firstj = js.j_lastj = js.j_njobs = 0; + } + + /* Scan from the last slot backward, looking for the next free one. */ + /* XXX - revisit this interactive assumption */ + /* XXX - this way for now */ + if (interactive) + { + for (i = js.j_jobslots; i; i--) + if (jobs[i - 1]) + break; + } + else + { +#if 0 + /* This wraps around, but makes it inconvenient to extend the array */ + for (i = js.j_lastj+1; i != js.j_lastj; i++) + { + if (i >= js.j_jobslots) + i = 0; + if (jobs[i] == 0) + break; + } + if (i == js.j_lastj) + i = js.j_jobslots; +#else + /* This doesn't wrap around yet. */ + for (i = js.j_lastj ? js.j_lastj + 1 : js.j_lastj; i < js.j_jobslots; i++) + if (jobs[i] == 0) + break; +#endif + } + + /* Do we need more room? */ + + /* First try compaction */ + if ((interactive_shell == 0 || subshell_environment) && i == js.j_jobslots && js.j_jobslots >= MAX_JOBS_IN_ARRAY) + i = compact_jobs_list (0); + + /* If we can't compact, reallocate */ + if (i == js.j_jobslots) + { + js.j_jobslots += JOB_SLOTS; + jobs = (JOB **)xrealloc (jobs, (js.j_jobslots * sizeof (JOB *))); + + for (j = i; j < js.j_jobslots; j++) + jobs[j] = (JOB *)NULL; + } + + /* Add the current pipeline to the job list. */ + if (the_pipeline) + { + register PROCESS *p; + int any_running, any_stopped, n; + + newjob = (JOB *)xmalloc (sizeof (JOB)); + + for (n = 1, p = the_pipeline; p->next != the_pipeline; n++, p = p->next) + ; + p->next = (PROCESS *)NULL; + newjob->pipe = REVERSE_LIST (the_pipeline, PROCESS *); + for (p = newjob->pipe; p->next; p = p->next) + ; + p->next = newjob->pipe; + + the_pipeline = (PROCESS *)NULL; + newjob->pgrp = pipeline_pgrp; + pipeline_pgrp = 0; + + newjob->flags = 0; + + /* Flag to see if in another pgrp. */ + if (job_control) + newjob->flags |= J_JOBCONTROL; + + /* Set the state of this pipeline. */ + p = newjob->pipe; + any_running = any_stopped = 0; + do + { + any_running |= PRUNNING (p); + any_stopped |= PSTOPPED (p); + p = p->next; + } + while (p != newjob->pipe); + + newjob->state = any_running ? JRUNNING : (any_stopped ? JSTOPPED : JDEAD); + newjob->wd = job_working_directory (); + newjob->deferred = deferred; + + newjob->j_cleanup = (sh_vptrfunc_t *)NULL; + newjob->cleanarg = (PTR_T) NULL; + + jobs[i] = newjob; + if (newjob->state == JDEAD && (newjob->flags & J_FOREGROUND)) + setjstatus (i); + if (newjob->state == JDEAD) + { + js.c_reaped += n; /* wouldn't have been done since this was not part of a job */ + js.j_ndead++; + } + js.c_injobs += n; + + js.j_lastj = i; + js.j_njobs++; + } + else + newjob = (JOB *)NULL; + + if (newjob) + js.j_lastmade = newjob; + + if (async) + { + if (newjob) + { + newjob->flags &= ~J_FOREGROUND; + newjob->flags |= J_ASYNC; + js.j_lastasync = newjob; + } + reset_current (); + } + else + { + if (newjob) + { + newjob->flags |= J_FOREGROUND; + /* + * !!!!! NOTE !!!!! (chet@ins.cwru.edu) + * + * The currently-accepted job control wisdom says to set the + * terminal's process group n+1 times in an n-step pipeline: + * once in the parent and once in each child. This is where + * the parent gives it away. + * + * Don't give the terminal away if this shell is an asynchronous + * subshell. + * + */ + if (job_control && newjob->pgrp && (subshell_environment&SUBSHELL_ASYNC) == 0) + maybe_give_terminal_to (shell_pgrp, newjob->pgrp, 0); + } + } + + stop_making_children (); + UNBLOCK_CHILD (oset); + return (newjob ? i : js.j_current); +} + +/* Functions to manage the list of exited background pids whose status has + been saved. */ + +static struct pidstat * +bgp_alloc (pid, status) + pid_t pid; + int status; +{ + struct pidstat *ps; + + ps = (struct pidstat *)xmalloc (sizeof (struct pidstat)); + ps->pid = pid; + ps->status = status; + ps->next = (struct pidstat *)0; + return ps; +} + +static struct pidstat * +bgp_add (pid, status) + pid_t pid; + int status; +{ + struct pidstat *ps; + + ps = bgp_alloc (pid, status); + + if (bgpids.list == 0) + { + bgpids.list = bgpids.end = ps; + bgpids.npid = 0; /* just to make sure */ + } + else + { + bgpids.end->next = ps; + bgpids.end = ps; + } + bgpids.npid++; + + if (bgpids.npid > js.c_childmax) + bgp_prune (); + + return ps; +} + +static int +bgp_delete (pid) + pid_t pid; +{ + struct pidstat *prev, *p; + + for (prev = p = bgpids.list; p; prev = p, p = p->next) + if (p->pid == pid) + { + prev->next = p->next; /* remove from list */ + break; + } + + if (p == 0) + return 0; /* not found */ + +#if defined (DEBUG) + itrace("bgp_delete: deleting %d", pid); +#endif + + /* Housekeeping in the border cases. */ + if (p == bgpids.list) + bgpids.list = bgpids.list->next; + else if (p == bgpids.end) + bgpids.end = prev; + + bgpids.npid--; + if (bgpids.npid == 0) + bgpids.list = bgpids.end = 0; + else if (bgpids.npid == 1) + bgpids.end = bgpids.list; /* just to make sure */ + + free (p); + return 1; +} + +/* Clear out the list of saved statuses */ +static void +bgp_clear () +{ + struct pidstat *ps, *p; + + for (ps = bgpids.list; ps; ) + { + p = ps; + ps = ps->next; + free (p); + } + bgpids.list = bgpids.end = 0; + bgpids.npid = 0; +} + +/* Search for PID in the list of saved background pids; return its status if + found. If not found, return -1. */ +static int +bgp_search (pid) + pid_t pid; +{ + struct pidstat *ps; + + for (ps = bgpids.list ; ps; ps = ps->next) + if (ps->pid == pid) + return ps->status; + return -1; +} + +static void +bgp_prune () +{ + struct pidstat *ps; + + while (bgpids.npid > js.c_childmax) + { + ps = bgpids.list; + bgpids.list = bgpids.list->next; + free (ps); + bgpids.npid--; + } +} + +/* Reset the values of js.j_lastj and js.j_firstj after one or both have + been deleted. The caller should check whether js.j_njobs is 0 before + calling this. This wraps around, but the rest of the code does not. At + this point, it should not matter. */ +static void +reset_job_indices () +{ + int old; + + if (jobs[js.j_firstj] == 0) + { + old = js.j_firstj++; + if (old >= js.j_jobslots) + old = js.j_jobslots - 1; + while (js.j_firstj != old) + { + if (js.j_firstj >= js.j_jobslots) + js.j_firstj = 0; + if (jobs[js.j_firstj] || js.j_firstj == old) /* needed if old == 0 */ + break; + js.j_firstj++; + } + if (js.j_firstj == old) + js.j_firstj = js.j_lastj = js.j_njobs = 0; + } + if (jobs[js.j_lastj] == 0) + { + old = js.j_lastj--; + if (old < 0) + old = 0; + while (js.j_lastj != old) + { + if (js.j_lastj < 0) + js.j_lastj = js.j_jobslots - 1; + if (jobs[js.j_lastj] || js.j_lastj == old) /* needed if old == js.j_jobslots */ + break; + js.j_lastj--; + } + if (js.j_lastj == old) + js.j_firstj = js.j_lastj = js.j_njobs = 0; + } +} + +/* Delete all DEAD jobs that the user had received notification about. */ +static void +cleanup_dead_jobs () +{ + register int i; + int os; + + if (js.j_jobslots == 0 || jobs_list_frozen) + return; + + QUEUE_SIGCHLD(os); + + /* XXX could use js.j_firstj and js.j_lastj here */ + for (i = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("cleanup_dead_jobs: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("cleanup_dead_jobs: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + + if (jobs[i] && DEADJOB (i) && IS_NOTIFIED (i)) + delete_job (i, 0); + } + +#if defined (COPROCESS_SUPPORT) + coproc_reap (); +#endif + + UNQUEUE_SIGCHLD(os); +} + +static int +processes_in_job (job) + int job; +{ + int nproc; + register PROCESS *p; + + nproc = 0; + p = jobs[job]->pipe; + do + { + p = p->next; + nproc++; + } + while (p != jobs[job]->pipe); + + return nproc; +} + +static void +delete_old_job (pid) + pid_t pid; +{ + PROCESS *p; + int job; + + job = find_job (pid, 0, &p); + if (job != NO_JOB) + { +#ifdef DEBUG + itrace ("delete_old_job: found pid %d in job %d with state %d", pid, job, jobs[job]->state); +#endif + if (JOBSTATE (job) == JDEAD) + delete_job (job, DEL_NOBGPID); + else + { +#ifdef DEBUG + internal_warning (_("forked pid %d appears in running job %d"), pid, job+1); +#endif + if (p) + p->pid = 0; + } + } +} + +/* Reallocate and compress the jobs list. This returns with a jobs array + whose size is a multiple of JOB_SLOTS and can hold the current number of + jobs. Heuristics are used to minimize the number of new reallocs. */ +static void +realloc_jobs_list () +{ + sigset_t set, oset; + int nsize, i, j, ncur, nprev; + JOB **nlist; + + ncur = nprev = NO_JOB; + nsize = ((js.j_njobs + JOB_SLOTS - 1) / JOB_SLOTS); + nsize *= JOB_SLOTS; + i = js.j_njobs % JOB_SLOTS; + if (i == 0 || i > (JOB_SLOTS >> 1)) + nsize += JOB_SLOTS; + + BLOCK_CHILD (set, oset); + nlist = (js.j_jobslots == nsize) ? jobs : (JOB **) xmalloc (nsize * sizeof (JOB *)); + + js.c_reaped = js.j_ndead = 0; + for (i = j = 0; i < js.j_jobslots; i++) + if (jobs[i]) + { + if (i == js.j_current) + ncur = j; + if (i == js.j_previous) + nprev = j; + nlist[j++] = jobs[i]; + if (jobs[i]->state == JDEAD) + { + js.j_ndead++; + js.c_reaped += processes_in_job (i); + } + } + +#if 0 + itrace ("realloc_jobs_list: resize jobs list from %d to %d", js.j_jobslots, nsize); + itrace ("realloc_jobs_list: j_lastj changed from %d to %d", js.j_lastj, (j > 0) ? j - 1 : 0); + itrace ("realloc_jobs_list: j_njobs changed from %d to %d", js.j_njobs, j); + itrace ("realloc_jobs_list: js.j_ndead %d js.c_reaped %d", js.j_ndead, js.c_reaped); +#endif + + js.j_firstj = 0; + js.j_lastj = (j > 0) ? j - 1 : 0; + js.j_njobs = j; + js.j_jobslots = nsize; + + /* Zero out remaining slots in new jobs list */ + for ( ; j < nsize; j++) + nlist[j] = (JOB *)NULL; + + if (jobs != nlist) + { + free (jobs); + jobs = nlist; + } + + if (ncur != NO_JOB) + js.j_current = ncur; + if (nprev != NO_JOB) + js.j_previous = nprev; + + /* Need to reset these */ + if (js.j_current == NO_JOB || js.j_previous == NO_JOB || js.j_current > js.j_lastj || js.j_previous > js.j_lastj) + reset_current (); + +#if 0 + itrace ("realloc_jobs_list: reset js.j_current (%d) and js.j_previous (%d)", js.j_current, js.j_previous); +#endif + + UNBLOCK_CHILD (oset); +} + +/* Compact the jobs list by removing dead jobs. Assume that we have filled + the jobs array to some predefined maximum. Called when the shell is not + the foreground process (subshell_environment != 0). Returns the first + available slot in the compacted list. If that value is js.j_jobslots, then + the list needs to be reallocated. The jobs array may be in new memory if + this returns > 0 and < js.j_jobslots. FLAGS is reserved for future use. */ +static int +compact_jobs_list (flags) + int flags; +{ + if (js.j_jobslots == 0 || jobs_list_frozen) + return js.j_jobslots; + + reap_dead_jobs (); + realloc_jobs_list (); + +#if 0 + itrace("compact_jobs_list: returning %d", (js.j_lastj || jobs[js.j_lastj]) ? js.j_lastj + 1 : 0); +#endif + + return ((js.j_lastj || jobs[js.j_lastj]) ? js.j_lastj + 1 : 0); +} + +/* Delete the job at INDEX from the job list. Must be called + with SIGCHLD blocked. */ +void +delete_job (job_index, dflags) + int job_index, dflags; +{ + register JOB *temp; + PROCESS *proc; + int ndel; + + if (js.j_jobslots == 0 || jobs_list_frozen) + return; + + if ((dflags & DEL_WARNSTOPPED) && subshell_environment == 0 && STOPPED (job_index)) + internal_warning (_("deleting stopped job %d with process group %ld"), job_index+1, (long)jobs[job_index]->pgrp); + temp = jobs[job_index]; + if (temp == 0) + return; + + if ((dflags & DEL_NOBGPID) == 0) + { + proc = find_last_proc (job_index, 0); + /* Could do this just for J_ASYNC jobs, but we save all. */ + if (proc) + bgp_add (proc->pid, process_exit_status (proc->status)); + } + + jobs[job_index] = (JOB *)NULL; + if (temp == js.j_lastmade) + js.j_lastmade = 0; + else if (temp == js.j_lastasync) + js.j_lastasync = 0; + + free (temp->wd); + ndel = discard_pipeline (temp->pipe); + + js.c_injobs -= ndel; + if (temp->state == JDEAD) + { + js.c_reaped -= ndel; + js.j_ndead--; + if (js.c_reaped < 0) + { +#ifdef DEBUG + itrace("delete_job (%d pgrp %d): js.c_reaped (%d) < 0 ndel = %d js.j_ndead = %d", job_index, temp->pgrp, js.c_reaped, ndel, js.j_ndead); +#endif + js.c_reaped = 0; + } + } + + if (temp->deferred) + dispose_command (temp->deferred); + + free (temp); + + js.j_njobs--; + if (js.j_njobs == 0) + js.j_firstj = js.j_lastj = 0; + else if (jobs[js.j_firstj] == 0 || jobs[js.j_lastj] == 0) + reset_job_indices (); + + if (job_index == js.j_current || job_index == js.j_previous) + reset_current (); +} + +/* Must be called with SIGCHLD blocked. */ +void +nohup_job (job_index) + int job_index; +{ + register JOB *temp; + + if (js.j_jobslots == 0) + return; + + if (temp = jobs[job_index]) + temp->flags |= J_NOHUP; +} + +/* Get rid of the data structure associated with a process chain. */ +static int +discard_pipeline (chain) + register PROCESS *chain; +{ + register PROCESS *this, *next; + int n; + + this = chain; + n = 0; + do + { + next = this->next; + FREE (this->command); + free (this); + n++; + this = next; + } + while (this != chain); + + return n; +} + +/* Add this process to the chain being built in the_pipeline. + NAME is the command string that will be exec'ed later. + PID is the process id of the child. */ +static void +add_process (name, pid) + char *name; + pid_t pid; +{ + PROCESS *t, *p; + +#if defined (RECYCLES_PIDS) + int j; + p = find_process (pid, 0, &j); + if (p) + { +# ifdef DEBUG + if (j == NO_JOB) + internal_warning (_("add_process: process %5ld (%s) in the_pipeline"), (long)p->pid, p->command); +# endif + if (PALIVE (p)) + internal_warning (_("add_process: pid %5ld (%s) marked as still alive"), (long)p->pid, p->command); + p->running = PS_RECYCLED; /* mark as recycled */ + } +#endif + + t = (PROCESS *)xmalloc (sizeof (PROCESS)); + t->next = the_pipeline; + t->pid = pid; + WSTATUS (t->status) = 0; + t->running = PS_RUNNING; + t->command = name; + the_pipeline = t; + + if (t->next == 0) + t->next = t; + else + { + p = t->next; + while (p->next != t->next) + p = p->next; + p->next = t; + } +} + +/* Create a (dummy) PROCESS with NAME, PID, and STATUS, and make it the last + process in jobs[JID]->pipe. Used by the lastpipe code. */ +void +append_process (name, pid, status, jid) + char *name; + pid_t pid; + int status; + int jid; +{ + PROCESS *t, *p; + + t = (PROCESS *)xmalloc (sizeof (PROCESS)); + t->next = (PROCESS *)NULL; + t->pid = pid; + /* set process exit status using offset discovered by configure */ + t->status = (status & 0xff) << WEXITSTATUS_OFFSET; + t->running = PS_DONE; + t->command = name; + + js.c_reaped++; /* XXX */ + + for (p = jobs[jid]->pipe; p->next != jobs[jid]->pipe; p = p->next) + ; + p->next = t; + t->next = jobs[jid]->pipe; +} + +#if 0 +/* Take the last job and make it the first job. Must be called with + SIGCHLD blocked. */ +int +rotate_the_pipeline () +{ + PROCESS *p; + + if (the_pipeline->next == the_pipeline) + return; + for (p = the_pipeline; p->next != the_pipeline; p = p->next) + ; + the_pipeline = p; +} + +/* Reverse the order of the processes in the_pipeline. Must be called with + SIGCHLD blocked. */ +int +reverse_the_pipeline () +{ + PROCESS *p, *n; + + if (the_pipeline->next == the_pipeline) + return; + + for (p = the_pipeline; p->next != the_pipeline; p = p->next) + ; + p->next = (PROCESS *)NULL; + + n = REVERSE_LIST (the_pipeline, PROCESS *); + + the_pipeline = n; + for (p = the_pipeline; p->next; p = p->next) + ; + p->next = the_pipeline; +} +#endif + +/* Map FUNC over the list of jobs. If FUNC returns non-zero, + then it is time to stop mapping, and that is the return value + for map_over_jobs. FUNC is called with a JOB, arg1, arg2, + and INDEX. */ +static int +map_over_jobs (func, arg1, arg2) + sh_job_map_func_t *func; + int arg1, arg2; +{ + register int i; + int result; + sigset_t set, oset; + + if (js.j_jobslots == 0) + return 0; + + BLOCK_CHILD (set, oset); + + /* XXX could use js.j_firstj here */ + for (i = result = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("map_over_jobs: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("map_over_jobs: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + if (jobs[i]) + { + result = (*func)(jobs[i], arg1, arg2, i); + if (result) + break; + } + } + + UNBLOCK_CHILD (oset); + + return (result); +} + +/* Cause all the jobs in the current pipeline to exit. */ +void +terminate_current_pipeline () +{ + if (pipeline_pgrp && pipeline_pgrp != shell_pgrp) + { + killpg (pipeline_pgrp, SIGTERM); + killpg (pipeline_pgrp, SIGCONT); + } +} + +/* Cause all stopped jobs to exit. */ +void +terminate_stopped_jobs () +{ + register int i; + + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + { + if (jobs[i] && STOPPED (i)) + { + killpg (jobs[i]->pgrp, SIGTERM); + killpg (jobs[i]->pgrp, SIGCONT); + } + } +} + +/* Cause all jobs, running or stopped, to receive a hangup signal. If + a job is marked J_NOHUP, don't send the SIGHUP. */ +void +hangup_all_jobs () +{ + register int i; + + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + { + if (jobs[i]) + { + if (jobs[i]->flags & J_NOHUP) + continue; + killpg (jobs[i]->pgrp, SIGHUP); + if (STOPPED (i)) + killpg (jobs[i]->pgrp, SIGCONT); + } + } +} + +void +kill_current_pipeline () +{ + stop_making_children (); + start_pipeline (); +} + +/* Return the pipeline that PID belongs to. Note that the pipeline + doesn't have to belong to a job. Must be called with SIGCHLD blocked. + If JOBP is non-null, return the index of the job containing PID. */ +static PROCESS * +find_pipeline (pid, alive_only, jobp) + pid_t pid; + int alive_only; + int *jobp; /* index into jobs list or NO_JOB */ +{ + int job; + PROCESS *p; + + /* See if this process is in the pipeline that we are building. */ + if (jobp) + *jobp = NO_JOB; + if (the_pipeline) + { + p = the_pipeline; + do + { + /* Return it if we found it. Don't ever return a recycled pid. */ + if (p->pid == pid && ((alive_only == 0 && PRECYCLED(p) == 0) || PALIVE(p))) + return (p); + + p = p->next; + } + while (p != the_pipeline); + } + + job = find_job (pid, alive_only, &p); + if (jobp) + *jobp = job; + return (job == NO_JOB) ? (PROCESS *)NULL : jobs[job]->pipe; +} + +/* Return the PROCESS * describing PID. If JOBP is non-null return the index + into the jobs array of the job containing PID. Must be called with + SIGCHLD blocked. */ +static PROCESS * +find_process (pid, alive_only, jobp) + pid_t pid; + int alive_only; + int *jobp; /* index into jobs list or NO_JOB */ +{ + PROCESS *p; + + p = find_pipeline (pid, alive_only, jobp); + while (p && p->pid != pid) + p = p->next; + return p; +} + +/* Return the job index that PID belongs to, or NO_JOB if it doesn't + belong to any job. Must be called with SIGCHLD blocked. */ +static int +find_job (pid, alive_only, procp) + pid_t pid; + int alive_only; + PROCESS **procp; +{ + register int i; + PROCESS *p; + + /* XXX could use js.j_firstj here, and should check js.j_lastj */ + for (i = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("find_job: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("find_job: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + if (jobs[i]) + { + p = jobs[i]->pipe; + + do + { + if (p->pid == pid && ((alive_only == 0 && PRECYCLED(p) == 0) || PALIVE(p))) + { + if (procp) + *procp = p; + return (i); + } + + p = p->next; + } + while (p != jobs[i]->pipe); + } + } + + return (NO_JOB); +} + +/* Find a job given a PID. If BLOCK is non-zero, block SIGCHLD as + required by find_job. */ +int +get_job_by_pid (pid, block) + pid_t pid; + int block; +{ + int job; + sigset_t set, oset; + + if (block) + BLOCK_CHILD (set, oset); + + job = find_job (pid, 0, NULL); + + if (block) + UNBLOCK_CHILD (oset); + + return job; +} + +/* Print descriptive information about the job with leader pid PID. */ +void +describe_pid (pid) + pid_t pid; +{ + int job; + sigset_t set, oset; + + BLOCK_CHILD (set, oset); + + job = find_job (pid, 0, NULL); + + if (job != NO_JOB) + fprintf (stderr, "[%d] %ld\n", job + 1, (long)pid); + else + programming_error (_("describe_pid: %ld: no such pid"), (long)pid); + + UNBLOCK_CHILD (oset); +} + +static char * +j_strsignal (s) + int s; +{ + char *x; + + x = strsignal (s); + if (x == 0) + { + x = retcode_name_buffer; + sprintf (x, _("Signal %d"), s); + } + return x; +} + +static char * +printable_job_status (j, p, format) + int j; + PROCESS *p; + int format; +{ + static char *temp; + int es; + + temp = _("Done"); + + if (STOPPED (j) && format == 0) + { + if (posixly_correct == 0 || p == 0 || (WIFSTOPPED (p->status) == 0)) + temp = _("Stopped"); + else + { + temp = retcode_name_buffer; + sprintf (temp, _("Stopped(%s)"), signal_name (WSTOPSIG (p->status))); + } + } + else if (RUNNING (j)) + temp = _("Running"); + else + { + if (WIFSTOPPED (p->status)) + temp = j_strsignal (WSTOPSIG (p->status)); + else if (WIFSIGNALED (p->status)) + temp = j_strsignal (WTERMSIG (p->status)); + else if (WIFEXITED (p->status)) + { + temp = retcode_name_buffer; + es = WEXITSTATUS (p->status); + if (es == 0) + strcpy (temp, _("Done")); + else if (posixly_correct) + sprintf (temp, _("Done(%d)"), es); + else + sprintf (temp, _("Exit %d"), es); + } + else + temp = _("Unknown status"); + } + + return temp; +} + +/* This is the way to print out information on a job if you + know the index. FORMAT is: + + JLIST_NORMAL) [1]+ Running emacs + JLIST_LONG ) [1]+ 2378 Running emacs + -1 ) [1]+ 2378 emacs + + JLIST_NORMAL) [1]+ Stopped ls | more + JLIST_LONG ) [1]+ 2369 Stopped ls + 2367 | more + JLIST_PID_ONLY) + Just list the pid of the process group leader (really + the process group). + JLIST_CHANGED_ONLY) + Use format JLIST_NORMAL, but list only jobs about which + the user has not been notified. */ + +/* Print status for pipeline P. If JOB_INDEX is >= 0, it is the index into + the JOBS array corresponding to this pipeline. FORMAT is as described + above. Must be called with SIGCHLD blocked. + + If you're printing a pipeline that's not in the jobs array, like the + current pipeline as it's being created, pass -1 for JOB_INDEX */ +static void +print_pipeline (p, job_index, format, stream) + PROCESS *p; + int job_index, format; + FILE *stream; +{ + PROCESS *first, *last, *show; + int es, name_padding; + char *temp; + + if (p == 0) + return; + + first = last = p; + while (last->next != first) + last = last->next; + + for (;;) + { + if (p != first) + fprintf (stream, format ? " " : " |"); + + if (format != JLIST_STANDARD) + fprintf (stream, "%5ld", (long)p->pid); + + fprintf (stream, " "); + + if (format > -1 && job_index >= 0) + { + show = format ? p : last; + temp = printable_job_status (job_index, show, format); + + if (p != first) + { + if (format) + { + if (show->running == first->running && + WSTATUS (show->status) == WSTATUS (first->status)) + temp = ""; + } + else + temp = (char *)NULL; + } + + if (temp) + { + fprintf (stream, "%s", temp); + + es = STRLEN (temp); + if (es == 0) + es = 2; /* strlen ("| ") */ + name_padding = LONGEST_SIGNAL_DESC - es; + + fprintf (stream, "%*s", name_padding, ""); + + if ((WIFSTOPPED (show->status) == 0) && + (WIFCONTINUED (show->status) == 0) && + WIFCORED (show->status)) + fprintf (stream, _("(core dumped) ")); + } + } + + if (p != first && format) + fprintf (stream, "| "); + + if (p->command) + fprintf (stream, "%s", p->command); + + if (p == last && job_index >= 0) + { + temp = current_working_directory (); + + if (RUNNING (job_index) && (IS_FOREGROUND (job_index) == 0)) + fprintf (stream, " &"); + + if (strcmp (temp, jobs[job_index]->wd) != 0) + fprintf (stream, + _(" (wd: %s)"), polite_directory_format (jobs[job_index]->wd)); + } + + if (format || (p == last)) + { + /* We need to add a CR only if this is an interactive shell, and + we're reporting the status of a completed job asynchronously. + We can't really check whether this particular job is being + reported asynchronously, so just add the CR if the shell is + currently interactive and asynchronous notification is enabled. */ + if (asynchronous_notification && interactive) + fprintf (stream, "\r\n"); + else + fprintf (stream, "\n"); + } + + if (p == last) + break; + p = p->next; + } + fflush (stream); +} + +/* Print information to STREAM about jobs[JOB_INDEX] according to FORMAT. + Must be called with SIGCHLD blocked or queued with queue_sigchld */ +static void +pretty_print_job (job_index, format, stream) + int job_index, format; + FILE *stream; +{ + register PROCESS *p; + + /* Format only pid information about the process group leader? */ + if (format == JLIST_PID_ONLY) + { + fprintf (stream, "%ld\n", (long)jobs[job_index]->pipe->pid); + return; + } + + if (format == JLIST_CHANGED_ONLY) + { + if (IS_NOTIFIED (job_index)) + return; + format = JLIST_STANDARD; + } + + if (format != JLIST_NONINTERACTIVE) + fprintf (stream, "[%d]%c ", job_index + 1, + (job_index == js.j_current) ? '+': + (job_index == js.j_previous) ? '-' : ' '); + + if (format == JLIST_NONINTERACTIVE) + format = JLIST_LONG; + + p = jobs[job_index]->pipe; + + print_pipeline (p, job_index, format, stream); + + /* We have printed information about this job. When the job's + status changes, waitchld () sets the notification flag to 0. */ + jobs[job_index]->flags |= J_NOTIFIED; +} + +static int +print_job (job, format, state, job_index) + JOB *job; + int format, state, job_index; +{ + if (state == -1 || (JOB_STATE)state == job->state) + pretty_print_job (job_index, format, stdout); + return (0); +} + +void +list_one_job (job, format, ignore, job_index) + JOB *job; + int format, ignore, job_index; +{ + pretty_print_job (job_index, format, stdout); +} + +void +list_stopped_jobs (format) + int format; +{ + cleanup_dead_jobs (); + map_over_jobs (print_job, format, (int)JSTOPPED); +} + +void +list_running_jobs (format) + int format; +{ + cleanup_dead_jobs (); + map_over_jobs (print_job, format, (int)JRUNNING); +} + +/* List jobs. If FORMAT is non-zero, then the long form of the information + is printed, else just a short version. */ +void +list_all_jobs (format) + int format; +{ + cleanup_dead_jobs (); + map_over_jobs (print_job, format, -1); +} + +/* Fork, handling errors. Returns the pid of the newly made child, or 0. + COMMAND is just for remembering the name of the command; we don't do + anything else with it. ASYNC_P says what to do with the tty. If + non-zero, then don't give it away. */ +pid_t +make_child (command, async_p) + char *command; + int async_p; +{ + int forksleep; + sigset_t set, oset; + pid_t pid; + + /* XXX - block SIGTERM here and unblock in child after fork resets the + set of pending signals? */ + sigemptyset (&set); + sigaddset (&set, SIGCHLD); + sigaddset (&set, SIGINT); + sigemptyset (&oset); + sigprocmask (SIG_BLOCK, &set, &oset); + + making_children (); + + forksleep = 1; + +#if defined (BUFFERED_INPUT) + /* If default_buffered_input is active, we are reading a script. If + the command is asynchronous, we have already duplicated /dev/null + as fd 0, but have not changed the buffered stream corresponding to + the old fd 0. We don't want to sync the stream in this case. */ + if (default_buffered_input != -1 && + (!async_p || default_buffered_input > 0)) + sync_buffered_stream (default_buffered_input); +#endif /* BUFFERED_INPUT */ + + RESET_SIGTERM; + + /* Create the child, handle severe errors. Retry on EAGAIN. */ + while ((pid = fork ()) < 0 && errno == EAGAIN && forksleep < FORKSLEEP_MAX) + { + /* bash-4.2 */ + /* If we can't create any children, try to reap some dead ones. */ + waitchld (-1, 0); + + sys_error ("fork: retry"); + RESET_SIGTERM; + + if (sleep (forksleep) != 0) + break; + forksleep <<= 1; + } + + if (pid != 0) + RESET_SIGTERM; + + if (pid < 0) + { + sys_error ("fork"); + + /* Kill all of the processes in the current pipeline. */ + terminate_current_pipeline (); + + /* Discard the current pipeline, if any. */ + if (the_pipeline) + kill_current_pipeline (); + + last_command_exit_value = EX_NOEXEC; + throw_to_top_level (); /* Reset signals, etc. */ + } + + if (pid == 0) + { + /* In the child. Give this child the right process group, set the + signals to the default state for a new process. */ + pid_t mypid; + + mypid = getpid (); +#if defined (BUFFERED_INPUT) + /* Close default_buffered_input if it's > 0. We don't close it if it's + 0 because that's the file descriptor used when redirecting input, + and it's wrong to close the file in that case. */ + unset_bash_input (0); +#endif /* BUFFERED_INPUT */ + + /* Restore top-level signal mask. */ + sigprocmask (SIG_SETMASK, &top_level_mask, (sigset_t *)NULL); + + if (job_control) + { + /* All processes in this pipeline belong in the same + process group. */ + + if (pipeline_pgrp == 0) /* This is the first child. */ + pipeline_pgrp = mypid; + + /* Check for running command in backquotes. */ + if (pipeline_pgrp == shell_pgrp) + ignore_tty_job_signals (); + else + default_tty_job_signals (); + + /* Set the process group before trying to mess with the terminal's + process group. This is mandated by POSIX. */ + /* This is in accordance with the Posix 1003.1 standard, + section B.7.2.4, which says that trying to set the terminal + process group with tcsetpgrp() to an unused pgrp value (like + this would have for the first child) is an error. Section + B.4.3.3, p. 237 also covers this, in the context of job control + shells. */ + if (setpgid (mypid, pipeline_pgrp) < 0) + sys_error (_("child setpgid (%ld to %ld)"), (long)mypid, (long)pipeline_pgrp); + + /* By convention (and assumption above), if + pipeline_pgrp == shell_pgrp, we are making a child for + command substitution. + In this case, we don't want to give the terminal to the + shell's process group (we could be in the middle of a + pipeline, for example). */ + if (async_p == 0 && pipeline_pgrp != shell_pgrp && ((subshell_environment&SUBSHELL_ASYNC) == 0)) + give_terminal_to (pipeline_pgrp, 0); + +#if defined (PGRP_PIPE) + if (pipeline_pgrp == mypid) + pipe_read (pgrp_pipe); +#endif + } + else /* Without job control... */ + { + if (pipeline_pgrp == 0) + pipeline_pgrp = shell_pgrp; + + /* If these signals are set to SIG_DFL, we encounter the curious + situation of an interactive ^Z to a running process *working* + and stopping the process, but being unable to do anything with + that process to change its state. On the other hand, if they + are set to SIG_IGN, jobs started from scripts do not stop when + the shell running the script gets a SIGTSTP and stops. */ + + default_tty_job_signals (); + } + +#if defined (PGRP_PIPE) + /* Release the process group pipe, since our call to setpgid () + is done. The last call to sh_closepipe is done in stop_pipeline. */ + sh_closepipe (pgrp_pipe); +#endif /* PGRP_PIPE */ + +#if 0 + /* Don't set last_asynchronous_pid in the child */ + if (async_p) + last_asynchronous_pid = mypid; /* XXX */ + else +#endif +#if defined (RECYCLES_PIDS) + if (last_asynchronous_pid == mypid) + /* Avoid pid aliasing. 1 seems like a safe, unusual pid value. */ + last_asynchronous_pid = 1; +#endif + } + else + { + /* In the parent. Remember the pid of the child just created + as the proper pgrp if this is the first child. */ + + if (job_control) + { + if (pipeline_pgrp == 0) + { + pipeline_pgrp = pid; + /* Don't twiddle terminal pgrps in the parent! This is the bug, + not the good thing of twiddling them in the child! */ + /* give_terminal_to (pipeline_pgrp, 0); */ + } + /* This is done on the recommendation of the Rationale section of + the POSIX 1003.1 standard, where it discusses job control and + shells. It is done to avoid possible race conditions. (Ref. + 1003.1 Rationale, section B.4.3.3, page 236). */ + setpgid (pid, pipeline_pgrp); + } + else + { + if (pipeline_pgrp == 0) + pipeline_pgrp = shell_pgrp; + } + + /* Place all processes into the jobs array regardless of the + state of job_control. */ + add_process (command, pid); + + if (async_p) + last_asynchronous_pid = pid; +#if defined (RECYCLES_PIDS) + else if (last_asynchronous_pid == pid) + /* Avoid pid aliasing. 1 seems like a safe, unusual pid value. */ + last_asynchronous_pid = 1; +#endif + + /* Delete the saved status for any job containing this PID in case it's + been reused. */ + delete_old_job (pid); + + /* Perform the check for pid reuse unconditionally. Some systems reuse + PIDs before giving a process CHILD_MAX/_SC_CHILD_MAX unique ones. */ + bgp_delete (pid); /* new process, discard any saved status */ + + last_made_pid = pid; + + /* keep stats */ + js.c_totforked++; + js.c_living++; + + /* Unblock SIGINT and SIGCHLD unless creating a pipeline, in which case + SIGCHLD remains blocked until all commands in the pipeline have been + created. */ + sigprocmask (SIG_SETMASK, &oset, (sigset_t *)NULL); + } + + return (pid); +} + +/* These two functions are called only in child processes. */ +void +ignore_tty_job_signals () +{ + set_signal_handler (SIGTSTP, SIG_IGN); + set_signal_handler (SIGTTIN, SIG_IGN); + set_signal_handler (SIGTTOU, SIG_IGN); +} + +void +default_tty_job_signals () +{ + set_signal_handler (SIGTSTP, SIG_DFL); + set_signal_handler (SIGTTIN, SIG_DFL); + set_signal_handler (SIGTTOU, SIG_DFL); +} + +/* When we end a job abnormally, or if we stop a job, we set the tty to the + state kept in here. When a job ends normally, we set the state in here + to the state of the tty. */ + +static TTYSTRUCT shell_tty_info; + +#if defined (NEW_TTY_DRIVER) +static struct tchars shell_tchars; +static struct ltchars shell_ltchars; +#endif /* NEW_TTY_DRIVER */ + +#if defined (NEW_TTY_DRIVER) && defined (DRAIN_OUTPUT) +/* Since the BSD tty driver does not allow us to change the tty modes + while simultaneously waiting for output to drain and preserving + typeahead, we have to drain the output ourselves before calling + ioctl. We cheat by finding the length of the output queue, and + using select to wait for an appropriate length of time. This is + a hack, and should be labeled as such (it's a hastily-adapted + mutation of a `usleep' implementation). It's only reason for + existing is the flaw in the BSD tty driver. */ + +static int ttspeeds[] = +{ + 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, + 1800, 2400, 4800, 9600, 19200, 38400 +}; + +static void +draino (fd, ospeed) + int fd, ospeed; +{ + register int delay = ttspeeds[ospeed]; + int n; + + if (!delay) + return; + + while ((ioctl (fd, TIOCOUTQ, &n) == 0) && n) + { + if (n > (delay / 100)) + { + struct timeval tv; + + n *= 10; /* 2 bits more for conservativeness. */ + tv.tv_sec = n / delay; + tv.tv_usec = ((n % delay) * 1000000) / delay; + select (fd, (fd_set *)0, (fd_set *)0, (fd_set *)0, &tv); + } + else + break; + } +} +#endif /* NEW_TTY_DRIVER && DRAIN_OUTPUT */ + +/* Return the fd from which we are actually getting input. */ +#define input_tty() (shell_tty != -1) ? shell_tty : fileno (stderr) + +/* Fill the contents of shell_tty_info with the current tty info. */ +int +get_tty_state () +{ + int tty; + + tty = input_tty (); + if (tty != -1) + { +#if defined (NEW_TTY_DRIVER) + ioctl (tty, TIOCGETP, &shell_tty_info); + ioctl (tty, TIOCGETC, &shell_tchars); + ioctl (tty, TIOCGLTC, &shell_ltchars); +#endif /* NEW_TTY_DRIVER */ + +#if defined (TERMIO_TTY_DRIVER) + ioctl (tty, TCGETA, &shell_tty_info); +#endif /* TERMIO_TTY_DRIVER */ + +#if defined (TERMIOS_TTY_DRIVER) + if (tcgetattr (tty, &shell_tty_info) < 0) + { +#if 0 + /* Only print an error message if we're really interactive at + this time. */ + if (interactive) + sys_error ("[%ld: %d (%d)] tcgetattr", (long)getpid (), shell_level, tty); +#endif + return -1; + } +#endif /* TERMIOS_TTY_DRIVER */ + if (check_window_size) + get_new_window_size (0, (int *)0, (int *)0); + } + return 0; +} + +/* Make the current tty use the state in shell_tty_info. */ +int +set_tty_state () +{ + int tty; + + tty = input_tty (); + if (tty != -1) + { +#if defined (NEW_TTY_DRIVER) +# if defined (DRAIN_OUTPUT) + draino (tty, shell_tty_info.sg_ospeed); +# endif /* DRAIN_OUTPUT */ + ioctl (tty, TIOCSETN, &shell_tty_info); + ioctl (tty, TIOCSETC, &shell_tchars); + ioctl (tty, TIOCSLTC, &shell_ltchars); +#endif /* NEW_TTY_DRIVER */ + +#if defined (TERMIO_TTY_DRIVER) + ioctl (tty, TCSETAW, &shell_tty_info); +#endif /* TERMIO_TTY_DRIVER */ + +#if defined (TERMIOS_TTY_DRIVER) + if (tcsetattr (tty, TCSADRAIN, &shell_tty_info) < 0) + { + /* Only print an error message if we're really interactive at + this time. */ + if (interactive) + sys_error ("[%ld: %d (%d)] tcsetattr", (long)getpid (), shell_level, tty); + return -1; + } +#endif /* TERMIOS_TTY_DRIVER */ + } + return 0; +} + +/* Given an index into the jobs array JOB, return the PROCESS struct of the last + process in that job's pipeline. This is the one whose exit status + counts. Must be called with SIGCHLD blocked or queued. */ +static PROCESS * +find_last_proc (job, block) + int job; + int block; +{ + register PROCESS *p; + sigset_t set, oset; + + if (block) + BLOCK_CHILD (set, oset); + + p = jobs[job]->pipe; + while (p && p->next != jobs[job]->pipe) + p = p->next; + + if (block) + UNBLOCK_CHILD (oset); + + return (p); +} + +static pid_t +find_last_pid (job, block) + int job; + int block; +{ + PROCESS *p; + + p = find_last_proc (job, block); + /* Possible race condition here. */ + return p->pid; +} + +/* Wait for a particular child of the shell to finish executing. + This low-level function prints an error message if PID is not + a child of this shell. It returns -1 if it fails, or whatever + wait_for returns otherwise. If the child is not found in the + jobs table, it returns 127. */ +int +wait_for_single_pid (pid) + pid_t pid; +{ + register PROCESS *child; + sigset_t set, oset; + int r, job; + + BLOCK_CHILD (set, oset); + child = find_pipeline (pid, 0, (int *)NULL); + UNBLOCK_CHILD (oset); + + if (child == 0) + { + r = bgp_search (pid); + if (r >= 0) + return r; + } + + if (child == 0) + { + internal_error (_("wait: pid %ld is not a child of this shell"), (long)pid); + return (127); + } + + r = wait_for (pid); + + /* POSIX.2: if we just waited for a job, we can remove it from the jobs + table. */ + BLOCK_CHILD (set, oset); + job = find_job (pid, 0, NULL); + if (job != NO_JOB && jobs[job] && DEADJOB (job)) + jobs[job]->flags |= J_NOTIFIED; + UNBLOCK_CHILD (oset); + + /* If running in posix mode, remove the job from the jobs table immediately */ + if (posixly_correct) + { + cleanup_dead_jobs (); + bgp_delete (pid); + } + + return r; +} + +/* Wait for all of the background processes started by this shell to finish. */ +void +wait_for_background_pids () +{ + register int i, r, waited_for; + sigset_t set, oset; + pid_t pid; + + for (waited_for = 0;;) + { + BLOCK_CHILD (set, oset); + + /* find first running job; if none running in foreground, break */ + /* XXX could use js.j_firstj and js.j_lastj here */ + for (i = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("wait_for_background_pids: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("wait_for_background_pids: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + if (jobs[i] && RUNNING (i) && IS_FOREGROUND (i) == 0) + break; + } + if (i == js.j_jobslots) + { + UNBLOCK_CHILD (oset); + break; + } + + /* now wait for the last pid in that job. */ + pid = find_last_pid (i, 0); + UNBLOCK_CHILD (oset); + QUIT; + errno = 0; /* XXX */ + r = wait_for_single_pid (pid); + if (r == -1) + { + /* If we're mistaken about job state, compensate. */ + if (errno == ECHILD) + mark_all_jobs_as_dead (); + } + else + waited_for++; + } + + /* POSIX.2 says the shell can discard the statuses of all completed jobs if + `wait' is called with no arguments. */ + mark_dead_jobs_as_notified (1); + cleanup_dead_jobs (); + bgp_clear (); +} + +/* Make OLD_SIGINT_HANDLER the SIGINT signal handler. */ +#define INVALID_SIGNAL_HANDLER (SigHandler *)wait_for_background_pids +static SigHandler *old_sigint_handler = INVALID_SIGNAL_HANDLER; + +static int wait_sigint_received; +static int child_caught_sigint; +static int waiting_for_child; + +static void +restore_sigint_handler () +{ + if (old_sigint_handler != INVALID_SIGNAL_HANDLER) + { + set_signal_handler (SIGINT, old_sigint_handler); + old_sigint_handler = INVALID_SIGNAL_HANDLER; + waiting_for_child = 0; + } +} + +/* Handle SIGINT while we are waiting for children in a script to exit. + The `wait' builtin should be interruptible, but all others should be + effectively ignored (i.e. not cause the shell to exit). */ +static sighandler +wait_sigint_handler (sig) + int sig; +{ + SigHandler *sigint_handler; + + if (interrupt_immediately || + (this_shell_builtin && this_shell_builtin == wait_builtin)) + { + last_command_exit_value = 128+SIGINT; + restore_sigint_handler (); + /* If we got a SIGINT while in `wait', and SIGINT is trapped, do + what POSIX.2 says (see builtins/wait.def for more info). */ + if (this_shell_builtin && this_shell_builtin == wait_builtin && + signal_is_trapped (SIGINT) && + ((sigint_handler = trap_to_sighandler (SIGINT)) == trap_handler)) + { + trap_handler (SIGINT); /* set pending_traps[SIGINT] */ + wait_signal_received = SIGINT; + if (interrupt_immediately) + { + interrupt_immediately = 0; + longjmp (wait_intr_buf, 1); + } + else + /* Let CHECK_WAIT_INTR handle it in wait_for/waitchld */ + SIGRETURN (0); + } + else if (interrupt_immediately) + { + ADDINTERRUPT; + QUIT; + } + else /* wait_builtin but signal not trapped, treat as interrupt */ + kill (getpid (), SIGINT); + } + + /* XXX - should this be interrupt_state? If it is, the shell will act + as if it got the SIGINT interrupt. */ + if (waiting_for_child) + wait_sigint_received = 1; + else + { + last_command_exit_value = 128+SIGINT; + restore_sigint_handler (); + kill (getpid (), SIGINT); + } + + /* Otherwise effectively ignore the SIGINT and allow the running job to + be killed. */ + SIGRETURN (0); +} + +static int +process_exit_signal (status) + WAIT status; +{ + return (WIFSIGNALED (status) ? WTERMSIG (status) : 0); +} + +static int +process_exit_status (status) + WAIT status; +{ + if (WIFSIGNALED (status)) + return (128 + WTERMSIG (status)); + else if (WIFSTOPPED (status) == 0) + return (WEXITSTATUS (status)); + else + return (EXECUTION_SUCCESS); +} + +static WAIT +job_signal_status (job) + int job; +{ + register PROCESS *p; + WAIT s; + + p = jobs[job]->pipe; + do + { + s = p->status; + if (WIFSIGNALED(s) || WIFSTOPPED(s)) + break; + p = p->next; + } + while (p != jobs[job]->pipe); + + return s; +} + +/* Return the exit status of the last process in the pipeline for job JOB. + This is the exit status of the entire job. */ +static WAIT +raw_job_exit_status (job) + int job; +{ + register PROCESS *p; + int fail; + WAIT ret; + + if (pipefail_opt) + { + fail = 0; + p = jobs[job]->pipe; + do + { + if (WSTATUS (p->status) != EXECUTION_SUCCESS) + fail = WSTATUS(p->status); + p = p->next; + } + while (p != jobs[job]->pipe); + WSTATUS (ret) = fail; + return ret; + } + + for (p = jobs[job]->pipe; p->next != jobs[job]->pipe; p = p->next) + ; + return (p->status); +} + +/* Return the exit status of job JOB. This is the exit status of the last + (rightmost) process in the job's pipeline, modified if the job was killed + by a signal or stopped. */ +int +job_exit_status (job) + int job; +{ + return (process_exit_status (raw_job_exit_status (job))); +} + +int +job_exit_signal (job) + int job; +{ + return (process_exit_signal (raw_job_exit_status (job))); +} + +#define FIND_CHILD(pid, child) \ + do \ + { \ + child = find_pipeline (pid, 0, (int *)NULL); \ + if (child == 0) \ + { \ + give_terminal_to (shell_pgrp, 0); \ + UNBLOCK_CHILD (oset); \ + internal_error (_("wait_for: No record of process %ld"), (long)pid); \ + restore_sigint_handler (); \ + return (termination_state = 127); \ + } \ + } \ + while (0) + +/* Wait for pid (one of our children) to terminate, then + return the termination state. Returns 127 if PID is not found in + the jobs table. Returns -1 if waitchld() returns -1, indicating + that there are no unwaited-for child processes. */ +int +wait_for (pid) + pid_t pid; +{ + int job, termination_state, r; + WAIT s; + register PROCESS *child; + sigset_t set, oset; + + /* In the case that this code is interrupted, and we longjmp () out of it, + we are relying on the code in throw_to_top_level () to restore the + top-level signal mask. */ + child = 0; + BLOCK_CHILD (set, oset); + + /* Ignore interrupts while waiting for a job run without job control + to finish. We don't want the shell to exit if an interrupt is + received, only if one of the jobs run is killed via SIGINT. If + job control is not set, the job will be run in the same pgrp as + the shell, and the shell will see any signals the job gets. In + fact, we want this set every time the waiting shell and the waited- + for process are in the same process group, including command + substitution. */ + + /* This is possibly a race condition -- should it go in stop_pipeline? */ + wait_sigint_received = child_caught_sigint = 0; + if (job_control == 0 || (subshell_environment&SUBSHELL_COMSUB)) + { + old_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler); + waiting_for_child = 0; + if (old_sigint_handler == SIG_IGN) + set_signal_handler (SIGINT, old_sigint_handler); + } + + termination_state = last_command_exit_value; + + if (interactive && job_control == 0) + QUIT; + /* Check for terminating signals and exit the shell if we receive one */ + CHECK_TERMSIG; + + /* Check for a trapped signal interrupting the wait builtin and jump out */ + CHECK_WAIT_INTR; + + /* If we say wait_for (), then we have a record of this child somewhere. + If it and none of its peers are running, don't call waitchld(). */ + + job = NO_JOB; + do + { + if (pid != ANY_PID) + FIND_CHILD (pid, child); + + /* If this child is part of a job, then we are really waiting for the + job to finish. Otherwise, we are waiting for the child to finish. + We check for JDEAD in case the job state has been set by waitchld + after receipt of a SIGCHLD. */ + if (job == NO_JOB) + job = find_job (pid, 0, NULL); + + /* waitchld() takes care of setting the state of the job. If the job + has already exited before this is called, sigchld_handler will have + called waitchld and the state will be set to JDEAD. */ + + if (pid == ANY_PID || PRUNNING(child) || (job != NO_JOB && RUNNING (job))) + { +#if defined (WAITPID_BROKEN) /* SCOv4 */ + sigset_t suspend_set; + sigemptyset (&suspend_set); + sigsuspend (&suspend_set); +#else /* !WAITPID_BROKEN */ +# if defined (MUST_UNBLOCK_CHLD) + struct sigaction act, oact; + sigset_t nullset, chldset; + + sigemptyset (&nullset); + sigemptyset (&chldset); + sigprocmask (SIG_SETMASK, &nullset, &chldset); + act.sa_handler = SIG_DFL; + sigemptyset (&act.sa_mask); + sigemptyset (&oact.sa_mask); + act.sa_flags = 0; +# if defined (SA_RESTART) + act.sa_flags |= SA_RESTART; +# endif + sigaction (SIGCHLD, &act, &oact); +# endif /* MUST_UNBLOCK_CHLD */ + queue_sigchld = 1; + waiting_for_child++; + r = waitchld (pid, 1); /* XXX */ + waiting_for_child--; +#if 0 +itrace("wait_for: blocking wait for %d returns %d child = %p", (int)pid, r, child); +#endif +# if defined (MUST_UNBLOCK_CHLD) + sigaction (SIGCHLD, &oact, (struct sigaction *)NULL); + sigprocmask (SIG_SETMASK, &chldset, (sigset_t *)NULL); +# endif + queue_sigchld = 0; + if (r == -1 && errno == ECHILD && this_shell_builtin == wait_builtin) + { + termination_state = -1; + /* XXX - restore sigint handler here? */ + goto wait_for_return; + } + + /* If child is marked as running, but waitpid() returns -1/ECHILD, + there is something wrong. Somewhere, wait should have returned + that child's pid. Mark the child as not running and the job, + if it exists, as JDEAD. */ + if (r == -1 && errno == ECHILD) + { + if (child) + { + child->running = PS_DONE; + WSTATUS (child->status) = 0; /* XXX -- can't find true status */ + } + js.c_living = 0; /* no living child processes */ + if (job != NO_JOB) + { + jobs[job]->state = JDEAD; + js.c_reaped++; + js.j_ndead++; + } + if (pid == ANY_PID) + { + termination_state = -1; + break; + } + } +#endif /* WAITPID_BROKEN */ + } + + /* If the shell is interactive, and job control is disabled, see + if the foreground process has died due to SIGINT and jump out + of the wait loop if it has. waitchld has already restored the + old SIGINT signal handler. */ + if (interactive && job_control == 0) + QUIT; + /* Check for terminating signals and exit the shell if we receive one */ + CHECK_TERMSIG; + + /* Check for a trapped signal interrupting the wait builtin and jump out */ + CHECK_WAIT_INTR; + + if (pid == ANY_PID) + /* XXX - could set child but we don't have a handle on what waitchld + reaps. Leave termination_state alone. */ + goto wait_for_return; + } + while (PRUNNING (child) || (job != NO_JOB && RUNNING (job))); + + /* Restore the original SIGINT signal handler before we return. */ + restore_sigint_handler (); + + /* The exit state of the command is either the termination state of the + child, or the termination state of the job. If a job, the status + of the last child in the pipeline is the significant one. If the command + or job was terminated by a signal, note that value also. */ + termination_state = (job != NO_JOB) ? job_exit_status (job) + : process_exit_status (child->status); + last_command_exit_signal = (job != NO_JOB) ? job_exit_signal (job) + : process_exit_signal (child->status); + + /* XXX */ + if ((job != NO_JOB && JOBSTATE (job) == JSTOPPED) || WIFSTOPPED (child->status)) + termination_state = 128 + WSTOPSIG (child->status); + + if (job == NO_JOB || IS_JOBCONTROL (job)) + { + /* XXX - under what circumstances is a job not present in the jobs + table (job == NO_JOB)? + 1. command substitution + + In the case of command substitution, at least, it's probably not + the right thing to give the terminal to the shell's process group, + even though there is code in subst.c:command_substitute to work + around it. + + Things that don't: + $PROMPT_COMMAND execution + process substitution + */ +#if 0 +if (job == NO_JOB) + itrace("wait_for: job == NO_JOB, giving the terminal to shell_pgrp (%ld)", (long)shell_pgrp); +#endif + give_terminal_to (shell_pgrp, 0); + } + + /* If the command did not exit cleanly, or the job is just + being stopped, then reset the tty state back to what it + was before this command. Reset the tty state and notify + the user of the job termination only if the shell is + interactive. Clean up any dead jobs in either case. */ + if (job != NO_JOB) + { + if (interactive_shell && subshell_environment == 0) + { + /* This used to use `child->status'. That's wrong, however, for + pipelines. `child' is the first process in the pipeline. It's + likely that the process we want to check for abnormal termination + or stopping is the last process in the pipeline, especially if + it's long-lived and the first process is short-lived. Since we + know we have a job here, we can check all the processes in this + job's pipeline and see if one of them stopped or terminated due + to a signal. We might want to change this later to just check + the last process in the pipeline. If no process exits due to a + signal, S is left as the status of the last job in the pipeline. */ + s = job_signal_status (job); + + if (WIFSIGNALED (s) || WIFSTOPPED (s)) + { + set_tty_state (); + + /* If the current job was stopped or killed by a signal, and + the user has requested it, get a possibly new window size */ + if (check_window_size && (job == js.j_current || IS_FOREGROUND (job))) + get_new_window_size (0, (int *)0, (int *)0); + } + else + get_tty_state (); + + /* If job control is enabled, the job was started with job + control, the job was the foreground job, and it was killed + by SIGINT, then print a newline to compensate for the kernel + printing the ^C without a trailing newline. */ + if (job_control && IS_JOBCONTROL (job) && IS_FOREGROUND (job) && + WIFSIGNALED (s) && WTERMSIG (s) == SIGINT) + { + /* If SIGINT is not trapped and the shell is in a for, while, + or until loop, act as if the shell received SIGINT as + well, so the loop can be broken. This doesn't call the + SIGINT signal handler; maybe it should. */ + if (signal_is_trapped (SIGINT) == 0 && (loop_level || (shell_compatibility_level > 32 && executing_list))) + ADDINTERRUPT; + else + { + putchar ('\n'); + fflush (stdout); + } + } + } + else if ((subshell_environment & (SUBSHELL_COMSUB|SUBSHELL_PIPE)) && wait_sigint_received) + { + /* If waiting for a job in a subshell started to do command + substitution or to run a pipeline element that consists of + something like a while loop or a for loop, simulate getting + and being killed by the SIGINT to pass the status back to our + parent. */ + s = job_signal_status (job); + + if (child_caught_sigint == 0 && signal_is_trapped (SIGINT) == 0) + { + UNBLOCK_CHILD (oset); + old_sigint_handler = set_signal_handler (SIGINT, SIG_DFL); + if (old_sigint_handler == SIG_IGN) + restore_sigint_handler (); + else + kill (getpid (), SIGINT); + } + } + else if (interactive_shell == 0 && IS_FOREGROUND (job) && check_window_size) + get_new_window_size (0, (int *)0, (int *)0); + + /* Moved here from set_job_status_and_cleanup, which is in the SIGCHLD + signal handler path */ + if (DEADJOB (job) && IS_FOREGROUND (job) /*&& subshell_environment == 0*/) + setjstatus (job); + + /* If this job is dead, notify the user of the status. If the shell + is interactive, this will display a message on the terminal. If + the shell is not interactive, make sure we turn on the notify bit + so we don't get an unwanted message about the job's termination, + and so delete_job really clears the slot in the jobs table. */ + notify_and_cleanup (); + } + +wait_for_return: + + UNBLOCK_CHILD (oset); + + return (termination_state); +} + +/* Wait for the last process in the pipeline for JOB. Returns whatever + wait_for returns: the last process's termination state or -1 if there + are no unwaited-for child processes or an error occurs. */ +int +wait_for_job (job) + int job; +{ + pid_t pid; + int r; + sigset_t set, oset; + + BLOCK_CHILD(set, oset); + if (JOBSTATE (job) == JSTOPPED) + internal_warning (_("wait_for_job: job %d is stopped"), job+1); + + pid = find_last_pid (job, 0); + UNBLOCK_CHILD(oset); + r = wait_for (pid); + + /* POSIX.2: we can remove the job from the jobs table if we just waited + for it. */ + BLOCK_CHILD (set, oset); + if (job != NO_JOB && jobs[job] && DEADJOB (job)) + jobs[job]->flags |= J_NOTIFIED; + UNBLOCK_CHILD (oset); + + return r; +} + +/* Wait for any background job started by this shell to finish. Very + similar to wait_for_background_pids(). Returns the exit status of + the next exiting job, -1 if there are no background jobs. The caller + is responsible for translating -1 into the right return value. */ +int +wait_for_any_job () +{ + pid_t pid; + int i, r, waited_for; + sigset_t set, oset; + + if (jobs_list_frozen) + return -1; + + /* First see if there are any unnotified dead jobs that we can report on */ + BLOCK_CHILD (set, oset); + for (i = 0; i < js.j_jobslots; i++) + { + if (jobs[i] && DEADJOB (i) && IS_NOTIFIED (i) == 0) + { +return_job: + r = job_exit_status (i); + notify_of_job_status (); /* XXX */ + delete_job (i, 0); +#if defined (COPROCESS_SUPPORT) + coproc_reap (); +#endif + UNBLOCK_CHILD (oset); + return r; + } + } + UNBLOCK_CHILD (oset); + + /* At this point, we have no dead jobs in the jobs table. Wait until we + get one, even if it takes multiple pids exiting. */ + for (waited_for = 0;;) + { + /* Make sure there is a background job to wait for */ + BLOCK_CHILD (set, oset); + for (i = 0; i < js.j_jobslots; i++) + if (jobs[i] && RUNNING (i) && IS_FOREGROUND (i) == 0) + break; + if (i == js.j_jobslots) + { + UNBLOCK_CHILD (oset); + return -1; + } + + UNBLOCK_CHILD (oset); + + QUIT; + CHECK_TERMSIG; + CHECK_WAIT_INTR; + + errno = 0; + r = wait_for (ANY_PID); /* special sentinel value for wait_for */ + if (r == -1 && errno == ECHILD) + mark_all_jobs_as_dead (); + + /* Now we see if we have any dead jobs and return the first one */ + BLOCK_CHILD (set, oset); + for (i = 0; i < js.j_jobslots; i++) + if (jobs[i] && DEADJOB (i)) + goto return_job; + UNBLOCK_CHILD (oset); + } + + return -1; +} + +/* Print info about dead jobs, and then delete them from the list + of known jobs. This does not actually delete jobs when the + shell is not interactive, because the dead jobs are not marked + as notified. */ +void +notify_and_cleanup () +{ + if (jobs_list_frozen) + return; + + if (interactive || interactive_shell == 0 || sourcelevel) + notify_of_job_status (); + + cleanup_dead_jobs (); +} + +/* Make dead jobs disappear from the jobs array without notification. + This is used when the shell is not interactive. */ +void +reap_dead_jobs () +{ + mark_dead_jobs_as_notified (0); + cleanup_dead_jobs (); +} + +/* Return the next closest (chronologically) job to JOB which is in + STATE. STATE can be JSTOPPED, JRUNNING. NO_JOB is returned if + there is no next recent job. */ +static int +most_recent_job_in_state (job, state) + int job; + JOB_STATE state; +{ + register int i, result; + sigset_t set, oset; + + BLOCK_CHILD (set, oset); + + for (result = NO_JOB, i = job - 1; i >= 0; i--) + { + if (jobs[i] && (JOBSTATE (i) == state)) + { + result = i; + break; + } + } + + UNBLOCK_CHILD (oset); + + return (result); +} + +/* Return the newest *stopped* job older than JOB, or NO_JOB if not + found. */ +static int +job_last_stopped (job) + int job; +{ + return (most_recent_job_in_state (job, JSTOPPED)); +} + +/* Return the newest *running* job older than JOB, or NO_JOB if not + found. */ +static int +job_last_running (job) + int job; +{ + return (most_recent_job_in_state (job, JRUNNING)); +} + +/* Make JOB be the current job, and make previous be useful. Must be + called with SIGCHLD blocked. */ +static void +set_current_job (job) + int job; +{ + int candidate; + + if (js.j_current != job) + { + js.j_previous = js.j_current; + js.j_current = job; + } + + /* First choice for previous job is the old current job. */ + if (js.j_previous != js.j_current && + js.j_previous != NO_JOB && + jobs[js.j_previous] && + STOPPED (js.j_previous)) + return; + + /* Second choice: Newest stopped job that is older than + the current job. */ + candidate = NO_JOB; + if (STOPPED (js.j_current)) + { + candidate = job_last_stopped (js.j_current); + + if (candidate != NO_JOB) + { + js.j_previous = candidate; + return; + } + } + + /* If we get here, there is either only one stopped job, in which case it is + the current job and the previous job should be set to the newest running + job, or there are only running jobs and the previous job should be set to + the newest running job older than the current job. We decide on which + alternative to use based on whether or not JOBSTATE(js.j_current) is + JSTOPPED. */ + + candidate = RUNNING (js.j_current) ? job_last_running (js.j_current) + : job_last_running (js.j_jobslots); + + if (candidate != NO_JOB) + { + js.j_previous = candidate; + return; + } + + /* There is only a single job, and it is both `+' and `-'. */ + js.j_previous = js.j_current; +} + +/* Make current_job be something useful, if it isn't already. */ + +/* Here's the deal: The newest non-running job should be `+', and the + next-newest non-running job should be `-'. If there is only a single + stopped job, the js.j_previous is the newest non-running job. If there + are only running jobs, the newest running job is `+' and the + next-newest running job is `-'. Must be called with SIGCHLD blocked. */ + +static void +reset_current () +{ + int candidate; + + if (js.j_jobslots && js.j_current != NO_JOB && jobs[js.j_current] && STOPPED (js.j_current)) + candidate = js.j_current; + else + { + candidate = NO_JOB; + + /* First choice: the previous job. */ + if (js.j_previous != NO_JOB && jobs[js.j_previous] && STOPPED (js.j_previous)) + candidate = js.j_previous; + + /* Second choice: the most recently stopped job. */ + if (candidate == NO_JOB) + candidate = job_last_stopped (js.j_jobslots); + + /* Third choice: the newest running job. */ + if (candidate == NO_JOB) + candidate = job_last_running (js.j_jobslots); + } + + /* If we found a job to use, then use it. Otherwise, there + are no jobs period. */ + if (candidate != NO_JOB) + set_current_job (candidate); + else + js.j_current = js.j_previous = NO_JOB; +} + +/* Set up the job structures so we know the job and its processes are + all running. */ +static void +set_job_running (job) + int job; +{ + register PROCESS *p; + + /* Each member of the pipeline is now running. */ + p = jobs[job]->pipe; + + do + { + if (WIFSTOPPED (p->status)) + p->running = PS_RUNNING; /* XXX - could be PS_STOPPED */ + p = p->next; + } + while (p != jobs[job]->pipe); + + /* This means that the job is running. */ + JOBSTATE (job) = JRUNNING; +} + +/* Start a job. FOREGROUND if non-zero says to do that. Otherwise, + start the job in the background. JOB is a zero-based index into + JOBS. Returns -1 if it is unable to start a job, and the return + status of the job otherwise. */ +int +start_job (job, foreground) + int job, foreground; +{ + register PROCESS *p; + int already_running; + sigset_t set, oset; + char *wd, *s; + static TTYSTRUCT save_stty; + + BLOCK_CHILD (set, oset); + + if (DEADJOB (job)) + { + internal_error (_("%s: job has terminated"), this_command_name); + UNBLOCK_CHILD (oset); + return (-1); + } + + already_running = RUNNING (job); + + if (foreground == 0 && already_running) + { + internal_error (_("%s: job %d already in background"), this_command_name, job + 1); + UNBLOCK_CHILD (oset); + return (0); /* XPG6/SUSv3 says this is not an error */ + } + + wd = current_working_directory (); + + /* You don't know about the state of this job. Do you? */ + jobs[job]->flags &= ~J_NOTIFIED; + + if (foreground) + { + set_current_job (job); + jobs[job]->flags |= J_FOREGROUND; + } + + /* Tell the outside world what we're doing. */ + p = jobs[job]->pipe; + + if (foreground == 0) + { + /* POSIX.2 says `bg' doesn't give any indication about current or + previous job. */ + if (posixly_correct == 0) + s = (job == js.j_current) ? "+ ": ((job == js.j_previous) ? "- " : " "); + else + s = " "; + printf ("[%d]%s", job + 1, s); + } + + do + { + printf ("%s%s", + p->command ? p->command : "", + p->next != jobs[job]->pipe? " | " : ""); + p = p->next; + } + while (p != jobs[job]->pipe); + + if (foreground == 0) + printf (" &"); + + if (strcmp (wd, jobs[job]->wd) != 0) + printf (" (wd: %s)", polite_directory_format (jobs[job]->wd)); + + printf ("\n"); + + /* Run the job. */ + if (already_running == 0) + set_job_running (job); + + /* Save the tty settings before we start the job in the foreground. */ + if (foreground) + { + get_tty_state (); + save_stty = shell_tty_info; + /* Give the terminal to this job. */ + if (IS_JOBCONTROL (job)) + give_terminal_to (jobs[job]->pgrp, 0); + } + else + jobs[job]->flags &= ~J_FOREGROUND; + + /* If the job is already running, then don't bother jump-starting it. */ + if (already_running == 0) + { + jobs[job]->flags |= J_NOTIFIED; + killpg (jobs[job]->pgrp, SIGCONT); + } + + if (foreground) + { + pid_t pid; + int st; + + pid = find_last_pid (job, 0); + UNBLOCK_CHILD (oset); + st = wait_for (pid); + shell_tty_info = save_stty; + set_tty_state (); + return (st); + } + else + { + reset_current (); + UNBLOCK_CHILD (oset); + return (0); + } +} + +/* Give PID SIGNAL. This determines what job the pid belongs to (if any). + If PID does belong to a job, and the job is stopped, then CONTinue the + job after giving it SIGNAL. Returns -1 on failure. If GROUP is non-null, + then kill the process group associated with PID. */ +int +kill_pid (pid, sig, group) + pid_t pid; + int sig, group; +{ + register PROCESS *p; + int job, result, negative; + sigset_t set, oset; + + if (pid < -1) + { + pid = -pid; + group = negative = 1; + } + else + negative = 0; + + result = EXECUTION_SUCCESS; + if (group) + { + BLOCK_CHILD (set, oset); + p = find_pipeline (pid, 0, &job); + + if (job != NO_JOB) + { + jobs[job]->flags &= ~J_NOTIFIED; + + /* Kill process in backquotes or one started without job control? */ + + /* If we're passed a pid < -1, just call killpg and see what happens */ + if (negative && jobs[job]->pgrp == shell_pgrp) + result = killpg (pid, sig); + /* If we're killing using job control notification, for example, + without job control active, we have to do things ourselves. */ + else if (jobs[job]->pgrp == shell_pgrp) + { + p = jobs[job]->pipe; + do + { + if (PALIVE (p) == 0) + continue; /* avoid pid recycling problem */ + kill (p->pid, sig); + if (PEXITED (p) && (sig == SIGTERM || sig == SIGHUP)) + kill (p->pid, SIGCONT); + p = p->next; + } + while (p != jobs[job]->pipe); + } + else + { + result = killpg (jobs[job]->pgrp, sig); + if (p && STOPPED (job) && (sig == SIGTERM || sig == SIGHUP)) + killpg (jobs[job]->pgrp, SIGCONT); + /* If we're continuing a stopped job via kill rather than bg or + fg, emulate the `bg' behavior. */ + if (p && STOPPED (job) && (sig == SIGCONT)) + { + set_job_running (job); + jobs[job]->flags &= ~J_FOREGROUND; + jobs[job]->flags |= J_NOTIFIED; + } + } + } + else + result = killpg (pid, sig); + + UNBLOCK_CHILD (oset); + } + else + result = kill (pid, sig); + + return (result); +} + +/* sigchld_handler () flushes at least one of the children that we are + waiting for. It gets run when we have gotten a SIGCHLD signal. */ +static sighandler +sigchld_handler (sig) + int sig; +{ + int n, oerrno; + + oerrno = errno; + REINSTALL_SIGCHLD_HANDLER; + sigchld++; + n = 0; + if (queue_sigchld == 0) + n = waitchld (-1, 0); + errno = oerrno; + SIGRETURN (n); +} + +/* waitchld() reaps dead or stopped children. It's called by wait_for and + sigchld_handler, and runs until there aren't any children terminating any + more. + If BLOCK is 1, this is to be a blocking wait for a single child, although + an arriving SIGCHLD could cause the wait to be non-blocking. It returns + the number of children reaped, or -1 if there are no unwaited-for child + processes. */ +static int +waitchld (wpid, block) + pid_t wpid; + int block; +{ + WAIT status; + PROCESS *child; + pid_t pid; + + int call_set_current, last_stopped_job, job, children_exited, waitpid_flags; + static int wcontinued = WCONTINUED; /* run-time fix for glibc problem */ + + call_set_current = children_exited = 0; + last_stopped_job = NO_JOB; + + do + { + /* We don't want to be notified about jobs stopping if job control + is not active. XXX - was interactive_shell instead of job_control */ + waitpid_flags = (job_control && subshell_environment == 0) + ? (WUNTRACED|wcontinued) + : 0; + if (sigchld || block == 0) + waitpid_flags |= WNOHANG; + + /* Check for terminating signals and exit the shell if we receive one */ + CHECK_TERMSIG; + /* Check for a trapped signal interrupting the wait builtin and jump out */ + CHECK_WAIT_INTR; + + if (block == 1 && queue_sigchld == 0 && (waitpid_flags & WNOHANG) == 0) + { + internal_warning (_("waitchld: turning on WNOHANG to avoid indefinite block")); + waitpid_flags |= WNOHANG; + } + + pid = WAITPID (-1, &status, waitpid_flags); + +#if 0 +if (wpid != -1 && block) + itrace("waitchld: blocking waitpid returns %d", pid); +#endif + /* WCONTINUED may be rejected by waitpid as invalid even when defined */ + if (wcontinued && pid < 0 && errno == EINVAL) + { + wcontinued = 0; + continue; /* jump back to the test and retry without WCONTINUED */ + } + + /* The check for WNOHANG is to make sure we decrement sigchld only + if it was non-zero before we called waitpid. */ + if (sigchld > 0 && (waitpid_flags & WNOHANG)) + sigchld--; + + /* If waitpid returns -1 with errno == ECHILD, there are no more + unwaited-for child processes of this shell. */ + if (pid < 0 && errno == ECHILD) + { + if (children_exited == 0) + return -1; + else + break; + } + +#if 0 +itrace("waitchld: waitpid returns %d block = %d", pid, block); +#endif + /* If waitpid returns 0, there are running children. If it returns -1, + the only other error POSIX says it can return is EINTR. */ + CHECK_TERMSIG; + CHECK_WAIT_INTR; + + /* If waitpid returns -1/EINTR and the shell saw a SIGINT, then we + assume the child has blocked or handled SIGINT. In that case, we + require the child to actually die due to SIGINT to act on the + SIGINT we received; otherwise we assume the child handled it and + let it go. */ + if (pid < 0 && errno == EINTR && wait_sigint_received) + child_caught_sigint = 1; + + if (pid <= 0) + continue; /* jumps right to the test */ + + /* If the child process did die due to SIGINT, forget our assumption + that it caught or otherwise handled it. */ + if (WIFSIGNALED (status) && WTERMSIG (status) == SIGINT) + child_caught_sigint = 0; + + /* children_exited is used to run traps on SIGCHLD. We don't want to + run the trap if a process is just being continued. */ + if (WIFCONTINUED(status) == 0) + { + children_exited++; + js.c_living--; + } + + /* Locate our PROCESS for this pid. */ + child = find_process (pid, 1, &job); /* want living procs only */ + +#if defined (COPROCESS_SUPPORT) + coproc_pidchk (pid, WSTATUS(status)); +#endif + + /* It is not an error to have a child terminate that we did + not have a record of. This child could have been part of + a pipeline in backquote substitution. Even so, I'm not + sure child is ever non-zero. */ + if (child == 0) + { + if (WIFEXITED (status) || WIFSIGNALED (status)) + js.c_reaped++; + continue; + } + + /* Remember status, and whether or not the process is running. */ + child->status = status; + child->running = WIFCONTINUED(status) ? PS_RUNNING : PS_DONE; + + if (PEXITED (child)) + { + js.c_totreaped++; + if (job != NO_JOB) + js.c_reaped++; + } + + if (job == NO_JOB) + continue; + + call_set_current += set_job_status_and_cleanup (job); + + if (STOPPED (job)) + last_stopped_job = job; + else if (DEADJOB (job) && last_stopped_job == job) + last_stopped_job = NO_JOB; + } + while ((sigchld || block == 0) && pid > (pid_t)0); + + /* If a job was running and became stopped, then set the current + job. Otherwise, don't change a thing. */ + if (call_set_current) + { + if (last_stopped_job != NO_JOB) + set_current_job (last_stopped_job); + else + reset_current (); + } + + /* Call a SIGCHLD trap handler for each child that exits, if one is set. */ + if (job_control && signal_is_trapped (SIGCHLD) && children_exited && + trap_list[SIGCHLD] != (char *)IGNORE_SIG) + { + if (posixly_correct && this_shell_builtin && this_shell_builtin == wait_builtin) + { + interrupt_immediately = 0; + trap_handler (SIGCHLD); /* set pending_traps[SIGCHLD] */ + wait_signal_received = SIGCHLD; + /* If we're in a signal handler, let CHECK_WAIT_INTR pick it up; + run_pending_traps will call run_sigchld_trap later */ + if (sigchld == 0) + longjmp (wait_intr_buf, 1); + } + /* If not in posix mode and not executing the wait builtin, queue the + signal for later handling. Run the trap immediately if we are + executing the wait builtin, but don't break out of `wait'. */ + else if (sigchld) /* called from signal handler */ + queue_sigchld_trap (children_exited); + else if (running_trap) + queue_sigchld_trap (children_exited); + else if (this_shell_builtin == wait_builtin) + run_sigchld_trap (children_exited); /* XXX */ + else + queue_sigchld_trap (children_exited); + } + + /* We have successfully recorded the useful information about this process + that has just changed state. If we notify asynchronously, and the job + that this process belongs to is no longer running, then notify the user + of that fact now. */ + if (asynchronous_notification && interactive) + notify_of_job_status (); + + return (children_exited); +} + +/* Set the status of JOB and perform any necessary cleanup if the job is + marked as JDEAD. + + Currently, the cleanup activity is restricted to handling any SIGINT + received while waiting for a foreground job to finish. */ +static int +set_job_status_and_cleanup (job) + int job; +{ + PROCESS *child; + int tstatus, job_state, any_stopped, any_tstped, call_set_current; + SigHandler *temp_handler; + + child = jobs[job]->pipe; + jobs[job]->flags &= ~J_NOTIFIED; + + call_set_current = 0; + + /* + * COMPUTE JOB STATUS + */ + + /* If all children are not running, but any of them is stopped, then + the job is stopped, not dead. */ + job_state = any_stopped = any_tstped = 0; + do + { + job_state |= PRUNNING (child); +#if 0 + if (PEXITED (child) && (WIFSTOPPED (child->status))) +#else + /* Only checking for WIFSTOPPED now, not for PS_DONE */ + if (PSTOPPED (child)) +#endif + { + any_stopped = 1; + any_tstped |= job_control && (WSTOPSIG (child->status) == SIGTSTP); + } + child = child->next; + } + while (child != jobs[job]->pipe); + + /* If job_state != 0, the job is still running, so don't bother with + setting the process exit status and job state unless we're + transitioning from stopped to running. */ + if (job_state != 0 && JOBSTATE(job) != JSTOPPED) + return 0; + + /* + * SET JOB STATUS + */ + + /* The job is either stopped or dead. Set the state of the job accordingly. */ + if (any_stopped) + { + jobs[job]->state = JSTOPPED; + jobs[job]->flags &= ~J_FOREGROUND; + call_set_current++; + /* Suspending a job with SIGTSTP breaks all active loops. */ + if (any_tstped && loop_level) + breaking = loop_level; + } + else if (job_state != 0) /* was stopped, now running */ + { + jobs[job]->state = JRUNNING; + call_set_current++; + } + else + { + jobs[job]->state = JDEAD; + js.j_ndead++; + +#if 0 + if (IS_FOREGROUND (job)) + setjstatus (job); +#endif + + /* If this job has a cleanup function associated with it, call it + with `cleanarg' as the single argument, then set the function + pointer to NULL so it is not inadvertently called twice. The + cleanup function is responsible for deallocating cleanarg. */ + if (jobs[job]->j_cleanup) + { + (*jobs[job]->j_cleanup) (jobs[job]->cleanarg); + jobs[job]->j_cleanup = (sh_vptrfunc_t *)NULL; + } + } + + /* + * CLEANUP + * + * Currently, we just do special things if we got a SIGINT while waiting + * for a foreground job to complete + */ + + if (JOBSTATE (job) == JDEAD) + { + /* If we're running a shell script and we get a SIGINT with a + SIGINT trap handler, but the foreground job handles it and + does not exit due to SIGINT, run the trap handler but do not + otherwise act as if we got the interrupt. */ + if (wait_sigint_received && interactive_shell == 0 && + child_caught_sigint && IS_FOREGROUND (job) && + signal_is_trapped (SIGINT)) + { + int old_frozen; + wait_sigint_received = 0; + last_command_exit_value = process_exit_status (child->status); + + old_frozen = jobs_list_frozen; + jobs_list_frozen = 1; + tstatus = maybe_call_trap_handler (SIGINT); + jobs_list_frozen = old_frozen; + } + + /* If the foreground job is killed by SIGINT when job control is not + active, we need to perform some special handling. + + The check of wait_sigint_received is a way to determine if the + SIGINT came from the keyboard (in which case the shell has already + seen it, and wait_sigint_received is non-zero, because keyboard + signals are sent to process groups) or via kill(2) to the foreground + process by another process (or itself). If the shell did receive the + SIGINT, it needs to perform normal SIGINT processing. */ + else if (wait_sigint_received && + child_caught_sigint == 0 && + IS_FOREGROUND (job) && IS_JOBCONTROL (job) == 0) + { + int old_frozen; + + wait_sigint_received = 0; + + /* If SIGINT is trapped, set the exit status so that the trap + handler can see it. */ + if (signal_is_trapped (SIGINT)) + last_command_exit_value = process_exit_status (child->status); + + /* If the signal is trapped, let the trap handler get it no matter + what and simply return if the trap handler returns. + maybe_call_trap_handler() may cause dead jobs to be removed from + the job table because of a call to execute_command. We work + around this by setting JOBS_LIST_FROZEN. */ + old_frozen = jobs_list_frozen; + jobs_list_frozen = 1; + tstatus = maybe_call_trap_handler (SIGINT); + jobs_list_frozen = old_frozen; + if (tstatus == 0 && old_sigint_handler != INVALID_SIGNAL_HANDLER) + { + /* wait_sigint_handler () has already seen SIGINT and + allowed the wait builtin to jump out. We need to + call the original SIGINT handler, if necessary. If + the original handler is SIG_DFL, we need to resend + the signal to ourselves. */ + + temp_handler = old_sigint_handler; + + /* Bogus. If we've reset the signal handler as the result + of a trap caught on SIGINT, then old_sigint_handler + will point to trap_handler, which now knows nothing about + SIGINT (if we reset the sighandler to the default). + In this case, we have to fix things up. What a crock. */ + if (temp_handler == trap_handler && signal_is_trapped (SIGINT) == 0) + temp_handler = trap_to_sighandler (SIGINT); + restore_sigint_handler (); + if (temp_handler == SIG_DFL) + termsig_handler (SIGINT); /* XXX */ + else if (temp_handler != SIG_IGN) + (*temp_handler) (SIGINT); + } + } + } + + return call_set_current; +} + +/* Build the array of values for the $PIPESTATUS variable from the set of + exit statuses of all processes in the job J. */ +static void +setjstatus (j) + int j; +{ +#if defined (ARRAY_VARS) + register int i; + register PROCESS *p; + + for (i = 1, p = jobs[j]->pipe; p->next != jobs[j]->pipe; p = p->next, i++) + ; + i++; + if (statsize < i) + { + pstatuses = (int *)xrealloc (pstatuses, i * sizeof (int)); + statsize = i; + } + i = 0; + p = jobs[j]->pipe; + do + { + pstatuses[i++] = process_exit_status (p->status); + p = p->next; + } + while (p != jobs[j]->pipe); + + pstatuses[i] = -1; /* sentinel */ + set_pipestatus_array (pstatuses, i); +#endif +} + +void +run_sigchld_trap (nchild) + int nchild; +{ + char *trap_command; + int i; + + /* Turn off the trap list during the call to parse_and_execute () + to avoid potentially infinite recursive calls. Preserve the + values of last_command_exit_value, last_made_pid, and the_pipeline + around the execution of the trap commands. */ + trap_command = savestring (trap_list[SIGCHLD]); + + begin_unwind_frame ("SIGCHLD trap"); + unwind_protect_int (last_command_exit_value); + unwind_protect_int (last_command_exit_signal); + unwind_protect_var (last_made_pid); + unwind_protect_int (interrupt_immediately); + unwind_protect_int (jobs_list_frozen); + unwind_protect_pointer (the_pipeline); + unwind_protect_pointer (subst_assign_varlist); + + /* We have to add the commands this way because they will be run + in reverse order of adding. We don't want maybe_set_sigchld_trap () + to reference freed memory. */ + add_unwind_protect (xfree, trap_command); + add_unwind_protect (maybe_set_sigchld_trap, trap_command); + + subst_assign_varlist = (WORD_LIST *)NULL; + the_pipeline = (PROCESS *)NULL; + + running_trap = SIGCHLD + 1; + + set_impossible_sigchld_trap (); + jobs_list_frozen = 1; + for (i = 0; i < nchild; i++) + { +#if 0 + interrupt_immediately = 1; +#endif + parse_and_execute (savestring (trap_command), "trap", SEVAL_NOHIST|SEVAL_RESETLINE); + } + + run_unwind_frame ("SIGCHLD trap"); + running_trap = 0; +} + +/* Function to call when you want to notify people of changes + in job status. This prints out all jobs which are pending + notification to stderr, and marks those printed as already + notified, thus making them candidates for cleanup. */ +static void +notify_of_job_status () +{ + register int job, termsig; + char *dir; + sigset_t set, oset; + WAIT s; + + if (jobs == 0 || js.j_jobslots == 0) + return; + + if (old_ttou != 0) + { + sigemptyset (&set); + sigaddset (&set, SIGCHLD); + sigaddset (&set, SIGTTOU); + sigemptyset (&oset); + sigprocmask (SIG_BLOCK, &set, &oset); + } + else + queue_sigchld++; + + /* XXX could use js.j_firstj here */ + for (job = 0, dir = (char *)NULL; job < js.j_jobslots; job++) + { + if (jobs[job] && IS_NOTIFIED (job) == 0) + { + s = raw_job_exit_status (job); + termsig = WTERMSIG (s); + + /* POSIX.2 says we have to hang onto the statuses of at most the + last CHILD_MAX background processes if the shell is running a + script. If the shell is running a script, either from a file + or standard input, don't print anything unless the job was + killed by a signal. */ + if (startup_state == 0 && WIFSIGNALED (s) == 0 && + ((DEADJOB (job) && IS_FOREGROUND (job) == 0) || STOPPED (job))) + continue; + +#if 0 + /* If job control is disabled, don't print the status messages. + Mark dead jobs as notified so that they get cleaned up. If + startup_state == 2, we were started to run `-c command', so + don't print anything. */ + if ((job_control == 0 && interactive_shell) || startup_state == 2) +#else + /* If job control is disabled, don't print the status messages. + Mark dead jobs as notified so that they get cleaned up. If + startup_state == 2 and subshell_environment has the + SUBSHELL_COMSUB bit turned on, we were started to run a command + substitution, so don't print anything. */ + if ((job_control == 0 && interactive_shell) || + (startup_state == 2 && (subshell_environment & SUBSHELL_COMSUB))) +#endif + { + /* POSIX.2 compatibility: if the shell is not interactive, + hang onto the job corresponding to the last asynchronous + pid until the user has been notified of its status or does + a `wait'. */ + if (DEADJOB (job) && (interactive_shell || (find_last_pid (job, 0) != last_asynchronous_pid))) + jobs[job]->flags |= J_NOTIFIED; + continue; + } + + /* Print info on jobs that are running in the background, + and on foreground jobs that were killed by anything + except SIGINT (and possibly SIGPIPE). */ + switch (JOBSTATE (job)) + { + case JDEAD: + if (interactive_shell == 0 && termsig && WIFSIGNALED (s) && + termsig != SIGINT && +#if defined (DONT_REPORT_SIGTERM) + termsig != SIGTERM && +#endif +#if defined (DONT_REPORT_SIGPIPE) + termsig != SIGPIPE && +#endif + signal_is_trapped (termsig) == 0) + { + /* Don't print `0' for a line number. */ + fprintf (stderr, _("%s: line %d: "), get_name_for_error (), (line_number == 0) ? 1 : line_number); + pretty_print_job (job, JLIST_NONINTERACTIVE, stderr); + } + else if (IS_FOREGROUND (job)) + { +#if !defined (DONT_REPORT_SIGPIPE) + if (termsig && WIFSIGNALED (s) && termsig != SIGINT) +#else + if (termsig && WIFSIGNALED (s) && termsig != SIGINT && termsig != SIGPIPE) +#endif + { + fprintf (stderr, "%s", j_strsignal (termsig)); + + if (WIFCORED (s)) + fprintf (stderr, _(" (core dumped)")); + + fprintf (stderr, "\n"); + } + } + else if (job_control) /* XXX job control test added */ + { + if (dir == 0) + dir = current_working_directory (); + pretty_print_job (job, JLIST_STANDARD, stderr); + if (dir && strcmp (dir, jobs[job]->wd) != 0) + fprintf (stderr, + _("(wd now: %s)\n"), polite_directory_format (dir)); + } + + jobs[job]->flags |= J_NOTIFIED; + break; + + case JSTOPPED: + fprintf (stderr, "\n"); + if (dir == 0) + dir = current_working_directory (); + pretty_print_job (job, JLIST_STANDARD, stderr); + if (dir && (strcmp (dir, jobs[job]->wd) != 0)) + fprintf (stderr, + _("(wd now: %s)\n"), polite_directory_format (dir)); + jobs[job]->flags |= J_NOTIFIED; + break; + + case JRUNNING: + case JMIXED: + break; + + default: + programming_error ("notify_of_job_status"); + } + } + } + if (old_ttou != 0) + sigprocmask (SIG_SETMASK, &oset, (sigset_t *)NULL); + else + queue_sigchld--; +} + +/* Initialize the job control mechanism, and set up the tty stuff. */ +int +initialize_job_control (force) + int force; +{ + pid_t t; + int t_errno; + + t_errno = -1; + shell_pgrp = getpgid (0); + + if (shell_pgrp == -1) + { + sys_error (_("initialize_job_control: getpgrp failed")); + exit (1); + } + + /* We can only have job control if we are interactive unless we force it. */ + if (interactive == 0 && force == 0) + { + job_control = 0; + original_pgrp = NO_PID; + shell_tty = fileno (stderr); + } + else + { + shell_tty = -1; + + /* If forced_interactive is set, we skip the normal check that stderr + is attached to a tty, so we need to check here. If it's not, we + need to see whether we have a controlling tty by opening /dev/tty, + since trying to use job control tty pgrp manipulations on a non-tty + is going to fail. */ + if (forced_interactive && isatty (fileno (stderr)) == 0) + shell_tty = open ("/dev/tty", O_RDWR|O_NONBLOCK); + + /* Get our controlling terminal. If job_control is set, or + interactive is set, then this is an interactive shell no + matter where fd 2 is directed. */ + if (shell_tty == -1) + shell_tty = dup (fileno (stderr)); /* fd 2 */ + + if (shell_tty != -1) + shell_tty = move_to_high_fd (shell_tty, 1, -1); + + /* Compensate for a bug in systems that compiled the BSD + rlogind with DEBUG defined, like NeXT and Alliant. */ + if (shell_pgrp == 0) + { + shell_pgrp = getpid (); + setpgid (0, shell_pgrp); + tcsetpgrp (shell_tty, shell_pgrp); + } + + while ((terminal_pgrp = tcgetpgrp (shell_tty)) != -1) + { + if (shell_pgrp != terminal_pgrp) + { + SigHandler *ottin; + + ottin = set_signal_handler(SIGTTIN, SIG_DFL); + kill (0, SIGTTIN); + set_signal_handler (SIGTTIN, ottin); + continue; + } + break; + } + + if (terminal_pgrp == -1) + t_errno = errno; + + /* Make sure that we are using the new line discipline. */ + if (set_new_line_discipline (shell_tty) < 0) + { + sys_error (_("initialize_job_control: line discipline")); + job_control = 0; + } + else + { + original_pgrp = shell_pgrp; + shell_pgrp = getpid (); + + if ((original_pgrp != shell_pgrp) && (setpgid (0, shell_pgrp) < 0)) + { + sys_error (_("initialize_job_control: setpgid")); + shell_pgrp = original_pgrp; + } + + job_control = 1; + + /* If (and only if) we just set our process group to our pid, + thereby becoming a process group leader, and the terminal + is not in the same process group as our (new) process group, + then set the terminal's process group to our (new) process + group. If that fails, set our process group back to what it + was originally (so we can still read from the terminal) and + turn off job control. */ + if (shell_pgrp != original_pgrp && shell_pgrp != terminal_pgrp) + { + if (give_terminal_to (shell_pgrp, 0) < 0) + { + t_errno = errno; + setpgid (0, original_pgrp); + shell_pgrp = original_pgrp; + errno = t_errno; + sys_error (_("cannot set terminal process group (%d)"), shell_pgrp); + job_control = 0; + } + } + + if (job_control && ((t = tcgetpgrp (shell_tty)) == -1 || t != shell_pgrp)) + { + if (t_errno != -1) + errno = t_errno; + sys_error (_("cannot set terminal process group (%d)"), t); + job_control = 0; + } + } + if (job_control == 0) + internal_error (_("no job control in this shell")); + } + + if (shell_tty != fileno (stderr)) + SET_CLOSE_ON_EXEC (shell_tty); + + set_signal_handler (SIGCHLD, sigchld_handler); + + change_flag ('m', job_control ? '-' : '+'); + + if (interactive) + get_tty_state (); + + if (js.c_childmax < 0) + js.c_childmax = getmaxchild (); + if (js.c_childmax < 0) + js.c_childmax = DEFAULT_CHILD_MAX; + + return job_control; +} + +#ifdef DEBUG +void +debug_print_pgrps () +{ + itrace("original_pgrp = %ld shell_pgrp = %ld terminal_pgrp = %ld", + (long)original_pgrp, (long)shell_pgrp, (long)terminal_pgrp); + itrace("tcgetpgrp(%d) -> %ld, getpgid(0) -> %ld", + shell_tty, (long)tcgetpgrp (shell_tty), (long)getpgid(0)); +} +#endif + +/* Set the line discipline to the best this system has to offer. + Return -1 if this is not possible. */ +static int +set_new_line_discipline (tty) + int tty; +{ +#if defined (NEW_TTY_DRIVER) + int ldisc; + + if (ioctl (tty, TIOCGETD, &ldisc) < 0) + return (-1); + + if (ldisc != NTTYDISC) + { + ldisc = NTTYDISC; + + if (ioctl (tty, TIOCSETD, &ldisc) < 0) + return (-1); + } + return (0); +#endif /* NEW_TTY_DRIVER */ + +#if defined (TERMIO_TTY_DRIVER) +# if defined (TERMIO_LDISC) && (NTTYDISC) + if (ioctl (tty, TCGETA, &shell_tty_info) < 0) + return (-1); + + if (shell_tty_info.c_line != NTTYDISC) + { + shell_tty_info.c_line = NTTYDISC; + if (ioctl (tty, TCSETAW, &shell_tty_info) < 0) + return (-1); + } +# endif /* TERMIO_LDISC && NTTYDISC */ + return (0); +#endif /* TERMIO_TTY_DRIVER */ + +#if defined (TERMIOS_TTY_DRIVER) +# if defined (TERMIOS_LDISC) && defined (NTTYDISC) + if (tcgetattr (tty, &shell_tty_info) < 0) + return (-1); + + if (shell_tty_info.c_line != NTTYDISC) + { + shell_tty_info.c_line = NTTYDISC; + if (tcsetattr (tty, TCSADRAIN, &shell_tty_info) < 0) + return (-1); + } +# endif /* TERMIOS_LDISC && NTTYDISC */ + return (0); +#endif /* TERMIOS_TTY_DRIVER */ + +#if !defined (NEW_TTY_DRIVER) && !defined (TERMIO_TTY_DRIVER) && !defined (TERMIOS_TTY_DRIVER) + return (-1); +#endif +} + +/* Setup this shell to handle C-C, etc. */ +void +initialize_job_signals () +{ + if (interactive) + { + set_signal_handler (SIGINT, sigint_sighandler); + set_signal_handler (SIGTSTP, SIG_IGN); + set_signal_handler (SIGTTOU, SIG_IGN); + set_signal_handler (SIGTTIN, SIG_IGN); + } + else if (job_control) + { + old_tstp = set_signal_handler (SIGTSTP, sigstop_sighandler); + old_ttin = set_signal_handler (SIGTTIN, sigstop_sighandler); + old_ttou = set_signal_handler (SIGTTOU, sigstop_sighandler); + } + /* Leave these things alone for non-interactive shells without job + control. */ +} + +/* Here we handle CONT signals. */ +static sighandler +sigcont_sighandler (sig) + int sig; +{ + initialize_job_signals (); + set_signal_handler (SIGCONT, old_cont); + kill (getpid (), SIGCONT); + + SIGRETURN (0); +} + +/* Here we handle stop signals while we are running not as a login shell. */ +static sighandler +sigstop_sighandler (sig) + int sig; +{ + set_signal_handler (SIGTSTP, old_tstp); + set_signal_handler (SIGTTOU, old_ttou); + set_signal_handler (SIGTTIN, old_ttin); + + old_cont = set_signal_handler (SIGCONT, sigcont_sighandler); + + give_terminal_to (shell_pgrp, 0); + + kill (getpid (), sig); + + SIGRETURN (0); +} + +/* Give the terminal to PGRP. */ +int +give_terminal_to (pgrp, force) + pid_t pgrp; + int force; +{ + sigset_t set, oset; + int r, e; + + r = 0; + if (job_control || force) + { + sigemptyset (&set); + sigaddset (&set, SIGTTOU); + sigaddset (&set, SIGTTIN); + sigaddset (&set, SIGTSTP); + sigaddset (&set, SIGCHLD); + sigemptyset (&oset); + sigprocmask (SIG_BLOCK, &set, &oset); + + if (tcsetpgrp (shell_tty, pgrp) < 0) + { + /* Maybe we should print an error message? */ +#if 0 + sys_error ("tcsetpgrp(%d) failed: pid %ld to pgrp %ld", + shell_tty, (long)getpid(), (long)pgrp); +#endif + r = -1; + e = errno; + } + else + terminal_pgrp = pgrp; + sigprocmask (SIG_SETMASK, &oset, (sigset_t *)NULL); + } + + if (r == -1) + errno = e; + + return r; +} + +/* Give terminal to NPGRP iff it's currently owned by OPGRP. FLAGS are the + flags to pass to give_terminal_to(). */ +static int +maybe_give_terminal_to (opgrp, npgrp, flags) + pid_t opgrp, npgrp; + int flags; +{ + int tpgrp; + + tpgrp = tcgetpgrp (shell_tty); + if (tpgrp < 0 && errno == ENOTTY) + return -1; + if (tpgrp == npgrp) + { + terminal_pgrp = npgrp; + return 0; + } + else if (tpgrp != opgrp) + { +#if defined (DEBUG) + internal_warning ("maybe_give_terminal_to: terminal pgrp == %d shell pgrp = %d new pgrp = %d", tpgrp, opgrp, npgrp); +#endif + return -1; + } + else + return (give_terminal_to (npgrp, flags)); +} + +/* Clear out any jobs in the job array. This is intended to be used by + children of the shell, who should not have any job structures as baggage + when they start executing (forking subshells for parenthesized execution + and functions with pipes are the two that spring to mind). If RUNNING_ONLY + is nonzero, only running jobs are removed from the table. */ +void +delete_all_jobs (running_only) + int running_only; +{ + register int i; + sigset_t set, oset; + + BLOCK_CHILD (set, oset); + + /* XXX - need to set j_lastj, j_firstj appropriately if running_only != 0. */ + if (js.j_jobslots) + { + js.j_current = js.j_previous = NO_JOB; + + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("delete_all_jobs: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("delete_all_jobs: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + if (jobs[i] && (running_only == 0 || (running_only && RUNNING(i)))) + delete_job (i, DEL_WARNSTOPPED); + } + if (running_only == 0) + { + free ((char *)jobs); + js.j_jobslots = 0; + js.j_firstj = js.j_lastj = js.j_njobs = 0; + } + } + + if (running_only == 0) + bgp_clear (); + + UNBLOCK_CHILD (oset); +} + +/* Mark all jobs in the job array so that they don't get a SIGHUP when the + shell gets one. If RUNNING_ONLY is nonzero, mark only running jobs. */ +void +nohup_all_jobs (running_only) + int running_only; +{ + register int i; + sigset_t set, oset; + + BLOCK_CHILD (set, oset); + + if (js.j_jobslots) + { + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + if (jobs[i] && (running_only == 0 || (running_only && RUNNING(i)))) + nohup_job (i); + } + + UNBLOCK_CHILD (oset); +} + +int +count_all_jobs () +{ + int i, n; + sigset_t set, oset; + + /* This really counts all non-dead jobs. */ + BLOCK_CHILD (set, oset); + /* XXX could use js.j_firstj here */ + for (i = n = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("count_all_jobs: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("count_all_jobs: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + if (jobs[i] && DEADJOB(i) == 0) + n++; + } + UNBLOCK_CHILD (oset); + return n; +} + +static void +mark_all_jobs_as_dead () +{ + register int i; + sigset_t set, oset; + + if (js.j_jobslots == 0) + return; + + BLOCK_CHILD (set, oset); + + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + if (jobs[i]) + { + jobs[i]->state = JDEAD; + js.j_ndead++; + } + + UNBLOCK_CHILD (oset); +} + +/* Mark all dead jobs as notified, so delete_job () cleans them out + of the job table properly. POSIX.2 says we need to save the + status of the last CHILD_MAX jobs, so we count the number of dead + jobs and mark only enough as notified to save CHILD_MAX statuses. */ +static void +mark_dead_jobs_as_notified (force) + int force; +{ + register int i, ndead, ndeadproc; + sigset_t set, oset; + + if (js.j_jobslots == 0) + return; + + BLOCK_CHILD (set, oset); + + /* If FORCE is non-zero, we don't have to keep CHILD_MAX statuses + around; just run through the array. */ + if (force) + { + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + { + if (jobs[i] && DEADJOB (i) && (interactive_shell || (find_last_pid (i, 0) != last_asynchronous_pid))) + jobs[i]->flags |= J_NOTIFIED; + } + UNBLOCK_CHILD (oset); + return; + } + + /* Mark enough dead jobs as notified to keep CHILD_MAX processes left in the + array with the corresponding not marked as notified. This is a better + way to avoid pid aliasing and reuse problems than keeping the POSIX- + mandated CHILD_MAX jobs around. delete_job() takes care of keeping the + bgpids list regulated. */ + + /* Count the number of dead jobs */ + /* XXX could use js.j_firstj here */ + for (i = ndead = ndeadproc = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("mark_dead_jobs_as_notified: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("mark_dead_jobs_as_notified: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + if (jobs[i] && DEADJOB (i)) + { + ndead++; + ndeadproc += processes_in_job (i); + } + } + +#ifdef DEBUG +# if 0 + if (ndeadproc != js.c_reaped) + itrace("mark_dead_jobs_as_notified: ndeadproc (%d) != js.c_reaped (%d)", ndeadproc, js.c_reaped); +# endif + if (ndead != js.j_ndead) + itrace("mark_dead_jobs_as_notified: ndead (%d) != js.j_ndead (%d)", ndead, js.j_ndead); +#endif + + if (js.c_childmax < 0) + js.c_childmax = getmaxchild (); + if (js.c_childmax < 0) + js.c_childmax = DEFAULT_CHILD_MAX; + + /* Don't do anything if the number of dead processes is less than CHILD_MAX + and we're not forcing a cleanup. */ + if (ndeadproc <= js.c_childmax) + { + UNBLOCK_CHILD (oset); + return; + } + +#if 0 +itrace("mark_dead_jobs_as_notified: child_max = %d ndead = %d ndeadproc = %d", js.c_childmax, ndead, ndeadproc); +#endif + + /* Mark enough dead jobs as notified that we keep CHILD_MAX jobs in + the list. This isn't exactly right yet; changes need to be made + to stop_pipeline so we don't mark the newer jobs after we've + created CHILD_MAX slots in the jobs array. This needs to be + integrated with a way to keep the jobs array from growing without + bound. Maybe we wrap back around to 0 after we reach some max + limit, and there are sufficient job slots free (keep track of total + size of jobs array (js.j_jobslots) and running count of number of jobs + in jobs array. Then keep a job index corresponding to the `oldest job' + and start this loop there, wrapping around as necessary. In effect, + we turn the list into a circular buffer. */ + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + { + if (jobs[i] && DEADJOB (i) && (interactive_shell || (find_last_pid (i, 0) != last_asynchronous_pid))) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("mark_dead_jobs_as_notified: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("mark_dead_jobs_as_notified: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + /* If marking this job as notified would drop us down below + child_max, don't mark it so we can keep at least child_max + statuses. XXX -- need to check what Posix actually says + about keeping statuses. */ + if ((ndeadproc -= processes_in_job (i)) <= js.c_childmax) + break; + jobs[i]->flags |= J_NOTIFIED; + } + } + + UNBLOCK_CHILD (oset); +} + +/* Here to allow other parts of the shell (like the trap stuff) to + freeze and unfreeze the jobs list. */ +void +freeze_jobs_list () +{ + jobs_list_frozen = 1; +} + +void +unfreeze_jobs_list () +{ + jobs_list_frozen = 0; +} + +/* Allow or disallow job control to take place. Returns the old value + of job_control. */ +int +set_job_control (arg) + int arg; +{ + int old; + + old = job_control; + job_control = arg; + + /* If we're turning on job control, reset pipeline_pgrp so make_child will + put new child processes into the right pgrp */ + if (job_control != old && job_control) + pipeline_pgrp = 0; + + return (old); +} + +/* Turn off all traces of job control. This is run by children of the shell + which are going to do shellsy things, like wait (), etc. */ +void +without_job_control () +{ + stop_making_children (); + start_pipeline (); +#if defined (PGRP_PIPE) + sh_closepipe (pgrp_pipe); +#endif + delete_all_jobs (0); + set_job_control (0); +} + +/* If this shell is interactive, terminate all stopped jobs and + restore the original terminal process group. This is done + before the `exec' builtin calls shell_execve. */ +void +end_job_control () +{ + if (interactive_shell) /* XXX - should it be interactive? */ + { + terminate_stopped_jobs (); + + if (original_pgrp >= 0) + give_terminal_to (original_pgrp, 1); + } + + if (original_pgrp >= 0) + setpgid (0, original_pgrp); +} + +/* Restart job control by closing shell tty and reinitializing. This is + called after an exec fails in an interactive shell and we do not exit. */ +void +restart_job_control () +{ + if (shell_tty != -1) + close (shell_tty); + initialize_job_control (0); +} + +void +set_maxchild (nchild) + int nchild; +{ + static int lmaxchild = -1; + + if (lmaxchild < 0) + lmaxchild = getmaxchild (); + if (lmaxchild < 0) + lmaxchild = DEFAULT_CHILD_MAX; + + /* Clamp value we set. Minimum is what Posix requires, maximum is defined + above as MAX_CHILD_MAX. */ + if (nchild < lmaxchild) + nchild = lmaxchild; + else if (nchild > MAX_CHILD_MAX) + nchild = MAX_CHILD_MAX; + + js.c_childmax = nchild; +} + +/* Set the handler to run when the shell receives a SIGCHLD signal. */ +void +set_sigchld_handler () +{ + set_signal_handler (SIGCHLD, sigchld_handler); +} + +#if defined (PGRP_PIPE) +/* Read from the read end of a pipe. This is how the process group leader + blocks until all of the processes in a pipeline have been made. */ +static void +pipe_read (pp) + int *pp; +{ + char ch; + + if (pp[1] >= 0) + { + close (pp[1]); + pp[1] = -1; + } + + if (pp[0] >= 0) + { + while (read (pp[0], &ch, 1) == -1 && errno == EINTR) + ; + } +} + +/* Functional interface closes our local-to-job-control pipes. */ +void +close_pgrp_pipe () +{ + sh_closepipe (pgrp_pipe); +} + +void +save_pgrp_pipe (p, clear) + int *p; + int clear; +{ + p[0] = pgrp_pipe[0]; + p[1] = pgrp_pipe[1]; + if (clear) + pgrp_pipe[0] = pgrp_pipe[1] = -1; +} + +void +restore_pgrp_pipe (p) + int *p; +{ + pgrp_pipe[0] = p[0]; + pgrp_pipe[1] = p[1]; +} + +#endif /* PGRP_PIPE */ diff --git a/.pc/bash43-006.diff/patchlevel.h b/.pc/bash43-006.diff/patchlevel.h new file mode 100644 index 0000000..11097c3 --- /dev/null +++ b/.pc/bash43-006.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 5 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-007.diff/arrayfunc.c b/.pc/bash43-007.diff/arrayfunc.c new file mode 100644 index 0000000..b82767e --- /dev/null +++ b/.pc/bash43-007.diff/arrayfunc.c @@ -0,0 +1,1141 @@ +/* arrayfunc.c -- High-level array functions used by other parts of the shell. */ + +/* Copyright (C) 2001-2011 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#if defined (ARRAY_VARS) + +#if defined (HAVE_UNISTD_H) +# include +#endif +#include + +#include "bashintl.h" + +#include "shell.h" +#include "pathexp.h" + +#include "shmbutil.h" + +#include "builtins/common.h" + +extern char *this_command_name; +extern int last_command_exit_value; +extern int array_needs_making; + +static SHELL_VAR *bind_array_var_internal __P((SHELL_VAR *, arrayind_t, char *, char *, int)); +static SHELL_VAR *assign_array_element_internal __P((SHELL_VAR *, char *, char *, char *, int, char *, int)); + +static char *quote_assign __P((const char *)); +static void quote_array_assignment_chars __P((WORD_LIST *)); +static char *array_value_internal __P((char *, int, int, int *, arrayind_t *)); + +/* Standard error message to use when encountering an invalid array subscript */ +const char * const bash_badsub_errmsg = N_("bad array subscript"); + +/* **************************************************************** */ +/* */ +/* Functions to manipulate array variables and perform assignments */ +/* */ +/* **************************************************************** */ + +/* Convert a shell variable to an array variable. The original value is + saved as array[0]. */ +SHELL_VAR * +convert_var_to_array (var) + SHELL_VAR *var; +{ + char *oldval; + ARRAY *array; + + oldval = value_cell (var); + array = array_create (); + if (oldval) + array_insert (array, 0, oldval); + + FREE (value_cell (var)); + var_setarray (var, array); + + /* these aren't valid anymore */ + var->dynamic_value = (sh_var_value_func_t *)NULL; + var->assign_func = (sh_var_assign_func_t *)NULL; + + INVALIDATE_EXPORTSTR (var); + if (exported_p (var)) + array_needs_making++; + + VSETATTR (var, att_array); + VUNSETATTR (var, att_invisible); + + return var; +} + +/* Convert a shell variable to an array variable. The original value is + saved as array[0]. */ +SHELL_VAR * +convert_var_to_assoc (var) + SHELL_VAR *var; +{ + char *oldval; + HASH_TABLE *hash; + + oldval = value_cell (var); + hash = assoc_create (0); + if (oldval) + assoc_insert (hash, savestring ("0"), oldval); + + FREE (value_cell (var)); + var_setassoc (var, hash); + + /* these aren't valid anymore */ + var->dynamic_value = (sh_var_value_func_t *)NULL; + var->assign_func = (sh_var_assign_func_t *)NULL; + + INVALIDATE_EXPORTSTR (var); + if (exported_p (var)) + array_needs_making++; + + VSETATTR (var, att_assoc); + VUNSETATTR (var, att_invisible); + + return var; +} + +char * +make_array_variable_value (entry, ind, key, value, flags) + SHELL_VAR *entry; + arrayind_t ind; + char *key; + char *value; + int flags; +{ + SHELL_VAR *dentry; + char *newval; + + /* If we're appending, we need the old value of the array reference, so + fake out make_variable_value with a dummy SHELL_VAR */ + if (flags & ASS_APPEND) + { + dentry = (SHELL_VAR *)xmalloc (sizeof (SHELL_VAR)); + dentry->name = savestring (entry->name); + if (assoc_p (entry)) + newval = assoc_reference (assoc_cell (entry), key); + else + newval = array_reference (array_cell (entry), ind); + if (newval) + dentry->value = savestring (newval); + else + { + dentry->value = (char *)xmalloc (1); + dentry->value[0] = '\0'; + } + dentry->exportstr = 0; + dentry->attributes = entry->attributes & ~(att_array|att_assoc|att_exported); + /* Leave the rest of the members uninitialized; the code doesn't look + at them. */ + newval = make_variable_value (dentry, value, flags); + dispose_variable (dentry); + } + else + newval = make_variable_value (entry, value, flags); + + return newval; +} + +static SHELL_VAR * +bind_array_var_internal (entry, ind, key, value, flags) + SHELL_VAR *entry; + arrayind_t ind; + char *key; + char *value; + int flags; +{ + char *newval; + + newval = make_array_variable_value (entry, ind, key, value, flags); + + if (entry->assign_func) + (*entry->assign_func) (entry, newval, ind, key); + else if (assoc_p (entry)) + assoc_insert (assoc_cell (entry), key, newval); + else + array_insert (array_cell (entry), ind, newval); + FREE (newval); + + return (entry); +} + +/* Perform an array assignment name[ind]=value. If NAME already exists and + is not an array, and IND is 0, perform name=value instead. If NAME exists + and is not an array, and IND is not 0, convert it into an array with the + existing value as name[0]. + + If NAME does not exist, just create an array variable, no matter what + IND's value may be. */ +SHELL_VAR * +bind_array_variable (name, ind, value, flags) + char *name; + arrayind_t ind; + char *value; + int flags; +{ + SHELL_VAR *entry; + + entry = find_shell_variable (name); + + if (entry == (SHELL_VAR *) 0) + entry = make_new_array_variable (name); + else if (readonly_p (entry) || noassign_p (entry)) + { + if (readonly_p (entry)) + err_readonly (name); + return (entry); + } + else if (array_p (entry) == 0) + entry = convert_var_to_array (entry); + + /* ENTRY is an array variable, and ARRAY points to the value. */ + return (bind_array_var_internal (entry, ind, 0, value, flags)); +} + +SHELL_VAR * +bind_array_element (entry, ind, value, flags) + SHELL_VAR *entry; + arrayind_t ind; + char *value; + int flags; +{ + return (bind_array_var_internal (entry, ind, 0, value, flags)); +} + +SHELL_VAR * +bind_assoc_variable (entry, name, key, value, flags) + SHELL_VAR *entry; + char *name; + char *key; + char *value; + int flags; +{ + SHELL_VAR *dentry; + char *newval; + + if (readonly_p (entry) || noassign_p (entry)) + { + if (readonly_p (entry)) + err_readonly (name); + return (entry); + } + + return (bind_array_var_internal (entry, 0, key, value, flags)); +} + +/* Parse NAME, a lhs of an assignment statement of the form v[s], and + assign VALUE to that array element by calling bind_array_variable(). */ +SHELL_VAR * +assign_array_element (name, value, flags) + char *name, *value; + int flags; +{ + char *sub, *vname; + int sublen; + SHELL_VAR *entry; + + vname = array_variable_name (name, &sub, &sublen); + + if (vname == 0) + return ((SHELL_VAR *)NULL); + + if ((ALL_ELEMENT_SUB (sub[0]) && sub[1] == ']') || (sublen <= 1)) + { + free (vname); + err_badarraysub (name); + return ((SHELL_VAR *)NULL); + } + + entry = find_variable (vname); + entry = assign_array_element_internal (entry, name, vname, sub, sublen, value, flags); + + free (vname); + return entry; +} + +static SHELL_VAR * +assign_array_element_internal (entry, name, vname, sub, sublen, value, flags) + SHELL_VAR *entry; + char *name; /* only used for error messages */ + char *vname; + char *sub; + int sublen; + char *value; + int flags; +{ + char *akey; + arrayind_t ind; + + if (entry && assoc_p (entry)) + { + sub[sublen-1] = '\0'; + akey = expand_assignment_string_to_string (sub, 0); /* [ */ + sub[sublen-1] = ']'; + if (akey == 0 || *akey == 0) + { + err_badarraysub (name); + FREE (akey); + return ((SHELL_VAR *)NULL); + } + entry = bind_assoc_variable (entry, vname, akey, value, flags); + } + else + { + ind = array_expand_index (entry, sub, sublen); + /* negative subscripts to indexed arrays count back from end */ + if (entry && ind < 0) + ind = (array_p (entry) ? array_max_index (array_cell (entry)) : 0) + 1 + ind; + if (ind < 0) + { + err_badarraysub (name); + return ((SHELL_VAR *)NULL); + } + entry = bind_array_variable (vname, ind, value, flags); + } + + return (entry); +} + +/* Find the array variable corresponding to NAME. If there is no variable, + create a new array variable. If the variable exists but is not an array, + convert it to an indexed array. If FLAGS&1 is non-zero, an existing + variable is checked for the readonly or noassign attribute in preparation + for assignment (e.g., by the `read' builtin). If FLAGS&2 is non-zero, we + create an associative array. */ +SHELL_VAR * +find_or_make_array_variable (name, flags) + char *name; + int flags; +{ + SHELL_VAR *var; + + var = find_variable (name); + if (var == 0) + { + /* See if we have a nameref pointing to a variable that hasn't been + created yet. */ + var = find_variable_last_nameref (name); + if (var && nameref_p (var)) + var = (flags & 2) ? make_new_assoc_variable (nameref_cell (var)) : make_new_array_variable (nameref_cell (var)); + } + + if (var == 0) + var = (flags & 2) ? make_new_assoc_variable (name) : make_new_array_variable (name); + else if ((flags & 1) && (readonly_p (var) || noassign_p (var))) + { + if (readonly_p (var)) + err_readonly (name); + return ((SHELL_VAR *)NULL); + } + else if ((flags & 2) && array_p (var)) + { + last_command_exit_value = 1; + report_error (_("%s: cannot convert indexed to associative array"), name); + return ((SHELL_VAR *)NULL); + } + else if (array_p (var) == 0 && assoc_p (var) == 0) + var = convert_var_to_array (var); + + return (var); +} + +/* Perform a compound assignment statement for array NAME, where VALUE is + the text between the parens: NAME=( VALUE ) */ +SHELL_VAR * +assign_array_from_string (name, value, flags) + char *name, *value; + int flags; +{ + SHELL_VAR *var; + int vflags; + + vflags = 1; + if (flags & ASS_MKASSOC) + vflags |= 2; + + var = find_or_make_array_variable (name, vflags); + if (var == 0) + return ((SHELL_VAR *)NULL); + + return (assign_array_var_from_string (var, value, flags)); +} + +/* Sequentially assign the indices of indexed array variable VAR from the + words in LIST. */ +SHELL_VAR * +assign_array_var_from_word_list (var, list, flags) + SHELL_VAR *var; + WORD_LIST *list; + int flags; +{ + register arrayind_t i; + register WORD_LIST *l; + ARRAY *a; + + a = array_cell (var); + i = (flags & ASS_APPEND) ? array_max_index (a) + 1 : 0; + + for (l = list; l; l = l->next, i++) + if (var->assign_func) + (*var->assign_func) (var, l->word->word, i, 0); + else + array_insert (a, i, l->word->word); + return var; +} + +WORD_LIST * +expand_compound_array_assignment (var, value, flags) + SHELL_VAR *var; + char *value; + int flags; +{ + WORD_LIST *list, *nlist; + WORD_LIST *hd, *tl, *t, *n; + char *val; + int ni; + + /* This condition is true when invoked from the declare builtin with a + command like + declare -a d='([1]="" [2]="bdef" [5]="hello world" "test")' */ + if (*value == '(') /*)*/ + { + ni = 1; + val = extract_array_assignment_list (value, &ni); + if (val == 0) + return (WORD_LIST *)NULL; + } + else + val = value; + + /* Expand the value string into a list of words, performing all the + shell expansions including pathname generation and word splitting. */ + /* First we split the string on whitespace, using the shell parser + (ksh93 seems to do this). */ + list = parse_string_to_word_list (val, 1, "array assign"); + + if (var && assoc_p (var)) + { + if (val != value) + free (val); + return list; + } + + /* If we're using [subscript]=value, we need to quote each [ and ] to + prevent unwanted filename expansion. This doesn't need to be done + for associative array expansion, since that uses a different expansion + function (see assign_compound_array_list below). */ + if (list) + quote_array_assignment_chars (list); + + /* Now that we've split it, perform the shell expansions on each + word in the list. */ + nlist = list ? expand_words_no_vars (list) : (WORD_LIST *)NULL; + + dispose_words (list); + + if (val != value) + free (val); + + return nlist; +} + +/* Callers ensure that VAR is not NULL */ +void +assign_compound_array_list (var, nlist, flags) + SHELL_VAR *var; + WORD_LIST *nlist; + int flags; +{ + ARRAY *a; + HASH_TABLE *h; + WORD_LIST *list; + char *w, *val, *nval; + int len, iflags, free_val; + arrayind_t ind, last_ind; + char *akey; + + a = (var && array_p (var)) ? array_cell (var) : (ARRAY *)0; + h = (var && assoc_p (var)) ? assoc_cell (var) : (HASH_TABLE *)0; + + akey = (char *)0; + ind = 0; + + /* Now that we are ready to assign values to the array, kill the existing + value. */ + if ((flags & ASS_APPEND) == 0) + { + if (a && array_p (var)) + array_flush (a); + else if (h && assoc_p (var)) + assoc_flush (h); + } + + last_ind = (a && (flags & ASS_APPEND)) ? array_max_index (a) + 1 : 0; + + for (list = nlist; list; list = list->next) + { + iflags = flags; + w = list->word->word; + + /* We have a word of the form [ind]=value */ + if ((list->word->flags & W_ASSIGNMENT) && w[0] == '[') + { + /* Don't have to handle embedded quotes specially any more, since + associative array subscripts have not been expanded yet (see + above). */ + len = skipsubscript (w, 0, 0); + + /* XXX - changes for `+=' */ + if (w[len] != ']' || (w[len+1] != '=' && (w[len+1] != '+' || w[len+2] != '='))) + { + if (assoc_p (var)) + { + err_badarraysub (w); + continue; + } + nval = make_variable_value (var, w, flags); + if (var->assign_func) + (*var->assign_func) (var, nval, last_ind, 0); + else + array_insert (a, last_ind, nval); + FREE (nval); + last_ind++; + continue; + } + + if (len == 1) + { + err_badarraysub (w); + continue; + } + + if (ALL_ELEMENT_SUB (w[1]) && len == 2) + { + last_command_exit_value = 1; + if (assoc_p (var)) + report_error (_("%s: invalid associative array key"), w); + else + report_error (_("%s: cannot assign to non-numeric index"), w); + continue; + } + + if (array_p (var)) + { + ind = array_expand_index (var, w + 1, len); + /* negative subscripts to indexed arrays count back from end */ + if (ind < 0) + ind = array_max_index (array_cell (var)) + 1 + ind; + if (ind < 0) + { + err_badarraysub (w); + continue; + } + + last_ind = ind; + } + else if (assoc_p (var)) + { + /* This is not performed above, see expand_compound_array_assignment */ + w[len] = '\0'; /*[*/ + akey = expand_assignment_string_to_string (w+1, 0); + w[len] = ']'; + /* And we need to expand the value also, see below */ + if (akey == 0 || *akey == 0) + { + err_badarraysub (w); + FREE (akey); + continue; + } + } + + /* XXX - changes for `+=' -- just accept the syntax. ksh93 doesn't do this */ + if (w[len + 1] == '+' && w[len + 2] == '=') + { + iflags |= ASS_APPEND; + val = w + len + 3; + } + else + val = w + len + 2; + } + else if (assoc_p (var)) + { + last_command_exit_value = 1; + report_error (_("%s: %s: must use subscript when assigning associative array"), var->name, w); + continue; + } + else /* No [ind]=value, just a stray `=' */ + { + ind = last_ind; + val = w; + } + + free_val = 0; + /* See above; we need to expand the value here */ + if (assoc_p (var)) + { + val = expand_assignment_string_to_string (val, 0); + free_val = 1; + } + + if (integer_p (var)) + this_command_name = (char *)NULL; /* no command name for errors */ + bind_array_var_internal (var, ind, akey, val, iflags); + last_ind++; + + if (free_val) + free (val); + } +} + +/* Perform a compound array assignment: VAR->name=( VALUE ). The + VALUE has already had the parentheses stripped. */ +SHELL_VAR * +assign_array_var_from_string (var, value, flags) + SHELL_VAR *var; + char *value; + int flags; +{ + WORD_LIST *nlist; + + if (value == 0) + return var; + + nlist = expand_compound_array_assignment (var, value, flags); + assign_compound_array_list (var, nlist, flags); + + if (nlist) + dispose_words (nlist); + return (var); +} + +/* Quote globbing chars and characters in $IFS before the `=' in an assignment + statement (usually a compound array assignment) to protect them from + unwanted filename expansion or word splitting. */ +static char * +quote_assign (string) + const char *string; +{ + size_t slen; + int saw_eq; + char *temp, *t, *subs; + const char *s, *send; + int ss, se; + DECLARE_MBSTATE; + + slen = strlen (string); + send = string + slen; + + t = temp = (char *)xmalloc (slen * 2 + 1); + saw_eq = 0; + for (s = string; *s; ) + { + if (*s == '=') + saw_eq = 1; + if (saw_eq == 0 && *s == '[') /* looks like a subscript */ + { + ss = s - string; + se = skipsubscript (string, ss, 0); + subs = substring (s, ss, se); + *t++ = '\\'; + strcpy (t, subs); + t += se - ss; + *t++ = '\\'; + *t++ = ']'; + s += se + 1; + free (subs); + continue; + } + if (saw_eq == 0 && (glob_char_p (s) || isifs (*s))) + *t++ = '\\'; + + COPY_CHAR_P (t, s, send); + } + *t = '\0'; + return temp; +} + +/* For each word in a compound array assignment, if the word looks like + [ind]=value, quote globbing chars and characters in $IFS before the `='. */ +static void +quote_array_assignment_chars (list) + WORD_LIST *list; +{ + char *nword; + WORD_LIST *l; + + for (l = list; l; l = l->next) + { + if (l->word == 0 || l->word->word == 0 || l->word->word[0] == '\0') + continue; /* should not happen, but just in case... */ + /* Don't bother if it hasn't been recognized as an assignment or + doesn't look like [ind]=value */ + if ((l->word->flags & W_ASSIGNMENT) == 0) + continue; + if (l->word->word[0] != '[' || mbschr (l->word->word, '=') == 0) /* ] */ + continue; + + nword = quote_assign (l->word->word); + free (l->word->word); + l->word->word = nword; + l->word->flags |= W_NOGLOB; /* XXX - W_NOSPLIT also? */ + } +} + +/* skipsubscript moved to subst.c to use private functions. 2009/02/24. */ + +/* This function is called with SUB pointing to just after the beginning + `[' of an array subscript and removes the array element to which SUB + expands from array VAR. A subscript of `*' or `@' unsets the array. */ +int +unbind_array_element (var, sub) + SHELL_VAR *var; + char *sub; +{ + int len; + arrayind_t ind; + char *akey; + ARRAY_ELEMENT *ae; + + len = skipsubscript (sub, 0, 0); + if (sub[len] != ']' || len == 0) + { + builtin_error ("%s[%s: %s", var->name, sub, _(bash_badsub_errmsg)); + return -1; + } + sub[len] = '\0'; + + if (ALL_ELEMENT_SUB (sub[0]) && sub[1] == 0) + { + unbind_variable (var->name); + return (0); + } + + if (assoc_p (var)) + { + akey = expand_assignment_string_to_string (sub, 0); /* [ */ + if (akey == 0 || *akey == 0) + { + builtin_error ("[%s]: %s", sub, _(bash_badsub_errmsg)); + FREE (akey); + return -1; + } + assoc_remove (assoc_cell (var), akey); + free (akey); + } + else + { + ind = array_expand_index (var, sub, len+1); + /* negative subscripts to indexed arrays count back from end */ + if (ind < 0) + ind = array_max_index (array_cell (var)) + 1 + ind; + if (ind < 0) + { + builtin_error ("[%s]: %s", sub, _(bash_badsub_errmsg)); + return -1; + } + ae = array_remove (array_cell (var), ind); + if (ae) + array_dispose_element (ae); + } + + return 0; +} + +/* Format and output an array assignment in compound form VAR=(VALUES), + suitable for re-use as input. */ +void +print_array_assignment (var, quoted) + SHELL_VAR *var; + int quoted; +{ + char *vstr; + + vstr = array_to_assign (array_cell (var), quoted); + + if (vstr == 0) + printf ("%s=%s\n", var->name, quoted ? "'()'" : "()"); + else + { + printf ("%s=%s\n", var->name, vstr); + free (vstr); + } +} + +/* Format and output an associative array assignment in compound form + VAR=(VALUES), suitable for re-use as input. */ +void +print_assoc_assignment (var, quoted) + SHELL_VAR *var; + int quoted; +{ + char *vstr; + + vstr = assoc_to_assign (assoc_cell (var), quoted); + + if (vstr == 0) + printf ("%s=%s\n", var->name, quoted ? "'()'" : "()"); + else + { + printf ("%s=%s\n", var->name, vstr); + free (vstr); + } +} + +/***********************************************************************/ +/* */ +/* Utility functions to manage arrays and their contents for expansion */ +/* */ +/***********************************************************************/ + +/* Return 1 if NAME is a properly-formed array reference v[sub]. */ +int +valid_array_reference (name) + char *name; +{ + char *t; + int r, len; + + t = mbschr (name, '['); /* ] */ + if (t) + { + *t = '\0'; + r = legal_identifier (name); + *t = '['; + if (r == 0) + return 0; + /* Check for a properly-terminated non-blank subscript. */ + len = skipsubscript (t, 0, 0); + if (t[len] != ']' || len == 1) + return 0; + for (r = 1; r < len; r++) + if (whitespace (t[r]) == 0) + return 1; + return 0; + } + return 0; +} + +/* Expand the array index beginning at S and extending LEN characters. */ +arrayind_t +array_expand_index (var, s, len) + SHELL_VAR *var; + char *s; + int len; +{ + char *exp, *t; + int expok; + arrayind_t val; + + exp = (char *)xmalloc (len); + strncpy (exp, s, len - 1); + exp[len - 1] = '\0'; + t = expand_arith_string (exp, 0); + this_command_name = (char *)NULL; + val = evalexp (t, &expok); + free (t); + free (exp); + if (expok == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + + top_level_cleanup (); + jump_to_top_level (DISCARD); + } + return val; +} + +/* Return the name of the variable specified by S without any subscript. + If SUBP is non-null, return a pointer to the start of the subscript + in *SUBP. If LENP is non-null, the length of the subscript is returned + in *LENP. This returns newly-allocated memory. */ +char * +array_variable_name (s, subp, lenp) + char *s, **subp; + int *lenp; +{ + char *t, *ret; + int ind, ni; + + t = mbschr (s, '['); + if (t == 0) + { + if (subp) + *subp = t; + if (lenp) + *lenp = 0; + return ((char *)NULL); + } + ind = t - s; + ni = skipsubscript (s, ind, 0); + if (ni <= ind + 1 || s[ni] != ']') + { + err_badarraysub (s); + if (subp) + *subp = t; + if (lenp) + *lenp = 0; + return ((char *)NULL); + } + + *t = '\0'; + ret = savestring (s); + *t++ = '['; /* ] */ + + if (subp) + *subp = t; + if (lenp) + *lenp = ni - ind; + + return ret; +} + +/* Return the variable specified by S without any subscript. If SUBP is + non-null, return a pointer to the start of the subscript in *SUBP. + If LENP is non-null, the length of the subscript is returned in *LENP. */ +SHELL_VAR * +array_variable_part (s, subp, lenp) + char *s, **subp; + int *lenp; +{ + char *t; + SHELL_VAR *var; + + t = array_variable_name (s, subp, lenp); + if (t == 0) + return ((SHELL_VAR *)NULL); + var = find_variable (t); + + free (t); +#if 0 + return (var == 0 || invisible_p (var)) ? (SHELL_VAR *)0 : var; +#else + return var; /* now return invisible variables; caller must handle */ +#endif +} + +#define INDEX_ERROR() \ + do \ + { \ + if (var) \ + err_badarraysub (var->name); \ + else \ + { \ + t[-1] = '\0'; \ + err_badarraysub (s); \ + t[-1] = '['; /* ] */\ + } \ + return ((char *)NULL); \ + } \ + while (0) + +/* Return a string containing the elements in the array and subscript + described by S. If the subscript is * or @, obeys quoting rules akin + to the expansion of $* and $@ including double quoting. If RTYPE + is non-null it gets 1 if the array reference is name[*], 2 if the + reference is name[@], and 0 otherwise. */ +static char * +array_value_internal (s, quoted, flags, rtype, indp) + char *s; + int quoted, flags, *rtype; + arrayind_t *indp; +{ + int len; + arrayind_t ind; + char *akey; + char *retval, *t, *temp; + WORD_LIST *l; + SHELL_VAR *var; + + var = array_variable_part (s, &t, &len); + + /* Expand the index, even if the variable doesn't exist, in case side + effects are needed, like ${w[i++]} where w is unset. */ +#if 0 + if (var == 0) + return (char *)NULL; +#endif + + if (len == 0) + return ((char *)NULL); /* error message already printed */ + + /* [ */ + akey = 0; + if (ALL_ELEMENT_SUB (t[0]) && t[1] == ']') + { + if (rtype) + *rtype = (t[0] == '*') ? 1 : 2; + if ((flags & AV_ALLOWALL) == 0) + { + err_badarraysub (s); + return ((char *)NULL); + } + else if (var == 0 || value_cell (var) == 0) /* XXX - check for invisible_p(var) ? */ + return ((char *)NULL); + else if (array_p (var) == 0 && assoc_p (var) == 0) + l = add_string_to_list (value_cell (var), (WORD_LIST *)NULL); + else if (assoc_p (var)) + { + l = assoc_to_word_list (assoc_cell (var)); + if (l == (WORD_LIST *)NULL) + return ((char *)NULL); + } + else + { + l = array_to_word_list (array_cell (var)); + if (l == (WORD_LIST *)NULL) + return ((char *) NULL); + } + + if (t[0] == '*' && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + { + temp = string_list_dollar_star (l); + retval = quote_string (temp); /* XXX - leak here */ + free (temp); + } + else /* ${name[@]} or unquoted ${name[*]} */ + retval = string_list_dollar_at (l, quoted); /* XXX - leak here */ + + dispose_words (l); + } + else + { + if (rtype) + *rtype = 0; + if (var == 0 || array_p (var) || assoc_p (var) == 0) + { + if ((flags & AV_USEIND) == 0 || indp == 0) + { + ind = array_expand_index (var, t, len); + if (ind < 0) + { + /* negative subscripts to indexed arrays count back from end */ + if (var && array_p (var)) + ind = array_max_index (array_cell (var)) + 1 + ind; + if (ind < 0) + INDEX_ERROR(); + } + if (indp) + *indp = ind; + } + else if (indp) + ind = *indp; + } + else if (assoc_p (var)) + { + t[len - 1] = '\0'; + akey = expand_assignment_string_to_string (t, 0); /* [ */ + t[len - 1] = ']'; + if (akey == 0 || *akey == 0) + { + FREE (akey); + INDEX_ERROR(); + } + } + + if (var == 0 || value_cell (var) == 0) /* XXX - check invisible_p(var) ? */ + { + FREE (akey); + return ((char *)NULL); + } + if (array_p (var) == 0 && assoc_p (var) == 0) + return (ind == 0 ? value_cell (var) : (char *)NULL); + else if (assoc_p (var)) + { + retval = assoc_reference (assoc_cell (var), akey); + free (akey); + } + else + retval = array_reference (array_cell (var), ind); + } + + return retval; +} + +/* Return a string containing the elements described by the array and + subscript contained in S, obeying quoting for subscripts * and @. */ +char * +array_value (s, quoted, flags, rtype, indp) + char *s; + int quoted, flags, *rtype; + arrayind_t *indp; +{ + return (array_value_internal (s, quoted, flags|AV_ALLOWALL, rtype, indp)); +} + +/* Return the value of the array indexing expression S as a single string. + If (FLAGS & AV_ALLOWALL) is 0, do not allow `@' and `*' subscripts. This + is used by other parts of the shell such as the arithmetic expression + evaluator in expr.c. */ +char * +get_array_value (s, flags, rtype, indp) + char *s; + int flags, *rtype; + arrayind_t *indp; +{ + return (array_value_internal (s, 0, flags, rtype, indp)); +} + +char * +array_keys (s, quoted) + char *s; + int quoted; +{ + int len; + char *retval, *t, *temp; + WORD_LIST *l; + SHELL_VAR *var; + + var = array_variable_part (s, &t, &len); + + /* [ */ + if (var == 0 || ALL_ELEMENT_SUB (t[0]) == 0 || t[1] != ']') + return (char *)NULL; + + if (var_isset (var) == 0 || invisible_p (var)) + return (char *)NULL; + + if (array_p (var) == 0 && assoc_p (var) == 0) + l = add_string_to_list ("0", (WORD_LIST *)NULL); + else if (assoc_p (var)) + l = assoc_keys_to_word_list (assoc_cell (var)); + else + l = array_keys_to_word_list (array_cell (var)); + if (l == (WORD_LIST *)NULL) + return ((char *) NULL); + + if (t[0] == '*' && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + { + temp = string_list_dollar_star (l); + retval = quote_string (temp); + free (temp); + } + else /* ${!name[@]} or unquoted ${!name[*]} */ + retval = string_list_dollar_at (l, quoted); + + dispose_words (l); + return retval; +} +#endif /* ARRAY_VARS */ diff --git a/.pc/bash43-007.diff/patchlevel.h b/.pc/bash43-007.diff/patchlevel.h new file mode 100644 index 0000000..7e887f6 --- /dev/null +++ b/.pc/bash43-007.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 6 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-008.diff/lib/glob/glob.c b/.pc/bash43-008.diff/lib/glob/glob.c new file mode 100644 index 0000000..f549436 --- /dev/null +++ b/.pc/bash43-008.diff/lib/glob/glob.c @@ -0,0 +1,1365 @@ +/* glob.c -- file-name wildcard pattern matching for Bash. + + Copyright (C) 1985-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne-Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* To whomever it may concern: I have never seen the code which most + Unix programs use to perform this function. I wrote this from scratch + based on specifications for the pattern matching. --RMS. */ + +#include + +#if !defined (__GNUC__) && !defined (HAVE_ALLOCA_H) && defined (_AIX) + #pragma alloca +#endif /* _AIX && RISC6000 && !__GNUC__ */ + +#include "bashtypes.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" +#include "posixdir.h" +#include "posixstat.h" +#include "shmbutil.h" +#include "xmalloc.h" + +#include "filecntl.h" +#if !defined (F_OK) +# define F_OK 0 +#endif + +#include "stdc.h" +#include "memalloc.h" + +#include + +#include "shell.h" + +#include "glob.h" +#include "strmatch.h" + +#if !defined (HAVE_BCOPY) && !defined (bcopy) +# define bcopy(s, d, n) ((void) memcpy ((d), (s), (n))) +#endif /* !HAVE_BCOPY && !bcopy */ + +#if !defined (NULL) +# if defined (__STDC__) +# define NULL ((void *) 0) +# else +# define NULL 0x0 +# endif /* __STDC__ */ +#endif /* !NULL */ + +#if !defined (FREE) +# define FREE(x) if (x) free (x) +#endif + +/* Don't try to alloca() more than this much memory for `struct globval' + in glob_vector() */ +#ifndef ALLOCA_MAX +# define ALLOCA_MAX 100000 +#endif + +struct globval + { + struct globval *next; + char *name; + }; + +extern void throw_to_top_level __P((void)); +extern int sh_eaccess __P((char *, int)); +extern char *sh_makepath __P((const char *, const char *, int)); +extern int signal_is_pending __P((int)); +extern void run_pending_traps __P((void)); + +extern int extended_glob; + +/* Global variable which controls whether or not * matches .*. + Non-zero means don't match .*. */ +int noglob_dot_filenames = 1; + +/* Global variable which controls whether or not filename globbing + is done without regard to case. */ +int glob_ignore_case = 0; + +/* Global variable to return to signify an error in globbing. */ +char *glob_error_return; + +static struct globval finddirs_error_return; + +/* Some forward declarations. */ +static int skipname __P((char *, char *, int)); +#if HANDLE_MULTIBYTE +static int mbskipname __P((char *, char *, int)); +#endif +#if HANDLE_MULTIBYTE +static void udequote_pathname __P((char *)); +static void wdequote_pathname __P((char *)); +#else +# define dequote_pathname udequote_pathname +#endif +static void dequote_pathname __P((char *)); +static int glob_testdir __P((char *, int)); +static char **glob_dir_to_array __P((char *, char **, int)); + +/* Make sure these names continue to agree with what's in smatch.c */ +extern char *glob_patscan __P((char *, char *, int)); +extern wchar_t *glob_patscan_wc __P((wchar_t *, wchar_t *, int)); + +/* Compile `glob_loop.c' for single-byte characters. */ +#define CHAR unsigned char +#define INT int +#define L(CS) CS +#define INTERNAL_GLOB_PATTERN_P internal_glob_pattern_p +#include "glob_loop.c" + +/* Compile `glob_loop.c' again for multibyte characters. */ +#if HANDLE_MULTIBYTE + +#define CHAR wchar_t +#define INT wint_t +#define L(CS) L##CS +#define INTERNAL_GLOB_PATTERN_P internal_glob_wpattern_p +#include "glob_loop.c" + +#endif /* HANDLE_MULTIBYTE */ + +/* And now a function that calls either the single-byte or multibyte version + of internal_glob_pattern_p. */ +int +glob_pattern_p (pattern) + const char *pattern; +{ +#if HANDLE_MULTIBYTE + size_t n; + wchar_t *wpattern; + int r; + + if (MB_CUR_MAX == 1) + return (internal_glob_pattern_p ((unsigned char *)pattern)); + + /* Convert strings to wide chars, and call the multibyte version. */ + n = xdupmbstowcs (&wpattern, NULL, pattern); + if (n == (size_t)-1) + /* Oops. Invalid multibyte sequence. Try it as single-byte sequence. */ + return (internal_glob_pattern_p ((unsigned char *)pattern)); + + r = internal_glob_wpattern_p (wpattern); + free (wpattern); + + return r; +#else + return (internal_glob_pattern_p (pattern)); +#endif +} + +#if EXTENDED_GLOB +/* Return 1 if all subpatterns in the extended globbing pattern PAT indicate + that the name should be skipped. XXX - doesn't handle pattern negation, + not sure if it should */ +static int +extglob_skipname (pat, dname, flags) + char *pat, *dname; + int flags; +{ + char *pp, *pe, *t; + int n, r; + + pp = pat + 2; + pe = pp + strlen (pp) - 1; /*(*/ + if (*pe != ')') + return 0; + if ((t = strchr (pp, '|')) == 0) /* easy case first */ + { + *pe = '\0'; + r = skipname (pp, dname, flags); /*(*/ + *pe = ')'; + return r; + } + while (t = glob_patscan (pp, pe, '|')) + { + n = t[-1]; + t[-1] = '\0'; + r = skipname (pp, dname, flags); + t[-1] = n; + if (r == 0) /* if any pattern says not skip, we don't skip */ + return r; + pp = t; + } /*(*/ + + if (pp == pe) /* glob_patscan might find end of pattern */ + return r; + + *pe = '\0'; +# if defined (HANDLE_MULTIBYTE) + r = mbskipname (pp, dname, flags); /*(*/ +# else + r = skipname (pp, dname, flags); /*(*/ +# endif + *pe = ')'; + return r; +} +#endif + +/* Return 1 if DNAME should be skipped according to PAT. Mostly concerned + with matching leading `.'. */ +static int +skipname (pat, dname, flags) + char *pat; + char *dname; + int flags; +{ +#if EXTENDED_GLOB + if (extglob_pattern_p (pat)) /* XXX */ + return (extglob_skipname (pat, dname, flags)); +#endif + + /* If a leading dot need not be explicitly matched, and the pattern + doesn't start with a `.', don't match `.' or `..' */ + if (noglob_dot_filenames == 0 && pat[0] != '.' && + (pat[0] != '\\' || pat[1] != '.') && + (dname[0] == '.' && + (dname[1] == '\0' || (dname[1] == '.' && dname[2] == '\0')))) + return 1; + + /* If a dot must be explicitly matched, check to see if they do. */ + else if (noglob_dot_filenames && dname[0] == '.' && pat[0] != '.' && + (pat[0] != '\\' || pat[1] != '.')) + return 1; + + return 0; +} + +#if HANDLE_MULTIBYTE + +static int +wchkname (pat_wc, dn_wc) + wchar_t *pat_wc, *dn_wc; +{ + /* If a leading dot need not be explicitly matched, and the + pattern doesn't start with a `.', don't match `.' or `..' */ + if (noglob_dot_filenames == 0 && pat_wc[0] != L'.' && + (pat_wc[0] != L'\\' || pat_wc[1] != L'.') && + (dn_wc[0] == L'.' && + (dn_wc[1] == L'\0' || (dn_wc[1] == L'.' && dn_wc[2] == L'\0')))) + return 1; + + /* If a leading dot must be explicitly matched, check to see if the + pattern and dirname both have one. */ + else if (noglob_dot_filenames && dn_wc[0] == L'.' && + pat_wc[0] != L'.' && + (pat_wc[0] != L'\\' || pat_wc[1] != L'.')) + return 1; + + return 0; +} + +static int +wextglob_skipname (pat, dname, flags) + wchar_t *pat, *dname; + int flags; +{ +#if EXTENDED_GLOB + wchar_t *pp, *pe, *t, n; + int r; + + pp = pat + 2; + pe = pp + wcslen (pp) - 1; /*(*/ + if (*pe != L')') + return 0; + if ((t = wcschr (pp, L'|')) == 0) + { + *pe = L'\0'; + r = wchkname (pp, dname); /*(*/ + *pe = L')'; + return r; + } + while (t = glob_patscan_wc (pp, pe, '|')) + { + n = t[-1]; + t[-1] = L'\0'; + r = wchkname (pp, dname); + t[-1] = n; + if (r == 0) + return 0; + pp = t; + } + + if (pp == pe) /* glob_patscan_wc might find end of pattern */ + return r; + + *pe = L'\0'; + r = wchkname (pp, dname); /*(*/ + *pe = L')'; + return r; +#else + return (wchkname (pat, dname)); +#endif +} + +/* Return 1 if DNAME should be skipped according to PAT. Handles multibyte + characters in PAT and DNAME. Mostly concerned with matching leading `.'. */ +static int +mbskipname (pat, dname, flags) + char *pat, *dname; + int flags; +{ + int ret, ext; + wchar_t *pat_wc, *dn_wc; + size_t pat_n, dn_n; + + if (mbsmbchar (dname) == 0 && mbsmbchar (pat) == 0) + return (skipname (pat, dname, flags)); + + ext = 0; +#if EXTENDED_GLOB + ext = extglob_pattern_p (pat); +#endif + + pat_wc = dn_wc = (wchar_t *)NULL; + + pat_n = xdupmbstowcs (&pat_wc, NULL, pat); + if (pat_n != (size_t)-1) + dn_n = xdupmbstowcs (&dn_wc, NULL, dname); + + ret = 0; + if (pat_n != (size_t)-1 && dn_n !=(size_t)-1) + ret = ext ? wextglob_skipname (pat_wc, dn_wc, flags) : wchkname (pat_wc, dn_wc); + else + ret = skipname (pat, dname, flags); + + FREE (pat_wc); + FREE (dn_wc); + + return ret; +} +#endif /* HANDLE_MULTIBYTE */ + +/* Remove backslashes quoting characters in PATHNAME by modifying PATHNAME. */ +static void +udequote_pathname (pathname) + char *pathname; +{ + register int i, j; + + for (i = j = 0; pathname && pathname[i]; ) + { + if (pathname[i] == '\\') + i++; + + pathname[j++] = pathname[i++]; + + if (pathname[i - 1] == 0) + break; + } + if (pathname) + pathname[j] = '\0'; +} + +#if HANDLE_MULTIBYTE +/* Remove backslashes quoting characters in PATHNAME by modifying PATHNAME. */ +static void +wdequote_pathname (pathname) + char *pathname; +{ + mbstate_t ps; + size_t len, n; + wchar_t *wpathname; + int i, j; + wchar_t *orig_wpathname; + + len = strlen (pathname); + /* Convert the strings into wide characters. */ + n = xdupmbstowcs (&wpathname, NULL, pathname); + if (n == (size_t) -1) + { + /* Something wrong. Fall back to single-byte */ + udequote_pathname (pathname); + return; + } + orig_wpathname = wpathname; + + for (i = j = 0; wpathname && wpathname[i]; ) + { + if (wpathname[i] == L'\\') + i++; + + wpathname[j++] = wpathname[i++]; + + if (wpathname[i - 1] == L'\0') + break; + } + if (wpathname) + wpathname[j] = L'\0'; + + /* Convert the wide character string into unibyte character set. */ + memset (&ps, '\0', sizeof(mbstate_t)); + n = wcsrtombs(pathname, (const wchar_t **)&wpathname, len, &ps); + pathname[len] = '\0'; + + /* Can't just free wpathname here; wcsrtombs changes it in many cases. */ + free (orig_wpathname); +} + +static void +dequote_pathname (pathname) + char *pathname; +{ + if (MB_CUR_MAX > 1) + wdequote_pathname (pathname); + else + udequote_pathname (pathname); +} +#endif /* HANDLE_MULTIBYTE */ + +/* Test whether NAME exists. */ + +#if defined (HAVE_LSTAT) +# define GLOB_TESTNAME(name) (lstat (name, &finfo)) +#else /* !HAVE_LSTAT */ +# if !defined (AFS) +# define GLOB_TESTNAME(name) (sh_eaccess (name, F_OK)) +# else /* AFS */ +# define GLOB_TESTNAME(name) (access (name, F_OK)) +# endif /* AFS */ +#endif /* !HAVE_LSTAT */ + +/* Return 0 if DIR is a directory, -1 otherwise. */ +static int +glob_testdir (dir, flags) + char *dir; + int flags; +{ + struct stat finfo; + int r; + +/*itrace("glob_testdir: testing %s" flags = %d, dir, flags);*/ +#if defined (HAVE_LSTAT) + r = (flags & GX_ALLDIRS) ? lstat (dir, &finfo) : stat (dir, &finfo); +#else + r = stat (dir, &finfo); +#endif + if (r < 0) + return (-1); + + if (S_ISDIR (finfo.st_mode) == 0) + return (-1); + + return (0); +} + +/* Recursively scan SDIR for directories matching PAT (PAT is always `**'). + FLAGS is simply passed down to the recursive call to glob_vector. Returns + a list of matching directory names. EP, if non-null, is set to the last + element of the returned list. NP, if non-null, is set to the number of + directories in the returned list. These two variables exist for the + convenience of the caller (always glob_vector). */ +static struct globval * +finddirs (pat, sdir, flags, ep, np) + char *pat; + char *sdir; + int flags; + struct globval **ep; + int *np; +{ + char **r, *n; + int ndirs; + struct globval *ret, *e, *g; + +/*itrace("finddirs: pat = `%s' sdir = `%s' flags = 0x%x", pat, sdir, flags);*/ + e = ret = 0; + r = glob_vector (pat, sdir, flags); + if (r == 0 || r[0] == 0) + { + if (np) + *np = 0; + if (ep) + *ep = 0; + if (r && r != &glob_error_return) + free (r); + return (struct globval *)0; + } + for (ndirs = 0; r[ndirs] != 0; ndirs++) + { + g = (struct globval *) malloc (sizeof (struct globval)); + if (g == 0) + { + while (ret) /* free list built so far */ + { + g = ret->next; + free (ret); + ret = g; + } + + free (r); + if (np) + *np = 0; + if (ep) + *ep = 0; + return (&finddirs_error_return); + } + if (e == 0) + e = g; + + g->next = ret; + ret = g; + + g->name = r[ndirs]; + } + + free (r); + if (ep) + *ep = e; + if (np) + *np = ndirs; + + return ret; +} + +/* Return a vector of names of files in directory DIR + whose names match glob pattern PAT. + The names are not in any particular order. + Wildcards at the beginning of PAT do not match an initial period. + + The vector is terminated by an element that is a null pointer. + + To free the space allocated, first free the vector's elements, + then free the vector. + + Return 0 if cannot get enough memory to hold the pointer + and the names. + + Return -1 if cannot access directory DIR. + Look in errno for more information. */ + +char ** +glob_vector (pat, dir, flags) + char *pat; + char *dir; + int flags; +{ + DIR *d; + register struct dirent *dp; + struct globval *lastlink, *e, *dirlist; + register struct globval *nextlink; + register char *nextname, *npat, *subdir; + unsigned int count; + int lose, skip, ndirs, isdir, sdlen, add_current, patlen; + register char **name_vector; + register unsigned int i; + int mflags; /* Flags passed to strmatch (). */ + int pflags; /* flags passed to sh_makepath () */ + int nalloca; + struct globval *firstmalloc, *tmplink; + char *convfn; + + lastlink = 0; + count = lose = skip = add_current = 0; + + firstmalloc = 0; + nalloca = 0; + +/*itrace("glob_vector: pat = `%s' dir = `%s' flags = 0x%x", pat, dir, flags);*/ + /* If PAT is empty, skip the loop, but return one (empty) filename. */ + if (pat == 0 || *pat == '\0') + { + if (glob_testdir (dir, 0) < 0) + return ((char **) &glob_error_return); + + nextlink = (struct globval *)alloca (sizeof (struct globval)); + if (nextlink == NULL) + return ((char **) NULL); + + nextlink->next = (struct globval *)0; + nextname = (char *) malloc (1); + if (nextname == 0) + lose = 1; + else + { + lastlink = nextlink; + nextlink->name = nextname; + nextname[0] = '\0'; + count = 1; + } + + skip = 1; + } + + patlen = (pat && *pat) ? strlen (pat) : 0; + + /* If the filename pattern (PAT) does not contain any globbing characters, + we can dispense with reading the directory, and just see if there is + a filename `DIR/PAT'. If there is, and we can access it, just make the + vector to return and bail immediately. */ + if (skip == 0 && glob_pattern_p (pat) == 0) + { + int dirlen; + struct stat finfo; + + if (glob_testdir (dir, 0) < 0) + return ((char **) &glob_error_return); + + dirlen = strlen (dir); + nextname = (char *)malloc (dirlen + patlen + 2); + npat = (char *)malloc (patlen + 1); + if (nextname == 0 || npat == 0) + { + FREE (nextname); + FREE (npat); + lose = 1; + } + else + { + strcpy (npat, pat); + dequote_pathname (npat); + + strcpy (nextname, dir); + nextname[dirlen++] = '/'; + strcpy (nextname + dirlen, npat); + + if (GLOB_TESTNAME (nextname) >= 0) + { + free (nextname); + nextlink = (struct globval *)alloca (sizeof (struct globval)); + if (nextlink) + { + nextlink->next = (struct globval *)0; + lastlink = nextlink; + nextlink->name = npat; + count = 1; + } + else + { + free (npat); + lose = 1; + } + } + else + { + free (nextname); + free (npat); + } + } + + skip = 1; + } + + if (skip == 0) + { + /* Open the directory, punting immediately if we cannot. If opendir + is not robust (i.e., it opens non-directories successfully), test + that DIR is a directory and punt if it's not. */ +#if defined (OPENDIR_NOT_ROBUST) + if (glob_testdir (dir, 0) < 0) + return ((char **) &glob_error_return); +#endif + + d = opendir (dir); + if (d == NULL) + return ((char **) &glob_error_return); + + /* Compute the flags that will be passed to strmatch(). We don't + need to do this every time through the loop. */ + mflags = (noglob_dot_filenames ? FNM_PERIOD : 0) | FNM_PATHNAME; + +#ifdef FNM_CASEFOLD + if (glob_ignore_case) + mflags |= FNM_CASEFOLD; +#endif + + if (extended_glob) + mflags |= FNM_EXTMATCH; + + add_current = ((flags & (GX_ALLDIRS|GX_ADDCURDIR)) == (GX_ALLDIRS|GX_ADDCURDIR)); + + /* Scan the directory, finding all names that match. + For each name that matches, allocate a struct globval + on the stack and store the name in it. + Chain those structs together; lastlink is the front of the chain. */ + while (1) + { + /* Make globbing interruptible in the shell. */ + if (interrupt_state || terminating_signal) + { + lose = 1; + break; + } + else if (signal_is_pending (SIGINT)) /* XXX - make SIGINT traps responsive */ + { + lose = 1; + break; + } + + dp = readdir (d); + if (dp == NULL) + break; + + /* If this directory entry is not to be used, try again. */ + if (REAL_DIR_ENTRY (dp) == 0) + continue; + +#if 0 + if (dp->d_name == 0 || *dp->d_name == 0) + continue; +#endif + +#if HANDLE_MULTIBYTE + if (MB_CUR_MAX > 1 && mbskipname (pat, dp->d_name, flags)) + continue; + else +#endif + if (skipname (pat, dp->d_name, flags)) + continue; + + /* If we're only interested in directories, don't bother with files */ + if (flags & (GX_MATCHDIRS|GX_ALLDIRS)) + { + pflags = (flags & GX_ALLDIRS) ? MP_RMDOT : 0; + if (flags & GX_NULLDIR) + pflags |= MP_IGNDOT; + subdir = sh_makepath (dir, dp->d_name, pflags); + isdir = glob_testdir (subdir, flags); + if (isdir < 0 && (flags & GX_MATCHDIRS)) + { + free (subdir); + continue; + } + } + + if (flags & GX_ALLDIRS) + { + if (isdir == 0) + { + dirlist = finddirs (pat, subdir, (flags & ~GX_ADDCURDIR), &e, &ndirs); + if (dirlist == &finddirs_error_return) + { + free (subdir); + lose = 1; + break; + } + if (ndirs) /* add recursive directories to list */ + { + if (firstmalloc == 0) + firstmalloc = e; + e->next = lastlink; + lastlink = dirlist; + count += ndirs; + } + } + + nextlink = (struct globval *) malloc (sizeof (struct globval)); + if (firstmalloc == 0) + firstmalloc = nextlink; + sdlen = strlen (subdir); + nextname = (char *) malloc (sdlen + 1); + if (nextlink == 0 || nextname == 0) + { + FREE (nextlink); + FREE (nextname); + free (subdir); + lose = 1; + break; + } + nextlink->next = lastlink; + lastlink = nextlink; + nextlink->name = nextname; + bcopy (subdir, nextname, sdlen + 1); + free (subdir); + ++count; + continue; + } + else if (flags & GX_MATCHDIRS) + free (subdir); + + convfn = fnx_fromfs (dp->d_name, D_NAMLEN (dp)); + if (strmatch (pat, convfn, mflags) != FNM_NOMATCH) + { + if (nalloca < ALLOCA_MAX) + { + nextlink = (struct globval *) alloca (sizeof (struct globval)); + nalloca += sizeof (struct globval); + } + else + { + nextlink = (struct globval *) malloc (sizeof (struct globval)); + if (firstmalloc == 0) + firstmalloc = nextlink; + } + + nextname = (char *) malloc (D_NAMLEN (dp) + 1); + if (nextlink == 0 || nextname == 0) + { + FREE (nextlink); + FREE (nextname); + lose = 1; + break; + } + nextlink->next = lastlink; + lastlink = nextlink; + nextlink->name = nextname; + bcopy (dp->d_name, nextname, D_NAMLEN (dp) + 1); + ++count; + } + } + + (void) closedir (d); + } + + /* compat: if GX_ADDCURDIR, add the passed directory also. Add an empty + directory name as a placeholder if GX_NULLDIR (in which case the passed + directory name is "."). */ + if (add_current) + { + sdlen = strlen (dir); + nextname = (char *)malloc (sdlen + 1); + nextlink = (struct globval *) malloc (sizeof (struct globval)); + if (nextlink == 0 || nextname == 0) + { + FREE (nextlink); + FREE (nextname); + lose = 1; + } + else + { + nextlink->name = nextname; + nextlink->next = lastlink; + lastlink = nextlink; + if (flags & GX_NULLDIR) + nextname[0] = '\0'; + else + bcopy (dir, nextname, sdlen + 1); + ++count; + } + } + + if (lose == 0) + { + name_vector = (char **) malloc ((count + 1) * sizeof (char *)); + lose |= name_vector == NULL; + } + + /* Have we run out of memory? */ + if (lose) + { + tmplink = 0; + + /* Here free the strings we have got. */ + while (lastlink) + { + /* Since we build the list in reverse order, the first N entries + will be allocated with malloc, if firstmalloc is set, from + lastlink to firstmalloc. */ + if (firstmalloc) + { + if (lastlink == firstmalloc) + firstmalloc = 0; + tmplink = lastlink; + } + else + tmplink = 0; + free (lastlink->name); + lastlink = lastlink->next; + FREE (tmplink); + } + + /* Don't call QUIT; here; let higher layers deal with it. */ + + return ((char **)NULL); + } + + /* Copy the name pointers from the linked list into the vector. */ + for (tmplink = lastlink, i = 0; i < count; ++i) + { + name_vector[i] = tmplink->name; + tmplink = tmplink->next; + } + + name_vector[count] = NULL; + + /* If we allocated some of the struct globvals, free them now. */ + if (firstmalloc) + { + tmplink = 0; + while (lastlink) + { + tmplink = lastlink; + if (lastlink == firstmalloc) + lastlink = firstmalloc = 0; + else + lastlink = lastlink->next; + free (tmplink); + } + } + + return (name_vector); +} + +/* Return a new array which is the concatenation of each string in ARRAY + to DIR. This function expects you to pass in an allocated ARRAY, and + it takes care of free()ing that array. Thus, you might think of this + function as side-effecting ARRAY. This should handle GX_MARKDIRS. */ +static char ** +glob_dir_to_array (dir, array, flags) + char *dir, **array; + int flags; +{ + register unsigned int i, l; + int add_slash; + char **result, *new; + struct stat sb; + + l = strlen (dir); + if (l == 0) + { + if (flags & GX_MARKDIRS) + for (i = 0; array[i]; i++) + { + if ((stat (array[i], &sb) == 0) && S_ISDIR (sb.st_mode)) + { + l = strlen (array[i]); + new = (char *)realloc (array[i], l + 2); + if (new == 0) + return NULL; + new[l] = '/'; + new[l+1] = '\0'; + array[i] = new; + } + } + return (array); + } + + add_slash = dir[l - 1] != '/'; + + i = 0; + while (array[i] != NULL) + ++i; + + result = (char **) malloc ((i + 1) * sizeof (char *)); + if (result == NULL) + return (NULL); + + for (i = 0; array[i] != NULL; i++) + { + /* 3 == 1 for NUL, 1 for slash at end of DIR, 1 for GX_MARKDIRS */ + result[i] = (char *) malloc (l + strlen (array[i]) + 3); + + if (result[i] == NULL) + { + int ind; + for (ind = 0; ind < i; ind++) + free (result[ind]); + free (result); + return (NULL); + } + + strcpy (result[i], dir); + if (add_slash) + result[i][l] = '/'; + strcpy (result[i] + l + add_slash, array[i]); + if (flags & GX_MARKDIRS) + { + if ((stat (result[i], &sb) == 0) && S_ISDIR (sb.st_mode)) + { + size_t rlen; + rlen = strlen (result[i]); + result[i][rlen] = '/'; + result[i][rlen+1] = '\0'; + } + } + } + result[i] = NULL; + + /* Free the input array. */ + for (i = 0; array[i] != NULL; i++) + free (array[i]); + free ((char *) array); + + return (result); +} + +/* Do globbing on PATHNAME. Return an array of pathnames that match, + marking the end of the array with a null-pointer as an element. + If no pathnames match, then the array is empty (first element is null). + If there isn't enough memory, then return NULL. + If a file system error occurs, return -1; `errno' has the error code. */ +char ** +glob_filename (pathname, flags) + char *pathname; + int flags; +{ + char **result; + unsigned int result_size; + char *directory_name, *filename, *dname; + unsigned int directory_len; + int free_dirname; /* flag */ + int dflags; + + result = (char **) malloc (sizeof (char *)); + result_size = 1; + if (result == NULL) + return (NULL); + + result[0] = NULL; + + directory_name = NULL; + + /* Find the filename. */ + filename = strrchr (pathname, '/'); + if (filename == NULL) + { + filename = pathname; + directory_name = ""; + directory_len = 0; + free_dirname = 0; + } + else + { + directory_len = (filename - pathname) + 1; + directory_name = (char *) malloc (directory_len + 1); + + if (directory_name == 0) /* allocation failed? */ + return (NULL); + + bcopy (pathname, directory_name, directory_len); + directory_name[directory_len] = '\0'; + ++filename; + free_dirname = 1; + } + + /* If directory_name contains globbing characters, then we + have to expand the previous levels. Just recurse. */ + if (directory_len > 0 && glob_pattern_p (directory_name)) + { + char **directories, *d, *p; + register unsigned int i; + int all_starstar, last_starstar; + + all_starstar = last_starstar = 0; + d = directory_name; + dflags = flags & ~GX_MARKDIRS; + /* Collapse a sequence of ** patterns separated by one or more slashes + to a single ** terminated by a slash or NUL */ + if ((flags & GX_GLOBSTAR) && d[0] == '*' && d[1] == '*' && (d[2] == '/' || d[2] == '\0')) + { + p = d; + while (d[0] == '*' && d[1] == '*' && (d[2] == '/' || d[2] == '\0')) + { + p = d; + if (d[2]) + { + d += 3; + while (*d == '/') + d++; + if (*d == 0) + break; + } + } + if (*d == 0) + all_starstar = 1; + d = p; + dflags |= GX_ALLDIRS|GX_ADDCURDIR; + directory_len = strlen (d); + } + + /* If there is a non [star][star]/ component in directory_name, we + still need to collapse trailing sequences of [star][star]/ into + a single one and note that the directory name ends with [star][star], + so we can compensate if filename is [star][star] */ + if ((flags & GX_GLOBSTAR) && all_starstar == 0) + { + int dl, prev; + prev = dl = directory_len; + while (dl >= 4 && d[dl - 1] == '/' && + d[dl - 2] == '*' && + d[dl - 3] == '*' && + d[dl - 4] == '/') + prev = dl, dl -= 3; + if (dl != directory_len) + last_starstar = 1; + directory_len = prev; + } + + /* If the directory name ends in [star][star]/ but the filename is + [star][star], just remove the final [star][star] from the directory + so we don't have to scan everything twice. */ + if (last_starstar && directory_len > 4 && + filename[0] == '*' && filename[1] == '*' && filename[2] == 0) + { + directory_len -= 3; + } + + if (d[directory_len - 1] == '/') + d[directory_len - 1] = '\0'; + + directories = glob_filename (d, dflags); + + if (free_dirname) + { + free (directory_name); + directory_name = NULL; + } + + if (directories == NULL) + goto memory_error; + else if (directories == (char **)&glob_error_return) + { + free ((char *) result); + return ((char **) &glob_error_return); + } + else if (*directories == NULL) + { + free ((char *) directories); + free ((char *) result); + return ((char **) &glob_error_return); + } + + /* If we have something like [star][star]/[star][star], it's no use to + glob **, then do it again, and throw half the results away. */ + if (all_starstar && filename[0] == '*' && filename[1] == '*' && filename[2] == 0) + { + free ((char *) directories); + free (directory_name); + directory_name = NULL; + directory_len = 0; + goto only_filename; + } + + /* We have successfully globbed the preceding directory name. + For each name in DIRECTORIES, call glob_vector on it and + FILENAME. Concatenate the results together. */ + for (i = 0; directories[i] != NULL; ++i) + { + char **temp_results; + int shouldbreak; + + shouldbreak = 0; + /* XXX -- we've recursively scanned any directories resulting from + a `**', so turn off the flag. We turn it on again below if + filename is `**' */ + /* Scan directory even on a NULL filename. That way, `*h/' + returns only directories ending in `h', instead of all + files ending in `h' with a `/' appended. */ + dname = directories[i]; + dflags = flags & ~(GX_MARKDIRS|GX_ALLDIRS|GX_ADDCURDIR); + if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0') + dflags |= GX_ALLDIRS|GX_ADDCURDIR; + if (dname[0] == '\0' && filename[0]) + { + dflags |= GX_NULLDIR; + dname = "."; /* treat null directory name and non-null filename as current directory */ + } + temp_results = glob_vector (filename, dname, dflags); + + /* Handle error cases. */ + if (temp_results == NULL) + goto memory_error; + else if (temp_results == (char **)&glob_error_return) + /* This filename is probably not a directory. Ignore it. */ + ; + else + { + char **array; + register unsigned int l; + + /* If we're expanding **, we don't need to glue the directory + name to the results; we've already done it in glob_vector */ + if ((dflags & GX_ALLDIRS) && filename[0] == '*' && filename[1] == '*' && (filename[2] == '\0' || filename[2] == '/')) + { + /* When do we remove null elements from temp_results? And + how to avoid duplicate elements in the final result? */ + /* If (dflags & GX_NULLDIR) glob_filename potentially left a + NULL placeholder in the temp results just in case + glob_vector/glob_dir_to_array did something with it, but + if it didn't, and we're not supposed to be passing them + through for some reason ((flags & GX_NULLDIR) == 0) we + need to remove all the NULL elements from the beginning + of TEMP_RESULTS. */ + /* If we have a null directory name and ** as the filename, + we have just searched for everything from the current + directory on down. Break now (shouldbreak = 1) to avoid + duplicate entries in the final result. */ +#define NULL_PLACEHOLDER(x) ((x) && *(x) && **(x) == 0) + if ((dflags & GX_NULLDIR) && (flags & GX_NULLDIR) == 0 && + NULL_PLACEHOLDER (temp_results)) +#undef NULL_PLACEHOLDER + { + register int i, n; + for (n = 0; temp_results[n] && *temp_results[n] == 0; n++) + ; + i = n; + do + temp_results[i - n] = temp_results[i]; + while (temp_results[i++] != 0); + array = temp_results; + shouldbreak = 1; + } + else + array = temp_results; + } + else + array = glob_dir_to_array (directories[i], temp_results, flags); + l = 0; + while (array[l] != NULL) + ++l; + + result = + (char **)realloc (result, (result_size + l) * sizeof (char *)); + + if (result == NULL) + goto memory_error; + + for (l = 0; array[l] != NULL; ++l) + result[result_size++ - 1] = array[l]; + + result[result_size - 1] = NULL; + + /* Note that the elements of ARRAY are not freed. */ + if (array != temp_results) + free ((char *) array); + else if ((dflags & GX_ALLDIRS) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0') + free (temp_results); /* expanding ** case above */ + + if (shouldbreak) + break; + } + } + /* Free the directories. */ + for (i = 0; directories[i]; i++) + free (directories[i]); + + free ((char *) directories); + + return (result); + } + +only_filename: + /* If there is only a directory name, return it. */ + if (*filename == '\0') + { + result = (char **) realloc ((char *) result, 2 * sizeof (char *)); + if (result == NULL) + return (NULL); + /* Handle GX_MARKDIRS here. */ + result[0] = (char *) malloc (directory_len + 1); + if (result[0] == NULL) + goto memory_error; + bcopy (directory_name, result[0], directory_len + 1); + if (free_dirname) + free (directory_name); + result[1] = NULL; + return (result); + } + else + { + char **temp_results; + + /* There are no unquoted globbing characters in DIRECTORY_NAME. + Dequote it before we try to open the directory since there may + be quoted globbing characters which should be treated verbatim. */ + if (directory_len > 0) + dequote_pathname (directory_name); + + /* We allocated a small array called RESULT, which we won't be using. + Free that memory now. */ + free (result); + + /* Just return what glob_vector () returns appended to the + directory name. */ + /* If flags & GX_ALLDIRS, we're called recursively */ + dflags = flags & ~GX_MARKDIRS; + if (directory_len == 0) + dflags |= GX_NULLDIR; + if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0') + { + dflags |= GX_ALLDIRS|GX_ADDCURDIR; +#if 0 + /* If we want all directories (dflags & GX_ALLDIRS) and we're not + being called recursively as something like `echo [star][star]/[star].o' + ((flags & GX_ALLDIRS) == 0), we want to prevent glob_vector from + adding a null directory name to the front of the temp_results + array. We turn off ADDCURDIR if not called recursively and + dlen == 0 */ +#endif + if (directory_len == 0 && (flags & GX_ALLDIRS) == 0) + dflags &= ~GX_ADDCURDIR; + } + temp_results = glob_vector (filename, + (directory_len == 0 ? "." : directory_name), + dflags); + + if (temp_results == NULL || temp_results == (char **)&glob_error_return) + { + if (free_dirname) + free (directory_name); + QUIT; /* XXX - shell */ + run_pending_traps (); + return (temp_results); + } + + result = glob_dir_to_array ((dflags & GX_ALLDIRS) ? "" : directory_name, temp_results, flags); + + if (free_dirname) + free (directory_name); + return (result); + } + + /* We get to memory_error if the program has run out of memory, or + if this is the shell, and we have been interrupted. */ + memory_error: + if (result != NULL) + { + register unsigned int i; + for (i = 0; result[i] != NULL; ++i) + free (result[i]); + free ((char *) result); + } + + if (free_dirname && directory_name) + free (directory_name); + + QUIT; + run_pending_traps (); + + return (NULL); +} + +#if defined (TEST) + +main (argc, argv) + int argc; + char **argv; +{ + unsigned int i; + + for (i = 1; i < argc; ++i) + { + char **value = glob_filename (argv[i], 0); + if (value == NULL) + puts ("Out of memory."); + else if (value == &glob_error_return) + perror (argv[i]); + else + for (i = 0; value[i] != NULL; i++) + puts (value[i]); + } + + exit (0); +} +#endif /* TEST. */ diff --git a/.pc/bash43-008.diff/lib/glob/gmisc.c b/.pc/bash43-008.diff/lib/glob/gmisc.c new file mode 100644 index 0000000..17e4265 --- /dev/null +++ b/.pc/bash43-008.diff/lib/glob/gmisc.c @@ -0,0 +1,376 @@ +/* gmisc.c -- miscellaneous pattern matching utility functions for Bash. + + Copyright (C) 2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne-Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include "bashtypes.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" +#include "shmbutil.h" + +#include "stdc.h" + +#ifndef LPAREN +# define LPAREN '(' +#endif +#ifndef RPAREN +# define RPAREN ')' +#endif + +#if defined (HANDLE_MULTIBYTE) +#define WLPAREN L'(' +#define WRPAREN L')' + +/* Return 1 of the first character of WSTRING could match the first + character of pattern WPAT. Wide character version. */ +int +match_pattern_wchar (wpat, wstring) + wchar_t *wpat, *wstring; +{ + wchar_t wc; + + if (*wstring == 0) + return (0); + + switch (wc = *wpat++) + { + default: + return (*wstring == wc); + case L'\\': + return (*wstring == *wpat); + case L'?': + return (*wpat == WLPAREN ? 1 : (*wstring != L'\0')); + case L'*': + return (1); + case L'+': + case L'!': + case L'@': + return (*wpat == WLPAREN ? 1 : (*wstring == wc)); + case L'[': + return (*wstring != L'\0'); + } +} + +int +wmatchlen (wpat, wmax) + wchar_t *wpat; + size_t wmax; +{ + wchar_t wc; + int matlen, bracklen, t, in_cclass, in_collsym, in_equiv; + + if (*wpat == 0) + return (0); + + matlen = in_cclass = in_collsym = in_equiv = 0; + while (wc = *wpat++) + { + switch (wc) + { + default: + matlen++; + break; + case L'\\': + if (*wpat == 0) + return ++matlen; + else + { + matlen++; + wpat++; + } + break; + case L'?': + if (*wpat == WLPAREN) + return (matlen = -1); /* XXX for now */ + else + matlen++; + break; + case L'*': + return (matlen = -1); + case L'+': + case L'!': + case L'@': + if (*wpat == WLPAREN) + return (matlen = -1); /* XXX for now */ + else + matlen++; + break; + case L'[': + /* scan for ending `]', skipping over embedded [:...:] */ + bracklen = 1; + wc = *wpat++; + do + { + if (wc == 0) + { + wpat--; /* back up to NUL */ + matlen += bracklen; + goto bad_bracket; + } + else if (wc == L'\\') + { + /* *wpat == backslash-escaped character */ + bracklen++; + /* If the backslash or backslash-escape ends the string, + bail. The ++wpat skips over the backslash escape */ + if (*wpat == 0 || *++wpat == 0) + { + matlen += bracklen; + goto bad_bracket; + } + } + else if (wc == L'[' && *wpat == L':') /* character class */ + { + wpat++; + bracklen++; + in_cclass = 1; + } + else if (in_cclass && wc == L':' && *wpat == L']') + { + wpat++; + bracklen++; + in_cclass = 0; + } + else if (wc == L'[' && *wpat == L'.') /* collating symbol */ + { + wpat++; + bracklen++; + if (*wpat == L']') /* right bracket can appear as collating symbol */ + { + wpat++; + bracklen++; + } + in_collsym = 1; + } + else if (in_collsym && wc == L'.' && *wpat == L']') + { + wpat++; + bracklen++; + in_collsym = 0; + } + else if (wc == L'[' && *wpat == L'=') /* equivalence class */ + { + wpat++; + bracklen++; + if (*wpat == L']') /* right bracket can appear as equivalence class */ + { + wpat++; + bracklen++; + } + in_equiv = 1; + } + else if (in_equiv && wc == L'=' && *wpat == L']') + { + wpat++; + bracklen++; + in_equiv = 0; + } + else + bracklen++; + } + while ((wc = *wpat++) != L']'); + matlen++; /* bracket expression can only match one char */ +bad_bracket: + break; + } + } + + return matlen; +} +#endif + +int +extglob_pattern_p (pat) + char *pat; +{ + switch (pat[0]) + { + case '*': + case '+': + case '!': + case '@': + return (pat[1] == LPAREN); + default: + return 0; + } + + return 0; +} + +/* Return 1 of the first character of STRING could match the first + character of pattern PAT. Used to avoid n2 calls to strmatch(). */ +int +match_pattern_char (pat, string) + char *pat, *string; +{ + char c; + + if (*string == 0) + return (0); + + switch (c = *pat++) + { + default: + return (*string == c); + case '\\': + return (*string == *pat); + case '?': + return (*pat == LPAREN ? 1 : (*string != '\0')); + case '*': + return (1); + case '+': + case '!': + case '@': + return (*pat == LPAREN ? 1 : (*string == c)); + case '[': + return (*string != '\0'); + } +} + +int +umatchlen (pat, max) + char *pat; + size_t max; +{ + char c; + int matlen, bracklen, t, in_cclass, in_collsym, in_equiv; + + if (*pat == 0) + return (0); + + matlen = in_cclass = in_collsym = in_equiv = 0; + while (c = *pat++) + { + switch (c) + { + default: + matlen++; + break; + case '\\': + if (*pat == 0) + return ++matlen; + else + { + matlen++; + pat++; + } + break; + case '?': + if (*pat == LPAREN) + return (matlen = -1); /* XXX for now */ + else + matlen++; + break; + case '*': + return (matlen = -1); + case '+': + case '!': + case '@': + if (*pat == LPAREN) + return (matlen = -1); /* XXX for now */ + else + matlen++; + break; + case '[': + /* scan for ending `]', skipping over embedded [:...:] */ + bracklen = 1; + c = *pat++; + do + { + if (c == 0) + { + pat--; /* back up to NUL */ + matlen += bracklen; + goto bad_bracket; + } + else if (c == '\\') + { + /* *pat == backslash-escaped character */ + bracklen++; + /* If the backslash or backslash-escape ends the string, + bail. The ++pat skips over the backslash escape */ + if (*pat == 0 || *++pat == 0) + { + matlen += bracklen; + goto bad_bracket; + } + } + else if (c == '[' && *pat == ':') /* character class */ + { + pat++; + bracklen++; + in_cclass = 1; + } + else if (in_cclass && c == ':' && *pat == ']') + { + pat++; + bracklen++; + in_cclass = 0; + } + else if (c == '[' && *pat == '.') /* collating symbol */ + { + pat++; + bracklen++; + if (*pat == ']') /* right bracket can appear as collating symbol */ + { + pat++; + bracklen++; + } + in_collsym = 1; + } + else if (in_collsym && c == '.' && *pat == ']') + { + pat++; + bracklen++; + in_collsym = 0; + } + else if (c == '[' && *pat == '=') /* equivalence class */ + { + pat++; + bracklen++; + if (*pat == ']') /* right bracket can appear as equivalence class */ + { + pat++; + bracklen++; + } + in_equiv = 1; + } + else if (in_equiv && c == '=' && *pat == ']') + { + pat++; + bracklen++; + in_equiv = 0; + } + else + bracklen++; + } + while ((c = *pat++) != ']'); + matlen++; /* bracket expression can only match one char */ +bad_bracket: + break; + } + } + + return matlen; +} diff --git a/.pc/bash43-008.diff/patchlevel.h b/.pc/bash43-008.diff/patchlevel.h new file mode 100644 index 0000000..fc8c97f --- /dev/null +++ b/.pc/bash43-008.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 7 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-009.diff/parse.y b/.pc/bash43-009.diff/parse.y new file mode 100644 index 0000000..83d5b9f --- /dev/null +++ b/.pc/bash43-009.diff/parse.y @@ -0,0 +1,6227 @@ +/* parse.y - Yacc grammar for bash. */ + +/* Copyright (C) 1989-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +%{ +#include "config.h" + +#include "bashtypes.h" +#include "bashansi.h" + +#include "filecntl.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (HAVE_LOCALE_H) +# include +#endif + +#include +#include "chartypes.h" +#include + +#include "memalloc.h" + +#include "bashintl.h" + +#define NEED_STRFTIME_DECL /* used in externs.h */ + +#include "shell.h" +#include "typemax.h" /* SIZE_MAX if needed */ +#include "trap.h" +#include "flags.h" +#include "parser.h" +#include "mailcheck.h" +#include "test.h" +#include "builtins.h" +#include "builtins/common.h" +#include "builtins/builtext.h" + +#include "shmbutil.h" + +#if defined (READLINE) +# include "bashline.h" +# include +#endif /* READLINE */ + +#if defined (HISTORY) +# include "bashhist.h" +# include +#endif /* HISTORY */ + +#if defined (JOB_CONTROL) +# include "jobs.h" +#endif /* JOB_CONTROL */ + +#if defined (ALIAS) +# include "alias.h" +#else +typedef void *alias_t; +#endif /* ALIAS */ + +#if defined (PROMPT_STRING_DECODE) +# ifndef _MINIX +# include +# endif +# include +# if defined (TM_IN_SYS_TIME) +# include +# include +# endif /* TM_IN_SYS_TIME */ +# include "maxpath.h" +#endif /* PROMPT_STRING_DECODE */ + +#define RE_READ_TOKEN -99 +#define NO_EXPANSION -100 + +#ifdef DEBUG +# define YYDEBUG 1 +#else +# define YYDEBUG 0 +#endif + +#if defined (HANDLE_MULTIBYTE) +# define last_shell_getc_is_singlebyte \ + ((shell_input_line_index > 1) \ + ? shell_input_line_property[shell_input_line_index - 1] \ + : 1) +# define MBTEST(x) ((x) && last_shell_getc_is_singlebyte) +#else +# define last_shell_getc_is_singlebyte 1 +# define MBTEST(x) ((x)) +#endif + +#if defined (EXTENDED_GLOB) +extern int extended_glob; +#endif + +extern int eof_encountered; +extern int no_line_editing, running_under_emacs; +extern int current_command_number; +extern int sourcelevel, parse_and_execute_level; +extern int posixly_correct; +extern int last_command_exit_value; +extern pid_t last_command_subst_pid; +extern char *shell_name, *current_host_name; +extern char *dist_version; +extern int patch_level; +extern int dump_translatable_strings, dump_po_strings; +extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin; +#if defined (BUFFERED_INPUT) +extern int bash_input_fd_changed; +#endif + +extern int errno; +/* **************************************************************** */ +/* */ +/* "Forward" declarations */ +/* */ +/* **************************************************************** */ + +#ifdef DEBUG +static void debug_parser __P((int)); +#endif + +static int yy_getc __P((void)); +static int yy_ungetc __P((int)); + +#if defined (READLINE) +static int yy_readline_get __P((void)); +static int yy_readline_unget __P((int)); +#endif + +static int yy_string_get __P((void)); +static int yy_string_unget __P((int)); +static void rewind_input_string __P((void)); +static int yy_stream_get __P((void)); +static int yy_stream_unget __P((int)); + +static int shell_getc __P((int)); +static void shell_ungetc __P((int)); +static void discard_until __P((int)); + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) +static void push_string __P((char *, int, alias_t *)); +static void pop_string __P((void)); +static void free_string_list __P((void)); +#endif + +static char *read_a_line __P((int)); + +static int reserved_word_acceptable __P((int)); +static int yylex __P((void)); +static int alias_expand_token __P((char *)); +static int time_command_acceptable __P((void)); +static int special_case_tokens __P((char *)); +static int read_token __P((int)); +static char *parse_matched_pair __P((int, int, int, int *, int)); +static char *parse_comsub __P((int, int, int, int *, int)); +#if defined (ARRAY_VARS) +static char *parse_compound_assignment __P((int *)); +#endif +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) +static int parse_dparen __P((int)); +static int parse_arith_cmd __P((char **, int)); +#endif +#if defined (COND_COMMAND) +static void cond_error __P((void)); +static COND_COM *cond_expr __P((void)); +static COND_COM *cond_or __P((void)); +static COND_COM *cond_and __P((void)); +static COND_COM *cond_term __P((void)); +static int cond_skip_newlines __P((void)); +static COMMAND *parse_cond_command __P((void)); +#endif +#if defined (ARRAY_VARS) +static int token_is_assignment __P((char *, int)); +static int token_is_ident __P((char *, int)); +#endif +static int read_token_word __P((int)); +static void discard_parser_constructs __P((int)); + +static char *error_token_from_token __P((int)); +static char *error_token_from_text __P((void)); +static void print_offending_line __P((void)); +static void report_syntax_error __P((char *)); + +static void handle_eof_input_unit __P((void)); +static void prompt_again __P((void)); +#if 0 +static void reset_readline_prompt __P((void)); +#endif +static void print_prompt __P((void)); + +#if defined (HANDLE_MULTIBYTE) +static void set_line_mbstate __P((void)); +static char *shell_input_line_property = NULL; +#else +# define set_line_mbstate() +#endif + +extern int yyerror __P((const char *)); + +#ifdef DEBUG +extern int yydebug; +#endif + +/* Default prompt strings */ +char *primary_prompt = PPROMPT; +char *secondary_prompt = SPROMPT; + +/* PROMPT_STRING_POINTER points to one of these, never to an actual string. */ +char *ps1_prompt, *ps2_prompt; + +/* Handle on the current prompt string. Indirectly points through + ps1_ or ps2_prompt. */ +char **prompt_string_pointer = (char **)NULL; +char *current_prompt_string; + +/* Non-zero means we expand aliases in commands. */ +int expand_aliases = 0; + +/* If non-zero, the decoded prompt string undergoes parameter and + variable substitution, command substitution, arithmetic substitution, + string expansion, process substitution, and quote removal in + decode_prompt_string. */ +int promptvars = 1; + +/* If non-zero, $'...' and $"..." are expanded when they appear within + a ${...} expansion, even when the expansion appears within double + quotes. */ +int extended_quote = 1; + +/* The number of lines read from input while creating the current command. */ +int current_command_line_count; + +/* The number of lines in a command saved while we run parse_and_execute */ +int saved_command_line_count; + +/* The token that currently denotes the end of parse. */ +int shell_eof_token; + +/* The token currently being read. */ +int current_token; + +/* The current parser state. */ +int parser_state; + +/* Variables to manage the task of reading here documents, because we need to + defer the reading until after a complete command has been collected. */ +static REDIRECT *redir_stack[10]; +int need_here_doc; + +/* Where shell input comes from. History expansion is performed on each + line when the shell is interactive. */ +static char *shell_input_line = (char *)NULL; +static size_t shell_input_line_index; +static size_t shell_input_line_size; /* Amount allocated for shell_input_line. */ +static size_t shell_input_line_len; /* strlen (shell_input_line) */ + +/* Either zero or EOF. */ +static int shell_input_line_terminator; + +/* The line number in a script on which a function definition starts. */ +static int function_dstart; + +/* The line number in a script on which a function body starts. */ +static int function_bstart; + +/* The line number in a script at which an arithmetic for command starts. */ +static int arith_for_lineno; + +/* The decoded prompt string. Used if READLINE is not defined or if + editing is turned off. Analogous to current_readline_prompt. */ +static char *current_decoded_prompt; + +/* The last read token, or NULL. read_token () uses this for context + checking. */ +static int last_read_token; + +/* The token read prior to last_read_token. */ +static int token_before_that; + +/* The token read prior to token_before_that. */ +static int two_tokens_ago; + +static int global_extglob; + +/* The line number in a script where the word in a `case WORD', `select WORD' + or `for WORD' begins. This is a nested command maximum, since the array + index is decremented after a case, select, or for command is parsed. */ +#define MAX_CASE_NEST 128 +static int word_lineno[MAX_CASE_NEST]; +static int word_top = -1; + +/* If non-zero, it is the token that we want read_token to return + regardless of what text is (or isn't) present to be read. This + is reset by read_token. If token_to_read == WORD or + ASSIGNMENT_WORD, yylval.word should be set to word_desc_to_read. */ +static int token_to_read; +static WORD_DESC *word_desc_to_read; + +static REDIRECTEE source; +static REDIRECTEE redir; +%} + +%union { + WORD_DESC *word; /* the word that we read. */ + int number; /* the number that we read. */ + WORD_LIST *word_list; + COMMAND *command; + REDIRECT *redirect; + ELEMENT element; + PATTERN_LIST *pattern; +} + +/* Reserved words. Members of the first group are only recognized + in the case that they are preceded by a list_terminator. Members + of the second group are for [[...]] commands. Members of the + third group are recognized only under special circumstances. */ +%token IF THEN ELSE ELIF FI CASE ESAC FOR SELECT WHILE UNTIL DO DONE FUNCTION COPROC +%token COND_START COND_END COND_ERROR +%token IN BANG TIME TIMEOPT TIMEIGN + +/* More general tokens. yylex () knows how to make these. */ +%token WORD ASSIGNMENT_WORD REDIR_WORD +%token NUMBER +%token ARITH_CMD ARITH_FOR_EXPRS +%token COND_CMD +%token AND_AND OR_OR GREATER_GREATER LESS_LESS LESS_AND LESS_LESS_LESS +%token GREATER_AND SEMI_SEMI SEMI_AND SEMI_SEMI_AND +%token LESS_LESS_MINUS AND_GREATER AND_GREATER_GREATER LESS_GREATER +%token GREATER_BAR BAR_AND + +/* The types that the various syntactical units return. */ + +%type inputunit command pipeline pipeline_command +%type list list0 list1 compound_list simple_list simple_list1 +%type simple_command shell_command +%type for_command select_command case_command group_command +%type arith_command +%type cond_command +%type arith_for_command +%type coproc +%type function_def function_body if_command elif_clause subshell +%type redirection redirection_list +%type simple_command_element +%type word_list pattern +%type pattern_list case_clause_sequence case_clause +%type timespec +%type list_terminator + +%start inputunit + +%left '&' ';' '\n' yacc_EOF +%left AND_AND OR_OR +%right '|' BAR_AND +%% + +inputunit: simple_list simple_list_terminator + { + /* Case of regular command. Discard the error + safety net,and return the command just parsed. */ + global_command = $1; + eof_encountered = 0; + /* discard_parser_constructs (0); */ + if (parser_state & PST_CMDSUBST) + parser_state |= PST_EOFTOKEN; + YYACCEPT; + } + | '\n' + { + /* Case of regular command, but not a very + interesting one. Return a NULL command. */ + global_command = (COMMAND *)NULL; + if (parser_state & PST_CMDSUBST) + parser_state |= PST_EOFTOKEN; + YYACCEPT; + } + | error '\n' + { + /* Error during parsing. Return NULL command. */ + global_command = (COMMAND *)NULL; + eof_encountered = 0; + /* discard_parser_constructs (1); */ + if (interactive && parse_and_execute_level == 0) + { + YYACCEPT; + } + else + { + YYABORT; + } + } + | yacc_EOF + { + /* Case of EOF seen by itself. Do ignoreeof or + not. */ + global_command = (COMMAND *)NULL; + handle_eof_input_unit (); + YYACCEPT; + } + ; + +word_list: WORD + { $$ = make_word_list ($1, (WORD_LIST *)NULL); } + | word_list WORD + { $$ = make_word_list ($2, $1); } + ; + +redirection: '>' WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_output_direction, redir, 0); + } + | '<' WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_input_direction, redir, 0); + } + | NUMBER '>' WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_output_direction, redir, 0); + } + | NUMBER '<' WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_input_direction, redir, 0); + } + | REDIR_WORD '>' WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_output_direction, redir, REDIR_VARASSIGN); + } + | REDIR_WORD '<' WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_input_direction, redir, REDIR_VARASSIGN); + } + | GREATER_GREATER WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_appending_to, redir, 0); + } + | NUMBER GREATER_GREATER WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_appending_to, redir, 0); + } + | REDIR_WORD GREATER_GREATER WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_appending_to, redir, REDIR_VARASSIGN); + } + | GREATER_BAR WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_output_force, redir, 0); + } + | NUMBER GREATER_BAR WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_output_force, redir, 0); + } + | REDIR_WORD GREATER_BAR WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_output_force, redir, REDIR_VARASSIGN); + } + | LESS_GREATER WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_input_output, redir, 0); + } + | NUMBER LESS_GREATER WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_input_output, redir, 0); + } + | REDIR_WORD LESS_GREATER WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_input_output, redir, REDIR_VARASSIGN); + } + | LESS_LESS WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_reading_until, redir, 0); + redir_stack[need_here_doc++] = $$; + } + | NUMBER LESS_LESS WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_reading_until, redir, 0); + redir_stack[need_here_doc++] = $$; + } + | REDIR_WORD LESS_LESS WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN); + redir_stack[need_here_doc++] = $$; + } + | LESS_LESS_MINUS WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_deblank_reading_until, redir, 0); + redir_stack[need_here_doc++] = $$; + } + | NUMBER LESS_LESS_MINUS WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_deblank_reading_until, redir, 0); + redir_stack[need_here_doc++] = $$; + } + | REDIR_WORD LESS_LESS_MINUS WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN); + redir_stack[need_here_doc++] = $$; + } + | LESS_LESS_LESS WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_reading_string, redir, 0); + } + | NUMBER LESS_LESS_LESS WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_reading_string, redir, 0); + } + | REDIR_WORD LESS_LESS_LESS WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_reading_string, redir, REDIR_VARASSIGN); + } + | LESS_AND NUMBER + { + source.dest = 0; + redir.dest = $2; + $$ = make_redirection (source, r_duplicating_input, redir, 0); + } + | NUMBER LESS_AND NUMBER + { + source.dest = $1; + redir.dest = $3; + $$ = make_redirection (source, r_duplicating_input, redir, 0); + } + | REDIR_WORD LESS_AND NUMBER + { + source.filename = $1; + redir.dest = $3; + $$ = make_redirection (source, r_duplicating_input, redir, REDIR_VARASSIGN); + } + | GREATER_AND NUMBER + { + source.dest = 1; + redir.dest = $2; + $$ = make_redirection (source, r_duplicating_output, redir, 0); + } + | NUMBER GREATER_AND NUMBER + { + source.dest = $1; + redir.dest = $3; + $$ = make_redirection (source, r_duplicating_output, redir, 0); + } + | REDIR_WORD GREATER_AND NUMBER + { + source.filename = $1; + redir.dest = $3; + $$ = make_redirection (source, r_duplicating_output, redir, REDIR_VARASSIGN); + } + | LESS_AND WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_duplicating_input_word, redir, 0); + } + | NUMBER LESS_AND WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_duplicating_input_word, redir, 0); + } + | REDIR_WORD LESS_AND WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_duplicating_input_word, redir, REDIR_VARASSIGN); + } + | GREATER_AND WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_duplicating_output_word, redir, 0); + } + | NUMBER GREATER_AND WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_duplicating_output_word, redir, 0); + } + | REDIR_WORD GREATER_AND WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_duplicating_output_word, redir, REDIR_VARASSIGN); + } + | GREATER_AND '-' + { + source.dest = 1; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, 0); + } + | NUMBER GREATER_AND '-' + { + source.dest = $1; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, 0); + } + | REDIR_WORD GREATER_AND '-' + { + source.filename = $1; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, REDIR_VARASSIGN); + } + | LESS_AND '-' + { + source.dest = 0; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, 0); + } + | NUMBER LESS_AND '-' + { + source.dest = $1; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, 0); + } + | REDIR_WORD LESS_AND '-' + { + source.filename = $1; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, REDIR_VARASSIGN); + } + | AND_GREATER WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_err_and_out, redir, 0); + } + | AND_GREATER_GREATER WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_append_err_and_out, redir, 0); + } + ; + +simple_command_element: WORD + { $$.word = $1; $$.redirect = 0; } + | ASSIGNMENT_WORD + { $$.word = $1; $$.redirect = 0; } + | redirection + { $$.redirect = $1; $$.word = 0; } + ; + +redirection_list: redirection + { + $$ = $1; + } + | redirection_list redirection + { + register REDIRECT *t; + + for (t = $1; t->next; t = t->next) + ; + t->next = $2; + $$ = $1; + } + ; + +simple_command: simple_command_element + { $$ = make_simple_command ($1, (COMMAND *)NULL); } + | simple_command simple_command_element + { $$ = make_simple_command ($2, $1); } + ; + +command: simple_command + { $$ = clean_simple_command ($1); } + | shell_command + { $$ = $1; } + | shell_command redirection_list + { + COMMAND *tc; + + tc = $1; + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = $2; + } + else + tc->redirects = $2; + $$ = $1; + } + | function_def + { $$ = $1; } + | coproc + { $$ = $1; } + ; + +shell_command: for_command + { $$ = $1; } + | case_command + { $$ = $1; } + | WHILE compound_list DO compound_list DONE + { $$ = make_while_command ($2, $4); } + | UNTIL compound_list DO compound_list DONE + { $$ = make_until_command ($2, $4); } + | select_command + { $$ = $1; } + | if_command + { $$ = $1; } + | subshell + { $$ = $1; } + | group_command + { $$ = $1; } + | arith_command + { $$ = $1; } + | cond_command + { $$ = $1; } + | arith_for_command + { $$ = $1; } + ; + +for_command: FOR WORD newline_list DO compound_list DONE + { + $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD newline_list '{' compound_list '}' + { + $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD ';' newline_list DO compound_list DONE + { + $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD ';' newline_list '{' compound_list '}' + { + $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD newline_list IN word_list list_terminator newline_list DO compound_list DONE + { + $$ = make_for_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD newline_list IN word_list list_terminator newline_list '{' compound_list '}' + { + $$ = make_for_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD newline_list IN list_terminator newline_list DO compound_list DONE + { + $$ = make_for_command ($2, (WORD_LIST *)NULL, $8, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD newline_list IN list_terminator newline_list '{' compound_list '}' + { + $$ = make_for_command ($2, (WORD_LIST *)NULL, $8, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + ; + +arith_for_command: FOR ARITH_FOR_EXPRS list_terminator newline_list DO compound_list DONE + { + $$ = make_arith_for_command ($2, $6, arith_for_lineno); + if (word_top > 0) word_top--; + } + | FOR ARITH_FOR_EXPRS list_terminator newline_list '{' compound_list '}' + { + $$ = make_arith_for_command ($2, $6, arith_for_lineno); + if (word_top > 0) word_top--; + } + | FOR ARITH_FOR_EXPRS DO compound_list DONE + { + $$ = make_arith_for_command ($2, $4, arith_for_lineno); + if (word_top > 0) word_top--; + } + | FOR ARITH_FOR_EXPRS '{' compound_list '}' + { + $$ = make_arith_for_command ($2, $4, arith_for_lineno); + if (word_top > 0) word_top--; + } + ; + +select_command: SELECT WORD newline_list DO list DONE + { + $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | SELECT WORD newline_list '{' list '}' + { + $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | SELECT WORD ';' newline_list DO list DONE + { + $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | SELECT WORD ';' newline_list '{' list '}' + { + $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | SELECT WORD newline_list IN word_list list_terminator newline_list DO list DONE + { + $$ = make_select_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | SELECT WORD newline_list IN word_list list_terminator newline_list '{' list '}' + { + $$ = make_select_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + ; + +case_command: CASE WORD newline_list IN newline_list ESAC + { + $$ = make_case_command ($2, (PATTERN_LIST *)NULL, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | CASE WORD newline_list IN case_clause_sequence newline_list ESAC + { + $$ = make_case_command ($2, $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | CASE WORD newline_list IN case_clause ESAC + { + $$ = make_case_command ($2, $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + ; + +function_def: WORD '(' ')' newline_list function_body + { $$ = make_function_def ($1, $5, function_dstart, function_bstart); } + + | FUNCTION WORD '(' ')' newline_list function_body + { $$ = make_function_def ($2, $6, function_dstart, function_bstart); } + + | FUNCTION WORD newline_list function_body + { $$ = make_function_def ($2, $4, function_dstart, function_bstart); } + ; + +function_body: shell_command + { $$ = $1; } + | shell_command redirection_list + { + COMMAND *tc; + + tc = $1; + /* According to Posix.2 3.9.5, redirections + specified after the body of a function should + be attached to the function and performed when + the function is executed, not as part of the + function definition command. */ + /* XXX - I don't think it matters, but we might + want to change this in the future to avoid + problems differentiating between a function + definition with a redirection and a function + definition containing a single command with a + redirection. The two are semantically equivalent, + though -- the only difference is in how the + command printing code displays the redirections. */ + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = $2; + } + else + tc->redirects = $2; + $$ = $1; + } + ; + +subshell: '(' compound_list ')' + { + $$ = make_subshell_command ($2); + $$->flags |= CMD_WANT_SUBSHELL; + } + ; + +coproc: COPROC shell_command + { + $$ = make_coproc_command ("COPROC", $2); + $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + | COPROC shell_command redirection_list + { + COMMAND *tc; + + tc = $2; + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = $3; + } + else + tc->redirects = $3; + $$ = make_coproc_command ("COPROC", $2); + $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + | COPROC WORD shell_command + { + $$ = make_coproc_command ($2->word, $3); + $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + | COPROC WORD shell_command redirection_list + { + COMMAND *tc; + + tc = $3; + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = $4; + } + else + tc->redirects = $4; + $$ = make_coproc_command ($2->word, $3); + $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + | COPROC simple_command + { + $$ = make_coproc_command ("COPROC", clean_simple_command ($2)); + $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + ; + +if_command: IF compound_list THEN compound_list FI + { $$ = make_if_command ($2, $4, (COMMAND *)NULL); } + | IF compound_list THEN compound_list ELSE compound_list FI + { $$ = make_if_command ($2, $4, $6); } + | IF compound_list THEN compound_list elif_clause FI + { $$ = make_if_command ($2, $4, $5); } + ; + + +group_command: '{' compound_list '}' + { $$ = make_group_command ($2); } + ; + +arith_command: ARITH_CMD + { $$ = make_arith_command ($1); } + ; + +cond_command: COND_START COND_CMD COND_END + { $$ = $2; } + ; + +elif_clause: ELIF compound_list THEN compound_list + { $$ = make_if_command ($2, $4, (COMMAND *)NULL); } + | ELIF compound_list THEN compound_list ELSE compound_list + { $$ = make_if_command ($2, $4, $6); } + | ELIF compound_list THEN compound_list elif_clause + { $$ = make_if_command ($2, $4, $5); } + ; + +case_clause: pattern_list + | case_clause_sequence pattern_list + { $2->next = $1; $$ = $2; } + ; + +pattern_list: newline_list pattern ')' compound_list + { $$ = make_pattern_list ($2, $4); } + | newline_list pattern ')' newline_list + { $$ = make_pattern_list ($2, (COMMAND *)NULL); } + | newline_list '(' pattern ')' compound_list + { $$ = make_pattern_list ($3, $5); } + | newline_list '(' pattern ')' newline_list + { $$ = make_pattern_list ($3, (COMMAND *)NULL); } + ; + +case_clause_sequence: pattern_list SEMI_SEMI + { $$ = $1; } + | case_clause_sequence pattern_list SEMI_SEMI + { $2->next = $1; $$ = $2; } + | pattern_list SEMI_AND + { $1->flags |= CASEPAT_FALLTHROUGH; $$ = $1; } + | case_clause_sequence pattern_list SEMI_AND + { $2->flags |= CASEPAT_FALLTHROUGH; $2->next = $1; $$ = $2; } + | pattern_list SEMI_SEMI_AND + { $1->flags |= CASEPAT_TESTNEXT; $$ = $1; } + | case_clause_sequence pattern_list SEMI_SEMI_AND + { $2->flags |= CASEPAT_TESTNEXT; $2->next = $1; $$ = $2; } + ; + +pattern: WORD + { $$ = make_word_list ($1, (WORD_LIST *)NULL); } + | pattern '|' WORD + { $$ = make_word_list ($3, $1); } + ; + +/* A list allows leading or trailing newlines and + newlines as operators (equivalent to semicolons). + It must end with a newline or semicolon. + Lists are used within commands such as if, for, while. */ + +list: newline_list list0 + { + $$ = $2; + if (need_here_doc) + gather_here_documents (); + } + ; + +compound_list: list + | newline_list list1 + { + $$ = $2; + } + ; + +list0: list1 '\n' newline_list + | list1 '&' newline_list + { + if ($1->type == cm_connection) + $$ = connect_async_list ($1, (COMMAND *)NULL, '&'); + else + $$ = command_connect ($1, (COMMAND *)NULL, '&'); + } + | list1 ';' newline_list + + ; + +list1: list1 AND_AND newline_list list1 + { $$ = command_connect ($1, $4, AND_AND); } + | list1 OR_OR newline_list list1 + { $$ = command_connect ($1, $4, OR_OR); } + | list1 '&' newline_list list1 + { + if ($1->type == cm_connection) + $$ = connect_async_list ($1, $4, '&'); + else + $$ = command_connect ($1, $4, '&'); + } + | list1 ';' newline_list list1 + { $$ = command_connect ($1, $4, ';'); } + | list1 '\n' newline_list list1 + { $$ = command_connect ($1, $4, ';'); } + | pipeline_command + { $$ = $1; } + ; + +simple_list_terminator: '\n' + | yacc_EOF + ; + +list_terminator:'\n' + { $$ = '\n'; } + | ';' + { $$ = ';'; } + | yacc_EOF + { $$ = yacc_EOF; } + ; + +newline_list: + | newline_list '\n' + ; + +/* A simple_list is a list that contains no significant newlines + and no leading or trailing newlines. Newlines are allowed + only following operators, where they are not significant. + + This is what an inputunit consists of. */ + +simple_list: simple_list1 + { + $$ = $1; + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = $1; + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + | simple_list1 '&' + { + if ($1->type == cm_connection) + $$ = connect_async_list ($1, (COMMAND *)NULL, '&'); + else + $$ = command_connect ($1, (COMMAND *)NULL, '&'); + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = $1; + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + | simple_list1 ';' + { + $$ = $1; + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = $1; + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + ; + +simple_list1: simple_list1 AND_AND newline_list simple_list1 + { $$ = command_connect ($1, $4, AND_AND); } + | simple_list1 OR_OR newline_list simple_list1 + { $$ = command_connect ($1, $4, OR_OR); } + | simple_list1 '&' simple_list1 + { + if ($1->type == cm_connection) + $$ = connect_async_list ($1, $3, '&'); + else + $$ = command_connect ($1, $3, '&'); + } + | simple_list1 ';' simple_list1 + { $$ = command_connect ($1, $3, ';'); } + + | pipeline_command + { $$ = $1; } + ; + +pipeline_command: pipeline + { $$ = $1; } + | BANG pipeline_command + { + if ($2) + $2->flags ^= CMD_INVERT_RETURN; /* toggle */ + $$ = $2; + } + | timespec pipeline_command + { + if ($2) + $2->flags |= $1; + $$ = $2; + } + | timespec list_terminator + { + ELEMENT x; + + /* Boy, this is unclean. `time' by itself can + time a null command. We cheat and push a + newline back if the list_terminator was a newline + to avoid the double-newline problem (one to + terminate this, one to terminate the command) */ + x.word = 0; + x.redirect = 0; + $$ = make_simple_command (x, (COMMAND *)NULL); + $$->flags |= $1; + /* XXX - let's cheat and push a newline back */ + if ($2 == '\n') + token_to_read = '\n'; + } + | BANG list_terminator + { + ELEMENT x; + + /* This is just as unclean. Posix says that `!' + by itself should be equivalent to `false'. + We cheat and push a + newline back if the list_terminator was a newline + to avoid the double-newline problem (one to + terminate this, one to terminate the command) */ + x.word = 0; + x.redirect = 0; + $$ = make_simple_command (x, (COMMAND *)NULL); + $$->flags |= CMD_INVERT_RETURN; + /* XXX - let's cheat and push a newline back */ + if ($2 == '\n') + token_to_read = '\n'; + } + ; + +pipeline: pipeline '|' newline_list pipeline + { $$ = command_connect ($1, $4, '|'); } + | pipeline BAR_AND newline_list pipeline + { + /* Make cmd1 |& cmd2 equivalent to cmd1 2>&1 | cmd2 */ + COMMAND *tc; + REDIRECTEE rd, sd; + REDIRECT *r; + + tc = $1->type == cm_simple ? (COMMAND *)$1->value.Simple : $1; + sd.dest = 2; + rd.dest = 1; + r = make_redirection (sd, r_duplicating_output, rd, 0); + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = r; + } + else + tc->redirects = r; + + $$ = command_connect ($1, $4, '|'); + } + | command + { $$ = $1; } + ; + +timespec: TIME + { $$ = CMD_TIME_PIPELINE; } + | TIME TIMEOPT + { $$ = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } + | TIME TIMEOPT TIMEIGN + { $$ = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } + ; +%% + +/* Initial size to allocate for tokens, and the + amount to grow them by. */ +#define TOKEN_DEFAULT_INITIAL_SIZE 496 +#define TOKEN_DEFAULT_GROW_SIZE 512 + +/* Should we call prompt_again? */ +#define SHOULD_PROMPT() \ + (interactive && (bash_input.type == st_stdin || bash_input.type == st_stream)) + +#if defined (ALIAS) +# define expanding_alias() (pushed_string_list && pushed_string_list->expander) +#else +# define expanding_alias() 0 +#endif + +/* Global var is non-zero when end of file has been reached. */ +int EOF_Reached = 0; + +#ifdef DEBUG +static void +debug_parser (i) + int i; +{ +#if YYDEBUG != 0 + yydebug = i; +#endif +} +#endif + +/* yy_getc () returns the next available character from input or EOF. + yy_ungetc (c) makes `c' the next character to read. + init_yy_io (get, unget, type, location) makes the function GET the + installed function for getting the next character, makes UNGET the + installed function for un-getting a character, sets the type of stream + (either string or file) from TYPE, and makes LOCATION point to where + the input is coming from. */ + +/* Unconditionally returns end-of-file. */ +int +return_EOF () +{ + return (EOF); +} + +/* Variable containing the current get and unget functions. + See ./input.h for a clearer description. */ +BASH_INPUT bash_input; + +/* Set all of the fields in BASH_INPUT to NULL. Free bash_input.name if it + is non-null, avoiding a memory leak. */ +void +initialize_bash_input () +{ + bash_input.type = st_none; + FREE (bash_input.name); + bash_input.name = (char *)NULL; + bash_input.location.file = (FILE *)NULL; + bash_input.location.string = (char *)NULL; + bash_input.getter = (sh_cget_func_t *)NULL; + bash_input.ungetter = (sh_cunget_func_t *)NULL; +} + +/* Set the contents of the current bash input stream from + GET, UNGET, TYPE, NAME, and LOCATION. */ +void +init_yy_io (get, unget, type, name, location) + sh_cget_func_t *get; + sh_cunget_func_t *unget; + enum stream_type type; + const char *name; + INPUT_STREAM location; +{ + bash_input.type = type; + FREE (bash_input.name); + bash_input.name = name ? savestring (name) : (char *)NULL; + + /* XXX */ +#if defined (CRAY) + memcpy((char *)&bash_input.location.string, (char *)&location.string, sizeof(location)); +#else + bash_input.location = location; +#endif + bash_input.getter = get; + bash_input.ungetter = unget; +} + +char * +yy_input_name () +{ + return (bash_input.name ? bash_input.name : "stdin"); +} + +/* Call this to get the next character of input. */ +static int +yy_getc () +{ + return (*(bash_input.getter)) (); +} + +/* Call this to unget C. That is, to make C the next character + to be read. */ +static int +yy_ungetc (c) + int c; +{ + return (*(bash_input.ungetter)) (c); +} + +#if defined (BUFFERED_INPUT) +#ifdef INCLUDE_UNUSED +int +input_file_descriptor () +{ + switch (bash_input.type) + { + case st_stream: + return (fileno (bash_input.location.file)); + case st_bstream: + return (bash_input.location.buffered_fd); + case st_stdin: + default: + return (fileno (stdin)); + } +} +#endif +#endif /* BUFFERED_INPUT */ + +/* **************************************************************** */ +/* */ +/* Let input be read from readline (). */ +/* */ +/* **************************************************************** */ + +#if defined (READLINE) +char *current_readline_prompt = (char *)NULL; +char *current_readline_line = (char *)NULL; +int current_readline_line_index = 0; + +static int +yy_readline_get () +{ + SigHandler *old_sigint; + int line_len; + unsigned char c; + + if (!current_readline_line) + { + if (!bash_readline_initialized) + initialize_readline (); + +#if defined (JOB_CONTROL) + if (job_control) + give_terminal_to (shell_pgrp, 0); +#endif /* JOB_CONTROL */ + + old_sigint = (SigHandler *)IMPOSSIBLE_TRAP_HANDLER; + if (signal_is_ignored (SIGINT) == 0) + { + /* interrupt_immediately++; */ + old_sigint = (SigHandler *)set_signal_handler (SIGINT, sigint_sighandler); + } + + current_readline_line = readline (current_readline_prompt ? + current_readline_prompt : ""); + + CHECK_TERMSIG; + if (signal_is_ignored (SIGINT) == 0) + { + /* interrupt_immediately--; */ + if (old_sigint != IMPOSSIBLE_TRAP_HANDLER) + set_signal_handler (SIGINT, old_sigint); + } + +#if 0 + /* Reset the prompt to the decoded value of prompt_string_pointer. */ + reset_readline_prompt (); +#endif + + if (current_readline_line == 0) + return (EOF); + + current_readline_line_index = 0; + line_len = strlen (current_readline_line); + + current_readline_line = (char *)xrealloc (current_readline_line, 2 + line_len); + current_readline_line[line_len++] = '\n'; + current_readline_line[line_len] = '\0'; + } + + if (current_readline_line[current_readline_line_index] == 0) + { + free (current_readline_line); + current_readline_line = (char *)NULL; + return (yy_readline_get ()); + } + else + { + c = current_readline_line[current_readline_line_index++]; + return (c); + } +} + +static int +yy_readline_unget (c) + int c; +{ + if (current_readline_line_index && current_readline_line) + current_readline_line[--current_readline_line_index] = c; + return (c); +} + +void +with_input_from_stdin () +{ + INPUT_STREAM location; + + if (bash_input.type != st_stdin && stream_on_stack (st_stdin) == 0) + { + location.string = current_readline_line; + init_yy_io (yy_readline_get, yy_readline_unget, + st_stdin, "readline stdin", location); + } +} + +#else /* !READLINE */ + +void +with_input_from_stdin () +{ + with_input_from_stream (stdin, "stdin"); +} +#endif /* !READLINE */ + +/* **************************************************************** */ +/* */ +/* Let input come from STRING. STRING is zero terminated. */ +/* */ +/* **************************************************************** */ + +static int +yy_string_get () +{ + register char *string; + register unsigned char c; + + string = bash_input.location.string; + + /* If the string doesn't exist, or is empty, EOF found. */ + if (string && *string) + { + c = *string++; + bash_input.location.string = string; + return (c); + } + else + return (EOF); +} + +static int +yy_string_unget (c) + int c; +{ + *(--bash_input.location.string) = c; + return (c); +} + +void +with_input_from_string (string, name) + char *string; + const char *name; +{ + INPUT_STREAM location; + + location.string = string; + init_yy_io (yy_string_get, yy_string_unget, st_string, name, location); +} + +/* Count the number of characters we've consumed from bash_input.location.string + and read into shell_input_line, but have not returned from shell_getc. + That is the true input location. Rewind bash_input.location.string by + that number of characters, so it points to the last character actually + consumed by the parser. */ +static void +rewind_input_string () +{ + int xchars; + + /* number of unconsumed characters in the input -- XXX need to take newlines + into account, e.g., $(...\n) */ + xchars = shell_input_line_len - shell_input_line_index; + if (bash_input.location.string[-1] == '\n') + xchars++; + + /* XXX - how to reflect bash_input.location.string back to string passed to + parse_and_execute or xparse_dolparen? xparse_dolparen needs to know how + far into the string we parsed. parse_and_execute knows where bash_input. + location.string is, and how far from orig_string that is -- that's the + number of characters the command consumed. */ + + /* bash_input.location.string - xchars should be where we parsed to */ + /* need to do more validation on xchars value for sanity -- test cases. */ + bash_input.location.string -= xchars; +} + +/* **************************************************************** */ +/* */ +/* Let input come from STREAM. */ +/* */ +/* **************************************************************** */ + +/* These two functions used to test the value of the HAVE_RESTARTABLE_SYSCALLS + define, and just use getc/ungetc if it was defined, but since bash + installs its signal handlers without the SA_RESTART flag, some signals + (like SIGCHLD, SIGWINCH, etc.) received during a read(2) will not cause + the read to be restarted. We need to restart it ourselves. */ + +static int +yy_stream_get () +{ + int result; + + result = EOF; + if (bash_input.location.file) + { +#if 0 + if (interactive) + interrupt_immediately++; +#endif + + /* XXX - don't need terminate_immediately; getc_with_restart checks + for terminating signals itself if read returns < 0 */ + result = getc_with_restart (bash_input.location.file); + +#if 0 + if (interactive) + interrupt_immediately--; +#endif + } + return (result); +} + +static int +yy_stream_unget (c) + int c; +{ + return (ungetc_with_restart (c, bash_input.location.file)); +} + +void +with_input_from_stream (stream, name) + FILE *stream; + const char *name; +{ + INPUT_STREAM location; + + location.file = stream; + init_yy_io (yy_stream_get, yy_stream_unget, st_stream, name, location); +} + +typedef struct stream_saver { + struct stream_saver *next; + BASH_INPUT bash_input; + int line; +#if defined (BUFFERED_INPUT) + BUFFERED_STREAM *bstream; +#endif /* BUFFERED_INPUT */ +} STREAM_SAVER; + +/* The globally known line number. */ +int line_number = 0; + +/* The line number offset set by assigning to LINENO. Not currently used. */ +int line_number_base = 0; + +#if defined (COND_COMMAND) +static int cond_lineno; +static int cond_token; +#endif + +STREAM_SAVER *stream_list = (STREAM_SAVER *)NULL; + +void +push_stream (reset_lineno) + int reset_lineno; +{ + STREAM_SAVER *saver = (STREAM_SAVER *)xmalloc (sizeof (STREAM_SAVER)); + + xbcopy ((char *)&bash_input, (char *)&(saver->bash_input), sizeof (BASH_INPUT)); + +#if defined (BUFFERED_INPUT) + saver->bstream = (BUFFERED_STREAM *)NULL; + /* If we have a buffered stream, clear out buffers[fd]. */ + if (bash_input.type == st_bstream && bash_input.location.buffered_fd >= 0) + saver->bstream = set_buffered_stream (bash_input.location.buffered_fd, + (BUFFERED_STREAM *)NULL); +#endif /* BUFFERED_INPUT */ + + saver->line = line_number; + bash_input.name = (char *)NULL; + saver->next = stream_list; + stream_list = saver; + EOF_Reached = 0; + if (reset_lineno) + line_number = 0; +} + +void +pop_stream () +{ + if (!stream_list) + EOF_Reached = 1; + else + { + STREAM_SAVER *saver = stream_list; + + EOF_Reached = 0; + stream_list = stream_list->next; + + init_yy_io (saver->bash_input.getter, + saver->bash_input.ungetter, + saver->bash_input.type, + saver->bash_input.name, + saver->bash_input.location); + +#if defined (BUFFERED_INPUT) + /* If we have a buffered stream, restore buffers[fd]. */ + /* If the input file descriptor was changed while this was on the + save stack, update the buffered fd to the new file descriptor and + re-establish the buffer <-> bash_input fd correspondence. */ + if (bash_input.type == st_bstream && bash_input.location.buffered_fd >= 0) + { + if (bash_input_fd_changed) + { + bash_input_fd_changed = 0; + if (default_buffered_input >= 0) + { + bash_input.location.buffered_fd = default_buffered_input; + saver->bstream->b_fd = default_buffered_input; + SET_CLOSE_ON_EXEC (default_buffered_input); + } + } + /* XXX could free buffered stream returned as result here. */ + set_buffered_stream (bash_input.location.buffered_fd, saver->bstream); + } +#endif /* BUFFERED_INPUT */ + + line_number = saver->line; + + FREE (saver->bash_input.name); + free (saver); + } +} + +/* Return 1 if a stream of type TYPE is saved on the stack. */ +int +stream_on_stack (type) + enum stream_type type; +{ + register STREAM_SAVER *s; + + for (s = stream_list; s; s = s->next) + if (s->bash_input.type == type) + return 1; + return 0; +} + +/* Save the current token state and return it in a malloced array. */ +int * +save_token_state () +{ + int *ret; + + ret = (int *)xmalloc (4 * sizeof (int)); + ret[0] = last_read_token; + ret[1] = token_before_that; + ret[2] = two_tokens_ago; + ret[3] = current_token; + return ret; +} + +void +restore_token_state (ts) + int *ts; +{ + if (ts == 0) + return; + last_read_token = ts[0]; + token_before_that = ts[1]; + two_tokens_ago = ts[2]; + current_token = ts[3]; +} + +/* + * This is used to inhibit alias expansion and reserved word recognition + * inside case statement pattern lists. A `case statement pattern list' is: + * + * everything between the `in' in a `case word in' and the next ')' + * or `esac' + * everything between a `;;' and the next `)' or `esac' + */ + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + +#define END_OF_ALIAS 0 + +/* + * Pseudo-global variables used in implementing token-wise alias expansion. + */ + +/* + * Pushing and popping strings. This works together with shell_getc to + * implement alias expansion on a per-token basis. + */ + +#define PSH_ALIAS 0x01 +#define PSH_DPAREN 0x02 +#define PSH_SOURCE 0x04 + +typedef struct string_saver { + struct string_saver *next; + int expand_alias; /* Value to set expand_alias to when string is popped. */ + char *saved_line; +#if defined (ALIAS) + alias_t *expander; /* alias that caused this line to be pushed. */ +#endif + size_t saved_line_size, saved_line_index; + int saved_line_terminator; + int flags; +} STRING_SAVER; + +STRING_SAVER *pushed_string_list = (STRING_SAVER *)NULL; + +/* + * Push the current shell_input_line onto a stack of such lines and make S + * the current input. Used when expanding aliases. EXPAND is used to set + * the value of expand_next_token when the string is popped, so that the + * word after the alias in the original line is handled correctly when the + * alias expands to multiple words. TOKEN is the token that was expanded + * into S; it is saved and used to prevent infinite recursive expansion. + */ +static void +push_string (s, expand, ap) + char *s; + int expand; + alias_t *ap; +{ + STRING_SAVER *temp = (STRING_SAVER *)xmalloc (sizeof (STRING_SAVER)); + + temp->expand_alias = expand; + temp->saved_line = shell_input_line; + temp->saved_line_size = shell_input_line_size; + temp->saved_line_index = shell_input_line_index; + temp->saved_line_terminator = shell_input_line_terminator; + temp->flags = 0; +#if defined (ALIAS) + temp->expander = ap; + if (ap) + temp->flags = PSH_ALIAS; +#endif + temp->next = pushed_string_list; + pushed_string_list = temp; + +#if defined (ALIAS) + if (ap) + ap->flags |= AL_BEINGEXPANDED; +#endif + + shell_input_line = s; + shell_input_line_size = STRLEN (s); + shell_input_line_index = 0; + shell_input_line_terminator = '\0'; +#if 0 + parser_state &= ~PST_ALEXPNEXT; /* XXX */ +#endif + + set_line_mbstate (); +} + +/* + * Make the top of the pushed_string stack be the current shell input. + * Only called when there is something on the stack. Called from shell_getc + * when it thinks it has consumed the string generated by an alias expansion + * and needs to return to the original input line. + */ +static void +pop_string () +{ + STRING_SAVER *t; + + FREE (shell_input_line); + shell_input_line = pushed_string_list->saved_line; + shell_input_line_index = pushed_string_list->saved_line_index; + shell_input_line_size = pushed_string_list->saved_line_size; + shell_input_line_terminator = pushed_string_list->saved_line_terminator; + + if (pushed_string_list->expand_alias) + parser_state |= PST_ALEXPNEXT; + else + parser_state &= ~PST_ALEXPNEXT; + + t = pushed_string_list; + pushed_string_list = pushed_string_list->next; + +#if defined (ALIAS) + if (t->expander) + t->expander->flags &= ~AL_BEINGEXPANDED; +#endif + + free ((char *)t); + + set_line_mbstate (); +} + +static void +free_string_list () +{ + register STRING_SAVER *t, *t1; + + for (t = pushed_string_list; t; ) + { + t1 = t->next; + FREE (t->saved_line); +#if defined (ALIAS) + if (t->expander) + t->expander->flags &= ~AL_BEINGEXPANDED; +#endif + free ((char *)t); + t = t1; + } + pushed_string_list = (STRING_SAVER *)NULL; +} + +#endif /* ALIAS || DPAREN_ARITHMETIC */ + +void +free_pushed_string_input () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + free_string_list (); +#endif +} + +int +parser_expanding_alias () +{ + return (expanding_alias ()); +} + +void +parser_save_alias () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + push_string ((char *)NULL, 0, (alias_t *)NULL); + pushed_string_list->flags = PSH_SOURCE; /* XXX - for now */ +#else + ; +#endif +} + +void +parser_restore_alias () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + if (pushed_string_list) + pop_string (); +#else + ; +#endif +} + +/* Return a line of text, taken from wherever yylex () reads input. + If there is no more input, then we return NULL. If REMOVE_QUOTED_NEWLINE + is non-zero, we remove unquoted \ pairs. This is used by + read_secondary_line to read here documents. */ +static char * +read_a_line (remove_quoted_newline) + int remove_quoted_newline; +{ + static char *line_buffer = (char *)NULL; + static int buffer_size = 0; + int indx, c, peekc, pass_next; + +#if defined (READLINE) + if (no_line_editing && SHOULD_PROMPT ()) +#else + if (SHOULD_PROMPT ()) +#endif + print_prompt (); + + pass_next = indx = 0; + while (1) + { + /* Allow immediate exit if interrupted during input. */ + QUIT; + + c = yy_getc (); + + /* Ignore null bytes in input. */ + if (c == 0) + { +#if 0 + internal_warning ("read_a_line: ignored null byte in input"); +#endif + continue; + } + + /* If there is no more input, then we return NULL. */ + if (c == EOF) + { + if (interactive && bash_input.type == st_stream) + clearerr (stdin); + if (indx == 0) + return ((char *)NULL); + c = '\n'; + } + + /* `+2' in case the final character in the buffer is a newline. */ + RESIZE_MALLOCED_BUFFER (line_buffer, indx, 2, buffer_size, 128); + + /* IF REMOVE_QUOTED_NEWLINES is non-zero, we are reading a + here document with an unquoted delimiter. In this case, + the line will be expanded as if it were in double quotes. + We allow a backslash to escape the next character, but we + need to treat the backslash specially only if a backslash + quoting a backslash-newline pair appears in the line. */ + if (pass_next) + { + line_buffer[indx++] = c; + pass_next = 0; + } + else if (c == '\\' && remove_quoted_newline) + { + QUIT; + peekc = yy_getc (); + if (peekc == '\n') + { + line_number++; + continue; /* Make the unquoted \ pair disappear. */ + } + else + { + yy_ungetc (peekc); + pass_next = 1; + line_buffer[indx++] = c; /* Preserve the backslash. */ + } + } + else + line_buffer[indx++] = c; + + if (c == '\n') + { + line_buffer[indx] = '\0'; + return (line_buffer); + } + } +} + +/* Return a line as in read_a_line (), but insure that the prompt is + the secondary prompt. This is used to read the lines of a here + document. REMOVE_QUOTED_NEWLINE is non-zero if we should remove + newlines quoted with backslashes while reading the line. It is + non-zero unless the delimiter of the here document was quoted. */ +char * +read_secondary_line (remove_quoted_newline) + int remove_quoted_newline; +{ + char *ret; + int n, c; + + prompt_string_pointer = &ps2_prompt; + if (SHOULD_PROMPT()) + prompt_again (); + ret = read_a_line (remove_quoted_newline); +#if defined (HISTORY) + if (ret && remember_on_history && (parser_state & PST_HEREDOC)) + { + /* To make adding the the here-document body right, we need to rely + on history_delimiting_chars() returning \n for the first line of + the here-document body and the null string for the second and + subsequent lines, so we avoid double newlines. + current_command_line_count == 2 for the first line of the body. */ + + current_command_line_count++; + maybe_add_history (ret); + } +#endif /* HISTORY */ + return ret; +} + +/* **************************************************************** */ +/* */ +/* YYLEX () */ +/* */ +/* **************************************************************** */ + +/* Reserved words. These are only recognized as the first word of a + command. */ +STRING_INT_ALIST word_token_alist[] = { + { "if", IF }, + { "then", THEN }, + { "else", ELSE }, + { "elif", ELIF }, + { "fi", FI }, + { "case", CASE }, + { "esac", ESAC }, + { "for", FOR }, +#if defined (SELECT_COMMAND) + { "select", SELECT }, +#endif + { "while", WHILE }, + { "until", UNTIL }, + { "do", DO }, + { "done", DONE }, + { "in", IN }, + { "function", FUNCTION }, +#if defined (COMMAND_TIMING) + { "time", TIME }, +#endif + { "{", '{' }, + { "}", '}' }, + { "!", BANG }, +#if defined (COND_COMMAND) + { "[[", COND_START }, + { "]]", COND_END }, +#endif +#if defined (COPROCESS_SUPPORT) + { "coproc", COPROC }, +#endif + { (char *)NULL, 0} +}; + +/* other tokens that can be returned by read_token() */ +STRING_INT_ALIST other_token_alist[] = { + /* Multiple-character tokens with special values */ + { "--", TIMEIGN }, + { "-p", TIMEOPT }, + { "&&", AND_AND }, + { "||", OR_OR }, + { ">>", GREATER_GREATER }, + { "<<", LESS_LESS }, + { "<&", LESS_AND }, + { ">&", GREATER_AND }, + { ";;", SEMI_SEMI }, + { ";&", SEMI_AND }, + { ";;&", SEMI_SEMI_AND }, + { "<<-", LESS_LESS_MINUS }, + { "<<<", LESS_LESS_LESS }, + { "&>", AND_GREATER }, + { "&>>", AND_GREATER_GREATER }, + { "<>", LESS_GREATER }, + { ">|", GREATER_BAR }, + { "|&", BAR_AND }, + { "EOF", yacc_EOF }, + /* Tokens whose value is the character itself */ + { ">", '>' }, + { "<", '<' }, + { "-", '-' }, + { "{", '{' }, + { "}", '}' }, + { ";", ';' }, + { "(", '(' }, + { ")", ')' }, + { "|", '|' }, + { "&", '&' }, + { "newline", '\n' }, + { (char *)NULL, 0} +}; + +/* others not listed here: + WORD look at yylval.word + ASSIGNMENT_WORD look at yylval.word + NUMBER look at yylval.number + ARITH_CMD look at yylval.word_list + ARITH_FOR_EXPRS look at yylval.word_list + COND_CMD look at yylval.command +*/ + +/* These are used by read_token_word, but appear up here so that shell_getc + can use them to decide when to add otherwise blank lines to the history. */ + +/* The primary delimiter stack. */ +struct dstack dstack = { (char *)NULL, 0, 0 }; + +/* A temporary delimiter stack to be used when decoding prompt strings. + This is needed because command substitutions in prompt strings (e.g., PS2) + can screw up the parser's quoting state. */ +static struct dstack temp_dstack = { (char *)NULL, 0, 0 }; + +/* Macro for accessing the top delimiter on the stack. Returns the + delimiter or zero if none. */ +#define current_delimiter(ds) \ + (ds.delimiter_depth ? ds.delimiters[ds.delimiter_depth - 1] : 0) + +#define push_delimiter(ds, character) \ + do \ + { \ + if (ds.delimiter_depth + 2 > ds.delimiter_space) \ + ds.delimiters = (char *)xrealloc \ + (ds.delimiters, (ds.delimiter_space += 10) * sizeof (char)); \ + ds.delimiters[ds.delimiter_depth] = character; \ + ds.delimiter_depth++; \ + } \ + while (0) + +#define pop_delimiter(ds) ds.delimiter_depth-- + +/* Return the next shell input character. This always reads characters + from shell_input_line; when that line is exhausted, it is time to + read the next line. This is called by read_token when the shell is + processing normal command input. */ + +/* This implements one-character lookahead/lookbehind across physical input + lines, to avoid something being lost because it's pushed back with + shell_ungetc when we're at the start of a line. */ +static int eol_ungetc_lookahead = 0; + +static int +shell_getc (remove_quoted_newline) + int remove_quoted_newline; +{ + register int i; + int c, truncating; + unsigned char uc; + + QUIT; + + if (sigwinch_received) + { + sigwinch_received = 0; + get_new_window_size (0, (int *)0, (int *)0); + } + + if (eol_ungetc_lookahead) + { + c = eol_ungetc_lookahead; + eol_ungetc_lookahead = 0; + return (c); + } + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* If shell_input_line[shell_input_line_index] == 0, but there is + something on the pushed list of strings, then we don't want to go + off and get another line. We let the code down below handle it. */ + + if (!shell_input_line || ((!shell_input_line[shell_input_line_index]) && + (pushed_string_list == (STRING_SAVER *)NULL))) +#else /* !ALIAS && !DPAREN_ARITHMETIC */ + if (!shell_input_line || !shell_input_line[shell_input_line_index]) +#endif /* !ALIAS && !DPAREN_ARITHMETIC */ + { + line_number++; + + /* Let's not let one really really long line blow up memory allocation */ + if (shell_input_line && shell_input_line_size >= 32768) + { + free (shell_input_line); + shell_input_line = 0; + shell_input_line_size = 0; + } + + restart_read: + + /* Allow immediate exit if interrupted during input. */ + QUIT; + + i = truncating = 0; + shell_input_line_terminator = 0; + + /* If the shell is interatctive, but not currently printing a prompt + (interactive_shell && interactive == 0), we don't want to print + notifies or cleanup the jobs -- we want to defer it until we do + print the next prompt. */ + if (interactive_shell == 0 || SHOULD_PROMPT()) + { +#if defined (JOB_CONTROL) + /* This can cause a problem when reading a command as the result + of a trap, when the trap is called from flush_child. This call + had better not cause jobs to disappear from the job table in + that case, or we will have big trouble. */ + notify_and_cleanup (); +#else /* !JOB_CONTROL */ + cleanup_dead_jobs (); +#endif /* !JOB_CONTROL */ + } + +#if defined (READLINE) + if (no_line_editing && SHOULD_PROMPT()) +#else + if (SHOULD_PROMPT()) +#endif + print_prompt (); + + if (bash_input.type == st_stream) + clearerr (stdin); + + while (1) + { + c = yy_getc (); + + /* Allow immediate exit if interrupted during input. */ + QUIT; + + if (c == '\0') + { +#if 0 + internal_warning ("shell_getc: ignored null byte in input"); +#endif + continue; + } + + /* Theoretical overflow */ + /* If we can't put 256 bytes more into the buffer, allocate + everything we can and fill it as full as we can. */ + /* XXX - we ignore rest of line using `truncating' flag */ + if (shell_input_line_size > (SIZE_MAX - 256)) + { + size_t n; + + n = SIZE_MAX - i; /* how much more can we put into the buffer? */ + if (n <= 2) /* we have to save 1 for the newline added below */ + { + if (truncating == 0) + internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%llu): line truncated", shell_input_line_size, SIZE_MAX); + shell_input_line[i] = '\0'; + truncating = 1; + } + if (shell_input_line_size < SIZE_MAX) + { + shell_input_line_size = SIZE_MAX; + shell_input_line = xrealloc (shell_input_line, shell_input_line_size); + } + } + else + RESIZE_MALLOCED_BUFFER (shell_input_line, i, 2, shell_input_line_size, 256); + + if (c == EOF) + { + if (bash_input.type == st_stream) + clearerr (stdin); + + if (i == 0) + shell_input_line_terminator = EOF; + + shell_input_line[i] = '\0'; + break; + } + + if (truncating == 0 || c == '\n') + shell_input_line[i++] = c; + + if (c == '\n') + { + shell_input_line[--i] = '\0'; + current_command_line_count++; + break; + } + } + + shell_input_line_index = 0; + shell_input_line_len = i; /* == strlen (shell_input_line) */ + + set_line_mbstate (); + +#if defined (HISTORY) + if (remember_on_history && shell_input_line && shell_input_line[0]) + { + char *expansions; +# if defined (BANG_HISTORY) + int old_hist; + + /* If the current delimiter is a single quote, we should not be + performing history expansion, even if we're on a different + line from the original single quote. */ + old_hist = history_expansion_inhibited; + if (current_delimiter (dstack) == '\'') + history_expansion_inhibited = 1; +# endif + expansions = pre_process_line (shell_input_line, 1, 1); +# if defined (BANG_HISTORY) + history_expansion_inhibited = old_hist; +# endif + if (expansions != shell_input_line) + { + free (shell_input_line); + shell_input_line = expansions; + shell_input_line_len = shell_input_line ? + strlen (shell_input_line) : 0; + if (shell_input_line_len == 0) + current_command_line_count--; + + /* We have to force the xrealloc below because we don't know + the true allocated size of shell_input_line anymore. */ + shell_input_line_size = shell_input_line_len; + + set_line_mbstate (); + } + } + /* Try to do something intelligent with blank lines encountered while + entering multi-line commands. XXX - this is grotesque */ + else if (remember_on_history && shell_input_line && + shell_input_line[0] == '\0' && + current_command_line_count > 1) + { + if (current_delimiter (dstack)) + /* We know shell_input_line[0] == 0 and we're reading some sort of + quoted string. This means we've got a line consisting of only + a newline in a quoted string. We want to make sure this line + gets added to the history. */ + maybe_add_history (shell_input_line); + else + { + char *hdcs; + hdcs = history_delimiting_chars (shell_input_line); + if (hdcs && hdcs[0] == ';') + maybe_add_history (shell_input_line); + } + } + +#endif /* HISTORY */ + + if (shell_input_line) + { + /* Lines that signify the end of the shell's input should not be + echoed. We should not echo lines while parsing command + substitutions with recursive calls into the parsing engine; those + should only be echoed once when we read the word. That is the + reason for the test against shell_eof_token, which is set to a + right paren when parsing the contents of command substitutions. */ + if (echo_input_at_read && (shell_input_line[0] || + shell_input_line_terminator != EOF) && + shell_eof_token == 0) + fprintf (stderr, "%s\n", shell_input_line); + } + else + { + shell_input_line_size = 0; + prompt_string_pointer = ¤t_prompt_string; + if (SHOULD_PROMPT ()) + prompt_again (); + goto restart_read; + } + + /* Add the newline to the end of this string, iff the string does + not already end in an EOF character. */ + if (shell_input_line_terminator != EOF) + { + if (shell_input_line_size < SIZE_MAX && shell_input_line_len > shell_input_line_size - 3) + shell_input_line = (char *)xrealloc (shell_input_line, + 1 + (shell_input_line_size += 2)); + + shell_input_line[shell_input_line_len] = '\n'; + shell_input_line[shell_input_line_len + 1] = '\0'; + + set_line_mbstate (); + } + } + +next_alias_char: + uc = shell_input_line[shell_input_line_index]; + + if (uc) + shell_input_line_index++; + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* If UC is NULL, we have reached the end of the current input string. If + pushed_string_list is non-empty, it's time to pop to the previous string + because we have fully consumed the result of the last alias expansion. + Do it transparently; just return the next character of the string popped + to. */ + /* If pushed_string_list != 0 but pushed_string_list->expander == 0 (not + currently tested) and the flags value is not PSH_SOURCE, we are not + parsing an alias, we have just saved one (push_string, when called by + the parse_dparen code) In this case, just go on as well. The PSH_SOURCE + case is handled below. */ +pop_alias: + if (uc == 0 && pushed_string_list && pushed_string_list->flags != PSH_SOURCE) + { + pop_string (); + uc = shell_input_line[shell_input_line_index]; + if (uc) + shell_input_line_index++; + } +#endif /* ALIAS || DPAREN_ARITHMETIC */ + + if MBTEST(uc == '\\' && remove_quoted_newline && shell_input_line[shell_input_line_index] == '\n') + { + if (SHOULD_PROMPT ()) + prompt_again (); + line_number++; + /* What do we do here if we're expanding an alias whose definition + includes an escaped newline? If that's the last character in the + alias expansion, we just pop the pushed string list (recall that + we inhibit the appending of a space in mk_alexpansion() if newline + is the last character). If it's not the last character, we need + to consume the quoted newline and move to the next character in + the expansion. */ +#if defined (ALIAS) + if (expanding_alias () && shell_input_line[shell_input_line_index+1] == '\0') + { + uc = 0; + goto pop_alias; + } + else if (expanding_alias () && shell_input_line[shell_input_line_index+1] != '\0') + { + shell_input_line_index++; /* skip newline */ + goto next_alias_char; /* and get next character */ + } + else +#endif + goto restart_read; + } + + if (uc == 0 && shell_input_line_terminator == EOF) + return ((shell_input_line_index != 0) ? '\n' : EOF); + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* We already know that we are not parsing an alias expansion because of the + check for expanding_alias() above. This knows how parse_and_execute + handles switching to st_string input while an alias is being expanded, + hence the check for pushed_string_list without pushed_string_list->expander + and the check for PSH_SOURCE as pushed_string_list->flags. + parse_and_execute and parse_string both change the input type to st_string + and place the string to be parsed and executed into location.string, so + we should not stop reading that until the pointer is '\0'. + The check for shell_input_line_terminator may be superfluous. + + This solves the problem of `.' inside a multi-line alias with embedded + newlines executing things out of order. */ + if (uc == 0 && bash_input.type == st_string && *bash_input.location.string && + pushed_string_list && pushed_string_list->flags == PSH_SOURCE && + shell_input_line_terminator == 0) + { + shell_input_line_index = 0; + goto restart_read; + } +#endif + + return (uc); +} + +/* Put C back into the input for the shell. This might need changes for + HANDLE_MULTIBYTE around EOLs. Since we (currently) never push back a + character different than we read, shell_input_line_property doesn't need + to change when manipulating shell_input_line. The define for + last_shell_getc_is_singlebyte should take care of it, though. */ +static void +shell_ungetc (c) + int c; +{ + if (shell_input_line && shell_input_line_index) + shell_input_line[--shell_input_line_index] = c; + else + eol_ungetc_lookahead = c; +} + +#ifdef INCLUDE_UNUSED +/* Back the input pointer up by one, effectively `ungetting' a character. */ +static void +shell_ungetchar () +{ + if (shell_input_line && shell_input_line_index) + shell_input_line_index--; +} +#endif + +/* Discard input until CHARACTER is seen, then push that character back + onto the input stream. */ +static void +discard_until (character) + int character; +{ + int c; + + while ((c = shell_getc (0)) != EOF && c != character) + ; + + if (c != EOF) + shell_ungetc (c); +} + +void +execute_variable_command (command, vname) + char *command, *vname; +{ + char *last_lastarg; + sh_parser_state_t ps; + + save_parser_state (&ps); + last_lastarg = get_string_value ("_"); + if (last_lastarg) + last_lastarg = savestring (last_lastarg); + + parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEVAL_NOHIST); + + restore_parser_state (&ps); + bind_variable ("_", last_lastarg, 0); + FREE (last_lastarg); + + if (token_to_read == '\n') /* reset_parser was called */ + token_to_read = 0; +} + +/* Place to remember the token. We try to keep the buffer + at a reasonable size, but it can grow. */ +static char *token = (char *)NULL; + +/* Current size of the token buffer. */ +static int token_buffer_size; + +/* Command to read_token () explaining what we want it to do. */ +#define READ 0 +#define RESET 1 +#define prompt_is_ps1 \ + (!prompt_string_pointer || prompt_string_pointer == &ps1_prompt) + +/* Function for yyparse to call. yylex keeps track of + the last two tokens read, and calls read_token. */ +static int +yylex () +{ + if (interactive && (current_token == 0 || current_token == '\n')) + { + /* Before we print a prompt, we might have to check mailboxes. + We do this only if it is time to do so. Notice that only here + is the mail alarm reset; nothing takes place in check_mail () + except the checking of mail. Please don't change this. */ + if (prompt_is_ps1 && parse_and_execute_level == 0 && time_to_check_mail ()) + { + check_mail (); + reset_mail_timer (); + } + + /* Avoid printing a prompt if we're not going to read anything, e.g. + after resetting the parser with read_token (RESET). */ + if (token_to_read == 0 && SHOULD_PROMPT ()) + prompt_again (); + } + + two_tokens_ago = token_before_that; + token_before_that = last_read_token; + last_read_token = current_token; + current_token = read_token (READ); + + if ((parser_state & PST_EOFTOKEN) && current_token == shell_eof_token) + { + current_token = yacc_EOF; + if (bash_input.type == st_string) + rewind_input_string (); + } + parser_state &= ~PST_EOFTOKEN; + + return (current_token); +} + +/* When non-zero, we have read the required tokens + which allow ESAC to be the next one read. */ +static int esacs_needed_count; + +void +gather_here_documents () +{ + int r; + + r = 0; + while (need_here_doc) + { + parser_state |= PST_HEREDOC; + make_here_document (redir_stack[r++], line_number); + parser_state &= ~PST_HEREDOC; + need_here_doc--; + } +} + +/* When non-zero, an open-brace used to create a group is awaiting a close + brace partner. */ +static int open_brace_count; + +#define command_token_position(token) \ + (((token) == ASSIGNMENT_WORD) || (parser_state&PST_REDIRLIST) || \ + ((token) != SEMI_SEMI && (token) != SEMI_AND && (token) != SEMI_SEMI_AND && reserved_word_acceptable(token))) + +#define assignment_acceptable(token) \ + (command_token_position(token) && ((parser_state & PST_CASEPAT) == 0)) + +/* Check to see if TOKEN is a reserved word and return the token + value if it is. */ +#define CHECK_FOR_RESERVED_WORD(tok) \ + do { \ + if (!dollar_present && !quoted && \ + reserved_word_acceptable (last_read_token)) \ + { \ + int i; \ + for (i = 0; word_token_alist[i].word != (char *)NULL; i++) \ + if (STREQ (tok, word_token_alist[i].word)) \ + { \ + if ((parser_state & PST_CASEPAT) && (word_token_alist[i].token != ESAC)) \ + break; \ + if (word_token_alist[i].token == TIME && time_command_acceptable () == 0) \ + break; \ + if (word_token_alist[i].token == ESAC) \ + parser_state &= ~(PST_CASEPAT|PST_CASESTMT); \ + else if (word_token_alist[i].token == CASE) \ + parser_state |= PST_CASESTMT; \ + else if (word_token_alist[i].token == COND_END) \ + parser_state &= ~(PST_CONDCMD|PST_CONDEXPR); \ + else if (word_token_alist[i].token == COND_START) \ + parser_state |= PST_CONDCMD; \ + else if (word_token_alist[i].token == '{') \ + open_brace_count++; \ + else if (word_token_alist[i].token == '}' && open_brace_count) \ + open_brace_count--; \ + return (word_token_alist[i].token); \ + } \ + } \ + } while (0) + +#if defined (ALIAS) + + /* OK, we have a token. Let's try to alias expand it, if (and only if) + it's eligible. + + It is eligible for expansion if EXPAND_ALIASES is set, and + the token is unquoted and the last token read was a command + separator (or expand_next_token is set), and we are currently + processing an alias (pushed_string_list is non-empty) and this + token is not the same as the current or any previously + processed alias. + + Special cases that disqualify: + In a pattern list in a case statement (parser_state & PST_CASEPAT). */ + +static char * +mk_alexpansion (s) + char *s; +{ + int l; + char *r; + + l = strlen (s); + r = xmalloc (l + 2); + strcpy (r, s); + /* If the last character in the alias is a newline, don't add a trailing + space to the expansion. Works with shell_getc above. */ + if (r[l - 1] != ' ' && r[l - 1] != '\n') + r[l++] = ' '; + r[l] = '\0'; + return r; +} + +static int +alias_expand_token (tokstr) + char *tokstr; +{ + char *expanded; + alias_t *ap; + + if (((parser_state & PST_ALEXPNEXT) || command_token_position (last_read_token)) && + (parser_state & PST_CASEPAT) == 0) + { + ap = find_alias (tokstr); + + /* Currently expanding this token. */ + if (ap && (ap->flags & AL_BEINGEXPANDED)) + return (NO_EXPANSION); + + /* mk_alexpansion puts an extra space on the end of the alias expansion, + so the lookahead by the parser works right. If this gets changed, + make sure the code in shell_getc that deals with reaching the end of + an expanded alias is changed with it. */ + expanded = ap ? mk_alexpansion (ap->value) : (char *)NULL; + + if (expanded) + { + push_string (expanded, ap->flags & AL_EXPANDNEXT, ap); + return (RE_READ_TOKEN); + } + else + /* This is an eligible token that does not have an expansion. */ + return (NO_EXPANSION); + } + return (NO_EXPANSION); +} +#endif /* ALIAS */ + +static int +time_command_acceptable () +{ +#if defined (COMMAND_TIMING) + int i; + + if (posixly_correct && shell_compatibility_level > 41) + { + /* Quick check of the rest of the line to find the next token. If it + begins with a `-', Posix says to not return `time' as the token. + This was interp 267. */ + i = shell_input_line_index; + while (i < shell_input_line_len && (shell_input_line[i] == ' ' || shell_input_line[i] == '\t')) + i++; + if (shell_input_line[i] == '-') + return 0; + } + + switch (last_read_token) + { + case 0: + case ';': + case '\n': + case AND_AND: + case OR_OR: + case '&': + case DO: + case THEN: + case ELSE: + case '{': /* } */ + case '(': /* ) */ + case BANG: /* ! time pipeline */ + case TIME: /* time time pipeline */ + case TIMEOPT: /* time -p time pipeline */ + case TIMEIGN: /* time -p -- ... */ + return 1; + default: + return 0; + } +#else + return 0; +#endif /* COMMAND_TIMING */ +} + +/* Handle special cases of token recognition: + IN is recognized if the last token was WORD and the token + before that was FOR or CASE or SELECT. + + DO is recognized if the last token was WORD and the token + before that was FOR or SELECT. + + ESAC is recognized if the last token caused `esacs_needed_count' + to be set + + `{' is recognized if the last token as WORD and the token + before that was FUNCTION, or if we just parsed an arithmetic + `for' command. + + `}' is recognized if there is an unclosed `{' present. + + `-p' is returned as TIMEOPT if the last read token was TIME. + `--' is returned as TIMEIGN if the last read token was TIMEOPT. + + ']]' is returned as COND_END if the parser is currently parsing + a conditional expression ((parser_state & PST_CONDEXPR) != 0) + + `time' is returned as TIME if and only if it is immediately + preceded by one of `;', `\n', `||', `&&', or `&'. +*/ + +static int +special_case_tokens (tokstr) + char *tokstr; +{ + if ((last_read_token == WORD) && +#if defined (SELECT_COMMAND) + ((token_before_that == FOR) || (token_before_that == CASE) || (token_before_that == SELECT)) && +#else + ((token_before_that == FOR) || (token_before_that == CASE)) && +#endif + (tokstr[0] == 'i' && tokstr[1] == 'n' && tokstr[2] == 0)) + { + if (token_before_that == CASE) + { + parser_state |= PST_CASEPAT; + esacs_needed_count++; + } + return (IN); + } + + if (last_read_token == WORD && +#if defined (SELECT_COMMAND) + (token_before_that == FOR || token_before_that == SELECT) && +#else + (token_before_that == FOR) && +#endif + (tokstr[0] == 'd' && tokstr[1] == 'o' && tokstr[2] == '\0')) + return (DO); + + /* Ditto for ESAC in the CASE case. + Specifically, this handles "case word in esac", which is a legal + construct, certainly because someone will pass an empty arg to the + case construct, and we don't want it to barf. Of course, we should + insist that the case construct has at least one pattern in it, but + the designers disagree. */ + if (esacs_needed_count) + { + esacs_needed_count--; + if (STREQ (tokstr, "esac")) + { + parser_state &= ~PST_CASEPAT; + return (ESAC); + } + } + + /* The start of a shell function definition. */ + if (parser_state & PST_ALLOWOPNBRC) + { + parser_state &= ~PST_ALLOWOPNBRC; + if (tokstr[0] == '{' && tokstr[1] == '\0') /* } */ + { + open_brace_count++; + function_bstart = line_number; + return ('{'); /* } */ + } + } + + /* We allow a `do' after a for ((...)) without an intervening + list_terminator */ + if (last_read_token == ARITH_FOR_EXPRS && tokstr[0] == 'd' && tokstr[1] == 'o' && !tokstr[2]) + return (DO); + if (last_read_token == ARITH_FOR_EXPRS && tokstr[0] == '{' && tokstr[1] == '\0') /* } */ + { + open_brace_count++; + return ('{'); /* } */ + } + + if (open_brace_count && reserved_word_acceptable (last_read_token) && tokstr[0] == '}' && !tokstr[1]) + { + open_brace_count--; /* { */ + return ('}'); + } + +#if defined (COMMAND_TIMING) + /* Handle -p after `time'. */ + if (last_read_token == TIME && tokstr[0] == '-' && tokstr[1] == 'p' && !tokstr[2]) + return (TIMEOPT); + /* Handle -- after `time -p'. */ + if (last_read_token == TIMEOPT && tokstr[0] == '-' && tokstr[1] == '-' && !tokstr[2]) + return (TIMEIGN); +#endif + +#if defined (COND_COMMAND) /* [[ */ + if ((parser_state & PST_CONDEXPR) && tokstr[0] == ']' && tokstr[1] == ']' && tokstr[2] == '\0') + return (COND_END); +#endif + + return (-1); +} + +/* Called from shell.c when Control-C is typed at top level. Or + by the error rule at top level. */ +void +reset_parser () +{ + dstack.delimiter_depth = 0; /* No delimiters found so far. */ + open_brace_count = 0; + +#if defined (EXTENDED_GLOB) + /* Reset to global value of extended glob */ + if (parser_state & PST_EXTPAT) + extended_glob = global_extglob; +#endif + + parser_state = 0; + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + if (pushed_string_list) + free_string_list (); +#endif /* ALIAS || DPAREN_ARITHMETIC */ + + if (shell_input_line) + { + free (shell_input_line); + shell_input_line = (char *)NULL; + shell_input_line_size = shell_input_line_index = 0; + } + + FREE (word_desc_to_read); + word_desc_to_read = (WORD_DESC *)NULL; + + current_token = '\n'; /* XXX */ + last_read_token = '\n'; + token_to_read = '\n'; +} + +/* Read the next token. Command can be READ (normal operation) or + RESET (to normalize state). */ +static int +read_token (command) + int command; +{ + int character; /* Current character. */ + int peek_char; /* Temporary look-ahead character. */ + int result; /* The thing to return. */ + + if (command == RESET) + { + reset_parser (); + return ('\n'); + } + + if (token_to_read) + { + result = token_to_read; + if (token_to_read == WORD || token_to_read == ASSIGNMENT_WORD) + { + yylval.word = word_desc_to_read; + word_desc_to_read = (WORD_DESC *)NULL; + } + token_to_read = 0; + return (result); + } + +#if defined (COND_COMMAND) + if ((parser_state & (PST_CONDCMD|PST_CONDEXPR)) == PST_CONDCMD) + { + cond_lineno = line_number; + parser_state |= PST_CONDEXPR; + yylval.command = parse_cond_command (); + if (cond_token != COND_END) + { + cond_error (); + return (-1); + } + token_to_read = COND_END; + parser_state &= ~(PST_CONDEXPR|PST_CONDCMD); + return (COND_CMD); + } +#endif + +#if defined (ALIAS) + /* This is a place to jump back to once we have successfully expanded a + token with an alias and pushed the string with push_string () */ + re_read_token: +#endif /* ALIAS */ + + /* Read a single word from input. Start by skipping blanks. */ + while ((character = shell_getc (1)) != EOF && shellblank (character)) + ; + + if (character == EOF) + { + EOF_Reached = 1; + return (yacc_EOF); + } + + if MBTEST(character == '#' && (!interactive || interactive_comments)) + { + /* A comment. Discard until EOL or EOF, and then return a newline. */ + discard_until ('\n'); + shell_getc (0); + character = '\n'; /* this will take the next if statement and return. */ + } + + if (character == '\n') + { + /* If we're about to return an unquoted newline, we can go and collect + the text of any pending here document. */ + if (need_here_doc) + gather_here_documents (); + +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + parser_state &= ~PST_ASSIGNOK; + + return (character); + } + + if (parser_state & PST_REGEXP) + goto tokword; + + /* Shell meta-characters. */ + if MBTEST(shellmeta (character) && ((parser_state & PST_DBLPAREN) == 0)) + { +#if defined (ALIAS) + /* Turn off alias tokenization iff this character sequence would + not leave us ready to read a command. */ + if (character == '<' || character == '>') + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + parser_state &= ~PST_ASSIGNOK; + + peek_char = shell_getc (1); + if (character == peek_char) + { + switch (character) + { + case '<': + /* If '<' then we could be at "<<" or at "<<-". We have to + look ahead one more character. */ + peek_char = shell_getc (1); + if MBTEST(peek_char == '-') + return (LESS_LESS_MINUS); + else if MBTEST(peek_char == '<') + return (LESS_LESS_LESS); + else + { + shell_ungetc (peek_char); + return (LESS_LESS); + } + + case '>': + return (GREATER_GREATER); + + case ';': + parser_state |= PST_CASEPAT; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + peek_char = shell_getc (1); + if MBTEST(peek_char == '&') + return (SEMI_SEMI_AND); + else + { + shell_ungetc (peek_char); + return (SEMI_SEMI); + } + + case '&': + return (AND_AND); + + case '|': + return (OR_OR); + +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) + case '(': /* ) */ + result = parse_dparen (character); + if (result == -2) + break; + else + return result; +#endif + } + } + else if MBTEST(character == '<' && peek_char == '&') + return (LESS_AND); + else if MBTEST(character == '>' && peek_char == '&') + return (GREATER_AND); + else if MBTEST(character == '<' && peek_char == '>') + return (LESS_GREATER); + else if MBTEST(character == '>' && peek_char == '|') + return (GREATER_BAR); + else if MBTEST(character == '&' && peek_char == '>') + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '>') + return (AND_GREATER_GREATER); + else + { + shell_ungetc (peek_char); + return (AND_GREATER); + } + } + else if MBTEST(character == '|' && peek_char == '&') + return (BAR_AND); + else if MBTEST(character == ';' && peek_char == '&') + { + parser_state |= PST_CASEPAT; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + return (SEMI_AND); + } + + shell_ungetc (peek_char); + + /* If we look like we are reading the start of a function + definition, then let the reader know about it so that + we will do the right thing with `{'. */ + if MBTEST(character == ')' && last_read_token == '(' && token_before_that == WORD) + { + parser_state |= PST_ALLOWOPNBRC; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + function_dstart = line_number; + } + + /* case pattern lists may be preceded by an optional left paren. If + we're not trying to parse a case pattern list, the left paren + indicates a subshell. */ + if MBTEST(character == '(' && (parser_state & PST_CASEPAT) == 0) /* ) */ + parser_state |= PST_SUBSHELL; + /*(*/ + else if MBTEST((parser_state & PST_CASEPAT) && character == ')') + parser_state &= ~PST_CASEPAT; + /*(*/ + else if MBTEST((parser_state & PST_SUBSHELL) && character == ')') + parser_state &= ~PST_SUBSHELL; + +#if defined (PROCESS_SUBSTITUTION) + /* Check for the constructs which introduce process substitution. + Shells running in `posix mode' don't do process substitution. */ + if MBTEST(posixly_correct || ((character != '>' && character != '<') || peek_char != '(')) /*)*/ +#endif /* PROCESS_SUBSTITUTION */ + return (character); + } + + /* Hack <&- (close stdin) case. Also <&N- (dup and close). */ + if MBTEST(character == '-' && (last_read_token == LESS_AND || last_read_token == GREATER_AND)) + return (character); + +tokword: + /* Okay, if we got this far, we have to read a word. Read one, + and then check it against the known ones. */ + result = read_token_word (character); +#if defined (ALIAS) + if (result == RE_READ_TOKEN) + goto re_read_token; +#endif + return result; +} + +/* + * Match a $(...) or other grouping construct. This has to handle embedded + * quoted strings ('', ``, "") and nested constructs. It also must handle + * reprompting the user, if necessary, after reading a newline, and returning + * correct error values if it reads EOF. + */ +#define P_FIRSTCLOSE 0x0001 +#define P_ALLOWESC 0x0002 +#define P_DQUOTE 0x0004 +#define P_COMMAND 0x0008 /* parsing a command, so look for comments */ +#define P_BACKQUOTE 0x0010 /* parsing a backquoted command substitution */ +#define P_ARRAYSUB 0x0020 /* parsing a [...] array subscript for assignment */ +#define P_DOLBRACE 0x0040 /* parsing a ${...} construct */ + +/* Lexical state while parsing a grouping construct or $(...). */ +#define LEX_WASDOL 0x001 +#define LEX_CKCOMMENT 0x002 +#define LEX_INCOMMENT 0x004 +#define LEX_PASSNEXT 0x008 +#define LEX_RESWDOK 0x010 +#define LEX_CKCASE 0x020 +#define LEX_INCASE 0x040 +#define LEX_INHEREDOC 0x080 +#define LEX_HEREDELIM 0x100 /* reading here-doc delimiter */ +#define LEX_STRIPDOC 0x200 /* <<- strip tabs from here doc delim */ +#define LEX_INWORD 0x400 + +#define COMSUB_META(ch) ((ch) == ';' || (ch) == '&' || (ch) == '|') + +#define CHECK_NESTRET_ERROR() \ + do { \ + if (nestret == &matched_pair_error) \ + { \ + free (ret); \ + return &matched_pair_error; \ + } \ + } while (0) + +#define APPEND_NESTRET() \ + do { \ + if (nestlen) \ + { \ + RESIZE_MALLOCED_BUFFER (ret, retind, nestlen, retsize, 64); \ + strcpy (ret + retind, nestret); \ + retind += nestlen; \ + } \ + } while (0) + +static char matched_pair_error; + +static char * +parse_matched_pair (qc, open, close, lenp, flags) + int qc; /* `"' if this construct is within double quotes */ + int open, close; + int *lenp, flags; +{ + int count, ch, tflags; + int nestlen, ttranslen, start_lineno; + char *ret, *nestret, *ttrans; + int retind, retsize, rflags; + int dolbrace_state; + + dolbrace_state = (flags & P_DOLBRACE) ? DOLBRACE_PARAM : 0; + +/*itrace("parse_matched_pair[%d]: open = %c close = %c flags = %d", line_number, open, close, flags);*/ + count = 1; + tflags = 0; + + if ((flags & P_COMMAND) && qc != '`' && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0) + tflags |= LEX_CKCOMMENT; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ + rflags = (qc == '"') ? P_DQUOTE : (flags & P_DQUOTE); + + ret = (char *)xmalloc (retsize = 64); + retind = 0; + + start_lineno = line_number; + while (count) + { + ch = shell_getc (qc != '\'' && (tflags & (LEX_PASSNEXT)) == 0); + + if (ch == EOF) + { + free (ret); + parser_error (start_lineno, _("unexpected EOF while looking for matching `%c'"), close); + EOF_Reached = 1; /* XXX */ + return (&matched_pair_error); + } + + /* Possible reprompting. */ + if (ch == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* Don't bother counting parens or doing anything else if in a comment + or part of a case statement */ + if (tflags & LEX_INCOMMENT) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + if (ch == '\n') + tflags &= ~LEX_INCOMMENT; + + continue; + } + + /* Not exactly right yet, should handle shell metacharacters, too. If + any changes are made to this test, make analogous changes to subst.c: + extract_delimited_string(). */ + else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || shellblank (ret[retind - 1]))) + tflags |= LEX_INCOMMENT; + + if (tflags & LEX_PASSNEXT) /* last char was backslash */ + { + tflags &= ~LEX_PASSNEXT; + if (qc != '\'' && ch == '\n') /* double-quoted \ disappears. */ + { + if (retind > 0) + retind--; /* swallow previously-added backslash */ + continue; + } + + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + if MBTEST(ch == CTLESC) + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + /* If we're reparsing the input (e.g., from parse_string_to_word_list), + we've already prepended CTLESC to single-quoted results of $'...'. + We may want to do this for other CTLESC-quoted characters in + reparse, too. */ + else if MBTEST((parser_state & PST_REPARSE) && open == '\'' && (ch == CTLESC || ch == CTLNUL)) + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + continue; + } + else if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + else if MBTEST(ch == close) /* ending delimiter */ + count--; + /* handle nested ${...} specially. */ + else if MBTEST(open != close && (tflags & LEX_WASDOL) && open == '{' && ch == open) /* } */ + count++; + else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && ch == open) /* nested begin */ + count++; + + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + /* If we just read the ending character, don't bother continuing. */ + if (count == 0) + break; + + if (open == '\'') /* '' inside grouping construct */ + { + if MBTEST((flags & P_ALLOWESC) && ch == '\\') + tflags |= LEX_PASSNEXT; + continue; + } + + if MBTEST(ch == '\\') /* backslashes */ + tflags |= LEX_PASSNEXT; + + /* Based on which dolstate is currently in (param, op, or word), + decide what the op is. We're really only concerned if it's % or + #, so we can turn on a flag that says whether or not we should + treat single quotes as special when inside a double-quoted + ${...}. This logic must agree with subst.c:extract_dollar_brace_string + since they share the same defines. */ + /* FLAG POSIX INTERP 221 */ + if (flags & P_DOLBRACE) + { + /* ${param%[%]word} */ + if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '%' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param#[#]word} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '#' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param/[/]pat/rep} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '/' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE2; /* XXX */ + /* ${param^[^]pat} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '^' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param,[,]pat} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == ',' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && strchr ("#%^,~:-=?+/", ch) != 0) + dolbrace_state = DOLBRACE_OP; + else if MBTEST(dolbrace_state == DOLBRACE_OP && strchr ("#%^,~:-=?+/", ch) == 0) + dolbrace_state = DOLBRACE_WORD; + } + + /* The big hammer. Single quotes aren't special in double quotes. The + problem is that Posix used to say the single quotes are semi-special: + within a double-quoted ${...} construct "an even number of + unescaped double-quotes or single-quotes, if any, shall occur." */ + /* This was changed in Austin Group Interp 221 */ + if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'') + continue; + + /* Could also check open == '`' if we want to parse grouping constructs + inside old-style command substitution. */ + if (open != close) /* a grouping construct */ + { + if MBTEST(shellquote (ch)) + { + /* '', ``, or "" inside $(...) or other grouping construct. */ + push_delimiter (dstack, ch); + if MBTEST((tflags & LEX_WASDOL) && ch == '\'') /* $'...' inside group */ + nestret = parse_matched_pair (ch, ch, ch, &nestlen, P_ALLOWESC|rflags); + else + nestret = parse_matched_pair (ch, ch, ch, &nestlen, rflags); + pop_delimiter (dstack); + CHECK_NESTRET_ERROR (); + + if MBTEST((tflags & LEX_WASDOL) && ch == '\'' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Translate $'...' here. */ + ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen); + xfree (nestret); + + /* If we're parsing a double-quoted brace expansion and we are + not in a place where single quotes are treated specially, + make sure we single-quote the results of the ansi + expansion because quote removal should remove them later */ + /* FLAG POSIX INTERP 221 */ + if ((shell_compatibility_level > 42) && (rflags & P_DQUOTE) && (dolbrace_state == DOLBRACE_QUOTE2) && (flags & P_DOLBRACE)) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else if ((rflags & P_DQUOTE) == 0) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else + { + nestret = ttrans; + nestlen = ttranslen; + } + retind -= 2; /* back up before the $' */ + } + else if MBTEST((tflags & LEX_WASDOL) && ch == '"' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Locale expand $"..." here. */ + ttrans = localeexpand (nestret, 0, nestlen - 1, start_lineno, &ttranslen); + xfree (nestret); + + nestret = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + nestlen = ttranslen + 2; + retind -= 2; /* back up before the $" */ + } + + APPEND_NESTRET (); + FREE (nestret); + } + else if ((flags & P_ARRAYSUB) && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + goto parse_dollar_word; + } + /* Parse an old-style command substitution within double quotes as a + single word. */ + /* XXX - sh and ksh93 don't do this - XXX */ + else if MBTEST(open == '"' && ch == '`') + { + nestret = parse_matched_pair (0, '`', '`', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + else if MBTEST(open != '`' && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + /* check for $(), $[], or ${} inside quoted string. */ + { +parse_dollar_word: + if (open == ch) /* undo previous increment */ + count--; + if (ch == '(') /* ) */ + nestret = parse_comsub (0, '(', ')', &nestlen, (rflags|P_COMMAND) & ~P_DQUOTE); + else if (ch == '{') /* } */ + nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|P_DOLBRACE|rflags); + else if (ch == '[') /* ] */ + nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + if MBTEST(ch == '$') + tflags |= LEX_WASDOL; + else + tflags &= ~LEX_WASDOL; + } + + ret[retind] = '\0'; + if (lenp) + *lenp = retind; +/*itrace("parse_matched_pair[%d]: returning %s", line_number, ret);*/ + return ret; +} + +/* Parse a $(...) command substitution. This is messier than I'd like, and + reproduces a lot more of the token-reading code than I'd like. */ +static char * +parse_comsub (qc, open, close, lenp, flags) + int qc; /* `"' if this construct is within double quotes */ + int open, close; + int *lenp, flags; +{ + int count, ch, peekc, tflags, lex_rwlen, lex_wlen, lex_firstind; + int nestlen, ttranslen, start_lineno; + char *ret, *nestret, *ttrans, *heredelim; + int retind, retsize, rflags, hdlen; + + /* Posix interp 217 says arithmetic expressions have precedence, so + assume $(( introduces arithmetic expansion and parse accordingly. */ + peekc = shell_getc (0); + shell_ungetc (peekc); + if (peekc == '(') + return (parse_matched_pair (qc, open, close, lenp, 0)); + +/*itrace("parse_comsub: qc = `%c' open = %c close = %c", qc, open, close);*/ + count = 1; + tflags = LEX_RESWDOK; + + if ((flags & P_COMMAND) && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0) + tflags |= LEX_CKCASE; + if ((tflags & LEX_CKCASE) && (interactive == 0 || interactive_comments)) + tflags |= LEX_CKCOMMENT; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ + rflags = (flags & P_DQUOTE); + + ret = (char *)xmalloc (retsize = 64); + retind = 0; + + start_lineno = line_number; + lex_rwlen = lex_wlen = 0; + + heredelim = 0; + lex_firstind = -1; + + while (count) + { +comsub_readchar: + ch = shell_getc (qc != '\'' && (tflags & (LEX_INCOMMENT|LEX_PASSNEXT)) == 0); + + if (ch == EOF) + { +eof_error: + free (ret); + FREE (heredelim); + parser_error (start_lineno, _("unexpected EOF while looking for matching `%c'"), close); + EOF_Reached = 1; /* XXX */ + return (&matched_pair_error); + } + + /* If we hit the end of a line and are reading the contents of a here + document, and it's not the same line that the document starts on, + check for this line being the here doc delimiter. Otherwise, if + we're in a here document, mark the next character as the beginning + of a line. */ + if (ch == '\n') + { + if ((tflags & LEX_HEREDELIM) && heredelim) + { + tflags &= ~LEX_HEREDELIM; + tflags |= LEX_INHEREDOC; + lex_firstind = retind + 1; + } + else if (tflags & LEX_INHEREDOC) + { + int tind; + tind = lex_firstind; + while ((tflags & LEX_STRIPDOC) && ret[tind] == '\t') + tind++; + if (STREQN (ret + tind, heredelim, hdlen)) + { + tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC); +/*itrace("parse_comsub:%d: found here doc end `%s'", line_number, ret + tind);*/ + free (heredelim); + heredelim = 0; + lex_firstind = -1; + } + else + lex_firstind = retind + 1; + } + } + + /* Possible reprompting. */ + if (ch == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* XXX -- possibly allow here doc to be delimited by ending right + paren. */ + if ((tflags & LEX_INHEREDOC) && ch == close && count == 1) + { + int tind; +/*itrace("parse_comsub: in here doc, ch == close, retind - firstind = %d hdlen = %d retind = %d", retind-lex_firstind, hdlen, retind);*/ + tind = lex_firstind; + while ((tflags & LEX_STRIPDOC) && ret[tind] == '\t') + tind++; + if (retind-tind == hdlen && STREQN (ret + tind, heredelim, hdlen)) + { + tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC); +/*itrace("parse_comsub:%d: found here doc end `%s'", line_number, ret + tind);*/ + free (heredelim); + heredelim = 0; + lex_firstind = -1; + } + } + + /* Don't bother counting parens or doing anything else if in a comment */ + if (tflags & (LEX_INCOMMENT|LEX_INHEREDOC)) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + if ((tflags & LEX_INCOMMENT) && ch == '\n') + { +/*itrace("parse_comsub:%d: lex_incomment -> 0 ch = `%c'", line_number, ch);*/ + tflags &= ~LEX_INCOMMENT; + } + + continue; + } + + if (tflags & LEX_PASSNEXT) /* last char was backslash */ + { +/*itrace("parse_comsub:%d: lex_passnext -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + tflags &= ~LEX_PASSNEXT; + if (qc != '\'' && ch == '\n') /* double-quoted \ disappears. */ + { + if (retind > 0) + retind--; /* swallow previously-added backslash */ + continue; + } + + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + if MBTEST(ch == CTLESC) + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + + /* If this is a shell break character, we are not in a word. If not, + we either start or continue a word. */ + if MBTEST(shellbreak (ch)) + { + tflags &= ~LEX_INWORD; +/*itrace("parse_comsub:%d: lex_inword -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + } + else + { + if (tflags & LEX_INWORD) + { + lex_wlen++; +/*itrace("parse_comsub:%d: lex_inword == 1 ch = `%c' lex_wlen = %d (%d)", line_number, ch, lex_wlen, __LINE__);*/ + } + else + { +/*itrace("parse_comsub:%d: lex_inword -> 1 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + tflags |= LEX_INWORD; + lex_wlen = 0; + } + } + + /* Skip whitespace */ + if MBTEST(shellblank (ch) && (tflags & LEX_HEREDELIM) == 0 && lex_rwlen == 0) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + continue; + } + + /* Either we are looking for the start of the here-doc delimiter + (lex_firstind == -1) or we are reading one (lex_firstind >= 0). + If this character is a shell break character and we are reading + the delimiter, save it and note that we are now reading a here + document. If we've found the start of the delimiter, note it by + setting lex_firstind. Backslashes can quote shell metacharacters + in here-doc delimiters. */ + if (tflags & LEX_HEREDELIM) + { + if (lex_firstind == -1 && shellbreak (ch) == 0) + lex_firstind = retind; +#if 0 + else if (heredelim && (tflags & LEX_PASSNEXT) == 0 && ch == '\n') + { + tflags |= LEX_INHEREDOC; + tflags &= ~LEX_HEREDELIM; + lex_firstind = retind + 1; + } +#endif + else if (lex_firstind >= 0 && (tflags & LEX_PASSNEXT) == 0 && shellbreak (ch)) + { + if (heredelim == 0) + { + nestret = substring (ret, lex_firstind, retind); + heredelim = string_quote_removal (nestret, 0); + free (nestret); + hdlen = STRLEN(heredelim); +/*itrace("parse_comsub:%d: found here doc delimiter `%s' (%d)", line_number, heredelim, hdlen);*/ + } + if (ch == '\n') + { + tflags |= LEX_INHEREDOC; + tflags &= ~LEX_HEREDELIM; + lex_firstind = retind + 1; + } + else + lex_firstind = -1; + } + } + + /* Meta-characters that can introduce a reserved word. Not perfect yet. */ + if MBTEST((tflags & LEX_RESWDOK) == 0 && (tflags & LEX_CKCASE) && (tflags & LEX_INCOMMENT) == 0 && (shellmeta(ch) || ch == '\n')) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + peekc = shell_getc (1); + if (ch == peekc && (ch == '&' || ch == '|' || ch == ';')) /* two-character tokens */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; +/*itrace("parse_comsub:%d: set lex_reswordok = 1, ch = `%c'", line_number, ch);*/ + tflags |= LEX_RESWDOK; + lex_rwlen = 0; + continue; + } + else if (ch == '\n' || COMSUB_META(ch)) + { + shell_ungetc (peekc); +/*itrace("parse_comsub:%d: set lex_reswordok = 1, ch = `%c'", line_number, ch);*/ + tflags |= LEX_RESWDOK; + lex_rwlen = 0; + continue; + } + else if (ch == EOF) + goto eof_error; + else + { + /* `unget' the character we just added and fall through */ + retind--; + shell_ungetc (peekc); + } + } + + /* If we can read a reserved word, try to read one. */ + if (tflags & LEX_RESWDOK) + { + if MBTEST(islower (ch)) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + lex_rwlen++; + continue; + } + else if MBTEST(lex_rwlen == 4 && shellbreak (ch)) + { + if (STREQN (ret + retind - 4, "case", 4)) + { + tflags |= LEX_INCASE; +/*itrace("parse_comsub:%d: found `case', lex_incase -> 1 lex_reswdok -> 0", line_number);*/ + } + else if (STREQN (ret + retind - 4, "esac", 4)) + { + tflags &= ~LEX_INCASE; +/*itrace("parse_comsub:%d: found `esac', lex_incase -> 0 lex_reswdok -> 0", line_number);*/ + } + tflags &= ~LEX_RESWDOK; + } + else if MBTEST((tflags & LEX_CKCOMMENT) && ch == '#' && (lex_rwlen == 0 || ((tflags & LEX_INWORD) && lex_wlen == 0))) + ; /* don't modify LEX_RESWDOK if we're starting a comment */ + /* Allow `do' followed by space, tab, or newline to preserve the + RESWDOK flag, but reset the reserved word length counter so we + can read another one. */ + else if MBTEST(((tflags & LEX_INCASE) == 0) && + (isblank(ch) || ch == '\n') && + lex_rwlen == 2 && + STREQN (ret + retind - 2, "do", 2)) + { +/*itrace("parse_comsub:%d: lex_incase == 1 found `%c', found \"do\"", line_number, ch);*/ + lex_rwlen = 0; + } + else if MBTEST((tflags & LEX_INCASE) && ch != '\n') + /* If we can read a reserved word and we're in case, we're at the + point where we can read a new pattern list or an esac. We + handle the esac case above. If we read a newline, we want to + leave LEX_RESWDOK alone. If we read anything else, we want to + turn off LEX_RESWDOK, since we're going to read a pattern list. */ + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: lex_incase == 1 found `%c', lex_reswordok -> 0", line_number, ch);*/ + } + else if MBTEST(shellbreak (ch) == 0) + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/ + } +#if 0 + /* If we find a space or tab but have read something and it's not + `do', turn off the reserved-word-ok flag */ + else if MBTEST(isblank (ch) && lex_rwlen > 0) + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/ + } +#endif + } + + /* Might be the start of a here-doc delimiter */ + if MBTEST((tflags & LEX_INCOMMENT) == 0 && (tflags & LEX_CKCASE) && ch == '<') + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + peekc = shell_getc (1); + if (peekc == EOF) + goto eof_error; + if (peekc == ch) + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; + peekc = shell_getc (1); + if (peekc == EOF) + goto eof_error; + if (peekc == '-') + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; + tflags |= LEX_STRIPDOC; + } + else + shell_ungetc (peekc); + if (peekc != '<') + { + tflags |= LEX_HEREDELIM; + lex_firstind = -1; + } + continue; + } + else + ch = peekc; /* fall through and continue XXX */ + } + else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (((tflags & LEX_RESWDOK) && lex_rwlen == 0) || ((tflags & LEX_INWORD) && lex_wlen == 0))) + { +/*itrace("parse_comsub:%d: lex_incomment -> 1 (%d)", line_number, __LINE__);*/ + tflags |= LEX_INCOMMENT; + } + + if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } +#if 0 + else if MBTEST((tflags & LEX_INCASE) && ch == close && close == ')') + tflags &= ~LEX_INCASE; /* XXX */ +#endif + else if MBTEST(ch == close && (tflags & LEX_INCASE) == 0) /* ending delimiter */ + { + count--; +/*itrace("parse_comsub:%d: found close: count = %d", line_number, count);*/ + } + else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && (tflags & LEX_INCASE) == 0 && ch == open) /* nested begin */ + { + count++; +/*itrace("parse_comsub:%d: found open: count = %d", line_number, count);*/ + } + + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + /* If we just read the ending character, don't bother continuing. */ + if (count == 0) + break; + + if MBTEST(ch == '\\') /* backslashes */ + tflags |= LEX_PASSNEXT; + + if MBTEST(shellquote (ch)) + { + /* '', ``, or "" inside $(...). */ + push_delimiter (dstack, ch); + if MBTEST((tflags & LEX_WASDOL) && ch == '\'') /* $'...' inside group */ + nestret = parse_matched_pair (ch, ch, ch, &nestlen, P_ALLOWESC|rflags); + else + nestret = parse_matched_pair (ch, ch, ch, &nestlen, rflags); + pop_delimiter (dstack); + CHECK_NESTRET_ERROR (); + + if MBTEST((tflags & LEX_WASDOL) && ch == '\'' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Translate $'...' here. */ + ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen); + xfree (nestret); + + if ((rflags & P_DQUOTE) == 0) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else + { + nestret = ttrans; + nestlen = ttranslen; + } + retind -= 2; /* back up before the $' */ + } + else if MBTEST((tflags & LEX_WASDOL) && ch == '"' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Locale expand $"..." here. */ + ttrans = localeexpand (nestret, 0, nestlen - 1, start_lineno, &ttranslen); + xfree (nestret); + + nestret = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + nestlen = ttranslen + 2; + retind -= 2; /* back up before the $" */ + } + + APPEND_NESTRET (); + FREE (nestret); + } + else if MBTEST((tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + /* check for $(), $[], or ${} inside command substitution. */ + { + if ((tflags & LEX_INCASE) == 0 && open == ch) /* undo previous increment */ + count--; + if (ch == '(') /* ) */ + nestret = parse_comsub (0, '(', ')', &nestlen, (rflags|P_COMMAND) & ~P_DQUOTE); + else if (ch == '{') /* } */ + nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|P_DOLBRACE|rflags); + else if (ch == '[') /* ] */ + nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + if MBTEST(ch == '$') + tflags |= LEX_WASDOL; + else + tflags &= ~LEX_WASDOL; + } + + FREE (heredelim); + ret[retind] = '\0'; + if (lenp) + *lenp = retind; +/*itrace("parse_comsub:%d: returning `%s'", line_number, ret);*/ + return ret; +} + +/* Recursively call the parser to parse a $(...) command substitution. */ +char * +xparse_dolparen (base, string, indp, flags) + char *base; + char *string; + int *indp; + int flags; +{ + sh_parser_state_t ps; + sh_input_line_state_t ls; + int orig_ind, nc, sflags, orig_eof_token; + char *ret, *s, *ep, *ostring; + + /*yydebug = 1;*/ + orig_ind = *indp; + ostring = string; + +/*itrace("xparse_dolparen: size = %d shell_input_line = `%s'", shell_input_line_size, shell_input_line);*/ + sflags = SEVAL_NONINT|SEVAL_NOHIST|SEVAL_NOFREE; + if (flags & SX_NOLONGJMP) + sflags |= SEVAL_NOLONGJMP; + save_parser_state (&ps); + save_input_line_state (&ls); + orig_eof_token = shell_eof_token; + + /*(*/ + parser_state |= PST_CMDSUBST|PST_EOFTOKEN; /* allow instant ')' */ /*(*/ + shell_eof_token = ')'; + parse_string (string, "command substitution", sflags, &ep); + + shell_eof_token = orig_eof_token; + restore_parser_state (&ps); + reset_parser (); + /* reset_parser clears shell_input_line and associated variables */ + restore_input_line_state (&ls); + if (interactive) + token_to_read = 0; + + /* Need to find how many characters parse_and_execute consumed, update + *indp, if flags != 0, copy the portion of the string parsed into RET + and return it. If flags & 1 (EX_NOALLOC) we can return NULL. */ + + /*(*/ + if (ep[-1] != ')') + { +#if DEBUG + if (ep[-1] != '\n') + itrace("xparse_dolparen:%d: ep[-1] != RPAREN (%d), ep = `%s'", line_number, ep[-1], ep); +#endif + while (ep > ostring && ep[-1] == '\n') ep--; + } + + nc = ep - ostring; + *indp = ep - base - 1; + + /*(*/ +#if DEBUG + if (base[*indp] != ')') + itrace("xparse_dolparen:%d: base[%d] != RPAREN (%d), base = `%s'", line_number, *indp, base[*indp], base); +#endif + + if (flags & SX_NOALLOC) + return (char *)NULL; + + if (nc == 0) + { + ret = xmalloc (1); + ret[0] = '\0'; + } + else + ret = substring (ostring, 0, nc - 1); + + return ret; +} + +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) +/* Parse a double-paren construct. It can be either an arithmetic + command, an arithmetic `for' command, or a nested subshell. Returns + the parsed token, -1 on error, or -2 if we didn't do anything and + should just go on. */ +static int +parse_dparen (c) + int c; +{ + int cmdtyp, sline; + char *wval; + WORD_DESC *wd; + +#if defined (ARITH_FOR_COMMAND) + if (last_read_token == FOR) + { + arith_for_lineno = line_number; + cmdtyp = parse_arith_cmd (&wval, 0); + if (cmdtyp == 1) + { + wd = alloc_word_desc (); + wd->word = wval; + yylval.word_list = make_word_list (wd, (WORD_LIST *)NULL); + return (ARITH_FOR_EXPRS); + } + else + return -1; /* ERROR */ + } +#endif + +#if defined (DPAREN_ARITHMETIC) + if (reserved_word_acceptable (last_read_token)) + { + sline = line_number; + + cmdtyp = parse_arith_cmd (&wval, 0); + if (cmdtyp == 1) /* arithmetic command */ + { + wd = alloc_word_desc (); + wd->word = wval; + wd->flags = W_QUOTED|W_NOSPLIT|W_NOGLOB|W_DQUOTE; + yylval.word_list = make_word_list (wd, (WORD_LIST *)NULL); + return (ARITH_CMD); + } + else if (cmdtyp == 0) /* nested subshell */ + { + push_string (wval, 0, (alias_t *)NULL); + pushed_string_list->flags = PSH_DPAREN; + if ((parser_state & PST_CASEPAT) == 0) + parser_state |= PST_SUBSHELL; + return (c); + } + else /* ERROR */ + return -1; + } +#endif + + return -2; /* XXX */ +} + +/* We've seen a `(('. Look for the matching `))'. If we get it, return 1. + If not, assume it's a nested subshell for backwards compatibility and + return 0. In any case, put the characters we've consumed into a locally- + allocated buffer and make *ep point to that buffer. Return -1 on an + error, for example EOF. */ +static int +parse_arith_cmd (ep, adddq) + char **ep; + int adddq; +{ + int exp_lineno, rval, c; + char *ttok, *tokstr; + int ttoklen; + + exp_lineno = line_number; + ttok = parse_matched_pair (0, '(', ')', &ttoklen, 0); + rval = 1; + if (ttok == &matched_pair_error) + return -1; + /* Check that the next character is the closing right paren. If + not, this is a syntax error. ( */ + c = shell_getc (0); + if MBTEST(c != ')') + rval = 0; + + tokstr = (char *)xmalloc (ttoklen + 4); + + /* if ADDDQ != 0 then (( ... )) -> "..." */ + if (rval == 1 && adddq) /* arith cmd, add double quotes */ + { + tokstr[0] = '"'; + strncpy (tokstr + 1, ttok, ttoklen - 1); + tokstr[ttoklen] = '"'; + tokstr[ttoklen+1] = '\0'; + } + else if (rval == 1) /* arith cmd, don't add double quotes */ + { + strncpy (tokstr, ttok, ttoklen - 1); + tokstr[ttoklen-1] = '\0'; + } + else /* nested subshell */ + { + tokstr[0] = '('; + strncpy (tokstr + 1, ttok, ttoklen - 1); + tokstr[ttoklen] = ')'; + tokstr[ttoklen+1] = c; + tokstr[ttoklen+2] = '\0'; + } + + *ep = tokstr; + FREE (ttok); + return rval; +} +#endif /* DPAREN_ARITHMETIC || ARITH_FOR_COMMAND */ + +#if defined (COND_COMMAND) +static void +cond_error () +{ + char *etext; + + if (EOF_Reached && cond_token != COND_ERROR) /* [[ */ + parser_error (cond_lineno, _("unexpected EOF while looking for `]]'")); + else if (cond_token != COND_ERROR) + { + if (etext = error_token_from_token (cond_token)) + { + parser_error (cond_lineno, _("syntax error in conditional expression: unexpected token `%s'"), etext); + free (etext); + } + else + parser_error (cond_lineno, _("syntax error in conditional expression")); + } +} + +static COND_COM * +cond_expr () +{ + return (cond_or ()); +} + +static COND_COM * +cond_or () +{ + COND_COM *l, *r; + + l = cond_and (); + if (cond_token == OR_OR) + { + r = cond_or (); + l = make_cond_node (COND_OR, (WORD_DESC *)NULL, l, r); + } + return l; +} + +static COND_COM * +cond_and () +{ + COND_COM *l, *r; + + l = cond_term (); + if (cond_token == AND_AND) + { + r = cond_and (); + l = make_cond_node (COND_AND, (WORD_DESC *)NULL, l, r); + } + return l; +} + +static int +cond_skip_newlines () +{ + while ((cond_token = read_token (READ)) == '\n') + { + if (SHOULD_PROMPT ()) + prompt_again (); + } + return (cond_token); +} + +#define COND_RETURN_ERROR() \ + do { cond_token = COND_ERROR; return ((COND_COM *)NULL); } while (0) + +static COND_COM * +cond_term () +{ + WORD_DESC *op; + COND_COM *term, *tleft, *tright; + int tok, lineno; + char *etext; + + /* Read a token. It can be a left paren, a `!', a unary operator, or a + word that should be the first argument of a binary operator. Start by + skipping newlines, since this is a compound command. */ + tok = cond_skip_newlines (); + lineno = line_number; + if (tok == COND_END) + { + COND_RETURN_ERROR (); + } + else if (tok == '(') + { + term = cond_expr (); + if (cond_token != ')') + { + if (term) + dispose_cond_node (term); /* ( */ + if (etext = error_token_from_token (cond_token)) + { + parser_error (lineno, _("unexpected token `%s', expected `)'"), etext); + free (etext); + } + else + parser_error (lineno, _("expected `)'")); + COND_RETURN_ERROR (); + } + term = make_cond_node (COND_EXPR, (WORD_DESC *)NULL, term, (COND_COM *)NULL); + (void)cond_skip_newlines (); + } + else if (tok == BANG || (tok == WORD && (yylval.word->word[0] == '!' && yylval.word->word[1] == '\0'))) + { + if (tok == WORD) + dispose_word (yylval.word); /* not needed */ + term = cond_term (); + if (term) + term->flags |= CMD_INVERT_RETURN; + } + else if (tok == WORD && yylval.word->word[0] == '-' && yylval.word->word[2] == 0 && test_unop (yylval.word->word)) + { + op = yylval.word; + tok = read_token (READ); + if (tok == WORD) + { + tleft = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + term = make_cond_node (COND_UNARY, op, tleft, (COND_COM *)NULL); + } + else + { + dispose_word (op); + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected argument `%s' to conditional unary operator"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected argument to conditional unary operator")); + COND_RETURN_ERROR (); + } + + (void)cond_skip_newlines (); + } + else if (tok == WORD) /* left argument to binary operator */ + { + /* lhs */ + tleft = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + + /* binop */ + tok = read_token (READ); + if (tok == WORD && test_binop (yylval.word->word)) + { + op = yylval.word; + if (op->word[0] == '=' && (op->word[1] == '\0' || (op->word[1] == '=' && op->word[2] == '\0'))) + parser_state |= PST_EXTPAT; + else if (op->word[0] == '!' && op->word[1] == '=' && op->word[2] == '\0') + parser_state |= PST_EXTPAT; + } +#if defined (COND_REGEXP) + else if (tok == WORD && STREQ (yylval.word->word, "=~")) + { + op = yylval.word; + parser_state |= PST_REGEXP; + } +#endif + else if (tok == '<' || tok == '>') + op = make_word_from_token (tok); /* ( */ + /* There should be a check before blindly accepting the `)' that we have + seen the opening `('. */ + else if (tok == COND_END || tok == AND_AND || tok == OR_OR || tok == ')') + { + /* Special case. [[ x ]] is equivalent to [[ -n x ]], just like + the test command. Similarly for [[ x && expr ]] or + [[ x || expr ]] or [[ (x) ]]. */ + op = make_word ("-n"); + term = make_cond_node (COND_UNARY, op, tleft, (COND_COM *)NULL); + cond_token = tok; + return (term); + } + else + { + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected token `%s', conditional binary operator expected"), etext); + free (etext); + } + else + parser_error (line_number, _("conditional binary operator expected")); + dispose_cond_node (tleft); + COND_RETURN_ERROR (); + } + + /* rhs */ + if (parser_state & PST_EXTPAT) + extended_glob = 1; + tok = read_token (READ); + if (parser_state & PST_EXTPAT) + extended_glob = global_extglob; + parser_state &= ~(PST_REGEXP|PST_EXTPAT); + + if (tok == WORD) + { + tright = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + term = make_cond_node (COND_BINARY, op, tleft, tright); + } + else + { + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected argument `%s' to conditional binary operator"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected argument to conditional binary operator")); + dispose_cond_node (tleft); + dispose_word (op); + COND_RETURN_ERROR (); + } + + (void)cond_skip_newlines (); + } + else + { + if (tok < 256) + parser_error (line_number, _("unexpected token `%c' in conditional command"), tok); + else if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected token `%s' in conditional command"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected token %d in conditional command"), tok); + COND_RETURN_ERROR (); + } + return (term); +} + +/* This is kind of bogus -- we slip a mini recursive-descent parser in + here to handle the conditional statement syntax. */ +static COMMAND * +parse_cond_command () +{ + COND_COM *cexp; + + global_extglob = extended_glob; + cexp = cond_expr (); + return (make_cond_command (cexp)); +} +#endif + +#if defined (ARRAY_VARS) +/* When this is called, it's guaranteed that we don't care about anything + in t beyond i. We do save and restore the chars, though. */ +static int +token_is_assignment (t, i) + char *t; + int i; +{ + unsigned char c, c1; + int r; + + c = t[i]; c1 = t[i+1]; + t[i] = '='; t[i+1] = '\0'; + r = assignment (t, (parser_state & PST_COMPASSIGN) != 0); + t[i] = c; t[i+1] = c1; + return r; +} + +/* XXX - possible changes here for `+=' */ +static int +token_is_ident (t, i) + char *t; + int i; +{ + unsigned char c; + int r; + + c = t[i]; + t[i] = '\0'; + r = legal_identifier (t); + t[i] = c; + return r; +} +#endif + +static int +read_token_word (character) + int character; +{ + /* The value for YYLVAL when a WORD is read. */ + WORD_DESC *the_word; + + /* Index into the token that we are building. */ + int token_index; + + /* ALL_DIGITS becomes zero when we see a non-digit. */ + int all_digit_token; + + /* DOLLAR_PRESENT becomes non-zero if we see a `$'. */ + int dollar_present; + + /* COMPOUND_ASSIGNMENT becomes non-zero if we are parsing a compound + assignment. */ + int compound_assignment; + + /* QUOTED becomes non-zero if we see one of ("), ('), (`), or (\). */ + int quoted; + + /* Non-zero means to ignore the value of the next character, and just + to add it no matter what. */ + int pass_next_character; + + /* The current delimiting character. */ + int cd; + int result, peek_char; + char *ttok, *ttrans; + int ttoklen, ttranslen; + intmax_t lvalue; + + if (token_buffer_size < TOKEN_DEFAULT_INITIAL_SIZE) + token = (char *)xrealloc (token, token_buffer_size = TOKEN_DEFAULT_INITIAL_SIZE); + + token_index = 0; + all_digit_token = DIGIT (character); + dollar_present = quoted = pass_next_character = compound_assignment = 0; + + for (;;) + { + if (character == EOF) + goto got_token; + + if (pass_next_character) + { + pass_next_character = 0; + goto got_escaped_character; + } + + cd = current_delimiter (dstack); + + /* Handle backslashes. Quote lots of things when not inside of + double-quotes, quote some things inside of double-quotes. */ + if MBTEST(character == '\\') + { + peek_char = shell_getc (0); + + /* Backslash-newline is ignored in all cases except + when quoted with single quotes. */ + if (peek_char == '\n') + { + character = '\n'; + goto next_character; + } + else + { + shell_ungetc (peek_char); + + /* If the next character is to be quoted, note it now. */ + if (cd == 0 || cd == '`' || + (cd == '"' && peek_char >= 0 && (sh_syntaxtab[peek_char] & CBSDQUOTE))) + pass_next_character++; + + quoted = 1; + goto got_character; + } + } + + /* Parse a matched pair of quote characters. */ + if MBTEST(shellquote (character)) + { + push_delimiter (dstack, character); + ttok = parse_matched_pair (character, character, character, &ttoklen, (character == '`') ? P_COMMAND : 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + all_digit_token = 0; + quoted = 1; + dollar_present |= (character == '"' && strchr (ttok, '$') != 0); + FREE (ttok); + goto next_character; + } + +#ifdef COND_REGEXP + /* When parsing a regexp as a single word inside a conditional command, + we need to special-case characters special to both the shell and + regular expressions. Right now, that is only '(' and '|'. */ /*)*/ + if MBTEST((parser_state & PST_REGEXP) && (character == '(' || character == '|')) /*)*/ + { + if (character == '|') + goto got_character; + + push_delimiter (dstack, character); + ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = all_digit_token = 0; + goto next_character; + } +#endif /* COND_REGEXP */ + +#ifdef EXTENDED_GLOB + /* Parse a ksh-style extended pattern matching specification. */ + if MBTEST(extended_glob && PATTERN_CHAR (character)) + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '(') /* ) */ + { + push_delimiter (dstack, peek_char); + ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + token[token_index++] = peek_char; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = all_digit_token = 0; + goto next_character; + } + else + shell_ungetc (peek_char); + } +#endif /* EXTENDED_GLOB */ + + /* If the delimiter character is not single quote, parse some of + the shell expansions that must be read as a single word. */ + if (shellexp (character)) + { + peek_char = shell_getc (1); + /* $(...), <(...), >(...), $((...)), ${...}, and $[...] constructs */ + if MBTEST(peek_char == '(' || + ((peek_char == '{' || peek_char == '[') && character == '$')) /* ) ] } */ + { + if (peek_char == '{') /* } */ + ttok = parse_matched_pair (cd, '{', '}', &ttoklen, P_FIRSTCLOSE|P_DOLBRACE); + else if (peek_char == '(') /* ) */ + { + /* XXX - push and pop the `(' as a delimiter for use by + the command-oriented-history code. This way newlines + appearing in the $(...) string get added to the + history literally rather than causing a possibly- + incorrect `;' to be added. ) */ + push_delimiter (dstack, peek_char); + ttok = parse_comsub (cd, '(', ')', &ttoklen, P_COMMAND); + pop_delimiter (dstack); + } + else + ttok = parse_matched_pair (cd, '[', ']', &ttoklen, 0); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + token[token_index++] = peek_char; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = 1; + all_digit_token = 0; + goto next_character; + } + /* This handles $'...' and $"..." new-style quoted strings. */ + else if MBTEST(character == '$' && (peek_char == '\'' || peek_char == '"')) + { + int first_line; + + first_line = line_number; + push_delimiter (dstack, peek_char); + ttok = parse_matched_pair (peek_char, peek_char, peek_char, + &ttoklen, + (peek_char == '\'') ? P_ALLOWESC : 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; + if (peek_char == '\'') + { + ttrans = ansiexpand (ttok, 0, ttoklen - 1, &ttranslen); + free (ttok); + + /* Insert the single quotes and correctly quote any + embedded single quotes (allowed because P_ALLOWESC was + passed to parse_matched_pair). */ + ttok = sh_single_quote (ttrans); + free (ttrans); + ttranslen = strlen (ttok); + ttrans = ttok; + } + else + { + /* Try to locale-expand the converted string. */ + ttrans = localeexpand (ttok, 0, ttoklen - 1, first_line, &ttranslen); + free (ttok); + + /* Add the double quotes back */ + ttok = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + ttranslen += 2; + ttrans = ttok; + } + + RESIZE_MALLOCED_BUFFER (token, token_index, ttranslen + 1, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + strcpy (token + token_index, ttrans); + token_index += ttranslen; + FREE (ttrans); + quoted = 1; + all_digit_token = 0; + goto next_character; + } + /* This could eventually be extended to recognize all of the + shell's single-character parameter expansions, and set flags.*/ + else if MBTEST(character == '$' && peek_char == '$') + { + RESIZE_MALLOCED_BUFFER (token, token_index, 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = '$'; + token[token_index++] = peek_char; + dollar_present = 1; + all_digit_token = 0; + goto next_character; + } + else + shell_ungetc (peek_char); + } + +#if defined (ARRAY_VARS) + /* Identify possible array subscript assignment; match [...]. If + parser_state&PST_COMPASSIGN, we need to parse [sub]=words treating + `sub' as if it were enclosed in double quotes. */ + else if MBTEST(character == '[' && /* ] */ + ((token_index > 0 && assignment_acceptable (last_read_token) && token_is_ident (token, token_index)) || + (token_index == 0 && (parser_state&PST_COMPASSIGN)))) + { + ttok = parse_matched_pair (cd, '[', ']', &ttoklen, P_ARRAYSUB); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + all_digit_token = 0; + goto next_character; + } + /* Identify possible compound array variable assignment. */ + else if MBTEST(character == '=' && token_index > 0 && (assignment_acceptable (last_read_token) || (parser_state & PST_ASSIGNOK)) && token_is_assignment (token, token_index)) + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '(') /* ) */ + { + ttok = parse_compound_assignment (&ttoklen); + + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 4, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + + token[token_index++] = '='; + token[token_index++] = '('; + if (ttok) + { + strcpy (token + token_index, ttok); + token_index += ttoklen; + } + token[token_index++] = ')'; + FREE (ttok); + all_digit_token = 0; + compound_assignment = 1; +#if 1 + goto next_character; +#else + goto got_token; /* ksh93 seems to do this */ +#endif + } + else + shell_ungetc (peek_char); + } +#endif + + /* When not parsing a multi-character word construct, shell meta- + characters break words. */ + if MBTEST(shellbreak (character)) + { + shell_ungetc (character); + goto got_token; + } + +got_character: + + if (character == CTLESC || character == CTLNUL) + { + RESIZE_MALLOCED_BUFFER (token, token_index, 2, token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = CTLESC; + } + else +got_escaped_character: + RESIZE_MALLOCED_BUFFER (token, token_index, 1, token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + + token[token_index++] = character; + + all_digit_token &= DIGIT (character); + dollar_present |= character == '$'; + + next_character: + if (character == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* We want to remove quoted newlines (that is, a \ pair) + unless we are within single quotes or pass_next_character is + set (the shell equivalent of literal-next). */ + cd = current_delimiter (dstack); + character = shell_getc (cd != '\'' && pass_next_character == 0); + } /* end for (;;) */ + +got_token: + + /* Calls to RESIZE_MALLOCED_BUFFER ensure there is sufficient room. */ + token[token_index] = '\0'; + + /* Check to see what thing we should return. If the last_read_token + is a `<', or a `&', or the character which ended this token is + a '>' or '<', then, and ONLY then, is this input token a NUMBER. + Otherwise, it is just a word, and should be returned as such. */ + if MBTEST(all_digit_token && (character == '<' || character == '>' || + last_read_token == LESS_AND || + last_read_token == GREATER_AND)) + { + if (legal_number (token, &lvalue) && (int)lvalue == lvalue) + { + yylval.number = lvalue; + return (NUMBER); + } + } + + /* Check for special case tokens. */ + result = (last_shell_getc_is_singlebyte) ? special_case_tokens (token) : -1; + if (result >= 0) + return result; + +#if defined (ALIAS) + /* Posix.2 does not allow reserved words to be aliased, so check for all + of them, including special cases, before expanding the current token + as an alias. */ + if MBTEST(posixly_correct) + CHECK_FOR_RESERVED_WORD (token); + + /* Aliases are expanded iff EXPAND_ALIASES is non-zero, and quoting + inhibits alias expansion. */ + if (expand_aliases && quoted == 0) + { + result = alias_expand_token (token); + if (result == RE_READ_TOKEN) + return (RE_READ_TOKEN); + else if (result == NO_EXPANSION) + parser_state &= ~PST_ALEXPNEXT; + } + + /* If not in Posix.2 mode, check for reserved words after alias + expansion. */ + if MBTEST(posixly_correct == 0) +#endif + CHECK_FOR_RESERVED_WORD (token); + + the_word = (WORD_DESC *)xmalloc (sizeof (WORD_DESC)); + the_word->word = (char *)xmalloc (1 + token_index); + the_word->flags = 0; + strcpy (the_word->word, token); + if (dollar_present) + the_word->flags |= W_HASDOLLAR; + if (quoted) + the_word->flags |= W_QUOTED; /*(*/ + if (compound_assignment && token[token_index-1] == ')') + the_word->flags |= W_COMPASSIGN; + /* A word is an assignment if it appears at the beginning of a + simple command, or after another assignment word. This is + context-dependent, so it cannot be handled in the grammar. */ + if (assignment (token, (parser_state & PST_COMPASSIGN) != 0)) + { + the_word->flags |= W_ASSIGNMENT; + /* Don't perform word splitting on assignment statements. */ + if (assignment_acceptable (last_read_token) || (parser_state & PST_COMPASSIGN) != 0) + { + the_word->flags |= W_NOSPLIT; + if (parser_state & PST_COMPASSIGN) + the_word->flags |= W_NOGLOB; /* XXX - W_NOBRACE? */ + } + } + + if (command_token_position (last_read_token)) + { + struct builtin *b; + b = builtin_address_internal (token, 0); + if (b && (b->flags & ASSIGNMENT_BUILTIN)) + parser_state |= PST_ASSIGNOK; + else if (STREQ (token, "eval") || STREQ (token, "let")) + parser_state |= PST_ASSIGNOK; + } + + yylval.word = the_word; + + if (token[0] == '{' && token[token_index-1] == '}' && + (character == '<' || character == '>')) + { + /* can use token; already copied to the_word */ + token[token_index-1] = '\0'; +#if defined (ARRAY_VARS) + if (legal_identifier (token+1) || valid_array_reference (token+1)) +#else + if (legal_identifier (token+1)) +#endif + { + strcpy (the_word->word, token+1); +/*itrace("read_token_word: returning REDIR_WORD for %s", the_word->word);*/ + return (REDIR_WORD); + } + } + + result = ((the_word->flags & (W_ASSIGNMENT|W_NOSPLIT)) == (W_ASSIGNMENT|W_NOSPLIT)) + ? ASSIGNMENT_WORD : WORD; + + switch (last_read_token) + { + case FUNCTION: + parser_state |= PST_ALLOWOPNBRC; + function_dstart = line_number; + break; + case CASE: + case SELECT: + case FOR: + if (word_top < MAX_CASE_NEST) + word_top++; + word_lineno[word_top] = line_number; + break; + } + + return (result); +} + +/* Return 1 if TOKSYM is a token that after being read would allow + a reserved word to be seen, else 0. */ +static int +reserved_word_acceptable (toksym) + int toksym; +{ + switch (toksym) + { + case '\n': + case ';': + case '(': + case ')': + case '|': + case '&': + case '{': + case '}': /* XXX */ + case AND_AND: + case BANG: + case BAR_AND: + case DO: + case DONE: + case ELIF: + case ELSE: + case ESAC: + case FI: + case IF: + case OR_OR: + case SEMI_SEMI: + case SEMI_AND: + case SEMI_SEMI_AND: + case THEN: + case TIME: + case TIMEOPT: + case TIMEIGN: + case COPROC: + case UNTIL: + case WHILE: + case 0: + return 1; + default: +#if defined (COPROCESS_SUPPORT) + if (last_read_token == WORD && token_before_that == COPROC) + return 1; +#endif + if (last_read_token == WORD && token_before_that == FUNCTION) + return 1; + return 0; + } +} + +/* Return the index of TOKEN in the alist of reserved words, or -1 if + TOKEN is not a shell reserved word. */ +int +find_reserved_word (tokstr) + char *tokstr; +{ + int i; + for (i = 0; word_token_alist[i].word; i++) + if (STREQ (tokstr, word_token_alist[i].word)) + return i; + return -1; +} + +/* An interface to let the rest of the shell (primarily the completion + system) know what the parser is expecting. */ +int +parser_in_command_position () +{ + return (command_token_position (last_read_token)); +} + +#if 0 +#if defined (READLINE) +/* Called after each time readline is called. This insures that whatever + the new prompt string is gets propagated to readline's local prompt + variable. */ +static void +reset_readline_prompt () +{ + char *temp_prompt; + + if (prompt_string_pointer) + { + temp_prompt = (*prompt_string_pointer) + ? decode_prompt_string (*prompt_string_pointer) + : (char *)NULL; + + if (temp_prompt == 0) + { + temp_prompt = (char *)xmalloc (1); + temp_prompt[0] = '\0'; + } + + FREE (current_readline_prompt); + current_readline_prompt = temp_prompt; + } +} +#endif /* READLINE */ +#endif /* 0 */ + +#if defined (HISTORY) +/* A list of tokens which can be followed by newlines, but not by + semi-colons. When concatenating multiple lines of history, the + newline separator for such tokens is replaced with a space. */ +static const int no_semi_successors[] = { + '\n', '{', '(', ')', ';', '&', '|', + CASE, DO, ELSE, IF, SEMI_SEMI, SEMI_AND, SEMI_SEMI_AND, THEN, UNTIL, + WHILE, AND_AND, OR_OR, IN, + 0 +}; + +/* If we are not within a delimited expression, try to be smart + about which separators can be semi-colons and which must be + newlines. Returns the string that should be added into the + history entry. LINE is the line we're about to add; it helps + make some more intelligent decisions in certain cases. */ +char * +history_delimiting_chars (line) + const char *line; +{ + static int last_was_heredoc = 0; /* was the last entry the start of a here document? */ + register int i; + + if ((parser_state & PST_HEREDOC) == 0) + last_was_heredoc = 0; + + if (dstack.delimiter_depth != 0) + return ("\n"); + + /* We look for current_command_line_count == 2 because we are looking to + add the first line of the body of the here document (the second line + of the command). We also keep LAST_WAS_HEREDOC as a private sentinel + variable to note when we think we added the first line of a here doc + (the one with a "<<" somewhere in it) */ + if (parser_state & PST_HEREDOC) + { + if (last_was_heredoc) + { + last_was_heredoc = 0; + return "\n"; + } + return (current_command_line_count == 2 ? "\n" : ""); + } + + if (parser_state & PST_COMPASSIGN) + return (" "); + + /* First, handle some special cases. */ + /*(*/ + /* If we just read `()', assume it's a function definition, and don't + add a semicolon. If the token before the `)' was not `(', and we're + not in the midst of parsing a case statement, assume it's a + parenthesized command and add the semicolon. */ + /*)(*/ + if (token_before_that == ')') + { + if (two_tokens_ago == '(') /*)*/ /* function def */ + return " "; + /* This does not work for subshells inside case statement + command lists. It's a suboptimal solution. */ + else if (parser_state & PST_CASESTMT) /* case statement pattern */ + return " "; + else + return "; "; /* (...) subshell */ + } + else if (token_before_that == WORD && two_tokens_ago == FUNCTION) + return " "; /* function def using `function name' without `()' */ + + /* If we're not in a here document, but we think we're about to parse one, + and we would otherwise return a `;', return a newline to delimit the + line with the here-doc delimiter */ + else if ((parser_state & PST_HEREDOC) == 0 && current_command_line_count > 1 && last_read_token == '\n' && strstr (line, "<<")) + { + last_was_heredoc = 1; + return "\n"; + } + + else if (token_before_that == WORD && two_tokens_ago == FOR) + { + /* Tricky. `for i\nin ...' should not have a semicolon, but + `for i\ndo ...' should. We do what we can. */ + for (i = shell_input_line_index; whitespace (shell_input_line[i]); i++) + ; + if (shell_input_line[i] && shell_input_line[i] == 'i' && shell_input_line[i+1] == 'n') + return " "; + return ";"; + } + else if (two_tokens_ago == CASE && token_before_that == WORD && (parser_state & PST_CASESTMT)) + return " "; + + for (i = 0; no_semi_successors[i]; i++) + { + if (token_before_that == no_semi_successors[i]) + return (" "); + } + + return ("; "); +} +#endif /* HISTORY */ + +/* Issue a prompt, or prepare to issue a prompt when the next character + is read. */ +static void +prompt_again () +{ + char *temp_prompt; + + if (interactive == 0 || expanding_alias ()) /* XXX */ + return; + + ps1_prompt = get_string_value ("PS1"); + ps2_prompt = get_string_value ("PS2"); + + if (!prompt_string_pointer) + prompt_string_pointer = &ps1_prompt; + + temp_prompt = *prompt_string_pointer + ? decode_prompt_string (*prompt_string_pointer) + : (char *)NULL; + + if (temp_prompt == 0) + { + temp_prompt = (char *)xmalloc (1); + temp_prompt[0] = '\0'; + } + + current_prompt_string = *prompt_string_pointer; + prompt_string_pointer = &ps2_prompt; + +#if defined (READLINE) + if (!no_line_editing) + { + FREE (current_readline_prompt); + current_readline_prompt = temp_prompt; + } + else +#endif /* READLINE */ + { + FREE (current_decoded_prompt); + current_decoded_prompt = temp_prompt; + } +} + +int +get_current_prompt_level () +{ + return ((current_prompt_string && current_prompt_string == ps2_prompt) ? 2 : 1); +} + +void +set_current_prompt_level (x) + int x; +{ + prompt_string_pointer = (x == 2) ? &ps2_prompt : &ps1_prompt; + current_prompt_string = *prompt_string_pointer; +} + +static void +print_prompt () +{ + fprintf (stderr, "%s", current_decoded_prompt); + fflush (stderr); +} + +/* Return a string which will be printed as a prompt. The string + may contain special characters which are decoded as follows: + + \a bell (ascii 07) + \d the date in Day Mon Date format + \e escape (ascii 033) + \h the hostname up to the first `.' + \H the hostname + \j the number of active jobs + \l the basename of the shell's tty device name + \n CRLF + \r CR + \s the name of the shell + \t the time in 24-hour hh:mm:ss format + \T the time in 12-hour hh:mm:ss format + \@ the time in 12-hour hh:mm am/pm format + \A the time in 24-hour hh:mm format + \D{fmt} the result of passing FMT to strftime(3) + \u your username + \v the version of bash (e.g., 2.00) + \V the release of bash, version + patchlevel (e.g., 2.00.0) + \w the current working directory + \W the last element of $PWD + \! the history number of this command + \# the command number of this command + \$ a $ or a # if you are root + \nnn character code nnn in octal + \\ a backslash + \[ begin a sequence of non-printing chars + \] end a sequence of non-printing chars +*/ +#define PROMPT_GROWTH 48 +char * +decode_prompt_string (string) + char *string; +{ + WORD_LIST *list; + char *result, *t; + struct dstack save_dstack; + int last_exit_value, last_comsub_pid; +#if defined (PROMPT_STRING_DECODE) + int result_size, result_index; + int c, n, i; + char *temp, octal_string[4]; + struct tm *tm; + time_t the_time; + char timebuf[128]; + char *timefmt; + + result = (char *)xmalloc (result_size = PROMPT_GROWTH); + result[result_index = 0] = 0; + temp = (char *)NULL; + + while (c = *string++) + { + if (posixly_correct && c == '!') + { + if (*string == '!') + { + temp = savestring ("!"); + goto add_string; + } + else + { +#if !defined (HISTORY) + temp = savestring ("1"); +#else /* HISTORY */ + temp = itos (history_number ()); +#endif /* HISTORY */ + string--; /* add_string increments string again. */ + goto add_string; + } + } + if (c == '\\') + { + c = *string; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + strncpy (octal_string, string, 3); + octal_string[3] = '\0'; + + n = read_octal (octal_string); + temp = (char *)xmalloc (3); + + if (n == CTLESC || n == CTLNUL) + { + temp[0] = CTLESC; + temp[1] = n; + temp[2] = '\0'; + } + else if (n == -1) + { + temp[0] = '\\'; + temp[1] = '\0'; + } + else + { + temp[0] = n; + temp[1] = '\0'; + } + + for (c = 0; n != -1 && c < 3 && ISOCTAL (*string); c++) + string++; + + c = 0; /* tested at add_string: */ + goto add_string; + + case 'd': + case 't': + case 'T': + case '@': + case 'A': + /* Make the current time/date into a string. */ + (void) time (&the_time); +#if defined (HAVE_TZSET) + sv_tz ("TZ"); /* XXX -- just make sure */ +#endif + tm = localtime (&the_time); + + if (c == 'd') + n = strftime (timebuf, sizeof (timebuf), "%a %b %d", tm); + else if (c == 't') + n = strftime (timebuf, sizeof (timebuf), "%H:%M:%S", tm); + else if (c == 'T') + n = strftime (timebuf, sizeof (timebuf), "%I:%M:%S", tm); + else if (c == '@') + n = strftime (timebuf, sizeof (timebuf), "%I:%M %p", tm); + else if (c == 'A') + n = strftime (timebuf, sizeof (timebuf), "%H:%M", tm); + + if (n == 0) + timebuf[0] = '\0'; + else + timebuf[sizeof(timebuf) - 1] = '\0'; + + temp = savestring (timebuf); + goto add_string; + + case 'D': /* strftime format */ + if (string[1] != '{') /* } */ + goto not_escape; + + (void) time (&the_time); + tm = localtime (&the_time); + string += 2; /* skip { */ + timefmt = xmalloc (strlen (string) + 3); + for (t = timefmt; *string && *string != '}'; ) + *t++ = *string++; + *t = '\0'; + c = *string; /* tested at add_string */ + if (timefmt[0] == '\0') + { + timefmt[0] = '%'; + timefmt[1] = 'X'; /* locale-specific current time */ + timefmt[2] = '\0'; + } + n = strftime (timebuf, sizeof (timebuf), timefmt, tm); + free (timefmt); + + if (n == 0) + timebuf[0] = '\0'; + else + timebuf[sizeof(timebuf) - 1] = '\0'; + + if (promptvars || posixly_correct) + /* Make sure that expand_prompt_string is called with a + second argument of Q_DOUBLE_QUOTES if we use this + function here. */ + temp = sh_backslash_quote_for_double_quotes (timebuf); + else + temp = savestring (timebuf); + goto add_string; + + case 'n': + temp = (char *)xmalloc (3); + temp[0] = no_line_editing ? '\n' : '\r'; + temp[1] = no_line_editing ? '\0' : '\n'; + temp[2] = '\0'; + goto add_string; + + case 's': + temp = base_pathname (shell_name); + temp = savestring (temp); + goto add_string; + + case 'v': + case 'V': + temp = (char *)xmalloc (16); + if (c == 'v') + strcpy (temp, dist_version); + else + sprintf (temp, "%s.%d", dist_version, patch_level); + goto add_string; + + case 'w': + case 'W': + { + /* Use the value of PWD because it is much more efficient. */ + char t_string[PATH_MAX]; + int tlen; + + temp = get_string_value ("PWD"); + + if (temp == 0) + { + if (getcwd (t_string, sizeof(t_string)) == 0) + { + t_string[0] = '.'; + tlen = 1; + } + else + tlen = strlen (t_string); + } + else + { + tlen = sizeof (t_string) - 1; + strncpy (t_string, temp, tlen); + } + t_string[tlen] = '\0'; + +#if defined (MACOSX) + /* Convert from "fs" format to "input" format */ + temp = fnx_fromfs (t_string, strlen (t_string)); + if (temp != t_string) + strcpy (t_string, temp); +#endif + +#define ROOT_PATH(x) ((x)[0] == '/' && (x)[1] == 0) +#define DOUBLE_SLASH_ROOT(x) ((x)[0] == '/' && (x)[1] == '/' && (x)[2] == 0) + /* Abbreviate \W as ~ if $PWD == $HOME */ + if (c == 'W' && (((t = get_string_value ("HOME")) == 0) || STREQ (t, t_string) == 0)) + { + if (ROOT_PATH (t_string) == 0 && DOUBLE_SLASH_ROOT (t_string) == 0) + { + t = strrchr (t_string, '/'); + if (t) + memmove (t_string, t + 1, strlen (t)); /* strlen(t) to copy NULL */ + } + } +#undef ROOT_PATH +#undef DOUBLE_SLASH_ROOT + else + { + /* polite_directory_format is guaranteed to return a string + no longer than PATH_MAX - 1 characters. */ + temp = polite_directory_format (t_string); + if (temp != t_string) + strcpy (t_string, temp); + } + + temp = trim_pathname (t_string, PATH_MAX - 1); + /* If we're going to be expanding the prompt string later, + quote the directory name. */ + if (promptvars || posixly_correct) + /* Make sure that expand_prompt_string is called with a + second argument of Q_DOUBLE_QUOTES if we use this + function here. */ + temp = sh_backslash_quote_for_double_quotes (t_string); + else + temp = savestring (t_string); + + goto add_string; + } + + case 'u': + if (current_user.user_name == 0) + get_current_user_info (); + temp = savestring (current_user.user_name); + goto add_string; + + case 'h': + case 'H': + temp = savestring (current_host_name); + if (c == 'h' && (t = (char *)strchr (temp, '.'))) + *t = '\0'; + goto add_string; + + case '#': + temp = itos (current_command_number); + goto add_string; + + case '!': +#if !defined (HISTORY) + temp = savestring ("1"); +#else /* HISTORY */ + temp = itos (history_number ()); +#endif /* HISTORY */ + goto add_string; + + case '$': + t = temp = (char *)xmalloc (3); + if ((promptvars || posixly_correct) && (current_user.euid != 0)) + *t++ = '\\'; + *t++ = current_user.euid == 0 ? '#' : '$'; + *t = '\0'; + goto add_string; + + case 'j': + temp = itos (count_all_jobs ()); + goto add_string; + + case 'l': +#if defined (HAVE_TTYNAME) + temp = (char *)ttyname (fileno (stdin)); + t = temp ? base_pathname (temp) : "tty"; + temp = savestring (t); +#else + temp = savestring ("tty"); +#endif /* !HAVE_TTYNAME */ + goto add_string; + +#if defined (READLINE) + case '[': + case ']': + if (no_line_editing) + { + string++; + break; + } + temp = (char *)xmalloc (3); + n = (c == '[') ? RL_PROMPT_START_IGNORE : RL_PROMPT_END_IGNORE; + i = 0; + if (n == CTLESC || n == CTLNUL) + temp[i++] = CTLESC; + temp[i++] = n; + temp[i] = '\0'; + goto add_string; +#endif /* READLINE */ + + case '\\': + case 'a': + case 'e': + case 'r': + temp = (char *)xmalloc (2); + if (c == 'a') + temp[0] = '\07'; + else if (c == 'e') + temp[0] = '\033'; + else if (c == 'r') + temp[0] = '\r'; + else /* (c == '\\') */ + temp[0] = c; + temp[1] = '\0'; + goto add_string; + + default: +not_escape: + temp = (char *)xmalloc (3); + temp[0] = '\\'; + temp[1] = c; + temp[2] = '\0'; + + add_string: + if (c) + string++; + result = + sub_append_string (temp, result, &result_index, &result_size); + temp = (char *)NULL; /* Freed in sub_append_string (). */ + result[result_index] = '\0'; + break; + } + } + else + { + RESIZE_MALLOCED_BUFFER (result, result_index, 3, result_size, PROMPT_GROWTH); + result[result_index++] = c; + result[result_index] = '\0'; + } + } +#else /* !PROMPT_STRING_DECODE */ + result = savestring (string); +#endif /* !PROMPT_STRING_DECODE */ + + /* Save the delimiter stack and point `dstack' to temp space so any + command substitutions in the prompt string won't result in screwing + up the parser's quoting state. */ + save_dstack = dstack; + dstack = temp_dstack; + dstack.delimiter_depth = 0; + + /* Perform variable and parameter expansion and command substitution on + the prompt string. */ + if (promptvars || posixly_correct) + { + last_exit_value = last_command_exit_value; + last_comsub_pid = last_command_subst_pid; + list = expand_prompt_string (result, Q_DOUBLE_QUOTES, 0); + free (result); + result = string_list (list); + dispose_words (list); + last_command_exit_value = last_exit_value; + last_command_subst_pid = last_comsub_pid; + } + else + { + t = dequote_string (result); + free (result); + result = t; + } + + dstack = save_dstack; + + return (result); +} + +/************************************************ + * * + * ERROR HANDLING * + * * + ************************************************/ + +/* Report a syntax error, and restart the parser. Call here for fatal + errors. */ +int +yyerror (msg) + const char *msg; +{ + report_syntax_error ((char *)NULL); + reset_parser (); + return (0); +} + +static char * +error_token_from_token (tok) + int tok; +{ + char *t; + + if (t = find_token_in_alist (tok, word_token_alist, 0)) + return t; + + if (t = find_token_in_alist (tok, other_token_alist, 0)) + return t; + + t = (char *)NULL; + /* This stuff is dicy and needs closer inspection */ + switch (current_token) + { + case WORD: + case ASSIGNMENT_WORD: + if (yylval.word) + t = savestring (yylval.word->word); + break; + case NUMBER: + t = itos (yylval.number); + break; + case ARITH_CMD: + if (yylval.word_list) + t = string_list (yylval.word_list); + break; + case ARITH_FOR_EXPRS: + if (yylval.word_list) + t = string_list_internal (yylval.word_list, " ; "); + break; + case COND_CMD: + t = (char *)NULL; /* punt */ + break; + } + + return t; +} + +static char * +error_token_from_text () +{ + char *msg, *t; + int token_end, i; + + t = shell_input_line; + i = shell_input_line_index; + token_end = 0; + msg = (char *)NULL; + + if (i && t[i] == '\0') + i--; + + while (i && (whitespace (t[i]) || t[i] == '\n')) + i--; + + if (i) + token_end = i + 1; + + while (i && (member (t[i], " \n\t;|&") == 0)) + i--; + + while (i != token_end && (whitespace (t[i]) || t[i] == '\n')) + i++; + + /* Return our idea of the offending token. */ + if (token_end || (i == 0 && token_end == 0)) + { + if (token_end) + msg = substring (t, i, token_end); + else /* one-character token */ + { + msg = (char *)xmalloc (2); + msg[0] = t[i]; + msg[1] = '\0'; + } + } + + return (msg); +} + +static void +print_offending_line () +{ + char *msg; + int token_end; + + msg = savestring (shell_input_line); + token_end = strlen (msg); + while (token_end && msg[token_end - 1] == '\n') + msg[--token_end] = '\0'; + + parser_error (line_number, "`%s'", msg); + free (msg); +} + +/* Report a syntax error with line numbers, etc. + Call here for recoverable errors. If you have a message to print, + then place it in MESSAGE, otherwise pass NULL and this will figure + out an appropriate message for you. */ +static void +report_syntax_error (message) + char *message; +{ + char *msg, *p; + + if (message) + { + parser_error (line_number, "%s", message); + if (interactive && EOF_Reached) + EOF_Reached = 0; + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; + return; + } + + /* If the line of input we're reading is not null, try to find the + objectionable token. First, try to figure out what token the + parser's complaining about by looking at current_token. */ + if (current_token != 0 && EOF_Reached == 0 && (msg = error_token_from_token (current_token))) + { + if (ansic_shouldquote (msg)) + { + p = ansic_quote (msg, 0, NULL); + free (msg); + msg = p; + } + parser_error (line_number, _("syntax error near unexpected token `%s'"), msg); + free (msg); + + if (interactive == 0) + print_offending_line (); + + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; + return; + } + + /* If looking at the current token doesn't prove fruitful, try to find the + offending token by analyzing the text of the input line near the current + input line index and report what we find. */ + if (shell_input_line && *shell_input_line) + { + msg = error_token_from_text (); + if (msg) + { + parser_error (line_number, _("syntax error near `%s'"), msg); + free (msg); + } + + /* If not interactive, print the line containing the error. */ + if (interactive == 0) + print_offending_line (); + } + else + { + msg = EOF_Reached ? _("syntax error: unexpected end of file") : _("syntax error"); + parser_error (line_number, "%s", msg); + /* When the shell is interactive, this file uses EOF_Reached + only for error reporting. Other mechanisms are used to + decide whether or not to exit. */ + if (interactive && EOF_Reached) + EOF_Reached = 0; + } + + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; +} + +/* ??? Needed function. ??? We have to be able to discard the constructs + created during parsing. In the case of error, we want to return + allocated objects to the memory pool. In the case of no error, we want + to throw away the information about where the allocated objects live. + (dispose_command () will actually free the command.) */ +static void +discard_parser_constructs (error_p) + int error_p; +{ +} + +/************************************************ + * * + * EOF HANDLING * + * * + ************************************************/ + +/* Do that silly `type "bye" to exit' stuff. You know, "ignoreeof". */ + +/* A flag denoting whether or not ignoreeof is set. */ +int ignoreeof = 0; + +/* The number of times that we have encountered an EOF character without + another character intervening. When this gets above the limit, the + shell terminates. */ +int eof_encountered = 0; + +/* The limit for eof_encountered. */ +int eof_encountered_limit = 10; + +/* If we have EOF as the only input unit, this user wants to leave + the shell. If the shell is not interactive, then just leave. + Otherwise, if ignoreeof is set, and we haven't done this the + required number of times in a row, print a message. */ +static void +handle_eof_input_unit () +{ + if (interactive) + { + /* shell.c may use this to decide whether or not to write out the + history, among other things. We use it only for error reporting + in this file. */ + if (EOF_Reached) + EOF_Reached = 0; + + /* If the user wants to "ignore" eof, then let her do so, kind of. */ + if (ignoreeof) + { + if (eof_encountered < eof_encountered_limit) + { + fprintf (stderr, _("Use \"%s\" to leave the shell.\n"), + login_shell ? "logout" : "exit"); + eof_encountered++; + /* Reset the parsing state. */ + last_read_token = current_token = '\n'; + /* Reset the prompt string to be $PS1. */ + prompt_string_pointer = (char **)NULL; + prompt_again (); + return; + } + } + + /* In this case EOF should exit the shell. Do it now. */ + reset_parser (); + exit_builtin ((WORD_LIST *)NULL); + } + else + { + /* We don't write history files, etc., for non-interactive shells. */ + EOF_Reached = 1; + } +} + +/************************************************ + * * + * STRING PARSING FUNCTIONS * + * * + ************************************************/ + +/* It's very important that these two functions treat the characters + between ( and ) identically. */ + +static WORD_LIST parse_string_error; + +/* Take a string and run it through the shell parser, returning the + resultant word list. Used by compound array assignment. */ +WORD_LIST * +parse_string_to_word_list (s, flags, whom) + char *s; + int flags; + const char *whom; +{ + WORD_LIST *wl; + int tok, orig_current_token, orig_line_number, orig_input_terminator; + int orig_line_count; + int old_echo_input, old_expand_aliases; +#if defined (HISTORY) + int old_remember_on_history, old_history_expansion_inhibited; +#endif + +#if defined (HISTORY) + old_remember_on_history = remember_on_history; +# if defined (BANG_HISTORY) + old_history_expansion_inhibited = history_expansion_inhibited; +# endif + bash_history_disable (); +#endif + + orig_line_number = line_number; + orig_line_count = current_command_line_count; + orig_input_terminator = shell_input_line_terminator; + old_echo_input = echo_input_at_read; + old_expand_aliases = expand_aliases; + + push_stream (1); + last_read_token = WORD; /* WORD to allow reserved words here */ + current_command_line_count = 0; + echo_input_at_read = expand_aliases = 0; + + with_input_from_string (s, whom); + wl = (WORD_LIST *)NULL; + + if (flags & 1) + parser_state |= PST_COMPASSIGN|PST_REPARSE; + + while ((tok = read_token (READ)) != yacc_EOF) + { + if (tok == '\n' && *bash_input.location.string == '\0') + break; + if (tok == '\n') /* Allow newlines in compound assignments */ + continue; + if (tok != WORD && tok != ASSIGNMENT_WORD) + { + line_number = orig_line_number + line_number - 1; + orig_current_token = current_token; + current_token = tok; + yyerror (NULL); /* does the right thing */ + current_token = orig_current_token; + if (wl) + dispose_words (wl); + wl = &parse_string_error; + break; + } + wl = make_word_list (yylval.word, wl); + } + + last_read_token = '\n'; + pop_stream (); + +#if defined (HISTORY) + remember_on_history = old_remember_on_history; +# if defined (BANG_HISTORY) + history_expansion_inhibited = old_history_expansion_inhibited; +# endif /* BANG_HISTORY */ +#endif /* HISTORY */ + + echo_input_at_read = old_echo_input; + expand_aliases = old_expand_aliases; + + current_command_line_count = orig_line_count; + shell_input_line_terminator = orig_input_terminator; + + if (flags & 1) + parser_state &= ~(PST_COMPASSIGN|PST_REPARSE); + + if (wl == &parse_string_error) + { + last_command_exit_value = EXECUTION_FAILURE; + if (interactive_shell == 0 && posixly_correct) + jump_to_top_level (FORCE_EOF); + else + jump_to_top_level (DISCARD); + } + + return (REVERSE_LIST (wl, WORD_LIST *)); +} + +static char * +parse_compound_assignment (retlenp) + int *retlenp; +{ + WORD_LIST *wl, *rl; + int tok, orig_line_number, orig_token_size, orig_last_token, assignok; + char *saved_token, *ret; + + saved_token = token; + orig_token_size = token_buffer_size; + orig_line_number = line_number; + orig_last_token = last_read_token; + + last_read_token = WORD; /* WORD to allow reserved words here */ + + token = (char *)NULL; + token_buffer_size = 0; + + assignok = parser_state&PST_ASSIGNOK; /* XXX */ + + wl = (WORD_LIST *)NULL; /* ( */ + parser_state |= PST_COMPASSIGN; + + while ((tok = read_token (READ)) != ')') + { + if (tok == '\n') /* Allow newlines in compound assignments */ + { + if (SHOULD_PROMPT ()) + prompt_again (); + continue; + } + if (tok != WORD && tok != ASSIGNMENT_WORD) + { + current_token = tok; /* for error reporting */ + if (tok == yacc_EOF) /* ( */ + parser_error (orig_line_number, _("unexpected EOF while looking for matching `)'")); + else + yyerror(NULL); /* does the right thing */ + if (wl) + dispose_words (wl); + wl = &parse_string_error; + break; + } + wl = make_word_list (yylval.word, wl); + } + + FREE (token); + token = saved_token; + token_buffer_size = orig_token_size; + + parser_state &= ~PST_COMPASSIGN; + + if (wl == &parse_string_error) + { + last_command_exit_value = EXECUTION_FAILURE; + last_read_token = '\n'; /* XXX */ + if (interactive_shell == 0 && posixly_correct) + jump_to_top_level (FORCE_EOF); + else + jump_to_top_level (DISCARD); + } + + last_read_token = orig_last_token; /* XXX - was WORD? */ + + if (wl) + { + rl = REVERSE_LIST (wl, WORD_LIST *); + ret = string_list (rl); + dispose_words (rl); + } + else + ret = (char *)NULL; + + if (retlenp) + *retlenp = (ret && *ret) ? strlen (ret) : 0; + + if (assignok) + parser_state |= PST_ASSIGNOK; + + return ret; +} + +/************************************************ + * * + * SAVING AND RESTORING PARTIAL PARSE STATE * + * * + ************************************************/ + +sh_parser_state_t * +save_parser_state (ps) + sh_parser_state_t *ps; +{ + if (ps == 0) + ps = (sh_parser_state_t *)xmalloc (sizeof (sh_parser_state_t)); + if (ps == 0) + return ((sh_parser_state_t *)NULL); + + ps->parser_state = parser_state; + ps->token_state = save_token_state (); + + ps->input_line_terminator = shell_input_line_terminator; + ps->eof_encountered = eof_encountered; + + ps->prompt_string_pointer = prompt_string_pointer; + + ps->current_command_line_count = current_command_line_count; + +#if defined (HISTORY) + ps->remember_on_history = remember_on_history; +# if defined (BANG_HISTORY) + ps->history_expansion_inhibited = history_expansion_inhibited; +# endif +#endif + + ps->last_command_exit_value = last_command_exit_value; +#if defined (ARRAY_VARS) + ps->pipestatus = save_pipestatus_array (); +#endif + + ps->last_shell_builtin = last_shell_builtin; + ps->this_shell_builtin = this_shell_builtin; + + ps->expand_aliases = expand_aliases; + ps->echo_input_at_read = echo_input_at_read; + + ps->token = token; + ps->token_buffer_size = token_buffer_size; + /* Force reallocation on next call to read_token_word */ + token = 0; + token_buffer_size = 0; + + return (ps); +} + +void +restore_parser_state (ps) + sh_parser_state_t *ps; +{ + if (ps == 0) + return; + + parser_state = ps->parser_state; + if (ps->token_state) + { + restore_token_state (ps->token_state); + free (ps->token_state); + } + + shell_input_line_terminator = ps->input_line_terminator; + eof_encountered = ps->eof_encountered; + + prompt_string_pointer = ps->prompt_string_pointer; + + current_command_line_count = ps->current_command_line_count; + +#if defined (HISTORY) + remember_on_history = ps->remember_on_history; +# if defined (BANG_HISTORY) + history_expansion_inhibited = ps->history_expansion_inhibited; +# endif +#endif + + last_command_exit_value = ps->last_command_exit_value; +#if defined (ARRAY_VARS) + restore_pipestatus_array (ps->pipestatus); +#endif + + last_shell_builtin = ps->last_shell_builtin; + this_shell_builtin = ps->this_shell_builtin; + + expand_aliases = ps->expand_aliases; + echo_input_at_read = ps->echo_input_at_read; + + FREE (token); + token = ps->token; + token_buffer_size = ps->token_buffer_size; +} + +sh_input_line_state_t * +save_input_line_state (ls) + sh_input_line_state_t *ls; +{ + if (ls == 0) + ls = (sh_input_line_state_t *)xmalloc (sizeof (sh_input_line_state_t)); + if (ls == 0) + return ((sh_input_line_state_t *)NULL); + + ls->input_line = shell_input_line; + ls->input_line_size = shell_input_line_size; + ls->input_line_len = shell_input_line_len; + ls->input_line_index = shell_input_line_index; + + /* force reallocation */ + shell_input_line = 0; + shell_input_line_size = shell_input_line_len = shell_input_line_index = 0; + + return ls; +} + +void +restore_input_line_state (ls) + sh_input_line_state_t *ls; +{ + FREE (shell_input_line); + shell_input_line = ls->input_line; + shell_input_line_size = ls->input_line_size; + shell_input_line_len = ls->input_line_len; + shell_input_line_index = ls->input_line_index; + + set_line_mbstate (); +} + +/************************************************ + * * + * MULTIBYTE CHARACTER HANDLING * + * * + ************************************************/ + +#if defined (HANDLE_MULTIBYTE) +static void +set_line_mbstate () +{ + int c; + size_t i, previ, len; + mbstate_t mbs, prevs; + size_t mbclen; + + if (shell_input_line == NULL) + return; + len = strlen (shell_input_line); /* XXX - shell_input_line_len ? */ + FREE (shell_input_line_property); + shell_input_line_property = (char *)xmalloc (len + 1); + + memset (&prevs, '\0', sizeof (mbstate_t)); + for (i = previ = 0; i < len; i++) + { + mbs = prevs; + + c = shell_input_line[i]; + if (c == EOF) + { + size_t j; + for (j = i; j < len; j++) + shell_input_line_property[j] = 1; + break; + } + + mbclen = mbrlen (shell_input_line + previ, i - previ + 1, &mbs); + if (mbclen == 1 || mbclen == (size_t)-1) + { + mbclen = 1; + previ = i + 1; + } + else if (mbclen == (size_t)-2) + mbclen = 0; + else if (mbclen > 1) + { + mbclen = 0; + previ = i + 1; + prevs = mbs; + } + else + { + /* XXX - what to do if mbrlen returns 0? (null wide character) */ + size_t j; + for (j = i; j < len; j++) + shell_input_line_property[j] = 1; + break; + } + + shell_input_line_property[i] = mbclen; + } +} +#endif /* HANDLE_MULTIBYTE */ diff --git a/.pc/bash43-009.diff/patchlevel.h b/.pc/bash43-009.diff/patchlevel.h new file mode 100644 index 0000000..4099c48 --- /dev/null +++ b/.pc/bash43-009.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 8 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-009.diff/y.tab.c b/.pc/bash43-009.diff/y.tab.c new file mode 100644 index 0000000..709a56a --- /dev/null +++ b/.pc/bash43-009.diff/y.tab.c @@ -0,0 +1,8540 @@ +/* A Bison parser, made by GNU Bison 2.3. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.3" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + IF = 258, + THEN = 259, + ELSE = 260, + ELIF = 261, + FI = 262, + CASE = 263, + ESAC = 264, + FOR = 265, + SELECT = 266, + WHILE = 267, + UNTIL = 268, + DO = 269, + DONE = 270, + FUNCTION = 271, + COPROC = 272, + COND_START = 273, + COND_END = 274, + COND_ERROR = 275, + IN = 276, + BANG = 277, + TIME = 278, + TIMEOPT = 279, + TIMEIGN = 280, + WORD = 281, + ASSIGNMENT_WORD = 282, + REDIR_WORD = 283, + NUMBER = 284, + ARITH_CMD = 285, + ARITH_FOR_EXPRS = 286, + COND_CMD = 287, + AND_AND = 288, + OR_OR = 289, + GREATER_GREATER = 290, + LESS_LESS = 291, + LESS_AND = 292, + LESS_LESS_LESS = 293, + GREATER_AND = 294, + SEMI_SEMI = 295, + SEMI_AND = 296, + SEMI_SEMI_AND = 297, + LESS_LESS_MINUS = 298, + AND_GREATER = 299, + AND_GREATER_GREATER = 300, + LESS_GREATER = 301, + GREATER_BAR = 302, + BAR_AND = 303, + yacc_EOF = 304 + }; +#endif +/* Tokens. */ +#define IF 258 +#define THEN 259 +#define ELSE 260 +#define ELIF 261 +#define FI 262 +#define CASE 263 +#define ESAC 264 +#define FOR 265 +#define SELECT 266 +#define WHILE 267 +#define UNTIL 268 +#define DO 269 +#define DONE 270 +#define FUNCTION 271 +#define COPROC 272 +#define COND_START 273 +#define COND_END 274 +#define COND_ERROR 275 +#define IN 276 +#define BANG 277 +#define TIME 278 +#define TIMEOPT 279 +#define TIMEIGN 280 +#define WORD 281 +#define ASSIGNMENT_WORD 282 +#define REDIR_WORD 283 +#define NUMBER 284 +#define ARITH_CMD 285 +#define ARITH_FOR_EXPRS 286 +#define COND_CMD 287 +#define AND_AND 288 +#define OR_OR 289 +#define GREATER_GREATER 290 +#define LESS_LESS 291 +#define LESS_AND 292 +#define LESS_LESS_LESS 293 +#define GREATER_AND 294 +#define SEMI_SEMI 295 +#define SEMI_AND 296 +#define SEMI_SEMI_AND 297 +#define LESS_LESS_MINUS 298 +#define AND_GREATER 299 +#define AND_GREATER_GREATER 300 +#define LESS_GREATER 301 +#define GREATER_BAR 302 +#define BAR_AND 303 +#define yacc_EOF 304 + + + + +/* Copy the first part of user declarations. */ +#line 21 "/usr/homes/chet/src/bash/src/parse.y" + +#include "config.h" + +#include "bashtypes.h" +#include "bashansi.h" + +#include "filecntl.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (HAVE_LOCALE_H) +# include +#endif + +#include +#include "chartypes.h" +#include + +#include "memalloc.h" + +#include "bashintl.h" + +#define NEED_STRFTIME_DECL /* used in externs.h */ + +#include "shell.h" +#include "typemax.h" /* SIZE_MAX if needed */ +#include "trap.h" +#include "flags.h" +#include "parser.h" +#include "mailcheck.h" +#include "test.h" +#include "builtins.h" +#include "builtins/common.h" +#include "builtins/builtext.h" + +#include "shmbutil.h" + +#if defined (READLINE) +# include "bashline.h" +# include +#endif /* READLINE */ + +#if defined (HISTORY) +# include "bashhist.h" +# include +#endif /* HISTORY */ + +#if defined (JOB_CONTROL) +# include "jobs.h" +#endif /* JOB_CONTROL */ + +#if defined (ALIAS) +# include "alias.h" +#else +typedef void *alias_t; +#endif /* ALIAS */ + +#if defined (PROMPT_STRING_DECODE) +# ifndef _MINIX +# include +# endif +# include +# if defined (TM_IN_SYS_TIME) +# include +# include +# endif /* TM_IN_SYS_TIME */ +# include "maxpath.h" +#endif /* PROMPT_STRING_DECODE */ + +#define RE_READ_TOKEN -99 +#define NO_EXPANSION -100 + +#ifdef DEBUG +# define YYDEBUG 1 +#else +# define YYDEBUG 0 +#endif + +#if defined (HANDLE_MULTIBYTE) +# define last_shell_getc_is_singlebyte \ + ((shell_input_line_index > 1) \ + ? shell_input_line_property[shell_input_line_index - 1] \ + : 1) +# define MBTEST(x) ((x) && last_shell_getc_is_singlebyte) +#else +# define last_shell_getc_is_singlebyte 1 +# define MBTEST(x) ((x)) +#endif + +#if defined (EXTENDED_GLOB) +extern int extended_glob; +#endif + +extern int eof_encountered; +extern int no_line_editing, running_under_emacs; +extern int current_command_number; +extern int sourcelevel, parse_and_execute_level; +extern int posixly_correct; +extern int last_command_exit_value; +extern pid_t last_command_subst_pid; +extern char *shell_name, *current_host_name; +extern char *dist_version; +extern int patch_level; +extern int dump_translatable_strings, dump_po_strings; +extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin; +#if defined (BUFFERED_INPUT) +extern int bash_input_fd_changed; +#endif + +extern int errno; +/* **************************************************************** */ +/* */ +/* "Forward" declarations */ +/* */ +/* **************************************************************** */ + +#ifdef DEBUG +static void debug_parser __P((int)); +#endif + +static int yy_getc __P((void)); +static int yy_ungetc __P((int)); + +#if defined (READLINE) +static int yy_readline_get __P((void)); +static int yy_readline_unget __P((int)); +#endif + +static int yy_string_get __P((void)); +static int yy_string_unget __P((int)); +static void rewind_input_string __P((void)); +static int yy_stream_get __P((void)); +static int yy_stream_unget __P((int)); + +static int shell_getc __P((int)); +static void shell_ungetc __P((int)); +static void discard_until __P((int)); + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) +static void push_string __P((char *, int, alias_t *)); +static void pop_string __P((void)); +static void free_string_list __P((void)); +#endif + +static char *read_a_line __P((int)); + +static int reserved_word_acceptable __P((int)); +static int yylex __P((void)); +static int alias_expand_token __P((char *)); +static int time_command_acceptable __P((void)); +static int special_case_tokens __P((char *)); +static int read_token __P((int)); +static char *parse_matched_pair __P((int, int, int, int *, int)); +static char *parse_comsub __P((int, int, int, int *, int)); +#if defined (ARRAY_VARS) +static char *parse_compound_assignment __P((int *)); +#endif +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) +static int parse_dparen __P((int)); +static int parse_arith_cmd __P((char **, int)); +#endif +#if defined (COND_COMMAND) +static void cond_error __P((void)); +static COND_COM *cond_expr __P((void)); +static COND_COM *cond_or __P((void)); +static COND_COM *cond_and __P((void)); +static COND_COM *cond_term __P((void)); +static int cond_skip_newlines __P((void)); +static COMMAND *parse_cond_command __P((void)); +#endif +#if defined (ARRAY_VARS) +static int token_is_assignment __P((char *, int)); +static int token_is_ident __P((char *, int)); +#endif +static int read_token_word __P((int)); +static void discard_parser_constructs __P((int)); + +static char *error_token_from_token __P((int)); +static char *error_token_from_text __P((void)); +static void print_offending_line __P((void)); +static void report_syntax_error __P((char *)); + +static void handle_eof_input_unit __P((void)); +static void prompt_again __P((void)); +#if 0 +static void reset_readline_prompt __P((void)); +#endif +static void print_prompt __P((void)); + +#if defined (HANDLE_MULTIBYTE) +static void set_line_mbstate __P((void)); +static char *shell_input_line_property = NULL; +#else +# define set_line_mbstate() +#endif + +extern int yyerror __P((const char *)); + +#ifdef DEBUG +extern int yydebug; +#endif + +/* Default prompt strings */ +char *primary_prompt = PPROMPT; +char *secondary_prompt = SPROMPT; + +/* PROMPT_STRING_POINTER points to one of these, never to an actual string. */ +char *ps1_prompt, *ps2_prompt; + +/* Handle on the current prompt string. Indirectly points through + ps1_ or ps2_prompt. */ +char **prompt_string_pointer = (char **)NULL; +char *current_prompt_string; + +/* Non-zero means we expand aliases in commands. */ +int expand_aliases = 0; + +/* If non-zero, the decoded prompt string undergoes parameter and + variable substitution, command substitution, arithmetic substitution, + string expansion, process substitution, and quote removal in + decode_prompt_string. */ +int promptvars = 1; + +/* If non-zero, $'...' and $"..." are expanded when they appear within + a ${...} expansion, even when the expansion appears within double + quotes. */ +int extended_quote = 1; + +/* The number of lines read from input while creating the current command. */ +int current_command_line_count; + +/* The number of lines in a command saved while we run parse_and_execute */ +int saved_command_line_count; + +/* The token that currently denotes the end of parse. */ +int shell_eof_token; + +/* The token currently being read. */ +int current_token; + +/* The current parser state. */ +int parser_state; + +/* Variables to manage the task of reading here documents, because we need to + defer the reading until after a complete command has been collected. */ +static REDIRECT *redir_stack[10]; +int need_here_doc; + +/* Where shell input comes from. History expansion is performed on each + line when the shell is interactive. */ +static char *shell_input_line = (char *)NULL; +static size_t shell_input_line_index; +static size_t shell_input_line_size; /* Amount allocated for shell_input_line. */ +static size_t shell_input_line_len; /* strlen (shell_input_line) */ + +/* Either zero or EOF. */ +static int shell_input_line_terminator; + +/* The line number in a script on which a function definition starts. */ +static int function_dstart; + +/* The line number in a script on which a function body starts. */ +static int function_bstart; + +/* The line number in a script at which an arithmetic for command starts. */ +static int arith_for_lineno; + +/* The decoded prompt string. Used if READLINE is not defined or if + editing is turned off. Analogous to current_readline_prompt. */ +static char *current_decoded_prompt; + +/* The last read token, or NULL. read_token () uses this for context + checking. */ +static int last_read_token; + +/* The token read prior to last_read_token. */ +static int token_before_that; + +/* The token read prior to token_before_that. */ +static int two_tokens_ago; + +static int global_extglob; + +/* The line number in a script where the word in a `case WORD', `select WORD' + or `for WORD' begins. This is a nested command maximum, since the array + index is decremented after a case, select, or for command is parsed. */ +#define MAX_CASE_NEST 128 +static int word_lineno[MAX_CASE_NEST]; +static int word_top = -1; + +/* If non-zero, it is the token that we want read_token to return + regardless of what text is (or isn't) present to be read. This + is reset by read_token. If token_to_read == WORD or + ASSIGNMENT_WORD, yylval.word should be set to word_desc_to_read. */ +static int token_to_read; +static WORD_DESC *word_desc_to_read; + +static REDIRECTEE source; +static REDIRECTEE redir; + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 324 "/usr/homes/chet/src/bash/src/parse.y" +{ + WORD_DESC *word; /* the word that we read. */ + int number; /* the number that we read. */ + WORD_LIST *word_list; + COMMAND *command; + REDIRECT *redirect; + ELEMENT element; + PATTERN_LIST *pattern; +} +/* Line 193 of yacc.c. */ +#line 507 "y.tab.c" + YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + + + +/* Copy the second part of user declarations. */ + + +/* Line 216 of yacc.c. */ +#line 520 "y.tab.c" + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss; + YYSTYPE yyvs; + }; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 116 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 659 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 61 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 38 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 167 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 342 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 304 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 51, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 49, 2, + 59, 60, 2, 2, 2, 56, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 50, + 55, 2, 54, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 57, 53, 58, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 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, 52 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 6, 8, 11, 13, 15, 18, 21, + 24, 28, 32, 36, 40, 43, 47, 51, 54, 58, + 62, 65, 69, 73, 76, 80, 84, 87, 91, 95, + 98, 102, 106, 109, 113, 117, 120, 124, 128, 131, + 135, 139, 142, 146, 150, 153, 157, 161, 164, 168, + 172, 175, 178, 180, 182, 184, 186, 189, 191, 194, + 196, 198, 201, 203, 205, 207, 209, 215, 221, 223, + 225, 227, 229, 231, 233, 235, 242, 249, 257, 265, + 276, 287, 297, 307, 315, 323, 329, 335, 342, 349, + 357, 365, 376, 387, 394, 402, 409, 415, 422, 427, + 429, 432, 436, 439, 443, 447, 452, 455, 461, 469, + 476, 480, 482, 486, 491, 498, 504, 506, 509, 514, + 519, 525, 531, 534, 538, 541, 545, 548, 552, 554, + 558, 561, 563, 566, 570, 574, 578, 583, 588, 593, + 598, 603, 605, 607, 609, 611, 613, 615, 616, 619, + 621, 624, 627, 632, 637, 641, 645, 647, 649, 652, + 655, 658, 661, 666, 671, 673, 675, 678 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int8 yyrhs[] = +{ + 62, 0, -1, 94, 91, -1, 51, -1, 1, 51, + -1, 52, -1, 26, -1, 63, 26, -1, 54, 26, + -1, 55, 26, -1, 29, 54, 26, -1, 29, 55, + 26, -1, 28, 54, 26, -1, 28, 55, 26, -1, + 35, 26, -1, 29, 35, 26, -1, 28, 35, 26, + -1, 47, 26, -1, 29, 47, 26, -1, 28, 47, + 26, -1, 46, 26, -1, 29, 46, 26, -1, 28, + 46, 26, -1, 36, 26, -1, 29, 36, 26, -1, + 28, 36, 26, -1, 43, 26, -1, 29, 43, 26, + -1, 28, 43, 26, -1, 38, 26, -1, 29, 38, + 26, -1, 28, 38, 26, -1, 37, 29, -1, 29, + 37, 29, -1, 28, 37, 29, -1, 39, 29, -1, + 29, 39, 29, -1, 28, 39, 29, -1, 37, 26, + -1, 29, 37, 26, -1, 28, 37, 26, -1, 39, + 26, -1, 29, 39, 26, -1, 28, 39, 26, -1, + 39, 56, -1, 29, 39, 56, -1, 28, 39, 56, + -1, 37, 56, -1, 29, 37, 56, -1, 28, 37, + 56, -1, 44, 26, -1, 45, 26, -1, 26, -1, + 27, -1, 64, -1, 64, -1, 66, 64, -1, 65, + -1, 67, 65, -1, 67, -1, 69, -1, 69, 66, + -1, 74, -1, 77, -1, 70, -1, 73, -1, 12, + 88, 14, 88, 15, -1, 13, 88, 14, 88, 15, + -1, 72, -1, 78, -1, 76, -1, 79, -1, 80, + -1, 81, -1, 71, -1, 10, 26, 93, 14, 88, + 15, -1, 10, 26, 93, 57, 88, 58, -1, 10, + 26, 50, 93, 14, 88, 15, -1, 10, 26, 50, + 93, 57, 88, 58, -1, 10, 26, 93, 21, 63, + 92, 93, 14, 88, 15, -1, 10, 26, 93, 21, + 63, 92, 93, 57, 88, 58, -1, 10, 26, 93, + 21, 92, 93, 14, 88, 15, -1, 10, 26, 93, + 21, 92, 93, 57, 88, 58, -1, 10, 31, 92, + 93, 14, 88, 15, -1, 10, 31, 92, 93, 57, + 88, 58, -1, 10, 31, 14, 88, 15, -1, 10, + 31, 57, 88, 58, -1, 11, 26, 93, 14, 87, + 15, -1, 11, 26, 93, 57, 87, 58, -1, 11, + 26, 50, 93, 14, 87, 15, -1, 11, 26, 50, + 93, 57, 87, 58, -1, 11, 26, 93, 21, 63, + 92, 93, 14, 87, 15, -1, 11, 26, 93, 21, + 63, 92, 93, 57, 87, 58, -1, 8, 26, 93, + 21, 93, 9, -1, 8, 26, 93, 21, 85, 93, + 9, -1, 8, 26, 93, 21, 83, 9, -1, 26, + 59, 60, 93, 75, -1, 16, 26, 59, 60, 93, + 75, -1, 16, 26, 93, 75, -1, 69, -1, 69, + 66, -1, 59, 88, 60, -1, 17, 69, -1, 17, + 69, 66, -1, 17, 26, 69, -1, 17, 26, 69, + 66, -1, 17, 67, -1, 3, 88, 4, 88, 7, + -1, 3, 88, 4, 88, 5, 88, 7, -1, 3, + 88, 4, 88, 82, 7, -1, 57, 88, 58, -1, + 30, -1, 18, 32, 19, -1, 6, 88, 4, 88, + -1, 6, 88, 4, 88, 5, 88, -1, 6, 88, + 4, 88, 82, -1, 84, -1, 85, 84, -1, 93, + 86, 60, 88, -1, 93, 86, 60, 93, -1, 93, + 59, 86, 60, 88, -1, 93, 59, 86, 60, 93, + -1, 84, 40, -1, 85, 84, 40, -1, 84, 41, + -1, 85, 84, 41, -1, 84, 42, -1, 85, 84, + 42, -1, 26, -1, 86, 53, 26, -1, 93, 89, + -1, 87, -1, 93, 90, -1, 90, 51, 93, -1, + 90, 49, 93, -1, 90, 50, 93, -1, 90, 33, + 93, 90, -1, 90, 34, 93, 90, -1, 90, 49, + 93, 90, -1, 90, 50, 93, 90, -1, 90, 51, + 93, 90, -1, 96, -1, 51, -1, 52, -1, 51, + -1, 50, -1, 52, -1, -1, 93, 51, -1, 95, + -1, 95, 49, -1, 95, 50, -1, 95, 33, 93, + 95, -1, 95, 34, 93, 95, -1, 95, 49, 95, + -1, 95, 50, 95, -1, 96, -1, 97, -1, 22, + 96, -1, 98, 96, -1, 98, 92, -1, 22, 92, + -1, 97, 53, 93, 97, -1, 97, 48, 93, 97, + -1, 68, -1, 23, -1, 23, 24, -1, 23, 24, + 25, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 377, 377, 388, 397, 412, 422, 424, 428, 434, + 440, 446, 452, 458, 464, 470, 476, 482, 488, 494, + 500, 506, 512, 518, 525, 532, 539, 546, 553, 560, + 566, 572, 578, 584, 590, 596, 602, 608, 614, 620, + 626, 632, 638, 644, 650, 656, 662, 668, 674, 680, + 686, 692, 700, 702, 704, 708, 712, 723, 725, 729, + 731, 733, 749, 751, 755, 757, 759, 761, 763, 765, + 767, 769, 771, 773, 775, 779, 784, 789, 794, 799, + 804, 809, 814, 821, 826, 831, 836, 843, 848, 853, + 858, 863, 868, 875, 880, 885, 892, 895, 898, 902, + 904, 935, 942, 947, 964, 969, 986, 993, 995, 997, + 1002, 1006, 1010, 1014, 1016, 1018, 1022, 1023, 1027, 1029, + 1031, 1033, 1037, 1039, 1041, 1043, 1045, 1047, 1051, 1053, + 1062, 1070, 1071, 1077, 1078, 1085, 1089, 1091, 1093, 1100, + 1102, 1104, 1108, 1109, 1112, 1114, 1116, 1120, 1121, 1130, + 1143, 1159, 1174, 1176, 1178, 1185, 1188, 1192, 1194, 1200, + 1206, 1223, 1243, 1245, 1268, 1272, 1274, 1276 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "IF", "THEN", "ELSE", "ELIF", "FI", + "CASE", "ESAC", "FOR", "SELECT", "WHILE", "UNTIL", "DO", "DONE", + "FUNCTION", "COPROC", "COND_START", "COND_END", "COND_ERROR", "IN", + "BANG", "TIME", "TIMEOPT", "TIMEIGN", "WORD", "ASSIGNMENT_WORD", + "REDIR_WORD", "NUMBER", "ARITH_CMD", "ARITH_FOR_EXPRS", "COND_CMD", + "AND_AND", "OR_OR", "GREATER_GREATER", "LESS_LESS", "LESS_AND", + "LESS_LESS_LESS", "GREATER_AND", "SEMI_SEMI", "SEMI_AND", + "SEMI_SEMI_AND", "LESS_LESS_MINUS", "AND_GREATER", "AND_GREATER_GREATER", + "LESS_GREATER", "GREATER_BAR", "BAR_AND", "'&'", "';'", "'\\n'", + "yacc_EOF", "'|'", "'>'", "'<'", "'-'", "'{'", "'}'", "'('", "')'", + "$accept", "inputunit", "word_list", "redirection", + "simple_command_element", "redirection_list", "simple_command", + "command", "shell_command", "for_command", "arith_for_command", + "select_command", "case_command", "function_def", "function_body", + "subshell", "coproc", "if_command", "group_command", "arith_command", + "cond_command", "elif_clause", "case_clause", "pattern_list", + "case_clause_sequence", "pattern", "list", "compound_list", "list0", + "list1", "simple_list_terminator", "list_terminator", "newline_list", + "simple_list", "simple_list1", "pipeline_command", "pipeline", + "timespec", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 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, 38, + 59, 10, 304, 124, 62, 60, 45, 123, 125, 40, + 41 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 61, 62, 62, 62, 62, 63, 63, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 65, 65, 65, 66, 66, 67, 67, 68, + 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, + 70, 70, 70, 71, 71, 71, 71, 72, 72, 72, + 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, + 75, 76, 77, 77, 77, 77, 77, 78, 78, 78, + 79, 80, 81, 82, 82, 82, 83, 83, 84, 84, + 84, 84, 85, 85, 85, 85, 85, 85, 86, 86, + 87, 88, 88, 89, 89, 89, 90, 90, 90, 90, + 90, 90, 91, 91, 92, 92, 92, 93, 93, 94, + 94, 94, 95, 95, 95, 95, 95, 96, 96, 96, + 96, 96, 97, 97, 97, 98, 98, 98 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 2, 1, 2, 1, 1, 2, 2, 2, + 3, 3, 3, 3, 2, 3, 3, 2, 3, 3, + 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, + 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, + 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, + 2, 2, 1, 1, 1, 1, 2, 1, 2, 1, + 1, 2, 1, 1, 1, 1, 5, 5, 1, 1, + 1, 1, 1, 1, 1, 6, 6, 7, 7, 10, + 10, 9, 9, 7, 7, 5, 5, 6, 6, 7, + 7, 10, 10, 6, 7, 6, 5, 6, 4, 1, + 2, 3, 2, 3, 3, 4, 2, 5, 7, 6, + 3, 1, 3, 4, 6, 5, 1, 2, 4, 4, + 5, 5, 2, 3, 2, 3, 2, 3, 1, 3, + 2, 1, 2, 3, 3, 3, 4, 4, 4, 4, + 4, 1, 1, 1, 1, 1, 1, 0, 2, 1, + 2, 2, 4, 4, 3, 3, 1, 1, 2, 2, + 2, 2, 4, 4, 1, 1, 2, 3 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 0, 0, 147, 0, 0, 0, 147, 147, 0, 0, + 0, 0, 165, 52, 53, 0, 0, 111, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, + 0, 0, 147, 147, 0, 54, 57, 59, 164, 60, + 64, 74, 68, 65, 62, 70, 63, 69, 71, 72, + 73, 0, 149, 156, 157, 0, 4, 131, 0, 0, + 147, 147, 0, 147, 0, 0, 147, 52, 106, 102, + 0, 145, 144, 146, 161, 158, 166, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 14, 23, + 38, 32, 47, 29, 41, 35, 44, 26, 50, 51, + 20, 17, 8, 9, 0, 0, 1, 52, 58, 55, + 61, 142, 143, 2, 147, 147, 150, 151, 147, 147, + 160, 159, 147, 148, 130, 132, 141, 0, 147, 0, + 147, 147, 147, 147, 0, 147, 147, 0, 0, 104, + 103, 112, 167, 147, 16, 25, 40, 34, 49, 31, + 43, 37, 46, 28, 22, 19, 12, 13, 15, 24, + 39, 33, 48, 30, 42, 36, 45, 27, 21, 18, + 10, 11, 110, 101, 56, 0, 0, 154, 155, 0, + 0, 0, 147, 147, 147, 147, 147, 147, 0, 147, + 0, 147, 0, 0, 0, 0, 147, 0, 147, 0, + 0, 147, 99, 98, 105, 0, 152, 153, 0, 0, + 163, 162, 147, 147, 107, 0, 0, 0, 134, 135, + 133, 0, 116, 147, 0, 147, 147, 0, 6, 0, + 147, 0, 85, 86, 147, 147, 147, 147, 0, 0, + 0, 0, 66, 67, 0, 100, 96, 0, 0, 109, + 136, 137, 138, 139, 140, 95, 122, 124, 126, 117, + 0, 93, 128, 0, 0, 0, 0, 75, 7, 147, + 0, 76, 0, 0, 0, 0, 87, 0, 147, 88, + 97, 108, 147, 147, 147, 147, 123, 125, 127, 94, + 0, 0, 147, 77, 78, 0, 147, 147, 83, 84, + 89, 90, 0, 113, 0, 0, 0, 147, 129, 118, + 119, 147, 147, 0, 0, 147, 147, 147, 115, 120, + 121, 0, 0, 81, 82, 0, 0, 114, 79, 80, + 91, 92 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 34, 239, 35, 36, 120, 37, 38, 39, 40, + 41, 42, 43, 44, 213, 45, 46, 47, 48, 49, + 50, 225, 231, 232, 233, 274, 57, 58, 134, 135, + 123, 74, 59, 51, 187, 136, 54, 55 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -208 +static const yytype_int16 yypact[] = +{ + 296, -35, -208, -2, 38, 10, -208, -208, 24, 546, + 31, 346, 51, 47, -208, 591, 604, -208, 56, 71, + -18, 112, 130, 115, 128, 136, 143, 154, -208, -208, + 157, 170, -208, -208, 111, -208, -208, 229, -208, 578, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -12, -3, -208, 48, 346, -208, -208, 208, 396, + -208, 73, 15, 163, 190, 201, 160, 107, 229, 578, + 204, -208, -208, -208, -208, -208, 195, 165, 202, 215, + 152, 216, 153, 222, 227, 236, 237, 244, 245, 253, + 158, 254, 171, 255, 256, 259, 261, 262, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, 231, 230, -208, -208, -208, -208, + 578, -208, -208, -208, -208, -208, 446, 446, -208, -208, + -208, -208, -208, -208, -208, 210, -208, 4, -208, 65, + -208, -208, -208, -208, 70, -208, -208, 232, 41, 578, + 578, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, 396, 396, 23, 23, 496, + 496, 97, -208, -208, -208, -208, -208, -208, 85, -208, + 185, -208, 276, 235, 100, 110, -208, 268, -208, 280, + 283, -208, 578, -208, 578, 41, -208, -208, 446, 446, + 48, 48, -208, -208, -208, 295, 396, 396, 396, 396, + 396, 294, 161, -208, 19, -208, -208, 290, -208, 200, + -208, 252, -208, -208, -208, -208, -208, -208, 302, 396, + 200, 269, -208, -208, 41, 578, -208, 313, 324, -208, + -208, -208, 55, 55, 55, -208, -208, -208, -208, 192, + 34, -208, -208, 303, -19, 315, 278, -208, -208, -208, + 114, -208, 322, 286, 323, 287, -208, 210, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + 8, 320, -208, -208, -208, 117, -208, -208, -208, -208, + -208, -208, 119, 167, 396, 396, 396, -208, -208, -208, + 396, -208, -208, 337, 307, -208, -208, -208, -208, -208, + 396, 345, 308, -208, -208, 352, 312, -208, -208, -208, + -208, -208 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -208, -208, 164, -37, -31, -62, 368, -208, -5, -208, + -208, -208, -208, -208, -206, -208, -208, -208, -208, -208, + -208, 66, -208, 145, -208, 88, -173, -6, -208, -207, + -208, -45, -48, -208, 5, 3, 17, -208 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -1 +static const yytype_uint16 yytable[] = +{ + 64, 65, 119, 53, 69, 52, 118, 150, 100, 256, + 130, 101, 137, 139, 75, 144, 56, 142, 148, 260, + 261, 262, 263, 264, 60, 197, 114, 115, 271, 140, + 124, 125, 119, 248, 301, 251, 63, 118, 102, 121, + 122, 302, 287, 299, 2, 272, 126, 127, 290, 3, + 66, 4, 5, 6, 7, 133, 124, 125, 131, 10, + 272, 301, 149, 70, 61, 71, 72, 73, 317, 62, + 133, 17, 141, 284, 285, 76, 185, 186, 273, 199, + 189, 190, 98, 184, 206, 133, 200, 214, 192, 193, + 198, 207, 133, 273, 204, 205, 128, 99, 32, 235, + 33, 129, 222, 223, 224, 215, 77, 262, 263, 264, + 2, 116, 119, 184, 244, 3, 133, 4, 5, 6, + 7, 133, 201, 138, 246, 10, 191, 208, 306, 53, + 53, 321, 188, 325, 202, 203, 133, 17, 103, 209, + 210, 107, 236, 212, 226, 227, 228, 229, 230, 234, + 255, 133, 335, 336, 108, 240, 104, 245, 249, 105, + 249, 133, 109, 254, 32, 133, 33, 247, 133, 110, + 133, 307, 327, 223, 322, 119, 326, 184, 156, 160, + 111, 157, 161, 112, 170, 270, 106, 171, 53, 53, + 216, 217, 280, 237, 279, 241, 113, 174, 249, 249, + 175, 266, 267, 268, 145, 288, 220, 221, 158, 162, + 212, 238, 132, 143, 172, 146, 257, 258, 184, 147, + 152, 53, 53, 151, 188, 153, 278, 176, 154, 275, + 276, 305, 296, 297, 298, 71, 72, 73, 282, 283, + 312, 155, 159, 192, 193, 314, 315, 316, 163, 212, + 71, 72, 73, 164, 320, 117, 14, 15, 16, 194, + 195, 196, 165, 166, 18, 19, 20, 21, 22, 330, + 167, 168, 23, 24, 25, 26, 27, 249, 249, 169, + 173, 177, 178, 30, 31, 179, 313, 180, 181, 182, + 183, 242, 211, 243, 238, 252, 319, 1, 253, 2, + 323, 324, 259, 265, 3, 277, 4, 5, 6, 7, + 281, 329, 8, 9, 10, 331, 332, 286, 11, 12, + 291, 337, 13, 14, 15, 16, 17, 289, 292, 272, + 303, 18, 19, 20, 21, 22, 304, 308, 310, 23, + 24, 25, 26, 27, 309, 311, 318, 28, 29, 2, + 30, 31, 333, 32, 3, 33, 4, 5, 6, 7, + 338, 300, 8, 9, 10, 334, 339, 340, 11, 12, + 341, 250, 13, 14, 15, 16, 17, 68, 269, 328, + 0, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 27, 0, 0, 71, 72, 73, 2, + 30, 31, 0, 32, 3, 33, 4, 5, 6, 7, + 0, 0, 8, 9, 10, 0, 0, 0, 11, 12, + 0, 0, 13, 14, 15, 16, 17, 0, 0, 0, + 0, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 27, 0, 0, 0, 133, 0, 2, + 30, 31, 0, 32, 3, 33, 4, 5, 6, 7, + 0, 0, 8, 9, 10, 0, 0, 0, 11, 12, + 0, 0, 13, 14, 15, 16, 17, 0, 0, 0, + 0, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 27, 0, 0, 0, 0, 0, 2, + 30, 31, 0, 32, 3, 33, 4, 5, 6, 7, + 0, 0, 8, 9, 10, 0, 0, 0, 0, 0, + 0, 0, 13, 14, 15, 16, 17, 0, 0, 0, + 0, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 27, 0, 0, 0, 133, 0, 2, + 30, 31, 0, 32, 3, 33, 4, 5, 6, 7, + 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, + 0, 0, 67, 14, 15, 16, 17, 0, 0, 0, + 0, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 27, 0, 0, 0, 0, 0, 0, + 30, 31, 0, 32, 0, 33, 15, 16, 0, 0, + 0, 0, 0, 18, 19, 20, 21, 22, 0, 0, + 0, 23, 24, 25, 26, 27, 78, 79, 80, 81, + 82, 0, 30, 31, 83, 0, 0, 84, 85, 88, + 89, 90, 91, 92, 0, 86, 87, 93, 0, 0, + 94, 95, 0, 0, 0, 0, 0, 0, 96, 97 +}; + +static const yytype_int16 yycheck[] = +{ + 6, 7, 39, 0, 9, 0, 37, 69, 26, 215, + 55, 29, 60, 61, 11, 63, 51, 62, 66, 226, + 227, 228, 229, 230, 26, 21, 32, 33, 9, 14, + 33, 34, 69, 206, 53, 208, 26, 68, 56, 51, + 52, 60, 249, 9, 3, 26, 49, 50, 254, 8, + 26, 10, 11, 12, 13, 51, 33, 34, 55, 18, + 26, 53, 67, 32, 26, 50, 51, 52, 60, 31, + 51, 30, 57, 246, 247, 24, 124, 125, 59, 14, + 128, 129, 26, 120, 14, 51, 21, 149, 33, 34, + 138, 21, 51, 59, 142, 143, 48, 26, 57, 14, + 59, 53, 5, 6, 7, 153, 59, 314, 315, 316, + 3, 0, 149, 150, 14, 8, 51, 10, 11, 12, + 13, 51, 57, 50, 14, 18, 132, 57, 14, 126, + 127, 14, 127, 14, 140, 141, 51, 30, 26, 145, + 146, 26, 57, 148, 192, 193, 194, 195, 196, 197, + 212, 51, 325, 326, 26, 200, 26, 57, 206, 29, + 208, 51, 26, 211, 57, 51, 59, 57, 51, 26, + 51, 57, 5, 6, 57, 212, 57, 214, 26, 26, + 26, 29, 29, 26, 26, 233, 56, 29, 185, 186, + 185, 186, 240, 199, 239, 201, 26, 26, 246, 247, + 29, 40, 41, 42, 14, 250, 189, 190, 56, 56, + 215, 26, 4, 50, 56, 14, 222, 223, 255, 59, + 25, 218, 219, 19, 219, 60, 26, 56, 26, 235, + 236, 279, 40, 41, 42, 50, 51, 52, 244, 245, + 288, 26, 26, 33, 34, 293, 294, 295, 26, 254, + 50, 51, 52, 26, 302, 26, 27, 28, 29, 49, + 50, 51, 26, 26, 35, 36, 37, 38, 39, 317, + 26, 26, 43, 44, 45, 46, 47, 325, 326, 26, + 26, 26, 26, 54, 55, 26, 292, 26, 26, 58, + 60, 15, 60, 58, 26, 15, 302, 1, 15, 3, + 306, 307, 7, 9, 8, 15, 10, 11, 12, 13, + 58, 317, 16, 17, 18, 321, 322, 15, 22, 23, + 7, 327, 26, 27, 28, 29, 30, 58, 4, 26, + 15, 35, 36, 37, 38, 39, 58, 15, 15, 43, + 44, 45, 46, 47, 58, 58, 26, 51, 52, 3, + 54, 55, 15, 57, 8, 59, 10, 11, 12, 13, + 15, 273, 16, 17, 18, 58, 58, 15, 22, 23, + 58, 207, 26, 27, 28, 29, 30, 9, 233, 313, + -1, 35, 36, 37, 38, 39, -1, -1, -1, 43, + 44, 45, 46, 47, -1, -1, 50, 51, 52, 3, + 54, 55, -1, 57, 8, 59, 10, 11, 12, 13, + -1, -1, 16, 17, 18, -1, -1, -1, 22, 23, + -1, -1, 26, 27, 28, 29, 30, -1, -1, -1, + -1, 35, 36, 37, 38, 39, -1, -1, -1, 43, + 44, 45, 46, 47, -1, -1, -1, 51, -1, 3, + 54, 55, -1, 57, 8, 59, 10, 11, 12, 13, + -1, -1, 16, 17, 18, -1, -1, -1, 22, 23, + -1, -1, 26, 27, 28, 29, 30, -1, -1, -1, + -1, 35, 36, 37, 38, 39, -1, -1, -1, 43, + 44, 45, 46, 47, -1, -1, -1, -1, -1, 3, + 54, 55, -1, 57, 8, 59, 10, 11, 12, 13, + -1, -1, 16, 17, 18, -1, -1, -1, -1, -1, + -1, -1, 26, 27, 28, 29, 30, -1, -1, -1, + -1, 35, 36, 37, 38, 39, -1, -1, -1, 43, + 44, 45, 46, 47, -1, -1, -1, 51, -1, 3, + 54, 55, -1, 57, 8, 59, 10, 11, 12, 13, + -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, + -1, -1, 26, 27, 28, 29, 30, -1, -1, -1, + -1, 35, 36, 37, 38, 39, -1, -1, -1, 43, + 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, + 54, 55, -1, 57, -1, 59, 28, 29, -1, -1, + -1, -1, -1, 35, 36, 37, 38, 39, -1, -1, + -1, 43, 44, 45, 46, 47, 35, 36, 37, 38, + 39, -1, 54, 55, 43, -1, -1, 46, 47, 35, + 36, 37, 38, 39, -1, 54, 55, 43, -1, -1, + 46, 47, -1, -1, -1, -1, -1, -1, 54, 55 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 1, 3, 8, 10, 11, 12, 13, 16, 17, + 18, 22, 23, 26, 27, 28, 29, 30, 35, 36, + 37, 38, 39, 43, 44, 45, 46, 47, 51, 52, + 54, 55, 57, 59, 62, 64, 65, 67, 68, 69, + 70, 71, 72, 73, 74, 76, 77, 78, 79, 80, + 81, 94, 95, 96, 97, 98, 51, 87, 88, 93, + 26, 26, 31, 26, 88, 88, 26, 26, 67, 69, + 32, 50, 51, 52, 92, 96, 24, 59, 35, 36, + 37, 38, 39, 43, 46, 47, 54, 55, 35, 36, + 37, 38, 39, 43, 46, 47, 54, 55, 26, 26, + 26, 29, 56, 26, 26, 29, 56, 26, 26, 26, + 26, 26, 26, 26, 88, 88, 0, 26, 65, 64, + 66, 51, 52, 91, 33, 34, 49, 50, 48, 53, + 92, 96, 4, 51, 89, 90, 96, 93, 50, 93, + 14, 57, 92, 50, 93, 14, 14, 59, 93, 69, + 66, 19, 25, 60, 26, 26, 26, 29, 56, 26, + 26, 29, 56, 26, 26, 26, 26, 26, 26, 26, + 26, 29, 56, 26, 26, 29, 56, 26, 26, 26, + 26, 26, 58, 60, 64, 93, 93, 95, 95, 93, + 93, 88, 33, 34, 49, 50, 51, 21, 93, 14, + 21, 57, 88, 88, 93, 93, 14, 21, 57, 88, + 88, 60, 69, 75, 66, 93, 95, 95, 49, 50, + 97, 97, 5, 6, 7, 82, 93, 93, 93, 93, + 93, 83, 84, 85, 93, 14, 57, 88, 26, 63, + 92, 88, 15, 58, 14, 57, 14, 57, 87, 93, + 63, 87, 15, 15, 93, 66, 75, 88, 88, 7, + 90, 90, 90, 90, 90, 9, 40, 41, 42, 84, + 93, 9, 26, 59, 86, 88, 88, 15, 26, 92, + 93, 58, 88, 88, 87, 87, 15, 90, 92, 58, + 75, 7, 4, 49, 50, 51, 40, 41, 42, 9, + 86, 53, 60, 15, 58, 93, 14, 57, 15, 58, + 15, 58, 93, 88, 93, 93, 93, 60, 26, 88, + 93, 14, 57, 88, 88, 14, 57, 5, 82, 88, + 93, 88, 88, 15, 58, 87, 87, 88, 15, 58, + 15, 58 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +#else +static void +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; +#endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + fprintf (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) +{ + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } +} +#endif /* YYERROR_VERBOSE */ + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + YYUSE (yyvaluep); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} + + +/* Prevent warnings from -Wmissing-prototypes. */ + +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + + +/* The look-ahead symbol. */ +int yychar; + +/* The semantic value of the look-ahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void) +#else +int +yyparse () + +#endif +#endif +{ + + int yystate; + int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to look-ahead token. */ + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a look-ahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + if (yyn == YYFINAL) + YYACCEPT; + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + yystate = yyn; + *++yyvsp = yylval; + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: +#line 378 "/usr/homes/chet/src/bash/src/parse.y" + { + /* Case of regular command. Discard the error + safety net,and return the command just parsed. */ + global_command = (yyvsp[(1) - (2)].command); + eof_encountered = 0; + /* discard_parser_constructs (0); */ + if (parser_state & PST_CMDSUBST) + parser_state |= PST_EOFTOKEN; + YYACCEPT; + } + break; + + case 3: +#line 389 "/usr/homes/chet/src/bash/src/parse.y" + { + /* Case of regular command, but not a very + interesting one. Return a NULL command. */ + global_command = (COMMAND *)NULL; + if (parser_state & PST_CMDSUBST) + parser_state |= PST_EOFTOKEN; + YYACCEPT; + } + break; + + case 4: +#line 398 "/usr/homes/chet/src/bash/src/parse.y" + { + /* Error during parsing. Return NULL command. */ + global_command = (COMMAND *)NULL; + eof_encountered = 0; + /* discard_parser_constructs (1); */ + if (interactive && parse_and_execute_level == 0) + { + YYACCEPT; + } + else + { + YYABORT; + } + } + break; + + case 5: +#line 413 "/usr/homes/chet/src/bash/src/parse.y" + { + /* Case of EOF seen by itself. Do ignoreeof or + not. */ + global_command = (COMMAND *)NULL; + handle_eof_input_unit (); + YYACCEPT; + } + break; + + case 6: +#line 423 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); } + break; + + case 7: +#line 425 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(2) - (2)].word), (yyvsp[(1) - (2)].word_list)); } + break; + + case 8: +#line 429 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_output_direction, redir, 0); + } + break; + + case 9: +#line 435 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_input_direction, redir, 0); + } + break; + + case 10: +#line 441 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_output_direction, redir, 0); + } + break; + + case 11: +#line 447 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_input_direction, redir, 0); + } + break; + + case 12: +#line 453 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_output_direction, redir, REDIR_VARASSIGN); + } + break; + + case 13: +#line 459 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_input_direction, redir, REDIR_VARASSIGN); + } + break; + + case 14: +#line 465 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_appending_to, redir, 0); + } + break; + + case 15: +#line 471 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_appending_to, redir, 0); + } + break; + + case 16: +#line 477 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_appending_to, redir, REDIR_VARASSIGN); + } + break; + + case 17: +#line 483 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_output_force, redir, 0); + } + break; + + case 18: +#line 489 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_output_force, redir, 0); + } + break; + + case 19: +#line 495 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_output_force, redir, REDIR_VARASSIGN); + } + break; + + case 20: +#line 501 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_input_output, redir, 0); + } + break; + + case 21: +#line 507 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_input_output, redir, 0); + } + break; + + case 22: +#line 513 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_input_output, redir, REDIR_VARASSIGN); + } + break; + + case 23: +#line 519 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_reading_until, redir, 0); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 24: +#line 526 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_reading_until, redir, 0); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 25: +#line 533 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 26: +#line 540 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, 0); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 27: +#line 547 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, 0); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 28: +#line 554 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 29: +#line 561 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_reading_string, redir, 0); + } + break; + + case 30: +#line 567 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_reading_string, redir, 0); + } + break; + + case 31: +#line 573 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_reading_string, redir, REDIR_VARASSIGN); + } + break; + + case 32: +#line 579 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.dest = (yyvsp[(2) - (2)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_input, redir, 0); + } + break; + + case 33: +#line 585 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = (yyvsp[(3) - (3)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_input, redir, 0); + } + break; + + case 34: +#line 591 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = (yyvsp[(3) - (3)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_input, redir, REDIR_VARASSIGN); + } + break; + + case 35: +#line 597 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.dest = (yyvsp[(2) - (2)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_output, redir, 0); + } + break; + + case 36: +#line 603 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = (yyvsp[(3) - (3)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_output, redir, 0); + } + break; + + case 37: +#line 609 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = (yyvsp[(3) - (3)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_output, redir, REDIR_VARASSIGN); + } + break; + + case 38: +#line 615 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_input_word, redir, 0); + } + break; + + case 39: +#line 621 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_input_word, redir, 0); + } + break; + + case 40: +#line 627 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_input_word, redir, REDIR_VARASSIGN); + } + break; + + case 41: +#line 633 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_output_word, redir, 0); + } + break; + + case 42: +#line 639 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_output_word, redir, 0); + } + break; + + case 43: +#line 645 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_output_word, redir, REDIR_VARASSIGN); + } + break; + + case 44: +#line 651 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, 0); + } + break; + + case 45: +#line 657 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, 0); + } + break; + + case 46: +#line 663 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, REDIR_VARASSIGN); + } + break; + + case 47: +#line 669 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, 0); + } + break; + + case 48: +#line 675 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, 0); + } + break; + + case 49: +#line 681 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, REDIR_VARASSIGN); + } + break; + + case 50: +#line 687 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_err_and_out, redir, 0); + } + break; + + case 51: +#line 693 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_append_err_and_out, redir, 0); + } + break; + + case 52: +#line 701 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; } + break; + + case 53: +#line 703 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; } + break; + + case 54: +#line 705 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.element).redirect = (yyvsp[(1) - (1)].redirect); (yyval.element).word = 0; } + break; + + case 55: +#line 709 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.redirect) = (yyvsp[(1) - (1)].redirect); + } + break; + + case 56: +#line 713 "/usr/homes/chet/src/bash/src/parse.y" + { + register REDIRECT *t; + + for (t = (yyvsp[(1) - (2)].redirect); t->next; t = t->next) + ; + t->next = (yyvsp[(2) - (2)].redirect); + (yyval.redirect) = (yyvsp[(1) - (2)].redirect); + } + break; + + case 57: +#line 724 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_simple_command ((yyvsp[(1) - (1)].element), (COMMAND *)NULL); } + break; + + case 58: +#line 726 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_simple_command ((yyvsp[(2) - (2)].element), (yyvsp[(1) - (2)].command)); } + break; + + case 59: +#line 730 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = clean_simple_command ((yyvsp[(1) - (1)].command)); } + break; + + case 60: +#line 732 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 61: +#line 734 "/usr/homes/chet/src/bash/src/parse.y" + { + COMMAND *tc; + + tc = (yyvsp[(1) - (2)].command); + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = (yyvsp[(2) - (2)].redirect); + } + else + tc->redirects = (yyvsp[(2) - (2)].redirect); + (yyval.command) = (yyvsp[(1) - (2)].command); + } + break; + + case 62: +#line 750 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 63: +#line 752 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 64: +#line 756 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 65: +#line 758 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 66: +#line 760 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_while_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); } + break; + + case 67: +#line 762 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_until_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); } + break; + + case 68: +#line 764 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 69: +#line 766 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 70: +#line 768 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 71: +#line 770 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 72: +#line 772 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 73: +#line 774 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 74: +#line 776 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 75: +#line 780 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 76: +#line 785 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 77: +#line 790 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 78: +#line 795 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 79: +#line 800 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 80: +#line 805 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 81: +#line 810 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 82: +#line 815 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 83: +#line 822 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno); + if (word_top > 0) word_top--; + } + break; + + case 84: +#line 827 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno); + if (word_top > 0) word_top--; + } + break; + + case 85: +#line 832 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno); + if (word_top > 0) word_top--; + } + break; + + case 86: +#line 837 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno); + if (word_top > 0) word_top--; + } + break; + + case 87: +#line 844 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 88: +#line 849 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 89: +#line 854 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 90: +#line 859 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 91: +#line 864 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 92: +#line 869 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 93: +#line 876 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (PATTERN_LIST *)NULL, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 94: +#line 881 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_case_command ((yyvsp[(2) - (7)].word), (yyvsp[(5) - (7)].pattern), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 95: +#line 886 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (yyvsp[(5) - (6)].pattern), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 96: +#line 893 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_function_def ((yyvsp[(1) - (5)].word), (yyvsp[(5) - (5)].command), function_dstart, function_bstart); } + break; + + case 97: +#line 896 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_function_def ((yyvsp[(2) - (6)].word), (yyvsp[(6) - (6)].command), function_dstart, function_bstart); } + break; + + case 98: +#line 899 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_function_def ((yyvsp[(2) - (4)].word), (yyvsp[(4) - (4)].command), function_dstart, function_bstart); } + break; + + case 99: +#line 903 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 100: +#line 905 "/usr/homes/chet/src/bash/src/parse.y" + { + COMMAND *tc; + + tc = (yyvsp[(1) - (2)].command); + /* According to Posix.2 3.9.5, redirections + specified after the body of a function should + be attached to the function and performed when + the function is executed, not as part of the + function definition command. */ + /* XXX - I don't think it matters, but we might + want to change this in the future to avoid + problems differentiating between a function + definition with a redirection and a function + definition containing a single command with a + redirection. The two are semantically equivalent, + though -- the only difference is in how the + command printing code displays the redirections. */ + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = (yyvsp[(2) - (2)].redirect); + } + else + tc->redirects = (yyvsp[(2) - (2)].redirect); + (yyval.command) = (yyvsp[(1) - (2)].command); + } + break; + + case 101: +#line 936 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_subshell_command ((yyvsp[(2) - (3)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL; + } + break; + + case 102: +#line 943 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_coproc_command ("COPROC", (yyvsp[(2) - (2)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + break; + + case 103: +#line 948 "/usr/homes/chet/src/bash/src/parse.y" + { + COMMAND *tc; + + tc = (yyvsp[(2) - (3)].command); + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = (yyvsp[(3) - (3)].redirect); + } + else + tc->redirects = (yyvsp[(3) - (3)].redirect); + (yyval.command) = make_coproc_command ("COPROC", (yyvsp[(2) - (3)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + break; + + case 104: +#line 965 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_coproc_command ((yyvsp[(2) - (3)].word)->word, (yyvsp[(3) - (3)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + break; + + case 105: +#line 970 "/usr/homes/chet/src/bash/src/parse.y" + { + COMMAND *tc; + + tc = (yyvsp[(3) - (4)].command); + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = (yyvsp[(4) - (4)].redirect); + } + else + tc->redirects = (yyvsp[(4) - (4)].redirect); + (yyval.command) = make_coproc_command ((yyvsp[(2) - (4)].word)->word, (yyvsp[(3) - (4)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + break; + + case 106: +#line 987 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_coproc_command ("COPROC", clean_simple_command ((yyvsp[(2) - (2)].command))); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + break; + + case 107: +#line 994 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (COMMAND *)NULL); } + break; + + case 108: +#line 996 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (7)].command), (yyvsp[(4) - (7)].command), (yyvsp[(6) - (7)].command)); } + break; + + case 109: +#line 998 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(5) - (6)].command)); } + break; + + case 110: +#line 1003 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_group_command ((yyvsp[(2) - (3)].command)); } + break; + + case 111: +#line 1007 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_arith_command ((yyvsp[(1) - (1)].word_list)); } + break; + + case 112: +#line 1011 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(2) - (3)].command); } + break; + + case 113: +#line 1015 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (4)].command), (yyvsp[(4) - (4)].command), (COMMAND *)NULL); } + break; + + case 114: +#line 1017 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(6) - (6)].command)); } + break; + + case 115: +#line 1019 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (yyvsp[(5) - (5)].command)); } + break; + + case 117: +#line 1024 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(2) - (2)].pattern)->next = (yyvsp[(1) - (2)].pattern); (yyval.pattern) = (yyvsp[(2) - (2)].pattern); } + break; + + case 118: +#line 1028 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (yyvsp[(4) - (4)].command)); } + break; + + case 119: +#line 1030 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (COMMAND *)NULL); } + break; + + case 120: +#line 1032 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (yyvsp[(5) - (5)].command)); } + break; + + case 121: +#line 1034 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (COMMAND *)NULL); } + break; + + case 122: +#line 1038 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.pattern) = (yyvsp[(1) - (2)].pattern); } + break; + + case 123: +#line 1040 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); } + break; + + case 124: +#line 1042 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); } + break; + + case 125: +#line 1044 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); } + break; + + case 126: +#line 1046 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_TESTNEXT; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); } + break; + + case 127: +#line 1048 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_TESTNEXT; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); } + break; + + case 128: +#line 1052 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); } + break; + + case 129: +#line 1054 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(3) - (3)].word), (yyvsp[(1) - (3)].word_list)); } + break; + + case 130: +#line 1063 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = (yyvsp[(2) - (2)].command); + if (need_here_doc) + gather_here_documents (); + } + break; + + case 132: +#line 1072 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = (yyvsp[(2) - (2)].command); + } + break; + + case 134: +#line 1079 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(1) - (3)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (3)].command), (COMMAND *)NULL, '&'); + else + (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (COMMAND *)NULL, '&'); + } + break; + + case 136: +#line 1090 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); } + break; + + case 137: +#line 1092 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); } + break; + + case 138: +#line 1094 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(1) - (4)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '&'); + else + (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '&'); + } + break; + + case 139: +#line 1101 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); } + break; + + case 140: +#line 1103 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); } + break; + + case 141: +#line 1105 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 144: +#line 1113 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = '\n'; } + break; + + case 145: +#line 1115 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = ';'; } + break; + + case 146: +#line 1117 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = yacc_EOF; } + break; + + case 149: +#line 1131 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = (yyvsp[(1) - (1)].command); + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = (yyvsp[(1) - (1)].command); + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + break; + + case 150: +#line 1144 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(1) - (2)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (2)].command), (COMMAND *)NULL, '&'); + else + (yyval.command) = command_connect ((yyvsp[(1) - (2)].command), (COMMAND *)NULL, '&'); + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = (yyvsp[(1) - (2)].command); + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + break; + + case 151: +#line 1160 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = (yyvsp[(1) - (2)].command); + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = (yyvsp[(1) - (2)].command); + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + break; + + case 152: +#line 1175 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); } + break; + + case 153: +#line 1177 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); } + break; + + case 154: +#line 1179 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(1) - (3)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), '&'); + else + (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), '&'); + } + break; + + case 155: +#line 1186 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), ';'); } + break; + + case 156: +#line 1189 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 157: +#line 1193 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 158: +#line 1195 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(2) - (2)].command)) + (yyvsp[(2) - (2)].command)->flags ^= CMD_INVERT_RETURN; /* toggle */ + (yyval.command) = (yyvsp[(2) - (2)].command); + } + break; + + case 159: +#line 1201 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(2) - (2)].command)) + (yyvsp[(2) - (2)].command)->flags |= (yyvsp[(1) - (2)].number); + (yyval.command) = (yyvsp[(2) - (2)].command); + } + break; + + case 160: +#line 1207 "/usr/homes/chet/src/bash/src/parse.y" + { + ELEMENT x; + + /* Boy, this is unclean. `time' by itself can + time a null command. We cheat and push a + newline back if the list_terminator was a newline + to avoid the double-newline problem (one to + terminate this, one to terminate the command) */ + x.word = 0; + x.redirect = 0; + (yyval.command) = make_simple_command (x, (COMMAND *)NULL); + (yyval.command)->flags |= (yyvsp[(1) - (2)].number); + /* XXX - let's cheat and push a newline back */ + if ((yyvsp[(2) - (2)].number) == '\n') + token_to_read = '\n'; + } + break; + + case 161: +#line 1224 "/usr/homes/chet/src/bash/src/parse.y" + { + ELEMENT x; + + /* This is just as unclean. Posix says that `!' + by itself should be equivalent to `false'. + We cheat and push a + newline back if the list_terminator was a newline + to avoid the double-newline problem (one to + terminate this, one to terminate the command) */ + x.word = 0; + x.redirect = 0; + (yyval.command) = make_simple_command (x, (COMMAND *)NULL); + (yyval.command)->flags |= CMD_INVERT_RETURN; + /* XXX - let's cheat and push a newline back */ + if ((yyvsp[(2) - (2)].number) == '\n') + token_to_read = '\n'; + } + break; + + case 162: +#line 1244 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '|'); } + break; + + case 163: +#line 1246 "/usr/homes/chet/src/bash/src/parse.y" + { + /* Make cmd1 |& cmd2 equivalent to cmd1 2>&1 | cmd2 */ + COMMAND *tc; + REDIRECTEE rd, sd; + REDIRECT *r; + + tc = (yyvsp[(1) - (4)].command)->type == cm_simple ? (COMMAND *)(yyvsp[(1) - (4)].command)->value.Simple : (yyvsp[(1) - (4)].command); + sd.dest = 2; + rd.dest = 1; + r = make_redirection (sd, r_duplicating_output, rd, 0); + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = r; + } + else + tc->redirects = r; + + (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '|'); + } + break; + + case 164: +#line 1269 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 165: +#line 1273 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = CMD_TIME_PIPELINE; } + break; + + case 166: +#line 1275 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } + break; + + case 167: +#line 1277 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } + break; + + +/* Line 1267 of yacc.c. */ +#line 3377 "y.tab.c" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse look-ahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse look-ahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + if (yyn == YYFINAL) + YYACCEPT; + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#ifndef yyoverflow +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); +} + + +#line 1279 "/usr/homes/chet/src/bash/src/parse.y" + + +/* Initial size to allocate for tokens, and the + amount to grow them by. */ +#define TOKEN_DEFAULT_INITIAL_SIZE 496 +#define TOKEN_DEFAULT_GROW_SIZE 512 + +/* Should we call prompt_again? */ +#define SHOULD_PROMPT() \ + (interactive && (bash_input.type == st_stdin || bash_input.type == st_stream)) + +#if defined (ALIAS) +# define expanding_alias() (pushed_string_list && pushed_string_list->expander) +#else +# define expanding_alias() 0 +#endif + +/* Global var is non-zero when end of file has been reached. */ +int EOF_Reached = 0; + +#ifdef DEBUG +static void +debug_parser (i) + int i; +{ +#if YYDEBUG != 0 + yydebug = i; +#endif +} +#endif + +/* yy_getc () returns the next available character from input or EOF. + yy_ungetc (c) makes `c' the next character to read. + init_yy_io (get, unget, type, location) makes the function GET the + installed function for getting the next character, makes UNGET the + installed function for un-getting a character, sets the type of stream + (either string or file) from TYPE, and makes LOCATION point to where + the input is coming from. */ + +/* Unconditionally returns end-of-file. */ +int +return_EOF () +{ + return (EOF); +} + +/* Variable containing the current get and unget functions. + See ./input.h for a clearer description. */ +BASH_INPUT bash_input; + +/* Set all of the fields in BASH_INPUT to NULL. Free bash_input.name if it + is non-null, avoiding a memory leak. */ +void +initialize_bash_input () +{ + bash_input.type = st_none; + FREE (bash_input.name); + bash_input.name = (char *)NULL; + bash_input.location.file = (FILE *)NULL; + bash_input.location.string = (char *)NULL; + bash_input.getter = (sh_cget_func_t *)NULL; + bash_input.ungetter = (sh_cunget_func_t *)NULL; +} + +/* Set the contents of the current bash input stream from + GET, UNGET, TYPE, NAME, and LOCATION. */ +void +init_yy_io (get, unget, type, name, location) + sh_cget_func_t *get; + sh_cunget_func_t *unget; + enum stream_type type; + const char *name; + INPUT_STREAM location; +{ + bash_input.type = type; + FREE (bash_input.name); + bash_input.name = name ? savestring (name) : (char *)NULL; + + /* XXX */ +#if defined (CRAY) + memcpy((char *)&bash_input.location.string, (char *)&location.string, sizeof(location)); +#else + bash_input.location = location; +#endif + bash_input.getter = get; + bash_input.ungetter = unget; +} + +char * +yy_input_name () +{ + return (bash_input.name ? bash_input.name : "stdin"); +} + +/* Call this to get the next character of input. */ +static int +yy_getc () +{ + return (*(bash_input.getter)) (); +} + +/* Call this to unget C. That is, to make C the next character + to be read. */ +static int +yy_ungetc (c) + int c; +{ + return (*(bash_input.ungetter)) (c); +} + +#if defined (BUFFERED_INPUT) +#ifdef INCLUDE_UNUSED +int +input_file_descriptor () +{ + switch (bash_input.type) + { + case st_stream: + return (fileno (bash_input.location.file)); + case st_bstream: + return (bash_input.location.buffered_fd); + case st_stdin: + default: + return (fileno (stdin)); + } +} +#endif +#endif /* BUFFERED_INPUT */ + +/* **************************************************************** */ +/* */ +/* Let input be read from readline (). */ +/* */ +/* **************************************************************** */ + +#if defined (READLINE) +char *current_readline_prompt = (char *)NULL; +char *current_readline_line = (char *)NULL; +int current_readline_line_index = 0; + +static int +yy_readline_get () +{ + SigHandler *old_sigint; + int line_len; + unsigned char c; + + if (!current_readline_line) + { + if (!bash_readline_initialized) + initialize_readline (); + +#if defined (JOB_CONTROL) + if (job_control) + give_terminal_to (shell_pgrp, 0); +#endif /* JOB_CONTROL */ + + old_sigint = (SigHandler *)IMPOSSIBLE_TRAP_HANDLER; + if (signal_is_ignored (SIGINT) == 0) + { + /* interrupt_immediately++; */ + old_sigint = (SigHandler *)set_signal_handler (SIGINT, sigint_sighandler); + } + + current_readline_line = readline (current_readline_prompt ? + current_readline_prompt : ""); + + CHECK_TERMSIG; + if (signal_is_ignored (SIGINT) == 0) + { + /* interrupt_immediately--; */ + if (old_sigint != IMPOSSIBLE_TRAP_HANDLER) + set_signal_handler (SIGINT, old_sigint); + } + +#if 0 + /* Reset the prompt to the decoded value of prompt_string_pointer. */ + reset_readline_prompt (); +#endif + + if (current_readline_line == 0) + return (EOF); + + current_readline_line_index = 0; + line_len = strlen (current_readline_line); + + current_readline_line = (char *)xrealloc (current_readline_line, 2 + line_len); + current_readline_line[line_len++] = '\n'; + current_readline_line[line_len] = '\0'; + } + + if (current_readline_line[current_readline_line_index] == 0) + { + free (current_readline_line); + current_readline_line = (char *)NULL; + return (yy_readline_get ()); + } + else + { + c = current_readline_line[current_readline_line_index++]; + return (c); + } +} + +static int +yy_readline_unget (c) + int c; +{ + if (current_readline_line_index && current_readline_line) + current_readline_line[--current_readline_line_index] = c; + return (c); +} + +void +with_input_from_stdin () +{ + INPUT_STREAM location; + + if (bash_input.type != st_stdin && stream_on_stack (st_stdin) == 0) + { + location.string = current_readline_line; + init_yy_io (yy_readline_get, yy_readline_unget, + st_stdin, "readline stdin", location); + } +} + +#else /* !READLINE */ + +void +with_input_from_stdin () +{ + with_input_from_stream (stdin, "stdin"); +} +#endif /* !READLINE */ + +/* **************************************************************** */ +/* */ +/* Let input come from STRING. STRING is zero terminated. */ +/* */ +/* **************************************************************** */ + +static int +yy_string_get () +{ + register char *string; + register unsigned char c; + + string = bash_input.location.string; + + /* If the string doesn't exist, or is empty, EOF found. */ + if (string && *string) + { + c = *string++; + bash_input.location.string = string; + return (c); + } + else + return (EOF); +} + +static int +yy_string_unget (c) + int c; +{ + *(--bash_input.location.string) = c; + return (c); +} + +void +with_input_from_string (string, name) + char *string; + const char *name; +{ + INPUT_STREAM location; + + location.string = string; + init_yy_io (yy_string_get, yy_string_unget, st_string, name, location); +} + +/* Count the number of characters we've consumed from bash_input.location.string + and read into shell_input_line, but have not returned from shell_getc. + That is the true input location. Rewind bash_input.location.string by + that number of characters, so it points to the last character actually + consumed by the parser. */ +static void +rewind_input_string () +{ + int xchars; + + /* number of unconsumed characters in the input -- XXX need to take newlines + into account, e.g., $(...\n) */ + xchars = shell_input_line_len - shell_input_line_index; + if (bash_input.location.string[-1] == '\n') + xchars++; + + /* XXX - how to reflect bash_input.location.string back to string passed to + parse_and_execute or xparse_dolparen? xparse_dolparen needs to know how + far into the string we parsed. parse_and_execute knows where bash_input. + location.string is, and how far from orig_string that is -- that's the + number of characters the command consumed. */ + + /* bash_input.location.string - xchars should be where we parsed to */ + /* need to do more validation on xchars value for sanity -- test cases. */ + bash_input.location.string -= xchars; +} + +/* **************************************************************** */ +/* */ +/* Let input come from STREAM. */ +/* */ +/* **************************************************************** */ + +/* These two functions used to test the value of the HAVE_RESTARTABLE_SYSCALLS + define, and just use getc/ungetc if it was defined, but since bash + installs its signal handlers without the SA_RESTART flag, some signals + (like SIGCHLD, SIGWINCH, etc.) received during a read(2) will not cause + the read to be restarted. We need to restart it ourselves. */ + +static int +yy_stream_get () +{ + int result; + + result = EOF; + if (bash_input.location.file) + { +#if 0 + if (interactive) + interrupt_immediately++; +#endif + + /* XXX - don't need terminate_immediately; getc_with_restart checks + for terminating signals itself if read returns < 0 */ + result = getc_with_restart (bash_input.location.file); + +#if 0 + if (interactive) + interrupt_immediately--; +#endif + } + return (result); +} + +static int +yy_stream_unget (c) + int c; +{ + return (ungetc_with_restart (c, bash_input.location.file)); +} + +void +with_input_from_stream (stream, name) + FILE *stream; + const char *name; +{ + INPUT_STREAM location; + + location.file = stream; + init_yy_io (yy_stream_get, yy_stream_unget, st_stream, name, location); +} + +typedef struct stream_saver { + struct stream_saver *next; + BASH_INPUT bash_input; + int line; +#if defined (BUFFERED_INPUT) + BUFFERED_STREAM *bstream; +#endif /* BUFFERED_INPUT */ +} STREAM_SAVER; + +/* The globally known line number. */ +int line_number = 0; + +/* The line number offset set by assigning to LINENO. Not currently used. */ +int line_number_base = 0; + +#if defined (COND_COMMAND) +static int cond_lineno; +static int cond_token; +#endif + +STREAM_SAVER *stream_list = (STREAM_SAVER *)NULL; + +void +push_stream (reset_lineno) + int reset_lineno; +{ + STREAM_SAVER *saver = (STREAM_SAVER *)xmalloc (sizeof (STREAM_SAVER)); + + xbcopy ((char *)&bash_input, (char *)&(saver->bash_input), sizeof (BASH_INPUT)); + +#if defined (BUFFERED_INPUT) + saver->bstream = (BUFFERED_STREAM *)NULL; + /* If we have a buffered stream, clear out buffers[fd]. */ + if (bash_input.type == st_bstream && bash_input.location.buffered_fd >= 0) + saver->bstream = set_buffered_stream (bash_input.location.buffered_fd, + (BUFFERED_STREAM *)NULL); +#endif /* BUFFERED_INPUT */ + + saver->line = line_number; + bash_input.name = (char *)NULL; + saver->next = stream_list; + stream_list = saver; + EOF_Reached = 0; + if (reset_lineno) + line_number = 0; +} + +void +pop_stream () +{ + if (!stream_list) + EOF_Reached = 1; + else + { + STREAM_SAVER *saver = stream_list; + + EOF_Reached = 0; + stream_list = stream_list->next; + + init_yy_io (saver->bash_input.getter, + saver->bash_input.ungetter, + saver->bash_input.type, + saver->bash_input.name, + saver->bash_input.location); + +#if defined (BUFFERED_INPUT) + /* If we have a buffered stream, restore buffers[fd]. */ + /* If the input file descriptor was changed while this was on the + save stack, update the buffered fd to the new file descriptor and + re-establish the buffer <-> bash_input fd correspondence. */ + if (bash_input.type == st_bstream && bash_input.location.buffered_fd >= 0) + { + if (bash_input_fd_changed) + { + bash_input_fd_changed = 0; + if (default_buffered_input >= 0) + { + bash_input.location.buffered_fd = default_buffered_input; + saver->bstream->b_fd = default_buffered_input; + SET_CLOSE_ON_EXEC (default_buffered_input); + } + } + /* XXX could free buffered stream returned as result here. */ + set_buffered_stream (bash_input.location.buffered_fd, saver->bstream); + } +#endif /* BUFFERED_INPUT */ + + line_number = saver->line; + + FREE (saver->bash_input.name); + free (saver); + } +} + +/* Return 1 if a stream of type TYPE is saved on the stack. */ +int +stream_on_stack (type) + enum stream_type type; +{ + register STREAM_SAVER *s; + + for (s = stream_list; s; s = s->next) + if (s->bash_input.type == type) + return 1; + return 0; +} + +/* Save the current token state and return it in a malloced array. */ +int * +save_token_state () +{ + int *ret; + + ret = (int *)xmalloc (4 * sizeof (int)); + ret[0] = last_read_token; + ret[1] = token_before_that; + ret[2] = two_tokens_ago; + ret[3] = current_token; + return ret; +} + +void +restore_token_state (ts) + int *ts; +{ + if (ts == 0) + return; + last_read_token = ts[0]; + token_before_that = ts[1]; + two_tokens_ago = ts[2]; + current_token = ts[3]; +} + +/* + * This is used to inhibit alias expansion and reserved word recognition + * inside case statement pattern lists. A `case statement pattern list' is: + * + * everything between the `in' in a `case word in' and the next ')' + * or `esac' + * everything between a `;;' and the next `)' or `esac' + */ + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + +#define END_OF_ALIAS 0 + +/* + * Pseudo-global variables used in implementing token-wise alias expansion. + */ + +/* + * Pushing and popping strings. This works together with shell_getc to + * implement alias expansion on a per-token basis. + */ + +#define PSH_ALIAS 0x01 +#define PSH_DPAREN 0x02 +#define PSH_SOURCE 0x04 + +typedef struct string_saver { + struct string_saver *next; + int expand_alias; /* Value to set expand_alias to when string is popped. */ + char *saved_line; +#if defined (ALIAS) + alias_t *expander; /* alias that caused this line to be pushed. */ +#endif + size_t saved_line_size, saved_line_index; + int saved_line_terminator; + int flags; +} STRING_SAVER; + +STRING_SAVER *pushed_string_list = (STRING_SAVER *)NULL; + +/* + * Push the current shell_input_line onto a stack of such lines and make S + * the current input. Used when expanding aliases. EXPAND is used to set + * the value of expand_next_token when the string is popped, so that the + * word after the alias in the original line is handled correctly when the + * alias expands to multiple words. TOKEN is the token that was expanded + * into S; it is saved and used to prevent infinite recursive expansion. + */ +static void +push_string (s, expand, ap) + char *s; + int expand; + alias_t *ap; +{ + STRING_SAVER *temp = (STRING_SAVER *)xmalloc (sizeof (STRING_SAVER)); + + temp->expand_alias = expand; + temp->saved_line = shell_input_line; + temp->saved_line_size = shell_input_line_size; + temp->saved_line_index = shell_input_line_index; + temp->saved_line_terminator = shell_input_line_terminator; + temp->flags = 0; +#if defined (ALIAS) + temp->expander = ap; + if (ap) + temp->flags = PSH_ALIAS; +#endif + temp->next = pushed_string_list; + pushed_string_list = temp; + +#if defined (ALIAS) + if (ap) + ap->flags |= AL_BEINGEXPANDED; +#endif + + shell_input_line = s; + shell_input_line_size = STRLEN (s); + shell_input_line_index = 0; + shell_input_line_terminator = '\0'; +#if 0 + parser_state &= ~PST_ALEXPNEXT; /* XXX */ +#endif + + set_line_mbstate (); +} + +/* + * Make the top of the pushed_string stack be the current shell input. + * Only called when there is something on the stack. Called from shell_getc + * when it thinks it has consumed the string generated by an alias expansion + * and needs to return to the original input line. + */ +static void +pop_string () +{ + STRING_SAVER *t; + + FREE (shell_input_line); + shell_input_line = pushed_string_list->saved_line; + shell_input_line_index = pushed_string_list->saved_line_index; + shell_input_line_size = pushed_string_list->saved_line_size; + shell_input_line_terminator = pushed_string_list->saved_line_terminator; + + if (pushed_string_list->expand_alias) + parser_state |= PST_ALEXPNEXT; + else + parser_state &= ~PST_ALEXPNEXT; + + t = pushed_string_list; + pushed_string_list = pushed_string_list->next; + +#if defined (ALIAS) + if (t->expander) + t->expander->flags &= ~AL_BEINGEXPANDED; +#endif + + free ((char *)t); + + set_line_mbstate (); +} + +static void +free_string_list () +{ + register STRING_SAVER *t, *t1; + + for (t = pushed_string_list; t; ) + { + t1 = t->next; + FREE (t->saved_line); +#if defined (ALIAS) + if (t->expander) + t->expander->flags &= ~AL_BEINGEXPANDED; +#endif + free ((char *)t); + t = t1; + } + pushed_string_list = (STRING_SAVER *)NULL; +} + +#endif /* ALIAS || DPAREN_ARITHMETIC */ + +void +free_pushed_string_input () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + free_string_list (); +#endif +} + +int +parser_expanding_alias () +{ + return (expanding_alias ()); +} + +void +parser_save_alias () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + push_string ((char *)NULL, 0, (alias_t *)NULL); + pushed_string_list->flags = PSH_SOURCE; /* XXX - for now */ +#else + ; +#endif +} + +void +parser_restore_alias () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + if (pushed_string_list) + pop_string (); +#else + ; +#endif +} + +/* Return a line of text, taken from wherever yylex () reads input. + If there is no more input, then we return NULL. If REMOVE_QUOTED_NEWLINE + is non-zero, we remove unquoted \ pairs. This is used by + read_secondary_line to read here documents. */ +static char * +read_a_line (remove_quoted_newline) + int remove_quoted_newline; +{ + static char *line_buffer = (char *)NULL; + static int buffer_size = 0; + int indx, c, peekc, pass_next; + +#if defined (READLINE) + if (no_line_editing && SHOULD_PROMPT ()) +#else + if (SHOULD_PROMPT ()) +#endif + print_prompt (); + + pass_next = indx = 0; + while (1) + { + /* Allow immediate exit if interrupted during input. */ + QUIT; + + c = yy_getc (); + + /* Ignore null bytes in input. */ + if (c == 0) + { +#if 0 + internal_warning ("read_a_line: ignored null byte in input"); +#endif + continue; + } + + /* If there is no more input, then we return NULL. */ + if (c == EOF) + { + if (interactive && bash_input.type == st_stream) + clearerr (stdin); + if (indx == 0) + return ((char *)NULL); + c = '\n'; + } + + /* `+2' in case the final character in the buffer is a newline. */ + RESIZE_MALLOCED_BUFFER (line_buffer, indx, 2, buffer_size, 128); + + /* IF REMOVE_QUOTED_NEWLINES is non-zero, we are reading a + here document with an unquoted delimiter. In this case, + the line will be expanded as if it were in double quotes. + We allow a backslash to escape the next character, but we + need to treat the backslash specially only if a backslash + quoting a backslash-newline pair appears in the line. */ + if (pass_next) + { + line_buffer[indx++] = c; + pass_next = 0; + } + else if (c == '\\' && remove_quoted_newline) + { + QUIT; + peekc = yy_getc (); + if (peekc == '\n') + { + line_number++; + continue; /* Make the unquoted \ pair disappear. */ + } + else + { + yy_ungetc (peekc); + pass_next = 1; + line_buffer[indx++] = c; /* Preserve the backslash. */ + } + } + else + line_buffer[indx++] = c; + + if (c == '\n') + { + line_buffer[indx] = '\0'; + return (line_buffer); + } + } +} + +/* Return a line as in read_a_line (), but insure that the prompt is + the secondary prompt. This is used to read the lines of a here + document. REMOVE_QUOTED_NEWLINE is non-zero if we should remove + newlines quoted with backslashes while reading the line. It is + non-zero unless the delimiter of the here document was quoted. */ +char * +read_secondary_line (remove_quoted_newline) + int remove_quoted_newline; +{ + char *ret; + int n, c; + + prompt_string_pointer = &ps2_prompt; + if (SHOULD_PROMPT()) + prompt_again (); + ret = read_a_line (remove_quoted_newline); +#if defined (HISTORY) + if (ret && remember_on_history && (parser_state & PST_HEREDOC)) + { + /* To make adding the the here-document body right, we need to rely + on history_delimiting_chars() returning \n for the first line of + the here-document body and the null string for the second and + subsequent lines, so we avoid double newlines. + current_command_line_count == 2 for the first line of the body. */ + + current_command_line_count++; + maybe_add_history (ret); + } +#endif /* HISTORY */ + return ret; +} + +/* **************************************************************** */ +/* */ +/* YYLEX () */ +/* */ +/* **************************************************************** */ + +/* Reserved words. These are only recognized as the first word of a + command. */ +STRING_INT_ALIST word_token_alist[] = { + { "if", IF }, + { "then", THEN }, + { "else", ELSE }, + { "elif", ELIF }, + { "fi", FI }, + { "case", CASE }, + { "esac", ESAC }, + { "for", FOR }, +#if defined (SELECT_COMMAND) + { "select", SELECT }, +#endif + { "while", WHILE }, + { "until", UNTIL }, + { "do", DO }, + { "done", DONE }, + { "in", IN }, + { "function", FUNCTION }, +#if defined (COMMAND_TIMING) + { "time", TIME }, +#endif + { "{", '{' }, + { "}", '}' }, + { "!", BANG }, +#if defined (COND_COMMAND) + { "[[", COND_START }, + { "]]", COND_END }, +#endif +#if defined (COPROCESS_SUPPORT) + { "coproc", COPROC }, +#endif + { (char *)NULL, 0} +}; + +/* other tokens that can be returned by read_token() */ +STRING_INT_ALIST other_token_alist[] = { + /* Multiple-character tokens with special values */ + { "--", TIMEIGN }, + { "-p", TIMEOPT }, + { "&&", AND_AND }, + { "||", OR_OR }, + { ">>", GREATER_GREATER }, + { "<<", LESS_LESS }, + { "<&", LESS_AND }, + { ">&", GREATER_AND }, + { ";;", SEMI_SEMI }, + { ";&", SEMI_AND }, + { ";;&", SEMI_SEMI_AND }, + { "<<-", LESS_LESS_MINUS }, + { "<<<", LESS_LESS_LESS }, + { "&>", AND_GREATER }, + { "&>>", AND_GREATER_GREATER }, + { "<>", LESS_GREATER }, + { ">|", GREATER_BAR }, + { "|&", BAR_AND }, + { "EOF", yacc_EOF }, + /* Tokens whose value is the character itself */ + { ">", '>' }, + { "<", '<' }, + { "-", '-' }, + { "{", '{' }, + { "}", '}' }, + { ";", ';' }, + { "(", '(' }, + { ")", ')' }, + { "|", '|' }, + { "&", '&' }, + { "newline", '\n' }, + { (char *)NULL, 0} +}; + +/* others not listed here: + WORD look at yylval.word + ASSIGNMENT_WORD look at yylval.word + NUMBER look at yylval.number + ARITH_CMD look at yylval.word_list + ARITH_FOR_EXPRS look at yylval.word_list + COND_CMD look at yylval.command +*/ + +/* These are used by read_token_word, but appear up here so that shell_getc + can use them to decide when to add otherwise blank lines to the history. */ + +/* The primary delimiter stack. */ +struct dstack dstack = { (char *)NULL, 0, 0 }; + +/* A temporary delimiter stack to be used when decoding prompt strings. + This is needed because command substitutions in prompt strings (e.g., PS2) + can screw up the parser's quoting state. */ +static struct dstack temp_dstack = { (char *)NULL, 0, 0 }; + +/* Macro for accessing the top delimiter on the stack. Returns the + delimiter or zero if none. */ +#define current_delimiter(ds) \ + (ds.delimiter_depth ? ds.delimiters[ds.delimiter_depth - 1] : 0) + +#define push_delimiter(ds, character) \ + do \ + { \ + if (ds.delimiter_depth + 2 > ds.delimiter_space) \ + ds.delimiters = (char *)xrealloc \ + (ds.delimiters, (ds.delimiter_space += 10) * sizeof (char)); \ + ds.delimiters[ds.delimiter_depth] = character; \ + ds.delimiter_depth++; \ + } \ + while (0) + +#define pop_delimiter(ds) ds.delimiter_depth-- + +/* Return the next shell input character. This always reads characters + from shell_input_line; when that line is exhausted, it is time to + read the next line. This is called by read_token when the shell is + processing normal command input. */ + +/* This implements one-character lookahead/lookbehind across physical input + lines, to avoid something being lost because it's pushed back with + shell_ungetc when we're at the start of a line. */ +static int eol_ungetc_lookahead = 0; + +static int +shell_getc (remove_quoted_newline) + int remove_quoted_newline; +{ + register int i; + int c, truncating; + unsigned char uc; + + QUIT; + + if (sigwinch_received) + { + sigwinch_received = 0; + get_new_window_size (0, (int *)0, (int *)0); + } + + if (eol_ungetc_lookahead) + { + c = eol_ungetc_lookahead; + eol_ungetc_lookahead = 0; + return (c); + } + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* If shell_input_line[shell_input_line_index] == 0, but there is + something on the pushed list of strings, then we don't want to go + off and get another line. We let the code down below handle it. */ + + if (!shell_input_line || ((!shell_input_line[shell_input_line_index]) && + (pushed_string_list == (STRING_SAVER *)NULL))) +#else /* !ALIAS && !DPAREN_ARITHMETIC */ + if (!shell_input_line || !shell_input_line[shell_input_line_index]) +#endif /* !ALIAS && !DPAREN_ARITHMETIC */ + { + line_number++; + + /* Let's not let one really really long line blow up memory allocation */ + if (shell_input_line && shell_input_line_size >= 32768) + { + free (shell_input_line); + shell_input_line = 0; + shell_input_line_size = 0; + } + + restart_read: + + /* Allow immediate exit if interrupted during input. */ + QUIT; + + i = truncating = 0; + shell_input_line_terminator = 0; + + /* If the shell is interatctive, but not currently printing a prompt + (interactive_shell && interactive == 0), we don't want to print + notifies or cleanup the jobs -- we want to defer it until we do + print the next prompt. */ + if (interactive_shell == 0 || SHOULD_PROMPT()) + { +#if defined (JOB_CONTROL) + /* This can cause a problem when reading a command as the result + of a trap, when the trap is called from flush_child. This call + had better not cause jobs to disappear from the job table in + that case, or we will have big trouble. */ + notify_and_cleanup (); +#else /* !JOB_CONTROL */ + cleanup_dead_jobs (); +#endif /* !JOB_CONTROL */ + } + +#if defined (READLINE) + if (no_line_editing && SHOULD_PROMPT()) +#else + if (SHOULD_PROMPT()) +#endif + print_prompt (); + + if (bash_input.type == st_stream) + clearerr (stdin); + + while (1) + { + c = yy_getc (); + + /* Allow immediate exit if interrupted during input. */ + QUIT; + + if (c == '\0') + { +#if 0 + internal_warning ("shell_getc: ignored null byte in input"); +#endif + continue; + } + + /* Theoretical overflow */ + /* If we can't put 256 bytes more into the buffer, allocate + everything we can and fill it as full as we can. */ + /* XXX - we ignore rest of line using `truncating' flag */ + if (shell_input_line_size > (SIZE_MAX - 256)) + { + size_t n; + + n = SIZE_MAX - i; /* how much more can we put into the buffer? */ + if (n <= 2) /* we have to save 1 for the newline added below */ + { + if (truncating == 0) + internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%llu): line truncated", shell_input_line_size, SIZE_MAX); + shell_input_line[i] = '\0'; + truncating = 1; + } + if (shell_input_line_size < SIZE_MAX) + { + shell_input_line_size = SIZE_MAX; + shell_input_line = xrealloc (shell_input_line, shell_input_line_size); + } + } + else + RESIZE_MALLOCED_BUFFER (shell_input_line, i, 2, shell_input_line_size, 256); + + if (c == EOF) + { + if (bash_input.type == st_stream) + clearerr (stdin); + + if (i == 0) + shell_input_line_terminator = EOF; + + shell_input_line[i] = '\0'; + break; + } + + if (truncating == 0 || c == '\n') + shell_input_line[i++] = c; + + if (c == '\n') + { + shell_input_line[--i] = '\0'; + current_command_line_count++; + break; + } + } + + shell_input_line_index = 0; + shell_input_line_len = i; /* == strlen (shell_input_line) */ + + set_line_mbstate (); + +#if defined (HISTORY) + if (remember_on_history && shell_input_line && shell_input_line[0]) + { + char *expansions; +# if defined (BANG_HISTORY) + int old_hist; + + /* If the current delimiter is a single quote, we should not be + performing history expansion, even if we're on a different + line from the original single quote. */ + old_hist = history_expansion_inhibited; + if (current_delimiter (dstack) == '\'') + history_expansion_inhibited = 1; +# endif + expansions = pre_process_line (shell_input_line, 1, 1); +# if defined (BANG_HISTORY) + history_expansion_inhibited = old_hist; +# endif + if (expansions != shell_input_line) + { + free (shell_input_line); + shell_input_line = expansions; + shell_input_line_len = shell_input_line ? + strlen (shell_input_line) : 0; + if (shell_input_line_len == 0) + current_command_line_count--; + + /* We have to force the xrealloc below because we don't know + the true allocated size of shell_input_line anymore. */ + shell_input_line_size = shell_input_line_len; + + set_line_mbstate (); + } + } + /* Try to do something intelligent with blank lines encountered while + entering multi-line commands. XXX - this is grotesque */ + else if (remember_on_history && shell_input_line && + shell_input_line[0] == '\0' && + current_command_line_count > 1) + { + if (current_delimiter (dstack)) + /* We know shell_input_line[0] == 0 and we're reading some sort of + quoted string. This means we've got a line consisting of only + a newline in a quoted string. We want to make sure this line + gets added to the history. */ + maybe_add_history (shell_input_line); + else + { + char *hdcs; + hdcs = history_delimiting_chars (shell_input_line); + if (hdcs && hdcs[0] == ';') + maybe_add_history (shell_input_line); + } + } + +#endif /* HISTORY */ + + if (shell_input_line) + { + /* Lines that signify the end of the shell's input should not be + echoed. We should not echo lines while parsing command + substitutions with recursive calls into the parsing engine; those + should only be echoed once when we read the word. That is the + reason for the test against shell_eof_token, which is set to a + right paren when parsing the contents of command substitutions. */ + if (echo_input_at_read && (shell_input_line[0] || + shell_input_line_terminator != EOF) && + shell_eof_token == 0) + fprintf (stderr, "%s\n", shell_input_line); + } + else + { + shell_input_line_size = 0; + prompt_string_pointer = ¤t_prompt_string; + if (SHOULD_PROMPT ()) + prompt_again (); + goto restart_read; + } + + /* Add the newline to the end of this string, iff the string does + not already end in an EOF character. */ + if (shell_input_line_terminator != EOF) + { + if (shell_input_line_size < SIZE_MAX && shell_input_line_len > shell_input_line_size - 3) + shell_input_line = (char *)xrealloc (shell_input_line, + 1 + (shell_input_line_size += 2)); + + shell_input_line[shell_input_line_len] = '\n'; + shell_input_line[shell_input_line_len + 1] = '\0'; + + set_line_mbstate (); + } + } + +next_alias_char: + uc = shell_input_line[shell_input_line_index]; + + if (uc) + shell_input_line_index++; + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* If UC is NULL, we have reached the end of the current input string. If + pushed_string_list is non-empty, it's time to pop to the previous string + because we have fully consumed the result of the last alias expansion. + Do it transparently; just return the next character of the string popped + to. */ + /* If pushed_string_list != 0 but pushed_string_list->expander == 0 (not + currently tested) and the flags value is not PSH_SOURCE, we are not + parsing an alias, we have just saved one (push_string, when called by + the parse_dparen code) In this case, just go on as well. The PSH_SOURCE + case is handled below. */ +pop_alias: + if (uc == 0 && pushed_string_list && pushed_string_list->flags != PSH_SOURCE) + { + pop_string (); + uc = shell_input_line[shell_input_line_index]; + if (uc) + shell_input_line_index++; + } +#endif /* ALIAS || DPAREN_ARITHMETIC */ + + if MBTEST(uc == '\\' && remove_quoted_newline && shell_input_line[shell_input_line_index] == '\n') + { + if (SHOULD_PROMPT ()) + prompt_again (); + line_number++; + /* What do we do here if we're expanding an alias whose definition + includes an escaped newline? If that's the last character in the + alias expansion, we just pop the pushed string list (recall that + we inhibit the appending of a space in mk_alexpansion() if newline + is the last character). If it's not the last character, we need + to consume the quoted newline and move to the next character in + the expansion. */ +#if defined (ALIAS) + if (expanding_alias () && shell_input_line[shell_input_line_index+1] == '\0') + { + uc = 0; + goto pop_alias; + } + else if (expanding_alias () && shell_input_line[shell_input_line_index+1] != '\0') + { + shell_input_line_index++; /* skip newline */ + goto next_alias_char; /* and get next character */ + } + else +#endif + goto restart_read; + } + + if (uc == 0 && shell_input_line_terminator == EOF) + return ((shell_input_line_index != 0) ? '\n' : EOF); + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* We already know that we are not parsing an alias expansion because of the + check for expanding_alias() above. This knows how parse_and_execute + handles switching to st_string input while an alias is being expanded, + hence the check for pushed_string_list without pushed_string_list->expander + and the check for PSH_SOURCE as pushed_string_list->flags. + parse_and_execute and parse_string both change the input type to st_string + and place the string to be parsed and executed into location.string, so + we should not stop reading that until the pointer is '\0'. + The check for shell_input_line_terminator may be superfluous. + + This solves the problem of `.' inside a multi-line alias with embedded + newlines executing things out of order. */ + if (uc == 0 && bash_input.type == st_string && *bash_input.location.string && + pushed_string_list && pushed_string_list->flags == PSH_SOURCE && + shell_input_line_terminator == 0) + { + shell_input_line_index = 0; + goto restart_read; + } +#endif + + return (uc); +} + +/* Put C back into the input for the shell. This might need changes for + HANDLE_MULTIBYTE around EOLs. Since we (currently) never push back a + character different than we read, shell_input_line_property doesn't need + to change when manipulating shell_input_line. The define for + last_shell_getc_is_singlebyte should take care of it, though. */ +static void +shell_ungetc (c) + int c; +{ + if (shell_input_line && shell_input_line_index) + shell_input_line[--shell_input_line_index] = c; + else + eol_ungetc_lookahead = c; +} + +#ifdef INCLUDE_UNUSED +/* Back the input pointer up by one, effectively `ungetting' a character. */ +static void +shell_ungetchar () +{ + if (shell_input_line && shell_input_line_index) + shell_input_line_index--; +} +#endif + +/* Discard input until CHARACTER is seen, then push that character back + onto the input stream. */ +static void +discard_until (character) + int character; +{ + int c; + + while ((c = shell_getc (0)) != EOF && c != character) + ; + + if (c != EOF) + shell_ungetc (c); +} + +void +execute_variable_command (command, vname) + char *command, *vname; +{ + char *last_lastarg; + sh_parser_state_t ps; + + save_parser_state (&ps); + last_lastarg = get_string_value ("_"); + if (last_lastarg) + last_lastarg = savestring (last_lastarg); + + parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEVAL_NOHIST); + + restore_parser_state (&ps); + bind_variable ("_", last_lastarg, 0); + FREE (last_lastarg); + + if (token_to_read == '\n') /* reset_parser was called */ + token_to_read = 0; +} + +/* Place to remember the token. We try to keep the buffer + at a reasonable size, but it can grow. */ +static char *token = (char *)NULL; + +/* Current size of the token buffer. */ +static int token_buffer_size; + +/* Command to read_token () explaining what we want it to do. */ +#define READ 0 +#define RESET 1 +#define prompt_is_ps1 \ + (!prompt_string_pointer || prompt_string_pointer == &ps1_prompt) + +/* Function for yyparse to call. yylex keeps track of + the last two tokens read, and calls read_token. */ +static int +yylex () +{ + if (interactive && (current_token == 0 || current_token == '\n')) + { + /* Before we print a prompt, we might have to check mailboxes. + We do this only if it is time to do so. Notice that only here + is the mail alarm reset; nothing takes place in check_mail () + except the checking of mail. Please don't change this. */ + if (prompt_is_ps1 && parse_and_execute_level == 0 && time_to_check_mail ()) + { + check_mail (); + reset_mail_timer (); + } + + /* Avoid printing a prompt if we're not going to read anything, e.g. + after resetting the parser with read_token (RESET). */ + if (token_to_read == 0 && SHOULD_PROMPT ()) + prompt_again (); + } + + two_tokens_ago = token_before_that; + token_before_that = last_read_token; + last_read_token = current_token; + current_token = read_token (READ); + + if ((parser_state & PST_EOFTOKEN) && current_token == shell_eof_token) + { + current_token = yacc_EOF; + if (bash_input.type == st_string) + rewind_input_string (); + } + parser_state &= ~PST_EOFTOKEN; + + return (current_token); +} + +/* When non-zero, we have read the required tokens + which allow ESAC to be the next one read. */ +static int esacs_needed_count; + +void +gather_here_documents () +{ + int r; + + r = 0; + while (need_here_doc) + { + parser_state |= PST_HEREDOC; + make_here_document (redir_stack[r++], line_number); + parser_state &= ~PST_HEREDOC; + need_here_doc--; + } +} + +/* When non-zero, an open-brace used to create a group is awaiting a close + brace partner. */ +static int open_brace_count; + +#define command_token_position(token) \ + (((token) == ASSIGNMENT_WORD) || (parser_state&PST_REDIRLIST) || \ + ((token) != SEMI_SEMI && (token) != SEMI_AND && (token) != SEMI_SEMI_AND && reserved_word_acceptable(token))) + +#define assignment_acceptable(token) \ + (command_token_position(token) && ((parser_state & PST_CASEPAT) == 0)) + +/* Check to see if TOKEN is a reserved word and return the token + value if it is. */ +#define CHECK_FOR_RESERVED_WORD(tok) \ + do { \ + if (!dollar_present && !quoted && \ + reserved_word_acceptable (last_read_token)) \ + { \ + int i; \ + for (i = 0; word_token_alist[i].word != (char *)NULL; i++) \ + if (STREQ (tok, word_token_alist[i].word)) \ + { \ + if ((parser_state & PST_CASEPAT) && (word_token_alist[i].token != ESAC)) \ + break; \ + if (word_token_alist[i].token == TIME && time_command_acceptable () == 0) \ + break; \ + if (word_token_alist[i].token == ESAC) \ + parser_state &= ~(PST_CASEPAT|PST_CASESTMT); \ + else if (word_token_alist[i].token == CASE) \ + parser_state |= PST_CASESTMT; \ + else if (word_token_alist[i].token == COND_END) \ + parser_state &= ~(PST_CONDCMD|PST_CONDEXPR); \ + else if (word_token_alist[i].token == COND_START) \ + parser_state |= PST_CONDCMD; \ + else if (word_token_alist[i].token == '{') \ + open_brace_count++; \ + else if (word_token_alist[i].token == '}' && open_brace_count) \ + open_brace_count--; \ + return (word_token_alist[i].token); \ + } \ + } \ + } while (0) + +#if defined (ALIAS) + + /* OK, we have a token. Let's try to alias expand it, if (and only if) + it's eligible. + + It is eligible for expansion if EXPAND_ALIASES is set, and + the token is unquoted and the last token read was a command + separator (or expand_next_token is set), and we are currently + processing an alias (pushed_string_list is non-empty) and this + token is not the same as the current or any previously + processed alias. + + Special cases that disqualify: + In a pattern list in a case statement (parser_state & PST_CASEPAT). */ + +static char * +mk_alexpansion (s) + char *s; +{ + int l; + char *r; + + l = strlen (s); + r = xmalloc (l + 2); + strcpy (r, s); + /* If the last character in the alias is a newline, don't add a trailing + space to the expansion. Works with shell_getc above. */ + if (r[l - 1] != ' ' && r[l - 1] != '\n') + r[l++] = ' '; + r[l] = '\0'; + return r; +} + +static int +alias_expand_token (tokstr) + char *tokstr; +{ + char *expanded; + alias_t *ap; + + if (((parser_state & PST_ALEXPNEXT) || command_token_position (last_read_token)) && + (parser_state & PST_CASEPAT) == 0) + { + ap = find_alias (tokstr); + + /* Currently expanding this token. */ + if (ap && (ap->flags & AL_BEINGEXPANDED)) + return (NO_EXPANSION); + + /* mk_alexpansion puts an extra space on the end of the alias expansion, + so the lookahead by the parser works right. If this gets changed, + make sure the code in shell_getc that deals with reaching the end of + an expanded alias is changed with it. */ + expanded = ap ? mk_alexpansion (ap->value) : (char *)NULL; + + if (expanded) + { + push_string (expanded, ap->flags & AL_EXPANDNEXT, ap); + return (RE_READ_TOKEN); + } + else + /* This is an eligible token that does not have an expansion. */ + return (NO_EXPANSION); + } + return (NO_EXPANSION); +} +#endif /* ALIAS */ + +static int +time_command_acceptable () +{ +#if defined (COMMAND_TIMING) + int i; + + if (posixly_correct && shell_compatibility_level > 41) + { + /* Quick check of the rest of the line to find the next token. If it + begins with a `-', Posix says to not return `time' as the token. + This was interp 267. */ + i = shell_input_line_index; + while (i < shell_input_line_len && (shell_input_line[i] == ' ' || shell_input_line[i] == '\t')) + i++; + if (shell_input_line[i] == '-') + return 0; + } + + switch (last_read_token) + { + case 0: + case ';': + case '\n': + case AND_AND: + case OR_OR: + case '&': + case DO: + case THEN: + case ELSE: + case '{': /* } */ + case '(': /* ) */ + case BANG: /* ! time pipeline */ + case TIME: /* time time pipeline */ + case TIMEOPT: /* time -p time pipeline */ + case TIMEIGN: /* time -p -- ... */ + return 1; + default: + return 0; + } +#else + return 0; +#endif /* COMMAND_TIMING */ +} + +/* Handle special cases of token recognition: + IN is recognized if the last token was WORD and the token + before that was FOR or CASE or SELECT. + + DO is recognized if the last token was WORD and the token + before that was FOR or SELECT. + + ESAC is recognized if the last token caused `esacs_needed_count' + to be set + + `{' is recognized if the last token as WORD and the token + before that was FUNCTION, or if we just parsed an arithmetic + `for' command. + + `}' is recognized if there is an unclosed `{' present. + + `-p' is returned as TIMEOPT if the last read token was TIME. + `--' is returned as TIMEIGN if the last read token was TIMEOPT. + + ']]' is returned as COND_END if the parser is currently parsing + a conditional expression ((parser_state & PST_CONDEXPR) != 0) + + `time' is returned as TIME if and only if it is immediately + preceded by one of `;', `\n', `||', `&&', or `&'. +*/ + +static int +special_case_tokens (tokstr) + char *tokstr; +{ + if ((last_read_token == WORD) && +#if defined (SELECT_COMMAND) + ((token_before_that == FOR) || (token_before_that == CASE) || (token_before_that == SELECT)) && +#else + ((token_before_that == FOR) || (token_before_that == CASE)) && +#endif + (tokstr[0] == 'i' && tokstr[1] == 'n' && tokstr[2] == 0)) + { + if (token_before_that == CASE) + { + parser_state |= PST_CASEPAT; + esacs_needed_count++; + } + return (IN); + } + + if (last_read_token == WORD && +#if defined (SELECT_COMMAND) + (token_before_that == FOR || token_before_that == SELECT) && +#else + (token_before_that == FOR) && +#endif + (tokstr[0] == 'd' && tokstr[1] == 'o' && tokstr[2] == '\0')) + return (DO); + + /* Ditto for ESAC in the CASE case. + Specifically, this handles "case word in esac", which is a legal + construct, certainly because someone will pass an empty arg to the + case construct, and we don't want it to barf. Of course, we should + insist that the case construct has at least one pattern in it, but + the designers disagree. */ + if (esacs_needed_count) + { + esacs_needed_count--; + if (STREQ (tokstr, "esac")) + { + parser_state &= ~PST_CASEPAT; + return (ESAC); + } + } + + /* The start of a shell function definition. */ + if (parser_state & PST_ALLOWOPNBRC) + { + parser_state &= ~PST_ALLOWOPNBRC; + if (tokstr[0] == '{' && tokstr[1] == '\0') /* } */ + { + open_brace_count++; + function_bstart = line_number; + return ('{'); /* } */ + } + } + + /* We allow a `do' after a for ((...)) without an intervening + list_terminator */ + if (last_read_token == ARITH_FOR_EXPRS && tokstr[0] == 'd' && tokstr[1] == 'o' && !tokstr[2]) + return (DO); + if (last_read_token == ARITH_FOR_EXPRS && tokstr[0] == '{' && tokstr[1] == '\0') /* } */ + { + open_brace_count++; + return ('{'); /* } */ + } + + if (open_brace_count && reserved_word_acceptable (last_read_token) && tokstr[0] == '}' && !tokstr[1]) + { + open_brace_count--; /* { */ + return ('}'); + } + +#if defined (COMMAND_TIMING) + /* Handle -p after `time'. */ + if (last_read_token == TIME && tokstr[0] == '-' && tokstr[1] == 'p' && !tokstr[2]) + return (TIMEOPT); + /* Handle -- after `time -p'. */ + if (last_read_token == TIMEOPT && tokstr[0] == '-' && tokstr[1] == '-' && !tokstr[2]) + return (TIMEIGN); +#endif + +#if defined (COND_COMMAND) /* [[ */ + if ((parser_state & PST_CONDEXPR) && tokstr[0] == ']' && tokstr[1] == ']' && tokstr[2] == '\0') + return (COND_END); +#endif + + return (-1); +} + +/* Called from shell.c when Control-C is typed at top level. Or + by the error rule at top level. */ +void +reset_parser () +{ + dstack.delimiter_depth = 0; /* No delimiters found so far. */ + open_brace_count = 0; + +#if defined (EXTENDED_GLOB) + /* Reset to global value of extended glob */ + if (parser_state & PST_EXTPAT) + extended_glob = global_extglob; +#endif + + parser_state = 0; + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + if (pushed_string_list) + free_string_list (); +#endif /* ALIAS || DPAREN_ARITHMETIC */ + + if (shell_input_line) + { + free (shell_input_line); + shell_input_line = (char *)NULL; + shell_input_line_size = shell_input_line_index = 0; + } + + FREE (word_desc_to_read); + word_desc_to_read = (WORD_DESC *)NULL; + + current_token = '\n'; /* XXX */ + last_read_token = '\n'; + token_to_read = '\n'; +} + +/* Read the next token. Command can be READ (normal operation) or + RESET (to normalize state). */ +static int +read_token (command) + int command; +{ + int character; /* Current character. */ + int peek_char; /* Temporary look-ahead character. */ + int result; /* The thing to return. */ + + if (command == RESET) + { + reset_parser (); + return ('\n'); + } + + if (token_to_read) + { + result = token_to_read; + if (token_to_read == WORD || token_to_read == ASSIGNMENT_WORD) + { + yylval.word = word_desc_to_read; + word_desc_to_read = (WORD_DESC *)NULL; + } + token_to_read = 0; + return (result); + } + +#if defined (COND_COMMAND) + if ((parser_state & (PST_CONDCMD|PST_CONDEXPR)) == PST_CONDCMD) + { + cond_lineno = line_number; + parser_state |= PST_CONDEXPR; + yylval.command = parse_cond_command (); + if (cond_token != COND_END) + { + cond_error (); + return (-1); + } + token_to_read = COND_END; + parser_state &= ~(PST_CONDEXPR|PST_CONDCMD); + return (COND_CMD); + } +#endif + +#if defined (ALIAS) + /* This is a place to jump back to once we have successfully expanded a + token with an alias and pushed the string with push_string () */ + re_read_token: +#endif /* ALIAS */ + + /* Read a single word from input. Start by skipping blanks. */ + while ((character = shell_getc (1)) != EOF && shellblank (character)) + ; + + if (character == EOF) + { + EOF_Reached = 1; + return (yacc_EOF); + } + + if MBTEST(character == '#' && (!interactive || interactive_comments)) + { + /* A comment. Discard until EOL or EOF, and then return a newline. */ + discard_until ('\n'); + shell_getc (0); + character = '\n'; /* this will take the next if statement and return. */ + } + + if (character == '\n') + { + /* If we're about to return an unquoted newline, we can go and collect + the text of any pending here document. */ + if (need_here_doc) + gather_here_documents (); + +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + parser_state &= ~PST_ASSIGNOK; + + return (character); + } + + if (parser_state & PST_REGEXP) + goto tokword; + + /* Shell meta-characters. */ + if MBTEST(shellmeta (character) && ((parser_state & PST_DBLPAREN) == 0)) + { +#if defined (ALIAS) + /* Turn off alias tokenization iff this character sequence would + not leave us ready to read a command. */ + if (character == '<' || character == '>') + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + parser_state &= ~PST_ASSIGNOK; + + peek_char = shell_getc (1); + if (character == peek_char) + { + switch (character) + { + case '<': + /* If '<' then we could be at "<<" or at "<<-". We have to + look ahead one more character. */ + peek_char = shell_getc (1); + if MBTEST(peek_char == '-') + return (LESS_LESS_MINUS); + else if MBTEST(peek_char == '<') + return (LESS_LESS_LESS); + else + { + shell_ungetc (peek_char); + return (LESS_LESS); + } + + case '>': + return (GREATER_GREATER); + + case ';': + parser_state |= PST_CASEPAT; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + peek_char = shell_getc (1); + if MBTEST(peek_char == '&') + return (SEMI_SEMI_AND); + else + { + shell_ungetc (peek_char); + return (SEMI_SEMI); + } + + case '&': + return (AND_AND); + + case '|': + return (OR_OR); + +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) + case '(': /* ) */ + result = parse_dparen (character); + if (result == -2) + break; + else + return result; +#endif + } + } + else if MBTEST(character == '<' && peek_char == '&') + return (LESS_AND); + else if MBTEST(character == '>' && peek_char == '&') + return (GREATER_AND); + else if MBTEST(character == '<' && peek_char == '>') + return (LESS_GREATER); + else if MBTEST(character == '>' && peek_char == '|') + return (GREATER_BAR); + else if MBTEST(character == '&' && peek_char == '>') + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '>') + return (AND_GREATER_GREATER); + else + { + shell_ungetc (peek_char); + return (AND_GREATER); + } + } + else if MBTEST(character == '|' && peek_char == '&') + return (BAR_AND); + else if MBTEST(character == ';' && peek_char == '&') + { + parser_state |= PST_CASEPAT; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + return (SEMI_AND); + } + + shell_ungetc (peek_char); + + /* If we look like we are reading the start of a function + definition, then let the reader know about it so that + we will do the right thing with `{'. */ + if MBTEST(character == ')' && last_read_token == '(' && token_before_that == WORD) + { + parser_state |= PST_ALLOWOPNBRC; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + function_dstart = line_number; + } + + /* case pattern lists may be preceded by an optional left paren. If + we're not trying to parse a case pattern list, the left paren + indicates a subshell. */ + if MBTEST(character == '(' && (parser_state & PST_CASEPAT) == 0) /* ) */ + parser_state |= PST_SUBSHELL; + /*(*/ + else if MBTEST((parser_state & PST_CASEPAT) && character == ')') + parser_state &= ~PST_CASEPAT; + /*(*/ + else if MBTEST((parser_state & PST_SUBSHELL) && character == ')') + parser_state &= ~PST_SUBSHELL; + +#if defined (PROCESS_SUBSTITUTION) + /* Check for the constructs which introduce process substitution. + Shells running in `posix mode' don't do process substitution. */ + if MBTEST(posixly_correct || ((character != '>' && character != '<') || peek_char != '(')) /*)*/ +#endif /* PROCESS_SUBSTITUTION */ + return (character); + } + + /* Hack <&- (close stdin) case. Also <&N- (dup and close). */ + if MBTEST(character == '-' && (last_read_token == LESS_AND || last_read_token == GREATER_AND)) + return (character); + +tokword: + /* Okay, if we got this far, we have to read a word. Read one, + and then check it against the known ones. */ + result = read_token_word (character); +#if defined (ALIAS) + if (result == RE_READ_TOKEN) + goto re_read_token; +#endif + return result; +} + +/* + * Match a $(...) or other grouping construct. This has to handle embedded + * quoted strings ('', ``, "") and nested constructs. It also must handle + * reprompting the user, if necessary, after reading a newline, and returning + * correct error values if it reads EOF. + */ +#define P_FIRSTCLOSE 0x0001 +#define P_ALLOWESC 0x0002 +#define P_DQUOTE 0x0004 +#define P_COMMAND 0x0008 /* parsing a command, so look for comments */ +#define P_BACKQUOTE 0x0010 /* parsing a backquoted command substitution */ +#define P_ARRAYSUB 0x0020 /* parsing a [...] array subscript for assignment */ +#define P_DOLBRACE 0x0040 /* parsing a ${...} construct */ + +/* Lexical state while parsing a grouping construct or $(...). */ +#define LEX_WASDOL 0x001 +#define LEX_CKCOMMENT 0x002 +#define LEX_INCOMMENT 0x004 +#define LEX_PASSNEXT 0x008 +#define LEX_RESWDOK 0x010 +#define LEX_CKCASE 0x020 +#define LEX_INCASE 0x040 +#define LEX_INHEREDOC 0x080 +#define LEX_HEREDELIM 0x100 /* reading here-doc delimiter */ +#define LEX_STRIPDOC 0x200 /* <<- strip tabs from here doc delim */ +#define LEX_INWORD 0x400 + +#define COMSUB_META(ch) ((ch) == ';' || (ch) == '&' || (ch) == '|') + +#define CHECK_NESTRET_ERROR() \ + do { \ + if (nestret == &matched_pair_error) \ + { \ + free (ret); \ + return &matched_pair_error; \ + } \ + } while (0) + +#define APPEND_NESTRET() \ + do { \ + if (nestlen) \ + { \ + RESIZE_MALLOCED_BUFFER (ret, retind, nestlen, retsize, 64); \ + strcpy (ret + retind, nestret); \ + retind += nestlen; \ + } \ + } while (0) + +static char matched_pair_error; + +static char * +parse_matched_pair (qc, open, close, lenp, flags) + int qc; /* `"' if this construct is within double quotes */ + int open, close; + int *lenp, flags; +{ + int count, ch, tflags; + int nestlen, ttranslen, start_lineno; + char *ret, *nestret, *ttrans; + int retind, retsize, rflags; + int dolbrace_state; + + dolbrace_state = (flags & P_DOLBRACE) ? DOLBRACE_PARAM : 0; + +/*itrace("parse_matched_pair[%d]: open = %c close = %c flags = %d", line_number, open, close, flags);*/ + count = 1; + tflags = 0; + + if ((flags & P_COMMAND) && qc != '`' && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0) + tflags |= LEX_CKCOMMENT; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ + rflags = (qc == '"') ? P_DQUOTE : (flags & P_DQUOTE); + + ret = (char *)xmalloc (retsize = 64); + retind = 0; + + start_lineno = line_number; + while (count) + { + ch = shell_getc (qc != '\'' && (tflags & (LEX_PASSNEXT)) == 0); + + if (ch == EOF) + { + free (ret); + parser_error (start_lineno, _("unexpected EOF while looking for matching `%c'"), close); + EOF_Reached = 1; /* XXX */ + return (&matched_pair_error); + } + + /* Possible reprompting. */ + if (ch == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* Don't bother counting parens or doing anything else if in a comment + or part of a case statement */ + if (tflags & LEX_INCOMMENT) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + if (ch == '\n') + tflags &= ~LEX_INCOMMENT; + + continue; + } + + /* Not exactly right yet, should handle shell metacharacters, too. If + any changes are made to this test, make analogous changes to subst.c: + extract_delimited_string(). */ + else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || shellblank (ret[retind - 1]))) + tflags |= LEX_INCOMMENT; + + if (tflags & LEX_PASSNEXT) /* last char was backslash */ + { + tflags &= ~LEX_PASSNEXT; + if (qc != '\'' && ch == '\n') /* double-quoted \ disappears. */ + { + if (retind > 0) + retind--; /* swallow previously-added backslash */ + continue; + } + + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + if MBTEST(ch == CTLESC) + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + /* If we're reparsing the input (e.g., from parse_string_to_word_list), + we've already prepended CTLESC to single-quoted results of $'...'. + We may want to do this for other CTLESC-quoted characters in + reparse, too. */ + else if MBTEST((parser_state & PST_REPARSE) && open == '\'' && (ch == CTLESC || ch == CTLNUL)) + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + continue; + } + else if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + else if MBTEST(ch == close) /* ending delimiter */ + count--; + /* handle nested ${...} specially. */ + else if MBTEST(open != close && (tflags & LEX_WASDOL) && open == '{' && ch == open) /* } */ + count++; + else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && ch == open) /* nested begin */ + count++; + + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + /* If we just read the ending character, don't bother continuing. */ + if (count == 0) + break; + + if (open == '\'') /* '' inside grouping construct */ + { + if MBTEST((flags & P_ALLOWESC) && ch == '\\') + tflags |= LEX_PASSNEXT; + continue; + } + + if MBTEST(ch == '\\') /* backslashes */ + tflags |= LEX_PASSNEXT; + + /* Based on which dolstate is currently in (param, op, or word), + decide what the op is. We're really only concerned if it's % or + #, so we can turn on a flag that says whether or not we should + treat single quotes as special when inside a double-quoted + ${...}. This logic must agree with subst.c:extract_dollar_brace_string + since they share the same defines. */ + /* FLAG POSIX INTERP 221 */ + if (flags & P_DOLBRACE) + { + /* ${param%[%]word} */ + if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '%' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param#[#]word} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '#' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param/[/]pat/rep} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '/' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE2; /* XXX */ + /* ${param^[^]pat} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '^' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param,[,]pat} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == ',' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && strchr ("#%^,~:-=?+/", ch) != 0) + dolbrace_state = DOLBRACE_OP; + else if MBTEST(dolbrace_state == DOLBRACE_OP && strchr ("#%^,~:-=?+/", ch) == 0) + dolbrace_state = DOLBRACE_WORD; + } + + /* The big hammer. Single quotes aren't special in double quotes. The + problem is that Posix used to say the single quotes are semi-special: + within a double-quoted ${...} construct "an even number of + unescaped double-quotes or single-quotes, if any, shall occur." */ + /* This was changed in Austin Group Interp 221 */ + if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'') + continue; + + /* Could also check open == '`' if we want to parse grouping constructs + inside old-style command substitution. */ + if (open != close) /* a grouping construct */ + { + if MBTEST(shellquote (ch)) + { + /* '', ``, or "" inside $(...) or other grouping construct. */ + push_delimiter (dstack, ch); + if MBTEST((tflags & LEX_WASDOL) && ch == '\'') /* $'...' inside group */ + nestret = parse_matched_pair (ch, ch, ch, &nestlen, P_ALLOWESC|rflags); + else + nestret = parse_matched_pair (ch, ch, ch, &nestlen, rflags); + pop_delimiter (dstack); + CHECK_NESTRET_ERROR (); + + if MBTEST((tflags & LEX_WASDOL) && ch == '\'' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Translate $'...' here. */ + ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen); + xfree (nestret); + + /* If we're parsing a double-quoted brace expansion and we are + not in a place where single quotes are treated specially, + make sure we single-quote the results of the ansi + expansion because quote removal should remove them later */ + /* FLAG POSIX INTERP 221 */ + if ((shell_compatibility_level > 42) && (rflags & P_DQUOTE) && (dolbrace_state == DOLBRACE_QUOTE2) && (flags & P_DOLBRACE)) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else if ((rflags & P_DQUOTE) == 0) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else + { + nestret = ttrans; + nestlen = ttranslen; + } + retind -= 2; /* back up before the $' */ + } + else if MBTEST((tflags & LEX_WASDOL) && ch == '"' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Locale expand $"..." here. */ + ttrans = localeexpand (nestret, 0, nestlen - 1, start_lineno, &ttranslen); + xfree (nestret); + + nestret = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + nestlen = ttranslen + 2; + retind -= 2; /* back up before the $" */ + } + + APPEND_NESTRET (); + FREE (nestret); + } + else if ((flags & P_ARRAYSUB) && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + goto parse_dollar_word; + } + /* Parse an old-style command substitution within double quotes as a + single word. */ + /* XXX - sh and ksh93 don't do this - XXX */ + else if MBTEST(open == '"' && ch == '`') + { + nestret = parse_matched_pair (0, '`', '`', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + else if MBTEST(open != '`' && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + /* check for $(), $[], or ${} inside quoted string. */ + { +parse_dollar_word: + if (open == ch) /* undo previous increment */ + count--; + if (ch == '(') /* ) */ + nestret = parse_comsub (0, '(', ')', &nestlen, (rflags|P_COMMAND) & ~P_DQUOTE); + else if (ch == '{') /* } */ + nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|P_DOLBRACE|rflags); + else if (ch == '[') /* ] */ + nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + if MBTEST(ch == '$') + tflags |= LEX_WASDOL; + else + tflags &= ~LEX_WASDOL; + } + + ret[retind] = '\0'; + if (lenp) + *lenp = retind; +/*itrace("parse_matched_pair[%d]: returning %s", line_number, ret);*/ + return ret; +} + +/* Parse a $(...) command substitution. This is messier than I'd like, and + reproduces a lot more of the token-reading code than I'd like. */ +static char * +parse_comsub (qc, open, close, lenp, flags) + int qc; /* `"' if this construct is within double quotes */ + int open, close; + int *lenp, flags; +{ + int count, ch, peekc, tflags, lex_rwlen, lex_wlen, lex_firstind; + int nestlen, ttranslen, start_lineno; + char *ret, *nestret, *ttrans, *heredelim; + int retind, retsize, rflags, hdlen; + + /* Posix interp 217 says arithmetic expressions have precedence, so + assume $(( introduces arithmetic expansion and parse accordingly. */ + peekc = shell_getc (0); + shell_ungetc (peekc); + if (peekc == '(') + return (parse_matched_pair (qc, open, close, lenp, 0)); + +/*itrace("parse_comsub: qc = `%c' open = %c close = %c", qc, open, close);*/ + count = 1; + tflags = LEX_RESWDOK; + + if ((flags & P_COMMAND) && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0) + tflags |= LEX_CKCASE; + if ((tflags & LEX_CKCASE) && (interactive == 0 || interactive_comments)) + tflags |= LEX_CKCOMMENT; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ + rflags = (flags & P_DQUOTE); + + ret = (char *)xmalloc (retsize = 64); + retind = 0; + + start_lineno = line_number; + lex_rwlen = lex_wlen = 0; + + heredelim = 0; + lex_firstind = -1; + + while (count) + { +comsub_readchar: + ch = shell_getc (qc != '\'' && (tflags & (LEX_INCOMMENT|LEX_PASSNEXT)) == 0); + + if (ch == EOF) + { +eof_error: + free (ret); + FREE (heredelim); + parser_error (start_lineno, _("unexpected EOF while looking for matching `%c'"), close); + EOF_Reached = 1; /* XXX */ + return (&matched_pair_error); + } + + /* If we hit the end of a line and are reading the contents of a here + document, and it's not the same line that the document starts on, + check for this line being the here doc delimiter. Otherwise, if + we're in a here document, mark the next character as the beginning + of a line. */ + if (ch == '\n') + { + if ((tflags & LEX_HEREDELIM) && heredelim) + { + tflags &= ~LEX_HEREDELIM; + tflags |= LEX_INHEREDOC; + lex_firstind = retind + 1; + } + else if (tflags & LEX_INHEREDOC) + { + int tind; + tind = lex_firstind; + while ((tflags & LEX_STRIPDOC) && ret[tind] == '\t') + tind++; + if (STREQN (ret + tind, heredelim, hdlen)) + { + tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC); +/*itrace("parse_comsub:%d: found here doc end `%s'", line_number, ret + tind);*/ + free (heredelim); + heredelim = 0; + lex_firstind = -1; + } + else + lex_firstind = retind + 1; + } + } + + /* Possible reprompting. */ + if (ch == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* XXX -- possibly allow here doc to be delimited by ending right + paren. */ + if ((tflags & LEX_INHEREDOC) && ch == close && count == 1) + { + int tind; +/*itrace("parse_comsub: in here doc, ch == close, retind - firstind = %d hdlen = %d retind = %d", retind-lex_firstind, hdlen, retind);*/ + tind = lex_firstind; + while ((tflags & LEX_STRIPDOC) && ret[tind] == '\t') + tind++; + if (retind-tind == hdlen && STREQN (ret + tind, heredelim, hdlen)) + { + tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC); +/*itrace("parse_comsub:%d: found here doc end `%s'", line_number, ret + tind);*/ + free (heredelim); + heredelim = 0; + lex_firstind = -1; + } + } + + /* Don't bother counting parens or doing anything else if in a comment */ + if (tflags & (LEX_INCOMMENT|LEX_INHEREDOC)) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + if ((tflags & LEX_INCOMMENT) && ch == '\n') + { +/*itrace("parse_comsub:%d: lex_incomment -> 0 ch = `%c'", line_number, ch);*/ + tflags &= ~LEX_INCOMMENT; + } + + continue; + } + + if (tflags & LEX_PASSNEXT) /* last char was backslash */ + { +/*itrace("parse_comsub:%d: lex_passnext -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + tflags &= ~LEX_PASSNEXT; + if (qc != '\'' && ch == '\n') /* double-quoted \ disappears. */ + { + if (retind > 0) + retind--; /* swallow previously-added backslash */ + continue; + } + + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + if MBTEST(ch == CTLESC) + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + + /* If this is a shell break character, we are not in a word. If not, + we either start or continue a word. */ + if MBTEST(shellbreak (ch)) + { + tflags &= ~LEX_INWORD; +/*itrace("parse_comsub:%d: lex_inword -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + } + else + { + if (tflags & LEX_INWORD) + { + lex_wlen++; +/*itrace("parse_comsub:%d: lex_inword == 1 ch = `%c' lex_wlen = %d (%d)", line_number, ch, lex_wlen, __LINE__);*/ + } + else + { +/*itrace("parse_comsub:%d: lex_inword -> 1 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + tflags |= LEX_INWORD; + lex_wlen = 0; + } + } + + /* Skip whitespace */ + if MBTEST(shellblank (ch) && (tflags & LEX_HEREDELIM) == 0 && lex_rwlen == 0) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + continue; + } + + /* Either we are looking for the start of the here-doc delimiter + (lex_firstind == -1) or we are reading one (lex_firstind >= 0). + If this character is a shell break character and we are reading + the delimiter, save it and note that we are now reading a here + document. If we've found the start of the delimiter, note it by + setting lex_firstind. Backslashes can quote shell metacharacters + in here-doc delimiters. */ + if (tflags & LEX_HEREDELIM) + { + if (lex_firstind == -1 && shellbreak (ch) == 0) + lex_firstind = retind; +#if 0 + else if (heredelim && (tflags & LEX_PASSNEXT) == 0 && ch == '\n') + { + tflags |= LEX_INHEREDOC; + tflags &= ~LEX_HEREDELIM; + lex_firstind = retind + 1; + } +#endif + else if (lex_firstind >= 0 && (tflags & LEX_PASSNEXT) == 0 && shellbreak (ch)) + { + if (heredelim == 0) + { + nestret = substring (ret, lex_firstind, retind); + heredelim = string_quote_removal (nestret, 0); + free (nestret); + hdlen = STRLEN(heredelim); +/*itrace("parse_comsub:%d: found here doc delimiter `%s' (%d)", line_number, heredelim, hdlen);*/ + } + if (ch == '\n') + { + tflags |= LEX_INHEREDOC; + tflags &= ~LEX_HEREDELIM; + lex_firstind = retind + 1; + } + else + lex_firstind = -1; + } + } + + /* Meta-characters that can introduce a reserved word. Not perfect yet. */ + if MBTEST((tflags & LEX_RESWDOK) == 0 && (tflags & LEX_CKCASE) && (tflags & LEX_INCOMMENT) == 0 && (shellmeta(ch) || ch == '\n')) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + peekc = shell_getc (1); + if (ch == peekc && (ch == '&' || ch == '|' || ch == ';')) /* two-character tokens */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; +/*itrace("parse_comsub:%d: set lex_reswordok = 1, ch = `%c'", line_number, ch);*/ + tflags |= LEX_RESWDOK; + lex_rwlen = 0; + continue; + } + else if (ch == '\n' || COMSUB_META(ch)) + { + shell_ungetc (peekc); +/*itrace("parse_comsub:%d: set lex_reswordok = 1, ch = `%c'", line_number, ch);*/ + tflags |= LEX_RESWDOK; + lex_rwlen = 0; + continue; + } + else if (ch == EOF) + goto eof_error; + else + { + /* `unget' the character we just added and fall through */ + retind--; + shell_ungetc (peekc); + } + } + + /* If we can read a reserved word, try to read one. */ + if (tflags & LEX_RESWDOK) + { + if MBTEST(islower (ch)) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + lex_rwlen++; + continue; + } + else if MBTEST(lex_rwlen == 4 && shellbreak (ch)) + { + if (STREQN (ret + retind - 4, "case", 4)) + { + tflags |= LEX_INCASE; +/*itrace("parse_comsub:%d: found `case', lex_incase -> 1 lex_reswdok -> 0", line_number);*/ + } + else if (STREQN (ret + retind - 4, "esac", 4)) + { + tflags &= ~LEX_INCASE; +/*itrace("parse_comsub:%d: found `esac', lex_incase -> 0 lex_reswdok -> 0", line_number);*/ + } + tflags &= ~LEX_RESWDOK; + } + else if MBTEST((tflags & LEX_CKCOMMENT) && ch == '#' && (lex_rwlen == 0 || ((tflags & LEX_INWORD) && lex_wlen == 0))) + ; /* don't modify LEX_RESWDOK if we're starting a comment */ + /* Allow `do' followed by space, tab, or newline to preserve the + RESWDOK flag, but reset the reserved word length counter so we + can read another one. */ + else if MBTEST(((tflags & LEX_INCASE) == 0) && + (isblank(ch) || ch == '\n') && + lex_rwlen == 2 && + STREQN (ret + retind - 2, "do", 2)) + { +/*itrace("parse_comsub:%d: lex_incase == 1 found `%c', found \"do\"", line_number, ch);*/ + lex_rwlen = 0; + } + else if MBTEST((tflags & LEX_INCASE) && ch != '\n') + /* If we can read a reserved word and we're in case, we're at the + point where we can read a new pattern list or an esac. We + handle the esac case above. If we read a newline, we want to + leave LEX_RESWDOK alone. If we read anything else, we want to + turn off LEX_RESWDOK, since we're going to read a pattern list. */ + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: lex_incase == 1 found `%c', lex_reswordok -> 0", line_number, ch);*/ + } + else if MBTEST(shellbreak (ch) == 0) + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/ + } +#if 0 + /* If we find a space or tab but have read something and it's not + `do', turn off the reserved-word-ok flag */ + else if MBTEST(isblank (ch) && lex_rwlen > 0) + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/ + } +#endif + } + + /* Might be the start of a here-doc delimiter */ + if MBTEST((tflags & LEX_INCOMMENT) == 0 && (tflags & LEX_CKCASE) && ch == '<') + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + peekc = shell_getc (1); + if (peekc == EOF) + goto eof_error; + if (peekc == ch) + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; + peekc = shell_getc (1); + if (peekc == EOF) + goto eof_error; + if (peekc == '-') + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; + tflags |= LEX_STRIPDOC; + } + else + shell_ungetc (peekc); + if (peekc != '<') + { + tflags |= LEX_HEREDELIM; + lex_firstind = -1; + } + continue; + } + else + ch = peekc; /* fall through and continue XXX */ + } + else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (((tflags & LEX_RESWDOK) && lex_rwlen == 0) || ((tflags & LEX_INWORD) && lex_wlen == 0))) + { +/*itrace("parse_comsub:%d: lex_incomment -> 1 (%d)", line_number, __LINE__);*/ + tflags |= LEX_INCOMMENT; + } + + if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } +#if 0 + else if MBTEST((tflags & LEX_INCASE) && ch == close && close == ')') + tflags &= ~LEX_INCASE; /* XXX */ +#endif + else if MBTEST(ch == close && (tflags & LEX_INCASE) == 0) /* ending delimiter */ + { + count--; +/*itrace("parse_comsub:%d: found close: count = %d", line_number, count);*/ + } + else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && (tflags & LEX_INCASE) == 0 && ch == open) /* nested begin */ + { + count++; +/*itrace("parse_comsub:%d: found open: count = %d", line_number, count);*/ + } + + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + /* If we just read the ending character, don't bother continuing. */ + if (count == 0) + break; + + if MBTEST(ch == '\\') /* backslashes */ + tflags |= LEX_PASSNEXT; + + if MBTEST(shellquote (ch)) + { + /* '', ``, or "" inside $(...). */ + push_delimiter (dstack, ch); + if MBTEST((tflags & LEX_WASDOL) && ch == '\'') /* $'...' inside group */ + nestret = parse_matched_pair (ch, ch, ch, &nestlen, P_ALLOWESC|rflags); + else + nestret = parse_matched_pair (ch, ch, ch, &nestlen, rflags); + pop_delimiter (dstack); + CHECK_NESTRET_ERROR (); + + if MBTEST((tflags & LEX_WASDOL) && ch == '\'' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Translate $'...' here. */ + ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen); + xfree (nestret); + + if ((rflags & P_DQUOTE) == 0) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else + { + nestret = ttrans; + nestlen = ttranslen; + } + retind -= 2; /* back up before the $' */ + } + else if MBTEST((tflags & LEX_WASDOL) && ch == '"' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Locale expand $"..." here. */ + ttrans = localeexpand (nestret, 0, nestlen - 1, start_lineno, &ttranslen); + xfree (nestret); + + nestret = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + nestlen = ttranslen + 2; + retind -= 2; /* back up before the $" */ + } + + APPEND_NESTRET (); + FREE (nestret); + } + else if MBTEST((tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + /* check for $(), $[], or ${} inside command substitution. */ + { + if ((tflags & LEX_INCASE) == 0 && open == ch) /* undo previous increment */ + count--; + if (ch == '(') /* ) */ + nestret = parse_comsub (0, '(', ')', &nestlen, (rflags|P_COMMAND) & ~P_DQUOTE); + else if (ch == '{') /* } */ + nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|P_DOLBRACE|rflags); + else if (ch == '[') /* ] */ + nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + if MBTEST(ch == '$') + tflags |= LEX_WASDOL; + else + tflags &= ~LEX_WASDOL; + } + + FREE (heredelim); + ret[retind] = '\0'; + if (lenp) + *lenp = retind; +/*itrace("parse_comsub:%d: returning `%s'", line_number, ret);*/ + return ret; +} + +/* Recursively call the parser to parse a $(...) command substitution. */ +char * +xparse_dolparen (base, string, indp, flags) + char *base; + char *string; + int *indp; + int flags; +{ + sh_parser_state_t ps; + sh_input_line_state_t ls; + int orig_ind, nc, sflags, orig_eof_token; + char *ret, *s, *ep, *ostring; + + /*yydebug = 1;*/ + orig_ind = *indp; + ostring = string; + +/*itrace("xparse_dolparen: size = %d shell_input_line = `%s'", shell_input_line_size, shell_input_line);*/ + sflags = SEVAL_NONINT|SEVAL_NOHIST|SEVAL_NOFREE; + if (flags & SX_NOLONGJMP) + sflags |= SEVAL_NOLONGJMP; + save_parser_state (&ps); + save_input_line_state (&ls); + orig_eof_token = shell_eof_token; + + /*(*/ + parser_state |= PST_CMDSUBST|PST_EOFTOKEN; /* allow instant ')' */ /*(*/ + shell_eof_token = ')'; + parse_string (string, "command substitution", sflags, &ep); + + shell_eof_token = orig_eof_token; + restore_parser_state (&ps); + reset_parser (); + /* reset_parser clears shell_input_line and associated variables */ + restore_input_line_state (&ls); + if (interactive) + token_to_read = 0; + + /* Need to find how many characters parse_and_execute consumed, update + *indp, if flags != 0, copy the portion of the string parsed into RET + and return it. If flags & 1 (EX_NOALLOC) we can return NULL. */ + + /*(*/ + if (ep[-1] != ')') + { +#if DEBUG + if (ep[-1] != '\n') + itrace("xparse_dolparen:%d: ep[-1] != RPAREN (%d), ep = `%s'", line_number, ep[-1], ep); +#endif + while (ep > ostring && ep[-1] == '\n') ep--; + } + + nc = ep - ostring; + *indp = ep - base - 1; + + /*(*/ +#if DEBUG + if (base[*indp] != ')') + itrace("xparse_dolparen:%d: base[%d] != RPAREN (%d), base = `%s'", line_number, *indp, base[*indp], base); +#endif + + if (flags & SX_NOALLOC) + return (char *)NULL; + + if (nc == 0) + { + ret = xmalloc (1); + ret[0] = '\0'; + } + else + ret = substring (ostring, 0, nc - 1); + + return ret; +} + +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) +/* Parse a double-paren construct. It can be either an arithmetic + command, an arithmetic `for' command, or a nested subshell. Returns + the parsed token, -1 on error, or -2 if we didn't do anything and + should just go on. */ +static int +parse_dparen (c) + int c; +{ + int cmdtyp, sline; + char *wval; + WORD_DESC *wd; + +#if defined (ARITH_FOR_COMMAND) + if (last_read_token == FOR) + { + arith_for_lineno = line_number; + cmdtyp = parse_arith_cmd (&wval, 0); + if (cmdtyp == 1) + { + wd = alloc_word_desc (); + wd->word = wval; + yylval.word_list = make_word_list (wd, (WORD_LIST *)NULL); + return (ARITH_FOR_EXPRS); + } + else + return -1; /* ERROR */ + } +#endif + +#if defined (DPAREN_ARITHMETIC) + if (reserved_word_acceptable (last_read_token)) + { + sline = line_number; + + cmdtyp = parse_arith_cmd (&wval, 0); + if (cmdtyp == 1) /* arithmetic command */ + { + wd = alloc_word_desc (); + wd->word = wval; + wd->flags = W_QUOTED|W_NOSPLIT|W_NOGLOB|W_DQUOTE; + yylval.word_list = make_word_list (wd, (WORD_LIST *)NULL); + return (ARITH_CMD); + } + else if (cmdtyp == 0) /* nested subshell */ + { + push_string (wval, 0, (alias_t *)NULL); + pushed_string_list->flags = PSH_DPAREN; + if ((parser_state & PST_CASEPAT) == 0) + parser_state |= PST_SUBSHELL; + return (c); + } + else /* ERROR */ + return -1; + } +#endif + + return -2; /* XXX */ +} + +/* We've seen a `(('. Look for the matching `))'. If we get it, return 1. + If not, assume it's a nested subshell for backwards compatibility and + return 0. In any case, put the characters we've consumed into a locally- + allocated buffer and make *ep point to that buffer. Return -1 on an + error, for example EOF. */ +static int +parse_arith_cmd (ep, adddq) + char **ep; + int adddq; +{ + int exp_lineno, rval, c; + char *ttok, *tokstr; + int ttoklen; + + exp_lineno = line_number; + ttok = parse_matched_pair (0, '(', ')', &ttoklen, 0); + rval = 1; + if (ttok == &matched_pair_error) + return -1; + /* Check that the next character is the closing right paren. If + not, this is a syntax error. ( */ + c = shell_getc (0); + if MBTEST(c != ')') + rval = 0; + + tokstr = (char *)xmalloc (ttoklen + 4); + + /* if ADDDQ != 0 then (( ... )) -> "..." */ + if (rval == 1 && adddq) /* arith cmd, add double quotes */ + { + tokstr[0] = '"'; + strncpy (tokstr + 1, ttok, ttoklen - 1); + tokstr[ttoklen] = '"'; + tokstr[ttoklen+1] = '\0'; + } + else if (rval == 1) /* arith cmd, don't add double quotes */ + { + strncpy (tokstr, ttok, ttoklen - 1); + tokstr[ttoklen-1] = '\0'; + } + else /* nested subshell */ + { + tokstr[0] = '('; + strncpy (tokstr + 1, ttok, ttoklen - 1); + tokstr[ttoklen] = ')'; + tokstr[ttoklen+1] = c; + tokstr[ttoklen+2] = '\0'; + } + + *ep = tokstr; + FREE (ttok); + return rval; +} +#endif /* DPAREN_ARITHMETIC || ARITH_FOR_COMMAND */ + +#if defined (COND_COMMAND) +static void +cond_error () +{ + char *etext; + + if (EOF_Reached && cond_token != COND_ERROR) /* [[ */ + parser_error (cond_lineno, _("unexpected EOF while looking for `]]'")); + else if (cond_token != COND_ERROR) + { + if (etext = error_token_from_token (cond_token)) + { + parser_error (cond_lineno, _("syntax error in conditional expression: unexpected token `%s'"), etext); + free (etext); + } + else + parser_error (cond_lineno, _("syntax error in conditional expression")); + } +} + +static COND_COM * +cond_expr () +{ + return (cond_or ()); +} + +static COND_COM * +cond_or () +{ + COND_COM *l, *r; + + l = cond_and (); + if (cond_token == OR_OR) + { + r = cond_or (); + l = make_cond_node (COND_OR, (WORD_DESC *)NULL, l, r); + } + return l; +} + +static COND_COM * +cond_and () +{ + COND_COM *l, *r; + + l = cond_term (); + if (cond_token == AND_AND) + { + r = cond_and (); + l = make_cond_node (COND_AND, (WORD_DESC *)NULL, l, r); + } + return l; +} + +static int +cond_skip_newlines () +{ + while ((cond_token = read_token (READ)) == '\n') + { + if (SHOULD_PROMPT ()) + prompt_again (); + } + return (cond_token); +} + +#define COND_RETURN_ERROR() \ + do { cond_token = COND_ERROR; return ((COND_COM *)NULL); } while (0) + +static COND_COM * +cond_term () +{ + WORD_DESC *op; + COND_COM *term, *tleft, *tright; + int tok, lineno; + char *etext; + + /* Read a token. It can be a left paren, a `!', a unary operator, or a + word that should be the first argument of a binary operator. Start by + skipping newlines, since this is a compound command. */ + tok = cond_skip_newlines (); + lineno = line_number; + if (tok == COND_END) + { + COND_RETURN_ERROR (); + } + else if (tok == '(') + { + term = cond_expr (); + if (cond_token != ')') + { + if (term) + dispose_cond_node (term); /* ( */ + if (etext = error_token_from_token (cond_token)) + { + parser_error (lineno, _("unexpected token `%s', expected `)'"), etext); + free (etext); + } + else + parser_error (lineno, _("expected `)'")); + COND_RETURN_ERROR (); + } + term = make_cond_node (COND_EXPR, (WORD_DESC *)NULL, term, (COND_COM *)NULL); + (void)cond_skip_newlines (); + } + else if (tok == BANG || (tok == WORD && (yylval.word->word[0] == '!' && yylval.word->word[1] == '\0'))) + { + if (tok == WORD) + dispose_word (yylval.word); /* not needed */ + term = cond_term (); + if (term) + term->flags |= CMD_INVERT_RETURN; + } + else if (tok == WORD && yylval.word->word[0] == '-' && yylval.word->word[2] == 0 && test_unop (yylval.word->word)) + { + op = yylval.word; + tok = read_token (READ); + if (tok == WORD) + { + tleft = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + term = make_cond_node (COND_UNARY, op, tleft, (COND_COM *)NULL); + } + else + { + dispose_word (op); + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected argument `%s' to conditional unary operator"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected argument to conditional unary operator")); + COND_RETURN_ERROR (); + } + + (void)cond_skip_newlines (); + } + else if (tok == WORD) /* left argument to binary operator */ + { + /* lhs */ + tleft = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + + /* binop */ + tok = read_token (READ); + if (tok == WORD && test_binop (yylval.word->word)) + { + op = yylval.word; + if (op->word[0] == '=' && (op->word[1] == '\0' || (op->word[1] == '=' && op->word[2] == '\0'))) + parser_state |= PST_EXTPAT; + else if (op->word[0] == '!' && op->word[1] == '=' && op->word[2] == '\0') + parser_state |= PST_EXTPAT; + } +#if defined (COND_REGEXP) + else if (tok == WORD && STREQ (yylval.word->word, "=~")) + { + op = yylval.word; + parser_state |= PST_REGEXP; + } +#endif + else if (tok == '<' || tok == '>') + op = make_word_from_token (tok); /* ( */ + /* There should be a check before blindly accepting the `)' that we have + seen the opening `('. */ + else if (tok == COND_END || tok == AND_AND || tok == OR_OR || tok == ')') + { + /* Special case. [[ x ]] is equivalent to [[ -n x ]], just like + the test command. Similarly for [[ x && expr ]] or + [[ x || expr ]] or [[ (x) ]]. */ + op = make_word ("-n"); + term = make_cond_node (COND_UNARY, op, tleft, (COND_COM *)NULL); + cond_token = tok; + return (term); + } + else + { + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected token `%s', conditional binary operator expected"), etext); + free (etext); + } + else + parser_error (line_number, _("conditional binary operator expected")); + dispose_cond_node (tleft); + COND_RETURN_ERROR (); + } + + /* rhs */ + if (parser_state & PST_EXTPAT) + extended_glob = 1; + tok = read_token (READ); + if (parser_state & PST_EXTPAT) + extended_glob = global_extglob; + parser_state &= ~(PST_REGEXP|PST_EXTPAT); + + if (tok == WORD) + { + tright = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + term = make_cond_node (COND_BINARY, op, tleft, tright); + } + else + { + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected argument `%s' to conditional binary operator"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected argument to conditional binary operator")); + dispose_cond_node (tleft); + dispose_word (op); + COND_RETURN_ERROR (); + } + + (void)cond_skip_newlines (); + } + else + { + if (tok < 256) + parser_error (line_number, _("unexpected token `%c' in conditional command"), tok); + else if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected token `%s' in conditional command"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected token %d in conditional command"), tok); + COND_RETURN_ERROR (); + } + return (term); +} + +/* This is kind of bogus -- we slip a mini recursive-descent parser in + here to handle the conditional statement syntax. */ +static COMMAND * +parse_cond_command () +{ + COND_COM *cexp; + + global_extglob = extended_glob; + cexp = cond_expr (); + return (make_cond_command (cexp)); +} +#endif + +#if defined (ARRAY_VARS) +/* When this is called, it's guaranteed that we don't care about anything + in t beyond i. We do save and restore the chars, though. */ +static int +token_is_assignment (t, i) + char *t; + int i; +{ + unsigned char c, c1; + int r; + + c = t[i]; c1 = t[i+1]; + t[i] = '='; t[i+1] = '\0'; + r = assignment (t, (parser_state & PST_COMPASSIGN) != 0); + t[i] = c; t[i+1] = c1; + return r; +} + +/* XXX - possible changes here for `+=' */ +static int +token_is_ident (t, i) + char *t; + int i; +{ + unsigned char c; + int r; + + c = t[i]; + t[i] = '\0'; + r = legal_identifier (t); + t[i] = c; + return r; +} +#endif + +static int +read_token_word (character) + int character; +{ + /* The value for YYLVAL when a WORD is read. */ + WORD_DESC *the_word; + + /* Index into the token that we are building. */ + int token_index; + + /* ALL_DIGITS becomes zero when we see a non-digit. */ + int all_digit_token; + + /* DOLLAR_PRESENT becomes non-zero if we see a `$'. */ + int dollar_present; + + /* COMPOUND_ASSIGNMENT becomes non-zero if we are parsing a compound + assignment. */ + int compound_assignment; + + /* QUOTED becomes non-zero if we see one of ("), ('), (`), or (\). */ + int quoted; + + /* Non-zero means to ignore the value of the next character, and just + to add it no matter what. */ + int pass_next_character; + + /* The current delimiting character. */ + int cd; + int result, peek_char; + char *ttok, *ttrans; + int ttoklen, ttranslen; + intmax_t lvalue; + + if (token_buffer_size < TOKEN_DEFAULT_INITIAL_SIZE) + token = (char *)xrealloc (token, token_buffer_size = TOKEN_DEFAULT_INITIAL_SIZE); + + token_index = 0; + all_digit_token = DIGIT (character); + dollar_present = quoted = pass_next_character = compound_assignment = 0; + + for (;;) + { + if (character == EOF) + goto got_token; + + if (pass_next_character) + { + pass_next_character = 0; + goto got_escaped_character; + } + + cd = current_delimiter (dstack); + + /* Handle backslashes. Quote lots of things when not inside of + double-quotes, quote some things inside of double-quotes. */ + if MBTEST(character == '\\') + { + peek_char = shell_getc (0); + + /* Backslash-newline is ignored in all cases except + when quoted with single quotes. */ + if (peek_char == '\n') + { + character = '\n'; + goto next_character; + } + else + { + shell_ungetc (peek_char); + + /* If the next character is to be quoted, note it now. */ + if (cd == 0 || cd == '`' || + (cd == '"' && peek_char >= 0 && (sh_syntaxtab[peek_char] & CBSDQUOTE))) + pass_next_character++; + + quoted = 1; + goto got_character; + } + } + + /* Parse a matched pair of quote characters. */ + if MBTEST(shellquote (character)) + { + push_delimiter (dstack, character); + ttok = parse_matched_pair (character, character, character, &ttoklen, (character == '`') ? P_COMMAND : 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + all_digit_token = 0; + quoted = 1; + dollar_present |= (character == '"' && strchr (ttok, '$') != 0); + FREE (ttok); + goto next_character; + } + +#ifdef COND_REGEXP + /* When parsing a regexp as a single word inside a conditional command, + we need to special-case characters special to both the shell and + regular expressions. Right now, that is only '(' and '|'. */ /*)*/ + if MBTEST((parser_state & PST_REGEXP) && (character == '(' || character == '|')) /*)*/ + { + if (character == '|') + goto got_character; + + push_delimiter (dstack, character); + ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = all_digit_token = 0; + goto next_character; + } +#endif /* COND_REGEXP */ + +#ifdef EXTENDED_GLOB + /* Parse a ksh-style extended pattern matching specification. */ + if MBTEST(extended_glob && PATTERN_CHAR (character)) + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '(') /* ) */ + { + push_delimiter (dstack, peek_char); + ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + token[token_index++] = peek_char; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = all_digit_token = 0; + goto next_character; + } + else + shell_ungetc (peek_char); + } +#endif /* EXTENDED_GLOB */ + + /* If the delimiter character is not single quote, parse some of + the shell expansions that must be read as a single word. */ + if (shellexp (character)) + { + peek_char = shell_getc (1); + /* $(...), <(...), >(...), $((...)), ${...}, and $[...] constructs */ + if MBTEST(peek_char == '(' || + ((peek_char == '{' || peek_char == '[') && character == '$')) /* ) ] } */ + { + if (peek_char == '{') /* } */ + ttok = parse_matched_pair (cd, '{', '}', &ttoklen, P_FIRSTCLOSE|P_DOLBRACE); + else if (peek_char == '(') /* ) */ + { + /* XXX - push and pop the `(' as a delimiter for use by + the command-oriented-history code. This way newlines + appearing in the $(...) string get added to the + history literally rather than causing a possibly- + incorrect `;' to be added. ) */ + push_delimiter (dstack, peek_char); + ttok = parse_comsub (cd, '(', ')', &ttoklen, P_COMMAND); + pop_delimiter (dstack); + } + else + ttok = parse_matched_pair (cd, '[', ']', &ttoklen, 0); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + token[token_index++] = peek_char; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = 1; + all_digit_token = 0; + goto next_character; + } + /* This handles $'...' and $"..." new-style quoted strings. */ + else if MBTEST(character == '$' && (peek_char == '\'' || peek_char == '"')) + { + int first_line; + + first_line = line_number; + push_delimiter (dstack, peek_char); + ttok = parse_matched_pair (peek_char, peek_char, peek_char, + &ttoklen, + (peek_char == '\'') ? P_ALLOWESC : 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; + if (peek_char == '\'') + { + ttrans = ansiexpand (ttok, 0, ttoklen - 1, &ttranslen); + free (ttok); + + /* Insert the single quotes and correctly quote any + embedded single quotes (allowed because P_ALLOWESC was + passed to parse_matched_pair). */ + ttok = sh_single_quote (ttrans); + free (ttrans); + ttranslen = strlen (ttok); + ttrans = ttok; + } + else + { + /* Try to locale-expand the converted string. */ + ttrans = localeexpand (ttok, 0, ttoklen - 1, first_line, &ttranslen); + free (ttok); + + /* Add the double quotes back */ + ttok = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + ttranslen += 2; + ttrans = ttok; + } + + RESIZE_MALLOCED_BUFFER (token, token_index, ttranslen + 1, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + strcpy (token + token_index, ttrans); + token_index += ttranslen; + FREE (ttrans); + quoted = 1; + all_digit_token = 0; + goto next_character; + } + /* This could eventually be extended to recognize all of the + shell's single-character parameter expansions, and set flags.*/ + else if MBTEST(character == '$' && peek_char == '$') + { + RESIZE_MALLOCED_BUFFER (token, token_index, 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = '$'; + token[token_index++] = peek_char; + dollar_present = 1; + all_digit_token = 0; + goto next_character; + } + else + shell_ungetc (peek_char); + } + +#if defined (ARRAY_VARS) + /* Identify possible array subscript assignment; match [...]. If + parser_state&PST_COMPASSIGN, we need to parse [sub]=words treating + `sub' as if it were enclosed in double quotes. */ + else if MBTEST(character == '[' && /* ] */ + ((token_index > 0 && assignment_acceptable (last_read_token) && token_is_ident (token, token_index)) || + (token_index == 0 && (parser_state&PST_COMPASSIGN)))) + { + ttok = parse_matched_pair (cd, '[', ']', &ttoklen, P_ARRAYSUB); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + all_digit_token = 0; + goto next_character; + } + /* Identify possible compound array variable assignment. */ + else if MBTEST(character == '=' && token_index > 0 && (assignment_acceptable (last_read_token) || (parser_state & PST_ASSIGNOK)) && token_is_assignment (token, token_index)) + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '(') /* ) */ + { + ttok = parse_compound_assignment (&ttoklen); + + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 4, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + + token[token_index++] = '='; + token[token_index++] = '('; + if (ttok) + { + strcpy (token + token_index, ttok); + token_index += ttoklen; + } + token[token_index++] = ')'; + FREE (ttok); + all_digit_token = 0; + compound_assignment = 1; +#if 1 + goto next_character; +#else + goto got_token; /* ksh93 seems to do this */ +#endif + } + else + shell_ungetc (peek_char); + } +#endif + + /* When not parsing a multi-character word construct, shell meta- + characters break words. */ + if MBTEST(shellbreak (character)) + { + shell_ungetc (character); + goto got_token; + } + +got_character: + + if (character == CTLESC || character == CTLNUL) + { + RESIZE_MALLOCED_BUFFER (token, token_index, 2, token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = CTLESC; + } + else +got_escaped_character: + RESIZE_MALLOCED_BUFFER (token, token_index, 1, token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + + token[token_index++] = character; + + all_digit_token &= DIGIT (character); + dollar_present |= character == '$'; + + next_character: + if (character == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* We want to remove quoted newlines (that is, a \ pair) + unless we are within single quotes or pass_next_character is + set (the shell equivalent of literal-next). */ + cd = current_delimiter (dstack); + character = shell_getc (cd != '\'' && pass_next_character == 0); + } /* end for (;;) */ + +got_token: + + /* Calls to RESIZE_MALLOCED_BUFFER ensure there is sufficient room. */ + token[token_index] = '\0'; + + /* Check to see what thing we should return. If the last_read_token + is a `<', or a `&', or the character which ended this token is + a '>' or '<', then, and ONLY then, is this input token a NUMBER. + Otherwise, it is just a word, and should be returned as such. */ + if MBTEST(all_digit_token && (character == '<' || character == '>' || + last_read_token == LESS_AND || + last_read_token == GREATER_AND)) + { + if (legal_number (token, &lvalue) && (int)lvalue == lvalue) + { + yylval.number = lvalue; + return (NUMBER); + } + } + + /* Check for special case tokens. */ + result = (last_shell_getc_is_singlebyte) ? special_case_tokens (token) : -1; + if (result >= 0) + return result; + +#if defined (ALIAS) + /* Posix.2 does not allow reserved words to be aliased, so check for all + of them, including special cases, before expanding the current token + as an alias. */ + if MBTEST(posixly_correct) + CHECK_FOR_RESERVED_WORD (token); + + /* Aliases are expanded iff EXPAND_ALIASES is non-zero, and quoting + inhibits alias expansion. */ + if (expand_aliases && quoted == 0) + { + result = alias_expand_token (token); + if (result == RE_READ_TOKEN) + return (RE_READ_TOKEN); + else if (result == NO_EXPANSION) + parser_state &= ~PST_ALEXPNEXT; + } + + /* If not in Posix.2 mode, check for reserved words after alias + expansion. */ + if MBTEST(posixly_correct == 0) +#endif + CHECK_FOR_RESERVED_WORD (token); + + the_word = (WORD_DESC *)xmalloc (sizeof (WORD_DESC)); + the_word->word = (char *)xmalloc (1 + token_index); + the_word->flags = 0; + strcpy (the_word->word, token); + if (dollar_present) + the_word->flags |= W_HASDOLLAR; + if (quoted) + the_word->flags |= W_QUOTED; /*(*/ + if (compound_assignment && token[token_index-1] == ')') + the_word->flags |= W_COMPASSIGN; + /* A word is an assignment if it appears at the beginning of a + simple command, or after another assignment word. This is + context-dependent, so it cannot be handled in the grammar. */ + if (assignment (token, (parser_state & PST_COMPASSIGN) != 0)) + { + the_word->flags |= W_ASSIGNMENT; + /* Don't perform word splitting on assignment statements. */ + if (assignment_acceptable (last_read_token) || (parser_state & PST_COMPASSIGN) != 0) + { + the_word->flags |= W_NOSPLIT; + if (parser_state & PST_COMPASSIGN) + the_word->flags |= W_NOGLOB; /* XXX - W_NOBRACE? */ + } + } + + if (command_token_position (last_read_token)) + { + struct builtin *b; + b = builtin_address_internal (token, 0); + if (b && (b->flags & ASSIGNMENT_BUILTIN)) + parser_state |= PST_ASSIGNOK; + else if (STREQ (token, "eval") || STREQ (token, "let")) + parser_state |= PST_ASSIGNOK; + } + + yylval.word = the_word; + + if (token[0] == '{' && token[token_index-1] == '}' && + (character == '<' || character == '>')) + { + /* can use token; already copied to the_word */ + token[token_index-1] = '\0'; +#if defined (ARRAY_VARS) + if (legal_identifier (token+1) || valid_array_reference (token+1)) +#else + if (legal_identifier (token+1)) +#endif + { + strcpy (the_word->word, token+1); +/*itrace("read_token_word: returning REDIR_WORD for %s", the_word->word);*/ + return (REDIR_WORD); + } + } + + result = ((the_word->flags & (W_ASSIGNMENT|W_NOSPLIT)) == (W_ASSIGNMENT|W_NOSPLIT)) + ? ASSIGNMENT_WORD : WORD; + + switch (last_read_token) + { + case FUNCTION: + parser_state |= PST_ALLOWOPNBRC; + function_dstart = line_number; + break; + case CASE: + case SELECT: + case FOR: + if (word_top < MAX_CASE_NEST) + word_top++; + word_lineno[word_top] = line_number; + break; + } + + return (result); +} + +/* Return 1 if TOKSYM is a token that after being read would allow + a reserved word to be seen, else 0. */ +static int +reserved_word_acceptable (toksym) + int toksym; +{ + switch (toksym) + { + case '\n': + case ';': + case '(': + case ')': + case '|': + case '&': + case '{': + case '}': /* XXX */ + case AND_AND: + case BANG: + case BAR_AND: + case DO: + case DONE: + case ELIF: + case ELSE: + case ESAC: + case FI: + case IF: + case OR_OR: + case SEMI_SEMI: + case SEMI_AND: + case SEMI_SEMI_AND: + case THEN: + case TIME: + case TIMEOPT: + case TIMEIGN: + case COPROC: + case UNTIL: + case WHILE: + case 0: + return 1; + default: +#if defined (COPROCESS_SUPPORT) + if (last_read_token == WORD && token_before_that == COPROC) + return 1; +#endif + if (last_read_token == WORD && token_before_that == FUNCTION) + return 1; + return 0; + } +} + +/* Return the index of TOKEN in the alist of reserved words, or -1 if + TOKEN is not a shell reserved word. */ +int +find_reserved_word (tokstr) + char *tokstr; +{ + int i; + for (i = 0; word_token_alist[i].word; i++) + if (STREQ (tokstr, word_token_alist[i].word)) + return i; + return -1; +} + +/* An interface to let the rest of the shell (primarily the completion + system) know what the parser is expecting. */ +int +parser_in_command_position () +{ + return (command_token_position (last_read_token)); +} + +#if 0 +#if defined (READLINE) +/* Called after each time readline is called. This insures that whatever + the new prompt string is gets propagated to readline's local prompt + variable. */ +static void +reset_readline_prompt () +{ + char *temp_prompt; + + if (prompt_string_pointer) + { + temp_prompt = (*prompt_string_pointer) + ? decode_prompt_string (*prompt_string_pointer) + : (char *)NULL; + + if (temp_prompt == 0) + { + temp_prompt = (char *)xmalloc (1); + temp_prompt[0] = '\0'; + } + + FREE (current_readline_prompt); + current_readline_prompt = temp_prompt; + } +} +#endif /* READLINE */ +#endif /* 0 */ + +#if defined (HISTORY) +/* A list of tokens which can be followed by newlines, but not by + semi-colons. When concatenating multiple lines of history, the + newline separator for such tokens is replaced with a space. */ +static const int no_semi_successors[] = { + '\n', '{', '(', ')', ';', '&', '|', + CASE, DO, ELSE, IF, SEMI_SEMI, SEMI_AND, SEMI_SEMI_AND, THEN, UNTIL, + WHILE, AND_AND, OR_OR, IN, + 0 +}; + +/* If we are not within a delimited expression, try to be smart + about which separators can be semi-colons and which must be + newlines. Returns the string that should be added into the + history entry. LINE is the line we're about to add; it helps + make some more intelligent decisions in certain cases. */ +char * +history_delimiting_chars (line) + const char *line; +{ + static int last_was_heredoc = 0; /* was the last entry the start of a here document? */ + register int i; + + if ((parser_state & PST_HEREDOC) == 0) + last_was_heredoc = 0; + + if (dstack.delimiter_depth != 0) + return ("\n"); + + /* We look for current_command_line_count == 2 because we are looking to + add the first line of the body of the here document (the second line + of the command). We also keep LAST_WAS_HEREDOC as a private sentinel + variable to note when we think we added the first line of a here doc + (the one with a "<<" somewhere in it) */ + if (parser_state & PST_HEREDOC) + { + if (last_was_heredoc) + { + last_was_heredoc = 0; + return "\n"; + } + return (current_command_line_count == 2 ? "\n" : ""); + } + + if (parser_state & PST_COMPASSIGN) + return (" "); + + /* First, handle some special cases. */ + /*(*/ + /* If we just read `()', assume it's a function definition, and don't + add a semicolon. If the token before the `)' was not `(', and we're + not in the midst of parsing a case statement, assume it's a + parenthesized command and add the semicolon. */ + /*)(*/ + if (token_before_that == ')') + { + if (two_tokens_ago == '(') /*)*/ /* function def */ + return " "; + /* This does not work for subshells inside case statement + command lists. It's a suboptimal solution. */ + else if (parser_state & PST_CASESTMT) /* case statement pattern */ + return " "; + else + return "; "; /* (...) subshell */ + } + else if (token_before_that == WORD && two_tokens_ago == FUNCTION) + return " "; /* function def using `function name' without `()' */ + + /* If we're not in a here document, but we think we're about to parse one, + and we would otherwise return a `;', return a newline to delimit the + line with the here-doc delimiter */ + else if ((parser_state & PST_HEREDOC) == 0 && current_command_line_count > 1 && last_read_token == '\n' && strstr (line, "<<")) + { + last_was_heredoc = 1; + return "\n"; + } + + else if (token_before_that == WORD && two_tokens_ago == FOR) + { + /* Tricky. `for i\nin ...' should not have a semicolon, but + `for i\ndo ...' should. We do what we can. */ + for (i = shell_input_line_index; whitespace (shell_input_line[i]); i++) + ; + if (shell_input_line[i] && shell_input_line[i] == 'i' && shell_input_line[i+1] == 'n') + return " "; + return ";"; + } + else if (two_tokens_ago == CASE && token_before_that == WORD && (parser_state & PST_CASESTMT)) + return " "; + + for (i = 0; no_semi_successors[i]; i++) + { + if (token_before_that == no_semi_successors[i]) + return (" "); + } + + return ("; "); +} +#endif /* HISTORY */ + +/* Issue a prompt, or prepare to issue a prompt when the next character + is read. */ +static void +prompt_again () +{ + char *temp_prompt; + + if (interactive == 0 || expanding_alias ()) /* XXX */ + return; + + ps1_prompt = get_string_value ("PS1"); + ps2_prompt = get_string_value ("PS2"); + + if (!prompt_string_pointer) + prompt_string_pointer = &ps1_prompt; + + temp_prompt = *prompt_string_pointer + ? decode_prompt_string (*prompt_string_pointer) + : (char *)NULL; + + if (temp_prompt == 0) + { + temp_prompt = (char *)xmalloc (1); + temp_prompt[0] = '\0'; + } + + current_prompt_string = *prompt_string_pointer; + prompt_string_pointer = &ps2_prompt; + +#if defined (READLINE) + if (!no_line_editing) + { + FREE (current_readline_prompt); + current_readline_prompt = temp_prompt; + } + else +#endif /* READLINE */ + { + FREE (current_decoded_prompt); + current_decoded_prompt = temp_prompt; + } +} + +int +get_current_prompt_level () +{ + return ((current_prompt_string && current_prompt_string == ps2_prompt) ? 2 : 1); +} + +void +set_current_prompt_level (x) + int x; +{ + prompt_string_pointer = (x == 2) ? &ps2_prompt : &ps1_prompt; + current_prompt_string = *prompt_string_pointer; +} + +static void +print_prompt () +{ + fprintf (stderr, "%s", current_decoded_prompt); + fflush (stderr); +} + +/* Return a string which will be printed as a prompt. The string + may contain special characters which are decoded as follows: + + \a bell (ascii 07) + \d the date in Day Mon Date format + \e escape (ascii 033) + \h the hostname up to the first `.' + \H the hostname + \j the number of active jobs + \l the basename of the shell's tty device name + \n CRLF + \r CR + \s the name of the shell + \t the time in 24-hour hh:mm:ss format + \T the time in 12-hour hh:mm:ss format + \@ the time in 12-hour hh:mm am/pm format + \A the time in 24-hour hh:mm format + \D{fmt} the result of passing FMT to strftime(3) + \u your username + \v the version of bash (e.g., 2.00) + \V the release of bash, version + patchlevel (e.g., 2.00.0) + \w the current working directory + \W the last element of $PWD + \! the history number of this command + \# the command number of this command + \$ a $ or a # if you are root + \nnn character code nnn in octal + \\ a backslash + \[ begin a sequence of non-printing chars + \] end a sequence of non-printing chars +*/ +#define PROMPT_GROWTH 48 +char * +decode_prompt_string (string) + char *string; +{ + WORD_LIST *list; + char *result, *t; + struct dstack save_dstack; + int last_exit_value, last_comsub_pid; +#if defined (PROMPT_STRING_DECODE) + int result_size, result_index; + int c, n, i; + char *temp, octal_string[4]; + struct tm *tm; + time_t the_time; + char timebuf[128]; + char *timefmt; + + result = (char *)xmalloc (result_size = PROMPT_GROWTH); + result[result_index = 0] = 0; + temp = (char *)NULL; + + while (c = *string++) + { + if (posixly_correct && c == '!') + { + if (*string == '!') + { + temp = savestring ("!"); + goto add_string; + } + else + { +#if !defined (HISTORY) + temp = savestring ("1"); +#else /* HISTORY */ + temp = itos (history_number ()); +#endif /* HISTORY */ + string--; /* add_string increments string again. */ + goto add_string; + } + } + if (c == '\\') + { + c = *string; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + strncpy (octal_string, string, 3); + octal_string[3] = '\0'; + + n = read_octal (octal_string); + temp = (char *)xmalloc (3); + + if (n == CTLESC || n == CTLNUL) + { + temp[0] = CTLESC; + temp[1] = n; + temp[2] = '\0'; + } + else if (n == -1) + { + temp[0] = '\\'; + temp[1] = '\0'; + } + else + { + temp[0] = n; + temp[1] = '\0'; + } + + for (c = 0; n != -1 && c < 3 && ISOCTAL (*string); c++) + string++; + + c = 0; /* tested at add_string: */ + goto add_string; + + case 'd': + case 't': + case 'T': + case '@': + case 'A': + /* Make the current time/date into a string. */ + (void) time (&the_time); +#if defined (HAVE_TZSET) + sv_tz ("TZ"); /* XXX -- just make sure */ +#endif + tm = localtime (&the_time); + + if (c == 'd') + n = strftime (timebuf, sizeof (timebuf), "%a %b %d", tm); + else if (c == 't') + n = strftime (timebuf, sizeof (timebuf), "%H:%M:%S", tm); + else if (c == 'T') + n = strftime (timebuf, sizeof (timebuf), "%I:%M:%S", tm); + else if (c == '@') + n = strftime (timebuf, sizeof (timebuf), "%I:%M %p", tm); + else if (c == 'A') + n = strftime (timebuf, sizeof (timebuf), "%H:%M", tm); + + if (n == 0) + timebuf[0] = '\0'; + else + timebuf[sizeof(timebuf) - 1] = '\0'; + + temp = savestring (timebuf); + goto add_string; + + case 'D': /* strftime format */ + if (string[1] != '{') /* } */ + goto not_escape; + + (void) time (&the_time); + tm = localtime (&the_time); + string += 2; /* skip { */ + timefmt = xmalloc (strlen (string) + 3); + for (t = timefmt; *string && *string != '}'; ) + *t++ = *string++; + *t = '\0'; + c = *string; /* tested at add_string */ + if (timefmt[0] == '\0') + { + timefmt[0] = '%'; + timefmt[1] = 'X'; /* locale-specific current time */ + timefmt[2] = '\0'; + } + n = strftime (timebuf, sizeof (timebuf), timefmt, tm); + free (timefmt); + + if (n == 0) + timebuf[0] = '\0'; + else + timebuf[sizeof(timebuf) - 1] = '\0'; + + if (promptvars || posixly_correct) + /* Make sure that expand_prompt_string is called with a + second argument of Q_DOUBLE_QUOTES if we use this + function here. */ + temp = sh_backslash_quote_for_double_quotes (timebuf); + else + temp = savestring (timebuf); + goto add_string; + + case 'n': + temp = (char *)xmalloc (3); + temp[0] = no_line_editing ? '\n' : '\r'; + temp[1] = no_line_editing ? '\0' : '\n'; + temp[2] = '\0'; + goto add_string; + + case 's': + temp = base_pathname (shell_name); + temp = savestring (temp); + goto add_string; + + case 'v': + case 'V': + temp = (char *)xmalloc (16); + if (c == 'v') + strcpy (temp, dist_version); + else + sprintf (temp, "%s.%d", dist_version, patch_level); + goto add_string; + + case 'w': + case 'W': + { + /* Use the value of PWD because it is much more efficient. */ + char t_string[PATH_MAX]; + int tlen; + + temp = get_string_value ("PWD"); + + if (temp == 0) + { + if (getcwd (t_string, sizeof(t_string)) == 0) + { + t_string[0] = '.'; + tlen = 1; + } + else + tlen = strlen (t_string); + } + else + { + tlen = sizeof (t_string) - 1; + strncpy (t_string, temp, tlen); + } + t_string[tlen] = '\0'; + +#if defined (MACOSX) + /* Convert from "fs" format to "input" format */ + temp = fnx_fromfs (t_string, strlen (t_string)); + if (temp != t_string) + strcpy (t_string, temp); +#endif + +#define ROOT_PATH(x) ((x)[0] == '/' && (x)[1] == 0) +#define DOUBLE_SLASH_ROOT(x) ((x)[0] == '/' && (x)[1] == '/' && (x)[2] == 0) + /* Abbreviate \W as ~ if $PWD == $HOME */ + if (c == 'W' && (((t = get_string_value ("HOME")) == 0) || STREQ (t, t_string) == 0)) + { + if (ROOT_PATH (t_string) == 0 && DOUBLE_SLASH_ROOT (t_string) == 0) + { + t = strrchr (t_string, '/'); + if (t) + memmove (t_string, t + 1, strlen (t)); /* strlen(t) to copy NULL */ + } + } +#undef ROOT_PATH +#undef DOUBLE_SLASH_ROOT + else + { + /* polite_directory_format is guaranteed to return a string + no longer than PATH_MAX - 1 characters. */ + temp = polite_directory_format (t_string); + if (temp != t_string) + strcpy (t_string, temp); + } + + temp = trim_pathname (t_string, PATH_MAX - 1); + /* If we're going to be expanding the prompt string later, + quote the directory name. */ + if (promptvars || posixly_correct) + /* Make sure that expand_prompt_string is called with a + second argument of Q_DOUBLE_QUOTES if we use this + function here. */ + temp = sh_backslash_quote_for_double_quotes (t_string); + else + temp = savestring (t_string); + + goto add_string; + } + + case 'u': + if (current_user.user_name == 0) + get_current_user_info (); + temp = savestring (current_user.user_name); + goto add_string; + + case 'h': + case 'H': + temp = savestring (current_host_name); + if (c == 'h' && (t = (char *)strchr (temp, '.'))) + *t = '\0'; + goto add_string; + + case '#': + temp = itos (current_command_number); + goto add_string; + + case '!': +#if !defined (HISTORY) + temp = savestring ("1"); +#else /* HISTORY */ + temp = itos (history_number ()); +#endif /* HISTORY */ + goto add_string; + + case '$': + t = temp = (char *)xmalloc (3); + if ((promptvars || posixly_correct) && (current_user.euid != 0)) + *t++ = '\\'; + *t++ = current_user.euid == 0 ? '#' : '$'; + *t = '\0'; + goto add_string; + + case 'j': + temp = itos (count_all_jobs ()); + goto add_string; + + case 'l': +#if defined (HAVE_TTYNAME) + temp = (char *)ttyname (fileno (stdin)); + t = temp ? base_pathname (temp) : "tty"; + temp = savestring (t); +#else + temp = savestring ("tty"); +#endif /* !HAVE_TTYNAME */ + goto add_string; + +#if defined (READLINE) + case '[': + case ']': + if (no_line_editing) + { + string++; + break; + } + temp = (char *)xmalloc (3); + n = (c == '[') ? RL_PROMPT_START_IGNORE : RL_PROMPT_END_IGNORE; + i = 0; + if (n == CTLESC || n == CTLNUL) + temp[i++] = CTLESC; + temp[i++] = n; + temp[i] = '\0'; + goto add_string; +#endif /* READLINE */ + + case '\\': + case 'a': + case 'e': + case 'r': + temp = (char *)xmalloc (2); + if (c == 'a') + temp[0] = '\07'; + else if (c == 'e') + temp[0] = '\033'; + else if (c == 'r') + temp[0] = '\r'; + else /* (c == '\\') */ + temp[0] = c; + temp[1] = '\0'; + goto add_string; + + default: +not_escape: + temp = (char *)xmalloc (3); + temp[0] = '\\'; + temp[1] = c; + temp[2] = '\0'; + + add_string: + if (c) + string++; + result = + sub_append_string (temp, result, &result_index, &result_size); + temp = (char *)NULL; /* Freed in sub_append_string (). */ + result[result_index] = '\0'; + break; + } + } + else + { + RESIZE_MALLOCED_BUFFER (result, result_index, 3, result_size, PROMPT_GROWTH); + result[result_index++] = c; + result[result_index] = '\0'; + } + } +#else /* !PROMPT_STRING_DECODE */ + result = savestring (string); +#endif /* !PROMPT_STRING_DECODE */ + + /* Save the delimiter stack and point `dstack' to temp space so any + command substitutions in the prompt string won't result in screwing + up the parser's quoting state. */ + save_dstack = dstack; + dstack = temp_dstack; + dstack.delimiter_depth = 0; + + /* Perform variable and parameter expansion and command substitution on + the prompt string. */ + if (promptvars || posixly_correct) + { + last_exit_value = last_command_exit_value; + last_comsub_pid = last_command_subst_pid; + list = expand_prompt_string (result, Q_DOUBLE_QUOTES, 0); + free (result); + result = string_list (list); + dispose_words (list); + last_command_exit_value = last_exit_value; + last_command_subst_pid = last_comsub_pid; + } + else + { + t = dequote_string (result); + free (result); + result = t; + } + + dstack = save_dstack; + + return (result); +} + +/************************************************ + * * + * ERROR HANDLING * + * * + ************************************************/ + +/* Report a syntax error, and restart the parser. Call here for fatal + errors. */ +int +yyerror (msg) + const char *msg; +{ + report_syntax_error ((char *)NULL); + reset_parser (); + return (0); +} + +static char * +error_token_from_token (tok) + int tok; +{ + char *t; + + if (t = find_token_in_alist (tok, word_token_alist, 0)) + return t; + + if (t = find_token_in_alist (tok, other_token_alist, 0)) + return t; + + t = (char *)NULL; + /* This stuff is dicy and needs closer inspection */ + switch (current_token) + { + case WORD: + case ASSIGNMENT_WORD: + if (yylval.word) + t = savestring (yylval.word->word); + break; + case NUMBER: + t = itos (yylval.number); + break; + case ARITH_CMD: + if (yylval.word_list) + t = string_list (yylval.word_list); + break; + case ARITH_FOR_EXPRS: + if (yylval.word_list) + t = string_list_internal (yylval.word_list, " ; "); + break; + case COND_CMD: + t = (char *)NULL; /* punt */ + break; + } + + return t; +} + +static char * +error_token_from_text () +{ + char *msg, *t; + int token_end, i; + + t = shell_input_line; + i = shell_input_line_index; + token_end = 0; + msg = (char *)NULL; + + if (i && t[i] == '\0') + i--; + + while (i && (whitespace (t[i]) || t[i] == '\n')) + i--; + + if (i) + token_end = i + 1; + + while (i && (member (t[i], " \n\t;|&") == 0)) + i--; + + while (i != token_end && (whitespace (t[i]) || t[i] == '\n')) + i++; + + /* Return our idea of the offending token. */ + if (token_end || (i == 0 && token_end == 0)) + { + if (token_end) + msg = substring (t, i, token_end); + else /* one-character token */ + { + msg = (char *)xmalloc (2); + msg[0] = t[i]; + msg[1] = '\0'; + } + } + + return (msg); +} + +static void +print_offending_line () +{ + char *msg; + int token_end; + + msg = savestring (shell_input_line); + token_end = strlen (msg); + while (token_end && msg[token_end - 1] == '\n') + msg[--token_end] = '\0'; + + parser_error (line_number, "`%s'", msg); + free (msg); +} + +/* Report a syntax error with line numbers, etc. + Call here for recoverable errors. If you have a message to print, + then place it in MESSAGE, otherwise pass NULL and this will figure + out an appropriate message for you. */ +static void +report_syntax_error (message) + char *message; +{ + char *msg, *p; + + if (message) + { + parser_error (line_number, "%s", message); + if (interactive && EOF_Reached) + EOF_Reached = 0; + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; + return; + } + + /* If the line of input we're reading is not null, try to find the + objectionable token. First, try to figure out what token the + parser's complaining about by looking at current_token. */ + if (current_token != 0 && EOF_Reached == 0 && (msg = error_token_from_token (current_token))) + { + if (ansic_shouldquote (msg)) + { + p = ansic_quote (msg, 0, NULL); + free (msg); + msg = p; + } + parser_error (line_number, _("syntax error near unexpected token `%s'"), msg); + free (msg); + + if (interactive == 0) + print_offending_line (); + + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; + return; + } + + /* If looking at the current token doesn't prove fruitful, try to find the + offending token by analyzing the text of the input line near the current + input line index and report what we find. */ + if (shell_input_line && *shell_input_line) + { + msg = error_token_from_text (); + if (msg) + { + parser_error (line_number, _("syntax error near `%s'"), msg); + free (msg); + } + + /* If not interactive, print the line containing the error. */ + if (interactive == 0) + print_offending_line (); + } + else + { + msg = EOF_Reached ? _("syntax error: unexpected end of file") : _("syntax error"); + parser_error (line_number, "%s", msg); + /* When the shell is interactive, this file uses EOF_Reached + only for error reporting. Other mechanisms are used to + decide whether or not to exit. */ + if (interactive && EOF_Reached) + EOF_Reached = 0; + } + + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; +} + +/* ??? Needed function. ??? We have to be able to discard the constructs + created during parsing. In the case of error, we want to return + allocated objects to the memory pool. In the case of no error, we want + to throw away the information about where the allocated objects live. + (dispose_command () will actually free the command.) */ +static void +discard_parser_constructs (error_p) + int error_p; +{ +} + +/************************************************ + * * + * EOF HANDLING * + * * + ************************************************/ + +/* Do that silly `type "bye" to exit' stuff. You know, "ignoreeof". */ + +/* A flag denoting whether or not ignoreeof is set. */ +int ignoreeof = 0; + +/* The number of times that we have encountered an EOF character without + another character intervening. When this gets above the limit, the + shell terminates. */ +int eof_encountered = 0; + +/* The limit for eof_encountered. */ +int eof_encountered_limit = 10; + +/* If we have EOF as the only input unit, this user wants to leave + the shell. If the shell is not interactive, then just leave. + Otherwise, if ignoreeof is set, and we haven't done this the + required number of times in a row, print a message. */ +static void +handle_eof_input_unit () +{ + if (interactive) + { + /* shell.c may use this to decide whether or not to write out the + history, among other things. We use it only for error reporting + in this file. */ + if (EOF_Reached) + EOF_Reached = 0; + + /* If the user wants to "ignore" eof, then let her do so, kind of. */ + if (ignoreeof) + { + if (eof_encountered < eof_encountered_limit) + { + fprintf (stderr, _("Use \"%s\" to leave the shell.\n"), + login_shell ? "logout" : "exit"); + eof_encountered++; + /* Reset the parsing state. */ + last_read_token = current_token = '\n'; + /* Reset the prompt string to be $PS1. */ + prompt_string_pointer = (char **)NULL; + prompt_again (); + return; + } + } + + /* In this case EOF should exit the shell. Do it now. */ + reset_parser (); + exit_builtin ((WORD_LIST *)NULL); + } + else + { + /* We don't write history files, etc., for non-interactive shells. */ + EOF_Reached = 1; + } +} + +/************************************************ + * * + * STRING PARSING FUNCTIONS * + * * + ************************************************/ + +/* It's very important that these two functions treat the characters + between ( and ) identically. */ + +static WORD_LIST parse_string_error; + +/* Take a string and run it through the shell parser, returning the + resultant word list. Used by compound array assignment. */ +WORD_LIST * +parse_string_to_word_list (s, flags, whom) + char *s; + int flags; + const char *whom; +{ + WORD_LIST *wl; + int tok, orig_current_token, orig_line_number, orig_input_terminator; + int orig_line_count; + int old_echo_input, old_expand_aliases; +#if defined (HISTORY) + int old_remember_on_history, old_history_expansion_inhibited; +#endif + +#if defined (HISTORY) + old_remember_on_history = remember_on_history; +# if defined (BANG_HISTORY) + old_history_expansion_inhibited = history_expansion_inhibited; +# endif + bash_history_disable (); +#endif + + orig_line_number = line_number; + orig_line_count = current_command_line_count; + orig_input_terminator = shell_input_line_terminator; + old_echo_input = echo_input_at_read; + old_expand_aliases = expand_aliases; + + push_stream (1); + last_read_token = WORD; /* WORD to allow reserved words here */ + current_command_line_count = 0; + echo_input_at_read = expand_aliases = 0; + + with_input_from_string (s, whom); + wl = (WORD_LIST *)NULL; + + if (flags & 1) + parser_state |= PST_COMPASSIGN|PST_REPARSE; + + while ((tok = read_token (READ)) != yacc_EOF) + { + if (tok == '\n' && *bash_input.location.string == '\0') + break; + if (tok == '\n') /* Allow newlines in compound assignments */ + continue; + if (tok != WORD && tok != ASSIGNMENT_WORD) + { + line_number = orig_line_number + line_number - 1; + orig_current_token = current_token; + current_token = tok; + yyerror (NULL); /* does the right thing */ + current_token = orig_current_token; + if (wl) + dispose_words (wl); + wl = &parse_string_error; + break; + } + wl = make_word_list (yylval.word, wl); + } + + last_read_token = '\n'; + pop_stream (); + +#if defined (HISTORY) + remember_on_history = old_remember_on_history; +# if defined (BANG_HISTORY) + history_expansion_inhibited = old_history_expansion_inhibited; +# endif /* BANG_HISTORY */ +#endif /* HISTORY */ + + echo_input_at_read = old_echo_input; + expand_aliases = old_expand_aliases; + + current_command_line_count = orig_line_count; + shell_input_line_terminator = orig_input_terminator; + + if (flags & 1) + parser_state &= ~(PST_COMPASSIGN|PST_REPARSE); + + if (wl == &parse_string_error) + { + last_command_exit_value = EXECUTION_FAILURE; + if (interactive_shell == 0 && posixly_correct) + jump_to_top_level (FORCE_EOF); + else + jump_to_top_level (DISCARD); + } + + return (REVERSE_LIST (wl, WORD_LIST *)); +} + +static char * +parse_compound_assignment (retlenp) + int *retlenp; +{ + WORD_LIST *wl, *rl; + int tok, orig_line_number, orig_token_size, orig_last_token, assignok; + char *saved_token, *ret; + + saved_token = token; + orig_token_size = token_buffer_size; + orig_line_number = line_number; + orig_last_token = last_read_token; + + last_read_token = WORD; /* WORD to allow reserved words here */ + + token = (char *)NULL; + token_buffer_size = 0; + + assignok = parser_state&PST_ASSIGNOK; /* XXX */ + + wl = (WORD_LIST *)NULL; /* ( */ + parser_state |= PST_COMPASSIGN; + + while ((tok = read_token (READ)) != ')') + { + if (tok == '\n') /* Allow newlines in compound assignments */ + { + if (SHOULD_PROMPT ()) + prompt_again (); + continue; + } + if (tok != WORD && tok != ASSIGNMENT_WORD) + { + current_token = tok; /* for error reporting */ + if (tok == yacc_EOF) /* ( */ + parser_error (orig_line_number, _("unexpected EOF while looking for matching `)'")); + else + yyerror(NULL); /* does the right thing */ + if (wl) + dispose_words (wl); + wl = &parse_string_error; + break; + } + wl = make_word_list (yylval.word, wl); + } + + FREE (token); + token = saved_token; + token_buffer_size = orig_token_size; + + parser_state &= ~PST_COMPASSIGN; + + if (wl == &parse_string_error) + { + last_command_exit_value = EXECUTION_FAILURE; + last_read_token = '\n'; /* XXX */ + if (interactive_shell == 0 && posixly_correct) + jump_to_top_level (FORCE_EOF); + else + jump_to_top_level (DISCARD); + } + + last_read_token = orig_last_token; /* XXX - was WORD? */ + + if (wl) + { + rl = REVERSE_LIST (wl, WORD_LIST *); + ret = string_list (rl); + dispose_words (rl); + } + else + ret = (char *)NULL; + + if (retlenp) + *retlenp = (ret && *ret) ? strlen (ret) : 0; + + if (assignok) + parser_state |= PST_ASSIGNOK; + + return ret; +} + +/************************************************ + * * + * SAVING AND RESTORING PARTIAL PARSE STATE * + * * + ************************************************/ + +sh_parser_state_t * +save_parser_state (ps) + sh_parser_state_t *ps; +{ + if (ps == 0) + ps = (sh_parser_state_t *)xmalloc (sizeof (sh_parser_state_t)); + if (ps == 0) + return ((sh_parser_state_t *)NULL); + + ps->parser_state = parser_state; + ps->token_state = save_token_state (); + + ps->input_line_terminator = shell_input_line_terminator; + ps->eof_encountered = eof_encountered; + + ps->prompt_string_pointer = prompt_string_pointer; + + ps->current_command_line_count = current_command_line_count; + +#if defined (HISTORY) + ps->remember_on_history = remember_on_history; +# if defined (BANG_HISTORY) + ps->history_expansion_inhibited = history_expansion_inhibited; +# endif +#endif + + ps->last_command_exit_value = last_command_exit_value; +#if defined (ARRAY_VARS) + ps->pipestatus = save_pipestatus_array (); +#endif + + ps->last_shell_builtin = last_shell_builtin; + ps->this_shell_builtin = this_shell_builtin; + + ps->expand_aliases = expand_aliases; + ps->echo_input_at_read = echo_input_at_read; + + ps->token = token; + ps->token_buffer_size = token_buffer_size; + /* Force reallocation on next call to read_token_word */ + token = 0; + token_buffer_size = 0; + + return (ps); +} + +void +restore_parser_state (ps) + sh_parser_state_t *ps; +{ + if (ps == 0) + return; + + parser_state = ps->parser_state; + if (ps->token_state) + { + restore_token_state (ps->token_state); + free (ps->token_state); + } + + shell_input_line_terminator = ps->input_line_terminator; + eof_encountered = ps->eof_encountered; + + prompt_string_pointer = ps->prompt_string_pointer; + + current_command_line_count = ps->current_command_line_count; + +#if defined (HISTORY) + remember_on_history = ps->remember_on_history; +# if defined (BANG_HISTORY) + history_expansion_inhibited = ps->history_expansion_inhibited; +# endif +#endif + + last_command_exit_value = ps->last_command_exit_value; +#if defined (ARRAY_VARS) + restore_pipestatus_array (ps->pipestatus); +#endif + + last_shell_builtin = ps->last_shell_builtin; + this_shell_builtin = ps->this_shell_builtin; + + expand_aliases = ps->expand_aliases; + echo_input_at_read = ps->echo_input_at_read; + + FREE (token); + token = ps->token; + token_buffer_size = ps->token_buffer_size; +} + +sh_input_line_state_t * +save_input_line_state (ls) + sh_input_line_state_t *ls; +{ + if (ls == 0) + ls = (sh_input_line_state_t *)xmalloc (sizeof (sh_input_line_state_t)); + if (ls == 0) + return ((sh_input_line_state_t *)NULL); + + ls->input_line = shell_input_line; + ls->input_line_size = shell_input_line_size; + ls->input_line_len = shell_input_line_len; + ls->input_line_index = shell_input_line_index; + + /* force reallocation */ + shell_input_line = 0; + shell_input_line_size = shell_input_line_len = shell_input_line_index = 0; + + return ls; +} + +void +restore_input_line_state (ls) + sh_input_line_state_t *ls; +{ + FREE (shell_input_line); + shell_input_line = ls->input_line; + shell_input_line_size = ls->input_line_size; + shell_input_line_len = ls->input_line_len; + shell_input_line_index = ls->input_line_index; + + set_line_mbstate (); +} + +/************************************************ + * * + * MULTIBYTE CHARACTER HANDLING * + * * + ************************************************/ + +#if defined (HANDLE_MULTIBYTE) +static void +set_line_mbstate () +{ + int c; + size_t i, previ, len; + mbstate_t mbs, prevs; + size_t mbclen; + + if (shell_input_line == NULL) + return; + len = strlen (shell_input_line); /* XXX - shell_input_line_len ? */ + FREE (shell_input_line_property); + shell_input_line_property = (char *)xmalloc (len + 1); + + memset (&prevs, '\0', sizeof (mbstate_t)); + for (i = previ = 0; i < len; i++) + { + mbs = prevs; + + c = shell_input_line[i]; + if (c == EOF) + { + size_t j; + for (j = i; j < len; j++) + shell_input_line_property[j] = 1; + break; + } + + mbclen = mbrlen (shell_input_line + previ, i - previ + 1, &mbs); + if (mbclen == 1 || mbclen == (size_t)-1) + { + mbclen = 1; + previ = i + 1; + } + else if (mbclen == (size_t)-2) + mbclen = 0; + else if (mbclen > 1) + { + mbclen = 0; + previ = i + 1; + prevs = mbs; + } + else + { + /* XXX - what to do if mbrlen returns 0? (null wide character) */ + size_t j; + for (j = i; j < len; j++) + shell_input_line_property[j] = 1; + break; + } + + shell_input_line_property[i] = mbclen; + } +} +#endif /* HANDLE_MULTIBYTE */ + diff --git a/.pc/bash43-010.diff/externs.h b/.pc/bash43-010.diff/externs.h new file mode 100644 index 0000000..61fd0eb --- /dev/null +++ b/.pc/bash43-010.diff/externs.h @@ -0,0 +1,516 @@ +/* externs.h -- extern function declarations which do not appear in their + own header file. */ + +/* Copyright (C) 1993-2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Make sure that this is included *after* config.h! */ + +#if !defined (_EXTERNS_H_) +# define _EXTERNS_H_ + +#include "stdc.h" + +/* Functions from expr.c. */ +extern intmax_t evalexp __P((char *, int *)); + +/* Functions from print_cmd.c. */ +#define FUNC_MULTILINE 0x01 +#define FUNC_EXTERNAL 0x02 + +extern char *make_command_string __P((COMMAND *)); +extern char *named_function_string __P((char *, COMMAND *, int)); + +extern void print_command __P((COMMAND *)); +extern void print_simple_command __P((SIMPLE_COM *)); +extern void print_word_list __P((WORD_LIST *, char *)); + +/* debugger support */ +extern void print_for_command_head __P((FOR_COM *)); +#if defined (SELECT_COMMAND) +extern void print_select_command_head __P((SELECT_COM *)); +#endif +extern void print_case_command_head __P((CASE_COM *)); +#if defined (DPAREN_ARITHMETIC) +extern void print_arith_command __P((WORD_LIST *)); +#endif +#if defined (COND_COMMAND) +extern void print_cond_command __P((COND_COM *)); +#endif + +/* set -x support */ +extern void xtrace_init __P((void)); +#ifdef NEED_XTRACE_SET_DECL +extern void xtrace_set __P((int, FILE *)); +#endif +extern void xtrace_fdchk __P((int)); +extern void xtrace_reset __P((void)); +extern char *indirection_level_string __P((void)); +extern void xtrace_print_assignment __P((char *, char *, int, int)); +extern void xtrace_print_word_list __P((WORD_LIST *, int)); +extern void xtrace_print_for_command_head __P((FOR_COM *)); +#if defined (SELECT_COMMAND) +extern void xtrace_print_select_command_head __P((SELECT_COM *)); +#endif +extern void xtrace_print_case_command_head __P((CASE_COM *)); +#if defined (DPAREN_ARITHMETIC) +extern void xtrace_print_arith_cmd __P((WORD_LIST *)); +#endif +#if defined (COND_COMMAND) +extern void xtrace_print_cond_term __P((int, int, WORD_DESC *, char *, char *)); +#endif + +/* Functions from shell.c. */ +extern void exit_shell __P((int)) __attribute__((__noreturn__)); +extern void sh_exit __P((int)) __attribute__((__noreturn__)); +extern void subshell_exit __P((int)) __attribute__((__noreturn__)); +extern void disable_priv_mode __P((void)); +extern void unbind_args __P((void)); + +#if defined (RESTRICTED_SHELL) +extern int shell_is_restricted __P((char *)); +extern int maybe_make_restricted __P((char *)); +#endif + +extern void unset_bash_input __P((int)); +extern void get_current_user_info __P((void)); + +/* Functions from eval.c. */ +extern int reader_loop __P((void)); +extern int parse_command __P((void)); +extern int read_command __P((void)); + +/* Functions from braces.c. */ +#if defined (BRACE_EXPANSION) +extern char **brace_expand __P((char *)); +#endif + +/* Miscellaneous functions from parse.y */ +extern int yyparse __P((void)); +extern int return_EOF __P((void)); +extern char *xparse_dolparen __P((char *, char *, int *, int)); +extern void reset_parser __P((void)); +extern WORD_LIST *parse_string_to_word_list __P((char *, int, const char *)); + +extern int parser_in_command_position __P((void)); + +extern void free_pushed_string_input __P((void)); + +extern int parser_expanding_alias __P((void)); +extern void parser_save_alias __P((void)); +extern void parser_restore_alias __P((void)); + +extern char *decode_prompt_string __P((char *)); + +extern int get_current_prompt_level __P((void)); +extern void set_current_prompt_level __P((int)); + +#if defined (HISTORY) +extern char *history_delimiting_chars __P((const char *)); +#endif + +/* Declarations for functions defined in locale.c */ +extern void set_default_locale __P((void)); +extern void set_default_locale_vars __P((void)); +extern int set_locale_var __P((char *, char *)); +extern int set_lang __P((char *, char *)); +extern void set_default_lang __P((void)); +extern char *get_locale_var __P((char *)); +extern char *localetrans __P((char *, int, int *)); +extern char *mk_msgstr __P((char *, int *)); +extern char *localeexpand __P((char *, int, int, int, int *)); + +/* Declarations for functions defined in list.c. */ +extern void list_walk __P((GENERIC_LIST *, sh_glist_func_t *)); +extern void wlist_walk __P((WORD_LIST *, sh_icpfunc_t *)); +extern GENERIC_LIST *list_reverse (); +extern int list_length (); +extern GENERIC_LIST *list_append (); +extern GENERIC_LIST *list_remove (); + +/* Declarations for functions defined in stringlib.c */ +extern int find_string_in_alist __P((char *, STRING_INT_ALIST *, int)); +extern char *find_token_in_alist __P((int, STRING_INT_ALIST *, int)); +extern int find_index_in_alist __P((char *, STRING_INT_ALIST *, int)); + +extern char *substring __P((const char *, int, int)); +extern char *strsub __P((char *, char *, char *, int)); +extern char *strcreplace __P((char *, int, char *, int)); +extern void strip_leading __P((char *)); +extern void strip_trailing __P((char *, int, int)); +extern void xbcopy __P((char *, char *, int)); + +/* Functions from version.c. */ +extern char *shell_version_string __P((void)); +extern void show_shell_version __P((int)); + +/* Functions from the bash library, lib/sh/libsh.a. These should really + go into a separate include file. */ + +/* declarations for functions defined in lib/sh/casemod.c */ +extern char *sh_modcase __P((const char *, char *, int)); + +/* Defines for flags argument to sh_modcase. These need to agree with what's + in lib/sh/casemode.c */ +#define CASE_LOWER 0x0001 +#define CASE_UPPER 0x0002 +#define CASE_CAPITALIZE 0x0004 +#define CASE_UNCAP 0x0008 +#define CASE_TOGGLE 0x0010 +#define CASE_TOGGLEALL 0x0020 +#define CASE_UPFIRST 0x0040 +#define CASE_LOWFIRST 0x0080 + +#define CASE_USEWORDS 0x1000 + +/* declarations for functions defined in lib/sh/clktck.c */ +extern long get_clk_tck __P((void)); + +/* declarations for functions defined in lib/sh/clock.c */ +extern void clock_t_to_secs (); +extern void print_clock_t (); + +/* Declarations for functions defined in lib/sh/dprintf.c */ +#if !defined (HAVE_DPRINTF) +extern void dprintf __P((int, const char *, ...)) __attribute__((__format__ (printf, 2, 3))); +#endif + +/* Declarations for functions defined in lib/sh/fmtulong.c */ +#define FL_PREFIX 0x01 /* add 0x, 0X, or 0 prefix as appropriate */ +#define FL_ADDBASE 0x02 /* add base# prefix to converted value */ +#define FL_HEXUPPER 0x04 /* use uppercase when converting to hex */ +#define FL_UNSIGNED 0x08 /* don't add any sign */ + +extern char *fmtulong __P((unsigned long int, int, char *, size_t, int)); + +/* Declarations for functions defined in lib/sh/fmtulong.c */ +#if defined (HAVE_LONG_LONG) +extern char *fmtullong __P((unsigned long long int, int, char *, size_t, int)); +#endif + +/* Declarations for functions defined in lib/sh/fmtumax.c */ +extern char *fmtumax __P((uintmax_t, int, char *, size_t, int)); + +/* Declarations for functions defined in lib/sh/fnxform.c */ +extern char *fnx_fromfs __P((char *, size_t)); +extern char *fnx_tofs __P((char *, size_t)); + +/* Declarations for functions defined in lib/sh/fpurge.c */ + +#if defined NEED_FPURGE_DECL +#if !HAVE_DECL_FPURGE + +#if HAVE_FPURGE +# define fpurge _bash_fpurge +#endif +extern int fpurge __P((FILE *stream)); + +#endif /* HAVE_DECL_FPURGE */ +#endif /* NEED_FPURGE_DECL */ + +/* Declarations for functions defined in lib/sh/getcwd.c */ +#if !defined (HAVE_GETCWD) +extern char *getcwd __P((char *, size_t)); +#endif + +/* Declarations for functions defined in lib/sh/input_avail.c */ +extern int input_avail __P((int)); + +/* Declarations for functions defined in lib/sh/itos.c */ +extern char *inttostr __P((intmax_t, char *, size_t)); +extern char *itos __P((intmax_t)); +extern char *mitos __P((intmax_t)); +extern char *uinttostr __P((uintmax_t, char *, size_t)); +extern char *uitos __P((uintmax_t)); + +/* declarations for functions defined in lib/sh/makepath.c */ +#define MP_DOTILDE 0x01 +#define MP_DOCWD 0x02 +#define MP_RMDOT 0x04 +#define MP_IGNDOT 0x08 + +extern char *sh_makepath __P((const char *, const char *, int)); + +/* declarations for functions defined in lib/sh/mbscasecmp.c */ +#if !defined (HAVE_MBSCASECMP) +extern char *mbscasecmp __P((const char *, const char *)); +#endif + +/* declarations for functions defined in lib/sh/mbschr.c */ +#if !defined (HAVE_MBSCHR) +extern char *mbschr __P((const char *, int)); +#endif + +/* declarations for functions defined in lib/sh/mbscmp.c */ +#if !defined (HAVE_MBSCMP) +extern char *mbscmp __P((const char *, const char *)); +#endif + +/* declarations for functions defined in lib/sh/netconn.c */ +extern int isnetconn __P((int)); + +/* declarations for functions defined in lib/sh/netopen.c */ +extern int netopen __P((char *)); + +/* Declarations for functions defined in lib/sh/oslib.c */ + +#if !defined (HAVE_DUP2) || defined (DUP2_BROKEN) +extern int dup2 __P((int, int)); +#endif + +#if !defined (HAVE_GETDTABLESIZE) +extern int getdtablesize __P((void)); +#endif /* !HAVE_GETDTABLESIZE */ + +#if !defined (HAVE_GETHOSTNAME) +extern int gethostname __P((char *, int)); +#endif /* !HAVE_GETHOSTNAME */ + +extern int getmaxgroups __P((void)); +extern long getmaxchild __P((void)); + +/* declarations for functions defined in lib/sh/pathcanon.c */ +#define PATH_CHECKDOTDOT 0x0001 +#define PATH_CHECKEXISTS 0x0002 +#define PATH_HARDPATH 0x0004 +#define PATH_NOALLOC 0x0008 + +extern char *sh_canonpath __P((char *, int)); + +/* declarations for functions defined in lib/sh/pathphys.c */ +extern char *sh_physpath __P((char *, int)); +extern char *sh_realpath __P((const char *, char *)); + +/* declarations for functions defined in lib/sh/setlinebuf.c */ +#ifdef NEED_SH_SETLINEBUF_DECL +extern int sh_setlinebuf __P((FILE *)); +#endif + +/* declarations for functions defined in lib/sh/shaccess.c */ +extern int sh_eaccess __P((char *, int)); + +/* declarations for functions defined in lib/sh/shmatch.c */ +extern int sh_regmatch __P((const char *, const char *, int)); + +/* defines for flags argument to sh_regmatch. */ +#define SHMAT_SUBEXP 0x001 /* save subexpressions in SH_REMATCH */ +#define SHMAT_PWARN 0x002 /* print a warning message on invalid regexp */ + +/* declarations for functions defined in lib/sh/shmbchar.c */ +extern size_t mbstrlen __P((const char *)); +extern char *mbsmbchar __P((const char *)); +extern int sh_mbsnlen __P((const char *, size_t, int)); + +/* declarations for functions defined in lib/sh/shquote.c */ +extern char *sh_single_quote __P((const char *)); +extern char *sh_double_quote __P((const char *)); +extern char *sh_mkdoublequoted __P((const char *, int, int)); +extern char *sh_un_double_quote __P((char *)); +extern char *sh_backslash_quote __P((char *, const char *, int)); +extern char *sh_backslash_quote_for_double_quotes __P((char *)); +extern int sh_contains_shell_metas __P((char *)); + +/* declarations for functions defined in lib/sh/spell.c */ +extern int spname __P((char *, char *)); +extern char *dirspell __P((char *)); + +/* declarations for functions defined in lib/sh/strcasecmp.c */ +#if !defined (HAVE_STRCASECMP) +extern int strncasecmp __P((const char *, const char *, int)); +extern int strcasecmp __P((const char *, const char *)); +#endif /* HAVE_STRCASECMP */ + +/* declarations for functions defined in lib/sh/strcasestr.c */ +#if ! HAVE_STRCASESTR +extern char *strcasestr __P((const char *, const char *)); +#endif + +/* declarations for functions defined in lib/sh/strchrnul.c */ +#if ! HAVE_STRCHRNUL +extern char *strchrnul __P((const char *, int)); +#endif + +/* declarations for functions defined in lib/sh/strerror.c */ +#if !defined (HAVE_STRERROR) && !defined (strerror) +extern char *strerror __P((int)); +#endif + +/* declarations for functions defined in lib/sh/strftime.c */ +#if !defined (HAVE_STRFTIME) && defined (NEED_STRFTIME_DECL) +extern size_t strftime __P((char *, size_t, const char *, const struct tm *)); +#endif + +/* declarations for functions and structures defined in lib/sh/stringlist.c */ + +/* This is a general-purpose argv-style array struct. */ +typedef struct _list_of_strings { + char **list; + int list_size; + int list_len; +} STRINGLIST; + +typedef int sh_strlist_map_func_t __P((char *)); + +extern STRINGLIST *strlist_create __P((int)); +extern STRINGLIST *strlist_resize __P((STRINGLIST *, int)); +extern void strlist_flush __P((STRINGLIST *)); +extern void strlist_dispose __P((STRINGLIST *)); +extern int strlist_remove __P((STRINGLIST *, char *)); +extern STRINGLIST *strlist_copy __P((STRINGLIST *)); +extern STRINGLIST *strlist_merge __P((STRINGLIST *, STRINGLIST *)); +extern STRINGLIST *strlist_append __P((STRINGLIST *, STRINGLIST *)); +extern STRINGLIST *strlist_prefix_suffix __P((STRINGLIST *, char *, char *)); +extern void strlist_print __P((STRINGLIST *, char *)); +extern void strlist_walk __P((STRINGLIST *, sh_strlist_map_func_t *)); +extern void strlist_sort __P((STRINGLIST *)); + +/* declarations for functions defined in lib/sh/stringvec.c */ + +extern char **strvec_create __P((int)); +extern char **strvec_resize __P((char **, int)); +extern char **strvec_mcreate __P((int)); +extern char **strvec_mresize __P((char **, int)); +extern void strvec_flush __P((char **)); +extern void strvec_dispose __P((char **)); +extern int strvec_remove __P((char **, char *)); +extern int strvec_len __P((char **)); +extern int strvec_search __P((char **, char *)); +extern char **strvec_copy __P((char **)); +extern int strvec_strcmp __P((char **, char **)); +extern void strvec_sort __P((char **)); + +extern char **strvec_from_word_list __P((WORD_LIST *, int, int, int *)); +extern WORD_LIST *strvec_to_word_list __P((char **, int, int)); + +/* declarations for functions defined in lib/sh/strnlen.c */ +#if !defined (HAVE_STRNLEN) +extern size_t strnlen __P((const char *, size_t)); +#endif + +/* declarations for functions defined in lib/sh/strpbrk.c */ +#if !defined (HAVE_STRPBRK) +extern char *strpbrk __P((const char *, const char *)); +#endif + +/* declarations for functions defined in lib/sh/strtod.c */ +#if !defined (HAVE_STRTOD) +extern double strtod __P((const char *, char **)); +#endif + +/* declarations for functions defined in lib/sh/strtol.c */ +#if !HAVE_DECL_STRTOL +extern long strtol __P((const char *, char **, int)); +#endif + +/* declarations for functions defined in lib/sh/strtoll.c */ +#if defined (HAVE_LONG_LONG) && !HAVE_DECL_STRTOLL +extern long long strtoll __P((const char *, char **, int)); +#endif + +/* declarations for functions defined in lib/sh/strtoul.c */ +#if !HAVE_DECL_STRTOUL +extern unsigned long strtoul __P((const char *, char **, int)); +#endif + +/* declarations for functions defined in lib/sh/strtoull.c */ +#if defined (HAVE_LONG_LONG) && !HAVE_DECL_STRTOULL +extern unsigned long long strtoull __P((const char *, char **, int)); +#endif + +/* declarations for functions defined in lib/sh/strimax.c */ +#if !HAVE_DECL_STRTOIMAX +extern intmax_t strtoimax __P((const char *, char **, int)); +#endif + +/* declarations for functions defined in lib/sh/strumax.c */ +#if !HAVE_DECL_STRTOUMAX +extern uintmax_t strtoumax __P((const char *, char **, int)); +#endif + +/* declarations for functions defined in lib/sh/strtrans.c */ +extern char *ansicstr __P((char *, int, int, int *, int *)); +extern char *ansic_quote __P((char *, int, int *)); +extern int ansic_shouldquote __P((const char *)); +extern char *ansiexpand __P((char *, int, int, int *)); + +/* declarations for functions defined in lib/sh/timeval.c. No prototypes + so we don't have to count on having a definition of struct timeval in + scope when this file is included. */ +extern void timeval_to_secs (); +extern void print_timeval (); + +/* declarations for functions defined in lib/sh/tmpfile.c */ +#define MT_USETMPDIR 0x0001 +#define MT_READWRITE 0x0002 +#define MT_USERANDOM 0x0004 + +extern char *sh_mktmpname __P((char *, int)); +extern int sh_mktmpfd __P((char *, int, char **)); +/* extern FILE *sh_mktmpfp __P((char *, int, char **)); */ + +/* declarations for functions defined in lib/sh/uconvert.c */ +extern int uconvert __P((char *, long *, long *)); + +/* declarations for functions defined in lib/sh/ufuncs.c */ +extern unsigned int falarm __P((unsigned int, unsigned int)); +extern unsigned int fsleep __P((unsigned int, unsigned int)); + +/* declarations for functions defined in lib/sh/unicode.c */ +extern int u32cconv __P((unsigned long, char *)); +extern void u32reset __P((void)); + +/* declarations for functions defined in lib/sh/wcsnwidth.c */ +#if defined (HANDLE_MULTIBYTE) +extern int wcsnwidth __P((const wchar_t *, size_t, int)); +#endif + +/* declarations for functions defined in lib/sh/winsize.c */ +extern void get_new_window_size __P((int, int *, int *)); + +/* declarations for functions defined in lib/sh/zcatfd.c */ +extern int zcatfd __P((int, int, char *)); + +/* declarations for functions defined in lib/sh/zgetline.c */ +extern ssize_t zgetline __P((int, char **, size_t *, int)); + +/* declarations for functions defined in lib/sh/zmapfd.c */ +extern int zmapfd __P((int, char **, char *)); + +/* declarations for functions defined in lib/sh/zread.c */ +extern ssize_t zread __P((int, char *, size_t)); +extern ssize_t zreadretry __P((int, char *, size_t)); +extern ssize_t zreadintr __P((int, char *, size_t)); +extern ssize_t zreadc __P((int, char *)); +extern ssize_t zreadcintr __P((int, char *)); +extern ssize_t zreadn __P((int, char *, size_t)); +extern void zreset __P((void)); +extern void zsyncfd __P((int)); + +/* declarations for functions defined in lib/sh/zwrite.c */ +extern int zwrite __P((int, char *, size_t)); + +/* declarations for functions defined in lib/glob/gmisc.c */ +extern int match_pattern_char __P((char *, char *)); +extern int umatchlen __P((char *, size_t)); + +#if defined (HANDLE_MULTIBYTE) +extern int match_pattern_wchar __P((wchar_t *, wchar_t *)); +extern int wmatchlen __P((wchar_t *, size_t)); +#endif + +#endif /* _EXTERNS_H_ */ diff --git a/.pc/bash43-010.diff/lib/sh/shquote.c b/.pc/bash43-010.diff/lib/sh/shquote.c new file mode 100644 index 0000000..31cce1c --- /dev/null +++ b/.pc/bash43-010.diff/lib/sh/shquote.c @@ -0,0 +1,313 @@ +/* shquote - functions to quote and dequote strings */ + +/* Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include + +#include "syntax.h" +#include + +/* Default set of characters that should be backslash-quoted in strings */ +static const char bstab[256] = + { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 0, 0, 0, 0, 0, /* TAB, NL */ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 1, 1, 1, 0, 1, 0, 1, 1, /* SPACE, !, DQUOTE, DOL, AMP, SQUOTE */ + 1, 1, 1, 0, 1, 0, 0, 0, /* LPAR, RPAR, STAR, COMMA */ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 0, 1, 1, /* SEMI, LESSTHAN, GREATERTHAN, QUEST */ + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 1, 0, /* LBRACK, BS, RBRACK, CARAT */ + + 1, 0, 0, 0, 0, 0, 0, 0, /* BACKQ */ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 0, 0, /* LBRACE, BAR, RBRACE */ + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + }; + +/* **************************************************************** */ +/* */ +/* Functions for quoting strings to be re-read as input */ +/* */ +/* **************************************************************** */ + +/* Return a new string which is the single-quoted version of STRING. + Used by alias and trap, among others. */ +char * +sh_single_quote (string) + const char *string; +{ + register int c; + char *result, *r; + const char *s; + + result = (char *)xmalloc (3 + (4 * strlen (string))); + r = result; + + if (string[0] == '\'' && string[1] == 0) + { + *r++ = '\\'; + *r++ = '\''; + *r++ = 0; + return result; + } + + *r++ = '\''; + + for (s = string; s && (c = *s); s++) + { + *r++ = c; + + if (c == '\'') + { + *r++ = '\\'; /* insert escaped single quote */ + *r++ = '\''; + *r++ = '\''; /* start new quoted string */ + } + } + + *r++ = '\''; + *r = '\0'; + + return (result); +} + +/* Quote STRING using double quotes. Return a new string. */ +char * +sh_double_quote (string) + const char *string; +{ + register unsigned char c; + char *result, *r; + const char *s; + + result = (char *)xmalloc (3 + (2 * strlen (string))); + r = result; + *r++ = '"'; + + for (s = string; s && (c = *s); s++) + { + /* Backslash-newline disappears within double quotes, so don't add one. */ + if ((sh_syntaxtab[c] & CBSDQUOTE) && c != '\n') + *r++ = '\\'; + else if (c == CTLESC || c == CTLNUL) + *r++ = CTLESC; /* could be '\\'? */ + + *r++ = c; + } + + *r++ = '"'; + *r = '\0'; + + return (result); +} + +/* Turn S into a simple double-quoted string. If FLAGS is non-zero, quote + double quote characters in S with backslashes. */ +char * +sh_mkdoublequoted (s, slen, flags) + const char *s; + int slen, flags; +{ + char *r, *ret; + int rlen; + + rlen = (flags == 0) ? slen + 3 : (2 * slen) + 1; + ret = r = (char *)xmalloc (rlen); + + *r++ = '"'; + while (*s) + { + if (flags && *s == '"') + *r++ = '\\'; + *r++ = *s++; + } + *r++ = '"'; + *r = '\0'; + + return ret; +} + +/* Remove backslashes that are quoting characters that are special between + double quotes. Return a new string. XXX - should this handle CTLESC + and CTLNUL? */ +char * +sh_un_double_quote (string) + char *string; +{ + register int c, pass_next; + char *result, *r, *s; + + r = result = (char *)xmalloc (strlen (string) + 1); + + for (pass_next = 0, s = string; s && (c = *s); s++) + { + if (pass_next) + { + *r++ = c; + pass_next = 0; + continue; + } + if (c == '\\' && (sh_syntaxtab[(unsigned char) s[1]] & CBSDQUOTE)) + { + pass_next = 1; + continue; + } + *r++ = c; + } + + *r = '\0'; + return result; +} + +/* Quote special characters in STRING using backslashes. Return a new + string. NOTE: if the string is to be further expanded, we need a + way to protect the CTLESC and CTLNUL characters. As I write this, + the current callers will never cause the string to be expanded without + going through the shell parser, which will protect the internal + quoting characters. TABLE, if set, points to a map of the ascii code + set with char needing to be backslash-quoted if table[char]==1. FLAGS, + if 1, causes tildes to be quoted as well. */ + +char * +sh_backslash_quote (string, table, flags) + char *string; + char *table; + int flags; +{ + int c; + char *result, *r, *s, *backslash_table; + + result = (char *)xmalloc (2 * strlen (string) + 1); + + backslash_table = table ? table : (char *)bstab; + for (r = result, s = string; s && (c = *s); s++) + { + if (backslash_table[c] == 1) + *r++ = '\\'; + else if (c == '#' && s == string) /* comment char */ + *r++ = '\\'; + else if ((flags&1) && c == '~' && (s == string || s[-1] == ':' || s[-1] == '=')) + /* Tildes are special at the start of a word or after a `:' or `=' + (technically unquoted, but it doesn't make a difference in practice) */ + *r++ = '\\'; + *r++ = c; + } + + *r = '\0'; + return (result); +} + +#if defined (PROMPT_STRING_DECODE) +/* Quote characters that get special treatment when in double quotes in STRING + using backslashes. Return a new string. */ +char * +sh_backslash_quote_for_double_quotes (string) + char *string; +{ + unsigned char c; + char *result, *r, *s; + + result = (char *)xmalloc (2 * strlen (string) + 1); + + for (r = result, s = string; s && (c = *s); s++) + { + if (sh_syntaxtab[c] & CBSDQUOTE) + *r++ = '\\'; + /* I should probably add flags for these to sh_syntaxtab[] */ + else if (c == CTLESC || c == CTLNUL) + *r++ = CTLESC; /* could be '\\'? */ + + *r++ = c; + } + + *r = '\0'; + return (result); +} +#endif /* PROMPT_STRING_DECODE */ + +int +sh_contains_shell_metas (string) + char *string; +{ + char *s; + + for (s = string; s && *s; s++) + { + switch (*s) + { + case ' ': case '\t': case '\n': /* IFS white space */ + case '\'': case '"': case '\\': /* quoting chars */ + case '|': case '&': case ';': /* shell metacharacters */ + case '(': case ')': case '<': case '>': + case '!': case '{': case '}': /* reserved words */ + case '*': case '[': case '?': case ']': /* globbing chars */ + case '^': + case '$': case '`': /* expansion chars */ + return (1); + case '~': /* tilde expansion */ + if (s == string || s[-1] == '=' || s[-1] == ':') + return (1); + break; + case '#': + if (s == string) /* comment char */ + return (1); + /* FALLTHROUGH */ + default: + break; + } + } + + return (0); +} diff --git a/.pc/bash43-010.diff/patchlevel.h b/.pc/bash43-010.diff/patchlevel.h new file mode 100644 index 0000000..2860f13 --- /dev/null +++ b/.pc/bash43-010.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 9 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-010.diff/pcomplete.c b/.pc/bash43-010.diff/pcomplete.c new file mode 100644 index 0000000..a3327ed --- /dev/null +++ b/.pc/bash43-010.diff/pcomplete.c @@ -0,0 +1,1632 @@ +/* pcomplete.c - functions to generate lists of matches for programmable completion. */ + +/* Copyright (C) 1999-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (PROGRAMMABLE_COMPLETION) + +#include "bashtypes.h" +#include "posixstat.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include + +#if defined (PREFER_STDARG) +# include +#else +# include +#endif + +#include + +#include +#include "bashansi.h" +#include "bashintl.h" + +#include "shell.h" +#include "pcomplete.h" +#include "alias.h" +#include "bashline.h" +#include "execute_cmd.h" +#include "pathexp.h" + +#if defined (JOB_CONTROL) +# include "jobs.h" +#endif + +#if !defined (NSIG) +# include "trap.h" +#endif + +#include "shmbutil.h" + +#include "builtins.h" +#include "builtins/common.h" +#include "builtins/builtext.h" + +#include +#include + +#include +#include +#include + +#define PCOMP_RETRYFAIL 256 + +#ifdef STRDUP +# undef STRDUP +#endif +#define STRDUP(x) ((x) ? savestring (x) : (char *)NULL) + +typedef SHELL_VAR **SVFUNC (); + +#ifndef HAVE_STRPBRK +extern char *strpbrk __P((char *, char *)); +#endif + +extern int array_needs_making; +extern STRING_INT_ALIST word_token_alist[]; +extern char *signal_names[]; +extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin; + +#if defined (DEBUG) +#if defined (PREFER_STDARG) +static void debug_printf (const char *, ...) __attribute__((__format__ (printf, 1, 2))); +#endif +#endif /* DEBUG */ + +static int it_init_joblist __P((ITEMLIST *, int)); + +static int it_init_aliases __P((ITEMLIST *)); +static int it_init_arrayvars __P((ITEMLIST *)); +static int it_init_bindings __P((ITEMLIST *)); +static int it_init_builtins __P((ITEMLIST *)); +static int it_init_disabled __P((ITEMLIST *)); +static int it_init_enabled __P((ITEMLIST *)); +static int it_init_exported __P((ITEMLIST *)); +static int it_init_functions __P((ITEMLIST *)); +static int it_init_helptopics __P((ITEMLIST *)); +static int it_init_hostnames __P((ITEMLIST *)); +static int it_init_jobs __P((ITEMLIST *)); +static int it_init_running __P((ITEMLIST *)); +static int it_init_stopped __P((ITEMLIST *)); +static int it_init_keywords __P((ITEMLIST *)); +static int it_init_signals __P((ITEMLIST *)); +static int it_init_variables __P((ITEMLIST *)); +static int it_init_setopts __P((ITEMLIST *)); +static int it_init_shopts __P((ITEMLIST *)); + +static int shouldexp_filterpat __P((char *)); +static char *preproc_filterpat __P((char *, char *)); + +static void init_itemlist_from_varlist __P((ITEMLIST *, SVFUNC *)); + +static STRINGLIST *gen_matches_from_itemlist __P((ITEMLIST *, const char *)); +static STRINGLIST *gen_action_completions __P((COMPSPEC *, const char *)); +static STRINGLIST *gen_globpat_matches __P((COMPSPEC *, const char *)); +static STRINGLIST *gen_wordlist_matches __P((COMPSPEC *, const char *)); +static STRINGLIST *gen_shell_function_matches __P((COMPSPEC *, const char *, + const char *, + char *, int, WORD_LIST *, + int, int, int *)); +static STRINGLIST *gen_command_matches __P((COMPSPEC *, const char *, + const char *, + char *, int, WORD_LIST *, + int, int)); + +static STRINGLIST *gen_progcomp_completions __P((const char *, const char *, + const char *, + int, int, int *, int *, + COMPSPEC **)); + +static char *pcomp_filename_completion_function __P((const char *, int)); + +#if defined (ARRAY_VARS) +static SHELL_VAR *bind_comp_words __P((WORD_LIST *)); +#endif +static void bind_compfunc_variables __P((char *, int, WORD_LIST *, int, int)); +static void unbind_compfunc_variables __P((int)); +static WORD_LIST *build_arg_list __P((char *, const char *, const char *, WORD_LIST *, int)); +static WORD_LIST *command_line_to_word_list __P((char *, int, int, int *, int *)); + +#ifdef DEBUG +static int progcomp_debug = 0; +#endif + +int prog_completion_enabled = 1; + +/* These are used to manage the arrays of strings for possible completions. */ +ITEMLIST it_aliases = { 0, it_init_aliases, (STRINGLIST *)0 }; +ITEMLIST it_arrayvars = { LIST_DYNAMIC, it_init_arrayvars, (STRINGLIST *)0 }; +ITEMLIST it_bindings = { 0, it_init_bindings, (STRINGLIST *)0 }; +ITEMLIST it_builtins = { 0, it_init_builtins, (STRINGLIST *)0 }; +ITEMLIST it_commands = { LIST_DYNAMIC }; /* unused */ +ITEMLIST it_directories = { LIST_DYNAMIC }; /* unused */ +ITEMLIST it_disabled = { 0, it_init_disabled, (STRINGLIST *)0 }; +ITEMLIST it_enabled = { 0, it_init_enabled, (STRINGLIST *)0 }; +ITEMLIST it_exports = { LIST_DYNAMIC, it_init_exported, (STRINGLIST *)0 }; +ITEMLIST it_files = { LIST_DYNAMIC }; /* unused */ +ITEMLIST it_functions = { 0, it_init_functions, (STRINGLIST *)0 }; +ITEMLIST it_helptopics = { 0, it_init_helptopics, (STRINGLIST *)0 }; +ITEMLIST it_hostnames = { LIST_DYNAMIC, it_init_hostnames, (STRINGLIST *)0 }; +ITEMLIST it_groups = { LIST_DYNAMIC }; /* unused */ +ITEMLIST it_jobs = { LIST_DYNAMIC, it_init_jobs, (STRINGLIST *)0 }; +ITEMLIST it_keywords = { 0, it_init_keywords, (STRINGLIST *)0 }; +ITEMLIST it_running = { LIST_DYNAMIC, it_init_running, (STRINGLIST *)0 }; +ITEMLIST it_services = { LIST_DYNAMIC }; /* unused */ +ITEMLIST it_setopts = { 0, it_init_setopts, (STRINGLIST *)0 }; +ITEMLIST it_shopts = { 0, it_init_shopts, (STRINGLIST *)0 }; +ITEMLIST it_signals = { 0, it_init_signals, (STRINGLIST *)0 }; +ITEMLIST it_stopped = { LIST_DYNAMIC, it_init_stopped, (STRINGLIST *)0 }; +ITEMLIST it_users = { LIST_DYNAMIC }; /* unused */ +ITEMLIST it_variables = { LIST_DYNAMIC, it_init_variables, (STRINGLIST *)0 }; + +COMPSPEC *pcomp_curcs; +const char *pcomp_curcmd; + +#ifdef DEBUG +/* Debugging code */ +static void +#if defined (PREFER_STDARG) +debug_printf (const char *format, ...) +#else +debug_printf (format, va_alist) + const char *format; + va_dcl +#endif +{ + va_list args; + + if (progcomp_debug == 0) + return; + + SH_VA_START (args, format); + + fprintf (stdout, "DEBUG: "); + vfprintf (stdout, format, args); + fprintf (stdout, "\n"); + + rl_on_new_line (); + + va_end (args); +} +#endif + +/* Functions to manage the item lists */ + +void +set_itemlist_dirty (it) + ITEMLIST *it; +{ + it->flags |= LIST_DIRTY; +} + +void +initialize_itemlist (itp) + ITEMLIST *itp; +{ + (*itp->list_getter) (itp); + itp->flags |= LIST_INITIALIZED; + itp->flags &= ~LIST_DIRTY; +} + +void +clean_itemlist (itp) + ITEMLIST *itp; +{ + STRINGLIST *sl; + + sl = itp->slist; + if (sl) + { + if ((itp->flags & (LIST_DONTFREEMEMBERS|LIST_DONTFREE)) == 0) + strvec_flush (sl->list); + if ((itp->flags & LIST_DONTFREE) == 0) + free (sl->list); + free (sl); + } + itp->slist = (STRINGLIST *)NULL; + itp->flags &= ~(LIST_DONTFREE|LIST_DONTFREEMEMBERS|LIST_INITIALIZED|LIST_DIRTY); +} + + +static int +shouldexp_filterpat (s) + char *s; +{ + register char *p; + + for (p = s; p && *p; p++) + { + if (*p == '\\') + p++; + else if (*p == '&') + return 1; + } + return 0; +} + +/* Replace any instance of `&' in PAT with TEXT. Backslash may be used to + quote a `&' and inhibit substitution. Returns a new string. This just + calls stringlib.c:strcreplace(). */ +static char * +preproc_filterpat (pat, text) + char *pat; + char *text; +{ + char *ret; + + ret = strcreplace (pat, '&', text, 1); + return ret; +} + +/* Remove any match of FILTERPAT from SL. A `&' in FILTERPAT is replaced by + TEXT. A leading `!' in FILTERPAT negates the pattern; in this case + any member of SL->list that does *not* match will be removed. This returns + a new STRINGLIST with the matching members of SL *copied*. Any + non-matching members of SL->list are *freed*. */ +STRINGLIST * +filter_stringlist (sl, filterpat, text) + STRINGLIST *sl; + char *filterpat, *text; +{ + int i, m, not; + STRINGLIST *ret; + char *npat, *t; + + if (sl == 0 || sl->list == 0 || sl->list_len == 0) + return sl; + + npat = shouldexp_filterpat (filterpat) ? preproc_filterpat (filterpat, text) : filterpat; + + not = (npat[0] == '!'); + t = not ? npat + 1 : npat; + + ret = strlist_create (sl->list_size); + for (i = 0; i < sl->list_len; i++) + { + m = strmatch (t, sl->list[i], FNMATCH_EXTFLAG); + if ((not && m == FNM_NOMATCH) || (not == 0 && m != FNM_NOMATCH)) + free (sl->list[i]); + else + ret->list[ret->list_len++] = sl->list[i]; + } + + ret->list[ret->list_len] = (char *)NULL; + if (npat != filterpat) + free (npat); + + return ret; +} + +/* Turn an array of strings returned by rl_completion_matches into a STRINGLIST. + This understands how rl_completion_matches sets matches[0] (the lcd of the + strings in the list, unless it's the only match). */ +STRINGLIST * +completions_to_stringlist (matches) + char **matches; +{ + STRINGLIST *sl; + int mlen, i, n; + + mlen = (matches == 0) ? 0 : strvec_len (matches); + sl = strlist_create (mlen + 1); + + if (matches == 0 || matches[0] == 0) + return sl; + + if (matches[1] == 0) + { + sl->list[0] = STRDUP (matches[0]); + sl->list[sl->list_len = 1] = (char *)NULL; + return sl; + } + + for (i = 1, n = 0; i < mlen; i++, n++) + sl->list[n] = STRDUP (matches[i]); + sl->list_len = n; + sl->list[n] = (char *)NULL; + + return sl; +} + +/* Functions to manage the various ITEMLISTs that we populate internally. + The caller is responsible for setting ITP->flags correctly. */ + +static int +it_init_aliases (itp) + ITEMLIST *itp; +{ +#ifdef ALIAS + alias_t **alias_list; + register int i, n; + STRINGLIST *sl; + + alias_list = all_aliases (); + if (alias_list == 0) + { + itp->slist = (STRINGLIST *)NULL; + return 0; + } + for (n = 0; alias_list[n]; n++) + ; + sl = strlist_create (n+1); + for (i = 0; i < n; i++) + sl->list[i] = STRDUP (alias_list[i]->name); + sl->list[n] = (char *)NULL; + sl->list_size = sl->list_len = n; + itp->slist = sl; +#else + itp->slist = (STRINGLIST *)NULL; +#endif + free (alias_list); + return 1; +} + +static void +init_itemlist_from_varlist (itp, svfunc) + ITEMLIST *itp; + SVFUNC *svfunc; +{ + SHELL_VAR **vlist; + STRINGLIST *sl; + register int i, n; + + vlist = (*svfunc) (); + if (vlist == 0) + { + itp->slist = (STRINGLIST *)NULL; + return; + } + for (n = 0; vlist[n]; n++) + ; + sl = strlist_create (n+1); + for (i = 0; i < n; i++) + sl->list[i] = savestring (vlist[i]->name); + sl->list[sl->list_len = n] = (char *)NULL; + itp->slist = sl; +} + +static int +it_init_arrayvars (itp) + ITEMLIST *itp; +{ +#if defined (ARRAY_VARS) + init_itemlist_from_varlist (itp, all_array_variables); + return 1; +#else + return 0; +#endif +} + +static int +it_init_bindings (itp) + ITEMLIST *itp; +{ + char **blist; + STRINGLIST *sl; + + /* rl_funmap_names allocates blist, but not its members */ + blist = (char **)rl_funmap_names (); /* XXX fix const later */ + sl = strlist_create (0); + sl->list = blist; + sl->list_size = 0; + sl->list_len = strvec_len (sl->list); + itp->flags |= LIST_DONTFREEMEMBERS; + itp->slist = sl; + + return 0; +} + +static int +it_init_builtins (itp) + ITEMLIST *itp; +{ + STRINGLIST *sl; + register int i, n; + + sl = strlist_create (num_shell_builtins); + for (i = n = 0; i < num_shell_builtins; i++) + if (shell_builtins[i].function) + sl->list[n++] = shell_builtins[i].name; + sl->list[sl->list_len = n] = (char *)NULL; + itp->flags |= LIST_DONTFREEMEMBERS; + itp->slist = sl; + return 0; +} + +static int +it_init_enabled (itp) + ITEMLIST *itp; +{ + STRINGLIST *sl; + register int i, n; + + sl = strlist_create (num_shell_builtins); + for (i = n = 0; i < num_shell_builtins; i++) + { + if (shell_builtins[i].function && (shell_builtins[i].flags & BUILTIN_ENABLED)) + sl->list[n++] = shell_builtins[i].name; + } + sl->list[sl->list_len = n] = (char *)NULL; + itp->flags |= LIST_DONTFREEMEMBERS; + itp->slist = sl; + return 0; +} + +static int +it_init_disabled (itp) + ITEMLIST *itp; +{ + STRINGLIST *sl; + register int i, n; + + sl = strlist_create (num_shell_builtins); + for (i = n = 0; i < num_shell_builtins; i++) + { + if (shell_builtins[i].function && ((shell_builtins[i].flags & BUILTIN_ENABLED) == 0)) + sl->list[n++] = shell_builtins[i].name; + } + sl->list[sl->list_len = n] = (char *)NULL; + itp->flags |= LIST_DONTFREEMEMBERS; + itp->slist = sl; + return 0; +} + +static int +it_init_exported (itp) + ITEMLIST *itp; +{ + init_itemlist_from_varlist (itp, all_exported_variables); + return 0; +} + +static int +it_init_functions (itp) + ITEMLIST *itp; +{ + init_itemlist_from_varlist (itp, all_visible_functions); + return 0; +} + +/* Like it_init_builtins, but includes everything the help builtin looks at, + not just builtins with an active implementing function. */ +static int +it_init_helptopics (itp) + ITEMLIST *itp; +{ + STRINGLIST *sl; + register int i, n; + + sl = strlist_create (num_shell_builtins); + for (i = n = 0; i < num_shell_builtins; i++) + sl->list[n++] = shell_builtins[i].name; + sl->list[sl->list_len = n] = (char *)NULL; + itp->flags |= LIST_DONTFREEMEMBERS; + itp->slist = sl; + return 0; +} + +static int +it_init_hostnames (itp) + ITEMLIST *itp; +{ + STRINGLIST *sl; + + sl = strlist_create (0); + sl->list = get_hostname_list (); + sl->list_len = sl->list ? strvec_len (sl->list) : 0; + sl->list_size = sl->list_len; + itp->slist = sl; + itp->flags |= LIST_DONTFREEMEMBERS|LIST_DONTFREE; + return 0; +} + +static int +it_init_joblist (itp, jstate) + ITEMLIST *itp; + int jstate; +{ +#if defined (JOB_CONTROL) + STRINGLIST *sl; + register int i; + register PROCESS *p; + char *s, *t; + JOB *j; + JOB_STATE ws; /* wanted state */ + + ws = JNONE; + if (jstate == 0) + ws = JRUNNING; + else if (jstate == 1) + ws = JSTOPPED; + + sl = strlist_create (js.j_jobslots); + for (i = js.j_jobslots - 1; i >= 0; i--) + { + j = get_job_by_jid (i); + if (j == 0) + continue; + p = j->pipe; + if (jstate == -1 || JOBSTATE(i) == ws) + { + s = savestring (p->command); + t = strpbrk (s, " \t\n"); + if (t) + *t = '\0'; + sl->list[sl->list_len++] = s; + } + } + itp->slist = sl; +#else + itp->slist = (STRINGLIST *)NULL; +#endif + return 0; +} + +static int +it_init_jobs (itp) + ITEMLIST *itp; +{ + return (it_init_joblist (itp, -1)); +} + +static int +it_init_running (itp) + ITEMLIST *itp; +{ + return (it_init_joblist (itp, 0)); +} + +static int +it_init_stopped (itp) + ITEMLIST *itp; +{ + return (it_init_joblist (itp, 1)); +} + +static int +it_init_keywords (itp) + ITEMLIST *itp; +{ + STRINGLIST *sl; + register int i, n; + + for (n = 0; word_token_alist[n].word; n++) + ; + sl = strlist_create (n); + for (i = 0; i < n; i++) + sl->list[i] = word_token_alist[i].word; + sl->list[sl->list_len = i] = (char *)NULL; + itp->flags |= LIST_DONTFREEMEMBERS; + itp->slist = sl; + return 0; +} + +static int +it_init_signals (itp) + ITEMLIST *itp; +{ + STRINGLIST *sl; + + sl = strlist_create (0); + sl->list = signal_names; + sl->list_len = strvec_len (sl->list); + itp->flags |= LIST_DONTFREE; + itp->slist = sl; + return 0; +} + +static int +it_init_variables (itp) + ITEMLIST *itp; +{ + init_itemlist_from_varlist (itp, all_visible_variables); + return 0; +} + +static int +it_init_setopts (itp) + ITEMLIST *itp; +{ + STRINGLIST *sl; + + sl = strlist_create (0); + sl->list = get_minus_o_opts (); + sl->list_len = strvec_len (sl->list); + itp->slist = sl; + itp->flags |= LIST_DONTFREEMEMBERS; + return 0; +} + +static int +it_init_shopts (itp) + ITEMLIST *itp; +{ + STRINGLIST *sl; + + sl = strlist_create (0); + sl->list = get_shopt_options (); + sl->list_len = strvec_len (sl->list); + itp->slist = sl; + itp->flags |= LIST_DONTFREEMEMBERS; + return 0; +} + +/* Generate a list of all matches for TEXT using the STRINGLIST in itp->slist + as the list of possibilities. If the itemlist has been marked dirty or + it should be regenerated every time, destroy the old STRINGLIST and make a + new one before trying the match. TEXT is dequoted before attempting a + match. */ +static STRINGLIST * +gen_matches_from_itemlist (itp, text) + ITEMLIST *itp; + const char *text; +{ + STRINGLIST *ret, *sl; + int tlen, i, n; + char *ntxt; + + if ((itp->flags & (LIST_DIRTY|LIST_DYNAMIC)) || + (itp->flags & LIST_INITIALIZED) == 0) + { + if (itp->flags & (LIST_DIRTY|LIST_DYNAMIC)) + clean_itemlist (itp); + if ((itp->flags & LIST_INITIALIZED) == 0) + initialize_itemlist (itp); + } + if (itp->slist == 0) + return ((STRINGLIST *)NULL); + ret = strlist_create (itp->slist->list_len+1); + sl = itp->slist; + + ntxt = bash_dequote_text (text); + tlen = STRLEN (ntxt); + + for (i = n = 0; i < sl->list_len; i++) + { + if (tlen == 0 || STREQN (sl->list[i], ntxt, tlen)) + ret->list[n++] = STRDUP (sl->list[i]); + } + ret->list[ret->list_len = n] = (char *)NULL; + + FREE (ntxt); + return ret; +} + +/* A wrapper for rl_filename_completion_function that dequotes the filename + before attempting completions. */ +static char * +pcomp_filename_completion_function (text, state) + const char *text; + int state; +{ + static char *dfn; /* dequoted filename */ + int qc; + int iscompgen, iscompleting; + + if (state == 0) + { + FREE (dfn); + /* remove backslashes quoting special characters in filenames. */ + /* There are roughly three paths we can follow to get here: + 1. complete -f + 2. compgen -f "$word" from a completion function + 3. compgen -f "$word" from the command line + They all need to be handled. + + In the first two cases, readline will run the filename dequoting + function in rl_filename_completion_function if it found a filename + quoting character in the word to be completed + (rl_completion_found_quote). We run the dequoting function here + if we're running compgen, we're not completing, and the + rl_filename_completion_function won't dequote the filename + (rl_completion_found_quote == 0). */ + iscompgen = this_shell_builtin == compgen_builtin; + iscompleting = RL_ISSTATE (RL_STATE_COMPLETING); + if (iscompgen && iscompleting == 0 && rl_completion_found_quote == 0 + && rl_filename_dequoting_function) + { + /* Use rl_completion_quote_character because any single or + double quotes have been removed by the time TEXT makes it + here, and we don't want to remove backslashes inside + quoted strings. */ + dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character); + } + else + dfn = savestring (text); + } + + return (rl_filename_completion_function (dfn, state)); +} + +#define GEN_COMPS(bmap, flag, it, text, glist, tlist) \ + do { \ + if (bmap & flag) \ + { \ + tlist = gen_matches_from_itemlist (it, text); \ + if (tlist) \ + { \ + glist = strlist_append (glist, tlist); \ + strlist_dispose (tlist); \ + } \ + } \ + } while (0) + +#define GEN_XCOMPS(bmap, flag, text, func, cmatches, glist, tlist) \ + do { \ + if (bmap & flag) \ + { \ + cmatches = rl_completion_matches (text, func); \ + tlist = completions_to_stringlist (cmatches); \ + glist = strlist_append (glist, tlist); \ + strvec_dispose (cmatches); \ + strlist_dispose (tlist); \ + } \ + } while (0) + +/* Functions to generate lists of matches from the actions member of CS. */ + +static STRINGLIST * +gen_action_completions (cs, text) + COMPSPEC *cs; + const char *text; +{ + STRINGLIST *ret, *tmatches; + char **cmatches; /* from rl_completion_matches ... */ + unsigned long flags; + int t; + + ret = tmatches = (STRINGLIST *)NULL; + flags = cs->actions; + + GEN_COMPS (flags, CA_ALIAS, &it_aliases, text, ret, tmatches); + GEN_COMPS (flags, CA_ARRAYVAR, &it_arrayvars, text, ret, tmatches); + GEN_COMPS (flags, CA_BINDING, &it_bindings, text, ret, tmatches); + GEN_COMPS (flags, CA_BUILTIN, &it_builtins, text, ret, tmatches); + GEN_COMPS (flags, CA_DISABLED, &it_disabled, text, ret, tmatches); + GEN_COMPS (flags, CA_ENABLED, &it_enabled, text, ret, tmatches); + GEN_COMPS (flags, CA_EXPORT, &it_exports, text, ret, tmatches); + GEN_COMPS (flags, CA_FUNCTION, &it_functions, text, ret, tmatches); + GEN_COMPS (flags, CA_HELPTOPIC, &it_helptopics, text, ret, tmatches); + GEN_COMPS (flags, CA_HOSTNAME, &it_hostnames, text, ret, tmatches); + GEN_COMPS (flags, CA_JOB, &it_jobs, text, ret, tmatches); + GEN_COMPS (flags, CA_KEYWORD, &it_keywords, text, ret, tmatches); + GEN_COMPS (flags, CA_RUNNING, &it_running, text, ret, tmatches); + GEN_COMPS (flags, CA_SETOPT, &it_setopts, text, ret, tmatches); + GEN_COMPS (flags, CA_SHOPT, &it_shopts, text, ret, tmatches); + GEN_COMPS (flags, CA_SIGNAL, &it_signals, text, ret, tmatches); + GEN_COMPS (flags, CA_STOPPED, &it_stopped, text, ret, tmatches); + GEN_COMPS (flags, CA_VARIABLE, &it_variables, text, ret, tmatches); + + GEN_XCOMPS(flags, CA_COMMAND, text, command_word_completion_function, cmatches, ret, tmatches); + GEN_XCOMPS(flags, CA_FILE, text, pcomp_filename_completion_function, cmatches, ret, tmatches); + GEN_XCOMPS(flags, CA_USER, text, rl_username_completion_function, cmatches, ret, tmatches); + GEN_XCOMPS(flags, CA_GROUP, text, bash_groupname_completion_function, cmatches, ret, tmatches); + GEN_XCOMPS(flags, CA_SERVICE, text, bash_servicename_completion_function, cmatches, ret, tmatches); + + /* And lastly, the special case for directories */ + if (flags & CA_DIRECTORY) + { + t = rl_filename_completion_desired; + rl_completion_mark_symlink_dirs = 1; /* override user preference */ + cmatches = bash_directory_completion_matches (text); + /* If we did not want filename completion before this, and there are + no matches, turn off rl_filename_completion_desired so whatever + matches we get are not treated as filenames (it gets turned on by + rl_filename_completion_function unconditionally). */ + if (t == 0 && cmatches == 0 && rl_filename_completion_desired == 1) + rl_filename_completion_desired = 0; + tmatches = completions_to_stringlist (cmatches); + ret = strlist_append (ret, tmatches); + strvec_dispose (cmatches); + strlist_dispose (tmatches); + } + + return ret; +} + +/* Generate a list of matches for CS->globpat. Unresolved: should this use + TEXT as a match prefix, or just go without? Currently, the code does not + use TEXT, just globs CS->globpat and returns the results. If we do decide + to use TEXT, we should call quote_string_for_globbing before the call to + glob_filename. */ +static STRINGLIST * +gen_globpat_matches (cs, text) + COMPSPEC *cs; + const char *text; +{ + STRINGLIST *sl; + + sl = strlist_create (0); + sl->list = glob_filename (cs->globpat, 0); + if (GLOB_FAILED (sl->list)) + sl->list = (char **)NULL; + if (sl->list) + sl->list_len = sl->list_size = strvec_len (sl->list); + return sl; +} + +/* Perform the shell word expansions on CS->words and return the results. + Again, this ignores TEXT. */ +static STRINGLIST * +gen_wordlist_matches (cs, text) + COMPSPEC *cs; + const char *text; +{ + WORD_LIST *l, *l2; + STRINGLIST *sl; + int nw, tlen; + char *ntxt; /* dequoted TEXT to use in comparisons */ + + if (cs->words == 0 || cs->words[0] == '\0') + return ((STRINGLIST *)NULL); + + /* This used to be a simple expand_string(cs->words, 0), but that won't + do -- there's no way to split a simple list into individual words + that way, since the shell semantics say that word splitting is done + only on the results of expansion. split_at_delims also handles embedded + quoted strings and preserves the quotes for the expand_words_shellexp + function call that follows. */ + /* XXX - this is where this function spends most of its time */ + l = split_at_delims (cs->words, strlen (cs->words), (char *)NULL, -1, 0, (int *)NULL, (int *)NULL); + if (l == 0) + return ((STRINGLIST *)NULL); + /* This will jump back to the top level if the expansion fails... */ + l2 = expand_words_shellexp (l); + dispose_words (l); + + nw = list_length (l2); + sl = strlist_create (nw + 1); + + ntxt = bash_dequote_text (text); + tlen = STRLEN (ntxt); + + for (nw = 0, l = l2; l; l = l->next) + { + if (tlen == 0 || STREQN (l->word->word, ntxt, tlen)) + sl->list[nw++] = STRDUP (l->word->word); + } + sl->list[sl->list_len = nw] = (char *)NULL; + + dispose_words (l2); + FREE (ntxt); + return sl; +} + +#ifdef ARRAY_VARS + +static SHELL_VAR * +bind_comp_words (lwords) + WORD_LIST *lwords; +{ + SHELL_VAR *v; + + v = find_variable ("COMP_WORDS"); + if (v == 0) + v = make_new_array_variable ("COMP_WORDS"); + if (readonly_p (v)) + VUNSETATTR (v, att_readonly); + if (array_p (v) == 0) + v = convert_var_to_array (v); + v = assign_array_var_from_word_list (v, lwords, 0); + + VUNSETATTR (v, att_invisible); + return v; +} +#endif /* ARRAY_VARS */ + +static void +bind_compfunc_variables (line, ind, lwords, cw, exported) + char *line; + int ind; + WORD_LIST *lwords; + int cw, exported; +{ + char ibuf[INT_STRLEN_BOUND(int) + 1]; + char *value; + SHELL_VAR *v; + size_t llen; + int c; + + /* Set the variables that the function expects while it executes. Maybe + these should be in the function environment (temporary_env). */ + v = bind_variable ("COMP_LINE", line, 0); + if (v && exported) + VSETATTR(v, att_exported); + + /* Post bash-4.2: COMP_POINT is characters instead of bytes. */ + c = line[ind]; + line[ind] = '\0'; + llen = MB_STRLEN (line); + line[ind] = c; + value = inttostr (llen, ibuf, sizeof(ibuf)); + v = bind_int_variable ("COMP_POINT", value); + if (v && exported) + VSETATTR(v, att_exported); + + value = inttostr (rl_completion_type, ibuf, sizeof (ibuf)); + v = bind_int_variable ("COMP_TYPE", value); + if (v && exported) + VSETATTR(v, att_exported); + + value = inttostr (rl_completion_invoking_key, ibuf, sizeof (ibuf)); + v = bind_int_variable ("COMP_KEY", value); + if (v && exported) + VSETATTR(v, att_exported); + + /* Since array variables can't be exported, we don't bother making the + array of words. */ + if (exported == 0) + { +#ifdef ARRAY_VARS + v = bind_comp_words (lwords); + value = inttostr (cw, ibuf, sizeof(ibuf)); + bind_int_variable ("COMP_CWORD", value); +#endif + } + else + array_needs_making = 1; +} + +static void +unbind_compfunc_variables (exported) + int exported; +{ + unbind_variable ("COMP_LINE"); + unbind_variable ("COMP_POINT"); + unbind_variable ("COMP_TYPE"); + unbind_variable ("COMP_KEY"); +#ifdef ARRAY_VARS + unbind_variable ("COMP_WORDS"); + unbind_variable ("COMP_CWORD"); +#endif + if (exported) + array_needs_making = 1; +} + +/* Build the list of words to pass to a function or external command + as arguments. When the function or command is invoked, + + $0 == function or command being invoked + $1 == command name + $2 == word to be completed (possibly null) + $3 == previous word + + Functions can access all of the words in the current command line + with the COMP_WORDS array. External commands cannot; they have to + make do with the COMP_LINE and COMP_POINT variables. */ + +static WORD_LIST * +build_arg_list (cmd, cname, text, lwords, ind) + char *cmd; + const char *cname; + const char *text; + WORD_LIST *lwords; + int ind; +{ + WORD_LIST *ret, *cl, *l; + WORD_DESC *w; + int i; + + ret = (WORD_LIST *)NULL; + w = make_word (cmd); + ret = make_word_list (w, (WORD_LIST *)NULL); /* $0 */ + + w = make_word (cname); /* $1 */ + cl = ret->next = make_word_list (w, (WORD_LIST *)NULL); + + w = make_word (text); + cl->next = make_word_list (w, (WORD_LIST *)NULL); /* $2 */ + cl = cl->next; + + /* Search lwords for current word */ + for (l = lwords, i = 1; l && i < ind-1; l = l->next, i++) + ; + w = (l && l->word) ? copy_word (l->word) : make_word (""); + cl->next = make_word_list (w, (WORD_LIST *)NULL); + + return ret; +} + +/* Build a command string with + $0 == cs->funcname (function to execute for completion list) + $1 == command name (command being completed) + $2 = word to be completed (possibly null) + $3 = previous word + and run in the current shell. The function should put its completion + list into the array variable COMPREPLY. We build a STRINGLIST + from the results and return it. + + Since the shell function should return its list of matches in an array + variable, this does nothing if arrays are not compiled into the shell. */ + +static STRINGLIST * +gen_shell_function_matches (cs, cmd, text, line, ind, lwords, nw, cw, foundp) + COMPSPEC *cs; + const char *cmd; + const char *text; + char *line; + int ind; + WORD_LIST *lwords; + int nw, cw; + int *foundp; +{ + char *funcname; + STRINGLIST *sl; + SHELL_VAR *f, *v; + WORD_LIST *cmdlist; + int fval, found; + sh_parser_state_t ps; + sh_parser_state_t * restrict pps; +#if defined (ARRAY_VARS) + ARRAY *a; +#endif + + found = 0; + if (foundp) + *foundp = found; + + funcname = cs->funcname; + f = find_function (funcname); + if (f == 0) + { + internal_error (_("completion: function `%s' not found"), funcname); + rl_ding (); + rl_on_new_line (); + return ((STRINGLIST *)NULL); + } + +#if !defined (ARRAY_VARS) + return ((STRINGLIST *)NULL); +#else + + /* We pass cw - 1 because command_line_to_word_list returns indices that are + 1-based, while bash arrays are 0-based. */ + bind_compfunc_variables (line, ind, lwords, cw - 1, 0); + + cmdlist = build_arg_list (funcname, cmd, text, lwords, cw); + + pps = &ps; + save_parser_state (pps); + begin_unwind_frame ("gen-shell-function-matches"); + add_unwind_protect (restore_parser_state, (char *)pps); + add_unwind_protect (dispose_words, (char *)cmdlist); + add_unwind_protect (unbind_compfunc_variables, (char *)0); + + fval = execute_shell_function (f, cmdlist); + + discard_unwind_frame ("gen-shell-function-matches"); + restore_parser_state (pps); + + found = fval != EX_NOTFOUND; + if (fval == EX_RETRYFAIL) + found |= PCOMP_RETRYFAIL; + if (foundp) + *foundp = found; + + /* Now clean up and destroy everything. */ + dispose_words (cmdlist); + unbind_compfunc_variables (0); + + /* The list of completions is returned in the array variable COMPREPLY. */ + v = find_variable ("COMPREPLY"); + if (v == 0) + return ((STRINGLIST *)NULL); + if (array_p (v) == 0) + v = convert_var_to_array (v); + + VUNSETATTR (v, att_invisible); + + a = array_cell (v); + if (found == 0 || (found & PCOMP_RETRYFAIL) || a == 0 || array_empty (a)) + sl = (STRINGLIST *)NULL; + else + { + /* XXX - should we filter the list of completions so only those matching + TEXT are returned? Right now, we do not. */ + sl = strlist_create (0); + sl->list = array_to_argv (a); + sl->list_len = sl->list_size = array_num_elements (a); + } + + /* XXX - should we unbind COMPREPLY here? */ + unbind_variable ("COMPREPLY"); + + return (sl); +#endif +} + +/* Build a command string with + $0 == cs->command (command to execute for completion list) + $1 == command name (command being completed) + $2 = word to be completed (possibly null) + $3 = previous word + and run in with command substitution. Parse the results, one word + per line, with backslashes allowed to escape newlines. Build a + STRINGLIST from the results and return it. */ + +static STRINGLIST * +gen_command_matches (cs, cmd, text, line, ind, lwords, nw, cw) + COMPSPEC *cs; + const char *cmd; + const char *text; + char *line; + int ind; + WORD_LIST *lwords; + int nw, cw; +{ + char *csbuf, *cscmd, *t; + int cmdlen, cmdsize, n, ws, we; + WORD_LIST *cmdlist, *cl; + WORD_DESC *tw; + STRINGLIST *sl; + + bind_compfunc_variables (line, ind, lwords, cw, 1); + cmdlist = build_arg_list (cs->command, cmd, text, lwords, cw); + + /* Estimate the size needed for the buffer. */ + n = strlen (cs->command); + cmdsize = n + 1; + for (cl = cmdlist->next; cl; cl = cl->next) + cmdsize += STRLEN (cl->word->word) + 3; + cmdsize += 2; + + /* allocate the string for the command and fill it in. */ + cscmd = (char *)xmalloc (cmdsize + 1); + + strcpy (cscmd, cs->command); /* $0 */ + cmdlen = n; + cscmd[cmdlen++] = ' '; + for (cl = cmdlist->next; cl; cl = cl->next) /* $1, $2, $3, ... */ + { + t = sh_single_quote (cl->word->word ? cl->word->word : ""); + n = strlen (t); + RESIZE_MALLOCED_BUFFER (cscmd, cmdlen, n + 2, cmdsize, 64); + strcpy (cscmd + cmdlen, t); + cmdlen += n; + if (cl->next) + cscmd[cmdlen++] = ' '; + free (t); + } + cscmd[cmdlen] = '\0'; + + tw = command_substitute (cscmd, 0); + csbuf = tw ? tw->word : (char *)NULL; + if (tw) + dispose_word_desc (tw); + + /* Now clean up and destroy everything. */ + dispose_words (cmdlist); + free (cscmd); + unbind_compfunc_variables (1); + + if (csbuf == 0 || *csbuf == '\0') + { + FREE (csbuf); + return ((STRINGLIST *)NULL); + } + + /* Now break CSBUF up at newlines, with backslash allowed to escape a + newline, and put the individual words into a STRINGLIST. */ + sl = strlist_create (16); + for (ws = 0; csbuf[ws]; ) + { + we = ws; + while (csbuf[we] && csbuf[we] != '\n') + { + if (csbuf[we] == '\\' && csbuf[we+1] == '\n') + we++; + we++; + } + t = substring (csbuf, ws, we); + if (sl->list_len >= sl->list_size - 1) + strlist_resize (sl, sl->list_size + 16); + sl->list[sl->list_len++] = t; + while (csbuf[we] == '\n') we++; + ws = we; + } + sl->list[sl->list_len] = (char *)NULL; + + free (csbuf); + return (sl); +} + +static WORD_LIST * +command_line_to_word_list (line, llen, sentinel, nwp, cwp) + char *line; + int llen, sentinel, *nwp, *cwp; +{ + WORD_LIST *ret; + char *delims; + +#if 0 + delims = "()<>;&| \t\n"; /* shell metacharacters break words */ +#else + delims = rl_completer_word_break_characters; +#endif + ret = split_at_delims (line, llen, delims, sentinel, SD_NOQUOTEDELIM, nwp, cwp); + return (ret); +} + +/* Evaluate COMPSPEC *cs and return all matches for WORD. */ + +STRINGLIST * +gen_compspec_completions (cs, cmd, word, start, end, foundp) + COMPSPEC *cs; + const char *cmd; + const char *word; + int start, end; + int *foundp; +{ + STRINGLIST *ret, *tmatches; + char *line; + int llen, nw, cw, found, foundf; + WORD_LIST *lwords; + WORD_DESC *lw; + COMPSPEC *tcs; + + found = 1; + +#ifdef DEBUG + debug_printf ("gen_compspec_completions (%s, %s, %d, %d)", cmd, word, start, end); + debug_printf ("gen_compspec_completions: %s -> %p", cmd, cs); +#endif + ret = gen_action_completions (cs, word); +#ifdef DEBUG + if (ret && progcomp_debug) + { + debug_printf ("gen_action_completions (%p, %s) -->", cs, word); + strlist_print (ret, "\t"); + rl_on_new_line (); + } +#endif + + /* Now we start generating completions based on the other members of CS. */ + if (cs->globpat) + { + tmatches = gen_globpat_matches (cs, word); + if (tmatches) + { +#ifdef DEBUG + if (progcomp_debug) + { + debug_printf ("gen_globpat_matches (%p, %s) -->", cs, word); + strlist_print (tmatches, "\t"); + rl_on_new_line (); + } +#endif + ret = strlist_append (ret, tmatches); + strlist_dispose (tmatches); + rl_filename_completion_desired = 1; + } + } + + if (cs->words) + { + tmatches = gen_wordlist_matches (cs, word); + if (tmatches) + { +#ifdef DEBUG + if (progcomp_debug) + { + debug_printf ("gen_wordlist_matches (%p, %s) -->", cs, word); + strlist_print (tmatches, "\t"); + rl_on_new_line (); + } +#endif + ret = strlist_append (ret, tmatches); + strlist_dispose (tmatches); + } + } + + lwords = (WORD_LIST *)NULL; + line = (char *)NULL; + if (cs->command || cs->funcname) + { + /* If we have a command or function to execute, we need to first break + the command line into individual words, find the number of words, + and find the word in the list containing the word to be completed. */ + line = substring (rl_line_buffer, start, end); + llen = end - start; + +#ifdef DEBUG + debug_printf ("command_line_to_word_list (%s, %d, %d, %p, %p)", + line, llen, rl_point - start, &nw, &cw); +#endif + lwords = command_line_to_word_list (line, llen, rl_point - start, &nw, &cw); + /* If we skipped a NULL word at the beginning of the line, add it back */ + if (lwords && lwords->word && cmd[0] == 0 && lwords->word->word[0] != 0) + { + lw = make_bare_word (cmd); + lwords = make_word_list (lw, lwords); + nw++; + cw++; + } +#ifdef DEBUG + if (lwords == 0 && llen > 0) + debug_printf ("ERROR: command_line_to_word_list returns NULL"); + else if (progcomp_debug) + { + debug_printf ("command_line_to_word_list -->"); + printf ("\t"); + print_word_list (lwords, "!"); + printf ("\n"); + fflush(stdout); + rl_on_new_line (); + } +#endif + } + + if (cs->funcname) + { + foundf = 0; + tmatches = gen_shell_function_matches (cs, cmd, word, line, rl_point - start, lwords, nw, cw, &foundf); + if (foundf != 0) + found = foundf; + if (tmatches) + { +#ifdef DEBUG + if (progcomp_debug) + { + debug_printf ("gen_shell_function_matches (%p, %s, %s, %p, %d, %d) -->", cs, cmd, word, lwords, nw, cw); + strlist_print (tmatches, "\t"); + rl_on_new_line (); + } +#endif + ret = strlist_append (ret, tmatches); + strlist_dispose (tmatches); + } + } + + if (cs->command) + { + tmatches = gen_command_matches (cs, cmd, word, line, rl_point - start, lwords, nw, cw); + if (tmatches) + { +#ifdef DEBUG + if (progcomp_debug) + { + debug_printf ("gen_command_matches (%p, %s, %s, %p, %d, %d) -->", cs, cmd, word, lwords, nw, cw); + strlist_print (tmatches, "\t"); + rl_on_new_line (); + } +#endif + ret = strlist_append (ret, tmatches); + strlist_dispose (tmatches); + } + } + + if (cs->command || cs->funcname) + { + if (lwords) + dispose_words (lwords); + FREE (line); + } + + if (foundp) + *foundp = found; + + if (found == 0 || (found & PCOMP_RETRYFAIL)) + { + strlist_dispose (ret); + return NULL; + } + + if (cs->filterpat) + { + tmatches = filter_stringlist (ret, cs->filterpat, word); +#ifdef DEBUG + if (progcomp_debug) + { + debug_printf ("filter_stringlist (%p, %s, %s) -->", ret, cs->filterpat, word); + strlist_print (tmatches, "\t"); + rl_on_new_line (); + } +#endif + if (ret && ret != tmatches) + { + FREE (ret->list); + free (ret); + } + ret = tmatches; + } + + if (cs->prefix || cs->suffix) + ret = strlist_prefix_suffix (ret, cs->prefix, cs->suffix); + + /* If no matches have been generated and the user has specified that + directory completion should be done as a default, call + gen_action_completions again to generate a list of matching directory + names. */ + if ((ret == 0 || ret->list_len == 0) && (cs->options & COPT_DIRNAMES)) + { + tcs = compspec_create (); + tcs->actions = CA_DIRECTORY; + FREE (ret); + ret = gen_action_completions (tcs, word); + compspec_dispose (tcs); + } + else if (cs->options & COPT_PLUSDIRS) + { + tcs = compspec_create (); + tcs->actions = CA_DIRECTORY; + tmatches = gen_action_completions (tcs, word); + ret = strlist_append (ret, tmatches); + strlist_dispose (tmatches); + compspec_dispose (tcs); + } + + return (ret); +} + +void +pcomp_set_readline_variables (flags, nval) + int flags, nval; +{ + /* If the user specified that the compspec returns filenames, make + sure that readline knows it. */ + if (flags & COPT_FILENAMES) + rl_filename_completion_desired = nval; + /* If the user doesn't want a space appended, tell readline. */ + if (flags & COPT_NOSPACE) + rl_completion_suppress_append = nval; + /* The value here is inverted, since the default is on and the `noquote' + option is supposed to turn it off */ + if (flags & COPT_NOQUOTE) + rl_filename_quoting_desired = 1 - nval; +} + +/* Set or unset FLAGS in the options word of the current compspec. + SET_OR_UNSET is 1 for setting, 0 for unsetting. */ +void +pcomp_set_compspec_options (cs, flags, set_or_unset) + COMPSPEC *cs; + int flags, set_or_unset; +{ + if (cs == 0 && ((cs = pcomp_curcs) == 0)) + return; + if (set_or_unset) + cs->options |= flags; + else + cs->options &= ~flags; +} + +static STRINGLIST * +gen_progcomp_completions (ocmd, cmd, word, start, end, foundp, retryp, lastcs) + const char *ocmd; + const char *cmd; + const char *word; + int start, end; + int *foundp, *retryp; + COMPSPEC **lastcs; +{ + COMPSPEC *cs, *oldcs; + const char *oldcmd; + STRINGLIST *ret; + + cs = progcomp_search (ocmd); + + if (cs == 0 || cs == *lastcs) + { +#if 0 + if (foundp) + *foundp = 0; +#endif + return (NULL); + } + + if (*lastcs) + compspec_dispose (*lastcs); + cs->refcount++; /* XXX */ + *lastcs = cs; + + cs = compspec_copy (cs); + + oldcs = pcomp_curcs; + oldcmd = pcomp_curcmd; + + pcomp_curcs = cs; + pcomp_curcmd = cmd; + + ret = gen_compspec_completions (cs, cmd, word, start, end, foundp); + + pcomp_curcs = oldcs; + pcomp_curcmd = oldcmd; + + /* We need to conditionally handle setting *retryp here */ + if (retryp) + *retryp = foundp && (*foundp & PCOMP_RETRYFAIL); + + if (foundp) + { + *foundp &= ~PCOMP_RETRYFAIL; + *foundp |= cs->options; + } + + compspec_dispose (cs); + return ret; +} + +/* The driver function for the programmable completion code. Returns a list + of matches for WORD, which is an argument to command CMD. START and END + bound the command currently being completed in rl_line_buffer. */ +char ** +programmable_completions (cmd, word, start, end, foundp) + const char *cmd; + const char *word; + int start, end, *foundp; +{ + COMPSPEC *cs, *lastcs; + STRINGLIST *ret; + char **rmatches, *t; + int found, retry, count; + + lastcs = 0; + found = count = 0; + + do + { + retry = 0; + + /* We look at the basename of CMD if the full command does not have + an associated COMPSPEC. */ + ret = gen_progcomp_completions (cmd, cmd, word, start, end, &found, &retry, &lastcs); + if (found == 0) + { + t = strrchr (cmd, '/'); + if (t && *(++t)) + ret = gen_progcomp_completions (t, cmd, word, start, end, &found, &retry, &lastcs); + } + + if (found == 0) + ret = gen_progcomp_completions (DEFAULTCMD, cmd, word, start, end, &found, &retry, &lastcs); + + count++; + + if (count > 32) + { + internal_warning ("programmable_completion: %s: possible retry loop", cmd); + break; + } + } + while (retry); + + if (ret) + { + rmatches = ret->list; + free (ret); + } + else + rmatches = (char **)NULL; + + if (foundp) + *foundp = found; + + if (lastcs) /* XXX - should be while? */ + compspec_dispose (lastcs); + + return (rmatches); +} + +#endif /* PROGRAMMABLE_COMPLETION */ diff --git a/.pc/bash43-011.diff/lib/readline/display.c b/.pc/bash43-011.diff/lib/readline/display.c new file mode 100644 index 0000000..913e0da --- /dev/null +++ b/.pc/bash43-011.diff/lib/readline/display.c @@ -0,0 +1,2818 @@ +/* display.c -- readline redisplay facility. */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif /* HAVE_UNISTD_H */ + +#include "posixstat.h" + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include + +#ifdef __MSDOS__ +# include +#endif + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" +#include "rlmbutil.h" + +/* Termcap library stuff. */ +#include "tcap.h" + +/* Some standard library routines. */ +#include "readline.h" +#include "history.h" + +#include "rlprivate.h" +#include "xmalloc.h" + +#if !defined (strchr) && !defined (__STDC__) +extern char *strchr (), *strrchr (); +#endif /* !strchr && !__STDC__ */ + +static void update_line PARAMS((char *, char *, int, int, int, int)); +static void space_to_eol PARAMS((int)); +static void delete_chars PARAMS((int)); +static void insert_some_chars PARAMS((char *, int, int)); +static void open_some_spaces PARAMS((int)); +static void cr PARAMS((void)); + +/* State of visible and invisible lines. */ +struct line_state + { + char *line; + int *lbreaks; + int lbsize; +#if defined (HANDLE_MULTIBYTE) + int *wrapped_line; + int wbsize; +#endif + }; + +/* The line display buffers. One is the line currently displayed on + the screen. The other is the line about to be displayed. */ +static struct line_state line_state_array[2]; +static struct line_state *line_state_visible = &line_state_array[0]; +static struct line_state *line_state_invisible = &line_state_array[1]; +static int line_structures_initialized = 0; + +/* Backwards-compatible names. */ +#define inv_lbreaks (line_state_invisible->lbreaks) +#define inv_lbsize (line_state_invisible->lbsize) +#define vis_lbreaks (line_state_visible->lbreaks) +#define vis_lbsize (line_state_visible->lbsize) + +#define visible_line (line_state_visible->line) +#define invisible_line (line_state_invisible->line) + +#if defined (HANDLE_MULTIBYTE) +static int _rl_col_width PARAMS((const char *, int, int, int)); +#else +# define _rl_col_width(l, s, e, f) (((e) <= (s)) ? 0 : (e) - (s)) +#endif + +/* Heuristic used to decide whether it is faster to move from CUR to NEW + by backing up or outputting a carriage return and moving forward. CUR + and NEW are either both buffer positions or absolute screen positions. */ +#define CR_FASTER(new, cur) (((new) + 1) < ((cur) - (new))) + +/* _rl_last_c_pos is an absolute cursor position in multibyte locales and a + buffer index in others. This macro is used when deciding whether the + current cursor position is in the middle of a prompt string containing + invisible characters. XXX - might need to take `modmark' into account. */ +#define PROMPT_ENDING_INDEX \ + ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) ? prompt_physical_chars : prompt_last_invisible+1) + + +/* **************************************************************** */ +/* */ +/* Display stuff */ +/* */ +/* **************************************************************** */ + +/* This is the stuff that is hard for me. I never seem to write good + display routines in C. Let's see how I do this time. */ + +/* (PWP) Well... Good for a simple line updater, but totally ignores + the problems of input lines longer than the screen width. + + update_line and the code that calls it makes a multiple line, + automatically wrapping line update. Careful attention needs + to be paid to the vertical position variables. */ + +/* Keep two buffers; one which reflects the current contents of the + screen, and the other to draw what we think the new contents should + be. Then compare the buffers, and make whatever changes to the + screen itself that we should. Finally, make the buffer that we + just drew into be the one which reflects the current contents of the + screen, and place the cursor where it belongs. + + Commands that want to can fix the display themselves, and then let + this function know that the display has been fixed by setting the + RL_DISPLAY_FIXED variable. This is good for efficiency. */ + +/* Application-specific redisplay function. */ +rl_voidfunc_t *rl_redisplay_function = rl_redisplay; + +/* Global variables declared here. */ +/* What YOU turn on when you have handled all redisplay yourself. */ +int rl_display_fixed = 0; + +int _rl_suppress_redisplay = 0; +int _rl_want_redisplay = 0; + +/* The stuff that gets printed out before the actual text of the line. + This is usually pointing to rl_prompt. */ +char *rl_display_prompt = (char *)NULL; + +/* Pseudo-global variables declared here. */ + +/* The visible cursor position. If you print some text, adjust this. */ +/* NOTE: _rl_last_c_pos is used as a buffer index when not in a locale + supporting multibyte characters, and an absolute cursor position when + in such a locale. This is an artifact of the donated multibyte support. + Care must be taken when modifying its value. */ +int _rl_last_c_pos = 0; +int _rl_last_v_pos = 0; + +static int cpos_adjusted; +static int cpos_buffer_position; +static int displaying_prompt_first_line; +static int prompt_multibyte_chars; + +/* Number of lines currently on screen minus 1. */ +int _rl_vis_botlin = 0; + +/* Variables used only in this file. */ +/* The last left edge of text that was displayed. This is used when + doing horizontal scrolling. It shifts in thirds of a screenwidth. */ +static int last_lmargin; + +/* A buffer for `modeline' messages. */ +static char *msg_buf = 0; +static int msg_bufsiz = 0; + +/* Non-zero forces the redisplay even if we thought it was unnecessary. */ +static int forced_display; + +/* Default and initial buffer size. Can grow. */ +static int line_size = 1024; + +/* Variables to keep track of the expanded prompt string, which may + include invisible characters. */ + +static char *local_prompt, *local_prompt_prefix; +static int local_prompt_len; +static int prompt_visible_length, prompt_prefix_length; + +/* The number of invisible characters in the line currently being + displayed on the screen. */ +static int visible_wrap_offset; + +/* The number of invisible characters in the prompt string. Static so it + can be shared between rl_redisplay and update_line */ +static int wrap_offset; + +/* The index of the last invisible character in the prompt string. */ +static int prompt_last_invisible; + +/* The length (buffer offset) of the first line of the last (possibly + multi-line) buffer displayed on the screen. */ +static int visible_first_line_len; + +/* Number of invisible characters on the first physical line of the prompt. + Only valid when the number of physical characters in the prompt exceeds + (or is equal to) _rl_screenwidth. */ +static int prompt_invis_chars_first_line; + +static int prompt_last_screen_line; + +static int prompt_physical_chars; + +/* set to a non-zero value by rl_redisplay if we are marking modified history + lines and the current line is so marked. */ +static int modmark; + +/* Variables to save and restore prompt and display information. */ + +/* These are getting numerous enough that it's time to create a struct. */ + +static char *saved_local_prompt; +static char *saved_local_prefix; +static int saved_last_invisible; +static int saved_visible_length; +static int saved_prefix_length; +static int saved_local_length; +static int saved_invis_chars_first_line; +static int saved_physical_chars; + +/* Return a character indicating the editing mode, for use in the prompt. */ +static int +prompt_modechar () +{ + if (rl_editing_mode == emacs_mode) + return '@'; + else if (_rl_keymap == vi_insertion_keymap) + return '+'; /* vi insert mode */ + else + return ':'; /* vi command mode */ +} + +/* Expand the prompt string S and return the number of visible + characters in *LP, if LP is not null. This is currently more-or-less + a placeholder for expansion. LIP, if non-null is a place to store the + index of the last invisible character in the returned string. NIFLP, + if non-zero, is a place to store the number of invisible characters in + the first prompt line. The previous are used as byte counts -- indexes + into a character buffer. */ + +/* Current implementation: + \001 (^A) start non-visible characters + \002 (^B) end non-visible characters + all characters except \001 and \002 (following a \001) are copied to + the returned string; all characters except those between \001 and + \002 are assumed to be `visible'. */ + +static char * +expand_prompt (pmt, lp, lip, niflp, vlp) + char *pmt; + int *lp, *lip, *niflp, *vlp; +{ + char *r, *ret, *p, *igstart; + int l, rl, last, ignoring, ninvis, invfl, invflset, ind, pind, physchars; + + /* Short-circuit if we can. */ + if ((MB_CUR_MAX <= 1 || rl_byte_oriented) && strchr (pmt, RL_PROMPT_START_IGNORE) == 0) + { + if (pmt == rl_prompt && _rl_show_mode_in_prompt) + { + l = strlen (pmt); + r = (char *)xmalloc (l + 2); + r[0] = prompt_modechar (); + strcpy (r + 1, pmt); + } + else + r = savestring (pmt); + + if (lp) + *lp = strlen (r); + if (lip) + *lip = 0; + if (niflp) + *niflp = 0; + if (vlp) + *vlp = lp ? *lp : strlen (r); + return r; + } + + l = strlen (pmt); + r = ret = (char *)xmalloc (l + 2); + + rl = physchars = 0; /* move up here so mode show can set them */ + if (pmt == rl_prompt && _rl_show_mode_in_prompt) + { + *r++ = prompt_modechar (); + rl = physchars = 1; + } + + invfl = 0; /* invisible chars in first line of prompt */ + invflset = 0; /* we only want to set invfl once */ + + igstart = 0; + for (ignoring = last = ninvis = 0, p = pmt; p && *p; p++) + { + /* This code strips the invisible character string markers + RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE */ + if (ignoring == 0 && *p == RL_PROMPT_START_IGNORE) /* XXX - check ignoring? */ + { + ignoring = 1; + igstart = p; + continue; + } + else if (ignoring && *p == RL_PROMPT_END_IGNORE) + { + ignoring = 0; + if (p != (igstart + 1)) + last = r - ret - 1; + continue; + } + else + { +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + pind = p - pmt; + ind = _rl_find_next_mbchar (pmt, pind, 1, MB_FIND_NONZERO); + l = ind - pind; + while (l--) + *r++ = *p++; + if (!ignoring) + { + /* rl ends up being assigned to prompt_visible_length, + which is the number of characters in the buffer that + contribute to characters on the screen, which might + not be the same as the number of physical characters + on the screen in the presence of multibyte characters */ + rl += ind - pind; + physchars += _rl_col_width (pmt, pind, ind, 0); + } + else + ninvis += ind - pind; + p--; /* compensate for later increment */ + } + else +#endif + { + *r++ = *p; + if (!ignoring) + { + rl++; /* visible length byte counter */ + physchars++; + } + else + ninvis++; /* invisible chars byte counter */ + } + + if (invflset == 0 && rl >= _rl_screenwidth) + { + invfl = ninvis; + invflset = 1; + } + } + } + + if (rl < _rl_screenwidth) + invfl = ninvis; + + *r = '\0'; + if (lp) + *lp = rl; + if (lip) + *lip = last; + if (niflp) + *niflp = invfl; + if (vlp) + *vlp = physchars; + return ret; +} + +/* Just strip out RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE from + PMT and return the rest of PMT. */ +char * +_rl_strip_prompt (pmt) + char *pmt; +{ + char *ret; + + ret = expand_prompt (pmt, (int *)NULL, (int *)NULL, (int *)NULL, (int *)NULL); + return ret; +} + +void +_rl_reset_prompt () +{ + rl_visible_prompt_length = rl_expand_prompt (rl_prompt); +} + +/* + * Expand the prompt string into the various display components, if + * necessary. + * + * local_prompt = expanded last line of string in rl_display_prompt + * (portion after the final newline) + * local_prompt_prefix = portion before last newline of rl_display_prompt, + * expanded via expand_prompt + * prompt_visible_length = number of visible characters in local_prompt + * prompt_prefix_length = number of visible characters in local_prompt_prefix + * + * This function is called once per call to readline(). It may also be + * called arbitrarily to expand the primary prompt. + * + * The return value is the number of visible characters on the last line + * of the (possibly multi-line) prompt. + */ +int +rl_expand_prompt (prompt) + char *prompt; +{ + char *p, *t; + int c; + + /* Clear out any saved values. */ + FREE (local_prompt); + FREE (local_prompt_prefix); + + local_prompt = local_prompt_prefix = (char *)0; + local_prompt_len = 0; + prompt_last_invisible = prompt_invis_chars_first_line = 0; + prompt_visible_length = prompt_physical_chars = 0; + + if (prompt == 0 || *prompt == 0) + return (0); + + p = strrchr (prompt, '\n'); + if (!p) + { + /* The prompt is only one logical line, though it might wrap. */ + local_prompt = expand_prompt (prompt, &prompt_visible_length, + &prompt_last_invisible, + &prompt_invis_chars_first_line, + &prompt_physical_chars); + local_prompt_prefix = (char *)0; + local_prompt_len = local_prompt ? strlen (local_prompt) : 0; + return (prompt_visible_length); + } + else + { + /* The prompt spans multiple lines. */ + t = ++p; + local_prompt = expand_prompt (p, &prompt_visible_length, + &prompt_last_invisible, + &prompt_invis_chars_first_line, + &prompt_physical_chars); + c = *t; *t = '\0'; + /* The portion of the prompt string up to and including the + final newline is now null-terminated. */ + local_prompt_prefix = expand_prompt (prompt, &prompt_prefix_length, + (int *)NULL, + (int *)NULL, + (int *)NULL); + *t = c; + local_prompt_len = local_prompt ? strlen (local_prompt) : 0; + return (prompt_prefix_length); + } +} + +/* Initialize the VISIBLE_LINE and INVISIBLE_LINE arrays, and their associated + arrays of line break markers. MINSIZE is the minimum size of VISIBLE_LINE + and INVISIBLE_LINE; if it is greater than LINE_SIZE, LINE_SIZE is + increased. If the lines have already been allocated, this ensures that + they can hold at least MINSIZE characters. */ +static void +init_line_structures (minsize) + int minsize; +{ + register int n; + + if (invisible_line == 0) /* initialize it */ + { + if (line_size < minsize) + line_size = minsize; + visible_line = (char *)xmalloc (line_size); + invisible_line = (char *)xmalloc (line_size); + } + else if (line_size < minsize) /* ensure it can hold MINSIZE chars */ + { + line_size *= 2; + if (line_size < minsize) + line_size = minsize; + visible_line = (char *)xrealloc (visible_line, line_size); + invisible_line = (char *)xrealloc (invisible_line, line_size); + } + + for (n = minsize; n < line_size; n++) + { + visible_line[n] = 0; + invisible_line[n] = 1; + } + + if (vis_lbreaks == 0) + { + /* should be enough. */ + inv_lbsize = vis_lbsize = 256; + +#if defined (HANDLE_MULTIBYTE) + line_state_visible->wbsize = vis_lbsize; + line_state_visible->wrapped_line = (int *)xmalloc (line_state_visible->wbsize * sizeof (int)); + + line_state_invisible->wbsize = inv_lbsize; + line_state_invisible->wrapped_line = (int *)xmalloc (line_state_invisible->wbsize * sizeof (int)); +#endif + + inv_lbreaks = (int *)xmalloc (inv_lbsize * sizeof (int)); + vis_lbreaks = (int *)xmalloc (vis_lbsize * sizeof (int)); + inv_lbreaks[0] = vis_lbreaks[0] = 0; + } + + line_structures_initialized = 1; +} + +/* Basic redisplay algorithm. */ +void +rl_redisplay () +{ + register int in, out, c, linenum, cursor_linenum; + register char *line; + int inv_botlin, lb_botlin, lb_linenum, o_cpos; + int newlines, lpos, temp, n0, num, prompt_lines_estimate; + char *prompt_this_line; +#if defined (HANDLE_MULTIBYTE) + wchar_t wc; + size_t wc_bytes; + int wc_width; + mbstate_t ps; + int _rl_wrapped_multicolumn = 0; +#endif + + if (_rl_echoing_p == 0) + return; + + /* Block keyboard interrupts because this function manipulates global + data structures. */ + _rl_block_sigint (); + RL_SETSTATE (RL_STATE_REDISPLAYING); + + if (!rl_display_prompt) + rl_display_prompt = ""; + + if (line_structures_initialized == 0) + { + init_line_structures (0); + rl_on_new_line (); + } + + /* Draw the line into the buffer. */ + cpos_buffer_position = -1; + + prompt_multibyte_chars = prompt_visible_length - prompt_physical_chars; + + line = invisible_line; + out = inv_botlin = 0; + + /* Mark the line as modified or not. We only do this for history + lines. */ + modmark = 0; + if (_rl_mark_modified_lines && current_history () && rl_undo_list) + { + line[out++] = '*'; + line[out] = '\0'; + modmark = 1; + } + + /* If someone thought that the redisplay was handled, but the currently + visible line has a different modification state than the one about + to become visible, then correct the caller's misconception. */ + if (visible_line[0] != invisible_line[0]) + rl_display_fixed = 0; + + /* If the prompt to be displayed is the `primary' readline prompt (the + one passed to readline()), use the values we have already expanded. + If not, use what's already in rl_display_prompt. WRAP_OFFSET is the + number of non-visible characters in the prompt string. */ + if (rl_display_prompt == rl_prompt || local_prompt) + { + if (local_prompt_prefix && forced_display) + _rl_output_some_chars (local_prompt_prefix, strlen (local_prompt_prefix)); + + if (local_prompt_len > 0) + { + temp = local_prompt_len + out + 2; + if (temp >= line_size) + { + line_size = (temp + 1024) - (temp % 1024); + visible_line = (char *)xrealloc (visible_line, line_size); + line = invisible_line = (char *)xrealloc (invisible_line, line_size); + } + strncpy (line + out, local_prompt, local_prompt_len); + out += local_prompt_len; + } + line[out] = '\0'; + wrap_offset = local_prompt_len - prompt_visible_length; + } + else + { + int pmtlen; + prompt_this_line = strrchr (rl_display_prompt, '\n'); + if (!prompt_this_line) + prompt_this_line = rl_display_prompt; + else + { + prompt_this_line++; + pmtlen = prompt_this_line - rl_display_prompt; /* temp var */ + if (forced_display) + { + _rl_output_some_chars (rl_display_prompt, pmtlen); + /* Make sure we are at column zero even after a newline, + regardless of the state of terminal output processing. */ + if (pmtlen < 2 || prompt_this_line[-2] != '\r') + cr (); + } + } + + prompt_physical_chars = pmtlen = strlen (prompt_this_line); + temp = pmtlen + out + 2; + if (temp >= line_size) + { + line_size = (temp + 1024) - (temp % 1024); + visible_line = (char *)xrealloc (visible_line, line_size); + line = invisible_line = (char *)xrealloc (invisible_line, line_size); + } + strncpy (line + out, prompt_this_line, pmtlen); + out += pmtlen; + line[out] = '\0'; + wrap_offset = prompt_invis_chars_first_line = 0; + } + +#define CHECK_INV_LBREAKS() \ + do { \ + if (newlines >= (inv_lbsize - 2)) \ + { \ + inv_lbsize *= 2; \ + inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \ + } \ + } while (0) + +#if defined (HANDLE_MULTIBYTE) +#define CHECK_LPOS() \ + do { \ + lpos++; \ + if (lpos >= _rl_screenwidth) \ + { \ + if (newlines >= (inv_lbsize - 2)) \ + { \ + inv_lbsize *= 2; \ + inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \ + } \ + inv_lbreaks[++newlines] = out; \ + if (newlines >= (line_state_invisible->wbsize - 1)) \ + { \ + line_state_invisible->wbsize *= 2; \ + line_state_invisible->wrapped_line = (int *)xrealloc (line_state_invisible->wrapped_line, line_state_invisible->wbsize * sizeof(int)); \ + } \ + line_state_invisible->wrapped_line[newlines] = _rl_wrapped_multicolumn; \ + lpos = 0; \ + } \ + } while (0) +#else +#define CHECK_LPOS() \ + do { \ + lpos++; \ + if (lpos >= _rl_screenwidth) \ + { \ + if (newlines >= (inv_lbsize - 2)) \ + { \ + inv_lbsize *= 2; \ + inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \ + } \ + inv_lbreaks[++newlines] = out; \ + lpos = 0; \ + } \ + } while (0) +#endif + + /* inv_lbreaks[i] is where line i starts in the buffer. */ + inv_lbreaks[newlines = 0] = 0; + lpos = prompt_physical_chars + modmark; + +#if defined (HANDLE_MULTIBYTE) + memset (line_state_invisible->wrapped_line, 0, line_state_invisible->wbsize * sizeof (int)); + num = 0; +#endif + + /* prompt_invis_chars_first_line is the number of invisible characters in + the first physical line of the prompt. + wrap_offset - prompt_invis_chars_first_line is the number of invis + chars on the second (or, more generally, last) line. */ + + /* This is zero-based, used to set the newlines */ + prompt_lines_estimate = lpos / _rl_screenwidth; + + /* what if lpos is already >= _rl_screenwidth before we start drawing the + contents of the command line? */ + while (lpos >= _rl_screenwidth) + { + int z; + /* fix from Darin Johnson for prompt string with + invisible characters that is longer than the screen width. The + prompt_invis_chars_first_line variable could be made into an array + saying how many invisible characters there are per line, but that's + probably too much work for the benefit gained. How many people have + prompts that exceed two physical lines? + Additional logic fix from Edward Catmur */ +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0 && prompt_multibyte_chars > 0) + { + n0 = num; + temp = local_prompt_len; + while (num < temp) + { + z = _rl_col_width (local_prompt, n0, num, 1); + if (z > _rl_screenwidth) + { + num = _rl_find_prev_mbchar (local_prompt, num, MB_FIND_ANY); + break; + } + else if (z == _rl_screenwidth) + break; + num++; + } + temp = num; + } + else +#endif /* !HANDLE_MULTIBYTE */ + temp = ((newlines + 1) * _rl_screenwidth); + + /* Now account for invisible characters in the current line. */ + /* XXX - this assumes that the invisible characters may be split, but only + between the first and the last lines. */ + temp += (newlines == 0) ? prompt_invis_chars_first_line + : ((newlines == prompt_lines_estimate) ? wrap_offset : prompt_invis_chars_first_line); + + inv_lbreaks[++newlines] = temp; +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0 && prompt_multibyte_chars > 0) + lpos -= _rl_col_width (local_prompt, n0, num, 1); + else +#endif + lpos -= _rl_screenwidth; + } + + prompt_last_screen_line = newlines; + + /* Draw the rest of the line (after the prompt) into invisible_line, keeping + track of where the cursor is (cpos_buffer_position), the number of the line containing + the cursor (lb_linenum), the last line number (lb_botlin and inv_botlin). + It maintains an array of line breaks for display (inv_lbreaks). + This handles expanding tabs for display and displaying meta characters. */ + lb_linenum = 0; +#if defined (HANDLE_MULTIBYTE) + in = 0; + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + memset (&ps, 0, sizeof (mbstate_t)); + /* XXX - what if wc_bytes ends up <= 0? check for MB_INVALIDCH */ + wc_bytes = mbrtowc (&wc, rl_line_buffer, rl_end, &ps); + } + else + wc_bytes = 1; + while (in < rl_end) +#else + for (in = 0; in < rl_end; in++) +#endif + { + c = (unsigned char)rl_line_buffer[in]; + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + if (MB_INVALIDCH (wc_bytes)) + { + /* Byte sequence is invalid or shortened. Assume that the + first byte represents a character. */ + wc_bytes = 1; + /* Assume that a character occupies a single column. */ + wc_width = 1; + memset (&ps, 0, sizeof (mbstate_t)); + } + else if (MB_NULLWCH (wc_bytes)) + break; /* Found '\0' */ + else + { + temp = WCWIDTH (wc); + wc_width = (temp >= 0) ? temp : 1; + } + } +#endif + + if (out + 8 >= line_size) /* XXX - 8 for \t */ + { + line_size *= 2; + visible_line = (char *)xrealloc (visible_line, line_size); + invisible_line = (char *)xrealloc (invisible_line, line_size); + line = invisible_line; + } + + if (in == rl_point) + { + cpos_buffer_position = out; + lb_linenum = newlines; + } + +#if defined (HANDLE_MULTIBYTE) + if (META_CHAR (c) && _rl_output_meta_chars == 0) /* XXX - clean up */ +#else + if (META_CHAR (c)) +#endif + { + if (_rl_output_meta_chars == 0) + { + sprintf (line + out, "\\%o", c); + + if (lpos + 4 >= _rl_screenwidth) + { + temp = _rl_screenwidth - lpos; + CHECK_INV_LBREAKS (); + inv_lbreaks[++newlines] = out + temp; + lpos = 4 - temp; + } + else + lpos += 4; + + out += 4; + } + else + { + line[out++] = c; + CHECK_LPOS(); + } + } +#if defined (DISPLAY_TABS) + else if (c == '\t') + { + register int newout; + +#if 0 + newout = (out | (int)7) + 1; +#else + newout = out + 8 - lpos % 8; +#endif + temp = newout - out; + if (lpos + temp >= _rl_screenwidth) + { + register int temp2; + temp2 = _rl_screenwidth - lpos; + CHECK_INV_LBREAKS (); + inv_lbreaks[++newlines] = out + temp2; + lpos = temp - temp2; + while (out < newout) + line[out++] = ' '; + } + else + { + while (out < newout) + line[out++] = ' '; + lpos += temp; + } + } +#endif + else if (c == '\n' && _rl_horizontal_scroll_mode == 0 && _rl_term_up && *_rl_term_up) + { + line[out++] = '\0'; /* XXX - sentinel */ + CHECK_INV_LBREAKS (); + inv_lbreaks[++newlines] = out; + lpos = 0; + } + else if (CTRL_CHAR (c) || c == RUBOUT) + { + line[out++] = '^'; + CHECK_LPOS(); + line[out++] = CTRL_CHAR (c) ? UNCTRL (c) : '?'; + CHECK_LPOS(); + } + else + { +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + register int i; + + _rl_wrapped_multicolumn = 0; + + if (_rl_screenwidth < lpos + wc_width) + for (i = lpos; i < _rl_screenwidth; i++) + { + /* The space will be removed in update_line() */ + line[out++] = ' '; + _rl_wrapped_multicolumn++; + CHECK_LPOS(); + } + if (in == rl_point) + { + cpos_buffer_position = out; + lb_linenum = newlines; + } + for (i = in; i < in+wc_bytes; i++) + line[out++] = rl_line_buffer[i]; + for (i = 0; i < wc_width; i++) + CHECK_LPOS(); + } + else + { + line[out++] = c; + CHECK_LPOS(); + } +#else + line[out++] = c; + CHECK_LPOS(); +#endif + } + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + in += wc_bytes; + /* XXX - what if wc_bytes ends up <= 0? check for MB_INVALIDCH */ + wc_bytes = mbrtowc (&wc, rl_line_buffer + in, rl_end - in, &ps); + } + else + in++; +#endif + + } + line[out] = '\0'; + if (cpos_buffer_position < 0) + { + cpos_buffer_position = out; + lb_linenum = newlines; + } + + inv_botlin = lb_botlin = newlines; + CHECK_INV_LBREAKS (); + inv_lbreaks[newlines+1] = out; + cursor_linenum = lb_linenum; + + /* CPOS_BUFFER_POSITION == position in buffer where cursor should be placed. + CURSOR_LINENUM == line number where the cursor should be placed. */ + + /* PWP: now is when things get a bit hairy. The visible and invisible + line buffers are really multiple lines, which would wrap every + (screenwidth - 1) characters. Go through each in turn, finding + the changed region and updating it. The line order is top to bottom. */ + + /* If we can move the cursor up and down, then use multiple lines, + otherwise, let long lines display in a single terminal line, and + horizontally scroll it. */ + displaying_prompt_first_line = 1; + if (_rl_horizontal_scroll_mode == 0 && _rl_term_up && *_rl_term_up) + { + int nleft, pos, changed_screen_line, tx; + + if (!rl_display_fixed || forced_display) + { + forced_display = 0; + + /* If we have more than a screenful of material to display, then + only display a screenful. We should display the last screen, + not the first. */ + if (out >= _rl_screenchars) + { + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + out = _rl_find_prev_mbchar (line, _rl_screenchars, MB_FIND_ANY); + else + out = _rl_screenchars - 1; + } + + /* The first line is at character position 0 in the buffer. The + second and subsequent lines start at inv_lbreaks[N], offset by + OFFSET (which has already been calculated above). */ + +#define INVIS_FIRST() (prompt_physical_chars > _rl_screenwidth ? prompt_invis_chars_first_line : wrap_offset) +#define WRAP_OFFSET(line, offset) ((line == 0) \ + ? (offset ? INVIS_FIRST() : 0) \ + : ((line == prompt_last_screen_line) ? wrap_offset-prompt_invis_chars_first_line : 0)) +#define W_OFFSET(line, offset) ((line) == 0 ? offset : 0) +#define VIS_LLEN(l) ((l) > _rl_vis_botlin ? 0 : (vis_lbreaks[l+1] - vis_lbreaks[l])) +#define INV_LLEN(l) (inv_lbreaks[l+1] - inv_lbreaks[l]) +#define VIS_CHARS(line) (visible_line + vis_lbreaks[line]) +#define VIS_LINE(line) ((line) > _rl_vis_botlin) ? "" : VIS_CHARS(line) +#define INV_LINE(line) (invisible_line + inv_lbreaks[line]) + +#define OLD_CPOS_IN_PROMPT() (cpos_adjusted == 0 && \ + _rl_last_c_pos != o_cpos && \ + _rl_last_c_pos > wrap_offset && \ + o_cpos < prompt_last_invisible) + + /* For each line in the buffer, do the updating display. */ + for (linenum = 0; linenum <= inv_botlin; linenum++) + { + /* This can lead us astray if we execute a program that changes + the locale from a non-multibyte to a multibyte one. */ + o_cpos = _rl_last_c_pos; + cpos_adjusted = 0; + update_line (VIS_LINE(linenum), INV_LINE(linenum), linenum, + VIS_LLEN(linenum), INV_LLEN(linenum), inv_botlin); + + /* update_line potentially changes _rl_last_c_pos, but doesn't + take invisible characters into account, since _rl_last_c_pos + is an absolute cursor position in a multibyte locale. See + if compensating here is the right thing, or if we have to + change update_line itself. There are several cases in which + update_line adjusts _rl_last_c_pos itself (so it can pass + _rl_move_cursor_relative accurate values); it communicates + this back by setting cpos_adjusted. If we assume that + _rl_last_c_pos is correct (an absolute cursor position) each + time update_line is called, then we can assume in our + calculations that o_cpos does not need to be adjusted by + wrap_offset. */ + if (linenum == 0 && (MB_CUR_MAX > 1 && rl_byte_oriented == 0) && OLD_CPOS_IN_PROMPT()) + _rl_last_c_pos -= prompt_invis_chars_first_line; /* XXX - was wrap_offset */ + else if (linenum == prompt_last_screen_line && prompt_physical_chars > _rl_screenwidth && + (MB_CUR_MAX > 1 && rl_byte_oriented == 0) && + cpos_adjusted == 0 && + _rl_last_c_pos != o_cpos && + _rl_last_c_pos > (prompt_last_invisible - _rl_screenwidth - prompt_invis_chars_first_line)) + _rl_last_c_pos -= (wrap_offset-prompt_invis_chars_first_line); + + /* If this is the line with the prompt, we might need to + compensate for invisible characters in the new line. Do + this only if there is not more than one new line (which + implies that we completely overwrite the old visible line) + and the new line is shorter than the old. Make sure we are + at the end of the new line before clearing. */ + if (linenum == 0 && + inv_botlin == 0 && _rl_last_c_pos == out && + (wrap_offset > visible_wrap_offset) && + (_rl_last_c_pos < visible_first_line_len)) + { + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + nleft = _rl_screenwidth - _rl_last_c_pos; + else + nleft = _rl_screenwidth + wrap_offset - _rl_last_c_pos; + if (nleft) + _rl_clear_to_eol (nleft); + } +#if 0 + /* This segment is intended to handle the case where the prompt + has invisible characters on the second line and the new line + to be displayed needs to clear the rest of the old characters + out (e.g., when printing the i-search prompt). In general, + the case of the new line being shorter than the old. + Incomplete */ + else if (linenum == prompt_last_screen_line && + prompt_physical_chars > _rl_screenwidth && + wrap_offset != prompt_invis_chars_first_line && + _rl_last_c_pos == out && +#endif + + + /* Since the new first line is now visible, save its length. */ + if (linenum == 0) + visible_first_line_len = (inv_botlin > 0) ? inv_lbreaks[1] : out - wrap_offset; + } + + /* We may have deleted some lines. If so, clear the left over + blank ones at the bottom out. */ + if (_rl_vis_botlin > inv_botlin) + { + char *tt; + for (; linenum <= _rl_vis_botlin; linenum++) + { + tt = VIS_CHARS (linenum); + _rl_move_vert (linenum); + _rl_move_cursor_relative (0, tt); + _rl_clear_to_eol + ((linenum == _rl_vis_botlin) ? strlen (tt) : _rl_screenwidth); + } + } + _rl_vis_botlin = inv_botlin; + + /* CHANGED_SCREEN_LINE is set to 1 if we have moved to a + different screen line during this redisplay. */ + changed_screen_line = _rl_last_v_pos != cursor_linenum; + if (changed_screen_line) + { + _rl_move_vert (cursor_linenum); + /* If we moved up to the line with the prompt using _rl_term_up, + the physical cursor position on the screen stays the same, + but the buffer position needs to be adjusted to account + for invisible characters. */ + if ((MB_CUR_MAX == 1 || rl_byte_oriented) && cursor_linenum == 0 && wrap_offset) + _rl_last_c_pos += wrap_offset; + } + + /* We have to reprint the prompt if it contains invisible + characters, since it's not generally OK to just reprint + the characters from the current cursor position. But we + only need to reprint it if the cursor is before the last + invisible character in the prompt string. */ + nleft = prompt_visible_length + wrap_offset; + if (cursor_linenum == 0 && wrap_offset > 0 && _rl_last_c_pos > 0 && +#if 0 + _rl_last_c_pos <= PROMPT_ENDING_INDEX && local_prompt) +#else + _rl_last_c_pos < PROMPT_ENDING_INDEX && local_prompt) +#endif + { +#if defined (__MSDOS__) + putc ('\r', rl_outstream); +#else + if (_rl_term_cr) + tputs (_rl_term_cr, 1, _rl_output_character_function); +#endif + if (modmark) + _rl_output_some_chars ("*", 1); + + _rl_output_some_chars (local_prompt, nleft); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + _rl_last_c_pos = _rl_col_width (local_prompt, 0, nleft, 1) - wrap_offset + modmark; + else + _rl_last_c_pos = nleft + modmark; + } + + /* Where on that line? And where does that line start + in the buffer? */ + pos = inv_lbreaks[cursor_linenum]; + /* nleft == number of characters in the line buffer between the + start of the line and the desired cursor position. */ + nleft = cpos_buffer_position - pos; + + /* NLEFT is now a number of characters in a buffer. When in a + multibyte locale, however, _rl_last_c_pos is an absolute cursor + position that doesn't take invisible characters in the prompt + into account. We use a fudge factor to compensate. */ + + /* Since _rl_backspace() doesn't know about invisible characters in the + prompt, and there's no good way to tell it, we compensate for + those characters here and call _rl_backspace() directly. */ + if (wrap_offset && cursor_linenum == 0 && nleft < _rl_last_c_pos) + { + /* TX == new physical cursor position in multibyte locale. */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + tx = _rl_col_width (&visible_line[pos], 0, nleft, 1) - visible_wrap_offset; + else + tx = nleft; + if (tx >= 0 && _rl_last_c_pos > tx) + { + _rl_backspace (_rl_last_c_pos - tx); /* XXX */ + _rl_last_c_pos = tx; + } + } + + /* We need to note that in a multibyte locale we are dealing with + _rl_last_c_pos as an absolute cursor position, but moving to a + point specified by a buffer position (NLEFT) that doesn't take + invisible characters into account. */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + _rl_move_cursor_relative (nleft, &invisible_line[pos]); + else if (nleft != _rl_last_c_pos) + _rl_move_cursor_relative (nleft, &invisible_line[pos]); + } + } + else /* Do horizontal scrolling. */ + { +#define M_OFFSET(margin, offset) ((margin) == 0 ? offset : 0) + int lmargin, ndisp, nleft, phys_c_pos, t; + + /* Always at top line. */ + _rl_last_v_pos = 0; + + /* Compute where in the buffer the displayed line should start. This + will be LMARGIN. */ + + /* The number of characters that will be displayed before the cursor. */ + ndisp = cpos_buffer_position - wrap_offset; + nleft = prompt_visible_length + wrap_offset; + /* Where the new cursor position will be on the screen. This can be + longer than SCREENWIDTH; if it is, lmargin will be adjusted. */ + phys_c_pos = cpos_buffer_position - (last_lmargin ? last_lmargin : wrap_offset); + t = _rl_screenwidth / 3; + + /* If the number of characters had already exceeded the screenwidth, + last_lmargin will be > 0. */ + + /* If the number of characters to be displayed is more than the screen + width, compute the starting offset so that the cursor is about + two-thirds of the way across the screen. */ + if (phys_c_pos > _rl_screenwidth - 2) + { + lmargin = cpos_buffer_position - (2 * t); + if (lmargin < 0) + lmargin = 0; + /* If the left margin would be in the middle of a prompt with + invisible characters, don't display the prompt at all. */ + if (wrap_offset && lmargin > 0 && lmargin < nleft) + lmargin = nleft; + } + else if (ndisp < _rl_screenwidth - 2) /* XXX - was -1 */ + lmargin = 0; + else if (phys_c_pos < 1) + { + /* If we are moving back towards the beginning of the line and + the last margin is no longer correct, compute a new one. */ + lmargin = ((cpos_buffer_position - 1) / t) * t; /* XXX */ + if (wrap_offset && lmargin > 0 && lmargin < nleft) + lmargin = nleft; + } + else + lmargin = last_lmargin; + + displaying_prompt_first_line = lmargin < nleft; + + /* If the first character on the screen isn't the first character + in the display line, indicate this with a special character. */ + if (lmargin > 0) + line[lmargin] = '<'; + + /* If SCREENWIDTH characters starting at LMARGIN do not encompass + the whole line, indicate that with a special character at the + right edge of the screen. If LMARGIN is 0, we need to take the + wrap offset into account. */ + t = lmargin + M_OFFSET (lmargin, wrap_offset) + _rl_screenwidth; + if (t < out) + line[t - 1] = '>'; + + if (rl_display_fixed == 0 || forced_display || lmargin != last_lmargin) + { + forced_display = 0; + o_cpos = _rl_last_c_pos; + cpos_adjusted = 0; + update_line (&visible_line[last_lmargin], + &invisible_line[lmargin], + 0, + _rl_screenwidth + visible_wrap_offset, + _rl_screenwidth + (lmargin ? 0 : wrap_offset), + 0); + + if ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) && + displaying_prompt_first_line && OLD_CPOS_IN_PROMPT()) + _rl_last_c_pos -= prompt_invis_chars_first_line; /* XXX - was wrap_offset */ + + /* If the visible new line is shorter than the old, but the number + of invisible characters is greater, and we are at the end of + the new line, we need to clear to eol. */ + t = _rl_last_c_pos - M_OFFSET (lmargin, wrap_offset); + if ((M_OFFSET (lmargin, wrap_offset) > visible_wrap_offset) && + (_rl_last_c_pos == out) && displaying_prompt_first_line && + t < visible_first_line_len) + { + nleft = _rl_screenwidth - t; + _rl_clear_to_eol (nleft); + } + visible_first_line_len = out - lmargin - M_OFFSET (lmargin, wrap_offset); + if (visible_first_line_len > _rl_screenwidth) + visible_first_line_len = _rl_screenwidth; + + _rl_move_cursor_relative (cpos_buffer_position - lmargin, &invisible_line[lmargin]); + last_lmargin = lmargin; + } + } + fflush (rl_outstream); + + /* Swap visible and non-visible lines. */ + { + struct line_state *vtemp = line_state_visible; + + line_state_visible = line_state_invisible; + line_state_invisible = vtemp; + + rl_display_fixed = 0; + /* If we are displaying on a single line, and last_lmargin is > 0, we + are not displaying any invisible characters, so set visible_wrap_offset + to 0. */ + if (_rl_horizontal_scroll_mode && last_lmargin) + visible_wrap_offset = 0; + else + visible_wrap_offset = wrap_offset; + } + + RL_UNSETSTATE (RL_STATE_REDISPLAYING); + _rl_release_sigint (); +} + +/* PWP: update_line() is based on finding the middle difference of each + line on the screen; vis: + + /old first difference + /beginning of line | /old last same /old EOL + v v v v +old: eddie> Oh, my little gruntle-buggy is to me, as lurgid as +new: eddie> Oh, my little buggy says to me, as lurgid as + ^ ^ ^ ^ + \beginning of line | \new last same \new end of line + \new first difference + + All are character pointers for the sake of speed. Special cases for + no differences, as well as for end of line additions must be handled. + + Could be made even smarter, but this works well enough */ +static void +update_line (old, new, current_line, omax, nmax, inv_botlin) + register char *old, *new; + int current_line, omax, nmax, inv_botlin; +{ + register char *ofd, *ols, *oe, *nfd, *nls, *ne; + int temp, lendiff, wsatend, od, nd, twidth, o_cpos; + int current_invis_chars; + int col_lendiff, col_temp; + int bytes_to_insert; +#if defined (HANDLE_MULTIBYTE) + mbstate_t ps_new, ps_old; + int new_offset, old_offset; +#endif + + /* If we're at the right edge of a terminal that supports xn, we're + ready to wrap around, so do so. This fixes problems with knowing + the exact cursor position and cut-and-paste with certain terminal + emulators. In this calculation, TEMP is the physical screen + position of the cursor. */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + temp = _rl_last_c_pos; + else + temp = _rl_last_c_pos - WRAP_OFFSET (_rl_last_v_pos, visible_wrap_offset); + if (temp == _rl_screenwidth && _rl_term_autowrap && !_rl_horizontal_scroll_mode + && _rl_last_v_pos == current_line - 1) + { +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + wchar_t wc; + mbstate_t ps; + int tempwidth, bytes; + size_t ret; + + /* This fixes only double-column characters, but if the wrapped + character consumes more than three columns, spaces will be + inserted in the string buffer. */ + if (current_line < line_state_visible->wbsize && line_state_visible->wrapped_line[current_line] > 0) + _rl_clear_to_eol (line_state_visible->wrapped_line[current_line]); + + memset (&ps, 0, sizeof (mbstate_t)); + ret = mbrtowc (&wc, new, MB_CUR_MAX, &ps); + if (MB_INVALIDCH (ret)) + { + tempwidth = 1; + ret = 1; + } + else if (MB_NULLWCH (ret)) + tempwidth = 0; + else + tempwidth = WCWIDTH (wc); + + if (tempwidth > 0) + { + int count, i; + bytes = ret; + for (count = 0; count < bytes; count++) + putc (new[count], rl_outstream); + _rl_last_c_pos = tempwidth; + _rl_last_v_pos++; + memset (&ps, 0, sizeof (mbstate_t)); + ret = mbrtowc (&wc, old, MB_CUR_MAX, &ps); + if (ret != 0 && bytes != 0) + { + if (MB_INVALIDCH (ret)) + ret = 1; + memmove (old+bytes, old+ret, strlen (old+ret)); + memcpy (old, new, bytes); + /* Fix up indices if we copy data from one line to another */ + omax += bytes - ret; + for (i = current_line+1; i <= inv_botlin+1; i++) + vis_lbreaks[i] += bytes - ret; + } + } + else + { + putc (' ', rl_outstream); + _rl_last_c_pos = 1; + _rl_last_v_pos++; + if (old[0] && new[0]) + old[0] = new[0]; + } + } + else +#endif + { + if (new[0]) + putc (new[0], rl_outstream); + else + putc (' ', rl_outstream); + _rl_last_c_pos = 1; + _rl_last_v_pos++; + if (old[0] && new[0]) + old[0] = new[0]; + } + } + + + /* Find first difference. */ +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + /* See if the old line is a subset of the new line, so that the + only change is adding characters. */ + temp = (omax < nmax) ? omax : nmax; + if (memcmp (old, new, temp) == 0) /* adding at the end */ + { + new_offset = old_offset = temp; + ofd = old + temp; + nfd = new + temp; + } + else + { + memset (&ps_new, 0, sizeof(mbstate_t)); + memset (&ps_old, 0, sizeof(mbstate_t)); + + if (omax == nmax && STREQN (new, old, omax)) + { + old_offset = omax; + new_offset = nmax; + ofd = old + omax; + nfd = new + nmax; + } + else + { + new_offset = old_offset = 0; + for (ofd = old, nfd = new; + (ofd - old < omax) && *ofd && + _rl_compare_chars(old, old_offset, &ps_old, new, new_offset, &ps_new); ) + { + old_offset = _rl_find_next_mbchar (old, old_offset, 1, MB_FIND_ANY); + new_offset = _rl_find_next_mbchar (new, new_offset, 1, MB_FIND_ANY); + + ofd = old + old_offset; + nfd = new + new_offset; + } + } + } + } + else +#endif + for (ofd = old, nfd = new; + (ofd - old < omax) && *ofd && (*ofd == *nfd); + ofd++, nfd++) + ; + + /* Move to the end of the screen line. ND and OD are used to keep track + of the distance between ne and new and oe and old, respectively, to + move a subtraction out of each loop. */ + for (od = ofd - old, oe = ofd; od < omax && *oe; oe++, od++); + for (nd = nfd - new, ne = nfd; nd < nmax && *ne; ne++, nd++); + + /* If no difference, continue to next line. */ + if (ofd == oe && nfd == ne) + return; + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0 && _rl_utf8locale) + { + wchar_t wc; + mbstate_t ps = { 0 }; + int t; + + /* If the first character in the difference is a zero-width character, + assume it's a combining character and back one up so the two base + characters no longer compare equivalently. */ + t = mbrtowc (&wc, ofd, MB_CUR_MAX, &ps); + if (t > 0 && UNICODE_COMBINING_CHAR (wc) && WCWIDTH (wc) == 0) + { + old_offset = _rl_find_prev_mbchar (old, ofd - old, MB_FIND_ANY); + new_offset = _rl_find_prev_mbchar (new, nfd - new, MB_FIND_ANY); + ofd = old + old_offset; /* equal by definition */ + nfd = new + new_offset; + } + } +#endif + + wsatend = 1; /* flag for trailing whitespace */ + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + ols = old + _rl_find_prev_mbchar (old, oe - old, MB_FIND_ANY); + nls = new + _rl_find_prev_mbchar (new, ne - new, MB_FIND_ANY); + + while ((ols > ofd) && (nls > nfd)) + { + memset (&ps_old, 0, sizeof (mbstate_t)); + memset (&ps_new, 0, sizeof (mbstate_t)); + +#if 0 + /* On advice from jir@yamato.ibm.com */ + _rl_adjust_point (old, ols - old, &ps_old); + _rl_adjust_point (new, nls - new, &ps_new); +#endif + + if (_rl_compare_chars (old, ols - old, &ps_old, new, nls - new, &ps_new) == 0) + break; + + if (*ols == ' ') + wsatend = 0; + + ols = old + _rl_find_prev_mbchar (old, ols - old, MB_FIND_ANY); + nls = new + _rl_find_prev_mbchar (new, nls - new, MB_FIND_ANY); + } + } + else + { +#endif /* HANDLE_MULTIBYTE */ + ols = oe - 1; /* find last same */ + nls = ne - 1; + while ((ols > ofd) && (nls > nfd) && (*ols == *nls)) + { + if (*ols != ' ') + wsatend = 0; + ols--; + nls--; + } +#if defined (HANDLE_MULTIBYTE) + } +#endif + + if (wsatend) + { + ols = oe; + nls = ne; + } +#if defined (HANDLE_MULTIBYTE) + /* This may not work for stateful encoding, but who cares? To handle + stateful encoding properly, we have to scan each string from the + beginning and compare. */ + else if (_rl_compare_chars (ols, 0, NULL, nls, 0, NULL) == 0) +#else + else if (*ols != *nls) +#endif + { + if (*ols) /* don't step past the NUL */ + { + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + ols = old + _rl_find_next_mbchar (old, ols - old, 1, MB_FIND_ANY); + else + ols++; + } + if (*nls) + { + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + nls = new + _rl_find_next_mbchar (new, nls - new, 1, MB_FIND_ANY); + else + nls++; + } + } + + /* count of invisible characters in the current invisible line. */ + current_invis_chars = W_OFFSET (current_line, wrap_offset); + if (_rl_last_v_pos != current_line) + { + _rl_move_vert (current_line); + if ((MB_CUR_MAX == 1 || rl_byte_oriented) && current_line == 0 && visible_wrap_offset) + _rl_last_c_pos += visible_wrap_offset; + } + + /* If this is the first line and there are invisible characters in the + prompt string, and the prompt string has not changed, and the current + cursor position is before the last invisible character in the prompt, + and the index of the character to move to is past the end of the prompt + string, then redraw the entire prompt string. We can only do this + reliably if the terminal supports a `cr' capability. + + This is not an efficiency hack -- there is a problem with redrawing + portions of the prompt string if they contain terminal escape + sequences (like drawing the `unbold' sequence without a corresponding + `bold') that manifests itself on certain terminals. */ + + lendiff = local_prompt_len; + od = ofd - old; /* index of first difference in visible line */ + if (current_line == 0 && !_rl_horizontal_scroll_mode && + _rl_term_cr && lendiff > prompt_visible_length && _rl_last_c_pos > 0 && + od >= lendiff && _rl_last_c_pos < PROMPT_ENDING_INDEX) + { +#if defined (__MSDOS__) + putc ('\r', rl_outstream); +#else + tputs (_rl_term_cr, 1, _rl_output_character_function); +#endif + if (modmark) + _rl_output_some_chars ("*", 1); + _rl_output_some_chars (local_prompt, lendiff); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + /* We take wrap_offset into account here so we can pass correct + information to _rl_move_cursor_relative. */ + _rl_last_c_pos = _rl_col_width (local_prompt, 0, lendiff, 1) - wrap_offset + modmark; + cpos_adjusted = 1; + } + else + _rl_last_c_pos = lendiff + modmark; + } + + o_cpos = _rl_last_c_pos; + + /* When this function returns, _rl_last_c_pos is correct, and an absolute + cursor position in multibyte mode, but a buffer index when not in a + multibyte locale. */ + _rl_move_cursor_relative (od, old); + +#if defined (HANDLE_MULTIBYTE) + /* We need to indicate that the cursor position is correct in the presence of + invisible characters in the prompt string. Let's see if setting this when + we make sure we're at the end of the drawn prompt string works. */ + if (current_line == 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0 && + (_rl_last_c_pos > 0 || o_cpos > 0) && + _rl_last_c_pos == prompt_physical_chars) + cpos_adjusted = 1; +#endif + + /* if (len (new) > len (old)) + lendiff == difference in buffer (bytes) + col_lendiff == difference on screen (columns) + When not using multibyte characters, these are equal */ + lendiff = (nls - nfd) - (ols - ofd); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + col_lendiff = _rl_col_width (new, nfd - new, nls - new, 1) - _rl_col_width (old, ofd - old, ols - old, 1); + else + col_lendiff = lendiff; + + /* If we are changing the number of invisible characters in a line, and + the spot of first difference is before the end of the invisible chars, + lendiff needs to be adjusted. */ + if (current_line == 0 && !_rl_horizontal_scroll_mode && + current_invis_chars != visible_wrap_offset) + { + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + lendiff += visible_wrap_offset - current_invis_chars; + col_lendiff += visible_wrap_offset - current_invis_chars; + } + else + { + lendiff += visible_wrap_offset - current_invis_chars; + col_lendiff = lendiff; + } + } + + /* We use temp as a count of the number of bytes from the first difference + to the end of the new line. col_temp is the corresponding number of + screen columns. A `dumb' update moves to the spot of first difference + and writes TEMP bytes. */ + /* Insert (diff (len (old), len (new)) ch. */ + temp = ne - nfd; + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + col_temp = _rl_col_width (new, nfd - new, ne - new, 1); + else + col_temp = temp; + + /* how many bytes from the new line buffer to write to the display */ + bytes_to_insert = nls - nfd; + + /* col_lendiff > 0 if we are adding characters to the line */ + if (col_lendiff > 0) /* XXX - was lendiff */ + { + /* Non-zero if we're increasing the number of lines. */ + int gl = current_line >= _rl_vis_botlin && inv_botlin > _rl_vis_botlin; + /* If col_lendiff is > 0, implying that the new string takes up more + screen real estate than the old, but lendiff is < 0, meaning that it + takes fewer bytes, we need to just output the characters starting + from the first difference. These will overwrite what is on the + display, so there's no reason to do a smart update. This can really + only happen in a multibyte environment. */ + if (lendiff < 0) + { + _rl_output_some_chars (nfd, temp); + _rl_last_c_pos += col_temp; /* XXX - was _rl_col_width (nfd, 0, temp, 1); */ + /* If nfd begins before any invisible characters in the prompt, + adjust _rl_last_c_pos to account for wrap_offset and set + cpos_adjusted to let the caller know. */ + if (current_line == 0 && displaying_prompt_first_line && wrap_offset && ((nfd - new) <= prompt_last_invisible)) + { + _rl_last_c_pos -= wrap_offset; + cpos_adjusted = 1; + } + return; + } + /* Sometimes it is cheaper to print the characters rather than + use the terminal's capabilities. If we're growing the number + of lines, make sure we actually cause the new line to wrap + around on auto-wrapping terminals. */ + else if (_rl_terminal_can_insert && ((2 * col_temp) >= col_lendiff || _rl_term_IC) && (!_rl_term_autowrap || !gl)) + { + /* If lendiff > prompt_visible_length and _rl_last_c_pos == 0 and + _rl_horizontal_scroll_mode == 1, inserting the characters with + _rl_term_IC or _rl_term_ic will screw up the screen because of the + invisible characters. We need to just draw them. */ + /* The same thing happens if we're trying to draw before the last + invisible character in the prompt string or we're increasing the + number of invisible characters in the line and we're not drawing + the entire prompt string. */ + if (*ols && ((_rl_horizontal_scroll_mode && + _rl_last_c_pos == 0 && + lendiff > prompt_visible_length && + current_invis_chars > 0) == 0) && + (((MB_CUR_MAX > 1 && rl_byte_oriented == 0) && + current_line == 0 && wrap_offset && + ((nfd - new) <= prompt_last_invisible) && + (col_lendiff < prompt_visible_length)) == 0) && + (visible_wrap_offset >= current_invis_chars)) + { + open_some_spaces (col_lendiff); + _rl_output_some_chars (nfd, bytes_to_insert); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + _rl_last_c_pos += _rl_col_width (nfd, 0, bytes_to_insert, 1); + else + _rl_last_c_pos += bytes_to_insert; + } + else if ((MB_CUR_MAX == 1 || rl_byte_oriented != 0) && *ols == 0 && lendiff > 0) + { + /* At the end of a line the characters do not have to + be "inserted". They can just be placed on the screen. */ + _rl_output_some_chars (nfd, temp); + _rl_last_c_pos += col_temp; + return; + } + else /* just write from first difference to end of new line */ + { + _rl_output_some_chars (nfd, temp); + _rl_last_c_pos += col_temp; + /* If nfd begins before the last invisible character in the + prompt, adjust _rl_last_c_pos to account for wrap_offset + and set cpos_adjusted to let the caller know. */ + if ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) && current_line == 0 && displaying_prompt_first_line && wrap_offset && ((nfd - new) <= prompt_last_invisible)) + { + _rl_last_c_pos -= wrap_offset; + cpos_adjusted = 1; + } + return; + } + + if (bytes_to_insert > lendiff) + { + /* If nfd begins before the last invisible character in the + prompt, adjust _rl_last_c_pos to account for wrap_offset + and set cpos_adjusted to let the caller know. */ + if ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) && current_line == 0 && displaying_prompt_first_line && wrap_offset && ((nfd - new) <= prompt_last_invisible)) + { + _rl_last_c_pos -= wrap_offset; + cpos_adjusted = 1; + } + } + } + else + { + /* cannot insert chars, write to EOL */ + _rl_output_some_chars (nfd, temp); + _rl_last_c_pos += col_temp; + /* If we're in a multibyte locale and were before the last invisible + char in the current line (which implies we just output some invisible + characters) we need to adjust _rl_last_c_pos, since it represents + a physical character position. */ + if ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) && + current_line == prompt_last_screen_line && wrap_offset && + displaying_prompt_first_line && + wrap_offset != prompt_invis_chars_first_line && + ((nfd-new) < (prompt_last_invisible-(current_line*_rl_screenwidth)))) + { + _rl_last_c_pos -= wrap_offset - prompt_invis_chars_first_line; + cpos_adjusted = 1; + } + } + } + else /* Delete characters from line. */ + { + /* If possible and inexpensive to use terminal deletion, then do so. */ + if (_rl_term_dc && (2 * col_temp) >= -col_lendiff) + { + /* If all we're doing is erasing the invisible characters in the + prompt string, don't bother. It screws up the assumptions + about what's on the screen. */ + if (_rl_horizontal_scroll_mode && _rl_last_c_pos == 0 && + displaying_prompt_first_line && + -lendiff == visible_wrap_offset) + col_lendiff = 0; + + /* If we have moved lmargin and we're shrinking the line, we've + already moved the cursor to the first character of the new line, + so deleting -col_lendiff characters will mess up the cursor + position calculation */ + if (_rl_horizontal_scroll_mode && displaying_prompt_first_line == 0 && + col_lendiff && _rl_last_c_pos < -col_lendiff) + col_lendiff = 0; + + if (col_lendiff) + delete_chars (-col_lendiff); /* delete (diff) characters */ + + /* Copy (new) chars to screen from first diff to last match, + overwriting what is there. */ + if (bytes_to_insert > 0) + { + /* If nfd begins at the prompt, or before the invisible + characters in the prompt, we need to adjust _rl_last_c_pos + in a multibyte locale to account for the wrap offset and + set cpos_adjusted accordingly. */ + _rl_output_some_chars (nfd, bytes_to_insert); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + _rl_last_c_pos += _rl_col_width (nfd, 0, bytes_to_insert, 1); + if (current_line == 0 && wrap_offset && + displaying_prompt_first_line && + _rl_last_c_pos > wrap_offset && + ((nfd - new) <= prompt_last_invisible)) + { + _rl_last_c_pos -= wrap_offset; + cpos_adjusted = 1; + } + } + else + _rl_last_c_pos += bytes_to_insert; + + if (_rl_horizontal_scroll_mode && ((oe-old) > (ne-new))) + goto clear_rest_of_line; + } + } + /* Otherwise, print over the existing material. */ + else + { + if (temp > 0) + { + /* If nfd begins at the prompt, or before the invisible + characters in the prompt, we need to adjust _rl_last_c_pos + in a multibyte locale to account for the wrap offset and + set cpos_adjusted accordingly. */ + _rl_output_some_chars (nfd, temp); + _rl_last_c_pos += col_temp; /* XXX */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + if (current_line == 0 && wrap_offset && + displaying_prompt_first_line && + _rl_last_c_pos > wrap_offset && + ((nfd - new) <= prompt_last_invisible)) + { + _rl_last_c_pos -= wrap_offset; + cpos_adjusted = 1; + } + } + } +clear_rest_of_line: + lendiff = (oe - old) - (ne - new); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + col_lendiff = _rl_col_width (old, 0, oe - old, 1) - _rl_col_width (new, 0, ne - new, 1); + else + col_lendiff = lendiff; + + /* If we've already printed over the entire width of the screen, + including the old material, then col_lendiff doesn't matter and + space_to_eol will insert too many spaces. XXX - maybe we should + adjust col_lendiff based on the difference between _rl_last_c_pos + and _rl_screenwidth */ + if (col_lendiff && ((MB_CUR_MAX == 1 || rl_byte_oriented) || (_rl_last_c_pos < _rl_screenwidth))) + { + if (_rl_term_autowrap && current_line < inv_botlin) + space_to_eol (col_lendiff); + else + _rl_clear_to_eol (col_lendiff); + } + } + } +} + +/* Tell the update routines that we have moved onto a new (empty) line. */ +int +rl_on_new_line () +{ + if (visible_line) + visible_line[0] = '\0'; + + _rl_last_c_pos = _rl_last_v_pos = 0; + _rl_vis_botlin = last_lmargin = 0; + if (vis_lbreaks) + vis_lbreaks[0] = vis_lbreaks[1] = 0; + visible_wrap_offset = 0; + return 0; +} + +/* Tell the update routines that we have moved onto a new line with the + prompt already displayed. Code originally from the version of readline + distributed with CLISP. rl_expand_prompt must have already been called + (explicitly or implicitly). This still doesn't work exactly right. */ +int +rl_on_new_line_with_prompt () +{ + int prompt_size, i, l, real_screenwidth, newlines; + char *prompt_last_line, *lprompt; + + /* Initialize visible_line and invisible_line to ensure that they can hold + the already-displayed prompt. */ + prompt_size = strlen (rl_prompt) + 1; + init_line_structures (prompt_size); + + /* Make sure the line structures hold the already-displayed prompt for + redisplay. */ + lprompt = local_prompt ? local_prompt : rl_prompt; + strcpy (visible_line, lprompt); + strcpy (invisible_line, lprompt); + + /* If the prompt contains newlines, take the last tail. */ + prompt_last_line = strrchr (rl_prompt, '\n'); + if (!prompt_last_line) + prompt_last_line = rl_prompt; + + l = strlen (prompt_last_line); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + _rl_last_c_pos = _rl_col_width (prompt_last_line, 0, l, 1); /* XXX */ + else + _rl_last_c_pos = l; + + /* Dissect prompt_last_line into screen lines. Note that here we have + to use the real screenwidth. Readline's notion of screenwidth might be + one less, see terminal.c. */ + real_screenwidth = _rl_screenwidth + (_rl_term_autowrap ? 0 : 1); + _rl_last_v_pos = l / real_screenwidth; + /* If the prompt length is a multiple of real_screenwidth, we don't know + whether the cursor is at the end of the last line, or already at the + beginning of the next line. Output a newline just to be safe. */ + if (l > 0 && (l % real_screenwidth) == 0) + _rl_output_some_chars ("\n", 1); + last_lmargin = 0; + + newlines = 0; i = 0; + while (i <= l) + { + _rl_vis_botlin = newlines; + vis_lbreaks[newlines++] = i; + i += real_screenwidth; + } + vis_lbreaks[newlines] = l; + visible_wrap_offset = 0; + + rl_display_prompt = rl_prompt; /* XXX - make sure it's set */ + + return 0; +} + +/* Actually update the display, period. */ +int +rl_forced_update_display () +{ + register char *temp; + + if (visible_line) + { + temp = visible_line; + while (*temp) + *temp++ = '\0'; + } + rl_on_new_line (); + forced_display++; + (*rl_redisplay_function) (); + return 0; +} + +/* Move the cursor from _rl_last_c_pos to NEW, which are buffer indices. + (Well, when we don't have multibyte characters, _rl_last_c_pos is a + buffer index.) + DATA is the contents of the screen line of interest; i.e., where + the movement is being done. */ +void +_rl_move_cursor_relative (new, data) + int new; + const char *data; +{ + register int i; + int woff; /* number of invisible chars on current line */ + int cpos, dpos; /* current and desired cursor positions */ + int adjust; + + woff = WRAP_OFFSET (_rl_last_v_pos, wrap_offset); + cpos = _rl_last_c_pos; + + if (cpos == 0 && cpos == new) + return; + +#if defined (HANDLE_MULTIBYTE) + /* If we have multibyte characters, NEW is indexed by the buffer point in + a multibyte string, but _rl_last_c_pos is the display position. In + this case, NEW's display position is not obvious and must be + calculated. We need to account for invisible characters in this line, + as long as we are past them and they are counted by _rl_col_width. */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + adjust = 1; + /* Try to short-circuit common cases and eliminate a bunch of multibyte + character function calls. */ + /* 1. prompt string */ + if (new == local_prompt_len && memcmp (data, local_prompt, new) == 0) + { + dpos = prompt_physical_chars; + cpos_adjusted = 1; + adjust = 0; + } + /* 2. prompt_string + line contents */ + else if (new > local_prompt_len && local_prompt && memcmp (data, local_prompt, local_prompt_len) == 0) + { + dpos = prompt_physical_chars + _rl_col_width (data, local_prompt_len, new, 1); + cpos_adjusted = 1; + adjust = 0; + } + else + dpos = _rl_col_width (data, 0, new, 1); + + if (displaying_prompt_first_line == 0) + adjust = 0; + + /* Use NEW when comparing against the last invisible character in the + prompt string, since they're both buffer indices and DPOS is a + desired display position. */ + if (adjust && ((new > prompt_last_invisible) || /* XXX - don't use woff here */ + (prompt_physical_chars >= _rl_screenwidth && + _rl_last_v_pos == prompt_last_screen_line && + wrap_offset >= woff && dpos >= woff && + new > (prompt_last_invisible-(_rl_screenwidth*_rl_last_v_pos)-wrap_offset)))) + /* XXX last comparison might need to be >= */ + { + dpos -= woff; + /* Since this will be assigned to _rl_last_c_pos at the end (more + precisely, _rl_last_c_pos == dpos when this function returns), + let the caller know. */ + cpos_adjusted = 1; + } + } + else +#endif + dpos = new; + + /* If we don't have to do anything, then return. */ + if (cpos == dpos) + return; + + /* It may be faster to output a CR, and then move forwards instead + of moving backwards. */ + /* i == current physical cursor position. */ +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + i = _rl_last_c_pos; + else +#endif + i = _rl_last_c_pos - woff; + if (dpos == 0 || CR_FASTER (dpos, _rl_last_c_pos) || + (_rl_term_autowrap && i == _rl_screenwidth)) + { +#if defined (__MSDOS__) + putc ('\r', rl_outstream); +#else + tputs (_rl_term_cr, 1, _rl_output_character_function); +#endif /* !__MSDOS__ */ + cpos = _rl_last_c_pos = 0; + } + + if (cpos < dpos) + { + /* Move the cursor forward. We do it by printing the command + to move the cursor forward if there is one, else print that + portion of the output buffer again. Which is cheaper? */ + + /* The above comment is left here for posterity. It is faster + to print one character (non-control) than to print a control + sequence telling the terminal to move forward one character. + That kind of control is for people who don't know what the + data is underneath the cursor. */ + + /* However, we need a handle on where the current display position is + in the buffer for the immediately preceding comment to be true. + In multibyte locales, we don't currently have that info available. + Without it, we don't know where the data we have to display begins + in the buffer and we have to go back to the beginning of the screen + line. In this case, we can use the terminal sequence to move forward + if it's available. */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + if (_rl_term_forward_char) + { + for (i = cpos; i < dpos; i++) + tputs (_rl_term_forward_char, 1, _rl_output_character_function); + } + else + { + tputs (_rl_term_cr, 1, _rl_output_character_function); + for (i = 0; i < new; i++) + putc (data[i], rl_outstream); + } + } + else + for (i = cpos; i < new; i++) + putc (data[i], rl_outstream); + } + +#if defined (HANDLE_MULTIBYTE) + /* NEW points to the buffer point, but _rl_last_c_pos is the display point. + The byte length of the string is probably bigger than the column width + of the string, which means that if NEW == _rl_last_c_pos, then NEW's + display point is less than _rl_last_c_pos. */ +#endif + else if (cpos > dpos) + _rl_backspace (cpos - dpos); + + _rl_last_c_pos = dpos; +} + +/* PWP: move the cursor up or down. */ +void +_rl_move_vert (to) + int to; +{ + register int delta, i; + + if (_rl_last_v_pos == to || to > _rl_screenheight) + return; + + if ((delta = to - _rl_last_v_pos) > 0) + { + for (i = 0; i < delta; i++) + putc ('\n', rl_outstream); +#if defined (__MSDOS__) + putc ('\r', rl_outstream); +#else + tputs (_rl_term_cr, 1, _rl_output_character_function); +#endif + _rl_last_c_pos = 0; + } + else + { /* delta < 0 */ +#ifdef __DJGPP__ + int row, col; + + fflush (rl_outstream); + ScreenGetCursor (&row, &col); + ScreenSetCursor (row + delta, col); + i = -delta; +#else + if (_rl_term_up && *_rl_term_up) + for (i = 0; i < -delta; i++) + tputs (_rl_term_up, 1, _rl_output_character_function); +#endif /* !__DJGPP__ */ + } + + _rl_last_v_pos = to; /* Now TO is here */ +} + +/* Physically print C on rl_outstream. This is for functions which know + how to optimize the display. Return the number of characters output. */ +int +rl_show_char (c) + int c; +{ + int n = 1; + if (META_CHAR (c) && (_rl_output_meta_chars == 0)) + { + fprintf (rl_outstream, "M-"); + n += 2; + c = UNMETA (c); + } + +#if defined (DISPLAY_TABS) + if ((CTRL_CHAR (c) && c != '\t') || c == RUBOUT) +#else + if (CTRL_CHAR (c) || c == RUBOUT) +#endif /* !DISPLAY_TABS */ + { + fprintf (rl_outstream, "C-"); + n += 2; + c = CTRL_CHAR (c) ? UNCTRL (c) : '?'; + } + + putc (c, rl_outstream); + fflush (rl_outstream); + return n; +} + +int +rl_character_len (c, pos) + register int c, pos; +{ + unsigned char uc; + + uc = (unsigned char)c; + + if (META_CHAR (uc)) + return ((_rl_output_meta_chars == 0) ? 4 : 1); + + if (uc == '\t') + { +#if defined (DISPLAY_TABS) + return (((pos | 7) + 1) - pos); +#else + return (2); +#endif /* !DISPLAY_TABS */ + } + + if (CTRL_CHAR (c) || c == RUBOUT) + return (2); + + return ((ISPRINT (uc)) ? 1 : 2); +} +/* How to print things in the "echo-area". The prompt is treated as a + mini-modeline. */ +static int msg_saved_prompt = 0; + +#if defined (USE_VARARGS) +int +#if defined (PREFER_STDARG) +rl_message (const char *format, ...) +#else +rl_message (va_alist) + va_dcl +#endif +{ + va_list args; +#if defined (PREFER_VARARGS) + char *format; +#endif +#if defined (HAVE_VSNPRINTF) + int bneed; +#endif + +#if defined (PREFER_STDARG) + va_start (args, format); +#else + va_start (args); + format = va_arg (args, char *); +#endif + + if (msg_buf == 0) + msg_buf = xmalloc (msg_bufsiz = 128); + +#if defined (HAVE_VSNPRINTF) + bneed = vsnprintf (msg_buf, msg_bufsiz - 1, format, args); + if (bneed >= msg_bufsiz - 1) + { + msg_bufsiz = bneed + 1; + msg_buf = xrealloc (msg_buf, msg_bufsiz); + va_end (args); + +#if defined (PREFER_STDARG) + va_start (args, format); +#else + va_start (args); + format = va_arg (args, char *); +#endif + vsnprintf (msg_buf, msg_bufsiz - 1, format, args); + } +#else + vsprintf (msg_buf, format, args); + msg_buf[msg_bufsiz - 1] = '\0'; /* overflow? */ +#endif + va_end (args); + + if (saved_local_prompt == 0) + { + rl_save_prompt (); + msg_saved_prompt = 1; + } + else if (local_prompt != saved_local_prompt) + { + FREE (local_prompt); + FREE (local_prompt_prefix); + local_prompt = (char *)NULL; + } + rl_display_prompt = msg_buf; + local_prompt = expand_prompt (msg_buf, &prompt_visible_length, + &prompt_last_invisible, + &prompt_invis_chars_first_line, + &prompt_physical_chars); + local_prompt_prefix = (char *)NULL; + local_prompt_len = local_prompt ? strlen (local_prompt) : 0; + (*rl_redisplay_function) (); + + return 0; +} +#else /* !USE_VARARGS */ +int +rl_message (format, arg1, arg2) + char *format; +{ + if (msg_buf == 0) + msg_buf = xmalloc (msg_bufsiz = 128); + + sprintf (msg_buf, format, arg1, arg2); + msg_buf[msg_bufsiz - 1] = '\0'; /* overflow? */ + + rl_display_prompt = msg_buf; + if (saved_local_prompt == 0) + { + rl_save_prompt (); + msg_saved_prompt = 1; + } + else if (local_prompt != saved_local_prompt) + { + FREE (local_prompt); + FREE (local_prompt_prefix); + local_prompt = (char *)NULL; + } + local_prompt = expand_prompt (msg_buf, &prompt_visible_length, + &prompt_last_invisible, + &prompt_invis_chars_first_line, + &prompt_physical_chars); + local_prompt_prefix = (char *)NULL; + local_prompt_len = local_prompt ? strlen (local_prompt) : 0; + (*rl_redisplay_function) (); + + return 0; +} +#endif /* !USE_VARARGS */ + +/* How to clear things from the "echo-area". */ +int +rl_clear_message () +{ + rl_display_prompt = rl_prompt; + if (msg_saved_prompt) + { + rl_restore_prompt (); + msg_saved_prompt = 0; + } + (*rl_redisplay_function) (); + return 0; +} + +int +rl_reset_line_state () +{ + rl_on_new_line (); + + rl_display_prompt = rl_prompt ? rl_prompt : ""; + forced_display = 1; + return 0; +} + +void +rl_save_prompt () +{ + saved_local_prompt = local_prompt; + saved_local_prefix = local_prompt_prefix; + saved_prefix_length = prompt_prefix_length; + saved_local_length = local_prompt_len; + saved_last_invisible = prompt_last_invisible; + saved_visible_length = prompt_visible_length; + saved_invis_chars_first_line = prompt_invis_chars_first_line; + saved_physical_chars = prompt_physical_chars; + + local_prompt = local_prompt_prefix = (char *)0; + local_prompt_len = 0; + prompt_last_invisible = prompt_visible_length = prompt_prefix_length = 0; + prompt_invis_chars_first_line = prompt_physical_chars = 0; +} + +void +rl_restore_prompt () +{ + FREE (local_prompt); + FREE (local_prompt_prefix); + + local_prompt = saved_local_prompt; + local_prompt_prefix = saved_local_prefix; + local_prompt_len = saved_local_length; + prompt_prefix_length = saved_prefix_length; + prompt_last_invisible = saved_last_invisible; + prompt_visible_length = saved_visible_length; + prompt_invis_chars_first_line = saved_invis_chars_first_line; + prompt_physical_chars = saved_physical_chars; + + /* can test saved_local_prompt to see if prompt info has been saved. */ + saved_local_prompt = saved_local_prefix = (char *)0; + saved_local_length = 0; + saved_last_invisible = saved_visible_length = saved_prefix_length = 0; + saved_invis_chars_first_line = saved_physical_chars = 0; +} + +char * +_rl_make_prompt_for_search (pchar) + int pchar; +{ + int len; + char *pmt, *p; + + rl_save_prompt (); + + /* We've saved the prompt, and can do anything with the various prompt + strings we need before they're restored. We want the unexpanded + portion of the prompt string after any final newline. */ + p = rl_prompt ? strrchr (rl_prompt, '\n') : 0; + if (p == 0) + { + len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0; + pmt = (char *)xmalloc (len + 2); + if (len) + strcpy (pmt, rl_prompt); + pmt[len] = pchar; + pmt[len+1] = '\0'; + } + else + { + p++; + len = strlen (p); + pmt = (char *)xmalloc (len + 2); + if (len) + strcpy (pmt, p); + pmt[len] = pchar; + pmt[len+1] = '\0'; + } + + /* will be overwritten by expand_prompt, called from rl_message */ + prompt_physical_chars = saved_physical_chars + 1; + return pmt; +} + +/* Quick redisplay hack when erasing characters at the end of the line. */ +void +_rl_erase_at_end_of_line (l) + int l; +{ + register int i; + + _rl_backspace (l); + for (i = 0; i < l; i++) + putc (' ', rl_outstream); + _rl_backspace (l); + for (i = 0; i < l; i++) + visible_line[--_rl_last_c_pos] = '\0'; + rl_display_fixed++; +} + +/* Clear to the end of the line. COUNT is the minimum + number of character spaces to clear, */ +void +_rl_clear_to_eol (count) + int count; +{ +#ifndef __MSDOS__ + if (_rl_term_clreol) + tputs (_rl_term_clreol, 1, _rl_output_character_function); + else +#endif + if (count) + space_to_eol (count); +} + +/* Clear to the end of the line using spaces. COUNT is the minimum + number of character spaces to clear, */ +static void +space_to_eol (count) + int count; +{ + register int i; + + for (i = 0; i < count; i++) + putc (' ', rl_outstream); + + _rl_last_c_pos += count; +} + +void +_rl_clear_screen () +{ +#ifndef __DJGPP__ + if (_rl_term_clrpag) + tputs (_rl_term_clrpag, 1, _rl_output_character_function); + else + rl_crlf (); +#else + ScreenClear (); + ScreenSetCursor (0, 0); +#endif /* __DJGPP__ */ +} + +/* Insert COUNT characters from STRING to the output stream at column COL. */ +static void +insert_some_chars (string, count, col) + char *string; + int count, col; +{ + open_some_spaces (col); + _rl_output_some_chars (string, count); +} + +/* Insert COL spaces, keeping the cursor at the same position. We follow the + ncurses documentation and use either im/ei with explicit spaces, or IC/ic + by itself. We assume there will either be ei or we don't need to use it. */ +static void +open_some_spaces (col) + int col; +{ +#if !defined (__MSDOS__) && !defined (__MINGW32__) + char *buffer; + register int i; + + /* If IC is defined, then we do not have to "enter" insert mode. */ + if (_rl_term_IC) + { + buffer = tgoto (_rl_term_IC, 0, col); + tputs (buffer, 1, _rl_output_character_function); + } + else if (_rl_term_im && *_rl_term_im) + { + tputs (_rl_term_im, 1, _rl_output_character_function); + /* just output the desired number of spaces */ + for (i = col; i--; ) + _rl_output_character_function (' '); + /* If there is a string to turn off insert mode, use it now. */ + if (_rl_term_ei && *_rl_term_ei) + tputs (_rl_term_ei, 1, _rl_output_character_function); + /* and move back the right number of spaces */ + _rl_backspace (col); + } + else if (_rl_term_ic && *_rl_term_ic) + { + /* If there is a special command for inserting characters, then + use that first to open up the space. */ + for (i = col; i--; ) + tputs (_rl_term_ic, 1, _rl_output_character_function); + } +#endif /* !__MSDOS__ && !__MINGW32__ */ +} + +/* Delete COUNT characters from the display line. */ +static void +delete_chars (count) + int count; +{ + if (count > _rl_screenwidth) /* XXX */ + return; + +#if !defined (__MSDOS__) && !defined (__MINGW32__) + if (_rl_term_DC && *_rl_term_DC) + { + char *buffer; + buffer = tgoto (_rl_term_DC, count, count); + tputs (buffer, count, _rl_output_character_function); + } + else + { + if (_rl_term_dc && *_rl_term_dc) + while (count--) + tputs (_rl_term_dc, 1, _rl_output_character_function); + } +#endif /* !__MSDOS__ && !__MINGW32__ */ +} + +void +_rl_update_final () +{ + int full_lines; + + full_lines = 0; + /* If the cursor is the only thing on an otherwise-blank last line, + compensate so we don't print an extra CRLF. */ + if (_rl_vis_botlin && _rl_last_c_pos == 0 && + visible_line[vis_lbreaks[_rl_vis_botlin]] == 0) + { + _rl_vis_botlin--; + full_lines = 1; + } + _rl_move_vert (_rl_vis_botlin); + /* If we've wrapped lines, remove the final xterm line-wrap flag. */ + if (full_lines && _rl_term_autowrap && (VIS_LLEN(_rl_vis_botlin) == _rl_screenwidth)) + { + char *last_line; + + last_line = &visible_line[vis_lbreaks[_rl_vis_botlin]]; + cpos_buffer_position = -1; /* don't know where we are in buffer */ + _rl_move_cursor_relative (_rl_screenwidth - 1, last_line); /* XXX */ + _rl_clear_to_eol (0); + putc (last_line[_rl_screenwidth - 1], rl_outstream); + } + _rl_vis_botlin = 0; + rl_crlf (); + fflush (rl_outstream); + rl_display_fixed++; +} + +/* Move to the start of the current line. */ +static void +cr () +{ + if (_rl_term_cr) + { +#if defined (__MSDOS__) + putc ('\r', rl_outstream); +#else + tputs (_rl_term_cr, 1, _rl_output_character_function); +#endif + _rl_last_c_pos = 0; + } +} + +/* Redraw the last line of a multi-line prompt that may possibly contain + terminal escape sequences. Called with the cursor at column 0 of the + line to draw the prompt on. */ +static void +redraw_prompt (t) + char *t; +{ + char *oldp; + + oldp = rl_display_prompt; + rl_save_prompt (); + + rl_display_prompt = t; + local_prompt = expand_prompt (t, &prompt_visible_length, + &prompt_last_invisible, + &prompt_invis_chars_first_line, + &prompt_physical_chars); + local_prompt_prefix = (char *)NULL; + local_prompt_len = local_prompt ? strlen (local_prompt) : 0; + + rl_forced_update_display (); + + rl_display_prompt = oldp; + rl_restore_prompt(); +} + +/* Redisplay the current line after a SIGWINCH is received. */ +void +_rl_redisplay_after_sigwinch () +{ + char *t; + + /* Clear the last line (assuming that the screen size change will result in + either more or fewer characters on that line only) and put the cursor at + column 0. Make sure the right thing happens if we have wrapped to a new + screen line. */ + if (_rl_term_cr) + { + _rl_move_vert (_rl_vis_botlin); + +#if defined (__MSDOS__) + putc ('\r', rl_outstream); +#else + tputs (_rl_term_cr, 1, _rl_output_character_function); +#endif + _rl_last_c_pos = 0; +#if defined (__MSDOS__) + space_to_eol (_rl_screenwidth); + putc ('\r', rl_outstream); +#else + if (_rl_term_clreol) + tputs (_rl_term_clreol, 1, _rl_output_character_function); + else + { + space_to_eol (_rl_screenwidth); + tputs (_rl_term_cr, 1, _rl_output_character_function); + } +#endif + if (_rl_last_v_pos > 0) + _rl_move_vert (0); + } + else + rl_crlf (); + + /* Redraw only the last line of a multi-line prompt. */ + t = strrchr (rl_display_prompt, '\n'); + if (t) + redraw_prompt (++t); + else + rl_forced_update_display (); +} + +void +_rl_clean_up_for_exit () +{ + if (_rl_echoing_p) + { + _rl_move_vert (_rl_vis_botlin); + _rl_vis_botlin = 0; + fflush (rl_outstream); + rl_restart_output (1, 0); + } +} + +void +_rl_erase_entire_line () +{ + cr (); + _rl_clear_to_eol (0); + cr (); + fflush (rl_outstream); +} + +/* return the `current display line' of the cursor -- the number of lines to + move up to get to the first screen line of the current readline line. */ +int +_rl_current_display_line () +{ + int ret, nleft; + + /* Find out whether or not there might be invisible characters in the + editing buffer. */ + if (rl_display_prompt == rl_prompt) + nleft = _rl_last_c_pos - _rl_screenwidth - rl_visible_prompt_length; + else + nleft = _rl_last_c_pos - _rl_screenwidth; + + if (nleft > 0) + ret = 1 + nleft / _rl_screenwidth; + else + ret = 0; + + return ret; +} + +#if defined (HANDLE_MULTIBYTE) +/* Calculate the number of screen columns occupied by STR from START to END. + In the case of multibyte characters with stateful encoding, we have to + scan from the beginning of the string to take the state into account. */ +static int +_rl_col_width (str, start, end, flags) + const char *str; + int start, end, flags; +{ + wchar_t wc; + mbstate_t ps; + int tmp, point, width, max; + + if (end <= start) + return 0; + if (MB_CUR_MAX == 1 || rl_byte_oriented) + /* this can happen in some cases where it's inconvenient to check */ + return (end - start); + + memset (&ps, 0, sizeof (mbstate_t)); + + point = 0; + max = end; + + /* Try to short-circuit common cases. The adjustment to remove wrap_offset + is done by the caller. */ + /* 1. prompt string */ + if (flags && start == 0 && end == local_prompt_len && memcmp (str, local_prompt, local_prompt_len) == 0) + return (prompt_physical_chars + wrap_offset); + /* 2. prompt string + line contents */ + else if (flags && start == 0 && local_prompt_len > 0 && end > local_prompt_len && local_prompt && memcmp (str, local_prompt, local_prompt_len) == 0) + { + tmp = prompt_physical_chars + wrap_offset; + /* XXX - try to call ourselves recursively with non-prompt portion */ + tmp += _rl_col_width (str, local_prompt_len, end, flags); + return (tmp); + } + + while (point < start) + { + tmp = mbrlen (str + point, max, &ps); + if (MB_INVALIDCH ((size_t)tmp)) + { + /* In this case, the bytes are invalid or too short to compose a + multibyte character, so we assume that the first byte represents + a single character. */ + point++; + max--; + + /* Clear the state of the byte sequence, because in this case the + effect of mbstate is undefined. */ + memset (&ps, 0, sizeof (mbstate_t)); + } + else if (MB_NULLWCH (tmp)) + break; /* Found '\0' */ + else + { + point += tmp; + max -= tmp; + } + } + + /* If START is not a byte that starts a character, then POINT will be + greater than START. In this case, assume that (POINT - START) gives + a byte count that is the number of columns of difference. */ + width = point - start; + + while (point < end) + { + tmp = mbrtowc (&wc, str + point, max, &ps); + if (MB_INVALIDCH ((size_t)tmp)) + { + /* In this case, the bytes are invalid or too short to compose a + multibyte character, so we assume that the first byte represents + a single character. */ + point++; + max--; + + /* and assume that the byte occupies a single column. */ + width++; + + /* Clear the state of the byte sequence, because in this case the + effect of mbstate is undefined. */ + memset (&ps, 0, sizeof (mbstate_t)); + } + else if (MB_NULLWCH (tmp)) + break; /* Found '\0' */ + else + { + point += tmp; + max -= tmp; + tmp = WCWIDTH(wc); + width += (tmp >= 0) ? tmp : 1; + } + } + + width += point - end; + + return width; +} +#endif /* HANDLE_MULTIBYTE */ diff --git a/.pc/bash43-011.diff/patchlevel.h b/.pc/bash43-011.diff/patchlevel.h new file mode 100644 index 0000000..f95b837 --- /dev/null +++ b/.pc/bash43-011.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 10 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-012.diff/jobs.c b/.pc/bash43-012.diff/jobs.c new file mode 100644 index 0000000..4982019 --- /dev/null +++ b/.pc/bash43-012.diff/jobs.c @@ -0,0 +1,4475 @@ +/* jobs.c - functions that make children, remember them, and handle their termination. */ + +/* This file works with both POSIX and BSD systems. It implements job + control. */ + +/* Copyright (C) 1989-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" +#include "trap.h" +#include +#include +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "posixtime.h" + +#if defined (HAVE_SYS_RESOURCE_H) && defined (HAVE_WAIT3) && !defined (_POSIX_VERSION) && !defined (RLIMTYPE) +# include +#endif /* !_POSIX_VERSION && HAVE_SYS_RESOURCE_H && HAVE_WAIT3 && !RLIMTYPE */ + +#if defined (HAVE_SYS_FILE_H) +# include +#endif + +#include "filecntl.h" +#include +#if defined (HAVE_SYS_PARAM_H) +#include +#endif + +#if defined (BUFFERED_INPUT) +# include "input.h" +#endif + +/* Need to include this up here for *_TTY_DRIVER definitions. */ +#include "shtty.h" + +/* Define this if your output is getting swallowed. It's a no-op on + machines with the termio or termios tty drivers. */ +/* #define DRAIN_OUTPUT */ + +/* For the TIOCGPGRP and TIOCSPGRP ioctl parameters on HP-UX */ +#if defined (hpux) && !defined (TERMIOS_TTY_DRIVER) +# include +#endif /* hpux && !TERMIOS_TTY_DRIVER */ + +#include "bashansi.h" +#include "bashintl.h" +#include "shell.h" +#include "jobs.h" +#include "execute_cmd.h" +#include "flags.h" + +#include "builtins/builtext.h" +#include "builtins/common.h" + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +#if !defined (HAVE_KILLPG) +extern int killpg __P((pid_t, int)); +#endif + +#if !DEFAULT_CHILD_MAX +# define DEFAULT_CHILD_MAX 32 +#endif + +#if !MAX_CHILD_MAX +# define MAX_CHILD_MAX 8192 +#endif + +#if !defined (DEBUG) +#define MAX_JOBS_IN_ARRAY 4096 /* production */ +#else +#define MAX_JOBS_IN_ARRAY 128 /* testing */ +#endif + +/* Flag values for second argument to delete_job */ +#define DEL_WARNSTOPPED 1 /* warn about deleting stopped jobs */ +#define DEL_NOBGPID 2 /* don't add pgrp leader to bgpids */ + +/* Take care of system dependencies that must be handled when waiting for + children. The arguments to the WAITPID macro match those to the Posix.1 + waitpid() function. */ + +#if defined (ultrix) && defined (mips) && defined (_POSIX_VERSION) +# define WAITPID(pid, statusp, options) \ + wait3 ((union wait *)statusp, options, (struct rusage *)0) +#else +# if defined (_POSIX_VERSION) || defined (HAVE_WAITPID) +# define WAITPID(pid, statusp, options) \ + waitpid ((pid_t)pid, statusp, options) +# else +# if defined (HAVE_WAIT3) +# define WAITPID(pid, statusp, options) \ + wait3 (statusp, options, (struct rusage *)0) +# else +# define WAITPID(pid, statusp, options) \ + wait3 (statusp, options, (int *)0) +# endif /* HAVE_WAIT3 */ +# endif /* !_POSIX_VERSION && !HAVE_WAITPID*/ +#endif /* !(Ultrix && mips && _POSIX_VERSION) */ + +/* getpgrp () varies between systems. Even systems that claim to be + Posix.1 compatible lie sometimes (Ultrix, SunOS4, apollo). */ +#if defined (GETPGRP_VOID) +# define getpgid(p) getpgrp () +#else +# define getpgid(p) getpgrp (p) +#endif /* !GETPGRP_VOID */ + +/* If the system needs it, REINSTALL_SIGCHLD_HANDLER will reinstall the + handler for SIGCHLD. */ +#if defined (MUST_REINSTALL_SIGHANDLERS) +# define REINSTALL_SIGCHLD_HANDLER signal (SIGCHLD, sigchld_handler) +#else +# define REINSTALL_SIGCHLD_HANDLER +#endif /* !MUST_REINSTALL_SIGHANDLERS */ + +/* Some systems let waitpid(2) tell callers about stopped children. */ +#if !defined (WCONTINUED) || defined (WCONTINUED_BROKEN) +# undef WCONTINUED +# define WCONTINUED 0 +#endif +#if !defined (WIFCONTINUED) +# define WIFCONTINUED(s) (0) +#endif + +/* The number of additional slots to allocate when we run out. */ +#define JOB_SLOTS 8 + +typedef int sh_job_map_func_t __P((JOB *, int, int, int)); + +/* Variables used here but defined in other files. */ +extern int subshell_environment, line_number; +extern int posixly_correct, shell_level; +extern int last_command_exit_value, last_command_exit_signal; +extern int loop_level, breaking; +extern int executing_list; +extern int sourcelevel; +extern int running_trap; +extern sh_builtin_func_t *this_shell_builtin; +extern char *shell_name, *this_command_name; +extern sigset_t top_level_mask; +extern procenv_t wait_intr_buf; +extern int wait_signal_received; +extern WORD_LIST *subst_assign_varlist; + +static struct jobstats zerojs = { -1L, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NO_JOB, NO_JOB, 0, 0 }; +struct jobstats js = { -1L, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NO_JOB, NO_JOB, 0, 0 }; + +struct bgpids bgpids = { 0, 0, 0 }; + +/* The array of known jobs. */ +JOB **jobs = (JOB **)NULL; + +#if 0 +/* The number of slots currently allocated to JOBS. */ +int job_slots = 0; +#endif + +/* The controlling tty for this shell. */ +int shell_tty = -1; + +/* The shell's process group. */ +pid_t shell_pgrp = NO_PID; + +/* The terminal's process group. */ +pid_t terminal_pgrp = NO_PID; + +/* The process group of the shell's parent. */ +pid_t original_pgrp = NO_PID; + +/* The process group of the pipeline currently being made. */ +pid_t pipeline_pgrp = (pid_t)0; + +#if defined (PGRP_PIPE) +/* Pipes which each shell uses to communicate with the process group leader + until all of the processes in a pipeline have been started. Then the + process leader is allowed to continue. */ +int pgrp_pipe[2] = { -1, -1 }; +#endif + +#if 0 +/* The job which is current; i.e. the one that `%+' stands for. */ +int current_job = NO_JOB; + +/* The previous job; i.e. the one that `%-' stands for. */ +int previous_job = NO_JOB; +#endif + +/* Last child made by the shell. */ +volatile pid_t last_made_pid = NO_PID; + +/* Pid of the last asynchronous child. */ +volatile pid_t last_asynchronous_pid = NO_PID; + +/* The pipeline currently being built. */ +PROCESS *the_pipeline = (PROCESS *)NULL; + +/* If this is non-zero, do job control. */ +int job_control = 1; + +/* Call this when you start making children. */ +int already_making_children = 0; + +/* If this is non-zero, $LINES and $COLUMNS are reset after every process + exits from get_tty_state(). */ +int check_window_size = CHECKWINSIZE_DEFAULT; + +/* Functions local to this file. */ + +static sighandler wait_sigint_handler __P((int)); +static sighandler sigchld_handler __P((int)); +static sighandler sigcont_sighandler __P((int)); +static sighandler sigstop_sighandler __P((int)); + +static int waitchld __P((pid_t, int)); + +static PROCESS *find_pipeline __P((pid_t, int, int *)); +static PROCESS *find_process __P((pid_t, int, int *)); + +static char *current_working_directory __P((void)); +static char *job_working_directory __P((void)); +static char *j_strsignal __P((int)); +static char *printable_job_status __P((int, PROCESS *, int)); + +static PROCESS *find_last_proc __P((int, int)); +static pid_t find_last_pid __P((int, int)); + +static int set_new_line_discipline __P((int)); +static int map_over_jobs __P((sh_job_map_func_t *, int, int)); +static int job_last_stopped __P((int)); +static int job_last_running __P((int)); +static int most_recent_job_in_state __P((int, JOB_STATE)); +static int find_job __P((pid_t, int, PROCESS **)); +static int print_job __P((JOB *, int, int, int)); +static int process_exit_status __P((WAIT)); +static int process_exit_signal __P((WAIT)); +static int set_job_status_and_cleanup __P((int)); + +static WAIT job_signal_status __P((int)); +static WAIT raw_job_exit_status __P((int)); + +static void notify_of_job_status __P((void)); +static void reset_job_indices __P((void)); +static void cleanup_dead_jobs __P((void)); +static int processes_in_job __P((int)); +static void realloc_jobs_list __P((void)); +static int compact_jobs_list __P((int)); +static int discard_pipeline __P((PROCESS *)); +static void add_process __P((char *, pid_t)); +static void print_pipeline __P((PROCESS *, int, int, FILE *)); +static void pretty_print_job __P((int, int, FILE *)); +static void set_current_job __P((int)); +static void reset_current __P((void)); +static void set_job_running __P((int)); +static void setjstatus __P((int)); +static int maybe_give_terminal_to __P((pid_t, pid_t, int)); +static void mark_all_jobs_as_dead __P((void)); +static void mark_dead_jobs_as_notified __P((int)); +static void restore_sigint_handler __P((void)); +#if defined (PGRP_PIPE) +static void pipe_read __P((int *)); +#endif + +static struct pidstat *bgp_alloc __P((pid_t, int)); +static struct pidstat *bgp_add __P((pid_t, int)); +static int bgp_delete __P((pid_t)); +static void bgp_clear __P((void)); +static int bgp_search __P((pid_t)); +static void bgp_prune __P((void)); + +#if defined (ARRAY_VARS) +static int *pstatuses; /* list of pipeline statuses */ +static int statsize; +#endif + +/* Used to synchronize between wait_for and other functions and the SIGCHLD + signal handler. */ +static int sigchld; +static int queue_sigchld; + +#define QUEUE_SIGCHLD(os) (os) = sigchld, queue_sigchld++ + +#define UNQUEUE_SIGCHLD(os) \ + do { \ + queue_sigchld--; \ + if (queue_sigchld == 0 && os != sigchld) \ + waitchld (-1, 0); \ + } while (0) + +static SigHandler *old_tstp, *old_ttou, *old_ttin; +static SigHandler *old_cont = (SigHandler *)SIG_DFL; + +/* A place to temporarily save the current pipeline. */ +static PROCESS *saved_pipeline; +static int saved_already_making_children; + +/* Set this to non-zero whenever you don't want the jobs list to change at + all: no jobs deleted and no status change notifications. This is used, + for example, when executing SIGCHLD traps, which may run arbitrary + commands. */ +static int jobs_list_frozen; + +static char retcode_name_buffer[64]; + +#if !defined (_POSIX_VERSION) + +/* These are definitions to map POSIX 1003.1 functions onto existing BSD + library functions and system calls. */ +#define setpgid(pid, pgrp) setpgrp (pid, pgrp) +#define tcsetpgrp(fd, pgrp) ioctl ((fd), TIOCSPGRP, &(pgrp)) + +pid_t +tcgetpgrp (fd) + int fd; +{ + pid_t pgrp; + + /* ioctl will handle setting errno correctly. */ + if (ioctl (fd, TIOCGPGRP, &pgrp) < 0) + return (-1); + return (pgrp); +} + +#endif /* !_POSIX_VERSION */ + +/* Initialize the global job stats structure and other bookkeeping variables */ +void +init_job_stats () +{ + js = zerojs; +} + +/* Return the working directory for the current process. Unlike + job_working_directory, this does not call malloc (), nor do any + of the functions it calls. This is so that it can safely be called + from a signal handler. */ +static char * +current_working_directory () +{ + char *dir; + static char d[PATH_MAX]; + + dir = get_string_value ("PWD"); + + if (dir == 0 && the_current_working_directory && no_symbolic_links) + dir = the_current_working_directory; + + if (dir == 0) + { + dir = getcwd (d, sizeof(d)); + if (dir) + dir = d; + } + + return (dir == 0) ? "" : dir; +} + +/* Return the working directory for the current process. */ +static char * +job_working_directory () +{ + char *dir; + + dir = get_string_value ("PWD"); + if (dir) + return (savestring (dir)); + + dir = get_working_directory ("job-working-directory"); + if (dir) + return (dir); + + return (savestring ("")); +} + +void +making_children () +{ + if (already_making_children) + return; + + already_making_children = 1; + start_pipeline (); +} + +void +stop_making_children () +{ + already_making_children = 0; +} + +void +cleanup_the_pipeline () +{ + PROCESS *disposer; + sigset_t set, oset; + + BLOCK_CHILD (set, oset); + disposer = the_pipeline; + the_pipeline = (PROCESS *)NULL; + UNBLOCK_CHILD (oset); + + if (disposer) + discard_pipeline (disposer); +} + +void +save_pipeline (clear) + int clear; +{ + saved_pipeline = the_pipeline; + if (clear) + the_pipeline = (PROCESS *)NULL; + saved_already_making_children = already_making_children; +} + +void +restore_pipeline (discard) + int discard; +{ + PROCESS *old_pipeline; + + old_pipeline = the_pipeline; + the_pipeline = saved_pipeline; + already_making_children = saved_already_making_children; + if (discard && old_pipeline) + discard_pipeline (old_pipeline); +} + +/* Start building a pipeline. */ +void +start_pipeline () +{ + if (the_pipeline) + { + cleanup_the_pipeline (); + pipeline_pgrp = 0; +#if defined (PGRP_PIPE) + sh_closepipe (pgrp_pipe); +#endif + } + +#if defined (PGRP_PIPE) + if (job_control) + { + if (pipe (pgrp_pipe) == -1) + sys_error (_("start_pipeline: pgrp pipe")); + } +#endif +} + +/* Stop building a pipeline. Install the process list in the job array. + This returns the index of the newly installed job. + DEFERRED is a command structure to be executed upon satisfactory + execution exit of this pipeline. */ +int +stop_pipeline (async, deferred) + int async; + COMMAND *deferred; +{ + register int i, j; + JOB *newjob; + sigset_t set, oset; + + BLOCK_CHILD (set, oset); + +#if defined (PGRP_PIPE) + /* The parent closes the process group synchronization pipe. */ + sh_closepipe (pgrp_pipe); +#endif + + cleanup_dead_jobs (); + + if (js.j_jobslots == 0) + { + js.j_jobslots = JOB_SLOTS; + jobs = (JOB **)xmalloc (js.j_jobslots * sizeof (JOB *)); + + /* Now blank out these new entries. */ + for (i = 0; i < js.j_jobslots; i++) + jobs[i] = (JOB *)NULL; + + js.j_firstj = js.j_lastj = js.j_njobs = 0; + } + + /* Scan from the last slot backward, looking for the next free one. */ + /* XXX - revisit this interactive assumption */ + /* XXX - this way for now */ + if (interactive) + { + for (i = js.j_jobslots; i; i--) + if (jobs[i - 1]) + break; + } + else + { +#if 0 + /* This wraps around, but makes it inconvenient to extend the array */ + for (i = js.j_lastj+1; i != js.j_lastj; i++) + { + if (i >= js.j_jobslots) + i = 0; + if (jobs[i] == 0) + break; + } + if (i == js.j_lastj) + i = js.j_jobslots; +#else + /* This doesn't wrap around yet. */ + for (i = js.j_lastj ? js.j_lastj + 1 : js.j_lastj; i < js.j_jobslots; i++) + if (jobs[i] == 0) + break; +#endif + } + + /* Do we need more room? */ + + /* First try compaction */ + if ((interactive_shell == 0 || subshell_environment) && i == js.j_jobslots && js.j_jobslots >= MAX_JOBS_IN_ARRAY) + i = compact_jobs_list (0); + + /* If we can't compact, reallocate */ + if (i == js.j_jobslots) + { + js.j_jobslots += JOB_SLOTS; + jobs = (JOB **)xrealloc (jobs, (js.j_jobslots * sizeof (JOB *))); + + for (j = i; j < js.j_jobslots; j++) + jobs[j] = (JOB *)NULL; + } + + /* Add the current pipeline to the job list. */ + if (the_pipeline) + { + register PROCESS *p; + int any_running, any_stopped, n; + + newjob = (JOB *)xmalloc (sizeof (JOB)); + + for (n = 1, p = the_pipeline; p->next != the_pipeline; n++, p = p->next) + ; + p->next = (PROCESS *)NULL; + newjob->pipe = REVERSE_LIST (the_pipeline, PROCESS *); + for (p = newjob->pipe; p->next; p = p->next) + ; + p->next = newjob->pipe; + + the_pipeline = (PROCESS *)NULL; + newjob->pgrp = pipeline_pgrp; + pipeline_pgrp = 0; + + newjob->flags = 0; + + /* Flag to see if in another pgrp. */ + if (job_control) + newjob->flags |= J_JOBCONTROL; + + /* Set the state of this pipeline. */ + p = newjob->pipe; + any_running = any_stopped = 0; + do + { + any_running |= PRUNNING (p); + any_stopped |= PSTOPPED (p); + p = p->next; + } + while (p != newjob->pipe); + + newjob->state = any_running ? JRUNNING : (any_stopped ? JSTOPPED : JDEAD); + newjob->wd = job_working_directory (); + newjob->deferred = deferred; + + newjob->j_cleanup = (sh_vptrfunc_t *)NULL; + newjob->cleanarg = (PTR_T) NULL; + + jobs[i] = newjob; + if (newjob->state == JDEAD && (newjob->flags & J_FOREGROUND)) + setjstatus (i); + if (newjob->state == JDEAD) + { + js.c_reaped += n; /* wouldn't have been done since this was not part of a job */ + js.j_ndead++; + } + js.c_injobs += n; + + js.j_lastj = i; + js.j_njobs++; + } + else + newjob = (JOB *)NULL; + + if (newjob) + js.j_lastmade = newjob; + + if (async) + { + if (newjob) + { + newjob->flags &= ~J_FOREGROUND; + newjob->flags |= J_ASYNC; + js.j_lastasync = newjob; + } + reset_current (); + } + else + { + if (newjob) + { + newjob->flags |= J_FOREGROUND; + /* + * !!!!! NOTE !!!!! (chet@ins.cwru.edu) + * + * The currently-accepted job control wisdom says to set the + * terminal's process group n+1 times in an n-step pipeline: + * once in the parent and once in each child. This is where + * the parent gives it away. + * + * Don't give the terminal away if this shell is an asynchronous + * subshell. + * + */ + if (job_control && newjob->pgrp && (subshell_environment&SUBSHELL_ASYNC) == 0) + maybe_give_terminal_to (shell_pgrp, newjob->pgrp, 0); + } + } + + stop_making_children (); + UNBLOCK_CHILD (oset); + return (newjob ? i : js.j_current); +} + +/* Functions to manage the list of exited background pids whose status has + been saved. */ + +static struct pidstat * +bgp_alloc (pid, status) + pid_t pid; + int status; +{ + struct pidstat *ps; + + ps = (struct pidstat *)xmalloc (sizeof (struct pidstat)); + ps->pid = pid; + ps->status = status; + ps->next = (struct pidstat *)0; + return ps; +} + +static struct pidstat * +bgp_add (pid, status) + pid_t pid; + int status; +{ + struct pidstat *ps; + + ps = bgp_alloc (pid, status); + + if (bgpids.list == 0) + { + bgpids.list = bgpids.end = ps; + bgpids.npid = 0; /* just to make sure */ + } + else + { + bgpids.end->next = ps; + bgpids.end = ps; + } + bgpids.npid++; + + if (bgpids.npid > js.c_childmax) + bgp_prune (); + + return ps; +} + +static int +bgp_delete (pid) + pid_t pid; +{ + struct pidstat *prev, *p; + + for (prev = p = bgpids.list; p; prev = p, p = p->next) + if (p->pid == pid) + { + prev->next = p->next; /* remove from list */ + break; + } + + if (p == 0) + return 0; /* not found */ + +#if defined (DEBUG) + itrace("bgp_delete: deleting %d", pid); +#endif + + /* Housekeeping in the border cases. */ + if (p == bgpids.list) + bgpids.list = bgpids.list->next; + else if (p == bgpids.end) + bgpids.end = prev; + + bgpids.npid--; + if (bgpids.npid == 0) + bgpids.list = bgpids.end = 0; + else if (bgpids.npid == 1) + bgpids.end = bgpids.list; /* just to make sure */ + + free (p); + return 1; +} + +/* Clear out the list of saved statuses */ +static void +bgp_clear () +{ + struct pidstat *ps, *p; + + for (ps = bgpids.list; ps; ) + { + p = ps; + ps = ps->next; + free (p); + } + bgpids.list = bgpids.end = 0; + bgpids.npid = 0; +} + +/* Search for PID in the list of saved background pids; return its status if + found. If not found, return -1. */ +static int +bgp_search (pid) + pid_t pid; +{ + struct pidstat *ps; + + for (ps = bgpids.list ; ps; ps = ps->next) + if (ps->pid == pid) + return ps->status; + return -1; +} + +static void +bgp_prune () +{ + struct pidstat *ps; + + while (bgpids.npid > js.c_childmax) + { + ps = bgpids.list; + bgpids.list = bgpids.list->next; + free (ps); + bgpids.npid--; + } +} + +/* Reset the values of js.j_lastj and js.j_firstj after one or both have + been deleted. The caller should check whether js.j_njobs is 0 before + calling this. This wraps around, but the rest of the code does not. At + this point, it should not matter. */ +static void +reset_job_indices () +{ + int old; + + if (jobs[js.j_firstj] == 0) + { + old = js.j_firstj++; + if (old >= js.j_jobslots) + old = js.j_jobslots - 1; + while (js.j_firstj != old) + { + if (js.j_firstj >= js.j_jobslots) + js.j_firstj = 0; + if (jobs[js.j_firstj] || js.j_firstj == old) /* needed if old == 0 */ + break; + js.j_firstj++; + } + if (js.j_firstj == old) + js.j_firstj = js.j_lastj = js.j_njobs = 0; + } + if (jobs[js.j_lastj] == 0) + { + old = js.j_lastj--; + if (old < 0) + old = 0; + while (js.j_lastj != old) + { + if (js.j_lastj < 0) + js.j_lastj = js.j_jobslots - 1; + if (jobs[js.j_lastj] || js.j_lastj == old) /* needed if old == js.j_jobslots */ + break; + js.j_lastj--; + } + if (js.j_lastj == old) + js.j_firstj = js.j_lastj = js.j_njobs = 0; + } +} + +/* Delete all DEAD jobs that the user had received notification about. */ +static void +cleanup_dead_jobs () +{ + register int i; + int os; + + if (js.j_jobslots == 0 || jobs_list_frozen) + return; + + QUEUE_SIGCHLD(os); + + /* XXX could use js.j_firstj and js.j_lastj here */ + for (i = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("cleanup_dead_jobs: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("cleanup_dead_jobs: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + + if (jobs[i] && DEADJOB (i) && IS_NOTIFIED (i)) + delete_job (i, 0); + } + +#if defined (COPROCESS_SUPPORT) + coproc_reap (); +#endif + + UNQUEUE_SIGCHLD(os); +} + +static int +processes_in_job (job) + int job; +{ + int nproc; + register PROCESS *p; + + nproc = 0; + p = jobs[job]->pipe; + do + { + p = p->next; + nproc++; + } + while (p != jobs[job]->pipe); + + return nproc; +} + +static void +delete_old_job (pid) + pid_t pid; +{ + PROCESS *p; + int job; + + job = find_job (pid, 0, &p); + if (job != NO_JOB) + { +#ifdef DEBUG + itrace ("delete_old_job: found pid %d in job %d with state %d", pid, job, jobs[job]->state); +#endif + if (JOBSTATE (job) == JDEAD) + delete_job (job, DEL_NOBGPID); + else + { +#ifdef DEBUG + internal_warning (_("forked pid %d appears in running job %d"), pid, job+1); +#endif + if (p) + p->pid = 0; + } + } +} + +/* Reallocate and compress the jobs list. This returns with a jobs array + whose size is a multiple of JOB_SLOTS and can hold the current number of + jobs. Heuristics are used to minimize the number of new reallocs. */ +static void +realloc_jobs_list () +{ + sigset_t set, oset; + int nsize, i, j, ncur, nprev; + JOB **nlist; + + ncur = nprev = NO_JOB; + nsize = ((js.j_njobs + JOB_SLOTS - 1) / JOB_SLOTS); + nsize *= JOB_SLOTS; + i = js.j_njobs % JOB_SLOTS; + if (i == 0 || i > (JOB_SLOTS >> 1)) + nsize += JOB_SLOTS; + + BLOCK_CHILD (set, oset); + nlist = (js.j_jobslots == nsize) ? jobs : (JOB **) xmalloc (nsize * sizeof (JOB *)); + + js.c_reaped = js.j_ndead = 0; + for (i = j = 0; i < js.j_jobslots; i++) + if (jobs[i]) + { + if (i == js.j_current) + ncur = j; + if (i == js.j_previous) + nprev = j; + nlist[j++] = jobs[i]; + if (jobs[i]->state == JDEAD) + { + js.j_ndead++; + js.c_reaped += processes_in_job (i); + } + } + +#if 0 + itrace ("realloc_jobs_list: resize jobs list from %d to %d", js.j_jobslots, nsize); + itrace ("realloc_jobs_list: j_lastj changed from %d to %d", js.j_lastj, (j > 0) ? j - 1 : 0); + itrace ("realloc_jobs_list: j_njobs changed from %d to %d", js.j_njobs, j); + itrace ("realloc_jobs_list: js.j_ndead %d js.c_reaped %d", js.j_ndead, js.c_reaped); +#endif + + js.j_firstj = 0; + js.j_lastj = (j > 0) ? j - 1 : 0; + js.j_njobs = j; + js.j_jobslots = nsize; + + /* Zero out remaining slots in new jobs list */ + for ( ; j < nsize; j++) + nlist[j] = (JOB *)NULL; + + if (jobs != nlist) + { + free (jobs); + jobs = nlist; + } + + if (ncur != NO_JOB) + js.j_current = ncur; + if (nprev != NO_JOB) + js.j_previous = nprev; + + /* Need to reset these */ + if (js.j_current == NO_JOB || js.j_previous == NO_JOB || js.j_current > js.j_lastj || js.j_previous > js.j_lastj) + reset_current (); + +#if 0 + itrace ("realloc_jobs_list: reset js.j_current (%d) and js.j_previous (%d)", js.j_current, js.j_previous); +#endif + + UNBLOCK_CHILD (oset); +} + +/* Compact the jobs list by removing dead jobs. Assume that we have filled + the jobs array to some predefined maximum. Called when the shell is not + the foreground process (subshell_environment != 0). Returns the first + available slot in the compacted list. If that value is js.j_jobslots, then + the list needs to be reallocated. The jobs array may be in new memory if + this returns > 0 and < js.j_jobslots. FLAGS is reserved for future use. */ +static int +compact_jobs_list (flags) + int flags; +{ + if (js.j_jobslots == 0 || jobs_list_frozen) + return js.j_jobslots; + + reap_dead_jobs (); + realloc_jobs_list (); + +#if 0 + itrace("compact_jobs_list: returning %d", (js.j_lastj || jobs[js.j_lastj]) ? js.j_lastj + 1 : 0); +#endif + + return ((js.j_lastj || jobs[js.j_lastj]) ? js.j_lastj + 1 : 0); +} + +/* Delete the job at INDEX from the job list. Must be called + with SIGCHLD blocked. */ +void +delete_job (job_index, dflags) + int job_index, dflags; +{ + register JOB *temp; + PROCESS *proc; + int ndel; + + if (js.j_jobslots == 0 || jobs_list_frozen) + return; + + if ((dflags & DEL_WARNSTOPPED) && subshell_environment == 0 && STOPPED (job_index)) + internal_warning (_("deleting stopped job %d with process group %ld"), job_index+1, (long)jobs[job_index]->pgrp); + temp = jobs[job_index]; + if (temp == 0) + return; + + if ((dflags & DEL_NOBGPID) == 0) + { + proc = find_last_proc (job_index, 0); + /* Could do this just for J_ASYNC jobs, but we save all. */ + if (proc) + bgp_add (proc->pid, process_exit_status (proc->status)); + } + + jobs[job_index] = (JOB *)NULL; + if (temp == js.j_lastmade) + js.j_lastmade = 0; + else if (temp == js.j_lastasync) + js.j_lastasync = 0; + + free (temp->wd); + ndel = discard_pipeline (temp->pipe); + + js.c_injobs -= ndel; + if (temp->state == JDEAD) + { + js.c_reaped -= ndel; + js.j_ndead--; + if (js.c_reaped < 0) + { +#ifdef DEBUG + itrace("delete_job (%d pgrp %d): js.c_reaped (%d) < 0 ndel = %d js.j_ndead = %d", job_index, temp->pgrp, js.c_reaped, ndel, js.j_ndead); +#endif + js.c_reaped = 0; + } + } + + if (temp->deferred) + dispose_command (temp->deferred); + + free (temp); + + js.j_njobs--; + if (js.j_njobs == 0) + js.j_firstj = js.j_lastj = 0; + else if (jobs[js.j_firstj] == 0 || jobs[js.j_lastj] == 0) + reset_job_indices (); + + if (job_index == js.j_current || job_index == js.j_previous) + reset_current (); +} + +/* Must be called with SIGCHLD blocked. */ +void +nohup_job (job_index) + int job_index; +{ + register JOB *temp; + + if (js.j_jobslots == 0) + return; + + if (temp = jobs[job_index]) + temp->flags |= J_NOHUP; +} + +/* Get rid of the data structure associated with a process chain. */ +static int +discard_pipeline (chain) + register PROCESS *chain; +{ + register PROCESS *this, *next; + int n; + + this = chain; + n = 0; + do + { + next = this->next; + FREE (this->command); + free (this); + n++; + this = next; + } + while (this != chain); + + return n; +} + +/* Add this process to the chain being built in the_pipeline. + NAME is the command string that will be exec'ed later. + PID is the process id of the child. */ +static void +add_process (name, pid) + char *name; + pid_t pid; +{ + PROCESS *t, *p; + +#if defined (RECYCLES_PIDS) + int j; + p = find_process (pid, 0, &j); + if (p) + { +# ifdef DEBUG + if (j == NO_JOB) + internal_warning (_("add_process: process %5ld (%s) in the_pipeline"), (long)p->pid, p->command); +# endif + if (PALIVE (p)) + internal_warning (_("add_process: pid %5ld (%s) marked as still alive"), (long)p->pid, p->command); + p->running = PS_RECYCLED; /* mark as recycled */ + } +#endif + + t = (PROCESS *)xmalloc (sizeof (PROCESS)); + t->next = the_pipeline; + t->pid = pid; + WSTATUS (t->status) = 0; + t->running = PS_RUNNING; + t->command = name; + the_pipeline = t; + + if (t->next == 0) + t->next = t; + else + { + p = t->next; + while (p->next != t->next) + p = p->next; + p->next = t; + } +} + +/* Create a (dummy) PROCESS with NAME, PID, and STATUS, and make it the last + process in jobs[JID]->pipe. Used by the lastpipe code. */ +void +append_process (name, pid, status, jid) + char *name; + pid_t pid; + int status; + int jid; +{ + PROCESS *t, *p; + + t = (PROCESS *)xmalloc (sizeof (PROCESS)); + t->next = (PROCESS *)NULL; + t->pid = pid; + /* set process exit status using offset discovered by configure */ + t->status = (status & 0xff) << WEXITSTATUS_OFFSET; + t->running = PS_DONE; + t->command = name; + + js.c_reaped++; /* XXX */ + + for (p = jobs[jid]->pipe; p->next != jobs[jid]->pipe; p = p->next) + ; + p->next = t; + t->next = jobs[jid]->pipe; +} + +#if 0 +/* Take the last job and make it the first job. Must be called with + SIGCHLD blocked. */ +int +rotate_the_pipeline () +{ + PROCESS *p; + + if (the_pipeline->next == the_pipeline) + return; + for (p = the_pipeline; p->next != the_pipeline; p = p->next) + ; + the_pipeline = p; +} + +/* Reverse the order of the processes in the_pipeline. Must be called with + SIGCHLD blocked. */ +int +reverse_the_pipeline () +{ + PROCESS *p, *n; + + if (the_pipeline->next == the_pipeline) + return; + + for (p = the_pipeline; p->next != the_pipeline; p = p->next) + ; + p->next = (PROCESS *)NULL; + + n = REVERSE_LIST (the_pipeline, PROCESS *); + + the_pipeline = n; + for (p = the_pipeline; p->next; p = p->next) + ; + p->next = the_pipeline; +} +#endif + +/* Map FUNC over the list of jobs. If FUNC returns non-zero, + then it is time to stop mapping, and that is the return value + for map_over_jobs. FUNC is called with a JOB, arg1, arg2, + and INDEX. */ +static int +map_over_jobs (func, arg1, arg2) + sh_job_map_func_t *func; + int arg1, arg2; +{ + register int i; + int result; + sigset_t set, oset; + + if (js.j_jobslots == 0) + return 0; + + BLOCK_CHILD (set, oset); + + /* XXX could use js.j_firstj here */ + for (i = result = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("map_over_jobs: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("map_over_jobs: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + if (jobs[i]) + { + result = (*func)(jobs[i], arg1, arg2, i); + if (result) + break; + } + } + + UNBLOCK_CHILD (oset); + + return (result); +} + +/* Cause all the jobs in the current pipeline to exit. */ +void +terminate_current_pipeline () +{ + if (pipeline_pgrp && pipeline_pgrp != shell_pgrp) + { + killpg (pipeline_pgrp, SIGTERM); + killpg (pipeline_pgrp, SIGCONT); + } +} + +/* Cause all stopped jobs to exit. */ +void +terminate_stopped_jobs () +{ + register int i; + + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + { + if (jobs[i] && STOPPED (i)) + { + killpg (jobs[i]->pgrp, SIGTERM); + killpg (jobs[i]->pgrp, SIGCONT); + } + } +} + +/* Cause all jobs, running or stopped, to receive a hangup signal. If + a job is marked J_NOHUP, don't send the SIGHUP. */ +void +hangup_all_jobs () +{ + register int i; + + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + { + if (jobs[i]) + { + if (jobs[i]->flags & J_NOHUP) + continue; + killpg (jobs[i]->pgrp, SIGHUP); + if (STOPPED (i)) + killpg (jobs[i]->pgrp, SIGCONT); + } + } +} + +void +kill_current_pipeline () +{ + stop_making_children (); + start_pipeline (); +} + +/* Return the pipeline that PID belongs to. Note that the pipeline + doesn't have to belong to a job. Must be called with SIGCHLD blocked. + If JOBP is non-null, return the index of the job containing PID. */ +static PROCESS * +find_pipeline (pid, alive_only, jobp) + pid_t pid; + int alive_only; + int *jobp; /* index into jobs list or NO_JOB */ +{ + int job; + PROCESS *p; + + /* See if this process is in the pipeline that we are building. */ + if (jobp) + *jobp = NO_JOB; + if (the_pipeline) + { + p = the_pipeline; + do + { + /* Return it if we found it. Don't ever return a recycled pid. */ + if (p->pid == pid && ((alive_only == 0 && PRECYCLED(p) == 0) || PALIVE(p))) + return (p); + + p = p->next; + } + while (p != the_pipeline); + } + + job = find_job (pid, alive_only, &p); + if (jobp) + *jobp = job; + return (job == NO_JOB) ? (PROCESS *)NULL : jobs[job]->pipe; +} + +/* Return the PROCESS * describing PID. If JOBP is non-null return the index + into the jobs array of the job containing PID. Must be called with + SIGCHLD blocked. */ +static PROCESS * +find_process (pid, alive_only, jobp) + pid_t pid; + int alive_only; + int *jobp; /* index into jobs list or NO_JOB */ +{ + PROCESS *p; + + p = find_pipeline (pid, alive_only, jobp); + while (p && p->pid != pid) + p = p->next; + return p; +} + +/* Return the job index that PID belongs to, or NO_JOB if it doesn't + belong to any job. Must be called with SIGCHLD blocked. */ +static int +find_job (pid, alive_only, procp) + pid_t pid; + int alive_only; + PROCESS **procp; +{ + register int i; + PROCESS *p; + + /* XXX could use js.j_firstj here, and should check js.j_lastj */ + for (i = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("find_job: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("find_job: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + if (jobs[i]) + { + p = jobs[i]->pipe; + + do + { + if (p->pid == pid && ((alive_only == 0 && PRECYCLED(p) == 0) || PALIVE(p))) + { + if (procp) + *procp = p; + return (i); + } + + p = p->next; + } + while (p != jobs[i]->pipe); + } + } + + return (NO_JOB); +} + +/* Find a job given a PID. If BLOCK is non-zero, block SIGCHLD as + required by find_job. */ +int +get_job_by_pid (pid, block) + pid_t pid; + int block; +{ + int job; + sigset_t set, oset; + + if (block) + BLOCK_CHILD (set, oset); + + job = find_job (pid, 0, NULL); + + if (block) + UNBLOCK_CHILD (oset); + + return job; +} + +/* Print descriptive information about the job with leader pid PID. */ +void +describe_pid (pid) + pid_t pid; +{ + int job; + sigset_t set, oset; + + BLOCK_CHILD (set, oset); + + job = find_job (pid, 0, NULL); + + if (job != NO_JOB) + fprintf (stderr, "[%d] %ld\n", job + 1, (long)pid); + else + programming_error (_("describe_pid: %ld: no such pid"), (long)pid); + + UNBLOCK_CHILD (oset); +} + +static char * +j_strsignal (s) + int s; +{ + char *x; + + x = strsignal (s); + if (x == 0) + { + x = retcode_name_buffer; + sprintf (x, _("Signal %d"), s); + } + return x; +} + +static char * +printable_job_status (j, p, format) + int j; + PROCESS *p; + int format; +{ + static char *temp; + int es; + + temp = _("Done"); + + if (STOPPED (j) && format == 0) + { + if (posixly_correct == 0 || p == 0 || (WIFSTOPPED (p->status) == 0)) + temp = _("Stopped"); + else + { + temp = retcode_name_buffer; + sprintf (temp, _("Stopped(%s)"), signal_name (WSTOPSIG (p->status))); + } + } + else if (RUNNING (j)) + temp = _("Running"); + else + { + if (WIFSTOPPED (p->status)) + temp = j_strsignal (WSTOPSIG (p->status)); + else if (WIFSIGNALED (p->status)) + temp = j_strsignal (WTERMSIG (p->status)); + else if (WIFEXITED (p->status)) + { + temp = retcode_name_buffer; + es = WEXITSTATUS (p->status); + if (es == 0) + strcpy (temp, _("Done")); + else if (posixly_correct) + sprintf (temp, _("Done(%d)"), es); + else + sprintf (temp, _("Exit %d"), es); + } + else + temp = _("Unknown status"); + } + + return temp; +} + +/* This is the way to print out information on a job if you + know the index. FORMAT is: + + JLIST_NORMAL) [1]+ Running emacs + JLIST_LONG ) [1]+ 2378 Running emacs + -1 ) [1]+ 2378 emacs + + JLIST_NORMAL) [1]+ Stopped ls | more + JLIST_LONG ) [1]+ 2369 Stopped ls + 2367 | more + JLIST_PID_ONLY) + Just list the pid of the process group leader (really + the process group). + JLIST_CHANGED_ONLY) + Use format JLIST_NORMAL, but list only jobs about which + the user has not been notified. */ + +/* Print status for pipeline P. If JOB_INDEX is >= 0, it is the index into + the JOBS array corresponding to this pipeline. FORMAT is as described + above. Must be called with SIGCHLD blocked. + + If you're printing a pipeline that's not in the jobs array, like the + current pipeline as it's being created, pass -1 for JOB_INDEX */ +static void +print_pipeline (p, job_index, format, stream) + PROCESS *p; + int job_index, format; + FILE *stream; +{ + PROCESS *first, *last, *show; + int es, name_padding; + char *temp; + + if (p == 0) + return; + + first = last = p; + while (last->next != first) + last = last->next; + + for (;;) + { + if (p != first) + fprintf (stream, format ? " " : " |"); + + if (format != JLIST_STANDARD) + fprintf (stream, "%5ld", (long)p->pid); + + fprintf (stream, " "); + + if (format > -1 && job_index >= 0) + { + show = format ? p : last; + temp = printable_job_status (job_index, show, format); + + if (p != first) + { + if (format) + { + if (show->running == first->running && + WSTATUS (show->status) == WSTATUS (first->status)) + temp = ""; + } + else + temp = (char *)NULL; + } + + if (temp) + { + fprintf (stream, "%s", temp); + + es = STRLEN (temp); + if (es == 0) + es = 2; /* strlen ("| ") */ + name_padding = LONGEST_SIGNAL_DESC - es; + + fprintf (stream, "%*s", name_padding, ""); + + if ((WIFSTOPPED (show->status) == 0) && + (WIFCONTINUED (show->status) == 0) && + WIFCORED (show->status)) + fprintf (stream, _("(core dumped) ")); + } + } + + if (p != first && format) + fprintf (stream, "| "); + + if (p->command) + fprintf (stream, "%s", p->command); + + if (p == last && job_index >= 0) + { + temp = current_working_directory (); + + if (RUNNING (job_index) && (IS_FOREGROUND (job_index) == 0)) + fprintf (stream, " &"); + + if (strcmp (temp, jobs[job_index]->wd) != 0) + fprintf (stream, + _(" (wd: %s)"), polite_directory_format (jobs[job_index]->wd)); + } + + if (format || (p == last)) + { + /* We need to add a CR only if this is an interactive shell, and + we're reporting the status of a completed job asynchronously. + We can't really check whether this particular job is being + reported asynchronously, so just add the CR if the shell is + currently interactive and asynchronous notification is enabled. */ + if (asynchronous_notification && interactive) + fprintf (stream, "\r\n"); + else + fprintf (stream, "\n"); + } + + if (p == last) + break; + p = p->next; + } + fflush (stream); +} + +/* Print information to STREAM about jobs[JOB_INDEX] according to FORMAT. + Must be called with SIGCHLD blocked or queued with queue_sigchld */ +static void +pretty_print_job (job_index, format, stream) + int job_index, format; + FILE *stream; +{ + register PROCESS *p; + + /* Format only pid information about the process group leader? */ + if (format == JLIST_PID_ONLY) + { + fprintf (stream, "%ld\n", (long)jobs[job_index]->pipe->pid); + return; + } + + if (format == JLIST_CHANGED_ONLY) + { + if (IS_NOTIFIED (job_index)) + return; + format = JLIST_STANDARD; + } + + if (format != JLIST_NONINTERACTIVE) + fprintf (stream, "[%d]%c ", job_index + 1, + (job_index == js.j_current) ? '+': + (job_index == js.j_previous) ? '-' : ' '); + + if (format == JLIST_NONINTERACTIVE) + format = JLIST_LONG; + + p = jobs[job_index]->pipe; + + print_pipeline (p, job_index, format, stream); + + /* We have printed information about this job. When the job's + status changes, waitchld () sets the notification flag to 0. */ + jobs[job_index]->flags |= J_NOTIFIED; +} + +static int +print_job (job, format, state, job_index) + JOB *job; + int format, state, job_index; +{ + if (state == -1 || (JOB_STATE)state == job->state) + pretty_print_job (job_index, format, stdout); + return (0); +} + +void +list_one_job (job, format, ignore, job_index) + JOB *job; + int format, ignore, job_index; +{ + pretty_print_job (job_index, format, stdout); +} + +void +list_stopped_jobs (format) + int format; +{ + cleanup_dead_jobs (); + map_over_jobs (print_job, format, (int)JSTOPPED); +} + +void +list_running_jobs (format) + int format; +{ + cleanup_dead_jobs (); + map_over_jobs (print_job, format, (int)JRUNNING); +} + +/* List jobs. If FORMAT is non-zero, then the long form of the information + is printed, else just a short version. */ +void +list_all_jobs (format) + int format; +{ + cleanup_dead_jobs (); + map_over_jobs (print_job, format, -1); +} + +/* Fork, handling errors. Returns the pid of the newly made child, or 0. + COMMAND is just for remembering the name of the command; we don't do + anything else with it. ASYNC_P says what to do with the tty. If + non-zero, then don't give it away. */ +pid_t +make_child (command, async_p) + char *command; + int async_p; +{ + int forksleep; + sigset_t set, oset; + pid_t pid; + + /* XXX - block SIGTERM here and unblock in child after fork resets the + set of pending signals? */ + sigemptyset (&set); + sigaddset (&set, SIGCHLD); + sigaddset (&set, SIGINT); + sigemptyset (&oset); + sigprocmask (SIG_BLOCK, &set, &oset); + + making_children (); + + forksleep = 1; + +#if defined (BUFFERED_INPUT) + /* If default_buffered_input is active, we are reading a script. If + the command is asynchronous, we have already duplicated /dev/null + as fd 0, but have not changed the buffered stream corresponding to + the old fd 0. We don't want to sync the stream in this case. */ + if (default_buffered_input != -1 && + (!async_p || default_buffered_input > 0)) + sync_buffered_stream (default_buffered_input); +#endif /* BUFFERED_INPUT */ + + RESET_SIGTERM; + + /* Create the child, handle severe errors. Retry on EAGAIN. */ + while ((pid = fork ()) < 0 && errno == EAGAIN && forksleep < FORKSLEEP_MAX) + { + /* bash-4.2 */ + /* If we can't create any children, try to reap some dead ones. */ + waitchld (-1, 0); + + sys_error ("fork: retry"); + RESET_SIGTERM; + + if (sleep (forksleep) != 0) + break; + forksleep <<= 1; + } + + if (pid != 0) + RESET_SIGTERM; + + if (pid < 0) + { + sys_error ("fork"); + + /* Kill all of the processes in the current pipeline. */ + terminate_current_pipeline (); + + /* Discard the current pipeline, if any. */ + if (the_pipeline) + kill_current_pipeline (); + + last_command_exit_value = EX_NOEXEC; + throw_to_top_level (); /* Reset signals, etc. */ + } + + if (pid == 0) + { + /* In the child. Give this child the right process group, set the + signals to the default state for a new process. */ + pid_t mypid; + + mypid = getpid (); +#if defined (BUFFERED_INPUT) + /* Close default_buffered_input if it's > 0. We don't close it if it's + 0 because that's the file descriptor used when redirecting input, + and it's wrong to close the file in that case. */ + unset_bash_input (0); +#endif /* BUFFERED_INPUT */ + + /* Restore top-level signal mask. */ + sigprocmask (SIG_SETMASK, &top_level_mask, (sigset_t *)NULL); + + if (job_control) + { + /* All processes in this pipeline belong in the same + process group. */ + + if (pipeline_pgrp == 0) /* This is the first child. */ + pipeline_pgrp = mypid; + + /* Check for running command in backquotes. */ + if (pipeline_pgrp == shell_pgrp) + ignore_tty_job_signals (); + else + default_tty_job_signals (); + + /* Set the process group before trying to mess with the terminal's + process group. This is mandated by POSIX. */ + /* This is in accordance with the Posix 1003.1 standard, + section B.7.2.4, which says that trying to set the terminal + process group with tcsetpgrp() to an unused pgrp value (like + this would have for the first child) is an error. Section + B.4.3.3, p. 237 also covers this, in the context of job control + shells. */ + if (setpgid (mypid, pipeline_pgrp) < 0) + sys_error (_("child setpgid (%ld to %ld)"), (long)mypid, (long)pipeline_pgrp); + + /* By convention (and assumption above), if + pipeline_pgrp == shell_pgrp, we are making a child for + command substitution. + In this case, we don't want to give the terminal to the + shell's process group (we could be in the middle of a + pipeline, for example). */ + if (async_p == 0 && pipeline_pgrp != shell_pgrp && ((subshell_environment&SUBSHELL_ASYNC) == 0)) + give_terminal_to (pipeline_pgrp, 0); + +#if defined (PGRP_PIPE) + if (pipeline_pgrp == mypid) + pipe_read (pgrp_pipe); +#endif + } + else /* Without job control... */ + { + if (pipeline_pgrp == 0) + pipeline_pgrp = shell_pgrp; + + /* If these signals are set to SIG_DFL, we encounter the curious + situation of an interactive ^Z to a running process *working* + and stopping the process, but being unable to do anything with + that process to change its state. On the other hand, if they + are set to SIG_IGN, jobs started from scripts do not stop when + the shell running the script gets a SIGTSTP and stops. */ + + default_tty_job_signals (); + } + +#if defined (PGRP_PIPE) + /* Release the process group pipe, since our call to setpgid () + is done. The last call to sh_closepipe is done in stop_pipeline. */ + sh_closepipe (pgrp_pipe); +#endif /* PGRP_PIPE */ + +#if 0 + /* Don't set last_asynchronous_pid in the child */ + if (async_p) + last_asynchronous_pid = mypid; /* XXX */ + else +#endif +#if defined (RECYCLES_PIDS) + if (last_asynchronous_pid == mypid) + /* Avoid pid aliasing. 1 seems like a safe, unusual pid value. */ + last_asynchronous_pid = 1; +#endif + } + else + { + /* In the parent. Remember the pid of the child just created + as the proper pgrp if this is the first child. */ + + if (job_control) + { + if (pipeline_pgrp == 0) + { + pipeline_pgrp = pid; + /* Don't twiddle terminal pgrps in the parent! This is the bug, + not the good thing of twiddling them in the child! */ + /* give_terminal_to (pipeline_pgrp, 0); */ + } + /* This is done on the recommendation of the Rationale section of + the POSIX 1003.1 standard, where it discusses job control and + shells. It is done to avoid possible race conditions. (Ref. + 1003.1 Rationale, section B.4.3.3, page 236). */ + setpgid (pid, pipeline_pgrp); + } + else + { + if (pipeline_pgrp == 0) + pipeline_pgrp = shell_pgrp; + } + + /* Place all processes into the jobs array regardless of the + state of job_control. */ + add_process (command, pid); + + if (async_p) + last_asynchronous_pid = pid; +#if defined (RECYCLES_PIDS) + else if (last_asynchronous_pid == pid) + /* Avoid pid aliasing. 1 seems like a safe, unusual pid value. */ + last_asynchronous_pid = 1; +#endif + + /* Delete the saved status for any job containing this PID in case it's + been reused. */ + delete_old_job (pid); + + /* Perform the check for pid reuse unconditionally. Some systems reuse + PIDs before giving a process CHILD_MAX/_SC_CHILD_MAX unique ones. */ + bgp_delete (pid); /* new process, discard any saved status */ + + last_made_pid = pid; + + /* keep stats */ + js.c_totforked++; + js.c_living++; + + /* Unblock SIGINT and SIGCHLD unless creating a pipeline, in which case + SIGCHLD remains blocked until all commands in the pipeline have been + created. */ + sigprocmask (SIG_SETMASK, &oset, (sigset_t *)NULL); + } + + return (pid); +} + +/* These two functions are called only in child processes. */ +void +ignore_tty_job_signals () +{ + set_signal_handler (SIGTSTP, SIG_IGN); + set_signal_handler (SIGTTIN, SIG_IGN); + set_signal_handler (SIGTTOU, SIG_IGN); +} + +void +default_tty_job_signals () +{ + set_signal_handler (SIGTSTP, SIG_DFL); + set_signal_handler (SIGTTIN, SIG_DFL); + set_signal_handler (SIGTTOU, SIG_DFL); +} + +/* When we end a job abnormally, or if we stop a job, we set the tty to the + state kept in here. When a job ends normally, we set the state in here + to the state of the tty. */ + +static TTYSTRUCT shell_tty_info; + +#if defined (NEW_TTY_DRIVER) +static struct tchars shell_tchars; +static struct ltchars shell_ltchars; +#endif /* NEW_TTY_DRIVER */ + +#if defined (NEW_TTY_DRIVER) && defined (DRAIN_OUTPUT) +/* Since the BSD tty driver does not allow us to change the tty modes + while simultaneously waiting for output to drain and preserving + typeahead, we have to drain the output ourselves before calling + ioctl. We cheat by finding the length of the output queue, and + using select to wait for an appropriate length of time. This is + a hack, and should be labeled as such (it's a hastily-adapted + mutation of a `usleep' implementation). It's only reason for + existing is the flaw in the BSD tty driver. */ + +static int ttspeeds[] = +{ + 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, + 1800, 2400, 4800, 9600, 19200, 38400 +}; + +static void +draino (fd, ospeed) + int fd, ospeed; +{ + register int delay = ttspeeds[ospeed]; + int n; + + if (!delay) + return; + + while ((ioctl (fd, TIOCOUTQ, &n) == 0) && n) + { + if (n > (delay / 100)) + { + struct timeval tv; + + n *= 10; /* 2 bits more for conservativeness. */ + tv.tv_sec = n / delay; + tv.tv_usec = ((n % delay) * 1000000) / delay; + select (fd, (fd_set *)0, (fd_set *)0, (fd_set *)0, &tv); + } + else + break; + } +} +#endif /* NEW_TTY_DRIVER && DRAIN_OUTPUT */ + +/* Return the fd from which we are actually getting input. */ +#define input_tty() (shell_tty != -1) ? shell_tty : fileno (stderr) + +/* Fill the contents of shell_tty_info with the current tty info. */ +int +get_tty_state () +{ + int tty; + + tty = input_tty (); + if (tty != -1) + { +#if defined (NEW_TTY_DRIVER) + ioctl (tty, TIOCGETP, &shell_tty_info); + ioctl (tty, TIOCGETC, &shell_tchars); + ioctl (tty, TIOCGLTC, &shell_ltchars); +#endif /* NEW_TTY_DRIVER */ + +#if defined (TERMIO_TTY_DRIVER) + ioctl (tty, TCGETA, &shell_tty_info); +#endif /* TERMIO_TTY_DRIVER */ + +#if defined (TERMIOS_TTY_DRIVER) + if (tcgetattr (tty, &shell_tty_info) < 0) + { +#if 0 + /* Only print an error message if we're really interactive at + this time. */ + if (interactive) + sys_error ("[%ld: %d (%d)] tcgetattr", (long)getpid (), shell_level, tty); +#endif + return -1; + } +#endif /* TERMIOS_TTY_DRIVER */ + if (check_window_size) + get_new_window_size (0, (int *)0, (int *)0); + } + return 0; +} + +/* Make the current tty use the state in shell_tty_info. */ +int +set_tty_state () +{ + int tty; + + tty = input_tty (); + if (tty != -1) + { +#if defined (NEW_TTY_DRIVER) +# if defined (DRAIN_OUTPUT) + draino (tty, shell_tty_info.sg_ospeed); +# endif /* DRAIN_OUTPUT */ + ioctl (tty, TIOCSETN, &shell_tty_info); + ioctl (tty, TIOCSETC, &shell_tchars); + ioctl (tty, TIOCSLTC, &shell_ltchars); +#endif /* NEW_TTY_DRIVER */ + +#if defined (TERMIO_TTY_DRIVER) + ioctl (tty, TCSETAW, &shell_tty_info); +#endif /* TERMIO_TTY_DRIVER */ + +#if defined (TERMIOS_TTY_DRIVER) + if (tcsetattr (tty, TCSADRAIN, &shell_tty_info) < 0) + { + /* Only print an error message if we're really interactive at + this time. */ + if (interactive) + sys_error ("[%ld: %d (%d)] tcsetattr", (long)getpid (), shell_level, tty); + return -1; + } +#endif /* TERMIOS_TTY_DRIVER */ + } + return 0; +} + +/* Given an index into the jobs array JOB, return the PROCESS struct of the last + process in that job's pipeline. This is the one whose exit status + counts. Must be called with SIGCHLD blocked or queued. */ +static PROCESS * +find_last_proc (job, block) + int job; + int block; +{ + register PROCESS *p; + sigset_t set, oset; + + if (block) + BLOCK_CHILD (set, oset); + + p = jobs[job]->pipe; + while (p && p->next != jobs[job]->pipe) + p = p->next; + + if (block) + UNBLOCK_CHILD (oset); + + return (p); +} + +static pid_t +find_last_pid (job, block) + int job; + int block; +{ + PROCESS *p; + + p = find_last_proc (job, block); + /* Possible race condition here. */ + return p->pid; +} + +/* Wait for a particular child of the shell to finish executing. + This low-level function prints an error message if PID is not + a child of this shell. It returns -1 if it fails, or whatever + wait_for returns otherwise. If the child is not found in the + jobs table, it returns 127. */ +int +wait_for_single_pid (pid) + pid_t pid; +{ + register PROCESS *child; + sigset_t set, oset; + int r, job; + + BLOCK_CHILD (set, oset); + child = find_pipeline (pid, 0, (int *)NULL); + UNBLOCK_CHILD (oset); + + if (child == 0) + { + r = bgp_search (pid); + if (r >= 0) + return r; + } + + if (child == 0) + { + internal_error (_("wait: pid %ld is not a child of this shell"), (long)pid); + return (127); + } + + r = wait_for (pid); + + /* POSIX.2: if we just waited for a job, we can remove it from the jobs + table. */ + BLOCK_CHILD (set, oset); + job = find_job (pid, 0, NULL); + if (job != NO_JOB && jobs[job] && DEADJOB (job)) + jobs[job]->flags |= J_NOTIFIED; + UNBLOCK_CHILD (oset); + + /* If running in posix mode, remove the job from the jobs table immediately */ + if (posixly_correct) + { + cleanup_dead_jobs (); + bgp_delete (pid); + } + + return r; +} + +/* Wait for all of the background processes started by this shell to finish. */ +void +wait_for_background_pids () +{ + register int i, r, waited_for; + sigset_t set, oset; + pid_t pid; + + for (waited_for = 0;;) + { + BLOCK_CHILD (set, oset); + + /* find first running job; if none running in foreground, break */ + /* XXX could use js.j_firstj and js.j_lastj here */ + for (i = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("wait_for_background_pids: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("wait_for_background_pids: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + if (jobs[i] && RUNNING (i) && IS_FOREGROUND (i) == 0) + break; + } + if (i == js.j_jobslots) + { + UNBLOCK_CHILD (oset); + break; + } + + /* now wait for the last pid in that job. */ + pid = find_last_pid (i, 0); + UNBLOCK_CHILD (oset); + QUIT; + errno = 0; /* XXX */ + r = wait_for_single_pid (pid); + if (r == -1) + { + /* If we're mistaken about job state, compensate. */ + if (errno == ECHILD) + mark_all_jobs_as_dead (); + } + else + waited_for++; + } + + /* POSIX.2 says the shell can discard the statuses of all completed jobs if + `wait' is called with no arguments. */ + mark_dead_jobs_as_notified (1); + cleanup_dead_jobs (); + bgp_clear (); +} + +/* Make OLD_SIGINT_HANDLER the SIGINT signal handler. */ +#define INVALID_SIGNAL_HANDLER (SigHandler *)wait_for_background_pids +static SigHandler *old_sigint_handler = INVALID_SIGNAL_HANDLER; + +static int wait_sigint_received; +static int child_caught_sigint; +static int waiting_for_child; + +static void +restore_sigint_handler () +{ + if (old_sigint_handler != INVALID_SIGNAL_HANDLER) + { + set_signal_handler (SIGINT, old_sigint_handler); + old_sigint_handler = INVALID_SIGNAL_HANDLER; + waiting_for_child = 0; + } +} + +/* Handle SIGINT while we are waiting for children in a script to exit. + The `wait' builtin should be interruptible, but all others should be + effectively ignored (i.e. not cause the shell to exit). */ +static sighandler +wait_sigint_handler (sig) + int sig; +{ + SigHandler *sigint_handler; + + if (interrupt_immediately || + (this_shell_builtin && this_shell_builtin == wait_builtin)) + { + last_command_exit_value = 128+SIGINT; + restore_sigint_handler (); + /* If we got a SIGINT while in `wait', and SIGINT is trapped, do + what POSIX.2 says (see builtins/wait.def for more info). */ + if (this_shell_builtin && this_shell_builtin == wait_builtin && + signal_is_trapped (SIGINT) && + ((sigint_handler = trap_to_sighandler (SIGINT)) == trap_handler)) + { + trap_handler (SIGINT); /* set pending_traps[SIGINT] */ + wait_signal_received = SIGINT; + if (interrupt_immediately) + { + interrupt_immediately = 0; + longjmp (wait_intr_buf, 1); + } + else + /* Let CHECK_WAIT_INTR handle it in wait_for/waitchld */ + SIGRETURN (0); + } + else if (interrupt_immediately) + { + ADDINTERRUPT; + QUIT; + } + else /* wait_builtin but signal not trapped, treat as interrupt */ + kill (getpid (), SIGINT); + } + + /* XXX - should this be interrupt_state? If it is, the shell will act + as if it got the SIGINT interrupt. */ + if (waiting_for_child) + wait_sigint_received = 1; + else + { + last_command_exit_value = 128+SIGINT; + restore_sigint_handler (); + kill (getpid (), SIGINT); + } + + /* Otherwise effectively ignore the SIGINT and allow the running job to + be killed. */ + SIGRETURN (0); +} + +static int +process_exit_signal (status) + WAIT status; +{ + return (WIFSIGNALED (status) ? WTERMSIG (status) : 0); +} + +static int +process_exit_status (status) + WAIT status; +{ + if (WIFSIGNALED (status)) + return (128 + WTERMSIG (status)); + else if (WIFSTOPPED (status) == 0) + return (WEXITSTATUS (status)); + else + return (EXECUTION_SUCCESS); +} + +static WAIT +job_signal_status (job) + int job; +{ + register PROCESS *p; + WAIT s; + + p = jobs[job]->pipe; + do + { + s = p->status; + if (WIFSIGNALED(s) || WIFSTOPPED(s)) + break; + p = p->next; + } + while (p != jobs[job]->pipe); + + return s; +} + +/* Return the exit status of the last process in the pipeline for job JOB. + This is the exit status of the entire job. */ +static WAIT +raw_job_exit_status (job) + int job; +{ + register PROCESS *p; + int fail; + WAIT ret; + + if (pipefail_opt) + { + fail = 0; + p = jobs[job]->pipe; + do + { + if (WSTATUS (p->status) != EXECUTION_SUCCESS) + fail = WSTATUS(p->status); + p = p->next; + } + while (p != jobs[job]->pipe); + WSTATUS (ret) = fail; + return ret; + } + + for (p = jobs[job]->pipe; p->next != jobs[job]->pipe; p = p->next) + ; + return (p->status); +} + +/* Return the exit status of job JOB. This is the exit status of the last + (rightmost) process in the job's pipeline, modified if the job was killed + by a signal or stopped. */ +int +job_exit_status (job) + int job; +{ + return (process_exit_status (raw_job_exit_status (job))); +} + +int +job_exit_signal (job) + int job; +{ + return (process_exit_signal (raw_job_exit_status (job))); +} + +#define FIND_CHILD(pid, child) \ + do \ + { \ + child = find_pipeline (pid, 0, (int *)NULL); \ + if (child == 0) \ + { \ + give_terminal_to (shell_pgrp, 0); \ + UNBLOCK_CHILD (oset); \ + internal_error (_("wait_for: No record of process %ld"), (long)pid); \ + restore_sigint_handler (); \ + return (termination_state = 127); \ + } \ + } \ + while (0) + +/* Wait for pid (one of our children) to terminate, then + return the termination state. Returns 127 if PID is not found in + the jobs table. Returns -1 if waitchld() returns -1, indicating + that there are no unwaited-for child processes. */ +int +wait_for (pid) + pid_t pid; +{ + int job, termination_state, r; + WAIT s; + register PROCESS *child; + sigset_t set, oset; + + /* In the case that this code is interrupted, and we longjmp () out of it, + we are relying on the code in throw_to_top_level () to restore the + top-level signal mask. */ + child = 0; + BLOCK_CHILD (set, oset); + + /* Ignore interrupts while waiting for a job run without job control + to finish. We don't want the shell to exit if an interrupt is + received, only if one of the jobs run is killed via SIGINT. If + job control is not set, the job will be run in the same pgrp as + the shell, and the shell will see any signals the job gets. In + fact, we want this set every time the waiting shell and the waited- + for process are in the same process group, including command + substitution. */ + + /* This is possibly a race condition -- should it go in stop_pipeline? */ + wait_sigint_received = child_caught_sigint = 0; + if (job_control == 0 || (subshell_environment&SUBSHELL_COMSUB)) + { + old_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler); + waiting_for_child = 0; + if (old_sigint_handler == SIG_IGN) + set_signal_handler (SIGINT, old_sigint_handler); + } + + termination_state = last_command_exit_value; + + if (interactive && job_control == 0) + QUIT; + /* Check for terminating signals and exit the shell if we receive one */ + CHECK_TERMSIG; + + /* Check for a trapped signal interrupting the wait builtin and jump out */ + CHECK_WAIT_INTR; + + /* If we say wait_for (), then we have a record of this child somewhere. + If it and none of its peers are running, don't call waitchld(). */ + + job = NO_JOB; + do + { + if (pid != ANY_PID) + FIND_CHILD (pid, child); + + /* If this child is part of a job, then we are really waiting for the + job to finish. Otherwise, we are waiting for the child to finish. + We check for JDEAD in case the job state has been set by waitchld + after receipt of a SIGCHLD. */ + if (job == NO_JOB) + job = find_job (pid, 0, NULL); + + /* waitchld() takes care of setting the state of the job. If the job + has already exited before this is called, sigchld_handler will have + called waitchld and the state will be set to JDEAD. */ + + if (pid == ANY_PID || PRUNNING(child) || (job != NO_JOB && RUNNING (job))) + { +#if defined (WAITPID_BROKEN) /* SCOv4 */ + sigset_t suspend_set; + sigemptyset (&suspend_set); + sigsuspend (&suspend_set); +#else /* !WAITPID_BROKEN */ +# if defined (MUST_UNBLOCK_CHLD) + struct sigaction act, oact; + sigset_t nullset, chldset; + + sigemptyset (&nullset); + sigemptyset (&chldset); + sigprocmask (SIG_SETMASK, &nullset, &chldset); + act.sa_handler = SIG_DFL; + sigemptyset (&act.sa_mask); + sigemptyset (&oact.sa_mask); + act.sa_flags = 0; +# if defined (SA_RESTART) + act.sa_flags |= SA_RESTART; +# endif + sigaction (SIGCHLD, &act, &oact); +# endif /* MUST_UNBLOCK_CHLD */ + queue_sigchld = 1; + waiting_for_child++; + r = waitchld (pid, 1); /* XXX */ + waiting_for_child--; +#if 0 +itrace("wait_for: blocking wait for %d returns %d child = %p", (int)pid, r, child); +#endif +# if defined (MUST_UNBLOCK_CHLD) + sigaction (SIGCHLD, &oact, (struct sigaction *)NULL); + sigprocmask (SIG_SETMASK, &chldset, (sigset_t *)NULL); +# endif + queue_sigchld = 0; + if (r == -1 && errno == ECHILD && this_shell_builtin == wait_builtin) + { + termination_state = -1; + /* XXX - restore sigint handler here? */ + goto wait_for_return; + } + + /* If child is marked as running, but waitpid() returns -1/ECHILD, + there is something wrong. Somewhere, wait should have returned + that child's pid. Mark the child as not running and the job, + if it exists, as JDEAD. */ + if (r == -1 && errno == ECHILD) + { + if (child) + { + child->running = PS_DONE; + WSTATUS (child->status) = 0; /* XXX -- can't find true status */ + } + js.c_living = 0; /* no living child processes */ + if (job != NO_JOB) + { + jobs[job]->state = JDEAD; + js.c_reaped++; + js.j_ndead++; + } + if (pid == ANY_PID) + { + termination_state = -1; + break; + } + } +#endif /* WAITPID_BROKEN */ + } + + /* If the shell is interactive, and job control is disabled, see + if the foreground process has died due to SIGINT and jump out + of the wait loop if it has. waitchld has already restored the + old SIGINT signal handler. */ + if (interactive && job_control == 0) + QUIT; + /* Check for terminating signals and exit the shell if we receive one */ + CHECK_TERMSIG; + + /* Check for a trapped signal interrupting the wait builtin and jump out */ + CHECK_WAIT_INTR; + + if (pid == ANY_PID) + /* XXX - could set child but we don't have a handle on what waitchld + reaps. Leave termination_state alone. */ + goto wait_for_return; + } + while (PRUNNING (child) || (job != NO_JOB && RUNNING (job))); + + /* Restore the original SIGINT signal handler before we return. */ + restore_sigint_handler (); + + /* The exit state of the command is either the termination state of the + child, or the termination state of the job. If a job, the status + of the last child in the pipeline is the significant one. If the command + or job was terminated by a signal, note that value also. */ + termination_state = (job != NO_JOB) ? job_exit_status (job) + : process_exit_status (child->status); + last_command_exit_signal = (job != NO_JOB) ? job_exit_signal (job) + : process_exit_signal (child->status); + + /* XXX */ + if ((job != NO_JOB && JOBSTATE (job) == JSTOPPED) || WIFSTOPPED (child->status)) + termination_state = 128 + WSTOPSIG (child->status); + + if (job == NO_JOB || IS_JOBCONTROL (job)) + { + /* XXX - under what circumstances is a job not present in the jobs + table (job == NO_JOB)? + 1. command substitution + + In the case of command substitution, at least, it's probably not + the right thing to give the terminal to the shell's process group, + even though there is code in subst.c:command_substitute to work + around it. + + Things that don't: + $PROMPT_COMMAND execution + process substitution + */ +#if 0 +if (job == NO_JOB) + itrace("wait_for: job == NO_JOB, giving the terminal to shell_pgrp (%ld)", (long)shell_pgrp); +#endif + give_terminal_to (shell_pgrp, 0); + } + + /* If the command did not exit cleanly, or the job is just + being stopped, then reset the tty state back to what it + was before this command. Reset the tty state and notify + the user of the job termination only if the shell is + interactive. Clean up any dead jobs in either case. */ + if (job != NO_JOB) + { + if (interactive_shell && subshell_environment == 0) + { + /* This used to use `child->status'. That's wrong, however, for + pipelines. `child' is the first process in the pipeline. It's + likely that the process we want to check for abnormal termination + or stopping is the last process in the pipeline, especially if + it's long-lived and the first process is short-lived. Since we + know we have a job here, we can check all the processes in this + job's pipeline and see if one of them stopped or terminated due + to a signal. We might want to change this later to just check + the last process in the pipeline. If no process exits due to a + signal, S is left as the status of the last job in the pipeline. */ + s = job_signal_status (job); + + if (WIFSIGNALED (s) || WIFSTOPPED (s)) + { + set_tty_state (); + + /* If the current job was stopped or killed by a signal, and + the user has requested it, get a possibly new window size */ + if (check_window_size && (job == js.j_current || IS_FOREGROUND (job))) + get_new_window_size (0, (int *)0, (int *)0); + } + else + get_tty_state (); + + /* If job control is enabled, the job was started with job + control, the job was the foreground job, and it was killed + by SIGINT, then print a newline to compensate for the kernel + printing the ^C without a trailing newline. */ + if (job_control && IS_JOBCONTROL (job) && IS_FOREGROUND (job) && + WIFSIGNALED (s) && WTERMSIG (s) == SIGINT) + { + /* If SIGINT is not trapped and the shell is in a for, while, + or until loop, act as if the shell received SIGINT as + well, so the loop can be broken. This doesn't call the + SIGINT signal handler; maybe it should. */ + if (signal_is_trapped (SIGINT) == 0 && (loop_level || (shell_compatibility_level > 32 && executing_list))) + ADDINTERRUPT; + else + { + putchar ('\n'); + fflush (stdout); + } + } + } + else if ((subshell_environment & (SUBSHELL_COMSUB|SUBSHELL_PIPE)) && wait_sigint_received) + { + /* If waiting for a job in a subshell started to do command + substitution or to run a pipeline element that consists of + something like a while loop or a for loop, simulate getting + and being killed by the SIGINT to pass the status back to our + parent. */ + s = job_signal_status (job); + + if (child_caught_sigint == 0 && signal_is_trapped (SIGINT) == 0) + { + UNBLOCK_CHILD (oset); + old_sigint_handler = set_signal_handler (SIGINT, SIG_DFL); + if (old_sigint_handler == SIG_IGN) + restore_sigint_handler (); + else + kill (getpid (), SIGINT); + } + } + else if (interactive_shell == 0 && IS_FOREGROUND (job) && check_window_size) + get_new_window_size (0, (int *)0, (int *)0); + + /* Moved here from set_job_status_and_cleanup, which is in the SIGCHLD + signal handler path */ + if (DEADJOB (job) && IS_FOREGROUND (job) /*&& subshell_environment == 0*/) + setjstatus (job); + + /* If this job is dead, notify the user of the status. If the shell + is interactive, this will display a message on the terminal. If + the shell is not interactive, make sure we turn on the notify bit + so we don't get an unwanted message about the job's termination, + and so delete_job really clears the slot in the jobs table. */ + notify_and_cleanup (); + } + +wait_for_return: + + UNBLOCK_CHILD (oset); + + return (termination_state); +} + +/* Wait for the last process in the pipeline for JOB. Returns whatever + wait_for returns: the last process's termination state or -1 if there + are no unwaited-for child processes or an error occurs. */ +int +wait_for_job (job) + int job; +{ + pid_t pid; + int r; + sigset_t set, oset; + + BLOCK_CHILD(set, oset); + if (JOBSTATE (job) == JSTOPPED) + internal_warning (_("wait_for_job: job %d is stopped"), job+1); + + pid = find_last_pid (job, 0); + UNBLOCK_CHILD(oset); + r = wait_for (pid); + + /* POSIX.2: we can remove the job from the jobs table if we just waited + for it. */ + BLOCK_CHILD (set, oset); + if (job != NO_JOB && jobs[job] && DEADJOB (job)) + jobs[job]->flags |= J_NOTIFIED; + UNBLOCK_CHILD (oset); + + return r; +} + +/* Wait for any background job started by this shell to finish. Very + similar to wait_for_background_pids(). Returns the exit status of + the next exiting job, -1 if there are no background jobs. The caller + is responsible for translating -1 into the right return value. */ +int +wait_for_any_job () +{ + pid_t pid; + int i, r, waited_for; + sigset_t set, oset; + + if (jobs_list_frozen) + return -1; + + /* First see if there are any unnotified dead jobs that we can report on */ + BLOCK_CHILD (set, oset); + for (i = 0; i < js.j_jobslots; i++) + { + if (jobs[i] && DEADJOB (i) && IS_NOTIFIED (i) == 0) + { +return_job: + r = job_exit_status (i); + notify_of_job_status (); /* XXX */ + delete_job (i, 0); +#if defined (COPROCESS_SUPPORT) + coproc_reap (); +#endif + UNBLOCK_CHILD (oset); + return r; + } + } + UNBLOCK_CHILD (oset); + + /* At this point, we have no dead jobs in the jobs table. Wait until we + get one, even if it takes multiple pids exiting. */ + for (waited_for = 0;;) + { + /* Make sure there is a background job to wait for */ + BLOCK_CHILD (set, oset); + for (i = 0; i < js.j_jobslots; i++) + if (jobs[i] && RUNNING (i) && IS_FOREGROUND (i) == 0) + break; + if (i == js.j_jobslots) + { + UNBLOCK_CHILD (oset); + return -1; + } + + UNBLOCK_CHILD (oset); + + QUIT; + CHECK_TERMSIG; + CHECK_WAIT_INTR; + + errno = 0; + r = wait_for (ANY_PID); /* special sentinel value for wait_for */ + if (r == -1 && errno == ECHILD) + mark_all_jobs_as_dead (); + + /* Now we see if we have any dead jobs and return the first one */ + BLOCK_CHILD (set, oset); + for (i = 0; i < js.j_jobslots; i++) + if (jobs[i] && DEADJOB (i)) + goto return_job; + UNBLOCK_CHILD (oset); + } + + return -1; +} + +/* Print info about dead jobs, and then delete them from the list + of known jobs. This does not actually delete jobs when the + shell is not interactive, because the dead jobs are not marked + as notified. */ +void +notify_and_cleanup () +{ + if (jobs_list_frozen) + return; + + if (interactive || interactive_shell == 0 || sourcelevel) + notify_of_job_status (); + + cleanup_dead_jobs (); +} + +/* Make dead jobs disappear from the jobs array without notification. + This is used when the shell is not interactive. */ +void +reap_dead_jobs () +{ + mark_dead_jobs_as_notified (0); + cleanup_dead_jobs (); +} + +/* Return the next closest (chronologically) job to JOB which is in + STATE. STATE can be JSTOPPED, JRUNNING. NO_JOB is returned if + there is no next recent job. */ +static int +most_recent_job_in_state (job, state) + int job; + JOB_STATE state; +{ + register int i, result; + sigset_t set, oset; + + BLOCK_CHILD (set, oset); + + for (result = NO_JOB, i = job - 1; i >= 0; i--) + { + if (jobs[i] && (JOBSTATE (i) == state)) + { + result = i; + break; + } + } + + UNBLOCK_CHILD (oset); + + return (result); +} + +/* Return the newest *stopped* job older than JOB, or NO_JOB if not + found. */ +static int +job_last_stopped (job) + int job; +{ + return (most_recent_job_in_state (job, JSTOPPED)); +} + +/* Return the newest *running* job older than JOB, or NO_JOB if not + found. */ +static int +job_last_running (job) + int job; +{ + return (most_recent_job_in_state (job, JRUNNING)); +} + +/* Make JOB be the current job, and make previous be useful. Must be + called with SIGCHLD blocked. */ +static void +set_current_job (job) + int job; +{ + int candidate; + + if (js.j_current != job) + { + js.j_previous = js.j_current; + js.j_current = job; + } + + /* First choice for previous job is the old current job. */ + if (js.j_previous != js.j_current && + js.j_previous != NO_JOB && + jobs[js.j_previous] && + STOPPED (js.j_previous)) + return; + + /* Second choice: Newest stopped job that is older than + the current job. */ + candidate = NO_JOB; + if (STOPPED (js.j_current)) + { + candidate = job_last_stopped (js.j_current); + + if (candidate != NO_JOB) + { + js.j_previous = candidate; + return; + } + } + + /* If we get here, there is either only one stopped job, in which case it is + the current job and the previous job should be set to the newest running + job, or there are only running jobs and the previous job should be set to + the newest running job older than the current job. We decide on which + alternative to use based on whether or not JOBSTATE(js.j_current) is + JSTOPPED. */ + + candidate = RUNNING (js.j_current) ? job_last_running (js.j_current) + : job_last_running (js.j_jobslots); + + if (candidate != NO_JOB) + { + js.j_previous = candidate; + return; + } + + /* There is only a single job, and it is both `+' and `-'. */ + js.j_previous = js.j_current; +} + +/* Make current_job be something useful, if it isn't already. */ + +/* Here's the deal: The newest non-running job should be `+', and the + next-newest non-running job should be `-'. If there is only a single + stopped job, the js.j_previous is the newest non-running job. If there + are only running jobs, the newest running job is `+' and the + next-newest running job is `-'. Must be called with SIGCHLD blocked. */ + +static void +reset_current () +{ + int candidate; + + if (js.j_jobslots && js.j_current != NO_JOB && jobs[js.j_current] && STOPPED (js.j_current)) + candidate = js.j_current; + else + { + candidate = NO_JOB; + + /* First choice: the previous job. */ + if (js.j_previous != NO_JOB && jobs[js.j_previous] && STOPPED (js.j_previous)) + candidate = js.j_previous; + + /* Second choice: the most recently stopped job. */ + if (candidate == NO_JOB) + candidate = job_last_stopped (js.j_jobslots); + + /* Third choice: the newest running job. */ + if (candidate == NO_JOB) + candidate = job_last_running (js.j_jobslots); + } + + /* If we found a job to use, then use it. Otherwise, there + are no jobs period. */ + if (candidate != NO_JOB) + set_current_job (candidate); + else + js.j_current = js.j_previous = NO_JOB; +} + +/* Set up the job structures so we know the job and its processes are + all running. */ +static void +set_job_running (job) + int job; +{ + register PROCESS *p; + + /* Each member of the pipeline is now running. */ + p = jobs[job]->pipe; + + do + { + if (WIFSTOPPED (p->status)) + p->running = PS_RUNNING; /* XXX - could be PS_STOPPED */ + p = p->next; + } + while (p != jobs[job]->pipe); + + /* This means that the job is running. */ + JOBSTATE (job) = JRUNNING; +} + +/* Start a job. FOREGROUND if non-zero says to do that. Otherwise, + start the job in the background. JOB is a zero-based index into + JOBS. Returns -1 if it is unable to start a job, and the return + status of the job otherwise. */ +int +start_job (job, foreground) + int job, foreground; +{ + register PROCESS *p; + int already_running; + sigset_t set, oset; + char *wd, *s; + static TTYSTRUCT save_stty; + + BLOCK_CHILD (set, oset); + + if (DEADJOB (job)) + { + internal_error (_("%s: job has terminated"), this_command_name); + UNBLOCK_CHILD (oset); + return (-1); + } + + already_running = RUNNING (job); + + if (foreground == 0 && already_running) + { + internal_error (_("%s: job %d already in background"), this_command_name, job + 1); + UNBLOCK_CHILD (oset); + return (0); /* XPG6/SUSv3 says this is not an error */ + } + + wd = current_working_directory (); + + /* You don't know about the state of this job. Do you? */ + jobs[job]->flags &= ~J_NOTIFIED; + + if (foreground) + { + set_current_job (job); + jobs[job]->flags |= J_FOREGROUND; + } + + /* Tell the outside world what we're doing. */ + p = jobs[job]->pipe; + + if (foreground == 0) + { + /* POSIX.2 says `bg' doesn't give any indication about current or + previous job. */ + if (posixly_correct == 0) + s = (job == js.j_current) ? "+ ": ((job == js.j_previous) ? "- " : " "); + else + s = " "; + printf ("[%d]%s", job + 1, s); + } + + do + { + printf ("%s%s", + p->command ? p->command : "", + p->next != jobs[job]->pipe? " | " : ""); + p = p->next; + } + while (p != jobs[job]->pipe); + + if (foreground == 0) + printf (" &"); + + if (strcmp (wd, jobs[job]->wd) != 0) + printf (" (wd: %s)", polite_directory_format (jobs[job]->wd)); + + printf ("\n"); + + /* Run the job. */ + if (already_running == 0) + set_job_running (job); + + /* Save the tty settings before we start the job in the foreground. */ + if (foreground) + { + get_tty_state (); + save_stty = shell_tty_info; + /* Give the terminal to this job. */ + if (IS_JOBCONTROL (job)) + give_terminal_to (jobs[job]->pgrp, 0); + } + else + jobs[job]->flags &= ~J_FOREGROUND; + + /* If the job is already running, then don't bother jump-starting it. */ + if (already_running == 0) + { + jobs[job]->flags |= J_NOTIFIED; + killpg (jobs[job]->pgrp, SIGCONT); + } + + if (foreground) + { + pid_t pid; + int st; + + pid = find_last_pid (job, 0); + UNBLOCK_CHILD (oset); + st = wait_for (pid); + shell_tty_info = save_stty; + set_tty_state (); + return (st); + } + else + { + reset_current (); + UNBLOCK_CHILD (oset); + return (0); + } +} + +/* Give PID SIGNAL. This determines what job the pid belongs to (if any). + If PID does belong to a job, and the job is stopped, then CONTinue the + job after giving it SIGNAL. Returns -1 on failure. If GROUP is non-null, + then kill the process group associated with PID. */ +int +kill_pid (pid, sig, group) + pid_t pid; + int sig, group; +{ + register PROCESS *p; + int job, result, negative; + sigset_t set, oset; + + if (pid < -1) + { + pid = -pid; + group = negative = 1; + } + else + negative = 0; + + result = EXECUTION_SUCCESS; + if (group) + { + BLOCK_CHILD (set, oset); + p = find_pipeline (pid, 0, &job); + + if (job != NO_JOB) + { + jobs[job]->flags &= ~J_NOTIFIED; + + /* Kill process in backquotes or one started without job control? */ + + /* If we're passed a pid < -1, just call killpg and see what happens */ + if (negative && jobs[job]->pgrp == shell_pgrp) + result = killpg (pid, sig); + /* If we're killing using job control notification, for example, + without job control active, we have to do things ourselves. */ + else if (jobs[job]->pgrp == shell_pgrp) + { + p = jobs[job]->pipe; + do + { + if (PALIVE (p) == 0) + continue; /* avoid pid recycling problem */ + kill (p->pid, sig); + if (PEXITED (p) && (sig == SIGTERM || sig == SIGHUP)) + kill (p->pid, SIGCONT); + p = p->next; + } + while (p != jobs[job]->pipe); + } + else + { + result = killpg (jobs[job]->pgrp, sig); + if (p && STOPPED (job) && (sig == SIGTERM || sig == SIGHUP)) + killpg (jobs[job]->pgrp, SIGCONT); + /* If we're continuing a stopped job via kill rather than bg or + fg, emulate the `bg' behavior. */ + if (p && STOPPED (job) && (sig == SIGCONT)) + { + set_job_running (job); + jobs[job]->flags &= ~J_FOREGROUND; + jobs[job]->flags |= J_NOTIFIED; + } + } + } + else + result = killpg (pid, sig); + + UNBLOCK_CHILD (oset); + } + else + result = kill (pid, sig); + + return (result); +} + +/* sigchld_handler () flushes at least one of the children that we are + waiting for. It gets run when we have gotten a SIGCHLD signal. */ +static sighandler +sigchld_handler (sig) + int sig; +{ + int n, oerrno; + + oerrno = errno; + REINSTALL_SIGCHLD_HANDLER; + sigchld++; + n = 0; + if (queue_sigchld == 0) + n = waitchld (-1, 0); + errno = oerrno; + SIGRETURN (n); +} + +/* waitchld() reaps dead or stopped children. It's called by wait_for and + sigchld_handler, and runs until there aren't any children terminating any + more. + If BLOCK is 1, this is to be a blocking wait for a single child, although + an arriving SIGCHLD could cause the wait to be non-blocking. It returns + the number of children reaped, or -1 if there are no unwaited-for child + processes. */ +static int +waitchld (wpid, block) + pid_t wpid; + int block; +{ + WAIT status; + PROCESS *child; + pid_t pid; + + int call_set_current, last_stopped_job, job, children_exited, waitpid_flags; + static int wcontinued = WCONTINUED; /* run-time fix for glibc problem */ + + call_set_current = children_exited = 0; + last_stopped_job = NO_JOB; + + do + { + /* We don't want to be notified about jobs stopping if job control + is not active. XXX - was interactive_shell instead of job_control */ + waitpid_flags = (job_control && subshell_environment == 0) + ? (WUNTRACED|wcontinued) + : 0; + if (sigchld || block == 0) + waitpid_flags |= WNOHANG; + + /* Check for terminating signals and exit the shell if we receive one */ + CHECK_TERMSIG; + /* Check for a trapped signal interrupting the wait builtin and jump out */ + CHECK_WAIT_INTR; + + if (block == 1 && queue_sigchld == 0 && (waitpid_flags & WNOHANG) == 0) + { + internal_warning (_("waitchld: turning on WNOHANG to avoid indefinite block")); + waitpid_flags |= WNOHANG; + } + + pid = WAITPID (-1, &status, waitpid_flags); + +#if 0 +if (wpid != -1 && block) + itrace("waitchld: blocking waitpid returns %d", pid); +#endif + /* WCONTINUED may be rejected by waitpid as invalid even when defined */ + if (wcontinued && pid < 0 && errno == EINVAL) + { + wcontinued = 0; + continue; /* jump back to the test and retry without WCONTINUED */ + } + + /* The check for WNOHANG is to make sure we decrement sigchld only + if it was non-zero before we called waitpid. */ + if (sigchld > 0 && (waitpid_flags & WNOHANG)) + sigchld--; + + /* If waitpid returns -1 with errno == ECHILD, there are no more + unwaited-for child processes of this shell. */ + if (pid < 0 && errno == ECHILD) + { + if (children_exited == 0) + return -1; + else + break; + } + +#if 0 +itrace("waitchld: waitpid returns %d block = %d", pid, block); +#endif + /* If waitpid returns 0, there are running children. If it returns -1, + the only other error POSIX says it can return is EINTR. */ + CHECK_TERMSIG; + CHECK_WAIT_INTR; + + /* If waitpid returns -1/EINTR and the shell saw a SIGINT, then we + assume the child has blocked or handled SIGINT. In that case, we + require the child to actually die due to SIGINT to act on the + SIGINT we received; otherwise we assume the child handled it and + let it go. */ + if (pid < 0 && errno == EINTR && wait_sigint_received) + child_caught_sigint = 1; + + if (pid <= 0) + continue; /* jumps right to the test */ + + /* If the child process did die due to SIGINT, forget our assumption + that it caught or otherwise handled it. */ + if (WIFSIGNALED (status) && WTERMSIG (status) == SIGINT) + child_caught_sigint = 0; + + /* children_exited is used to run traps on SIGCHLD. We don't want to + run the trap if a process is just being continued. */ + if (WIFCONTINUED(status) == 0) + { + children_exited++; + js.c_living--; + } + + /* Locate our PROCESS for this pid. */ + child = find_process (pid, 1, &job); /* want living procs only */ + +#if defined (COPROCESS_SUPPORT) + coproc_pidchk (pid, WSTATUS(status)); +#endif + + /* It is not an error to have a child terminate that we did + not have a record of. This child could have been part of + a pipeline in backquote substitution. Even so, I'm not + sure child is ever non-zero. */ + if (child == 0) + { + if (WIFEXITED (status) || WIFSIGNALED (status)) + js.c_reaped++; + continue; + } + + /* Remember status, and whether or not the process is running. */ + child->status = status; + child->running = WIFCONTINUED(status) ? PS_RUNNING : PS_DONE; + + if (PEXITED (child)) + { + js.c_totreaped++; + if (job != NO_JOB) + js.c_reaped++; + } + + if (job == NO_JOB) + continue; + + call_set_current += set_job_status_and_cleanup (job); + + if (STOPPED (job)) + last_stopped_job = job; + else if (DEADJOB (job) && last_stopped_job == job) + last_stopped_job = NO_JOB; + } + while ((sigchld || block == 0) && pid > (pid_t)0); + + /* If a job was running and became stopped, then set the current + job. Otherwise, don't change a thing. */ + if (call_set_current) + { + if (last_stopped_job != NO_JOB) + set_current_job (last_stopped_job); + else + reset_current (); + } + + /* Call a SIGCHLD trap handler for each child that exits, if one is set. */ + if (job_control && signal_is_trapped (SIGCHLD) && children_exited && + trap_list[SIGCHLD] != (char *)IGNORE_SIG) + { + if (posixly_correct && this_shell_builtin && this_shell_builtin == wait_builtin) + { + interrupt_immediately = 0; + trap_handler (SIGCHLD); /* set pending_traps[SIGCHLD] */ + wait_signal_received = SIGCHLD; + /* If we're in a signal handler, let CHECK_WAIT_INTR pick it up; + run_pending_traps will call run_sigchld_trap later */ + if (sigchld == 0) + longjmp (wait_intr_buf, 1); + } + /* If not in posix mode and not executing the wait builtin, queue the + signal for later handling. Run the trap immediately if we are + executing the wait builtin, but don't break out of `wait'. */ + else if (sigchld) /* called from signal handler */ + queue_sigchld_trap (children_exited); + else if (running_trap) + queue_sigchld_trap (children_exited); + else if (this_shell_builtin == wait_builtin) + run_sigchld_trap (children_exited); /* XXX */ + else + queue_sigchld_trap (children_exited); + } + + /* We have successfully recorded the useful information about this process + that has just changed state. If we notify asynchronously, and the job + that this process belongs to is no longer running, then notify the user + of that fact now. */ + if (asynchronous_notification && interactive) + notify_of_job_status (); + + return (children_exited); +} + +/* Set the status of JOB and perform any necessary cleanup if the job is + marked as JDEAD. + + Currently, the cleanup activity is restricted to handling any SIGINT + received while waiting for a foreground job to finish. */ +static int +set_job_status_and_cleanup (job) + int job; +{ + PROCESS *child; + int tstatus, job_state, any_stopped, any_tstped, call_set_current; + SigHandler *temp_handler; + + child = jobs[job]->pipe; + jobs[job]->flags &= ~J_NOTIFIED; + + call_set_current = 0; + + /* + * COMPUTE JOB STATUS + */ + + /* If all children are not running, but any of them is stopped, then + the job is stopped, not dead. */ + job_state = any_stopped = any_tstped = 0; + do + { + job_state |= PRUNNING (child); +#if 0 + if (PEXITED (child) && (WIFSTOPPED (child->status))) +#else + /* Only checking for WIFSTOPPED now, not for PS_DONE */ + if (PSTOPPED (child)) +#endif + { + any_stopped = 1; + any_tstped |= job_control && (WSTOPSIG (child->status) == SIGTSTP); + } + child = child->next; + } + while (child != jobs[job]->pipe); + + /* If job_state != 0, the job is still running, so don't bother with + setting the process exit status and job state unless we're + transitioning from stopped to running. */ + if (job_state != 0 && JOBSTATE(job) != JSTOPPED) + return 0; + + /* + * SET JOB STATUS + */ + + /* The job is either stopped or dead. Set the state of the job accordingly. */ + if (any_stopped) + { + jobs[job]->state = JSTOPPED; + jobs[job]->flags &= ~J_FOREGROUND; + call_set_current++; + /* Suspending a job with SIGTSTP breaks all active loops. */ + if (any_tstped && loop_level) + breaking = loop_level; + } + else if (job_state != 0) /* was stopped, now running */ + { + jobs[job]->state = JRUNNING; + call_set_current++; + } + else + { + jobs[job]->state = JDEAD; + js.j_ndead++; + +#if 0 + if (IS_FOREGROUND (job)) + setjstatus (job); +#endif + + /* If this job has a cleanup function associated with it, call it + with `cleanarg' as the single argument, then set the function + pointer to NULL so it is not inadvertently called twice. The + cleanup function is responsible for deallocating cleanarg. */ + if (jobs[job]->j_cleanup) + { + (*jobs[job]->j_cleanup) (jobs[job]->cleanarg); + jobs[job]->j_cleanup = (sh_vptrfunc_t *)NULL; + } + } + + /* + * CLEANUP + * + * Currently, we just do special things if we got a SIGINT while waiting + * for a foreground job to complete + */ + + if (JOBSTATE (job) == JDEAD) + { + /* If we're running a shell script and we get a SIGINT with a + SIGINT trap handler, but the foreground job handles it and + does not exit due to SIGINT, run the trap handler but do not + otherwise act as if we got the interrupt. */ + if (wait_sigint_received && interactive_shell == 0 && + child_caught_sigint && IS_FOREGROUND (job) && + signal_is_trapped (SIGINT)) + { + int old_frozen; + wait_sigint_received = 0; + last_command_exit_value = process_exit_status (child->status); + + old_frozen = jobs_list_frozen; + jobs_list_frozen = 1; + tstatus = maybe_call_trap_handler (SIGINT); + jobs_list_frozen = old_frozen; + } + + /* If the foreground job is killed by SIGINT when job control is not + active, we need to perform some special handling. + + The check of wait_sigint_received is a way to determine if the + SIGINT came from the keyboard (in which case the shell has already + seen it, and wait_sigint_received is non-zero, because keyboard + signals are sent to process groups) or via kill(2) to the foreground + process by another process (or itself). If the shell did receive the + SIGINT, it needs to perform normal SIGINT processing. */ + else if (wait_sigint_received && + child_caught_sigint == 0 && + IS_FOREGROUND (job) && IS_JOBCONTROL (job) == 0) + { + int old_frozen; + + wait_sigint_received = 0; + + /* If SIGINT is trapped, set the exit status so that the trap + handler can see it. */ + if (signal_is_trapped (SIGINT)) + last_command_exit_value = process_exit_status (child->status); + + /* If the signal is trapped, let the trap handler get it no matter + what and simply return if the trap handler returns. + maybe_call_trap_handler() may cause dead jobs to be removed from + the job table because of a call to execute_command. We work + around this by setting JOBS_LIST_FROZEN. */ + old_frozen = jobs_list_frozen; + jobs_list_frozen = 1; + tstatus = maybe_call_trap_handler (SIGINT); + jobs_list_frozen = old_frozen; + if (tstatus == 0 && old_sigint_handler != INVALID_SIGNAL_HANDLER) + { + /* wait_sigint_handler () has already seen SIGINT and + allowed the wait builtin to jump out. We need to + call the original SIGINT handler, if necessary. If + the original handler is SIG_DFL, we need to resend + the signal to ourselves. */ + + temp_handler = old_sigint_handler; + + /* Bogus. If we've reset the signal handler as the result + of a trap caught on SIGINT, then old_sigint_handler + will point to trap_handler, which now knows nothing about + SIGINT (if we reset the sighandler to the default). + In this case, we have to fix things up. What a crock. */ + if (temp_handler == trap_handler && signal_is_trapped (SIGINT) == 0) + temp_handler = trap_to_sighandler (SIGINT); + restore_sigint_handler (); + if (temp_handler == SIG_DFL) + termsig_handler (SIGINT); /* XXX */ + else if (temp_handler != SIG_IGN) + (*temp_handler) (SIGINT); + } + } + } + + return call_set_current; +} + +/* Build the array of values for the $PIPESTATUS variable from the set of + exit statuses of all processes in the job J. */ +static void +setjstatus (j) + int j; +{ +#if defined (ARRAY_VARS) + register int i; + register PROCESS *p; + + for (i = 1, p = jobs[j]->pipe; p->next != jobs[j]->pipe; p = p->next, i++) + ; + i++; + if (statsize < i) + { + pstatuses = (int *)xrealloc (pstatuses, i * sizeof (int)); + statsize = i; + } + i = 0; + p = jobs[j]->pipe; + do + { + pstatuses[i++] = process_exit_status (p->status); + p = p->next; + } + while (p != jobs[j]->pipe); + + pstatuses[i] = -1; /* sentinel */ + set_pipestatus_array (pstatuses, i); +#endif +} + +void +run_sigchld_trap (nchild) + int nchild; +{ + char *trap_command; + int i; + + /* Turn off the trap list during the call to parse_and_execute () + to avoid potentially infinite recursive calls. Preserve the + values of last_command_exit_value, last_made_pid, and the_pipeline + around the execution of the trap commands. */ + trap_command = savestring (trap_list[SIGCHLD]); + + begin_unwind_frame ("SIGCHLD trap"); + unwind_protect_int (last_command_exit_value); + unwind_protect_int (last_command_exit_signal); + unwind_protect_var (last_made_pid); + unwind_protect_int (interrupt_immediately); + unwind_protect_int (jobs_list_frozen); + unwind_protect_pointer (the_pipeline); + unwind_protect_pointer (subst_assign_varlist); + + /* We have to add the commands this way because they will be run + in reverse order of adding. We don't want maybe_set_sigchld_trap () + to reference freed memory. */ + add_unwind_protect (xfree, trap_command); + add_unwind_protect (maybe_set_sigchld_trap, trap_command); + + subst_assign_varlist = (WORD_LIST *)NULL; + the_pipeline = (PROCESS *)NULL; + + running_trap = SIGCHLD + 1; + + set_impossible_sigchld_trap (); + jobs_list_frozen = 1; + for (i = 0; i < nchild; i++) + { +#if 0 + interrupt_immediately = 1; +#endif + parse_and_execute (savestring (trap_command), "trap", SEVAL_NOHIST|SEVAL_RESETLINE); + } + + run_unwind_frame ("SIGCHLD trap"); + running_trap = 0; +} + +/* Function to call when you want to notify people of changes + in job status. This prints out all jobs which are pending + notification to stderr, and marks those printed as already + notified, thus making them candidates for cleanup. */ +static void +notify_of_job_status () +{ + register int job, termsig; + char *dir; + sigset_t set, oset; + WAIT s; + + if (jobs == 0 || js.j_jobslots == 0) + return; + + if (old_ttou != 0) + { + sigemptyset (&set); + sigaddset (&set, SIGCHLD); + sigaddset (&set, SIGTTOU); + sigemptyset (&oset); + sigprocmask (SIG_BLOCK, &set, &oset); + } + else + queue_sigchld++; + + /* XXX could use js.j_firstj here */ + for (job = 0, dir = (char *)NULL; job < js.j_jobslots; job++) + { + if (jobs[job] && IS_NOTIFIED (job) == 0) + { + s = raw_job_exit_status (job); + termsig = WTERMSIG (s); + + /* POSIX.2 says we have to hang onto the statuses of at most the + last CHILD_MAX background processes if the shell is running a + script. If the shell is running a script, either from a file + or standard input, don't print anything unless the job was + killed by a signal. */ + if (startup_state == 0 && WIFSIGNALED (s) == 0 && + ((DEADJOB (job) && IS_FOREGROUND (job) == 0) || STOPPED (job))) + continue; + +#if 0 + /* If job control is disabled, don't print the status messages. + Mark dead jobs as notified so that they get cleaned up. If + startup_state == 2, we were started to run `-c command', so + don't print anything. */ + if ((job_control == 0 && interactive_shell) || startup_state == 2) +#else + /* If job control is disabled, don't print the status messages. + Mark dead jobs as notified so that they get cleaned up. If + startup_state == 2 and subshell_environment has the + SUBSHELL_COMSUB bit turned on, we were started to run a command + substitution, so don't print anything. */ + if ((job_control == 0 && interactive_shell) || + (startup_state == 2 && (subshell_environment & SUBSHELL_COMSUB))) +#endif + { + /* POSIX.2 compatibility: if the shell is not interactive, + hang onto the job corresponding to the last asynchronous + pid until the user has been notified of its status or does + a `wait'. */ + if (DEADJOB (job) && (interactive_shell || (find_last_pid (job, 0) != last_asynchronous_pid))) + jobs[job]->flags |= J_NOTIFIED; + continue; + } + + /* Print info on jobs that are running in the background, + and on foreground jobs that were killed by anything + except SIGINT (and possibly SIGPIPE). */ + switch (JOBSTATE (job)) + { + case JDEAD: + if (interactive_shell == 0 && termsig && WIFSIGNALED (s) && + termsig != SIGINT && +#if defined (DONT_REPORT_SIGTERM) + termsig != SIGTERM && +#endif +#if defined (DONT_REPORT_SIGPIPE) + termsig != SIGPIPE && +#endif + signal_is_trapped (termsig) == 0) + { + /* Don't print `0' for a line number. */ + fprintf (stderr, _("%s: line %d: "), get_name_for_error (), (line_number == 0) ? 1 : line_number); + pretty_print_job (job, JLIST_NONINTERACTIVE, stderr); + } + else if (IS_FOREGROUND (job)) + { +#if !defined (DONT_REPORT_SIGPIPE) + if (termsig && WIFSIGNALED (s) && termsig != SIGINT) +#else + if (termsig && WIFSIGNALED (s) && termsig != SIGINT && termsig != SIGPIPE) +#endif + { + fprintf (stderr, "%s", j_strsignal (termsig)); + + if (WIFCORED (s)) + fprintf (stderr, _(" (core dumped)")); + + fprintf (stderr, "\n"); + } + } + else if (job_control) /* XXX job control test added */ + { + if (dir == 0) + dir = current_working_directory (); + pretty_print_job (job, JLIST_STANDARD, stderr); + if (dir && strcmp (dir, jobs[job]->wd) != 0) + fprintf (stderr, + _("(wd now: %s)\n"), polite_directory_format (dir)); + } + + jobs[job]->flags |= J_NOTIFIED; + break; + + case JSTOPPED: + fprintf (stderr, "\n"); + if (dir == 0) + dir = current_working_directory (); + pretty_print_job (job, JLIST_STANDARD, stderr); + if (dir && (strcmp (dir, jobs[job]->wd) != 0)) + fprintf (stderr, + _("(wd now: %s)\n"), polite_directory_format (dir)); + jobs[job]->flags |= J_NOTIFIED; + break; + + case JRUNNING: + case JMIXED: + break; + + default: + programming_error ("notify_of_job_status"); + } + } + } + if (old_ttou != 0) + sigprocmask (SIG_SETMASK, &oset, (sigset_t *)NULL); + else + queue_sigchld--; +} + +/* Initialize the job control mechanism, and set up the tty stuff. */ +int +initialize_job_control (force) + int force; +{ + pid_t t; + int t_errno; + + t_errno = -1; + shell_pgrp = getpgid (0); + + if (shell_pgrp == -1) + { + sys_error (_("initialize_job_control: getpgrp failed")); + exit (1); + } + + /* We can only have job control if we are interactive unless we force it. */ + if (interactive == 0 && force == 0) + { + job_control = 0; + original_pgrp = NO_PID; + shell_tty = fileno (stderr); + } + else + { + shell_tty = -1; + + /* If forced_interactive is set, we skip the normal check that stderr + is attached to a tty, so we need to check here. If it's not, we + need to see whether we have a controlling tty by opening /dev/tty, + since trying to use job control tty pgrp manipulations on a non-tty + is going to fail. */ + if (forced_interactive && isatty (fileno (stderr)) == 0) + shell_tty = open ("/dev/tty", O_RDWR|O_NONBLOCK); + + /* Get our controlling terminal. If job_control is set, or + interactive is set, then this is an interactive shell no + matter where fd 2 is directed. */ + if (shell_tty == -1) + shell_tty = dup (fileno (stderr)); /* fd 2 */ + + if (shell_tty != -1) + shell_tty = move_to_high_fd (shell_tty, 1, -1); + + /* Compensate for a bug in systems that compiled the BSD + rlogind with DEBUG defined, like NeXT and Alliant. */ + if (shell_pgrp == 0) + { + shell_pgrp = getpid (); + setpgid (0, shell_pgrp); + tcsetpgrp (shell_tty, shell_pgrp); + } + + while ((terminal_pgrp = tcgetpgrp (shell_tty)) != -1) + { + if (shell_pgrp != terminal_pgrp) + { + SigHandler *ottin; + + ottin = set_signal_handler(SIGTTIN, SIG_DFL); + kill (0, SIGTTIN); + set_signal_handler (SIGTTIN, ottin); + continue; + } + break; + } + + if (terminal_pgrp == -1) + t_errno = errno; + + /* Make sure that we are using the new line discipline. */ + if (set_new_line_discipline (shell_tty) < 0) + { + sys_error (_("initialize_job_control: line discipline")); + job_control = 0; + } + else + { + original_pgrp = shell_pgrp; + shell_pgrp = getpid (); + + if ((original_pgrp != shell_pgrp) && (setpgid (0, shell_pgrp) < 0)) + { + sys_error (_("initialize_job_control: setpgid")); + shell_pgrp = original_pgrp; + } + + job_control = 1; + + /* If (and only if) we just set our process group to our pid, + thereby becoming a process group leader, and the terminal + is not in the same process group as our (new) process group, + then set the terminal's process group to our (new) process + group. If that fails, set our process group back to what it + was originally (so we can still read from the terminal) and + turn off job control. */ + if (shell_pgrp != original_pgrp && shell_pgrp != terminal_pgrp) + { + if (give_terminal_to (shell_pgrp, 0) < 0) + { + t_errno = errno; + setpgid (0, original_pgrp); + shell_pgrp = original_pgrp; + errno = t_errno; + sys_error (_("cannot set terminal process group (%d)"), shell_pgrp); + job_control = 0; + } + } + + if (job_control && ((t = tcgetpgrp (shell_tty)) == -1 || t != shell_pgrp)) + { + if (t_errno != -1) + errno = t_errno; + sys_error (_("cannot set terminal process group (%d)"), t); + job_control = 0; + } + } + if (job_control == 0) + internal_error (_("no job control in this shell")); + } + + if (shell_tty != fileno (stderr)) + SET_CLOSE_ON_EXEC (shell_tty); + + set_signal_handler (SIGCHLD, sigchld_handler); + + change_flag ('m', job_control ? '-' : '+'); + + if (interactive) + get_tty_state (); + + if (js.c_childmax < 0) + js.c_childmax = getmaxchild (); + if (js.c_childmax < 0) + js.c_childmax = DEFAULT_CHILD_MAX; + + return job_control; +} + +#ifdef DEBUG +void +debug_print_pgrps () +{ + itrace("original_pgrp = %ld shell_pgrp = %ld terminal_pgrp = %ld", + (long)original_pgrp, (long)shell_pgrp, (long)terminal_pgrp); + itrace("tcgetpgrp(%d) -> %ld, getpgid(0) -> %ld", + shell_tty, (long)tcgetpgrp (shell_tty), (long)getpgid(0)); +} +#endif + +/* Set the line discipline to the best this system has to offer. + Return -1 if this is not possible. */ +static int +set_new_line_discipline (tty) + int tty; +{ +#if defined (NEW_TTY_DRIVER) + int ldisc; + + if (ioctl (tty, TIOCGETD, &ldisc) < 0) + return (-1); + + if (ldisc != NTTYDISC) + { + ldisc = NTTYDISC; + + if (ioctl (tty, TIOCSETD, &ldisc) < 0) + return (-1); + } + return (0); +#endif /* NEW_TTY_DRIVER */ + +#if defined (TERMIO_TTY_DRIVER) +# if defined (TERMIO_LDISC) && (NTTYDISC) + if (ioctl (tty, TCGETA, &shell_tty_info) < 0) + return (-1); + + if (shell_tty_info.c_line != NTTYDISC) + { + shell_tty_info.c_line = NTTYDISC; + if (ioctl (tty, TCSETAW, &shell_tty_info) < 0) + return (-1); + } +# endif /* TERMIO_LDISC && NTTYDISC */ + return (0); +#endif /* TERMIO_TTY_DRIVER */ + +#if defined (TERMIOS_TTY_DRIVER) +# if defined (TERMIOS_LDISC) && defined (NTTYDISC) + if (tcgetattr (tty, &shell_tty_info) < 0) + return (-1); + + if (shell_tty_info.c_line != NTTYDISC) + { + shell_tty_info.c_line = NTTYDISC; + if (tcsetattr (tty, TCSADRAIN, &shell_tty_info) < 0) + return (-1); + } +# endif /* TERMIOS_LDISC && NTTYDISC */ + return (0); +#endif /* TERMIOS_TTY_DRIVER */ + +#if !defined (NEW_TTY_DRIVER) && !defined (TERMIO_TTY_DRIVER) && !defined (TERMIOS_TTY_DRIVER) + return (-1); +#endif +} + +/* Setup this shell to handle C-C, etc. */ +void +initialize_job_signals () +{ + if (interactive) + { + set_signal_handler (SIGINT, sigint_sighandler); + set_signal_handler (SIGTSTP, SIG_IGN); + set_signal_handler (SIGTTOU, SIG_IGN); + set_signal_handler (SIGTTIN, SIG_IGN); + } + else if (job_control) + { + old_tstp = set_signal_handler (SIGTSTP, sigstop_sighandler); + old_ttin = set_signal_handler (SIGTTIN, sigstop_sighandler); + old_ttou = set_signal_handler (SIGTTOU, sigstop_sighandler); + } + /* Leave these things alone for non-interactive shells without job + control. */ +} + +/* Here we handle CONT signals. */ +static sighandler +sigcont_sighandler (sig) + int sig; +{ + initialize_job_signals (); + set_signal_handler (SIGCONT, old_cont); + kill (getpid (), SIGCONT); + + SIGRETURN (0); +} + +/* Here we handle stop signals while we are running not as a login shell. */ +static sighandler +sigstop_sighandler (sig) + int sig; +{ + set_signal_handler (SIGTSTP, old_tstp); + set_signal_handler (SIGTTOU, old_ttou); + set_signal_handler (SIGTTIN, old_ttin); + + old_cont = set_signal_handler (SIGCONT, sigcont_sighandler); + + give_terminal_to (shell_pgrp, 0); + + kill (getpid (), sig); + + SIGRETURN (0); +} + +/* Give the terminal to PGRP. */ +int +give_terminal_to (pgrp, force) + pid_t pgrp; + int force; +{ + sigset_t set, oset; + int r, e; + + r = 0; + if (job_control || force) + { + sigemptyset (&set); + sigaddset (&set, SIGTTOU); + sigaddset (&set, SIGTTIN); + sigaddset (&set, SIGTSTP); + sigaddset (&set, SIGCHLD); + sigemptyset (&oset); + sigprocmask (SIG_BLOCK, &set, &oset); + + if (tcsetpgrp (shell_tty, pgrp) < 0) + { + /* Maybe we should print an error message? */ +#if 0 + sys_error ("tcsetpgrp(%d) failed: pid %ld to pgrp %ld", + shell_tty, (long)getpid(), (long)pgrp); +#endif + r = -1; + e = errno; + } + else + terminal_pgrp = pgrp; + sigprocmask (SIG_SETMASK, &oset, (sigset_t *)NULL); + } + + if (r == -1) + errno = e; + + return r; +} + +/* Give terminal to NPGRP iff it's currently owned by OPGRP. FLAGS are the + flags to pass to give_terminal_to(). */ +static int +maybe_give_terminal_to (opgrp, npgrp, flags) + pid_t opgrp, npgrp; + int flags; +{ + int tpgrp; + + tpgrp = tcgetpgrp (shell_tty); + if (tpgrp < 0 && errno == ENOTTY) + return -1; + if (tpgrp == npgrp) + { + terminal_pgrp = npgrp; + return 0; + } + else if (tpgrp != opgrp) + { +#if defined (DEBUG) + internal_warning ("maybe_give_terminal_to: terminal pgrp == %d shell pgrp = %d new pgrp = %d", tpgrp, opgrp, npgrp); +#endif + return -1; + } + else + return (give_terminal_to (npgrp, flags)); +} + +/* Clear out any jobs in the job array. This is intended to be used by + children of the shell, who should not have any job structures as baggage + when they start executing (forking subshells for parenthesized execution + and functions with pipes are the two that spring to mind). If RUNNING_ONLY + is nonzero, only running jobs are removed from the table. */ +void +delete_all_jobs (running_only) + int running_only; +{ + register int i; + sigset_t set, oset; + + BLOCK_CHILD (set, oset); + + /* XXX - need to set j_lastj, j_firstj appropriately if running_only != 0. */ + if (js.j_jobslots) + { + js.j_current = js.j_previous = NO_JOB; + + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("delete_all_jobs: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("delete_all_jobs: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + if (jobs[i] && (running_only == 0 || (running_only && RUNNING(i)))) + delete_job (i, DEL_WARNSTOPPED); + } + if (running_only == 0) + { + free ((char *)jobs); + js.j_jobslots = 0; + js.j_firstj = js.j_lastj = js.j_njobs = 0; + } + } + + if (running_only == 0) + bgp_clear (); + + UNBLOCK_CHILD (oset); +} + +/* Mark all jobs in the job array so that they don't get a SIGHUP when the + shell gets one. If RUNNING_ONLY is nonzero, mark only running jobs. */ +void +nohup_all_jobs (running_only) + int running_only; +{ + register int i; + sigset_t set, oset; + + BLOCK_CHILD (set, oset); + + if (js.j_jobslots) + { + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + if (jobs[i] && (running_only == 0 || (running_only && RUNNING(i)))) + nohup_job (i); + } + + UNBLOCK_CHILD (oset); +} + +int +count_all_jobs () +{ + int i, n; + sigset_t set, oset; + + /* This really counts all non-dead jobs. */ + BLOCK_CHILD (set, oset); + /* XXX could use js.j_firstj here */ + for (i = n = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("count_all_jobs: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("count_all_jobs: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + if (jobs[i] && DEADJOB(i) == 0) + n++; + } + UNBLOCK_CHILD (oset); + return n; +} + +static void +mark_all_jobs_as_dead () +{ + register int i; + sigset_t set, oset; + + if (js.j_jobslots == 0) + return; + + BLOCK_CHILD (set, oset); + + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + if (jobs[i]) + { + jobs[i]->state = JDEAD; + js.j_ndead++; + } + + UNBLOCK_CHILD (oset); +} + +/* Mark all dead jobs as notified, so delete_job () cleans them out + of the job table properly. POSIX.2 says we need to save the + status of the last CHILD_MAX jobs, so we count the number of dead + jobs and mark only enough as notified to save CHILD_MAX statuses. */ +static void +mark_dead_jobs_as_notified (force) + int force; +{ + register int i, ndead, ndeadproc; + sigset_t set, oset; + + if (js.j_jobslots == 0) + return; + + BLOCK_CHILD (set, oset); + + /* If FORCE is non-zero, we don't have to keep CHILD_MAX statuses + around; just run through the array. */ + if (force) + { + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + { + if (jobs[i] && DEADJOB (i) && (interactive_shell || (find_last_pid (i, 0) != last_asynchronous_pid))) + jobs[i]->flags |= J_NOTIFIED; + } + UNBLOCK_CHILD (oset); + return; + } + + /* Mark enough dead jobs as notified to keep CHILD_MAX processes left in the + array with the corresponding not marked as notified. This is a better + way to avoid pid aliasing and reuse problems than keeping the POSIX- + mandated CHILD_MAX jobs around. delete_job() takes care of keeping the + bgpids list regulated. */ + + /* Count the number of dead jobs */ + /* XXX could use js.j_firstj here */ + for (i = ndead = ndeadproc = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("mark_dead_jobs_as_notified: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("mark_dead_jobs_as_notified: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + if (jobs[i] && DEADJOB (i)) + { + ndead++; + ndeadproc += processes_in_job (i); + } + } + +#ifdef DEBUG +# if 0 + if (ndeadproc != js.c_reaped) + itrace("mark_dead_jobs_as_notified: ndeadproc (%d) != js.c_reaped (%d)", ndeadproc, js.c_reaped); +# endif + if (ndead != js.j_ndead) + itrace("mark_dead_jobs_as_notified: ndead (%d) != js.j_ndead (%d)", ndead, js.j_ndead); +#endif + + if (js.c_childmax < 0) + js.c_childmax = getmaxchild (); + if (js.c_childmax < 0) + js.c_childmax = DEFAULT_CHILD_MAX; + + /* Don't do anything if the number of dead processes is less than CHILD_MAX + and we're not forcing a cleanup. */ + if (ndeadproc <= js.c_childmax) + { + UNBLOCK_CHILD (oset); + return; + } + +#if 0 +itrace("mark_dead_jobs_as_notified: child_max = %d ndead = %d ndeadproc = %d", js.c_childmax, ndead, ndeadproc); +#endif + + /* Mark enough dead jobs as notified that we keep CHILD_MAX jobs in + the list. This isn't exactly right yet; changes need to be made + to stop_pipeline so we don't mark the newer jobs after we've + created CHILD_MAX slots in the jobs array. This needs to be + integrated with a way to keep the jobs array from growing without + bound. Maybe we wrap back around to 0 after we reach some max + limit, and there are sufficient job slots free (keep track of total + size of jobs array (js.j_jobslots) and running count of number of jobs + in jobs array. Then keep a job index corresponding to the `oldest job' + and start this loop there, wrapping around as necessary. In effect, + we turn the list into a circular buffer. */ + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + { + if (jobs[i] && DEADJOB (i) && (interactive_shell || (find_last_pid (i, 0) != last_asynchronous_pid))) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("mark_dead_jobs_as_notified: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("mark_dead_jobs_as_notified: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + /* If marking this job as notified would drop us down below + child_max, don't mark it so we can keep at least child_max + statuses. XXX -- need to check what Posix actually says + about keeping statuses. */ + if ((ndeadproc -= processes_in_job (i)) <= js.c_childmax) + break; + jobs[i]->flags |= J_NOTIFIED; + } + } + + UNBLOCK_CHILD (oset); +} + +/* Here to allow other parts of the shell (like the trap stuff) to + freeze and unfreeze the jobs list. */ +void +freeze_jobs_list () +{ + jobs_list_frozen = 1; +} + +void +unfreeze_jobs_list () +{ + jobs_list_frozen = 0; +} + +/* Allow or disallow job control to take place. Returns the old value + of job_control. */ +int +set_job_control (arg) + int arg; +{ + int old; + + old = job_control; + job_control = arg; + + /* If we're turning on job control, reset pipeline_pgrp so make_child will + put new child processes into the right pgrp */ + if (job_control != old && job_control) + pipeline_pgrp = 0; + + return (old); +} + +/* Turn off all traces of job control. This is run by children of the shell + which are going to do shellsy things, like wait (), etc. */ +void +without_job_control () +{ + stop_making_children (); + start_pipeline (); +#if defined (PGRP_PIPE) + sh_closepipe (pgrp_pipe); +#endif + delete_all_jobs (0); + set_job_control (0); +} + +/* If this shell is interactive, terminate all stopped jobs and + restore the original terminal process group. This is done + before the `exec' builtin calls shell_execve. */ +void +end_job_control () +{ + if (interactive_shell || job_control) /* XXX - should it be just job_control? */ + { + terminate_stopped_jobs (); + + if (original_pgrp >= 0) + give_terminal_to (original_pgrp, 1); + } + + if (original_pgrp >= 0) + setpgid (0, original_pgrp); +} + +/* Restart job control by closing shell tty and reinitializing. This is + called after an exec fails in an interactive shell and we do not exit. */ +void +restart_job_control () +{ + if (shell_tty != -1) + close (shell_tty); + initialize_job_control (0); +} + +void +set_maxchild (nchild) + int nchild; +{ + static int lmaxchild = -1; + + if (lmaxchild < 0) + lmaxchild = getmaxchild (); + if (lmaxchild < 0) + lmaxchild = DEFAULT_CHILD_MAX; + + /* Clamp value we set. Minimum is what Posix requires, maximum is defined + above as MAX_CHILD_MAX. */ + if (nchild < lmaxchild) + nchild = lmaxchild; + else if (nchild > MAX_CHILD_MAX) + nchild = MAX_CHILD_MAX; + + js.c_childmax = nchild; +} + +/* Set the handler to run when the shell receives a SIGCHLD signal. */ +void +set_sigchld_handler () +{ + set_signal_handler (SIGCHLD, sigchld_handler); +} + +#if defined (PGRP_PIPE) +/* Read from the read end of a pipe. This is how the process group leader + blocks until all of the processes in a pipeline have been made. */ +static void +pipe_read (pp) + int *pp; +{ + char ch; + + if (pp[1] >= 0) + { + close (pp[1]); + pp[1] = -1; + } + + if (pp[0] >= 0) + { + while (read (pp[0], &ch, 1) == -1 && errno == EINTR) + ; + } +} + +/* Functional interface closes our local-to-job-control pipes. */ +void +close_pgrp_pipe () +{ + sh_closepipe (pgrp_pipe); +} + +void +save_pgrp_pipe (p, clear) + int *p; + int clear; +{ + p[0] = pgrp_pipe[0]; + p[1] = pgrp_pipe[1]; + if (clear) + pgrp_pipe[0] = pgrp_pipe[1] = -1; +} + +void +restore_pgrp_pipe (p) + int *p; +{ + pgrp_pipe[0] = p[0]; + pgrp_pipe[1] = p[1]; +} + +#endif /* PGRP_PIPE */ diff --git a/.pc/bash43-012.diff/patchlevel.h b/.pc/bash43-012.diff/patchlevel.h new file mode 100644 index 0000000..b7c2ff4 --- /dev/null +++ b/.pc/bash43-012.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 11 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-013.diff/lib/readline/display.c b/.pc/bash43-013.diff/lib/readline/display.c new file mode 100644 index 0000000..dccfdc7 --- /dev/null +++ b/.pc/bash43-013.diff/lib/readline/display.c @@ -0,0 +1,2819 @@ +/* display.c -- readline redisplay facility. */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif /* HAVE_UNISTD_H */ + +#include "posixstat.h" + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include + +#ifdef __MSDOS__ +# include +#endif + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" +#include "rlmbutil.h" + +/* Termcap library stuff. */ +#include "tcap.h" + +/* Some standard library routines. */ +#include "readline.h" +#include "history.h" + +#include "rlprivate.h" +#include "xmalloc.h" + +#if !defined (strchr) && !defined (__STDC__) +extern char *strchr (), *strrchr (); +#endif /* !strchr && !__STDC__ */ + +static void update_line PARAMS((char *, char *, int, int, int, int)); +static void space_to_eol PARAMS((int)); +static void delete_chars PARAMS((int)); +static void insert_some_chars PARAMS((char *, int, int)); +static void open_some_spaces PARAMS((int)); +static void cr PARAMS((void)); + +/* State of visible and invisible lines. */ +struct line_state + { + char *line; + int *lbreaks; + int lbsize; +#if defined (HANDLE_MULTIBYTE) + int *wrapped_line; + int wbsize; +#endif + }; + +/* The line display buffers. One is the line currently displayed on + the screen. The other is the line about to be displayed. */ +static struct line_state line_state_array[2]; +static struct line_state *line_state_visible = &line_state_array[0]; +static struct line_state *line_state_invisible = &line_state_array[1]; +static int line_structures_initialized = 0; + +/* Backwards-compatible names. */ +#define inv_lbreaks (line_state_invisible->lbreaks) +#define inv_lbsize (line_state_invisible->lbsize) +#define vis_lbreaks (line_state_visible->lbreaks) +#define vis_lbsize (line_state_visible->lbsize) + +#define visible_line (line_state_visible->line) +#define invisible_line (line_state_invisible->line) + +#if defined (HANDLE_MULTIBYTE) +static int _rl_col_width PARAMS((const char *, int, int, int)); +#else +# define _rl_col_width(l, s, e, f) (((e) <= (s)) ? 0 : (e) - (s)) +#endif + +/* Heuristic used to decide whether it is faster to move from CUR to NEW + by backing up or outputting a carriage return and moving forward. CUR + and NEW are either both buffer positions or absolute screen positions. */ +#define CR_FASTER(new, cur) (((new) + 1) < ((cur) - (new))) + +/* _rl_last_c_pos is an absolute cursor position in multibyte locales and a + buffer index in others. This macro is used when deciding whether the + current cursor position is in the middle of a prompt string containing + invisible characters. XXX - might need to take `modmark' into account. */ +#define PROMPT_ENDING_INDEX \ + ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) ? prompt_physical_chars : prompt_last_invisible+1) + + +/* **************************************************************** */ +/* */ +/* Display stuff */ +/* */ +/* **************************************************************** */ + +/* This is the stuff that is hard for me. I never seem to write good + display routines in C. Let's see how I do this time. */ + +/* (PWP) Well... Good for a simple line updater, but totally ignores + the problems of input lines longer than the screen width. + + update_line and the code that calls it makes a multiple line, + automatically wrapping line update. Careful attention needs + to be paid to the vertical position variables. */ + +/* Keep two buffers; one which reflects the current contents of the + screen, and the other to draw what we think the new contents should + be. Then compare the buffers, and make whatever changes to the + screen itself that we should. Finally, make the buffer that we + just drew into be the one which reflects the current contents of the + screen, and place the cursor where it belongs. + + Commands that want to can fix the display themselves, and then let + this function know that the display has been fixed by setting the + RL_DISPLAY_FIXED variable. This is good for efficiency. */ + +/* Application-specific redisplay function. */ +rl_voidfunc_t *rl_redisplay_function = rl_redisplay; + +/* Global variables declared here. */ +/* What YOU turn on when you have handled all redisplay yourself. */ +int rl_display_fixed = 0; + +int _rl_suppress_redisplay = 0; +int _rl_want_redisplay = 0; + +/* The stuff that gets printed out before the actual text of the line. + This is usually pointing to rl_prompt. */ +char *rl_display_prompt = (char *)NULL; + +/* Pseudo-global variables declared here. */ + +/* The visible cursor position. If you print some text, adjust this. */ +/* NOTE: _rl_last_c_pos is used as a buffer index when not in a locale + supporting multibyte characters, and an absolute cursor position when + in such a locale. This is an artifact of the donated multibyte support. + Care must be taken when modifying its value. */ +int _rl_last_c_pos = 0; +int _rl_last_v_pos = 0; + +static int cpos_adjusted; +static int cpos_buffer_position; +static int displaying_prompt_first_line; +static int prompt_multibyte_chars; + +/* Number of lines currently on screen minus 1. */ +int _rl_vis_botlin = 0; + +/* Variables used only in this file. */ +/* The last left edge of text that was displayed. This is used when + doing horizontal scrolling. It shifts in thirds of a screenwidth. */ +static int last_lmargin; + +/* A buffer for `modeline' messages. */ +static char *msg_buf = 0; +static int msg_bufsiz = 0; + +/* Non-zero forces the redisplay even if we thought it was unnecessary. */ +static int forced_display; + +/* Default and initial buffer size. Can grow. */ +static int line_size = 1024; + +/* Variables to keep track of the expanded prompt string, which may + include invisible characters. */ + +static char *local_prompt, *local_prompt_prefix; +static int local_prompt_len; +static int prompt_visible_length, prompt_prefix_length; + +/* The number of invisible characters in the line currently being + displayed on the screen. */ +static int visible_wrap_offset; + +/* The number of invisible characters in the prompt string. Static so it + can be shared between rl_redisplay and update_line */ +static int wrap_offset; + +/* The index of the last invisible character in the prompt string. */ +static int prompt_last_invisible; + +/* The length (buffer offset) of the first line of the last (possibly + multi-line) buffer displayed on the screen. */ +static int visible_first_line_len; + +/* Number of invisible characters on the first physical line of the prompt. + Only valid when the number of physical characters in the prompt exceeds + (or is equal to) _rl_screenwidth. */ +static int prompt_invis_chars_first_line; + +static int prompt_last_screen_line; + +static int prompt_physical_chars; + +/* set to a non-zero value by rl_redisplay if we are marking modified history + lines and the current line is so marked. */ +static int modmark; + +/* Variables to save and restore prompt and display information. */ + +/* These are getting numerous enough that it's time to create a struct. */ + +static char *saved_local_prompt; +static char *saved_local_prefix; +static int saved_last_invisible; +static int saved_visible_length; +static int saved_prefix_length; +static int saved_local_length; +static int saved_invis_chars_first_line; +static int saved_physical_chars; + +/* Return a character indicating the editing mode, for use in the prompt. */ +static int +prompt_modechar () +{ + if (rl_editing_mode == emacs_mode) + return '@'; + else if (_rl_keymap == vi_insertion_keymap) + return '+'; /* vi insert mode */ + else + return ':'; /* vi command mode */ +} + +/* Expand the prompt string S and return the number of visible + characters in *LP, if LP is not null. This is currently more-or-less + a placeholder for expansion. LIP, if non-null is a place to store the + index of the last invisible character in the returned string. NIFLP, + if non-zero, is a place to store the number of invisible characters in + the first prompt line. The previous are used as byte counts -- indexes + into a character buffer. */ + +/* Current implementation: + \001 (^A) start non-visible characters + \002 (^B) end non-visible characters + all characters except \001 and \002 (following a \001) are copied to + the returned string; all characters except those between \001 and + \002 are assumed to be `visible'. */ + +static char * +expand_prompt (pmt, lp, lip, niflp, vlp) + char *pmt; + int *lp, *lip, *niflp, *vlp; +{ + char *r, *ret, *p, *igstart; + int l, rl, last, ignoring, ninvis, invfl, invflset, ind, pind, physchars; + + /* Short-circuit if we can. */ + if ((MB_CUR_MAX <= 1 || rl_byte_oriented) && strchr (pmt, RL_PROMPT_START_IGNORE) == 0) + { + if (pmt == rl_prompt && _rl_show_mode_in_prompt) + { + l = strlen (pmt); + r = (char *)xmalloc (l + 2); + r[0] = prompt_modechar (); + strcpy (r + 1, pmt); + } + else + r = savestring (pmt); + + if (lp) + *lp = strlen (r); + if (lip) + *lip = 0; + if (niflp) + *niflp = 0; + if (vlp) + *vlp = lp ? *lp : strlen (r); + return r; + } + + l = strlen (pmt); + r = ret = (char *)xmalloc (l + 2); + + rl = physchars = 0; /* move up here so mode show can set them */ + if (pmt == rl_prompt && _rl_show_mode_in_prompt) + { + *r++ = prompt_modechar (); + rl = physchars = 1; + } + + invfl = 0; /* invisible chars in first line of prompt */ + invflset = 0; /* we only want to set invfl once */ + + igstart = 0; + for (ignoring = last = ninvis = 0, p = pmt; p && *p; p++) + { + /* This code strips the invisible character string markers + RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE */ + if (ignoring == 0 && *p == RL_PROMPT_START_IGNORE) /* XXX - check ignoring? */ + { + ignoring = 1; + igstart = p; + continue; + } + else if (ignoring && *p == RL_PROMPT_END_IGNORE) + { + ignoring = 0; + if (p != (igstart + 1)) + last = r - ret - 1; + continue; + } + else + { +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + pind = p - pmt; + ind = _rl_find_next_mbchar (pmt, pind, 1, MB_FIND_NONZERO); + l = ind - pind; + while (l--) + *r++ = *p++; + if (!ignoring) + { + /* rl ends up being assigned to prompt_visible_length, + which is the number of characters in the buffer that + contribute to characters on the screen, which might + not be the same as the number of physical characters + on the screen in the presence of multibyte characters */ + rl += ind - pind; + physchars += _rl_col_width (pmt, pind, ind, 0); + } + else + ninvis += ind - pind; + p--; /* compensate for later increment */ + } + else +#endif + { + *r++ = *p; + if (!ignoring) + { + rl++; /* visible length byte counter */ + physchars++; + } + else + ninvis++; /* invisible chars byte counter */ + } + + if (invflset == 0 && rl >= _rl_screenwidth) + { + invfl = ninvis; + invflset = 1; + } + } + } + + if (rl < _rl_screenwidth) + invfl = ninvis; + + *r = '\0'; + if (lp) + *lp = rl; + if (lip) + *lip = last; + if (niflp) + *niflp = invfl; + if (vlp) + *vlp = physchars; + return ret; +} + +/* Just strip out RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE from + PMT and return the rest of PMT. */ +char * +_rl_strip_prompt (pmt) + char *pmt; +{ + char *ret; + + ret = expand_prompt (pmt, (int *)NULL, (int *)NULL, (int *)NULL, (int *)NULL); + return ret; +} + +void +_rl_reset_prompt () +{ + rl_visible_prompt_length = rl_expand_prompt (rl_prompt); +} + +/* + * Expand the prompt string into the various display components, if + * necessary. + * + * local_prompt = expanded last line of string in rl_display_prompt + * (portion after the final newline) + * local_prompt_prefix = portion before last newline of rl_display_prompt, + * expanded via expand_prompt + * prompt_visible_length = number of visible characters in local_prompt + * prompt_prefix_length = number of visible characters in local_prompt_prefix + * + * This function is called once per call to readline(). It may also be + * called arbitrarily to expand the primary prompt. + * + * The return value is the number of visible characters on the last line + * of the (possibly multi-line) prompt. + */ +int +rl_expand_prompt (prompt) + char *prompt; +{ + char *p, *t; + int c; + + /* Clear out any saved values. */ + FREE (local_prompt); + FREE (local_prompt_prefix); + + local_prompt = local_prompt_prefix = (char *)0; + local_prompt_len = 0; + prompt_last_invisible = prompt_invis_chars_first_line = 0; + prompt_visible_length = prompt_physical_chars = 0; + + if (prompt == 0 || *prompt == 0) + return (0); + + p = strrchr (prompt, '\n'); + if (!p) + { + /* The prompt is only one logical line, though it might wrap. */ + local_prompt = expand_prompt (prompt, &prompt_visible_length, + &prompt_last_invisible, + &prompt_invis_chars_first_line, + &prompt_physical_chars); + local_prompt_prefix = (char *)0; + local_prompt_len = local_prompt ? strlen (local_prompt) : 0; + return (prompt_visible_length); + } + else + { + /* The prompt spans multiple lines. */ + t = ++p; + local_prompt = expand_prompt (p, &prompt_visible_length, + &prompt_last_invisible, + &prompt_invis_chars_first_line, + &prompt_physical_chars); + c = *t; *t = '\0'; + /* The portion of the prompt string up to and including the + final newline is now null-terminated. */ + local_prompt_prefix = expand_prompt (prompt, &prompt_prefix_length, + (int *)NULL, + (int *)NULL, + (int *)NULL); + *t = c; + local_prompt_len = local_prompt ? strlen (local_prompt) : 0; + return (prompt_prefix_length); + } +} + +/* Initialize the VISIBLE_LINE and INVISIBLE_LINE arrays, and their associated + arrays of line break markers. MINSIZE is the minimum size of VISIBLE_LINE + and INVISIBLE_LINE; if it is greater than LINE_SIZE, LINE_SIZE is + increased. If the lines have already been allocated, this ensures that + they can hold at least MINSIZE characters. */ +static void +init_line_structures (minsize) + int minsize; +{ + register int n; + + if (invisible_line == 0) /* initialize it */ + { + if (line_size < minsize) + line_size = minsize; + visible_line = (char *)xmalloc (line_size); + invisible_line = (char *)xmalloc (line_size); + } + else if (line_size < minsize) /* ensure it can hold MINSIZE chars */ + { + line_size *= 2; + if (line_size < minsize) + line_size = minsize; + visible_line = (char *)xrealloc (visible_line, line_size); + invisible_line = (char *)xrealloc (invisible_line, line_size); + } + + for (n = minsize; n < line_size; n++) + { + visible_line[n] = 0; + invisible_line[n] = 1; + } + + if (vis_lbreaks == 0) + { + /* should be enough. */ + inv_lbsize = vis_lbsize = 256; + +#if defined (HANDLE_MULTIBYTE) + line_state_visible->wbsize = vis_lbsize; + line_state_visible->wrapped_line = (int *)xmalloc (line_state_visible->wbsize * sizeof (int)); + + line_state_invisible->wbsize = inv_lbsize; + line_state_invisible->wrapped_line = (int *)xmalloc (line_state_invisible->wbsize * sizeof (int)); +#endif + + inv_lbreaks = (int *)xmalloc (inv_lbsize * sizeof (int)); + vis_lbreaks = (int *)xmalloc (vis_lbsize * sizeof (int)); + inv_lbreaks[0] = vis_lbreaks[0] = 0; + } + + line_structures_initialized = 1; +} + +/* Basic redisplay algorithm. */ +void +rl_redisplay () +{ + register int in, out, c, linenum, cursor_linenum; + register char *line; + int inv_botlin, lb_botlin, lb_linenum, o_cpos; + int newlines, lpos, temp, n0, num, prompt_lines_estimate; + char *prompt_this_line; +#if defined (HANDLE_MULTIBYTE) + wchar_t wc; + size_t wc_bytes; + int wc_width; + mbstate_t ps; + int _rl_wrapped_multicolumn = 0; +#endif + + if (_rl_echoing_p == 0) + return; + + /* Block keyboard interrupts because this function manipulates global + data structures. */ + _rl_block_sigint (); + RL_SETSTATE (RL_STATE_REDISPLAYING); + + if (!rl_display_prompt) + rl_display_prompt = ""; + + if (line_structures_initialized == 0) + { + init_line_structures (0); + rl_on_new_line (); + } + + /* Draw the line into the buffer. */ + cpos_buffer_position = -1; + + prompt_multibyte_chars = prompt_visible_length - prompt_physical_chars; + + line = invisible_line; + out = inv_botlin = 0; + + /* Mark the line as modified or not. We only do this for history + lines. */ + modmark = 0; + if (_rl_mark_modified_lines && current_history () && rl_undo_list) + { + line[out++] = '*'; + line[out] = '\0'; + modmark = 1; + } + + /* If someone thought that the redisplay was handled, but the currently + visible line has a different modification state than the one about + to become visible, then correct the caller's misconception. */ + if (visible_line[0] != invisible_line[0]) + rl_display_fixed = 0; + + /* If the prompt to be displayed is the `primary' readline prompt (the + one passed to readline()), use the values we have already expanded. + If not, use what's already in rl_display_prompt. WRAP_OFFSET is the + number of non-visible characters in the prompt string. */ + if (rl_display_prompt == rl_prompt || local_prompt) + { + if (local_prompt_prefix && forced_display) + _rl_output_some_chars (local_prompt_prefix, strlen (local_prompt_prefix)); + + if (local_prompt_len > 0) + { + temp = local_prompt_len + out + 2; + if (temp >= line_size) + { + line_size = (temp + 1024) - (temp % 1024); + visible_line = (char *)xrealloc (visible_line, line_size); + line = invisible_line = (char *)xrealloc (invisible_line, line_size); + } + strncpy (line + out, local_prompt, local_prompt_len); + out += local_prompt_len; + } + line[out] = '\0'; + wrap_offset = local_prompt_len - prompt_visible_length; + } + else + { + int pmtlen; + prompt_this_line = strrchr (rl_display_prompt, '\n'); + if (!prompt_this_line) + prompt_this_line = rl_display_prompt; + else + { + prompt_this_line++; + pmtlen = prompt_this_line - rl_display_prompt; /* temp var */ + if (forced_display) + { + _rl_output_some_chars (rl_display_prompt, pmtlen); + /* Make sure we are at column zero even after a newline, + regardless of the state of terminal output processing. */ + if (pmtlen < 2 || prompt_this_line[-2] != '\r') + cr (); + } + } + + prompt_physical_chars = pmtlen = strlen (prompt_this_line); + temp = pmtlen + out + 2; + if (temp >= line_size) + { + line_size = (temp + 1024) - (temp % 1024); + visible_line = (char *)xrealloc (visible_line, line_size); + line = invisible_line = (char *)xrealloc (invisible_line, line_size); + } + strncpy (line + out, prompt_this_line, pmtlen); + out += pmtlen; + line[out] = '\0'; + wrap_offset = prompt_invis_chars_first_line = 0; + } + +#define CHECK_INV_LBREAKS() \ + do { \ + if (newlines >= (inv_lbsize - 2)) \ + { \ + inv_lbsize *= 2; \ + inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \ + } \ + } while (0) + +#if defined (HANDLE_MULTIBYTE) +#define CHECK_LPOS() \ + do { \ + lpos++; \ + if (lpos >= _rl_screenwidth) \ + { \ + if (newlines >= (inv_lbsize - 2)) \ + { \ + inv_lbsize *= 2; \ + inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \ + } \ + inv_lbreaks[++newlines] = out; \ + if (newlines >= (line_state_invisible->wbsize - 1)) \ + { \ + line_state_invisible->wbsize *= 2; \ + line_state_invisible->wrapped_line = (int *)xrealloc (line_state_invisible->wrapped_line, line_state_invisible->wbsize * sizeof(int)); \ + } \ + line_state_invisible->wrapped_line[newlines] = _rl_wrapped_multicolumn; \ + lpos = 0; \ + } \ + } while (0) +#else +#define CHECK_LPOS() \ + do { \ + lpos++; \ + if (lpos >= _rl_screenwidth) \ + { \ + if (newlines >= (inv_lbsize - 2)) \ + { \ + inv_lbsize *= 2; \ + inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \ + } \ + inv_lbreaks[++newlines] = out; \ + lpos = 0; \ + } \ + } while (0) +#endif + + /* inv_lbreaks[i] is where line i starts in the buffer. */ + inv_lbreaks[newlines = 0] = 0; + lpos = prompt_physical_chars + modmark; + +#if defined (HANDLE_MULTIBYTE) + memset (line_state_invisible->wrapped_line, 0, line_state_invisible->wbsize * sizeof (int)); + num = 0; +#endif + + /* prompt_invis_chars_first_line is the number of invisible characters in + the first physical line of the prompt. + wrap_offset - prompt_invis_chars_first_line is the number of invis + chars on the second (or, more generally, last) line. */ + + /* This is zero-based, used to set the newlines */ + prompt_lines_estimate = lpos / _rl_screenwidth; + + /* what if lpos is already >= _rl_screenwidth before we start drawing the + contents of the command line? */ + while (lpos >= _rl_screenwidth) + { + int z; + /* fix from Darin Johnson for prompt string with + invisible characters that is longer than the screen width. The + prompt_invis_chars_first_line variable could be made into an array + saying how many invisible characters there are per line, but that's + probably too much work for the benefit gained. How many people have + prompts that exceed two physical lines? + Additional logic fix from Edward Catmur */ +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0 && prompt_multibyte_chars > 0) + { + n0 = num; + temp = local_prompt_len; + while (num < temp) + { + z = _rl_col_width (local_prompt, n0, num, 1); + if (z > _rl_screenwidth) + { + num = _rl_find_prev_mbchar (local_prompt, num, MB_FIND_ANY); + break; + } + else if (z == _rl_screenwidth) + break; + num++; + } + temp = num; + } + else +#endif /* !HANDLE_MULTIBYTE */ + temp = ((newlines + 1) * _rl_screenwidth); + + /* Now account for invisible characters in the current line. */ + /* XXX - this assumes that the invisible characters may be split, but only + between the first and the last lines. */ + temp += (newlines == 0) ? prompt_invis_chars_first_line + : ((newlines == prompt_lines_estimate) ? wrap_offset : prompt_invis_chars_first_line); + + inv_lbreaks[++newlines] = temp; +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0 && prompt_multibyte_chars > 0) + lpos -= _rl_col_width (local_prompt, n0, num, 1); + else +#endif + lpos -= _rl_screenwidth; + } + + prompt_last_screen_line = newlines; + + /* Draw the rest of the line (after the prompt) into invisible_line, keeping + track of where the cursor is (cpos_buffer_position), the number of the line containing + the cursor (lb_linenum), the last line number (lb_botlin and inv_botlin). + It maintains an array of line breaks for display (inv_lbreaks). + This handles expanding tabs for display and displaying meta characters. */ + lb_linenum = 0; +#if defined (HANDLE_MULTIBYTE) + in = 0; + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + memset (&ps, 0, sizeof (mbstate_t)); + /* XXX - what if wc_bytes ends up <= 0? check for MB_INVALIDCH */ + wc_bytes = mbrtowc (&wc, rl_line_buffer, rl_end, &ps); + } + else + wc_bytes = 1; + while (in < rl_end) +#else + for (in = 0; in < rl_end; in++) +#endif + { + c = (unsigned char)rl_line_buffer[in]; + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + if (MB_INVALIDCH (wc_bytes)) + { + /* Byte sequence is invalid or shortened. Assume that the + first byte represents a character. */ + wc_bytes = 1; + /* Assume that a character occupies a single column. */ + wc_width = 1; + memset (&ps, 0, sizeof (mbstate_t)); + } + else if (MB_NULLWCH (wc_bytes)) + break; /* Found '\0' */ + else + { + temp = WCWIDTH (wc); + wc_width = (temp >= 0) ? temp : 1; + } + } +#endif + + if (out + 8 >= line_size) /* XXX - 8 for \t */ + { + line_size *= 2; + visible_line = (char *)xrealloc (visible_line, line_size); + invisible_line = (char *)xrealloc (invisible_line, line_size); + line = invisible_line; + } + + if (in == rl_point) + { + cpos_buffer_position = out; + lb_linenum = newlines; + } + +#if defined (HANDLE_MULTIBYTE) + if (META_CHAR (c) && _rl_output_meta_chars == 0) /* XXX - clean up */ +#else + if (META_CHAR (c)) +#endif + { + if (_rl_output_meta_chars == 0) + { + sprintf (line + out, "\\%o", c); + + if (lpos + 4 >= _rl_screenwidth) + { + temp = _rl_screenwidth - lpos; + CHECK_INV_LBREAKS (); + inv_lbreaks[++newlines] = out + temp; + lpos = 4 - temp; + } + else + lpos += 4; + + out += 4; + } + else + { + line[out++] = c; + CHECK_LPOS(); + } + } +#if defined (DISPLAY_TABS) + else if (c == '\t') + { + register int newout; + +#if 0 + newout = (out | (int)7) + 1; +#else + newout = out + 8 - lpos % 8; +#endif + temp = newout - out; + if (lpos + temp >= _rl_screenwidth) + { + register int temp2; + temp2 = _rl_screenwidth - lpos; + CHECK_INV_LBREAKS (); + inv_lbreaks[++newlines] = out + temp2; + lpos = temp - temp2; + while (out < newout) + line[out++] = ' '; + } + else + { + while (out < newout) + line[out++] = ' '; + lpos += temp; + } + } +#endif + else if (c == '\n' && _rl_horizontal_scroll_mode == 0 && _rl_term_up && *_rl_term_up) + { + line[out++] = '\0'; /* XXX - sentinel */ + CHECK_INV_LBREAKS (); + inv_lbreaks[++newlines] = out; + lpos = 0; + } + else if (CTRL_CHAR (c) || c == RUBOUT) + { + line[out++] = '^'; + CHECK_LPOS(); + line[out++] = CTRL_CHAR (c) ? UNCTRL (c) : '?'; + CHECK_LPOS(); + } + else + { +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + register int i; + + _rl_wrapped_multicolumn = 0; + + if (_rl_screenwidth < lpos + wc_width) + for (i = lpos; i < _rl_screenwidth; i++) + { + /* The space will be removed in update_line() */ + line[out++] = ' '; + _rl_wrapped_multicolumn++; + CHECK_LPOS(); + } + if (in == rl_point) + { + cpos_buffer_position = out; + lb_linenum = newlines; + } + for (i = in; i < in+wc_bytes; i++) + line[out++] = rl_line_buffer[i]; + for (i = 0; i < wc_width; i++) + CHECK_LPOS(); + } + else + { + line[out++] = c; + CHECK_LPOS(); + } +#else + line[out++] = c; + CHECK_LPOS(); +#endif + } + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + in += wc_bytes; + /* XXX - what if wc_bytes ends up <= 0? check for MB_INVALIDCH */ + wc_bytes = mbrtowc (&wc, rl_line_buffer + in, rl_end - in, &ps); + } + else + in++; +#endif + + } + line[out] = '\0'; + if (cpos_buffer_position < 0) + { + cpos_buffer_position = out; + lb_linenum = newlines; + } + + inv_botlin = lb_botlin = newlines; + CHECK_INV_LBREAKS (); + inv_lbreaks[newlines+1] = out; + cursor_linenum = lb_linenum; + + /* CPOS_BUFFER_POSITION == position in buffer where cursor should be placed. + CURSOR_LINENUM == line number where the cursor should be placed. */ + + /* PWP: now is when things get a bit hairy. The visible and invisible + line buffers are really multiple lines, which would wrap every + (screenwidth - 1) characters. Go through each in turn, finding + the changed region and updating it. The line order is top to bottom. */ + + /* If we can move the cursor up and down, then use multiple lines, + otherwise, let long lines display in a single terminal line, and + horizontally scroll it. */ + displaying_prompt_first_line = 1; + if (_rl_horizontal_scroll_mode == 0 && _rl_term_up && *_rl_term_up) + { + int nleft, pos, changed_screen_line, tx; + + if (!rl_display_fixed || forced_display) + { + forced_display = 0; + + /* If we have more than a screenful of material to display, then + only display a screenful. We should display the last screen, + not the first. */ + if (out >= _rl_screenchars) + { + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + out = _rl_find_prev_mbchar (line, _rl_screenchars, MB_FIND_ANY); + else + out = _rl_screenchars - 1; + } + + /* The first line is at character position 0 in the buffer. The + second and subsequent lines start at inv_lbreaks[N], offset by + OFFSET (which has already been calculated above). */ + +#define INVIS_FIRST() (prompt_physical_chars > _rl_screenwidth ? prompt_invis_chars_first_line : wrap_offset) +#define WRAP_OFFSET(line, offset) ((line == 0) \ + ? (offset ? INVIS_FIRST() : 0) \ + : ((line == prompt_last_screen_line) ? wrap_offset-prompt_invis_chars_first_line : 0)) +#define W_OFFSET(line, offset) ((line) == 0 ? offset : 0) +#define VIS_LLEN(l) ((l) > _rl_vis_botlin ? 0 : (vis_lbreaks[l+1] - vis_lbreaks[l])) +#define INV_LLEN(l) (inv_lbreaks[l+1] - inv_lbreaks[l]) +#define VIS_CHARS(line) (visible_line + vis_lbreaks[line]) +#define VIS_LINE(line) ((line) > _rl_vis_botlin) ? "" : VIS_CHARS(line) +#define INV_LINE(line) (invisible_line + inv_lbreaks[line]) + +#define OLD_CPOS_IN_PROMPT() (cpos_adjusted == 0 && \ + _rl_last_c_pos != o_cpos && \ + _rl_last_c_pos > wrap_offset && \ + o_cpos < prompt_last_invisible) + + /* For each line in the buffer, do the updating display. */ + for (linenum = 0; linenum <= inv_botlin; linenum++) + { + /* This can lead us astray if we execute a program that changes + the locale from a non-multibyte to a multibyte one. */ + o_cpos = _rl_last_c_pos; + cpos_adjusted = 0; + update_line (VIS_LINE(linenum), INV_LINE(linenum), linenum, + VIS_LLEN(linenum), INV_LLEN(linenum), inv_botlin); + + /* update_line potentially changes _rl_last_c_pos, but doesn't + take invisible characters into account, since _rl_last_c_pos + is an absolute cursor position in a multibyte locale. See + if compensating here is the right thing, or if we have to + change update_line itself. There are several cases in which + update_line adjusts _rl_last_c_pos itself (so it can pass + _rl_move_cursor_relative accurate values); it communicates + this back by setting cpos_adjusted. If we assume that + _rl_last_c_pos is correct (an absolute cursor position) each + time update_line is called, then we can assume in our + calculations that o_cpos does not need to be adjusted by + wrap_offset. */ + if (linenum == 0 && (MB_CUR_MAX > 1 && rl_byte_oriented == 0) && OLD_CPOS_IN_PROMPT()) + _rl_last_c_pos -= prompt_invis_chars_first_line; /* XXX - was wrap_offset */ + else if (linenum == prompt_last_screen_line && prompt_physical_chars > _rl_screenwidth && + (MB_CUR_MAX > 1 && rl_byte_oriented == 0) && + cpos_adjusted == 0 && + _rl_last_c_pos != o_cpos && + _rl_last_c_pos > (prompt_last_invisible - _rl_screenwidth - prompt_invis_chars_first_line)) + _rl_last_c_pos -= (wrap_offset-prompt_invis_chars_first_line); + + /* If this is the line with the prompt, we might need to + compensate for invisible characters in the new line. Do + this only if there is not more than one new line (which + implies that we completely overwrite the old visible line) + and the new line is shorter than the old. Make sure we are + at the end of the new line before clearing. */ + if (linenum == 0 && + inv_botlin == 0 && _rl_last_c_pos == out && + (wrap_offset > visible_wrap_offset) && + (_rl_last_c_pos < visible_first_line_len)) + { + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + nleft = _rl_screenwidth - _rl_last_c_pos; + else + nleft = _rl_screenwidth + wrap_offset - _rl_last_c_pos; + if (nleft) + _rl_clear_to_eol (nleft); + } +#if 0 + /* This segment is intended to handle the case where the prompt + has invisible characters on the second line and the new line + to be displayed needs to clear the rest of the old characters + out (e.g., when printing the i-search prompt). In general, + the case of the new line being shorter than the old. + Incomplete */ + else if (linenum == prompt_last_screen_line && + prompt_physical_chars > _rl_screenwidth && + wrap_offset != prompt_invis_chars_first_line && + _rl_last_c_pos == out && +#endif + + + /* Since the new first line is now visible, save its length. */ + if (linenum == 0) + visible_first_line_len = (inv_botlin > 0) ? inv_lbreaks[1] : out - wrap_offset; + } + + /* We may have deleted some lines. If so, clear the left over + blank ones at the bottom out. */ + if (_rl_vis_botlin > inv_botlin) + { + char *tt; + for (; linenum <= _rl_vis_botlin; linenum++) + { + tt = VIS_CHARS (linenum); + _rl_move_vert (linenum); + _rl_move_cursor_relative (0, tt); + _rl_clear_to_eol + ((linenum == _rl_vis_botlin) ? strlen (tt) : _rl_screenwidth); + } + } + _rl_vis_botlin = inv_botlin; + + /* CHANGED_SCREEN_LINE is set to 1 if we have moved to a + different screen line during this redisplay. */ + changed_screen_line = _rl_last_v_pos != cursor_linenum; + if (changed_screen_line) + { + _rl_move_vert (cursor_linenum); + /* If we moved up to the line with the prompt using _rl_term_up, + the physical cursor position on the screen stays the same, + but the buffer position needs to be adjusted to account + for invisible characters. */ + if ((MB_CUR_MAX == 1 || rl_byte_oriented) && cursor_linenum == 0 && wrap_offset) + _rl_last_c_pos += wrap_offset; + } + + /* We have to reprint the prompt if it contains invisible + characters, since it's not generally OK to just reprint + the characters from the current cursor position. But we + only need to reprint it if the cursor is before the last + invisible character in the prompt string. */ + nleft = prompt_visible_length + wrap_offset; + if (cursor_linenum == 0 && wrap_offset > 0 && _rl_last_c_pos > 0 && +#if 0 + _rl_last_c_pos <= PROMPT_ENDING_INDEX && local_prompt) +#else + _rl_last_c_pos < PROMPT_ENDING_INDEX && local_prompt) +#endif + { +#if defined (__MSDOS__) + putc ('\r', rl_outstream); +#else + if (_rl_term_cr) + tputs (_rl_term_cr, 1, _rl_output_character_function); +#endif + if (modmark) + _rl_output_some_chars ("*", 1); + + _rl_output_some_chars (local_prompt, nleft); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + _rl_last_c_pos = _rl_col_width (local_prompt, 0, nleft, 1) - wrap_offset + modmark; + else + _rl_last_c_pos = nleft + modmark; + } + + /* Where on that line? And where does that line start + in the buffer? */ + pos = inv_lbreaks[cursor_linenum]; + /* nleft == number of characters in the line buffer between the + start of the line and the desired cursor position. */ + nleft = cpos_buffer_position - pos; + + /* NLEFT is now a number of characters in a buffer. When in a + multibyte locale, however, _rl_last_c_pos is an absolute cursor + position that doesn't take invisible characters in the prompt + into account. We use a fudge factor to compensate. */ + + /* Since _rl_backspace() doesn't know about invisible characters in the + prompt, and there's no good way to tell it, we compensate for + those characters here and call _rl_backspace() directly. */ + if (wrap_offset && cursor_linenum == 0 && nleft < _rl_last_c_pos) + { + /* TX == new physical cursor position in multibyte locale. */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + tx = _rl_col_width (&visible_line[pos], 0, nleft, 1) - visible_wrap_offset; + else + tx = nleft; + if (tx >= 0 && _rl_last_c_pos > tx) + { + _rl_backspace (_rl_last_c_pos - tx); /* XXX */ + _rl_last_c_pos = tx; + } + } + + /* We need to note that in a multibyte locale we are dealing with + _rl_last_c_pos as an absolute cursor position, but moving to a + point specified by a buffer position (NLEFT) that doesn't take + invisible characters into account. */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + _rl_move_cursor_relative (nleft, &invisible_line[pos]); + else if (nleft != _rl_last_c_pos) + _rl_move_cursor_relative (nleft, &invisible_line[pos]); + } + } + else /* Do horizontal scrolling. */ + { +#define M_OFFSET(margin, offset) ((margin) == 0 ? offset : 0) + int lmargin, ndisp, nleft, phys_c_pos, t; + + /* Always at top line. */ + _rl_last_v_pos = 0; + + /* Compute where in the buffer the displayed line should start. This + will be LMARGIN. */ + + /* The number of characters that will be displayed before the cursor. */ + ndisp = cpos_buffer_position - wrap_offset; + nleft = prompt_visible_length + wrap_offset; + /* Where the new cursor position will be on the screen. This can be + longer than SCREENWIDTH; if it is, lmargin will be adjusted. */ + phys_c_pos = cpos_buffer_position - (last_lmargin ? last_lmargin : wrap_offset); + t = _rl_screenwidth / 3; + + /* If the number of characters had already exceeded the screenwidth, + last_lmargin will be > 0. */ + + /* If the number of characters to be displayed is more than the screen + width, compute the starting offset so that the cursor is about + two-thirds of the way across the screen. */ + if (phys_c_pos > _rl_screenwidth - 2) + { + lmargin = cpos_buffer_position - (2 * t); + if (lmargin < 0) + lmargin = 0; + /* If the left margin would be in the middle of a prompt with + invisible characters, don't display the prompt at all. */ + if (wrap_offset && lmargin > 0 && lmargin < nleft) + lmargin = nleft; + } + else if (ndisp < _rl_screenwidth - 2) /* XXX - was -1 */ + lmargin = 0; + else if (phys_c_pos < 1) + { + /* If we are moving back towards the beginning of the line and + the last margin is no longer correct, compute a new one. */ + lmargin = ((cpos_buffer_position - 1) / t) * t; /* XXX */ + if (wrap_offset && lmargin > 0 && lmargin < nleft) + lmargin = nleft; + } + else + lmargin = last_lmargin; + + displaying_prompt_first_line = lmargin < nleft; + + /* If the first character on the screen isn't the first character + in the display line, indicate this with a special character. */ + if (lmargin > 0) + line[lmargin] = '<'; + + /* If SCREENWIDTH characters starting at LMARGIN do not encompass + the whole line, indicate that with a special character at the + right edge of the screen. If LMARGIN is 0, we need to take the + wrap offset into account. */ + t = lmargin + M_OFFSET (lmargin, wrap_offset) + _rl_screenwidth; + if (t < out) + line[t - 1] = '>'; + + if (rl_display_fixed == 0 || forced_display || lmargin != last_lmargin) + { + forced_display = 0; + o_cpos = _rl_last_c_pos; + cpos_adjusted = 0; + update_line (&visible_line[last_lmargin], + &invisible_line[lmargin], + 0, + _rl_screenwidth + visible_wrap_offset, + _rl_screenwidth + (lmargin ? 0 : wrap_offset), + 0); + + if ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) && + displaying_prompt_first_line && OLD_CPOS_IN_PROMPT()) + _rl_last_c_pos -= prompt_invis_chars_first_line; /* XXX - was wrap_offset */ + + /* If the visible new line is shorter than the old, but the number + of invisible characters is greater, and we are at the end of + the new line, we need to clear to eol. */ + t = _rl_last_c_pos - M_OFFSET (lmargin, wrap_offset); + if ((M_OFFSET (lmargin, wrap_offset) > visible_wrap_offset) && + (_rl_last_c_pos == out) && displaying_prompt_first_line && + t < visible_first_line_len) + { + nleft = _rl_screenwidth - t; + _rl_clear_to_eol (nleft); + } + visible_first_line_len = out - lmargin - M_OFFSET (lmargin, wrap_offset); + if (visible_first_line_len > _rl_screenwidth) + visible_first_line_len = _rl_screenwidth; + + _rl_move_cursor_relative (cpos_buffer_position - lmargin, &invisible_line[lmargin]); + last_lmargin = lmargin; + } + } + fflush (rl_outstream); + + /* Swap visible and non-visible lines. */ + { + struct line_state *vtemp = line_state_visible; + + line_state_visible = line_state_invisible; + line_state_invisible = vtemp; + + rl_display_fixed = 0; + /* If we are displaying on a single line, and last_lmargin is > 0, we + are not displaying any invisible characters, so set visible_wrap_offset + to 0. */ + if (_rl_horizontal_scroll_mode && last_lmargin) + visible_wrap_offset = 0; + else + visible_wrap_offset = wrap_offset; + } + + RL_UNSETSTATE (RL_STATE_REDISPLAYING); + _rl_release_sigint (); +} + +/* PWP: update_line() is based on finding the middle difference of each + line on the screen; vis: + + /old first difference + /beginning of line | /old last same /old EOL + v v v v +old: eddie> Oh, my little gruntle-buggy is to me, as lurgid as +new: eddie> Oh, my little buggy says to me, as lurgid as + ^ ^ ^ ^ + \beginning of line | \new last same \new end of line + \new first difference + + All are character pointers for the sake of speed. Special cases for + no differences, as well as for end of line additions must be handled. + + Could be made even smarter, but this works well enough */ +static void +update_line (old, new, current_line, omax, nmax, inv_botlin) + register char *old, *new; + int current_line, omax, nmax, inv_botlin; +{ + register char *ofd, *ols, *oe, *nfd, *nls, *ne; + int temp, lendiff, wsatend, od, nd, twidth, o_cpos; + int current_invis_chars; + int col_lendiff, col_temp; + int bytes_to_insert; +#if defined (HANDLE_MULTIBYTE) + mbstate_t ps_new, ps_old; + int new_offset, old_offset; +#endif + + /* If we're at the right edge of a terminal that supports xn, we're + ready to wrap around, so do so. This fixes problems with knowing + the exact cursor position and cut-and-paste with certain terminal + emulators. In this calculation, TEMP is the physical screen + position of the cursor. */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + temp = _rl_last_c_pos; + else + temp = _rl_last_c_pos - WRAP_OFFSET (_rl_last_v_pos, visible_wrap_offset); + if (temp == _rl_screenwidth && _rl_term_autowrap && !_rl_horizontal_scroll_mode + && _rl_last_v_pos == current_line - 1) + { +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + wchar_t wc; + mbstate_t ps; + int tempwidth, bytes; + size_t ret; + + /* This fixes only double-column characters, but if the wrapped + character consumes more than three columns, spaces will be + inserted in the string buffer. */ + if (current_line < line_state_visible->wbsize && line_state_visible->wrapped_line[current_line] > 0) + _rl_clear_to_eol (line_state_visible->wrapped_line[current_line]); + + memset (&ps, 0, sizeof (mbstate_t)); + ret = mbrtowc (&wc, new, MB_CUR_MAX, &ps); + if (MB_INVALIDCH (ret)) + { + tempwidth = 1; + ret = 1; + } + else if (MB_NULLWCH (ret)) + tempwidth = 0; + else + tempwidth = WCWIDTH (wc); + + if (tempwidth > 0) + { + int count, i; + bytes = ret; + for (count = 0; count < bytes; count++) + putc (new[count], rl_outstream); + _rl_last_c_pos = tempwidth; + _rl_last_v_pos++; + memset (&ps, 0, sizeof (mbstate_t)); + ret = mbrtowc (&wc, old, MB_CUR_MAX, &ps); + if (ret != 0 && bytes != 0) + { + if (MB_INVALIDCH (ret)) + ret = 1; + memmove (old+bytes, old+ret, strlen (old+ret)); + memcpy (old, new, bytes); + /* Fix up indices if we copy data from one line to another */ + omax += bytes - ret; + for (i = current_line+1; i <= inv_botlin+1; i++) + vis_lbreaks[i] += bytes - ret; + } + } + else + { + putc (' ', rl_outstream); + _rl_last_c_pos = 1; + _rl_last_v_pos++; + if (old[0] && new[0]) + old[0] = new[0]; + } + } + else +#endif + { + if (new[0]) + putc (new[0], rl_outstream); + else + putc (' ', rl_outstream); + _rl_last_c_pos = 1; + _rl_last_v_pos++; + if (old[0] && new[0]) + old[0] = new[0]; + } + } + + + /* Find first difference. */ +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + /* See if the old line is a subset of the new line, so that the + only change is adding characters. */ + temp = (omax < nmax) ? omax : nmax; + if (memcmp (old, new, temp) == 0) /* adding at the end */ + { + new_offset = old_offset = temp; + ofd = old + temp; + nfd = new + temp; + } + else + { + memset (&ps_new, 0, sizeof(mbstate_t)); + memset (&ps_old, 0, sizeof(mbstate_t)); + + if (omax == nmax && STREQN (new, old, omax)) + { + old_offset = omax; + new_offset = nmax; + ofd = old + omax; + nfd = new + nmax; + } + else + { + new_offset = old_offset = 0; + for (ofd = old, nfd = new; + (ofd - old < omax) && *ofd && + _rl_compare_chars(old, old_offset, &ps_old, new, new_offset, &ps_new); ) + { + old_offset = _rl_find_next_mbchar (old, old_offset, 1, MB_FIND_ANY); + new_offset = _rl_find_next_mbchar (new, new_offset, 1, MB_FIND_ANY); + + ofd = old + old_offset; + nfd = new + new_offset; + } + } + } + } + else +#endif + for (ofd = old, nfd = new; + (ofd - old < omax) && *ofd && (*ofd == *nfd); + ofd++, nfd++) + ; + + /* Move to the end of the screen line. ND and OD are used to keep track + of the distance between ne and new and oe and old, respectively, to + move a subtraction out of each loop. */ + for (od = ofd - old, oe = ofd; od < omax && *oe; oe++, od++); + for (nd = nfd - new, ne = nfd; nd < nmax && *ne; ne++, nd++); + + /* If no difference, continue to next line. */ + if (ofd == oe && nfd == ne) + return; + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0 && _rl_utf8locale) + { + wchar_t wc; + mbstate_t ps = { 0 }; + int t; + + /* If the first character in the difference is a zero-width character, + assume it's a combining character and back one up so the two base + characters no longer compare equivalently. */ + t = mbrtowc (&wc, ofd, MB_CUR_MAX, &ps); + if (t > 0 && UNICODE_COMBINING_CHAR (wc) && WCWIDTH (wc) == 0) + { + old_offset = _rl_find_prev_mbchar (old, ofd - old, MB_FIND_ANY); + new_offset = _rl_find_prev_mbchar (new, nfd - new, MB_FIND_ANY); + ofd = old + old_offset; /* equal by definition */ + nfd = new + new_offset; + } + } +#endif + + wsatend = 1; /* flag for trailing whitespace */ + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + ols = old + _rl_find_prev_mbchar (old, oe - old, MB_FIND_ANY); + nls = new + _rl_find_prev_mbchar (new, ne - new, MB_FIND_ANY); + + while ((ols > ofd) && (nls > nfd)) + { + memset (&ps_old, 0, sizeof (mbstate_t)); + memset (&ps_new, 0, sizeof (mbstate_t)); + +#if 0 + /* On advice from jir@yamato.ibm.com */ + _rl_adjust_point (old, ols - old, &ps_old); + _rl_adjust_point (new, nls - new, &ps_new); +#endif + + if (_rl_compare_chars (old, ols - old, &ps_old, new, nls - new, &ps_new) == 0) + break; + + if (*ols == ' ') + wsatend = 0; + + ols = old + _rl_find_prev_mbchar (old, ols - old, MB_FIND_ANY); + nls = new + _rl_find_prev_mbchar (new, nls - new, MB_FIND_ANY); + } + } + else + { +#endif /* HANDLE_MULTIBYTE */ + ols = oe - 1; /* find last same */ + nls = ne - 1; + while ((ols > ofd) && (nls > nfd) && (*ols == *nls)) + { + if (*ols != ' ') + wsatend = 0; + ols--; + nls--; + } +#if defined (HANDLE_MULTIBYTE) + } +#endif + + if (wsatend) + { + ols = oe; + nls = ne; + } +#if defined (HANDLE_MULTIBYTE) + /* This may not work for stateful encoding, but who cares? To handle + stateful encoding properly, we have to scan each string from the + beginning and compare. */ + else if (_rl_compare_chars (ols, 0, NULL, nls, 0, NULL) == 0) +#else + else if (*ols != *nls) +#endif + { + if (*ols) /* don't step past the NUL */ + { + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + ols = old + _rl_find_next_mbchar (old, ols - old, 1, MB_FIND_ANY); + else + ols++; + } + if (*nls) + { + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + nls = new + _rl_find_next_mbchar (new, nls - new, 1, MB_FIND_ANY); + else + nls++; + } + } + + /* count of invisible characters in the current invisible line. */ + current_invis_chars = W_OFFSET (current_line, wrap_offset); + if (_rl_last_v_pos != current_line) + { + _rl_move_vert (current_line); + if ((MB_CUR_MAX == 1 || rl_byte_oriented) && current_line == 0 && visible_wrap_offset) + _rl_last_c_pos += visible_wrap_offset; + } + + /* If this is the first line and there are invisible characters in the + prompt string, and the prompt string has not changed, and the current + cursor position is before the last invisible character in the prompt, + and the index of the character to move to is past the end of the prompt + string, then redraw the entire prompt string. We can only do this + reliably if the terminal supports a `cr' capability. + + This is not an efficiency hack -- there is a problem with redrawing + portions of the prompt string if they contain terminal escape + sequences (like drawing the `unbold' sequence without a corresponding + `bold') that manifests itself on certain terminals. */ + + lendiff = local_prompt_len; + od = ofd - old; /* index of first difference in visible line */ + if (current_line == 0 && !_rl_horizontal_scroll_mode && + _rl_term_cr && lendiff > prompt_visible_length && _rl_last_c_pos > 0 && + od >= lendiff && _rl_last_c_pos < PROMPT_ENDING_INDEX) + { +#if defined (__MSDOS__) + putc ('\r', rl_outstream); +#else + tputs (_rl_term_cr, 1, _rl_output_character_function); +#endif + if (modmark) + _rl_output_some_chars ("*", 1); + _rl_output_some_chars (local_prompt, lendiff); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + /* We take wrap_offset into account here so we can pass correct + information to _rl_move_cursor_relative. */ + _rl_last_c_pos = _rl_col_width (local_prompt, 0, lendiff, 1) - wrap_offset + modmark; + cpos_adjusted = 1; + } + else + _rl_last_c_pos = lendiff + modmark; + } + + o_cpos = _rl_last_c_pos; + + /* When this function returns, _rl_last_c_pos is correct, and an absolute + cursor position in multibyte mode, but a buffer index when not in a + multibyte locale. */ + _rl_move_cursor_relative (od, old); + +#if defined (HANDLE_MULTIBYTE) + /* We need to indicate that the cursor position is correct in the presence of + invisible characters in the prompt string. Let's see if setting this when + we make sure we're at the end of the drawn prompt string works. */ + if (current_line == 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0 && + (_rl_last_c_pos > 0 || o_cpos > 0) && + _rl_last_c_pos == prompt_physical_chars) + cpos_adjusted = 1; +#endif + + /* if (len (new) > len (old)) + lendiff == difference in buffer (bytes) + col_lendiff == difference on screen (columns) + When not using multibyte characters, these are equal */ + lendiff = (nls - nfd) - (ols - ofd); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + col_lendiff = _rl_col_width (new, nfd - new, nls - new, 1) - _rl_col_width (old, ofd - old, ols - old, 1); + else + col_lendiff = lendiff; + + /* If we are changing the number of invisible characters in a line, and + the spot of first difference is before the end of the invisible chars, + lendiff needs to be adjusted. */ + if (current_line == 0 && !_rl_horizontal_scroll_mode && + current_invis_chars != visible_wrap_offset) + { + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + lendiff += visible_wrap_offset - current_invis_chars; + col_lendiff += visible_wrap_offset - current_invis_chars; + } + else + { + lendiff += visible_wrap_offset - current_invis_chars; + col_lendiff = lendiff; + } + } + + /* We use temp as a count of the number of bytes from the first difference + to the end of the new line. col_temp is the corresponding number of + screen columns. A `dumb' update moves to the spot of first difference + and writes TEMP bytes. */ + /* Insert (diff (len (old), len (new)) ch. */ + temp = ne - nfd; + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + col_temp = _rl_col_width (new, nfd - new, ne - new, 1); + else + col_temp = temp; + + /* how many bytes from the new line buffer to write to the display */ + bytes_to_insert = nls - nfd; + + /* col_lendiff > 0 if we are adding characters to the line */ + if (col_lendiff > 0) /* XXX - was lendiff */ + { + /* Non-zero if we're increasing the number of lines. */ + int gl = current_line >= _rl_vis_botlin && inv_botlin > _rl_vis_botlin; + /* If col_lendiff is > 0, implying that the new string takes up more + screen real estate than the old, but lendiff is < 0, meaning that it + takes fewer bytes, we need to just output the characters starting + from the first difference. These will overwrite what is on the + display, so there's no reason to do a smart update. This can really + only happen in a multibyte environment. */ + if (lendiff < 0) + { + _rl_output_some_chars (nfd, temp); + _rl_last_c_pos += col_temp; /* XXX - was _rl_col_width (nfd, 0, temp, 1); */ + /* If nfd begins before any invisible characters in the prompt, + adjust _rl_last_c_pos to account for wrap_offset and set + cpos_adjusted to let the caller know. */ + if (current_line == 0 && displaying_prompt_first_line && wrap_offset && ((nfd - new) <= prompt_last_invisible)) + { + _rl_last_c_pos -= wrap_offset; + cpos_adjusted = 1; + } + return; + } + /* Sometimes it is cheaper to print the characters rather than + use the terminal's capabilities. If we're growing the number + of lines, make sure we actually cause the new line to wrap + around on auto-wrapping terminals. */ + else if (_rl_terminal_can_insert && ((2 * col_temp) >= col_lendiff || _rl_term_IC) && (!_rl_term_autowrap || !gl)) + { + /* If lendiff > prompt_visible_length and _rl_last_c_pos == 0 and + _rl_horizontal_scroll_mode == 1, inserting the characters with + _rl_term_IC or _rl_term_ic will screw up the screen because of the + invisible characters. We need to just draw them. */ + /* The same thing happens if we're trying to draw before the last + invisible character in the prompt string or we're increasing the + number of invisible characters in the line and we're not drawing + the entire prompt string. */ + if (*ols && ((_rl_horizontal_scroll_mode && + _rl_last_c_pos == 0 && + lendiff > prompt_visible_length && + current_invis_chars > 0) == 0) && + (((MB_CUR_MAX > 1 && rl_byte_oriented == 0) && + current_line == 0 && wrap_offset && + ((nfd - new) <= prompt_last_invisible) && + (col_lendiff < prompt_visible_length)) == 0) && + (visible_wrap_offset >= current_invis_chars)) + { + open_some_spaces (col_lendiff); + _rl_output_some_chars (nfd, bytes_to_insert); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + _rl_last_c_pos += _rl_col_width (nfd, 0, bytes_to_insert, 1); + else + _rl_last_c_pos += bytes_to_insert; + } + else if ((MB_CUR_MAX == 1 || rl_byte_oriented != 0) && *ols == 0 && lendiff > 0) + { + /* At the end of a line the characters do not have to + be "inserted". They can just be placed on the screen. */ + _rl_output_some_chars (nfd, temp); + _rl_last_c_pos += col_temp; + return; + } + else /* just write from first difference to end of new line */ + { + _rl_output_some_chars (nfd, temp); + _rl_last_c_pos += col_temp; + /* If nfd begins before the last invisible character in the + prompt, adjust _rl_last_c_pos to account for wrap_offset + and set cpos_adjusted to let the caller know. */ + if ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) && current_line == 0 && displaying_prompt_first_line && wrap_offset && ((nfd - new) <= prompt_last_invisible)) + { + _rl_last_c_pos -= wrap_offset; + cpos_adjusted = 1; + } + return; + } + + if (bytes_to_insert > lendiff) + { + /* If nfd begins before the last invisible character in the + prompt, adjust _rl_last_c_pos to account for wrap_offset + and set cpos_adjusted to let the caller know. */ + if ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) && current_line == 0 && displaying_prompt_first_line && wrap_offset && ((nfd - new) <= prompt_last_invisible)) + { + _rl_last_c_pos -= wrap_offset; + cpos_adjusted = 1; + } + } + } + else + { + /* cannot insert chars, write to EOL */ + _rl_output_some_chars (nfd, temp); + _rl_last_c_pos += col_temp; + /* If we're in a multibyte locale and were before the last invisible + char in the current line (which implies we just output some invisible + characters) we need to adjust _rl_last_c_pos, since it represents + a physical character position. */ + if ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) && + current_line == prompt_last_screen_line && wrap_offset && + displaying_prompt_first_line && + wrap_offset != prompt_invis_chars_first_line && + ((nfd-new) < (prompt_last_invisible-(current_line*_rl_screenwidth)))) + { + _rl_last_c_pos -= wrap_offset - prompt_invis_chars_first_line; + cpos_adjusted = 1; + } + } + } + else /* Delete characters from line. */ + { + /* If possible and inexpensive to use terminal deletion, then do so. */ + if (_rl_term_dc && (2 * col_temp) >= -col_lendiff) + { + /* If all we're doing is erasing the invisible characters in the + prompt string, don't bother. It screws up the assumptions + about what's on the screen. */ + if (_rl_horizontal_scroll_mode && _rl_last_c_pos == 0 && + displaying_prompt_first_line && + -lendiff == visible_wrap_offset) + col_lendiff = 0; + + /* If we have moved lmargin and we're shrinking the line, we've + already moved the cursor to the first character of the new line, + so deleting -col_lendiff characters will mess up the cursor + position calculation */ + if (_rl_horizontal_scroll_mode && displaying_prompt_first_line == 0 && + col_lendiff && _rl_last_c_pos < -col_lendiff) + col_lendiff = 0; + + if (col_lendiff) + delete_chars (-col_lendiff); /* delete (diff) characters */ + + /* Copy (new) chars to screen from first diff to last match, + overwriting what is there. */ + if (bytes_to_insert > 0) + { + /* If nfd begins at the prompt, or before the invisible + characters in the prompt, we need to adjust _rl_last_c_pos + in a multibyte locale to account for the wrap offset and + set cpos_adjusted accordingly. */ + _rl_output_some_chars (nfd, bytes_to_insert); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + _rl_last_c_pos += _rl_col_width (nfd, 0, bytes_to_insert, 1); + if (current_line == 0 && wrap_offset && + displaying_prompt_first_line && + _rl_last_c_pos > wrap_offset && + ((nfd - new) <= prompt_last_invisible)) + { + _rl_last_c_pos -= wrap_offset; + cpos_adjusted = 1; + } + } + else + _rl_last_c_pos += bytes_to_insert; + + if (_rl_horizontal_scroll_mode && ((oe-old) > (ne-new))) + goto clear_rest_of_line; + } + } + /* Otherwise, print over the existing material. */ + else + { + if (temp > 0) + { + /* If nfd begins at the prompt, or before the invisible + characters in the prompt, we need to adjust _rl_last_c_pos + in a multibyte locale to account for the wrap offset and + set cpos_adjusted accordingly. */ + _rl_output_some_chars (nfd, temp); + _rl_last_c_pos += col_temp; /* XXX */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + if (current_line == 0 && wrap_offset && + displaying_prompt_first_line && + _rl_last_c_pos > wrap_offset && + ((nfd - new) <= prompt_last_invisible)) + { + _rl_last_c_pos -= wrap_offset; + cpos_adjusted = 1; + } + } + } +clear_rest_of_line: + lendiff = (oe - old) - (ne - new); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + col_lendiff = _rl_col_width (old, 0, oe - old, 1) - _rl_col_width (new, 0, ne - new, 1); + else + col_lendiff = lendiff; + + /* If we've already printed over the entire width of the screen, + including the old material, then col_lendiff doesn't matter and + space_to_eol will insert too many spaces. XXX - maybe we should + adjust col_lendiff based on the difference between _rl_last_c_pos + and _rl_screenwidth */ + if (col_lendiff && ((MB_CUR_MAX == 1 || rl_byte_oriented) || (_rl_last_c_pos < _rl_screenwidth))) + { + if (_rl_term_autowrap && current_line < inv_botlin) + space_to_eol (col_lendiff); + else + _rl_clear_to_eol (col_lendiff); + } + } + } +} + +/* Tell the update routines that we have moved onto a new (empty) line. */ +int +rl_on_new_line () +{ + if (visible_line) + visible_line[0] = '\0'; + + _rl_last_c_pos = _rl_last_v_pos = 0; + _rl_vis_botlin = last_lmargin = 0; + if (vis_lbreaks) + vis_lbreaks[0] = vis_lbreaks[1] = 0; + visible_wrap_offset = 0; + return 0; +} + +/* Tell the update routines that we have moved onto a new line with the + prompt already displayed. Code originally from the version of readline + distributed with CLISP. rl_expand_prompt must have already been called + (explicitly or implicitly). This still doesn't work exactly right. */ +int +rl_on_new_line_with_prompt () +{ + int prompt_size, i, l, real_screenwidth, newlines; + char *prompt_last_line, *lprompt; + + /* Initialize visible_line and invisible_line to ensure that they can hold + the already-displayed prompt. */ + prompt_size = strlen (rl_prompt) + 1; + init_line_structures (prompt_size); + + /* Make sure the line structures hold the already-displayed prompt for + redisplay. */ + lprompt = local_prompt ? local_prompt : rl_prompt; + strcpy (visible_line, lprompt); + strcpy (invisible_line, lprompt); + + /* If the prompt contains newlines, take the last tail. */ + prompt_last_line = strrchr (rl_prompt, '\n'); + if (!prompt_last_line) + prompt_last_line = rl_prompt; + + l = strlen (prompt_last_line); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + _rl_last_c_pos = _rl_col_width (prompt_last_line, 0, l, 1); /* XXX */ + else + _rl_last_c_pos = l; + + /* Dissect prompt_last_line into screen lines. Note that here we have + to use the real screenwidth. Readline's notion of screenwidth might be + one less, see terminal.c. */ + real_screenwidth = _rl_screenwidth + (_rl_term_autowrap ? 0 : 1); + _rl_last_v_pos = l / real_screenwidth; + /* If the prompt length is a multiple of real_screenwidth, we don't know + whether the cursor is at the end of the last line, or already at the + beginning of the next line. Output a newline just to be safe. */ + if (l > 0 && (l % real_screenwidth) == 0) + _rl_output_some_chars ("\n", 1); + last_lmargin = 0; + + newlines = 0; i = 0; + while (i <= l) + { + _rl_vis_botlin = newlines; + vis_lbreaks[newlines++] = i; + i += real_screenwidth; + } + vis_lbreaks[newlines] = l; + visible_wrap_offset = 0; + + rl_display_prompt = rl_prompt; /* XXX - make sure it's set */ + + return 0; +} + +/* Actually update the display, period. */ +int +rl_forced_update_display () +{ + register char *temp; + + if (visible_line) + { + temp = visible_line; + while (*temp) + *temp++ = '\0'; + } + rl_on_new_line (); + forced_display++; + (*rl_redisplay_function) (); + return 0; +} + +/* Move the cursor from _rl_last_c_pos to NEW, which are buffer indices. + (Well, when we don't have multibyte characters, _rl_last_c_pos is a + buffer index.) + DATA is the contents of the screen line of interest; i.e., where + the movement is being done. */ +void +_rl_move_cursor_relative (new, data) + int new; + const char *data; +{ + register int i; + int woff; /* number of invisible chars on current line */ + int cpos, dpos; /* current and desired cursor positions */ + int adjust; + + woff = WRAP_OFFSET (_rl_last_v_pos, wrap_offset); + cpos = _rl_last_c_pos; + + if (cpos == 0 && cpos == new) + return; + +#if defined (HANDLE_MULTIBYTE) + /* If we have multibyte characters, NEW is indexed by the buffer point in + a multibyte string, but _rl_last_c_pos is the display position. In + this case, NEW's display position is not obvious and must be + calculated. We need to account for invisible characters in this line, + as long as we are past them and they are counted by _rl_col_width. */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + adjust = 1; + /* Try to short-circuit common cases and eliminate a bunch of multibyte + character function calls. */ + /* 1. prompt string */ + if (new == local_prompt_len && memcmp (data, local_prompt, new) == 0) + { + dpos = prompt_physical_chars; + cpos_adjusted = 1; + adjust = 0; + } + /* 2. prompt_string + line contents */ + else if (new > local_prompt_len && local_prompt && memcmp (data, local_prompt, local_prompt_len) == 0) + { + dpos = prompt_physical_chars + _rl_col_width (data, local_prompt_len, new, 1); + cpos_adjusted = 1; + adjust = 0; + } + else + dpos = _rl_col_width (data, 0, new, 1); + + if (displaying_prompt_first_line == 0) + adjust = 0; + + /* Use NEW when comparing against the last invisible character in the + prompt string, since they're both buffer indices and DPOS is a + desired display position. */ + if (adjust && ((new > prompt_last_invisible) || /* XXX - don't use woff here */ + (prompt_physical_chars >= _rl_screenwidth && + _rl_last_v_pos == prompt_last_screen_line && + wrap_offset >= woff && dpos >= woff && + new > (prompt_last_invisible-(_rl_screenwidth*_rl_last_v_pos)-wrap_offset)))) + /* XXX last comparison might need to be >= */ + { + dpos -= woff; + /* Since this will be assigned to _rl_last_c_pos at the end (more + precisely, _rl_last_c_pos == dpos when this function returns), + let the caller know. */ + cpos_adjusted = 1; + } + } + else +#endif + dpos = new; + + /* If we don't have to do anything, then return. */ + if (cpos == dpos) + return; + + /* It may be faster to output a CR, and then move forwards instead + of moving backwards. */ + /* i == current physical cursor position. */ +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + i = _rl_last_c_pos; + else +#endif + i = _rl_last_c_pos - woff; + if (dpos == 0 || CR_FASTER (dpos, _rl_last_c_pos) || + (_rl_term_autowrap && i == _rl_screenwidth)) + { +#if defined (__MSDOS__) + putc ('\r', rl_outstream); +#else + tputs (_rl_term_cr, 1, _rl_output_character_function); +#endif /* !__MSDOS__ */ + cpos = _rl_last_c_pos = 0; + } + + if (cpos < dpos) + { + /* Move the cursor forward. We do it by printing the command + to move the cursor forward if there is one, else print that + portion of the output buffer again. Which is cheaper? */ + + /* The above comment is left here for posterity. It is faster + to print one character (non-control) than to print a control + sequence telling the terminal to move forward one character. + That kind of control is for people who don't know what the + data is underneath the cursor. */ + + /* However, we need a handle on where the current display position is + in the buffer for the immediately preceding comment to be true. + In multibyte locales, we don't currently have that info available. + Without it, we don't know where the data we have to display begins + in the buffer and we have to go back to the beginning of the screen + line. In this case, we can use the terminal sequence to move forward + if it's available. */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + if (_rl_term_forward_char) + { + for (i = cpos; i < dpos; i++) + tputs (_rl_term_forward_char, 1, _rl_output_character_function); + } + else + { + tputs (_rl_term_cr, 1, _rl_output_character_function); + for (i = 0; i < new; i++) + putc (data[i], rl_outstream); + } + } + else + for (i = cpos; i < new; i++) + putc (data[i], rl_outstream); + } + +#if defined (HANDLE_MULTIBYTE) + /* NEW points to the buffer point, but _rl_last_c_pos is the display point. + The byte length of the string is probably bigger than the column width + of the string, which means that if NEW == _rl_last_c_pos, then NEW's + display point is less than _rl_last_c_pos. */ +#endif + else if (cpos > dpos) + _rl_backspace (cpos - dpos); + + _rl_last_c_pos = dpos; +} + +/* PWP: move the cursor up or down. */ +void +_rl_move_vert (to) + int to; +{ + register int delta, i; + + if (_rl_last_v_pos == to || to > _rl_screenheight) + return; + + if ((delta = to - _rl_last_v_pos) > 0) + { + for (i = 0; i < delta; i++) + putc ('\n', rl_outstream); +#if defined (__MSDOS__) + putc ('\r', rl_outstream); +#else + tputs (_rl_term_cr, 1, _rl_output_character_function); +#endif + _rl_last_c_pos = 0; + } + else + { /* delta < 0 */ +#ifdef __DJGPP__ + int row, col; + + fflush (rl_outstream); + ScreenGetCursor (&row, &col); + ScreenSetCursor (row + delta, col); + i = -delta; +#else + if (_rl_term_up && *_rl_term_up) + for (i = 0; i < -delta; i++) + tputs (_rl_term_up, 1, _rl_output_character_function); +#endif /* !__DJGPP__ */ + } + + _rl_last_v_pos = to; /* Now TO is here */ +} + +/* Physically print C on rl_outstream. This is for functions which know + how to optimize the display. Return the number of characters output. */ +int +rl_show_char (c) + int c; +{ + int n = 1; + if (META_CHAR (c) && (_rl_output_meta_chars == 0)) + { + fprintf (rl_outstream, "M-"); + n += 2; + c = UNMETA (c); + } + +#if defined (DISPLAY_TABS) + if ((CTRL_CHAR (c) && c != '\t') || c == RUBOUT) +#else + if (CTRL_CHAR (c) || c == RUBOUT) +#endif /* !DISPLAY_TABS */ + { + fprintf (rl_outstream, "C-"); + n += 2; + c = CTRL_CHAR (c) ? UNCTRL (c) : '?'; + } + + putc (c, rl_outstream); + fflush (rl_outstream); + return n; +} + +int +rl_character_len (c, pos) + register int c, pos; +{ + unsigned char uc; + + uc = (unsigned char)c; + + if (META_CHAR (uc)) + return ((_rl_output_meta_chars == 0) ? 4 : 1); + + if (uc == '\t') + { +#if defined (DISPLAY_TABS) + return (((pos | 7) + 1) - pos); +#else + return (2); +#endif /* !DISPLAY_TABS */ + } + + if (CTRL_CHAR (c) || c == RUBOUT) + return (2); + + return ((ISPRINT (uc)) ? 1 : 2); +} +/* How to print things in the "echo-area". The prompt is treated as a + mini-modeline. */ +static int msg_saved_prompt = 0; + +#if defined (USE_VARARGS) +int +#if defined (PREFER_STDARG) +rl_message (const char *format, ...) +#else +rl_message (va_alist) + va_dcl +#endif +{ + va_list args; +#if defined (PREFER_VARARGS) + char *format; +#endif +#if defined (HAVE_VSNPRINTF) + int bneed; +#endif + +#if defined (PREFER_STDARG) + va_start (args, format); +#else + va_start (args); + format = va_arg (args, char *); +#endif + + if (msg_buf == 0) + msg_buf = xmalloc (msg_bufsiz = 128); + +#if defined (HAVE_VSNPRINTF) + bneed = vsnprintf (msg_buf, msg_bufsiz - 1, format, args); + if (bneed >= msg_bufsiz - 1) + { + msg_bufsiz = bneed + 1; + msg_buf = xrealloc (msg_buf, msg_bufsiz); + va_end (args); + +#if defined (PREFER_STDARG) + va_start (args, format); +#else + va_start (args); + format = va_arg (args, char *); +#endif + vsnprintf (msg_buf, msg_bufsiz - 1, format, args); + } +#else + vsprintf (msg_buf, format, args); + msg_buf[msg_bufsiz - 1] = '\0'; /* overflow? */ +#endif + va_end (args); + + if (saved_local_prompt == 0) + { + rl_save_prompt (); + msg_saved_prompt = 1; + } + else if (local_prompt != saved_local_prompt) + { + FREE (local_prompt); + FREE (local_prompt_prefix); + local_prompt = (char *)NULL; + } + rl_display_prompt = msg_buf; + local_prompt = expand_prompt (msg_buf, &prompt_visible_length, + &prompt_last_invisible, + &prompt_invis_chars_first_line, + &prompt_physical_chars); + local_prompt_prefix = (char *)NULL; + local_prompt_len = local_prompt ? strlen (local_prompt) : 0; + (*rl_redisplay_function) (); + + return 0; +} +#else /* !USE_VARARGS */ +int +rl_message (format, arg1, arg2) + char *format; +{ + if (msg_buf == 0) + msg_buf = xmalloc (msg_bufsiz = 128); + + sprintf (msg_buf, format, arg1, arg2); + msg_buf[msg_bufsiz - 1] = '\0'; /* overflow? */ + + rl_display_prompt = msg_buf; + if (saved_local_prompt == 0) + { + rl_save_prompt (); + msg_saved_prompt = 1; + } + else if (local_prompt != saved_local_prompt) + { + FREE (local_prompt); + FREE (local_prompt_prefix); + local_prompt = (char *)NULL; + } + local_prompt = expand_prompt (msg_buf, &prompt_visible_length, + &prompt_last_invisible, + &prompt_invis_chars_first_line, + &prompt_physical_chars); + local_prompt_prefix = (char *)NULL; + local_prompt_len = local_prompt ? strlen (local_prompt) : 0; + (*rl_redisplay_function) (); + + return 0; +} +#endif /* !USE_VARARGS */ + +/* How to clear things from the "echo-area". */ +int +rl_clear_message () +{ + rl_display_prompt = rl_prompt; + if (msg_saved_prompt) + { + rl_restore_prompt (); + msg_saved_prompt = 0; + } + (*rl_redisplay_function) (); + return 0; +} + +int +rl_reset_line_state () +{ + rl_on_new_line (); + + rl_display_prompt = rl_prompt ? rl_prompt : ""; + forced_display = 1; + return 0; +} + +void +rl_save_prompt () +{ + saved_local_prompt = local_prompt; + saved_local_prefix = local_prompt_prefix; + saved_prefix_length = prompt_prefix_length; + saved_local_length = local_prompt_len; + saved_last_invisible = prompt_last_invisible; + saved_visible_length = prompt_visible_length; + saved_invis_chars_first_line = prompt_invis_chars_first_line; + saved_physical_chars = prompt_physical_chars; + + local_prompt = local_prompt_prefix = (char *)0; + local_prompt_len = 0; + prompt_last_invisible = prompt_visible_length = prompt_prefix_length = 0; + prompt_invis_chars_first_line = prompt_physical_chars = 0; +} + +void +rl_restore_prompt () +{ + FREE (local_prompt); + FREE (local_prompt_prefix); + + local_prompt = saved_local_prompt; + local_prompt_prefix = saved_local_prefix; + local_prompt_len = saved_local_length; + prompt_prefix_length = saved_prefix_length; + prompt_last_invisible = saved_last_invisible; + prompt_visible_length = saved_visible_length; + prompt_invis_chars_first_line = saved_invis_chars_first_line; + prompt_physical_chars = saved_physical_chars; + + /* can test saved_local_prompt to see if prompt info has been saved. */ + saved_local_prompt = saved_local_prefix = (char *)0; + saved_local_length = 0; + saved_last_invisible = saved_visible_length = saved_prefix_length = 0; + saved_invis_chars_first_line = saved_physical_chars = 0; +} + +char * +_rl_make_prompt_for_search (pchar) + int pchar; +{ + int len; + char *pmt, *p; + + rl_save_prompt (); + + /* We've saved the prompt, and can do anything with the various prompt + strings we need before they're restored. We want the unexpanded + portion of the prompt string after any final newline. */ + p = rl_prompt ? strrchr (rl_prompt, '\n') : 0; + if (p == 0) + { + len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0; + pmt = (char *)xmalloc (len + 2); + if (len) + strcpy (pmt, rl_prompt); + pmt[len] = pchar; + pmt[len+1] = '\0'; + } + else + { + p++; + len = strlen (p); + pmt = (char *)xmalloc (len + 2); + if (len) + strcpy (pmt, p); + pmt[len] = pchar; + pmt[len+1] = '\0'; + } + + /* will be overwritten by expand_prompt, called from rl_message */ + prompt_physical_chars = saved_physical_chars + 1; + return pmt; +} + +/* Quick redisplay hack when erasing characters at the end of the line. */ +void +_rl_erase_at_end_of_line (l) + int l; +{ + register int i; + + _rl_backspace (l); + for (i = 0; i < l; i++) + putc (' ', rl_outstream); + _rl_backspace (l); + for (i = 0; i < l; i++) + visible_line[--_rl_last_c_pos] = '\0'; + rl_display_fixed++; +} + +/* Clear to the end of the line. COUNT is the minimum + number of character spaces to clear, */ +void +_rl_clear_to_eol (count) + int count; +{ +#ifndef __MSDOS__ + if (_rl_term_clreol) + tputs (_rl_term_clreol, 1, _rl_output_character_function); + else +#endif + if (count) + space_to_eol (count); +} + +/* Clear to the end of the line using spaces. COUNT is the minimum + number of character spaces to clear, */ +static void +space_to_eol (count) + int count; +{ + register int i; + + for (i = 0; i < count; i++) + putc (' ', rl_outstream); + + _rl_last_c_pos += count; +} + +void +_rl_clear_screen () +{ +#ifndef __DJGPP__ + if (_rl_term_clrpag) + tputs (_rl_term_clrpag, 1, _rl_output_character_function); + else + rl_crlf (); +#else + ScreenClear (); + ScreenSetCursor (0, 0); +#endif /* __DJGPP__ */ +} + +/* Insert COUNT characters from STRING to the output stream at column COL. */ +static void +insert_some_chars (string, count, col) + char *string; + int count, col; +{ + open_some_spaces (col); + _rl_output_some_chars (string, count); +} + +/* Insert COL spaces, keeping the cursor at the same position. We follow the + ncurses documentation and use either im/ei with explicit spaces, or IC/ic + by itself. We assume there will either be ei or we don't need to use it. */ +static void +open_some_spaces (col) + int col; +{ +#if !defined (__MSDOS__) && !defined (__MINGW32__) + char *buffer; + register int i; + + /* If IC is defined, then we do not have to "enter" insert mode. */ + if (_rl_term_IC) + { + buffer = tgoto (_rl_term_IC, 0, col); + tputs (buffer, 1, _rl_output_character_function); + } + else if (_rl_term_im && *_rl_term_im) + { + tputs (_rl_term_im, 1, _rl_output_character_function); + /* just output the desired number of spaces */ + for (i = col; i--; ) + _rl_output_character_function (' '); + /* If there is a string to turn off insert mode, use it now. */ + if (_rl_term_ei && *_rl_term_ei) + tputs (_rl_term_ei, 1, _rl_output_character_function); + /* and move back the right number of spaces */ + _rl_backspace (col); + } + else if (_rl_term_ic && *_rl_term_ic) + { + /* If there is a special command for inserting characters, then + use that first to open up the space. */ + for (i = col; i--; ) + tputs (_rl_term_ic, 1, _rl_output_character_function); + } +#endif /* !__MSDOS__ && !__MINGW32__ */ +} + +/* Delete COUNT characters from the display line. */ +static void +delete_chars (count) + int count; +{ + if (count > _rl_screenwidth) /* XXX */ + return; + +#if !defined (__MSDOS__) && !defined (__MINGW32__) + if (_rl_term_DC && *_rl_term_DC) + { + char *buffer; + buffer = tgoto (_rl_term_DC, count, count); + tputs (buffer, count, _rl_output_character_function); + } + else + { + if (_rl_term_dc && *_rl_term_dc) + while (count--) + tputs (_rl_term_dc, 1, _rl_output_character_function); + } +#endif /* !__MSDOS__ && !__MINGW32__ */ +} + +void +_rl_update_final () +{ + int full_lines; + + full_lines = 0; + /* If the cursor is the only thing on an otherwise-blank last line, + compensate so we don't print an extra CRLF. */ + if (_rl_vis_botlin && _rl_last_c_pos == 0 && + visible_line[vis_lbreaks[_rl_vis_botlin]] == 0) + { + _rl_vis_botlin--; + full_lines = 1; + } + _rl_move_vert (_rl_vis_botlin); + /* If we've wrapped lines, remove the final xterm line-wrap flag. */ + if (full_lines && _rl_term_autowrap && (VIS_LLEN(_rl_vis_botlin) == _rl_screenwidth)) + { + char *last_line; + + last_line = &visible_line[vis_lbreaks[_rl_vis_botlin]]; + cpos_buffer_position = -1; /* don't know where we are in buffer */ + _rl_move_cursor_relative (_rl_screenwidth - 1, last_line); /* XXX */ + _rl_clear_to_eol (0); + putc (last_line[_rl_screenwidth - 1], rl_outstream); + } + _rl_vis_botlin = 0; + rl_crlf (); + fflush (rl_outstream); + rl_display_fixed++; +} + +/* Move to the start of the current line. */ +static void +cr () +{ + if (_rl_term_cr) + { +#if defined (__MSDOS__) + putc ('\r', rl_outstream); +#else + tputs (_rl_term_cr, 1, _rl_output_character_function); +#endif + _rl_last_c_pos = 0; + } +} + +/* Redraw the last line of a multi-line prompt that may possibly contain + terminal escape sequences. Called with the cursor at column 0 of the + line to draw the prompt on. */ +static void +redraw_prompt (t) + char *t; +{ + char *oldp; + + oldp = rl_display_prompt; + rl_save_prompt (); + + rl_display_prompt = t; + local_prompt = expand_prompt (t, &prompt_visible_length, + &prompt_last_invisible, + &prompt_invis_chars_first_line, + &prompt_physical_chars); + local_prompt_prefix = (char *)NULL; + local_prompt_len = local_prompt ? strlen (local_prompt) : 0; + + rl_forced_update_display (); + + rl_display_prompt = oldp; + rl_restore_prompt(); +} + +/* Redisplay the current line after a SIGWINCH is received. */ +void +_rl_redisplay_after_sigwinch () +{ + char *t; + + /* Clear the last line (assuming that the screen size change will result in + either more or fewer characters on that line only) and put the cursor at + column 0. Make sure the right thing happens if we have wrapped to a new + screen line. */ + if (_rl_term_cr) + { + _rl_move_vert (_rl_vis_botlin); + +#if defined (__MSDOS__) + putc ('\r', rl_outstream); +#else + tputs (_rl_term_cr, 1, _rl_output_character_function); +#endif + _rl_last_c_pos = 0; +#if defined (__MSDOS__) + space_to_eol (_rl_screenwidth); + putc ('\r', rl_outstream); +#else + if (_rl_term_clreol) + tputs (_rl_term_clreol, 1, _rl_output_character_function); + else + { + space_to_eol (_rl_screenwidth); + tputs (_rl_term_cr, 1, _rl_output_character_function); + } +#endif + if (_rl_last_v_pos > 0) + _rl_move_vert (0); + } + else + rl_crlf (); + + /* Redraw only the last line of a multi-line prompt. */ + t = strrchr (rl_display_prompt, '\n'); + if (t) + redraw_prompt (++t); + else + rl_forced_update_display (); +} + +void +_rl_clean_up_for_exit () +{ + if (_rl_echoing_p) + { + if (_rl_vis_botlin > 0) /* minor optimization plus bug fix */ + _rl_move_vert (_rl_vis_botlin); + _rl_vis_botlin = 0; + fflush (rl_outstream); + rl_restart_output (1, 0); + } +} + +void +_rl_erase_entire_line () +{ + cr (); + _rl_clear_to_eol (0); + cr (); + fflush (rl_outstream); +} + +/* return the `current display line' of the cursor -- the number of lines to + move up to get to the first screen line of the current readline line. */ +int +_rl_current_display_line () +{ + int ret, nleft; + + /* Find out whether or not there might be invisible characters in the + editing buffer. */ + if (rl_display_prompt == rl_prompt) + nleft = _rl_last_c_pos - _rl_screenwidth - rl_visible_prompt_length; + else + nleft = _rl_last_c_pos - _rl_screenwidth; + + if (nleft > 0) + ret = 1 + nleft / _rl_screenwidth; + else + ret = 0; + + return ret; +} + +#if defined (HANDLE_MULTIBYTE) +/* Calculate the number of screen columns occupied by STR from START to END. + In the case of multibyte characters with stateful encoding, we have to + scan from the beginning of the string to take the state into account. */ +static int +_rl_col_width (str, start, end, flags) + const char *str; + int start, end, flags; +{ + wchar_t wc; + mbstate_t ps; + int tmp, point, width, max; + + if (end <= start) + return 0; + if (MB_CUR_MAX == 1 || rl_byte_oriented) + /* this can happen in some cases where it's inconvenient to check */ + return (end - start); + + memset (&ps, 0, sizeof (mbstate_t)); + + point = 0; + max = end; + + /* Try to short-circuit common cases. The adjustment to remove wrap_offset + is done by the caller. */ + /* 1. prompt string */ + if (flags && start == 0 && end == local_prompt_len && memcmp (str, local_prompt, local_prompt_len) == 0) + return (prompt_physical_chars + wrap_offset); + /* 2. prompt string + line contents */ + else if (flags && start == 0 && local_prompt_len > 0 && end > local_prompt_len && local_prompt && memcmp (str, local_prompt, local_prompt_len) == 0) + { + tmp = prompt_physical_chars + wrap_offset; + /* XXX - try to call ourselves recursively with non-prompt portion */ + tmp += _rl_col_width (str, local_prompt_len, end, flags); + return (tmp); + } + + while (point < start) + { + tmp = mbrlen (str + point, max, &ps); + if (MB_INVALIDCH ((size_t)tmp)) + { + /* In this case, the bytes are invalid or too short to compose a + multibyte character, so we assume that the first byte represents + a single character. */ + point++; + max--; + + /* Clear the state of the byte sequence, because in this case the + effect of mbstate is undefined. */ + memset (&ps, 0, sizeof (mbstate_t)); + } + else if (MB_NULLWCH (tmp)) + break; /* Found '\0' */ + else + { + point += tmp; + max -= tmp; + } + } + + /* If START is not a byte that starts a character, then POINT will be + greater than START. In this case, assume that (POINT - START) gives + a byte count that is the number of columns of difference. */ + width = point - start; + + while (point < end) + { + tmp = mbrtowc (&wc, str + point, max, &ps); + if (MB_INVALIDCH ((size_t)tmp)) + { + /* In this case, the bytes are invalid or too short to compose a + multibyte character, so we assume that the first byte represents + a single character. */ + point++; + max--; + + /* and assume that the byte occupies a single column. */ + width++; + + /* Clear the state of the byte sequence, because in this case the + effect of mbstate is undefined. */ + memset (&ps, 0, sizeof (mbstate_t)); + } + else if (MB_NULLWCH (tmp)) + break; /* Found '\0' */ + else + { + point += tmp; + max -= tmp; + tmp = WCWIDTH(wc); + width += (tmp >= 0) ? tmp : 1; + } + } + + width += point - end; + + return width; +} +#endif /* HANDLE_MULTIBYTE */ diff --git a/.pc/bash43-013.diff/patchlevel.h b/.pc/bash43-013.diff/patchlevel.h new file mode 100644 index 0000000..b5516c2 --- /dev/null +++ b/.pc/bash43-013.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 12 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-014.diff/patchlevel.h b/.pc/bash43-014.diff/patchlevel.h new file mode 100644 index 0000000..72064c5 --- /dev/null +++ b/.pc/bash43-014.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 13 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-014.diff/subst.c b/.pc/bash43-014.diff/subst.c new file mode 100644 index 0000000..e131f4c --- /dev/null +++ b/.pc/bash43-014.diff/subst.c @@ -0,0 +1,9713 @@ +/* subst.c -- The part of the shell that does parameter, command, arithmetic, + and globbing substitutions. */ + +/* ``Have a little faith, there's magic in the night. You ain't a + beauty, but, hey, you're alright.'' */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" +#include +#include "chartypes.h" +#if defined (HAVE_PWD_H) +# include +#endif +#include +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" +#include "posixstat.h" +#include "bashintl.h" + +#include "shell.h" +#include "parser.h" +#include "flags.h" +#include "jobs.h" +#include "execute_cmd.h" +#include "filecntl.h" +#include "trap.h" +#include "pathexp.h" +#include "mailcheck.h" + +#include "shmbutil.h" +#include "typemax.h" + +#include "builtins/getopt.h" +#include "builtins/common.h" + +#include "builtins/builtext.h" + +#include +#include + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +/* The size that strings change by. */ +#define DEFAULT_INITIAL_ARRAY_SIZE 112 +#define DEFAULT_ARRAY_SIZE 128 + +/* Variable types. */ +#define VT_VARIABLE 0 +#define VT_POSPARMS 1 +#define VT_ARRAYVAR 2 +#define VT_ARRAYMEMBER 3 +#define VT_ASSOCVAR 4 + +#define VT_STARSUB 128 /* $* or ${array[*]} -- used to split */ + +/* Flags for quoted_strchr */ +#define ST_BACKSL 0x01 +#define ST_CTLESC 0x02 +#define ST_SQUOTE 0x04 /* unused yet */ +#define ST_DQUOTE 0x08 /* unused yet */ + +/* Flags for the `pflags' argument to param_expand() */ +#define PF_NOCOMSUB 0x01 /* Do not perform command substitution */ +#define PF_IGNUNBOUND 0x02 /* ignore unbound vars even if -u set */ +#define PF_NOSPLIT2 0x04 /* same as W_NOSPLIT2 */ +#define PF_ASSIGNRHS 0x08 /* same as W_ASSIGNRHS */ + +/* These defs make it easier to use the editor. */ +#define LBRACE '{' +#define RBRACE '}' +#define LPAREN '(' +#define RPAREN ')' +#define LBRACK '[' +#define RBRACK ']' + +#if defined (HANDLE_MULTIBYTE) +#define WLPAREN L'(' +#define WRPAREN L')' +#endif + +/* Evaluates to 1 if C is one of the shell's special parameters whose length + can be taken, but is also one of the special expansion characters. */ +#define VALID_SPECIAL_LENGTH_PARAM(c) \ + ((c) == '-' || (c) == '?' || (c) == '#') + +/* Evaluates to 1 if C is one of the shell's special parameters for which an + indirect variable reference may be made. */ +#define VALID_INDIR_PARAM(c) \ + ((posixly_correct == 0 && (c) == '#') || (posixly_correct == 0 && (c) == '?') || (c) == '@' || (c) == '*') + +/* Evaluates to 1 if C is one of the OP characters that follows the parameter + in ${parameter[:]OPword}. */ +#define VALID_PARAM_EXPAND_CHAR(c) (sh_syntaxtab[(unsigned char)c] & CSUBSTOP) + +/* Evaluates to 1 if this is one of the shell's special variables. */ +#define SPECIAL_VAR(name, wi) \ + ((DIGIT (*name) && all_digits (name)) || \ + (name[1] == '\0' && (sh_syntaxtab[(unsigned char)*name] & CSPECVAR)) || \ + (wi && name[2] == '\0' && VALID_INDIR_PARAM (name[1]))) + +/* An expansion function that takes a string and a quoted flag and returns + a WORD_LIST *. Used as the type of the third argument to + expand_string_if_necessary(). */ +typedef WORD_LIST *EXPFUNC __P((char *, int)); + +/* Process ID of the last command executed within command substitution. */ +pid_t last_command_subst_pid = NO_PID; +pid_t current_command_subst_pid = NO_PID; + +/* Variables used to keep track of the characters in IFS. */ +SHELL_VAR *ifs_var; +char *ifs_value; +unsigned char ifs_cmap[UCHAR_MAX + 1]; +int ifs_is_set, ifs_is_null; + +#if defined (HANDLE_MULTIBYTE) +unsigned char ifs_firstc[MB_LEN_MAX]; +size_t ifs_firstc_len; +#else +unsigned char ifs_firstc; +#endif + +/* Sentinel to tell when we are performing variable assignments preceding a + command name and putting them into the environment. Used to make sure + we use the temporary environment when looking up variable values. */ +int assigning_in_environment; + +/* Used to hold a list of variable assignments preceding a command. Global + so the SIGCHLD handler in jobs.c can unwind-protect it when it runs a + SIGCHLD trap and so it can be saved and restored by the trap handlers. */ +WORD_LIST *subst_assign_varlist = (WORD_LIST *)NULL; + +/* Extern functions and variables from different files. */ +extern int last_command_exit_value, last_command_exit_signal; +extern int subshell_environment, line_number; +extern int subshell_level, parse_and_execute_level, sourcelevel; +extern int eof_encountered; +extern int return_catch_flag, return_catch_value; +extern pid_t dollar_dollar_pid; +extern int posixly_correct; +extern char *this_command_name; +extern struct fd_bitmap *current_fds_to_close; +extern int wordexp_only; +extern int expanding_redir; +extern int tempenv_assign_error; +extern int builtin_ignoring_errexit; + +#if !defined (HAVE_WCSDUP) && defined (HANDLE_MULTIBYTE) +extern wchar_t *wcsdup __P((const wchar_t *)); +#endif + +/* Non-zero means to allow unmatched globbed filenames to expand to + a null file. */ +int allow_null_glob_expansion; + +/* Non-zero means to throw an error when globbing fails to match anything. */ +int fail_glob_expansion; + +#if 0 +/* Variables to keep track of which words in an expanded word list (the + output of expand_word_list_internal) are the result of globbing + expansions. GLOB_ARGV_FLAGS is used by execute_cmd.c. + (CURRENTLY UNUSED). */ +char *glob_argv_flags; +static int glob_argv_flags_size; +#endif + +static WORD_LIST expand_word_error, expand_word_fatal; +static WORD_DESC expand_wdesc_error, expand_wdesc_fatal; +static char expand_param_error, expand_param_fatal; +static char extract_string_error, extract_string_fatal; + +/* Tell the expansion functions to not longjmp back to top_level on fatal + errors. Enabled when doing completion and prompt string expansion. */ +static int no_longjmp_on_fatal_error = 0; + +/* Set by expand_word_unsplit; used to inhibit splitting and re-joining + $* on $IFS, primarily when doing assignment statements. */ +static int expand_no_split_dollar_star = 0; + +/* A WORD_LIST of words to be expanded by expand_word_list_internal, + without any leading variable assignments. */ +static WORD_LIST *garglist = (WORD_LIST *)NULL; + +static char *quoted_substring __P((char *, int, int)); +static int quoted_strlen __P((char *)); +static char *quoted_strchr __P((char *, int, int)); + +static char *expand_string_if_necessary __P((char *, int, EXPFUNC *)); +static inline char *expand_string_to_string_internal __P((char *, int, EXPFUNC *)); +static WORD_LIST *call_expand_word_internal __P((WORD_DESC *, int, int, int *, int *)); +static WORD_LIST *expand_string_internal __P((char *, int)); +static WORD_LIST *expand_string_leave_quoted __P((char *, int)); +static WORD_LIST *expand_string_for_rhs __P((char *, int, int *, int *)); + +static WORD_LIST *list_quote_escapes __P((WORD_LIST *)); +static WORD_LIST *list_dequote_escapes __P((WORD_LIST *)); + +static char *make_quoted_char __P((int)); +static WORD_LIST *quote_list __P((WORD_LIST *)); + +static int unquoted_substring __P((char *, char *)); +static int unquoted_member __P((int, char *)); + +#if defined (ARRAY_VARS) +static SHELL_VAR *do_compound_assignment __P((char *, char *, int)); +#endif +static int do_assignment_internal __P((const WORD_DESC *, int)); + +static char *string_extract_verbatim __P((char *, size_t, int *, char *, int)); +static char *string_extract __P((char *, int *, char *, int)); +static char *string_extract_double_quoted __P((char *, int *, int)); +static inline char *string_extract_single_quoted __P((char *, int *)); +static inline int skip_single_quoted __P((const char *, size_t, int)); +static int skip_double_quoted __P((char *, size_t, int)); +static char *extract_delimited_string __P((char *, int *, char *, char *, char *, int)); +static char *extract_dollar_brace_string __P((char *, int *, int, int)); +static int skip_matched_pair __P((const char *, int, int, int, int)); + +static char *pos_params __P((char *, int, int, int)); + +static unsigned char *mb_getcharlens __P((char *, int)); + +static char *remove_upattern __P((char *, char *, int)); +#if defined (HANDLE_MULTIBYTE) +static wchar_t *remove_wpattern __P((wchar_t *, size_t, wchar_t *, int)); +#endif +static char *remove_pattern __P((char *, char *, int)); + +static int match_upattern __P((char *, char *, int, char **, char **)); +#if defined (HANDLE_MULTIBYTE) +static int match_wpattern __P((wchar_t *, char **, size_t, wchar_t *, int, char **, char **)); +#endif +static int match_pattern __P((char *, char *, int, char **, char **)); +static int getpatspec __P((int, char *)); +static char *getpattern __P((char *, int, int)); +static char *variable_remove_pattern __P((char *, char *, int, int)); +static char *list_remove_pattern __P((WORD_LIST *, char *, int, int, int)); +static char *parameter_list_remove_pattern __P((int, char *, int, int)); +#ifdef ARRAY_VARS +static char *array_remove_pattern __P((SHELL_VAR *, char *, int, char *, int)); +#endif +static char *parameter_brace_remove_pattern __P((char *, char *, int, char *, int, int, int)); + +static char *process_substitute __P((char *, int)); + +static char *read_comsub __P((int, int, int *)); + +#ifdef ARRAY_VARS +static arrayind_t array_length_reference __P((char *)); +#endif + +static int valid_brace_expansion_word __P((char *, int)); +static int chk_atstar __P((char *, int, int *, int *)); +static int chk_arithsub __P((const char *, int)); + +static WORD_DESC *parameter_brace_expand_word __P((char *, int, int, int, arrayind_t *)); +static char *parameter_brace_find_indir __P((char *, int, int, int)); +static WORD_DESC *parameter_brace_expand_indir __P((char *, int, int, int *, int *)); +static WORD_DESC *parameter_brace_expand_rhs __P((char *, char *, int, int, int *, int *)); +static void parameter_brace_expand_error __P((char *, char *)); + +static int valid_length_expression __P((char *)); +static intmax_t parameter_brace_expand_length __P((char *)); + +static char *skiparith __P((char *, int)); +static int verify_substring_values __P((SHELL_VAR *, char *, char *, int, intmax_t *, intmax_t *)); +static int get_var_and_type __P((char *, char *, arrayind_t, int, int, SHELL_VAR **, char **)); +static char *mb_substring __P((char *, int, int)); +static char *parameter_brace_substring __P((char *, char *, int, char *, int, int)); + +static int shouldexp_replacement __P((char *)); + +static char *pos_params_pat_subst __P((char *, char *, char *, int)); + +static char *parameter_brace_patsub __P((char *, char *, int, char *, int, int)); + +static char *pos_params_casemod __P((char *, char *, int, int)); +static char *parameter_brace_casemod __P((char *, char *, int, int, char *, int, int)); + +static WORD_DESC *parameter_brace_expand __P((char *, int *, int, int, int *, int *)); +static WORD_DESC *param_expand __P((char *, int *, int, int *, int *, int *, int *, int)); + +static WORD_LIST *expand_word_internal __P((WORD_DESC *, int, int, int *, int *)); + +static WORD_LIST *word_list_split __P((WORD_LIST *)); + +static void exp_jump_to_top_level __P((int)); + +static WORD_LIST *separate_out_assignments __P((WORD_LIST *)); +static WORD_LIST *glob_expand_word_list __P((WORD_LIST *, int)); +#ifdef BRACE_EXPANSION +static WORD_LIST *brace_expand_word_list __P((WORD_LIST *, int)); +#endif +#if defined (ARRAY_VARS) +static int make_internal_declare __P((char *, char *)); +#endif +static WORD_LIST *shell_expand_word_list __P((WORD_LIST *, int)); +static WORD_LIST *expand_word_list_internal __P((WORD_LIST *, int)); + +/* **************************************************************** */ +/* */ +/* Utility Functions */ +/* */ +/* **************************************************************** */ + +#if defined (DEBUG) +void +dump_word_flags (flags) + int flags; +{ + int f; + + f = flags; + fprintf (stderr, "%d -> ", f); + if (f & W_ASSIGNASSOC) + { + f &= ~W_ASSIGNASSOC; + fprintf (stderr, "W_ASSIGNASSOC%s", f ? "|" : ""); + } + if (f & W_ASSIGNARRAY) + { + f &= ~W_ASSIGNARRAY; + fprintf (stderr, "W_ASSIGNARRAY%s", f ? "|" : ""); + } + if (f & W_HASCTLESC) + { + f &= ~W_HASCTLESC; + fprintf (stderr, "W_HASCTLESC%s", f ? "|" : ""); + } + if (f & W_NOPROCSUB) + { + f &= ~W_NOPROCSUB; + fprintf (stderr, "W_NOPROCSUB%s", f ? "|" : ""); + } + if (f & W_DQUOTE) + { + f &= ~W_DQUOTE; + fprintf (stderr, "W_DQUOTE%s", f ? "|" : ""); + } + if (f & W_HASQUOTEDNULL) + { + f &= ~W_HASQUOTEDNULL; + fprintf (stderr, "W_HASQUOTEDNULL%s", f ? "|" : ""); + } + if (f & W_ASSIGNARG) + { + f &= ~W_ASSIGNARG; + fprintf (stderr, "W_ASSIGNARG%s", f ? "|" : ""); + } + if (f & W_ASSNBLTIN) + { + f &= ~W_ASSNBLTIN; + fprintf (stderr, "W_ASSNBLTIN%s", f ? "|" : ""); + } + if (f & W_ASSNGLOBAL) + { + f &= ~W_ASSNGLOBAL; + fprintf (stderr, "W_ASSNGLOBAL%s", f ? "|" : ""); + } + if (f & W_ASSIGNINT) + { + f &= ~W_ASSIGNINT; + fprintf (stderr, "W_ASSIGNINT%s", f ? "|" : ""); + } + if (f & W_COMPASSIGN) + { + f &= ~W_COMPASSIGN; + fprintf (stderr, "W_COMPASSIGN%s", f ? "|" : ""); + } + if (f & W_NOEXPAND) + { + f &= ~W_NOEXPAND; + fprintf (stderr, "W_NOEXPAND%s", f ? "|" : ""); + } + if (f & W_ITILDE) + { + f &= ~W_ITILDE; + fprintf (stderr, "W_ITILDE%s", f ? "|" : ""); + } + if (f & W_NOTILDE) + { + f &= ~W_NOTILDE; + fprintf (stderr, "W_NOTILDE%s", f ? "|" : ""); + } + if (f & W_ASSIGNRHS) + { + f &= ~W_ASSIGNRHS; + fprintf (stderr, "W_ASSIGNRHS%s", f ? "|" : ""); + } + if (f & W_NOCOMSUB) + { + f &= ~W_NOCOMSUB; + fprintf (stderr, "W_NOCOMSUB%s", f ? "|" : ""); + } + if (f & W_DOLLARSTAR) + { + f &= ~W_DOLLARSTAR; + fprintf (stderr, "W_DOLLARSTAR%s", f ? "|" : ""); + } + if (f & W_DOLLARAT) + { + f &= ~W_DOLLARAT; + fprintf (stderr, "W_DOLLARAT%s", f ? "|" : ""); + } + if (f & W_TILDEEXP) + { + f &= ~W_TILDEEXP; + fprintf (stderr, "W_TILDEEXP%s", f ? "|" : ""); + } + if (f & W_NOSPLIT2) + { + f &= ~W_NOSPLIT2; + fprintf (stderr, "W_NOSPLIT2%s", f ? "|" : ""); + } + if (f & W_NOSPLIT) + { + f &= ~W_NOSPLIT; + fprintf (stderr, "W_NOSPLIT%s", f ? "|" : ""); + } + if (f & W_NOBRACE) + { + f &= ~W_NOBRACE; + fprintf (stderr, "W_NOBRACE%s", f ? "|" : ""); + } + if (f & W_NOGLOB) + { + f &= ~W_NOGLOB; + fprintf (stderr, "W_NOGLOB%s", f ? "|" : ""); + } + if (f & W_SPLITSPACE) + { + f &= ~W_SPLITSPACE; + fprintf (stderr, "W_SPLITSPACE%s", f ? "|" : ""); + } + if (f & W_ASSIGNMENT) + { + f &= ~W_ASSIGNMENT; + fprintf (stderr, "W_ASSIGNMENT%s", f ? "|" : ""); + } + if (f & W_QUOTED) + { + f &= ~W_QUOTED; + fprintf (stderr, "W_QUOTED%s", f ? "|" : ""); + } + if (f & W_HASDOLLAR) + { + f &= ~W_HASDOLLAR; + fprintf (stderr, "W_HASDOLLAR%s", f ? "|" : ""); + } + fprintf (stderr, "\n"); + fflush (stderr); +} +#endif + +#ifdef INCLUDE_UNUSED +static char * +quoted_substring (string, start, end) + char *string; + int start, end; +{ + register int len, l; + register char *result, *s, *r; + + len = end - start; + + /* Move to string[start], skipping quoted characters. */ + for (s = string, l = 0; *s && l < start; ) + { + if (*s == CTLESC) + { + s++; + continue; + } + l++; + if (*s == 0) + break; + } + + r = result = (char *)xmalloc (2*len + 1); /* save room for quotes */ + + /* Copy LEN characters, including quote characters. */ + s = string + l; + for (l = 0; l < len; s++) + { + if (*s == CTLESC) + *r++ = *s++; + *r++ = *s; + l++; + if (*s == 0) + break; + } + *r = '\0'; + return result; +} +#endif + +#ifdef INCLUDE_UNUSED +/* Return the length of S, skipping over quoted characters */ +static int +quoted_strlen (s) + char *s; +{ + register char *p; + int i; + + i = 0; + for (p = s; *p; p++) + { + if (*p == CTLESC) + { + p++; + if (*p == 0) + return (i + 1); + } + i++; + } + + return i; +} +#endif + +/* Find the first occurrence of character C in string S, obeying shell + quoting rules. If (FLAGS & ST_BACKSL) is non-zero, backslash-escaped + characters are skipped. If (FLAGS & ST_CTLESC) is non-zero, characters + escaped with CTLESC are skipped. */ +static char * +quoted_strchr (s, c, flags) + char *s; + int c, flags; +{ + register char *p; + + for (p = s; *p; p++) + { + if (((flags & ST_BACKSL) && *p == '\\') + || ((flags & ST_CTLESC) && *p == CTLESC)) + { + p++; + if (*p == '\0') + return ((char *)NULL); + continue; + } + else if (*p == c) + return p; + } + return ((char *)NULL); +} + +/* Return 1 if CHARACTER appears in an unquoted portion of + STRING. Return 0 otherwise. CHARACTER must be a single-byte character. */ +static int +unquoted_member (character, string) + int character; + char *string; +{ + size_t slen; + int sindex, c; + DECLARE_MBSTATE; + + slen = strlen (string); + sindex = 0; + while (c = string[sindex]) + { + if (c == character) + return (1); + + switch (c) + { + default: + ADVANCE_CHAR (string, slen, sindex); + break; + + case '\\': + sindex++; + if (string[sindex]) + ADVANCE_CHAR (string, slen, sindex); + break; + + case '\'': + sindex = skip_single_quoted (string, slen, ++sindex); + break; + + case '"': + sindex = skip_double_quoted (string, slen, ++sindex); + break; + } + } + return (0); +} + +/* Return 1 if SUBSTR appears in an unquoted portion of STRING. */ +static int +unquoted_substring (substr, string) + char *substr, *string; +{ + size_t slen; + int sindex, c, sublen; + DECLARE_MBSTATE; + + if (substr == 0 || *substr == '\0') + return (0); + + slen = strlen (string); + sublen = strlen (substr); + for (sindex = 0; c = string[sindex]; ) + { + if (STREQN (string + sindex, substr, sublen)) + return (1); + + switch (c) + { + case '\\': + sindex++; + if (string[sindex]) + ADVANCE_CHAR (string, slen, sindex); + break; + + case '\'': + sindex = skip_single_quoted (string, slen, ++sindex); + break; + + case '"': + sindex = skip_double_quoted (string, slen, ++sindex); + break; + + default: + ADVANCE_CHAR (string, slen, sindex); + break; + } + } + return (0); +} + +/* Most of the substitutions must be done in parallel. In order + to avoid using tons of unclear goto's, I have some functions + for manipulating malloc'ed strings. They all take INDX, a + pointer to an integer which is the offset into the string + where manipulation is taking place. They also take SIZE, a + pointer to an integer which is the current length of the + character array for this string. */ + +/* Append SOURCE to TARGET at INDEX. SIZE is the current amount + of space allocated to TARGET. SOURCE can be NULL, in which + case nothing happens. Gets rid of SOURCE by freeing it. + Returns TARGET in case the location has changed. */ +INLINE char * +sub_append_string (source, target, indx, size) + char *source, *target; + int *indx, *size; +{ + if (source) + { + int srclen, n; + + srclen = STRLEN (source); + if (srclen >= (int)(*size - *indx)) + { + n = srclen + *indx; + n = (n + DEFAULT_ARRAY_SIZE) - (n % DEFAULT_ARRAY_SIZE); + target = (char *)xrealloc (target, (*size = n)); + } + + FASTCOPY (source, target + *indx, srclen); + *indx += srclen; + target[*indx] = '\0'; + + free (source); + } + return (target); +} + +#if 0 +/* UNUSED */ +/* Append the textual representation of NUMBER to TARGET. + INDX and SIZE are as in SUB_APPEND_STRING. */ +char * +sub_append_number (number, target, indx, size) + intmax_t number; + int *indx, *size; + char *target; +{ + char *temp; + + temp = itos (number); + return (sub_append_string (temp, target, indx, size)); +} +#endif + +/* Extract a substring from STRING, starting at SINDEX and ending with + one of the characters in CHARLIST. Don't make the ending character + part of the string. Leave SINDEX pointing at the ending character. + Understand about backslashes in the string. If (flags & SX_VARNAME) + is non-zero, and array variables have been compiled into the shell, + everything between a `[' and a corresponding `]' is skipped over. + If (flags & SX_NOALLOC) is non-zero, don't return the substring, just + update SINDEX. If (flags & SX_REQMATCH) is non-zero, the string must + contain a closing character from CHARLIST. */ +static char * +string_extract (string, sindex, charlist, flags) + char *string; + int *sindex; + char *charlist; + int flags; +{ + register int c, i; + int found; + size_t slen; + char *temp; + DECLARE_MBSTATE; + + slen = (MB_CUR_MAX > 1) ? strlen (string + *sindex) + *sindex : 0; + i = *sindex; + found = 0; + while (c = string[i]) + { + if (c == '\\') + { + if (string[i + 1]) + i++; + else + break; + } +#if defined (ARRAY_VARS) + else if ((flags & SX_VARNAME) && c == '[') + { + int ni; + /* If this is an array subscript, skip over it and continue. */ + ni = skipsubscript (string, i, 0); + if (string[ni] == ']') + i = ni; + } +#endif + else if (MEMBER (c, charlist)) + { + found = 1; + break; + } + + ADVANCE_CHAR (string, slen, i); + } + + /* If we had to have a matching delimiter and didn't find one, return an + error and let the caller deal with it. */ + if ((flags & SX_REQMATCH) && found == 0) + { + *sindex = i; + return (&extract_string_error); + } + + temp = (flags & SX_NOALLOC) ? (char *)NULL : substring (string, *sindex, i); + *sindex = i; + + return (temp); +} + +/* Extract the contents of STRING as if it is enclosed in double quotes. + SINDEX, when passed in, is the offset of the character immediately + following the opening double quote; on exit, SINDEX is left pointing after + the closing double quote. If STRIPDQ is non-zero, unquoted double + quotes are stripped and the string is terminated by a null byte. + Backslashes between the embedded double quotes are processed. If STRIPDQ + is zero, an unquoted `"' terminates the string. */ +static char * +string_extract_double_quoted (string, sindex, stripdq) + char *string; + int *sindex, stripdq; +{ + size_t slen; + char *send; + int j, i, t; + unsigned char c; + char *temp, *ret; /* The new string we return. */ + int pass_next, backquote, si; /* State variables for the machine. */ + int dquote; + DECLARE_MBSTATE; + + slen = strlen (string + *sindex) + *sindex; + send = string + slen; + + pass_next = backquote = dquote = 0; + temp = (char *)xmalloc (1 + slen - *sindex); + + j = 0; + i = *sindex; + while (c = string[i]) + { + /* Process a character that was quoted by a backslash. */ + if (pass_next) + { + /* XXX - take another look at this in light of Interp 221 */ + /* Posix.2 sez: + + ``The backslash shall retain its special meaning as an escape + character only when followed by one of the characters: + $ ` " \ ''. + + If STRIPDQ is zero, we handle the double quotes here and let + expand_word_internal handle the rest. If STRIPDQ is non-zero, + we have already been through one round of backslash stripping, + and want to strip these backslashes only if DQUOTE is non-zero, + indicating that we are inside an embedded double-quoted string. */ + + /* If we are in an embedded quoted string, then don't strip + backslashes before characters for which the backslash + retains its special meaning, but remove backslashes in + front of other characters. If we are not in an + embedded quoted string, don't strip backslashes at all. + This mess is necessary because the string was already + surrounded by double quotes (and sh has some really weird + quoting rules). + The returned string will be run through expansion as if + it were double-quoted. */ + if ((stripdq == 0 && c != '"') || + (stripdq && ((dquote && (sh_syntaxtab[c] & CBSDQUOTE)) || dquote == 0))) + temp[j++] = '\\'; + pass_next = 0; + +add_one_character: + COPY_CHAR_I (temp, j, string, send, i); + continue; + } + + /* A backslash protects the next character. The code just above + handles preserving the backslash in front of any character but + a double quote. */ + if (c == '\\') + { + pass_next++; + i++; + continue; + } + + /* Inside backquotes, ``the portion of the quoted string from the + initial backquote and the characters up to the next backquote + that is not preceded by a backslash, having escape characters + removed, defines that command''. */ + if (backquote) + { + if (c == '`') + backquote = 0; + temp[j++] = c; + i++; + continue; + } + + if (c == '`') + { + temp[j++] = c; + backquote++; + i++; + continue; + } + + /* Pass everything between `$(' and the matching `)' or a quoted + ${ ... } pair through according to the Posix.2 specification. */ + if (c == '$' && ((string[i + 1] == LPAREN) || (string[i + 1] == LBRACE))) + { + int free_ret = 1; + + si = i + 2; + if (string[i + 1] == LPAREN) + ret = extract_command_subst (string, &si, 0); + else + ret = extract_dollar_brace_string (string, &si, Q_DOUBLE_QUOTES, 0); + + temp[j++] = '$'; + temp[j++] = string[i + 1]; + + /* Just paranoia; ret will not be 0 unless no_longjmp_on_fatal_error + is set. */ + if (ret == 0 && no_longjmp_on_fatal_error) + { + free_ret = 0; + ret = string + i + 2; + } + + for (t = 0; ret[t]; t++, j++) + temp[j] = ret[t]; + temp[j] = string[si]; + + if (string[si]) + { + j++; + i = si + 1; + } + else + i = si; + + if (free_ret) + free (ret); + continue; + } + + /* Add any character but a double quote to the quoted string we're + accumulating. */ + if (c != '"') + goto add_one_character; + + /* c == '"' */ + if (stripdq) + { + dquote ^= 1; + i++; + continue; + } + + break; + } + temp[j] = '\0'; + + /* Point to after the closing quote. */ + if (c) + i++; + *sindex = i; + + return (temp); +} + +/* This should really be another option to string_extract_double_quoted. */ +static int +skip_double_quoted (string, slen, sind) + char *string; + size_t slen; + int sind; +{ + int c, i; + char *ret; + int pass_next, backquote, si; + DECLARE_MBSTATE; + + pass_next = backquote = 0; + i = sind; + while (c = string[i]) + { + if (pass_next) + { + pass_next = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next++; + i++; + continue; + } + else if (backquote) + { + if (c == '`') + backquote = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '`') + { + backquote++; + i++; + continue; + } + else if (c == '$' && ((string[i + 1] == LPAREN) || (string[i + 1] == LBRACE))) + { + si = i + 2; + if (string[i + 1] == LPAREN) + ret = extract_command_subst (string, &si, SX_NOALLOC); + else + ret = extract_dollar_brace_string (string, &si, Q_DOUBLE_QUOTES, SX_NOALLOC); + + i = si + 1; + continue; + } + else if (c != '"') + { + ADVANCE_CHAR (string, slen, i); + continue; + } + else + break; + } + + if (c) + i++; + + return (i); +} + +/* Extract the contents of STRING as if it is enclosed in single quotes. + SINDEX, when passed in, is the offset of the character immediately + following the opening single quote; on exit, SINDEX is left pointing after + the closing single quote. */ +static inline char * +string_extract_single_quoted (string, sindex) + char *string; + int *sindex; +{ + register int i; + size_t slen; + char *t; + DECLARE_MBSTATE; + + /* Don't need slen for ADVANCE_CHAR unless multibyte chars possible. */ + slen = (MB_CUR_MAX > 1) ? strlen (string + *sindex) + *sindex : 0; + i = *sindex; + while (string[i] && string[i] != '\'') + ADVANCE_CHAR (string, slen, i); + + t = substring (string, *sindex, i); + + if (string[i]) + i++; + *sindex = i; + + return (t); +} + +static inline int +skip_single_quoted (string, slen, sind) + const char *string; + size_t slen; + int sind; +{ + register int c; + DECLARE_MBSTATE; + + c = sind; + while (string[c] && string[c] != '\'') + ADVANCE_CHAR (string, slen, c); + + if (string[c]) + c++; + return c; +} + +/* Just like string_extract, but doesn't hack backslashes or any of + that other stuff. Obeys CTLESC quoting. Used to do splitting on $IFS. */ +static char * +string_extract_verbatim (string, slen, sindex, charlist, flags) + char *string; + size_t slen; + int *sindex; + char *charlist; + int flags; +{ + register int i; +#if defined (HANDLE_MULTIBYTE) + size_t clen; + wchar_t *wcharlist; +#endif + int c; + char *temp; + DECLARE_MBSTATE; + + if (charlist[0] == '\'' && charlist[1] == '\0') + { + temp = string_extract_single_quoted (string, sindex); + --*sindex; /* leave *sindex at separator character */ + return temp; + } + + i = *sindex; +#if 0 + /* See how the MBLEN and ADVANCE_CHAR macros work to understand why we need + this only if MB_CUR_MAX > 1. */ + slen = (MB_CUR_MAX > 1) ? strlen (string + *sindex) + *sindex : 1; +#endif +#if defined (HANDLE_MULTIBYTE) + clen = strlen (charlist); + wcharlist = 0; +#endif + while (c = string[i]) + { +#if defined (HANDLE_MULTIBYTE) + size_t mblength; +#endif + if ((flags & SX_NOCTLESC) == 0 && c == CTLESC) + { + i += 2; + continue; + } + /* Even if flags contains SX_NOCTLESC, we let CTLESC quoting CTLNUL + through, to protect the CTLNULs from later calls to + remove_quoted_nulls. */ + else if ((flags & SX_NOESCCTLNUL) == 0 && c == CTLESC && string[i+1] == CTLNUL) + { + i += 2; + continue; + } + +#if defined (HANDLE_MULTIBYTE) + mblength = MBLEN (string + i, slen - i); + if (mblength > 1) + { + wchar_t wc; + mblength = mbtowc (&wc, string + i, slen - i); + if (MB_INVALIDCH (mblength)) + { + if (MEMBER (c, charlist)) + break; + } + else + { + if (wcharlist == 0) + { + size_t len; + len = mbstowcs (wcharlist, charlist, 0); + if (len == -1) + len = 0; + wcharlist = (wchar_t *)xmalloc (sizeof (wchar_t) * (len + 1)); + mbstowcs (wcharlist, charlist, len + 1); + } + + if (wcschr (wcharlist, wc)) + break; + } + } + else +#endif + if (MEMBER (c, charlist)) + break; + + ADVANCE_CHAR (string, slen, i); + } + +#if defined (HANDLE_MULTIBYTE) + FREE (wcharlist); +#endif + + temp = substring (string, *sindex, i); + *sindex = i; + + return (temp); +} + +/* Extract the $( construct in STRING, and return a new string. + Start extracting at (SINDEX) as if we had just seen "$(". + Make (SINDEX) get the position of the matching ")". ) + XFLAGS is additional flags to pass to other extraction functions. */ +char * +extract_command_subst (string, sindex, xflags) + char *string; + int *sindex; + int xflags; +{ + if (string[*sindex] == LPAREN) + return (extract_delimited_string (string, sindex, "$(", "(", ")", xflags|SX_COMMAND)); /*)*/ + else + { + xflags |= (no_longjmp_on_fatal_error ? SX_NOLONGJMP : 0); + return (xparse_dolparen (string, string+*sindex, sindex, xflags)); + } +} + +/* Extract the $[ construct in STRING, and return a new string. (]) + Start extracting at (SINDEX) as if we had just seen "$[". + Make (SINDEX) get the position of the matching "]". */ +char * +extract_arithmetic_subst (string, sindex) + char *string; + int *sindex; +{ + return (extract_delimited_string (string, sindex, "$[", "[", "]", 0)); /*]*/ +} + +#if defined (PROCESS_SUBSTITUTION) +/* Extract the <( or >( construct in STRING, and return a new string. + Start extracting at (SINDEX) as if we had just seen "<(". + Make (SINDEX) get the position of the matching ")". */ /*))*/ +char * +extract_process_subst (string, starter, sindex) + char *string; + char *starter; + int *sindex; +{ + return (extract_delimited_string (string, sindex, starter, "(", ")", SX_COMMAND)); +} +#endif /* PROCESS_SUBSTITUTION */ + +#if defined (ARRAY_VARS) +/* This can be fooled by unquoted right parens in the passed string. If + each caller verifies that the last character in STRING is a right paren, + we don't even need to call extract_delimited_string. */ +char * +extract_array_assignment_list (string, sindex) + char *string; + int *sindex; +{ + int slen; + char *ret; + + slen = strlen (string); /* ( */ + if (string[slen - 1] == ')') + { + ret = substring (string, *sindex, slen - 1); + *sindex = slen - 1; + return ret; + } + return 0; +} +#endif + +/* Extract and create a new string from the contents of STRING, a + character string delimited with OPENER and CLOSER. SINDEX is + the address of an int describing the current offset in STRING; + it should point to just after the first OPENER found. On exit, + SINDEX gets the position of the last character of the matching CLOSER. + If OPENER is more than a single character, ALT_OPENER, if non-null, + contains a character string that can also match CLOSER and thus + needs to be skipped. */ +static char * +extract_delimited_string (string, sindex, opener, alt_opener, closer, flags) + char *string; + int *sindex; + char *opener, *alt_opener, *closer; + int flags; +{ + int i, c, si; + size_t slen; + char *t, *result; + int pass_character, nesting_level, in_comment; + int len_closer, len_opener, len_alt_opener; + DECLARE_MBSTATE; + + slen = strlen (string + *sindex) + *sindex; + len_opener = STRLEN (opener); + len_alt_opener = STRLEN (alt_opener); + len_closer = STRLEN (closer); + + pass_character = in_comment = 0; + + nesting_level = 1; + i = *sindex; + + while (nesting_level) + { + c = string[i]; + + if (c == 0) + break; + + if (in_comment) + { + if (c == '\n') + in_comment = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + + if (pass_character) /* previous char was backslash */ + { + pass_character = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + + /* Not exactly right yet; should handle shell metacharacters and + multibyte characters, too. See COMMENT_BEGIN define in parse.y */ + if ((flags & SX_COMMAND) && c == '#' && (i == 0 || string[i - 1] == '\n' || shellblank (string[i - 1]))) + { + in_comment = 1; + ADVANCE_CHAR (string, slen, i); + continue; + } + + if (c == CTLESC || c == '\\') + { + pass_character++; + i++; + continue; + } + + /* Process a nested command substitution, but only if we're parsing an + arithmetic substitution. */ + if ((flags & SX_COMMAND) && string[i] == '$' && string[i+1] == LPAREN) + { + si = i + 2; + t = extract_command_subst (string, &si, flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Process a nested OPENER. */ + if (STREQN (string + i, opener, len_opener)) + { + si = i + len_opener; + t = extract_delimited_string (string, &si, opener, alt_opener, closer, flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Process a nested ALT_OPENER */ + if (len_alt_opener && STREQN (string + i, alt_opener, len_alt_opener)) + { + si = i + len_alt_opener; + t = extract_delimited_string (string, &si, alt_opener, alt_opener, closer, flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* If the current substring terminates the delimited string, decrement + the nesting level. */ + if (STREQN (string + i, closer, len_closer)) + { + i += len_closer - 1; /* move to last byte of the closer */ + nesting_level--; + if (nesting_level == 0) + break; + } + + /* Pass old-style command substitution through verbatim. */ + if (c == '`') + { + si = i + 1; + t = string_extract (string, &si, "`", flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Pass single-quoted and double-quoted strings through verbatim. */ + if (c == '\'' || c == '"') + { + si = i + 1; + i = (c == '\'') ? skip_single_quoted (string, slen, si) + : skip_double_quoted (string, slen, si); + continue; + } + + /* move past this character, which was not special. */ + ADVANCE_CHAR (string, slen, i); + } + + if (c == 0 && nesting_level) + { + if (no_longjmp_on_fatal_error == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("bad substitution: no closing `%s' in %s"), closer, string); + exp_jump_to_top_level (DISCARD); + } + else + { + *sindex = i; + return (char *)NULL; + } + } + + si = i - *sindex - len_closer + 1; + if (flags & SX_NOALLOC) + result = (char *)NULL; + else + { + result = (char *)xmalloc (1 + si); + strncpy (result, string + *sindex, si); + result[si] = '\0'; + } + *sindex = i; + + return (result); +} + +/* Extract a parameter expansion expression within ${ and } from STRING. + Obey the Posix.2 rules for finding the ending `}': count braces while + skipping over enclosed quoted strings and command substitutions. + SINDEX is the address of an int describing the current offset in STRING; + it should point to just after the first `{' found. On exit, SINDEX + gets the position of the matching `}'. QUOTED is non-zero if this + occurs inside double quotes. */ +/* XXX -- this is very similar to extract_delimited_string -- XXX */ +static char * +extract_dollar_brace_string (string, sindex, quoted, flags) + char *string; + int *sindex, quoted, flags; +{ + register int i, c; + size_t slen; + int pass_character, nesting_level, si, dolbrace_state; + char *result, *t; + DECLARE_MBSTATE; + + pass_character = 0; + nesting_level = 1; + slen = strlen (string + *sindex) + *sindex; + + /* The handling of dolbrace_state needs to agree with the code in parse.y: + parse_matched_pair(). The different initial value is to handle the + case where this function is called to parse the word in + ${param op word} (SX_WORD). */ + dolbrace_state = (flags & SX_WORD) ? DOLBRACE_WORD : DOLBRACE_PARAM; + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && (flags & SX_POSIXEXP)) + dolbrace_state = DOLBRACE_QUOTE; + + i = *sindex; + while (c = string[i]) + { + if (pass_character) + { + pass_character = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + + /* CTLESCs and backslashes quote the next character. */ + if (c == CTLESC || c == '\\') + { + pass_character++; + i++; + continue; + } + + if (string[i] == '$' && string[i+1] == LBRACE) + { + nesting_level++; + i += 2; + continue; + } + + if (c == RBRACE) + { + nesting_level--; + if (nesting_level == 0) + break; + i++; + continue; + } + + /* Pass the contents of old-style command substitutions through + verbatim. */ + if (c == '`') + { + si = i + 1; + t = string_extract (string, &si, "`", flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Pass the contents of new-style command substitutions and + arithmetic substitutions through verbatim. */ + if (string[i] == '$' && string[i+1] == LPAREN) + { + si = i + 2; + t = extract_command_subst (string, &si, flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Pass the contents of double-quoted strings through verbatim. */ + if (c == '"') + { + si = i + 1; + i = skip_double_quoted (string, slen, si); + /* skip_XXX_quoted leaves index one past close quote */ + continue; + } + + if (c == '\'') + { +/*itrace("extract_dollar_brace_string: c == single quote flags = %d quoted = %d dolbrace_state = %d", flags, quoted, dolbrace_state);*/ + if (posixly_correct && shell_compatibility_level > 42 && dolbrace_state != DOLBRACE_QUOTE && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ADVANCE_CHAR (string, slen, i); + else + { + si = i + 1; + i = skip_single_quoted (string, slen, si); + } + + continue; + } + + /* move past this character, which was not special. */ + ADVANCE_CHAR (string, slen, i); + + /* This logic must agree with parse.y:parse_matched_pair, since they + share the same defines. */ + if (dolbrace_state == DOLBRACE_PARAM && c == '%' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if (dolbrace_state == DOLBRACE_PARAM && c == '#' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if (dolbrace_state == DOLBRACE_PARAM && c == '/' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE2; /* XXX */ + else if (dolbrace_state == DOLBRACE_PARAM && c == '^' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if (dolbrace_state == DOLBRACE_PARAM && c == ',' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if (dolbrace_state == DOLBRACE_PARAM && strchr ("#%^,~:-=?+/", c) != 0) + dolbrace_state = DOLBRACE_OP; + else if (dolbrace_state == DOLBRACE_OP && strchr ("#%^,~:-=?+/", c) == 0) + dolbrace_state = DOLBRACE_WORD; + } + + if (c == 0 && nesting_level) + { + if (no_longjmp_on_fatal_error == 0) + { /* { */ + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("bad substitution: no closing `%s' in %s"), "}", string); + exp_jump_to_top_level (DISCARD); + } + else + { + *sindex = i; + return ((char *)NULL); + } + } + + result = (flags & SX_NOALLOC) ? (char *)NULL : substring (string, *sindex, i); + *sindex = i; + + return (result); +} + +/* Remove backslashes which are quoting backquotes from STRING. Modifies + STRING, and returns a pointer to it. */ +char * +de_backslash (string) + char *string; +{ + register size_t slen; + register int i, j, prev_i; + DECLARE_MBSTATE; + + slen = strlen (string); + i = j = 0; + + /* Loop copying string[i] to string[j], i >= j. */ + while (i < slen) + { + if (string[i] == '\\' && (string[i + 1] == '`' || string[i + 1] == '\\' || + string[i + 1] == '$')) + i++; + prev_i = i; + ADVANCE_CHAR (string, slen, i); + if (j < prev_i) + do string[j++] = string[prev_i++]; while (prev_i < i); + else + j = i; + } + string[j] = '\0'; + + return (string); +} + +#if 0 +/*UNUSED*/ +/* Replace instances of \! in a string with !. */ +void +unquote_bang (string) + char *string; +{ + register int i, j; + register char *temp; + + temp = (char *)xmalloc (1 + strlen (string)); + + for (i = 0, j = 0; (temp[j] = string[i]); i++, j++) + { + if (string[i] == '\\' && string[i + 1] == '!') + { + temp[j] = '!'; + i++; + } + } + strcpy (string, temp); + free (temp); +} +#endif + +#define CQ_RETURN(x) do { no_longjmp_on_fatal_error = 0; return (x); } while (0) + +/* This function assumes s[i] == open; returns with s[ret] == close; used to + parse array subscripts. FLAGS & 1 means to not attempt to skip over + matched pairs of quotes or backquotes, or skip word expansions; it is + intended to be used after expansion has been performed and during final + assignment parsing (see arrayfunc.c:assign_compound_array_list()). */ +static int +skip_matched_pair (string, start, open, close, flags) + const char *string; + int start, open, close, flags; +{ + int i, pass_next, backq, si, c, count; + size_t slen; + char *temp, *ss; + DECLARE_MBSTATE; + + slen = strlen (string + start) + start; + no_longjmp_on_fatal_error = 1; + + i = start + 1; /* skip over leading bracket */ + count = 1; + pass_next = backq = 0; + ss = (char *)string; + while (c = string[i]) + { + if (pass_next) + { + pass_next = 0; + if (c == 0) + CQ_RETURN(i); + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (backq) + { + if (c == '`') + backq = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if ((flags & 1) == 0 && c == '`') + { + backq = 1; + i++; + continue; + } + else if ((flags & 1) == 0 && c == open) + { + count++; + i++; + continue; + } + else if (c == close) + { + count--; + if (count == 0) + break; + i++; + continue; + } + else if ((flags & 1) == 0 && (c == '\'' || c == '"')) + { + i = (c == '\'') ? skip_single_quoted (ss, slen, ++i) + : skip_double_quoted (ss, slen, ++i); + /* no increment, the skip functions increment past the closing quote. */ + } + else if ((flags&1) == 0 && c == '$' && (string[i+1] == LPAREN || string[i+1] == LBRACE)) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + + if (string[i+1] == LPAREN) + temp = extract_delimited_string (ss, &si, "$(", "(", ")", SX_NOALLOC|SX_COMMAND); /* ) */ + else + temp = extract_dollar_brace_string (ss, &si, 0, SX_NOALLOC); + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } + else + ADVANCE_CHAR (string, slen, i); + } + + CQ_RETURN(i); +} + +#if defined (ARRAY_VARS) +int +skipsubscript (string, start, flags) + const char *string; + int start, flags; +{ + return (skip_matched_pair (string, start, '[', ']', flags)); +} +#endif + +/* Skip characters in STRING until we find a character in DELIMS, and return + the index of that character. START is the index into string at which we + begin. This is similar in spirit to strpbrk, but it returns an index into + STRING and takes a starting index. This little piece of code knows quite + a lot of shell syntax. It's very similar to skip_double_quoted and other + functions of that ilk. */ +int +skip_to_delim (string, start, delims, flags) + char *string; + int start; + char *delims; + int flags; +{ + int i, pass_next, backq, si, c, invert, skipquote, skipcmd; + size_t slen; + char *temp, open[3]; + DECLARE_MBSTATE; + + slen = strlen (string + start) + start; + if (flags & SD_NOJMP) + no_longjmp_on_fatal_error = 1; + invert = (flags & SD_INVERT); + skipcmd = (flags & SD_NOSKIPCMD) == 0; + + i = start; + pass_next = backq = 0; + while (c = string[i]) + { + /* If this is non-zero, we should not let quote characters be delimiters + and the current character is a single or double quote. We should not + test whether or not it's a delimiter until after we skip single- or + double-quoted strings. */ + skipquote = ((flags & SD_NOQUOTEDELIM) && (c == '\'' || c =='"')); + if (pass_next) + { + pass_next = 0; + if (c == 0) + CQ_RETURN(i); + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (backq) + { + if (c == '`') + backq = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '`') + { + backq = 1; + i++; + continue; + } + else if (skipquote == 0 && invert == 0 && member (c, delims)) + break; + else if (c == '\'' || c == '"') + { + i = (c == '\'') ? skip_single_quoted (string, slen, ++i) + : skip_double_quoted (string, slen, ++i); + /* no increment, the skip functions increment past the closing quote. */ + } + else if (c == '$' && ((skipcmd && string[i+1] == LPAREN) || string[i+1] == LBRACE)) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + + if (string[i+1] == LPAREN) + temp = extract_delimited_string (string, &si, "$(", "(", ")", SX_NOALLOC|SX_COMMAND); /* ) */ + else + temp = extract_dollar_brace_string (string, &si, 0, SX_NOALLOC); + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } +#if defined (PROCESS_SUBSTITUTION) + else if (skipcmd && (c == '<' || c == '>') && string[i+1] == LPAREN) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + temp = extract_process_subst (string, (c == '<') ? "<(" : ">(", &si); + free (temp); /* no SX_ALLOC here */ + i = si; + if (string[i] == '\0') + break; + i++; + continue; + } +#endif /* PROCESS_SUBSTITUTION */ +#if defined (EXTENDED_GLOB) + else if ((flags & SD_EXTGLOB) && extended_glob && string[i+1] == LPAREN && member (c, "?*+!@")) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + + open[0] = c; + open[1] = LPAREN; + open[2] = '\0'; + temp = extract_delimited_string (string, &si, open, "(", ")", SX_NOALLOC); /* ) */ + + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } +#endif + else if ((flags & SD_GLOB) && c == LBRACK) + { + si = i + 1; + if (string[si] == '\0') + CQ_RETURN(si); + + temp = extract_delimited_string (string, &si, "[", "[", "]", SX_NOALLOC); /* ] */ + + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } + else if ((skipquote || invert) && (member (c, delims) == 0)) + break; + else + ADVANCE_CHAR (string, slen, i); + } + + CQ_RETURN(i); +} + +#if defined (READLINE) +/* Return 1 if the portion of STRING ending at EINDEX is quoted (there is + an unclosed quoted string), or if the character at EINDEX is quoted + by a backslash. NO_LONGJMP_ON_FATAL_ERROR is used to flag that the various + single and double-quoted string parsing functions should not return an + error if there are unclosed quotes or braces. The characters that this + recognizes need to be the same as the contents of + rl_completer_quote_characters. */ + +int +char_is_quoted (string, eindex) + char *string; + int eindex; +{ + int i, pass_next, c; + size_t slen; + DECLARE_MBSTATE; + + slen = strlen (string); + no_longjmp_on_fatal_error = 1; + i = pass_next = 0; + while (i <= eindex) + { + c = string[i]; + + if (pass_next) + { + pass_next = 0; + if (i >= eindex) /* XXX was if (i >= eindex - 1) */ + CQ_RETURN(1); + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (c == '\'' || c == '"') + { + i = (c == '\'') ? skip_single_quoted (string, slen, ++i) + : skip_double_quoted (string, slen, ++i); + if (i > eindex) + CQ_RETURN(1); + /* no increment, the skip_xxx functions go one past end */ + } + else + ADVANCE_CHAR (string, slen, i); + } + + CQ_RETURN(0); +} + +int +unclosed_pair (string, eindex, openstr) + char *string; + int eindex; + char *openstr; +{ + int i, pass_next, openc, olen; + size_t slen; + DECLARE_MBSTATE; + + slen = strlen (string); + olen = strlen (openstr); + i = pass_next = openc = 0; + while (i <= eindex) + { + if (pass_next) + { + pass_next = 0; + if (i >= eindex) /* XXX was if (i >= eindex - 1) */ + return 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (string[i] == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (STREQN (string + i, openstr, olen)) + { + openc = 1 - openc; + i += olen; + } + else if (string[i] == '\'' || string[i] == '"') + { + i = (string[i] == '\'') ? skip_single_quoted (string, slen, i) + : skip_double_quoted (string, slen, i); + if (i > eindex) + return 0; + } + else + ADVANCE_CHAR (string, slen, i); + } + return (openc); +} + +/* Split STRING (length SLEN) at DELIMS, and return a WORD_LIST with the + individual words. If DELIMS is NULL, the current value of $IFS is used + to split the string, and the function follows the shell field splitting + rules. SENTINEL is an index to look for. NWP, if non-NULL, + gets the number of words in the returned list. CWP, if non-NULL, gets + the index of the word containing SENTINEL. Non-whitespace chars in + DELIMS delimit separate fields. */ +WORD_LIST * +split_at_delims (string, slen, delims, sentinel, flags, nwp, cwp) + char *string; + int slen; + char *delims; + int sentinel, flags; + int *nwp, *cwp; +{ + int ts, te, i, nw, cw, ifs_split, dflags; + char *token, *d, *d2; + WORD_LIST *ret, *tl; + + if (string == 0 || *string == '\0') + { + if (nwp) + *nwp = 0; + if (cwp) + *cwp = 0; + return ((WORD_LIST *)NULL); + } + + d = (delims == 0) ? ifs_value : delims; + ifs_split = delims == 0; + + /* Make d2 the non-whitespace characters in delims */ + d2 = 0; + if (delims) + { + size_t slength; +#if defined (HANDLE_MULTIBYTE) + size_t mblength = 1; +#endif + DECLARE_MBSTATE; + + slength = strlen (delims); + d2 = (char *)xmalloc (slength + 1); + i = ts = 0; + while (delims[i]) + { +#if defined (HANDLE_MULTIBYTE) + mbstate_t state_bak; + state_bak = state; + mblength = MBRLEN (delims + i, slength, &state); + if (MB_INVALIDCH (mblength)) + state = state_bak; + else if (mblength > 1) + { + memcpy (d2 + ts, delims + i, mblength); + ts += mblength; + i += mblength; + slength -= mblength; + continue; + } +#endif + if (whitespace (delims[i]) == 0) + d2[ts++] = delims[i]; + + i++; + slength--; + } + d2[ts] = '\0'; + } + + ret = (WORD_LIST *)NULL; + + /* Remove sequences of whitespace characters at the start of the string, as + long as those characters are delimiters. */ + for (i = 0; member (string[i], d) && spctabnl (string[i]); i++) + ; + if (string[i] == '\0') + return (ret); + + ts = i; + nw = 0; + cw = -1; + dflags = flags|SD_NOJMP; + while (1) + { + te = skip_to_delim (string, ts, d, dflags); + + /* If we have a non-whitespace delimiter character, use it to make a + separate field. This is just about what $IFS splitting does and + is closer to the behavior of the shell parser. */ + if (ts == te && d2 && member (string[ts], d2)) + { + te = ts + 1; + /* If we're using IFS splitting, the non-whitespace delimiter char + and any additional IFS whitespace delimits a field. */ + if (ifs_split) + while (member (string[te], d) && spctabnl (string[te])) + te++; + else + while (member (string[te], d2)) + te++; + } + + token = substring (string, ts, te); + + ret = add_string_to_list (token, ret); + free (token); + nw++; + + if (sentinel >= ts && sentinel <= te) + cw = nw; + + /* If the cursor is at whitespace just before word start, set the + sentinel word to the current word. */ + if (cwp && cw == -1 && sentinel == ts-1) + cw = nw; + + /* If the cursor is at whitespace between two words, make a new, empty + word, add it before (well, after, since the list is in reverse order) + the word we just added, and set the current word to that one. */ + if (cwp && cw == -1 && sentinel < ts) + { + tl = make_word_list (make_word (""), ret->next); + ret->next = tl; + cw = nw; + nw++; + } + + if (string[te] == 0) + break; + + i = te; + while (member (string[i], d) && (ifs_split || spctabnl(string[i]))) + i++; + + if (string[i]) + ts = i; + else + break; + } + + /* Special case for SENTINEL at the end of STRING. If we haven't found + the word containing SENTINEL yet, and the index we're looking for is at + the end of STRING (or past the end of the previously-found token, + possible if the end of the line is composed solely of IFS whitespace) + add an additional null argument and set the current word pointer to that. */ + if (cwp && cw == -1 && (sentinel >= slen || sentinel >= te)) + { + if (whitespace (string[sentinel - 1])) + { + token = ""; + ret = add_string_to_list (token, ret); + nw++; + } + cw = nw; + } + + if (nwp) + *nwp = nw; + if (cwp) + *cwp = cw; + + FREE (d2); + + return (REVERSE_LIST (ret, WORD_LIST *)); +} +#endif /* READLINE */ + +#if 0 +/* UNUSED */ +/* Extract the name of the variable to bind to from the assignment string. */ +char * +assignment_name (string) + char *string; +{ + int offset; + char *temp; + + offset = assignment (string, 0); + if (offset == 0) + return (char *)NULL; + temp = substring (string, 0, offset); + return (temp); +} +#endif + +/* **************************************************************** */ +/* */ +/* Functions to convert strings to WORD_LISTs and vice versa */ +/* */ +/* **************************************************************** */ + +/* Return a single string of all the words in LIST. SEP is the separator + to put between individual elements of LIST in the output string. */ +char * +string_list_internal (list, sep) + WORD_LIST *list; + char *sep; +{ + register WORD_LIST *t; + char *result, *r; + int word_len, sep_len, result_size; + + if (list == 0) + return ((char *)NULL); + + /* Short-circuit quickly if we don't need to separate anything. */ + if (list->next == 0) + return (savestring (list->word->word)); + + /* This is nearly always called with either sep[0] == 0 or sep[1] == 0. */ + sep_len = STRLEN (sep); + result_size = 0; + + for (t = list; t; t = t->next) + { + if (t != list) + result_size += sep_len; + result_size += strlen (t->word->word); + } + + r = result = (char *)xmalloc (result_size + 1); + + for (t = list; t; t = t->next) + { + if (t != list && sep_len) + { + if (sep_len > 1) + { + FASTCOPY (sep, r, sep_len); + r += sep_len; + } + else + *r++ = sep[0]; + } + + word_len = strlen (t->word->word); + FASTCOPY (t->word->word, r, word_len); + r += word_len; + } + + *r = '\0'; + return (result); +} + +/* Return a single string of all the words present in LIST, separating + each word with a space. */ +char * +string_list (list) + WORD_LIST *list; +{ + return (string_list_internal (list, " ")); +} + +/* An external interface that can be used by the rest of the shell to + obtain a string containing the first character in $IFS. Handles all + the multibyte complications. If LENP is non-null, it is set to the + length of the returned string. */ +char * +ifs_firstchar (lenp) + int *lenp; +{ + char *ret; + int len; + + ret = xmalloc (MB_LEN_MAX + 1); +#if defined (HANDLE_MULTIBYTE) + if (ifs_firstc_len == 1) + { + ret[0] = ifs_firstc[0]; + ret[1] = '\0'; + len = ret[0] ? 1 : 0; + } + else + { + memcpy (ret, ifs_firstc, ifs_firstc_len); + ret[len = ifs_firstc_len] = '\0'; + } +#else + ret[0] = ifs_firstc; + ret[1] = '\0'; + len = ret[0] ? 0 : 1; +#endif + + if (lenp) + *lenp = len; + + return ret; +} + +/* Return a single string of all the words present in LIST, obeying the + quoting rules for "$*", to wit: (P1003.2, draft 11, 3.5.2) "If the + expansion [of $*] appears within a double quoted string, it expands + to a single field with the value of each parameter separated by the + first character of the IFS variable, or by a if IFS is unset." */ +char * +string_list_dollar_star (list) + WORD_LIST *list; +{ + char *ret; +#if defined (HANDLE_MULTIBYTE) +# if defined (__GNUC__) + char sep[MB_CUR_MAX + 1]; +# else + char *sep = 0; +# endif +#else + char sep[2]; +#endif + +#if defined (HANDLE_MULTIBYTE) +# if !defined (__GNUC__) + sep = (char *)xmalloc (MB_CUR_MAX + 1); +# endif /* !__GNUC__ */ + if (ifs_firstc_len == 1) + { + sep[0] = ifs_firstc[0]; + sep[1] = '\0'; + } + else + { + memcpy (sep, ifs_firstc, ifs_firstc_len); + sep[ifs_firstc_len] = '\0'; + } +#else + sep[0] = ifs_firstc; + sep[1] = '\0'; +#endif + + ret = string_list_internal (list, sep); +#if defined (HANDLE_MULTIBYTE) && !defined (__GNUC__) + free (sep); +#endif + return ret; +} + +/* Turn $@ into a string. If (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + is non-zero, the $@ appears within double quotes, and we should quote + the list before converting it into a string. If IFS is unset, and the + word is not quoted, we just need to quote CTLESC and CTLNUL characters + in the words in the list, because the default value of $IFS is + , IFS characters in the words in the list should + also be split. If IFS is null, and the word is not quoted, we need + to quote the words in the list to preserve the positional parameters + exactly. */ +char * +string_list_dollar_at (list, quoted) + WORD_LIST *list; + int quoted; +{ + char *ifs, *ret; +#if defined (HANDLE_MULTIBYTE) +# if defined (__GNUC__) + char sep[MB_CUR_MAX + 1]; +# else + char *sep = 0; +# endif /* !__GNUC__ */ +#else + char sep[2]; +#endif + WORD_LIST *tlist; + + /* XXX this could just be ifs = ifs_value; */ + ifs = ifs_var ? value_cell (ifs_var) : (char *)0; + +#if defined (HANDLE_MULTIBYTE) +# if !defined (__GNUC__) + sep = (char *)xmalloc (MB_CUR_MAX + 1); +# endif /* !__GNUC__ */ + if (ifs && *ifs) + { + if (ifs_firstc_len == 1) + { + sep[0] = ifs_firstc[0]; + sep[1] = '\0'; + } + else + { + memcpy (sep, ifs_firstc, ifs_firstc_len); + sep[ifs_firstc_len] = '\0'; + } + } + else + { + sep[0] = ' '; + sep[1] = '\0'; + } +#else + sep[0] = (ifs == 0 || *ifs == 0) ? ' ' : *ifs; + sep[1] = '\0'; +#endif + + /* XXX -- why call quote_list if ifs == 0? we can get away without doing + it now that quote_escapes quotes spaces */ + tlist = (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES|Q_PATQUOTE)) + ? quote_list (list) + : list_quote_escapes (list); + + ret = string_list_internal (tlist, sep); +#if defined (HANDLE_MULTIBYTE) && !defined (__GNUC__) + free (sep); +#endif + return ret; +} + +/* Turn the positional parameters into a string, understanding quoting and + the various subtleties of using the first character of $IFS as the + separator. Calls string_list_dollar_at, string_list_dollar_star, and + string_list as appropriate. */ +char * +string_list_pos_params (pchar, list, quoted) + int pchar; + WORD_LIST *list; + int quoted; +{ + char *ret; + WORD_LIST *tlist; + + if (pchar == '*' && (quoted & Q_DOUBLE_QUOTES)) + { + tlist = quote_list (list); + word_list_remove_quoted_nulls (tlist); + ret = string_list_dollar_star (tlist); + } + else if (pchar == '*' && (quoted & Q_HERE_DOCUMENT)) + { + tlist = quote_list (list); + word_list_remove_quoted_nulls (tlist); + ret = string_list (tlist); + } + else if (pchar == '*') + { + /* Even when unquoted, string_list_dollar_star does the right thing + making sure that the first character of $IFS is used as the + separator. */ + ret = string_list_dollar_star (list); + } + else if (pchar == '@' && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + /* We use string_list_dollar_at, but only if the string is quoted, since + that quotes the escapes if it's not, which we don't want. We could + use string_list (the old code did), but that doesn't do the right + thing if the first character of $IFS is not a space. We use + string_list_dollar_star if the string is unquoted so we make sure that + the elements of $@ are separated by the first character of $IFS for + later splitting. */ + ret = string_list_dollar_at (list, quoted); + else if (pchar == '@') + ret = string_list_dollar_star (list); + else + ret = string_list ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) ? quote_list (list) : list); + + return ret; +} + +/* Return the list of words present in STRING. Separate the string into + words at any of the characters found in SEPARATORS. If QUOTED is + non-zero then word in the list will have its quoted flag set, otherwise + the quoted flag is left as make_word () deemed fit. + + This obeys the P1003.2 word splitting semantics. If `separators' is + exactly , then the splitting algorithm is that of + the Bourne shell, which treats any sequence of characters from `separators' + as a delimiter. If IFS is unset, which results in `separators' being set + to "", no splitting occurs. If separators has some other value, the + following rules are applied (`IFS white space' means zero or more + occurrences of , , or , as long as those characters + are in `separators'): + + 1) IFS white space is ignored at the start and the end of the + string. + 2) Each occurrence of a character in `separators' that is not + IFS white space, along with any adjacent occurrences of + IFS white space delimits a field. + 3) Any nonzero-length sequence of IFS white space delimits a field. + */ + +/* BEWARE! list_string strips null arguments. Don't call it twice and + expect to have "" preserved! */ + +/* This performs word splitting and quoted null character removal on + STRING. */ +#define issep(c) \ + (((separators)[0]) ? ((separators)[1] ? isifs(c) \ + : (c) == (separators)[0]) \ + : 0) + +WORD_LIST * +list_string (string, separators, quoted) + register char *string, *separators; + int quoted; +{ + WORD_LIST *result; + WORD_DESC *t; + char *current_word, *s; + int sindex, sh_style_split, whitesep, xflags; + size_t slen; + + if (!string || !*string) + return ((WORD_LIST *)NULL); + + sh_style_split = separators && separators[0] == ' ' && + separators[1] == '\t' && + separators[2] == '\n' && + separators[3] == '\0'; + for (xflags = 0, s = ifs_value; s && *s; s++) + { + if (*s == CTLESC) xflags |= SX_NOCTLESC; + else if (*s == CTLNUL) xflags |= SX_NOESCCTLNUL; + } + + slen = 0; + /* Remove sequences of whitespace at the beginning of STRING, as + long as those characters appear in IFS. Do not do this if + STRING is quoted or if there are no separator characters. */ + if (!quoted || !separators || !*separators) + { + for (s = string; *s && spctabnl (*s) && issep (*s); s++); + + if (!*s) + return ((WORD_LIST *)NULL); + + string = s; + } + + /* OK, now STRING points to a word that does not begin with white space. + The splitting algorithm is: + extract a word, stopping at a separator + skip sequences of spc, tab, or nl as long as they are separators + This obeys the field splitting rules in Posix.2. */ + slen = (MB_CUR_MAX > 1) ? strlen (string) : 1; + for (result = (WORD_LIST *)NULL, sindex = 0; string[sindex]; ) + { + /* Don't need string length in ADVANCE_CHAR or string_extract_verbatim + unless multibyte chars are possible. */ + current_word = string_extract_verbatim (string, slen, &sindex, separators, xflags); + if (current_word == 0) + break; + + /* If we have a quoted empty string, add a quoted null argument. We + want to preserve the quoted null character iff this is a quoted + empty string; otherwise the quoted null characters are removed + below. */ + if (QUOTED_NULL (current_word)) + { + t = alloc_word_desc (); + t->word = make_quoted_char ('\0'); + t->flags |= W_QUOTED|W_HASQUOTEDNULL; + result = make_word_list (t, result); + } + else if (current_word[0] != '\0') + { + /* If we have something, then add it regardless. However, + perform quoted null character removal on the current word. */ + remove_quoted_nulls (current_word); + result = add_string_to_list (current_word, result); + result->word->flags &= ~W_HASQUOTEDNULL; /* just to be sure */ + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + result->word->flags |= W_QUOTED; + } + + /* If we're not doing sequences of separators in the traditional + Bourne shell style, then add a quoted null argument. */ + else if (!sh_style_split && !spctabnl (string[sindex])) + { + t = alloc_word_desc (); + t->word = make_quoted_char ('\0'); + t->flags |= W_QUOTED|W_HASQUOTEDNULL; + result = make_word_list (t, result); + } + + free (current_word); + + /* Note whether or not the separator is IFS whitespace, used later. */ + whitesep = string[sindex] && spctabnl (string[sindex]); + + /* Move past the current separator character. */ + if (string[sindex]) + { + DECLARE_MBSTATE; + ADVANCE_CHAR (string, slen, sindex); + } + + /* Now skip sequences of space, tab, or newline characters if they are + in the list of separators. */ + while (string[sindex] && spctabnl (string[sindex]) && issep (string[sindex])) + sindex++; + + /* If the first separator was IFS whitespace and the current character + is a non-whitespace IFS character, it should be part of the current + field delimiter, not a separate delimiter that would result in an + empty field. Look at POSIX.2, 3.6.5, (3)(b). */ + if (string[sindex] && whitesep && issep (string[sindex]) && !spctabnl (string[sindex])) + { + sindex++; + /* An IFS character that is not IFS white space, along with any + adjacent IFS white space, shall delimit a field. (SUSv3) */ + while (string[sindex] && spctabnl (string[sindex]) && isifs (string[sindex])) + sindex++; + } + } + return (REVERSE_LIST (result, WORD_LIST *)); +} + +/* Parse a single word from STRING, using SEPARATORS to separate fields. + ENDPTR is set to the first character after the word. This is used by + the `read' builtin. This is never called with SEPARATORS != $IFS; + it should be simplified. + + XXX - this function is very similar to list_string; they should be + combined - XXX */ +char * +get_word_from_string (stringp, separators, endptr) + char **stringp, *separators, **endptr; +{ + register char *s; + char *current_word; + int sindex, sh_style_split, whitesep, xflags; + size_t slen; + + if (!stringp || !*stringp || !**stringp) + return ((char *)NULL); + + sh_style_split = separators && separators[0] == ' ' && + separators[1] == '\t' && + separators[2] == '\n' && + separators[3] == '\0'; + for (xflags = 0, s = ifs_value; s && *s; s++) + { + if (*s == CTLESC) xflags |= SX_NOCTLESC; + if (*s == CTLNUL) xflags |= SX_NOESCCTLNUL; + } + + s = *stringp; + slen = 0; + + /* Remove sequences of whitespace at the beginning of STRING, as + long as those characters appear in IFS. */ + if (sh_style_split || !separators || !*separators) + { + for (; *s && spctabnl (*s) && isifs (*s); s++); + + /* If the string is nothing but whitespace, update it and return. */ + if (!*s) + { + *stringp = s; + if (endptr) + *endptr = s; + return ((char *)NULL); + } + } + + /* OK, S points to a word that does not begin with white space. + Now extract a word, stopping at a separator, save a pointer to + the first character after the word, then skip sequences of spc, + tab, or nl as long as they are separators. + + This obeys the field splitting rules in Posix.2. */ + sindex = 0; + /* Don't need string length in ADVANCE_CHAR or string_extract_verbatim + unless multibyte chars are possible. */ + slen = (MB_CUR_MAX > 1) ? strlen (s) : 1; + current_word = string_extract_verbatim (s, slen, &sindex, separators, xflags); + + /* Set ENDPTR to the first character after the end of the word. */ + if (endptr) + *endptr = s + sindex; + + /* Note whether or not the separator is IFS whitespace, used later. */ + whitesep = s[sindex] && spctabnl (s[sindex]); + + /* Move past the current separator character. */ + if (s[sindex]) + { + DECLARE_MBSTATE; + ADVANCE_CHAR (s, slen, sindex); + } + + /* Now skip sequences of space, tab, or newline characters if they are + in the list of separators. */ + while (s[sindex] && spctabnl (s[sindex]) && isifs (s[sindex])) + sindex++; + + /* If the first separator was IFS whitespace and the current character is + a non-whitespace IFS character, it should be part of the current field + delimiter, not a separate delimiter that would result in an empty field. + Look at POSIX.2, 3.6.5, (3)(b). */ + if (s[sindex] && whitesep && isifs (s[sindex]) && !spctabnl (s[sindex])) + { + sindex++; + /* An IFS character that is not IFS white space, along with any adjacent + IFS white space, shall delimit a field. */ + while (s[sindex] && spctabnl (s[sindex]) && isifs (s[sindex])) + sindex++; + } + + /* Update STRING to point to the next field. */ + *stringp = s + sindex; + return (current_word); +} + +/* Remove IFS white space at the end of STRING. Start at the end + of the string and walk backwards until the beginning of the string + or we find a character that's not IFS white space and not CTLESC. + Only let CTLESC escape a white space character if SAW_ESCAPE is + non-zero. */ +char * +strip_trailing_ifs_whitespace (string, separators, saw_escape) + char *string, *separators; + int saw_escape; +{ + char *s; + + s = string + STRLEN (string) - 1; + while (s > string && ((spctabnl (*s) && isifs (*s)) || + (saw_escape && *s == CTLESC && spctabnl (s[1])))) + s--; + *++s = '\0'; + return string; +} + +#if 0 +/* UNUSED */ +/* Split STRING into words at whitespace. Obeys shell-style quoting with + backslashes, single and double quotes. */ +WORD_LIST * +list_string_with_quotes (string) + char *string; +{ + WORD_LIST *list; + char *token, *s; + size_t s_len; + int c, i, tokstart, len; + + for (s = string; s && *s && spctabnl (*s); s++) + ; + if (s == 0 || *s == 0) + return ((WORD_LIST *)NULL); + + s_len = strlen (s); + tokstart = i = 0; + list = (WORD_LIST *)NULL; + while (1) + { + c = s[i]; + if (c == '\\') + { + i++; + if (s[i]) + i++; + } + else if (c == '\'') + i = skip_single_quoted (s, s_len, ++i); + else if (c == '"') + i = skip_double_quoted (s, s_len, ++i); + else if (c == 0 || spctabnl (c)) + { + /* We have found the end of a token. Make a word out of it and + add it to the word list. */ + token = substring (s, tokstart, i); + list = add_string_to_list (token, list); + free (token); + while (spctabnl (s[i])) + i++; + if (s[i]) + tokstart = i; + else + break; + } + else + i++; /* normal character */ + } + return (REVERSE_LIST (list, WORD_LIST *)); +} +#endif + +/********************************************************/ +/* */ +/* Functions to perform assignment statements */ +/* */ +/********************************************************/ + +#if defined (ARRAY_VARS) +static SHELL_VAR * +do_compound_assignment (name, value, flags) + char *name, *value; + int flags; +{ + SHELL_VAR *v; + int mklocal, mkassoc, mkglobal; + WORD_LIST *list; + + mklocal = flags & ASS_MKLOCAL; + mkassoc = flags & ASS_MKASSOC; + mkglobal = flags & ASS_MKGLOBAL; + + if (mklocal && variable_context) + { + v = find_variable (name); + list = expand_compound_array_assignment (v, value, flags); + if (mkassoc) + v = make_local_assoc_variable (name); + else if (v == 0 || (array_p (v) == 0 && assoc_p (v) == 0) || v->context != variable_context) + v = make_local_array_variable (name, 0); + if (v) + assign_compound_array_list (v, list, flags); + } + /* In a function but forcing assignment in global context */ + else if (mkglobal && variable_context) + { + v = find_global_variable (name); + list = expand_compound_array_assignment (v, value, flags); + if (v == 0 && mkassoc) + v = make_new_assoc_variable (name); + else if (v && mkassoc && assoc_p (v) == 0) + v = convert_var_to_assoc (v); + else if (v == 0) + v = make_new_array_variable (name); + else if (v && mkassoc == 0 && array_p (v) == 0) + v = convert_var_to_array (v); + if (v) + assign_compound_array_list (v, list, flags); + } + else + v = assign_array_from_string (name, value, flags); + + return (v); +} +#endif + +/* Given STRING, an assignment string, get the value of the right side + of the `=', and bind it to the left side. If EXPAND is true, then + perform parameter expansion, command substitution, and arithmetic + expansion on the right-hand side. Perform tilde expansion in any + case. Do not perform word splitting on the result of expansion. */ +static int +do_assignment_internal (word, expand) + const WORD_DESC *word; + int expand; +{ + int offset, appendop, assign_list, aflags, retval; + char *name, *value, *temp; + SHELL_VAR *entry; +#if defined (ARRAY_VARS) + char *t; + int ni; +#endif + const char *string; + + if (word == 0 || word->word == 0) + return 0; + + appendop = assign_list = aflags = 0; + string = word->word; + offset = assignment (string, 0); + name = savestring (string); + value = (char *)NULL; + + if (name[offset] == '=') + { + if (name[offset - 1] == '+') + { + appendop = 1; + name[offset - 1] = '\0'; + } + + name[offset] = 0; /* might need this set later */ + temp = name + offset + 1; + +#if defined (ARRAY_VARS) + if (expand && (word->flags & W_COMPASSIGN)) + { + assign_list = ni = 1; + value = extract_array_assignment_list (temp, &ni); + } + else +#endif + if (expand && temp[0]) + value = expand_string_if_necessary (temp, 0, expand_string_assignment); + else + value = savestring (temp); + } + + if (value == 0) + { + value = (char *)xmalloc (1); + value[0] = '\0'; + } + + if (echo_command_at_execute) + { + if (appendop) + name[offset - 1] = '+'; + xtrace_print_assignment (name, value, assign_list, 1); + if (appendop) + name[offset - 1] = '\0'; + } + +#define ASSIGN_RETURN(r) do { FREE (value); free (name); return (r); } while (0) + + if (appendop) + aflags |= ASS_APPEND; + +#if defined (ARRAY_VARS) + if (t = mbschr (name, '[')) /*]*/ + { + if (assign_list) + { + report_error (_("%s: cannot assign list to array member"), name); + ASSIGN_RETURN (0); + } + entry = assign_array_element (name, value, aflags); + if (entry == 0) + ASSIGN_RETURN (0); + } + else if (assign_list) + { + if ((word->flags & W_ASSIGNARG) && (word->flags & W_ASSNGLOBAL) == 0) + aflags |= ASS_MKLOCAL; + if ((word->flags & W_ASSIGNARG) && (word->flags & W_ASSNGLOBAL)) + aflags |= ASS_MKGLOBAL; + if (word->flags & W_ASSIGNASSOC) + aflags |= ASS_MKASSOC; + entry = do_compound_assignment (name, value, aflags); + } + else +#endif /* ARRAY_VARS */ + entry = bind_variable (name, value, aflags); + + stupidly_hack_special_variables (name); + + /* Return 1 if the assignment seems to have been performed correctly. */ + if (entry == 0 || readonly_p (entry)) + retval = 0; /* assignment failure */ + else if (noassign_p (entry)) + { + last_command_exit_value = EXECUTION_FAILURE; + retval = 1; /* error status, but not assignment failure */ + } + else + retval = 1; + + if (entry && retval != 0 && noassign_p (entry) == 0) + VUNSETATTR (entry, att_invisible); + + ASSIGN_RETURN (retval); +} + +/* Perform the assignment statement in STRING, and expand the + right side by doing tilde, command and parameter expansion. */ +int +do_assignment (string) + char *string; +{ + WORD_DESC td; + + td.flags = W_ASSIGNMENT; + td.word = string; + + return do_assignment_internal (&td, 1); +} + +int +do_word_assignment (word, flags) + WORD_DESC *word; + int flags; +{ + return do_assignment_internal (word, 1); +} + +/* Given STRING, an assignment string, get the value of the right side + of the `=', and bind it to the left side. Do not perform any word + expansions on the right hand side. */ +int +do_assignment_no_expand (string) + char *string; +{ + WORD_DESC td; + + td.flags = W_ASSIGNMENT; + td.word = string; + + return (do_assignment_internal (&td, 0)); +} + +/*************************************************** + * * + * Functions to manage the positional parameters * + * * + ***************************************************/ + +/* Return the word list that corresponds to `$*'. */ +WORD_LIST * +list_rest_of_args () +{ + register WORD_LIST *list, *args; + int i; + + /* Break out of the loop as soon as one of the dollar variables is null. */ + for (i = 1, list = (WORD_LIST *)NULL; i < 10 && dollar_vars[i]; i++) + list = make_word_list (make_bare_word (dollar_vars[i]), list); + + for (args = rest_of_args; args; args = args->next) + list = make_word_list (make_bare_word (args->word->word), list); + + return (REVERSE_LIST (list, WORD_LIST *)); +} + +int +number_of_args () +{ + register WORD_LIST *list; + int n; + + for (n = 0; n < 9 && dollar_vars[n+1]; n++) + ; + for (list = rest_of_args; list; list = list->next) + n++; + return n; +} + +/* Return the value of a positional parameter. This handles values > 10. */ +char * +get_dollar_var_value (ind) + intmax_t ind; +{ + char *temp; + WORD_LIST *p; + + if (ind < 10) + temp = dollar_vars[ind] ? savestring (dollar_vars[ind]) : (char *)NULL; + else /* We want something like ${11} */ + { + ind -= 10; + for (p = rest_of_args; p && ind--; p = p->next) + ; + temp = p ? savestring (p->word->word) : (char *)NULL; + } + return (temp); +} + +/* Make a single large string out of the dollar digit variables, + and the rest_of_args. If DOLLAR_STAR is 1, then obey the special + case of "$*" with respect to IFS. */ +char * +string_rest_of_args (dollar_star) + int dollar_star; +{ + register WORD_LIST *list; + char *string; + + list = list_rest_of_args (); + string = dollar_star ? string_list_dollar_star (list) : string_list (list); + dispose_words (list); + return (string); +} + +/* Return a string containing the positional parameters from START to + END, inclusive. If STRING[0] == '*', we obey the rules for $*, + which only makes a difference if QUOTED is non-zero. If QUOTED includes + Q_HERE_DOCUMENT or Q_DOUBLE_QUOTES, this returns a quoted list, otherwise + no quoting chars are added. */ +static char * +pos_params (string, start, end, quoted) + char *string; + int start, end, quoted; +{ + WORD_LIST *save, *params, *h, *t; + char *ret; + int i; + + /* see if we can short-circuit. if start == end, we want 0 parameters. */ + if (start == end) + return ((char *)NULL); + + save = params = list_rest_of_args (); + if (save == 0) + return ((char *)NULL); + + if (start == 0) /* handle ${@:0[:x]} specially */ + { + t = make_word_list (make_word (dollar_vars[0]), params); + save = params = t; + } + + for (i = start ? 1 : 0; params && i < start; i++) + params = params->next; + if (params == 0) + return ((char *)NULL); + for (h = t = params; params && i < end; i++) + { + t = params; + params = params->next; + } + + t->next = (WORD_LIST *)NULL; + + ret = string_list_pos_params (string[0], h, quoted); + + if (t != params) + t->next = params; + + dispose_words (save); + return (ret); +} + +/******************************************************************/ +/* */ +/* Functions to expand strings to strings or WORD_LISTs */ +/* */ +/******************************************************************/ + +#if defined (PROCESS_SUBSTITUTION) +#define EXP_CHAR(s) (s == '$' || s == '`' || s == '<' || s == '>' || s == CTLESC || s == '~') +#else +#define EXP_CHAR(s) (s == '$' || s == '`' || s == CTLESC || s == '~') +#endif + +/* If there are any characters in STRING that require full expansion, + then call FUNC to expand STRING; otherwise just perform quote + removal if necessary. This returns a new string. */ +static char * +expand_string_if_necessary (string, quoted, func) + char *string; + int quoted; + EXPFUNC *func; +{ + WORD_LIST *list; + size_t slen; + int i, saw_quote; + char *ret; + DECLARE_MBSTATE; + + /* Don't need string length for ADVANCE_CHAR unless multibyte chars possible. */ + slen = (MB_CUR_MAX > 1) ? strlen (string) : 0; + i = saw_quote = 0; + while (string[i]) + { + if (EXP_CHAR (string[i])) + break; + else if (string[i] == '\'' || string[i] == '\\' || string[i] == '"') + saw_quote = 1; + ADVANCE_CHAR (string, slen, i); + } + + if (string[i]) + { + list = (*func) (string, quoted); + if (list) + { + ret = string_list (list); + dispose_words (list); + } + else + ret = (char *)NULL; + } + else if (saw_quote && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + ret = string_quote_removal (string, quoted); + else + ret = savestring (string); + + return ret; +} + +static inline char * +expand_string_to_string_internal (string, quoted, func) + char *string; + int quoted; + EXPFUNC *func; +{ + WORD_LIST *list; + char *ret; + + if (string == 0 || *string == '\0') + return ((char *)NULL); + + list = (*func) (string, quoted); + if (list) + { + ret = string_list (list); + dispose_words (list); + } + else + ret = (char *)NULL; + + return (ret); +} + +char * +expand_string_to_string (string, quoted) + char *string; + int quoted; +{ + return (expand_string_to_string_internal (string, quoted, expand_string)); +} + +char * +expand_string_unsplit_to_string (string, quoted) + char *string; + int quoted; +{ + return (expand_string_to_string_internal (string, quoted, expand_string_unsplit)); +} + +char * +expand_assignment_string_to_string (string, quoted) + char *string; + int quoted; +{ + return (expand_string_to_string_internal (string, quoted, expand_string_assignment)); +} + +char * +expand_arith_string (string, quoted) + char *string; + int quoted; +{ + WORD_DESC td; + WORD_LIST *list, *tlist; + size_t slen; + int i, saw_quote; + char *ret; + DECLARE_MBSTATE; + + /* Don't need string length for ADVANCE_CHAR unless multibyte chars possible. */ + slen = (MB_CUR_MAX > 1) ? strlen (string) : 0; + i = saw_quote = 0; + while (string[i]) + { + if (EXP_CHAR (string[i])) + break; + else if (string[i] == '\'' || string[i] == '\\' || string[i] == '"') + saw_quote = 1; + ADVANCE_CHAR (string, slen, i); + } + + if (string[i]) + { + /* This is expanded version of expand_string_internal as it's called by + expand_string_leave_quoted */ + td.flags = W_NOPROCSUB; /* don't want process substitution */ + td.word = savestring (string); + list = call_expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + /* This takes care of the calls from expand_string_leave_quoted and + expand_string */ + if (list) + { + tlist = word_list_split (list); + dispose_words (list); + list = tlist; + if (list) + dequote_list (list); + } + /* This comes from expand_string_if_necessary */ + if (list) + { + ret = string_list (list); + dispose_words (list); + } + else + ret = (char *)NULL; + FREE (td.word); + } + else if (saw_quote && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + ret = string_quote_removal (string, quoted); + else + ret = savestring (string); + + return ret; +} + +#if defined (COND_COMMAND) +/* Just remove backslashes in STRING. Returns a new string. */ +char * +remove_backslashes (string) + char *string; +{ + char *r, *ret, *s; + + r = ret = (char *)xmalloc (strlen (string) + 1); + for (s = string; s && *s; ) + { + if (*s == '\\') + s++; + if (*s == 0) + break; + *r++ = *s++; + } + *r = '\0'; + return ret; +} + +/* This needs better error handling. */ +/* Expand W for use as an argument to a unary or binary operator in a + [[...]] expression. If SPECIAL is 1, this is the rhs argument + to the != or == operator, and should be treated as a pattern. In + this case, we quote the string specially for the globbing code. If + SPECIAL is 2, this is an rhs argument for the =~ operator, and should + be quoted appropriately for regcomp/regexec. The caller is responsible + for removing the backslashes if the unquoted word is needed later. */ +char * +cond_expand_word (w, special) + WORD_DESC *w; + int special; +{ + char *r, *p; + WORD_LIST *l; + int qflags; + + if (w->word == 0 || w->word[0] == '\0') + return ((char *)NULL); + + w->flags |= W_NOSPLIT2; + l = call_expand_word_internal (w, 0, 0, (int *)0, (int *)0); + if (l) + { + if (special == 0) /* LHS */ + { + dequote_list (l); + r = string_list (l); + } + else + { + /* Need to figure out whether or not we should call dequote_escapes + or a new dequote_ctlnul function here, and under what + circumstances. */ + qflags = QGLOB_CVTNULL; + if (special == 2) + qflags |= QGLOB_REGEXP; + p = string_list (l); + r = quote_string_for_globbing (p, qflags); + free (p); + } + dispose_words (l); + } + else + r = (char *)NULL; + + return r; +} +#endif + +/* Call expand_word_internal to expand W and handle error returns. + A convenience function for functions that don't want to handle + any errors or free any memory before aborting. */ +static WORD_LIST * +call_expand_word_internal (w, q, i, c, e) + WORD_DESC *w; + int q, i, *c, *e; +{ + WORD_LIST *result; + + result = expand_word_internal (w, q, i, c, e); + if (result == &expand_word_error || result == &expand_word_fatal) + { + /* By convention, each time this error is returned, w->word has + already been freed (it sometimes may not be in the fatal case, + but that doesn't result in a memory leak because we're going + to exit in most cases). */ + w->word = (char *)NULL; + last_command_exit_value = EXECUTION_FAILURE; + exp_jump_to_top_level ((result == &expand_word_error) ? DISCARD : FORCE_EOF); + /* NOTREACHED */ + return (NULL); + } + else + return (result); +} + +/* Perform parameter expansion, command substitution, and arithmetic + expansion on STRING, as if it were a word. Leave the result quoted. + Since this does not perform word splitting, it leaves quoted nulls + in the result. */ +static WORD_LIST * +expand_string_internal (string, quoted) + char *string; + int quoted; +{ + WORD_DESC td; + WORD_LIST *tresult; + + if (string == 0 || *string == 0) + return ((WORD_LIST *)NULL); + + td.flags = 0; + td.word = savestring (string); + + tresult = call_expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + + FREE (td.word); + return (tresult); +} + +/* Expand STRING by performing parameter expansion, command substitution, + and arithmetic expansion. Dequote the resulting WORD_LIST before + returning it, but do not perform word splitting. The call to + remove_quoted_nulls () is in here because word splitting normally + takes care of quote removal. */ +WORD_LIST * +expand_string_unsplit (string, quoted) + char *string; + int quoted; +{ + WORD_LIST *value; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + expand_no_split_dollar_star = 1; + value = expand_string_internal (string, quoted); + expand_no_split_dollar_star = 0; + + if (value) + { + if (value->word) + { + remove_quoted_nulls (value->word->word); + value->word->flags &= ~W_HASQUOTEDNULL; + } + dequote_list (value); + } + return (value); +} + +/* Expand the rhs of an assignment statement */ +WORD_LIST * +expand_string_assignment (string, quoted) + char *string; + int quoted; +{ + WORD_DESC td; + WORD_LIST *value; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + expand_no_split_dollar_star = 1; + + td.flags = W_ASSIGNRHS; + td.word = savestring (string); + value = call_expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + FREE (td.word); + + expand_no_split_dollar_star = 0; + + if (value) + { + if (value->word) + { + remove_quoted_nulls (value->word->word); + value->word->flags &= ~W_HASQUOTEDNULL; + } + dequote_list (value); + } + return (value); +} + + +/* Expand one of the PS? prompt strings. This is a sort of combination of + expand_string_unsplit and expand_string_internal, but returns the + passed string when an error occurs. Might want to trap other calls + to jump_to_top_level here so we don't endlessly loop. */ +WORD_LIST * +expand_prompt_string (string, quoted, wflags) + char *string; + int quoted; + int wflags; +{ + WORD_LIST *value; + WORD_DESC td; + + if (string == 0 || *string == 0) + return ((WORD_LIST *)NULL); + + td.flags = wflags; + td.word = savestring (string); + + no_longjmp_on_fatal_error = 1; + value = expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + no_longjmp_on_fatal_error = 0; + + if (value == &expand_word_error || value == &expand_word_fatal) + { + value = make_word_list (make_bare_word (string), (WORD_LIST *)NULL); + return value; + } + FREE (td.word); + if (value) + { + if (value->word) + { + remove_quoted_nulls (value->word->word); + value->word->flags &= ~W_HASQUOTEDNULL; + } + dequote_list (value); + } + return (value); +} + +/* Expand STRING just as if you were expanding a word, but do not dequote + the resultant WORD_LIST. This is called only from within this file, + and is used to correctly preserve quoted characters when expanding + things like ${1+"$@"}. This does parameter expansion, command + substitution, arithmetic expansion, and word splitting. */ +static WORD_LIST * +expand_string_leave_quoted (string, quoted) + char *string; + int quoted; +{ + WORD_LIST *tlist; + WORD_LIST *tresult; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + tlist = expand_string_internal (string, quoted); + + if (tlist) + { + tresult = word_list_split (tlist); + dispose_words (tlist); + return (tresult); + } + return ((WORD_LIST *)NULL); +} + +/* This does not perform word splitting or dequote the WORD_LIST + it returns. */ +static WORD_LIST * +expand_string_for_rhs (string, quoted, dollar_at_p, has_dollar_at) + char *string; + int quoted, *dollar_at_p, *has_dollar_at; +{ + WORD_DESC td; + WORD_LIST *tresult; + + if (string == 0 || *string == '\0') + return (WORD_LIST *)NULL; + + td.flags = W_NOSPLIT2; /* no splitting, remove "" and '' */ + td.word = string; + tresult = call_expand_word_internal (&td, quoted, 1, dollar_at_p, has_dollar_at); + return (tresult); +} + +/* Expand STRING just as if you were expanding a word. This also returns + a list of words. Note that filename globbing is *NOT* done for word + or string expansion, just when the shell is expanding a command. This + does parameter expansion, command substitution, arithmetic expansion, + and word splitting. Dequote the resultant WORD_LIST before returning. */ +WORD_LIST * +expand_string (string, quoted) + char *string; + int quoted; +{ + WORD_LIST *result; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + result = expand_string_leave_quoted (string, quoted); + return (result ? dequote_list (result) : result); +} + +/*************************************************** + * * + * Functions to handle quoting chars * + * * + ***************************************************/ + +/* Conventions: + + A string with s[0] == CTLNUL && s[1] == 0 is a quoted null string. + The parser passes CTLNUL as CTLESC CTLNUL. */ + +/* Quote escape characters in string s, but no other characters. This is + used to protect CTLESC and CTLNUL in variable values from the rest of + the word expansion process after the variable is expanded (word splitting + and filename generation). If IFS is null, we quote spaces as well, just + in case we split on spaces later (in the case of unquoted $@, we will + eventually attempt to split the entire word on spaces). Corresponding + code exists in dequote_escapes. Even if we don't end up splitting on + spaces, quoting spaces is not a problem. This should never be called on + a string that is quoted with single or double quotes or part of a here + document (effectively double-quoted). */ +char * +quote_escapes (string) + char *string; +{ + register char *s, *t; + size_t slen; + char *result, *send; + int quote_spaces, skip_ctlesc, skip_ctlnul; + DECLARE_MBSTATE; + + slen = strlen (string); + send = string + slen; + + quote_spaces = (ifs_value && *ifs_value == 0); + + for (skip_ctlesc = skip_ctlnul = 0, s = ifs_value; s && *s; s++) + skip_ctlesc |= *s == CTLESC, skip_ctlnul |= *s == CTLNUL; + + t = result = (char *)xmalloc ((slen * 2) + 1); + s = string; + + while (*s) + { + if ((skip_ctlesc == 0 && *s == CTLESC) || (skip_ctlnul == 0 && *s == CTLNUL) || (quote_spaces && *s == ' ')) + *t++ = CTLESC; + COPY_CHAR_P (t, s, send); + } + *t = '\0'; + + return (result); +} + +static WORD_LIST * +list_quote_escapes (list) + WORD_LIST *list; +{ + register WORD_LIST *w; + char *t; + + for (w = list; w; w = w->next) + { + t = w->word->word; + w->word->word = quote_escapes (t); + free (t); + } + return list; +} + +/* Inverse of quote_escapes; remove CTLESC protecting CTLESC or CTLNUL. + + The parser passes us CTLESC as CTLESC CTLESC and CTLNUL as CTLESC CTLNUL. + This is necessary to make unquoted CTLESC and CTLNUL characters in the + data stream pass through properly. + + We need to remove doubled CTLESC characters inside quoted strings before + quoting the entire string, so we do not double the number of CTLESC + characters. + + Also used by parts of the pattern substitution code. */ +char * +dequote_escapes (string) + char *string; +{ + register char *s, *t, *s1; + size_t slen; + char *result, *send; + int quote_spaces; + DECLARE_MBSTATE; + + if (string == 0) + return string; + + slen = strlen (string); + send = string + slen; + + t = result = (char *)xmalloc (slen + 1); + + if (strchr (string, CTLESC) == 0) + return (strcpy (result, string)); + + quote_spaces = (ifs_value && *ifs_value == 0); + + s = string; + while (*s) + { + if (*s == CTLESC && (s[1] == CTLESC || s[1] == CTLNUL || (quote_spaces && s[1] == ' '))) + { + s++; + if (*s == '\0') + break; + } + COPY_CHAR_P (t, s, send); + } + *t = '\0'; + + return result; +} + +static WORD_LIST * +list_dequote_escapes (list) + WORD_LIST *list; +{ + register WORD_LIST *w; + char *t; + + for (w = list; w; w = w->next) + { + t = w->word->word; + w->word->word = dequote_escapes (t); + free (t); + } + return list; +} + +/* Return a new string with the quoted representation of character C. + This turns "" into QUOTED_NULL, so the W_HASQUOTEDNULL flag needs to be + set in any resultant WORD_DESC where this value is the word. */ +static char * +make_quoted_char (c) + int c; +{ + char *temp; + + temp = (char *)xmalloc (3); + if (c == 0) + { + temp[0] = CTLNUL; + temp[1] = '\0'; + } + else + { + temp[0] = CTLESC; + temp[1] = c; + temp[2] = '\0'; + } + return (temp); +} + +/* Quote STRING, returning a new string. This turns "" into QUOTED_NULL, so + the W_HASQUOTEDNULL flag needs to be set in any resultant WORD_DESC where + this value is the word. */ +char * +quote_string (string) + char *string; +{ + register char *t; + size_t slen; + char *result, *send; + + if (*string == 0) + { + result = (char *)xmalloc (2); + result[0] = CTLNUL; + result[1] = '\0'; + } + else + { + DECLARE_MBSTATE; + + slen = strlen (string); + send = string + slen; + + result = (char *)xmalloc ((slen * 2) + 1); + + for (t = result; string < send; ) + { + *t++ = CTLESC; + COPY_CHAR_P (t, string, send); + } + *t = '\0'; + } + return (result); +} + +/* De-quote quoted characters in STRING. */ +char * +dequote_string (string) + char *string; +{ + register char *s, *t; + size_t slen; + char *result, *send; + DECLARE_MBSTATE; + + slen = strlen (string); + + t = result = (char *)xmalloc (slen + 1); + + if (QUOTED_NULL (string)) + { + result[0] = '\0'; + return (result); + } + + /* If no character in the string can be quoted, don't bother examining + each character. Just return a copy of the string passed to us. */ + if (strchr (string, CTLESC) == NULL) + return (strcpy (result, string)); + + send = string + slen; + s = string; + while (*s) + { + if (*s == CTLESC) + { + s++; + if (*s == '\0') + break; + } + COPY_CHAR_P (t, s, send); + } + + *t = '\0'; + return (result); +} + +/* Quote the entire WORD_LIST list. */ +static WORD_LIST * +quote_list (list) + WORD_LIST *list; +{ + register WORD_LIST *w; + char *t; + + for (w = list; w; w = w->next) + { + t = w->word->word; + w->word->word = quote_string (t); + if (*t == 0) + w->word->flags |= W_HASQUOTEDNULL; /* XXX - turn on W_HASQUOTEDNULL here? */ + w->word->flags |= W_QUOTED; + free (t); + } + return list; +} + +/* De-quote quoted characters in each word in LIST. */ +WORD_LIST * +dequote_list (list) + WORD_LIST *list; +{ + register char *s; + register WORD_LIST *tlist; + + for (tlist = list; tlist; tlist = tlist->next) + { + s = dequote_string (tlist->word->word); + if (QUOTED_NULL (tlist->word->word)) + tlist->word->flags &= ~W_HASQUOTEDNULL; + free (tlist->word->word); + tlist->word->word = s; + } + return list; +} + +/* Remove CTLESC protecting a CTLESC or CTLNUL in place. Return the passed + string. */ +char * +remove_quoted_escapes (string) + char *string; +{ + char *t; + + if (string) + { + t = dequote_escapes (string); + strcpy (string, t); + free (t); + } + + return (string); +} + +/* Perform quoted null character removal on STRING. We don't allow any + quoted null characters in the middle or at the ends of strings because + of how expand_word_internal works. remove_quoted_nulls () turns + STRING into an empty string iff it only consists of a quoted null, + and removes all unquoted CTLNUL characters. */ +char * +remove_quoted_nulls (string) + char *string; +{ + register size_t slen; + register int i, j, prev_i; + DECLARE_MBSTATE; + + if (strchr (string, CTLNUL) == 0) /* XXX */ + return string; /* XXX */ + + slen = strlen (string); + i = j = 0; + + while (i < slen) + { + if (string[i] == CTLESC) + { + /* Old code had j++, but we cannot assume that i == j at this + point -- what if a CTLNUL has already been removed from the + string? We don't want to drop the CTLESC or recopy characters + that we've already copied down. */ + i++; string[j++] = CTLESC; + if (i == slen) + break; + } + else if (string[i] == CTLNUL) + { + i++; + continue; + } + + prev_i = i; + ADVANCE_CHAR (string, slen, i); + if (j < prev_i) + { + do string[j++] = string[prev_i++]; while (prev_i < i); + } + else + j = i; + } + string[j] = '\0'; + + return (string); +} + +/* Perform quoted null character removal on each element of LIST. + This modifies LIST. */ +void +word_list_remove_quoted_nulls (list) + WORD_LIST *list; +{ + register WORD_LIST *t; + + for (t = list; t; t = t->next) + { + remove_quoted_nulls (t->word->word); + t->word->flags &= ~W_HASQUOTEDNULL; + } +} + +/* **************************************************************** */ +/* */ +/* Functions for Matching and Removing Patterns */ +/* */ +/* **************************************************************** */ + +#if defined (HANDLE_MULTIBYTE) +#if 0 /* Currently unused */ +static unsigned char * +mb_getcharlens (string, len) + char *string; + int len; +{ + int i, offset, last; + unsigned char *ret; + char *p; + DECLARE_MBSTATE; + + i = offset = 0; + last = 0; + ret = (unsigned char *)xmalloc (len); + memset (ret, 0, len); + while (string[last]) + { + ADVANCE_CHAR (string, len, offset); + ret[last] = offset - last; + last = offset; + } + return ret; +} +#endif +#endif + +/* Remove the portion of PARAM matched by PATTERN according to OP, where OP + can have one of 4 values: + RP_LONG_LEFT remove longest matching portion at start of PARAM + RP_SHORT_LEFT remove shortest matching portion at start of PARAM + RP_LONG_RIGHT remove longest matching portion at end of PARAM + RP_SHORT_RIGHT remove shortest matching portion at end of PARAM +*/ + +#define RP_LONG_LEFT 1 +#define RP_SHORT_LEFT 2 +#define RP_LONG_RIGHT 3 +#define RP_SHORT_RIGHT 4 + +/* Returns its first argument if nothing matched; new memory otherwise */ +static char * +remove_upattern (param, pattern, op) + char *param, *pattern; + int op; +{ + register int len; + register char *end; + register char *p, *ret, c; + + len = STRLEN (param); + end = param + len; + + switch (op) + { + case RP_LONG_LEFT: /* remove longest match at start */ + for (p = end; p >= param; p--) + { + c = *p; *p = '\0'; + if (strmatch (pattern, param, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + *p = c; + return (savestring (p)); + } + *p = c; + + } + break; + + case RP_SHORT_LEFT: /* remove shortest match at start */ + for (p = param; p <= end; p++) + { + c = *p; *p = '\0'; + if (strmatch (pattern, param, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + *p = c; + return (savestring (p)); + } + *p = c; + } + break; + + case RP_LONG_RIGHT: /* remove longest match at end */ + for (p = param; p <= end; p++) + { + if (strmatch (pattern, p, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + c = *p; *p = '\0'; + ret = savestring (param); + *p = c; + return (ret); + } + } + break; + + case RP_SHORT_RIGHT: /* remove shortest match at end */ + for (p = end; p >= param; p--) + { + if (strmatch (pattern, p, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + c = *p; *p = '\0'; + ret = savestring (param); + *p = c; + return (ret); + } + } + break; + } + + return (param); /* no match, return original string */ +} + +#if defined (HANDLE_MULTIBYTE) +/* Returns its first argument if nothing matched; new memory otherwise */ +static wchar_t * +remove_wpattern (wparam, wstrlen, wpattern, op) + wchar_t *wparam; + size_t wstrlen; + wchar_t *wpattern; + int op; +{ + wchar_t wc, *ret; + int n; + + switch (op) + { + case RP_LONG_LEFT: /* remove longest match at start */ + for (n = wstrlen; n >= 0; n--) + { + wc = wparam[n]; wparam[n] = L'\0'; + if (wcsmatch (wpattern, wparam, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wparam[n] = wc; + return (wcsdup (wparam + n)); + } + wparam[n] = wc; + } + break; + + case RP_SHORT_LEFT: /* remove shortest match at start */ + for (n = 0; n <= wstrlen; n++) + { + wc = wparam[n]; wparam[n] = L'\0'; + if (wcsmatch (wpattern, wparam, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wparam[n] = wc; + return (wcsdup (wparam + n)); + } + wparam[n] = wc; + } + break; + + case RP_LONG_RIGHT: /* remove longest match at end */ + for (n = 0; n <= wstrlen; n++) + { + if (wcsmatch (wpattern, wparam + n, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wc = wparam[n]; wparam[n] = L'\0'; + ret = wcsdup (wparam); + wparam[n] = wc; + return (ret); + } + } + break; + + case RP_SHORT_RIGHT: /* remove shortest match at end */ + for (n = wstrlen; n >= 0; n--) + { + if (wcsmatch (wpattern, wparam + n, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wc = wparam[n]; wparam[n] = L'\0'; + ret = wcsdup (wparam); + wparam[n] = wc; + return (ret); + } + } + break; + } + + return (wparam); /* no match, return original string */ +} +#endif /* HANDLE_MULTIBYTE */ + +static char * +remove_pattern (param, pattern, op) + char *param, *pattern; + int op; +{ + char *xret; + + if (param == NULL) + return (param); + if (*param == '\0' || pattern == NULL || *pattern == '\0') /* minor optimization */ + return (savestring (param)); + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1) + { + wchar_t *ret, *oret; + size_t n; + wchar_t *wparam, *wpattern; + mbstate_t ps; + + n = xdupmbstowcs (&wpattern, NULL, pattern); + if (n == (size_t)-1) + { + xret = remove_upattern (param, pattern, op); + return ((xret == param) ? savestring (param) : xret); + } + n = xdupmbstowcs (&wparam, NULL, param); + + if (n == (size_t)-1) + { + free (wpattern); + xret = remove_upattern (param, pattern, op); + return ((xret == param) ? savestring (param) : xret); + } + oret = ret = remove_wpattern (wparam, n, wpattern, op); + /* Don't bother to convert wparam back to multibyte string if nothing + matched; just return copy of original string */ + if (ret == wparam) + { + free (wparam); + free (wpattern); + return (savestring (param)); + } + + free (wparam); + free (wpattern); + + n = strlen (param); + xret = (char *)xmalloc (n + 1); + memset (&ps, '\0', sizeof (mbstate_t)); + n = wcsrtombs (xret, (const wchar_t **)&ret, n, &ps); + xret[n] = '\0'; /* just to make sure */ + free (oret); + return xret; + } + else +#endif + { + xret = remove_upattern (param, pattern, op); + return ((xret == param) ? savestring (param) : xret); + } +} + +/* Match PAT anywhere in STRING and return the match boundaries. + This returns 1 in case of a successful match, 0 otherwise. SP + and EP are pointers into the string where the match begins and + ends, respectively. MTYPE controls what kind of match is attempted. + MATCH_BEG and MATCH_END anchor the match at the beginning and end + of the string, respectively. The longest match is returned. */ +static int +match_upattern (string, pat, mtype, sp, ep) + char *string, *pat; + int mtype; + char **sp, **ep; +{ + int c, len, mlen; + register char *p, *p1, *npat; + char *end; + int n1; + + /* If the pattern doesn't match anywhere in the string, go ahead and + short-circuit right away. A minor optimization, saves a bunch of + unnecessary calls to strmatch (up to N calls for a string of N + characters) if the match is unsuccessful. To preserve the semantics + of the substring matches below, we make sure that the pattern has + `*' as first and last character, making a new pattern if necessary. */ + /* XXX - check this later if I ever implement `**' with special meaning, + since this will potentially result in `**' at the beginning or end */ + len = STRLEN (pat); + if (pat[0] != '*' || (pat[0] == '*' && pat[1] == LPAREN && extended_glob) || pat[len - 1] != '*') + { + p = npat = (char *)xmalloc (len + 3); + p1 = pat; + if (*p1 != '*' || (*p1 == '*' && p1[1] == LPAREN && extended_glob)) + *p++ = '*'; + while (*p1) + *p++ = *p1++; + if (p1[-1] != '*' || p[-2] == '\\') + *p++ = '*'; + *p = '\0'; + } + else + npat = pat; + c = strmatch (npat, string, FNMATCH_EXTFLAG); + if (npat != pat) + free (npat); + if (c == FNM_NOMATCH) + return (0); + + len = STRLEN (string); + end = string + len; + + mlen = umatchlen (pat, len); + + switch (mtype) + { + case MATCH_ANY: + for (p = string; p <= end; p++) + { + if (match_pattern_char (pat, p)) + { + p1 = (mlen == -1) ? end : p + mlen; + /* p1 - p = length of portion of string to be considered + p = current position in string + mlen = number of characters consumed by match (-1 for entire string) + end = end of string + we want to break immediately if the potential match len + is greater than the number of characters remaining in the + string + */ + if (p1 > end) + break; + for ( ; p1 >= p; p1--) + { + c = *p1; *p1 = '\0'; + if (strmatch (pat, p, FNMATCH_EXTFLAG) == 0) + { + *p1 = c; + *sp = p; + *ep = p1; + return 1; + } + *p1 = c; +#if 1 + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; +#endif + } + } + } + + return (0); + + case MATCH_BEG: + if (match_pattern_char (pat, string) == 0) + return (0); + + for (p = (mlen == -1) ? end : string + mlen; p >= string; p--) + { + c = *p; *p = '\0'; + if (strmatch (pat, string, FNMATCH_EXTFLAG) == 0) + { + *p = c; + *sp = string; + *ep = p; + return 1; + } + *p = c; + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + + return (0); + + case MATCH_END: + for (p = end - ((mlen == -1) ? len : mlen); p <= end; p++) + { + if (strmatch (pat, p, FNMATCH_EXTFLAG) == 0) + { + *sp = p; + *ep = end; + return 1; + } + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + + return (0); + } + + return (0); +} + +#if defined (HANDLE_MULTIBYTE) +/* Match WPAT anywhere in WSTRING and return the match boundaries. + This returns 1 in case of a successful match, 0 otherwise. Wide + character version. */ +static int +match_wpattern (wstring, indices, wstrlen, wpat, mtype, sp, ep) + wchar_t *wstring; + char **indices; + size_t wstrlen; + wchar_t *wpat; + int mtype; + char **sp, **ep; +{ + wchar_t wc, *wp, *nwpat, *wp1; + size_t len; + int mlen; + int n, n1, n2, simple; + + simple = (wpat[0] != L'\\' && wpat[0] != L'*' && wpat[0] != L'?' && wpat[0] != L'['); +#if defined (EXTENDED_GLOB) + if (extended_glob) + simple &= (wpat[1] != L'(' || (wpat[0] != L'*' && wpat[0] != L'?' && wpat[0] != L'+' && wpat[0] != L'!' && wpat[0] != L'@')); /*)*/ +#endif + + /* If the pattern doesn't match anywhere in the string, go ahead and + short-circuit right away. A minor optimization, saves a bunch of + unnecessary calls to strmatch (up to N calls for a string of N + characters) if the match is unsuccessful. To preserve the semantics + of the substring matches below, we make sure that the pattern has + `*' as first and last character, making a new pattern if necessary. */ + len = wcslen (wpat); + if (wpat[0] != L'*' || (wpat[0] == L'*' && wpat[1] == WLPAREN && extended_glob) || wpat[len - 1] != L'*') + { + wp = nwpat = (wchar_t *)xmalloc ((len + 3) * sizeof (wchar_t)); + wp1 = wpat; + if (*wp1 != L'*' || (*wp1 == '*' && wp1[1] == WLPAREN && extended_glob)) + *wp++ = L'*'; + while (*wp1 != L'\0') + *wp++ = *wp1++; + if (wp1[-1] != L'*' || wp1[-2] == L'\\') + *wp++ = L'*'; + *wp = '\0'; + } + else + nwpat = wpat; + len = wcsmatch (nwpat, wstring, FNMATCH_EXTFLAG); + if (nwpat != wpat) + free (nwpat); + if (len == FNM_NOMATCH) + return (0); + + mlen = wmatchlen (wpat, wstrlen); + +/* itrace("wmatchlen (%ls) -> %d", wpat, mlen); */ + switch (mtype) + { + case MATCH_ANY: + for (n = 0; n <= wstrlen; n++) + { + n2 = simple ? (*wpat == wstring[n]) : match_pattern_wchar (wpat, wstring + n); + if (n2) + { + n1 = (mlen == -1) ? wstrlen : n + mlen; + if (n1 > wstrlen) + break; + + for ( ; n1 >= n; n1--) + { + wc = wstring[n1]; wstring[n1] = L'\0'; + if (wcsmatch (wpat, wstring + n, FNMATCH_EXTFLAG) == 0) + { + wstring[n1] = wc; + *sp = indices[n]; + *ep = indices[n1]; + return 1; + } + wstring[n1] = wc; + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + } + } + + return (0); + + case MATCH_BEG: + if (match_pattern_wchar (wpat, wstring) == 0) + return (0); + + for (n = (mlen == -1) ? wstrlen : mlen; n >= 0; n--) + { + wc = wstring[n]; wstring[n] = L'\0'; + if (wcsmatch (wpat, wstring, FNMATCH_EXTFLAG) == 0) + { + wstring[n] = wc; + *sp = indices[0]; + *ep = indices[n]; + return 1; + } + wstring[n] = wc; + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + + return (0); + + case MATCH_END: + for (n = wstrlen - ((mlen == -1) ? wstrlen : mlen); n <= wstrlen; n++) + { + if (wcsmatch (wpat, wstring + n, FNMATCH_EXTFLAG) == 0) + { + *sp = indices[n]; + *ep = indices[wstrlen]; + return 1; + } + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + + return (0); + } + + return (0); +} +#endif /* HANDLE_MULTIBYTE */ + +static int +match_pattern (string, pat, mtype, sp, ep) + char *string, *pat; + int mtype; + char **sp, **ep; +{ +#if defined (HANDLE_MULTIBYTE) + int ret; + size_t n; + wchar_t *wstring, *wpat; + char **indices; + size_t slen, plen, mslen, mplen; +#endif + + if (string == 0 || *string == 0 || pat == 0 || *pat == 0) + return (0); + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1) + { + if (mbsmbchar (string) == 0 && mbsmbchar (pat) == 0) + return (match_upattern (string, pat, mtype, sp, ep)); + + n = xdupmbstowcs (&wpat, NULL, pat); + if (n == (size_t)-1) + return (match_upattern (string, pat, mtype, sp, ep)); + n = xdupmbstowcs (&wstring, &indices, string); + if (n == (size_t)-1) + { + free (wpat); + return (match_upattern (string, pat, mtype, sp, ep)); + } + ret = match_wpattern (wstring, indices, n, wpat, mtype, sp, ep); + + free (wpat); + free (wstring); + free (indices); + + return (ret); + } + else +#endif + return (match_upattern (string, pat, mtype, sp, ep)); +} + +static int +getpatspec (c, value) + int c; + char *value; +{ + if (c == '#') + return ((*value == '#') ? RP_LONG_LEFT : RP_SHORT_LEFT); + else /* c == '%' */ + return ((*value == '%') ? RP_LONG_RIGHT : RP_SHORT_RIGHT); +} + +/* Posix.2 says that the WORD should be run through tilde expansion, + parameter expansion, command substitution and arithmetic expansion. + This leaves the result quoted, so quote_string_for_globbing () has + to be called to fix it up for strmatch (). If QUOTED is non-zero, + it means that the entire expression was enclosed in double quotes. + This means that quoting characters in the pattern do not make any + special pattern characters quoted. For example, the `*' in the + following retains its special meaning: "${foo#'*'}". */ +static char * +getpattern (value, quoted, expandpat) + char *value; + int quoted, expandpat; +{ + char *pat, *tword; + WORD_LIST *l; +#if 0 + int i; +#endif + /* There is a problem here: how to handle single or double quotes in the + pattern string when the whole expression is between double quotes? + POSIX.2 says that enclosing double quotes do not cause the pattern to + be quoted, but does that leave us a problem with @ and array[@] and their + expansions inside a pattern? */ +#if 0 + if (expandpat && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && *tword) + { + i = 0; + pat = string_extract_double_quoted (tword, &i, 1); + free (tword); + tword = pat; + } +#endif + + /* expand_string_for_rhs () leaves WORD quoted and does not perform + word splitting. */ + l = *value ? expand_string_for_rhs (value, + (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) ? Q_PATQUOTE : quoted, + (int *)NULL, (int *)NULL) + : (WORD_LIST *)0; + pat = string_list (l); + dispose_words (l); + if (pat) + { + tword = quote_string_for_globbing (pat, QGLOB_CVTNULL); + free (pat); + pat = tword; + } + return (pat); +} + +#if 0 +/* Handle removing a pattern from a string as a result of ${name%[%]value} + or ${name#[#]value}. */ +static char * +variable_remove_pattern (value, pattern, patspec, quoted) + char *value, *pattern; + int patspec, quoted; +{ + char *tword; + + tword = remove_pattern (value, pattern, patspec); + + return (tword); +} +#endif + +static char * +list_remove_pattern (list, pattern, patspec, itype, quoted) + WORD_LIST *list; + char *pattern; + int patspec, itype, quoted; +{ + WORD_LIST *new, *l; + WORD_DESC *w; + char *tword; + + for (new = (WORD_LIST *)NULL, l = list; l; l = l->next) + { + tword = remove_pattern (l->word->word, pattern, patspec); + w = alloc_word_desc (); + w->word = tword ? tword : savestring (""); + new = make_word_list (w, new); + } + + l = REVERSE_LIST (new, WORD_LIST *); + tword = string_list_pos_params (itype, l, quoted); + dispose_words (l); + + return (tword); +} + +static char * +parameter_list_remove_pattern (itype, pattern, patspec, quoted) + int itype; + char *pattern; + int patspec, quoted; +{ + char *ret; + WORD_LIST *list; + + list = list_rest_of_args (); + if (list == 0) + return ((char *)NULL); + ret = list_remove_pattern (list, pattern, patspec, itype, quoted); + dispose_words (list); + return (ret); +} + +#if defined (ARRAY_VARS) +static char * +array_remove_pattern (var, pattern, patspec, varname, quoted) + SHELL_VAR *var; + char *pattern; + int patspec; + char *varname; /* so we can figure out how it's indexed */ + int quoted; +{ + ARRAY *a; + HASH_TABLE *h; + int itype; + char *ret; + WORD_LIST *list; + SHELL_VAR *v; + + /* compute itype from varname here */ + v = array_variable_part (varname, &ret, 0); + + /* XXX */ + if (v && invisible_p (var)) + return ((char *)NULL); + + itype = ret[0]; + + a = (v && array_p (v)) ? array_cell (v) : 0; + h = (v && assoc_p (v)) ? assoc_cell (v) : 0; + + list = a ? array_to_word_list (a) : (h ? assoc_to_word_list (h) : 0); + if (list == 0) + return ((char *)NULL); + ret = list_remove_pattern (list, pattern, patspec, itype, quoted); + dispose_words (list); + + return ret; +} +#endif /* ARRAY_VARS */ + +static char * +parameter_brace_remove_pattern (varname, value, ind, patstr, rtype, quoted, flags) + char *varname, *value; + int ind; + char *patstr; + int rtype, quoted, flags; +{ + int vtype, patspec, starsub; + char *temp1, *val, *pattern; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + this_command_name = varname; + + vtype = get_var_and_type (varname, value, ind, quoted, flags, &v, &val); + if (vtype == -1) + return ((char *)NULL); + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + patspec = getpatspec (rtype, patstr); + if (patspec == RP_LONG_LEFT || patspec == RP_LONG_RIGHT) + patstr++; + + /* Need to pass getpattern newly-allocated memory in case of expansion -- + the expansion code will free the passed string on an error. */ + temp1 = savestring (patstr); + pattern = getpattern (temp1, quoted, 1); + free (temp1); + + temp1 = (char *)NULL; /* shut up gcc */ + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + temp1 = remove_pattern (val, pattern, patspec); + if (vtype == VT_VARIABLE) + FREE (val); + if (temp1) + { + val = (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + ? quote_string (temp1) + : quote_escapes (temp1); + free (temp1); + temp1 = val; + } + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + temp1 = array_remove_pattern (v, pattern, patspec, varname, quoted); + if (temp1 && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + { + val = quote_escapes (temp1); + free (temp1); + temp1 = val; + } + break; +#endif + case VT_POSPARMS: + temp1 = parameter_list_remove_pattern (varname[0], pattern, patspec, quoted); + if (temp1 && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + { + val = quote_escapes (temp1); + free (temp1); + temp1 = val; + } + break; + } + + FREE (pattern); + return temp1; +} + +/******************************************* + * * + * Functions to expand WORD_DESCs * + * * + *******************************************/ + +/* Expand WORD, performing word splitting on the result. This does + parameter expansion, command substitution, arithmetic expansion, + word splitting, and quote removal. */ + +WORD_LIST * +expand_word (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_LIST *result, *tresult; + + tresult = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); + result = word_list_split (tresult); + dispose_words (tresult); + return (result ? dequote_list (result) : result); +} + +/* Expand WORD, but do not perform word splitting on the result. This + does parameter expansion, command substitution, arithmetic expansion, + and quote removal. */ +WORD_LIST * +expand_word_unsplit (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_LIST *result; + + expand_no_split_dollar_star = 1; +#if defined (HANDLE_MULTIBYTE) + if (ifs_firstc[0] == 0) +#else + if (ifs_firstc == 0) +#endif + word->flags |= W_NOSPLIT; + word->flags |= W_NOSPLIT2; + result = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); + expand_no_split_dollar_star = 0; + + return (result ? dequote_list (result) : result); +} + +/* Perform shell expansions on WORD, but do not perform word splitting or + quote removal on the result. Virtually identical to expand_word_unsplit; + could be combined if implementations don't diverge. */ +WORD_LIST * +expand_word_leave_quoted (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_LIST *result; + + expand_no_split_dollar_star = 1; +#if defined (HANDLE_MULTIBYTE) + if (ifs_firstc[0] == 0) +#else + if (ifs_firstc == 0) +#endif + word->flags |= W_NOSPLIT; + word->flags |= W_NOSPLIT2; + result = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); + expand_no_split_dollar_star = 0; + + return result; +} + +#if defined (PROCESS_SUBSTITUTION) + +/*****************************************************************/ +/* */ +/* Hacking Process Substitution */ +/* */ +/*****************************************************************/ + +#if !defined (HAVE_DEV_FD) +/* Named pipes must be removed explicitly with `unlink'. This keeps a list + of FIFOs the shell has open. unlink_fifo_list will walk the list and + unlink all of them. add_fifo_list adds the name of an open FIFO to the + list. NFIFO is a count of the number of FIFOs in the list. */ +#define FIFO_INCR 20 + +struct temp_fifo { + char *file; + pid_t proc; +}; + +static struct temp_fifo *fifo_list = (struct temp_fifo *)NULL; +static int nfifo; +static int fifo_list_size; + +char * +copy_fifo_list (sizep) + int *sizep; +{ + if (sizep) + *sizep = 0; + return (char *)NULL; +} + +static void +add_fifo_list (pathname) + char *pathname; +{ + if (nfifo >= fifo_list_size - 1) + { + fifo_list_size += FIFO_INCR; + fifo_list = (struct temp_fifo *)xrealloc (fifo_list, + fifo_list_size * sizeof (struct temp_fifo)); + } + + fifo_list[nfifo].file = savestring (pathname); + nfifo++; +} + +void +unlink_fifo (i) + int i; +{ + if ((fifo_list[i].proc == -1) || (kill(fifo_list[i].proc, 0) == -1)) + { + unlink (fifo_list[i].file); + free (fifo_list[i].file); + fifo_list[i].file = (char *)NULL; + fifo_list[i].proc = -1; + } +} + +void +unlink_fifo_list () +{ + int saved, i, j; + + if (nfifo == 0) + return; + + for (i = saved = 0; i < nfifo; i++) + { + if ((fifo_list[i].proc == -1) || (kill(fifo_list[i].proc, 0) == -1)) + { + unlink (fifo_list[i].file); + free (fifo_list[i].file); + fifo_list[i].file = (char *)NULL; + fifo_list[i].proc = -1; + } + else + saved++; + } + + /* If we didn't remove some of the FIFOs, compact the list. */ + if (saved) + { + for (i = j = 0; i < nfifo; i++) + if (fifo_list[i].file) + { + fifo_list[j].file = fifo_list[i].file; + fifo_list[j].proc = fifo_list[i].proc; + j++; + } + nfifo = j; + } + else + nfifo = 0; +} + +/* Take LIST, which is a bitmap denoting active FIFOs in fifo_list + from some point in the past, and close all open FIFOs in fifo_list + that are not marked as active in LIST. If LIST is NULL, close + everything in fifo_list. LSIZE is the number of elements in LIST, in + case it's larger than fifo_list_size (size of fifo_list). */ +void +close_new_fifos (list, lsize) + char *list; + int lsize; +{ + int i; + + if (list == 0) + { + unlink_fifo_list (); + return; + } + + for (i = 0; i < lsize; i++) + if (list[i] == 0 && i < fifo_list_size && fifo_list[i].proc != -1) + unlink_fifo (i); + + for (i = lsize; i < fifo_list_size; i++) + unlink_fifo (i); +} + +int +fifos_pending () +{ + return nfifo; +} + +int +num_fifos () +{ + return nfifo; +} + +static char * +make_named_pipe () +{ + char *tname; + + tname = sh_mktmpname ("sh-np", MT_USERANDOM|MT_USETMPDIR); + if (mkfifo (tname, 0600) < 0) + { + free (tname); + return ((char *)NULL); + } + + add_fifo_list (tname); + return (tname); +} + +#else /* HAVE_DEV_FD */ + +/* DEV_FD_LIST is a bitmap of file descriptors attached to pipes the shell + has open to children. NFDS is a count of the number of bits currently + set in DEV_FD_LIST. TOTFDS is a count of the highest possible number + of open files. */ +static char *dev_fd_list = (char *)NULL; +static int nfds; +static int totfds; /* The highest possible number of open files. */ + +char * +copy_fifo_list (sizep) + int *sizep; +{ + char *ret; + + if (nfds == 0 || totfds == 0) + { + if (sizep) + *sizep = 0; + return (char *)NULL; + } + + if (sizep) + *sizep = totfds; + ret = (char *)xmalloc (totfds); + return (memcpy (ret, dev_fd_list, totfds)); +} + +static void +add_fifo_list (fd) + int fd; +{ + if (dev_fd_list == 0 || fd >= totfds) + { + int ofds; + + ofds = totfds; + totfds = getdtablesize (); + if (totfds < 0 || totfds > 256) + totfds = 256; + if (fd >= totfds) + totfds = fd + 2; + + dev_fd_list = (char *)xrealloc (dev_fd_list, totfds); + memset (dev_fd_list + ofds, '\0', totfds - ofds); + } + + dev_fd_list[fd] = 1; + nfds++; +} + +int +fifos_pending () +{ + return 0; /* used for cleanup; not needed with /dev/fd */ +} + +int +num_fifos () +{ + return nfds; +} + +void +unlink_fifo (fd) + int fd; +{ + if (dev_fd_list[fd]) + { + close (fd); + dev_fd_list[fd] = 0; + nfds--; + } +} + +void +unlink_fifo_list () +{ + register int i; + + if (nfds == 0) + return; + + for (i = 0; nfds && i < totfds; i++) + unlink_fifo (i); + + nfds = 0; +} + +/* Take LIST, which is a snapshot copy of dev_fd_list from some point in + the past, and close all open fds in dev_fd_list that are not marked + as open in LIST. If LIST is NULL, close everything in dev_fd_list. + LSIZE is the number of elements in LIST, in case it's larger than + totfds (size of dev_fd_list). */ +void +close_new_fifos (list, lsize) + char *list; + int lsize; +{ + int i; + + if (list == 0) + { + unlink_fifo_list (); + return; + } + + for (i = 0; i < lsize; i++) + if (list[i] == 0 && i < totfds && dev_fd_list[i]) + unlink_fifo (i); + + for (i = lsize; i < totfds; i++) + unlink_fifo (i); +} + +#if defined (NOTDEF) +print_dev_fd_list () +{ + register int i; + + fprintf (stderr, "pid %ld: dev_fd_list:", (long)getpid ()); + fflush (stderr); + + for (i = 0; i < totfds; i++) + { + if (dev_fd_list[i]) + fprintf (stderr, " %d", i); + } + fprintf (stderr, "\n"); +} +#endif /* NOTDEF */ + +static char * +make_dev_fd_filename (fd) + int fd; +{ + char *ret, intbuf[INT_STRLEN_BOUND (int) + 1], *p; + + ret = (char *)xmalloc (sizeof (DEV_FD_PREFIX) + 8); + + strcpy (ret, DEV_FD_PREFIX); + p = inttostr (fd, intbuf, sizeof (intbuf)); + strcpy (ret + sizeof (DEV_FD_PREFIX) - 1, p); + + add_fifo_list (fd); + return (ret); +} + +#endif /* HAVE_DEV_FD */ + +/* Return a filename that will open a connection to the process defined by + executing STRING. HAVE_DEV_FD, if defined, means open a pipe and return + a filename in /dev/fd corresponding to a descriptor that is one of the + ends of the pipe. If not defined, we use named pipes on systems that have + them. Systems without /dev/fd and named pipes are out of luck. + + OPEN_FOR_READ_IN_CHILD, if 1, means open the named pipe for reading or + use the read end of the pipe and dup that file descriptor to fd 0 in + the child. If OPEN_FOR_READ_IN_CHILD is 0, we open the named pipe for + writing or use the write end of the pipe in the child, and dup that + file descriptor to fd 1 in the child. The parent does the opposite. */ + +static char * +process_substitute (string, open_for_read_in_child) + char *string; + int open_for_read_in_child; +{ + char *pathname; + int fd, result; + pid_t old_pid, pid; +#if defined (HAVE_DEV_FD) + int parent_pipe_fd, child_pipe_fd; + int fildes[2]; +#endif /* HAVE_DEV_FD */ +#if defined (JOB_CONTROL) + pid_t old_pipeline_pgrp; +#endif + + if (!string || !*string || wordexp_only) + return ((char *)NULL); + +#if !defined (HAVE_DEV_FD) + pathname = make_named_pipe (); +#else /* HAVE_DEV_FD */ + if (pipe (fildes) < 0) + { + sys_error (_("cannot make pipe for process substitution")); + return ((char *)NULL); + } + /* If OPEN_FOR_READ_IN_CHILD == 1, we want to use the write end of + the pipe in the parent, otherwise the read end. */ + parent_pipe_fd = fildes[open_for_read_in_child]; + child_pipe_fd = fildes[1 - open_for_read_in_child]; + /* Move the parent end of the pipe to some high file descriptor, to + avoid clashes with FDs used by the script. */ + parent_pipe_fd = move_to_high_fd (parent_pipe_fd, 1, 64); + + pathname = make_dev_fd_filename (parent_pipe_fd); +#endif /* HAVE_DEV_FD */ + + if (pathname == 0) + { + sys_error (_("cannot make pipe for process substitution")); + return ((char *)NULL); + } + + old_pid = last_made_pid; + +#if defined (JOB_CONTROL) + old_pipeline_pgrp = pipeline_pgrp; + pipeline_pgrp = shell_pgrp; + save_pipeline (1); +#endif /* JOB_CONTROL */ + + pid = make_child ((char *)NULL, 1); + if (pid == 0) + { + reset_terminating_signals (); /* XXX */ + free_pushed_string_input (); + /* Cancel traps, in trap.c. */ + restore_original_signals (); /* XXX - what about special builtins? bash-4.2 */ + setup_async_signals (); + subshell_environment |= SUBSHELL_COMSUB|SUBSHELL_PROCSUB; + } + +#if defined (JOB_CONTROL) + set_sigchld_handler (); + stop_making_children (); + /* XXX - should we only do this in the parent? (as in command subst) */ + pipeline_pgrp = old_pipeline_pgrp; +#endif /* JOB_CONTROL */ + + if (pid < 0) + { + sys_error (_("cannot make child for process substitution")); + free (pathname); +#if defined (HAVE_DEV_FD) + close (parent_pipe_fd); + close (child_pipe_fd); +#endif /* HAVE_DEV_FD */ + return ((char *)NULL); + } + + if (pid > 0) + { +#if defined (JOB_CONTROL) + restore_pipeline (1); +#endif + +#if !defined (HAVE_DEV_FD) + fifo_list[nfifo-1].proc = pid; +#endif + + last_made_pid = old_pid; + +#if defined (JOB_CONTROL) && defined (PGRP_PIPE) + close_pgrp_pipe (); +#endif /* JOB_CONTROL && PGRP_PIPE */ + +#if defined (HAVE_DEV_FD) + close (child_pipe_fd); +#endif /* HAVE_DEV_FD */ + + return (pathname); + } + + set_sigint_handler (); + +#if defined (JOB_CONTROL) + set_job_control (0); +#endif /* JOB_CONTROL */ + +#if !defined (HAVE_DEV_FD) + /* Open the named pipe in the child. */ + fd = open (pathname, open_for_read_in_child ? O_RDONLY : O_WRONLY); + if (fd < 0) + { + /* Two separate strings for ease of translation. */ + if (open_for_read_in_child) + sys_error (_("cannot open named pipe %s for reading"), pathname); + else + sys_error (_("cannot open named pipe %s for writing"), pathname); + + exit (127); + } + if (open_for_read_in_child) + { + if (sh_unset_nodelay_mode (fd) < 0) + { + sys_error (_("cannot reset nodelay mode for fd %d"), fd); + exit (127); + } + } +#else /* HAVE_DEV_FD */ + fd = child_pipe_fd; +#endif /* HAVE_DEV_FD */ + + if (dup2 (fd, open_for_read_in_child ? 0 : 1) < 0) + { + sys_error (_("cannot duplicate named pipe %s as fd %d"), pathname, + open_for_read_in_child ? 0 : 1); + exit (127); + } + + if (fd != (open_for_read_in_child ? 0 : 1)) + close (fd); + + /* Need to close any files that this process has open to pipes inherited + from its parent. */ + if (current_fds_to_close) + { + close_fd_bitmap (current_fds_to_close); + current_fds_to_close = (struct fd_bitmap *)NULL; + } + +#if defined (HAVE_DEV_FD) + /* Make sure we close the parent's end of the pipe and clear the slot + in the fd list so it is not closed later, if reallocated by, for + instance, pipe(2). */ + close (parent_pipe_fd); + dev_fd_list[parent_pipe_fd] = 0; +#endif /* HAVE_DEV_FD */ + + /* subshells shouldn't have this flag, which controls using the temporary + environment for variable lookups. */ + expanding_redir = 0; + + result = parse_and_execute (string, "process substitution", (SEVAL_NONINT|SEVAL_NOHIST)); + +#if !defined (HAVE_DEV_FD) + /* Make sure we close the named pipe in the child before we exit. */ + close (open_for_read_in_child ? 0 : 1); +#endif /* !HAVE_DEV_FD */ + + last_command_exit_value = result; + result = run_exit_trap (); + exit (result); + /*NOTREACHED*/ +} +#endif /* PROCESS_SUBSTITUTION */ + +/***********************************/ +/* */ +/* Command Substitution */ +/* */ +/***********************************/ + +static char * +read_comsub (fd, quoted, rflag) + int fd, quoted; + int *rflag; +{ + char *istring, buf[128], *bufp, *s; + int istring_index, istring_size, c, tflag, skip_ctlesc, skip_ctlnul; + ssize_t bufn; + + istring = (char *)NULL; + istring_index = istring_size = bufn = tflag = 0; + + for (skip_ctlesc = skip_ctlnul = 0, s = ifs_value; s && *s; s++) + skip_ctlesc |= *s == CTLESC, skip_ctlnul |= *s == CTLNUL; + + /* Read the output of the command through the pipe. This may need to be + changed to understand multibyte characters in the future. */ + while (1) + { + if (fd < 0) + break; + if (--bufn <= 0) + { + bufn = zread (fd, buf, sizeof (buf)); + if (bufn <= 0) + break; + bufp = buf; + } + c = *bufp++; + + if (c == 0) + { +#if 0 + internal_warning ("read_comsub: ignored null byte in input"); +#endif + continue; + } + + /* Add the character to ISTRING, possibly after resizing it. */ + RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, DEFAULT_ARRAY_SIZE); + + /* This is essentially quote_string inline */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) /* || c == CTLESC || c == CTLNUL */) + istring[istring_index++] = CTLESC; + /* Escape CTLESC and CTLNUL in the output to protect those characters + from the rest of the word expansions (word splitting and globbing.) + This is essentially quote_escapes inline. */ + else if (skip_ctlesc == 0 && c == CTLESC) + { + tflag |= W_HASCTLESC; + istring[istring_index++] = CTLESC; + } + else if ((skip_ctlnul == 0 && c == CTLNUL) || (c == ' ' && (ifs_value && *ifs_value == 0))) + istring[istring_index++] = CTLESC; + + istring[istring_index++] = c; + +#if 0 +#if defined (__CYGWIN__) + if (c == '\n' && istring_index > 1 && istring[istring_index - 2] == '\r') + { + istring_index--; + istring[istring_index - 1] = '\n'; + } +#endif +#endif + } + + if (istring) + istring[istring_index] = '\0'; + + /* If we read no output, just return now and save ourselves some + trouble. */ + if (istring_index == 0) + { + FREE (istring); + if (rflag) + *rflag = tflag; + return (char *)NULL; + } + + /* Strip trailing newlines from the output of the command. */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + { + while (istring_index > 0) + { + if (istring[istring_index - 1] == '\n') + { + --istring_index; + + /* If the newline was quoted, remove the quoting char. */ + if (istring[istring_index - 1] == CTLESC) + --istring_index; + } + else + break; + } + istring[istring_index] = '\0'; + } + else + strip_trailing (istring, istring_index - 1, 1); + + if (rflag) + *rflag = tflag; + return istring; +} + +/* Perform command substitution on STRING. This returns a WORD_DESC * with the + contained string possibly quoted. */ +WORD_DESC * +command_substitute (string, quoted) + char *string; + int quoted; +{ + pid_t pid, old_pid, old_pipeline_pgrp, old_async_pid; + char *istring; + int result, fildes[2], function_value, pflags, rc, tflag; + WORD_DESC *ret; + + istring = (char *)NULL; + + /* Don't fork () if there is no need to. In the case of no command to + run, just return NULL. */ + if (!string || !*string || (string[0] == '\n' && !string[1])) + return ((WORD_DESC *)NULL); + + if (wordexp_only && read_but_dont_execute) + { + last_command_exit_value = EX_WEXPCOMSUB; + jump_to_top_level (EXITPROG); + } + + /* We're making the assumption here that the command substitution will + eventually run a command from the file system. Since we'll run + maybe_make_export_env in this subshell before executing that command, + the parent shell and any other shells it starts will have to remake + the environment. If we make it before we fork, other shells won't + have to. Don't bother if we have any temporary variable assignments, + though, because the export environment will be remade after this + command completes anyway, but do it if all the words to be expanded + are variable assignments. */ + if (subst_assign_varlist == 0 || garglist == 0) + maybe_make_export_env (); /* XXX */ + + /* Flags to pass to parse_and_execute() */ + pflags = (interactive && sourcelevel == 0) ? SEVAL_RESETLINE : 0; + + /* Pipe the output of executing STRING into the current shell. */ + if (pipe (fildes) < 0) + { + sys_error (_("cannot make pipe for command substitution")); + goto error_exit; + } + + old_pid = last_made_pid; +#if defined (JOB_CONTROL) + old_pipeline_pgrp = pipeline_pgrp; + /* Don't reset the pipeline pgrp if we're already a subshell in a pipeline. */ + if ((subshell_environment & SUBSHELL_PIPE) == 0) + pipeline_pgrp = shell_pgrp; + cleanup_the_pipeline (); +#endif /* JOB_CONTROL */ + + old_async_pid = last_asynchronous_pid; + pid = make_child ((char *)NULL, subshell_environment&SUBSHELL_ASYNC); + last_asynchronous_pid = old_async_pid; + + if (pid == 0) + { + /* Reset the signal handlers in the child, but don't free the + trap strings. Set a flag noting that we have to free the + trap strings if we run trap to change a signal disposition. */ + reset_signal_handlers (); + subshell_environment |= SUBSHELL_RESETTRAP; + } + +#if defined (JOB_CONTROL) + /* XXX DO THIS ONLY IN PARENT ? XXX */ + set_sigchld_handler (); + stop_making_children (); + if (pid != 0) + pipeline_pgrp = old_pipeline_pgrp; +#else + stop_making_children (); +#endif /* JOB_CONTROL */ + + if (pid < 0) + { + sys_error (_("cannot make child for command substitution")); + error_exit: + + last_made_pid = old_pid; + + FREE (istring); + close (fildes[0]); + close (fildes[1]); + return ((WORD_DESC *)NULL); + } + + if (pid == 0) + { + set_sigint_handler (); /* XXX */ + + free_pushed_string_input (); + + if (dup2 (fildes[1], 1) < 0) + { + sys_error (_("command_substitute: cannot duplicate pipe as fd 1")); + exit (EXECUTION_FAILURE); + } + + /* If standard output is closed in the parent shell + (such as after `exec >&-'), file descriptor 1 will be + the lowest available file descriptor, and end up in + fildes[0]. This can happen for stdin and stderr as well, + but stdout is more important -- it will cause no output + to be generated from this command. */ + if ((fildes[1] != fileno (stdin)) && + (fildes[1] != fileno (stdout)) && + (fildes[1] != fileno (stderr))) + close (fildes[1]); + + if ((fildes[0] != fileno (stdin)) && + (fildes[0] != fileno (stdout)) && + (fildes[0] != fileno (stderr))) + close (fildes[0]); + +#ifdef __CYGWIN__ + /* Let stdio know the fd may have changed from text to binary mode, and + make sure to preserve stdout line buffering. */ + freopen (NULL, "w", stdout); + sh_setlinebuf (stdout); +#endif /* __CYGWIN__ */ + + /* The currently executing shell is not interactive. */ + interactive = 0; + + /* This is a subshell environment. */ + subshell_environment |= SUBSHELL_COMSUB; + + /* When not in POSIX mode, command substitution does not inherit + the -e flag. */ + if (posixly_correct == 0) + { + builtin_ignoring_errexit = 0; + change_flag ('e', FLAG_OFF); + set_shellopts (); + } + + remove_quoted_escapes (string); + + startup_state = 2; /* see if we can avoid a fork */ + /* Give command substitution a place to jump back to on failure, + so we don't go back up to main (). */ + result = setjmp_nosigs (top_level); + + /* If we're running a command substitution inside a shell function, + trap `return' so we don't return from the function in the subshell + and go off to never-never land. */ + if (result == 0 && return_catch_flag) + function_value = setjmp_nosigs (return_catch); + else + function_value = 0; + + if (result == ERREXIT) + rc = last_command_exit_value; + else if (result == EXITPROG) + rc = last_command_exit_value; + else if (result) + rc = EXECUTION_FAILURE; + else if (function_value) + rc = return_catch_value; + else + { + subshell_level++; + rc = parse_and_execute (string, "command substitution", pflags|SEVAL_NOHIST); + subshell_level--; + } + + last_command_exit_value = rc; + rc = run_exit_trap (); +#if defined (PROCESS_SUBSTITUTION) + unlink_fifo_list (); +#endif + exit (rc); + } + else + { +#if defined (JOB_CONTROL) && defined (PGRP_PIPE) + close_pgrp_pipe (); +#endif /* JOB_CONTROL && PGRP_PIPE */ + + close (fildes[1]); + + tflag = 0; + istring = read_comsub (fildes[0], quoted, &tflag); + + close (fildes[0]); + + current_command_subst_pid = pid; + last_command_exit_value = wait_for (pid); + last_command_subst_pid = pid; + last_made_pid = old_pid; + +#if defined (JOB_CONTROL) + /* If last_command_exit_value > 128, then the substituted command + was terminated by a signal. If that signal was SIGINT, then send + SIGINT to ourselves. This will break out of loops, for instance. */ + if (last_command_exit_value == (128 + SIGINT) && last_command_exit_signal == SIGINT) + kill (getpid (), SIGINT); + + /* wait_for gives the terminal back to shell_pgrp. If some other + process group should have it, give it away to that group here. + pipeline_pgrp is non-zero only while we are constructing a + pipeline, so what we are concerned about is whether or not that + pipeline was started in the background. A pipeline started in + the background should never get the tty back here. */ + if (interactive && pipeline_pgrp != (pid_t)0 && (subshell_environment & SUBSHELL_ASYNC) == 0) + give_terminal_to (pipeline_pgrp, 0); +#endif /* JOB_CONTROL */ + + ret = alloc_word_desc (); + ret->word = istring; + ret->flags = tflag; + + return ret; + } +} + +/******************************************************** + * * + * Utility functions for parameter expansion * + * * + ********************************************************/ + +#if defined (ARRAY_VARS) + +static arrayind_t +array_length_reference (s) + char *s; +{ + int len; + arrayind_t ind; + char *akey; + char *t, c; + ARRAY *array; + HASH_TABLE *h; + SHELL_VAR *var; + + var = array_variable_part (s, &t, &len); + + /* If unbound variables should generate an error, report one and return + failure. */ + if ((var == 0 || invisible_p (var) || (assoc_p (var) == 0 && array_p (var) == 0)) && unbound_vars_is_error) + { + c = *--t; + *t = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (s); + *t = c; + return (-1); + } + else if (var == 0 || invisible_p (var)) + return 0; + + /* We support a couple of expansions for variables that are not arrays. + We'll return the length of the value for v[0], and 1 for v[@] or + v[*]. Return 0 for everything else. */ + + array = array_p (var) ? array_cell (var) : (ARRAY *)NULL; + h = assoc_p (var) ? assoc_cell (var) : (HASH_TABLE *)NULL; + + if (ALL_ELEMENT_SUB (t[0]) && t[1] == ']') + { + if (assoc_p (var)) + return (h ? assoc_num_elements (h) : 0); + else if (array_p (var)) + return (array ? array_num_elements (array) : 0); + else + return (var_isset (var) ? 1 : 0); + } + + if (assoc_p (var)) + { + t[len - 1] = '\0'; + akey = expand_assignment_string_to_string (t, 0); /* [ */ + t[len - 1] = ']'; + if (akey == 0 || *akey == 0) + { + err_badarraysub (t); + FREE (akey); + return (-1); + } + t = assoc_reference (assoc_cell (var), akey); + free (akey); + } + else + { + ind = array_expand_index (var, t, len); + /* negative subscripts to indexed arrays count back from end */ + if (var && array_p (var) && ind < 0) + ind = array_max_index (array_cell (var)) + 1 + ind; + if (ind < 0) + { + err_badarraysub (t); + return (-1); + } + if (array_p (var)) + t = array_reference (array, ind); + else + t = (ind == 0) ? value_cell (var) : (char *)NULL; + } + + len = MB_STRLEN (t); + return (len); +} +#endif /* ARRAY_VARS */ + +static int +valid_brace_expansion_word (name, var_is_special) + char *name; + int var_is_special; +{ + if (DIGIT (*name) && all_digits (name)) + return 1; + else if (var_is_special) + return 1; +#if defined (ARRAY_VARS) + else if (valid_array_reference (name)) + return 1; +#endif /* ARRAY_VARS */ + else if (legal_identifier (name)) + return 1; + else + return 0; +} + +static int +chk_atstar (name, quoted, quoted_dollar_atp, contains_dollar_at) + char *name; + int quoted; + int *quoted_dollar_atp, *contains_dollar_at; +{ + char *temp1; + + if (name == 0) + { + if (quoted_dollar_atp) + *quoted_dollar_atp = 0; + if (contains_dollar_at) + *contains_dollar_at = 0; + return 0; + } + + /* check for $@ and $* */ + if (name[0] == '@' && name[1] == 0) + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } + else if (name[0] == '*' && name[1] == '\0' && quoted == 0) + { + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } + + /* Now check for ${array[@]} and ${array[*]} */ +#if defined (ARRAY_VARS) + else if (valid_array_reference (name)) + { + temp1 = mbschr (name, '['); + if (temp1 && temp1[1] == '@' && temp1[2] == ']') + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } /* [ */ + /* ${array[*]}, when unquoted, should be treated like ${array[@]}, + which should result in separate words even when IFS is unset. */ + if (temp1 && temp1[1] == '*' && temp1[2] == ']' && quoted == 0) + { + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } + } +#endif + return 0; +} + +/* Parameter expand NAME, and return a new string which is the expansion, + or NULL if there was no expansion. + VAR_IS_SPECIAL is non-zero if NAME is one of the special variables in + the shell, e.g., "@", "$", "*", etc. QUOTED, if non-zero, means that + NAME was found inside of a double-quoted expression. */ +static WORD_DESC * +parameter_brace_expand_word (name, var_is_special, quoted, pflags, indp) + char *name; + int var_is_special, quoted, pflags; + arrayind_t *indp; +{ + WORD_DESC *ret; + char *temp, *tt; + intmax_t arg_index; + SHELL_VAR *var; + int atype, rflags; + arrayind_t ind; + + ret = 0; + temp = 0; + rflags = 0; + + if (indp) + *indp = INTMAX_MIN; + + /* Handle multiple digit arguments, as in ${11}. */ + if (legal_number (name, &arg_index)) + { + tt = get_dollar_var_value (arg_index); + if (tt) + temp = (*tt && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + ? quote_string (tt) + : quote_escapes (tt); + else + temp = (char *)NULL; + FREE (tt); + } + else if (var_is_special) /* ${@} */ + { + int sindex; + tt = (char *)xmalloc (2 + strlen (name)); + tt[sindex = 0] = '$'; + strcpy (tt + 1, name); + + ret = param_expand (tt, &sindex, quoted, (int *)NULL, (int *)NULL, + (int *)NULL, (int *)NULL, pflags); + free (tt); + } +#if defined (ARRAY_VARS) + else if (valid_array_reference (name)) + { +expand_arrayref: + /* XXX - does this leak if name[@] or name[*]? */ + if (pflags & PF_ASSIGNRHS) + { + temp = array_variable_name (name, &tt, (int *)0); + if (ALL_ELEMENT_SUB (tt[0]) && tt[1] == ']') + temp = array_value (name, quoted|Q_DOUBLE_QUOTES, 0, &atype, &ind); + else + temp = array_value (name, quoted, 0, &atype, &ind); + } + else + temp = array_value (name, quoted, 0, &atype, &ind); + if (atype == 0 && temp) + { + temp = (*temp && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + ? quote_string (temp) + : quote_escapes (temp); + rflags |= W_ARRAYIND; + if (indp) + *indp = ind; + } + else if (atype == 1 && temp && QUOTED_NULL (temp) && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + rflags |= W_HASQUOTEDNULL; + } +#endif + else if (var = find_variable (name)) + { + if (var_isset (var) && invisible_p (var) == 0) + { +#if defined (ARRAY_VARS) + if (assoc_p (var)) + temp = assoc_reference (assoc_cell (var), "0"); + else if (array_p (var)) + temp = array_reference (array_cell (var), 0); + else + temp = value_cell (var); +#else + temp = value_cell (var); +#endif + + if (temp) + temp = (*temp && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + ? quote_string (temp) + : quote_escapes (temp); + } + else + temp = (char *)NULL; + } + else if (var = find_variable_last_nameref (name)) + { + temp = nameref_cell (var); +#if defined (ARRAY_VARS) + /* Handle expanding nameref whose value is x[n] */ + if (temp && *temp && valid_array_reference (temp)) + { + name = temp; + goto expand_arrayref; + } + else +#endif + /* y=2 ; typeset -n x=y; echo ${x} is not the same as echo ${2} in ksh */ + if (temp && *temp && legal_identifier (temp) == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("%s: invalid variable name for name reference"), temp); + temp = &expand_param_error; + } + else + temp = (char *)NULL; + } + else + temp = (char *)NULL; + + if (ret == 0) + { + ret = alloc_word_desc (); + ret->word = temp; + ret->flags |= rflags; + } + return ret; +} + +static char * +parameter_brace_find_indir (name, var_is_special, quoted, find_nameref) + char *name; + int var_is_special, quoted, find_nameref; +{ + char *temp, *t; + WORD_DESC *w; + SHELL_VAR *v; + + if (find_nameref && var_is_special == 0 && (v = find_variable_last_nameref (name)) && + nameref_p (v) && (t = nameref_cell (v)) && *t) + return (savestring (t)); + + /* If var_is_special == 0, and name is not an array reference, this does + more expansion than necessary. It should really look up the variable's + value and not try to expand it. */ + w = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND, 0); + t = w->word; + /* Have to dequote here if necessary */ + if (t) + { + temp = (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + ? dequote_string (t) + : dequote_escapes (t); + free (t); + t = temp; + } + dispose_word_desc (w); + + return t; +} + +/* Expand an indirect reference to a variable: ${!NAME} expands to the + value of the variable whose name is the value of NAME. */ +static WORD_DESC * +parameter_brace_expand_indir (name, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at) + char *name; + int var_is_special, quoted; + int *quoted_dollar_atp, *contains_dollar_at; +{ + char *temp, *t; + WORD_DESC *w; + SHELL_VAR *v; + + /* See if it's a nameref first, behave in ksh93-compatible fashion. + There is at least one incompatibility: given ${!foo[0]} where foo=bar, + bash performs an indirect lookup on foo[0] and expands the result; + ksh93 expands bar[0]. We could do that here -- there are enough usable + primitives to do that -- but do not at this point. */ + if (var_is_special == 0 && (v = find_variable_last_nameref (name))) + { + if (nameref_p (v) && (t = nameref_cell (v)) && *t) + { + w = alloc_word_desc (); + w->word = savestring (t); + w->flags = 0; + return w; + } + } + + t = parameter_brace_find_indir (name, var_is_special, quoted, 0); + + chk_atstar (t, quoted, quoted_dollar_atp, contains_dollar_at); + if (t == 0) + return (WORD_DESC *)NULL; + + w = parameter_brace_expand_word (t, SPECIAL_VAR(t, 0), quoted, 0, 0); + free (t); + + return w; +} + +/* Expand the right side of a parameter expansion of the form ${NAMEcVALUE}, + depending on the value of C, the separating character. C can be one of + "-", "+", or "=". QUOTED is true if the entire brace expression occurs + between double quotes. */ +static WORD_DESC * +parameter_brace_expand_rhs (name, value, c, quoted, qdollaratp, hasdollarat) + char *name, *value; + int c, quoted, *qdollaratp, *hasdollarat; +{ + WORD_DESC *w; + WORD_LIST *l; + char *t, *t1, *temp; + int hasdol; + + /* If the entire expression is between double quotes, we want to treat + the value as a double-quoted string, with the exception that we strip + embedded unescaped double quotes (for sh backwards compatibility). */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && *value) + { + hasdol = 0; + temp = string_extract_double_quoted (value, &hasdol, 1); + } + else + temp = value; + + w = alloc_word_desc (); + hasdol = 0; + /* XXX was 0 not quoted */ + l = *temp ? expand_string_for_rhs (temp, quoted, &hasdol, (int *)NULL) + : (WORD_LIST *)0; + if (hasdollarat) + *hasdollarat = hasdol || (l && l->next); + if (temp != value) + free (temp); + if (l) + { + /* The expansion of TEMP returned something. We need to treat things + slightly differently if HASDOL is non-zero. If we have "$@", the + individual words have already been quoted. We need to turn them + into a string with the words separated by the first character of + $IFS without any additional quoting, so string_list_dollar_at won't + do the right thing. We use string_list_dollar_star instead. */ + temp = (hasdol || l->next) ? string_list_dollar_star (l) : string_list (l); + + /* If l->next is not null, we know that TEMP contained "$@", since that + is the only expansion that creates more than one word. */ + if (qdollaratp && ((hasdol && quoted) || l->next)) + *qdollaratp = 1; + /* If we have a quoted null result (QUOTED_NULL(temp)) and the word is + a quoted null (l->next == 0 && QUOTED_NULL(l->word->word)), the + flags indicate it (l->word->flags & W_HASQUOTEDNULL), and the + expansion is quoted (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + (which is more paranoia than anything else), we need to return the + quoted null string and set the flags to indicate it. */ + if (l->next == 0 && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && QUOTED_NULL (temp) && QUOTED_NULL (l->word->word) && (l->word->flags & W_HASQUOTEDNULL)) + { + w->flags |= W_HASQUOTEDNULL; + } + dispose_words (l); + } + else if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && hasdol) + { + /* The brace expansion occurred between double quotes and there was + a $@ in TEMP. It does not matter if the $@ is quoted, as long as + it does not expand to anything. In this case, we want to return + a quoted empty string. */ + temp = make_quoted_char ('\0'); + w->flags |= W_HASQUOTEDNULL; + } + else + temp = (char *)NULL; + + if (c == '-' || c == '+') + { + w->word = temp; + return w; + } + + /* c == '=' */ + t = temp ? savestring (temp) : savestring (""); + t1 = dequote_string (t); + free (t); +#if defined (ARRAY_VARS) + if (valid_array_reference (name)) + assign_array_element (name, t1, 0); + else +#endif /* ARRAY_VARS */ + bind_variable (name, t1, 0); +#if 0 + if (STREQ (name, "IFS") == 0) +#endif + stupidly_hack_special_variables (name); + + /* From Posix group discussion Feb-March 2010. Issue 7 0000221 */ + free (temp); + + w->word = t1; + return w; +} + +/* Deal with the right hand side of a ${name:?value} expansion in the case + that NAME is null or not set. If VALUE is non-null it is expanded and + used as the error message to print, otherwise a standard message is + printed. */ +static void +parameter_brace_expand_error (name, value) + char *name, *value; +{ + WORD_LIST *l; + char *temp; + + last_command_exit_value = EXECUTION_FAILURE; /* ensure it's non-zero */ + if (value && *value) + { + l = expand_string (value, 0); + temp = string_list (l); + report_error ("%s: %s", name, temp ? temp : ""); /* XXX was value not "" */ + FREE (temp); + dispose_words (l); + } + else + report_error (_("%s: parameter null or not set"), name); + + /* Free the data we have allocated during this expansion, since we + are about to longjmp out. */ + free (name); + FREE (value); +} + +/* Return 1 if NAME is something for which parameter_brace_expand_length is + OK to do. */ +static int +valid_length_expression (name) + char *name; +{ + return (name[1] == '\0' || /* ${#} */ + ((sh_syntaxtab[(unsigned char) name[1]] & CSPECVAR) && name[2] == '\0') || /* special param */ + (DIGIT (name[1]) && all_digits (name + 1)) || /* ${#11} */ +#if defined (ARRAY_VARS) + valid_array_reference (name + 1) || /* ${#a[7]} */ +#endif + legal_identifier (name + 1)); /* ${#PS1} */ +} + +/* Handle the parameter brace expansion that requires us to return the + length of a parameter. */ +static intmax_t +parameter_brace_expand_length (name) + char *name; +{ + char *t, *newname; + intmax_t number, arg_index; + WORD_LIST *list; +#if defined (ARRAY_VARS) + SHELL_VAR *var; +#endif + + if (name[1] == '\0') /* ${#} */ + number = number_of_args (); + else if ((name[1] == '@' || name[1] == '*') && name[2] == '\0') /* ${#@}, ${#*} */ + number = number_of_args (); + else if ((sh_syntaxtab[(unsigned char) name[1]] & CSPECVAR) && name[2] == '\0') + { + /* Take the lengths of some of the shell's special parameters. */ + switch (name[1]) + { + case '-': + t = which_set_flags (); + break; + case '?': + t = itos (last_command_exit_value); + break; + case '$': + t = itos (dollar_dollar_pid); + break; + case '!': + if (last_asynchronous_pid == NO_PID) + t = (char *)NULL; /* XXX - error if set -u set? */ + else + t = itos (last_asynchronous_pid); + break; + case '#': + t = itos (number_of_args ()); + break; + } + number = STRLEN (t); + FREE (t); + } +#if defined (ARRAY_VARS) + else if (valid_array_reference (name + 1)) + number = array_length_reference (name + 1); +#endif /* ARRAY_VARS */ + else + { + number = 0; + + if (legal_number (name + 1, &arg_index)) /* ${#1} */ + { + t = get_dollar_var_value (arg_index); + if (t == 0 && unbound_vars_is_error) + return INTMAX_MIN; + number = MB_STRLEN (t); + FREE (t); + } +#if defined (ARRAY_VARS) + else if ((var = find_variable (name + 1)) && (invisible_p (var) == 0) && (array_p (var) || assoc_p (var))) + { + if (assoc_p (var)) + t = assoc_reference (assoc_cell (var), "0"); + else + t = array_reference (array_cell (var), 0); + if (t == 0 && unbound_vars_is_error) + return INTMAX_MIN; + number = MB_STRLEN (t); + } +#endif + else /* ${#PS1} */ + { + newname = savestring (name); + newname[0] = '$'; + list = expand_string (newname, Q_DOUBLE_QUOTES); + t = list ? string_list (list) : (char *)NULL; + free (newname); + if (list) + dispose_words (list); + + number = t ? MB_STRLEN (t) : 0; + FREE (t); + } + } + + return (number); +} + +/* Skip characters in SUBSTR until DELIM. SUBSTR is an arithmetic expression, + so we do some ad-hoc parsing of an arithmetic expression to find + the first DELIM, instead of using strchr(3). Two rules: + 1. If the substring contains a `(', read until closing `)'. + 2. If the substring contains a `?', read past one `:' for each `?'. +*/ + +static char * +skiparith (substr, delim) + char *substr; + int delim; +{ + size_t sublen; + int skipcol, pcount, i; + DECLARE_MBSTATE; + + sublen = strlen (substr); + i = skipcol = pcount = 0; + while (substr[i]) + { + /* Balance parens */ + if (substr[i] == LPAREN) + { + pcount++; + i++; + continue; + } + if (substr[i] == RPAREN && pcount) + { + pcount--; + i++; + continue; + } + if (pcount) + { + ADVANCE_CHAR (substr, sublen, i); + continue; + } + + /* Skip one `:' for each `?' */ + if (substr[i] == ':' && skipcol) + { + skipcol--; + i++; + continue; + } + if (substr[i] == delim) + break; + if (substr[i] == '?') + { + skipcol++; + i++; + continue; + } + ADVANCE_CHAR (substr, sublen, i); + } + + return (substr + i); +} + +/* Verify and limit the start and end of the desired substring. If + VTYPE == 0, a regular shell variable is being used; if it is 1, + then the positional parameters are being used; if it is 2, then + VALUE is really a pointer to an array variable that should be used. + Return value is 1 if both values were OK, 0 if there was a problem + with an invalid expression, or -1 if the values were out of range. */ +static int +verify_substring_values (v, value, substr, vtype, e1p, e2p) + SHELL_VAR *v; + char *value, *substr; + int vtype; + intmax_t *e1p, *e2p; +{ + char *t, *temp1, *temp2; + arrayind_t len; + int expok; +#if defined (ARRAY_VARS) + ARRAY *a; + HASH_TABLE *h; +#endif + + /* duplicate behavior of strchr(3) */ + t = skiparith (substr, ':'); + if (*t && *t == ':') + *t = '\0'; + else + t = (char *)0; + + temp1 = expand_arith_string (substr, Q_DOUBLE_QUOTES); + *e1p = evalexp (temp1, &expok); + free (temp1); + if (expok == 0) + return (0); + + len = -1; /* paranoia */ + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + len = MB_STRLEN (value); + break; + case VT_POSPARMS: + len = number_of_args () + 1; + if (*e1p == 0) + len++; /* add one arg if counting from $0 */ + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + /* For arrays, the first value deals with array indices. Negative + offsets count from one past the array's maximum index. Associative + arrays treat the number of elements as the maximum index. */ + if (assoc_p (v)) + { + h = assoc_cell (v); + len = assoc_num_elements (h) + (*e1p < 0); + } + else + { + a = (ARRAY *)value; + len = array_max_index (a) + (*e1p < 0); /* arrays index from 0 to n - 1 */ + } + break; +#endif + } + + if (len == -1) /* paranoia */ + return -1; + + if (*e1p < 0) /* negative offsets count from end */ + *e1p += len; + + if (*e1p > len || *e1p < 0) + return (-1); + +#if defined (ARRAY_VARS) + /* For arrays, the second offset deals with the number of elements. */ + if (vtype == VT_ARRAYVAR) + len = assoc_p (v) ? assoc_num_elements (h) : array_num_elements (a); +#endif + + if (t) + { + t++; + temp2 = savestring (t); + temp1 = expand_arith_string (temp2, Q_DOUBLE_QUOTES); + free (temp2); + t[-1] = ':'; + *e2p = evalexp (temp1, &expok); + free (temp1); + if (expok == 0) + return (0); +#if 1 + if ((vtype == VT_ARRAYVAR || vtype == VT_POSPARMS) && *e2p < 0) +#else + /* bash-4.3: allow positional parameter length < 0 to count backwards + from end of positional parameters */ + if (vtype == VT_ARRAYVAR && *e2p < 0) +#endif + { + internal_error (_("%s: substring expression < 0"), t); + return (0); + } +#if defined (ARRAY_VARS) + /* In order to deal with sparse arrays, push the intelligence about how + to deal with the number of elements desired down to the array- + specific functions. */ + if (vtype != VT_ARRAYVAR) +#endif + { + if (*e2p < 0) + { + *e2p += len; + if (*e2p < 0 || *e2p < *e1p) + { + internal_error (_("%s: substring expression < 0"), t); + return (0); + } + } + else + *e2p += *e1p; /* want E2 chars starting at E1 */ + if (*e2p > len) + *e2p = len; + } + } + else + *e2p = len; + + return (1); +} + +/* Return the type of variable specified by VARNAME (simple variable, + positional param, or array variable). Also return the value specified + by VARNAME (value of a variable or a reference to an array element). + QUOTED is the standard description of quoting state, using Q_* defines. + FLAGS is currently a set of flags to pass to array_value. If IND is + non-null and not INTMAX_MIN, and FLAGS includes AV_USEIND, IND is + passed to array_value so the array index is not computed again. + If this returns VT_VARIABLE, the caller assumes that CTLESC and CTLNUL + characters in the value are quoted with CTLESC and takes appropriate + steps. For convenience, *VALP is set to the dequoted VALUE. */ +static int +get_var_and_type (varname, value, ind, quoted, flags, varp, valp) + char *varname, *value; + arrayind_t ind; + int quoted, flags; + SHELL_VAR **varp; + char **valp; +{ + int vtype, want_indir; + char *temp, *vname; + WORD_DESC *wd; +#if defined (ARRAY_VARS) + SHELL_VAR *v; +#endif + arrayind_t lind; + + want_indir = *varname == '!' && + (legal_variable_starter ((unsigned char)varname[1]) || DIGIT (varname[1]) + || VALID_INDIR_PARAM (varname[1])); + if (want_indir) + vname = parameter_brace_find_indir (varname+1, SPECIAL_VAR (varname, 1), quoted, 1); + else + vname = varname; + + /* This sets vtype to VT_VARIABLE or VT_POSPARMS */ + vtype = (vname[0] == '@' || vname[0] == '*') && vname[1] == '\0'; + if (vtype == VT_POSPARMS && vname[0] == '*') + vtype |= VT_STARSUB; + *varp = (SHELL_VAR *)NULL; + +#if defined (ARRAY_VARS) + if (valid_array_reference (vname)) + { + v = array_variable_part (vname, &temp, (int *)0); + /* If we want to signal array_value to use an already-computed index, + set LIND to that index */ + lind = (ind != INTMAX_MIN && (flags & AV_USEIND)) ? ind : 0; + if (v && invisible_p (v)) + { + vtype = VT_ARRAYMEMBER; + *varp = (SHELL_VAR *)NULL; + *valp = (char *)NULL; + } + if (v && (array_p (v) || assoc_p (v))) + { /* [ */ + if (ALL_ELEMENT_SUB (temp[0]) && temp[1] == ']') + { + /* Callers have to differentiate between indexed and associative */ + vtype = VT_ARRAYVAR; + if (temp[0] == '*') + vtype |= VT_STARSUB; + *valp = array_p (v) ? (char *)array_cell (v) : (char *)assoc_cell (v); + } + else + { + vtype = VT_ARRAYMEMBER; + *valp = array_value (vname, Q_DOUBLE_QUOTES, flags, (int *)NULL, &lind); + } + *varp = v; + } + else if (v && (ALL_ELEMENT_SUB (temp[0]) && temp[1] == ']')) + { + vtype = VT_VARIABLE; + *varp = v; + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + *valp = dequote_string (value); + else + *valp = dequote_escapes (value); + } + else + { + vtype = VT_ARRAYMEMBER; + *varp = v; + *valp = array_value (vname, Q_DOUBLE_QUOTES, flags, (int *)NULL, &lind); + } + } + else if ((v = find_variable (vname)) && (invisible_p (v) == 0) && (assoc_p (v) || array_p (v))) + { + vtype = VT_ARRAYMEMBER; + *varp = v; + *valp = assoc_p (v) ? assoc_reference (assoc_cell (v), "0") : array_reference (array_cell (v), 0); + } + else +#endif + { + if (value && vtype == VT_VARIABLE) + { + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + *valp = dequote_string (value); + else + *valp = dequote_escapes (value); + } + else + *valp = value; + } + + if (want_indir) + free (vname); + + return vtype; +} + +/******************************************************/ +/* */ +/* Functions to extract substrings of variable values */ +/* */ +/******************************************************/ + +#if defined (HANDLE_MULTIBYTE) +/* Character-oriented rather than strictly byte-oriented substrings. S and + E, rather being strict indices into STRING, indicate character (possibly + multibyte character) positions that require calculation. + Used by the ${param:offset[:length]} expansion. */ +static char * +mb_substring (string, s, e) + char *string; + int s, e; +{ + char *tt; + int start, stop, i, slen; + DECLARE_MBSTATE; + + start = 0; + /* Don't need string length in ADVANCE_CHAR unless multibyte chars possible. */ + slen = (MB_CUR_MAX > 1) ? STRLEN (string) : 0; + + i = s; + while (string[start] && i--) + ADVANCE_CHAR (string, slen, start); + stop = start; + i = e - s; + while (string[stop] && i--) + ADVANCE_CHAR (string, slen, stop); + tt = substring (string, start, stop); + return tt; +} +#endif + +/* Process a variable substring expansion: ${name:e1[:e2]}. If VARNAME + is `@', use the positional parameters; otherwise, use the value of + VARNAME. If VARNAME is an array variable, use the array elements. */ + +static char * +parameter_brace_substring (varname, value, ind, substr, quoted, flags) + char *varname, *value; + int ind; + char *substr; + int quoted, flags; +{ + intmax_t e1, e2; + int vtype, r, starsub; + char *temp, *val, *tt, *oname; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + oname = this_command_name; + this_command_name = varname; + + vtype = get_var_and_type (varname, value, ind, quoted, flags, &v, &val); + if (vtype == -1) + { + this_command_name = oname; + return ((char *)NULL); + } + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + r = verify_substring_values (v, val, substr, vtype, &e1, &e2); + this_command_name = oname; + if (r <= 0) + { + if (vtype == VT_VARIABLE) + FREE (val); + return ((r == 0) ? &expand_param_error : (char *)NULL); + } + + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1) + tt = mb_substring (val, e1, e2); + else +#endif + tt = substring (val, e1, e2); + + if (vtype == VT_VARIABLE) + FREE (val); + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + temp = quote_string (tt); + else + temp = tt ? quote_escapes (tt) : (char *)NULL; + FREE (tt); + break; + case VT_POSPARMS: + tt = pos_params (varname, e1, e2, quoted); + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) == 0) + { + temp = tt ? quote_escapes (tt) : (char *)NULL; + FREE (tt); + } + else + temp = tt; + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + if (assoc_p (v)) + /* we convert to list and take first e2 elements starting at e1th + element -- officially undefined for now */ + temp = assoc_subrange (assoc_cell (v), e1, e2, starsub, quoted); + else + /* We want E2 to be the number of elements desired (arrays can be sparse, + so verify_substring_values just returns the numbers specified and we + rely on array_subrange to understand how to deal with them). */ + temp = array_subrange (array_cell (v), e1, e2, starsub, quoted); + /* array_subrange now calls array_quote_escapes as appropriate, so the + caller no longer needs to. */ + break; +#endif + default: + temp = (char *)NULL; + } + + return temp; +} + +/****************************************************************/ +/* */ +/* Functions to perform pattern substitution on variable values */ +/* */ +/****************************************************************/ + +static int +shouldexp_replacement (s) + char *s; +{ + register char *p; + + for (p = s; p && *p; p++) + { + if (*p == '\\') + p++; + else if (*p == '&') + return 1; + } + return 0; +} + +char * +pat_subst (string, pat, rep, mflags) + char *string, *pat, *rep; + int mflags; +{ + char *ret, *s, *e, *str, *rstr, *mstr; + int rsize, rptr, l, replen, mtype, rxpand, rslen, mlen; + + if (string == 0) + return (savestring ("")); + + mtype = mflags & MATCH_TYPEMASK; + +#if 0 /* bash-4.2 ? */ + rxpand = (rep && *rep) ? shouldexp_replacement (rep) : 0; +#else + rxpand = 0; +#endif + + /* Special cases: + * 1. A null pattern with mtype == MATCH_BEG means to prefix STRING + * with REP and return the result. + * 2. A null pattern with mtype == MATCH_END means to append REP to + * STRING and return the result. + * These don't understand or process `&' in the replacement string. + */ + if ((pat == 0 || *pat == 0) && (mtype == MATCH_BEG || mtype == MATCH_END)) + { + replen = STRLEN (rep); + l = STRLEN (string); + ret = (char *)xmalloc (replen + l + 2); + if (replen == 0) + strcpy (ret, string); + else if (mtype == MATCH_BEG) + { + strcpy (ret, rep); + strcpy (ret + replen, string); + } + else + { + strcpy (ret, string); + strcpy (ret + l, rep); + } + return (ret); + } + + ret = (char *)xmalloc (rsize = 64); + ret[0] = '\0'; + + for (replen = STRLEN (rep), rptr = 0, str = string;;) + { + if (match_pattern (str, pat, mtype, &s, &e) == 0) + break; + l = s - str; + + if (rxpand) + { + int x; + mlen = e - s; + mstr = xmalloc (mlen + 1); + for (x = 0; x < mlen; x++) + mstr[x] = s[x]; + mstr[mlen] = '\0'; + rstr = strcreplace (rep, '&', mstr, 0); + rslen = strlen (rstr); + } + else + { + rstr = rep; + rslen = replen; + } + + RESIZE_MALLOCED_BUFFER (ret, rptr, (l + rslen), rsize, 64); + + /* OK, now copy the leading unmatched portion of the string (from + str to s) to ret starting at rptr (the current offset). Then copy + the replacement string at ret + rptr + (s - str). Increment + rptr (if necessary) and str and go on. */ + if (l) + { + strncpy (ret + rptr, str, l); + rptr += l; + } + if (replen) + { + strncpy (ret + rptr, rstr, rslen); + rptr += rslen; + } + str = e; /* e == end of match */ + + if (rstr != rep) + free (rstr); + + if (((mflags & MATCH_GLOBREP) == 0) || mtype != MATCH_ANY) + break; + + if (s == e) + { + /* On a zero-length match, make sure we copy one character, since + we increment one character to avoid infinite recursion. */ + RESIZE_MALLOCED_BUFFER (ret, rptr, 1, rsize, 64); + ret[rptr++] = *str++; + e++; /* avoid infinite recursion on zero-length match */ + } + } + + /* Now copy the unmatched portion of the input string */ + if (str && *str) + { + RESIZE_MALLOCED_BUFFER (ret, rptr, STRLEN(str) + 1, rsize, 64); + strcpy (ret + rptr, str); + } + else + ret[rptr] = '\0'; + + return ret; +} + +/* Do pattern match and replacement on the positional parameters. */ +static char * +pos_params_pat_subst (string, pat, rep, mflags) + char *string, *pat, *rep; + int mflags; +{ + WORD_LIST *save, *params; + WORD_DESC *w; + char *ret; + int pchar, qflags; + + save = params = list_rest_of_args (); + if (save == 0) + return ((char *)NULL); + + for ( ; params; params = params->next) + { + ret = pat_subst (params->word->word, pat, rep, mflags); + w = alloc_word_desc (); + w->word = ret ? ret : savestring (""); + dispose_word (params->word); + params->word = w; + } + + pchar = (mflags & MATCH_STARSUB) == MATCH_STARSUB ? '*' : '@'; + qflags = (mflags & MATCH_QUOTED) == MATCH_QUOTED ? Q_DOUBLE_QUOTES : 0; + + ret = string_list_pos_params (pchar, save, qflags); + + dispose_words (save); + + return (ret); +} + +/* Perform pattern substitution on VALUE, which is the expansion of + VARNAME. PATSUB is an expression supplying the pattern to match + and the string to substitute. QUOTED is a flags word containing + the type of quoting currently in effect. */ +static char * +parameter_brace_patsub (varname, value, ind, patsub, quoted, flags) + char *varname, *value; + int ind; + char *patsub; + int quoted, flags; +{ + int vtype, mflags, starsub, delim; + char *val, *temp, *pat, *rep, *p, *lpatsub, *tt; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + this_command_name = varname; + + vtype = get_var_and_type (varname, value, ind, quoted, flags, &v, &val); + if (vtype == -1) + return ((char *)NULL); + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + mflags = 0; + /* PATSUB is never NULL when this is called. */ + if (*patsub == '/') + { + mflags |= MATCH_GLOBREP; + patsub++; + } + + /* Malloc this because expand_string_if_necessary or one of the expansion + functions in its call chain may free it on a substitution error. */ + lpatsub = savestring (patsub); + + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + mflags |= MATCH_QUOTED; + + if (starsub) + mflags |= MATCH_STARSUB; + + /* If the pattern starts with a `/', make sure we skip over it when looking + for the replacement delimiter. */ + delim = skip_to_delim (lpatsub, ((*patsub == '/') ? 1 : 0), "/", 0); + if (lpatsub[delim] == '/') + { + lpatsub[delim] = 0; + rep = lpatsub + delim + 1; + } + else + rep = (char *)NULL; + + if (rep && *rep == '\0') + rep = (char *)NULL; + + /* Perform the same expansions on the pattern as performed by the + pattern removal expansions. */ + pat = getpattern (lpatsub, quoted, 1); + + if (rep) + { + /* We want to perform quote removal on the expanded replacement even if + the entire expansion is double-quoted because the parser and string + extraction functions treated quotes in the replacement string as + special. THIS IS NOT BACKWARDS COMPATIBLE WITH BASH-4.2. */ + if (shell_compatibility_level > 42) + rep = expand_string_if_necessary (rep, quoted & ~(Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT), expand_string_unsplit); + /* This is the bash-4.2 code. */ + else if ((mflags & MATCH_QUOTED) == 0) + rep = expand_string_if_necessary (rep, quoted, expand_string_unsplit); + else + rep = expand_string_to_string_internal (rep, quoted, expand_string_unsplit); + } + + /* ksh93 doesn't allow the match specifier to be a part of the expanded + pattern. This is an extension. Make sure we don't anchor the pattern + at the beginning or end of the string if we're doing global replacement, + though. */ + p = pat; + if (mflags & MATCH_GLOBREP) + mflags |= MATCH_ANY; + else if (pat && pat[0] == '#') + { + mflags |= MATCH_BEG; + p++; + } + else if (pat && pat[0] == '%') + { + mflags |= MATCH_END; + p++; + } + else + mflags |= MATCH_ANY; + + /* OK, we now want to substitute REP for PAT in VAL. If + flags & MATCH_GLOBREP is non-zero, the substitution is done + everywhere, otherwise only the first occurrence of PAT is + replaced. The pattern matching code doesn't understand + CTLESC quoting CTLESC and CTLNUL so we use the dequoted variable + values passed in (VT_VARIABLE) so the pattern substitution + code works right. We need to requote special chars after + we're done for VT_VARIABLE and VT_ARRAYMEMBER, and for the + other cases if QUOTED == 0, since the posparams and arrays + indexed by * or @ do special things when QUOTED != 0. */ + + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + temp = pat_subst (val, p, rep, mflags); + if (vtype == VT_VARIABLE) + FREE (val); + if (temp) + { + tt = (mflags & MATCH_QUOTED) ? quote_string (temp) : quote_escapes (temp); + free (temp); + temp = tt; + } + break; + case VT_POSPARMS: + temp = pos_params_pat_subst (val, p, rep, mflags); + if (temp && (mflags & MATCH_QUOTED) == 0) + { + tt = quote_escapes (temp); + free (temp); + temp = tt; + } + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + temp = assoc_p (v) ? assoc_patsub (assoc_cell (v), p, rep, mflags) + : array_patsub (array_cell (v), p, rep, mflags); + /* Don't call quote_escapes anymore; array_patsub calls + array_quote_escapes as appropriate before adding the + space separators; ditto for assoc_patsub. */ + break; +#endif + } + + FREE (pat); + FREE (rep); + free (lpatsub); + + return temp; +} + +/****************************************************************/ +/* */ +/* Functions to perform case modification on variable values */ +/* */ +/****************************************************************/ + +/* Do case modification on the positional parameters. */ + +static char * +pos_params_modcase (string, pat, modop, mflags) + char *string, *pat; + int modop; + int mflags; +{ + WORD_LIST *save, *params; + WORD_DESC *w; + char *ret; + int pchar, qflags; + + save = params = list_rest_of_args (); + if (save == 0) + return ((char *)NULL); + + for ( ; params; params = params->next) + { + ret = sh_modcase (params->word->word, pat, modop); + w = alloc_word_desc (); + w->word = ret ? ret : savestring (""); + dispose_word (params->word); + params->word = w; + } + + pchar = (mflags & MATCH_STARSUB) == MATCH_STARSUB ? '*' : '@'; + qflags = (mflags & MATCH_QUOTED) == MATCH_QUOTED ? Q_DOUBLE_QUOTES : 0; + + ret = string_list_pos_params (pchar, save, qflags); + dispose_words (save); + + return (ret); +} + +/* Perform case modification on VALUE, which is the expansion of + VARNAME. MODSPEC is an expression supplying the type of modification + to perform. QUOTED is a flags word containing the type of quoting + currently in effect. */ +static char * +parameter_brace_casemod (varname, value, ind, modspec, patspec, quoted, flags) + char *varname, *value; + int ind, modspec; + char *patspec; + int quoted, flags; +{ + int vtype, starsub, modop, mflags, x; + char *val, *temp, *pat, *p, *lpat, *tt; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + this_command_name = varname; + + vtype = get_var_and_type (varname, value, ind, quoted, flags, &v, &val); + if (vtype == -1) + return ((char *)NULL); + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + modop = 0; + mflags = 0; + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + mflags |= MATCH_QUOTED; + if (starsub) + mflags |= MATCH_STARSUB; + + p = patspec; + if (modspec == '^') + { + x = p && p[0] == modspec; + modop = x ? CASE_UPPER : CASE_UPFIRST; + p += x; + } + else if (modspec == ',') + { + x = p && p[0] == modspec; + modop = x ? CASE_LOWER : CASE_LOWFIRST; + p += x; + } + else if (modspec == '~') + { + x = p && p[0] == modspec; + modop = x ? CASE_TOGGLEALL : CASE_TOGGLE; + p += x; + } + + lpat = p ? savestring (p) : 0; + /* Perform the same expansions on the pattern as performed by the + pattern removal expansions. FOR LATER */ + pat = lpat ? getpattern (lpat, quoted, 1) : 0; + + /* OK, now we do the case modification. */ + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + temp = sh_modcase (val, pat, modop); + if (vtype == VT_VARIABLE) + FREE (val); + if (temp) + { + tt = (mflags & MATCH_QUOTED) ? quote_string (temp) : quote_escapes (temp); + free (temp); + temp = tt; + } + break; + + case VT_POSPARMS: + temp = pos_params_modcase (val, pat, modop, mflags); + if (temp && (mflags & MATCH_QUOTED) == 0) + { + tt = quote_escapes (temp); + free (temp); + temp = tt; + } + break; + +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + temp = assoc_p (v) ? assoc_modcase (assoc_cell (v), pat, modop, mflags) + : array_modcase (array_cell (v), pat, modop, mflags); + /* Don't call quote_escapes; array_modcase calls array_quote_escapes + as appropriate before adding the space separators; ditto for + assoc_modcase. */ + break; +#endif + } + + FREE (pat); + free (lpat); + + return temp; +} + +/* Check for unbalanced parens in S, which is the contents of $(( ... )). If + any occur, this must be a nested command substitution, so return 0. + Otherwise, return 1. A valid arithmetic expression must always have a + ( before a matching ), so any cases where there are more right parens + means that this must not be an arithmetic expression, though the parser + will not accept it without a balanced total number of parens. */ +static int +chk_arithsub (s, len) + const char *s; + int len; +{ + int i, count; + DECLARE_MBSTATE; + + i = count = 0; + while (i < len) + { + if (s[i] == LPAREN) + count++; + else if (s[i] == RPAREN) + { + count--; + if (count < 0) + return 0; + } + + switch (s[i]) + { + default: + ADVANCE_CHAR (s, len, i); + break; + + case '\\': + i++; + if (s[i]) + ADVANCE_CHAR (s, len, i); + break; + + case '\'': + i = skip_single_quoted (s, len, ++i); + break; + + case '"': + i = skip_double_quoted ((char *)s, len, ++i); + break; + } + } + + return (count == 0); +} + +/****************************************************************/ +/* */ +/* Functions to perform parameter expansion on a string */ +/* */ +/****************************************************************/ + +/* ${[#][!]name[[:][^[^]][,[,]]#[#]%[%]-=?+[word][:e1[:e2]]]} */ +static WORD_DESC * +parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, contains_dollar_at) + char *string; + int *indexp, quoted, *quoted_dollar_atp, *contains_dollar_at, pflags; +{ + int check_nullness, var_is_set, var_is_null, var_is_special; + int want_substring, want_indir, want_patsub, want_casemod; + char *name, *value, *temp, *temp1; + WORD_DESC *tdesc, *ret; + int t_index, sindex, c, tflag, modspec; + intmax_t number; + arrayind_t ind; + + temp = temp1 = value = (char *)NULL; + var_is_set = var_is_null = var_is_special = check_nullness = 0; + want_substring = want_indir = want_patsub = want_casemod = 0; + + sindex = *indexp; + t_index = ++sindex; + /* ${#var} doesn't have any of the other parameter expansions on it. */ + if (string[t_index] == '#' && legal_variable_starter (string[t_index+1])) /* {{ */ + name = string_extract (string, &t_index, "}", SX_VARNAME); + else +#if defined (CASEMOD_EXPANSIONS) + /* To enable case-toggling expansions using the `~' operator character + change the 1 to 0. */ +# if defined (CASEMOD_CAPCASE) + name = string_extract (string, &t_index, "#%^,~:-=?+/}", SX_VARNAME); +# else + name = string_extract (string, &t_index, "#%^,:-=?+/}", SX_VARNAME); +# endif /* CASEMOD_CAPCASE */ +#else + name = string_extract (string, &t_index, "#%:-=?+/}", SX_VARNAME); +#endif /* CASEMOD_EXPANSIONS */ + + ret = 0; + tflag = 0; + + ind = INTMAX_MIN; + + /* If the name really consists of a special variable, then make sure + that we have the entire name. We don't allow indirect references + to special variables except `#', `?', `@' and `*'. */ + if ((sindex == t_index && VALID_SPECIAL_LENGTH_PARAM (string[t_index])) || + (sindex == t_index - 1 && string[sindex] == '!' && VALID_INDIR_PARAM (string[t_index]))) + { + t_index++; + temp1 = string_extract (string, &t_index, "#%:-=?+/}", 0); + name = (char *)xrealloc (name, 3 + (strlen (temp1))); + *name = string[sindex]; + if (string[sindex] == '!') + { + /* indirect reference of $#, $?, $@, or $* */ + name[1] = string[sindex + 1]; + strcpy (name + 2, temp1); + } + else + strcpy (name + 1, temp1); + free (temp1); + } + sindex = t_index; + + /* Find out what character ended the variable name. Then + do the appropriate thing. */ + if (c = string[sindex]) + sindex++; + + /* If c is followed by one of the valid parameter expansion + characters, move past it as normal. If not, assume that + a substring specification is being given, and do not move + past it. */ + if (c == ':' && VALID_PARAM_EXPAND_CHAR (string[sindex])) + { + check_nullness++; + if (c = string[sindex]) + sindex++; + } + else if (c == ':' && string[sindex] != RBRACE) + want_substring = 1; + else if (c == '/' /* && string[sindex] != RBRACE */) /* XXX */ + want_patsub = 1; +#if defined (CASEMOD_EXPANSIONS) + else if (c == '^' || c == ',' || c == '~') + { + modspec = c; + want_casemod = 1; + } +#endif + + /* Catch the valid and invalid brace expressions that made it through the + tests above. */ + /* ${#-} is a valid expansion and means to take the length of $-. + Similarly for ${#?} and ${##}... */ + if (name[0] == '#' && name[1] == '\0' && check_nullness == 0 && + VALID_SPECIAL_LENGTH_PARAM (c) && string[sindex] == RBRACE) + { + name = (char *)xrealloc (name, 3); + name[1] = c; + name[2] = '\0'; + c = string[sindex++]; + } + + /* ...but ${#%}, ${#:}, ${#=}, ${#+}, and ${#/} are errors. */ + if (name[0] == '#' && name[1] == '\0' && check_nullness == 0 && + member (c, "%:=+/") && string[sindex] == RBRACE) + { + temp = (char *)NULL; + goto bad_substitution; + } + + /* Indirect expansion begins with a `!'. A valid indirect expansion is + either a variable name, one of the positional parameters or a special + variable that expands to one of the positional parameters. */ + want_indir = *name == '!' && + (legal_variable_starter ((unsigned char)name[1]) || DIGIT (name[1]) + || VALID_INDIR_PARAM (name[1])); + + /* Determine the value of this variable. */ + + /* Check for special variables, directly referenced. */ + if (SPECIAL_VAR (name, want_indir)) + var_is_special++; + + /* Check for special expansion things, like the length of a parameter */ + if (*name == '#' && name[1]) + { + /* If we are not pointing at the character just after the + closing brace, then we haven't gotten all of the name. + Since it begins with a special character, this is a bad + substitution. Also check NAME for validity before trying + to go on. */ + if (string[sindex - 1] != RBRACE || (valid_length_expression (name) == 0)) + { + temp = (char *)NULL; + goto bad_substitution; + } + + number = parameter_brace_expand_length (name); + if (number == INTMAX_MIN && unbound_vars_is_error) + { + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (name+1); + free (name); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + free (name); + + *indexp = sindex; + if (number < 0) + return (&expand_wdesc_error); + else + { + ret = alloc_word_desc (); + ret->word = itos (number); + return ret; + } + } + + /* ${@} is identical to $@. */ + if (name[0] == '@' && name[1] == '\0') + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + + if (contains_dollar_at) + *contains_dollar_at = 1; + + tflag |= W_DOLLARAT; + } + + /* Process ${!PREFIX*} expansion. */ + if (want_indir && string[sindex - 1] == RBRACE && + (string[sindex - 2] == '*' || string[sindex - 2] == '@') && + legal_variable_starter ((unsigned char) name[1])) + { + char **x; + WORD_LIST *xlist; + + temp1 = savestring (name + 1); + number = strlen (temp1); + temp1[number - 1] = '\0'; + x = all_variables_matching_prefix (temp1); + xlist = strvec_to_word_list (x, 0, 0); + if (string[sindex - 2] == '*') + temp = string_list_dollar_star (xlist); + else + { + temp = string_list_dollar_at (xlist, quoted); + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + + tflag |= W_DOLLARAT; + } + free (x); + dispose_words (xlist); + free (temp1); + *indexp = sindex; + + free (name); + + ret = alloc_word_desc (); + ret->word = temp; + ret->flags = tflag; /* XXX */ + return ret; + } + +#if defined (ARRAY_VARS) + /* Process ${!ARRAY[@]} and ${!ARRAY[*]} expansion. */ /* [ */ + if (want_indir && string[sindex - 1] == RBRACE && + string[sindex - 2] == ']' && valid_array_reference (name+1)) + { + char *x, *x1; + + temp1 = savestring (name + 1); + x = array_variable_name (temp1, &x1, (int *)0); /* [ */ + FREE (x); + if (ALL_ELEMENT_SUB (x1[0]) && x1[1] == ']') + { + temp = array_keys (temp1, quoted); /* handles assoc vars too */ + if (x1[0] == '@') + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + + tflag |= W_DOLLARAT; + } + + free (temp1); + *indexp = sindex; + + ret = alloc_word_desc (); + ret->word = temp; + ret->flags = tflag; /* XXX */ + return ret; + } + + free (temp1); + } +#endif /* ARRAY_VARS */ + + /* Make sure that NAME is valid before trying to go on. */ + if (valid_brace_expansion_word (want_indir ? name + 1 : name, + var_is_special) == 0) + { + temp = (char *)NULL; + goto bad_substitution; + } + + if (want_indir) + tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at); + else + tdesc = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND|(pflags&(PF_NOSPLIT2|PF_ASSIGNRHS)), &ind); + + if (tdesc) + { + temp = tdesc->word; + tflag = tdesc->flags; + dispose_word_desc (tdesc); + } + else + temp = (char *)0; + + if (temp == &expand_param_error || temp == &expand_param_fatal) + { + FREE (name); + FREE (value); + return (temp == &expand_param_error ? &expand_wdesc_error : &expand_wdesc_fatal); + } + +#if defined (ARRAY_VARS) + if (valid_array_reference (name)) + chk_atstar (name, quoted, quoted_dollar_atp, contains_dollar_at); +#endif + + var_is_set = temp != (char *)0; + var_is_null = check_nullness && (var_is_set == 0 || *temp == 0); + /* XXX - this may not need to be restricted to special variables */ + if (check_nullness) + var_is_null |= var_is_set && var_is_special && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && QUOTED_NULL (temp); + + /* Get the rest of the stuff inside the braces. */ + if (c && c != RBRACE) + { + /* Extract the contents of the ${ ... } expansion + according to the Posix.2 rules. */ + value = extract_dollar_brace_string (string, &sindex, quoted, (c == '%' || c == '#' || c =='/' || c == '^' || c == ',' || c ==':') ? SX_POSIXEXP|SX_WORD : SX_WORD); + if (string[sindex] == RBRACE) + sindex++; + else + goto bad_substitution; + } + else + value = (char *)NULL; + + *indexp = sindex; + + /* All the cases where an expansion can possibly generate an unbound + variable error. */ + if (want_substring || want_patsub || want_casemod || c == '#' || c == '%' || c == RBRACE) + { + if (var_is_set == 0 && unbound_vars_is_error && ((name[0] != '@' && name[0] != '*') || name[1])) + { + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (name); + FREE (value); + FREE (temp); + free (name); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + } + + /* If this is a substring spec, process it and add the result. */ + if (want_substring) + { + temp1 = parameter_brace_substring (name, temp, ind, value, quoted, (tflag & W_ARRAYIND) ? AV_USEIND : 0); + FREE (name); + FREE (value); + FREE (temp); + + if (temp1 == &expand_param_error) + return (&expand_wdesc_error); + else if (temp1 == &expand_param_fatal) + return (&expand_wdesc_fatal); + + ret = alloc_word_desc (); + ret->word = temp1; + /* We test quoted_dollar_atp because we want variants with double-quoted + "$@" to take a different code path. In fact, we make sure at the end + of expand_word_internal that we're only looking at these flags if + quoted_dollar_at == 0. */ + if (temp1 && + (quoted_dollar_atp == 0 || *quoted_dollar_atp == 0) && + QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ret->flags |= W_QUOTED|W_HASQUOTEDNULL; + return ret; + } + else if (want_patsub) + { + temp1 = parameter_brace_patsub (name, temp, ind, value, quoted, (tflag & W_ARRAYIND) ? AV_USEIND : 0); + FREE (name); + FREE (value); + FREE (temp); + + if (temp1 == &expand_param_error) + return (&expand_wdesc_error); + else if (temp1 == &expand_param_fatal) + return (&expand_wdesc_fatal); + + ret = alloc_word_desc (); + ret->word = temp1; + if (temp1 && + (quoted_dollar_atp == 0 || *quoted_dollar_atp == 0) && + QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ret->flags |= W_QUOTED|W_HASQUOTEDNULL; + return ret; + } +#if defined (CASEMOD_EXPANSIONS) + else if (want_casemod) + { + temp1 = parameter_brace_casemod (name, temp, ind, modspec, value, quoted, (tflag & W_ARRAYIND) ? AV_USEIND : 0); + FREE (name); + FREE (value); + FREE (temp); + + if (temp1 == &expand_param_error) + return (&expand_wdesc_error); + else if (temp1 == &expand_param_fatal) + return (&expand_wdesc_fatal); + + ret = alloc_word_desc (); + ret->word = temp1; + if (temp1 && + (quoted_dollar_atp == 0 || *quoted_dollar_atp == 0) && + QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ret->flags |= W_QUOTED|W_HASQUOTEDNULL; + return ret; + } +#endif + + /* Do the right thing based on which character ended the variable name. */ + switch (c) + { + default: + case '\0': + bad_substitution: + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("%s: bad substitution"), string ? string : "??"); + FREE (value); + FREE (temp); + free (name); + return &expand_wdesc_error; + + case RBRACE: + break; + + case '#': /* ${param#[#]pattern} */ + case '%': /* ${param%[%]pattern} */ + if (value == 0 || *value == '\0' || temp == 0 || *temp == '\0') + { + FREE (value); + break; + } + temp1 = parameter_brace_remove_pattern (name, temp, ind, value, c, quoted, (tflag & W_ARRAYIND) ? AV_USEIND : 0); + free (temp); + free (value); + free (name); + + ret = alloc_word_desc (); + ret->word = temp1; + if (temp1 && QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ret->flags |= W_QUOTED|W_HASQUOTEDNULL; + return ret; + + case '-': + case '=': + case '?': + case '+': + if (var_is_set && var_is_null == 0) + { + /* If the operator is `+', we don't want the value of the named + variable for anything, just the value of the right hand side. */ + if (c == '+') + { + /* XXX -- if we're double-quoted and the named variable is "$@", + we want to turn off any special handling of "$@" -- + we're not using it, so whatever is on the rhs applies. */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 0; + if (contains_dollar_at) + *contains_dollar_at = 0; + + FREE (temp); + if (value) + { + /* From Posix discussion on austin-group list. Issue 221 + requires that backslashes escaping `}' inside + double-quoted ${...} be removed. */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + quoted |= Q_DOLBRACE; + ret = parameter_brace_expand_rhs (name, value, c, + quoted, + quoted_dollar_atp, + contains_dollar_at); + /* XXX - fix up later, esp. noting presence of + W_HASQUOTEDNULL in ret->flags */ + free (value); + } + else + temp = (char *)NULL; + } + else + { + FREE (value); + } + /* Otherwise do nothing; just use the value in TEMP. */ + } + else /* VAR not set or VAR is NULL. */ + { + FREE (temp); + temp = (char *)NULL; + if (c == '=' && var_is_special) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("$%s: cannot assign in this way"), name); + free (name); + free (value); + return &expand_wdesc_error; + } + else if (c == '?') + { + parameter_brace_expand_error (name, value); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + else if (c != '+') + { + /* XXX -- if we're double-quoted and the named variable is "$@", + we want to turn off any special handling of "$@" -- + we're not using it, so whatever is on the rhs applies. */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 0; + if (contains_dollar_at) + *contains_dollar_at = 0; + + /* From Posix discussion on austin-group list. Issue 221 requires + that backslashes escaping `}' inside double-quoted ${...} be + removed. */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + quoted |= Q_DOLBRACE; + ret = parameter_brace_expand_rhs (name, value, c, quoted, + quoted_dollar_atp, + contains_dollar_at); + /* XXX - fix up later, esp. noting presence of + W_HASQUOTEDNULL in tdesc->flags */ + } + free (value); + } + + break; + } + free (name); + + if (ret == 0) + { + ret = alloc_word_desc (); + ret->flags = tflag; + ret->word = temp; + } + return (ret); +} + +/* Expand a single ${xxx} expansion. The braces are optional. When + the braces are used, parameter_brace_expand() does the work, + possibly calling param_expand recursively. */ +static WORD_DESC * +param_expand (string, sindex, quoted, expanded_something, + contains_dollar_at, quoted_dollar_at_p, had_quoted_null_p, + pflags) + char *string; + int *sindex, quoted, *expanded_something, *contains_dollar_at; + int *quoted_dollar_at_p, *had_quoted_null_p, pflags; +{ + char *temp, *temp1, uerror[3]; + int zindex, t_index, expok; + unsigned char c; + intmax_t number; + SHELL_VAR *var; + WORD_LIST *list; + WORD_DESC *tdesc, *ret; + int tflag; + + zindex = *sindex; + c = string[++zindex]; + + temp = (char *)NULL; + ret = tdesc = (WORD_DESC *)NULL; + tflag = 0; + + /* Do simple cases first. Switch on what follows '$'. */ + switch (c) + { + /* $0 .. $9? */ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + temp1 = dollar_vars[TODIGIT (c)]; + if (unbound_vars_is_error && temp1 == (char *)NULL) + { + uerror[0] = '$'; + uerror[1] = c; + uerror[2] = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (uerror); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + if (temp1) + temp = (*temp1 && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ? quote_string (temp1) + : quote_escapes (temp1); + else + temp = (char *)NULL; + + break; + + /* $$ -- pid of the invoking shell. */ + case '$': + temp = itos (dollar_dollar_pid); + break; + + /* $# -- number of positional parameters. */ + case '#': + temp = itos (number_of_args ()); + break; + + /* $? -- return value of the last synchronous command. */ + case '?': + temp = itos (last_command_exit_value); + break; + + /* $- -- flags supplied to the shell on invocation or by `set'. */ + case '-': + temp = which_set_flags (); + break; + + /* $! -- Pid of the last asynchronous command. */ + case '!': + /* If no asynchronous pids have been created, expand to nothing. + If `set -u' has been executed, and no async processes have + been created, this is an expansion error. */ + if (last_asynchronous_pid == NO_PID) + { + if (expanded_something) + *expanded_something = 0; + temp = (char *)NULL; + if (unbound_vars_is_error) + { + uerror[0] = '$'; + uerror[1] = c; + uerror[2] = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (uerror); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + } + else + temp = itos (last_asynchronous_pid); + break; + + /* The only difference between this and $@ is when the arg is quoted. */ + case '*': /* `$*' */ + list = list_rest_of_args (); + +#if 0 + /* According to austin-group posix proposal by Geoff Clare in + <20090505091501.GA10097@squonk.masqnet> of 5 May 2009: + + "The shell shall write a message to standard error and + immediately exit when it tries to expand an unset parameter + other than the '@' and '*' special parameters." + */ + + if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) + { + uerror[0] = '$'; + uerror[1] = '*'; + uerror[2] = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (uerror); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } +#endif + + /* If there are no command-line arguments, this should just + disappear if there are other characters in the expansion, + even if it's quoted. */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && list == 0) + temp = (char *)NULL; + else if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES|Q_PATQUOTE)) + { + /* If we have "$*" we want to make a string of the positional + parameters, separated by the first character of $IFS, and + quote the whole string, including the separators. If IFS + is unset, the parameters are separated by ' '; if $IFS is + null, the parameters are concatenated. */ + temp = (quoted & (Q_DOUBLE_QUOTES|Q_PATQUOTE)) ? string_list_dollar_star (list) : string_list (list); + if (temp) + { + temp1 = quote_string (temp); + if (*temp == 0) + tflag |= W_HASQUOTEDNULL; + free (temp); + temp = temp1; + } + } + else + { + /* We check whether or not we're eventually going to split $* here, + for example when IFS is empty and we are processing the rhs of + an assignment statement. In that case, we don't separate the + arguments at all. Otherwise, if the $* is not quoted it is + identical to $@ */ +# if defined (HANDLE_MULTIBYTE) + if (expand_no_split_dollar_star && ifs_firstc[0] == 0) +# else + if (expand_no_split_dollar_star && ifs_firstc == 0) +# endif + temp = string_list_dollar_star (list); + else + { + temp = string_list_dollar_at (list, quoted); + if (quoted == 0 && (ifs_is_set == 0 || ifs_is_null)) + tflag |= W_SPLITSPACE; + } + + if (expand_no_split_dollar_star == 0 && contains_dollar_at) + *contains_dollar_at = 1; + } + + dispose_words (list); + break; + + /* When we have "$@" what we want is "$1" "$2" "$3" ... This + means that we have to turn quoting off after we split into + the individually quoted arguments so that the final split + on the first character of $IFS is still done. */ + case '@': /* `$@' */ + list = list_rest_of_args (); + +#if 0 + /* According to austin-group posix proposal by Geoff Clare in + <20090505091501.GA10097@squonk.masqnet> of 5 May 2009: + + "The shell shall write a message to standard error and + immediately exit when it tries to expand an unset parameter + other than the '@' and '*' special parameters." + */ + + if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) + { + uerror[0] = '$'; + uerror[1] = '@'; + uerror[2] = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (uerror); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } +#endif + + /* We want to flag the fact that we saw this. We can't turn + off quoting entirely, because other characters in the + string might need it (consider "\"$@\""), but we need some + way to signal that the final split on the first character + of $IFS should be done, even though QUOTED is 1. */ + /* XXX - should this test include Q_PATQUOTE? */ + if (quoted_dollar_at_p && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + *quoted_dollar_at_p = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + + /* We want to separate the positional parameters with the first + character of $IFS in case $IFS is something other than a space. + We also want to make sure that splitting is done no matter what -- + according to POSIX.2, this expands to a list of the positional + parameters no matter what IFS is set to. */ + temp = string_list_dollar_at (list, (pflags & PF_ASSIGNRHS) ? (quoted|Q_DOUBLE_QUOTES) : quoted); + + tflag |= W_DOLLARAT; + dispose_words (list); + break; + + case LBRACE: + tdesc = parameter_brace_expand (string, &zindex, quoted, pflags, + quoted_dollar_at_p, + contains_dollar_at); + + if (tdesc == &expand_wdesc_error || tdesc == &expand_wdesc_fatal) + return (tdesc); + temp = tdesc ? tdesc->word : (char *)0; + + /* XXX */ + /* Quoted nulls should be removed if there is anything else + in the string. */ + /* Note that we saw the quoted null so we can add one back at + the end of this function if there are no other characters + in the string, discard TEMP, and go on. The exception to + this is when we have "${@}" and $1 is '', since $@ needs + special handling. */ + if (tdesc && tdesc->word && (tdesc->flags & W_HASQUOTEDNULL) && QUOTED_NULL (temp)) + { + if (had_quoted_null_p) + *had_quoted_null_p = 1; + if (*quoted_dollar_at_p == 0) + { + free (temp); + tdesc->word = temp = (char *)NULL; + } + + } + + ret = tdesc; + goto return0; + + /* Do command or arithmetic substitution. */ + case LPAREN: + /* We have to extract the contents of this paren substitution. */ + t_index = zindex + 1; + temp = extract_command_subst (string, &t_index, 0); + zindex = t_index; + + /* For Posix.2-style `$(( ))' arithmetic substitution, + extract the expression and pass it to the evaluator. */ + if (temp && *temp == LPAREN) + { + char *temp2; + temp1 = temp + 1; + temp2 = savestring (temp1); + t_index = strlen (temp2) - 1; + + if (temp2[t_index] != RPAREN) + { + free (temp2); + goto comsub; + } + + /* Cut off ending `)' */ + temp2[t_index] = '\0'; + + if (chk_arithsub (temp2, t_index) == 0) + { + free (temp2); +#if 0 + internal_warning (_("future versions of the shell will force evaluation as an arithmetic substitution")); +#endif + goto comsub; + } + + /* Expand variables found inside the expression. */ + temp1 = expand_arith_string (temp2, Q_DOUBLE_QUOTES); + free (temp2); + +arithsub: + /* No error messages. */ + this_command_name = (char *)NULL; + number = evalexp (temp1, &expok); + free (temp); + free (temp1); + if (expok == 0) + { + if (interactive_shell == 0 && posixly_correct) + { + last_command_exit_value = EXECUTION_FAILURE; + return (&expand_wdesc_fatal); + } + else + return (&expand_wdesc_error); + } + temp = itos (number); + break; + } + +comsub: + if (pflags & PF_NOCOMSUB) + /* we need zindex+1 because string[zindex] == RPAREN */ + temp1 = substring (string, *sindex, zindex+1); + else + { + tdesc = command_substitute (temp, quoted); + temp1 = tdesc ? tdesc->word : (char *)NULL; + if (tdesc) + dispose_word_desc (tdesc); + } + FREE (temp); + temp = temp1; + break; + + /* Do POSIX.2d9-style arithmetic substitution. This will probably go + away in a future bash release. */ + case '[': + /* Extract the contents of this arithmetic substitution. */ + t_index = zindex + 1; + temp = extract_arithmetic_subst (string, &t_index); + zindex = t_index; + if (temp == 0) + { + temp = savestring (string); + if (expanded_something) + *expanded_something = 0; + goto return0; + } + + /* Do initial variable expansion. */ + temp1 = expand_arith_string (temp, Q_DOUBLE_QUOTES); + + goto arithsub; + + default: + /* Find the variable in VARIABLE_LIST. */ + temp = (char *)NULL; + + for (t_index = zindex; (c = string[zindex]) && legal_variable_char (c); zindex++) + ; + temp1 = (zindex > t_index) ? substring (string, t_index, zindex) : (char *)NULL; + + /* If this isn't a variable name, then just output the `$'. */ + if (temp1 == 0 || *temp1 == '\0') + { + FREE (temp1); + temp = (char *)xmalloc (2); + temp[0] = '$'; + temp[1] = '\0'; + if (expanded_something) + *expanded_something = 0; + goto return0; + } + + /* If the variable exists, return its value cell. */ + var = find_variable (temp1); + + if (var && invisible_p (var) == 0 && var_isset (var)) + { +#if defined (ARRAY_VARS) + if (assoc_p (var) || array_p (var)) + { + temp = array_p (var) ? array_reference (array_cell (var), 0) + : assoc_reference (assoc_cell (var), "0"); + if (temp) + temp = (*temp && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ? quote_string (temp) + : quote_escapes (temp); + else if (unbound_vars_is_error) + goto unbound_variable; + } + else +#endif + { + temp = value_cell (var); + + temp = (*temp && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ? quote_string (temp) + : quote_escapes (temp); + } + + free (temp1); + + goto return0; + } + else if (var = find_variable_last_nameref (temp1)) + { + temp = nameref_cell (var); +#if defined (ARRAY_VARS) + if (temp && *temp && valid_array_reference (temp)) + { + tdesc = parameter_brace_expand_word (temp, SPECIAL_VAR (temp, 0), quoted, pflags, (arrayind_t *)NULL); + if (tdesc == &expand_wdesc_error || tdesc == &expand_wdesc_fatal) + return (tdesc); + ret = tdesc; + goto return0; + } + else +#endif + /* y=2 ; typeset -n x=y; echo $x is not the same as echo $2 in ksh */ + if (temp && *temp && legal_identifier (temp) == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("%s: invalid variable name for name reference"), temp); + return (&expand_wdesc_error); /* XXX */ + } + else + temp = (char *)NULL; + } + + temp = (char *)NULL; + +unbound_variable: + if (unbound_vars_is_error) + { + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (temp1); + } + else + { + free (temp1); + goto return0; + } + + free (temp1); + last_command_exit_value = EXECUTION_FAILURE; + return ((unbound_vars_is_error && interactive_shell == 0) + ? &expand_wdesc_fatal + : &expand_wdesc_error); + } + + if (string[zindex]) + zindex++; + +return0: + *sindex = zindex; + + if (ret == 0) + { + ret = alloc_word_desc (); + ret->flags = tflag; /* XXX */ + ret->word = temp; + } + return ret; +} + +/* Make a word list which is the result of parameter and variable + expansion, command substitution, arithmetic substitution, and + quote removal of WORD. Return a pointer to a WORD_LIST which is + the result of the expansion. If WORD contains a null word, the + word list returned is also null. + + QUOTED contains flag values defined in shell.h. + + ISEXP is used to tell expand_word_internal that the word should be + treated as the result of an expansion. This has implications for + how IFS characters in the word are treated. + + CONTAINS_DOLLAR_AT and EXPANDED_SOMETHING are return values; when non-null + they point to an integer value which receives information about expansion. + CONTAINS_DOLLAR_AT gets non-zero if WORD contained "$@", else zero. + EXPANDED_SOMETHING get non-zero if WORD contained any parameter expansions, + else zero. + + This only does word splitting in the case of $@ expansion. In that + case, we split on ' '. */ + +/* Values for the local variable quoted_state. */ +#define UNQUOTED 0 +#define PARTIALLY_QUOTED 1 +#define WHOLLY_QUOTED 2 + +static WORD_LIST * +expand_word_internal (word, quoted, isexp, contains_dollar_at, expanded_something) + WORD_DESC *word; + int quoted, isexp; + int *contains_dollar_at; + int *expanded_something; +{ + WORD_LIST *list; + WORD_DESC *tword; + + /* The intermediate string that we build while expanding. */ + char *istring; + + /* The current size of the above object. */ + int istring_size; + + /* Index into ISTRING. */ + int istring_index; + + /* Temporary string storage. */ + char *temp, *temp1; + + /* The text of WORD. */ + register char *string; + + /* The size of STRING. */ + size_t string_size; + + /* The index into STRING. */ + int sindex; + + /* This gets 1 if we see a $@ while quoted. */ + int quoted_dollar_at; + + /* One of UNQUOTED, PARTIALLY_QUOTED, or WHOLLY_QUOTED, depending on + whether WORD contains no quoting characters, a partially quoted + string (e.g., "xx"ab), or is fully quoted (e.g., "xxab"). */ + int quoted_state; + + /* State flags */ + int had_quoted_null; + int has_dollar_at, temp_has_dollar_at; + int split_on_spaces; + int tflag; + int pflags; /* flags passed to param_expand */ + + int assignoff; /* If assignment, offset of `=' */ + + register unsigned char c; /* Current character. */ + int t_index; /* For calls to string_extract_xxx. */ + + char twochars[2]; + + DECLARE_MBSTATE; + + istring = (char *)xmalloc (istring_size = DEFAULT_INITIAL_ARRAY_SIZE); + istring[istring_index = 0] = '\0'; + quoted_dollar_at = had_quoted_null = has_dollar_at = 0; + split_on_spaces = 0; + quoted_state = UNQUOTED; + + string = word->word; + if (string == 0) + goto finished_with_string; + /* Don't need the string length for the SADD... and COPY_ macros unless + multibyte characters are possible. */ + string_size = (MB_CUR_MAX > 1) ? strlen (string) : 1; + + if (contains_dollar_at) + *contains_dollar_at = 0; + + assignoff = -1; + + /* Begin the expansion. */ + + for (sindex = 0; ;) + { + c = string[sindex]; + + /* Case on top-level character. */ + switch (c) + { + case '\0': + goto finished_with_string; + + case CTLESC: + sindex++; +#if HANDLE_MULTIBYTE + if (MB_CUR_MAX > 1 && string[sindex]) + { + SADD_MBQCHAR_BODY(temp, string, sindex, string_size); + } + else +#endif + { + temp = (char *)xmalloc (3); + temp[0] = CTLESC; + temp[1] = c = string[sindex]; + temp[2] = '\0'; + } + +dollar_add_string: + if (string[sindex]) + sindex++; + +add_string: + if (temp) + { + istring = sub_append_string (temp, istring, &istring_index, &istring_size); + temp = (char *)0; + } + + break; + +#if defined (PROCESS_SUBSTITUTION) + /* Process substitution. */ + case '<': + case '>': + { + if (string[++sindex] != LPAREN || (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || (word->flags & (W_DQUOTE|W_NOPROCSUB)) || posixly_correct) + { + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + else + t_index = sindex + 1; /* skip past both '<' and LPAREN */ + + temp1 = extract_process_subst (string, (c == '<') ? "<(" : ">(", &t_index); /*))*/ + sindex = t_index; + + /* If the process substitution specification is `<()', we want to + open the pipe for writing in the child and produce output; if + it is `>()', we want to open the pipe for reading in the child + and consume input. */ + temp = temp1 ? process_substitute (temp1, (c == '>')) : (char *)0; + + FREE (temp1); + + goto dollar_add_string; + } +#endif /* PROCESS_SUBSTITUTION */ + + case '=': + /* Posix.2 section 3.6.1 says that tildes following `=' in words + which are not assignment statements are not expanded. If the + shell isn't in posix mode, though, we perform tilde expansion + on `likely candidate' unquoted assignment statements (flags + include W_ASSIGNMENT but not W_QUOTED). A likely candidate + contains an unquoted :~ or =~. Something to think about: we + now have a flag that says to perform tilde expansion on arguments + to `assignment builtins' like declare and export that look like + assignment statements. We now do tilde expansion on such words + even in POSIX mode. */ + if (word->flags & (W_ASSIGNRHS|W_NOTILDE)) + { + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c)) + goto add_ifs_character; + else + goto add_character; + } + /* If we're not in posix mode or forcing assignment-statement tilde + expansion, note where the `=' appears in the word and prepare to + do tilde expansion following the first `='. */ + if ((word->flags & W_ASSIGNMENT) && + (posixly_correct == 0 || (word->flags & W_TILDEEXP)) && + assignoff == -1 && sindex > 0) + assignoff = sindex; + if (sindex == assignoff && string[sindex+1] == '~') /* XXX */ + word->flags |= W_ITILDE; +#if 0 + else if ((word->flags & W_ASSIGNMENT) && + (posixly_correct == 0 || (word->flags & W_TILDEEXP)) && + string[sindex+1] == '~') + word->flags |= W_ITILDE; +#endif + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c)) + goto add_ifs_character; + else + goto add_character; + + case ':': + if (word->flags & W_NOTILDE) + { + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c)) + goto add_ifs_character; + else + goto add_character; + } + + if ((word->flags & (W_ASSIGNMENT|W_ASSIGNRHS|W_TILDEEXP)) && + string[sindex+1] == '~') + word->flags |= W_ITILDE; + + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c)) + goto add_ifs_character; + else + goto add_character; + + case '~': + /* If the word isn't supposed to be tilde expanded, or we're not + at the start of a word or after an unquoted : or = in an + assignment statement, we don't do tilde expansion. */ + if ((word->flags & (W_NOTILDE|W_DQUOTE)) || + (sindex > 0 && ((word->flags & W_ITILDE) == 0)) || + (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + { + word->flags &= ~W_ITILDE; + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c) && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) == 0) + goto add_ifs_character; + else + goto add_character; + } + + if (word->flags & W_ASSIGNRHS) + tflag = 2; + else if (word->flags & (W_ASSIGNMENT|W_TILDEEXP)) + tflag = 1; + else + tflag = 0; + + temp = bash_tilde_find_word (string + sindex, tflag, &t_index); + + word->flags &= ~W_ITILDE; + + if (temp && *temp && t_index > 0) + { + temp1 = bash_tilde_expand (temp, tflag); + if (temp1 && *temp1 == '~' && STREQ (temp, temp1)) + { + FREE (temp); + FREE (temp1); + goto add_character; /* tilde expansion failed */ + } + free (temp); + temp = temp1; + sindex += t_index; + goto add_quoted_string; /* XXX was add_string */ + } + else + { + FREE (temp); + goto add_character; + } + + case '$': + if (expanded_something) + *expanded_something = 1; + + temp_has_dollar_at = 0; + pflags = (word->flags & W_NOCOMSUB) ? PF_NOCOMSUB : 0; + if (word->flags & W_NOSPLIT2) + pflags |= PF_NOSPLIT2; + if (word->flags & W_ASSIGNRHS) + pflags |= PF_ASSIGNRHS; + tword = param_expand (string, &sindex, quoted, expanded_something, + &temp_has_dollar_at, "ed_dollar_at, + &had_quoted_null, pflags); + has_dollar_at += temp_has_dollar_at; + split_on_spaces += (tword->flags & W_SPLITSPACE); + + if (tword == &expand_wdesc_error || tword == &expand_wdesc_fatal) + { + free (string); + free (istring); + return ((tword == &expand_wdesc_error) ? &expand_word_error + : &expand_word_fatal); + } + if (contains_dollar_at && has_dollar_at) + *contains_dollar_at = 1; + + if (tword && (tword->flags & W_HASQUOTEDNULL)) + had_quoted_null = 1; + + temp = tword ? tword->word : (char *)NULL; + dispose_word_desc (tword); + + /* Kill quoted nulls; we will add them back at the end of + expand_word_internal if nothing else in the string */ + if (had_quoted_null && temp && QUOTED_NULL (temp)) + { + FREE (temp); + temp = (char *)NULL; + } + + goto add_string; + break; + + case '`': /* Backquoted command substitution. */ + { + t_index = sindex++; + + temp = string_extract (string, &sindex, "`", SX_REQMATCH); + /* The test of sindex against t_index is to allow bare instances of + ` to pass through, for backwards compatibility. */ + if (temp == &extract_string_error || temp == &extract_string_fatal) + { + if (sindex - 1 == t_index) + { + sindex = t_index; + goto add_character; + } + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("bad substitution: no closing \"`\" in %s") , string+t_index); + free (string); + free (istring); + return ((temp == &extract_string_error) ? &expand_word_error + : &expand_word_fatal); + } + + if (expanded_something) + *expanded_something = 1; + + if (word->flags & W_NOCOMSUB) + /* sindex + 1 because string[sindex] == '`' */ + temp1 = substring (string, t_index, sindex + 1); + else + { + de_backslash (temp); + tword = command_substitute (temp, quoted); + temp1 = tword ? tword->word : (char *)NULL; + if (tword) + dispose_word_desc (tword); + } + FREE (temp); + temp = temp1; + goto dollar_add_string; + } + + case '\\': + if (string[sindex + 1] == '\n') + { + sindex += 2; + continue; + } + + c = string[++sindex]; + + if (quoted & Q_HERE_DOCUMENT) + tflag = CBSHDOC; + else if (quoted & Q_DOUBLE_QUOTES) + tflag = CBSDQUOTE; + else + tflag = 0; + + /* From Posix discussion on austin-group list: Backslash escaping + a } in ${...} is removed. Issue 0000221 */ + if ((quoted & Q_DOLBRACE) && c == RBRACE) + { + SCOPY_CHAR_I (twochars, CTLESC, c, string, sindex, string_size); + } + /* This is the fix for " $@\ " */ + else if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && ((sh_syntaxtab[c] & tflag) == 0) && isexp == 0 && isifs (c)) + { + RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, + DEFAULT_ARRAY_SIZE); + istring[istring_index++] = CTLESC; + istring[istring_index++] = '\\'; + istring[istring_index] = '\0'; + + SCOPY_CHAR_I (twochars, CTLESC, c, string, sindex, string_size); + } + else if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && ((sh_syntaxtab[c] & tflag) == 0)) + { + SCOPY_CHAR_I (twochars, '\\', c, string, sindex, string_size); + } + else if (c == 0) + { + c = CTLNUL; + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + else + { + SCOPY_CHAR_I (twochars, CTLESC, c, string, sindex, string_size); + } + + sindex++; +add_twochars: + /* BEFORE jumping here, we need to increment sindex if appropriate */ + RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, + DEFAULT_ARRAY_SIZE); + istring[istring_index++] = twochars[0]; + istring[istring_index++] = twochars[1]; + istring[istring_index] = '\0'; + + break; + + case '"': + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + goto add_character; + + t_index = ++sindex; + temp = string_extract_double_quoted (string, &sindex, 0); + + /* If the quotes surrounded the entire string, then the + whole word was quoted. */ + quoted_state = (t_index == 1 && string[sindex] == '\0') + ? WHOLLY_QUOTED + : PARTIALLY_QUOTED; + + if (temp && *temp) + { + tword = alloc_word_desc (); + tword->word = temp; + + temp = (char *)NULL; + + temp_has_dollar_at = 0; /* XXX */ + /* Need to get W_HASQUOTEDNULL flag through this function. */ + list = expand_word_internal (tword, Q_DOUBLE_QUOTES, 0, &temp_has_dollar_at, (int *)NULL); + has_dollar_at += temp_has_dollar_at; + + if (list == &expand_word_error || list == &expand_word_fatal) + { + free (istring); + free (string); + /* expand_word_internal has already freed temp_word->word + for us because of the way it prints error messages. */ + tword->word = (char *)NULL; + dispose_word (tword); + return list; + } + + dispose_word (tword); + + /* "$@" (a double-quoted dollar-at) expands into nothing, + not even a NULL word, when there are no positional + parameters. */ + if (list == 0 && has_dollar_at) + { + quoted_dollar_at++; + break; + } + + /* If we get "$@", we know we have expanded something, so we + need to remember it for the final split on $IFS. This is + a special case; it's the only case where a quoted string + can expand into more than one word. It's going to come back + from the above call to expand_word_internal as a list with + a single word, in which all characters are quoted and + separated by blanks. What we want to do is to turn it back + into a list for the next piece of code. */ + if (list) + dequote_list (list); + + if (list && list->word && (list->word->flags & W_HASQUOTEDNULL)) + had_quoted_null = 1; /* XXX */ + + if (has_dollar_at) + { + quoted_dollar_at++; + if (contains_dollar_at) + *contains_dollar_at = 1; + if (expanded_something) + *expanded_something = 1; + } + } + else + { + /* What we have is "". This is a minor optimization. */ + FREE (temp); + list = (WORD_LIST *)NULL; + } + + /* The code above *might* return a list (consider the case of "$@", + where it returns "$1", "$2", etc.). We can't throw away the + rest of the list, and we have to make sure each word gets added + as quoted. We test on tresult->next: if it is non-NULL, we + quote the whole list, save it to a string with string_list, and + add that string. We don't need to quote the results of this + (and it would be wrong, since that would quote the separators + as well), so we go directly to add_string. */ + if (list) + { + if (list->next) + { + /* Testing quoted_dollar_at makes sure that "$@" is + split correctly when $IFS does not contain a space. */ + temp = quoted_dollar_at + ? string_list_dollar_at (list, Q_DOUBLE_QUOTES) + : string_list (quote_list (list)); + dispose_words (list); + goto add_string; + } + else + { + temp = savestring (list->word->word); + tflag = list->word->flags; + dispose_words (list); + + /* If the string is not a quoted null string, we want + to remove any embedded unquoted CTLNUL characters. + We do not want to turn quoted null strings back into + the empty string, though. We do this because we + want to remove any quoted nulls from expansions that + contain other characters. For example, if we have + x"$*"y or "x$*y" and there are no positional parameters, + the $* should expand into nothing. */ + /* We use the W_HASQUOTEDNULL flag to differentiate the + cases: a quoted null character as above and when + CTLNUL is contained in the (non-null) expansion + of some variable. We use the had_quoted_null flag to + pass the value through this function to its caller. */ + if ((tflag & W_HASQUOTEDNULL) && QUOTED_NULL (temp) == 0) + remove_quoted_nulls (temp); /* XXX */ + } + } + else + temp = (char *)NULL; + + /* We do not want to add quoted nulls to strings that are only + partially quoted; we can throw them away. The exception to + this is when we are going to be performing word splitting, + since we have to preserve a null argument if the next character + will cause word splitting. */ + if (temp == 0 && quoted_state == PARTIALLY_QUOTED && (word->flags & (W_NOSPLIT|W_NOSPLIT2))) + continue; + + add_quoted_string: + + if (temp) + { + temp1 = temp; + temp = quote_string (temp); + free (temp1); + goto add_string; + } + else + { + /* Add NULL arg. */ + c = CTLNUL; + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + + /* break; */ + + case '\'': + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + goto add_character; + + t_index = ++sindex; + temp = string_extract_single_quoted (string, &sindex); + + /* If the entire STRING was surrounded by single quotes, + then the string is wholly quoted. */ + quoted_state = (t_index == 1 && string[sindex] == '\0') + ? WHOLLY_QUOTED + : PARTIALLY_QUOTED; + + /* If all we had was '', it is a null expansion. */ + if (*temp == '\0') + { + free (temp); + temp = (char *)NULL; + } + else + remove_quoted_escapes (temp); /* ??? */ + + /* We do not want to add quoted nulls to strings that are only + partially quoted; such nulls are discarded. */ + if (temp == 0 && (quoted_state == PARTIALLY_QUOTED)) + continue; + + /* If we have a quoted null expansion, add a quoted NULL to istring. */ + if (temp == 0) + { + c = CTLNUL; + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + else + goto add_quoted_string; + + /* break; */ + + default: + /* This is the fix for " $@ " */ + add_ifs_character: + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || (isexp == 0 && isifs (c))) + { + if (string[sindex]) /* from old goto dollar_add_string */ + sindex++; + if (c == 0) + { + c = CTLNUL; + goto add_character; + } + else + { +#if HANDLE_MULTIBYTE + if (MB_CUR_MAX > 1) + sindex--; + + if (MB_CUR_MAX > 1) + { + SADD_MBQCHAR_BODY(temp, string, sindex, string_size); + } + else +#endif + { + twochars[0] = CTLESC; + twochars[1] = c; + goto add_twochars; + } + } + } + + SADD_MBCHAR (temp, string, sindex, string_size); + + add_character: + RESIZE_MALLOCED_BUFFER (istring, istring_index, 1, istring_size, + DEFAULT_ARRAY_SIZE); + istring[istring_index++] = c; + istring[istring_index] = '\0'; + + /* Next character. */ + sindex++; + } + } + +finished_with_string: + /* OK, we're ready to return. If we have a quoted string, and + quoted_dollar_at is not set, we do no splitting at all; otherwise + we split on ' '. The routines that call this will handle what to + do if nothing has been expanded. */ + + /* Partially and wholly quoted strings which expand to the empty + string are retained as an empty arguments. Unquoted strings + which expand to the empty string are discarded. The single + exception is the case of expanding "$@" when there are no + positional parameters. In that case, we discard the expansion. */ + + /* Because of how the code that handles "" and '' in partially + quoted strings works, we need to make ISTRING into a QUOTED_NULL + if we saw quoting characters, but the expansion was empty. + "" and '' are tossed away before we get to this point when + processing partially quoted strings. This makes "" and $xxx"" + equivalent when xxx is unset. We also look to see whether we + saw a quoted null from a ${} expansion and add one back if we + need to. */ + + /* If we expand to nothing and there were no single or double quotes + in the word, we throw it away. Otherwise, we return a NULL word. + The single exception is for $@ surrounded by double quotes when + there are no positional parameters. In that case, we also throw + the word away. */ + + if (*istring == '\0') + { + if (quoted_dollar_at == 0 && (had_quoted_null || quoted_state == PARTIALLY_QUOTED)) + { + istring[0] = CTLNUL; + istring[1] = '\0'; + tword = make_bare_word (istring); + tword->flags |= W_HASQUOTEDNULL; /* XXX */ + list = make_word_list (tword, (WORD_LIST *)NULL); + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + tword->flags |= W_QUOTED; + } + /* According to sh, ksh, and Posix.2, if a word expands into nothing + and a double-quoted "$@" appears anywhere in it, then the entire + word is removed. */ + else if (quoted_state == UNQUOTED || quoted_dollar_at) + list = (WORD_LIST *)NULL; +#if 0 + else + { + tword = make_bare_word (istring); + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + tword->flags |= W_QUOTED; + list = make_word_list (tword, (WORD_LIST *)NULL); + } +#else + else + list = (WORD_LIST *)NULL; +#endif + } + else if (word->flags & W_NOSPLIT) + { + tword = make_bare_word (istring); + if (word->flags & W_ASSIGNMENT) + tword->flags |= W_ASSIGNMENT; /* XXX */ + if (word->flags & W_COMPASSIGN) + tword->flags |= W_COMPASSIGN; /* XXX */ + if (word->flags & W_NOGLOB) + tword->flags |= W_NOGLOB; /* XXX */ + if (word->flags & W_NOBRACE) + tword->flags |= W_NOBRACE; /* XXX */ + if (word->flags & W_NOEXPAND) + tword->flags |= W_NOEXPAND; /* XXX */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + tword->flags |= W_QUOTED; + if (had_quoted_null && QUOTED_NULL (istring)) + tword->flags |= W_HASQUOTEDNULL; + list = make_word_list (tword, (WORD_LIST *)NULL); + } + else + { + char *ifs_chars; + + ifs_chars = (quoted_dollar_at || has_dollar_at) ? ifs_value : (char *)NULL; + + /* If we have $@, we need to split the results no matter what. If + IFS is unset or NULL, string_list_dollar_at has separated the + positional parameters with a space, so we split on space (we have + set ifs_chars to " \t\n" above if ifs is unset). If IFS is set, + string_list_dollar_at has separated the positional parameters + with the first character of $IFS, so we split on $IFS. If + SPLIT_ON_SPACES is set, we expanded $* (unquoted) with IFS either + unset or null, and we want to make sure that we split on spaces + regardless of what else has happened to IFS since the expansion. */ + if (split_on_spaces) + list = list_string (istring, " ", 1); /* XXX quoted == 1? */ + else if (has_dollar_at && ifs_chars) + list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1); + else + { + tword = make_bare_word (istring); + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) || (quoted_state == WHOLLY_QUOTED)) + tword->flags |= W_QUOTED; + if (word->flags & W_ASSIGNMENT) + tword->flags |= W_ASSIGNMENT; + if (word->flags & W_COMPASSIGN) + tword->flags |= W_COMPASSIGN; + if (word->flags & W_NOGLOB) + tword->flags |= W_NOGLOB; + if (word->flags & W_NOBRACE) + tword->flags |= W_NOBRACE; + if (word->flags & W_NOEXPAND) + tword->flags |= W_NOEXPAND; + if (had_quoted_null && QUOTED_NULL (istring)) + tword->flags |= W_HASQUOTEDNULL; /* XXX */ + list = make_word_list (tword, (WORD_LIST *)NULL); + } + } + + free (istring); + return (list); +} + +/* **************************************************************** */ +/* */ +/* Functions for Quote Removal */ +/* */ +/* **************************************************************** */ + +/* Perform quote removal on STRING. If QUOTED > 0, assume we are obeying the + backslash quoting rules for within double quotes or a here document. */ +char * +string_quote_removal (string, quoted) + char *string; + int quoted; +{ + size_t slen; + char *r, *result_string, *temp, *send; + int sindex, tindex, dquote; + unsigned char c; + DECLARE_MBSTATE; + + /* The result can be no longer than the original string. */ + slen = strlen (string); + send = string + slen; + + r = result_string = (char *)xmalloc (slen + 1); + + for (dquote = sindex = 0; c = string[sindex];) + { + switch (c) + { + case '\\': + c = string[++sindex]; + if (c == 0) + { + *r++ = '\\'; + break; + } + if (((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || dquote) && (sh_syntaxtab[c] & CBSDQUOTE) == 0) + *r++ = '\\'; + /* FALLTHROUGH */ + + default: + SCOPY_CHAR_M (r, string, send, sindex); + break; + + case '\'': + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || dquote) + { + *r++ = c; + sindex++; + break; + } + tindex = sindex + 1; + temp = string_extract_single_quoted (string, &tindex); + if (temp) + { + strcpy (r, temp); + r += strlen (r); + free (temp); + } + sindex = tindex; + break; + + case '"': + dquote = 1 - dquote; + sindex++; + break; + } + } + *r = '\0'; + return (result_string); +} + +#if 0 +/* UNUSED */ +/* Perform quote removal on word WORD. This allocates and returns a new + WORD_DESC *. */ +WORD_DESC * +word_quote_removal (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_DESC *w; + char *t; + + t = string_quote_removal (word->word, quoted); + w = alloc_word_desc (); + w->word = t ? t : savestring (""); + return (w); +} + +/* Perform quote removal on all words in LIST. If QUOTED is non-zero, + the members of the list are treated as if they are surrounded by + double quotes. Return a new list, or NULL if LIST is NULL. */ +WORD_LIST * +word_list_quote_removal (list, quoted) + WORD_LIST *list; + int quoted; +{ + WORD_LIST *result, *t, *tresult, *e; + + for (t = list, result = (WORD_LIST *)NULL; t; t = t->next) + { + tresult = make_word_list (word_quote_removal (t->word, quoted), (WORD_LIST *)NULL); +#if 0 + result = (WORD_LIST *) list_append (result, tresult); +#else + if (result == 0) + result = e = tresult; + else + { + e->next = tresult; + while (e->next) + e = e->next; + } +#endif + } + return (result); +} +#endif + +/******************************************* + * * + * Functions to perform word splitting * + * * + *******************************************/ + +void +setifs (v) + SHELL_VAR *v; +{ + char *t; + unsigned char uc; + + ifs_var = v; + ifs_value = (v && value_cell (v)) ? value_cell (v) : " \t\n"; + + ifs_is_set = ifs_var != 0; + ifs_is_null = ifs_is_set && (*ifs_value == 0); + + /* Should really merge ifs_cmap with sh_syntaxtab. XXX - doesn't yet + handle multibyte chars in IFS */ + memset (ifs_cmap, '\0', sizeof (ifs_cmap)); + for (t = ifs_value ; t && *t; t++) + { + uc = *t; + ifs_cmap[uc] = 1; + } + +#if defined (HANDLE_MULTIBYTE) + if (ifs_value == 0) + { + ifs_firstc[0] = '\0'; + ifs_firstc_len = 1; + } + else + { + size_t ifs_len; + ifs_len = strnlen (ifs_value, MB_CUR_MAX); + ifs_firstc_len = MBLEN (ifs_value, ifs_len); + if (ifs_firstc_len == 1 || ifs_firstc_len == 0 || MB_INVALIDCH (ifs_firstc_len)) + { + ifs_firstc[0] = ifs_value[0]; + ifs_firstc[1] = '\0'; + ifs_firstc_len = 1; + } + else + memcpy (ifs_firstc, ifs_value, ifs_firstc_len); + } +#else + ifs_firstc = ifs_value ? *ifs_value : 0; +#endif +} + +char * +getifs () +{ + return ifs_value; +} + +/* This splits a single word into a WORD LIST on $IFS, but only if the word + is not quoted. list_string () performs quote removal for us, even if we + don't do any splitting. */ +WORD_LIST * +word_split (w, ifs_chars) + WORD_DESC *w; + char *ifs_chars; +{ + WORD_LIST *result; + + if (w) + { + char *xifs; + + xifs = ((w->flags & W_QUOTED) || ifs_chars == 0) ? "" : ifs_chars; + result = list_string (w->word, xifs, w->flags & W_QUOTED); + } + else + result = (WORD_LIST *)NULL; + + return (result); +} + +/* Perform word splitting on LIST and return the RESULT. It is possible + to return (WORD_LIST *)NULL. */ +static WORD_LIST * +word_list_split (list) + WORD_LIST *list; +{ + WORD_LIST *result, *t, *tresult, *e; + + for (t = list, result = (WORD_LIST *)NULL; t; t = t->next) + { + tresult = word_split (t->word, ifs_value); + if (result == 0) + result = e = tresult; + else + { + e->next = tresult; + while (e->next) + e = e->next; + } + } + return (result); +} + +/************************************************** + * * + * Functions to expand an entire WORD_LIST * + * * + **************************************************/ + +/* Do any word-expansion-specific cleanup and jump to top_level */ +static void +exp_jump_to_top_level (v) + int v; +{ + set_pipestatus_from_exit (last_command_exit_value); + + /* Cleanup code goes here. */ + expand_no_split_dollar_star = 0; /* XXX */ + expanding_redir = 0; + assigning_in_environment = 0; + + if (parse_and_execute_level == 0) + top_level_cleanup (); /* from sig.c */ + + jump_to_top_level (v); +} + +/* Put NLIST (which is a WORD_LIST * of only one element) at the front of + ELIST, and set ELIST to the new list. */ +#define PREPEND_LIST(nlist, elist) \ + do { nlist->next = elist; elist = nlist; } while (0) + +/* Separate out any initial variable assignments from TLIST. If set -k has + been executed, remove all assignment statements from TLIST. Initial + variable assignments and other environment assignments are placed + on SUBST_ASSIGN_VARLIST. */ +static WORD_LIST * +separate_out_assignments (tlist) + WORD_LIST *tlist; +{ + register WORD_LIST *vp, *lp; + + if (tlist == 0) + return ((WORD_LIST *)NULL); + + if (subst_assign_varlist) + dispose_words (subst_assign_varlist); /* Clean up after previous error */ + + subst_assign_varlist = (WORD_LIST *)NULL; + vp = lp = tlist; + + /* Separate out variable assignments at the start of the command. + Loop invariant: vp->next == lp + Loop postcondition: + lp = list of words left after assignment statements skipped + tlist = original list of words + */ + while (lp && (lp->word->flags & W_ASSIGNMENT)) + { + vp = lp; + lp = lp->next; + } + + /* If lp != tlist, we have some initial assignment statements. + We make SUBST_ASSIGN_VARLIST point to the list of assignment + words and TLIST point to the remaining words. */ + if (lp != tlist) + { + subst_assign_varlist = tlist; + /* ASSERT(vp->next == lp); */ + vp->next = (WORD_LIST *)NULL; /* terminate variable list */ + tlist = lp; /* remainder of word list */ + } + + /* vp == end of variable list */ + /* tlist == remainder of original word list without variable assignments */ + if (!tlist) + /* All the words in tlist were assignment statements */ + return ((WORD_LIST *)NULL); + + /* ASSERT(tlist != NULL); */ + /* ASSERT((tlist->word->flags & W_ASSIGNMENT) == 0); */ + + /* If the -k option is in effect, we need to go through the remaining + words, separate out the assignment words, and place them on + SUBST_ASSIGN_VARLIST. */ + if (place_keywords_in_env) + { + WORD_LIST *tp; /* tp == running pointer into tlist */ + + tp = tlist; + lp = tlist->next; + + /* Loop Invariant: tp->next == lp */ + /* Loop postcondition: tlist == word list without assignment statements */ + while (lp) + { + if (lp->word->flags & W_ASSIGNMENT) + { + /* Found an assignment statement, add this word to end of + subst_assign_varlist (vp). */ + if (!subst_assign_varlist) + subst_assign_varlist = vp = lp; + else + { + vp->next = lp; + vp = lp; + } + + /* Remove the word pointed to by LP from TLIST. */ + tp->next = lp->next; + /* ASSERT(vp == lp); */ + lp->next = (WORD_LIST *)NULL; + lp = tp->next; + } + else + { + tp = lp; + lp = lp->next; + } + } + } + return (tlist); +} + +#define WEXP_VARASSIGN 0x001 +#define WEXP_BRACEEXP 0x002 +#define WEXP_TILDEEXP 0x004 +#define WEXP_PARAMEXP 0x008 +#define WEXP_PATHEXP 0x010 + +/* All of the expansions, including variable assignments at the start of + the list. */ +#define WEXP_ALL (WEXP_VARASSIGN|WEXP_BRACEEXP|WEXP_TILDEEXP|WEXP_PARAMEXP|WEXP_PATHEXP) + +/* All of the expansions except variable assignments at the start of + the list. */ +#define WEXP_NOVARS (WEXP_BRACEEXP|WEXP_TILDEEXP|WEXP_PARAMEXP|WEXP_PATHEXP) + +/* All of the `shell expansions': brace expansion, tilde expansion, parameter + expansion, command substitution, arithmetic expansion, word splitting, and + quote removal. */ +#define WEXP_SHELLEXP (WEXP_BRACEEXP|WEXP_TILDEEXP|WEXP_PARAMEXP) + +/* Take the list of words in LIST and do the various substitutions. Return + a new list of words which is the expanded list, and without things like + variable assignments. */ + +WORD_LIST * +expand_words (list) + WORD_LIST *list; +{ + return (expand_word_list_internal (list, WEXP_ALL)); +} + +/* Same as expand_words (), but doesn't hack variable or environment + variables. */ +WORD_LIST * +expand_words_no_vars (list) + WORD_LIST *list; +{ + return (expand_word_list_internal (list, WEXP_NOVARS)); +} + +WORD_LIST * +expand_words_shellexp (list) + WORD_LIST *list; +{ + return (expand_word_list_internal (list, WEXP_SHELLEXP)); +} + +static WORD_LIST * +glob_expand_word_list (tlist, eflags) + WORD_LIST *tlist; + int eflags; +{ + char **glob_array, *temp_string; + register int glob_index; + WORD_LIST *glob_list, *output_list, *disposables, *next; + WORD_DESC *tword; + + output_list = disposables = (WORD_LIST *)NULL; + glob_array = (char **)NULL; + while (tlist) + { + /* For each word, either globbing is attempted or the word is + added to orig_list. If globbing succeeds, the results are + added to orig_list and the word (tlist) is added to the list + of disposable words. If globbing fails and failed glob + expansions are left unchanged (the shell default), the + original word is added to orig_list. If globbing fails and + failed glob expansions are removed, the original word is + added to the list of disposable words. orig_list ends up + in reverse order and requires a call to REVERSE_LIST to + be set right. After all words are examined, the disposable + words are freed. */ + next = tlist->next; + + /* If the word isn't an assignment and contains an unquoted + pattern matching character, then glob it. */ + if ((tlist->word->flags & W_NOGLOB) == 0 && + unquoted_glob_pattern_p (tlist->word->word)) + { + glob_array = shell_glob_filename (tlist->word->word); + + /* Handle error cases. + I don't think we should report errors like "No such file + or directory". However, I would like to report errors + like "Read failed". */ + + if (glob_array == 0 || GLOB_FAILED (glob_array)) + { + glob_array = (char **)xmalloc (sizeof (char *)); + glob_array[0] = (char *)NULL; + } + + /* Dequote the current word in case we have to use it. */ + if (glob_array[0] == NULL) + { + temp_string = dequote_string (tlist->word->word); + free (tlist->word->word); + tlist->word->word = temp_string; + } + + /* Make the array into a word list. */ + glob_list = (WORD_LIST *)NULL; + for (glob_index = 0; glob_array[glob_index]; glob_index++) + { + tword = make_bare_word (glob_array[glob_index]); + glob_list = make_word_list (tword, glob_list); + } + + if (glob_list) + { + output_list = (WORD_LIST *)list_append (glob_list, output_list); + PREPEND_LIST (tlist, disposables); + } + else if (fail_glob_expansion != 0) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("no match: %s"), tlist->word->word); + exp_jump_to_top_level (DISCARD); + } + else if (allow_null_glob_expansion == 0) + { + /* Failed glob expressions are left unchanged. */ + PREPEND_LIST (tlist, output_list); + } + else + { + /* Failed glob expressions are removed. */ + PREPEND_LIST (tlist, disposables); + } + } + else + { + /* Dequote the string. */ + temp_string = dequote_string (tlist->word->word); + free (tlist->word->word); + tlist->word->word = temp_string; + PREPEND_LIST (tlist, output_list); + } + + strvec_dispose (glob_array); + glob_array = (char **)NULL; + + tlist = next; + } + + if (disposables) + dispose_words (disposables); + + if (output_list) + output_list = REVERSE_LIST (output_list, WORD_LIST *); + + return (output_list); +} + +#if defined (BRACE_EXPANSION) +static WORD_LIST * +brace_expand_word_list (tlist, eflags) + WORD_LIST *tlist; + int eflags; +{ + register char **expansions; + char *temp_string; + WORD_LIST *disposables, *output_list, *next; + WORD_DESC *w; + int eindex; + + for (disposables = output_list = (WORD_LIST *)NULL; tlist; tlist = next) + { + next = tlist->next; + + if (tlist->word->flags & W_NOBRACE) + { +/*itrace("brace_expand_word_list: %s: W_NOBRACE", tlist->word->word);*/ + PREPEND_LIST (tlist, output_list); + continue; + } + + if ((tlist->word->flags & (W_COMPASSIGN|W_ASSIGNARG)) == (W_COMPASSIGN|W_ASSIGNARG)) + { +/*itrace("brace_expand_word_list: %s: W_COMPASSIGN|W_ASSIGNARG", tlist->word->word);*/ + PREPEND_LIST (tlist, output_list); + continue; + } + + /* Only do brace expansion if the word has a brace character. If + not, just add the word list element to BRACES and continue. In + the common case, at least when running shell scripts, this will + degenerate to a bunch of calls to `mbschr', and then what is + basically a reversal of TLIST into BRACES, which is corrected + by a call to REVERSE_LIST () on BRACES when the end of TLIST + is reached. */ + if (mbschr (tlist->word->word, LBRACE)) + { + expansions = brace_expand (tlist->word->word); + + for (eindex = 0; temp_string = expansions[eindex]; eindex++) + { + w = alloc_word_desc (); + w->word = temp_string; + + /* If brace expansion didn't change the word, preserve + the flags. We may want to preserve the flags + unconditionally someday -- XXX */ + if (STREQ (temp_string, tlist->word->word)) + w->flags = tlist->word->flags; + else + w = make_word_flags (w, temp_string); + + output_list = make_word_list (w, output_list); + } + free (expansions); + + /* Add TLIST to the list of words to be freed after brace + expansion has been performed. */ + PREPEND_LIST (tlist, disposables); + } + else + PREPEND_LIST (tlist, output_list); + } + + if (disposables) + dispose_words (disposables); + + if (output_list) + output_list = REVERSE_LIST (output_list, WORD_LIST *); + + return (output_list); +} +#endif + +#if defined (ARRAY_VARS) +/* Take WORD, a compound associative array assignment, and internally run + 'declare -A w', where W is the variable name portion of WORD. */ +static int +make_internal_declare (word, option) + char *word; + char *option; +{ + int t; + WORD_LIST *wl; + WORD_DESC *w; + + w = make_word (word); + + t = assignment (w->word, 0); + w->word[t] = '\0'; + + wl = make_word_list (w, (WORD_LIST *)NULL); + wl = make_word_list (make_word (option), wl); + + return (declare_builtin (wl)); +} +#endif + +static WORD_LIST * +shell_expand_word_list (tlist, eflags) + WORD_LIST *tlist; + int eflags; +{ + WORD_LIST *expanded, *orig_list, *new_list, *next, *temp_list; + int expanded_something, has_dollar_at; + char *temp_string; + + /* We do tilde expansion all the time. This is what 1003.2 says. */ + new_list = (WORD_LIST *)NULL; + for (orig_list = tlist; tlist; tlist = next) + { + temp_string = tlist->word->word; + + next = tlist->next; + +#if defined (ARRAY_VARS) + /* If this is a compound array assignment to a builtin that accepts + such assignments (e.g., `declare'), take the assignment and perform + it separately, handling the semantics of declarations inside shell + functions. This avoids the double-evaluation of such arguments, + because `declare' does some evaluation of compound assignments on + its own. */ + if ((tlist->word->flags & (W_COMPASSIGN|W_ASSIGNARG)) == (W_COMPASSIGN|W_ASSIGNARG)) + { + int t; + char opts[8], opti; + + opti = 0; + if (tlist->word->flags & (W_ASSIGNASSOC|W_ASSNGLOBAL|W_ASSIGNARRAY)) + opts[opti++] = '-'; + + if ((tlist->word->flags & (W_ASSIGNASSOC|W_ASSNGLOBAL)) == (W_ASSIGNASSOC|W_ASSNGLOBAL)) + { + opts[opti++] = 'g'; + opts[opti++] = 'A'; + } + else if (tlist->word->flags & W_ASSIGNASSOC) + opts[opti++] = 'A'; + else if ((tlist->word->flags & (W_ASSIGNARRAY|W_ASSNGLOBAL)) == (W_ASSIGNARRAY|W_ASSNGLOBAL)) + { + opts[opti++] = 'g'; + opts[opti++] = 'a'; + } + else if (tlist->word->flags & W_ASSIGNARRAY) + opts[opti++] = 'a'; + else if (tlist->word->flags & W_ASSNGLOBAL) + opts[opti++] = 'g'; + +#if 0 + /* If we have special handling note the integer attribute */ + if (opti > 0 && (tlist->word->flags & W_ASSIGNINT)) + opts[opti++] = 'i'; +#endif + + opts[opti] = '\0'; + if (opti > 0) + make_internal_declare (tlist->word->word, opts); + + t = do_word_assignment (tlist->word, 0); + if (t == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + exp_jump_to_top_level (DISCARD); + } + + /* Now transform the word as ksh93 appears to do and go on */ + t = assignment (tlist->word->word, 0); + tlist->word->word[t] = '\0'; + tlist->word->flags &= ~(W_ASSIGNMENT|W_NOSPLIT|W_COMPASSIGN|W_ASSIGNARG|W_ASSIGNASSOC|W_ASSIGNARRAY); + } +#endif + + expanded_something = 0; + expanded = expand_word_internal + (tlist->word, 0, 0, &has_dollar_at, &expanded_something); + + if (expanded == &expand_word_error || expanded == &expand_word_fatal) + { + /* By convention, each time this error is returned, + tlist->word->word has already been freed. */ + tlist->word->word = (char *)NULL; + + /* Dispose our copy of the original list. */ + dispose_words (orig_list); + /* Dispose the new list we're building. */ + dispose_words (new_list); + + last_command_exit_value = EXECUTION_FAILURE; + if (expanded == &expand_word_error) + exp_jump_to_top_level (DISCARD); + else + exp_jump_to_top_level (FORCE_EOF); + } + + /* Don't split words marked W_NOSPLIT. */ + if (expanded_something && (tlist->word->flags & W_NOSPLIT) == 0) + { + temp_list = word_list_split (expanded); + dispose_words (expanded); + } + else + { + /* If no parameter expansion, command substitution, process + substitution, or arithmetic substitution took place, then + do not do word splitting. We still have to remove quoted + null characters from the result. */ + word_list_remove_quoted_nulls (expanded); + temp_list = expanded; + } + + expanded = REVERSE_LIST (temp_list, WORD_LIST *); + new_list = (WORD_LIST *)list_append (expanded, new_list); + } + + if (orig_list) + dispose_words (orig_list); + + if (new_list) + new_list = REVERSE_LIST (new_list, WORD_LIST *); + + return (new_list); +} + +/* The workhorse for expand_words () and expand_words_no_vars (). + First arg is LIST, a WORD_LIST of words. + Second arg EFLAGS is a flags word controlling which expansions are + performed. + + This does all of the substitutions: brace expansion, tilde expansion, + parameter expansion, command substitution, arithmetic expansion, + process substitution, word splitting, and pathname expansion, according + to the bits set in EFLAGS. Words with the W_QUOTED or W_NOSPLIT bits + set, or for which no expansion is done, do not undergo word splitting. + Words with the W_NOGLOB bit set do not undergo pathname expansion; words + with W_NOBRACE set do not undergo brace expansion (see + brace_expand_word_list above). */ +static WORD_LIST * +expand_word_list_internal (list, eflags) + WORD_LIST *list; + int eflags; +{ + WORD_LIST *new_list, *temp_list; + int tint; + + tempenv_assign_error = 0; + if (list == 0) + return ((WORD_LIST *)NULL); + + garglist = new_list = copy_word_list (list); + if (eflags & WEXP_VARASSIGN) + { + garglist = new_list = separate_out_assignments (new_list); + if (new_list == 0) + { + if (subst_assign_varlist) + { + /* All the words were variable assignments, so they are placed + into the shell's environment. */ + for (temp_list = subst_assign_varlist; temp_list; temp_list = temp_list->next) + { + this_command_name = (char *)NULL; /* no arithmetic errors */ + tint = do_word_assignment (temp_list->word, 0); + /* Variable assignment errors in non-interactive shells + running in Posix.2 mode cause the shell to exit. */ + if (tint == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + if (interactive_shell == 0 && posixly_correct) + exp_jump_to_top_level (FORCE_EOF); + else + exp_jump_to_top_level (DISCARD); + } + } + dispose_words (subst_assign_varlist); + subst_assign_varlist = (WORD_LIST *)NULL; + } + return ((WORD_LIST *)NULL); + } + } + + /* Begin expanding the words that remain. The expansions take place on + things that aren't really variable assignments. */ + +#if defined (BRACE_EXPANSION) + /* Do brace expansion on this word if there are any brace characters + in the string. */ + if ((eflags & WEXP_BRACEEXP) && brace_expansion && new_list) + new_list = brace_expand_word_list (new_list, eflags); +#endif /* BRACE_EXPANSION */ + + /* Perform the `normal' shell expansions: tilde expansion, parameter and + variable substitution, command substitution, arithmetic expansion, + and word splitting. */ + new_list = shell_expand_word_list (new_list, eflags); + + /* Okay, we're almost done. Now let's just do some filename + globbing. */ + if (new_list) + { + if ((eflags & WEXP_PATHEXP) && disallow_filename_globbing == 0) + /* Glob expand the word list unless globbing has been disabled. */ + new_list = glob_expand_word_list (new_list, eflags); + else + /* Dequote the words, because we're not performing globbing. */ + new_list = dequote_list (new_list); + } + + if ((eflags & WEXP_VARASSIGN) && subst_assign_varlist) + { + sh_wassign_func_t *assign_func; + int is_special_builtin, is_builtin_or_func; + + /* If the remainder of the words expand to nothing, Posix.2 requires + that the variable and environment assignments affect the shell's + environment. */ + assign_func = new_list ? assign_in_env : do_word_assignment; + tempenv_assign_error = 0; + + is_builtin_or_func = (new_list && new_list->word && (find_shell_builtin (new_list->word->word) || find_function (new_list->word->word))); + /* Posix says that special builtins exit if a variable assignment error + occurs in an assignment preceding it. */ + is_special_builtin = (posixly_correct && new_list && new_list->word && find_special_builtin (new_list->word->word)); + + for (temp_list = subst_assign_varlist; temp_list; temp_list = temp_list->next) + { + this_command_name = (char *)NULL; + assigning_in_environment = (assign_func == assign_in_env); + tint = (*assign_func) (temp_list->word, is_builtin_or_func); + assigning_in_environment = 0; + /* Variable assignment errors in non-interactive shells running + in Posix.2 mode cause the shell to exit. */ + if (tint == 0) + { + if (assign_func == do_word_assignment) + { + last_command_exit_value = EXECUTION_FAILURE; + if (interactive_shell == 0 && posixly_correct && is_special_builtin) + exp_jump_to_top_level (FORCE_EOF); + else + exp_jump_to_top_level (DISCARD); + } + else + tempenv_assign_error++; + } + } + + dispose_words (subst_assign_varlist); + subst_assign_varlist = (WORD_LIST *)NULL; + } + + return (new_list); +} diff --git a/.pc/bash43-015.diff/bashline.c b/.pc/bash43-015.diff/bashline.c new file mode 100644 index 0000000..1f12764 --- /dev/null +++ b/.pc/bash43-015.diff/bashline.c @@ -0,0 +1,4212 @@ +/* bashline.c -- Bash's interface to the readline library. */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#if defined (READLINE) + +#include "bashtypes.h" +#include "posixstat.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (HAVE_GRP_H) +# include +#endif + +#if defined (HAVE_NETDB_H) +# include +#endif + +#include + +#include +#include "chartypes.h" +#include "bashansi.h" +#include "bashintl.h" + +#include "shell.h" +#include "input.h" +#include "builtins.h" +#include "bashhist.h" +#include "bashline.h" +#include "execute_cmd.h" +#include "findcmd.h" +#include "pathexp.h" +#include "shmbutil.h" +#include "trap.h" + +#include "builtins/common.h" + +#include +#include +#include + +#include + +#if defined (ALIAS) +# include "alias.h" +#endif + +#if defined (PROGRAMMABLE_COMPLETION) +# include "pcomplete.h" +#endif + +/* These should agree with the defines for emacs_mode and vi_mode in + rldefs.h, even though that's not a public readline header file. */ +#ifndef EMACS_EDITING_MODE +# define NO_EDITING_MODE -1 +# define EMACS_EDITING_MODE 1 +# define VI_EDITING_MODE 0 +#endif + +#define RL_BOOLEAN_VARIABLE_VALUE(s) ((s)[0] == 'o' && (s)[1] == 'n' && (s)[2] == '\0') + +#if defined (BRACE_COMPLETION) +extern int bash_brace_completion __P((int, int)); +#endif /* BRACE_COMPLETION */ + +/* To avoid including curses.h/term.h/termcap.h and that whole mess. */ +#ifdef _MINIX +extern int tputs __P((const char *string, int nlines, void (*outx)(int))); +#else +extern int tputs __P((const char *string, int nlines, int (*outx)(int))); +#endif + +/* Forward declarations */ + +/* Functions bound to keys in Readline for Bash users. */ +static int shell_expand_line __P((int, int)); +static int display_shell_version __P((int, int)); +static int operate_and_get_next __P((int, int)); + +static int bash_ignore_filenames __P((char **)); +static int bash_ignore_everything __P((char **)); + +#if defined (BANG_HISTORY) +static char *history_expand_line_internal __P((char *)); +static int history_expand_line __P((int, int)); +static int tcsh_magic_space __P((int, int)); +#endif /* BANG_HISTORY */ +#ifdef ALIAS +static int alias_expand_line __P((int, int)); +#endif +#if defined (BANG_HISTORY) && defined (ALIAS) +static int history_and_alias_expand_line __P((int, int)); +#endif + +static int bash_forward_shellword __P((int, int)); +static int bash_backward_shellword __P((int, int)); +static int bash_kill_shellword __P((int, int)); +static int bash_backward_kill_shellword __P((int, int)); + +/* Helper functions for Readline. */ +static char *restore_tilde __P((char *, char *)); +static char *maybe_restore_tilde __P((char *, char *)); + +static char *bash_filename_rewrite_hook __P((char *, int)); + +static void bash_directory_expansion __P((char **)); +static int bash_filename_stat_hook __P((char **)); +static int bash_command_name_stat_hook __P((char **)); +static int bash_directory_completion_hook __P((char **)); +static int filename_completion_ignore __P((char **)); +static int bash_push_line __P((void)); + +static int executable_completion __P((const char *, int)); + +static rl_icppfunc_t *save_directory_hook __P((void)); +static void restore_directory_hook __P((rl_icppfunc_t)); + +static void cleanup_expansion_error __P((void)); +static void maybe_make_readline_line __P((char *)); +static void set_up_new_line __P((char *)); + +static int check_redir __P((int)); +static char **attempt_shell_completion __P((const char *, int, int)); +static char *variable_completion_function __P((const char *, int)); +static char *hostname_completion_function __P((const char *, int)); +static char *command_subst_completion_function __P((const char *, int)); + +static void build_history_completion_array __P((void)); +static char *history_completion_generator __P((const char *, int)); +static int dynamic_complete_history __P((int, int)); +static int bash_dabbrev_expand __P((int, int)); + +static void initialize_hostname_list __P((void)); +static void add_host_name __P((char *)); +static void snarf_hosts_from_file __P((char *)); +static char **hostnames_matching __P((char *)); + +static void _ignore_completion_names __P((char **, sh_ignore_func_t *)); +static int name_is_acceptable __P((const char *)); +static int test_for_directory __P((const char *)); +static int return_zero __P((const char *)); + +static char *bash_dequote_filename __P((char *, int)); +static char *quote_word_break_chars __P((char *)); +static void set_filename_bstab __P((const char *)); +static char *bash_quote_filename __P((char *, int, char *)); + +#ifdef _MINIX +static void putx __P((int)); +#else +static int putx __P((int)); +#endif +static int bash_execute_unix_command __P((int, int)); +static void init_unix_command_map __P((void)); +static int isolate_sequence __P((char *, int, int, int *)); + +static int set_saved_history __P((void)); + +#if defined (ALIAS) +static int posix_edit_macros __P((int, int)); +#endif + +static int bash_event_hook __P((void)); + +#if defined (PROGRAMMABLE_COMPLETION) +static int find_cmd_start __P((int)); +static int find_cmd_end __P((int)); +static char *find_cmd_name __P((int, int *, int *)); +static char *prog_complete_return __P((const char *, int)); + +static char **prog_complete_matches; +#endif + +/* Variables used here but defined in other files. */ +#if defined (BANG_HISTORY) +extern int hist_verify; +#endif + +extern int current_command_line_count, saved_command_line_count; +extern int last_command_exit_value; +extern int array_needs_making; +extern int posixly_correct, no_symbolic_links; +extern char *current_prompt_string, *ps1_prompt; +extern STRING_INT_ALIST word_token_alist[]; +extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin; + +/* SPECIFIC_COMPLETION_FUNCTIONS specifies that we have individual + completion functions which indicate what type of completion should be + done (at or before point) that can be bound to key sequences with + the readline library. */ +#define SPECIFIC_COMPLETION_FUNCTIONS + +#if defined (SPECIFIC_COMPLETION_FUNCTIONS) +static int bash_specific_completion __P((int, rl_compentry_func_t *)); + +static int bash_complete_filename_internal __P((int)); +static int bash_complete_username_internal __P((int)); +static int bash_complete_hostname_internal __P((int)); +static int bash_complete_variable_internal __P((int)); +static int bash_complete_command_internal __P((int)); + +static int bash_complete_filename __P((int, int)); +static int bash_possible_filename_completions __P((int, int)); +static int bash_complete_username __P((int, int)); +static int bash_possible_username_completions __P((int, int)); +static int bash_complete_hostname __P((int, int)); +static int bash_possible_hostname_completions __P((int, int)); +static int bash_complete_variable __P((int, int)); +static int bash_possible_variable_completions __P((int, int)); +static int bash_complete_command __P((int, int)); +static int bash_possible_command_completions __P((int, int)); + +static char *glob_complete_word __P((const char *, int)); +static int bash_glob_completion_internal __P((int)); +static int bash_glob_complete_word __P((int, int)); +static int bash_glob_expand_word __P((int, int)); +static int bash_glob_list_expansions __P((int, int)); + +#endif /* SPECIFIC_COMPLETION_FUNCTIONS */ + +static int edit_and_execute_command __P((int, int, int, char *)); +#if defined (VI_MODE) +static int vi_edit_and_execute_command __P((int, int)); +static int bash_vi_complete __P((int, int)); +#endif +static int emacs_edit_and_execute_command __P((int, int)); + +/* Non-zero once initalize_readline () has been called. */ +int bash_readline_initialized = 0; + +/* If non-zero, we do hostname completion, breaking words at `@' and + trying to complete the stuff after the `@' from our own internal + host list. */ +int perform_hostname_completion = 1; + +/* If non-zero, we don't do command completion on an empty line. */ +int no_empty_command_completion; + +/* Set FORCE_FIGNORE if you want to honor FIGNORE even if it ignores the + only possible matches. Set to 0 if you want to match filenames if they + are the only possible matches, even if FIGNORE says to. */ +int force_fignore = 1; + +/* Perform spelling correction on directory names during word completion */ +int dircomplete_spelling = 0; + +/* Expand directory names during word/filename completion. */ +#if DIRCOMPLETE_EXPAND_DEFAULT +int dircomplete_expand = 1; +int dircomplete_expand_relpath = 1; +#else +int dircomplete_expand = 0; +int dircomplete_expand_relpath = 0; +#endif + +/* When non-zero, perform `normal' shell quoting on completed filenames + even when the completed name contains a directory name with a shell + variable referene, so dollar signs in a filename get quoted appropriately. + Set to zero to remove dollar sign (and braces or parens as needed) from + the set of characters that will be quoted. */ +int complete_fullquote = 1; + +static char *bash_completer_word_break_characters = " \t\n\"'@><=;|&(:"; +static char *bash_nohostname_word_break_characters = " \t\n\"'><=;|&(:"; +/* )) */ + +static const char *default_filename_quote_characters = " \t\n\\\"'@<>=;|&()#$`?*[!:{~"; /*}*/ +static char *custom_filename_quote_characters = 0; +static char filename_bstab[256]; + +static rl_hook_func_t *old_rl_startup_hook = (rl_hook_func_t *)NULL; + +static int dot_in_path = 0; + +/* Set to non-zero when dabbrev-expand is running */ +static int dabbrev_expand_active = 0; + +/* What kind of quoting is performed by bash_quote_filename: + COMPLETE_DQUOTE = double-quoting the filename + COMPLETE_SQUOTE = single_quoting the filename + COMPLETE_BSQUOTE = backslash-quoting special chars in the filename +*/ +#define COMPLETE_DQUOTE 1 +#define COMPLETE_SQUOTE 2 +#define COMPLETE_BSQUOTE 3 +static int completion_quoting_style = COMPLETE_BSQUOTE; + +/* Flag values for the final argument to bash_default_completion */ +#define DEFCOMP_CMDPOS 1 + +/* Change the readline VI-mode keymaps into or out of Posix.2 compliance. + Called when the shell is put into or out of `posix' mode. */ +void +posix_readline_initialize (on_or_off) + int on_or_off; +{ + if (on_or_off) + rl_variable_bind ("comment-begin", "#"); +#if defined (VI_MODE) + rl_bind_key_in_map (CTRL ('I'), on_or_off ? rl_insert : rl_complete, vi_insertion_keymap); +#endif +} + +void +reset_completer_word_break_chars () +{ + rl_completer_word_break_characters = perform_hostname_completion ? savestring (bash_completer_word_break_characters) : savestring (bash_nohostname_word_break_characters); +} + +/* When this function returns, rl_completer_word_break_characters points to + dynamically allocated memory. */ +int +enable_hostname_completion (on_or_off) + int on_or_off; +{ + int old_value; + char *at, *nv, *nval; + + old_value = perform_hostname_completion; + + if (on_or_off) + { + perform_hostname_completion = 1; + rl_special_prefixes = "$@"; + } + else + { + perform_hostname_completion = 0; + rl_special_prefixes = "$"; + } + + /* Now we need to figure out how to appropriately modify and assign + rl_completer_word_break_characters depending on whether we want + hostname completion on or off. */ + + /* If this is the first time this has been called + (bash_readline_initialized == 0), use the sames values as before, but + allocate new memory for rl_completer_word_break_characters. */ + + if (bash_readline_initialized == 0 && + (rl_completer_word_break_characters == 0 || + rl_completer_word_break_characters == rl_basic_word_break_characters)) + { + if (on_or_off) + rl_completer_word_break_characters = savestring (bash_completer_word_break_characters); + else + rl_completer_word_break_characters = savestring (bash_nohostname_word_break_characters); + } + else + { + /* See if we have anything to do. */ + at = strchr (rl_completer_word_break_characters, '@'); + if ((at == 0 && on_or_off == 0) || (at != 0 && on_or_off != 0)) + return old_value; + + /* We have something to do. Do it. */ + nval = (char *)xmalloc (strlen (rl_completer_word_break_characters) + 1 + on_or_off); + + if (on_or_off == 0) + { + /* Turn it off -- just remove `@' from word break chars. We want + to remove all occurrences of `@' from the char list, so we loop + rather than just copy the rest of the list over AT. */ + for (nv = nval, at = rl_completer_word_break_characters; *at; ) + if (*at != '@') + *nv++ = *at++; + else + at++; + *nv = '\0'; + } + else + { + nval[0] = '@'; + strcpy (nval + 1, rl_completer_word_break_characters); + } + + free (rl_completer_word_break_characters); + rl_completer_word_break_characters = nval; + } + + return (old_value); +} + +/* Called once from parse.y if we are going to use readline. */ +void +initialize_readline () +{ + rl_command_func_t *func; + char kseq[2]; + + if (bash_readline_initialized) + return; + + rl_terminal_name = get_string_value ("TERM"); + rl_instream = stdin; + rl_outstream = stderr; + + /* Allow conditional parsing of the ~/.inputrc file. */ + rl_readline_name = "Bash"; + + /* Add bindable names before calling rl_initialize so they may be + referenced in the various inputrc files. */ + rl_add_defun ("shell-expand-line", shell_expand_line, -1); +#ifdef BANG_HISTORY + rl_add_defun ("history-expand-line", history_expand_line, -1); + rl_add_defun ("magic-space", tcsh_magic_space, -1); +#endif + + rl_add_defun ("shell-forward-word", bash_forward_shellword, -1); + rl_add_defun ("shell-backward-word", bash_backward_shellword, -1); + rl_add_defun ("shell-kill-word", bash_kill_shellword, -1); + rl_add_defun ("shell-backward-kill-word", bash_backward_kill_shellword, -1); + +#ifdef ALIAS + rl_add_defun ("alias-expand-line", alias_expand_line, -1); +# ifdef BANG_HISTORY + rl_add_defun ("history-and-alias-expand-line", history_and_alias_expand_line, -1); +# endif +#endif + + /* Backwards compatibility. */ + rl_add_defun ("insert-last-argument", rl_yank_last_arg, -1); + + rl_add_defun ("operate-and-get-next", operate_and_get_next, -1); + rl_add_defun ("display-shell-version", display_shell_version, -1); + rl_add_defun ("edit-and-execute-command", emacs_edit_and_execute_command, -1); + +#if defined (BRACE_COMPLETION) + rl_add_defun ("complete-into-braces", bash_brace_completion, -1); +#endif + +#if defined (SPECIFIC_COMPLETION_FUNCTIONS) + rl_add_defun ("complete-filename", bash_complete_filename, -1); + rl_add_defun ("possible-filename-completions", bash_possible_filename_completions, -1); + rl_add_defun ("complete-username", bash_complete_username, -1); + rl_add_defun ("possible-username-completions", bash_possible_username_completions, -1); + rl_add_defun ("complete-hostname", bash_complete_hostname, -1); + rl_add_defun ("possible-hostname-completions", bash_possible_hostname_completions, -1); + rl_add_defun ("complete-variable", bash_complete_variable, -1); + rl_add_defun ("possible-variable-completions", bash_possible_variable_completions, -1); + rl_add_defun ("complete-command", bash_complete_command, -1); + rl_add_defun ("possible-command-completions", bash_possible_command_completions, -1); + rl_add_defun ("glob-complete-word", bash_glob_complete_word, -1); + rl_add_defun ("glob-expand-word", bash_glob_expand_word, -1); + rl_add_defun ("glob-list-expansions", bash_glob_list_expansions, -1); +#endif + + rl_add_defun ("dynamic-complete-history", dynamic_complete_history, -1); + rl_add_defun ("dabbrev-expand", bash_dabbrev_expand, -1); + + /* Bind defaults before binding our custom shell keybindings. */ + if (RL_ISSTATE(RL_STATE_INITIALIZED) == 0) + rl_initialize (); + + /* Bind up our special shell functions. */ + rl_bind_key_if_unbound_in_map (CTRL('E'), shell_expand_line, emacs_meta_keymap); + +#ifdef BANG_HISTORY + rl_bind_key_if_unbound_in_map ('^', history_expand_line, emacs_meta_keymap); +#endif + + rl_bind_key_if_unbound_in_map (CTRL ('O'), operate_and_get_next, emacs_standard_keymap); + rl_bind_key_if_unbound_in_map (CTRL ('V'), display_shell_version, emacs_ctlx_keymap); + + /* In Bash, the user can switch editing modes with "set -o [vi emacs]", + so it is not necessary to allow C-M-j for context switching. Turn + off this occasionally confusing behaviour. */ + kseq[0] = CTRL('J'); + kseq[1] = '\0'; + func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL); + if (func == rl_vi_editing_mode) + rl_unbind_key_in_map (CTRL('J'), emacs_meta_keymap); + kseq[0] = CTRL('M'); + func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL); + if (func == rl_vi_editing_mode) + rl_unbind_key_in_map (CTRL('M'), emacs_meta_keymap); +#if defined (VI_MODE) + rl_unbind_key_in_map (CTRL('E'), vi_movement_keymap); +#endif + +#if defined (BRACE_COMPLETION) + rl_bind_key_if_unbound_in_map ('{', bash_brace_completion, emacs_meta_keymap); /*}*/ +#endif /* BRACE_COMPLETION */ + +#if defined (SPECIFIC_COMPLETION_FUNCTIONS) + rl_bind_key_if_unbound_in_map ('/', bash_complete_filename, emacs_meta_keymap); + rl_bind_key_if_unbound_in_map ('/', bash_possible_filename_completions, emacs_ctlx_keymap); + + /* Have to jump through hoops here because there is a default binding for + M-~ (rl_tilde_expand) */ + kseq[0] = '~'; + kseq[1] = '\0'; + func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL); + if (func == 0 || func == rl_tilde_expand) + rl_bind_keyseq_in_map (kseq, bash_complete_username, emacs_meta_keymap); + + rl_bind_key_if_unbound_in_map ('~', bash_possible_username_completions, emacs_ctlx_keymap); + + rl_bind_key_if_unbound_in_map ('@', bash_complete_hostname, emacs_meta_keymap); + rl_bind_key_if_unbound_in_map ('@', bash_possible_hostname_completions, emacs_ctlx_keymap); + + rl_bind_key_if_unbound_in_map ('$', bash_complete_variable, emacs_meta_keymap); + rl_bind_key_if_unbound_in_map ('$', bash_possible_variable_completions, emacs_ctlx_keymap); + + rl_bind_key_if_unbound_in_map ('!', bash_complete_command, emacs_meta_keymap); + rl_bind_key_if_unbound_in_map ('!', bash_possible_command_completions, emacs_ctlx_keymap); + + rl_bind_key_if_unbound_in_map ('g', bash_glob_complete_word, emacs_meta_keymap); + rl_bind_key_if_unbound_in_map ('*', bash_glob_expand_word, emacs_ctlx_keymap); + rl_bind_key_if_unbound_in_map ('g', bash_glob_list_expansions, emacs_ctlx_keymap); + +#endif /* SPECIFIC_COMPLETION_FUNCTIONS */ + + kseq[0] = TAB; + kseq[1] = '\0'; + func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL); + if (func == 0 || func == rl_tab_insert) + rl_bind_key_in_map (TAB, dynamic_complete_history, emacs_meta_keymap); + + /* Tell the completer that we want a crack first. */ + rl_attempted_completion_function = attempt_shell_completion; + + /* Tell the completer that we might want to follow symbolic links or + do other expansion on directory names. */ + set_directory_hook (); + + rl_filename_rewrite_hook = bash_filename_rewrite_hook; + + rl_filename_stat_hook = bash_filename_stat_hook; + + /* Tell the filename completer we want a chance to ignore some names. */ + rl_ignore_some_completions_function = filename_completion_ignore; + + /* Bind C-xC-e to invoke emacs and run result as commands. */ + rl_bind_key_if_unbound_in_map (CTRL ('E'), emacs_edit_and_execute_command, emacs_ctlx_keymap); +#if defined (VI_MODE) + rl_bind_key_if_unbound_in_map ('v', vi_edit_and_execute_command, vi_movement_keymap); +# if defined (ALIAS) + rl_bind_key_if_unbound_in_map ('@', posix_edit_macros, vi_movement_keymap); +# endif + + rl_bind_key_in_map ('\\', bash_vi_complete, vi_movement_keymap); + rl_bind_key_in_map ('*', bash_vi_complete, vi_movement_keymap); + rl_bind_key_in_map ('=', bash_vi_complete, vi_movement_keymap); +#endif + + rl_completer_quote_characters = "'\""; + + /* This sets rl_completer_word_break_characters and rl_special_prefixes + to the appropriate values, depending on whether or not hostname + completion is enabled. */ + enable_hostname_completion (perform_hostname_completion); + + /* characters that need to be quoted when appearing in filenames. */ + rl_filename_quote_characters = default_filename_quote_characters; + set_filename_bstab (rl_filename_quote_characters); + + rl_filename_quoting_function = bash_quote_filename; + rl_filename_dequoting_function = bash_dequote_filename; + rl_char_is_quoted_p = char_is_quoted; + +#if 0 + /* This is superfluous and makes it impossible to use tab completion in + vi mode even when explicitly binding it in ~/.inputrc. sv_strict_posix() + should already have called posix_readline_initialize() when + posixly_correct was set. */ + if (posixly_correct) + posix_readline_initialize (1); +#endif + + bash_readline_initialized = 1; +} + +void +bashline_reinitialize () +{ + bash_readline_initialized = 0; +} + +void +bashline_set_event_hook () +{ + rl_signal_event_hook = bash_event_hook; +} + +void +bashline_reset_event_hook () +{ + rl_signal_event_hook = 0; +} + +/* On Sun systems at least, rl_attempted_completion_function can end up + getting set to NULL, and rl_completion_entry_function set to do command + word completion if Bash is interrupted while trying to complete a command + word. This just resets all the completion functions to the right thing. + It's called from throw_to_top_level(). */ +void +bashline_reset () +{ + tilde_initialize (); + rl_attempted_completion_function = attempt_shell_completion; + rl_completion_entry_function = NULL; + rl_ignore_some_completions_function = filename_completion_ignore; + rl_filename_quote_characters = default_filename_quote_characters; + set_filename_bstab (rl_filename_quote_characters); + + set_directory_hook (); + rl_filename_stat_hook = bash_filename_stat_hook; + + bashline_reset_event_hook (); +} + +/* Contains the line to push into readline. */ +static char *push_to_readline = (char *)NULL; + +/* Push the contents of push_to_readline into the + readline buffer. */ +static int +bash_push_line () +{ + if (push_to_readline) + { + rl_insert_text (push_to_readline); + free (push_to_readline); + push_to_readline = (char *)NULL; + rl_startup_hook = old_rl_startup_hook; + } + return 0; +} + +/* Call this to set the initial text for the next line to read + from readline. */ +int +bash_re_edit (line) + char *line; +{ + FREE (push_to_readline); + + push_to_readline = savestring (line); + old_rl_startup_hook = rl_startup_hook; + rl_startup_hook = bash_push_line; + + return (0); +} + +static int +display_shell_version (count, c) + int count, c; +{ + rl_crlf (); + show_shell_version (0); + putc ('\r', rl_outstream); + fflush (rl_outstream); + rl_on_new_line (); + rl_redisplay (); + return 0; +} + +/* **************************************************************** */ +/* */ +/* Readline Stuff */ +/* */ +/* **************************************************************** */ + +/* If the user requests hostname completion, then simply build a list + of hosts, and complete from that forever more, or at least until + HOSTFILE is unset. */ + +/* THIS SHOULD BE A STRINGLIST. */ +/* The kept list of hostnames. */ +static char **hostname_list = (char **)NULL; + +/* The physical size of the above list. */ +static int hostname_list_size; + +/* The number of hostnames in the above list. */ +static int hostname_list_length; + +/* Whether or not HOSTNAME_LIST has been initialized. */ +int hostname_list_initialized = 0; + +/* Initialize the hostname completion table. */ +static void +initialize_hostname_list () +{ + char *temp; + + temp = get_string_value ("HOSTFILE"); + if (temp == 0) + temp = get_string_value ("hostname_completion_file"); + if (temp == 0) + temp = DEFAULT_HOSTS_FILE; + + snarf_hosts_from_file (temp); + + if (hostname_list) + hostname_list_initialized++; +} + +/* Add NAME to the list of hosts. */ +static void +add_host_name (name) + char *name; +{ + if (hostname_list_length + 2 > hostname_list_size) + { + hostname_list_size = (hostname_list_size + 32) - (hostname_list_size % 32); + hostname_list = strvec_resize (hostname_list, hostname_list_size); + } + + hostname_list[hostname_list_length++] = savestring (name); + hostname_list[hostname_list_length] = (char *)NULL; +} + +#define cr_whitespace(c) ((c) == '\r' || (c) == '\n' || whitespace(c)) + +static void +snarf_hosts_from_file (filename) + char *filename; +{ + FILE *file; + char *temp, buffer[256], name[256]; + register int i, start; + + file = fopen (filename, "r"); + if (file == 0) + return; + + while (temp = fgets (buffer, 255, file)) + { + /* Skip to first character. */ + for (i = 0; buffer[i] && cr_whitespace (buffer[i]); i++) + ; + + /* If comment or blank line, ignore. */ + if (buffer[i] == '\0' || buffer[i] == '#') + continue; + + /* If `preprocessor' directive, do the include. */ + if (strncmp (buffer + i, "$include ", 9) == 0) + { + char *incfile, *t; + + /* Find start of filename. */ + for (incfile = buffer + i + 9; *incfile && whitespace (*incfile); incfile++) + ; + + /* Find end of filename. */ + for (t = incfile; *t && cr_whitespace (*t) == 0; t++) + ; + + *t = '\0'; + + snarf_hosts_from_file (incfile); + continue; + } + + /* Skip internet address if present. */ + if (DIGIT (buffer[i])) + for (; buffer[i] && cr_whitespace (buffer[i]) == 0; i++); + + /* Gobble up names. Each name is separated with whitespace. */ + while (buffer[i]) + { + for (; cr_whitespace (buffer[i]); i++) + ; + if (buffer[i] == '\0' || buffer[i] == '#') + break; + + /* Isolate the current word. */ + for (start = i; buffer[i] && cr_whitespace (buffer[i]) == 0; i++) + ; + if (i == start) + continue; + strncpy (name, buffer + start, i - start); + name[i - start] = '\0'; + add_host_name (name); + } + } + fclose (file); +} + +/* Return the hostname list. */ +char ** +get_hostname_list () +{ + if (hostname_list_initialized == 0) + initialize_hostname_list (); + return (hostname_list); +} + +void +clear_hostname_list () +{ + register int i; + + if (hostname_list_initialized == 0) + return; + for (i = 0; i < hostname_list_length; i++) + free (hostname_list[i]); + hostname_list_length = hostname_list_initialized = 0; +} + +/* Return a NULL terminated list of hostnames which begin with TEXT. + Initialize the hostname list the first time if necessary. + The array is malloc ()'ed, but not the individual strings. */ +static char ** +hostnames_matching (text) + char *text; +{ + register int i, len, nmatch, rsize; + char **result; + + if (hostname_list_initialized == 0) + initialize_hostname_list (); + + if (hostname_list_initialized == 0) + return ((char **)NULL); + + /* Special case. If TEXT consists of nothing, then the whole list is + what is desired. */ + if (*text == '\0') + { + result = strvec_create (1 + hostname_list_length); + for (i = 0; i < hostname_list_length; i++) + result[i] = hostname_list[i]; + result[i] = (char *)NULL; + return (result); + } + + /* Scan until found, or failure. */ + len = strlen (text); + result = (char **)NULL; + for (i = nmatch = rsize = 0; i < hostname_list_length; i++) + { + if (STREQN (text, hostname_list[i], len) == 0) + continue; + + /* OK, it matches. Add it to the list. */ + if (nmatch >= (rsize - 1)) + { + rsize = (rsize + 16) - (rsize % 16); + result = strvec_resize (result, rsize); + } + + result[nmatch++] = hostname_list[i]; + } + if (nmatch) + result[nmatch] = (char *)NULL; + return (result); +} + +/* The equivalent of the Korn shell C-o operate-and-get-next-history-line + editing command. */ +static int saved_history_line_to_use = -1; +static int last_saved_history_line = -1; + +#define HISTORY_FULL() (history_is_stifled () && history_length >= history_max_entries) + +static int +set_saved_history () +{ + /* XXX - compensate for assumption that history was `shuffled' if it was + actually not. */ + if (HISTORY_FULL () && + hist_last_line_added == 0 && + saved_history_line_to_use < history_length - 1) + saved_history_line_to_use++; + + if (saved_history_line_to_use >= 0) + { + rl_get_previous_history (history_length - saved_history_line_to_use, 0); + last_saved_history_line = saved_history_line_to_use; + } + saved_history_line_to_use = -1; + rl_startup_hook = old_rl_startup_hook; + return (0); +} + +static int +operate_and_get_next (count, c) + int count, c; +{ + int where; + + /* Accept the current line. */ + rl_newline (1, c); + + /* Find the current line, and find the next line to use. */ + where = where_history (); + + if (HISTORY_FULL () || (where >= history_length - 1)) + saved_history_line_to_use = where; + else + saved_history_line_to_use = where + 1; + + old_rl_startup_hook = rl_startup_hook; + rl_startup_hook = set_saved_history; + + return 0; +} + +/* This vi mode command causes VI_EDIT_COMMAND to be run on the current + command being entered (if no explicit argument is given), otherwise on + a command from the history file. */ + +#define VI_EDIT_COMMAND "fc -e \"${VISUAL:-${EDITOR:-vi}}\"" +#define EMACS_EDIT_COMMAND "fc -e \"${VISUAL:-${EDITOR:-emacs}}\"" +#define POSIX_VI_EDIT_COMMAND "fc -e vi" + +static int +edit_and_execute_command (count, c, editing_mode, edit_command) + int count, c, editing_mode; + char *edit_command; +{ + char *command, *metaval; + int r, rrs, metaflag; + sh_parser_state_t ps; + + rrs = rl_readline_state; + saved_command_line_count = current_command_line_count; + + /* Accept the current line. */ + rl_newline (1, c); + + if (rl_explicit_arg) + { + command = (char *)xmalloc (strlen (edit_command) + 8); + sprintf (command, "%s %d", edit_command, count); + } + else + { + /* Take the command we were just editing, add it to the history file, + then call fc to operate on it. We have to add a dummy command to + the end of the history because fc ignores the last command (assumes + it's supposed to deal with the command before the `fc'). */ + /* This breaks down when using command-oriented history and are not + finished with the command, so we should not ignore the last command */ + using_history (); + current_command_line_count++; /* for rl_newline above */ + bash_add_history (rl_line_buffer); + current_command_line_count = 0; /* for dummy history entry */ + bash_add_history (""); + history_lines_this_session++; + using_history (); + command = savestring (edit_command); + } + + metaval = rl_variable_value ("input-meta"); + metaflag = RL_BOOLEAN_VARIABLE_VALUE (metaval); + + /* Now, POSIX.1-2001 and SUSv3 say that the commands executed from the + temporary file should be placed into the history. We don't do that + yet. */ + if (rl_deprep_term_function) + (*rl_deprep_term_function) (); + save_parser_state (&ps); + r = parse_and_execute (command, (editing_mode == VI_EDITING_MODE) ? "v" : "C-xC-e", SEVAL_NOHIST); + restore_parser_state (&ps); + if (rl_prep_term_function) + (*rl_prep_term_function) (metaflag); + + current_command_line_count = saved_command_line_count; + + /* Now erase the contents of the current line and undo the effects of the + rl_accept_line() above. We don't even want to make the text we just + executed available for undoing. */ + rl_line_buffer[0] = '\0'; /* XXX */ + rl_point = rl_end = 0; + rl_done = 0; + rl_readline_state = rrs; + + rl_forced_update_display (); + + return r; +} + +#if defined (VI_MODE) +static int +vi_edit_and_execute_command (count, c) + int count, c; +{ + if (posixly_correct) + return (edit_and_execute_command (count, c, VI_EDITING_MODE, POSIX_VI_EDIT_COMMAND)); + else + return (edit_and_execute_command (count, c, VI_EDITING_MODE, VI_EDIT_COMMAND)); +} +#endif /* VI_MODE */ + +static int +emacs_edit_and_execute_command (count, c) + int count, c; +{ + return (edit_and_execute_command (count, c, EMACS_EDITING_MODE, EMACS_EDIT_COMMAND)); +} + +#if defined (ALIAS) +static int +posix_edit_macros (count, key) + int count, key; +{ + int c; + char alias_name[3], *alias_value, *macro; + + c = rl_read_key (); + alias_name[0] = '_'; + alias_name[1] = c; + alias_name[2] = '\0'; + + alias_value = get_alias_value (alias_name); + if (alias_value && *alias_value) + { + macro = savestring (alias_value); + rl_push_macro_input (macro); + } + return 0; +} +#endif + +/* Bindable commands that move `shell-words': that is, sequences of + non-unquoted-metacharacters. */ + +#define WORDDELIM(c) (shellmeta(c) || shellblank(c)) + +static int +bash_forward_shellword (count, key) + int count, key; +{ + size_t slen; + int sindex, c, p; + DECLARE_MBSTATE; + + if (count < 0) + return (bash_backward_shellword (-count, key)); + + /* The tricky part of this is deciding whether or not the first character + we're on is an unquoted metacharacter. Not completely handled yet. */ + /* XXX - need to test this stuff with backslash-escaped shell + metacharacters and unclosed single- and double-quoted strings. */ + + p = rl_point; + slen = rl_end; + + while (count) + { + if (p == rl_end) + { + rl_point = rl_end; + return 0; + } + + /* Are we in a quoted string? If we are, move to the end of the quoted + string and continue the outer loop. We only want quoted strings, not + backslash-escaped characters, but char_is_quoted doesn't + differentiate. */ + if (char_is_quoted (rl_line_buffer, p) && p > 0 && rl_line_buffer[p-1] != '\\') + { + do + ADVANCE_CHAR (rl_line_buffer, slen, p); + while (p < rl_end && char_is_quoted (rl_line_buffer, p)); + count--; + continue; + } + + /* Rest of code assumes we are not in a quoted string. */ + /* Move forward until we hit a non-metacharacter. */ + while (p < rl_end && (c = rl_line_buffer[p]) && WORDDELIM (c)) + { + switch (c) + { + default: + ADVANCE_CHAR (rl_line_buffer, slen, p); + continue; /* straight back to loop, don't increment p */ + case '\\': + if (p < rl_end && rl_line_buffer[p]) + ADVANCE_CHAR (rl_line_buffer, slen, p); + break; + case '\'': + p = skip_to_delim (rl_line_buffer, ++p, "'", SD_NOJMP); + break; + case '"': + p = skip_to_delim (rl_line_buffer, ++p, "\"", SD_NOJMP); + break; + } + + if (p < rl_end) + p++; + } + + if (rl_line_buffer[p] == 0 || p == rl_end) + { + rl_point = rl_end; + rl_ding (); + return 0; + } + + /* Now move forward until we hit a non-quoted metacharacter or EOL */ + while (p < rl_end && (c = rl_line_buffer[p]) && WORDDELIM (c) == 0) + { + switch (c) + { + default: + ADVANCE_CHAR (rl_line_buffer, slen, p); + continue; /* straight back to loop, don't increment p */ + case '\\': + if (p < rl_end && rl_line_buffer[p]) + ADVANCE_CHAR (rl_line_buffer, slen, p); + break; + case '\'': + p = skip_to_delim (rl_line_buffer, ++p, "'", SD_NOJMP); + break; + case '"': + p = skip_to_delim (rl_line_buffer, ++p, "\"", SD_NOJMP); + break; + } + + if (p < rl_end) + p++; + } + + if (p == rl_end || rl_line_buffer[p] == 0) + { + rl_point = rl_end; + return (0); + } + + count--; + } + + rl_point = p; + return (0); +} + +static int +bash_backward_shellword (count, key) + int count, key; +{ + size_t slen; + int sindex, c, p; + DECLARE_MBSTATE; + + if (count < 0) + return (bash_forward_shellword (-count, key)); + + p = rl_point; + slen = rl_end; + + while (count) + { + if (p == 0) + { + rl_point = 0; + return 0; + } + + /* Move backward until we hit a non-metacharacter. */ + while (p > 0) + { + c = rl_line_buffer[p]; + if (WORDDELIM (c) && char_is_quoted (rl_line_buffer, p) == 0) + BACKUP_CHAR (rl_line_buffer, slen, p); + break; + } + + if (p == 0) + { + rl_point = 0; + return 0; + } + + /* Now move backward until we hit a metacharacter or BOL. */ + while (p > 0) + { + c = rl_line_buffer[p]; + if (WORDDELIM (c) && char_is_quoted (rl_line_buffer, p) == 0) + break; + BACKUP_CHAR (rl_line_buffer, slen, p); + } + + count--; + } + + rl_point = p; + return 0; +} + +static int +bash_kill_shellword (count, key) + int count, key; +{ + int p; + + if (count < 0) + return (bash_backward_kill_shellword (-count, key)); + + p = rl_point; + bash_forward_shellword (count, key); + + if (rl_point != p) + rl_kill_text (p, rl_point); + + rl_point = p; + if (rl_editing_mode == 1) /* 1 == emacs_mode */ + rl_mark = rl_point; + + return 0; +} + +static int +bash_backward_kill_shellword (count, key) + int count, key; +{ + int p; + + if (count < 0) + return (bash_kill_shellword (-count, key)); + + p = rl_point; + bash_backward_shellword (count, key); + + if (rl_point != p) + rl_kill_text (p, rl_point); + + if (rl_editing_mode == 1) /* 1 == emacs_mode */ + rl_mark = rl_point; + + return 0; +} + + +/* **************************************************************** */ +/* */ +/* How To Do Shell Completion */ +/* */ +/* **************************************************************** */ + +#define COMMAND_SEPARATORS ";|&{(`" +/* )} */ +#define COMMAND_SEPARATORS_PLUS_WS ";|&{(` \t" +/* )} */ + +/* check for redirections and other character combinations that are not + command separators */ +static int +check_redir (ti) + int ti; +{ + register int this_char, prev_char; + + /* Handle the two character tokens `>&', `<&', and `>|'. + We are not in a command position after one of these. */ + this_char = rl_line_buffer[ti]; + prev_char = rl_line_buffer[ti - 1]; + + if ((this_char == '&' && (prev_char == '<' || prev_char == '>')) || + (this_char == '|' && prev_char == '>')) + return (1); + else if (this_char == '{' && prev_char == '$') /*}*/ + return (1); +#if 0 /* Not yet */ + else if (this_char == '(' && prev_char == '$') /*)*/ + return (1); + else if (this_char == '(' && prev_char == '<') /*)*/ + return (1); +#if defined (EXTENDED_GLOB) + else if (extended_glob && this_char == '(' && prev_char == '!') /*)*/ + return (1); +#endif +#endif + else if (char_is_quoted (rl_line_buffer, ti)) + return (1); + return (0); +} + +#if defined (PROGRAMMABLE_COMPLETION) +/* + * XXX - because of the <= start test, and setting os = s+1, this can + * potentially return os > start. This is probably not what we want to + * happen, but fix later after 2.05a-release. + */ +static int +find_cmd_start (start) + int start; +{ + register int s, os; + + os = 0; + /* Flags == SD_NOJMP only because we want to skip over command substitutions + in assignment statements. Have to test whether this affects `standalone' + command substitutions as individual words. */ + while (((s = skip_to_delim (rl_line_buffer, os, COMMAND_SEPARATORS, SD_NOJMP/*|SD_NOSKIPCMD*/)) <= start) && + rl_line_buffer[s]) + os = s+1; + return os; +} + +static int +find_cmd_end (end) + int end; +{ + register int e; + + e = skip_to_delim (rl_line_buffer, end, COMMAND_SEPARATORS, SD_NOJMP); + return e; +} + +static char * +find_cmd_name (start, sp, ep) + int start; + int *sp, *ep; +{ + char *name; + register int s, e; + + for (s = start; whitespace (rl_line_buffer[s]); s++) + ; + + /* skip until a shell break character */ + e = skip_to_delim (rl_line_buffer, s, "()<>;&| \t\n", SD_NOJMP); + + name = substring (rl_line_buffer, s, e); + + if (sp) + *sp = s; + if (ep) + *ep = e; + + return (name); +} + +static char * +prog_complete_return (text, matchnum) + const char *text; + int matchnum; +{ + static int ind; + + if (matchnum == 0) + ind = 0; + + if (prog_complete_matches == 0 || prog_complete_matches[ind] == 0) + return (char *)NULL; + return (prog_complete_matches[ind++]); +} + +#endif /* PROGRAMMABLE_COMPLETION */ + +/* Do some completion on TEXT. The indices of TEXT in RL_LINE_BUFFER are + at START and END. Return an array of matches, or NULL if none. */ +static char ** +attempt_shell_completion (text, start, end) + const char *text; + int start, end; +{ + int in_command_position, ti, saveti, qc, dflags; + char **matches, *command_separator_chars; +#if defined (PROGRAMMABLE_COMPLETION) + int have_progcomps, was_assignment; +#endif + + command_separator_chars = COMMAND_SEPARATORS; + matches = (char **)NULL; + rl_ignore_some_completions_function = filename_completion_ignore; + + rl_filename_quote_characters = default_filename_quote_characters; + set_filename_bstab (rl_filename_quote_characters); + set_directory_hook (); + rl_filename_stat_hook = bash_filename_stat_hook; + + /* Determine if this could be a command word. It is if it appears at + the start of the line (ignoring preceding whitespace), or if it + appears after a character that separates commands. It cannot be a + command word if we aren't at the top-level prompt. */ + ti = start - 1; + saveti = qc = -1; + + while ((ti > -1) && (whitespace (rl_line_buffer[ti]))) + ti--; + +#if 1 + /* If this is an open quote, maybe we're trying to complete a quoted + command name. */ + if (ti >= 0 && (rl_line_buffer[ti] == '"' || rl_line_buffer[ti] == '\'')) + { + qc = rl_line_buffer[ti]; + saveti = ti--; + while (ti > -1 && (whitespace (rl_line_buffer[ti]))) + ti--; + } +#endif + + in_command_position = 0; + if (ti < 0) + { + /* Only do command completion at the start of a line when we + are prompting at the top level. */ + if (current_prompt_string == ps1_prompt) + in_command_position++; + else if (parser_in_command_position ()) + in_command_position++; + } + else if (member (rl_line_buffer[ti], command_separator_chars)) + { + in_command_position++; + + if (check_redir (ti) == 1) + in_command_position = 0; + } + else + { + /* This still could be in command position. It is possible + that all of the previous words on the line are variable + assignments. */ + } + + /* Check that we haven't incorrectly flagged a closed command substitution + as indicating we're in a command position. */ + if (in_command_position && ti >= 0 && rl_line_buffer[ti] == '`' && + *text != '`' && unclosed_pair (rl_line_buffer, end, "`") == 0) + in_command_position = 0; + + /* Special handling for command substitution. If *TEXT is a backquote, + it can be the start or end of an old-style command substitution, or + unmatched. If it's unmatched, both calls to unclosed_pair will + succeed. Don't bother if readline found a single quote and we are + completing on the substring. */ + if (*text == '`' && rl_completion_quote_character != '\'' && + (in_command_position || (unclosed_pair (rl_line_buffer, start, "`") && + unclosed_pair (rl_line_buffer, end, "`")))) + matches = rl_completion_matches (text, command_subst_completion_function); + +#if defined (PROGRAMMABLE_COMPLETION) + /* Attempt programmable completion. */ + have_progcomps = prog_completion_enabled && (progcomp_size () > 0); + if (matches == 0 && (in_command_position == 0 || text[0] == '\0') && + current_prompt_string == ps1_prompt) + { + int s, e, s1, e1, os, foundcs; + char *n; + + /* XXX - don't free the members */ + if (prog_complete_matches) + free (prog_complete_matches); + prog_complete_matches = (char **)NULL; + + os = start; + n = 0; + s = find_cmd_start (os); + e = find_cmd_end (end); + do + { + /* Skip over assignment statements preceding a command name. If we + don't find a command name at all, we can perform command name + completion. If we find a partial command name, we should perform + command name completion on it. */ + FREE (n); + n = find_cmd_name (s, &s1, &e1); + s = e1 + 1; + } + while (was_assignment = assignment (n, 0)); + s = s1; /* reset to index where name begins */ + + /* s == index of where command name begins (reset above) + e == end of current command, may be end of line + s1 = index of where command name begins + e1 == index of where command name ends + start == index of where word to be completed begins + end == index of where word to be completed ends + if (s == start) we are doing command word completion for sure + if (e1 == end) we are at the end of the command name and completing it */ + if (start == 0 && end == 0 && e != 0 && text[0] == '\0') /* beginning of non-empty line */ + foundcs = 0; + else if (start == end && start == s1 && e != 0 && e1 > end) /* beginning of command name, leading whitespace */ + foundcs = 0; + else if (e == 0 && e == s && text[0] == '\0' && have_progcomps) /* beginning of empty line */ + prog_complete_matches = programmable_completions ("_EmptycmD_", text, s, e, &foundcs); + else if (start == end && text[0] == '\0' && s1 > start && whitespace (rl_line_buffer[start])) + foundcs = 0; /* whitespace before command name */ + else if (e > s && was_assignment == 0 && e1 == end && rl_line_buffer[e] == 0 && whitespace (rl_line_buffer[e-1]) == 0) + { + /* not assignment statement, but still want to perform command + completion if we are composing command word. */ + foundcs = 0; + in_command_position = s == start && STREQ (n, text); /* XXX */ + } + else if (e > s && was_assignment == 0 && have_progcomps) + { + prog_complete_matches = programmable_completions (n, text, s, e, &foundcs); + /* command completion if programmable completion fails */ + in_command_position = s == start && STREQ (n, text); /* XXX */ + } + else if (s >= e && n[0] == '\0' && text[0] == '\0' && start > 0) + { + foundcs = 0; /* empty command name following assignments */ + in_command_position = was_assignment; + } + else if (s == start && e == end && STREQ (n, text) && start > 0) + { + foundcs = 0; /* partial command name following assignments */ + in_command_position = 1; + } + else + foundcs = 0; + FREE (n); + /* XXX - if we found a COMPSPEC for the command, just return whatever + the programmable completion code returns, and disable the default + filename completion that readline will do unless the COPT_DEFAULT + option has been set with the `-o default' option to complete or + compopt. */ + if (foundcs) + { + pcomp_set_readline_variables (foundcs, 1); + /* Turn what the programmable completion code returns into what + readline wants. I should have made compute_lcd_of_matches + external... */ + matches = rl_completion_matches (text, prog_complete_return); + if ((foundcs & COPT_DEFAULT) == 0) + rl_attempted_completion_over = 1; /* no default */ + if (matches || ((foundcs & COPT_BASHDEFAULT) == 0)) + return (matches); + } + } +#endif + + if (matches == 0) + { + dflags = 0; + if (in_command_position) + dflags |= DEFCOMP_CMDPOS; + matches = bash_default_completion (text, start, end, qc, dflags); + } + + return matches; +} + +char ** +bash_default_completion (text, start, end, qc, compflags) + const char *text; + int start, end, qc, compflags; +{ + char **matches, *t; + + matches = (char **)NULL; + + /* New posix-style command substitution or variable name? */ + if (!matches && *text == '$') + { + if (qc != '\'' && text[1] == '(') /* ) */ + matches = rl_completion_matches (text, command_subst_completion_function); + else + { + matches = rl_completion_matches (text, variable_completion_function); + if (matches && matches[0] && matches[1] == 0) + { + t = savestring (matches[0]); + bash_filename_stat_hook (&t); + /* doesn't use test_for_directory because that performs tilde + expansion */ + if (file_isdir (t)) + rl_completion_append_character = '/'; + free (t); + } + } + } + + /* If the word starts in `~', and there is no slash in the word, then + try completing this word as a username. */ + if (matches == 0 && *text == '~' && mbschr (text, '/') == 0) + matches = rl_completion_matches (text, rl_username_completion_function); + + /* Another one. Why not? If the word starts in '@', then look through + the world of known hostnames for completion first. */ + if (matches == 0 && perform_hostname_completion && *text == '@') + matches = rl_completion_matches (text, hostname_completion_function); + + /* And last, (but not least) if this word is in a command position, then + complete over possible command names, including aliases, functions, + and command names. */ + if (matches == 0 && (compflags & DEFCOMP_CMDPOS)) + { + /* If END == START and text[0] == 0, we are trying to complete an empty + command word. */ + if (no_empty_command_completion && end == start && text[0] == '\0') + { + matches = (char **)NULL; + rl_ignore_some_completions_function = bash_ignore_everything; + } + else + { +#define CMD_IS_DIR(x) (absolute_pathname(x) == 0 && absolute_program(x) == 0 && *(x) != '~' && test_for_directory (x)) + + dot_in_path = 0; + matches = rl_completion_matches (text, command_word_completion_function); + + /* If we are attempting command completion and nothing matches, we + do not want readline to perform filename completion for us. We + still want to be able to complete partial pathnames, so set the + completion ignore function to something which will remove + filenames and leave directories in the match list. */ + if (matches == (char **)NULL) + rl_ignore_some_completions_function = bash_ignore_filenames; + else if (matches[1] == 0 && CMD_IS_DIR(matches[0]) && dot_in_path == 0) + /* If we found a single match, without looking in the current + directory (because it's not in $PATH), but the found name is + also a command in the current directory, suppress appending any + terminating character, since it's ambiguous. */ + { + rl_completion_suppress_append = 1; + rl_filename_completion_desired = 0; + } + else if (matches[0] && matches[1] && STREQ (matches[0], matches[1]) && CMD_IS_DIR (matches[0])) + /* There are multiple instances of the same match (duplicate + completions haven't yet been removed). In this case, all of + the matches will be the same, and the duplicate removal code + will distill them all down to one. We turn on + rl_completion_suppress_append for the same reason as above. + Remember: we only care if there's eventually a single unique + completion. If there are multiple completions this won't + make a difference and the problem won't occur. */ + { + rl_completion_suppress_append = 1; + rl_filename_completion_desired = 0; + } + } + } + + /* This could be a globbing pattern, so try to expand it using pathname + expansion. */ + if (!matches && glob_pattern_p (text)) + { + matches = rl_completion_matches (text, glob_complete_word); + /* A glob expression that matches more than one filename is problematic. + If we match more than one filename, punt. */ + if (matches && matches[1] && rl_completion_type == TAB) + { + strvec_dispose (matches); + matches = (char **)0; + } + else if (matches && matches[1] && rl_completion_type == '!') + { + rl_completion_suppress_append = 1; + rl_filename_completion_desired = 0; + } + } + + return (matches); +} + +static int +bash_command_name_stat_hook (name) + char **name; +{ + char *cname, *result; + + /* If it's not something we're going to look up in $PATH, just call the + normal filename stat hook. */ + if (absolute_program (*name)) + return (bash_filename_stat_hook (name)); + + cname = *name; + /* XXX - we could do something here with converting aliases, builtins, + and functions into something that came out as executable, but we don't. */ + result = search_for_command (cname, 0); + if (result) + { + *name = result; + return 1; + } + return 0; +} + +static int +executable_completion (filename, searching_path) + const char *filename; + int searching_path; +{ + char *f; + int r; + + f = savestring (filename); + bash_directory_completion_hook (&f); + + r = searching_path ? executable_file (f) : executable_or_directory (f); + free (f); + return r; +} + +/* This is the function to call when the word to complete is in a position + where a command word can be found. It grovels $PATH, looking for commands + that match. It also scans aliases, function names, and the shell_builtin + table. */ +char * +command_word_completion_function (hint_text, state) + const char *hint_text; + int state; +{ + static char *hint = (char *)NULL; + static char *path = (char *)NULL; + static char *val = (char *)NULL; + static char *filename_hint = (char *)NULL; + static char *fnhint = (char *)NULL; + static char *dequoted_hint = (char *)NULL; + static char *directory_part = (char *)NULL; + static char **glob_matches = (char **)NULL; + static int path_index, hint_len, dequoted_len, istate, igncase; + static int mapping_over, local_index, searching_path, hint_is_dir; + static int old_glob_ignore_case, globpat; + static SHELL_VAR **varlist = (SHELL_VAR **)NULL; +#if defined (ALIAS) + static alias_t **alias_list = (alias_t **)NULL; +#endif /* ALIAS */ + char *temp, *cval; + + /* We have to map over the possibilities for command words. If we have + no state, then make one just for that purpose. */ + if (state == 0) + { + rl_filename_stat_hook = bash_command_name_stat_hook; + + if (dequoted_hint && dequoted_hint != hint) + free (dequoted_hint); + if (hint) + free (hint); + + mapping_over = searching_path = 0; + hint_is_dir = CMD_IS_DIR (hint_text); + val = (char *)NULL; + + temp = rl_variable_value ("completion-ignore-case"); + igncase = RL_BOOLEAN_VARIABLE_VALUE (temp); + + if (glob_matches) + { + free (glob_matches); + glob_matches = (char **)NULL; + } + + globpat = glob_pattern_p (hint_text); + + /* If this is an absolute program name, do not check it against + aliases, reserved words, functions or builtins. We must check + whether or not it is unique, and, if so, whether that filename + is executable. */ + if (globpat || absolute_program (hint_text)) + { + /* Perform tilde expansion on what's passed, so we don't end up + passing filenames with tildes directly to stat(). */ + if (*hint_text == '~') + { + hint = bash_tilde_expand (hint_text, 0); + directory_part = savestring (hint_text); + temp = strchr (directory_part, '/'); + if (temp) + *temp = 0; + else + { + free (directory_part); + directory_part = (char *)NULL; + } + } + else + hint = savestring (hint_text); + + dequoted_hint = hint; + /* If readline's completer found a quote character somewhere, but + didn't set the quote character, there must have been a quote + character embedded in the filename. It can't be at the start of + the filename, so we need to dequote the filename before we look + in the file system for it. */ + if (rl_completion_found_quote && rl_completion_quote_character == 0) + { + dequoted_hint = bash_dequote_filename (hint, 0); + free (hint); + hint = dequoted_hint; + } + dequoted_len = hint_len = strlen (hint); + + if (filename_hint) + free (filename_hint); + + fnhint = filename_hint = savestring (hint); + + istate = 0; + + if (globpat) + { + mapping_over = 5; + goto globword; + } + else + { + if (dircomplete_expand && path_dot_or_dotdot (filename_hint)) + { + dircomplete_expand = 0; + set_directory_hook (); + dircomplete_expand = 1; + } + mapping_over = 4; + goto inner; + } + } + + dequoted_hint = hint = savestring (hint_text); + dequoted_len = hint_len = strlen (hint); + + if (rl_completion_found_quote && rl_completion_quote_character == 0) + { + dequoted_hint = bash_dequote_filename (hint, 0); + dequoted_len = strlen (dequoted_hint); + } + + path = get_string_value ("PATH"); + path_index = dot_in_path = 0; + + /* Initialize the variables for each type of command word. */ + local_index = 0; + + if (varlist) + free (varlist); + + varlist = all_visible_functions (); + +#if defined (ALIAS) + if (alias_list) + free (alias_list); + + alias_list = all_aliases (); +#endif /* ALIAS */ + } + + /* mapping_over says what we are currently hacking. Note that every case + in this list must fall through when there are no more possibilities. */ + + switch (mapping_over) + { + case 0: /* Aliases come first. */ +#if defined (ALIAS) + while (alias_list && alias_list[local_index]) + { + register char *alias; + + alias = alias_list[local_index++]->name; + + if (STREQN (alias, hint, hint_len)) + return (savestring (alias)); + } +#endif /* ALIAS */ + local_index = 0; + mapping_over++; + + case 1: /* Then shell reserved words. */ + { + while (word_token_alist[local_index].word) + { + register char *reserved_word; + + reserved_word = word_token_alist[local_index++].word; + + if (STREQN (reserved_word, hint, hint_len)) + return (savestring (reserved_word)); + } + local_index = 0; + mapping_over++; + } + + case 2: /* Then function names. */ + while (varlist && varlist[local_index]) + { + register char *varname; + + varname = varlist[local_index++]->name; + + if (STREQN (varname, hint, hint_len)) + return (savestring (varname)); + } + local_index = 0; + mapping_over++; + + case 3: /* Then shell builtins. */ + for (; local_index < num_shell_builtins; local_index++) + { + /* Ignore it if it doesn't have a function pointer or if it + is not currently enabled. */ + if (!shell_builtins[local_index].function || + (shell_builtins[local_index].flags & BUILTIN_ENABLED) == 0) + continue; + + if (STREQN (shell_builtins[local_index].name, hint, hint_len)) + { + int i = local_index++; + + return (savestring (shell_builtins[i].name)); + } + } + local_index = 0; + mapping_over++; + } + +globword: + /* Limited support for completing command words with globbing chars. Only + a single match (multiple matches that end up reducing the number of + characters in the common prefix are bad) will ever be returned on + regular completion. */ + if (globpat) + { + if (state == 0) + { + glob_ignore_case = igncase; + glob_matches = shell_glob_filename (hint); + glob_ignore_case = old_glob_ignore_case; + + if (GLOB_FAILED (glob_matches) || glob_matches == 0) + { + glob_matches = (char **)NULL; + return ((char *)NULL); + } + + local_index = 0; + + if (glob_matches[1] && rl_completion_type == TAB) /* multiple matches are bad */ + return ((char *)NULL); + } + + while (val = glob_matches[local_index++]) + { + if (executable_or_directory (val)) + { + if (*hint_text == '~' && directory_part) + { + temp = maybe_restore_tilde (val, directory_part); + free (val); + val = temp; + } + return (val); + } + free (val); + } + + glob_ignore_case = old_glob_ignore_case; + return ((char *)NULL); + } + + /* If the text passed is a directory in the current directory, return it + as a possible match. Executables in directories in the current + directory can be specified using relative pathnames and successfully + executed even when `.' is not in $PATH. */ + if (hint_is_dir) + { + hint_is_dir = 0; /* only return the hint text once */ + return (savestring (hint_text)); + } + + /* Repeatedly call filename_completion_function while we have + members of PATH left. Question: should we stat each file? + Answer: we call executable_file () on each file. */ + outer: + + istate = (val != (char *)NULL); + + if (istate == 0) + { + char *current_path; + + /* Get the next directory from the path. If there is none, then we + are all done. */ + if (path == 0 || path[path_index] == 0 || + (current_path = extract_colon_unit (path, &path_index)) == 0) + return ((char *)NULL); + + searching_path = 1; + if (*current_path == 0) + { + free (current_path); + current_path = savestring ("."); + } + + if (*current_path == '~') + { + char *t; + + t = bash_tilde_expand (current_path, 0); + free (current_path); + current_path = t; + } + + if (current_path[0] == '.' && current_path[1] == '\0') + dot_in_path = 1; + + if (fnhint && fnhint != filename_hint) + free (fnhint); + if (filename_hint) + free (filename_hint); + + filename_hint = sh_makepath (current_path, hint, 0); + /* Need a quoted version (though it doesn't matter much in most + cases) because rl_filename_completion_function dequotes the + filename it gets, assuming that it's been quoted as part of + the input line buffer. */ + if (strpbrk (filename_hint, "\"'\\")) + fnhint = sh_backslash_quote (filename_hint, filename_bstab, 0); + else + fnhint = filename_hint; + free (current_path); /* XXX */ + } + + inner: + val = rl_filename_completion_function (fnhint, istate); + if (mapping_over == 4 && dircomplete_expand) + set_directory_hook (); + + istate = 1; + + if (val == 0) + { + /* If the hint text is an absolute program, then don't bother + searching through PATH. */ + if (absolute_program (hint)) + return ((char *)NULL); + + goto outer; + } + else + { + int match, freetemp; + + if (absolute_program (hint)) + { + if (igncase == 0) + match = strncmp (val, hint, hint_len) == 0; + else + match = strncasecmp (val, hint, hint_len) == 0; + + /* If we performed tilde expansion, restore the original + filename. */ + if (*hint_text == '~') + temp = maybe_restore_tilde (val, directory_part); + else + temp = savestring (val); + freetemp = 1; + } + else + { + temp = strrchr (val, '/'); + + if (temp) + { + temp++; + if (igncase == 0) + freetemp = match = strncmp (temp, hint, hint_len) == 0; + else + freetemp = match = strncasecmp (temp, hint, hint_len) == 0; + if (match) + temp = savestring (temp); + } + else + freetemp = match = 0; + } + + /* If we have found a match, and it is an executable file, return it. + We don't return directory names when searching $PATH, since the + bash execution code won't find executables in directories which + appear in directories in $PATH when they're specified using + relative pathnames. */ +#if 0 + /* If we're not searching $PATH and we have a relative pathname, we + need to re-canonicalize it before testing whether or not it's an + executable or a directory so the shell treats .. relative to $PWD + according to the physical/logical option. The shell already + canonicalizes the directory name in order to tell readline where + to look, so not doing it here will be inconsistent. */ + /* XXX -- currently not used -- will introduce more inconsistency, + since shell does not canonicalize ../foo before passing it to + shell_execve(). */ + if (match && searching_path == 0 && *val == '.') + { + char *t, *t1; + + t = get_working_directory ("command-word-completion"); + t1 = make_absolute (val, t); + free (t); + cval = sh_canonpath (t1, PATH_CHECKDOTDOT|PATH_CHECKEXISTS); + } + else +#endif + cval = val; + + if (match && executable_completion ((searching_path ? val : cval), searching_path)) + { + if (cval != val) + free (cval); + free (val); + val = ""; /* So it won't be NULL. */ + return (temp); + } + else + { + if (freetemp) + free (temp); + if (cval != val) + free (cval); + free (val); + goto inner; + } + } +} + +/* Completion inside an unterminated command substitution. */ +static char * +command_subst_completion_function (text, state) + const char *text; + int state; +{ + static char **matches = (char **)NULL; + static const char *orig_start; + static char *filename_text = (char *)NULL; + static int cmd_index, start_len; + char *value; + + if (state == 0) + { + if (filename_text) + free (filename_text); + orig_start = text; + if (*text == '`') + text++; + else if (*text == '$' && text[1] == '(') /* ) */ + text += 2; + /* If the text was quoted, suppress any quote character that the + readline completion code would insert. */ + rl_completion_suppress_quote = 1; + start_len = text - orig_start; + filename_text = savestring (text); + if (matches) + free (matches); + + /* + * At this point we can entertain the idea of re-parsing + * `filename_text' into a (possibly incomplete) command name and + * arguments, and doing completion based on that. This is + * currently very rudimentary, but it is a small improvement. + */ + for (value = filename_text + strlen (filename_text) - 1; value > filename_text; value--) + if (whitespace (*value) || member (*value, COMMAND_SEPARATORS)) + break; + if (value <= filename_text) + matches = rl_completion_matches (filename_text, command_word_completion_function); + else + { + value++; + start_len += value - filename_text; + if (whitespace (value[-1])) + matches = rl_completion_matches (value, rl_filename_completion_function); + else + matches = rl_completion_matches (value, command_word_completion_function); + } + + /* If there is more than one match, rl_completion_matches has already + put the lcd in matches[0]. Skip over it. */ + cmd_index = matches && matches[0] && matches[1]; + + /* If there's a single match and it's a directory, set the append char + to the expected `/'. Otherwise, don't append anything. */ + if (matches && matches[0] && matches[1] == 0 && test_for_directory (matches[0])) + rl_completion_append_character = '/'; + else + rl_completion_suppress_append = 1; + } + + if (matches == 0 || matches[cmd_index] == 0) + { + rl_filename_quoting_desired = 0; /* disable quoting */ + return ((char *)NULL); + } + else + { + value = (char *)xmalloc (1 + start_len + strlen (matches[cmd_index])); + + if (start_len == 1) + value[0] = *orig_start; + else + strncpy (value, orig_start, start_len); + + strcpy (value + start_len, matches[cmd_index]); + + cmd_index++; + return (value); + } +} + +/* Okay, now we write the entry_function for variable completion. */ +static char * +variable_completion_function (text, state) + const char *text; + int state; +{ + static char **varlist = (char **)NULL; + static int varlist_index; + static char *varname = (char *)NULL; + static int namelen; + static int first_char, first_char_loc; + + if (!state) + { + if (varname) + free (varname); + + first_char_loc = 0; + first_char = text[0]; + + if (first_char == '$') + first_char_loc++; + + if (text[first_char_loc] == '{') + first_char_loc++; + + varname = savestring (text + first_char_loc); + + namelen = strlen (varname); + if (varlist) + strvec_dispose (varlist); + + varlist = all_variables_matching_prefix (varname); + varlist_index = 0; + } + + if (!varlist || !varlist[varlist_index]) + { + return ((char *)NULL); + } + else + { + char *value; + + value = (char *)xmalloc (4 + strlen (varlist[varlist_index])); + + if (first_char_loc) + { + value[0] = first_char; + if (first_char_loc == 2) + value[1] = '{'; + } + + strcpy (value + first_char_loc, varlist[varlist_index]); + if (first_char_loc == 2) + strcat (value, "}"); + + varlist_index++; + return (value); + } +} + +/* How about a completion function for hostnames? */ +static char * +hostname_completion_function (text, state) + const char *text; + int state; +{ + static char **list = (char **)NULL; + static int list_index = 0; + static int first_char, first_char_loc; + + /* If we don't have any state, make some. */ + if (state == 0) + { + FREE (list); + + list = (char **)NULL; + + first_char_loc = 0; + first_char = *text; + + if (first_char == '@') + first_char_loc++; + + list = hostnames_matching ((char *)text+first_char_loc); + list_index = 0; + } + + if (list && list[list_index]) + { + char *t; + + t = (char *)xmalloc (2 + strlen (list[list_index])); + *t = first_char; + strcpy (t + first_char_loc, list[list_index]); + list_index++; + return (t); + } + + return ((char *)NULL); +} + +/* + * A completion function for service names from /etc/services (or wherever). + */ +char * +bash_servicename_completion_function (text, state) + const char *text; + int state; +{ +#if defined (__WIN32__) || defined (__OPENNT) || !defined (HAVE_GETSERVENT) + return ((char *)NULL); +#else + static char *sname = (char *)NULL; + static struct servent *srvent; + static int snamelen, firstc; + char *value; + char **alist, *aentry; + int afound; + + if (state == 0) + { + FREE (sname); + firstc = *text; + + sname = savestring (text); + snamelen = strlen (sname); + setservent (0); + } + + while (srvent = getservent ()) + { + afound = 0; + if (snamelen == 0 || (STREQN (sname, srvent->s_name, snamelen))) + break; + /* Not primary, check aliases */ + for (alist = srvent->s_aliases; *alist; alist++) + { + aentry = *alist; + if (STREQN (sname, aentry, snamelen)) + { + afound = 1; + break; + } + } + + if (afound) + break; + } + + if (srvent == 0) + { + endservent (); + return ((char *)NULL); + } + + value = afound ? savestring (aentry) : savestring (srvent->s_name); + return value; +#endif +} + +/* + * A completion function for group names from /etc/group (or wherever). + */ +char * +bash_groupname_completion_function (text, state) + const char *text; + int state; +{ +#if defined (__WIN32__) || defined (__OPENNT) || !defined (HAVE_GRP_H) + return ((char *)NULL); +#else + static char *gname = (char *)NULL; + static struct group *grent; + static int gnamelen; + char *value; + + if (state == 0) + { + FREE (gname); + gname = savestring (text); + gnamelen = strlen (gname); + + setgrent (); + } + + while (grent = getgrent ()) + { + if (gnamelen == 0 || (STREQN (gname, grent->gr_name, gnamelen))) + break; + } + + if (grent == 0) + { + endgrent (); + return ((char *)NULL); + } + + value = savestring (grent->gr_name); + return (value); +#endif +} + +/* Functions to perform history and alias expansions on the current line. */ + +#if defined (BANG_HISTORY) +/* Perform history expansion on the current line. If no history expansion + is done, pre_process_line() returns what it was passed, so we need to + allocate a new line here. */ +static char * +history_expand_line_internal (line) + char *line; +{ + char *new_line; + int old_verify; + + old_verify = hist_verify; + hist_verify = 0; + new_line = pre_process_line (line, 0, 0); + hist_verify = old_verify; + + return (new_line == line) ? savestring (line) : new_line; +} +#endif + +/* There was an error in expansion. Let the preprocessor print + the error here. */ +static void +cleanup_expansion_error () +{ + char *to_free; +#if defined (BANG_HISTORY) + int old_verify; + + old_verify = hist_verify; + hist_verify = 0; +#endif + + fprintf (rl_outstream, "\r\n"); + to_free = pre_process_line (rl_line_buffer, 1, 0); +#if defined (BANG_HISTORY) + hist_verify = old_verify; +#endif + if (to_free != rl_line_buffer) + FREE (to_free); + putc ('\r', rl_outstream); + rl_forced_update_display (); +} + +/* If NEW_LINE differs from what is in the readline line buffer, add an + undo record to get from the readline line buffer contents to the new + line and make NEW_LINE the current readline line. */ +static void +maybe_make_readline_line (new_line) + char *new_line; +{ + if (strcmp (new_line, rl_line_buffer) != 0) + { + rl_point = rl_end; + + rl_add_undo (UNDO_BEGIN, 0, 0, 0); + rl_delete_text (0, rl_point); + rl_point = rl_end = rl_mark = 0; + rl_insert_text (new_line); + rl_add_undo (UNDO_END, 0, 0, 0); + } +} + +/* Make NEW_LINE be the current readline line. This frees NEW_LINE. */ +static void +set_up_new_line (new_line) + char *new_line; +{ + int old_point, at_end; + + old_point = rl_point; + at_end = rl_point == rl_end; + + /* If the line was history and alias expanded, then make that + be one thing to undo. */ + maybe_make_readline_line (new_line); + free (new_line); + + /* Place rl_point where we think it should go. */ + if (at_end) + rl_point = rl_end; + else if (old_point < rl_end) + { + rl_point = old_point; + if (!whitespace (rl_line_buffer[rl_point])) + rl_forward_word (1, 0); + } +} + +#if defined (ALIAS) +/* Expand aliases in the current readline line. */ +static int +alias_expand_line (count, ignore) + int count, ignore; +{ + char *new_line; + + new_line = alias_expand (rl_line_buffer); + + if (new_line) + { + set_up_new_line (new_line); + return (0); + } + else + { + cleanup_expansion_error (); + return (1); + } +} +#endif + +#if defined (BANG_HISTORY) +/* History expand the line. */ +static int +history_expand_line (count, ignore) + int count, ignore; +{ + char *new_line; + + new_line = history_expand_line_internal (rl_line_buffer); + + if (new_line) + { + set_up_new_line (new_line); + return (0); + } + else + { + cleanup_expansion_error (); + return (1); + } +} + +/* Expand history substitutions in the current line and then insert a + space (hopefully close to where we were before). */ +static int +tcsh_magic_space (count, ignore) + int count, ignore; +{ + int dist_from_end, old_point; + + old_point = rl_point; + dist_from_end = rl_end - rl_point; + if (history_expand_line (count, ignore) == 0) + { + /* Try a simple heuristic from Stephen Gildea . + This works if all expansions were before rl_point or if no expansions + were performed. */ + rl_point = (old_point == 0) ? old_point : rl_end - dist_from_end; + rl_insert (1, ' '); + return (0); + } + else + return (1); +} +#endif /* BANG_HISTORY */ + +/* History and alias expand the line. */ +static int +history_and_alias_expand_line (count, ignore) + int count, ignore; +{ + char *new_line; + + new_line = 0; +#if defined (BANG_HISTORY) + new_line = history_expand_line_internal (rl_line_buffer); +#endif + +#if defined (ALIAS) + if (new_line) + { + char *alias_line; + + alias_line = alias_expand (new_line); + free (new_line); + new_line = alias_line; + } +#endif /* ALIAS */ + + if (new_line) + { + set_up_new_line (new_line); + return (0); + } + else + { + cleanup_expansion_error (); + return (1); + } +} + +/* History and alias expand the line, then perform the shell word + expansions by calling expand_string. This can't use set_up_new_line() + because we want the variable expansions as a separate undo'able + set of operations. */ +static int +shell_expand_line (count, ignore) + int count, ignore; +{ + char *new_line; + WORD_LIST *expanded_string; + + new_line = 0; +#if defined (BANG_HISTORY) + new_line = history_expand_line_internal (rl_line_buffer); +#endif + +#if defined (ALIAS) + if (new_line) + { + char *alias_line; + + alias_line = alias_expand (new_line); + free (new_line); + new_line = alias_line; + } +#endif /* ALIAS */ + + if (new_line) + { + int old_point = rl_point; + int at_end = rl_point == rl_end; + + /* If the line was history and alias expanded, then make that + be one thing to undo. */ + maybe_make_readline_line (new_line); + free (new_line); + + /* If there is variable expansion to perform, do that as a separate + operation to be undone. */ + new_line = savestring (rl_line_buffer); + expanded_string = expand_string (new_line, 0); + FREE (new_line); + if (expanded_string == 0) + { + new_line = (char *)xmalloc (1); + new_line[0] = '\0'; + } + else + { + new_line = string_list (expanded_string); + dispose_words (expanded_string); + } + + maybe_make_readline_line (new_line); + free (new_line); + + /* Place rl_point where we think it should go. */ + if (at_end) + rl_point = rl_end; + else if (old_point < rl_end) + { + rl_point = old_point; + if (!whitespace (rl_line_buffer[rl_point])) + rl_forward_word (1, 0); + } + return 0; + } + else + { + cleanup_expansion_error (); + return 1; + } +} + +/* If FIGNORE is set, then don't match files with the given suffixes when + completing filenames. If only one of the possibilities has an acceptable + suffix, delete the others, else just return and let the completer + signal an error. It is called by the completer when real + completions are done on filenames by the completer's internal + function, not for completion lists (M-?) and not on "other" + completion types, such as hostnames or commands. */ + +static struct ignorevar fignore = +{ + "FIGNORE", + (struct ign *)0, + 0, + (char *)0, + (sh_iv_item_func_t *) 0, +}; + +static void +_ignore_completion_names (names, name_func) + char **names; + sh_ignore_func_t *name_func; +{ + char **newnames; + int idx, nidx; + char **oldnames; + int oidx; + + /* If there is only one completion, see if it is acceptable. If it is + not, free it up. In any case, short-circuit and return. This is a + special case because names[0] is not the prefix of the list of names + if there is only one completion; it is the completion itself. */ + if (names[1] == (char *)0) + { + if (force_fignore) + if ((*name_func) (names[0]) == 0) + { + free (names[0]); + names[0] = (char *)NULL; + } + + return; + } + + /* Allocate space for array to hold list of pointers to matching + filenames. The pointers are copied back to NAMES when done. */ + for (nidx = 1; names[nidx]; nidx++) + ; + newnames = strvec_create (nidx + 1); + + if (force_fignore == 0) + { + oldnames = strvec_create (nidx - 1); + oidx = 0; + } + + newnames[0] = names[0]; + for (idx = nidx = 1; names[idx]; idx++) + { + if ((*name_func) (names[idx])) + newnames[nidx++] = names[idx]; + else if (force_fignore == 0) + oldnames[oidx++] = names[idx]; + else + free (names[idx]); + } + + newnames[nidx] = (char *)NULL; + + /* If none are acceptable then let the completer handle it. */ + if (nidx == 1) + { + if (force_fignore) + { + free (names[0]); + names[0] = (char *)NULL; + } + else + free (oldnames); + + free (newnames); + return; + } + + if (force_fignore == 0) + { + while (oidx) + free (oldnames[--oidx]); + free (oldnames); + } + + /* If only one is acceptable, copy it to names[0] and return. */ + if (nidx == 2) + { + free (names[0]); + names[0] = newnames[1]; + names[1] = (char *)NULL; + free (newnames); + return; + } + + /* Copy the acceptable names back to NAMES, set the new array end, + and return. */ + for (nidx = 1; newnames[nidx]; nidx++) + names[nidx] = newnames[nidx]; + names[nidx] = (char *)NULL; + free (newnames); +} + +static int +name_is_acceptable (name) + const char *name; +{ + struct ign *p; + int nlen; + + for (nlen = strlen (name), p = fignore.ignores; p->val; p++) + { + if (nlen > p->len && p->len > 0 && STREQ (p->val, &name[nlen - p->len])) + return (0); + } + + return (1); +} + +#if 0 +static int +ignore_dot_names (name) + char *name; +{ + return (name[0] != '.'); +} +#endif + +static int +filename_completion_ignore (names) + char **names; +{ +#if 0 + if (glob_dot_filenames == 0) + _ignore_completion_names (names, ignore_dot_names); +#endif + + setup_ignore_patterns (&fignore); + + if (fignore.num_ignores == 0) + return 0; + + _ignore_completion_names (names, name_is_acceptable); + + return 0; +} + +/* Return 1 if NAME is a directory. NAME undergoes tilde expansion. */ +static int +test_for_directory (name) + const char *name; +{ + char *fn; + int r; + + fn = bash_tilde_expand (name, 0); + r = file_isdir (fn); + free (fn); + + return (r); +} + +/* Remove files from NAMES, leaving directories. */ +static int +bash_ignore_filenames (names) + char **names; +{ + _ignore_completion_names (names, test_for_directory); + return 0; +} + +static int +return_zero (name) + const char *name; +{ + return 0; +} + +static int +bash_ignore_everything (names) + char **names; +{ + _ignore_completion_names (names, return_zero); + return 0; +} + +/* Replace a tilde-prefix in VAL with a `~', assuming the user typed it. VAL + is an expanded filename. DIRECTORY_PART is the tilde-prefix portion + of the un-tilde-expanded version of VAL (what the user typed). */ +static char * +restore_tilde (val, directory_part) + char *val, *directory_part; +{ + int l, vl, dl2, xl; + char *dh2, *expdir, *ret; + + vl = strlen (val); + + /* We need to duplicate the expansions readline performs on the directory + portion before passing it to our completion function. */ + dh2 = directory_part ? bash_dequote_filename (directory_part, 0) : 0; + bash_directory_expansion (&dh2); + dl2 = strlen (dh2); + + expdir = bash_tilde_expand (directory_part, 0); + xl = strlen (expdir); + free (expdir); + + /* + dh2 = unexpanded but dequoted tilde-prefix + dl2 = length of tilde-prefix + expdir = tilde-expanded tilde-prefix + xl = length of expanded tilde-prefix + l = length of remainder after tilde-prefix + */ + l = (vl - xl) + 1; + + ret = (char *)xmalloc (dl2 + 2 + l); + strcpy (ret, dh2); + strcpy (ret + dl2, val + xl); + + free (dh2); + return (ret); +} + +static char * +maybe_restore_tilde (val, directory_part) + char *val, *directory_part; +{ + rl_icppfunc_t *save; + char *ret; + + save = (dircomplete_expand == 0) ? save_directory_hook () : (rl_icppfunc_t *)0; + ret = restore_tilde (val, directory_part); + if (save) + restore_directory_hook (save); + return ret; +} + +/* Simulate the expansions that will be performed by + rl_filename_completion_function. This must be called with the address of + a pointer to malloc'd memory. */ +static void +bash_directory_expansion (dirname) + char **dirname; +{ + char *d, *nd; + + d = savestring (*dirname); + + if ((rl_directory_rewrite_hook) && (*rl_directory_rewrite_hook) (&d)) + { + free (*dirname); + *dirname = d; + } + else if (rl_directory_completion_hook && (*rl_directory_completion_hook) (&d)) + { + free (*dirname); + *dirname = d; + } + else if (rl_completion_found_quote) + { + nd = bash_dequote_filename (d, rl_completion_quote_character); + free (*dirname); + free (d); + *dirname = nd; + } +} + +/* If necessary, rewrite directory entry */ +static char * +bash_filename_rewrite_hook (fname, fnlen) + char *fname; + int fnlen; +{ + char *conv; + + conv = fnx_fromfs (fname, fnlen); + if (conv != fname) + conv = savestring (conv); + return conv; +} + +/* Functions to save and restore the appropriate directory hook */ +/* This is not static so the shopt code can call it */ +void +set_directory_hook () +{ + if (dircomplete_expand) + { + rl_directory_completion_hook = bash_directory_completion_hook; + rl_directory_rewrite_hook = (rl_icppfunc_t *)0; + } + else + { + rl_directory_rewrite_hook = bash_directory_completion_hook; + rl_directory_completion_hook = (rl_icppfunc_t *)0; + } +} + +static rl_icppfunc_t * +save_directory_hook () +{ + rl_icppfunc_t *ret; + + if (dircomplete_expand) + { + ret = rl_directory_completion_hook; + rl_directory_completion_hook = (rl_icppfunc_t *)NULL; + } + else + { + ret = rl_directory_rewrite_hook; + rl_directory_rewrite_hook = (rl_icppfunc_t *)NULL; + } + + return ret; +} + +static void +restore_directory_hook (hookf) + rl_icppfunc_t *hookf; +{ + if (dircomplete_expand) + rl_directory_completion_hook = hookf; + else + rl_directory_rewrite_hook = hookf; +} + +/* Expand a filename before the readline completion code passes it to stat(2). + The filename will already have had tilde expansion performed. */ +static int +bash_filename_stat_hook (dirname) + char **dirname; +{ + char *local_dirname, *new_dirname, *t; + int should_expand_dirname, return_value; + WORD_LIST *wl; + struct stat sb; + + local_dirname = *dirname; + should_expand_dirname = return_value = 0; + if (t = mbschr (local_dirname, '$')) + should_expand_dirname = '$'; + else if (t = mbschr (local_dirname, '`')) /* XXX */ + should_expand_dirname = '`'; + +#if defined (HAVE_LSTAT) + if (should_expand_dirname && lstat (local_dirname, &sb) == 0) +#else + if (should_expand_dirname && stat (local_dirname, &sb) == 0) +#endif + should_expand_dirname = 0; + + if (should_expand_dirname) + { + new_dirname = savestring (local_dirname); + wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB); /* does the right thing */ + if (wl) + { + free (new_dirname); + new_dirname = string_list (wl); + /* Tell the completer we actually expanded something and change + *dirname only if we expanded to something non-null -- stat + behaves unpredictably when passed null or empty strings */ + if (new_dirname && *new_dirname) + { + free (local_dirname); /* XXX */ + local_dirname = *dirname = new_dirname; + return_value = STREQ (local_dirname, *dirname) == 0; + } + else + free (new_dirname); + dispose_words (wl); + } + else + free (new_dirname); + } + + /* This is very similar to the code in bash_directory_completion_hook below, + but without spelling correction and not worrying about whether or not + we change relative pathnames. */ + if (no_symbolic_links == 0 && (local_dirname[0] != '.' || local_dirname[1])) + { + char *temp1, *temp2; + + t = get_working_directory ("symlink-hook"); + temp1 = make_absolute (local_dirname, t); + free (t); + temp2 = sh_canonpath (temp1, PATH_CHECKDOTDOT|PATH_CHECKEXISTS); + + /* If we can't canonicalize, bail. */ + if (temp2 == 0) + { + free (temp1); + return return_value; + } + + free (local_dirname); + *dirname = temp2; + free (temp1); + } + + return (return_value); +} + +/* Handle symbolic link references and other directory name + expansions while hacking completion. This should return 1 if it modifies + the DIRNAME argument, 0 otherwise. It should make sure not to modify + DIRNAME if it returns 0. */ +static int +bash_directory_completion_hook (dirname) + char **dirname; +{ + char *local_dirname, *new_dirname, *t; + int return_value, should_expand_dirname, nextch, closer; + WORD_LIST *wl; + struct stat sb; + + return_value = should_expand_dirname = nextch = closer = 0; + local_dirname = *dirname; + + if (t = mbschr (local_dirname, '$')) + { + should_expand_dirname = '$'; + nextch = t[1]; + /* Deliberately does not handle the deprecated $[...] arithmetic + expansion syntax */ + if (nextch == '(') + closer = ')'; + else if (nextch == '{') + closer = '}'; + else + nextch = 0; + } + else if (local_dirname[0] == '~') + should_expand_dirname = '~'; + else + { + t = mbschr (local_dirname, '`'); + if (t && unclosed_pair (local_dirname, strlen (local_dirname), "`") == 0) + should_expand_dirname = '`'; + } + +#if defined (HAVE_LSTAT) + if (should_expand_dirname && lstat (local_dirname, &sb) == 0) +#else + if (should_expand_dirname && stat (local_dirname, &sb) == 0) +#endif + should_expand_dirname = 0; + + if (should_expand_dirname) + { + new_dirname = savestring (local_dirname); + wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB); /* does the right thing */ + if (wl) + { + *dirname = string_list (wl); + /* Tell the completer to replace the directory name only if we + actually expanded something. */ + return_value = STREQ (local_dirname, *dirname) == 0; + free (local_dirname); + free (new_dirname); + dispose_words (wl); + local_dirname = *dirname; + /* XXX - change rl_filename_quote_characters here based on + should_expand_dirname/nextch/closer. This is the only place + custom_filename_quote_characters is modified. */ + if (rl_filename_quote_characters && *rl_filename_quote_characters) + { + int i, j, c; + i = strlen (default_filename_quote_characters); + custom_filename_quote_characters = xrealloc (custom_filename_quote_characters, i+1); + for (i = j = 0; c = default_filename_quote_characters[i]; i++) + { + if (c == should_expand_dirname || c == nextch || c == closer) + continue; + custom_filename_quote_characters[j++] = c; + } + custom_filename_quote_characters[j] = '\0'; + rl_filename_quote_characters = custom_filename_quote_characters; + set_filename_bstab (rl_filename_quote_characters); + } + } + else + { + free (new_dirname); + free (local_dirname); + *dirname = (char *)xmalloc (1); + **dirname = '\0'; + return 1; + } + } + else + { + /* Dequote the filename even if we don't expand it. */ + new_dirname = bash_dequote_filename (local_dirname, rl_completion_quote_character); + return_value = STREQ (local_dirname, new_dirname) == 0; + free (local_dirname); + local_dirname = *dirname = new_dirname; + } + + /* no_symbolic_links == 0 -> use (default) logical view of the file system. + local_dirname[0] == '.' && local_dirname[1] == '/' means files in the + current directory (./). + local_dirname[0] == '.' && local_dirname[1] == 0 means relative pathnames + in the current directory (e.g., lib/sh). + XXX - should we do spelling correction on these? */ + + /* This is test as it was in bash-4.2: skip relative pathnames in current + directory. Change test to + (local_dirname[0] != '.' || (local_dirname[1] && local_dirname[1] != '/')) + if we want to skip paths beginning with ./ also. */ + if (no_symbolic_links == 0 && (local_dirname[0] != '.' || local_dirname[1])) + { + char *temp1, *temp2; + int len1, len2; + + /* If we have a relative path + (local_dirname[0] != '/' && local_dirname[0] != '.') + that is canonical after appending it to the current directory, then + temp1 = temp2+'/' + That is, + strcmp (temp1, temp2) == 0 + after adding a slash to temp2 below. It should be safe to not + change those. + */ + t = get_working_directory ("symlink-hook"); + temp1 = make_absolute (local_dirname, t); + free (t); + temp2 = sh_canonpath (temp1, PATH_CHECKDOTDOT|PATH_CHECKEXISTS); + + /* Try spelling correction if initial canonicalization fails. Make + sure we are set to replace the directory name with the results so + subsequent directory checks don't fail. */ + if (temp2 == 0 && dircomplete_spelling && dircomplete_expand) + { + temp2 = dirspell (temp1); + if (temp2) + { + free (temp1); + temp1 = temp2; + temp2 = sh_canonpath (temp1, PATH_CHECKDOTDOT|PATH_CHECKEXISTS); + return_value |= temp2 != 0; + } + } + /* If we can't canonicalize, bail. */ + if (temp2 == 0) + { + free (temp1); + return return_value; + } + len1 = strlen (temp1); + if (temp1[len1 - 1] == '/') + { + len2 = strlen (temp2); + if (len2 > 2) /* don't append `/' to `/' or `//' */ + { + temp2 = (char *)xrealloc (temp2, len2 + 2); + temp2[len2] = '/'; + temp2[len2 + 1] = '\0'; + } + } + + /* dircomplete_expand_relpath == 0 means we want to leave relative + pathnames that are unchanged by canonicalization alone. + *local_dirname != '/' && *local_dirname != '.' == relative pathname + (consistent with general.c:absolute_pathname()) + temp1 == temp2 (after appending a slash to temp2) means the pathname + is not changed by canonicalization as described above. */ + if (dircomplete_expand_relpath || ((local_dirname[0] != '/' && local_dirname[0] != '.') && STREQ (temp1, temp2) == 0)) + return_value |= STREQ (local_dirname, temp2) == 0; + free (local_dirname); + *dirname = temp2; + free (temp1); + } + + return (return_value); +} + +static char **history_completion_array = (char **)NULL; +static int harry_size; +static int harry_len; + +static void +build_history_completion_array () +{ + register int i, j; + HIST_ENTRY **hlist; + char **tokens; + + /* First, clear out the current dynamic history completion list. */ + if (harry_size) + { + strvec_dispose (history_completion_array); + history_completion_array = (char **)NULL; + harry_size = 0; + harry_len = 0; + } + + /* Next, grovel each line of history, making each shell-sized token + a separate entry in the history_completion_array. */ + hlist = history_list (); + + if (hlist) + { + for (i = 0; hlist[i]; i++) + ; + for ( --i; i >= 0; i--) + { + /* Separate each token, and place into an array. */ + tokens = history_tokenize (hlist[i]->line); + + for (j = 0; tokens && tokens[j]; j++) + { + if (harry_len + 2 > harry_size) + history_completion_array = strvec_resize (history_completion_array, harry_size += 10); + + history_completion_array[harry_len++] = tokens[j]; + history_completion_array[harry_len] = (char *)NULL; + } + free (tokens); + } + + /* Sort the complete list of tokens. */ + if (dabbrev_expand_active == 0) + qsort (history_completion_array, harry_len, sizeof (char *), (QSFUNC *)strvec_strcmp); + } +} + +static char * +history_completion_generator (hint_text, state) + const char *hint_text; + int state; +{ + static int local_index, len; + static const char *text; + + /* If this is the first call to the generator, then initialize the + list of strings to complete over. */ + if (state == 0) + { + if (dabbrev_expand_active) /* This is kind of messy */ + rl_completion_suppress_append = 1; + local_index = 0; + build_history_completion_array (); + text = hint_text; + len = strlen (text); + } + + while (history_completion_array && history_completion_array[local_index]) + { + if (strncmp (text, history_completion_array[local_index++], len) == 0) + return (savestring (history_completion_array[local_index - 1])); + } + return ((char *)NULL); +} + +static int +dynamic_complete_history (count, key) + int count, key; +{ + int r; + rl_compentry_func_t *orig_func; + rl_completion_func_t *orig_attempt_func; + rl_compignore_func_t *orig_ignore_func; + + orig_func = rl_completion_entry_function; + orig_attempt_func = rl_attempted_completion_function; + orig_ignore_func = rl_ignore_some_completions_function; + + rl_completion_entry_function = history_completion_generator; + rl_attempted_completion_function = (rl_completion_func_t *)NULL; + rl_ignore_some_completions_function = filename_completion_ignore; + + /* XXX - use rl_completion_mode here? */ + if (rl_last_func == dynamic_complete_history) + r = rl_complete_internal ('?'); + else + r = rl_complete_internal (TAB); + + rl_completion_entry_function = orig_func; + rl_attempted_completion_function = orig_attempt_func; + rl_ignore_some_completions_function = orig_ignore_func; + + return r; +} + +static int +bash_dabbrev_expand (count, key) + int count, key; +{ + int r, orig_suppress, orig_sort; + rl_compentry_func_t *orig_func; + rl_completion_func_t *orig_attempt_func; + rl_compignore_func_t *orig_ignore_func; + + orig_func = rl_menu_completion_entry_function; + orig_attempt_func = rl_attempted_completion_function; + orig_ignore_func = rl_ignore_some_completions_function; + orig_suppress = rl_completion_suppress_append; + orig_sort = rl_sort_completion_matches; + + rl_menu_completion_entry_function = history_completion_generator; + rl_attempted_completion_function = (rl_completion_func_t *)NULL; + rl_ignore_some_completions_function = filename_completion_ignore; + rl_filename_completion_desired = 0; + rl_completion_suppress_append = 1; + rl_sort_completion_matches = 0; + + /* XXX - use rl_completion_mode here? */ + dabbrev_expand_active = 1; + if (rl_last_func == bash_dabbrev_expand) + rl_last_func = rl_menu_complete; + r = rl_menu_complete (count, key); + dabbrev_expand_active = 0; + + rl_last_func = bash_dabbrev_expand; + rl_menu_completion_entry_function = orig_func; + rl_attempted_completion_function = orig_attempt_func; + rl_ignore_some_completions_function = orig_ignore_func; + rl_completion_suppress_append = orig_suppress; + rl_sort_completion_matches = orig_sort; + + return r; +} + +#if defined (SPECIFIC_COMPLETION_FUNCTIONS) +static int +bash_complete_username (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_username_internal (rl_completion_mode (bash_complete_username)); +} + +static int +bash_possible_username_completions (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_username_internal ('?'); +} + +static int +bash_complete_username_internal (what_to_do) + int what_to_do; +{ + return bash_specific_completion (what_to_do, rl_username_completion_function); +} + +static int +bash_complete_filename (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_filename_internal (rl_completion_mode (bash_complete_filename)); +} + +static int +bash_possible_filename_completions (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_filename_internal ('?'); +} + +static int +bash_complete_filename_internal (what_to_do) + int what_to_do; +{ + rl_compentry_func_t *orig_func; + rl_completion_func_t *orig_attempt_func; + rl_icppfunc_t *orig_dir_func; + rl_compignore_func_t *orig_ignore_func; + /*const*/ char *orig_rl_completer_word_break_characters; + int r; + + orig_func = rl_completion_entry_function; + orig_attempt_func = rl_attempted_completion_function; + orig_ignore_func = rl_ignore_some_completions_function; + orig_rl_completer_word_break_characters = rl_completer_word_break_characters; + + orig_dir_func = save_directory_hook (); + + rl_completion_entry_function = rl_filename_completion_function; + rl_attempted_completion_function = (rl_completion_func_t *)NULL; + rl_ignore_some_completions_function = filename_completion_ignore; + rl_completer_word_break_characters = " \t\n\"\'"; + + r = rl_complete_internal (what_to_do); + + rl_completion_entry_function = orig_func; + rl_attempted_completion_function = orig_attempt_func; + rl_ignore_some_completions_function = orig_ignore_func; + rl_completer_word_break_characters = orig_rl_completer_word_break_characters; + + restore_directory_hook (orig_dir_func); + + return r; +} + +static int +bash_complete_hostname (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_hostname_internal (rl_completion_mode (bash_complete_hostname)); +} + +static int +bash_possible_hostname_completions (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_hostname_internal ('?'); +} + +static int +bash_complete_variable (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_variable_internal (rl_completion_mode (bash_complete_variable)); +} + +static int +bash_possible_variable_completions (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_variable_internal ('?'); +} + +static int +bash_complete_command (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_command_internal (rl_completion_mode (bash_complete_command)); +} + +static int +bash_possible_command_completions (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_command_internal ('?'); +} + +static int +bash_complete_hostname_internal (what_to_do) + int what_to_do; +{ + return bash_specific_completion (what_to_do, hostname_completion_function); +} + +static int +bash_complete_variable_internal (what_to_do) + int what_to_do; +{ + return bash_specific_completion (what_to_do, variable_completion_function); +} + +static int +bash_complete_command_internal (what_to_do) + int what_to_do; +{ + return bash_specific_completion (what_to_do, command_word_completion_function); +} + +static char *globtext; +static char *globorig; + +static char * +glob_complete_word (text, state) + const char *text; + int state; +{ + static char **matches = (char **)NULL; + static int ind; + int glen; + char *ret, *ttext; + + if (state == 0) + { + rl_filename_completion_desired = 1; + FREE (matches); + if (globorig != globtext) + FREE (globorig); + FREE (globtext); + + ttext = bash_tilde_expand (text, 0); + + if (rl_explicit_arg) + { + globorig = savestring (ttext); + glen = strlen (ttext); + globtext = (char *)xmalloc (glen + 2); + strcpy (globtext, ttext); + globtext[glen] = '*'; + globtext[glen+1] = '\0'; + } + else + globtext = globorig = savestring (ttext); + + if (ttext != text) + free (ttext); + + matches = shell_glob_filename (globtext); + if (GLOB_FAILED (matches)) + matches = (char **)NULL; + ind = 0; + } + + ret = matches ? matches[ind] : (char *)NULL; + ind++; + return ret; +} + +static int +bash_glob_completion_internal (what_to_do) + int what_to_do; +{ + return bash_specific_completion (what_to_do, glob_complete_word); +} + +/* A special quoting function so we don't end up quoting globbing characters + in the word if there are no matches or multiple matches. */ +static char * +bash_glob_quote_filename (s, rtype, qcp) + char *s; + int rtype; + char *qcp; +{ + if (globorig && qcp && *qcp == '\0' && STREQ (s, globorig)) + return (savestring (s)); + else + return (bash_quote_filename (s, rtype, qcp)); +} + +static int +bash_glob_complete_word (count, key) + int count, key; +{ + int r; + rl_quote_func_t *orig_quoting_function; + + if (rl_editing_mode == EMACS_EDITING_MODE) + rl_explicit_arg = 1; /* force `*' append */ + orig_quoting_function = rl_filename_quoting_function; + rl_filename_quoting_function = bash_glob_quote_filename; + + r = bash_glob_completion_internal (rl_completion_mode (bash_glob_complete_word)); + + rl_filename_quoting_function = orig_quoting_function; + return r; +} + +static int +bash_glob_expand_word (count, key) + int count, key; +{ + return bash_glob_completion_internal ('*'); +} + +static int +bash_glob_list_expansions (count, key) + int count, key; +{ + return bash_glob_completion_internal ('?'); +} + +static int +bash_specific_completion (what_to_do, generator) + int what_to_do; + rl_compentry_func_t *generator; +{ + rl_compentry_func_t *orig_func; + rl_completion_func_t *orig_attempt_func; + rl_compignore_func_t *orig_ignore_func; + int r; + + orig_func = rl_completion_entry_function; + orig_attempt_func = rl_attempted_completion_function; + orig_ignore_func = rl_ignore_some_completions_function; + rl_completion_entry_function = generator; + rl_attempted_completion_function = NULL; + rl_ignore_some_completions_function = orig_ignore_func; + + r = rl_complete_internal (what_to_do); + + rl_completion_entry_function = orig_func; + rl_attempted_completion_function = orig_attempt_func; + rl_ignore_some_completions_function = orig_ignore_func; + + return r; +} + +#endif /* SPECIFIC_COMPLETION_FUNCTIONS */ + +#if defined (VI_MODE) +/* Completion, from vi mode's point of view. This is a modified version of + rl_vi_complete which uses the bash globbing code to implement what POSIX + specifies, which is to append a `*' and attempt filename generation (which + has the side effect of expanding any globbing characters in the word). */ +static int +bash_vi_complete (count, key) + int count, key; +{ +#if defined (SPECIFIC_COMPLETION_FUNCTIONS) + int p, r; + char *t; + + if ((rl_point < rl_end) && (!whitespace (rl_line_buffer[rl_point]))) + { + if (!whitespace (rl_line_buffer[rl_point + 1])) + rl_vi_end_word (1, 'E'); + rl_point++; + } + + /* Find boundaries of current word, according to vi definition of a + `bigword'. */ + t = 0; + if (rl_point > 0) + { + p = rl_point; + rl_vi_bWord (1, 'B'); + r = rl_point; + rl_point = p; + p = r; + + t = substring (rl_line_buffer, p, rl_point); + } + + if (t && glob_pattern_p (t) == 0) + rl_explicit_arg = 1; /* XXX - force glob_complete_word to append `*' */ + FREE (t); + + if (key == '*') /* Expansion and replacement. */ + r = bash_glob_expand_word (count, key); + else if (key == '=') /* List possible completions. */ + r = bash_glob_list_expansions (count, key); + else if (key == '\\') /* Standard completion */ + r = bash_glob_complete_word (count, key); + else + r = rl_complete (0, key); + + if (key == '*' || key == '\\') + rl_vi_start_inserting (key, 1, 1); + + return (r); +#else + return rl_vi_complete (count, key); +#endif /* !SPECIFIC_COMPLETION_FUNCTIONS */ +} +#endif /* VI_MODE */ + +/* Filename quoting for completion. */ +/* A function to strip unquoted quote characters (single quotes, double + quotes, and backslashes). It allows single quotes to appear + within double quotes, and vice versa. It should be smarter. */ +static char * +bash_dequote_filename (text, quote_char) + char *text; + int quote_char; +{ + char *ret, *p, *r; + int l, quoted; + + l = strlen (text); + ret = (char *)xmalloc (l + 1); + for (quoted = quote_char, p = text, r = ret; p && *p; p++) + { + /* Allow backslash-escaped characters to pass through unscathed. */ + if (*p == '\\') + { + /* Backslashes are preserved within single quotes. */ + if (quoted == '\'') + *r++ = *p; + /* Backslashes are preserved within double quotes unless the + character is one that is defined to be escaped */ + else if (quoted == '"' && ((sh_syntaxtab[p[1]] & CBSDQUOTE) == 0)) + *r++ = *p; + + *r++ = *++p; + if (*p == '\0') + return ret; /* XXX - was break; */ + continue; + } + /* Close quote. */ + if (quoted && *p == quoted) + { + quoted = 0; + continue; + } + /* Open quote. */ + if (quoted == 0 && (*p == '\'' || *p == '"')) + { + quoted = *p; + continue; + } + *r++ = *p; + } + *r = '\0'; + return ret; +} + +/* Quote characters that the readline completion code would treat as + word break characters with backslashes. Pass backslash-quoted + characters through without examination. */ +static char * +quote_word_break_chars (text) + char *text; +{ + char *ret, *r, *s; + int l; + + l = strlen (text); + ret = (char *)xmalloc ((2 * l) + 1); + for (s = text, r = ret; *s; s++) + { + /* Pass backslash-quoted characters through, including the backslash. */ + if (*s == '\\') + { + *r++ = '\\'; + *r++ = *++s; + if (*s == '\0') + break; + continue; + } + /* OK, we have an unquoted character. Check its presence in + rl_completer_word_break_characters. */ + if (mbschr (rl_completer_word_break_characters, *s)) + *r++ = '\\'; + /* XXX -- check for standalone tildes here and backslash-quote them */ + if (s == text && *s == '~' && file_exists (text)) + *r++ = '\\'; + *r++ = *s; + } + *r = '\0'; + return ret; +} + +/* Use characters in STRING to populate the table of characters that should + be backslash-quoted. The table will be used for sh_backslash_quote from + this file. */ +static void +set_filename_bstab (string) + const char *string; +{ + const char *s; + + memset (filename_bstab, 0, sizeof (filename_bstab)); + for (s = string; s && *s; s++) + filename_bstab[*s] = 1; +} + +/* Quote a filename using double quotes, single quotes, or backslashes + depending on the value of completion_quoting_style. If we're + completing using backslashes, we need to quote some additional + characters (those that readline treats as word breaks), so we call + quote_word_break_chars on the result. This returns newly-allocated + memory. */ +static char * +bash_quote_filename (s, rtype, qcp) + char *s; + int rtype; + char *qcp; +{ + char *rtext, *mtext, *ret; + int rlen, cs; + + rtext = (char *)NULL; + + /* If RTYPE == MULT_MATCH, it means that there is + more than one match. In this case, we do not add + the closing quote or attempt to perform tilde + expansion. If RTYPE == SINGLE_MATCH, we try + to perform tilde expansion, because single and double + quotes inhibit tilde expansion by the shell. */ + + cs = completion_quoting_style; + /* Might need to modify the default completion style based on *qcp, + since it's set to any user-provided opening quote. We also change + to single-quoting if there is no user-provided opening quote and + the word being completed contains newlines, since those are not + quoted correctly using backslashes (a backslash-newline pair is + special to the shell parser). */ + if (*qcp == '\0' && cs == COMPLETE_BSQUOTE && mbschr (s, '\n')) + cs = COMPLETE_SQUOTE; + else if (*qcp == '"') + cs = COMPLETE_DQUOTE; + else if (*qcp == '\'') + cs = COMPLETE_SQUOTE; +#if defined (BANG_HISTORY) + else if (*qcp == '\0' && history_expansion && cs == COMPLETE_DQUOTE && + history_expansion_inhibited == 0 && mbschr (s, '!')) + cs = COMPLETE_BSQUOTE; + + if (*qcp == '"' && history_expansion && cs == COMPLETE_DQUOTE && + history_expansion_inhibited == 0 && mbschr (s, '!')) + { + cs = COMPLETE_BSQUOTE; + *qcp = '\0'; + } +#endif + + /* Don't tilde-expand backslash-quoted filenames, since only single and + double quotes inhibit tilde expansion. */ + mtext = s; + if (mtext[0] == '~' && rtype == SINGLE_MATCH && cs != COMPLETE_BSQUOTE) + mtext = bash_tilde_expand (s, 0); + + switch (cs) + { + case COMPLETE_DQUOTE: + rtext = sh_double_quote (mtext); + break; + case COMPLETE_SQUOTE: + rtext = sh_single_quote (mtext); + break; + case COMPLETE_BSQUOTE: + rtext = sh_backslash_quote (mtext, complete_fullquote ? 0 : filename_bstab, 0); + break; + } + + if (mtext != s) + free (mtext); + + /* We may need to quote additional characters: those that readline treats + as word breaks that are not quoted by backslash_quote. */ + if (rtext && cs == COMPLETE_BSQUOTE) + { + mtext = quote_word_break_chars (rtext); + free (rtext); + rtext = mtext; + } + + /* Leave the opening quote intact. The readline completion code takes + care of avoiding doubled opening quotes. */ + if (rtext) + { + rlen = strlen (rtext); + ret = (char *)xmalloc (rlen + 1); + strcpy (ret, rtext); + } + else + { + ret = (char *)xmalloc (rlen = 1); + ret[0] = '\0'; + } + + /* If there are multiple matches, cut off the closing quote. */ + if (rtype == MULT_MATCH && cs != COMPLETE_BSQUOTE) + ret[rlen - 1] = '\0'; + free (rtext); + return ret; +} + +/* Support for binding readline key sequences to Unix commands. */ +static Keymap cmd_xmap; + +#ifdef _MINIX +static void +#else +static int +#endif +putx(c) + int c; +{ + int x; + x = putc (c, rl_outstream); +#ifndef _MINIX + return x; +#endif +} + +static int +bash_execute_unix_command (count, key) + int count; /* ignored */ + int key; +{ + Keymap ckmap; /* current keymap */ + Keymap xkmap; /* unix command executing keymap */ + rl_command_func_t *func; + int type; + register int i, r; + intmax_t mi; + sh_parser_state_t ps; + char *cmd, *value, *l, *l1, *ce; + SHELL_VAR *v; + char ibuf[INT_STRLEN_BOUND(int) + 1]; + + /* First, we need to find the right command to execute. This is tricky, + because we might have already indirected into another keymap, so we + have to walk cmd_xmap using the entire key sequence. */ + cmd = (char *)rl_function_of_keyseq (rl_executing_keyseq, cmd_xmap, &type); + + if (cmd == 0 || type != ISMACR) + { + rl_crlf (); + internal_error (_("bash_execute_unix_command: cannot find keymap for command")); + rl_forced_update_display (); + return 1; + } + + ce = rl_get_termcap ("ce"); + if (ce) /* clear current line */ + { + fprintf (rl_outstream, "\r"); + tputs (ce, 1, putx); + fflush (rl_outstream); + } + else + rl_crlf (); /* move to a new line */ + + v = bind_variable ("READLINE_LINE", rl_line_buffer, 0); + if (v) + VSETATTR (v, att_exported); + l = v ? value_cell (v) : 0; + value = inttostr (rl_point, ibuf, sizeof (ibuf)); + v = bind_int_variable ("READLINE_POINT", value); + if (v) + VSETATTR (v, att_exported); + array_needs_making = 1; + + save_parser_state (&ps); + r = parse_and_execute (cmd, "bash_execute_unix_command", SEVAL_NOHIST|SEVAL_NOFREE); + restore_parser_state (&ps); + + v = find_variable ("READLINE_LINE"); + l1 = v ? value_cell (v) : 0; + if (l1 != l) + maybe_make_readline_line (value_cell (v)); + v = find_variable ("READLINE_POINT"); + if (v && legal_number (value_cell (v), &mi)) + { + i = mi; + if (i != rl_point) + { + rl_point = i; + if (rl_point > rl_end) + rl_point = rl_end; + else if (rl_point < 0) + rl_point = 0; + } + } + + unbind_variable ("READLINE_LINE"); + unbind_variable ("READLINE_POINT"); + array_needs_making = 1; + + /* and restore the readline buffer and display after command execution. */ + rl_forced_update_display (); + return 0; +} + +int +print_unix_command_map () +{ + Keymap save; + + save = rl_get_keymap (); + rl_set_keymap (cmd_xmap); + rl_macro_dumper (1); + rl_set_keymap (save); + return 0; +} + +static void +init_unix_command_map () +{ + cmd_xmap = rl_make_bare_keymap (); +} + +static int +isolate_sequence (string, ind, need_dquote, startp) + char *string; + int ind, need_dquote, *startp; +{ + register int i; + int c, passc, delim; + + for (i = ind; string[i] && whitespace (string[i]); i++) + ; + /* NEED_DQUOTE means that the first non-white character *must* be `"'. */ + if (need_dquote && string[i] != '"') + { + builtin_error (_("%s: first non-whitespace character is not `\"'"), string); + return -1; + } + + /* We can have delimited strings even if NEED_DQUOTE == 0, like the command + string to bind the key sequence to. */ + delim = (string[i] == '"' || string[i] == '\'') ? string[i] : 0; + + if (startp) + *startp = delim ? ++i : i; + + for (passc = 0; c = string[i]; i++) + { + if (passc) + { + passc = 0; + continue; + } + if (c == '\\') + { + passc++; + continue; + } + if (c == delim) + break; + } + + if (delim && string[i] != delim) + { + builtin_error (_("no closing `%c' in %s"), delim, string); + return -1; + } + + return i; +} + +int +bind_keyseq_to_unix_command (line) + char *line; +{ + Keymap kmap; + char *kseq, *value; + int i, kstart; + + if (cmd_xmap == 0) + init_unix_command_map (); + + kmap = rl_get_keymap (); + + /* We duplicate some of the work done by rl_parse_and_bind here, but + this code only has to handle `"keyseq": ["]command["]' and can + generate an error for anything else. */ + i = isolate_sequence (line, 0, 1, &kstart); + if (i < 0) + return -1; + + /* Create the key sequence string to pass to rl_generic_bind */ + kseq = substring (line, kstart, i); + + for ( ; line[i] && line[i] != ':'; i++) + ; + if (line[i] != ':') + { + builtin_error (_("%s: missing colon separator"), line); + FREE (kseq); + return -1; + } + + i = isolate_sequence (line, i + 1, 0, &kstart); + if (i < 0) + { + FREE (kseq); + return -1; + } + + /* Create the value string containing the command to execute. */ + value = substring (line, kstart, i); + + /* Save the command to execute and the key sequence in the CMD_XMAP */ + rl_generic_bind (ISMACR, kseq, value, cmd_xmap); + + /* and bind the key sequence in the current keymap to a function that + understands how to execute from CMD_XMAP */ + rl_bind_keyseq_in_map (kseq, bash_execute_unix_command, kmap); + + free (kseq); + return 0; +} + +/* Used by the programmable completion code. Complete TEXT as a filename, + but return only directories as matches. Dequotes the filename before + attempting to find matches. */ +char ** +bash_directory_completion_matches (text) + const char *text; +{ + char **m1; + char *dfn; + int qc; + + qc = rl_dispatching ? rl_completion_quote_character : 0; + dfn = bash_dequote_filename ((char *)text, qc); + m1 = rl_completion_matches (dfn, rl_filename_completion_function); + free (dfn); + + if (m1 == 0 || m1[0] == 0) + return m1; + /* We don't bother recomputing the lcd of the matches, because it will just + get thrown away by the programmable completion code and recomputed + later. */ + (void)bash_ignore_filenames (m1); + return m1; +} + +char * +bash_dequote_text (text) + const char *text; +{ + char *dtxt; + int qc; + + qc = (text[0] == '"' || text[0] == '\'') ? text[0] : 0; + dtxt = bash_dequote_filename ((char *)text, qc); + return (dtxt); +} + +/* This event hook is designed to be called after readline receives a signal + that interrupts read(2). It gives reasonable responsiveness to interrupts + and fatal signals without executing too much code in a signal handler + context. */ +static int +bash_event_hook () +{ + /* If we're going to longjmp to top_level, make sure we clean up readline. + check_signals will call QUIT, which will eventually longjmp to top_level, + calling run_interrupt_trap along the way. */ + if (interrupt_state) + rl_cleanup_after_signal (); + bashline_reset_event_hook (); + check_signals_and_traps (); /* XXX */ + return 0; +} + +#endif /* READLINE */ diff --git a/.pc/bash43-015.diff/patchlevel.h b/.pc/bash43-015.diff/patchlevel.h new file mode 100644 index 0000000..20a8267 --- /dev/null +++ b/.pc/bash43-015.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 14 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-016.diff/lib/glob/glob.c b/.pc/bash43-016.diff/lib/glob/glob.c new file mode 100644 index 0000000..60ac79e --- /dev/null +++ b/.pc/bash43-016.diff/lib/glob/glob.c @@ -0,0 +1,1374 @@ +/* glob.c -- file-name wildcard pattern matching for Bash. + + Copyright (C) 1985-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne-Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* To whomever it may concern: I have never seen the code which most + Unix programs use to perform this function. I wrote this from scratch + based on specifications for the pattern matching. --RMS. */ + +#include + +#if !defined (__GNUC__) && !defined (HAVE_ALLOCA_H) && defined (_AIX) + #pragma alloca +#endif /* _AIX && RISC6000 && !__GNUC__ */ + +#include "bashtypes.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" +#include "posixdir.h" +#include "posixstat.h" +#include "shmbutil.h" +#include "xmalloc.h" + +#include "filecntl.h" +#if !defined (F_OK) +# define F_OK 0 +#endif + +#include "stdc.h" +#include "memalloc.h" + +#include + +#include "shell.h" + +#include "glob.h" +#include "strmatch.h" + +#if !defined (HAVE_BCOPY) && !defined (bcopy) +# define bcopy(s, d, n) ((void) memcpy ((d), (s), (n))) +#endif /* !HAVE_BCOPY && !bcopy */ + +#if !defined (NULL) +# if defined (__STDC__) +# define NULL ((void *) 0) +# else +# define NULL 0x0 +# endif /* __STDC__ */ +#endif /* !NULL */ + +#if !defined (FREE) +# define FREE(x) if (x) free (x) +#endif + +/* Don't try to alloca() more than this much memory for `struct globval' + in glob_vector() */ +#ifndef ALLOCA_MAX +# define ALLOCA_MAX 100000 +#endif + +struct globval + { + struct globval *next; + char *name; + }; + +extern void throw_to_top_level __P((void)); +extern int sh_eaccess __P((char *, int)); +extern char *sh_makepath __P((const char *, const char *, int)); +extern int signal_is_pending __P((int)); +extern void run_pending_traps __P((void)); + +extern int extended_glob; + +/* Global variable which controls whether or not * matches .*. + Non-zero means don't match .*. */ +int noglob_dot_filenames = 1; + +/* Global variable which controls whether or not filename globbing + is done without regard to case. */ +int glob_ignore_case = 0; + +/* Global variable to return to signify an error in globbing. */ +char *glob_error_return; + +static struct globval finddirs_error_return; + +/* Some forward declarations. */ +static int skipname __P((char *, char *, int)); +#if HANDLE_MULTIBYTE +static int mbskipname __P((char *, char *, int)); +#endif +#if HANDLE_MULTIBYTE +static void udequote_pathname __P((char *)); +static void wdequote_pathname __P((char *)); +#else +# define dequote_pathname udequote_pathname +#endif +static void dequote_pathname __P((char *)); +static int glob_testdir __P((char *, int)); +static char **glob_dir_to_array __P((char *, char **, int)); + +/* Make sure these names continue to agree with what's in smatch.c */ +extern char *glob_patscan __P((char *, char *, int)); +extern wchar_t *glob_patscan_wc __P((wchar_t *, wchar_t *, int)); + +/* Compile `glob_loop.c' for single-byte characters. */ +#define CHAR unsigned char +#define INT int +#define L(CS) CS +#define INTERNAL_GLOB_PATTERN_P internal_glob_pattern_p +#include "glob_loop.c" + +/* Compile `glob_loop.c' again for multibyte characters. */ +#if HANDLE_MULTIBYTE + +#define CHAR wchar_t +#define INT wint_t +#define L(CS) L##CS +#define INTERNAL_GLOB_PATTERN_P internal_glob_wpattern_p +#include "glob_loop.c" + +#endif /* HANDLE_MULTIBYTE */ + +/* And now a function that calls either the single-byte or multibyte version + of internal_glob_pattern_p. */ +int +glob_pattern_p (pattern) + const char *pattern; +{ +#if HANDLE_MULTIBYTE + size_t n; + wchar_t *wpattern; + int r; + + if (MB_CUR_MAX == 1) + return (internal_glob_pattern_p ((unsigned char *)pattern)); + + /* Convert strings to wide chars, and call the multibyte version. */ + n = xdupmbstowcs (&wpattern, NULL, pattern); + if (n == (size_t)-1) + /* Oops. Invalid multibyte sequence. Try it as single-byte sequence. */ + return (internal_glob_pattern_p ((unsigned char *)pattern)); + + r = internal_glob_wpattern_p (wpattern); + free (wpattern); + + return r; +#else + return (internal_glob_pattern_p (pattern)); +#endif +} + +#if EXTENDED_GLOB +/* Return 1 if all subpatterns in the extended globbing pattern PAT indicate + that the name should be skipped. XXX - doesn't handle pattern negation, + not sure if it should */ +static int +extglob_skipname (pat, dname, flags) + char *pat, *dname; + int flags; +{ + char *pp, *pe, *t, *se; + int n, r, negate; + + negate = *pat == '!'; + pp = pat + 2; + se = pp + strlen (pp) - 1; /* end of string */ + pe = glob_patscan (pp, se, 0); /* end of extglob pattern (( */ + /* we should check for invalid extglob pattern here */ + /* if pe != se we have more of the pattern at the end of the extglob + pattern. Check the easy case first ( */ + if (pe == se && *pe == ')' && (t = strchr (pp, '|')) == 0) + { + *pe = '\0'; +#if defined (HANDLE_MULTIBYTE) + r = mbskipname (pp, dname, flags); +#else + r = skipname (pp, dname, flags); /*(*/ +#endif + *pe = ')'; + return r; + } + + /* check every subpattern */ + while (t = glob_patscan (pp, pe, '|')) + { + n = t[-1]; + t[-1] = '\0'; +#if defined (HANDLE_MULTIBYTE) + r = mbskipname (pp, dname, flags); +#else + r = skipname (pp, dname, flags); +#endif + t[-1] = n; + if (r == 0) /* if any pattern says not skip, we don't skip */ + return r; + pp = t; + } /*(*/ + + /* glob_patscan might find end of pattern */ + if (pp == se) + return r; + + /* but if it doesn't then we didn't match a leading dot */ + return 0; +} +#endif + +/* Return 1 if DNAME should be skipped according to PAT. Mostly concerned + with matching leading `.'. */ +static int +skipname (pat, dname, flags) + char *pat; + char *dname; + int flags; +{ +#if EXTENDED_GLOB + if (extglob_pattern_p (pat)) /* XXX */ + return (extglob_skipname (pat, dname, flags)); +#endif + + /* If a leading dot need not be explicitly matched, and the pattern + doesn't start with a `.', don't match `.' or `..' */ + if (noglob_dot_filenames == 0 && pat[0] != '.' && + (pat[0] != '\\' || pat[1] != '.') && + (dname[0] == '.' && + (dname[1] == '\0' || (dname[1] == '.' && dname[2] == '\0')))) + return 1; + + /* If a dot must be explicitly matched, check to see if they do. */ + else if (noglob_dot_filenames && dname[0] == '.' && pat[0] != '.' && + (pat[0] != '\\' || pat[1] != '.')) + return 1; + + return 0; +} + +#if HANDLE_MULTIBYTE + +static int +wchkname (pat_wc, dn_wc) + wchar_t *pat_wc, *dn_wc; +{ + /* If a leading dot need not be explicitly matched, and the + pattern doesn't start with a `.', don't match `.' or `..' */ + if (noglob_dot_filenames == 0 && pat_wc[0] != L'.' && + (pat_wc[0] != L'\\' || pat_wc[1] != L'.') && + (dn_wc[0] == L'.' && + (dn_wc[1] == L'\0' || (dn_wc[1] == L'.' && dn_wc[2] == L'\0')))) + return 1; + + /* If a leading dot must be explicitly matched, check to see if the + pattern and dirname both have one. */ + else if (noglob_dot_filenames && dn_wc[0] == L'.' && + pat_wc[0] != L'.' && + (pat_wc[0] != L'\\' || pat_wc[1] != L'.')) + return 1; + + return 0; +} + +static int +wextglob_skipname (pat, dname, flags) + wchar_t *pat, *dname; + int flags; +{ +#if EXTENDED_GLOB + wchar_t *pp, *pe, *t, n, *se; + int r, negate; + + negate = *pat == L'!'; + pp = pat + 2; + se = pp + wcslen (pp) - 1; /*(*/ + pe = glob_patscan_wc (pp, se, 0); + + if (pe == se && *pe == ')' && (t = wcschr (pp, L'|')) == 0) + { + *pe = L'\0'; + r = wchkname (pp, dname); /*(*/ + *pe = L')'; + return r; + } + + /* check every subpattern */ + while (t = glob_patscan_wc (pp, pe, '|')) + { + n = t[-1]; + t[-1] = L'\0'; + r = wchkname (pp, dname); + t[-1] = n; + if (r == 0) + return 0; + pp = t; + } + + if (pp == pe) /* glob_patscan_wc might find end of pattern */ + return r; + + /* but if it doesn't then we didn't match a leading dot */ + return 0; +#else + return (wchkname (pat, dname)); +#endif +} + +/* Return 1 if DNAME should be skipped according to PAT. Handles multibyte + characters in PAT and DNAME. Mostly concerned with matching leading `.'. */ +static int +mbskipname (pat, dname, flags) + char *pat, *dname; + int flags; +{ + int ret, ext; + wchar_t *pat_wc, *dn_wc; + size_t pat_n, dn_n; + + if (mbsmbchar (dname) == 0 && mbsmbchar (pat) == 0) + return (skipname (pat, dname, flags)); + + ext = 0; +#if EXTENDED_GLOB + ext = extglob_pattern_p (pat); +#endif + + pat_wc = dn_wc = (wchar_t *)NULL; + + pat_n = xdupmbstowcs (&pat_wc, NULL, pat); + if (pat_n != (size_t)-1) + dn_n = xdupmbstowcs (&dn_wc, NULL, dname); + + ret = 0; + if (pat_n != (size_t)-1 && dn_n !=(size_t)-1) + ret = ext ? wextglob_skipname (pat_wc, dn_wc, flags) : wchkname (pat_wc, dn_wc); + else + ret = skipname (pat, dname, flags); + + FREE (pat_wc); + FREE (dn_wc); + + return ret; +} +#endif /* HANDLE_MULTIBYTE */ + +/* Remove backslashes quoting characters in PATHNAME by modifying PATHNAME. */ +static void +udequote_pathname (pathname) + char *pathname; +{ + register int i, j; + + for (i = j = 0; pathname && pathname[i]; ) + { + if (pathname[i] == '\\') + i++; + + pathname[j++] = pathname[i++]; + + if (pathname[i - 1] == 0) + break; + } + if (pathname) + pathname[j] = '\0'; +} + +#if HANDLE_MULTIBYTE +/* Remove backslashes quoting characters in PATHNAME by modifying PATHNAME. */ +static void +wdequote_pathname (pathname) + char *pathname; +{ + mbstate_t ps; + size_t len, n; + wchar_t *wpathname; + int i, j; + wchar_t *orig_wpathname; + + len = strlen (pathname); + /* Convert the strings into wide characters. */ + n = xdupmbstowcs (&wpathname, NULL, pathname); + if (n == (size_t) -1) + { + /* Something wrong. Fall back to single-byte */ + udequote_pathname (pathname); + return; + } + orig_wpathname = wpathname; + + for (i = j = 0; wpathname && wpathname[i]; ) + { + if (wpathname[i] == L'\\') + i++; + + wpathname[j++] = wpathname[i++]; + + if (wpathname[i - 1] == L'\0') + break; + } + if (wpathname) + wpathname[j] = L'\0'; + + /* Convert the wide character string into unibyte character set. */ + memset (&ps, '\0', sizeof(mbstate_t)); + n = wcsrtombs(pathname, (const wchar_t **)&wpathname, len, &ps); + pathname[len] = '\0'; + + /* Can't just free wpathname here; wcsrtombs changes it in many cases. */ + free (orig_wpathname); +} + +static void +dequote_pathname (pathname) + char *pathname; +{ + if (MB_CUR_MAX > 1) + wdequote_pathname (pathname); + else + udequote_pathname (pathname); +} +#endif /* HANDLE_MULTIBYTE */ + +/* Test whether NAME exists. */ + +#if defined (HAVE_LSTAT) +# define GLOB_TESTNAME(name) (lstat (name, &finfo)) +#else /* !HAVE_LSTAT */ +# if !defined (AFS) +# define GLOB_TESTNAME(name) (sh_eaccess (name, F_OK)) +# else /* AFS */ +# define GLOB_TESTNAME(name) (access (name, F_OK)) +# endif /* AFS */ +#endif /* !HAVE_LSTAT */ + +/* Return 0 if DIR is a directory, -1 otherwise. */ +static int +glob_testdir (dir, flags) + char *dir; + int flags; +{ + struct stat finfo; + int r; + +/*itrace("glob_testdir: testing %s" flags = %d, dir, flags);*/ +#if defined (HAVE_LSTAT) + r = (flags & GX_ALLDIRS) ? lstat (dir, &finfo) : stat (dir, &finfo); +#else + r = stat (dir, &finfo); +#endif + if (r < 0) + return (-1); + + if (S_ISDIR (finfo.st_mode) == 0) + return (-1); + + return (0); +} + +/* Recursively scan SDIR for directories matching PAT (PAT is always `**'). + FLAGS is simply passed down to the recursive call to glob_vector. Returns + a list of matching directory names. EP, if non-null, is set to the last + element of the returned list. NP, if non-null, is set to the number of + directories in the returned list. These two variables exist for the + convenience of the caller (always glob_vector). */ +static struct globval * +finddirs (pat, sdir, flags, ep, np) + char *pat; + char *sdir; + int flags; + struct globval **ep; + int *np; +{ + char **r, *n; + int ndirs; + struct globval *ret, *e, *g; + +/*itrace("finddirs: pat = `%s' sdir = `%s' flags = 0x%x", pat, sdir, flags);*/ + e = ret = 0; + r = glob_vector (pat, sdir, flags); + if (r == 0 || r[0] == 0) + { + if (np) + *np = 0; + if (ep) + *ep = 0; + if (r && r != &glob_error_return) + free (r); + return (struct globval *)0; + } + for (ndirs = 0; r[ndirs] != 0; ndirs++) + { + g = (struct globval *) malloc (sizeof (struct globval)); + if (g == 0) + { + while (ret) /* free list built so far */ + { + g = ret->next; + free (ret); + ret = g; + } + + free (r); + if (np) + *np = 0; + if (ep) + *ep = 0; + return (&finddirs_error_return); + } + if (e == 0) + e = g; + + g->next = ret; + ret = g; + + g->name = r[ndirs]; + } + + free (r); + if (ep) + *ep = e; + if (np) + *np = ndirs; + + return ret; +} + +/* Return a vector of names of files in directory DIR + whose names match glob pattern PAT. + The names are not in any particular order. + Wildcards at the beginning of PAT do not match an initial period. + + The vector is terminated by an element that is a null pointer. + + To free the space allocated, first free the vector's elements, + then free the vector. + + Return 0 if cannot get enough memory to hold the pointer + and the names. + + Return -1 if cannot access directory DIR. + Look in errno for more information. */ + +char ** +glob_vector (pat, dir, flags) + char *pat; + char *dir; + int flags; +{ + DIR *d; + register struct dirent *dp; + struct globval *lastlink, *e, *dirlist; + register struct globval *nextlink; + register char *nextname, *npat, *subdir; + unsigned int count; + int lose, skip, ndirs, isdir, sdlen, add_current, patlen; + register char **name_vector; + register unsigned int i; + int mflags; /* Flags passed to strmatch (). */ + int pflags; /* flags passed to sh_makepath () */ + int nalloca; + struct globval *firstmalloc, *tmplink; + char *convfn; + + lastlink = 0; + count = lose = skip = add_current = 0; + + firstmalloc = 0; + nalloca = 0; + +/*itrace("glob_vector: pat = `%s' dir = `%s' flags = 0x%x", pat, dir, flags);*/ + /* If PAT is empty, skip the loop, but return one (empty) filename. */ + if (pat == 0 || *pat == '\0') + { + if (glob_testdir (dir, 0) < 0) + return ((char **) &glob_error_return); + + nextlink = (struct globval *)alloca (sizeof (struct globval)); + if (nextlink == NULL) + return ((char **) NULL); + + nextlink->next = (struct globval *)0; + nextname = (char *) malloc (1); + if (nextname == 0) + lose = 1; + else + { + lastlink = nextlink; + nextlink->name = nextname; + nextname[0] = '\0'; + count = 1; + } + + skip = 1; + } + + patlen = (pat && *pat) ? strlen (pat) : 0; + + /* If the filename pattern (PAT) does not contain any globbing characters, + we can dispense with reading the directory, and just see if there is + a filename `DIR/PAT'. If there is, and we can access it, just make the + vector to return and bail immediately. */ + if (skip == 0 && glob_pattern_p (pat) == 0) + { + int dirlen; + struct stat finfo; + + if (glob_testdir (dir, 0) < 0) + return ((char **) &glob_error_return); + + dirlen = strlen (dir); + nextname = (char *)malloc (dirlen + patlen + 2); + npat = (char *)malloc (patlen + 1); + if (nextname == 0 || npat == 0) + { + FREE (nextname); + FREE (npat); + lose = 1; + } + else + { + strcpy (npat, pat); + dequote_pathname (npat); + + strcpy (nextname, dir); + nextname[dirlen++] = '/'; + strcpy (nextname + dirlen, npat); + + if (GLOB_TESTNAME (nextname) >= 0) + { + free (nextname); + nextlink = (struct globval *)alloca (sizeof (struct globval)); + if (nextlink) + { + nextlink->next = (struct globval *)0; + lastlink = nextlink; + nextlink->name = npat; + count = 1; + } + else + { + free (npat); + lose = 1; + } + } + else + { + free (nextname); + free (npat); + } + } + + skip = 1; + } + + if (skip == 0) + { + /* Open the directory, punting immediately if we cannot. If opendir + is not robust (i.e., it opens non-directories successfully), test + that DIR is a directory and punt if it's not. */ +#if defined (OPENDIR_NOT_ROBUST) + if (glob_testdir (dir, 0) < 0) + return ((char **) &glob_error_return); +#endif + + d = opendir (dir); + if (d == NULL) + return ((char **) &glob_error_return); + + /* Compute the flags that will be passed to strmatch(). We don't + need to do this every time through the loop. */ + mflags = (noglob_dot_filenames ? FNM_PERIOD : 0) | FNM_PATHNAME; + +#ifdef FNM_CASEFOLD + if (glob_ignore_case) + mflags |= FNM_CASEFOLD; +#endif + + if (extended_glob) + mflags |= FNM_EXTMATCH; + + add_current = ((flags & (GX_ALLDIRS|GX_ADDCURDIR)) == (GX_ALLDIRS|GX_ADDCURDIR)); + + /* Scan the directory, finding all names that match. + For each name that matches, allocate a struct globval + on the stack and store the name in it. + Chain those structs together; lastlink is the front of the chain. */ + while (1) + { + /* Make globbing interruptible in the shell. */ + if (interrupt_state || terminating_signal) + { + lose = 1; + break; + } + else if (signal_is_pending (SIGINT)) /* XXX - make SIGINT traps responsive */ + { + lose = 1; + break; + } + + dp = readdir (d); + if (dp == NULL) + break; + + /* If this directory entry is not to be used, try again. */ + if (REAL_DIR_ENTRY (dp) == 0) + continue; + +#if 0 + if (dp->d_name == 0 || *dp->d_name == 0) + continue; +#endif + +#if HANDLE_MULTIBYTE + if (MB_CUR_MAX > 1 && mbskipname (pat, dp->d_name, flags)) + continue; + else +#endif + if (skipname (pat, dp->d_name, flags)) + continue; + + /* If we're only interested in directories, don't bother with files */ + if (flags & (GX_MATCHDIRS|GX_ALLDIRS)) + { + pflags = (flags & GX_ALLDIRS) ? MP_RMDOT : 0; + if (flags & GX_NULLDIR) + pflags |= MP_IGNDOT; + subdir = sh_makepath (dir, dp->d_name, pflags); + isdir = glob_testdir (subdir, flags); + if (isdir < 0 && (flags & GX_MATCHDIRS)) + { + free (subdir); + continue; + } + } + + if (flags & GX_ALLDIRS) + { + if (isdir == 0) + { + dirlist = finddirs (pat, subdir, (flags & ~GX_ADDCURDIR), &e, &ndirs); + if (dirlist == &finddirs_error_return) + { + free (subdir); + lose = 1; + break; + } + if (ndirs) /* add recursive directories to list */ + { + if (firstmalloc == 0) + firstmalloc = e; + e->next = lastlink; + lastlink = dirlist; + count += ndirs; + } + } + + nextlink = (struct globval *) malloc (sizeof (struct globval)); + if (firstmalloc == 0) + firstmalloc = nextlink; + sdlen = strlen (subdir); + nextname = (char *) malloc (sdlen + 1); + if (nextlink == 0 || nextname == 0) + { + FREE (nextlink); + FREE (nextname); + free (subdir); + lose = 1; + break; + } + nextlink->next = lastlink; + lastlink = nextlink; + nextlink->name = nextname; + bcopy (subdir, nextname, sdlen + 1); + free (subdir); + ++count; + continue; + } + else if (flags & GX_MATCHDIRS) + free (subdir); + + convfn = fnx_fromfs (dp->d_name, D_NAMLEN (dp)); + if (strmatch (pat, convfn, mflags) != FNM_NOMATCH) + { + if (nalloca < ALLOCA_MAX) + { + nextlink = (struct globval *) alloca (sizeof (struct globval)); + nalloca += sizeof (struct globval); + } + else + { + nextlink = (struct globval *) malloc (sizeof (struct globval)); + if (firstmalloc == 0) + firstmalloc = nextlink; + } + + nextname = (char *) malloc (D_NAMLEN (dp) + 1); + if (nextlink == 0 || nextname == 0) + { + FREE (nextlink); + FREE (nextname); + lose = 1; + break; + } + nextlink->next = lastlink; + lastlink = nextlink; + nextlink->name = nextname; + bcopy (dp->d_name, nextname, D_NAMLEN (dp) + 1); + ++count; + } + } + + (void) closedir (d); + } + + /* compat: if GX_ADDCURDIR, add the passed directory also. Add an empty + directory name as a placeholder if GX_NULLDIR (in which case the passed + directory name is "."). */ + if (add_current) + { + sdlen = strlen (dir); + nextname = (char *)malloc (sdlen + 1); + nextlink = (struct globval *) malloc (sizeof (struct globval)); + if (nextlink == 0 || nextname == 0) + { + FREE (nextlink); + FREE (nextname); + lose = 1; + } + else + { + nextlink->name = nextname; + nextlink->next = lastlink; + lastlink = nextlink; + if (flags & GX_NULLDIR) + nextname[0] = '\0'; + else + bcopy (dir, nextname, sdlen + 1); + ++count; + } + } + + if (lose == 0) + { + name_vector = (char **) malloc ((count + 1) * sizeof (char *)); + lose |= name_vector == NULL; + } + + /* Have we run out of memory? */ + if (lose) + { + tmplink = 0; + + /* Here free the strings we have got. */ + while (lastlink) + { + /* Since we build the list in reverse order, the first N entries + will be allocated with malloc, if firstmalloc is set, from + lastlink to firstmalloc. */ + if (firstmalloc) + { + if (lastlink == firstmalloc) + firstmalloc = 0; + tmplink = lastlink; + } + else + tmplink = 0; + free (lastlink->name); + lastlink = lastlink->next; + FREE (tmplink); + } + + /* Don't call QUIT; here; let higher layers deal with it. */ + + return ((char **)NULL); + } + + /* Copy the name pointers from the linked list into the vector. */ + for (tmplink = lastlink, i = 0; i < count; ++i) + { + name_vector[i] = tmplink->name; + tmplink = tmplink->next; + } + + name_vector[count] = NULL; + + /* If we allocated some of the struct globvals, free them now. */ + if (firstmalloc) + { + tmplink = 0; + while (lastlink) + { + tmplink = lastlink; + if (lastlink == firstmalloc) + lastlink = firstmalloc = 0; + else + lastlink = lastlink->next; + free (tmplink); + } + } + + return (name_vector); +} + +/* Return a new array which is the concatenation of each string in ARRAY + to DIR. This function expects you to pass in an allocated ARRAY, and + it takes care of free()ing that array. Thus, you might think of this + function as side-effecting ARRAY. This should handle GX_MARKDIRS. */ +static char ** +glob_dir_to_array (dir, array, flags) + char *dir, **array; + int flags; +{ + register unsigned int i, l; + int add_slash; + char **result, *new; + struct stat sb; + + l = strlen (dir); + if (l == 0) + { + if (flags & GX_MARKDIRS) + for (i = 0; array[i]; i++) + { + if ((stat (array[i], &sb) == 0) && S_ISDIR (sb.st_mode)) + { + l = strlen (array[i]); + new = (char *)realloc (array[i], l + 2); + if (new == 0) + return NULL; + new[l] = '/'; + new[l+1] = '\0'; + array[i] = new; + } + } + return (array); + } + + add_slash = dir[l - 1] != '/'; + + i = 0; + while (array[i] != NULL) + ++i; + + result = (char **) malloc ((i + 1) * sizeof (char *)); + if (result == NULL) + return (NULL); + + for (i = 0; array[i] != NULL; i++) + { + /* 3 == 1 for NUL, 1 for slash at end of DIR, 1 for GX_MARKDIRS */ + result[i] = (char *) malloc (l + strlen (array[i]) + 3); + + if (result[i] == NULL) + { + int ind; + for (ind = 0; ind < i; ind++) + free (result[ind]); + free (result); + return (NULL); + } + + strcpy (result[i], dir); + if (add_slash) + result[i][l] = '/'; + strcpy (result[i] + l + add_slash, array[i]); + if (flags & GX_MARKDIRS) + { + if ((stat (result[i], &sb) == 0) && S_ISDIR (sb.st_mode)) + { + size_t rlen; + rlen = strlen (result[i]); + result[i][rlen] = '/'; + result[i][rlen+1] = '\0'; + } + } + } + result[i] = NULL; + + /* Free the input array. */ + for (i = 0; array[i] != NULL; i++) + free (array[i]); + free ((char *) array); + + return (result); +} + +/* Do globbing on PATHNAME. Return an array of pathnames that match, + marking the end of the array with a null-pointer as an element. + If no pathnames match, then the array is empty (first element is null). + If there isn't enough memory, then return NULL. + If a file system error occurs, return -1; `errno' has the error code. */ +char ** +glob_filename (pathname, flags) + char *pathname; + int flags; +{ + char **result; + unsigned int result_size; + char *directory_name, *filename, *dname; + unsigned int directory_len; + int free_dirname; /* flag */ + int dflags; + + result = (char **) malloc (sizeof (char *)); + result_size = 1; + if (result == NULL) + return (NULL); + + result[0] = NULL; + + directory_name = NULL; + + /* Find the filename. */ + filename = strrchr (pathname, '/'); + if (filename == NULL) + { + filename = pathname; + directory_name = ""; + directory_len = 0; + free_dirname = 0; + } + else + { + directory_len = (filename - pathname) + 1; + directory_name = (char *) malloc (directory_len + 1); + + if (directory_name == 0) /* allocation failed? */ + return (NULL); + + bcopy (pathname, directory_name, directory_len); + directory_name[directory_len] = '\0'; + ++filename; + free_dirname = 1; + } + + /* If directory_name contains globbing characters, then we + have to expand the previous levels. Just recurse. */ + if (directory_len > 0 && glob_pattern_p (directory_name)) + { + char **directories, *d, *p; + register unsigned int i; + int all_starstar, last_starstar; + + all_starstar = last_starstar = 0; + d = directory_name; + dflags = flags & ~GX_MARKDIRS; + /* Collapse a sequence of ** patterns separated by one or more slashes + to a single ** terminated by a slash or NUL */ + if ((flags & GX_GLOBSTAR) && d[0] == '*' && d[1] == '*' && (d[2] == '/' || d[2] == '\0')) + { + p = d; + while (d[0] == '*' && d[1] == '*' && (d[2] == '/' || d[2] == '\0')) + { + p = d; + if (d[2]) + { + d += 3; + while (*d == '/') + d++; + if (*d == 0) + break; + } + } + if (*d == 0) + all_starstar = 1; + d = p; + dflags |= GX_ALLDIRS|GX_ADDCURDIR; + directory_len = strlen (d); + } + + /* If there is a non [star][star]/ component in directory_name, we + still need to collapse trailing sequences of [star][star]/ into + a single one and note that the directory name ends with [star][star], + so we can compensate if filename is [star][star] */ + if ((flags & GX_GLOBSTAR) && all_starstar == 0) + { + int dl, prev; + prev = dl = directory_len; + while (dl >= 4 && d[dl - 1] == '/' && + d[dl - 2] == '*' && + d[dl - 3] == '*' && + d[dl - 4] == '/') + prev = dl, dl -= 3; + if (dl != directory_len) + last_starstar = 1; + directory_len = prev; + } + + /* If the directory name ends in [star][star]/ but the filename is + [star][star], just remove the final [star][star] from the directory + so we don't have to scan everything twice. */ + if (last_starstar && directory_len > 4 && + filename[0] == '*' && filename[1] == '*' && filename[2] == 0) + { + directory_len -= 3; + } + + if (d[directory_len - 1] == '/') + d[directory_len - 1] = '\0'; + + directories = glob_filename (d, dflags); + + if (free_dirname) + { + free (directory_name); + directory_name = NULL; + } + + if (directories == NULL) + goto memory_error; + else if (directories == (char **)&glob_error_return) + { + free ((char *) result); + return ((char **) &glob_error_return); + } + else if (*directories == NULL) + { + free ((char *) directories); + free ((char *) result); + return ((char **) &glob_error_return); + } + + /* If we have something like [star][star]/[star][star], it's no use to + glob **, then do it again, and throw half the results away. */ + if (all_starstar && filename[0] == '*' && filename[1] == '*' && filename[2] == 0) + { + free ((char *) directories); + free (directory_name); + directory_name = NULL; + directory_len = 0; + goto only_filename; + } + + /* We have successfully globbed the preceding directory name. + For each name in DIRECTORIES, call glob_vector on it and + FILENAME. Concatenate the results together. */ + for (i = 0; directories[i] != NULL; ++i) + { + char **temp_results; + int shouldbreak; + + shouldbreak = 0; + /* XXX -- we've recursively scanned any directories resulting from + a `**', so turn off the flag. We turn it on again below if + filename is `**' */ + /* Scan directory even on a NULL filename. That way, `*h/' + returns only directories ending in `h', instead of all + files ending in `h' with a `/' appended. */ + dname = directories[i]; + dflags = flags & ~(GX_MARKDIRS|GX_ALLDIRS|GX_ADDCURDIR); + if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0') + dflags |= GX_ALLDIRS|GX_ADDCURDIR; + if (dname[0] == '\0' && filename[0]) + { + dflags |= GX_NULLDIR; + dname = "."; /* treat null directory name and non-null filename as current directory */ + } + temp_results = glob_vector (filename, dname, dflags); + + /* Handle error cases. */ + if (temp_results == NULL) + goto memory_error; + else if (temp_results == (char **)&glob_error_return) + /* This filename is probably not a directory. Ignore it. */ + ; + else + { + char **array; + register unsigned int l; + + /* If we're expanding **, we don't need to glue the directory + name to the results; we've already done it in glob_vector */ + if ((dflags & GX_ALLDIRS) && filename[0] == '*' && filename[1] == '*' && (filename[2] == '\0' || filename[2] == '/')) + { + /* When do we remove null elements from temp_results? And + how to avoid duplicate elements in the final result? */ + /* If (dflags & GX_NULLDIR) glob_filename potentially left a + NULL placeholder in the temp results just in case + glob_vector/glob_dir_to_array did something with it, but + if it didn't, and we're not supposed to be passing them + through for some reason ((flags & GX_NULLDIR) == 0) we + need to remove all the NULL elements from the beginning + of TEMP_RESULTS. */ + /* If we have a null directory name and ** as the filename, + we have just searched for everything from the current + directory on down. Break now (shouldbreak = 1) to avoid + duplicate entries in the final result. */ +#define NULL_PLACEHOLDER(x) ((x) && *(x) && **(x) == 0) + if ((dflags & GX_NULLDIR) && (flags & GX_NULLDIR) == 0 && + NULL_PLACEHOLDER (temp_results)) +#undef NULL_PLACEHOLDER + { + register int i, n; + for (n = 0; temp_results[n] && *temp_results[n] == 0; n++) + ; + i = n; + do + temp_results[i - n] = temp_results[i]; + while (temp_results[i++] != 0); + array = temp_results; + shouldbreak = 1; + } + else + array = temp_results; + } + else + array = glob_dir_to_array (directories[i], temp_results, flags); + l = 0; + while (array[l] != NULL) + ++l; + + result = + (char **)realloc (result, (result_size + l) * sizeof (char *)); + + if (result == NULL) + goto memory_error; + + for (l = 0; array[l] != NULL; ++l) + result[result_size++ - 1] = array[l]; + + result[result_size - 1] = NULL; + + /* Note that the elements of ARRAY are not freed. */ + if (array != temp_results) + free ((char *) array); + else if ((dflags & GX_ALLDIRS) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0') + free (temp_results); /* expanding ** case above */ + + if (shouldbreak) + break; + } + } + /* Free the directories. */ + for (i = 0; directories[i]; i++) + free (directories[i]); + + free ((char *) directories); + + return (result); + } + +only_filename: + /* If there is only a directory name, return it. */ + if (*filename == '\0') + { + result = (char **) realloc ((char *) result, 2 * sizeof (char *)); + if (result == NULL) + return (NULL); + /* Handle GX_MARKDIRS here. */ + result[0] = (char *) malloc (directory_len + 1); + if (result[0] == NULL) + goto memory_error; + bcopy (directory_name, result[0], directory_len + 1); + if (free_dirname) + free (directory_name); + result[1] = NULL; + return (result); + } + else + { + char **temp_results; + + /* There are no unquoted globbing characters in DIRECTORY_NAME. + Dequote it before we try to open the directory since there may + be quoted globbing characters which should be treated verbatim. */ + if (directory_len > 0) + dequote_pathname (directory_name); + + /* We allocated a small array called RESULT, which we won't be using. + Free that memory now. */ + free (result); + + /* Just return what glob_vector () returns appended to the + directory name. */ + /* If flags & GX_ALLDIRS, we're called recursively */ + dflags = flags & ~GX_MARKDIRS; + if (directory_len == 0) + dflags |= GX_NULLDIR; + if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0') + { + dflags |= GX_ALLDIRS|GX_ADDCURDIR; +#if 0 + /* If we want all directories (dflags & GX_ALLDIRS) and we're not + being called recursively as something like `echo [star][star]/[star].o' + ((flags & GX_ALLDIRS) == 0), we want to prevent glob_vector from + adding a null directory name to the front of the temp_results + array. We turn off ADDCURDIR if not called recursively and + dlen == 0 */ +#endif + if (directory_len == 0 && (flags & GX_ALLDIRS) == 0) + dflags &= ~GX_ADDCURDIR; + } + temp_results = glob_vector (filename, + (directory_len == 0 ? "." : directory_name), + dflags); + + if (temp_results == NULL || temp_results == (char **)&glob_error_return) + { + if (free_dirname) + free (directory_name); + QUIT; /* XXX - shell */ + run_pending_traps (); + return (temp_results); + } + + result = glob_dir_to_array ((dflags & GX_ALLDIRS) ? "" : directory_name, temp_results, flags); + + if (free_dirname) + free (directory_name); + return (result); + } + + /* We get to memory_error if the program has run out of memory, or + if this is the shell, and we have been interrupted. */ + memory_error: + if (result != NULL) + { + register unsigned int i; + for (i = 0; result[i] != NULL; ++i) + free (result[i]); + free ((char *) result); + } + + if (free_dirname && directory_name) + free (directory_name); + + QUIT; + run_pending_traps (); + + return (NULL); +} + +#if defined (TEST) + +main (argc, argv) + int argc; + char **argv; +{ + unsigned int i; + + for (i = 1; i < argc; ++i) + { + char **value = glob_filename (argv[i], 0); + if (value == NULL) + puts ("Out of memory."); + else if (value == &glob_error_return) + perror (argv[i]); + else + for (i = 0; value[i] != NULL; i++) + puts (value[i]); + } + + exit (0); +} +#endif /* TEST. */ diff --git a/.pc/bash43-016.diff/lib/glob/gmisc.c b/.pc/bash43-016.diff/lib/glob/gmisc.c new file mode 100644 index 0000000..4bd37f6 --- /dev/null +++ b/.pc/bash43-016.diff/lib/glob/gmisc.c @@ -0,0 +1,377 @@ +/* gmisc.c -- miscellaneous pattern matching utility functions for Bash. + + Copyright (C) 2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne-Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include "bashtypes.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" +#include "shmbutil.h" + +#include "stdc.h" + +#ifndef LPAREN +# define LPAREN '(' +#endif +#ifndef RPAREN +# define RPAREN ')' +#endif + +#if defined (HANDLE_MULTIBYTE) +#define WLPAREN L'(' +#define WRPAREN L')' + +/* Return 1 of the first character of WSTRING could match the first + character of pattern WPAT. Wide character version. */ +int +match_pattern_wchar (wpat, wstring) + wchar_t *wpat, *wstring; +{ + wchar_t wc; + + if (*wstring == 0) + return (0); + + switch (wc = *wpat++) + { + default: + return (*wstring == wc); + case L'\\': + return (*wstring == *wpat); + case L'?': + return (*wpat == WLPAREN ? 1 : (*wstring != L'\0')); + case L'*': + return (1); + case L'+': + case L'!': + case L'@': + return (*wpat == WLPAREN ? 1 : (*wstring == wc)); + case L'[': + return (*wstring != L'\0'); + } +} + +int +wmatchlen (wpat, wmax) + wchar_t *wpat; + size_t wmax; +{ + wchar_t wc; + int matlen, bracklen, t, in_cclass, in_collsym, in_equiv; + + if (*wpat == 0) + return (0); + + matlen = in_cclass = in_collsym = in_equiv = 0; + while (wc = *wpat++) + { + switch (wc) + { + default: + matlen++; + break; + case L'\\': + if (*wpat == 0) + return ++matlen; + else + { + matlen++; + wpat++; + } + break; + case L'?': + if (*wpat == WLPAREN) + return (matlen = -1); /* XXX for now */ + else + matlen++; + break; + case L'*': + return (matlen = -1); + case L'+': + case L'!': + case L'@': + if (*wpat == WLPAREN) + return (matlen = -1); /* XXX for now */ + else + matlen++; + break; + case L'[': + /* scan for ending `]', skipping over embedded [:...:] */ + bracklen = 1; + wc = *wpat++; + do + { + if (wc == 0) + { + wpat--; /* back up to NUL */ + matlen += bracklen; + goto bad_bracket; + } + else if (wc == L'\\') + { + /* *wpat == backslash-escaped character */ + bracklen++; + /* If the backslash or backslash-escape ends the string, + bail. The ++wpat skips over the backslash escape */ + if (*wpat == 0 || *++wpat == 0) + { + matlen += bracklen; + goto bad_bracket; + } + } + else if (wc == L'[' && *wpat == L':') /* character class */ + { + wpat++; + bracklen++; + in_cclass = 1; + } + else if (in_cclass && wc == L':' && *wpat == L']') + { + wpat++; + bracklen++; + in_cclass = 0; + } + else if (wc == L'[' && *wpat == L'.') /* collating symbol */ + { + wpat++; + bracklen++; + if (*wpat == L']') /* right bracket can appear as collating symbol */ + { + wpat++; + bracklen++; + } + in_collsym = 1; + } + else if (in_collsym && wc == L'.' && *wpat == L']') + { + wpat++; + bracklen++; + in_collsym = 0; + } + else if (wc == L'[' && *wpat == L'=') /* equivalence class */ + { + wpat++; + bracklen++; + if (*wpat == L']') /* right bracket can appear as equivalence class */ + { + wpat++; + bracklen++; + } + in_equiv = 1; + } + else if (in_equiv && wc == L'=' && *wpat == L']') + { + wpat++; + bracklen++; + in_equiv = 0; + } + else + bracklen++; + } + while ((wc = *wpat++) != L']'); + matlen++; /* bracket expression can only match one char */ +bad_bracket: + break; + } + } + + return matlen; +} +#endif + +int +extglob_pattern_p (pat) + char *pat; +{ + switch (pat[0]) + { + case '*': + case '+': + case '!': + case '@': + case '?': + return (pat[1] == LPAREN); + default: + return 0; + } + + return 0; +} + +/* Return 1 of the first character of STRING could match the first + character of pattern PAT. Used to avoid n2 calls to strmatch(). */ +int +match_pattern_char (pat, string) + char *pat, *string; +{ + char c; + + if (*string == 0) + return (0); + + switch (c = *pat++) + { + default: + return (*string == c); + case '\\': + return (*string == *pat); + case '?': + return (*pat == LPAREN ? 1 : (*string != '\0')); + case '*': + return (1); + case '+': + case '!': + case '@': + return (*pat == LPAREN ? 1 : (*string == c)); + case '[': + return (*string != '\0'); + } +} + +int +umatchlen (pat, max) + char *pat; + size_t max; +{ + char c; + int matlen, bracklen, t, in_cclass, in_collsym, in_equiv; + + if (*pat == 0) + return (0); + + matlen = in_cclass = in_collsym = in_equiv = 0; + while (c = *pat++) + { + switch (c) + { + default: + matlen++; + break; + case '\\': + if (*pat == 0) + return ++matlen; + else + { + matlen++; + pat++; + } + break; + case '?': + if (*pat == LPAREN) + return (matlen = -1); /* XXX for now */ + else + matlen++; + break; + case '*': + return (matlen = -1); + case '+': + case '!': + case '@': + if (*pat == LPAREN) + return (matlen = -1); /* XXX for now */ + else + matlen++; + break; + case '[': + /* scan for ending `]', skipping over embedded [:...:] */ + bracklen = 1; + c = *pat++; + do + { + if (c == 0) + { + pat--; /* back up to NUL */ + matlen += bracklen; + goto bad_bracket; + } + else if (c == '\\') + { + /* *pat == backslash-escaped character */ + bracklen++; + /* If the backslash or backslash-escape ends the string, + bail. The ++pat skips over the backslash escape */ + if (*pat == 0 || *++pat == 0) + { + matlen += bracklen; + goto bad_bracket; + } + } + else if (c == '[' && *pat == ':') /* character class */ + { + pat++; + bracklen++; + in_cclass = 1; + } + else if (in_cclass && c == ':' && *pat == ']') + { + pat++; + bracklen++; + in_cclass = 0; + } + else if (c == '[' && *pat == '.') /* collating symbol */ + { + pat++; + bracklen++; + if (*pat == ']') /* right bracket can appear as collating symbol */ + { + pat++; + bracklen++; + } + in_collsym = 1; + } + else if (in_collsym && c == '.' && *pat == ']') + { + pat++; + bracklen++; + in_collsym = 0; + } + else if (c == '[' && *pat == '=') /* equivalence class */ + { + pat++; + bracklen++; + if (*pat == ']') /* right bracket can appear as equivalence class */ + { + pat++; + bracklen++; + } + in_equiv = 1; + } + else if (in_equiv && c == '=' && *pat == ']') + { + pat++; + bracklen++; + in_equiv = 0; + } + else + bracklen++; + } + while ((c = *pat++) != ']'); + matlen++; /* bracket expression can only match one char */ +bad_bracket: + break; + } + } + + return matlen; +} diff --git a/.pc/bash43-016.diff/patchlevel.h b/.pc/bash43-016.diff/patchlevel.h new file mode 100644 index 0000000..27edd57 --- /dev/null +++ b/.pc/bash43-016.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 15 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-017.diff/patchlevel.h b/.pc/bash43-017.diff/patchlevel.h new file mode 100644 index 0000000..706588e --- /dev/null +++ b/.pc/bash43-017.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 16 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-017.diff/variables.c b/.pc/bash43-017.diff/variables.c new file mode 100644 index 0000000..70fac3b --- /dev/null +++ b/.pc/bash43-017.diff/variables.c @@ -0,0 +1,5334 @@ +/* variables.c -- Functions for hacking shell variables. */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" +#include "posixstat.h" +#include "posixtime.h" + +#if defined (__QNX__) +# if defined (__QNXNTO__) +# include +# else +# include +# endif /* !__QNXNTO__ */ +#endif /* __QNX__ */ + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include "chartypes.h" +#if defined (HAVE_PWD_H) +# include +#endif +#include "bashansi.h" +#include "bashintl.h" + +#define NEED_XTRACE_SET_DECL + +#include "shell.h" +#include "flags.h" +#include "execute_cmd.h" +#include "findcmd.h" +#include "mailcheck.h" +#include "input.h" +#include "hashcmd.h" +#include "pathexp.h" +#include "alias.h" +#include "jobs.h" + +#include "version.h" + +#include "builtins/getopt.h" +#include "builtins/common.h" +#include "builtins/builtext.h" + +#if defined (READLINE) +# include "bashline.h" +# include +#else +# include +#endif + +#if defined (HISTORY) +# include "bashhist.h" +# include +#endif /* HISTORY */ + +#if defined (PROGRAMMABLE_COMPLETION) +# include "pcomplete.h" +#endif + +#define TEMPENV_HASH_BUCKETS 4 /* must be power of two */ + +#define ifsname(s) ((s)[0] == 'I' && (s)[1] == 'F' && (s)[2] == 'S' && (s)[3] == '\0') + +extern char **environ; + +/* Variables used here and defined in other files. */ +extern int posixly_correct; +extern int line_number, line_number_base; +extern int subshell_environment, indirection_level, subshell_level; +extern int build_version, patch_level; +extern int expanding_redir; +extern int last_command_exit_value; +extern char *dist_version, *release_status; +extern char *shell_name; +extern char *primary_prompt, *secondary_prompt; +extern char *current_host_name; +extern sh_builtin_func_t *this_shell_builtin; +extern SHELL_VAR *this_shell_function; +extern char *the_printed_command_except_trap; +extern char *this_command_name; +extern char *command_execution_string; +extern time_t shell_start_time; +extern int assigning_in_environment; +extern int executing_builtin; +extern int funcnest_max; + +#if defined (READLINE) +extern int no_line_editing; +extern int perform_hostname_completion; +#endif + +/* The list of shell variables that the user has created at the global + scope, or that came from the environment. */ +VAR_CONTEXT *global_variables = (VAR_CONTEXT *)NULL; + +/* The current list of shell variables, including function scopes */ +VAR_CONTEXT *shell_variables = (VAR_CONTEXT *)NULL; + +/* The list of shell functions that the user has created, or that came from + the environment. */ +HASH_TABLE *shell_functions = (HASH_TABLE *)NULL; + +#if defined (DEBUGGER) +/* The table of shell function definitions that the user defined or that + came from the environment. */ +HASH_TABLE *shell_function_defs = (HASH_TABLE *)NULL; +#endif + +/* The current variable context. This is really a count of how deep into + executing functions we are. */ +int variable_context = 0; + +/* The set of shell assignments which are made only in the environment + for a single command. */ +HASH_TABLE *temporary_env = (HASH_TABLE *)NULL; + +/* Set to non-zero if an assignment error occurs while putting variables + into the temporary environment. */ +int tempenv_assign_error; + +/* Some funky variables which are known about specially. Here is where + "$*", "$1", and all the cruft is kept. */ +char *dollar_vars[10]; +WORD_LIST *rest_of_args = (WORD_LIST *)NULL; + +/* The value of $$. */ +pid_t dollar_dollar_pid; + +/* Non-zero means that we have to remake EXPORT_ENV. */ +int array_needs_making = 1; + +/* The number of times BASH has been executed. This is set + by initialize_variables (). */ +int shell_level = 0; + +/* An array which is passed to commands as their environment. It is + manufactured from the union of the initial environment and the + shell variables that are marked for export. */ +char **export_env = (char **)NULL; +static int export_env_index; +static int export_env_size; + +#if defined (READLINE) +static int winsize_assignment; /* currently assigning to LINES or COLUMNS */ +#endif + +static HASH_TABLE *last_table_searched; /* hash_lookup sets this */ + +/* Some forward declarations. */ +static void create_variable_tables __P((void)); + +static void set_machine_vars __P((void)); +static void set_home_var __P((void)); +static void set_shell_var __P((void)); +static char *get_bash_name __P((void)); +static void initialize_shell_level __P((void)); +static void uidset __P((void)); +#if defined (ARRAY_VARS) +static void make_vers_array __P((void)); +#endif + +static SHELL_VAR *null_assign __P((SHELL_VAR *, char *, arrayind_t, char *)); +#if defined (ARRAY_VARS) +static SHELL_VAR *null_array_assign __P((SHELL_VAR *, char *, arrayind_t, char *)); +#endif +static SHELL_VAR *get_self __P((SHELL_VAR *)); + +#if defined (ARRAY_VARS) +static SHELL_VAR *init_dynamic_array_var __P((char *, sh_var_value_func_t *, sh_var_assign_func_t *, int)); +static SHELL_VAR *init_dynamic_assoc_var __P((char *, sh_var_value_func_t *, sh_var_assign_func_t *, int)); +#endif + +static SHELL_VAR *assign_seconds __P((SHELL_VAR *, char *, arrayind_t, char *)); +static SHELL_VAR *get_seconds __P((SHELL_VAR *)); +static SHELL_VAR *init_seconds_var __P((void)); + +static int brand __P((void)); +static void sbrand __P((unsigned long)); /* set bash random number generator. */ +static void seedrand __P((void)); /* seed generator randomly */ +static SHELL_VAR *assign_random __P((SHELL_VAR *, char *, arrayind_t, char *)); +static SHELL_VAR *get_random __P((SHELL_VAR *)); + +static SHELL_VAR *assign_lineno __P((SHELL_VAR *, char *, arrayind_t, char *)); +static SHELL_VAR *get_lineno __P((SHELL_VAR *)); + +static SHELL_VAR *assign_subshell __P((SHELL_VAR *, char *, arrayind_t, char *)); +static SHELL_VAR *get_subshell __P((SHELL_VAR *)); + +static SHELL_VAR *get_bashpid __P((SHELL_VAR *)); + +#if defined (HISTORY) +static SHELL_VAR *get_histcmd __P((SHELL_VAR *)); +#endif + +#if defined (READLINE) +static SHELL_VAR *get_comp_wordbreaks __P((SHELL_VAR *)); +static SHELL_VAR *assign_comp_wordbreaks __P((SHELL_VAR *, char *, arrayind_t, char *)); +#endif + +#if defined (PUSHD_AND_POPD) && defined (ARRAY_VARS) +static SHELL_VAR *assign_dirstack __P((SHELL_VAR *, char *, arrayind_t, char *)); +static SHELL_VAR *get_dirstack __P((SHELL_VAR *)); +#endif + +#if defined (ARRAY_VARS) +static SHELL_VAR *get_groupset __P((SHELL_VAR *)); + +static SHELL_VAR *build_hashcmd __P((SHELL_VAR *)); +static SHELL_VAR *get_hashcmd __P((SHELL_VAR *)); +static SHELL_VAR *assign_hashcmd __P((SHELL_VAR *, char *, arrayind_t, char *)); +# if defined (ALIAS) +static SHELL_VAR *build_aliasvar __P((SHELL_VAR *)); +static SHELL_VAR *get_aliasvar __P((SHELL_VAR *)); +static SHELL_VAR *assign_aliasvar __P((SHELL_VAR *, char *, arrayind_t, char *)); +# endif +#endif + +static SHELL_VAR *get_funcname __P((SHELL_VAR *)); +static SHELL_VAR *init_funcname_var __P((void)); + +static void initialize_dynamic_variables __P((void)); + +static SHELL_VAR *hash_lookup __P((const char *, HASH_TABLE *)); +static SHELL_VAR *new_shell_variable __P((const char *)); +static SHELL_VAR *make_new_variable __P((const char *, HASH_TABLE *)); +static SHELL_VAR *bind_variable_internal __P((const char *, char *, HASH_TABLE *, int, int)); + +static void dispose_variable_value __P((SHELL_VAR *)); +static void free_variable_hash_data __P((PTR_T)); + +static VARLIST *vlist_alloc __P((int)); +static VARLIST *vlist_realloc __P((VARLIST *, int)); +static void vlist_add __P((VARLIST *, SHELL_VAR *, int)); + +static void flatten __P((HASH_TABLE *, sh_var_map_func_t *, VARLIST *, int)); + +static int qsort_var_comp __P((SHELL_VAR **, SHELL_VAR **)); + +static SHELL_VAR **vapply __P((sh_var_map_func_t *)); +static SHELL_VAR **fapply __P((sh_var_map_func_t *)); + +static int visible_var __P((SHELL_VAR *)); +static int visible_and_exported __P((SHELL_VAR *)); +static int export_environment_candidate __P((SHELL_VAR *)); +static int local_and_exported __P((SHELL_VAR *)); +static int variable_in_context __P((SHELL_VAR *)); +#if defined (ARRAY_VARS) +static int visible_array_vars __P((SHELL_VAR *)); +#endif + +static SHELL_VAR *find_nameref_at_context __P((SHELL_VAR *, VAR_CONTEXT *)); +static SHELL_VAR *find_variable_nameref_context __P((SHELL_VAR *, VAR_CONTEXT *, VAR_CONTEXT **)); +static SHELL_VAR *find_variable_last_nameref_context __P((SHELL_VAR *, VAR_CONTEXT *, VAR_CONTEXT **)); + +static SHELL_VAR *bind_tempenv_variable __P((const char *, char *)); +static void push_temp_var __P((PTR_T)); +static void propagate_temp_var __P((PTR_T)); +static void dispose_temporary_env __P((sh_free_func_t *)); + +static inline char *mk_env_string __P((const char *, const char *)); +static char **make_env_array_from_var_list __P((SHELL_VAR **)); +static char **make_var_export_array __P((VAR_CONTEXT *)); +static char **make_func_export_array __P((void)); +static void add_temp_array_to_env __P((char **, int, int)); + +static int n_shell_variables __P((void)); +static int set_context __P((SHELL_VAR *)); + +static void push_func_var __P((PTR_T)); +static void push_exported_var __P((PTR_T)); + +static inline int find_special_var __P((const char *)); + +static void +create_variable_tables () +{ + if (shell_variables == 0) + { + shell_variables = global_variables = new_var_context ((char *)NULL, 0); + shell_variables->scope = 0; + shell_variables->table = hash_create (0); + } + + if (shell_functions == 0) + shell_functions = hash_create (0); + +#if defined (DEBUGGER) + if (shell_function_defs == 0) + shell_function_defs = hash_create (0); +#endif +} + +/* Initialize the shell variables from the current environment. + If PRIVMODE is nonzero, don't import functions from ENV or + parse $SHELLOPTS. */ +void +initialize_shell_variables (env, privmode) + char **env; + int privmode; +{ + char *name, *string, *temp_string; + int c, char_index, string_index, string_length, ro; + SHELL_VAR *temp_var; + + create_variable_tables (); + + for (string_index = 0; string = env[string_index++]; ) + { + char_index = 0; + name = string; + while ((c = *string++) && c != '=') + ; + if (string[-1] == '=') + char_index = string - name - 1; + + /* If there are weird things in the environment, like `=xxx' or a + string without an `=', just skip them. */ + if (char_index == 0) + continue; + + /* ASSERT(name[char_index] == '=') */ + name[char_index] = '\0'; + /* Now, name = env variable name, string = env variable value, and + char_index == strlen (name) */ + + temp_var = (SHELL_VAR *)NULL; + + /* If exported function, define it now. Don't import functions from + the environment in privileged mode. */ + if (privmode == 0 && read_but_dont_execute == 0 && STREQN ("() {", string, 4)) + { + string_length = strlen (string); + temp_string = (char *)xmalloc (3 + string_length + char_index); + + strcpy (temp_string, name); + temp_string[char_index] = ' '; + strcpy (temp_string + char_index + 1, string); + + if (posixly_correct == 0 || legal_identifier (name)) + parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST); + + /* Ancient backwards compatibility. Old versions of bash exported + functions like name()=() {...} */ + if (name[char_index - 1] == ')' && name[char_index - 2] == '(') + name[char_index - 2] = '\0'; + + if (temp_var = find_function (name)) + { + VSETATTR (temp_var, (att_exported|att_imported)); + array_needs_making = 1; + } + else + { + if (temp_var = bind_variable (name, string, 0)) + { + VSETATTR (temp_var, (att_exported | att_imported | att_invisible)); + array_needs_making = 1; + } + last_command_exit_value = 1; + report_error (_("error importing function definition for `%s'"), name); + } + + /* ( */ + if (name[char_index - 1] == ')' && name[char_index - 2] == '\0') + name[char_index - 2] = '('; /* ) */ + } +#if defined (ARRAY_VARS) +# if ARRAY_EXPORT + /* Array variables may not yet be exported. */ + else if (*string == '(' && string[1] == '[' && string[strlen (string) - 1] == ')') + { + string_length = 1; + temp_string = extract_array_assignment_list (string, &string_length); + temp_var = assign_array_from_string (name, temp_string); + FREE (temp_string); + VSETATTR (temp_var, (att_exported | att_imported)); + array_needs_making = 1; + } +# endif /* ARRAY_EXPORT */ +#endif +#if 0 + else if (legal_identifier (name)) +#else + else +#endif + { + ro = 0; + if (posixly_correct && STREQ (name, "SHELLOPTS")) + { + temp_var = find_variable ("SHELLOPTS"); + ro = temp_var && readonly_p (temp_var); + if (temp_var) + VUNSETATTR (temp_var, att_readonly); + } + temp_var = bind_variable (name, string, 0); + if (temp_var) + { + if (legal_identifier (name)) + VSETATTR (temp_var, (att_exported | att_imported)); + else + VSETATTR (temp_var, (att_exported | att_imported | att_invisible)); + if (ro) + VSETATTR (temp_var, att_readonly); + array_needs_making = 1; + } + } + + name[char_index] = '='; + /* temp_var can be NULL if it was an exported function with a syntax + error (a different bug, but it still shouldn't dump core). */ + if (temp_var && function_p (temp_var) == 0) /* XXX not yet */ + { + CACHE_IMPORTSTR (temp_var, name); + } + } + + set_pwd (); + + /* Set up initial value of $_ */ + temp_var = set_if_not ("_", dollar_vars[0]); + + /* Remember this pid. */ + dollar_dollar_pid = getpid (); + + /* Now make our own defaults in case the vars that we think are + important are missing. */ + temp_var = set_if_not ("PATH", DEFAULT_PATH_VALUE); +#if 0 + set_auto_export (temp_var); /* XXX */ +#endif + + temp_var = set_if_not ("TERM", "dumb"); +#if 0 + set_auto_export (temp_var); /* XXX */ +#endif + +#if defined (__QNX__) + /* set node id -- don't import it from the environment */ + { + char node_name[22]; +# if defined (__QNXNTO__) + netmgr_ndtostr(ND2S_LOCAL_STR, ND_LOCAL_NODE, node_name, sizeof(node_name)); +# else + qnx_nidtostr (getnid (), node_name, sizeof (node_name)); +# endif + temp_var = bind_variable ("NODE", node_name, 0); + set_auto_export (temp_var); + } +#endif + + /* set up the prompts. */ + if (interactive_shell) + { +#if defined (PROMPT_STRING_DECODE) + set_if_not ("PS1", primary_prompt); +#else + if (current_user.uid == -1) + get_current_user_info (); + set_if_not ("PS1", current_user.euid == 0 ? "# " : primary_prompt); +#endif + set_if_not ("PS2", secondary_prompt); + } + set_if_not ("PS4", "+ "); + + /* Don't allow IFS to be imported from the environment. */ + temp_var = bind_variable ("IFS", " \t\n", 0); + setifs (temp_var); + + /* Magic machine types. Pretty convenient. */ + set_machine_vars (); + + /* Default MAILCHECK for interactive shells. Defer the creation of a + default MAILPATH until the startup files are read, because MAIL + names a mail file if MAILPATH is not set, and we should provide a + default only if neither is set. */ + if (interactive_shell) + { + temp_var = set_if_not ("MAILCHECK", posixly_correct ? "600" : "60"); + VSETATTR (temp_var, att_integer); + } + + /* Do some things with shell level. */ + initialize_shell_level (); + + set_ppid (); + + /* Initialize the `getopts' stuff. */ + temp_var = bind_variable ("OPTIND", "1", 0); + VSETATTR (temp_var, att_integer); + getopts_reset (0); + bind_variable ("OPTERR", "1", 0); + sh_opterr = 1; + + if (login_shell == 1 && posixly_correct == 0) + set_home_var (); + + /* Get the full pathname to THIS shell, and set the BASH variable + to it. */ + name = get_bash_name (); + temp_var = bind_variable ("BASH", name, 0); + free (name); + + /* Make the exported environment variable SHELL be the user's login + shell. Note that the `tset' command looks at this variable + to determine what style of commands to output; if it ends in "csh", + then C-shell commands are output, else Bourne shell commands. */ + set_shell_var (); + + /* Make a variable called BASH_VERSION which contains the version info. */ + bind_variable ("BASH_VERSION", shell_version_string (), 0); +#if defined (ARRAY_VARS) + make_vers_array (); +#endif + + if (command_execution_string) + bind_variable ("BASH_EXECUTION_STRING", command_execution_string, 0); + + /* Find out if we're supposed to be in Posix.2 mode via an + environment variable. */ + temp_var = find_variable ("POSIXLY_CORRECT"); + if (!temp_var) + temp_var = find_variable ("POSIX_PEDANTIC"); + if (temp_var && imported_p (temp_var)) + sv_strict_posix (temp_var->name); + +#if defined (HISTORY) + /* Set history variables to defaults, and then do whatever we would + do if the variable had just been set. Do this only in the case + that we are remembering commands on the history list. */ + if (remember_on_history) + { + name = bash_tilde_expand (posixly_correct ? "~/.sh_history" : "~/.bash_history", 0); + + set_if_not ("HISTFILE", name); + free (name); + } +#endif /* HISTORY */ + + /* Seed the random number generator. */ + seedrand (); + + /* Handle some "special" variables that we may have inherited from a + parent shell. */ + if (interactive_shell) + { + temp_var = find_variable ("IGNOREEOF"); + if (!temp_var) + temp_var = find_variable ("ignoreeof"); + if (temp_var && imported_p (temp_var)) + sv_ignoreeof (temp_var->name); + } + +#if defined (HISTORY) + if (interactive_shell && remember_on_history) + { + sv_history_control ("HISTCONTROL"); + sv_histignore ("HISTIGNORE"); + sv_histtimefmt ("HISTTIMEFORMAT"); + } +#endif /* HISTORY */ + +#if defined (READLINE) && defined (STRICT_POSIX) + /* POSIXLY_CORRECT will only be 1 here if the shell was compiled + -DSTRICT_POSIX */ + if (interactive_shell && posixly_correct && no_line_editing == 0) + rl_prefer_env_winsize = 1; +#endif /* READLINE && STRICT_POSIX */ + + /* + * 24 October 2001 + * + * I'm tired of the arguing and bug reports. Bash now leaves SSH_CLIENT + * and SSH2_CLIENT alone. I'm going to rely on the shell_level check in + * isnetconn() to avoid running the startup files more often than wanted. + * That will, of course, only work if the user's login shell is bash, so + * I've made that behavior conditional on SSH_SOURCE_BASHRC being defined + * in config-top.h. + */ +#if 0 + temp_var = find_variable ("SSH_CLIENT"); + if (temp_var && imported_p (temp_var)) + { + VUNSETATTR (temp_var, att_exported); + array_needs_making = 1; + } + temp_var = find_variable ("SSH2_CLIENT"); + if (temp_var && imported_p (temp_var)) + { + VUNSETATTR (temp_var, att_exported); + array_needs_making = 1; + } +#endif + + /* Get the user's real and effective user ids. */ + uidset (); + + temp_var = find_variable ("BASH_XTRACEFD"); + if (temp_var && imported_p (temp_var)) + sv_xtracefd (temp_var->name); + + /* Initialize the dynamic variables, and seed their values. */ + initialize_dynamic_variables (); +} + +/* **************************************************************** */ +/* */ +/* Setting values for special shell variables */ +/* */ +/* **************************************************************** */ + +static void +set_machine_vars () +{ + SHELL_VAR *temp_var; + + temp_var = set_if_not ("HOSTTYPE", HOSTTYPE); + temp_var = set_if_not ("OSTYPE", OSTYPE); + temp_var = set_if_not ("MACHTYPE", MACHTYPE); + + temp_var = set_if_not ("HOSTNAME", current_host_name); +} + +/* Set $HOME to the information in the password file if we didn't get + it from the environment. */ + +/* This function is not static so the tilde and readline libraries can + use it. */ +char * +sh_get_home_dir () +{ + if (current_user.home_dir == 0) + get_current_user_info (); + return current_user.home_dir; +} + +static void +set_home_var () +{ + SHELL_VAR *temp_var; + + temp_var = find_variable ("HOME"); + if (temp_var == 0) + temp_var = bind_variable ("HOME", sh_get_home_dir (), 0); +#if 0 + VSETATTR (temp_var, att_exported); +#endif +} + +/* Set $SHELL to the user's login shell if it is not already set. Call + get_current_user_info if we haven't already fetched the shell. */ +static void +set_shell_var () +{ + SHELL_VAR *temp_var; + + temp_var = find_variable ("SHELL"); + if (temp_var == 0) + { + if (current_user.shell == 0) + get_current_user_info (); + temp_var = bind_variable ("SHELL", current_user.shell, 0); + } +#if 0 + VSETATTR (temp_var, att_exported); +#endif +} + +static char * +get_bash_name () +{ + char *name; + + if ((login_shell == 1) && RELPATH(shell_name)) + { + if (current_user.shell == 0) + get_current_user_info (); + name = savestring (current_user.shell); + } + else if (ABSPATH(shell_name)) + name = savestring (shell_name); + else if (shell_name[0] == '.' && shell_name[1] == '/') + { + /* Fast path for common case. */ + char *cdir; + int len; + + cdir = get_string_value ("PWD"); + if (cdir) + { + len = strlen (cdir); + name = (char *)xmalloc (len + strlen (shell_name) + 1); + strcpy (name, cdir); + strcpy (name + len, shell_name + 1); + } + else + name = savestring (shell_name); + } + else + { + char *tname; + int s; + + tname = find_user_command (shell_name); + + if (tname == 0) + { + /* Try the current directory. If there is not an executable + there, just punt and use the login shell. */ + s = file_status (shell_name); + if (s & FS_EXECABLE) + { + tname = make_absolute (shell_name, get_string_value ("PWD")); + if (*shell_name == '.') + { + name = sh_canonpath (tname, PATH_CHECKDOTDOT|PATH_CHECKEXISTS); + if (name == 0) + name = tname; + else + free (tname); + } + else + name = tname; + } + else + { + if (current_user.shell == 0) + get_current_user_info (); + name = savestring (current_user.shell); + } + } + else + { + name = full_pathname (tname); + free (tname); + } + } + + return (name); +} + +void +adjust_shell_level (change) + int change; +{ + char new_level[5], *old_SHLVL; + intmax_t old_level; + SHELL_VAR *temp_var; + + old_SHLVL = get_string_value ("SHLVL"); + if (old_SHLVL == 0 || *old_SHLVL == '\0' || legal_number (old_SHLVL, &old_level) == 0) + old_level = 0; + + shell_level = old_level + change; + if (shell_level < 0) + shell_level = 0; + else if (shell_level > 1000) + { + internal_warning (_("shell level (%d) too high, resetting to 1"), shell_level); + shell_level = 1; + } + + /* We don't need the full generality of itos here. */ + if (shell_level < 10) + { + new_level[0] = shell_level + '0'; + new_level[1] = '\0'; + } + else if (shell_level < 100) + { + new_level[0] = (shell_level / 10) + '0'; + new_level[1] = (shell_level % 10) + '0'; + new_level[2] = '\0'; + } + else if (shell_level < 1000) + { + new_level[0] = (shell_level / 100) + '0'; + old_level = shell_level % 100; + new_level[1] = (old_level / 10) + '0'; + new_level[2] = (old_level % 10) + '0'; + new_level[3] = '\0'; + } + + temp_var = bind_variable ("SHLVL", new_level, 0); + set_auto_export (temp_var); +} + +static void +initialize_shell_level () +{ + adjust_shell_level (1); +} + +/* If we got PWD from the environment, update our idea of the current + working directory. In any case, make sure that PWD exists before + checking it. It is possible for getcwd () to fail on shell startup, + and in that case, PWD would be undefined. If this is an interactive + login shell, see if $HOME is the current working directory, and if + that's not the same string as $PWD, set PWD=$HOME. */ + +void +set_pwd () +{ + SHELL_VAR *temp_var, *home_var; + char *temp_string, *home_string; + + home_var = find_variable ("HOME"); + home_string = home_var ? value_cell (home_var) : (char *)NULL; + + temp_var = find_variable ("PWD"); + if (temp_var && imported_p (temp_var) && + (temp_string = value_cell (temp_var)) && + same_file (temp_string, ".", (struct stat *)NULL, (struct stat *)NULL)) + set_working_directory (temp_string); + else if (home_string && interactive_shell && login_shell && + same_file (home_string, ".", (struct stat *)NULL, (struct stat *)NULL)) + { + set_working_directory (home_string); + temp_var = bind_variable ("PWD", home_string, 0); + set_auto_export (temp_var); + } + else + { + temp_string = get_working_directory ("shell-init"); + if (temp_string) + { + temp_var = bind_variable ("PWD", temp_string, 0); + set_auto_export (temp_var); + free (temp_string); + } + } + + /* According to the Single Unix Specification, v2, $OLDPWD is an + `environment variable' and therefore should be auto-exported. + Make a dummy invisible variable for OLDPWD, and mark it as exported. */ + temp_var = bind_variable ("OLDPWD", (char *)NULL, 0); + VSETATTR (temp_var, (att_exported | att_invisible)); +} + +/* Make a variable $PPID, which holds the pid of the shell's parent. */ +void +set_ppid () +{ + char namebuf[INT_STRLEN_BOUND(pid_t) + 1], *name; + SHELL_VAR *temp_var; + + name = inttostr (getppid (), namebuf, sizeof(namebuf)); + temp_var = find_variable ("PPID"); + if (temp_var) + VUNSETATTR (temp_var, (att_readonly | att_exported)); + temp_var = bind_variable ("PPID", name, 0); + VSETATTR (temp_var, (att_readonly | att_integer)); +} + +static void +uidset () +{ + char buff[INT_STRLEN_BOUND(uid_t) + 1], *b; + register SHELL_VAR *v; + + b = inttostr (current_user.uid, buff, sizeof (buff)); + v = find_variable ("UID"); + if (v == 0) + { + v = bind_variable ("UID", b, 0); + VSETATTR (v, (att_readonly | att_integer)); + } + + if (current_user.euid != current_user.uid) + b = inttostr (current_user.euid, buff, sizeof (buff)); + + v = find_variable ("EUID"); + if (v == 0) + { + v = bind_variable ("EUID", b, 0); + VSETATTR (v, (att_readonly | att_integer)); + } +} + +#if defined (ARRAY_VARS) +static void +make_vers_array () +{ + SHELL_VAR *vv; + ARRAY *av; + char *s, d[32], b[INT_STRLEN_BOUND(int) + 1]; + + unbind_variable ("BASH_VERSINFO"); + + vv = make_new_array_variable ("BASH_VERSINFO"); + av = array_cell (vv); + strcpy (d, dist_version); + s = strchr (d, '.'); + if (s) + *s++ = '\0'; + array_insert (av, 0, d); + array_insert (av, 1, s); + s = inttostr (patch_level, b, sizeof (b)); + array_insert (av, 2, s); + s = inttostr (build_version, b, sizeof (b)); + array_insert (av, 3, s); + array_insert (av, 4, release_status); + array_insert (av, 5, MACHTYPE); + + VSETATTR (vv, att_readonly); +} +#endif /* ARRAY_VARS */ + +/* Set the environment variables $LINES and $COLUMNS in response to + a window size change. */ +void +sh_set_lines_and_columns (lines, cols) + int lines, cols; +{ + char val[INT_STRLEN_BOUND(int) + 1], *v; + +#if defined (READLINE) + /* If we are currently assigning to LINES or COLUMNS, don't do anything. */ + if (winsize_assignment) + return; +#endif + + v = inttostr (lines, val, sizeof (val)); + bind_variable ("LINES", v, 0); + + v = inttostr (cols, val, sizeof (val)); + bind_variable ("COLUMNS", v, 0); +} + +/* **************************************************************** */ +/* */ +/* Printing variables and values */ +/* */ +/* **************************************************************** */ + +/* Print LIST (a list of shell variables) to stdout in such a way that + they can be read back in. */ +void +print_var_list (list) + register SHELL_VAR **list; +{ + register int i; + register SHELL_VAR *var; + + for (i = 0; list && (var = list[i]); i++) + if (invisible_p (var) == 0) + print_assignment (var); +} + +/* Print LIST (a list of shell functions) to stdout in such a way that + they can be read back in. */ +void +print_func_list (list) + register SHELL_VAR **list; +{ + register int i; + register SHELL_VAR *var; + + for (i = 0; list && (var = list[i]); i++) + { + printf ("%s ", var->name); + print_var_function (var); + printf ("\n"); + } +} + +/* Print the value of a single SHELL_VAR. No newline is + output, but the variable is printed in such a way that + it can be read back in. */ +void +print_assignment (var) + SHELL_VAR *var; +{ + if (var_isset (var) == 0) + return; + + if (function_p (var)) + { + printf ("%s", var->name); + print_var_function (var); + printf ("\n"); + } +#if defined (ARRAY_VARS) + else if (array_p (var)) + print_array_assignment (var, 0); + else if (assoc_p (var)) + print_assoc_assignment (var, 0); +#endif /* ARRAY_VARS */ + else + { + printf ("%s=", var->name); + print_var_value (var, 1); + printf ("\n"); + } +} + +/* Print the value cell of VAR, a shell variable. Do not print + the name, nor leading/trailing newline. If QUOTE is non-zero, + and the value contains shell metacharacters, quote the value + in such a way that it can be read back in. */ +void +print_var_value (var, quote) + SHELL_VAR *var; + int quote; +{ + char *t; + + if (var_isset (var) == 0) + return; + + if (quote && posixly_correct == 0 && ansic_shouldquote (value_cell (var))) + { + t = ansic_quote (value_cell (var), 0, (int *)0); + printf ("%s", t); + free (t); + } + else if (quote && sh_contains_shell_metas (value_cell (var))) + { + t = sh_single_quote (value_cell (var)); + printf ("%s", t); + free (t); + } + else + printf ("%s", value_cell (var)); +} + +/* Print the function cell of VAR, a shell variable. Do not + print the name, nor leading/trailing newline. */ +void +print_var_function (var) + SHELL_VAR *var; +{ + char *x; + + if (function_p (var) && var_isset (var)) + { + x = named_function_string ((char *)NULL, function_cell(var), FUNC_MULTILINE|FUNC_EXTERNAL); + printf ("%s", x); + } +} + +/* **************************************************************** */ +/* */ +/* Dynamic Variables */ +/* */ +/* **************************************************************** */ + +/* DYNAMIC VARIABLES + + These are variables whose values are generated anew each time they are + referenced. These are implemented using a pair of function pointers + in the struct variable: assign_func, which is called from bind_variable + and, if arrays are compiled into the shell, some of the functions in + arrayfunc.c, and dynamic_value, which is called from find_variable. + + assign_func is called from bind_variable_internal, if + bind_variable_internal discovers that the variable being assigned to + has such a function. The function is called as + SHELL_VAR *temp = (*(entry->assign_func)) (entry, value, ind) + and the (SHELL_VAR *)temp is returned as the value of bind_variable. It + is usually ENTRY (self). IND is an index for an array variable, and + unused otherwise. + + dynamic_value is called from find_variable_internal to return a `new' + value for the specified dynamic varible. If this function is NULL, + the variable is treated as a `normal' shell variable. If it is not, + however, then this function is called like this: + tempvar = (*(var->dynamic_value)) (var); + + Sometimes `tempvar' will replace the value of `var'. Other times, the + shell will simply use the string value. Pretty object-oriented, huh? + + Be warned, though: if you `unset' a special variable, it loses its + special meaning, even if you subsequently set it. + + The special assignment code would probably have been better put in + subst.c: do_assignment_internal, in the same style as + stupidly_hack_special_variables, but I wanted the changes as + localized as possible. */ + +#define INIT_DYNAMIC_VAR(var, val, gfunc, afunc) \ + do \ + { \ + v = bind_variable (var, (val), 0); \ + v->dynamic_value = gfunc; \ + v->assign_func = afunc; \ + } \ + while (0) + +#define INIT_DYNAMIC_ARRAY_VAR(var, gfunc, afunc) \ + do \ + { \ + v = make_new_array_variable (var); \ + v->dynamic_value = gfunc; \ + v->assign_func = afunc; \ + } \ + while (0) + +#define INIT_DYNAMIC_ASSOC_VAR(var, gfunc, afunc) \ + do \ + { \ + v = make_new_assoc_variable (var); \ + v->dynamic_value = gfunc; \ + v->assign_func = afunc; \ + } \ + while (0) + +static SHELL_VAR * +null_assign (self, value, unused, key) + SHELL_VAR *self; + char *value; + arrayind_t unused; + char *key; +{ + return (self); +} + +#if defined (ARRAY_VARS) +static SHELL_VAR * +null_array_assign (self, value, ind, key) + SHELL_VAR *self; + char *value; + arrayind_t ind; + char *key; +{ + return (self); +} +#endif + +/* Degenerate `dynamic_value' function; just returns what's passed without + manipulation. */ +static SHELL_VAR * +get_self (self) + SHELL_VAR *self; +{ + return (self); +} + +#if defined (ARRAY_VARS) +/* A generic dynamic array variable initializer. Initialize array variable + NAME with dynamic value function GETFUNC and assignment function SETFUNC. */ +static SHELL_VAR * +init_dynamic_array_var (name, getfunc, setfunc, attrs) + char *name; + sh_var_value_func_t *getfunc; + sh_var_assign_func_t *setfunc; + int attrs; +{ + SHELL_VAR *v; + + v = find_variable (name); + if (v) + return (v); + INIT_DYNAMIC_ARRAY_VAR (name, getfunc, setfunc); + if (attrs) + VSETATTR (v, attrs); + return v; +} + +static SHELL_VAR * +init_dynamic_assoc_var (name, getfunc, setfunc, attrs) + char *name; + sh_var_value_func_t *getfunc; + sh_var_assign_func_t *setfunc; + int attrs; +{ + SHELL_VAR *v; + + v = find_variable (name); + if (v) + return (v); + INIT_DYNAMIC_ASSOC_VAR (name, getfunc, setfunc); + if (attrs) + VSETATTR (v, attrs); + return v; +} +#endif + +/* The value of $SECONDS. This is the number of seconds since shell + invocation, or, the number of seconds since the last assignment + the + value of the last assignment. */ +static intmax_t seconds_value_assigned; + +static SHELL_VAR * +assign_seconds (self, value, unused, key) + SHELL_VAR *self; + char *value; + arrayind_t unused; + char *key; +{ + if (legal_number (value, &seconds_value_assigned) == 0) + seconds_value_assigned = 0; + shell_start_time = NOW; + return (self); +} + +static SHELL_VAR * +get_seconds (var) + SHELL_VAR *var; +{ + time_t time_since_start; + char *p; + + time_since_start = NOW - shell_start_time; + p = itos(seconds_value_assigned + time_since_start); + + FREE (value_cell (var)); + + VSETATTR (var, att_integer); + var_setvalue (var, p); + return (var); +} + +static SHELL_VAR * +init_seconds_var () +{ + SHELL_VAR *v; + + v = find_variable ("SECONDS"); + if (v) + { + if (legal_number (value_cell(v), &seconds_value_assigned) == 0) + seconds_value_assigned = 0; + } + INIT_DYNAMIC_VAR ("SECONDS", (v ? value_cell (v) : (char *)NULL), get_seconds, assign_seconds); + return v; +} + +/* The random number seed. You can change this by setting RANDOM. */ +static unsigned long rseed = 1; +static int last_random_value; +static int seeded_subshell = 0; + +/* A linear congruential random number generator based on the example + one in the ANSI C standard. This one isn't very good, but a more + complicated one is overkill. */ + +/* Returns a pseudo-random number between 0 and 32767. */ +static int +brand () +{ + /* From "Random number generators: good ones are hard to find", + Park and Miller, Communications of the ACM, vol. 31, no. 10, + October 1988, p. 1195. filtered through FreeBSD */ + long h, l; + + /* Can't seed with 0. */ + if (rseed == 0) + rseed = 123459876; + h = rseed / 127773; + l = rseed % 127773; + rseed = 16807 * l - 2836 * h; +#if 0 + if (rseed < 0) + rseed += 0x7fffffff; +#endif + return ((unsigned int)(rseed & 32767)); /* was % 32768 */ +} + +/* Set the random number generator seed to SEED. */ +static void +sbrand (seed) + unsigned long seed; +{ + rseed = seed; + last_random_value = 0; +} + +static void +seedrand () +{ + struct timeval tv; + + gettimeofday (&tv, NULL); + sbrand (tv.tv_sec ^ tv.tv_usec ^ getpid ()); +} + +static SHELL_VAR * +assign_random (self, value, unused, key) + SHELL_VAR *self; + char *value; + arrayind_t unused; + char *key; +{ + sbrand (strtoul (value, (char **)NULL, 10)); + if (subshell_environment) + seeded_subshell = getpid (); + return (self); +} + +int +get_random_number () +{ + int rv, pid; + + /* Reset for command and process substitution. */ + pid = getpid (); + if (subshell_environment && seeded_subshell != pid) + { + seedrand (); + seeded_subshell = pid; + } + + do + rv = brand (); + while (rv == last_random_value); + return rv; +} + +static SHELL_VAR * +get_random (var) + SHELL_VAR *var; +{ + int rv; + char *p; + + rv = get_random_number (); + last_random_value = rv; + p = itos (rv); + + FREE (value_cell (var)); + + VSETATTR (var, att_integer); + var_setvalue (var, p); + return (var); +} + +static SHELL_VAR * +assign_lineno (var, value, unused, key) + SHELL_VAR *var; + char *value; + arrayind_t unused; + char *key; +{ + intmax_t new_value; + + if (value == 0 || *value == '\0' || legal_number (value, &new_value) == 0) + new_value = 0; + line_number = line_number_base = new_value; + return var; +} + +/* Function which returns the current line number. */ +static SHELL_VAR * +get_lineno (var) + SHELL_VAR *var; +{ + char *p; + int ln; + + ln = executing_line_number (); + p = itos (ln); + FREE (value_cell (var)); + var_setvalue (var, p); + return (var); +} + +static SHELL_VAR * +assign_subshell (var, value, unused, key) + SHELL_VAR *var; + char *value; + arrayind_t unused; + char *key; +{ + intmax_t new_value; + + if (value == 0 || *value == '\0' || legal_number (value, &new_value) == 0) + new_value = 0; + subshell_level = new_value; + return var; +} + +static SHELL_VAR * +get_subshell (var) + SHELL_VAR *var; +{ + char *p; + + p = itos (subshell_level); + FREE (value_cell (var)); + var_setvalue (var, p); + return (var); +} + +static SHELL_VAR * +get_bashpid (var) + SHELL_VAR *var; +{ + int pid; + char *p; + + pid = getpid (); + p = itos (pid); + + FREE (value_cell (var)); + VSETATTR (var, att_integer|att_readonly); + var_setvalue (var, p); + return (var); +} + +static SHELL_VAR * +get_bash_command (var) + SHELL_VAR *var; +{ + char *p; + + if (the_printed_command_except_trap) + p = savestring (the_printed_command_except_trap); + else + { + p = (char *)xmalloc (1); + p[0] = '\0'; + } + FREE (value_cell (var)); + var_setvalue (var, p); + return (var); +} + +#if defined (HISTORY) +static SHELL_VAR * +get_histcmd (var) + SHELL_VAR *var; +{ + char *p; + + p = itos (history_number ()); + FREE (value_cell (var)); + var_setvalue (var, p); + return (var); +} +#endif + +#if defined (READLINE) +/* When this function returns, VAR->value points to malloced memory. */ +static SHELL_VAR * +get_comp_wordbreaks (var) + SHELL_VAR *var; +{ + /* If we don't have anything yet, assign a default value. */ + if (rl_completer_word_break_characters == 0 && bash_readline_initialized == 0) + enable_hostname_completion (perform_hostname_completion); + + FREE (value_cell (var)); + var_setvalue (var, savestring (rl_completer_word_break_characters)); + + return (var); +} + +/* When this function returns, rl_completer_word_break_characters points to + malloced memory. */ +static SHELL_VAR * +assign_comp_wordbreaks (self, value, unused, key) + SHELL_VAR *self; + char *value; + arrayind_t unused; + char *key; +{ + if (rl_completer_word_break_characters && + rl_completer_word_break_characters != rl_basic_word_break_characters) + free (rl_completer_word_break_characters); + + rl_completer_word_break_characters = savestring (value); + return self; +} +#endif /* READLINE */ + +#if defined (PUSHD_AND_POPD) && defined (ARRAY_VARS) +static SHELL_VAR * +assign_dirstack (self, value, ind, key) + SHELL_VAR *self; + char *value; + arrayind_t ind; + char *key; +{ + set_dirstack_element (ind, 1, value); + return self; +} + +static SHELL_VAR * +get_dirstack (self) + SHELL_VAR *self; +{ + ARRAY *a; + WORD_LIST *l; + + l = get_directory_stack (0); + a = array_from_word_list (l); + array_dispose (array_cell (self)); + dispose_words (l); + var_setarray (self, a); + return self; +} +#endif /* PUSHD AND POPD && ARRAY_VARS */ + +#if defined (ARRAY_VARS) +/* We don't want to initialize the group set with a call to getgroups() + unless we're asked to, but we only want to do it once. */ +static SHELL_VAR * +get_groupset (self) + SHELL_VAR *self; +{ + register int i; + int ng; + ARRAY *a; + static char **group_set = (char **)NULL; + + if (group_set == 0) + { + group_set = get_group_list (&ng); + a = array_cell (self); + for (i = 0; i < ng; i++) + array_insert (a, i, group_set[i]); + } + return (self); +} + +static SHELL_VAR * +build_hashcmd (self) + SHELL_VAR *self; +{ + HASH_TABLE *h; + int i; + char *k, *v; + BUCKET_CONTENTS *item; + + h = assoc_cell (self); + if (h) + assoc_dispose (h); + + if (hashed_filenames == 0 || HASH_ENTRIES (hashed_filenames) == 0) + { + var_setvalue (self, (char *)NULL); + return self; + } + + h = assoc_create (hashed_filenames->nbuckets); + for (i = 0; i < hashed_filenames->nbuckets; i++) + { + for (item = hash_items (i, hashed_filenames); item; item = item->next) + { + k = savestring (item->key); + v = pathdata(item)->path; + assoc_insert (h, k, v); + } + } + + var_setvalue (self, (char *)h); + return self; +} + +static SHELL_VAR * +get_hashcmd (self) + SHELL_VAR *self; +{ + build_hashcmd (self); + return (self); +} + +static SHELL_VAR * +assign_hashcmd (self, value, ind, key) + SHELL_VAR *self; + char *value; + arrayind_t ind; + char *key; +{ + phash_insert (key, value, 0, 0); + return (build_hashcmd (self)); +} + +#if defined (ALIAS) +static SHELL_VAR * +build_aliasvar (self) + SHELL_VAR *self; +{ + HASH_TABLE *h; + int i; + char *k, *v; + BUCKET_CONTENTS *item; + + h = assoc_cell (self); + if (h) + assoc_dispose (h); + + if (aliases == 0 || HASH_ENTRIES (aliases) == 0) + { + var_setvalue (self, (char *)NULL); + return self; + } + + h = assoc_create (aliases->nbuckets); + for (i = 0; i < aliases->nbuckets; i++) + { + for (item = hash_items (i, aliases); item; item = item->next) + { + k = savestring (item->key); + v = ((alias_t *)(item->data))->value; + assoc_insert (h, k, v); + } + } + + var_setvalue (self, (char *)h); + return self; +} + +static SHELL_VAR * +get_aliasvar (self) + SHELL_VAR *self; +{ + build_aliasvar (self); + return (self); +} + +static SHELL_VAR * +assign_aliasvar (self, value, ind, key) + SHELL_VAR *self; + char *value; + arrayind_t ind; + char *key; +{ + add_alias (key, value); + return (build_aliasvar (self)); +} +#endif /* ALIAS */ + +#endif /* ARRAY_VARS */ + +/* If ARRAY_VARS is not defined, this just returns the name of any + currently-executing function. If we have arrays, it's a call stack. */ +static SHELL_VAR * +get_funcname (self) + SHELL_VAR *self; +{ +#if ! defined (ARRAY_VARS) + char *t; + if (variable_context && this_shell_function) + { + FREE (value_cell (self)); + t = savestring (this_shell_function->name); + var_setvalue (self, t); + } +#endif + return (self); +} + +void +make_funcname_visible (on_or_off) + int on_or_off; +{ + SHELL_VAR *v; + + v = find_variable ("FUNCNAME"); + if (v == 0 || v->dynamic_value == 0) + return; + + if (on_or_off) + VUNSETATTR (v, att_invisible); + else + VSETATTR (v, att_invisible); +} + +static SHELL_VAR * +init_funcname_var () +{ + SHELL_VAR *v; + + v = find_variable ("FUNCNAME"); + if (v) + return v; +#if defined (ARRAY_VARS) + INIT_DYNAMIC_ARRAY_VAR ("FUNCNAME", get_funcname, null_array_assign); +#else + INIT_DYNAMIC_VAR ("FUNCNAME", (char *)NULL, get_funcname, null_assign); +#endif + VSETATTR (v, att_invisible|att_noassign); + return v; +} + +static void +initialize_dynamic_variables () +{ + SHELL_VAR *v; + + v = init_seconds_var (); + + INIT_DYNAMIC_VAR ("BASH_COMMAND", (char *)NULL, get_bash_command, (sh_var_assign_func_t *)NULL); + INIT_DYNAMIC_VAR ("BASH_SUBSHELL", (char *)NULL, get_subshell, assign_subshell); + + INIT_DYNAMIC_VAR ("RANDOM", (char *)NULL, get_random, assign_random); + VSETATTR (v, att_integer); + INIT_DYNAMIC_VAR ("LINENO", (char *)NULL, get_lineno, assign_lineno); + VSETATTR (v, att_integer); + + INIT_DYNAMIC_VAR ("BASHPID", (char *)NULL, get_bashpid, null_assign); + VSETATTR (v, att_integer|att_readonly); + +#if defined (HISTORY) + INIT_DYNAMIC_VAR ("HISTCMD", (char *)NULL, get_histcmd, (sh_var_assign_func_t *)NULL); + VSETATTR (v, att_integer); +#endif + +#if defined (READLINE) + INIT_DYNAMIC_VAR ("COMP_WORDBREAKS", (char *)NULL, get_comp_wordbreaks, assign_comp_wordbreaks); +#endif + +#if defined (PUSHD_AND_POPD) && defined (ARRAY_VARS) + v = init_dynamic_array_var ("DIRSTACK", get_dirstack, assign_dirstack, 0); +#endif /* PUSHD_AND_POPD && ARRAY_VARS */ + +#if defined (ARRAY_VARS) + v = init_dynamic_array_var ("GROUPS", get_groupset, null_array_assign, att_noassign); + +# if defined (DEBUGGER) + v = init_dynamic_array_var ("BASH_ARGC", get_self, null_array_assign, att_noassign|att_nounset); + v = init_dynamic_array_var ("BASH_ARGV", get_self, null_array_assign, att_noassign|att_nounset); +# endif /* DEBUGGER */ + v = init_dynamic_array_var ("BASH_SOURCE", get_self, null_array_assign, att_noassign|att_nounset); + v = init_dynamic_array_var ("BASH_LINENO", get_self, null_array_assign, att_noassign|att_nounset); + + v = init_dynamic_assoc_var ("BASH_CMDS", get_hashcmd, assign_hashcmd, att_nofree); +# if defined (ALIAS) + v = init_dynamic_assoc_var ("BASH_ALIASES", get_aliasvar, assign_aliasvar, att_nofree); +# endif +#endif + + v = init_funcname_var (); +} + +/* **************************************************************** */ +/* */ +/* Retrieving variables and values */ +/* */ +/* **************************************************************** */ + +/* How to get a pointer to the shell variable or function named NAME. + HASHED_VARS is a pointer to the hash table containing the list + of interest (either variables or functions). */ + +static SHELL_VAR * +hash_lookup (name, hashed_vars) + const char *name; + HASH_TABLE *hashed_vars; +{ + BUCKET_CONTENTS *bucket; + + bucket = hash_search (name, hashed_vars, 0); + /* If we find the name in HASHED_VARS, set LAST_TABLE_SEARCHED to that + table. */ + if (bucket) + last_table_searched = hashed_vars; + return (bucket ? (SHELL_VAR *)bucket->data : (SHELL_VAR *)NULL); +} + +SHELL_VAR * +var_lookup (name, vcontext) + const char *name; + VAR_CONTEXT *vcontext; +{ + VAR_CONTEXT *vc; + SHELL_VAR *v; + + v = (SHELL_VAR *)NULL; + for (vc = vcontext; vc; vc = vc->down) + if (v = hash_lookup (name, vc->table)) + break; + + return v; +} + +/* Look up the variable entry named NAME. If SEARCH_TEMPENV is non-zero, + then also search the temporarily built list of exported variables. + The lookup order is: + temporary_env + shell_variables list +*/ + +SHELL_VAR * +find_variable_internal (name, force_tempenv) + const char *name; + int force_tempenv; +{ + SHELL_VAR *var; + int search_tempenv; + VAR_CONTEXT *vc; + + var = (SHELL_VAR *)NULL; + + /* If explicitly requested, first look in the temporary environment for + the variable. This allows constructs such as "foo=x eval 'echo $foo'" + to get the `exported' value of $foo. This happens if we are executing + a function or builtin, or if we are looking up a variable in a + "subshell environment". */ + search_tempenv = force_tempenv || (expanding_redir == 0 && subshell_environment); + + if (search_tempenv && temporary_env) + var = hash_lookup (name, temporary_env); + + vc = shell_variables; +#if 0 +if (search_tempenv == 0 && /* (subshell_environment & SUBSHELL_COMSUB) && */ + expanding_redir && + (this_shell_builtin == eval_builtin || this_shell_builtin == command_builtin)) + { + itrace("find_variable_internal: search_tempenv == 0: skipping VC_BLTNENV"); + while (vc && (vc->flags & VC_BLTNENV)) + vc = vc->down; + if (vc == 0) + vc = shell_variables; + } +#endif + + if (var == 0) + var = var_lookup (name, vc); + + if (var == 0) + return ((SHELL_VAR *)NULL); + + return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var); +} + +/* Look up and resolve the chain of nameref variables starting at V all the + way to NULL or non-nameref. */ +SHELL_VAR * +find_variable_nameref (v) + SHELL_VAR *v; +{ + int level; + char *newname; + SHELL_VAR *orig, *oldv; + + level = 0; + orig = v; + while (v && nameref_p (v)) + { + level++; + if (level > NAMEREF_MAX) + return ((SHELL_VAR *)0); /* error message here? */ + newname = nameref_cell (v); + if (newname == 0 || *newname == '\0') + return ((SHELL_VAR *)0); + oldv = v; + v = find_variable_internal (newname, (expanding_redir == 0 && (assigning_in_environment || executing_builtin))); + if (v == orig || v == oldv) + { + internal_warning (_("%s: circular name reference"), orig->name); + return ((SHELL_VAR *)0); + } + } + return v; +} + +/* Resolve the chain of nameref variables for NAME. XXX - could change later */ +SHELL_VAR * +find_variable_last_nameref (name) + const char *name; +{ + SHELL_VAR *v, *nv; + char *newname; + int level; + + nv = v = find_variable_noref (name); + level = 0; + while (v && nameref_p (v)) + { + level++; + if (level > NAMEREF_MAX) + return ((SHELL_VAR *)0); /* error message here? */ + newname = nameref_cell (v); + if (newname == 0 || *newname == '\0') + return ((SHELL_VAR *)0); + nv = v; + v = find_variable_internal (newname, (expanding_redir == 0 && (assigning_in_environment || executing_builtin))); + } + return nv; +} + +/* Resolve the chain of nameref variables for NAME. XXX - could change later */ +SHELL_VAR * +find_global_variable_last_nameref (name) + const char *name; +{ + SHELL_VAR *v, *nv; + char *newname; + int level; + + nv = v = find_global_variable_noref (name); + level = 0; + while (v && nameref_p (v)) + { + level++; + if (level > NAMEREF_MAX) + return ((SHELL_VAR *)0); /* error message here? */ + newname = nameref_cell (v); + if (newname == 0 || *newname == '\0') + return ((SHELL_VAR *)0); + nv = v; + v = find_global_variable_noref (newname); + } + return nv; +} + +static SHELL_VAR * +find_nameref_at_context (v, vc) + SHELL_VAR *v; + VAR_CONTEXT *vc; +{ + SHELL_VAR *nv, *nv2; + VAR_CONTEXT *nvc; + char *newname; + int level; + + nv = v; + level = 1; + while (nv && nameref_p (nv)) + { + level++; + if (level > NAMEREF_MAX) + return ((SHELL_VAR *)NULL); + newname = nameref_cell (nv); + if (newname == 0 || *newname == '\0') + return ((SHELL_VAR *)NULL); + nv2 = hash_lookup (newname, vc->table); + if (nv2 == 0) + break; + nv = nv2; + } + return nv; +} + +/* Do nameref resolution from the VC, which is the local context for some + function or builtin, `up' the chain to the global variables context. If + NVCP is not NULL, return the variable context where we finally ended the + nameref resolution (so the bind_variable_internal can use the correct + variable context and hash table). */ +static SHELL_VAR * +find_variable_nameref_context (v, vc, nvcp) + SHELL_VAR *v; + VAR_CONTEXT *vc; + VAR_CONTEXT **nvcp; +{ + SHELL_VAR *nv, *nv2; + VAR_CONTEXT *nvc; + + /* Look starting at the current context all the way `up' */ + for (nv = v, nvc = vc; nvc; nvc = nvc->down) + { + nv2 = find_nameref_at_context (nv, nvc); + if (nv2 == 0) + continue; + nv = nv2; + if (*nvcp) + *nvcp = nvc; + if (nameref_p (nv) == 0) + break; + } + return (nameref_p (nv) ? (SHELL_VAR *)NULL : nv); +} + +/* Do nameref resolution from the VC, which is the local context for some + function or builtin, `up' the chain to the global variables context. If + NVCP is not NULL, return the variable context where we finally ended the + nameref resolution (so the bind_variable_internal can use the correct + variable context and hash table). */ +static SHELL_VAR * +find_variable_last_nameref_context (v, vc, nvcp) + SHELL_VAR *v; + VAR_CONTEXT *vc; + VAR_CONTEXT **nvcp; +{ + SHELL_VAR *nv, *nv2; + VAR_CONTEXT *nvc; + + /* Look starting at the current context all the way `up' */ + for (nv = v, nvc = vc; nvc; nvc = nvc->down) + { + nv2 = find_nameref_at_context (nv, nvc); + if (nv2 == 0) + continue; + nv = nv2; + if (*nvcp) + *nvcp = nvc; + } + return (nameref_p (nv) ? nv : (SHELL_VAR *)NULL); +} + +/* Find a variable, forcing a search of the temporary environment first */ +SHELL_VAR * +find_variable_tempenv (name) + const char *name; +{ + SHELL_VAR *var; + + var = find_variable_internal (name, 1); + if (var && nameref_p (var)) + var = find_variable_nameref (var); + return (var); +} + +/* Find a variable, not forcing a search of the temporary environment first */ +SHELL_VAR * +find_variable_notempenv (name) + const char *name; +{ + SHELL_VAR *var; + + var = find_variable_internal (name, 0); + if (var && nameref_p (var)) + var = find_variable_nameref (var); + return (var); +} + +SHELL_VAR * +find_global_variable (name) + const char *name; +{ + SHELL_VAR *var; + + var = var_lookup (name, global_variables); + if (var && nameref_p (var)) + var = find_variable_nameref (var); + + if (var == 0) + return ((SHELL_VAR *)NULL); + + return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var); +} + +SHELL_VAR * +find_global_variable_noref (name) + const char *name; +{ + SHELL_VAR *var; + + var = var_lookup (name, global_variables); + + if (var == 0) + return ((SHELL_VAR *)NULL); + + return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var); +} + +SHELL_VAR * +find_shell_variable (name) + const char *name; +{ + SHELL_VAR *var; + + var = var_lookup (name, shell_variables); + if (var && nameref_p (var)) + var = find_variable_nameref (var); + + if (var == 0) + return ((SHELL_VAR *)NULL); + + return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var); +} + +/* Look up the variable entry named NAME. Returns the entry or NULL. */ +SHELL_VAR * +find_variable (name) + const char *name; +{ + SHELL_VAR *v; + + last_table_searched = 0; + v = find_variable_internal (name, (expanding_redir == 0 && (assigning_in_environment || executing_builtin))); + if (v && nameref_p (v)) + v = find_variable_nameref (v); + return v; +} + +SHELL_VAR * +find_variable_noref (name) + const char *name; +{ + SHELL_VAR *v; + + v = find_variable_internal (name, (expanding_redir == 0 && (assigning_in_environment || executing_builtin))); + return v; +} + +/* Look up the function entry whose name matches STRING. + Returns the entry or NULL. */ +SHELL_VAR * +find_function (name) + const char *name; +{ + return (hash_lookup (name, shell_functions)); +} + +/* Find the function definition for the shell function named NAME. Returns + the entry or NULL. */ +FUNCTION_DEF * +find_function_def (name) + const char *name; +{ +#if defined (DEBUGGER) + return ((FUNCTION_DEF *)hash_lookup (name, shell_function_defs)); +#else + return ((FUNCTION_DEF *)0); +#endif +} + +/* Return the value of VAR. VAR is assumed to have been the result of a + lookup without any subscript, if arrays are compiled into the shell. */ +char * +get_variable_value (var) + SHELL_VAR *var; +{ + if (var == 0) + return ((char *)NULL); +#if defined (ARRAY_VARS) + else if (array_p (var)) + return (array_reference (array_cell (var), 0)); + else if (assoc_p (var)) + return (assoc_reference (assoc_cell (var), "0")); +#endif + else + return (value_cell (var)); +} + +/* Return the string value of a variable. Return NULL if the variable + doesn't exist. Don't cons a new string. This is a potential memory + leak if the variable is found in the temporary environment. Since + functions and variables have separate name spaces, returns NULL if + var_name is a shell function only. */ +char * +get_string_value (var_name) + const char *var_name; +{ + SHELL_VAR *var; + + var = find_variable (var_name); + return ((var) ? get_variable_value (var) : (char *)NULL); +} + +/* This is present for use by the tilde and readline libraries. */ +char * +sh_get_env_value (v) + const char *v; +{ + return get_string_value (v); +} + +/* **************************************************************** */ +/* */ +/* Creating and setting variables */ +/* */ +/* **************************************************************** */ + +/* Set NAME to VALUE if NAME has no value. */ +SHELL_VAR * +set_if_not (name, value) + char *name, *value; +{ + SHELL_VAR *v; + + if (shell_variables == 0) + create_variable_tables (); + + v = find_variable (name); + if (v == 0) + v = bind_variable_internal (name, value, global_variables->table, HASH_NOSRCH, 0); + return (v); +} + +/* Create a local variable referenced by NAME. */ +SHELL_VAR * +make_local_variable (name) + const char *name; +{ + SHELL_VAR *new_var, *old_var; + VAR_CONTEXT *vc; + int was_tmpvar; + char *tmp_value; + + /* local foo; local foo; is a no-op. */ + old_var = find_variable (name); + if (old_var && local_p (old_var) && old_var->context == variable_context) + { + VUNSETATTR (old_var, att_invisible); /* XXX */ + return (old_var); + } + + was_tmpvar = old_var && tempvar_p (old_var); + /* If we're making a local variable in a shell function, the temporary env + has already been merged into the function's variable context stack. We + can assume that a temporary var in the same context appears in the same + VAR_CONTEXT and can safely be returned without creating a new variable + (which results in duplicate names in the same VAR_CONTEXT->table */ + /* We can't just test tmpvar_p because variables in the temporary env given + to a shell function appear in the function's local variable VAR_CONTEXT + but retain their tempvar attribute. We want temporary variables that are + found in temporary_env, hence the test for last_table_searched, which is + set in hash_lookup and only (so far) checked here. */ + if (was_tmpvar && old_var->context == variable_context && last_table_searched != temporary_env) + { + VUNSETATTR (old_var, att_invisible); + return (old_var); + } + if (was_tmpvar) + tmp_value = value_cell (old_var); + + for (vc = shell_variables; vc; vc = vc->down) + if (vc_isfuncenv (vc) && vc->scope == variable_context) + break; + + if (vc == 0) + { + internal_error (_("make_local_variable: no function context at current scope")); + return ((SHELL_VAR *)NULL); + } + else if (vc->table == 0) + vc->table = hash_create (TEMPENV_HASH_BUCKETS); + + /* Since this is called only from the local/declare/typeset code, we can + call builtin_error here without worry (of course, it will also work + for anything that sets this_command_name). Variables with the `noassign' + attribute may not be made local. The test against old_var's context + level is to disallow local copies of readonly global variables (since I + believe that this could be a security hole). Readonly copies of calling + function local variables are OK. */ + if (old_var && (noassign_p (old_var) || + (readonly_p (old_var) && old_var->context == 0))) + { + if (readonly_p (old_var)) + sh_readonly (name); + else if (noassign_p (old_var)) + builtin_error (_("%s: variable may not be assigned value"), name); +#if 0 + /* Let noassign variables through with a warning */ + if (readonly_p (old_var)) +#endif + return ((SHELL_VAR *)NULL); + } + + if (old_var == 0) + new_var = make_new_variable (name, vc->table); + else + { + new_var = make_new_variable (name, vc->table); + + /* If we found this variable in one of the temporary environments, + inherit its value. Watch to see if this causes problems with + things like `x=4 local x'. XXX - see above for temporary env + variables with the same context level as variable_context */ + /* XXX - we should only do this if the variable is not an array. */ + if (was_tmpvar) + var_setvalue (new_var, savestring (tmp_value)); + + new_var->attributes = exported_p (old_var) ? att_exported : 0; + } + + vc->flags |= VC_HASLOCAL; + + new_var->context = variable_context; + VSETATTR (new_var, att_local); + + if (ifsname (name)) + setifs (new_var); + + if (was_tmpvar == 0) + VSETATTR (new_var, att_invisible); /* XXX */ + return (new_var); +} + +/* Create a new shell variable with name NAME. */ +static SHELL_VAR * +new_shell_variable (name) + const char *name; +{ + SHELL_VAR *entry; + + entry = (SHELL_VAR *)xmalloc (sizeof (SHELL_VAR)); + + entry->name = savestring (name); + var_setvalue (entry, (char *)NULL); + CLEAR_EXPORTSTR (entry); + + entry->dynamic_value = (sh_var_value_func_t *)NULL; + entry->assign_func = (sh_var_assign_func_t *)NULL; + + entry->attributes = 0; + + /* Always assume variables are to be made at toplevel! + make_local_variable has the responsibility of changing the + variable context. */ + entry->context = 0; + + return (entry); +} + +/* Create a new shell variable with name NAME and add it to the hash table + TABLE. */ +static SHELL_VAR * +make_new_variable (name, table) + const char *name; + HASH_TABLE *table; +{ + SHELL_VAR *entry; + BUCKET_CONTENTS *elt; + + entry = new_shell_variable (name); + + /* Make sure we have a shell_variables hash table to add to. */ + if (shell_variables == 0) + create_variable_tables (); + + elt = hash_insert (savestring (name), table, HASH_NOSRCH); + elt->data = (PTR_T)entry; + + return entry; +} + +#if defined (ARRAY_VARS) +SHELL_VAR * +make_new_array_variable (name) + char *name; +{ + SHELL_VAR *entry; + ARRAY *array; + + entry = make_new_variable (name, global_variables->table); + array = array_create (); + + var_setarray (entry, array); + VSETATTR (entry, att_array); + return entry; +} + +SHELL_VAR * +make_local_array_variable (name, assoc_ok) + char *name; + int assoc_ok; +{ + SHELL_VAR *var; + ARRAY *array; + + var = make_local_variable (name); + if (var == 0 || array_p (var) || (assoc_ok && assoc_p (var))) + return var; + + array = array_create (); + + dispose_variable_value (var); + var_setarray (var, array); + VSETATTR (var, att_array); + return var; +} + +SHELL_VAR * +make_new_assoc_variable (name) + char *name; +{ + SHELL_VAR *entry; + HASH_TABLE *hash; + + entry = make_new_variable (name, global_variables->table); + hash = assoc_create (0); + + var_setassoc (entry, hash); + VSETATTR (entry, att_assoc); + return entry; +} + +SHELL_VAR * +make_local_assoc_variable (name) + char *name; +{ + SHELL_VAR *var; + HASH_TABLE *hash; + + var = make_local_variable (name); + if (var == 0 || assoc_p (var)) + return var; + + dispose_variable_value (var); + hash = assoc_create (0); + + var_setassoc (var, hash); + VSETATTR (var, att_assoc); + return var; +} +#endif + +char * +make_variable_value (var, value, flags) + SHELL_VAR *var; + char *value; + int flags; +{ + char *retval, *oval; + intmax_t lval, rval; + int expok, olen, op; + + /* If this variable has had its type set to integer (via `declare -i'), + then do expression evaluation on it and store the result. The + functions in expr.c (evalexp()) and bind_int_variable() are responsible + for turning off the integer flag if they don't want further + evaluation done. */ + if (integer_p (var)) + { + if (flags & ASS_APPEND) + { + oval = value_cell (var); + lval = evalexp (oval, &expok); /* ksh93 seems to do this */ + if (expok == 0) + { + top_level_cleanup (); + jump_to_top_level (DISCARD); + } + } + rval = evalexp (value, &expok); + if (expok == 0) + { + top_level_cleanup (); + jump_to_top_level (DISCARD); + } + /* This can be fooled if the variable's value changes while evaluating + `rval'. We can change it if we move the evaluation of lval to here. */ + if (flags & ASS_APPEND) + rval += lval; + retval = itos (rval); + } +#if defined (CASEMOD_ATTRS) + else if (capcase_p (var) || uppercase_p (var) || lowercase_p (var)) + { + if (flags & ASS_APPEND) + { + oval = get_variable_value (var); + if (oval == 0) /* paranoia */ + oval = ""; + olen = STRLEN (oval); + retval = (char *)xmalloc (olen + (value ? STRLEN (value) : 0) + 1); + strcpy (retval, oval); + if (value) + strcpy (retval+olen, value); + } + else if (*value) + retval = savestring (value); + else + { + retval = (char *)xmalloc (1); + retval[0] = '\0'; + } + op = capcase_p (var) ? CASE_CAPITALIZE + : (uppercase_p (var) ? CASE_UPPER : CASE_LOWER); + oval = sh_modcase (retval, (char *)0, op); + free (retval); + retval = oval; + } +#endif /* CASEMOD_ATTRS */ + else if (value) + { + if (flags & ASS_APPEND) + { + oval = get_variable_value (var); + if (oval == 0) /* paranoia */ + oval = ""; + olen = STRLEN (oval); + retval = (char *)xmalloc (olen + (value ? STRLEN (value) : 0) + 1); + strcpy (retval, oval); + if (value) + strcpy (retval+olen, value); + } + else if (*value) + retval = savestring (value); + else + { + retval = (char *)xmalloc (1); + retval[0] = '\0'; + } + } + else + retval = (char *)NULL; + + return retval; +} + +/* Bind a variable NAME to VALUE in the HASH_TABLE TABLE, which may be the + temporary environment (but usually is not). */ +static SHELL_VAR * +bind_variable_internal (name, value, table, hflags, aflags) + const char *name; + char *value; + HASH_TABLE *table; + int hflags, aflags; +{ + char *newval; + SHELL_VAR *entry; + + entry = (hflags & HASH_NOSRCH) ? (SHELL_VAR *)NULL : hash_lookup (name, table); + /* Follow the nameref chain here if this is the global variables table */ + if (entry && nameref_p (entry) && (invisible_p (entry) == 0) && table == global_variables->table) + { + entry = find_global_variable (entry->name); + /* Let's see if we have a nameref referencing a variable that hasn't yet + been created. */ + if (entry == 0) + entry = find_variable_last_nameref (name); /* XXX */ + if (entry == 0) /* just in case */ + return (entry); + } + + /* The first clause handles `declare -n ref; ref=x;' */ + if (entry && invisible_p (entry) && nameref_p (entry)) + goto assign_value; + else if (entry && nameref_p (entry)) + { + newval = nameref_cell (entry); +#if defined (ARRAY_VARS) + /* declare -n foo=x[2] */ + if (valid_array_reference (newval)) + /* XXX - should it be aflags? */ + entry = assign_array_element (newval, make_variable_value (entry, value, 0), aflags); + else +#endif + { + entry = make_new_variable (newval, table); + var_setvalue (entry, make_variable_value (entry, value, 0)); + } + } + else if (entry == 0) + { + entry = make_new_variable (name, table); + var_setvalue (entry, make_variable_value (entry, value, 0)); /* XXX */ + } + else if (entry->assign_func) /* array vars have assign functions now */ + { + INVALIDATE_EXPORTSTR (entry); + newval = (aflags & ASS_APPEND) ? make_variable_value (entry, value, aflags) : value; + if (assoc_p (entry)) + entry = (*(entry->assign_func)) (entry, newval, -1, savestring ("0")); + else if (array_p (entry)) + entry = (*(entry->assign_func)) (entry, newval, 0, 0); + else + entry = (*(entry->assign_func)) (entry, newval, -1, 0); + if (newval != value) + free (newval); + return (entry); + } + else + { +assign_value: + if (readonly_p (entry) || noassign_p (entry)) + { + if (readonly_p (entry)) + err_readonly (name); + return (entry); + } + + /* Variables which are bound are visible. */ + VUNSETATTR (entry, att_invisible); + +#if defined (ARRAY_VARS) + if (assoc_p (entry) || array_p (entry)) + newval = make_array_variable_value (entry, 0, "0", value, aflags); + else +#endif + + newval = make_variable_value (entry, value, aflags); /* XXX */ + + /* Invalidate any cached export string */ + INVALIDATE_EXPORTSTR (entry); + +#if defined (ARRAY_VARS) + /* XXX -- this bears looking at again -- XXX */ + /* If an existing array variable x is being assigned to with x=b or + `read x' or something of that nature, silently convert it to + x[0]=b or `read x[0]'. */ + if (assoc_p (entry)) + { + assoc_insert (assoc_cell (entry), savestring ("0"), newval); + free (newval); + } + else if (array_p (entry)) + { + array_insert (array_cell (entry), 0, newval); + free (newval); + } + else +#endif + { + FREE (value_cell (entry)); + var_setvalue (entry, newval); + } + } + + if (mark_modified_vars) + VSETATTR (entry, att_exported); + + if (exported_p (entry)) + array_needs_making = 1; + + return (entry); +} + +/* Bind a variable NAME to VALUE. This conses up the name + and value strings. If we have a temporary environment, we bind there + first, then we bind into shell_variables. */ + +SHELL_VAR * +bind_variable (name, value, flags) + const char *name; + char *value; + int flags; +{ + SHELL_VAR *v, *nv; + VAR_CONTEXT *vc, *nvc; + int level; + + if (shell_variables == 0) + create_variable_tables (); + + /* If we have a temporary environment, look there first for the variable, + and, if found, modify the value there before modifying it in the + shell_variables table. This allows sourced scripts to modify values + given to them in a temporary environment while modifying the variable + value that the caller sees. */ + if (temporary_env) + bind_tempenv_variable (name, value); + + /* XXX -- handle local variables here. */ + for (vc = shell_variables; vc; vc = vc->down) + { + if (vc_isfuncenv (vc) || vc_isbltnenv (vc)) + { + v = hash_lookup (name, vc->table); + nvc = vc; + if (v && nameref_p (v)) + { + nv = find_variable_nameref_context (v, vc, &nvc); + if (nv == 0) + { + nv = find_variable_last_nameref_context (v, vc, &nvc); + if (nv && nameref_p (nv)) + { + /* If this nameref variable doesn't have a value yet, + set the value. Otherwise, assign using the value as + normal. */ + if (nameref_cell (nv) == 0) + return (bind_variable_internal (nv->name, value, nvc->table, 0, flags)); + return (bind_variable_internal (nameref_cell (nv), value, nvc->table, 0, flags)); + } + else + v = nv; + } + else + v = nv; + } + if (v) + return (bind_variable_internal (v->name, value, nvc->table, 0, flags)); + } + } + /* bind_variable_internal will handle nameref resolution in this case */ + return (bind_variable_internal (name, value, global_variables->table, 0, flags)); +} + +SHELL_VAR * +bind_global_variable (name, value, flags) + const char *name; + char *value; + int flags; +{ + SHELL_VAR *v, *nv; + VAR_CONTEXT *vc, *nvc; + int level; + + if (shell_variables == 0) + create_variable_tables (); + + /* bind_variable_internal will handle nameref resolution in this case */ + return (bind_variable_internal (name, value, global_variables->table, 0, flags)); +} + +/* Make VAR, a simple shell variable, have value VALUE. Once assigned a + value, variables are no longer invisible. This is a duplicate of part + of the internals of bind_variable. If the variable is exported, or + all modified variables should be exported, mark the variable for export + and note that the export environment needs to be recreated. */ +SHELL_VAR * +bind_variable_value (var, value, aflags) + SHELL_VAR *var; + char *value; + int aflags; +{ + char *t; + int invis; + + invis = invisible_p (var); + VUNSETATTR (var, att_invisible); + + if (var->assign_func) + { + /* If we're appending, we need the old value, so use + make_variable_value */ + t = (aflags & ASS_APPEND) ? make_variable_value (var, value, aflags) : value; + (*(var->assign_func)) (var, t, -1, 0); + if (t != value && t) + free (t); + } + else + { + t = make_variable_value (var, value, aflags); +#if defined (ARRAY_VARS) + if ((aflags & ASS_NAMEREF) && (t == 0 || *t == 0 || (legal_identifier (t) == 0 && valid_array_reference (t) == 0))) +#else + if ((aflags & ASS_NAMEREF) && (t == 0 || *t == 0 || legal_identifier (t) == 0)) +#endif + { + free (t); + if (invis) + VSETATTR (var, att_invisible); /* XXX */ + return ((SHELL_VAR *)NULL); + } + FREE (value_cell (var)); + var_setvalue (var, t); + } + + INVALIDATE_EXPORTSTR (var); + + if (mark_modified_vars) + VSETATTR (var, att_exported); + + if (exported_p (var)) + array_needs_making = 1; + + return (var); +} + +/* Bind/create a shell variable with the name LHS to the RHS. + This creates or modifies a variable such that it is an integer. + + This used to be in expr.c, but it is here so that all of the + variable binding stuff is localized. Since we don't want any + recursive evaluation from bind_variable() (possible without this code, + since bind_variable() calls the evaluator for variables with the integer + attribute set), we temporarily turn off the integer attribute for each + variable we set here, then turn it back on after binding as necessary. */ + +SHELL_VAR * +bind_int_variable (lhs, rhs) + char *lhs, *rhs; +{ + register SHELL_VAR *v; + int isint, isarr, implicitarray; + + isint = isarr = implicitarray = 0; +#if defined (ARRAY_VARS) + if (valid_array_reference (lhs)) + { + isarr = 1; + v = array_variable_part (lhs, (char **)0, (int *)0); + } + else +#endif + v = find_variable (lhs); + + if (v) + { + isint = integer_p (v); + VUNSETATTR (v, att_integer); +#if defined (ARRAY_VARS) + if (array_p (v) && isarr == 0) + implicitarray = 1; +#endif + } + +#if defined (ARRAY_VARS) + if (isarr) + v = assign_array_element (lhs, rhs, 0); + else if (implicitarray) + v = bind_array_variable (lhs, 0, rhs, 0); + else +#endif + v = bind_variable (lhs, rhs, 0); + + if (v && isint) + VSETATTR (v, att_integer); + + VUNSETATTR (v, att_invisible); + + return (v); +} + +SHELL_VAR * +bind_var_to_int (var, val) + char *var; + intmax_t val; +{ + char ibuf[INT_STRLEN_BOUND (intmax_t) + 1], *p; + + p = fmtulong (val, 10, ibuf, sizeof (ibuf), 0); + return (bind_int_variable (var, p)); +} + +/* Do a function binding to a variable. You pass the name and + the command to bind to. This conses the name and command. */ +SHELL_VAR * +bind_function (name, value) + const char *name; + COMMAND *value; +{ + SHELL_VAR *entry; + + entry = find_function (name); + if (entry == 0) + { + BUCKET_CONTENTS *elt; + + elt = hash_insert (savestring (name), shell_functions, HASH_NOSRCH); + entry = new_shell_variable (name); + elt->data = (PTR_T)entry; + } + else + INVALIDATE_EXPORTSTR (entry); + + if (var_isset (entry)) + dispose_command (function_cell (entry)); + + if (value) + var_setfunc (entry, copy_command (value)); + else + var_setfunc (entry, 0); + + VSETATTR (entry, att_function); + + if (mark_modified_vars) + VSETATTR (entry, att_exported); + + VUNSETATTR (entry, att_invisible); /* Just to be sure */ + + if (exported_p (entry)) + array_needs_making = 1; + +#if defined (PROGRAMMABLE_COMPLETION) + set_itemlist_dirty (&it_functions); +#endif + + return (entry); +} + +#if defined (DEBUGGER) +/* Bind a function definition, which includes source file and line number + information in addition to the command, into the FUNCTION_DEF hash table.*/ +void +bind_function_def (name, value) + const char *name; + FUNCTION_DEF *value; +{ + FUNCTION_DEF *entry; + BUCKET_CONTENTS *elt; + COMMAND *cmd; + + entry = find_function_def (name); + if (entry) + { + dispose_function_def_contents (entry); + entry = copy_function_def_contents (value, entry); + } + else + { + cmd = value->command; + value->command = 0; + entry = copy_function_def (value); + value->command = cmd; + + elt = hash_insert (savestring (name), shell_function_defs, HASH_NOSRCH); + elt->data = (PTR_T *)entry; + } +} +#endif /* DEBUGGER */ + +/* Add STRING, which is of the form foo=bar, to the temporary environment + HASH_TABLE (temporary_env). The functions in execute_cmd.c are + responsible for moving the main temporary env to one of the other + temporary environments. The expansion code in subst.c calls this. */ +int +assign_in_env (word, flags) + WORD_DESC *word; + int flags; +{ + int offset, aflags; + char *name, *temp, *value; + SHELL_VAR *var; + const char *string; + + string = word->word; + + aflags = 0; + offset = assignment (string, 0); + name = savestring (string); + value = (char *)NULL; + + if (name[offset] == '=') + { + name[offset] = 0; + + /* don't ignore the `+' when assigning temporary environment */ + if (name[offset - 1] == '+') + { + name[offset - 1] = '\0'; + aflags |= ASS_APPEND; + } + + var = find_variable (name); + if (var && (readonly_p (var) || noassign_p (var))) + { + if (readonly_p (var)) + err_readonly (name); + free (name); + return (0); + } + + temp = name + offset + 1; + value = expand_assignment_string_to_string (temp, 0); + + if (var && (aflags & ASS_APPEND)) + { + temp = make_variable_value (var, value, aflags); + FREE (value); + value = temp; + } + } + + if (temporary_env == 0) + temporary_env = hash_create (TEMPENV_HASH_BUCKETS); + + var = hash_lookup (name, temporary_env); + if (var == 0) + var = make_new_variable (name, temporary_env); + else + FREE (value_cell (var)); + + if (value == 0) + { + value = (char *)xmalloc (1); /* like do_assignment_internal */ + value[0] = '\0'; + } + + var_setvalue (var, value); + var->attributes |= (att_exported|att_tempvar); + var->context = variable_context; /* XXX */ + + INVALIDATE_EXPORTSTR (var); + var->exportstr = mk_env_string (name, value); + + array_needs_making = 1; + + if (flags) + stupidly_hack_special_variables (name); + + if (echo_command_at_execute) + /* The Korn shell prints the `+ ' in front of assignment statements, + so we do too. */ + xtrace_print_assignment (name, value, 0, 1); + + free (name); + return 1; +} + +/* **************************************************************** */ +/* */ +/* Copying variables */ +/* */ +/* **************************************************************** */ + +#ifdef INCLUDE_UNUSED +/* Copy VAR to a new data structure and return that structure. */ +SHELL_VAR * +copy_variable (var) + SHELL_VAR *var; +{ + SHELL_VAR *copy = (SHELL_VAR *)NULL; + + if (var) + { + copy = (SHELL_VAR *)xmalloc (sizeof (SHELL_VAR)); + + copy->attributes = var->attributes; + copy->name = savestring (var->name); + + if (function_p (var)) + var_setfunc (copy, copy_command (function_cell (var))); +#if defined (ARRAY_VARS) + else if (array_p (var)) + var_setarray (copy, array_copy (array_cell (var))); + else if (assoc_p (var)) + var_setassoc (copy, assoc_copy (assoc_cell (var))); +#endif + else if (nameref_cell (var)) /* XXX - nameref */ + var_setref (copy, savestring (nameref_cell (var))); + else if (value_cell (var)) /* XXX - nameref */ + var_setvalue (copy, savestring (value_cell (var))); + else + var_setvalue (copy, (char *)NULL); + + copy->dynamic_value = var->dynamic_value; + copy->assign_func = var->assign_func; + + copy->exportstr = COPY_EXPORTSTR (var); + + copy->context = var->context; + } + return (copy); +} +#endif + +/* **************************************************************** */ +/* */ +/* Deleting and unsetting variables */ +/* */ +/* **************************************************************** */ + +/* Dispose of the information attached to VAR. */ +static void +dispose_variable_value (var) + SHELL_VAR *var; +{ + if (function_p (var)) + dispose_command (function_cell (var)); +#if defined (ARRAY_VARS) + else if (array_p (var)) + array_dispose (array_cell (var)); + else if (assoc_p (var)) + assoc_dispose (assoc_cell (var)); +#endif + else if (nameref_p (var)) + FREE (nameref_cell (var)); + else + FREE (value_cell (var)); +} + +void +dispose_variable (var) + SHELL_VAR *var; +{ + if (var == 0) + return; + + if (nofree_p (var) == 0) + dispose_variable_value (var); + + FREE_EXPORTSTR (var); + + free (var->name); + + if (exported_p (var)) + array_needs_making = 1; + + free (var); +} + +/* Unset the shell variable referenced by NAME. Unsetting a nameref variable + unsets the variable it resolves to but leaves the nameref alone. */ +int +unbind_variable (name) + const char *name; +{ + SHELL_VAR *v, *nv; + int r; + + v = var_lookup (name, shell_variables); + nv = (v && nameref_p (v)) ? find_variable_nameref (v) : (SHELL_VAR *)NULL; + + r = nv ? makunbound (nv->name, shell_variables) : makunbound (name, shell_variables); + return r; +} + +/* Unbind NAME, where NAME is assumed to be a nameref variable */ +int +unbind_nameref (name) + const char *name; +{ + SHELL_VAR *v; + + v = var_lookup (name, shell_variables); + if (v && nameref_p (v)) + return makunbound (name, shell_variables); + return 0; +} + +/* Unset the shell function named NAME. */ +int +unbind_func (name) + const char *name; +{ + BUCKET_CONTENTS *elt; + SHELL_VAR *func; + + elt = hash_remove (name, shell_functions, 0); + + if (elt == 0) + return -1; + +#if defined (PROGRAMMABLE_COMPLETION) + set_itemlist_dirty (&it_functions); +#endif + + func = (SHELL_VAR *)elt->data; + if (func) + { + if (exported_p (func)) + array_needs_making++; + dispose_variable (func); + } + + free (elt->key); + free (elt); + + return 0; +} + +#if defined (DEBUGGER) +int +unbind_function_def (name) + const char *name; +{ + BUCKET_CONTENTS *elt; + FUNCTION_DEF *funcdef; + + elt = hash_remove (name, shell_function_defs, 0); + + if (elt == 0) + return -1; + + funcdef = (FUNCTION_DEF *)elt->data; + if (funcdef) + dispose_function_def (funcdef); + + free (elt->key); + free (elt); + + return 0; +} +#endif /* DEBUGGER */ + +int +delete_var (name, vc) + const char *name; + VAR_CONTEXT *vc; +{ + BUCKET_CONTENTS *elt; + SHELL_VAR *old_var; + VAR_CONTEXT *v; + + for (elt = (BUCKET_CONTENTS *)NULL, v = vc; v; v = v->down) + if (elt = hash_remove (name, v->table, 0)) + break; + + if (elt == 0) + return (-1); + + old_var = (SHELL_VAR *)elt->data; + free (elt->key); + free (elt); + + dispose_variable (old_var); + return (0); +} + +/* Make the variable associated with NAME go away. HASH_LIST is the + hash table from which this variable should be deleted (either + shell_variables or shell_functions). + Returns non-zero if the variable couldn't be found. */ +int +makunbound (name, vc) + const char *name; + VAR_CONTEXT *vc; +{ + BUCKET_CONTENTS *elt, *new_elt; + SHELL_VAR *old_var; + VAR_CONTEXT *v; + char *t; + + for (elt = (BUCKET_CONTENTS *)NULL, v = vc; v; v = v->down) + if (elt = hash_remove (name, v->table, 0)) + break; + + if (elt == 0) + return (-1); + + old_var = (SHELL_VAR *)elt->data; + + if (old_var && exported_p (old_var)) + array_needs_making++; + + /* If we're unsetting a local variable and we're still executing inside + the function, just mark the variable as invisible. The function + eventually called by pop_var_context() will clean it up later. This + must be done so that if the variable is subsequently assigned a new + value inside the function, the `local' attribute is still present. + We also need to add it back into the correct hash table. */ + if (old_var && local_p (old_var) && variable_context == old_var->context) + { + if (nofree_p (old_var)) + var_setvalue (old_var, (char *)NULL); +#if defined (ARRAY_VARS) + else if (array_p (old_var)) + array_dispose (array_cell (old_var)); + else if (assoc_p (old_var)) + assoc_dispose (assoc_cell (old_var)); +#endif + else if (nameref_p (old_var)) + FREE (nameref_cell (old_var)); + else + FREE (value_cell (old_var)); + /* Reset the attributes. Preserve the export attribute if the variable + came from a temporary environment. Make sure it stays local, and + make it invisible. */ + old_var->attributes = (exported_p (old_var) && tempvar_p (old_var)) ? att_exported : 0; + VSETATTR (old_var, att_local); + VSETATTR (old_var, att_invisible); + var_setvalue (old_var, (char *)NULL); + INVALIDATE_EXPORTSTR (old_var); + + new_elt = hash_insert (savestring (old_var->name), v->table, 0); + new_elt->data = (PTR_T)old_var; + stupidly_hack_special_variables (old_var->name); + + free (elt->key); + free (elt); + return (0); + } + + /* Have to save a copy of name here, because it might refer to + old_var->name. If so, stupidly_hack_special_variables will + reference freed memory. */ + t = savestring (name); + + free (elt->key); + free (elt); + + dispose_variable (old_var); + stupidly_hack_special_variables (t); + free (t); + + return (0); +} + +/* Get rid of all of the variables in the current context. */ +void +kill_all_local_variables () +{ + VAR_CONTEXT *vc; + + for (vc = shell_variables; vc; vc = vc->down) + if (vc_isfuncenv (vc) && vc->scope == variable_context) + break; + if (vc == 0) + return; /* XXX */ + + if (vc->table && vc_haslocals (vc)) + { + delete_all_variables (vc->table); + hash_dispose (vc->table); + } + vc->table = (HASH_TABLE *)NULL; +} + +static void +free_variable_hash_data (data) + PTR_T data; +{ + SHELL_VAR *var; + + var = (SHELL_VAR *)data; + dispose_variable (var); +} + +/* Delete the entire contents of the hash table. */ +void +delete_all_variables (hashed_vars) + HASH_TABLE *hashed_vars; +{ + hash_flush (hashed_vars, free_variable_hash_data); +} + +/* **************************************************************** */ +/* */ +/* Setting variable attributes */ +/* */ +/* **************************************************************** */ + +#define FIND_OR_MAKE_VARIABLE(name, entry) \ + do \ + { \ + entry = find_variable (name); \ + if (!entry) \ + { \ + entry = bind_variable (name, "", 0); \ + if (!no_invisible_vars && entry) entry->attributes |= att_invisible; \ + } \ + } \ + while (0) + +/* Make the variable associated with NAME be readonly. + If NAME does not exist yet, create it. */ +void +set_var_read_only (name) + char *name; +{ + SHELL_VAR *entry; + + FIND_OR_MAKE_VARIABLE (name, entry); + VSETATTR (entry, att_readonly); +} + +#ifdef INCLUDE_UNUSED +/* Make the function associated with NAME be readonly. + If NAME does not exist, we just punt, like auto_export code below. */ +void +set_func_read_only (name) + const char *name; +{ + SHELL_VAR *entry; + + entry = find_function (name); + if (entry) + VSETATTR (entry, att_readonly); +} + +/* Make the variable associated with NAME be auto-exported. + If NAME does not exist yet, create it. */ +void +set_var_auto_export (name) + char *name; +{ + SHELL_VAR *entry; + + FIND_OR_MAKE_VARIABLE (name, entry); + set_auto_export (entry); +} + +/* Make the function associated with NAME be auto-exported. */ +void +set_func_auto_export (name) + const char *name; +{ + SHELL_VAR *entry; + + entry = find_function (name); + if (entry) + set_auto_export (entry); +} +#endif + +/* **************************************************************** */ +/* */ +/* Creating lists of variables */ +/* */ +/* **************************************************************** */ + +static VARLIST * +vlist_alloc (nentries) + int nentries; +{ + VARLIST *vlist; + + vlist = (VARLIST *)xmalloc (sizeof (VARLIST)); + vlist->list = (SHELL_VAR **)xmalloc ((nentries + 1) * sizeof (SHELL_VAR *)); + vlist->list_size = nentries; + vlist->list_len = 0; + vlist->list[0] = (SHELL_VAR *)NULL; + + return vlist; +} + +static VARLIST * +vlist_realloc (vlist, n) + VARLIST *vlist; + int n; +{ + if (vlist == 0) + return (vlist = vlist_alloc (n)); + if (n > vlist->list_size) + { + vlist->list_size = n; + vlist->list = (SHELL_VAR **)xrealloc (vlist->list, (vlist->list_size + 1) * sizeof (SHELL_VAR *)); + } + return vlist; +} + +static void +vlist_add (vlist, var, flags) + VARLIST *vlist; + SHELL_VAR *var; + int flags; +{ + register int i; + + for (i = 0; i < vlist->list_len; i++) + if (STREQ (var->name, vlist->list[i]->name)) + break; + if (i < vlist->list_len) + return; + + if (i >= vlist->list_size) + vlist = vlist_realloc (vlist, vlist->list_size + 16); + + vlist->list[vlist->list_len++] = var; + vlist->list[vlist->list_len] = (SHELL_VAR *)NULL; +} + +/* Map FUNCTION over the variables in VAR_HASH_TABLE. Return an array of the + variables for which FUNCTION returns a non-zero value. A NULL value + for FUNCTION means to use all variables. */ +SHELL_VAR ** +map_over (function, vc) + sh_var_map_func_t *function; + VAR_CONTEXT *vc; +{ + VAR_CONTEXT *v; + VARLIST *vlist; + SHELL_VAR **ret; + int nentries; + + for (nentries = 0, v = vc; v; v = v->down) + nentries += HASH_ENTRIES (v->table); + + if (nentries == 0) + return (SHELL_VAR **)NULL; + + vlist = vlist_alloc (nentries); + + for (v = vc; v; v = v->down) + flatten (v->table, function, vlist, 0); + + ret = vlist->list; + free (vlist); + return ret; +} + +SHELL_VAR ** +map_over_funcs (function) + sh_var_map_func_t *function; +{ + VARLIST *vlist; + SHELL_VAR **ret; + + if (shell_functions == 0 || HASH_ENTRIES (shell_functions) == 0) + return ((SHELL_VAR **)NULL); + + vlist = vlist_alloc (HASH_ENTRIES (shell_functions)); + + flatten (shell_functions, function, vlist, 0); + + ret = vlist->list; + free (vlist); + return ret; +} + +/* Flatten VAR_HASH_TABLE, applying FUNC to each member and adding those + elements for which FUNC succeeds to VLIST->list. FLAGS is reserved + for future use. Only unique names are added to VLIST. If FUNC is + NULL, each variable in VAR_HASH_TABLE is added to VLIST. If VLIST is + NULL, FUNC is applied to each SHELL_VAR in VAR_HASH_TABLE. If VLIST + and FUNC are both NULL, nothing happens. */ +static void +flatten (var_hash_table, func, vlist, flags) + HASH_TABLE *var_hash_table; + sh_var_map_func_t *func; + VARLIST *vlist; + int flags; +{ + register int i; + register BUCKET_CONTENTS *tlist; + int r; + SHELL_VAR *var; + + if (var_hash_table == 0 || (HASH_ENTRIES (var_hash_table) == 0) || (vlist == 0 && func == 0)) + return; + + for (i = 0; i < var_hash_table->nbuckets; i++) + { + for (tlist = hash_items (i, var_hash_table); tlist; tlist = tlist->next) + { + var = (SHELL_VAR *)tlist->data; + + r = func ? (*func) (var) : 1; + if (r && vlist) + vlist_add (vlist, var, flags); + } + } +} + +void +sort_variables (array) + SHELL_VAR **array; +{ + qsort (array, strvec_len ((char **)array), sizeof (SHELL_VAR *), (QSFUNC *)qsort_var_comp); +} + +static int +qsort_var_comp (var1, var2) + SHELL_VAR **var1, **var2; +{ + int result; + + if ((result = (*var1)->name[0] - (*var2)->name[0]) == 0) + result = strcmp ((*var1)->name, (*var2)->name); + + return (result); +} + +/* Apply FUNC to each variable in SHELL_VARIABLES, adding each one for + which FUNC succeeds to an array of SHELL_VAR *s. Returns the array. */ +static SHELL_VAR ** +vapply (func) + sh_var_map_func_t *func; +{ + SHELL_VAR **list; + + list = map_over (func, shell_variables); + if (list /* && posixly_correct */) + sort_variables (list); + return (list); +} + +/* Apply FUNC to each variable in SHELL_FUNCTIONS, adding each one for + which FUNC succeeds to an array of SHELL_VAR *s. Returns the array. */ +static SHELL_VAR ** +fapply (func) + sh_var_map_func_t *func; +{ + SHELL_VAR **list; + + list = map_over_funcs (func); + if (list /* && posixly_correct */) + sort_variables (list); + return (list); +} + +/* Create a NULL terminated array of all the shell variables. */ +SHELL_VAR ** +all_shell_variables () +{ + return (vapply ((sh_var_map_func_t *)NULL)); +} + +/* Create a NULL terminated array of all the shell functions. */ +SHELL_VAR ** +all_shell_functions () +{ + return (fapply ((sh_var_map_func_t *)NULL)); +} + +static int +visible_var (var) + SHELL_VAR *var; +{ + return (invisible_p (var) == 0); +} + +SHELL_VAR ** +all_visible_functions () +{ + return (fapply (visible_var)); +} + +SHELL_VAR ** +all_visible_variables () +{ + return (vapply (visible_var)); +} + +/* Return non-zero if the variable VAR is visible and exported. Array + variables cannot be exported. */ +static int +visible_and_exported (var) + SHELL_VAR *var; +{ + return (invisible_p (var) == 0 && exported_p (var)); +} + +/* Candidate variables for the export environment are either valid variables + with the export attribute or invalid variables inherited from the initial + environment and simply passed through. */ +static int +export_environment_candidate (var) + SHELL_VAR *var; +{ + return (exported_p (var) && (invisible_p (var) == 0 || imported_p (var))); +} + +/* Return non-zero if VAR is a local variable in the current context and + is exported. */ +static int +local_and_exported (var) + SHELL_VAR *var; +{ + return (invisible_p (var) == 0 && local_p (var) && var->context == variable_context && exported_p (var)); +} + +SHELL_VAR ** +all_exported_variables () +{ + return (vapply (visible_and_exported)); +} + +SHELL_VAR ** +local_exported_variables () +{ + return (vapply (local_and_exported)); +} + +static int +variable_in_context (var) + SHELL_VAR *var; +{ + return (invisible_p (var) == 0 && local_p (var) && var->context == variable_context); +} + +SHELL_VAR ** +all_local_variables () +{ + VARLIST *vlist; + SHELL_VAR **ret; + VAR_CONTEXT *vc; + + vc = shell_variables; + for (vc = shell_variables; vc; vc = vc->down) + if (vc_isfuncenv (vc) && vc->scope == variable_context) + break; + + if (vc == 0) + { + internal_error (_("all_local_variables: no function context at current scope")); + return (SHELL_VAR **)NULL; + } + if (vc->table == 0 || HASH_ENTRIES (vc->table) == 0 || vc_haslocals (vc) == 0) + return (SHELL_VAR **)NULL; + + vlist = vlist_alloc (HASH_ENTRIES (vc->table)); + + flatten (vc->table, variable_in_context, vlist, 0); + + ret = vlist->list; + free (vlist); + if (ret) + sort_variables (ret); + return ret; +} + +#if defined (ARRAY_VARS) +/* Return non-zero if the variable VAR is visible and an array. */ +static int +visible_array_vars (var) + SHELL_VAR *var; +{ + return (invisible_p (var) == 0 && array_p (var)); +} + +SHELL_VAR ** +all_array_variables () +{ + return (vapply (visible_array_vars)); +} +#endif /* ARRAY_VARS */ + +char ** +all_variables_matching_prefix (prefix) + const char *prefix; +{ + SHELL_VAR **varlist; + char **rlist; + int vind, rind, plen; + + plen = STRLEN (prefix); + varlist = all_visible_variables (); + for (vind = 0; varlist && varlist[vind]; vind++) + ; + if (varlist == 0 || vind == 0) + return ((char **)NULL); + rlist = strvec_create (vind + 1); + for (vind = rind = 0; varlist[vind]; vind++) + { + if (plen == 0 || STREQN (prefix, varlist[vind]->name, plen)) + rlist[rind++] = savestring (varlist[vind]->name); + } + rlist[rind] = (char *)0; + free (varlist); + + return rlist; +} + +/* **************************************************************** */ +/* */ +/* Managing temporary variable scopes */ +/* */ +/* **************************************************************** */ + +/* Make variable NAME have VALUE in the temporary environment. */ +static SHELL_VAR * +bind_tempenv_variable (name, value) + const char *name; + char *value; +{ + SHELL_VAR *var; + + var = temporary_env ? hash_lookup (name, temporary_env) : (SHELL_VAR *)NULL; + + if (var) + { + FREE (value_cell (var)); + var_setvalue (var, savestring (value)); + INVALIDATE_EXPORTSTR (var); + } + + return (var); +} + +/* Find a variable in the temporary environment that is named NAME. + Return the SHELL_VAR *, or NULL if not found. */ +SHELL_VAR * +find_tempenv_variable (name) + const char *name; +{ + return (temporary_env ? hash_lookup (name, temporary_env) : (SHELL_VAR *)NULL); +} + +char **tempvar_list; +int tvlist_ind; + +/* Push the variable described by (SHELL_VAR *)DATA down to the next + variable context from the temporary environment. */ +static void +push_temp_var (data) + PTR_T data; +{ + SHELL_VAR *var, *v; + HASH_TABLE *binding_table; + + var = (SHELL_VAR *)data; + + binding_table = shell_variables->table; + if (binding_table == 0) + { + if (shell_variables == global_variables) + /* shouldn't happen */ + binding_table = shell_variables->table = global_variables->table = hash_create (0); + else + binding_table = shell_variables->table = hash_create (TEMPENV_HASH_BUCKETS); + } + + v = bind_variable_internal (var->name, value_cell (var), binding_table, 0, 0); + + /* XXX - should we set the context here? It shouldn't matter because of how + assign_in_env works, but might want to check. */ + if (binding_table == global_variables->table) /* XXX */ + var->attributes &= ~(att_tempvar|att_propagate); + else + { + var->attributes |= att_propagate; + if (binding_table == shell_variables->table) + shell_variables->flags |= VC_HASTMPVAR; + } + v->attributes |= var->attributes; + + if (find_special_var (var->name) >= 0) + tempvar_list[tvlist_ind++] = savestring (var->name); + + dispose_variable (var); +} + +static void +propagate_temp_var (data) + PTR_T data; +{ + SHELL_VAR *var; + + var = (SHELL_VAR *)data; + if (tempvar_p (var) && (var->attributes & att_propagate)) + push_temp_var (data); + else + { + if (find_special_var (var->name) >= 0) + tempvar_list[tvlist_ind++] = savestring (var->name); + dispose_variable (var); + } +} + +/* Free the storage used in the hash table for temporary + environment variables. PUSHF is a function to be called + to free each hash table entry. It takes care of pushing variables + to previous scopes if appropriate. PUSHF stores names of variables + that require special handling (e.g., IFS) on tempvar_list, so this + function can call stupidly_hack_special_variables on all the + variables in the list when the temporary hash table is destroyed. */ +static void +dispose_temporary_env (pushf) + sh_free_func_t *pushf; +{ + int i; + + tempvar_list = strvec_create (HASH_ENTRIES (temporary_env) + 1); + tempvar_list[tvlist_ind = 0] = 0; + + hash_flush (temporary_env, pushf); + hash_dispose (temporary_env); + temporary_env = (HASH_TABLE *)NULL; + + tempvar_list[tvlist_ind] = 0; + + array_needs_making = 1; + +#if 0 + sv_ifs ("IFS"); /* XXX here for now -- check setifs in assign_in_env */ +#endif + for (i = 0; i < tvlist_ind; i++) + stupidly_hack_special_variables (tempvar_list[i]); + + strvec_dispose (tempvar_list); + tempvar_list = 0; + tvlist_ind = 0; +} + +void +dispose_used_env_vars () +{ + if (temporary_env) + { + dispose_temporary_env (propagate_temp_var); + maybe_make_export_env (); + } +} + +/* Take all of the shell variables in the temporary environment HASH_TABLE + and make shell variables from them at the current variable context. */ +void +merge_temporary_env () +{ + if (temporary_env) + dispose_temporary_env (push_temp_var); +} + +/* **************************************************************** */ +/* */ +/* Creating and manipulating the environment */ +/* */ +/* **************************************************************** */ + +static inline char * +mk_env_string (name, value) + const char *name, *value; +{ + int name_len, value_len; + char *p; + + name_len = strlen (name); + value_len = STRLEN (value); + p = (char *)xmalloc (2 + name_len + value_len); + strcpy (p, name); + p[name_len] = '='; + if (value && *value) + strcpy (p + name_len + 1, value); + else + p[name_len + 1] = '\0'; + return (p); +} + +#ifdef DEBUG +/* Debugging */ +static int +valid_exportstr (v) + SHELL_VAR *v; +{ + char *s; + + s = v->exportstr; + if (s == 0) + { + internal_error (_("%s has null exportstr"), v->name); + return (0); + } + if (legal_variable_starter ((unsigned char)*s) == 0) + { + internal_error (_("invalid character %d in exportstr for %s"), *s, v->name); + return (0); + } + for (s = v->exportstr + 1; s && *s; s++) + { + if (*s == '=') + break; + if (legal_variable_char ((unsigned char)*s) == 0) + { + internal_error (_("invalid character %d in exportstr for %s"), *s, v->name); + return (0); + } + } + if (*s != '=') + { + internal_error (_("no `=' in exportstr for %s"), v->name); + return (0); + } + return (1); +} +#endif + +static char ** +make_env_array_from_var_list (vars) + SHELL_VAR **vars; +{ + register int i, list_index; + register SHELL_VAR *var; + char **list, *value; + + list = strvec_create ((1 + strvec_len ((char **)vars))); + +#define USE_EXPORTSTR (value == var->exportstr) + + for (i = 0, list_index = 0; var = vars[i]; i++) + { +#if defined (__CYGWIN__) + /* We don't use the exportstr stuff on Cygwin at all. */ + INVALIDATE_EXPORTSTR (var); +#endif + if (var->exportstr) + value = var->exportstr; + else if (function_p (var)) + value = named_function_string ((char *)NULL, function_cell (var), 0); +#if defined (ARRAY_VARS) + else if (array_p (var)) +# if ARRAY_EXPORT + value = array_to_assignment_string (array_cell (var)); +# else + continue; /* XXX array vars cannot yet be exported */ +# endif /* ARRAY_EXPORT */ + else if (assoc_p (var)) +# if 0 + value = assoc_to_assignment_string (assoc_cell (var)); +# else + continue; /* XXX associative array vars cannot yet be exported */ +# endif +#endif + else + value = value_cell (var); + + if (value) + { + /* Gee, I'd like to get away with not using savestring() if we're + using the cached exportstr... */ + list[list_index] = USE_EXPORTSTR ? savestring (value) + : mk_env_string (var->name, value); + + if (USE_EXPORTSTR == 0) + SAVE_EXPORTSTR (var, list[list_index]); + + list_index++; +#undef USE_EXPORTSTR + +#if 0 /* not yet */ +#if defined (ARRAY_VARS) + if (array_p (var) || assoc_p (var)) + free (value); +#endif +#endif + } + } + + list[list_index] = (char *)NULL; + return (list); +} + +/* Make an array of assignment statements from the hash table + HASHED_VARS which contains SHELL_VARs. Only visible, exported + variables are eligible. */ +static char ** +make_var_export_array (vcxt) + VAR_CONTEXT *vcxt; +{ + char **list; + SHELL_VAR **vars; + +#if 0 + vars = map_over (visible_and_exported, vcxt); +#else + vars = map_over (export_environment_candidate, vcxt); +#endif + + if (vars == 0) + return (char **)NULL; + + list = make_env_array_from_var_list (vars); + + free (vars); + return (list); +} + +static char ** +make_func_export_array () +{ + char **list; + SHELL_VAR **vars; + + vars = map_over_funcs (visible_and_exported); + if (vars == 0) + return (char **)NULL; + + list = make_env_array_from_var_list (vars); + + free (vars); + return (list); +} + +/* Add ENVSTR to the end of the exported environment, EXPORT_ENV. */ +#define add_to_export_env(envstr,do_alloc) \ +do \ + { \ + if (export_env_index >= (export_env_size - 1)) \ + { \ + export_env_size += 16; \ + export_env = strvec_resize (export_env, export_env_size); \ + environ = export_env; \ + } \ + export_env[export_env_index++] = (do_alloc) ? savestring (envstr) : envstr; \ + export_env[export_env_index] = (char *)NULL; \ + } while (0) + +/* Add ASSIGN to EXPORT_ENV, or supercede a previous assignment in the + array with the same left-hand side. Return the new EXPORT_ENV. */ +char ** +add_or_supercede_exported_var (assign, do_alloc) + char *assign; + int do_alloc; +{ + register int i; + int equal_offset; + + equal_offset = assignment (assign, 0); + if (equal_offset == 0) + return (export_env); + + /* If this is a function, then only supersede the function definition. + We do this by including the `=() {' in the comparison, like + initialize_shell_variables does. */ + if (assign[equal_offset + 1] == '(' && + strncmp (assign + equal_offset + 2, ") {", 3) == 0) /* } */ + equal_offset += 4; + + for (i = 0; i < export_env_index; i++) + { + if (STREQN (assign, export_env[i], equal_offset + 1)) + { + free (export_env[i]); + export_env[i] = do_alloc ? savestring (assign) : assign; + return (export_env); + } + } + add_to_export_env (assign, do_alloc); + return (export_env); +} + +static void +add_temp_array_to_env (temp_array, do_alloc, do_supercede) + char **temp_array; + int do_alloc, do_supercede; +{ + register int i; + + if (temp_array == 0) + return; + + for (i = 0; temp_array[i]; i++) + { + if (do_supercede) + export_env = add_or_supercede_exported_var (temp_array[i], do_alloc); + else + add_to_export_env (temp_array[i], do_alloc); + } + + free (temp_array); +} + +/* Make the environment array for the command about to be executed, if the + array needs making. Otherwise, do nothing. If a shell action could + change the array that commands receive for their environment, then the + code should `array_needs_making++'. + + The order to add to the array is: + temporary_env + list of var contexts whose head is shell_variables + shell_functions + + This is the shell variable lookup order. We add only new variable + names at each step, which allows local variables and variables in + the temporary environments to shadow variables in the global (or + any previous) scope. +*/ + +static int +n_shell_variables () +{ + VAR_CONTEXT *vc; + int n; + + for (n = 0, vc = shell_variables; vc; vc = vc->down) + n += HASH_ENTRIES (vc->table); + return n; +} + +int +chkexport (name) + char *name; +{ + SHELL_VAR *v; + + v = find_variable (name); + if (v && exported_p (v)) + { + array_needs_making = 1; + maybe_make_export_env (); + return 1; + } + return 0; +} + +void +maybe_make_export_env () +{ + register char **temp_array; + int new_size; + VAR_CONTEXT *tcxt; + + if (array_needs_making) + { + if (export_env) + strvec_flush (export_env); + + /* Make a guess based on how many shell variables and functions we + have. Since there will always be array variables, and array + variables are not (yet) exported, this will always be big enough + for the exported variables and functions. */ + new_size = n_shell_variables () + HASH_ENTRIES (shell_functions) + 1 + + HASH_ENTRIES (temporary_env); + if (new_size > export_env_size) + { + export_env_size = new_size; + export_env = strvec_resize (export_env, export_env_size); + environ = export_env; + } + export_env[export_env_index = 0] = (char *)NULL; + + /* Make a dummy variable context from the temporary_env, stick it on + the front of shell_variables, call make_var_export_array on the + whole thing to flatten it, and convert the list of SHELL_VAR *s + to the form needed by the environment. */ + if (temporary_env) + { + tcxt = new_var_context ((char *)NULL, 0); + tcxt->table = temporary_env; + tcxt->down = shell_variables; + } + else + tcxt = shell_variables; + + temp_array = make_var_export_array (tcxt); + if (temp_array) + add_temp_array_to_env (temp_array, 0, 0); + + if (tcxt != shell_variables) + free (tcxt); + +#if defined (RESTRICTED_SHELL) + /* Restricted shells may not export shell functions. */ + temp_array = restricted ? (char **)0 : make_func_export_array (); +#else + temp_array = make_func_export_array (); +#endif + if (temp_array) + add_temp_array_to_env (temp_array, 0, 0); + + array_needs_making = 0; + } +} + +/* This is an efficiency hack. PWD and OLDPWD are auto-exported, so + we will need to remake the exported environment every time we + change directories. `_' is always put into the environment for + every external command, so without special treatment it will always + cause the environment to be remade. + + If there is no other reason to make the exported environment, we can + just update the variables in place and mark the exported environment + as no longer needing a remake. */ +void +update_export_env_inplace (env_prefix, preflen, value) + char *env_prefix; + int preflen; + char *value; +{ + char *evar; + + evar = (char *)xmalloc (STRLEN (value) + preflen + 1); + strcpy (evar, env_prefix); + if (value) + strcpy (evar + preflen, value); + export_env = add_or_supercede_exported_var (evar, 0); +} + +/* We always put _ in the environment as the name of this command. */ +void +put_command_name_into_env (command_name) + char *command_name; +{ + update_export_env_inplace ("_=", 2, command_name); +} + +/* **************************************************************** */ +/* */ +/* Managing variable contexts */ +/* */ +/* **************************************************************** */ + +/* Allocate and return a new variable context with NAME and FLAGS. + NAME can be NULL. */ + +VAR_CONTEXT * +new_var_context (name, flags) + char *name; + int flags; +{ + VAR_CONTEXT *vc; + + vc = (VAR_CONTEXT *)xmalloc (sizeof (VAR_CONTEXT)); + vc->name = name ? savestring (name) : (char *)NULL; + vc->scope = variable_context; + vc->flags = flags; + + vc->up = vc->down = (VAR_CONTEXT *)NULL; + vc->table = (HASH_TABLE *)NULL; + + return vc; +} + +/* Free a variable context and its data, including the hash table. Dispose + all of the variables. */ +void +dispose_var_context (vc) + VAR_CONTEXT *vc; +{ + FREE (vc->name); + + if (vc->table) + { + delete_all_variables (vc->table); + hash_dispose (vc->table); + } + + free (vc); +} + +/* Set VAR's scope level to the current variable context. */ +static int +set_context (var) + SHELL_VAR *var; +{ + return (var->context = variable_context); +} + +/* Make a new variable context with NAME and FLAGS and a HASH_TABLE of + temporary variables, and push it onto shell_variables. This is + for shell functions. */ +VAR_CONTEXT * +push_var_context (name, flags, tempvars) + char *name; + int flags; + HASH_TABLE *tempvars; +{ + VAR_CONTEXT *vc; + + vc = new_var_context (name, flags); + vc->table = tempvars; + if (tempvars) + { + /* Have to do this because the temp environment was created before + variable_context was incremented. */ + flatten (tempvars, set_context, (VARLIST *)NULL, 0); + vc->flags |= VC_HASTMPVAR; + } + vc->down = shell_variables; + shell_variables->up = vc; + + return (shell_variables = vc); +} + +static void +push_func_var (data) + PTR_T data; +{ + SHELL_VAR *var, *v; + + var = (SHELL_VAR *)data; + + if (tempvar_p (var) && (posixly_correct || (var->attributes & att_propagate))) + { + /* Make sure we have a hash table to store the variable in while it is + being propagated down to the global variables table. Create one if + we have to */ + if ((vc_isfuncenv (shell_variables) || vc_istempenv (shell_variables)) && shell_variables->table == 0) + shell_variables->table = hash_create (0); + /* XXX - should we set v->context here? */ + v = bind_variable_internal (var->name, value_cell (var), shell_variables->table, 0, 0); + if (shell_variables == global_variables) + var->attributes &= ~(att_tempvar|att_propagate); + else + shell_variables->flags |= VC_HASTMPVAR; + v->attributes |= var->attributes; + } + else + stupidly_hack_special_variables (var->name); /* XXX */ + + dispose_variable (var); +} + +/* Pop the top context off of VCXT and dispose of it, returning the rest of + the stack. */ +void +pop_var_context () +{ + VAR_CONTEXT *ret, *vcxt; + + vcxt = shell_variables; + if (vc_isfuncenv (vcxt) == 0) + { + internal_error (_("pop_var_context: head of shell_variables not a function context")); + return; + } + + if (ret = vcxt->down) + { + ret->up = (VAR_CONTEXT *)NULL; + shell_variables = ret; + if (vcxt->table) + hash_flush (vcxt->table, push_func_var); + dispose_var_context (vcxt); + } + else + internal_error (_("pop_var_context: no global_variables context")); +} + +/* Delete the HASH_TABLEs for all variable contexts beginning at VCXT, and + all of the VAR_CONTEXTs except GLOBAL_VARIABLES. */ +void +delete_all_contexts (vcxt) + VAR_CONTEXT *vcxt; +{ + VAR_CONTEXT *v, *t; + + for (v = vcxt; v != global_variables; v = t) + { + t = v->down; + dispose_var_context (v); + } + + delete_all_variables (global_variables->table); + shell_variables = global_variables; +} + +/* **************************************************************** */ +/* */ +/* Pushing and Popping temporary variable scopes */ +/* */ +/* **************************************************************** */ + +VAR_CONTEXT * +push_scope (flags, tmpvars) + int flags; + HASH_TABLE *tmpvars; +{ + return (push_var_context ((char *)NULL, flags, tmpvars)); +} + +static void +push_exported_var (data) + PTR_T data; +{ + SHELL_VAR *var, *v; + + var = (SHELL_VAR *)data; + + /* If a temp var had its export attribute set, or it's marked to be + propagated, bind it in the previous scope before disposing it. */ + /* XXX - This isn't exactly right, because all tempenv variables have the + export attribute set. */ +#if 0 + if (exported_p (var) || (var->attributes & att_propagate)) +#else + if (tempvar_p (var) && exported_p (var) && (var->attributes & att_propagate)) +#endif + { + var->attributes &= ~att_tempvar; /* XXX */ + v = bind_variable_internal (var->name, value_cell (var), shell_variables->table, 0, 0); + if (shell_variables == global_variables) + var->attributes &= ~att_propagate; + v->attributes |= var->attributes; + } + else + stupidly_hack_special_variables (var->name); /* XXX */ + + dispose_variable (var); +} + +void +pop_scope (is_special) + int is_special; +{ + VAR_CONTEXT *vcxt, *ret; + + vcxt = shell_variables; + if (vc_istempscope (vcxt) == 0) + { + internal_error (_("pop_scope: head of shell_variables not a temporary environment scope")); + return; + } + + ret = vcxt->down; + if (ret) + ret->up = (VAR_CONTEXT *)NULL; + + shell_variables = ret; + + /* Now we can take care of merging variables in VCXT into set of scopes + whose head is RET (shell_variables). */ + FREE (vcxt->name); + if (vcxt->table) + { + if (is_special) + hash_flush (vcxt->table, push_func_var); + else + hash_flush (vcxt->table, push_exported_var); + hash_dispose (vcxt->table); + } + free (vcxt); + + sv_ifs ("IFS"); /* XXX here for now */ +} + +/* **************************************************************** */ +/* */ +/* Pushing and Popping function contexts */ +/* */ +/* **************************************************************** */ + +static WORD_LIST **dollar_arg_stack = (WORD_LIST **)NULL; +static int dollar_arg_stack_slots; +static int dollar_arg_stack_index; + +/* XXX - we might want to consider pushing and popping the `getopts' state + when we modify the positional parameters. */ +void +push_context (name, is_subshell, tempvars) + char *name; /* function name */ + int is_subshell; + HASH_TABLE *tempvars; +{ + if (is_subshell == 0) + push_dollar_vars (); + variable_context++; + push_var_context (name, VC_FUNCENV, tempvars); +} + +/* Only called when subshell == 0, so we don't need to check, and can + unconditionally pop the dollar vars off the stack. */ +void +pop_context () +{ + pop_dollar_vars (); + variable_context--; + pop_var_context (); + + sv_ifs ("IFS"); /* XXX here for now */ +} + +/* Save the existing positional parameters on a stack. */ +void +push_dollar_vars () +{ + if (dollar_arg_stack_index + 2 > dollar_arg_stack_slots) + { + dollar_arg_stack = (WORD_LIST **) + xrealloc (dollar_arg_stack, (dollar_arg_stack_slots += 10) + * sizeof (WORD_LIST *)); + } + dollar_arg_stack[dollar_arg_stack_index++] = list_rest_of_args (); + dollar_arg_stack[dollar_arg_stack_index] = (WORD_LIST *)NULL; +} + +/* Restore the positional parameters from our stack. */ +void +pop_dollar_vars () +{ + if (!dollar_arg_stack || dollar_arg_stack_index == 0) + return; + + remember_args (dollar_arg_stack[--dollar_arg_stack_index], 1); + dispose_words (dollar_arg_stack[dollar_arg_stack_index]); + dollar_arg_stack[dollar_arg_stack_index] = (WORD_LIST *)NULL; + set_dollar_vars_unchanged (); +} + +void +dispose_saved_dollar_vars () +{ + if (!dollar_arg_stack || dollar_arg_stack_index == 0) + return; + + dispose_words (dollar_arg_stack[dollar_arg_stack_index]); + dollar_arg_stack[dollar_arg_stack_index] = (WORD_LIST *)NULL; +} + +/* Manipulate the special BASH_ARGV and BASH_ARGC variables. */ + +void +push_args (list) + WORD_LIST *list; +{ +#if defined (ARRAY_VARS) && defined (DEBUGGER) + SHELL_VAR *bash_argv_v, *bash_argc_v; + ARRAY *bash_argv_a, *bash_argc_a; + WORD_LIST *l; + arrayind_t i; + char *t; + + GET_ARRAY_FROM_VAR ("BASH_ARGV", bash_argv_v, bash_argv_a); + GET_ARRAY_FROM_VAR ("BASH_ARGC", bash_argc_v, bash_argc_a); + + for (l = list, i = 0; l; l = l->next, i++) + array_push (bash_argv_a, l->word->word); + + t = itos (i); + array_push (bash_argc_a, t); + free (t); +#endif /* ARRAY_VARS && DEBUGGER */ +} + +/* Remove arguments from BASH_ARGV array. Pop top element off BASH_ARGC + array and use that value as the count of elements to remove from + BASH_ARGV. */ +void +pop_args () +{ +#if defined (ARRAY_VARS) && defined (DEBUGGER) + SHELL_VAR *bash_argv_v, *bash_argc_v; + ARRAY *bash_argv_a, *bash_argc_a; + ARRAY_ELEMENT *ce; + intmax_t i; + + GET_ARRAY_FROM_VAR ("BASH_ARGV", bash_argv_v, bash_argv_a); + GET_ARRAY_FROM_VAR ("BASH_ARGC", bash_argc_v, bash_argc_a); + + ce = array_shift (bash_argc_a, 1, 0); + if (ce == 0 || legal_number (element_value (ce), &i) == 0) + i = 0; + + for ( ; i > 0; i--) + array_pop (bash_argv_a); + array_dispose_element (ce); +#endif /* ARRAY_VARS && DEBUGGER */ +} + +/************************************************* + * * + * Functions to manage special variables * + * * + *************************************************/ + +/* Extern declarations for variables this code has to manage. */ +extern int eof_encountered, eof_encountered_limit, ignoreeof; + +#if defined (READLINE) +extern int hostname_list_initialized; +#endif + +/* An alist of name.function for each special variable. Most of the + functions don't do much, and in fact, this would be faster with a + switch statement, but by the end of this file, I am sick of switch + statements. */ + +#define SET_INT_VAR(name, intvar) intvar = find_variable (name) != 0 + +/* This table will be sorted with qsort() the first time it's accessed. */ +struct name_and_function { + char *name; + sh_sv_func_t *function; +}; + +static struct name_and_function special_vars[] = { + { "BASH_COMPAT", sv_shcompat }, + { "BASH_XTRACEFD", sv_xtracefd }, + +#if defined (JOB_CONTROL) + { "CHILD_MAX", sv_childmax }, +#endif + +#if defined (READLINE) +# if defined (STRICT_POSIX) + { "COLUMNS", sv_winsize }, +# endif + { "COMP_WORDBREAKS", sv_comp_wordbreaks }, +#endif + + { "FUNCNEST", sv_funcnest }, + + { "GLOBIGNORE", sv_globignore }, + +#if defined (HISTORY) + { "HISTCONTROL", sv_history_control }, + { "HISTFILESIZE", sv_histsize }, + { "HISTIGNORE", sv_histignore }, + { "HISTSIZE", sv_histsize }, + { "HISTTIMEFORMAT", sv_histtimefmt }, +#endif + +#if defined (__CYGWIN__) + { "HOME", sv_home }, +#endif + +#if defined (READLINE) + { "HOSTFILE", sv_hostfile }, +#endif + + { "IFS", sv_ifs }, + { "IGNOREEOF", sv_ignoreeof }, + + { "LANG", sv_locale }, + { "LC_ALL", sv_locale }, + { "LC_COLLATE", sv_locale }, + { "LC_CTYPE", sv_locale }, + { "LC_MESSAGES", sv_locale }, + { "LC_NUMERIC", sv_locale }, + { "LC_TIME", sv_locale }, + +#if defined (READLINE) && defined (STRICT_POSIX) + { "LINES", sv_winsize }, +#endif + + { "MAIL", sv_mail }, + { "MAILCHECK", sv_mail }, + { "MAILPATH", sv_mail }, + + { "OPTERR", sv_opterr }, + { "OPTIND", sv_optind }, + + { "PATH", sv_path }, + { "POSIXLY_CORRECT", sv_strict_posix }, + +#if defined (READLINE) + { "TERM", sv_terminal }, + { "TERMCAP", sv_terminal }, + { "TERMINFO", sv_terminal }, +#endif /* READLINE */ + + { "TEXTDOMAIN", sv_locale }, + { "TEXTDOMAINDIR", sv_locale }, + +#if defined (HAVE_TZSET) + { "TZ", sv_tz }, +#endif + +#if defined (HISTORY) && defined (BANG_HISTORY) + { "histchars", sv_histchars }, +#endif /* HISTORY && BANG_HISTORY */ + + { "ignoreeof", sv_ignoreeof }, + + { (char *)0, (sh_sv_func_t *)0 } +}; + +#define N_SPECIAL_VARS (sizeof (special_vars) / sizeof (special_vars[0]) - 1) + +static int +sv_compare (sv1, sv2) + struct name_and_function *sv1, *sv2; +{ + int r; + + if ((r = sv1->name[0] - sv2->name[0]) == 0) + r = strcmp (sv1->name, sv2->name); + return r; +} + +static inline int +find_special_var (name) + const char *name; +{ + register int i, r; + + for (i = 0; special_vars[i].name; i++) + { + r = special_vars[i].name[0] - name[0]; + if (r == 0) + r = strcmp (special_vars[i].name, name); + if (r == 0) + return i; + else if (r > 0) + /* Can't match any of rest of elements in sorted list. Take this out + if it causes problems in certain environments. */ + break; + } + return -1; +} + +/* The variable in NAME has just had its state changed. Check to see if it + is one of the special ones where something special happens. */ +void +stupidly_hack_special_variables (name) + char *name; +{ + static int sv_sorted = 0; + int i; + + if (sv_sorted == 0) /* shouldn't need, but it's fairly cheap. */ + { + qsort (special_vars, N_SPECIAL_VARS, sizeof (special_vars[0]), + (QSFUNC *)sv_compare); + sv_sorted = 1; + } + + i = find_special_var (name); + if (i != -1) + (*(special_vars[i].function)) (name); +} + +/* Special variables that need hooks to be run when they are unset as part + of shell reinitialization should have their sv_ functions run here. */ +void +reinit_special_variables () +{ +#if defined (READLINE) + sv_comp_wordbreaks ("COMP_WORDBREAKS"); +#endif + sv_globignore ("GLOBIGNORE"); + sv_opterr ("OPTERR"); +} + +void +sv_ifs (name) + char *name; +{ + SHELL_VAR *v; + + v = find_variable ("IFS"); + setifs (v); +} + +/* What to do just after the PATH variable has changed. */ +void +sv_path (name) + char *name; +{ + /* hash -r */ + phash_flush (); +} + +/* What to do just after one of the MAILxxxx variables has changed. NAME + is the name of the variable. This is called with NAME set to one of + MAIL, MAILCHECK, or MAILPATH. */ +void +sv_mail (name) + char *name; +{ + /* If the time interval for checking the files has changed, then + reset the mail timer. Otherwise, one of the pathname vars + to the users mailbox has changed, so rebuild the array of + filenames. */ + if (name[4] == 'C') /* if (strcmp (name, "MAILCHECK") == 0) */ + reset_mail_timer (); + else + { + free_mail_files (); + remember_mail_dates (); + } +} + +void +sv_funcnest (name) + char *name; +{ + SHELL_VAR *v; + intmax_t num; + + v = find_variable (name); + if (v == 0) + funcnest_max = 0; + else if (legal_number (value_cell (v), &num) == 0) + funcnest_max = 0; + else + funcnest_max = num; +} + +/* What to do when GLOBIGNORE changes. */ +void +sv_globignore (name) + char *name; +{ + if (privileged_mode == 0) + setup_glob_ignore (name); +} + +#if defined (READLINE) +void +sv_comp_wordbreaks (name) + char *name; +{ + SHELL_VAR *sv; + + sv = find_variable (name); + if (sv == 0) + reset_completer_word_break_chars (); +} + +/* What to do just after one of the TERMxxx variables has changed. + If we are an interactive shell, then try to reset the terminal + information in readline. */ +void +sv_terminal (name) + char *name; +{ + if (interactive_shell && no_line_editing == 0) + rl_reset_terminal (get_string_value ("TERM")); +} + +void +sv_hostfile (name) + char *name; +{ + SHELL_VAR *v; + + v = find_variable (name); + if (v == 0) + clear_hostname_list (); + else + hostname_list_initialized = 0; +} + +#if defined (STRICT_POSIX) +/* In strict posix mode, we allow assignments to LINES and COLUMNS (and values + found in the initial environment) to override the terminal size reported by + the kernel. */ +void +sv_winsize (name) + char *name; +{ + SHELL_VAR *v; + intmax_t xd; + int d; + + if (posixly_correct == 0 || interactive_shell == 0 || no_line_editing) + return; + + v = find_variable (name); + if (v == 0 || var_isnull (v)) + rl_reset_screen_size (); + else + { + if (legal_number (value_cell (v), &xd) == 0) + return; + winsize_assignment = 1; + d = xd; /* truncate */ + if (name[0] == 'L') /* LINES */ + rl_set_screen_size (d, -1); + else /* COLUMNS */ + rl_set_screen_size (-1, d); + winsize_assignment = 0; + } +} +#endif /* STRICT_POSIX */ +#endif /* READLINE */ + +/* Update the value of HOME in the export environment so tilde expansion will + work on cygwin. */ +#if defined (__CYGWIN__) +sv_home (name) + char *name; +{ + array_needs_making = 1; + maybe_make_export_env (); +} +#endif + +#if defined (HISTORY) +/* What to do after the HISTSIZE or HISTFILESIZE variables change. + If there is a value for this HISTSIZE (and it is numeric), then stifle + the history. Otherwise, if there is NO value for this variable, + unstifle the history. If name is HISTFILESIZE, and its value is + numeric, truncate the history file to hold no more than that many + lines. */ +void +sv_histsize (name) + char *name; +{ + char *temp; + intmax_t num; + int hmax; + + temp = get_string_value (name); + + if (temp && *temp) + { + if (legal_number (temp, &num)) + { + hmax = num; + if (hmax < 0 && name[4] == 'S') + unstifle_history (); /* unstifle history if HISTSIZE < 0 */ + else if (name[4] == 'S') + { + stifle_history (hmax); + hmax = where_history (); + if (history_lines_this_session > hmax) + history_lines_this_session = hmax; + } + else if (hmax >= 0) /* truncate HISTFILE if HISTFILESIZE >= 0 */ + { + history_truncate_file (get_string_value ("HISTFILE"), hmax); + if (hmax <= history_lines_in_file) + history_lines_in_file = hmax; + } + } + } + else if (name[4] == 'S') + unstifle_history (); +} + +/* What to do after the HISTIGNORE variable changes. */ +void +sv_histignore (name) + char *name; +{ + setup_history_ignore (name); +} + +/* What to do after the HISTCONTROL variable changes. */ +void +sv_history_control (name) + char *name; +{ + char *temp; + char *val; + int tptr; + + history_control = 0; + temp = get_string_value (name); + + if (temp == 0 || *temp == 0) + return; + + tptr = 0; + while (val = extract_colon_unit (temp, &tptr)) + { + if (STREQ (val, "ignorespace")) + history_control |= HC_IGNSPACE; + else if (STREQ (val, "ignoredups")) + history_control |= HC_IGNDUPS; + else if (STREQ (val, "ignoreboth")) + history_control |= HC_IGNBOTH; + else if (STREQ (val, "erasedups")) + history_control |= HC_ERASEDUPS; + + free (val); + } +} + +#if defined (BANG_HISTORY) +/* Setting/unsetting of the history expansion character. */ +void +sv_histchars (name) + char *name; +{ + char *temp; + + temp = get_string_value (name); + if (temp) + { + history_expansion_char = *temp; + if (temp[0] && temp[1]) + { + history_subst_char = temp[1]; + if (temp[2]) + history_comment_char = temp[2]; + } + } + else + { + history_expansion_char = '!'; + history_subst_char = '^'; + history_comment_char = '#'; + } +} +#endif /* BANG_HISTORY */ + +void +sv_histtimefmt (name) + char *name; +{ + SHELL_VAR *v; + + if (v = find_variable (name)) + { + if (history_comment_char == 0) + history_comment_char = '#'; + } + history_write_timestamps = (v != 0); +} +#endif /* HISTORY */ + +#if defined (HAVE_TZSET) +void +sv_tz (name) + char *name; +{ + if (chkexport (name)) + tzset (); +} +#endif + +/* If the variable exists, then the value of it can be the number + of times we actually ignore the EOF. The default is small, + (smaller than csh, anyway). */ +void +sv_ignoreeof (name) + char *name; +{ + SHELL_VAR *tmp_var; + char *temp; + + eof_encountered = 0; + + tmp_var = find_variable (name); + ignoreeof = tmp_var != 0; + temp = tmp_var ? value_cell (tmp_var) : (char *)NULL; + if (temp) + eof_encountered_limit = (*temp && all_digits (temp)) ? atoi (temp) : 10; + set_shellopts (); /* make sure `ignoreeof' is/is not in $SHELLOPTS */ +} + +void +sv_optind (name) + char *name; +{ + char *tt; + int s; + + tt = get_string_value ("OPTIND"); + if (tt && *tt) + { + s = atoi (tt); + + /* According to POSIX, setting OPTIND=1 resets the internal state + of getopt (). */ + if (s < 0 || s == 1) + s = 0; + } + else + s = 0; + getopts_reset (s); +} + +void +sv_opterr (name) + char *name; +{ + char *tt; + + tt = get_string_value ("OPTERR"); + sh_opterr = (tt && *tt) ? atoi (tt) : 1; +} + +void +sv_strict_posix (name) + char *name; +{ + SET_INT_VAR (name, posixly_correct); + posix_initialize (posixly_correct); +#if defined (READLINE) + if (interactive_shell) + posix_readline_initialize (posixly_correct); +#endif /* READLINE */ + set_shellopts (); /* make sure `posix' is/is not in $SHELLOPTS */ +} + +void +sv_locale (name) + char *name; +{ + char *v; + int r; + + v = get_string_value (name); + if (name[0] == 'L' && name[1] == 'A') /* LANG */ + r = set_lang (name, v); + else + r = set_locale_var (name, v); /* LC_*, TEXTDOMAIN* */ + +#if 1 + if (r == 0 && posixly_correct) + last_command_exit_value = 1; +#endif +} + +#if defined (ARRAY_VARS) +void +set_pipestatus_array (ps, nproc) + int *ps; + int nproc; +{ + SHELL_VAR *v; + ARRAY *a; + ARRAY_ELEMENT *ae; + register int i; + char *t, tbuf[INT_STRLEN_BOUND(int) + 1]; + + v = find_variable ("PIPESTATUS"); + if (v == 0) + v = make_new_array_variable ("PIPESTATUS"); + if (array_p (v) == 0) + return; /* Do nothing if not an array variable. */ + a = array_cell (v); + + if (a == 0 || array_num_elements (a) == 0) + { + for (i = 0; i < nproc; i++) /* was ps[i] != -1, not i < nproc */ + { + t = inttostr (ps[i], tbuf, sizeof (tbuf)); + array_insert (a, i, t); + } + return; + } + + /* Fast case */ + if (array_num_elements (a) == nproc && nproc == 1) + { + ae = element_forw (a->head); + free (element_value (ae)); + ae->value = itos (ps[0]); + } + else if (array_num_elements (a) <= nproc) + { + /* modify in array_num_elements members in place, then add */ + ae = a->head; + for (i = 0; i < array_num_elements (a); i++) + { + ae = element_forw (ae); + free (element_value (ae)); + ae->value = itos (ps[i]); + } + /* add any more */ + for ( ; i < nproc; i++) + { + t = inttostr (ps[i], tbuf, sizeof (tbuf)); + array_insert (a, i, t); + } + } + else + { + /* deleting elements. it's faster to rebuild the array. */ + array_flush (a); + for (i = 0; ps[i] != -1; i++) + { + t = inttostr (ps[i], tbuf, sizeof (tbuf)); + array_insert (a, i, t); + } + } +} + +ARRAY * +save_pipestatus_array () +{ + SHELL_VAR *v; + ARRAY *a, *a2; + + v = find_variable ("PIPESTATUS"); + if (v == 0 || array_p (v) == 0 || array_cell (v) == 0) + return ((ARRAY *)NULL); + + a = array_cell (v); + a2 = array_copy (array_cell (v)); + + return a2; +} + +void +restore_pipestatus_array (a) + ARRAY *a; +{ + SHELL_VAR *v; + ARRAY *a2; + + v = find_variable ("PIPESTATUS"); + /* XXX - should we still assign even if existing value is NULL? */ + if (v == 0 || array_p (v) == 0 || array_cell (v) == 0) + return; + + a2 = array_cell (v); + var_setarray (v, a); + + array_dispose (a2); +} +#endif + +void +set_pipestatus_from_exit (s) + int s; +{ +#if defined (ARRAY_VARS) + static int v[2] = { 0, -1 }; + + v[0] = s; + set_pipestatus_array (v, 1); +#endif +} + +void +sv_xtracefd (name) + char *name; +{ + SHELL_VAR *v; + char *t, *e; + int fd; + FILE *fp; + + v = find_variable (name); + if (v == 0) + { + xtrace_reset (); + return; + } + + t = value_cell (v); + if (t == 0 || *t == 0) + xtrace_reset (); + else + { + fd = (int)strtol (t, &e, 10); + if (e != t && *e == '\0' && sh_validfd (fd)) + { + fp = fdopen (fd, "w"); + if (fp == 0) + internal_error (_("%s: %s: cannot open as FILE"), name, value_cell (v)); + else + xtrace_set (fd, fp); + } + else + internal_error (_("%s: %s: invalid value for trace file descriptor"), name, value_cell (v)); + } +} + +#define MIN_COMPAT_LEVEL 31 + +void +sv_shcompat (name) + char *name; +{ + SHELL_VAR *v; + char *val; + int tens, ones, compatval; + + v = find_variable (name); + if (v == 0) + { + shell_compatibility_level = DEFAULT_COMPAT_LEVEL; + set_compatibility_opts (); + return; + } + val = value_cell (v); + if (val == 0 || *val == '\0') + { + shell_compatibility_level = DEFAULT_COMPAT_LEVEL; + set_compatibility_opts (); + return; + } + /* Handle decimal-like compatibility version specifications: 4.2 */ + if (isdigit (val[0]) && val[1] == '.' && isdigit (val[2]) && val[3] == 0) + { + tens = val[0] - '0'; + ones = val[2] - '0'; + compatval = tens*10 + ones; + } + /* Handle integer-like compatibility version specifications: 42 */ + else if (isdigit (val[0]) && isdigit (val[1]) && val[2] == 0) + { + tens = val[0] - '0'; + ones = val[1] - '0'; + compatval = tens*10 + ones; + } + else + { +compat_error: + internal_error (_("%s: %s: compatibility value out of range"), name, val); + shell_compatibility_level = DEFAULT_COMPAT_LEVEL; + set_compatibility_opts (); + return; + } + + if (compatval < MIN_COMPAT_LEVEL || compatval > DEFAULT_COMPAT_LEVEL) + goto compat_error; + + shell_compatibility_level = compatval; + set_compatibility_opts (); +} + +#if defined (JOB_CONTROL) +void +sv_childmax (name) + char *name; +{ + char *tt; + int s; + + tt = get_string_value (name); + s = (tt && *tt) ? atoi (tt) : 0; + set_maxchild (s); +} +#endif diff --git a/.pc/bash43-018.diff/arrayfunc.c b/.pc/bash43-018.diff/arrayfunc.c new file mode 100644 index 0000000..a89e67f --- /dev/null +++ b/.pc/bash43-018.diff/arrayfunc.c @@ -0,0 +1,1146 @@ +/* arrayfunc.c -- High-level array functions used by other parts of the shell. */ + +/* Copyright (C) 2001-2011 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#if defined (ARRAY_VARS) + +#if defined (HAVE_UNISTD_H) +# include +#endif +#include + +#include "bashintl.h" + +#include "shell.h" +#include "pathexp.h" + +#include "shmbutil.h" + +#include "builtins/common.h" + +extern char *this_command_name; +extern int last_command_exit_value; +extern int array_needs_making; + +static SHELL_VAR *bind_array_var_internal __P((SHELL_VAR *, arrayind_t, char *, char *, int)); +static SHELL_VAR *assign_array_element_internal __P((SHELL_VAR *, char *, char *, char *, int, char *, int)); + +static char *quote_assign __P((const char *)); +static void quote_array_assignment_chars __P((WORD_LIST *)); +static char *array_value_internal __P((char *, int, int, int *, arrayind_t *)); + +/* Standard error message to use when encountering an invalid array subscript */ +const char * const bash_badsub_errmsg = N_("bad array subscript"); + +/* **************************************************************** */ +/* */ +/* Functions to manipulate array variables and perform assignments */ +/* */ +/* **************************************************************** */ + +/* Convert a shell variable to an array variable. The original value is + saved as array[0]. */ +SHELL_VAR * +convert_var_to_array (var) + SHELL_VAR *var; +{ + char *oldval; + ARRAY *array; + + oldval = value_cell (var); + array = array_create (); + if (oldval) + array_insert (array, 0, oldval); + + FREE (value_cell (var)); + var_setarray (var, array); + + /* these aren't valid anymore */ + var->dynamic_value = (sh_var_value_func_t *)NULL; + var->assign_func = (sh_var_assign_func_t *)NULL; + + INVALIDATE_EXPORTSTR (var); + if (exported_p (var)) + array_needs_making++; + + VSETATTR (var, att_array); + VUNSETATTR (var, att_invisible); + + return var; +} + +/* Convert a shell variable to an array variable. The original value is + saved as array[0]. */ +SHELL_VAR * +convert_var_to_assoc (var) + SHELL_VAR *var; +{ + char *oldval; + HASH_TABLE *hash; + + oldval = value_cell (var); + hash = assoc_create (0); + if (oldval) + assoc_insert (hash, savestring ("0"), oldval); + + FREE (value_cell (var)); + var_setassoc (var, hash); + + /* these aren't valid anymore */ + var->dynamic_value = (sh_var_value_func_t *)NULL; + var->assign_func = (sh_var_assign_func_t *)NULL; + + INVALIDATE_EXPORTSTR (var); + if (exported_p (var)) + array_needs_making++; + + VSETATTR (var, att_assoc); + VUNSETATTR (var, att_invisible); + + return var; +} + +char * +make_array_variable_value (entry, ind, key, value, flags) + SHELL_VAR *entry; + arrayind_t ind; + char *key; + char *value; + int flags; +{ + SHELL_VAR *dentry; + char *newval; + + /* If we're appending, we need the old value of the array reference, so + fake out make_variable_value with a dummy SHELL_VAR */ + if (flags & ASS_APPEND) + { + dentry = (SHELL_VAR *)xmalloc (sizeof (SHELL_VAR)); + dentry->name = savestring (entry->name); + if (assoc_p (entry)) + newval = assoc_reference (assoc_cell (entry), key); + else + newval = array_reference (array_cell (entry), ind); + if (newval) + dentry->value = savestring (newval); + else + { + dentry->value = (char *)xmalloc (1); + dentry->value[0] = '\0'; + } + dentry->exportstr = 0; + dentry->attributes = entry->attributes & ~(att_array|att_assoc|att_exported); + /* Leave the rest of the members uninitialized; the code doesn't look + at them. */ + newval = make_variable_value (dentry, value, flags); + dispose_variable (dentry); + } + else + newval = make_variable_value (entry, value, flags); + + return newval; +} + +static SHELL_VAR * +bind_array_var_internal (entry, ind, key, value, flags) + SHELL_VAR *entry; + arrayind_t ind; + char *key; + char *value; + int flags; +{ + char *newval; + + newval = make_array_variable_value (entry, ind, key, value, flags); + + if (entry->assign_func) + (*entry->assign_func) (entry, newval, ind, key); + else if (assoc_p (entry)) + assoc_insert (assoc_cell (entry), key, newval); + else + array_insert (array_cell (entry), ind, newval); + FREE (newval); + + return (entry); +} + +/* Perform an array assignment name[ind]=value. If NAME already exists and + is not an array, and IND is 0, perform name=value instead. If NAME exists + and is not an array, and IND is not 0, convert it into an array with the + existing value as name[0]. + + If NAME does not exist, just create an array variable, no matter what + IND's value may be. */ +SHELL_VAR * +bind_array_variable (name, ind, value, flags) + char *name; + arrayind_t ind; + char *value; + int flags; +{ + SHELL_VAR *entry; + + entry = find_shell_variable (name); + + if (entry == (SHELL_VAR *) 0) + entry = make_new_array_variable (name); + else if (readonly_p (entry) || noassign_p (entry)) + { + if (readonly_p (entry)) + err_readonly (name); + return (entry); + } + else if (array_p (entry) == 0) + entry = convert_var_to_array (entry); + + /* ENTRY is an array variable, and ARRAY points to the value. */ + return (bind_array_var_internal (entry, ind, 0, value, flags)); +} + +SHELL_VAR * +bind_array_element (entry, ind, value, flags) + SHELL_VAR *entry; + arrayind_t ind; + char *value; + int flags; +{ + return (bind_array_var_internal (entry, ind, 0, value, flags)); +} + +SHELL_VAR * +bind_assoc_variable (entry, name, key, value, flags) + SHELL_VAR *entry; + char *name; + char *key; + char *value; + int flags; +{ + SHELL_VAR *dentry; + char *newval; + + if (readonly_p (entry) || noassign_p (entry)) + { + if (readonly_p (entry)) + err_readonly (name); + return (entry); + } + + return (bind_array_var_internal (entry, 0, key, value, flags)); +} + +/* Parse NAME, a lhs of an assignment statement of the form v[s], and + assign VALUE to that array element by calling bind_array_variable(). */ +SHELL_VAR * +assign_array_element (name, value, flags) + char *name, *value; + int flags; +{ + char *sub, *vname; + int sublen; + SHELL_VAR *entry; + + vname = array_variable_name (name, &sub, &sublen); + + if (vname == 0) + return ((SHELL_VAR *)NULL); + + if ((ALL_ELEMENT_SUB (sub[0]) && sub[1] == ']') || (sublen <= 1)) + { + free (vname); + err_badarraysub (name); + return ((SHELL_VAR *)NULL); + } + + entry = find_variable (vname); + entry = assign_array_element_internal (entry, name, vname, sub, sublen, value, flags); + + free (vname); + return entry; +} + +static SHELL_VAR * +assign_array_element_internal (entry, name, vname, sub, sublen, value, flags) + SHELL_VAR *entry; + char *name; /* only used for error messages */ + char *vname; + char *sub; + int sublen; + char *value; + int flags; +{ + char *akey; + arrayind_t ind; + + if (entry && assoc_p (entry)) + { + sub[sublen-1] = '\0'; + akey = expand_assignment_string_to_string (sub, 0); /* [ */ + sub[sublen-1] = ']'; + if (akey == 0 || *akey == 0) + { + err_badarraysub (name); + FREE (akey); + return ((SHELL_VAR *)NULL); + } + entry = bind_assoc_variable (entry, vname, akey, value, flags); + } + else + { + ind = array_expand_index (entry, sub, sublen); + /* negative subscripts to indexed arrays count back from end */ + if (entry && ind < 0) + ind = (array_p (entry) ? array_max_index (array_cell (entry)) : 0) + 1 + ind; + if (ind < 0) + { + err_badarraysub (name); + return ((SHELL_VAR *)NULL); + } + entry = bind_array_variable (vname, ind, value, flags); + } + + return (entry); +} + +/* Find the array variable corresponding to NAME. If there is no variable, + create a new array variable. If the variable exists but is not an array, + convert it to an indexed array. If FLAGS&1 is non-zero, an existing + variable is checked for the readonly or noassign attribute in preparation + for assignment (e.g., by the `read' builtin). If FLAGS&2 is non-zero, we + create an associative array. */ +SHELL_VAR * +find_or_make_array_variable (name, flags) + char *name; + int flags; +{ + SHELL_VAR *var; + + var = find_variable (name); + if (var == 0) + { + /* See if we have a nameref pointing to a variable that hasn't been + created yet. */ + var = find_variable_last_nameref (name); + if (var && nameref_p (var)) + var = (flags & 2) ? make_new_assoc_variable (nameref_cell (var)) : make_new_array_variable (nameref_cell (var)); + } + + if (var == 0) + var = (flags & 2) ? make_new_assoc_variable (name) : make_new_array_variable (name); + else if ((flags & 1) && (readonly_p (var) || noassign_p (var))) + { + if (readonly_p (var)) + err_readonly (name); + return ((SHELL_VAR *)NULL); + } + else if ((flags & 2) && array_p (var)) + { + last_command_exit_value = 1; + report_error (_("%s: cannot convert indexed to associative array"), name); + return ((SHELL_VAR *)NULL); + } + else if (array_p (var) == 0 && assoc_p (var) == 0) + var = convert_var_to_array (var); + + return (var); +} + +/* Perform a compound assignment statement for array NAME, where VALUE is + the text between the parens: NAME=( VALUE ) */ +SHELL_VAR * +assign_array_from_string (name, value, flags) + char *name, *value; + int flags; +{ + SHELL_VAR *var; + int vflags; + + vflags = 1; + if (flags & ASS_MKASSOC) + vflags |= 2; + + var = find_or_make_array_variable (name, vflags); + if (var == 0) + return ((SHELL_VAR *)NULL); + + return (assign_array_var_from_string (var, value, flags)); +} + +/* Sequentially assign the indices of indexed array variable VAR from the + words in LIST. */ +SHELL_VAR * +assign_array_var_from_word_list (var, list, flags) + SHELL_VAR *var; + WORD_LIST *list; + int flags; +{ + register arrayind_t i; + register WORD_LIST *l; + ARRAY *a; + + a = array_cell (var); + i = (flags & ASS_APPEND) ? array_max_index (a) + 1 : 0; + + for (l = list; l; l = l->next, i++) + if (var->assign_func) + (*var->assign_func) (var, l->word->word, i, 0); + else + array_insert (a, i, l->word->word); + return var; +} + +WORD_LIST * +expand_compound_array_assignment (var, value, flags) + SHELL_VAR *var; + char *value; + int flags; +{ + WORD_LIST *list, *nlist; + WORD_LIST *hd, *tl, *t, *n; + char *val; + int ni; + + /* This condition is true when invoked from the declare builtin with a + command like + declare -a d='([1]="" [2]="bdef" [5]="hello world" "test")' */ + if (*value == '(') /*)*/ + { + ni = 1; + val = extract_array_assignment_list (value, &ni); + if (val == 0) + return (WORD_LIST *)NULL; + } + else + val = value; + + /* Expand the value string into a list of words, performing all the + shell expansions including pathname generation and word splitting. */ + /* First we split the string on whitespace, using the shell parser + (ksh93 seems to do this). */ + list = parse_string_to_word_list (val, 1, "array assign"); + + if (var && assoc_p (var)) + { + if (val != value) + free (val); + return list; + } + + /* If we're using [subscript]=value, we need to quote each [ and ] to + prevent unwanted filename expansion. This doesn't need to be done + for associative array expansion, since that uses a different expansion + function (see assign_compound_array_list below). */ + if (list) + quote_array_assignment_chars (list); + + /* Now that we've split it, perform the shell expansions on each + word in the list. */ + nlist = list ? expand_words_no_vars (list) : (WORD_LIST *)NULL; + + dispose_words (list); + + if (val != value) + free (val); + + return nlist; +} + +/* Callers ensure that VAR is not NULL */ +void +assign_compound_array_list (var, nlist, flags) + SHELL_VAR *var; + WORD_LIST *nlist; + int flags; +{ + ARRAY *a; + HASH_TABLE *h; + WORD_LIST *list; + char *w, *val, *nval; + int len, iflags, free_val; + arrayind_t ind, last_ind; + char *akey; + + a = (var && array_p (var)) ? array_cell (var) : (ARRAY *)0; + h = (var && assoc_p (var)) ? assoc_cell (var) : (HASH_TABLE *)0; + + akey = (char *)0; + ind = 0; + + /* Now that we are ready to assign values to the array, kill the existing + value. */ + if ((flags & ASS_APPEND) == 0) + { + if (a && array_p (var)) + array_flush (a); + else if (h && assoc_p (var)) + assoc_flush (h); + } + + last_ind = (a && (flags & ASS_APPEND)) ? array_max_index (a) + 1 : 0; + + for (list = nlist; list; list = list->next) + { + iflags = flags; + w = list->word->word; + + /* We have a word of the form [ind]=value */ + if ((list->word->flags & W_ASSIGNMENT) && w[0] == '[') + { + /* Don't have to handle embedded quotes specially any more, since + associative array subscripts have not been expanded yet (see + above). */ + len = skipsubscript (w, 0, 0); + + /* XXX - changes for `+=' */ + if (w[len] != ']' || (w[len+1] != '=' && (w[len+1] != '+' || w[len+2] != '='))) + { + if (assoc_p (var)) + { + err_badarraysub (w); + continue; + } + nval = make_variable_value (var, w, flags); + if (var->assign_func) + (*var->assign_func) (var, nval, last_ind, 0); + else + array_insert (a, last_ind, nval); + FREE (nval); + last_ind++; + continue; + } + + if (len == 1) + { + err_badarraysub (w); + continue; + } + + if (ALL_ELEMENT_SUB (w[1]) && len == 2) + { + last_command_exit_value = 1; + if (assoc_p (var)) + report_error (_("%s: invalid associative array key"), w); + else + report_error (_("%s: cannot assign to non-numeric index"), w); + continue; + } + + if (array_p (var)) + { + ind = array_expand_index (var, w + 1, len); + /* negative subscripts to indexed arrays count back from end */ + if (ind < 0) + ind = array_max_index (array_cell (var)) + 1 + ind; + if (ind < 0) + { + err_badarraysub (w); + continue; + } + + last_ind = ind; + } + else if (assoc_p (var)) + { + /* This is not performed above, see expand_compound_array_assignment */ + w[len] = '\0'; /*[*/ + akey = expand_assignment_string_to_string (w+1, 0); + w[len] = ']'; + /* And we need to expand the value also, see below */ + if (akey == 0 || *akey == 0) + { + err_badarraysub (w); + FREE (akey); + continue; + } + } + + /* XXX - changes for `+=' -- just accept the syntax. ksh93 doesn't do this */ + if (w[len + 1] == '+' && w[len + 2] == '=') + { + iflags |= ASS_APPEND; + val = w + len + 3; + } + else + val = w + len + 2; + } + else if (assoc_p (var)) + { + last_command_exit_value = 1; + report_error (_("%s: %s: must use subscript when assigning associative array"), var->name, w); + continue; + } + else /* No [ind]=value, just a stray `=' */ + { + ind = last_ind; + val = w; + } + + free_val = 0; + /* See above; we need to expand the value here */ + if (assoc_p (var)) + { + val = expand_assignment_string_to_string (val, 0); + if (val == 0) + { + val = (char *)xmalloc (1); + val[0] = '\0'; /* like do_assignment_internal */ + } + free_val = 1; + } + + if (integer_p (var)) + this_command_name = (char *)NULL; /* no command name for errors */ + bind_array_var_internal (var, ind, akey, val, iflags); + last_ind++; + + if (free_val) + free (val); + } +} + +/* Perform a compound array assignment: VAR->name=( VALUE ). The + VALUE has already had the parentheses stripped. */ +SHELL_VAR * +assign_array_var_from_string (var, value, flags) + SHELL_VAR *var; + char *value; + int flags; +{ + WORD_LIST *nlist; + + if (value == 0) + return var; + + nlist = expand_compound_array_assignment (var, value, flags); + assign_compound_array_list (var, nlist, flags); + + if (nlist) + dispose_words (nlist); + return (var); +} + +/* Quote globbing chars and characters in $IFS before the `=' in an assignment + statement (usually a compound array assignment) to protect them from + unwanted filename expansion or word splitting. */ +static char * +quote_assign (string) + const char *string; +{ + size_t slen; + int saw_eq; + char *temp, *t, *subs; + const char *s, *send; + int ss, se; + DECLARE_MBSTATE; + + slen = strlen (string); + send = string + slen; + + t = temp = (char *)xmalloc (slen * 2 + 1); + saw_eq = 0; + for (s = string; *s; ) + { + if (*s == '=') + saw_eq = 1; + if (saw_eq == 0 && *s == '[') /* looks like a subscript */ + { + ss = s - string; + se = skipsubscript (string, ss, 0); + subs = substring (s, ss, se); + *t++ = '\\'; + strcpy (t, subs); + t += se - ss; + *t++ = '\\'; + *t++ = ']'; + s += se + 1; + free (subs); + continue; + } + if (saw_eq == 0 && (glob_char_p (s) || isifs (*s))) + *t++ = '\\'; + + COPY_CHAR_P (t, s, send); + } + *t = '\0'; + return temp; +} + +/* For each word in a compound array assignment, if the word looks like + [ind]=value, quote globbing chars and characters in $IFS before the `='. */ +static void +quote_array_assignment_chars (list) + WORD_LIST *list; +{ + char *nword; + WORD_LIST *l; + + for (l = list; l; l = l->next) + { + if (l->word == 0 || l->word->word == 0 || l->word->word[0] == '\0') + continue; /* should not happen, but just in case... */ + /* Don't bother if it hasn't been recognized as an assignment or + doesn't look like [ind]=value */ + if ((l->word->flags & W_ASSIGNMENT) == 0) + continue; + if (l->word->word[0] != '[' || mbschr (l->word->word, '=') == 0) /* ] */ + continue; + + nword = quote_assign (l->word->word); + free (l->word->word); + l->word->word = nword; + l->word->flags |= W_NOGLOB; /* XXX - W_NOSPLIT also? */ + } +} + +/* skipsubscript moved to subst.c to use private functions. 2009/02/24. */ + +/* This function is called with SUB pointing to just after the beginning + `[' of an array subscript and removes the array element to which SUB + expands from array VAR. A subscript of `*' or `@' unsets the array. */ +int +unbind_array_element (var, sub) + SHELL_VAR *var; + char *sub; +{ + int len; + arrayind_t ind; + char *akey; + ARRAY_ELEMENT *ae; + + len = skipsubscript (sub, 0, 0); + if (sub[len] != ']' || len == 0) + { + builtin_error ("%s[%s: %s", var->name, sub, _(bash_badsub_errmsg)); + return -1; + } + sub[len] = '\0'; + + if (ALL_ELEMENT_SUB (sub[0]) && sub[1] == 0) + { + unbind_variable (var->name); + return (0); + } + + if (assoc_p (var)) + { + akey = expand_assignment_string_to_string (sub, 0); /* [ */ + if (akey == 0 || *akey == 0) + { + builtin_error ("[%s]: %s", sub, _(bash_badsub_errmsg)); + FREE (akey); + return -1; + } + assoc_remove (assoc_cell (var), akey); + free (akey); + } + else + { + ind = array_expand_index (var, sub, len+1); + /* negative subscripts to indexed arrays count back from end */ + if (ind < 0) + ind = array_max_index (array_cell (var)) + 1 + ind; + if (ind < 0) + { + builtin_error ("[%s]: %s", sub, _(bash_badsub_errmsg)); + return -1; + } + ae = array_remove (array_cell (var), ind); + if (ae) + array_dispose_element (ae); + } + + return 0; +} + +/* Format and output an array assignment in compound form VAR=(VALUES), + suitable for re-use as input. */ +void +print_array_assignment (var, quoted) + SHELL_VAR *var; + int quoted; +{ + char *vstr; + + vstr = array_to_assign (array_cell (var), quoted); + + if (vstr == 0) + printf ("%s=%s\n", var->name, quoted ? "'()'" : "()"); + else + { + printf ("%s=%s\n", var->name, vstr); + free (vstr); + } +} + +/* Format and output an associative array assignment in compound form + VAR=(VALUES), suitable for re-use as input. */ +void +print_assoc_assignment (var, quoted) + SHELL_VAR *var; + int quoted; +{ + char *vstr; + + vstr = assoc_to_assign (assoc_cell (var), quoted); + + if (vstr == 0) + printf ("%s=%s\n", var->name, quoted ? "'()'" : "()"); + else + { + printf ("%s=%s\n", var->name, vstr); + free (vstr); + } +} + +/***********************************************************************/ +/* */ +/* Utility functions to manage arrays and their contents for expansion */ +/* */ +/***********************************************************************/ + +/* Return 1 if NAME is a properly-formed array reference v[sub]. */ +int +valid_array_reference (name) + char *name; +{ + char *t; + int r, len; + + t = mbschr (name, '['); /* ] */ + if (t) + { + *t = '\0'; + r = legal_identifier (name); + *t = '['; + if (r == 0) + return 0; + /* Check for a properly-terminated non-blank subscript. */ + len = skipsubscript (t, 0, 0); + if (t[len] != ']' || len == 1) + return 0; + for (r = 1; r < len; r++) + if (whitespace (t[r]) == 0) + return 1; + return 0; + } + return 0; +} + +/* Expand the array index beginning at S and extending LEN characters. */ +arrayind_t +array_expand_index (var, s, len) + SHELL_VAR *var; + char *s; + int len; +{ + char *exp, *t; + int expok; + arrayind_t val; + + exp = (char *)xmalloc (len); + strncpy (exp, s, len - 1); + exp[len - 1] = '\0'; + t = expand_arith_string (exp, 0); + this_command_name = (char *)NULL; + val = evalexp (t, &expok); + free (t); + free (exp); + if (expok == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + + top_level_cleanup (); + jump_to_top_level (DISCARD); + } + return val; +} + +/* Return the name of the variable specified by S without any subscript. + If SUBP is non-null, return a pointer to the start of the subscript + in *SUBP. If LENP is non-null, the length of the subscript is returned + in *LENP. This returns newly-allocated memory. */ +char * +array_variable_name (s, subp, lenp) + char *s, **subp; + int *lenp; +{ + char *t, *ret; + int ind, ni; + + t = mbschr (s, '['); + if (t == 0) + { + if (subp) + *subp = t; + if (lenp) + *lenp = 0; + return ((char *)NULL); + } + ind = t - s; + ni = skipsubscript (s, ind, 0); + if (ni <= ind + 1 || s[ni] != ']') + { + err_badarraysub (s); + if (subp) + *subp = t; + if (lenp) + *lenp = 0; + return ((char *)NULL); + } + + *t = '\0'; + ret = savestring (s); + *t++ = '['; /* ] */ + + if (subp) + *subp = t; + if (lenp) + *lenp = ni - ind; + + return ret; +} + +/* Return the variable specified by S without any subscript. If SUBP is + non-null, return a pointer to the start of the subscript in *SUBP. + If LENP is non-null, the length of the subscript is returned in *LENP. */ +SHELL_VAR * +array_variable_part (s, subp, lenp) + char *s, **subp; + int *lenp; +{ + char *t; + SHELL_VAR *var; + + t = array_variable_name (s, subp, lenp); + if (t == 0) + return ((SHELL_VAR *)NULL); + var = find_variable (t); + + free (t); +#if 0 + return (var == 0 || invisible_p (var)) ? (SHELL_VAR *)0 : var; +#else + return var; /* now return invisible variables; caller must handle */ +#endif +} + +#define INDEX_ERROR() \ + do \ + { \ + if (var) \ + err_badarraysub (var->name); \ + else \ + { \ + t[-1] = '\0'; \ + err_badarraysub (s); \ + t[-1] = '['; /* ] */\ + } \ + return ((char *)NULL); \ + } \ + while (0) + +/* Return a string containing the elements in the array and subscript + described by S. If the subscript is * or @, obeys quoting rules akin + to the expansion of $* and $@ including double quoting. If RTYPE + is non-null it gets 1 if the array reference is name[*], 2 if the + reference is name[@], and 0 otherwise. */ +static char * +array_value_internal (s, quoted, flags, rtype, indp) + char *s; + int quoted, flags, *rtype; + arrayind_t *indp; +{ + int len; + arrayind_t ind; + char *akey; + char *retval, *t, *temp; + WORD_LIST *l; + SHELL_VAR *var; + + var = array_variable_part (s, &t, &len); + + /* Expand the index, even if the variable doesn't exist, in case side + effects are needed, like ${w[i++]} where w is unset. */ +#if 0 + if (var == 0) + return (char *)NULL; +#endif + + if (len == 0) + return ((char *)NULL); /* error message already printed */ + + /* [ */ + akey = 0; + if (ALL_ELEMENT_SUB (t[0]) && t[1] == ']') + { + if (rtype) + *rtype = (t[0] == '*') ? 1 : 2; + if ((flags & AV_ALLOWALL) == 0) + { + err_badarraysub (s); + return ((char *)NULL); + } + else if (var == 0 || value_cell (var) == 0) /* XXX - check for invisible_p(var) ? */ + return ((char *)NULL); + else if (array_p (var) == 0 && assoc_p (var) == 0) + l = add_string_to_list (value_cell (var), (WORD_LIST *)NULL); + else if (assoc_p (var)) + { + l = assoc_to_word_list (assoc_cell (var)); + if (l == (WORD_LIST *)NULL) + return ((char *)NULL); + } + else + { + l = array_to_word_list (array_cell (var)); + if (l == (WORD_LIST *)NULL) + return ((char *) NULL); + } + + if (t[0] == '*' && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + { + temp = string_list_dollar_star (l); + retval = quote_string (temp); /* XXX - leak here */ + free (temp); + } + else /* ${name[@]} or unquoted ${name[*]} */ + retval = string_list_dollar_at (l, quoted); /* XXX - leak here */ + + dispose_words (l); + } + else + { + if (rtype) + *rtype = 0; + if (var == 0 || array_p (var) || assoc_p (var) == 0) + { + if ((flags & AV_USEIND) == 0 || indp == 0) + { + ind = array_expand_index (var, t, len); + if (ind < 0) + { + /* negative subscripts to indexed arrays count back from end */ + if (var && array_p (var)) + ind = array_max_index (array_cell (var)) + 1 + ind; + if (ind < 0) + INDEX_ERROR(); + } + if (indp) + *indp = ind; + } + else if (indp) + ind = *indp; + } + else if (assoc_p (var)) + { + t[len - 1] = '\0'; + akey = expand_assignment_string_to_string (t, 0); /* [ */ + t[len - 1] = ']'; + if (akey == 0 || *akey == 0) + { + FREE (akey); + INDEX_ERROR(); + } + } + + if (var == 0 || value_cell (var) == 0) /* XXX - check invisible_p(var) ? */ + { + FREE (akey); + return ((char *)NULL); + } + if (array_p (var) == 0 && assoc_p (var) == 0) + return (ind == 0 ? value_cell (var) : (char *)NULL); + else if (assoc_p (var)) + { + retval = assoc_reference (assoc_cell (var), akey); + free (akey); + } + else + retval = array_reference (array_cell (var), ind); + } + + return retval; +} + +/* Return a string containing the elements described by the array and + subscript contained in S, obeying quoting for subscripts * and @. */ +char * +array_value (s, quoted, flags, rtype, indp) + char *s; + int quoted, flags, *rtype; + arrayind_t *indp; +{ + return (array_value_internal (s, quoted, flags|AV_ALLOWALL, rtype, indp)); +} + +/* Return the value of the array indexing expression S as a single string. + If (FLAGS & AV_ALLOWALL) is 0, do not allow `@' and `*' subscripts. This + is used by other parts of the shell such as the arithmetic expression + evaluator in expr.c. */ +char * +get_array_value (s, flags, rtype, indp) + char *s; + int flags, *rtype; + arrayind_t *indp; +{ + return (array_value_internal (s, 0, flags, rtype, indp)); +} + +char * +array_keys (s, quoted) + char *s; + int quoted; +{ + int len; + char *retval, *t, *temp; + WORD_LIST *l; + SHELL_VAR *var; + + var = array_variable_part (s, &t, &len); + + /* [ */ + if (var == 0 || ALL_ELEMENT_SUB (t[0]) == 0 || t[1] != ']') + return (char *)NULL; + + if (var_isset (var) == 0 || invisible_p (var)) + return (char *)NULL; + + if (array_p (var) == 0 && assoc_p (var) == 0) + l = add_string_to_list ("0", (WORD_LIST *)NULL); + else if (assoc_p (var)) + l = assoc_keys_to_word_list (assoc_cell (var)); + else + l = array_keys_to_word_list (array_cell (var)); + if (l == (WORD_LIST *)NULL) + return ((char *) NULL); + + if (t[0] == '*' && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + { + temp = string_list_dollar_star (l); + retval = quote_string (temp); + free (temp); + } + else /* ${!name[@]} or unquoted ${!name[*]} */ + retval = string_list_dollar_at (l, quoted); + + dispose_words (l); + return retval; +} +#endif /* ARRAY_VARS */ diff --git a/.pc/bash43-018.diff/patchlevel.h b/.pc/bash43-018.diff/patchlevel.h new file mode 100644 index 0000000..2ff299b --- /dev/null +++ b/.pc/bash43-018.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 17 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-019.diff/builtins/read.def b/.pc/bash43-019.diff/builtins/read.def new file mode 100644 index 0000000..56945b9 --- /dev/null +++ b/.pc/bash43-019.diff/builtins/read.def @@ -0,0 +1,1091 @@ +This file is read.def, from which is created read.c. +It implements the builtin "read" in Bash. + +Copyright (C) 1987-2012 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES read.c + +$BUILTIN read +$FUNCTION read_builtin +$SHORT_DOC read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...] +Read a line from the standard input and split it into fields. + +Reads a single line from the standard input, or from file descriptor FD +if the -u option is supplied. The line is split into fields as with word +splitting, and the first word is assigned to the first NAME, the second +word to the second NAME, and so on, with any leftover words assigned to +the last NAME. Only the characters found in $IFS are recognized as word +delimiters. + +If no NAMEs are supplied, the line read is stored in the REPLY variable. + +Options: + -a array assign the words read to sequential indices of the array + variable ARRAY, starting at zero + -d delim continue until the first character of DELIM is read, rather + than newline + -e use Readline to obtain the line in an interactive shell + -i text Use TEXT as the initial text for Readline + -n nchars return after reading NCHARS characters rather than waiting + for a newline, but honor a delimiter if fewer than NCHARS + characters are read before the delimiter + -N nchars return only after reading exactly NCHARS characters, unless + EOF is encountered or read times out, ignoring any delimiter + -p prompt output the string PROMPT without a trailing newline before + attempting to read + -r do not allow backslashes to escape any characters + -s do not echo input coming from a terminal + -t timeout time out and return failure if a complete line of input is + not read within TIMEOUT seconds. The value of the TMOUT + variable is the default timeout. TIMEOUT may be a + fractional number. If TIMEOUT is 0, read returns immediately, + without trying to read any data, returning success only if + input is available on the specified file descriptor. The + exit status is greater than 128 if the timeout is exceeded + -u fd read from file descriptor FD instead of the standard input + +Exit Status: +The return code is zero, unless end-of-file is encountered, read times out +(in which case it's greater than 128), a variable assignment error occurs, +or an invalid file descriptor is supplied as the argument to -u. +$END + +#include + +#include "bashtypes.h" +#include "posixstat.h" + +#include + +#include "bashansi.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include + +#ifdef __CYGWIN__ +# include +# include +#endif + +#include "../bashintl.h" + +#include "../shell.h" +#include "common.h" +#include "bashgetopt.h" + +#include + +#if defined (READLINE) +#include "../bashline.h" +#include +#endif + +#if defined (BUFFERED_INPUT) +# include "input.h" +#endif + +#include "shmbutil.h" + +#if !defined(errno) +extern int errno; +#endif + +extern void run_pending_traps __P((void)); + +extern int posixly_correct; +extern int trapped_signal_received; + +struct ttsave +{ + int fd; + TTYSTRUCT *attrs; +}; + +#if defined (READLINE) +static void reset_attempted_completion_function __P((char *)); +static int set_itext __P((void)); +static char *edit_line __P((char *, char *)); +static void set_eol_delim __P((int)); +static void reset_eol_delim __P((char *)); +#endif +static SHELL_VAR *bind_read_variable __P((char *, char *)); +#if defined (HANDLE_MULTIBYTE) +static int read_mbchar __P((int, char *, int, int, int)); +#endif +static void ttyrestore __P((struct ttsave *)); + +static sighandler sigalrm __P((int)); +static void reset_alarm __P((void)); + +/* Try this to see what the rest of the shell can do with the information. */ +procenv_t alrmbuf; +int sigalrm_seen; + +static int reading; +static SigHandler *old_alrm; +static unsigned char delim; + +/* In all cases, SIGALRM just sets a flag that we check periodically. This + avoids problems with the semi-tricky stuff we do with the xfree of + input_string at the top of the unwind-protect list (see below). */ + +/* Set a flag that CHECK_ALRM can check. This relies on zread calling + trap.c:check_signals_and_traps(), which knows about sigalrm_seen and + alrmbuf. */ +static sighandler +sigalrm (s) + int s; +{ + sigalrm_seen = 1; +} + +static void +reset_alarm () +{ + set_signal_handler (SIGALRM, old_alrm); + falarm (0, 0); +} + +/* Read the value of the shell variables whose names follow. + The reading is done from the current input stream, whatever + that may be. Successive words of the input line are assigned + to the variables mentioned in LIST. The last variable in LIST + gets the remainder of the words on the line. If no variables + are mentioned in LIST, then the default variable is $REPLY. */ +int +read_builtin (list) + WORD_LIST *list; +{ + register char *varname; + int size, i, nr, pass_next, saw_escape, eof, opt, retval, code, print_ps2; + int input_is_tty, input_is_pipe, unbuffered_read, skip_ctlesc, skip_ctlnul; + int raw, edit, nchars, silent, have_timeout, ignore_delim, fd, lastsig, t_errno; + unsigned int tmsec, tmusec; + long ival, uval; + intmax_t intval; + char c; + char *input_string, *orig_input_string, *ifs_chars, *prompt, *arrayname; + char *e, *t, *t1, *ps2, *tofree; + struct stat tsb; + SHELL_VAR *var; + TTYSTRUCT ttattrs, ttset; + struct ttsave termsave; +#if defined (ARRAY_VARS) + WORD_LIST *alist; +#endif +#if defined (READLINE) + char *rlbuf, *itext; + int rlind; +#endif + + USE_VAR(size); + USE_VAR(i); + USE_VAR(pass_next); + USE_VAR(print_ps2); + USE_VAR(saw_escape); + USE_VAR(input_is_pipe); +/* USE_VAR(raw); */ + USE_VAR(edit); + USE_VAR(tmsec); + USE_VAR(tmusec); + USE_VAR(nchars); + USE_VAR(silent); + USE_VAR(ifs_chars); + USE_VAR(prompt); + USE_VAR(arrayname); +#if defined (READLINE) + USE_VAR(rlbuf); + USE_VAR(rlind); + USE_VAR(itext); +#endif + USE_VAR(list); + USE_VAR(ps2); + USE_VAR(lastsig); + + sigalrm_seen = reading = 0; + + i = 0; /* Index into the string that we are reading. */ + raw = edit = 0; /* Not reading raw input by default. */ + silent = 0; + arrayname = prompt = (char *)NULL; + fd = 0; /* file descriptor to read from */ + +#if defined (READLINE) + rlbuf = itext = (char *)0; + rlind = 0; +#endif + + tmsec = tmusec = 0; /* no timeout */ + nr = nchars = input_is_tty = input_is_pipe = unbuffered_read = have_timeout = 0; + delim = '\n'; /* read until newline */ + ignore_delim = 0; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "ersa:d:i:n:p:t:u:N:")) != -1) + { + switch (opt) + { + case 'r': + raw = 1; + break; + case 'p': + prompt = list_optarg; + break; + case 's': + silent = 1; + break; + case 'e': +#if defined (READLINE) + edit = 1; +#endif + break; + case 'i': +#if defined (READLINE) + itext = list_optarg; +#endif + break; +#if defined (ARRAY_VARS) + case 'a': + arrayname = list_optarg; + break; +#endif + case 't': + code = uconvert (list_optarg, &ival, &uval); + if (code == 0 || ival < 0 || uval < 0) + { + builtin_error (_("%s: invalid timeout specification"), list_optarg); + return (EXECUTION_FAILURE); + } + else + { + have_timeout = 1; + tmsec = ival; + tmusec = uval; + } + break; + case 'N': + ignore_delim = 1; + delim = -1; + case 'n': + code = legal_number (list_optarg, &intval); + if (code == 0 || intval < 0 || intval != (int)intval) + { + sh_invalidnum (list_optarg); + return (EXECUTION_FAILURE); + } + else + nchars = intval; + break; + case 'u': + code = legal_number (list_optarg, &intval); + if (code == 0 || intval < 0 || intval != (int)intval) + { + builtin_error (_("%s: invalid file descriptor specification"), list_optarg); + return (EXECUTION_FAILURE); + } + else + fd = intval; + if (sh_validfd (fd) == 0) + { + builtin_error (_("%d: invalid file descriptor: %s"), fd, strerror (errno)); + return (EXECUTION_FAILURE); + } + break; + case 'd': + delim = *list_optarg; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + /* `read -t 0 var' tests whether input is available with select/FIONREAD, + and fails if those are unavailable */ + if (have_timeout && tmsec == 0 && tmusec == 0) +#if 0 + return (EXECUTION_FAILURE); +#else + return (input_avail (fd) ? EXECUTION_SUCCESS : EXECUTION_FAILURE); +#endif + + /* Convenience: check early whether or not the first of possibly several + variable names is a valid identifier, and bail early if so. */ +#if defined (ARRAY_VARS) + if (list && legal_identifier (list->word->word) == 0 && valid_array_reference (list->word->word) == 0) +#else + if (list && legal_identifier (list->word->word) == 0) +#endif + { + sh_invalidid (list->word->word); + return (EXECUTION_FAILURE); + } + + /* If we're asked to ignore the delimiter, make sure we do. */ + if (ignore_delim) + delim = -1; + + /* IF IFS is unset, we use the default of " \t\n". */ + ifs_chars = getifs (); + if (ifs_chars == 0) /* XXX - shouldn't happen */ + ifs_chars = ""; + /* If we want to read exactly NCHARS chars, don't split on IFS */ + if (ignore_delim) + ifs_chars = ""; + for (skip_ctlesc = skip_ctlnul = 0, e = ifs_chars; *e; e++) + skip_ctlesc |= *e == CTLESC, skip_ctlnul |= *e == CTLNUL; + + input_string = (char *)xmalloc (size = 112); /* XXX was 128 */ + input_string[0] = '\0'; + + /* $TMOUT, if set, is the default timeout for read. */ + if (have_timeout == 0 && (e = get_string_value ("TMOUT"))) + { + code = uconvert (e, &ival, &uval); + if (code == 0 || ival < 0 || uval < 0) + tmsec = tmusec = 0; + else + { + tmsec = ival; + tmusec = uval; + } + } + + begin_unwind_frame ("read_builtin"); + +#if defined (BUFFERED_INPUT) + if (interactive == 0 && default_buffered_input >= 0 && fd_is_bash_input (fd)) + sync_buffered_stream (default_buffered_input); +#endif + + input_is_tty = isatty (fd); + if (input_is_tty == 0) +#ifndef __CYGWIN__ + input_is_pipe = (lseek (fd, 0L, SEEK_CUR) < 0) && (errno == ESPIPE); +#else + input_is_pipe = 1; +#endif + + /* If the -p, -e or -s flags were given, but input is not coming from the + terminal, turn them off. */ + if ((prompt || edit || silent) && input_is_tty == 0) + { + prompt = (char *)NULL; +#if defined (READLINE) + itext = (char *)NULL; +#endif + edit = silent = 0; + } + +#if defined (READLINE) + if (edit) + add_unwind_protect (xfree, rlbuf); +#endif + + pass_next = 0; /* Non-zero signifies last char was backslash. */ + saw_escape = 0; /* Non-zero signifies that we saw an escape char */ + + if (tmsec > 0 || tmusec > 0) + { + /* Turn off the timeout if stdin is a regular file (e.g. from + input redirection). */ + if ((fstat (fd, &tsb) < 0) || S_ISREG (tsb.st_mode)) + tmsec = tmusec = 0; + } + + if (tmsec > 0 || tmusec > 0) + { + code = setjmp_nosigs (alrmbuf); + if (code) + { + sigalrm_seen = 0; + /* Tricky. The top of the unwind-protect stack is the free of + input_string. We want to run all the rest and use input_string, + so we have to save input_string temporarily, run the unwind- + protects, then restore input_string so we can use it later */ + orig_input_string = 0; + input_string[i] = '\0'; /* make sure it's terminated */ + if (i == 0) + { + t = (char *)xmalloc (1); + t[0] = 0; + } + else + t = savestring (input_string); + + run_unwind_frame ("read_builtin"); + input_string = t; + retval = 128+SIGALRM; + goto assign_vars; + } + old_alrm = set_signal_handler (SIGALRM, sigalrm); + add_unwind_protect (reset_alarm, (char *)NULL); +#if defined (READLINE) + if (edit) + add_unwind_protect (reset_attempted_completion_function, (char *)NULL); +#endif + falarm (tmsec, tmusec); + } + + /* If we've been asked to read only NCHARS chars, or we're using some + character other than newline to terminate the line, do the right + thing to readline or the tty. */ + if (nchars > 0 || delim != '\n') + { +#if defined (READLINE) + if (edit) + { + if (nchars > 0) + { + unwind_protect_int (rl_num_chars_to_read); + rl_num_chars_to_read = nchars; + } + if (delim != '\n') + { + set_eol_delim (delim); + add_unwind_protect (reset_eol_delim, (char *)NULL); + } + } + else +#endif + if (input_is_tty) + { + /* ttsave() */ + termsave.fd = fd; + ttgetattr (fd, &ttattrs); + termsave.attrs = &ttattrs; + + ttset = ttattrs; + i = silent ? ttfd_cbreak (fd, &ttset) : ttfd_onechar (fd, &ttset); + if (i < 0) + sh_ttyerror (1); + add_unwind_protect ((Function *)ttyrestore, (char *)&termsave); + } + } + else if (silent) /* turn off echo but leave term in canonical mode */ + { + /* ttsave (); */ + termsave.fd = fd; + ttgetattr (fd, &ttattrs); + termsave.attrs = &ttattrs; + + ttset = ttattrs; + i = ttfd_noecho (fd, &ttset); /* ttnoecho (); */ + if (i < 0) + sh_ttyerror (1); + + add_unwind_protect ((Function *)ttyrestore, (char *)&termsave); + } + + /* This *must* be the top unwind-protect on the stack, so the manipulation + of the unwind-protect stack after the realloc() works right. */ + add_unwind_protect (xfree, input_string); + + CHECK_ALRM; + if ((nchars > 0) && (input_is_tty == 0) && ignore_delim) /* read -N */ + unbuffered_read = 2; + else if ((nchars > 0) || (delim != '\n') || input_is_pipe) + unbuffered_read = 1; + + if (prompt && edit == 0) + { + fprintf (stderr, "%s", prompt); + fflush (stderr); + } + +#if defined (__CYGWIN__) && defined (O_TEXT) + setmode (0, O_TEXT); +#endif + + ps2 = 0; + for (print_ps2 = eof = retval = 0;;) + { + CHECK_ALRM; + +#if defined (READLINE) + if (edit) + { + if (rlbuf && rlbuf[rlind] == '\0') + { + xfree (rlbuf); + rlbuf = (char *)0; + } + if (rlbuf == 0) + { + reading = 1; + rlbuf = edit_line (prompt ? prompt : "", itext); + reading = 0; + rlind = 0; + } + if (rlbuf == 0) + { + eof = 1; + break; + } + c = rlbuf[rlind++]; + } + else + { +#endif + + if (print_ps2) + { + if (ps2 == 0) + ps2 = get_string_value ("PS2"); + fprintf (stderr, "%s", ps2 ? ps2 : ""); + fflush (stderr); + print_ps2 = 0; + } + +#if 0 + if (posixly_correct == 0) + interrupt_immediately++; +#endif + reading = 1; + if (unbuffered_read == 2) + retval = posixly_correct ? zreadintr (fd, &c, 1) : zreadn (fd, &c, nchars - nr); + else if (unbuffered_read) + retval = posixly_correct ? zreadintr (fd, &c, 1) : zread (fd, &c, 1); + else + retval = posixly_correct ? zreadcintr (fd, &c) : zreadc (fd, &c); + reading = 0; +#if 0 + if (posixly_correct == 0) + interrupt_immediately--; +#endif + + if (retval <= 0) + { + if (retval < 0 && errno == EINTR) + { + lastsig = LASTSIG(); + if (lastsig == 0) + lastsig = trapped_signal_received; + run_pending_traps (); /* because interrupt_immediately is not set */ + } + else + lastsig = 0; + CHECK_TERMSIG; + eof = 1; + break; + } + + CHECK_ALRM; + +#if defined (READLINE) + } +#endif + + CHECK_ALRM; + if (i + 4 >= size) /* XXX was i + 2; use i + 4 for multibyte/read_mbchar */ + { + char *t; + t = (char *)xrealloc (input_string, size += 128); + + /* Only need to change unwind-protect if input_string changes */ + if (t != input_string) + { + input_string = t; + remove_unwind_protect (); + add_unwind_protect (xfree, input_string); + } + } + + /* If the next character is to be accepted verbatim, a backslash + newline pair still disappears from the input. */ + if (pass_next) + { + pass_next = 0; + if (c == '\n') + { + i--; /* back up over the CTLESC */ + if (interactive && input_is_tty && raw == 0) + print_ps2 = 1; + } + else + goto add_char; + continue; + } + + /* This may cause problems if IFS contains CTLESC */ + if (c == '\\' && raw == 0) + { + pass_next++; + if (skip_ctlesc == 0) + { + saw_escape++; + input_string[i++] = CTLESC; + } + continue; + } + + if (ignore_delim == 0 && (unsigned char)c == delim) + break; + + if (c == '\0' && delim != '\0') + continue; /* skip NUL bytes in input */ + + if ((skip_ctlesc == 0 && c == CTLESC) || (skip_ctlnul == 0 && c == CTLNUL)) + { + saw_escape++; + input_string[i++] = CTLESC; + } + +add_char: + input_string[i++] = c; + CHECK_ALRM; + +#if defined (HANDLE_MULTIBYTE) + if (nchars > 0 && MB_CUR_MAX > 1 && is_basic (c) == 0) + { + input_string[i] = '\0'; /* for simplicity and debugging */ + i += read_mbchar (fd, input_string, i, c, unbuffered_read); + } +#endif + + nr++; + + if (nchars > 0 && nr >= nchars) + break; + } + input_string[i] = '\0'; + CHECK_ALRM; + + if (retval < 0) + { + t_errno = errno; + if (errno != EINTR) + builtin_error (_("read error: %d: %s"), fd, strerror (errno)); + run_unwind_frame ("read_builtin"); + return ((t_errno != EINTR) ? EXECUTION_FAILURE : 128+lastsig); + } + + if (tmsec > 0 || tmusec > 0) + reset_alarm (); + + if (nchars > 0 || delim != '\n') + { +#if defined (READLINE) + if (edit) + { + if (nchars > 0) + rl_num_chars_to_read = 0; + if (delim != '\n') + reset_eol_delim ((char *)NULL); + } + else +#endif + if (input_is_tty) + ttyrestore (&termsave); + } + else if (silent) + ttyrestore (&termsave); + + if (unbuffered_read == 0) + zsyncfd (fd); + + discard_unwind_frame ("read_builtin"); + + retval = eof ? EXECUTION_FAILURE : EXECUTION_SUCCESS; + +assign_vars: + +#if defined (ARRAY_VARS) + /* If -a was given, take the string read, break it into a list of words, + an assign them to `arrayname' in turn. */ + if (arrayname) + { + if (legal_identifier (arrayname) == 0) + { + sh_invalidid (arrayname); + xfree (input_string); + return (EXECUTION_FAILURE); + } + + var = find_or_make_array_variable (arrayname, 1); + if (var == 0) + { + xfree (input_string); + return EXECUTION_FAILURE; /* readonly or noassign */ + } + if (assoc_p (var)) + { + builtin_error (_("%s: cannot convert associative to indexed array"), arrayname); + xfree (input_string); + return EXECUTION_FAILURE; /* existing associative array */ + } + else if (invisible_p (var)) + VUNSETATTR (var, att_invisible); + array_flush (array_cell (var)); + + alist = list_string (input_string, ifs_chars, 0); + if (alist) + { + if (saw_escape) + dequote_list (alist); + else + word_list_remove_quoted_nulls (alist); + assign_array_var_from_word_list (var, alist, 0); + dispose_words (alist); + } + xfree (input_string); + return (retval); + } +#endif /* ARRAY_VARS */ + + /* If there are no variables, save the text of the line read to the + variable $REPLY. ksh93 strips leading and trailing IFS whitespace, + so that `read x ; echo "$x"' and `read ; echo "$REPLY"' behave the + same way, but I believe that the difference in behaviors is useful + enough to not do it. Without the bash behavior, there is no way + to read a line completely without interpretation or modification + unless you mess with $IFS (e.g., setting it to the empty string). + If you disagree, change the occurrences of `#if 0' to `#if 1' below. */ + if (list == 0) + { +#if 0 + orig_input_string = input_string; + for (t = input_string; ifs_chars && *ifs_chars && spctabnl(*t) && isifs(*t); t++) + ; + input_string = t; + input_string = strip_trailing_ifs_whitespace (input_string, ifs_chars, saw_escape); +#endif + + if (saw_escape) + { + t = dequote_string (input_string); + var = bind_variable ("REPLY", t, 0); + free (t); + } + else + var = bind_variable ("REPLY", input_string, 0); + VUNSETATTR (var, att_invisible); + + xfree (input_string); + return (retval); + } + + /* This code implements the Posix.2 spec for splitting the words + read and assigning them to variables. */ + orig_input_string = input_string; + + /* Remove IFS white space at the beginning of the input string. If + $IFS is null, no field splitting is performed. */ + for (t = input_string; ifs_chars && *ifs_chars && spctabnl(*t) && isifs(*t); t++) + ; + input_string = t; + for (; list->next; list = list->next) + { + varname = list->word->word; +#if defined (ARRAY_VARS) + if (legal_identifier (varname) == 0 && valid_array_reference (varname) == 0) +#else + if (legal_identifier (varname) == 0) +#endif + { + sh_invalidid (varname); + xfree (orig_input_string); + return (EXECUTION_FAILURE); + } + + /* If there are more variables than words read from the input, + the remaining variables are set to the empty string. */ + if (*input_string) + { + /* This call updates INPUT_STRING. */ + t = get_word_from_string (&input_string, ifs_chars, &e); + if (t) + *e = '\0'; + /* Don't bother to remove the CTLESC unless we added one + somewhere while reading the string. */ + if (t && saw_escape) + { + t1 = dequote_string (t); + var = bind_read_variable (varname, t1); + xfree (t1); + } + else + var = bind_read_variable (varname, t ? t : ""); + } + else + { + t = (char *)0; + var = bind_read_variable (varname, ""); + } + + FREE (t); + if (var == 0) + { + xfree (orig_input_string); + return (EXECUTION_FAILURE); + } + + stupidly_hack_special_variables (varname); + VUNSETATTR (var, att_invisible); + } + + /* Now assign the rest of the line to the last variable argument. */ +#if defined (ARRAY_VARS) + if (legal_identifier (list->word->word) == 0 && valid_array_reference (list->word->word) == 0) +#else + if (legal_identifier (list->word->word) == 0) +#endif + { + sh_invalidid (list->word->word); + xfree (orig_input_string); + return (EXECUTION_FAILURE); + } + +#if 0 + /* This has to be done this way rather than using string_list + and list_string because Posix.2 says that the last variable gets the + remaining words and their intervening separators. */ + input_string = strip_trailing_ifs_whitespace (input_string, ifs_chars, saw_escape); +#else + /* Check whether or not the number of fields is exactly the same as the + number of variables. */ + tofree = NULL; + if (*input_string) + { + t1 = input_string; + t = get_word_from_string (&input_string, ifs_chars, &e); + if (*input_string == 0) + tofree = input_string = t; + else + { + input_string = strip_trailing_ifs_whitespace (t1, ifs_chars, saw_escape); + tofree = t; + } + } +#endif + + if (saw_escape && input_string && *input_string) + { + t = dequote_string (input_string); + var = bind_read_variable (list->word->word, t); + xfree (t); + } + else + var = bind_read_variable (list->word->word, input_string ? input_string : ""); + + if (var) + { + stupidly_hack_special_variables (list->word->word); + VUNSETATTR (var, att_invisible); + } + else + retval = EXECUTION_FAILURE; + + FREE (tofree); + xfree (orig_input_string); + + return (retval); +} + +static SHELL_VAR * +bind_read_variable (name, value) + char *name, *value; +{ + SHELL_VAR *v; + +#if defined (ARRAY_VARS) + if (valid_array_reference (name) == 0) + v = bind_variable (name, value, 0); + else + v = assign_array_element (name, value, 0); +#else /* !ARRAY_VARS */ + v = bind_variable (name, value, 0); +#endif /* !ARRAY_VARS */ + return (v == 0 ? v + : ((readonly_p (v) || noassign_p (v)) ? (SHELL_VAR *)NULL : v)); +} + +#if defined (HANDLE_MULTIBYTE) +static int +read_mbchar (fd, string, ind, ch, unbuffered) + int fd; + char *string; + int ind, ch, unbuffered; +{ + char mbchar[MB_LEN_MAX + 1]; + int i, n, r; + char c; + size_t ret; + mbstate_t ps, ps_back; + wchar_t wc; + + memset (&ps, '\0', sizeof (mbstate_t)); + memset (&ps_back, '\0', sizeof (mbstate_t)); + + mbchar[0] = ch; + i = 1; + for (n = 0; n <= MB_LEN_MAX; n++) + { + ps_back = ps; + ret = mbrtowc (&wc, mbchar, i, &ps); + if (ret == (size_t)-2) + { + ps = ps_back; + /* We don't want to be interrupted during a multibyte char read */ + if (unbuffered) + r = zread (fd, &c, 1); + else + r = zreadc (fd, &c); + if (r < 0) + goto mbchar_return; + mbchar[i++] = c; + continue; + } + else if (ret == (size_t)-1 || ret == (size_t)0 || ret > (size_t)0) + break; + } + +mbchar_return: + if (i > 1) /* read a multibyte char */ + /* mbchar[0] is already string[ind-1] */ + for (r = 1; r < i; r++) + string[ind+r-1] = mbchar[r]; + return i - 1; +} +#endif + + +static void +ttyrestore (ttp) + struct ttsave *ttp; +{ + ttsetattr (ttp->fd, ttp->attrs); +} + +#if defined (READLINE) +static rl_completion_func_t *old_attempted_completion_function = 0; +static rl_hook_func_t *old_startup_hook; +static char *deftext; + +static void +reset_attempted_completion_function (cp) + char *cp; +{ + if (rl_attempted_completion_function == 0 && old_attempted_completion_function) + rl_attempted_completion_function = old_attempted_completion_function; +} + +static int +set_itext () +{ + int r1, r2; + + r1 = r2 = 0; + if (old_startup_hook) + r1 = (*old_startup_hook) (); + if (deftext) + { + r2 = rl_insert_text (deftext); + deftext = (char *)NULL; + rl_startup_hook = old_startup_hook; + old_startup_hook = (rl_hook_func_t *)NULL; + } + return (r1 || r2); +} + +static char * +edit_line (p, itext) + char *p; + char *itext; +{ + char *ret; + int len; + + if (bash_readline_initialized == 0) + initialize_readline (); + + old_attempted_completion_function = rl_attempted_completion_function; + rl_attempted_completion_function = (rl_completion_func_t *)NULL; + if (itext) + { + old_startup_hook = rl_startup_hook; + rl_startup_hook = set_itext; + deftext = itext; + } + + ret = readline (p); + + rl_attempted_completion_function = old_attempted_completion_function; + old_attempted_completion_function = (rl_completion_func_t *)NULL; + + if (ret == 0) + return ret; + len = strlen (ret); + ret = (char *)xrealloc (ret, len + 2); + ret[len++] = delim; + ret[len] = '\0'; + return ret; +} + +static int old_delim_ctype; +static rl_command_func_t *old_delim_func; +static int old_newline_ctype; +static rl_command_func_t *old_newline_func; + +static unsigned char delim_char; + +static void +set_eol_delim (c) + int c; +{ + Keymap cmap; + + if (bash_readline_initialized == 0) + initialize_readline (); + cmap = rl_get_keymap (); + + /* Change newline to self-insert */ + old_newline_ctype = cmap[RETURN].type; + old_newline_func = cmap[RETURN].function; + cmap[RETURN].type = ISFUNC; + cmap[RETURN].function = rl_insert; + + /* Bind the delimiter character to accept-line. */ + old_delim_ctype = cmap[c].type; + old_delim_func = cmap[c].function; + cmap[c].type = ISFUNC; + cmap[c].function = rl_newline; + + delim_char = c; +} + +static void +reset_eol_delim (cp) + char *cp; +{ + Keymap cmap; + + cmap = rl_get_keymap (); + + cmap[RETURN].type = old_newline_ctype; + cmap[RETURN].function = old_newline_func; + + cmap[delim_char].type = old_delim_ctype; + cmap[delim_char].function = old_delim_func; +} +#endif diff --git a/.pc/bash43-019.diff/lib/readline/input.c b/.pc/bash43-019.diff/lib/readline/input.c new file mode 100644 index 0000000..117dfe8 --- /dev/null +++ b/.pc/bash43-019.diff/lib/readline/input.c @@ -0,0 +1,625 @@ +/* input.c -- character input functions for readline. */ + +/* Copyright (C) 1994-2013 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (__TANDEM) +# include +#endif + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include +#include +#if defined (HAVE_SYS_FILE_H) +# include +#endif /* HAVE_SYS_FILE_H */ + +#if defined (HAVE_UNISTD_H) +# include +#endif /* HAVE_UNISTD_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include + +#include "posixselect.h" + +#if defined (FIONREAD_IN_SYS_IOCTL) +# include +#endif + +#include +#include + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" +#include "rlmbutil.h" + +/* Some standard library routines. */ +#include "readline.h" + +#include "rlprivate.h" +#include "rlshell.h" +#include "xmalloc.h" + +/* What kind of non-blocking I/O do we have? */ +#if !defined (O_NDELAY) && defined (O_NONBLOCK) +# define O_NDELAY O_NONBLOCK /* Posix style */ +#endif + +/* Non-null means it is a pointer to a function to run while waiting for + character input. */ +rl_hook_func_t *rl_event_hook = (rl_hook_func_t *)NULL; + +/* A function to call if a read(2) is interrupted by a signal. */ +rl_hook_func_t *rl_signal_event_hook = (rl_hook_func_t *)NULL; + +/* A function to replace _rl_input_available for applications using the + callback interface. */ +rl_hook_func_t *rl_input_available_hook = (rl_hook_func_t *)NULL; + +rl_getc_func_t *rl_getc_function = rl_getc; + +static int _keyboard_input_timeout = 100000; /* 0.1 seconds; it's in usec */ + +static int ibuffer_space PARAMS((void)); +static int rl_get_char PARAMS((int *)); +static int rl_gather_tyi PARAMS((void)); + +/* **************************************************************** */ +/* */ +/* Character Input Buffering */ +/* */ +/* **************************************************************** */ + +static int pop_index, push_index; +static unsigned char ibuffer[512]; +static int ibuffer_len = sizeof (ibuffer) - 1; + +#define any_typein (push_index != pop_index) + +int +_rl_any_typein () +{ + return any_typein; +} + +int +_rl_pushed_input_available () +{ + return (push_index != pop_index); +} + +/* Return the amount of space available in the buffer for stuffing + characters. */ +static int +ibuffer_space () +{ + if (pop_index > push_index) + return (pop_index - push_index - 1); + else + return (ibuffer_len - (push_index - pop_index)); +} + +/* Get a key from the buffer of characters to be read. + Return the key in KEY. + Result is non-zero if there was a key, or 0 if there wasn't. */ +static int +rl_get_char (key) + int *key; +{ + if (push_index == pop_index) + return (0); + + *key = ibuffer[pop_index++]; +#if 0 + if (pop_index >= ibuffer_len) +#else + if (pop_index > ibuffer_len) +#endif + pop_index = 0; + + return (1); +} + +/* Stuff KEY into the *front* of the input buffer. + Returns non-zero if successful, zero if there is + no space left in the buffer. */ +int +_rl_unget_char (key) + int key; +{ + if (ibuffer_space ()) + { + pop_index--; + if (pop_index < 0) + pop_index = ibuffer_len; + ibuffer[pop_index] = key; + return (1); + } + return (0); +} + +/* If a character is available to be read, then read it and stuff it into + IBUFFER. Otherwise, just return. Returns number of characters read + (0 if none available) and -1 on error (EIO). */ +static int +rl_gather_tyi () +{ + int tty; + register int tem, result; + int chars_avail, k; + char input; +#if defined(HAVE_SELECT) + fd_set readfds, exceptfds; + struct timeval timeout; +#endif + + chars_avail = 0; + tty = fileno (rl_instream); + +#if defined (HAVE_SELECT) + FD_ZERO (&readfds); + FD_ZERO (&exceptfds); + FD_SET (tty, &readfds); + FD_SET (tty, &exceptfds); + USEC_TO_TIMEVAL (_keyboard_input_timeout, timeout); + result = select (tty + 1, &readfds, (fd_set *)NULL, &exceptfds, &timeout); + if (result <= 0) + return 0; /* Nothing to read. */ +#endif + + result = -1; +#if defined (FIONREAD) + errno = 0; + result = ioctl (tty, FIONREAD, &chars_avail); + if (result == -1 && errno == EIO) + return -1; +#endif + +#if defined (O_NDELAY) + if (result == -1) + { + tem = fcntl (tty, F_GETFL, 0); + + fcntl (tty, F_SETFL, (tem | O_NDELAY)); + chars_avail = read (tty, &input, 1); + + fcntl (tty, F_SETFL, tem); + if (chars_avail == -1 && errno == EAGAIN) + return 0; + if (chars_avail == 0) /* EOF */ + { + rl_stuff_char (EOF); + return (0); + } + } +#endif /* O_NDELAY */ + +#if defined (__MINGW32__) + /* Use getch/_kbhit to check for available console input, in the same way + that we read it normally. */ + chars_avail = isatty (tty) ? _kbhit () : 0; + result = 0; +#endif + + /* If there's nothing available, don't waste time trying to read + something. */ + if (chars_avail <= 0) + return 0; + + tem = ibuffer_space (); + + if (chars_avail > tem) + chars_avail = tem; + + /* One cannot read all of the available input. I can only read a single + character at a time, or else programs which require input can be + thwarted. If the buffer is larger than one character, I lose. + Damn! */ + if (tem < ibuffer_len) + chars_avail = 0; + + if (result != -1) + { + while (chars_avail--) + { + RL_CHECK_SIGNALS (); + k = (*rl_getc_function) (rl_instream); + if (rl_stuff_char (k) == 0) + break; /* some problem; no more room */ + if (k == NEWLINE || k == RETURN) + break; + } + } + else + { + if (chars_avail) + rl_stuff_char (input); + } + + return 1; +} + +int +rl_set_keyboard_input_timeout (u) + int u; +{ + int o; + + o = _keyboard_input_timeout; + if (u >= 0) + _keyboard_input_timeout = u; + return (o); +} + +/* Is there input available to be read on the readline input file + descriptor? Only works if the system has select(2) or FIONREAD. + Uses the value of _keyboard_input_timeout as the timeout; if another + readline function wants to specify a timeout and not leave it up to + the user, it should use _rl_input_queued(timeout_value_in_microseconds) + instead. */ +int +_rl_input_available () +{ +#if defined(HAVE_SELECT) + fd_set readfds, exceptfds; + struct timeval timeout; +#endif +#if !defined (HAVE_SELECT) && defined(FIONREAD) + int chars_avail; +#endif + int tty; + + if (rl_input_available_hook) + return (*rl_input_available_hook) (); + + tty = fileno (rl_instream); + +#if defined (HAVE_SELECT) + FD_ZERO (&readfds); + FD_ZERO (&exceptfds); + FD_SET (tty, &readfds); + FD_SET (tty, &exceptfds); + timeout.tv_sec = 0; + timeout.tv_usec = _keyboard_input_timeout; + return (select (tty + 1, &readfds, (fd_set *)NULL, &exceptfds, &timeout) > 0); +#else + +#if defined (FIONREAD) + if (ioctl (tty, FIONREAD, &chars_avail) == 0) + return (chars_avail); +#endif + +#endif + +#if defined (__MINGW32__) + if (isatty (tty)) + return (_kbhit ()); +#endif + + return 0; +} + +int +_rl_input_queued (t) + int t; +{ + int old_timeout, r; + + old_timeout = rl_set_keyboard_input_timeout (t); + r = _rl_input_available (); + rl_set_keyboard_input_timeout (old_timeout); + return r; +} + +void +_rl_insert_typein (c) + int c; +{ + int key, t, i; + char *string; + + i = key = 0; + string = (char *)xmalloc (ibuffer_len + 1); + string[i++] = (char) c; + + while ((t = rl_get_char (&key)) && + _rl_keymap[key].type == ISFUNC && + _rl_keymap[key].function == rl_insert) + string[i++] = key; + + if (t) + _rl_unget_char (key); + + string[i] = '\0'; + rl_insert_text (string); + xfree (string); +} + +/* Add KEY to the buffer of characters to be read. Returns 1 if the + character was stuffed correctly; 0 otherwise. */ +int +rl_stuff_char (key) + int key; +{ + if (ibuffer_space () == 0) + return 0; + + if (key == EOF) + { + key = NEWLINE; + rl_pending_input = EOF; + RL_SETSTATE (RL_STATE_INPUTPENDING); + } + ibuffer[push_index++] = key; +#if 0 + if (push_index >= ibuffer_len) +#else + if (push_index > ibuffer_len) +#endif + push_index = 0; + + return 1; +} + +/* Make C be the next command to be executed. */ +int +rl_execute_next (c) + int c; +{ + rl_pending_input = c; + RL_SETSTATE (RL_STATE_INPUTPENDING); + return 0; +} + +/* Clear any pending input pushed with rl_execute_next() */ +int +rl_clear_pending_input () +{ + rl_pending_input = 0; + RL_UNSETSTATE (RL_STATE_INPUTPENDING); + return 0; +} + +/* **************************************************************** */ +/* */ +/* Character Input */ +/* */ +/* **************************************************************** */ + +/* Read a key, including pending input. */ +int +rl_read_key () +{ + int c, r; + + if (rl_pending_input) + { + c = rl_pending_input; + rl_clear_pending_input (); + } + else + { + /* If input is coming from a macro, then use that. */ + if (c = _rl_next_macro_key ()) + return (c); + + /* If the user has an event function, then call it periodically. */ + if (rl_event_hook) + { + while (rl_event_hook) + { + if (rl_get_char (&c) != 0) + break; + + if ((r = rl_gather_tyi ()) < 0) /* XXX - EIO */ + { + rl_done = 1; + return ('\n'); + } + else if (r > 0) /* read something */ + continue; + + RL_CHECK_SIGNALS (); + if (rl_done) /* XXX - experimental */ + return ('\n'); + (*rl_event_hook) (); + } + } + else + { + if (rl_get_char (&c) == 0) + c = (*rl_getc_function) (rl_instream); +/* fprintf(stderr, "rl_read_key: calling RL_CHECK_SIGNALS: _rl_caught_signal = %d", _rl_caught_signal); */ + RL_CHECK_SIGNALS (); + } + } + + return (c); +} + +int +rl_getc (stream) + FILE *stream; +{ + int result; + unsigned char c; + + while (1) + { + RL_CHECK_SIGNALS (); + + /* We know at this point that _rl_caught_signal == 0 */ + +#if defined (__MINGW32__) + if (isatty (fileno (stream))) + return (getch ()); +#endif + result = read (fileno (stream), &c, sizeof (unsigned char)); + + if (result == sizeof (unsigned char)) + return (c); + + /* If zero characters are returned, then the file that we are + reading from is empty! Return EOF in that case. */ + if (result == 0) + return (EOF); + +#if defined (__BEOS__) + if (errno == EINTR) + continue; +#endif + +#if defined (EWOULDBLOCK) +# define X_EWOULDBLOCK EWOULDBLOCK +#else +# define X_EWOULDBLOCK -99 +#endif + +#if defined (EAGAIN) +# define X_EAGAIN EAGAIN +#else +# define X_EAGAIN -99 +#endif + + if (errno == X_EWOULDBLOCK || errno == X_EAGAIN) + { + if (sh_unset_nodelay_mode (fileno (stream)) < 0) + return (EOF); + continue; + } + +#undef X_EWOULDBLOCK +#undef X_EAGAIN + +/* fprintf(stderr, "rl_getc: result = %d errno = %d\n", result, errno); */ + + /* If the error that we received was EINTR, then try again, + this is simply an interrupted system call to read (). We allow + the read to be interrupted if we caught SIGHUP or SIGTERM (but + not SIGINT; let the signal handler deal with that), but if the + application sets an event hook, call it for other signals. + Otherwise (not EINTR), some error occurred, also signifying EOF. */ + if (errno != EINTR) + return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF); + else if (_rl_caught_signal == SIGHUP || _rl_caught_signal == SIGTERM) + return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF); + else if (_rl_caught_signal == SIGINT || _rl_caught_signal == SIGQUIT) + RL_CHECK_SIGNALS (); + + if (rl_signal_event_hook) + (*rl_signal_event_hook) (); + } +} + +#if defined (HANDLE_MULTIBYTE) +/* read multibyte char */ +int +_rl_read_mbchar (mbchar, size) + char *mbchar; + int size; +{ + int mb_len, c; + size_t mbchar_bytes_length; + wchar_t wc; + mbstate_t ps, ps_back; + + memset(&ps, 0, sizeof (mbstate_t)); + memset(&ps_back, 0, sizeof (mbstate_t)); + + mb_len = 0; + while (mb_len < size) + { + RL_SETSTATE(RL_STATE_MOREINPUT); + c = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + + if (c < 0) + break; + + mbchar[mb_len++] = c; + + mbchar_bytes_length = mbrtowc (&wc, mbchar, mb_len, &ps); + if (mbchar_bytes_length == (size_t)(-1)) + break; /* invalid byte sequence for the current locale */ + else if (mbchar_bytes_length == (size_t)(-2)) + { + /* shorted bytes */ + ps = ps_back; + continue; + } + else if (mbchar_bytes_length == 0) + { + mbchar[0] = '\0'; /* null wide character */ + mb_len = 1; + break; + } + else if (mbchar_bytes_length > (size_t)(0)) + break; + } + + return mb_len; +} + +/* Read a multibyte-character string whose first character is FIRST into + the buffer MB of length MLEN. Returns the last character read, which + may be FIRST. Used by the search functions, among others. Very similar + to _rl_read_mbchar. */ +int +_rl_read_mbstring (first, mb, mlen) + int first; + char *mb; + int mlen; +{ + int i, c; + mbstate_t ps; + + c = first; + memset (mb, 0, mlen); + for (i = 0; c >= 0 && i < mlen; i++) + { + mb[i] = (char)c; + memset (&ps, 0, sizeof (mbstate_t)); + if (_rl_get_char_len (mb, &ps) == -2) + { + /* Read more for multibyte character */ + RL_SETSTATE (RL_STATE_MOREINPUT); + c = rl_read_key (); + RL_UNSETSTATE (RL_STATE_MOREINPUT); + } + else + break; + } + return c; +} +#endif /* HANDLE_MULTIBYTE */ diff --git a/.pc/bash43-019.diff/patchlevel.h b/.pc/bash43-019.diff/patchlevel.h new file mode 100644 index 0000000..d669696 --- /dev/null +++ b/.pc/bash43-019.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 18 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-020.diff/parse.y b/.pc/bash43-020.diff/parse.y new file mode 100644 index 0000000..91bf3bf --- /dev/null +++ b/.pc/bash43-020.diff/parse.y @@ -0,0 +1,6227 @@ +/* parse.y - Yacc grammar for bash. */ + +/* Copyright (C) 1989-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +%{ +#include "config.h" + +#include "bashtypes.h" +#include "bashansi.h" + +#include "filecntl.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (HAVE_LOCALE_H) +# include +#endif + +#include +#include "chartypes.h" +#include + +#include "memalloc.h" + +#include "bashintl.h" + +#define NEED_STRFTIME_DECL /* used in externs.h */ + +#include "shell.h" +#include "typemax.h" /* SIZE_MAX if needed */ +#include "trap.h" +#include "flags.h" +#include "parser.h" +#include "mailcheck.h" +#include "test.h" +#include "builtins.h" +#include "builtins/common.h" +#include "builtins/builtext.h" + +#include "shmbutil.h" + +#if defined (READLINE) +# include "bashline.h" +# include +#endif /* READLINE */ + +#if defined (HISTORY) +# include "bashhist.h" +# include +#endif /* HISTORY */ + +#if defined (JOB_CONTROL) +# include "jobs.h" +#endif /* JOB_CONTROL */ + +#if defined (ALIAS) +# include "alias.h" +#else +typedef void *alias_t; +#endif /* ALIAS */ + +#if defined (PROMPT_STRING_DECODE) +# ifndef _MINIX +# include +# endif +# include +# if defined (TM_IN_SYS_TIME) +# include +# include +# endif /* TM_IN_SYS_TIME */ +# include "maxpath.h" +#endif /* PROMPT_STRING_DECODE */ + +#define RE_READ_TOKEN -99 +#define NO_EXPANSION -100 + +#ifdef DEBUG +# define YYDEBUG 1 +#else +# define YYDEBUG 0 +#endif + +#if defined (HANDLE_MULTIBYTE) +# define last_shell_getc_is_singlebyte \ + ((shell_input_line_index > 1) \ + ? shell_input_line_property[shell_input_line_index - 1] \ + : 1) +# define MBTEST(x) ((x) && last_shell_getc_is_singlebyte) +#else +# define last_shell_getc_is_singlebyte 1 +# define MBTEST(x) ((x)) +#endif + +#if defined (EXTENDED_GLOB) +extern int extended_glob; +#endif + +extern int eof_encountered; +extern int no_line_editing, running_under_emacs; +extern int current_command_number; +extern int sourcelevel, parse_and_execute_level; +extern int posixly_correct; +extern int last_command_exit_value; +extern pid_t last_command_subst_pid; +extern char *shell_name, *current_host_name; +extern char *dist_version; +extern int patch_level; +extern int dump_translatable_strings, dump_po_strings; +extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin; +#if defined (BUFFERED_INPUT) +extern int bash_input_fd_changed; +#endif + +extern int errno; +/* **************************************************************** */ +/* */ +/* "Forward" declarations */ +/* */ +/* **************************************************************** */ + +#ifdef DEBUG +static void debug_parser __P((int)); +#endif + +static int yy_getc __P((void)); +static int yy_ungetc __P((int)); + +#if defined (READLINE) +static int yy_readline_get __P((void)); +static int yy_readline_unget __P((int)); +#endif + +static int yy_string_get __P((void)); +static int yy_string_unget __P((int)); +static void rewind_input_string __P((void)); +static int yy_stream_get __P((void)); +static int yy_stream_unget __P((int)); + +static int shell_getc __P((int)); +static void shell_ungetc __P((int)); +static void discard_until __P((int)); + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) +static void push_string __P((char *, int, alias_t *)); +static void pop_string __P((void)); +static void free_string_list __P((void)); +#endif + +static char *read_a_line __P((int)); + +static int reserved_word_acceptable __P((int)); +static int yylex __P((void)); +static int alias_expand_token __P((char *)); +static int time_command_acceptable __P((void)); +static int special_case_tokens __P((char *)); +static int read_token __P((int)); +static char *parse_matched_pair __P((int, int, int, int *, int)); +static char *parse_comsub __P((int, int, int, int *, int)); +#if defined (ARRAY_VARS) +static char *parse_compound_assignment __P((int *)); +#endif +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) +static int parse_dparen __P((int)); +static int parse_arith_cmd __P((char **, int)); +#endif +#if defined (COND_COMMAND) +static void cond_error __P((void)); +static COND_COM *cond_expr __P((void)); +static COND_COM *cond_or __P((void)); +static COND_COM *cond_and __P((void)); +static COND_COM *cond_term __P((void)); +static int cond_skip_newlines __P((void)); +static COMMAND *parse_cond_command __P((void)); +#endif +#if defined (ARRAY_VARS) +static int token_is_assignment __P((char *, int)); +static int token_is_ident __P((char *, int)); +#endif +static int read_token_word __P((int)); +static void discard_parser_constructs __P((int)); + +static char *error_token_from_token __P((int)); +static char *error_token_from_text __P((void)); +static void print_offending_line __P((void)); +static void report_syntax_error __P((char *)); + +static void handle_eof_input_unit __P((void)); +static void prompt_again __P((void)); +#if 0 +static void reset_readline_prompt __P((void)); +#endif +static void print_prompt __P((void)); + +#if defined (HANDLE_MULTIBYTE) +static void set_line_mbstate __P((void)); +static char *shell_input_line_property = NULL; +#else +# define set_line_mbstate() +#endif + +extern int yyerror __P((const char *)); + +#ifdef DEBUG +extern int yydebug; +#endif + +/* Default prompt strings */ +char *primary_prompt = PPROMPT; +char *secondary_prompt = SPROMPT; + +/* PROMPT_STRING_POINTER points to one of these, never to an actual string. */ +char *ps1_prompt, *ps2_prompt; + +/* Handle on the current prompt string. Indirectly points through + ps1_ or ps2_prompt. */ +char **prompt_string_pointer = (char **)NULL; +char *current_prompt_string; + +/* Non-zero means we expand aliases in commands. */ +int expand_aliases = 0; + +/* If non-zero, the decoded prompt string undergoes parameter and + variable substitution, command substitution, arithmetic substitution, + string expansion, process substitution, and quote removal in + decode_prompt_string. */ +int promptvars = 1; + +/* If non-zero, $'...' and $"..." are expanded when they appear within + a ${...} expansion, even when the expansion appears within double + quotes. */ +int extended_quote = 1; + +/* The number of lines read from input while creating the current command. */ +int current_command_line_count; + +/* The number of lines in a command saved while we run parse_and_execute */ +int saved_command_line_count; + +/* The token that currently denotes the end of parse. */ +int shell_eof_token; + +/* The token currently being read. */ +int current_token; + +/* The current parser state. */ +int parser_state; + +/* Variables to manage the task of reading here documents, because we need to + defer the reading until after a complete command has been collected. */ +static REDIRECT *redir_stack[10]; +int need_here_doc; + +/* Where shell input comes from. History expansion is performed on each + line when the shell is interactive. */ +static char *shell_input_line = (char *)NULL; +static size_t shell_input_line_index; +static size_t shell_input_line_size; /* Amount allocated for shell_input_line. */ +static size_t shell_input_line_len; /* strlen (shell_input_line) */ + +/* Either zero or EOF. */ +static int shell_input_line_terminator; + +/* The line number in a script on which a function definition starts. */ +static int function_dstart; + +/* The line number in a script on which a function body starts. */ +static int function_bstart; + +/* The line number in a script at which an arithmetic for command starts. */ +static int arith_for_lineno; + +/* The decoded prompt string. Used if READLINE is not defined or if + editing is turned off. Analogous to current_readline_prompt. */ +static char *current_decoded_prompt; + +/* The last read token, or NULL. read_token () uses this for context + checking. */ +static int last_read_token; + +/* The token read prior to last_read_token. */ +static int token_before_that; + +/* The token read prior to token_before_that. */ +static int two_tokens_ago; + +static int global_extglob; + +/* The line number in a script where the word in a `case WORD', `select WORD' + or `for WORD' begins. This is a nested command maximum, since the array + index is decremented after a case, select, or for command is parsed. */ +#define MAX_CASE_NEST 128 +static int word_lineno[MAX_CASE_NEST]; +static int word_top = -1; + +/* If non-zero, it is the token that we want read_token to return + regardless of what text is (or isn't) present to be read. This + is reset by read_token. If token_to_read == WORD or + ASSIGNMENT_WORD, yylval.word should be set to word_desc_to_read. */ +static int token_to_read; +static WORD_DESC *word_desc_to_read; + +static REDIRECTEE source; +static REDIRECTEE redir; +%} + +%union { + WORD_DESC *word; /* the word that we read. */ + int number; /* the number that we read. */ + WORD_LIST *word_list; + COMMAND *command; + REDIRECT *redirect; + ELEMENT element; + PATTERN_LIST *pattern; +} + +/* Reserved words. Members of the first group are only recognized + in the case that they are preceded by a list_terminator. Members + of the second group are for [[...]] commands. Members of the + third group are recognized only under special circumstances. */ +%token IF THEN ELSE ELIF FI CASE ESAC FOR SELECT WHILE UNTIL DO DONE FUNCTION COPROC +%token COND_START COND_END COND_ERROR +%token IN BANG TIME TIMEOPT TIMEIGN + +/* More general tokens. yylex () knows how to make these. */ +%token WORD ASSIGNMENT_WORD REDIR_WORD +%token NUMBER +%token ARITH_CMD ARITH_FOR_EXPRS +%token COND_CMD +%token AND_AND OR_OR GREATER_GREATER LESS_LESS LESS_AND LESS_LESS_LESS +%token GREATER_AND SEMI_SEMI SEMI_AND SEMI_SEMI_AND +%token LESS_LESS_MINUS AND_GREATER AND_GREATER_GREATER LESS_GREATER +%token GREATER_BAR BAR_AND + +/* The types that the various syntactical units return. */ + +%type inputunit command pipeline pipeline_command +%type list list0 list1 compound_list simple_list simple_list1 +%type simple_command shell_command +%type for_command select_command case_command group_command +%type arith_command +%type cond_command +%type arith_for_command +%type coproc +%type function_def function_body if_command elif_clause subshell +%type redirection redirection_list +%type simple_command_element +%type word_list pattern +%type pattern_list case_clause_sequence case_clause +%type timespec +%type list_terminator + +%start inputunit + +%left '&' ';' '\n' yacc_EOF +%left AND_AND OR_OR +%right '|' BAR_AND +%% + +inputunit: simple_list simple_list_terminator + { + /* Case of regular command. Discard the error + safety net,and return the command just parsed. */ + global_command = $1; + eof_encountered = 0; + /* discard_parser_constructs (0); */ + if (parser_state & PST_CMDSUBST) + parser_state |= PST_EOFTOKEN; + YYACCEPT; + } + | '\n' + { + /* Case of regular command, but not a very + interesting one. Return a NULL command. */ + global_command = (COMMAND *)NULL; + if (parser_state & PST_CMDSUBST) + parser_state |= PST_EOFTOKEN; + YYACCEPT; + } + | error '\n' + { + /* Error during parsing. Return NULL command. */ + global_command = (COMMAND *)NULL; + eof_encountered = 0; + /* discard_parser_constructs (1); */ + if (interactive && parse_and_execute_level == 0) + { + YYACCEPT; + } + else + { + YYABORT; + } + } + | yacc_EOF + { + /* Case of EOF seen by itself. Do ignoreeof or + not. */ + global_command = (COMMAND *)NULL; + handle_eof_input_unit (); + YYACCEPT; + } + ; + +word_list: WORD + { $$ = make_word_list ($1, (WORD_LIST *)NULL); } + | word_list WORD + { $$ = make_word_list ($2, $1); } + ; + +redirection: '>' WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_output_direction, redir, 0); + } + | '<' WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_input_direction, redir, 0); + } + | NUMBER '>' WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_output_direction, redir, 0); + } + | NUMBER '<' WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_input_direction, redir, 0); + } + | REDIR_WORD '>' WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_output_direction, redir, REDIR_VARASSIGN); + } + | REDIR_WORD '<' WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_input_direction, redir, REDIR_VARASSIGN); + } + | GREATER_GREATER WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_appending_to, redir, 0); + } + | NUMBER GREATER_GREATER WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_appending_to, redir, 0); + } + | REDIR_WORD GREATER_GREATER WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_appending_to, redir, REDIR_VARASSIGN); + } + | GREATER_BAR WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_output_force, redir, 0); + } + | NUMBER GREATER_BAR WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_output_force, redir, 0); + } + | REDIR_WORD GREATER_BAR WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_output_force, redir, REDIR_VARASSIGN); + } + | LESS_GREATER WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_input_output, redir, 0); + } + | NUMBER LESS_GREATER WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_input_output, redir, 0); + } + | REDIR_WORD LESS_GREATER WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_input_output, redir, REDIR_VARASSIGN); + } + | LESS_LESS WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_reading_until, redir, 0); + redir_stack[need_here_doc++] = $$; + } + | NUMBER LESS_LESS WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_reading_until, redir, 0); + redir_stack[need_here_doc++] = $$; + } + | REDIR_WORD LESS_LESS WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN); + redir_stack[need_here_doc++] = $$; + } + | LESS_LESS_MINUS WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_deblank_reading_until, redir, 0); + redir_stack[need_here_doc++] = $$; + } + | NUMBER LESS_LESS_MINUS WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_deblank_reading_until, redir, 0); + redir_stack[need_here_doc++] = $$; + } + | REDIR_WORD LESS_LESS_MINUS WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN); + redir_stack[need_here_doc++] = $$; + } + | LESS_LESS_LESS WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_reading_string, redir, 0); + } + | NUMBER LESS_LESS_LESS WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_reading_string, redir, 0); + } + | REDIR_WORD LESS_LESS_LESS WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_reading_string, redir, REDIR_VARASSIGN); + } + | LESS_AND NUMBER + { + source.dest = 0; + redir.dest = $2; + $$ = make_redirection (source, r_duplicating_input, redir, 0); + } + | NUMBER LESS_AND NUMBER + { + source.dest = $1; + redir.dest = $3; + $$ = make_redirection (source, r_duplicating_input, redir, 0); + } + | REDIR_WORD LESS_AND NUMBER + { + source.filename = $1; + redir.dest = $3; + $$ = make_redirection (source, r_duplicating_input, redir, REDIR_VARASSIGN); + } + | GREATER_AND NUMBER + { + source.dest = 1; + redir.dest = $2; + $$ = make_redirection (source, r_duplicating_output, redir, 0); + } + | NUMBER GREATER_AND NUMBER + { + source.dest = $1; + redir.dest = $3; + $$ = make_redirection (source, r_duplicating_output, redir, 0); + } + | REDIR_WORD GREATER_AND NUMBER + { + source.filename = $1; + redir.dest = $3; + $$ = make_redirection (source, r_duplicating_output, redir, REDIR_VARASSIGN); + } + | LESS_AND WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_duplicating_input_word, redir, 0); + } + | NUMBER LESS_AND WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_duplicating_input_word, redir, 0); + } + | REDIR_WORD LESS_AND WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_duplicating_input_word, redir, REDIR_VARASSIGN); + } + | GREATER_AND WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_duplicating_output_word, redir, 0); + } + | NUMBER GREATER_AND WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_duplicating_output_word, redir, 0); + } + | REDIR_WORD GREATER_AND WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_duplicating_output_word, redir, REDIR_VARASSIGN); + } + | GREATER_AND '-' + { + source.dest = 1; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, 0); + } + | NUMBER GREATER_AND '-' + { + source.dest = $1; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, 0); + } + | REDIR_WORD GREATER_AND '-' + { + source.filename = $1; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, REDIR_VARASSIGN); + } + | LESS_AND '-' + { + source.dest = 0; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, 0); + } + | NUMBER LESS_AND '-' + { + source.dest = $1; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, 0); + } + | REDIR_WORD LESS_AND '-' + { + source.filename = $1; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, REDIR_VARASSIGN); + } + | AND_GREATER WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_err_and_out, redir, 0); + } + | AND_GREATER_GREATER WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_append_err_and_out, redir, 0); + } + ; + +simple_command_element: WORD + { $$.word = $1; $$.redirect = 0; } + | ASSIGNMENT_WORD + { $$.word = $1; $$.redirect = 0; } + | redirection + { $$.redirect = $1; $$.word = 0; } + ; + +redirection_list: redirection + { + $$ = $1; + } + | redirection_list redirection + { + register REDIRECT *t; + + for (t = $1; t->next; t = t->next) + ; + t->next = $2; + $$ = $1; + } + ; + +simple_command: simple_command_element + { $$ = make_simple_command ($1, (COMMAND *)NULL); } + | simple_command simple_command_element + { $$ = make_simple_command ($2, $1); } + ; + +command: simple_command + { $$ = clean_simple_command ($1); } + | shell_command + { $$ = $1; } + | shell_command redirection_list + { + COMMAND *tc; + + tc = $1; + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = $2; + } + else + tc->redirects = $2; + $$ = $1; + } + | function_def + { $$ = $1; } + | coproc + { $$ = $1; } + ; + +shell_command: for_command + { $$ = $1; } + | case_command + { $$ = $1; } + | WHILE compound_list DO compound_list DONE + { $$ = make_while_command ($2, $4); } + | UNTIL compound_list DO compound_list DONE + { $$ = make_until_command ($2, $4); } + | select_command + { $$ = $1; } + | if_command + { $$ = $1; } + | subshell + { $$ = $1; } + | group_command + { $$ = $1; } + | arith_command + { $$ = $1; } + | cond_command + { $$ = $1; } + | arith_for_command + { $$ = $1; } + ; + +for_command: FOR WORD newline_list DO compound_list DONE + { + $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD newline_list '{' compound_list '}' + { + $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD ';' newline_list DO compound_list DONE + { + $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD ';' newline_list '{' compound_list '}' + { + $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD newline_list IN word_list list_terminator newline_list DO compound_list DONE + { + $$ = make_for_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD newline_list IN word_list list_terminator newline_list '{' compound_list '}' + { + $$ = make_for_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD newline_list IN list_terminator newline_list DO compound_list DONE + { + $$ = make_for_command ($2, (WORD_LIST *)NULL, $8, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD newline_list IN list_terminator newline_list '{' compound_list '}' + { + $$ = make_for_command ($2, (WORD_LIST *)NULL, $8, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + ; + +arith_for_command: FOR ARITH_FOR_EXPRS list_terminator newline_list DO compound_list DONE + { + $$ = make_arith_for_command ($2, $6, arith_for_lineno); + if (word_top > 0) word_top--; + } + | FOR ARITH_FOR_EXPRS list_terminator newline_list '{' compound_list '}' + { + $$ = make_arith_for_command ($2, $6, arith_for_lineno); + if (word_top > 0) word_top--; + } + | FOR ARITH_FOR_EXPRS DO compound_list DONE + { + $$ = make_arith_for_command ($2, $4, arith_for_lineno); + if (word_top > 0) word_top--; + } + | FOR ARITH_FOR_EXPRS '{' compound_list '}' + { + $$ = make_arith_for_command ($2, $4, arith_for_lineno); + if (word_top > 0) word_top--; + } + ; + +select_command: SELECT WORD newline_list DO list DONE + { + $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | SELECT WORD newline_list '{' list '}' + { + $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | SELECT WORD ';' newline_list DO list DONE + { + $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | SELECT WORD ';' newline_list '{' list '}' + { + $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | SELECT WORD newline_list IN word_list list_terminator newline_list DO list DONE + { + $$ = make_select_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | SELECT WORD newline_list IN word_list list_terminator newline_list '{' list '}' + { + $$ = make_select_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + ; + +case_command: CASE WORD newline_list IN newline_list ESAC + { + $$ = make_case_command ($2, (PATTERN_LIST *)NULL, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | CASE WORD newline_list IN case_clause_sequence newline_list ESAC + { + $$ = make_case_command ($2, $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | CASE WORD newline_list IN case_clause ESAC + { + $$ = make_case_command ($2, $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + ; + +function_def: WORD '(' ')' newline_list function_body + { $$ = make_function_def ($1, $5, function_dstart, function_bstart); } + + | FUNCTION WORD '(' ')' newline_list function_body + { $$ = make_function_def ($2, $6, function_dstart, function_bstart); } + + | FUNCTION WORD newline_list function_body + { $$ = make_function_def ($2, $4, function_dstart, function_bstart); } + ; + +function_body: shell_command + { $$ = $1; } + | shell_command redirection_list + { + COMMAND *tc; + + tc = $1; + /* According to Posix.2 3.9.5, redirections + specified after the body of a function should + be attached to the function and performed when + the function is executed, not as part of the + function definition command. */ + /* XXX - I don't think it matters, but we might + want to change this in the future to avoid + problems differentiating between a function + definition with a redirection and a function + definition containing a single command with a + redirection. The two are semantically equivalent, + though -- the only difference is in how the + command printing code displays the redirections. */ + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = $2; + } + else + tc->redirects = $2; + $$ = $1; + } + ; + +subshell: '(' compound_list ')' + { + $$ = make_subshell_command ($2); + $$->flags |= CMD_WANT_SUBSHELL; + } + ; + +coproc: COPROC shell_command + { + $$ = make_coproc_command ("COPROC", $2); + $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + | COPROC shell_command redirection_list + { + COMMAND *tc; + + tc = $2; + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = $3; + } + else + tc->redirects = $3; + $$ = make_coproc_command ("COPROC", $2); + $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + | COPROC WORD shell_command + { + $$ = make_coproc_command ($2->word, $3); + $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + | COPROC WORD shell_command redirection_list + { + COMMAND *tc; + + tc = $3; + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = $4; + } + else + tc->redirects = $4; + $$ = make_coproc_command ($2->word, $3); + $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + | COPROC simple_command + { + $$ = make_coproc_command ("COPROC", clean_simple_command ($2)); + $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + ; + +if_command: IF compound_list THEN compound_list FI + { $$ = make_if_command ($2, $4, (COMMAND *)NULL); } + | IF compound_list THEN compound_list ELSE compound_list FI + { $$ = make_if_command ($2, $4, $6); } + | IF compound_list THEN compound_list elif_clause FI + { $$ = make_if_command ($2, $4, $5); } + ; + + +group_command: '{' compound_list '}' + { $$ = make_group_command ($2); } + ; + +arith_command: ARITH_CMD + { $$ = make_arith_command ($1); } + ; + +cond_command: COND_START COND_CMD COND_END + { $$ = $2; } + ; + +elif_clause: ELIF compound_list THEN compound_list + { $$ = make_if_command ($2, $4, (COMMAND *)NULL); } + | ELIF compound_list THEN compound_list ELSE compound_list + { $$ = make_if_command ($2, $4, $6); } + | ELIF compound_list THEN compound_list elif_clause + { $$ = make_if_command ($2, $4, $5); } + ; + +case_clause: pattern_list + | case_clause_sequence pattern_list + { $2->next = $1; $$ = $2; } + ; + +pattern_list: newline_list pattern ')' compound_list + { $$ = make_pattern_list ($2, $4); } + | newline_list pattern ')' newline_list + { $$ = make_pattern_list ($2, (COMMAND *)NULL); } + | newline_list '(' pattern ')' compound_list + { $$ = make_pattern_list ($3, $5); } + | newline_list '(' pattern ')' newline_list + { $$ = make_pattern_list ($3, (COMMAND *)NULL); } + ; + +case_clause_sequence: pattern_list SEMI_SEMI + { $$ = $1; } + | case_clause_sequence pattern_list SEMI_SEMI + { $2->next = $1; $$ = $2; } + | pattern_list SEMI_AND + { $1->flags |= CASEPAT_FALLTHROUGH; $$ = $1; } + | case_clause_sequence pattern_list SEMI_AND + { $2->flags |= CASEPAT_FALLTHROUGH; $2->next = $1; $$ = $2; } + | pattern_list SEMI_SEMI_AND + { $1->flags |= CASEPAT_TESTNEXT; $$ = $1; } + | case_clause_sequence pattern_list SEMI_SEMI_AND + { $2->flags |= CASEPAT_TESTNEXT; $2->next = $1; $$ = $2; } + ; + +pattern: WORD + { $$ = make_word_list ($1, (WORD_LIST *)NULL); } + | pattern '|' WORD + { $$ = make_word_list ($3, $1); } + ; + +/* A list allows leading or trailing newlines and + newlines as operators (equivalent to semicolons). + It must end with a newline or semicolon. + Lists are used within commands such as if, for, while. */ + +list: newline_list list0 + { + $$ = $2; + if (need_here_doc) + gather_here_documents (); + } + ; + +compound_list: list + | newline_list list1 + { + $$ = $2; + } + ; + +list0: list1 '\n' newline_list + | list1 '&' newline_list + { + if ($1->type == cm_connection) + $$ = connect_async_list ($1, (COMMAND *)NULL, '&'); + else + $$ = command_connect ($1, (COMMAND *)NULL, '&'); + } + | list1 ';' newline_list + + ; + +list1: list1 AND_AND newline_list list1 + { $$ = command_connect ($1, $4, AND_AND); } + | list1 OR_OR newline_list list1 + { $$ = command_connect ($1, $4, OR_OR); } + | list1 '&' newline_list list1 + { + if ($1->type == cm_connection) + $$ = connect_async_list ($1, $4, '&'); + else + $$ = command_connect ($1, $4, '&'); + } + | list1 ';' newline_list list1 + { $$ = command_connect ($1, $4, ';'); } + | list1 '\n' newline_list list1 + { $$ = command_connect ($1, $4, ';'); } + | pipeline_command + { $$ = $1; } + ; + +simple_list_terminator: '\n' + | yacc_EOF + ; + +list_terminator:'\n' + { $$ = '\n'; } + | ';' + { $$ = ';'; } + | yacc_EOF + { $$ = yacc_EOF; } + ; + +newline_list: + | newline_list '\n' + ; + +/* A simple_list is a list that contains no significant newlines + and no leading or trailing newlines. Newlines are allowed + only following operators, where they are not significant. + + This is what an inputunit consists of. */ + +simple_list: simple_list1 + { + $$ = $1; + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = $1; + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + | simple_list1 '&' + { + if ($1->type == cm_connection) + $$ = connect_async_list ($1, (COMMAND *)NULL, '&'); + else + $$ = command_connect ($1, (COMMAND *)NULL, '&'); + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = $1; + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + | simple_list1 ';' + { + $$ = $1; + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = $1; + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + ; + +simple_list1: simple_list1 AND_AND newline_list simple_list1 + { $$ = command_connect ($1, $4, AND_AND); } + | simple_list1 OR_OR newline_list simple_list1 + { $$ = command_connect ($1, $4, OR_OR); } + | simple_list1 '&' simple_list1 + { + if ($1->type == cm_connection) + $$ = connect_async_list ($1, $3, '&'); + else + $$ = command_connect ($1, $3, '&'); + } + | simple_list1 ';' simple_list1 + { $$ = command_connect ($1, $3, ';'); } + + | pipeline_command + { $$ = $1; } + ; + +pipeline_command: pipeline + { $$ = $1; } + | BANG pipeline_command + { + if ($2) + $2->flags ^= CMD_INVERT_RETURN; /* toggle */ + $$ = $2; + } + | timespec pipeline_command + { + if ($2) + $2->flags |= $1; + $$ = $2; + } + | timespec list_terminator + { + ELEMENT x; + + /* Boy, this is unclean. `time' by itself can + time a null command. We cheat and push a + newline back if the list_terminator was a newline + to avoid the double-newline problem (one to + terminate this, one to terminate the command) */ + x.word = 0; + x.redirect = 0; + $$ = make_simple_command (x, (COMMAND *)NULL); + $$->flags |= $1; + /* XXX - let's cheat and push a newline back */ + if ($2 == '\n') + token_to_read = '\n'; + } + | BANG list_terminator + { + ELEMENT x; + + /* This is just as unclean. Posix says that `!' + by itself should be equivalent to `false'. + We cheat and push a + newline back if the list_terminator was a newline + to avoid the double-newline problem (one to + terminate this, one to terminate the command) */ + x.word = 0; + x.redirect = 0; + $$ = make_simple_command (x, (COMMAND *)NULL); + $$->flags |= CMD_INVERT_RETURN; + /* XXX - let's cheat and push a newline back */ + if ($2 == '\n') + token_to_read = '\n'; + } + ; + +pipeline: pipeline '|' newline_list pipeline + { $$ = command_connect ($1, $4, '|'); } + | pipeline BAR_AND newline_list pipeline + { + /* Make cmd1 |& cmd2 equivalent to cmd1 2>&1 | cmd2 */ + COMMAND *tc; + REDIRECTEE rd, sd; + REDIRECT *r; + + tc = $1->type == cm_simple ? (COMMAND *)$1->value.Simple : $1; + sd.dest = 2; + rd.dest = 1; + r = make_redirection (sd, r_duplicating_output, rd, 0); + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = r; + } + else + tc->redirects = r; + + $$ = command_connect ($1, $4, '|'); + } + | command + { $$ = $1; } + ; + +timespec: TIME + { $$ = CMD_TIME_PIPELINE; } + | TIME TIMEOPT + { $$ = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } + | TIME TIMEOPT TIMEIGN + { $$ = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } + ; +%% + +/* Initial size to allocate for tokens, and the + amount to grow them by. */ +#define TOKEN_DEFAULT_INITIAL_SIZE 496 +#define TOKEN_DEFAULT_GROW_SIZE 512 + +/* Should we call prompt_again? */ +#define SHOULD_PROMPT() \ + (interactive && (bash_input.type == st_stdin || bash_input.type == st_stream)) + +#if defined (ALIAS) +# define expanding_alias() (pushed_string_list && pushed_string_list->expander) +#else +# define expanding_alias() 0 +#endif + +/* Global var is non-zero when end of file has been reached. */ +int EOF_Reached = 0; + +#ifdef DEBUG +static void +debug_parser (i) + int i; +{ +#if YYDEBUG != 0 + yydebug = i; +#endif +} +#endif + +/* yy_getc () returns the next available character from input or EOF. + yy_ungetc (c) makes `c' the next character to read. + init_yy_io (get, unget, type, location) makes the function GET the + installed function for getting the next character, makes UNGET the + installed function for un-getting a character, sets the type of stream + (either string or file) from TYPE, and makes LOCATION point to where + the input is coming from. */ + +/* Unconditionally returns end-of-file. */ +int +return_EOF () +{ + return (EOF); +} + +/* Variable containing the current get and unget functions. + See ./input.h for a clearer description. */ +BASH_INPUT bash_input; + +/* Set all of the fields in BASH_INPUT to NULL. Free bash_input.name if it + is non-null, avoiding a memory leak. */ +void +initialize_bash_input () +{ + bash_input.type = st_none; + FREE (bash_input.name); + bash_input.name = (char *)NULL; + bash_input.location.file = (FILE *)NULL; + bash_input.location.string = (char *)NULL; + bash_input.getter = (sh_cget_func_t *)NULL; + bash_input.ungetter = (sh_cunget_func_t *)NULL; +} + +/* Set the contents of the current bash input stream from + GET, UNGET, TYPE, NAME, and LOCATION. */ +void +init_yy_io (get, unget, type, name, location) + sh_cget_func_t *get; + sh_cunget_func_t *unget; + enum stream_type type; + const char *name; + INPUT_STREAM location; +{ + bash_input.type = type; + FREE (bash_input.name); + bash_input.name = name ? savestring (name) : (char *)NULL; + + /* XXX */ +#if defined (CRAY) + memcpy((char *)&bash_input.location.string, (char *)&location.string, sizeof(location)); +#else + bash_input.location = location; +#endif + bash_input.getter = get; + bash_input.ungetter = unget; +} + +char * +yy_input_name () +{ + return (bash_input.name ? bash_input.name : "stdin"); +} + +/* Call this to get the next character of input. */ +static int +yy_getc () +{ + return (*(bash_input.getter)) (); +} + +/* Call this to unget C. That is, to make C the next character + to be read. */ +static int +yy_ungetc (c) + int c; +{ + return (*(bash_input.ungetter)) (c); +} + +#if defined (BUFFERED_INPUT) +#ifdef INCLUDE_UNUSED +int +input_file_descriptor () +{ + switch (bash_input.type) + { + case st_stream: + return (fileno (bash_input.location.file)); + case st_bstream: + return (bash_input.location.buffered_fd); + case st_stdin: + default: + return (fileno (stdin)); + } +} +#endif +#endif /* BUFFERED_INPUT */ + +/* **************************************************************** */ +/* */ +/* Let input be read from readline (). */ +/* */ +/* **************************************************************** */ + +#if defined (READLINE) +char *current_readline_prompt = (char *)NULL; +char *current_readline_line = (char *)NULL; +int current_readline_line_index = 0; + +static int +yy_readline_get () +{ + SigHandler *old_sigint; + int line_len; + unsigned char c; + + if (!current_readline_line) + { + if (!bash_readline_initialized) + initialize_readline (); + +#if defined (JOB_CONTROL) + if (job_control) + give_terminal_to (shell_pgrp, 0); +#endif /* JOB_CONTROL */ + + old_sigint = (SigHandler *)IMPOSSIBLE_TRAP_HANDLER; + if (signal_is_ignored (SIGINT) == 0) + { + /* interrupt_immediately++; */ + old_sigint = (SigHandler *)set_signal_handler (SIGINT, sigint_sighandler); + } + + current_readline_line = readline (current_readline_prompt ? + current_readline_prompt : ""); + + CHECK_TERMSIG; + if (signal_is_ignored (SIGINT) == 0) + { + /* interrupt_immediately--; */ + if (old_sigint != IMPOSSIBLE_TRAP_HANDLER) + set_signal_handler (SIGINT, old_sigint); + } + +#if 0 + /* Reset the prompt to the decoded value of prompt_string_pointer. */ + reset_readline_prompt (); +#endif + + if (current_readline_line == 0) + return (EOF); + + current_readline_line_index = 0; + line_len = strlen (current_readline_line); + + current_readline_line = (char *)xrealloc (current_readline_line, 2 + line_len); + current_readline_line[line_len++] = '\n'; + current_readline_line[line_len] = '\0'; + } + + if (current_readline_line[current_readline_line_index] == 0) + { + free (current_readline_line); + current_readline_line = (char *)NULL; + return (yy_readline_get ()); + } + else + { + c = current_readline_line[current_readline_line_index++]; + return (c); + } +} + +static int +yy_readline_unget (c) + int c; +{ + if (current_readline_line_index && current_readline_line) + current_readline_line[--current_readline_line_index] = c; + return (c); +} + +void +with_input_from_stdin () +{ + INPUT_STREAM location; + + if (bash_input.type != st_stdin && stream_on_stack (st_stdin) == 0) + { + location.string = current_readline_line; + init_yy_io (yy_readline_get, yy_readline_unget, + st_stdin, "readline stdin", location); + } +} + +#else /* !READLINE */ + +void +with_input_from_stdin () +{ + with_input_from_stream (stdin, "stdin"); +} +#endif /* !READLINE */ + +/* **************************************************************** */ +/* */ +/* Let input come from STRING. STRING is zero terminated. */ +/* */ +/* **************************************************************** */ + +static int +yy_string_get () +{ + register char *string; + register unsigned char c; + + string = bash_input.location.string; + + /* If the string doesn't exist, or is empty, EOF found. */ + if (string && *string) + { + c = *string++; + bash_input.location.string = string; + return (c); + } + else + return (EOF); +} + +static int +yy_string_unget (c) + int c; +{ + *(--bash_input.location.string) = c; + return (c); +} + +void +with_input_from_string (string, name) + char *string; + const char *name; +{ + INPUT_STREAM location; + + location.string = string; + init_yy_io (yy_string_get, yy_string_unget, st_string, name, location); +} + +/* Count the number of characters we've consumed from bash_input.location.string + and read into shell_input_line, but have not returned from shell_getc. + That is the true input location. Rewind bash_input.location.string by + that number of characters, so it points to the last character actually + consumed by the parser. */ +static void +rewind_input_string () +{ + int xchars; + + /* number of unconsumed characters in the input -- XXX need to take newlines + into account, e.g., $(...\n) */ + xchars = shell_input_line_len - shell_input_line_index; + if (bash_input.location.string[-1] == '\n') + xchars++; + + /* XXX - how to reflect bash_input.location.string back to string passed to + parse_and_execute or xparse_dolparen? xparse_dolparen needs to know how + far into the string we parsed. parse_and_execute knows where bash_input. + location.string is, and how far from orig_string that is -- that's the + number of characters the command consumed. */ + + /* bash_input.location.string - xchars should be where we parsed to */ + /* need to do more validation on xchars value for sanity -- test cases. */ + bash_input.location.string -= xchars; +} + +/* **************************************************************** */ +/* */ +/* Let input come from STREAM. */ +/* */ +/* **************************************************************** */ + +/* These two functions used to test the value of the HAVE_RESTARTABLE_SYSCALLS + define, and just use getc/ungetc if it was defined, but since bash + installs its signal handlers without the SA_RESTART flag, some signals + (like SIGCHLD, SIGWINCH, etc.) received during a read(2) will not cause + the read to be restarted. We need to restart it ourselves. */ + +static int +yy_stream_get () +{ + int result; + + result = EOF; + if (bash_input.location.file) + { +#if 0 + if (interactive) + interrupt_immediately++; +#endif + + /* XXX - don't need terminate_immediately; getc_with_restart checks + for terminating signals itself if read returns < 0 */ + result = getc_with_restart (bash_input.location.file); + +#if 0 + if (interactive) + interrupt_immediately--; +#endif + } + return (result); +} + +static int +yy_stream_unget (c) + int c; +{ + return (ungetc_with_restart (c, bash_input.location.file)); +} + +void +with_input_from_stream (stream, name) + FILE *stream; + const char *name; +{ + INPUT_STREAM location; + + location.file = stream; + init_yy_io (yy_stream_get, yy_stream_unget, st_stream, name, location); +} + +typedef struct stream_saver { + struct stream_saver *next; + BASH_INPUT bash_input; + int line; +#if defined (BUFFERED_INPUT) + BUFFERED_STREAM *bstream; +#endif /* BUFFERED_INPUT */ +} STREAM_SAVER; + +/* The globally known line number. */ +int line_number = 0; + +/* The line number offset set by assigning to LINENO. Not currently used. */ +int line_number_base = 0; + +#if defined (COND_COMMAND) +static int cond_lineno; +static int cond_token; +#endif + +STREAM_SAVER *stream_list = (STREAM_SAVER *)NULL; + +void +push_stream (reset_lineno) + int reset_lineno; +{ + STREAM_SAVER *saver = (STREAM_SAVER *)xmalloc (sizeof (STREAM_SAVER)); + + xbcopy ((char *)&bash_input, (char *)&(saver->bash_input), sizeof (BASH_INPUT)); + +#if defined (BUFFERED_INPUT) + saver->bstream = (BUFFERED_STREAM *)NULL; + /* If we have a buffered stream, clear out buffers[fd]. */ + if (bash_input.type == st_bstream && bash_input.location.buffered_fd >= 0) + saver->bstream = set_buffered_stream (bash_input.location.buffered_fd, + (BUFFERED_STREAM *)NULL); +#endif /* BUFFERED_INPUT */ + + saver->line = line_number; + bash_input.name = (char *)NULL; + saver->next = stream_list; + stream_list = saver; + EOF_Reached = 0; + if (reset_lineno) + line_number = 0; +} + +void +pop_stream () +{ + if (!stream_list) + EOF_Reached = 1; + else + { + STREAM_SAVER *saver = stream_list; + + EOF_Reached = 0; + stream_list = stream_list->next; + + init_yy_io (saver->bash_input.getter, + saver->bash_input.ungetter, + saver->bash_input.type, + saver->bash_input.name, + saver->bash_input.location); + +#if defined (BUFFERED_INPUT) + /* If we have a buffered stream, restore buffers[fd]. */ + /* If the input file descriptor was changed while this was on the + save stack, update the buffered fd to the new file descriptor and + re-establish the buffer <-> bash_input fd correspondence. */ + if (bash_input.type == st_bstream && bash_input.location.buffered_fd >= 0) + { + if (bash_input_fd_changed) + { + bash_input_fd_changed = 0; + if (default_buffered_input >= 0) + { + bash_input.location.buffered_fd = default_buffered_input; + saver->bstream->b_fd = default_buffered_input; + SET_CLOSE_ON_EXEC (default_buffered_input); + } + } + /* XXX could free buffered stream returned as result here. */ + set_buffered_stream (bash_input.location.buffered_fd, saver->bstream); + } +#endif /* BUFFERED_INPUT */ + + line_number = saver->line; + + FREE (saver->bash_input.name); + free (saver); + } +} + +/* Return 1 if a stream of type TYPE is saved on the stack. */ +int +stream_on_stack (type) + enum stream_type type; +{ + register STREAM_SAVER *s; + + for (s = stream_list; s; s = s->next) + if (s->bash_input.type == type) + return 1; + return 0; +} + +/* Save the current token state and return it in a malloced array. */ +int * +save_token_state () +{ + int *ret; + + ret = (int *)xmalloc (4 * sizeof (int)); + ret[0] = last_read_token; + ret[1] = token_before_that; + ret[2] = two_tokens_ago; + ret[3] = current_token; + return ret; +} + +void +restore_token_state (ts) + int *ts; +{ + if (ts == 0) + return; + last_read_token = ts[0]; + token_before_that = ts[1]; + two_tokens_ago = ts[2]; + current_token = ts[3]; +} + +/* + * This is used to inhibit alias expansion and reserved word recognition + * inside case statement pattern lists. A `case statement pattern list' is: + * + * everything between the `in' in a `case word in' and the next ')' + * or `esac' + * everything between a `;;' and the next `)' or `esac' + */ + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + +#define END_OF_ALIAS 0 + +/* + * Pseudo-global variables used in implementing token-wise alias expansion. + */ + +/* + * Pushing and popping strings. This works together with shell_getc to + * implement alias expansion on a per-token basis. + */ + +#define PSH_ALIAS 0x01 +#define PSH_DPAREN 0x02 +#define PSH_SOURCE 0x04 + +typedef struct string_saver { + struct string_saver *next; + int expand_alias; /* Value to set expand_alias to when string is popped. */ + char *saved_line; +#if defined (ALIAS) + alias_t *expander; /* alias that caused this line to be pushed. */ +#endif + size_t saved_line_size, saved_line_index; + int saved_line_terminator; + int flags; +} STRING_SAVER; + +STRING_SAVER *pushed_string_list = (STRING_SAVER *)NULL; + +/* + * Push the current shell_input_line onto a stack of such lines and make S + * the current input. Used when expanding aliases. EXPAND is used to set + * the value of expand_next_token when the string is popped, so that the + * word after the alias in the original line is handled correctly when the + * alias expands to multiple words. TOKEN is the token that was expanded + * into S; it is saved and used to prevent infinite recursive expansion. + */ +static void +push_string (s, expand, ap) + char *s; + int expand; + alias_t *ap; +{ + STRING_SAVER *temp = (STRING_SAVER *)xmalloc (sizeof (STRING_SAVER)); + + temp->expand_alias = expand; + temp->saved_line = shell_input_line; + temp->saved_line_size = shell_input_line_size; + temp->saved_line_index = shell_input_line_index; + temp->saved_line_terminator = shell_input_line_terminator; + temp->flags = 0; +#if defined (ALIAS) + temp->expander = ap; + if (ap) + temp->flags = PSH_ALIAS; +#endif + temp->next = pushed_string_list; + pushed_string_list = temp; + +#if defined (ALIAS) + if (ap) + ap->flags |= AL_BEINGEXPANDED; +#endif + + shell_input_line = s; + shell_input_line_size = STRLEN (s); + shell_input_line_index = 0; + shell_input_line_terminator = '\0'; +#if 0 + parser_state &= ~PST_ALEXPNEXT; /* XXX */ +#endif + + set_line_mbstate (); +} + +/* + * Make the top of the pushed_string stack be the current shell input. + * Only called when there is something on the stack. Called from shell_getc + * when it thinks it has consumed the string generated by an alias expansion + * and needs to return to the original input line. + */ +static void +pop_string () +{ + STRING_SAVER *t; + + FREE (shell_input_line); + shell_input_line = pushed_string_list->saved_line; + shell_input_line_index = pushed_string_list->saved_line_index; + shell_input_line_size = pushed_string_list->saved_line_size; + shell_input_line_terminator = pushed_string_list->saved_line_terminator; + + if (pushed_string_list->expand_alias) + parser_state |= PST_ALEXPNEXT; + else + parser_state &= ~PST_ALEXPNEXT; + + t = pushed_string_list; + pushed_string_list = pushed_string_list->next; + +#if defined (ALIAS) + if (t->expander) + t->expander->flags &= ~AL_BEINGEXPANDED; +#endif + + free ((char *)t); + + set_line_mbstate (); +} + +static void +free_string_list () +{ + register STRING_SAVER *t, *t1; + + for (t = pushed_string_list; t; ) + { + t1 = t->next; + FREE (t->saved_line); +#if defined (ALIAS) + if (t->expander) + t->expander->flags &= ~AL_BEINGEXPANDED; +#endif + free ((char *)t); + t = t1; + } + pushed_string_list = (STRING_SAVER *)NULL; +} + +#endif /* ALIAS || DPAREN_ARITHMETIC */ + +void +free_pushed_string_input () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + free_string_list (); +#endif +} + +int +parser_expanding_alias () +{ + return (expanding_alias ()); +} + +void +parser_save_alias () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + push_string ((char *)NULL, 0, (alias_t *)NULL); + pushed_string_list->flags = PSH_SOURCE; /* XXX - for now */ +#else + ; +#endif +} + +void +parser_restore_alias () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + if (pushed_string_list) + pop_string (); +#else + ; +#endif +} + +/* Return a line of text, taken from wherever yylex () reads input. + If there is no more input, then we return NULL. If REMOVE_QUOTED_NEWLINE + is non-zero, we remove unquoted \ pairs. This is used by + read_secondary_line to read here documents. */ +static char * +read_a_line (remove_quoted_newline) + int remove_quoted_newline; +{ + static char *line_buffer = (char *)NULL; + static int buffer_size = 0; + int indx, c, peekc, pass_next; + +#if defined (READLINE) + if (no_line_editing && SHOULD_PROMPT ()) +#else + if (SHOULD_PROMPT ()) +#endif + print_prompt (); + + pass_next = indx = 0; + while (1) + { + /* Allow immediate exit if interrupted during input. */ + QUIT; + + c = yy_getc (); + + /* Ignore null bytes in input. */ + if (c == 0) + { +#if 0 + internal_warning ("read_a_line: ignored null byte in input"); +#endif + continue; + } + + /* If there is no more input, then we return NULL. */ + if (c == EOF) + { + if (interactive && bash_input.type == st_stream) + clearerr (stdin); + if (indx == 0) + return ((char *)NULL); + c = '\n'; + } + + /* `+2' in case the final character in the buffer is a newline. */ + RESIZE_MALLOCED_BUFFER (line_buffer, indx, 2, buffer_size, 128); + + /* IF REMOVE_QUOTED_NEWLINES is non-zero, we are reading a + here document with an unquoted delimiter. In this case, + the line will be expanded as if it were in double quotes. + We allow a backslash to escape the next character, but we + need to treat the backslash specially only if a backslash + quoting a backslash-newline pair appears in the line. */ + if (pass_next) + { + line_buffer[indx++] = c; + pass_next = 0; + } + else if (c == '\\' && remove_quoted_newline) + { + QUIT; + peekc = yy_getc (); + if (peekc == '\n') + { + line_number++; + continue; /* Make the unquoted \ pair disappear. */ + } + else + { + yy_ungetc (peekc); + pass_next = 1; + line_buffer[indx++] = c; /* Preserve the backslash. */ + } + } + else + line_buffer[indx++] = c; + + if (c == '\n') + { + line_buffer[indx] = '\0'; + return (line_buffer); + } + } +} + +/* Return a line as in read_a_line (), but insure that the prompt is + the secondary prompt. This is used to read the lines of a here + document. REMOVE_QUOTED_NEWLINE is non-zero if we should remove + newlines quoted with backslashes while reading the line. It is + non-zero unless the delimiter of the here document was quoted. */ +char * +read_secondary_line (remove_quoted_newline) + int remove_quoted_newline; +{ + char *ret; + int n, c; + + prompt_string_pointer = &ps2_prompt; + if (SHOULD_PROMPT()) + prompt_again (); + ret = read_a_line (remove_quoted_newline); +#if defined (HISTORY) + if (ret && remember_on_history && (parser_state & PST_HEREDOC)) + { + /* To make adding the the here-document body right, we need to rely + on history_delimiting_chars() returning \n for the first line of + the here-document body and the null string for the second and + subsequent lines, so we avoid double newlines. + current_command_line_count == 2 for the first line of the body. */ + + current_command_line_count++; + maybe_add_history (ret); + } +#endif /* HISTORY */ + return ret; +} + +/* **************************************************************** */ +/* */ +/* YYLEX () */ +/* */ +/* **************************************************************** */ + +/* Reserved words. These are only recognized as the first word of a + command. */ +STRING_INT_ALIST word_token_alist[] = { + { "if", IF }, + { "then", THEN }, + { "else", ELSE }, + { "elif", ELIF }, + { "fi", FI }, + { "case", CASE }, + { "esac", ESAC }, + { "for", FOR }, +#if defined (SELECT_COMMAND) + { "select", SELECT }, +#endif + { "while", WHILE }, + { "until", UNTIL }, + { "do", DO }, + { "done", DONE }, + { "in", IN }, + { "function", FUNCTION }, +#if defined (COMMAND_TIMING) + { "time", TIME }, +#endif + { "{", '{' }, + { "}", '}' }, + { "!", BANG }, +#if defined (COND_COMMAND) + { "[[", COND_START }, + { "]]", COND_END }, +#endif +#if defined (COPROCESS_SUPPORT) + { "coproc", COPROC }, +#endif + { (char *)NULL, 0} +}; + +/* other tokens that can be returned by read_token() */ +STRING_INT_ALIST other_token_alist[] = { + /* Multiple-character tokens with special values */ + { "--", TIMEIGN }, + { "-p", TIMEOPT }, + { "&&", AND_AND }, + { "||", OR_OR }, + { ">>", GREATER_GREATER }, + { "<<", LESS_LESS }, + { "<&", LESS_AND }, + { ">&", GREATER_AND }, + { ";;", SEMI_SEMI }, + { ";&", SEMI_AND }, + { ";;&", SEMI_SEMI_AND }, + { "<<-", LESS_LESS_MINUS }, + { "<<<", LESS_LESS_LESS }, + { "&>", AND_GREATER }, + { "&>>", AND_GREATER_GREATER }, + { "<>", LESS_GREATER }, + { ">|", GREATER_BAR }, + { "|&", BAR_AND }, + { "EOF", yacc_EOF }, + /* Tokens whose value is the character itself */ + { ">", '>' }, + { "<", '<' }, + { "-", '-' }, + { "{", '{' }, + { "}", '}' }, + { ";", ';' }, + { "(", '(' }, + { ")", ')' }, + { "|", '|' }, + { "&", '&' }, + { "newline", '\n' }, + { (char *)NULL, 0} +}; + +/* others not listed here: + WORD look at yylval.word + ASSIGNMENT_WORD look at yylval.word + NUMBER look at yylval.number + ARITH_CMD look at yylval.word_list + ARITH_FOR_EXPRS look at yylval.word_list + COND_CMD look at yylval.command +*/ + +/* These are used by read_token_word, but appear up here so that shell_getc + can use them to decide when to add otherwise blank lines to the history. */ + +/* The primary delimiter stack. */ +struct dstack dstack = { (char *)NULL, 0, 0 }; + +/* A temporary delimiter stack to be used when decoding prompt strings. + This is needed because command substitutions in prompt strings (e.g., PS2) + can screw up the parser's quoting state. */ +static struct dstack temp_dstack = { (char *)NULL, 0, 0 }; + +/* Macro for accessing the top delimiter on the stack. Returns the + delimiter or zero if none. */ +#define current_delimiter(ds) \ + (ds.delimiter_depth ? ds.delimiters[ds.delimiter_depth - 1] : 0) + +#define push_delimiter(ds, character) \ + do \ + { \ + if (ds.delimiter_depth + 2 > ds.delimiter_space) \ + ds.delimiters = (char *)xrealloc \ + (ds.delimiters, (ds.delimiter_space += 10) * sizeof (char)); \ + ds.delimiters[ds.delimiter_depth] = character; \ + ds.delimiter_depth++; \ + } \ + while (0) + +#define pop_delimiter(ds) ds.delimiter_depth-- + +/* Return the next shell input character. This always reads characters + from shell_input_line; when that line is exhausted, it is time to + read the next line. This is called by read_token when the shell is + processing normal command input. */ + +/* This implements one-character lookahead/lookbehind across physical input + lines, to avoid something being lost because it's pushed back with + shell_ungetc when we're at the start of a line. */ +static int eol_ungetc_lookahead = 0; + +static int +shell_getc (remove_quoted_newline) + int remove_quoted_newline; +{ + register int i; + int c, truncating; + unsigned char uc; + + QUIT; + + if (sigwinch_received) + { + sigwinch_received = 0; + get_new_window_size (0, (int *)0, (int *)0); + } + + if (eol_ungetc_lookahead) + { + c = eol_ungetc_lookahead; + eol_ungetc_lookahead = 0; + return (c); + } + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* If shell_input_line[shell_input_line_index] == 0, but there is + something on the pushed list of strings, then we don't want to go + off and get another line. We let the code down below handle it. */ + + if (!shell_input_line || ((!shell_input_line[shell_input_line_index]) && + (pushed_string_list == (STRING_SAVER *)NULL))) +#else /* !ALIAS && !DPAREN_ARITHMETIC */ + if (!shell_input_line || !shell_input_line[shell_input_line_index]) +#endif /* !ALIAS && !DPAREN_ARITHMETIC */ + { + line_number++; + + /* Let's not let one really really long line blow up memory allocation */ + if (shell_input_line && shell_input_line_size >= 32768) + { + free (shell_input_line); + shell_input_line = 0; + shell_input_line_size = 0; + } + + restart_read: + + /* Allow immediate exit if interrupted during input. */ + QUIT; + + i = truncating = 0; + shell_input_line_terminator = 0; + + /* If the shell is interatctive, but not currently printing a prompt + (interactive_shell && interactive == 0), we don't want to print + notifies or cleanup the jobs -- we want to defer it until we do + print the next prompt. */ + if (interactive_shell == 0 || SHOULD_PROMPT()) + { +#if defined (JOB_CONTROL) + /* This can cause a problem when reading a command as the result + of a trap, when the trap is called from flush_child. This call + had better not cause jobs to disappear from the job table in + that case, or we will have big trouble. */ + notify_and_cleanup (); +#else /* !JOB_CONTROL */ + cleanup_dead_jobs (); +#endif /* !JOB_CONTROL */ + } + +#if defined (READLINE) + if (no_line_editing && SHOULD_PROMPT()) +#else + if (SHOULD_PROMPT()) +#endif + print_prompt (); + + if (bash_input.type == st_stream) + clearerr (stdin); + + while (1) + { + c = yy_getc (); + + /* Allow immediate exit if interrupted during input. */ + QUIT; + + if (c == '\0') + { +#if 0 + internal_warning ("shell_getc: ignored null byte in input"); +#endif + continue; + } + + /* Theoretical overflow */ + /* If we can't put 256 bytes more into the buffer, allocate + everything we can and fill it as full as we can. */ + /* XXX - we ignore rest of line using `truncating' flag */ + if (shell_input_line_size > (SIZE_MAX - 256)) + { + size_t n; + + n = SIZE_MAX - i; /* how much more can we put into the buffer? */ + if (n <= 2) /* we have to save 1 for the newline added below */ + { + if (truncating == 0) + internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%llu): line truncated", shell_input_line_size, SIZE_MAX); + shell_input_line[i] = '\0'; + truncating = 1; + } + if (shell_input_line_size < SIZE_MAX) + { + shell_input_line_size = SIZE_MAX; + shell_input_line = xrealloc (shell_input_line, shell_input_line_size); + } + } + else + RESIZE_MALLOCED_BUFFER (shell_input_line, i, 2, shell_input_line_size, 256); + + if (c == EOF) + { + if (bash_input.type == st_stream) + clearerr (stdin); + + if (i == 0) + shell_input_line_terminator = EOF; + + shell_input_line[i] = '\0'; + break; + } + + if (truncating == 0 || c == '\n') + shell_input_line[i++] = c; + + if (c == '\n') + { + shell_input_line[--i] = '\0'; + current_command_line_count++; + break; + } + } + + shell_input_line_index = 0; + shell_input_line_len = i; /* == strlen (shell_input_line) */ + + set_line_mbstate (); + +#if defined (HISTORY) + if (remember_on_history && shell_input_line && shell_input_line[0]) + { + char *expansions; +# if defined (BANG_HISTORY) + int old_hist; + + /* If the current delimiter is a single quote, we should not be + performing history expansion, even if we're on a different + line from the original single quote. */ + old_hist = history_expansion_inhibited; + if (current_delimiter (dstack) == '\'') + history_expansion_inhibited = 1; +# endif + expansions = pre_process_line (shell_input_line, 1, 1); +# if defined (BANG_HISTORY) + history_expansion_inhibited = old_hist; +# endif + if (expansions != shell_input_line) + { + free (shell_input_line); + shell_input_line = expansions; + shell_input_line_len = shell_input_line ? + strlen (shell_input_line) : 0; + if (shell_input_line_len == 0) + current_command_line_count--; + + /* We have to force the xrealloc below because we don't know + the true allocated size of shell_input_line anymore. */ + shell_input_line_size = shell_input_line_len; + + set_line_mbstate (); + } + } + /* Try to do something intelligent with blank lines encountered while + entering multi-line commands. XXX - this is grotesque */ + else if (remember_on_history && shell_input_line && + shell_input_line[0] == '\0' && + current_command_line_count > 1) + { + if (current_delimiter (dstack)) + /* We know shell_input_line[0] == 0 and we're reading some sort of + quoted string. This means we've got a line consisting of only + a newline in a quoted string. We want to make sure this line + gets added to the history. */ + maybe_add_history (shell_input_line); + else + { + char *hdcs; + hdcs = history_delimiting_chars (shell_input_line); + if (hdcs && hdcs[0] == ';') + maybe_add_history (shell_input_line); + } + } + +#endif /* HISTORY */ + + if (shell_input_line) + { + /* Lines that signify the end of the shell's input should not be + echoed. We should not echo lines while parsing command + substitutions with recursive calls into the parsing engine; those + should only be echoed once when we read the word. That is the + reason for the test against shell_eof_token, which is set to a + right paren when parsing the contents of command substitutions. */ + if (echo_input_at_read && (shell_input_line[0] || + shell_input_line_terminator != EOF) && + shell_eof_token == 0) + fprintf (stderr, "%s\n", shell_input_line); + } + else + { + shell_input_line_size = 0; + prompt_string_pointer = ¤t_prompt_string; + if (SHOULD_PROMPT ()) + prompt_again (); + goto restart_read; + } + + /* Add the newline to the end of this string, iff the string does + not already end in an EOF character. */ + if (shell_input_line_terminator != EOF) + { + if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size)) + shell_input_line = (char *)xrealloc (shell_input_line, + 1 + (shell_input_line_size += 2)); + + shell_input_line[shell_input_line_len] = '\n'; + shell_input_line[shell_input_line_len + 1] = '\0'; + + set_line_mbstate (); + } + } + +next_alias_char: + uc = shell_input_line[shell_input_line_index]; + + if (uc) + shell_input_line_index++; + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* If UC is NULL, we have reached the end of the current input string. If + pushed_string_list is non-empty, it's time to pop to the previous string + because we have fully consumed the result of the last alias expansion. + Do it transparently; just return the next character of the string popped + to. */ + /* If pushed_string_list != 0 but pushed_string_list->expander == 0 (not + currently tested) and the flags value is not PSH_SOURCE, we are not + parsing an alias, we have just saved one (push_string, when called by + the parse_dparen code) In this case, just go on as well. The PSH_SOURCE + case is handled below. */ +pop_alias: + if (uc == 0 && pushed_string_list && pushed_string_list->flags != PSH_SOURCE) + { + pop_string (); + uc = shell_input_line[shell_input_line_index]; + if (uc) + shell_input_line_index++; + } +#endif /* ALIAS || DPAREN_ARITHMETIC */ + + if MBTEST(uc == '\\' && remove_quoted_newline && shell_input_line[shell_input_line_index] == '\n') + { + if (SHOULD_PROMPT ()) + prompt_again (); + line_number++; + /* What do we do here if we're expanding an alias whose definition + includes an escaped newline? If that's the last character in the + alias expansion, we just pop the pushed string list (recall that + we inhibit the appending of a space in mk_alexpansion() if newline + is the last character). If it's not the last character, we need + to consume the quoted newline and move to the next character in + the expansion. */ +#if defined (ALIAS) + if (expanding_alias () && shell_input_line[shell_input_line_index+1] == '\0') + { + uc = 0; + goto pop_alias; + } + else if (expanding_alias () && shell_input_line[shell_input_line_index+1] != '\0') + { + shell_input_line_index++; /* skip newline */ + goto next_alias_char; /* and get next character */ + } + else +#endif + goto restart_read; + } + + if (uc == 0 && shell_input_line_terminator == EOF) + return ((shell_input_line_index != 0) ? '\n' : EOF); + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* We already know that we are not parsing an alias expansion because of the + check for expanding_alias() above. This knows how parse_and_execute + handles switching to st_string input while an alias is being expanded, + hence the check for pushed_string_list without pushed_string_list->expander + and the check for PSH_SOURCE as pushed_string_list->flags. + parse_and_execute and parse_string both change the input type to st_string + and place the string to be parsed and executed into location.string, so + we should not stop reading that until the pointer is '\0'. + The check for shell_input_line_terminator may be superfluous. + + This solves the problem of `.' inside a multi-line alias with embedded + newlines executing things out of order. */ + if (uc == 0 && bash_input.type == st_string && *bash_input.location.string && + pushed_string_list && pushed_string_list->flags == PSH_SOURCE && + shell_input_line_terminator == 0) + { + shell_input_line_index = 0; + goto restart_read; + } +#endif + + return (uc); +} + +/* Put C back into the input for the shell. This might need changes for + HANDLE_MULTIBYTE around EOLs. Since we (currently) never push back a + character different than we read, shell_input_line_property doesn't need + to change when manipulating shell_input_line. The define for + last_shell_getc_is_singlebyte should take care of it, though. */ +static void +shell_ungetc (c) + int c; +{ + if (shell_input_line && shell_input_line_index) + shell_input_line[--shell_input_line_index] = c; + else + eol_ungetc_lookahead = c; +} + +#ifdef INCLUDE_UNUSED +/* Back the input pointer up by one, effectively `ungetting' a character. */ +static void +shell_ungetchar () +{ + if (shell_input_line && shell_input_line_index) + shell_input_line_index--; +} +#endif + +/* Discard input until CHARACTER is seen, then push that character back + onto the input stream. */ +static void +discard_until (character) + int character; +{ + int c; + + while ((c = shell_getc (0)) != EOF && c != character) + ; + + if (c != EOF) + shell_ungetc (c); +} + +void +execute_variable_command (command, vname) + char *command, *vname; +{ + char *last_lastarg; + sh_parser_state_t ps; + + save_parser_state (&ps); + last_lastarg = get_string_value ("_"); + if (last_lastarg) + last_lastarg = savestring (last_lastarg); + + parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEVAL_NOHIST); + + restore_parser_state (&ps); + bind_variable ("_", last_lastarg, 0); + FREE (last_lastarg); + + if (token_to_read == '\n') /* reset_parser was called */ + token_to_read = 0; +} + +/* Place to remember the token. We try to keep the buffer + at a reasonable size, but it can grow. */ +static char *token = (char *)NULL; + +/* Current size of the token buffer. */ +static int token_buffer_size; + +/* Command to read_token () explaining what we want it to do. */ +#define READ 0 +#define RESET 1 +#define prompt_is_ps1 \ + (!prompt_string_pointer || prompt_string_pointer == &ps1_prompt) + +/* Function for yyparse to call. yylex keeps track of + the last two tokens read, and calls read_token. */ +static int +yylex () +{ + if (interactive && (current_token == 0 || current_token == '\n')) + { + /* Before we print a prompt, we might have to check mailboxes. + We do this only if it is time to do so. Notice that only here + is the mail alarm reset; nothing takes place in check_mail () + except the checking of mail. Please don't change this. */ + if (prompt_is_ps1 && parse_and_execute_level == 0 && time_to_check_mail ()) + { + check_mail (); + reset_mail_timer (); + } + + /* Avoid printing a prompt if we're not going to read anything, e.g. + after resetting the parser with read_token (RESET). */ + if (token_to_read == 0 && SHOULD_PROMPT ()) + prompt_again (); + } + + two_tokens_ago = token_before_that; + token_before_that = last_read_token; + last_read_token = current_token; + current_token = read_token (READ); + + if ((parser_state & PST_EOFTOKEN) && current_token == shell_eof_token) + { + current_token = yacc_EOF; + if (bash_input.type == st_string) + rewind_input_string (); + } + parser_state &= ~PST_EOFTOKEN; + + return (current_token); +} + +/* When non-zero, we have read the required tokens + which allow ESAC to be the next one read. */ +static int esacs_needed_count; + +void +gather_here_documents () +{ + int r; + + r = 0; + while (need_here_doc) + { + parser_state |= PST_HEREDOC; + make_here_document (redir_stack[r++], line_number); + parser_state &= ~PST_HEREDOC; + need_here_doc--; + } +} + +/* When non-zero, an open-brace used to create a group is awaiting a close + brace partner. */ +static int open_brace_count; + +#define command_token_position(token) \ + (((token) == ASSIGNMENT_WORD) || (parser_state&PST_REDIRLIST) || \ + ((token) != SEMI_SEMI && (token) != SEMI_AND && (token) != SEMI_SEMI_AND && reserved_word_acceptable(token))) + +#define assignment_acceptable(token) \ + (command_token_position(token) && ((parser_state & PST_CASEPAT) == 0)) + +/* Check to see if TOKEN is a reserved word and return the token + value if it is. */ +#define CHECK_FOR_RESERVED_WORD(tok) \ + do { \ + if (!dollar_present && !quoted && \ + reserved_word_acceptable (last_read_token)) \ + { \ + int i; \ + for (i = 0; word_token_alist[i].word != (char *)NULL; i++) \ + if (STREQ (tok, word_token_alist[i].word)) \ + { \ + if ((parser_state & PST_CASEPAT) && (word_token_alist[i].token != ESAC)) \ + break; \ + if (word_token_alist[i].token == TIME && time_command_acceptable () == 0) \ + break; \ + if (word_token_alist[i].token == ESAC) \ + parser_state &= ~(PST_CASEPAT|PST_CASESTMT); \ + else if (word_token_alist[i].token == CASE) \ + parser_state |= PST_CASESTMT; \ + else if (word_token_alist[i].token == COND_END) \ + parser_state &= ~(PST_CONDCMD|PST_CONDEXPR); \ + else if (word_token_alist[i].token == COND_START) \ + parser_state |= PST_CONDCMD; \ + else if (word_token_alist[i].token == '{') \ + open_brace_count++; \ + else if (word_token_alist[i].token == '}' && open_brace_count) \ + open_brace_count--; \ + return (word_token_alist[i].token); \ + } \ + } \ + } while (0) + +#if defined (ALIAS) + + /* OK, we have a token. Let's try to alias expand it, if (and only if) + it's eligible. + + It is eligible for expansion if EXPAND_ALIASES is set, and + the token is unquoted and the last token read was a command + separator (or expand_next_token is set), and we are currently + processing an alias (pushed_string_list is non-empty) and this + token is not the same as the current or any previously + processed alias. + + Special cases that disqualify: + In a pattern list in a case statement (parser_state & PST_CASEPAT). */ + +static char * +mk_alexpansion (s) + char *s; +{ + int l; + char *r; + + l = strlen (s); + r = xmalloc (l + 2); + strcpy (r, s); + /* If the last character in the alias is a newline, don't add a trailing + space to the expansion. Works with shell_getc above. */ + if (r[l - 1] != ' ' && r[l - 1] != '\n') + r[l++] = ' '; + r[l] = '\0'; + return r; +} + +static int +alias_expand_token (tokstr) + char *tokstr; +{ + char *expanded; + alias_t *ap; + + if (((parser_state & PST_ALEXPNEXT) || command_token_position (last_read_token)) && + (parser_state & PST_CASEPAT) == 0) + { + ap = find_alias (tokstr); + + /* Currently expanding this token. */ + if (ap && (ap->flags & AL_BEINGEXPANDED)) + return (NO_EXPANSION); + + /* mk_alexpansion puts an extra space on the end of the alias expansion, + so the lookahead by the parser works right. If this gets changed, + make sure the code in shell_getc that deals with reaching the end of + an expanded alias is changed with it. */ + expanded = ap ? mk_alexpansion (ap->value) : (char *)NULL; + + if (expanded) + { + push_string (expanded, ap->flags & AL_EXPANDNEXT, ap); + return (RE_READ_TOKEN); + } + else + /* This is an eligible token that does not have an expansion. */ + return (NO_EXPANSION); + } + return (NO_EXPANSION); +} +#endif /* ALIAS */ + +static int +time_command_acceptable () +{ +#if defined (COMMAND_TIMING) + int i; + + if (posixly_correct && shell_compatibility_level > 41) + { + /* Quick check of the rest of the line to find the next token. If it + begins with a `-', Posix says to not return `time' as the token. + This was interp 267. */ + i = shell_input_line_index; + while (i < shell_input_line_len && (shell_input_line[i] == ' ' || shell_input_line[i] == '\t')) + i++; + if (shell_input_line[i] == '-') + return 0; + } + + switch (last_read_token) + { + case 0: + case ';': + case '\n': + case AND_AND: + case OR_OR: + case '&': + case DO: + case THEN: + case ELSE: + case '{': /* } */ + case '(': /* ) */ + case BANG: /* ! time pipeline */ + case TIME: /* time time pipeline */ + case TIMEOPT: /* time -p time pipeline */ + case TIMEIGN: /* time -p -- ... */ + return 1; + default: + return 0; + } +#else + return 0; +#endif /* COMMAND_TIMING */ +} + +/* Handle special cases of token recognition: + IN is recognized if the last token was WORD and the token + before that was FOR or CASE or SELECT. + + DO is recognized if the last token was WORD and the token + before that was FOR or SELECT. + + ESAC is recognized if the last token caused `esacs_needed_count' + to be set + + `{' is recognized if the last token as WORD and the token + before that was FUNCTION, or if we just parsed an arithmetic + `for' command. + + `}' is recognized if there is an unclosed `{' present. + + `-p' is returned as TIMEOPT if the last read token was TIME. + `--' is returned as TIMEIGN if the last read token was TIMEOPT. + + ']]' is returned as COND_END if the parser is currently parsing + a conditional expression ((parser_state & PST_CONDEXPR) != 0) + + `time' is returned as TIME if and only if it is immediately + preceded by one of `;', `\n', `||', `&&', or `&'. +*/ + +static int +special_case_tokens (tokstr) + char *tokstr; +{ + if ((last_read_token == WORD) && +#if defined (SELECT_COMMAND) + ((token_before_that == FOR) || (token_before_that == CASE) || (token_before_that == SELECT)) && +#else + ((token_before_that == FOR) || (token_before_that == CASE)) && +#endif + (tokstr[0] == 'i' && tokstr[1] == 'n' && tokstr[2] == 0)) + { + if (token_before_that == CASE) + { + parser_state |= PST_CASEPAT; + esacs_needed_count++; + } + return (IN); + } + + if (last_read_token == WORD && +#if defined (SELECT_COMMAND) + (token_before_that == FOR || token_before_that == SELECT) && +#else + (token_before_that == FOR) && +#endif + (tokstr[0] == 'd' && tokstr[1] == 'o' && tokstr[2] == '\0')) + return (DO); + + /* Ditto for ESAC in the CASE case. + Specifically, this handles "case word in esac", which is a legal + construct, certainly because someone will pass an empty arg to the + case construct, and we don't want it to barf. Of course, we should + insist that the case construct has at least one pattern in it, but + the designers disagree. */ + if (esacs_needed_count) + { + esacs_needed_count--; + if (STREQ (tokstr, "esac")) + { + parser_state &= ~PST_CASEPAT; + return (ESAC); + } + } + + /* The start of a shell function definition. */ + if (parser_state & PST_ALLOWOPNBRC) + { + parser_state &= ~PST_ALLOWOPNBRC; + if (tokstr[0] == '{' && tokstr[1] == '\0') /* } */ + { + open_brace_count++; + function_bstart = line_number; + return ('{'); /* } */ + } + } + + /* We allow a `do' after a for ((...)) without an intervening + list_terminator */ + if (last_read_token == ARITH_FOR_EXPRS && tokstr[0] == 'd' && tokstr[1] == 'o' && !tokstr[2]) + return (DO); + if (last_read_token == ARITH_FOR_EXPRS && tokstr[0] == '{' && tokstr[1] == '\0') /* } */ + { + open_brace_count++; + return ('{'); /* } */ + } + + if (open_brace_count && reserved_word_acceptable (last_read_token) && tokstr[0] == '}' && !tokstr[1]) + { + open_brace_count--; /* { */ + return ('}'); + } + +#if defined (COMMAND_TIMING) + /* Handle -p after `time'. */ + if (last_read_token == TIME && tokstr[0] == '-' && tokstr[1] == 'p' && !tokstr[2]) + return (TIMEOPT); + /* Handle -- after `time -p'. */ + if (last_read_token == TIMEOPT && tokstr[0] == '-' && tokstr[1] == '-' && !tokstr[2]) + return (TIMEIGN); +#endif + +#if defined (COND_COMMAND) /* [[ */ + if ((parser_state & PST_CONDEXPR) && tokstr[0] == ']' && tokstr[1] == ']' && tokstr[2] == '\0') + return (COND_END); +#endif + + return (-1); +} + +/* Called from shell.c when Control-C is typed at top level. Or + by the error rule at top level. */ +void +reset_parser () +{ + dstack.delimiter_depth = 0; /* No delimiters found so far. */ + open_brace_count = 0; + +#if defined (EXTENDED_GLOB) + /* Reset to global value of extended glob */ + if (parser_state & PST_EXTPAT) + extended_glob = global_extglob; +#endif + + parser_state = 0; + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + if (pushed_string_list) + free_string_list (); +#endif /* ALIAS || DPAREN_ARITHMETIC */ + + if (shell_input_line) + { + free (shell_input_line); + shell_input_line = (char *)NULL; + shell_input_line_size = shell_input_line_index = 0; + } + + FREE (word_desc_to_read); + word_desc_to_read = (WORD_DESC *)NULL; + + current_token = '\n'; /* XXX */ + last_read_token = '\n'; + token_to_read = '\n'; +} + +/* Read the next token. Command can be READ (normal operation) or + RESET (to normalize state). */ +static int +read_token (command) + int command; +{ + int character; /* Current character. */ + int peek_char; /* Temporary look-ahead character. */ + int result; /* The thing to return. */ + + if (command == RESET) + { + reset_parser (); + return ('\n'); + } + + if (token_to_read) + { + result = token_to_read; + if (token_to_read == WORD || token_to_read == ASSIGNMENT_WORD) + { + yylval.word = word_desc_to_read; + word_desc_to_read = (WORD_DESC *)NULL; + } + token_to_read = 0; + return (result); + } + +#if defined (COND_COMMAND) + if ((parser_state & (PST_CONDCMD|PST_CONDEXPR)) == PST_CONDCMD) + { + cond_lineno = line_number; + parser_state |= PST_CONDEXPR; + yylval.command = parse_cond_command (); + if (cond_token != COND_END) + { + cond_error (); + return (-1); + } + token_to_read = COND_END; + parser_state &= ~(PST_CONDEXPR|PST_CONDCMD); + return (COND_CMD); + } +#endif + +#if defined (ALIAS) + /* This is a place to jump back to once we have successfully expanded a + token with an alias and pushed the string with push_string () */ + re_read_token: +#endif /* ALIAS */ + + /* Read a single word from input. Start by skipping blanks. */ + while ((character = shell_getc (1)) != EOF && shellblank (character)) + ; + + if (character == EOF) + { + EOF_Reached = 1; + return (yacc_EOF); + } + + if MBTEST(character == '#' && (!interactive || interactive_comments)) + { + /* A comment. Discard until EOL or EOF, and then return a newline. */ + discard_until ('\n'); + shell_getc (0); + character = '\n'; /* this will take the next if statement and return. */ + } + + if (character == '\n') + { + /* If we're about to return an unquoted newline, we can go and collect + the text of any pending here document. */ + if (need_here_doc) + gather_here_documents (); + +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + parser_state &= ~PST_ASSIGNOK; + + return (character); + } + + if (parser_state & PST_REGEXP) + goto tokword; + + /* Shell meta-characters. */ + if MBTEST(shellmeta (character) && ((parser_state & PST_DBLPAREN) == 0)) + { +#if defined (ALIAS) + /* Turn off alias tokenization iff this character sequence would + not leave us ready to read a command. */ + if (character == '<' || character == '>') + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + parser_state &= ~PST_ASSIGNOK; + + peek_char = shell_getc (1); + if (character == peek_char) + { + switch (character) + { + case '<': + /* If '<' then we could be at "<<" or at "<<-". We have to + look ahead one more character. */ + peek_char = shell_getc (1); + if MBTEST(peek_char == '-') + return (LESS_LESS_MINUS); + else if MBTEST(peek_char == '<') + return (LESS_LESS_LESS); + else + { + shell_ungetc (peek_char); + return (LESS_LESS); + } + + case '>': + return (GREATER_GREATER); + + case ';': + parser_state |= PST_CASEPAT; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + peek_char = shell_getc (1); + if MBTEST(peek_char == '&') + return (SEMI_SEMI_AND); + else + { + shell_ungetc (peek_char); + return (SEMI_SEMI); + } + + case '&': + return (AND_AND); + + case '|': + return (OR_OR); + +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) + case '(': /* ) */ + result = parse_dparen (character); + if (result == -2) + break; + else + return result; +#endif + } + } + else if MBTEST(character == '<' && peek_char == '&') + return (LESS_AND); + else if MBTEST(character == '>' && peek_char == '&') + return (GREATER_AND); + else if MBTEST(character == '<' && peek_char == '>') + return (LESS_GREATER); + else if MBTEST(character == '>' && peek_char == '|') + return (GREATER_BAR); + else if MBTEST(character == '&' && peek_char == '>') + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '>') + return (AND_GREATER_GREATER); + else + { + shell_ungetc (peek_char); + return (AND_GREATER); + } + } + else if MBTEST(character == '|' && peek_char == '&') + return (BAR_AND); + else if MBTEST(character == ';' && peek_char == '&') + { + parser_state |= PST_CASEPAT; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + return (SEMI_AND); + } + + shell_ungetc (peek_char); + + /* If we look like we are reading the start of a function + definition, then let the reader know about it so that + we will do the right thing with `{'. */ + if MBTEST(character == ')' && last_read_token == '(' && token_before_that == WORD) + { + parser_state |= PST_ALLOWOPNBRC; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + function_dstart = line_number; + } + + /* case pattern lists may be preceded by an optional left paren. If + we're not trying to parse a case pattern list, the left paren + indicates a subshell. */ + if MBTEST(character == '(' && (parser_state & PST_CASEPAT) == 0) /* ) */ + parser_state |= PST_SUBSHELL; + /*(*/ + else if MBTEST((parser_state & PST_CASEPAT) && character == ')') + parser_state &= ~PST_CASEPAT; + /*(*/ + else if MBTEST((parser_state & PST_SUBSHELL) && character == ')') + parser_state &= ~PST_SUBSHELL; + +#if defined (PROCESS_SUBSTITUTION) + /* Check for the constructs which introduce process substitution. + Shells running in `posix mode' don't do process substitution. */ + if MBTEST(posixly_correct || ((character != '>' && character != '<') || peek_char != '(')) /*)*/ +#endif /* PROCESS_SUBSTITUTION */ + return (character); + } + + /* Hack <&- (close stdin) case. Also <&N- (dup and close). */ + if MBTEST(character == '-' && (last_read_token == LESS_AND || last_read_token == GREATER_AND)) + return (character); + +tokword: + /* Okay, if we got this far, we have to read a word. Read one, + and then check it against the known ones. */ + result = read_token_word (character); +#if defined (ALIAS) + if (result == RE_READ_TOKEN) + goto re_read_token; +#endif + return result; +} + +/* + * Match a $(...) or other grouping construct. This has to handle embedded + * quoted strings ('', ``, "") and nested constructs. It also must handle + * reprompting the user, if necessary, after reading a newline, and returning + * correct error values if it reads EOF. + */ +#define P_FIRSTCLOSE 0x0001 +#define P_ALLOWESC 0x0002 +#define P_DQUOTE 0x0004 +#define P_COMMAND 0x0008 /* parsing a command, so look for comments */ +#define P_BACKQUOTE 0x0010 /* parsing a backquoted command substitution */ +#define P_ARRAYSUB 0x0020 /* parsing a [...] array subscript for assignment */ +#define P_DOLBRACE 0x0040 /* parsing a ${...} construct */ + +/* Lexical state while parsing a grouping construct or $(...). */ +#define LEX_WASDOL 0x001 +#define LEX_CKCOMMENT 0x002 +#define LEX_INCOMMENT 0x004 +#define LEX_PASSNEXT 0x008 +#define LEX_RESWDOK 0x010 +#define LEX_CKCASE 0x020 +#define LEX_INCASE 0x040 +#define LEX_INHEREDOC 0x080 +#define LEX_HEREDELIM 0x100 /* reading here-doc delimiter */ +#define LEX_STRIPDOC 0x200 /* <<- strip tabs from here doc delim */ +#define LEX_INWORD 0x400 + +#define COMSUB_META(ch) ((ch) == ';' || (ch) == '&' || (ch) == '|') + +#define CHECK_NESTRET_ERROR() \ + do { \ + if (nestret == &matched_pair_error) \ + { \ + free (ret); \ + return &matched_pair_error; \ + } \ + } while (0) + +#define APPEND_NESTRET() \ + do { \ + if (nestlen) \ + { \ + RESIZE_MALLOCED_BUFFER (ret, retind, nestlen, retsize, 64); \ + strcpy (ret + retind, nestret); \ + retind += nestlen; \ + } \ + } while (0) + +static char matched_pair_error; + +static char * +parse_matched_pair (qc, open, close, lenp, flags) + int qc; /* `"' if this construct is within double quotes */ + int open, close; + int *lenp, flags; +{ + int count, ch, tflags; + int nestlen, ttranslen, start_lineno; + char *ret, *nestret, *ttrans; + int retind, retsize, rflags; + int dolbrace_state; + + dolbrace_state = (flags & P_DOLBRACE) ? DOLBRACE_PARAM : 0; + +/*itrace("parse_matched_pair[%d]: open = %c close = %c flags = %d", line_number, open, close, flags);*/ + count = 1; + tflags = 0; + + if ((flags & P_COMMAND) && qc != '`' && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0) + tflags |= LEX_CKCOMMENT; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ + rflags = (qc == '"') ? P_DQUOTE : (flags & P_DQUOTE); + + ret = (char *)xmalloc (retsize = 64); + retind = 0; + + start_lineno = line_number; + while (count) + { + ch = shell_getc (qc != '\'' && (tflags & (LEX_PASSNEXT)) == 0); + + if (ch == EOF) + { + free (ret); + parser_error (start_lineno, _("unexpected EOF while looking for matching `%c'"), close); + EOF_Reached = 1; /* XXX */ + return (&matched_pair_error); + } + + /* Possible reprompting. */ + if (ch == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* Don't bother counting parens or doing anything else if in a comment + or part of a case statement */ + if (tflags & LEX_INCOMMENT) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + if (ch == '\n') + tflags &= ~LEX_INCOMMENT; + + continue; + } + + /* Not exactly right yet, should handle shell metacharacters, too. If + any changes are made to this test, make analogous changes to subst.c: + extract_delimited_string(). */ + else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || shellblank (ret[retind - 1]))) + tflags |= LEX_INCOMMENT; + + if (tflags & LEX_PASSNEXT) /* last char was backslash */ + { + tflags &= ~LEX_PASSNEXT; + if (qc != '\'' && ch == '\n') /* double-quoted \ disappears. */ + { + if (retind > 0) + retind--; /* swallow previously-added backslash */ + continue; + } + + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + if MBTEST(ch == CTLESC) + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + /* If we're reparsing the input (e.g., from parse_string_to_word_list), + we've already prepended CTLESC to single-quoted results of $'...'. + We may want to do this for other CTLESC-quoted characters in + reparse, too. */ + else if MBTEST((parser_state & PST_REPARSE) && open == '\'' && (ch == CTLESC || ch == CTLNUL)) + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + continue; + } + else if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + else if MBTEST(ch == close) /* ending delimiter */ + count--; + /* handle nested ${...} specially. */ + else if MBTEST(open != close && (tflags & LEX_WASDOL) && open == '{' && ch == open) /* } */ + count++; + else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && ch == open) /* nested begin */ + count++; + + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + /* If we just read the ending character, don't bother continuing. */ + if (count == 0) + break; + + if (open == '\'') /* '' inside grouping construct */ + { + if MBTEST((flags & P_ALLOWESC) && ch == '\\') + tflags |= LEX_PASSNEXT; + continue; + } + + if MBTEST(ch == '\\') /* backslashes */ + tflags |= LEX_PASSNEXT; + + /* Based on which dolstate is currently in (param, op, or word), + decide what the op is. We're really only concerned if it's % or + #, so we can turn on a flag that says whether or not we should + treat single quotes as special when inside a double-quoted + ${...}. This logic must agree with subst.c:extract_dollar_brace_string + since they share the same defines. */ + /* FLAG POSIX INTERP 221 */ + if (flags & P_DOLBRACE) + { + /* ${param%[%]word} */ + if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '%' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param#[#]word} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '#' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param/[/]pat/rep} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '/' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE2; /* XXX */ + /* ${param^[^]pat} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '^' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param,[,]pat} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == ',' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && strchr ("#%^,~:-=?+/", ch) != 0) + dolbrace_state = DOLBRACE_OP; + else if MBTEST(dolbrace_state == DOLBRACE_OP && strchr ("#%^,~:-=?+/", ch) == 0) + dolbrace_state = DOLBRACE_WORD; + } + + /* The big hammer. Single quotes aren't special in double quotes. The + problem is that Posix used to say the single quotes are semi-special: + within a double-quoted ${...} construct "an even number of + unescaped double-quotes or single-quotes, if any, shall occur." */ + /* This was changed in Austin Group Interp 221 */ + if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'') + continue; + + /* Could also check open == '`' if we want to parse grouping constructs + inside old-style command substitution. */ + if (open != close) /* a grouping construct */ + { + if MBTEST(shellquote (ch)) + { + /* '', ``, or "" inside $(...) or other grouping construct. */ + push_delimiter (dstack, ch); + if MBTEST((tflags & LEX_WASDOL) && ch == '\'') /* $'...' inside group */ + nestret = parse_matched_pair (ch, ch, ch, &nestlen, P_ALLOWESC|rflags); + else + nestret = parse_matched_pair (ch, ch, ch, &nestlen, rflags); + pop_delimiter (dstack); + CHECK_NESTRET_ERROR (); + + if MBTEST((tflags & LEX_WASDOL) && ch == '\'' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Translate $'...' here. */ + ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen); + xfree (nestret); + + /* If we're parsing a double-quoted brace expansion and we are + not in a place where single quotes are treated specially, + make sure we single-quote the results of the ansi + expansion because quote removal should remove them later */ + /* FLAG POSIX INTERP 221 */ + if ((shell_compatibility_level > 42) && (rflags & P_DQUOTE) && (dolbrace_state == DOLBRACE_QUOTE2) && (flags & P_DOLBRACE)) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else if ((rflags & P_DQUOTE) == 0) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else + { + nestret = ttrans; + nestlen = ttranslen; + } + retind -= 2; /* back up before the $' */ + } + else if MBTEST((tflags & LEX_WASDOL) && ch == '"' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Locale expand $"..." here. */ + ttrans = localeexpand (nestret, 0, nestlen - 1, start_lineno, &ttranslen); + xfree (nestret); + + nestret = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + nestlen = ttranslen + 2; + retind -= 2; /* back up before the $" */ + } + + APPEND_NESTRET (); + FREE (nestret); + } + else if ((flags & P_ARRAYSUB) && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + goto parse_dollar_word; + } + /* Parse an old-style command substitution within double quotes as a + single word. */ + /* XXX - sh and ksh93 don't do this - XXX */ + else if MBTEST(open == '"' && ch == '`') + { + nestret = parse_matched_pair (0, '`', '`', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + else if MBTEST(open != '`' && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + /* check for $(), $[], or ${} inside quoted string. */ + { +parse_dollar_word: + if (open == ch) /* undo previous increment */ + count--; + if (ch == '(') /* ) */ + nestret = parse_comsub (0, '(', ')', &nestlen, (rflags|P_COMMAND) & ~P_DQUOTE); + else if (ch == '{') /* } */ + nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|P_DOLBRACE|rflags); + else if (ch == '[') /* ] */ + nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + if MBTEST(ch == '$') + tflags |= LEX_WASDOL; + else + tflags &= ~LEX_WASDOL; + } + + ret[retind] = '\0'; + if (lenp) + *lenp = retind; +/*itrace("parse_matched_pair[%d]: returning %s", line_number, ret);*/ + return ret; +} + +/* Parse a $(...) command substitution. This is messier than I'd like, and + reproduces a lot more of the token-reading code than I'd like. */ +static char * +parse_comsub (qc, open, close, lenp, flags) + int qc; /* `"' if this construct is within double quotes */ + int open, close; + int *lenp, flags; +{ + int count, ch, peekc, tflags, lex_rwlen, lex_wlen, lex_firstind; + int nestlen, ttranslen, start_lineno; + char *ret, *nestret, *ttrans, *heredelim; + int retind, retsize, rflags, hdlen; + + /* Posix interp 217 says arithmetic expressions have precedence, so + assume $(( introduces arithmetic expansion and parse accordingly. */ + peekc = shell_getc (0); + shell_ungetc (peekc); + if (peekc == '(') + return (parse_matched_pair (qc, open, close, lenp, 0)); + +/*itrace("parse_comsub: qc = `%c' open = %c close = %c", qc, open, close);*/ + count = 1; + tflags = LEX_RESWDOK; + + if ((flags & P_COMMAND) && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0) + tflags |= LEX_CKCASE; + if ((tflags & LEX_CKCASE) && (interactive == 0 || interactive_comments)) + tflags |= LEX_CKCOMMENT; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ + rflags = (flags & P_DQUOTE); + + ret = (char *)xmalloc (retsize = 64); + retind = 0; + + start_lineno = line_number; + lex_rwlen = lex_wlen = 0; + + heredelim = 0; + lex_firstind = -1; + + while (count) + { +comsub_readchar: + ch = shell_getc (qc != '\'' && (tflags & (LEX_INCOMMENT|LEX_PASSNEXT)) == 0); + + if (ch == EOF) + { +eof_error: + free (ret); + FREE (heredelim); + parser_error (start_lineno, _("unexpected EOF while looking for matching `%c'"), close); + EOF_Reached = 1; /* XXX */ + return (&matched_pair_error); + } + + /* If we hit the end of a line and are reading the contents of a here + document, and it's not the same line that the document starts on, + check for this line being the here doc delimiter. Otherwise, if + we're in a here document, mark the next character as the beginning + of a line. */ + if (ch == '\n') + { + if ((tflags & LEX_HEREDELIM) && heredelim) + { + tflags &= ~LEX_HEREDELIM; + tflags |= LEX_INHEREDOC; + lex_firstind = retind + 1; + } + else if (tflags & LEX_INHEREDOC) + { + int tind; + tind = lex_firstind; + while ((tflags & LEX_STRIPDOC) && ret[tind] == '\t') + tind++; + if (STREQN (ret + tind, heredelim, hdlen)) + { + tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC); +/*itrace("parse_comsub:%d: found here doc end `%s'", line_number, ret + tind);*/ + free (heredelim); + heredelim = 0; + lex_firstind = -1; + } + else + lex_firstind = retind + 1; + } + } + + /* Possible reprompting. */ + if (ch == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* XXX -- possibly allow here doc to be delimited by ending right + paren. */ + if ((tflags & LEX_INHEREDOC) && ch == close && count == 1) + { + int tind; +/*itrace("parse_comsub: in here doc, ch == close, retind - firstind = %d hdlen = %d retind = %d", retind-lex_firstind, hdlen, retind);*/ + tind = lex_firstind; + while ((tflags & LEX_STRIPDOC) && ret[tind] == '\t') + tind++; + if (retind-tind == hdlen && STREQN (ret + tind, heredelim, hdlen)) + { + tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC); +/*itrace("parse_comsub:%d: found here doc end `%s'", line_number, ret + tind);*/ + free (heredelim); + heredelim = 0; + lex_firstind = -1; + } + } + + /* Don't bother counting parens or doing anything else if in a comment */ + if (tflags & (LEX_INCOMMENT|LEX_INHEREDOC)) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + if ((tflags & LEX_INCOMMENT) && ch == '\n') + { +/*itrace("parse_comsub:%d: lex_incomment -> 0 ch = `%c'", line_number, ch);*/ + tflags &= ~LEX_INCOMMENT; + } + + continue; + } + + if (tflags & LEX_PASSNEXT) /* last char was backslash */ + { +/*itrace("parse_comsub:%d: lex_passnext -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + tflags &= ~LEX_PASSNEXT; + if (qc != '\'' && ch == '\n') /* double-quoted \ disappears. */ + { + if (retind > 0) + retind--; /* swallow previously-added backslash */ + continue; + } + + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + if MBTEST(ch == CTLESC) + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + + /* If this is a shell break character, we are not in a word. If not, + we either start or continue a word. */ + if MBTEST(shellbreak (ch)) + { + tflags &= ~LEX_INWORD; +/*itrace("parse_comsub:%d: lex_inword -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + } + else + { + if (tflags & LEX_INWORD) + { + lex_wlen++; +/*itrace("parse_comsub:%d: lex_inword == 1 ch = `%c' lex_wlen = %d (%d)", line_number, ch, lex_wlen, __LINE__);*/ + } + else + { +/*itrace("parse_comsub:%d: lex_inword -> 1 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + tflags |= LEX_INWORD; + lex_wlen = 0; + } + } + + /* Skip whitespace */ + if MBTEST(shellblank (ch) && (tflags & LEX_HEREDELIM) == 0 && lex_rwlen == 0) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + continue; + } + + /* Either we are looking for the start of the here-doc delimiter + (lex_firstind == -1) or we are reading one (lex_firstind >= 0). + If this character is a shell break character and we are reading + the delimiter, save it and note that we are now reading a here + document. If we've found the start of the delimiter, note it by + setting lex_firstind. Backslashes can quote shell metacharacters + in here-doc delimiters. */ + if (tflags & LEX_HEREDELIM) + { + if (lex_firstind == -1 && shellbreak (ch) == 0) + lex_firstind = retind; +#if 0 + else if (heredelim && (tflags & LEX_PASSNEXT) == 0 && ch == '\n') + { + tflags |= LEX_INHEREDOC; + tflags &= ~LEX_HEREDELIM; + lex_firstind = retind + 1; + } +#endif + else if (lex_firstind >= 0 && (tflags & LEX_PASSNEXT) == 0 && shellbreak (ch)) + { + if (heredelim == 0) + { + nestret = substring (ret, lex_firstind, retind); + heredelim = string_quote_removal (nestret, 0); + free (nestret); + hdlen = STRLEN(heredelim); +/*itrace("parse_comsub:%d: found here doc delimiter `%s' (%d)", line_number, heredelim, hdlen);*/ + } + if (ch == '\n') + { + tflags |= LEX_INHEREDOC; + tflags &= ~LEX_HEREDELIM; + lex_firstind = retind + 1; + } + else + lex_firstind = -1; + } + } + + /* Meta-characters that can introduce a reserved word. Not perfect yet. */ + if MBTEST((tflags & LEX_RESWDOK) == 0 && (tflags & LEX_CKCASE) && (tflags & LEX_INCOMMENT) == 0 && (shellmeta(ch) || ch == '\n')) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + peekc = shell_getc (1); + if (ch == peekc && (ch == '&' || ch == '|' || ch == ';')) /* two-character tokens */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; +/*itrace("parse_comsub:%d: set lex_reswordok = 1, ch = `%c'", line_number, ch);*/ + tflags |= LEX_RESWDOK; + lex_rwlen = 0; + continue; + } + else if (ch == '\n' || COMSUB_META(ch)) + { + shell_ungetc (peekc); +/*itrace("parse_comsub:%d: set lex_reswordok = 1, ch = `%c'", line_number, ch);*/ + tflags |= LEX_RESWDOK; + lex_rwlen = 0; + continue; + } + else if (ch == EOF) + goto eof_error; + else + { + /* `unget' the character we just added and fall through */ + retind--; + shell_ungetc (peekc); + } + } + + /* If we can read a reserved word, try to read one. */ + if (tflags & LEX_RESWDOK) + { + if MBTEST(islower (ch)) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + lex_rwlen++; + continue; + } + else if MBTEST(lex_rwlen == 4 && shellbreak (ch)) + { + if (STREQN (ret + retind - 4, "case", 4)) + { + tflags |= LEX_INCASE; +/*itrace("parse_comsub:%d: found `case', lex_incase -> 1 lex_reswdok -> 0", line_number);*/ + } + else if (STREQN (ret + retind - 4, "esac", 4)) + { + tflags &= ~LEX_INCASE; +/*itrace("parse_comsub:%d: found `esac', lex_incase -> 0 lex_reswdok -> 0", line_number);*/ + } + tflags &= ~LEX_RESWDOK; + } + else if MBTEST((tflags & LEX_CKCOMMENT) && ch == '#' && (lex_rwlen == 0 || ((tflags & LEX_INWORD) && lex_wlen == 0))) + ; /* don't modify LEX_RESWDOK if we're starting a comment */ + /* Allow `do' followed by space, tab, or newline to preserve the + RESWDOK flag, but reset the reserved word length counter so we + can read another one. */ + else if MBTEST(((tflags & LEX_INCASE) == 0) && + (isblank(ch) || ch == '\n') && + lex_rwlen == 2 && + STREQN (ret + retind - 2, "do", 2)) + { +/*itrace("parse_comsub:%d: lex_incase == 1 found `%c', found \"do\"", line_number, ch);*/ + lex_rwlen = 0; + } + else if MBTEST((tflags & LEX_INCASE) && ch != '\n') + /* If we can read a reserved word and we're in case, we're at the + point where we can read a new pattern list or an esac. We + handle the esac case above. If we read a newline, we want to + leave LEX_RESWDOK alone. If we read anything else, we want to + turn off LEX_RESWDOK, since we're going to read a pattern list. */ + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: lex_incase == 1 found `%c', lex_reswordok -> 0", line_number, ch);*/ + } + else if MBTEST(shellbreak (ch) == 0) + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/ + } +#if 0 + /* If we find a space or tab but have read something and it's not + `do', turn off the reserved-word-ok flag */ + else if MBTEST(isblank (ch) && lex_rwlen > 0) + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/ + } +#endif + } + + /* Might be the start of a here-doc delimiter */ + if MBTEST((tflags & LEX_INCOMMENT) == 0 && (tflags & LEX_CKCASE) && ch == '<') + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + peekc = shell_getc (1); + if (peekc == EOF) + goto eof_error; + if (peekc == ch) + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; + peekc = shell_getc (1); + if (peekc == EOF) + goto eof_error; + if (peekc == '-') + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; + tflags |= LEX_STRIPDOC; + } + else + shell_ungetc (peekc); + if (peekc != '<') + { + tflags |= LEX_HEREDELIM; + lex_firstind = -1; + } + continue; + } + else + ch = peekc; /* fall through and continue XXX */ + } + else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (((tflags & LEX_RESWDOK) && lex_rwlen == 0) || ((tflags & LEX_INWORD) && lex_wlen == 0))) + { +/*itrace("parse_comsub:%d: lex_incomment -> 1 (%d)", line_number, __LINE__);*/ + tflags |= LEX_INCOMMENT; + } + + if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } +#if 0 + else if MBTEST((tflags & LEX_INCASE) && ch == close && close == ')') + tflags &= ~LEX_INCASE; /* XXX */ +#endif + else if MBTEST(ch == close && (tflags & LEX_INCASE) == 0) /* ending delimiter */ + { + count--; +/*itrace("parse_comsub:%d: found close: count = %d", line_number, count);*/ + } + else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && (tflags & LEX_INCASE) == 0 && ch == open) /* nested begin */ + { + count++; +/*itrace("parse_comsub:%d: found open: count = %d", line_number, count);*/ + } + + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + /* If we just read the ending character, don't bother continuing. */ + if (count == 0) + break; + + if MBTEST(ch == '\\') /* backslashes */ + tflags |= LEX_PASSNEXT; + + if MBTEST(shellquote (ch)) + { + /* '', ``, or "" inside $(...). */ + push_delimiter (dstack, ch); + if MBTEST((tflags & LEX_WASDOL) && ch == '\'') /* $'...' inside group */ + nestret = parse_matched_pair (ch, ch, ch, &nestlen, P_ALLOWESC|rflags); + else + nestret = parse_matched_pair (ch, ch, ch, &nestlen, rflags); + pop_delimiter (dstack); + CHECK_NESTRET_ERROR (); + + if MBTEST((tflags & LEX_WASDOL) && ch == '\'' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Translate $'...' here. */ + ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen); + xfree (nestret); + + if ((rflags & P_DQUOTE) == 0) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else + { + nestret = ttrans; + nestlen = ttranslen; + } + retind -= 2; /* back up before the $' */ + } + else if MBTEST((tflags & LEX_WASDOL) && ch == '"' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Locale expand $"..." here. */ + ttrans = localeexpand (nestret, 0, nestlen - 1, start_lineno, &ttranslen); + xfree (nestret); + + nestret = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + nestlen = ttranslen + 2; + retind -= 2; /* back up before the $" */ + } + + APPEND_NESTRET (); + FREE (nestret); + } + else if MBTEST((tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + /* check for $(), $[], or ${} inside command substitution. */ + { + if ((tflags & LEX_INCASE) == 0 && open == ch) /* undo previous increment */ + count--; + if (ch == '(') /* ) */ + nestret = parse_comsub (0, '(', ')', &nestlen, (rflags|P_COMMAND) & ~P_DQUOTE); + else if (ch == '{') /* } */ + nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|P_DOLBRACE|rflags); + else if (ch == '[') /* ] */ + nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + if MBTEST(ch == '$') + tflags |= LEX_WASDOL; + else + tflags &= ~LEX_WASDOL; + } + + FREE (heredelim); + ret[retind] = '\0'; + if (lenp) + *lenp = retind; +/*itrace("parse_comsub:%d: returning `%s'", line_number, ret);*/ + return ret; +} + +/* Recursively call the parser to parse a $(...) command substitution. */ +char * +xparse_dolparen (base, string, indp, flags) + char *base; + char *string; + int *indp; + int flags; +{ + sh_parser_state_t ps; + sh_input_line_state_t ls; + int orig_ind, nc, sflags, orig_eof_token; + char *ret, *s, *ep, *ostring; + + /*yydebug = 1;*/ + orig_ind = *indp; + ostring = string; + +/*itrace("xparse_dolparen: size = %d shell_input_line = `%s'", shell_input_line_size, shell_input_line);*/ + sflags = SEVAL_NONINT|SEVAL_NOHIST|SEVAL_NOFREE; + if (flags & SX_NOLONGJMP) + sflags |= SEVAL_NOLONGJMP; + save_parser_state (&ps); + save_input_line_state (&ls); + orig_eof_token = shell_eof_token; + + /*(*/ + parser_state |= PST_CMDSUBST|PST_EOFTOKEN; /* allow instant ')' */ /*(*/ + shell_eof_token = ')'; + parse_string (string, "command substitution", sflags, &ep); + + shell_eof_token = orig_eof_token; + restore_parser_state (&ps); + reset_parser (); + /* reset_parser clears shell_input_line and associated variables */ + restore_input_line_state (&ls); + if (interactive) + token_to_read = 0; + + /* Need to find how many characters parse_and_execute consumed, update + *indp, if flags != 0, copy the portion of the string parsed into RET + and return it. If flags & 1 (EX_NOALLOC) we can return NULL. */ + + /*(*/ + if (ep[-1] != ')') + { +#if DEBUG + if (ep[-1] != '\n') + itrace("xparse_dolparen:%d: ep[-1] != RPAREN (%d), ep = `%s'", line_number, ep[-1], ep); +#endif + while (ep > ostring && ep[-1] == '\n') ep--; + } + + nc = ep - ostring; + *indp = ep - base - 1; + + /*(*/ +#if DEBUG + if (base[*indp] != ')') + itrace("xparse_dolparen:%d: base[%d] != RPAREN (%d), base = `%s'", line_number, *indp, base[*indp], base); +#endif + + if (flags & SX_NOALLOC) + return (char *)NULL; + + if (nc == 0) + { + ret = xmalloc (1); + ret[0] = '\0'; + } + else + ret = substring (ostring, 0, nc - 1); + + return ret; +} + +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) +/* Parse a double-paren construct. It can be either an arithmetic + command, an arithmetic `for' command, or a nested subshell. Returns + the parsed token, -1 on error, or -2 if we didn't do anything and + should just go on. */ +static int +parse_dparen (c) + int c; +{ + int cmdtyp, sline; + char *wval; + WORD_DESC *wd; + +#if defined (ARITH_FOR_COMMAND) + if (last_read_token == FOR) + { + arith_for_lineno = line_number; + cmdtyp = parse_arith_cmd (&wval, 0); + if (cmdtyp == 1) + { + wd = alloc_word_desc (); + wd->word = wval; + yylval.word_list = make_word_list (wd, (WORD_LIST *)NULL); + return (ARITH_FOR_EXPRS); + } + else + return -1; /* ERROR */ + } +#endif + +#if defined (DPAREN_ARITHMETIC) + if (reserved_word_acceptable (last_read_token)) + { + sline = line_number; + + cmdtyp = parse_arith_cmd (&wval, 0); + if (cmdtyp == 1) /* arithmetic command */ + { + wd = alloc_word_desc (); + wd->word = wval; + wd->flags = W_QUOTED|W_NOSPLIT|W_NOGLOB|W_DQUOTE; + yylval.word_list = make_word_list (wd, (WORD_LIST *)NULL); + return (ARITH_CMD); + } + else if (cmdtyp == 0) /* nested subshell */ + { + push_string (wval, 0, (alias_t *)NULL); + pushed_string_list->flags = PSH_DPAREN; + if ((parser_state & PST_CASEPAT) == 0) + parser_state |= PST_SUBSHELL; + return (c); + } + else /* ERROR */ + return -1; + } +#endif + + return -2; /* XXX */ +} + +/* We've seen a `(('. Look for the matching `))'. If we get it, return 1. + If not, assume it's a nested subshell for backwards compatibility and + return 0. In any case, put the characters we've consumed into a locally- + allocated buffer and make *ep point to that buffer. Return -1 on an + error, for example EOF. */ +static int +parse_arith_cmd (ep, adddq) + char **ep; + int adddq; +{ + int exp_lineno, rval, c; + char *ttok, *tokstr; + int ttoklen; + + exp_lineno = line_number; + ttok = parse_matched_pair (0, '(', ')', &ttoklen, 0); + rval = 1; + if (ttok == &matched_pair_error) + return -1; + /* Check that the next character is the closing right paren. If + not, this is a syntax error. ( */ + c = shell_getc (0); + if MBTEST(c != ')') + rval = 0; + + tokstr = (char *)xmalloc (ttoklen + 4); + + /* if ADDDQ != 0 then (( ... )) -> "..." */ + if (rval == 1 && adddq) /* arith cmd, add double quotes */ + { + tokstr[0] = '"'; + strncpy (tokstr + 1, ttok, ttoklen - 1); + tokstr[ttoklen] = '"'; + tokstr[ttoklen+1] = '\0'; + } + else if (rval == 1) /* arith cmd, don't add double quotes */ + { + strncpy (tokstr, ttok, ttoklen - 1); + tokstr[ttoklen-1] = '\0'; + } + else /* nested subshell */ + { + tokstr[0] = '('; + strncpy (tokstr + 1, ttok, ttoklen - 1); + tokstr[ttoklen] = ')'; + tokstr[ttoklen+1] = c; + tokstr[ttoklen+2] = '\0'; + } + + *ep = tokstr; + FREE (ttok); + return rval; +} +#endif /* DPAREN_ARITHMETIC || ARITH_FOR_COMMAND */ + +#if defined (COND_COMMAND) +static void +cond_error () +{ + char *etext; + + if (EOF_Reached && cond_token != COND_ERROR) /* [[ */ + parser_error (cond_lineno, _("unexpected EOF while looking for `]]'")); + else if (cond_token != COND_ERROR) + { + if (etext = error_token_from_token (cond_token)) + { + parser_error (cond_lineno, _("syntax error in conditional expression: unexpected token `%s'"), etext); + free (etext); + } + else + parser_error (cond_lineno, _("syntax error in conditional expression")); + } +} + +static COND_COM * +cond_expr () +{ + return (cond_or ()); +} + +static COND_COM * +cond_or () +{ + COND_COM *l, *r; + + l = cond_and (); + if (cond_token == OR_OR) + { + r = cond_or (); + l = make_cond_node (COND_OR, (WORD_DESC *)NULL, l, r); + } + return l; +} + +static COND_COM * +cond_and () +{ + COND_COM *l, *r; + + l = cond_term (); + if (cond_token == AND_AND) + { + r = cond_and (); + l = make_cond_node (COND_AND, (WORD_DESC *)NULL, l, r); + } + return l; +} + +static int +cond_skip_newlines () +{ + while ((cond_token = read_token (READ)) == '\n') + { + if (SHOULD_PROMPT ()) + prompt_again (); + } + return (cond_token); +} + +#define COND_RETURN_ERROR() \ + do { cond_token = COND_ERROR; return ((COND_COM *)NULL); } while (0) + +static COND_COM * +cond_term () +{ + WORD_DESC *op; + COND_COM *term, *tleft, *tright; + int tok, lineno; + char *etext; + + /* Read a token. It can be a left paren, a `!', a unary operator, or a + word that should be the first argument of a binary operator. Start by + skipping newlines, since this is a compound command. */ + tok = cond_skip_newlines (); + lineno = line_number; + if (tok == COND_END) + { + COND_RETURN_ERROR (); + } + else if (tok == '(') + { + term = cond_expr (); + if (cond_token != ')') + { + if (term) + dispose_cond_node (term); /* ( */ + if (etext = error_token_from_token (cond_token)) + { + parser_error (lineno, _("unexpected token `%s', expected `)'"), etext); + free (etext); + } + else + parser_error (lineno, _("expected `)'")); + COND_RETURN_ERROR (); + } + term = make_cond_node (COND_EXPR, (WORD_DESC *)NULL, term, (COND_COM *)NULL); + (void)cond_skip_newlines (); + } + else if (tok == BANG || (tok == WORD && (yylval.word->word[0] == '!' && yylval.word->word[1] == '\0'))) + { + if (tok == WORD) + dispose_word (yylval.word); /* not needed */ + term = cond_term (); + if (term) + term->flags |= CMD_INVERT_RETURN; + } + else if (tok == WORD && yylval.word->word[0] == '-' && yylval.word->word[2] == 0 && test_unop (yylval.word->word)) + { + op = yylval.word; + tok = read_token (READ); + if (tok == WORD) + { + tleft = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + term = make_cond_node (COND_UNARY, op, tleft, (COND_COM *)NULL); + } + else + { + dispose_word (op); + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected argument `%s' to conditional unary operator"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected argument to conditional unary operator")); + COND_RETURN_ERROR (); + } + + (void)cond_skip_newlines (); + } + else if (tok == WORD) /* left argument to binary operator */ + { + /* lhs */ + tleft = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + + /* binop */ + tok = read_token (READ); + if (tok == WORD && test_binop (yylval.word->word)) + { + op = yylval.word; + if (op->word[0] == '=' && (op->word[1] == '\0' || (op->word[1] == '=' && op->word[2] == '\0'))) + parser_state |= PST_EXTPAT; + else if (op->word[0] == '!' && op->word[1] == '=' && op->word[2] == '\0') + parser_state |= PST_EXTPAT; + } +#if defined (COND_REGEXP) + else if (tok == WORD && STREQ (yylval.word->word, "=~")) + { + op = yylval.word; + parser_state |= PST_REGEXP; + } +#endif + else if (tok == '<' || tok == '>') + op = make_word_from_token (tok); /* ( */ + /* There should be a check before blindly accepting the `)' that we have + seen the opening `('. */ + else if (tok == COND_END || tok == AND_AND || tok == OR_OR || tok == ')') + { + /* Special case. [[ x ]] is equivalent to [[ -n x ]], just like + the test command. Similarly for [[ x && expr ]] or + [[ x || expr ]] or [[ (x) ]]. */ + op = make_word ("-n"); + term = make_cond_node (COND_UNARY, op, tleft, (COND_COM *)NULL); + cond_token = tok; + return (term); + } + else + { + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected token `%s', conditional binary operator expected"), etext); + free (etext); + } + else + parser_error (line_number, _("conditional binary operator expected")); + dispose_cond_node (tleft); + COND_RETURN_ERROR (); + } + + /* rhs */ + if (parser_state & PST_EXTPAT) + extended_glob = 1; + tok = read_token (READ); + if (parser_state & PST_EXTPAT) + extended_glob = global_extglob; + parser_state &= ~(PST_REGEXP|PST_EXTPAT); + + if (tok == WORD) + { + tright = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + term = make_cond_node (COND_BINARY, op, tleft, tright); + } + else + { + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected argument `%s' to conditional binary operator"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected argument to conditional binary operator")); + dispose_cond_node (tleft); + dispose_word (op); + COND_RETURN_ERROR (); + } + + (void)cond_skip_newlines (); + } + else + { + if (tok < 256) + parser_error (line_number, _("unexpected token `%c' in conditional command"), tok); + else if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected token `%s' in conditional command"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected token %d in conditional command"), tok); + COND_RETURN_ERROR (); + } + return (term); +} + +/* This is kind of bogus -- we slip a mini recursive-descent parser in + here to handle the conditional statement syntax. */ +static COMMAND * +parse_cond_command () +{ + COND_COM *cexp; + + global_extglob = extended_glob; + cexp = cond_expr (); + return (make_cond_command (cexp)); +} +#endif + +#if defined (ARRAY_VARS) +/* When this is called, it's guaranteed that we don't care about anything + in t beyond i. We do save and restore the chars, though. */ +static int +token_is_assignment (t, i) + char *t; + int i; +{ + unsigned char c, c1; + int r; + + c = t[i]; c1 = t[i+1]; + t[i] = '='; t[i+1] = '\0'; + r = assignment (t, (parser_state & PST_COMPASSIGN) != 0); + t[i] = c; t[i+1] = c1; + return r; +} + +/* XXX - possible changes here for `+=' */ +static int +token_is_ident (t, i) + char *t; + int i; +{ + unsigned char c; + int r; + + c = t[i]; + t[i] = '\0'; + r = legal_identifier (t); + t[i] = c; + return r; +} +#endif + +static int +read_token_word (character) + int character; +{ + /* The value for YYLVAL when a WORD is read. */ + WORD_DESC *the_word; + + /* Index into the token that we are building. */ + int token_index; + + /* ALL_DIGITS becomes zero when we see a non-digit. */ + int all_digit_token; + + /* DOLLAR_PRESENT becomes non-zero if we see a `$'. */ + int dollar_present; + + /* COMPOUND_ASSIGNMENT becomes non-zero if we are parsing a compound + assignment. */ + int compound_assignment; + + /* QUOTED becomes non-zero if we see one of ("), ('), (`), or (\). */ + int quoted; + + /* Non-zero means to ignore the value of the next character, and just + to add it no matter what. */ + int pass_next_character; + + /* The current delimiting character. */ + int cd; + int result, peek_char; + char *ttok, *ttrans; + int ttoklen, ttranslen; + intmax_t lvalue; + + if (token_buffer_size < TOKEN_DEFAULT_INITIAL_SIZE) + token = (char *)xrealloc (token, token_buffer_size = TOKEN_DEFAULT_INITIAL_SIZE); + + token_index = 0; + all_digit_token = DIGIT (character); + dollar_present = quoted = pass_next_character = compound_assignment = 0; + + for (;;) + { + if (character == EOF) + goto got_token; + + if (pass_next_character) + { + pass_next_character = 0; + goto got_escaped_character; + } + + cd = current_delimiter (dstack); + + /* Handle backslashes. Quote lots of things when not inside of + double-quotes, quote some things inside of double-quotes. */ + if MBTEST(character == '\\') + { + peek_char = shell_getc (0); + + /* Backslash-newline is ignored in all cases except + when quoted with single quotes. */ + if (peek_char == '\n') + { + character = '\n'; + goto next_character; + } + else + { + shell_ungetc (peek_char); + + /* If the next character is to be quoted, note it now. */ + if (cd == 0 || cd == '`' || + (cd == '"' && peek_char >= 0 && (sh_syntaxtab[peek_char] & CBSDQUOTE))) + pass_next_character++; + + quoted = 1; + goto got_character; + } + } + + /* Parse a matched pair of quote characters. */ + if MBTEST(shellquote (character)) + { + push_delimiter (dstack, character); + ttok = parse_matched_pair (character, character, character, &ttoklen, (character == '`') ? P_COMMAND : 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + all_digit_token = 0; + quoted = 1; + dollar_present |= (character == '"' && strchr (ttok, '$') != 0); + FREE (ttok); + goto next_character; + } + +#ifdef COND_REGEXP + /* When parsing a regexp as a single word inside a conditional command, + we need to special-case characters special to both the shell and + regular expressions. Right now, that is only '(' and '|'. */ /*)*/ + if MBTEST((parser_state & PST_REGEXP) && (character == '(' || character == '|')) /*)*/ + { + if (character == '|') + goto got_character; + + push_delimiter (dstack, character); + ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = all_digit_token = 0; + goto next_character; + } +#endif /* COND_REGEXP */ + +#ifdef EXTENDED_GLOB + /* Parse a ksh-style extended pattern matching specification. */ + if MBTEST(extended_glob && PATTERN_CHAR (character)) + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '(') /* ) */ + { + push_delimiter (dstack, peek_char); + ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + token[token_index++] = peek_char; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = all_digit_token = 0; + goto next_character; + } + else + shell_ungetc (peek_char); + } +#endif /* EXTENDED_GLOB */ + + /* If the delimiter character is not single quote, parse some of + the shell expansions that must be read as a single word. */ + if (shellexp (character)) + { + peek_char = shell_getc (1); + /* $(...), <(...), >(...), $((...)), ${...}, and $[...] constructs */ + if MBTEST(peek_char == '(' || + ((peek_char == '{' || peek_char == '[') && character == '$')) /* ) ] } */ + { + if (peek_char == '{') /* } */ + ttok = parse_matched_pair (cd, '{', '}', &ttoklen, P_FIRSTCLOSE|P_DOLBRACE); + else if (peek_char == '(') /* ) */ + { + /* XXX - push and pop the `(' as a delimiter for use by + the command-oriented-history code. This way newlines + appearing in the $(...) string get added to the + history literally rather than causing a possibly- + incorrect `;' to be added. ) */ + push_delimiter (dstack, peek_char); + ttok = parse_comsub (cd, '(', ')', &ttoklen, P_COMMAND); + pop_delimiter (dstack); + } + else + ttok = parse_matched_pair (cd, '[', ']', &ttoklen, 0); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + token[token_index++] = peek_char; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = 1; + all_digit_token = 0; + goto next_character; + } + /* This handles $'...' and $"..." new-style quoted strings. */ + else if MBTEST(character == '$' && (peek_char == '\'' || peek_char == '"')) + { + int first_line; + + first_line = line_number; + push_delimiter (dstack, peek_char); + ttok = parse_matched_pair (peek_char, peek_char, peek_char, + &ttoklen, + (peek_char == '\'') ? P_ALLOWESC : 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; + if (peek_char == '\'') + { + ttrans = ansiexpand (ttok, 0, ttoklen - 1, &ttranslen); + free (ttok); + + /* Insert the single quotes and correctly quote any + embedded single quotes (allowed because P_ALLOWESC was + passed to parse_matched_pair). */ + ttok = sh_single_quote (ttrans); + free (ttrans); + ttranslen = strlen (ttok); + ttrans = ttok; + } + else + { + /* Try to locale-expand the converted string. */ + ttrans = localeexpand (ttok, 0, ttoklen - 1, first_line, &ttranslen); + free (ttok); + + /* Add the double quotes back */ + ttok = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + ttranslen += 2; + ttrans = ttok; + } + + RESIZE_MALLOCED_BUFFER (token, token_index, ttranslen + 1, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + strcpy (token + token_index, ttrans); + token_index += ttranslen; + FREE (ttrans); + quoted = 1; + all_digit_token = 0; + goto next_character; + } + /* This could eventually be extended to recognize all of the + shell's single-character parameter expansions, and set flags.*/ + else if MBTEST(character == '$' && peek_char == '$') + { + RESIZE_MALLOCED_BUFFER (token, token_index, 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = '$'; + token[token_index++] = peek_char; + dollar_present = 1; + all_digit_token = 0; + goto next_character; + } + else + shell_ungetc (peek_char); + } + +#if defined (ARRAY_VARS) + /* Identify possible array subscript assignment; match [...]. If + parser_state&PST_COMPASSIGN, we need to parse [sub]=words treating + `sub' as if it were enclosed in double quotes. */ + else if MBTEST(character == '[' && /* ] */ + ((token_index > 0 && assignment_acceptable (last_read_token) && token_is_ident (token, token_index)) || + (token_index == 0 && (parser_state&PST_COMPASSIGN)))) + { + ttok = parse_matched_pair (cd, '[', ']', &ttoklen, P_ARRAYSUB); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + all_digit_token = 0; + goto next_character; + } + /* Identify possible compound array variable assignment. */ + else if MBTEST(character == '=' && token_index > 0 && (assignment_acceptable (last_read_token) || (parser_state & PST_ASSIGNOK)) && token_is_assignment (token, token_index)) + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '(') /* ) */ + { + ttok = parse_compound_assignment (&ttoklen); + + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 4, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + + token[token_index++] = '='; + token[token_index++] = '('; + if (ttok) + { + strcpy (token + token_index, ttok); + token_index += ttoklen; + } + token[token_index++] = ')'; + FREE (ttok); + all_digit_token = 0; + compound_assignment = 1; +#if 1 + goto next_character; +#else + goto got_token; /* ksh93 seems to do this */ +#endif + } + else + shell_ungetc (peek_char); + } +#endif + + /* When not parsing a multi-character word construct, shell meta- + characters break words. */ + if MBTEST(shellbreak (character)) + { + shell_ungetc (character); + goto got_token; + } + +got_character: + + if (character == CTLESC || character == CTLNUL) + { + RESIZE_MALLOCED_BUFFER (token, token_index, 2, token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = CTLESC; + } + else +got_escaped_character: + RESIZE_MALLOCED_BUFFER (token, token_index, 1, token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + + token[token_index++] = character; + + all_digit_token &= DIGIT (character); + dollar_present |= character == '$'; + + next_character: + if (character == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* We want to remove quoted newlines (that is, a \ pair) + unless we are within single quotes or pass_next_character is + set (the shell equivalent of literal-next). */ + cd = current_delimiter (dstack); + character = shell_getc (cd != '\'' && pass_next_character == 0); + } /* end for (;;) */ + +got_token: + + /* Calls to RESIZE_MALLOCED_BUFFER ensure there is sufficient room. */ + token[token_index] = '\0'; + + /* Check to see what thing we should return. If the last_read_token + is a `<', or a `&', or the character which ended this token is + a '>' or '<', then, and ONLY then, is this input token a NUMBER. + Otherwise, it is just a word, and should be returned as such. */ + if MBTEST(all_digit_token && (character == '<' || character == '>' || + last_read_token == LESS_AND || + last_read_token == GREATER_AND)) + { + if (legal_number (token, &lvalue) && (int)lvalue == lvalue) + { + yylval.number = lvalue; + return (NUMBER); + } + } + + /* Check for special case tokens. */ + result = (last_shell_getc_is_singlebyte) ? special_case_tokens (token) : -1; + if (result >= 0) + return result; + +#if defined (ALIAS) + /* Posix.2 does not allow reserved words to be aliased, so check for all + of them, including special cases, before expanding the current token + as an alias. */ + if MBTEST(posixly_correct) + CHECK_FOR_RESERVED_WORD (token); + + /* Aliases are expanded iff EXPAND_ALIASES is non-zero, and quoting + inhibits alias expansion. */ + if (expand_aliases && quoted == 0) + { + result = alias_expand_token (token); + if (result == RE_READ_TOKEN) + return (RE_READ_TOKEN); + else if (result == NO_EXPANSION) + parser_state &= ~PST_ALEXPNEXT; + } + + /* If not in Posix.2 mode, check for reserved words after alias + expansion. */ + if MBTEST(posixly_correct == 0) +#endif + CHECK_FOR_RESERVED_WORD (token); + + the_word = (WORD_DESC *)xmalloc (sizeof (WORD_DESC)); + the_word->word = (char *)xmalloc (1 + token_index); + the_word->flags = 0; + strcpy (the_word->word, token); + if (dollar_present) + the_word->flags |= W_HASDOLLAR; + if (quoted) + the_word->flags |= W_QUOTED; /*(*/ + if (compound_assignment && token[token_index-1] == ')') + the_word->flags |= W_COMPASSIGN; + /* A word is an assignment if it appears at the beginning of a + simple command, or after another assignment word. This is + context-dependent, so it cannot be handled in the grammar. */ + if (assignment (token, (parser_state & PST_COMPASSIGN) != 0)) + { + the_word->flags |= W_ASSIGNMENT; + /* Don't perform word splitting on assignment statements. */ + if (assignment_acceptable (last_read_token) || (parser_state & PST_COMPASSIGN) != 0) + { + the_word->flags |= W_NOSPLIT; + if (parser_state & PST_COMPASSIGN) + the_word->flags |= W_NOGLOB; /* XXX - W_NOBRACE? */ + } + } + + if (command_token_position (last_read_token)) + { + struct builtin *b; + b = builtin_address_internal (token, 0); + if (b && (b->flags & ASSIGNMENT_BUILTIN)) + parser_state |= PST_ASSIGNOK; + else if (STREQ (token, "eval") || STREQ (token, "let")) + parser_state |= PST_ASSIGNOK; + } + + yylval.word = the_word; + + if (token[0] == '{' && token[token_index-1] == '}' && + (character == '<' || character == '>')) + { + /* can use token; already copied to the_word */ + token[token_index-1] = '\0'; +#if defined (ARRAY_VARS) + if (legal_identifier (token+1) || valid_array_reference (token+1)) +#else + if (legal_identifier (token+1)) +#endif + { + strcpy (the_word->word, token+1); +/*itrace("read_token_word: returning REDIR_WORD for %s", the_word->word);*/ + return (REDIR_WORD); + } + } + + result = ((the_word->flags & (W_ASSIGNMENT|W_NOSPLIT)) == (W_ASSIGNMENT|W_NOSPLIT)) + ? ASSIGNMENT_WORD : WORD; + + switch (last_read_token) + { + case FUNCTION: + parser_state |= PST_ALLOWOPNBRC; + function_dstart = line_number; + break; + case CASE: + case SELECT: + case FOR: + if (word_top < MAX_CASE_NEST) + word_top++; + word_lineno[word_top] = line_number; + break; + } + + return (result); +} + +/* Return 1 if TOKSYM is a token that after being read would allow + a reserved word to be seen, else 0. */ +static int +reserved_word_acceptable (toksym) + int toksym; +{ + switch (toksym) + { + case '\n': + case ';': + case '(': + case ')': + case '|': + case '&': + case '{': + case '}': /* XXX */ + case AND_AND: + case BANG: + case BAR_AND: + case DO: + case DONE: + case ELIF: + case ELSE: + case ESAC: + case FI: + case IF: + case OR_OR: + case SEMI_SEMI: + case SEMI_AND: + case SEMI_SEMI_AND: + case THEN: + case TIME: + case TIMEOPT: + case TIMEIGN: + case COPROC: + case UNTIL: + case WHILE: + case 0: + return 1; + default: +#if defined (COPROCESS_SUPPORT) + if (last_read_token == WORD && token_before_that == COPROC) + return 1; +#endif + if (last_read_token == WORD && token_before_that == FUNCTION) + return 1; + return 0; + } +} + +/* Return the index of TOKEN in the alist of reserved words, or -1 if + TOKEN is not a shell reserved word. */ +int +find_reserved_word (tokstr) + char *tokstr; +{ + int i; + for (i = 0; word_token_alist[i].word; i++) + if (STREQ (tokstr, word_token_alist[i].word)) + return i; + return -1; +} + +/* An interface to let the rest of the shell (primarily the completion + system) know what the parser is expecting. */ +int +parser_in_command_position () +{ + return (command_token_position (last_read_token)); +} + +#if 0 +#if defined (READLINE) +/* Called after each time readline is called. This insures that whatever + the new prompt string is gets propagated to readline's local prompt + variable. */ +static void +reset_readline_prompt () +{ + char *temp_prompt; + + if (prompt_string_pointer) + { + temp_prompt = (*prompt_string_pointer) + ? decode_prompt_string (*prompt_string_pointer) + : (char *)NULL; + + if (temp_prompt == 0) + { + temp_prompt = (char *)xmalloc (1); + temp_prompt[0] = '\0'; + } + + FREE (current_readline_prompt); + current_readline_prompt = temp_prompt; + } +} +#endif /* READLINE */ +#endif /* 0 */ + +#if defined (HISTORY) +/* A list of tokens which can be followed by newlines, but not by + semi-colons. When concatenating multiple lines of history, the + newline separator for such tokens is replaced with a space. */ +static const int no_semi_successors[] = { + '\n', '{', '(', ')', ';', '&', '|', + CASE, DO, ELSE, IF, SEMI_SEMI, SEMI_AND, SEMI_SEMI_AND, THEN, UNTIL, + WHILE, AND_AND, OR_OR, IN, + 0 +}; + +/* If we are not within a delimited expression, try to be smart + about which separators can be semi-colons and which must be + newlines. Returns the string that should be added into the + history entry. LINE is the line we're about to add; it helps + make some more intelligent decisions in certain cases. */ +char * +history_delimiting_chars (line) + const char *line; +{ + static int last_was_heredoc = 0; /* was the last entry the start of a here document? */ + register int i; + + if ((parser_state & PST_HEREDOC) == 0) + last_was_heredoc = 0; + + if (dstack.delimiter_depth != 0) + return ("\n"); + + /* We look for current_command_line_count == 2 because we are looking to + add the first line of the body of the here document (the second line + of the command). We also keep LAST_WAS_HEREDOC as a private sentinel + variable to note when we think we added the first line of a here doc + (the one with a "<<" somewhere in it) */ + if (parser_state & PST_HEREDOC) + { + if (last_was_heredoc) + { + last_was_heredoc = 0; + return "\n"; + } + return (current_command_line_count == 2 ? "\n" : ""); + } + + if (parser_state & PST_COMPASSIGN) + return (" "); + + /* First, handle some special cases. */ + /*(*/ + /* If we just read `()', assume it's a function definition, and don't + add a semicolon. If the token before the `)' was not `(', and we're + not in the midst of parsing a case statement, assume it's a + parenthesized command and add the semicolon. */ + /*)(*/ + if (token_before_that == ')') + { + if (two_tokens_ago == '(') /*)*/ /* function def */ + return " "; + /* This does not work for subshells inside case statement + command lists. It's a suboptimal solution. */ + else if (parser_state & PST_CASESTMT) /* case statement pattern */ + return " "; + else + return "; "; /* (...) subshell */ + } + else if (token_before_that == WORD && two_tokens_ago == FUNCTION) + return " "; /* function def using `function name' without `()' */ + + /* If we're not in a here document, but we think we're about to parse one, + and we would otherwise return a `;', return a newline to delimit the + line with the here-doc delimiter */ + else if ((parser_state & PST_HEREDOC) == 0 && current_command_line_count > 1 && last_read_token == '\n' && strstr (line, "<<")) + { + last_was_heredoc = 1; + return "\n"; + } + + else if (token_before_that == WORD && two_tokens_ago == FOR) + { + /* Tricky. `for i\nin ...' should not have a semicolon, but + `for i\ndo ...' should. We do what we can. */ + for (i = shell_input_line_index; whitespace (shell_input_line[i]); i++) + ; + if (shell_input_line[i] && shell_input_line[i] == 'i' && shell_input_line[i+1] == 'n') + return " "; + return ";"; + } + else if (two_tokens_ago == CASE && token_before_that == WORD && (parser_state & PST_CASESTMT)) + return " "; + + for (i = 0; no_semi_successors[i]; i++) + { + if (token_before_that == no_semi_successors[i]) + return (" "); + } + + return ("; "); +} +#endif /* HISTORY */ + +/* Issue a prompt, or prepare to issue a prompt when the next character + is read. */ +static void +prompt_again () +{ + char *temp_prompt; + + if (interactive == 0 || expanding_alias ()) /* XXX */ + return; + + ps1_prompt = get_string_value ("PS1"); + ps2_prompt = get_string_value ("PS2"); + + if (!prompt_string_pointer) + prompt_string_pointer = &ps1_prompt; + + temp_prompt = *prompt_string_pointer + ? decode_prompt_string (*prompt_string_pointer) + : (char *)NULL; + + if (temp_prompt == 0) + { + temp_prompt = (char *)xmalloc (1); + temp_prompt[0] = '\0'; + } + + current_prompt_string = *prompt_string_pointer; + prompt_string_pointer = &ps2_prompt; + +#if defined (READLINE) + if (!no_line_editing) + { + FREE (current_readline_prompt); + current_readline_prompt = temp_prompt; + } + else +#endif /* READLINE */ + { + FREE (current_decoded_prompt); + current_decoded_prompt = temp_prompt; + } +} + +int +get_current_prompt_level () +{ + return ((current_prompt_string && current_prompt_string == ps2_prompt) ? 2 : 1); +} + +void +set_current_prompt_level (x) + int x; +{ + prompt_string_pointer = (x == 2) ? &ps2_prompt : &ps1_prompt; + current_prompt_string = *prompt_string_pointer; +} + +static void +print_prompt () +{ + fprintf (stderr, "%s", current_decoded_prompt); + fflush (stderr); +} + +/* Return a string which will be printed as a prompt. The string + may contain special characters which are decoded as follows: + + \a bell (ascii 07) + \d the date in Day Mon Date format + \e escape (ascii 033) + \h the hostname up to the first `.' + \H the hostname + \j the number of active jobs + \l the basename of the shell's tty device name + \n CRLF + \r CR + \s the name of the shell + \t the time in 24-hour hh:mm:ss format + \T the time in 12-hour hh:mm:ss format + \@ the time in 12-hour hh:mm am/pm format + \A the time in 24-hour hh:mm format + \D{fmt} the result of passing FMT to strftime(3) + \u your username + \v the version of bash (e.g., 2.00) + \V the release of bash, version + patchlevel (e.g., 2.00.0) + \w the current working directory + \W the last element of $PWD + \! the history number of this command + \# the command number of this command + \$ a $ or a # if you are root + \nnn character code nnn in octal + \\ a backslash + \[ begin a sequence of non-printing chars + \] end a sequence of non-printing chars +*/ +#define PROMPT_GROWTH 48 +char * +decode_prompt_string (string) + char *string; +{ + WORD_LIST *list; + char *result, *t; + struct dstack save_dstack; + int last_exit_value, last_comsub_pid; +#if defined (PROMPT_STRING_DECODE) + int result_size, result_index; + int c, n, i; + char *temp, octal_string[4]; + struct tm *tm; + time_t the_time; + char timebuf[128]; + char *timefmt; + + result = (char *)xmalloc (result_size = PROMPT_GROWTH); + result[result_index = 0] = 0; + temp = (char *)NULL; + + while (c = *string++) + { + if (posixly_correct && c == '!') + { + if (*string == '!') + { + temp = savestring ("!"); + goto add_string; + } + else + { +#if !defined (HISTORY) + temp = savestring ("1"); +#else /* HISTORY */ + temp = itos (history_number ()); +#endif /* HISTORY */ + string--; /* add_string increments string again. */ + goto add_string; + } + } + if (c == '\\') + { + c = *string; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + strncpy (octal_string, string, 3); + octal_string[3] = '\0'; + + n = read_octal (octal_string); + temp = (char *)xmalloc (3); + + if (n == CTLESC || n == CTLNUL) + { + temp[0] = CTLESC; + temp[1] = n; + temp[2] = '\0'; + } + else if (n == -1) + { + temp[0] = '\\'; + temp[1] = '\0'; + } + else + { + temp[0] = n; + temp[1] = '\0'; + } + + for (c = 0; n != -1 && c < 3 && ISOCTAL (*string); c++) + string++; + + c = 0; /* tested at add_string: */ + goto add_string; + + case 'd': + case 't': + case 'T': + case '@': + case 'A': + /* Make the current time/date into a string. */ + (void) time (&the_time); +#if defined (HAVE_TZSET) + sv_tz ("TZ"); /* XXX -- just make sure */ +#endif + tm = localtime (&the_time); + + if (c == 'd') + n = strftime (timebuf, sizeof (timebuf), "%a %b %d", tm); + else if (c == 't') + n = strftime (timebuf, sizeof (timebuf), "%H:%M:%S", tm); + else if (c == 'T') + n = strftime (timebuf, sizeof (timebuf), "%I:%M:%S", tm); + else if (c == '@') + n = strftime (timebuf, sizeof (timebuf), "%I:%M %p", tm); + else if (c == 'A') + n = strftime (timebuf, sizeof (timebuf), "%H:%M", tm); + + if (n == 0) + timebuf[0] = '\0'; + else + timebuf[sizeof(timebuf) - 1] = '\0'; + + temp = savestring (timebuf); + goto add_string; + + case 'D': /* strftime format */ + if (string[1] != '{') /* } */ + goto not_escape; + + (void) time (&the_time); + tm = localtime (&the_time); + string += 2; /* skip { */ + timefmt = xmalloc (strlen (string) + 3); + for (t = timefmt; *string && *string != '}'; ) + *t++ = *string++; + *t = '\0'; + c = *string; /* tested at add_string */ + if (timefmt[0] == '\0') + { + timefmt[0] = '%'; + timefmt[1] = 'X'; /* locale-specific current time */ + timefmt[2] = '\0'; + } + n = strftime (timebuf, sizeof (timebuf), timefmt, tm); + free (timefmt); + + if (n == 0) + timebuf[0] = '\0'; + else + timebuf[sizeof(timebuf) - 1] = '\0'; + + if (promptvars || posixly_correct) + /* Make sure that expand_prompt_string is called with a + second argument of Q_DOUBLE_QUOTES if we use this + function here. */ + temp = sh_backslash_quote_for_double_quotes (timebuf); + else + temp = savestring (timebuf); + goto add_string; + + case 'n': + temp = (char *)xmalloc (3); + temp[0] = no_line_editing ? '\n' : '\r'; + temp[1] = no_line_editing ? '\0' : '\n'; + temp[2] = '\0'; + goto add_string; + + case 's': + temp = base_pathname (shell_name); + temp = savestring (temp); + goto add_string; + + case 'v': + case 'V': + temp = (char *)xmalloc (16); + if (c == 'v') + strcpy (temp, dist_version); + else + sprintf (temp, "%s.%d", dist_version, patch_level); + goto add_string; + + case 'w': + case 'W': + { + /* Use the value of PWD because it is much more efficient. */ + char t_string[PATH_MAX]; + int tlen; + + temp = get_string_value ("PWD"); + + if (temp == 0) + { + if (getcwd (t_string, sizeof(t_string)) == 0) + { + t_string[0] = '.'; + tlen = 1; + } + else + tlen = strlen (t_string); + } + else + { + tlen = sizeof (t_string) - 1; + strncpy (t_string, temp, tlen); + } + t_string[tlen] = '\0'; + +#if defined (MACOSX) + /* Convert from "fs" format to "input" format */ + temp = fnx_fromfs (t_string, strlen (t_string)); + if (temp != t_string) + strcpy (t_string, temp); +#endif + +#define ROOT_PATH(x) ((x)[0] == '/' && (x)[1] == 0) +#define DOUBLE_SLASH_ROOT(x) ((x)[0] == '/' && (x)[1] == '/' && (x)[2] == 0) + /* Abbreviate \W as ~ if $PWD == $HOME */ + if (c == 'W' && (((t = get_string_value ("HOME")) == 0) || STREQ (t, t_string) == 0)) + { + if (ROOT_PATH (t_string) == 0 && DOUBLE_SLASH_ROOT (t_string) == 0) + { + t = strrchr (t_string, '/'); + if (t) + memmove (t_string, t + 1, strlen (t)); /* strlen(t) to copy NULL */ + } + } +#undef ROOT_PATH +#undef DOUBLE_SLASH_ROOT + else + { + /* polite_directory_format is guaranteed to return a string + no longer than PATH_MAX - 1 characters. */ + temp = polite_directory_format (t_string); + if (temp != t_string) + strcpy (t_string, temp); + } + + temp = trim_pathname (t_string, PATH_MAX - 1); + /* If we're going to be expanding the prompt string later, + quote the directory name. */ + if (promptvars || posixly_correct) + /* Make sure that expand_prompt_string is called with a + second argument of Q_DOUBLE_QUOTES if we use this + function here. */ + temp = sh_backslash_quote_for_double_quotes (t_string); + else + temp = savestring (t_string); + + goto add_string; + } + + case 'u': + if (current_user.user_name == 0) + get_current_user_info (); + temp = savestring (current_user.user_name); + goto add_string; + + case 'h': + case 'H': + temp = savestring (current_host_name); + if (c == 'h' && (t = (char *)strchr (temp, '.'))) + *t = '\0'; + goto add_string; + + case '#': + temp = itos (current_command_number); + goto add_string; + + case '!': +#if !defined (HISTORY) + temp = savestring ("1"); +#else /* HISTORY */ + temp = itos (history_number ()); +#endif /* HISTORY */ + goto add_string; + + case '$': + t = temp = (char *)xmalloc (3); + if ((promptvars || posixly_correct) && (current_user.euid != 0)) + *t++ = '\\'; + *t++ = current_user.euid == 0 ? '#' : '$'; + *t = '\0'; + goto add_string; + + case 'j': + temp = itos (count_all_jobs ()); + goto add_string; + + case 'l': +#if defined (HAVE_TTYNAME) + temp = (char *)ttyname (fileno (stdin)); + t = temp ? base_pathname (temp) : "tty"; + temp = savestring (t); +#else + temp = savestring ("tty"); +#endif /* !HAVE_TTYNAME */ + goto add_string; + +#if defined (READLINE) + case '[': + case ']': + if (no_line_editing) + { + string++; + break; + } + temp = (char *)xmalloc (3); + n = (c == '[') ? RL_PROMPT_START_IGNORE : RL_PROMPT_END_IGNORE; + i = 0; + if (n == CTLESC || n == CTLNUL) + temp[i++] = CTLESC; + temp[i++] = n; + temp[i] = '\0'; + goto add_string; +#endif /* READLINE */ + + case '\\': + case 'a': + case 'e': + case 'r': + temp = (char *)xmalloc (2); + if (c == 'a') + temp[0] = '\07'; + else if (c == 'e') + temp[0] = '\033'; + else if (c == 'r') + temp[0] = '\r'; + else /* (c == '\\') */ + temp[0] = c; + temp[1] = '\0'; + goto add_string; + + default: +not_escape: + temp = (char *)xmalloc (3); + temp[0] = '\\'; + temp[1] = c; + temp[2] = '\0'; + + add_string: + if (c) + string++; + result = + sub_append_string (temp, result, &result_index, &result_size); + temp = (char *)NULL; /* Freed in sub_append_string (). */ + result[result_index] = '\0'; + break; + } + } + else + { + RESIZE_MALLOCED_BUFFER (result, result_index, 3, result_size, PROMPT_GROWTH); + result[result_index++] = c; + result[result_index] = '\0'; + } + } +#else /* !PROMPT_STRING_DECODE */ + result = savestring (string); +#endif /* !PROMPT_STRING_DECODE */ + + /* Save the delimiter stack and point `dstack' to temp space so any + command substitutions in the prompt string won't result in screwing + up the parser's quoting state. */ + save_dstack = dstack; + dstack = temp_dstack; + dstack.delimiter_depth = 0; + + /* Perform variable and parameter expansion and command substitution on + the prompt string. */ + if (promptvars || posixly_correct) + { + last_exit_value = last_command_exit_value; + last_comsub_pid = last_command_subst_pid; + list = expand_prompt_string (result, Q_DOUBLE_QUOTES, 0); + free (result); + result = string_list (list); + dispose_words (list); + last_command_exit_value = last_exit_value; + last_command_subst_pid = last_comsub_pid; + } + else + { + t = dequote_string (result); + free (result); + result = t; + } + + dstack = save_dstack; + + return (result); +} + +/************************************************ + * * + * ERROR HANDLING * + * * + ************************************************/ + +/* Report a syntax error, and restart the parser. Call here for fatal + errors. */ +int +yyerror (msg) + const char *msg; +{ + report_syntax_error ((char *)NULL); + reset_parser (); + return (0); +} + +static char * +error_token_from_token (tok) + int tok; +{ + char *t; + + if (t = find_token_in_alist (tok, word_token_alist, 0)) + return t; + + if (t = find_token_in_alist (tok, other_token_alist, 0)) + return t; + + t = (char *)NULL; + /* This stuff is dicy and needs closer inspection */ + switch (current_token) + { + case WORD: + case ASSIGNMENT_WORD: + if (yylval.word) + t = savestring (yylval.word->word); + break; + case NUMBER: + t = itos (yylval.number); + break; + case ARITH_CMD: + if (yylval.word_list) + t = string_list (yylval.word_list); + break; + case ARITH_FOR_EXPRS: + if (yylval.word_list) + t = string_list_internal (yylval.word_list, " ; "); + break; + case COND_CMD: + t = (char *)NULL; /* punt */ + break; + } + + return t; +} + +static char * +error_token_from_text () +{ + char *msg, *t; + int token_end, i; + + t = shell_input_line; + i = shell_input_line_index; + token_end = 0; + msg = (char *)NULL; + + if (i && t[i] == '\0') + i--; + + while (i && (whitespace (t[i]) || t[i] == '\n')) + i--; + + if (i) + token_end = i + 1; + + while (i && (member (t[i], " \n\t;|&") == 0)) + i--; + + while (i != token_end && (whitespace (t[i]) || t[i] == '\n')) + i++; + + /* Return our idea of the offending token. */ + if (token_end || (i == 0 && token_end == 0)) + { + if (token_end) + msg = substring (t, i, token_end); + else /* one-character token */ + { + msg = (char *)xmalloc (2); + msg[0] = t[i]; + msg[1] = '\0'; + } + } + + return (msg); +} + +static void +print_offending_line () +{ + char *msg; + int token_end; + + msg = savestring (shell_input_line); + token_end = strlen (msg); + while (token_end && msg[token_end - 1] == '\n') + msg[--token_end] = '\0'; + + parser_error (line_number, "`%s'", msg); + free (msg); +} + +/* Report a syntax error with line numbers, etc. + Call here for recoverable errors. If you have a message to print, + then place it in MESSAGE, otherwise pass NULL and this will figure + out an appropriate message for you. */ +static void +report_syntax_error (message) + char *message; +{ + char *msg, *p; + + if (message) + { + parser_error (line_number, "%s", message); + if (interactive && EOF_Reached) + EOF_Reached = 0; + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; + return; + } + + /* If the line of input we're reading is not null, try to find the + objectionable token. First, try to figure out what token the + parser's complaining about by looking at current_token. */ + if (current_token != 0 && EOF_Reached == 0 && (msg = error_token_from_token (current_token))) + { + if (ansic_shouldquote (msg)) + { + p = ansic_quote (msg, 0, NULL); + free (msg); + msg = p; + } + parser_error (line_number, _("syntax error near unexpected token `%s'"), msg); + free (msg); + + if (interactive == 0) + print_offending_line (); + + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; + return; + } + + /* If looking at the current token doesn't prove fruitful, try to find the + offending token by analyzing the text of the input line near the current + input line index and report what we find. */ + if (shell_input_line && *shell_input_line) + { + msg = error_token_from_text (); + if (msg) + { + parser_error (line_number, _("syntax error near `%s'"), msg); + free (msg); + } + + /* If not interactive, print the line containing the error. */ + if (interactive == 0) + print_offending_line (); + } + else + { + msg = EOF_Reached ? _("syntax error: unexpected end of file") : _("syntax error"); + parser_error (line_number, "%s", msg); + /* When the shell is interactive, this file uses EOF_Reached + only for error reporting. Other mechanisms are used to + decide whether or not to exit. */ + if (interactive && EOF_Reached) + EOF_Reached = 0; + } + + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; +} + +/* ??? Needed function. ??? We have to be able to discard the constructs + created during parsing. In the case of error, we want to return + allocated objects to the memory pool. In the case of no error, we want + to throw away the information about where the allocated objects live. + (dispose_command () will actually free the command.) */ +static void +discard_parser_constructs (error_p) + int error_p; +{ +} + +/************************************************ + * * + * EOF HANDLING * + * * + ************************************************/ + +/* Do that silly `type "bye" to exit' stuff. You know, "ignoreeof". */ + +/* A flag denoting whether or not ignoreeof is set. */ +int ignoreeof = 0; + +/* The number of times that we have encountered an EOF character without + another character intervening. When this gets above the limit, the + shell terminates. */ +int eof_encountered = 0; + +/* The limit for eof_encountered. */ +int eof_encountered_limit = 10; + +/* If we have EOF as the only input unit, this user wants to leave + the shell. If the shell is not interactive, then just leave. + Otherwise, if ignoreeof is set, and we haven't done this the + required number of times in a row, print a message. */ +static void +handle_eof_input_unit () +{ + if (interactive) + { + /* shell.c may use this to decide whether or not to write out the + history, among other things. We use it only for error reporting + in this file. */ + if (EOF_Reached) + EOF_Reached = 0; + + /* If the user wants to "ignore" eof, then let her do so, kind of. */ + if (ignoreeof) + { + if (eof_encountered < eof_encountered_limit) + { + fprintf (stderr, _("Use \"%s\" to leave the shell.\n"), + login_shell ? "logout" : "exit"); + eof_encountered++; + /* Reset the parsing state. */ + last_read_token = current_token = '\n'; + /* Reset the prompt string to be $PS1. */ + prompt_string_pointer = (char **)NULL; + prompt_again (); + return; + } + } + + /* In this case EOF should exit the shell. Do it now. */ + reset_parser (); + exit_builtin ((WORD_LIST *)NULL); + } + else + { + /* We don't write history files, etc., for non-interactive shells. */ + EOF_Reached = 1; + } +} + +/************************************************ + * * + * STRING PARSING FUNCTIONS * + * * + ************************************************/ + +/* It's very important that these two functions treat the characters + between ( and ) identically. */ + +static WORD_LIST parse_string_error; + +/* Take a string and run it through the shell parser, returning the + resultant word list. Used by compound array assignment. */ +WORD_LIST * +parse_string_to_word_list (s, flags, whom) + char *s; + int flags; + const char *whom; +{ + WORD_LIST *wl; + int tok, orig_current_token, orig_line_number, orig_input_terminator; + int orig_line_count; + int old_echo_input, old_expand_aliases; +#if defined (HISTORY) + int old_remember_on_history, old_history_expansion_inhibited; +#endif + +#if defined (HISTORY) + old_remember_on_history = remember_on_history; +# if defined (BANG_HISTORY) + old_history_expansion_inhibited = history_expansion_inhibited; +# endif + bash_history_disable (); +#endif + + orig_line_number = line_number; + orig_line_count = current_command_line_count; + orig_input_terminator = shell_input_line_terminator; + old_echo_input = echo_input_at_read; + old_expand_aliases = expand_aliases; + + push_stream (1); + last_read_token = WORD; /* WORD to allow reserved words here */ + current_command_line_count = 0; + echo_input_at_read = expand_aliases = 0; + + with_input_from_string (s, whom); + wl = (WORD_LIST *)NULL; + + if (flags & 1) + parser_state |= PST_COMPASSIGN|PST_REPARSE; + + while ((tok = read_token (READ)) != yacc_EOF) + { + if (tok == '\n' && *bash_input.location.string == '\0') + break; + if (tok == '\n') /* Allow newlines in compound assignments */ + continue; + if (tok != WORD && tok != ASSIGNMENT_WORD) + { + line_number = orig_line_number + line_number - 1; + orig_current_token = current_token; + current_token = tok; + yyerror (NULL); /* does the right thing */ + current_token = orig_current_token; + if (wl) + dispose_words (wl); + wl = &parse_string_error; + break; + } + wl = make_word_list (yylval.word, wl); + } + + last_read_token = '\n'; + pop_stream (); + +#if defined (HISTORY) + remember_on_history = old_remember_on_history; +# if defined (BANG_HISTORY) + history_expansion_inhibited = old_history_expansion_inhibited; +# endif /* BANG_HISTORY */ +#endif /* HISTORY */ + + echo_input_at_read = old_echo_input; + expand_aliases = old_expand_aliases; + + current_command_line_count = orig_line_count; + shell_input_line_terminator = orig_input_terminator; + + if (flags & 1) + parser_state &= ~(PST_COMPASSIGN|PST_REPARSE); + + if (wl == &parse_string_error) + { + last_command_exit_value = EXECUTION_FAILURE; + if (interactive_shell == 0 && posixly_correct) + jump_to_top_level (FORCE_EOF); + else + jump_to_top_level (DISCARD); + } + + return (REVERSE_LIST (wl, WORD_LIST *)); +} + +static char * +parse_compound_assignment (retlenp) + int *retlenp; +{ + WORD_LIST *wl, *rl; + int tok, orig_line_number, orig_token_size, orig_last_token, assignok; + char *saved_token, *ret; + + saved_token = token; + orig_token_size = token_buffer_size; + orig_line_number = line_number; + orig_last_token = last_read_token; + + last_read_token = WORD; /* WORD to allow reserved words here */ + + token = (char *)NULL; + token_buffer_size = 0; + + assignok = parser_state&PST_ASSIGNOK; /* XXX */ + + wl = (WORD_LIST *)NULL; /* ( */ + parser_state |= PST_COMPASSIGN; + + while ((tok = read_token (READ)) != ')') + { + if (tok == '\n') /* Allow newlines in compound assignments */ + { + if (SHOULD_PROMPT ()) + prompt_again (); + continue; + } + if (tok != WORD && tok != ASSIGNMENT_WORD) + { + current_token = tok; /* for error reporting */ + if (tok == yacc_EOF) /* ( */ + parser_error (orig_line_number, _("unexpected EOF while looking for matching `)'")); + else + yyerror(NULL); /* does the right thing */ + if (wl) + dispose_words (wl); + wl = &parse_string_error; + break; + } + wl = make_word_list (yylval.word, wl); + } + + FREE (token); + token = saved_token; + token_buffer_size = orig_token_size; + + parser_state &= ~PST_COMPASSIGN; + + if (wl == &parse_string_error) + { + last_command_exit_value = EXECUTION_FAILURE; + last_read_token = '\n'; /* XXX */ + if (interactive_shell == 0 && posixly_correct) + jump_to_top_level (FORCE_EOF); + else + jump_to_top_level (DISCARD); + } + + last_read_token = orig_last_token; /* XXX - was WORD? */ + + if (wl) + { + rl = REVERSE_LIST (wl, WORD_LIST *); + ret = string_list (rl); + dispose_words (rl); + } + else + ret = (char *)NULL; + + if (retlenp) + *retlenp = (ret && *ret) ? strlen (ret) : 0; + + if (assignok) + parser_state |= PST_ASSIGNOK; + + return ret; +} + +/************************************************ + * * + * SAVING AND RESTORING PARTIAL PARSE STATE * + * * + ************************************************/ + +sh_parser_state_t * +save_parser_state (ps) + sh_parser_state_t *ps; +{ + if (ps == 0) + ps = (sh_parser_state_t *)xmalloc (sizeof (sh_parser_state_t)); + if (ps == 0) + return ((sh_parser_state_t *)NULL); + + ps->parser_state = parser_state; + ps->token_state = save_token_state (); + + ps->input_line_terminator = shell_input_line_terminator; + ps->eof_encountered = eof_encountered; + + ps->prompt_string_pointer = prompt_string_pointer; + + ps->current_command_line_count = current_command_line_count; + +#if defined (HISTORY) + ps->remember_on_history = remember_on_history; +# if defined (BANG_HISTORY) + ps->history_expansion_inhibited = history_expansion_inhibited; +# endif +#endif + + ps->last_command_exit_value = last_command_exit_value; +#if defined (ARRAY_VARS) + ps->pipestatus = save_pipestatus_array (); +#endif + + ps->last_shell_builtin = last_shell_builtin; + ps->this_shell_builtin = this_shell_builtin; + + ps->expand_aliases = expand_aliases; + ps->echo_input_at_read = echo_input_at_read; + + ps->token = token; + ps->token_buffer_size = token_buffer_size; + /* Force reallocation on next call to read_token_word */ + token = 0; + token_buffer_size = 0; + + return (ps); +} + +void +restore_parser_state (ps) + sh_parser_state_t *ps; +{ + if (ps == 0) + return; + + parser_state = ps->parser_state; + if (ps->token_state) + { + restore_token_state (ps->token_state); + free (ps->token_state); + } + + shell_input_line_terminator = ps->input_line_terminator; + eof_encountered = ps->eof_encountered; + + prompt_string_pointer = ps->prompt_string_pointer; + + current_command_line_count = ps->current_command_line_count; + +#if defined (HISTORY) + remember_on_history = ps->remember_on_history; +# if defined (BANG_HISTORY) + history_expansion_inhibited = ps->history_expansion_inhibited; +# endif +#endif + + last_command_exit_value = ps->last_command_exit_value; +#if defined (ARRAY_VARS) + restore_pipestatus_array (ps->pipestatus); +#endif + + last_shell_builtin = ps->last_shell_builtin; + this_shell_builtin = ps->this_shell_builtin; + + expand_aliases = ps->expand_aliases; + echo_input_at_read = ps->echo_input_at_read; + + FREE (token); + token = ps->token; + token_buffer_size = ps->token_buffer_size; +} + +sh_input_line_state_t * +save_input_line_state (ls) + sh_input_line_state_t *ls; +{ + if (ls == 0) + ls = (sh_input_line_state_t *)xmalloc (sizeof (sh_input_line_state_t)); + if (ls == 0) + return ((sh_input_line_state_t *)NULL); + + ls->input_line = shell_input_line; + ls->input_line_size = shell_input_line_size; + ls->input_line_len = shell_input_line_len; + ls->input_line_index = shell_input_line_index; + + /* force reallocation */ + shell_input_line = 0; + shell_input_line_size = shell_input_line_len = shell_input_line_index = 0; + + return ls; +} + +void +restore_input_line_state (ls) + sh_input_line_state_t *ls; +{ + FREE (shell_input_line); + shell_input_line = ls->input_line; + shell_input_line_size = ls->input_line_size; + shell_input_line_len = ls->input_line_len; + shell_input_line_index = ls->input_line_index; + + set_line_mbstate (); +} + +/************************************************ + * * + * MULTIBYTE CHARACTER HANDLING * + * * + ************************************************/ + +#if defined (HANDLE_MULTIBYTE) +static void +set_line_mbstate () +{ + int c; + size_t i, previ, len; + mbstate_t mbs, prevs; + size_t mbclen; + + if (shell_input_line == NULL) + return; + len = strlen (shell_input_line); /* XXX - shell_input_line_len ? */ + FREE (shell_input_line_property); + shell_input_line_property = (char *)xmalloc (len + 1); + + memset (&prevs, '\0', sizeof (mbstate_t)); + for (i = previ = 0; i < len; i++) + { + mbs = prevs; + + c = shell_input_line[i]; + if (c == EOF) + { + size_t j; + for (j = i; j < len; j++) + shell_input_line_property[j] = 1; + break; + } + + mbclen = mbrlen (shell_input_line + previ, i - previ + 1, &mbs); + if (mbclen == 1 || mbclen == (size_t)-1) + { + mbclen = 1; + previ = i + 1; + } + else if (mbclen == (size_t)-2) + mbclen = 0; + else if (mbclen > 1) + { + mbclen = 0; + previ = i + 1; + prevs = mbs; + } + else + { + /* XXX - what to do if mbrlen returns 0? (null wide character) */ + size_t j; + for (j = i; j < len; j++) + shell_input_line_property[j] = 1; + break; + } + + shell_input_line_property[i] = mbclen; + } +} +#endif /* HANDLE_MULTIBYTE */ diff --git a/.pc/bash43-020.diff/patchlevel.h b/.pc/bash43-020.diff/patchlevel.h new file mode 100644 index 0000000..0a57e4b --- /dev/null +++ b/.pc/bash43-020.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 19 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-020.diff/shell.h b/.pc/bash43-020.diff/shell.h new file mode 100644 index 0000000..243e467 --- /dev/null +++ b/.pc/bash43-020.diff/shell.h @@ -0,0 +1,186 @@ +/* shell.h -- The data structures used by the shell */ + +/* Copyright (C) 1993-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "bashjmp.h" + +#include "command.h" +#include "syntax.h" +#include "general.h" +#include "error.h" +#include "variables.h" +#include "arrayfunc.h" +#include "quit.h" +#include "maxpath.h" +#include "unwind_prot.h" +#include "dispose_cmd.h" +#include "make_cmd.h" +#include "ocache.h" +#include "subst.h" +#include "sig.h" +#include "pathnames.h" +#include "externs.h" + +extern int EOF_Reached; + +#define NO_PIPE -1 +#define REDIRECT_BOTH -2 + +#define NO_VARIABLE -1 + +/* Values that can be returned by execute_command (). */ +#define EXECUTION_FAILURE 1 +#define EXECUTION_SUCCESS 0 + +/* Usage messages by builtins result in a return status of 2. */ +#define EX_BADUSAGE 2 + +#define EX_MISCERROR 2 + +/* Special exit statuses used by the shell, internally and externally. */ +#define EX_RETRYFAIL 124 +#define EX_WEXPCOMSUB 125 +#define EX_BINARY_FILE 126 +#define EX_NOEXEC 126 +#define EX_NOINPUT 126 +#define EX_NOTFOUND 127 + +#define EX_SHERRBASE 256 /* all special error values are > this. */ + +#define EX_BADSYNTAX 257 /* shell syntax error */ +#define EX_USAGE 258 /* syntax error in usage */ +#define EX_REDIRFAIL 259 /* redirection failed */ +#define EX_BADASSIGN 260 /* variable assignment error */ +#define EX_EXPFAIL 261 /* word expansion failed */ + +/* Flag values that control parameter pattern substitution. */ +#define MATCH_ANY 0x000 +#define MATCH_BEG 0x001 +#define MATCH_END 0x002 + +#define MATCH_TYPEMASK 0x003 + +#define MATCH_GLOBREP 0x010 +#define MATCH_QUOTED 0x020 +#define MATCH_STARSUB 0x040 + +/* Some needed external declarations. */ +extern char **shell_environment; +extern WORD_LIST *rest_of_args; + +/* Generalized global variables. */ +extern int debugging_mode; +extern int executing, login_shell; +extern int interactive, interactive_shell; +extern int startup_state; +extern int subshell_environment; +extern int shell_compatibility_level; + +extern int locale_mb_cur_max; + +/* Structure to pass around that holds a bitmap of file descriptors + to close, and the size of that structure. Used in execute_cmd.c. */ +struct fd_bitmap { + int size; + char *bitmap; +}; + +#define FD_BITMAP_SIZE 32 + +#define CTLESC '\001' +#define CTLNUL '\177' + +/* Information about the current user. */ +struct user_info { + uid_t uid, euid; + gid_t gid, egid; + char *user_name; + char *shell; /* shell from the password file */ + char *home_dir; +}; + +extern struct user_info current_user; + +/* Force gcc to not clobber X on a longjmp(). Old versions of gcc mangle + this badly. */ +#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ > 8) +# define USE_VAR(x) ((void) &(x)) +#else +# define USE_VAR(x) +#endif + +/* Structure in which to save partial parsing state when doing things like + PROMPT_COMMAND and bash_execute_unix_command execution. */ + +typedef struct _sh_parser_state_t { + + /* parsing state */ + int parser_state; + int *token_state; + + char *token; + int token_buffer_size; + + /* input line state -- line number saved elsewhere */ + int input_line_terminator; + int eof_encountered; + +#if defined (HANDLE_MULTIBYTE) + /* Nothing right now for multibyte state, but might want something later. */ +#endif + + char **prompt_string_pointer; + + /* history state affecting or modified by the parser */ + int current_command_line_count; +#if defined (HISTORY) + int remember_on_history; + int history_expansion_inhibited; +#endif + + /* execution state possibly modified by the parser */ + int last_command_exit_value; +#if defined (ARRAY_VARS) + ARRAY *pipestatus; +#endif + sh_builtin_func_t *last_shell_builtin, *this_shell_builtin; + + /* flags state affecting the parser */ + int expand_aliases; + int echo_input_at_read; + +} sh_parser_state_t; + +typedef struct _sh_input_line_state_t { + char *input_line; + size_t input_line_index; + size_t input_line_size; + size_t input_line_len; +} sh_input_line_state_t; + +/* Let's try declaring these here. */ +extern sh_parser_state_t *save_parser_state __P((sh_parser_state_t *)); +extern void restore_parser_state __P((sh_parser_state_t *)); + +extern sh_input_line_state_t *save_input_line_state __P((sh_input_line_state_t *)); +extern void restore_input_line_state __P((sh_input_line_state_t *)); diff --git a/.pc/bash43-020.diff/y.tab.c b/.pc/bash43-020.diff/y.tab.c new file mode 100644 index 0000000..80fe930 --- /dev/null +++ b/.pc/bash43-020.diff/y.tab.c @@ -0,0 +1,8540 @@ +/* A Bison parser, made by GNU Bison 2.3. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.3" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + IF = 258, + THEN = 259, + ELSE = 260, + ELIF = 261, + FI = 262, + CASE = 263, + ESAC = 264, + FOR = 265, + SELECT = 266, + WHILE = 267, + UNTIL = 268, + DO = 269, + DONE = 270, + FUNCTION = 271, + COPROC = 272, + COND_START = 273, + COND_END = 274, + COND_ERROR = 275, + IN = 276, + BANG = 277, + TIME = 278, + TIMEOPT = 279, + TIMEIGN = 280, + WORD = 281, + ASSIGNMENT_WORD = 282, + REDIR_WORD = 283, + NUMBER = 284, + ARITH_CMD = 285, + ARITH_FOR_EXPRS = 286, + COND_CMD = 287, + AND_AND = 288, + OR_OR = 289, + GREATER_GREATER = 290, + LESS_LESS = 291, + LESS_AND = 292, + LESS_LESS_LESS = 293, + GREATER_AND = 294, + SEMI_SEMI = 295, + SEMI_AND = 296, + SEMI_SEMI_AND = 297, + LESS_LESS_MINUS = 298, + AND_GREATER = 299, + AND_GREATER_GREATER = 300, + LESS_GREATER = 301, + GREATER_BAR = 302, + BAR_AND = 303, + yacc_EOF = 304 + }; +#endif +/* Tokens. */ +#define IF 258 +#define THEN 259 +#define ELSE 260 +#define ELIF 261 +#define FI 262 +#define CASE 263 +#define ESAC 264 +#define FOR 265 +#define SELECT 266 +#define WHILE 267 +#define UNTIL 268 +#define DO 269 +#define DONE 270 +#define FUNCTION 271 +#define COPROC 272 +#define COND_START 273 +#define COND_END 274 +#define COND_ERROR 275 +#define IN 276 +#define BANG 277 +#define TIME 278 +#define TIMEOPT 279 +#define TIMEIGN 280 +#define WORD 281 +#define ASSIGNMENT_WORD 282 +#define REDIR_WORD 283 +#define NUMBER 284 +#define ARITH_CMD 285 +#define ARITH_FOR_EXPRS 286 +#define COND_CMD 287 +#define AND_AND 288 +#define OR_OR 289 +#define GREATER_GREATER 290 +#define LESS_LESS 291 +#define LESS_AND 292 +#define LESS_LESS_LESS 293 +#define GREATER_AND 294 +#define SEMI_SEMI 295 +#define SEMI_AND 296 +#define SEMI_SEMI_AND 297 +#define LESS_LESS_MINUS 298 +#define AND_GREATER 299 +#define AND_GREATER_GREATER 300 +#define LESS_GREATER 301 +#define GREATER_BAR 302 +#define BAR_AND 303 +#define yacc_EOF 304 + + + + +/* Copy the first part of user declarations. */ +#line 21 "/usr/homes/chet/src/bash/src/parse.y" + +#include "config.h" + +#include "bashtypes.h" +#include "bashansi.h" + +#include "filecntl.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (HAVE_LOCALE_H) +# include +#endif + +#include +#include "chartypes.h" +#include + +#include "memalloc.h" + +#include "bashintl.h" + +#define NEED_STRFTIME_DECL /* used in externs.h */ + +#include "shell.h" +#include "typemax.h" /* SIZE_MAX if needed */ +#include "trap.h" +#include "flags.h" +#include "parser.h" +#include "mailcheck.h" +#include "test.h" +#include "builtins.h" +#include "builtins/common.h" +#include "builtins/builtext.h" + +#include "shmbutil.h" + +#if defined (READLINE) +# include "bashline.h" +# include +#endif /* READLINE */ + +#if defined (HISTORY) +# include "bashhist.h" +# include +#endif /* HISTORY */ + +#if defined (JOB_CONTROL) +# include "jobs.h" +#endif /* JOB_CONTROL */ + +#if defined (ALIAS) +# include "alias.h" +#else +typedef void *alias_t; +#endif /* ALIAS */ + +#if defined (PROMPT_STRING_DECODE) +# ifndef _MINIX +# include +# endif +# include +# if defined (TM_IN_SYS_TIME) +# include +# include +# endif /* TM_IN_SYS_TIME */ +# include "maxpath.h" +#endif /* PROMPT_STRING_DECODE */ + +#define RE_READ_TOKEN -99 +#define NO_EXPANSION -100 + +#ifdef DEBUG +# define YYDEBUG 1 +#else +# define YYDEBUG 0 +#endif + +#if defined (HANDLE_MULTIBYTE) +# define last_shell_getc_is_singlebyte \ + ((shell_input_line_index > 1) \ + ? shell_input_line_property[shell_input_line_index - 1] \ + : 1) +# define MBTEST(x) ((x) && last_shell_getc_is_singlebyte) +#else +# define last_shell_getc_is_singlebyte 1 +# define MBTEST(x) ((x)) +#endif + +#if defined (EXTENDED_GLOB) +extern int extended_glob; +#endif + +extern int eof_encountered; +extern int no_line_editing, running_under_emacs; +extern int current_command_number; +extern int sourcelevel, parse_and_execute_level; +extern int posixly_correct; +extern int last_command_exit_value; +extern pid_t last_command_subst_pid; +extern char *shell_name, *current_host_name; +extern char *dist_version; +extern int patch_level; +extern int dump_translatable_strings, dump_po_strings; +extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin; +#if defined (BUFFERED_INPUT) +extern int bash_input_fd_changed; +#endif + +extern int errno; +/* **************************************************************** */ +/* */ +/* "Forward" declarations */ +/* */ +/* **************************************************************** */ + +#ifdef DEBUG +static void debug_parser __P((int)); +#endif + +static int yy_getc __P((void)); +static int yy_ungetc __P((int)); + +#if defined (READLINE) +static int yy_readline_get __P((void)); +static int yy_readline_unget __P((int)); +#endif + +static int yy_string_get __P((void)); +static int yy_string_unget __P((int)); +static void rewind_input_string __P((void)); +static int yy_stream_get __P((void)); +static int yy_stream_unget __P((int)); + +static int shell_getc __P((int)); +static void shell_ungetc __P((int)); +static void discard_until __P((int)); + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) +static void push_string __P((char *, int, alias_t *)); +static void pop_string __P((void)); +static void free_string_list __P((void)); +#endif + +static char *read_a_line __P((int)); + +static int reserved_word_acceptable __P((int)); +static int yylex __P((void)); +static int alias_expand_token __P((char *)); +static int time_command_acceptable __P((void)); +static int special_case_tokens __P((char *)); +static int read_token __P((int)); +static char *parse_matched_pair __P((int, int, int, int *, int)); +static char *parse_comsub __P((int, int, int, int *, int)); +#if defined (ARRAY_VARS) +static char *parse_compound_assignment __P((int *)); +#endif +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) +static int parse_dparen __P((int)); +static int parse_arith_cmd __P((char **, int)); +#endif +#if defined (COND_COMMAND) +static void cond_error __P((void)); +static COND_COM *cond_expr __P((void)); +static COND_COM *cond_or __P((void)); +static COND_COM *cond_and __P((void)); +static COND_COM *cond_term __P((void)); +static int cond_skip_newlines __P((void)); +static COMMAND *parse_cond_command __P((void)); +#endif +#if defined (ARRAY_VARS) +static int token_is_assignment __P((char *, int)); +static int token_is_ident __P((char *, int)); +#endif +static int read_token_word __P((int)); +static void discard_parser_constructs __P((int)); + +static char *error_token_from_token __P((int)); +static char *error_token_from_text __P((void)); +static void print_offending_line __P((void)); +static void report_syntax_error __P((char *)); + +static void handle_eof_input_unit __P((void)); +static void prompt_again __P((void)); +#if 0 +static void reset_readline_prompt __P((void)); +#endif +static void print_prompt __P((void)); + +#if defined (HANDLE_MULTIBYTE) +static void set_line_mbstate __P((void)); +static char *shell_input_line_property = NULL; +#else +# define set_line_mbstate() +#endif + +extern int yyerror __P((const char *)); + +#ifdef DEBUG +extern int yydebug; +#endif + +/* Default prompt strings */ +char *primary_prompt = PPROMPT; +char *secondary_prompt = SPROMPT; + +/* PROMPT_STRING_POINTER points to one of these, never to an actual string. */ +char *ps1_prompt, *ps2_prompt; + +/* Handle on the current prompt string. Indirectly points through + ps1_ or ps2_prompt. */ +char **prompt_string_pointer = (char **)NULL; +char *current_prompt_string; + +/* Non-zero means we expand aliases in commands. */ +int expand_aliases = 0; + +/* If non-zero, the decoded prompt string undergoes parameter and + variable substitution, command substitution, arithmetic substitution, + string expansion, process substitution, and quote removal in + decode_prompt_string. */ +int promptvars = 1; + +/* If non-zero, $'...' and $"..." are expanded when they appear within + a ${...} expansion, even when the expansion appears within double + quotes. */ +int extended_quote = 1; + +/* The number of lines read from input while creating the current command. */ +int current_command_line_count; + +/* The number of lines in a command saved while we run parse_and_execute */ +int saved_command_line_count; + +/* The token that currently denotes the end of parse. */ +int shell_eof_token; + +/* The token currently being read. */ +int current_token; + +/* The current parser state. */ +int parser_state; + +/* Variables to manage the task of reading here documents, because we need to + defer the reading until after a complete command has been collected. */ +static REDIRECT *redir_stack[10]; +int need_here_doc; + +/* Where shell input comes from. History expansion is performed on each + line when the shell is interactive. */ +static char *shell_input_line = (char *)NULL; +static size_t shell_input_line_index; +static size_t shell_input_line_size; /* Amount allocated for shell_input_line. */ +static size_t shell_input_line_len; /* strlen (shell_input_line) */ + +/* Either zero or EOF. */ +static int shell_input_line_terminator; + +/* The line number in a script on which a function definition starts. */ +static int function_dstart; + +/* The line number in a script on which a function body starts. */ +static int function_bstart; + +/* The line number in a script at which an arithmetic for command starts. */ +static int arith_for_lineno; + +/* The decoded prompt string. Used if READLINE is not defined or if + editing is turned off. Analogous to current_readline_prompt. */ +static char *current_decoded_prompt; + +/* The last read token, or NULL. read_token () uses this for context + checking. */ +static int last_read_token; + +/* The token read prior to last_read_token. */ +static int token_before_that; + +/* The token read prior to token_before_that. */ +static int two_tokens_ago; + +static int global_extglob; + +/* The line number in a script where the word in a `case WORD', `select WORD' + or `for WORD' begins. This is a nested command maximum, since the array + index is decremented after a case, select, or for command is parsed. */ +#define MAX_CASE_NEST 128 +static int word_lineno[MAX_CASE_NEST]; +static int word_top = -1; + +/* If non-zero, it is the token that we want read_token to return + regardless of what text is (or isn't) present to be read. This + is reset by read_token. If token_to_read == WORD or + ASSIGNMENT_WORD, yylval.word should be set to word_desc_to_read. */ +static int token_to_read; +static WORD_DESC *word_desc_to_read; + +static REDIRECTEE source; +static REDIRECTEE redir; + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 324 "/usr/homes/chet/src/bash/src/parse.y" +{ + WORD_DESC *word; /* the word that we read. */ + int number; /* the number that we read. */ + WORD_LIST *word_list; + COMMAND *command; + REDIRECT *redirect; + ELEMENT element; + PATTERN_LIST *pattern; +} +/* Line 193 of yacc.c. */ +#line 507 "y.tab.c" + YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + + + +/* Copy the second part of user declarations. */ + + +/* Line 216 of yacc.c. */ +#line 520 "y.tab.c" + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss; + YYSTYPE yyvs; + }; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 116 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 659 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 61 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 38 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 167 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 342 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 304 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 51, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 49, 2, + 59, 60, 2, 2, 2, 56, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 50, + 55, 2, 54, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 57, 53, 58, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 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, 52 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 6, 8, 11, 13, 15, 18, 21, + 24, 28, 32, 36, 40, 43, 47, 51, 54, 58, + 62, 65, 69, 73, 76, 80, 84, 87, 91, 95, + 98, 102, 106, 109, 113, 117, 120, 124, 128, 131, + 135, 139, 142, 146, 150, 153, 157, 161, 164, 168, + 172, 175, 178, 180, 182, 184, 186, 189, 191, 194, + 196, 198, 201, 203, 205, 207, 209, 215, 221, 223, + 225, 227, 229, 231, 233, 235, 242, 249, 257, 265, + 276, 287, 297, 307, 315, 323, 329, 335, 342, 349, + 357, 365, 376, 387, 394, 402, 409, 415, 422, 427, + 429, 432, 436, 439, 443, 447, 452, 455, 461, 469, + 476, 480, 482, 486, 491, 498, 504, 506, 509, 514, + 519, 525, 531, 534, 538, 541, 545, 548, 552, 554, + 558, 561, 563, 566, 570, 574, 578, 583, 588, 593, + 598, 603, 605, 607, 609, 611, 613, 615, 616, 619, + 621, 624, 627, 632, 637, 641, 645, 647, 649, 652, + 655, 658, 661, 666, 671, 673, 675, 678 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int8 yyrhs[] = +{ + 62, 0, -1, 94, 91, -1, 51, -1, 1, 51, + -1, 52, -1, 26, -1, 63, 26, -1, 54, 26, + -1, 55, 26, -1, 29, 54, 26, -1, 29, 55, + 26, -1, 28, 54, 26, -1, 28, 55, 26, -1, + 35, 26, -1, 29, 35, 26, -1, 28, 35, 26, + -1, 47, 26, -1, 29, 47, 26, -1, 28, 47, + 26, -1, 46, 26, -1, 29, 46, 26, -1, 28, + 46, 26, -1, 36, 26, -1, 29, 36, 26, -1, + 28, 36, 26, -1, 43, 26, -1, 29, 43, 26, + -1, 28, 43, 26, -1, 38, 26, -1, 29, 38, + 26, -1, 28, 38, 26, -1, 37, 29, -1, 29, + 37, 29, -1, 28, 37, 29, -1, 39, 29, -1, + 29, 39, 29, -1, 28, 39, 29, -1, 37, 26, + -1, 29, 37, 26, -1, 28, 37, 26, -1, 39, + 26, -1, 29, 39, 26, -1, 28, 39, 26, -1, + 39, 56, -1, 29, 39, 56, -1, 28, 39, 56, + -1, 37, 56, -1, 29, 37, 56, -1, 28, 37, + 56, -1, 44, 26, -1, 45, 26, -1, 26, -1, + 27, -1, 64, -1, 64, -1, 66, 64, -1, 65, + -1, 67, 65, -1, 67, -1, 69, -1, 69, 66, + -1, 74, -1, 77, -1, 70, -1, 73, -1, 12, + 88, 14, 88, 15, -1, 13, 88, 14, 88, 15, + -1, 72, -1, 78, -1, 76, -1, 79, -1, 80, + -1, 81, -1, 71, -1, 10, 26, 93, 14, 88, + 15, -1, 10, 26, 93, 57, 88, 58, -1, 10, + 26, 50, 93, 14, 88, 15, -1, 10, 26, 50, + 93, 57, 88, 58, -1, 10, 26, 93, 21, 63, + 92, 93, 14, 88, 15, -1, 10, 26, 93, 21, + 63, 92, 93, 57, 88, 58, -1, 10, 26, 93, + 21, 92, 93, 14, 88, 15, -1, 10, 26, 93, + 21, 92, 93, 57, 88, 58, -1, 10, 31, 92, + 93, 14, 88, 15, -1, 10, 31, 92, 93, 57, + 88, 58, -1, 10, 31, 14, 88, 15, -1, 10, + 31, 57, 88, 58, -1, 11, 26, 93, 14, 87, + 15, -1, 11, 26, 93, 57, 87, 58, -1, 11, + 26, 50, 93, 14, 87, 15, -1, 11, 26, 50, + 93, 57, 87, 58, -1, 11, 26, 93, 21, 63, + 92, 93, 14, 87, 15, -1, 11, 26, 93, 21, + 63, 92, 93, 57, 87, 58, -1, 8, 26, 93, + 21, 93, 9, -1, 8, 26, 93, 21, 85, 93, + 9, -1, 8, 26, 93, 21, 83, 9, -1, 26, + 59, 60, 93, 75, -1, 16, 26, 59, 60, 93, + 75, -1, 16, 26, 93, 75, -1, 69, -1, 69, + 66, -1, 59, 88, 60, -1, 17, 69, -1, 17, + 69, 66, -1, 17, 26, 69, -1, 17, 26, 69, + 66, -1, 17, 67, -1, 3, 88, 4, 88, 7, + -1, 3, 88, 4, 88, 5, 88, 7, -1, 3, + 88, 4, 88, 82, 7, -1, 57, 88, 58, -1, + 30, -1, 18, 32, 19, -1, 6, 88, 4, 88, + -1, 6, 88, 4, 88, 5, 88, -1, 6, 88, + 4, 88, 82, -1, 84, -1, 85, 84, -1, 93, + 86, 60, 88, -1, 93, 86, 60, 93, -1, 93, + 59, 86, 60, 88, -1, 93, 59, 86, 60, 93, + -1, 84, 40, -1, 85, 84, 40, -1, 84, 41, + -1, 85, 84, 41, -1, 84, 42, -1, 85, 84, + 42, -1, 26, -1, 86, 53, 26, -1, 93, 89, + -1, 87, -1, 93, 90, -1, 90, 51, 93, -1, + 90, 49, 93, -1, 90, 50, 93, -1, 90, 33, + 93, 90, -1, 90, 34, 93, 90, -1, 90, 49, + 93, 90, -1, 90, 50, 93, 90, -1, 90, 51, + 93, 90, -1, 96, -1, 51, -1, 52, -1, 51, + -1, 50, -1, 52, -1, -1, 93, 51, -1, 95, + -1, 95, 49, -1, 95, 50, -1, 95, 33, 93, + 95, -1, 95, 34, 93, 95, -1, 95, 49, 95, + -1, 95, 50, 95, -1, 96, -1, 97, -1, 22, + 96, -1, 98, 96, -1, 98, 92, -1, 22, 92, + -1, 97, 53, 93, 97, -1, 97, 48, 93, 97, + -1, 68, -1, 23, -1, 23, 24, -1, 23, 24, + 25, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 377, 377, 388, 397, 412, 422, 424, 428, 434, + 440, 446, 452, 458, 464, 470, 476, 482, 488, 494, + 500, 506, 512, 518, 525, 532, 539, 546, 553, 560, + 566, 572, 578, 584, 590, 596, 602, 608, 614, 620, + 626, 632, 638, 644, 650, 656, 662, 668, 674, 680, + 686, 692, 700, 702, 704, 708, 712, 723, 725, 729, + 731, 733, 749, 751, 755, 757, 759, 761, 763, 765, + 767, 769, 771, 773, 775, 779, 784, 789, 794, 799, + 804, 809, 814, 821, 826, 831, 836, 843, 848, 853, + 858, 863, 868, 875, 880, 885, 892, 895, 898, 902, + 904, 935, 942, 947, 964, 969, 986, 993, 995, 997, + 1002, 1006, 1010, 1014, 1016, 1018, 1022, 1023, 1027, 1029, + 1031, 1033, 1037, 1039, 1041, 1043, 1045, 1047, 1051, 1053, + 1062, 1070, 1071, 1077, 1078, 1085, 1089, 1091, 1093, 1100, + 1102, 1104, 1108, 1109, 1112, 1114, 1116, 1120, 1121, 1130, + 1143, 1159, 1174, 1176, 1178, 1185, 1188, 1192, 1194, 1200, + 1206, 1223, 1243, 1245, 1268, 1272, 1274, 1276 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "IF", "THEN", "ELSE", "ELIF", "FI", + "CASE", "ESAC", "FOR", "SELECT", "WHILE", "UNTIL", "DO", "DONE", + "FUNCTION", "COPROC", "COND_START", "COND_END", "COND_ERROR", "IN", + "BANG", "TIME", "TIMEOPT", "TIMEIGN", "WORD", "ASSIGNMENT_WORD", + "REDIR_WORD", "NUMBER", "ARITH_CMD", "ARITH_FOR_EXPRS", "COND_CMD", + "AND_AND", "OR_OR", "GREATER_GREATER", "LESS_LESS", "LESS_AND", + "LESS_LESS_LESS", "GREATER_AND", "SEMI_SEMI", "SEMI_AND", + "SEMI_SEMI_AND", "LESS_LESS_MINUS", "AND_GREATER", "AND_GREATER_GREATER", + "LESS_GREATER", "GREATER_BAR", "BAR_AND", "'&'", "';'", "'\\n'", + "yacc_EOF", "'|'", "'>'", "'<'", "'-'", "'{'", "'}'", "'('", "')'", + "$accept", "inputunit", "word_list", "redirection", + "simple_command_element", "redirection_list", "simple_command", + "command", "shell_command", "for_command", "arith_for_command", + "select_command", "case_command", "function_def", "function_body", + "subshell", "coproc", "if_command", "group_command", "arith_command", + "cond_command", "elif_clause", "case_clause", "pattern_list", + "case_clause_sequence", "pattern", "list", "compound_list", "list0", + "list1", "simple_list_terminator", "list_terminator", "newline_list", + "simple_list", "simple_list1", "pipeline_command", "pipeline", + "timespec", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 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, 38, + 59, 10, 304, 124, 62, 60, 45, 123, 125, 40, + 41 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 61, 62, 62, 62, 62, 63, 63, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 65, 65, 65, 66, 66, 67, 67, 68, + 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, + 70, 70, 70, 71, 71, 71, 71, 72, 72, 72, + 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, + 75, 76, 77, 77, 77, 77, 77, 78, 78, 78, + 79, 80, 81, 82, 82, 82, 83, 83, 84, 84, + 84, 84, 85, 85, 85, 85, 85, 85, 86, 86, + 87, 88, 88, 89, 89, 89, 90, 90, 90, 90, + 90, 90, 91, 91, 92, 92, 92, 93, 93, 94, + 94, 94, 95, 95, 95, 95, 95, 96, 96, 96, + 96, 96, 97, 97, 97, 98, 98, 98 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 2, 1, 2, 1, 1, 2, 2, 2, + 3, 3, 3, 3, 2, 3, 3, 2, 3, 3, + 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, + 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, + 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, + 2, 2, 1, 1, 1, 1, 2, 1, 2, 1, + 1, 2, 1, 1, 1, 1, 5, 5, 1, 1, + 1, 1, 1, 1, 1, 6, 6, 7, 7, 10, + 10, 9, 9, 7, 7, 5, 5, 6, 6, 7, + 7, 10, 10, 6, 7, 6, 5, 6, 4, 1, + 2, 3, 2, 3, 3, 4, 2, 5, 7, 6, + 3, 1, 3, 4, 6, 5, 1, 2, 4, 4, + 5, 5, 2, 3, 2, 3, 2, 3, 1, 3, + 2, 1, 2, 3, 3, 3, 4, 4, 4, 4, + 4, 1, 1, 1, 1, 1, 1, 0, 2, 1, + 2, 2, 4, 4, 3, 3, 1, 1, 2, 2, + 2, 2, 4, 4, 1, 1, 2, 3 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 0, 0, 147, 0, 0, 0, 147, 147, 0, 0, + 0, 0, 165, 52, 53, 0, 0, 111, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, + 0, 0, 147, 147, 0, 54, 57, 59, 164, 60, + 64, 74, 68, 65, 62, 70, 63, 69, 71, 72, + 73, 0, 149, 156, 157, 0, 4, 131, 0, 0, + 147, 147, 0, 147, 0, 0, 147, 52, 106, 102, + 0, 145, 144, 146, 161, 158, 166, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 14, 23, + 38, 32, 47, 29, 41, 35, 44, 26, 50, 51, + 20, 17, 8, 9, 0, 0, 1, 52, 58, 55, + 61, 142, 143, 2, 147, 147, 150, 151, 147, 147, + 160, 159, 147, 148, 130, 132, 141, 0, 147, 0, + 147, 147, 147, 147, 0, 147, 147, 0, 0, 104, + 103, 112, 167, 147, 16, 25, 40, 34, 49, 31, + 43, 37, 46, 28, 22, 19, 12, 13, 15, 24, + 39, 33, 48, 30, 42, 36, 45, 27, 21, 18, + 10, 11, 110, 101, 56, 0, 0, 154, 155, 0, + 0, 0, 147, 147, 147, 147, 147, 147, 0, 147, + 0, 147, 0, 0, 0, 0, 147, 0, 147, 0, + 0, 147, 99, 98, 105, 0, 152, 153, 0, 0, + 163, 162, 147, 147, 107, 0, 0, 0, 134, 135, + 133, 0, 116, 147, 0, 147, 147, 0, 6, 0, + 147, 0, 85, 86, 147, 147, 147, 147, 0, 0, + 0, 0, 66, 67, 0, 100, 96, 0, 0, 109, + 136, 137, 138, 139, 140, 95, 122, 124, 126, 117, + 0, 93, 128, 0, 0, 0, 0, 75, 7, 147, + 0, 76, 0, 0, 0, 0, 87, 0, 147, 88, + 97, 108, 147, 147, 147, 147, 123, 125, 127, 94, + 0, 0, 147, 77, 78, 0, 147, 147, 83, 84, + 89, 90, 0, 113, 0, 0, 0, 147, 129, 118, + 119, 147, 147, 0, 0, 147, 147, 147, 115, 120, + 121, 0, 0, 81, 82, 0, 0, 114, 79, 80, + 91, 92 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 34, 239, 35, 36, 120, 37, 38, 39, 40, + 41, 42, 43, 44, 213, 45, 46, 47, 48, 49, + 50, 225, 231, 232, 233, 274, 57, 58, 134, 135, + 123, 74, 59, 51, 187, 136, 54, 55 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -208 +static const yytype_int16 yypact[] = +{ + 296, -35, -208, -2, 38, 10, -208, -208, 24, 546, + 31, 346, 51, 47, -208, 591, 604, -208, 56, 71, + -18, 112, 130, 115, 128, 136, 143, 154, -208, -208, + 157, 170, -208, -208, 111, -208, -208, 229, -208, 578, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -12, -3, -208, 48, 346, -208, -208, 208, 396, + -208, 73, 15, 163, 190, 201, 160, 107, 229, 578, + 204, -208, -208, -208, -208, -208, 195, 165, 202, 215, + 152, 216, 153, 222, 227, 236, 237, 244, 245, 253, + 158, 254, 171, 255, 256, 259, 261, 262, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, 231, 230, -208, -208, -208, -208, + 578, -208, -208, -208, -208, -208, 446, 446, -208, -208, + -208, -208, -208, -208, -208, 210, -208, 4, -208, 65, + -208, -208, -208, -208, 70, -208, -208, 232, 41, 578, + 578, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, 396, 396, 23, 23, 496, + 496, 97, -208, -208, -208, -208, -208, -208, 85, -208, + 185, -208, 276, 235, 100, 110, -208, 268, -208, 280, + 283, -208, 578, -208, 578, 41, -208, -208, 446, 446, + 48, 48, -208, -208, -208, 295, 396, 396, 396, 396, + 396, 294, 161, -208, 19, -208, -208, 290, -208, 200, + -208, 252, -208, -208, -208, -208, -208, -208, 302, 396, + 200, 269, -208, -208, 41, 578, -208, 313, 324, -208, + -208, -208, 55, 55, 55, -208, -208, -208, -208, 192, + 34, -208, -208, 303, -19, 315, 278, -208, -208, -208, + 114, -208, 322, 286, 323, 287, -208, 210, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + 8, 320, -208, -208, -208, 117, -208, -208, -208, -208, + -208, -208, 119, 167, 396, 396, 396, -208, -208, -208, + 396, -208, -208, 337, 307, -208, -208, -208, -208, -208, + 396, 345, 308, -208, -208, 352, 312, -208, -208, -208, + -208, -208 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -208, -208, 164, -37, -31, -62, 368, -208, -5, -208, + -208, -208, -208, -208, -206, -208, -208, -208, -208, -208, + -208, 66, -208, 145, -208, 88, -173, -6, -208, -207, + -208, -45, -48, -208, 5, 3, 17, -208 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -1 +static const yytype_uint16 yytable[] = +{ + 64, 65, 119, 53, 69, 52, 118, 150, 100, 256, + 130, 101, 137, 139, 75, 144, 56, 142, 148, 260, + 261, 262, 263, 264, 60, 197, 114, 115, 271, 140, + 124, 125, 119, 248, 301, 251, 63, 118, 102, 121, + 122, 302, 287, 299, 2, 272, 126, 127, 290, 3, + 66, 4, 5, 6, 7, 133, 124, 125, 131, 10, + 272, 301, 149, 70, 61, 71, 72, 73, 317, 62, + 133, 17, 141, 284, 285, 76, 185, 186, 273, 199, + 189, 190, 98, 184, 206, 133, 200, 214, 192, 193, + 198, 207, 133, 273, 204, 205, 128, 99, 32, 235, + 33, 129, 222, 223, 224, 215, 77, 262, 263, 264, + 2, 116, 119, 184, 244, 3, 133, 4, 5, 6, + 7, 133, 201, 138, 246, 10, 191, 208, 306, 53, + 53, 321, 188, 325, 202, 203, 133, 17, 103, 209, + 210, 107, 236, 212, 226, 227, 228, 229, 230, 234, + 255, 133, 335, 336, 108, 240, 104, 245, 249, 105, + 249, 133, 109, 254, 32, 133, 33, 247, 133, 110, + 133, 307, 327, 223, 322, 119, 326, 184, 156, 160, + 111, 157, 161, 112, 170, 270, 106, 171, 53, 53, + 216, 217, 280, 237, 279, 241, 113, 174, 249, 249, + 175, 266, 267, 268, 145, 288, 220, 221, 158, 162, + 212, 238, 132, 143, 172, 146, 257, 258, 184, 147, + 152, 53, 53, 151, 188, 153, 278, 176, 154, 275, + 276, 305, 296, 297, 298, 71, 72, 73, 282, 283, + 312, 155, 159, 192, 193, 314, 315, 316, 163, 212, + 71, 72, 73, 164, 320, 117, 14, 15, 16, 194, + 195, 196, 165, 166, 18, 19, 20, 21, 22, 330, + 167, 168, 23, 24, 25, 26, 27, 249, 249, 169, + 173, 177, 178, 30, 31, 179, 313, 180, 181, 182, + 183, 242, 211, 243, 238, 252, 319, 1, 253, 2, + 323, 324, 259, 265, 3, 277, 4, 5, 6, 7, + 281, 329, 8, 9, 10, 331, 332, 286, 11, 12, + 291, 337, 13, 14, 15, 16, 17, 289, 292, 272, + 303, 18, 19, 20, 21, 22, 304, 308, 310, 23, + 24, 25, 26, 27, 309, 311, 318, 28, 29, 2, + 30, 31, 333, 32, 3, 33, 4, 5, 6, 7, + 338, 300, 8, 9, 10, 334, 339, 340, 11, 12, + 341, 250, 13, 14, 15, 16, 17, 68, 269, 328, + 0, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 27, 0, 0, 71, 72, 73, 2, + 30, 31, 0, 32, 3, 33, 4, 5, 6, 7, + 0, 0, 8, 9, 10, 0, 0, 0, 11, 12, + 0, 0, 13, 14, 15, 16, 17, 0, 0, 0, + 0, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 27, 0, 0, 0, 133, 0, 2, + 30, 31, 0, 32, 3, 33, 4, 5, 6, 7, + 0, 0, 8, 9, 10, 0, 0, 0, 11, 12, + 0, 0, 13, 14, 15, 16, 17, 0, 0, 0, + 0, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 27, 0, 0, 0, 0, 0, 2, + 30, 31, 0, 32, 3, 33, 4, 5, 6, 7, + 0, 0, 8, 9, 10, 0, 0, 0, 0, 0, + 0, 0, 13, 14, 15, 16, 17, 0, 0, 0, + 0, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 27, 0, 0, 0, 133, 0, 2, + 30, 31, 0, 32, 3, 33, 4, 5, 6, 7, + 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, + 0, 0, 67, 14, 15, 16, 17, 0, 0, 0, + 0, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 27, 0, 0, 0, 0, 0, 0, + 30, 31, 0, 32, 0, 33, 15, 16, 0, 0, + 0, 0, 0, 18, 19, 20, 21, 22, 0, 0, + 0, 23, 24, 25, 26, 27, 78, 79, 80, 81, + 82, 0, 30, 31, 83, 0, 0, 84, 85, 88, + 89, 90, 91, 92, 0, 86, 87, 93, 0, 0, + 94, 95, 0, 0, 0, 0, 0, 0, 96, 97 +}; + +static const yytype_int16 yycheck[] = +{ + 6, 7, 39, 0, 9, 0, 37, 69, 26, 215, + 55, 29, 60, 61, 11, 63, 51, 62, 66, 226, + 227, 228, 229, 230, 26, 21, 32, 33, 9, 14, + 33, 34, 69, 206, 53, 208, 26, 68, 56, 51, + 52, 60, 249, 9, 3, 26, 49, 50, 254, 8, + 26, 10, 11, 12, 13, 51, 33, 34, 55, 18, + 26, 53, 67, 32, 26, 50, 51, 52, 60, 31, + 51, 30, 57, 246, 247, 24, 124, 125, 59, 14, + 128, 129, 26, 120, 14, 51, 21, 149, 33, 34, + 138, 21, 51, 59, 142, 143, 48, 26, 57, 14, + 59, 53, 5, 6, 7, 153, 59, 314, 315, 316, + 3, 0, 149, 150, 14, 8, 51, 10, 11, 12, + 13, 51, 57, 50, 14, 18, 132, 57, 14, 126, + 127, 14, 127, 14, 140, 141, 51, 30, 26, 145, + 146, 26, 57, 148, 192, 193, 194, 195, 196, 197, + 212, 51, 325, 326, 26, 200, 26, 57, 206, 29, + 208, 51, 26, 211, 57, 51, 59, 57, 51, 26, + 51, 57, 5, 6, 57, 212, 57, 214, 26, 26, + 26, 29, 29, 26, 26, 233, 56, 29, 185, 186, + 185, 186, 240, 199, 239, 201, 26, 26, 246, 247, + 29, 40, 41, 42, 14, 250, 189, 190, 56, 56, + 215, 26, 4, 50, 56, 14, 222, 223, 255, 59, + 25, 218, 219, 19, 219, 60, 26, 56, 26, 235, + 236, 279, 40, 41, 42, 50, 51, 52, 244, 245, + 288, 26, 26, 33, 34, 293, 294, 295, 26, 254, + 50, 51, 52, 26, 302, 26, 27, 28, 29, 49, + 50, 51, 26, 26, 35, 36, 37, 38, 39, 317, + 26, 26, 43, 44, 45, 46, 47, 325, 326, 26, + 26, 26, 26, 54, 55, 26, 292, 26, 26, 58, + 60, 15, 60, 58, 26, 15, 302, 1, 15, 3, + 306, 307, 7, 9, 8, 15, 10, 11, 12, 13, + 58, 317, 16, 17, 18, 321, 322, 15, 22, 23, + 7, 327, 26, 27, 28, 29, 30, 58, 4, 26, + 15, 35, 36, 37, 38, 39, 58, 15, 15, 43, + 44, 45, 46, 47, 58, 58, 26, 51, 52, 3, + 54, 55, 15, 57, 8, 59, 10, 11, 12, 13, + 15, 273, 16, 17, 18, 58, 58, 15, 22, 23, + 58, 207, 26, 27, 28, 29, 30, 9, 233, 313, + -1, 35, 36, 37, 38, 39, -1, -1, -1, 43, + 44, 45, 46, 47, -1, -1, 50, 51, 52, 3, + 54, 55, -1, 57, 8, 59, 10, 11, 12, 13, + -1, -1, 16, 17, 18, -1, -1, -1, 22, 23, + -1, -1, 26, 27, 28, 29, 30, -1, -1, -1, + -1, 35, 36, 37, 38, 39, -1, -1, -1, 43, + 44, 45, 46, 47, -1, -1, -1, 51, -1, 3, + 54, 55, -1, 57, 8, 59, 10, 11, 12, 13, + -1, -1, 16, 17, 18, -1, -1, -1, 22, 23, + -1, -1, 26, 27, 28, 29, 30, -1, -1, -1, + -1, 35, 36, 37, 38, 39, -1, -1, -1, 43, + 44, 45, 46, 47, -1, -1, -1, -1, -1, 3, + 54, 55, -1, 57, 8, 59, 10, 11, 12, 13, + -1, -1, 16, 17, 18, -1, -1, -1, -1, -1, + -1, -1, 26, 27, 28, 29, 30, -1, -1, -1, + -1, 35, 36, 37, 38, 39, -1, -1, -1, 43, + 44, 45, 46, 47, -1, -1, -1, 51, -1, 3, + 54, 55, -1, 57, 8, 59, 10, 11, 12, 13, + -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, + -1, -1, 26, 27, 28, 29, 30, -1, -1, -1, + -1, 35, 36, 37, 38, 39, -1, -1, -1, 43, + 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, + 54, 55, -1, 57, -1, 59, 28, 29, -1, -1, + -1, -1, -1, 35, 36, 37, 38, 39, -1, -1, + -1, 43, 44, 45, 46, 47, 35, 36, 37, 38, + 39, -1, 54, 55, 43, -1, -1, 46, 47, 35, + 36, 37, 38, 39, -1, 54, 55, 43, -1, -1, + 46, 47, -1, -1, -1, -1, -1, -1, 54, 55 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 1, 3, 8, 10, 11, 12, 13, 16, 17, + 18, 22, 23, 26, 27, 28, 29, 30, 35, 36, + 37, 38, 39, 43, 44, 45, 46, 47, 51, 52, + 54, 55, 57, 59, 62, 64, 65, 67, 68, 69, + 70, 71, 72, 73, 74, 76, 77, 78, 79, 80, + 81, 94, 95, 96, 97, 98, 51, 87, 88, 93, + 26, 26, 31, 26, 88, 88, 26, 26, 67, 69, + 32, 50, 51, 52, 92, 96, 24, 59, 35, 36, + 37, 38, 39, 43, 46, 47, 54, 55, 35, 36, + 37, 38, 39, 43, 46, 47, 54, 55, 26, 26, + 26, 29, 56, 26, 26, 29, 56, 26, 26, 26, + 26, 26, 26, 26, 88, 88, 0, 26, 65, 64, + 66, 51, 52, 91, 33, 34, 49, 50, 48, 53, + 92, 96, 4, 51, 89, 90, 96, 93, 50, 93, + 14, 57, 92, 50, 93, 14, 14, 59, 93, 69, + 66, 19, 25, 60, 26, 26, 26, 29, 56, 26, + 26, 29, 56, 26, 26, 26, 26, 26, 26, 26, + 26, 29, 56, 26, 26, 29, 56, 26, 26, 26, + 26, 26, 58, 60, 64, 93, 93, 95, 95, 93, + 93, 88, 33, 34, 49, 50, 51, 21, 93, 14, + 21, 57, 88, 88, 93, 93, 14, 21, 57, 88, + 88, 60, 69, 75, 66, 93, 95, 95, 49, 50, + 97, 97, 5, 6, 7, 82, 93, 93, 93, 93, + 93, 83, 84, 85, 93, 14, 57, 88, 26, 63, + 92, 88, 15, 58, 14, 57, 14, 57, 87, 93, + 63, 87, 15, 15, 93, 66, 75, 88, 88, 7, + 90, 90, 90, 90, 90, 9, 40, 41, 42, 84, + 93, 9, 26, 59, 86, 88, 88, 15, 26, 92, + 93, 58, 88, 88, 87, 87, 15, 90, 92, 58, + 75, 7, 4, 49, 50, 51, 40, 41, 42, 9, + 86, 53, 60, 15, 58, 93, 14, 57, 15, 58, + 15, 58, 93, 88, 93, 93, 93, 60, 26, 88, + 93, 14, 57, 88, 88, 14, 57, 5, 82, 88, + 93, 88, 88, 15, 58, 87, 87, 88, 15, 58, + 15, 58 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +#else +static void +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; +#endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + fprintf (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) +{ + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } +} +#endif /* YYERROR_VERBOSE */ + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + YYUSE (yyvaluep); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} + + +/* Prevent warnings from -Wmissing-prototypes. */ + +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + + +/* The look-ahead symbol. */ +int yychar; + +/* The semantic value of the look-ahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void) +#else +int +yyparse () + +#endif +#endif +{ + + int yystate; + int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to look-ahead token. */ + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a look-ahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + if (yyn == YYFINAL) + YYACCEPT; + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + yystate = yyn; + *++yyvsp = yylval; + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: +#line 378 "/usr/homes/chet/src/bash/src/parse.y" + { + /* Case of regular command. Discard the error + safety net,and return the command just parsed. */ + global_command = (yyvsp[(1) - (2)].command); + eof_encountered = 0; + /* discard_parser_constructs (0); */ + if (parser_state & PST_CMDSUBST) + parser_state |= PST_EOFTOKEN; + YYACCEPT; + } + break; + + case 3: +#line 389 "/usr/homes/chet/src/bash/src/parse.y" + { + /* Case of regular command, but not a very + interesting one. Return a NULL command. */ + global_command = (COMMAND *)NULL; + if (parser_state & PST_CMDSUBST) + parser_state |= PST_EOFTOKEN; + YYACCEPT; + } + break; + + case 4: +#line 398 "/usr/homes/chet/src/bash/src/parse.y" + { + /* Error during parsing. Return NULL command. */ + global_command = (COMMAND *)NULL; + eof_encountered = 0; + /* discard_parser_constructs (1); */ + if (interactive && parse_and_execute_level == 0) + { + YYACCEPT; + } + else + { + YYABORT; + } + } + break; + + case 5: +#line 413 "/usr/homes/chet/src/bash/src/parse.y" + { + /* Case of EOF seen by itself. Do ignoreeof or + not. */ + global_command = (COMMAND *)NULL; + handle_eof_input_unit (); + YYACCEPT; + } + break; + + case 6: +#line 423 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); } + break; + + case 7: +#line 425 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(2) - (2)].word), (yyvsp[(1) - (2)].word_list)); } + break; + + case 8: +#line 429 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_output_direction, redir, 0); + } + break; + + case 9: +#line 435 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_input_direction, redir, 0); + } + break; + + case 10: +#line 441 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_output_direction, redir, 0); + } + break; + + case 11: +#line 447 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_input_direction, redir, 0); + } + break; + + case 12: +#line 453 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_output_direction, redir, REDIR_VARASSIGN); + } + break; + + case 13: +#line 459 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_input_direction, redir, REDIR_VARASSIGN); + } + break; + + case 14: +#line 465 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_appending_to, redir, 0); + } + break; + + case 15: +#line 471 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_appending_to, redir, 0); + } + break; + + case 16: +#line 477 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_appending_to, redir, REDIR_VARASSIGN); + } + break; + + case 17: +#line 483 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_output_force, redir, 0); + } + break; + + case 18: +#line 489 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_output_force, redir, 0); + } + break; + + case 19: +#line 495 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_output_force, redir, REDIR_VARASSIGN); + } + break; + + case 20: +#line 501 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_input_output, redir, 0); + } + break; + + case 21: +#line 507 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_input_output, redir, 0); + } + break; + + case 22: +#line 513 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_input_output, redir, REDIR_VARASSIGN); + } + break; + + case 23: +#line 519 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_reading_until, redir, 0); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 24: +#line 526 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_reading_until, redir, 0); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 25: +#line 533 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 26: +#line 540 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, 0); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 27: +#line 547 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, 0); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 28: +#line 554 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 29: +#line 561 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_reading_string, redir, 0); + } + break; + + case 30: +#line 567 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_reading_string, redir, 0); + } + break; + + case 31: +#line 573 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_reading_string, redir, REDIR_VARASSIGN); + } + break; + + case 32: +#line 579 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.dest = (yyvsp[(2) - (2)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_input, redir, 0); + } + break; + + case 33: +#line 585 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = (yyvsp[(3) - (3)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_input, redir, 0); + } + break; + + case 34: +#line 591 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = (yyvsp[(3) - (3)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_input, redir, REDIR_VARASSIGN); + } + break; + + case 35: +#line 597 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.dest = (yyvsp[(2) - (2)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_output, redir, 0); + } + break; + + case 36: +#line 603 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = (yyvsp[(3) - (3)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_output, redir, 0); + } + break; + + case 37: +#line 609 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = (yyvsp[(3) - (3)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_output, redir, REDIR_VARASSIGN); + } + break; + + case 38: +#line 615 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_input_word, redir, 0); + } + break; + + case 39: +#line 621 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_input_word, redir, 0); + } + break; + + case 40: +#line 627 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_input_word, redir, REDIR_VARASSIGN); + } + break; + + case 41: +#line 633 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_output_word, redir, 0); + } + break; + + case 42: +#line 639 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_output_word, redir, 0); + } + break; + + case 43: +#line 645 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_output_word, redir, REDIR_VARASSIGN); + } + break; + + case 44: +#line 651 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, 0); + } + break; + + case 45: +#line 657 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, 0); + } + break; + + case 46: +#line 663 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, REDIR_VARASSIGN); + } + break; + + case 47: +#line 669 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, 0); + } + break; + + case 48: +#line 675 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, 0); + } + break; + + case 49: +#line 681 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, REDIR_VARASSIGN); + } + break; + + case 50: +#line 687 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_err_and_out, redir, 0); + } + break; + + case 51: +#line 693 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_append_err_and_out, redir, 0); + } + break; + + case 52: +#line 701 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; } + break; + + case 53: +#line 703 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; } + break; + + case 54: +#line 705 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.element).redirect = (yyvsp[(1) - (1)].redirect); (yyval.element).word = 0; } + break; + + case 55: +#line 709 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.redirect) = (yyvsp[(1) - (1)].redirect); + } + break; + + case 56: +#line 713 "/usr/homes/chet/src/bash/src/parse.y" + { + register REDIRECT *t; + + for (t = (yyvsp[(1) - (2)].redirect); t->next; t = t->next) + ; + t->next = (yyvsp[(2) - (2)].redirect); + (yyval.redirect) = (yyvsp[(1) - (2)].redirect); + } + break; + + case 57: +#line 724 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_simple_command ((yyvsp[(1) - (1)].element), (COMMAND *)NULL); } + break; + + case 58: +#line 726 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_simple_command ((yyvsp[(2) - (2)].element), (yyvsp[(1) - (2)].command)); } + break; + + case 59: +#line 730 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = clean_simple_command ((yyvsp[(1) - (1)].command)); } + break; + + case 60: +#line 732 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 61: +#line 734 "/usr/homes/chet/src/bash/src/parse.y" + { + COMMAND *tc; + + tc = (yyvsp[(1) - (2)].command); + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = (yyvsp[(2) - (2)].redirect); + } + else + tc->redirects = (yyvsp[(2) - (2)].redirect); + (yyval.command) = (yyvsp[(1) - (2)].command); + } + break; + + case 62: +#line 750 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 63: +#line 752 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 64: +#line 756 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 65: +#line 758 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 66: +#line 760 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_while_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); } + break; + + case 67: +#line 762 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_until_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); } + break; + + case 68: +#line 764 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 69: +#line 766 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 70: +#line 768 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 71: +#line 770 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 72: +#line 772 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 73: +#line 774 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 74: +#line 776 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 75: +#line 780 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 76: +#line 785 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 77: +#line 790 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 78: +#line 795 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 79: +#line 800 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 80: +#line 805 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 81: +#line 810 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 82: +#line 815 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 83: +#line 822 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno); + if (word_top > 0) word_top--; + } + break; + + case 84: +#line 827 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno); + if (word_top > 0) word_top--; + } + break; + + case 85: +#line 832 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno); + if (word_top > 0) word_top--; + } + break; + + case 86: +#line 837 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno); + if (word_top > 0) word_top--; + } + break; + + case 87: +#line 844 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 88: +#line 849 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 89: +#line 854 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 90: +#line 859 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 91: +#line 864 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 92: +#line 869 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 93: +#line 876 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (PATTERN_LIST *)NULL, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 94: +#line 881 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_case_command ((yyvsp[(2) - (7)].word), (yyvsp[(5) - (7)].pattern), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 95: +#line 886 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (yyvsp[(5) - (6)].pattern), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 96: +#line 893 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_function_def ((yyvsp[(1) - (5)].word), (yyvsp[(5) - (5)].command), function_dstart, function_bstart); } + break; + + case 97: +#line 896 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_function_def ((yyvsp[(2) - (6)].word), (yyvsp[(6) - (6)].command), function_dstart, function_bstart); } + break; + + case 98: +#line 899 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_function_def ((yyvsp[(2) - (4)].word), (yyvsp[(4) - (4)].command), function_dstart, function_bstart); } + break; + + case 99: +#line 903 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 100: +#line 905 "/usr/homes/chet/src/bash/src/parse.y" + { + COMMAND *tc; + + tc = (yyvsp[(1) - (2)].command); + /* According to Posix.2 3.9.5, redirections + specified after the body of a function should + be attached to the function and performed when + the function is executed, not as part of the + function definition command. */ + /* XXX - I don't think it matters, but we might + want to change this in the future to avoid + problems differentiating between a function + definition with a redirection and a function + definition containing a single command with a + redirection. The two are semantically equivalent, + though -- the only difference is in how the + command printing code displays the redirections. */ + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = (yyvsp[(2) - (2)].redirect); + } + else + tc->redirects = (yyvsp[(2) - (2)].redirect); + (yyval.command) = (yyvsp[(1) - (2)].command); + } + break; + + case 101: +#line 936 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_subshell_command ((yyvsp[(2) - (3)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL; + } + break; + + case 102: +#line 943 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_coproc_command ("COPROC", (yyvsp[(2) - (2)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + break; + + case 103: +#line 948 "/usr/homes/chet/src/bash/src/parse.y" + { + COMMAND *tc; + + tc = (yyvsp[(2) - (3)].command); + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = (yyvsp[(3) - (3)].redirect); + } + else + tc->redirects = (yyvsp[(3) - (3)].redirect); + (yyval.command) = make_coproc_command ("COPROC", (yyvsp[(2) - (3)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + break; + + case 104: +#line 965 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_coproc_command ((yyvsp[(2) - (3)].word)->word, (yyvsp[(3) - (3)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + break; + + case 105: +#line 970 "/usr/homes/chet/src/bash/src/parse.y" + { + COMMAND *tc; + + tc = (yyvsp[(3) - (4)].command); + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = (yyvsp[(4) - (4)].redirect); + } + else + tc->redirects = (yyvsp[(4) - (4)].redirect); + (yyval.command) = make_coproc_command ((yyvsp[(2) - (4)].word)->word, (yyvsp[(3) - (4)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + break; + + case 106: +#line 987 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_coproc_command ("COPROC", clean_simple_command ((yyvsp[(2) - (2)].command))); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + break; + + case 107: +#line 994 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (COMMAND *)NULL); } + break; + + case 108: +#line 996 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (7)].command), (yyvsp[(4) - (7)].command), (yyvsp[(6) - (7)].command)); } + break; + + case 109: +#line 998 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(5) - (6)].command)); } + break; + + case 110: +#line 1003 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_group_command ((yyvsp[(2) - (3)].command)); } + break; + + case 111: +#line 1007 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_arith_command ((yyvsp[(1) - (1)].word_list)); } + break; + + case 112: +#line 1011 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(2) - (3)].command); } + break; + + case 113: +#line 1015 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (4)].command), (yyvsp[(4) - (4)].command), (COMMAND *)NULL); } + break; + + case 114: +#line 1017 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(6) - (6)].command)); } + break; + + case 115: +#line 1019 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (yyvsp[(5) - (5)].command)); } + break; + + case 117: +#line 1024 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(2) - (2)].pattern)->next = (yyvsp[(1) - (2)].pattern); (yyval.pattern) = (yyvsp[(2) - (2)].pattern); } + break; + + case 118: +#line 1028 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (yyvsp[(4) - (4)].command)); } + break; + + case 119: +#line 1030 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (COMMAND *)NULL); } + break; + + case 120: +#line 1032 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (yyvsp[(5) - (5)].command)); } + break; + + case 121: +#line 1034 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (COMMAND *)NULL); } + break; + + case 122: +#line 1038 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.pattern) = (yyvsp[(1) - (2)].pattern); } + break; + + case 123: +#line 1040 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); } + break; + + case 124: +#line 1042 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); } + break; + + case 125: +#line 1044 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); } + break; + + case 126: +#line 1046 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_TESTNEXT; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); } + break; + + case 127: +#line 1048 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_TESTNEXT; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); } + break; + + case 128: +#line 1052 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); } + break; + + case 129: +#line 1054 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(3) - (3)].word), (yyvsp[(1) - (3)].word_list)); } + break; + + case 130: +#line 1063 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = (yyvsp[(2) - (2)].command); + if (need_here_doc) + gather_here_documents (); + } + break; + + case 132: +#line 1072 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = (yyvsp[(2) - (2)].command); + } + break; + + case 134: +#line 1079 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(1) - (3)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (3)].command), (COMMAND *)NULL, '&'); + else + (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (COMMAND *)NULL, '&'); + } + break; + + case 136: +#line 1090 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); } + break; + + case 137: +#line 1092 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); } + break; + + case 138: +#line 1094 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(1) - (4)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '&'); + else + (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '&'); + } + break; + + case 139: +#line 1101 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); } + break; + + case 140: +#line 1103 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); } + break; + + case 141: +#line 1105 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 144: +#line 1113 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = '\n'; } + break; + + case 145: +#line 1115 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = ';'; } + break; + + case 146: +#line 1117 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = yacc_EOF; } + break; + + case 149: +#line 1131 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = (yyvsp[(1) - (1)].command); + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = (yyvsp[(1) - (1)].command); + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + break; + + case 150: +#line 1144 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(1) - (2)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (2)].command), (COMMAND *)NULL, '&'); + else + (yyval.command) = command_connect ((yyvsp[(1) - (2)].command), (COMMAND *)NULL, '&'); + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = (yyvsp[(1) - (2)].command); + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + break; + + case 151: +#line 1160 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = (yyvsp[(1) - (2)].command); + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = (yyvsp[(1) - (2)].command); + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + break; + + case 152: +#line 1175 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); } + break; + + case 153: +#line 1177 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); } + break; + + case 154: +#line 1179 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(1) - (3)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), '&'); + else + (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), '&'); + } + break; + + case 155: +#line 1186 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), ';'); } + break; + + case 156: +#line 1189 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 157: +#line 1193 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 158: +#line 1195 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(2) - (2)].command)) + (yyvsp[(2) - (2)].command)->flags ^= CMD_INVERT_RETURN; /* toggle */ + (yyval.command) = (yyvsp[(2) - (2)].command); + } + break; + + case 159: +#line 1201 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(2) - (2)].command)) + (yyvsp[(2) - (2)].command)->flags |= (yyvsp[(1) - (2)].number); + (yyval.command) = (yyvsp[(2) - (2)].command); + } + break; + + case 160: +#line 1207 "/usr/homes/chet/src/bash/src/parse.y" + { + ELEMENT x; + + /* Boy, this is unclean. `time' by itself can + time a null command. We cheat and push a + newline back if the list_terminator was a newline + to avoid the double-newline problem (one to + terminate this, one to terminate the command) */ + x.word = 0; + x.redirect = 0; + (yyval.command) = make_simple_command (x, (COMMAND *)NULL); + (yyval.command)->flags |= (yyvsp[(1) - (2)].number); + /* XXX - let's cheat and push a newline back */ + if ((yyvsp[(2) - (2)].number) == '\n') + token_to_read = '\n'; + } + break; + + case 161: +#line 1224 "/usr/homes/chet/src/bash/src/parse.y" + { + ELEMENT x; + + /* This is just as unclean. Posix says that `!' + by itself should be equivalent to `false'. + We cheat and push a + newline back if the list_terminator was a newline + to avoid the double-newline problem (one to + terminate this, one to terminate the command) */ + x.word = 0; + x.redirect = 0; + (yyval.command) = make_simple_command (x, (COMMAND *)NULL); + (yyval.command)->flags |= CMD_INVERT_RETURN; + /* XXX - let's cheat and push a newline back */ + if ((yyvsp[(2) - (2)].number) == '\n') + token_to_read = '\n'; + } + break; + + case 162: +#line 1244 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '|'); } + break; + + case 163: +#line 1246 "/usr/homes/chet/src/bash/src/parse.y" + { + /* Make cmd1 |& cmd2 equivalent to cmd1 2>&1 | cmd2 */ + COMMAND *tc; + REDIRECTEE rd, sd; + REDIRECT *r; + + tc = (yyvsp[(1) - (4)].command)->type == cm_simple ? (COMMAND *)(yyvsp[(1) - (4)].command)->value.Simple : (yyvsp[(1) - (4)].command); + sd.dest = 2; + rd.dest = 1; + r = make_redirection (sd, r_duplicating_output, rd, 0); + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = r; + } + else + tc->redirects = r; + + (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '|'); + } + break; + + case 164: +#line 1269 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 165: +#line 1273 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = CMD_TIME_PIPELINE; } + break; + + case 166: +#line 1275 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } + break; + + case 167: +#line 1277 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } + break; + + +/* Line 1267 of yacc.c. */ +#line 3377 "y.tab.c" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse look-ahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse look-ahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + if (yyn == YYFINAL) + YYACCEPT; + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#ifndef yyoverflow +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); +} + + +#line 1279 "/usr/homes/chet/src/bash/src/parse.y" + + +/* Initial size to allocate for tokens, and the + amount to grow them by. */ +#define TOKEN_DEFAULT_INITIAL_SIZE 496 +#define TOKEN_DEFAULT_GROW_SIZE 512 + +/* Should we call prompt_again? */ +#define SHOULD_PROMPT() \ + (interactive && (bash_input.type == st_stdin || bash_input.type == st_stream)) + +#if defined (ALIAS) +# define expanding_alias() (pushed_string_list && pushed_string_list->expander) +#else +# define expanding_alias() 0 +#endif + +/* Global var is non-zero when end of file has been reached. */ +int EOF_Reached = 0; + +#ifdef DEBUG +static void +debug_parser (i) + int i; +{ +#if YYDEBUG != 0 + yydebug = i; +#endif +} +#endif + +/* yy_getc () returns the next available character from input or EOF. + yy_ungetc (c) makes `c' the next character to read. + init_yy_io (get, unget, type, location) makes the function GET the + installed function for getting the next character, makes UNGET the + installed function for un-getting a character, sets the type of stream + (either string or file) from TYPE, and makes LOCATION point to where + the input is coming from. */ + +/* Unconditionally returns end-of-file. */ +int +return_EOF () +{ + return (EOF); +} + +/* Variable containing the current get and unget functions. + See ./input.h for a clearer description. */ +BASH_INPUT bash_input; + +/* Set all of the fields in BASH_INPUT to NULL. Free bash_input.name if it + is non-null, avoiding a memory leak. */ +void +initialize_bash_input () +{ + bash_input.type = st_none; + FREE (bash_input.name); + bash_input.name = (char *)NULL; + bash_input.location.file = (FILE *)NULL; + bash_input.location.string = (char *)NULL; + bash_input.getter = (sh_cget_func_t *)NULL; + bash_input.ungetter = (sh_cunget_func_t *)NULL; +} + +/* Set the contents of the current bash input stream from + GET, UNGET, TYPE, NAME, and LOCATION. */ +void +init_yy_io (get, unget, type, name, location) + sh_cget_func_t *get; + sh_cunget_func_t *unget; + enum stream_type type; + const char *name; + INPUT_STREAM location; +{ + bash_input.type = type; + FREE (bash_input.name); + bash_input.name = name ? savestring (name) : (char *)NULL; + + /* XXX */ +#if defined (CRAY) + memcpy((char *)&bash_input.location.string, (char *)&location.string, sizeof(location)); +#else + bash_input.location = location; +#endif + bash_input.getter = get; + bash_input.ungetter = unget; +} + +char * +yy_input_name () +{ + return (bash_input.name ? bash_input.name : "stdin"); +} + +/* Call this to get the next character of input. */ +static int +yy_getc () +{ + return (*(bash_input.getter)) (); +} + +/* Call this to unget C. That is, to make C the next character + to be read. */ +static int +yy_ungetc (c) + int c; +{ + return (*(bash_input.ungetter)) (c); +} + +#if defined (BUFFERED_INPUT) +#ifdef INCLUDE_UNUSED +int +input_file_descriptor () +{ + switch (bash_input.type) + { + case st_stream: + return (fileno (bash_input.location.file)); + case st_bstream: + return (bash_input.location.buffered_fd); + case st_stdin: + default: + return (fileno (stdin)); + } +} +#endif +#endif /* BUFFERED_INPUT */ + +/* **************************************************************** */ +/* */ +/* Let input be read from readline (). */ +/* */ +/* **************************************************************** */ + +#if defined (READLINE) +char *current_readline_prompt = (char *)NULL; +char *current_readline_line = (char *)NULL; +int current_readline_line_index = 0; + +static int +yy_readline_get () +{ + SigHandler *old_sigint; + int line_len; + unsigned char c; + + if (!current_readline_line) + { + if (!bash_readline_initialized) + initialize_readline (); + +#if defined (JOB_CONTROL) + if (job_control) + give_terminal_to (shell_pgrp, 0); +#endif /* JOB_CONTROL */ + + old_sigint = (SigHandler *)IMPOSSIBLE_TRAP_HANDLER; + if (signal_is_ignored (SIGINT) == 0) + { + /* interrupt_immediately++; */ + old_sigint = (SigHandler *)set_signal_handler (SIGINT, sigint_sighandler); + } + + current_readline_line = readline (current_readline_prompt ? + current_readline_prompt : ""); + + CHECK_TERMSIG; + if (signal_is_ignored (SIGINT) == 0) + { + /* interrupt_immediately--; */ + if (old_sigint != IMPOSSIBLE_TRAP_HANDLER) + set_signal_handler (SIGINT, old_sigint); + } + +#if 0 + /* Reset the prompt to the decoded value of prompt_string_pointer. */ + reset_readline_prompt (); +#endif + + if (current_readline_line == 0) + return (EOF); + + current_readline_line_index = 0; + line_len = strlen (current_readline_line); + + current_readline_line = (char *)xrealloc (current_readline_line, 2 + line_len); + current_readline_line[line_len++] = '\n'; + current_readline_line[line_len] = '\0'; + } + + if (current_readline_line[current_readline_line_index] == 0) + { + free (current_readline_line); + current_readline_line = (char *)NULL; + return (yy_readline_get ()); + } + else + { + c = current_readline_line[current_readline_line_index++]; + return (c); + } +} + +static int +yy_readline_unget (c) + int c; +{ + if (current_readline_line_index && current_readline_line) + current_readline_line[--current_readline_line_index] = c; + return (c); +} + +void +with_input_from_stdin () +{ + INPUT_STREAM location; + + if (bash_input.type != st_stdin && stream_on_stack (st_stdin) == 0) + { + location.string = current_readline_line; + init_yy_io (yy_readline_get, yy_readline_unget, + st_stdin, "readline stdin", location); + } +} + +#else /* !READLINE */ + +void +with_input_from_stdin () +{ + with_input_from_stream (stdin, "stdin"); +} +#endif /* !READLINE */ + +/* **************************************************************** */ +/* */ +/* Let input come from STRING. STRING is zero terminated. */ +/* */ +/* **************************************************************** */ + +static int +yy_string_get () +{ + register char *string; + register unsigned char c; + + string = bash_input.location.string; + + /* If the string doesn't exist, or is empty, EOF found. */ + if (string && *string) + { + c = *string++; + bash_input.location.string = string; + return (c); + } + else + return (EOF); +} + +static int +yy_string_unget (c) + int c; +{ + *(--bash_input.location.string) = c; + return (c); +} + +void +with_input_from_string (string, name) + char *string; + const char *name; +{ + INPUT_STREAM location; + + location.string = string; + init_yy_io (yy_string_get, yy_string_unget, st_string, name, location); +} + +/* Count the number of characters we've consumed from bash_input.location.string + and read into shell_input_line, but have not returned from shell_getc. + That is the true input location. Rewind bash_input.location.string by + that number of characters, so it points to the last character actually + consumed by the parser. */ +static void +rewind_input_string () +{ + int xchars; + + /* number of unconsumed characters in the input -- XXX need to take newlines + into account, e.g., $(...\n) */ + xchars = shell_input_line_len - shell_input_line_index; + if (bash_input.location.string[-1] == '\n') + xchars++; + + /* XXX - how to reflect bash_input.location.string back to string passed to + parse_and_execute or xparse_dolparen? xparse_dolparen needs to know how + far into the string we parsed. parse_and_execute knows where bash_input. + location.string is, and how far from orig_string that is -- that's the + number of characters the command consumed. */ + + /* bash_input.location.string - xchars should be where we parsed to */ + /* need to do more validation on xchars value for sanity -- test cases. */ + bash_input.location.string -= xchars; +} + +/* **************************************************************** */ +/* */ +/* Let input come from STREAM. */ +/* */ +/* **************************************************************** */ + +/* These two functions used to test the value of the HAVE_RESTARTABLE_SYSCALLS + define, and just use getc/ungetc if it was defined, but since bash + installs its signal handlers without the SA_RESTART flag, some signals + (like SIGCHLD, SIGWINCH, etc.) received during a read(2) will not cause + the read to be restarted. We need to restart it ourselves. */ + +static int +yy_stream_get () +{ + int result; + + result = EOF; + if (bash_input.location.file) + { +#if 0 + if (interactive) + interrupt_immediately++; +#endif + + /* XXX - don't need terminate_immediately; getc_with_restart checks + for terminating signals itself if read returns < 0 */ + result = getc_with_restart (bash_input.location.file); + +#if 0 + if (interactive) + interrupt_immediately--; +#endif + } + return (result); +} + +static int +yy_stream_unget (c) + int c; +{ + return (ungetc_with_restart (c, bash_input.location.file)); +} + +void +with_input_from_stream (stream, name) + FILE *stream; + const char *name; +{ + INPUT_STREAM location; + + location.file = stream; + init_yy_io (yy_stream_get, yy_stream_unget, st_stream, name, location); +} + +typedef struct stream_saver { + struct stream_saver *next; + BASH_INPUT bash_input; + int line; +#if defined (BUFFERED_INPUT) + BUFFERED_STREAM *bstream; +#endif /* BUFFERED_INPUT */ +} STREAM_SAVER; + +/* The globally known line number. */ +int line_number = 0; + +/* The line number offset set by assigning to LINENO. Not currently used. */ +int line_number_base = 0; + +#if defined (COND_COMMAND) +static int cond_lineno; +static int cond_token; +#endif + +STREAM_SAVER *stream_list = (STREAM_SAVER *)NULL; + +void +push_stream (reset_lineno) + int reset_lineno; +{ + STREAM_SAVER *saver = (STREAM_SAVER *)xmalloc (sizeof (STREAM_SAVER)); + + xbcopy ((char *)&bash_input, (char *)&(saver->bash_input), sizeof (BASH_INPUT)); + +#if defined (BUFFERED_INPUT) + saver->bstream = (BUFFERED_STREAM *)NULL; + /* If we have a buffered stream, clear out buffers[fd]. */ + if (bash_input.type == st_bstream && bash_input.location.buffered_fd >= 0) + saver->bstream = set_buffered_stream (bash_input.location.buffered_fd, + (BUFFERED_STREAM *)NULL); +#endif /* BUFFERED_INPUT */ + + saver->line = line_number; + bash_input.name = (char *)NULL; + saver->next = stream_list; + stream_list = saver; + EOF_Reached = 0; + if (reset_lineno) + line_number = 0; +} + +void +pop_stream () +{ + if (!stream_list) + EOF_Reached = 1; + else + { + STREAM_SAVER *saver = stream_list; + + EOF_Reached = 0; + stream_list = stream_list->next; + + init_yy_io (saver->bash_input.getter, + saver->bash_input.ungetter, + saver->bash_input.type, + saver->bash_input.name, + saver->bash_input.location); + +#if defined (BUFFERED_INPUT) + /* If we have a buffered stream, restore buffers[fd]. */ + /* If the input file descriptor was changed while this was on the + save stack, update the buffered fd to the new file descriptor and + re-establish the buffer <-> bash_input fd correspondence. */ + if (bash_input.type == st_bstream && bash_input.location.buffered_fd >= 0) + { + if (bash_input_fd_changed) + { + bash_input_fd_changed = 0; + if (default_buffered_input >= 0) + { + bash_input.location.buffered_fd = default_buffered_input; + saver->bstream->b_fd = default_buffered_input; + SET_CLOSE_ON_EXEC (default_buffered_input); + } + } + /* XXX could free buffered stream returned as result here. */ + set_buffered_stream (bash_input.location.buffered_fd, saver->bstream); + } +#endif /* BUFFERED_INPUT */ + + line_number = saver->line; + + FREE (saver->bash_input.name); + free (saver); + } +} + +/* Return 1 if a stream of type TYPE is saved on the stack. */ +int +stream_on_stack (type) + enum stream_type type; +{ + register STREAM_SAVER *s; + + for (s = stream_list; s; s = s->next) + if (s->bash_input.type == type) + return 1; + return 0; +} + +/* Save the current token state and return it in a malloced array. */ +int * +save_token_state () +{ + int *ret; + + ret = (int *)xmalloc (4 * sizeof (int)); + ret[0] = last_read_token; + ret[1] = token_before_that; + ret[2] = two_tokens_ago; + ret[3] = current_token; + return ret; +} + +void +restore_token_state (ts) + int *ts; +{ + if (ts == 0) + return; + last_read_token = ts[0]; + token_before_that = ts[1]; + two_tokens_ago = ts[2]; + current_token = ts[3]; +} + +/* + * This is used to inhibit alias expansion and reserved word recognition + * inside case statement pattern lists. A `case statement pattern list' is: + * + * everything between the `in' in a `case word in' and the next ')' + * or `esac' + * everything between a `;;' and the next `)' or `esac' + */ + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + +#define END_OF_ALIAS 0 + +/* + * Pseudo-global variables used in implementing token-wise alias expansion. + */ + +/* + * Pushing and popping strings. This works together with shell_getc to + * implement alias expansion on a per-token basis. + */ + +#define PSH_ALIAS 0x01 +#define PSH_DPAREN 0x02 +#define PSH_SOURCE 0x04 + +typedef struct string_saver { + struct string_saver *next; + int expand_alias; /* Value to set expand_alias to when string is popped. */ + char *saved_line; +#if defined (ALIAS) + alias_t *expander; /* alias that caused this line to be pushed. */ +#endif + size_t saved_line_size, saved_line_index; + int saved_line_terminator; + int flags; +} STRING_SAVER; + +STRING_SAVER *pushed_string_list = (STRING_SAVER *)NULL; + +/* + * Push the current shell_input_line onto a stack of such lines and make S + * the current input. Used when expanding aliases. EXPAND is used to set + * the value of expand_next_token when the string is popped, so that the + * word after the alias in the original line is handled correctly when the + * alias expands to multiple words. TOKEN is the token that was expanded + * into S; it is saved and used to prevent infinite recursive expansion. + */ +static void +push_string (s, expand, ap) + char *s; + int expand; + alias_t *ap; +{ + STRING_SAVER *temp = (STRING_SAVER *)xmalloc (sizeof (STRING_SAVER)); + + temp->expand_alias = expand; + temp->saved_line = shell_input_line; + temp->saved_line_size = shell_input_line_size; + temp->saved_line_index = shell_input_line_index; + temp->saved_line_terminator = shell_input_line_terminator; + temp->flags = 0; +#if defined (ALIAS) + temp->expander = ap; + if (ap) + temp->flags = PSH_ALIAS; +#endif + temp->next = pushed_string_list; + pushed_string_list = temp; + +#if defined (ALIAS) + if (ap) + ap->flags |= AL_BEINGEXPANDED; +#endif + + shell_input_line = s; + shell_input_line_size = STRLEN (s); + shell_input_line_index = 0; + shell_input_line_terminator = '\0'; +#if 0 + parser_state &= ~PST_ALEXPNEXT; /* XXX */ +#endif + + set_line_mbstate (); +} + +/* + * Make the top of the pushed_string stack be the current shell input. + * Only called when there is something on the stack. Called from shell_getc + * when it thinks it has consumed the string generated by an alias expansion + * and needs to return to the original input line. + */ +static void +pop_string () +{ + STRING_SAVER *t; + + FREE (shell_input_line); + shell_input_line = pushed_string_list->saved_line; + shell_input_line_index = pushed_string_list->saved_line_index; + shell_input_line_size = pushed_string_list->saved_line_size; + shell_input_line_terminator = pushed_string_list->saved_line_terminator; + + if (pushed_string_list->expand_alias) + parser_state |= PST_ALEXPNEXT; + else + parser_state &= ~PST_ALEXPNEXT; + + t = pushed_string_list; + pushed_string_list = pushed_string_list->next; + +#if defined (ALIAS) + if (t->expander) + t->expander->flags &= ~AL_BEINGEXPANDED; +#endif + + free ((char *)t); + + set_line_mbstate (); +} + +static void +free_string_list () +{ + register STRING_SAVER *t, *t1; + + for (t = pushed_string_list; t; ) + { + t1 = t->next; + FREE (t->saved_line); +#if defined (ALIAS) + if (t->expander) + t->expander->flags &= ~AL_BEINGEXPANDED; +#endif + free ((char *)t); + t = t1; + } + pushed_string_list = (STRING_SAVER *)NULL; +} + +#endif /* ALIAS || DPAREN_ARITHMETIC */ + +void +free_pushed_string_input () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + free_string_list (); +#endif +} + +int +parser_expanding_alias () +{ + return (expanding_alias ()); +} + +void +parser_save_alias () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + push_string ((char *)NULL, 0, (alias_t *)NULL); + pushed_string_list->flags = PSH_SOURCE; /* XXX - for now */ +#else + ; +#endif +} + +void +parser_restore_alias () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + if (pushed_string_list) + pop_string (); +#else + ; +#endif +} + +/* Return a line of text, taken from wherever yylex () reads input. + If there is no more input, then we return NULL. If REMOVE_QUOTED_NEWLINE + is non-zero, we remove unquoted \ pairs. This is used by + read_secondary_line to read here documents. */ +static char * +read_a_line (remove_quoted_newline) + int remove_quoted_newline; +{ + static char *line_buffer = (char *)NULL; + static int buffer_size = 0; + int indx, c, peekc, pass_next; + +#if defined (READLINE) + if (no_line_editing && SHOULD_PROMPT ()) +#else + if (SHOULD_PROMPT ()) +#endif + print_prompt (); + + pass_next = indx = 0; + while (1) + { + /* Allow immediate exit if interrupted during input. */ + QUIT; + + c = yy_getc (); + + /* Ignore null bytes in input. */ + if (c == 0) + { +#if 0 + internal_warning ("read_a_line: ignored null byte in input"); +#endif + continue; + } + + /* If there is no more input, then we return NULL. */ + if (c == EOF) + { + if (interactive && bash_input.type == st_stream) + clearerr (stdin); + if (indx == 0) + return ((char *)NULL); + c = '\n'; + } + + /* `+2' in case the final character in the buffer is a newline. */ + RESIZE_MALLOCED_BUFFER (line_buffer, indx, 2, buffer_size, 128); + + /* IF REMOVE_QUOTED_NEWLINES is non-zero, we are reading a + here document with an unquoted delimiter. In this case, + the line will be expanded as if it were in double quotes. + We allow a backslash to escape the next character, but we + need to treat the backslash specially only if a backslash + quoting a backslash-newline pair appears in the line. */ + if (pass_next) + { + line_buffer[indx++] = c; + pass_next = 0; + } + else if (c == '\\' && remove_quoted_newline) + { + QUIT; + peekc = yy_getc (); + if (peekc == '\n') + { + line_number++; + continue; /* Make the unquoted \ pair disappear. */ + } + else + { + yy_ungetc (peekc); + pass_next = 1; + line_buffer[indx++] = c; /* Preserve the backslash. */ + } + } + else + line_buffer[indx++] = c; + + if (c == '\n') + { + line_buffer[indx] = '\0'; + return (line_buffer); + } + } +} + +/* Return a line as in read_a_line (), but insure that the prompt is + the secondary prompt. This is used to read the lines of a here + document. REMOVE_QUOTED_NEWLINE is non-zero if we should remove + newlines quoted with backslashes while reading the line. It is + non-zero unless the delimiter of the here document was quoted. */ +char * +read_secondary_line (remove_quoted_newline) + int remove_quoted_newline; +{ + char *ret; + int n, c; + + prompt_string_pointer = &ps2_prompt; + if (SHOULD_PROMPT()) + prompt_again (); + ret = read_a_line (remove_quoted_newline); +#if defined (HISTORY) + if (ret && remember_on_history && (parser_state & PST_HEREDOC)) + { + /* To make adding the the here-document body right, we need to rely + on history_delimiting_chars() returning \n for the first line of + the here-document body and the null string for the second and + subsequent lines, so we avoid double newlines. + current_command_line_count == 2 for the first line of the body. */ + + current_command_line_count++; + maybe_add_history (ret); + } +#endif /* HISTORY */ + return ret; +} + +/* **************************************************************** */ +/* */ +/* YYLEX () */ +/* */ +/* **************************************************************** */ + +/* Reserved words. These are only recognized as the first word of a + command. */ +STRING_INT_ALIST word_token_alist[] = { + { "if", IF }, + { "then", THEN }, + { "else", ELSE }, + { "elif", ELIF }, + { "fi", FI }, + { "case", CASE }, + { "esac", ESAC }, + { "for", FOR }, +#if defined (SELECT_COMMAND) + { "select", SELECT }, +#endif + { "while", WHILE }, + { "until", UNTIL }, + { "do", DO }, + { "done", DONE }, + { "in", IN }, + { "function", FUNCTION }, +#if defined (COMMAND_TIMING) + { "time", TIME }, +#endif + { "{", '{' }, + { "}", '}' }, + { "!", BANG }, +#if defined (COND_COMMAND) + { "[[", COND_START }, + { "]]", COND_END }, +#endif +#if defined (COPROCESS_SUPPORT) + { "coproc", COPROC }, +#endif + { (char *)NULL, 0} +}; + +/* other tokens that can be returned by read_token() */ +STRING_INT_ALIST other_token_alist[] = { + /* Multiple-character tokens with special values */ + { "--", TIMEIGN }, + { "-p", TIMEOPT }, + { "&&", AND_AND }, + { "||", OR_OR }, + { ">>", GREATER_GREATER }, + { "<<", LESS_LESS }, + { "<&", LESS_AND }, + { ">&", GREATER_AND }, + { ";;", SEMI_SEMI }, + { ";&", SEMI_AND }, + { ";;&", SEMI_SEMI_AND }, + { "<<-", LESS_LESS_MINUS }, + { "<<<", LESS_LESS_LESS }, + { "&>", AND_GREATER }, + { "&>>", AND_GREATER_GREATER }, + { "<>", LESS_GREATER }, + { ">|", GREATER_BAR }, + { "|&", BAR_AND }, + { "EOF", yacc_EOF }, + /* Tokens whose value is the character itself */ + { ">", '>' }, + { "<", '<' }, + { "-", '-' }, + { "{", '{' }, + { "}", '}' }, + { ";", ';' }, + { "(", '(' }, + { ")", ')' }, + { "|", '|' }, + { "&", '&' }, + { "newline", '\n' }, + { (char *)NULL, 0} +}; + +/* others not listed here: + WORD look at yylval.word + ASSIGNMENT_WORD look at yylval.word + NUMBER look at yylval.number + ARITH_CMD look at yylval.word_list + ARITH_FOR_EXPRS look at yylval.word_list + COND_CMD look at yylval.command +*/ + +/* These are used by read_token_word, but appear up here so that shell_getc + can use them to decide when to add otherwise blank lines to the history. */ + +/* The primary delimiter stack. */ +struct dstack dstack = { (char *)NULL, 0, 0 }; + +/* A temporary delimiter stack to be used when decoding prompt strings. + This is needed because command substitutions in prompt strings (e.g., PS2) + can screw up the parser's quoting state. */ +static struct dstack temp_dstack = { (char *)NULL, 0, 0 }; + +/* Macro for accessing the top delimiter on the stack. Returns the + delimiter or zero if none. */ +#define current_delimiter(ds) \ + (ds.delimiter_depth ? ds.delimiters[ds.delimiter_depth - 1] : 0) + +#define push_delimiter(ds, character) \ + do \ + { \ + if (ds.delimiter_depth + 2 > ds.delimiter_space) \ + ds.delimiters = (char *)xrealloc \ + (ds.delimiters, (ds.delimiter_space += 10) * sizeof (char)); \ + ds.delimiters[ds.delimiter_depth] = character; \ + ds.delimiter_depth++; \ + } \ + while (0) + +#define pop_delimiter(ds) ds.delimiter_depth-- + +/* Return the next shell input character. This always reads characters + from shell_input_line; when that line is exhausted, it is time to + read the next line. This is called by read_token when the shell is + processing normal command input. */ + +/* This implements one-character lookahead/lookbehind across physical input + lines, to avoid something being lost because it's pushed back with + shell_ungetc when we're at the start of a line. */ +static int eol_ungetc_lookahead = 0; + +static int +shell_getc (remove_quoted_newline) + int remove_quoted_newline; +{ + register int i; + int c, truncating; + unsigned char uc; + + QUIT; + + if (sigwinch_received) + { + sigwinch_received = 0; + get_new_window_size (0, (int *)0, (int *)0); + } + + if (eol_ungetc_lookahead) + { + c = eol_ungetc_lookahead; + eol_ungetc_lookahead = 0; + return (c); + } + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* If shell_input_line[shell_input_line_index] == 0, but there is + something on the pushed list of strings, then we don't want to go + off and get another line. We let the code down below handle it. */ + + if (!shell_input_line || ((!shell_input_line[shell_input_line_index]) && + (pushed_string_list == (STRING_SAVER *)NULL))) +#else /* !ALIAS && !DPAREN_ARITHMETIC */ + if (!shell_input_line || !shell_input_line[shell_input_line_index]) +#endif /* !ALIAS && !DPAREN_ARITHMETIC */ + { + line_number++; + + /* Let's not let one really really long line blow up memory allocation */ + if (shell_input_line && shell_input_line_size >= 32768) + { + free (shell_input_line); + shell_input_line = 0; + shell_input_line_size = 0; + } + + restart_read: + + /* Allow immediate exit if interrupted during input. */ + QUIT; + + i = truncating = 0; + shell_input_line_terminator = 0; + + /* If the shell is interatctive, but not currently printing a prompt + (interactive_shell && interactive == 0), we don't want to print + notifies or cleanup the jobs -- we want to defer it until we do + print the next prompt. */ + if (interactive_shell == 0 || SHOULD_PROMPT()) + { +#if defined (JOB_CONTROL) + /* This can cause a problem when reading a command as the result + of a trap, when the trap is called from flush_child. This call + had better not cause jobs to disappear from the job table in + that case, or we will have big trouble. */ + notify_and_cleanup (); +#else /* !JOB_CONTROL */ + cleanup_dead_jobs (); +#endif /* !JOB_CONTROL */ + } + +#if defined (READLINE) + if (no_line_editing && SHOULD_PROMPT()) +#else + if (SHOULD_PROMPT()) +#endif + print_prompt (); + + if (bash_input.type == st_stream) + clearerr (stdin); + + while (1) + { + c = yy_getc (); + + /* Allow immediate exit if interrupted during input. */ + QUIT; + + if (c == '\0') + { +#if 0 + internal_warning ("shell_getc: ignored null byte in input"); +#endif + continue; + } + + /* Theoretical overflow */ + /* If we can't put 256 bytes more into the buffer, allocate + everything we can and fill it as full as we can. */ + /* XXX - we ignore rest of line using `truncating' flag */ + if (shell_input_line_size > (SIZE_MAX - 256)) + { + size_t n; + + n = SIZE_MAX - i; /* how much more can we put into the buffer? */ + if (n <= 2) /* we have to save 1 for the newline added below */ + { + if (truncating == 0) + internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%llu): line truncated", shell_input_line_size, SIZE_MAX); + shell_input_line[i] = '\0'; + truncating = 1; + } + if (shell_input_line_size < SIZE_MAX) + { + shell_input_line_size = SIZE_MAX; + shell_input_line = xrealloc (shell_input_line, shell_input_line_size); + } + } + else + RESIZE_MALLOCED_BUFFER (shell_input_line, i, 2, shell_input_line_size, 256); + + if (c == EOF) + { + if (bash_input.type == st_stream) + clearerr (stdin); + + if (i == 0) + shell_input_line_terminator = EOF; + + shell_input_line[i] = '\0'; + break; + } + + if (truncating == 0 || c == '\n') + shell_input_line[i++] = c; + + if (c == '\n') + { + shell_input_line[--i] = '\0'; + current_command_line_count++; + break; + } + } + + shell_input_line_index = 0; + shell_input_line_len = i; /* == strlen (shell_input_line) */ + + set_line_mbstate (); + +#if defined (HISTORY) + if (remember_on_history && shell_input_line && shell_input_line[0]) + { + char *expansions; +# if defined (BANG_HISTORY) + int old_hist; + + /* If the current delimiter is a single quote, we should not be + performing history expansion, even if we're on a different + line from the original single quote. */ + old_hist = history_expansion_inhibited; + if (current_delimiter (dstack) == '\'') + history_expansion_inhibited = 1; +# endif + expansions = pre_process_line (shell_input_line, 1, 1); +# if defined (BANG_HISTORY) + history_expansion_inhibited = old_hist; +# endif + if (expansions != shell_input_line) + { + free (shell_input_line); + shell_input_line = expansions; + shell_input_line_len = shell_input_line ? + strlen (shell_input_line) : 0; + if (shell_input_line_len == 0) + current_command_line_count--; + + /* We have to force the xrealloc below because we don't know + the true allocated size of shell_input_line anymore. */ + shell_input_line_size = shell_input_line_len; + + set_line_mbstate (); + } + } + /* Try to do something intelligent with blank lines encountered while + entering multi-line commands. XXX - this is grotesque */ + else if (remember_on_history && shell_input_line && + shell_input_line[0] == '\0' && + current_command_line_count > 1) + { + if (current_delimiter (dstack)) + /* We know shell_input_line[0] == 0 and we're reading some sort of + quoted string. This means we've got a line consisting of only + a newline in a quoted string. We want to make sure this line + gets added to the history. */ + maybe_add_history (shell_input_line); + else + { + char *hdcs; + hdcs = history_delimiting_chars (shell_input_line); + if (hdcs && hdcs[0] == ';') + maybe_add_history (shell_input_line); + } + } + +#endif /* HISTORY */ + + if (shell_input_line) + { + /* Lines that signify the end of the shell's input should not be + echoed. We should not echo lines while parsing command + substitutions with recursive calls into the parsing engine; those + should only be echoed once when we read the word. That is the + reason for the test against shell_eof_token, which is set to a + right paren when parsing the contents of command substitutions. */ + if (echo_input_at_read && (shell_input_line[0] || + shell_input_line_terminator != EOF) && + shell_eof_token == 0) + fprintf (stderr, "%s\n", shell_input_line); + } + else + { + shell_input_line_size = 0; + prompt_string_pointer = ¤t_prompt_string; + if (SHOULD_PROMPT ()) + prompt_again (); + goto restart_read; + } + + /* Add the newline to the end of this string, iff the string does + not already end in an EOF character. */ + if (shell_input_line_terminator != EOF) + { + if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size)) + shell_input_line = (char *)xrealloc (shell_input_line, + 1 + (shell_input_line_size += 2)); + + shell_input_line[shell_input_line_len] = '\n'; + shell_input_line[shell_input_line_len + 1] = '\0'; + + set_line_mbstate (); + } + } + +next_alias_char: + uc = shell_input_line[shell_input_line_index]; + + if (uc) + shell_input_line_index++; + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* If UC is NULL, we have reached the end of the current input string. If + pushed_string_list is non-empty, it's time to pop to the previous string + because we have fully consumed the result of the last alias expansion. + Do it transparently; just return the next character of the string popped + to. */ + /* If pushed_string_list != 0 but pushed_string_list->expander == 0 (not + currently tested) and the flags value is not PSH_SOURCE, we are not + parsing an alias, we have just saved one (push_string, when called by + the parse_dparen code) In this case, just go on as well. The PSH_SOURCE + case is handled below. */ +pop_alias: + if (uc == 0 && pushed_string_list && pushed_string_list->flags != PSH_SOURCE) + { + pop_string (); + uc = shell_input_line[shell_input_line_index]; + if (uc) + shell_input_line_index++; + } +#endif /* ALIAS || DPAREN_ARITHMETIC */ + + if MBTEST(uc == '\\' && remove_quoted_newline && shell_input_line[shell_input_line_index] == '\n') + { + if (SHOULD_PROMPT ()) + prompt_again (); + line_number++; + /* What do we do here if we're expanding an alias whose definition + includes an escaped newline? If that's the last character in the + alias expansion, we just pop the pushed string list (recall that + we inhibit the appending of a space in mk_alexpansion() if newline + is the last character). If it's not the last character, we need + to consume the quoted newline and move to the next character in + the expansion. */ +#if defined (ALIAS) + if (expanding_alias () && shell_input_line[shell_input_line_index+1] == '\0') + { + uc = 0; + goto pop_alias; + } + else if (expanding_alias () && shell_input_line[shell_input_line_index+1] != '\0') + { + shell_input_line_index++; /* skip newline */ + goto next_alias_char; /* and get next character */ + } + else +#endif + goto restart_read; + } + + if (uc == 0 && shell_input_line_terminator == EOF) + return ((shell_input_line_index != 0) ? '\n' : EOF); + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* We already know that we are not parsing an alias expansion because of the + check for expanding_alias() above. This knows how parse_and_execute + handles switching to st_string input while an alias is being expanded, + hence the check for pushed_string_list without pushed_string_list->expander + and the check for PSH_SOURCE as pushed_string_list->flags. + parse_and_execute and parse_string both change the input type to st_string + and place the string to be parsed and executed into location.string, so + we should not stop reading that until the pointer is '\0'. + The check for shell_input_line_terminator may be superfluous. + + This solves the problem of `.' inside a multi-line alias with embedded + newlines executing things out of order. */ + if (uc == 0 && bash_input.type == st_string && *bash_input.location.string && + pushed_string_list && pushed_string_list->flags == PSH_SOURCE && + shell_input_line_terminator == 0) + { + shell_input_line_index = 0; + goto restart_read; + } +#endif + + return (uc); +} + +/* Put C back into the input for the shell. This might need changes for + HANDLE_MULTIBYTE around EOLs. Since we (currently) never push back a + character different than we read, shell_input_line_property doesn't need + to change when manipulating shell_input_line. The define for + last_shell_getc_is_singlebyte should take care of it, though. */ +static void +shell_ungetc (c) + int c; +{ + if (shell_input_line && shell_input_line_index) + shell_input_line[--shell_input_line_index] = c; + else + eol_ungetc_lookahead = c; +} + +#ifdef INCLUDE_UNUSED +/* Back the input pointer up by one, effectively `ungetting' a character. */ +static void +shell_ungetchar () +{ + if (shell_input_line && shell_input_line_index) + shell_input_line_index--; +} +#endif + +/* Discard input until CHARACTER is seen, then push that character back + onto the input stream. */ +static void +discard_until (character) + int character; +{ + int c; + + while ((c = shell_getc (0)) != EOF && c != character) + ; + + if (c != EOF) + shell_ungetc (c); +} + +void +execute_variable_command (command, vname) + char *command, *vname; +{ + char *last_lastarg; + sh_parser_state_t ps; + + save_parser_state (&ps); + last_lastarg = get_string_value ("_"); + if (last_lastarg) + last_lastarg = savestring (last_lastarg); + + parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEVAL_NOHIST); + + restore_parser_state (&ps); + bind_variable ("_", last_lastarg, 0); + FREE (last_lastarg); + + if (token_to_read == '\n') /* reset_parser was called */ + token_to_read = 0; +} + +/* Place to remember the token. We try to keep the buffer + at a reasonable size, but it can grow. */ +static char *token = (char *)NULL; + +/* Current size of the token buffer. */ +static int token_buffer_size; + +/* Command to read_token () explaining what we want it to do. */ +#define READ 0 +#define RESET 1 +#define prompt_is_ps1 \ + (!prompt_string_pointer || prompt_string_pointer == &ps1_prompt) + +/* Function for yyparse to call. yylex keeps track of + the last two tokens read, and calls read_token. */ +static int +yylex () +{ + if (interactive && (current_token == 0 || current_token == '\n')) + { + /* Before we print a prompt, we might have to check mailboxes. + We do this only if it is time to do so. Notice that only here + is the mail alarm reset; nothing takes place in check_mail () + except the checking of mail. Please don't change this. */ + if (prompt_is_ps1 && parse_and_execute_level == 0 && time_to_check_mail ()) + { + check_mail (); + reset_mail_timer (); + } + + /* Avoid printing a prompt if we're not going to read anything, e.g. + after resetting the parser with read_token (RESET). */ + if (token_to_read == 0 && SHOULD_PROMPT ()) + prompt_again (); + } + + two_tokens_ago = token_before_that; + token_before_that = last_read_token; + last_read_token = current_token; + current_token = read_token (READ); + + if ((parser_state & PST_EOFTOKEN) && current_token == shell_eof_token) + { + current_token = yacc_EOF; + if (bash_input.type == st_string) + rewind_input_string (); + } + parser_state &= ~PST_EOFTOKEN; + + return (current_token); +} + +/* When non-zero, we have read the required tokens + which allow ESAC to be the next one read. */ +static int esacs_needed_count; + +void +gather_here_documents () +{ + int r; + + r = 0; + while (need_here_doc) + { + parser_state |= PST_HEREDOC; + make_here_document (redir_stack[r++], line_number); + parser_state &= ~PST_HEREDOC; + need_here_doc--; + } +} + +/* When non-zero, an open-brace used to create a group is awaiting a close + brace partner. */ +static int open_brace_count; + +#define command_token_position(token) \ + (((token) == ASSIGNMENT_WORD) || (parser_state&PST_REDIRLIST) || \ + ((token) != SEMI_SEMI && (token) != SEMI_AND && (token) != SEMI_SEMI_AND && reserved_word_acceptable(token))) + +#define assignment_acceptable(token) \ + (command_token_position(token) && ((parser_state & PST_CASEPAT) == 0)) + +/* Check to see if TOKEN is a reserved word and return the token + value if it is. */ +#define CHECK_FOR_RESERVED_WORD(tok) \ + do { \ + if (!dollar_present && !quoted && \ + reserved_word_acceptable (last_read_token)) \ + { \ + int i; \ + for (i = 0; word_token_alist[i].word != (char *)NULL; i++) \ + if (STREQ (tok, word_token_alist[i].word)) \ + { \ + if ((parser_state & PST_CASEPAT) && (word_token_alist[i].token != ESAC)) \ + break; \ + if (word_token_alist[i].token == TIME && time_command_acceptable () == 0) \ + break; \ + if (word_token_alist[i].token == ESAC) \ + parser_state &= ~(PST_CASEPAT|PST_CASESTMT); \ + else if (word_token_alist[i].token == CASE) \ + parser_state |= PST_CASESTMT; \ + else if (word_token_alist[i].token == COND_END) \ + parser_state &= ~(PST_CONDCMD|PST_CONDEXPR); \ + else if (word_token_alist[i].token == COND_START) \ + parser_state |= PST_CONDCMD; \ + else if (word_token_alist[i].token == '{') \ + open_brace_count++; \ + else if (word_token_alist[i].token == '}' && open_brace_count) \ + open_brace_count--; \ + return (word_token_alist[i].token); \ + } \ + } \ + } while (0) + +#if defined (ALIAS) + + /* OK, we have a token. Let's try to alias expand it, if (and only if) + it's eligible. + + It is eligible for expansion if EXPAND_ALIASES is set, and + the token is unquoted and the last token read was a command + separator (or expand_next_token is set), and we are currently + processing an alias (pushed_string_list is non-empty) and this + token is not the same as the current or any previously + processed alias. + + Special cases that disqualify: + In a pattern list in a case statement (parser_state & PST_CASEPAT). */ + +static char * +mk_alexpansion (s) + char *s; +{ + int l; + char *r; + + l = strlen (s); + r = xmalloc (l + 2); + strcpy (r, s); + /* If the last character in the alias is a newline, don't add a trailing + space to the expansion. Works with shell_getc above. */ + if (r[l - 1] != ' ' && r[l - 1] != '\n') + r[l++] = ' '; + r[l] = '\0'; + return r; +} + +static int +alias_expand_token (tokstr) + char *tokstr; +{ + char *expanded; + alias_t *ap; + + if (((parser_state & PST_ALEXPNEXT) || command_token_position (last_read_token)) && + (parser_state & PST_CASEPAT) == 0) + { + ap = find_alias (tokstr); + + /* Currently expanding this token. */ + if (ap && (ap->flags & AL_BEINGEXPANDED)) + return (NO_EXPANSION); + + /* mk_alexpansion puts an extra space on the end of the alias expansion, + so the lookahead by the parser works right. If this gets changed, + make sure the code in shell_getc that deals with reaching the end of + an expanded alias is changed with it. */ + expanded = ap ? mk_alexpansion (ap->value) : (char *)NULL; + + if (expanded) + { + push_string (expanded, ap->flags & AL_EXPANDNEXT, ap); + return (RE_READ_TOKEN); + } + else + /* This is an eligible token that does not have an expansion. */ + return (NO_EXPANSION); + } + return (NO_EXPANSION); +} +#endif /* ALIAS */ + +static int +time_command_acceptable () +{ +#if defined (COMMAND_TIMING) + int i; + + if (posixly_correct && shell_compatibility_level > 41) + { + /* Quick check of the rest of the line to find the next token. If it + begins with a `-', Posix says to not return `time' as the token. + This was interp 267. */ + i = shell_input_line_index; + while (i < shell_input_line_len && (shell_input_line[i] == ' ' || shell_input_line[i] == '\t')) + i++; + if (shell_input_line[i] == '-') + return 0; + } + + switch (last_read_token) + { + case 0: + case ';': + case '\n': + case AND_AND: + case OR_OR: + case '&': + case DO: + case THEN: + case ELSE: + case '{': /* } */ + case '(': /* ) */ + case BANG: /* ! time pipeline */ + case TIME: /* time time pipeline */ + case TIMEOPT: /* time -p time pipeline */ + case TIMEIGN: /* time -p -- ... */ + return 1; + default: + return 0; + } +#else + return 0; +#endif /* COMMAND_TIMING */ +} + +/* Handle special cases of token recognition: + IN is recognized if the last token was WORD and the token + before that was FOR or CASE or SELECT. + + DO is recognized if the last token was WORD and the token + before that was FOR or SELECT. + + ESAC is recognized if the last token caused `esacs_needed_count' + to be set + + `{' is recognized if the last token as WORD and the token + before that was FUNCTION, or if we just parsed an arithmetic + `for' command. + + `}' is recognized if there is an unclosed `{' present. + + `-p' is returned as TIMEOPT if the last read token was TIME. + `--' is returned as TIMEIGN if the last read token was TIMEOPT. + + ']]' is returned as COND_END if the parser is currently parsing + a conditional expression ((parser_state & PST_CONDEXPR) != 0) + + `time' is returned as TIME if and only if it is immediately + preceded by one of `;', `\n', `||', `&&', or `&'. +*/ + +static int +special_case_tokens (tokstr) + char *tokstr; +{ + if ((last_read_token == WORD) && +#if defined (SELECT_COMMAND) + ((token_before_that == FOR) || (token_before_that == CASE) || (token_before_that == SELECT)) && +#else + ((token_before_that == FOR) || (token_before_that == CASE)) && +#endif + (tokstr[0] == 'i' && tokstr[1] == 'n' && tokstr[2] == 0)) + { + if (token_before_that == CASE) + { + parser_state |= PST_CASEPAT; + esacs_needed_count++; + } + return (IN); + } + + if (last_read_token == WORD && +#if defined (SELECT_COMMAND) + (token_before_that == FOR || token_before_that == SELECT) && +#else + (token_before_that == FOR) && +#endif + (tokstr[0] == 'd' && tokstr[1] == 'o' && tokstr[2] == '\0')) + return (DO); + + /* Ditto for ESAC in the CASE case. + Specifically, this handles "case word in esac", which is a legal + construct, certainly because someone will pass an empty arg to the + case construct, and we don't want it to barf. Of course, we should + insist that the case construct has at least one pattern in it, but + the designers disagree. */ + if (esacs_needed_count) + { + esacs_needed_count--; + if (STREQ (tokstr, "esac")) + { + parser_state &= ~PST_CASEPAT; + return (ESAC); + } + } + + /* The start of a shell function definition. */ + if (parser_state & PST_ALLOWOPNBRC) + { + parser_state &= ~PST_ALLOWOPNBRC; + if (tokstr[0] == '{' && tokstr[1] == '\0') /* } */ + { + open_brace_count++; + function_bstart = line_number; + return ('{'); /* } */ + } + } + + /* We allow a `do' after a for ((...)) without an intervening + list_terminator */ + if (last_read_token == ARITH_FOR_EXPRS && tokstr[0] == 'd' && tokstr[1] == 'o' && !tokstr[2]) + return (DO); + if (last_read_token == ARITH_FOR_EXPRS && tokstr[0] == '{' && tokstr[1] == '\0') /* } */ + { + open_brace_count++; + return ('{'); /* } */ + } + + if (open_brace_count && reserved_word_acceptable (last_read_token) && tokstr[0] == '}' && !tokstr[1]) + { + open_brace_count--; /* { */ + return ('}'); + } + +#if defined (COMMAND_TIMING) + /* Handle -p after `time'. */ + if (last_read_token == TIME && tokstr[0] == '-' && tokstr[1] == 'p' && !tokstr[2]) + return (TIMEOPT); + /* Handle -- after `time -p'. */ + if (last_read_token == TIMEOPT && tokstr[0] == '-' && tokstr[1] == '-' && !tokstr[2]) + return (TIMEIGN); +#endif + +#if defined (COND_COMMAND) /* [[ */ + if ((parser_state & PST_CONDEXPR) && tokstr[0] == ']' && tokstr[1] == ']' && tokstr[2] == '\0') + return (COND_END); +#endif + + return (-1); +} + +/* Called from shell.c when Control-C is typed at top level. Or + by the error rule at top level. */ +void +reset_parser () +{ + dstack.delimiter_depth = 0; /* No delimiters found so far. */ + open_brace_count = 0; + +#if defined (EXTENDED_GLOB) + /* Reset to global value of extended glob */ + if (parser_state & PST_EXTPAT) + extended_glob = global_extglob; +#endif + + parser_state = 0; + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + if (pushed_string_list) + free_string_list (); +#endif /* ALIAS || DPAREN_ARITHMETIC */ + + if (shell_input_line) + { + free (shell_input_line); + shell_input_line = (char *)NULL; + shell_input_line_size = shell_input_line_index = 0; + } + + FREE (word_desc_to_read); + word_desc_to_read = (WORD_DESC *)NULL; + + current_token = '\n'; /* XXX */ + last_read_token = '\n'; + token_to_read = '\n'; +} + +/* Read the next token. Command can be READ (normal operation) or + RESET (to normalize state). */ +static int +read_token (command) + int command; +{ + int character; /* Current character. */ + int peek_char; /* Temporary look-ahead character. */ + int result; /* The thing to return. */ + + if (command == RESET) + { + reset_parser (); + return ('\n'); + } + + if (token_to_read) + { + result = token_to_read; + if (token_to_read == WORD || token_to_read == ASSIGNMENT_WORD) + { + yylval.word = word_desc_to_read; + word_desc_to_read = (WORD_DESC *)NULL; + } + token_to_read = 0; + return (result); + } + +#if defined (COND_COMMAND) + if ((parser_state & (PST_CONDCMD|PST_CONDEXPR)) == PST_CONDCMD) + { + cond_lineno = line_number; + parser_state |= PST_CONDEXPR; + yylval.command = parse_cond_command (); + if (cond_token != COND_END) + { + cond_error (); + return (-1); + } + token_to_read = COND_END; + parser_state &= ~(PST_CONDEXPR|PST_CONDCMD); + return (COND_CMD); + } +#endif + +#if defined (ALIAS) + /* This is a place to jump back to once we have successfully expanded a + token with an alias and pushed the string with push_string () */ + re_read_token: +#endif /* ALIAS */ + + /* Read a single word from input. Start by skipping blanks. */ + while ((character = shell_getc (1)) != EOF && shellblank (character)) + ; + + if (character == EOF) + { + EOF_Reached = 1; + return (yacc_EOF); + } + + if MBTEST(character == '#' && (!interactive || interactive_comments)) + { + /* A comment. Discard until EOL or EOF, and then return a newline. */ + discard_until ('\n'); + shell_getc (0); + character = '\n'; /* this will take the next if statement and return. */ + } + + if (character == '\n') + { + /* If we're about to return an unquoted newline, we can go and collect + the text of any pending here document. */ + if (need_here_doc) + gather_here_documents (); + +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + parser_state &= ~PST_ASSIGNOK; + + return (character); + } + + if (parser_state & PST_REGEXP) + goto tokword; + + /* Shell meta-characters. */ + if MBTEST(shellmeta (character) && ((parser_state & PST_DBLPAREN) == 0)) + { +#if defined (ALIAS) + /* Turn off alias tokenization iff this character sequence would + not leave us ready to read a command. */ + if (character == '<' || character == '>') + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + parser_state &= ~PST_ASSIGNOK; + + peek_char = shell_getc (1); + if (character == peek_char) + { + switch (character) + { + case '<': + /* If '<' then we could be at "<<" or at "<<-". We have to + look ahead one more character. */ + peek_char = shell_getc (1); + if MBTEST(peek_char == '-') + return (LESS_LESS_MINUS); + else if MBTEST(peek_char == '<') + return (LESS_LESS_LESS); + else + { + shell_ungetc (peek_char); + return (LESS_LESS); + } + + case '>': + return (GREATER_GREATER); + + case ';': + parser_state |= PST_CASEPAT; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + peek_char = shell_getc (1); + if MBTEST(peek_char == '&') + return (SEMI_SEMI_AND); + else + { + shell_ungetc (peek_char); + return (SEMI_SEMI); + } + + case '&': + return (AND_AND); + + case '|': + return (OR_OR); + +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) + case '(': /* ) */ + result = parse_dparen (character); + if (result == -2) + break; + else + return result; +#endif + } + } + else if MBTEST(character == '<' && peek_char == '&') + return (LESS_AND); + else if MBTEST(character == '>' && peek_char == '&') + return (GREATER_AND); + else if MBTEST(character == '<' && peek_char == '>') + return (LESS_GREATER); + else if MBTEST(character == '>' && peek_char == '|') + return (GREATER_BAR); + else if MBTEST(character == '&' && peek_char == '>') + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '>') + return (AND_GREATER_GREATER); + else + { + shell_ungetc (peek_char); + return (AND_GREATER); + } + } + else if MBTEST(character == '|' && peek_char == '&') + return (BAR_AND); + else if MBTEST(character == ';' && peek_char == '&') + { + parser_state |= PST_CASEPAT; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + return (SEMI_AND); + } + + shell_ungetc (peek_char); + + /* If we look like we are reading the start of a function + definition, then let the reader know about it so that + we will do the right thing with `{'. */ + if MBTEST(character == ')' && last_read_token == '(' && token_before_that == WORD) + { + parser_state |= PST_ALLOWOPNBRC; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + function_dstart = line_number; + } + + /* case pattern lists may be preceded by an optional left paren. If + we're not trying to parse a case pattern list, the left paren + indicates a subshell. */ + if MBTEST(character == '(' && (parser_state & PST_CASEPAT) == 0) /* ) */ + parser_state |= PST_SUBSHELL; + /*(*/ + else if MBTEST((parser_state & PST_CASEPAT) && character == ')') + parser_state &= ~PST_CASEPAT; + /*(*/ + else if MBTEST((parser_state & PST_SUBSHELL) && character == ')') + parser_state &= ~PST_SUBSHELL; + +#if defined (PROCESS_SUBSTITUTION) + /* Check for the constructs which introduce process substitution. + Shells running in `posix mode' don't do process substitution. */ + if MBTEST(posixly_correct || ((character != '>' && character != '<') || peek_char != '(')) /*)*/ +#endif /* PROCESS_SUBSTITUTION */ + return (character); + } + + /* Hack <&- (close stdin) case. Also <&N- (dup and close). */ + if MBTEST(character == '-' && (last_read_token == LESS_AND || last_read_token == GREATER_AND)) + return (character); + +tokword: + /* Okay, if we got this far, we have to read a word. Read one, + and then check it against the known ones. */ + result = read_token_word (character); +#if defined (ALIAS) + if (result == RE_READ_TOKEN) + goto re_read_token; +#endif + return result; +} + +/* + * Match a $(...) or other grouping construct. This has to handle embedded + * quoted strings ('', ``, "") and nested constructs. It also must handle + * reprompting the user, if necessary, after reading a newline, and returning + * correct error values if it reads EOF. + */ +#define P_FIRSTCLOSE 0x0001 +#define P_ALLOWESC 0x0002 +#define P_DQUOTE 0x0004 +#define P_COMMAND 0x0008 /* parsing a command, so look for comments */ +#define P_BACKQUOTE 0x0010 /* parsing a backquoted command substitution */ +#define P_ARRAYSUB 0x0020 /* parsing a [...] array subscript for assignment */ +#define P_DOLBRACE 0x0040 /* parsing a ${...} construct */ + +/* Lexical state while parsing a grouping construct or $(...). */ +#define LEX_WASDOL 0x001 +#define LEX_CKCOMMENT 0x002 +#define LEX_INCOMMENT 0x004 +#define LEX_PASSNEXT 0x008 +#define LEX_RESWDOK 0x010 +#define LEX_CKCASE 0x020 +#define LEX_INCASE 0x040 +#define LEX_INHEREDOC 0x080 +#define LEX_HEREDELIM 0x100 /* reading here-doc delimiter */ +#define LEX_STRIPDOC 0x200 /* <<- strip tabs from here doc delim */ +#define LEX_INWORD 0x400 + +#define COMSUB_META(ch) ((ch) == ';' || (ch) == '&' || (ch) == '|') + +#define CHECK_NESTRET_ERROR() \ + do { \ + if (nestret == &matched_pair_error) \ + { \ + free (ret); \ + return &matched_pair_error; \ + } \ + } while (0) + +#define APPEND_NESTRET() \ + do { \ + if (nestlen) \ + { \ + RESIZE_MALLOCED_BUFFER (ret, retind, nestlen, retsize, 64); \ + strcpy (ret + retind, nestret); \ + retind += nestlen; \ + } \ + } while (0) + +static char matched_pair_error; + +static char * +parse_matched_pair (qc, open, close, lenp, flags) + int qc; /* `"' if this construct is within double quotes */ + int open, close; + int *lenp, flags; +{ + int count, ch, tflags; + int nestlen, ttranslen, start_lineno; + char *ret, *nestret, *ttrans; + int retind, retsize, rflags; + int dolbrace_state; + + dolbrace_state = (flags & P_DOLBRACE) ? DOLBRACE_PARAM : 0; + +/*itrace("parse_matched_pair[%d]: open = %c close = %c flags = %d", line_number, open, close, flags);*/ + count = 1; + tflags = 0; + + if ((flags & P_COMMAND) && qc != '`' && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0) + tflags |= LEX_CKCOMMENT; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ + rflags = (qc == '"') ? P_DQUOTE : (flags & P_DQUOTE); + + ret = (char *)xmalloc (retsize = 64); + retind = 0; + + start_lineno = line_number; + while (count) + { + ch = shell_getc (qc != '\'' && (tflags & (LEX_PASSNEXT)) == 0); + + if (ch == EOF) + { + free (ret); + parser_error (start_lineno, _("unexpected EOF while looking for matching `%c'"), close); + EOF_Reached = 1; /* XXX */ + return (&matched_pair_error); + } + + /* Possible reprompting. */ + if (ch == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* Don't bother counting parens or doing anything else if in a comment + or part of a case statement */ + if (tflags & LEX_INCOMMENT) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + if (ch == '\n') + tflags &= ~LEX_INCOMMENT; + + continue; + } + + /* Not exactly right yet, should handle shell metacharacters, too. If + any changes are made to this test, make analogous changes to subst.c: + extract_delimited_string(). */ + else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || shellblank (ret[retind - 1]))) + tflags |= LEX_INCOMMENT; + + if (tflags & LEX_PASSNEXT) /* last char was backslash */ + { + tflags &= ~LEX_PASSNEXT; + if (qc != '\'' && ch == '\n') /* double-quoted \ disappears. */ + { + if (retind > 0) + retind--; /* swallow previously-added backslash */ + continue; + } + + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + if MBTEST(ch == CTLESC) + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + /* If we're reparsing the input (e.g., from parse_string_to_word_list), + we've already prepended CTLESC to single-quoted results of $'...'. + We may want to do this for other CTLESC-quoted characters in + reparse, too. */ + else if MBTEST((parser_state & PST_REPARSE) && open == '\'' && (ch == CTLESC || ch == CTLNUL)) + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + continue; + } + else if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + else if MBTEST(ch == close) /* ending delimiter */ + count--; + /* handle nested ${...} specially. */ + else if MBTEST(open != close && (tflags & LEX_WASDOL) && open == '{' && ch == open) /* } */ + count++; + else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && ch == open) /* nested begin */ + count++; + + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + /* If we just read the ending character, don't bother continuing. */ + if (count == 0) + break; + + if (open == '\'') /* '' inside grouping construct */ + { + if MBTEST((flags & P_ALLOWESC) && ch == '\\') + tflags |= LEX_PASSNEXT; + continue; + } + + if MBTEST(ch == '\\') /* backslashes */ + tflags |= LEX_PASSNEXT; + + /* Based on which dolstate is currently in (param, op, or word), + decide what the op is. We're really only concerned if it's % or + #, so we can turn on a flag that says whether or not we should + treat single quotes as special when inside a double-quoted + ${...}. This logic must agree with subst.c:extract_dollar_brace_string + since they share the same defines. */ + /* FLAG POSIX INTERP 221 */ + if (flags & P_DOLBRACE) + { + /* ${param%[%]word} */ + if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '%' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param#[#]word} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '#' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param/[/]pat/rep} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '/' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE2; /* XXX */ + /* ${param^[^]pat} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '^' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param,[,]pat} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == ',' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && strchr ("#%^,~:-=?+/", ch) != 0) + dolbrace_state = DOLBRACE_OP; + else if MBTEST(dolbrace_state == DOLBRACE_OP && strchr ("#%^,~:-=?+/", ch) == 0) + dolbrace_state = DOLBRACE_WORD; + } + + /* The big hammer. Single quotes aren't special in double quotes. The + problem is that Posix used to say the single quotes are semi-special: + within a double-quoted ${...} construct "an even number of + unescaped double-quotes or single-quotes, if any, shall occur." */ + /* This was changed in Austin Group Interp 221 */ + if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'') + continue; + + /* Could also check open == '`' if we want to parse grouping constructs + inside old-style command substitution. */ + if (open != close) /* a grouping construct */ + { + if MBTEST(shellquote (ch)) + { + /* '', ``, or "" inside $(...) or other grouping construct. */ + push_delimiter (dstack, ch); + if MBTEST((tflags & LEX_WASDOL) && ch == '\'') /* $'...' inside group */ + nestret = parse_matched_pair (ch, ch, ch, &nestlen, P_ALLOWESC|rflags); + else + nestret = parse_matched_pair (ch, ch, ch, &nestlen, rflags); + pop_delimiter (dstack); + CHECK_NESTRET_ERROR (); + + if MBTEST((tflags & LEX_WASDOL) && ch == '\'' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Translate $'...' here. */ + ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen); + xfree (nestret); + + /* If we're parsing a double-quoted brace expansion and we are + not in a place where single quotes are treated specially, + make sure we single-quote the results of the ansi + expansion because quote removal should remove them later */ + /* FLAG POSIX INTERP 221 */ + if ((shell_compatibility_level > 42) && (rflags & P_DQUOTE) && (dolbrace_state == DOLBRACE_QUOTE2) && (flags & P_DOLBRACE)) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else if ((rflags & P_DQUOTE) == 0) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else + { + nestret = ttrans; + nestlen = ttranslen; + } + retind -= 2; /* back up before the $' */ + } + else if MBTEST((tflags & LEX_WASDOL) && ch == '"' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Locale expand $"..." here. */ + ttrans = localeexpand (nestret, 0, nestlen - 1, start_lineno, &ttranslen); + xfree (nestret); + + nestret = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + nestlen = ttranslen + 2; + retind -= 2; /* back up before the $" */ + } + + APPEND_NESTRET (); + FREE (nestret); + } + else if ((flags & P_ARRAYSUB) && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + goto parse_dollar_word; + } + /* Parse an old-style command substitution within double quotes as a + single word. */ + /* XXX - sh and ksh93 don't do this - XXX */ + else if MBTEST(open == '"' && ch == '`') + { + nestret = parse_matched_pair (0, '`', '`', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + else if MBTEST(open != '`' && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + /* check for $(), $[], or ${} inside quoted string. */ + { +parse_dollar_word: + if (open == ch) /* undo previous increment */ + count--; + if (ch == '(') /* ) */ + nestret = parse_comsub (0, '(', ')', &nestlen, (rflags|P_COMMAND) & ~P_DQUOTE); + else if (ch == '{') /* } */ + nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|P_DOLBRACE|rflags); + else if (ch == '[') /* ] */ + nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + if MBTEST(ch == '$') + tflags |= LEX_WASDOL; + else + tflags &= ~LEX_WASDOL; + } + + ret[retind] = '\0'; + if (lenp) + *lenp = retind; +/*itrace("parse_matched_pair[%d]: returning %s", line_number, ret);*/ + return ret; +} + +/* Parse a $(...) command substitution. This is messier than I'd like, and + reproduces a lot more of the token-reading code than I'd like. */ +static char * +parse_comsub (qc, open, close, lenp, flags) + int qc; /* `"' if this construct is within double quotes */ + int open, close; + int *lenp, flags; +{ + int count, ch, peekc, tflags, lex_rwlen, lex_wlen, lex_firstind; + int nestlen, ttranslen, start_lineno; + char *ret, *nestret, *ttrans, *heredelim; + int retind, retsize, rflags, hdlen; + + /* Posix interp 217 says arithmetic expressions have precedence, so + assume $(( introduces arithmetic expansion and parse accordingly. */ + peekc = shell_getc (0); + shell_ungetc (peekc); + if (peekc == '(') + return (parse_matched_pair (qc, open, close, lenp, 0)); + +/*itrace("parse_comsub: qc = `%c' open = %c close = %c", qc, open, close);*/ + count = 1; + tflags = LEX_RESWDOK; + + if ((flags & P_COMMAND) && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0) + tflags |= LEX_CKCASE; + if ((tflags & LEX_CKCASE) && (interactive == 0 || interactive_comments)) + tflags |= LEX_CKCOMMENT; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ + rflags = (flags & P_DQUOTE); + + ret = (char *)xmalloc (retsize = 64); + retind = 0; + + start_lineno = line_number; + lex_rwlen = lex_wlen = 0; + + heredelim = 0; + lex_firstind = -1; + + while (count) + { +comsub_readchar: + ch = shell_getc (qc != '\'' && (tflags & (LEX_INCOMMENT|LEX_PASSNEXT)) == 0); + + if (ch == EOF) + { +eof_error: + free (ret); + FREE (heredelim); + parser_error (start_lineno, _("unexpected EOF while looking for matching `%c'"), close); + EOF_Reached = 1; /* XXX */ + return (&matched_pair_error); + } + + /* If we hit the end of a line and are reading the contents of a here + document, and it's not the same line that the document starts on, + check for this line being the here doc delimiter. Otherwise, if + we're in a here document, mark the next character as the beginning + of a line. */ + if (ch == '\n') + { + if ((tflags & LEX_HEREDELIM) && heredelim) + { + tflags &= ~LEX_HEREDELIM; + tflags |= LEX_INHEREDOC; + lex_firstind = retind + 1; + } + else if (tflags & LEX_INHEREDOC) + { + int tind; + tind = lex_firstind; + while ((tflags & LEX_STRIPDOC) && ret[tind] == '\t') + tind++; + if (STREQN (ret + tind, heredelim, hdlen)) + { + tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC); +/*itrace("parse_comsub:%d: found here doc end `%s'", line_number, ret + tind);*/ + free (heredelim); + heredelim = 0; + lex_firstind = -1; + } + else + lex_firstind = retind + 1; + } + } + + /* Possible reprompting. */ + if (ch == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* XXX -- possibly allow here doc to be delimited by ending right + paren. */ + if ((tflags & LEX_INHEREDOC) && ch == close && count == 1) + { + int tind; +/*itrace("parse_comsub: in here doc, ch == close, retind - firstind = %d hdlen = %d retind = %d", retind-lex_firstind, hdlen, retind);*/ + tind = lex_firstind; + while ((tflags & LEX_STRIPDOC) && ret[tind] == '\t') + tind++; + if (retind-tind == hdlen && STREQN (ret + tind, heredelim, hdlen)) + { + tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC); +/*itrace("parse_comsub:%d: found here doc end `%s'", line_number, ret + tind);*/ + free (heredelim); + heredelim = 0; + lex_firstind = -1; + } + } + + /* Don't bother counting parens or doing anything else if in a comment */ + if (tflags & (LEX_INCOMMENT|LEX_INHEREDOC)) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + if ((tflags & LEX_INCOMMENT) && ch == '\n') + { +/*itrace("parse_comsub:%d: lex_incomment -> 0 ch = `%c'", line_number, ch);*/ + tflags &= ~LEX_INCOMMENT; + } + + continue; + } + + if (tflags & LEX_PASSNEXT) /* last char was backslash */ + { +/*itrace("parse_comsub:%d: lex_passnext -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + tflags &= ~LEX_PASSNEXT; + if (qc != '\'' && ch == '\n') /* double-quoted \ disappears. */ + { + if (retind > 0) + retind--; /* swallow previously-added backslash */ + continue; + } + + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + if MBTEST(ch == CTLESC) + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + + /* If this is a shell break character, we are not in a word. If not, + we either start or continue a word. */ + if MBTEST(shellbreak (ch)) + { + tflags &= ~LEX_INWORD; +/*itrace("parse_comsub:%d: lex_inword -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + } + else + { + if (tflags & LEX_INWORD) + { + lex_wlen++; +/*itrace("parse_comsub:%d: lex_inword == 1 ch = `%c' lex_wlen = %d (%d)", line_number, ch, lex_wlen, __LINE__);*/ + } + else + { +/*itrace("parse_comsub:%d: lex_inword -> 1 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + tflags |= LEX_INWORD; + lex_wlen = 0; + } + } + + /* Skip whitespace */ + if MBTEST(shellblank (ch) && (tflags & LEX_HEREDELIM) == 0 && lex_rwlen == 0) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + continue; + } + + /* Either we are looking for the start of the here-doc delimiter + (lex_firstind == -1) or we are reading one (lex_firstind >= 0). + If this character is a shell break character and we are reading + the delimiter, save it and note that we are now reading a here + document. If we've found the start of the delimiter, note it by + setting lex_firstind. Backslashes can quote shell metacharacters + in here-doc delimiters. */ + if (tflags & LEX_HEREDELIM) + { + if (lex_firstind == -1 && shellbreak (ch) == 0) + lex_firstind = retind; +#if 0 + else if (heredelim && (tflags & LEX_PASSNEXT) == 0 && ch == '\n') + { + tflags |= LEX_INHEREDOC; + tflags &= ~LEX_HEREDELIM; + lex_firstind = retind + 1; + } +#endif + else if (lex_firstind >= 0 && (tflags & LEX_PASSNEXT) == 0 && shellbreak (ch)) + { + if (heredelim == 0) + { + nestret = substring (ret, lex_firstind, retind); + heredelim = string_quote_removal (nestret, 0); + free (nestret); + hdlen = STRLEN(heredelim); +/*itrace("parse_comsub:%d: found here doc delimiter `%s' (%d)", line_number, heredelim, hdlen);*/ + } + if (ch == '\n') + { + tflags |= LEX_INHEREDOC; + tflags &= ~LEX_HEREDELIM; + lex_firstind = retind + 1; + } + else + lex_firstind = -1; + } + } + + /* Meta-characters that can introduce a reserved word. Not perfect yet. */ + if MBTEST((tflags & LEX_RESWDOK) == 0 && (tflags & LEX_CKCASE) && (tflags & LEX_INCOMMENT) == 0 && (shellmeta(ch) || ch == '\n')) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + peekc = shell_getc (1); + if (ch == peekc && (ch == '&' || ch == '|' || ch == ';')) /* two-character tokens */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; +/*itrace("parse_comsub:%d: set lex_reswordok = 1, ch = `%c'", line_number, ch);*/ + tflags |= LEX_RESWDOK; + lex_rwlen = 0; + continue; + } + else if (ch == '\n' || COMSUB_META(ch)) + { + shell_ungetc (peekc); +/*itrace("parse_comsub:%d: set lex_reswordok = 1, ch = `%c'", line_number, ch);*/ + tflags |= LEX_RESWDOK; + lex_rwlen = 0; + continue; + } + else if (ch == EOF) + goto eof_error; + else + { + /* `unget' the character we just added and fall through */ + retind--; + shell_ungetc (peekc); + } + } + + /* If we can read a reserved word, try to read one. */ + if (tflags & LEX_RESWDOK) + { + if MBTEST(islower (ch)) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + lex_rwlen++; + continue; + } + else if MBTEST(lex_rwlen == 4 && shellbreak (ch)) + { + if (STREQN (ret + retind - 4, "case", 4)) + { + tflags |= LEX_INCASE; +/*itrace("parse_comsub:%d: found `case', lex_incase -> 1 lex_reswdok -> 0", line_number);*/ + } + else if (STREQN (ret + retind - 4, "esac", 4)) + { + tflags &= ~LEX_INCASE; +/*itrace("parse_comsub:%d: found `esac', lex_incase -> 0 lex_reswdok -> 0", line_number);*/ + } + tflags &= ~LEX_RESWDOK; + } + else if MBTEST((tflags & LEX_CKCOMMENT) && ch == '#' && (lex_rwlen == 0 || ((tflags & LEX_INWORD) && lex_wlen == 0))) + ; /* don't modify LEX_RESWDOK if we're starting a comment */ + /* Allow `do' followed by space, tab, or newline to preserve the + RESWDOK flag, but reset the reserved word length counter so we + can read another one. */ + else if MBTEST(((tflags & LEX_INCASE) == 0) && + (isblank(ch) || ch == '\n') && + lex_rwlen == 2 && + STREQN (ret + retind - 2, "do", 2)) + { +/*itrace("parse_comsub:%d: lex_incase == 1 found `%c', found \"do\"", line_number, ch);*/ + lex_rwlen = 0; + } + else if MBTEST((tflags & LEX_INCASE) && ch != '\n') + /* If we can read a reserved word and we're in case, we're at the + point where we can read a new pattern list or an esac. We + handle the esac case above. If we read a newline, we want to + leave LEX_RESWDOK alone. If we read anything else, we want to + turn off LEX_RESWDOK, since we're going to read a pattern list. */ + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: lex_incase == 1 found `%c', lex_reswordok -> 0", line_number, ch);*/ + } + else if MBTEST(shellbreak (ch) == 0) + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/ + } +#if 0 + /* If we find a space or tab but have read something and it's not + `do', turn off the reserved-word-ok flag */ + else if MBTEST(isblank (ch) && lex_rwlen > 0) + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/ + } +#endif + } + + /* Might be the start of a here-doc delimiter */ + if MBTEST((tflags & LEX_INCOMMENT) == 0 && (tflags & LEX_CKCASE) && ch == '<') + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + peekc = shell_getc (1); + if (peekc == EOF) + goto eof_error; + if (peekc == ch) + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; + peekc = shell_getc (1); + if (peekc == EOF) + goto eof_error; + if (peekc == '-') + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; + tflags |= LEX_STRIPDOC; + } + else + shell_ungetc (peekc); + if (peekc != '<') + { + tflags |= LEX_HEREDELIM; + lex_firstind = -1; + } + continue; + } + else + ch = peekc; /* fall through and continue XXX */ + } + else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (((tflags & LEX_RESWDOK) && lex_rwlen == 0) || ((tflags & LEX_INWORD) && lex_wlen == 0))) + { +/*itrace("parse_comsub:%d: lex_incomment -> 1 (%d)", line_number, __LINE__);*/ + tflags |= LEX_INCOMMENT; + } + + if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } +#if 0 + else if MBTEST((tflags & LEX_INCASE) && ch == close && close == ')') + tflags &= ~LEX_INCASE; /* XXX */ +#endif + else if MBTEST(ch == close && (tflags & LEX_INCASE) == 0) /* ending delimiter */ + { + count--; +/*itrace("parse_comsub:%d: found close: count = %d", line_number, count);*/ + } + else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && (tflags & LEX_INCASE) == 0 && ch == open) /* nested begin */ + { + count++; +/*itrace("parse_comsub:%d: found open: count = %d", line_number, count);*/ + } + + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + /* If we just read the ending character, don't bother continuing. */ + if (count == 0) + break; + + if MBTEST(ch == '\\') /* backslashes */ + tflags |= LEX_PASSNEXT; + + if MBTEST(shellquote (ch)) + { + /* '', ``, or "" inside $(...). */ + push_delimiter (dstack, ch); + if MBTEST((tflags & LEX_WASDOL) && ch == '\'') /* $'...' inside group */ + nestret = parse_matched_pair (ch, ch, ch, &nestlen, P_ALLOWESC|rflags); + else + nestret = parse_matched_pair (ch, ch, ch, &nestlen, rflags); + pop_delimiter (dstack); + CHECK_NESTRET_ERROR (); + + if MBTEST((tflags & LEX_WASDOL) && ch == '\'' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Translate $'...' here. */ + ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen); + xfree (nestret); + + if ((rflags & P_DQUOTE) == 0) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else + { + nestret = ttrans; + nestlen = ttranslen; + } + retind -= 2; /* back up before the $' */ + } + else if MBTEST((tflags & LEX_WASDOL) && ch == '"' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Locale expand $"..." here. */ + ttrans = localeexpand (nestret, 0, nestlen - 1, start_lineno, &ttranslen); + xfree (nestret); + + nestret = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + nestlen = ttranslen + 2; + retind -= 2; /* back up before the $" */ + } + + APPEND_NESTRET (); + FREE (nestret); + } + else if MBTEST((tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + /* check for $(), $[], or ${} inside command substitution. */ + { + if ((tflags & LEX_INCASE) == 0 && open == ch) /* undo previous increment */ + count--; + if (ch == '(') /* ) */ + nestret = parse_comsub (0, '(', ')', &nestlen, (rflags|P_COMMAND) & ~P_DQUOTE); + else if (ch == '{') /* } */ + nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|P_DOLBRACE|rflags); + else if (ch == '[') /* ] */ + nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + if MBTEST(ch == '$') + tflags |= LEX_WASDOL; + else + tflags &= ~LEX_WASDOL; + } + + FREE (heredelim); + ret[retind] = '\0'; + if (lenp) + *lenp = retind; +/*itrace("parse_comsub:%d: returning `%s'", line_number, ret);*/ + return ret; +} + +/* Recursively call the parser to parse a $(...) command substitution. */ +char * +xparse_dolparen (base, string, indp, flags) + char *base; + char *string; + int *indp; + int flags; +{ + sh_parser_state_t ps; + sh_input_line_state_t ls; + int orig_ind, nc, sflags, orig_eof_token; + char *ret, *s, *ep, *ostring; + + /*yydebug = 1;*/ + orig_ind = *indp; + ostring = string; + +/*itrace("xparse_dolparen: size = %d shell_input_line = `%s'", shell_input_line_size, shell_input_line);*/ + sflags = SEVAL_NONINT|SEVAL_NOHIST|SEVAL_NOFREE; + if (flags & SX_NOLONGJMP) + sflags |= SEVAL_NOLONGJMP; + save_parser_state (&ps); + save_input_line_state (&ls); + orig_eof_token = shell_eof_token; + + /*(*/ + parser_state |= PST_CMDSUBST|PST_EOFTOKEN; /* allow instant ')' */ /*(*/ + shell_eof_token = ')'; + parse_string (string, "command substitution", sflags, &ep); + + shell_eof_token = orig_eof_token; + restore_parser_state (&ps); + reset_parser (); + /* reset_parser clears shell_input_line and associated variables */ + restore_input_line_state (&ls); + if (interactive) + token_to_read = 0; + + /* Need to find how many characters parse_and_execute consumed, update + *indp, if flags != 0, copy the portion of the string parsed into RET + and return it. If flags & 1 (EX_NOALLOC) we can return NULL. */ + + /*(*/ + if (ep[-1] != ')') + { +#if DEBUG + if (ep[-1] != '\n') + itrace("xparse_dolparen:%d: ep[-1] != RPAREN (%d), ep = `%s'", line_number, ep[-1], ep); +#endif + while (ep > ostring && ep[-1] == '\n') ep--; + } + + nc = ep - ostring; + *indp = ep - base - 1; + + /*(*/ +#if DEBUG + if (base[*indp] != ')') + itrace("xparse_dolparen:%d: base[%d] != RPAREN (%d), base = `%s'", line_number, *indp, base[*indp], base); +#endif + + if (flags & SX_NOALLOC) + return (char *)NULL; + + if (nc == 0) + { + ret = xmalloc (1); + ret[0] = '\0'; + } + else + ret = substring (ostring, 0, nc - 1); + + return ret; +} + +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) +/* Parse a double-paren construct. It can be either an arithmetic + command, an arithmetic `for' command, or a nested subshell. Returns + the parsed token, -1 on error, or -2 if we didn't do anything and + should just go on. */ +static int +parse_dparen (c) + int c; +{ + int cmdtyp, sline; + char *wval; + WORD_DESC *wd; + +#if defined (ARITH_FOR_COMMAND) + if (last_read_token == FOR) + { + arith_for_lineno = line_number; + cmdtyp = parse_arith_cmd (&wval, 0); + if (cmdtyp == 1) + { + wd = alloc_word_desc (); + wd->word = wval; + yylval.word_list = make_word_list (wd, (WORD_LIST *)NULL); + return (ARITH_FOR_EXPRS); + } + else + return -1; /* ERROR */ + } +#endif + +#if defined (DPAREN_ARITHMETIC) + if (reserved_word_acceptable (last_read_token)) + { + sline = line_number; + + cmdtyp = parse_arith_cmd (&wval, 0); + if (cmdtyp == 1) /* arithmetic command */ + { + wd = alloc_word_desc (); + wd->word = wval; + wd->flags = W_QUOTED|W_NOSPLIT|W_NOGLOB|W_DQUOTE; + yylval.word_list = make_word_list (wd, (WORD_LIST *)NULL); + return (ARITH_CMD); + } + else if (cmdtyp == 0) /* nested subshell */ + { + push_string (wval, 0, (alias_t *)NULL); + pushed_string_list->flags = PSH_DPAREN; + if ((parser_state & PST_CASEPAT) == 0) + parser_state |= PST_SUBSHELL; + return (c); + } + else /* ERROR */ + return -1; + } +#endif + + return -2; /* XXX */ +} + +/* We've seen a `(('. Look for the matching `))'. If we get it, return 1. + If not, assume it's a nested subshell for backwards compatibility and + return 0. In any case, put the characters we've consumed into a locally- + allocated buffer and make *ep point to that buffer. Return -1 on an + error, for example EOF. */ +static int +parse_arith_cmd (ep, adddq) + char **ep; + int adddq; +{ + int exp_lineno, rval, c; + char *ttok, *tokstr; + int ttoklen; + + exp_lineno = line_number; + ttok = parse_matched_pair (0, '(', ')', &ttoklen, 0); + rval = 1; + if (ttok == &matched_pair_error) + return -1; + /* Check that the next character is the closing right paren. If + not, this is a syntax error. ( */ + c = shell_getc (0); + if MBTEST(c != ')') + rval = 0; + + tokstr = (char *)xmalloc (ttoklen + 4); + + /* if ADDDQ != 0 then (( ... )) -> "..." */ + if (rval == 1 && adddq) /* arith cmd, add double quotes */ + { + tokstr[0] = '"'; + strncpy (tokstr + 1, ttok, ttoklen - 1); + tokstr[ttoklen] = '"'; + tokstr[ttoklen+1] = '\0'; + } + else if (rval == 1) /* arith cmd, don't add double quotes */ + { + strncpy (tokstr, ttok, ttoklen - 1); + tokstr[ttoklen-1] = '\0'; + } + else /* nested subshell */ + { + tokstr[0] = '('; + strncpy (tokstr + 1, ttok, ttoklen - 1); + tokstr[ttoklen] = ')'; + tokstr[ttoklen+1] = c; + tokstr[ttoklen+2] = '\0'; + } + + *ep = tokstr; + FREE (ttok); + return rval; +} +#endif /* DPAREN_ARITHMETIC || ARITH_FOR_COMMAND */ + +#if defined (COND_COMMAND) +static void +cond_error () +{ + char *etext; + + if (EOF_Reached && cond_token != COND_ERROR) /* [[ */ + parser_error (cond_lineno, _("unexpected EOF while looking for `]]'")); + else if (cond_token != COND_ERROR) + { + if (etext = error_token_from_token (cond_token)) + { + parser_error (cond_lineno, _("syntax error in conditional expression: unexpected token `%s'"), etext); + free (etext); + } + else + parser_error (cond_lineno, _("syntax error in conditional expression")); + } +} + +static COND_COM * +cond_expr () +{ + return (cond_or ()); +} + +static COND_COM * +cond_or () +{ + COND_COM *l, *r; + + l = cond_and (); + if (cond_token == OR_OR) + { + r = cond_or (); + l = make_cond_node (COND_OR, (WORD_DESC *)NULL, l, r); + } + return l; +} + +static COND_COM * +cond_and () +{ + COND_COM *l, *r; + + l = cond_term (); + if (cond_token == AND_AND) + { + r = cond_and (); + l = make_cond_node (COND_AND, (WORD_DESC *)NULL, l, r); + } + return l; +} + +static int +cond_skip_newlines () +{ + while ((cond_token = read_token (READ)) == '\n') + { + if (SHOULD_PROMPT ()) + prompt_again (); + } + return (cond_token); +} + +#define COND_RETURN_ERROR() \ + do { cond_token = COND_ERROR; return ((COND_COM *)NULL); } while (0) + +static COND_COM * +cond_term () +{ + WORD_DESC *op; + COND_COM *term, *tleft, *tright; + int tok, lineno; + char *etext; + + /* Read a token. It can be a left paren, a `!', a unary operator, or a + word that should be the first argument of a binary operator. Start by + skipping newlines, since this is a compound command. */ + tok = cond_skip_newlines (); + lineno = line_number; + if (tok == COND_END) + { + COND_RETURN_ERROR (); + } + else if (tok == '(') + { + term = cond_expr (); + if (cond_token != ')') + { + if (term) + dispose_cond_node (term); /* ( */ + if (etext = error_token_from_token (cond_token)) + { + parser_error (lineno, _("unexpected token `%s', expected `)'"), etext); + free (etext); + } + else + parser_error (lineno, _("expected `)'")); + COND_RETURN_ERROR (); + } + term = make_cond_node (COND_EXPR, (WORD_DESC *)NULL, term, (COND_COM *)NULL); + (void)cond_skip_newlines (); + } + else if (tok == BANG || (tok == WORD && (yylval.word->word[0] == '!' && yylval.word->word[1] == '\0'))) + { + if (tok == WORD) + dispose_word (yylval.word); /* not needed */ + term = cond_term (); + if (term) + term->flags |= CMD_INVERT_RETURN; + } + else if (tok == WORD && yylval.word->word[0] == '-' && yylval.word->word[2] == 0 && test_unop (yylval.word->word)) + { + op = yylval.word; + tok = read_token (READ); + if (tok == WORD) + { + tleft = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + term = make_cond_node (COND_UNARY, op, tleft, (COND_COM *)NULL); + } + else + { + dispose_word (op); + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected argument `%s' to conditional unary operator"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected argument to conditional unary operator")); + COND_RETURN_ERROR (); + } + + (void)cond_skip_newlines (); + } + else if (tok == WORD) /* left argument to binary operator */ + { + /* lhs */ + tleft = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + + /* binop */ + tok = read_token (READ); + if (tok == WORD && test_binop (yylval.word->word)) + { + op = yylval.word; + if (op->word[0] == '=' && (op->word[1] == '\0' || (op->word[1] == '=' && op->word[2] == '\0'))) + parser_state |= PST_EXTPAT; + else if (op->word[0] == '!' && op->word[1] == '=' && op->word[2] == '\0') + parser_state |= PST_EXTPAT; + } +#if defined (COND_REGEXP) + else if (tok == WORD && STREQ (yylval.word->word, "=~")) + { + op = yylval.word; + parser_state |= PST_REGEXP; + } +#endif + else if (tok == '<' || tok == '>') + op = make_word_from_token (tok); /* ( */ + /* There should be a check before blindly accepting the `)' that we have + seen the opening `('. */ + else if (tok == COND_END || tok == AND_AND || tok == OR_OR || tok == ')') + { + /* Special case. [[ x ]] is equivalent to [[ -n x ]], just like + the test command. Similarly for [[ x && expr ]] or + [[ x || expr ]] or [[ (x) ]]. */ + op = make_word ("-n"); + term = make_cond_node (COND_UNARY, op, tleft, (COND_COM *)NULL); + cond_token = tok; + return (term); + } + else + { + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected token `%s', conditional binary operator expected"), etext); + free (etext); + } + else + parser_error (line_number, _("conditional binary operator expected")); + dispose_cond_node (tleft); + COND_RETURN_ERROR (); + } + + /* rhs */ + if (parser_state & PST_EXTPAT) + extended_glob = 1; + tok = read_token (READ); + if (parser_state & PST_EXTPAT) + extended_glob = global_extglob; + parser_state &= ~(PST_REGEXP|PST_EXTPAT); + + if (tok == WORD) + { + tright = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + term = make_cond_node (COND_BINARY, op, tleft, tright); + } + else + { + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected argument `%s' to conditional binary operator"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected argument to conditional binary operator")); + dispose_cond_node (tleft); + dispose_word (op); + COND_RETURN_ERROR (); + } + + (void)cond_skip_newlines (); + } + else + { + if (tok < 256) + parser_error (line_number, _("unexpected token `%c' in conditional command"), tok); + else if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected token `%s' in conditional command"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected token %d in conditional command"), tok); + COND_RETURN_ERROR (); + } + return (term); +} + +/* This is kind of bogus -- we slip a mini recursive-descent parser in + here to handle the conditional statement syntax. */ +static COMMAND * +parse_cond_command () +{ + COND_COM *cexp; + + global_extglob = extended_glob; + cexp = cond_expr (); + return (make_cond_command (cexp)); +} +#endif + +#if defined (ARRAY_VARS) +/* When this is called, it's guaranteed that we don't care about anything + in t beyond i. We do save and restore the chars, though. */ +static int +token_is_assignment (t, i) + char *t; + int i; +{ + unsigned char c, c1; + int r; + + c = t[i]; c1 = t[i+1]; + t[i] = '='; t[i+1] = '\0'; + r = assignment (t, (parser_state & PST_COMPASSIGN) != 0); + t[i] = c; t[i+1] = c1; + return r; +} + +/* XXX - possible changes here for `+=' */ +static int +token_is_ident (t, i) + char *t; + int i; +{ + unsigned char c; + int r; + + c = t[i]; + t[i] = '\0'; + r = legal_identifier (t); + t[i] = c; + return r; +} +#endif + +static int +read_token_word (character) + int character; +{ + /* The value for YYLVAL when a WORD is read. */ + WORD_DESC *the_word; + + /* Index into the token that we are building. */ + int token_index; + + /* ALL_DIGITS becomes zero when we see a non-digit. */ + int all_digit_token; + + /* DOLLAR_PRESENT becomes non-zero if we see a `$'. */ + int dollar_present; + + /* COMPOUND_ASSIGNMENT becomes non-zero if we are parsing a compound + assignment. */ + int compound_assignment; + + /* QUOTED becomes non-zero if we see one of ("), ('), (`), or (\). */ + int quoted; + + /* Non-zero means to ignore the value of the next character, and just + to add it no matter what. */ + int pass_next_character; + + /* The current delimiting character. */ + int cd; + int result, peek_char; + char *ttok, *ttrans; + int ttoklen, ttranslen; + intmax_t lvalue; + + if (token_buffer_size < TOKEN_DEFAULT_INITIAL_SIZE) + token = (char *)xrealloc (token, token_buffer_size = TOKEN_DEFAULT_INITIAL_SIZE); + + token_index = 0; + all_digit_token = DIGIT (character); + dollar_present = quoted = pass_next_character = compound_assignment = 0; + + for (;;) + { + if (character == EOF) + goto got_token; + + if (pass_next_character) + { + pass_next_character = 0; + goto got_escaped_character; + } + + cd = current_delimiter (dstack); + + /* Handle backslashes. Quote lots of things when not inside of + double-quotes, quote some things inside of double-quotes. */ + if MBTEST(character == '\\') + { + peek_char = shell_getc (0); + + /* Backslash-newline is ignored in all cases except + when quoted with single quotes. */ + if (peek_char == '\n') + { + character = '\n'; + goto next_character; + } + else + { + shell_ungetc (peek_char); + + /* If the next character is to be quoted, note it now. */ + if (cd == 0 || cd == '`' || + (cd == '"' && peek_char >= 0 && (sh_syntaxtab[peek_char] & CBSDQUOTE))) + pass_next_character++; + + quoted = 1; + goto got_character; + } + } + + /* Parse a matched pair of quote characters. */ + if MBTEST(shellquote (character)) + { + push_delimiter (dstack, character); + ttok = parse_matched_pair (character, character, character, &ttoklen, (character == '`') ? P_COMMAND : 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + all_digit_token = 0; + quoted = 1; + dollar_present |= (character == '"' && strchr (ttok, '$') != 0); + FREE (ttok); + goto next_character; + } + +#ifdef COND_REGEXP + /* When parsing a regexp as a single word inside a conditional command, + we need to special-case characters special to both the shell and + regular expressions. Right now, that is only '(' and '|'. */ /*)*/ + if MBTEST((parser_state & PST_REGEXP) && (character == '(' || character == '|')) /*)*/ + { + if (character == '|') + goto got_character; + + push_delimiter (dstack, character); + ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = all_digit_token = 0; + goto next_character; + } +#endif /* COND_REGEXP */ + +#ifdef EXTENDED_GLOB + /* Parse a ksh-style extended pattern matching specification. */ + if MBTEST(extended_glob && PATTERN_CHAR (character)) + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '(') /* ) */ + { + push_delimiter (dstack, peek_char); + ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + token[token_index++] = peek_char; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = all_digit_token = 0; + goto next_character; + } + else + shell_ungetc (peek_char); + } +#endif /* EXTENDED_GLOB */ + + /* If the delimiter character is not single quote, parse some of + the shell expansions that must be read as a single word. */ + if (shellexp (character)) + { + peek_char = shell_getc (1); + /* $(...), <(...), >(...), $((...)), ${...}, and $[...] constructs */ + if MBTEST(peek_char == '(' || + ((peek_char == '{' || peek_char == '[') && character == '$')) /* ) ] } */ + { + if (peek_char == '{') /* } */ + ttok = parse_matched_pair (cd, '{', '}', &ttoklen, P_FIRSTCLOSE|P_DOLBRACE); + else if (peek_char == '(') /* ) */ + { + /* XXX - push and pop the `(' as a delimiter for use by + the command-oriented-history code. This way newlines + appearing in the $(...) string get added to the + history literally rather than causing a possibly- + incorrect `;' to be added. ) */ + push_delimiter (dstack, peek_char); + ttok = parse_comsub (cd, '(', ')', &ttoklen, P_COMMAND); + pop_delimiter (dstack); + } + else + ttok = parse_matched_pair (cd, '[', ']', &ttoklen, 0); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + token[token_index++] = peek_char; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = 1; + all_digit_token = 0; + goto next_character; + } + /* This handles $'...' and $"..." new-style quoted strings. */ + else if MBTEST(character == '$' && (peek_char == '\'' || peek_char == '"')) + { + int first_line; + + first_line = line_number; + push_delimiter (dstack, peek_char); + ttok = parse_matched_pair (peek_char, peek_char, peek_char, + &ttoklen, + (peek_char == '\'') ? P_ALLOWESC : 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; + if (peek_char == '\'') + { + ttrans = ansiexpand (ttok, 0, ttoklen - 1, &ttranslen); + free (ttok); + + /* Insert the single quotes and correctly quote any + embedded single quotes (allowed because P_ALLOWESC was + passed to parse_matched_pair). */ + ttok = sh_single_quote (ttrans); + free (ttrans); + ttranslen = strlen (ttok); + ttrans = ttok; + } + else + { + /* Try to locale-expand the converted string. */ + ttrans = localeexpand (ttok, 0, ttoklen - 1, first_line, &ttranslen); + free (ttok); + + /* Add the double quotes back */ + ttok = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + ttranslen += 2; + ttrans = ttok; + } + + RESIZE_MALLOCED_BUFFER (token, token_index, ttranslen + 1, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + strcpy (token + token_index, ttrans); + token_index += ttranslen; + FREE (ttrans); + quoted = 1; + all_digit_token = 0; + goto next_character; + } + /* This could eventually be extended to recognize all of the + shell's single-character parameter expansions, and set flags.*/ + else if MBTEST(character == '$' && peek_char == '$') + { + RESIZE_MALLOCED_BUFFER (token, token_index, 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = '$'; + token[token_index++] = peek_char; + dollar_present = 1; + all_digit_token = 0; + goto next_character; + } + else + shell_ungetc (peek_char); + } + +#if defined (ARRAY_VARS) + /* Identify possible array subscript assignment; match [...]. If + parser_state&PST_COMPASSIGN, we need to parse [sub]=words treating + `sub' as if it were enclosed in double quotes. */ + else if MBTEST(character == '[' && /* ] */ + ((token_index > 0 && assignment_acceptable (last_read_token) && token_is_ident (token, token_index)) || + (token_index == 0 && (parser_state&PST_COMPASSIGN)))) + { + ttok = parse_matched_pair (cd, '[', ']', &ttoklen, P_ARRAYSUB); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + all_digit_token = 0; + goto next_character; + } + /* Identify possible compound array variable assignment. */ + else if MBTEST(character == '=' && token_index > 0 && (assignment_acceptable (last_read_token) || (parser_state & PST_ASSIGNOK)) && token_is_assignment (token, token_index)) + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '(') /* ) */ + { + ttok = parse_compound_assignment (&ttoklen); + + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 4, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + + token[token_index++] = '='; + token[token_index++] = '('; + if (ttok) + { + strcpy (token + token_index, ttok); + token_index += ttoklen; + } + token[token_index++] = ')'; + FREE (ttok); + all_digit_token = 0; + compound_assignment = 1; +#if 1 + goto next_character; +#else + goto got_token; /* ksh93 seems to do this */ +#endif + } + else + shell_ungetc (peek_char); + } +#endif + + /* When not parsing a multi-character word construct, shell meta- + characters break words. */ + if MBTEST(shellbreak (character)) + { + shell_ungetc (character); + goto got_token; + } + +got_character: + + if (character == CTLESC || character == CTLNUL) + { + RESIZE_MALLOCED_BUFFER (token, token_index, 2, token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = CTLESC; + } + else +got_escaped_character: + RESIZE_MALLOCED_BUFFER (token, token_index, 1, token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + + token[token_index++] = character; + + all_digit_token &= DIGIT (character); + dollar_present |= character == '$'; + + next_character: + if (character == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* We want to remove quoted newlines (that is, a \ pair) + unless we are within single quotes or pass_next_character is + set (the shell equivalent of literal-next). */ + cd = current_delimiter (dstack); + character = shell_getc (cd != '\'' && pass_next_character == 0); + } /* end for (;;) */ + +got_token: + + /* Calls to RESIZE_MALLOCED_BUFFER ensure there is sufficient room. */ + token[token_index] = '\0'; + + /* Check to see what thing we should return. If the last_read_token + is a `<', or a `&', or the character which ended this token is + a '>' or '<', then, and ONLY then, is this input token a NUMBER. + Otherwise, it is just a word, and should be returned as such. */ + if MBTEST(all_digit_token && (character == '<' || character == '>' || + last_read_token == LESS_AND || + last_read_token == GREATER_AND)) + { + if (legal_number (token, &lvalue) && (int)lvalue == lvalue) + { + yylval.number = lvalue; + return (NUMBER); + } + } + + /* Check for special case tokens. */ + result = (last_shell_getc_is_singlebyte) ? special_case_tokens (token) : -1; + if (result >= 0) + return result; + +#if defined (ALIAS) + /* Posix.2 does not allow reserved words to be aliased, so check for all + of them, including special cases, before expanding the current token + as an alias. */ + if MBTEST(posixly_correct) + CHECK_FOR_RESERVED_WORD (token); + + /* Aliases are expanded iff EXPAND_ALIASES is non-zero, and quoting + inhibits alias expansion. */ + if (expand_aliases && quoted == 0) + { + result = alias_expand_token (token); + if (result == RE_READ_TOKEN) + return (RE_READ_TOKEN); + else if (result == NO_EXPANSION) + parser_state &= ~PST_ALEXPNEXT; + } + + /* If not in Posix.2 mode, check for reserved words after alias + expansion. */ + if MBTEST(posixly_correct == 0) +#endif + CHECK_FOR_RESERVED_WORD (token); + + the_word = (WORD_DESC *)xmalloc (sizeof (WORD_DESC)); + the_word->word = (char *)xmalloc (1 + token_index); + the_word->flags = 0; + strcpy (the_word->word, token); + if (dollar_present) + the_word->flags |= W_HASDOLLAR; + if (quoted) + the_word->flags |= W_QUOTED; /*(*/ + if (compound_assignment && token[token_index-1] == ')') + the_word->flags |= W_COMPASSIGN; + /* A word is an assignment if it appears at the beginning of a + simple command, or after another assignment word. This is + context-dependent, so it cannot be handled in the grammar. */ + if (assignment (token, (parser_state & PST_COMPASSIGN) != 0)) + { + the_word->flags |= W_ASSIGNMENT; + /* Don't perform word splitting on assignment statements. */ + if (assignment_acceptable (last_read_token) || (parser_state & PST_COMPASSIGN) != 0) + { + the_word->flags |= W_NOSPLIT; + if (parser_state & PST_COMPASSIGN) + the_word->flags |= W_NOGLOB; /* XXX - W_NOBRACE? */ + } + } + + if (command_token_position (last_read_token)) + { + struct builtin *b; + b = builtin_address_internal (token, 0); + if (b && (b->flags & ASSIGNMENT_BUILTIN)) + parser_state |= PST_ASSIGNOK; + else if (STREQ (token, "eval") || STREQ (token, "let")) + parser_state |= PST_ASSIGNOK; + } + + yylval.word = the_word; + + if (token[0] == '{' && token[token_index-1] == '}' && + (character == '<' || character == '>')) + { + /* can use token; already copied to the_word */ + token[token_index-1] = '\0'; +#if defined (ARRAY_VARS) + if (legal_identifier (token+1) || valid_array_reference (token+1)) +#else + if (legal_identifier (token+1)) +#endif + { + strcpy (the_word->word, token+1); +/*itrace("read_token_word: returning REDIR_WORD for %s", the_word->word);*/ + return (REDIR_WORD); + } + } + + result = ((the_word->flags & (W_ASSIGNMENT|W_NOSPLIT)) == (W_ASSIGNMENT|W_NOSPLIT)) + ? ASSIGNMENT_WORD : WORD; + + switch (last_read_token) + { + case FUNCTION: + parser_state |= PST_ALLOWOPNBRC; + function_dstart = line_number; + break; + case CASE: + case SELECT: + case FOR: + if (word_top < MAX_CASE_NEST) + word_top++; + word_lineno[word_top] = line_number; + break; + } + + return (result); +} + +/* Return 1 if TOKSYM is a token that after being read would allow + a reserved word to be seen, else 0. */ +static int +reserved_word_acceptable (toksym) + int toksym; +{ + switch (toksym) + { + case '\n': + case ';': + case '(': + case ')': + case '|': + case '&': + case '{': + case '}': /* XXX */ + case AND_AND: + case BANG: + case BAR_AND: + case DO: + case DONE: + case ELIF: + case ELSE: + case ESAC: + case FI: + case IF: + case OR_OR: + case SEMI_SEMI: + case SEMI_AND: + case SEMI_SEMI_AND: + case THEN: + case TIME: + case TIMEOPT: + case TIMEIGN: + case COPROC: + case UNTIL: + case WHILE: + case 0: + return 1; + default: +#if defined (COPROCESS_SUPPORT) + if (last_read_token == WORD && token_before_that == COPROC) + return 1; +#endif + if (last_read_token == WORD && token_before_that == FUNCTION) + return 1; + return 0; + } +} + +/* Return the index of TOKEN in the alist of reserved words, or -1 if + TOKEN is not a shell reserved word. */ +int +find_reserved_word (tokstr) + char *tokstr; +{ + int i; + for (i = 0; word_token_alist[i].word; i++) + if (STREQ (tokstr, word_token_alist[i].word)) + return i; + return -1; +} + +/* An interface to let the rest of the shell (primarily the completion + system) know what the parser is expecting. */ +int +parser_in_command_position () +{ + return (command_token_position (last_read_token)); +} + +#if 0 +#if defined (READLINE) +/* Called after each time readline is called. This insures that whatever + the new prompt string is gets propagated to readline's local prompt + variable. */ +static void +reset_readline_prompt () +{ + char *temp_prompt; + + if (prompt_string_pointer) + { + temp_prompt = (*prompt_string_pointer) + ? decode_prompt_string (*prompt_string_pointer) + : (char *)NULL; + + if (temp_prompt == 0) + { + temp_prompt = (char *)xmalloc (1); + temp_prompt[0] = '\0'; + } + + FREE (current_readline_prompt); + current_readline_prompt = temp_prompt; + } +} +#endif /* READLINE */ +#endif /* 0 */ + +#if defined (HISTORY) +/* A list of tokens which can be followed by newlines, but not by + semi-colons. When concatenating multiple lines of history, the + newline separator for such tokens is replaced with a space. */ +static const int no_semi_successors[] = { + '\n', '{', '(', ')', ';', '&', '|', + CASE, DO, ELSE, IF, SEMI_SEMI, SEMI_AND, SEMI_SEMI_AND, THEN, UNTIL, + WHILE, AND_AND, OR_OR, IN, + 0 +}; + +/* If we are not within a delimited expression, try to be smart + about which separators can be semi-colons and which must be + newlines. Returns the string that should be added into the + history entry. LINE is the line we're about to add; it helps + make some more intelligent decisions in certain cases. */ +char * +history_delimiting_chars (line) + const char *line; +{ + static int last_was_heredoc = 0; /* was the last entry the start of a here document? */ + register int i; + + if ((parser_state & PST_HEREDOC) == 0) + last_was_heredoc = 0; + + if (dstack.delimiter_depth != 0) + return ("\n"); + + /* We look for current_command_line_count == 2 because we are looking to + add the first line of the body of the here document (the second line + of the command). We also keep LAST_WAS_HEREDOC as a private sentinel + variable to note when we think we added the first line of a here doc + (the one with a "<<" somewhere in it) */ + if (parser_state & PST_HEREDOC) + { + if (last_was_heredoc) + { + last_was_heredoc = 0; + return "\n"; + } + return (current_command_line_count == 2 ? "\n" : ""); + } + + if (parser_state & PST_COMPASSIGN) + return (" "); + + /* First, handle some special cases. */ + /*(*/ + /* If we just read `()', assume it's a function definition, and don't + add a semicolon. If the token before the `)' was not `(', and we're + not in the midst of parsing a case statement, assume it's a + parenthesized command and add the semicolon. */ + /*)(*/ + if (token_before_that == ')') + { + if (two_tokens_ago == '(') /*)*/ /* function def */ + return " "; + /* This does not work for subshells inside case statement + command lists. It's a suboptimal solution. */ + else if (parser_state & PST_CASESTMT) /* case statement pattern */ + return " "; + else + return "; "; /* (...) subshell */ + } + else if (token_before_that == WORD && two_tokens_ago == FUNCTION) + return " "; /* function def using `function name' without `()' */ + + /* If we're not in a here document, but we think we're about to parse one, + and we would otherwise return a `;', return a newline to delimit the + line with the here-doc delimiter */ + else if ((parser_state & PST_HEREDOC) == 0 && current_command_line_count > 1 && last_read_token == '\n' && strstr (line, "<<")) + { + last_was_heredoc = 1; + return "\n"; + } + + else if (token_before_that == WORD && two_tokens_ago == FOR) + { + /* Tricky. `for i\nin ...' should not have a semicolon, but + `for i\ndo ...' should. We do what we can. */ + for (i = shell_input_line_index; whitespace (shell_input_line[i]); i++) + ; + if (shell_input_line[i] && shell_input_line[i] == 'i' && shell_input_line[i+1] == 'n') + return " "; + return ";"; + } + else if (two_tokens_ago == CASE && token_before_that == WORD && (parser_state & PST_CASESTMT)) + return " "; + + for (i = 0; no_semi_successors[i]; i++) + { + if (token_before_that == no_semi_successors[i]) + return (" "); + } + + return ("; "); +} +#endif /* HISTORY */ + +/* Issue a prompt, or prepare to issue a prompt when the next character + is read. */ +static void +prompt_again () +{ + char *temp_prompt; + + if (interactive == 0 || expanding_alias ()) /* XXX */ + return; + + ps1_prompt = get_string_value ("PS1"); + ps2_prompt = get_string_value ("PS2"); + + if (!prompt_string_pointer) + prompt_string_pointer = &ps1_prompt; + + temp_prompt = *prompt_string_pointer + ? decode_prompt_string (*prompt_string_pointer) + : (char *)NULL; + + if (temp_prompt == 0) + { + temp_prompt = (char *)xmalloc (1); + temp_prompt[0] = '\0'; + } + + current_prompt_string = *prompt_string_pointer; + prompt_string_pointer = &ps2_prompt; + +#if defined (READLINE) + if (!no_line_editing) + { + FREE (current_readline_prompt); + current_readline_prompt = temp_prompt; + } + else +#endif /* READLINE */ + { + FREE (current_decoded_prompt); + current_decoded_prompt = temp_prompt; + } +} + +int +get_current_prompt_level () +{ + return ((current_prompt_string && current_prompt_string == ps2_prompt) ? 2 : 1); +} + +void +set_current_prompt_level (x) + int x; +{ + prompt_string_pointer = (x == 2) ? &ps2_prompt : &ps1_prompt; + current_prompt_string = *prompt_string_pointer; +} + +static void +print_prompt () +{ + fprintf (stderr, "%s", current_decoded_prompt); + fflush (stderr); +} + +/* Return a string which will be printed as a prompt. The string + may contain special characters which are decoded as follows: + + \a bell (ascii 07) + \d the date in Day Mon Date format + \e escape (ascii 033) + \h the hostname up to the first `.' + \H the hostname + \j the number of active jobs + \l the basename of the shell's tty device name + \n CRLF + \r CR + \s the name of the shell + \t the time in 24-hour hh:mm:ss format + \T the time in 12-hour hh:mm:ss format + \@ the time in 12-hour hh:mm am/pm format + \A the time in 24-hour hh:mm format + \D{fmt} the result of passing FMT to strftime(3) + \u your username + \v the version of bash (e.g., 2.00) + \V the release of bash, version + patchlevel (e.g., 2.00.0) + \w the current working directory + \W the last element of $PWD + \! the history number of this command + \# the command number of this command + \$ a $ or a # if you are root + \nnn character code nnn in octal + \\ a backslash + \[ begin a sequence of non-printing chars + \] end a sequence of non-printing chars +*/ +#define PROMPT_GROWTH 48 +char * +decode_prompt_string (string) + char *string; +{ + WORD_LIST *list; + char *result, *t; + struct dstack save_dstack; + int last_exit_value, last_comsub_pid; +#if defined (PROMPT_STRING_DECODE) + int result_size, result_index; + int c, n, i; + char *temp, octal_string[4]; + struct tm *tm; + time_t the_time; + char timebuf[128]; + char *timefmt; + + result = (char *)xmalloc (result_size = PROMPT_GROWTH); + result[result_index = 0] = 0; + temp = (char *)NULL; + + while (c = *string++) + { + if (posixly_correct && c == '!') + { + if (*string == '!') + { + temp = savestring ("!"); + goto add_string; + } + else + { +#if !defined (HISTORY) + temp = savestring ("1"); +#else /* HISTORY */ + temp = itos (history_number ()); +#endif /* HISTORY */ + string--; /* add_string increments string again. */ + goto add_string; + } + } + if (c == '\\') + { + c = *string; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + strncpy (octal_string, string, 3); + octal_string[3] = '\0'; + + n = read_octal (octal_string); + temp = (char *)xmalloc (3); + + if (n == CTLESC || n == CTLNUL) + { + temp[0] = CTLESC; + temp[1] = n; + temp[2] = '\0'; + } + else if (n == -1) + { + temp[0] = '\\'; + temp[1] = '\0'; + } + else + { + temp[0] = n; + temp[1] = '\0'; + } + + for (c = 0; n != -1 && c < 3 && ISOCTAL (*string); c++) + string++; + + c = 0; /* tested at add_string: */ + goto add_string; + + case 'd': + case 't': + case 'T': + case '@': + case 'A': + /* Make the current time/date into a string. */ + (void) time (&the_time); +#if defined (HAVE_TZSET) + sv_tz ("TZ"); /* XXX -- just make sure */ +#endif + tm = localtime (&the_time); + + if (c == 'd') + n = strftime (timebuf, sizeof (timebuf), "%a %b %d", tm); + else if (c == 't') + n = strftime (timebuf, sizeof (timebuf), "%H:%M:%S", tm); + else if (c == 'T') + n = strftime (timebuf, sizeof (timebuf), "%I:%M:%S", tm); + else if (c == '@') + n = strftime (timebuf, sizeof (timebuf), "%I:%M %p", tm); + else if (c == 'A') + n = strftime (timebuf, sizeof (timebuf), "%H:%M", tm); + + if (n == 0) + timebuf[0] = '\0'; + else + timebuf[sizeof(timebuf) - 1] = '\0'; + + temp = savestring (timebuf); + goto add_string; + + case 'D': /* strftime format */ + if (string[1] != '{') /* } */ + goto not_escape; + + (void) time (&the_time); + tm = localtime (&the_time); + string += 2; /* skip { */ + timefmt = xmalloc (strlen (string) + 3); + for (t = timefmt; *string && *string != '}'; ) + *t++ = *string++; + *t = '\0'; + c = *string; /* tested at add_string */ + if (timefmt[0] == '\0') + { + timefmt[0] = '%'; + timefmt[1] = 'X'; /* locale-specific current time */ + timefmt[2] = '\0'; + } + n = strftime (timebuf, sizeof (timebuf), timefmt, tm); + free (timefmt); + + if (n == 0) + timebuf[0] = '\0'; + else + timebuf[sizeof(timebuf) - 1] = '\0'; + + if (promptvars || posixly_correct) + /* Make sure that expand_prompt_string is called with a + second argument of Q_DOUBLE_QUOTES if we use this + function here. */ + temp = sh_backslash_quote_for_double_quotes (timebuf); + else + temp = savestring (timebuf); + goto add_string; + + case 'n': + temp = (char *)xmalloc (3); + temp[0] = no_line_editing ? '\n' : '\r'; + temp[1] = no_line_editing ? '\0' : '\n'; + temp[2] = '\0'; + goto add_string; + + case 's': + temp = base_pathname (shell_name); + temp = savestring (temp); + goto add_string; + + case 'v': + case 'V': + temp = (char *)xmalloc (16); + if (c == 'v') + strcpy (temp, dist_version); + else + sprintf (temp, "%s.%d", dist_version, patch_level); + goto add_string; + + case 'w': + case 'W': + { + /* Use the value of PWD because it is much more efficient. */ + char t_string[PATH_MAX]; + int tlen; + + temp = get_string_value ("PWD"); + + if (temp == 0) + { + if (getcwd (t_string, sizeof(t_string)) == 0) + { + t_string[0] = '.'; + tlen = 1; + } + else + tlen = strlen (t_string); + } + else + { + tlen = sizeof (t_string) - 1; + strncpy (t_string, temp, tlen); + } + t_string[tlen] = '\0'; + +#if defined (MACOSX) + /* Convert from "fs" format to "input" format */ + temp = fnx_fromfs (t_string, strlen (t_string)); + if (temp != t_string) + strcpy (t_string, temp); +#endif + +#define ROOT_PATH(x) ((x)[0] == '/' && (x)[1] == 0) +#define DOUBLE_SLASH_ROOT(x) ((x)[0] == '/' && (x)[1] == '/' && (x)[2] == 0) + /* Abbreviate \W as ~ if $PWD == $HOME */ + if (c == 'W' && (((t = get_string_value ("HOME")) == 0) || STREQ (t, t_string) == 0)) + { + if (ROOT_PATH (t_string) == 0 && DOUBLE_SLASH_ROOT (t_string) == 0) + { + t = strrchr (t_string, '/'); + if (t) + memmove (t_string, t + 1, strlen (t)); /* strlen(t) to copy NULL */ + } + } +#undef ROOT_PATH +#undef DOUBLE_SLASH_ROOT + else + { + /* polite_directory_format is guaranteed to return a string + no longer than PATH_MAX - 1 characters. */ + temp = polite_directory_format (t_string); + if (temp != t_string) + strcpy (t_string, temp); + } + + temp = trim_pathname (t_string, PATH_MAX - 1); + /* If we're going to be expanding the prompt string later, + quote the directory name. */ + if (promptvars || posixly_correct) + /* Make sure that expand_prompt_string is called with a + second argument of Q_DOUBLE_QUOTES if we use this + function here. */ + temp = sh_backslash_quote_for_double_quotes (t_string); + else + temp = savestring (t_string); + + goto add_string; + } + + case 'u': + if (current_user.user_name == 0) + get_current_user_info (); + temp = savestring (current_user.user_name); + goto add_string; + + case 'h': + case 'H': + temp = savestring (current_host_name); + if (c == 'h' && (t = (char *)strchr (temp, '.'))) + *t = '\0'; + goto add_string; + + case '#': + temp = itos (current_command_number); + goto add_string; + + case '!': +#if !defined (HISTORY) + temp = savestring ("1"); +#else /* HISTORY */ + temp = itos (history_number ()); +#endif /* HISTORY */ + goto add_string; + + case '$': + t = temp = (char *)xmalloc (3); + if ((promptvars || posixly_correct) && (current_user.euid != 0)) + *t++ = '\\'; + *t++ = current_user.euid == 0 ? '#' : '$'; + *t = '\0'; + goto add_string; + + case 'j': + temp = itos (count_all_jobs ()); + goto add_string; + + case 'l': +#if defined (HAVE_TTYNAME) + temp = (char *)ttyname (fileno (stdin)); + t = temp ? base_pathname (temp) : "tty"; + temp = savestring (t); +#else + temp = savestring ("tty"); +#endif /* !HAVE_TTYNAME */ + goto add_string; + +#if defined (READLINE) + case '[': + case ']': + if (no_line_editing) + { + string++; + break; + } + temp = (char *)xmalloc (3); + n = (c == '[') ? RL_PROMPT_START_IGNORE : RL_PROMPT_END_IGNORE; + i = 0; + if (n == CTLESC || n == CTLNUL) + temp[i++] = CTLESC; + temp[i++] = n; + temp[i] = '\0'; + goto add_string; +#endif /* READLINE */ + + case '\\': + case 'a': + case 'e': + case 'r': + temp = (char *)xmalloc (2); + if (c == 'a') + temp[0] = '\07'; + else if (c == 'e') + temp[0] = '\033'; + else if (c == 'r') + temp[0] = '\r'; + else /* (c == '\\') */ + temp[0] = c; + temp[1] = '\0'; + goto add_string; + + default: +not_escape: + temp = (char *)xmalloc (3); + temp[0] = '\\'; + temp[1] = c; + temp[2] = '\0'; + + add_string: + if (c) + string++; + result = + sub_append_string (temp, result, &result_index, &result_size); + temp = (char *)NULL; /* Freed in sub_append_string (). */ + result[result_index] = '\0'; + break; + } + } + else + { + RESIZE_MALLOCED_BUFFER (result, result_index, 3, result_size, PROMPT_GROWTH); + result[result_index++] = c; + result[result_index] = '\0'; + } + } +#else /* !PROMPT_STRING_DECODE */ + result = savestring (string); +#endif /* !PROMPT_STRING_DECODE */ + + /* Save the delimiter stack and point `dstack' to temp space so any + command substitutions in the prompt string won't result in screwing + up the parser's quoting state. */ + save_dstack = dstack; + dstack = temp_dstack; + dstack.delimiter_depth = 0; + + /* Perform variable and parameter expansion and command substitution on + the prompt string. */ + if (promptvars || posixly_correct) + { + last_exit_value = last_command_exit_value; + last_comsub_pid = last_command_subst_pid; + list = expand_prompt_string (result, Q_DOUBLE_QUOTES, 0); + free (result); + result = string_list (list); + dispose_words (list); + last_command_exit_value = last_exit_value; + last_command_subst_pid = last_comsub_pid; + } + else + { + t = dequote_string (result); + free (result); + result = t; + } + + dstack = save_dstack; + + return (result); +} + +/************************************************ + * * + * ERROR HANDLING * + * * + ************************************************/ + +/* Report a syntax error, and restart the parser. Call here for fatal + errors. */ +int +yyerror (msg) + const char *msg; +{ + report_syntax_error ((char *)NULL); + reset_parser (); + return (0); +} + +static char * +error_token_from_token (tok) + int tok; +{ + char *t; + + if (t = find_token_in_alist (tok, word_token_alist, 0)) + return t; + + if (t = find_token_in_alist (tok, other_token_alist, 0)) + return t; + + t = (char *)NULL; + /* This stuff is dicy and needs closer inspection */ + switch (current_token) + { + case WORD: + case ASSIGNMENT_WORD: + if (yylval.word) + t = savestring (yylval.word->word); + break; + case NUMBER: + t = itos (yylval.number); + break; + case ARITH_CMD: + if (yylval.word_list) + t = string_list (yylval.word_list); + break; + case ARITH_FOR_EXPRS: + if (yylval.word_list) + t = string_list_internal (yylval.word_list, " ; "); + break; + case COND_CMD: + t = (char *)NULL; /* punt */ + break; + } + + return t; +} + +static char * +error_token_from_text () +{ + char *msg, *t; + int token_end, i; + + t = shell_input_line; + i = shell_input_line_index; + token_end = 0; + msg = (char *)NULL; + + if (i && t[i] == '\0') + i--; + + while (i && (whitespace (t[i]) || t[i] == '\n')) + i--; + + if (i) + token_end = i + 1; + + while (i && (member (t[i], " \n\t;|&") == 0)) + i--; + + while (i != token_end && (whitespace (t[i]) || t[i] == '\n')) + i++; + + /* Return our idea of the offending token. */ + if (token_end || (i == 0 && token_end == 0)) + { + if (token_end) + msg = substring (t, i, token_end); + else /* one-character token */ + { + msg = (char *)xmalloc (2); + msg[0] = t[i]; + msg[1] = '\0'; + } + } + + return (msg); +} + +static void +print_offending_line () +{ + char *msg; + int token_end; + + msg = savestring (shell_input_line); + token_end = strlen (msg); + while (token_end && msg[token_end - 1] == '\n') + msg[--token_end] = '\0'; + + parser_error (line_number, "`%s'", msg); + free (msg); +} + +/* Report a syntax error with line numbers, etc. + Call here for recoverable errors. If you have a message to print, + then place it in MESSAGE, otherwise pass NULL and this will figure + out an appropriate message for you. */ +static void +report_syntax_error (message) + char *message; +{ + char *msg, *p; + + if (message) + { + parser_error (line_number, "%s", message); + if (interactive && EOF_Reached) + EOF_Reached = 0; + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; + return; + } + + /* If the line of input we're reading is not null, try to find the + objectionable token. First, try to figure out what token the + parser's complaining about by looking at current_token. */ + if (current_token != 0 && EOF_Reached == 0 && (msg = error_token_from_token (current_token))) + { + if (ansic_shouldquote (msg)) + { + p = ansic_quote (msg, 0, NULL); + free (msg); + msg = p; + } + parser_error (line_number, _("syntax error near unexpected token `%s'"), msg); + free (msg); + + if (interactive == 0) + print_offending_line (); + + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; + return; + } + + /* If looking at the current token doesn't prove fruitful, try to find the + offending token by analyzing the text of the input line near the current + input line index and report what we find. */ + if (shell_input_line && *shell_input_line) + { + msg = error_token_from_text (); + if (msg) + { + parser_error (line_number, _("syntax error near `%s'"), msg); + free (msg); + } + + /* If not interactive, print the line containing the error. */ + if (interactive == 0) + print_offending_line (); + } + else + { + msg = EOF_Reached ? _("syntax error: unexpected end of file") : _("syntax error"); + parser_error (line_number, "%s", msg); + /* When the shell is interactive, this file uses EOF_Reached + only for error reporting. Other mechanisms are used to + decide whether or not to exit. */ + if (interactive && EOF_Reached) + EOF_Reached = 0; + } + + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; +} + +/* ??? Needed function. ??? We have to be able to discard the constructs + created during parsing. In the case of error, we want to return + allocated objects to the memory pool. In the case of no error, we want + to throw away the information about where the allocated objects live. + (dispose_command () will actually free the command.) */ +static void +discard_parser_constructs (error_p) + int error_p; +{ +} + +/************************************************ + * * + * EOF HANDLING * + * * + ************************************************/ + +/* Do that silly `type "bye" to exit' stuff. You know, "ignoreeof". */ + +/* A flag denoting whether or not ignoreeof is set. */ +int ignoreeof = 0; + +/* The number of times that we have encountered an EOF character without + another character intervening. When this gets above the limit, the + shell terminates. */ +int eof_encountered = 0; + +/* The limit for eof_encountered. */ +int eof_encountered_limit = 10; + +/* If we have EOF as the only input unit, this user wants to leave + the shell. If the shell is not interactive, then just leave. + Otherwise, if ignoreeof is set, and we haven't done this the + required number of times in a row, print a message. */ +static void +handle_eof_input_unit () +{ + if (interactive) + { + /* shell.c may use this to decide whether or not to write out the + history, among other things. We use it only for error reporting + in this file. */ + if (EOF_Reached) + EOF_Reached = 0; + + /* If the user wants to "ignore" eof, then let her do so, kind of. */ + if (ignoreeof) + { + if (eof_encountered < eof_encountered_limit) + { + fprintf (stderr, _("Use \"%s\" to leave the shell.\n"), + login_shell ? "logout" : "exit"); + eof_encountered++; + /* Reset the parsing state. */ + last_read_token = current_token = '\n'; + /* Reset the prompt string to be $PS1. */ + prompt_string_pointer = (char **)NULL; + prompt_again (); + return; + } + } + + /* In this case EOF should exit the shell. Do it now. */ + reset_parser (); + exit_builtin ((WORD_LIST *)NULL); + } + else + { + /* We don't write history files, etc., for non-interactive shells. */ + EOF_Reached = 1; + } +} + +/************************************************ + * * + * STRING PARSING FUNCTIONS * + * * + ************************************************/ + +/* It's very important that these two functions treat the characters + between ( and ) identically. */ + +static WORD_LIST parse_string_error; + +/* Take a string and run it through the shell parser, returning the + resultant word list. Used by compound array assignment. */ +WORD_LIST * +parse_string_to_word_list (s, flags, whom) + char *s; + int flags; + const char *whom; +{ + WORD_LIST *wl; + int tok, orig_current_token, orig_line_number, orig_input_terminator; + int orig_line_count; + int old_echo_input, old_expand_aliases; +#if defined (HISTORY) + int old_remember_on_history, old_history_expansion_inhibited; +#endif + +#if defined (HISTORY) + old_remember_on_history = remember_on_history; +# if defined (BANG_HISTORY) + old_history_expansion_inhibited = history_expansion_inhibited; +# endif + bash_history_disable (); +#endif + + orig_line_number = line_number; + orig_line_count = current_command_line_count; + orig_input_terminator = shell_input_line_terminator; + old_echo_input = echo_input_at_read; + old_expand_aliases = expand_aliases; + + push_stream (1); + last_read_token = WORD; /* WORD to allow reserved words here */ + current_command_line_count = 0; + echo_input_at_read = expand_aliases = 0; + + with_input_from_string (s, whom); + wl = (WORD_LIST *)NULL; + + if (flags & 1) + parser_state |= PST_COMPASSIGN|PST_REPARSE; + + while ((tok = read_token (READ)) != yacc_EOF) + { + if (tok == '\n' && *bash_input.location.string == '\0') + break; + if (tok == '\n') /* Allow newlines in compound assignments */ + continue; + if (tok != WORD && tok != ASSIGNMENT_WORD) + { + line_number = orig_line_number + line_number - 1; + orig_current_token = current_token; + current_token = tok; + yyerror (NULL); /* does the right thing */ + current_token = orig_current_token; + if (wl) + dispose_words (wl); + wl = &parse_string_error; + break; + } + wl = make_word_list (yylval.word, wl); + } + + last_read_token = '\n'; + pop_stream (); + +#if defined (HISTORY) + remember_on_history = old_remember_on_history; +# if defined (BANG_HISTORY) + history_expansion_inhibited = old_history_expansion_inhibited; +# endif /* BANG_HISTORY */ +#endif /* HISTORY */ + + echo_input_at_read = old_echo_input; + expand_aliases = old_expand_aliases; + + current_command_line_count = orig_line_count; + shell_input_line_terminator = orig_input_terminator; + + if (flags & 1) + parser_state &= ~(PST_COMPASSIGN|PST_REPARSE); + + if (wl == &parse_string_error) + { + last_command_exit_value = EXECUTION_FAILURE; + if (interactive_shell == 0 && posixly_correct) + jump_to_top_level (FORCE_EOF); + else + jump_to_top_level (DISCARD); + } + + return (REVERSE_LIST (wl, WORD_LIST *)); +} + +static char * +parse_compound_assignment (retlenp) + int *retlenp; +{ + WORD_LIST *wl, *rl; + int tok, orig_line_number, orig_token_size, orig_last_token, assignok; + char *saved_token, *ret; + + saved_token = token; + orig_token_size = token_buffer_size; + orig_line_number = line_number; + orig_last_token = last_read_token; + + last_read_token = WORD; /* WORD to allow reserved words here */ + + token = (char *)NULL; + token_buffer_size = 0; + + assignok = parser_state&PST_ASSIGNOK; /* XXX */ + + wl = (WORD_LIST *)NULL; /* ( */ + parser_state |= PST_COMPASSIGN; + + while ((tok = read_token (READ)) != ')') + { + if (tok == '\n') /* Allow newlines in compound assignments */ + { + if (SHOULD_PROMPT ()) + prompt_again (); + continue; + } + if (tok != WORD && tok != ASSIGNMENT_WORD) + { + current_token = tok; /* for error reporting */ + if (tok == yacc_EOF) /* ( */ + parser_error (orig_line_number, _("unexpected EOF while looking for matching `)'")); + else + yyerror(NULL); /* does the right thing */ + if (wl) + dispose_words (wl); + wl = &parse_string_error; + break; + } + wl = make_word_list (yylval.word, wl); + } + + FREE (token); + token = saved_token; + token_buffer_size = orig_token_size; + + parser_state &= ~PST_COMPASSIGN; + + if (wl == &parse_string_error) + { + last_command_exit_value = EXECUTION_FAILURE; + last_read_token = '\n'; /* XXX */ + if (interactive_shell == 0 && posixly_correct) + jump_to_top_level (FORCE_EOF); + else + jump_to_top_level (DISCARD); + } + + last_read_token = orig_last_token; /* XXX - was WORD? */ + + if (wl) + { + rl = REVERSE_LIST (wl, WORD_LIST *); + ret = string_list (rl); + dispose_words (rl); + } + else + ret = (char *)NULL; + + if (retlenp) + *retlenp = (ret && *ret) ? strlen (ret) : 0; + + if (assignok) + parser_state |= PST_ASSIGNOK; + + return ret; +} + +/************************************************ + * * + * SAVING AND RESTORING PARTIAL PARSE STATE * + * * + ************************************************/ + +sh_parser_state_t * +save_parser_state (ps) + sh_parser_state_t *ps; +{ + if (ps == 0) + ps = (sh_parser_state_t *)xmalloc (sizeof (sh_parser_state_t)); + if (ps == 0) + return ((sh_parser_state_t *)NULL); + + ps->parser_state = parser_state; + ps->token_state = save_token_state (); + + ps->input_line_terminator = shell_input_line_terminator; + ps->eof_encountered = eof_encountered; + + ps->prompt_string_pointer = prompt_string_pointer; + + ps->current_command_line_count = current_command_line_count; + +#if defined (HISTORY) + ps->remember_on_history = remember_on_history; +# if defined (BANG_HISTORY) + ps->history_expansion_inhibited = history_expansion_inhibited; +# endif +#endif + + ps->last_command_exit_value = last_command_exit_value; +#if defined (ARRAY_VARS) + ps->pipestatus = save_pipestatus_array (); +#endif + + ps->last_shell_builtin = last_shell_builtin; + ps->this_shell_builtin = this_shell_builtin; + + ps->expand_aliases = expand_aliases; + ps->echo_input_at_read = echo_input_at_read; + + ps->token = token; + ps->token_buffer_size = token_buffer_size; + /* Force reallocation on next call to read_token_word */ + token = 0; + token_buffer_size = 0; + + return (ps); +} + +void +restore_parser_state (ps) + sh_parser_state_t *ps; +{ + if (ps == 0) + return; + + parser_state = ps->parser_state; + if (ps->token_state) + { + restore_token_state (ps->token_state); + free (ps->token_state); + } + + shell_input_line_terminator = ps->input_line_terminator; + eof_encountered = ps->eof_encountered; + + prompt_string_pointer = ps->prompt_string_pointer; + + current_command_line_count = ps->current_command_line_count; + +#if defined (HISTORY) + remember_on_history = ps->remember_on_history; +# if defined (BANG_HISTORY) + history_expansion_inhibited = ps->history_expansion_inhibited; +# endif +#endif + + last_command_exit_value = ps->last_command_exit_value; +#if defined (ARRAY_VARS) + restore_pipestatus_array (ps->pipestatus); +#endif + + last_shell_builtin = ps->last_shell_builtin; + this_shell_builtin = ps->this_shell_builtin; + + expand_aliases = ps->expand_aliases; + echo_input_at_read = ps->echo_input_at_read; + + FREE (token); + token = ps->token; + token_buffer_size = ps->token_buffer_size; +} + +sh_input_line_state_t * +save_input_line_state (ls) + sh_input_line_state_t *ls; +{ + if (ls == 0) + ls = (sh_input_line_state_t *)xmalloc (sizeof (sh_input_line_state_t)); + if (ls == 0) + return ((sh_input_line_state_t *)NULL); + + ls->input_line = shell_input_line; + ls->input_line_size = shell_input_line_size; + ls->input_line_len = shell_input_line_len; + ls->input_line_index = shell_input_line_index; + + /* force reallocation */ + shell_input_line = 0; + shell_input_line_size = shell_input_line_len = shell_input_line_index = 0; + + return ls; +} + +void +restore_input_line_state (ls) + sh_input_line_state_t *ls; +{ + FREE (shell_input_line); + shell_input_line = ls->input_line; + shell_input_line_size = ls->input_line_size; + shell_input_line_len = ls->input_line_len; + shell_input_line_index = ls->input_line_index; + + set_line_mbstate (); +} + +/************************************************ + * * + * MULTIBYTE CHARACTER HANDLING * + * * + ************************************************/ + +#if defined (HANDLE_MULTIBYTE) +static void +set_line_mbstate () +{ + int c; + size_t i, previ, len; + mbstate_t mbs, prevs; + size_t mbclen; + + if (shell_input_line == NULL) + return; + len = strlen (shell_input_line); /* XXX - shell_input_line_len ? */ + FREE (shell_input_line_property); + shell_input_line_property = (char *)xmalloc (len + 1); + + memset (&prevs, '\0', sizeof (mbstate_t)); + for (i = previ = 0; i < len; i++) + { + mbs = prevs; + + c = shell_input_line[i]; + if (c == EOF) + { + size_t j; + for (j = i; j < len; j++) + shell_input_line_property[j] = 1; + break; + } + + mbclen = mbrlen (shell_input_line + previ, i - previ + 1, &mbs); + if (mbclen == 1 || mbclen == (size_t)-1) + { + mbclen = 1; + previ = i + 1; + } + else if (mbclen == (size_t)-2) + mbclen = 0; + else if (mbclen > 1) + { + mbclen = 0; + previ = i + 1; + prevs = mbs; + } + else + { + /* XXX - what to do if mbrlen returns 0? (null wide character) */ + size_t j; + for (j = i; j < len; j++) + shell_input_line_property[j] = 1; + break; + } + + shell_input_line_property[i] = mbclen; + } +} +#endif /* HANDLE_MULTIBYTE */ + diff --git a/.pc/bash43-021.diff/lib/readline/misc.c b/.pc/bash43-021.diff/lib/readline/misc.c new file mode 100644 index 0000000..da5c696 --- /dev/null +++ b/.pc/bash43-021.diff/lib/readline/misc.c @@ -0,0 +1,692 @@ +/* misc.c -- miscellaneous bindable readline functions. */ + +/* Copyright (C) 1987-2012 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# include +#endif /* HAVE_UNISTD_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#if defined (HAVE_LOCALE_H) +# include +#endif + +#include + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" +#include "rlmbutil.h" + +/* Some standard library routines. */ +#include "readline.h" +#include "history.h" + +#include "rlprivate.h" +#include "rlshell.h" +#include "xmalloc.h" + +static int rl_digit_loop PARAMS((void)); +static void _rl_history_set_point PARAMS((void)); + +extern int history_offset; + +/* Forward declarations used in this file */ +void _rl_free_history_entry PARAMS((HIST_ENTRY *)); + +/* If non-zero, rl_get_previous_history and rl_get_next_history attempt + to preserve the value of rl_point from line to line. */ +int _rl_history_preserve_point = 0; + +_rl_arg_cxt _rl_argcxt; + +/* Saved target point for when _rl_history_preserve_point is set. Special + value of -1 means that point is at the end of the line. */ +int _rl_history_saved_point = -1; + +/* **************************************************************** */ +/* */ +/* Numeric Arguments */ +/* */ +/* **************************************************************** */ + +int +_rl_arg_overflow () +{ + if (rl_numeric_arg > 1000000) + { + _rl_argcxt = 0; + rl_explicit_arg = rl_numeric_arg = 0; + rl_ding (); + rl_restore_prompt (); + rl_clear_message (); + RL_UNSETSTATE(RL_STATE_NUMERICARG); + return 1; + } + return 0; +} + +void +_rl_arg_init () +{ + rl_save_prompt (); + _rl_argcxt = 0; + RL_SETSTATE(RL_STATE_NUMERICARG); +} + +int +_rl_arg_getchar () +{ + int c; + + rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg); + RL_SETSTATE(RL_STATE_MOREINPUT); + c = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + + return c; +} + +/* Process C as part of the current numeric argument. Return -1 if the + argument should be aborted, 0 if we should not read any more chars, and + 1 if we should continue to read chars. */ +int +_rl_arg_dispatch (cxt, c) + _rl_arg_cxt cxt; + int c; +{ + int key, r; + + key = c; + + /* If we see a key bound to `universal-argument' after seeing digits, + it ends the argument but is otherwise ignored. */ + if (_rl_keymap[c].type == ISFUNC && _rl_keymap[c].function == rl_universal_argument) + { + if ((cxt & NUM_SAWDIGITS) == 0) + { + rl_numeric_arg *= 4; + return 1; + } + else if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + _rl_argcxt |= NUM_READONE; + return 0; /* XXX */ + } + else + { + RL_SETSTATE(RL_STATE_MOREINPUT); + key = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + rl_restore_prompt (); + rl_clear_message (); + RL_UNSETSTATE(RL_STATE_NUMERICARG); + if (key < 0) + return -1; + return (_rl_dispatch (key, _rl_keymap)); + } + } + + c = UNMETA (c); + + if (_rl_digit_p (c)) + { + r = _rl_digit_value (c); + rl_numeric_arg = rl_explicit_arg ? (rl_numeric_arg * 10) + r : r; + rl_explicit_arg = 1; + _rl_argcxt |= NUM_SAWDIGITS; + } + else if (c == '-' && rl_explicit_arg == 0) + { + rl_numeric_arg = 1; + _rl_argcxt |= NUM_SAWMINUS; + rl_arg_sign = -1; + } + else + { + /* Make M-- command equivalent to M--1 command. */ + if ((_rl_argcxt & NUM_SAWMINUS) && rl_numeric_arg == 1 && rl_explicit_arg == 0) + rl_explicit_arg = 1; + rl_restore_prompt (); + rl_clear_message (); + RL_UNSETSTATE(RL_STATE_NUMERICARG); + + r = _rl_dispatch (key, _rl_keymap); + if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + /* At worst, this will cause an extra redisplay. Otherwise, + we have to wait until the next character comes in. */ + if (rl_done == 0) + (*rl_redisplay_function) (); + r = 0; + } + return r; + } + + return 1; +} + +/* Handle C-u style numeric args, as well as M--, and M-digits. */ +static int +rl_digit_loop () +{ + int c, r; + + while (1) + { + if (_rl_arg_overflow ()) + return 1; + + c = _rl_arg_getchar (); + + if (c < 0) + { + _rl_abort_internal (); + return -1; + } + + r = _rl_arg_dispatch (_rl_argcxt, c); + if (r <= 0 || (RL_ISSTATE (RL_STATE_NUMERICARG) == 0)) + break; + } + + return r; +} + +/* Create a default argument. */ +void +_rl_reset_argument () +{ + rl_numeric_arg = rl_arg_sign = 1; + rl_explicit_arg = 0; + _rl_argcxt = 0; +} + +/* Start a numeric argument with initial value KEY */ +int +rl_digit_argument (ignore, key) + int ignore, key; +{ + _rl_arg_init (); + if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + _rl_arg_dispatch (_rl_argcxt, key); + rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg); + return 0; + } + else + { + rl_execute_next (key); + return (rl_digit_loop ()); + } +} + +/* C-u, universal argument. Multiply the current argument by 4. + Read a key. If the key has nothing to do with arguments, then + dispatch on it. If the key is the abort character then abort. */ +int +rl_universal_argument (count, key) + int count, key; +{ + _rl_arg_init (); + rl_numeric_arg *= 4; + + return (RL_ISSTATE (RL_STATE_CALLBACK) ? 0 : rl_digit_loop ()); +} + +int +_rl_arg_callback (cxt) + _rl_arg_cxt cxt; +{ + int c, r; + + c = _rl_arg_getchar (); + + if (_rl_argcxt & NUM_READONE) + { + _rl_argcxt &= ~NUM_READONE; + rl_restore_prompt (); + rl_clear_message (); + RL_UNSETSTATE(RL_STATE_NUMERICARG); + rl_execute_next (c); + return 0; + } + + r = _rl_arg_dispatch (cxt, c); + return (r != 1); +} + +/* What to do when you abort reading an argument. */ +int +rl_discard_argument () +{ + rl_ding (); + rl_clear_message (); + _rl_reset_argument (); + + return 0; +} + +/* **************************************************************** */ +/* */ +/* History Utilities */ +/* */ +/* **************************************************************** */ + +/* We already have a history library, and that is what we use to control + the history features of readline. This is our local interface to + the history mechanism. */ + +/* While we are editing the history, this is the saved + version of the original line. */ +HIST_ENTRY *_rl_saved_line_for_history = (HIST_ENTRY *)NULL; + +/* Set the history pointer back to the last entry in the history. */ +void +_rl_start_using_history () +{ + using_history (); + if (_rl_saved_line_for_history) + _rl_free_history_entry (_rl_saved_line_for_history); + + _rl_saved_line_for_history = (HIST_ENTRY *)NULL; +} + +/* Free the contents (and containing structure) of a HIST_ENTRY. */ +void +_rl_free_history_entry (entry) + HIST_ENTRY *entry; +{ + if (entry == 0) + return; + + FREE (entry->line); + FREE (entry->timestamp); + + xfree (entry); +} + +/* Perhaps put back the current line if it has changed. */ +int +rl_maybe_replace_line () +{ + HIST_ENTRY *temp; + + temp = current_history (); + /* If the current line has changed, save the changes. */ + if (temp && ((UNDO_LIST *)(temp->data) != rl_undo_list)) + { + temp = replace_history_entry (where_history (), rl_line_buffer, (histdata_t)rl_undo_list); + xfree (temp->line); + FREE (temp->timestamp); + xfree (temp); + } + return 0; +} + +/* Restore the _rl_saved_line_for_history if there is one. */ +int +rl_maybe_unsave_line () +{ + if (_rl_saved_line_for_history) + { + /* Can't call with `1' because rl_undo_list might point to an undo + list from a history entry, as in rl_replace_from_history() below. */ + rl_replace_line (_rl_saved_line_for_history->line, 0); + rl_undo_list = (UNDO_LIST *)_rl_saved_line_for_history->data; + _rl_free_history_entry (_rl_saved_line_for_history); + _rl_saved_line_for_history = (HIST_ENTRY *)NULL; + rl_point = rl_end; /* rl_replace_line sets rl_end */ + } + else + rl_ding (); + return 0; +} + +/* Save the current line in _rl_saved_line_for_history. */ +int +rl_maybe_save_line () +{ + if (_rl_saved_line_for_history == 0) + { + _rl_saved_line_for_history = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY)); + _rl_saved_line_for_history->line = savestring (rl_line_buffer); + _rl_saved_line_for_history->timestamp = (char *)NULL; + _rl_saved_line_for_history->data = (char *)rl_undo_list; + } + + return 0; +} + +int +_rl_free_saved_history_line () +{ + if (_rl_saved_line_for_history) + { + _rl_free_history_entry (_rl_saved_line_for_history); + _rl_saved_line_for_history = (HIST_ENTRY *)NULL; + } + return 0; +} + +static void +_rl_history_set_point () +{ + rl_point = (_rl_history_preserve_point && _rl_history_saved_point != -1) + ? _rl_history_saved_point + : rl_end; + if (rl_point > rl_end) + rl_point = rl_end; + +#if defined (VI_MODE) + if (rl_editing_mode == vi_mode && _rl_keymap != vi_insertion_keymap) + rl_point = 0; +#endif /* VI_MODE */ + + if (rl_editing_mode == emacs_mode) + rl_mark = (rl_point == rl_end ? 0 : rl_end); +} + +void +rl_replace_from_history (entry, flags) + HIST_ENTRY *entry; + int flags; /* currently unused */ +{ + /* Can't call with `1' because rl_undo_list might point to an undo list + from a history entry, just like we're setting up here. */ + rl_replace_line (entry->line, 0); + rl_undo_list = (UNDO_LIST *)entry->data; + rl_point = rl_end; + rl_mark = 0; + +#if defined (VI_MODE) + if (rl_editing_mode == vi_mode) + { + rl_point = 0; + rl_mark = rl_end; + } +#endif +} + +/* Process and free undo lists attached to each history entry prior to the + current entry, inclusive, reverting each line to its saved state. This + is destructive, and state about the current line is lost. This is not + intended to be called while actively editing, and the current line is + not assumed to have been added to the history list. */ +void +_rl_revert_all_lines () +{ + int hpos; + HIST_ENTRY *entry; + UNDO_LIST *ul, *saved_undo_list; + char *lbuf; + + lbuf = savestring (rl_line_buffer); + saved_undo_list = rl_undo_list; + hpos = where_history (); + + entry = (hpos == history_length) ? previous_history () : current_history (); + while (entry) + { + if (ul = (UNDO_LIST *)entry->data) + { + if (ul == saved_undo_list) + saved_undo_list = 0; + /* Set up rl_line_buffer and other variables from history entry */ + rl_replace_from_history (entry, 0); /* entry->line is now current */ + /* Undo all changes to this history entry */ + while (rl_undo_list) + rl_do_undo (); + /* And copy the reverted line back to the history entry, preserving + the timestamp. */ + FREE (entry->line); + entry->line = savestring (rl_line_buffer); + entry->data = 0; + } + entry = previous_history (); + } + + /* Restore history state */ + rl_undo_list = saved_undo_list; /* may have been set to null */ + history_set_pos (hpos); + + /* reset the line buffer */ + rl_replace_line (lbuf, 0); + _rl_set_the_line (); + + /* and clean up */ + xfree (lbuf); +} + +/* Free the history list, including private readline data and take care + of pointer aliases to history data. Resets rl_undo_list if it points + to an UNDO_LIST * saved as some history entry's data member. This + should not be called while editing is active. */ +void +rl_clear_history () +{ + HIST_ENTRY **hlist, *hent; + register int i; + UNDO_LIST *ul, *saved_undo_list; + + saved_undo_list = rl_undo_list; + hlist = history_list (); /* direct pointer, not copy */ + + for (i = 0; i < history_length; i++) + { + hent = hlist[i]; + if (ul = (UNDO_LIST *)hent->data) + { + if (ul == saved_undo_list) + saved_undo_list = 0; + _rl_free_undo_list (ul); + hent->data = 0; + } + _rl_free_history_entry (hent); + } + + history_offset = history_length = 0; + rl_undo_list = saved_undo_list; /* should be NULL */ +} + +/* **************************************************************** */ +/* */ +/* History Commands */ +/* */ +/* **************************************************************** */ + +/* Meta-< goes to the start of the history. */ +int +rl_beginning_of_history (count, key) + int count, key; +{ + return (rl_get_previous_history (1 + where_history (), key)); +} + +/* Meta-> goes to the end of the history. (The current line). */ +int +rl_end_of_history (count, key) + int count, key; +{ + rl_maybe_replace_line (); + using_history (); + rl_maybe_unsave_line (); + return 0; +} + +/* Move down to the next history line. */ +int +rl_get_next_history (count, key) + int count, key; +{ + HIST_ENTRY *temp; + + if (count < 0) + return (rl_get_previous_history (-count, key)); + + if (count == 0) + return 0; + + rl_maybe_replace_line (); + + /* either not saved by rl_newline or at end of line, so set appropriately. */ + if (_rl_history_saved_point == -1 && (rl_point || rl_end)) + _rl_history_saved_point = (rl_point == rl_end) ? -1 : rl_point; + + temp = (HIST_ENTRY *)NULL; + while (count) + { + temp = next_history (); + if (!temp) + break; + --count; + } + + if (temp == 0) + rl_maybe_unsave_line (); + else + { + rl_replace_from_history (temp, 0); + _rl_history_set_point (); + } + return 0; +} + +/* Get the previous item out of our interactive history, making it the current + line. If there is no previous history, just ding. */ +int +rl_get_previous_history (count, key) + int count, key; +{ + HIST_ENTRY *old_temp, *temp; + + if (count < 0) + return (rl_get_next_history (-count, key)); + + if (count == 0) + return 0; + + /* either not saved by rl_newline or at end of line, so set appropriately. */ + if (_rl_history_saved_point == -1 && (rl_point || rl_end)) + _rl_history_saved_point = (rl_point == rl_end) ? -1 : rl_point; + + /* If we don't have a line saved, then save this one. */ + rl_maybe_save_line (); + + /* If the current line has changed, save the changes. */ + rl_maybe_replace_line (); + + temp = old_temp = (HIST_ENTRY *)NULL; + while (count) + { + temp = previous_history (); + if (temp == 0) + break; + + old_temp = temp; + --count; + } + + /* If there was a large argument, and we moved back to the start of the + history, that is not an error. So use the last value found. */ + if (!temp && old_temp) + temp = old_temp; + + if (temp == 0) + rl_ding (); + else + { + rl_replace_from_history (temp, 0); + _rl_history_set_point (); + } + + return 0; +} + +/* **************************************************************** */ +/* */ +/* Editing Modes */ +/* */ +/* **************************************************************** */ +/* How to toggle back and forth between editing modes. */ +int +rl_vi_editing_mode (count, key) + int count, key; +{ +#if defined (VI_MODE) + _rl_set_insert_mode (RL_IM_INSERT, 1); /* vi mode ignores insert mode */ + rl_editing_mode = vi_mode; + rl_vi_insert_mode (1, key); +#endif /* VI_MODE */ + + return 0; +} + +int +rl_emacs_editing_mode (count, key) + int count, key; +{ + rl_editing_mode = emacs_mode; + _rl_set_insert_mode (RL_IM_INSERT, 1); /* emacs mode default is insert mode */ + _rl_keymap = emacs_standard_keymap; + + if (_rl_show_mode_in_prompt) + _rl_reset_prompt (); + + return 0; +} + +/* Function for the rest of the library to use to set insert/overwrite mode. */ +void +_rl_set_insert_mode (im, force) + int im, force; +{ +#ifdef CURSOR_MODE + _rl_set_cursor (im, force); +#endif + + rl_insert_mode = im; +} + +/* Toggle overwrite mode. A positive explicit argument selects overwrite + mode. A negative or zero explicit argument selects insert mode. */ +int +rl_overwrite_mode (count, key) + int count, key; +{ + if (rl_explicit_arg == 0) + _rl_set_insert_mode (rl_insert_mode ^ 1, 0); + else if (count > 0) + _rl_set_insert_mode (RL_IM_OVERWRITE, 0); + else + _rl_set_insert_mode (RL_IM_INSERT, 0); + + return 0; +} diff --git a/.pc/bash43-021.diff/patchlevel.h b/.pc/bash43-021.diff/patchlevel.h new file mode 100644 index 0000000..6b5f365 --- /dev/null +++ b/.pc/bash43-021.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 20 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-022.diff/execute_cmd.c b/.pc/bash43-022.diff/execute_cmd.c new file mode 100644 index 0000000..f9a755d --- /dev/null +++ b/.pc/bash43-022.diff/execute_cmd.c @@ -0,0 +1,5445 @@ +/* execute_cmd.c -- Execute a COMMAND structure. */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#if !defined (__GNUC__) && !defined (HAVE_ALLOCA_H) && defined (_AIX) + #pragma alloca +#endif /* _AIX && RISC6000 && !__GNUC__ */ + +#include +#include "chartypes.h" +#include "bashtypes.h" +#if !defined (_MINIX) && defined (HAVE_SYS_FILE_H) +# include +#endif +#include "filecntl.h" +#include "posixstat.h" +#include +#if defined (HAVE_SYS_PARAM_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "posixtime.h" + +#if defined (HAVE_SYS_RESOURCE_H) && !defined (RLIMTYPE) +# include +#endif + +#if defined (HAVE_SYS_TIMES_H) && defined (HAVE_TIMES) +# include +#endif + +#include + +#if !defined (errno) +extern int errno; +#endif + +#define NEED_FPURGE_DECL + +#include "bashansi.h" +#include "bashintl.h" + +#include "memalloc.h" +#include "shell.h" +#include /* use <...> so we pick it up from the build directory */ +#include "flags.h" +#include "builtins.h" +#include "hashlib.h" +#include "jobs.h" +#include "execute_cmd.h" +#include "findcmd.h" +#include "redir.h" +#include "trap.h" +#include "pathexp.h" +#include "hashcmd.h" + +#if defined (COND_COMMAND) +# include "test.h" +#endif + +#include "builtins/common.h" +#include "builtins/builtext.h" /* list of builtins */ + +#include +#include + +#if defined (BUFFERED_INPUT) +# include "input.h" +#endif + +#if defined (ALIAS) +# include "alias.h" +#endif + +#if defined (HISTORY) +# include "bashhist.h" +#endif + +extern int dollar_dollar_pid; +extern int posixly_correct; +extern int expand_aliases; +extern int autocd; +extern int breaking, continuing, loop_level; +extern int parse_and_execute_level, running_trap, sourcelevel; +extern int command_string_index, line_number; +extern int dot_found_in_search; +extern int already_making_children; +extern int tempenv_assign_error; +extern char *the_printed_command, *shell_name; +extern pid_t last_command_subst_pid; +extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin; +extern char **subshell_argv, **subshell_envp; +extern int subshell_argc; +extern time_t shell_start_time; +#if 0 +extern char *glob_argv_flags; +#endif + +extern int job_control; /* XXX */ + +extern int close __P((int)); + +/* Static functions defined and used in this file. */ +static void close_pipes __P((int, int)); +static void do_piping __P((int, int)); +static void bind_lastarg __P((char *)); +static int shell_control_structure __P((enum command_type)); +static void cleanup_redirects __P((REDIRECT *)); + +#if defined (JOB_CONTROL) +static int restore_signal_mask __P((sigset_t *)); +#endif + +static void async_redirect_stdin __P((void)); + +static int builtin_status __P((int)); + +static int execute_for_command __P((FOR_COM *)); +#if defined (SELECT_COMMAND) +static int displen __P((const char *)); +static int print_index_and_element __P((int, int, WORD_LIST *)); +static void indent __P((int, int)); +static void print_select_list __P((WORD_LIST *, int, int, int)); +static char *select_query __P((WORD_LIST *, int, char *, int)); +static int execute_select_command __P((SELECT_COM *)); +#endif +#if defined (DPAREN_ARITHMETIC) +static int execute_arith_command __P((ARITH_COM *)); +#endif +#if defined (COND_COMMAND) +static int execute_cond_node __P((COND_COM *)); +static int execute_cond_command __P((COND_COM *)); +#endif +#if defined (COMMAND_TIMING) +static int mkfmt __P((char *, int, int, time_t, int)); +static void print_formatted_time __P((FILE *, char *, + time_t, int, time_t, int, + time_t, int, int)); +static int time_command __P((COMMAND *, int, int, int, struct fd_bitmap *)); +#endif +#if defined (ARITH_FOR_COMMAND) +static intmax_t eval_arith_for_expr __P((WORD_LIST *, int *)); +static int execute_arith_for_command __P((ARITH_FOR_COM *)); +#endif +static int execute_case_command __P((CASE_COM *)); +static int execute_while_command __P((WHILE_COM *)); +static int execute_until_command __P((WHILE_COM *)); +static int execute_while_or_until __P((WHILE_COM *, int)); +static int execute_if_command __P((IF_COM *)); +static int execute_null_command __P((REDIRECT *, int, int, int)); +static void fix_assignment_words __P((WORD_LIST *)); +static int execute_simple_command __P((SIMPLE_COM *, int, int, int, struct fd_bitmap *)); +static int execute_builtin __P((sh_builtin_func_t *, WORD_LIST *, int, int)); +static int execute_function __P((SHELL_VAR *, WORD_LIST *, int, struct fd_bitmap *, int, int)); +static int execute_builtin_or_function __P((WORD_LIST *, sh_builtin_func_t *, + SHELL_VAR *, + REDIRECT *, struct fd_bitmap *, int)); +static void execute_subshell_builtin_or_function __P((WORD_LIST *, REDIRECT *, + sh_builtin_func_t *, + SHELL_VAR *, + int, int, int, + struct fd_bitmap *, + int)); +static int execute_disk_command __P((WORD_LIST *, REDIRECT *, char *, + int, int, int, struct fd_bitmap *, int)); + +static char *getinterp __P((char *, int, int *)); +static void initialize_subshell __P((void)); +static int execute_in_subshell __P((COMMAND *, int, int, int, struct fd_bitmap *)); +#if defined (COPROCESS_SUPPORT) +static int execute_coproc __P((COMMAND *, int, int, struct fd_bitmap *)); +#endif + +static int execute_pipeline __P((COMMAND *, int, int, int, struct fd_bitmap *)); + +static int execute_connection __P((COMMAND *, int, int, int, struct fd_bitmap *)); + +static int execute_intern_function __P((WORD_DESC *, FUNCTION_DEF *)); + +/* Set to 1 if fd 0 was the subject of redirection to a subshell. Global + so that reader_loop can set it to zero before executing a command. */ +int stdin_redir; + +/* The name of the command that is currently being executed. + `test' needs this, for example. */ +char *this_command_name; + +/* The printed representation of the currently-executing command (same as + the_printed_command), except when a trap is being executed. Useful for + a debugger to know where exactly the program is currently executing. */ +char *the_printed_command_except_trap; + +/* For catching RETURN in a function. */ +int return_catch_flag; +int return_catch_value; +procenv_t return_catch; + +/* The value returned by the last synchronous command. */ +int last_command_exit_value; + +/* Whether or not the last command (corresponding to last_command_exit_value) + was terminated by a signal, and, if so, which one. */ +int last_command_exit_signal; + +/* Are we currently ignoring the -e option for the duration of a builtin's + execution? */ +int builtin_ignoring_errexit = 0; + +/* The list of redirections to perform which will undo the redirections + that I made in the shell. */ +REDIRECT *redirection_undo_list = (REDIRECT *)NULL; + +/* The list of redirections to perform which will undo the internal + redirections performed by the `exec' builtin. These are redirections + that must be undone even when exec discards redirection_undo_list. */ +REDIRECT *exec_redirection_undo_list = (REDIRECT *)NULL; + +/* When greater than zero, value is the `level' of builtins we are + currently executing (e.g. `eval echo a' would have it set to 2). */ +int executing_builtin = 0; + +/* Non-zero if we are executing a command list (a;b;c, etc.) */ +int executing_list = 0; + +/* Non-zero if failing commands in a command substitution should not exit the + shell even if -e is set. Used to pass the CMD_IGNORE_RETURN flag down to + commands run in command substitutions by parse_and_execute. */ +int comsub_ignore_return = 0; + +/* Non-zero if we have just forked and are currently running in a subshell + environment. */ +int subshell_environment; + +/* Count of nested subshells, like SHLVL. Available via $BASH_SUBSHELL */ +int subshell_level = 0; + +/* Currently-executing shell function. */ +SHELL_VAR *this_shell_function; + +/* If non-zero, matches in case and [[ ... ]] are case-insensitive */ +int match_ignore_case = 0; + +int executing_command_builtin = 0; + +struct stat SB; /* used for debugging */ + +static int special_builtin_failed; + +static COMMAND *currently_executing_command; + +/* The line number that the currently executing function starts on. */ +static int function_line_number; + +/* XXX - set to 1 if we're running the DEBUG trap and we want to show the line + number containing the function name. Used by executing_line_number to + report the correct line number. Kind of a hack. */ +static int showing_function_line; + +/* $LINENO ($BASH_LINENO) for use by an ERR trap. Global so parse_and_execute + can save and restore it. */ +int line_number_for_err_trap; + +/* A sort of function nesting level counter */ +int funcnest = 0; +int funcnest_max = 0; /* bash-4.2 */ + +int lastpipe_opt = 0; + +struct fd_bitmap *current_fds_to_close = (struct fd_bitmap *)NULL; + +#define FD_BITMAP_DEFAULT_SIZE 32 + +/* Functions to allocate and deallocate the structures used to pass + information from the shell to its children about file descriptors + to close. */ +struct fd_bitmap * +new_fd_bitmap (size) + int size; +{ + struct fd_bitmap *ret; + + ret = (struct fd_bitmap *)xmalloc (sizeof (struct fd_bitmap)); + + ret->size = size; + + if (size) + { + ret->bitmap = (char *)xmalloc (size); + memset (ret->bitmap, '\0', size); + } + else + ret->bitmap = (char *)NULL; + return (ret); +} + +void +dispose_fd_bitmap (fdbp) + struct fd_bitmap *fdbp; +{ + FREE (fdbp->bitmap); + free (fdbp); +} + +void +close_fd_bitmap (fdbp) + struct fd_bitmap *fdbp; +{ + register int i; + + if (fdbp) + { + for (i = 0; i < fdbp->size; i++) + if (fdbp->bitmap[i]) + { + close (i); + fdbp->bitmap[i] = 0; + } + } +} + +/* Return the line number of the currently executing command. */ +int +executing_line_number () +{ + if (executing && showing_function_line == 0 && + (variable_context == 0 || interactive_shell == 0) && + currently_executing_command) + { +#if defined (COND_COMMAND) + if (currently_executing_command->type == cm_cond) + return currently_executing_command->value.Cond->line; +#endif +#if defined (DPAREN_ARITHMETIC) + if (currently_executing_command->type == cm_arith) + return currently_executing_command->value.Arith->line; +#endif +#if defined (ARITH_FOR_COMMAND) + if (currently_executing_command->type == cm_arith_for) + return currently_executing_command->value.ArithFor->line; +#endif + + return line_number; + } + else + return line_number; +} + +/* Execute the command passed in COMMAND. COMMAND is exactly what + read_command () places into GLOBAL_COMMAND. See "command.h" for the + details of the command structure. + + EXECUTION_SUCCESS or EXECUTION_FAILURE are the only possible + return values. Executing a command with nothing in it returns + EXECUTION_SUCCESS. */ +int +execute_command (command) + COMMAND *command; +{ + struct fd_bitmap *bitmap; + int result; + + current_fds_to_close = (struct fd_bitmap *)NULL; + bitmap = new_fd_bitmap (FD_BITMAP_DEFAULT_SIZE); + begin_unwind_frame ("execute-command"); + add_unwind_protect (dispose_fd_bitmap, (char *)bitmap); + + /* Just do the command, but not asynchronously. */ + result = execute_command_internal (command, 0, NO_PIPE, NO_PIPE, bitmap); + + dispose_fd_bitmap (bitmap); + discard_unwind_frame ("execute-command"); + +#if defined (PROCESS_SUBSTITUTION) + /* don't unlink fifos if we're in a shell function; wait until the function + returns. */ + if (variable_context == 0) + unlink_fifo_list (); +#endif /* PROCESS_SUBSTITUTION */ + + QUIT; + return (result); +} + +/* Return 1 if TYPE is a shell control structure type. */ +static int +shell_control_structure (type) + enum command_type type; +{ + switch (type) + { +#if defined (ARITH_FOR_COMMAND) + case cm_arith_for: +#endif +#if defined (SELECT_COMMAND) + case cm_select: +#endif +#if defined (DPAREN_ARITHMETIC) + case cm_arith: +#endif +#if defined (COND_COMMAND) + case cm_cond: +#endif + case cm_case: + case cm_while: + case cm_until: + case cm_if: + case cm_for: + case cm_group: + case cm_function_def: + return (1); + + default: + return (0); + } +} + +/* A function to use to unwind_protect the redirection undo list + for loops. */ +static void +cleanup_redirects (list) + REDIRECT *list; +{ + do_redirections (list, RX_ACTIVE); + dispose_redirects (list); +} + +#if 0 +/* Function to unwind_protect the redirections for functions and builtins. */ +static void +cleanup_func_redirects (list) + REDIRECT *list; +{ + do_redirections (list, RX_ACTIVE); +} +#endif + +void +dispose_exec_redirects () +{ + if (exec_redirection_undo_list) + { + dispose_redirects (exec_redirection_undo_list); + exec_redirection_undo_list = (REDIRECT *)NULL; + } +} + +#if defined (JOB_CONTROL) +/* A function to restore the signal mask to its proper value when the shell + is interrupted or errors occur while creating a pipeline. */ +static int +restore_signal_mask (set) + sigset_t *set; +{ + return (sigprocmask (SIG_SETMASK, set, (sigset_t *)NULL)); +} +#endif /* JOB_CONTROL */ + +#ifdef DEBUG +/* A debugging function that can be called from gdb, for instance. */ +void +open_files () +{ + register int i; + int f, fd_table_size; + + fd_table_size = getdtablesize (); + + fprintf (stderr, "pid %ld open files:", (long)getpid ()); + for (i = 3; i < fd_table_size; i++) + { + if ((f = fcntl (i, F_GETFD, 0)) != -1) + fprintf (stderr, " %d (%s)", i, f ? "close" : "open"); + } + fprintf (stderr, "\n"); +} +#endif + +static void +async_redirect_stdin () +{ + int fd; + + fd = open ("/dev/null", O_RDONLY); + if (fd > 0) + { + dup2 (fd, 0); + close (fd); + } + else if (fd < 0) + internal_error (_("cannot redirect standard input from /dev/null: %s"), strerror (errno)); +} + +#define DESCRIBE_PID(pid) do { if (interactive) describe_pid (pid); } while (0) + +/* Execute the command passed in COMMAND, perhaps doing it asynchronously. + COMMAND is exactly what read_command () places into GLOBAL_COMMAND. + ASYNCHROUNOUS, if non-zero, says to do this command in the background. + PIPE_IN and PIPE_OUT are file descriptors saying where input comes + from and where it goes. They can have the value of NO_PIPE, which means + I/O is stdin/stdout. + FDS_TO_CLOSE is a list of file descriptors to close once the child has + been forked. This list often contains the unusable sides of pipes, etc. + + EXECUTION_SUCCESS or EXECUTION_FAILURE are the only possible + return values. Executing a command with nothing in it returns + EXECUTION_SUCCESS. */ +int +execute_command_internal (command, asynchronous, pipe_in, pipe_out, + fds_to_close) + COMMAND *command; + int asynchronous; + int pipe_in, pipe_out; + struct fd_bitmap *fds_to_close; +{ + int exec_result, user_subshell, invert, ignore_return, was_error_trap; + REDIRECT *my_undo_list, *exec_undo_list; + char *tcmd; + volatile int last_pid; + volatile int save_line_number; +#if defined (PROCESS_SUBSTITUTION) + volatile int ofifo, nfifo, osize, saved_fifo; + volatile char *ofifo_list; +#endif + + if (breaking || continuing) + return (last_command_exit_value); + if (command == 0 || read_but_dont_execute) + return (EXECUTION_SUCCESS); + + QUIT; + run_pending_traps (); + +#if 0 + if (running_trap == 0) +#endif + currently_executing_command = command; + + invert = (command->flags & CMD_INVERT_RETURN) != 0; + + /* If we're inverting the return value and `set -e' has been executed, + we don't want a failing command to inadvertently cause the shell + to exit. */ + if (exit_immediately_on_error && invert) /* XXX */ + command->flags |= CMD_IGNORE_RETURN; /* XXX */ + + exec_result = EXECUTION_SUCCESS; + + /* If a command was being explicitly run in a subshell, or if it is + a shell control-structure, and it has a pipe, then we do the command + in a subshell. */ + if (command->type == cm_subshell && (command->flags & CMD_NO_FORK)) + return (execute_in_subshell (command, asynchronous, pipe_in, pipe_out, fds_to_close)); + +#if defined (COPROCESS_SUPPORT) + if (command->type == cm_coproc) + return (execute_coproc (command, pipe_in, pipe_out, fds_to_close)); +#endif + + user_subshell = command->type == cm_subshell || ((command->flags & CMD_WANT_SUBSHELL) != 0); + + if (command->type == cm_subshell || + (command->flags & (CMD_WANT_SUBSHELL|CMD_FORCE_SUBSHELL)) || + (shell_control_structure (command->type) && + (pipe_out != NO_PIPE || pipe_in != NO_PIPE || asynchronous))) + { + pid_t paren_pid; + int s; + + /* Fork a subshell, turn off the subshell bit, turn off job + control and call execute_command () on the command again. */ + line_number_for_err_trap = line_number; + tcmd = make_command_string (command); + paren_pid = make_child (savestring (tcmd), asynchronous); + + if (user_subshell && signal_is_trapped (ERROR_TRAP) && + signal_in_progress (DEBUG_TRAP) == 0 && running_trap == 0) + { + FREE (the_printed_command_except_trap); + the_printed_command_except_trap = savestring (the_printed_command); + } + + if (paren_pid == 0) + { + /* We want to run the exit trap for forced {} subshells, and we + want to note this before execute_in_subshell modifies the + COMMAND struct. Need to keep in mind that execute_in_subshell + runs the exit trap for () subshells itself. */ + /* This handles { command; } & */ + s = user_subshell == 0 && command->type == cm_group && pipe_in == NO_PIPE && pipe_out == NO_PIPE && asynchronous; + /* run exit trap for : | { ...; } and { ...; } | : */ + /* run exit trap for : | ( ...; ) and ( ...; ) | : */ + s += user_subshell == 0 && command->type == cm_group && (pipe_in != NO_PIPE || pipe_out != NO_PIPE) && asynchronous == 0; + + last_command_exit_value = execute_in_subshell (command, asynchronous, pipe_in, pipe_out, fds_to_close); + if (s) + subshell_exit (last_command_exit_value); + else + exit (last_command_exit_value); + /* NOTREACHED */ + } + else + { + close_pipes (pipe_in, pipe_out); + +#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD) + if (variable_context == 0) /* wait until shell function completes */ + unlink_fifo_list (); +#endif + /* If we are part of a pipeline, and not the end of the pipeline, + then we should simply return and let the last command in the + pipe be waited for. If we are not in a pipeline, or are the + last command in the pipeline, then we wait for the subshell + and return its exit status as usual. */ + if (pipe_out != NO_PIPE) + return (EXECUTION_SUCCESS); + + stop_pipeline (asynchronous, (COMMAND *)NULL); + + if (asynchronous == 0) + { + was_error_trap = signal_is_trapped (ERROR_TRAP) && signal_is_ignored (ERROR_TRAP) == 0; + invert = (command->flags & CMD_INVERT_RETURN) != 0; + ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0; + + exec_result = wait_for (paren_pid); + + /* If we have to, invert the return value. */ + if (invert) + exec_result = ((exec_result == EXECUTION_SUCCESS) + ? EXECUTION_FAILURE + : EXECUTION_SUCCESS); + + last_command_exit_value = exec_result; + if (user_subshell && was_error_trap && ignore_return == 0 && invert == 0 && exec_result != EXECUTION_SUCCESS) + { + save_line_number = line_number; + line_number = line_number_for_err_trap; + run_error_trap (); + line_number = save_line_number; + } + + if (user_subshell && ignore_return == 0 && invert == 0 && exit_immediately_on_error && exec_result != EXECUTION_SUCCESS) + { + run_pending_traps (); + jump_to_top_level (ERREXIT); + } + + return (last_command_exit_value); + } + else + { + DESCRIBE_PID (paren_pid); + + run_pending_traps (); + + /* Posix 2013 2.9.3.1: "the exit status of an asynchronous list + shall be zero." */ + last_command_exit_value = 0; + return (EXECUTION_SUCCESS); + } + } + } + +#if defined (COMMAND_TIMING) + if (command->flags & CMD_TIME_PIPELINE) + { + if (asynchronous) + { + command->flags |= CMD_FORCE_SUBSHELL; + exec_result = execute_command_internal (command, 1, pipe_in, pipe_out, fds_to_close); + } + else + { + exec_result = time_command (command, asynchronous, pipe_in, pipe_out, fds_to_close); +#if 0 + if (running_trap == 0) +#endif + currently_executing_command = (COMMAND *)NULL; + } + return (exec_result); + } +#endif /* COMMAND_TIMING */ + + if (shell_control_structure (command->type) && command->redirects) + stdin_redir = stdin_redirects (command->redirects); + +#if defined (PROCESS_SUBSTITUTION) + if (variable_context != 0) + { + ofifo = num_fifos (); + ofifo_list = copy_fifo_list ((int *)&osize); + saved_fifo = 1; + } + else + saved_fifo = 0; +#endif + + /* Handle WHILE FOR CASE etc. with redirections. (Also '&' input + redirection.) */ + if (do_redirections (command->redirects, RX_ACTIVE|RX_UNDOABLE) != 0) + { + cleanup_redirects (redirection_undo_list); + redirection_undo_list = (REDIRECT *)NULL; + dispose_exec_redirects (); +#if defined (PROCESS_SUBSTITUTION) + if (saved_fifo) + free ((void *)ofifo_list); +#endif + return (last_command_exit_value = EXECUTION_FAILURE); + } + + if (redirection_undo_list) + { + /* XXX - why copy here? */ + my_undo_list = (REDIRECT *)copy_redirects (redirection_undo_list); + dispose_redirects (redirection_undo_list); + redirection_undo_list = (REDIRECT *)NULL; + } + else + my_undo_list = (REDIRECT *)NULL; + + if (exec_redirection_undo_list) + { + /* XXX - why copy here? */ + exec_undo_list = (REDIRECT *)copy_redirects (exec_redirection_undo_list); + dispose_redirects (exec_redirection_undo_list); + exec_redirection_undo_list = (REDIRECT *)NULL; + } + else + exec_undo_list = (REDIRECT *)NULL; + + if (my_undo_list || exec_undo_list) + begin_unwind_frame ("loop_redirections"); + + if (my_undo_list) + add_unwind_protect ((Function *)cleanup_redirects, my_undo_list); + + if (exec_undo_list) + add_unwind_protect ((Function *)dispose_redirects, exec_undo_list); + + ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0; + + QUIT; + + switch (command->type) + { + case cm_simple: + { + save_line_number = line_number; + /* We can't rely on variables retaining their values across a + call to execute_simple_command if a longjmp occurs as the + result of a `return' builtin. This is true for sure with gcc. */ +#if defined (RECYCLES_PIDS) + last_made_pid = NO_PID; +#endif + last_pid = last_made_pid; + was_error_trap = signal_is_trapped (ERROR_TRAP) && signal_is_ignored (ERROR_TRAP) == 0; + + if (ignore_return && command->value.Simple) + command->value.Simple->flags |= CMD_IGNORE_RETURN; + if (command->flags & CMD_STDIN_REDIR) + command->value.Simple->flags |= CMD_STDIN_REDIR; + + line_number_for_err_trap = line_number = command->value.Simple->line; + exec_result = + execute_simple_command (command->value.Simple, pipe_in, pipe_out, + asynchronous, fds_to_close); + line_number = save_line_number; + + /* The temporary environment should be used for only the simple + command immediately following its definition. */ + dispose_used_env_vars (); + +#if (defined (ultrix) && defined (mips)) || defined (C_ALLOCA) + /* Reclaim memory allocated with alloca () on machines which + may be using the alloca emulation code. */ + (void) alloca (0); +#endif /* (ultrix && mips) || C_ALLOCA */ + + /* If we forked to do the command, then we must wait_for () + the child. */ + + /* XXX - this is something to watch out for if there are problems + when the shell is compiled without job control. Don't worry about + whether or not last_made_pid == last_pid; already_making_children + tells us whether or not there are unwaited-for children to wait + for and reap. */ + if (already_making_children && pipe_out == NO_PIPE) + { + stop_pipeline (asynchronous, (COMMAND *)NULL); + + if (asynchronous) + { + DESCRIBE_PID (last_made_pid); + } + else +#if !defined (JOB_CONTROL) + /* Do not wait for asynchronous processes started from + startup files. */ + if (last_made_pid != last_asynchronous_pid) +#endif + /* When executing a shell function that executes other + commands, this causes the last simple command in + the function to be waited for twice. This also causes + subshells forked to execute builtin commands (e.g., in + pipelines) to be waited for twice. */ + exec_result = wait_for (last_made_pid); + } + } + + /* 2009/02/13 -- pipeline failure is processed elsewhere. This handles + only the failure of a simple command. */ + if (was_error_trap && ignore_return == 0 && invert == 0 && pipe_in == NO_PIPE && pipe_out == NO_PIPE && exec_result != EXECUTION_SUCCESS) + { + last_command_exit_value = exec_result; + line_number = line_number_for_err_trap; + run_error_trap (); + line_number = save_line_number; + } + + if (ignore_return == 0 && invert == 0 && + ((posixly_correct && interactive == 0 && special_builtin_failed) || + (exit_immediately_on_error && pipe_in == NO_PIPE && pipe_out == NO_PIPE && exec_result != EXECUTION_SUCCESS))) + { + last_command_exit_value = exec_result; + run_pending_traps (); + jump_to_top_level (ERREXIT); + } + + break; + + case cm_for: + if (ignore_return) + command->value.For->flags |= CMD_IGNORE_RETURN; + exec_result = execute_for_command (command->value.For); + break; + +#if defined (ARITH_FOR_COMMAND) + case cm_arith_for: + if (ignore_return) + command->value.ArithFor->flags |= CMD_IGNORE_RETURN; + exec_result = execute_arith_for_command (command->value.ArithFor); + break; +#endif + +#if defined (SELECT_COMMAND) + case cm_select: + if (ignore_return) + command->value.Select->flags |= CMD_IGNORE_RETURN; + exec_result = execute_select_command (command->value.Select); + break; +#endif + + case cm_case: + if (ignore_return) + command->value.Case->flags |= CMD_IGNORE_RETURN; + exec_result = execute_case_command (command->value.Case); + break; + + case cm_while: + if (ignore_return) + command->value.While->flags |= CMD_IGNORE_RETURN; + exec_result = execute_while_command (command->value.While); + break; + + case cm_until: + if (ignore_return) + command->value.While->flags |= CMD_IGNORE_RETURN; + exec_result = execute_until_command (command->value.While); + break; + + case cm_if: + if (ignore_return) + command->value.If->flags |= CMD_IGNORE_RETURN; + exec_result = execute_if_command (command->value.If); + break; + + case cm_group: + + /* This code can be executed from either of two paths: an explicit + '{}' command, or via a function call. If we are executed via a + function call, we have already taken care of the function being + executed in the background (down there in execute_simple_command ()), + and this command should *not* be marked as asynchronous. If we + are executing a regular '{}' group command, and asynchronous == 1, + we must want to execute the whole command in the background, so we + need a subshell, and we want the stuff executed in that subshell + (this group command) to be executed in the foreground of that + subshell (i.e. there will not be *another* subshell forked). + + What we do is to force a subshell if asynchronous, and then call + execute_command_internal again with asynchronous still set to 1, + but with the original group command, so the printed command will + look right. + + The code above that handles forking off subshells will note that + both subshell and async are on, and turn off async in the child + after forking the subshell (but leave async set in the parent, so + the normal call to describe_pid is made). This turning off + async is *crucial*; if it is not done, this will fall into an + infinite loop of executions through this spot in subshell after + subshell until the process limit is exhausted. */ + + if (asynchronous) + { + command->flags |= CMD_FORCE_SUBSHELL; + exec_result = + execute_command_internal (command, 1, pipe_in, pipe_out, + fds_to_close); + } + else + { + if (ignore_return && command->value.Group->command) + command->value.Group->command->flags |= CMD_IGNORE_RETURN; + exec_result = + execute_command_internal (command->value.Group->command, + asynchronous, pipe_in, pipe_out, + fds_to_close); + } + break; + + case cm_connection: + exec_result = execute_connection (command, asynchronous, + pipe_in, pipe_out, fds_to_close); + break; + +#if defined (DPAREN_ARITHMETIC) + case cm_arith: + was_error_trap = signal_is_trapped (ERROR_TRAP) && signal_is_ignored (ERROR_TRAP) == 0; + if (ignore_return) + command->value.Arith->flags |= CMD_IGNORE_RETURN; + line_number_for_err_trap = save_line_number = line_number; + exec_result = execute_arith_command (command->value.Arith); + line_number = save_line_number; + + if (was_error_trap && ignore_return == 0 && invert == 0 && exec_result != EXECUTION_SUCCESS) + { + last_command_exit_value = exec_result; + save_line_number = line_number; + line_number = line_number_for_err_trap; + run_error_trap (); + line_number = save_line_number; + } + + if (ignore_return == 0 && invert == 0 && exit_immediately_on_error && exec_result != EXECUTION_SUCCESS) + { + last_command_exit_value = exec_result; + run_pending_traps (); + jump_to_top_level (ERREXIT); + } + + break; +#endif + +#if defined (COND_COMMAND) + case cm_cond: + was_error_trap = signal_is_trapped (ERROR_TRAP) && signal_is_ignored (ERROR_TRAP) == 0; + if (ignore_return) + command->value.Cond->flags |= CMD_IGNORE_RETURN; + + line_number_for_err_trap = save_line_number = line_number; + exec_result = execute_cond_command (command->value.Cond); + line_number = save_line_number; + + if (was_error_trap && ignore_return == 0 && invert == 0 && exec_result != EXECUTION_SUCCESS) + { + last_command_exit_value = exec_result; + save_line_number = line_number; + line_number = line_number_for_err_trap; + run_error_trap (); + line_number = save_line_number; + } + + if (ignore_return == 0 && invert == 0 && exit_immediately_on_error && exec_result != EXECUTION_SUCCESS) + { + last_command_exit_value = exec_result; + run_pending_traps (); + jump_to_top_level (ERREXIT); + } + + break; +#endif + + case cm_function_def: + exec_result = execute_intern_function (command->value.Function_def->name, + command->value.Function_def); + break; + + default: + command_error ("execute_command", CMDERR_BADTYPE, command->type, 0); + } + + if (my_undo_list) + { + do_redirections (my_undo_list, RX_ACTIVE); + dispose_redirects (my_undo_list); + } + + if (exec_undo_list) + dispose_redirects (exec_undo_list); + + if (my_undo_list || exec_undo_list) + discard_unwind_frame ("loop_redirections"); + +#if defined (PROCESS_SUBSTITUTION) + if (saved_fifo) + { + nfifo = num_fifos (); + if (nfifo > ofifo) + close_new_fifos ((char *)ofifo_list, osize); + free ((void *)ofifo_list); + } +#endif + + /* Invert the return value if we have to */ + if (invert) + exec_result = (exec_result == EXECUTION_SUCCESS) + ? EXECUTION_FAILURE + : EXECUTION_SUCCESS; + +#if defined (DPAREN_ARITHMETIC) || defined (COND_COMMAND) + /* This is where we set PIPESTATUS from the exit status of the appropriate + compound commands (the ones that look enough like simple commands to + cause confusion). We might be able to optimize by not doing this if + subshell_environment != 0. */ + switch (command->type) + { +# if defined (DPAREN_ARITHMETIC) + case cm_arith: +# endif +# if defined (COND_COMMAND) + case cm_cond: +# endif + set_pipestatus_from_exit (exec_result); + break; + } +#endif + + last_command_exit_value = exec_result; + run_pending_traps (); +#if 0 + if (running_trap == 0) +#endif + currently_executing_command = (COMMAND *)NULL; + + return (last_command_exit_value); +} + +#if defined (COMMAND_TIMING) + +#if defined (HAVE_GETRUSAGE) && defined (HAVE_GETTIMEOFDAY) +extern struct timeval *difftimeval __P((struct timeval *, struct timeval *, struct timeval *)); +extern struct timeval *addtimeval __P((struct timeval *, struct timeval *, struct timeval *)); +extern int timeval_to_cpu __P((struct timeval *, struct timeval *, struct timeval *)); +#endif + +#define POSIX_TIMEFORMAT "real %2R\nuser %2U\nsys %2S" +#define BASH_TIMEFORMAT "\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS" + +static const int precs[] = { 0, 100, 10, 1 }; + +/* Expand one `%'-prefixed escape sequence from a time format string. */ +static int +mkfmt (buf, prec, lng, sec, sec_fraction) + char *buf; + int prec, lng; + time_t sec; + int sec_fraction; +{ + time_t min; + char abuf[INT_STRLEN_BOUND(time_t) + 1]; + int ind, aind; + + ind = 0; + abuf[sizeof(abuf) - 1] = '\0'; + + /* If LNG is non-zero, we want to decompose SEC into minutes and seconds. */ + if (lng) + { + min = sec / 60; + sec %= 60; + aind = sizeof(abuf) - 2; + do + abuf[aind--] = (min % 10) + '0'; + while (min /= 10); + aind++; + while (abuf[aind]) + buf[ind++] = abuf[aind++]; + buf[ind++] = 'm'; + } + + /* Now add the seconds. */ + aind = sizeof (abuf) - 2; + do + abuf[aind--] = (sec % 10) + '0'; + while (sec /= 10); + aind++; + while (abuf[aind]) + buf[ind++] = abuf[aind++]; + + /* We want to add a decimal point and PREC places after it if PREC is + nonzero. PREC is not greater than 3. SEC_FRACTION is between 0 + and 999. */ + if (prec != 0) + { + buf[ind++] = '.'; + for (aind = 1; aind <= prec; aind++) + { + buf[ind++] = (sec_fraction / precs[aind]) + '0'; + sec_fraction %= precs[aind]; + } + } + + if (lng) + buf[ind++] = 's'; + buf[ind] = '\0'; + + return (ind); +} + +/* Interpret the format string FORMAT, interpolating the following escape + sequences: + %[prec][l][RUS] + + where the optional `prec' is a precision, meaning the number of + characters after the decimal point, the optional `l' means to format + using minutes and seconds (MMmNN[.FF]s), like the `times' builtin', + and the last character is one of + + R number of seconds of `real' time + U number of seconds of `user' time + S number of seconds of `system' time + + An occurrence of `%%' in the format string is translated to a `%'. The + result is printed to FP, a pointer to a FILE. The other variables are + the seconds and thousandths of a second of real, user, and system time, + resectively. */ +static void +print_formatted_time (fp, format, rs, rsf, us, usf, ss, ssf, cpu) + FILE *fp; + char *format; + time_t rs; + int rsf; + time_t us; + int usf; + time_t ss; + int ssf, cpu; +{ + int prec, lng, len; + char *str, *s, ts[INT_STRLEN_BOUND (time_t) + sizeof ("mSS.FFFF")]; + time_t sum; + int sum_frac; + int sindex, ssize; + + len = strlen (format); + ssize = (len + 64) - (len % 64); + str = (char *)xmalloc (ssize); + sindex = 0; + + for (s = format; *s; s++) + { + if (*s != '%' || s[1] == '\0') + { + RESIZE_MALLOCED_BUFFER (str, sindex, 1, ssize, 64); + str[sindex++] = *s; + } + else if (s[1] == '%') + { + s++; + RESIZE_MALLOCED_BUFFER (str, sindex, 1, ssize, 64); + str[sindex++] = *s; + } + else if (s[1] == 'P') + { + s++; +#if 0 + /* clamp CPU usage at 100% */ + if (cpu > 10000) + cpu = 10000; +#endif + sum = cpu / 100; + sum_frac = (cpu % 100) * 10; + len = mkfmt (ts, 2, 0, sum, sum_frac); + RESIZE_MALLOCED_BUFFER (str, sindex, len, ssize, 64); + strcpy (str + sindex, ts); + sindex += len; + } + else + { + prec = 3; /* default is three places past the decimal point. */ + lng = 0; /* default is to not use minutes or append `s' */ + s++; + if (DIGIT (*s)) /* `precision' */ + { + prec = *s++ - '0'; + if (prec > 3) prec = 3; + } + if (*s == 'l') /* `length extender' */ + { + lng = 1; + s++; + } + if (*s == 'R' || *s == 'E') + len = mkfmt (ts, prec, lng, rs, rsf); + else if (*s == 'U') + len = mkfmt (ts, prec, lng, us, usf); + else if (*s == 'S') + len = mkfmt (ts, prec, lng, ss, ssf); + else + { + internal_error (_("TIMEFORMAT: `%c': invalid format character"), *s); + free (str); + return; + } + RESIZE_MALLOCED_BUFFER (str, sindex, len, ssize, 64); + strcpy (str + sindex, ts); + sindex += len; + } + } + + str[sindex] = '\0'; + fprintf (fp, "%s\n", str); + fflush (fp); + + free (str); +} + +static int +time_command (command, asynchronous, pipe_in, pipe_out, fds_to_close) + COMMAND *command; + int asynchronous, pipe_in, pipe_out; + struct fd_bitmap *fds_to_close; +{ + int rv, posix_time, old_flags, nullcmd; + time_t rs, us, ss; + int rsf, usf, ssf; + int cpu; + char *time_format; + +#if defined (HAVE_GETRUSAGE) && defined (HAVE_GETTIMEOFDAY) + struct timeval real, user, sys; + struct timeval before, after; +# if defined (HAVE_STRUCT_TIMEZONE) + struct timezone dtz; /* posix doesn't define this */ +# endif + struct rusage selfb, selfa, kidsb, kidsa; /* a = after, b = before */ +#else +# if defined (HAVE_TIMES) + clock_t tbefore, tafter, real, user, sys; + struct tms before, after; +# endif +#endif + +#if defined (HAVE_GETRUSAGE) && defined (HAVE_GETTIMEOFDAY) +# if defined (HAVE_STRUCT_TIMEZONE) + gettimeofday (&before, &dtz); +# else + gettimeofday (&before, (void *)NULL); +# endif /* !HAVE_STRUCT_TIMEZONE */ + getrusage (RUSAGE_SELF, &selfb); + getrusage (RUSAGE_CHILDREN, &kidsb); +#else +# if defined (HAVE_TIMES) + tbefore = times (&before); +# endif +#endif + + posix_time = command && (command->flags & CMD_TIME_POSIX); + + nullcmd = (command == 0) || (command->type == cm_simple && command->value.Simple->words == 0 && command->value.Simple->redirects == 0); + if (posixly_correct && nullcmd) + { +#if defined (HAVE_GETRUSAGE) + selfb.ru_utime.tv_sec = kidsb.ru_utime.tv_sec = selfb.ru_stime.tv_sec = kidsb.ru_stime.tv_sec = 0; + selfb.ru_utime.tv_usec = kidsb.ru_utime.tv_usec = selfb.ru_stime.tv_usec = kidsb.ru_stime.tv_usec = 0; + before.tv_sec = shell_start_time; + before.tv_usec = 0; +#else + before.tms_utime = before.tms_stime = before.tms_cutime = before.tms_cstime = 0; + tbefore = shell_start_time; +#endif + } + + old_flags = command->flags; + command->flags &= ~(CMD_TIME_PIPELINE|CMD_TIME_POSIX); + rv = execute_command_internal (command, asynchronous, pipe_in, pipe_out, fds_to_close); + command->flags = old_flags; + + rs = us = ss = 0; + rsf = usf = ssf = cpu = 0; + +#if defined (HAVE_GETRUSAGE) && defined (HAVE_GETTIMEOFDAY) +# if defined (HAVE_STRUCT_TIMEZONE) + gettimeofday (&after, &dtz); +# else + gettimeofday (&after, (void *)NULL); +# endif /* !HAVE_STRUCT_TIMEZONE */ + getrusage (RUSAGE_SELF, &selfa); + getrusage (RUSAGE_CHILDREN, &kidsa); + + difftimeval (&real, &before, &after); + timeval_to_secs (&real, &rs, &rsf); + + addtimeval (&user, difftimeval(&after, &selfb.ru_utime, &selfa.ru_utime), + difftimeval(&before, &kidsb.ru_utime, &kidsa.ru_utime)); + timeval_to_secs (&user, &us, &usf); + + addtimeval (&sys, difftimeval(&after, &selfb.ru_stime, &selfa.ru_stime), + difftimeval(&before, &kidsb.ru_stime, &kidsa.ru_stime)); + timeval_to_secs (&sys, &ss, &ssf); + + cpu = timeval_to_cpu (&real, &user, &sys); +#else +# if defined (HAVE_TIMES) + tafter = times (&after); + + real = tafter - tbefore; + clock_t_to_secs (real, &rs, &rsf); + + user = (after.tms_utime - before.tms_utime) + (after.tms_cutime - before.tms_cutime); + clock_t_to_secs (user, &us, &usf); + + sys = (after.tms_stime - before.tms_stime) + (after.tms_cstime - before.tms_cstime); + clock_t_to_secs (sys, &ss, &ssf); + + cpu = (real == 0) ? 0 : ((user + sys) * 10000) / real; + +# else + rs = us = ss = 0; + rsf = usf = ssf = cpu = 0; +# endif +#endif + + if (posix_time) + time_format = POSIX_TIMEFORMAT; + else if ((time_format = get_string_value ("TIMEFORMAT")) == 0) + { + if (posixly_correct && nullcmd) + time_format = "user\t%2lU\nsys\t%2lS"; + else + time_format = BASH_TIMEFORMAT; + } + if (time_format && *time_format) + print_formatted_time (stderr, time_format, rs, rsf, us, usf, ss, ssf, cpu); + + return rv; +} +#endif /* COMMAND_TIMING */ + +/* Execute a command that's supposed to be in a subshell. This must be + called after make_child and we must be running in the child process. + The caller will return or exit() immediately with the value this returns. */ +static int +execute_in_subshell (command, asynchronous, pipe_in, pipe_out, fds_to_close) + COMMAND *command; + int asynchronous; + int pipe_in, pipe_out; + struct fd_bitmap *fds_to_close; +{ + int user_subshell, return_code, function_value, should_redir_stdin, invert; + int ois, user_coproc; + int result; + volatile COMMAND *tcom; + + USE_VAR(user_subshell); + USE_VAR(user_coproc); + USE_VAR(invert); + USE_VAR(tcom); + USE_VAR(asynchronous); + + subshell_level++; + should_redir_stdin = (asynchronous && (command->flags & CMD_STDIN_REDIR) && + pipe_in == NO_PIPE && + stdin_redirects (command->redirects) == 0); + + invert = (command->flags & CMD_INVERT_RETURN) != 0; + user_subshell = command->type == cm_subshell || ((command->flags & CMD_WANT_SUBSHELL) != 0); + user_coproc = command->type == cm_coproc; + + command->flags &= ~(CMD_FORCE_SUBSHELL | CMD_WANT_SUBSHELL | CMD_INVERT_RETURN); + + /* If a command is asynchronous in a subshell (like ( foo ) & or + the special case of an asynchronous GROUP command where the + the subshell bit is turned on down in case cm_group: below), + turn off `asynchronous', so that two subshells aren't spawned. + XXX - asynchronous used to be set to 0 in this block, but that + means that setup_async_signals was never run. Now it's set to + 0 after subshell_environment is set appropriately and setup_async_signals + is run. + + This seems semantically correct to me. For example, + ( foo ) & seems to say ``do the command `foo' in a subshell + environment, but don't wait for that subshell to finish'', + and "{ foo ; bar ; } &" seems to me to be like functions or + builtins in the background, which executed in a subshell + environment. I just don't see the need to fork two subshells. */ + + /* Don't fork again, we are already in a subshell. A `doubly + async' shell is not interactive, however. */ + if (asynchronous) + { +#if defined (JOB_CONTROL) + /* If a construct like ( exec xxx yyy ) & is given while job + control is active, we want to prevent exec from putting the + subshell back into the original process group, carefully + undoing all the work we just did in make_child. */ + original_pgrp = -1; +#endif /* JOB_CONTROL */ + ois = interactive_shell; + interactive_shell = 0; + /* This test is to prevent alias expansion by interactive shells that + run `(command) &' but to allow scripts that have enabled alias + expansion with `shopt -s expand_alias' to continue to expand + aliases. */ + if (ois != interactive_shell) + expand_aliases = 0; + } + + /* Subshells are neither login nor interactive. */ + login_shell = interactive = 0; + + if (user_subshell) + subshell_environment = SUBSHELL_PAREN; + else + { + subshell_environment = 0; /* XXX */ + if (asynchronous) + subshell_environment |= SUBSHELL_ASYNC; + if (pipe_in != NO_PIPE || pipe_out != NO_PIPE) + subshell_environment |= SUBSHELL_PIPE; + if (user_coproc) + subshell_environment |= SUBSHELL_COPROC; + } + + reset_terminating_signals (); /* in sig.c */ + /* Cancel traps, in trap.c. */ + /* Reset the signal handlers in the child, but don't free the + trap strings. Set a flag noting that we have to free the + trap strings if we run trap to change a signal disposition. */ + reset_signal_handlers (); + subshell_environment |= SUBSHELL_RESETTRAP; + + /* Make sure restore_original_signals doesn't undo the work done by + make_child to ensure that asynchronous children are immune to SIGINT + and SIGQUIT. Turn off asynchronous to make sure more subshells are + not spawned. */ + if (asynchronous) + { + setup_async_signals (); + asynchronous = 0; + } + +#if defined (JOB_CONTROL) + set_sigchld_handler (); +#endif /* JOB_CONTROL */ + + set_sigint_handler (); + +#if defined (JOB_CONTROL) + /* Delete all traces that there were any jobs running. This is + only for subshells. */ + without_job_control (); +#endif /* JOB_CONTROL */ + + if (fds_to_close) + close_fd_bitmap (fds_to_close); + + do_piping (pipe_in, pipe_out); + +#if defined (COPROCESS_SUPPORT) + coproc_closeall (); +#endif + + /* If this is a user subshell, set a flag if stdin was redirected. + This is used later to decide whether to redirect fd 0 to + /dev/null for async commands in the subshell. This adds more + sh compatibility, but I'm not sure it's the right thing to do. */ + if (user_subshell) + { + stdin_redir = stdin_redirects (command->redirects); + restore_default_signal (EXIT_TRAP); + } + + /* If this is an asynchronous command (command &), we want to + redirect the standard input from /dev/null in the absence of + any specific redirection involving stdin. */ + if (should_redir_stdin && stdin_redir == 0) + async_redirect_stdin (); + + /* Do redirections, then dispose of them before recursive call. */ + if (command->redirects) + { + if (do_redirections (command->redirects, RX_ACTIVE) != 0) + exit (invert ? EXECUTION_SUCCESS : EXECUTION_FAILURE); + + dispose_redirects (command->redirects); + command->redirects = (REDIRECT *)NULL; + } + + if (command->type == cm_subshell) + tcom = command->value.Subshell->command; + else if (user_coproc) + tcom = command->value.Coproc->command; + else + tcom = command; + + if (command->flags & CMD_TIME_PIPELINE) + tcom->flags |= CMD_TIME_PIPELINE; + if (command->flags & CMD_TIME_POSIX) + tcom->flags |= CMD_TIME_POSIX; + + /* Make sure the subshell inherits any CMD_IGNORE_RETURN flag. */ + if ((command->flags & CMD_IGNORE_RETURN) && tcom != command) + tcom->flags |= CMD_IGNORE_RETURN; + + /* If this is a simple command, tell execute_disk_command that it + might be able to get away without forking and simply exec. + This means things like ( sleep 10 ) will only cause one fork. + If we're timing the command or inverting its return value, however, + we cannot do this optimization. */ + if ((user_subshell || user_coproc) && (tcom->type == cm_simple || tcom->type == cm_subshell) && + ((tcom->flags & CMD_TIME_PIPELINE) == 0) && + ((tcom->flags & CMD_INVERT_RETURN) == 0)) + { + tcom->flags |= CMD_NO_FORK; + if (tcom->type == cm_simple) + tcom->value.Simple->flags |= CMD_NO_FORK; + } + + invert = (tcom->flags & CMD_INVERT_RETURN) != 0; + tcom->flags &= ~CMD_INVERT_RETURN; + + result = setjmp_nosigs (top_level); + + /* If we're inside a function while executing this subshell, we + need to handle a possible `return'. */ + function_value = 0; + if (return_catch_flag) + function_value = setjmp_nosigs (return_catch); + + /* If we're going to exit the shell, we don't want to invert the return + status. */ + if (result == EXITPROG) + invert = 0, return_code = last_command_exit_value; + else if (result) + return_code = EXECUTION_FAILURE; + else if (function_value) + return_code = return_catch_value; + else + return_code = execute_command_internal ((COMMAND *)tcom, asynchronous, NO_PIPE, NO_PIPE, fds_to_close); + + /* If we are asked to, invert the return value. */ + if (invert) + return_code = (return_code == EXECUTION_SUCCESS) ? EXECUTION_FAILURE + : EXECUTION_SUCCESS; + + /* If we were explicitly placed in a subshell with (), we need + to do the `shell cleanup' things, such as running traps[0]. */ + if (user_subshell && signal_is_trapped (0)) + { + last_command_exit_value = return_code; + return_code = run_exit_trap (); + } + + subshell_level--; + return (return_code); + /* NOTREACHED */ +} + +#if defined (COPROCESS_SUPPORT) +#define COPROC_MAX 16 + +typedef struct cpelement + { + struct cpelement *next; + struct coproc *coproc; + } +cpelement_t; + +typedef struct cplist + { + struct cpelement *head; + struct cpelement *tail; + int ncoproc; + int lock; + } +cplist_t; + +static struct cpelement *cpe_alloc __P((struct coproc *)); +static void cpe_dispose __P((struct cpelement *)); +static struct cpelement *cpl_add __P((struct coproc *)); +static struct cpelement *cpl_delete __P((pid_t)); +static void cpl_reap __P((void)); +static void cpl_flush __P((void)); +static void cpl_closeall __P((void)); +static struct cpelement *cpl_search __P((pid_t)); +static struct cpelement *cpl_searchbyname __P((const char *)); +static void cpl_prune __P((void)); + +static void coproc_free __P((struct coproc *)); + +/* Will go away when there is fully-implemented support for multiple coprocs. */ +Coproc sh_coproc = { 0, NO_PID, -1, -1, 0, 0, 0, 0, 0 }; + +cplist_t coproc_list = {0, 0, 0}; + +/* Functions to manage the list of coprocs */ + +static struct cpelement * +cpe_alloc (cp) + Coproc *cp; +{ + struct cpelement *cpe; + + cpe = (struct cpelement *)xmalloc (sizeof (struct cpelement)); + cpe->coproc = cp; + cpe->next = (struct cpelement *)0; + return cpe; +} + +static void +cpe_dispose (cpe) + struct cpelement *cpe; +{ + free (cpe); +} + +static struct cpelement * +cpl_add (cp) + Coproc *cp; +{ + struct cpelement *cpe; + + cpe = cpe_alloc (cp); + + if (coproc_list.head == 0) + { + coproc_list.head = coproc_list.tail = cpe; + coproc_list.ncoproc = 0; /* just to make sure */ + } + else + { + coproc_list.tail->next = cpe; + coproc_list.tail = cpe; + } + coproc_list.ncoproc++; + + return cpe; +} + +static struct cpelement * +cpl_delete (pid) + pid_t pid; +{ + struct cpelement *prev, *p; + + for (prev = p = coproc_list.head; p; prev = p, p = p->next) + if (p->coproc->c_pid == pid) + { + prev->next = p->next; /* remove from list */ + break; + } + + if (p == 0) + return 0; /* not found */ + +#if defined (DEBUG) + itrace("cpl_delete: deleting %d", pid); +#endif + + /* Housekeeping in the border cases. */ + if (p == coproc_list.head) + coproc_list.head = coproc_list.head->next; + else if (p == coproc_list.tail) + coproc_list.tail = prev; + + coproc_list.ncoproc--; + if (coproc_list.ncoproc == 0) + coproc_list.head = coproc_list.tail = 0; + else if (coproc_list.ncoproc == 1) + coproc_list.tail = coproc_list.head; /* just to make sure */ + + return (p); +} + +static void +cpl_reap () +{ + struct cpelement *p, *next, *nh, *nt; + + /* Build a new list by removing dead coprocs and fix up the coproc_list + pointers when done. */ + nh = nt = next = (struct cpelement *)0; + for (p = coproc_list.head; p; p = next) + { + next = p->next; + if (p->coproc->c_flags & COPROC_DEAD) + { + coproc_list.ncoproc--; /* keep running count, fix up pointers later */ + +#if defined (DEBUG) + itrace("cpl_reap: deleting %d", p->coproc->c_pid); +#endif + + coproc_dispose (p->coproc); + cpe_dispose (p); + } + else if (nh == 0) + nh = nt = p; + else + { + nt->next = p; + nt = nt->next; + } + } + + if (coproc_list.ncoproc == 0) + coproc_list.head = coproc_list.tail = 0; + else + { + if (nt) + nt->next = 0; + coproc_list.head = nh; + coproc_list.tail = nt; + if (coproc_list.ncoproc == 1) + coproc_list.tail = coproc_list.head; /* just to make sure */ + } +} + +/* Clear out the list of saved statuses */ +static void +cpl_flush () +{ + struct cpelement *cpe, *p; + + for (cpe = coproc_list.head; cpe; ) + { + p = cpe; + cpe = cpe->next; + + coproc_dispose (p->coproc); + cpe_dispose (p); + } + + coproc_list.head = coproc_list.tail = 0; + coproc_list.ncoproc = 0; +} + +static void +cpl_closeall () +{ + struct cpelement *cpe; + + for (cpe = coproc_list.head; cpe; cpe = cpe->next) + coproc_close (cpe->coproc); +} + +static void +cpl_fdchk (fd) + int fd; +{ + struct cpelement *cpe; + + for (cpe = coproc_list.head; cpe; cpe = cpe->next) + coproc_checkfd (cpe->coproc, fd); +} + +/* Search for PID in the list of coprocs; return the cpelement struct if + found. If not found, return NULL. */ +static struct cpelement * +cpl_search (pid) + pid_t pid; +{ + struct cpelement *cpe; + + for (cpe = coproc_list.head ; cpe; cpe = cpe->next) + if (cpe->coproc->c_pid == pid) + return cpe; + return (struct cpelement *)NULL; +} + +/* Search for the coproc named NAME in the list of coprocs; return the + cpelement struct if found. If not found, return NULL. */ +static struct cpelement * +cpl_searchbyname (name) + const char *name; +{ + struct cpelement *cp; + + for (cp = coproc_list.head ; cp; cp = cp->next) + if (STREQ (cp->coproc->c_name, name)) + return cp; + return (struct cpelement *)NULL; +} + +#if 0 +static void +cpl_prune () +{ + struct cpelement *cp; + + while (coproc_list.head && coproc_list.ncoproc > COPROC_MAX) + { + cp = coproc_list.head; + coproc_list.head = coproc_list.head->next; + coproc_dispose (cp->coproc); + cpe_dispose (cp); + coproc_list.ncoproc--; + } +} +#endif + +/* These currently use a single global "shell coproc" but are written in a + way to not preclude additional coprocs later (using the list management + package above). */ + +struct coproc * +getcoprocbypid (pid) + pid_t pid; +{ +#if MULTIPLE_COPROCS + struct cpelement *p; + + p = cpl_search (pid); + return (p ? p->coproc : 0); +#else + return (pid == sh_coproc.c_pid ? &sh_coproc : 0); +#endif +} + +struct coproc * +getcoprocbyname (name) + const char *name; +{ +#if MULTIPLE_COPROCS + struct cpelement *p; + + p = cpl_searchbyname (name); + return (p ? p->coproc : 0); +#else + return ((sh_coproc.c_name && STREQ (sh_coproc.c_name, name)) ? &sh_coproc : 0); +#endif +} + +void +coproc_init (cp) + struct coproc *cp; +{ + cp->c_name = 0; + cp->c_pid = NO_PID; + cp->c_rfd = cp->c_wfd = -1; + cp->c_rsave = cp->c_wsave = -1; + cp->c_flags = cp->c_status = cp->c_lock = 0; +} + +struct coproc * +coproc_alloc (name, pid) + char *name; + pid_t pid; +{ + struct coproc *cp; + +#if MULTIPLE_COPROCS + cp = (struct coproc *)xmalloc (sizeof (struct coproc)); +#else + cp = &sh_coproc; +#endif + coproc_init (cp); + cp->c_lock = 2; + + cp->c_pid = pid; + cp->c_name = savestring (name); +#if MULTIPLE_COPROCS + cpl_add (cp); +#endif + cp->c_lock = 0; + return (cp); +} + +static void +coproc_free (cp) + struct coproc *cp; +{ + free (cp); +} + +void +coproc_dispose (cp) + struct coproc *cp; +{ + sigset_t set, oset; + + if (cp == 0) + return; + + BLOCK_SIGNAL (SIGCHLD, set, oset); + cp->c_lock = 3; + coproc_unsetvars (cp); + FREE (cp->c_name); + coproc_close (cp); +#if MULTIPLE_COPROCS + coproc_free (cp); +#else + coproc_init (cp); + cp->c_lock = 0; +#endif + UNBLOCK_SIGNAL (oset); +} + +/* Placeholder for now. Will require changes for multiple coprocs */ +void +coproc_flush () +{ +#if MULTIPLE_COPROCS + cpl_flush (); +#else + coproc_dispose (&sh_coproc); +#endif +} + +void +coproc_close (cp) + struct coproc *cp; +{ + if (cp->c_rfd >= 0) + { + close (cp->c_rfd); + cp->c_rfd = -1; + } + if (cp->c_wfd >= 0) + { + close (cp->c_wfd); + cp->c_wfd = -1; + } + cp->c_rsave = cp->c_wsave = -1; +} + +void +coproc_closeall () +{ +#if MULTIPLE_COPROCS + cpl_closeall (); +#else + coproc_close (&sh_coproc); /* XXX - will require changes for multiple coprocs */ +#endif +} + +void +coproc_reap () +{ +#if MULTIPLE_COPROCS + cpl_reap (); +#else + struct coproc *cp; + + cp = &sh_coproc; /* XXX - will require changes for multiple coprocs */ + if (cp && (cp->c_flags & COPROC_DEAD)) + coproc_dispose (cp); +#endif +} + +void +coproc_rclose (cp, fd) + struct coproc *cp; + int fd; +{ + if (cp->c_rfd >= 0 && cp->c_rfd == fd) + { + close (cp->c_rfd); + cp->c_rfd = -1; + } +} + +void +coproc_wclose (cp, fd) + struct coproc *cp; + int fd; +{ + if (cp->c_wfd >= 0 && cp->c_wfd == fd) + { + close (cp->c_wfd); + cp->c_wfd = -1; + } +} + +void +coproc_checkfd (cp, fd) + struct coproc *cp; + int fd; +{ + int update; + + update = 0; + if (cp->c_rfd >= 0 && cp->c_rfd == fd) + update = cp->c_rfd = -1; + if (cp->c_wfd >= 0 && cp->c_wfd == fd) + update = cp->c_wfd = -1; + if (update) + coproc_setvars (cp); +} + +void +coproc_fdchk (fd) + int fd; +{ +#if MULTIPLE_COPROCS + cpl_fdchk (fd); +#else + coproc_checkfd (&sh_coproc, fd); +#endif +} + +void +coproc_fdclose (cp, fd) + struct coproc *cp; + int fd; +{ + coproc_rclose (cp, fd); + coproc_wclose (cp, fd); + coproc_setvars (cp); +} + +void +coproc_fdsave (cp) + struct coproc *cp; +{ + cp->c_rsave = cp->c_rfd; + cp->c_wsave = cp->c_wfd; +} + +void +coproc_fdrestore (cp) + struct coproc *cp; +{ + cp->c_rfd = cp->c_rsave; + cp->c_wfd = cp->c_wsave; +} + +void +coproc_pidchk (pid, status) + pid_t pid; +{ + struct coproc *cp; + +#if MULTIPLE_COPROCS + struct cpelement *cpe; + + cpe = cpl_delete (pid); + cp = cpe ? cpe->coproc : 0; +#else + cp = getcoprocbypid (pid); +#endif + if (cp) + { + cp->c_lock = 4; + cp->c_status = status; + cp->c_flags |= COPROC_DEAD; + cp->c_flags &= ~COPROC_RUNNING; + /* Don't dispose the coproc or unset the COPROC_XXX variables because + this is executed in a signal handler context. Wait until coproc_reap + takes care of it. */ + cp->c_lock = 0; + } +} + +void +coproc_setvars (cp) + struct coproc *cp; +{ + SHELL_VAR *v; + char *namevar, *t; + int l; +#if defined (ARRAY_VARS) + arrayind_t ind; +#endif + + if (cp->c_name == 0) + return; + + l = strlen (cp->c_name); + namevar = xmalloc (l + 16); + +#if defined (ARRAY_VARS) + v = find_variable (cp->c_name); + if (v == 0) + v = make_new_array_variable (cp->c_name); + if (array_p (v) == 0) + v = convert_var_to_array (v); + + t = itos (cp->c_rfd); + ind = 0; + v = bind_array_variable (cp->c_name, ind, t, 0); + free (t); + + t = itos (cp->c_wfd); + ind = 1; + bind_array_variable (cp->c_name, ind, t, 0); + free (t); +#else + sprintf (namevar, "%s_READ", cp->c_name); + t = itos (cp->c_rfd); + bind_variable (namevar, t, 0); + free (t); + sprintf (namevar, "%s_WRITE", cp->c_name); + t = itos (cp->c_wfd); + bind_variable (namevar, t, 0); + free (t); +#endif + + sprintf (namevar, "%s_PID", cp->c_name); + t = itos (cp->c_pid); + bind_variable (namevar, t, 0); + free (t); + + free (namevar); +} + +void +coproc_unsetvars (cp) + struct coproc *cp; +{ + int l; + char *namevar; + + if (cp->c_name == 0) + return; + + l = strlen (cp->c_name); + namevar = xmalloc (l + 16); + + sprintf (namevar, "%s_PID", cp->c_name); + unbind_variable (namevar); + +#if defined (ARRAY_VARS) + unbind_variable (cp->c_name); +#else + sprintf (namevar, "%s_READ", cp->c_name); + unbind_variable (namevar); + sprintf (namevar, "%s_WRITE", cp->c_name); + unbind_variable (namevar); +#endif + + free (namevar); +} + +static int +execute_coproc (command, pipe_in, pipe_out, fds_to_close) + COMMAND *command; + int pipe_in, pipe_out; + struct fd_bitmap *fds_to_close; +{ + int rpipe[2], wpipe[2], estat, invert; + pid_t coproc_pid; + Coproc *cp; + char *tcmd; + sigset_t set, oset; + + /* XXX -- can be removed after changes to handle multiple coprocs */ +#if !MULTIPLE_COPROCS + if (sh_coproc.c_pid != NO_PID) + internal_warning ("execute_coproc: coproc [%d:%s] still exists", sh_coproc.c_pid, sh_coproc.c_name); + coproc_init (&sh_coproc); +#endif + + invert = (command->flags & CMD_INVERT_RETURN) != 0; + command_string_index = 0; + tcmd = make_command_string (command); + + sh_openpipe ((int *)&rpipe); /* 0 = parent read, 1 = child write */ + sh_openpipe ((int *)&wpipe); /* 0 = child read, 1 = parent write */ + + BLOCK_SIGNAL (SIGCHLD, set, oset); + + coproc_pid = make_child (savestring (tcmd), 1); + + if (coproc_pid == 0) + { + close (rpipe[0]); + close (wpipe[1]); + + UNBLOCK_SIGNAL (oset); + estat = execute_in_subshell (command, 1, wpipe[0], rpipe[1], fds_to_close); + + fflush (stdout); + fflush (stderr); + + exit (estat); + } + + close (rpipe[1]); + close (wpipe[0]); + + /* XXX - possibly run Coproc->name through word expansion? */ + cp = coproc_alloc (command->value.Coproc->name, coproc_pid); + cp->c_rfd = rpipe[0]; + cp->c_wfd = wpipe[1]; + + SET_CLOSE_ON_EXEC (cp->c_rfd); + SET_CLOSE_ON_EXEC (cp->c_wfd); + + coproc_setvars (cp); + + UNBLOCK_SIGNAL (oset); + +#if 0 + itrace ("execute_coproc: [%d] %s", coproc_pid, the_printed_command); +#endif + + close_pipes (pipe_in, pipe_out); +#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD) + unlink_fifo_list (); +#endif + stop_pipeline (1, (COMMAND *)NULL); + DESCRIBE_PID (coproc_pid); + run_pending_traps (); + + return (invert ? EXECUTION_FAILURE : EXECUTION_SUCCESS); +} +#endif + +static void +restore_stdin (s) + int s; +{ + dup2 (s, 0); + close (s); +} + +/* Catch-all cleanup function for lastpipe code for unwind-protects */ +static void +lastpipe_cleanup (s) + int s; +{ + unfreeze_jobs_list (); +} + +static int +execute_pipeline (command, asynchronous, pipe_in, pipe_out, fds_to_close) + COMMAND *command; + int asynchronous, pipe_in, pipe_out; + struct fd_bitmap *fds_to_close; +{ + int prev, fildes[2], new_bitmap_size, dummyfd, ignore_return, exec_result; + int lstdin, lastpipe_flag, lastpipe_jid; + COMMAND *cmd; + struct fd_bitmap *fd_bitmap; + pid_t lastpid; + +#if defined (JOB_CONTROL) + sigset_t set, oset; + BLOCK_CHILD (set, oset); +#endif /* JOB_CONTROL */ + + ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0; + + prev = pipe_in; + cmd = command; + + while (cmd && cmd->type == cm_connection && + cmd->value.Connection && cmd->value.Connection->connector == '|') + { + /* Make a pipeline between the two commands. */ + if (pipe (fildes) < 0) + { + sys_error (_("pipe error")); +#if defined (JOB_CONTROL) + terminate_current_pipeline (); + kill_current_pipeline (); + UNBLOCK_CHILD (oset); +#endif /* JOB_CONTROL */ + last_command_exit_value = EXECUTION_FAILURE; + /* The unwind-protects installed below will take care + of closing all of the open file descriptors. */ + throw_to_top_level (); + return (EXECUTION_FAILURE); /* XXX */ + } + + /* Here is a problem: with the new file close-on-exec + code, the read end of the pipe (fildes[0]) stays open + in the first process, so that process will never get a + SIGPIPE. There is no way to signal the first process + that it should close fildes[0] after forking, so it + remains open. No SIGPIPE is ever sent because there + is still a file descriptor open for reading connected + to the pipe. We take care of that here. This passes + around a bitmap of file descriptors that must be + closed after making a child process in execute_simple_command. */ + + /* We need fd_bitmap to be at least as big as fildes[0]. + If fildes[0] is less than fds_to_close->size, then + use fds_to_close->size. */ + new_bitmap_size = (fildes[0] < fds_to_close->size) + ? fds_to_close->size + : fildes[0] + 8; + + fd_bitmap = new_fd_bitmap (new_bitmap_size); + + /* Now copy the old information into the new bitmap. */ + xbcopy ((char *)fds_to_close->bitmap, (char *)fd_bitmap->bitmap, fds_to_close->size); + + /* And mark the pipe file descriptors to be closed. */ + fd_bitmap->bitmap[fildes[0]] = 1; + + /* In case there are pipe or out-of-processes errors, we + want all these file descriptors to be closed when + unwind-protects are run, and the storage used for the + bitmaps freed up. */ + begin_unwind_frame ("pipe-file-descriptors"); + add_unwind_protect (dispose_fd_bitmap, fd_bitmap); + add_unwind_protect (close_fd_bitmap, fd_bitmap); + if (prev >= 0) + add_unwind_protect (close, prev); + dummyfd = fildes[1]; + add_unwind_protect (close, dummyfd); + +#if defined (JOB_CONTROL) + add_unwind_protect (restore_signal_mask, &oset); +#endif /* JOB_CONTROL */ + + if (ignore_return && cmd->value.Connection->first) + cmd->value.Connection->first->flags |= CMD_IGNORE_RETURN; + execute_command_internal (cmd->value.Connection->first, asynchronous, + prev, fildes[1], fd_bitmap); + + if (prev >= 0) + close (prev); + + prev = fildes[0]; + close (fildes[1]); + + dispose_fd_bitmap (fd_bitmap); + discard_unwind_frame ("pipe-file-descriptors"); + + cmd = cmd->value.Connection->second; + } + + lastpid = last_made_pid; + + /* Now execute the rightmost command in the pipeline. */ + if (ignore_return && cmd) + cmd->flags |= CMD_IGNORE_RETURN; + + lastpipe_flag = 0; + + begin_unwind_frame ("lastpipe-exec"); + lstdin = -1; + /* If the `lastpipe' option is set with shopt, and job control is not + enabled, execute the last element of non-async pipelines in the + current shell environment. */ + if (lastpipe_opt && job_control == 0 && asynchronous == 0 && pipe_out == NO_PIPE && prev > 0) + { + lstdin = move_to_high_fd (0, 1, -1); + if (lstdin > 0) + { + do_piping (prev, pipe_out); + prev = NO_PIPE; + add_unwind_protect (restore_stdin, lstdin); + lastpipe_flag = 1; + freeze_jobs_list (); + lastpipe_jid = stop_pipeline (0, (COMMAND *)NULL); /* XXX */ + add_unwind_protect (lastpipe_cleanup, lastpipe_jid); + } + if (cmd) + cmd->flags |= CMD_LASTPIPE; + } + if (prev >= 0) + add_unwind_protect (close, prev); + + exec_result = execute_command_internal (cmd, asynchronous, prev, pipe_out, fds_to_close); + + if (lstdin > 0) + restore_stdin (lstdin); + + if (prev >= 0) + close (prev); + +#if defined (JOB_CONTROL) + UNBLOCK_CHILD (oset); +#endif + + QUIT; + + if (lastpipe_flag) + { +#if defined (JOB_CONTROL) + append_process (savestring (the_printed_command), dollar_dollar_pid, exec_result, lastpipe_jid); +#endif + lstdin = wait_for (lastpid); +#if defined (JOB_CONTROL) + exec_result = job_exit_status (lastpipe_jid); +#endif + unfreeze_jobs_list (); + } + + discard_unwind_frame ("lastpipe-exec"); + + return (exec_result); +} + +static int +execute_connection (command, asynchronous, pipe_in, pipe_out, fds_to_close) + COMMAND *command; + int asynchronous, pipe_in, pipe_out; + struct fd_bitmap *fds_to_close; +{ + COMMAND *tc, *second; + int ignore_return, exec_result, was_error_trap, invert; + volatile int save_line_number; + + ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0; + + switch (command->value.Connection->connector) + { + /* Do the first command asynchronously. */ + case '&': + tc = command->value.Connection->first; + if (tc == 0) + return (EXECUTION_SUCCESS); + + if (ignore_return) + tc->flags |= CMD_IGNORE_RETURN; + tc->flags |= CMD_AMPERSAND; + + /* If this shell was compiled without job control support, + if we are currently in a subshell via `( xxx )', or if job + control is not active then the standard input for an + asynchronous command is forced to /dev/null. */ +#if defined (JOB_CONTROL) + if ((subshell_environment || !job_control) && !stdin_redir) +#else + if (!stdin_redir) +#endif /* JOB_CONTROL */ + tc->flags |= CMD_STDIN_REDIR; + + exec_result = execute_command_internal (tc, 1, pipe_in, pipe_out, fds_to_close); + QUIT; + + if (tc->flags & CMD_STDIN_REDIR) + tc->flags &= ~CMD_STDIN_REDIR; + + second = command->value.Connection->second; + if (second) + { + if (ignore_return) + second->flags |= CMD_IGNORE_RETURN; + + exec_result = execute_command_internal (second, asynchronous, pipe_in, pipe_out, fds_to_close); + } + + break; + + /* Just call execute command on both sides. */ + case ';': + if (ignore_return) + { + if (command->value.Connection->first) + command->value.Connection->first->flags |= CMD_IGNORE_RETURN; + if (command->value.Connection->second) + command->value.Connection->second->flags |= CMD_IGNORE_RETURN; + } + executing_list++; + QUIT; + execute_command (command->value.Connection->first); + QUIT; + exec_result = execute_command_internal (command->value.Connection->second, + asynchronous, pipe_in, pipe_out, + fds_to_close); + executing_list--; + break; + + case '|': + was_error_trap = signal_is_trapped (ERROR_TRAP) && signal_is_ignored (ERROR_TRAP) == 0; + invert = (command->flags & CMD_INVERT_RETURN) != 0; + ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0; + + line_number_for_err_trap = line_number; + exec_result = execute_pipeline (command, asynchronous, pipe_in, pipe_out, fds_to_close); + + if (was_error_trap && ignore_return == 0 && invert == 0 && exec_result != EXECUTION_SUCCESS) + { + last_command_exit_value = exec_result; + save_line_number = line_number; + line_number = line_number_for_err_trap; + run_error_trap (); + line_number = save_line_number; + } + + if (ignore_return == 0 && invert == 0 && exit_immediately_on_error && exec_result != EXECUTION_SUCCESS) + { + last_command_exit_value = exec_result; + run_pending_traps (); + jump_to_top_level (ERREXIT); + } + + break; + + case AND_AND: + case OR_OR: + if (asynchronous) + { + /* If we have something like `a && b &' or `a || b &', run the + && or || stuff in a subshell. Force a subshell and just call + execute_command_internal again. Leave asynchronous on + so that we get a report from the parent shell about the + background job. */ + command->flags |= CMD_FORCE_SUBSHELL; + exec_result = execute_command_internal (command, 1, pipe_in, pipe_out, fds_to_close); + break; + } + + /* Execute the first command. If the result of that is successful + and the connector is AND_AND, or the result is not successful + and the connector is OR_OR, then execute the second command, + otherwise return. */ + + executing_list++; + if (command->value.Connection->first) + command->value.Connection->first->flags |= CMD_IGNORE_RETURN; + + exec_result = execute_command (command->value.Connection->first); + QUIT; + if (((command->value.Connection->connector == AND_AND) && + (exec_result == EXECUTION_SUCCESS)) || + ((command->value.Connection->connector == OR_OR) && + (exec_result != EXECUTION_SUCCESS))) + { + if (ignore_return && command->value.Connection->second) + command->value.Connection->second->flags |= CMD_IGNORE_RETURN; + + exec_result = execute_command (command->value.Connection->second); + } + executing_list--; + break; + + default: + command_error ("execute_connection", CMDERR_BADCONN, command->value.Connection->connector, 0); + jump_to_top_level (DISCARD); + exec_result = EXECUTION_FAILURE; + } + + return exec_result; +} + +#define REAP() \ + do \ + { \ + if (!interactive_shell) \ + reap_dead_jobs (); \ + } \ + while (0) + +/* Execute a FOR command. The syntax is: FOR word_desc IN word_list; + DO command; DONE */ +static int +execute_for_command (for_command) + FOR_COM *for_command; +{ + register WORD_LIST *releaser, *list; + SHELL_VAR *v; + char *identifier; + int retval, save_line_number; +#if 0 + SHELL_VAR *old_value = (SHELL_VAR *)NULL; /* Remember the old value of x. */ +#endif + + save_line_number = line_number; + if (check_identifier (for_command->name, 1) == 0) + { + if (posixly_correct && interactive_shell == 0) + { + last_command_exit_value = EX_BADUSAGE; + jump_to_top_level (ERREXIT); + } + return (EXECUTION_FAILURE); + } + + loop_level++; + identifier = for_command->name->word; + + line_number = for_command->line; /* for expansion error messages */ + list = releaser = expand_words_no_vars (for_command->map_list); + + begin_unwind_frame ("for"); + add_unwind_protect (dispose_words, releaser); + +#if 0 + if (lexical_scoping) + { + old_value = copy_variable (find_variable (identifier)); + if (old_value) + add_unwind_protect (dispose_variable, old_value); + } +#endif + + if (for_command->flags & CMD_IGNORE_RETURN) + for_command->action->flags |= CMD_IGNORE_RETURN; + + for (retval = EXECUTION_SUCCESS; list; list = list->next) + { + QUIT; + + line_number = for_command->line; + + /* Remember what this command looks like, for debugger. */ + command_string_index = 0; + print_for_command_head (for_command); + + if (echo_command_at_execute) + xtrace_print_for_command_head (for_command); + + /* Save this command unless it's a trap command and we're not running + a debug trap. */ + if (signal_in_progress (DEBUG_TRAP) == 0 && running_trap == 0) + { + FREE (the_printed_command_except_trap); + the_printed_command_except_trap = savestring (the_printed_command); + } + + retval = run_debug_trap (); +#if defined (DEBUGGER) + /* In debugging mode, if the DEBUG trap returns a non-zero status, we + skip the command. */ + if (debugging_mode && retval != EXECUTION_SUCCESS) + continue; +#endif + + this_command_name = (char *)NULL; + /* XXX - special ksh93 for command index variable handling */ + v = find_variable_last_nameref (identifier); + if (v && nameref_p (v)) + { + v = bind_variable_value (v, list->word->word, 0); + } + else + v = bind_variable (identifier, list->word->word, 0); + if (readonly_p (v) || noassign_p (v)) + { + line_number = save_line_number; + if (readonly_p (v) && interactive_shell == 0 && posixly_correct) + { + last_command_exit_value = EXECUTION_FAILURE; + jump_to_top_level (FORCE_EOF); + } + else + { + dispose_words (releaser); + discard_unwind_frame ("for"); + loop_level--; + return (EXECUTION_FAILURE); + } + } + retval = execute_command (for_command->action); + REAP (); + QUIT; + + if (breaking) + { + breaking--; + break; + } + + if (continuing) + { + continuing--; + if (continuing) + break; + } + } + + loop_level--; + line_number = save_line_number; + +#if 0 + if (lexical_scoping) + { + if (!old_value) + unbind_variable (identifier); + else + { + SHELL_VAR *new_value; + + new_value = bind_variable (identifier, value_cell(old_value), 0); + new_value->attributes = old_value->attributes; + dispose_variable (old_value); + } + } +#endif + + dispose_words (releaser); + discard_unwind_frame ("for"); + return (retval); +} + +#if defined (ARITH_FOR_COMMAND) +/* Execute an arithmetic for command. The syntax is + + for (( init ; step ; test )) + do + body + done + + The execution should be exactly equivalent to + + eval \(\( init \)\) + while eval \(\( test \)\) ; do + body; + eval \(\( step \)\) + done +*/ +static intmax_t +eval_arith_for_expr (l, okp) + WORD_LIST *l; + int *okp; +{ + WORD_LIST *new; + intmax_t expresult; + int r; + + new = expand_words_no_vars (l); + if (new) + { + if (echo_command_at_execute) + xtrace_print_arith_cmd (new); + this_command_name = "(("; /* )) for expression error messages */ + + command_string_index = 0; + print_arith_command (new); + if (signal_in_progress (DEBUG_TRAP) == 0) + { + FREE (the_printed_command_except_trap); + the_printed_command_except_trap = savestring (the_printed_command); + } + + r = run_debug_trap (); + /* In debugging mode, if the DEBUG trap returns a non-zero status, we + skip the command. */ +#if defined (DEBUGGER) + if (debugging_mode == 0 || r == EXECUTION_SUCCESS) + expresult = evalexp (new->word->word, okp); + else + { + expresult = 0; + if (okp) + *okp = 1; + } +#else + expresult = evalexp (new->word->word, okp); +#endif + dispose_words (new); + } + else + { + expresult = 0; + if (okp) + *okp = 1; + } + return (expresult); +} + +static int +execute_arith_for_command (arith_for_command) + ARITH_FOR_COM *arith_for_command; +{ + intmax_t expresult; + int expok, body_status, arith_lineno, save_lineno; + + body_status = EXECUTION_SUCCESS; + loop_level++; + save_lineno = line_number; + + if (arith_for_command->flags & CMD_IGNORE_RETURN) + arith_for_command->action->flags |= CMD_IGNORE_RETURN; + + this_command_name = "(("; /* )) for expression error messages */ + + /* save the starting line number of the command so we can reset + line_number before executing each expression -- for $LINENO + and the DEBUG trap. */ + line_number = arith_lineno = arith_for_command->line; + if (variable_context && interactive_shell) + line_number -= function_line_number; + + /* Evaluate the initialization expression. */ + expresult = eval_arith_for_expr (arith_for_command->init, &expok); + if (expok == 0) + { + line_number = save_lineno; + return (EXECUTION_FAILURE); + } + + while (1) + { + /* Evaluate the test expression. */ + line_number = arith_lineno; + expresult = eval_arith_for_expr (arith_for_command->test, &expok); + line_number = save_lineno; + + if (expok == 0) + { + body_status = EXECUTION_FAILURE; + break; + } + REAP (); + if (expresult == 0) + break; + + /* Execute the body of the arithmetic for command. */ + QUIT; + body_status = execute_command (arith_for_command->action); + QUIT; + + /* Handle any `break' or `continue' commands executed by the body. */ + if (breaking) + { + breaking--; + break; + } + + if (continuing) + { + continuing--; + if (continuing) + break; + } + + /* Evaluate the step expression. */ + line_number = arith_lineno; + expresult = eval_arith_for_expr (arith_for_command->step, &expok); + line_number = save_lineno; + + if (expok == 0) + { + body_status = EXECUTION_FAILURE; + break; + } + } + + loop_level--; + line_number = save_lineno; + + return (body_status); +} +#endif + +#if defined (SELECT_COMMAND) +static int LINES, COLS, tabsize; + +#define RP_SPACE ") " +#define RP_SPACE_LEN 2 + +/* XXX - does not handle numbers > 1000000 at all. */ +#define NUMBER_LEN(s) \ +((s < 10) ? 1 \ + : ((s < 100) ? 2 \ + : ((s < 1000) ? 3 \ + : ((s < 10000) ? 4 \ + : ((s < 100000) ? 5 \ + : 6))))) + +static int +displen (s) + const char *s; +{ +#if defined (HANDLE_MULTIBYTE) + wchar_t *wcstr; + size_t slen; + int wclen; + + wcstr = 0; + slen = mbstowcs (wcstr, s, 0); + if (slen == -1) + slen = 0; + wcstr = (wchar_t *)xmalloc (sizeof (wchar_t) * (slen + 1)); + mbstowcs (wcstr, s, slen + 1); + wclen = wcswidth (wcstr, slen); + free (wcstr); + return (wclen < 0 ? STRLEN(s) : wclen); +#else + return (STRLEN (s)); +#endif +} + +static int +print_index_and_element (len, ind, list) + int len, ind; + WORD_LIST *list; +{ + register WORD_LIST *l; + register int i; + + if (list == 0) + return (0); + for (i = ind, l = list; l && --i; l = l->next) + ; + if (l == 0) /* don't think this can happen */ + return (0); + fprintf (stderr, "%*d%s%s", len, ind, RP_SPACE, l->word->word); + return (displen (l->word->word)); +} + +static void +indent (from, to) + int from, to; +{ + while (from < to) + { + if ((to / tabsize) > (from / tabsize)) + { + putc ('\t', stderr); + from += tabsize - from % tabsize; + } + else + { + putc (' ', stderr); + from++; + } + } +} + +static void +print_select_list (list, list_len, max_elem_len, indices_len) + WORD_LIST *list; + int list_len, max_elem_len, indices_len; +{ + int ind, row, elem_len, pos, cols, rows; + int first_column_indices_len, other_indices_len; + + if (list == 0) + { + putc ('\n', stderr); + return; + } + + cols = max_elem_len ? COLS / max_elem_len : 1; + if (cols == 0) + cols = 1; + rows = list_len ? list_len / cols + (list_len % cols != 0) : 1; + cols = list_len ? list_len / rows + (list_len % rows != 0) : 1; + + if (rows == 1) + { + rows = cols; + cols = 1; + } + + first_column_indices_len = NUMBER_LEN (rows); + other_indices_len = indices_len; + + for (row = 0; row < rows; row++) + { + ind = row; + pos = 0; + while (1) + { + indices_len = (pos == 0) ? first_column_indices_len : other_indices_len; + elem_len = print_index_and_element (indices_len, ind + 1, list); + elem_len += indices_len + RP_SPACE_LEN; + ind += rows; + if (ind >= list_len) + break; + indent (pos + elem_len, pos + max_elem_len); + pos += max_elem_len; + } + putc ('\n', stderr); + } +} + +/* Print the elements of LIST, one per line, preceded by an index from 1 to + LIST_LEN. Then display PROMPT and wait for the user to enter a number. + If the number is between 1 and LIST_LEN, return that selection. If EOF + is read, return a null string. If a blank line is entered, or an invalid + number is entered, the loop is executed again. */ +static char * +select_query (list, list_len, prompt, print_menu) + WORD_LIST *list; + int list_len; + char *prompt; + int print_menu; +{ + int max_elem_len, indices_len, len; + intmax_t reply; + WORD_LIST *l; + char *repl_string, *t; + +#if 0 + t = get_string_value ("LINES"); + LINES = (t && *t) ? atoi (t) : 24; +#endif + t = get_string_value ("COLUMNS"); + COLS = (t && *t) ? atoi (t) : 80; + +#if 0 + t = get_string_value ("TABSIZE"); + tabsize = (t && *t) ? atoi (t) : 8; + if (tabsize <= 0) + tabsize = 8; +#else + tabsize = 8; +#endif + + max_elem_len = 0; + for (l = list; l; l = l->next) + { + len = displen (l->word->word); + if (len > max_elem_len) + max_elem_len = len; + } + indices_len = NUMBER_LEN (list_len); + max_elem_len += indices_len + RP_SPACE_LEN + 2; + + while (1) + { + if (print_menu) + print_select_list (list, list_len, max_elem_len, indices_len); + fprintf (stderr, "%s", prompt); + fflush (stderr); + QUIT; + + if (read_builtin ((WORD_LIST *)NULL) != EXECUTION_SUCCESS) + { + putchar ('\n'); + return ((char *)NULL); + } + repl_string = get_string_value ("REPLY"); + if (*repl_string == 0) + { + print_menu = 1; + continue; + } + if (legal_number (repl_string, &reply) == 0) + return ""; + if (reply < 1 || reply > list_len) + return ""; + + for (l = list; l && --reply; l = l->next) + ; + return (l->word->word); /* XXX - can't be null? */ + } +} + +/* Execute a SELECT command. The syntax is: + SELECT word IN list DO command_list DONE + Only `break' or `return' in command_list will terminate + the command. */ +static int +execute_select_command (select_command) + SELECT_COM *select_command; +{ + WORD_LIST *releaser, *list; + SHELL_VAR *v; + char *identifier, *ps3_prompt, *selection; + int retval, list_len, show_menu, save_line_number; + + if (check_identifier (select_command->name, 1) == 0) + return (EXECUTION_FAILURE); + + save_line_number = line_number; + line_number = select_command->line; + + command_string_index = 0; + print_select_command_head (select_command); + + if (echo_command_at_execute) + xtrace_print_select_command_head (select_command); + +#if 0 + if (signal_in_progress (DEBUG_TRAP) == 0 && (this_command_name == 0 || (STREQ (this_command_name, "trap") == 0))) +#else + if (signal_in_progress (DEBUG_TRAP) == 0 && running_trap == 0) +#endif + { + FREE (the_printed_command_except_trap); + the_printed_command_except_trap = savestring (the_printed_command); + } + + retval = run_debug_trap (); +#if defined (DEBUGGER) + /* In debugging mode, if the DEBUG trap returns a non-zero status, we + skip the command. */ + if (debugging_mode && retval != EXECUTION_SUCCESS) + return (EXECUTION_SUCCESS); +#endif + + loop_level++; + identifier = select_command->name->word; + + /* command and arithmetic substitution, parameter and variable expansion, + word splitting, pathname expansion, and quote removal. */ + list = releaser = expand_words_no_vars (select_command->map_list); + list_len = list_length (list); + if (list == 0 || list_len == 0) + { + if (list) + dispose_words (list); + line_number = save_line_number; + return (EXECUTION_SUCCESS); + } + + begin_unwind_frame ("select"); + add_unwind_protect (dispose_words, releaser); + + if (select_command->flags & CMD_IGNORE_RETURN) + select_command->action->flags |= CMD_IGNORE_RETURN; + + retval = EXECUTION_SUCCESS; + show_menu = 1; + + while (1) + { + line_number = select_command->line; + ps3_prompt = get_string_value ("PS3"); + if (ps3_prompt == 0) + ps3_prompt = "#? "; + + QUIT; + selection = select_query (list, list_len, ps3_prompt, show_menu); + QUIT; + if (selection == 0) + { + /* select_query returns EXECUTION_FAILURE if the read builtin + fails, so we want to return failure in this case. */ + retval = EXECUTION_FAILURE; + break; + } + + v = bind_variable (identifier, selection, 0); + if (readonly_p (v) || noassign_p (v)) + { + if (readonly_p (v) && interactive_shell == 0 && posixly_correct) + { + last_command_exit_value = EXECUTION_FAILURE; + jump_to_top_level (FORCE_EOF); + } + else + { + dispose_words (releaser); + discard_unwind_frame ("select"); + loop_level--; + line_number = save_line_number; + return (EXECUTION_FAILURE); + } + } + + retval = execute_command (select_command->action); + + REAP (); + QUIT; + + if (breaking) + { + breaking--; + break; + } + + if (continuing) + { + continuing--; + if (continuing) + break; + } + +#if defined (KSH_COMPATIBLE_SELECT) + show_menu = 0; + selection = get_string_value ("REPLY"); + if (selection && *selection == '\0') + show_menu = 1; +#endif + } + + loop_level--; + line_number = save_line_number; + + dispose_words (releaser); + discard_unwind_frame ("select"); + return (retval); +} +#endif /* SELECT_COMMAND */ + +/* Execute a CASE command. The syntax is: CASE word_desc IN pattern_list ESAC. + The pattern_list is a linked list of pattern clauses; each clause contains + some patterns to compare word_desc against, and an associated command to + execute. */ +static int +execute_case_command (case_command) + CASE_COM *case_command; +{ + register WORD_LIST *list; + WORD_LIST *wlist, *es; + PATTERN_LIST *clauses; + char *word, *pattern; + int retval, match, ignore_return, save_line_number; + + save_line_number = line_number; + line_number = case_command->line; + + command_string_index = 0; + print_case_command_head (case_command); + + if (echo_command_at_execute) + xtrace_print_case_command_head (case_command); + +#if 0 + if (signal_in_progress (DEBUG_TRAP) == 0 && (this_command_name == 0 || (STREQ (this_command_name, "trap") == 0))) +#else + if (signal_in_progress (DEBUG_TRAP) == 0 && running_trap == 0) +#endif + { + FREE (the_printed_command_except_trap); + the_printed_command_except_trap = savestring (the_printed_command); + } + + retval = run_debug_trap(); +#if defined (DEBUGGER) + /* In debugging mode, if the DEBUG trap returns a non-zero status, we + skip the command. */ + if (debugging_mode && retval != EXECUTION_SUCCESS) + { + line_number = save_line_number; + return (EXECUTION_SUCCESS); + } +#endif + + wlist = expand_word_unsplit (case_command->word, 0); + word = wlist ? string_list (wlist) : savestring (""); + dispose_words (wlist); + + retval = EXECUTION_SUCCESS; + ignore_return = case_command->flags & CMD_IGNORE_RETURN; + + begin_unwind_frame ("case"); + add_unwind_protect ((Function *)xfree, word); + +#define EXIT_CASE() goto exit_case_command + + for (clauses = case_command->clauses; clauses; clauses = clauses->next) + { + QUIT; + for (list = clauses->patterns; list; list = list->next) + { + es = expand_word_leave_quoted (list->word, 0); + + if (es && es->word && es->word->word && *(es->word->word)) + pattern = quote_string_for_globbing (es->word->word, QGLOB_CVTNULL); + else + { + pattern = (char *)xmalloc (1); + pattern[0] = '\0'; + } + + /* Since the pattern does not undergo quote removal (as per + Posix.2, section 3.9.4.3), the strmatch () call must be able + to recognize backslashes as escape characters. */ + match = strmatch (pattern, word, FNMATCH_EXTFLAG|FNMATCH_IGNCASE) != FNM_NOMATCH; + free (pattern); + + dispose_words (es); + + if (match) + { + do + { + if (clauses->action && ignore_return) + clauses->action->flags |= CMD_IGNORE_RETURN; + retval = execute_command (clauses->action); + } + while ((clauses->flags & CASEPAT_FALLTHROUGH) && (clauses = clauses->next)); + if (clauses == 0 || (clauses->flags & CASEPAT_TESTNEXT) == 0) + EXIT_CASE (); + else + break; + } + + QUIT; + } + } + +exit_case_command: + free (word); + discard_unwind_frame ("case"); + line_number = save_line_number; + return (retval); +} + +#define CMD_WHILE 0 +#define CMD_UNTIL 1 + +/* The WHILE command. Syntax: WHILE test DO action; DONE. + Repeatedly execute action while executing test produces + EXECUTION_SUCCESS. */ +static int +execute_while_command (while_command) + WHILE_COM *while_command; +{ + return (execute_while_or_until (while_command, CMD_WHILE)); +} + +/* UNTIL is just like WHILE except that the test result is negated. */ +static int +execute_until_command (while_command) + WHILE_COM *while_command; +{ + return (execute_while_or_until (while_command, CMD_UNTIL)); +} + +/* The body for both while and until. The only difference between the + two is that the test value is treated differently. TYPE is + CMD_WHILE or CMD_UNTIL. The return value for both commands should + be EXECUTION_SUCCESS if no commands in the body are executed, and + the status of the last command executed in the body otherwise. */ +static int +execute_while_or_until (while_command, type) + WHILE_COM *while_command; + int type; +{ + int return_value, body_status; + + body_status = EXECUTION_SUCCESS; + loop_level++; + + while_command->test->flags |= CMD_IGNORE_RETURN; + if (while_command->flags & CMD_IGNORE_RETURN) + while_command->action->flags |= CMD_IGNORE_RETURN; + + while (1) + { + return_value = execute_command (while_command->test); + REAP (); + + /* Need to handle `break' in the test when we would break out of the + loop. The job control code will set `breaking' to loop_level + when a job in a loop is stopped with SIGTSTP. If the stopped job + is in the loop test, `breaking' will not be reset unless we do + this, and the shell will cease to execute commands. */ + if (type == CMD_WHILE && return_value != EXECUTION_SUCCESS) + { + if (breaking) + breaking--; + break; + } + if (type == CMD_UNTIL && return_value == EXECUTION_SUCCESS) + { + if (breaking) + breaking--; + break; + } + + QUIT; + body_status = execute_command (while_command->action); + QUIT; + + if (breaking) + { + breaking--; + break; + } + + if (continuing) + { + continuing--; + if (continuing) + break; + } + } + loop_level--; + + return (body_status); +} + +/* IF test THEN command [ELSE command]. + IF also allows ELIF in the place of ELSE IF, but + the parser makes *that* stupidity transparent. */ +static int +execute_if_command (if_command) + IF_COM *if_command; +{ + int return_value, save_line_number; + + save_line_number = line_number; + if_command->test->flags |= CMD_IGNORE_RETURN; + return_value = execute_command (if_command->test); + line_number = save_line_number; + + if (return_value == EXECUTION_SUCCESS) + { + QUIT; + + if (if_command->true_case && (if_command->flags & CMD_IGNORE_RETURN)) + if_command->true_case->flags |= CMD_IGNORE_RETURN; + + return (execute_command (if_command->true_case)); + } + else + { + QUIT; + + if (if_command->false_case && (if_command->flags & CMD_IGNORE_RETURN)) + if_command->false_case->flags |= CMD_IGNORE_RETURN; + + return (execute_command (if_command->false_case)); + } +} + +#if defined (DPAREN_ARITHMETIC) +static int +execute_arith_command (arith_command) + ARITH_COM *arith_command; +{ + int expok, save_line_number, retval; + intmax_t expresult; + WORD_LIST *new; + char *exp; + + expresult = 0; + + save_line_number = line_number; + this_command_name = "(("; /* )) */ + line_number = arith_command->line; + /* If we're in a function, update the line number information. */ + if (variable_context && interactive_shell) + line_number -= function_line_number; + + command_string_index = 0; + print_arith_command (arith_command->exp); + + if (signal_in_progress (DEBUG_TRAP) == 0) + { + FREE (the_printed_command_except_trap); + the_printed_command_except_trap = savestring (the_printed_command); + } + + /* Run the debug trap before each arithmetic command, but do it after we + update the line number information and before we expand the various + words in the expression. */ + retval = run_debug_trap (); +#if defined (DEBUGGER) + /* In debugging mode, if the DEBUG trap returns a non-zero status, we + skip the command. */ + if (debugging_mode && retval != EXECUTION_SUCCESS) + { + line_number = save_line_number; + return (EXECUTION_SUCCESS); + } +#endif + + new = expand_words_no_vars (arith_command->exp); + + /* If we're tracing, make a new word list with `((' at the front and `))' + at the back and print it. */ + if (echo_command_at_execute) + xtrace_print_arith_cmd (new); + + if (new) + { + exp = new->next ? string_list (new) : new->word->word; + expresult = evalexp (exp, &expok); + line_number = save_line_number; + if (exp != new->word->word) + free (exp); + dispose_words (new); + } + else + { + expresult = 0; + expok = 1; + } + + if (expok == 0) + return (EXECUTION_FAILURE); + + return (expresult == 0 ? EXECUTION_FAILURE : EXECUTION_SUCCESS); +} +#endif /* DPAREN_ARITHMETIC */ + +#if defined (COND_COMMAND) + +static char * const nullstr = ""; + +/* XXX - can COND ever be NULL when this is called? */ +static int +execute_cond_node (cond) + COND_COM *cond; +{ + int result, invert, patmatch, rmatch, mflags, ignore; + char *arg1, *arg2; +#if 0 + char *t1, *t2; +#endif + + invert = (cond->flags & CMD_INVERT_RETURN); + ignore = (cond->flags & CMD_IGNORE_RETURN); + if (ignore) + { + if (cond->left) + cond->left->flags |= CMD_IGNORE_RETURN; + if (cond->right) + cond->right->flags |= CMD_IGNORE_RETURN; + } + + if (cond->type == COND_EXPR) + result = execute_cond_node (cond->left); + else if (cond->type == COND_OR) + { + result = execute_cond_node (cond->left); + if (result != EXECUTION_SUCCESS) + result = execute_cond_node (cond->right); + } + else if (cond->type == COND_AND) + { + result = execute_cond_node (cond->left); + if (result == EXECUTION_SUCCESS) + result = execute_cond_node (cond->right); + } + else if (cond->type == COND_UNARY) + { + if (ignore) + comsub_ignore_return++; + arg1 = cond_expand_word (cond->left->op, 0); + if (ignore) + comsub_ignore_return--; + if (arg1 == 0) + arg1 = nullstr; + if (echo_command_at_execute) + xtrace_print_cond_term (cond->type, invert, cond->op, arg1, (char *)NULL); + result = unary_test (cond->op->word, arg1) ? EXECUTION_SUCCESS : EXECUTION_FAILURE; + if (arg1 != nullstr) + free (arg1); + } + else if (cond->type == COND_BINARY) + { + rmatch = 0; + patmatch = (((cond->op->word[1] == '=') && (cond->op->word[2] == '\0') && + (cond->op->word[0] == '!' || cond->op->word[0] == '=')) || + (cond->op->word[0] == '=' && cond->op->word[1] == '\0')); +#if defined (COND_REGEXP) + rmatch = (cond->op->word[0] == '=' && cond->op->word[1] == '~' && + cond->op->word[2] == '\0'); +#endif + + if (ignore) + comsub_ignore_return++; + arg1 = cond_expand_word (cond->left->op, 0); + if (ignore) + comsub_ignore_return--; + if (arg1 == 0) + arg1 = nullstr; + if (ignore) + comsub_ignore_return++; + arg2 = cond_expand_word (cond->right->op, + (rmatch && shell_compatibility_level > 31) ? 2 : (patmatch ? 1 : 0)); + if (ignore) + comsub_ignore_return--; + if (arg2 == 0) + arg2 = nullstr; + + if (echo_command_at_execute) + xtrace_print_cond_term (cond->type, invert, cond->op, arg1, arg2); + +#if defined (COND_REGEXP) + if (rmatch) + { + mflags = SHMAT_PWARN; +#if defined (ARRAY_VARS) + mflags |= SHMAT_SUBEXP; +#endif + +#if 0 + t1 = strescape(arg1); + t2 = strescape(arg2); + itrace("execute_cond_node: sh_regmatch on `%s' and `%s'", t1, t2); + free(t1); + free(t2); +#endif + + result = sh_regmatch (arg1, arg2, mflags); + } + else +#endif /* COND_REGEXP */ + { + int oe; + oe = extended_glob; + extended_glob = 1; + result = binary_test (cond->op->word, arg1, arg2, TEST_PATMATCH|TEST_ARITHEXP|TEST_LOCALE) + ? EXECUTION_SUCCESS + : EXECUTION_FAILURE; + extended_glob = oe; + } + if (arg1 != nullstr) + free (arg1); + if (arg2 != nullstr) + free (arg2); + } + else + { + command_error ("execute_cond_node", CMDERR_BADTYPE, cond->type, 0); + jump_to_top_level (DISCARD); + result = EXECUTION_FAILURE; + } + + if (invert) + result = (result == EXECUTION_SUCCESS) ? EXECUTION_FAILURE : EXECUTION_SUCCESS; + + return result; +} + +static int +execute_cond_command (cond_command) + COND_COM *cond_command; +{ + int retval, save_line_number; + + retval = EXECUTION_SUCCESS; + save_line_number = line_number; + + this_command_name = "[["; + line_number = cond_command->line; + /* If we're in a function, update the line number information. */ + if (variable_context && interactive_shell) + line_number -= function_line_number; + command_string_index = 0; + print_cond_command (cond_command); + + if (signal_in_progress (DEBUG_TRAP) == 0) + { + FREE (the_printed_command_except_trap); + the_printed_command_except_trap = savestring (the_printed_command); + } + + /* Run the debug trap before each conditional command, but do it after we + update the line number information. */ + retval = run_debug_trap (); +#if defined (DEBUGGER) + /* In debugging mode, if the DEBUG trap returns a non-zero status, we + skip the command. */ + if (debugging_mode && retval != EXECUTION_SUCCESS) + { + line_number = save_line_number; + return (EXECUTION_SUCCESS); + } +#endif + +#if 0 + debug_print_cond_command (cond_command); +#endif + + last_command_exit_value = retval = execute_cond_node (cond_command); + line_number = save_line_number; + return (retval); +} +#endif /* COND_COMMAND */ + +static void +bind_lastarg (arg) + char *arg; +{ + SHELL_VAR *var; + + if (arg == 0) + arg = ""; + var = bind_variable ("_", arg, 0); + VUNSETATTR (var, att_exported); +} + +/* Execute a null command. Fork a subshell if the command uses pipes or is + to be run asynchronously. This handles all the side effects that are + supposed to take place. */ +static int +execute_null_command (redirects, pipe_in, pipe_out, async) + REDIRECT *redirects; + int pipe_in, pipe_out, async; +{ + int r; + int forcefork; + REDIRECT *rd; + + for (forcefork = 0, rd = redirects; rd; rd = rd->next) + forcefork += rd->rflags & REDIR_VARASSIGN; + + if (forcefork || pipe_in != NO_PIPE || pipe_out != NO_PIPE || async) + { + /* We have a null command, but we really want a subshell to take + care of it. Just fork, do piping and redirections, and exit. */ + if (make_child ((char *)NULL, async) == 0) + { + /* Cancel traps, in trap.c. */ + restore_original_signals (); /* XXX */ + + do_piping (pipe_in, pipe_out); + +#if defined (COPROCESS_SUPPORT) + coproc_closeall (); +#endif + + subshell_environment = 0; + if (async) + subshell_environment |= SUBSHELL_ASYNC; + if (pipe_in != NO_PIPE || pipe_out != NO_PIPE) + subshell_environment |= SUBSHELL_PIPE; + + if (do_redirections (redirects, RX_ACTIVE) == 0) + exit (EXECUTION_SUCCESS); + else + exit (EXECUTION_FAILURE); + } + else + { + close_pipes (pipe_in, pipe_out); +#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD) + if (pipe_out == NO_PIPE) + unlink_fifo_list (); +#endif + return (EXECUTION_SUCCESS); + } + } + else + { + /* Even if there aren't any command names, pretend to do the + redirections that are specified. The user expects the side + effects to take place. If the redirections fail, then return + failure. Otherwise, if a command substitution took place while + expanding the command or a redirection, return the value of that + substitution. Otherwise, return EXECUTION_SUCCESS. */ + + r = do_redirections (redirects, RX_ACTIVE|RX_UNDOABLE); + cleanup_redirects (redirection_undo_list); + redirection_undo_list = (REDIRECT *)NULL; + + if (r != 0) + return (EXECUTION_FAILURE); + else if (last_command_subst_pid != NO_PID) + return (last_command_exit_value); + else + return (EXECUTION_SUCCESS); + } +} + +/* This is a hack to suppress word splitting for assignment statements + given as arguments to builtins with the ASSIGNMENT_BUILTIN flag set. */ +static void +fix_assignment_words (words) + WORD_LIST *words; +{ + WORD_LIST *w, *wcmd; + struct builtin *b; + int assoc, global, array, integer; + + if (words == 0) + return; + + b = 0; + assoc = global = array = integer = 0; + + /* Skip over assignment statements preceding a command name */ + wcmd = words; + for (wcmd = words; wcmd; wcmd = wcmd->next) + if ((wcmd->word->flags & W_ASSIGNMENT) == 0) + break; + + for (w = wcmd; w; w = w->next) + if (w->word->flags & W_ASSIGNMENT) + { + if (b == 0) + { + /* Posix (post-2008) says that `command' doesn't change whether + or not the builtin it shadows is a `declaration command', even + though it removes other special builtin properties. In Posix + mode, we skip over one or more instances of `command' and + deal with the next word as the assignment builtin. */ + while (posixly_correct && wcmd && wcmd->word && wcmd->word->word && STREQ (wcmd->word->word, "command")) + wcmd = wcmd->next; + b = builtin_address_internal (wcmd->word->word, 0); + if (b == 0 || (b->flags & ASSIGNMENT_BUILTIN) == 0) + return; + else if (b && (b->flags & ASSIGNMENT_BUILTIN)) + wcmd->word->flags |= W_ASSNBLTIN; + } + w->word->flags |= (W_NOSPLIT|W_NOGLOB|W_TILDEEXP|W_ASSIGNARG); +#if defined (ARRAY_VARS) + if (assoc) + w->word->flags |= W_ASSIGNASSOC; + if (array) + w->word->flags |= W_ASSIGNARRAY; +#endif + if (global) + w->word->flags |= W_ASSNGLOBAL; + if (integer) + w->word->flags |= W_ASSIGNINT; + } +#if defined (ARRAY_VARS) + /* Note that we saw an associative array option to a builtin that takes + assignment statements. This is a bit of a kludge. */ + else if (w->word->word[0] == '-' && (strchr (w->word->word+1, 'A') || strchr (w->word->word+1, 'a') || strchr (w->word->word+1, 'g'))) +#else + else if (w->word->word[0] == '-' && strchr (w->word->word+1, 'g')) +#endif + { + if (b == 0) + { + while (posixly_correct && wcmd && wcmd->word && wcmd->word->word && STREQ (wcmd->word->word, "command")) + wcmd = wcmd->next; + b = builtin_address_internal (wcmd->word->word, 0); + if (b == 0 || (b->flags & ASSIGNMENT_BUILTIN) == 0) + return; + else if (b && (b->flags & ASSIGNMENT_BUILTIN)) + wcmd->word->flags |= W_ASSNBLTIN; + } + if ((wcmd->word->flags & W_ASSNBLTIN) && strchr (w->word->word+1, 'A')) + assoc = 1; + else if ((wcmd->word->flags & W_ASSNBLTIN) && strchr (w->word->word+1, 'a')) + array = 1; + if ((wcmd->word->flags & W_ASSNBLTIN) && strchr (w->word->word+1, 'g')) + global = 1; + if ((wcmd->word->flags & W_ASSNBLTIN) && strchr (w->word->word+1, 'i')) + integer = 1; + } +} + +/* Return 1 if the file found by searching $PATH for PATHNAME, defaulting + to PATHNAME, is a directory. Used by the autocd code below. */ +static int +is_dirname (pathname) + char *pathname; +{ + char *temp; + int ret; + + temp = search_for_command (pathname, 0); + ret = (temp ? file_isdir (temp) : file_isdir (pathname)); + free (temp); + return ret; +} + +/* The meaty part of all the executions. We have to start hacking the + real execution of commands here. Fork a process, set things up, + execute the command. */ +static int +execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close) + SIMPLE_COM *simple_command; + int pipe_in, pipe_out, async; + struct fd_bitmap *fds_to_close; +{ + WORD_LIST *words, *lastword; + char *command_line, *lastarg, *temp; + int first_word_quoted, result, builtin_is_special, already_forked, dofork; + pid_t old_last_async_pid; + sh_builtin_func_t *builtin; + SHELL_VAR *func; + volatile int old_builtin, old_command_builtin; + + result = EXECUTION_SUCCESS; + special_builtin_failed = builtin_is_special = 0; + command_line = (char *)0; + + QUIT; + + /* If we're in a function, update the line number information. */ + if (variable_context && interactive_shell && sourcelevel == 0) + line_number -= function_line_number; + + /* Remember what this command line looks like at invocation. */ + command_string_index = 0; + print_simple_command (simple_command); + +#if 0 + if (signal_in_progress (DEBUG_TRAP) == 0 && (this_command_name == 0 || (STREQ (this_command_name, "trap") == 0))) +#else + if (signal_in_progress (DEBUG_TRAP) == 0 && running_trap == 0) +#endif + { + FREE (the_printed_command_except_trap); + the_printed_command_except_trap = the_printed_command ? savestring (the_printed_command) : (char *)0; + } + + /* Run the debug trap before each simple command, but do it after we + update the line number information. */ + result = run_debug_trap (); +#if defined (DEBUGGER) + /* In debugging mode, if the DEBUG trap returns a non-zero status, we + skip the command. */ + if (debugging_mode && result != EXECUTION_SUCCESS) + return (EXECUTION_SUCCESS); +#endif + + first_word_quoted = + simple_command->words ? (simple_command->words->word->flags & W_QUOTED) : 0; + + last_command_subst_pid = NO_PID; + old_last_async_pid = last_asynchronous_pid; + + already_forked = dofork = 0; + + /* If we're in a pipeline or run in the background, set DOFORK so we + make the child early, before word expansion. This keeps assignment + statements from affecting the parent shell's environment when they + should not. */ + dofork = pipe_in != NO_PIPE || pipe_out != NO_PIPE || async; + + /* Something like `%2 &' should restart job 2 in the background, not cause + the shell to fork here. */ + if (dofork && pipe_in == NO_PIPE && pipe_out == NO_PIPE && + simple_command->words && simple_command->words->word && + simple_command->words->word->word && + (simple_command->words->word->word[0] == '%')) + dofork = 0; + + if (dofork) + { + /* Do this now, because execute_disk_command will do it anyway in the + vast majority of cases. */ + maybe_make_export_env (); + + /* Don't let a DEBUG trap overwrite the command string to be saved with + the process/job associated with this child. */ + if (make_child (savestring (the_printed_command_except_trap), async) == 0) + { + already_forked = 1; + simple_command->flags |= CMD_NO_FORK; + + subshell_environment = SUBSHELL_FORK; + if (pipe_in != NO_PIPE || pipe_out != NO_PIPE) + subshell_environment |= SUBSHELL_PIPE; + if (async) + subshell_environment |= SUBSHELL_ASYNC; + + /* We need to do this before piping to handle some really + pathological cases where one of the pipe file descriptors + is < 2. */ + if (fds_to_close) + close_fd_bitmap (fds_to_close); + + do_piping (pipe_in, pipe_out); + pipe_in = pipe_out = NO_PIPE; +#if defined (COPROCESS_SUPPORT) + coproc_closeall (); +#endif + + last_asynchronous_pid = old_last_async_pid; + + CHECK_SIGTERM; + } + else + { + /* Don't let simple commands that aren't the last command in a + pipeline change $? for the rest of the pipeline (or at all). */ + if (pipe_out != NO_PIPE) + result = last_command_exit_value; + close_pipes (pipe_in, pipe_out); +#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD) + /* Close /dev/fd file descriptors in the parent after forking the + last child in a (possibly one-element) pipeline. Defer this + until any running shell function completes. */ + if (pipe_out == NO_PIPE && variable_context == 0) /* XXX */ + unlink_fifo_list (); /* XXX */ +#endif + command_line = (char *)NULL; /* don't free this. */ + bind_lastarg ((char *)NULL); + return (result); + } + } + + /* If we are re-running this as the result of executing the `command' + builtin, do not expand the command words a second time. */ + if ((simple_command->flags & CMD_INHIBIT_EXPANSION) == 0) + { + current_fds_to_close = fds_to_close; + fix_assignment_words (simple_command->words); + /* Pass the ignore return flag down to command substitutions */ + if (simple_command->flags & CMD_IGNORE_RETURN) /* XXX */ + comsub_ignore_return++; + words = expand_words (simple_command->words); + if (simple_command->flags & CMD_IGNORE_RETURN) + comsub_ignore_return--; + current_fds_to_close = (struct fd_bitmap *)NULL; + } + else + words = copy_word_list (simple_command->words); + + /* It is possible for WORDS not to have anything left in it. + Perhaps all the words consisted of `$foo', and there was + no variable `$foo'. */ + if (words == 0) + { + this_command_name = 0; + result = execute_null_command (simple_command->redirects, + pipe_in, pipe_out, + already_forked ? 0 : async); + if (already_forked) + exit (result); + else + { + bind_lastarg ((char *)NULL); + set_pipestatus_from_exit (result); + return (result); + } + } + + lastarg = (char *)NULL; + + begin_unwind_frame ("simple-command"); + + if (echo_command_at_execute) + xtrace_print_word_list (words, 1); + + builtin = (sh_builtin_func_t *)NULL; + func = (SHELL_VAR *)NULL; + if ((simple_command->flags & CMD_NO_FUNCTIONS) == 0) + { + /* Posix.2 says special builtins are found before functions. We + don't set builtin_is_special anywhere other than here, because + this path is followed only when the `command' builtin is *not* + being used, and we don't want to exit the shell if a special + builtin executed with `command builtin' fails. `command' is not + a special builtin. */ + if (posixly_correct) + { + builtin = find_special_builtin (words->word->word); + if (builtin) + builtin_is_special = 1; + } + if (builtin == 0) + func = find_function (words->word->word); + } + + /* In POSIX mode, assignment errors in the temporary environment cause a + non-interactive shell to exit. */ + if (posixly_correct && builtin_is_special && interactive_shell == 0 && tempenv_assign_error) + { + last_command_exit_value = EXECUTION_FAILURE; + jump_to_top_level (ERREXIT); + } + tempenv_assign_error = 0; /* don't care about this any more */ + + add_unwind_protect (dispose_words, words); + QUIT; + + /* Bind the last word in this command to "$_" after execution. */ + for (lastword = words; lastword->next; lastword = lastword->next) + ; + lastarg = lastword->word->word; + +#if defined (JOB_CONTROL) + /* Is this command a job control related thing? */ + if (words->word->word[0] == '%' && already_forked == 0) + { + this_command_name = async ? "bg" : "fg"; + last_shell_builtin = this_shell_builtin; + this_shell_builtin = builtin_address (this_command_name); + result = (*this_shell_builtin) (words); + goto return_result; + } + + /* One other possibililty. The user may want to resume an existing job. + If they do, find out whether this word is a candidate for a running + job. */ + if (job_control && already_forked == 0 && async == 0 && + !first_word_quoted && + !words->next && + words->word->word[0] && + !simple_command->redirects && + pipe_in == NO_PIPE && + pipe_out == NO_PIPE && + (temp = get_string_value ("auto_resume"))) + { + int job, jflags, started_status; + + jflags = JM_STOPPED|JM_FIRSTMATCH; + if (STREQ (temp, "exact")) + jflags |= JM_EXACT; + else if (STREQ (temp, "substring")) + jflags |= JM_SUBSTRING; + else + jflags |= JM_PREFIX; + job = get_job_by_name (words->word->word, jflags); + if (job != NO_JOB) + { + run_unwind_frame ("simple-command"); + this_command_name = "fg"; + last_shell_builtin = this_shell_builtin; + this_shell_builtin = builtin_address ("fg"); + + started_status = start_job (job, 1); + return ((started_status < 0) ? EXECUTION_FAILURE : started_status); + } + } +#endif /* JOB_CONTROL */ + +run_builtin: + /* Remember the name of this command globally. */ + this_command_name = words->word->word; + + QUIT; + + /* This command could be a shell builtin or a user-defined function. + We have already found special builtins by this time, so we do not + set builtin_is_special. If this is a function or builtin, and we + have pipes, then fork a subshell in here. Otherwise, just execute + the command directly. */ + if (func == 0 && builtin == 0) + builtin = find_shell_builtin (this_command_name); + + last_shell_builtin = this_shell_builtin; + this_shell_builtin = builtin; + + if (builtin || func) + { + if (builtin) + { + old_builtin = executing_builtin; + old_command_builtin = executing_command_builtin; + unwind_protect_int (executing_builtin); /* modified in execute_builtin */ + unwind_protect_int (executing_command_builtin); /* ditto */ + } + if (already_forked) + { + /* reset_terminating_signals (); */ /* XXX */ + /* Reset the signal handlers in the child, but don't free the + trap strings. Set a flag noting that we have to free the + trap strings if we run trap to change a signal disposition. */ + reset_signal_handlers (); + subshell_environment |= SUBSHELL_RESETTRAP; + + if (async) + { + if ((simple_command->flags & CMD_STDIN_REDIR) && + pipe_in == NO_PIPE && + (stdin_redirects (simple_command->redirects) == 0)) + async_redirect_stdin (); + setup_async_signals (); + } + + subshell_level++; + execute_subshell_builtin_or_function + (words, simple_command->redirects, builtin, func, + pipe_in, pipe_out, async, fds_to_close, + simple_command->flags); + subshell_level--; + } + else + { + result = execute_builtin_or_function + (words, builtin, func, simple_command->redirects, fds_to_close, + simple_command->flags); + if (builtin) + { + if (result > EX_SHERRBASE) + { + switch (result) + { + case EX_REDIRFAIL: + case EX_BADASSIGN: + case EX_EXPFAIL: + /* These errors cause non-interactive posix mode shells to exit */ + if (posixly_correct && builtin_is_special && interactive_shell == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + jump_to_top_level (ERREXIT); + } + } + result = builtin_status (result); + if (builtin_is_special) + special_builtin_failed = 1; + } + /* In POSIX mode, if there are assignment statements preceding + a special builtin, they persist after the builtin + completes. */ + if (posixly_correct && builtin_is_special && temporary_env) + merge_temporary_env (); + } + else /* function */ + { + if (result == EX_USAGE) + result = EX_BADUSAGE; + else if (result > EX_SHERRBASE) + result = EXECUTION_FAILURE; + } + + set_pipestatus_from_exit (result); + + goto return_result; + } + } + + if (autocd && interactive && words->word && is_dirname (words->word->word)) + { + words = make_word_list (make_word ("cd"), words); + xtrace_print_word_list (words, 0); + goto run_builtin; + } + + if (command_line == 0) + command_line = savestring (the_printed_command_except_trap ? the_printed_command_except_trap : ""); + +#if defined (PROCESS_SUBSTITUTION) + if ((subshell_environment & SUBSHELL_COMSUB) && (simple_command->flags & CMD_NO_FORK) && fifos_pending() > 0) + simple_command->flags &= ~CMD_NO_FORK; +#endif + + result = execute_disk_command (words, simple_command->redirects, command_line, + pipe_in, pipe_out, async, fds_to_close, + simple_command->flags); + + return_result: + bind_lastarg (lastarg); + FREE (command_line); + dispose_words (words); + if (builtin) + { + executing_builtin = old_builtin; + executing_command_builtin = old_command_builtin; + } + discard_unwind_frame ("simple-command"); + this_command_name = (char *)NULL; /* points to freed memory now */ + return (result); +} + +/* Translate the special builtin exit statuses. We don't really need a + function for this; it's a placeholder for future work. */ +static int +builtin_status (result) + int result; +{ + int r; + + switch (result) + { + case EX_USAGE: + r = EX_BADUSAGE; + break; + case EX_REDIRFAIL: + case EX_BADSYNTAX: + case EX_BADASSIGN: + case EX_EXPFAIL: + r = EXECUTION_FAILURE; + break; + default: + r = EXECUTION_SUCCESS; + break; + } + return (r); +} + +static int +execute_builtin (builtin, words, flags, subshell) + sh_builtin_func_t *builtin; + WORD_LIST *words; + int flags, subshell; +{ + int old_e_flag, result, eval_unwind; + int isbltinenv; + char *error_trap; + + error_trap = 0; + old_e_flag = exit_immediately_on_error; + + /* The eval builtin calls parse_and_execute, which does not know about + the setting of flags, and always calls the execution functions with + flags that will exit the shell on an error if -e is set. If the + eval builtin is being called, and we're supposed to ignore the exit + value of the command, we turn the -e flag off ourselves and disable + the ERR trap, then restore them when the command completes. This is + also a problem (as below) for the command and source/. builtins. */ + if (subshell == 0 && (flags & CMD_IGNORE_RETURN) && + (builtin == eval_builtin || builtin == command_builtin || builtin == source_builtin)) + { + begin_unwind_frame ("eval_builtin"); + unwind_protect_int (exit_immediately_on_error); + unwind_protect_int (builtin_ignoring_errexit); + error_trap = TRAP_STRING (ERROR_TRAP); + if (error_trap) + { + error_trap = savestring (error_trap); + add_unwind_protect (xfree, error_trap); + add_unwind_protect (set_error_trap, error_trap); + restore_default_signal (ERROR_TRAP); + } + exit_immediately_on_error = 0; + builtin_ignoring_errexit = 1; + eval_unwind = 1; + } + else + eval_unwind = 0; + + /* The temporary environment for a builtin is supposed to apply to + all commands executed by that builtin. Currently, this is a + problem only with the `unset', `source' and `eval' builtins. + `mapfile' is a special case because it uses evalstring (same as + eval or source) to run its callbacks. */ + isbltinenv = (builtin == source_builtin || builtin == eval_builtin || builtin == unset_builtin || builtin == mapfile_builtin); + + if (isbltinenv) + { + if (subshell == 0) + begin_unwind_frame ("builtin_env"); + + if (temporary_env) + { + push_scope (VC_BLTNENV, temporary_env); + if (subshell == 0) + add_unwind_protect (pop_scope, (flags & CMD_COMMAND_BUILTIN) ? 0 : "1"); + temporary_env = (HASH_TABLE *)NULL; + } + } + + /* `return' does a longjmp() back to a saved environment in execute_function. + If a variable assignment list preceded the command, and the shell is + running in POSIX mode, we need to merge that into the shell_variables + table, since `return' is a POSIX special builtin. */ + if (posixly_correct && subshell == 0 && builtin == return_builtin && temporary_env) + { + begin_unwind_frame ("return_temp_env"); + add_unwind_protect (merge_temporary_env, (char *)NULL); + } + + executing_builtin++; + executing_command_builtin |= builtin == command_builtin; + result = ((*builtin) (words->next)); + + /* This shouldn't happen, but in case `return' comes back instead of + longjmp'ing, we need to unwind. */ + if (posixly_correct && subshell == 0 && builtin == return_builtin && temporary_env) + discard_unwind_frame ("return_temp_env"); + + if (subshell == 0 && isbltinenv) + run_unwind_frame ("builtin_env"); + + if (eval_unwind) + { + exit_immediately_on_error = errexit_flag; + builtin_ignoring_errexit = 0; + if (error_trap) + { + set_error_trap (error_trap); + xfree (error_trap); + } + discard_unwind_frame ("eval_builtin"); + } + + return (result); +} + +static int +execute_function (var, words, flags, fds_to_close, async, subshell) + SHELL_VAR *var; + WORD_LIST *words; + int flags; + struct fd_bitmap *fds_to_close; + int async, subshell; +{ + int return_val, result; + COMMAND *tc, *fc, *save_current; + char *debug_trap, *error_trap, *return_trap; +#if defined (ARRAY_VARS) + SHELL_VAR *funcname_v, *nfv, *bash_source_v, *bash_lineno_v; + ARRAY *funcname_a; + volatile ARRAY *bash_source_a; + volatile ARRAY *bash_lineno_a; +#endif + FUNCTION_DEF *shell_fn; + char *sfile, *t; + + USE_VAR(fc); + + if (funcnest_max > 0 && funcnest >= funcnest_max) + { + internal_error (_("%s: maximum function nesting level exceeded (%d)"), var->name, funcnest); + funcnest = 0; /* XXX - should we reset it somewhere else? */ + jump_to_top_level (DISCARD); + } + +#if defined (ARRAY_VARS) + GET_ARRAY_FROM_VAR ("FUNCNAME", funcname_v, funcname_a); + GET_ARRAY_FROM_VAR ("BASH_SOURCE", bash_source_v, bash_source_a); + GET_ARRAY_FROM_VAR ("BASH_LINENO", bash_lineno_v, bash_lineno_a); +#endif + + tc = (COMMAND *)copy_command (function_cell (var)); + if (tc && (flags & CMD_IGNORE_RETURN)) + tc->flags |= CMD_IGNORE_RETURN; + + if (subshell == 0) + { + begin_unwind_frame ("function_calling"); + push_context (var->name, subshell, temporary_env); + add_unwind_protect (pop_context, (char *)NULL); + unwind_protect_int (line_number); + unwind_protect_int (return_catch_flag); + unwind_protect_jmp_buf (return_catch); + add_unwind_protect (dispose_command, (char *)tc); + unwind_protect_pointer (this_shell_function); + unwind_protect_int (loop_level); + unwind_protect_int (funcnest); + } + else + push_context (var->name, subshell, temporary_env); /* don't unwind-protect for subshells */ + + temporary_env = (HASH_TABLE *)NULL; + + this_shell_function = var; + make_funcname_visible (1); + + debug_trap = TRAP_STRING(DEBUG_TRAP); + error_trap = TRAP_STRING(ERROR_TRAP); + return_trap = TRAP_STRING(RETURN_TRAP); + + /* The order of the unwind protects for debug_trap, error_trap and + return_trap is important here! unwind-protect commands are run + in reverse order of registration. If this causes problems, take + out the xfree unwind-protect calls and live with the small memory leak. */ + + /* function_trace_mode != 0 means that all functions inherit the DEBUG trap. + if the function has the trace attribute set, it inherits the DEBUG trap */ + if (debug_trap && ((trace_p (var) == 0) && function_trace_mode == 0)) + { + if (subshell == 0) + { + debug_trap = savestring (debug_trap); + add_unwind_protect (xfree, debug_trap); + add_unwind_protect (set_debug_trap, debug_trap); + } + restore_default_signal (DEBUG_TRAP); + } + + /* error_trace_mode != 0 means that functions inherit the ERR trap. */ + if (error_trap && error_trace_mode == 0) + { + if (subshell == 0) + { + error_trap = savestring (error_trap); + add_unwind_protect (xfree, error_trap); + add_unwind_protect (set_error_trap, error_trap); + } + restore_default_signal (ERROR_TRAP); + } + + /* Shell functions inherit the RETURN trap if function tracing is on + globally or on individually for this function. */ +#if 0 + if (return_trap && ((trace_p (var) == 0) && function_trace_mode == 0)) +#else + if (return_trap && (signal_in_progress (DEBUG_TRAP) || ((trace_p (var) == 0) && function_trace_mode == 0))) +#endif + { + if (subshell == 0) + { + return_trap = savestring (return_trap); + add_unwind_protect (xfree, return_trap); + add_unwind_protect (set_return_trap, return_trap); + } + restore_default_signal (RETURN_TRAP); + } + + funcnest++; +#if defined (ARRAY_VARS) + /* This is quite similar to the code in shell.c and elsewhere. */ + shell_fn = find_function_def (this_shell_function->name); + sfile = shell_fn ? shell_fn->source_file : ""; + array_push ((ARRAY *)funcname_a, this_shell_function->name); + + array_push ((ARRAY *)bash_source_a, sfile); + t = itos (executing_line_number ()); + array_push ((ARRAY *)bash_lineno_a, t); + free (t); +#endif + + /* The temporary environment for a function is supposed to apply to + all commands executed within the function body. */ + + remember_args (words->next, 1); + + /* Update BASH_ARGV and BASH_ARGC */ + if (debugging_mode) + push_args (words->next); + + /* Number of the line on which the function body starts. */ + line_number = function_line_number = tc->line; + +#if defined (JOB_CONTROL) + if (subshell) + stop_pipeline (async, (COMMAND *)NULL); +#endif + + fc = tc; + + return_catch_flag++; + return_val = setjmp_nosigs (return_catch); + + if (return_val) + { + result = return_catch_value; + /* Run the RETURN trap in the function's context. */ + save_current = currently_executing_command; + run_return_trap (); + currently_executing_command = save_current; + } + else + { + /* Run the debug trap here so we can trap at the start of a function's + execution rather than the execution of the body's first command. */ + showing_function_line = 1; + save_current = currently_executing_command; + result = run_debug_trap (); +#if defined (DEBUGGER) + /* In debugging mode, if the DEBUG trap returns a non-zero status, we + skip the command. */ + if (debugging_mode == 0 || result == EXECUTION_SUCCESS) + { + showing_function_line = 0; + currently_executing_command = save_current; + result = execute_command_internal (fc, 0, NO_PIPE, NO_PIPE, fds_to_close); + + /* Run the RETURN trap in the function's context */ + save_current = currently_executing_command; + run_return_trap (); + currently_executing_command = save_current; + } +#else + result = execute_command_internal (fc, 0, NO_PIPE, NO_PIPE, fds_to_close); + + save_current = currently_executing_command; + run_return_trap (); + currently_executing_command = save_current; +#endif + showing_function_line = 0; + } + + /* Restore BASH_ARGC and BASH_ARGV */ + if (debugging_mode) + pop_args (); + + if (subshell == 0) + run_unwind_frame ("function_calling"); + +#if defined (ARRAY_VARS) + /* These two variables cannot be unset, and cannot be affected by the + function. */ + array_pop ((ARRAY *)bash_source_a); + array_pop ((ARRAY *)bash_lineno_a); + + /* FUNCNAME can be unset, and so can potentially be changed by the + function. */ + GET_ARRAY_FROM_VAR ("FUNCNAME", nfv, funcname_a); + if (nfv == funcname_v) + array_pop (funcname_a); +#endif + + if (variable_context == 0 || this_shell_function == 0) + { + make_funcname_visible (0); +#if defined (PROCESS_SUBSTITUTION) + unlink_fifo_list (); +#endif + } + + return (result); +} + +/* A convenience routine for use by other parts of the shell to execute + a particular shell function. */ +int +execute_shell_function (var, words) + SHELL_VAR *var; + WORD_LIST *words; +{ + int ret; + struct fd_bitmap *bitmap; + + bitmap = new_fd_bitmap (FD_BITMAP_DEFAULT_SIZE); + begin_unwind_frame ("execute-shell-function"); + add_unwind_protect (dispose_fd_bitmap, (char *)bitmap); + + ret = execute_function (var, words, 0, bitmap, 0, 0); + + dispose_fd_bitmap (bitmap); + discard_unwind_frame ("execute-shell-function"); + + return ret; +} + +/* Execute a shell builtin or function in a subshell environment. This + routine does not return; it only calls exit(). If BUILTIN is non-null, + it points to a function to call to execute a shell builtin; otherwise + VAR points at the body of a function to execute. WORDS is the arguments + to the command, REDIRECTS specifies redirections to perform before the + command is executed. */ +static void +execute_subshell_builtin_or_function (words, redirects, builtin, var, + pipe_in, pipe_out, async, fds_to_close, + flags) + WORD_LIST *words; + REDIRECT *redirects; + sh_builtin_func_t *builtin; + SHELL_VAR *var; + int pipe_in, pipe_out, async; + struct fd_bitmap *fds_to_close; + int flags; +{ + int result, r, funcvalue; +#if defined (JOB_CONTROL) + int jobs_hack; + + jobs_hack = (builtin == jobs_builtin) && + ((subshell_environment & SUBSHELL_ASYNC) == 0 || pipe_out != NO_PIPE); +#endif + + /* A subshell is neither a login shell nor interactive. */ + login_shell = interactive = 0; + + if (async) + subshell_environment |= SUBSHELL_ASYNC; + if (pipe_in != NO_PIPE || pipe_out != NO_PIPE) + subshell_environment |= SUBSHELL_PIPE; + + maybe_make_export_env (); /* XXX - is this needed? */ + +#if defined (JOB_CONTROL) + /* Eradicate all traces of job control after we fork the subshell, so + all jobs begun by this subshell are in the same process group as + the shell itself. */ + + /* Allow the output of `jobs' to be piped. */ + if (jobs_hack) + kill_current_pipeline (); + else + without_job_control (); + + set_sigchld_handler (); +#endif /* JOB_CONTROL */ + + set_sigint_handler (); + + if (fds_to_close) + close_fd_bitmap (fds_to_close); + + do_piping (pipe_in, pipe_out); + + if (do_redirections (redirects, RX_ACTIVE) != 0) + exit (EXECUTION_FAILURE); + + if (builtin) + { + /* Give builtins a place to jump back to on failure, + so we don't go back up to main(). */ + result = setjmp_nosigs (top_level); + + /* Give the return builtin a place to jump to when executed in a subshell + or pipeline */ + funcvalue = 0; + if (return_catch_flag && builtin == return_builtin) + funcvalue = setjmp_nosigs (return_catch); + + if (result == EXITPROG) + exit (last_command_exit_value); + else if (result) + exit (EXECUTION_FAILURE); + else if (funcvalue) + exit (return_catch_value); + else + { + r = execute_builtin (builtin, words, flags, 1); + fflush (stdout); + if (r == EX_USAGE) + r = EX_BADUSAGE; + exit (r); + } + } + else + { + r = execute_function (var, words, flags, fds_to_close, async, 1); + fflush (stdout); + exit (r); + } +} + +/* Execute a builtin or function in the current shell context. If BUILTIN + is non-null, it is the builtin command to execute, otherwise VAR points + to the body of a function. WORDS are the command's arguments, REDIRECTS + are the redirections to perform. FDS_TO_CLOSE is the usual bitmap of + file descriptors to close. + + If BUILTIN is exec_builtin, the redirections specified in REDIRECTS are + not undone before this function returns. */ +static int +execute_builtin_or_function (words, builtin, var, redirects, + fds_to_close, flags) + WORD_LIST *words; + sh_builtin_func_t *builtin; + SHELL_VAR *var; + REDIRECT *redirects; + struct fd_bitmap *fds_to_close; + int flags; +{ + int result; + REDIRECT *saved_undo_list; +#if defined (PROCESS_SUBSTITUTION) + int ofifo, nfifo, osize; + char *ofifo_list; +#endif + + +#if defined (PROCESS_SUBSTITUTION) + ofifo = num_fifos (); + ofifo_list = copy_fifo_list (&osize); +#endif + + if (do_redirections (redirects, RX_ACTIVE|RX_UNDOABLE) != 0) + { + cleanup_redirects (redirection_undo_list); + redirection_undo_list = (REDIRECT *)NULL; + dispose_exec_redirects (); +#if defined (PROCESS_SUBSTITUTION) + free (ofifo_list); +#endif + return (EX_REDIRFAIL); /* was EXECUTION_FAILURE */ + } + + saved_undo_list = redirection_undo_list; + + /* Calling the "exec" builtin changes redirections forever. */ + if (builtin == exec_builtin) + { + dispose_redirects (saved_undo_list); + saved_undo_list = exec_redirection_undo_list; + exec_redirection_undo_list = (REDIRECT *)NULL; + } + else + dispose_exec_redirects (); + + if (saved_undo_list) + { + begin_unwind_frame ("saved redirects"); + add_unwind_protect (cleanup_redirects, (char *)saved_undo_list); + } + + redirection_undo_list = (REDIRECT *)NULL; + + if (builtin) + result = execute_builtin (builtin, words, flags, 0); + else + result = execute_function (var, words, flags, fds_to_close, 0, 0); + + /* We do this before undoing the effects of any redirections. */ + fflush (stdout); + fpurge (stdout); + if (ferror (stdout)) + clearerr (stdout); + + /* If we are executing the `command' builtin, but this_shell_builtin is + set to `exec_builtin', we know that we have something like + `command exec [redirection]', since otherwise `exec' would have + overwritten the shell and we wouldn't get here. In this case, we + want to behave as if the `command' builtin had not been specified + and preserve the redirections. */ + if (builtin == command_builtin && this_shell_builtin == exec_builtin) + { + int discard; + + discard = 0; + if (saved_undo_list) + { + dispose_redirects (saved_undo_list); + discard = 1; + } + redirection_undo_list = exec_redirection_undo_list; + saved_undo_list = exec_redirection_undo_list = (REDIRECT *)NULL; + if (discard) + discard_unwind_frame ("saved redirects"); + } + + if (saved_undo_list) + { + redirection_undo_list = saved_undo_list; + discard_unwind_frame ("saved redirects"); + } + + if (redirection_undo_list) + { + cleanup_redirects (redirection_undo_list); + redirection_undo_list = (REDIRECT *)NULL; + } + +#if defined (PROCESS_SUBSTITUTION) + /* Close any FIFOs created by this builtin or function. */ + nfifo = num_fifos (); + if (nfifo > ofifo) + close_new_fifos (ofifo_list, osize); + free (ofifo_list); +#endif + + return (result); +} + +void +setup_async_signals () +{ +#if defined (__BEOS__) + set_signal_handler (SIGHUP, SIG_IGN); /* they want csh-like behavior */ +#endif + +#if defined (JOB_CONTROL) + if (job_control == 0) +#endif + { + /* Make sure we get the original signal dispositions now so we don't + confuse the trap builtin later if the subshell tries to use it to + reset SIGINT/SIGQUIT. Don't call set_signal_ignored; that sets + the value of original_signals to SIG_IGN. Posix interpretation 751. */ + get_original_signal (SIGINT); + set_signal_handler (SIGINT, SIG_IGN); + + get_original_signal (SIGQUIT); + set_signal_handler (SIGQUIT, SIG_IGN); + } +} + +/* Execute a simple command that is hopefully defined in a disk file + somewhere. + + 1) fork () + 2) connect pipes + 3) look up the command + 4) do redirections + 5) execve () + 6) If the execve failed, see if the file has executable mode set. + If so, and it isn't a directory, then execute its contents as + a shell script. + + Note that the filename hashing stuff has to take place up here, + in the parent. This is probably why the Bourne style shells + don't handle it, since that would require them to go through + this gnarly hair, for no good reason. + + NOTE: callers expect this to fork or exit(). */ + +/* Name of a shell function to call when a command name is not found. */ +#ifndef NOTFOUND_HOOK +# define NOTFOUND_HOOK "command_not_found_handle" +#endif + +static int +execute_disk_command (words, redirects, command_line, pipe_in, pipe_out, + async, fds_to_close, cmdflags) + WORD_LIST *words; + REDIRECT *redirects; + char *command_line; + int pipe_in, pipe_out, async; + struct fd_bitmap *fds_to_close; + int cmdflags; +{ + char *pathname, *command, **args; + int nofork, result; + pid_t pid; + SHELL_VAR *hookf; + WORD_LIST *wl; + + nofork = (cmdflags & CMD_NO_FORK); /* Don't fork, just exec, if no pipes */ + pathname = words->word->word; + + result = EXECUTION_SUCCESS; +#if defined (RESTRICTED_SHELL) + command = (char *)NULL; + if (restricted && mbschr (pathname, '/')) + { + internal_error (_("%s: restricted: cannot specify `/' in command names"), + pathname); + result = last_command_exit_value = EXECUTION_FAILURE; + + /* If we're not going to fork below, we must already be in a child + process or a context in which it's safe to call exit(2). */ + if (nofork && pipe_in == NO_PIPE && pipe_out == NO_PIPE) + exit (last_command_exit_value); + else + goto parent_return; + } +#endif /* RESTRICTED_SHELL */ + + command = search_for_command (pathname, 1); + + if (command) + { + maybe_make_export_env (); + put_command_name_into_env (command); + } + + /* We have to make the child before we check for the non-existence + of COMMAND, since we want the error messages to be redirected. */ + /* If we can get away without forking and there are no pipes to deal with, + don't bother to fork, just directly exec the command. */ + if (nofork && pipe_in == NO_PIPE && pipe_out == NO_PIPE) + pid = 0; + else + pid = make_child (savestring (command_line), async); + + if (pid == 0) + { + int old_interactive; + + reset_terminating_signals (); /* XXX */ + /* Cancel traps, in trap.c. */ + restore_original_signals (); + + CHECK_SIGTERM; + + /* restore_original_signals may have undone the work done + by make_child to ensure that SIGINT and SIGQUIT are ignored + in asynchronous children. */ + if (async) + { + if ((cmdflags & CMD_STDIN_REDIR) && + pipe_in == NO_PIPE && + (stdin_redirects (redirects) == 0)) + async_redirect_stdin (); + setup_async_signals (); + } + + /* This functionality is now provided by close-on-exec of the + file descriptors manipulated by redirection and piping. + Some file descriptors still need to be closed in all children + because of the way bash does pipes; fds_to_close is a + bitmap of all such file descriptors. */ + if (fds_to_close) + close_fd_bitmap (fds_to_close); + + do_piping (pipe_in, pipe_out); + + old_interactive = interactive; + if (async) + interactive = 0; + + subshell_environment = SUBSHELL_FORK; + + if (redirects && (do_redirections (redirects, RX_ACTIVE) != 0)) + { +#if defined (PROCESS_SUBSTITUTION) + /* Try to remove named pipes that may have been created as the + result of redirections. */ + unlink_fifo_list (); +#endif /* PROCESS_SUBSTITUTION */ + exit (EXECUTION_FAILURE); + } + + if (async) + interactive = old_interactive; + + if (command == 0) + { + hookf = find_function (NOTFOUND_HOOK); + if (hookf == 0) + { + /* Make sure filenames are displayed using printable characters */ + if (ansic_shouldquote (pathname)) + pathname = ansic_quote (pathname, 0, NULL); + internal_error (_("%s: command not found"), pathname); + exit (EX_NOTFOUND); /* Posix.2 says the exit status is 127 */ + } + +#if defined (JOB_CONTROL) + /* May need to reinitialize more of the job control state here. */ + kill_current_pipeline (); +#endif + + wl = make_word_list (make_word (NOTFOUND_HOOK), words); + exit (execute_shell_function (hookf, wl)); + } + + CHECK_SIGTERM; + + /* Execve expects the command name to be in args[0]. So we + leave it there, in the same format that the user used to + type it in. */ + args = strvec_from_word_list (words, 0, 0, (int *)NULL); + exit (shell_execve (command, args, export_env)); + } + else + { +parent_return: + QUIT; + + /* Make sure that the pipes are closed in the parent. */ + close_pipes (pipe_in, pipe_out); +#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD) + if (variable_context == 0) + unlink_fifo_list (); +#endif + FREE (command); + return (result); + } +} + +/* CPP defines to decide whether a particular index into the #! line + corresponds to a valid interpreter name or argument character, or + whitespace. The MSDOS define is to allow \r to be treated the same + as \n. */ + +#if !defined (MSDOS) +# define STRINGCHAR(ind) \ + (ind < sample_len && !whitespace (sample[ind]) && sample[ind] != '\n') +# define WHITECHAR(ind) \ + (ind < sample_len && whitespace (sample[ind])) +#else /* MSDOS */ +# define STRINGCHAR(ind) \ + (ind < sample_len && !whitespace (sample[ind]) && sample[ind] != '\n' && sample[ind] != '\r') +# define WHITECHAR(ind) \ + (ind < sample_len && whitespace (sample[ind])) +#endif /* MSDOS */ + +static char * +getinterp (sample, sample_len, endp) + char *sample; + int sample_len, *endp; +{ + register int i; + char *execname; + int start; + + /* Find the name of the interpreter to exec. */ + for (i = 2; i < sample_len && whitespace (sample[i]); i++) + ; + + for (start = i; STRINGCHAR(i); i++) + ; + + execname = substring (sample, start, i); + + if (endp) + *endp = i; + return execname; +} + +#if !defined (HAVE_HASH_BANG_EXEC) +/* If the operating system on which we're running does not handle + the #! executable format, then help out. SAMPLE is the text read + from the file, SAMPLE_LEN characters. COMMAND is the name of + the script; it and ARGS, the arguments given by the user, will + become arguments to the specified interpreter. ENV is the environment + to pass to the interpreter. + + The word immediately following the #! is the interpreter to execute. + A single argument to the interpreter is allowed. */ + +static int +execute_shell_script (sample, sample_len, command, args, env) + char *sample; + int sample_len; + char *command; + char **args, **env; +{ + char *execname, *firstarg; + int i, start, size_increment, larry; + + /* Find the name of the interpreter to exec. */ + execname = getinterp (sample, sample_len, &i); + size_increment = 1; + + /* Now the argument, if any. */ + for (firstarg = (char *)NULL, start = i; WHITECHAR(i); i++) + ; + + /* If there is more text on the line, then it is an argument for the + interpreter. */ + + if (STRINGCHAR(i)) + { + for (start = i; STRINGCHAR(i); i++) + ; + firstarg = substring ((char *)sample, start, i); + size_increment = 2; + } + + larry = strvec_len (args) + size_increment; + args = strvec_resize (args, larry + 1); + + for (i = larry - 1; i; i--) + args[i] = args[i - size_increment]; + + args[0] = execname; + if (firstarg) + { + args[1] = firstarg; + args[2] = command; + } + else + args[1] = command; + + args[larry] = (char *)NULL; + + return (shell_execve (execname, args, env)); +} +#undef STRINGCHAR +#undef WHITECHAR + +#endif /* !HAVE_HASH_BANG_EXEC */ + +static void +initialize_subshell () +{ +#if defined (ALIAS) + /* Forget about any aliases that we knew of. We are in a subshell. */ + delete_all_aliases (); +#endif /* ALIAS */ + +#if defined (HISTORY) + /* Forget about the history lines we have read. This is a non-interactive + subshell. */ + history_lines_this_session = 0; +#endif + +#if defined (JOB_CONTROL) + /* Forget about the way job control was working. We are in a subshell. */ + without_job_control (); + set_sigchld_handler (); + init_job_stats (); +#endif /* JOB_CONTROL */ + + /* Reset the values of the shell flags and options. */ + reset_shell_flags (); + reset_shell_options (); + reset_shopt_options (); + + /* Zero out builtin_env, since this could be a shell script run from a + sourced file with a temporary environment supplied to the `source/.' + builtin. Such variables are not supposed to be exported (empirical + testing with sh and ksh). Just throw it away; don't worry about a + memory leak. */ + if (vc_isbltnenv (shell_variables)) + shell_variables = shell_variables->down; + + clear_unwind_protect_list (0); + /* XXX -- are there other things we should be resetting here? */ + parse_and_execute_level = 0; /* nothing left to restore it */ + + /* We're no longer inside a shell function. */ + variable_context = return_catch_flag = funcnest = 0; + + executing_list = 0; /* XXX */ + + /* If we're not interactive, close the file descriptor from which we're + reading the current shell script. */ + if (interactive_shell == 0) + unset_bash_input (0); +} + +#if defined (HAVE_SETOSTYPE) && defined (_POSIX_SOURCE) +# define SETOSTYPE(x) __setostype(x) +#else +# define SETOSTYPE(x) +#endif + +#define READ_SAMPLE_BUF(file, buf, len) \ + do \ + { \ + fd = open(file, O_RDONLY); \ + if (fd >= 0) \ + { \ + len = read (fd, buf, 80); \ + close (fd); \ + } \ + else \ + len = -1; \ + } \ + while (0) + +/* Call execve (), handling interpreting shell scripts, and handling + exec failures. */ +int +shell_execve (command, args, env) + char *command; + char **args, **env; +{ + int larray, i, fd; + char sample[80]; + int sample_len; + + SETOSTYPE (0); /* Some systems use for USG/POSIX semantics */ + execve (command, args, env); + i = errno; /* error from execve() */ + CHECK_TERMSIG; + SETOSTYPE (1); + + /* If we get to this point, then start checking out the file. + Maybe it is something we can hack ourselves. */ + if (i != ENOEXEC) + { + if (file_isdir (command)) +#if defined (EISDIR) + internal_error (_("%s: %s"), command, strerror (EISDIR)); +#else + internal_error (_("%s: is a directory"), command); +#endif + else if (executable_file (command) == 0) + { + errno = i; + file_error (command); + } + /* errors not involving the path argument to execve. */ + else if (i == E2BIG || i == ENOMEM) + { + errno = i; + file_error (command); + } + else + { + /* The file has the execute bits set, but the kernel refuses to + run it for some reason. See why. */ +#if defined (HAVE_HASH_BANG_EXEC) + READ_SAMPLE_BUF (command, sample, sample_len); + sample[sample_len - 1] = '\0'; + if (sample_len > 2 && sample[0] == '#' && sample[1] == '!') + { + char *interp; + int ilen; + + interp = getinterp (sample, sample_len, (int *)NULL); + ilen = strlen (interp); + errno = i; + if (interp[ilen - 1] == '\r') + { + interp = xrealloc (interp, ilen + 2); + interp[ilen - 1] = '^'; + interp[ilen] = 'M'; + interp[ilen + 1] = '\0'; + } + sys_error (_("%s: %s: bad interpreter"), command, interp ? interp : ""); + FREE (interp); + return (EX_NOEXEC); + } +#endif + errno = i; + file_error (command); + } + return ((i == ENOENT) ? EX_NOTFOUND : EX_NOEXEC); /* XXX Posix.2 says that exit status is 126 */ + } + + /* This file is executable. + If it begins with #!, then help out people with losing operating + systems. Otherwise, check to see if it is a binary file by seeing + if the contents of the first line (or up to 80 characters) are in the + ASCII set. If it's a text file, execute the contents as shell commands, + otherwise return 126 (EX_BINARY_FILE). */ + READ_SAMPLE_BUF (command, sample, sample_len); + + if (sample_len == 0) + return (EXECUTION_SUCCESS); + + /* Is this supposed to be an executable script? + If so, the format of the line is "#! interpreter [argument]". + A single argument is allowed. The BSD kernel restricts + the length of the entire line to 32 characters (32 bytes + being the size of the BSD exec header), but we allow 80 + characters. */ + if (sample_len > 0) + { +#if !defined (HAVE_HASH_BANG_EXEC) + if (sample_len > 2 && sample[0] == '#' && sample[1] == '!') + return (execute_shell_script (sample, sample_len, command, args, env)); + else +#endif + if (check_binary_file (sample, sample_len)) + { + internal_error (_("%s: cannot execute binary file: %s"), command, strerror (i)); + return (EX_BINARY_FILE); + } + } + + /* We have committed to attempting to execute the contents of this file + as shell commands. */ + + initialize_subshell (); + + set_sigint_handler (); + + /* Insert the name of this shell into the argument list. */ + larray = strvec_len (args) + 1; + args = strvec_resize (args, larray + 1); + + for (i = larray - 1; i; i--) + args[i] = args[i - 1]; + + args[0] = shell_name; + args[1] = command; + args[larray] = (char *)NULL; + + if (args[0][0] == '-') + args[0]++; + +#if defined (RESTRICTED_SHELL) + if (restricted) + change_flag ('r', FLAG_OFF); +#endif + + if (subshell_argv) + { + /* Can't free subshell_argv[0]; that is shell_name. */ + for (i = 1; i < subshell_argc; i++) + free (subshell_argv[i]); + free (subshell_argv); + } + + dispose_command (currently_executing_command); /* XXX */ + currently_executing_command = (COMMAND *)NULL; + + subshell_argc = larray; + subshell_argv = args; + subshell_envp = env; + + unbind_args (); /* remove the positional parameters */ + + longjmp (subshell_top_level, 1); + /*NOTREACHED*/ +} + +static int +execute_intern_function (name, funcdef) + WORD_DESC *name; + FUNCTION_DEF *funcdef; +{ + SHELL_VAR *var; + + if (check_identifier (name, posixly_correct) == 0) + { + if (posixly_correct && interactive_shell == 0) + { + last_command_exit_value = EX_BADUSAGE; + jump_to_top_level (ERREXIT); + } + return (EXECUTION_FAILURE); + } + + /* Posix interpretation 383 */ + if (posixly_correct && find_special_builtin (name->word)) + { + internal_error (_("`%s': is a special builtin"), name->word); + last_command_exit_value = EX_BADUSAGE; + jump_to_top_level (ERREXIT); + } + + var = find_function (name->word); + if (var && (readonly_p (var) || noassign_p (var))) + { + if (readonly_p (var)) + internal_error (_("%s: readonly function"), var->name); + return (EXECUTION_FAILURE); + } + +#if defined (DEBUGGER) + bind_function_def (name->word, funcdef); +#endif + + bind_function (name->word, funcdef->command); + return (EXECUTION_SUCCESS); +} + +#if defined (INCLUDE_UNUSED) +#if defined (PROCESS_SUBSTITUTION) +void +close_all_files () +{ + register int i, fd_table_size; + + fd_table_size = getdtablesize (); + if (fd_table_size > 256) /* clamp to a reasonable value */ + fd_table_size = 256; + + for (i = 3; i < fd_table_size; i++) + close (i); +} +#endif /* PROCESS_SUBSTITUTION */ +#endif + +static void +close_pipes (in, out) + int in, out; +{ + if (in >= 0) + close (in); + if (out >= 0) + close (out); +} + +static void +dup_error (oldd, newd) + int oldd, newd; +{ + sys_error (_("cannot duplicate fd %d to fd %d"), oldd, newd); +} + +/* Redirect input and output to be from and to the specified pipes. + NO_PIPE and REDIRECT_BOTH are handled correctly. */ +static void +do_piping (pipe_in, pipe_out) + int pipe_in, pipe_out; +{ + if (pipe_in != NO_PIPE) + { + if (dup2 (pipe_in, 0) < 0) + dup_error (pipe_in, 0); + if (pipe_in > 0) + close (pipe_in); +#ifdef __CYGWIN__ + /* Let stdio know the fd may have changed from text to binary mode. */ + freopen (NULL, "r", stdin); +#endif /* __CYGWIN__ */ + } + if (pipe_out != NO_PIPE) + { + if (pipe_out != REDIRECT_BOTH) + { + if (dup2 (pipe_out, 1) < 0) + dup_error (pipe_out, 1); + if (pipe_out == 0 || pipe_out > 1) + close (pipe_out); + } + else + { + if (dup2 (1, 2) < 0) + dup_error (1, 2); + } +#ifdef __CYGWIN__ + /* Let stdio know the fd may have changed from text to binary mode, and + make sure to preserve stdout line buffering. */ + freopen (NULL, "w", stdout); + sh_setlinebuf (stdout); +#endif /* __CYGWIN__ */ + } +} diff --git a/.pc/bash43-022.diff/patchlevel.h b/.pc/bash43-022.diff/patchlevel.h new file mode 100644 index 0000000..bc7f5f8 --- /dev/null +++ b/.pc/bash43-022.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 21 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-023.diff/patchlevel.h b/.pc/bash43-023.diff/patchlevel.h new file mode 100644 index 0000000..c8605ba --- /dev/null +++ b/.pc/bash43-023.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 22 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-023.diff/subst.c b/.pc/bash43-023.diff/subst.c new file mode 100644 index 0000000..f94d129 --- /dev/null +++ b/.pc/bash43-023.diff/subst.c @@ -0,0 +1,9745 @@ +/* subst.c -- The part of the shell that does parameter, command, arithmetic, + and globbing substitutions. */ + +/* ``Have a little faith, there's magic in the night. You ain't a + beauty, but, hey, you're alright.'' */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" +#include +#include "chartypes.h" +#if defined (HAVE_PWD_H) +# include +#endif +#include +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" +#include "posixstat.h" +#include "bashintl.h" + +#include "shell.h" +#include "parser.h" +#include "flags.h" +#include "jobs.h" +#include "execute_cmd.h" +#include "filecntl.h" +#include "trap.h" +#include "pathexp.h" +#include "mailcheck.h" + +#include "shmbutil.h" +#include "typemax.h" + +#include "builtins/getopt.h" +#include "builtins/common.h" + +#include "builtins/builtext.h" + +#include +#include + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +/* The size that strings change by. */ +#define DEFAULT_INITIAL_ARRAY_SIZE 112 +#define DEFAULT_ARRAY_SIZE 128 + +/* Variable types. */ +#define VT_VARIABLE 0 +#define VT_POSPARMS 1 +#define VT_ARRAYVAR 2 +#define VT_ARRAYMEMBER 3 +#define VT_ASSOCVAR 4 + +#define VT_STARSUB 128 /* $* or ${array[*]} -- used to split */ + +/* Flags for quoted_strchr */ +#define ST_BACKSL 0x01 +#define ST_CTLESC 0x02 +#define ST_SQUOTE 0x04 /* unused yet */ +#define ST_DQUOTE 0x08 /* unused yet */ + +/* Flags for the `pflags' argument to param_expand() */ +#define PF_NOCOMSUB 0x01 /* Do not perform command substitution */ +#define PF_IGNUNBOUND 0x02 /* ignore unbound vars even if -u set */ +#define PF_NOSPLIT2 0x04 /* same as W_NOSPLIT2 */ +#define PF_ASSIGNRHS 0x08 /* same as W_ASSIGNRHS */ + +/* These defs make it easier to use the editor. */ +#define LBRACE '{' +#define RBRACE '}' +#define LPAREN '(' +#define RPAREN ')' +#define LBRACK '[' +#define RBRACK ']' + +#if defined (HANDLE_MULTIBYTE) +#define WLPAREN L'(' +#define WRPAREN L')' +#endif + +/* Evaluates to 1 if C is one of the shell's special parameters whose length + can be taken, but is also one of the special expansion characters. */ +#define VALID_SPECIAL_LENGTH_PARAM(c) \ + ((c) == '-' || (c) == '?' || (c) == '#') + +/* Evaluates to 1 if C is one of the shell's special parameters for which an + indirect variable reference may be made. */ +#define VALID_INDIR_PARAM(c) \ + ((posixly_correct == 0 && (c) == '#') || (posixly_correct == 0 && (c) == '?') || (c) == '@' || (c) == '*') + +/* Evaluates to 1 if C is one of the OP characters that follows the parameter + in ${parameter[:]OPword}. */ +#define VALID_PARAM_EXPAND_CHAR(c) (sh_syntaxtab[(unsigned char)c] & CSUBSTOP) + +/* Evaluates to 1 if this is one of the shell's special variables. */ +#define SPECIAL_VAR(name, wi) \ + ((DIGIT (*name) && all_digits (name)) || \ + (name[1] == '\0' && (sh_syntaxtab[(unsigned char)*name] & CSPECVAR)) || \ + (wi && name[2] == '\0' && VALID_INDIR_PARAM (name[1]))) + +/* An expansion function that takes a string and a quoted flag and returns + a WORD_LIST *. Used as the type of the third argument to + expand_string_if_necessary(). */ +typedef WORD_LIST *EXPFUNC __P((char *, int)); + +/* Process ID of the last command executed within command substitution. */ +pid_t last_command_subst_pid = NO_PID; +pid_t current_command_subst_pid = NO_PID; + +/* Variables used to keep track of the characters in IFS. */ +SHELL_VAR *ifs_var; +char *ifs_value; +unsigned char ifs_cmap[UCHAR_MAX + 1]; +int ifs_is_set, ifs_is_null; + +#if defined (HANDLE_MULTIBYTE) +unsigned char ifs_firstc[MB_LEN_MAX]; +size_t ifs_firstc_len; +#else +unsigned char ifs_firstc; +#endif + +/* Sentinel to tell when we are performing variable assignments preceding a + command name and putting them into the environment. Used to make sure + we use the temporary environment when looking up variable values. */ +int assigning_in_environment; + +/* Used to hold a list of variable assignments preceding a command. Global + so the SIGCHLD handler in jobs.c can unwind-protect it when it runs a + SIGCHLD trap and so it can be saved and restored by the trap handlers. */ +WORD_LIST *subst_assign_varlist = (WORD_LIST *)NULL; + +/* Extern functions and variables from different files. */ +extern int last_command_exit_value, last_command_exit_signal; +extern int subshell_environment, line_number; +extern int subshell_level, parse_and_execute_level, sourcelevel; +extern int eof_encountered; +extern int return_catch_flag, return_catch_value; +extern pid_t dollar_dollar_pid; +extern int posixly_correct; +extern char *this_command_name; +extern struct fd_bitmap *current_fds_to_close; +extern int wordexp_only; +extern int expanding_redir; +extern int tempenv_assign_error; +extern int builtin_ignoring_errexit; + +#if !defined (HAVE_WCSDUP) && defined (HANDLE_MULTIBYTE) +extern wchar_t *wcsdup __P((const wchar_t *)); +#endif + +/* Non-zero means to allow unmatched globbed filenames to expand to + a null file. */ +int allow_null_glob_expansion; + +/* Non-zero means to throw an error when globbing fails to match anything. */ +int fail_glob_expansion; + +#if 0 +/* Variables to keep track of which words in an expanded word list (the + output of expand_word_list_internal) are the result of globbing + expansions. GLOB_ARGV_FLAGS is used by execute_cmd.c. + (CURRENTLY UNUSED). */ +char *glob_argv_flags; +static int glob_argv_flags_size; +#endif + +static WORD_LIST expand_word_error, expand_word_fatal; +static WORD_DESC expand_wdesc_error, expand_wdesc_fatal; +static char expand_param_error, expand_param_fatal; +static char extract_string_error, extract_string_fatal; + +/* Tell the expansion functions to not longjmp back to top_level on fatal + errors. Enabled when doing completion and prompt string expansion. */ +static int no_longjmp_on_fatal_error = 0; + +/* Set by expand_word_unsplit; used to inhibit splitting and re-joining + $* on $IFS, primarily when doing assignment statements. */ +static int expand_no_split_dollar_star = 0; + +/* A WORD_LIST of words to be expanded by expand_word_list_internal, + without any leading variable assignments. */ +static WORD_LIST *garglist = (WORD_LIST *)NULL; + +static char *quoted_substring __P((char *, int, int)); +static int quoted_strlen __P((char *)); +static char *quoted_strchr __P((char *, int, int)); + +static char *expand_string_if_necessary __P((char *, int, EXPFUNC *)); +static inline char *expand_string_to_string_internal __P((char *, int, EXPFUNC *)); +static WORD_LIST *call_expand_word_internal __P((WORD_DESC *, int, int, int *, int *)); +static WORD_LIST *expand_string_internal __P((char *, int)); +static WORD_LIST *expand_string_leave_quoted __P((char *, int)); +static WORD_LIST *expand_string_for_rhs __P((char *, int, int *, int *)); + +static WORD_LIST *list_quote_escapes __P((WORD_LIST *)); +static WORD_LIST *list_dequote_escapes __P((WORD_LIST *)); + +static char *make_quoted_char __P((int)); +static WORD_LIST *quote_list __P((WORD_LIST *)); + +static int unquoted_substring __P((char *, char *)); +static int unquoted_member __P((int, char *)); + +#if defined (ARRAY_VARS) +static SHELL_VAR *do_compound_assignment __P((char *, char *, int)); +#endif +static int do_assignment_internal __P((const WORD_DESC *, int)); + +static char *string_extract_verbatim __P((char *, size_t, int *, char *, int)); +static char *string_extract __P((char *, int *, char *, int)); +static char *string_extract_double_quoted __P((char *, int *, int)); +static inline char *string_extract_single_quoted __P((char *, int *)); +static inline int skip_single_quoted __P((const char *, size_t, int)); +static int skip_double_quoted __P((char *, size_t, int)); +static char *extract_delimited_string __P((char *, int *, char *, char *, char *, int)); +static char *extract_dollar_brace_string __P((char *, int *, int, int)); +static int skip_matched_pair __P((const char *, int, int, int, int)); + +static char *pos_params __P((char *, int, int, int)); + +static unsigned char *mb_getcharlens __P((char *, int)); + +static char *remove_upattern __P((char *, char *, int)); +#if defined (HANDLE_MULTIBYTE) +static wchar_t *remove_wpattern __P((wchar_t *, size_t, wchar_t *, int)); +#endif +static char *remove_pattern __P((char *, char *, int)); + +static int match_upattern __P((char *, char *, int, char **, char **)); +#if defined (HANDLE_MULTIBYTE) +static int match_wpattern __P((wchar_t *, char **, size_t, wchar_t *, int, char **, char **)); +#endif +static int match_pattern __P((char *, char *, int, char **, char **)); +static int getpatspec __P((int, char *)); +static char *getpattern __P((char *, int, int)); +static char *variable_remove_pattern __P((char *, char *, int, int)); +static char *list_remove_pattern __P((WORD_LIST *, char *, int, int, int)); +static char *parameter_list_remove_pattern __P((int, char *, int, int)); +#ifdef ARRAY_VARS +static char *array_remove_pattern __P((SHELL_VAR *, char *, int, char *, int)); +#endif +static char *parameter_brace_remove_pattern __P((char *, char *, int, char *, int, int, int)); + +static char *process_substitute __P((char *, int)); + +static char *read_comsub __P((int, int, int *)); + +#ifdef ARRAY_VARS +static arrayind_t array_length_reference __P((char *)); +#endif + +static int valid_brace_expansion_word __P((char *, int)); +static int chk_atstar __P((char *, int, int *, int *)); +static int chk_arithsub __P((const char *, int)); + +static WORD_DESC *parameter_brace_expand_word __P((char *, int, int, int, arrayind_t *)); +static char *parameter_brace_find_indir __P((char *, int, int, int)); +static WORD_DESC *parameter_brace_expand_indir __P((char *, int, int, int *, int *)); +static WORD_DESC *parameter_brace_expand_rhs __P((char *, char *, int, int, int *, int *)); +static void parameter_brace_expand_error __P((char *, char *)); + +static int valid_length_expression __P((char *)); +static intmax_t parameter_brace_expand_length __P((char *)); + +static char *skiparith __P((char *, int)); +static int verify_substring_values __P((SHELL_VAR *, char *, char *, int, intmax_t *, intmax_t *)); +static int get_var_and_type __P((char *, char *, arrayind_t, int, int, SHELL_VAR **, char **)); +static char *mb_substring __P((char *, int, int)); +static char *parameter_brace_substring __P((char *, char *, int, char *, int, int)); + +static int shouldexp_replacement __P((char *)); + +static char *pos_params_pat_subst __P((char *, char *, char *, int)); + +static char *parameter_brace_patsub __P((char *, char *, int, char *, int, int)); + +static char *pos_params_casemod __P((char *, char *, int, int)); +static char *parameter_brace_casemod __P((char *, char *, int, int, char *, int, int)); + +static WORD_DESC *parameter_brace_expand __P((char *, int *, int, int, int *, int *)); +static WORD_DESC *param_expand __P((char *, int *, int, int *, int *, int *, int *, int)); + +static WORD_LIST *expand_word_internal __P((WORD_DESC *, int, int, int *, int *)); + +static WORD_LIST *word_list_split __P((WORD_LIST *)); + +static void exp_jump_to_top_level __P((int)); + +static WORD_LIST *separate_out_assignments __P((WORD_LIST *)); +static WORD_LIST *glob_expand_word_list __P((WORD_LIST *, int)); +#ifdef BRACE_EXPANSION +static WORD_LIST *brace_expand_word_list __P((WORD_LIST *, int)); +#endif +#if defined (ARRAY_VARS) +static int make_internal_declare __P((char *, char *)); +#endif +static WORD_LIST *shell_expand_word_list __P((WORD_LIST *, int)); +static WORD_LIST *expand_word_list_internal __P((WORD_LIST *, int)); + +/* **************************************************************** */ +/* */ +/* Utility Functions */ +/* */ +/* **************************************************************** */ + +#if defined (DEBUG) +void +dump_word_flags (flags) + int flags; +{ + int f; + + f = flags; + fprintf (stderr, "%d -> ", f); + if (f & W_ASSIGNASSOC) + { + f &= ~W_ASSIGNASSOC; + fprintf (stderr, "W_ASSIGNASSOC%s", f ? "|" : ""); + } + if (f & W_ASSIGNARRAY) + { + f &= ~W_ASSIGNARRAY; + fprintf (stderr, "W_ASSIGNARRAY%s", f ? "|" : ""); + } + if (f & W_HASCTLESC) + { + f &= ~W_HASCTLESC; + fprintf (stderr, "W_HASCTLESC%s", f ? "|" : ""); + } + if (f & W_NOPROCSUB) + { + f &= ~W_NOPROCSUB; + fprintf (stderr, "W_NOPROCSUB%s", f ? "|" : ""); + } + if (f & W_DQUOTE) + { + f &= ~W_DQUOTE; + fprintf (stderr, "W_DQUOTE%s", f ? "|" : ""); + } + if (f & W_HASQUOTEDNULL) + { + f &= ~W_HASQUOTEDNULL; + fprintf (stderr, "W_HASQUOTEDNULL%s", f ? "|" : ""); + } + if (f & W_ASSIGNARG) + { + f &= ~W_ASSIGNARG; + fprintf (stderr, "W_ASSIGNARG%s", f ? "|" : ""); + } + if (f & W_ASSNBLTIN) + { + f &= ~W_ASSNBLTIN; + fprintf (stderr, "W_ASSNBLTIN%s", f ? "|" : ""); + } + if (f & W_ASSNGLOBAL) + { + f &= ~W_ASSNGLOBAL; + fprintf (stderr, "W_ASSNGLOBAL%s", f ? "|" : ""); + } + if (f & W_ASSIGNINT) + { + f &= ~W_ASSIGNINT; + fprintf (stderr, "W_ASSIGNINT%s", f ? "|" : ""); + } + if (f & W_COMPASSIGN) + { + f &= ~W_COMPASSIGN; + fprintf (stderr, "W_COMPASSIGN%s", f ? "|" : ""); + } + if (f & W_NOEXPAND) + { + f &= ~W_NOEXPAND; + fprintf (stderr, "W_NOEXPAND%s", f ? "|" : ""); + } + if (f & W_ITILDE) + { + f &= ~W_ITILDE; + fprintf (stderr, "W_ITILDE%s", f ? "|" : ""); + } + if (f & W_NOTILDE) + { + f &= ~W_NOTILDE; + fprintf (stderr, "W_NOTILDE%s", f ? "|" : ""); + } + if (f & W_ASSIGNRHS) + { + f &= ~W_ASSIGNRHS; + fprintf (stderr, "W_ASSIGNRHS%s", f ? "|" : ""); + } + if (f & W_NOCOMSUB) + { + f &= ~W_NOCOMSUB; + fprintf (stderr, "W_NOCOMSUB%s", f ? "|" : ""); + } + if (f & W_DOLLARSTAR) + { + f &= ~W_DOLLARSTAR; + fprintf (stderr, "W_DOLLARSTAR%s", f ? "|" : ""); + } + if (f & W_DOLLARAT) + { + f &= ~W_DOLLARAT; + fprintf (stderr, "W_DOLLARAT%s", f ? "|" : ""); + } + if (f & W_TILDEEXP) + { + f &= ~W_TILDEEXP; + fprintf (stderr, "W_TILDEEXP%s", f ? "|" : ""); + } + if (f & W_NOSPLIT2) + { + f &= ~W_NOSPLIT2; + fprintf (stderr, "W_NOSPLIT2%s", f ? "|" : ""); + } + if (f & W_NOSPLIT) + { + f &= ~W_NOSPLIT; + fprintf (stderr, "W_NOSPLIT%s", f ? "|" : ""); + } + if (f & W_NOBRACE) + { + f &= ~W_NOBRACE; + fprintf (stderr, "W_NOBRACE%s", f ? "|" : ""); + } + if (f & W_NOGLOB) + { + f &= ~W_NOGLOB; + fprintf (stderr, "W_NOGLOB%s", f ? "|" : ""); + } + if (f & W_SPLITSPACE) + { + f &= ~W_SPLITSPACE; + fprintf (stderr, "W_SPLITSPACE%s", f ? "|" : ""); + } + if (f & W_ASSIGNMENT) + { + f &= ~W_ASSIGNMENT; + fprintf (stderr, "W_ASSIGNMENT%s", f ? "|" : ""); + } + if (f & W_QUOTED) + { + f &= ~W_QUOTED; + fprintf (stderr, "W_QUOTED%s", f ? "|" : ""); + } + if (f & W_HASDOLLAR) + { + f &= ~W_HASDOLLAR; + fprintf (stderr, "W_HASDOLLAR%s", f ? "|" : ""); + } + fprintf (stderr, "\n"); + fflush (stderr); +} +#endif + +#ifdef INCLUDE_UNUSED +static char * +quoted_substring (string, start, end) + char *string; + int start, end; +{ + register int len, l; + register char *result, *s, *r; + + len = end - start; + + /* Move to string[start], skipping quoted characters. */ + for (s = string, l = 0; *s && l < start; ) + { + if (*s == CTLESC) + { + s++; + continue; + } + l++; + if (*s == 0) + break; + } + + r = result = (char *)xmalloc (2*len + 1); /* save room for quotes */ + + /* Copy LEN characters, including quote characters. */ + s = string + l; + for (l = 0; l < len; s++) + { + if (*s == CTLESC) + *r++ = *s++; + *r++ = *s; + l++; + if (*s == 0) + break; + } + *r = '\0'; + return result; +} +#endif + +#ifdef INCLUDE_UNUSED +/* Return the length of S, skipping over quoted characters */ +static int +quoted_strlen (s) + char *s; +{ + register char *p; + int i; + + i = 0; + for (p = s; *p; p++) + { + if (*p == CTLESC) + { + p++; + if (*p == 0) + return (i + 1); + } + i++; + } + + return i; +} +#endif + +/* Find the first occurrence of character C in string S, obeying shell + quoting rules. If (FLAGS & ST_BACKSL) is non-zero, backslash-escaped + characters are skipped. If (FLAGS & ST_CTLESC) is non-zero, characters + escaped with CTLESC are skipped. */ +static char * +quoted_strchr (s, c, flags) + char *s; + int c, flags; +{ + register char *p; + + for (p = s; *p; p++) + { + if (((flags & ST_BACKSL) && *p == '\\') + || ((flags & ST_CTLESC) && *p == CTLESC)) + { + p++; + if (*p == '\0') + return ((char *)NULL); + continue; + } + else if (*p == c) + return p; + } + return ((char *)NULL); +} + +/* Return 1 if CHARACTER appears in an unquoted portion of + STRING. Return 0 otherwise. CHARACTER must be a single-byte character. */ +static int +unquoted_member (character, string) + int character; + char *string; +{ + size_t slen; + int sindex, c; + DECLARE_MBSTATE; + + slen = strlen (string); + sindex = 0; + while (c = string[sindex]) + { + if (c == character) + return (1); + + switch (c) + { + default: + ADVANCE_CHAR (string, slen, sindex); + break; + + case '\\': + sindex++; + if (string[sindex]) + ADVANCE_CHAR (string, slen, sindex); + break; + + case '\'': + sindex = skip_single_quoted (string, slen, ++sindex); + break; + + case '"': + sindex = skip_double_quoted (string, slen, ++sindex); + break; + } + } + return (0); +} + +/* Return 1 if SUBSTR appears in an unquoted portion of STRING. */ +static int +unquoted_substring (substr, string) + char *substr, *string; +{ + size_t slen; + int sindex, c, sublen; + DECLARE_MBSTATE; + + if (substr == 0 || *substr == '\0') + return (0); + + slen = strlen (string); + sublen = strlen (substr); + for (sindex = 0; c = string[sindex]; ) + { + if (STREQN (string + sindex, substr, sublen)) + return (1); + + switch (c) + { + case '\\': + sindex++; + if (string[sindex]) + ADVANCE_CHAR (string, slen, sindex); + break; + + case '\'': + sindex = skip_single_quoted (string, slen, ++sindex); + break; + + case '"': + sindex = skip_double_quoted (string, slen, ++sindex); + break; + + default: + ADVANCE_CHAR (string, slen, sindex); + break; + } + } + return (0); +} + +/* Most of the substitutions must be done in parallel. In order + to avoid using tons of unclear goto's, I have some functions + for manipulating malloc'ed strings. They all take INDX, a + pointer to an integer which is the offset into the string + where manipulation is taking place. They also take SIZE, a + pointer to an integer which is the current length of the + character array for this string. */ + +/* Append SOURCE to TARGET at INDEX. SIZE is the current amount + of space allocated to TARGET. SOURCE can be NULL, in which + case nothing happens. Gets rid of SOURCE by freeing it. + Returns TARGET in case the location has changed. */ +INLINE char * +sub_append_string (source, target, indx, size) + char *source, *target; + int *indx, *size; +{ + if (source) + { + int srclen, n; + + srclen = STRLEN (source); + if (srclen >= (int)(*size - *indx)) + { + n = srclen + *indx; + n = (n + DEFAULT_ARRAY_SIZE) - (n % DEFAULT_ARRAY_SIZE); + target = (char *)xrealloc (target, (*size = n)); + } + + FASTCOPY (source, target + *indx, srclen); + *indx += srclen; + target[*indx] = '\0'; + + free (source); + } + return (target); +} + +#if 0 +/* UNUSED */ +/* Append the textual representation of NUMBER to TARGET. + INDX and SIZE are as in SUB_APPEND_STRING. */ +char * +sub_append_number (number, target, indx, size) + intmax_t number; + int *indx, *size; + char *target; +{ + char *temp; + + temp = itos (number); + return (sub_append_string (temp, target, indx, size)); +} +#endif + +/* Extract a substring from STRING, starting at SINDEX and ending with + one of the characters in CHARLIST. Don't make the ending character + part of the string. Leave SINDEX pointing at the ending character. + Understand about backslashes in the string. If (flags & SX_VARNAME) + is non-zero, and array variables have been compiled into the shell, + everything between a `[' and a corresponding `]' is skipped over. + If (flags & SX_NOALLOC) is non-zero, don't return the substring, just + update SINDEX. If (flags & SX_REQMATCH) is non-zero, the string must + contain a closing character from CHARLIST. */ +static char * +string_extract (string, sindex, charlist, flags) + char *string; + int *sindex; + char *charlist; + int flags; +{ + register int c, i; + int found; + size_t slen; + char *temp; + DECLARE_MBSTATE; + + slen = (MB_CUR_MAX > 1) ? strlen (string + *sindex) + *sindex : 0; + i = *sindex; + found = 0; + while (c = string[i]) + { + if (c == '\\') + { + if (string[i + 1]) + i++; + else + break; + } +#if defined (ARRAY_VARS) + else if ((flags & SX_VARNAME) && c == '[') + { + int ni; + /* If this is an array subscript, skip over it and continue. */ + ni = skipsubscript (string, i, 0); + if (string[ni] == ']') + i = ni; + } +#endif + else if (MEMBER (c, charlist)) + { + found = 1; + break; + } + + ADVANCE_CHAR (string, slen, i); + } + + /* If we had to have a matching delimiter and didn't find one, return an + error and let the caller deal with it. */ + if ((flags & SX_REQMATCH) && found == 0) + { + *sindex = i; + return (&extract_string_error); + } + + temp = (flags & SX_NOALLOC) ? (char *)NULL : substring (string, *sindex, i); + *sindex = i; + + return (temp); +} + +/* Extract the contents of STRING as if it is enclosed in double quotes. + SINDEX, when passed in, is the offset of the character immediately + following the opening double quote; on exit, SINDEX is left pointing after + the closing double quote. If STRIPDQ is non-zero, unquoted double + quotes are stripped and the string is terminated by a null byte. + Backslashes between the embedded double quotes are processed. If STRIPDQ + is zero, an unquoted `"' terminates the string. */ +static char * +string_extract_double_quoted (string, sindex, stripdq) + char *string; + int *sindex, stripdq; +{ + size_t slen; + char *send; + int j, i, t; + unsigned char c; + char *temp, *ret; /* The new string we return. */ + int pass_next, backquote, si; /* State variables for the machine. */ + int dquote; + DECLARE_MBSTATE; + + slen = strlen (string + *sindex) + *sindex; + send = string + slen; + + pass_next = backquote = dquote = 0; + temp = (char *)xmalloc (1 + slen - *sindex); + + j = 0; + i = *sindex; + while (c = string[i]) + { + /* Process a character that was quoted by a backslash. */ + if (pass_next) + { + /* XXX - take another look at this in light of Interp 221 */ + /* Posix.2 sez: + + ``The backslash shall retain its special meaning as an escape + character only when followed by one of the characters: + $ ` " \ ''. + + If STRIPDQ is zero, we handle the double quotes here and let + expand_word_internal handle the rest. If STRIPDQ is non-zero, + we have already been through one round of backslash stripping, + and want to strip these backslashes only if DQUOTE is non-zero, + indicating that we are inside an embedded double-quoted string. */ + + /* If we are in an embedded quoted string, then don't strip + backslashes before characters for which the backslash + retains its special meaning, but remove backslashes in + front of other characters. If we are not in an + embedded quoted string, don't strip backslashes at all. + This mess is necessary because the string was already + surrounded by double quotes (and sh has some really weird + quoting rules). + The returned string will be run through expansion as if + it were double-quoted. */ + if ((stripdq == 0 && c != '"') || + (stripdq && ((dquote && (sh_syntaxtab[c] & CBSDQUOTE)) || dquote == 0))) + temp[j++] = '\\'; + pass_next = 0; + +add_one_character: + COPY_CHAR_I (temp, j, string, send, i); + continue; + } + + /* A backslash protects the next character. The code just above + handles preserving the backslash in front of any character but + a double quote. */ + if (c == '\\') + { + pass_next++; + i++; + continue; + } + + /* Inside backquotes, ``the portion of the quoted string from the + initial backquote and the characters up to the next backquote + that is not preceded by a backslash, having escape characters + removed, defines that command''. */ + if (backquote) + { + if (c == '`') + backquote = 0; + temp[j++] = c; + i++; + continue; + } + + if (c == '`') + { + temp[j++] = c; + backquote++; + i++; + continue; + } + + /* Pass everything between `$(' and the matching `)' or a quoted + ${ ... } pair through according to the Posix.2 specification. */ + if (c == '$' && ((string[i + 1] == LPAREN) || (string[i + 1] == LBRACE))) + { + int free_ret = 1; + + si = i + 2; + if (string[i + 1] == LPAREN) + ret = extract_command_subst (string, &si, 0); + else + ret = extract_dollar_brace_string (string, &si, Q_DOUBLE_QUOTES, 0); + + temp[j++] = '$'; + temp[j++] = string[i + 1]; + + /* Just paranoia; ret will not be 0 unless no_longjmp_on_fatal_error + is set. */ + if (ret == 0 && no_longjmp_on_fatal_error) + { + free_ret = 0; + ret = string + i + 2; + } + + for (t = 0; ret[t]; t++, j++) + temp[j] = ret[t]; + temp[j] = string[si]; + + if (string[si]) + { + j++; + i = si + 1; + } + else + i = si; + + if (free_ret) + free (ret); + continue; + } + + /* Add any character but a double quote to the quoted string we're + accumulating. */ + if (c != '"') + goto add_one_character; + + /* c == '"' */ + if (stripdq) + { + dquote ^= 1; + i++; + continue; + } + + break; + } + temp[j] = '\0'; + + /* Point to after the closing quote. */ + if (c) + i++; + *sindex = i; + + return (temp); +} + +/* This should really be another option to string_extract_double_quoted. */ +static int +skip_double_quoted (string, slen, sind) + char *string; + size_t slen; + int sind; +{ + int c, i; + char *ret; + int pass_next, backquote, si; + DECLARE_MBSTATE; + + pass_next = backquote = 0; + i = sind; + while (c = string[i]) + { + if (pass_next) + { + pass_next = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next++; + i++; + continue; + } + else if (backquote) + { + if (c == '`') + backquote = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '`') + { + backquote++; + i++; + continue; + } + else if (c == '$' && ((string[i + 1] == LPAREN) || (string[i + 1] == LBRACE))) + { + si = i + 2; + if (string[i + 1] == LPAREN) + ret = extract_command_subst (string, &si, SX_NOALLOC); + else + ret = extract_dollar_brace_string (string, &si, Q_DOUBLE_QUOTES, SX_NOALLOC); + + i = si + 1; + continue; + } + else if (c != '"') + { + ADVANCE_CHAR (string, slen, i); + continue; + } + else + break; + } + + if (c) + i++; + + return (i); +} + +/* Extract the contents of STRING as if it is enclosed in single quotes. + SINDEX, when passed in, is the offset of the character immediately + following the opening single quote; on exit, SINDEX is left pointing after + the closing single quote. */ +static inline char * +string_extract_single_quoted (string, sindex) + char *string; + int *sindex; +{ + register int i; + size_t slen; + char *t; + DECLARE_MBSTATE; + + /* Don't need slen for ADVANCE_CHAR unless multibyte chars possible. */ + slen = (MB_CUR_MAX > 1) ? strlen (string + *sindex) + *sindex : 0; + i = *sindex; + while (string[i] && string[i] != '\'') + ADVANCE_CHAR (string, slen, i); + + t = substring (string, *sindex, i); + + if (string[i]) + i++; + *sindex = i; + + return (t); +} + +static inline int +skip_single_quoted (string, slen, sind) + const char *string; + size_t slen; + int sind; +{ + register int c; + DECLARE_MBSTATE; + + c = sind; + while (string[c] && string[c] != '\'') + ADVANCE_CHAR (string, slen, c); + + if (string[c]) + c++; + return c; +} + +/* Just like string_extract, but doesn't hack backslashes or any of + that other stuff. Obeys CTLESC quoting. Used to do splitting on $IFS. */ +static char * +string_extract_verbatim (string, slen, sindex, charlist, flags) + char *string; + size_t slen; + int *sindex; + char *charlist; + int flags; +{ + register int i; +#if defined (HANDLE_MULTIBYTE) + size_t clen; + wchar_t *wcharlist; +#endif + int c; + char *temp; + DECLARE_MBSTATE; + + if (charlist[0] == '\'' && charlist[1] == '\0') + { + temp = string_extract_single_quoted (string, sindex); + --*sindex; /* leave *sindex at separator character */ + return temp; + } + + i = *sindex; +#if 0 + /* See how the MBLEN and ADVANCE_CHAR macros work to understand why we need + this only if MB_CUR_MAX > 1. */ + slen = (MB_CUR_MAX > 1) ? strlen (string + *sindex) + *sindex : 1; +#endif +#if defined (HANDLE_MULTIBYTE) + clen = strlen (charlist); + wcharlist = 0; +#endif + while (c = string[i]) + { +#if defined (HANDLE_MULTIBYTE) + size_t mblength; +#endif + if ((flags & SX_NOCTLESC) == 0 && c == CTLESC) + { + i += 2; + continue; + } + /* Even if flags contains SX_NOCTLESC, we let CTLESC quoting CTLNUL + through, to protect the CTLNULs from later calls to + remove_quoted_nulls. */ + else if ((flags & SX_NOESCCTLNUL) == 0 && c == CTLESC && string[i+1] == CTLNUL) + { + i += 2; + continue; + } + +#if defined (HANDLE_MULTIBYTE) + mblength = MBLEN (string + i, slen - i); + if (mblength > 1) + { + wchar_t wc; + mblength = mbtowc (&wc, string + i, slen - i); + if (MB_INVALIDCH (mblength)) + { + if (MEMBER (c, charlist)) + break; + } + else + { + if (wcharlist == 0) + { + size_t len; + len = mbstowcs (wcharlist, charlist, 0); + if (len == -1) + len = 0; + wcharlist = (wchar_t *)xmalloc (sizeof (wchar_t) * (len + 1)); + mbstowcs (wcharlist, charlist, len + 1); + } + + if (wcschr (wcharlist, wc)) + break; + } + } + else +#endif + if (MEMBER (c, charlist)) + break; + + ADVANCE_CHAR (string, slen, i); + } + +#if defined (HANDLE_MULTIBYTE) + FREE (wcharlist); +#endif + + temp = substring (string, *sindex, i); + *sindex = i; + + return (temp); +} + +/* Extract the $( construct in STRING, and return a new string. + Start extracting at (SINDEX) as if we had just seen "$(". + Make (SINDEX) get the position of the matching ")". ) + XFLAGS is additional flags to pass to other extraction functions. */ +char * +extract_command_subst (string, sindex, xflags) + char *string; + int *sindex; + int xflags; +{ + if (string[*sindex] == LPAREN) + return (extract_delimited_string (string, sindex, "$(", "(", ")", xflags|SX_COMMAND)); /*)*/ + else + { + xflags |= (no_longjmp_on_fatal_error ? SX_NOLONGJMP : 0); + return (xparse_dolparen (string, string+*sindex, sindex, xflags)); + } +} + +/* Extract the $[ construct in STRING, and return a new string. (]) + Start extracting at (SINDEX) as if we had just seen "$[". + Make (SINDEX) get the position of the matching "]". */ +char * +extract_arithmetic_subst (string, sindex) + char *string; + int *sindex; +{ + return (extract_delimited_string (string, sindex, "$[", "[", "]", 0)); /*]*/ +} + +#if defined (PROCESS_SUBSTITUTION) +/* Extract the <( or >( construct in STRING, and return a new string. + Start extracting at (SINDEX) as if we had just seen "<(". + Make (SINDEX) get the position of the matching ")". */ /*))*/ +char * +extract_process_subst (string, starter, sindex) + char *string; + char *starter; + int *sindex; +{ + return (extract_delimited_string (string, sindex, starter, "(", ")", SX_COMMAND)); +} +#endif /* PROCESS_SUBSTITUTION */ + +#if defined (ARRAY_VARS) +/* This can be fooled by unquoted right parens in the passed string. If + each caller verifies that the last character in STRING is a right paren, + we don't even need to call extract_delimited_string. */ +char * +extract_array_assignment_list (string, sindex) + char *string; + int *sindex; +{ + int slen; + char *ret; + + slen = strlen (string); /* ( */ + if (string[slen - 1] == ')') + { + ret = substring (string, *sindex, slen - 1); + *sindex = slen - 1; + return ret; + } + return 0; +} +#endif + +/* Extract and create a new string from the contents of STRING, a + character string delimited with OPENER and CLOSER. SINDEX is + the address of an int describing the current offset in STRING; + it should point to just after the first OPENER found. On exit, + SINDEX gets the position of the last character of the matching CLOSER. + If OPENER is more than a single character, ALT_OPENER, if non-null, + contains a character string that can also match CLOSER and thus + needs to be skipped. */ +static char * +extract_delimited_string (string, sindex, opener, alt_opener, closer, flags) + char *string; + int *sindex; + char *opener, *alt_opener, *closer; + int flags; +{ + int i, c, si; + size_t slen; + char *t, *result; + int pass_character, nesting_level, in_comment; + int len_closer, len_opener, len_alt_opener; + DECLARE_MBSTATE; + + slen = strlen (string + *sindex) + *sindex; + len_opener = STRLEN (opener); + len_alt_opener = STRLEN (alt_opener); + len_closer = STRLEN (closer); + + pass_character = in_comment = 0; + + nesting_level = 1; + i = *sindex; + + while (nesting_level) + { + c = string[i]; + + if (c == 0) + break; + + if (in_comment) + { + if (c == '\n') + in_comment = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + + if (pass_character) /* previous char was backslash */ + { + pass_character = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + + /* Not exactly right yet; should handle shell metacharacters and + multibyte characters, too. See COMMENT_BEGIN define in parse.y */ + if ((flags & SX_COMMAND) && c == '#' && (i == 0 || string[i - 1] == '\n' || shellblank (string[i - 1]))) + { + in_comment = 1; + ADVANCE_CHAR (string, slen, i); + continue; + } + + if (c == CTLESC || c == '\\') + { + pass_character++; + i++; + continue; + } + + /* Process a nested command substitution, but only if we're parsing an + arithmetic substitution. */ + if ((flags & SX_COMMAND) && string[i] == '$' && string[i+1] == LPAREN) + { + si = i + 2; + t = extract_command_subst (string, &si, flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Process a nested OPENER. */ + if (STREQN (string + i, opener, len_opener)) + { + si = i + len_opener; + t = extract_delimited_string (string, &si, opener, alt_opener, closer, flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Process a nested ALT_OPENER */ + if (len_alt_opener && STREQN (string + i, alt_opener, len_alt_opener)) + { + si = i + len_alt_opener; + t = extract_delimited_string (string, &si, alt_opener, alt_opener, closer, flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* If the current substring terminates the delimited string, decrement + the nesting level. */ + if (STREQN (string + i, closer, len_closer)) + { + i += len_closer - 1; /* move to last byte of the closer */ + nesting_level--; + if (nesting_level == 0) + break; + } + + /* Pass old-style command substitution through verbatim. */ + if (c == '`') + { + si = i + 1; + t = string_extract (string, &si, "`", flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Pass single-quoted and double-quoted strings through verbatim. */ + if (c == '\'' || c == '"') + { + si = i + 1; + i = (c == '\'') ? skip_single_quoted (string, slen, si) + : skip_double_quoted (string, slen, si); + continue; + } + + /* move past this character, which was not special. */ + ADVANCE_CHAR (string, slen, i); + } + + if (c == 0 && nesting_level) + { + if (no_longjmp_on_fatal_error == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("bad substitution: no closing `%s' in %s"), closer, string); + exp_jump_to_top_level (DISCARD); + } + else + { + *sindex = i; + return (char *)NULL; + } + } + + si = i - *sindex - len_closer + 1; + if (flags & SX_NOALLOC) + result = (char *)NULL; + else + { + result = (char *)xmalloc (1 + si); + strncpy (result, string + *sindex, si); + result[si] = '\0'; + } + *sindex = i; + + return (result); +} + +/* Extract a parameter expansion expression within ${ and } from STRING. + Obey the Posix.2 rules for finding the ending `}': count braces while + skipping over enclosed quoted strings and command substitutions. + SINDEX is the address of an int describing the current offset in STRING; + it should point to just after the first `{' found. On exit, SINDEX + gets the position of the matching `}'. QUOTED is non-zero if this + occurs inside double quotes. */ +/* XXX -- this is very similar to extract_delimited_string -- XXX */ +static char * +extract_dollar_brace_string (string, sindex, quoted, flags) + char *string; + int *sindex, quoted, flags; +{ + register int i, c; + size_t slen; + int pass_character, nesting_level, si, dolbrace_state; + char *result, *t; + DECLARE_MBSTATE; + + pass_character = 0; + nesting_level = 1; + slen = strlen (string + *sindex) + *sindex; + + /* The handling of dolbrace_state needs to agree with the code in parse.y: + parse_matched_pair(). The different initial value is to handle the + case where this function is called to parse the word in + ${param op word} (SX_WORD). */ + dolbrace_state = (flags & SX_WORD) ? DOLBRACE_WORD : DOLBRACE_PARAM; + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && (flags & SX_POSIXEXP)) + dolbrace_state = DOLBRACE_QUOTE; + + i = *sindex; + while (c = string[i]) + { + if (pass_character) + { + pass_character = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + + /* CTLESCs and backslashes quote the next character. */ + if (c == CTLESC || c == '\\') + { + pass_character++; + i++; + continue; + } + + if (string[i] == '$' && string[i+1] == LBRACE) + { + nesting_level++; + i += 2; + continue; + } + + if (c == RBRACE) + { + nesting_level--; + if (nesting_level == 0) + break; + i++; + continue; + } + + /* Pass the contents of old-style command substitutions through + verbatim. */ + if (c == '`') + { + si = i + 1; + t = string_extract (string, &si, "`", flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Pass the contents of new-style command substitutions and + arithmetic substitutions through verbatim. */ + if (string[i] == '$' && string[i+1] == LPAREN) + { + si = i + 2; + t = extract_command_subst (string, &si, flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Pass the contents of double-quoted strings through verbatim. */ + if (c == '"') + { + si = i + 1; + i = skip_double_quoted (string, slen, si); + /* skip_XXX_quoted leaves index one past close quote */ + continue; + } + + if (c == '\'') + { +/*itrace("extract_dollar_brace_string: c == single quote flags = %d quoted = %d dolbrace_state = %d", flags, quoted, dolbrace_state);*/ + if (posixly_correct && shell_compatibility_level > 42 && dolbrace_state != DOLBRACE_QUOTE && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ADVANCE_CHAR (string, slen, i); + else + { + si = i + 1; + i = skip_single_quoted (string, slen, si); + } + + continue; + } + + /* move past this character, which was not special. */ + ADVANCE_CHAR (string, slen, i); + + /* This logic must agree with parse.y:parse_matched_pair, since they + share the same defines. */ + if (dolbrace_state == DOLBRACE_PARAM && c == '%' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if (dolbrace_state == DOLBRACE_PARAM && c == '#' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if (dolbrace_state == DOLBRACE_PARAM && c == '/' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE2; /* XXX */ + else if (dolbrace_state == DOLBRACE_PARAM && c == '^' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if (dolbrace_state == DOLBRACE_PARAM && c == ',' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if (dolbrace_state == DOLBRACE_PARAM && strchr ("#%^,~:-=?+/", c) != 0) + dolbrace_state = DOLBRACE_OP; + else if (dolbrace_state == DOLBRACE_OP && strchr ("#%^,~:-=?+/", c) == 0) + dolbrace_state = DOLBRACE_WORD; + } + + if (c == 0 && nesting_level) + { + if (no_longjmp_on_fatal_error == 0) + { /* { */ + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("bad substitution: no closing `%s' in %s"), "}", string); + exp_jump_to_top_level (DISCARD); + } + else + { + *sindex = i; + return ((char *)NULL); + } + } + + result = (flags & SX_NOALLOC) ? (char *)NULL : substring (string, *sindex, i); + *sindex = i; + + return (result); +} + +/* Remove backslashes which are quoting backquotes from STRING. Modifies + STRING, and returns a pointer to it. */ +char * +de_backslash (string) + char *string; +{ + register size_t slen; + register int i, j, prev_i; + DECLARE_MBSTATE; + + slen = strlen (string); + i = j = 0; + + /* Loop copying string[i] to string[j], i >= j. */ + while (i < slen) + { + if (string[i] == '\\' && (string[i + 1] == '`' || string[i + 1] == '\\' || + string[i + 1] == '$')) + i++; + prev_i = i; + ADVANCE_CHAR (string, slen, i); + if (j < prev_i) + do string[j++] = string[prev_i++]; while (prev_i < i); + else + j = i; + } + string[j] = '\0'; + + return (string); +} + +#if 0 +/*UNUSED*/ +/* Replace instances of \! in a string with !. */ +void +unquote_bang (string) + char *string; +{ + register int i, j; + register char *temp; + + temp = (char *)xmalloc (1 + strlen (string)); + + for (i = 0, j = 0; (temp[j] = string[i]); i++, j++) + { + if (string[i] == '\\' && string[i + 1] == '!') + { + temp[j] = '!'; + i++; + } + } + strcpy (string, temp); + free (temp); +} +#endif + +#define CQ_RETURN(x) do { no_longjmp_on_fatal_error = 0; return (x); } while (0) + +/* This function assumes s[i] == open; returns with s[ret] == close; used to + parse array subscripts. FLAGS & 1 means to not attempt to skip over + matched pairs of quotes or backquotes, or skip word expansions; it is + intended to be used after expansion has been performed and during final + assignment parsing (see arrayfunc.c:assign_compound_array_list()). */ +static int +skip_matched_pair (string, start, open, close, flags) + const char *string; + int start, open, close, flags; +{ + int i, pass_next, backq, si, c, count; + size_t slen; + char *temp, *ss; + DECLARE_MBSTATE; + + slen = strlen (string + start) + start; + no_longjmp_on_fatal_error = 1; + + i = start + 1; /* skip over leading bracket */ + count = 1; + pass_next = backq = 0; + ss = (char *)string; + while (c = string[i]) + { + if (pass_next) + { + pass_next = 0; + if (c == 0) + CQ_RETURN(i); + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (backq) + { + if (c == '`') + backq = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if ((flags & 1) == 0 && c == '`') + { + backq = 1; + i++; + continue; + } + else if ((flags & 1) == 0 && c == open) + { + count++; + i++; + continue; + } + else if (c == close) + { + count--; + if (count == 0) + break; + i++; + continue; + } + else if ((flags & 1) == 0 && (c == '\'' || c == '"')) + { + i = (c == '\'') ? skip_single_quoted (ss, slen, ++i) + : skip_double_quoted (ss, slen, ++i); + /* no increment, the skip functions increment past the closing quote. */ + } + else if ((flags&1) == 0 && c == '$' && (string[i+1] == LPAREN || string[i+1] == LBRACE)) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + + if (string[i+1] == LPAREN) + temp = extract_delimited_string (ss, &si, "$(", "(", ")", SX_NOALLOC|SX_COMMAND); /* ) */ + else + temp = extract_dollar_brace_string (ss, &si, 0, SX_NOALLOC); + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } + else + ADVANCE_CHAR (string, slen, i); + } + + CQ_RETURN(i); +} + +#if defined (ARRAY_VARS) +int +skipsubscript (string, start, flags) + const char *string; + int start, flags; +{ + return (skip_matched_pair (string, start, '[', ']', flags)); +} +#endif + +/* Skip characters in STRING until we find a character in DELIMS, and return + the index of that character. START is the index into string at which we + begin. This is similar in spirit to strpbrk, but it returns an index into + STRING and takes a starting index. This little piece of code knows quite + a lot of shell syntax. It's very similar to skip_double_quoted and other + functions of that ilk. */ +int +skip_to_delim (string, start, delims, flags) + char *string; + int start; + char *delims; + int flags; +{ + int i, pass_next, backq, si, c, invert, skipquote, skipcmd; + size_t slen; + char *temp, open[3]; + DECLARE_MBSTATE; + + slen = strlen (string + start) + start; + if (flags & SD_NOJMP) + no_longjmp_on_fatal_error = 1; + invert = (flags & SD_INVERT); + skipcmd = (flags & SD_NOSKIPCMD) == 0; + + i = start; + pass_next = backq = 0; + while (c = string[i]) + { + /* If this is non-zero, we should not let quote characters be delimiters + and the current character is a single or double quote. We should not + test whether or not it's a delimiter until after we skip single- or + double-quoted strings. */ + skipquote = ((flags & SD_NOQUOTEDELIM) && (c == '\'' || c =='"')); + if (pass_next) + { + pass_next = 0; + if (c == 0) + CQ_RETURN(i); + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (backq) + { + if (c == '`') + backq = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '`') + { + backq = 1; + i++; + continue; + } + else if (skipquote == 0 && invert == 0 && member (c, delims)) + break; + else if (c == '\'' || c == '"') + { + i = (c == '\'') ? skip_single_quoted (string, slen, ++i) + : skip_double_quoted (string, slen, ++i); + /* no increment, the skip functions increment past the closing quote. */ + } + else if (c == '$' && ((skipcmd && string[i+1] == LPAREN) || string[i+1] == LBRACE)) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + + if (string[i+1] == LPAREN) + temp = extract_delimited_string (string, &si, "$(", "(", ")", SX_NOALLOC|SX_COMMAND); /* ) */ + else + temp = extract_dollar_brace_string (string, &si, 0, SX_NOALLOC); + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } +#if defined (PROCESS_SUBSTITUTION) + else if (skipcmd && (c == '<' || c == '>') && string[i+1] == LPAREN) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + temp = extract_process_subst (string, (c == '<') ? "<(" : ">(", &si); + free (temp); /* no SX_ALLOC here */ + i = si; + if (string[i] == '\0') + break; + i++; + continue; + } +#endif /* PROCESS_SUBSTITUTION */ +#if defined (EXTENDED_GLOB) + else if ((flags & SD_EXTGLOB) && extended_glob && string[i+1] == LPAREN && member (c, "?*+!@")) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + + open[0] = c; + open[1] = LPAREN; + open[2] = '\0'; + temp = extract_delimited_string (string, &si, open, "(", ")", SX_NOALLOC); /* ) */ + + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } +#endif + else if ((flags & SD_GLOB) && c == LBRACK) + { + si = i + 1; + if (string[si] == '\0') + CQ_RETURN(si); + + temp = extract_delimited_string (string, &si, "[", "[", "]", SX_NOALLOC); /* ] */ + + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } + else if ((skipquote || invert) && (member (c, delims) == 0)) + break; + else + ADVANCE_CHAR (string, slen, i); + } + + CQ_RETURN(i); +} + +#if defined (READLINE) +/* Return 1 if the portion of STRING ending at EINDEX is quoted (there is + an unclosed quoted string), or if the character at EINDEX is quoted + by a backslash. NO_LONGJMP_ON_FATAL_ERROR is used to flag that the various + single and double-quoted string parsing functions should not return an + error if there are unclosed quotes or braces. The characters that this + recognizes need to be the same as the contents of + rl_completer_quote_characters. */ + +int +char_is_quoted (string, eindex) + char *string; + int eindex; +{ + int i, pass_next, c; + size_t slen; + DECLARE_MBSTATE; + + slen = strlen (string); + no_longjmp_on_fatal_error = 1; + i = pass_next = 0; + while (i <= eindex) + { + c = string[i]; + + if (pass_next) + { + pass_next = 0; + if (i >= eindex) /* XXX was if (i >= eindex - 1) */ + CQ_RETURN(1); + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (c == '\'' || c == '"') + { + i = (c == '\'') ? skip_single_quoted (string, slen, ++i) + : skip_double_quoted (string, slen, ++i); + if (i > eindex) + CQ_RETURN(1); + /* no increment, the skip_xxx functions go one past end */ + } + else + ADVANCE_CHAR (string, slen, i); + } + + CQ_RETURN(0); +} + +int +unclosed_pair (string, eindex, openstr) + char *string; + int eindex; + char *openstr; +{ + int i, pass_next, openc, olen; + size_t slen; + DECLARE_MBSTATE; + + slen = strlen (string); + olen = strlen (openstr); + i = pass_next = openc = 0; + while (i <= eindex) + { + if (pass_next) + { + pass_next = 0; + if (i >= eindex) /* XXX was if (i >= eindex - 1) */ + return 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (string[i] == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (STREQN (string + i, openstr, olen)) + { + openc = 1 - openc; + i += olen; + } + else if (string[i] == '\'' || string[i] == '"') + { + i = (string[i] == '\'') ? skip_single_quoted (string, slen, i) + : skip_double_quoted (string, slen, i); + if (i > eindex) + return 0; + } + else + ADVANCE_CHAR (string, slen, i); + } + return (openc); +} + +/* Split STRING (length SLEN) at DELIMS, and return a WORD_LIST with the + individual words. If DELIMS is NULL, the current value of $IFS is used + to split the string, and the function follows the shell field splitting + rules. SENTINEL is an index to look for. NWP, if non-NULL, + gets the number of words in the returned list. CWP, if non-NULL, gets + the index of the word containing SENTINEL. Non-whitespace chars in + DELIMS delimit separate fields. */ +WORD_LIST * +split_at_delims (string, slen, delims, sentinel, flags, nwp, cwp) + char *string; + int slen; + char *delims; + int sentinel, flags; + int *nwp, *cwp; +{ + int ts, te, i, nw, cw, ifs_split, dflags; + char *token, *d, *d2; + WORD_LIST *ret, *tl; + + if (string == 0 || *string == '\0') + { + if (nwp) + *nwp = 0; + if (cwp) + *cwp = 0; + return ((WORD_LIST *)NULL); + } + + d = (delims == 0) ? ifs_value : delims; + ifs_split = delims == 0; + + /* Make d2 the non-whitespace characters in delims */ + d2 = 0; + if (delims) + { + size_t slength; +#if defined (HANDLE_MULTIBYTE) + size_t mblength = 1; +#endif + DECLARE_MBSTATE; + + slength = strlen (delims); + d2 = (char *)xmalloc (slength + 1); + i = ts = 0; + while (delims[i]) + { +#if defined (HANDLE_MULTIBYTE) + mbstate_t state_bak; + state_bak = state; + mblength = MBRLEN (delims + i, slength, &state); + if (MB_INVALIDCH (mblength)) + state = state_bak; + else if (mblength > 1) + { + memcpy (d2 + ts, delims + i, mblength); + ts += mblength; + i += mblength; + slength -= mblength; + continue; + } +#endif + if (whitespace (delims[i]) == 0) + d2[ts++] = delims[i]; + + i++; + slength--; + } + d2[ts] = '\0'; + } + + ret = (WORD_LIST *)NULL; + + /* Remove sequences of whitespace characters at the start of the string, as + long as those characters are delimiters. */ + for (i = 0; member (string[i], d) && spctabnl (string[i]); i++) + ; + if (string[i] == '\0') + return (ret); + + ts = i; + nw = 0; + cw = -1; + dflags = flags|SD_NOJMP; + while (1) + { + te = skip_to_delim (string, ts, d, dflags); + + /* If we have a non-whitespace delimiter character, use it to make a + separate field. This is just about what $IFS splitting does and + is closer to the behavior of the shell parser. */ + if (ts == te && d2 && member (string[ts], d2)) + { + te = ts + 1; + /* If we're using IFS splitting, the non-whitespace delimiter char + and any additional IFS whitespace delimits a field. */ + if (ifs_split) + while (member (string[te], d) && spctabnl (string[te])) + te++; + else + while (member (string[te], d2)) + te++; + } + + token = substring (string, ts, te); + + ret = add_string_to_list (token, ret); + free (token); + nw++; + + if (sentinel >= ts && sentinel <= te) + cw = nw; + + /* If the cursor is at whitespace just before word start, set the + sentinel word to the current word. */ + if (cwp && cw == -1 && sentinel == ts-1) + cw = nw; + + /* If the cursor is at whitespace between two words, make a new, empty + word, add it before (well, after, since the list is in reverse order) + the word we just added, and set the current word to that one. */ + if (cwp && cw == -1 && sentinel < ts) + { + tl = make_word_list (make_word (""), ret->next); + ret->next = tl; + cw = nw; + nw++; + } + + if (string[te] == 0) + break; + + i = te; + while (member (string[i], d) && (ifs_split || spctabnl(string[i]))) + i++; + + if (string[i]) + ts = i; + else + break; + } + + /* Special case for SENTINEL at the end of STRING. If we haven't found + the word containing SENTINEL yet, and the index we're looking for is at + the end of STRING (or past the end of the previously-found token, + possible if the end of the line is composed solely of IFS whitespace) + add an additional null argument and set the current word pointer to that. */ + if (cwp && cw == -1 && (sentinel >= slen || sentinel >= te)) + { + if (whitespace (string[sentinel - 1])) + { + token = ""; + ret = add_string_to_list (token, ret); + nw++; + } + cw = nw; + } + + if (nwp) + *nwp = nw; + if (cwp) + *cwp = cw; + + FREE (d2); + + return (REVERSE_LIST (ret, WORD_LIST *)); +} +#endif /* READLINE */ + +#if 0 +/* UNUSED */ +/* Extract the name of the variable to bind to from the assignment string. */ +char * +assignment_name (string) + char *string; +{ + int offset; + char *temp; + + offset = assignment (string, 0); + if (offset == 0) + return (char *)NULL; + temp = substring (string, 0, offset); + return (temp); +} +#endif + +/* **************************************************************** */ +/* */ +/* Functions to convert strings to WORD_LISTs and vice versa */ +/* */ +/* **************************************************************** */ + +/* Return a single string of all the words in LIST. SEP is the separator + to put between individual elements of LIST in the output string. */ +char * +string_list_internal (list, sep) + WORD_LIST *list; + char *sep; +{ + register WORD_LIST *t; + char *result, *r; + int word_len, sep_len, result_size; + + if (list == 0) + return ((char *)NULL); + + /* Short-circuit quickly if we don't need to separate anything. */ + if (list->next == 0) + return (savestring (list->word->word)); + + /* This is nearly always called with either sep[0] == 0 or sep[1] == 0. */ + sep_len = STRLEN (sep); + result_size = 0; + + for (t = list; t; t = t->next) + { + if (t != list) + result_size += sep_len; + result_size += strlen (t->word->word); + } + + r = result = (char *)xmalloc (result_size + 1); + + for (t = list; t; t = t->next) + { + if (t != list && sep_len) + { + if (sep_len > 1) + { + FASTCOPY (sep, r, sep_len); + r += sep_len; + } + else + *r++ = sep[0]; + } + + word_len = strlen (t->word->word); + FASTCOPY (t->word->word, r, word_len); + r += word_len; + } + + *r = '\0'; + return (result); +} + +/* Return a single string of all the words present in LIST, separating + each word with a space. */ +char * +string_list (list) + WORD_LIST *list; +{ + return (string_list_internal (list, " ")); +} + +/* An external interface that can be used by the rest of the shell to + obtain a string containing the first character in $IFS. Handles all + the multibyte complications. If LENP is non-null, it is set to the + length of the returned string. */ +char * +ifs_firstchar (lenp) + int *lenp; +{ + char *ret; + int len; + + ret = xmalloc (MB_LEN_MAX + 1); +#if defined (HANDLE_MULTIBYTE) + if (ifs_firstc_len == 1) + { + ret[0] = ifs_firstc[0]; + ret[1] = '\0'; + len = ret[0] ? 1 : 0; + } + else + { + memcpy (ret, ifs_firstc, ifs_firstc_len); + ret[len = ifs_firstc_len] = '\0'; + } +#else + ret[0] = ifs_firstc; + ret[1] = '\0'; + len = ret[0] ? 0 : 1; +#endif + + if (lenp) + *lenp = len; + + return ret; +} + +/* Return a single string of all the words present in LIST, obeying the + quoting rules for "$*", to wit: (P1003.2, draft 11, 3.5.2) "If the + expansion [of $*] appears within a double quoted string, it expands + to a single field with the value of each parameter separated by the + first character of the IFS variable, or by a if IFS is unset." */ +char * +string_list_dollar_star (list) + WORD_LIST *list; +{ + char *ret; +#if defined (HANDLE_MULTIBYTE) +# if defined (__GNUC__) + char sep[MB_CUR_MAX + 1]; +# else + char *sep = 0; +# endif +#else + char sep[2]; +#endif + +#if defined (HANDLE_MULTIBYTE) +# if !defined (__GNUC__) + sep = (char *)xmalloc (MB_CUR_MAX + 1); +# endif /* !__GNUC__ */ + if (ifs_firstc_len == 1) + { + sep[0] = ifs_firstc[0]; + sep[1] = '\0'; + } + else + { + memcpy (sep, ifs_firstc, ifs_firstc_len); + sep[ifs_firstc_len] = '\0'; + } +#else + sep[0] = ifs_firstc; + sep[1] = '\0'; +#endif + + ret = string_list_internal (list, sep); +#if defined (HANDLE_MULTIBYTE) && !defined (__GNUC__) + free (sep); +#endif + return ret; +} + +/* Turn $@ into a string. If (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + is non-zero, the $@ appears within double quotes, and we should quote + the list before converting it into a string. If IFS is unset, and the + word is not quoted, we just need to quote CTLESC and CTLNUL characters + in the words in the list, because the default value of $IFS is + , IFS characters in the words in the list should + also be split. If IFS is null, and the word is not quoted, we need + to quote the words in the list to preserve the positional parameters + exactly. */ +char * +string_list_dollar_at (list, quoted) + WORD_LIST *list; + int quoted; +{ + char *ifs, *ret; +#if defined (HANDLE_MULTIBYTE) +# if defined (__GNUC__) + char sep[MB_CUR_MAX + 1]; +# else + char *sep = 0; +# endif /* !__GNUC__ */ +#else + char sep[2]; +#endif + WORD_LIST *tlist; + + /* XXX this could just be ifs = ifs_value; */ + ifs = ifs_var ? value_cell (ifs_var) : (char *)0; + +#if defined (HANDLE_MULTIBYTE) +# if !defined (__GNUC__) + sep = (char *)xmalloc (MB_CUR_MAX + 1); +# endif /* !__GNUC__ */ + if (ifs && *ifs) + { + if (ifs_firstc_len == 1) + { + sep[0] = ifs_firstc[0]; + sep[1] = '\0'; + } + else + { + memcpy (sep, ifs_firstc, ifs_firstc_len); + sep[ifs_firstc_len] = '\0'; + } + } + else + { + sep[0] = ' '; + sep[1] = '\0'; + } +#else + sep[0] = (ifs == 0 || *ifs == 0) ? ' ' : *ifs; + sep[1] = '\0'; +#endif + + /* XXX -- why call quote_list if ifs == 0? we can get away without doing + it now that quote_escapes quotes spaces */ + tlist = (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES|Q_PATQUOTE)) + ? quote_list (list) + : list_quote_escapes (list); + + ret = string_list_internal (tlist, sep); +#if defined (HANDLE_MULTIBYTE) && !defined (__GNUC__) + free (sep); +#endif + return ret; +} + +/* Turn the positional parameters into a string, understanding quoting and + the various subtleties of using the first character of $IFS as the + separator. Calls string_list_dollar_at, string_list_dollar_star, and + string_list as appropriate. */ +char * +string_list_pos_params (pchar, list, quoted) + int pchar; + WORD_LIST *list; + int quoted; +{ + char *ret; + WORD_LIST *tlist; + + if (pchar == '*' && (quoted & Q_DOUBLE_QUOTES)) + { + tlist = quote_list (list); + word_list_remove_quoted_nulls (tlist); + ret = string_list_dollar_star (tlist); + } + else if (pchar == '*' && (quoted & Q_HERE_DOCUMENT)) + { + tlist = quote_list (list); + word_list_remove_quoted_nulls (tlist); + ret = string_list (tlist); + } + else if (pchar == '*') + { + /* Even when unquoted, string_list_dollar_star does the right thing + making sure that the first character of $IFS is used as the + separator. */ + ret = string_list_dollar_star (list); + } + else if (pchar == '@' && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + /* We use string_list_dollar_at, but only if the string is quoted, since + that quotes the escapes if it's not, which we don't want. We could + use string_list (the old code did), but that doesn't do the right + thing if the first character of $IFS is not a space. We use + string_list_dollar_star if the string is unquoted so we make sure that + the elements of $@ are separated by the first character of $IFS for + later splitting. */ + ret = string_list_dollar_at (list, quoted); + else if (pchar == '@') + ret = string_list_dollar_star (list); + else + ret = string_list ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) ? quote_list (list) : list); + + return ret; +} + +/* Return the list of words present in STRING. Separate the string into + words at any of the characters found in SEPARATORS. If QUOTED is + non-zero then word in the list will have its quoted flag set, otherwise + the quoted flag is left as make_word () deemed fit. + + This obeys the P1003.2 word splitting semantics. If `separators' is + exactly , then the splitting algorithm is that of + the Bourne shell, which treats any sequence of characters from `separators' + as a delimiter. If IFS is unset, which results in `separators' being set + to "", no splitting occurs. If separators has some other value, the + following rules are applied (`IFS white space' means zero or more + occurrences of , , or , as long as those characters + are in `separators'): + + 1) IFS white space is ignored at the start and the end of the + string. + 2) Each occurrence of a character in `separators' that is not + IFS white space, along with any adjacent occurrences of + IFS white space delimits a field. + 3) Any nonzero-length sequence of IFS white space delimits a field. + */ + +/* BEWARE! list_string strips null arguments. Don't call it twice and + expect to have "" preserved! */ + +/* This performs word splitting and quoted null character removal on + STRING. */ +#define issep(c) \ + (((separators)[0]) ? ((separators)[1] ? isifs(c) \ + : (c) == (separators)[0]) \ + : 0) + +WORD_LIST * +list_string (string, separators, quoted) + register char *string, *separators; + int quoted; +{ + WORD_LIST *result; + WORD_DESC *t; + char *current_word, *s; + int sindex, sh_style_split, whitesep, xflags; + size_t slen; + + if (!string || !*string) + return ((WORD_LIST *)NULL); + + sh_style_split = separators && separators[0] == ' ' && + separators[1] == '\t' && + separators[2] == '\n' && + separators[3] == '\0'; + for (xflags = 0, s = ifs_value; s && *s; s++) + { + if (*s == CTLESC) xflags |= SX_NOCTLESC; + else if (*s == CTLNUL) xflags |= SX_NOESCCTLNUL; + } + + slen = 0; + /* Remove sequences of whitespace at the beginning of STRING, as + long as those characters appear in IFS. Do not do this if + STRING is quoted or if there are no separator characters. */ + if (!quoted || !separators || !*separators) + { + for (s = string; *s && spctabnl (*s) && issep (*s); s++); + + if (!*s) + return ((WORD_LIST *)NULL); + + string = s; + } + + /* OK, now STRING points to a word that does not begin with white space. + The splitting algorithm is: + extract a word, stopping at a separator + skip sequences of spc, tab, or nl as long as they are separators + This obeys the field splitting rules in Posix.2. */ + slen = (MB_CUR_MAX > 1) ? strlen (string) : 1; + for (result = (WORD_LIST *)NULL, sindex = 0; string[sindex]; ) + { + /* Don't need string length in ADVANCE_CHAR or string_extract_verbatim + unless multibyte chars are possible. */ + current_word = string_extract_verbatim (string, slen, &sindex, separators, xflags); + if (current_word == 0) + break; + + /* If we have a quoted empty string, add a quoted null argument. We + want to preserve the quoted null character iff this is a quoted + empty string; otherwise the quoted null characters are removed + below. */ + if (QUOTED_NULL (current_word)) + { + t = alloc_word_desc (); + t->word = make_quoted_char ('\0'); + t->flags |= W_QUOTED|W_HASQUOTEDNULL; + result = make_word_list (t, result); + } + else if (current_word[0] != '\0') + { + /* If we have something, then add it regardless. However, + perform quoted null character removal on the current word. */ + remove_quoted_nulls (current_word); + result = add_string_to_list (current_word, result); + result->word->flags &= ~W_HASQUOTEDNULL; /* just to be sure */ + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + result->word->flags |= W_QUOTED; + } + + /* If we're not doing sequences of separators in the traditional + Bourne shell style, then add a quoted null argument. */ + else if (!sh_style_split && !spctabnl (string[sindex])) + { + t = alloc_word_desc (); + t->word = make_quoted_char ('\0'); + t->flags |= W_QUOTED|W_HASQUOTEDNULL; + result = make_word_list (t, result); + } + + free (current_word); + + /* Note whether or not the separator is IFS whitespace, used later. */ + whitesep = string[sindex] && spctabnl (string[sindex]); + + /* Move past the current separator character. */ + if (string[sindex]) + { + DECLARE_MBSTATE; + ADVANCE_CHAR (string, slen, sindex); + } + + /* Now skip sequences of space, tab, or newline characters if they are + in the list of separators. */ + while (string[sindex] && spctabnl (string[sindex]) && issep (string[sindex])) + sindex++; + + /* If the first separator was IFS whitespace and the current character + is a non-whitespace IFS character, it should be part of the current + field delimiter, not a separate delimiter that would result in an + empty field. Look at POSIX.2, 3.6.5, (3)(b). */ + if (string[sindex] && whitesep && issep (string[sindex]) && !spctabnl (string[sindex])) + { + sindex++; + /* An IFS character that is not IFS white space, along with any + adjacent IFS white space, shall delimit a field. (SUSv3) */ + while (string[sindex] && spctabnl (string[sindex]) && isifs (string[sindex])) + sindex++; + } + } + return (REVERSE_LIST (result, WORD_LIST *)); +} + +/* Parse a single word from STRING, using SEPARATORS to separate fields. + ENDPTR is set to the first character after the word. This is used by + the `read' builtin. This is never called with SEPARATORS != $IFS; + it should be simplified. + + XXX - this function is very similar to list_string; they should be + combined - XXX */ +char * +get_word_from_string (stringp, separators, endptr) + char **stringp, *separators, **endptr; +{ + register char *s; + char *current_word; + int sindex, sh_style_split, whitesep, xflags; + size_t slen; + + if (!stringp || !*stringp || !**stringp) + return ((char *)NULL); + + sh_style_split = separators && separators[0] == ' ' && + separators[1] == '\t' && + separators[2] == '\n' && + separators[3] == '\0'; + for (xflags = 0, s = ifs_value; s && *s; s++) + { + if (*s == CTLESC) xflags |= SX_NOCTLESC; + if (*s == CTLNUL) xflags |= SX_NOESCCTLNUL; + } + + s = *stringp; + slen = 0; + + /* Remove sequences of whitespace at the beginning of STRING, as + long as those characters appear in IFS. */ + if (sh_style_split || !separators || !*separators) + { + for (; *s && spctabnl (*s) && isifs (*s); s++); + + /* If the string is nothing but whitespace, update it and return. */ + if (!*s) + { + *stringp = s; + if (endptr) + *endptr = s; + return ((char *)NULL); + } + } + + /* OK, S points to a word that does not begin with white space. + Now extract a word, stopping at a separator, save a pointer to + the first character after the word, then skip sequences of spc, + tab, or nl as long as they are separators. + + This obeys the field splitting rules in Posix.2. */ + sindex = 0; + /* Don't need string length in ADVANCE_CHAR or string_extract_verbatim + unless multibyte chars are possible. */ + slen = (MB_CUR_MAX > 1) ? strlen (s) : 1; + current_word = string_extract_verbatim (s, slen, &sindex, separators, xflags); + + /* Set ENDPTR to the first character after the end of the word. */ + if (endptr) + *endptr = s + sindex; + + /* Note whether or not the separator is IFS whitespace, used later. */ + whitesep = s[sindex] && spctabnl (s[sindex]); + + /* Move past the current separator character. */ + if (s[sindex]) + { + DECLARE_MBSTATE; + ADVANCE_CHAR (s, slen, sindex); + } + + /* Now skip sequences of space, tab, or newline characters if they are + in the list of separators. */ + while (s[sindex] && spctabnl (s[sindex]) && isifs (s[sindex])) + sindex++; + + /* If the first separator was IFS whitespace and the current character is + a non-whitespace IFS character, it should be part of the current field + delimiter, not a separate delimiter that would result in an empty field. + Look at POSIX.2, 3.6.5, (3)(b). */ + if (s[sindex] && whitesep && isifs (s[sindex]) && !spctabnl (s[sindex])) + { + sindex++; + /* An IFS character that is not IFS white space, along with any adjacent + IFS white space, shall delimit a field. */ + while (s[sindex] && spctabnl (s[sindex]) && isifs (s[sindex])) + sindex++; + } + + /* Update STRING to point to the next field. */ + *stringp = s + sindex; + return (current_word); +} + +/* Remove IFS white space at the end of STRING. Start at the end + of the string and walk backwards until the beginning of the string + or we find a character that's not IFS white space and not CTLESC. + Only let CTLESC escape a white space character if SAW_ESCAPE is + non-zero. */ +char * +strip_trailing_ifs_whitespace (string, separators, saw_escape) + char *string, *separators; + int saw_escape; +{ + char *s; + + s = string + STRLEN (string) - 1; + while (s > string && ((spctabnl (*s) && isifs (*s)) || + (saw_escape && *s == CTLESC && spctabnl (s[1])))) + s--; + *++s = '\0'; + return string; +} + +#if 0 +/* UNUSED */ +/* Split STRING into words at whitespace. Obeys shell-style quoting with + backslashes, single and double quotes. */ +WORD_LIST * +list_string_with_quotes (string) + char *string; +{ + WORD_LIST *list; + char *token, *s; + size_t s_len; + int c, i, tokstart, len; + + for (s = string; s && *s && spctabnl (*s); s++) + ; + if (s == 0 || *s == 0) + return ((WORD_LIST *)NULL); + + s_len = strlen (s); + tokstart = i = 0; + list = (WORD_LIST *)NULL; + while (1) + { + c = s[i]; + if (c == '\\') + { + i++; + if (s[i]) + i++; + } + else if (c == '\'') + i = skip_single_quoted (s, s_len, ++i); + else if (c == '"') + i = skip_double_quoted (s, s_len, ++i); + else if (c == 0 || spctabnl (c)) + { + /* We have found the end of a token. Make a word out of it and + add it to the word list. */ + token = substring (s, tokstart, i); + list = add_string_to_list (token, list); + free (token); + while (spctabnl (s[i])) + i++; + if (s[i]) + tokstart = i; + else + break; + } + else + i++; /* normal character */ + } + return (REVERSE_LIST (list, WORD_LIST *)); +} +#endif + +/********************************************************/ +/* */ +/* Functions to perform assignment statements */ +/* */ +/********************************************************/ + +#if defined (ARRAY_VARS) +static SHELL_VAR * +do_compound_assignment (name, value, flags) + char *name, *value; + int flags; +{ + SHELL_VAR *v; + int mklocal, mkassoc, mkglobal; + WORD_LIST *list; + + mklocal = flags & ASS_MKLOCAL; + mkassoc = flags & ASS_MKASSOC; + mkglobal = flags & ASS_MKGLOBAL; + + if (mklocal && variable_context) + { + v = find_variable (name); + list = expand_compound_array_assignment (v, value, flags); + if (mkassoc) + v = make_local_assoc_variable (name); + else if (v == 0 || (array_p (v) == 0 && assoc_p (v) == 0) || v->context != variable_context) + v = make_local_array_variable (name, 0); + if (v) + assign_compound_array_list (v, list, flags); + } + /* In a function but forcing assignment in global context */ + else if (mkglobal && variable_context) + { + v = find_global_variable (name); + list = expand_compound_array_assignment (v, value, flags); + if (v == 0 && mkassoc) + v = make_new_assoc_variable (name); + else if (v && mkassoc && assoc_p (v) == 0) + v = convert_var_to_assoc (v); + else if (v == 0) + v = make_new_array_variable (name); + else if (v && mkassoc == 0 && array_p (v) == 0) + v = convert_var_to_array (v); + if (v) + assign_compound_array_list (v, list, flags); + } + else + v = assign_array_from_string (name, value, flags); + + return (v); +} +#endif + +/* Given STRING, an assignment string, get the value of the right side + of the `=', and bind it to the left side. If EXPAND is true, then + perform parameter expansion, command substitution, and arithmetic + expansion on the right-hand side. Perform tilde expansion in any + case. Do not perform word splitting on the result of expansion. */ +static int +do_assignment_internal (word, expand) + const WORD_DESC *word; + int expand; +{ + int offset, appendop, assign_list, aflags, retval; + char *name, *value, *temp; + SHELL_VAR *entry; +#if defined (ARRAY_VARS) + char *t; + int ni; +#endif + const char *string; + + if (word == 0 || word->word == 0) + return 0; + + appendop = assign_list = aflags = 0; + string = word->word; + offset = assignment (string, 0); + name = savestring (string); + value = (char *)NULL; + + if (name[offset] == '=') + { + if (name[offset - 1] == '+') + { + appendop = 1; + name[offset - 1] = '\0'; + } + + name[offset] = 0; /* might need this set later */ + temp = name + offset + 1; + +#if defined (ARRAY_VARS) + if (expand && (word->flags & W_COMPASSIGN)) + { + assign_list = ni = 1; + value = extract_array_assignment_list (temp, &ni); + } + else +#endif + if (expand && temp[0]) + value = expand_string_if_necessary (temp, 0, expand_string_assignment); + else + value = savestring (temp); + } + + if (value == 0) + { + value = (char *)xmalloc (1); + value[0] = '\0'; + } + + if (echo_command_at_execute) + { + if (appendop) + name[offset - 1] = '+'; + xtrace_print_assignment (name, value, assign_list, 1); + if (appendop) + name[offset - 1] = '\0'; + } + +#define ASSIGN_RETURN(r) do { FREE (value); free (name); return (r); } while (0) + + if (appendop) + aflags |= ASS_APPEND; + +#if defined (ARRAY_VARS) + if (t = mbschr (name, '[')) /*]*/ + { + if (assign_list) + { + report_error (_("%s: cannot assign list to array member"), name); + ASSIGN_RETURN (0); + } + entry = assign_array_element (name, value, aflags); + if (entry == 0) + ASSIGN_RETURN (0); + } + else if (assign_list) + { + if ((word->flags & W_ASSIGNARG) && (word->flags & W_ASSNGLOBAL) == 0) + aflags |= ASS_MKLOCAL; + if ((word->flags & W_ASSIGNARG) && (word->flags & W_ASSNGLOBAL)) + aflags |= ASS_MKGLOBAL; + if (word->flags & W_ASSIGNASSOC) + aflags |= ASS_MKASSOC; + entry = do_compound_assignment (name, value, aflags); + } + else +#endif /* ARRAY_VARS */ + entry = bind_variable (name, value, aflags); + + stupidly_hack_special_variables (name); + + /* Return 1 if the assignment seems to have been performed correctly. */ + if (entry == 0 || readonly_p (entry)) + retval = 0; /* assignment failure */ + else if (noassign_p (entry)) + { + last_command_exit_value = EXECUTION_FAILURE; + retval = 1; /* error status, but not assignment failure */ + } + else + retval = 1; + + if (entry && retval != 0 && noassign_p (entry) == 0) + VUNSETATTR (entry, att_invisible); + + ASSIGN_RETURN (retval); +} + +/* Perform the assignment statement in STRING, and expand the + right side by doing tilde, command and parameter expansion. */ +int +do_assignment (string) + char *string; +{ + WORD_DESC td; + + td.flags = W_ASSIGNMENT; + td.word = string; + + return do_assignment_internal (&td, 1); +} + +int +do_word_assignment (word, flags) + WORD_DESC *word; + int flags; +{ + return do_assignment_internal (word, 1); +} + +/* Given STRING, an assignment string, get the value of the right side + of the `=', and bind it to the left side. Do not perform any word + expansions on the right hand side. */ +int +do_assignment_no_expand (string) + char *string; +{ + WORD_DESC td; + + td.flags = W_ASSIGNMENT; + td.word = string; + + return (do_assignment_internal (&td, 0)); +} + +/*************************************************** + * * + * Functions to manage the positional parameters * + * * + ***************************************************/ + +/* Return the word list that corresponds to `$*'. */ +WORD_LIST * +list_rest_of_args () +{ + register WORD_LIST *list, *args; + int i; + + /* Break out of the loop as soon as one of the dollar variables is null. */ + for (i = 1, list = (WORD_LIST *)NULL; i < 10 && dollar_vars[i]; i++) + list = make_word_list (make_bare_word (dollar_vars[i]), list); + + for (args = rest_of_args; args; args = args->next) + list = make_word_list (make_bare_word (args->word->word), list); + + return (REVERSE_LIST (list, WORD_LIST *)); +} + +int +number_of_args () +{ + register WORD_LIST *list; + int n; + + for (n = 0; n < 9 && dollar_vars[n+1]; n++) + ; + for (list = rest_of_args; list; list = list->next) + n++; + return n; +} + +/* Return the value of a positional parameter. This handles values > 10. */ +char * +get_dollar_var_value (ind) + intmax_t ind; +{ + char *temp; + WORD_LIST *p; + + if (ind < 10) + temp = dollar_vars[ind] ? savestring (dollar_vars[ind]) : (char *)NULL; + else /* We want something like ${11} */ + { + ind -= 10; + for (p = rest_of_args; p && ind--; p = p->next) + ; + temp = p ? savestring (p->word->word) : (char *)NULL; + } + return (temp); +} + +/* Make a single large string out of the dollar digit variables, + and the rest_of_args. If DOLLAR_STAR is 1, then obey the special + case of "$*" with respect to IFS. */ +char * +string_rest_of_args (dollar_star) + int dollar_star; +{ + register WORD_LIST *list; + char *string; + + list = list_rest_of_args (); + string = dollar_star ? string_list_dollar_star (list) : string_list (list); + dispose_words (list); + return (string); +} + +/* Return a string containing the positional parameters from START to + END, inclusive. If STRING[0] == '*', we obey the rules for $*, + which only makes a difference if QUOTED is non-zero. If QUOTED includes + Q_HERE_DOCUMENT or Q_DOUBLE_QUOTES, this returns a quoted list, otherwise + no quoting chars are added. */ +static char * +pos_params (string, start, end, quoted) + char *string; + int start, end, quoted; +{ + WORD_LIST *save, *params, *h, *t; + char *ret; + int i; + + /* see if we can short-circuit. if start == end, we want 0 parameters. */ + if (start == end) + return ((char *)NULL); + + save = params = list_rest_of_args (); + if (save == 0) + return ((char *)NULL); + + if (start == 0) /* handle ${@:0[:x]} specially */ + { + t = make_word_list (make_word (dollar_vars[0]), params); + save = params = t; + } + + for (i = start ? 1 : 0; params && i < start; i++) + params = params->next; + if (params == 0) + return ((char *)NULL); + for (h = t = params; params && i < end; i++) + { + t = params; + params = params->next; + } + + t->next = (WORD_LIST *)NULL; + + ret = string_list_pos_params (string[0], h, quoted); + + if (t != params) + t->next = params; + + dispose_words (save); + return (ret); +} + +/******************************************************************/ +/* */ +/* Functions to expand strings to strings or WORD_LISTs */ +/* */ +/******************************************************************/ + +#if defined (PROCESS_SUBSTITUTION) +#define EXP_CHAR(s) (s == '$' || s == '`' || s == '<' || s == '>' || s == CTLESC || s == '~') +#else +#define EXP_CHAR(s) (s == '$' || s == '`' || s == CTLESC || s == '~') +#endif + +/* If there are any characters in STRING that require full expansion, + then call FUNC to expand STRING; otherwise just perform quote + removal if necessary. This returns a new string. */ +static char * +expand_string_if_necessary (string, quoted, func) + char *string; + int quoted; + EXPFUNC *func; +{ + WORD_LIST *list; + size_t slen; + int i, saw_quote; + char *ret; + DECLARE_MBSTATE; + + /* Don't need string length for ADVANCE_CHAR unless multibyte chars possible. */ + slen = (MB_CUR_MAX > 1) ? strlen (string) : 0; + i = saw_quote = 0; + while (string[i]) + { + if (EXP_CHAR (string[i])) + break; + else if (string[i] == '\'' || string[i] == '\\' || string[i] == '"') + saw_quote = 1; + ADVANCE_CHAR (string, slen, i); + } + + if (string[i]) + { + list = (*func) (string, quoted); + if (list) + { + ret = string_list (list); + dispose_words (list); + } + else + ret = (char *)NULL; + } + else if (saw_quote && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + ret = string_quote_removal (string, quoted); + else + ret = savestring (string); + + return ret; +} + +static inline char * +expand_string_to_string_internal (string, quoted, func) + char *string; + int quoted; + EXPFUNC *func; +{ + WORD_LIST *list; + char *ret; + + if (string == 0 || *string == '\0') + return ((char *)NULL); + + list = (*func) (string, quoted); + if (list) + { + ret = string_list (list); + dispose_words (list); + } + else + ret = (char *)NULL; + + return (ret); +} + +char * +expand_string_to_string (string, quoted) + char *string; + int quoted; +{ + return (expand_string_to_string_internal (string, quoted, expand_string)); +} + +char * +expand_string_unsplit_to_string (string, quoted) + char *string; + int quoted; +{ + return (expand_string_to_string_internal (string, quoted, expand_string_unsplit)); +} + +char * +expand_assignment_string_to_string (string, quoted) + char *string; + int quoted; +{ + return (expand_string_to_string_internal (string, quoted, expand_string_assignment)); +} + +char * +expand_arith_string (string, quoted) + char *string; + int quoted; +{ + WORD_DESC td; + WORD_LIST *list, *tlist; + size_t slen; + int i, saw_quote; + char *ret; + DECLARE_MBSTATE; + + /* Don't need string length for ADVANCE_CHAR unless multibyte chars possible. */ + slen = (MB_CUR_MAX > 1) ? strlen (string) : 0; + i = saw_quote = 0; + while (string[i]) + { + if (EXP_CHAR (string[i])) + break; + else if (string[i] == '\'' || string[i] == '\\' || string[i] == '"') + saw_quote = 1; + ADVANCE_CHAR (string, slen, i); + } + + if (string[i]) + { + /* This is expanded version of expand_string_internal as it's called by + expand_string_leave_quoted */ + td.flags = W_NOPROCSUB; /* don't want process substitution */ + td.word = savestring (string); + list = call_expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + /* This takes care of the calls from expand_string_leave_quoted and + expand_string */ + if (list) + { + tlist = word_list_split (list); + dispose_words (list); + list = tlist; + if (list) + dequote_list (list); + } + /* This comes from expand_string_if_necessary */ + if (list) + { + ret = string_list (list); + dispose_words (list); + } + else + ret = (char *)NULL; + FREE (td.word); + } + else if (saw_quote && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + ret = string_quote_removal (string, quoted); + else + ret = savestring (string); + + return ret; +} + +#if defined (COND_COMMAND) +/* Just remove backslashes in STRING. Returns a new string. */ +char * +remove_backslashes (string) + char *string; +{ + char *r, *ret, *s; + + r = ret = (char *)xmalloc (strlen (string) + 1); + for (s = string; s && *s; ) + { + if (*s == '\\') + s++; + if (*s == 0) + break; + *r++ = *s++; + } + *r = '\0'; + return ret; +} + +/* This needs better error handling. */ +/* Expand W for use as an argument to a unary or binary operator in a + [[...]] expression. If SPECIAL is 1, this is the rhs argument + to the != or == operator, and should be treated as a pattern. In + this case, we quote the string specially for the globbing code. If + SPECIAL is 2, this is an rhs argument for the =~ operator, and should + be quoted appropriately for regcomp/regexec. The caller is responsible + for removing the backslashes if the unquoted word is needed later. */ +char * +cond_expand_word (w, special) + WORD_DESC *w; + int special; +{ + char *r, *p; + WORD_LIST *l; + int qflags; + + if (w->word == 0 || w->word[0] == '\0') + return ((char *)NULL); + + expand_no_split_dollar_star = 1; + w->flags |= W_NOSPLIT2; + l = call_expand_word_internal (w, 0, 0, (int *)0, (int *)0); + expand_no_split_dollar_star = 0; + if (l) + { + if (special == 0) /* LHS */ + { + dequote_list (l); + r = string_list (l); + } + else + { + /* Need to figure out whether or not we should call dequote_escapes + or a new dequote_ctlnul function here, and under what + circumstances. */ + qflags = QGLOB_CVTNULL; + if (special == 2) + qflags |= QGLOB_REGEXP; + p = string_list (l); + r = quote_string_for_globbing (p, qflags); + free (p); + } + dispose_words (l); + } + else + r = (char *)NULL; + + return r; +} +#endif + +/* Call expand_word_internal to expand W and handle error returns. + A convenience function for functions that don't want to handle + any errors or free any memory before aborting. */ +static WORD_LIST * +call_expand_word_internal (w, q, i, c, e) + WORD_DESC *w; + int q, i, *c, *e; +{ + WORD_LIST *result; + + result = expand_word_internal (w, q, i, c, e); + if (result == &expand_word_error || result == &expand_word_fatal) + { + /* By convention, each time this error is returned, w->word has + already been freed (it sometimes may not be in the fatal case, + but that doesn't result in a memory leak because we're going + to exit in most cases). */ + w->word = (char *)NULL; + last_command_exit_value = EXECUTION_FAILURE; + exp_jump_to_top_level ((result == &expand_word_error) ? DISCARD : FORCE_EOF); + /* NOTREACHED */ + return (NULL); + } + else + return (result); +} + +/* Perform parameter expansion, command substitution, and arithmetic + expansion on STRING, as if it were a word. Leave the result quoted. + Since this does not perform word splitting, it leaves quoted nulls + in the result. */ +static WORD_LIST * +expand_string_internal (string, quoted) + char *string; + int quoted; +{ + WORD_DESC td; + WORD_LIST *tresult; + + if (string == 0 || *string == 0) + return ((WORD_LIST *)NULL); + + td.flags = 0; + td.word = savestring (string); + + tresult = call_expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + + FREE (td.word); + return (tresult); +} + +/* Expand STRING by performing parameter expansion, command substitution, + and arithmetic expansion. Dequote the resulting WORD_LIST before + returning it, but do not perform word splitting. The call to + remove_quoted_nulls () is in here because word splitting normally + takes care of quote removal. */ +WORD_LIST * +expand_string_unsplit (string, quoted) + char *string; + int quoted; +{ + WORD_LIST *value; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + expand_no_split_dollar_star = 1; + value = expand_string_internal (string, quoted); + expand_no_split_dollar_star = 0; + + if (value) + { + if (value->word) + { + remove_quoted_nulls (value->word->word); + value->word->flags &= ~W_HASQUOTEDNULL; + } + dequote_list (value); + } + return (value); +} + +/* Expand the rhs of an assignment statement */ +WORD_LIST * +expand_string_assignment (string, quoted) + char *string; + int quoted; +{ + WORD_DESC td; + WORD_LIST *value; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + expand_no_split_dollar_star = 1; + + td.flags = W_ASSIGNRHS; + td.word = savestring (string); + value = call_expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + FREE (td.word); + + expand_no_split_dollar_star = 0; + + if (value) + { + if (value->word) + { + remove_quoted_nulls (value->word->word); + value->word->flags &= ~W_HASQUOTEDNULL; + } + dequote_list (value); + } + return (value); +} + + +/* Expand one of the PS? prompt strings. This is a sort of combination of + expand_string_unsplit and expand_string_internal, but returns the + passed string when an error occurs. Might want to trap other calls + to jump_to_top_level here so we don't endlessly loop. */ +WORD_LIST * +expand_prompt_string (string, quoted, wflags) + char *string; + int quoted; + int wflags; +{ + WORD_LIST *value; + WORD_DESC td; + + if (string == 0 || *string == 0) + return ((WORD_LIST *)NULL); + + td.flags = wflags; + td.word = savestring (string); + + no_longjmp_on_fatal_error = 1; + value = expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + no_longjmp_on_fatal_error = 0; + + if (value == &expand_word_error || value == &expand_word_fatal) + { + value = make_word_list (make_bare_word (string), (WORD_LIST *)NULL); + return value; + } + FREE (td.word); + if (value) + { + if (value->word) + { + remove_quoted_nulls (value->word->word); + value->word->flags &= ~W_HASQUOTEDNULL; + } + dequote_list (value); + } + return (value); +} + +/* Expand STRING just as if you were expanding a word, but do not dequote + the resultant WORD_LIST. This is called only from within this file, + and is used to correctly preserve quoted characters when expanding + things like ${1+"$@"}. This does parameter expansion, command + substitution, arithmetic expansion, and word splitting. */ +static WORD_LIST * +expand_string_leave_quoted (string, quoted) + char *string; + int quoted; +{ + WORD_LIST *tlist; + WORD_LIST *tresult; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + tlist = expand_string_internal (string, quoted); + + if (tlist) + { + tresult = word_list_split (tlist); + dispose_words (tlist); + return (tresult); + } + return ((WORD_LIST *)NULL); +} + +/* This does not perform word splitting or dequote the WORD_LIST + it returns. */ +static WORD_LIST * +expand_string_for_rhs (string, quoted, dollar_at_p, has_dollar_at) + char *string; + int quoted, *dollar_at_p, *has_dollar_at; +{ + WORD_DESC td; + WORD_LIST *tresult; + + if (string == 0 || *string == '\0') + return (WORD_LIST *)NULL; + + td.flags = W_NOSPLIT2; /* no splitting, remove "" and '' */ + td.word = string; + tresult = call_expand_word_internal (&td, quoted, 1, dollar_at_p, has_dollar_at); + return (tresult); +} + +/* Expand STRING just as if you were expanding a word. This also returns + a list of words. Note that filename globbing is *NOT* done for word + or string expansion, just when the shell is expanding a command. This + does parameter expansion, command substitution, arithmetic expansion, + and word splitting. Dequote the resultant WORD_LIST before returning. */ +WORD_LIST * +expand_string (string, quoted) + char *string; + int quoted; +{ + WORD_LIST *result; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + result = expand_string_leave_quoted (string, quoted); + return (result ? dequote_list (result) : result); +} + +/*************************************************** + * * + * Functions to handle quoting chars * + * * + ***************************************************/ + +/* Conventions: + + A string with s[0] == CTLNUL && s[1] == 0 is a quoted null string. + The parser passes CTLNUL as CTLESC CTLNUL. */ + +/* Quote escape characters in string s, but no other characters. This is + used to protect CTLESC and CTLNUL in variable values from the rest of + the word expansion process after the variable is expanded (word splitting + and filename generation). If IFS is null, we quote spaces as well, just + in case we split on spaces later (in the case of unquoted $@, we will + eventually attempt to split the entire word on spaces). Corresponding + code exists in dequote_escapes. Even if we don't end up splitting on + spaces, quoting spaces is not a problem. This should never be called on + a string that is quoted with single or double quotes or part of a here + document (effectively double-quoted). */ +char * +quote_escapes (string) + char *string; +{ + register char *s, *t; + size_t slen; + char *result, *send; + int quote_spaces, skip_ctlesc, skip_ctlnul; + DECLARE_MBSTATE; + + slen = strlen (string); + send = string + slen; + + quote_spaces = (ifs_value && *ifs_value == 0); + + for (skip_ctlesc = skip_ctlnul = 0, s = ifs_value; s && *s; s++) + skip_ctlesc |= *s == CTLESC, skip_ctlnul |= *s == CTLNUL; + + t = result = (char *)xmalloc ((slen * 2) + 1); + s = string; + + while (*s) + { + if ((skip_ctlesc == 0 && *s == CTLESC) || (skip_ctlnul == 0 && *s == CTLNUL) || (quote_spaces && *s == ' ')) + *t++ = CTLESC; + COPY_CHAR_P (t, s, send); + } + *t = '\0'; + + return (result); +} + +static WORD_LIST * +list_quote_escapes (list) + WORD_LIST *list; +{ + register WORD_LIST *w; + char *t; + + for (w = list; w; w = w->next) + { + t = w->word->word; + w->word->word = quote_escapes (t); + free (t); + } + return list; +} + +/* Inverse of quote_escapes; remove CTLESC protecting CTLESC or CTLNUL. + + The parser passes us CTLESC as CTLESC CTLESC and CTLNUL as CTLESC CTLNUL. + This is necessary to make unquoted CTLESC and CTLNUL characters in the + data stream pass through properly. + + We need to remove doubled CTLESC characters inside quoted strings before + quoting the entire string, so we do not double the number of CTLESC + characters. + + Also used by parts of the pattern substitution code. */ +char * +dequote_escapes (string) + char *string; +{ + register char *s, *t, *s1; + size_t slen; + char *result, *send; + int quote_spaces; + DECLARE_MBSTATE; + + if (string == 0) + return string; + + slen = strlen (string); + send = string + slen; + + t = result = (char *)xmalloc (slen + 1); + + if (strchr (string, CTLESC) == 0) + return (strcpy (result, string)); + + quote_spaces = (ifs_value && *ifs_value == 0); + + s = string; + while (*s) + { + if (*s == CTLESC && (s[1] == CTLESC || s[1] == CTLNUL || (quote_spaces && s[1] == ' '))) + { + s++; + if (*s == '\0') + break; + } + COPY_CHAR_P (t, s, send); + } + *t = '\0'; + + return result; +} + +static WORD_LIST * +list_dequote_escapes (list) + WORD_LIST *list; +{ + register WORD_LIST *w; + char *t; + + for (w = list; w; w = w->next) + { + t = w->word->word; + w->word->word = dequote_escapes (t); + free (t); + } + return list; +} + +/* Return a new string with the quoted representation of character C. + This turns "" into QUOTED_NULL, so the W_HASQUOTEDNULL flag needs to be + set in any resultant WORD_DESC where this value is the word. */ +static char * +make_quoted_char (c) + int c; +{ + char *temp; + + temp = (char *)xmalloc (3); + if (c == 0) + { + temp[0] = CTLNUL; + temp[1] = '\0'; + } + else + { + temp[0] = CTLESC; + temp[1] = c; + temp[2] = '\0'; + } + return (temp); +} + +/* Quote STRING, returning a new string. This turns "" into QUOTED_NULL, so + the W_HASQUOTEDNULL flag needs to be set in any resultant WORD_DESC where + this value is the word. */ +char * +quote_string (string) + char *string; +{ + register char *t; + size_t slen; + char *result, *send; + + if (*string == 0) + { + result = (char *)xmalloc (2); + result[0] = CTLNUL; + result[1] = '\0'; + } + else + { + DECLARE_MBSTATE; + + slen = strlen (string); + send = string + slen; + + result = (char *)xmalloc ((slen * 2) + 1); + + for (t = result; string < send; ) + { + *t++ = CTLESC; + COPY_CHAR_P (t, string, send); + } + *t = '\0'; + } + return (result); +} + +/* De-quote quoted characters in STRING. */ +char * +dequote_string (string) + char *string; +{ + register char *s, *t; + size_t slen; + char *result, *send; + DECLARE_MBSTATE; + + slen = strlen (string); + + t = result = (char *)xmalloc (slen + 1); + + if (QUOTED_NULL (string)) + { + result[0] = '\0'; + return (result); + } + + /* If no character in the string can be quoted, don't bother examining + each character. Just return a copy of the string passed to us. */ + if (strchr (string, CTLESC) == NULL) + return (strcpy (result, string)); + + send = string + slen; + s = string; + while (*s) + { + if (*s == CTLESC) + { + s++; + if (*s == '\0') + break; + } + COPY_CHAR_P (t, s, send); + } + + *t = '\0'; + return (result); +} + +/* Quote the entire WORD_LIST list. */ +static WORD_LIST * +quote_list (list) + WORD_LIST *list; +{ + register WORD_LIST *w; + char *t; + + for (w = list; w; w = w->next) + { + t = w->word->word; + w->word->word = quote_string (t); + if (*t == 0) + w->word->flags |= W_HASQUOTEDNULL; /* XXX - turn on W_HASQUOTEDNULL here? */ + w->word->flags |= W_QUOTED; + free (t); + } + return list; +} + +/* De-quote quoted characters in each word in LIST. */ +WORD_LIST * +dequote_list (list) + WORD_LIST *list; +{ + register char *s; + register WORD_LIST *tlist; + + for (tlist = list; tlist; tlist = tlist->next) + { + s = dequote_string (tlist->word->word); + if (QUOTED_NULL (tlist->word->word)) + tlist->word->flags &= ~W_HASQUOTEDNULL; + free (tlist->word->word); + tlist->word->word = s; + } + return list; +} + +/* Remove CTLESC protecting a CTLESC or CTLNUL in place. Return the passed + string. */ +char * +remove_quoted_escapes (string) + char *string; +{ + char *t; + + if (string) + { + t = dequote_escapes (string); + strcpy (string, t); + free (t); + } + + return (string); +} + +/* Perform quoted null character removal on STRING. We don't allow any + quoted null characters in the middle or at the ends of strings because + of how expand_word_internal works. remove_quoted_nulls () turns + STRING into an empty string iff it only consists of a quoted null, + and removes all unquoted CTLNUL characters. */ +char * +remove_quoted_nulls (string) + char *string; +{ + register size_t slen; + register int i, j, prev_i; + DECLARE_MBSTATE; + + if (strchr (string, CTLNUL) == 0) /* XXX */ + return string; /* XXX */ + + slen = strlen (string); + i = j = 0; + + while (i < slen) + { + if (string[i] == CTLESC) + { + /* Old code had j++, but we cannot assume that i == j at this + point -- what if a CTLNUL has already been removed from the + string? We don't want to drop the CTLESC or recopy characters + that we've already copied down. */ + i++; string[j++] = CTLESC; + if (i == slen) + break; + } + else if (string[i] == CTLNUL) + { + i++; + continue; + } + + prev_i = i; + ADVANCE_CHAR (string, slen, i); + if (j < prev_i) + { + do string[j++] = string[prev_i++]; while (prev_i < i); + } + else + j = i; + } + string[j] = '\0'; + + return (string); +} + +/* Perform quoted null character removal on each element of LIST. + This modifies LIST. */ +void +word_list_remove_quoted_nulls (list) + WORD_LIST *list; +{ + register WORD_LIST *t; + + for (t = list; t; t = t->next) + { + remove_quoted_nulls (t->word->word); + t->word->flags &= ~W_HASQUOTEDNULL; + } +} + +/* **************************************************************** */ +/* */ +/* Functions for Matching and Removing Patterns */ +/* */ +/* **************************************************************** */ + +#if defined (HANDLE_MULTIBYTE) +#if 0 /* Currently unused */ +static unsigned char * +mb_getcharlens (string, len) + char *string; + int len; +{ + int i, offset, last; + unsigned char *ret; + char *p; + DECLARE_MBSTATE; + + i = offset = 0; + last = 0; + ret = (unsigned char *)xmalloc (len); + memset (ret, 0, len); + while (string[last]) + { + ADVANCE_CHAR (string, len, offset); + ret[last] = offset - last; + last = offset; + } + return ret; +} +#endif +#endif + +/* Remove the portion of PARAM matched by PATTERN according to OP, where OP + can have one of 4 values: + RP_LONG_LEFT remove longest matching portion at start of PARAM + RP_SHORT_LEFT remove shortest matching portion at start of PARAM + RP_LONG_RIGHT remove longest matching portion at end of PARAM + RP_SHORT_RIGHT remove shortest matching portion at end of PARAM +*/ + +#define RP_LONG_LEFT 1 +#define RP_SHORT_LEFT 2 +#define RP_LONG_RIGHT 3 +#define RP_SHORT_RIGHT 4 + +/* Returns its first argument if nothing matched; new memory otherwise */ +static char * +remove_upattern (param, pattern, op) + char *param, *pattern; + int op; +{ + register int len; + register char *end; + register char *p, *ret, c; + + len = STRLEN (param); + end = param + len; + + switch (op) + { + case RP_LONG_LEFT: /* remove longest match at start */ + for (p = end; p >= param; p--) + { + c = *p; *p = '\0'; + if (strmatch (pattern, param, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + *p = c; + return (savestring (p)); + } + *p = c; + + } + break; + + case RP_SHORT_LEFT: /* remove shortest match at start */ + for (p = param; p <= end; p++) + { + c = *p; *p = '\0'; + if (strmatch (pattern, param, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + *p = c; + return (savestring (p)); + } + *p = c; + } + break; + + case RP_LONG_RIGHT: /* remove longest match at end */ + for (p = param; p <= end; p++) + { + if (strmatch (pattern, p, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + c = *p; *p = '\0'; + ret = savestring (param); + *p = c; + return (ret); + } + } + break; + + case RP_SHORT_RIGHT: /* remove shortest match at end */ + for (p = end; p >= param; p--) + { + if (strmatch (pattern, p, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + c = *p; *p = '\0'; + ret = savestring (param); + *p = c; + return (ret); + } + } + break; + } + + return (param); /* no match, return original string */ +} + +#if defined (HANDLE_MULTIBYTE) +/* Returns its first argument if nothing matched; new memory otherwise */ +static wchar_t * +remove_wpattern (wparam, wstrlen, wpattern, op) + wchar_t *wparam; + size_t wstrlen; + wchar_t *wpattern; + int op; +{ + wchar_t wc, *ret; + int n; + + switch (op) + { + case RP_LONG_LEFT: /* remove longest match at start */ + for (n = wstrlen; n >= 0; n--) + { + wc = wparam[n]; wparam[n] = L'\0'; + if (wcsmatch (wpattern, wparam, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wparam[n] = wc; + return (wcsdup (wparam + n)); + } + wparam[n] = wc; + } + break; + + case RP_SHORT_LEFT: /* remove shortest match at start */ + for (n = 0; n <= wstrlen; n++) + { + wc = wparam[n]; wparam[n] = L'\0'; + if (wcsmatch (wpattern, wparam, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wparam[n] = wc; + return (wcsdup (wparam + n)); + } + wparam[n] = wc; + } + break; + + case RP_LONG_RIGHT: /* remove longest match at end */ + for (n = 0; n <= wstrlen; n++) + { + if (wcsmatch (wpattern, wparam + n, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wc = wparam[n]; wparam[n] = L'\0'; + ret = wcsdup (wparam); + wparam[n] = wc; + return (ret); + } + } + break; + + case RP_SHORT_RIGHT: /* remove shortest match at end */ + for (n = wstrlen; n >= 0; n--) + { + if (wcsmatch (wpattern, wparam + n, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wc = wparam[n]; wparam[n] = L'\0'; + ret = wcsdup (wparam); + wparam[n] = wc; + return (ret); + } + } + break; + } + + return (wparam); /* no match, return original string */ +} +#endif /* HANDLE_MULTIBYTE */ + +static char * +remove_pattern (param, pattern, op) + char *param, *pattern; + int op; +{ + char *xret; + + if (param == NULL) + return (param); + if (*param == '\0' || pattern == NULL || *pattern == '\0') /* minor optimization */ + return (savestring (param)); + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1) + { + wchar_t *ret, *oret; + size_t n; + wchar_t *wparam, *wpattern; + mbstate_t ps; + + n = xdupmbstowcs (&wpattern, NULL, pattern); + if (n == (size_t)-1) + { + xret = remove_upattern (param, pattern, op); + return ((xret == param) ? savestring (param) : xret); + } + n = xdupmbstowcs (&wparam, NULL, param); + + if (n == (size_t)-1) + { + free (wpattern); + xret = remove_upattern (param, pattern, op); + return ((xret == param) ? savestring (param) : xret); + } + oret = ret = remove_wpattern (wparam, n, wpattern, op); + /* Don't bother to convert wparam back to multibyte string if nothing + matched; just return copy of original string */ + if (ret == wparam) + { + free (wparam); + free (wpattern); + return (savestring (param)); + } + + free (wparam); + free (wpattern); + + n = strlen (param); + xret = (char *)xmalloc (n + 1); + memset (&ps, '\0', sizeof (mbstate_t)); + n = wcsrtombs (xret, (const wchar_t **)&ret, n, &ps); + xret[n] = '\0'; /* just to make sure */ + free (oret); + return xret; + } + else +#endif + { + xret = remove_upattern (param, pattern, op); + return ((xret == param) ? savestring (param) : xret); + } +} + +/* Match PAT anywhere in STRING and return the match boundaries. + This returns 1 in case of a successful match, 0 otherwise. SP + and EP are pointers into the string where the match begins and + ends, respectively. MTYPE controls what kind of match is attempted. + MATCH_BEG and MATCH_END anchor the match at the beginning and end + of the string, respectively. The longest match is returned. */ +static int +match_upattern (string, pat, mtype, sp, ep) + char *string, *pat; + int mtype; + char **sp, **ep; +{ + int c, len, mlen; + register char *p, *p1, *npat; + char *end; + int n1; + + /* If the pattern doesn't match anywhere in the string, go ahead and + short-circuit right away. A minor optimization, saves a bunch of + unnecessary calls to strmatch (up to N calls for a string of N + characters) if the match is unsuccessful. To preserve the semantics + of the substring matches below, we make sure that the pattern has + `*' as first and last character, making a new pattern if necessary. */ + /* XXX - check this later if I ever implement `**' with special meaning, + since this will potentially result in `**' at the beginning or end */ + len = STRLEN (pat); + if (pat[0] != '*' || (pat[0] == '*' && pat[1] == LPAREN && extended_glob) || pat[len - 1] != '*') + { + p = npat = (char *)xmalloc (len + 3); + p1 = pat; + if (*p1 != '*' || (*p1 == '*' && p1[1] == LPAREN && extended_glob)) + *p++ = '*'; + while (*p1) + *p++ = *p1++; + if (p1[-1] != '*' || p[-2] == '\\') + *p++ = '*'; + *p = '\0'; + } + else + npat = pat; + c = strmatch (npat, string, FNMATCH_EXTFLAG); + if (npat != pat) + free (npat); + if (c == FNM_NOMATCH) + return (0); + + len = STRLEN (string); + end = string + len; + + mlen = umatchlen (pat, len); + + switch (mtype) + { + case MATCH_ANY: + for (p = string; p <= end; p++) + { + if (match_pattern_char (pat, p)) + { + p1 = (mlen == -1) ? end : p + mlen; + /* p1 - p = length of portion of string to be considered + p = current position in string + mlen = number of characters consumed by match (-1 for entire string) + end = end of string + we want to break immediately if the potential match len + is greater than the number of characters remaining in the + string + */ + if (p1 > end) + break; + for ( ; p1 >= p; p1--) + { + c = *p1; *p1 = '\0'; + if (strmatch (pat, p, FNMATCH_EXTFLAG) == 0) + { + *p1 = c; + *sp = p; + *ep = p1; + return 1; + } + *p1 = c; +#if 1 + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; +#endif + } + } + } + + return (0); + + case MATCH_BEG: + if (match_pattern_char (pat, string) == 0) + return (0); + + for (p = (mlen == -1) ? end : string + mlen; p >= string; p--) + { + c = *p; *p = '\0'; + if (strmatch (pat, string, FNMATCH_EXTFLAG) == 0) + { + *p = c; + *sp = string; + *ep = p; + return 1; + } + *p = c; + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + + return (0); + + case MATCH_END: + for (p = end - ((mlen == -1) ? len : mlen); p <= end; p++) + { + if (strmatch (pat, p, FNMATCH_EXTFLAG) == 0) + { + *sp = p; + *ep = end; + return 1; + } + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + + return (0); + } + + return (0); +} + +#if defined (HANDLE_MULTIBYTE) +/* Match WPAT anywhere in WSTRING and return the match boundaries. + This returns 1 in case of a successful match, 0 otherwise. Wide + character version. */ +static int +match_wpattern (wstring, indices, wstrlen, wpat, mtype, sp, ep) + wchar_t *wstring; + char **indices; + size_t wstrlen; + wchar_t *wpat; + int mtype; + char **sp, **ep; +{ + wchar_t wc, *wp, *nwpat, *wp1; + size_t len; + int mlen; + int n, n1, n2, simple; + + simple = (wpat[0] != L'\\' && wpat[0] != L'*' && wpat[0] != L'?' && wpat[0] != L'['); +#if defined (EXTENDED_GLOB) + if (extended_glob) + simple &= (wpat[1] != L'(' || (wpat[0] != L'*' && wpat[0] != L'?' && wpat[0] != L'+' && wpat[0] != L'!' && wpat[0] != L'@')); /*)*/ +#endif + + /* If the pattern doesn't match anywhere in the string, go ahead and + short-circuit right away. A minor optimization, saves a bunch of + unnecessary calls to strmatch (up to N calls for a string of N + characters) if the match is unsuccessful. To preserve the semantics + of the substring matches below, we make sure that the pattern has + `*' as first and last character, making a new pattern if necessary. */ + len = wcslen (wpat); + if (wpat[0] != L'*' || (wpat[0] == L'*' && wpat[1] == WLPAREN && extended_glob) || wpat[len - 1] != L'*') + { + wp = nwpat = (wchar_t *)xmalloc ((len + 3) * sizeof (wchar_t)); + wp1 = wpat; + if (*wp1 != L'*' || (*wp1 == '*' && wp1[1] == WLPAREN && extended_glob)) + *wp++ = L'*'; + while (*wp1 != L'\0') + *wp++ = *wp1++; + if (wp1[-1] != L'*' || wp1[-2] == L'\\') + *wp++ = L'*'; + *wp = '\0'; + } + else + nwpat = wpat; + len = wcsmatch (nwpat, wstring, FNMATCH_EXTFLAG); + if (nwpat != wpat) + free (nwpat); + if (len == FNM_NOMATCH) + return (0); + + mlen = wmatchlen (wpat, wstrlen); + +/* itrace("wmatchlen (%ls) -> %d", wpat, mlen); */ + switch (mtype) + { + case MATCH_ANY: + for (n = 0; n <= wstrlen; n++) + { + n2 = simple ? (*wpat == wstring[n]) : match_pattern_wchar (wpat, wstring + n); + if (n2) + { + n1 = (mlen == -1) ? wstrlen : n + mlen; + if (n1 > wstrlen) + break; + + for ( ; n1 >= n; n1--) + { + wc = wstring[n1]; wstring[n1] = L'\0'; + if (wcsmatch (wpat, wstring + n, FNMATCH_EXTFLAG) == 0) + { + wstring[n1] = wc; + *sp = indices[n]; + *ep = indices[n1]; + return 1; + } + wstring[n1] = wc; + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + } + } + + return (0); + + case MATCH_BEG: + if (match_pattern_wchar (wpat, wstring) == 0) + return (0); + + for (n = (mlen == -1) ? wstrlen : mlen; n >= 0; n--) + { + wc = wstring[n]; wstring[n] = L'\0'; + if (wcsmatch (wpat, wstring, FNMATCH_EXTFLAG) == 0) + { + wstring[n] = wc; + *sp = indices[0]; + *ep = indices[n]; + return 1; + } + wstring[n] = wc; + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + + return (0); + + case MATCH_END: + for (n = wstrlen - ((mlen == -1) ? wstrlen : mlen); n <= wstrlen; n++) + { + if (wcsmatch (wpat, wstring + n, FNMATCH_EXTFLAG) == 0) + { + *sp = indices[n]; + *ep = indices[wstrlen]; + return 1; + } + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + + return (0); + } + + return (0); +} +#endif /* HANDLE_MULTIBYTE */ + +static int +match_pattern (string, pat, mtype, sp, ep) + char *string, *pat; + int mtype; + char **sp, **ep; +{ +#if defined (HANDLE_MULTIBYTE) + int ret; + size_t n; + wchar_t *wstring, *wpat; + char **indices; + size_t slen, plen, mslen, mplen; +#endif + + if (string == 0 || *string == 0 || pat == 0 || *pat == 0) + return (0); + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1) + { + if (mbsmbchar (string) == 0 && mbsmbchar (pat) == 0) + return (match_upattern (string, pat, mtype, sp, ep)); + + n = xdupmbstowcs (&wpat, NULL, pat); + if (n == (size_t)-1) + return (match_upattern (string, pat, mtype, sp, ep)); + n = xdupmbstowcs (&wstring, &indices, string); + if (n == (size_t)-1) + { + free (wpat); + return (match_upattern (string, pat, mtype, sp, ep)); + } + ret = match_wpattern (wstring, indices, n, wpat, mtype, sp, ep); + + free (wpat); + free (wstring); + free (indices); + + return (ret); + } + else +#endif + return (match_upattern (string, pat, mtype, sp, ep)); +} + +static int +getpatspec (c, value) + int c; + char *value; +{ + if (c == '#') + return ((*value == '#') ? RP_LONG_LEFT : RP_SHORT_LEFT); + else /* c == '%' */ + return ((*value == '%') ? RP_LONG_RIGHT : RP_SHORT_RIGHT); +} + +/* Posix.2 says that the WORD should be run through tilde expansion, + parameter expansion, command substitution and arithmetic expansion. + This leaves the result quoted, so quote_string_for_globbing () has + to be called to fix it up for strmatch (). If QUOTED is non-zero, + it means that the entire expression was enclosed in double quotes. + This means that quoting characters in the pattern do not make any + special pattern characters quoted. For example, the `*' in the + following retains its special meaning: "${foo#'*'}". */ +static char * +getpattern (value, quoted, expandpat) + char *value; + int quoted, expandpat; +{ + char *pat, *tword; + WORD_LIST *l; +#if 0 + int i; +#endif + /* There is a problem here: how to handle single or double quotes in the + pattern string when the whole expression is between double quotes? + POSIX.2 says that enclosing double quotes do not cause the pattern to + be quoted, but does that leave us a problem with @ and array[@] and their + expansions inside a pattern? */ +#if 0 + if (expandpat && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && *tword) + { + i = 0; + pat = string_extract_double_quoted (tword, &i, 1); + free (tword); + tword = pat; + } +#endif + + /* expand_string_for_rhs () leaves WORD quoted and does not perform + word splitting. */ + l = *value ? expand_string_for_rhs (value, + (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) ? Q_PATQUOTE : quoted, + (int *)NULL, (int *)NULL) + : (WORD_LIST *)0; + pat = string_list (l); + dispose_words (l); + if (pat) + { + tword = quote_string_for_globbing (pat, QGLOB_CVTNULL); + free (pat); + pat = tword; + } + return (pat); +} + +#if 0 +/* Handle removing a pattern from a string as a result of ${name%[%]value} + or ${name#[#]value}. */ +static char * +variable_remove_pattern (value, pattern, patspec, quoted) + char *value, *pattern; + int patspec, quoted; +{ + char *tword; + + tword = remove_pattern (value, pattern, patspec); + + return (tword); +} +#endif + +static char * +list_remove_pattern (list, pattern, patspec, itype, quoted) + WORD_LIST *list; + char *pattern; + int patspec, itype, quoted; +{ + WORD_LIST *new, *l; + WORD_DESC *w; + char *tword; + + for (new = (WORD_LIST *)NULL, l = list; l; l = l->next) + { + tword = remove_pattern (l->word->word, pattern, patspec); + w = alloc_word_desc (); + w->word = tword ? tword : savestring (""); + new = make_word_list (w, new); + } + + l = REVERSE_LIST (new, WORD_LIST *); + tword = string_list_pos_params (itype, l, quoted); + dispose_words (l); + + return (tword); +} + +static char * +parameter_list_remove_pattern (itype, pattern, patspec, quoted) + int itype; + char *pattern; + int patspec, quoted; +{ + char *ret; + WORD_LIST *list; + + list = list_rest_of_args (); + if (list == 0) + return ((char *)NULL); + ret = list_remove_pattern (list, pattern, patspec, itype, quoted); + dispose_words (list); + return (ret); +} + +#if defined (ARRAY_VARS) +static char * +array_remove_pattern (var, pattern, patspec, varname, quoted) + SHELL_VAR *var; + char *pattern; + int patspec; + char *varname; /* so we can figure out how it's indexed */ + int quoted; +{ + ARRAY *a; + HASH_TABLE *h; + int itype; + char *ret; + WORD_LIST *list; + SHELL_VAR *v; + + /* compute itype from varname here */ + v = array_variable_part (varname, &ret, 0); + + /* XXX */ + if (v && invisible_p (var)) + return ((char *)NULL); + + itype = ret[0]; + + a = (v && array_p (v)) ? array_cell (v) : 0; + h = (v && assoc_p (v)) ? assoc_cell (v) : 0; + + list = a ? array_to_word_list (a) : (h ? assoc_to_word_list (h) : 0); + if (list == 0) + return ((char *)NULL); + ret = list_remove_pattern (list, pattern, patspec, itype, quoted); + dispose_words (list); + + return ret; +} +#endif /* ARRAY_VARS */ + +static char * +parameter_brace_remove_pattern (varname, value, ind, patstr, rtype, quoted, flags) + char *varname, *value; + int ind; + char *patstr; + int rtype, quoted, flags; +{ + int vtype, patspec, starsub; + char *temp1, *val, *pattern; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + this_command_name = varname; + + vtype = get_var_and_type (varname, value, ind, quoted, flags, &v, &val); + if (vtype == -1) + return ((char *)NULL); + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + patspec = getpatspec (rtype, patstr); + if (patspec == RP_LONG_LEFT || patspec == RP_LONG_RIGHT) + patstr++; + + /* Need to pass getpattern newly-allocated memory in case of expansion -- + the expansion code will free the passed string on an error. */ + temp1 = savestring (patstr); + pattern = getpattern (temp1, quoted, 1); + free (temp1); + + temp1 = (char *)NULL; /* shut up gcc */ + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + temp1 = remove_pattern (val, pattern, patspec); + if (vtype == VT_VARIABLE) + FREE (val); + if (temp1) + { + val = (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + ? quote_string (temp1) + : quote_escapes (temp1); + free (temp1); + temp1 = val; + } + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + temp1 = array_remove_pattern (v, pattern, patspec, varname, quoted); + if (temp1 && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + { + val = quote_escapes (temp1); + free (temp1); + temp1 = val; + } + break; +#endif + case VT_POSPARMS: + temp1 = parameter_list_remove_pattern (varname[0], pattern, patspec, quoted); + if (temp1 && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + { + val = quote_escapes (temp1); + free (temp1); + temp1 = val; + } + break; + } + + FREE (pattern); + return temp1; +} + +/******************************************* + * * + * Functions to expand WORD_DESCs * + * * + *******************************************/ + +/* Expand WORD, performing word splitting on the result. This does + parameter expansion, command substitution, arithmetic expansion, + word splitting, and quote removal. */ + +WORD_LIST * +expand_word (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_LIST *result, *tresult; + + tresult = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); + result = word_list_split (tresult); + dispose_words (tresult); + return (result ? dequote_list (result) : result); +} + +/* Expand WORD, but do not perform word splitting on the result. This + does parameter expansion, command substitution, arithmetic expansion, + and quote removal. */ +WORD_LIST * +expand_word_unsplit (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_LIST *result; + + expand_no_split_dollar_star = 1; +#if defined (HANDLE_MULTIBYTE) + if (ifs_firstc[0] == 0) +#else + if (ifs_firstc == 0) +#endif + word->flags |= W_NOSPLIT; + word->flags |= W_NOSPLIT2; + result = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); + expand_no_split_dollar_star = 0; + + return (result ? dequote_list (result) : result); +} + +/* Perform shell expansions on WORD, but do not perform word splitting or + quote removal on the result. Virtually identical to expand_word_unsplit; + could be combined if implementations don't diverge. */ +WORD_LIST * +expand_word_leave_quoted (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_LIST *result; + + expand_no_split_dollar_star = 1; +#if defined (HANDLE_MULTIBYTE) + if (ifs_firstc[0] == 0) +#else + if (ifs_firstc == 0) +#endif + word->flags |= W_NOSPLIT; + word->flags |= W_NOSPLIT2; + result = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); + expand_no_split_dollar_star = 0; + + return result; +} + +#if defined (PROCESS_SUBSTITUTION) + +/*****************************************************************/ +/* */ +/* Hacking Process Substitution */ +/* */ +/*****************************************************************/ + +#if !defined (HAVE_DEV_FD) +/* Named pipes must be removed explicitly with `unlink'. This keeps a list + of FIFOs the shell has open. unlink_fifo_list will walk the list and + unlink all of them. add_fifo_list adds the name of an open FIFO to the + list. NFIFO is a count of the number of FIFOs in the list. */ +#define FIFO_INCR 20 + +struct temp_fifo { + char *file; + pid_t proc; +}; + +static struct temp_fifo *fifo_list = (struct temp_fifo *)NULL; +static int nfifo; +static int fifo_list_size; + +char * +copy_fifo_list (sizep) + int *sizep; +{ + if (sizep) + *sizep = 0; + return (char *)NULL; +} + +static void +add_fifo_list (pathname) + char *pathname; +{ + if (nfifo >= fifo_list_size - 1) + { + fifo_list_size += FIFO_INCR; + fifo_list = (struct temp_fifo *)xrealloc (fifo_list, + fifo_list_size * sizeof (struct temp_fifo)); + } + + fifo_list[nfifo].file = savestring (pathname); + nfifo++; +} + +void +unlink_fifo (i) + int i; +{ + if ((fifo_list[i].proc == -1) || (kill(fifo_list[i].proc, 0) == -1)) + { + unlink (fifo_list[i].file); + free (fifo_list[i].file); + fifo_list[i].file = (char *)NULL; + fifo_list[i].proc = -1; + } +} + +void +unlink_fifo_list () +{ + int saved, i, j; + + if (nfifo == 0) + return; + + for (i = saved = 0; i < nfifo; i++) + { + if ((fifo_list[i].proc == -1) || (kill(fifo_list[i].proc, 0) == -1)) + { + unlink (fifo_list[i].file); + free (fifo_list[i].file); + fifo_list[i].file = (char *)NULL; + fifo_list[i].proc = -1; + } + else + saved++; + } + + /* If we didn't remove some of the FIFOs, compact the list. */ + if (saved) + { + for (i = j = 0; i < nfifo; i++) + if (fifo_list[i].file) + { + fifo_list[j].file = fifo_list[i].file; + fifo_list[j].proc = fifo_list[i].proc; + j++; + } + nfifo = j; + } + else + nfifo = 0; +} + +/* Take LIST, which is a bitmap denoting active FIFOs in fifo_list + from some point in the past, and close all open FIFOs in fifo_list + that are not marked as active in LIST. If LIST is NULL, close + everything in fifo_list. LSIZE is the number of elements in LIST, in + case it's larger than fifo_list_size (size of fifo_list). */ +void +close_new_fifos (list, lsize) + char *list; + int lsize; +{ + int i; + + if (list == 0) + { + unlink_fifo_list (); + return; + } + + for (i = 0; i < lsize; i++) + if (list[i] == 0 && i < fifo_list_size && fifo_list[i].proc != -1) + unlink_fifo (i); + + for (i = lsize; i < fifo_list_size; i++) + unlink_fifo (i); +} + +int +fifos_pending () +{ + return nfifo; +} + +int +num_fifos () +{ + return nfifo; +} + +static char * +make_named_pipe () +{ + char *tname; + + tname = sh_mktmpname ("sh-np", MT_USERANDOM|MT_USETMPDIR); + if (mkfifo (tname, 0600) < 0) + { + free (tname); + return ((char *)NULL); + } + + add_fifo_list (tname); + return (tname); +} + +#else /* HAVE_DEV_FD */ + +/* DEV_FD_LIST is a bitmap of file descriptors attached to pipes the shell + has open to children. NFDS is a count of the number of bits currently + set in DEV_FD_LIST. TOTFDS is a count of the highest possible number + of open files. */ +static char *dev_fd_list = (char *)NULL; +static int nfds; +static int totfds; /* The highest possible number of open files. */ + +char * +copy_fifo_list (sizep) + int *sizep; +{ + char *ret; + + if (nfds == 0 || totfds == 0) + { + if (sizep) + *sizep = 0; + return (char *)NULL; + } + + if (sizep) + *sizep = totfds; + ret = (char *)xmalloc (totfds); + return (memcpy (ret, dev_fd_list, totfds)); +} + +static void +add_fifo_list (fd) + int fd; +{ + if (dev_fd_list == 0 || fd >= totfds) + { + int ofds; + + ofds = totfds; + totfds = getdtablesize (); + if (totfds < 0 || totfds > 256) + totfds = 256; + if (fd >= totfds) + totfds = fd + 2; + + dev_fd_list = (char *)xrealloc (dev_fd_list, totfds); + memset (dev_fd_list + ofds, '\0', totfds - ofds); + } + + dev_fd_list[fd] = 1; + nfds++; +} + +int +fifos_pending () +{ + return 0; /* used for cleanup; not needed with /dev/fd */ +} + +int +num_fifos () +{ + return nfds; +} + +void +unlink_fifo (fd) + int fd; +{ + if (dev_fd_list[fd]) + { + close (fd); + dev_fd_list[fd] = 0; + nfds--; + } +} + +void +unlink_fifo_list () +{ + register int i; + + if (nfds == 0) + return; + + for (i = 0; nfds && i < totfds; i++) + unlink_fifo (i); + + nfds = 0; +} + +/* Take LIST, which is a snapshot copy of dev_fd_list from some point in + the past, and close all open fds in dev_fd_list that are not marked + as open in LIST. If LIST is NULL, close everything in dev_fd_list. + LSIZE is the number of elements in LIST, in case it's larger than + totfds (size of dev_fd_list). */ +void +close_new_fifos (list, lsize) + char *list; + int lsize; +{ + int i; + + if (list == 0) + { + unlink_fifo_list (); + return; + } + + for (i = 0; i < lsize; i++) + if (list[i] == 0 && i < totfds && dev_fd_list[i]) + unlink_fifo (i); + + for (i = lsize; i < totfds; i++) + unlink_fifo (i); +} + +#if defined (NOTDEF) +print_dev_fd_list () +{ + register int i; + + fprintf (stderr, "pid %ld: dev_fd_list:", (long)getpid ()); + fflush (stderr); + + for (i = 0; i < totfds; i++) + { + if (dev_fd_list[i]) + fprintf (stderr, " %d", i); + } + fprintf (stderr, "\n"); +} +#endif /* NOTDEF */ + +static char * +make_dev_fd_filename (fd) + int fd; +{ + char *ret, intbuf[INT_STRLEN_BOUND (int) + 1], *p; + + ret = (char *)xmalloc (sizeof (DEV_FD_PREFIX) + 8); + + strcpy (ret, DEV_FD_PREFIX); + p = inttostr (fd, intbuf, sizeof (intbuf)); + strcpy (ret + sizeof (DEV_FD_PREFIX) - 1, p); + + add_fifo_list (fd); + return (ret); +} + +#endif /* HAVE_DEV_FD */ + +/* Return a filename that will open a connection to the process defined by + executing STRING. HAVE_DEV_FD, if defined, means open a pipe and return + a filename in /dev/fd corresponding to a descriptor that is one of the + ends of the pipe. If not defined, we use named pipes on systems that have + them. Systems without /dev/fd and named pipes are out of luck. + + OPEN_FOR_READ_IN_CHILD, if 1, means open the named pipe for reading or + use the read end of the pipe and dup that file descriptor to fd 0 in + the child. If OPEN_FOR_READ_IN_CHILD is 0, we open the named pipe for + writing or use the write end of the pipe in the child, and dup that + file descriptor to fd 1 in the child. The parent does the opposite. */ + +static char * +process_substitute (string, open_for_read_in_child) + char *string; + int open_for_read_in_child; +{ + char *pathname; + int fd, result; + pid_t old_pid, pid; +#if defined (HAVE_DEV_FD) + int parent_pipe_fd, child_pipe_fd; + int fildes[2]; +#endif /* HAVE_DEV_FD */ +#if defined (JOB_CONTROL) + pid_t old_pipeline_pgrp; +#endif + + if (!string || !*string || wordexp_only) + return ((char *)NULL); + +#if !defined (HAVE_DEV_FD) + pathname = make_named_pipe (); +#else /* HAVE_DEV_FD */ + if (pipe (fildes) < 0) + { + sys_error (_("cannot make pipe for process substitution")); + return ((char *)NULL); + } + /* If OPEN_FOR_READ_IN_CHILD == 1, we want to use the write end of + the pipe in the parent, otherwise the read end. */ + parent_pipe_fd = fildes[open_for_read_in_child]; + child_pipe_fd = fildes[1 - open_for_read_in_child]; + /* Move the parent end of the pipe to some high file descriptor, to + avoid clashes with FDs used by the script. */ + parent_pipe_fd = move_to_high_fd (parent_pipe_fd, 1, 64); + + pathname = make_dev_fd_filename (parent_pipe_fd); +#endif /* HAVE_DEV_FD */ + + if (pathname == 0) + { + sys_error (_("cannot make pipe for process substitution")); + return ((char *)NULL); + } + + old_pid = last_made_pid; + +#if defined (JOB_CONTROL) + old_pipeline_pgrp = pipeline_pgrp; + pipeline_pgrp = shell_pgrp; + save_pipeline (1); +#endif /* JOB_CONTROL */ + + pid = make_child ((char *)NULL, 1); + if (pid == 0) + { + reset_terminating_signals (); /* XXX */ + free_pushed_string_input (); + /* Cancel traps, in trap.c. */ + restore_original_signals (); /* XXX - what about special builtins? bash-4.2 */ + setup_async_signals (); + subshell_environment |= SUBSHELL_COMSUB|SUBSHELL_PROCSUB; + } + +#if defined (JOB_CONTROL) + set_sigchld_handler (); + stop_making_children (); + /* XXX - should we only do this in the parent? (as in command subst) */ + pipeline_pgrp = old_pipeline_pgrp; +#endif /* JOB_CONTROL */ + + if (pid < 0) + { + sys_error (_("cannot make child for process substitution")); + free (pathname); +#if defined (HAVE_DEV_FD) + close (parent_pipe_fd); + close (child_pipe_fd); +#endif /* HAVE_DEV_FD */ + return ((char *)NULL); + } + + if (pid > 0) + { +#if defined (JOB_CONTROL) + restore_pipeline (1); +#endif + +#if !defined (HAVE_DEV_FD) + fifo_list[nfifo-1].proc = pid; +#endif + + last_made_pid = old_pid; + +#if defined (JOB_CONTROL) && defined (PGRP_PIPE) + close_pgrp_pipe (); +#endif /* JOB_CONTROL && PGRP_PIPE */ + +#if defined (HAVE_DEV_FD) + close (child_pipe_fd); +#endif /* HAVE_DEV_FD */ + + return (pathname); + } + + set_sigint_handler (); + +#if defined (JOB_CONTROL) + set_job_control (0); +#endif /* JOB_CONTROL */ + +#if !defined (HAVE_DEV_FD) + /* Open the named pipe in the child. */ + fd = open (pathname, open_for_read_in_child ? O_RDONLY : O_WRONLY); + if (fd < 0) + { + /* Two separate strings for ease of translation. */ + if (open_for_read_in_child) + sys_error (_("cannot open named pipe %s for reading"), pathname); + else + sys_error (_("cannot open named pipe %s for writing"), pathname); + + exit (127); + } + if (open_for_read_in_child) + { + if (sh_unset_nodelay_mode (fd) < 0) + { + sys_error (_("cannot reset nodelay mode for fd %d"), fd); + exit (127); + } + } +#else /* HAVE_DEV_FD */ + fd = child_pipe_fd; +#endif /* HAVE_DEV_FD */ + + if (dup2 (fd, open_for_read_in_child ? 0 : 1) < 0) + { + sys_error (_("cannot duplicate named pipe %s as fd %d"), pathname, + open_for_read_in_child ? 0 : 1); + exit (127); + } + + if (fd != (open_for_read_in_child ? 0 : 1)) + close (fd); + + /* Need to close any files that this process has open to pipes inherited + from its parent. */ + if (current_fds_to_close) + { + close_fd_bitmap (current_fds_to_close); + current_fds_to_close = (struct fd_bitmap *)NULL; + } + +#if defined (HAVE_DEV_FD) + /* Make sure we close the parent's end of the pipe and clear the slot + in the fd list so it is not closed later, if reallocated by, for + instance, pipe(2). */ + close (parent_pipe_fd); + dev_fd_list[parent_pipe_fd] = 0; +#endif /* HAVE_DEV_FD */ + + /* subshells shouldn't have this flag, which controls using the temporary + environment for variable lookups. */ + expanding_redir = 0; + + result = parse_and_execute (string, "process substitution", (SEVAL_NONINT|SEVAL_NOHIST)); + +#if !defined (HAVE_DEV_FD) + /* Make sure we close the named pipe in the child before we exit. */ + close (open_for_read_in_child ? 0 : 1); +#endif /* !HAVE_DEV_FD */ + + last_command_exit_value = result; + result = run_exit_trap (); + exit (result); + /*NOTREACHED*/ +} +#endif /* PROCESS_SUBSTITUTION */ + +/***********************************/ +/* */ +/* Command Substitution */ +/* */ +/***********************************/ + +static char * +read_comsub (fd, quoted, rflag) + int fd, quoted; + int *rflag; +{ + char *istring, buf[128], *bufp, *s; + int istring_index, istring_size, c, tflag, skip_ctlesc, skip_ctlnul; + ssize_t bufn; + + istring = (char *)NULL; + istring_index = istring_size = bufn = tflag = 0; + + for (skip_ctlesc = skip_ctlnul = 0, s = ifs_value; s && *s; s++) + skip_ctlesc |= *s == CTLESC, skip_ctlnul |= *s == CTLNUL; + + /* Read the output of the command through the pipe. This may need to be + changed to understand multibyte characters in the future. */ + while (1) + { + if (fd < 0) + break; + if (--bufn <= 0) + { + bufn = zread (fd, buf, sizeof (buf)); + if (bufn <= 0) + break; + bufp = buf; + } + c = *bufp++; + + if (c == 0) + { +#if 0 + internal_warning ("read_comsub: ignored null byte in input"); +#endif + continue; + } + + /* Add the character to ISTRING, possibly after resizing it. */ + RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, DEFAULT_ARRAY_SIZE); + + /* This is essentially quote_string inline */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) /* || c == CTLESC || c == CTLNUL */) + istring[istring_index++] = CTLESC; + /* Escape CTLESC and CTLNUL in the output to protect those characters + from the rest of the word expansions (word splitting and globbing.) + This is essentially quote_escapes inline. */ + else if (skip_ctlesc == 0 && c == CTLESC) + { + tflag |= W_HASCTLESC; + istring[istring_index++] = CTLESC; + } + else if ((skip_ctlnul == 0 && c == CTLNUL) || (c == ' ' && (ifs_value && *ifs_value == 0))) + istring[istring_index++] = CTLESC; + + istring[istring_index++] = c; + +#if 0 +#if defined (__CYGWIN__) + if (c == '\n' && istring_index > 1 && istring[istring_index - 2] == '\r') + { + istring_index--; + istring[istring_index - 1] = '\n'; + } +#endif +#endif + } + + if (istring) + istring[istring_index] = '\0'; + + /* If we read no output, just return now and save ourselves some + trouble. */ + if (istring_index == 0) + { + FREE (istring); + if (rflag) + *rflag = tflag; + return (char *)NULL; + } + + /* Strip trailing newlines from the output of the command. */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + { + while (istring_index > 0) + { + if (istring[istring_index - 1] == '\n') + { + --istring_index; + + /* If the newline was quoted, remove the quoting char. */ + if (istring[istring_index - 1] == CTLESC) + --istring_index; + } + else + break; + } + istring[istring_index] = '\0'; + } + else + strip_trailing (istring, istring_index - 1, 1); + + if (rflag) + *rflag = tflag; + return istring; +} + +/* Perform command substitution on STRING. This returns a WORD_DESC * with the + contained string possibly quoted. */ +WORD_DESC * +command_substitute (string, quoted) + char *string; + int quoted; +{ + pid_t pid, old_pid, old_pipeline_pgrp, old_async_pid; + char *istring; + int result, fildes[2], function_value, pflags, rc, tflag; + WORD_DESC *ret; + + istring = (char *)NULL; + + /* Don't fork () if there is no need to. In the case of no command to + run, just return NULL. */ + if (!string || !*string || (string[0] == '\n' && !string[1])) + return ((WORD_DESC *)NULL); + + if (wordexp_only && read_but_dont_execute) + { + last_command_exit_value = EX_WEXPCOMSUB; + jump_to_top_level (EXITPROG); + } + + /* We're making the assumption here that the command substitution will + eventually run a command from the file system. Since we'll run + maybe_make_export_env in this subshell before executing that command, + the parent shell and any other shells it starts will have to remake + the environment. If we make it before we fork, other shells won't + have to. Don't bother if we have any temporary variable assignments, + though, because the export environment will be remade after this + command completes anyway, but do it if all the words to be expanded + are variable assignments. */ + if (subst_assign_varlist == 0 || garglist == 0) + maybe_make_export_env (); /* XXX */ + + /* Flags to pass to parse_and_execute() */ + pflags = (interactive && sourcelevel == 0) ? SEVAL_RESETLINE : 0; + + /* Pipe the output of executing STRING into the current shell. */ + if (pipe (fildes) < 0) + { + sys_error (_("cannot make pipe for command substitution")); + goto error_exit; + } + + old_pid = last_made_pid; +#if defined (JOB_CONTROL) + old_pipeline_pgrp = pipeline_pgrp; + /* Don't reset the pipeline pgrp if we're already a subshell in a pipeline. */ + if ((subshell_environment & SUBSHELL_PIPE) == 0) + pipeline_pgrp = shell_pgrp; + cleanup_the_pipeline (); +#endif /* JOB_CONTROL */ + + old_async_pid = last_asynchronous_pid; + pid = make_child ((char *)NULL, subshell_environment&SUBSHELL_ASYNC); + last_asynchronous_pid = old_async_pid; + + if (pid == 0) + { + /* Reset the signal handlers in the child, but don't free the + trap strings. Set a flag noting that we have to free the + trap strings if we run trap to change a signal disposition. */ + reset_signal_handlers (); + subshell_environment |= SUBSHELL_RESETTRAP; + } + +#if defined (JOB_CONTROL) + /* XXX DO THIS ONLY IN PARENT ? XXX */ + set_sigchld_handler (); + stop_making_children (); + if (pid != 0) + pipeline_pgrp = old_pipeline_pgrp; +#else + stop_making_children (); +#endif /* JOB_CONTROL */ + + if (pid < 0) + { + sys_error (_("cannot make child for command substitution")); + error_exit: + + last_made_pid = old_pid; + + FREE (istring); + close (fildes[0]); + close (fildes[1]); + return ((WORD_DESC *)NULL); + } + + if (pid == 0) + { + set_sigint_handler (); /* XXX */ + + free_pushed_string_input (); + + if (dup2 (fildes[1], 1) < 0) + { + sys_error (_("command_substitute: cannot duplicate pipe as fd 1")); + exit (EXECUTION_FAILURE); + } + + /* If standard output is closed in the parent shell + (such as after `exec >&-'), file descriptor 1 will be + the lowest available file descriptor, and end up in + fildes[0]. This can happen for stdin and stderr as well, + but stdout is more important -- it will cause no output + to be generated from this command. */ + if ((fildes[1] != fileno (stdin)) && + (fildes[1] != fileno (stdout)) && + (fildes[1] != fileno (stderr))) + close (fildes[1]); + + if ((fildes[0] != fileno (stdin)) && + (fildes[0] != fileno (stdout)) && + (fildes[0] != fileno (stderr))) + close (fildes[0]); + +#ifdef __CYGWIN__ + /* Let stdio know the fd may have changed from text to binary mode, and + make sure to preserve stdout line buffering. */ + freopen (NULL, "w", stdout); + sh_setlinebuf (stdout); +#endif /* __CYGWIN__ */ + + /* The currently executing shell is not interactive. */ + interactive = 0; + + /* This is a subshell environment. */ + subshell_environment |= SUBSHELL_COMSUB; + + /* When not in POSIX mode, command substitution does not inherit + the -e flag. */ + if (posixly_correct == 0) + { + builtin_ignoring_errexit = 0; + change_flag ('e', FLAG_OFF); + set_shellopts (); + } + + remove_quoted_escapes (string); + + startup_state = 2; /* see if we can avoid a fork */ + /* Give command substitution a place to jump back to on failure, + so we don't go back up to main (). */ + result = setjmp_nosigs (top_level); + + /* If we're running a command substitution inside a shell function, + trap `return' so we don't return from the function in the subshell + and go off to never-never land. */ + if (result == 0 && return_catch_flag) + function_value = setjmp_nosigs (return_catch); + else + function_value = 0; + + if (result == ERREXIT) + rc = last_command_exit_value; + else if (result == EXITPROG) + rc = last_command_exit_value; + else if (result) + rc = EXECUTION_FAILURE; + else if (function_value) + rc = return_catch_value; + else + { + subshell_level++; + rc = parse_and_execute (string, "command substitution", pflags|SEVAL_NOHIST); + subshell_level--; + } + + last_command_exit_value = rc; + rc = run_exit_trap (); +#if defined (PROCESS_SUBSTITUTION) + unlink_fifo_list (); +#endif + exit (rc); + } + else + { +#if defined (JOB_CONTROL) && defined (PGRP_PIPE) + close_pgrp_pipe (); +#endif /* JOB_CONTROL && PGRP_PIPE */ + + close (fildes[1]); + + tflag = 0; + istring = read_comsub (fildes[0], quoted, &tflag); + + close (fildes[0]); + + current_command_subst_pid = pid; + last_command_exit_value = wait_for (pid); + last_command_subst_pid = pid; + last_made_pid = old_pid; + +#if defined (JOB_CONTROL) + /* If last_command_exit_value > 128, then the substituted command + was terminated by a signal. If that signal was SIGINT, then send + SIGINT to ourselves. This will break out of loops, for instance. */ + if (last_command_exit_value == (128 + SIGINT) && last_command_exit_signal == SIGINT) + kill (getpid (), SIGINT); + + /* wait_for gives the terminal back to shell_pgrp. If some other + process group should have it, give it away to that group here. + pipeline_pgrp is non-zero only while we are constructing a + pipeline, so what we are concerned about is whether or not that + pipeline was started in the background. A pipeline started in + the background should never get the tty back here. */ + if (interactive && pipeline_pgrp != (pid_t)0 && (subshell_environment & SUBSHELL_ASYNC) == 0) + give_terminal_to (pipeline_pgrp, 0); +#endif /* JOB_CONTROL */ + + ret = alloc_word_desc (); + ret->word = istring; + ret->flags = tflag; + + return ret; + } +} + +/******************************************************** + * * + * Utility functions for parameter expansion * + * * + ********************************************************/ + +#if defined (ARRAY_VARS) + +static arrayind_t +array_length_reference (s) + char *s; +{ + int len; + arrayind_t ind; + char *akey; + char *t, c; + ARRAY *array; + HASH_TABLE *h; + SHELL_VAR *var; + + var = array_variable_part (s, &t, &len); + + /* If unbound variables should generate an error, report one and return + failure. */ + if ((var == 0 || invisible_p (var) || (assoc_p (var) == 0 && array_p (var) == 0)) && unbound_vars_is_error) + { + c = *--t; + *t = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (s); + *t = c; + return (-1); + } + else if (var == 0 || invisible_p (var)) + return 0; + + /* We support a couple of expansions for variables that are not arrays. + We'll return the length of the value for v[0], and 1 for v[@] or + v[*]. Return 0 for everything else. */ + + array = array_p (var) ? array_cell (var) : (ARRAY *)NULL; + h = assoc_p (var) ? assoc_cell (var) : (HASH_TABLE *)NULL; + + if (ALL_ELEMENT_SUB (t[0]) && t[1] == ']') + { + if (assoc_p (var)) + return (h ? assoc_num_elements (h) : 0); + else if (array_p (var)) + return (array ? array_num_elements (array) : 0); + else + return (var_isset (var) ? 1 : 0); + } + + if (assoc_p (var)) + { + t[len - 1] = '\0'; + akey = expand_assignment_string_to_string (t, 0); /* [ */ + t[len - 1] = ']'; + if (akey == 0 || *akey == 0) + { + err_badarraysub (t); + FREE (akey); + return (-1); + } + t = assoc_reference (assoc_cell (var), akey); + free (akey); + } + else + { + ind = array_expand_index (var, t, len); + /* negative subscripts to indexed arrays count back from end */ + if (var && array_p (var) && ind < 0) + ind = array_max_index (array_cell (var)) + 1 + ind; + if (ind < 0) + { + err_badarraysub (t); + return (-1); + } + if (array_p (var)) + t = array_reference (array, ind); + else + t = (ind == 0) ? value_cell (var) : (char *)NULL; + } + + len = MB_STRLEN (t); + return (len); +} +#endif /* ARRAY_VARS */ + +static int +valid_brace_expansion_word (name, var_is_special) + char *name; + int var_is_special; +{ + if (DIGIT (*name) && all_digits (name)) + return 1; + else if (var_is_special) + return 1; +#if defined (ARRAY_VARS) + else if (valid_array_reference (name)) + return 1; +#endif /* ARRAY_VARS */ + else if (legal_identifier (name)) + return 1; + else + return 0; +} + +static int +chk_atstar (name, quoted, quoted_dollar_atp, contains_dollar_at) + char *name; + int quoted; + int *quoted_dollar_atp, *contains_dollar_at; +{ + char *temp1; + + if (name == 0) + { + if (quoted_dollar_atp) + *quoted_dollar_atp = 0; + if (contains_dollar_at) + *contains_dollar_at = 0; + return 0; + } + + /* check for $@ and $* */ + if (name[0] == '@' && name[1] == 0) + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } + else if (name[0] == '*' && name[1] == '\0' && quoted == 0) + { + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } + + /* Now check for ${array[@]} and ${array[*]} */ +#if defined (ARRAY_VARS) + else if (valid_array_reference (name)) + { + temp1 = mbschr (name, '['); + if (temp1 && temp1[1] == '@' && temp1[2] == ']') + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } /* [ */ + /* ${array[*]}, when unquoted, should be treated like ${array[@]}, + which should result in separate words even when IFS is unset. */ + if (temp1 && temp1[1] == '*' && temp1[2] == ']' && quoted == 0) + { + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } + } +#endif + return 0; +} + +/* Parameter expand NAME, and return a new string which is the expansion, + or NULL if there was no expansion. + VAR_IS_SPECIAL is non-zero if NAME is one of the special variables in + the shell, e.g., "@", "$", "*", etc. QUOTED, if non-zero, means that + NAME was found inside of a double-quoted expression. */ +static WORD_DESC * +parameter_brace_expand_word (name, var_is_special, quoted, pflags, indp) + char *name; + int var_is_special, quoted, pflags; + arrayind_t *indp; +{ + WORD_DESC *ret; + char *temp, *tt; + intmax_t arg_index; + SHELL_VAR *var; + int atype, rflags; + arrayind_t ind; + + ret = 0; + temp = 0; + rflags = 0; + + if (indp) + *indp = INTMAX_MIN; + + /* Handle multiple digit arguments, as in ${11}. */ + if (legal_number (name, &arg_index)) + { + tt = get_dollar_var_value (arg_index); + if (tt) + temp = (*tt && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + ? quote_string (tt) + : quote_escapes (tt); + else + temp = (char *)NULL; + FREE (tt); + } + else if (var_is_special) /* ${@} */ + { + int sindex; + tt = (char *)xmalloc (2 + strlen (name)); + tt[sindex = 0] = '$'; + strcpy (tt + 1, name); + + ret = param_expand (tt, &sindex, quoted, (int *)NULL, (int *)NULL, + (int *)NULL, (int *)NULL, pflags); + free (tt); + } +#if defined (ARRAY_VARS) + else if (valid_array_reference (name)) + { +expand_arrayref: + /* XXX - does this leak if name[@] or name[*]? */ + if (pflags & PF_ASSIGNRHS) + { + temp = array_variable_name (name, &tt, (int *)0); + if (ALL_ELEMENT_SUB (tt[0]) && tt[1] == ']') + temp = array_value (name, quoted|Q_DOUBLE_QUOTES, 0, &atype, &ind); + else + temp = array_value (name, quoted, 0, &atype, &ind); + } + else + temp = array_value (name, quoted, 0, &atype, &ind); + if (atype == 0 && temp) + { + temp = (*temp && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + ? quote_string (temp) + : quote_escapes (temp); + rflags |= W_ARRAYIND; + if (indp) + *indp = ind; + } + else if (atype == 1 && temp && QUOTED_NULL (temp) && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + rflags |= W_HASQUOTEDNULL; + } +#endif + else if (var = find_variable (name)) + { + if (var_isset (var) && invisible_p (var) == 0) + { +#if defined (ARRAY_VARS) + if (assoc_p (var)) + temp = assoc_reference (assoc_cell (var), "0"); + else if (array_p (var)) + temp = array_reference (array_cell (var), 0); + else + temp = value_cell (var); +#else + temp = value_cell (var); +#endif + + if (temp) + temp = (*temp && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + ? quote_string (temp) + : quote_escapes (temp); + } + else + temp = (char *)NULL; + } + else if (var = find_variable_last_nameref (name)) + { + temp = nameref_cell (var); +#if defined (ARRAY_VARS) + /* Handle expanding nameref whose value is x[n] */ + if (temp && *temp && valid_array_reference (temp)) + { + name = temp; + goto expand_arrayref; + } + else +#endif + /* y=2 ; typeset -n x=y; echo ${x} is not the same as echo ${2} in ksh */ + if (temp && *temp && legal_identifier (temp) == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("%s: invalid variable name for name reference"), temp); + temp = &expand_param_error; + } + else + temp = (char *)NULL; + } + else + temp = (char *)NULL; + + if (ret == 0) + { + ret = alloc_word_desc (); + ret->word = temp; + ret->flags |= rflags; + } + return ret; +} + +static char * +parameter_brace_find_indir (name, var_is_special, quoted, find_nameref) + char *name; + int var_is_special, quoted, find_nameref; +{ + char *temp, *t; + WORD_DESC *w; + SHELL_VAR *v; + + if (find_nameref && var_is_special == 0 && (v = find_variable_last_nameref (name)) && + nameref_p (v) && (t = nameref_cell (v)) && *t) + return (savestring (t)); + + /* If var_is_special == 0, and name is not an array reference, this does + more expansion than necessary. It should really look up the variable's + value and not try to expand it. */ + w = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND, 0); + t = w->word; + /* Have to dequote here if necessary */ + if (t) + { + temp = (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + ? dequote_string (t) + : dequote_escapes (t); + free (t); + t = temp; + } + dispose_word_desc (w); + + return t; +} + +/* Expand an indirect reference to a variable: ${!NAME} expands to the + value of the variable whose name is the value of NAME. */ +static WORD_DESC * +parameter_brace_expand_indir (name, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at) + char *name; + int var_is_special, quoted; + int *quoted_dollar_atp, *contains_dollar_at; +{ + char *temp, *t; + WORD_DESC *w; + SHELL_VAR *v; + + /* See if it's a nameref first, behave in ksh93-compatible fashion. + There is at least one incompatibility: given ${!foo[0]} where foo=bar, + bash performs an indirect lookup on foo[0] and expands the result; + ksh93 expands bar[0]. We could do that here -- there are enough usable + primitives to do that -- but do not at this point. */ + if (var_is_special == 0 && (v = find_variable_last_nameref (name))) + { + if (nameref_p (v) && (t = nameref_cell (v)) && *t) + { + w = alloc_word_desc (); + w->word = savestring (t); + w->flags = 0; + return w; + } + } + + t = parameter_brace_find_indir (name, var_is_special, quoted, 0); + + chk_atstar (t, quoted, quoted_dollar_atp, contains_dollar_at); + if (t == 0) + return (WORD_DESC *)NULL; + + w = parameter_brace_expand_word (t, SPECIAL_VAR(t, 0), quoted, 0, 0); + free (t); + + return w; +} + +/* Expand the right side of a parameter expansion of the form ${NAMEcVALUE}, + depending on the value of C, the separating character. C can be one of + "-", "+", or "=". QUOTED is true if the entire brace expression occurs + between double quotes. */ +static WORD_DESC * +parameter_brace_expand_rhs (name, value, c, quoted, qdollaratp, hasdollarat) + char *name, *value; + int c, quoted, *qdollaratp, *hasdollarat; +{ + WORD_DESC *w; + WORD_LIST *l; + char *t, *t1, *temp; + int hasdol; + + /* If the entire expression is between double quotes, we want to treat + the value as a double-quoted string, with the exception that we strip + embedded unescaped double quotes (for sh backwards compatibility). */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && *value) + { + hasdol = 0; + temp = string_extract_double_quoted (value, &hasdol, 1); + } + else + temp = value; + + w = alloc_word_desc (); + hasdol = 0; + /* XXX was 0 not quoted */ + l = *temp ? expand_string_for_rhs (temp, quoted, &hasdol, (int *)NULL) + : (WORD_LIST *)0; + if (hasdollarat) + *hasdollarat = hasdol || (l && l->next); + if (temp != value) + free (temp); + if (l) + { + /* The expansion of TEMP returned something. We need to treat things + slightly differently if HASDOL is non-zero. If we have "$@", the + individual words have already been quoted. We need to turn them + into a string with the words separated by the first character of + $IFS without any additional quoting, so string_list_dollar_at won't + do the right thing. We use string_list_dollar_star instead. */ + temp = (hasdol || l->next) ? string_list_dollar_star (l) : string_list (l); + + /* If l->next is not null, we know that TEMP contained "$@", since that + is the only expansion that creates more than one word. */ + if (qdollaratp && ((hasdol && quoted) || l->next)) + *qdollaratp = 1; + /* If we have a quoted null result (QUOTED_NULL(temp)) and the word is + a quoted null (l->next == 0 && QUOTED_NULL(l->word->word)), the + flags indicate it (l->word->flags & W_HASQUOTEDNULL), and the + expansion is quoted (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + (which is more paranoia than anything else), we need to return the + quoted null string and set the flags to indicate it. */ + if (l->next == 0 && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && QUOTED_NULL (temp) && QUOTED_NULL (l->word->word) && (l->word->flags & W_HASQUOTEDNULL)) + { + w->flags |= W_HASQUOTEDNULL; + } + dispose_words (l); + } + else if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && hasdol) + { + /* The brace expansion occurred between double quotes and there was + a $@ in TEMP. It does not matter if the $@ is quoted, as long as + it does not expand to anything. In this case, we want to return + a quoted empty string. */ + temp = make_quoted_char ('\0'); + w->flags |= W_HASQUOTEDNULL; + } + else + temp = (char *)NULL; + + if (c == '-' || c == '+') + { + w->word = temp; + return w; + } + + /* c == '=' */ + t = temp ? savestring (temp) : savestring (""); + t1 = dequote_string (t); + free (t); +#if defined (ARRAY_VARS) + if (valid_array_reference (name)) + assign_array_element (name, t1, 0); + else +#endif /* ARRAY_VARS */ + bind_variable (name, t1, 0); +#if 0 + if (STREQ (name, "IFS") == 0) +#endif + stupidly_hack_special_variables (name); + + /* From Posix group discussion Feb-March 2010. Issue 7 0000221 */ + free (temp); + + w->word = t1; + return w; +} + +/* Deal with the right hand side of a ${name:?value} expansion in the case + that NAME is null or not set. If VALUE is non-null it is expanded and + used as the error message to print, otherwise a standard message is + printed. */ +static void +parameter_brace_expand_error (name, value) + char *name, *value; +{ + WORD_LIST *l; + char *temp; + + last_command_exit_value = EXECUTION_FAILURE; /* ensure it's non-zero */ + if (value && *value) + { + l = expand_string (value, 0); + temp = string_list (l); + report_error ("%s: %s", name, temp ? temp : ""); /* XXX was value not "" */ + FREE (temp); + dispose_words (l); + } + else + report_error (_("%s: parameter null or not set"), name); + + /* Free the data we have allocated during this expansion, since we + are about to longjmp out. */ + free (name); + FREE (value); +} + +/* Return 1 if NAME is something for which parameter_brace_expand_length is + OK to do. */ +static int +valid_length_expression (name) + char *name; +{ + return (name[1] == '\0' || /* ${#} */ + ((sh_syntaxtab[(unsigned char) name[1]] & CSPECVAR) && name[2] == '\0') || /* special param */ + (DIGIT (name[1]) && all_digits (name + 1)) || /* ${#11} */ +#if defined (ARRAY_VARS) + valid_array_reference (name + 1) || /* ${#a[7]} */ +#endif + legal_identifier (name + 1)); /* ${#PS1} */ +} + +/* Handle the parameter brace expansion that requires us to return the + length of a parameter. */ +static intmax_t +parameter_brace_expand_length (name) + char *name; +{ + char *t, *newname; + intmax_t number, arg_index; + WORD_LIST *list; +#if defined (ARRAY_VARS) + SHELL_VAR *var; +#endif + + if (name[1] == '\0') /* ${#} */ + number = number_of_args (); + else if ((name[1] == '@' || name[1] == '*') && name[2] == '\0') /* ${#@}, ${#*} */ + number = number_of_args (); + else if ((sh_syntaxtab[(unsigned char) name[1]] & CSPECVAR) && name[2] == '\0') + { + /* Take the lengths of some of the shell's special parameters. */ + switch (name[1]) + { + case '-': + t = which_set_flags (); + break; + case '?': + t = itos (last_command_exit_value); + break; + case '$': + t = itos (dollar_dollar_pid); + break; + case '!': + if (last_asynchronous_pid == NO_PID) + t = (char *)NULL; /* XXX - error if set -u set? */ + else + t = itos (last_asynchronous_pid); + break; + case '#': + t = itos (number_of_args ()); + break; + } + number = STRLEN (t); + FREE (t); + } +#if defined (ARRAY_VARS) + else if (valid_array_reference (name + 1)) + number = array_length_reference (name + 1); +#endif /* ARRAY_VARS */ + else + { + number = 0; + + if (legal_number (name + 1, &arg_index)) /* ${#1} */ + { + t = get_dollar_var_value (arg_index); + if (t == 0 && unbound_vars_is_error) + return INTMAX_MIN; + number = MB_STRLEN (t); + FREE (t); + } +#if defined (ARRAY_VARS) + else if ((var = find_variable (name + 1)) && (invisible_p (var) == 0) && (array_p (var) || assoc_p (var))) + { + if (assoc_p (var)) + t = assoc_reference (assoc_cell (var), "0"); + else + t = array_reference (array_cell (var), 0); + if (t == 0 && unbound_vars_is_error) + return INTMAX_MIN; + number = MB_STRLEN (t); + } +#endif + else /* ${#PS1} */ + { + newname = savestring (name); + newname[0] = '$'; + list = expand_string (newname, Q_DOUBLE_QUOTES); + t = list ? string_list (list) : (char *)NULL; + free (newname); + if (list) + dispose_words (list); + + number = t ? MB_STRLEN (t) : 0; + FREE (t); + } + } + + return (number); +} + +/* Skip characters in SUBSTR until DELIM. SUBSTR is an arithmetic expression, + so we do some ad-hoc parsing of an arithmetic expression to find + the first DELIM, instead of using strchr(3). Two rules: + 1. If the substring contains a `(', read until closing `)'. + 2. If the substring contains a `?', read past one `:' for each `?'. +*/ + +static char * +skiparith (substr, delim) + char *substr; + int delim; +{ + size_t sublen; + int skipcol, pcount, i; + DECLARE_MBSTATE; + + sublen = strlen (substr); + i = skipcol = pcount = 0; + while (substr[i]) + { + /* Balance parens */ + if (substr[i] == LPAREN) + { + pcount++; + i++; + continue; + } + if (substr[i] == RPAREN && pcount) + { + pcount--; + i++; + continue; + } + if (pcount) + { + ADVANCE_CHAR (substr, sublen, i); + continue; + } + + /* Skip one `:' for each `?' */ + if (substr[i] == ':' && skipcol) + { + skipcol--; + i++; + continue; + } + if (substr[i] == delim) + break; + if (substr[i] == '?') + { + skipcol++; + i++; + continue; + } + ADVANCE_CHAR (substr, sublen, i); + } + + return (substr + i); +} + +/* Verify and limit the start and end of the desired substring. If + VTYPE == 0, a regular shell variable is being used; if it is 1, + then the positional parameters are being used; if it is 2, then + VALUE is really a pointer to an array variable that should be used. + Return value is 1 if both values were OK, 0 if there was a problem + with an invalid expression, or -1 if the values were out of range. */ +static int +verify_substring_values (v, value, substr, vtype, e1p, e2p) + SHELL_VAR *v; + char *value, *substr; + int vtype; + intmax_t *e1p, *e2p; +{ + char *t, *temp1, *temp2; + arrayind_t len; + int expok; +#if defined (ARRAY_VARS) + ARRAY *a; + HASH_TABLE *h; +#endif + + /* duplicate behavior of strchr(3) */ + t = skiparith (substr, ':'); + if (*t && *t == ':') + *t = '\0'; + else + t = (char *)0; + + temp1 = expand_arith_string (substr, Q_DOUBLE_QUOTES); + *e1p = evalexp (temp1, &expok); + free (temp1); + if (expok == 0) + return (0); + + len = -1; /* paranoia */ + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + len = MB_STRLEN (value); + break; + case VT_POSPARMS: + len = number_of_args () + 1; + if (*e1p == 0) + len++; /* add one arg if counting from $0 */ + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + /* For arrays, the first value deals with array indices. Negative + offsets count from one past the array's maximum index. Associative + arrays treat the number of elements as the maximum index. */ + if (assoc_p (v)) + { + h = assoc_cell (v); + len = assoc_num_elements (h) + (*e1p < 0); + } + else + { + a = (ARRAY *)value; + len = array_max_index (a) + (*e1p < 0); /* arrays index from 0 to n - 1 */ + } + break; +#endif + } + + if (len == -1) /* paranoia */ + return -1; + + if (*e1p < 0) /* negative offsets count from end */ + *e1p += len; + + if (*e1p > len || *e1p < 0) + return (-1); + +#if defined (ARRAY_VARS) + /* For arrays, the second offset deals with the number of elements. */ + if (vtype == VT_ARRAYVAR) + len = assoc_p (v) ? assoc_num_elements (h) : array_num_elements (a); +#endif + + if (t) + { + t++; + temp2 = savestring (t); + temp1 = expand_arith_string (temp2, Q_DOUBLE_QUOTES); + free (temp2); + t[-1] = ':'; + *e2p = evalexp (temp1, &expok); + free (temp1); + if (expok == 0) + return (0); +#if 1 + if ((vtype == VT_ARRAYVAR || vtype == VT_POSPARMS) && *e2p < 0) +#else + /* bash-4.3: allow positional parameter length < 0 to count backwards + from end of positional parameters */ + if (vtype == VT_ARRAYVAR && *e2p < 0) +#endif + { + internal_error (_("%s: substring expression < 0"), t); + return (0); + } +#if defined (ARRAY_VARS) + /* In order to deal with sparse arrays, push the intelligence about how + to deal with the number of elements desired down to the array- + specific functions. */ + if (vtype != VT_ARRAYVAR) +#endif + { + if (*e2p < 0) + { + *e2p += len; + if (*e2p < 0 || *e2p < *e1p) + { + internal_error (_("%s: substring expression < 0"), t); + return (0); + } + } + else + *e2p += *e1p; /* want E2 chars starting at E1 */ + if (*e2p > len) + *e2p = len; + } + } + else + *e2p = len; + + return (1); +} + +/* Return the type of variable specified by VARNAME (simple variable, + positional param, or array variable). Also return the value specified + by VARNAME (value of a variable or a reference to an array element). + QUOTED is the standard description of quoting state, using Q_* defines. + FLAGS is currently a set of flags to pass to array_value. If IND is + non-null and not INTMAX_MIN, and FLAGS includes AV_USEIND, IND is + passed to array_value so the array index is not computed again. + If this returns VT_VARIABLE, the caller assumes that CTLESC and CTLNUL + characters in the value are quoted with CTLESC and takes appropriate + steps. For convenience, *VALP is set to the dequoted VALUE. */ +static int +get_var_and_type (varname, value, ind, quoted, flags, varp, valp) + char *varname, *value; + arrayind_t ind; + int quoted, flags; + SHELL_VAR **varp; + char **valp; +{ + int vtype, want_indir; + char *temp, *vname; + WORD_DESC *wd; +#if defined (ARRAY_VARS) + SHELL_VAR *v; +#endif + arrayind_t lind; + + want_indir = *varname == '!' && + (legal_variable_starter ((unsigned char)varname[1]) || DIGIT (varname[1]) + || VALID_INDIR_PARAM (varname[1])); + if (want_indir) + vname = parameter_brace_find_indir (varname+1, SPECIAL_VAR (varname, 1), quoted, 1); + else + vname = varname; + + /* This sets vtype to VT_VARIABLE or VT_POSPARMS */ + vtype = (vname[0] == '@' || vname[0] == '*') && vname[1] == '\0'; + if (vtype == VT_POSPARMS && vname[0] == '*') + vtype |= VT_STARSUB; + *varp = (SHELL_VAR *)NULL; + +#if defined (ARRAY_VARS) + if (valid_array_reference (vname)) + { + v = array_variable_part (vname, &temp, (int *)0); + /* If we want to signal array_value to use an already-computed index, + set LIND to that index */ + lind = (ind != INTMAX_MIN && (flags & AV_USEIND)) ? ind : 0; + if (v && invisible_p (v)) + { + vtype = VT_ARRAYMEMBER; + *varp = (SHELL_VAR *)NULL; + *valp = (char *)NULL; + } + if (v && (array_p (v) || assoc_p (v))) + { /* [ */ + if (ALL_ELEMENT_SUB (temp[0]) && temp[1] == ']') + { + /* Callers have to differentiate between indexed and associative */ + vtype = VT_ARRAYVAR; + if (temp[0] == '*') + vtype |= VT_STARSUB; + *valp = array_p (v) ? (char *)array_cell (v) : (char *)assoc_cell (v); + } + else + { + vtype = VT_ARRAYMEMBER; + *valp = array_value (vname, Q_DOUBLE_QUOTES, flags, (int *)NULL, &lind); + } + *varp = v; + } + else if (v && (ALL_ELEMENT_SUB (temp[0]) && temp[1] == ']')) + { + vtype = VT_VARIABLE; + *varp = v; + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + *valp = dequote_string (value); + else + *valp = dequote_escapes (value); + } + else + { + vtype = VT_ARRAYMEMBER; + *varp = v; + *valp = array_value (vname, Q_DOUBLE_QUOTES, flags, (int *)NULL, &lind); + } + } + else if ((v = find_variable (vname)) && (invisible_p (v) == 0) && (assoc_p (v) || array_p (v))) + { + vtype = VT_ARRAYMEMBER; + *varp = v; + *valp = assoc_p (v) ? assoc_reference (assoc_cell (v), "0") : array_reference (array_cell (v), 0); + } + else +#endif + { + if (value && vtype == VT_VARIABLE) + { + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + *valp = dequote_string (value); + else + *valp = dequote_escapes (value); + } + else + *valp = value; + } + + if (want_indir) + free (vname); + + return vtype; +} + +/******************************************************/ +/* */ +/* Functions to extract substrings of variable values */ +/* */ +/******************************************************/ + +#if defined (HANDLE_MULTIBYTE) +/* Character-oriented rather than strictly byte-oriented substrings. S and + E, rather being strict indices into STRING, indicate character (possibly + multibyte character) positions that require calculation. + Used by the ${param:offset[:length]} expansion. */ +static char * +mb_substring (string, s, e) + char *string; + int s, e; +{ + char *tt; + int start, stop, i, slen; + DECLARE_MBSTATE; + + start = 0; + /* Don't need string length in ADVANCE_CHAR unless multibyte chars possible. */ + slen = (MB_CUR_MAX > 1) ? STRLEN (string) : 0; + + i = s; + while (string[start] && i--) + ADVANCE_CHAR (string, slen, start); + stop = start; + i = e - s; + while (string[stop] && i--) + ADVANCE_CHAR (string, slen, stop); + tt = substring (string, start, stop); + return tt; +} +#endif + +/* Process a variable substring expansion: ${name:e1[:e2]}. If VARNAME + is `@', use the positional parameters; otherwise, use the value of + VARNAME. If VARNAME is an array variable, use the array elements. */ + +static char * +parameter_brace_substring (varname, value, ind, substr, quoted, flags) + char *varname, *value; + int ind; + char *substr; + int quoted, flags; +{ + intmax_t e1, e2; + int vtype, r, starsub; + char *temp, *val, *tt, *oname; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + oname = this_command_name; + this_command_name = varname; + + vtype = get_var_and_type (varname, value, ind, quoted, flags, &v, &val); + if (vtype == -1) + { + this_command_name = oname; + return ((char *)NULL); + } + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + r = verify_substring_values (v, val, substr, vtype, &e1, &e2); + this_command_name = oname; + if (r <= 0) + { + if (vtype == VT_VARIABLE) + FREE (val); + return ((r == 0) ? &expand_param_error : (char *)NULL); + } + + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1) + tt = mb_substring (val, e1, e2); + else +#endif + tt = substring (val, e1, e2); + + if (vtype == VT_VARIABLE) + FREE (val); + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + temp = quote_string (tt); + else + temp = tt ? quote_escapes (tt) : (char *)NULL; + FREE (tt); + break; + case VT_POSPARMS: + tt = pos_params (varname, e1, e2, quoted); + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) == 0) + { + temp = tt ? quote_escapes (tt) : (char *)NULL; + FREE (tt); + } + else + temp = tt; + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + if (assoc_p (v)) + /* we convert to list and take first e2 elements starting at e1th + element -- officially undefined for now */ + temp = assoc_subrange (assoc_cell (v), e1, e2, starsub, quoted); + else + /* We want E2 to be the number of elements desired (arrays can be sparse, + so verify_substring_values just returns the numbers specified and we + rely on array_subrange to understand how to deal with them). */ + temp = array_subrange (array_cell (v), e1, e2, starsub, quoted); + /* array_subrange now calls array_quote_escapes as appropriate, so the + caller no longer needs to. */ + break; +#endif + default: + temp = (char *)NULL; + } + + return temp; +} + +/****************************************************************/ +/* */ +/* Functions to perform pattern substitution on variable values */ +/* */ +/****************************************************************/ + +static int +shouldexp_replacement (s) + char *s; +{ + register char *p; + + for (p = s; p && *p; p++) + { + if (*p == '\\') + p++; + else if (*p == '&') + return 1; + } + return 0; +} + +char * +pat_subst (string, pat, rep, mflags) + char *string, *pat, *rep; + int mflags; +{ + char *ret, *s, *e, *str, *rstr, *mstr; + int rsize, rptr, l, replen, mtype, rxpand, rslen, mlen; + + if (string == 0) + return (savestring ("")); + + mtype = mflags & MATCH_TYPEMASK; + +#if 0 /* bash-4.2 ? */ + rxpand = (rep && *rep) ? shouldexp_replacement (rep) : 0; +#else + rxpand = 0; +#endif + + /* Special cases: + * 1. A null pattern with mtype == MATCH_BEG means to prefix STRING + * with REP and return the result. + * 2. A null pattern with mtype == MATCH_END means to append REP to + * STRING and return the result. + * These don't understand or process `&' in the replacement string. + */ + if ((pat == 0 || *pat == 0) && (mtype == MATCH_BEG || mtype == MATCH_END)) + { + replen = STRLEN (rep); + l = STRLEN (string); + ret = (char *)xmalloc (replen + l + 2); + if (replen == 0) + strcpy (ret, string); + else if (mtype == MATCH_BEG) + { + strcpy (ret, rep); + strcpy (ret + replen, string); + } + else + { + strcpy (ret, string); + strcpy (ret + l, rep); + } + return (ret); + } + + ret = (char *)xmalloc (rsize = 64); + ret[0] = '\0'; + + for (replen = STRLEN (rep), rptr = 0, str = string;;) + { + if (match_pattern (str, pat, mtype, &s, &e) == 0) + break; + l = s - str; + + if (rxpand) + { + int x; + mlen = e - s; + mstr = xmalloc (mlen + 1); + for (x = 0; x < mlen; x++) + mstr[x] = s[x]; + mstr[mlen] = '\0'; + rstr = strcreplace (rep, '&', mstr, 0); + rslen = strlen (rstr); + } + else + { + rstr = rep; + rslen = replen; + } + + RESIZE_MALLOCED_BUFFER (ret, rptr, (l + rslen), rsize, 64); + + /* OK, now copy the leading unmatched portion of the string (from + str to s) to ret starting at rptr (the current offset). Then copy + the replacement string at ret + rptr + (s - str). Increment + rptr (if necessary) and str and go on. */ + if (l) + { + strncpy (ret + rptr, str, l); + rptr += l; + } + if (replen) + { + strncpy (ret + rptr, rstr, rslen); + rptr += rslen; + } + str = e; /* e == end of match */ + + if (rstr != rep) + free (rstr); + + if (((mflags & MATCH_GLOBREP) == 0) || mtype != MATCH_ANY) + break; + + if (s == e) + { + /* On a zero-length match, make sure we copy one character, since + we increment one character to avoid infinite recursion. */ + RESIZE_MALLOCED_BUFFER (ret, rptr, 1, rsize, 64); + ret[rptr++] = *str++; + e++; /* avoid infinite recursion on zero-length match */ + } + } + + /* Now copy the unmatched portion of the input string */ + if (str && *str) + { + RESIZE_MALLOCED_BUFFER (ret, rptr, STRLEN(str) + 1, rsize, 64); + strcpy (ret + rptr, str); + } + else + ret[rptr] = '\0'; + + return ret; +} + +/* Do pattern match and replacement on the positional parameters. */ +static char * +pos_params_pat_subst (string, pat, rep, mflags) + char *string, *pat, *rep; + int mflags; +{ + WORD_LIST *save, *params; + WORD_DESC *w; + char *ret; + int pchar, qflags; + + save = params = list_rest_of_args (); + if (save == 0) + return ((char *)NULL); + + for ( ; params; params = params->next) + { + ret = pat_subst (params->word->word, pat, rep, mflags); + w = alloc_word_desc (); + w->word = ret ? ret : savestring (""); + dispose_word (params->word); + params->word = w; + } + + pchar = (mflags & MATCH_STARSUB) == MATCH_STARSUB ? '*' : '@'; + qflags = (mflags & MATCH_QUOTED) == MATCH_QUOTED ? Q_DOUBLE_QUOTES : 0; + + ret = string_list_pos_params (pchar, save, qflags); + + dispose_words (save); + + return (ret); +} + +/* Perform pattern substitution on VALUE, which is the expansion of + VARNAME. PATSUB is an expression supplying the pattern to match + and the string to substitute. QUOTED is a flags word containing + the type of quoting currently in effect. */ +static char * +parameter_brace_patsub (varname, value, ind, patsub, quoted, flags) + char *varname, *value; + int ind; + char *patsub; + int quoted, flags; +{ + int vtype, mflags, starsub, delim; + char *val, *temp, *pat, *rep, *p, *lpatsub, *tt; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + this_command_name = varname; + + vtype = get_var_and_type (varname, value, ind, quoted, flags, &v, &val); + if (vtype == -1) + return ((char *)NULL); + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + mflags = 0; + /* PATSUB is never NULL when this is called. */ + if (*patsub == '/') + { + mflags |= MATCH_GLOBREP; + patsub++; + } + + /* Malloc this because expand_string_if_necessary or one of the expansion + functions in its call chain may free it on a substitution error. */ + lpatsub = savestring (patsub); + + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + mflags |= MATCH_QUOTED; + + if (starsub) + mflags |= MATCH_STARSUB; + + /* If the pattern starts with a `/', make sure we skip over it when looking + for the replacement delimiter. */ + delim = skip_to_delim (lpatsub, ((*patsub == '/') ? 1 : 0), "/", 0); + if (lpatsub[delim] == '/') + { + lpatsub[delim] = 0; + rep = lpatsub + delim + 1; + } + else + rep = (char *)NULL; + + if (rep && *rep == '\0') + rep = (char *)NULL; + + /* Perform the same expansions on the pattern as performed by the + pattern removal expansions. */ + pat = getpattern (lpatsub, quoted, 1); + + if (rep) + { + /* We want to perform quote removal on the expanded replacement even if + the entire expansion is double-quoted because the parser and string + extraction functions treated quotes in the replacement string as + special. THIS IS NOT BACKWARDS COMPATIBLE WITH BASH-4.2. */ + if (shell_compatibility_level > 42) + rep = expand_string_if_necessary (rep, quoted & ~(Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT), expand_string_unsplit); + /* This is the bash-4.2 code. */ + else if ((mflags & MATCH_QUOTED) == 0) + rep = expand_string_if_necessary (rep, quoted, expand_string_unsplit); + else + rep = expand_string_to_string_internal (rep, quoted, expand_string_unsplit); + } + + /* ksh93 doesn't allow the match specifier to be a part of the expanded + pattern. This is an extension. Make sure we don't anchor the pattern + at the beginning or end of the string if we're doing global replacement, + though. */ + p = pat; + if (mflags & MATCH_GLOBREP) + mflags |= MATCH_ANY; + else if (pat && pat[0] == '#') + { + mflags |= MATCH_BEG; + p++; + } + else if (pat && pat[0] == '%') + { + mflags |= MATCH_END; + p++; + } + else + mflags |= MATCH_ANY; + + /* OK, we now want to substitute REP for PAT in VAL. If + flags & MATCH_GLOBREP is non-zero, the substitution is done + everywhere, otherwise only the first occurrence of PAT is + replaced. The pattern matching code doesn't understand + CTLESC quoting CTLESC and CTLNUL so we use the dequoted variable + values passed in (VT_VARIABLE) so the pattern substitution + code works right. We need to requote special chars after + we're done for VT_VARIABLE and VT_ARRAYMEMBER, and for the + other cases if QUOTED == 0, since the posparams and arrays + indexed by * or @ do special things when QUOTED != 0. */ + + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + temp = pat_subst (val, p, rep, mflags); + if (vtype == VT_VARIABLE) + FREE (val); + if (temp) + { + tt = (mflags & MATCH_QUOTED) ? quote_string (temp) : quote_escapes (temp); + free (temp); + temp = tt; + } + break; + case VT_POSPARMS: + temp = pos_params_pat_subst (val, p, rep, mflags); + if (temp && (mflags & MATCH_QUOTED) == 0) + { + tt = quote_escapes (temp); + free (temp); + temp = tt; + } + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + temp = assoc_p (v) ? assoc_patsub (assoc_cell (v), p, rep, mflags) + : array_patsub (array_cell (v), p, rep, mflags); + /* Don't call quote_escapes anymore; array_patsub calls + array_quote_escapes as appropriate before adding the + space separators; ditto for assoc_patsub. */ + break; +#endif + } + + FREE (pat); + FREE (rep); + free (lpatsub); + + return temp; +} + +/****************************************************************/ +/* */ +/* Functions to perform case modification on variable values */ +/* */ +/****************************************************************/ + +/* Do case modification on the positional parameters. */ + +static char * +pos_params_modcase (string, pat, modop, mflags) + char *string, *pat; + int modop; + int mflags; +{ + WORD_LIST *save, *params; + WORD_DESC *w; + char *ret; + int pchar, qflags; + + save = params = list_rest_of_args (); + if (save == 0) + return ((char *)NULL); + + for ( ; params; params = params->next) + { + ret = sh_modcase (params->word->word, pat, modop); + w = alloc_word_desc (); + w->word = ret ? ret : savestring (""); + dispose_word (params->word); + params->word = w; + } + + pchar = (mflags & MATCH_STARSUB) == MATCH_STARSUB ? '*' : '@'; + qflags = (mflags & MATCH_QUOTED) == MATCH_QUOTED ? Q_DOUBLE_QUOTES : 0; + + ret = string_list_pos_params (pchar, save, qflags); + dispose_words (save); + + return (ret); +} + +/* Perform case modification on VALUE, which is the expansion of + VARNAME. MODSPEC is an expression supplying the type of modification + to perform. QUOTED is a flags word containing the type of quoting + currently in effect. */ +static char * +parameter_brace_casemod (varname, value, ind, modspec, patspec, quoted, flags) + char *varname, *value; + int ind, modspec; + char *patspec; + int quoted, flags; +{ + int vtype, starsub, modop, mflags, x; + char *val, *temp, *pat, *p, *lpat, *tt; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + this_command_name = varname; + + vtype = get_var_and_type (varname, value, ind, quoted, flags, &v, &val); + if (vtype == -1) + return ((char *)NULL); + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + modop = 0; + mflags = 0; + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + mflags |= MATCH_QUOTED; + if (starsub) + mflags |= MATCH_STARSUB; + + p = patspec; + if (modspec == '^') + { + x = p && p[0] == modspec; + modop = x ? CASE_UPPER : CASE_UPFIRST; + p += x; + } + else if (modspec == ',') + { + x = p && p[0] == modspec; + modop = x ? CASE_LOWER : CASE_LOWFIRST; + p += x; + } + else if (modspec == '~') + { + x = p && p[0] == modspec; + modop = x ? CASE_TOGGLEALL : CASE_TOGGLE; + p += x; + } + + lpat = p ? savestring (p) : 0; + /* Perform the same expansions on the pattern as performed by the + pattern removal expansions. FOR LATER */ + pat = lpat ? getpattern (lpat, quoted, 1) : 0; + + /* OK, now we do the case modification. */ + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + temp = sh_modcase (val, pat, modop); + if (vtype == VT_VARIABLE) + FREE (val); + if (temp) + { + tt = (mflags & MATCH_QUOTED) ? quote_string (temp) : quote_escapes (temp); + free (temp); + temp = tt; + } + break; + + case VT_POSPARMS: + temp = pos_params_modcase (val, pat, modop, mflags); + if (temp && (mflags & MATCH_QUOTED) == 0) + { + tt = quote_escapes (temp); + free (temp); + temp = tt; + } + break; + +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + temp = assoc_p (v) ? assoc_modcase (assoc_cell (v), pat, modop, mflags) + : array_modcase (array_cell (v), pat, modop, mflags); + /* Don't call quote_escapes; array_modcase calls array_quote_escapes + as appropriate before adding the space separators; ditto for + assoc_modcase. */ + break; +#endif + } + + FREE (pat); + free (lpat); + + return temp; +} + +/* Check for unbalanced parens in S, which is the contents of $(( ... )). If + any occur, this must be a nested command substitution, so return 0. + Otherwise, return 1. A valid arithmetic expression must always have a + ( before a matching ), so any cases where there are more right parens + means that this must not be an arithmetic expression, though the parser + will not accept it without a balanced total number of parens. */ +static int +chk_arithsub (s, len) + const char *s; + int len; +{ + int i, count; + DECLARE_MBSTATE; + + i = count = 0; + while (i < len) + { + if (s[i] == LPAREN) + count++; + else if (s[i] == RPAREN) + { + count--; + if (count < 0) + return 0; + } + + switch (s[i]) + { + default: + ADVANCE_CHAR (s, len, i); + break; + + case '\\': + i++; + if (s[i]) + ADVANCE_CHAR (s, len, i); + break; + + case '\'': + i = skip_single_quoted (s, len, ++i); + break; + + case '"': + i = skip_double_quoted ((char *)s, len, ++i); + break; + } + } + + return (count == 0); +} + +/****************************************************************/ +/* */ +/* Functions to perform parameter expansion on a string */ +/* */ +/****************************************************************/ + +/* ${[#][!]name[[:][^[^]][,[,]]#[#]%[%]-=?+[word][:e1[:e2]]]} */ +static WORD_DESC * +parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, contains_dollar_at) + char *string; + int *indexp, quoted, *quoted_dollar_atp, *contains_dollar_at, pflags; +{ + int check_nullness, var_is_set, var_is_null, var_is_special; + int want_substring, want_indir, want_patsub, want_casemod; + char *name, *value, *temp, *temp1; + WORD_DESC *tdesc, *ret; + int t_index, sindex, c, tflag, modspec; + intmax_t number; + arrayind_t ind; + + temp = temp1 = value = (char *)NULL; + var_is_set = var_is_null = var_is_special = check_nullness = 0; + want_substring = want_indir = want_patsub = want_casemod = 0; + + sindex = *indexp; + t_index = ++sindex; + /* ${#var} doesn't have any of the other parameter expansions on it. */ + if (string[t_index] == '#' && legal_variable_starter (string[t_index+1])) /* {{ */ + name = string_extract (string, &t_index, "}", SX_VARNAME); + else +#if defined (CASEMOD_EXPANSIONS) + /* To enable case-toggling expansions using the `~' operator character + change the 1 to 0. */ +# if defined (CASEMOD_CAPCASE) + name = string_extract (string, &t_index, "#%^,~:-=?+/}", SX_VARNAME); +# else + name = string_extract (string, &t_index, "#%^,:-=?+/}", SX_VARNAME); +# endif /* CASEMOD_CAPCASE */ +#else + name = string_extract (string, &t_index, "#%:-=?+/}", SX_VARNAME); +#endif /* CASEMOD_EXPANSIONS */ + + ret = 0; + tflag = 0; + + ind = INTMAX_MIN; + + /* If the name really consists of a special variable, then make sure + that we have the entire name. We don't allow indirect references + to special variables except `#', `?', `@' and `*'. */ + if ((sindex == t_index && VALID_SPECIAL_LENGTH_PARAM (string[t_index])) || + (sindex == t_index - 1 && string[sindex] == '!' && VALID_INDIR_PARAM (string[t_index]))) + { + t_index++; + temp1 = string_extract (string, &t_index, "#%:-=?+/}", 0); + name = (char *)xrealloc (name, 3 + (strlen (temp1))); + *name = string[sindex]; + if (string[sindex] == '!') + { + /* indirect reference of $#, $?, $@, or $* */ + name[1] = string[sindex + 1]; + strcpy (name + 2, temp1); + } + else + strcpy (name + 1, temp1); + free (temp1); + } + sindex = t_index; + + /* Find out what character ended the variable name. Then + do the appropriate thing. */ + if (c = string[sindex]) + sindex++; + + /* If c is followed by one of the valid parameter expansion + characters, move past it as normal. If not, assume that + a substring specification is being given, and do not move + past it. */ + if (c == ':' && VALID_PARAM_EXPAND_CHAR (string[sindex])) + { + check_nullness++; + if (c = string[sindex]) + sindex++; + } + else if (c == ':' && string[sindex] != RBRACE) + want_substring = 1; + else if (c == '/' /* && string[sindex] != RBRACE */) /* XXX */ + want_patsub = 1; +#if defined (CASEMOD_EXPANSIONS) + else if (c == '^' || c == ',' || c == '~') + { + modspec = c; + want_casemod = 1; + } +#endif + + /* Catch the valid and invalid brace expressions that made it through the + tests above. */ + /* ${#-} is a valid expansion and means to take the length of $-. + Similarly for ${#?} and ${##}... */ + if (name[0] == '#' && name[1] == '\0' && check_nullness == 0 && + VALID_SPECIAL_LENGTH_PARAM (c) && string[sindex] == RBRACE) + { + name = (char *)xrealloc (name, 3); + name[1] = c; + name[2] = '\0'; + c = string[sindex++]; + } + + /* ...but ${#%}, ${#:}, ${#=}, ${#+}, and ${#/} are errors. */ + if (name[0] == '#' && name[1] == '\0' && check_nullness == 0 && + member (c, "%:=+/") && string[sindex] == RBRACE) + { + temp = (char *)NULL; + goto bad_substitution; + } + + /* Indirect expansion begins with a `!'. A valid indirect expansion is + either a variable name, one of the positional parameters or a special + variable that expands to one of the positional parameters. */ + want_indir = *name == '!' && + (legal_variable_starter ((unsigned char)name[1]) || DIGIT (name[1]) + || VALID_INDIR_PARAM (name[1])); + + /* Determine the value of this variable. */ + + /* Check for special variables, directly referenced. */ + if (SPECIAL_VAR (name, want_indir)) + var_is_special++; + + /* Check for special expansion things, like the length of a parameter */ + if (*name == '#' && name[1]) + { + /* If we are not pointing at the character just after the + closing brace, then we haven't gotten all of the name. + Since it begins with a special character, this is a bad + substitution. Also check NAME for validity before trying + to go on. */ + if (string[sindex - 1] != RBRACE || (valid_length_expression (name) == 0)) + { + temp = (char *)NULL; + goto bad_substitution; + } + + number = parameter_brace_expand_length (name); + if (number == INTMAX_MIN && unbound_vars_is_error) + { + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (name+1); + free (name); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + free (name); + + *indexp = sindex; + if (number < 0) + return (&expand_wdesc_error); + else + { + ret = alloc_word_desc (); + ret->word = itos (number); + return ret; + } + } + + /* ${@} is identical to $@. */ + if (name[0] == '@' && name[1] == '\0') + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + + if (contains_dollar_at) + *contains_dollar_at = 1; + + tflag |= W_DOLLARAT; + } + + /* Process ${!PREFIX*} expansion. */ + if (want_indir && string[sindex - 1] == RBRACE && + (string[sindex - 2] == '*' || string[sindex - 2] == '@') && + legal_variable_starter ((unsigned char) name[1])) + { + char **x; + WORD_LIST *xlist; + + temp1 = savestring (name + 1); + number = strlen (temp1); + temp1[number - 1] = '\0'; + x = all_variables_matching_prefix (temp1); + xlist = strvec_to_word_list (x, 0, 0); + if (string[sindex - 2] == '*') + temp = string_list_dollar_star (xlist); + else + { + temp = string_list_dollar_at (xlist, quoted); + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + + tflag |= W_DOLLARAT; + } + free (x); + dispose_words (xlist); + free (temp1); + *indexp = sindex; + + free (name); + + ret = alloc_word_desc (); + ret->word = temp; + ret->flags = tflag; /* XXX */ + return ret; + } + +#if defined (ARRAY_VARS) + /* Process ${!ARRAY[@]} and ${!ARRAY[*]} expansion. */ /* [ */ + if (want_indir && string[sindex - 1] == RBRACE && + string[sindex - 2] == ']' && valid_array_reference (name+1)) + { + char *x, *x1; + + temp1 = savestring (name + 1); + x = array_variable_name (temp1, &x1, (int *)0); /* [ */ + FREE (x); + if (ALL_ELEMENT_SUB (x1[0]) && x1[1] == ']') + { + temp = array_keys (temp1, quoted); /* handles assoc vars too */ + if (x1[0] == '@') + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + + tflag |= W_DOLLARAT; + } + + free (temp1); + *indexp = sindex; + + ret = alloc_word_desc (); + ret->word = temp; + ret->flags = tflag; /* XXX */ + return ret; + } + + free (temp1); + } +#endif /* ARRAY_VARS */ + + /* Make sure that NAME is valid before trying to go on. */ + if (valid_brace_expansion_word (want_indir ? name + 1 : name, + var_is_special) == 0) + { + temp = (char *)NULL; + goto bad_substitution; + } + + if (want_indir) + tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at); + else + tdesc = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND|(pflags&(PF_NOSPLIT2|PF_ASSIGNRHS)), &ind); + + if (tdesc) + { + temp = tdesc->word; + tflag = tdesc->flags; + dispose_word_desc (tdesc); + } + else + temp = (char *)0; + + if (temp == &expand_param_error || temp == &expand_param_fatal) + { + FREE (name); + FREE (value); + return (temp == &expand_param_error ? &expand_wdesc_error : &expand_wdesc_fatal); + } + +#if defined (ARRAY_VARS) + if (valid_array_reference (name)) + chk_atstar (name, quoted, quoted_dollar_atp, contains_dollar_at); +#endif + + var_is_set = temp != (char *)0; + var_is_null = check_nullness && (var_is_set == 0 || *temp == 0); + /* XXX - this may not need to be restricted to special variables */ + if (check_nullness) + var_is_null |= var_is_set && var_is_special && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && QUOTED_NULL (temp); + + /* Get the rest of the stuff inside the braces. */ + if (c && c != RBRACE) + { + /* Extract the contents of the ${ ... } expansion + according to the Posix.2 rules. */ + value = extract_dollar_brace_string (string, &sindex, quoted, (c == '%' || c == '#' || c =='/' || c == '^' || c == ',' || c ==':') ? SX_POSIXEXP|SX_WORD : SX_WORD); + if (string[sindex] == RBRACE) + sindex++; + else + goto bad_substitution; + } + else + value = (char *)NULL; + + *indexp = sindex; + + /* All the cases where an expansion can possibly generate an unbound + variable error. */ + if (want_substring || want_patsub || want_casemod || c == '#' || c == '%' || c == RBRACE) + { + if (var_is_set == 0 && unbound_vars_is_error && ((name[0] != '@' && name[0] != '*') || name[1])) + { + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (name); + FREE (value); + FREE (temp); + free (name); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + } + + /* If this is a substring spec, process it and add the result. */ + if (want_substring) + { + temp1 = parameter_brace_substring (name, temp, ind, value, quoted, (tflag & W_ARRAYIND) ? AV_USEIND : 0); + FREE (name); + FREE (value); + FREE (temp); + + if (temp1 == &expand_param_error) + return (&expand_wdesc_error); + else if (temp1 == &expand_param_fatal) + return (&expand_wdesc_fatal); + + ret = alloc_word_desc (); + ret->word = temp1; + /* We test quoted_dollar_atp because we want variants with double-quoted + "$@" to take a different code path. In fact, we make sure at the end + of expand_word_internal that we're only looking at these flags if + quoted_dollar_at == 0. */ + if (temp1 && + (quoted_dollar_atp == 0 || *quoted_dollar_atp == 0) && + QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ret->flags |= W_QUOTED|W_HASQUOTEDNULL; + return ret; + } + else if (want_patsub) + { + temp1 = parameter_brace_patsub (name, temp, ind, value, quoted, (tflag & W_ARRAYIND) ? AV_USEIND : 0); + FREE (name); + FREE (value); + FREE (temp); + + if (temp1 == &expand_param_error) + return (&expand_wdesc_error); + else if (temp1 == &expand_param_fatal) + return (&expand_wdesc_fatal); + + ret = alloc_word_desc (); + ret->word = temp1; + if (temp1 && + (quoted_dollar_atp == 0 || *quoted_dollar_atp == 0) && + QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ret->flags |= W_QUOTED|W_HASQUOTEDNULL; + return ret; + } +#if defined (CASEMOD_EXPANSIONS) + else if (want_casemod) + { + temp1 = parameter_brace_casemod (name, temp, ind, modspec, value, quoted, (tflag & W_ARRAYIND) ? AV_USEIND : 0); + FREE (name); + FREE (value); + FREE (temp); + + if (temp1 == &expand_param_error) + return (&expand_wdesc_error); + else if (temp1 == &expand_param_fatal) + return (&expand_wdesc_fatal); + + ret = alloc_word_desc (); + ret->word = temp1; + if (temp1 && + (quoted_dollar_atp == 0 || *quoted_dollar_atp == 0) && + QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ret->flags |= W_QUOTED|W_HASQUOTEDNULL; + return ret; + } +#endif + + /* Do the right thing based on which character ended the variable name. */ + switch (c) + { + default: + case '\0': + bad_substitution: + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("%s: bad substitution"), string ? string : "??"); + FREE (value); + FREE (temp); + free (name); + return &expand_wdesc_error; + + case RBRACE: + break; + + case '#': /* ${param#[#]pattern} */ + case '%': /* ${param%[%]pattern} */ + if (value == 0 || *value == '\0' || temp == 0 || *temp == '\0') + { + FREE (value); + break; + } + temp1 = parameter_brace_remove_pattern (name, temp, ind, value, c, quoted, (tflag & W_ARRAYIND) ? AV_USEIND : 0); + free (temp); + free (value); + free (name); + + ret = alloc_word_desc (); + ret->word = temp1; + if (temp1 && QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ret->flags |= W_QUOTED|W_HASQUOTEDNULL; + return ret; + + case '-': + case '=': + case '?': + case '+': + if (var_is_set && var_is_null == 0) + { + /* If the operator is `+', we don't want the value of the named + variable for anything, just the value of the right hand side. */ + if (c == '+') + { + /* XXX -- if we're double-quoted and the named variable is "$@", + we want to turn off any special handling of "$@" -- + we're not using it, so whatever is on the rhs applies. */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 0; + if (contains_dollar_at) + *contains_dollar_at = 0; + + FREE (temp); + if (value) + { + /* From Posix discussion on austin-group list. Issue 221 + requires that backslashes escaping `}' inside + double-quoted ${...} be removed. */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + quoted |= Q_DOLBRACE; + ret = parameter_brace_expand_rhs (name, value, c, + quoted, + quoted_dollar_atp, + contains_dollar_at); + /* XXX - fix up later, esp. noting presence of + W_HASQUOTEDNULL in ret->flags */ + free (value); + } + else + temp = (char *)NULL; + } + else + { + FREE (value); + } + /* Otherwise do nothing; just use the value in TEMP. */ + } + else /* VAR not set or VAR is NULL. */ + { + FREE (temp); + temp = (char *)NULL; + if (c == '=' && var_is_special) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("$%s: cannot assign in this way"), name); + free (name); + free (value); + return &expand_wdesc_error; + } + else if (c == '?') + { + parameter_brace_expand_error (name, value); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + else if (c != '+') + { + /* XXX -- if we're double-quoted and the named variable is "$@", + we want to turn off any special handling of "$@" -- + we're not using it, so whatever is on the rhs applies. */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 0; + if (contains_dollar_at) + *contains_dollar_at = 0; + + /* From Posix discussion on austin-group list. Issue 221 requires + that backslashes escaping `}' inside double-quoted ${...} be + removed. */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + quoted |= Q_DOLBRACE; + ret = parameter_brace_expand_rhs (name, value, c, quoted, + quoted_dollar_atp, + contains_dollar_at); + /* XXX - fix up later, esp. noting presence of + W_HASQUOTEDNULL in tdesc->flags */ + } + free (value); + } + + break; + } + free (name); + + if (ret == 0) + { + ret = alloc_word_desc (); + ret->flags = tflag; + ret->word = temp; + } + return (ret); +} + +/* Expand a single ${xxx} expansion. The braces are optional. When + the braces are used, parameter_brace_expand() does the work, + possibly calling param_expand recursively. */ +static WORD_DESC * +param_expand (string, sindex, quoted, expanded_something, + contains_dollar_at, quoted_dollar_at_p, had_quoted_null_p, + pflags) + char *string; + int *sindex, quoted, *expanded_something, *contains_dollar_at; + int *quoted_dollar_at_p, *had_quoted_null_p, pflags; +{ + char *temp, *temp1, uerror[3]; + int zindex, t_index, expok; + unsigned char c; + intmax_t number; + SHELL_VAR *var; + WORD_LIST *list; + WORD_DESC *tdesc, *ret; + int tflag; + + zindex = *sindex; + c = string[++zindex]; + + temp = (char *)NULL; + ret = tdesc = (WORD_DESC *)NULL; + tflag = 0; + + /* Do simple cases first. Switch on what follows '$'. */ + switch (c) + { + /* $0 .. $9? */ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + temp1 = dollar_vars[TODIGIT (c)]; + if (unbound_vars_is_error && temp1 == (char *)NULL) + { + uerror[0] = '$'; + uerror[1] = c; + uerror[2] = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (uerror); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + if (temp1) + temp = (*temp1 && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ? quote_string (temp1) + : quote_escapes (temp1); + else + temp = (char *)NULL; + + break; + + /* $$ -- pid of the invoking shell. */ + case '$': + temp = itos (dollar_dollar_pid); + break; + + /* $# -- number of positional parameters. */ + case '#': + temp = itos (number_of_args ()); + break; + + /* $? -- return value of the last synchronous command. */ + case '?': + temp = itos (last_command_exit_value); + break; + + /* $- -- flags supplied to the shell on invocation or by `set'. */ + case '-': + temp = which_set_flags (); + break; + + /* $! -- Pid of the last asynchronous command. */ + case '!': + /* If no asynchronous pids have been created, expand to nothing. + If `set -u' has been executed, and no async processes have + been created, this is an expansion error. */ + if (last_asynchronous_pid == NO_PID) + { + if (expanded_something) + *expanded_something = 0; + temp = (char *)NULL; + if (unbound_vars_is_error) + { + uerror[0] = '$'; + uerror[1] = c; + uerror[2] = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (uerror); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + } + else + temp = itos (last_asynchronous_pid); + break; + + /* The only difference between this and $@ is when the arg is quoted. */ + case '*': /* `$*' */ + list = list_rest_of_args (); + +#if 0 + /* According to austin-group posix proposal by Geoff Clare in + <20090505091501.GA10097@squonk.masqnet> of 5 May 2009: + + "The shell shall write a message to standard error and + immediately exit when it tries to expand an unset parameter + other than the '@' and '*' special parameters." + */ + + if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) + { + uerror[0] = '$'; + uerror[1] = '*'; + uerror[2] = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (uerror); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } +#endif + + /* If there are no command-line arguments, this should just + disappear if there are other characters in the expansion, + even if it's quoted. */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && list == 0) + temp = (char *)NULL; + else if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES|Q_PATQUOTE)) + { + /* If we have "$*" we want to make a string of the positional + parameters, separated by the first character of $IFS, and + quote the whole string, including the separators. If IFS + is unset, the parameters are separated by ' '; if $IFS is + null, the parameters are concatenated. */ + temp = (quoted & (Q_DOUBLE_QUOTES|Q_PATQUOTE)) ? string_list_dollar_star (list) : string_list (list); + if (temp) + { + temp1 = quote_string (temp); + if (*temp == 0) + tflag |= W_HASQUOTEDNULL; + free (temp); + temp = temp1; + } + } + else + { + /* We check whether or not we're eventually going to split $* here, + for example when IFS is empty and we are processing the rhs of + an assignment statement. In that case, we don't separate the + arguments at all. Otherwise, if the $* is not quoted it is + identical to $@ */ +# if defined (HANDLE_MULTIBYTE) + if (expand_no_split_dollar_star && ifs_firstc[0] == 0) +# else + if (expand_no_split_dollar_star && ifs_firstc == 0) +# endif + temp = string_list_dollar_star (list); + else + { + temp = string_list_dollar_at (list, quoted); + if (quoted == 0 && (ifs_is_set == 0 || ifs_is_null)) + tflag |= W_SPLITSPACE; + } + + if (expand_no_split_dollar_star == 0 && contains_dollar_at) + *contains_dollar_at = 1; + } + + dispose_words (list); + break; + + /* When we have "$@" what we want is "$1" "$2" "$3" ... This + means that we have to turn quoting off after we split into + the individually quoted arguments so that the final split + on the first character of $IFS is still done. */ + case '@': /* `$@' */ + list = list_rest_of_args (); + +#if 0 + /* According to austin-group posix proposal by Geoff Clare in + <20090505091501.GA10097@squonk.masqnet> of 5 May 2009: + + "The shell shall write a message to standard error and + immediately exit when it tries to expand an unset parameter + other than the '@' and '*' special parameters." + */ + + if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) + { + uerror[0] = '$'; + uerror[1] = '@'; + uerror[2] = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (uerror); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } +#endif + + /* We want to flag the fact that we saw this. We can't turn + off quoting entirely, because other characters in the + string might need it (consider "\"$@\""), but we need some + way to signal that the final split on the first character + of $IFS should be done, even though QUOTED is 1. */ + /* XXX - should this test include Q_PATQUOTE? */ + if (quoted_dollar_at_p && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + *quoted_dollar_at_p = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + + /* We want to separate the positional parameters with the first + character of $IFS in case $IFS is something other than a space. + We also want to make sure that splitting is done no matter what -- + according to POSIX.2, this expands to a list of the positional + parameters no matter what IFS is set to. */ + /* XXX - what to do when in a context where word splitting is not + performed? Even when IFS is not the default, posix seems to imply + that we behave like unquoted $* ? Maybe we should use PF_NOSPLIT2 + here. */ + temp = string_list_dollar_at (list, (pflags & PF_ASSIGNRHS) ? (quoted|Q_DOUBLE_QUOTES) : quoted); + + tflag |= W_DOLLARAT; + dispose_words (list); + break; + + case LBRACE: + tdesc = parameter_brace_expand (string, &zindex, quoted, pflags, + quoted_dollar_at_p, + contains_dollar_at); + + if (tdesc == &expand_wdesc_error || tdesc == &expand_wdesc_fatal) + return (tdesc); + temp = tdesc ? tdesc->word : (char *)0; + + /* XXX */ + /* Quoted nulls should be removed if there is anything else + in the string. */ + /* Note that we saw the quoted null so we can add one back at + the end of this function if there are no other characters + in the string, discard TEMP, and go on. The exception to + this is when we have "${@}" and $1 is '', since $@ needs + special handling. */ + if (tdesc && tdesc->word && (tdesc->flags & W_HASQUOTEDNULL) && QUOTED_NULL (temp)) + { + if (had_quoted_null_p) + *had_quoted_null_p = 1; + if (*quoted_dollar_at_p == 0) + { + free (temp); + tdesc->word = temp = (char *)NULL; + } + + } + + ret = tdesc; + goto return0; + + /* Do command or arithmetic substitution. */ + case LPAREN: + /* We have to extract the contents of this paren substitution. */ + t_index = zindex + 1; + temp = extract_command_subst (string, &t_index, 0); + zindex = t_index; + + /* For Posix.2-style `$(( ))' arithmetic substitution, + extract the expression and pass it to the evaluator. */ + if (temp && *temp == LPAREN) + { + char *temp2; + temp1 = temp + 1; + temp2 = savestring (temp1); + t_index = strlen (temp2) - 1; + + if (temp2[t_index] != RPAREN) + { + free (temp2); + goto comsub; + } + + /* Cut off ending `)' */ + temp2[t_index] = '\0'; + + if (chk_arithsub (temp2, t_index) == 0) + { + free (temp2); +#if 0 + internal_warning (_("future versions of the shell will force evaluation as an arithmetic substitution")); +#endif + goto comsub; + } + + /* Expand variables found inside the expression. */ + temp1 = expand_arith_string (temp2, Q_DOUBLE_QUOTES); + free (temp2); + +arithsub: + /* No error messages. */ + this_command_name = (char *)NULL; + number = evalexp (temp1, &expok); + free (temp); + free (temp1); + if (expok == 0) + { + if (interactive_shell == 0 && posixly_correct) + { + last_command_exit_value = EXECUTION_FAILURE; + return (&expand_wdesc_fatal); + } + else + return (&expand_wdesc_error); + } + temp = itos (number); + break; + } + +comsub: + if (pflags & PF_NOCOMSUB) + /* we need zindex+1 because string[zindex] == RPAREN */ + temp1 = substring (string, *sindex, zindex+1); + else + { + tdesc = command_substitute (temp, quoted); + temp1 = tdesc ? tdesc->word : (char *)NULL; + if (tdesc) + dispose_word_desc (tdesc); + } + FREE (temp); + temp = temp1; + break; + + /* Do POSIX.2d9-style arithmetic substitution. This will probably go + away in a future bash release. */ + case '[': + /* Extract the contents of this arithmetic substitution. */ + t_index = zindex + 1; + temp = extract_arithmetic_subst (string, &t_index); + zindex = t_index; + if (temp == 0) + { + temp = savestring (string); + if (expanded_something) + *expanded_something = 0; + goto return0; + } + + /* Do initial variable expansion. */ + temp1 = expand_arith_string (temp, Q_DOUBLE_QUOTES); + + goto arithsub; + + default: + /* Find the variable in VARIABLE_LIST. */ + temp = (char *)NULL; + + for (t_index = zindex; (c = string[zindex]) && legal_variable_char (c); zindex++) + ; + temp1 = (zindex > t_index) ? substring (string, t_index, zindex) : (char *)NULL; + + /* If this isn't a variable name, then just output the `$'. */ + if (temp1 == 0 || *temp1 == '\0') + { + FREE (temp1); + temp = (char *)xmalloc (2); + temp[0] = '$'; + temp[1] = '\0'; + if (expanded_something) + *expanded_something = 0; + goto return0; + } + + /* If the variable exists, return its value cell. */ + var = find_variable (temp1); + + if (var && invisible_p (var) == 0 && var_isset (var)) + { +#if defined (ARRAY_VARS) + if (assoc_p (var) || array_p (var)) + { + temp = array_p (var) ? array_reference (array_cell (var), 0) + : assoc_reference (assoc_cell (var), "0"); + if (temp) + temp = (*temp && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ? quote_string (temp) + : quote_escapes (temp); + else if (unbound_vars_is_error) + goto unbound_variable; + } + else +#endif + { + temp = value_cell (var); + + temp = (*temp && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ? quote_string (temp) + : quote_escapes (temp); + } + + free (temp1); + + goto return0; + } + else if (var = find_variable_last_nameref (temp1)) + { + temp = nameref_cell (var); +#if defined (ARRAY_VARS) + if (temp && *temp && valid_array_reference (temp)) + { + tdesc = parameter_brace_expand_word (temp, SPECIAL_VAR (temp, 0), quoted, pflags, (arrayind_t *)NULL); + if (tdesc == &expand_wdesc_error || tdesc == &expand_wdesc_fatal) + return (tdesc); + ret = tdesc; + goto return0; + } + else +#endif + /* y=2 ; typeset -n x=y; echo $x is not the same as echo $2 in ksh */ + if (temp && *temp && legal_identifier (temp) == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("%s: invalid variable name for name reference"), temp); + return (&expand_wdesc_error); /* XXX */ + } + else + temp = (char *)NULL; + } + + temp = (char *)NULL; + +unbound_variable: + if (unbound_vars_is_error) + { + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (temp1); + } + else + { + free (temp1); + goto return0; + } + + free (temp1); + last_command_exit_value = EXECUTION_FAILURE; + return ((unbound_vars_is_error && interactive_shell == 0) + ? &expand_wdesc_fatal + : &expand_wdesc_error); + } + + if (string[zindex]) + zindex++; + +return0: + *sindex = zindex; + + if (ret == 0) + { + ret = alloc_word_desc (); + ret->flags = tflag; /* XXX */ + ret->word = temp; + } + return ret; +} + +/* Make a word list which is the result of parameter and variable + expansion, command substitution, arithmetic substitution, and + quote removal of WORD. Return a pointer to a WORD_LIST which is + the result of the expansion. If WORD contains a null word, the + word list returned is also null. + + QUOTED contains flag values defined in shell.h. + + ISEXP is used to tell expand_word_internal that the word should be + treated as the result of an expansion. This has implications for + how IFS characters in the word are treated. + + CONTAINS_DOLLAR_AT and EXPANDED_SOMETHING are return values; when non-null + they point to an integer value which receives information about expansion. + CONTAINS_DOLLAR_AT gets non-zero if WORD contained "$@", else zero. + EXPANDED_SOMETHING get non-zero if WORD contained any parameter expansions, + else zero. + + This only does word splitting in the case of $@ expansion. In that + case, we split on ' '. */ + +/* Values for the local variable quoted_state. */ +#define UNQUOTED 0 +#define PARTIALLY_QUOTED 1 +#define WHOLLY_QUOTED 2 + +static WORD_LIST * +expand_word_internal (word, quoted, isexp, contains_dollar_at, expanded_something) + WORD_DESC *word; + int quoted, isexp; + int *contains_dollar_at; + int *expanded_something; +{ + WORD_LIST *list; + WORD_DESC *tword; + + /* The intermediate string that we build while expanding. */ + char *istring; + + /* The current size of the above object. */ + int istring_size; + + /* Index into ISTRING. */ + int istring_index; + + /* Temporary string storage. */ + char *temp, *temp1; + + /* The text of WORD. */ + register char *string; + + /* The size of STRING. */ + size_t string_size; + + /* The index into STRING. */ + int sindex; + + /* This gets 1 if we see a $@ while quoted. */ + int quoted_dollar_at; + + /* One of UNQUOTED, PARTIALLY_QUOTED, or WHOLLY_QUOTED, depending on + whether WORD contains no quoting characters, a partially quoted + string (e.g., "xx"ab), or is fully quoted (e.g., "xxab"). */ + int quoted_state; + + /* State flags */ + int had_quoted_null; + int has_dollar_at, temp_has_dollar_at; + int split_on_spaces; + int tflag; + int pflags; /* flags passed to param_expand */ + + int assignoff; /* If assignment, offset of `=' */ + + register unsigned char c; /* Current character. */ + int t_index; /* For calls to string_extract_xxx. */ + + char twochars[2]; + + DECLARE_MBSTATE; + + istring = (char *)xmalloc (istring_size = DEFAULT_INITIAL_ARRAY_SIZE); + istring[istring_index = 0] = '\0'; + quoted_dollar_at = had_quoted_null = has_dollar_at = 0; + split_on_spaces = 0; + quoted_state = UNQUOTED; + + string = word->word; + if (string == 0) + goto finished_with_string; + /* Don't need the string length for the SADD... and COPY_ macros unless + multibyte characters are possible. */ + string_size = (MB_CUR_MAX > 1) ? strlen (string) : 1; + + if (contains_dollar_at) + *contains_dollar_at = 0; + + assignoff = -1; + + /* Begin the expansion. */ + + for (sindex = 0; ;) + { + c = string[sindex]; + + /* Case on top-level character. */ + switch (c) + { + case '\0': + goto finished_with_string; + + case CTLESC: + sindex++; +#if HANDLE_MULTIBYTE + if (MB_CUR_MAX > 1 && string[sindex]) + { + SADD_MBQCHAR_BODY(temp, string, sindex, string_size); + } + else +#endif + { + temp = (char *)xmalloc (3); + temp[0] = CTLESC; + temp[1] = c = string[sindex]; + temp[2] = '\0'; + } + +dollar_add_string: + if (string[sindex]) + sindex++; + +add_string: + if (temp) + { + istring = sub_append_string (temp, istring, &istring_index, &istring_size); + temp = (char *)0; + } + + break; + +#if defined (PROCESS_SUBSTITUTION) + /* Process substitution. */ + case '<': + case '>': + { + if (string[++sindex] != LPAREN || (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || (word->flags & (W_DQUOTE|W_NOPROCSUB)) || posixly_correct) + { + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + else + t_index = sindex + 1; /* skip past both '<' and LPAREN */ + + temp1 = extract_process_subst (string, (c == '<') ? "<(" : ">(", &t_index); /*))*/ + sindex = t_index; + + /* If the process substitution specification is `<()', we want to + open the pipe for writing in the child and produce output; if + it is `>()', we want to open the pipe for reading in the child + and consume input. */ + temp = temp1 ? process_substitute (temp1, (c == '>')) : (char *)0; + + FREE (temp1); + + goto dollar_add_string; + } +#endif /* PROCESS_SUBSTITUTION */ + + case '=': + /* Posix.2 section 3.6.1 says that tildes following `=' in words + which are not assignment statements are not expanded. If the + shell isn't in posix mode, though, we perform tilde expansion + on `likely candidate' unquoted assignment statements (flags + include W_ASSIGNMENT but not W_QUOTED). A likely candidate + contains an unquoted :~ or =~. Something to think about: we + now have a flag that says to perform tilde expansion on arguments + to `assignment builtins' like declare and export that look like + assignment statements. We now do tilde expansion on such words + even in POSIX mode. */ + if (word->flags & (W_ASSIGNRHS|W_NOTILDE)) + { + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c)) + goto add_ifs_character; + else + goto add_character; + } + /* If we're not in posix mode or forcing assignment-statement tilde + expansion, note where the `=' appears in the word and prepare to + do tilde expansion following the first `='. */ + if ((word->flags & W_ASSIGNMENT) && + (posixly_correct == 0 || (word->flags & W_TILDEEXP)) && + assignoff == -1 && sindex > 0) + assignoff = sindex; + if (sindex == assignoff && string[sindex+1] == '~') /* XXX */ + word->flags |= W_ITILDE; +#if 0 + else if ((word->flags & W_ASSIGNMENT) && + (posixly_correct == 0 || (word->flags & W_TILDEEXP)) && + string[sindex+1] == '~') + word->flags |= W_ITILDE; +#endif + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c)) + goto add_ifs_character; + else + goto add_character; + + case ':': + if (word->flags & W_NOTILDE) + { + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c)) + goto add_ifs_character; + else + goto add_character; + } + + if ((word->flags & (W_ASSIGNMENT|W_ASSIGNRHS|W_TILDEEXP)) && + string[sindex+1] == '~') + word->flags |= W_ITILDE; + + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c)) + goto add_ifs_character; + else + goto add_character; + + case '~': + /* If the word isn't supposed to be tilde expanded, or we're not + at the start of a word or after an unquoted : or = in an + assignment statement, we don't do tilde expansion. */ + if ((word->flags & (W_NOTILDE|W_DQUOTE)) || + (sindex > 0 && ((word->flags & W_ITILDE) == 0)) || + (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + { + word->flags &= ~W_ITILDE; + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c) && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) == 0) + goto add_ifs_character; + else + goto add_character; + } + + if (word->flags & W_ASSIGNRHS) + tflag = 2; + else if (word->flags & (W_ASSIGNMENT|W_TILDEEXP)) + tflag = 1; + else + tflag = 0; + + temp = bash_tilde_find_word (string + sindex, tflag, &t_index); + + word->flags &= ~W_ITILDE; + + if (temp && *temp && t_index > 0) + { + temp1 = bash_tilde_expand (temp, tflag); + if (temp1 && *temp1 == '~' && STREQ (temp, temp1)) + { + FREE (temp); + FREE (temp1); + goto add_character; /* tilde expansion failed */ + } + free (temp); + temp = temp1; + sindex += t_index; + goto add_quoted_string; /* XXX was add_string */ + } + else + { + FREE (temp); + goto add_character; + } + + case '$': + if (expanded_something) + *expanded_something = 1; + + temp_has_dollar_at = 0; + pflags = (word->flags & W_NOCOMSUB) ? PF_NOCOMSUB : 0; + if (word->flags & W_NOSPLIT2) + pflags |= PF_NOSPLIT2; + if (word->flags & W_ASSIGNRHS) + pflags |= PF_ASSIGNRHS; + tword = param_expand (string, &sindex, quoted, expanded_something, + &temp_has_dollar_at, "ed_dollar_at, + &had_quoted_null, pflags); + has_dollar_at += temp_has_dollar_at; + split_on_spaces += (tword->flags & W_SPLITSPACE); + + if (tword == &expand_wdesc_error || tword == &expand_wdesc_fatal) + { + free (string); + free (istring); + return ((tword == &expand_wdesc_error) ? &expand_word_error + : &expand_word_fatal); + } + if (contains_dollar_at && has_dollar_at) + *contains_dollar_at = 1; + + if (tword && (tword->flags & W_HASQUOTEDNULL)) + had_quoted_null = 1; + + temp = tword ? tword->word : (char *)NULL; + dispose_word_desc (tword); + + /* Kill quoted nulls; we will add them back at the end of + expand_word_internal if nothing else in the string */ + if (had_quoted_null && temp && QUOTED_NULL (temp)) + { + FREE (temp); + temp = (char *)NULL; + } + + goto add_string; + break; + + case '`': /* Backquoted command substitution. */ + { + t_index = sindex++; + + temp = string_extract (string, &sindex, "`", SX_REQMATCH); + /* The test of sindex against t_index is to allow bare instances of + ` to pass through, for backwards compatibility. */ + if (temp == &extract_string_error || temp == &extract_string_fatal) + { + if (sindex - 1 == t_index) + { + sindex = t_index; + goto add_character; + } + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("bad substitution: no closing \"`\" in %s") , string+t_index); + free (string); + free (istring); + return ((temp == &extract_string_error) ? &expand_word_error + : &expand_word_fatal); + } + + if (expanded_something) + *expanded_something = 1; + + if (word->flags & W_NOCOMSUB) + /* sindex + 1 because string[sindex] == '`' */ + temp1 = substring (string, t_index, sindex + 1); + else + { + de_backslash (temp); + tword = command_substitute (temp, quoted); + temp1 = tword ? tword->word : (char *)NULL; + if (tword) + dispose_word_desc (tword); + } + FREE (temp); + temp = temp1; + goto dollar_add_string; + } + + case '\\': + if (string[sindex + 1] == '\n') + { + sindex += 2; + continue; + } + + c = string[++sindex]; + + if (quoted & Q_HERE_DOCUMENT) + tflag = CBSHDOC; + else if (quoted & Q_DOUBLE_QUOTES) + tflag = CBSDQUOTE; + else + tflag = 0; + + /* From Posix discussion on austin-group list: Backslash escaping + a } in ${...} is removed. Issue 0000221 */ + if ((quoted & Q_DOLBRACE) && c == RBRACE) + { + SCOPY_CHAR_I (twochars, CTLESC, c, string, sindex, string_size); + } + /* This is the fix for " $@\ " */ + else if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && ((sh_syntaxtab[c] & tflag) == 0) && isexp == 0 && isifs (c)) + { + RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, + DEFAULT_ARRAY_SIZE); + istring[istring_index++] = CTLESC; + istring[istring_index++] = '\\'; + istring[istring_index] = '\0'; + + SCOPY_CHAR_I (twochars, CTLESC, c, string, sindex, string_size); + } + else if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && ((sh_syntaxtab[c] & tflag) == 0)) + { + SCOPY_CHAR_I (twochars, '\\', c, string, sindex, string_size); + } + else if (c == 0) + { + c = CTLNUL; + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + else + { + SCOPY_CHAR_I (twochars, CTLESC, c, string, sindex, string_size); + } + + sindex++; +add_twochars: + /* BEFORE jumping here, we need to increment sindex if appropriate */ + RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, + DEFAULT_ARRAY_SIZE); + istring[istring_index++] = twochars[0]; + istring[istring_index++] = twochars[1]; + istring[istring_index] = '\0'; + + break; + + case '"': + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + goto add_character; + + t_index = ++sindex; + temp = string_extract_double_quoted (string, &sindex, 0); + + /* If the quotes surrounded the entire string, then the + whole word was quoted. */ + quoted_state = (t_index == 1 && string[sindex] == '\0') + ? WHOLLY_QUOTED + : PARTIALLY_QUOTED; + + if (temp && *temp) + { + tword = alloc_word_desc (); + tword->word = temp; + + temp = (char *)NULL; + + temp_has_dollar_at = 0; /* XXX */ + /* Need to get W_HASQUOTEDNULL flag through this function. */ + list = expand_word_internal (tword, Q_DOUBLE_QUOTES, 0, &temp_has_dollar_at, (int *)NULL); + has_dollar_at += temp_has_dollar_at; + + if (list == &expand_word_error || list == &expand_word_fatal) + { + free (istring); + free (string); + /* expand_word_internal has already freed temp_word->word + for us because of the way it prints error messages. */ + tword->word = (char *)NULL; + dispose_word (tword); + return list; + } + + dispose_word (tword); + + /* "$@" (a double-quoted dollar-at) expands into nothing, + not even a NULL word, when there are no positional + parameters. */ + if (list == 0 && has_dollar_at) + { + quoted_dollar_at++; + break; + } + + /* If we get "$@", we know we have expanded something, so we + need to remember it for the final split on $IFS. This is + a special case; it's the only case where a quoted string + can expand into more than one word. It's going to come back + from the above call to expand_word_internal as a list with + a single word, in which all characters are quoted and + separated by blanks. What we want to do is to turn it back + into a list for the next piece of code. */ + if (list) + dequote_list (list); + + if (list && list->word && (list->word->flags & W_HASQUOTEDNULL)) + had_quoted_null = 1; /* XXX */ + + if (has_dollar_at) + { + quoted_dollar_at++; + if (contains_dollar_at) + *contains_dollar_at = 1; + if (expanded_something) + *expanded_something = 1; + } + } + else + { + /* What we have is "". This is a minor optimization. */ + FREE (temp); + list = (WORD_LIST *)NULL; + } + + /* The code above *might* return a list (consider the case of "$@", + where it returns "$1", "$2", etc.). We can't throw away the + rest of the list, and we have to make sure each word gets added + as quoted. We test on tresult->next: if it is non-NULL, we + quote the whole list, save it to a string with string_list, and + add that string. We don't need to quote the results of this + (and it would be wrong, since that would quote the separators + as well), so we go directly to add_string. */ + if (list) + { + if (list->next) + { + /* Testing quoted_dollar_at makes sure that "$@" is + split correctly when $IFS does not contain a space. */ + temp = quoted_dollar_at + ? string_list_dollar_at (list, Q_DOUBLE_QUOTES) + : string_list (quote_list (list)); + dispose_words (list); + goto add_string; + } + else + { + temp = savestring (list->word->word); + tflag = list->word->flags; + dispose_words (list); + + /* If the string is not a quoted null string, we want + to remove any embedded unquoted CTLNUL characters. + We do not want to turn quoted null strings back into + the empty string, though. We do this because we + want to remove any quoted nulls from expansions that + contain other characters. For example, if we have + x"$*"y or "x$*y" and there are no positional parameters, + the $* should expand into nothing. */ + /* We use the W_HASQUOTEDNULL flag to differentiate the + cases: a quoted null character as above and when + CTLNUL is contained in the (non-null) expansion + of some variable. We use the had_quoted_null flag to + pass the value through this function to its caller. */ + if ((tflag & W_HASQUOTEDNULL) && QUOTED_NULL (temp) == 0) + remove_quoted_nulls (temp); /* XXX */ + } + } + else + temp = (char *)NULL; + + /* We do not want to add quoted nulls to strings that are only + partially quoted; we can throw them away. The exception to + this is when we are going to be performing word splitting, + since we have to preserve a null argument if the next character + will cause word splitting. */ + if (temp == 0 && quoted_state == PARTIALLY_QUOTED && (word->flags & (W_NOSPLIT|W_NOSPLIT2))) + continue; + + add_quoted_string: + + if (temp) + { + temp1 = temp; + temp = quote_string (temp); + free (temp1); + goto add_string; + } + else + { + /* Add NULL arg. */ + c = CTLNUL; + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + + /* break; */ + + case '\'': + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + goto add_character; + + t_index = ++sindex; + temp = string_extract_single_quoted (string, &sindex); + + /* If the entire STRING was surrounded by single quotes, + then the string is wholly quoted. */ + quoted_state = (t_index == 1 && string[sindex] == '\0') + ? WHOLLY_QUOTED + : PARTIALLY_QUOTED; + + /* If all we had was '', it is a null expansion. */ + if (*temp == '\0') + { + free (temp); + temp = (char *)NULL; + } + else + remove_quoted_escapes (temp); /* ??? */ + + /* We do not want to add quoted nulls to strings that are only + partially quoted; such nulls are discarded. */ + if (temp == 0 && (quoted_state == PARTIALLY_QUOTED)) + continue; + + /* If we have a quoted null expansion, add a quoted NULL to istring. */ + if (temp == 0) + { + c = CTLNUL; + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + else + goto add_quoted_string; + + /* break; */ + + default: + /* This is the fix for " $@ " */ + add_ifs_character: + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || (isexp == 0 && isifs (c))) + { + if (string[sindex]) /* from old goto dollar_add_string */ + sindex++; + if (c == 0) + { + c = CTLNUL; + goto add_character; + } + else + { +#if HANDLE_MULTIBYTE + if (MB_CUR_MAX > 1) + sindex--; + + if (MB_CUR_MAX > 1) + { + SADD_MBQCHAR_BODY(temp, string, sindex, string_size); + } + else +#endif + { + twochars[0] = CTLESC; + twochars[1] = c; + goto add_twochars; + } + } + } + + SADD_MBCHAR (temp, string, sindex, string_size); + + add_character: + RESIZE_MALLOCED_BUFFER (istring, istring_index, 1, istring_size, + DEFAULT_ARRAY_SIZE); + istring[istring_index++] = c; + istring[istring_index] = '\0'; + + /* Next character. */ + sindex++; + } + } + +finished_with_string: + /* OK, we're ready to return. If we have a quoted string, and + quoted_dollar_at is not set, we do no splitting at all; otherwise + we split on ' '. The routines that call this will handle what to + do if nothing has been expanded. */ + + /* Partially and wholly quoted strings which expand to the empty + string are retained as an empty arguments. Unquoted strings + which expand to the empty string are discarded. The single + exception is the case of expanding "$@" when there are no + positional parameters. In that case, we discard the expansion. */ + + /* Because of how the code that handles "" and '' in partially + quoted strings works, we need to make ISTRING into a QUOTED_NULL + if we saw quoting characters, but the expansion was empty. + "" and '' are tossed away before we get to this point when + processing partially quoted strings. This makes "" and $xxx"" + equivalent when xxx is unset. We also look to see whether we + saw a quoted null from a ${} expansion and add one back if we + need to. */ + + /* If we expand to nothing and there were no single or double quotes + in the word, we throw it away. Otherwise, we return a NULL word. + The single exception is for $@ surrounded by double quotes when + there are no positional parameters. In that case, we also throw + the word away. */ + + if (*istring == '\0') + { + if (quoted_dollar_at == 0 && (had_quoted_null || quoted_state == PARTIALLY_QUOTED)) + { + istring[0] = CTLNUL; + istring[1] = '\0'; + tword = make_bare_word (istring); + tword->flags |= W_HASQUOTEDNULL; /* XXX */ + list = make_word_list (tword, (WORD_LIST *)NULL); + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + tword->flags |= W_QUOTED; + } + /* According to sh, ksh, and Posix.2, if a word expands into nothing + and a double-quoted "$@" appears anywhere in it, then the entire + word is removed. */ + else if (quoted_state == UNQUOTED || quoted_dollar_at) + list = (WORD_LIST *)NULL; +#if 0 + else + { + tword = make_bare_word (istring); + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + tword->flags |= W_QUOTED; + list = make_word_list (tword, (WORD_LIST *)NULL); + } +#else + else + list = (WORD_LIST *)NULL; +#endif + } + else if (word->flags & W_NOSPLIT) + { + tword = make_bare_word (istring); + if (word->flags & W_ASSIGNMENT) + tword->flags |= W_ASSIGNMENT; /* XXX */ + if (word->flags & W_COMPASSIGN) + tword->flags |= W_COMPASSIGN; /* XXX */ + if (word->flags & W_NOGLOB) + tword->flags |= W_NOGLOB; /* XXX */ + if (word->flags & W_NOBRACE) + tword->flags |= W_NOBRACE; /* XXX */ + if (word->flags & W_NOEXPAND) + tword->flags |= W_NOEXPAND; /* XXX */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + tword->flags |= W_QUOTED; + if (had_quoted_null && QUOTED_NULL (istring)) + tword->flags |= W_HASQUOTEDNULL; + list = make_word_list (tword, (WORD_LIST *)NULL); + } + else + { + char *ifs_chars; + char *tstring; + + ifs_chars = (quoted_dollar_at || has_dollar_at) ? ifs_value : (char *)NULL; + + /* If we have $@, we need to split the results no matter what. If + IFS is unset or NULL, string_list_dollar_at has separated the + positional parameters with a space, so we split on space (we have + set ifs_chars to " \t\n" above if ifs is unset). If IFS is set, + string_list_dollar_at has separated the positional parameters + with the first character of $IFS, so we split on $IFS. If + SPLIT_ON_SPACES is set, we expanded $* (unquoted) with IFS either + unset or null, and we want to make sure that we split on spaces + regardless of what else has happened to IFS since the expansion. */ + if (split_on_spaces) + list = list_string (istring, " ", 1); /* XXX quoted == 1? */ + /* If we have $@ (has_dollar_at != 0) and we are in a context where we + don't want to split the result (W_NOSPLIT2), and we are not quoted, + we have already separated the arguments with the first character of + $IFS. In this case, we want to return a list with a single word + with the separator possibly replaced with a space (it's what other + shells seem to do). + quoted_dollar_at is internal to this function and is set if we are + passed an argument that is unquoted (quoted == 0) but we encounter a + double-quoted $@ while expanding it. */ + else if (has_dollar_at && quoted_dollar_at == 0 && ifs_chars && quoted == 0 && (word->flags & W_NOSPLIT2)) + { + /* Only split and rejoin if we have to */ + if (*ifs_chars && *ifs_chars != ' ') + { + list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1); + tstring = string_list (list); + } + else + tstring = istring; + tword = make_bare_word (tstring); + if (tstring != istring) + free (tstring); + goto set_word_flags; + } + else if (has_dollar_at && ifs_chars) + list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1); + else + { + tword = make_bare_word (istring); +set_word_flags: + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) || (quoted_state == WHOLLY_QUOTED)) + tword->flags |= W_QUOTED; + if (word->flags & W_ASSIGNMENT) + tword->flags |= W_ASSIGNMENT; + if (word->flags & W_COMPASSIGN) + tword->flags |= W_COMPASSIGN; + if (word->flags & W_NOGLOB) + tword->flags |= W_NOGLOB; + if (word->flags & W_NOBRACE) + tword->flags |= W_NOBRACE; + if (word->flags & W_NOEXPAND) + tword->flags |= W_NOEXPAND; + if (had_quoted_null && QUOTED_NULL (istring)) + tword->flags |= W_HASQUOTEDNULL; /* XXX */ + list = make_word_list (tword, (WORD_LIST *)NULL); + } + } + + free (istring); + return (list); +} + +/* **************************************************************** */ +/* */ +/* Functions for Quote Removal */ +/* */ +/* **************************************************************** */ + +/* Perform quote removal on STRING. If QUOTED > 0, assume we are obeying the + backslash quoting rules for within double quotes or a here document. */ +char * +string_quote_removal (string, quoted) + char *string; + int quoted; +{ + size_t slen; + char *r, *result_string, *temp, *send; + int sindex, tindex, dquote; + unsigned char c; + DECLARE_MBSTATE; + + /* The result can be no longer than the original string. */ + slen = strlen (string); + send = string + slen; + + r = result_string = (char *)xmalloc (slen + 1); + + for (dquote = sindex = 0; c = string[sindex];) + { + switch (c) + { + case '\\': + c = string[++sindex]; + if (c == 0) + { + *r++ = '\\'; + break; + } + if (((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || dquote) && (sh_syntaxtab[c] & CBSDQUOTE) == 0) + *r++ = '\\'; + /* FALLTHROUGH */ + + default: + SCOPY_CHAR_M (r, string, send, sindex); + break; + + case '\'': + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || dquote) + { + *r++ = c; + sindex++; + break; + } + tindex = sindex + 1; + temp = string_extract_single_quoted (string, &tindex); + if (temp) + { + strcpy (r, temp); + r += strlen (r); + free (temp); + } + sindex = tindex; + break; + + case '"': + dquote = 1 - dquote; + sindex++; + break; + } + } + *r = '\0'; + return (result_string); +} + +#if 0 +/* UNUSED */ +/* Perform quote removal on word WORD. This allocates and returns a new + WORD_DESC *. */ +WORD_DESC * +word_quote_removal (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_DESC *w; + char *t; + + t = string_quote_removal (word->word, quoted); + w = alloc_word_desc (); + w->word = t ? t : savestring (""); + return (w); +} + +/* Perform quote removal on all words in LIST. If QUOTED is non-zero, + the members of the list are treated as if they are surrounded by + double quotes. Return a new list, or NULL if LIST is NULL. */ +WORD_LIST * +word_list_quote_removal (list, quoted) + WORD_LIST *list; + int quoted; +{ + WORD_LIST *result, *t, *tresult, *e; + + for (t = list, result = (WORD_LIST *)NULL; t; t = t->next) + { + tresult = make_word_list (word_quote_removal (t->word, quoted), (WORD_LIST *)NULL); +#if 0 + result = (WORD_LIST *) list_append (result, tresult); +#else + if (result == 0) + result = e = tresult; + else + { + e->next = tresult; + while (e->next) + e = e->next; + } +#endif + } + return (result); +} +#endif + +/******************************************* + * * + * Functions to perform word splitting * + * * + *******************************************/ + +void +setifs (v) + SHELL_VAR *v; +{ + char *t; + unsigned char uc; + + ifs_var = v; + ifs_value = (v && value_cell (v)) ? value_cell (v) : " \t\n"; + + ifs_is_set = ifs_var != 0; + ifs_is_null = ifs_is_set && (*ifs_value == 0); + + /* Should really merge ifs_cmap with sh_syntaxtab. XXX - doesn't yet + handle multibyte chars in IFS */ + memset (ifs_cmap, '\0', sizeof (ifs_cmap)); + for (t = ifs_value ; t && *t; t++) + { + uc = *t; + ifs_cmap[uc] = 1; + } + +#if defined (HANDLE_MULTIBYTE) + if (ifs_value == 0) + { + ifs_firstc[0] = '\0'; + ifs_firstc_len = 1; + } + else + { + size_t ifs_len; + ifs_len = strnlen (ifs_value, MB_CUR_MAX); + ifs_firstc_len = MBLEN (ifs_value, ifs_len); + if (ifs_firstc_len == 1 || ifs_firstc_len == 0 || MB_INVALIDCH (ifs_firstc_len)) + { + ifs_firstc[0] = ifs_value[0]; + ifs_firstc[1] = '\0'; + ifs_firstc_len = 1; + } + else + memcpy (ifs_firstc, ifs_value, ifs_firstc_len); + } +#else + ifs_firstc = ifs_value ? *ifs_value : 0; +#endif +} + +char * +getifs () +{ + return ifs_value; +} + +/* This splits a single word into a WORD LIST on $IFS, but only if the word + is not quoted. list_string () performs quote removal for us, even if we + don't do any splitting. */ +WORD_LIST * +word_split (w, ifs_chars) + WORD_DESC *w; + char *ifs_chars; +{ + WORD_LIST *result; + + if (w) + { + char *xifs; + + xifs = ((w->flags & W_QUOTED) || ifs_chars == 0) ? "" : ifs_chars; + result = list_string (w->word, xifs, w->flags & W_QUOTED); + } + else + result = (WORD_LIST *)NULL; + + return (result); +} + +/* Perform word splitting on LIST and return the RESULT. It is possible + to return (WORD_LIST *)NULL. */ +static WORD_LIST * +word_list_split (list) + WORD_LIST *list; +{ + WORD_LIST *result, *t, *tresult, *e; + + for (t = list, result = (WORD_LIST *)NULL; t; t = t->next) + { + tresult = word_split (t->word, ifs_value); + if (result == 0) + result = e = tresult; + else + { + e->next = tresult; + while (e->next) + e = e->next; + } + } + return (result); +} + +/************************************************** + * * + * Functions to expand an entire WORD_LIST * + * * + **************************************************/ + +/* Do any word-expansion-specific cleanup and jump to top_level */ +static void +exp_jump_to_top_level (v) + int v; +{ + set_pipestatus_from_exit (last_command_exit_value); + + /* Cleanup code goes here. */ + expand_no_split_dollar_star = 0; /* XXX */ + expanding_redir = 0; + assigning_in_environment = 0; + + if (parse_and_execute_level == 0) + top_level_cleanup (); /* from sig.c */ + + jump_to_top_level (v); +} + +/* Put NLIST (which is a WORD_LIST * of only one element) at the front of + ELIST, and set ELIST to the new list. */ +#define PREPEND_LIST(nlist, elist) \ + do { nlist->next = elist; elist = nlist; } while (0) + +/* Separate out any initial variable assignments from TLIST. If set -k has + been executed, remove all assignment statements from TLIST. Initial + variable assignments and other environment assignments are placed + on SUBST_ASSIGN_VARLIST. */ +static WORD_LIST * +separate_out_assignments (tlist) + WORD_LIST *tlist; +{ + register WORD_LIST *vp, *lp; + + if (tlist == 0) + return ((WORD_LIST *)NULL); + + if (subst_assign_varlist) + dispose_words (subst_assign_varlist); /* Clean up after previous error */ + + subst_assign_varlist = (WORD_LIST *)NULL; + vp = lp = tlist; + + /* Separate out variable assignments at the start of the command. + Loop invariant: vp->next == lp + Loop postcondition: + lp = list of words left after assignment statements skipped + tlist = original list of words + */ + while (lp && (lp->word->flags & W_ASSIGNMENT)) + { + vp = lp; + lp = lp->next; + } + + /* If lp != tlist, we have some initial assignment statements. + We make SUBST_ASSIGN_VARLIST point to the list of assignment + words and TLIST point to the remaining words. */ + if (lp != tlist) + { + subst_assign_varlist = tlist; + /* ASSERT(vp->next == lp); */ + vp->next = (WORD_LIST *)NULL; /* terminate variable list */ + tlist = lp; /* remainder of word list */ + } + + /* vp == end of variable list */ + /* tlist == remainder of original word list without variable assignments */ + if (!tlist) + /* All the words in tlist were assignment statements */ + return ((WORD_LIST *)NULL); + + /* ASSERT(tlist != NULL); */ + /* ASSERT((tlist->word->flags & W_ASSIGNMENT) == 0); */ + + /* If the -k option is in effect, we need to go through the remaining + words, separate out the assignment words, and place them on + SUBST_ASSIGN_VARLIST. */ + if (place_keywords_in_env) + { + WORD_LIST *tp; /* tp == running pointer into tlist */ + + tp = tlist; + lp = tlist->next; + + /* Loop Invariant: tp->next == lp */ + /* Loop postcondition: tlist == word list without assignment statements */ + while (lp) + { + if (lp->word->flags & W_ASSIGNMENT) + { + /* Found an assignment statement, add this word to end of + subst_assign_varlist (vp). */ + if (!subst_assign_varlist) + subst_assign_varlist = vp = lp; + else + { + vp->next = lp; + vp = lp; + } + + /* Remove the word pointed to by LP from TLIST. */ + tp->next = lp->next; + /* ASSERT(vp == lp); */ + lp->next = (WORD_LIST *)NULL; + lp = tp->next; + } + else + { + tp = lp; + lp = lp->next; + } + } + } + return (tlist); +} + +#define WEXP_VARASSIGN 0x001 +#define WEXP_BRACEEXP 0x002 +#define WEXP_TILDEEXP 0x004 +#define WEXP_PARAMEXP 0x008 +#define WEXP_PATHEXP 0x010 + +/* All of the expansions, including variable assignments at the start of + the list. */ +#define WEXP_ALL (WEXP_VARASSIGN|WEXP_BRACEEXP|WEXP_TILDEEXP|WEXP_PARAMEXP|WEXP_PATHEXP) + +/* All of the expansions except variable assignments at the start of + the list. */ +#define WEXP_NOVARS (WEXP_BRACEEXP|WEXP_TILDEEXP|WEXP_PARAMEXP|WEXP_PATHEXP) + +/* All of the `shell expansions': brace expansion, tilde expansion, parameter + expansion, command substitution, arithmetic expansion, word splitting, and + quote removal. */ +#define WEXP_SHELLEXP (WEXP_BRACEEXP|WEXP_TILDEEXP|WEXP_PARAMEXP) + +/* Take the list of words in LIST and do the various substitutions. Return + a new list of words which is the expanded list, and without things like + variable assignments. */ + +WORD_LIST * +expand_words (list) + WORD_LIST *list; +{ + return (expand_word_list_internal (list, WEXP_ALL)); +} + +/* Same as expand_words (), but doesn't hack variable or environment + variables. */ +WORD_LIST * +expand_words_no_vars (list) + WORD_LIST *list; +{ + return (expand_word_list_internal (list, WEXP_NOVARS)); +} + +WORD_LIST * +expand_words_shellexp (list) + WORD_LIST *list; +{ + return (expand_word_list_internal (list, WEXP_SHELLEXP)); +} + +static WORD_LIST * +glob_expand_word_list (tlist, eflags) + WORD_LIST *tlist; + int eflags; +{ + char **glob_array, *temp_string; + register int glob_index; + WORD_LIST *glob_list, *output_list, *disposables, *next; + WORD_DESC *tword; + + output_list = disposables = (WORD_LIST *)NULL; + glob_array = (char **)NULL; + while (tlist) + { + /* For each word, either globbing is attempted or the word is + added to orig_list. If globbing succeeds, the results are + added to orig_list and the word (tlist) is added to the list + of disposable words. If globbing fails and failed glob + expansions are left unchanged (the shell default), the + original word is added to orig_list. If globbing fails and + failed glob expansions are removed, the original word is + added to the list of disposable words. orig_list ends up + in reverse order and requires a call to REVERSE_LIST to + be set right. After all words are examined, the disposable + words are freed. */ + next = tlist->next; + + /* If the word isn't an assignment and contains an unquoted + pattern matching character, then glob it. */ + if ((tlist->word->flags & W_NOGLOB) == 0 && + unquoted_glob_pattern_p (tlist->word->word)) + { + glob_array = shell_glob_filename (tlist->word->word); + + /* Handle error cases. + I don't think we should report errors like "No such file + or directory". However, I would like to report errors + like "Read failed". */ + + if (glob_array == 0 || GLOB_FAILED (glob_array)) + { + glob_array = (char **)xmalloc (sizeof (char *)); + glob_array[0] = (char *)NULL; + } + + /* Dequote the current word in case we have to use it. */ + if (glob_array[0] == NULL) + { + temp_string = dequote_string (tlist->word->word); + free (tlist->word->word); + tlist->word->word = temp_string; + } + + /* Make the array into a word list. */ + glob_list = (WORD_LIST *)NULL; + for (glob_index = 0; glob_array[glob_index]; glob_index++) + { + tword = make_bare_word (glob_array[glob_index]); + glob_list = make_word_list (tword, glob_list); + } + + if (glob_list) + { + output_list = (WORD_LIST *)list_append (glob_list, output_list); + PREPEND_LIST (tlist, disposables); + } + else if (fail_glob_expansion != 0) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("no match: %s"), tlist->word->word); + exp_jump_to_top_level (DISCARD); + } + else if (allow_null_glob_expansion == 0) + { + /* Failed glob expressions are left unchanged. */ + PREPEND_LIST (tlist, output_list); + } + else + { + /* Failed glob expressions are removed. */ + PREPEND_LIST (tlist, disposables); + } + } + else + { + /* Dequote the string. */ + temp_string = dequote_string (tlist->word->word); + free (tlist->word->word); + tlist->word->word = temp_string; + PREPEND_LIST (tlist, output_list); + } + + strvec_dispose (glob_array); + glob_array = (char **)NULL; + + tlist = next; + } + + if (disposables) + dispose_words (disposables); + + if (output_list) + output_list = REVERSE_LIST (output_list, WORD_LIST *); + + return (output_list); +} + +#if defined (BRACE_EXPANSION) +static WORD_LIST * +brace_expand_word_list (tlist, eflags) + WORD_LIST *tlist; + int eflags; +{ + register char **expansions; + char *temp_string; + WORD_LIST *disposables, *output_list, *next; + WORD_DESC *w; + int eindex; + + for (disposables = output_list = (WORD_LIST *)NULL; tlist; tlist = next) + { + next = tlist->next; + + if (tlist->word->flags & W_NOBRACE) + { +/*itrace("brace_expand_word_list: %s: W_NOBRACE", tlist->word->word);*/ + PREPEND_LIST (tlist, output_list); + continue; + } + + if ((tlist->word->flags & (W_COMPASSIGN|W_ASSIGNARG)) == (W_COMPASSIGN|W_ASSIGNARG)) + { +/*itrace("brace_expand_word_list: %s: W_COMPASSIGN|W_ASSIGNARG", tlist->word->word);*/ + PREPEND_LIST (tlist, output_list); + continue; + } + + /* Only do brace expansion if the word has a brace character. If + not, just add the word list element to BRACES and continue. In + the common case, at least when running shell scripts, this will + degenerate to a bunch of calls to `mbschr', and then what is + basically a reversal of TLIST into BRACES, which is corrected + by a call to REVERSE_LIST () on BRACES when the end of TLIST + is reached. */ + if (mbschr (tlist->word->word, LBRACE)) + { + expansions = brace_expand (tlist->word->word); + + for (eindex = 0; temp_string = expansions[eindex]; eindex++) + { + w = alloc_word_desc (); + w->word = temp_string; + + /* If brace expansion didn't change the word, preserve + the flags. We may want to preserve the flags + unconditionally someday -- XXX */ + if (STREQ (temp_string, tlist->word->word)) + w->flags = tlist->word->flags; + else + w = make_word_flags (w, temp_string); + + output_list = make_word_list (w, output_list); + } + free (expansions); + + /* Add TLIST to the list of words to be freed after brace + expansion has been performed. */ + PREPEND_LIST (tlist, disposables); + } + else + PREPEND_LIST (tlist, output_list); + } + + if (disposables) + dispose_words (disposables); + + if (output_list) + output_list = REVERSE_LIST (output_list, WORD_LIST *); + + return (output_list); +} +#endif + +#if defined (ARRAY_VARS) +/* Take WORD, a compound associative array assignment, and internally run + 'declare -A w', where W is the variable name portion of WORD. */ +static int +make_internal_declare (word, option) + char *word; + char *option; +{ + int t; + WORD_LIST *wl; + WORD_DESC *w; + + w = make_word (word); + + t = assignment (w->word, 0); + w->word[t] = '\0'; + + wl = make_word_list (w, (WORD_LIST *)NULL); + wl = make_word_list (make_word (option), wl); + + return (declare_builtin (wl)); +} +#endif + +static WORD_LIST * +shell_expand_word_list (tlist, eflags) + WORD_LIST *tlist; + int eflags; +{ + WORD_LIST *expanded, *orig_list, *new_list, *next, *temp_list; + int expanded_something, has_dollar_at; + char *temp_string; + + /* We do tilde expansion all the time. This is what 1003.2 says. */ + new_list = (WORD_LIST *)NULL; + for (orig_list = tlist; tlist; tlist = next) + { + temp_string = tlist->word->word; + + next = tlist->next; + +#if defined (ARRAY_VARS) + /* If this is a compound array assignment to a builtin that accepts + such assignments (e.g., `declare'), take the assignment and perform + it separately, handling the semantics of declarations inside shell + functions. This avoids the double-evaluation of such arguments, + because `declare' does some evaluation of compound assignments on + its own. */ + if ((tlist->word->flags & (W_COMPASSIGN|W_ASSIGNARG)) == (W_COMPASSIGN|W_ASSIGNARG)) + { + int t; + char opts[8], opti; + + opti = 0; + if (tlist->word->flags & (W_ASSIGNASSOC|W_ASSNGLOBAL|W_ASSIGNARRAY)) + opts[opti++] = '-'; + + if ((tlist->word->flags & (W_ASSIGNASSOC|W_ASSNGLOBAL)) == (W_ASSIGNASSOC|W_ASSNGLOBAL)) + { + opts[opti++] = 'g'; + opts[opti++] = 'A'; + } + else if (tlist->word->flags & W_ASSIGNASSOC) + opts[opti++] = 'A'; + else if ((tlist->word->flags & (W_ASSIGNARRAY|W_ASSNGLOBAL)) == (W_ASSIGNARRAY|W_ASSNGLOBAL)) + { + opts[opti++] = 'g'; + opts[opti++] = 'a'; + } + else if (tlist->word->flags & W_ASSIGNARRAY) + opts[opti++] = 'a'; + else if (tlist->word->flags & W_ASSNGLOBAL) + opts[opti++] = 'g'; + +#if 0 + /* If we have special handling note the integer attribute */ + if (opti > 0 && (tlist->word->flags & W_ASSIGNINT)) + opts[opti++] = 'i'; +#endif + + opts[opti] = '\0'; + if (opti > 0) + make_internal_declare (tlist->word->word, opts); + + t = do_word_assignment (tlist->word, 0); + if (t == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + exp_jump_to_top_level (DISCARD); + } + + /* Now transform the word as ksh93 appears to do and go on */ + t = assignment (tlist->word->word, 0); + tlist->word->word[t] = '\0'; + tlist->word->flags &= ~(W_ASSIGNMENT|W_NOSPLIT|W_COMPASSIGN|W_ASSIGNARG|W_ASSIGNASSOC|W_ASSIGNARRAY); + } +#endif + + expanded_something = 0; + expanded = expand_word_internal + (tlist->word, 0, 0, &has_dollar_at, &expanded_something); + + if (expanded == &expand_word_error || expanded == &expand_word_fatal) + { + /* By convention, each time this error is returned, + tlist->word->word has already been freed. */ + tlist->word->word = (char *)NULL; + + /* Dispose our copy of the original list. */ + dispose_words (orig_list); + /* Dispose the new list we're building. */ + dispose_words (new_list); + + last_command_exit_value = EXECUTION_FAILURE; + if (expanded == &expand_word_error) + exp_jump_to_top_level (DISCARD); + else + exp_jump_to_top_level (FORCE_EOF); + } + + /* Don't split words marked W_NOSPLIT. */ + if (expanded_something && (tlist->word->flags & W_NOSPLIT) == 0) + { + temp_list = word_list_split (expanded); + dispose_words (expanded); + } + else + { + /* If no parameter expansion, command substitution, process + substitution, or arithmetic substitution took place, then + do not do word splitting. We still have to remove quoted + null characters from the result. */ + word_list_remove_quoted_nulls (expanded); + temp_list = expanded; + } + + expanded = REVERSE_LIST (temp_list, WORD_LIST *); + new_list = (WORD_LIST *)list_append (expanded, new_list); + } + + if (orig_list) + dispose_words (orig_list); + + if (new_list) + new_list = REVERSE_LIST (new_list, WORD_LIST *); + + return (new_list); +} + +/* The workhorse for expand_words () and expand_words_no_vars (). + First arg is LIST, a WORD_LIST of words. + Second arg EFLAGS is a flags word controlling which expansions are + performed. + + This does all of the substitutions: brace expansion, tilde expansion, + parameter expansion, command substitution, arithmetic expansion, + process substitution, word splitting, and pathname expansion, according + to the bits set in EFLAGS. Words with the W_QUOTED or W_NOSPLIT bits + set, or for which no expansion is done, do not undergo word splitting. + Words with the W_NOGLOB bit set do not undergo pathname expansion; words + with W_NOBRACE set do not undergo brace expansion (see + brace_expand_word_list above). */ +static WORD_LIST * +expand_word_list_internal (list, eflags) + WORD_LIST *list; + int eflags; +{ + WORD_LIST *new_list, *temp_list; + int tint; + + tempenv_assign_error = 0; + if (list == 0) + return ((WORD_LIST *)NULL); + + garglist = new_list = copy_word_list (list); + if (eflags & WEXP_VARASSIGN) + { + garglist = new_list = separate_out_assignments (new_list); + if (new_list == 0) + { + if (subst_assign_varlist) + { + /* All the words were variable assignments, so they are placed + into the shell's environment. */ + for (temp_list = subst_assign_varlist; temp_list; temp_list = temp_list->next) + { + this_command_name = (char *)NULL; /* no arithmetic errors */ + tint = do_word_assignment (temp_list->word, 0); + /* Variable assignment errors in non-interactive shells + running in Posix.2 mode cause the shell to exit. */ + if (tint == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + if (interactive_shell == 0 && posixly_correct) + exp_jump_to_top_level (FORCE_EOF); + else + exp_jump_to_top_level (DISCARD); + } + } + dispose_words (subst_assign_varlist); + subst_assign_varlist = (WORD_LIST *)NULL; + } + return ((WORD_LIST *)NULL); + } + } + + /* Begin expanding the words that remain. The expansions take place on + things that aren't really variable assignments. */ + +#if defined (BRACE_EXPANSION) + /* Do brace expansion on this word if there are any brace characters + in the string. */ + if ((eflags & WEXP_BRACEEXP) && brace_expansion && new_list) + new_list = brace_expand_word_list (new_list, eflags); +#endif /* BRACE_EXPANSION */ + + /* Perform the `normal' shell expansions: tilde expansion, parameter and + variable substitution, command substitution, arithmetic expansion, + and word splitting. */ + new_list = shell_expand_word_list (new_list, eflags); + + /* Okay, we're almost done. Now let's just do some filename + globbing. */ + if (new_list) + { + if ((eflags & WEXP_PATHEXP) && disallow_filename_globbing == 0) + /* Glob expand the word list unless globbing has been disabled. */ + new_list = glob_expand_word_list (new_list, eflags); + else + /* Dequote the words, because we're not performing globbing. */ + new_list = dequote_list (new_list); + } + + if ((eflags & WEXP_VARASSIGN) && subst_assign_varlist) + { + sh_wassign_func_t *assign_func; + int is_special_builtin, is_builtin_or_func; + + /* If the remainder of the words expand to nothing, Posix.2 requires + that the variable and environment assignments affect the shell's + environment. */ + assign_func = new_list ? assign_in_env : do_word_assignment; + tempenv_assign_error = 0; + + is_builtin_or_func = (new_list && new_list->word && (find_shell_builtin (new_list->word->word) || find_function (new_list->word->word))); + /* Posix says that special builtins exit if a variable assignment error + occurs in an assignment preceding it. */ + is_special_builtin = (posixly_correct && new_list && new_list->word && find_special_builtin (new_list->word->word)); + + for (temp_list = subst_assign_varlist; temp_list; temp_list = temp_list->next) + { + this_command_name = (char *)NULL; + assigning_in_environment = (assign_func == assign_in_env); + tint = (*assign_func) (temp_list->word, is_builtin_or_func); + assigning_in_environment = 0; + /* Variable assignment errors in non-interactive shells running + in Posix.2 mode cause the shell to exit. */ + if (tint == 0) + { + if (assign_func == do_word_assignment) + { + last_command_exit_value = EXECUTION_FAILURE; + if (interactive_shell == 0 && posixly_correct && is_special_builtin) + exp_jump_to_top_level (FORCE_EOF); + else + exp_jump_to_top_level (DISCARD); + } + else + tempenv_assign_error++; + } + } + + dispose_words (subst_assign_varlist); + subst_assign_varlist = (WORD_LIST *)NULL; + } + + return (new_list); +} diff --git a/.pc/bash43-023.diff/subst.h b/.pc/bash43-023.diff/subst.h new file mode 100644 index 0000000..d123fcc --- /dev/null +++ b/.pc/bash43-023.diff/subst.h @@ -0,0 +1,317 @@ +/* subst.h -- Names of externally visible functions in subst.c. */ + +/* Copyright (C) 1993-2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_SUBST_H_) +#define _SUBST_H_ + +#include "stdc.h" + +/* Constants which specify how to handle backslashes and quoting in + expand_word_internal (). Q_DOUBLE_QUOTES means to use the function + slashify_in_quotes () to decide whether the backslash should be + retained. Q_HERE_DOCUMENT means slashify_in_here_document () to + decide whether to retain the backslash. Q_KEEP_BACKSLASH means + to unconditionally retain the backslash. Q_PATQUOTE means that we're + expanding a pattern ${var%#[#%]pattern} in an expansion surrounded + by double quotes. Q_DOLBRACE means we are expanding a ${...} word, so + backslashes should also escape { and } and be removed. */ +#define Q_DOUBLE_QUOTES 0x01 +#define Q_HERE_DOCUMENT 0x02 +#define Q_KEEP_BACKSLASH 0x04 +#define Q_PATQUOTE 0x08 +#define Q_QUOTED 0x10 +#define Q_ADDEDQUOTES 0x20 +#define Q_QUOTEDNULL 0x40 +#define Q_DOLBRACE 0x80 + +/* Flag values controlling how assignment statements are treated. */ +#define ASS_APPEND 0x0001 +#define ASS_MKLOCAL 0x0002 +#define ASS_MKASSOC 0x0004 +#define ASS_MKGLOBAL 0x0008 /* force global assignment */ +#define ASS_NAMEREF 0x0010 /* assigning to nameref variable */ + +/* Flags for the string extraction functions. */ +#define SX_NOALLOC 0x0001 /* just skip; don't return substring */ +#define SX_VARNAME 0x0002 /* variable name; for string_extract () */ +#define SX_REQMATCH 0x0004 /* closing/matching delimiter required */ +#define SX_COMMAND 0x0008 /* extracting a shell script/command */ +#define SX_NOCTLESC 0x0010 /* don't honor CTLESC quoting */ +#define SX_NOESCCTLNUL 0x0020 /* don't let CTLESC quote CTLNUL */ +#define SX_NOLONGJMP 0x0040 /* don't longjmp on fatal error */ +#define SX_ARITHSUB 0x0080 /* extracting $(( ... )) (currently unused) */ +#define SX_POSIXEXP 0x0100 /* extracting new Posix pattern removal expansions in extract_dollar_brace_string */ +#define SX_WORD 0x0200 /* extracting word in ${param op word} */ + +/* Remove backslashes which are quoting backquotes from STRING. Modifies + STRING, and returns a pointer to it. */ +extern char * de_backslash __P((char *)); + +/* Replace instances of \! in a string with !. */ +extern void unquote_bang __P((char *)); + +/* Extract the $( construct in STRING, and return a new string. + Start extracting at (SINDEX) as if we had just seen "$(". + Make (SINDEX) get the position just after the matching ")". + XFLAGS is additional flags to pass to other extraction functions, */ +extern char *extract_command_subst __P((char *, int *, int)); + +/* Extract the $[ construct in STRING, and return a new string. + Start extracting at (SINDEX) as if we had just seen "$[". + Make (SINDEX) get the position just after the matching "]". */ +extern char *extract_arithmetic_subst __P((char *, int *)); + +#if defined (PROCESS_SUBSTITUTION) +/* Extract the <( or >( construct in STRING, and return a new string. + Start extracting at (SINDEX) as if we had just seen "<(". + Make (SINDEX) get the position just after the matching ")". */ +extern char *extract_process_subst __P((char *, char *, int *)); +#endif /* PROCESS_SUBSTITUTION */ + +/* Extract the name of the variable to bind to from the assignment string. */ +extern char *assignment_name __P((char *)); + +/* Return a single string of all the words present in LIST, separating + each word with SEP. */ +extern char *string_list_internal __P((WORD_LIST *, char *)); + +/* Return a single string of all the words present in LIST, separating + each word with a space. */ +extern char *string_list __P((WORD_LIST *)); + +/* Turn $* into a single string, obeying POSIX rules. */ +extern char *string_list_dollar_star __P((WORD_LIST *)); + +/* Expand $@ into a single string, obeying POSIX rules. */ +extern char *string_list_dollar_at __P((WORD_LIST *, int)); + +/* Turn the positional paramters into a string, understanding quoting and + the various subtleties of using the first character of $IFS as the + separator. Calls string_list_dollar_at, string_list_dollar_star, and + string_list as appropriate. */ +extern char *string_list_pos_params __P((int, WORD_LIST *, int)); + +/* Perform quoted null character removal on each element of LIST. + This modifies LIST. */ +extern void word_list_remove_quoted_nulls __P((WORD_LIST *)); + +/* This performs word splitting and quoted null character removal on + STRING. */ +extern WORD_LIST *list_string __P((char *, char *, int)); + +extern char *ifs_firstchar __P((int *)); +extern char *get_word_from_string __P((char **, char *, char **)); +extern char *strip_trailing_ifs_whitespace __P((char *, char *, int)); + +/* Given STRING, an assignment string, get the value of the right side + of the `=', and bind it to the left side. If EXPAND is true, then + perform tilde expansion, parameter expansion, command substitution, + and arithmetic expansion on the right-hand side. Do not perform word + splitting on the result of expansion. */ +extern int do_assignment __P((char *)); +extern int do_assignment_no_expand __P((char *)); +extern int do_word_assignment __P((WORD_DESC *, int)); + +/* Append SOURCE to TARGET at INDEX. SIZE is the current amount + of space allocated to TARGET. SOURCE can be NULL, in which + case nothing happens. Gets rid of SOURCE by free ()ing it. + Returns TARGET in case the location has changed. */ +extern char *sub_append_string __P((char *, char *, int *, int *)); + +/* Append the textual representation of NUMBER to TARGET. + INDEX and SIZE are as in SUB_APPEND_STRING. */ +extern char *sub_append_number __P((intmax_t, char *, int *, int *)); + +/* Return the word list that corresponds to `$*'. */ +extern WORD_LIST *list_rest_of_args __P((void)); + +/* Make a single large string out of the dollar digit variables, + and the rest_of_args. If DOLLAR_STAR is 1, then obey the special + case of "$*" with respect to IFS. */ +extern char *string_rest_of_args __P((int)); + +extern int number_of_args __P((void)); + +/* Expand STRING by performing parameter expansion, command substitution, + and arithmetic expansion. Dequote the resulting WORD_LIST before + returning it, but do not perform word splitting. The call to + remove_quoted_nulls () is made here because word splitting normally + takes care of quote removal. */ +extern WORD_LIST *expand_string_unsplit __P((char *, int)); + +/* Expand the rhs of an assignment statement. */ +extern WORD_LIST *expand_string_assignment __P((char *, int)); + +/* Expand a prompt string. */ +extern WORD_LIST *expand_prompt_string __P((char *, int, int)); + +/* Expand STRING just as if you were expanding a word. This also returns + a list of words. Note that filename globbing is *NOT* done for word + or string expansion, just when the shell is expanding a command. This + does parameter expansion, command substitution, arithmetic expansion, + and word splitting. Dequote the resultant WORD_LIST before returning. */ +extern WORD_LIST *expand_string __P((char *, int)); + +/* Convenience functions that expand strings to strings, taking care of + converting the WORD_LIST * returned by the expand_string* functions + to a string and deallocating the WORD_LIST *. */ +extern char *expand_string_to_string __P((char *, int)); +extern char *expand_string_unsplit_to_string __P((char *, int)); +extern char *expand_assignment_string_to_string __P((char *, int)); + +/* Expand an arithmetic expression string */ +extern char *expand_arith_string __P((char *, int)); + +/* De-quote quoted characters in STRING. */ +extern char *dequote_string __P((char *)); + +/* De-quote CTLESC-escaped CTLESC or CTLNUL characters in STRING. */ +extern char *dequote_escapes __P((char *)); + +/* De-quote quoted characters in each word in LIST. */ +extern WORD_LIST *dequote_list __P((WORD_LIST *)); + +/* Expand WORD, performing word splitting on the result. This does + parameter expansion, command substitution, arithmetic expansion, + word splitting, and quote removal. */ +extern WORD_LIST *expand_word __P((WORD_DESC *, int)); + +/* Expand WORD, but do not perform word splitting on the result. This + does parameter expansion, command substitution, arithmetic expansion, + and quote removal. */ +extern WORD_LIST *expand_word_unsplit __P((WORD_DESC *, int)); +extern WORD_LIST *expand_word_leave_quoted __P((WORD_DESC *, int)); + +/* Return the value of a positional parameter. This handles values > 10. */ +extern char *get_dollar_var_value __P((intmax_t)); + +/* Quote a string to protect it from word splitting. */ +extern char *quote_string __P((char *)); + +/* Quote escape characters (characters special to interals of expansion) + in a string. */ +extern char *quote_escapes __P((char *)); + +/* And remove such quoted special characters. */ +extern char *remove_quoted_escapes __P((char *)); + +/* Remove CTLNUL characters from STRING unless they are quoted with CTLESC. */ +extern char *remove_quoted_nulls __P((char *)); + +/* Perform quote removal on STRING. If QUOTED > 0, assume we are obeying the + backslash quoting rules for within double quotes. */ +extern char *string_quote_removal __P((char *, int)); + +/* Perform quote removal on word WORD. This allocates and returns a new + WORD_DESC *. */ +extern WORD_DESC *word_quote_removal __P((WORD_DESC *, int)); + +/* Perform quote removal on all words in LIST. If QUOTED is non-zero, + the members of the list are treated as if they are surrounded by + double quotes. Return a new list, or NULL if LIST is NULL. */ +extern WORD_LIST *word_list_quote_removal __P((WORD_LIST *, int)); + +/* Called when IFS is changed to maintain some private variables. */ +extern void setifs __P((SHELL_VAR *)); + +/* Return the value of $IFS, or " \t\n" if IFS is unset. */ +extern char *getifs __P((void)); + +/* This splits a single word into a WORD LIST on $IFS, but only if the word + is not quoted. list_string () performs quote removal for us, even if we + don't do any splitting. */ +extern WORD_LIST *word_split __P((WORD_DESC *, char *)); + +/* Take the list of words in LIST and do the various substitutions. Return + a new list of words which is the expanded list, and without things like + variable assignments. */ +extern WORD_LIST *expand_words __P((WORD_LIST *)); + +/* Same as expand_words (), but doesn't hack variable or environment + variables. */ +extern WORD_LIST *expand_words_no_vars __P((WORD_LIST *)); + +/* Perform the `normal shell expansions' on a WORD_LIST. These are + brace expansion, tilde expansion, parameter and variable substitution, + command substitution, arithmetic expansion, and word splitting. */ +extern WORD_LIST *expand_words_shellexp __P((WORD_LIST *)); + +extern WORD_DESC *command_substitute __P((char *, int)); +extern char *pat_subst __P((char *, char *, char *, int)); + +extern int fifos_pending __P((void)); +extern int num_fifos __P((void)); +extern void unlink_fifo_list __P((void)); +extern void unlink_fifo __P((int)); + +extern char *copy_fifo_list __P((int *)); +extern void unlink_new_fifos __P((char *, int)); +extern void close_new_fifos __P((char *, int)); + +extern WORD_LIST *list_string_with_quotes __P((char *)); + +#if defined (ARRAY_VARS) +extern char *extract_array_assignment_list __P((char *, int *)); +#endif + +#if defined (COND_COMMAND) +extern char *remove_backslashes __P((char *)); +extern char *cond_expand_word __P((WORD_DESC *, int)); +#endif + +/* Flags for skip_to_delim */ +#define SD_NOJMP 0x01 /* don't longjmp on fatal error. */ +#define SD_INVERT 0x02 /* look for chars NOT in passed set */ +#define SD_NOQUOTEDELIM 0x04 /* don't let single or double quotes act as delimiters */ +#define SD_NOSKIPCMD 0x08 /* don't skip over $(, <(, or >( command/process substitution */ +#define SD_EXTGLOB 0x10 /* skip over extended globbing patterns if appropriate */ +#define SD_IGNOREQUOTE 0x20 /* single and double quotes are not special */ +#define SD_GLOB 0x40 /* skip over glob patterns like bracket expressions */ + +extern int skip_to_delim __P((char *, int, char *, int)); + +#if defined (READLINE) +extern int char_is_quoted __P((char *, int)); +extern int unclosed_pair __P((char *, int, char *)); +extern WORD_LIST *split_at_delims __P((char *, int, char *, int, int, int *, int *)); +#endif + +/* Variables used to keep track of the characters in IFS. */ +extern SHELL_VAR *ifs_var; +extern char *ifs_value; +extern unsigned char ifs_cmap[]; + +#if defined (HANDLE_MULTIBYTE) +extern unsigned char ifs_firstc[]; +extern size_t ifs_firstc_len; +#else +extern unsigned char ifs_firstc; +#endif + +/* Evaluates to 1 if C is a character in $IFS. */ +#define isifs(c) (ifs_cmap[(unsigned char)(c)] != 0) + +/* How to determine the quoted state of the character C. */ +#define QUOTED_CHAR(c) ((c) == CTLESC) + +/* Is the first character of STRING a quoted NULL character? */ +#define QUOTED_NULL(string) ((string)[0] == CTLNUL && (string)[1] == '\0') + +#endif /* !_SUBST_H_ */ diff --git a/.pc/bash43-024.diff/patchlevel.h b/.pc/bash43-024.diff/patchlevel.h new file mode 100644 index 0000000..36672cb --- /dev/null +++ b/.pc/bash43-024.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 23 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-024.diff/subst.c b/.pc/bash43-024.diff/subst.c new file mode 100644 index 0000000..b931708 --- /dev/null +++ b/.pc/bash43-024.diff/subst.c @@ -0,0 +1,9751 @@ +/* subst.c -- The part of the shell that does parameter, command, arithmetic, + and globbing substitutions. */ + +/* ``Have a little faith, there's magic in the night. You ain't a + beauty, but, hey, you're alright.'' */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" +#include +#include "chartypes.h" +#if defined (HAVE_PWD_H) +# include +#endif +#include +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" +#include "posixstat.h" +#include "bashintl.h" + +#include "shell.h" +#include "parser.h" +#include "flags.h" +#include "jobs.h" +#include "execute_cmd.h" +#include "filecntl.h" +#include "trap.h" +#include "pathexp.h" +#include "mailcheck.h" + +#include "shmbutil.h" +#include "typemax.h" + +#include "builtins/getopt.h" +#include "builtins/common.h" + +#include "builtins/builtext.h" + +#include +#include + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +/* The size that strings change by. */ +#define DEFAULT_INITIAL_ARRAY_SIZE 112 +#define DEFAULT_ARRAY_SIZE 128 + +/* Variable types. */ +#define VT_VARIABLE 0 +#define VT_POSPARMS 1 +#define VT_ARRAYVAR 2 +#define VT_ARRAYMEMBER 3 +#define VT_ASSOCVAR 4 + +#define VT_STARSUB 128 /* $* or ${array[*]} -- used to split */ + +/* Flags for quoted_strchr */ +#define ST_BACKSL 0x01 +#define ST_CTLESC 0x02 +#define ST_SQUOTE 0x04 /* unused yet */ +#define ST_DQUOTE 0x08 /* unused yet */ + +/* Flags for the `pflags' argument to param_expand() */ +#define PF_NOCOMSUB 0x01 /* Do not perform command substitution */ +#define PF_IGNUNBOUND 0x02 /* ignore unbound vars even if -u set */ +#define PF_NOSPLIT2 0x04 /* same as W_NOSPLIT2 */ +#define PF_ASSIGNRHS 0x08 /* same as W_ASSIGNRHS */ + +/* These defs make it easier to use the editor. */ +#define LBRACE '{' +#define RBRACE '}' +#define LPAREN '(' +#define RPAREN ')' +#define LBRACK '[' +#define RBRACK ']' + +#if defined (HANDLE_MULTIBYTE) +#define WLPAREN L'(' +#define WRPAREN L')' +#endif + +/* Evaluates to 1 if C is one of the shell's special parameters whose length + can be taken, but is also one of the special expansion characters. */ +#define VALID_SPECIAL_LENGTH_PARAM(c) \ + ((c) == '-' || (c) == '?' || (c) == '#') + +/* Evaluates to 1 if C is one of the shell's special parameters for which an + indirect variable reference may be made. */ +#define VALID_INDIR_PARAM(c) \ + ((posixly_correct == 0 && (c) == '#') || (posixly_correct == 0 && (c) == '?') || (c) == '@' || (c) == '*') + +/* Evaluates to 1 if C is one of the OP characters that follows the parameter + in ${parameter[:]OPword}. */ +#define VALID_PARAM_EXPAND_CHAR(c) (sh_syntaxtab[(unsigned char)c] & CSUBSTOP) + +/* Evaluates to 1 if this is one of the shell's special variables. */ +#define SPECIAL_VAR(name, wi) \ + ((DIGIT (*name) && all_digits (name)) || \ + (name[1] == '\0' && (sh_syntaxtab[(unsigned char)*name] & CSPECVAR)) || \ + (wi && name[2] == '\0' && VALID_INDIR_PARAM (name[1]))) + +/* An expansion function that takes a string and a quoted flag and returns + a WORD_LIST *. Used as the type of the third argument to + expand_string_if_necessary(). */ +typedef WORD_LIST *EXPFUNC __P((char *, int)); + +/* Process ID of the last command executed within command substitution. */ +pid_t last_command_subst_pid = NO_PID; +pid_t current_command_subst_pid = NO_PID; + +/* Variables used to keep track of the characters in IFS. */ +SHELL_VAR *ifs_var; +char *ifs_value; +unsigned char ifs_cmap[UCHAR_MAX + 1]; +int ifs_is_set, ifs_is_null; + +#if defined (HANDLE_MULTIBYTE) +unsigned char ifs_firstc[MB_LEN_MAX]; +size_t ifs_firstc_len; +#else +unsigned char ifs_firstc; +#endif + +/* Sentinel to tell when we are performing variable assignments preceding a + command name and putting them into the environment. Used to make sure + we use the temporary environment when looking up variable values. */ +int assigning_in_environment; + +/* Used to hold a list of variable assignments preceding a command. Global + so the SIGCHLD handler in jobs.c can unwind-protect it when it runs a + SIGCHLD trap and so it can be saved and restored by the trap handlers. */ +WORD_LIST *subst_assign_varlist = (WORD_LIST *)NULL; + +/* Extern functions and variables from different files. */ +extern int last_command_exit_value, last_command_exit_signal; +extern int subshell_environment, line_number; +extern int subshell_level, parse_and_execute_level, sourcelevel; +extern int eof_encountered; +extern int return_catch_flag, return_catch_value; +extern pid_t dollar_dollar_pid; +extern int posixly_correct; +extern char *this_command_name; +extern struct fd_bitmap *current_fds_to_close; +extern int wordexp_only; +extern int expanding_redir; +extern int tempenv_assign_error; +extern int builtin_ignoring_errexit; + +#if !defined (HAVE_WCSDUP) && defined (HANDLE_MULTIBYTE) +extern wchar_t *wcsdup __P((const wchar_t *)); +#endif + +/* Non-zero means to allow unmatched globbed filenames to expand to + a null file. */ +int allow_null_glob_expansion; + +/* Non-zero means to throw an error when globbing fails to match anything. */ +int fail_glob_expansion; + +#if 0 +/* Variables to keep track of which words in an expanded word list (the + output of expand_word_list_internal) are the result of globbing + expansions. GLOB_ARGV_FLAGS is used by execute_cmd.c. + (CURRENTLY UNUSED). */ +char *glob_argv_flags; +static int glob_argv_flags_size; +#endif + +static WORD_LIST expand_word_error, expand_word_fatal; +static WORD_DESC expand_wdesc_error, expand_wdesc_fatal; +static char expand_param_error, expand_param_fatal; +static char extract_string_error, extract_string_fatal; + +/* Tell the expansion functions to not longjmp back to top_level on fatal + errors. Enabled when doing completion and prompt string expansion. */ +static int no_longjmp_on_fatal_error = 0; + +/* Set by expand_word_unsplit; used to inhibit splitting and re-joining + $* on $IFS, primarily when doing assignment statements. */ +static int expand_no_split_dollar_star = 0; + +/* A WORD_LIST of words to be expanded by expand_word_list_internal, + without any leading variable assignments. */ +static WORD_LIST *garglist = (WORD_LIST *)NULL; + +static char *quoted_substring __P((char *, int, int)); +static int quoted_strlen __P((char *)); +static char *quoted_strchr __P((char *, int, int)); + +static char *expand_string_if_necessary __P((char *, int, EXPFUNC *)); +static inline char *expand_string_to_string_internal __P((char *, int, EXPFUNC *)); +static WORD_LIST *call_expand_word_internal __P((WORD_DESC *, int, int, int *, int *)); +static WORD_LIST *expand_string_internal __P((char *, int)); +static WORD_LIST *expand_string_leave_quoted __P((char *, int)); +static WORD_LIST *expand_string_for_rhs __P((char *, int, int *, int *)); + +static WORD_LIST *list_quote_escapes __P((WORD_LIST *)); +static WORD_LIST *list_dequote_escapes __P((WORD_LIST *)); + +static char *make_quoted_char __P((int)); +static WORD_LIST *quote_list __P((WORD_LIST *)); + +static int unquoted_substring __P((char *, char *)); +static int unquoted_member __P((int, char *)); + +#if defined (ARRAY_VARS) +static SHELL_VAR *do_compound_assignment __P((char *, char *, int)); +#endif +static int do_assignment_internal __P((const WORD_DESC *, int)); + +static char *string_extract_verbatim __P((char *, size_t, int *, char *, int)); +static char *string_extract __P((char *, int *, char *, int)); +static char *string_extract_double_quoted __P((char *, int *, int)); +static inline char *string_extract_single_quoted __P((char *, int *)); +static inline int skip_single_quoted __P((const char *, size_t, int)); +static int skip_double_quoted __P((char *, size_t, int)); +static char *extract_delimited_string __P((char *, int *, char *, char *, char *, int)); +static char *extract_dollar_brace_string __P((char *, int *, int, int)); +static int skip_matched_pair __P((const char *, int, int, int, int)); + +static char *pos_params __P((char *, int, int, int)); + +static unsigned char *mb_getcharlens __P((char *, int)); + +static char *remove_upattern __P((char *, char *, int)); +#if defined (HANDLE_MULTIBYTE) +static wchar_t *remove_wpattern __P((wchar_t *, size_t, wchar_t *, int)); +#endif +static char *remove_pattern __P((char *, char *, int)); + +static int match_upattern __P((char *, char *, int, char **, char **)); +#if defined (HANDLE_MULTIBYTE) +static int match_wpattern __P((wchar_t *, char **, size_t, wchar_t *, int, char **, char **)); +#endif +static int match_pattern __P((char *, char *, int, char **, char **)); +static int getpatspec __P((int, char *)); +static char *getpattern __P((char *, int, int)); +static char *variable_remove_pattern __P((char *, char *, int, int)); +static char *list_remove_pattern __P((WORD_LIST *, char *, int, int, int)); +static char *parameter_list_remove_pattern __P((int, char *, int, int)); +#ifdef ARRAY_VARS +static char *array_remove_pattern __P((SHELL_VAR *, char *, int, char *, int)); +#endif +static char *parameter_brace_remove_pattern __P((char *, char *, int, char *, int, int, int)); + +static char *process_substitute __P((char *, int)); + +static char *read_comsub __P((int, int, int *)); + +#ifdef ARRAY_VARS +static arrayind_t array_length_reference __P((char *)); +#endif + +static int valid_brace_expansion_word __P((char *, int)); +static int chk_atstar __P((char *, int, int *, int *)); +static int chk_arithsub __P((const char *, int)); + +static WORD_DESC *parameter_brace_expand_word __P((char *, int, int, int, arrayind_t *)); +static char *parameter_brace_find_indir __P((char *, int, int, int)); +static WORD_DESC *parameter_brace_expand_indir __P((char *, int, int, int *, int *)); +static WORD_DESC *parameter_brace_expand_rhs __P((char *, char *, int, int, int *, int *)); +static void parameter_brace_expand_error __P((char *, char *)); + +static int valid_length_expression __P((char *)); +static intmax_t parameter_brace_expand_length __P((char *)); + +static char *skiparith __P((char *, int)); +static int verify_substring_values __P((SHELL_VAR *, char *, char *, int, intmax_t *, intmax_t *)); +static int get_var_and_type __P((char *, char *, arrayind_t, int, int, SHELL_VAR **, char **)); +static char *mb_substring __P((char *, int, int)); +static char *parameter_brace_substring __P((char *, char *, int, char *, int, int)); + +static int shouldexp_replacement __P((char *)); + +static char *pos_params_pat_subst __P((char *, char *, char *, int)); + +static char *parameter_brace_patsub __P((char *, char *, int, char *, int, int)); + +static char *pos_params_casemod __P((char *, char *, int, int)); +static char *parameter_brace_casemod __P((char *, char *, int, int, char *, int, int)); + +static WORD_DESC *parameter_brace_expand __P((char *, int *, int, int, int *, int *)); +static WORD_DESC *param_expand __P((char *, int *, int, int *, int *, int *, int *, int)); + +static WORD_LIST *expand_word_internal __P((WORD_DESC *, int, int, int *, int *)); + +static WORD_LIST *word_list_split __P((WORD_LIST *)); + +static void exp_jump_to_top_level __P((int)); + +static WORD_LIST *separate_out_assignments __P((WORD_LIST *)); +static WORD_LIST *glob_expand_word_list __P((WORD_LIST *, int)); +#ifdef BRACE_EXPANSION +static WORD_LIST *brace_expand_word_list __P((WORD_LIST *, int)); +#endif +#if defined (ARRAY_VARS) +static int make_internal_declare __P((char *, char *)); +#endif +static WORD_LIST *shell_expand_word_list __P((WORD_LIST *, int)); +static WORD_LIST *expand_word_list_internal __P((WORD_LIST *, int)); + +/* **************************************************************** */ +/* */ +/* Utility Functions */ +/* */ +/* **************************************************************** */ + +#if defined (DEBUG) +void +dump_word_flags (flags) + int flags; +{ + int f; + + f = flags; + fprintf (stderr, "%d -> ", f); + if (f & W_ASSIGNASSOC) + { + f &= ~W_ASSIGNASSOC; + fprintf (stderr, "W_ASSIGNASSOC%s", f ? "|" : ""); + } + if (f & W_ASSIGNARRAY) + { + f &= ~W_ASSIGNARRAY; + fprintf (stderr, "W_ASSIGNARRAY%s", f ? "|" : ""); + } + if (f & W_HASCTLESC) + { + f &= ~W_HASCTLESC; + fprintf (stderr, "W_HASCTLESC%s", f ? "|" : ""); + } + if (f & W_NOPROCSUB) + { + f &= ~W_NOPROCSUB; + fprintf (stderr, "W_NOPROCSUB%s", f ? "|" : ""); + } + if (f & W_DQUOTE) + { + f &= ~W_DQUOTE; + fprintf (stderr, "W_DQUOTE%s", f ? "|" : ""); + } + if (f & W_HASQUOTEDNULL) + { + f &= ~W_HASQUOTEDNULL; + fprintf (stderr, "W_HASQUOTEDNULL%s", f ? "|" : ""); + } + if (f & W_ASSIGNARG) + { + f &= ~W_ASSIGNARG; + fprintf (stderr, "W_ASSIGNARG%s", f ? "|" : ""); + } + if (f & W_ASSNBLTIN) + { + f &= ~W_ASSNBLTIN; + fprintf (stderr, "W_ASSNBLTIN%s", f ? "|" : ""); + } + if (f & W_ASSNGLOBAL) + { + f &= ~W_ASSNGLOBAL; + fprintf (stderr, "W_ASSNGLOBAL%s", f ? "|" : ""); + } + if (f & W_ASSIGNINT) + { + f &= ~W_ASSIGNINT; + fprintf (stderr, "W_ASSIGNINT%s", f ? "|" : ""); + } + if (f & W_COMPASSIGN) + { + f &= ~W_COMPASSIGN; + fprintf (stderr, "W_COMPASSIGN%s", f ? "|" : ""); + } + if (f & W_NOEXPAND) + { + f &= ~W_NOEXPAND; + fprintf (stderr, "W_NOEXPAND%s", f ? "|" : ""); + } + if (f & W_ITILDE) + { + f &= ~W_ITILDE; + fprintf (stderr, "W_ITILDE%s", f ? "|" : ""); + } + if (f & W_NOTILDE) + { + f &= ~W_NOTILDE; + fprintf (stderr, "W_NOTILDE%s", f ? "|" : ""); + } + if (f & W_ASSIGNRHS) + { + f &= ~W_ASSIGNRHS; + fprintf (stderr, "W_ASSIGNRHS%s", f ? "|" : ""); + } + if (f & W_NOCOMSUB) + { + f &= ~W_NOCOMSUB; + fprintf (stderr, "W_NOCOMSUB%s", f ? "|" : ""); + } + if (f & W_DOLLARSTAR) + { + f &= ~W_DOLLARSTAR; + fprintf (stderr, "W_DOLLARSTAR%s", f ? "|" : ""); + } + if (f & W_DOLLARAT) + { + f &= ~W_DOLLARAT; + fprintf (stderr, "W_DOLLARAT%s", f ? "|" : ""); + } + if (f & W_TILDEEXP) + { + f &= ~W_TILDEEXP; + fprintf (stderr, "W_TILDEEXP%s", f ? "|" : ""); + } + if (f & W_NOSPLIT2) + { + f &= ~W_NOSPLIT2; + fprintf (stderr, "W_NOSPLIT2%s", f ? "|" : ""); + } + if (f & W_NOSPLIT) + { + f &= ~W_NOSPLIT; + fprintf (stderr, "W_NOSPLIT%s", f ? "|" : ""); + } + if (f & W_NOBRACE) + { + f &= ~W_NOBRACE; + fprintf (stderr, "W_NOBRACE%s", f ? "|" : ""); + } + if (f & W_NOGLOB) + { + f &= ~W_NOGLOB; + fprintf (stderr, "W_NOGLOB%s", f ? "|" : ""); + } + if (f & W_SPLITSPACE) + { + f &= ~W_SPLITSPACE; + fprintf (stderr, "W_SPLITSPACE%s", f ? "|" : ""); + } + if (f & W_ASSIGNMENT) + { + f &= ~W_ASSIGNMENT; + fprintf (stderr, "W_ASSIGNMENT%s", f ? "|" : ""); + } + if (f & W_QUOTED) + { + f &= ~W_QUOTED; + fprintf (stderr, "W_QUOTED%s", f ? "|" : ""); + } + if (f & W_HASDOLLAR) + { + f &= ~W_HASDOLLAR; + fprintf (stderr, "W_HASDOLLAR%s", f ? "|" : ""); + } + fprintf (stderr, "\n"); + fflush (stderr); +} +#endif + +#ifdef INCLUDE_UNUSED +static char * +quoted_substring (string, start, end) + char *string; + int start, end; +{ + register int len, l; + register char *result, *s, *r; + + len = end - start; + + /* Move to string[start], skipping quoted characters. */ + for (s = string, l = 0; *s && l < start; ) + { + if (*s == CTLESC) + { + s++; + continue; + } + l++; + if (*s == 0) + break; + } + + r = result = (char *)xmalloc (2*len + 1); /* save room for quotes */ + + /* Copy LEN characters, including quote characters. */ + s = string + l; + for (l = 0; l < len; s++) + { + if (*s == CTLESC) + *r++ = *s++; + *r++ = *s; + l++; + if (*s == 0) + break; + } + *r = '\0'; + return result; +} +#endif + +#ifdef INCLUDE_UNUSED +/* Return the length of S, skipping over quoted characters */ +static int +quoted_strlen (s) + char *s; +{ + register char *p; + int i; + + i = 0; + for (p = s; *p; p++) + { + if (*p == CTLESC) + { + p++; + if (*p == 0) + return (i + 1); + } + i++; + } + + return i; +} +#endif + +/* Find the first occurrence of character C in string S, obeying shell + quoting rules. If (FLAGS & ST_BACKSL) is non-zero, backslash-escaped + characters are skipped. If (FLAGS & ST_CTLESC) is non-zero, characters + escaped with CTLESC are skipped. */ +static char * +quoted_strchr (s, c, flags) + char *s; + int c, flags; +{ + register char *p; + + for (p = s; *p; p++) + { + if (((flags & ST_BACKSL) && *p == '\\') + || ((flags & ST_CTLESC) && *p == CTLESC)) + { + p++; + if (*p == '\0') + return ((char *)NULL); + continue; + } + else if (*p == c) + return p; + } + return ((char *)NULL); +} + +/* Return 1 if CHARACTER appears in an unquoted portion of + STRING. Return 0 otherwise. CHARACTER must be a single-byte character. */ +static int +unquoted_member (character, string) + int character; + char *string; +{ + size_t slen; + int sindex, c; + DECLARE_MBSTATE; + + slen = strlen (string); + sindex = 0; + while (c = string[sindex]) + { + if (c == character) + return (1); + + switch (c) + { + default: + ADVANCE_CHAR (string, slen, sindex); + break; + + case '\\': + sindex++; + if (string[sindex]) + ADVANCE_CHAR (string, slen, sindex); + break; + + case '\'': + sindex = skip_single_quoted (string, slen, ++sindex); + break; + + case '"': + sindex = skip_double_quoted (string, slen, ++sindex); + break; + } + } + return (0); +} + +/* Return 1 if SUBSTR appears in an unquoted portion of STRING. */ +static int +unquoted_substring (substr, string) + char *substr, *string; +{ + size_t slen; + int sindex, c, sublen; + DECLARE_MBSTATE; + + if (substr == 0 || *substr == '\0') + return (0); + + slen = strlen (string); + sublen = strlen (substr); + for (sindex = 0; c = string[sindex]; ) + { + if (STREQN (string + sindex, substr, sublen)) + return (1); + + switch (c) + { + case '\\': + sindex++; + if (string[sindex]) + ADVANCE_CHAR (string, slen, sindex); + break; + + case '\'': + sindex = skip_single_quoted (string, slen, ++sindex); + break; + + case '"': + sindex = skip_double_quoted (string, slen, ++sindex); + break; + + default: + ADVANCE_CHAR (string, slen, sindex); + break; + } + } + return (0); +} + +/* Most of the substitutions must be done in parallel. In order + to avoid using tons of unclear goto's, I have some functions + for manipulating malloc'ed strings. They all take INDX, a + pointer to an integer which is the offset into the string + where manipulation is taking place. They also take SIZE, a + pointer to an integer which is the current length of the + character array for this string. */ + +/* Append SOURCE to TARGET at INDEX. SIZE is the current amount + of space allocated to TARGET. SOURCE can be NULL, in which + case nothing happens. Gets rid of SOURCE by freeing it. + Returns TARGET in case the location has changed. */ +INLINE char * +sub_append_string (source, target, indx, size) + char *source, *target; + int *indx, *size; +{ + if (source) + { + int srclen, n; + + srclen = STRLEN (source); + if (srclen >= (int)(*size - *indx)) + { + n = srclen + *indx; + n = (n + DEFAULT_ARRAY_SIZE) - (n % DEFAULT_ARRAY_SIZE); + target = (char *)xrealloc (target, (*size = n)); + } + + FASTCOPY (source, target + *indx, srclen); + *indx += srclen; + target[*indx] = '\0'; + + free (source); + } + return (target); +} + +#if 0 +/* UNUSED */ +/* Append the textual representation of NUMBER to TARGET. + INDX and SIZE are as in SUB_APPEND_STRING. */ +char * +sub_append_number (number, target, indx, size) + intmax_t number; + int *indx, *size; + char *target; +{ + char *temp; + + temp = itos (number); + return (sub_append_string (temp, target, indx, size)); +} +#endif + +/* Extract a substring from STRING, starting at SINDEX and ending with + one of the characters in CHARLIST. Don't make the ending character + part of the string. Leave SINDEX pointing at the ending character. + Understand about backslashes in the string. If (flags & SX_VARNAME) + is non-zero, and array variables have been compiled into the shell, + everything between a `[' and a corresponding `]' is skipped over. + If (flags & SX_NOALLOC) is non-zero, don't return the substring, just + update SINDEX. If (flags & SX_REQMATCH) is non-zero, the string must + contain a closing character from CHARLIST. */ +static char * +string_extract (string, sindex, charlist, flags) + char *string; + int *sindex; + char *charlist; + int flags; +{ + register int c, i; + int found; + size_t slen; + char *temp; + DECLARE_MBSTATE; + + slen = (MB_CUR_MAX > 1) ? strlen (string + *sindex) + *sindex : 0; + i = *sindex; + found = 0; + while (c = string[i]) + { + if (c == '\\') + { + if (string[i + 1]) + i++; + else + break; + } +#if defined (ARRAY_VARS) + else if ((flags & SX_VARNAME) && c == '[') + { + int ni; + /* If this is an array subscript, skip over it and continue. */ + ni = skipsubscript (string, i, 0); + if (string[ni] == ']') + i = ni; + } +#endif + else if (MEMBER (c, charlist)) + { + found = 1; + break; + } + + ADVANCE_CHAR (string, slen, i); + } + + /* If we had to have a matching delimiter and didn't find one, return an + error and let the caller deal with it. */ + if ((flags & SX_REQMATCH) && found == 0) + { + *sindex = i; + return (&extract_string_error); + } + + temp = (flags & SX_NOALLOC) ? (char *)NULL : substring (string, *sindex, i); + *sindex = i; + + return (temp); +} + +/* Extract the contents of STRING as if it is enclosed in double quotes. + SINDEX, when passed in, is the offset of the character immediately + following the opening double quote; on exit, SINDEX is left pointing after + the closing double quote. If STRIPDQ is non-zero, unquoted double + quotes are stripped and the string is terminated by a null byte. + Backslashes between the embedded double quotes are processed. If STRIPDQ + is zero, an unquoted `"' terminates the string. */ +static char * +string_extract_double_quoted (string, sindex, stripdq) + char *string; + int *sindex, stripdq; +{ + size_t slen; + char *send; + int j, i, t; + unsigned char c; + char *temp, *ret; /* The new string we return. */ + int pass_next, backquote, si; /* State variables for the machine. */ + int dquote; + DECLARE_MBSTATE; + + slen = strlen (string + *sindex) + *sindex; + send = string + slen; + + pass_next = backquote = dquote = 0; + temp = (char *)xmalloc (1 + slen - *sindex); + + j = 0; + i = *sindex; + while (c = string[i]) + { + /* Process a character that was quoted by a backslash. */ + if (pass_next) + { + /* XXX - take another look at this in light of Interp 221 */ + /* Posix.2 sez: + + ``The backslash shall retain its special meaning as an escape + character only when followed by one of the characters: + $ ` " \ ''. + + If STRIPDQ is zero, we handle the double quotes here and let + expand_word_internal handle the rest. If STRIPDQ is non-zero, + we have already been through one round of backslash stripping, + and want to strip these backslashes only if DQUOTE is non-zero, + indicating that we are inside an embedded double-quoted string. */ + + /* If we are in an embedded quoted string, then don't strip + backslashes before characters for which the backslash + retains its special meaning, but remove backslashes in + front of other characters. If we are not in an + embedded quoted string, don't strip backslashes at all. + This mess is necessary because the string was already + surrounded by double quotes (and sh has some really weird + quoting rules). + The returned string will be run through expansion as if + it were double-quoted. */ + if ((stripdq == 0 && c != '"') || + (stripdq && ((dquote && (sh_syntaxtab[c] & CBSDQUOTE)) || dquote == 0))) + temp[j++] = '\\'; + pass_next = 0; + +add_one_character: + COPY_CHAR_I (temp, j, string, send, i); + continue; + } + + /* A backslash protects the next character. The code just above + handles preserving the backslash in front of any character but + a double quote. */ + if (c == '\\') + { + pass_next++; + i++; + continue; + } + + /* Inside backquotes, ``the portion of the quoted string from the + initial backquote and the characters up to the next backquote + that is not preceded by a backslash, having escape characters + removed, defines that command''. */ + if (backquote) + { + if (c == '`') + backquote = 0; + temp[j++] = c; + i++; + continue; + } + + if (c == '`') + { + temp[j++] = c; + backquote++; + i++; + continue; + } + + /* Pass everything between `$(' and the matching `)' or a quoted + ${ ... } pair through according to the Posix.2 specification. */ + if (c == '$' && ((string[i + 1] == LPAREN) || (string[i + 1] == LBRACE))) + { + int free_ret = 1; + + si = i + 2; + if (string[i + 1] == LPAREN) + ret = extract_command_subst (string, &si, 0); + else + ret = extract_dollar_brace_string (string, &si, Q_DOUBLE_QUOTES, 0); + + temp[j++] = '$'; + temp[j++] = string[i + 1]; + + /* Just paranoia; ret will not be 0 unless no_longjmp_on_fatal_error + is set. */ + if (ret == 0 && no_longjmp_on_fatal_error) + { + free_ret = 0; + ret = string + i + 2; + } + + for (t = 0; ret[t]; t++, j++) + temp[j] = ret[t]; + temp[j] = string[si]; + + if (string[si]) + { + j++; + i = si + 1; + } + else + i = si; + + if (free_ret) + free (ret); + continue; + } + + /* Add any character but a double quote to the quoted string we're + accumulating. */ + if (c != '"') + goto add_one_character; + + /* c == '"' */ + if (stripdq) + { + dquote ^= 1; + i++; + continue; + } + + break; + } + temp[j] = '\0'; + + /* Point to after the closing quote. */ + if (c) + i++; + *sindex = i; + + return (temp); +} + +/* This should really be another option to string_extract_double_quoted. */ +static int +skip_double_quoted (string, slen, sind) + char *string; + size_t slen; + int sind; +{ + int c, i; + char *ret; + int pass_next, backquote, si; + DECLARE_MBSTATE; + + pass_next = backquote = 0; + i = sind; + while (c = string[i]) + { + if (pass_next) + { + pass_next = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next++; + i++; + continue; + } + else if (backquote) + { + if (c == '`') + backquote = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '`') + { + backquote++; + i++; + continue; + } + else if (c == '$' && ((string[i + 1] == LPAREN) || (string[i + 1] == LBRACE))) + { + si = i + 2; + if (string[i + 1] == LPAREN) + ret = extract_command_subst (string, &si, SX_NOALLOC); + else + ret = extract_dollar_brace_string (string, &si, Q_DOUBLE_QUOTES, SX_NOALLOC); + + i = si + 1; + continue; + } + else if (c != '"') + { + ADVANCE_CHAR (string, slen, i); + continue; + } + else + break; + } + + if (c) + i++; + + return (i); +} + +/* Extract the contents of STRING as if it is enclosed in single quotes. + SINDEX, when passed in, is the offset of the character immediately + following the opening single quote; on exit, SINDEX is left pointing after + the closing single quote. */ +static inline char * +string_extract_single_quoted (string, sindex) + char *string; + int *sindex; +{ + register int i; + size_t slen; + char *t; + DECLARE_MBSTATE; + + /* Don't need slen for ADVANCE_CHAR unless multibyte chars possible. */ + slen = (MB_CUR_MAX > 1) ? strlen (string + *sindex) + *sindex : 0; + i = *sindex; + while (string[i] && string[i] != '\'') + ADVANCE_CHAR (string, slen, i); + + t = substring (string, *sindex, i); + + if (string[i]) + i++; + *sindex = i; + + return (t); +} + +static inline int +skip_single_quoted (string, slen, sind) + const char *string; + size_t slen; + int sind; +{ + register int c; + DECLARE_MBSTATE; + + c = sind; + while (string[c] && string[c] != '\'') + ADVANCE_CHAR (string, slen, c); + + if (string[c]) + c++; + return c; +} + +/* Just like string_extract, but doesn't hack backslashes or any of + that other stuff. Obeys CTLESC quoting. Used to do splitting on $IFS. */ +static char * +string_extract_verbatim (string, slen, sindex, charlist, flags) + char *string; + size_t slen; + int *sindex; + char *charlist; + int flags; +{ + register int i; +#if defined (HANDLE_MULTIBYTE) + size_t clen; + wchar_t *wcharlist; +#endif + int c; + char *temp; + DECLARE_MBSTATE; + + if (charlist[0] == '\'' && charlist[1] == '\0') + { + temp = string_extract_single_quoted (string, sindex); + --*sindex; /* leave *sindex at separator character */ + return temp; + } + + i = *sindex; +#if 0 + /* See how the MBLEN and ADVANCE_CHAR macros work to understand why we need + this only if MB_CUR_MAX > 1. */ + slen = (MB_CUR_MAX > 1) ? strlen (string + *sindex) + *sindex : 1; +#endif +#if defined (HANDLE_MULTIBYTE) + clen = strlen (charlist); + wcharlist = 0; +#endif + while (c = string[i]) + { +#if defined (HANDLE_MULTIBYTE) + size_t mblength; +#endif + if ((flags & SX_NOCTLESC) == 0 && c == CTLESC) + { + i += 2; + continue; + } + /* Even if flags contains SX_NOCTLESC, we let CTLESC quoting CTLNUL + through, to protect the CTLNULs from later calls to + remove_quoted_nulls. */ + else if ((flags & SX_NOESCCTLNUL) == 0 && c == CTLESC && string[i+1] == CTLNUL) + { + i += 2; + continue; + } + +#if defined (HANDLE_MULTIBYTE) + mblength = MBLEN (string + i, slen - i); + if (mblength > 1) + { + wchar_t wc; + mblength = mbtowc (&wc, string + i, slen - i); + if (MB_INVALIDCH (mblength)) + { + if (MEMBER (c, charlist)) + break; + } + else + { + if (wcharlist == 0) + { + size_t len; + len = mbstowcs (wcharlist, charlist, 0); + if (len == -1) + len = 0; + wcharlist = (wchar_t *)xmalloc (sizeof (wchar_t) * (len + 1)); + mbstowcs (wcharlist, charlist, len + 1); + } + + if (wcschr (wcharlist, wc)) + break; + } + } + else +#endif + if (MEMBER (c, charlist)) + break; + + ADVANCE_CHAR (string, slen, i); + } + +#if defined (HANDLE_MULTIBYTE) + FREE (wcharlist); +#endif + + temp = substring (string, *sindex, i); + *sindex = i; + + return (temp); +} + +/* Extract the $( construct in STRING, and return a new string. + Start extracting at (SINDEX) as if we had just seen "$(". + Make (SINDEX) get the position of the matching ")". ) + XFLAGS is additional flags to pass to other extraction functions. */ +char * +extract_command_subst (string, sindex, xflags) + char *string; + int *sindex; + int xflags; +{ + if (string[*sindex] == LPAREN) + return (extract_delimited_string (string, sindex, "$(", "(", ")", xflags|SX_COMMAND)); /*)*/ + else + { + xflags |= (no_longjmp_on_fatal_error ? SX_NOLONGJMP : 0); + return (xparse_dolparen (string, string+*sindex, sindex, xflags)); + } +} + +/* Extract the $[ construct in STRING, and return a new string. (]) + Start extracting at (SINDEX) as if we had just seen "$[". + Make (SINDEX) get the position of the matching "]". */ +char * +extract_arithmetic_subst (string, sindex) + char *string; + int *sindex; +{ + return (extract_delimited_string (string, sindex, "$[", "[", "]", 0)); /*]*/ +} + +#if defined (PROCESS_SUBSTITUTION) +/* Extract the <( or >( construct in STRING, and return a new string. + Start extracting at (SINDEX) as if we had just seen "<(". + Make (SINDEX) get the position of the matching ")". */ /*))*/ +char * +extract_process_subst (string, starter, sindex, xflags) + char *string; + char *starter; + int *sindex; + int xflags; +{ +#if 0 + return (extract_delimited_string (string, sindex, starter, "(", ")", SX_COMMAND)); +#else + xflags |= (no_longjmp_on_fatal_error ? SX_NOLONGJMP : 0); + return (xparse_dolparen (string, string+*sindex, sindex, xflags)); +#endif +} +#endif /* PROCESS_SUBSTITUTION */ + +#if defined (ARRAY_VARS) +/* This can be fooled by unquoted right parens in the passed string. If + each caller verifies that the last character in STRING is a right paren, + we don't even need to call extract_delimited_string. */ +char * +extract_array_assignment_list (string, sindex) + char *string; + int *sindex; +{ + int slen; + char *ret; + + slen = strlen (string); /* ( */ + if (string[slen - 1] == ')') + { + ret = substring (string, *sindex, slen - 1); + *sindex = slen - 1; + return ret; + } + return 0; +} +#endif + +/* Extract and create a new string from the contents of STRING, a + character string delimited with OPENER and CLOSER. SINDEX is + the address of an int describing the current offset in STRING; + it should point to just after the first OPENER found. On exit, + SINDEX gets the position of the last character of the matching CLOSER. + If OPENER is more than a single character, ALT_OPENER, if non-null, + contains a character string that can also match CLOSER and thus + needs to be skipped. */ +static char * +extract_delimited_string (string, sindex, opener, alt_opener, closer, flags) + char *string; + int *sindex; + char *opener, *alt_opener, *closer; + int flags; +{ + int i, c, si; + size_t slen; + char *t, *result; + int pass_character, nesting_level, in_comment; + int len_closer, len_opener, len_alt_opener; + DECLARE_MBSTATE; + + slen = strlen (string + *sindex) + *sindex; + len_opener = STRLEN (opener); + len_alt_opener = STRLEN (alt_opener); + len_closer = STRLEN (closer); + + pass_character = in_comment = 0; + + nesting_level = 1; + i = *sindex; + + while (nesting_level) + { + c = string[i]; + + if (c == 0) + break; + + if (in_comment) + { + if (c == '\n') + in_comment = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + + if (pass_character) /* previous char was backslash */ + { + pass_character = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + + /* Not exactly right yet; should handle shell metacharacters and + multibyte characters, too. See COMMENT_BEGIN define in parse.y */ + if ((flags & SX_COMMAND) && c == '#' && (i == 0 || string[i - 1] == '\n' || shellblank (string[i - 1]))) + { + in_comment = 1; + ADVANCE_CHAR (string, slen, i); + continue; + } + + if (c == CTLESC || c == '\\') + { + pass_character++; + i++; + continue; + } + + /* Process a nested command substitution, but only if we're parsing an + arithmetic substitution. */ + if ((flags & SX_COMMAND) && string[i] == '$' && string[i+1] == LPAREN) + { + si = i + 2; + t = extract_command_subst (string, &si, flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Process a nested OPENER. */ + if (STREQN (string + i, opener, len_opener)) + { + si = i + len_opener; + t = extract_delimited_string (string, &si, opener, alt_opener, closer, flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Process a nested ALT_OPENER */ + if (len_alt_opener && STREQN (string + i, alt_opener, len_alt_opener)) + { + si = i + len_alt_opener; + t = extract_delimited_string (string, &si, alt_opener, alt_opener, closer, flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* If the current substring terminates the delimited string, decrement + the nesting level. */ + if (STREQN (string + i, closer, len_closer)) + { + i += len_closer - 1; /* move to last byte of the closer */ + nesting_level--; + if (nesting_level == 0) + break; + } + + /* Pass old-style command substitution through verbatim. */ + if (c == '`') + { + si = i + 1; + t = string_extract (string, &si, "`", flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Pass single-quoted and double-quoted strings through verbatim. */ + if (c == '\'' || c == '"') + { + si = i + 1; + i = (c == '\'') ? skip_single_quoted (string, slen, si) + : skip_double_quoted (string, slen, si); + continue; + } + + /* move past this character, which was not special. */ + ADVANCE_CHAR (string, slen, i); + } + + if (c == 0 && nesting_level) + { + if (no_longjmp_on_fatal_error == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("bad substitution: no closing `%s' in %s"), closer, string); + exp_jump_to_top_level (DISCARD); + } + else + { + *sindex = i; + return (char *)NULL; + } + } + + si = i - *sindex - len_closer + 1; + if (flags & SX_NOALLOC) + result = (char *)NULL; + else + { + result = (char *)xmalloc (1 + si); + strncpy (result, string + *sindex, si); + result[si] = '\0'; + } + *sindex = i; + + return (result); +} + +/* Extract a parameter expansion expression within ${ and } from STRING. + Obey the Posix.2 rules for finding the ending `}': count braces while + skipping over enclosed quoted strings and command substitutions. + SINDEX is the address of an int describing the current offset in STRING; + it should point to just after the first `{' found. On exit, SINDEX + gets the position of the matching `}'. QUOTED is non-zero if this + occurs inside double quotes. */ +/* XXX -- this is very similar to extract_delimited_string -- XXX */ +static char * +extract_dollar_brace_string (string, sindex, quoted, flags) + char *string; + int *sindex, quoted, flags; +{ + register int i, c; + size_t slen; + int pass_character, nesting_level, si, dolbrace_state; + char *result, *t; + DECLARE_MBSTATE; + + pass_character = 0; + nesting_level = 1; + slen = strlen (string + *sindex) + *sindex; + + /* The handling of dolbrace_state needs to agree with the code in parse.y: + parse_matched_pair(). The different initial value is to handle the + case where this function is called to parse the word in + ${param op word} (SX_WORD). */ + dolbrace_state = (flags & SX_WORD) ? DOLBRACE_WORD : DOLBRACE_PARAM; + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && (flags & SX_POSIXEXP)) + dolbrace_state = DOLBRACE_QUOTE; + + i = *sindex; + while (c = string[i]) + { + if (pass_character) + { + pass_character = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + + /* CTLESCs and backslashes quote the next character. */ + if (c == CTLESC || c == '\\') + { + pass_character++; + i++; + continue; + } + + if (string[i] == '$' && string[i+1] == LBRACE) + { + nesting_level++; + i += 2; + continue; + } + + if (c == RBRACE) + { + nesting_level--; + if (nesting_level == 0) + break; + i++; + continue; + } + + /* Pass the contents of old-style command substitutions through + verbatim. */ + if (c == '`') + { + si = i + 1; + t = string_extract (string, &si, "`", flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Pass the contents of new-style command substitutions and + arithmetic substitutions through verbatim. */ + if (string[i] == '$' && string[i+1] == LPAREN) + { + si = i + 2; + t = extract_command_subst (string, &si, flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Pass the contents of double-quoted strings through verbatim. */ + if (c == '"') + { + si = i + 1; + i = skip_double_quoted (string, slen, si); + /* skip_XXX_quoted leaves index one past close quote */ + continue; + } + + if (c == '\'') + { +/*itrace("extract_dollar_brace_string: c == single quote flags = %d quoted = %d dolbrace_state = %d", flags, quoted, dolbrace_state);*/ + if (posixly_correct && shell_compatibility_level > 42 && dolbrace_state != DOLBRACE_QUOTE && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ADVANCE_CHAR (string, slen, i); + else + { + si = i + 1; + i = skip_single_quoted (string, slen, si); + } + + continue; + } + + /* move past this character, which was not special. */ + ADVANCE_CHAR (string, slen, i); + + /* This logic must agree with parse.y:parse_matched_pair, since they + share the same defines. */ + if (dolbrace_state == DOLBRACE_PARAM && c == '%' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if (dolbrace_state == DOLBRACE_PARAM && c == '#' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if (dolbrace_state == DOLBRACE_PARAM && c == '/' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE2; /* XXX */ + else if (dolbrace_state == DOLBRACE_PARAM && c == '^' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if (dolbrace_state == DOLBRACE_PARAM && c == ',' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if (dolbrace_state == DOLBRACE_PARAM && strchr ("#%^,~:-=?+/", c) != 0) + dolbrace_state = DOLBRACE_OP; + else if (dolbrace_state == DOLBRACE_OP && strchr ("#%^,~:-=?+/", c) == 0) + dolbrace_state = DOLBRACE_WORD; + } + + if (c == 0 && nesting_level) + { + if (no_longjmp_on_fatal_error == 0) + { /* { */ + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("bad substitution: no closing `%s' in %s"), "}", string); + exp_jump_to_top_level (DISCARD); + } + else + { + *sindex = i; + return ((char *)NULL); + } + } + + result = (flags & SX_NOALLOC) ? (char *)NULL : substring (string, *sindex, i); + *sindex = i; + + return (result); +} + +/* Remove backslashes which are quoting backquotes from STRING. Modifies + STRING, and returns a pointer to it. */ +char * +de_backslash (string) + char *string; +{ + register size_t slen; + register int i, j, prev_i; + DECLARE_MBSTATE; + + slen = strlen (string); + i = j = 0; + + /* Loop copying string[i] to string[j], i >= j. */ + while (i < slen) + { + if (string[i] == '\\' && (string[i + 1] == '`' || string[i + 1] == '\\' || + string[i + 1] == '$')) + i++; + prev_i = i; + ADVANCE_CHAR (string, slen, i); + if (j < prev_i) + do string[j++] = string[prev_i++]; while (prev_i < i); + else + j = i; + } + string[j] = '\0'; + + return (string); +} + +#if 0 +/*UNUSED*/ +/* Replace instances of \! in a string with !. */ +void +unquote_bang (string) + char *string; +{ + register int i, j; + register char *temp; + + temp = (char *)xmalloc (1 + strlen (string)); + + for (i = 0, j = 0; (temp[j] = string[i]); i++, j++) + { + if (string[i] == '\\' && string[i + 1] == '!') + { + temp[j] = '!'; + i++; + } + } + strcpy (string, temp); + free (temp); +} +#endif + +#define CQ_RETURN(x) do { no_longjmp_on_fatal_error = 0; return (x); } while (0) + +/* This function assumes s[i] == open; returns with s[ret] == close; used to + parse array subscripts. FLAGS & 1 means to not attempt to skip over + matched pairs of quotes or backquotes, or skip word expansions; it is + intended to be used after expansion has been performed and during final + assignment parsing (see arrayfunc.c:assign_compound_array_list()). */ +static int +skip_matched_pair (string, start, open, close, flags) + const char *string; + int start, open, close, flags; +{ + int i, pass_next, backq, si, c, count; + size_t slen; + char *temp, *ss; + DECLARE_MBSTATE; + + slen = strlen (string + start) + start; + no_longjmp_on_fatal_error = 1; + + i = start + 1; /* skip over leading bracket */ + count = 1; + pass_next = backq = 0; + ss = (char *)string; + while (c = string[i]) + { + if (pass_next) + { + pass_next = 0; + if (c == 0) + CQ_RETURN(i); + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (backq) + { + if (c == '`') + backq = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if ((flags & 1) == 0 && c == '`') + { + backq = 1; + i++; + continue; + } + else if ((flags & 1) == 0 && c == open) + { + count++; + i++; + continue; + } + else if (c == close) + { + count--; + if (count == 0) + break; + i++; + continue; + } + else if ((flags & 1) == 0 && (c == '\'' || c == '"')) + { + i = (c == '\'') ? skip_single_quoted (ss, slen, ++i) + : skip_double_quoted (ss, slen, ++i); + /* no increment, the skip functions increment past the closing quote. */ + } + else if ((flags&1) == 0 && c == '$' && (string[i+1] == LPAREN || string[i+1] == LBRACE)) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + + if (string[i+1] == LPAREN) + temp = extract_delimited_string (ss, &si, "$(", "(", ")", SX_NOALLOC|SX_COMMAND); /* ) */ + else + temp = extract_dollar_brace_string (ss, &si, 0, SX_NOALLOC); + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } + else + ADVANCE_CHAR (string, slen, i); + } + + CQ_RETURN(i); +} + +#if defined (ARRAY_VARS) +int +skipsubscript (string, start, flags) + const char *string; + int start, flags; +{ + return (skip_matched_pair (string, start, '[', ']', flags)); +} +#endif + +/* Skip characters in STRING until we find a character in DELIMS, and return + the index of that character. START is the index into string at which we + begin. This is similar in spirit to strpbrk, but it returns an index into + STRING and takes a starting index. This little piece of code knows quite + a lot of shell syntax. It's very similar to skip_double_quoted and other + functions of that ilk. */ +int +skip_to_delim (string, start, delims, flags) + char *string; + int start; + char *delims; + int flags; +{ + int i, pass_next, backq, si, c, invert, skipquote, skipcmd; + size_t slen; + char *temp, open[3]; + DECLARE_MBSTATE; + + slen = strlen (string + start) + start; + if (flags & SD_NOJMP) + no_longjmp_on_fatal_error = 1; + invert = (flags & SD_INVERT); + skipcmd = (flags & SD_NOSKIPCMD) == 0; + + i = start; + pass_next = backq = 0; + while (c = string[i]) + { + /* If this is non-zero, we should not let quote characters be delimiters + and the current character is a single or double quote. We should not + test whether or not it's a delimiter until after we skip single- or + double-quoted strings. */ + skipquote = ((flags & SD_NOQUOTEDELIM) && (c == '\'' || c =='"')); + if (pass_next) + { + pass_next = 0; + if (c == 0) + CQ_RETURN(i); + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (backq) + { + if (c == '`') + backq = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '`') + { + backq = 1; + i++; + continue; + } + else if (skipquote == 0 && invert == 0 && member (c, delims)) + break; + else if (c == '\'' || c == '"') + { + i = (c == '\'') ? skip_single_quoted (string, slen, ++i) + : skip_double_quoted (string, slen, ++i); + /* no increment, the skip functions increment past the closing quote. */ + } + else if (c == '$' && ((skipcmd && string[i+1] == LPAREN) || string[i+1] == LBRACE)) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + + if (string[i+1] == LPAREN) + temp = extract_delimited_string (string, &si, "$(", "(", ")", SX_NOALLOC|SX_COMMAND); /* ) */ + else + temp = extract_dollar_brace_string (string, &si, 0, SX_NOALLOC); + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } +#if defined (PROCESS_SUBSTITUTION) + else if (skipcmd && (c == '<' || c == '>') && string[i+1] == LPAREN) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + temp = extract_process_subst (string, (c == '<') ? "<(" : ">(", &si, 0); + free (temp); /* no SX_ALLOC here */ + i = si; + if (string[i] == '\0') + break; + i++; + continue; + } +#endif /* PROCESS_SUBSTITUTION */ +#if defined (EXTENDED_GLOB) + else if ((flags & SD_EXTGLOB) && extended_glob && string[i+1] == LPAREN && member (c, "?*+!@")) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + + open[0] = c; + open[1] = LPAREN; + open[2] = '\0'; + temp = extract_delimited_string (string, &si, open, "(", ")", SX_NOALLOC); /* ) */ + + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } +#endif + else if ((flags & SD_GLOB) && c == LBRACK) + { + si = i + 1; + if (string[si] == '\0') + CQ_RETURN(si); + + temp = extract_delimited_string (string, &si, "[", "[", "]", SX_NOALLOC); /* ] */ + + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } + else if ((skipquote || invert) && (member (c, delims) == 0)) + break; + else + ADVANCE_CHAR (string, slen, i); + } + + CQ_RETURN(i); +} + +#if defined (READLINE) +/* Return 1 if the portion of STRING ending at EINDEX is quoted (there is + an unclosed quoted string), or if the character at EINDEX is quoted + by a backslash. NO_LONGJMP_ON_FATAL_ERROR is used to flag that the various + single and double-quoted string parsing functions should not return an + error if there are unclosed quotes or braces. The characters that this + recognizes need to be the same as the contents of + rl_completer_quote_characters. */ + +int +char_is_quoted (string, eindex) + char *string; + int eindex; +{ + int i, pass_next, c; + size_t slen; + DECLARE_MBSTATE; + + slen = strlen (string); + no_longjmp_on_fatal_error = 1; + i = pass_next = 0; + while (i <= eindex) + { + c = string[i]; + + if (pass_next) + { + pass_next = 0; + if (i >= eindex) /* XXX was if (i >= eindex - 1) */ + CQ_RETURN(1); + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (c == '\'' || c == '"') + { + i = (c == '\'') ? skip_single_quoted (string, slen, ++i) + : skip_double_quoted (string, slen, ++i); + if (i > eindex) + CQ_RETURN(1); + /* no increment, the skip_xxx functions go one past end */ + } + else + ADVANCE_CHAR (string, slen, i); + } + + CQ_RETURN(0); +} + +int +unclosed_pair (string, eindex, openstr) + char *string; + int eindex; + char *openstr; +{ + int i, pass_next, openc, olen; + size_t slen; + DECLARE_MBSTATE; + + slen = strlen (string); + olen = strlen (openstr); + i = pass_next = openc = 0; + while (i <= eindex) + { + if (pass_next) + { + pass_next = 0; + if (i >= eindex) /* XXX was if (i >= eindex - 1) */ + return 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (string[i] == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (STREQN (string + i, openstr, olen)) + { + openc = 1 - openc; + i += olen; + } + else if (string[i] == '\'' || string[i] == '"') + { + i = (string[i] == '\'') ? skip_single_quoted (string, slen, i) + : skip_double_quoted (string, slen, i); + if (i > eindex) + return 0; + } + else + ADVANCE_CHAR (string, slen, i); + } + return (openc); +} + +/* Split STRING (length SLEN) at DELIMS, and return a WORD_LIST with the + individual words. If DELIMS is NULL, the current value of $IFS is used + to split the string, and the function follows the shell field splitting + rules. SENTINEL is an index to look for. NWP, if non-NULL, + gets the number of words in the returned list. CWP, if non-NULL, gets + the index of the word containing SENTINEL. Non-whitespace chars in + DELIMS delimit separate fields. */ +WORD_LIST * +split_at_delims (string, slen, delims, sentinel, flags, nwp, cwp) + char *string; + int slen; + char *delims; + int sentinel, flags; + int *nwp, *cwp; +{ + int ts, te, i, nw, cw, ifs_split, dflags; + char *token, *d, *d2; + WORD_LIST *ret, *tl; + + if (string == 0 || *string == '\0') + { + if (nwp) + *nwp = 0; + if (cwp) + *cwp = 0; + return ((WORD_LIST *)NULL); + } + + d = (delims == 0) ? ifs_value : delims; + ifs_split = delims == 0; + + /* Make d2 the non-whitespace characters in delims */ + d2 = 0; + if (delims) + { + size_t slength; +#if defined (HANDLE_MULTIBYTE) + size_t mblength = 1; +#endif + DECLARE_MBSTATE; + + slength = strlen (delims); + d2 = (char *)xmalloc (slength + 1); + i = ts = 0; + while (delims[i]) + { +#if defined (HANDLE_MULTIBYTE) + mbstate_t state_bak; + state_bak = state; + mblength = MBRLEN (delims + i, slength, &state); + if (MB_INVALIDCH (mblength)) + state = state_bak; + else if (mblength > 1) + { + memcpy (d2 + ts, delims + i, mblength); + ts += mblength; + i += mblength; + slength -= mblength; + continue; + } +#endif + if (whitespace (delims[i]) == 0) + d2[ts++] = delims[i]; + + i++; + slength--; + } + d2[ts] = '\0'; + } + + ret = (WORD_LIST *)NULL; + + /* Remove sequences of whitespace characters at the start of the string, as + long as those characters are delimiters. */ + for (i = 0; member (string[i], d) && spctabnl (string[i]); i++) + ; + if (string[i] == '\0') + return (ret); + + ts = i; + nw = 0; + cw = -1; + dflags = flags|SD_NOJMP; + while (1) + { + te = skip_to_delim (string, ts, d, dflags); + + /* If we have a non-whitespace delimiter character, use it to make a + separate field. This is just about what $IFS splitting does and + is closer to the behavior of the shell parser. */ + if (ts == te && d2 && member (string[ts], d2)) + { + te = ts + 1; + /* If we're using IFS splitting, the non-whitespace delimiter char + and any additional IFS whitespace delimits a field. */ + if (ifs_split) + while (member (string[te], d) && spctabnl (string[te])) + te++; + else + while (member (string[te], d2)) + te++; + } + + token = substring (string, ts, te); + + ret = add_string_to_list (token, ret); + free (token); + nw++; + + if (sentinel >= ts && sentinel <= te) + cw = nw; + + /* If the cursor is at whitespace just before word start, set the + sentinel word to the current word. */ + if (cwp && cw == -1 && sentinel == ts-1) + cw = nw; + + /* If the cursor is at whitespace between two words, make a new, empty + word, add it before (well, after, since the list is in reverse order) + the word we just added, and set the current word to that one. */ + if (cwp && cw == -1 && sentinel < ts) + { + tl = make_word_list (make_word (""), ret->next); + ret->next = tl; + cw = nw; + nw++; + } + + if (string[te] == 0) + break; + + i = te; + while (member (string[i], d) && (ifs_split || spctabnl(string[i]))) + i++; + + if (string[i]) + ts = i; + else + break; + } + + /* Special case for SENTINEL at the end of STRING. If we haven't found + the word containing SENTINEL yet, and the index we're looking for is at + the end of STRING (or past the end of the previously-found token, + possible if the end of the line is composed solely of IFS whitespace) + add an additional null argument and set the current word pointer to that. */ + if (cwp && cw == -1 && (sentinel >= slen || sentinel >= te)) + { + if (whitespace (string[sentinel - 1])) + { + token = ""; + ret = add_string_to_list (token, ret); + nw++; + } + cw = nw; + } + + if (nwp) + *nwp = nw; + if (cwp) + *cwp = cw; + + FREE (d2); + + return (REVERSE_LIST (ret, WORD_LIST *)); +} +#endif /* READLINE */ + +#if 0 +/* UNUSED */ +/* Extract the name of the variable to bind to from the assignment string. */ +char * +assignment_name (string) + char *string; +{ + int offset; + char *temp; + + offset = assignment (string, 0); + if (offset == 0) + return (char *)NULL; + temp = substring (string, 0, offset); + return (temp); +} +#endif + +/* **************************************************************** */ +/* */ +/* Functions to convert strings to WORD_LISTs and vice versa */ +/* */ +/* **************************************************************** */ + +/* Return a single string of all the words in LIST. SEP is the separator + to put between individual elements of LIST in the output string. */ +char * +string_list_internal (list, sep) + WORD_LIST *list; + char *sep; +{ + register WORD_LIST *t; + char *result, *r; + int word_len, sep_len, result_size; + + if (list == 0) + return ((char *)NULL); + + /* Short-circuit quickly if we don't need to separate anything. */ + if (list->next == 0) + return (savestring (list->word->word)); + + /* This is nearly always called with either sep[0] == 0 or sep[1] == 0. */ + sep_len = STRLEN (sep); + result_size = 0; + + for (t = list; t; t = t->next) + { + if (t != list) + result_size += sep_len; + result_size += strlen (t->word->word); + } + + r = result = (char *)xmalloc (result_size + 1); + + for (t = list; t; t = t->next) + { + if (t != list && sep_len) + { + if (sep_len > 1) + { + FASTCOPY (sep, r, sep_len); + r += sep_len; + } + else + *r++ = sep[0]; + } + + word_len = strlen (t->word->word); + FASTCOPY (t->word->word, r, word_len); + r += word_len; + } + + *r = '\0'; + return (result); +} + +/* Return a single string of all the words present in LIST, separating + each word with a space. */ +char * +string_list (list) + WORD_LIST *list; +{ + return (string_list_internal (list, " ")); +} + +/* An external interface that can be used by the rest of the shell to + obtain a string containing the first character in $IFS. Handles all + the multibyte complications. If LENP is non-null, it is set to the + length of the returned string. */ +char * +ifs_firstchar (lenp) + int *lenp; +{ + char *ret; + int len; + + ret = xmalloc (MB_LEN_MAX + 1); +#if defined (HANDLE_MULTIBYTE) + if (ifs_firstc_len == 1) + { + ret[0] = ifs_firstc[0]; + ret[1] = '\0'; + len = ret[0] ? 1 : 0; + } + else + { + memcpy (ret, ifs_firstc, ifs_firstc_len); + ret[len = ifs_firstc_len] = '\0'; + } +#else + ret[0] = ifs_firstc; + ret[1] = '\0'; + len = ret[0] ? 0 : 1; +#endif + + if (lenp) + *lenp = len; + + return ret; +} + +/* Return a single string of all the words present in LIST, obeying the + quoting rules for "$*", to wit: (P1003.2, draft 11, 3.5.2) "If the + expansion [of $*] appears within a double quoted string, it expands + to a single field with the value of each parameter separated by the + first character of the IFS variable, or by a if IFS is unset." */ +char * +string_list_dollar_star (list) + WORD_LIST *list; +{ + char *ret; +#if defined (HANDLE_MULTIBYTE) +# if defined (__GNUC__) + char sep[MB_CUR_MAX + 1]; +# else + char *sep = 0; +# endif +#else + char sep[2]; +#endif + +#if defined (HANDLE_MULTIBYTE) +# if !defined (__GNUC__) + sep = (char *)xmalloc (MB_CUR_MAX + 1); +# endif /* !__GNUC__ */ + if (ifs_firstc_len == 1) + { + sep[0] = ifs_firstc[0]; + sep[1] = '\0'; + } + else + { + memcpy (sep, ifs_firstc, ifs_firstc_len); + sep[ifs_firstc_len] = '\0'; + } +#else + sep[0] = ifs_firstc; + sep[1] = '\0'; +#endif + + ret = string_list_internal (list, sep); +#if defined (HANDLE_MULTIBYTE) && !defined (__GNUC__) + free (sep); +#endif + return ret; +} + +/* Turn $@ into a string. If (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + is non-zero, the $@ appears within double quotes, and we should quote + the list before converting it into a string. If IFS is unset, and the + word is not quoted, we just need to quote CTLESC and CTLNUL characters + in the words in the list, because the default value of $IFS is + , IFS characters in the words in the list should + also be split. If IFS is null, and the word is not quoted, we need + to quote the words in the list to preserve the positional parameters + exactly. */ +char * +string_list_dollar_at (list, quoted) + WORD_LIST *list; + int quoted; +{ + char *ifs, *ret; +#if defined (HANDLE_MULTIBYTE) +# if defined (__GNUC__) + char sep[MB_CUR_MAX + 1]; +# else + char *sep = 0; +# endif /* !__GNUC__ */ +#else + char sep[2]; +#endif + WORD_LIST *tlist; + + /* XXX this could just be ifs = ifs_value; */ + ifs = ifs_var ? value_cell (ifs_var) : (char *)0; + +#if defined (HANDLE_MULTIBYTE) +# if !defined (__GNUC__) + sep = (char *)xmalloc (MB_CUR_MAX + 1); +# endif /* !__GNUC__ */ + if (ifs && *ifs) + { + if (ifs_firstc_len == 1) + { + sep[0] = ifs_firstc[0]; + sep[1] = '\0'; + } + else + { + memcpy (sep, ifs_firstc, ifs_firstc_len); + sep[ifs_firstc_len] = '\0'; + } + } + else + { + sep[0] = ' '; + sep[1] = '\0'; + } +#else + sep[0] = (ifs == 0 || *ifs == 0) ? ' ' : *ifs; + sep[1] = '\0'; +#endif + + /* XXX -- why call quote_list if ifs == 0? we can get away without doing + it now that quote_escapes quotes spaces */ + tlist = (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES|Q_PATQUOTE)) + ? quote_list (list) + : list_quote_escapes (list); + + ret = string_list_internal (tlist, sep); +#if defined (HANDLE_MULTIBYTE) && !defined (__GNUC__) + free (sep); +#endif + return ret; +} + +/* Turn the positional parameters into a string, understanding quoting and + the various subtleties of using the first character of $IFS as the + separator. Calls string_list_dollar_at, string_list_dollar_star, and + string_list as appropriate. */ +char * +string_list_pos_params (pchar, list, quoted) + int pchar; + WORD_LIST *list; + int quoted; +{ + char *ret; + WORD_LIST *tlist; + + if (pchar == '*' && (quoted & Q_DOUBLE_QUOTES)) + { + tlist = quote_list (list); + word_list_remove_quoted_nulls (tlist); + ret = string_list_dollar_star (tlist); + } + else if (pchar == '*' && (quoted & Q_HERE_DOCUMENT)) + { + tlist = quote_list (list); + word_list_remove_quoted_nulls (tlist); + ret = string_list (tlist); + } + else if (pchar == '*') + { + /* Even when unquoted, string_list_dollar_star does the right thing + making sure that the first character of $IFS is used as the + separator. */ + ret = string_list_dollar_star (list); + } + else if (pchar == '@' && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + /* We use string_list_dollar_at, but only if the string is quoted, since + that quotes the escapes if it's not, which we don't want. We could + use string_list (the old code did), but that doesn't do the right + thing if the first character of $IFS is not a space. We use + string_list_dollar_star if the string is unquoted so we make sure that + the elements of $@ are separated by the first character of $IFS for + later splitting. */ + ret = string_list_dollar_at (list, quoted); + else if (pchar == '@') + ret = string_list_dollar_star (list); + else + ret = string_list ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) ? quote_list (list) : list); + + return ret; +} + +/* Return the list of words present in STRING. Separate the string into + words at any of the characters found in SEPARATORS. If QUOTED is + non-zero then word in the list will have its quoted flag set, otherwise + the quoted flag is left as make_word () deemed fit. + + This obeys the P1003.2 word splitting semantics. If `separators' is + exactly , then the splitting algorithm is that of + the Bourne shell, which treats any sequence of characters from `separators' + as a delimiter. If IFS is unset, which results in `separators' being set + to "", no splitting occurs. If separators has some other value, the + following rules are applied (`IFS white space' means zero or more + occurrences of , , or , as long as those characters + are in `separators'): + + 1) IFS white space is ignored at the start and the end of the + string. + 2) Each occurrence of a character in `separators' that is not + IFS white space, along with any adjacent occurrences of + IFS white space delimits a field. + 3) Any nonzero-length sequence of IFS white space delimits a field. + */ + +/* BEWARE! list_string strips null arguments. Don't call it twice and + expect to have "" preserved! */ + +/* This performs word splitting and quoted null character removal on + STRING. */ +#define issep(c) \ + (((separators)[0]) ? ((separators)[1] ? isifs(c) \ + : (c) == (separators)[0]) \ + : 0) + +WORD_LIST * +list_string (string, separators, quoted) + register char *string, *separators; + int quoted; +{ + WORD_LIST *result; + WORD_DESC *t; + char *current_word, *s; + int sindex, sh_style_split, whitesep, xflags; + size_t slen; + + if (!string || !*string) + return ((WORD_LIST *)NULL); + + sh_style_split = separators && separators[0] == ' ' && + separators[1] == '\t' && + separators[2] == '\n' && + separators[3] == '\0'; + for (xflags = 0, s = ifs_value; s && *s; s++) + { + if (*s == CTLESC) xflags |= SX_NOCTLESC; + else if (*s == CTLNUL) xflags |= SX_NOESCCTLNUL; + } + + slen = 0; + /* Remove sequences of whitespace at the beginning of STRING, as + long as those characters appear in IFS. Do not do this if + STRING is quoted or if there are no separator characters. */ + if (!quoted || !separators || !*separators) + { + for (s = string; *s && spctabnl (*s) && issep (*s); s++); + + if (!*s) + return ((WORD_LIST *)NULL); + + string = s; + } + + /* OK, now STRING points to a word that does not begin with white space. + The splitting algorithm is: + extract a word, stopping at a separator + skip sequences of spc, tab, or nl as long as they are separators + This obeys the field splitting rules in Posix.2. */ + slen = (MB_CUR_MAX > 1) ? strlen (string) : 1; + for (result = (WORD_LIST *)NULL, sindex = 0; string[sindex]; ) + { + /* Don't need string length in ADVANCE_CHAR or string_extract_verbatim + unless multibyte chars are possible. */ + current_word = string_extract_verbatim (string, slen, &sindex, separators, xflags); + if (current_word == 0) + break; + + /* If we have a quoted empty string, add a quoted null argument. We + want to preserve the quoted null character iff this is a quoted + empty string; otherwise the quoted null characters are removed + below. */ + if (QUOTED_NULL (current_word)) + { + t = alloc_word_desc (); + t->word = make_quoted_char ('\0'); + t->flags |= W_QUOTED|W_HASQUOTEDNULL; + result = make_word_list (t, result); + } + else if (current_word[0] != '\0') + { + /* If we have something, then add it regardless. However, + perform quoted null character removal on the current word. */ + remove_quoted_nulls (current_word); + result = add_string_to_list (current_word, result); + result->word->flags &= ~W_HASQUOTEDNULL; /* just to be sure */ + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + result->word->flags |= W_QUOTED; + } + + /* If we're not doing sequences of separators in the traditional + Bourne shell style, then add a quoted null argument. */ + else if (!sh_style_split && !spctabnl (string[sindex])) + { + t = alloc_word_desc (); + t->word = make_quoted_char ('\0'); + t->flags |= W_QUOTED|W_HASQUOTEDNULL; + result = make_word_list (t, result); + } + + free (current_word); + + /* Note whether or not the separator is IFS whitespace, used later. */ + whitesep = string[sindex] && spctabnl (string[sindex]); + + /* Move past the current separator character. */ + if (string[sindex]) + { + DECLARE_MBSTATE; + ADVANCE_CHAR (string, slen, sindex); + } + + /* Now skip sequences of space, tab, or newline characters if they are + in the list of separators. */ + while (string[sindex] && spctabnl (string[sindex]) && issep (string[sindex])) + sindex++; + + /* If the first separator was IFS whitespace and the current character + is a non-whitespace IFS character, it should be part of the current + field delimiter, not a separate delimiter that would result in an + empty field. Look at POSIX.2, 3.6.5, (3)(b). */ + if (string[sindex] && whitesep && issep (string[sindex]) && !spctabnl (string[sindex])) + { + sindex++; + /* An IFS character that is not IFS white space, along with any + adjacent IFS white space, shall delimit a field. (SUSv3) */ + while (string[sindex] && spctabnl (string[sindex]) && isifs (string[sindex])) + sindex++; + } + } + return (REVERSE_LIST (result, WORD_LIST *)); +} + +/* Parse a single word from STRING, using SEPARATORS to separate fields. + ENDPTR is set to the first character after the word. This is used by + the `read' builtin. This is never called with SEPARATORS != $IFS; + it should be simplified. + + XXX - this function is very similar to list_string; they should be + combined - XXX */ +char * +get_word_from_string (stringp, separators, endptr) + char **stringp, *separators, **endptr; +{ + register char *s; + char *current_word; + int sindex, sh_style_split, whitesep, xflags; + size_t slen; + + if (!stringp || !*stringp || !**stringp) + return ((char *)NULL); + + sh_style_split = separators && separators[0] == ' ' && + separators[1] == '\t' && + separators[2] == '\n' && + separators[3] == '\0'; + for (xflags = 0, s = ifs_value; s && *s; s++) + { + if (*s == CTLESC) xflags |= SX_NOCTLESC; + if (*s == CTLNUL) xflags |= SX_NOESCCTLNUL; + } + + s = *stringp; + slen = 0; + + /* Remove sequences of whitespace at the beginning of STRING, as + long as those characters appear in IFS. */ + if (sh_style_split || !separators || !*separators) + { + for (; *s && spctabnl (*s) && isifs (*s); s++); + + /* If the string is nothing but whitespace, update it and return. */ + if (!*s) + { + *stringp = s; + if (endptr) + *endptr = s; + return ((char *)NULL); + } + } + + /* OK, S points to a word that does not begin with white space. + Now extract a word, stopping at a separator, save a pointer to + the first character after the word, then skip sequences of spc, + tab, or nl as long as they are separators. + + This obeys the field splitting rules in Posix.2. */ + sindex = 0; + /* Don't need string length in ADVANCE_CHAR or string_extract_verbatim + unless multibyte chars are possible. */ + slen = (MB_CUR_MAX > 1) ? strlen (s) : 1; + current_word = string_extract_verbatim (s, slen, &sindex, separators, xflags); + + /* Set ENDPTR to the first character after the end of the word. */ + if (endptr) + *endptr = s + sindex; + + /* Note whether or not the separator is IFS whitespace, used later. */ + whitesep = s[sindex] && spctabnl (s[sindex]); + + /* Move past the current separator character. */ + if (s[sindex]) + { + DECLARE_MBSTATE; + ADVANCE_CHAR (s, slen, sindex); + } + + /* Now skip sequences of space, tab, or newline characters if they are + in the list of separators. */ + while (s[sindex] && spctabnl (s[sindex]) && isifs (s[sindex])) + sindex++; + + /* If the first separator was IFS whitespace and the current character is + a non-whitespace IFS character, it should be part of the current field + delimiter, not a separate delimiter that would result in an empty field. + Look at POSIX.2, 3.6.5, (3)(b). */ + if (s[sindex] && whitesep && isifs (s[sindex]) && !spctabnl (s[sindex])) + { + sindex++; + /* An IFS character that is not IFS white space, along with any adjacent + IFS white space, shall delimit a field. */ + while (s[sindex] && spctabnl (s[sindex]) && isifs (s[sindex])) + sindex++; + } + + /* Update STRING to point to the next field. */ + *stringp = s + sindex; + return (current_word); +} + +/* Remove IFS white space at the end of STRING. Start at the end + of the string and walk backwards until the beginning of the string + or we find a character that's not IFS white space and not CTLESC. + Only let CTLESC escape a white space character if SAW_ESCAPE is + non-zero. */ +char * +strip_trailing_ifs_whitespace (string, separators, saw_escape) + char *string, *separators; + int saw_escape; +{ + char *s; + + s = string + STRLEN (string) - 1; + while (s > string && ((spctabnl (*s) && isifs (*s)) || + (saw_escape && *s == CTLESC && spctabnl (s[1])))) + s--; + *++s = '\0'; + return string; +} + +#if 0 +/* UNUSED */ +/* Split STRING into words at whitespace. Obeys shell-style quoting with + backslashes, single and double quotes. */ +WORD_LIST * +list_string_with_quotes (string) + char *string; +{ + WORD_LIST *list; + char *token, *s; + size_t s_len; + int c, i, tokstart, len; + + for (s = string; s && *s && spctabnl (*s); s++) + ; + if (s == 0 || *s == 0) + return ((WORD_LIST *)NULL); + + s_len = strlen (s); + tokstart = i = 0; + list = (WORD_LIST *)NULL; + while (1) + { + c = s[i]; + if (c == '\\') + { + i++; + if (s[i]) + i++; + } + else if (c == '\'') + i = skip_single_quoted (s, s_len, ++i); + else if (c == '"') + i = skip_double_quoted (s, s_len, ++i); + else if (c == 0 || spctabnl (c)) + { + /* We have found the end of a token. Make a word out of it and + add it to the word list. */ + token = substring (s, tokstart, i); + list = add_string_to_list (token, list); + free (token); + while (spctabnl (s[i])) + i++; + if (s[i]) + tokstart = i; + else + break; + } + else + i++; /* normal character */ + } + return (REVERSE_LIST (list, WORD_LIST *)); +} +#endif + +/********************************************************/ +/* */ +/* Functions to perform assignment statements */ +/* */ +/********************************************************/ + +#if defined (ARRAY_VARS) +static SHELL_VAR * +do_compound_assignment (name, value, flags) + char *name, *value; + int flags; +{ + SHELL_VAR *v; + int mklocal, mkassoc, mkglobal; + WORD_LIST *list; + + mklocal = flags & ASS_MKLOCAL; + mkassoc = flags & ASS_MKASSOC; + mkglobal = flags & ASS_MKGLOBAL; + + if (mklocal && variable_context) + { + v = find_variable (name); + list = expand_compound_array_assignment (v, value, flags); + if (mkassoc) + v = make_local_assoc_variable (name); + else if (v == 0 || (array_p (v) == 0 && assoc_p (v) == 0) || v->context != variable_context) + v = make_local_array_variable (name, 0); + if (v) + assign_compound_array_list (v, list, flags); + } + /* In a function but forcing assignment in global context */ + else if (mkglobal && variable_context) + { + v = find_global_variable (name); + list = expand_compound_array_assignment (v, value, flags); + if (v == 0 && mkassoc) + v = make_new_assoc_variable (name); + else if (v && mkassoc && assoc_p (v) == 0) + v = convert_var_to_assoc (v); + else if (v == 0) + v = make_new_array_variable (name); + else if (v && mkassoc == 0 && array_p (v) == 0) + v = convert_var_to_array (v); + if (v) + assign_compound_array_list (v, list, flags); + } + else + v = assign_array_from_string (name, value, flags); + + return (v); +} +#endif + +/* Given STRING, an assignment string, get the value of the right side + of the `=', and bind it to the left side. If EXPAND is true, then + perform parameter expansion, command substitution, and arithmetic + expansion on the right-hand side. Perform tilde expansion in any + case. Do not perform word splitting on the result of expansion. */ +static int +do_assignment_internal (word, expand) + const WORD_DESC *word; + int expand; +{ + int offset, appendop, assign_list, aflags, retval; + char *name, *value, *temp; + SHELL_VAR *entry; +#if defined (ARRAY_VARS) + char *t; + int ni; +#endif + const char *string; + + if (word == 0 || word->word == 0) + return 0; + + appendop = assign_list = aflags = 0; + string = word->word; + offset = assignment (string, 0); + name = savestring (string); + value = (char *)NULL; + + if (name[offset] == '=') + { + if (name[offset - 1] == '+') + { + appendop = 1; + name[offset - 1] = '\0'; + } + + name[offset] = 0; /* might need this set later */ + temp = name + offset + 1; + +#if defined (ARRAY_VARS) + if (expand && (word->flags & W_COMPASSIGN)) + { + assign_list = ni = 1; + value = extract_array_assignment_list (temp, &ni); + } + else +#endif + if (expand && temp[0]) + value = expand_string_if_necessary (temp, 0, expand_string_assignment); + else + value = savestring (temp); + } + + if (value == 0) + { + value = (char *)xmalloc (1); + value[0] = '\0'; + } + + if (echo_command_at_execute) + { + if (appendop) + name[offset - 1] = '+'; + xtrace_print_assignment (name, value, assign_list, 1); + if (appendop) + name[offset - 1] = '\0'; + } + +#define ASSIGN_RETURN(r) do { FREE (value); free (name); return (r); } while (0) + + if (appendop) + aflags |= ASS_APPEND; + +#if defined (ARRAY_VARS) + if (t = mbschr (name, '[')) /*]*/ + { + if (assign_list) + { + report_error (_("%s: cannot assign list to array member"), name); + ASSIGN_RETURN (0); + } + entry = assign_array_element (name, value, aflags); + if (entry == 0) + ASSIGN_RETURN (0); + } + else if (assign_list) + { + if ((word->flags & W_ASSIGNARG) && (word->flags & W_ASSNGLOBAL) == 0) + aflags |= ASS_MKLOCAL; + if ((word->flags & W_ASSIGNARG) && (word->flags & W_ASSNGLOBAL)) + aflags |= ASS_MKGLOBAL; + if (word->flags & W_ASSIGNASSOC) + aflags |= ASS_MKASSOC; + entry = do_compound_assignment (name, value, aflags); + } + else +#endif /* ARRAY_VARS */ + entry = bind_variable (name, value, aflags); + + stupidly_hack_special_variables (name); + + /* Return 1 if the assignment seems to have been performed correctly. */ + if (entry == 0 || readonly_p (entry)) + retval = 0; /* assignment failure */ + else if (noassign_p (entry)) + { + last_command_exit_value = EXECUTION_FAILURE; + retval = 1; /* error status, but not assignment failure */ + } + else + retval = 1; + + if (entry && retval != 0 && noassign_p (entry) == 0) + VUNSETATTR (entry, att_invisible); + + ASSIGN_RETURN (retval); +} + +/* Perform the assignment statement in STRING, and expand the + right side by doing tilde, command and parameter expansion. */ +int +do_assignment (string) + char *string; +{ + WORD_DESC td; + + td.flags = W_ASSIGNMENT; + td.word = string; + + return do_assignment_internal (&td, 1); +} + +int +do_word_assignment (word, flags) + WORD_DESC *word; + int flags; +{ + return do_assignment_internal (word, 1); +} + +/* Given STRING, an assignment string, get the value of the right side + of the `=', and bind it to the left side. Do not perform any word + expansions on the right hand side. */ +int +do_assignment_no_expand (string) + char *string; +{ + WORD_DESC td; + + td.flags = W_ASSIGNMENT; + td.word = string; + + return (do_assignment_internal (&td, 0)); +} + +/*************************************************** + * * + * Functions to manage the positional parameters * + * * + ***************************************************/ + +/* Return the word list that corresponds to `$*'. */ +WORD_LIST * +list_rest_of_args () +{ + register WORD_LIST *list, *args; + int i; + + /* Break out of the loop as soon as one of the dollar variables is null. */ + for (i = 1, list = (WORD_LIST *)NULL; i < 10 && dollar_vars[i]; i++) + list = make_word_list (make_bare_word (dollar_vars[i]), list); + + for (args = rest_of_args; args; args = args->next) + list = make_word_list (make_bare_word (args->word->word), list); + + return (REVERSE_LIST (list, WORD_LIST *)); +} + +int +number_of_args () +{ + register WORD_LIST *list; + int n; + + for (n = 0; n < 9 && dollar_vars[n+1]; n++) + ; + for (list = rest_of_args; list; list = list->next) + n++; + return n; +} + +/* Return the value of a positional parameter. This handles values > 10. */ +char * +get_dollar_var_value (ind) + intmax_t ind; +{ + char *temp; + WORD_LIST *p; + + if (ind < 10) + temp = dollar_vars[ind] ? savestring (dollar_vars[ind]) : (char *)NULL; + else /* We want something like ${11} */ + { + ind -= 10; + for (p = rest_of_args; p && ind--; p = p->next) + ; + temp = p ? savestring (p->word->word) : (char *)NULL; + } + return (temp); +} + +/* Make a single large string out of the dollar digit variables, + and the rest_of_args. If DOLLAR_STAR is 1, then obey the special + case of "$*" with respect to IFS. */ +char * +string_rest_of_args (dollar_star) + int dollar_star; +{ + register WORD_LIST *list; + char *string; + + list = list_rest_of_args (); + string = dollar_star ? string_list_dollar_star (list) : string_list (list); + dispose_words (list); + return (string); +} + +/* Return a string containing the positional parameters from START to + END, inclusive. If STRING[0] == '*', we obey the rules for $*, + which only makes a difference if QUOTED is non-zero. If QUOTED includes + Q_HERE_DOCUMENT or Q_DOUBLE_QUOTES, this returns a quoted list, otherwise + no quoting chars are added. */ +static char * +pos_params (string, start, end, quoted) + char *string; + int start, end, quoted; +{ + WORD_LIST *save, *params, *h, *t; + char *ret; + int i; + + /* see if we can short-circuit. if start == end, we want 0 parameters. */ + if (start == end) + return ((char *)NULL); + + save = params = list_rest_of_args (); + if (save == 0) + return ((char *)NULL); + + if (start == 0) /* handle ${@:0[:x]} specially */ + { + t = make_word_list (make_word (dollar_vars[0]), params); + save = params = t; + } + + for (i = start ? 1 : 0; params && i < start; i++) + params = params->next; + if (params == 0) + return ((char *)NULL); + for (h = t = params; params && i < end; i++) + { + t = params; + params = params->next; + } + + t->next = (WORD_LIST *)NULL; + + ret = string_list_pos_params (string[0], h, quoted); + + if (t != params) + t->next = params; + + dispose_words (save); + return (ret); +} + +/******************************************************************/ +/* */ +/* Functions to expand strings to strings or WORD_LISTs */ +/* */ +/******************************************************************/ + +#if defined (PROCESS_SUBSTITUTION) +#define EXP_CHAR(s) (s == '$' || s == '`' || s == '<' || s == '>' || s == CTLESC || s == '~') +#else +#define EXP_CHAR(s) (s == '$' || s == '`' || s == CTLESC || s == '~') +#endif + +/* If there are any characters in STRING that require full expansion, + then call FUNC to expand STRING; otherwise just perform quote + removal if necessary. This returns a new string. */ +static char * +expand_string_if_necessary (string, quoted, func) + char *string; + int quoted; + EXPFUNC *func; +{ + WORD_LIST *list; + size_t slen; + int i, saw_quote; + char *ret; + DECLARE_MBSTATE; + + /* Don't need string length for ADVANCE_CHAR unless multibyte chars possible. */ + slen = (MB_CUR_MAX > 1) ? strlen (string) : 0; + i = saw_quote = 0; + while (string[i]) + { + if (EXP_CHAR (string[i])) + break; + else if (string[i] == '\'' || string[i] == '\\' || string[i] == '"') + saw_quote = 1; + ADVANCE_CHAR (string, slen, i); + } + + if (string[i]) + { + list = (*func) (string, quoted); + if (list) + { + ret = string_list (list); + dispose_words (list); + } + else + ret = (char *)NULL; + } + else if (saw_quote && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + ret = string_quote_removal (string, quoted); + else + ret = savestring (string); + + return ret; +} + +static inline char * +expand_string_to_string_internal (string, quoted, func) + char *string; + int quoted; + EXPFUNC *func; +{ + WORD_LIST *list; + char *ret; + + if (string == 0 || *string == '\0') + return ((char *)NULL); + + list = (*func) (string, quoted); + if (list) + { + ret = string_list (list); + dispose_words (list); + } + else + ret = (char *)NULL; + + return (ret); +} + +char * +expand_string_to_string (string, quoted) + char *string; + int quoted; +{ + return (expand_string_to_string_internal (string, quoted, expand_string)); +} + +char * +expand_string_unsplit_to_string (string, quoted) + char *string; + int quoted; +{ + return (expand_string_to_string_internal (string, quoted, expand_string_unsplit)); +} + +char * +expand_assignment_string_to_string (string, quoted) + char *string; + int quoted; +{ + return (expand_string_to_string_internal (string, quoted, expand_string_assignment)); +} + +char * +expand_arith_string (string, quoted) + char *string; + int quoted; +{ + WORD_DESC td; + WORD_LIST *list, *tlist; + size_t slen; + int i, saw_quote; + char *ret; + DECLARE_MBSTATE; + + /* Don't need string length for ADVANCE_CHAR unless multibyte chars possible. */ + slen = (MB_CUR_MAX > 1) ? strlen (string) : 0; + i = saw_quote = 0; + while (string[i]) + { + if (EXP_CHAR (string[i])) + break; + else if (string[i] == '\'' || string[i] == '\\' || string[i] == '"') + saw_quote = 1; + ADVANCE_CHAR (string, slen, i); + } + + if (string[i]) + { + /* This is expanded version of expand_string_internal as it's called by + expand_string_leave_quoted */ + td.flags = W_NOPROCSUB; /* don't want process substitution */ + td.word = savestring (string); + list = call_expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + /* This takes care of the calls from expand_string_leave_quoted and + expand_string */ + if (list) + { + tlist = word_list_split (list); + dispose_words (list); + list = tlist; + if (list) + dequote_list (list); + } + /* This comes from expand_string_if_necessary */ + if (list) + { + ret = string_list (list); + dispose_words (list); + } + else + ret = (char *)NULL; + FREE (td.word); + } + else if (saw_quote && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + ret = string_quote_removal (string, quoted); + else + ret = savestring (string); + + return ret; +} + +#if defined (COND_COMMAND) +/* Just remove backslashes in STRING. Returns a new string. */ +char * +remove_backslashes (string) + char *string; +{ + char *r, *ret, *s; + + r = ret = (char *)xmalloc (strlen (string) + 1); + for (s = string; s && *s; ) + { + if (*s == '\\') + s++; + if (*s == 0) + break; + *r++ = *s++; + } + *r = '\0'; + return ret; +} + +/* This needs better error handling. */ +/* Expand W for use as an argument to a unary or binary operator in a + [[...]] expression. If SPECIAL is 1, this is the rhs argument + to the != or == operator, and should be treated as a pattern. In + this case, we quote the string specially for the globbing code. If + SPECIAL is 2, this is an rhs argument for the =~ operator, and should + be quoted appropriately for regcomp/regexec. The caller is responsible + for removing the backslashes if the unquoted word is needed later. */ +char * +cond_expand_word (w, special) + WORD_DESC *w; + int special; +{ + char *r, *p; + WORD_LIST *l; + int qflags; + + if (w->word == 0 || w->word[0] == '\0') + return ((char *)NULL); + + expand_no_split_dollar_star = 1; + w->flags |= W_NOSPLIT2; + l = call_expand_word_internal (w, 0, 0, (int *)0, (int *)0); + expand_no_split_dollar_star = 0; + if (l) + { + if (special == 0) /* LHS */ + { + dequote_list (l); + r = string_list (l); + } + else + { + /* Need to figure out whether or not we should call dequote_escapes + or a new dequote_ctlnul function here, and under what + circumstances. */ + qflags = QGLOB_CVTNULL; + if (special == 2) + qflags |= QGLOB_REGEXP; + p = string_list (l); + r = quote_string_for_globbing (p, qflags); + free (p); + } + dispose_words (l); + } + else + r = (char *)NULL; + + return r; +} +#endif + +/* Call expand_word_internal to expand W and handle error returns. + A convenience function for functions that don't want to handle + any errors or free any memory before aborting. */ +static WORD_LIST * +call_expand_word_internal (w, q, i, c, e) + WORD_DESC *w; + int q, i, *c, *e; +{ + WORD_LIST *result; + + result = expand_word_internal (w, q, i, c, e); + if (result == &expand_word_error || result == &expand_word_fatal) + { + /* By convention, each time this error is returned, w->word has + already been freed (it sometimes may not be in the fatal case, + but that doesn't result in a memory leak because we're going + to exit in most cases). */ + w->word = (char *)NULL; + last_command_exit_value = EXECUTION_FAILURE; + exp_jump_to_top_level ((result == &expand_word_error) ? DISCARD : FORCE_EOF); + /* NOTREACHED */ + return (NULL); + } + else + return (result); +} + +/* Perform parameter expansion, command substitution, and arithmetic + expansion on STRING, as if it were a word. Leave the result quoted. + Since this does not perform word splitting, it leaves quoted nulls + in the result. */ +static WORD_LIST * +expand_string_internal (string, quoted) + char *string; + int quoted; +{ + WORD_DESC td; + WORD_LIST *tresult; + + if (string == 0 || *string == 0) + return ((WORD_LIST *)NULL); + + td.flags = 0; + td.word = savestring (string); + + tresult = call_expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + + FREE (td.word); + return (tresult); +} + +/* Expand STRING by performing parameter expansion, command substitution, + and arithmetic expansion. Dequote the resulting WORD_LIST before + returning it, but do not perform word splitting. The call to + remove_quoted_nulls () is in here because word splitting normally + takes care of quote removal. */ +WORD_LIST * +expand_string_unsplit (string, quoted) + char *string; + int quoted; +{ + WORD_LIST *value; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + expand_no_split_dollar_star = 1; + value = expand_string_internal (string, quoted); + expand_no_split_dollar_star = 0; + + if (value) + { + if (value->word) + { + remove_quoted_nulls (value->word->word); + value->word->flags &= ~W_HASQUOTEDNULL; + } + dequote_list (value); + } + return (value); +} + +/* Expand the rhs of an assignment statement */ +WORD_LIST * +expand_string_assignment (string, quoted) + char *string; + int quoted; +{ + WORD_DESC td; + WORD_LIST *value; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + expand_no_split_dollar_star = 1; + + td.flags = W_ASSIGNRHS; + td.word = savestring (string); + value = call_expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + FREE (td.word); + + expand_no_split_dollar_star = 0; + + if (value) + { + if (value->word) + { + remove_quoted_nulls (value->word->word); + value->word->flags &= ~W_HASQUOTEDNULL; + } + dequote_list (value); + } + return (value); +} + + +/* Expand one of the PS? prompt strings. This is a sort of combination of + expand_string_unsplit and expand_string_internal, but returns the + passed string when an error occurs. Might want to trap other calls + to jump_to_top_level here so we don't endlessly loop. */ +WORD_LIST * +expand_prompt_string (string, quoted, wflags) + char *string; + int quoted; + int wflags; +{ + WORD_LIST *value; + WORD_DESC td; + + if (string == 0 || *string == 0) + return ((WORD_LIST *)NULL); + + td.flags = wflags; + td.word = savestring (string); + + no_longjmp_on_fatal_error = 1; + value = expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + no_longjmp_on_fatal_error = 0; + + if (value == &expand_word_error || value == &expand_word_fatal) + { + value = make_word_list (make_bare_word (string), (WORD_LIST *)NULL); + return value; + } + FREE (td.word); + if (value) + { + if (value->word) + { + remove_quoted_nulls (value->word->word); + value->word->flags &= ~W_HASQUOTEDNULL; + } + dequote_list (value); + } + return (value); +} + +/* Expand STRING just as if you were expanding a word, but do not dequote + the resultant WORD_LIST. This is called only from within this file, + and is used to correctly preserve quoted characters when expanding + things like ${1+"$@"}. This does parameter expansion, command + substitution, arithmetic expansion, and word splitting. */ +static WORD_LIST * +expand_string_leave_quoted (string, quoted) + char *string; + int quoted; +{ + WORD_LIST *tlist; + WORD_LIST *tresult; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + tlist = expand_string_internal (string, quoted); + + if (tlist) + { + tresult = word_list_split (tlist); + dispose_words (tlist); + return (tresult); + } + return ((WORD_LIST *)NULL); +} + +/* This does not perform word splitting or dequote the WORD_LIST + it returns. */ +static WORD_LIST * +expand_string_for_rhs (string, quoted, dollar_at_p, has_dollar_at) + char *string; + int quoted, *dollar_at_p, *has_dollar_at; +{ + WORD_DESC td; + WORD_LIST *tresult; + + if (string == 0 || *string == '\0') + return (WORD_LIST *)NULL; + + td.flags = W_NOSPLIT2; /* no splitting, remove "" and '' */ + td.word = string; + tresult = call_expand_word_internal (&td, quoted, 1, dollar_at_p, has_dollar_at); + return (tresult); +} + +/* Expand STRING just as if you were expanding a word. This also returns + a list of words. Note that filename globbing is *NOT* done for word + or string expansion, just when the shell is expanding a command. This + does parameter expansion, command substitution, arithmetic expansion, + and word splitting. Dequote the resultant WORD_LIST before returning. */ +WORD_LIST * +expand_string (string, quoted) + char *string; + int quoted; +{ + WORD_LIST *result; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + result = expand_string_leave_quoted (string, quoted); + return (result ? dequote_list (result) : result); +} + +/*************************************************** + * * + * Functions to handle quoting chars * + * * + ***************************************************/ + +/* Conventions: + + A string with s[0] == CTLNUL && s[1] == 0 is a quoted null string. + The parser passes CTLNUL as CTLESC CTLNUL. */ + +/* Quote escape characters in string s, but no other characters. This is + used to protect CTLESC and CTLNUL in variable values from the rest of + the word expansion process after the variable is expanded (word splitting + and filename generation). If IFS is null, we quote spaces as well, just + in case we split on spaces later (in the case of unquoted $@, we will + eventually attempt to split the entire word on spaces). Corresponding + code exists in dequote_escapes. Even if we don't end up splitting on + spaces, quoting spaces is not a problem. This should never be called on + a string that is quoted with single or double quotes or part of a here + document (effectively double-quoted). */ +char * +quote_escapes (string) + char *string; +{ + register char *s, *t; + size_t slen; + char *result, *send; + int quote_spaces, skip_ctlesc, skip_ctlnul; + DECLARE_MBSTATE; + + slen = strlen (string); + send = string + slen; + + quote_spaces = (ifs_value && *ifs_value == 0); + + for (skip_ctlesc = skip_ctlnul = 0, s = ifs_value; s && *s; s++) + skip_ctlesc |= *s == CTLESC, skip_ctlnul |= *s == CTLNUL; + + t = result = (char *)xmalloc ((slen * 2) + 1); + s = string; + + while (*s) + { + if ((skip_ctlesc == 0 && *s == CTLESC) || (skip_ctlnul == 0 && *s == CTLNUL) || (quote_spaces && *s == ' ')) + *t++ = CTLESC; + COPY_CHAR_P (t, s, send); + } + *t = '\0'; + + return (result); +} + +static WORD_LIST * +list_quote_escapes (list) + WORD_LIST *list; +{ + register WORD_LIST *w; + char *t; + + for (w = list; w; w = w->next) + { + t = w->word->word; + w->word->word = quote_escapes (t); + free (t); + } + return list; +} + +/* Inverse of quote_escapes; remove CTLESC protecting CTLESC or CTLNUL. + + The parser passes us CTLESC as CTLESC CTLESC and CTLNUL as CTLESC CTLNUL. + This is necessary to make unquoted CTLESC and CTLNUL characters in the + data stream pass through properly. + + We need to remove doubled CTLESC characters inside quoted strings before + quoting the entire string, so we do not double the number of CTLESC + characters. + + Also used by parts of the pattern substitution code. */ +char * +dequote_escapes (string) + char *string; +{ + register char *s, *t, *s1; + size_t slen; + char *result, *send; + int quote_spaces; + DECLARE_MBSTATE; + + if (string == 0) + return string; + + slen = strlen (string); + send = string + slen; + + t = result = (char *)xmalloc (slen + 1); + + if (strchr (string, CTLESC) == 0) + return (strcpy (result, string)); + + quote_spaces = (ifs_value && *ifs_value == 0); + + s = string; + while (*s) + { + if (*s == CTLESC && (s[1] == CTLESC || s[1] == CTLNUL || (quote_spaces && s[1] == ' '))) + { + s++; + if (*s == '\0') + break; + } + COPY_CHAR_P (t, s, send); + } + *t = '\0'; + + return result; +} + +static WORD_LIST * +list_dequote_escapes (list) + WORD_LIST *list; +{ + register WORD_LIST *w; + char *t; + + for (w = list; w; w = w->next) + { + t = w->word->word; + w->word->word = dequote_escapes (t); + free (t); + } + return list; +} + +/* Return a new string with the quoted representation of character C. + This turns "" into QUOTED_NULL, so the W_HASQUOTEDNULL flag needs to be + set in any resultant WORD_DESC where this value is the word. */ +static char * +make_quoted_char (c) + int c; +{ + char *temp; + + temp = (char *)xmalloc (3); + if (c == 0) + { + temp[0] = CTLNUL; + temp[1] = '\0'; + } + else + { + temp[0] = CTLESC; + temp[1] = c; + temp[2] = '\0'; + } + return (temp); +} + +/* Quote STRING, returning a new string. This turns "" into QUOTED_NULL, so + the W_HASQUOTEDNULL flag needs to be set in any resultant WORD_DESC where + this value is the word. */ +char * +quote_string (string) + char *string; +{ + register char *t; + size_t slen; + char *result, *send; + + if (*string == 0) + { + result = (char *)xmalloc (2); + result[0] = CTLNUL; + result[1] = '\0'; + } + else + { + DECLARE_MBSTATE; + + slen = strlen (string); + send = string + slen; + + result = (char *)xmalloc ((slen * 2) + 1); + + for (t = result; string < send; ) + { + *t++ = CTLESC; + COPY_CHAR_P (t, string, send); + } + *t = '\0'; + } + return (result); +} + +/* De-quote quoted characters in STRING. */ +char * +dequote_string (string) + char *string; +{ + register char *s, *t; + size_t slen; + char *result, *send; + DECLARE_MBSTATE; + + slen = strlen (string); + + t = result = (char *)xmalloc (slen + 1); + + if (QUOTED_NULL (string)) + { + result[0] = '\0'; + return (result); + } + + /* If no character in the string can be quoted, don't bother examining + each character. Just return a copy of the string passed to us. */ + if (strchr (string, CTLESC) == NULL) + return (strcpy (result, string)); + + send = string + slen; + s = string; + while (*s) + { + if (*s == CTLESC) + { + s++; + if (*s == '\0') + break; + } + COPY_CHAR_P (t, s, send); + } + + *t = '\0'; + return (result); +} + +/* Quote the entire WORD_LIST list. */ +static WORD_LIST * +quote_list (list) + WORD_LIST *list; +{ + register WORD_LIST *w; + char *t; + + for (w = list; w; w = w->next) + { + t = w->word->word; + w->word->word = quote_string (t); + if (*t == 0) + w->word->flags |= W_HASQUOTEDNULL; /* XXX - turn on W_HASQUOTEDNULL here? */ + w->word->flags |= W_QUOTED; + free (t); + } + return list; +} + +/* De-quote quoted characters in each word in LIST. */ +WORD_LIST * +dequote_list (list) + WORD_LIST *list; +{ + register char *s; + register WORD_LIST *tlist; + + for (tlist = list; tlist; tlist = tlist->next) + { + s = dequote_string (tlist->word->word); + if (QUOTED_NULL (tlist->word->word)) + tlist->word->flags &= ~W_HASQUOTEDNULL; + free (tlist->word->word); + tlist->word->word = s; + } + return list; +} + +/* Remove CTLESC protecting a CTLESC or CTLNUL in place. Return the passed + string. */ +char * +remove_quoted_escapes (string) + char *string; +{ + char *t; + + if (string) + { + t = dequote_escapes (string); + strcpy (string, t); + free (t); + } + + return (string); +} + +/* Perform quoted null character removal on STRING. We don't allow any + quoted null characters in the middle or at the ends of strings because + of how expand_word_internal works. remove_quoted_nulls () turns + STRING into an empty string iff it only consists of a quoted null, + and removes all unquoted CTLNUL characters. */ +char * +remove_quoted_nulls (string) + char *string; +{ + register size_t slen; + register int i, j, prev_i; + DECLARE_MBSTATE; + + if (strchr (string, CTLNUL) == 0) /* XXX */ + return string; /* XXX */ + + slen = strlen (string); + i = j = 0; + + while (i < slen) + { + if (string[i] == CTLESC) + { + /* Old code had j++, but we cannot assume that i == j at this + point -- what if a CTLNUL has already been removed from the + string? We don't want to drop the CTLESC or recopy characters + that we've already copied down. */ + i++; string[j++] = CTLESC; + if (i == slen) + break; + } + else if (string[i] == CTLNUL) + { + i++; + continue; + } + + prev_i = i; + ADVANCE_CHAR (string, slen, i); + if (j < prev_i) + { + do string[j++] = string[prev_i++]; while (prev_i < i); + } + else + j = i; + } + string[j] = '\0'; + + return (string); +} + +/* Perform quoted null character removal on each element of LIST. + This modifies LIST. */ +void +word_list_remove_quoted_nulls (list) + WORD_LIST *list; +{ + register WORD_LIST *t; + + for (t = list; t; t = t->next) + { + remove_quoted_nulls (t->word->word); + t->word->flags &= ~W_HASQUOTEDNULL; + } +} + +/* **************************************************************** */ +/* */ +/* Functions for Matching and Removing Patterns */ +/* */ +/* **************************************************************** */ + +#if defined (HANDLE_MULTIBYTE) +#if 0 /* Currently unused */ +static unsigned char * +mb_getcharlens (string, len) + char *string; + int len; +{ + int i, offset, last; + unsigned char *ret; + char *p; + DECLARE_MBSTATE; + + i = offset = 0; + last = 0; + ret = (unsigned char *)xmalloc (len); + memset (ret, 0, len); + while (string[last]) + { + ADVANCE_CHAR (string, len, offset); + ret[last] = offset - last; + last = offset; + } + return ret; +} +#endif +#endif + +/* Remove the portion of PARAM matched by PATTERN according to OP, where OP + can have one of 4 values: + RP_LONG_LEFT remove longest matching portion at start of PARAM + RP_SHORT_LEFT remove shortest matching portion at start of PARAM + RP_LONG_RIGHT remove longest matching portion at end of PARAM + RP_SHORT_RIGHT remove shortest matching portion at end of PARAM +*/ + +#define RP_LONG_LEFT 1 +#define RP_SHORT_LEFT 2 +#define RP_LONG_RIGHT 3 +#define RP_SHORT_RIGHT 4 + +/* Returns its first argument if nothing matched; new memory otherwise */ +static char * +remove_upattern (param, pattern, op) + char *param, *pattern; + int op; +{ + register int len; + register char *end; + register char *p, *ret, c; + + len = STRLEN (param); + end = param + len; + + switch (op) + { + case RP_LONG_LEFT: /* remove longest match at start */ + for (p = end; p >= param; p--) + { + c = *p; *p = '\0'; + if (strmatch (pattern, param, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + *p = c; + return (savestring (p)); + } + *p = c; + + } + break; + + case RP_SHORT_LEFT: /* remove shortest match at start */ + for (p = param; p <= end; p++) + { + c = *p; *p = '\0'; + if (strmatch (pattern, param, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + *p = c; + return (savestring (p)); + } + *p = c; + } + break; + + case RP_LONG_RIGHT: /* remove longest match at end */ + for (p = param; p <= end; p++) + { + if (strmatch (pattern, p, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + c = *p; *p = '\0'; + ret = savestring (param); + *p = c; + return (ret); + } + } + break; + + case RP_SHORT_RIGHT: /* remove shortest match at end */ + for (p = end; p >= param; p--) + { + if (strmatch (pattern, p, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + c = *p; *p = '\0'; + ret = savestring (param); + *p = c; + return (ret); + } + } + break; + } + + return (param); /* no match, return original string */ +} + +#if defined (HANDLE_MULTIBYTE) +/* Returns its first argument if nothing matched; new memory otherwise */ +static wchar_t * +remove_wpattern (wparam, wstrlen, wpattern, op) + wchar_t *wparam; + size_t wstrlen; + wchar_t *wpattern; + int op; +{ + wchar_t wc, *ret; + int n; + + switch (op) + { + case RP_LONG_LEFT: /* remove longest match at start */ + for (n = wstrlen; n >= 0; n--) + { + wc = wparam[n]; wparam[n] = L'\0'; + if (wcsmatch (wpattern, wparam, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wparam[n] = wc; + return (wcsdup (wparam + n)); + } + wparam[n] = wc; + } + break; + + case RP_SHORT_LEFT: /* remove shortest match at start */ + for (n = 0; n <= wstrlen; n++) + { + wc = wparam[n]; wparam[n] = L'\0'; + if (wcsmatch (wpattern, wparam, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wparam[n] = wc; + return (wcsdup (wparam + n)); + } + wparam[n] = wc; + } + break; + + case RP_LONG_RIGHT: /* remove longest match at end */ + for (n = 0; n <= wstrlen; n++) + { + if (wcsmatch (wpattern, wparam + n, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wc = wparam[n]; wparam[n] = L'\0'; + ret = wcsdup (wparam); + wparam[n] = wc; + return (ret); + } + } + break; + + case RP_SHORT_RIGHT: /* remove shortest match at end */ + for (n = wstrlen; n >= 0; n--) + { + if (wcsmatch (wpattern, wparam + n, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wc = wparam[n]; wparam[n] = L'\0'; + ret = wcsdup (wparam); + wparam[n] = wc; + return (ret); + } + } + break; + } + + return (wparam); /* no match, return original string */ +} +#endif /* HANDLE_MULTIBYTE */ + +static char * +remove_pattern (param, pattern, op) + char *param, *pattern; + int op; +{ + char *xret; + + if (param == NULL) + return (param); + if (*param == '\0' || pattern == NULL || *pattern == '\0') /* minor optimization */ + return (savestring (param)); + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1) + { + wchar_t *ret, *oret; + size_t n; + wchar_t *wparam, *wpattern; + mbstate_t ps; + + n = xdupmbstowcs (&wpattern, NULL, pattern); + if (n == (size_t)-1) + { + xret = remove_upattern (param, pattern, op); + return ((xret == param) ? savestring (param) : xret); + } + n = xdupmbstowcs (&wparam, NULL, param); + + if (n == (size_t)-1) + { + free (wpattern); + xret = remove_upattern (param, pattern, op); + return ((xret == param) ? savestring (param) : xret); + } + oret = ret = remove_wpattern (wparam, n, wpattern, op); + /* Don't bother to convert wparam back to multibyte string if nothing + matched; just return copy of original string */ + if (ret == wparam) + { + free (wparam); + free (wpattern); + return (savestring (param)); + } + + free (wparam); + free (wpattern); + + n = strlen (param); + xret = (char *)xmalloc (n + 1); + memset (&ps, '\0', sizeof (mbstate_t)); + n = wcsrtombs (xret, (const wchar_t **)&ret, n, &ps); + xret[n] = '\0'; /* just to make sure */ + free (oret); + return xret; + } + else +#endif + { + xret = remove_upattern (param, pattern, op); + return ((xret == param) ? savestring (param) : xret); + } +} + +/* Match PAT anywhere in STRING and return the match boundaries. + This returns 1 in case of a successful match, 0 otherwise. SP + and EP are pointers into the string where the match begins and + ends, respectively. MTYPE controls what kind of match is attempted. + MATCH_BEG and MATCH_END anchor the match at the beginning and end + of the string, respectively. The longest match is returned. */ +static int +match_upattern (string, pat, mtype, sp, ep) + char *string, *pat; + int mtype; + char **sp, **ep; +{ + int c, len, mlen; + register char *p, *p1, *npat; + char *end; + int n1; + + /* If the pattern doesn't match anywhere in the string, go ahead and + short-circuit right away. A minor optimization, saves a bunch of + unnecessary calls to strmatch (up to N calls for a string of N + characters) if the match is unsuccessful. To preserve the semantics + of the substring matches below, we make sure that the pattern has + `*' as first and last character, making a new pattern if necessary. */ + /* XXX - check this later if I ever implement `**' with special meaning, + since this will potentially result in `**' at the beginning or end */ + len = STRLEN (pat); + if (pat[0] != '*' || (pat[0] == '*' && pat[1] == LPAREN && extended_glob) || pat[len - 1] != '*') + { + p = npat = (char *)xmalloc (len + 3); + p1 = pat; + if (*p1 != '*' || (*p1 == '*' && p1[1] == LPAREN && extended_glob)) + *p++ = '*'; + while (*p1) + *p++ = *p1++; + if (p1[-1] != '*' || p[-2] == '\\') + *p++ = '*'; + *p = '\0'; + } + else + npat = pat; + c = strmatch (npat, string, FNMATCH_EXTFLAG); + if (npat != pat) + free (npat); + if (c == FNM_NOMATCH) + return (0); + + len = STRLEN (string); + end = string + len; + + mlen = umatchlen (pat, len); + + switch (mtype) + { + case MATCH_ANY: + for (p = string; p <= end; p++) + { + if (match_pattern_char (pat, p)) + { + p1 = (mlen == -1) ? end : p + mlen; + /* p1 - p = length of portion of string to be considered + p = current position in string + mlen = number of characters consumed by match (-1 for entire string) + end = end of string + we want to break immediately if the potential match len + is greater than the number of characters remaining in the + string + */ + if (p1 > end) + break; + for ( ; p1 >= p; p1--) + { + c = *p1; *p1 = '\0'; + if (strmatch (pat, p, FNMATCH_EXTFLAG) == 0) + { + *p1 = c; + *sp = p; + *ep = p1; + return 1; + } + *p1 = c; +#if 1 + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; +#endif + } + } + } + + return (0); + + case MATCH_BEG: + if (match_pattern_char (pat, string) == 0) + return (0); + + for (p = (mlen == -1) ? end : string + mlen; p >= string; p--) + { + c = *p; *p = '\0'; + if (strmatch (pat, string, FNMATCH_EXTFLAG) == 0) + { + *p = c; + *sp = string; + *ep = p; + return 1; + } + *p = c; + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + + return (0); + + case MATCH_END: + for (p = end - ((mlen == -1) ? len : mlen); p <= end; p++) + { + if (strmatch (pat, p, FNMATCH_EXTFLAG) == 0) + { + *sp = p; + *ep = end; + return 1; + } + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + + return (0); + } + + return (0); +} + +#if defined (HANDLE_MULTIBYTE) +/* Match WPAT anywhere in WSTRING and return the match boundaries. + This returns 1 in case of a successful match, 0 otherwise. Wide + character version. */ +static int +match_wpattern (wstring, indices, wstrlen, wpat, mtype, sp, ep) + wchar_t *wstring; + char **indices; + size_t wstrlen; + wchar_t *wpat; + int mtype; + char **sp, **ep; +{ + wchar_t wc, *wp, *nwpat, *wp1; + size_t len; + int mlen; + int n, n1, n2, simple; + + simple = (wpat[0] != L'\\' && wpat[0] != L'*' && wpat[0] != L'?' && wpat[0] != L'['); +#if defined (EXTENDED_GLOB) + if (extended_glob) + simple &= (wpat[1] != L'(' || (wpat[0] != L'*' && wpat[0] != L'?' && wpat[0] != L'+' && wpat[0] != L'!' && wpat[0] != L'@')); /*)*/ +#endif + + /* If the pattern doesn't match anywhere in the string, go ahead and + short-circuit right away. A minor optimization, saves a bunch of + unnecessary calls to strmatch (up to N calls for a string of N + characters) if the match is unsuccessful. To preserve the semantics + of the substring matches below, we make sure that the pattern has + `*' as first and last character, making a new pattern if necessary. */ + len = wcslen (wpat); + if (wpat[0] != L'*' || (wpat[0] == L'*' && wpat[1] == WLPAREN && extended_glob) || wpat[len - 1] != L'*') + { + wp = nwpat = (wchar_t *)xmalloc ((len + 3) * sizeof (wchar_t)); + wp1 = wpat; + if (*wp1 != L'*' || (*wp1 == '*' && wp1[1] == WLPAREN && extended_glob)) + *wp++ = L'*'; + while (*wp1 != L'\0') + *wp++ = *wp1++; + if (wp1[-1] != L'*' || wp1[-2] == L'\\') + *wp++ = L'*'; + *wp = '\0'; + } + else + nwpat = wpat; + len = wcsmatch (nwpat, wstring, FNMATCH_EXTFLAG); + if (nwpat != wpat) + free (nwpat); + if (len == FNM_NOMATCH) + return (0); + + mlen = wmatchlen (wpat, wstrlen); + +/* itrace("wmatchlen (%ls) -> %d", wpat, mlen); */ + switch (mtype) + { + case MATCH_ANY: + for (n = 0; n <= wstrlen; n++) + { + n2 = simple ? (*wpat == wstring[n]) : match_pattern_wchar (wpat, wstring + n); + if (n2) + { + n1 = (mlen == -1) ? wstrlen : n + mlen; + if (n1 > wstrlen) + break; + + for ( ; n1 >= n; n1--) + { + wc = wstring[n1]; wstring[n1] = L'\0'; + if (wcsmatch (wpat, wstring + n, FNMATCH_EXTFLAG) == 0) + { + wstring[n1] = wc; + *sp = indices[n]; + *ep = indices[n1]; + return 1; + } + wstring[n1] = wc; + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + } + } + + return (0); + + case MATCH_BEG: + if (match_pattern_wchar (wpat, wstring) == 0) + return (0); + + for (n = (mlen == -1) ? wstrlen : mlen; n >= 0; n--) + { + wc = wstring[n]; wstring[n] = L'\0'; + if (wcsmatch (wpat, wstring, FNMATCH_EXTFLAG) == 0) + { + wstring[n] = wc; + *sp = indices[0]; + *ep = indices[n]; + return 1; + } + wstring[n] = wc; + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + + return (0); + + case MATCH_END: + for (n = wstrlen - ((mlen == -1) ? wstrlen : mlen); n <= wstrlen; n++) + { + if (wcsmatch (wpat, wstring + n, FNMATCH_EXTFLAG) == 0) + { + *sp = indices[n]; + *ep = indices[wstrlen]; + return 1; + } + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + + return (0); + } + + return (0); +} +#endif /* HANDLE_MULTIBYTE */ + +static int +match_pattern (string, pat, mtype, sp, ep) + char *string, *pat; + int mtype; + char **sp, **ep; +{ +#if defined (HANDLE_MULTIBYTE) + int ret; + size_t n; + wchar_t *wstring, *wpat; + char **indices; + size_t slen, plen, mslen, mplen; +#endif + + if (string == 0 || *string == 0 || pat == 0 || *pat == 0) + return (0); + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1) + { + if (mbsmbchar (string) == 0 && mbsmbchar (pat) == 0) + return (match_upattern (string, pat, mtype, sp, ep)); + + n = xdupmbstowcs (&wpat, NULL, pat); + if (n == (size_t)-1) + return (match_upattern (string, pat, mtype, sp, ep)); + n = xdupmbstowcs (&wstring, &indices, string); + if (n == (size_t)-1) + { + free (wpat); + return (match_upattern (string, pat, mtype, sp, ep)); + } + ret = match_wpattern (wstring, indices, n, wpat, mtype, sp, ep); + + free (wpat); + free (wstring); + free (indices); + + return (ret); + } + else +#endif + return (match_upattern (string, pat, mtype, sp, ep)); +} + +static int +getpatspec (c, value) + int c; + char *value; +{ + if (c == '#') + return ((*value == '#') ? RP_LONG_LEFT : RP_SHORT_LEFT); + else /* c == '%' */ + return ((*value == '%') ? RP_LONG_RIGHT : RP_SHORT_RIGHT); +} + +/* Posix.2 says that the WORD should be run through tilde expansion, + parameter expansion, command substitution and arithmetic expansion. + This leaves the result quoted, so quote_string_for_globbing () has + to be called to fix it up for strmatch (). If QUOTED is non-zero, + it means that the entire expression was enclosed in double quotes. + This means that quoting characters in the pattern do not make any + special pattern characters quoted. For example, the `*' in the + following retains its special meaning: "${foo#'*'}". */ +static char * +getpattern (value, quoted, expandpat) + char *value; + int quoted, expandpat; +{ + char *pat, *tword; + WORD_LIST *l; +#if 0 + int i; +#endif + /* There is a problem here: how to handle single or double quotes in the + pattern string when the whole expression is between double quotes? + POSIX.2 says that enclosing double quotes do not cause the pattern to + be quoted, but does that leave us a problem with @ and array[@] and their + expansions inside a pattern? */ +#if 0 + if (expandpat && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && *tword) + { + i = 0; + pat = string_extract_double_quoted (tword, &i, 1); + free (tword); + tword = pat; + } +#endif + + /* expand_string_for_rhs () leaves WORD quoted and does not perform + word splitting. */ + l = *value ? expand_string_for_rhs (value, + (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) ? Q_PATQUOTE : quoted, + (int *)NULL, (int *)NULL) + : (WORD_LIST *)0; + pat = string_list (l); + dispose_words (l); + if (pat) + { + tword = quote_string_for_globbing (pat, QGLOB_CVTNULL); + free (pat); + pat = tword; + } + return (pat); +} + +#if 0 +/* Handle removing a pattern from a string as a result of ${name%[%]value} + or ${name#[#]value}. */ +static char * +variable_remove_pattern (value, pattern, patspec, quoted) + char *value, *pattern; + int patspec, quoted; +{ + char *tword; + + tword = remove_pattern (value, pattern, patspec); + + return (tword); +} +#endif + +static char * +list_remove_pattern (list, pattern, patspec, itype, quoted) + WORD_LIST *list; + char *pattern; + int patspec, itype, quoted; +{ + WORD_LIST *new, *l; + WORD_DESC *w; + char *tword; + + for (new = (WORD_LIST *)NULL, l = list; l; l = l->next) + { + tword = remove_pattern (l->word->word, pattern, patspec); + w = alloc_word_desc (); + w->word = tword ? tword : savestring (""); + new = make_word_list (w, new); + } + + l = REVERSE_LIST (new, WORD_LIST *); + tword = string_list_pos_params (itype, l, quoted); + dispose_words (l); + + return (tword); +} + +static char * +parameter_list_remove_pattern (itype, pattern, patspec, quoted) + int itype; + char *pattern; + int patspec, quoted; +{ + char *ret; + WORD_LIST *list; + + list = list_rest_of_args (); + if (list == 0) + return ((char *)NULL); + ret = list_remove_pattern (list, pattern, patspec, itype, quoted); + dispose_words (list); + return (ret); +} + +#if defined (ARRAY_VARS) +static char * +array_remove_pattern (var, pattern, patspec, varname, quoted) + SHELL_VAR *var; + char *pattern; + int patspec; + char *varname; /* so we can figure out how it's indexed */ + int quoted; +{ + ARRAY *a; + HASH_TABLE *h; + int itype; + char *ret; + WORD_LIST *list; + SHELL_VAR *v; + + /* compute itype from varname here */ + v = array_variable_part (varname, &ret, 0); + + /* XXX */ + if (v && invisible_p (var)) + return ((char *)NULL); + + itype = ret[0]; + + a = (v && array_p (v)) ? array_cell (v) : 0; + h = (v && assoc_p (v)) ? assoc_cell (v) : 0; + + list = a ? array_to_word_list (a) : (h ? assoc_to_word_list (h) : 0); + if (list == 0) + return ((char *)NULL); + ret = list_remove_pattern (list, pattern, patspec, itype, quoted); + dispose_words (list); + + return ret; +} +#endif /* ARRAY_VARS */ + +static char * +parameter_brace_remove_pattern (varname, value, ind, patstr, rtype, quoted, flags) + char *varname, *value; + int ind; + char *patstr; + int rtype, quoted, flags; +{ + int vtype, patspec, starsub; + char *temp1, *val, *pattern; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + this_command_name = varname; + + vtype = get_var_and_type (varname, value, ind, quoted, flags, &v, &val); + if (vtype == -1) + return ((char *)NULL); + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + patspec = getpatspec (rtype, patstr); + if (patspec == RP_LONG_LEFT || patspec == RP_LONG_RIGHT) + patstr++; + + /* Need to pass getpattern newly-allocated memory in case of expansion -- + the expansion code will free the passed string on an error. */ + temp1 = savestring (patstr); + pattern = getpattern (temp1, quoted, 1); + free (temp1); + + temp1 = (char *)NULL; /* shut up gcc */ + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + temp1 = remove_pattern (val, pattern, patspec); + if (vtype == VT_VARIABLE) + FREE (val); + if (temp1) + { + val = (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + ? quote_string (temp1) + : quote_escapes (temp1); + free (temp1); + temp1 = val; + } + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + temp1 = array_remove_pattern (v, pattern, patspec, varname, quoted); + if (temp1 && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + { + val = quote_escapes (temp1); + free (temp1); + temp1 = val; + } + break; +#endif + case VT_POSPARMS: + temp1 = parameter_list_remove_pattern (varname[0], pattern, patspec, quoted); + if (temp1 && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + { + val = quote_escapes (temp1); + free (temp1); + temp1 = val; + } + break; + } + + FREE (pattern); + return temp1; +} + +/******************************************* + * * + * Functions to expand WORD_DESCs * + * * + *******************************************/ + +/* Expand WORD, performing word splitting on the result. This does + parameter expansion, command substitution, arithmetic expansion, + word splitting, and quote removal. */ + +WORD_LIST * +expand_word (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_LIST *result, *tresult; + + tresult = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); + result = word_list_split (tresult); + dispose_words (tresult); + return (result ? dequote_list (result) : result); +} + +/* Expand WORD, but do not perform word splitting on the result. This + does parameter expansion, command substitution, arithmetic expansion, + and quote removal. */ +WORD_LIST * +expand_word_unsplit (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_LIST *result; + + expand_no_split_dollar_star = 1; +#if defined (HANDLE_MULTIBYTE) + if (ifs_firstc[0] == 0) +#else + if (ifs_firstc == 0) +#endif + word->flags |= W_NOSPLIT; + word->flags |= W_NOSPLIT2; + result = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); + expand_no_split_dollar_star = 0; + + return (result ? dequote_list (result) : result); +} + +/* Perform shell expansions on WORD, but do not perform word splitting or + quote removal on the result. Virtually identical to expand_word_unsplit; + could be combined if implementations don't diverge. */ +WORD_LIST * +expand_word_leave_quoted (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_LIST *result; + + expand_no_split_dollar_star = 1; +#if defined (HANDLE_MULTIBYTE) + if (ifs_firstc[0] == 0) +#else + if (ifs_firstc == 0) +#endif + word->flags |= W_NOSPLIT; + word->flags |= W_NOSPLIT2; + result = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); + expand_no_split_dollar_star = 0; + + return result; +} + +#if defined (PROCESS_SUBSTITUTION) + +/*****************************************************************/ +/* */ +/* Hacking Process Substitution */ +/* */ +/*****************************************************************/ + +#if !defined (HAVE_DEV_FD) +/* Named pipes must be removed explicitly with `unlink'. This keeps a list + of FIFOs the shell has open. unlink_fifo_list will walk the list and + unlink all of them. add_fifo_list adds the name of an open FIFO to the + list. NFIFO is a count of the number of FIFOs in the list. */ +#define FIFO_INCR 20 + +struct temp_fifo { + char *file; + pid_t proc; +}; + +static struct temp_fifo *fifo_list = (struct temp_fifo *)NULL; +static int nfifo; +static int fifo_list_size; + +char * +copy_fifo_list (sizep) + int *sizep; +{ + if (sizep) + *sizep = 0; + return (char *)NULL; +} + +static void +add_fifo_list (pathname) + char *pathname; +{ + if (nfifo >= fifo_list_size - 1) + { + fifo_list_size += FIFO_INCR; + fifo_list = (struct temp_fifo *)xrealloc (fifo_list, + fifo_list_size * sizeof (struct temp_fifo)); + } + + fifo_list[nfifo].file = savestring (pathname); + nfifo++; +} + +void +unlink_fifo (i) + int i; +{ + if ((fifo_list[i].proc == -1) || (kill(fifo_list[i].proc, 0) == -1)) + { + unlink (fifo_list[i].file); + free (fifo_list[i].file); + fifo_list[i].file = (char *)NULL; + fifo_list[i].proc = -1; + } +} + +void +unlink_fifo_list () +{ + int saved, i, j; + + if (nfifo == 0) + return; + + for (i = saved = 0; i < nfifo; i++) + { + if ((fifo_list[i].proc == -1) || (kill(fifo_list[i].proc, 0) == -1)) + { + unlink (fifo_list[i].file); + free (fifo_list[i].file); + fifo_list[i].file = (char *)NULL; + fifo_list[i].proc = -1; + } + else + saved++; + } + + /* If we didn't remove some of the FIFOs, compact the list. */ + if (saved) + { + for (i = j = 0; i < nfifo; i++) + if (fifo_list[i].file) + { + fifo_list[j].file = fifo_list[i].file; + fifo_list[j].proc = fifo_list[i].proc; + j++; + } + nfifo = j; + } + else + nfifo = 0; +} + +/* Take LIST, which is a bitmap denoting active FIFOs in fifo_list + from some point in the past, and close all open FIFOs in fifo_list + that are not marked as active in LIST. If LIST is NULL, close + everything in fifo_list. LSIZE is the number of elements in LIST, in + case it's larger than fifo_list_size (size of fifo_list). */ +void +close_new_fifos (list, lsize) + char *list; + int lsize; +{ + int i; + + if (list == 0) + { + unlink_fifo_list (); + return; + } + + for (i = 0; i < lsize; i++) + if (list[i] == 0 && i < fifo_list_size && fifo_list[i].proc != -1) + unlink_fifo (i); + + for (i = lsize; i < fifo_list_size; i++) + unlink_fifo (i); +} + +int +fifos_pending () +{ + return nfifo; +} + +int +num_fifos () +{ + return nfifo; +} + +static char * +make_named_pipe () +{ + char *tname; + + tname = sh_mktmpname ("sh-np", MT_USERANDOM|MT_USETMPDIR); + if (mkfifo (tname, 0600) < 0) + { + free (tname); + return ((char *)NULL); + } + + add_fifo_list (tname); + return (tname); +} + +#else /* HAVE_DEV_FD */ + +/* DEV_FD_LIST is a bitmap of file descriptors attached to pipes the shell + has open to children. NFDS is a count of the number of bits currently + set in DEV_FD_LIST. TOTFDS is a count of the highest possible number + of open files. */ +static char *dev_fd_list = (char *)NULL; +static int nfds; +static int totfds; /* The highest possible number of open files. */ + +char * +copy_fifo_list (sizep) + int *sizep; +{ + char *ret; + + if (nfds == 0 || totfds == 0) + { + if (sizep) + *sizep = 0; + return (char *)NULL; + } + + if (sizep) + *sizep = totfds; + ret = (char *)xmalloc (totfds); + return (memcpy (ret, dev_fd_list, totfds)); +} + +static void +add_fifo_list (fd) + int fd; +{ + if (dev_fd_list == 0 || fd >= totfds) + { + int ofds; + + ofds = totfds; + totfds = getdtablesize (); + if (totfds < 0 || totfds > 256) + totfds = 256; + if (fd >= totfds) + totfds = fd + 2; + + dev_fd_list = (char *)xrealloc (dev_fd_list, totfds); + memset (dev_fd_list + ofds, '\0', totfds - ofds); + } + + dev_fd_list[fd] = 1; + nfds++; +} + +int +fifos_pending () +{ + return 0; /* used for cleanup; not needed with /dev/fd */ +} + +int +num_fifos () +{ + return nfds; +} + +void +unlink_fifo (fd) + int fd; +{ + if (dev_fd_list[fd]) + { + close (fd); + dev_fd_list[fd] = 0; + nfds--; + } +} + +void +unlink_fifo_list () +{ + register int i; + + if (nfds == 0) + return; + + for (i = 0; nfds && i < totfds; i++) + unlink_fifo (i); + + nfds = 0; +} + +/* Take LIST, which is a snapshot copy of dev_fd_list from some point in + the past, and close all open fds in dev_fd_list that are not marked + as open in LIST. If LIST is NULL, close everything in dev_fd_list. + LSIZE is the number of elements in LIST, in case it's larger than + totfds (size of dev_fd_list). */ +void +close_new_fifos (list, lsize) + char *list; + int lsize; +{ + int i; + + if (list == 0) + { + unlink_fifo_list (); + return; + } + + for (i = 0; i < lsize; i++) + if (list[i] == 0 && i < totfds && dev_fd_list[i]) + unlink_fifo (i); + + for (i = lsize; i < totfds; i++) + unlink_fifo (i); +} + +#if defined (NOTDEF) +print_dev_fd_list () +{ + register int i; + + fprintf (stderr, "pid %ld: dev_fd_list:", (long)getpid ()); + fflush (stderr); + + for (i = 0; i < totfds; i++) + { + if (dev_fd_list[i]) + fprintf (stderr, " %d", i); + } + fprintf (stderr, "\n"); +} +#endif /* NOTDEF */ + +static char * +make_dev_fd_filename (fd) + int fd; +{ + char *ret, intbuf[INT_STRLEN_BOUND (int) + 1], *p; + + ret = (char *)xmalloc (sizeof (DEV_FD_PREFIX) + 8); + + strcpy (ret, DEV_FD_PREFIX); + p = inttostr (fd, intbuf, sizeof (intbuf)); + strcpy (ret + sizeof (DEV_FD_PREFIX) - 1, p); + + add_fifo_list (fd); + return (ret); +} + +#endif /* HAVE_DEV_FD */ + +/* Return a filename that will open a connection to the process defined by + executing STRING. HAVE_DEV_FD, if defined, means open a pipe and return + a filename in /dev/fd corresponding to a descriptor that is one of the + ends of the pipe. If not defined, we use named pipes on systems that have + them. Systems without /dev/fd and named pipes are out of luck. + + OPEN_FOR_READ_IN_CHILD, if 1, means open the named pipe for reading or + use the read end of the pipe and dup that file descriptor to fd 0 in + the child. If OPEN_FOR_READ_IN_CHILD is 0, we open the named pipe for + writing or use the write end of the pipe in the child, and dup that + file descriptor to fd 1 in the child. The parent does the opposite. */ + +static char * +process_substitute (string, open_for_read_in_child) + char *string; + int open_for_read_in_child; +{ + char *pathname; + int fd, result; + pid_t old_pid, pid; +#if defined (HAVE_DEV_FD) + int parent_pipe_fd, child_pipe_fd; + int fildes[2]; +#endif /* HAVE_DEV_FD */ +#if defined (JOB_CONTROL) + pid_t old_pipeline_pgrp; +#endif + + if (!string || !*string || wordexp_only) + return ((char *)NULL); + +#if !defined (HAVE_DEV_FD) + pathname = make_named_pipe (); +#else /* HAVE_DEV_FD */ + if (pipe (fildes) < 0) + { + sys_error (_("cannot make pipe for process substitution")); + return ((char *)NULL); + } + /* If OPEN_FOR_READ_IN_CHILD == 1, we want to use the write end of + the pipe in the parent, otherwise the read end. */ + parent_pipe_fd = fildes[open_for_read_in_child]; + child_pipe_fd = fildes[1 - open_for_read_in_child]; + /* Move the parent end of the pipe to some high file descriptor, to + avoid clashes with FDs used by the script. */ + parent_pipe_fd = move_to_high_fd (parent_pipe_fd, 1, 64); + + pathname = make_dev_fd_filename (parent_pipe_fd); +#endif /* HAVE_DEV_FD */ + + if (pathname == 0) + { + sys_error (_("cannot make pipe for process substitution")); + return ((char *)NULL); + } + + old_pid = last_made_pid; + +#if defined (JOB_CONTROL) + old_pipeline_pgrp = pipeline_pgrp; + pipeline_pgrp = shell_pgrp; + save_pipeline (1); +#endif /* JOB_CONTROL */ + + pid = make_child ((char *)NULL, 1); + if (pid == 0) + { + reset_terminating_signals (); /* XXX */ + free_pushed_string_input (); + /* Cancel traps, in trap.c. */ + restore_original_signals (); /* XXX - what about special builtins? bash-4.2 */ + setup_async_signals (); + subshell_environment |= SUBSHELL_COMSUB|SUBSHELL_PROCSUB; + } + +#if defined (JOB_CONTROL) + set_sigchld_handler (); + stop_making_children (); + /* XXX - should we only do this in the parent? (as in command subst) */ + pipeline_pgrp = old_pipeline_pgrp; +#endif /* JOB_CONTROL */ + + if (pid < 0) + { + sys_error (_("cannot make child for process substitution")); + free (pathname); +#if defined (HAVE_DEV_FD) + close (parent_pipe_fd); + close (child_pipe_fd); +#endif /* HAVE_DEV_FD */ + return ((char *)NULL); + } + + if (pid > 0) + { +#if defined (JOB_CONTROL) + restore_pipeline (1); +#endif + +#if !defined (HAVE_DEV_FD) + fifo_list[nfifo-1].proc = pid; +#endif + + last_made_pid = old_pid; + +#if defined (JOB_CONTROL) && defined (PGRP_PIPE) + close_pgrp_pipe (); +#endif /* JOB_CONTROL && PGRP_PIPE */ + +#if defined (HAVE_DEV_FD) + close (child_pipe_fd); +#endif /* HAVE_DEV_FD */ + + return (pathname); + } + + set_sigint_handler (); + +#if defined (JOB_CONTROL) + set_job_control (0); +#endif /* JOB_CONTROL */ + +#if !defined (HAVE_DEV_FD) + /* Open the named pipe in the child. */ + fd = open (pathname, open_for_read_in_child ? O_RDONLY : O_WRONLY); + if (fd < 0) + { + /* Two separate strings for ease of translation. */ + if (open_for_read_in_child) + sys_error (_("cannot open named pipe %s for reading"), pathname); + else + sys_error (_("cannot open named pipe %s for writing"), pathname); + + exit (127); + } + if (open_for_read_in_child) + { + if (sh_unset_nodelay_mode (fd) < 0) + { + sys_error (_("cannot reset nodelay mode for fd %d"), fd); + exit (127); + } + } +#else /* HAVE_DEV_FD */ + fd = child_pipe_fd; +#endif /* HAVE_DEV_FD */ + + if (dup2 (fd, open_for_read_in_child ? 0 : 1) < 0) + { + sys_error (_("cannot duplicate named pipe %s as fd %d"), pathname, + open_for_read_in_child ? 0 : 1); + exit (127); + } + + if (fd != (open_for_read_in_child ? 0 : 1)) + close (fd); + + /* Need to close any files that this process has open to pipes inherited + from its parent. */ + if (current_fds_to_close) + { + close_fd_bitmap (current_fds_to_close); + current_fds_to_close = (struct fd_bitmap *)NULL; + } + +#if defined (HAVE_DEV_FD) + /* Make sure we close the parent's end of the pipe and clear the slot + in the fd list so it is not closed later, if reallocated by, for + instance, pipe(2). */ + close (parent_pipe_fd); + dev_fd_list[parent_pipe_fd] = 0; +#endif /* HAVE_DEV_FD */ + + /* subshells shouldn't have this flag, which controls using the temporary + environment for variable lookups. */ + expanding_redir = 0; + + result = parse_and_execute (string, "process substitution", (SEVAL_NONINT|SEVAL_NOHIST)); + +#if !defined (HAVE_DEV_FD) + /* Make sure we close the named pipe in the child before we exit. */ + close (open_for_read_in_child ? 0 : 1); +#endif /* !HAVE_DEV_FD */ + + last_command_exit_value = result; + result = run_exit_trap (); + exit (result); + /*NOTREACHED*/ +} +#endif /* PROCESS_SUBSTITUTION */ + +/***********************************/ +/* */ +/* Command Substitution */ +/* */ +/***********************************/ + +static char * +read_comsub (fd, quoted, rflag) + int fd, quoted; + int *rflag; +{ + char *istring, buf[128], *bufp, *s; + int istring_index, istring_size, c, tflag, skip_ctlesc, skip_ctlnul; + ssize_t bufn; + + istring = (char *)NULL; + istring_index = istring_size = bufn = tflag = 0; + + for (skip_ctlesc = skip_ctlnul = 0, s = ifs_value; s && *s; s++) + skip_ctlesc |= *s == CTLESC, skip_ctlnul |= *s == CTLNUL; + + /* Read the output of the command through the pipe. This may need to be + changed to understand multibyte characters in the future. */ + while (1) + { + if (fd < 0) + break; + if (--bufn <= 0) + { + bufn = zread (fd, buf, sizeof (buf)); + if (bufn <= 0) + break; + bufp = buf; + } + c = *bufp++; + + if (c == 0) + { +#if 0 + internal_warning ("read_comsub: ignored null byte in input"); +#endif + continue; + } + + /* Add the character to ISTRING, possibly after resizing it. */ + RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, DEFAULT_ARRAY_SIZE); + + /* This is essentially quote_string inline */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) /* || c == CTLESC || c == CTLNUL */) + istring[istring_index++] = CTLESC; + /* Escape CTLESC and CTLNUL in the output to protect those characters + from the rest of the word expansions (word splitting and globbing.) + This is essentially quote_escapes inline. */ + else if (skip_ctlesc == 0 && c == CTLESC) + { + tflag |= W_HASCTLESC; + istring[istring_index++] = CTLESC; + } + else if ((skip_ctlnul == 0 && c == CTLNUL) || (c == ' ' && (ifs_value && *ifs_value == 0))) + istring[istring_index++] = CTLESC; + + istring[istring_index++] = c; + +#if 0 +#if defined (__CYGWIN__) + if (c == '\n' && istring_index > 1 && istring[istring_index - 2] == '\r') + { + istring_index--; + istring[istring_index - 1] = '\n'; + } +#endif +#endif + } + + if (istring) + istring[istring_index] = '\0'; + + /* If we read no output, just return now and save ourselves some + trouble. */ + if (istring_index == 0) + { + FREE (istring); + if (rflag) + *rflag = tflag; + return (char *)NULL; + } + + /* Strip trailing newlines from the output of the command. */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + { + while (istring_index > 0) + { + if (istring[istring_index - 1] == '\n') + { + --istring_index; + + /* If the newline was quoted, remove the quoting char. */ + if (istring[istring_index - 1] == CTLESC) + --istring_index; + } + else + break; + } + istring[istring_index] = '\0'; + } + else + strip_trailing (istring, istring_index - 1, 1); + + if (rflag) + *rflag = tflag; + return istring; +} + +/* Perform command substitution on STRING. This returns a WORD_DESC * with the + contained string possibly quoted. */ +WORD_DESC * +command_substitute (string, quoted) + char *string; + int quoted; +{ + pid_t pid, old_pid, old_pipeline_pgrp, old_async_pid; + char *istring; + int result, fildes[2], function_value, pflags, rc, tflag; + WORD_DESC *ret; + + istring = (char *)NULL; + + /* Don't fork () if there is no need to. In the case of no command to + run, just return NULL. */ + if (!string || !*string || (string[0] == '\n' && !string[1])) + return ((WORD_DESC *)NULL); + + if (wordexp_only && read_but_dont_execute) + { + last_command_exit_value = EX_WEXPCOMSUB; + jump_to_top_level (EXITPROG); + } + + /* We're making the assumption here that the command substitution will + eventually run a command from the file system. Since we'll run + maybe_make_export_env in this subshell before executing that command, + the parent shell and any other shells it starts will have to remake + the environment. If we make it before we fork, other shells won't + have to. Don't bother if we have any temporary variable assignments, + though, because the export environment will be remade after this + command completes anyway, but do it if all the words to be expanded + are variable assignments. */ + if (subst_assign_varlist == 0 || garglist == 0) + maybe_make_export_env (); /* XXX */ + + /* Flags to pass to parse_and_execute() */ + pflags = (interactive && sourcelevel == 0) ? SEVAL_RESETLINE : 0; + + /* Pipe the output of executing STRING into the current shell. */ + if (pipe (fildes) < 0) + { + sys_error (_("cannot make pipe for command substitution")); + goto error_exit; + } + + old_pid = last_made_pid; +#if defined (JOB_CONTROL) + old_pipeline_pgrp = pipeline_pgrp; + /* Don't reset the pipeline pgrp if we're already a subshell in a pipeline. */ + if ((subshell_environment & SUBSHELL_PIPE) == 0) + pipeline_pgrp = shell_pgrp; + cleanup_the_pipeline (); +#endif /* JOB_CONTROL */ + + old_async_pid = last_asynchronous_pid; + pid = make_child ((char *)NULL, subshell_environment&SUBSHELL_ASYNC); + last_asynchronous_pid = old_async_pid; + + if (pid == 0) + { + /* Reset the signal handlers in the child, but don't free the + trap strings. Set a flag noting that we have to free the + trap strings if we run trap to change a signal disposition. */ + reset_signal_handlers (); + subshell_environment |= SUBSHELL_RESETTRAP; + } + +#if defined (JOB_CONTROL) + /* XXX DO THIS ONLY IN PARENT ? XXX */ + set_sigchld_handler (); + stop_making_children (); + if (pid != 0) + pipeline_pgrp = old_pipeline_pgrp; +#else + stop_making_children (); +#endif /* JOB_CONTROL */ + + if (pid < 0) + { + sys_error (_("cannot make child for command substitution")); + error_exit: + + last_made_pid = old_pid; + + FREE (istring); + close (fildes[0]); + close (fildes[1]); + return ((WORD_DESC *)NULL); + } + + if (pid == 0) + { + set_sigint_handler (); /* XXX */ + + free_pushed_string_input (); + + if (dup2 (fildes[1], 1) < 0) + { + sys_error (_("command_substitute: cannot duplicate pipe as fd 1")); + exit (EXECUTION_FAILURE); + } + + /* If standard output is closed in the parent shell + (such as after `exec >&-'), file descriptor 1 will be + the lowest available file descriptor, and end up in + fildes[0]. This can happen for stdin and stderr as well, + but stdout is more important -- it will cause no output + to be generated from this command. */ + if ((fildes[1] != fileno (stdin)) && + (fildes[1] != fileno (stdout)) && + (fildes[1] != fileno (stderr))) + close (fildes[1]); + + if ((fildes[0] != fileno (stdin)) && + (fildes[0] != fileno (stdout)) && + (fildes[0] != fileno (stderr))) + close (fildes[0]); + +#ifdef __CYGWIN__ + /* Let stdio know the fd may have changed from text to binary mode, and + make sure to preserve stdout line buffering. */ + freopen (NULL, "w", stdout); + sh_setlinebuf (stdout); +#endif /* __CYGWIN__ */ + + /* The currently executing shell is not interactive. */ + interactive = 0; + + /* This is a subshell environment. */ + subshell_environment |= SUBSHELL_COMSUB; + + /* When not in POSIX mode, command substitution does not inherit + the -e flag. */ + if (posixly_correct == 0) + { + builtin_ignoring_errexit = 0; + change_flag ('e', FLAG_OFF); + set_shellopts (); + } + + remove_quoted_escapes (string); + + startup_state = 2; /* see if we can avoid a fork */ + /* Give command substitution a place to jump back to on failure, + so we don't go back up to main (). */ + result = setjmp_nosigs (top_level); + + /* If we're running a command substitution inside a shell function, + trap `return' so we don't return from the function in the subshell + and go off to never-never land. */ + if (result == 0 && return_catch_flag) + function_value = setjmp_nosigs (return_catch); + else + function_value = 0; + + if (result == ERREXIT) + rc = last_command_exit_value; + else if (result == EXITPROG) + rc = last_command_exit_value; + else if (result) + rc = EXECUTION_FAILURE; + else if (function_value) + rc = return_catch_value; + else + { + subshell_level++; + rc = parse_and_execute (string, "command substitution", pflags|SEVAL_NOHIST); + subshell_level--; + } + + last_command_exit_value = rc; + rc = run_exit_trap (); +#if defined (PROCESS_SUBSTITUTION) + unlink_fifo_list (); +#endif + exit (rc); + } + else + { +#if defined (JOB_CONTROL) && defined (PGRP_PIPE) + close_pgrp_pipe (); +#endif /* JOB_CONTROL && PGRP_PIPE */ + + close (fildes[1]); + + tflag = 0; + istring = read_comsub (fildes[0], quoted, &tflag); + + close (fildes[0]); + + current_command_subst_pid = pid; + last_command_exit_value = wait_for (pid); + last_command_subst_pid = pid; + last_made_pid = old_pid; + +#if defined (JOB_CONTROL) + /* If last_command_exit_value > 128, then the substituted command + was terminated by a signal. If that signal was SIGINT, then send + SIGINT to ourselves. This will break out of loops, for instance. */ + if (last_command_exit_value == (128 + SIGINT) && last_command_exit_signal == SIGINT) + kill (getpid (), SIGINT); + + /* wait_for gives the terminal back to shell_pgrp. If some other + process group should have it, give it away to that group here. + pipeline_pgrp is non-zero only while we are constructing a + pipeline, so what we are concerned about is whether or not that + pipeline was started in the background. A pipeline started in + the background should never get the tty back here. */ + if (interactive && pipeline_pgrp != (pid_t)0 && (subshell_environment & SUBSHELL_ASYNC) == 0) + give_terminal_to (pipeline_pgrp, 0); +#endif /* JOB_CONTROL */ + + ret = alloc_word_desc (); + ret->word = istring; + ret->flags = tflag; + + return ret; + } +} + +/******************************************************** + * * + * Utility functions for parameter expansion * + * * + ********************************************************/ + +#if defined (ARRAY_VARS) + +static arrayind_t +array_length_reference (s) + char *s; +{ + int len; + arrayind_t ind; + char *akey; + char *t, c; + ARRAY *array; + HASH_TABLE *h; + SHELL_VAR *var; + + var = array_variable_part (s, &t, &len); + + /* If unbound variables should generate an error, report one and return + failure. */ + if ((var == 0 || invisible_p (var) || (assoc_p (var) == 0 && array_p (var) == 0)) && unbound_vars_is_error) + { + c = *--t; + *t = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (s); + *t = c; + return (-1); + } + else if (var == 0 || invisible_p (var)) + return 0; + + /* We support a couple of expansions for variables that are not arrays. + We'll return the length of the value for v[0], and 1 for v[@] or + v[*]. Return 0 for everything else. */ + + array = array_p (var) ? array_cell (var) : (ARRAY *)NULL; + h = assoc_p (var) ? assoc_cell (var) : (HASH_TABLE *)NULL; + + if (ALL_ELEMENT_SUB (t[0]) && t[1] == ']') + { + if (assoc_p (var)) + return (h ? assoc_num_elements (h) : 0); + else if (array_p (var)) + return (array ? array_num_elements (array) : 0); + else + return (var_isset (var) ? 1 : 0); + } + + if (assoc_p (var)) + { + t[len - 1] = '\0'; + akey = expand_assignment_string_to_string (t, 0); /* [ */ + t[len - 1] = ']'; + if (akey == 0 || *akey == 0) + { + err_badarraysub (t); + FREE (akey); + return (-1); + } + t = assoc_reference (assoc_cell (var), akey); + free (akey); + } + else + { + ind = array_expand_index (var, t, len); + /* negative subscripts to indexed arrays count back from end */ + if (var && array_p (var) && ind < 0) + ind = array_max_index (array_cell (var)) + 1 + ind; + if (ind < 0) + { + err_badarraysub (t); + return (-1); + } + if (array_p (var)) + t = array_reference (array, ind); + else + t = (ind == 0) ? value_cell (var) : (char *)NULL; + } + + len = MB_STRLEN (t); + return (len); +} +#endif /* ARRAY_VARS */ + +static int +valid_brace_expansion_word (name, var_is_special) + char *name; + int var_is_special; +{ + if (DIGIT (*name) && all_digits (name)) + return 1; + else if (var_is_special) + return 1; +#if defined (ARRAY_VARS) + else if (valid_array_reference (name)) + return 1; +#endif /* ARRAY_VARS */ + else if (legal_identifier (name)) + return 1; + else + return 0; +} + +static int +chk_atstar (name, quoted, quoted_dollar_atp, contains_dollar_at) + char *name; + int quoted; + int *quoted_dollar_atp, *contains_dollar_at; +{ + char *temp1; + + if (name == 0) + { + if (quoted_dollar_atp) + *quoted_dollar_atp = 0; + if (contains_dollar_at) + *contains_dollar_at = 0; + return 0; + } + + /* check for $@ and $* */ + if (name[0] == '@' && name[1] == 0) + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } + else if (name[0] == '*' && name[1] == '\0' && quoted == 0) + { + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } + + /* Now check for ${array[@]} and ${array[*]} */ +#if defined (ARRAY_VARS) + else if (valid_array_reference (name)) + { + temp1 = mbschr (name, '['); + if (temp1 && temp1[1] == '@' && temp1[2] == ']') + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } /* [ */ + /* ${array[*]}, when unquoted, should be treated like ${array[@]}, + which should result in separate words even when IFS is unset. */ + if (temp1 && temp1[1] == '*' && temp1[2] == ']' && quoted == 0) + { + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } + } +#endif + return 0; +} + +/* Parameter expand NAME, and return a new string which is the expansion, + or NULL if there was no expansion. + VAR_IS_SPECIAL is non-zero if NAME is one of the special variables in + the shell, e.g., "@", "$", "*", etc. QUOTED, if non-zero, means that + NAME was found inside of a double-quoted expression. */ +static WORD_DESC * +parameter_brace_expand_word (name, var_is_special, quoted, pflags, indp) + char *name; + int var_is_special, quoted, pflags; + arrayind_t *indp; +{ + WORD_DESC *ret; + char *temp, *tt; + intmax_t arg_index; + SHELL_VAR *var; + int atype, rflags; + arrayind_t ind; + + ret = 0; + temp = 0; + rflags = 0; + + if (indp) + *indp = INTMAX_MIN; + + /* Handle multiple digit arguments, as in ${11}. */ + if (legal_number (name, &arg_index)) + { + tt = get_dollar_var_value (arg_index); + if (tt) + temp = (*tt && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + ? quote_string (tt) + : quote_escapes (tt); + else + temp = (char *)NULL; + FREE (tt); + } + else if (var_is_special) /* ${@} */ + { + int sindex; + tt = (char *)xmalloc (2 + strlen (name)); + tt[sindex = 0] = '$'; + strcpy (tt + 1, name); + + ret = param_expand (tt, &sindex, quoted, (int *)NULL, (int *)NULL, + (int *)NULL, (int *)NULL, pflags); + free (tt); + } +#if defined (ARRAY_VARS) + else if (valid_array_reference (name)) + { +expand_arrayref: + /* XXX - does this leak if name[@] or name[*]? */ + if (pflags & PF_ASSIGNRHS) + { + temp = array_variable_name (name, &tt, (int *)0); + if (ALL_ELEMENT_SUB (tt[0]) && tt[1] == ']') + temp = array_value (name, quoted|Q_DOUBLE_QUOTES, 0, &atype, &ind); + else + temp = array_value (name, quoted, 0, &atype, &ind); + } + else + temp = array_value (name, quoted, 0, &atype, &ind); + if (atype == 0 && temp) + { + temp = (*temp && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + ? quote_string (temp) + : quote_escapes (temp); + rflags |= W_ARRAYIND; + if (indp) + *indp = ind; + } + else if (atype == 1 && temp && QUOTED_NULL (temp) && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + rflags |= W_HASQUOTEDNULL; + } +#endif + else if (var = find_variable (name)) + { + if (var_isset (var) && invisible_p (var) == 0) + { +#if defined (ARRAY_VARS) + if (assoc_p (var)) + temp = assoc_reference (assoc_cell (var), "0"); + else if (array_p (var)) + temp = array_reference (array_cell (var), 0); + else + temp = value_cell (var); +#else + temp = value_cell (var); +#endif + + if (temp) + temp = (*temp && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + ? quote_string (temp) + : quote_escapes (temp); + } + else + temp = (char *)NULL; + } + else if (var = find_variable_last_nameref (name)) + { + temp = nameref_cell (var); +#if defined (ARRAY_VARS) + /* Handle expanding nameref whose value is x[n] */ + if (temp && *temp && valid_array_reference (temp)) + { + name = temp; + goto expand_arrayref; + } + else +#endif + /* y=2 ; typeset -n x=y; echo ${x} is not the same as echo ${2} in ksh */ + if (temp && *temp && legal_identifier (temp) == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("%s: invalid variable name for name reference"), temp); + temp = &expand_param_error; + } + else + temp = (char *)NULL; + } + else + temp = (char *)NULL; + + if (ret == 0) + { + ret = alloc_word_desc (); + ret->word = temp; + ret->flags |= rflags; + } + return ret; +} + +static char * +parameter_brace_find_indir (name, var_is_special, quoted, find_nameref) + char *name; + int var_is_special, quoted, find_nameref; +{ + char *temp, *t; + WORD_DESC *w; + SHELL_VAR *v; + + if (find_nameref && var_is_special == 0 && (v = find_variable_last_nameref (name)) && + nameref_p (v) && (t = nameref_cell (v)) && *t) + return (savestring (t)); + + /* If var_is_special == 0, and name is not an array reference, this does + more expansion than necessary. It should really look up the variable's + value and not try to expand it. */ + w = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND, 0); + t = w->word; + /* Have to dequote here if necessary */ + if (t) + { + temp = (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + ? dequote_string (t) + : dequote_escapes (t); + free (t); + t = temp; + } + dispose_word_desc (w); + + return t; +} + +/* Expand an indirect reference to a variable: ${!NAME} expands to the + value of the variable whose name is the value of NAME. */ +static WORD_DESC * +parameter_brace_expand_indir (name, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at) + char *name; + int var_is_special, quoted; + int *quoted_dollar_atp, *contains_dollar_at; +{ + char *temp, *t; + WORD_DESC *w; + SHELL_VAR *v; + + /* See if it's a nameref first, behave in ksh93-compatible fashion. + There is at least one incompatibility: given ${!foo[0]} where foo=bar, + bash performs an indirect lookup on foo[0] and expands the result; + ksh93 expands bar[0]. We could do that here -- there are enough usable + primitives to do that -- but do not at this point. */ + if (var_is_special == 0 && (v = find_variable_last_nameref (name))) + { + if (nameref_p (v) && (t = nameref_cell (v)) && *t) + { + w = alloc_word_desc (); + w->word = savestring (t); + w->flags = 0; + return w; + } + } + + t = parameter_brace_find_indir (name, var_is_special, quoted, 0); + + chk_atstar (t, quoted, quoted_dollar_atp, contains_dollar_at); + if (t == 0) + return (WORD_DESC *)NULL; + + w = parameter_brace_expand_word (t, SPECIAL_VAR(t, 0), quoted, 0, 0); + free (t); + + return w; +} + +/* Expand the right side of a parameter expansion of the form ${NAMEcVALUE}, + depending on the value of C, the separating character. C can be one of + "-", "+", or "=". QUOTED is true if the entire brace expression occurs + between double quotes. */ +static WORD_DESC * +parameter_brace_expand_rhs (name, value, c, quoted, qdollaratp, hasdollarat) + char *name, *value; + int c, quoted, *qdollaratp, *hasdollarat; +{ + WORD_DESC *w; + WORD_LIST *l; + char *t, *t1, *temp; + int hasdol; + + /* If the entire expression is between double quotes, we want to treat + the value as a double-quoted string, with the exception that we strip + embedded unescaped double quotes (for sh backwards compatibility). */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && *value) + { + hasdol = 0; + temp = string_extract_double_quoted (value, &hasdol, 1); + } + else + temp = value; + + w = alloc_word_desc (); + hasdol = 0; + /* XXX was 0 not quoted */ + l = *temp ? expand_string_for_rhs (temp, quoted, &hasdol, (int *)NULL) + : (WORD_LIST *)0; + if (hasdollarat) + *hasdollarat = hasdol || (l && l->next); + if (temp != value) + free (temp); + if (l) + { + /* The expansion of TEMP returned something. We need to treat things + slightly differently if HASDOL is non-zero. If we have "$@", the + individual words have already been quoted. We need to turn them + into a string with the words separated by the first character of + $IFS without any additional quoting, so string_list_dollar_at won't + do the right thing. We use string_list_dollar_star instead. */ + temp = (hasdol || l->next) ? string_list_dollar_star (l) : string_list (l); + + /* If l->next is not null, we know that TEMP contained "$@", since that + is the only expansion that creates more than one word. */ + if (qdollaratp && ((hasdol && quoted) || l->next)) + *qdollaratp = 1; + /* If we have a quoted null result (QUOTED_NULL(temp)) and the word is + a quoted null (l->next == 0 && QUOTED_NULL(l->word->word)), the + flags indicate it (l->word->flags & W_HASQUOTEDNULL), and the + expansion is quoted (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + (which is more paranoia than anything else), we need to return the + quoted null string and set the flags to indicate it. */ + if (l->next == 0 && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && QUOTED_NULL (temp) && QUOTED_NULL (l->word->word) && (l->word->flags & W_HASQUOTEDNULL)) + { + w->flags |= W_HASQUOTEDNULL; + } + dispose_words (l); + } + else if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && hasdol) + { + /* The brace expansion occurred between double quotes and there was + a $@ in TEMP. It does not matter if the $@ is quoted, as long as + it does not expand to anything. In this case, we want to return + a quoted empty string. */ + temp = make_quoted_char ('\0'); + w->flags |= W_HASQUOTEDNULL; + } + else + temp = (char *)NULL; + + if (c == '-' || c == '+') + { + w->word = temp; + return w; + } + + /* c == '=' */ + t = temp ? savestring (temp) : savestring (""); + t1 = dequote_string (t); + free (t); +#if defined (ARRAY_VARS) + if (valid_array_reference (name)) + assign_array_element (name, t1, 0); + else +#endif /* ARRAY_VARS */ + bind_variable (name, t1, 0); +#if 0 + if (STREQ (name, "IFS") == 0) +#endif + stupidly_hack_special_variables (name); + + /* From Posix group discussion Feb-March 2010. Issue 7 0000221 */ + free (temp); + + w->word = t1; + return w; +} + +/* Deal with the right hand side of a ${name:?value} expansion in the case + that NAME is null or not set. If VALUE is non-null it is expanded and + used as the error message to print, otherwise a standard message is + printed. */ +static void +parameter_brace_expand_error (name, value) + char *name, *value; +{ + WORD_LIST *l; + char *temp; + + last_command_exit_value = EXECUTION_FAILURE; /* ensure it's non-zero */ + if (value && *value) + { + l = expand_string (value, 0); + temp = string_list (l); + report_error ("%s: %s", name, temp ? temp : ""); /* XXX was value not "" */ + FREE (temp); + dispose_words (l); + } + else + report_error (_("%s: parameter null or not set"), name); + + /* Free the data we have allocated during this expansion, since we + are about to longjmp out. */ + free (name); + FREE (value); +} + +/* Return 1 if NAME is something for which parameter_brace_expand_length is + OK to do. */ +static int +valid_length_expression (name) + char *name; +{ + return (name[1] == '\0' || /* ${#} */ + ((sh_syntaxtab[(unsigned char) name[1]] & CSPECVAR) && name[2] == '\0') || /* special param */ + (DIGIT (name[1]) && all_digits (name + 1)) || /* ${#11} */ +#if defined (ARRAY_VARS) + valid_array_reference (name + 1) || /* ${#a[7]} */ +#endif + legal_identifier (name + 1)); /* ${#PS1} */ +} + +/* Handle the parameter brace expansion that requires us to return the + length of a parameter. */ +static intmax_t +parameter_brace_expand_length (name) + char *name; +{ + char *t, *newname; + intmax_t number, arg_index; + WORD_LIST *list; +#if defined (ARRAY_VARS) + SHELL_VAR *var; +#endif + + if (name[1] == '\0') /* ${#} */ + number = number_of_args (); + else if ((name[1] == '@' || name[1] == '*') && name[2] == '\0') /* ${#@}, ${#*} */ + number = number_of_args (); + else if ((sh_syntaxtab[(unsigned char) name[1]] & CSPECVAR) && name[2] == '\0') + { + /* Take the lengths of some of the shell's special parameters. */ + switch (name[1]) + { + case '-': + t = which_set_flags (); + break; + case '?': + t = itos (last_command_exit_value); + break; + case '$': + t = itos (dollar_dollar_pid); + break; + case '!': + if (last_asynchronous_pid == NO_PID) + t = (char *)NULL; /* XXX - error if set -u set? */ + else + t = itos (last_asynchronous_pid); + break; + case '#': + t = itos (number_of_args ()); + break; + } + number = STRLEN (t); + FREE (t); + } +#if defined (ARRAY_VARS) + else if (valid_array_reference (name + 1)) + number = array_length_reference (name + 1); +#endif /* ARRAY_VARS */ + else + { + number = 0; + + if (legal_number (name + 1, &arg_index)) /* ${#1} */ + { + t = get_dollar_var_value (arg_index); + if (t == 0 && unbound_vars_is_error) + return INTMAX_MIN; + number = MB_STRLEN (t); + FREE (t); + } +#if defined (ARRAY_VARS) + else if ((var = find_variable (name + 1)) && (invisible_p (var) == 0) && (array_p (var) || assoc_p (var))) + { + if (assoc_p (var)) + t = assoc_reference (assoc_cell (var), "0"); + else + t = array_reference (array_cell (var), 0); + if (t == 0 && unbound_vars_is_error) + return INTMAX_MIN; + number = MB_STRLEN (t); + } +#endif + else /* ${#PS1} */ + { + newname = savestring (name); + newname[0] = '$'; + list = expand_string (newname, Q_DOUBLE_QUOTES); + t = list ? string_list (list) : (char *)NULL; + free (newname); + if (list) + dispose_words (list); + + number = t ? MB_STRLEN (t) : 0; + FREE (t); + } + } + + return (number); +} + +/* Skip characters in SUBSTR until DELIM. SUBSTR is an arithmetic expression, + so we do some ad-hoc parsing of an arithmetic expression to find + the first DELIM, instead of using strchr(3). Two rules: + 1. If the substring contains a `(', read until closing `)'. + 2. If the substring contains a `?', read past one `:' for each `?'. +*/ + +static char * +skiparith (substr, delim) + char *substr; + int delim; +{ + size_t sublen; + int skipcol, pcount, i; + DECLARE_MBSTATE; + + sublen = strlen (substr); + i = skipcol = pcount = 0; + while (substr[i]) + { + /* Balance parens */ + if (substr[i] == LPAREN) + { + pcount++; + i++; + continue; + } + if (substr[i] == RPAREN && pcount) + { + pcount--; + i++; + continue; + } + if (pcount) + { + ADVANCE_CHAR (substr, sublen, i); + continue; + } + + /* Skip one `:' for each `?' */ + if (substr[i] == ':' && skipcol) + { + skipcol--; + i++; + continue; + } + if (substr[i] == delim) + break; + if (substr[i] == '?') + { + skipcol++; + i++; + continue; + } + ADVANCE_CHAR (substr, sublen, i); + } + + return (substr + i); +} + +/* Verify and limit the start and end of the desired substring. If + VTYPE == 0, a regular shell variable is being used; if it is 1, + then the positional parameters are being used; if it is 2, then + VALUE is really a pointer to an array variable that should be used. + Return value is 1 if both values were OK, 0 if there was a problem + with an invalid expression, or -1 if the values were out of range. */ +static int +verify_substring_values (v, value, substr, vtype, e1p, e2p) + SHELL_VAR *v; + char *value, *substr; + int vtype; + intmax_t *e1p, *e2p; +{ + char *t, *temp1, *temp2; + arrayind_t len; + int expok; +#if defined (ARRAY_VARS) + ARRAY *a; + HASH_TABLE *h; +#endif + + /* duplicate behavior of strchr(3) */ + t = skiparith (substr, ':'); + if (*t && *t == ':') + *t = '\0'; + else + t = (char *)0; + + temp1 = expand_arith_string (substr, Q_DOUBLE_QUOTES); + *e1p = evalexp (temp1, &expok); + free (temp1); + if (expok == 0) + return (0); + + len = -1; /* paranoia */ + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + len = MB_STRLEN (value); + break; + case VT_POSPARMS: + len = number_of_args () + 1; + if (*e1p == 0) + len++; /* add one arg if counting from $0 */ + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + /* For arrays, the first value deals with array indices. Negative + offsets count from one past the array's maximum index. Associative + arrays treat the number of elements as the maximum index. */ + if (assoc_p (v)) + { + h = assoc_cell (v); + len = assoc_num_elements (h) + (*e1p < 0); + } + else + { + a = (ARRAY *)value; + len = array_max_index (a) + (*e1p < 0); /* arrays index from 0 to n - 1 */ + } + break; +#endif + } + + if (len == -1) /* paranoia */ + return -1; + + if (*e1p < 0) /* negative offsets count from end */ + *e1p += len; + + if (*e1p > len || *e1p < 0) + return (-1); + +#if defined (ARRAY_VARS) + /* For arrays, the second offset deals with the number of elements. */ + if (vtype == VT_ARRAYVAR) + len = assoc_p (v) ? assoc_num_elements (h) : array_num_elements (a); +#endif + + if (t) + { + t++; + temp2 = savestring (t); + temp1 = expand_arith_string (temp2, Q_DOUBLE_QUOTES); + free (temp2); + t[-1] = ':'; + *e2p = evalexp (temp1, &expok); + free (temp1); + if (expok == 0) + return (0); +#if 1 + if ((vtype == VT_ARRAYVAR || vtype == VT_POSPARMS) && *e2p < 0) +#else + /* bash-4.3: allow positional parameter length < 0 to count backwards + from end of positional parameters */ + if (vtype == VT_ARRAYVAR && *e2p < 0) +#endif + { + internal_error (_("%s: substring expression < 0"), t); + return (0); + } +#if defined (ARRAY_VARS) + /* In order to deal with sparse arrays, push the intelligence about how + to deal with the number of elements desired down to the array- + specific functions. */ + if (vtype != VT_ARRAYVAR) +#endif + { + if (*e2p < 0) + { + *e2p += len; + if (*e2p < 0 || *e2p < *e1p) + { + internal_error (_("%s: substring expression < 0"), t); + return (0); + } + } + else + *e2p += *e1p; /* want E2 chars starting at E1 */ + if (*e2p > len) + *e2p = len; + } + } + else + *e2p = len; + + return (1); +} + +/* Return the type of variable specified by VARNAME (simple variable, + positional param, or array variable). Also return the value specified + by VARNAME (value of a variable or a reference to an array element). + QUOTED is the standard description of quoting state, using Q_* defines. + FLAGS is currently a set of flags to pass to array_value. If IND is + non-null and not INTMAX_MIN, and FLAGS includes AV_USEIND, IND is + passed to array_value so the array index is not computed again. + If this returns VT_VARIABLE, the caller assumes that CTLESC and CTLNUL + characters in the value are quoted with CTLESC and takes appropriate + steps. For convenience, *VALP is set to the dequoted VALUE. */ +static int +get_var_and_type (varname, value, ind, quoted, flags, varp, valp) + char *varname, *value; + arrayind_t ind; + int quoted, flags; + SHELL_VAR **varp; + char **valp; +{ + int vtype, want_indir; + char *temp, *vname; + WORD_DESC *wd; +#if defined (ARRAY_VARS) + SHELL_VAR *v; +#endif + arrayind_t lind; + + want_indir = *varname == '!' && + (legal_variable_starter ((unsigned char)varname[1]) || DIGIT (varname[1]) + || VALID_INDIR_PARAM (varname[1])); + if (want_indir) + vname = parameter_brace_find_indir (varname+1, SPECIAL_VAR (varname, 1), quoted, 1); + else + vname = varname; + + /* This sets vtype to VT_VARIABLE or VT_POSPARMS */ + vtype = (vname[0] == '@' || vname[0] == '*') && vname[1] == '\0'; + if (vtype == VT_POSPARMS && vname[0] == '*') + vtype |= VT_STARSUB; + *varp = (SHELL_VAR *)NULL; + +#if defined (ARRAY_VARS) + if (valid_array_reference (vname)) + { + v = array_variable_part (vname, &temp, (int *)0); + /* If we want to signal array_value to use an already-computed index, + set LIND to that index */ + lind = (ind != INTMAX_MIN && (flags & AV_USEIND)) ? ind : 0; + if (v && invisible_p (v)) + { + vtype = VT_ARRAYMEMBER; + *varp = (SHELL_VAR *)NULL; + *valp = (char *)NULL; + } + if (v && (array_p (v) || assoc_p (v))) + { /* [ */ + if (ALL_ELEMENT_SUB (temp[0]) && temp[1] == ']') + { + /* Callers have to differentiate between indexed and associative */ + vtype = VT_ARRAYVAR; + if (temp[0] == '*') + vtype |= VT_STARSUB; + *valp = array_p (v) ? (char *)array_cell (v) : (char *)assoc_cell (v); + } + else + { + vtype = VT_ARRAYMEMBER; + *valp = array_value (vname, Q_DOUBLE_QUOTES, flags, (int *)NULL, &lind); + } + *varp = v; + } + else if (v && (ALL_ELEMENT_SUB (temp[0]) && temp[1] == ']')) + { + vtype = VT_VARIABLE; + *varp = v; + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + *valp = dequote_string (value); + else + *valp = dequote_escapes (value); + } + else + { + vtype = VT_ARRAYMEMBER; + *varp = v; + *valp = array_value (vname, Q_DOUBLE_QUOTES, flags, (int *)NULL, &lind); + } + } + else if ((v = find_variable (vname)) && (invisible_p (v) == 0) && (assoc_p (v) || array_p (v))) + { + vtype = VT_ARRAYMEMBER; + *varp = v; + *valp = assoc_p (v) ? assoc_reference (assoc_cell (v), "0") : array_reference (array_cell (v), 0); + } + else +#endif + { + if (value && vtype == VT_VARIABLE) + { + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + *valp = dequote_string (value); + else + *valp = dequote_escapes (value); + } + else + *valp = value; + } + + if (want_indir) + free (vname); + + return vtype; +} + +/******************************************************/ +/* */ +/* Functions to extract substrings of variable values */ +/* */ +/******************************************************/ + +#if defined (HANDLE_MULTIBYTE) +/* Character-oriented rather than strictly byte-oriented substrings. S and + E, rather being strict indices into STRING, indicate character (possibly + multibyte character) positions that require calculation. + Used by the ${param:offset[:length]} expansion. */ +static char * +mb_substring (string, s, e) + char *string; + int s, e; +{ + char *tt; + int start, stop, i, slen; + DECLARE_MBSTATE; + + start = 0; + /* Don't need string length in ADVANCE_CHAR unless multibyte chars possible. */ + slen = (MB_CUR_MAX > 1) ? STRLEN (string) : 0; + + i = s; + while (string[start] && i--) + ADVANCE_CHAR (string, slen, start); + stop = start; + i = e - s; + while (string[stop] && i--) + ADVANCE_CHAR (string, slen, stop); + tt = substring (string, start, stop); + return tt; +} +#endif + +/* Process a variable substring expansion: ${name:e1[:e2]}. If VARNAME + is `@', use the positional parameters; otherwise, use the value of + VARNAME. If VARNAME is an array variable, use the array elements. */ + +static char * +parameter_brace_substring (varname, value, ind, substr, quoted, flags) + char *varname, *value; + int ind; + char *substr; + int quoted, flags; +{ + intmax_t e1, e2; + int vtype, r, starsub; + char *temp, *val, *tt, *oname; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + oname = this_command_name; + this_command_name = varname; + + vtype = get_var_and_type (varname, value, ind, quoted, flags, &v, &val); + if (vtype == -1) + { + this_command_name = oname; + return ((char *)NULL); + } + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + r = verify_substring_values (v, val, substr, vtype, &e1, &e2); + this_command_name = oname; + if (r <= 0) + { + if (vtype == VT_VARIABLE) + FREE (val); + return ((r == 0) ? &expand_param_error : (char *)NULL); + } + + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1) + tt = mb_substring (val, e1, e2); + else +#endif + tt = substring (val, e1, e2); + + if (vtype == VT_VARIABLE) + FREE (val); + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + temp = quote_string (tt); + else + temp = tt ? quote_escapes (tt) : (char *)NULL; + FREE (tt); + break; + case VT_POSPARMS: + tt = pos_params (varname, e1, e2, quoted); + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) == 0) + { + temp = tt ? quote_escapes (tt) : (char *)NULL; + FREE (tt); + } + else + temp = tt; + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + if (assoc_p (v)) + /* we convert to list and take first e2 elements starting at e1th + element -- officially undefined for now */ + temp = assoc_subrange (assoc_cell (v), e1, e2, starsub, quoted); + else + /* We want E2 to be the number of elements desired (arrays can be sparse, + so verify_substring_values just returns the numbers specified and we + rely on array_subrange to understand how to deal with them). */ + temp = array_subrange (array_cell (v), e1, e2, starsub, quoted); + /* array_subrange now calls array_quote_escapes as appropriate, so the + caller no longer needs to. */ + break; +#endif + default: + temp = (char *)NULL; + } + + return temp; +} + +/****************************************************************/ +/* */ +/* Functions to perform pattern substitution on variable values */ +/* */ +/****************************************************************/ + +static int +shouldexp_replacement (s) + char *s; +{ + register char *p; + + for (p = s; p && *p; p++) + { + if (*p == '\\') + p++; + else if (*p == '&') + return 1; + } + return 0; +} + +char * +pat_subst (string, pat, rep, mflags) + char *string, *pat, *rep; + int mflags; +{ + char *ret, *s, *e, *str, *rstr, *mstr; + int rsize, rptr, l, replen, mtype, rxpand, rslen, mlen; + + if (string == 0) + return (savestring ("")); + + mtype = mflags & MATCH_TYPEMASK; + +#if 0 /* bash-4.2 ? */ + rxpand = (rep && *rep) ? shouldexp_replacement (rep) : 0; +#else + rxpand = 0; +#endif + + /* Special cases: + * 1. A null pattern with mtype == MATCH_BEG means to prefix STRING + * with REP and return the result. + * 2. A null pattern with mtype == MATCH_END means to append REP to + * STRING and return the result. + * These don't understand or process `&' in the replacement string. + */ + if ((pat == 0 || *pat == 0) && (mtype == MATCH_BEG || mtype == MATCH_END)) + { + replen = STRLEN (rep); + l = STRLEN (string); + ret = (char *)xmalloc (replen + l + 2); + if (replen == 0) + strcpy (ret, string); + else if (mtype == MATCH_BEG) + { + strcpy (ret, rep); + strcpy (ret + replen, string); + } + else + { + strcpy (ret, string); + strcpy (ret + l, rep); + } + return (ret); + } + + ret = (char *)xmalloc (rsize = 64); + ret[0] = '\0'; + + for (replen = STRLEN (rep), rptr = 0, str = string;;) + { + if (match_pattern (str, pat, mtype, &s, &e) == 0) + break; + l = s - str; + + if (rxpand) + { + int x; + mlen = e - s; + mstr = xmalloc (mlen + 1); + for (x = 0; x < mlen; x++) + mstr[x] = s[x]; + mstr[mlen] = '\0'; + rstr = strcreplace (rep, '&', mstr, 0); + rslen = strlen (rstr); + } + else + { + rstr = rep; + rslen = replen; + } + + RESIZE_MALLOCED_BUFFER (ret, rptr, (l + rslen), rsize, 64); + + /* OK, now copy the leading unmatched portion of the string (from + str to s) to ret starting at rptr (the current offset). Then copy + the replacement string at ret + rptr + (s - str). Increment + rptr (if necessary) and str and go on. */ + if (l) + { + strncpy (ret + rptr, str, l); + rptr += l; + } + if (replen) + { + strncpy (ret + rptr, rstr, rslen); + rptr += rslen; + } + str = e; /* e == end of match */ + + if (rstr != rep) + free (rstr); + + if (((mflags & MATCH_GLOBREP) == 0) || mtype != MATCH_ANY) + break; + + if (s == e) + { + /* On a zero-length match, make sure we copy one character, since + we increment one character to avoid infinite recursion. */ + RESIZE_MALLOCED_BUFFER (ret, rptr, 1, rsize, 64); + ret[rptr++] = *str++; + e++; /* avoid infinite recursion on zero-length match */ + } + } + + /* Now copy the unmatched portion of the input string */ + if (str && *str) + { + RESIZE_MALLOCED_BUFFER (ret, rptr, STRLEN(str) + 1, rsize, 64); + strcpy (ret + rptr, str); + } + else + ret[rptr] = '\0'; + + return ret; +} + +/* Do pattern match and replacement on the positional parameters. */ +static char * +pos_params_pat_subst (string, pat, rep, mflags) + char *string, *pat, *rep; + int mflags; +{ + WORD_LIST *save, *params; + WORD_DESC *w; + char *ret; + int pchar, qflags; + + save = params = list_rest_of_args (); + if (save == 0) + return ((char *)NULL); + + for ( ; params; params = params->next) + { + ret = pat_subst (params->word->word, pat, rep, mflags); + w = alloc_word_desc (); + w->word = ret ? ret : savestring (""); + dispose_word (params->word); + params->word = w; + } + + pchar = (mflags & MATCH_STARSUB) == MATCH_STARSUB ? '*' : '@'; + qflags = (mflags & MATCH_QUOTED) == MATCH_QUOTED ? Q_DOUBLE_QUOTES : 0; + + ret = string_list_pos_params (pchar, save, qflags); + + dispose_words (save); + + return (ret); +} + +/* Perform pattern substitution on VALUE, which is the expansion of + VARNAME. PATSUB is an expression supplying the pattern to match + and the string to substitute. QUOTED is a flags word containing + the type of quoting currently in effect. */ +static char * +parameter_brace_patsub (varname, value, ind, patsub, quoted, flags) + char *varname, *value; + int ind; + char *patsub; + int quoted, flags; +{ + int vtype, mflags, starsub, delim; + char *val, *temp, *pat, *rep, *p, *lpatsub, *tt; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + this_command_name = varname; + + vtype = get_var_and_type (varname, value, ind, quoted, flags, &v, &val); + if (vtype == -1) + return ((char *)NULL); + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + mflags = 0; + /* PATSUB is never NULL when this is called. */ + if (*patsub == '/') + { + mflags |= MATCH_GLOBREP; + patsub++; + } + + /* Malloc this because expand_string_if_necessary or one of the expansion + functions in its call chain may free it on a substitution error. */ + lpatsub = savestring (patsub); + + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + mflags |= MATCH_QUOTED; + + if (starsub) + mflags |= MATCH_STARSUB; + + /* If the pattern starts with a `/', make sure we skip over it when looking + for the replacement delimiter. */ + delim = skip_to_delim (lpatsub, ((*patsub == '/') ? 1 : 0), "/", 0); + if (lpatsub[delim] == '/') + { + lpatsub[delim] = 0; + rep = lpatsub + delim + 1; + } + else + rep = (char *)NULL; + + if (rep && *rep == '\0') + rep = (char *)NULL; + + /* Perform the same expansions on the pattern as performed by the + pattern removal expansions. */ + pat = getpattern (lpatsub, quoted, 1); + + if (rep) + { + /* We want to perform quote removal on the expanded replacement even if + the entire expansion is double-quoted because the parser and string + extraction functions treated quotes in the replacement string as + special. THIS IS NOT BACKWARDS COMPATIBLE WITH BASH-4.2. */ + if (shell_compatibility_level > 42) + rep = expand_string_if_necessary (rep, quoted & ~(Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT), expand_string_unsplit); + /* This is the bash-4.2 code. */ + else if ((mflags & MATCH_QUOTED) == 0) + rep = expand_string_if_necessary (rep, quoted, expand_string_unsplit); + else + rep = expand_string_to_string_internal (rep, quoted, expand_string_unsplit); + } + + /* ksh93 doesn't allow the match specifier to be a part of the expanded + pattern. This is an extension. Make sure we don't anchor the pattern + at the beginning or end of the string if we're doing global replacement, + though. */ + p = pat; + if (mflags & MATCH_GLOBREP) + mflags |= MATCH_ANY; + else if (pat && pat[0] == '#') + { + mflags |= MATCH_BEG; + p++; + } + else if (pat && pat[0] == '%') + { + mflags |= MATCH_END; + p++; + } + else + mflags |= MATCH_ANY; + + /* OK, we now want to substitute REP for PAT in VAL. If + flags & MATCH_GLOBREP is non-zero, the substitution is done + everywhere, otherwise only the first occurrence of PAT is + replaced. The pattern matching code doesn't understand + CTLESC quoting CTLESC and CTLNUL so we use the dequoted variable + values passed in (VT_VARIABLE) so the pattern substitution + code works right. We need to requote special chars after + we're done for VT_VARIABLE and VT_ARRAYMEMBER, and for the + other cases if QUOTED == 0, since the posparams and arrays + indexed by * or @ do special things when QUOTED != 0. */ + + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + temp = pat_subst (val, p, rep, mflags); + if (vtype == VT_VARIABLE) + FREE (val); + if (temp) + { + tt = (mflags & MATCH_QUOTED) ? quote_string (temp) : quote_escapes (temp); + free (temp); + temp = tt; + } + break; + case VT_POSPARMS: + temp = pos_params_pat_subst (val, p, rep, mflags); + if (temp && (mflags & MATCH_QUOTED) == 0) + { + tt = quote_escapes (temp); + free (temp); + temp = tt; + } + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + temp = assoc_p (v) ? assoc_patsub (assoc_cell (v), p, rep, mflags) + : array_patsub (array_cell (v), p, rep, mflags); + /* Don't call quote_escapes anymore; array_patsub calls + array_quote_escapes as appropriate before adding the + space separators; ditto for assoc_patsub. */ + break; +#endif + } + + FREE (pat); + FREE (rep); + free (lpatsub); + + return temp; +} + +/****************************************************************/ +/* */ +/* Functions to perform case modification on variable values */ +/* */ +/****************************************************************/ + +/* Do case modification on the positional parameters. */ + +static char * +pos_params_modcase (string, pat, modop, mflags) + char *string, *pat; + int modop; + int mflags; +{ + WORD_LIST *save, *params; + WORD_DESC *w; + char *ret; + int pchar, qflags; + + save = params = list_rest_of_args (); + if (save == 0) + return ((char *)NULL); + + for ( ; params; params = params->next) + { + ret = sh_modcase (params->word->word, pat, modop); + w = alloc_word_desc (); + w->word = ret ? ret : savestring (""); + dispose_word (params->word); + params->word = w; + } + + pchar = (mflags & MATCH_STARSUB) == MATCH_STARSUB ? '*' : '@'; + qflags = (mflags & MATCH_QUOTED) == MATCH_QUOTED ? Q_DOUBLE_QUOTES : 0; + + ret = string_list_pos_params (pchar, save, qflags); + dispose_words (save); + + return (ret); +} + +/* Perform case modification on VALUE, which is the expansion of + VARNAME. MODSPEC is an expression supplying the type of modification + to perform. QUOTED is a flags word containing the type of quoting + currently in effect. */ +static char * +parameter_brace_casemod (varname, value, ind, modspec, patspec, quoted, flags) + char *varname, *value; + int ind, modspec; + char *patspec; + int quoted, flags; +{ + int vtype, starsub, modop, mflags, x; + char *val, *temp, *pat, *p, *lpat, *tt; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + this_command_name = varname; + + vtype = get_var_and_type (varname, value, ind, quoted, flags, &v, &val); + if (vtype == -1) + return ((char *)NULL); + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + modop = 0; + mflags = 0; + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + mflags |= MATCH_QUOTED; + if (starsub) + mflags |= MATCH_STARSUB; + + p = patspec; + if (modspec == '^') + { + x = p && p[0] == modspec; + modop = x ? CASE_UPPER : CASE_UPFIRST; + p += x; + } + else if (modspec == ',') + { + x = p && p[0] == modspec; + modop = x ? CASE_LOWER : CASE_LOWFIRST; + p += x; + } + else if (modspec == '~') + { + x = p && p[0] == modspec; + modop = x ? CASE_TOGGLEALL : CASE_TOGGLE; + p += x; + } + + lpat = p ? savestring (p) : 0; + /* Perform the same expansions on the pattern as performed by the + pattern removal expansions. FOR LATER */ + pat = lpat ? getpattern (lpat, quoted, 1) : 0; + + /* OK, now we do the case modification. */ + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + temp = sh_modcase (val, pat, modop); + if (vtype == VT_VARIABLE) + FREE (val); + if (temp) + { + tt = (mflags & MATCH_QUOTED) ? quote_string (temp) : quote_escapes (temp); + free (temp); + temp = tt; + } + break; + + case VT_POSPARMS: + temp = pos_params_modcase (val, pat, modop, mflags); + if (temp && (mflags & MATCH_QUOTED) == 0) + { + tt = quote_escapes (temp); + free (temp); + temp = tt; + } + break; + +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + temp = assoc_p (v) ? assoc_modcase (assoc_cell (v), pat, modop, mflags) + : array_modcase (array_cell (v), pat, modop, mflags); + /* Don't call quote_escapes; array_modcase calls array_quote_escapes + as appropriate before adding the space separators; ditto for + assoc_modcase. */ + break; +#endif + } + + FREE (pat); + free (lpat); + + return temp; +} + +/* Check for unbalanced parens in S, which is the contents of $(( ... )). If + any occur, this must be a nested command substitution, so return 0. + Otherwise, return 1. A valid arithmetic expression must always have a + ( before a matching ), so any cases where there are more right parens + means that this must not be an arithmetic expression, though the parser + will not accept it without a balanced total number of parens. */ +static int +chk_arithsub (s, len) + const char *s; + int len; +{ + int i, count; + DECLARE_MBSTATE; + + i = count = 0; + while (i < len) + { + if (s[i] == LPAREN) + count++; + else if (s[i] == RPAREN) + { + count--; + if (count < 0) + return 0; + } + + switch (s[i]) + { + default: + ADVANCE_CHAR (s, len, i); + break; + + case '\\': + i++; + if (s[i]) + ADVANCE_CHAR (s, len, i); + break; + + case '\'': + i = skip_single_quoted (s, len, ++i); + break; + + case '"': + i = skip_double_quoted ((char *)s, len, ++i); + break; + } + } + + return (count == 0); +} + +/****************************************************************/ +/* */ +/* Functions to perform parameter expansion on a string */ +/* */ +/****************************************************************/ + +/* ${[#][!]name[[:][^[^]][,[,]]#[#]%[%]-=?+[word][:e1[:e2]]]} */ +static WORD_DESC * +parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, contains_dollar_at) + char *string; + int *indexp, quoted, *quoted_dollar_atp, *contains_dollar_at, pflags; +{ + int check_nullness, var_is_set, var_is_null, var_is_special; + int want_substring, want_indir, want_patsub, want_casemod; + char *name, *value, *temp, *temp1; + WORD_DESC *tdesc, *ret; + int t_index, sindex, c, tflag, modspec; + intmax_t number; + arrayind_t ind; + + temp = temp1 = value = (char *)NULL; + var_is_set = var_is_null = var_is_special = check_nullness = 0; + want_substring = want_indir = want_patsub = want_casemod = 0; + + sindex = *indexp; + t_index = ++sindex; + /* ${#var} doesn't have any of the other parameter expansions on it. */ + if (string[t_index] == '#' && legal_variable_starter (string[t_index+1])) /* {{ */ + name = string_extract (string, &t_index, "}", SX_VARNAME); + else +#if defined (CASEMOD_EXPANSIONS) + /* To enable case-toggling expansions using the `~' operator character + change the 1 to 0. */ +# if defined (CASEMOD_CAPCASE) + name = string_extract (string, &t_index, "#%^,~:-=?+/}", SX_VARNAME); +# else + name = string_extract (string, &t_index, "#%^,:-=?+/}", SX_VARNAME); +# endif /* CASEMOD_CAPCASE */ +#else + name = string_extract (string, &t_index, "#%:-=?+/}", SX_VARNAME); +#endif /* CASEMOD_EXPANSIONS */ + + ret = 0; + tflag = 0; + + ind = INTMAX_MIN; + + /* If the name really consists of a special variable, then make sure + that we have the entire name. We don't allow indirect references + to special variables except `#', `?', `@' and `*'. */ + if ((sindex == t_index && VALID_SPECIAL_LENGTH_PARAM (string[t_index])) || + (sindex == t_index - 1 && string[sindex] == '!' && VALID_INDIR_PARAM (string[t_index]))) + { + t_index++; + temp1 = string_extract (string, &t_index, "#%:-=?+/}", 0); + name = (char *)xrealloc (name, 3 + (strlen (temp1))); + *name = string[sindex]; + if (string[sindex] == '!') + { + /* indirect reference of $#, $?, $@, or $* */ + name[1] = string[sindex + 1]; + strcpy (name + 2, temp1); + } + else + strcpy (name + 1, temp1); + free (temp1); + } + sindex = t_index; + + /* Find out what character ended the variable name. Then + do the appropriate thing. */ + if (c = string[sindex]) + sindex++; + + /* If c is followed by one of the valid parameter expansion + characters, move past it as normal. If not, assume that + a substring specification is being given, and do not move + past it. */ + if (c == ':' && VALID_PARAM_EXPAND_CHAR (string[sindex])) + { + check_nullness++; + if (c = string[sindex]) + sindex++; + } + else if (c == ':' && string[sindex] != RBRACE) + want_substring = 1; + else if (c == '/' /* && string[sindex] != RBRACE */) /* XXX */ + want_patsub = 1; +#if defined (CASEMOD_EXPANSIONS) + else if (c == '^' || c == ',' || c == '~') + { + modspec = c; + want_casemod = 1; + } +#endif + + /* Catch the valid and invalid brace expressions that made it through the + tests above. */ + /* ${#-} is a valid expansion and means to take the length of $-. + Similarly for ${#?} and ${##}... */ + if (name[0] == '#' && name[1] == '\0' && check_nullness == 0 && + VALID_SPECIAL_LENGTH_PARAM (c) && string[sindex] == RBRACE) + { + name = (char *)xrealloc (name, 3); + name[1] = c; + name[2] = '\0'; + c = string[sindex++]; + } + + /* ...but ${#%}, ${#:}, ${#=}, ${#+}, and ${#/} are errors. */ + if (name[0] == '#' && name[1] == '\0' && check_nullness == 0 && + member (c, "%:=+/") && string[sindex] == RBRACE) + { + temp = (char *)NULL; + goto bad_substitution; + } + + /* Indirect expansion begins with a `!'. A valid indirect expansion is + either a variable name, one of the positional parameters or a special + variable that expands to one of the positional parameters. */ + want_indir = *name == '!' && + (legal_variable_starter ((unsigned char)name[1]) || DIGIT (name[1]) + || VALID_INDIR_PARAM (name[1])); + + /* Determine the value of this variable. */ + + /* Check for special variables, directly referenced. */ + if (SPECIAL_VAR (name, want_indir)) + var_is_special++; + + /* Check for special expansion things, like the length of a parameter */ + if (*name == '#' && name[1]) + { + /* If we are not pointing at the character just after the + closing brace, then we haven't gotten all of the name. + Since it begins with a special character, this is a bad + substitution. Also check NAME for validity before trying + to go on. */ + if (string[sindex - 1] != RBRACE || (valid_length_expression (name) == 0)) + { + temp = (char *)NULL; + goto bad_substitution; + } + + number = parameter_brace_expand_length (name); + if (number == INTMAX_MIN && unbound_vars_is_error) + { + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (name+1); + free (name); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + free (name); + + *indexp = sindex; + if (number < 0) + return (&expand_wdesc_error); + else + { + ret = alloc_word_desc (); + ret->word = itos (number); + return ret; + } + } + + /* ${@} is identical to $@. */ + if (name[0] == '@' && name[1] == '\0') + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + + if (contains_dollar_at) + *contains_dollar_at = 1; + + tflag |= W_DOLLARAT; + } + + /* Process ${!PREFIX*} expansion. */ + if (want_indir && string[sindex - 1] == RBRACE && + (string[sindex - 2] == '*' || string[sindex - 2] == '@') && + legal_variable_starter ((unsigned char) name[1])) + { + char **x; + WORD_LIST *xlist; + + temp1 = savestring (name + 1); + number = strlen (temp1); + temp1[number - 1] = '\0'; + x = all_variables_matching_prefix (temp1); + xlist = strvec_to_word_list (x, 0, 0); + if (string[sindex - 2] == '*') + temp = string_list_dollar_star (xlist); + else + { + temp = string_list_dollar_at (xlist, quoted); + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + + tflag |= W_DOLLARAT; + } + free (x); + dispose_words (xlist); + free (temp1); + *indexp = sindex; + + free (name); + + ret = alloc_word_desc (); + ret->word = temp; + ret->flags = tflag; /* XXX */ + return ret; + } + +#if defined (ARRAY_VARS) + /* Process ${!ARRAY[@]} and ${!ARRAY[*]} expansion. */ /* [ */ + if (want_indir && string[sindex - 1] == RBRACE && + string[sindex - 2] == ']' && valid_array_reference (name+1)) + { + char *x, *x1; + + temp1 = savestring (name + 1); + x = array_variable_name (temp1, &x1, (int *)0); /* [ */ + FREE (x); + if (ALL_ELEMENT_SUB (x1[0]) && x1[1] == ']') + { + temp = array_keys (temp1, quoted); /* handles assoc vars too */ + if (x1[0] == '@') + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + + tflag |= W_DOLLARAT; + } + + free (temp1); + *indexp = sindex; + + ret = alloc_word_desc (); + ret->word = temp; + ret->flags = tflag; /* XXX */ + return ret; + } + + free (temp1); + } +#endif /* ARRAY_VARS */ + + /* Make sure that NAME is valid before trying to go on. */ + if (valid_brace_expansion_word (want_indir ? name + 1 : name, + var_is_special) == 0) + { + temp = (char *)NULL; + goto bad_substitution; + } + + if (want_indir) + tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at); + else + tdesc = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND|(pflags&(PF_NOSPLIT2|PF_ASSIGNRHS)), &ind); + + if (tdesc) + { + temp = tdesc->word; + tflag = tdesc->flags; + dispose_word_desc (tdesc); + } + else + temp = (char *)0; + + if (temp == &expand_param_error || temp == &expand_param_fatal) + { + FREE (name); + FREE (value); + return (temp == &expand_param_error ? &expand_wdesc_error : &expand_wdesc_fatal); + } + +#if defined (ARRAY_VARS) + if (valid_array_reference (name)) + chk_atstar (name, quoted, quoted_dollar_atp, contains_dollar_at); +#endif + + var_is_set = temp != (char *)0; + var_is_null = check_nullness && (var_is_set == 0 || *temp == 0); + /* XXX - this may not need to be restricted to special variables */ + if (check_nullness) + var_is_null |= var_is_set && var_is_special && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && QUOTED_NULL (temp); + + /* Get the rest of the stuff inside the braces. */ + if (c && c != RBRACE) + { + /* Extract the contents of the ${ ... } expansion + according to the Posix.2 rules. */ + value = extract_dollar_brace_string (string, &sindex, quoted, (c == '%' || c == '#' || c =='/' || c == '^' || c == ',' || c ==':') ? SX_POSIXEXP|SX_WORD : SX_WORD); + if (string[sindex] == RBRACE) + sindex++; + else + goto bad_substitution; + } + else + value = (char *)NULL; + + *indexp = sindex; + + /* All the cases where an expansion can possibly generate an unbound + variable error. */ + if (want_substring || want_patsub || want_casemod || c == '#' || c == '%' || c == RBRACE) + { + if (var_is_set == 0 && unbound_vars_is_error && ((name[0] != '@' && name[0] != '*') || name[1])) + { + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (name); + FREE (value); + FREE (temp); + free (name); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + } + + /* If this is a substring spec, process it and add the result. */ + if (want_substring) + { + temp1 = parameter_brace_substring (name, temp, ind, value, quoted, (tflag & W_ARRAYIND) ? AV_USEIND : 0); + FREE (name); + FREE (value); + FREE (temp); + + if (temp1 == &expand_param_error) + return (&expand_wdesc_error); + else if (temp1 == &expand_param_fatal) + return (&expand_wdesc_fatal); + + ret = alloc_word_desc (); + ret->word = temp1; + /* We test quoted_dollar_atp because we want variants with double-quoted + "$@" to take a different code path. In fact, we make sure at the end + of expand_word_internal that we're only looking at these flags if + quoted_dollar_at == 0. */ + if (temp1 && + (quoted_dollar_atp == 0 || *quoted_dollar_atp == 0) && + QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ret->flags |= W_QUOTED|W_HASQUOTEDNULL; + return ret; + } + else if (want_patsub) + { + temp1 = parameter_brace_patsub (name, temp, ind, value, quoted, (tflag & W_ARRAYIND) ? AV_USEIND : 0); + FREE (name); + FREE (value); + FREE (temp); + + if (temp1 == &expand_param_error) + return (&expand_wdesc_error); + else if (temp1 == &expand_param_fatal) + return (&expand_wdesc_fatal); + + ret = alloc_word_desc (); + ret->word = temp1; + if (temp1 && + (quoted_dollar_atp == 0 || *quoted_dollar_atp == 0) && + QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ret->flags |= W_QUOTED|W_HASQUOTEDNULL; + return ret; + } +#if defined (CASEMOD_EXPANSIONS) + else if (want_casemod) + { + temp1 = parameter_brace_casemod (name, temp, ind, modspec, value, quoted, (tflag & W_ARRAYIND) ? AV_USEIND : 0); + FREE (name); + FREE (value); + FREE (temp); + + if (temp1 == &expand_param_error) + return (&expand_wdesc_error); + else if (temp1 == &expand_param_fatal) + return (&expand_wdesc_fatal); + + ret = alloc_word_desc (); + ret->word = temp1; + if (temp1 && + (quoted_dollar_atp == 0 || *quoted_dollar_atp == 0) && + QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ret->flags |= W_QUOTED|W_HASQUOTEDNULL; + return ret; + } +#endif + + /* Do the right thing based on which character ended the variable name. */ + switch (c) + { + default: + case '\0': + bad_substitution: + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("%s: bad substitution"), string ? string : "??"); + FREE (value); + FREE (temp); + free (name); + return &expand_wdesc_error; + + case RBRACE: + break; + + case '#': /* ${param#[#]pattern} */ + case '%': /* ${param%[%]pattern} */ + if (value == 0 || *value == '\0' || temp == 0 || *temp == '\0') + { + FREE (value); + break; + } + temp1 = parameter_brace_remove_pattern (name, temp, ind, value, c, quoted, (tflag & W_ARRAYIND) ? AV_USEIND : 0); + free (temp); + free (value); + free (name); + + ret = alloc_word_desc (); + ret->word = temp1; + if (temp1 && QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ret->flags |= W_QUOTED|W_HASQUOTEDNULL; + return ret; + + case '-': + case '=': + case '?': + case '+': + if (var_is_set && var_is_null == 0) + { + /* If the operator is `+', we don't want the value of the named + variable for anything, just the value of the right hand side. */ + if (c == '+') + { + /* XXX -- if we're double-quoted and the named variable is "$@", + we want to turn off any special handling of "$@" -- + we're not using it, so whatever is on the rhs applies. */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 0; + if (contains_dollar_at) + *contains_dollar_at = 0; + + FREE (temp); + if (value) + { + /* From Posix discussion on austin-group list. Issue 221 + requires that backslashes escaping `}' inside + double-quoted ${...} be removed. */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + quoted |= Q_DOLBRACE; + ret = parameter_brace_expand_rhs (name, value, c, + quoted, + quoted_dollar_atp, + contains_dollar_at); + /* XXX - fix up later, esp. noting presence of + W_HASQUOTEDNULL in ret->flags */ + free (value); + } + else + temp = (char *)NULL; + } + else + { + FREE (value); + } + /* Otherwise do nothing; just use the value in TEMP. */ + } + else /* VAR not set or VAR is NULL. */ + { + FREE (temp); + temp = (char *)NULL; + if (c == '=' && var_is_special) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("$%s: cannot assign in this way"), name); + free (name); + free (value); + return &expand_wdesc_error; + } + else if (c == '?') + { + parameter_brace_expand_error (name, value); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + else if (c != '+') + { + /* XXX -- if we're double-quoted and the named variable is "$@", + we want to turn off any special handling of "$@" -- + we're not using it, so whatever is on the rhs applies. */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 0; + if (contains_dollar_at) + *contains_dollar_at = 0; + + /* From Posix discussion on austin-group list. Issue 221 requires + that backslashes escaping `}' inside double-quoted ${...} be + removed. */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + quoted |= Q_DOLBRACE; + ret = parameter_brace_expand_rhs (name, value, c, quoted, + quoted_dollar_atp, + contains_dollar_at); + /* XXX - fix up later, esp. noting presence of + W_HASQUOTEDNULL in tdesc->flags */ + } + free (value); + } + + break; + } + free (name); + + if (ret == 0) + { + ret = alloc_word_desc (); + ret->flags = tflag; + ret->word = temp; + } + return (ret); +} + +/* Expand a single ${xxx} expansion. The braces are optional. When + the braces are used, parameter_brace_expand() does the work, + possibly calling param_expand recursively. */ +static WORD_DESC * +param_expand (string, sindex, quoted, expanded_something, + contains_dollar_at, quoted_dollar_at_p, had_quoted_null_p, + pflags) + char *string; + int *sindex, quoted, *expanded_something, *contains_dollar_at; + int *quoted_dollar_at_p, *had_quoted_null_p, pflags; +{ + char *temp, *temp1, uerror[3]; + int zindex, t_index, expok; + unsigned char c; + intmax_t number; + SHELL_VAR *var; + WORD_LIST *list; + WORD_DESC *tdesc, *ret; + int tflag; + + zindex = *sindex; + c = string[++zindex]; + + temp = (char *)NULL; + ret = tdesc = (WORD_DESC *)NULL; + tflag = 0; + + /* Do simple cases first. Switch on what follows '$'. */ + switch (c) + { + /* $0 .. $9? */ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + temp1 = dollar_vars[TODIGIT (c)]; + if (unbound_vars_is_error && temp1 == (char *)NULL) + { + uerror[0] = '$'; + uerror[1] = c; + uerror[2] = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (uerror); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + if (temp1) + temp = (*temp1 && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ? quote_string (temp1) + : quote_escapes (temp1); + else + temp = (char *)NULL; + + break; + + /* $$ -- pid of the invoking shell. */ + case '$': + temp = itos (dollar_dollar_pid); + break; + + /* $# -- number of positional parameters. */ + case '#': + temp = itos (number_of_args ()); + break; + + /* $? -- return value of the last synchronous command. */ + case '?': + temp = itos (last_command_exit_value); + break; + + /* $- -- flags supplied to the shell on invocation or by `set'. */ + case '-': + temp = which_set_flags (); + break; + + /* $! -- Pid of the last asynchronous command. */ + case '!': + /* If no asynchronous pids have been created, expand to nothing. + If `set -u' has been executed, and no async processes have + been created, this is an expansion error. */ + if (last_asynchronous_pid == NO_PID) + { + if (expanded_something) + *expanded_something = 0; + temp = (char *)NULL; + if (unbound_vars_is_error) + { + uerror[0] = '$'; + uerror[1] = c; + uerror[2] = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (uerror); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + } + else + temp = itos (last_asynchronous_pid); + break; + + /* The only difference between this and $@ is when the arg is quoted. */ + case '*': /* `$*' */ + list = list_rest_of_args (); + +#if 0 + /* According to austin-group posix proposal by Geoff Clare in + <20090505091501.GA10097@squonk.masqnet> of 5 May 2009: + + "The shell shall write a message to standard error and + immediately exit when it tries to expand an unset parameter + other than the '@' and '*' special parameters." + */ + + if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) + { + uerror[0] = '$'; + uerror[1] = '*'; + uerror[2] = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (uerror); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } +#endif + + /* If there are no command-line arguments, this should just + disappear if there are other characters in the expansion, + even if it's quoted. */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && list == 0) + temp = (char *)NULL; + else if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES|Q_PATQUOTE)) + { + /* If we have "$*" we want to make a string of the positional + parameters, separated by the first character of $IFS, and + quote the whole string, including the separators. If IFS + is unset, the parameters are separated by ' '; if $IFS is + null, the parameters are concatenated. */ + temp = (quoted & (Q_DOUBLE_QUOTES|Q_PATQUOTE)) ? string_list_dollar_star (list) : string_list (list); + if (temp) + { + temp1 = quote_string (temp); + if (*temp == 0) + tflag |= W_HASQUOTEDNULL; + free (temp); + temp = temp1; + } + } + else + { + /* We check whether or not we're eventually going to split $* here, + for example when IFS is empty and we are processing the rhs of + an assignment statement. In that case, we don't separate the + arguments at all. Otherwise, if the $* is not quoted it is + identical to $@ */ +# if defined (HANDLE_MULTIBYTE) + if (expand_no_split_dollar_star && ifs_firstc[0] == 0) +# else + if (expand_no_split_dollar_star && ifs_firstc == 0) +# endif + temp = string_list_dollar_star (list); + else + { + temp = string_list_dollar_at (list, quoted); + if (quoted == 0 && (ifs_is_set == 0 || ifs_is_null)) + tflag |= W_SPLITSPACE; + } + + if (expand_no_split_dollar_star == 0 && contains_dollar_at) + *contains_dollar_at = 1; + } + + dispose_words (list); + break; + + /* When we have "$@" what we want is "$1" "$2" "$3" ... This + means that we have to turn quoting off after we split into + the individually quoted arguments so that the final split + on the first character of $IFS is still done. */ + case '@': /* `$@' */ + list = list_rest_of_args (); + +#if 0 + /* According to austin-group posix proposal by Geoff Clare in + <20090505091501.GA10097@squonk.masqnet> of 5 May 2009: + + "The shell shall write a message to standard error and + immediately exit when it tries to expand an unset parameter + other than the '@' and '*' special parameters." + */ + + if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) + { + uerror[0] = '$'; + uerror[1] = '@'; + uerror[2] = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (uerror); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } +#endif + + /* We want to flag the fact that we saw this. We can't turn + off quoting entirely, because other characters in the + string might need it (consider "\"$@\""), but we need some + way to signal that the final split on the first character + of $IFS should be done, even though QUOTED is 1. */ + /* XXX - should this test include Q_PATQUOTE? */ + if (quoted_dollar_at_p && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + *quoted_dollar_at_p = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + + /* We want to separate the positional parameters with the first + character of $IFS in case $IFS is something other than a space. + We also want to make sure that splitting is done no matter what -- + according to POSIX.2, this expands to a list of the positional + parameters no matter what IFS is set to. */ + /* XXX - what to do when in a context where word splitting is not + performed? Even when IFS is not the default, posix seems to imply + that we behave like unquoted $* ? Maybe we should use PF_NOSPLIT2 + here. */ + temp = string_list_dollar_at (list, (pflags & PF_ASSIGNRHS) ? (quoted|Q_DOUBLE_QUOTES) : quoted); + + tflag |= W_DOLLARAT; + dispose_words (list); + break; + + case LBRACE: + tdesc = parameter_brace_expand (string, &zindex, quoted, pflags, + quoted_dollar_at_p, + contains_dollar_at); + + if (tdesc == &expand_wdesc_error || tdesc == &expand_wdesc_fatal) + return (tdesc); + temp = tdesc ? tdesc->word : (char *)0; + + /* XXX */ + /* Quoted nulls should be removed if there is anything else + in the string. */ + /* Note that we saw the quoted null so we can add one back at + the end of this function if there are no other characters + in the string, discard TEMP, and go on. The exception to + this is when we have "${@}" and $1 is '', since $@ needs + special handling. */ + if (tdesc && tdesc->word && (tdesc->flags & W_HASQUOTEDNULL) && QUOTED_NULL (temp)) + { + if (had_quoted_null_p) + *had_quoted_null_p = 1; + if (*quoted_dollar_at_p == 0) + { + free (temp); + tdesc->word = temp = (char *)NULL; + } + + } + + ret = tdesc; + goto return0; + + /* Do command or arithmetic substitution. */ + case LPAREN: + /* We have to extract the contents of this paren substitution. */ + t_index = zindex + 1; + temp = extract_command_subst (string, &t_index, 0); + zindex = t_index; + + /* For Posix.2-style `$(( ))' arithmetic substitution, + extract the expression and pass it to the evaluator. */ + if (temp && *temp == LPAREN) + { + char *temp2; + temp1 = temp + 1; + temp2 = savestring (temp1); + t_index = strlen (temp2) - 1; + + if (temp2[t_index] != RPAREN) + { + free (temp2); + goto comsub; + } + + /* Cut off ending `)' */ + temp2[t_index] = '\0'; + + if (chk_arithsub (temp2, t_index) == 0) + { + free (temp2); +#if 0 + internal_warning (_("future versions of the shell will force evaluation as an arithmetic substitution")); +#endif + goto comsub; + } + + /* Expand variables found inside the expression. */ + temp1 = expand_arith_string (temp2, Q_DOUBLE_QUOTES); + free (temp2); + +arithsub: + /* No error messages. */ + this_command_name = (char *)NULL; + number = evalexp (temp1, &expok); + free (temp); + free (temp1); + if (expok == 0) + { + if (interactive_shell == 0 && posixly_correct) + { + last_command_exit_value = EXECUTION_FAILURE; + return (&expand_wdesc_fatal); + } + else + return (&expand_wdesc_error); + } + temp = itos (number); + break; + } + +comsub: + if (pflags & PF_NOCOMSUB) + /* we need zindex+1 because string[zindex] == RPAREN */ + temp1 = substring (string, *sindex, zindex+1); + else + { + tdesc = command_substitute (temp, quoted); + temp1 = tdesc ? tdesc->word : (char *)NULL; + if (tdesc) + dispose_word_desc (tdesc); + } + FREE (temp); + temp = temp1; + break; + + /* Do POSIX.2d9-style arithmetic substitution. This will probably go + away in a future bash release. */ + case '[': + /* Extract the contents of this arithmetic substitution. */ + t_index = zindex + 1; + temp = extract_arithmetic_subst (string, &t_index); + zindex = t_index; + if (temp == 0) + { + temp = savestring (string); + if (expanded_something) + *expanded_something = 0; + goto return0; + } + + /* Do initial variable expansion. */ + temp1 = expand_arith_string (temp, Q_DOUBLE_QUOTES); + + goto arithsub; + + default: + /* Find the variable in VARIABLE_LIST. */ + temp = (char *)NULL; + + for (t_index = zindex; (c = string[zindex]) && legal_variable_char (c); zindex++) + ; + temp1 = (zindex > t_index) ? substring (string, t_index, zindex) : (char *)NULL; + + /* If this isn't a variable name, then just output the `$'. */ + if (temp1 == 0 || *temp1 == '\0') + { + FREE (temp1); + temp = (char *)xmalloc (2); + temp[0] = '$'; + temp[1] = '\0'; + if (expanded_something) + *expanded_something = 0; + goto return0; + } + + /* If the variable exists, return its value cell. */ + var = find_variable (temp1); + + if (var && invisible_p (var) == 0 && var_isset (var)) + { +#if defined (ARRAY_VARS) + if (assoc_p (var) || array_p (var)) + { + temp = array_p (var) ? array_reference (array_cell (var), 0) + : assoc_reference (assoc_cell (var), "0"); + if (temp) + temp = (*temp && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ? quote_string (temp) + : quote_escapes (temp); + else if (unbound_vars_is_error) + goto unbound_variable; + } + else +#endif + { + temp = value_cell (var); + + temp = (*temp && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ? quote_string (temp) + : quote_escapes (temp); + } + + free (temp1); + + goto return0; + } + else if (var = find_variable_last_nameref (temp1)) + { + temp = nameref_cell (var); +#if defined (ARRAY_VARS) + if (temp && *temp && valid_array_reference (temp)) + { + tdesc = parameter_brace_expand_word (temp, SPECIAL_VAR (temp, 0), quoted, pflags, (arrayind_t *)NULL); + if (tdesc == &expand_wdesc_error || tdesc == &expand_wdesc_fatal) + return (tdesc); + ret = tdesc; + goto return0; + } + else +#endif + /* y=2 ; typeset -n x=y; echo $x is not the same as echo $2 in ksh */ + if (temp && *temp && legal_identifier (temp) == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("%s: invalid variable name for name reference"), temp); + return (&expand_wdesc_error); /* XXX */ + } + else + temp = (char *)NULL; + } + + temp = (char *)NULL; + +unbound_variable: + if (unbound_vars_is_error) + { + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (temp1); + } + else + { + free (temp1); + goto return0; + } + + free (temp1); + last_command_exit_value = EXECUTION_FAILURE; + return ((unbound_vars_is_error && interactive_shell == 0) + ? &expand_wdesc_fatal + : &expand_wdesc_error); + } + + if (string[zindex]) + zindex++; + +return0: + *sindex = zindex; + + if (ret == 0) + { + ret = alloc_word_desc (); + ret->flags = tflag; /* XXX */ + ret->word = temp; + } + return ret; +} + +/* Make a word list which is the result of parameter and variable + expansion, command substitution, arithmetic substitution, and + quote removal of WORD. Return a pointer to a WORD_LIST which is + the result of the expansion. If WORD contains a null word, the + word list returned is also null. + + QUOTED contains flag values defined in shell.h. + + ISEXP is used to tell expand_word_internal that the word should be + treated as the result of an expansion. This has implications for + how IFS characters in the word are treated. + + CONTAINS_DOLLAR_AT and EXPANDED_SOMETHING are return values; when non-null + they point to an integer value which receives information about expansion. + CONTAINS_DOLLAR_AT gets non-zero if WORD contained "$@", else zero. + EXPANDED_SOMETHING get non-zero if WORD contained any parameter expansions, + else zero. + + This only does word splitting in the case of $@ expansion. In that + case, we split on ' '. */ + +/* Values for the local variable quoted_state. */ +#define UNQUOTED 0 +#define PARTIALLY_QUOTED 1 +#define WHOLLY_QUOTED 2 + +static WORD_LIST * +expand_word_internal (word, quoted, isexp, contains_dollar_at, expanded_something) + WORD_DESC *word; + int quoted, isexp; + int *contains_dollar_at; + int *expanded_something; +{ + WORD_LIST *list; + WORD_DESC *tword; + + /* The intermediate string that we build while expanding. */ + char *istring; + + /* The current size of the above object. */ + int istring_size; + + /* Index into ISTRING. */ + int istring_index; + + /* Temporary string storage. */ + char *temp, *temp1; + + /* The text of WORD. */ + register char *string; + + /* The size of STRING. */ + size_t string_size; + + /* The index into STRING. */ + int sindex; + + /* This gets 1 if we see a $@ while quoted. */ + int quoted_dollar_at; + + /* One of UNQUOTED, PARTIALLY_QUOTED, or WHOLLY_QUOTED, depending on + whether WORD contains no quoting characters, a partially quoted + string (e.g., "xx"ab), or is fully quoted (e.g., "xxab"). */ + int quoted_state; + + /* State flags */ + int had_quoted_null; + int has_dollar_at, temp_has_dollar_at; + int split_on_spaces; + int tflag; + int pflags; /* flags passed to param_expand */ + + int assignoff; /* If assignment, offset of `=' */ + + register unsigned char c; /* Current character. */ + int t_index; /* For calls to string_extract_xxx. */ + + char twochars[2]; + + DECLARE_MBSTATE; + + istring = (char *)xmalloc (istring_size = DEFAULT_INITIAL_ARRAY_SIZE); + istring[istring_index = 0] = '\0'; + quoted_dollar_at = had_quoted_null = has_dollar_at = 0; + split_on_spaces = 0; + quoted_state = UNQUOTED; + + string = word->word; + if (string == 0) + goto finished_with_string; + /* Don't need the string length for the SADD... and COPY_ macros unless + multibyte characters are possible. */ + string_size = (MB_CUR_MAX > 1) ? strlen (string) : 1; + + if (contains_dollar_at) + *contains_dollar_at = 0; + + assignoff = -1; + + /* Begin the expansion. */ + + for (sindex = 0; ;) + { + c = string[sindex]; + + /* Case on top-level character. */ + switch (c) + { + case '\0': + goto finished_with_string; + + case CTLESC: + sindex++; +#if HANDLE_MULTIBYTE + if (MB_CUR_MAX > 1 && string[sindex]) + { + SADD_MBQCHAR_BODY(temp, string, sindex, string_size); + } + else +#endif + { + temp = (char *)xmalloc (3); + temp[0] = CTLESC; + temp[1] = c = string[sindex]; + temp[2] = '\0'; + } + +dollar_add_string: + if (string[sindex]) + sindex++; + +add_string: + if (temp) + { + istring = sub_append_string (temp, istring, &istring_index, &istring_size); + temp = (char *)0; + } + + break; + +#if defined (PROCESS_SUBSTITUTION) + /* Process substitution. */ + case '<': + case '>': + { + if (string[++sindex] != LPAREN || (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || (word->flags & (W_DQUOTE|W_NOPROCSUB)) || posixly_correct) + { + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + else + t_index = sindex + 1; /* skip past both '<' and LPAREN */ + + temp1 = extract_process_subst (string, (c == '<') ? "<(" : ">(", &t_index, 0); /*))*/ + sindex = t_index; + + /* If the process substitution specification is `<()', we want to + open the pipe for writing in the child and produce output; if + it is `>()', we want to open the pipe for reading in the child + and consume input. */ + temp = temp1 ? process_substitute (temp1, (c == '>')) : (char *)0; + + FREE (temp1); + + goto dollar_add_string; + } +#endif /* PROCESS_SUBSTITUTION */ + + case '=': + /* Posix.2 section 3.6.1 says that tildes following `=' in words + which are not assignment statements are not expanded. If the + shell isn't in posix mode, though, we perform tilde expansion + on `likely candidate' unquoted assignment statements (flags + include W_ASSIGNMENT but not W_QUOTED). A likely candidate + contains an unquoted :~ or =~. Something to think about: we + now have a flag that says to perform tilde expansion on arguments + to `assignment builtins' like declare and export that look like + assignment statements. We now do tilde expansion on such words + even in POSIX mode. */ + if (word->flags & (W_ASSIGNRHS|W_NOTILDE)) + { + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c)) + goto add_ifs_character; + else + goto add_character; + } + /* If we're not in posix mode or forcing assignment-statement tilde + expansion, note where the `=' appears in the word and prepare to + do tilde expansion following the first `='. */ + if ((word->flags & W_ASSIGNMENT) && + (posixly_correct == 0 || (word->flags & W_TILDEEXP)) && + assignoff == -1 && sindex > 0) + assignoff = sindex; + if (sindex == assignoff && string[sindex+1] == '~') /* XXX */ + word->flags |= W_ITILDE; +#if 0 + else if ((word->flags & W_ASSIGNMENT) && + (posixly_correct == 0 || (word->flags & W_TILDEEXP)) && + string[sindex+1] == '~') + word->flags |= W_ITILDE; +#endif + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c)) + goto add_ifs_character; + else + goto add_character; + + case ':': + if (word->flags & W_NOTILDE) + { + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c)) + goto add_ifs_character; + else + goto add_character; + } + + if ((word->flags & (W_ASSIGNMENT|W_ASSIGNRHS|W_TILDEEXP)) && + string[sindex+1] == '~') + word->flags |= W_ITILDE; + + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c)) + goto add_ifs_character; + else + goto add_character; + + case '~': + /* If the word isn't supposed to be tilde expanded, or we're not + at the start of a word or after an unquoted : or = in an + assignment statement, we don't do tilde expansion. */ + if ((word->flags & (W_NOTILDE|W_DQUOTE)) || + (sindex > 0 && ((word->flags & W_ITILDE) == 0)) || + (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + { + word->flags &= ~W_ITILDE; + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c) && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) == 0) + goto add_ifs_character; + else + goto add_character; + } + + if (word->flags & W_ASSIGNRHS) + tflag = 2; + else if (word->flags & (W_ASSIGNMENT|W_TILDEEXP)) + tflag = 1; + else + tflag = 0; + + temp = bash_tilde_find_word (string + sindex, tflag, &t_index); + + word->flags &= ~W_ITILDE; + + if (temp && *temp && t_index > 0) + { + temp1 = bash_tilde_expand (temp, tflag); + if (temp1 && *temp1 == '~' && STREQ (temp, temp1)) + { + FREE (temp); + FREE (temp1); + goto add_character; /* tilde expansion failed */ + } + free (temp); + temp = temp1; + sindex += t_index; + goto add_quoted_string; /* XXX was add_string */ + } + else + { + FREE (temp); + goto add_character; + } + + case '$': + if (expanded_something) + *expanded_something = 1; + + temp_has_dollar_at = 0; + pflags = (word->flags & W_NOCOMSUB) ? PF_NOCOMSUB : 0; + if (word->flags & W_NOSPLIT2) + pflags |= PF_NOSPLIT2; + if (word->flags & W_ASSIGNRHS) + pflags |= PF_ASSIGNRHS; + tword = param_expand (string, &sindex, quoted, expanded_something, + &temp_has_dollar_at, "ed_dollar_at, + &had_quoted_null, pflags); + has_dollar_at += temp_has_dollar_at; + split_on_spaces += (tword->flags & W_SPLITSPACE); + + if (tword == &expand_wdesc_error || tword == &expand_wdesc_fatal) + { + free (string); + free (istring); + return ((tword == &expand_wdesc_error) ? &expand_word_error + : &expand_word_fatal); + } + if (contains_dollar_at && has_dollar_at) + *contains_dollar_at = 1; + + if (tword && (tword->flags & W_HASQUOTEDNULL)) + had_quoted_null = 1; + + temp = tword ? tword->word : (char *)NULL; + dispose_word_desc (tword); + + /* Kill quoted nulls; we will add them back at the end of + expand_word_internal if nothing else in the string */ + if (had_quoted_null && temp && QUOTED_NULL (temp)) + { + FREE (temp); + temp = (char *)NULL; + } + + goto add_string; + break; + + case '`': /* Backquoted command substitution. */ + { + t_index = sindex++; + + temp = string_extract (string, &sindex, "`", SX_REQMATCH); + /* The test of sindex against t_index is to allow bare instances of + ` to pass through, for backwards compatibility. */ + if (temp == &extract_string_error || temp == &extract_string_fatal) + { + if (sindex - 1 == t_index) + { + sindex = t_index; + goto add_character; + } + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("bad substitution: no closing \"`\" in %s") , string+t_index); + free (string); + free (istring); + return ((temp == &extract_string_error) ? &expand_word_error + : &expand_word_fatal); + } + + if (expanded_something) + *expanded_something = 1; + + if (word->flags & W_NOCOMSUB) + /* sindex + 1 because string[sindex] == '`' */ + temp1 = substring (string, t_index, sindex + 1); + else + { + de_backslash (temp); + tword = command_substitute (temp, quoted); + temp1 = tword ? tword->word : (char *)NULL; + if (tword) + dispose_word_desc (tword); + } + FREE (temp); + temp = temp1; + goto dollar_add_string; + } + + case '\\': + if (string[sindex + 1] == '\n') + { + sindex += 2; + continue; + } + + c = string[++sindex]; + + if (quoted & Q_HERE_DOCUMENT) + tflag = CBSHDOC; + else if (quoted & Q_DOUBLE_QUOTES) + tflag = CBSDQUOTE; + else + tflag = 0; + + /* From Posix discussion on austin-group list: Backslash escaping + a } in ${...} is removed. Issue 0000221 */ + if ((quoted & Q_DOLBRACE) && c == RBRACE) + { + SCOPY_CHAR_I (twochars, CTLESC, c, string, sindex, string_size); + } + /* This is the fix for " $@\ " */ + else if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && ((sh_syntaxtab[c] & tflag) == 0) && isexp == 0 && isifs (c)) + { + RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, + DEFAULT_ARRAY_SIZE); + istring[istring_index++] = CTLESC; + istring[istring_index++] = '\\'; + istring[istring_index] = '\0'; + + SCOPY_CHAR_I (twochars, CTLESC, c, string, sindex, string_size); + } + else if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && ((sh_syntaxtab[c] & tflag) == 0)) + { + SCOPY_CHAR_I (twochars, '\\', c, string, sindex, string_size); + } + else if (c == 0) + { + c = CTLNUL; + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + else + { + SCOPY_CHAR_I (twochars, CTLESC, c, string, sindex, string_size); + } + + sindex++; +add_twochars: + /* BEFORE jumping here, we need to increment sindex if appropriate */ + RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, + DEFAULT_ARRAY_SIZE); + istring[istring_index++] = twochars[0]; + istring[istring_index++] = twochars[1]; + istring[istring_index] = '\0'; + + break; + + case '"': + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + goto add_character; + + t_index = ++sindex; + temp = string_extract_double_quoted (string, &sindex, 0); + + /* If the quotes surrounded the entire string, then the + whole word was quoted. */ + quoted_state = (t_index == 1 && string[sindex] == '\0') + ? WHOLLY_QUOTED + : PARTIALLY_QUOTED; + + if (temp && *temp) + { + tword = alloc_word_desc (); + tword->word = temp; + + temp = (char *)NULL; + + temp_has_dollar_at = 0; /* XXX */ + /* Need to get W_HASQUOTEDNULL flag through this function. */ + list = expand_word_internal (tword, Q_DOUBLE_QUOTES, 0, &temp_has_dollar_at, (int *)NULL); + has_dollar_at += temp_has_dollar_at; + + if (list == &expand_word_error || list == &expand_word_fatal) + { + free (istring); + free (string); + /* expand_word_internal has already freed temp_word->word + for us because of the way it prints error messages. */ + tword->word = (char *)NULL; + dispose_word (tword); + return list; + } + + dispose_word (tword); + + /* "$@" (a double-quoted dollar-at) expands into nothing, + not even a NULL word, when there are no positional + parameters. */ + if (list == 0 && has_dollar_at) + { + quoted_dollar_at++; + break; + } + + /* If we get "$@", we know we have expanded something, so we + need to remember it for the final split on $IFS. This is + a special case; it's the only case where a quoted string + can expand into more than one word. It's going to come back + from the above call to expand_word_internal as a list with + a single word, in which all characters are quoted and + separated by blanks. What we want to do is to turn it back + into a list for the next piece of code. */ + if (list) + dequote_list (list); + + if (list && list->word && (list->word->flags & W_HASQUOTEDNULL)) + had_quoted_null = 1; /* XXX */ + + if (has_dollar_at) + { + quoted_dollar_at++; + if (contains_dollar_at) + *contains_dollar_at = 1; + if (expanded_something) + *expanded_something = 1; + } + } + else + { + /* What we have is "". This is a minor optimization. */ + FREE (temp); + list = (WORD_LIST *)NULL; + } + + /* The code above *might* return a list (consider the case of "$@", + where it returns "$1", "$2", etc.). We can't throw away the + rest of the list, and we have to make sure each word gets added + as quoted. We test on tresult->next: if it is non-NULL, we + quote the whole list, save it to a string with string_list, and + add that string. We don't need to quote the results of this + (and it would be wrong, since that would quote the separators + as well), so we go directly to add_string. */ + if (list) + { + if (list->next) + { + /* Testing quoted_dollar_at makes sure that "$@" is + split correctly when $IFS does not contain a space. */ + temp = quoted_dollar_at + ? string_list_dollar_at (list, Q_DOUBLE_QUOTES) + : string_list (quote_list (list)); + dispose_words (list); + goto add_string; + } + else + { + temp = savestring (list->word->word); + tflag = list->word->flags; + dispose_words (list); + + /* If the string is not a quoted null string, we want + to remove any embedded unquoted CTLNUL characters. + We do not want to turn quoted null strings back into + the empty string, though. We do this because we + want to remove any quoted nulls from expansions that + contain other characters. For example, if we have + x"$*"y or "x$*y" and there are no positional parameters, + the $* should expand into nothing. */ + /* We use the W_HASQUOTEDNULL flag to differentiate the + cases: a quoted null character as above and when + CTLNUL is contained in the (non-null) expansion + of some variable. We use the had_quoted_null flag to + pass the value through this function to its caller. */ + if ((tflag & W_HASQUOTEDNULL) && QUOTED_NULL (temp) == 0) + remove_quoted_nulls (temp); /* XXX */ + } + } + else + temp = (char *)NULL; + + /* We do not want to add quoted nulls to strings that are only + partially quoted; we can throw them away. The exception to + this is when we are going to be performing word splitting, + since we have to preserve a null argument if the next character + will cause word splitting. */ + if (temp == 0 && quoted_state == PARTIALLY_QUOTED && (word->flags & (W_NOSPLIT|W_NOSPLIT2))) + continue; + + add_quoted_string: + + if (temp) + { + temp1 = temp; + temp = quote_string (temp); + free (temp1); + goto add_string; + } + else + { + /* Add NULL arg. */ + c = CTLNUL; + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + + /* break; */ + + case '\'': + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + goto add_character; + + t_index = ++sindex; + temp = string_extract_single_quoted (string, &sindex); + + /* If the entire STRING was surrounded by single quotes, + then the string is wholly quoted. */ + quoted_state = (t_index == 1 && string[sindex] == '\0') + ? WHOLLY_QUOTED + : PARTIALLY_QUOTED; + + /* If all we had was '', it is a null expansion. */ + if (*temp == '\0') + { + free (temp); + temp = (char *)NULL; + } + else + remove_quoted_escapes (temp); /* ??? */ + + /* We do not want to add quoted nulls to strings that are only + partially quoted; such nulls are discarded. */ + if (temp == 0 && (quoted_state == PARTIALLY_QUOTED)) + continue; + + /* If we have a quoted null expansion, add a quoted NULL to istring. */ + if (temp == 0) + { + c = CTLNUL; + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + else + goto add_quoted_string; + + /* break; */ + + default: + /* This is the fix for " $@ " */ + add_ifs_character: + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || (isexp == 0 && isifs (c))) + { + if (string[sindex]) /* from old goto dollar_add_string */ + sindex++; + if (c == 0) + { + c = CTLNUL; + goto add_character; + } + else + { +#if HANDLE_MULTIBYTE + if (MB_CUR_MAX > 1) + sindex--; + + if (MB_CUR_MAX > 1) + { + SADD_MBQCHAR_BODY(temp, string, sindex, string_size); + } + else +#endif + { + twochars[0] = CTLESC; + twochars[1] = c; + goto add_twochars; + } + } + } + + SADD_MBCHAR (temp, string, sindex, string_size); + + add_character: + RESIZE_MALLOCED_BUFFER (istring, istring_index, 1, istring_size, + DEFAULT_ARRAY_SIZE); + istring[istring_index++] = c; + istring[istring_index] = '\0'; + + /* Next character. */ + sindex++; + } + } + +finished_with_string: + /* OK, we're ready to return. If we have a quoted string, and + quoted_dollar_at is not set, we do no splitting at all; otherwise + we split on ' '. The routines that call this will handle what to + do if nothing has been expanded. */ + + /* Partially and wholly quoted strings which expand to the empty + string are retained as an empty arguments. Unquoted strings + which expand to the empty string are discarded. The single + exception is the case of expanding "$@" when there are no + positional parameters. In that case, we discard the expansion. */ + + /* Because of how the code that handles "" and '' in partially + quoted strings works, we need to make ISTRING into a QUOTED_NULL + if we saw quoting characters, but the expansion was empty. + "" and '' are tossed away before we get to this point when + processing partially quoted strings. This makes "" and $xxx"" + equivalent when xxx is unset. We also look to see whether we + saw a quoted null from a ${} expansion and add one back if we + need to. */ + + /* If we expand to nothing and there were no single or double quotes + in the word, we throw it away. Otherwise, we return a NULL word. + The single exception is for $@ surrounded by double quotes when + there are no positional parameters. In that case, we also throw + the word away. */ + + if (*istring == '\0') + { + if (quoted_dollar_at == 0 && (had_quoted_null || quoted_state == PARTIALLY_QUOTED)) + { + istring[0] = CTLNUL; + istring[1] = '\0'; + tword = make_bare_word (istring); + tword->flags |= W_HASQUOTEDNULL; /* XXX */ + list = make_word_list (tword, (WORD_LIST *)NULL); + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + tword->flags |= W_QUOTED; + } + /* According to sh, ksh, and Posix.2, if a word expands into nothing + and a double-quoted "$@" appears anywhere in it, then the entire + word is removed. */ + else if (quoted_state == UNQUOTED || quoted_dollar_at) + list = (WORD_LIST *)NULL; +#if 0 + else + { + tword = make_bare_word (istring); + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + tword->flags |= W_QUOTED; + list = make_word_list (tword, (WORD_LIST *)NULL); + } +#else + else + list = (WORD_LIST *)NULL; +#endif + } + else if (word->flags & W_NOSPLIT) + { + tword = make_bare_word (istring); + if (word->flags & W_ASSIGNMENT) + tword->flags |= W_ASSIGNMENT; /* XXX */ + if (word->flags & W_COMPASSIGN) + tword->flags |= W_COMPASSIGN; /* XXX */ + if (word->flags & W_NOGLOB) + tword->flags |= W_NOGLOB; /* XXX */ + if (word->flags & W_NOBRACE) + tword->flags |= W_NOBRACE; /* XXX */ + if (word->flags & W_NOEXPAND) + tword->flags |= W_NOEXPAND; /* XXX */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + tword->flags |= W_QUOTED; + if (had_quoted_null && QUOTED_NULL (istring)) + tword->flags |= W_HASQUOTEDNULL; + list = make_word_list (tword, (WORD_LIST *)NULL); + } + else + { + char *ifs_chars; + char *tstring; + + ifs_chars = (quoted_dollar_at || has_dollar_at) ? ifs_value : (char *)NULL; + + /* If we have $@, we need to split the results no matter what. If + IFS is unset or NULL, string_list_dollar_at has separated the + positional parameters with a space, so we split on space (we have + set ifs_chars to " \t\n" above if ifs is unset). If IFS is set, + string_list_dollar_at has separated the positional parameters + with the first character of $IFS, so we split on $IFS. If + SPLIT_ON_SPACES is set, we expanded $* (unquoted) with IFS either + unset or null, and we want to make sure that we split on spaces + regardless of what else has happened to IFS since the expansion. */ + if (split_on_spaces) + list = list_string (istring, " ", 1); /* XXX quoted == 1? */ + /* If we have $@ (has_dollar_at != 0) and we are in a context where we + don't want to split the result (W_NOSPLIT2), and we are not quoted, + we have already separated the arguments with the first character of + $IFS. In this case, we want to return a list with a single word + with the separator possibly replaced with a space (it's what other + shells seem to do). + quoted_dollar_at is internal to this function and is set if we are + passed an argument that is unquoted (quoted == 0) but we encounter a + double-quoted $@ while expanding it. */ + else if (has_dollar_at && quoted_dollar_at == 0 && ifs_chars && quoted == 0 && (word->flags & W_NOSPLIT2)) + { + /* Only split and rejoin if we have to */ + if (*ifs_chars && *ifs_chars != ' ') + { + list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1); + tstring = string_list (list); + } + else + tstring = istring; + tword = make_bare_word (tstring); + if (tstring != istring) + free (tstring); + goto set_word_flags; + } + else if (has_dollar_at && ifs_chars) + list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1); + else + { + tword = make_bare_word (istring); +set_word_flags: + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) || (quoted_state == WHOLLY_QUOTED)) + tword->flags |= W_QUOTED; + if (word->flags & W_ASSIGNMENT) + tword->flags |= W_ASSIGNMENT; + if (word->flags & W_COMPASSIGN) + tword->flags |= W_COMPASSIGN; + if (word->flags & W_NOGLOB) + tword->flags |= W_NOGLOB; + if (word->flags & W_NOBRACE) + tword->flags |= W_NOBRACE; + if (word->flags & W_NOEXPAND) + tword->flags |= W_NOEXPAND; + if (had_quoted_null && QUOTED_NULL (istring)) + tword->flags |= W_HASQUOTEDNULL; /* XXX */ + list = make_word_list (tword, (WORD_LIST *)NULL); + } + } + + free (istring); + return (list); +} + +/* **************************************************************** */ +/* */ +/* Functions for Quote Removal */ +/* */ +/* **************************************************************** */ + +/* Perform quote removal on STRING. If QUOTED > 0, assume we are obeying the + backslash quoting rules for within double quotes or a here document. */ +char * +string_quote_removal (string, quoted) + char *string; + int quoted; +{ + size_t slen; + char *r, *result_string, *temp, *send; + int sindex, tindex, dquote; + unsigned char c; + DECLARE_MBSTATE; + + /* The result can be no longer than the original string. */ + slen = strlen (string); + send = string + slen; + + r = result_string = (char *)xmalloc (slen + 1); + + for (dquote = sindex = 0; c = string[sindex];) + { + switch (c) + { + case '\\': + c = string[++sindex]; + if (c == 0) + { + *r++ = '\\'; + break; + } + if (((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || dquote) && (sh_syntaxtab[c] & CBSDQUOTE) == 0) + *r++ = '\\'; + /* FALLTHROUGH */ + + default: + SCOPY_CHAR_M (r, string, send, sindex); + break; + + case '\'': + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || dquote) + { + *r++ = c; + sindex++; + break; + } + tindex = sindex + 1; + temp = string_extract_single_quoted (string, &tindex); + if (temp) + { + strcpy (r, temp); + r += strlen (r); + free (temp); + } + sindex = tindex; + break; + + case '"': + dquote = 1 - dquote; + sindex++; + break; + } + } + *r = '\0'; + return (result_string); +} + +#if 0 +/* UNUSED */ +/* Perform quote removal on word WORD. This allocates and returns a new + WORD_DESC *. */ +WORD_DESC * +word_quote_removal (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_DESC *w; + char *t; + + t = string_quote_removal (word->word, quoted); + w = alloc_word_desc (); + w->word = t ? t : savestring (""); + return (w); +} + +/* Perform quote removal on all words in LIST. If QUOTED is non-zero, + the members of the list are treated as if they are surrounded by + double quotes. Return a new list, or NULL if LIST is NULL. */ +WORD_LIST * +word_list_quote_removal (list, quoted) + WORD_LIST *list; + int quoted; +{ + WORD_LIST *result, *t, *tresult, *e; + + for (t = list, result = (WORD_LIST *)NULL; t; t = t->next) + { + tresult = make_word_list (word_quote_removal (t->word, quoted), (WORD_LIST *)NULL); +#if 0 + result = (WORD_LIST *) list_append (result, tresult); +#else + if (result == 0) + result = e = tresult; + else + { + e->next = tresult; + while (e->next) + e = e->next; + } +#endif + } + return (result); +} +#endif + +/******************************************* + * * + * Functions to perform word splitting * + * * + *******************************************/ + +void +setifs (v) + SHELL_VAR *v; +{ + char *t; + unsigned char uc; + + ifs_var = v; + ifs_value = (v && value_cell (v)) ? value_cell (v) : " \t\n"; + + ifs_is_set = ifs_var != 0; + ifs_is_null = ifs_is_set && (*ifs_value == 0); + + /* Should really merge ifs_cmap with sh_syntaxtab. XXX - doesn't yet + handle multibyte chars in IFS */ + memset (ifs_cmap, '\0', sizeof (ifs_cmap)); + for (t = ifs_value ; t && *t; t++) + { + uc = *t; + ifs_cmap[uc] = 1; + } + +#if defined (HANDLE_MULTIBYTE) + if (ifs_value == 0) + { + ifs_firstc[0] = '\0'; + ifs_firstc_len = 1; + } + else + { + size_t ifs_len; + ifs_len = strnlen (ifs_value, MB_CUR_MAX); + ifs_firstc_len = MBLEN (ifs_value, ifs_len); + if (ifs_firstc_len == 1 || ifs_firstc_len == 0 || MB_INVALIDCH (ifs_firstc_len)) + { + ifs_firstc[0] = ifs_value[0]; + ifs_firstc[1] = '\0'; + ifs_firstc_len = 1; + } + else + memcpy (ifs_firstc, ifs_value, ifs_firstc_len); + } +#else + ifs_firstc = ifs_value ? *ifs_value : 0; +#endif +} + +char * +getifs () +{ + return ifs_value; +} + +/* This splits a single word into a WORD LIST on $IFS, but only if the word + is not quoted. list_string () performs quote removal for us, even if we + don't do any splitting. */ +WORD_LIST * +word_split (w, ifs_chars) + WORD_DESC *w; + char *ifs_chars; +{ + WORD_LIST *result; + + if (w) + { + char *xifs; + + xifs = ((w->flags & W_QUOTED) || ifs_chars == 0) ? "" : ifs_chars; + result = list_string (w->word, xifs, w->flags & W_QUOTED); + } + else + result = (WORD_LIST *)NULL; + + return (result); +} + +/* Perform word splitting on LIST and return the RESULT. It is possible + to return (WORD_LIST *)NULL. */ +static WORD_LIST * +word_list_split (list) + WORD_LIST *list; +{ + WORD_LIST *result, *t, *tresult, *e; + + for (t = list, result = (WORD_LIST *)NULL; t; t = t->next) + { + tresult = word_split (t->word, ifs_value); + if (result == 0) + result = e = tresult; + else + { + e->next = tresult; + while (e->next) + e = e->next; + } + } + return (result); +} + +/************************************************** + * * + * Functions to expand an entire WORD_LIST * + * * + **************************************************/ + +/* Do any word-expansion-specific cleanup and jump to top_level */ +static void +exp_jump_to_top_level (v) + int v; +{ + set_pipestatus_from_exit (last_command_exit_value); + + /* Cleanup code goes here. */ + expand_no_split_dollar_star = 0; /* XXX */ + expanding_redir = 0; + assigning_in_environment = 0; + + if (parse_and_execute_level == 0) + top_level_cleanup (); /* from sig.c */ + + jump_to_top_level (v); +} + +/* Put NLIST (which is a WORD_LIST * of only one element) at the front of + ELIST, and set ELIST to the new list. */ +#define PREPEND_LIST(nlist, elist) \ + do { nlist->next = elist; elist = nlist; } while (0) + +/* Separate out any initial variable assignments from TLIST. If set -k has + been executed, remove all assignment statements from TLIST. Initial + variable assignments and other environment assignments are placed + on SUBST_ASSIGN_VARLIST. */ +static WORD_LIST * +separate_out_assignments (tlist) + WORD_LIST *tlist; +{ + register WORD_LIST *vp, *lp; + + if (tlist == 0) + return ((WORD_LIST *)NULL); + + if (subst_assign_varlist) + dispose_words (subst_assign_varlist); /* Clean up after previous error */ + + subst_assign_varlist = (WORD_LIST *)NULL; + vp = lp = tlist; + + /* Separate out variable assignments at the start of the command. + Loop invariant: vp->next == lp + Loop postcondition: + lp = list of words left after assignment statements skipped + tlist = original list of words + */ + while (lp && (lp->word->flags & W_ASSIGNMENT)) + { + vp = lp; + lp = lp->next; + } + + /* If lp != tlist, we have some initial assignment statements. + We make SUBST_ASSIGN_VARLIST point to the list of assignment + words and TLIST point to the remaining words. */ + if (lp != tlist) + { + subst_assign_varlist = tlist; + /* ASSERT(vp->next == lp); */ + vp->next = (WORD_LIST *)NULL; /* terminate variable list */ + tlist = lp; /* remainder of word list */ + } + + /* vp == end of variable list */ + /* tlist == remainder of original word list without variable assignments */ + if (!tlist) + /* All the words in tlist were assignment statements */ + return ((WORD_LIST *)NULL); + + /* ASSERT(tlist != NULL); */ + /* ASSERT((tlist->word->flags & W_ASSIGNMENT) == 0); */ + + /* If the -k option is in effect, we need to go through the remaining + words, separate out the assignment words, and place them on + SUBST_ASSIGN_VARLIST. */ + if (place_keywords_in_env) + { + WORD_LIST *tp; /* tp == running pointer into tlist */ + + tp = tlist; + lp = tlist->next; + + /* Loop Invariant: tp->next == lp */ + /* Loop postcondition: tlist == word list without assignment statements */ + while (lp) + { + if (lp->word->flags & W_ASSIGNMENT) + { + /* Found an assignment statement, add this word to end of + subst_assign_varlist (vp). */ + if (!subst_assign_varlist) + subst_assign_varlist = vp = lp; + else + { + vp->next = lp; + vp = lp; + } + + /* Remove the word pointed to by LP from TLIST. */ + tp->next = lp->next; + /* ASSERT(vp == lp); */ + lp->next = (WORD_LIST *)NULL; + lp = tp->next; + } + else + { + tp = lp; + lp = lp->next; + } + } + } + return (tlist); +} + +#define WEXP_VARASSIGN 0x001 +#define WEXP_BRACEEXP 0x002 +#define WEXP_TILDEEXP 0x004 +#define WEXP_PARAMEXP 0x008 +#define WEXP_PATHEXP 0x010 + +/* All of the expansions, including variable assignments at the start of + the list. */ +#define WEXP_ALL (WEXP_VARASSIGN|WEXP_BRACEEXP|WEXP_TILDEEXP|WEXP_PARAMEXP|WEXP_PATHEXP) + +/* All of the expansions except variable assignments at the start of + the list. */ +#define WEXP_NOVARS (WEXP_BRACEEXP|WEXP_TILDEEXP|WEXP_PARAMEXP|WEXP_PATHEXP) + +/* All of the `shell expansions': brace expansion, tilde expansion, parameter + expansion, command substitution, arithmetic expansion, word splitting, and + quote removal. */ +#define WEXP_SHELLEXP (WEXP_BRACEEXP|WEXP_TILDEEXP|WEXP_PARAMEXP) + +/* Take the list of words in LIST and do the various substitutions. Return + a new list of words which is the expanded list, and without things like + variable assignments. */ + +WORD_LIST * +expand_words (list) + WORD_LIST *list; +{ + return (expand_word_list_internal (list, WEXP_ALL)); +} + +/* Same as expand_words (), but doesn't hack variable or environment + variables. */ +WORD_LIST * +expand_words_no_vars (list) + WORD_LIST *list; +{ + return (expand_word_list_internal (list, WEXP_NOVARS)); +} + +WORD_LIST * +expand_words_shellexp (list) + WORD_LIST *list; +{ + return (expand_word_list_internal (list, WEXP_SHELLEXP)); +} + +static WORD_LIST * +glob_expand_word_list (tlist, eflags) + WORD_LIST *tlist; + int eflags; +{ + char **glob_array, *temp_string; + register int glob_index; + WORD_LIST *glob_list, *output_list, *disposables, *next; + WORD_DESC *tword; + + output_list = disposables = (WORD_LIST *)NULL; + glob_array = (char **)NULL; + while (tlist) + { + /* For each word, either globbing is attempted or the word is + added to orig_list. If globbing succeeds, the results are + added to orig_list and the word (tlist) is added to the list + of disposable words. If globbing fails and failed glob + expansions are left unchanged (the shell default), the + original word is added to orig_list. If globbing fails and + failed glob expansions are removed, the original word is + added to the list of disposable words. orig_list ends up + in reverse order and requires a call to REVERSE_LIST to + be set right. After all words are examined, the disposable + words are freed. */ + next = tlist->next; + + /* If the word isn't an assignment and contains an unquoted + pattern matching character, then glob it. */ + if ((tlist->word->flags & W_NOGLOB) == 0 && + unquoted_glob_pattern_p (tlist->word->word)) + { + glob_array = shell_glob_filename (tlist->word->word); + + /* Handle error cases. + I don't think we should report errors like "No such file + or directory". However, I would like to report errors + like "Read failed". */ + + if (glob_array == 0 || GLOB_FAILED (glob_array)) + { + glob_array = (char **)xmalloc (sizeof (char *)); + glob_array[0] = (char *)NULL; + } + + /* Dequote the current word in case we have to use it. */ + if (glob_array[0] == NULL) + { + temp_string = dequote_string (tlist->word->word); + free (tlist->word->word); + tlist->word->word = temp_string; + } + + /* Make the array into a word list. */ + glob_list = (WORD_LIST *)NULL; + for (glob_index = 0; glob_array[glob_index]; glob_index++) + { + tword = make_bare_word (glob_array[glob_index]); + glob_list = make_word_list (tword, glob_list); + } + + if (glob_list) + { + output_list = (WORD_LIST *)list_append (glob_list, output_list); + PREPEND_LIST (tlist, disposables); + } + else if (fail_glob_expansion != 0) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("no match: %s"), tlist->word->word); + exp_jump_to_top_level (DISCARD); + } + else if (allow_null_glob_expansion == 0) + { + /* Failed glob expressions are left unchanged. */ + PREPEND_LIST (tlist, output_list); + } + else + { + /* Failed glob expressions are removed. */ + PREPEND_LIST (tlist, disposables); + } + } + else + { + /* Dequote the string. */ + temp_string = dequote_string (tlist->word->word); + free (tlist->word->word); + tlist->word->word = temp_string; + PREPEND_LIST (tlist, output_list); + } + + strvec_dispose (glob_array); + glob_array = (char **)NULL; + + tlist = next; + } + + if (disposables) + dispose_words (disposables); + + if (output_list) + output_list = REVERSE_LIST (output_list, WORD_LIST *); + + return (output_list); +} + +#if defined (BRACE_EXPANSION) +static WORD_LIST * +brace_expand_word_list (tlist, eflags) + WORD_LIST *tlist; + int eflags; +{ + register char **expansions; + char *temp_string; + WORD_LIST *disposables, *output_list, *next; + WORD_DESC *w; + int eindex; + + for (disposables = output_list = (WORD_LIST *)NULL; tlist; tlist = next) + { + next = tlist->next; + + if (tlist->word->flags & W_NOBRACE) + { +/*itrace("brace_expand_word_list: %s: W_NOBRACE", tlist->word->word);*/ + PREPEND_LIST (tlist, output_list); + continue; + } + + if ((tlist->word->flags & (W_COMPASSIGN|W_ASSIGNARG)) == (W_COMPASSIGN|W_ASSIGNARG)) + { +/*itrace("brace_expand_word_list: %s: W_COMPASSIGN|W_ASSIGNARG", tlist->word->word);*/ + PREPEND_LIST (tlist, output_list); + continue; + } + + /* Only do brace expansion if the word has a brace character. If + not, just add the word list element to BRACES and continue. In + the common case, at least when running shell scripts, this will + degenerate to a bunch of calls to `mbschr', and then what is + basically a reversal of TLIST into BRACES, which is corrected + by a call to REVERSE_LIST () on BRACES when the end of TLIST + is reached. */ + if (mbschr (tlist->word->word, LBRACE)) + { + expansions = brace_expand (tlist->word->word); + + for (eindex = 0; temp_string = expansions[eindex]; eindex++) + { + w = alloc_word_desc (); + w->word = temp_string; + + /* If brace expansion didn't change the word, preserve + the flags. We may want to preserve the flags + unconditionally someday -- XXX */ + if (STREQ (temp_string, tlist->word->word)) + w->flags = tlist->word->flags; + else + w = make_word_flags (w, temp_string); + + output_list = make_word_list (w, output_list); + } + free (expansions); + + /* Add TLIST to the list of words to be freed after brace + expansion has been performed. */ + PREPEND_LIST (tlist, disposables); + } + else + PREPEND_LIST (tlist, output_list); + } + + if (disposables) + dispose_words (disposables); + + if (output_list) + output_list = REVERSE_LIST (output_list, WORD_LIST *); + + return (output_list); +} +#endif + +#if defined (ARRAY_VARS) +/* Take WORD, a compound associative array assignment, and internally run + 'declare -A w', where W is the variable name portion of WORD. */ +static int +make_internal_declare (word, option) + char *word; + char *option; +{ + int t; + WORD_LIST *wl; + WORD_DESC *w; + + w = make_word (word); + + t = assignment (w->word, 0); + w->word[t] = '\0'; + + wl = make_word_list (w, (WORD_LIST *)NULL); + wl = make_word_list (make_word (option), wl); + + return (declare_builtin (wl)); +} +#endif + +static WORD_LIST * +shell_expand_word_list (tlist, eflags) + WORD_LIST *tlist; + int eflags; +{ + WORD_LIST *expanded, *orig_list, *new_list, *next, *temp_list; + int expanded_something, has_dollar_at; + char *temp_string; + + /* We do tilde expansion all the time. This is what 1003.2 says. */ + new_list = (WORD_LIST *)NULL; + for (orig_list = tlist; tlist; tlist = next) + { + temp_string = tlist->word->word; + + next = tlist->next; + +#if defined (ARRAY_VARS) + /* If this is a compound array assignment to a builtin that accepts + such assignments (e.g., `declare'), take the assignment and perform + it separately, handling the semantics of declarations inside shell + functions. This avoids the double-evaluation of such arguments, + because `declare' does some evaluation of compound assignments on + its own. */ + if ((tlist->word->flags & (W_COMPASSIGN|W_ASSIGNARG)) == (W_COMPASSIGN|W_ASSIGNARG)) + { + int t; + char opts[8], opti; + + opti = 0; + if (tlist->word->flags & (W_ASSIGNASSOC|W_ASSNGLOBAL|W_ASSIGNARRAY)) + opts[opti++] = '-'; + + if ((tlist->word->flags & (W_ASSIGNASSOC|W_ASSNGLOBAL)) == (W_ASSIGNASSOC|W_ASSNGLOBAL)) + { + opts[opti++] = 'g'; + opts[opti++] = 'A'; + } + else if (tlist->word->flags & W_ASSIGNASSOC) + opts[opti++] = 'A'; + else if ((tlist->word->flags & (W_ASSIGNARRAY|W_ASSNGLOBAL)) == (W_ASSIGNARRAY|W_ASSNGLOBAL)) + { + opts[opti++] = 'g'; + opts[opti++] = 'a'; + } + else if (tlist->word->flags & W_ASSIGNARRAY) + opts[opti++] = 'a'; + else if (tlist->word->flags & W_ASSNGLOBAL) + opts[opti++] = 'g'; + +#if 0 + /* If we have special handling note the integer attribute */ + if (opti > 0 && (tlist->word->flags & W_ASSIGNINT)) + opts[opti++] = 'i'; +#endif + + opts[opti] = '\0'; + if (opti > 0) + make_internal_declare (tlist->word->word, opts); + + t = do_word_assignment (tlist->word, 0); + if (t == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + exp_jump_to_top_level (DISCARD); + } + + /* Now transform the word as ksh93 appears to do and go on */ + t = assignment (tlist->word->word, 0); + tlist->word->word[t] = '\0'; + tlist->word->flags &= ~(W_ASSIGNMENT|W_NOSPLIT|W_COMPASSIGN|W_ASSIGNARG|W_ASSIGNASSOC|W_ASSIGNARRAY); + } +#endif + + expanded_something = 0; + expanded = expand_word_internal + (tlist->word, 0, 0, &has_dollar_at, &expanded_something); + + if (expanded == &expand_word_error || expanded == &expand_word_fatal) + { + /* By convention, each time this error is returned, + tlist->word->word has already been freed. */ + tlist->word->word = (char *)NULL; + + /* Dispose our copy of the original list. */ + dispose_words (orig_list); + /* Dispose the new list we're building. */ + dispose_words (new_list); + + last_command_exit_value = EXECUTION_FAILURE; + if (expanded == &expand_word_error) + exp_jump_to_top_level (DISCARD); + else + exp_jump_to_top_level (FORCE_EOF); + } + + /* Don't split words marked W_NOSPLIT. */ + if (expanded_something && (tlist->word->flags & W_NOSPLIT) == 0) + { + temp_list = word_list_split (expanded); + dispose_words (expanded); + } + else + { + /* If no parameter expansion, command substitution, process + substitution, or arithmetic substitution took place, then + do not do word splitting. We still have to remove quoted + null characters from the result. */ + word_list_remove_quoted_nulls (expanded); + temp_list = expanded; + } + + expanded = REVERSE_LIST (temp_list, WORD_LIST *); + new_list = (WORD_LIST *)list_append (expanded, new_list); + } + + if (orig_list) + dispose_words (orig_list); + + if (new_list) + new_list = REVERSE_LIST (new_list, WORD_LIST *); + + return (new_list); +} + +/* The workhorse for expand_words () and expand_words_no_vars (). + First arg is LIST, a WORD_LIST of words. + Second arg EFLAGS is a flags word controlling which expansions are + performed. + + This does all of the substitutions: brace expansion, tilde expansion, + parameter expansion, command substitution, arithmetic expansion, + process substitution, word splitting, and pathname expansion, according + to the bits set in EFLAGS. Words with the W_QUOTED or W_NOSPLIT bits + set, or for which no expansion is done, do not undergo word splitting. + Words with the W_NOGLOB bit set do not undergo pathname expansion; words + with W_NOBRACE set do not undergo brace expansion (see + brace_expand_word_list above). */ +static WORD_LIST * +expand_word_list_internal (list, eflags) + WORD_LIST *list; + int eflags; +{ + WORD_LIST *new_list, *temp_list; + int tint; + + tempenv_assign_error = 0; + if (list == 0) + return ((WORD_LIST *)NULL); + + garglist = new_list = copy_word_list (list); + if (eflags & WEXP_VARASSIGN) + { + garglist = new_list = separate_out_assignments (new_list); + if (new_list == 0) + { + if (subst_assign_varlist) + { + /* All the words were variable assignments, so they are placed + into the shell's environment. */ + for (temp_list = subst_assign_varlist; temp_list; temp_list = temp_list->next) + { + this_command_name = (char *)NULL; /* no arithmetic errors */ + tint = do_word_assignment (temp_list->word, 0); + /* Variable assignment errors in non-interactive shells + running in Posix.2 mode cause the shell to exit. */ + if (tint == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + if (interactive_shell == 0 && posixly_correct) + exp_jump_to_top_level (FORCE_EOF); + else + exp_jump_to_top_level (DISCARD); + } + } + dispose_words (subst_assign_varlist); + subst_assign_varlist = (WORD_LIST *)NULL; + } + return ((WORD_LIST *)NULL); + } + } + + /* Begin expanding the words that remain. The expansions take place on + things that aren't really variable assignments. */ + +#if defined (BRACE_EXPANSION) + /* Do brace expansion on this word if there are any brace characters + in the string. */ + if ((eflags & WEXP_BRACEEXP) && brace_expansion && new_list) + new_list = brace_expand_word_list (new_list, eflags); +#endif /* BRACE_EXPANSION */ + + /* Perform the `normal' shell expansions: tilde expansion, parameter and + variable substitution, command substitution, arithmetic expansion, + and word splitting. */ + new_list = shell_expand_word_list (new_list, eflags); + + /* Okay, we're almost done. Now let's just do some filename + globbing. */ + if (new_list) + { + if ((eflags & WEXP_PATHEXP) && disallow_filename_globbing == 0) + /* Glob expand the word list unless globbing has been disabled. */ + new_list = glob_expand_word_list (new_list, eflags); + else + /* Dequote the words, because we're not performing globbing. */ + new_list = dequote_list (new_list); + } + + if ((eflags & WEXP_VARASSIGN) && subst_assign_varlist) + { + sh_wassign_func_t *assign_func; + int is_special_builtin, is_builtin_or_func; + + /* If the remainder of the words expand to nothing, Posix.2 requires + that the variable and environment assignments affect the shell's + environment. */ + assign_func = new_list ? assign_in_env : do_word_assignment; + tempenv_assign_error = 0; + + is_builtin_or_func = (new_list && new_list->word && (find_shell_builtin (new_list->word->word) || find_function (new_list->word->word))); + /* Posix says that special builtins exit if a variable assignment error + occurs in an assignment preceding it. */ + is_special_builtin = (posixly_correct && new_list && new_list->word && find_special_builtin (new_list->word->word)); + + for (temp_list = subst_assign_varlist; temp_list; temp_list = temp_list->next) + { + this_command_name = (char *)NULL; + assigning_in_environment = (assign_func == assign_in_env); + tint = (*assign_func) (temp_list->word, is_builtin_or_func); + assigning_in_environment = 0; + /* Variable assignment errors in non-interactive shells running + in Posix.2 mode cause the shell to exit. */ + if (tint == 0) + { + if (assign_func == do_word_assignment) + { + last_command_exit_value = EXECUTION_FAILURE; + if (interactive_shell == 0 && posixly_correct && is_special_builtin) + exp_jump_to_top_level (FORCE_EOF); + else + exp_jump_to_top_level (DISCARD); + } + else + tempenv_assign_error++; + } + } + + dispose_words (subst_assign_varlist); + subst_assign_varlist = (WORD_LIST *)NULL; + } + + return (new_list); +} diff --git a/.pc/bash43-025.diff/builtins/common.h b/.pc/bash43-025.diff/builtins/common.h new file mode 100644 index 0000000..b0c2f7d --- /dev/null +++ b/.pc/bash43-025.diff/builtins/common.h @@ -0,0 +1,178 @@ +/* common.h -- extern declarations for functions defined in common.c. */ + +/* Copyright (C) 1993-2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (__COMMON_H) +# define __COMMON_H + +#include "stdc.h" + +#define ISOPTION(s, c) (s[0] == '-' && !s[2] && s[1] == c) + +/* Flag values for parse_and_execute () */ +#define SEVAL_NONINT 0x001 +#define SEVAL_INTERACT 0x002 +#define SEVAL_NOHIST 0x004 +#define SEVAL_NOFREE 0x008 +#define SEVAL_RESETLINE 0x010 +#define SEVAL_PARSEONLY 0x020 +#define SEVAL_NOLONGJMP 0x040 + +/* Flags for describe_command, shared between type.def and command.def */ +#define CDESC_ALL 0x001 /* type -a */ +#define CDESC_SHORTDESC 0x002 /* command -V */ +#define CDESC_REUSABLE 0x004 /* command -v */ +#define CDESC_TYPE 0x008 /* type -t */ +#define CDESC_PATH_ONLY 0x010 /* type -p */ +#define CDESC_FORCE_PATH 0x020 /* type -ap or type -P */ +#define CDESC_NOFUNCS 0x040 /* type -f */ +#define CDESC_ABSPATH 0x080 /* convert to absolute path, no ./ */ + +/* Flags for get_job_by_name */ +#define JM_PREFIX 0x01 /* prefix of job name */ +#define JM_SUBSTRING 0x02 /* substring of job name */ +#define JM_EXACT 0x04 /* match job name exactly */ +#define JM_STOPPED 0x08 /* match stopped jobs only */ +#define JM_FIRSTMATCH 0x10 /* return first matching job */ + +/* Flags for remember_args and value of changed_dollar_vars */ +#define ARGS_NONE 0x0 +#define ARGS_INVOC 0x01 +#define ARGS_FUNC 0x02 +#define ARGS_SETBLTIN 0x04 + +/* Functions from common.c */ +extern void builtin_error __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2))); +extern void builtin_warning __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2))); +extern void builtin_usage __P((void)); +extern void no_args __P((WORD_LIST *)); +extern int no_options __P((WORD_LIST *)); + +/* common error message functions */ +extern void sh_needarg __P((char *)); +extern void sh_neednumarg __P((char *)); +extern void sh_notfound __P((char *)); +extern void sh_invalidopt __P((char *)); +extern void sh_invalidoptname __P((char *)); +extern void sh_invalidid __P((char *)); +extern void sh_invalidnum __P((char *)); +extern void sh_invalidsig __P((char *)); +extern void sh_erange __P((char *, char *)); +extern void sh_badpid __P((char *)); +extern void sh_badjob __P((char *)); +extern void sh_readonly __P((const char *)); +extern void sh_nojobs __P((char *)); +extern void sh_restricted __P((char *)); +extern void sh_notbuiltin __P((char *)); +extern void sh_wrerror __P((void)); +extern void sh_ttyerror __P((int)); +extern int sh_chkwrite __P((int)); + +extern char **make_builtin_argv __P((WORD_LIST *, int *)); +extern void remember_args __P((WORD_LIST *, int)); + +extern int dollar_vars_changed __P((void)); +extern void set_dollar_vars_unchanged __P((void)); +extern void set_dollar_vars_changed __P((void)); + +extern int get_numeric_arg __P((WORD_LIST *, int, intmax_t *)); +extern int get_exitstat __P((WORD_LIST *)); +extern int read_octal __P((char *)); + +/* Keeps track of the current working directory. */ +extern char *the_current_working_directory; +extern char *get_working_directory __P((char *)); +extern void set_working_directory __P((char *)); + +#if defined (JOB_CONTROL) +extern int get_job_by_name __P((const char *, int)); +extern int get_job_spec __P((WORD_LIST *)); +#endif +extern int display_signal_list __P((WORD_LIST *, int)); + +/* It's OK to declare a function as returning a Function * without + providing a definition of what a `Function' is. */ +extern struct builtin *builtin_address_internal __P((char *, int)); +extern sh_builtin_func_t *find_shell_builtin __P((char *)); +extern sh_builtin_func_t *builtin_address __P((char *)); +extern sh_builtin_func_t *find_special_builtin __P((char *)); +extern void initialize_shell_builtins __P((void)); + +/* Functions from exit.def */ +extern void bash_logout __P((void)); + +/* Functions from getopts.def */ +extern void getopts_reset __P((int)); + +/* Functions from set.def */ +extern int minus_o_option_value __P((char *)); +extern void list_minus_o_opts __P((int, int)); +extern char **get_minus_o_opts __P((void)); +extern int set_minus_o_option __P((int, char *)); + +extern void set_shellopts __P((void)); +extern void parse_shellopts __P((char *)); +extern void initialize_shell_options __P((int)); + +extern void reset_shell_options __P((void)); + +/* Functions from shopt.def */ +extern void reset_shopt_options __P((void)); +extern char **get_shopt_options __P((void)); + +extern int shopt_setopt __P((char *, int)); +extern int shopt_listopt __P((char *, int)); + +extern int set_login_shell __P((char *, int)); + +extern void set_bashopts __P((void)); +extern void parse_bashopts __P((char *)); +extern void initialize_bashopts __P((int)); + +extern void set_compatibility_opts __P((void)); + +/* Functions from type.def */ +extern int describe_command __P((char *, int)); + +/* Functions from setattr.def */ +extern int set_or_show_attributes __P((WORD_LIST *, int, int)); +extern int show_all_var_attributes __P((int, int)); +extern int show_var_attributes __P((SHELL_VAR *, int, int)); +extern int show_name_attributes __P((char *, int)); +extern int show_func_attributes __P((char *, int)); +extern void set_var_attribute __P((char *, int, int)); + +/* Functions from pushd.def */ +extern char *get_dirstack_from_string __P((char *)); +extern char *get_dirstack_element __P((intmax_t, int)); +extern void set_dirstack_element __P((intmax_t, int, char *)); +extern WORD_LIST *get_directory_stack __P((int)); + +/* Functions from evalstring.c */ +extern int parse_and_execute __P((char *, const char *, int)); +extern int evalstring __P((char *, const char *, int)); +extern void parse_and_execute_cleanup __P((void)); +extern int parse_string __P((char *, const char *, int, char **)); + +/* Functions from evalfile.c */ +extern int maybe_execute_file __P((const char *, int)); +extern int source_file __P((const char *, int)); +extern int fc_execute_file __P((const char *)); + +#endif /* !__COMMON_H */ diff --git a/.pc/bash43-025.diff/builtins/evalstring.c b/.pc/bash43-025.diff/builtins/evalstring.c new file mode 100644 index 0000000..ce5b4d6 --- /dev/null +++ b/.pc/bash43-025.diff/builtins/evalstring.c @@ -0,0 +1,615 @@ +/* evalstring.c - evaluate a string as one or more shell commands. */ + +/* Copyright (C) 1996-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include +#include + +#include + +#include "filecntl.h" +#include "../bashansi.h" + +#include "../shell.h" +#include "../jobs.h" +#include "../builtins.h" +#include "../flags.h" +#include "../input.h" +#include "../execute_cmd.h" +#include "../redir.h" +#include "../trap.h" +#include "../bashintl.h" + +#include + +#if defined (HISTORY) +# include "../bashhist.h" +#endif + +#include "common.h" +#include "builtext.h" + +#if !defined (errno) +extern int errno; +#endif + +#define IS_BUILTIN(s) (builtin_address_internal(s, 0) != (struct builtin *)NULL) + +extern int indirection_level, subshell_environment; +extern int line_number, line_number_for_err_trap; +extern int current_token, shell_eof_token; +extern int last_command_exit_value; +extern int running_trap; +extern int loop_level; +extern int executing_list; +extern int comsub_ignore_return; +extern int posixly_correct; +extern int return_catch_flag, return_catch_value; +extern sh_builtin_func_t *this_shell_builtin; +extern char *the_printed_command_except_trap; + +int parse_and_execute_level = 0; + +static int cat_file __P((REDIRECT *)); + +#define PE_TAG "parse_and_execute top" +#define PS_TAG "parse_string top" + +#if defined (HISTORY) +static void +set_history_remembering () +{ + remember_on_history = enable_history_list; +} +#endif + +static void +restore_lastcom (x) + char *x; +{ + FREE (the_printed_command_except_trap); + the_printed_command_except_trap = x; +} + +/* How to force parse_and_execute () to clean up after itself. */ +void +parse_and_execute_cleanup () +{ + if (running_trap) + { + run_trap_cleanup (running_trap - 1); + unfreeze_jobs_list (); + } + + if (have_unwind_protects ()) + run_unwind_frame (PE_TAG); + else + parse_and_execute_level = 0; /* XXX */ +} + +static void +parse_prologue (string, flags, tag) + char *string; + int flags; + char *tag; +{ + char *orig_string, *lastcom; + int x; + + orig_string = string; + /* Unwind protect this invocation of parse_and_execute (). */ + begin_unwind_frame (tag); + unwind_protect_int (parse_and_execute_level); + unwind_protect_jmp_buf (top_level); + unwind_protect_int (indirection_level); + unwind_protect_int (line_number); + unwind_protect_int (line_number_for_err_trap); + unwind_protect_int (loop_level); + unwind_protect_int (executing_list); + unwind_protect_int (comsub_ignore_return); + if (flags & (SEVAL_NONINT|SEVAL_INTERACT)) + unwind_protect_int (interactive); + +#if defined (HISTORY) + if (parse_and_execute_level == 0) + add_unwind_protect (set_history_remembering, (char *)NULL); + else + unwind_protect_int (remember_on_history); /* can be used in scripts */ +# if defined (BANG_HISTORY) + if (interactive_shell) + unwind_protect_int (history_expansion_inhibited); +# endif /* BANG_HISTORY */ +#endif /* HISTORY */ + + if (interactive_shell) + { + x = get_current_prompt_level (); + add_unwind_protect (set_current_prompt_level, x); + } + + if (the_printed_command_except_trap) + { + lastcom = savestring (the_printed_command_except_trap); + add_unwind_protect (restore_lastcom, lastcom); + } + + add_unwind_protect (pop_stream, (char *)NULL); + if (parser_expanding_alias ()) + add_unwind_protect (parser_restore_alias, (char *)NULL); + + if (orig_string && ((flags & SEVAL_NOFREE) == 0)) + add_unwind_protect (xfree, orig_string); + end_unwind_frame (); + + if (flags & (SEVAL_NONINT|SEVAL_INTERACT)) + interactive = (flags & SEVAL_NONINT) ? 0 : 1; + +#if defined (HISTORY) + if (flags & SEVAL_NOHIST) + bash_history_disable (); +#endif /* HISTORY */ +} + +/* Parse and execute the commands in STRING. Returns whatever + execute_command () returns. This frees STRING. FLAGS is a + flags word; look in common.h for the possible values. Actions + are: + (flags & SEVAL_NONINT) -> interactive = 0; + (flags & SEVAL_INTERACT) -> interactive = 1; + (flags & SEVAL_NOHIST) -> call bash_history_disable () + (flags & SEVAL_NOFREE) -> don't free STRING when finished + (flags & SEVAL_RESETLINE) -> reset line_number to 1 +*/ + +int +parse_and_execute (string, from_file, flags) + char *string; + const char *from_file; + int flags; +{ + int code, lreset; + volatile int should_jump_to_top_level, last_result; + COMMAND *volatile command; + volatile sigset_t pe_sigmask; + + parse_prologue (string, flags, PE_TAG); + + parse_and_execute_level++; + + lreset = flags & SEVAL_RESETLINE; + +#if defined (HAVE_POSIX_SIGNALS) + /* If we longjmp and are going to go on, use this to restore signal mask */ + sigemptyset (&pe_sigmask); + sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &pe_sigmask); +#endif + + /* Reset the line number if the caller wants us to. If we don't reset the + line number, we have to subtract one, because we will add one just + before executing the next command (resetting the line number sets it to + 0; the first line number is 1). */ + push_stream (lreset); + if (parser_expanding_alias ()) + /* push current shell_input_line */ + parser_save_alias (); + + if (lreset == 0) + line_number--; + + indirection_level++; + + code = should_jump_to_top_level = 0; + last_result = EXECUTION_SUCCESS; + + with_input_from_string (string, from_file); + while (*(bash_input.location.string)) + { + command = (COMMAND *)NULL; + + if (interrupt_state) + { + last_result = EXECUTION_FAILURE; + break; + } + + /* Provide a location for functions which `longjmp (top_level)' to + jump to. This prevents errors in substitution from restarting + the reader loop directly, for example. */ + code = setjmp_nosigs (top_level); + + if (code) + { + should_jump_to_top_level = 0; + switch (code) + { + case ERREXIT: + /* variable_context -> 0 is what eval.c:reader_loop() does in + these circumstances. Don't bother with cleanup here because + we don't want to run the function execution cleanup stuff + that will cause pop_context and other functions to run. + XXX - change that if we want the function context to be + unwound. */ + if (exit_immediately_on_error && variable_context) + { + discard_unwind_frame ("pe_dispose"); + variable_context = 0; /* not in a function */ + } + should_jump_to_top_level = 1; + goto out; + case FORCE_EOF: + case EXITPROG: + if (command) + run_unwind_frame ("pe_dispose"); + /* Remember to call longjmp (top_level) after the old + value for it is restored. */ + should_jump_to_top_level = 1; + goto out; + + case DISCARD: + if (command) + run_unwind_frame ("pe_dispose"); + last_result = last_command_exit_value = EXECUTION_FAILURE; /* XXX */ + if (subshell_environment) + { + should_jump_to_top_level = 1; + goto out; + } + else + { +#if 0 + dispose_command (command); /* pe_dispose does this */ +#endif +#if defined (HAVE_POSIX_SIGNALS) + sigprocmask (SIG_SETMASK, &pe_sigmask, (sigset_t *)NULL); +#endif + continue; + } + + default: + command_error ("parse_and_execute", CMDERR_BADJUMP, code, 0); + break; + } + } + + if (parse_command () == 0) + { + if ((flags & SEVAL_PARSEONLY) || (interactive_shell == 0 && read_but_dont_execute)) + { + last_result = EXECUTION_SUCCESS; + dispose_command (global_command); + global_command = (COMMAND *)NULL; + } + else if (command = global_command) + { + struct fd_bitmap *bitmap; + + bitmap = new_fd_bitmap (FD_BITMAP_SIZE); + begin_unwind_frame ("pe_dispose"); + add_unwind_protect (dispose_fd_bitmap, bitmap); + add_unwind_protect (dispose_command, command); /* XXX */ + + global_command = (COMMAND *)NULL; + + if ((subshell_environment & SUBSHELL_COMSUB) && comsub_ignore_return) + command->flags |= CMD_IGNORE_RETURN; + +#if defined (ONESHOT) + /* + * IF + * we were invoked as `bash -c' (startup_state == 2) AND + * parse_and_execute has not been called recursively AND + * we're not running a trap AND + * we have parsed the full command (string == '\0') AND + * we're not going to run the exit trap AND + * we have a simple command without redirections AND + * the command is not being timed AND + * the command's return status is not being inverted + * THEN + * tell the execution code that we don't need to fork + */ + if (startup_state == 2 && parse_and_execute_level == 1 && + running_trap == 0 && + *bash_input.location.string == '\0' && + command->type == cm_simple && + signal_is_trapped (EXIT_TRAP) == 0 && + command->redirects == 0 && command->value.Simple->redirects == 0 && + ((command->flags & CMD_TIME_PIPELINE) == 0) && + ((command->flags & CMD_INVERT_RETURN) == 0)) + { + command->flags |= CMD_NO_FORK; + command->value.Simple->flags |= CMD_NO_FORK; + } +#endif /* ONESHOT */ + + /* See if this is a candidate for $( type == cm_simple && !command->redirects && + (command->flags & CMD_TIME_PIPELINE) == 0 && + command->value.Simple->words == 0 && + command->value.Simple->redirects && + command->value.Simple->redirects->next == 0 && + command->value.Simple->redirects->instruction == r_input_direction && + command->value.Simple->redirects->redirector.dest == 0) + { + int r; + r = cat_file (command->value.Simple->redirects); + last_result = (r < 0) ? EXECUTION_FAILURE : EXECUTION_SUCCESS; + } + else + last_result = execute_command_internal + (command, 0, NO_PIPE, NO_PIPE, bitmap); + dispose_command (command); + dispose_fd_bitmap (bitmap); + discard_unwind_frame ("pe_dispose"); + } + } + else + { + last_result = EXECUTION_FAILURE; + + if (interactive_shell == 0 && this_shell_builtin && + (this_shell_builtin == source_builtin || this_shell_builtin == eval_builtin) && + last_command_exit_value == EX_BADSYNTAX && posixly_correct) + { + should_jump_to_top_level = 1; + code = ERREXIT; + last_command_exit_value = EX_BADUSAGE; + } + + /* Since we are shell compatible, syntax errors in a script + abort the execution of the script. Right? */ + break; + } + } + + out: + + run_unwind_frame (PE_TAG); + + if (interrupt_state && parse_and_execute_level == 0) + { + /* An interrupt during non-interactive execution in an + interactive shell (e.g. via $PROMPT_COMMAND) should + not cause the shell to exit. */ + interactive = interactive_shell; + throw_to_top_level (); + } + + if (should_jump_to_top_level) + jump_to_top_level (code); + + return (last_result); +} + +/* Parse a command contained in STRING according to FLAGS and return the + number of characters consumed from the string. If non-NULL, set *ENDP + to the position in the string where the parse ended. Used to validate + command substitutions during parsing to obey Posix rules about finding + the end of the command and balancing parens. */ +int +parse_string (string, from_file, flags, endp) + char *string; + const char *from_file; + int flags; + char **endp; +{ + int code, nc; + volatile int should_jump_to_top_level; + COMMAND *volatile command, *oglobal; + char *ostring; + volatile sigset_t ps_sigmask; + + parse_prologue (string, flags, PS_TAG); + +#if defined (HAVE_POSIX_SIGNALS) + /* If we longjmp and are going to go on, use this to restore signal mask */ + sigemptyset (&ps_sigmask); + sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &ps_sigmask); +#endif + +/* itrace("parse_string: `%s'", string); */ + /* Reset the line number if the caller wants us to. If we don't reset the + line number, we have to subtract one, because we will add one just + before executing the next command (resetting the line number sets it to + 0; the first line number is 1). */ + push_stream (0); + if (parser_expanding_alias ()) + /* push current shell_input_line */ + parser_save_alias (); + + code = should_jump_to_top_level = 0; + oglobal = global_command; + ostring = string; + + with_input_from_string (string, from_file); + while (*(bash_input.location.string)) + { + command = (COMMAND *)NULL; + +#if 0 + if (interrupt_state) + break; +#endif + + /* Provide a location for functions which `longjmp (top_level)' to + jump to. */ + code = setjmp_nosigs (top_level); + + if (code) + { +#if defined (DEBUG) +itrace("parse_string: longjmp executed: code = %d", code); +#endif + should_jump_to_top_level = 0; + switch (code) + { + case FORCE_EOF: + case ERREXIT: + case EXITPROG: + case DISCARD: /* XXX */ + if (command) + dispose_command (command); + /* Remember to call longjmp (top_level) after the old + value for it is restored. */ + should_jump_to_top_level = 1; + goto out; + + default: +#if defined (HAVE_POSIX_SIGNALS) + sigprocmask (SIG_SETMASK, &ps_sigmask, (sigset_t *)NULL); +#endif + command_error ("parse_string", CMDERR_BADJUMP, code, 0); + break; + } + } + + if (parse_command () == 0) + { + dispose_command (global_command); + global_command = (COMMAND *)NULL; + } + else + { + if ((flags & SEVAL_NOLONGJMP) == 0) + { + should_jump_to_top_level = 1; + code = DISCARD; + } + else + reset_parser (); /* XXX - sets token_to_read */ + break; + } + + if (current_token == yacc_EOF || current_token == shell_eof_token) + break; + } + + out: + + global_command = oglobal; + nc = bash_input.location.string - ostring; + if (endp) + *endp = bash_input.location.string; + + run_unwind_frame (PS_TAG); + + if (should_jump_to_top_level) + jump_to_top_level (code); + + return (nc); +} + +/* Handle a $( < file ) command substitution. This expands the filename, + returning errors as appropriate, then just cats the file to the standard + output. */ +static int +cat_file (r) + REDIRECT *r; +{ + char *fn; + int fd, rval; + + if (r->instruction != r_input_direction) + return -1; + + /* Get the filename. */ + if (posixly_correct && !interactive_shell) + disallow_filename_globbing++; + fn = redirection_expand (r->redirectee.filename); + if (posixly_correct && !interactive_shell) + disallow_filename_globbing--; + + if (fn == 0) + { + redirection_error (r, AMBIGUOUS_REDIRECT); + return -1; + } + + fd = open(fn, O_RDONLY); + if (fd < 0) + { + file_error (fn); + free (fn); + return -1; + } + + rval = zcatfd (fd, 1, fn); + + free (fn); + close (fd); + + return (rval); +} + +int +evalstring (string, from_file, flags) + char *string; + const char *from_file; + int flags; +{ + volatile int r, rflag, rcatch; + + rcatch = 0; + rflag = return_catch_flag; + /* If we are in a place where `return' is valid, we have to catch + `eval "... return"' and make sure parse_and_execute cleans up. Then + we can trampoline to the previous saved return_catch location. */ + if (rflag) + { + begin_unwind_frame ("evalstring"); + + unwind_protect_int (return_catch_flag); + unwind_protect_jmp_buf (return_catch); + + return_catch_flag++; /* increment so we have a counter */ + rcatch = setjmp_nosigs (return_catch); + } + + if (rcatch) + { + parse_and_execute_cleanup (); + r = return_catch_value; + } + else + /* Note that parse_and_execute () frees the string it is passed. */ + r = parse_and_execute (string, from_file, flags); + + if (rflag) + { + run_unwind_frame ("evalstring"); + if (rcatch && return_catch_flag) + { + return_catch_value = r; + longjmp (return_catch, 1); + } + } + + return (r); +} diff --git a/.pc/bash43-025.diff/patchlevel.h b/.pc/bash43-025.diff/patchlevel.h new file mode 100644 index 0000000..9f74b87 --- /dev/null +++ b/.pc/bash43-025.diff/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 24 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/.pc/bash43-025.diff/subst.c b/.pc/bash43-025.diff/subst.c new file mode 100644 index 0000000..70654e6 --- /dev/null +++ b/.pc/bash43-025.diff/subst.c @@ -0,0 +1,9757 @@ +/* subst.c -- The part of the shell that does parameter, command, arithmetic, + and globbing substitutions. */ + +/* ``Have a little faith, there's magic in the night. You ain't a + beauty, but, hey, you're alright.'' */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" +#include +#include "chartypes.h" +#if defined (HAVE_PWD_H) +# include +#endif +#include +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" +#include "posixstat.h" +#include "bashintl.h" + +#include "shell.h" +#include "parser.h" +#include "flags.h" +#include "jobs.h" +#include "execute_cmd.h" +#include "filecntl.h" +#include "trap.h" +#include "pathexp.h" +#include "mailcheck.h" + +#include "shmbutil.h" +#include "typemax.h" + +#include "builtins/getopt.h" +#include "builtins/common.h" + +#include "builtins/builtext.h" + +#include +#include + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +/* The size that strings change by. */ +#define DEFAULT_INITIAL_ARRAY_SIZE 112 +#define DEFAULT_ARRAY_SIZE 128 + +/* Variable types. */ +#define VT_VARIABLE 0 +#define VT_POSPARMS 1 +#define VT_ARRAYVAR 2 +#define VT_ARRAYMEMBER 3 +#define VT_ASSOCVAR 4 + +#define VT_STARSUB 128 /* $* or ${array[*]} -- used to split */ + +/* Flags for quoted_strchr */ +#define ST_BACKSL 0x01 +#define ST_CTLESC 0x02 +#define ST_SQUOTE 0x04 /* unused yet */ +#define ST_DQUOTE 0x08 /* unused yet */ + +/* Flags for the `pflags' argument to param_expand() */ +#define PF_NOCOMSUB 0x01 /* Do not perform command substitution */ +#define PF_IGNUNBOUND 0x02 /* ignore unbound vars even if -u set */ +#define PF_NOSPLIT2 0x04 /* same as W_NOSPLIT2 */ +#define PF_ASSIGNRHS 0x08 /* same as W_ASSIGNRHS */ + +/* These defs make it easier to use the editor. */ +#define LBRACE '{' +#define RBRACE '}' +#define LPAREN '(' +#define RPAREN ')' +#define LBRACK '[' +#define RBRACK ']' + +#if defined (HANDLE_MULTIBYTE) +#define WLPAREN L'(' +#define WRPAREN L')' +#endif + +/* Evaluates to 1 if C is one of the shell's special parameters whose length + can be taken, but is also one of the special expansion characters. */ +#define VALID_SPECIAL_LENGTH_PARAM(c) \ + ((c) == '-' || (c) == '?' || (c) == '#') + +/* Evaluates to 1 if C is one of the shell's special parameters for which an + indirect variable reference may be made. */ +#define VALID_INDIR_PARAM(c) \ + ((posixly_correct == 0 && (c) == '#') || (posixly_correct == 0 && (c) == '?') || (c) == '@' || (c) == '*') + +/* Evaluates to 1 if C is one of the OP characters that follows the parameter + in ${parameter[:]OPword}. */ +#define VALID_PARAM_EXPAND_CHAR(c) (sh_syntaxtab[(unsigned char)c] & CSUBSTOP) + +/* Evaluates to 1 if this is one of the shell's special variables. */ +#define SPECIAL_VAR(name, wi) \ + ((DIGIT (*name) && all_digits (name)) || \ + (name[1] == '\0' && (sh_syntaxtab[(unsigned char)*name] & CSPECVAR)) || \ + (wi && name[2] == '\0' && VALID_INDIR_PARAM (name[1]))) + +/* An expansion function that takes a string and a quoted flag and returns + a WORD_LIST *. Used as the type of the third argument to + expand_string_if_necessary(). */ +typedef WORD_LIST *EXPFUNC __P((char *, int)); + +/* Process ID of the last command executed within command substitution. */ +pid_t last_command_subst_pid = NO_PID; +pid_t current_command_subst_pid = NO_PID; + +/* Variables used to keep track of the characters in IFS. */ +SHELL_VAR *ifs_var; +char *ifs_value; +unsigned char ifs_cmap[UCHAR_MAX + 1]; +int ifs_is_set, ifs_is_null; + +#if defined (HANDLE_MULTIBYTE) +unsigned char ifs_firstc[MB_LEN_MAX]; +size_t ifs_firstc_len; +#else +unsigned char ifs_firstc; +#endif + +/* Sentinel to tell when we are performing variable assignments preceding a + command name and putting them into the environment. Used to make sure + we use the temporary environment when looking up variable values. */ +int assigning_in_environment; + +/* Used to hold a list of variable assignments preceding a command. Global + so the SIGCHLD handler in jobs.c can unwind-protect it when it runs a + SIGCHLD trap and so it can be saved and restored by the trap handlers. */ +WORD_LIST *subst_assign_varlist = (WORD_LIST *)NULL; + +/* Extern functions and variables from different files. */ +extern int last_command_exit_value, last_command_exit_signal; +extern int subshell_environment, line_number; +extern int subshell_level, parse_and_execute_level, sourcelevel; +extern int eof_encountered; +extern int return_catch_flag, return_catch_value; +extern pid_t dollar_dollar_pid; +extern int posixly_correct; +extern char *this_command_name; +extern struct fd_bitmap *current_fds_to_close; +extern int wordexp_only; +extern int expanding_redir; +extern int tempenv_assign_error; +extern int builtin_ignoring_errexit; + +#if !defined (HAVE_WCSDUP) && defined (HANDLE_MULTIBYTE) +extern wchar_t *wcsdup __P((const wchar_t *)); +#endif + +/* Non-zero means to allow unmatched globbed filenames to expand to + a null file. */ +int allow_null_glob_expansion; + +/* Non-zero means to throw an error when globbing fails to match anything. */ +int fail_glob_expansion; + +#if 0 +/* Variables to keep track of which words in an expanded word list (the + output of expand_word_list_internal) are the result of globbing + expansions. GLOB_ARGV_FLAGS is used by execute_cmd.c. + (CURRENTLY UNUSED). */ +char *glob_argv_flags; +static int glob_argv_flags_size; +#endif + +static WORD_LIST expand_word_error, expand_word_fatal; +static WORD_DESC expand_wdesc_error, expand_wdesc_fatal; +static char expand_param_error, expand_param_fatal; +static char extract_string_error, extract_string_fatal; + +/* Tell the expansion functions to not longjmp back to top_level on fatal + errors. Enabled when doing completion and prompt string expansion. */ +static int no_longjmp_on_fatal_error = 0; + +/* Set by expand_word_unsplit; used to inhibit splitting and re-joining + $* on $IFS, primarily when doing assignment statements. */ +static int expand_no_split_dollar_star = 0; + +/* A WORD_LIST of words to be expanded by expand_word_list_internal, + without any leading variable assignments. */ +static WORD_LIST *garglist = (WORD_LIST *)NULL; + +static char *quoted_substring __P((char *, int, int)); +static int quoted_strlen __P((char *)); +static char *quoted_strchr __P((char *, int, int)); + +static char *expand_string_if_necessary __P((char *, int, EXPFUNC *)); +static inline char *expand_string_to_string_internal __P((char *, int, EXPFUNC *)); +static WORD_LIST *call_expand_word_internal __P((WORD_DESC *, int, int, int *, int *)); +static WORD_LIST *expand_string_internal __P((char *, int)); +static WORD_LIST *expand_string_leave_quoted __P((char *, int)); +static WORD_LIST *expand_string_for_rhs __P((char *, int, int *, int *)); + +static WORD_LIST *list_quote_escapes __P((WORD_LIST *)); +static WORD_LIST *list_dequote_escapes __P((WORD_LIST *)); + +static char *make_quoted_char __P((int)); +static WORD_LIST *quote_list __P((WORD_LIST *)); + +static int unquoted_substring __P((char *, char *)); +static int unquoted_member __P((int, char *)); + +#if defined (ARRAY_VARS) +static SHELL_VAR *do_compound_assignment __P((char *, char *, int)); +#endif +static int do_assignment_internal __P((const WORD_DESC *, int)); + +static char *string_extract_verbatim __P((char *, size_t, int *, char *, int)); +static char *string_extract __P((char *, int *, char *, int)); +static char *string_extract_double_quoted __P((char *, int *, int)); +static inline char *string_extract_single_quoted __P((char *, int *)); +static inline int skip_single_quoted __P((const char *, size_t, int)); +static int skip_double_quoted __P((char *, size_t, int)); +static char *extract_delimited_string __P((char *, int *, char *, char *, char *, int)); +static char *extract_dollar_brace_string __P((char *, int *, int, int)); +static int skip_matched_pair __P((const char *, int, int, int, int)); + +static char *pos_params __P((char *, int, int, int)); + +static unsigned char *mb_getcharlens __P((char *, int)); + +static char *remove_upattern __P((char *, char *, int)); +#if defined (HANDLE_MULTIBYTE) +static wchar_t *remove_wpattern __P((wchar_t *, size_t, wchar_t *, int)); +#endif +static char *remove_pattern __P((char *, char *, int)); + +static int match_upattern __P((char *, char *, int, char **, char **)); +#if defined (HANDLE_MULTIBYTE) +static int match_wpattern __P((wchar_t *, char **, size_t, wchar_t *, int, char **, char **)); +#endif +static int match_pattern __P((char *, char *, int, char **, char **)); +static int getpatspec __P((int, char *)); +static char *getpattern __P((char *, int, int)); +static char *variable_remove_pattern __P((char *, char *, int, int)); +static char *list_remove_pattern __P((WORD_LIST *, char *, int, int, int)); +static char *parameter_list_remove_pattern __P((int, char *, int, int)); +#ifdef ARRAY_VARS +static char *array_remove_pattern __P((SHELL_VAR *, char *, int, char *, int)); +#endif +static char *parameter_brace_remove_pattern __P((char *, char *, int, char *, int, int, int)); + +static char *process_substitute __P((char *, int)); + +static char *read_comsub __P((int, int, int *)); + +#ifdef ARRAY_VARS +static arrayind_t array_length_reference __P((char *)); +#endif + +static int valid_brace_expansion_word __P((char *, int)); +static int chk_atstar __P((char *, int, int *, int *)); +static int chk_arithsub __P((const char *, int)); + +static WORD_DESC *parameter_brace_expand_word __P((char *, int, int, int, arrayind_t *)); +static char *parameter_brace_find_indir __P((char *, int, int, int)); +static WORD_DESC *parameter_brace_expand_indir __P((char *, int, int, int *, int *)); +static WORD_DESC *parameter_brace_expand_rhs __P((char *, char *, int, int, int *, int *)); +static void parameter_brace_expand_error __P((char *, char *)); + +static int valid_length_expression __P((char *)); +static intmax_t parameter_brace_expand_length __P((char *)); + +static char *skiparith __P((char *, int)); +static int verify_substring_values __P((SHELL_VAR *, char *, char *, int, intmax_t *, intmax_t *)); +static int get_var_and_type __P((char *, char *, arrayind_t, int, int, SHELL_VAR **, char **)); +static char *mb_substring __P((char *, int, int)); +static char *parameter_brace_substring __P((char *, char *, int, char *, int, int)); + +static int shouldexp_replacement __P((char *)); + +static char *pos_params_pat_subst __P((char *, char *, char *, int)); + +static char *parameter_brace_patsub __P((char *, char *, int, char *, int, int)); + +static char *pos_params_casemod __P((char *, char *, int, int)); +static char *parameter_brace_casemod __P((char *, char *, int, int, char *, int, int)); + +static WORD_DESC *parameter_brace_expand __P((char *, int *, int, int, int *, int *)); +static WORD_DESC *param_expand __P((char *, int *, int, int *, int *, int *, int *, int)); + +static WORD_LIST *expand_word_internal __P((WORD_DESC *, int, int, int *, int *)); + +static WORD_LIST *word_list_split __P((WORD_LIST *)); + +static void exp_jump_to_top_level __P((int)); + +static WORD_LIST *separate_out_assignments __P((WORD_LIST *)); +static WORD_LIST *glob_expand_word_list __P((WORD_LIST *, int)); +#ifdef BRACE_EXPANSION +static WORD_LIST *brace_expand_word_list __P((WORD_LIST *, int)); +#endif +#if defined (ARRAY_VARS) +static int make_internal_declare __P((char *, char *)); +#endif +static WORD_LIST *shell_expand_word_list __P((WORD_LIST *, int)); +static WORD_LIST *expand_word_list_internal __P((WORD_LIST *, int)); + +/* **************************************************************** */ +/* */ +/* Utility Functions */ +/* */ +/* **************************************************************** */ + +#if defined (DEBUG) +void +dump_word_flags (flags) + int flags; +{ + int f; + + f = flags; + fprintf (stderr, "%d -> ", f); + if (f & W_ASSIGNASSOC) + { + f &= ~W_ASSIGNASSOC; + fprintf (stderr, "W_ASSIGNASSOC%s", f ? "|" : ""); + } + if (f & W_ASSIGNARRAY) + { + f &= ~W_ASSIGNARRAY; + fprintf (stderr, "W_ASSIGNARRAY%s", f ? "|" : ""); + } + if (f & W_HASCTLESC) + { + f &= ~W_HASCTLESC; + fprintf (stderr, "W_HASCTLESC%s", f ? "|" : ""); + } + if (f & W_NOPROCSUB) + { + f &= ~W_NOPROCSUB; + fprintf (stderr, "W_NOPROCSUB%s", f ? "|" : ""); + } + if (f & W_DQUOTE) + { + f &= ~W_DQUOTE; + fprintf (stderr, "W_DQUOTE%s", f ? "|" : ""); + } + if (f & W_HASQUOTEDNULL) + { + f &= ~W_HASQUOTEDNULL; + fprintf (stderr, "W_HASQUOTEDNULL%s", f ? "|" : ""); + } + if (f & W_ASSIGNARG) + { + f &= ~W_ASSIGNARG; + fprintf (stderr, "W_ASSIGNARG%s", f ? "|" : ""); + } + if (f & W_ASSNBLTIN) + { + f &= ~W_ASSNBLTIN; + fprintf (stderr, "W_ASSNBLTIN%s", f ? "|" : ""); + } + if (f & W_ASSNGLOBAL) + { + f &= ~W_ASSNGLOBAL; + fprintf (stderr, "W_ASSNGLOBAL%s", f ? "|" : ""); + } + if (f & W_ASSIGNINT) + { + f &= ~W_ASSIGNINT; + fprintf (stderr, "W_ASSIGNINT%s", f ? "|" : ""); + } + if (f & W_COMPASSIGN) + { + f &= ~W_COMPASSIGN; + fprintf (stderr, "W_COMPASSIGN%s", f ? "|" : ""); + } + if (f & W_NOEXPAND) + { + f &= ~W_NOEXPAND; + fprintf (stderr, "W_NOEXPAND%s", f ? "|" : ""); + } + if (f & W_ITILDE) + { + f &= ~W_ITILDE; + fprintf (stderr, "W_ITILDE%s", f ? "|" : ""); + } + if (f & W_NOTILDE) + { + f &= ~W_NOTILDE; + fprintf (stderr, "W_NOTILDE%s", f ? "|" : ""); + } + if (f & W_ASSIGNRHS) + { + f &= ~W_ASSIGNRHS; + fprintf (stderr, "W_ASSIGNRHS%s", f ? "|" : ""); + } + if (f & W_NOCOMSUB) + { + f &= ~W_NOCOMSUB; + fprintf (stderr, "W_NOCOMSUB%s", f ? "|" : ""); + } + if (f & W_DOLLARSTAR) + { + f &= ~W_DOLLARSTAR; + fprintf (stderr, "W_DOLLARSTAR%s", f ? "|" : ""); + } + if (f & W_DOLLARAT) + { + f &= ~W_DOLLARAT; + fprintf (stderr, "W_DOLLARAT%s", f ? "|" : ""); + } + if (f & W_TILDEEXP) + { + f &= ~W_TILDEEXP; + fprintf (stderr, "W_TILDEEXP%s", f ? "|" : ""); + } + if (f & W_NOSPLIT2) + { + f &= ~W_NOSPLIT2; + fprintf (stderr, "W_NOSPLIT2%s", f ? "|" : ""); + } + if (f & W_NOSPLIT) + { + f &= ~W_NOSPLIT; + fprintf (stderr, "W_NOSPLIT%s", f ? "|" : ""); + } + if (f & W_NOBRACE) + { + f &= ~W_NOBRACE; + fprintf (stderr, "W_NOBRACE%s", f ? "|" : ""); + } + if (f & W_NOGLOB) + { + f &= ~W_NOGLOB; + fprintf (stderr, "W_NOGLOB%s", f ? "|" : ""); + } + if (f & W_SPLITSPACE) + { + f &= ~W_SPLITSPACE; + fprintf (stderr, "W_SPLITSPACE%s", f ? "|" : ""); + } + if (f & W_ASSIGNMENT) + { + f &= ~W_ASSIGNMENT; + fprintf (stderr, "W_ASSIGNMENT%s", f ? "|" : ""); + } + if (f & W_QUOTED) + { + f &= ~W_QUOTED; + fprintf (stderr, "W_QUOTED%s", f ? "|" : ""); + } + if (f & W_HASDOLLAR) + { + f &= ~W_HASDOLLAR; + fprintf (stderr, "W_HASDOLLAR%s", f ? "|" : ""); + } + fprintf (stderr, "\n"); + fflush (stderr); +} +#endif + +#ifdef INCLUDE_UNUSED +static char * +quoted_substring (string, start, end) + char *string; + int start, end; +{ + register int len, l; + register char *result, *s, *r; + + len = end - start; + + /* Move to string[start], skipping quoted characters. */ + for (s = string, l = 0; *s && l < start; ) + { + if (*s == CTLESC) + { + s++; + continue; + } + l++; + if (*s == 0) + break; + } + + r = result = (char *)xmalloc (2*len + 1); /* save room for quotes */ + + /* Copy LEN characters, including quote characters. */ + s = string + l; + for (l = 0; l < len; s++) + { + if (*s == CTLESC) + *r++ = *s++; + *r++ = *s; + l++; + if (*s == 0) + break; + } + *r = '\0'; + return result; +} +#endif + +#ifdef INCLUDE_UNUSED +/* Return the length of S, skipping over quoted characters */ +static int +quoted_strlen (s) + char *s; +{ + register char *p; + int i; + + i = 0; + for (p = s; *p; p++) + { + if (*p == CTLESC) + { + p++; + if (*p == 0) + return (i + 1); + } + i++; + } + + return i; +} +#endif + +/* Find the first occurrence of character C in string S, obeying shell + quoting rules. If (FLAGS & ST_BACKSL) is non-zero, backslash-escaped + characters are skipped. If (FLAGS & ST_CTLESC) is non-zero, characters + escaped with CTLESC are skipped. */ +static char * +quoted_strchr (s, c, flags) + char *s; + int c, flags; +{ + register char *p; + + for (p = s; *p; p++) + { + if (((flags & ST_BACKSL) && *p == '\\') + || ((flags & ST_CTLESC) && *p == CTLESC)) + { + p++; + if (*p == '\0') + return ((char *)NULL); + continue; + } + else if (*p == c) + return p; + } + return ((char *)NULL); +} + +/* Return 1 if CHARACTER appears in an unquoted portion of + STRING. Return 0 otherwise. CHARACTER must be a single-byte character. */ +static int +unquoted_member (character, string) + int character; + char *string; +{ + size_t slen; + int sindex, c; + DECLARE_MBSTATE; + + slen = strlen (string); + sindex = 0; + while (c = string[sindex]) + { + if (c == character) + return (1); + + switch (c) + { + default: + ADVANCE_CHAR (string, slen, sindex); + break; + + case '\\': + sindex++; + if (string[sindex]) + ADVANCE_CHAR (string, slen, sindex); + break; + + case '\'': + sindex = skip_single_quoted (string, slen, ++sindex); + break; + + case '"': + sindex = skip_double_quoted (string, slen, ++sindex); + break; + } + } + return (0); +} + +/* Return 1 if SUBSTR appears in an unquoted portion of STRING. */ +static int +unquoted_substring (substr, string) + char *substr, *string; +{ + size_t slen; + int sindex, c, sublen; + DECLARE_MBSTATE; + + if (substr == 0 || *substr == '\0') + return (0); + + slen = strlen (string); + sublen = strlen (substr); + for (sindex = 0; c = string[sindex]; ) + { + if (STREQN (string + sindex, substr, sublen)) + return (1); + + switch (c) + { + case '\\': + sindex++; + if (string[sindex]) + ADVANCE_CHAR (string, slen, sindex); + break; + + case '\'': + sindex = skip_single_quoted (string, slen, ++sindex); + break; + + case '"': + sindex = skip_double_quoted (string, slen, ++sindex); + break; + + default: + ADVANCE_CHAR (string, slen, sindex); + break; + } + } + return (0); +} + +/* Most of the substitutions must be done in parallel. In order + to avoid using tons of unclear goto's, I have some functions + for manipulating malloc'ed strings. They all take INDX, a + pointer to an integer which is the offset into the string + where manipulation is taking place. They also take SIZE, a + pointer to an integer which is the current length of the + character array for this string. */ + +/* Append SOURCE to TARGET at INDEX. SIZE is the current amount + of space allocated to TARGET. SOURCE can be NULL, in which + case nothing happens. Gets rid of SOURCE by freeing it. + Returns TARGET in case the location has changed. */ +INLINE char * +sub_append_string (source, target, indx, size) + char *source, *target; + int *indx, *size; +{ + if (source) + { + int srclen, n; + + srclen = STRLEN (source); + if (srclen >= (int)(*size - *indx)) + { + n = srclen + *indx; + n = (n + DEFAULT_ARRAY_SIZE) - (n % DEFAULT_ARRAY_SIZE); + target = (char *)xrealloc (target, (*size = n)); + } + + FASTCOPY (source, target + *indx, srclen); + *indx += srclen; + target[*indx] = '\0'; + + free (source); + } + return (target); +} + +#if 0 +/* UNUSED */ +/* Append the textual representation of NUMBER to TARGET. + INDX and SIZE are as in SUB_APPEND_STRING. */ +char * +sub_append_number (number, target, indx, size) + intmax_t number; + int *indx, *size; + char *target; +{ + char *temp; + + temp = itos (number); + return (sub_append_string (temp, target, indx, size)); +} +#endif + +/* Extract a substring from STRING, starting at SINDEX and ending with + one of the characters in CHARLIST. Don't make the ending character + part of the string. Leave SINDEX pointing at the ending character. + Understand about backslashes in the string. If (flags & SX_VARNAME) + is non-zero, and array variables have been compiled into the shell, + everything between a `[' and a corresponding `]' is skipped over. + If (flags & SX_NOALLOC) is non-zero, don't return the substring, just + update SINDEX. If (flags & SX_REQMATCH) is non-zero, the string must + contain a closing character from CHARLIST. */ +static char * +string_extract (string, sindex, charlist, flags) + char *string; + int *sindex; + char *charlist; + int flags; +{ + register int c, i; + int found; + size_t slen; + char *temp; + DECLARE_MBSTATE; + + slen = (MB_CUR_MAX > 1) ? strlen (string + *sindex) + *sindex : 0; + i = *sindex; + found = 0; + while (c = string[i]) + { + if (c == '\\') + { + if (string[i + 1]) + i++; + else + break; + } +#if defined (ARRAY_VARS) + else if ((flags & SX_VARNAME) && c == '[') + { + int ni; + /* If this is an array subscript, skip over it and continue. */ + ni = skipsubscript (string, i, 0); + if (string[ni] == ']') + i = ni; + } +#endif + else if (MEMBER (c, charlist)) + { + found = 1; + break; + } + + ADVANCE_CHAR (string, slen, i); + } + + /* If we had to have a matching delimiter and didn't find one, return an + error and let the caller deal with it. */ + if ((flags & SX_REQMATCH) && found == 0) + { + *sindex = i; + return (&extract_string_error); + } + + temp = (flags & SX_NOALLOC) ? (char *)NULL : substring (string, *sindex, i); + *sindex = i; + + return (temp); +} + +/* Extract the contents of STRING as if it is enclosed in double quotes. + SINDEX, when passed in, is the offset of the character immediately + following the opening double quote; on exit, SINDEX is left pointing after + the closing double quote. If STRIPDQ is non-zero, unquoted double + quotes are stripped and the string is terminated by a null byte. + Backslashes between the embedded double quotes are processed. If STRIPDQ + is zero, an unquoted `"' terminates the string. */ +static char * +string_extract_double_quoted (string, sindex, stripdq) + char *string; + int *sindex, stripdq; +{ + size_t slen; + char *send; + int j, i, t; + unsigned char c; + char *temp, *ret; /* The new string we return. */ + int pass_next, backquote, si; /* State variables for the machine. */ + int dquote; + DECLARE_MBSTATE; + + slen = strlen (string + *sindex) + *sindex; + send = string + slen; + + pass_next = backquote = dquote = 0; + temp = (char *)xmalloc (1 + slen - *sindex); + + j = 0; + i = *sindex; + while (c = string[i]) + { + /* Process a character that was quoted by a backslash. */ + if (pass_next) + { + /* XXX - take another look at this in light of Interp 221 */ + /* Posix.2 sez: + + ``The backslash shall retain its special meaning as an escape + character only when followed by one of the characters: + $ ` " \ ''. + + If STRIPDQ is zero, we handle the double quotes here and let + expand_word_internal handle the rest. If STRIPDQ is non-zero, + we have already been through one round of backslash stripping, + and want to strip these backslashes only if DQUOTE is non-zero, + indicating that we are inside an embedded double-quoted string. */ + + /* If we are in an embedded quoted string, then don't strip + backslashes before characters for which the backslash + retains its special meaning, but remove backslashes in + front of other characters. If we are not in an + embedded quoted string, don't strip backslashes at all. + This mess is necessary because the string was already + surrounded by double quotes (and sh has some really weird + quoting rules). + The returned string will be run through expansion as if + it were double-quoted. */ + if ((stripdq == 0 && c != '"') || + (stripdq && ((dquote && (sh_syntaxtab[c] & CBSDQUOTE)) || dquote == 0))) + temp[j++] = '\\'; + pass_next = 0; + +add_one_character: + COPY_CHAR_I (temp, j, string, send, i); + continue; + } + + /* A backslash protects the next character. The code just above + handles preserving the backslash in front of any character but + a double quote. */ + if (c == '\\') + { + pass_next++; + i++; + continue; + } + + /* Inside backquotes, ``the portion of the quoted string from the + initial backquote and the characters up to the next backquote + that is not preceded by a backslash, having escape characters + removed, defines that command''. */ + if (backquote) + { + if (c == '`') + backquote = 0; + temp[j++] = c; + i++; + continue; + } + + if (c == '`') + { + temp[j++] = c; + backquote++; + i++; + continue; + } + + /* Pass everything between `$(' and the matching `)' or a quoted + ${ ... } pair through according to the Posix.2 specification. */ + if (c == '$' && ((string[i + 1] == LPAREN) || (string[i + 1] == LBRACE))) + { + int free_ret = 1; + + si = i + 2; + if (string[i + 1] == LPAREN) + ret = extract_command_subst (string, &si, 0); + else + ret = extract_dollar_brace_string (string, &si, Q_DOUBLE_QUOTES, 0); + + temp[j++] = '$'; + temp[j++] = string[i + 1]; + + /* Just paranoia; ret will not be 0 unless no_longjmp_on_fatal_error + is set. */ + if (ret == 0 && no_longjmp_on_fatal_error) + { + free_ret = 0; + ret = string + i + 2; + } + + for (t = 0; ret[t]; t++, j++) + temp[j] = ret[t]; + temp[j] = string[si]; + + if (string[si]) + { + j++; + i = si + 1; + } + else + i = si; + + if (free_ret) + free (ret); + continue; + } + + /* Add any character but a double quote to the quoted string we're + accumulating. */ + if (c != '"') + goto add_one_character; + + /* c == '"' */ + if (stripdq) + { + dquote ^= 1; + i++; + continue; + } + + break; + } + temp[j] = '\0'; + + /* Point to after the closing quote. */ + if (c) + i++; + *sindex = i; + + return (temp); +} + +/* This should really be another option to string_extract_double_quoted. */ +static int +skip_double_quoted (string, slen, sind) + char *string; + size_t slen; + int sind; +{ + int c, i; + char *ret; + int pass_next, backquote, si; + DECLARE_MBSTATE; + + pass_next = backquote = 0; + i = sind; + while (c = string[i]) + { + if (pass_next) + { + pass_next = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next++; + i++; + continue; + } + else if (backquote) + { + if (c == '`') + backquote = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '`') + { + backquote++; + i++; + continue; + } + else if (c == '$' && ((string[i + 1] == LPAREN) || (string[i + 1] == LBRACE))) + { + si = i + 2; + if (string[i + 1] == LPAREN) + ret = extract_command_subst (string, &si, SX_NOALLOC); + else + ret = extract_dollar_brace_string (string, &si, Q_DOUBLE_QUOTES, SX_NOALLOC); + + i = si + 1; + continue; + } + else if (c != '"') + { + ADVANCE_CHAR (string, slen, i); + continue; + } + else + break; + } + + if (c) + i++; + + return (i); +} + +/* Extract the contents of STRING as if it is enclosed in single quotes. + SINDEX, when passed in, is the offset of the character immediately + following the opening single quote; on exit, SINDEX is left pointing after + the closing single quote. */ +static inline char * +string_extract_single_quoted (string, sindex) + char *string; + int *sindex; +{ + register int i; + size_t slen; + char *t; + DECLARE_MBSTATE; + + /* Don't need slen for ADVANCE_CHAR unless multibyte chars possible. */ + slen = (MB_CUR_MAX > 1) ? strlen (string + *sindex) + *sindex : 0; + i = *sindex; + while (string[i] && string[i] != '\'') + ADVANCE_CHAR (string, slen, i); + + t = substring (string, *sindex, i); + + if (string[i]) + i++; + *sindex = i; + + return (t); +} + +static inline int +skip_single_quoted (string, slen, sind) + const char *string; + size_t slen; + int sind; +{ + register int c; + DECLARE_MBSTATE; + + c = sind; + while (string[c] && string[c] != '\'') + ADVANCE_CHAR (string, slen, c); + + if (string[c]) + c++; + return c; +} + +/* Just like string_extract, but doesn't hack backslashes or any of + that other stuff. Obeys CTLESC quoting. Used to do splitting on $IFS. */ +static char * +string_extract_verbatim (string, slen, sindex, charlist, flags) + char *string; + size_t slen; + int *sindex; + char *charlist; + int flags; +{ + register int i; +#if defined (HANDLE_MULTIBYTE) + size_t clen; + wchar_t *wcharlist; +#endif + int c; + char *temp; + DECLARE_MBSTATE; + + if (charlist[0] == '\'' && charlist[1] == '\0') + { + temp = string_extract_single_quoted (string, sindex); + --*sindex; /* leave *sindex at separator character */ + return temp; + } + + i = *sindex; +#if 0 + /* See how the MBLEN and ADVANCE_CHAR macros work to understand why we need + this only if MB_CUR_MAX > 1. */ + slen = (MB_CUR_MAX > 1) ? strlen (string + *sindex) + *sindex : 1; +#endif +#if defined (HANDLE_MULTIBYTE) + clen = strlen (charlist); + wcharlist = 0; +#endif + while (c = string[i]) + { +#if defined (HANDLE_MULTIBYTE) + size_t mblength; +#endif + if ((flags & SX_NOCTLESC) == 0 && c == CTLESC) + { + i += 2; + continue; + } + /* Even if flags contains SX_NOCTLESC, we let CTLESC quoting CTLNUL + through, to protect the CTLNULs from later calls to + remove_quoted_nulls. */ + else if ((flags & SX_NOESCCTLNUL) == 0 && c == CTLESC && string[i+1] == CTLNUL) + { + i += 2; + continue; + } + +#if defined (HANDLE_MULTIBYTE) + mblength = MBLEN (string + i, slen - i); + if (mblength > 1) + { + wchar_t wc; + mblength = mbtowc (&wc, string + i, slen - i); + if (MB_INVALIDCH (mblength)) + { + if (MEMBER (c, charlist)) + break; + } + else + { + if (wcharlist == 0) + { + size_t len; + len = mbstowcs (wcharlist, charlist, 0); + if (len == -1) + len = 0; + wcharlist = (wchar_t *)xmalloc (sizeof (wchar_t) * (len + 1)); + mbstowcs (wcharlist, charlist, len + 1); + } + + if (wcschr (wcharlist, wc)) + break; + } + } + else +#endif + if (MEMBER (c, charlist)) + break; + + ADVANCE_CHAR (string, slen, i); + } + +#if defined (HANDLE_MULTIBYTE) + FREE (wcharlist); +#endif + + temp = substring (string, *sindex, i); + *sindex = i; + + return (temp); +} + +/* Extract the $( construct in STRING, and return a new string. + Start extracting at (SINDEX) as if we had just seen "$(". + Make (SINDEX) get the position of the matching ")". ) + XFLAGS is additional flags to pass to other extraction functions. */ +char * +extract_command_subst (string, sindex, xflags) + char *string; + int *sindex; + int xflags; +{ + if (string[*sindex] == LPAREN) + return (extract_delimited_string (string, sindex, "$(", "(", ")", xflags|SX_COMMAND)); /*)*/ + else + { + xflags |= (no_longjmp_on_fatal_error ? SX_NOLONGJMP : 0); + return (xparse_dolparen (string, string+*sindex, sindex, xflags)); + } +} + +/* Extract the $[ construct in STRING, and return a new string. (]) + Start extracting at (SINDEX) as if we had just seen "$[". + Make (SINDEX) get the position of the matching "]". */ +char * +extract_arithmetic_subst (string, sindex) + char *string; + int *sindex; +{ + return (extract_delimited_string (string, sindex, "$[", "[", "]", 0)); /*]*/ +} + +#if defined (PROCESS_SUBSTITUTION) +/* Extract the <( or >( construct in STRING, and return a new string. + Start extracting at (SINDEX) as if we had just seen "<(". + Make (SINDEX) get the position of the matching ")". */ /*))*/ +char * +extract_process_subst (string, starter, sindex, xflags) + char *string; + char *starter; + int *sindex; + int xflags; +{ +#if 0 + return (extract_delimited_string (string, sindex, starter, "(", ")", SX_COMMAND)); +#else + xflags |= (no_longjmp_on_fatal_error ? SX_NOLONGJMP : 0); + return (xparse_dolparen (string, string+*sindex, sindex, xflags)); +#endif +} +#endif /* PROCESS_SUBSTITUTION */ + +#if defined (ARRAY_VARS) +/* This can be fooled by unquoted right parens in the passed string. If + each caller verifies that the last character in STRING is a right paren, + we don't even need to call extract_delimited_string. */ +char * +extract_array_assignment_list (string, sindex) + char *string; + int *sindex; +{ + int slen; + char *ret; + + slen = strlen (string); /* ( */ + if (string[slen - 1] == ')') + { + ret = substring (string, *sindex, slen - 1); + *sindex = slen - 1; + return ret; + } + return 0; +} +#endif + +/* Extract and create a new string from the contents of STRING, a + character string delimited with OPENER and CLOSER. SINDEX is + the address of an int describing the current offset in STRING; + it should point to just after the first OPENER found. On exit, + SINDEX gets the position of the last character of the matching CLOSER. + If OPENER is more than a single character, ALT_OPENER, if non-null, + contains a character string that can also match CLOSER and thus + needs to be skipped. */ +static char * +extract_delimited_string (string, sindex, opener, alt_opener, closer, flags) + char *string; + int *sindex; + char *opener, *alt_opener, *closer; + int flags; +{ + int i, c, si; + size_t slen; + char *t, *result; + int pass_character, nesting_level, in_comment; + int len_closer, len_opener, len_alt_opener; + DECLARE_MBSTATE; + + slen = strlen (string + *sindex) + *sindex; + len_opener = STRLEN (opener); + len_alt_opener = STRLEN (alt_opener); + len_closer = STRLEN (closer); + + pass_character = in_comment = 0; + + nesting_level = 1; + i = *sindex; + + while (nesting_level) + { + c = string[i]; + + if (c == 0) + break; + + if (in_comment) + { + if (c == '\n') + in_comment = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + + if (pass_character) /* previous char was backslash */ + { + pass_character = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + + /* Not exactly right yet; should handle shell metacharacters and + multibyte characters, too. See COMMENT_BEGIN define in parse.y */ + if ((flags & SX_COMMAND) && c == '#' && (i == 0 || string[i - 1] == '\n' || shellblank (string[i - 1]))) + { + in_comment = 1; + ADVANCE_CHAR (string, slen, i); + continue; + } + + if (c == CTLESC || c == '\\') + { + pass_character++; + i++; + continue; + } + + /* Process a nested command substitution, but only if we're parsing an + arithmetic substitution. */ + if ((flags & SX_COMMAND) && string[i] == '$' && string[i+1] == LPAREN) + { + si = i + 2; + t = extract_command_subst (string, &si, flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Process a nested OPENER. */ + if (STREQN (string + i, opener, len_opener)) + { + si = i + len_opener; + t = extract_delimited_string (string, &si, opener, alt_opener, closer, flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Process a nested ALT_OPENER */ + if (len_alt_opener && STREQN (string + i, alt_opener, len_alt_opener)) + { + si = i + len_alt_opener; + t = extract_delimited_string (string, &si, alt_opener, alt_opener, closer, flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* If the current substring terminates the delimited string, decrement + the nesting level. */ + if (STREQN (string + i, closer, len_closer)) + { + i += len_closer - 1; /* move to last byte of the closer */ + nesting_level--; + if (nesting_level == 0) + break; + } + + /* Pass old-style command substitution through verbatim. */ + if (c == '`') + { + si = i + 1; + t = string_extract (string, &si, "`", flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Pass single-quoted and double-quoted strings through verbatim. */ + if (c == '\'' || c == '"') + { + si = i + 1; + i = (c == '\'') ? skip_single_quoted (string, slen, si) + : skip_double_quoted (string, slen, si); + continue; + } + + /* move past this character, which was not special. */ + ADVANCE_CHAR (string, slen, i); + } + + if (c == 0 && nesting_level) + { + if (no_longjmp_on_fatal_error == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("bad substitution: no closing `%s' in %s"), closer, string); + exp_jump_to_top_level (DISCARD); + } + else + { + *sindex = i; + return (char *)NULL; + } + } + + si = i - *sindex - len_closer + 1; + if (flags & SX_NOALLOC) + result = (char *)NULL; + else + { + result = (char *)xmalloc (1 + si); + strncpy (result, string + *sindex, si); + result[si] = '\0'; + } + *sindex = i; + + return (result); +} + +/* Extract a parameter expansion expression within ${ and } from STRING. + Obey the Posix.2 rules for finding the ending `}': count braces while + skipping over enclosed quoted strings and command substitutions. + SINDEX is the address of an int describing the current offset in STRING; + it should point to just after the first `{' found. On exit, SINDEX + gets the position of the matching `}'. QUOTED is non-zero if this + occurs inside double quotes. */ +/* XXX -- this is very similar to extract_delimited_string -- XXX */ +static char * +extract_dollar_brace_string (string, sindex, quoted, flags) + char *string; + int *sindex, quoted, flags; +{ + register int i, c; + size_t slen; + int pass_character, nesting_level, si, dolbrace_state; + char *result, *t; + DECLARE_MBSTATE; + + pass_character = 0; + nesting_level = 1; + slen = strlen (string + *sindex) + *sindex; + + /* The handling of dolbrace_state needs to agree with the code in parse.y: + parse_matched_pair(). The different initial value is to handle the + case where this function is called to parse the word in + ${param op word} (SX_WORD). */ + dolbrace_state = (flags & SX_WORD) ? DOLBRACE_WORD : DOLBRACE_PARAM; + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && (flags & SX_POSIXEXP)) + dolbrace_state = DOLBRACE_QUOTE; + + i = *sindex; + while (c = string[i]) + { + if (pass_character) + { + pass_character = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + + /* CTLESCs and backslashes quote the next character. */ + if (c == CTLESC || c == '\\') + { + pass_character++; + i++; + continue; + } + + if (string[i] == '$' && string[i+1] == LBRACE) + { + nesting_level++; + i += 2; + continue; + } + + if (c == RBRACE) + { + nesting_level--; + if (nesting_level == 0) + break; + i++; + continue; + } + + /* Pass the contents of old-style command substitutions through + verbatim. */ + if (c == '`') + { + si = i + 1; + t = string_extract (string, &si, "`", flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Pass the contents of new-style command substitutions and + arithmetic substitutions through verbatim. */ + if (string[i] == '$' && string[i+1] == LPAREN) + { + si = i + 2; + t = extract_command_subst (string, &si, flags|SX_NOALLOC); + i = si + 1; + continue; + } + + /* Pass the contents of double-quoted strings through verbatim. */ + if (c == '"') + { + si = i + 1; + i = skip_double_quoted (string, slen, si); + /* skip_XXX_quoted leaves index one past close quote */ + continue; + } + + if (c == '\'') + { +/*itrace("extract_dollar_brace_string: c == single quote flags = %d quoted = %d dolbrace_state = %d", flags, quoted, dolbrace_state);*/ + if (posixly_correct && shell_compatibility_level > 42 && dolbrace_state != DOLBRACE_QUOTE && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ADVANCE_CHAR (string, slen, i); + else + { + si = i + 1; + i = skip_single_quoted (string, slen, si); + } + + continue; + } + + /* move past this character, which was not special. */ + ADVANCE_CHAR (string, slen, i); + + /* This logic must agree with parse.y:parse_matched_pair, since they + share the same defines. */ + if (dolbrace_state == DOLBRACE_PARAM && c == '%' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if (dolbrace_state == DOLBRACE_PARAM && c == '#' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if (dolbrace_state == DOLBRACE_PARAM && c == '/' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE2; /* XXX */ + else if (dolbrace_state == DOLBRACE_PARAM && c == '^' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if (dolbrace_state == DOLBRACE_PARAM && c == ',' && (i - *sindex) > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if (dolbrace_state == DOLBRACE_PARAM && strchr ("#%^,~:-=?+/", c) != 0) + dolbrace_state = DOLBRACE_OP; + else if (dolbrace_state == DOLBRACE_OP && strchr ("#%^,~:-=?+/", c) == 0) + dolbrace_state = DOLBRACE_WORD; + } + + if (c == 0 && nesting_level) + { + if (no_longjmp_on_fatal_error == 0) + { /* { */ + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("bad substitution: no closing `%s' in %s"), "}", string); + exp_jump_to_top_level (DISCARD); + } + else + { + *sindex = i; + return ((char *)NULL); + } + } + + result = (flags & SX_NOALLOC) ? (char *)NULL : substring (string, *sindex, i); + *sindex = i; + + return (result); +} + +/* Remove backslashes which are quoting backquotes from STRING. Modifies + STRING, and returns a pointer to it. */ +char * +de_backslash (string) + char *string; +{ + register size_t slen; + register int i, j, prev_i; + DECLARE_MBSTATE; + + slen = strlen (string); + i = j = 0; + + /* Loop copying string[i] to string[j], i >= j. */ + while (i < slen) + { + if (string[i] == '\\' && (string[i + 1] == '`' || string[i + 1] == '\\' || + string[i + 1] == '$')) + i++; + prev_i = i; + ADVANCE_CHAR (string, slen, i); + if (j < prev_i) + do string[j++] = string[prev_i++]; while (prev_i < i); + else + j = i; + } + string[j] = '\0'; + + return (string); +} + +#if 0 +/*UNUSED*/ +/* Replace instances of \! in a string with !. */ +void +unquote_bang (string) + char *string; +{ + register int i, j; + register char *temp; + + temp = (char *)xmalloc (1 + strlen (string)); + + for (i = 0, j = 0; (temp[j] = string[i]); i++, j++) + { + if (string[i] == '\\' && string[i + 1] == '!') + { + temp[j] = '!'; + i++; + } + } + strcpy (string, temp); + free (temp); +} +#endif + +#define CQ_RETURN(x) do { no_longjmp_on_fatal_error = 0; return (x); } while (0) + +/* This function assumes s[i] == open; returns with s[ret] == close; used to + parse array subscripts. FLAGS & 1 means to not attempt to skip over + matched pairs of quotes or backquotes, or skip word expansions; it is + intended to be used after expansion has been performed and during final + assignment parsing (see arrayfunc.c:assign_compound_array_list()). */ +static int +skip_matched_pair (string, start, open, close, flags) + const char *string; + int start, open, close, flags; +{ + int i, pass_next, backq, si, c, count; + size_t slen; + char *temp, *ss; + DECLARE_MBSTATE; + + slen = strlen (string + start) + start; + no_longjmp_on_fatal_error = 1; + + i = start + 1; /* skip over leading bracket */ + count = 1; + pass_next = backq = 0; + ss = (char *)string; + while (c = string[i]) + { + if (pass_next) + { + pass_next = 0; + if (c == 0) + CQ_RETURN(i); + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (backq) + { + if (c == '`') + backq = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if ((flags & 1) == 0 && c == '`') + { + backq = 1; + i++; + continue; + } + else if ((flags & 1) == 0 && c == open) + { + count++; + i++; + continue; + } + else if (c == close) + { + count--; + if (count == 0) + break; + i++; + continue; + } + else if ((flags & 1) == 0 && (c == '\'' || c == '"')) + { + i = (c == '\'') ? skip_single_quoted (ss, slen, ++i) + : skip_double_quoted (ss, slen, ++i); + /* no increment, the skip functions increment past the closing quote. */ + } + else if ((flags&1) == 0 && c == '$' && (string[i+1] == LPAREN || string[i+1] == LBRACE)) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + + if (string[i+1] == LPAREN) + temp = extract_delimited_string (ss, &si, "$(", "(", ")", SX_NOALLOC|SX_COMMAND); /* ) */ + else + temp = extract_dollar_brace_string (ss, &si, 0, SX_NOALLOC); + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } + else + ADVANCE_CHAR (string, slen, i); + } + + CQ_RETURN(i); +} + +#if defined (ARRAY_VARS) +int +skipsubscript (string, start, flags) + const char *string; + int start, flags; +{ + return (skip_matched_pair (string, start, '[', ']', flags)); +} +#endif + +/* Skip characters in STRING until we find a character in DELIMS, and return + the index of that character. START is the index into string at which we + begin. This is similar in spirit to strpbrk, but it returns an index into + STRING and takes a starting index. This little piece of code knows quite + a lot of shell syntax. It's very similar to skip_double_quoted and other + functions of that ilk. */ +int +skip_to_delim (string, start, delims, flags) + char *string; + int start; + char *delims; + int flags; +{ + int i, pass_next, backq, si, c, invert, skipquote, skipcmd; + size_t slen; + char *temp, open[3]; + DECLARE_MBSTATE; + + slen = strlen (string + start) + start; + if (flags & SD_NOJMP) + no_longjmp_on_fatal_error = 1; + invert = (flags & SD_INVERT); + skipcmd = (flags & SD_NOSKIPCMD) == 0; + + i = start; + pass_next = backq = 0; + while (c = string[i]) + { + /* If this is non-zero, we should not let quote characters be delimiters + and the current character is a single or double quote. We should not + test whether or not it's a delimiter until after we skip single- or + double-quoted strings. */ + skipquote = ((flags & SD_NOQUOTEDELIM) && (c == '\'' || c =='"')); + if (pass_next) + { + pass_next = 0; + if (c == 0) + CQ_RETURN(i); + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (backq) + { + if (c == '`') + backq = 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '`') + { + backq = 1; + i++; + continue; + } + else if (skipquote == 0 && invert == 0 && member (c, delims)) + break; + else if (c == '\'' || c == '"') + { + i = (c == '\'') ? skip_single_quoted (string, slen, ++i) + : skip_double_quoted (string, slen, ++i); + /* no increment, the skip functions increment past the closing quote. */ + } + else if (c == '$' && ((skipcmd && string[i+1] == LPAREN) || string[i+1] == LBRACE)) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + + if (string[i+1] == LPAREN) + temp = extract_delimited_string (string, &si, "$(", "(", ")", SX_NOALLOC|SX_COMMAND); /* ) */ + else + temp = extract_dollar_brace_string (string, &si, 0, SX_NOALLOC); + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } +#if defined (PROCESS_SUBSTITUTION) + else if (skipcmd && (c == '<' || c == '>') && string[i+1] == LPAREN) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + temp = extract_process_subst (string, (c == '<') ? "<(" : ">(", &si, 0); + free (temp); /* no SX_ALLOC here */ + i = si; + if (string[i] == '\0') + break; + i++; + continue; + } +#endif /* PROCESS_SUBSTITUTION */ +#if defined (EXTENDED_GLOB) + else if ((flags & SD_EXTGLOB) && extended_glob && string[i+1] == LPAREN && member (c, "?*+!@")) + { + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); + + open[0] = c; + open[1] = LPAREN; + open[2] = '\0'; + temp = extract_delimited_string (string, &si, open, "(", ")", SX_NOALLOC); /* ) */ + + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } +#endif + else if ((flags & SD_GLOB) && c == LBRACK) + { + si = i + 1; + if (string[si] == '\0') + CQ_RETURN(si); + + temp = extract_delimited_string (string, &si, "[", "[", "]", SX_NOALLOC); /* ] */ + + i = si; + if (string[i] == '\0') /* don't increment i past EOS in loop */ + break; + i++; + continue; + } + else if ((skipquote || invert) && (member (c, delims) == 0)) + break; + else + ADVANCE_CHAR (string, slen, i); + } + + CQ_RETURN(i); +} + +#if defined (READLINE) +/* Return 1 if the portion of STRING ending at EINDEX is quoted (there is + an unclosed quoted string), or if the character at EINDEX is quoted + by a backslash. NO_LONGJMP_ON_FATAL_ERROR is used to flag that the various + single and double-quoted string parsing functions should not return an + error if there are unclosed quotes or braces. The characters that this + recognizes need to be the same as the contents of + rl_completer_quote_characters. */ + +int +char_is_quoted (string, eindex) + char *string; + int eindex; +{ + int i, pass_next, c; + size_t slen; + DECLARE_MBSTATE; + + slen = strlen (string); + no_longjmp_on_fatal_error = 1; + i = pass_next = 0; + while (i <= eindex) + { + c = string[i]; + + if (pass_next) + { + pass_next = 0; + if (i >= eindex) /* XXX was if (i >= eindex - 1) */ + CQ_RETURN(1); + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (c == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (c == '\'' || c == '"') + { + i = (c == '\'') ? skip_single_quoted (string, slen, ++i) + : skip_double_quoted (string, slen, ++i); + if (i > eindex) + CQ_RETURN(1); + /* no increment, the skip_xxx functions go one past end */ + } + else + ADVANCE_CHAR (string, slen, i); + } + + CQ_RETURN(0); +} + +int +unclosed_pair (string, eindex, openstr) + char *string; + int eindex; + char *openstr; +{ + int i, pass_next, openc, olen; + size_t slen; + DECLARE_MBSTATE; + + slen = strlen (string); + olen = strlen (openstr); + i = pass_next = openc = 0; + while (i <= eindex) + { + if (pass_next) + { + pass_next = 0; + if (i >= eindex) /* XXX was if (i >= eindex - 1) */ + return 0; + ADVANCE_CHAR (string, slen, i); + continue; + } + else if (string[i] == '\\') + { + pass_next = 1; + i++; + continue; + } + else if (STREQN (string + i, openstr, olen)) + { + openc = 1 - openc; + i += olen; + } + else if (string[i] == '\'' || string[i] == '"') + { + i = (string[i] == '\'') ? skip_single_quoted (string, slen, i) + : skip_double_quoted (string, slen, i); + if (i > eindex) + return 0; + } + else + ADVANCE_CHAR (string, slen, i); + } + return (openc); +} + +/* Split STRING (length SLEN) at DELIMS, and return a WORD_LIST with the + individual words. If DELIMS is NULL, the current value of $IFS is used + to split the string, and the function follows the shell field splitting + rules. SENTINEL is an index to look for. NWP, if non-NULL, + gets the number of words in the returned list. CWP, if non-NULL, gets + the index of the word containing SENTINEL. Non-whitespace chars in + DELIMS delimit separate fields. */ +WORD_LIST * +split_at_delims (string, slen, delims, sentinel, flags, nwp, cwp) + char *string; + int slen; + char *delims; + int sentinel, flags; + int *nwp, *cwp; +{ + int ts, te, i, nw, cw, ifs_split, dflags; + char *token, *d, *d2; + WORD_LIST *ret, *tl; + + if (string == 0 || *string == '\0') + { + if (nwp) + *nwp = 0; + if (cwp) + *cwp = 0; + return ((WORD_LIST *)NULL); + } + + d = (delims == 0) ? ifs_value : delims; + ifs_split = delims == 0; + + /* Make d2 the non-whitespace characters in delims */ + d2 = 0; + if (delims) + { + size_t slength; +#if defined (HANDLE_MULTIBYTE) + size_t mblength = 1; +#endif + DECLARE_MBSTATE; + + slength = strlen (delims); + d2 = (char *)xmalloc (slength + 1); + i = ts = 0; + while (delims[i]) + { +#if defined (HANDLE_MULTIBYTE) + mbstate_t state_bak; + state_bak = state; + mblength = MBRLEN (delims + i, slength, &state); + if (MB_INVALIDCH (mblength)) + state = state_bak; + else if (mblength > 1) + { + memcpy (d2 + ts, delims + i, mblength); + ts += mblength; + i += mblength; + slength -= mblength; + continue; + } +#endif + if (whitespace (delims[i]) == 0) + d2[ts++] = delims[i]; + + i++; + slength--; + } + d2[ts] = '\0'; + } + + ret = (WORD_LIST *)NULL; + + /* Remove sequences of whitespace characters at the start of the string, as + long as those characters are delimiters. */ + for (i = 0; member (string[i], d) && spctabnl (string[i]); i++) + ; + if (string[i] == '\0') + return (ret); + + ts = i; + nw = 0; + cw = -1; + dflags = flags|SD_NOJMP; + while (1) + { + te = skip_to_delim (string, ts, d, dflags); + + /* If we have a non-whitespace delimiter character, use it to make a + separate field. This is just about what $IFS splitting does and + is closer to the behavior of the shell parser. */ + if (ts == te && d2 && member (string[ts], d2)) + { + te = ts + 1; + /* If we're using IFS splitting, the non-whitespace delimiter char + and any additional IFS whitespace delimits a field. */ + if (ifs_split) + while (member (string[te], d) && spctabnl (string[te])) + te++; + else + while (member (string[te], d2)) + te++; + } + + token = substring (string, ts, te); + + ret = add_string_to_list (token, ret); + free (token); + nw++; + + if (sentinel >= ts && sentinel <= te) + cw = nw; + + /* If the cursor is at whitespace just before word start, set the + sentinel word to the current word. */ + if (cwp && cw == -1 && sentinel == ts-1) + cw = nw; + + /* If the cursor is at whitespace between two words, make a new, empty + word, add it before (well, after, since the list is in reverse order) + the word we just added, and set the current word to that one. */ + if (cwp && cw == -1 && sentinel < ts) + { + tl = make_word_list (make_word (""), ret->next); + ret->next = tl; + cw = nw; + nw++; + } + + if (string[te] == 0) + break; + + i = te; + while (member (string[i], d) && (ifs_split || spctabnl(string[i]))) + i++; + + if (string[i]) + ts = i; + else + break; + } + + /* Special case for SENTINEL at the end of STRING. If we haven't found + the word containing SENTINEL yet, and the index we're looking for is at + the end of STRING (or past the end of the previously-found token, + possible if the end of the line is composed solely of IFS whitespace) + add an additional null argument and set the current word pointer to that. */ + if (cwp && cw == -1 && (sentinel >= slen || sentinel >= te)) + { + if (whitespace (string[sentinel - 1])) + { + token = ""; + ret = add_string_to_list (token, ret); + nw++; + } + cw = nw; + } + + if (nwp) + *nwp = nw; + if (cwp) + *cwp = cw; + + FREE (d2); + + return (REVERSE_LIST (ret, WORD_LIST *)); +} +#endif /* READLINE */ + +#if 0 +/* UNUSED */ +/* Extract the name of the variable to bind to from the assignment string. */ +char * +assignment_name (string) + char *string; +{ + int offset; + char *temp; + + offset = assignment (string, 0); + if (offset == 0) + return (char *)NULL; + temp = substring (string, 0, offset); + return (temp); +} +#endif + +/* **************************************************************** */ +/* */ +/* Functions to convert strings to WORD_LISTs and vice versa */ +/* */ +/* **************************************************************** */ + +/* Return a single string of all the words in LIST. SEP is the separator + to put between individual elements of LIST in the output string. */ +char * +string_list_internal (list, sep) + WORD_LIST *list; + char *sep; +{ + register WORD_LIST *t; + char *result, *r; + int word_len, sep_len, result_size; + + if (list == 0) + return ((char *)NULL); + + /* Short-circuit quickly if we don't need to separate anything. */ + if (list->next == 0) + return (savestring (list->word->word)); + + /* This is nearly always called with either sep[0] == 0 or sep[1] == 0. */ + sep_len = STRLEN (sep); + result_size = 0; + + for (t = list; t; t = t->next) + { + if (t != list) + result_size += sep_len; + result_size += strlen (t->word->word); + } + + r = result = (char *)xmalloc (result_size + 1); + + for (t = list; t; t = t->next) + { + if (t != list && sep_len) + { + if (sep_len > 1) + { + FASTCOPY (sep, r, sep_len); + r += sep_len; + } + else + *r++ = sep[0]; + } + + word_len = strlen (t->word->word); + FASTCOPY (t->word->word, r, word_len); + r += word_len; + } + + *r = '\0'; + return (result); +} + +/* Return a single string of all the words present in LIST, separating + each word with a space. */ +char * +string_list (list) + WORD_LIST *list; +{ + return (string_list_internal (list, " ")); +} + +/* An external interface that can be used by the rest of the shell to + obtain a string containing the first character in $IFS. Handles all + the multibyte complications. If LENP is non-null, it is set to the + length of the returned string. */ +char * +ifs_firstchar (lenp) + int *lenp; +{ + char *ret; + int len; + + ret = xmalloc (MB_LEN_MAX + 1); +#if defined (HANDLE_MULTIBYTE) + if (ifs_firstc_len == 1) + { + ret[0] = ifs_firstc[0]; + ret[1] = '\0'; + len = ret[0] ? 1 : 0; + } + else + { + memcpy (ret, ifs_firstc, ifs_firstc_len); + ret[len = ifs_firstc_len] = '\0'; + } +#else + ret[0] = ifs_firstc; + ret[1] = '\0'; + len = ret[0] ? 0 : 1; +#endif + + if (lenp) + *lenp = len; + + return ret; +} + +/* Return a single string of all the words present in LIST, obeying the + quoting rules for "$*", to wit: (P1003.2, draft 11, 3.5.2) "If the + expansion [of $*] appears within a double quoted string, it expands + to a single field with the value of each parameter separated by the + first character of the IFS variable, or by a if IFS is unset." */ +char * +string_list_dollar_star (list) + WORD_LIST *list; +{ + char *ret; +#if defined (HANDLE_MULTIBYTE) +# if defined (__GNUC__) + char sep[MB_CUR_MAX + 1]; +# else + char *sep = 0; +# endif +#else + char sep[2]; +#endif + +#if defined (HANDLE_MULTIBYTE) +# if !defined (__GNUC__) + sep = (char *)xmalloc (MB_CUR_MAX + 1); +# endif /* !__GNUC__ */ + if (ifs_firstc_len == 1) + { + sep[0] = ifs_firstc[0]; + sep[1] = '\0'; + } + else + { + memcpy (sep, ifs_firstc, ifs_firstc_len); + sep[ifs_firstc_len] = '\0'; + } +#else + sep[0] = ifs_firstc; + sep[1] = '\0'; +#endif + + ret = string_list_internal (list, sep); +#if defined (HANDLE_MULTIBYTE) && !defined (__GNUC__) + free (sep); +#endif + return ret; +} + +/* Turn $@ into a string. If (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + is non-zero, the $@ appears within double quotes, and we should quote + the list before converting it into a string. If IFS is unset, and the + word is not quoted, we just need to quote CTLESC and CTLNUL characters + in the words in the list, because the default value of $IFS is + , IFS characters in the words in the list should + also be split. If IFS is null, and the word is not quoted, we need + to quote the words in the list to preserve the positional parameters + exactly. */ +char * +string_list_dollar_at (list, quoted) + WORD_LIST *list; + int quoted; +{ + char *ifs, *ret; +#if defined (HANDLE_MULTIBYTE) +# if defined (__GNUC__) + char sep[MB_CUR_MAX + 1]; +# else + char *sep = 0; +# endif /* !__GNUC__ */ +#else + char sep[2]; +#endif + WORD_LIST *tlist; + + /* XXX this could just be ifs = ifs_value; */ + ifs = ifs_var ? value_cell (ifs_var) : (char *)0; + +#if defined (HANDLE_MULTIBYTE) +# if !defined (__GNUC__) + sep = (char *)xmalloc (MB_CUR_MAX + 1); +# endif /* !__GNUC__ */ + if (ifs && *ifs) + { + if (ifs_firstc_len == 1) + { + sep[0] = ifs_firstc[0]; + sep[1] = '\0'; + } + else + { + memcpy (sep, ifs_firstc, ifs_firstc_len); + sep[ifs_firstc_len] = '\0'; + } + } + else + { + sep[0] = ' '; + sep[1] = '\0'; + } +#else + sep[0] = (ifs == 0 || *ifs == 0) ? ' ' : *ifs; + sep[1] = '\0'; +#endif + + /* XXX -- why call quote_list if ifs == 0? we can get away without doing + it now that quote_escapes quotes spaces */ + tlist = (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES|Q_PATQUOTE)) + ? quote_list (list) + : list_quote_escapes (list); + + ret = string_list_internal (tlist, sep); +#if defined (HANDLE_MULTIBYTE) && !defined (__GNUC__) + free (sep); +#endif + return ret; +} + +/* Turn the positional parameters into a string, understanding quoting and + the various subtleties of using the first character of $IFS as the + separator. Calls string_list_dollar_at, string_list_dollar_star, and + string_list as appropriate. */ +char * +string_list_pos_params (pchar, list, quoted) + int pchar; + WORD_LIST *list; + int quoted; +{ + char *ret; + WORD_LIST *tlist; + + if (pchar == '*' && (quoted & Q_DOUBLE_QUOTES)) + { + tlist = quote_list (list); + word_list_remove_quoted_nulls (tlist); + ret = string_list_dollar_star (tlist); + } + else if (pchar == '*' && (quoted & Q_HERE_DOCUMENT)) + { + tlist = quote_list (list); + word_list_remove_quoted_nulls (tlist); + ret = string_list (tlist); + } + else if (pchar == '*') + { + /* Even when unquoted, string_list_dollar_star does the right thing + making sure that the first character of $IFS is used as the + separator. */ + ret = string_list_dollar_star (list); + } + else if (pchar == '@' && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + /* We use string_list_dollar_at, but only if the string is quoted, since + that quotes the escapes if it's not, which we don't want. We could + use string_list (the old code did), but that doesn't do the right + thing if the first character of $IFS is not a space. We use + string_list_dollar_star if the string is unquoted so we make sure that + the elements of $@ are separated by the first character of $IFS for + later splitting. */ + ret = string_list_dollar_at (list, quoted); + else if (pchar == '@') + ret = string_list_dollar_star (list); + else + ret = string_list ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) ? quote_list (list) : list); + + return ret; +} + +/* Return the list of words present in STRING. Separate the string into + words at any of the characters found in SEPARATORS. If QUOTED is + non-zero then word in the list will have its quoted flag set, otherwise + the quoted flag is left as make_word () deemed fit. + + This obeys the P1003.2 word splitting semantics. If `separators' is + exactly , then the splitting algorithm is that of + the Bourne shell, which treats any sequence of characters from `separators' + as a delimiter. If IFS is unset, which results in `separators' being set + to "", no splitting occurs. If separators has some other value, the + following rules are applied (`IFS white space' means zero or more + occurrences of , , or , as long as those characters + are in `separators'): + + 1) IFS white space is ignored at the start and the end of the + string. + 2) Each occurrence of a character in `separators' that is not + IFS white space, along with any adjacent occurrences of + IFS white space delimits a field. + 3) Any nonzero-length sequence of IFS white space delimits a field. + */ + +/* BEWARE! list_string strips null arguments. Don't call it twice and + expect to have "" preserved! */ + +/* This performs word splitting and quoted null character removal on + STRING. */ +#define issep(c) \ + (((separators)[0]) ? ((separators)[1] ? isifs(c) \ + : (c) == (separators)[0]) \ + : 0) + +WORD_LIST * +list_string (string, separators, quoted) + register char *string, *separators; + int quoted; +{ + WORD_LIST *result; + WORD_DESC *t; + char *current_word, *s; + int sindex, sh_style_split, whitesep, xflags; + size_t slen; + + if (!string || !*string) + return ((WORD_LIST *)NULL); + + sh_style_split = separators && separators[0] == ' ' && + separators[1] == '\t' && + separators[2] == '\n' && + separators[3] == '\0'; + for (xflags = 0, s = ifs_value; s && *s; s++) + { + if (*s == CTLESC) xflags |= SX_NOCTLESC; + else if (*s == CTLNUL) xflags |= SX_NOESCCTLNUL; + } + + slen = 0; + /* Remove sequences of whitespace at the beginning of STRING, as + long as those characters appear in IFS. Do not do this if + STRING is quoted or if there are no separator characters. */ + if (!quoted || !separators || !*separators) + { + for (s = string; *s && spctabnl (*s) && issep (*s); s++); + + if (!*s) + return ((WORD_LIST *)NULL); + + string = s; + } + + /* OK, now STRING points to a word that does not begin with white space. + The splitting algorithm is: + extract a word, stopping at a separator + skip sequences of spc, tab, or nl as long as they are separators + This obeys the field splitting rules in Posix.2. */ + slen = (MB_CUR_MAX > 1) ? strlen (string) : 1; + for (result = (WORD_LIST *)NULL, sindex = 0; string[sindex]; ) + { + /* Don't need string length in ADVANCE_CHAR or string_extract_verbatim + unless multibyte chars are possible. */ + current_word = string_extract_verbatim (string, slen, &sindex, separators, xflags); + if (current_word == 0) + break; + + /* If we have a quoted empty string, add a quoted null argument. We + want to preserve the quoted null character iff this is a quoted + empty string; otherwise the quoted null characters are removed + below. */ + if (QUOTED_NULL (current_word)) + { + t = alloc_word_desc (); + t->word = make_quoted_char ('\0'); + t->flags |= W_QUOTED|W_HASQUOTEDNULL; + result = make_word_list (t, result); + } + else if (current_word[0] != '\0') + { + /* If we have something, then add it regardless. However, + perform quoted null character removal on the current word. */ + remove_quoted_nulls (current_word); + result = add_string_to_list (current_word, result); + result->word->flags &= ~W_HASQUOTEDNULL; /* just to be sure */ + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + result->word->flags |= W_QUOTED; + } + + /* If we're not doing sequences of separators in the traditional + Bourne shell style, then add a quoted null argument. */ + else if (!sh_style_split && !spctabnl (string[sindex])) + { + t = alloc_word_desc (); + t->word = make_quoted_char ('\0'); + t->flags |= W_QUOTED|W_HASQUOTEDNULL; + result = make_word_list (t, result); + } + + free (current_word); + + /* Note whether or not the separator is IFS whitespace, used later. */ + whitesep = string[sindex] && spctabnl (string[sindex]); + + /* Move past the current separator character. */ + if (string[sindex]) + { + DECLARE_MBSTATE; + ADVANCE_CHAR (string, slen, sindex); + } + + /* Now skip sequences of space, tab, or newline characters if they are + in the list of separators. */ + while (string[sindex] && spctabnl (string[sindex]) && issep (string[sindex])) + sindex++; + + /* If the first separator was IFS whitespace and the current character + is a non-whitespace IFS character, it should be part of the current + field delimiter, not a separate delimiter that would result in an + empty field. Look at POSIX.2, 3.6.5, (3)(b). */ + if (string[sindex] && whitesep && issep (string[sindex]) && !spctabnl (string[sindex])) + { + sindex++; + /* An IFS character that is not IFS white space, along with any + adjacent IFS white space, shall delimit a field. (SUSv3) */ + while (string[sindex] && spctabnl (string[sindex]) && isifs (string[sindex])) + sindex++; + } + } + return (REVERSE_LIST (result, WORD_LIST *)); +} + +/* Parse a single word from STRING, using SEPARATORS to separate fields. + ENDPTR is set to the first character after the word. This is used by + the `read' builtin. This is never called with SEPARATORS != $IFS; + it should be simplified. + + XXX - this function is very similar to list_string; they should be + combined - XXX */ +char * +get_word_from_string (stringp, separators, endptr) + char **stringp, *separators, **endptr; +{ + register char *s; + char *current_word; + int sindex, sh_style_split, whitesep, xflags; + size_t slen; + + if (!stringp || !*stringp || !**stringp) + return ((char *)NULL); + + sh_style_split = separators && separators[0] == ' ' && + separators[1] == '\t' && + separators[2] == '\n' && + separators[3] == '\0'; + for (xflags = 0, s = ifs_value; s && *s; s++) + { + if (*s == CTLESC) xflags |= SX_NOCTLESC; + if (*s == CTLNUL) xflags |= SX_NOESCCTLNUL; + } + + s = *stringp; + slen = 0; + + /* Remove sequences of whitespace at the beginning of STRING, as + long as those characters appear in IFS. */ + if (sh_style_split || !separators || !*separators) + { + for (; *s && spctabnl (*s) && isifs (*s); s++); + + /* If the string is nothing but whitespace, update it and return. */ + if (!*s) + { + *stringp = s; + if (endptr) + *endptr = s; + return ((char *)NULL); + } + } + + /* OK, S points to a word that does not begin with white space. + Now extract a word, stopping at a separator, save a pointer to + the first character after the word, then skip sequences of spc, + tab, or nl as long as they are separators. + + This obeys the field splitting rules in Posix.2. */ + sindex = 0; + /* Don't need string length in ADVANCE_CHAR or string_extract_verbatim + unless multibyte chars are possible. */ + slen = (MB_CUR_MAX > 1) ? strlen (s) : 1; + current_word = string_extract_verbatim (s, slen, &sindex, separators, xflags); + + /* Set ENDPTR to the first character after the end of the word. */ + if (endptr) + *endptr = s + sindex; + + /* Note whether or not the separator is IFS whitespace, used later. */ + whitesep = s[sindex] && spctabnl (s[sindex]); + + /* Move past the current separator character. */ + if (s[sindex]) + { + DECLARE_MBSTATE; + ADVANCE_CHAR (s, slen, sindex); + } + + /* Now skip sequences of space, tab, or newline characters if they are + in the list of separators. */ + while (s[sindex] && spctabnl (s[sindex]) && isifs (s[sindex])) + sindex++; + + /* If the first separator was IFS whitespace and the current character is + a non-whitespace IFS character, it should be part of the current field + delimiter, not a separate delimiter that would result in an empty field. + Look at POSIX.2, 3.6.5, (3)(b). */ + if (s[sindex] && whitesep && isifs (s[sindex]) && !spctabnl (s[sindex])) + { + sindex++; + /* An IFS character that is not IFS white space, along with any adjacent + IFS white space, shall delimit a field. */ + while (s[sindex] && spctabnl (s[sindex]) && isifs (s[sindex])) + sindex++; + } + + /* Update STRING to point to the next field. */ + *stringp = s + sindex; + return (current_word); +} + +/* Remove IFS white space at the end of STRING. Start at the end + of the string and walk backwards until the beginning of the string + or we find a character that's not IFS white space and not CTLESC. + Only let CTLESC escape a white space character if SAW_ESCAPE is + non-zero. */ +char * +strip_trailing_ifs_whitespace (string, separators, saw_escape) + char *string, *separators; + int saw_escape; +{ + char *s; + + s = string + STRLEN (string) - 1; + while (s > string && ((spctabnl (*s) && isifs (*s)) || + (saw_escape && *s == CTLESC && spctabnl (s[1])))) + s--; + *++s = '\0'; + return string; +} + +#if 0 +/* UNUSED */ +/* Split STRING into words at whitespace. Obeys shell-style quoting with + backslashes, single and double quotes. */ +WORD_LIST * +list_string_with_quotes (string) + char *string; +{ + WORD_LIST *list; + char *token, *s; + size_t s_len; + int c, i, tokstart, len; + + for (s = string; s && *s && spctabnl (*s); s++) + ; + if (s == 0 || *s == 0) + return ((WORD_LIST *)NULL); + + s_len = strlen (s); + tokstart = i = 0; + list = (WORD_LIST *)NULL; + while (1) + { + c = s[i]; + if (c == '\\') + { + i++; + if (s[i]) + i++; + } + else if (c == '\'') + i = skip_single_quoted (s, s_len, ++i); + else if (c == '"') + i = skip_double_quoted (s, s_len, ++i); + else if (c == 0 || spctabnl (c)) + { + /* We have found the end of a token. Make a word out of it and + add it to the word list. */ + token = substring (s, tokstart, i); + list = add_string_to_list (token, list); + free (token); + while (spctabnl (s[i])) + i++; + if (s[i]) + tokstart = i; + else + break; + } + else + i++; /* normal character */ + } + return (REVERSE_LIST (list, WORD_LIST *)); +} +#endif + +/********************************************************/ +/* */ +/* Functions to perform assignment statements */ +/* */ +/********************************************************/ + +#if defined (ARRAY_VARS) +static SHELL_VAR * +do_compound_assignment (name, value, flags) + char *name, *value; + int flags; +{ + SHELL_VAR *v; + int mklocal, mkassoc, mkglobal; + WORD_LIST *list; + + mklocal = flags & ASS_MKLOCAL; + mkassoc = flags & ASS_MKASSOC; + mkglobal = flags & ASS_MKGLOBAL; + + if (mklocal && variable_context) + { + v = find_variable (name); + list = expand_compound_array_assignment (v, value, flags); + if (mkassoc) + v = make_local_assoc_variable (name); + else if (v == 0 || (array_p (v) == 0 && assoc_p (v) == 0) || v->context != variable_context) + v = make_local_array_variable (name, 0); + if (v) + assign_compound_array_list (v, list, flags); + } + /* In a function but forcing assignment in global context */ + else if (mkglobal && variable_context) + { + v = find_global_variable (name); + list = expand_compound_array_assignment (v, value, flags); + if (v == 0 && mkassoc) + v = make_new_assoc_variable (name); + else if (v && mkassoc && assoc_p (v) == 0) + v = convert_var_to_assoc (v); + else if (v == 0) + v = make_new_array_variable (name); + else if (v && mkassoc == 0 && array_p (v) == 0) + v = convert_var_to_array (v); + if (v) + assign_compound_array_list (v, list, flags); + } + else + v = assign_array_from_string (name, value, flags); + + return (v); +} +#endif + +/* Given STRING, an assignment string, get the value of the right side + of the `=', and bind it to the left side. If EXPAND is true, then + perform parameter expansion, command substitution, and arithmetic + expansion on the right-hand side. Perform tilde expansion in any + case. Do not perform word splitting on the result of expansion. */ +static int +do_assignment_internal (word, expand) + const WORD_DESC *word; + int expand; +{ + int offset, appendop, assign_list, aflags, retval; + char *name, *value, *temp; + SHELL_VAR *entry; +#if defined (ARRAY_VARS) + char *t; + int ni; +#endif + const char *string; + + if (word == 0 || word->word == 0) + return 0; + + appendop = assign_list = aflags = 0; + string = word->word; + offset = assignment (string, 0); + name = savestring (string); + value = (char *)NULL; + + if (name[offset] == '=') + { + if (name[offset - 1] == '+') + { + appendop = 1; + name[offset - 1] = '\0'; + } + + name[offset] = 0; /* might need this set later */ + temp = name + offset + 1; + +#if defined (ARRAY_VARS) + if (expand && (word->flags & W_COMPASSIGN)) + { + assign_list = ni = 1; + value = extract_array_assignment_list (temp, &ni); + } + else +#endif + if (expand && temp[0]) + value = expand_string_if_necessary (temp, 0, expand_string_assignment); + else + value = savestring (temp); + } + + if (value == 0) + { + value = (char *)xmalloc (1); + value[0] = '\0'; + } + + if (echo_command_at_execute) + { + if (appendop) + name[offset - 1] = '+'; + xtrace_print_assignment (name, value, assign_list, 1); + if (appendop) + name[offset - 1] = '\0'; + } + +#define ASSIGN_RETURN(r) do { FREE (value); free (name); return (r); } while (0) + + if (appendop) + aflags |= ASS_APPEND; + +#if defined (ARRAY_VARS) + if (t = mbschr (name, '[')) /*]*/ + { + if (assign_list) + { + report_error (_("%s: cannot assign list to array member"), name); + ASSIGN_RETURN (0); + } + entry = assign_array_element (name, value, aflags); + if (entry == 0) + ASSIGN_RETURN (0); + } + else if (assign_list) + { + if ((word->flags & W_ASSIGNARG) && (word->flags & W_ASSNGLOBAL) == 0) + aflags |= ASS_MKLOCAL; + if ((word->flags & W_ASSIGNARG) && (word->flags & W_ASSNGLOBAL)) + aflags |= ASS_MKGLOBAL; + if (word->flags & W_ASSIGNASSOC) + aflags |= ASS_MKASSOC; + entry = do_compound_assignment (name, value, aflags); + } + else +#endif /* ARRAY_VARS */ + entry = bind_variable (name, value, aflags); + + stupidly_hack_special_variables (name); + + /* Return 1 if the assignment seems to have been performed correctly. */ + if (entry == 0 || readonly_p (entry)) + retval = 0; /* assignment failure */ + else if (noassign_p (entry)) + { + last_command_exit_value = EXECUTION_FAILURE; + retval = 1; /* error status, but not assignment failure */ + } + else + retval = 1; + + if (entry && retval != 0 && noassign_p (entry) == 0) + VUNSETATTR (entry, att_invisible); + + ASSIGN_RETURN (retval); +} + +/* Perform the assignment statement in STRING, and expand the + right side by doing tilde, command and parameter expansion. */ +int +do_assignment (string) + char *string; +{ + WORD_DESC td; + + td.flags = W_ASSIGNMENT; + td.word = string; + + return do_assignment_internal (&td, 1); +} + +int +do_word_assignment (word, flags) + WORD_DESC *word; + int flags; +{ + return do_assignment_internal (word, 1); +} + +/* Given STRING, an assignment string, get the value of the right side + of the `=', and bind it to the left side. Do not perform any word + expansions on the right hand side. */ +int +do_assignment_no_expand (string) + char *string; +{ + WORD_DESC td; + + td.flags = W_ASSIGNMENT; + td.word = string; + + return (do_assignment_internal (&td, 0)); +} + +/*************************************************** + * * + * Functions to manage the positional parameters * + * * + ***************************************************/ + +/* Return the word list that corresponds to `$*'. */ +WORD_LIST * +list_rest_of_args () +{ + register WORD_LIST *list, *args; + int i; + + /* Break out of the loop as soon as one of the dollar variables is null. */ + for (i = 1, list = (WORD_LIST *)NULL; i < 10 && dollar_vars[i]; i++) + list = make_word_list (make_bare_word (dollar_vars[i]), list); + + for (args = rest_of_args; args; args = args->next) + list = make_word_list (make_bare_word (args->word->word), list); + + return (REVERSE_LIST (list, WORD_LIST *)); +} + +int +number_of_args () +{ + register WORD_LIST *list; + int n; + + for (n = 0; n < 9 && dollar_vars[n+1]; n++) + ; + for (list = rest_of_args; list; list = list->next) + n++; + return n; +} + +/* Return the value of a positional parameter. This handles values > 10. */ +char * +get_dollar_var_value (ind) + intmax_t ind; +{ + char *temp; + WORD_LIST *p; + + if (ind < 10) + temp = dollar_vars[ind] ? savestring (dollar_vars[ind]) : (char *)NULL; + else /* We want something like ${11} */ + { + ind -= 10; + for (p = rest_of_args; p && ind--; p = p->next) + ; + temp = p ? savestring (p->word->word) : (char *)NULL; + } + return (temp); +} + +/* Make a single large string out of the dollar digit variables, + and the rest_of_args. If DOLLAR_STAR is 1, then obey the special + case of "$*" with respect to IFS. */ +char * +string_rest_of_args (dollar_star) + int dollar_star; +{ + register WORD_LIST *list; + char *string; + + list = list_rest_of_args (); + string = dollar_star ? string_list_dollar_star (list) : string_list (list); + dispose_words (list); + return (string); +} + +/* Return a string containing the positional parameters from START to + END, inclusive. If STRING[0] == '*', we obey the rules for $*, + which only makes a difference if QUOTED is non-zero. If QUOTED includes + Q_HERE_DOCUMENT or Q_DOUBLE_QUOTES, this returns a quoted list, otherwise + no quoting chars are added. */ +static char * +pos_params (string, start, end, quoted) + char *string; + int start, end, quoted; +{ + WORD_LIST *save, *params, *h, *t; + char *ret; + int i; + + /* see if we can short-circuit. if start == end, we want 0 parameters. */ + if (start == end) + return ((char *)NULL); + + save = params = list_rest_of_args (); + if (save == 0) + return ((char *)NULL); + + if (start == 0) /* handle ${@:0[:x]} specially */ + { + t = make_word_list (make_word (dollar_vars[0]), params); + save = params = t; + } + + for (i = start ? 1 : 0; params && i < start; i++) + params = params->next; + if (params == 0) + return ((char *)NULL); + for (h = t = params; params && i < end; i++) + { + t = params; + params = params->next; + } + + t->next = (WORD_LIST *)NULL; + + ret = string_list_pos_params (string[0], h, quoted); + + if (t != params) + t->next = params; + + dispose_words (save); + return (ret); +} + +/******************************************************************/ +/* */ +/* Functions to expand strings to strings or WORD_LISTs */ +/* */ +/******************************************************************/ + +#if defined (PROCESS_SUBSTITUTION) +#define EXP_CHAR(s) (s == '$' || s == '`' || s == '<' || s == '>' || s == CTLESC || s == '~') +#else +#define EXP_CHAR(s) (s == '$' || s == '`' || s == CTLESC || s == '~') +#endif + +/* If there are any characters in STRING that require full expansion, + then call FUNC to expand STRING; otherwise just perform quote + removal if necessary. This returns a new string. */ +static char * +expand_string_if_necessary (string, quoted, func) + char *string; + int quoted; + EXPFUNC *func; +{ + WORD_LIST *list; + size_t slen; + int i, saw_quote; + char *ret; + DECLARE_MBSTATE; + + /* Don't need string length for ADVANCE_CHAR unless multibyte chars possible. */ + slen = (MB_CUR_MAX > 1) ? strlen (string) : 0; + i = saw_quote = 0; + while (string[i]) + { + if (EXP_CHAR (string[i])) + break; + else if (string[i] == '\'' || string[i] == '\\' || string[i] == '"') + saw_quote = 1; + ADVANCE_CHAR (string, slen, i); + } + + if (string[i]) + { + list = (*func) (string, quoted); + if (list) + { + ret = string_list (list); + dispose_words (list); + } + else + ret = (char *)NULL; + } + else if (saw_quote && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + ret = string_quote_removal (string, quoted); + else + ret = savestring (string); + + return ret; +} + +static inline char * +expand_string_to_string_internal (string, quoted, func) + char *string; + int quoted; + EXPFUNC *func; +{ + WORD_LIST *list; + char *ret; + + if (string == 0 || *string == '\0') + return ((char *)NULL); + + list = (*func) (string, quoted); + if (list) + { + ret = string_list (list); + dispose_words (list); + } + else + ret = (char *)NULL; + + return (ret); +} + +char * +expand_string_to_string (string, quoted) + char *string; + int quoted; +{ + return (expand_string_to_string_internal (string, quoted, expand_string)); +} + +char * +expand_string_unsplit_to_string (string, quoted) + char *string; + int quoted; +{ + return (expand_string_to_string_internal (string, quoted, expand_string_unsplit)); +} + +char * +expand_assignment_string_to_string (string, quoted) + char *string; + int quoted; +{ + return (expand_string_to_string_internal (string, quoted, expand_string_assignment)); +} + +char * +expand_arith_string (string, quoted) + char *string; + int quoted; +{ + WORD_DESC td; + WORD_LIST *list, *tlist; + size_t slen; + int i, saw_quote; + char *ret; + DECLARE_MBSTATE; + + /* Don't need string length for ADVANCE_CHAR unless multibyte chars possible. */ + slen = (MB_CUR_MAX > 1) ? strlen (string) : 0; + i = saw_quote = 0; + while (string[i]) + { + if (EXP_CHAR (string[i])) + break; + else if (string[i] == '\'' || string[i] == '\\' || string[i] == '"') + saw_quote = 1; + ADVANCE_CHAR (string, slen, i); + } + + if (string[i]) + { + /* This is expanded version of expand_string_internal as it's called by + expand_string_leave_quoted */ + td.flags = W_NOPROCSUB; /* don't want process substitution */ + td.word = savestring (string); + list = call_expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + /* This takes care of the calls from expand_string_leave_quoted and + expand_string */ + if (list) + { + tlist = word_list_split (list); + dispose_words (list); + list = tlist; + if (list) + dequote_list (list); + } + /* This comes from expand_string_if_necessary */ + if (list) + { + ret = string_list (list); + dispose_words (list); + } + else + ret = (char *)NULL; + FREE (td.word); + } + else if (saw_quote && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + ret = string_quote_removal (string, quoted); + else + ret = savestring (string); + + return ret; +} + +#if defined (COND_COMMAND) +/* Just remove backslashes in STRING. Returns a new string. */ +char * +remove_backslashes (string) + char *string; +{ + char *r, *ret, *s; + + r = ret = (char *)xmalloc (strlen (string) + 1); + for (s = string; s && *s; ) + { + if (*s == '\\') + s++; + if (*s == 0) + break; + *r++ = *s++; + } + *r = '\0'; + return ret; +} + +/* This needs better error handling. */ +/* Expand W for use as an argument to a unary or binary operator in a + [[...]] expression. If SPECIAL is 1, this is the rhs argument + to the != or == operator, and should be treated as a pattern. In + this case, we quote the string specially for the globbing code. If + SPECIAL is 2, this is an rhs argument for the =~ operator, and should + be quoted appropriately for regcomp/regexec. The caller is responsible + for removing the backslashes if the unquoted word is needed later. */ +char * +cond_expand_word (w, special) + WORD_DESC *w; + int special; +{ + char *r, *p; + WORD_LIST *l; + int qflags; + + if (w->word == 0 || w->word[0] == '\0') + return ((char *)NULL); + + expand_no_split_dollar_star = 1; + w->flags |= W_NOSPLIT2; + l = call_expand_word_internal (w, 0, 0, (int *)0, (int *)0); + expand_no_split_dollar_star = 0; + if (l) + { + if (special == 0) /* LHS */ + { + dequote_list (l); + r = string_list (l); + } + else + { + /* Need to figure out whether or not we should call dequote_escapes + or a new dequote_ctlnul function here, and under what + circumstances. */ + qflags = QGLOB_CVTNULL; + if (special == 2) + qflags |= QGLOB_REGEXP; + p = string_list (l); + r = quote_string_for_globbing (p, qflags); + free (p); + } + dispose_words (l); + } + else + r = (char *)NULL; + + return r; +} +#endif + +/* Call expand_word_internal to expand W and handle error returns. + A convenience function for functions that don't want to handle + any errors or free any memory before aborting. */ +static WORD_LIST * +call_expand_word_internal (w, q, i, c, e) + WORD_DESC *w; + int q, i, *c, *e; +{ + WORD_LIST *result; + + result = expand_word_internal (w, q, i, c, e); + if (result == &expand_word_error || result == &expand_word_fatal) + { + /* By convention, each time this error is returned, w->word has + already been freed (it sometimes may not be in the fatal case, + but that doesn't result in a memory leak because we're going + to exit in most cases). */ + w->word = (char *)NULL; + last_command_exit_value = EXECUTION_FAILURE; + exp_jump_to_top_level ((result == &expand_word_error) ? DISCARD : FORCE_EOF); + /* NOTREACHED */ + return (NULL); + } + else + return (result); +} + +/* Perform parameter expansion, command substitution, and arithmetic + expansion on STRING, as if it were a word. Leave the result quoted. + Since this does not perform word splitting, it leaves quoted nulls + in the result. */ +static WORD_LIST * +expand_string_internal (string, quoted) + char *string; + int quoted; +{ + WORD_DESC td; + WORD_LIST *tresult; + + if (string == 0 || *string == 0) + return ((WORD_LIST *)NULL); + + td.flags = 0; + td.word = savestring (string); + + tresult = call_expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + + FREE (td.word); + return (tresult); +} + +/* Expand STRING by performing parameter expansion, command substitution, + and arithmetic expansion. Dequote the resulting WORD_LIST before + returning it, but do not perform word splitting. The call to + remove_quoted_nulls () is in here because word splitting normally + takes care of quote removal. */ +WORD_LIST * +expand_string_unsplit (string, quoted) + char *string; + int quoted; +{ + WORD_LIST *value; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + expand_no_split_dollar_star = 1; + value = expand_string_internal (string, quoted); + expand_no_split_dollar_star = 0; + + if (value) + { + if (value->word) + { + remove_quoted_nulls (value->word->word); + value->word->flags &= ~W_HASQUOTEDNULL; + } + dequote_list (value); + } + return (value); +} + +/* Expand the rhs of an assignment statement */ +WORD_LIST * +expand_string_assignment (string, quoted) + char *string; + int quoted; +{ + WORD_DESC td; + WORD_LIST *value; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + expand_no_split_dollar_star = 1; + + td.flags = W_ASSIGNRHS; + td.word = savestring (string); + value = call_expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + FREE (td.word); + + expand_no_split_dollar_star = 0; + + if (value) + { + if (value->word) + { + remove_quoted_nulls (value->word->word); + value->word->flags &= ~W_HASQUOTEDNULL; + } + dequote_list (value); + } + return (value); +} + + +/* Expand one of the PS? prompt strings. This is a sort of combination of + expand_string_unsplit and expand_string_internal, but returns the + passed string when an error occurs. Might want to trap other calls + to jump_to_top_level here so we don't endlessly loop. */ +WORD_LIST * +expand_prompt_string (string, quoted, wflags) + char *string; + int quoted; + int wflags; +{ + WORD_LIST *value; + WORD_DESC td; + + if (string == 0 || *string == 0) + return ((WORD_LIST *)NULL); + + td.flags = wflags; + td.word = savestring (string); + + no_longjmp_on_fatal_error = 1; + value = expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL); + no_longjmp_on_fatal_error = 0; + + if (value == &expand_word_error || value == &expand_word_fatal) + { + value = make_word_list (make_bare_word (string), (WORD_LIST *)NULL); + return value; + } + FREE (td.word); + if (value) + { + if (value->word) + { + remove_quoted_nulls (value->word->word); + value->word->flags &= ~W_HASQUOTEDNULL; + } + dequote_list (value); + } + return (value); +} + +/* Expand STRING just as if you were expanding a word, but do not dequote + the resultant WORD_LIST. This is called only from within this file, + and is used to correctly preserve quoted characters when expanding + things like ${1+"$@"}. This does parameter expansion, command + substitution, arithmetic expansion, and word splitting. */ +static WORD_LIST * +expand_string_leave_quoted (string, quoted) + char *string; + int quoted; +{ + WORD_LIST *tlist; + WORD_LIST *tresult; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + tlist = expand_string_internal (string, quoted); + + if (tlist) + { + tresult = word_list_split (tlist); + dispose_words (tlist); + return (tresult); + } + return ((WORD_LIST *)NULL); +} + +/* This does not perform word splitting or dequote the WORD_LIST + it returns. */ +static WORD_LIST * +expand_string_for_rhs (string, quoted, dollar_at_p, has_dollar_at) + char *string; + int quoted, *dollar_at_p, *has_dollar_at; +{ + WORD_DESC td; + WORD_LIST *tresult; + + if (string == 0 || *string == '\0') + return (WORD_LIST *)NULL; + + td.flags = W_NOSPLIT2; /* no splitting, remove "" and '' */ + td.word = string; + tresult = call_expand_word_internal (&td, quoted, 1, dollar_at_p, has_dollar_at); + return (tresult); +} + +/* Expand STRING just as if you were expanding a word. This also returns + a list of words. Note that filename globbing is *NOT* done for word + or string expansion, just when the shell is expanding a command. This + does parameter expansion, command substitution, arithmetic expansion, + and word splitting. Dequote the resultant WORD_LIST before returning. */ +WORD_LIST * +expand_string (string, quoted) + char *string; + int quoted; +{ + WORD_LIST *result; + + if (string == 0 || *string == '\0') + return ((WORD_LIST *)NULL); + + result = expand_string_leave_quoted (string, quoted); + return (result ? dequote_list (result) : result); +} + +/*************************************************** + * * + * Functions to handle quoting chars * + * * + ***************************************************/ + +/* Conventions: + + A string with s[0] == CTLNUL && s[1] == 0 is a quoted null string. + The parser passes CTLNUL as CTLESC CTLNUL. */ + +/* Quote escape characters in string s, but no other characters. This is + used to protect CTLESC and CTLNUL in variable values from the rest of + the word expansion process after the variable is expanded (word splitting + and filename generation). If IFS is null, we quote spaces as well, just + in case we split on spaces later (in the case of unquoted $@, we will + eventually attempt to split the entire word on spaces). Corresponding + code exists in dequote_escapes. Even if we don't end up splitting on + spaces, quoting spaces is not a problem. This should never be called on + a string that is quoted with single or double quotes or part of a here + document (effectively double-quoted). */ +char * +quote_escapes (string) + char *string; +{ + register char *s, *t; + size_t slen; + char *result, *send; + int quote_spaces, skip_ctlesc, skip_ctlnul; + DECLARE_MBSTATE; + + slen = strlen (string); + send = string + slen; + + quote_spaces = (ifs_value && *ifs_value == 0); + + for (skip_ctlesc = skip_ctlnul = 0, s = ifs_value; s && *s; s++) + skip_ctlesc |= *s == CTLESC, skip_ctlnul |= *s == CTLNUL; + + t = result = (char *)xmalloc ((slen * 2) + 1); + s = string; + + while (*s) + { + if ((skip_ctlesc == 0 && *s == CTLESC) || (skip_ctlnul == 0 && *s == CTLNUL) || (quote_spaces && *s == ' ')) + *t++ = CTLESC; + COPY_CHAR_P (t, s, send); + } + *t = '\0'; + + return (result); +} + +static WORD_LIST * +list_quote_escapes (list) + WORD_LIST *list; +{ + register WORD_LIST *w; + char *t; + + for (w = list; w; w = w->next) + { + t = w->word->word; + w->word->word = quote_escapes (t); + free (t); + } + return list; +} + +/* Inverse of quote_escapes; remove CTLESC protecting CTLESC or CTLNUL. + + The parser passes us CTLESC as CTLESC CTLESC and CTLNUL as CTLESC CTLNUL. + This is necessary to make unquoted CTLESC and CTLNUL characters in the + data stream pass through properly. + + We need to remove doubled CTLESC characters inside quoted strings before + quoting the entire string, so we do not double the number of CTLESC + characters. + + Also used by parts of the pattern substitution code. */ +char * +dequote_escapes (string) + char *string; +{ + register char *s, *t, *s1; + size_t slen; + char *result, *send; + int quote_spaces; + DECLARE_MBSTATE; + + if (string == 0) + return string; + + slen = strlen (string); + send = string + slen; + + t = result = (char *)xmalloc (slen + 1); + + if (strchr (string, CTLESC) == 0) + return (strcpy (result, string)); + + quote_spaces = (ifs_value && *ifs_value == 0); + + s = string; + while (*s) + { + if (*s == CTLESC && (s[1] == CTLESC || s[1] == CTLNUL || (quote_spaces && s[1] == ' '))) + { + s++; + if (*s == '\0') + break; + } + COPY_CHAR_P (t, s, send); + } + *t = '\0'; + + return result; +} + +static WORD_LIST * +list_dequote_escapes (list) + WORD_LIST *list; +{ + register WORD_LIST *w; + char *t; + + for (w = list; w; w = w->next) + { + t = w->word->word; + w->word->word = dequote_escapes (t); + free (t); + } + return list; +} + +/* Return a new string with the quoted representation of character C. + This turns "" into QUOTED_NULL, so the W_HASQUOTEDNULL flag needs to be + set in any resultant WORD_DESC where this value is the word. */ +static char * +make_quoted_char (c) + int c; +{ + char *temp; + + temp = (char *)xmalloc (3); + if (c == 0) + { + temp[0] = CTLNUL; + temp[1] = '\0'; + } + else + { + temp[0] = CTLESC; + temp[1] = c; + temp[2] = '\0'; + } + return (temp); +} + +/* Quote STRING, returning a new string. This turns "" into QUOTED_NULL, so + the W_HASQUOTEDNULL flag needs to be set in any resultant WORD_DESC where + this value is the word. */ +char * +quote_string (string) + char *string; +{ + register char *t; + size_t slen; + char *result, *send; + + if (*string == 0) + { + result = (char *)xmalloc (2); + result[0] = CTLNUL; + result[1] = '\0'; + } + else + { + DECLARE_MBSTATE; + + slen = strlen (string); + send = string + slen; + + result = (char *)xmalloc ((slen * 2) + 1); + + for (t = result; string < send; ) + { + *t++ = CTLESC; + COPY_CHAR_P (t, string, send); + } + *t = '\0'; + } + return (result); +} + +/* De-quote quoted characters in STRING. */ +char * +dequote_string (string) + char *string; +{ + register char *s, *t; + size_t slen; + char *result, *send; + DECLARE_MBSTATE; + + slen = strlen (string); + + t = result = (char *)xmalloc (slen + 1); + + if (QUOTED_NULL (string)) + { + result[0] = '\0'; + return (result); + } + + /* If no character in the string can be quoted, don't bother examining + each character. Just return a copy of the string passed to us. */ + if (strchr (string, CTLESC) == NULL) + return (strcpy (result, string)); + + send = string + slen; + s = string; + while (*s) + { + if (*s == CTLESC) + { + s++; + if (*s == '\0') + break; + } + COPY_CHAR_P (t, s, send); + } + + *t = '\0'; + return (result); +} + +/* Quote the entire WORD_LIST list. */ +static WORD_LIST * +quote_list (list) + WORD_LIST *list; +{ + register WORD_LIST *w; + char *t; + + for (w = list; w; w = w->next) + { + t = w->word->word; + w->word->word = quote_string (t); + if (*t == 0) + w->word->flags |= W_HASQUOTEDNULL; /* XXX - turn on W_HASQUOTEDNULL here? */ + w->word->flags |= W_QUOTED; + free (t); + } + return list; +} + +/* De-quote quoted characters in each word in LIST. */ +WORD_LIST * +dequote_list (list) + WORD_LIST *list; +{ + register char *s; + register WORD_LIST *tlist; + + for (tlist = list; tlist; tlist = tlist->next) + { + s = dequote_string (tlist->word->word); + if (QUOTED_NULL (tlist->word->word)) + tlist->word->flags &= ~W_HASQUOTEDNULL; + free (tlist->word->word); + tlist->word->word = s; + } + return list; +} + +/* Remove CTLESC protecting a CTLESC or CTLNUL in place. Return the passed + string. */ +char * +remove_quoted_escapes (string) + char *string; +{ + char *t; + + if (string) + { + t = dequote_escapes (string); + strcpy (string, t); + free (t); + } + + return (string); +} + +/* Perform quoted null character removal on STRING. We don't allow any + quoted null characters in the middle or at the ends of strings because + of how expand_word_internal works. remove_quoted_nulls () turns + STRING into an empty string iff it only consists of a quoted null, + and removes all unquoted CTLNUL characters. */ +char * +remove_quoted_nulls (string) + char *string; +{ + register size_t slen; + register int i, j, prev_i; + DECLARE_MBSTATE; + + if (strchr (string, CTLNUL) == 0) /* XXX */ + return string; /* XXX */ + + slen = strlen (string); + i = j = 0; + + while (i < slen) + { + if (string[i] == CTLESC) + { + /* Old code had j++, but we cannot assume that i == j at this + point -- what if a CTLNUL has already been removed from the + string? We don't want to drop the CTLESC or recopy characters + that we've already copied down. */ + i++; string[j++] = CTLESC; + if (i == slen) + break; + } + else if (string[i] == CTLNUL) + { + i++; + continue; + } + + prev_i = i; + ADVANCE_CHAR (string, slen, i); + if (j < prev_i) + { + do string[j++] = string[prev_i++]; while (prev_i < i); + } + else + j = i; + } + string[j] = '\0'; + + return (string); +} + +/* Perform quoted null character removal on each element of LIST. + This modifies LIST. */ +void +word_list_remove_quoted_nulls (list) + WORD_LIST *list; +{ + register WORD_LIST *t; + + for (t = list; t; t = t->next) + { + remove_quoted_nulls (t->word->word); + t->word->flags &= ~W_HASQUOTEDNULL; + } +} + +/* **************************************************************** */ +/* */ +/* Functions for Matching and Removing Patterns */ +/* */ +/* **************************************************************** */ + +#if defined (HANDLE_MULTIBYTE) +#if 0 /* Currently unused */ +static unsigned char * +mb_getcharlens (string, len) + char *string; + int len; +{ + int i, offset, last; + unsigned char *ret; + char *p; + DECLARE_MBSTATE; + + i = offset = 0; + last = 0; + ret = (unsigned char *)xmalloc (len); + memset (ret, 0, len); + while (string[last]) + { + ADVANCE_CHAR (string, len, offset); + ret[last] = offset - last; + last = offset; + } + return ret; +} +#endif +#endif + +/* Remove the portion of PARAM matched by PATTERN according to OP, where OP + can have one of 4 values: + RP_LONG_LEFT remove longest matching portion at start of PARAM + RP_SHORT_LEFT remove shortest matching portion at start of PARAM + RP_LONG_RIGHT remove longest matching portion at end of PARAM + RP_SHORT_RIGHT remove shortest matching portion at end of PARAM +*/ + +#define RP_LONG_LEFT 1 +#define RP_SHORT_LEFT 2 +#define RP_LONG_RIGHT 3 +#define RP_SHORT_RIGHT 4 + +/* Returns its first argument if nothing matched; new memory otherwise */ +static char * +remove_upattern (param, pattern, op) + char *param, *pattern; + int op; +{ + register int len; + register char *end; + register char *p, *ret, c; + + len = STRLEN (param); + end = param + len; + + switch (op) + { + case RP_LONG_LEFT: /* remove longest match at start */ + for (p = end; p >= param; p--) + { + c = *p; *p = '\0'; + if (strmatch (pattern, param, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + *p = c; + return (savestring (p)); + } + *p = c; + + } + break; + + case RP_SHORT_LEFT: /* remove shortest match at start */ + for (p = param; p <= end; p++) + { + c = *p; *p = '\0'; + if (strmatch (pattern, param, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + *p = c; + return (savestring (p)); + } + *p = c; + } + break; + + case RP_LONG_RIGHT: /* remove longest match at end */ + for (p = param; p <= end; p++) + { + if (strmatch (pattern, p, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + c = *p; *p = '\0'; + ret = savestring (param); + *p = c; + return (ret); + } + } + break; + + case RP_SHORT_RIGHT: /* remove shortest match at end */ + for (p = end; p >= param; p--) + { + if (strmatch (pattern, p, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + c = *p; *p = '\0'; + ret = savestring (param); + *p = c; + return (ret); + } + } + break; + } + + return (param); /* no match, return original string */ +} + +#if defined (HANDLE_MULTIBYTE) +/* Returns its first argument if nothing matched; new memory otherwise */ +static wchar_t * +remove_wpattern (wparam, wstrlen, wpattern, op) + wchar_t *wparam; + size_t wstrlen; + wchar_t *wpattern; + int op; +{ + wchar_t wc, *ret; + int n; + + switch (op) + { + case RP_LONG_LEFT: /* remove longest match at start */ + for (n = wstrlen; n >= 0; n--) + { + wc = wparam[n]; wparam[n] = L'\0'; + if (wcsmatch (wpattern, wparam, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wparam[n] = wc; + return (wcsdup (wparam + n)); + } + wparam[n] = wc; + } + break; + + case RP_SHORT_LEFT: /* remove shortest match at start */ + for (n = 0; n <= wstrlen; n++) + { + wc = wparam[n]; wparam[n] = L'\0'; + if (wcsmatch (wpattern, wparam, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wparam[n] = wc; + return (wcsdup (wparam + n)); + } + wparam[n] = wc; + } + break; + + case RP_LONG_RIGHT: /* remove longest match at end */ + for (n = 0; n <= wstrlen; n++) + { + if (wcsmatch (wpattern, wparam + n, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wc = wparam[n]; wparam[n] = L'\0'; + ret = wcsdup (wparam); + wparam[n] = wc; + return (ret); + } + } + break; + + case RP_SHORT_RIGHT: /* remove shortest match at end */ + for (n = wstrlen; n >= 0; n--) + { + if (wcsmatch (wpattern, wparam + n, FNMATCH_EXTFLAG) != FNM_NOMATCH) + { + wc = wparam[n]; wparam[n] = L'\0'; + ret = wcsdup (wparam); + wparam[n] = wc; + return (ret); + } + } + break; + } + + return (wparam); /* no match, return original string */ +} +#endif /* HANDLE_MULTIBYTE */ + +static char * +remove_pattern (param, pattern, op) + char *param, *pattern; + int op; +{ + char *xret; + + if (param == NULL) + return (param); + if (*param == '\0' || pattern == NULL || *pattern == '\0') /* minor optimization */ + return (savestring (param)); + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1) + { + wchar_t *ret, *oret; + size_t n; + wchar_t *wparam, *wpattern; + mbstate_t ps; + + n = xdupmbstowcs (&wpattern, NULL, pattern); + if (n == (size_t)-1) + { + xret = remove_upattern (param, pattern, op); + return ((xret == param) ? savestring (param) : xret); + } + n = xdupmbstowcs (&wparam, NULL, param); + + if (n == (size_t)-1) + { + free (wpattern); + xret = remove_upattern (param, pattern, op); + return ((xret == param) ? savestring (param) : xret); + } + oret = ret = remove_wpattern (wparam, n, wpattern, op); + /* Don't bother to convert wparam back to multibyte string if nothing + matched; just return copy of original string */ + if (ret == wparam) + { + free (wparam); + free (wpattern); + return (savestring (param)); + } + + free (wparam); + free (wpattern); + + n = strlen (param); + xret = (char *)xmalloc (n + 1); + memset (&ps, '\0', sizeof (mbstate_t)); + n = wcsrtombs (xret, (const wchar_t **)&ret, n, &ps); + xret[n] = '\0'; /* just to make sure */ + free (oret); + return xret; + } + else +#endif + { + xret = remove_upattern (param, pattern, op); + return ((xret == param) ? savestring (param) : xret); + } +} + +/* Match PAT anywhere in STRING and return the match boundaries. + This returns 1 in case of a successful match, 0 otherwise. SP + and EP are pointers into the string where the match begins and + ends, respectively. MTYPE controls what kind of match is attempted. + MATCH_BEG and MATCH_END anchor the match at the beginning and end + of the string, respectively. The longest match is returned. */ +static int +match_upattern (string, pat, mtype, sp, ep) + char *string, *pat; + int mtype; + char **sp, **ep; +{ + int c, len, mlen; + register char *p, *p1, *npat; + char *end; + int n1; + + /* If the pattern doesn't match anywhere in the string, go ahead and + short-circuit right away. A minor optimization, saves a bunch of + unnecessary calls to strmatch (up to N calls for a string of N + characters) if the match is unsuccessful. To preserve the semantics + of the substring matches below, we make sure that the pattern has + `*' as first and last character, making a new pattern if necessary. */ + /* XXX - check this later if I ever implement `**' with special meaning, + since this will potentially result in `**' at the beginning or end */ + len = STRLEN (pat); + if (pat[0] != '*' || (pat[0] == '*' && pat[1] == LPAREN && extended_glob) || pat[len - 1] != '*') + { + p = npat = (char *)xmalloc (len + 3); + p1 = pat; + if (*p1 != '*' || (*p1 == '*' && p1[1] == LPAREN && extended_glob)) + *p++ = '*'; + while (*p1) + *p++ = *p1++; + if (p1[-1] != '*' || p[-2] == '\\') + *p++ = '*'; + *p = '\0'; + } + else + npat = pat; + c = strmatch (npat, string, FNMATCH_EXTFLAG); + if (npat != pat) + free (npat); + if (c == FNM_NOMATCH) + return (0); + + len = STRLEN (string); + end = string + len; + + mlen = umatchlen (pat, len); + + switch (mtype) + { + case MATCH_ANY: + for (p = string; p <= end; p++) + { + if (match_pattern_char (pat, p)) + { + p1 = (mlen == -1) ? end : p + mlen; + /* p1 - p = length of portion of string to be considered + p = current position in string + mlen = number of characters consumed by match (-1 for entire string) + end = end of string + we want to break immediately if the potential match len + is greater than the number of characters remaining in the + string + */ + if (p1 > end) + break; + for ( ; p1 >= p; p1--) + { + c = *p1; *p1 = '\0'; + if (strmatch (pat, p, FNMATCH_EXTFLAG) == 0) + { + *p1 = c; + *sp = p; + *ep = p1; + return 1; + } + *p1 = c; +#if 1 + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; +#endif + } + } + } + + return (0); + + case MATCH_BEG: + if (match_pattern_char (pat, string) == 0) + return (0); + + for (p = (mlen == -1) ? end : string + mlen; p >= string; p--) + { + c = *p; *p = '\0'; + if (strmatch (pat, string, FNMATCH_EXTFLAG) == 0) + { + *p = c; + *sp = string; + *ep = p; + return 1; + } + *p = c; + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + + return (0); + + case MATCH_END: + for (p = end - ((mlen == -1) ? len : mlen); p <= end; p++) + { + if (strmatch (pat, p, FNMATCH_EXTFLAG) == 0) + { + *sp = p; + *ep = end; + return 1; + } + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + + return (0); + } + + return (0); +} + +#if defined (HANDLE_MULTIBYTE) +/* Match WPAT anywhere in WSTRING and return the match boundaries. + This returns 1 in case of a successful match, 0 otherwise. Wide + character version. */ +static int +match_wpattern (wstring, indices, wstrlen, wpat, mtype, sp, ep) + wchar_t *wstring; + char **indices; + size_t wstrlen; + wchar_t *wpat; + int mtype; + char **sp, **ep; +{ + wchar_t wc, *wp, *nwpat, *wp1; + size_t len; + int mlen; + int n, n1, n2, simple; + + simple = (wpat[0] != L'\\' && wpat[0] != L'*' && wpat[0] != L'?' && wpat[0] != L'['); +#if defined (EXTENDED_GLOB) + if (extended_glob) + simple &= (wpat[1] != L'(' || (wpat[0] != L'*' && wpat[0] != L'?' && wpat[0] != L'+' && wpat[0] != L'!' && wpat[0] != L'@')); /*)*/ +#endif + + /* If the pattern doesn't match anywhere in the string, go ahead and + short-circuit right away. A minor optimization, saves a bunch of + unnecessary calls to strmatch (up to N calls for a string of N + characters) if the match is unsuccessful. To preserve the semantics + of the substring matches below, we make sure that the pattern has + `*' as first and last character, making a new pattern if necessary. */ + len = wcslen (wpat); + if (wpat[0] != L'*' || (wpat[0] == L'*' && wpat[1] == WLPAREN && extended_glob) || wpat[len - 1] != L'*') + { + wp = nwpat = (wchar_t *)xmalloc ((len + 3) * sizeof (wchar_t)); + wp1 = wpat; + if (*wp1 != L'*' || (*wp1 == '*' && wp1[1] == WLPAREN && extended_glob)) + *wp++ = L'*'; + while (*wp1 != L'\0') + *wp++ = *wp1++; + if (wp1[-1] != L'*' || wp1[-2] == L'\\') + *wp++ = L'*'; + *wp = '\0'; + } + else + nwpat = wpat; + len = wcsmatch (nwpat, wstring, FNMATCH_EXTFLAG); + if (nwpat != wpat) + free (nwpat); + if (len == FNM_NOMATCH) + return (0); + + mlen = wmatchlen (wpat, wstrlen); + +/* itrace("wmatchlen (%ls) -> %d", wpat, mlen); */ + switch (mtype) + { + case MATCH_ANY: + for (n = 0; n <= wstrlen; n++) + { + n2 = simple ? (*wpat == wstring[n]) : match_pattern_wchar (wpat, wstring + n); + if (n2) + { + n1 = (mlen == -1) ? wstrlen : n + mlen; + if (n1 > wstrlen) + break; + + for ( ; n1 >= n; n1--) + { + wc = wstring[n1]; wstring[n1] = L'\0'; + if (wcsmatch (wpat, wstring + n, FNMATCH_EXTFLAG) == 0) + { + wstring[n1] = wc; + *sp = indices[n]; + *ep = indices[n1]; + return 1; + } + wstring[n1] = wc; + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + } + } + + return (0); + + case MATCH_BEG: + if (match_pattern_wchar (wpat, wstring) == 0) + return (0); + + for (n = (mlen == -1) ? wstrlen : mlen; n >= 0; n--) + { + wc = wstring[n]; wstring[n] = L'\0'; + if (wcsmatch (wpat, wstring, FNMATCH_EXTFLAG) == 0) + { + wstring[n] = wc; + *sp = indices[0]; + *ep = indices[n]; + return 1; + } + wstring[n] = wc; + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + + return (0); + + case MATCH_END: + for (n = wstrlen - ((mlen == -1) ? wstrlen : mlen); n <= wstrlen; n++) + { + if (wcsmatch (wpat, wstring + n, FNMATCH_EXTFLAG) == 0) + { + *sp = indices[n]; + *ep = indices[wstrlen]; + return 1; + } + /* If MLEN != -1, we have a fixed length pattern. */ + if (mlen != -1) + break; + } + + return (0); + } + + return (0); +} +#endif /* HANDLE_MULTIBYTE */ + +static int +match_pattern (string, pat, mtype, sp, ep) + char *string, *pat; + int mtype; + char **sp, **ep; +{ +#if defined (HANDLE_MULTIBYTE) + int ret; + size_t n; + wchar_t *wstring, *wpat; + char **indices; + size_t slen, plen, mslen, mplen; +#endif + + if (string == 0 || *string == 0 || pat == 0 || *pat == 0) + return (0); + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1) + { + if (mbsmbchar (string) == 0 && mbsmbchar (pat) == 0) + return (match_upattern (string, pat, mtype, sp, ep)); + + n = xdupmbstowcs (&wpat, NULL, pat); + if (n == (size_t)-1) + return (match_upattern (string, pat, mtype, sp, ep)); + n = xdupmbstowcs (&wstring, &indices, string); + if (n == (size_t)-1) + { + free (wpat); + return (match_upattern (string, pat, mtype, sp, ep)); + } + ret = match_wpattern (wstring, indices, n, wpat, mtype, sp, ep); + + free (wpat); + free (wstring); + free (indices); + + return (ret); + } + else +#endif + return (match_upattern (string, pat, mtype, sp, ep)); +} + +static int +getpatspec (c, value) + int c; + char *value; +{ + if (c == '#') + return ((*value == '#') ? RP_LONG_LEFT : RP_SHORT_LEFT); + else /* c == '%' */ + return ((*value == '%') ? RP_LONG_RIGHT : RP_SHORT_RIGHT); +} + +/* Posix.2 says that the WORD should be run through tilde expansion, + parameter expansion, command substitution and arithmetic expansion. + This leaves the result quoted, so quote_string_for_globbing () has + to be called to fix it up for strmatch (). If QUOTED is non-zero, + it means that the entire expression was enclosed in double quotes. + This means that quoting characters in the pattern do not make any + special pattern characters quoted. For example, the `*' in the + following retains its special meaning: "${foo#'*'}". */ +static char * +getpattern (value, quoted, expandpat) + char *value; + int quoted, expandpat; +{ + char *pat, *tword; + WORD_LIST *l; +#if 0 + int i; +#endif + /* There is a problem here: how to handle single or double quotes in the + pattern string when the whole expression is between double quotes? + POSIX.2 says that enclosing double quotes do not cause the pattern to + be quoted, but does that leave us a problem with @ and array[@] and their + expansions inside a pattern? */ +#if 0 + if (expandpat && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && *tword) + { + i = 0; + pat = string_extract_double_quoted (tword, &i, 1); + free (tword); + tword = pat; + } +#endif + + /* expand_string_for_rhs () leaves WORD quoted and does not perform + word splitting. */ + l = *value ? expand_string_for_rhs (value, + (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) ? Q_PATQUOTE : quoted, + (int *)NULL, (int *)NULL) + : (WORD_LIST *)0; + pat = string_list (l); + dispose_words (l); + if (pat) + { + tword = quote_string_for_globbing (pat, QGLOB_CVTNULL); + free (pat); + pat = tword; + } + return (pat); +} + +#if 0 +/* Handle removing a pattern from a string as a result of ${name%[%]value} + or ${name#[#]value}. */ +static char * +variable_remove_pattern (value, pattern, patspec, quoted) + char *value, *pattern; + int patspec, quoted; +{ + char *tword; + + tword = remove_pattern (value, pattern, patspec); + + return (tword); +} +#endif + +static char * +list_remove_pattern (list, pattern, patspec, itype, quoted) + WORD_LIST *list; + char *pattern; + int patspec, itype, quoted; +{ + WORD_LIST *new, *l; + WORD_DESC *w; + char *tword; + + for (new = (WORD_LIST *)NULL, l = list; l; l = l->next) + { + tword = remove_pattern (l->word->word, pattern, patspec); + w = alloc_word_desc (); + w->word = tword ? tword : savestring (""); + new = make_word_list (w, new); + } + + l = REVERSE_LIST (new, WORD_LIST *); + tword = string_list_pos_params (itype, l, quoted); + dispose_words (l); + + return (tword); +} + +static char * +parameter_list_remove_pattern (itype, pattern, patspec, quoted) + int itype; + char *pattern; + int patspec, quoted; +{ + char *ret; + WORD_LIST *list; + + list = list_rest_of_args (); + if (list == 0) + return ((char *)NULL); + ret = list_remove_pattern (list, pattern, patspec, itype, quoted); + dispose_words (list); + return (ret); +} + +#if defined (ARRAY_VARS) +static char * +array_remove_pattern (var, pattern, patspec, varname, quoted) + SHELL_VAR *var; + char *pattern; + int patspec; + char *varname; /* so we can figure out how it's indexed */ + int quoted; +{ + ARRAY *a; + HASH_TABLE *h; + int itype; + char *ret; + WORD_LIST *list; + SHELL_VAR *v; + + /* compute itype from varname here */ + v = array_variable_part (varname, &ret, 0); + + /* XXX */ + if (v && invisible_p (var)) + return ((char *)NULL); + + itype = ret[0]; + + a = (v && array_p (v)) ? array_cell (v) : 0; + h = (v && assoc_p (v)) ? assoc_cell (v) : 0; + + list = a ? array_to_word_list (a) : (h ? assoc_to_word_list (h) : 0); + if (list == 0) + return ((char *)NULL); + ret = list_remove_pattern (list, pattern, patspec, itype, quoted); + dispose_words (list); + + return ret; +} +#endif /* ARRAY_VARS */ + +static char * +parameter_brace_remove_pattern (varname, value, ind, patstr, rtype, quoted, flags) + char *varname, *value; + int ind; + char *patstr; + int rtype, quoted, flags; +{ + int vtype, patspec, starsub; + char *temp1, *val, *pattern; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + this_command_name = varname; + + vtype = get_var_and_type (varname, value, ind, quoted, flags, &v, &val); + if (vtype == -1) + return ((char *)NULL); + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + patspec = getpatspec (rtype, patstr); + if (patspec == RP_LONG_LEFT || patspec == RP_LONG_RIGHT) + patstr++; + + /* Need to pass getpattern newly-allocated memory in case of expansion -- + the expansion code will free the passed string on an error. */ + temp1 = savestring (patstr); + pattern = getpattern (temp1, quoted, 1); + free (temp1); + + temp1 = (char *)NULL; /* shut up gcc */ + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + temp1 = remove_pattern (val, pattern, patspec); + if (vtype == VT_VARIABLE) + FREE (val); + if (temp1) + { + val = (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + ? quote_string (temp1) + : quote_escapes (temp1); + free (temp1); + temp1 = val; + } + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + temp1 = array_remove_pattern (v, pattern, patspec, varname, quoted); + if (temp1 && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + { + val = quote_escapes (temp1); + free (temp1); + temp1 = val; + } + break; +#endif + case VT_POSPARMS: + temp1 = parameter_list_remove_pattern (varname[0], pattern, patspec, quoted); + if (temp1 && ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0)) + { + val = quote_escapes (temp1); + free (temp1); + temp1 = val; + } + break; + } + + FREE (pattern); + return temp1; +} + +/******************************************* + * * + * Functions to expand WORD_DESCs * + * * + *******************************************/ + +/* Expand WORD, performing word splitting on the result. This does + parameter expansion, command substitution, arithmetic expansion, + word splitting, and quote removal. */ + +WORD_LIST * +expand_word (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_LIST *result, *tresult; + + tresult = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); + result = word_list_split (tresult); + dispose_words (tresult); + return (result ? dequote_list (result) : result); +} + +/* Expand WORD, but do not perform word splitting on the result. This + does parameter expansion, command substitution, arithmetic expansion, + and quote removal. */ +WORD_LIST * +expand_word_unsplit (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_LIST *result; + + expand_no_split_dollar_star = 1; +#if defined (HANDLE_MULTIBYTE) + if (ifs_firstc[0] == 0) +#else + if (ifs_firstc == 0) +#endif + word->flags |= W_NOSPLIT; + word->flags |= W_NOSPLIT2; + result = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); + expand_no_split_dollar_star = 0; + + return (result ? dequote_list (result) : result); +} + +/* Perform shell expansions on WORD, but do not perform word splitting or + quote removal on the result. Virtually identical to expand_word_unsplit; + could be combined if implementations don't diverge. */ +WORD_LIST * +expand_word_leave_quoted (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_LIST *result; + + expand_no_split_dollar_star = 1; +#if defined (HANDLE_MULTIBYTE) + if (ifs_firstc[0] == 0) +#else + if (ifs_firstc == 0) +#endif + word->flags |= W_NOSPLIT; + word->flags |= W_NOSPLIT2; + result = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); + expand_no_split_dollar_star = 0; + + return result; +} + +#if defined (PROCESS_SUBSTITUTION) + +/*****************************************************************/ +/* */ +/* Hacking Process Substitution */ +/* */ +/*****************************************************************/ + +#if !defined (HAVE_DEV_FD) +/* Named pipes must be removed explicitly with `unlink'. This keeps a list + of FIFOs the shell has open. unlink_fifo_list will walk the list and + unlink all of them. add_fifo_list adds the name of an open FIFO to the + list. NFIFO is a count of the number of FIFOs in the list. */ +#define FIFO_INCR 20 + +struct temp_fifo { + char *file; + pid_t proc; +}; + +static struct temp_fifo *fifo_list = (struct temp_fifo *)NULL; +static int nfifo; +static int fifo_list_size; + +char * +copy_fifo_list (sizep) + int *sizep; +{ + if (sizep) + *sizep = 0; + return (char *)NULL; +} + +static void +add_fifo_list (pathname) + char *pathname; +{ + if (nfifo >= fifo_list_size - 1) + { + fifo_list_size += FIFO_INCR; + fifo_list = (struct temp_fifo *)xrealloc (fifo_list, + fifo_list_size * sizeof (struct temp_fifo)); + } + + fifo_list[nfifo].file = savestring (pathname); + nfifo++; +} + +void +unlink_fifo (i) + int i; +{ + if ((fifo_list[i].proc == -1) || (kill(fifo_list[i].proc, 0) == -1)) + { + unlink (fifo_list[i].file); + free (fifo_list[i].file); + fifo_list[i].file = (char *)NULL; + fifo_list[i].proc = -1; + } +} + +void +unlink_fifo_list () +{ + int saved, i, j; + + if (nfifo == 0) + return; + + for (i = saved = 0; i < nfifo; i++) + { + if ((fifo_list[i].proc == -1) || (kill(fifo_list[i].proc, 0) == -1)) + { + unlink (fifo_list[i].file); + free (fifo_list[i].file); + fifo_list[i].file = (char *)NULL; + fifo_list[i].proc = -1; + } + else + saved++; + } + + /* If we didn't remove some of the FIFOs, compact the list. */ + if (saved) + { + for (i = j = 0; i < nfifo; i++) + if (fifo_list[i].file) + { + fifo_list[j].file = fifo_list[i].file; + fifo_list[j].proc = fifo_list[i].proc; + j++; + } + nfifo = j; + } + else + nfifo = 0; +} + +/* Take LIST, which is a bitmap denoting active FIFOs in fifo_list + from some point in the past, and close all open FIFOs in fifo_list + that are not marked as active in LIST. If LIST is NULL, close + everything in fifo_list. LSIZE is the number of elements in LIST, in + case it's larger than fifo_list_size (size of fifo_list). */ +void +close_new_fifos (list, lsize) + char *list; + int lsize; +{ + int i; + + if (list == 0) + { + unlink_fifo_list (); + return; + } + + for (i = 0; i < lsize; i++) + if (list[i] == 0 && i < fifo_list_size && fifo_list[i].proc != -1) + unlink_fifo (i); + + for (i = lsize; i < fifo_list_size; i++) + unlink_fifo (i); +} + +int +fifos_pending () +{ + return nfifo; +} + +int +num_fifos () +{ + return nfifo; +} + +static char * +make_named_pipe () +{ + char *tname; + + tname = sh_mktmpname ("sh-np", MT_USERANDOM|MT_USETMPDIR); + if (mkfifo (tname, 0600) < 0) + { + free (tname); + return ((char *)NULL); + } + + add_fifo_list (tname); + return (tname); +} + +#else /* HAVE_DEV_FD */ + +/* DEV_FD_LIST is a bitmap of file descriptors attached to pipes the shell + has open to children. NFDS is a count of the number of bits currently + set in DEV_FD_LIST. TOTFDS is a count of the highest possible number + of open files. */ +static char *dev_fd_list = (char *)NULL; +static int nfds; +static int totfds; /* The highest possible number of open files. */ + +char * +copy_fifo_list (sizep) + int *sizep; +{ + char *ret; + + if (nfds == 0 || totfds == 0) + { + if (sizep) + *sizep = 0; + return (char *)NULL; + } + + if (sizep) + *sizep = totfds; + ret = (char *)xmalloc (totfds); + return (memcpy (ret, dev_fd_list, totfds)); +} + +static void +add_fifo_list (fd) + int fd; +{ + if (dev_fd_list == 0 || fd >= totfds) + { + int ofds; + + ofds = totfds; + totfds = getdtablesize (); + if (totfds < 0 || totfds > 256) + totfds = 256; + if (fd >= totfds) + totfds = fd + 2; + + dev_fd_list = (char *)xrealloc (dev_fd_list, totfds); + memset (dev_fd_list + ofds, '\0', totfds - ofds); + } + + dev_fd_list[fd] = 1; + nfds++; +} + +int +fifos_pending () +{ + return 0; /* used for cleanup; not needed with /dev/fd */ +} + +int +num_fifos () +{ + return nfds; +} + +void +unlink_fifo (fd) + int fd; +{ + if (dev_fd_list[fd]) + { + close (fd); + dev_fd_list[fd] = 0; + nfds--; + } +} + +void +unlink_fifo_list () +{ + register int i; + + if (nfds == 0) + return; + + for (i = 0; nfds && i < totfds; i++) + unlink_fifo (i); + + nfds = 0; +} + +/* Take LIST, which is a snapshot copy of dev_fd_list from some point in + the past, and close all open fds in dev_fd_list that are not marked + as open in LIST. If LIST is NULL, close everything in dev_fd_list. + LSIZE is the number of elements in LIST, in case it's larger than + totfds (size of dev_fd_list). */ +void +close_new_fifos (list, lsize) + char *list; + int lsize; +{ + int i; + + if (list == 0) + { + unlink_fifo_list (); + return; + } + + for (i = 0; i < lsize; i++) + if (list[i] == 0 && i < totfds && dev_fd_list[i]) + unlink_fifo (i); + + for (i = lsize; i < totfds; i++) + unlink_fifo (i); +} + +#if defined (NOTDEF) +print_dev_fd_list () +{ + register int i; + + fprintf (stderr, "pid %ld: dev_fd_list:", (long)getpid ()); + fflush (stderr); + + for (i = 0; i < totfds; i++) + { + if (dev_fd_list[i]) + fprintf (stderr, " %d", i); + } + fprintf (stderr, "\n"); +} +#endif /* NOTDEF */ + +static char * +make_dev_fd_filename (fd) + int fd; +{ + char *ret, intbuf[INT_STRLEN_BOUND (int) + 1], *p; + + ret = (char *)xmalloc (sizeof (DEV_FD_PREFIX) + 8); + + strcpy (ret, DEV_FD_PREFIX); + p = inttostr (fd, intbuf, sizeof (intbuf)); + strcpy (ret + sizeof (DEV_FD_PREFIX) - 1, p); + + add_fifo_list (fd); + return (ret); +} + +#endif /* HAVE_DEV_FD */ + +/* Return a filename that will open a connection to the process defined by + executing STRING. HAVE_DEV_FD, if defined, means open a pipe and return + a filename in /dev/fd corresponding to a descriptor that is one of the + ends of the pipe. If not defined, we use named pipes on systems that have + them. Systems without /dev/fd and named pipes are out of luck. + + OPEN_FOR_READ_IN_CHILD, if 1, means open the named pipe for reading or + use the read end of the pipe and dup that file descriptor to fd 0 in + the child. If OPEN_FOR_READ_IN_CHILD is 0, we open the named pipe for + writing or use the write end of the pipe in the child, and dup that + file descriptor to fd 1 in the child. The parent does the opposite. */ + +static char * +process_substitute (string, open_for_read_in_child) + char *string; + int open_for_read_in_child; +{ + char *pathname; + int fd, result; + pid_t old_pid, pid; +#if defined (HAVE_DEV_FD) + int parent_pipe_fd, child_pipe_fd; + int fildes[2]; +#endif /* HAVE_DEV_FD */ +#if defined (JOB_CONTROL) + pid_t old_pipeline_pgrp; +#endif + + if (!string || !*string || wordexp_only) + return ((char *)NULL); + +#if !defined (HAVE_DEV_FD) + pathname = make_named_pipe (); +#else /* HAVE_DEV_FD */ + if (pipe (fildes) < 0) + { + sys_error (_("cannot make pipe for process substitution")); + return ((char *)NULL); + } + /* If OPEN_FOR_READ_IN_CHILD == 1, we want to use the write end of + the pipe in the parent, otherwise the read end. */ + parent_pipe_fd = fildes[open_for_read_in_child]; + child_pipe_fd = fildes[1 - open_for_read_in_child]; + /* Move the parent end of the pipe to some high file descriptor, to + avoid clashes with FDs used by the script. */ + parent_pipe_fd = move_to_high_fd (parent_pipe_fd, 1, 64); + + pathname = make_dev_fd_filename (parent_pipe_fd); +#endif /* HAVE_DEV_FD */ + + if (pathname == 0) + { + sys_error (_("cannot make pipe for process substitution")); + return ((char *)NULL); + } + + old_pid = last_made_pid; + +#if defined (JOB_CONTROL) + old_pipeline_pgrp = pipeline_pgrp; + pipeline_pgrp = shell_pgrp; + save_pipeline (1); +#endif /* JOB_CONTROL */ + + pid = make_child ((char *)NULL, 1); + if (pid == 0) + { + reset_terminating_signals (); /* XXX */ + free_pushed_string_input (); + /* Cancel traps, in trap.c. */ + restore_original_signals (); /* XXX - what about special builtins? bash-4.2 */ + setup_async_signals (); + subshell_environment |= SUBSHELL_COMSUB|SUBSHELL_PROCSUB; + } + +#if defined (JOB_CONTROL) + set_sigchld_handler (); + stop_making_children (); + /* XXX - should we only do this in the parent? (as in command subst) */ + pipeline_pgrp = old_pipeline_pgrp; +#endif /* JOB_CONTROL */ + + if (pid < 0) + { + sys_error (_("cannot make child for process substitution")); + free (pathname); +#if defined (HAVE_DEV_FD) + close (parent_pipe_fd); + close (child_pipe_fd); +#endif /* HAVE_DEV_FD */ + return ((char *)NULL); + } + + if (pid > 0) + { +#if defined (JOB_CONTROL) + restore_pipeline (1); +#endif + +#if !defined (HAVE_DEV_FD) + fifo_list[nfifo-1].proc = pid; +#endif + + last_made_pid = old_pid; + +#if defined (JOB_CONTROL) && defined (PGRP_PIPE) + close_pgrp_pipe (); +#endif /* JOB_CONTROL && PGRP_PIPE */ + +#if defined (HAVE_DEV_FD) + close (child_pipe_fd); +#endif /* HAVE_DEV_FD */ + + return (pathname); + } + + set_sigint_handler (); + +#if defined (JOB_CONTROL) + set_job_control (0); +#endif /* JOB_CONTROL */ + +#if !defined (HAVE_DEV_FD) + /* Open the named pipe in the child. */ + fd = open (pathname, open_for_read_in_child ? O_RDONLY : O_WRONLY); + if (fd < 0) + { + /* Two separate strings for ease of translation. */ + if (open_for_read_in_child) + sys_error (_("cannot open named pipe %s for reading"), pathname); + else + sys_error (_("cannot open named pipe %s for writing"), pathname); + + exit (127); + } + if (open_for_read_in_child) + { + if (sh_unset_nodelay_mode (fd) < 0) + { + sys_error (_("cannot reset nodelay mode for fd %d"), fd); + exit (127); + } + } +#else /* HAVE_DEV_FD */ + fd = child_pipe_fd; +#endif /* HAVE_DEV_FD */ + + if (dup2 (fd, open_for_read_in_child ? 0 : 1) < 0) + { + sys_error (_("cannot duplicate named pipe %s as fd %d"), pathname, + open_for_read_in_child ? 0 : 1); + exit (127); + } + + if (fd != (open_for_read_in_child ? 0 : 1)) + close (fd); + + /* Need to close any files that this process has open to pipes inherited + from its parent. */ + if (current_fds_to_close) + { + close_fd_bitmap (current_fds_to_close); + current_fds_to_close = (struct fd_bitmap *)NULL; + } + +#if defined (HAVE_DEV_FD) + /* Make sure we close the parent's end of the pipe and clear the slot + in the fd list so it is not closed later, if reallocated by, for + instance, pipe(2). */ + close (parent_pipe_fd); + dev_fd_list[parent_pipe_fd] = 0; +#endif /* HAVE_DEV_FD */ + + /* subshells shouldn't have this flag, which controls using the temporary + environment for variable lookups. */ + expanding_redir = 0; + + result = parse_and_execute (string, "process substitution", (SEVAL_NONINT|SEVAL_NOHIST)); + +#if !defined (HAVE_DEV_FD) + /* Make sure we close the named pipe in the child before we exit. */ + close (open_for_read_in_child ? 0 : 1); +#endif /* !HAVE_DEV_FD */ + + last_command_exit_value = result; + result = run_exit_trap (); + exit (result); + /*NOTREACHED*/ +} +#endif /* PROCESS_SUBSTITUTION */ + +/***********************************/ +/* */ +/* Command Substitution */ +/* */ +/***********************************/ + +static char * +read_comsub (fd, quoted, rflag) + int fd, quoted; + int *rflag; +{ + char *istring, buf[128], *bufp, *s; + int istring_index, istring_size, c, tflag, skip_ctlesc, skip_ctlnul; + ssize_t bufn; + + istring = (char *)NULL; + istring_index = istring_size = bufn = tflag = 0; + + for (skip_ctlesc = skip_ctlnul = 0, s = ifs_value; s && *s; s++) + skip_ctlesc |= *s == CTLESC, skip_ctlnul |= *s == CTLNUL; + + /* Read the output of the command through the pipe. This may need to be + changed to understand multibyte characters in the future. */ + while (1) + { + if (fd < 0) + break; + if (--bufn <= 0) + { + bufn = zread (fd, buf, sizeof (buf)); + if (bufn <= 0) + break; + bufp = buf; + } + c = *bufp++; + + if (c == 0) + { +#if 0 + internal_warning ("read_comsub: ignored null byte in input"); +#endif + continue; + } + + /* Add the character to ISTRING, possibly after resizing it. */ + RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, DEFAULT_ARRAY_SIZE); + + /* This is essentially quote_string inline */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) /* || c == CTLESC || c == CTLNUL */) + istring[istring_index++] = CTLESC; + /* Escape CTLESC and CTLNUL in the output to protect those characters + from the rest of the word expansions (word splitting and globbing.) + This is essentially quote_escapes inline. */ + else if (skip_ctlesc == 0 && c == CTLESC) + { + tflag |= W_HASCTLESC; + istring[istring_index++] = CTLESC; + } + else if ((skip_ctlnul == 0 && c == CTLNUL) || (c == ' ' && (ifs_value && *ifs_value == 0))) + istring[istring_index++] = CTLESC; + + istring[istring_index++] = c; + +#if 0 +#if defined (__CYGWIN__) + if (c == '\n' && istring_index > 1 && istring[istring_index - 2] == '\r') + { + istring_index--; + istring[istring_index - 1] = '\n'; + } +#endif +#endif + } + + if (istring) + istring[istring_index] = '\0'; + + /* If we read no output, just return now and save ourselves some + trouble. */ + if (istring_index == 0) + { + FREE (istring); + if (rflag) + *rflag = tflag; + return (char *)NULL; + } + + /* Strip trailing newlines from the output of the command. */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + { + while (istring_index > 0) + { + if (istring[istring_index - 1] == '\n') + { + --istring_index; + + /* If the newline was quoted, remove the quoting char. */ + if (istring[istring_index - 1] == CTLESC) + --istring_index; + } + else + break; + } + istring[istring_index] = '\0'; + } + else + strip_trailing (istring, istring_index - 1, 1); + + if (rflag) + *rflag = tflag; + return istring; +} + +/* Perform command substitution on STRING. This returns a WORD_DESC * with the + contained string possibly quoted. */ +WORD_DESC * +command_substitute (string, quoted) + char *string; + int quoted; +{ + pid_t pid, old_pid, old_pipeline_pgrp, old_async_pid; + char *istring; + int result, fildes[2], function_value, pflags, rc, tflag; + WORD_DESC *ret; + + istring = (char *)NULL; + + /* Don't fork () if there is no need to. In the case of no command to + run, just return NULL. */ + if (!string || !*string || (string[0] == '\n' && !string[1])) + return ((WORD_DESC *)NULL); + + if (wordexp_only && read_but_dont_execute) + { + last_command_exit_value = EX_WEXPCOMSUB; + jump_to_top_level (EXITPROG); + } + + /* We're making the assumption here that the command substitution will + eventually run a command from the file system. Since we'll run + maybe_make_export_env in this subshell before executing that command, + the parent shell and any other shells it starts will have to remake + the environment. If we make it before we fork, other shells won't + have to. Don't bother if we have any temporary variable assignments, + though, because the export environment will be remade after this + command completes anyway, but do it if all the words to be expanded + are variable assignments. */ + if (subst_assign_varlist == 0 || garglist == 0) + maybe_make_export_env (); /* XXX */ + + /* Flags to pass to parse_and_execute() */ + pflags = (interactive && sourcelevel == 0) ? SEVAL_RESETLINE : 0; + + /* Pipe the output of executing STRING into the current shell. */ + if (pipe (fildes) < 0) + { + sys_error (_("cannot make pipe for command substitution")); + goto error_exit; + } + + old_pid = last_made_pid; +#if defined (JOB_CONTROL) + old_pipeline_pgrp = pipeline_pgrp; + /* Don't reset the pipeline pgrp if we're already a subshell in a pipeline. */ + if ((subshell_environment & SUBSHELL_PIPE) == 0) + pipeline_pgrp = shell_pgrp; + cleanup_the_pipeline (); +#endif /* JOB_CONTROL */ + + old_async_pid = last_asynchronous_pid; + pid = make_child ((char *)NULL, subshell_environment&SUBSHELL_ASYNC); + last_asynchronous_pid = old_async_pid; + + if (pid == 0) + { + /* Reset the signal handlers in the child, but don't free the + trap strings. Set a flag noting that we have to free the + trap strings if we run trap to change a signal disposition. */ + reset_signal_handlers (); + subshell_environment |= SUBSHELL_RESETTRAP; + } + +#if defined (JOB_CONTROL) + /* XXX DO THIS ONLY IN PARENT ? XXX */ + set_sigchld_handler (); + stop_making_children (); + if (pid != 0) + pipeline_pgrp = old_pipeline_pgrp; +#else + stop_making_children (); +#endif /* JOB_CONTROL */ + + if (pid < 0) + { + sys_error (_("cannot make child for command substitution")); + error_exit: + + last_made_pid = old_pid; + + FREE (istring); + close (fildes[0]); + close (fildes[1]); + return ((WORD_DESC *)NULL); + } + + if (pid == 0) + { + set_sigint_handler (); /* XXX */ + + free_pushed_string_input (); + + if (dup2 (fildes[1], 1) < 0) + { + sys_error (_("command_substitute: cannot duplicate pipe as fd 1")); + exit (EXECUTION_FAILURE); + } + + /* If standard output is closed in the parent shell + (such as after `exec >&-'), file descriptor 1 will be + the lowest available file descriptor, and end up in + fildes[0]. This can happen for stdin and stderr as well, + but stdout is more important -- it will cause no output + to be generated from this command. */ + if ((fildes[1] != fileno (stdin)) && + (fildes[1] != fileno (stdout)) && + (fildes[1] != fileno (stderr))) + close (fildes[1]); + + if ((fildes[0] != fileno (stdin)) && + (fildes[0] != fileno (stdout)) && + (fildes[0] != fileno (stderr))) + close (fildes[0]); + +#ifdef __CYGWIN__ + /* Let stdio know the fd may have changed from text to binary mode, and + make sure to preserve stdout line buffering. */ + freopen (NULL, "w", stdout); + sh_setlinebuf (stdout); +#endif /* __CYGWIN__ */ + + /* The currently executing shell is not interactive. */ + interactive = 0; + + /* This is a subshell environment. */ + subshell_environment |= SUBSHELL_COMSUB; + + /* When not in POSIX mode, command substitution does not inherit + the -e flag. */ + if (posixly_correct == 0) + { + builtin_ignoring_errexit = 0; + change_flag ('e', FLAG_OFF); + set_shellopts (); + } + + remove_quoted_escapes (string); + + startup_state = 2; /* see if we can avoid a fork */ + /* Give command substitution a place to jump back to on failure, + so we don't go back up to main (). */ + result = setjmp_nosigs (top_level); + + /* If we're running a command substitution inside a shell function, + trap `return' so we don't return from the function in the subshell + and go off to never-never land. */ + if (result == 0 && return_catch_flag) + function_value = setjmp_nosigs (return_catch); + else + function_value = 0; + + if (result == ERREXIT) + rc = last_command_exit_value; + else if (result == EXITPROG) + rc = last_command_exit_value; + else if (result) + rc = EXECUTION_FAILURE; + else if (function_value) + rc = return_catch_value; + else + { + subshell_level++; + rc = parse_and_execute (string, "command substitution", pflags|SEVAL_NOHIST); + subshell_level--; + } + + last_command_exit_value = rc; + rc = run_exit_trap (); +#if defined (PROCESS_SUBSTITUTION) + unlink_fifo_list (); +#endif + exit (rc); + } + else + { +#if defined (JOB_CONTROL) && defined (PGRP_PIPE) + close_pgrp_pipe (); +#endif /* JOB_CONTROL && PGRP_PIPE */ + + close (fildes[1]); + + tflag = 0; + istring = read_comsub (fildes[0], quoted, &tflag); + + close (fildes[0]); + + current_command_subst_pid = pid; + last_command_exit_value = wait_for (pid); + last_command_subst_pid = pid; + last_made_pid = old_pid; + +#if defined (JOB_CONTROL) + /* If last_command_exit_value > 128, then the substituted command + was terminated by a signal. If that signal was SIGINT, then send + SIGINT to ourselves. This will break out of loops, for instance. */ + if (last_command_exit_value == (128 + SIGINT) && last_command_exit_signal == SIGINT) + kill (getpid (), SIGINT); + + /* wait_for gives the terminal back to shell_pgrp. If some other + process group should have it, give it away to that group here. + pipeline_pgrp is non-zero only while we are constructing a + pipeline, so what we are concerned about is whether or not that + pipeline was started in the background. A pipeline started in + the background should never get the tty back here. */ + if (interactive && pipeline_pgrp != (pid_t)0 && (subshell_environment & SUBSHELL_ASYNC) == 0) + give_terminal_to (pipeline_pgrp, 0); +#endif /* JOB_CONTROL */ + + ret = alloc_word_desc (); + ret->word = istring; + ret->flags = tflag; + + return ret; + } +} + +/******************************************************** + * * + * Utility functions for parameter expansion * + * * + ********************************************************/ + +#if defined (ARRAY_VARS) + +static arrayind_t +array_length_reference (s) + char *s; +{ + int len; + arrayind_t ind; + char *akey; + char *t, c; + ARRAY *array; + HASH_TABLE *h; + SHELL_VAR *var; + + var = array_variable_part (s, &t, &len); + + /* If unbound variables should generate an error, report one and return + failure. */ + if ((var == 0 || invisible_p (var) || (assoc_p (var) == 0 && array_p (var) == 0)) && unbound_vars_is_error) + { + c = *--t; + *t = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (s); + *t = c; + return (-1); + } + else if (var == 0 || invisible_p (var)) + return 0; + + /* We support a couple of expansions for variables that are not arrays. + We'll return the length of the value for v[0], and 1 for v[@] or + v[*]. Return 0 for everything else. */ + + array = array_p (var) ? array_cell (var) : (ARRAY *)NULL; + h = assoc_p (var) ? assoc_cell (var) : (HASH_TABLE *)NULL; + + if (ALL_ELEMENT_SUB (t[0]) && t[1] == ']') + { + if (assoc_p (var)) + return (h ? assoc_num_elements (h) : 0); + else if (array_p (var)) + return (array ? array_num_elements (array) : 0); + else + return (var_isset (var) ? 1 : 0); + } + + if (assoc_p (var)) + { + t[len - 1] = '\0'; + akey = expand_assignment_string_to_string (t, 0); /* [ */ + t[len - 1] = ']'; + if (akey == 0 || *akey == 0) + { + err_badarraysub (t); + FREE (akey); + return (-1); + } + t = assoc_reference (assoc_cell (var), akey); + free (akey); + } + else + { + ind = array_expand_index (var, t, len); + /* negative subscripts to indexed arrays count back from end */ + if (var && array_p (var) && ind < 0) + ind = array_max_index (array_cell (var)) + 1 + ind; + if (ind < 0) + { + err_badarraysub (t); + return (-1); + } + if (array_p (var)) + t = array_reference (array, ind); + else + t = (ind == 0) ? value_cell (var) : (char *)NULL; + } + + len = MB_STRLEN (t); + return (len); +} +#endif /* ARRAY_VARS */ + +static int +valid_brace_expansion_word (name, var_is_special) + char *name; + int var_is_special; +{ + if (DIGIT (*name) && all_digits (name)) + return 1; + else if (var_is_special) + return 1; +#if defined (ARRAY_VARS) + else if (valid_array_reference (name)) + return 1; +#endif /* ARRAY_VARS */ + else if (legal_identifier (name)) + return 1; + else + return 0; +} + +static int +chk_atstar (name, quoted, quoted_dollar_atp, contains_dollar_at) + char *name; + int quoted; + int *quoted_dollar_atp, *contains_dollar_at; +{ + char *temp1; + + if (name == 0) + { + if (quoted_dollar_atp) + *quoted_dollar_atp = 0; + if (contains_dollar_at) + *contains_dollar_at = 0; + return 0; + } + + /* check for $@ and $* */ + if (name[0] == '@' && name[1] == 0) + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } + else if (name[0] == '*' && name[1] == '\0' && quoted == 0) + { + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } + + /* Now check for ${array[@]} and ${array[*]} */ +#if defined (ARRAY_VARS) + else if (valid_array_reference (name)) + { + temp1 = mbschr (name, '['); + if (temp1 && temp1[1] == '@' && temp1[2] == ']') + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } /* [ */ + /* ${array[*]}, when unquoted, should be treated like ${array[@]}, + which should result in separate words even when IFS is unset. */ + if (temp1 && temp1[1] == '*' && temp1[2] == ']' && quoted == 0) + { + if (contains_dollar_at) + *contains_dollar_at = 1; + return 1; + } + } +#endif + return 0; +} + +/* Parameter expand NAME, and return a new string which is the expansion, + or NULL if there was no expansion. + VAR_IS_SPECIAL is non-zero if NAME is one of the special variables in + the shell, e.g., "@", "$", "*", etc. QUOTED, if non-zero, means that + NAME was found inside of a double-quoted expression. */ +static WORD_DESC * +parameter_brace_expand_word (name, var_is_special, quoted, pflags, indp) + char *name; + int var_is_special, quoted, pflags; + arrayind_t *indp; +{ + WORD_DESC *ret; + char *temp, *tt; + intmax_t arg_index; + SHELL_VAR *var; + int atype, rflags; + arrayind_t ind; + + ret = 0; + temp = 0; + rflags = 0; + + if (indp) + *indp = INTMAX_MIN; + + /* Handle multiple digit arguments, as in ${11}. */ + if (legal_number (name, &arg_index)) + { + tt = get_dollar_var_value (arg_index); + if (tt) + temp = (*tt && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + ? quote_string (tt) + : quote_escapes (tt); + else + temp = (char *)NULL; + FREE (tt); + } + else if (var_is_special) /* ${@} */ + { + int sindex; + tt = (char *)xmalloc (2 + strlen (name)); + tt[sindex = 0] = '$'; + strcpy (tt + 1, name); + + ret = param_expand (tt, &sindex, quoted, (int *)NULL, (int *)NULL, + (int *)NULL, (int *)NULL, pflags); + free (tt); + } +#if defined (ARRAY_VARS) + else if (valid_array_reference (name)) + { +expand_arrayref: + /* XXX - does this leak if name[@] or name[*]? */ + if (pflags & PF_ASSIGNRHS) + { + temp = array_variable_name (name, &tt, (int *)0); + if (ALL_ELEMENT_SUB (tt[0]) && tt[1] == ']') + temp = array_value (name, quoted|Q_DOUBLE_QUOTES, 0, &atype, &ind); + else + temp = array_value (name, quoted, 0, &atype, &ind); + } + else + temp = array_value (name, quoted, 0, &atype, &ind); + if (atype == 0 && temp) + { + temp = (*temp && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + ? quote_string (temp) + : quote_escapes (temp); + rflags |= W_ARRAYIND; + if (indp) + *indp = ind; + } + else if (atype == 1 && temp && QUOTED_NULL (temp) && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + rflags |= W_HASQUOTEDNULL; + } +#endif + else if (var = find_variable (name)) + { + if (var_isset (var) && invisible_p (var) == 0) + { +#if defined (ARRAY_VARS) + if (assoc_p (var)) + temp = assoc_reference (assoc_cell (var), "0"); + else if (array_p (var)) + temp = array_reference (array_cell (var), 0); + else + temp = value_cell (var); +#else + temp = value_cell (var); +#endif + + if (temp) + temp = (*temp && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + ? quote_string (temp) + : quote_escapes (temp); + } + else + temp = (char *)NULL; + } + else if (var = find_variable_last_nameref (name)) + { + temp = nameref_cell (var); +#if defined (ARRAY_VARS) + /* Handle expanding nameref whose value is x[n] */ + if (temp && *temp && valid_array_reference (temp)) + { + name = temp; + goto expand_arrayref; + } + else +#endif + /* y=2 ; typeset -n x=y; echo ${x} is not the same as echo ${2} in ksh */ + if (temp && *temp && legal_identifier (temp) == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("%s: invalid variable name for name reference"), temp); + temp = &expand_param_error; + } + else + temp = (char *)NULL; + } + else + temp = (char *)NULL; + + if (ret == 0) + { + ret = alloc_word_desc (); + ret->word = temp; + ret->flags |= rflags; + } + return ret; +} + +static char * +parameter_brace_find_indir (name, var_is_special, quoted, find_nameref) + char *name; + int var_is_special, quoted, find_nameref; +{ + char *temp, *t; + WORD_DESC *w; + SHELL_VAR *v; + + if (find_nameref && var_is_special == 0 && (v = find_variable_last_nameref (name)) && + nameref_p (v) && (t = nameref_cell (v)) && *t) + return (savestring (t)); + + /* If var_is_special == 0, and name is not an array reference, this does + more expansion than necessary. It should really look up the variable's + value and not try to expand it. */ + w = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND, 0); + t = w->word; + /* Have to dequote here if necessary */ + if (t) + { + temp = (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + ? dequote_string (t) + : dequote_escapes (t); + free (t); + t = temp; + } + dispose_word_desc (w); + + return t; +} + +/* Expand an indirect reference to a variable: ${!NAME} expands to the + value of the variable whose name is the value of NAME. */ +static WORD_DESC * +parameter_brace_expand_indir (name, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at) + char *name; + int var_is_special, quoted; + int *quoted_dollar_atp, *contains_dollar_at; +{ + char *temp, *t; + WORD_DESC *w; + SHELL_VAR *v; + + /* See if it's a nameref first, behave in ksh93-compatible fashion. + There is at least one incompatibility: given ${!foo[0]} where foo=bar, + bash performs an indirect lookup on foo[0] and expands the result; + ksh93 expands bar[0]. We could do that here -- there are enough usable + primitives to do that -- but do not at this point. */ + if (var_is_special == 0 && (v = find_variable_last_nameref (name))) + { + if (nameref_p (v) && (t = nameref_cell (v)) && *t) + { + w = alloc_word_desc (); + w->word = savestring (t); + w->flags = 0; + return w; + } + } + + t = parameter_brace_find_indir (name, var_is_special, quoted, 0); + + chk_atstar (t, quoted, quoted_dollar_atp, contains_dollar_at); + if (t == 0) + return (WORD_DESC *)NULL; + + w = parameter_brace_expand_word (t, SPECIAL_VAR(t, 0), quoted, 0, 0); + free (t); + + return w; +} + +/* Expand the right side of a parameter expansion of the form ${NAMEcVALUE}, + depending on the value of C, the separating character. C can be one of + "-", "+", or "=". QUOTED is true if the entire brace expression occurs + between double quotes. */ +static WORD_DESC * +parameter_brace_expand_rhs (name, value, c, quoted, qdollaratp, hasdollarat) + char *name, *value; + int c, quoted, *qdollaratp, *hasdollarat; +{ + WORD_DESC *w; + WORD_LIST *l; + char *t, *t1, *temp; + int hasdol; + + /* If the entire expression is between double quotes, we want to treat + the value as a double-quoted string, with the exception that we strip + embedded unescaped double quotes (for sh backwards compatibility). */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && *value) + { + hasdol = 0; + temp = string_extract_double_quoted (value, &hasdol, 1); + } + else + temp = value; + + w = alloc_word_desc (); + hasdol = 0; + /* XXX was 0 not quoted */ + l = *temp ? expand_string_for_rhs (temp, quoted, &hasdol, (int *)NULL) + : (WORD_LIST *)0; + if (hasdollarat) + *hasdollarat = hasdol || (l && l->next); + if (temp != value) + free (temp); + if (l) + { + /* The expansion of TEMP returned something. We need to treat things + slightly differently if HASDOL is non-zero. If we have "$@", the + individual words have already been quoted. We need to turn them + into a string with the words separated by the first character of + $IFS without any additional quoting, so string_list_dollar_at won't + do the right thing. We use string_list_dollar_star instead. */ + temp = (hasdol || l->next) ? string_list_dollar_star (l) : string_list (l); + + /* If l->next is not null, we know that TEMP contained "$@", since that + is the only expansion that creates more than one word. */ + if (qdollaratp && ((hasdol && quoted) || l->next)) + *qdollaratp = 1; + /* If we have a quoted null result (QUOTED_NULL(temp)) and the word is + a quoted null (l->next == 0 && QUOTED_NULL(l->word->word)), the + flags indicate it (l->word->flags & W_HASQUOTEDNULL), and the + expansion is quoted (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + (which is more paranoia than anything else), we need to return the + quoted null string and set the flags to indicate it. */ + if (l->next == 0 && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && QUOTED_NULL (temp) && QUOTED_NULL (l->word->word) && (l->word->flags & W_HASQUOTEDNULL)) + { + w->flags |= W_HASQUOTEDNULL; + } + dispose_words (l); + } + else if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && hasdol) + { + /* The brace expansion occurred between double quotes and there was + a $@ in TEMP. It does not matter if the $@ is quoted, as long as + it does not expand to anything. In this case, we want to return + a quoted empty string. */ + temp = make_quoted_char ('\0'); + w->flags |= W_HASQUOTEDNULL; + } + else + temp = (char *)NULL; + + if (c == '-' || c == '+') + { + w->word = temp; + return w; + } + + /* c == '=' */ + t = temp ? savestring (temp) : savestring (""); + t1 = dequote_string (t); + free (t); +#if defined (ARRAY_VARS) + if (valid_array_reference (name)) + assign_array_element (name, t1, 0); + else +#endif /* ARRAY_VARS */ + bind_variable (name, t1, 0); +#if 0 + if (STREQ (name, "IFS") == 0) +#endif + stupidly_hack_special_variables (name); + + /* From Posix group discussion Feb-March 2010. Issue 7 0000221 */ + free (temp); + + w->word = t1; + return w; +} + +/* Deal with the right hand side of a ${name:?value} expansion in the case + that NAME is null or not set. If VALUE is non-null it is expanded and + used as the error message to print, otherwise a standard message is + printed. */ +static void +parameter_brace_expand_error (name, value) + char *name, *value; +{ + WORD_LIST *l; + char *temp; + + last_command_exit_value = EXECUTION_FAILURE; /* ensure it's non-zero */ + if (value && *value) + { + l = expand_string (value, 0); + temp = string_list (l); + report_error ("%s: %s", name, temp ? temp : ""); /* XXX was value not "" */ + FREE (temp); + dispose_words (l); + } + else + report_error (_("%s: parameter null or not set"), name); + + /* Free the data we have allocated during this expansion, since we + are about to longjmp out. */ + free (name); + FREE (value); +} + +/* Return 1 if NAME is something for which parameter_brace_expand_length is + OK to do. */ +static int +valid_length_expression (name) + char *name; +{ + return (name[1] == '\0' || /* ${#} */ + ((sh_syntaxtab[(unsigned char) name[1]] & CSPECVAR) && name[2] == '\0') || /* special param */ + (DIGIT (name[1]) && all_digits (name + 1)) || /* ${#11} */ +#if defined (ARRAY_VARS) + valid_array_reference (name + 1) || /* ${#a[7]} */ +#endif + legal_identifier (name + 1)); /* ${#PS1} */ +} + +/* Handle the parameter brace expansion that requires us to return the + length of a parameter. */ +static intmax_t +parameter_brace_expand_length (name) + char *name; +{ + char *t, *newname; + intmax_t number, arg_index; + WORD_LIST *list; +#if defined (ARRAY_VARS) + SHELL_VAR *var; +#endif + + if (name[1] == '\0') /* ${#} */ + number = number_of_args (); + else if ((name[1] == '@' || name[1] == '*') && name[2] == '\0') /* ${#@}, ${#*} */ + number = number_of_args (); + else if ((sh_syntaxtab[(unsigned char) name[1]] & CSPECVAR) && name[2] == '\0') + { + /* Take the lengths of some of the shell's special parameters. */ + switch (name[1]) + { + case '-': + t = which_set_flags (); + break; + case '?': + t = itos (last_command_exit_value); + break; + case '$': + t = itos (dollar_dollar_pid); + break; + case '!': + if (last_asynchronous_pid == NO_PID) + t = (char *)NULL; /* XXX - error if set -u set? */ + else + t = itos (last_asynchronous_pid); + break; + case '#': + t = itos (number_of_args ()); + break; + } + number = STRLEN (t); + FREE (t); + } +#if defined (ARRAY_VARS) + else if (valid_array_reference (name + 1)) + number = array_length_reference (name + 1); +#endif /* ARRAY_VARS */ + else + { + number = 0; + + if (legal_number (name + 1, &arg_index)) /* ${#1} */ + { + t = get_dollar_var_value (arg_index); + if (t == 0 && unbound_vars_is_error) + return INTMAX_MIN; + number = MB_STRLEN (t); + FREE (t); + } +#if defined (ARRAY_VARS) + else if ((var = find_variable (name + 1)) && (invisible_p (var) == 0) && (array_p (var) || assoc_p (var))) + { + if (assoc_p (var)) + t = assoc_reference (assoc_cell (var), "0"); + else + t = array_reference (array_cell (var), 0); + if (t == 0 && unbound_vars_is_error) + return INTMAX_MIN; + number = MB_STRLEN (t); + } +#endif + else /* ${#PS1} */ + { + newname = savestring (name); + newname[0] = '$'; + list = expand_string (newname, Q_DOUBLE_QUOTES); + t = list ? string_list (list) : (char *)NULL; + free (newname); + if (list) + dispose_words (list); + + number = t ? MB_STRLEN (t) : 0; + FREE (t); + } + } + + return (number); +} + +/* Skip characters in SUBSTR until DELIM. SUBSTR is an arithmetic expression, + so we do some ad-hoc parsing of an arithmetic expression to find + the first DELIM, instead of using strchr(3). Two rules: + 1. If the substring contains a `(', read until closing `)'. + 2. If the substring contains a `?', read past one `:' for each `?'. +*/ + +static char * +skiparith (substr, delim) + char *substr; + int delim; +{ + size_t sublen; + int skipcol, pcount, i; + DECLARE_MBSTATE; + + sublen = strlen (substr); + i = skipcol = pcount = 0; + while (substr[i]) + { + /* Balance parens */ + if (substr[i] == LPAREN) + { + pcount++; + i++; + continue; + } + if (substr[i] == RPAREN && pcount) + { + pcount--; + i++; + continue; + } + if (pcount) + { + ADVANCE_CHAR (substr, sublen, i); + continue; + } + + /* Skip one `:' for each `?' */ + if (substr[i] == ':' && skipcol) + { + skipcol--; + i++; + continue; + } + if (substr[i] == delim) + break; + if (substr[i] == '?') + { + skipcol++; + i++; + continue; + } + ADVANCE_CHAR (substr, sublen, i); + } + + return (substr + i); +} + +/* Verify and limit the start and end of the desired substring. If + VTYPE == 0, a regular shell variable is being used; if it is 1, + then the positional parameters are being used; if it is 2, then + VALUE is really a pointer to an array variable that should be used. + Return value is 1 if both values were OK, 0 if there was a problem + with an invalid expression, or -1 if the values were out of range. */ +static int +verify_substring_values (v, value, substr, vtype, e1p, e2p) + SHELL_VAR *v; + char *value, *substr; + int vtype; + intmax_t *e1p, *e2p; +{ + char *t, *temp1, *temp2; + arrayind_t len; + int expok; +#if defined (ARRAY_VARS) + ARRAY *a; + HASH_TABLE *h; +#endif + + /* duplicate behavior of strchr(3) */ + t = skiparith (substr, ':'); + if (*t && *t == ':') + *t = '\0'; + else + t = (char *)0; + + temp1 = expand_arith_string (substr, Q_DOUBLE_QUOTES); + *e1p = evalexp (temp1, &expok); + free (temp1); + if (expok == 0) + return (0); + + len = -1; /* paranoia */ + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + len = MB_STRLEN (value); + break; + case VT_POSPARMS: + len = number_of_args () + 1; + if (*e1p == 0) + len++; /* add one arg if counting from $0 */ + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + /* For arrays, the first value deals with array indices. Negative + offsets count from one past the array's maximum index. Associative + arrays treat the number of elements as the maximum index. */ + if (assoc_p (v)) + { + h = assoc_cell (v); + len = assoc_num_elements (h) + (*e1p < 0); + } + else + { + a = (ARRAY *)value; + len = array_max_index (a) + (*e1p < 0); /* arrays index from 0 to n - 1 */ + } + break; +#endif + } + + if (len == -1) /* paranoia */ + return -1; + + if (*e1p < 0) /* negative offsets count from end */ + *e1p += len; + + if (*e1p > len || *e1p < 0) + return (-1); + +#if defined (ARRAY_VARS) + /* For arrays, the second offset deals with the number of elements. */ + if (vtype == VT_ARRAYVAR) + len = assoc_p (v) ? assoc_num_elements (h) : array_num_elements (a); +#endif + + if (t) + { + t++; + temp2 = savestring (t); + temp1 = expand_arith_string (temp2, Q_DOUBLE_QUOTES); + free (temp2); + t[-1] = ':'; + *e2p = evalexp (temp1, &expok); + free (temp1); + if (expok == 0) + return (0); +#if 1 + if ((vtype == VT_ARRAYVAR || vtype == VT_POSPARMS) && *e2p < 0) +#else + /* bash-4.3: allow positional parameter length < 0 to count backwards + from end of positional parameters */ + if (vtype == VT_ARRAYVAR && *e2p < 0) +#endif + { + internal_error (_("%s: substring expression < 0"), t); + return (0); + } +#if defined (ARRAY_VARS) + /* In order to deal with sparse arrays, push the intelligence about how + to deal with the number of elements desired down to the array- + specific functions. */ + if (vtype != VT_ARRAYVAR) +#endif + { + if (*e2p < 0) + { + *e2p += len; + if (*e2p < 0 || *e2p < *e1p) + { + internal_error (_("%s: substring expression < 0"), t); + return (0); + } + } + else + *e2p += *e1p; /* want E2 chars starting at E1 */ + if (*e2p > len) + *e2p = len; + } + } + else + *e2p = len; + + return (1); +} + +/* Return the type of variable specified by VARNAME (simple variable, + positional param, or array variable). Also return the value specified + by VARNAME (value of a variable or a reference to an array element). + QUOTED is the standard description of quoting state, using Q_* defines. + FLAGS is currently a set of flags to pass to array_value. If IND is + non-null and not INTMAX_MIN, and FLAGS includes AV_USEIND, IND is + passed to array_value so the array index is not computed again. + If this returns VT_VARIABLE, the caller assumes that CTLESC and CTLNUL + characters in the value are quoted with CTLESC and takes appropriate + steps. For convenience, *VALP is set to the dequoted VALUE. */ +static int +get_var_and_type (varname, value, ind, quoted, flags, varp, valp) + char *varname, *value; + arrayind_t ind; + int quoted, flags; + SHELL_VAR **varp; + char **valp; +{ + int vtype, want_indir; + char *temp, *vname; + WORD_DESC *wd; +#if defined (ARRAY_VARS) + SHELL_VAR *v; +#endif + arrayind_t lind; + + want_indir = *varname == '!' && + (legal_variable_starter ((unsigned char)varname[1]) || DIGIT (varname[1]) + || VALID_INDIR_PARAM (varname[1])); + if (want_indir) + vname = parameter_brace_find_indir (varname+1, SPECIAL_VAR (varname, 1), quoted, 1); + else + vname = varname; + + /* This sets vtype to VT_VARIABLE or VT_POSPARMS */ + vtype = (vname[0] == '@' || vname[0] == '*') && vname[1] == '\0'; + if (vtype == VT_POSPARMS && vname[0] == '*') + vtype |= VT_STARSUB; + *varp = (SHELL_VAR *)NULL; + +#if defined (ARRAY_VARS) + if (valid_array_reference (vname)) + { + v = array_variable_part (vname, &temp, (int *)0); + /* If we want to signal array_value to use an already-computed index, + set LIND to that index */ + lind = (ind != INTMAX_MIN && (flags & AV_USEIND)) ? ind : 0; + if (v && invisible_p (v)) + { + vtype = VT_ARRAYMEMBER; + *varp = (SHELL_VAR *)NULL; + *valp = (char *)NULL; + } + if (v && (array_p (v) || assoc_p (v))) + { /* [ */ + if (ALL_ELEMENT_SUB (temp[0]) && temp[1] == ']') + { + /* Callers have to differentiate between indexed and associative */ + vtype = VT_ARRAYVAR; + if (temp[0] == '*') + vtype |= VT_STARSUB; + *valp = array_p (v) ? (char *)array_cell (v) : (char *)assoc_cell (v); + } + else + { + vtype = VT_ARRAYMEMBER; + *valp = array_value (vname, Q_DOUBLE_QUOTES, flags, (int *)NULL, &lind); + } + *varp = v; + } + else if (v && (ALL_ELEMENT_SUB (temp[0]) && temp[1] == ']')) + { + vtype = VT_VARIABLE; + *varp = v; + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + *valp = dequote_string (value); + else + *valp = dequote_escapes (value); + } + else + { + vtype = VT_ARRAYMEMBER; + *varp = v; + *valp = array_value (vname, Q_DOUBLE_QUOTES, flags, (int *)NULL, &lind); + } + } + else if ((v = find_variable (vname)) && (invisible_p (v) == 0) && (assoc_p (v) || array_p (v))) + { + vtype = VT_ARRAYMEMBER; + *varp = v; + *valp = assoc_p (v) ? assoc_reference (assoc_cell (v), "0") : array_reference (array_cell (v), 0); + } + else +#endif + { + if (value && vtype == VT_VARIABLE) + { + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + *valp = dequote_string (value); + else + *valp = dequote_escapes (value); + } + else + *valp = value; + } + + if (want_indir) + free (vname); + + return vtype; +} + +/******************************************************/ +/* */ +/* Functions to extract substrings of variable values */ +/* */ +/******************************************************/ + +#if defined (HANDLE_MULTIBYTE) +/* Character-oriented rather than strictly byte-oriented substrings. S and + E, rather being strict indices into STRING, indicate character (possibly + multibyte character) positions that require calculation. + Used by the ${param:offset[:length]} expansion. */ +static char * +mb_substring (string, s, e) + char *string; + int s, e; +{ + char *tt; + int start, stop, i, slen; + DECLARE_MBSTATE; + + start = 0; + /* Don't need string length in ADVANCE_CHAR unless multibyte chars possible. */ + slen = (MB_CUR_MAX > 1) ? STRLEN (string) : 0; + + i = s; + while (string[start] && i--) + ADVANCE_CHAR (string, slen, start); + stop = start; + i = e - s; + while (string[stop] && i--) + ADVANCE_CHAR (string, slen, stop); + tt = substring (string, start, stop); + return tt; +} +#endif + +/* Process a variable substring expansion: ${name:e1[:e2]}. If VARNAME + is `@', use the positional parameters; otherwise, use the value of + VARNAME. If VARNAME is an array variable, use the array elements. */ + +static char * +parameter_brace_substring (varname, value, ind, substr, quoted, flags) + char *varname, *value; + int ind; + char *substr; + int quoted, flags; +{ + intmax_t e1, e2; + int vtype, r, starsub; + char *temp, *val, *tt, *oname; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + oname = this_command_name; + this_command_name = varname; + + vtype = get_var_and_type (varname, value, ind, quoted, flags, &v, &val); + if (vtype == -1) + { + this_command_name = oname; + return ((char *)NULL); + } + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + r = verify_substring_values (v, val, substr, vtype, &e1, &e2); + this_command_name = oname; + if (r <= 0) + { + if (vtype == VT_VARIABLE) + FREE (val); + return ((r == 0) ? &expand_param_error : (char *)NULL); + } + + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1) + tt = mb_substring (val, e1, e2); + else +#endif + tt = substring (val, e1, e2); + + if (vtype == VT_VARIABLE) + FREE (val); + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + temp = quote_string (tt); + else + temp = tt ? quote_escapes (tt) : (char *)NULL; + FREE (tt); + break; + case VT_POSPARMS: + tt = pos_params (varname, e1, e2, quoted); + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) == 0) + { + temp = tt ? quote_escapes (tt) : (char *)NULL; + FREE (tt); + } + else + temp = tt; + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + if (assoc_p (v)) + /* we convert to list and take first e2 elements starting at e1th + element -- officially undefined for now */ + temp = assoc_subrange (assoc_cell (v), e1, e2, starsub, quoted); + else + /* We want E2 to be the number of elements desired (arrays can be sparse, + so verify_substring_values just returns the numbers specified and we + rely on array_subrange to understand how to deal with them). */ + temp = array_subrange (array_cell (v), e1, e2, starsub, quoted); + /* array_subrange now calls array_quote_escapes as appropriate, so the + caller no longer needs to. */ + break; +#endif + default: + temp = (char *)NULL; + } + + return temp; +} + +/****************************************************************/ +/* */ +/* Functions to perform pattern substitution on variable values */ +/* */ +/****************************************************************/ + +static int +shouldexp_replacement (s) + char *s; +{ + register char *p; + + for (p = s; p && *p; p++) + { + if (*p == '\\') + p++; + else if (*p == '&') + return 1; + } + return 0; +} + +char * +pat_subst (string, pat, rep, mflags) + char *string, *pat, *rep; + int mflags; +{ + char *ret, *s, *e, *str, *rstr, *mstr; + int rsize, rptr, l, replen, mtype, rxpand, rslen, mlen; + + if (string == 0) + return (savestring ("")); + + mtype = mflags & MATCH_TYPEMASK; + +#if 0 /* bash-4.2 ? */ + rxpand = (rep && *rep) ? shouldexp_replacement (rep) : 0; +#else + rxpand = 0; +#endif + + /* Special cases: + * 1. A null pattern with mtype == MATCH_BEG means to prefix STRING + * with REP and return the result. + * 2. A null pattern with mtype == MATCH_END means to append REP to + * STRING and return the result. + * These don't understand or process `&' in the replacement string. + */ + if ((pat == 0 || *pat == 0) && (mtype == MATCH_BEG || mtype == MATCH_END)) + { + replen = STRLEN (rep); + l = STRLEN (string); + ret = (char *)xmalloc (replen + l + 2); + if (replen == 0) + strcpy (ret, string); + else if (mtype == MATCH_BEG) + { + strcpy (ret, rep); + strcpy (ret + replen, string); + } + else + { + strcpy (ret, string); + strcpy (ret + l, rep); + } + return (ret); + } + + ret = (char *)xmalloc (rsize = 64); + ret[0] = '\0'; + + for (replen = STRLEN (rep), rptr = 0, str = string;;) + { + if (match_pattern (str, pat, mtype, &s, &e) == 0) + break; + l = s - str; + + if (rxpand) + { + int x; + mlen = e - s; + mstr = xmalloc (mlen + 1); + for (x = 0; x < mlen; x++) + mstr[x] = s[x]; + mstr[mlen] = '\0'; + rstr = strcreplace (rep, '&', mstr, 0); + rslen = strlen (rstr); + } + else + { + rstr = rep; + rslen = replen; + } + + RESIZE_MALLOCED_BUFFER (ret, rptr, (l + rslen), rsize, 64); + + /* OK, now copy the leading unmatched portion of the string (from + str to s) to ret starting at rptr (the current offset). Then copy + the replacement string at ret + rptr + (s - str). Increment + rptr (if necessary) and str and go on. */ + if (l) + { + strncpy (ret + rptr, str, l); + rptr += l; + } + if (replen) + { + strncpy (ret + rptr, rstr, rslen); + rptr += rslen; + } + str = e; /* e == end of match */ + + if (rstr != rep) + free (rstr); + + if (((mflags & MATCH_GLOBREP) == 0) || mtype != MATCH_ANY) + break; + + if (s == e) + { + /* On a zero-length match, make sure we copy one character, since + we increment one character to avoid infinite recursion. */ + RESIZE_MALLOCED_BUFFER (ret, rptr, 1, rsize, 64); + ret[rptr++] = *str++; + e++; /* avoid infinite recursion on zero-length match */ + } + } + + /* Now copy the unmatched portion of the input string */ + if (str && *str) + { + RESIZE_MALLOCED_BUFFER (ret, rptr, STRLEN(str) + 1, rsize, 64); + strcpy (ret + rptr, str); + } + else + ret[rptr] = '\0'; + + return ret; +} + +/* Do pattern match and replacement on the positional parameters. */ +static char * +pos_params_pat_subst (string, pat, rep, mflags) + char *string, *pat, *rep; + int mflags; +{ + WORD_LIST *save, *params; + WORD_DESC *w; + char *ret; + int pchar, qflags; + + save = params = list_rest_of_args (); + if (save == 0) + return ((char *)NULL); + + for ( ; params; params = params->next) + { + ret = pat_subst (params->word->word, pat, rep, mflags); + w = alloc_word_desc (); + w->word = ret ? ret : savestring (""); + dispose_word (params->word); + params->word = w; + } + + pchar = (mflags & MATCH_STARSUB) == MATCH_STARSUB ? '*' : '@'; + qflags = (mflags & MATCH_QUOTED) == MATCH_QUOTED ? Q_DOUBLE_QUOTES : 0; + + ret = string_list_pos_params (pchar, save, qflags); + + dispose_words (save); + + return (ret); +} + +/* Perform pattern substitution on VALUE, which is the expansion of + VARNAME. PATSUB is an expression supplying the pattern to match + and the string to substitute. QUOTED is a flags word containing + the type of quoting currently in effect. */ +static char * +parameter_brace_patsub (varname, value, ind, patsub, quoted, flags) + char *varname, *value; + int ind; + char *patsub; + int quoted, flags; +{ + int vtype, mflags, starsub, delim; + char *val, *temp, *pat, *rep, *p, *lpatsub, *tt; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + this_command_name = varname; + + vtype = get_var_and_type (varname, value, ind, quoted, flags, &v, &val); + if (vtype == -1) + return ((char *)NULL); + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + mflags = 0; + /* PATSUB is never NULL when this is called. */ + if (*patsub == '/') + { + mflags |= MATCH_GLOBREP; + patsub++; + } + + /* Malloc this because expand_string_if_necessary or one of the expansion + functions in its call chain may free it on a substitution error. */ + lpatsub = savestring (patsub); + + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + mflags |= MATCH_QUOTED; + + if (starsub) + mflags |= MATCH_STARSUB; + + /* If the pattern starts with a `/', make sure we skip over it when looking + for the replacement delimiter. */ + delim = skip_to_delim (lpatsub, ((*patsub == '/') ? 1 : 0), "/", 0); + if (lpatsub[delim] == '/') + { + lpatsub[delim] = 0; + rep = lpatsub + delim + 1; + } + else + rep = (char *)NULL; + + if (rep && *rep == '\0') + rep = (char *)NULL; + + /* Perform the same expansions on the pattern as performed by the + pattern removal expansions. */ + pat = getpattern (lpatsub, quoted, 1); + + if (rep) + { + /* We want to perform quote removal on the expanded replacement even if + the entire expansion is double-quoted because the parser and string + extraction functions treated quotes in the replacement string as + special. THIS IS NOT BACKWARDS COMPATIBLE WITH BASH-4.2. */ + if (shell_compatibility_level > 42) + rep = expand_string_if_necessary (rep, quoted & ~(Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT), expand_string_unsplit); + /* This is the bash-4.2 code. */ + else if ((mflags & MATCH_QUOTED) == 0) + rep = expand_string_if_necessary (rep, quoted, expand_string_unsplit); + else + rep = expand_string_to_string_internal (rep, quoted, expand_string_unsplit); + } + + /* ksh93 doesn't allow the match specifier to be a part of the expanded + pattern. This is an extension. Make sure we don't anchor the pattern + at the beginning or end of the string if we're doing global replacement, + though. */ + p = pat; + if (mflags & MATCH_GLOBREP) + mflags |= MATCH_ANY; + else if (pat && pat[0] == '#') + { + mflags |= MATCH_BEG; + p++; + } + else if (pat && pat[0] == '%') + { + mflags |= MATCH_END; + p++; + } + else + mflags |= MATCH_ANY; + + /* OK, we now want to substitute REP for PAT in VAL. If + flags & MATCH_GLOBREP is non-zero, the substitution is done + everywhere, otherwise only the first occurrence of PAT is + replaced. The pattern matching code doesn't understand + CTLESC quoting CTLESC and CTLNUL so we use the dequoted variable + values passed in (VT_VARIABLE) so the pattern substitution + code works right. We need to requote special chars after + we're done for VT_VARIABLE and VT_ARRAYMEMBER, and for the + other cases if QUOTED == 0, since the posparams and arrays + indexed by * or @ do special things when QUOTED != 0. */ + + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + temp = pat_subst (val, p, rep, mflags); + if (vtype == VT_VARIABLE) + FREE (val); + if (temp) + { + tt = (mflags & MATCH_QUOTED) ? quote_string (temp) : quote_escapes (temp); + free (temp); + temp = tt; + } + break; + case VT_POSPARMS: + temp = pos_params_pat_subst (val, p, rep, mflags); + if (temp && (mflags & MATCH_QUOTED) == 0) + { + tt = quote_escapes (temp); + free (temp); + temp = tt; + } + break; +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + temp = assoc_p (v) ? assoc_patsub (assoc_cell (v), p, rep, mflags) + : array_patsub (array_cell (v), p, rep, mflags); + /* Don't call quote_escapes anymore; array_patsub calls + array_quote_escapes as appropriate before adding the + space separators; ditto for assoc_patsub. */ + break; +#endif + } + + FREE (pat); + FREE (rep); + free (lpatsub); + + return temp; +} + +/****************************************************************/ +/* */ +/* Functions to perform case modification on variable values */ +/* */ +/****************************************************************/ + +/* Do case modification on the positional parameters. */ + +static char * +pos_params_modcase (string, pat, modop, mflags) + char *string, *pat; + int modop; + int mflags; +{ + WORD_LIST *save, *params; + WORD_DESC *w; + char *ret; + int pchar, qflags; + + save = params = list_rest_of_args (); + if (save == 0) + return ((char *)NULL); + + for ( ; params; params = params->next) + { + ret = sh_modcase (params->word->word, pat, modop); + w = alloc_word_desc (); + w->word = ret ? ret : savestring (""); + dispose_word (params->word); + params->word = w; + } + + pchar = (mflags & MATCH_STARSUB) == MATCH_STARSUB ? '*' : '@'; + qflags = (mflags & MATCH_QUOTED) == MATCH_QUOTED ? Q_DOUBLE_QUOTES : 0; + + ret = string_list_pos_params (pchar, save, qflags); + dispose_words (save); + + return (ret); +} + +/* Perform case modification on VALUE, which is the expansion of + VARNAME. MODSPEC is an expression supplying the type of modification + to perform. QUOTED is a flags word containing the type of quoting + currently in effect. */ +static char * +parameter_brace_casemod (varname, value, ind, modspec, patspec, quoted, flags) + char *varname, *value; + int ind, modspec; + char *patspec; + int quoted, flags; +{ + int vtype, starsub, modop, mflags, x; + char *val, *temp, *pat, *p, *lpat, *tt; + SHELL_VAR *v; + + if (value == 0) + return ((char *)NULL); + + this_command_name = varname; + + vtype = get_var_and_type (varname, value, ind, quoted, flags, &v, &val); + if (vtype == -1) + return ((char *)NULL); + + starsub = vtype & VT_STARSUB; + vtype &= ~VT_STARSUB; + + modop = 0; + mflags = 0; + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + mflags |= MATCH_QUOTED; + if (starsub) + mflags |= MATCH_STARSUB; + + p = patspec; + if (modspec == '^') + { + x = p && p[0] == modspec; + modop = x ? CASE_UPPER : CASE_UPFIRST; + p += x; + } + else if (modspec == ',') + { + x = p && p[0] == modspec; + modop = x ? CASE_LOWER : CASE_LOWFIRST; + p += x; + } + else if (modspec == '~') + { + x = p && p[0] == modspec; + modop = x ? CASE_TOGGLEALL : CASE_TOGGLE; + p += x; + } + + lpat = p ? savestring (p) : 0; + /* Perform the same expansions on the pattern as performed by the + pattern removal expansions. FOR LATER */ + pat = lpat ? getpattern (lpat, quoted, 1) : 0; + + /* OK, now we do the case modification. */ + switch (vtype) + { + case VT_VARIABLE: + case VT_ARRAYMEMBER: + temp = sh_modcase (val, pat, modop); + if (vtype == VT_VARIABLE) + FREE (val); + if (temp) + { + tt = (mflags & MATCH_QUOTED) ? quote_string (temp) : quote_escapes (temp); + free (temp); + temp = tt; + } + break; + + case VT_POSPARMS: + temp = pos_params_modcase (val, pat, modop, mflags); + if (temp && (mflags & MATCH_QUOTED) == 0) + { + tt = quote_escapes (temp); + free (temp); + temp = tt; + } + break; + +#if defined (ARRAY_VARS) + case VT_ARRAYVAR: + temp = assoc_p (v) ? assoc_modcase (assoc_cell (v), pat, modop, mflags) + : array_modcase (array_cell (v), pat, modop, mflags); + /* Don't call quote_escapes; array_modcase calls array_quote_escapes + as appropriate before adding the space separators; ditto for + assoc_modcase. */ + break; +#endif + } + + FREE (pat); + free (lpat); + + return temp; +} + +/* Check for unbalanced parens in S, which is the contents of $(( ... )). If + any occur, this must be a nested command substitution, so return 0. + Otherwise, return 1. A valid arithmetic expression must always have a + ( before a matching ), so any cases where there are more right parens + means that this must not be an arithmetic expression, though the parser + will not accept it without a balanced total number of parens. */ +static int +chk_arithsub (s, len) + const char *s; + int len; +{ + int i, count; + DECLARE_MBSTATE; + + i = count = 0; + while (i < len) + { + if (s[i] == LPAREN) + count++; + else if (s[i] == RPAREN) + { + count--; + if (count < 0) + return 0; + } + + switch (s[i]) + { + default: + ADVANCE_CHAR (s, len, i); + break; + + case '\\': + i++; + if (s[i]) + ADVANCE_CHAR (s, len, i); + break; + + case '\'': + i = skip_single_quoted (s, len, ++i); + break; + + case '"': + i = skip_double_quoted ((char *)s, len, ++i); + break; + } + } + + return (count == 0); +} + +/****************************************************************/ +/* */ +/* Functions to perform parameter expansion on a string */ +/* */ +/****************************************************************/ + +/* ${[#][!]name[[:][^[^]][,[,]]#[#]%[%]-=?+[word][:e1[:e2]]]} */ +static WORD_DESC * +parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, contains_dollar_at) + char *string; + int *indexp, quoted, *quoted_dollar_atp, *contains_dollar_at, pflags; +{ + int check_nullness, var_is_set, var_is_null, var_is_special; + int want_substring, want_indir, want_patsub, want_casemod; + char *name, *value, *temp, *temp1; + WORD_DESC *tdesc, *ret; + int t_index, sindex, c, tflag, modspec; + intmax_t number; + arrayind_t ind; + + temp = temp1 = value = (char *)NULL; + var_is_set = var_is_null = var_is_special = check_nullness = 0; + want_substring = want_indir = want_patsub = want_casemod = 0; + + sindex = *indexp; + t_index = ++sindex; + /* ${#var} doesn't have any of the other parameter expansions on it. */ + if (string[t_index] == '#' && legal_variable_starter (string[t_index+1])) /* {{ */ + name = string_extract (string, &t_index, "}", SX_VARNAME); + else +#if defined (CASEMOD_EXPANSIONS) + /* To enable case-toggling expansions using the `~' operator character + change the 1 to 0. */ +# if defined (CASEMOD_CAPCASE) + name = string_extract (string, &t_index, "#%^,~:-=?+/}", SX_VARNAME); +# else + name = string_extract (string, &t_index, "#%^,:-=?+/}", SX_VARNAME); +# endif /* CASEMOD_CAPCASE */ +#else + name = string_extract (string, &t_index, "#%:-=?+/}", SX_VARNAME); +#endif /* CASEMOD_EXPANSIONS */ + + ret = 0; + tflag = 0; + + ind = INTMAX_MIN; + + /* If the name really consists of a special variable, then make sure + that we have the entire name. We don't allow indirect references + to special variables except `#', `?', `@' and `*'. */ + if ((sindex == t_index && VALID_SPECIAL_LENGTH_PARAM (string[t_index])) || + (sindex == t_index - 1 && string[sindex] == '!' && VALID_INDIR_PARAM (string[t_index]))) + { + t_index++; + temp1 = string_extract (string, &t_index, "#%:-=?+/}", 0); + name = (char *)xrealloc (name, 3 + (strlen (temp1))); + *name = string[sindex]; + if (string[sindex] == '!') + { + /* indirect reference of $#, $?, $@, or $* */ + name[1] = string[sindex + 1]; + strcpy (name + 2, temp1); + } + else + strcpy (name + 1, temp1); + free (temp1); + } + sindex = t_index; + + /* Find out what character ended the variable name. Then + do the appropriate thing. */ + if (c = string[sindex]) + sindex++; + + /* If c is followed by one of the valid parameter expansion + characters, move past it as normal. If not, assume that + a substring specification is being given, and do not move + past it. */ + if (c == ':' && VALID_PARAM_EXPAND_CHAR (string[sindex])) + { + check_nullness++; + if (c = string[sindex]) + sindex++; + } + else if (c == ':' && string[sindex] != RBRACE) + want_substring = 1; + else if (c == '/' /* && string[sindex] != RBRACE */) /* XXX */ + want_patsub = 1; +#if defined (CASEMOD_EXPANSIONS) + else if (c == '^' || c == ',' || c == '~') + { + modspec = c; + want_casemod = 1; + } +#endif + + /* Catch the valid and invalid brace expressions that made it through the + tests above. */ + /* ${#-} is a valid expansion and means to take the length of $-. + Similarly for ${#?} and ${##}... */ + if (name[0] == '#' && name[1] == '\0' && check_nullness == 0 && + VALID_SPECIAL_LENGTH_PARAM (c) && string[sindex] == RBRACE) + { + name = (char *)xrealloc (name, 3); + name[1] = c; + name[2] = '\0'; + c = string[sindex++]; + } + + /* ...but ${#%}, ${#:}, ${#=}, ${#+}, and ${#/} are errors. */ + if (name[0] == '#' && name[1] == '\0' && check_nullness == 0 && + member (c, "%:=+/") && string[sindex] == RBRACE) + { + temp = (char *)NULL; + goto bad_substitution; + } + + /* Indirect expansion begins with a `!'. A valid indirect expansion is + either a variable name, one of the positional parameters or a special + variable that expands to one of the positional parameters. */ + want_indir = *name == '!' && + (legal_variable_starter ((unsigned char)name[1]) || DIGIT (name[1]) + || VALID_INDIR_PARAM (name[1])); + + /* Determine the value of this variable. */ + + /* Check for special variables, directly referenced. */ + if (SPECIAL_VAR (name, want_indir)) + var_is_special++; + + /* Check for special expansion things, like the length of a parameter */ + if (*name == '#' && name[1]) + { + /* If we are not pointing at the character just after the + closing brace, then we haven't gotten all of the name. + Since it begins with a special character, this is a bad + substitution. Also check NAME for validity before trying + to go on. */ + if (string[sindex - 1] != RBRACE || (valid_length_expression (name) == 0)) + { + temp = (char *)NULL; + goto bad_substitution; + } + + number = parameter_brace_expand_length (name); + if (number == INTMAX_MIN && unbound_vars_is_error) + { + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (name+1); + free (name); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + free (name); + + *indexp = sindex; + if (number < 0) + return (&expand_wdesc_error); + else + { + ret = alloc_word_desc (); + ret->word = itos (number); + return ret; + } + } + + /* ${@} is identical to $@. */ + if (name[0] == '@' && name[1] == '\0') + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + + if (contains_dollar_at) + *contains_dollar_at = 1; + + tflag |= W_DOLLARAT; + } + + /* Process ${!PREFIX*} expansion. */ + if (want_indir && string[sindex - 1] == RBRACE && + (string[sindex - 2] == '*' || string[sindex - 2] == '@') && + legal_variable_starter ((unsigned char) name[1])) + { + char **x; + WORD_LIST *xlist; + + temp1 = savestring (name + 1); + number = strlen (temp1); + temp1[number - 1] = '\0'; + x = all_variables_matching_prefix (temp1); + xlist = strvec_to_word_list (x, 0, 0); + if (string[sindex - 2] == '*') + temp = string_list_dollar_star (xlist); + else + { + temp = string_list_dollar_at (xlist, quoted); + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + + tflag |= W_DOLLARAT; + } + free (x); + dispose_words (xlist); + free (temp1); + *indexp = sindex; + + free (name); + + ret = alloc_word_desc (); + ret->word = temp; + ret->flags = tflag; /* XXX */ + return ret; + } + +#if defined (ARRAY_VARS) + /* Process ${!ARRAY[@]} and ${!ARRAY[*]} expansion. */ /* [ */ + if (want_indir && string[sindex - 1] == RBRACE && + string[sindex - 2] == ']' && valid_array_reference (name+1)) + { + char *x, *x1; + + temp1 = savestring (name + 1); + x = array_variable_name (temp1, &x1, (int *)0); /* [ */ + FREE (x); + if (ALL_ELEMENT_SUB (x1[0]) && x1[1] == ']') + { + temp = array_keys (temp1, quoted); /* handles assoc vars too */ + if (x1[0] == '@') + { + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + + tflag |= W_DOLLARAT; + } + + free (temp1); + *indexp = sindex; + + ret = alloc_word_desc (); + ret->word = temp; + ret->flags = tflag; /* XXX */ + return ret; + } + + free (temp1); + } +#endif /* ARRAY_VARS */ + + /* Make sure that NAME is valid before trying to go on. */ + if (valid_brace_expansion_word (want_indir ? name + 1 : name, + var_is_special) == 0) + { + temp = (char *)NULL; + goto bad_substitution; + } + + if (want_indir) + { + tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at); + /* Turn off the W_ARRAYIND flag because there is no way for this function + to return the index we're supposed to be using. */ + if (tdesc && tdesc->flags) + tdesc->flags &= ~W_ARRAYIND; + } + else + tdesc = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND|(pflags&(PF_NOSPLIT2|PF_ASSIGNRHS)), &ind); + + if (tdesc) + { + temp = tdesc->word; + tflag = tdesc->flags; + dispose_word_desc (tdesc); + } + else + temp = (char *)0; + + if (temp == &expand_param_error || temp == &expand_param_fatal) + { + FREE (name); + FREE (value); + return (temp == &expand_param_error ? &expand_wdesc_error : &expand_wdesc_fatal); + } + +#if defined (ARRAY_VARS) + if (valid_array_reference (name)) + chk_atstar (name, quoted, quoted_dollar_atp, contains_dollar_at); +#endif + + var_is_set = temp != (char *)0; + var_is_null = check_nullness && (var_is_set == 0 || *temp == 0); + /* XXX - this may not need to be restricted to special variables */ + if (check_nullness) + var_is_null |= var_is_set && var_is_special && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && QUOTED_NULL (temp); + + /* Get the rest of the stuff inside the braces. */ + if (c && c != RBRACE) + { + /* Extract the contents of the ${ ... } expansion + according to the Posix.2 rules. */ + value = extract_dollar_brace_string (string, &sindex, quoted, (c == '%' || c == '#' || c =='/' || c == '^' || c == ',' || c ==':') ? SX_POSIXEXP|SX_WORD : SX_WORD); + if (string[sindex] == RBRACE) + sindex++; + else + goto bad_substitution; + } + else + value = (char *)NULL; + + *indexp = sindex; + + /* All the cases where an expansion can possibly generate an unbound + variable error. */ + if (want_substring || want_patsub || want_casemod || c == '#' || c == '%' || c == RBRACE) + { + if (var_is_set == 0 && unbound_vars_is_error && ((name[0] != '@' && name[0] != '*') || name[1])) + { + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (name); + FREE (value); + FREE (temp); + free (name); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + } + + /* If this is a substring spec, process it and add the result. */ + if (want_substring) + { + temp1 = parameter_brace_substring (name, temp, ind, value, quoted, (tflag & W_ARRAYIND) ? AV_USEIND : 0); + FREE (name); + FREE (value); + FREE (temp); + + if (temp1 == &expand_param_error) + return (&expand_wdesc_error); + else if (temp1 == &expand_param_fatal) + return (&expand_wdesc_fatal); + + ret = alloc_word_desc (); + ret->word = temp1; + /* We test quoted_dollar_atp because we want variants with double-quoted + "$@" to take a different code path. In fact, we make sure at the end + of expand_word_internal that we're only looking at these flags if + quoted_dollar_at == 0. */ + if (temp1 && + (quoted_dollar_atp == 0 || *quoted_dollar_atp == 0) && + QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ret->flags |= W_QUOTED|W_HASQUOTEDNULL; + return ret; + } + else if (want_patsub) + { + temp1 = parameter_brace_patsub (name, temp, ind, value, quoted, (tflag & W_ARRAYIND) ? AV_USEIND : 0); + FREE (name); + FREE (value); + FREE (temp); + + if (temp1 == &expand_param_error) + return (&expand_wdesc_error); + else if (temp1 == &expand_param_fatal) + return (&expand_wdesc_fatal); + + ret = alloc_word_desc (); + ret->word = temp1; + if (temp1 && + (quoted_dollar_atp == 0 || *quoted_dollar_atp == 0) && + QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ret->flags |= W_QUOTED|W_HASQUOTEDNULL; + return ret; + } +#if defined (CASEMOD_EXPANSIONS) + else if (want_casemod) + { + temp1 = parameter_brace_casemod (name, temp, ind, modspec, value, quoted, (tflag & W_ARRAYIND) ? AV_USEIND : 0); + FREE (name); + FREE (value); + FREE (temp); + + if (temp1 == &expand_param_error) + return (&expand_wdesc_error); + else if (temp1 == &expand_param_fatal) + return (&expand_wdesc_fatal); + + ret = alloc_word_desc (); + ret->word = temp1; + if (temp1 && + (quoted_dollar_atp == 0 || *quoted_dollar_atp == 0) && + QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ret->flags |= W_QUOTED|W_HASQUOTEDNULL; + return ret; + } +#endif + + /* Do the right thing based on which character ended the variable name. */ + switch (c) + { + default: + case '\0': + bad_substitution: + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("%s: bad substitution"), string ? string : "??"); + FREE (value); + FREE (temp); + free (name); + return &expand_wdesc_error; + + case RBRACE: + break; + + case '#': /* ${param#[#]pattern} */ + case '%': /* ${param%[%]pattern} */ + if (value == 0 || *value == '\0' || temp == 0 || *temp == '\0') + { + FREE (value); + break; + } + temp1 = parameter_brace_remove_pattern (name, temp, ind, value, c, quoted, (tflag & W_ARRAYIND) ? AV_USEIND : 0); + free (temp); + free (value); + free (name); + + ret = alloc_word_desc (); + ret->word = temp1; + if (temp1 && QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ret->flags |= W_QUOTED|W_HASQUOTEDNULL; + return ret; + + case '-': + case '=': + case '?': + case '+': + if (var_is_set && var_is_null == 0) + { + /* If the operator is `+', we don't want the value of the named + variable for anything, just the value of the right hand side. */ + if (c == '+') + { + /* XXX -- if we're double-quoted and the named variable is "$@", + we want to turn off any special handling of "$@" -- + we're not using it, so whatever is on the rhs applies. */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 0; + if (contains_dollar_at) + *contains_dollar_at = 0; + + FREE (temp); + if (value) + { + /* From Posix discussion on austin-group list. Issue 221 + requires that backslashes escaping `}' inside + double-quoted ${...} be removed. */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + quoted |= Q_DOLBRACE; + ret = parameter_brace_expand_rhs (name, value, c, + quoted, + quoted_dollar_atp, + contains_dollar_at); + /* XXX - fix up later, esp. noting presence of + W_HASQUOTEDNULL in ret->flags */ + free (value); + } + else + temp = (char *)NULL; + } + else + { + FREE (value); + } + /* Otherwise do nothing; just use the value in TEMP. */ + } + else /* VAR not set or VAR is NULL. */ + { + FREE (temp); + temp = (char *)NULL; + if (c == '=' && var_is_special) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("$%s: cannot assign in this way"), name); + free (name); + free (value); + return &expand_wdesc_error; + } + else if (c == '?') + { + parameter_brace_expand_error (name, value); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + else if (c != '+') + { + /* XXX -- if we're double-quoted and the named variable is "$@", + we want to turn off any special handling of "$@" -- + we're not using it, so whatever is on the rhs applies. */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && quoted_dollar_atp) + *quoted_dollar_atp = 0; + if (contains_dollar_at) + *contains_dollar_at = 0; + + /* From Posix discussion on austin-group list. Issue 221 requires + that backslashes escaping `}' inside double-quoted ${...} be + removed. */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + quoted |= Q_DOLBRACE; + ret = parameter_brace_expand_rhs (name, value, c, quoted, + quoted_dollar_atp, + contains_dollar_at); + /* XXX - fix up later, esp. noting presence of + W_HASQUOTEDNULL in tdesc->flags */ + } + free (value); + } + + break; + } + free (name); + + if (ret == 0) + { + ret = alloc_word_desc (); + ret->flags = tflag; + ret->word = temp; + } + return (ret); +} + +/* Expand a single ${xxx} expansion. The braces are optional. When + the braces are used, parameter_brace_expand() does the work, + possibly calling param_expand recursively. */ +static WORD_DESC * +param_expand (string, sindex, quoted, expanded_something, + contains_dollar_at, quoted_dollar_at_p, had_quoted_null_p, + pflags) + char *string; + int *sindex, quoted, *expanded_something, *contains_dollar_at; + int *quoted_dollar_at_p, *had_quoted_null_p, pflags; +{ + char *temp, *temp1, uerror[3]; + int zindex, t_index, expok; + unsigned char c; + intmax_t number; + SHELL_VAR *var; + WORD_LIST *list; + WORD_DESC *tdesc, *ret; + int tflag; + + zindex = *sindex; + c = string[++zindex]; + + temp = (char *)NULL; + ret = tdesc = (WORD_DESC *)NULL; + tflag = 0; + + /* Do simple cases first. Switch on what follows '$'. */ + switch (c) + { + /* $0 .. $9? */ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + temp1 = dollar_vars[TODIGIT (c)]; + if (unbound_vars_is_error && temp1 == (char *)NULL) + { + uerror[0] = '$'; + uerror[1] = c; + uerror[2] = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (uerror); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + if (temp1) + temp = (*temp1 && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ? quote_string (temp1) + : quote_escapes (temp1); + else + temp = (char *)NULL; + + break; + + /* $$ -- pid of the invoking shell. */ + case '$': + temp = itos (dollar_dollar_pid); + break; + + /* $# -- number of positional parameters. */ + case '#': + temp = itos (number_of_args ()); + break; + + /* $? -- return value of the last synchronous command. */ + case '?': + temp = itos (last_command_exit_value); + break; + + /* $- -- flags supplied to the shell on invocation or by `set'. */ + case '-': + temp = which_set_flags (); + break; + + /* $! -- Pid of the last asynchronous command. */ + case '!': + /* If no asynchronous pids have been created, expand to nothing. + If `set -u' has been executed, and no async processes have + been created, this is an expansion error. */ + if (last_asynchronous_pid == NO_PID) + { + if (expanded_something) + *expanded_something = 0; + temp = (char *)NULL; + if (unbound_vars_is_error) + { + uerror[0] = '$'; + uerror[1] = c; + uerror[2] = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (uerror); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } + } + else + temp = itos (last_asynchronous_pid); + break; + + /* The only difference between this and $@ is when the arg is quoted. */ + case '*': /* `$*' */ + list = list_rest_of_args (); + +#if 0 + /* According to austin-group posix proposal by Geoff Clare in + <20090505091501.GA10097@squonk.masqnet> of 5 May 2009: + + "The shell shall write a message to standard error and + immediately exit when it tries to expand an unset parameter + other than the '@' and '*' special parameters." + */ + + if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) + { + uerror[0] = '$'; + uerror[1] = '*'; + uerror[2] = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (uerror); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } +#endif + + /* If there are no command-line arguments, this should just + disappear if there are other characters in the expansion, + even if it's quoted. */ + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && list == 0) + temp = (char *)NULL; + else if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES|Q_PATQUOTE)) + { + /* If we have "$*" we want to make a string of the positional + parameters, separated by the first character of $IFS, and + quote the whole string, including the separators. If IFS + is unset, the parameters are separated by ' '; if $IFS is + null, the parameters are concatenated. */ + temp = (quoted & (Q_DOUBLE_QUOTES|Q_PATQUOTE)) ? string_list_dollar_star (list) : string_list (list); + if (temp) + { + temp1 = quote_string (temp); + if (*temp == 0) + tflag |= W_HASQUOTEDNULL; + free (temp); + temp = temp1; + } + } + else + { + /* We check whether or not we're eventually going to split $* here, + for example when IFS is empty and we are processing the rhs of + an assignment statement. In that case, we don't separate the + arguments at all. Otherwise, if the $* is not quoted it is + identical to $@ */ +# if defined (HANDLE_MULTIBYTE) + if (expand_no_split_dollar_star && ifs_firstc[0] == 0) +# else + if (expand_no_split_dollar_star && ifs_firstc == 0) +# endif + temp = string_list_dollar_star (list); + else + { + temp = string_list_dollar_at (list, quoted); + if (quoted == 0 && (ifs_is_set == 0 || ifs_is_null)) + tflag |= W_SPLITSPACE; + } + + if (expand_no_split_dollar_star == 0 && contains_dollar_at) + *contains_dollar_at = 1; + } + + dispose_words (list); + break; + + /* When we have "$@" what we want is "$1" "$2" "$3" ... This + means that we have to turn quoting off after we split into + the individually quoted arguments so that the final split + on the first character of $IFS is still done. */ + case '@': /* `$@' */ + list = list_rest_of_args (); + +#if 0 + /* According to austin-group posix proposal by Geoff Clare in + <20090505091501.GA10097@squonk.masqnet> of 5 May 2009: + + "The shell shall write a message to standard error and + immediately exit when it tries to expand an unset parameter + other than the '@' and '*' special parameters." + */ + + if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) + { + uerror[0] = '$'; + uerror[1] = '@'; + uerror[2] = '\0'; + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (uerror); + return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); + } +#endif + + /* We want to flag the fact that we saw this. We can't turn + off quoting entirely, because other characters in the + string might need it (consider "\"$@\""), but we need some + way to signal that the final split on the first character + of $IFS should be done, even though QUOTED is 1. */ + /* XXX - should this test include Q_PATQUOTE? */ + if (quoted_dollar_at_p && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + *quoted_dollar_at_p = 1; + if (contains_dollar_at) + *contains_dollar_at = 1; + + /* We want to separate the positional parameters with the first + character of $IFS in case $IFS is something other than a space. + We also want to make sure that splitting is done no matter what -- + according to POSIX.2, this expands to a list of the positional + parameters no matter what IFS is set to. */ + /* XXX - what to do when in a context where word splitting is not + performed? Even when IFS is not the default, posix seems to imply + that we behave like unquoted $* ? Maybe we should use PF_NOSPLIT2 + here. */ + temp = string_list_dollar_at (list, (pflags & PF_ASSIGNRHS) ? (quoted|Q_DOUBLE_QUOTES) : quoted); + + tflag |= W_DOLLARAT; + dispose_words (list); + break; + + case LBRACE: + tdesc = parameter_brace_expand (string, &zindex, quoted, pflags, + quoted_dollar_at_p, + contains_dollar_at); + + if (tdesc == &expand_wdesc_error || tdesc == &expand_wdesc_fatal) + return (tdesc); + temp = tdesc ? tdesc->word : (char *)0; + + /* XXX */ + /* Quoted nulls should be removed if there is anything else + in the string. */ + /* Note that we saw the quoted null so we can add one back at + the end of this function if there are no other characters + in the string, discard TEMP, and go on. The exception to + this is when we have "${@}" and $1 is '', since $@ needs + special handling. */ + if (tdesc && tdesc->word && (tdesc->flags & W_HASQUOTEDNULL) && QUOTED_NULL (temp)) + { + if (had_quoted_null_p) + *had_quoted_null_p = 1; + if (*quoted_dollar_at_p == 0) + { + free (temp); + tdesc->word = temp = (char *)NULL; + } + + } + + ret = tdesc; + goto return0; + + /* Do command or arithmetic substitution. */ + case LPAREN: + /* We have to extract the contents of this paren substitution. */ + t_index = zindex + 1; + temp = extract_command_subst (string, &t_index, 0); + zindex = t_index; + + /* For Posix.2-style `$(( ))' arithmetic substitution, + extract the expression and pass it to the evaluator. */ + if (temp && *temp == LPAREN) + { + char *temp2; + temp1 = temp + 1; + temp2 = savestring (temp1); + t_index = strlen (temp2) - 1; + + if (temp2[t_index] != RPAREN) + { + free (temp2); + goto comsub; + } + + /* Cut off ending `)' */ + temp2[t_index] = '\0'; + + if (chk_arithsub (temp2, t_index) == 0) + { + free (temp2); +#if 0 + internal_warning (_("future versions of the shell will force evaluation as an arithmetic substitution")); +#endif + goto comsub; + } + + /* Expand variables found inside the expression. */ + temp1 = expand_arith_string (temp2, Q_DOUBLE_QUOTES); + free (temp2); + +arithsub: + /* No error messages. */ + this_command_name = (char *)NULL; + number = evalexp (temp1, &expok); + free (temp); + free (temp1); + if (expok == 0) + { + if (interactive_shell == 0 && posixly_correct) + { + last_command_exit_value = EXECUTION_FAILURE; + return (&expand_wdesc_fatal); + } + else + return (&expand_wdesc_error); + } + temp = itos (number); + break; + } + +comsub: + if (pflags & PF_NOCOMSUB) + /* we need zindex+1 because string[zindex] == RPAREN */ + temp1 = substring (string, *sindex, zindex+1); + else + { + tdesc = command_substitute (temp, quoted); + temp1 = tdesc ? tdesc->word : (char *)NULL; + if (tdesc) + dispose_word_desc (tdesc); + } + FREE (temp); + temp = temp1; + break; + + /* Do POSIX.2d9-style arithmetic substitution. This will probably go + away in a future bash release. */ + case '[': + /* Extract the contents of this arithmetic substitution. */ + t_index = zindex + 1; + temp = extract_arithmetic_subst (string, &t_index); + zindex = t_index; + if (temp == 0) + { + temp = savestring (string); + if (expanded_something) + *expanded_something = 0; + goto return0; + } + + /* Do initial variable expansion. */ + temp1 = expand_arith_string (temp, Q_DOUBLE_QUOTES); + + goto arithsub; + + default: + /* Find the variable in VARIABLE_LIST. */ + temp = (char *)NULL; + + for (t_index = zindex; (c = string[zindex]) && legal_variable_char (c); zindex++) + ; + temp1 = (zindex > t_index) ? substring (string, t_index, zindex) : (char *)NULL; + + /* If this isn't a variable name, then just output the `$'. */ + if (temp1 == 0 || *temp1 == '\0') + { + FREE (temp1); + temp = (char *)xmalloc (2); + temp[0] = '$'; + temp[1] = '\0'; + if (expanded_something) + *expanded_something = 0; + goto return0; + } + + /* If the variable exists, return its value cell. */ + var = find_variable (temp1); + + if (var && invisible_p (var) == 0 && var_isset (var)) + { +#if defined (ARRAY_VARS) + if (assoc_p (var) || array_p (var)) + { + temp = array_p (var) ? array_reference (array_cell (var), 0) + : assoc_reference (assoc_cell (var), "0"); + if (temp) + temp = (*temp && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ? quote_string (temp) + : quote_escapes (temp); + else if (unbound_vars_is_error) + goto unbound_variable; + } + else +#endif + { + temp = value_cell (var); + + temp = (*temp && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + ? quote_string (temp) + : quote_escapes (temp); + } + + free (temp1); + + goto return0; + } + else if (var = find_variable_last_nameref (temp1)) + { + temp = nameref_cell (var); +#if defined (ARRAY_VARS) + if (temp && *temp && valid_array_reference (temp)) + { + tdesc = parameter_brace_expand_word (temp, SPECIAL_VAR (temp, 0), quoted, pflags, (arrayind_t *)NULL); + if (tdesc == &expand_wdesc_error || tdesc == &expand_wdesc_fatal) + return (tdesc); + ret = tdesc; + goto return0; + } + else +#endif + /* y=2 ; typeset -n x=y; echo $x is not the same as echo $2 in ksh */ + if (temp && *temp && legal_identifier (temp) == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("%s: invalid variable name for name reference"), temp); + return (&expand_wdesc_error); /* XXX */ + } + else + temp = (char *)NULL; + } + + temp = (char *)NULL; + +unbound_variable: + if (unbound_vars_is_error) + { + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (temp1); + } + else + { + free (temp1); + goto return0; + } + + free (temp1); + last_command_exit_value = EXECUTION_FAILURE; + return ((unbound_vars_is_error && interactive_shell == 0) + ? &expand_wdesc_fatal + : &expand_wdesc_error); + } + + if (string[zindex]) + zindex++; + +return0: + *sindex = zindex; + + if (ret == 0) + { + ret = alloc_word_desc (); + ret->flags = tflag; /* XXX */ + ret->word = temp; + } + return ret; +} + +/* Make a word list which is the result of parameter and variable + expansion, command substitution, arithmetic substitution, and + quote removal of WORD. Return a pointer to a WORD_LIST which is + the result of the expansion. If WORD contains a null word, the + word list returned is also null. + + QUOTED contains flag values defined in shell.h. + + ISEXP is used to tell expand_word_internal that the word should be + treated as the result of an expansion. This has implications for + how IFS characters in the word are treated. + + CONTAINS_DOLLAR_AT and EXPANDED_SOMETHING are return values; when non-null + they point to an integer value which receives information about expansion. + CONTAINS_DOLLAR_AT gets non-zero if WORD contained "$@", else zero. + EXPANDED_SOMETHING get non-zero if WORD contained any parameter expansions, + else zero. + + This only does word splitting in the case of $@ expansion. In that + case, we split on ' '. */ + +/* Values for the local variable quoted_state. */ +#define UNQUOTED 0 +#define PARTIALLY_QUOTED 1 +#define WHOLLY_QUOTED 2 + +static WORD_LIST * +expand_word_internal (word, quoted, isexp, contains_dollar_at, expanded_something) + WORD_DESC *word; + int quoted, isexp; + int *contains_dollar_at; + int *expanded_something; +{ + WORD_LIST *list; + WORD_DESC *tword; + + /* The intermediate string that we build while expanding. */ + char *istring; + + /* The current size of the above object. */ + int istring_size; + + /* Index into ISTRING. */ + int istring_index; + + /* Temporary string storage. */ + char *temp, *temp1; + + /* The text of WORD. */ + register char *string; + + /* The size of STRING. */ + size_t string_size; + + /* The index into STRING. */ + int sindex; + + /* This gets 1 if we see a $@ while quoted. */ + int quoted_dollar_at; + + /* One of UNQUOTED, PARTIALLY_QUOTED, or WHOLLY_QUOTED, depending on + whether WORD contains no quoting characters, a partially quoted + string (e.g., "xx"ab), or is fully quoted (e.g., "xxab"). */ + int quoted_state; + + /* State flags */ + int had_quoted_null; + int has_dollar_at, temp_has_dollar_at; + int split_on_spaces; + int tflag; + int pflags; /* flags passed to param_expand */ + + int assignoff; /* If assignment, offset of `=' */ + + register unsigned char c; /* Current character. */ + int t_index; /* For calls to string_extract_xxx. */ + + char twochars[2]; + + DECLARE_MBSTATE; + + istring = (char *)xmalloc (istring_size = DEFAULT_INITIAL_ARRAY_SIZE); + istring[istring_index = 0] = '\0'; + quoted_dollar_at = had_quoted_null = has_dollar_at = 0; + split_on_spaces = 0; + quoted_state = UNQUOTED; + + string = word->word; + if (string == 0) + goto finished_with_string; + /* Don't need the string length for the SADD... and COPY_ macros unless + multibyte characters are possible. */ + string_size = (MB_CUR_MAX > 1) ? strlen (string) : 1; + + if (contains_dollar_at) + *contains_dollar_at = 0; + + assignoff = -1; + + /* Begin the expansion. */ + + for (sindex = 0; ;) + { + c = string[sindex]; + + /* Case on top-level character. */ + switch (c) + { + case '\0': + goto finished_with_string; + + case CTLESC: + sindex++; +#if HANDLE_MULTIBYTE + if (MB_CUR_MAX > 1 && string[sindex]) + { + SADD_MBQCHAR_BODY(temp, string, sindex, string_size); + } + else +#endif + { + temp = (char *)xmalloc (3); + temp[0] = CTLESC; + temp[1] = c = string[sindex]; + temp[2] = '\0'; + } + +dollar_add_string: + if (string[sindex]) + sindex++; + +add_string: + if (temp) + { + istring = sub_append_string (temp, istring, &istring_index, &istring_size); + temp = (char *)0; + } + + break; + +#if defined (PROCESS_SUBSTITUTION) + /* Process substitution. */ + case '<': + case '>': + { + if (string[++sindex] != LPAREN || (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || (word->flags & (W_DQUOTE|W_NOPROCSUB)) || posixly_correct) + { + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + else + t_index = sindex + 1; /* skip past both '<' and LPAREN */ + + temp1 = extract_process_subst (string, (c == '<') ? "<(" : ">(", &t_index, 0); /*))*/ + sindex = t_index; + + /* If the process substitution specification is `<()', we want to + open the pipe for writing in the child and produce output; if + it is `>()', we want to open the pipe for reading in the child + and consume input. */ + temp = temp1 ? process_substitute (temp1, (c == '>')) : (char *)0; + + FREE (temp1); + + goto dollar_add_string; + } +#endif /* PROCESS_SUBSTITUTION */ + + case '=': + /* Posix.2 section 3.6.1 says that tildes following `=' in words + which are not assignment statements are not expanded. If the + shell isn't in posix mode, though, we perform tilde expansion + on `likely candidate' unquoted assignment statements (flags + include W_ASSIGNMENT but not W_QUOTED). A likely candidate + contains an unquoted :~ or =~. Something to think about: we + now have a flag that says to perform tilde expansion on arguments + to `assignment builtins' like declare and export that look like + assignment statements. We now do tilde expansion on such words + even in POSIX mode. */ + if (word->flags & (W_ASSIGNRHS|W_NOTILDE)) + { + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c)) + goto add_ifs_character; + else + goto add_character; + } + /* If we're not in posix mode or forcing assignment-statement tilde + expansion, note where the `=' appears in the word and prepare to + do tilde expansion following the first `='. */ + if ((word->flags & W_ASSIGNMENT) && + (posixly_correct == 0 || (word->flags & W_TILDEEXP)) && + assignoff == -1 && sindex > 0) + assignoff = sindex; + if (sindex == assignoff && string[sindex+1] == '~') /* XXX */ + word->flags |= W_ITILDE; +#if 0 + else if ((word->flags & W_ASSIGNMENT) && + (posixly_correct == 0 || (word->flags & W_TILDEEXP)) && + string[sindex+1] == '~') + word->flags |= W_ITILDE; +#endif + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c)) + goto add_ifs_character; + else + goto add_character; + + case ':': + if (word->flags & W_NOTILDE) + { + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c)) + goto add_ifs_character; + else + goto add_character; + } + + if ((word->flags & (W_ASSIGNMENT|W_ASSIGNRHS|W_TILDEEXP)) && + string[sindex+1] == '~') + word->flags |= W_ITILDE; + + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c)) + goto add_ifs_character; + else + goto add_character; + + case '~': + /* If the word isn't supposed to be tilde expanded, or we're not + at the start of a word or after an unquoted : or = in an + assignment statement, we don't do tilde expansion. */ + if ((word->flags & (W_NOTILDE|W_DQUOTE)) || + (sindex > 0 && ((word->flags & W_ITILDE) == 0)) || + (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + { + word->flags &= ~W_ITILDE; + if (isexp == 0 && (word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0 && isifs (c) && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) == 0) + goto add_ifs_character; + else + goto add_character; + } + + if (word->flags & W_ASSIGNRHS) + tflag = 2; + else if (word->flags & (W_ASSIGNMENT|W_TILDEEXP)) + tflag = 1; + else + tflag = 0; + + temp = bash_tilde_find_word (string + sindex, tflag, &t_index); + + word->flags &= ~W_ITILDE; + + if (temp && *temp && t_index > 0) + { + temp1 = bash_tilde_expand (temp, tflag); + if (temp1 && *temp1 == '~' && STREQ (temp, temp1)) + { + FREE (temp); + FREE (temp1); + goto add_character; /* tilde expansion failed */ + } + free (temp); + temp = temp1; + sindex += t_index; + goto add_quoted_string; /* XXX was add_string */ + } + else + { + FREE (temp); + goto add_character; + } + + case '$': + if (expanded_something) + *expanded_something = 1; + + temp_has_dollar_at = 0; + pflags = (word->flags & W_NOCOMSUB) ? PF_NOCOMSUB : 0; + if (word->flags & W_NOSPLIT2) + pflags |= PF_NOSPLIT2; + if (word->flags & W_ASSIGNRHS) + pflags |= PF_ASSIGNRHS; + tword = param_expand (string, &sindex, quoted, expanded_something, + &temp_has_dollar_at, "ed_dollar_at, + &had_quoted_null, pflags); + has_dollar_at += temp_has_dollar_at; + split_on_spaces += (tword->flags & W_SPLITSPACE); + + if (tword == &expand_wdesc_error || tword == &expand_wdesc_fatal) + { + free (string); + free (istring); + return ((tword == &expand_wdesc_error) ? &expand_word_error + : &expand_word_fatal); + } + if (contains_dollar_at && has_dollar_at) + *contains_dollar_at = 1; + + if (tword && (tword->flags & W_HASQUOTEDNULL)) + had_quoted_null = 1; + + temp = tword ? tword->word : (char *)NULL; + dispose_word_desc (tword); + + /* Kill quoted nulls; we will add them back at the end of + expand_word_internal if nothing else in the string */ + if (had_quoted_null && temp && QUOTED_NULL (temp)) + { + FREE (temp); + temp = (char *)NULL; + } + + goto add_string; + break; + + case '`': /* Backquoted command substitution. */ + { + t_index = sindex++; + + temp = string_extract (string, &sindex, "`", SX_REQMATCH); + /* The test of sindex against t_index is to allow bare instances of + ` to pass through, for backwards compatibility. */ + if (temp == &extract_string_error || temp == &extract_string_fatal) + { + if (sindex - 1 == t_index) + { + sindex = t_index; + goto add_character; + } + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("bad substitution: no closing \"`\" in %s") , string+t_index); + free (string); + free (istring); + return ((temp == &extract_string_error) ? &expand_word_error + : &expand_word_fatal); + } + + if (expanded_something) + *expanded_something = 1; + + if (word->flags & W_NOCOMSUB) + /* sindex + 1 because string[sindex] == '`' */ + temp1 = substring (string, t_index, sindex + 1); + else + { + de_backslash (temp); + tword = command_substitute (temp, quoted); + temp1 = tword ? tword->word : (char *)NULL; + if (tword) + dispose_word_desc (tword); + } + FREE (temp); + temp = temp1; + goto dollar_add_string; + } + + case '\\': + if (string[sindex + 1] == '\n') + { + sindex += 2; + continue; + } + + c = string[++sindex]; + + if (quoted & Q_HERE_DOCUMENT) + tflag = CBSHDOC; + else if (quoted & Q_DOUBLE_QUOTES) + tflag = CBSDQUOTE; + else + tflag = 0; + + /* From Posix discussion on austin-group list: Backslash escaping + a } in ${...} is removed. Issue 0000221 */ + if ((quoted & Q_DOLBRACE) && c == RBRACE) + { + SCOPY_CHAR_I (twochars, CTLESC, c, string, sindex, string_size); + } + /* This is the fix for " $@\ " */ + else if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && ((sh_syntaxtab[c] & tflag) == 0) && isexp == 0 && isifs (c)) + { + RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, + DEFAULT_ARRAY_SIZE); + istring[istring_index++] = CTLESC; + istring[istring_index++] = '\\'; + istring[istring_index] = '\0'; + + SCOPY_CHAR_I (twochars, CTLESC, c, string, sindex, string_size); + } + else if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && ((sh_syntaxtab[c] & tflag) == 0)) + { + SCOPY_CHAR_I (twochars, '\\', c, string, sindex, string_size); + } + else if (c == 0) + { + c = CTLNUL; + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + else + { + SCOPY_CHAR_I (twochars, CTLESC, c, string, sindex, string_size); + } + + sindex++; +add_twochars: + /* BEFORE jumping here, we need to increment sindex if appropriate */ + RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, + DEFAULT_ARRAY_SIZE); + istring[istring_index++] = twochars[0]; + istring[istring_index++] = twochars[1]; + istring[istring_index] = '\0'; + + break; + + case '"': + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + goto add_character; + + t_index = ++sindex; + temp = string_extract_double_quoted (string, &sindex, 0); + + /* If the quotes surrounded the entire string, then the + whole word was quoted. */ + quoted_state = (t_index == 1 && string[sindex] == '\0') + ? WHOLLY_QUOTED + : PARTIALLY_QUOTED; + + if (temp && *temp) + { + tword = alloc_word_desc (); + tword->word = temp; + + temp = (char *)NULL; + + temp_has_dollar_at = 0; /* XXX */ + /* Need to get W_HASQUOTEDNULL flag through this function. */ + list = expand_word_internal (tword, Q_DOUBLE_QUOTES, 0, &temp_has_dollar_at, (int *)NULL); + has_dollar_at += temp_has_dollar_at; + + if (list == &expand_word_error || list == &expand_word_fatal) + { + free (istring); + free (string); + /* expand_word_internal has already freed temp_word->word + for us because of the way it prints error messages. */ + tword->word = (char *)NULL; + dispose_word (tword); + return list; + } + + dispose_word (tword); + + /* "$@" (a double-quoted dollar-at) expands into nothing, + not even a NULL word, when there are no positional + parameters. */ + if (list == 0 && has_dollar_at) + { + quoted_dollar_at++; + break; + } + + /* If we get "$@", we know we have expanded something, so we + need to remember it for the final split on $IFS. This is + a special case; it's the only case where a quoted string + can expand into more than one word. It's going to come back + from the above call to expand_word_internal as a list with + a single word, in which all characters are quoted and + separated by blanks. What we want to do is to turn it back + into a list for the next piece of code. */ + if (list) + dequote_list (list); + + if (list && list->word && (list->word->flags & W_HASQUOTEDNULL)) + had_quoted_null = 1; /* XXX */ + + if (has_dollar_at) + { + quoted_dollar_at++; + if (contains_dollar_at) + *contains_dollar_at = 1; + if (expanded_something) + *expanded_something = 1; + } + } + else + { + /* What we have is "". This is a minor optimization. */ + FREE (temp); + list = (WORD_LIST *)NULL; + } + + /* The code above *might* return a list (consider the case of "$@", + where it returns "$1", "$2", etc.). We can't throw away the + rest of the list, and we have to make sure each word gets added + as quoted. We test on tresult->next: if it is non-NULL, we + quote the whole list, save it to a string with string_list, and + add that string. We don't need to quote the results of this + (and it would be wrong, since that would quote the separators + as well), so we go directly to add_string. */ + if (list) + { + if (list->next) + { + /* Testing quoted_dollar_at makes sure that "$@" is + split correctly when $IFS does not contain a space. */ + temp = quoted_dollar_at + ? string_list_dollar_at (list, Q_DOUBLE_QUOTES) + : string_list (quote_list (list)); + dispose_words (list); + goto add_string; + } + else + { + temp = savestring (list->word->word); + tflag = list->word->flags; + dispose_words (list); + + /* If the string is not a quoted null string, we want + to remove any embedded unquoted CTLNUL characters. + We do not want to turn quoted null strings back into + the empty string, though. We do this because we + want to remove any quoted nulls from expansions that + contain other characters. For example, if we have + x"$*"y or "x$*y" and there are no positional parameters, + the $* should expand into nothing. */ + /* We use the W_HASQUOTEDNULL flag to differentiate the + cases: a quoted null character as above and when + CTLNUL is contained in the (non-null) expansion + of some variable. We use the had_quoted_null flag to + pass the value through this function to its caller. */ + if ((tflag & W_HASQUOTEDNULL) && QUOTED_NULL (temp) == 0) + remove_quoted_nulls (temp); /* XXX */ + } + } + else + temp = (char *)NULL; + + /* We do not want to add quoted nulls to strings that are only + partially quoted; we can throw them away. The exception to + this is when we are going to be performing word splitting, + since we have to preserve a null argument if the next character + will cause word splitting. */ + if (temp == 0 && quoted_state == PARTIALLY_QUOTED && (word->flags & (W_NOSPLIT|W_NOSPLIT2))) + continue; + + add_quoted_string: + + if (temp) + { + temp1 = temp; + temp = quote_string (temp); + free (temp1); + goto add_string; + } + else + { + /* Add NULL arg. */ + c = CTLNUL; + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + + /* break; */ + + case '\'': + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) + goto add_character; + + t_index = ++sindex; + temp = string_extract_single_quoted (string, &sindex); + + /* If the entire STRING was surrounded by single quotes, + then the string is wholly quoted. */ + quoted_state = (t_index == 1 && string[sindex] == '\0') + ? WHOLLY_QUOTED + : PARTIALLY_QUOTED; + + /* If all we had was '', it is a null expansion. */ + if (*temp == '\0') + { + free (temp); + temp = (char *)NULL; + } + else + remove_quoted_escapes (temp); /* ??? */ + + /* We do not want to add quoted nulls to strings that are only + partially quoted; such nulls are discarded. */ + if (temp == 0 && (quoted_state == PARTIALLY_QUOTED)) + continue; + + /* If we have a quoted null expansion, add a quoted NULL to istring. */ + if (temp == 0) + { + c = CTLNUL; + sindex--; /* add_character: label increments sindex */ + goto add_character; + } + else + goto add_quoted_string; + + /* break; */ + + default: + /* This is the fix for " $@ " */ + add_ifs_character: + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || (isexp == 0 && isifs (c))) + { + if (string[sindex]) /* from old goto dollar_add_string */ + sindex++; + if (c == 0) + { + c = CTLNUL; + goto add_character; + } + else + { +#if HANDLE_MULTIBYTE + if (MB_CUR_MAX > 1) + sindex--; + + if (MB_CUR_MAX > 1) + { + SADD_MBQCHAR_BODY(temp, string, sindex, string_size); + } + else +#endif + { + twochars[0] = CTLESC; + twochars[1] = c; + goto add_twochars; + } + } + } + + SADD_MBCHAR (temp, string, sindex, string_size); + + add_character: + RESIZE_MALLOCED_BUFFER (istring, istring_index, 1, istring_size, + DEFAULT_ARRAY_SIZE); + istring[istring_index++] = c; + istring[istring_index] = '\0'; + + /* Next character. */ + sindex++; + } + } + +finished_with_string: + /* OK, we're ready to return. If we have a quoted string, and + quoted_dollar_at is not set, we do no splitting at all; otherwise + we split on ' '. The routines that call this will handle what to + do if nothing has been expanded. */ + + /* Partially and wholly quoted strings which expand to the empty + string are retained as an empty arguments. Unquoted strings + which expand to the empty string are discarded. The single + exception is the case of expanding "$@" when there are no + positional parameters. In that case, we discard the expansion. */ + + /* Because of how the code that handles "" and '' in partially + quoted strings works, we need to make ISTRING into a QUOTED_NULL + if we saw quoting characters, but the expansion was empty. + "" and '' are tossed away before we get to this point when + processing partially quoted strings. This makes "" and $xxx"" + equivalent when xxx is unset. We also look to see whether we + saw a quoted null from a ${} expansion and add one back if we + need to. */ + + /* If we expand to nothing and there were no single or double quotes + in the word, we throw it away. Otherwise, we return a NULL word. + The single exception is for $@ surrounded by double quotes when + there are no positional parameters. In that case, we also throw + the word away. */ + + if (*istring == '\0') + { + if (quoted_dollar_at == 0 && (had_quoted_null || quoted_state == PARTIALLY_QUOTED)) + { + istring[0] = CTLNUL; + istring[1] = '\0'; + tword = make_bare_word (istring); + tword->flags |= W_HASQUOTEDNULL; /* XXX */ + list = make_word_list (tword, (WORD_LIST *)NULL); + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + tword->flags |= W_QUOTED; + } + /* According to sh, ksh, and Posix.2, if a word expands into nothing + and a double-quoted "$@" appears anywhere in it, then the entire + word is removed. */ + else if (quoted_state == UNQUOTED || quoted_dollar_at) + list = (WORD_LIST *)NULL; +#if 0 + else + { + tword = make_bare_word (istring); + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + tword->flags |= W_QUOTED; + list = make_word_list (tword, (WORD_LIST *)NULL); + } +#else + else + list = (WORD_LIST *)NULL; +#endif + } + else if (word->flags & W_NOSPLIT) + { + tword = make_bare_word (istring); + if (word->flags & W_ASSIGNMENT) + tword->flags |= W_ASSIGNMENT; /* XXX */ + if (word->flags & W_COMPASSIGN) + tword->flags |= W_COMPASSIGN; /* XXX */ + if (word->flags & W_NOGLOB) + tword->flags |= W_NOGLOB; /* XXX */ + if (word->flags & W_NOBRACE) + tword->flags |= W_NOBRACE; /* XXX */ + if (word->flags & W_NOEXPAND) + tword->flags |= W_NOEXPAND; /* XXX */ + if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) + tword->flags |= W_QUOTED; + if (had_quoted_null && QUOTED_NULL (istring)) + tword->flags |= W_HASQUOTEDNULL; + list = make_word_list (tword, (WORD_LIST *)NULL); + } + else + { + char *ifs_chars; + char *tstring; + + ifs_chars = (quoted_dollar_at || has_dollar_at) ? ifs_value : (char *)NULL; + + /* If we have $@, we need to split the results no matter what. If + IFS is unset or NULL, string_list_dollar_at has separated the + positional parameters with a space, so we split on space (we have + set ifs_chars to " \t\n" above if ifs is unset). If IFS is set, + string_list_dollar_at has separated the positional parameters + with the first character of $IFS, so we split on $IFS. If + SPLIT_ON_SPACES is set, we expanded $* (unquoted) with IFS either + unset or null, and we want to make sure that we split on spaces + regardless of what else has happened to IFS since the expansion. */ + if (split_on_spaces) + list = list_string (istring, " ", 1); /* XXX quoted == 1? */ + /* If we have $@ (has_dollar_at != 0) and we are in a context where we + don't want to split the result (W_NOSPLIT2), and we are not quoted, + we have already separated the arguments with the first character of + $IFS. In this case, we want to return a list with a single word + with the separator possibly replaced with a space (it's what other + shells seem to do). + quoted_dollar_at is internal to this function and is set if we are + passed an argument that is unquoted (quoted == 0) but we encounter a + double-quoted $@ while expanding it. */ + else if (has_dollar_at && quoted_dollar_at == 0 && ifs_chars && quoted == 0 && (word->flags & W_NOSPLIT2)) + { + /* Only split and rejoin if we have to */ + if (*ifs_chars && *ifs_chars != ' ') + { + list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1); + tstring = string_list (list); + } + else + tstring = istring; + tword = make_bare_word (tstring); + if (tstring != istring) + free (tstring); + goto set_word_flags; + } + else if (has_dollar_at && ifs_chars) + list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1); + else + { + tword = make_bare_word (istring); +set_word_flags: + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) || (quoted_state == WHOLLY_QUOTED)) + tword->flags |= W_QUOTED; + if (word->flags & W_ASSIGNMENT) + tword->flags |= W_ASSIGNMENT; + if (word->flags & W_COMPASSIGN) + tword->flags |= W_COMPASSIGN; + if (word->flags & W_NOGLOB) + tword->flags |= W_NOGLOB; + if (word->flags & W_NOBRACE) + tword->flags |= W_NOBRACE; + if (word->flags & W_NOEXPAND) + tword->flags |= W_NOEXPAND; + if (had_quoted_null && QUOTED_NULL (istring)) + tword->flags |= W_HASQUOTEDNULL; /* XXX */ + list = make_word_list (tword, (WORD_LIST *)NULL); + } + } + + free (istring); + return (list); +} + +/* **************************************************************** */ +/* */ +/* Functions for Quote Removal */ +/* */ +/* **************************************************************** */ + +/* Perform quote removal on STRING. If QUOTED > 0, assume we are obeying the + backslash quoting rules for within double quotes or a here document. */ +char * +string_quote_removal (string, quoted) + char *string; + int quoted; +{ + size_t slen; + char *r, *result_string, *temp, *send; + int sindex, tindex, dquote; + unsigned char c; + DECLARE_MBSTATE; + + /* The result can be no longer than the original string. */ + slen = strlen (string); + send = string + slen; + + r = result_string = (char *)xmalloc (slen + 1); + + for (dquote = sindex = 0; c = string[sindex];) + { + switch (c) + { + case '\\': + c = string[++sindex]; + if (c == 0) + { + *r++ = '\\'; + break; + } + if (((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || dquote) && (sh_syntaxtab[c] & CBSDQUOTE) == 0) + *r++ = '\\'; + /* FALLTHROUGH */ + + default: + SCOPY_CHAR_M (r, string, send, sindex); + break; + + case '\'': + if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) || dquote) + { + *r++ = c; + sindex++; + break; + } + tindex = sindex + 1; + temp = string_extract_single_quoted (string, &tindex); + if (temp) + { + strcpy (r, temp); + r += strlen (r); + free (temp); + } + sindex = tindex; + break; + + case '"': + dquote = 1 - dquote; + sindex++; + break; + } + } + *r = '\0'; + return (result_string); +} + +#if 0 +/* UNUSED */ +/* Perform quote removal on word WORD. This allocates and returns a new + WORD_DESC *. */ +WORD_DESC * +word_quote_removal (word, quoted) + WORD_DESC *word; + int quoted; +{ + WORD_DESC *w; + char *t; + + t = string_quote_removal (word->word, quoted); + w = alloc_word_desc (); + w->word = t ? t : savestring (""); + return (w); +} + +/* Perform quote removal on all words in LIST. If QUOTED is non-zero, + the members of the list are treated as if they are surrounded by + double quotes. Return a new list, or NULL if LIST is NULL. */ +WORD_LIST * +word_list_quote_removal (list, quoted) + WORD_LIST *list; + int quoted; +{ + WORD_LIST *result, *t, *tresult, *e; + + for (t = list, result = (WORD_LIST *)NULL; t; t = t->next) + { + tresult = make_word_list (word_quote_removal (t->word, quoted), (WORD_LIST *)NULL); +#if 0 + result = (WORD_LIST *) list_append (result, tresult); +#else + if (result == 0) + result = e = tresult; + else + { + e->next = tresult; + while (e->next) + e = e->next; + } +#endif + } + return (result); +} +#endif + +/******************************************* + * * + * Functions to perform word splitting * + * * + *******************************************/ + +void +setifs (v) + SHELL_VAR *v; +{ + char *t; + unsigned char uc; + + ifs_var = v; + ifs_value = (v && value_cell (v)) ? value_cell (v) : " \t\n"; + + ifs_is_set = ifs_var != 0; + ifs_is_null = ifs_is_set && (*ifs_value == 0); + + /* Should really merge ifs_cmap with sh_syntaxtab. XXX - doesn't yet + handle multibyte chars in IFS */ + memset (ifs_cmap, '\0', sizeof (ifs_cmap)); + for (t = ifs_value ; t && *t; t++) + { + uc = *t; + ifs_cmap[uc] = 1; + } + +#if defined (HANDLE_MULTIBYTE) + if (ifs_value == 0) + { + ifs_firstc[0] = '\0'; + ifs_firstc_len = 1; + } + else + { + size_t ifs_len; + ifs_len = strnlen (ifs_value, MB_CUR_MAX); + ifs_firstc_len = MBLEN (ifs_value, ifs_len); + if (ifs_firstc_len == 1 || ifs_firstc_len == 0 || MB_INVALIDCH (ifs_firstc_len)) + { + ifs_firstc[0] = ifs_value[0]; + ifs_firstc[1] = '\0'; + ifs_firstc_len = 1; + } + else + memcpy (ifs_firstc, ifs_value, ifs_firstc_len); + } +#else + ifs_firstc = ifs_value ? *ifs_value : 0; +#endif +} + +char * +getifs () +{ + return ifs_value; +} + +/* This splits a single word into a WORD LIST on $IFS, but only if the word + is not quoted. list_string () performs quote removal for us, even if we + don't do any splitting. */ +WORD_LIST * +word_split (w, ifs_chars) + WORD_DESC *w; + char *ifs_chars; +{ + WORD_LIST *result; + + if (w) + { + char *xifs; + + xifs = ((w->flags & W_QUOTED) || ifs_chars == 0) ? "" : ifs_chars; + result = list_string (w->word, xifs, w->flags & W_QUOTED); + } + else + result = (WORD_LIST *)NULL; + + return (result); +} + +/* Perform word splitting on LIST and return the RESULT. It is possible + to return (WORD_LIST *)NULL. */ +static WORD_LIST * +word_list_split (list) + WORD_LIST *list; +{ + WORD_LIST *result, *t, *tresult, *e; + + for (t = list, result = (WORD_LIST *)NULL; t; t = t->next) + { + tresult = word_split (t->word, ifs_value); + if (result == 0) + result = e = tresult; + else + { + e->next = tresult; + while (e->next) + e = e->next; + } + } + return (result); +} + +/************************************************** + * * + * Functions to expand an entire WORD_LIST * + * * + **************************************************/ + +/* Do any word-expansion-specific cleanup and jump to top_level */ +static void +exp_jump_to_top_level (v) + int v; +{ + set_pipestatus_from_exit (last_command_exit_value); + + /* Cleanup code goes here. */ + expand_no_split_dollar_star = 0; /* XXX */ + expanding_redir = 0; + assigning_in_environment = 0; + + if (parse_and_execute_level == 0) + top_level_cleanup (); /* from sig.c */ + + jump_to_top_level (v); +} + +/* Put NLIST (which is a WORD_LIST * of only one element) at the front of + ELIST, and set ELIST to the new list. */ +#define PREPEND_LIST(nlist, elist) \ + do { nlist->next = elist; elist = nlist; } while (0) + +/* Separate out any initial variable assignments from TLIST. If set -k has + been executed, remove all assignment statements from TLIST. Initial + variable assignments and other environment assignments are placed + on SUBST_ASSIGN_VARLIST. */ +static WORD_LIST * +separate_out_assignments (tlist) + WORD_LIST *tlist; +{ + register WORD_LIST *vp, *lp; + + if (tlist == 0) + return ((WORD_LIST *)NULL); + + if (subst_assign_varlist) + dispose_words (subst_assign_varlist); /* Clean up after previous error */ + + subst_assign_varlist = (WORD_LIST *)NULL; + vp = lp = tlist; + + /* Separate out variable assignments at the start of the command. + Loop invariant: vp->next == lp + Loop postcondition: + lp = list of words left after assignment statements skipped + tlist = original list of words + */ + while (lp && (lp->word->flags & W_ASSIGNMENT)) + { + vp = lp; + lp = lp->next; + } + + /* If lp != tlist, we have some initial assignment statements. + We make SUBST_ASSIGN_VARLIST point to the list of assignment + words and TLIST point to the remaining words. */ + if (lp != tlist) + { + subst_assign_varlist = tlist; + /* ASSERT(vp->next == lp); */ + vp->next = (WORD_LIST *)NULL; /* terminate variable list */ + tlist = lp; /* remainder of word list */ + } + + /* vp == end of variable list */ + /* tlist == remainder of original word list without variable assignments */ + if (!tlist) + /* All the words in tlist were assignment statements */ + return ((WORD_LIST *)NULL); + + /* ASSERT(tlist != NULL); */ + /* ASSERT((tlist->word->flags & W_ASSIGNMENT) == 0); */ + + /* If the -k option is in effect, we need to go through the remaining + words, separate out the assignment words, and place them on + SUBST_ASSIGN_VARLIST. */ + if (place_keywords_in_env) + { + WORD_LIST *tp; /* tp == running pointer into tlist */ + + tp = tlist; + lp = tlist->next; + + /* Loop Invariant: tp->next == lp */ + /* Loop postcondition: tlist == word list without assignment statements */ + while (lp) + { + if (lp->word->flags & W_ASSIGNMENT) + { + /* Found an assignment statement, add this word to end of + subst_assign_varlist (vp). */ + if (!subst_assign_varlist) + subst_assign_varlist = vp = lp; + else + { + vp->next = lp; + vp = lp; + } + + /* Remove the word pointed to by LP from TLIST. */ + tp->next = lp->next; + /* ASSERT(vp == lp); */ + lp->next = (WORD_LIST *)NULL; + lp = tp->next; + } + else + { + tp = lp; + lp = lp->next; + } + } + } + return (tlist); +} + +#define WEXP_VARASSIGN 0x001 +#define WEXP_BRACEEXP 0x002 +#define WEXP_TILDEEXP 0x004 +#define WEXP_PARAMEXP 0x008 +#define WEXP_PATHEXP 0x010 + +/* All of the expansions, including variable assignments at the start of + the list. */ +#define WEXP_ALL (WEXP_VARASSIGN|WEXP_BRACEEXP|WEXP_TILDEEXP|WEXP_PARAMEXP|WEXP_PATHEXP) + +/* All of the expansions except variable assignments at the start of + the list. */ +#define WEXP_NOVARS (WEXP_BRACEEXP|WEXP_TILDEEXP|WEXP_PARAMEXP|WEXP_PATHEXP) + +/* All of the `shell expansions': brace expansion, tilde expansion, parameter + expansion, command substitution, arithmetic expansion, word splitting, and + quote removal. */ +#define WEXP_SHELLEXP (WEXP_BRACEEXP|WEXP_TILDEEXP|WEXP_PARAMEXP) + +/* Take the list of words in LIST and do the various substitutions. Return + a new list of words which is the expanded list, and without things like + variable assignments. */ + +WORD_LIST * +expand_words (list) + WORD_LIST *list; +{ + return (expand_word_list_internal (list, WEXP_ALL)); +} + +/* Same as expand_words (), but doesn't hack variable or environment + variables. */ +WORD_LIST * +expand_words_no_vars (list) + WORD_LIST *list; +{ + return (expand_word_list_internal (list, WEXP_NOVARS)); +} + +WORD_LIST * +expand_words_shellexp (list) + WORD_LIST *list; +{ + return (expand_word_list_internal (list, WEXP_SHELLEXP)); +} + +static WORD_LIST * +glob_expand_word_list (tlist, eflags) + WORD_LIST *tlist; + int eflags; +{ + char **glob_array, *temp_string; + register int glob_index; + WORD_LIST *glob_list, *output_list, *disposables, *next; + WORD_DESC *tword; + + output_list = disposables = (WORD_LIST *)NULL; + glob_array = (char **)NULL; + while (tlist) + { + /* For each word, either globbing is attempted or the word is + added to orig_list. If globbing succeeds, the results are + added to orig_list and the word (tlist) is added to the list + of disposable words. If globbing fails and failed glob + expansions are left unchanged (the shell default), the + original word is added to orig_list. If globbing fails and + failed glob expansions are removed, the original word is + added to the list of disposable words. orig_list ends up + in reverse order and requires a call to REVERSE_LIST to + be set right. After all words are examined, the disposable + words are freed. */ + next = tlist->next; + + /* If the word isn't an assignment and contains an unquoted + pattern matching character, then glob it. */ + if ((tlist->word->flags & W_NOGLOB) == 0 && + unquoted_glob_pattern_p (tlist->word->word)) + { + glob_array = shell_glob_filename (tlist->word->word); + + /* Handle error cases. + I don't think we should report errors like "No such file + or directory". However, I would like to report errors + like "Read failed". */ + + if (glob_array == 0 || GLOB_FAILED (glob_array)) + { + glob_array = (char **)xmalloc (sizeof (char *)); + glob_array[0] = (char *)NULL; + } + + /* Dequote the current word in case we have to use it. */ + if (glob_array[0] == NULL) + { + temp_string = dequote_string (tlist->word->word); + free (tlist->word->word); + tlist->word->word = temp_string; + } + + /* Make the array into a word list. */ + glob_list = (WORD_LIST *)NULL; + for (glob_index = 0; glob_array[glob_index]; glob_index++) + { + tword = make_bare_word (glob_array[glob_index]); + glob_list = make_word_list (tword, glob_list); + } + + if (glob_list) + { + output_list = (WORD_LIST *)list_append (glob_list, output_list); + PREPEND_LIST (tlist, disposables); + } + else if (fail_glob_expansion != 0) + { + last_command_exit_value = EXECUTION_FAILURE; + report_error (_("no match: %s"), tlist->word->word); + exp_jump_to_top_level (DISCARD); + } + else if (allow_null_glob_expansion == 0) + { + /* Failed glob expressions are left unchanged. */ + PREPEND_LIST (tlist, output_list); + } + else + { + /* Failed glob expressions are removed. */ + PREPEND_LIST (tlist, disposables); + } + } + else + { + /* Dequote the string. */ + temp_string = dequote_string (tlist->word->word); + free (tlist->word->word); + tlist->word->word = temp_string; + PREPEND_LIST (tlist, output_list); + } + + strvec_dispose (glob_array); + glob_array = (char **)NULL; + + tlist = next; + } + + if (disposables) + dispose_words (disposables); + + if (output_list) + output_list = REVERSE_LIST (output_list, WORD_LIST *); + + return (output_list); +} + +#if defined (BRACE_EXPANSION) +static WORD_LIST * +brace_expand_word_list (tlist, eflags) + WORD_LIST *tlist; + int eflags; +{ + register char **expansions; + char *temp_string; + WORD_LIST *disposables, *output_list, *next; + WORD_DESC *w; + int eindex; + + for (disposables = output_list = (WORD_LIST *)NULL; tlist; tlist = next) + { + next = tlist->next; + + if (tlist->word->flags & W_NOBRACE) + { +/*itrace("brace_expand_word_list: %s: W_NOBRACE", tlist->word->word);*/ + PREPEND_LIST (tlist, output_list); + continue; + } + + if ((tlist->word->flags & (W_COMPASSIGN|W_ASSIGNARG)) == (W_COMPASSIGN|W_ASSIGNARG)) + { +/*itrace("brace_expand_word_list: %s: W_COMPASSIGN|W_ASSIGNARG", tlist->word->word);*/ + PREPEND_LIST (tlist, output_list); + continue; + } + + /* Only do brace expansion if the word has a brace character. If + not, just add the word list element to BRACES and continue. In + the common case, at least when running shell scripts, this will + degenerate to a bunch of calls to `mbschr', and then what is + basically a reversal of TLIST into BRACES, which is corrected + by a call to REVERSE_LIST () on BRACES when the end of TLIST + is reached. */ + if (mbschr (tlist->word->word, LBRACE)) + { + expansions = brace_expand (tlist->word->word); + + for (eindex = 0; temp_string = expansions[eindex]; eindex++) + { + w = alloc_word_desc (); + w->word = temp_string; + + /* If brace expansion didn't change the word, preserve + the flags. We may want to preserve the flags + unconditionally someday -- XXX */ + if (STREQ (temp_string, tlist->word->word)) + w->flags = tlist->word->flags; + else + w = make_word_flags (w, temp_string); + + output_list = make_word_list (w, output_list); + } + free (expansions); + + /* Add TLIST to the list of words to be freed after brace + expansion has been performed. */ + PREPEND_LIST (tlist, disposables); + } + else + PREPEND_LIST (tlist, output_list); + } + + if (disposables) + dispose_words (disposables); + + if (output_list) + output_list = REVERSE_LIST (output_list, WORD_LIST *); + + return (output_list); +} +#endif + +#if defined (ARRAY_VARS) +/* Take WORD, a compound associative array assignment, and internally run + 'declare -A w', where W is the variable name portion of WORD. */ +static int +make_internal_declare (word, option) + char *word; + char *option; +{ + int t; + WORD_LIST *wl; + WORD_DESC *w; + + w = make_word (word); + + t = assignment (w->word, 0); + w->word[t] = '\0'; + + wl = make_word_list (w, (WORD_LIST *)NULL); + wl = make_word_list (make_word (option), wl); + + return (declare_builtin (wl)); +} +#endif + +static WORD_LIST * +shell_expand_word_list (tlist, eflags) + WORD_LIST *tlist; + int eflags; +{ + WORD_LIST *expanded, *orig_list, *new_list, *next, *temp_list; + int expanded_something, has_dollar_at; + char *temp_string; + + /* We do tilde expansion all the time. This is what 1003.2 says. */ + new_list = (WORD_LIST *)NULL; + for (orig_list = tlist; tlist; tlist = next) + { + temp_string = tlist->word->word; + + next = tlist->next; + +#if defined (ARRAY_VARS) + /* If this is a compound array assignment to a builtin that accepts + such assignments (e.g., `declare'), take the assignment and perform + it separately, handling the semantics of declarations inside shell + functions. This avoids the double-evaluation of such arguments, + because `declare' does some evaluation of compound assignments on + its own. */ + if ((tlist->word->flags & (W_COMPASSIGN|W_ASSIGNARG)) == (W_COMPASSIGN|W_ASSIGNARG)) + { + int t; + char opts[8], opti; + + opti = 0; + if (tlist->word->flags & (W_ASSIGNASSOC|W_ASSNGLOBAL|W_ASSIGNARRAY)) + opts[opti++] = '-'; + + if ((tlist->word->flags & (W_ASSIGNASSOC|W_ASSNGLOBAL)) == (W_ASSIGNASSOC|W_ASSNGLOBAL)) + { + opts[opti++] = 'g'; + opts[opti++] = 'A'; + } + else if (tlist->word->flags & W_ASSIGNASSOC) + opts[opti++] = 'A'; + else if ((tlist->word->flags & (W_ASSIGNARRAY|W_ASSNGLOBAL)) == (W_ASSIGNARRAY|W_ASSNGLOBAL)) + { + opts[opti++] = 'g'; + opts[opti++] = 'a'; + } + else if (tlist->word->flags & W_ASSIGNARRAY) + opts[opti++] = 'a'; + else if (tlist->word->flags & W_ASSNGLOBAL) + opts[opti++] = 'g'; + +#if 0 + /* If we have special handling note the integer attribute */ + if (opti > 0 && (tlist->word->flags & W_ASSIGNINT)) + opts[opti++] = 'i'; +#endif + + opts[opti] = '\0'; + if (opti > 0) + make_internal_declare (tlist->word->word, opts); + + t = do_word_assignment (tlist->word, 0); + if (t == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + exp_jump_to_top_level (DISCARD); + } + + /* Now transform the word as ksh93 appears to do and go on */ + t = assignment (tlist->word->word, 0); + tlist->word->word[t] = '\0'; + tlist->word->flags &= ~(W_ASSIGNMENT|W_NOSPLIT|W_COMPASSIGN|W_ASSIGNARG|W_ASSIGNASSOC|W_ASSIGNARRAY); + } +#endif + + expanded_something = 0; + expanded = expand_word_internal + (tlist->word, 0, 0, &has_dollar_at, &expanded_something); + + if (expanded == &expand_word_error || expanded == &expand_word_fatal) + { + /* By convention, each time this error is returned, + tlist->word->word has already been freed. */ + tlist->word->word = (char *)NULL; + + /* Dispose our copy of the original list. */ + dispose_words (orig_list); + /* Dispose the new list we're building. */ + dispose_words (new_list); + + last_command_exit_value = EXECUTION_FAILURE; + if (expanded == &expand_word_error) + exp_jump_to_top_level (DISCARD); + else + exp_jump_to_top_level (FORCE_EOF); + } + + /* Don't split words marked W_NOSPLIT. */ + if (expanded_something && (tlist->word->flags & W_NOSPLIT) == 0) + { + temp_list = word_list_split (expanded); + dispose_words (expanded); + } + else + { + /* If no parameter expansion, command substitution, process + substitution, or arithmetic substitution took place, then + do not do word splitting. We still have to remove quoted + null characters from the result. */ + word_list_remove_quoted_nulls (expanded); + temp_list = expanded; + } + + expanded = REVERSE_LIST (temp_list, WORD_LIST *); + new_list = (WORD_LIST *)list_append (expanded, new_list); + } + + if (orig_list) + dispose_words (orig_list); + + if (new_list) + new_list = REVERSE_LIST (new_list, WORD_LIST *); + + return (new_list); +} + +/* The workhorse for expand_words () and expand_words_no_vars (). + First arg is LIST, a WORD_LIST of words. + Second arg EFLAGS is a flags word controlling which expansions are + performed. + + This does all of the substitutions: brace expansion, tilde expansion, + parameter expansion, command substitution, arithmetic expansion, + process substitution, word splitting, and pathname expansion, according + to the bits set in EFLAGS. Words with the W_QUOTED or W_NOSPLIT bits + set, or for which no expansion is done, do not undergo word splitting. + Words with the W_NOGLOB bit set do not undergo pathname expansion; words + with W_NOBRACE set do not undergo brace expansion (see + brace_expand_word_list above). */ +static WORD_LIST * +expand_word_list_internal (list, eflags) + WORD_LIST *list; + int eflags; +{ + WORD_LIST *new_list, *temp_list; + int tint; + + tempenv_assign_error = 0; + if (list == 0) + return ((WORD_LIST *)NULL); + + garglist = new_list = copy_word_list (list); + if (eflags & WEXP_VARASSIGN) + { + garglist = new_list = separate_out_assignments (new_list); + if (new_list == 0) + { + if (subst_assign_varlist) + { + /* All the words were variable assignments, so they are placed + into the shell's environment. */ + for (temp_list = subst_assign_varlist; temp_list; temp_list = temp_list->next) + { + this_command_name = (char *)NULL; /* no arithmetic errors */ + tint = do_word_assignment (temp_list->word, 0); + /* Variable assignment errors in non-interactive shells + running in Posix.2 mode cause the shell to exit. */ + if (tint == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + if (interactive_shell == 0 && posixly_correct) + exp_jump_to_top_level (FORCE_EOF); + else + exp_jump_to_top_level (DISCARD); + } + } + dispose_words (subst_assign_varlist); + subst_assign_varlist = (WORD_LIST *)NULL; + } + return ((WORD_LIST *)NULL); + } + } + + /* Begin expanding the words that remain. The expansions take place on + things that aren't really variable assignments. */ + +#if defined (BRACE_EXPANSION) + /* Do brace expansion on this word if there are any brace characters + in the string. */ + if ((eflags & WEXP_BRACEEXP) && brace_expansion && new_list) + new_list = brace_expand_word_list (new_list, eflags); +#endif /* BRACE_EXPANSION */ + + /* Perform the `normal' shell expansions: tilde expansion, parameter and + variable substitution, command substitution, arithmetic expansion, + and word splitting. */ + new_list = shell_expand_word_list (new_list, eflags); + + /* Okay, we're almost done. Now let's just do some filename + globbing. */ + if (new_list) + { + if ((eflags & WEXP_PATHEXP) && disallow_filename_globbing == 0) + /* Glob expand the word list unless globbing has been disabled. */ + new_list = glob_expand_word_list (new_list, eflags); + else + /* Dequote the words, because we're not performing globbing. */ + new_list = dequote_list (new_list); + } + + if ((eflags & WEXP_VARASSIGN) && subst_assign_varlist) + { + sh_wassign_func_t *assign_func; + int is_special_builtin, is_builtin_or_func; + + /* If the remainder of the words expand to nothing, Posix.2 requires + that the variable and environment assignments affect the shell's + environment. */ + assign_func = new_list ? assign_in_env : do_word_assignment; + tempenv_assign_error = 0; + + is_builtin_or_func = (new_list && new_list->word && (find_shell_builtin (new_list->word->word) || find_function (new_list->word->word))); + /* Posix says that special builtins exit if a variable assignment error + occurs in an assignment preceding it. */ + is_special_builtin = (posixly_correct && new_list && new_list->word && find_special_builtin (new_list->word->word)); + + for (temp_list = subst_assign_varlist; temp_list; temp_list = temp_list->next) + { + this_command_name = (char *)NULL; + assigning_in_environment = (assign_func == assign_in_env); + tint = (*assign_func) (temp_list->word, is_builtin_or_func); + assigning_in_environment = 0; + /* Variable assignment errors in non-interactive shells running + in Posix.2 mode cause the shell to exit. */ + if (tint == 0) + { + if (assign_func == do_word_assignment) + { + last_command_exit_value = EXECUTION_FAILURE; + if (interactive_shell == 0 && posixly_correct && is_special_builtin) + exp_jump_to_top_level (FORCE_EOF); + else + exp_jump_to_top_level (DISCARD); + } + else + tempenv_assign_error++; + } + } + + dispose_words (subst_assign_varlist); + subst_assign_varlist = (WORD_LIST *)NULL; + } + + return (new_list); +} diff --git a/.pc/bash43-025.diff/variables.c b/.pc/bash43-025.diff/variables.c new file mode 100644 index 0000000..cdc54bc --- /dev/null +++ b/.pc/bash43-025.diff/variables.c @@ -0,0 +1,5331 @@ +/* variables.c -- Functions for hacking shell variables. */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" +#include "posixstat.h" +#include "posixtime.h" + +#if defined (__QNX__) +# if defined (__QNXNTO__) +# include +# else +# include +# endif /* !__QNXNTO__ */ +#endif /* __QNX__ */ + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include "chartypes.h" +#if defined (HAVE_PWD_H) +# include +#endif +#include "bashansi.h" +#include "bashintl.h" + +#define NEED_XTRACE_SET_DECL + +#include "shell.h" +#include "flags.h" +#include "execute_cmd.h" +#include "findcmd.h" +#include "mailcheck.h" +#include "input.h" +#include "hashcmd.h" +#include "pathexp.h" +#include "alias.h" +#include "jobs.h" + +#include "version.h" + +#include "builtins/getopt.h" +#include "builtins/common.h" +#include "builtins/builtext.h" + +#if defined (READLINE) +# include "bashline.h" +# include +#else +# include +#endif + +#if defined (HISTORY) +# include "bashhist.h" +# include +#endif /* HISTORY */ + +#if defined (PROGRAMMABLE_COMPLETION) +# include "pcomplete.h" +#endif + +#define TEMPENV_HASH_BUCKETS 4 /* must be power of two */ + +#define ifsname(s) ((s)[0] == 'I' && (s)[1] == 'F' && (s)[2] == 'S' && (s)[3] == '\0') + +extern char **environ; + +/* Variables used here and defined in other files. */ +extern int posixly_correct; +extern int line_number, line_number_base; +extern int subshell_environment, indirection_level, subshell_level; +extern int build_version, patch_level; +extern int expanding_redir; +extern int last_command_exit_value; +extern char *dist_version, *release_status; +extern char *shell_name; +extern char *primary_prompt, *secondary_prompt; +extern char *current_host_name; +extern sh_builtin_func_t *this_shell_builtin; +extern SHELL_VAR *this_shell_function; +extern char *the_printed_command_except_trap; +extern char *this_command_name; +extern char *command_execution_string; +extern time_t shell_start_time; +extern int assigning_in_environment; +extern int executing_builtin; +extern int funcnest_max; + +#if defined (READLINE) +extern int no_line_editing; +extern int perform_hostname_completion; +#endif + +/* The list of shell variables that the user has created at the global + scope, or that came from the environment. */ +VAR_CONTEXT *global_variables = (VAR_CONTEXT *)NULL; + +/* The current list of shell variables, including function scopes */ +VAR_CONTEXT *shell_variables = (VAR_CONTEXT *)NULL; + +/* The list of shell functions that the user has created, or that came from + the environment. */ +HASH_TABLE *shell_functions = (HASH_TABLE *)NULL; + +#if defined (DEBUGGER) +/* The table of shell function definitions that the user defined or that + came from the environment. */ +HASH_TABLE *shell_function_defs = (HASH_TABLE *)NULL; +#endif + +/* The current variable context. This is really a count of how deep into + executing functions we are. */ +int variable_context = 0; + +/* The set of shell assignments which are made only in the environment + for a single command. */ +HASH_TABLE *temporary_env = (HASH_TABLE *)NULL; + +/* Set to non-zero if an assignment error occurs while putting variables + into the temporary environment. */ +int tempenv_assign_error; + +/* Some funky variables which are known about specially. Here is where + "$*", "$1", and all the cruft is kept. */ +char *dollar_vars[10]; +WORD_LIST *rest_of_args = (WORD_LIST *)NULL; + +/* The value of $$. */ +pid_t dollar_dollar_pid; + +/* Non-zero means that we have to remake EXPORT_ENV. */ +int array_needs_making = 1; + +/* The number of times BASH has been executed. This is set + by initialize_variables (). */ +int shell_level = 0; + +/* An array which is passed to commands as their environment. It is + manufactured from the union of the initial environment and the + shell variables that are marked for export. */ +char **export_env = (char **)NULL; +static int export_env_index; +static int export_env_size; + +#if defined (READLINE) +static int winsize_assignment; /* currently assigning to LINES or COLUMNS */ +#endif + +static HASH_TABLE *last_table_searched; /* hash_lookup sets this */ + +/* Some forward declarations. */ +static void create_variable_tables __P((void)); + +static void set_machine_vars __P((void)); +static void set_home_var __P((void)); +static void set_shell_var __P((void)); +static char *get_bash_name __P((void)); +static void initialize_shell_level __P((void)); +static void uidset __P((void)); +#if defined (ARRAY_VARS) +static void make_vers_array __P((void)); +#endif + +static SHELL_VAR *null_assign __P((SHELL_VAR *, char *, arrayind_t, char *)); +#if defined (ARRAY_VARS) +static SHELL_VAR *null_array_assign __P((SHELL_VAR *, char *, arrayind_t, char *)); +#endif +static SHELL_VAR *get_self __P((SHELL_VAR *)); + +#if defined (ARRAY_VARS) +static SHELL_VAR *init_dynamic_array_var __P((char *, sh_var_value_func_t *, sh_var_assign_func_t *, int)); +static SHELL_VAR *init_dynamic_assoc_var __P((char *, sh_var_value_func_t *, sh_var_assign_func_t *, int)); +#endif + +static SHELL_VAR *assign_seconds __P((SHELL_VAR *, char *, arrayind_t, char *)); +static SHELL_VAR *get_seconds __P((SHELL_VAR *)); +static SHELL_VAR *init_seconds_var __P((void)); + +static int brand __P((void)); +static void sbrand __P((unsigned long)); /* set bash random number generator. */ +static void seedrand __P((void)); /* seed generator randomly */ +static SHELL_VAR *assign_random __P((SHELL_VAR *, char *, arrayind_t, char *)); +static SHELL_VAR *get_random __P((SHELL_VAR *)); + +static SHELL_VAR *assign_lineno __P((SHELL_VAR *, char *, arrayind_t, char *)); +static SHELL_VAR *get_lineno __P((SHELL_VAR *)); + +static SHELL_VAR *assign_subshell __P((SHELL_VAR *, char *, arrayind_t, char *)); +static SHELL_VAR *get_subshell __P((SHELL_VAR *)); + +static SHELL_VAR *get_bashpid __P((SHELL_VAR *)); + +#if defined (HISTORY) +static SHELL_VAR *get_histcmd __P((SHELL_VAR *)); +#endif + +#if defined (READLINE) +static SHELL_VAR *get_comp_wordbreaks __P((SHELL_VAR *)); +static SHELL_VAR *assign_comp_wordbreaks __P((SHELL_VAR *, char *, arrayind_t, char *)); +#endif + +#if defined (PUSHD_AND_POPD) && defined (ARRAY_VARS) +static SHELL_VAR *assign_dirstack __P((SHELL_VAR *, char *, arrayind_t, char *)); +static SHELL_VAR *get_dirstack __P((SHELL_VAR *)); +#endif + +#if defined (ARRAY_VARS) +static SHELL_VAR *get_groupset __P((SHELL_VAR *)); + +static SHELL_VAR *build_hashcmd __P((SHELL_VAR *)); +static SHELL_VAR *get_hashcmd __P((SHELL_VAR *)); +static SHELL_VAR *assign_hashcmd __P((SHELL_VAR *, char *, arrayind_t, char *)); +# if defined (ALIAS) +static SHELL_VAR *build_aliasvar __P((SHELL_VAR *)); +static SHELL_VAR *get_aliasvar __P((SHELL_VAR *)); +static SHELL_VAR *assign_aliasvar __P((SHELL_VAR *, char *, arrayind_t, char *)); +# endif +#endif + +static SHELL_VAR *get_funcname __P((SHELL_VAR *)); +static SHELL_VAR *init_funcname_var __P((void)); + +static void initialize_dynamic_variables __P((void)); + +static SHELL_VAR *hash_lookup __P((const char *, HASH_TABLE *)); +static SHELL_VAR *new_shell_variable __P((const char *)); +static SHELL_VAR *make_new_variable __P((const char *, HASH_TABLE *)); +static SHELL_VAR *bind_variable_internal __P((const char *, char *, HASH_TABLE *, int, int)); + +static void dispose_variable_value __P((SHELL_VAR *)); +static void free_variable_hash_data __P((PTR_T)); + +static VARLIST *vlist_alloc __P((int)); +static VARLIST *vlist_realloc __P((VARLIST *, int)); +static void vlist_add __P((VARLIST *, SHELL_VAR *, int)); + +static void flatten __P((HASH_TABLE *, sh_var_map_func_t *, VARLIST *, int)); + +static int qsort_var_comp __P((SHELL_VAR **, SHELL_VAR **)); + +static SHELL_VAR **vapply __P((sh_var_map_func_t *)); +static SHELL_VAR **fapply __P((sh_var_map_func_t *)); + +static int visible_var __P((SHELL_VAR *)); +static int visible_and_exported __P((SHELL_VAR *)); +static int export_environment_candidate __P((SHELL_VAR *)); +static int local_and_exported __P((SHELL_VAR *)); +static int variable_in_context __P((SHELL_VAR *)); +#if defined (ARRAY_VARS) +static int visible_array_vars __P((SHELL_VAR *)); +#endif + +static SHELL_VAR *find_nameref_at_context __P((SHELL_VAR *, VAR_CONTEXT *)); +static SHELL_VAR *find_variable_nameref_context __P((SHELL_VAR *, VAR_CONTEXT *, VAR_CONTEXT **)); +static SHELL_VAR *find_variable_last_nameref_context __P((SHELL_VAR *, VAR_CONTEXT *, VAR_CONTEXT **)); + +static SHELL_VAR *bind_tempenv_variable __P((const char *, char *)); +static void push_temp_var __P((PTR_T)); +static void propagate_temp_var __P((PTR_T)); +static void dispose_temporary_env __P((sh_free_func_t *)); + +static inline char *mk_env_string __P((const char *, const char *)); +static char **make_env_array_from_var_list __P((SHELL_VAR **)); +static char **make_var_export_array __P((VAR_CONTEXT *)); +static char **make_func_export_array __P((void)); +static void add_temp_array_to_env __P((char **, int, int)); + +static int n_shell_variables __P((void)); +static int set_context __P((SHELL_VAR *)); + +static void push_func_var __P((PTR_T)); +static void push_exported_var __P((PTR_T)); + +static inline int find_special_var __P((const char *)); + +static void +create_variable_tables () +{ + if (shell_variables == 0) + { + shell_variables = global_variables = new_var_context ((char *)NULL, 0); + shell_variables->scope = 0; + shell_variables->table = hash_create (0); + } + + if (shell_functions == 0) + shell_functions = hash_create (0); + +#if defined (DEBUGGER) + if (shell_function_defs == 0) + shell_function_defs = hash_create (0); +#endif +} + +/* Initialize the shell variables from the current environment. + If PRIVMODE is nonzero, don't import functions from ENV or + parse $SHELLOPTS. */ +void +initialize_shell_variables (env, privmode) + char **env; + int privmode; +{ + char *name, *string, *temp_string; + int c, char_index, string_index, string_length, ro; + SHELL_VAR *temp_var; + + create_variable_tables (); + + for (string_index = 0; string = env[string_index++]; ) + { + char_index = 0; + name = string; + while ((c = *string++) && c != '=') + ; + if (string[-1] == '=') + char_index = string - name - 1; + + /* If there are weird things in the environment, like `=xxx' or a + string without an `=', just skip them. */ + if (char_index == 0) + continue; + + /* ASSERT(name[char_index] == '=') */ + name[char_index] = '\0'; + /* Now, name = env variable name, string = env variable value, and + char_index == strlen (name) */ + + temp_var = (SHELL_VAR *)NULL; + + /* If exported function, define it now. Don't import functions from + the environment in privileged mode. */ + if (privmode == 0 && read_but_dont_execute == 0 && STREQN ("() {", string, 4)) + { + string_length = strlen (string); + temp_string = (char *)xmalloc (3 + string_length + char_index); + + strcpy (temp_string, name); + temp_string[char_index] = ' '; + strcpy (temp_string + char_index + 1, string); + + if (posixly_correct == 0 || legal_identifier (name)) + parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST); + + /* Ancient backwards compatibility. Old versions of bash exported + functions like name()=() {...} */ + if (name[char_index - 1] == ')' && name[char_index - 2] == '(') + name[char_index - 2] = '\0'; + + if (temp_var = find_function (name)) + { + VSETATTR (temp_var, (att_exported|att_imported)); + array_needs_making = 1; + } + else + { + if (temp_var = bind_variable (name, string, 0)) + { + VSETATTR (temp_var, (att_exported | att_imported | att_invisible)); + array_needs_making = 1; + } + last_command_exit_value = 1; + report_error (_("error importing function definition for `%s'"), name); + } + + /* ( */ + if (name[char_index - 1] == ')' && name[char_index - 2] == '\0') + name[char_index - 2] = '('; /* ) */ + } +#if defined (ARRAY_VARS) +# if ARRAY_EXPORT + /* Array variables may not yet be exported. */ + else if (*string == '(' && string[1] == '[' && string[strlen (string) - 1] == ')') + { + string_length = 1; + temp_string = extract_array_assignment_list (string, &string_length); + temp_var = assign_array_from_string (name, temp_string); + FREE (temp_string); + VSETATTR (temp_var, (att_exported | att_imported)); + array_needs_making = 1; + } +# endif /* ARRAY_EXPORT */ +#endif +#if 0 + else if (legal_identifier (name)) +#else + else +#endif + { + ro = 0; + if (posixly_correct && STREQ (name, "SHELLOPTS")) + { + temp_var = find_variable ("SHELLOPTS"); + ro = temp_var && readonly_p (temp_var); + if (temp_var) + VUNSETATTR (temp_var, att_readonly); + } + temp_var = bind_variable (name, string, 0); + if (temp_var) + { + if (legal_identifier (name)) + VSETATTR (temp_var, (att_exported | att_imported)); + else + VSETATTR (temp_var, (att_exported | att_imported | att_invisible)); + if (ro) + VSETATTR (temp_var, att_readonly); + array_needs_making = 1; + } + } + + name[char_index] = '='; + /* temp_var can be NULL if it was an exported function with a syntax + error (a different bug, but it still shouldn't dump core). */ + if (temp_var && function_p (temp_var) == 0) /* XXX not yet */ + { + CACHE_IMPORTSTR (temp_var, name); + } + } + + set_pwd (); + + /* Set up initial value of $_ */ + temp_var = set_if_not ("_", dollar_vars[0]); + + /* Remember this pid. */ + dollar_dollar_pid = getpid (); + + /* Now make our own defaults in case the vars that we think are + important are missing. */ + temp_var = set_if_not ("PATH", DEFAULT_PATH_VALUE); +#if 0 + set_auto_export (temp_var); /* XXX */ +#endif + + temp_var = set_if_not ("TERM", "dumb"); +#if 0 + set_auto_export (temp_var); /* XXX */ +#endif + +#if defined (__QNX__) + /* set node id -- don't import it from the environment */ + { + char node_name[22]; +# if defined (__QNXNTO__) + netmgr_ndtostr(ND2S_LOCAL_STR, ND_LOCAL_NODE, node_name, sizeof(node_name)); +# else + qnx_nidtostr (getnid (), node_name, sizeof (node_name)); +# endif + temp_var = bind_variable ("NODE", node_name, 0); + set_auto_export (temp_var); + } +#endif + + /* set up the prompts. */ + if (interactive_shell) + { +#if defined (PROMPT_STRING_DECODE) + set_if_not ("PS1", primary_prompt); +#else + if (current_user.uid == -1) + get_current_user_info (); + set_if_not ("PS1", current_user.euid == 0 ? "# " : primary_prompt); +#endif + set_if_not ("PS2", secondary_prompt); + } + set_if_not ("PS4", "+ "); + + /* Don't allow IFS to be imported from the environment. */ + temp_var = bind_variable ("IFS", " \t\n", 0); + setifs (temp_var); + + /* Magic machine types. Pretty convenient. */ + set_machine_vars (); + + /* Default MAILCHECK for interactive shells. Defer the creation of a + default MAILPATH until the startup files are read, because MAIL + names a mail file if MAILPATH is not set, and we should provide a + default only if neither is set. */ + if (interactive_shell) + { + temp_var = set_if_not ("MAILCHECK", posixly_correct ? "600" : "60"); + VSETATTR (temp_var, att_integer); + } + + /* Do some things with shell level. */ + initialize_shell_level (); + + set_ppid (); + + /* Initialize the `getopts' stuff. */ + temp_var = bind_variable ("OPTIND", "1", 0); + VSETATTR (temp_var, att_integer); + getopts_reset (0); + bind_variable ("OPTERR", "1", 0); + sh_opterr = 1; + + if (login_shell == 1 && posixly_correct == 0) + set_home_var (); + + /* Get the full pathname to THIS shell, and set the BASH variable + to it. */ + name = get_bash_name (); + temp_var = bind_variable ("BASH", name, 0); + free (name); + + /* Make the exported environment variable SHELL be the user's login + shell. Note that the `tset' command looks at this variable + to determine what style of commands to output; if it ends in "csh", + then C-shell commands are output, else Bourne shell commands. */ + set_shell_var (); + + /* Make a variable called BASH_VERSION which contains the version info. */ + bind_variable ("BASH_VERSION", shell_version_string (), 0); +#if defined (ARRAY_VARS) + make_vers_array (); +#endif + + if (command_execution_string) + bind_variable ("BASH_EXECUTION_STRING", command_execution_string, 0); + + /* Find out if we're supposed to be in Posix.2 mode via an + environment variable. */ + temp_var = find_variable ("POSIXLY_CORRECT"); + if (!temp_var) + temp_var = find_variable ("POSIX_PEDANTIC"); + if (temp_var && imported_p (temp_var)) + sv_strict_posix (temp_var->name); + +#if defined (HISTORY) + /* Set history variables to defaults, and then do whatever we would + do if the variable had just been set. Do this only in the case + that we are remembering commands on the history list. */ + if (remember_on_history) + { + name = bash_tilde_expand (posixly_correct ? "~/.sh_history" : "~/.bash_history", 0); + + set_if_not ("HISTFILE", name); + free (name); + } +#endif /* HISTORY */ + + /* Seed the random number generator. */ + seedrand (); + + /* Handle some "special" variables that we may have inherited from a + parent shell. */ + if (interactive_shell) + { + temp_var = find_variable ("IGNOREEOF"); + if (!temp_var) + temp_var = find_variable ("ignoreeof"); + if (temp_var && imported_p (temp_var)) + sv_ignoreeof (temp_var->name); + } + +#if defined (HISTORY) + if (interactive_shell && remember_on_history) + { + sv_history_control ("HISTCONTROL"); + sv_histignore ("HISTIGNORE"); + sv_histtimefmt ("HISTTIMEFORMAT"); + } +#endif /* HISTORY */ + +#if defined (READLINE) && defined (STRICT_POSIX) + /* POSIXLY_CORRECT will only be 1 here if the shell was compiled + -DSTRICT_POSIX */ + if (interactive_shell && posixly_correct && no_line_editing == 0) + rl_prefer_env_winsize = 1; +#endif /* READLINE && STRICT_POSIX */ + + /* + * 24 October 2001 + * + * I'm tired of the arguing and bug reports. Bash now leaves SSH_CLIENT + * and SSH2_CLIENT alone. I'm going to rely on the shell_level check in + * isnetconn() to avoid running the startup files more often than wanted. + * That will, of course, only work if the user's login shell is bash, so + * I've made that behavior conditional on SSH_SOURCE_BASHRC being defined + * in config-top.h. + */ +#if 0 + temp_var = find_variable ("SSH_CLIENT"); + if (temp_var && imported_p (temp_var)) + { + VUNSETATTR (temp_var, att_exported); + array_needs_making = 1; + } + temp_var = find_variable ("SSH2_CLIENT"); + if (temp_var && imported_p (temp_var)) + { + VUNSETATTR (temp_var, att_exported); + array_needs_making = 1; + } +#endif + + /* Get the user's real and effective user ids. */ + uidset (); + + temp_var = find_variable ("BASH_XTRACEFD"); + if (temp_var && imported_p (temp_var)) + sv_xtracefd (temp_var->name); + + /* Initialize the dynamic variables, and seed their values. */ + initialize_dynamic_variables (); +} + +/* **************************************************************** */ +/* */ +/* Setting values for special shell variables */ +/* */ +/* **************************************************************** */ + +static void +set_machine_vars () +{ + SHELL_VAR *temp_var; + + temp_var = set_if_not ("HOSTTYPE", HOSTTYPE); + temp_var = set_if_not ("OSTYPE", OSTYPE); + temp_var = set_if_not ("MACHTYPE", MACHTYPE); + + temp_var = set_if_not ("HOSTNAME", current_host_name); +} + +/* Set $HOME to the information in the password file if we didn't get + it from the environment. */ + +/* This function is not static so the tilde and readline libraries can + use it. */ +char * +sh_get_home_dir () +{ + if (current_user.home_dir == 0) + get_current_user_info (); + return current_user.home_dir; +} + +static void +set_home_var () +{ + SHELL_VAR *temp_var; + + temp_var = find_variable ("HOME"); + if (temp_var == 0) + temp_var = bind_variable ("HOME", sh_get_home_dir (), 0); +#if 0 + VSETATTR (temp_var, att_exported); +#endif +} + +/* Set $SHELL to the user's login shell if it is not already set. Call + get_current_user_info if we haven't already fetched the shell. */ +static void +set_shell_var () +{ + SHELL_VAR *temp_var; + + temp_var = find_variable ("SHELL"); + if (temp_var == 0) + { + if (current_user.shell == 0) + get_current_user_info (); + temp_var = bind_variable ("SHELL", current_user.shell, 0); + } +#if 0 + VSETATTR (temp_var, att_exported); +#endif +} + +static char * +get_bash_name () +{ + char *name; + + if ((login_shell == 1) && RELPATH(shell_name)) + { + if (current_user.shell == 0) + get_current_user_info (); + name = savestring (current_user.shell); + } + else if (ABSPATH(shell_name)) + name = savestring (shell_name); + else if (shell_name[0] == '.' && shell_name[1] == '/') + { + /* Fast path for common case. */ + char *cdir; + int len; + + cdir = get_string_value ("PWD"); + if (cdir) + { + len = strlen (cdir); + name = (char *)xmalloc (len + strlen (shell_name) + 1); + strcpy (name, cdir); + strcpy (name + len, shell_name + 1); + } + else + name = savestring (shell_name); + } + else + { + char *tname; + int s; + + tname = find_user_command (shell_name); + + if (tname == 0) + { + /* Try the current directory. If there is not an executable + there, just punt and use the login shell. */ + s = file_status (shell_name); + if (s & FS_EXECABLE) + { + tname = make_absolute (shell_name, get_string_value ("PWD")); + if (*shell_name == '.') + { + name = sh_canonpath (tname, PATH_CHECKDOTDOT|PATH_CHECKEXISTS); + if (name == 0) + name = tname; + else + free (tname); + } + else + name = tname; + } + else + { + if (current_user.shell == 0) + get_current_user_info (); + name = savestring (current_user.shell); + } + } + else + { + name = full_pathname (tname); + free (tname); + } + } + + return (name); +} + +void +adjust_shell_level (change) + int change; +{ + char new_level[5], *old_SHLVL; + intmax_t old_level; + SHELL_VAR *temp_var; + + old_SHLVL = get_string_value ("SHLVL"); + if (old_SHLVL == 0 || *old_SHLVL == '\0' || legal_number (old_SHLVL, &old_level) == 0) + old_level = 0; + + shell_level = old_level + change; + if (shell_level < 0) + shell_level = 0; + else if (shell_level > 1000) + { + internal_warning (_("shell level (%d) too high, resetting to 1"), shell_level); + shell_level = 1; + } + + /* We don't need the full generality of itos here. */ + if (shell_level < 10) + { + new_level[0] = shell_level + '0'; + new_level[1] = '\0'; + } + else if (shell_level < 100) + { + new_level[0] = (shell_level / 10) + '0'; + new_level[1] = (shell_level % 10) + '0'; + new_level[2] = '\0'; + } + else if (shell_level < 1000) + { + new_level[0] = (shell_level / 100) + '0'; + old_level = shell_level % 100; + new_level[1] = (old_level / 10) + '0'; + new_level[2] = (old_level % 10) + '0'; + new_level[3] = '\0'; + } + + temp_var = bind_variable ("SHLVL", new_level, 0); + set_auto_export (temp_var); +} + +static void +initialize_shell_level () +{ + adjust_shell_level (1); +} + +/* If we got PWD from the environment, update our idea of the current + working directory. In any case, make sure that PWD exists before + checking it. It is possible for getcwd () to fail on shell startup, + and in that case, PWD would be undefined. If this is an interactive + login shell, see if $HOME is the current working directory, and if + that's not the same string as $PWD, set PWD=$HOME. */ + +void +set_pwd () +{ + SHELL_VAR *temp_var, *home_var; + char *temp_string, *home_string; + + home_var = find_variable ("HOME"); + home_string = home_var ? value_cell (home_var) : (char *)NULL; + + temp_var = find_variable ("PWD"); + if (temp_var && imported_p (temp_var) && + (temp_string = value_cell (temp_var)) && + same_file (temp_string, ".", (struct stat *)NULL, (struct stat *)NULL)) + set_working_directory (temp_string); + else if (home_string && interactive_shell && login_shell && + same_file (home_string, ".", (struct stat *)NULL, (struct stat *)NULL)) + { + set_working_directory (home_string); + temp_var = bind_variable ("PWD", home_string, 0); + set_auto_export (temp_var); + } + else + { + temp_string = get_working_directory ("shell-init"); + if (temp_string) + { + temp_var = bind_variable ("PWD", temp_string, 0); + set_auto_export (temp_var); + free (temp_string); + } + } + + /* According to the Single Unix Specification, v2, $OLDPWD is an + `environment variable' and therefore should be auto-exported. + Make a dummy invisible variable for OLDPWD, and mark it as exported. */ + temp_var = bind_variable ("OLDPWD", (char *)NULL, 0); + VSETATTR (temp_var, (att_exported | att_invisible)); +} + +/* Make a variable $PPID, which holds the pid of the shell's parent. */ +void +set_ppid () +{ + char namebuf[INT_STRLEN_BOUND(pid_t) + 1], *name; + SHELL_VAR *temp_var; + + name = inttostr (getppid (), namebuf, sizeof(namebuf)); + temp_var = find_variable ("PPID"); + if (temp_var) + VUNSETATTR (temp_var, (att_readonly | att_exported)); + temp_var = bind_variable ("PPID", name, 0); + VSETATTR (temp_var, (att_readonly | att_integer)); +} + +static void +uidset () +{ + char buff[INT_STRLEN_BOUND(uid_t) + 1], *b; + register SHELL_VAR *v; + + b = inttostr (current_user.uid, buff, sizeof (buff)); + v = find_variable ("UID"); + if (v == 0) + { + v = bind_variable ("UID", b, 0); + VSETATTR (v, (att_readonly | att_integer)); + } + + if (current_user.euid != current_user.uid) + b = inttostr (current_user.euid, buff, sizeof (buff)); + + v = find_variable ("EUID"); + if (v == 0) + { + v = bind_variable ("EUID", b, 0); + VSETATTR (v, (att_readonly | att_integer)); + } +} + +#if defined (ARRAY_VARS) +static void +make_vers_array () +{ + SHELL_VAR *vv; + ARRAY *av; + char *s, d[32], b[INT_STRLEN_BOUND(int) + 1]; + + unbind_variable ("BASH_VERSINFO"); + + vv = make_new_array_variable ("BASH_VERSINFO"); + av = array_cell (vv); + strcpy (d, dist_version); + s = strchr (d, '.'); + if (s) + *s++ = '\0'; + array_insert (av, 0, d); + array_insert (av, 1, s); + s = inttostr (patch_level, b, sizeof (b)); + array_insert (av, 2, s); + s = inttostr (build_version, b, sizeof (b)); + array_insert (av, 3, s); + array_insert (av, 4, release_status); + array_insert (av, 5, MACHTYPE); + + VSETATTR (vv, att_readonly); +} +#endif /* ARRAY_VARS */ + +/* Set the environment variables $LINES and $COLUMNS in response to + a window size change. */ +void +sh_set_lines_and_columns (lines, cols) + int lines, cols; +{ + char val[INT_STRLEN_BOUND(int) + 1], *v; + +#if defined (READLINE) + /* If we are currently assigning to LINES or COLUMNS, don't do anything. */ + if (winsize_assignment) + return; +#endif + + v = inttostr (lines, val, sizeof (val)); + bind_variable ("LINES", v, 0); + + v = inttostr (cols, val, sizeof (val)); + bind_variable ("COLUMNS", v, 0); +} + +/* **************************************************************** */ +/* */ +/* Printing variables and values */ +/* */ +/* **************************************************************** */ + +/* Print LIST (a list of shell variables) to stdout in such a way that + they can be read back in. */ +void +print_var_list (list) + register SHELL_VAR **list; +{ + register int i; + register SHELL_VAR *var; + + for (i = 0; list && (var = list[i]); i++) + if (invisible_p (var) == 0) + print_assignment (var); +} + +/* Print LIST (a list of shell functions) to stdout in such a way that + they can be read back in. */ +void +print_func_list (list) + register SHELL_VAR **list; +{ + register int i; + register SHELL_VAR *var; + + for (i = 0; list && (var = list[i]); i++) + { + printf ("%s ", var->name); + print_var_function (var); + printf ("\n"); + } +} + +/* Print the value of a single SHELL_VAR. No newline is + output, but the variable is printed in such a way that + it can be read back in. */ +void +print_assignment (var) + SHELL_VAR *var; +{ + if (var_isset (var) == 0) + return; + + if (function_p (var)) + { + printf ("%s", var->name); + print_var_function (var); + printf ("\n"); + } +#if defined (ARRAY_VARS) + else if (array_p (var)) + print_array_assignment (var, 0); + else if (assoc_p (var)) + print_assoc_assignment (var, 0); +#endif /* ARRAY_VARS */ + else + { + printf ("%s=", var->name); + print_var_value (var, 1); + printf ("\n"); + } +} + +/* Print the value cell of VAR, a shell variable. Do not print + the name, nor leading/trailing newline. If QUOTE is non-zero, + and the value contains shell metacharacters, quote the value + in such a way that it can be read back in. */ +void +print_var_value (var, quote) + SHELL_VAR *var; + int quote; +{ + char *t; + + if (var_isset (var) == 0) + return; + + if (quote && posixly_correct == 0 && ansic_shouldquote (value_cell (var))) + { + t = ansic_quote (value_cell (var), 0, (int *)0); + printf ("%s", t); + free (t); + } + else if (quote && sh_contains_shell_metas (value_cell (var))) + { + t = sh_single_quote (value_cell (var)); + printf ("%s", t); + free (t); + } + else + printf ("%s", value_cell (var)); +} + +/* Print the function cell of VAR, a shell variable. Do not + print the name, nor leading/trailing newline. */ +void +print_var_function (var) + SHELL_VAR *var; +{ + char *x; + + if (function_p (var) && var_isset (var)) + { + x = named_function_string ((char *)NULL, function_cell(var), FUNC_MULTILINE|FUNC_EXTERNAL); + printf ("%s", x); + } +} + +/* **************************************************************** */ +/* */ +/* Dynamic Variables */ +/* */ +/* **************************************************************** */ + +/* DYNAMIC VARIABLES + + These are variables whose values are generated anew each time they are + referenced. These are implemented using a pair of function pointers + in the struct variable: assign_func, which is called from bind_variable + and, if arrays are compiled into the shell, some of the functions in + arrayfunc.c, and dynamic_value, which is called from find_variable. + + assign_func is called from bind_variable_internal, if + bind_variable_internal discovers that the variable being assigned to + has such a function. The function is called as + SHELL_VAR *temp = (*(entry->assign_func)) (entry, value, ind) + and the (SHELL_VAR *)temp is returned as the value of bind_variable. It + is usually ENTRY (self). IND is an index for an array variable, and + unused otherwise. + + dynamic_value is called from find_variable_internal to return a `new' + value for the specified dynamic varible. If this function is NULL, + the variable is treated as a `normal' shell variable. If it is not, + however, then this function is called like this: + tempvar = (*(var->dynamic_value)) (var); + + Sometimes `tempvar' will replace the value of `var'. Other times, the + shell will simply use the string value. Pretty object-oriented, huh? + + Be warned, though: if you `unset' a special variable, it loses its + special meaning, even if you subsequently set it. + + The special assignment code would probably have been better put in + subst.c: do_assignment_internal, in the same style as + stupidly_hack_special_variables, but I wanted the changes as + localized as possible. */ + +#define INIT_DYNAMIC_VAR(var, val, gfunc, afunc) \ + do \ + { \ + v = bind_variable (var, (val), 0); \ + v->dynamic_value = gfunc; \ + v->assign_func = afunc; \ + } \ + while (0) + +#define INIT_DYNAMIC_ARRAY_VAR(var, gfunc, afunc) \ + do \ + { \ + v = make_new_array_variable (var); \ + v->dynamic_value = gfunc; \ + v->assign_func = afunc; \ + } \ + while (0) + +#define INIT_DYNAMIC_ASSOC_VAR(var, gfunc, afunc) \ + do \ + { \ + v = make_new_assoc_variable (var); \ + v->dynamic_value = gfunc; \ + v->assign_func = afunc; \ + } \ + while (0) + +static SHELL_VAR * +null_assign (self, value, unused, key) + SHELL_VAR *self; + char *value; + arrayind_t unused; + char *key; +{ + return (self); +} + +#if defined (ARRAY_VARS) +static SHELL_VAR * +null_array_assign (self, value, ind, key) + SHELL_VAR *self; + char *value; + arrayind_t ind; + char *key; +{ + return (self); +} +#endif + +/* Degenerate `dynamic_value' function; just returns what's passed without + manipulation. */ +static SHELL_VAR * +get_self (self) + SHELL_VAR *self; +{ + return (self); +} + +#if defined (ARRAY_VARS) +/* A generic dynamic array variable initializer. Initialize array variable + NAME with dynamic value function GETFUNC and assignment function SETFUNC. */ +static SHELL_VAR * +init_dynamic_array_var (name, getfunc, setfunc, attrs) + char *name; + sh_var_value_func_t *getfunc; + sh_var_assign_func_t *setfunc; + int attrs; +{ + SHELL_VAR *v; + + v = find_variable (name); + if (v) + return (v); + INIT_DYNAMIC_ARRAY_VAR (name, getfunc, setfunc); + if (attrs) + VSETATTR (v, attrs); + return v; +} + +static SHELL_VAR * +init_dynamic_assoc_var (name, getfunc, setfunc, attrs) + char *name; + sh_var_value_func_t *getfunc; + sh_var_assign_func_t *setfunc; + int attrs; +{ + SHELL_VAR *v; + + v = find_variable (name); + if (v) + return (v); + INIT_DYNAMIC_ASSOC_VAR (name, getfunc, setfunc); + if (attrs) + VSETATTR (v, attrs); + return v; +} +#endif + +/* The value of $SECONDS. This is the number of seconds since shell + invocation, or, the number of seconds since the last assignment + the + value of the last assignment. */ +static intmax_t seconds_value_assigned; + +static SHELL_VAR * +assign_seconds (self, value, unused, key) + SHELL_VAR *self; + char *value; + arrayind_t unused; + char *key; +{ + if (legal_number (value, &seconds_value_assigned) == 0) + seconds_value_assigned = 0; + shell_start_time = NOW; + return (self); +} + +static SHELL_VAR * +get_seconds (var) + SHELL_VAR *var; +{ + time_t time_since_start; + char *p; + + time_since_start = NOW - shell_start_time; + p = itos(seconds_value_assigned + time_since_start); + + FREE (value_cell (var)); + + VSETATTR (var, att_integer); + var_setvalue (var, p); + return (var); +} + +static SHELL_VAR * +init_seconds_var () +{ + SHELL_VAR *v; + + v = find_variable ("SECONDS"); + if (v) + { + if (legal_number (value_cell(v), &seconds_value_assigned) == 0) + seconds_value_assigned = 0; + } + INIT_DYNAMIC_VAR ("SECONDS", (v ? value_cell (v) : (char *)NULL), get_seconds, assign_seconds); + return v; +} + +/* The random number seed. You can change this by setting RANDOM. */ +static unsigned long rseed = 1; +static int last_random_value; +static int seeded_subshell = 0; + +/* A linear congruential random number generator based on the example + one in the ANSI C standard. This one isn't very good, but a more + complicated one is overkill. */ + +/* Returns a pseudo-random number between 0 and 32767. */ +static int +brand () +{ + /* From "Random number generators: good ones are hard to find", + Park and Miller, Communications of the ACM, vol. 31, no. 10, + October 1988, p. 1195. filtered through FreeBSD */ + long h, l; + + /* Can't seed with 0. */ + if (rseed == 0) + rseed = 123459876; + h = rseed / 127773; + l = rseed % 127773; + rseed = 16807 * l - 2836 * h; +#if 0 + if (rseed < 0) + rseed += 0x7fffffff; +#endif + return ((unsigned int)(rseed & 32767)); /* was % 32768 */ +} + +/* Set the random number generator seed to SEED. */ +static void +sbrand (seed) + unsigned long seed; +{ + rseed = seed; + last_random_value = 0; +} + +static void +seedrand () +{ + struct timeval tv; + + gettimeofday (&tv, NULL); + sbrand (tv.tv_sec ^ tv.tv_usec ^ getpid ()); +} + +static SHELL_VAR * +assign_random (self, value, unused, key) + SHELL_VAR *self; + char *value; + arrayind_t unused; + char *key; +{ + sbrand (strtoul (value, (char **)NULL, 10)); + if (subshell_environment) + seeded_subshell = getpid (); + return (self); +} + +int +get_random_number () +{ + int rv, pid; + + /* Reset for command and process substitution. */ + pid = getpid (); + if (subshell_environment && seeded_subshell != pid) + { + seedrand (); + seeded_subshell = pid; + } + + do + rv = brand (); + while (rv == last_random_value); + return rv; +} + +static SHELL_VAR * +get_random (var) + SHELL_VAR *var; +{ + int rv; + char *p; + + rv = get_random_number (); + last_random_value = rv; + p = itos (rv); + + FREE (value_cell (var)); + + VSETATTR (var, att_integer); + var_setvalue (var, p); + return (var); +} + +static SHELL_VAR * +assign_lineno (var, value, unused, key) + SHELL_VAR *var; + char *value; + arrayind_t unused; + char *key; +{ + intmax_t new_value; + + if (value == 0 || *value == '\0' || legal_number (value, &new_value) == 0) + new_value = 0; + line_number = line_number_base = new_value; + return var; +} + +/* Function which returns the current line number. */ +static SHELL_VAR * +get_lineno (var) + SHELL_VAR *var; +{ + char *p; + int ln; + + ln = executing_line_number (); + p = itos (ln); + FREE (value_cell (var)); + var_setvalue (var, p); + return (var); +} + +static SHELL_VAR * +assign_subshell (var, value, unused, key) + SHELL_VAR *var; + char *value; + arrayind_t unused; + char *key; +{ + intmax_t new_value; + + if (value == 0 || *value == '\0' || legal_number (value, &new_value) == 0) + new_value = 0; + subshell_level = new_value; + return var; +} + +static SHELL_VAR * +get_subshell (var) + SHELL_VAR *var; +{ + char *p; + + p = itos (subshell_level); + FREE (value_cell (var)); + var_setvalue (var, p); + return (var); +} + +static SHELL_VAR * +get_bashpid (var) + SHELL_VAR *var; +{ + int pid; + char *p; + + pid = getpid (); + p = itos (pid); + + FREE (value_cell (var)); + VSETATTR (var, att_integer|att_readonly); + var_setvalue (var, p); + return (var); +} + +static SHELL_VAR * +get_bash_command (var) + SHELL_VAR *var; +{ + char *p; + + if (the_printed_command_except_trap) + p = savestring (the_printed_command_except_trap); + else + { + p = (char *)xmalloc (1); + p[0] = '\0'; + } + FREE (value_cell (var)); + var_setvalue (var, p); + return (var); +} + +#if defined (HISTORY) +static SHELL_VAR * +get_histcmd (var) + SHELL_VAR *var; +{ + char *p; + + p = itos (history_number ()); + FREE (value_cell (var)); + var_setvalue (var, p); + return (var); +} +#endif + +#if defined (READLINE) +/* When this function returns, VAR->value points to malloced memory. */ +static SHELL_VAR * +get_comp_wordbreaks (var) + SHELL_VAR *var; +{ + /* If we don't have anything yet, assign a default value. */ + if (rl_completer_word_break_characters == 0 && bash_readline_initialized == 0) + enable_hostname_completion (perform_hostname_completion); + + FREE (value_cell (var)); + var_setvalue (var, savestring (rl_completer_word_break_characters)); + + return (var); +} + +/* When this function returns, rl_completer_word_break_characters points to + malloced memory. */ +static SHELL_VAR * +assign_comp_wordbreaks (self, value, unused, key) + SHELL_VAR *self; + char *value; + arrayind_t unused; + char *key; +{ + if (rl_completer_word_break_characters && + rl_completer_word_break_characters != rl_basic_word_break_characters) + free (rl_completer_word_break_characters); + + rl_completer_word_break_characters = savestring (value); + return self; +} +#endif /* READLINE */ + +#if defined (PUSHD_AND_POPD) && defined (ARRAY_VARS) +static SHELL_VAR * +assign_dirstack (self, value, ind, key) + SHELL_VAR *self; + char *value; + arrayind_t ind; + char *key; +{ + set_dirstack_element (ind, 1, value); + return self; +} + +static SHELL_VAR * +get_dirstack (self) + SHELL_VAR *self; +{ + ARRAY *a; + WORD_LIST *l; + + l = get_directory_stack (0); + a = array_from_word_list (l); + array_dispose (array_cell (self)); + dispose_words (l); + var_setarray (self, a); + return self; +} +#endif /* PUSHD AND POPD && ARRAY_VARS */ + +#if defined (ARRAY_VARS) +/* We don't want to initialize the group set with a call to getgroups() + unless we're asked to, but we only want to do it once. */ +static SHELL_VAR * +get_groupset (self) + SHELL_VAR *self; +{ + register int i; + int ng; + ARRAY *a; + static char **group_set = (char **)NULL; + + if (group_set == 0) + { + group_set = get_group_list (&ng); + a = array_cell (self); + for (i = 0; i < ng; i++) + array_insert (a, i, group_set[i]); + } + return (self); +} + +static SHELL_VAR * +build_hashcmd (self) + SHELL_VAR *self; +{ + HASH_TABLE *h; + int i; + char *k, *v; + BUCKET_CONTENTS *item; + + h = assoc_cell (self); + if (h) + assoc_dispose (h); + + if (hashed_filenames == 0 || HASH_ENTRIES (hashed_filenames) == 0) + { + var_setvalue (self, (char *)NULL); + return self; + } + + h = assoc_create (hashed_filenames->nbuckets); + for (i = 0; i < hashed_filenames->nbuckets; i++) + { + for (item = hash_items (i, hashed_filenames); item; item = item->next) + { + k = savestring (item->key); + v = pathdata(item)->path; + assoc_insert (h, k, v); + } + } + + var_setvalue (self, (char *)h); + return self; +} + +static SHELL_VAR * +get_hashcmd (self) + SHELL_VAR *self; +{ + build_hashcmd (self); + return (self); +} + +static SHELL_VAR * +assign_hashcmd (self, value, ind, key) + SHELL_VAR *self; + char *value; + arrayind_t ind; + char *key; +{ + phash_insert (key, value, 0, 0); + return (build_hashcmd (self)); +} + +#if defined (ALIAS) +static SHELL_VAR * +build_aliasvar (self) + SHELL_VAR *self; +{ + HASH_TABLE *h; + int i; + char *k, *v; + BUCKET_CONTENTS *item; + + h = assoc_cell (self); + if (h) + assoc_dispose (h); + + if (aliases == 0 || HASH_ENTRIES (aliases) == 0) + { + var_setvalue (self, (char *)NULL); + return self; + } + + h = assoc_create (aliases->nbuckets); + for (i = 0; i < aliases->nbuckets; i++) + { + for (item = hash_items (i, aliases); item; item = item->next) + { + k = savestring (item->key); + v = ((alias_t *)(item->data))->value; + assoc_insert (h, k, v); + } + } + + var_setvalue (self, (char *)h); + return self; +} + +static SHELL_VAR * +get_aliasvar (self) + SHELL_VAR *self; +{ + build_aliasvar (self); + return (self); +} + +static SHELL_VAR * +assign_aliasvar (self, value, ind, key) + SHELL_VAR *self; + char *value; + arrayind_t ind; + char *key; +{ + add_alias (key, value); + return (build_aliasvar (self)); +} +#endif /* ALIAS */ + +#endif /* ARRAY_VARS */ + +/* If ARRAY_VARS is not defined, this just returns the name of any + currently-executing function. If we have arrays, it's a call stack. */ +static SHELL_VAR * +get_funcname (self) + SHELL_VAR *self; +{ +#if ! defined (ARRAY_VARS) + char *t; + if (variable_context && this_shell_function) + { + FREE (value_cell (self)); + t = savestring (this_shell_function->name); + var_setvalue (self, t); + } +#endif + return (self); +} + +void +make_funcname_visible (on_or_off) + int on_or_off; +{ + SHELL_VAR *v; + + v = find_variable ("FUNCNAME"); + if (v == 0 || v->dynamic_value == 0) + return; + + if (on_or_off) + VUNSETATTR (v, att_invisible); + else + VSETATTR (v, att_invisible); +} + +static SHELL_VAR * +init_funcname_var () +{ + SHELL_VAR *v; + + v = find_variable ("FUNCNAME"); + if (v) + return v; +#if defined (ARRAY_VARS) + INIT_DYNAMIC_ARRAY_VAR ("FUNCNAME", get_funcname, null_array_assign); +#else + INIT_DYNAMIC_VAR ("FUNCNAME", (char *)NULL, get_funcname, null_assign); +#endif + VSETATTR (v, att_invisible|att_noassign); + return v; +} + +static void +initialize_dynamic_variables () +{ + SHELL_VAR *v; + + v = init_seconds_var (); + + INIT_DYNAMIC_VAR ("BASH_COMMAND", (char *)NULL, get_bash_command, (sh_var_assign_func_t *)NULL); + INIT_DYNAMIC_VAR ("BASH_SUBSHELL", (char *)NULL, get_subshell, assign_subshell); + + INIT_DYNAMIC_VAR ("RANDOM", (char *)NULL, get_random, assign_random); + VSETATTR (v, att_integer); + INIT_DYNAMIC_VAR ("LINENO", (char *)NULL, get_lineno, assign_lineno); + VSETATTR (v, att_integer); + + INIT_DYNAMIC_VAR ("BASHPID", (char *)NULL, get_bashpid, null_assign); + VSETATTR (v, att_integer|att_readonly); + +#if defined (HISTORY) + INIT_DYNAMIC_VAR ("HISTCMD", (char *)NULL, get_histcmd, (sh_var_assign_func_t *)NULL); + VSETATTR (v, att_integer); +#endif + +#if defined (READLINE) + INIT_DYNAMIC_VAR ("COMP_WORDBREAKS", (char *)NULL, get_comp_wordbreaks, assign_comp_wordbreaks); +#endif + +#if defined (PUSHD_AND_POPD) && defined (ARRAY_VARS) + v = init_dynamic_array_var ("DIRSTACK", get_dirstack, assign_dirstack, 0); +#endif /* PUSHD_AND_POPD && ARRAY_VARS */ + +#if defined (ARRAY_VARS) + v = init_dynamic_array_var ("GROUPS", get_groupset, null_array_assign, att_noassign); + +# if defined (DEBUGGER) + v = init_dynamic_array_var ("BASH_ARGC", get_self, null_array_assign, att_noassign|att_nounset); + v = init_dynamic_array_var ("BASH_ARGV", get_self, null_array_assign, att_noassign|att_nounset); +# endif /* DEBUGGER */ + v = init_dynamic_array_var ("BASH_SOURCE", get_self, null_array_assign, att_noassign|att_nounset); + v = init_dynamic_array_var ("BASH_LINENO", get_self, null_array_assign, att_noassign|att_nounset); + + v = init_dynamic_assoc_var ("BASH_CMDS", get_hashcmd, assign_hashcmd, att_nofree); +# if defined (ALIAS) + v = init_dynamic_assoc_var ("BASH_ALIASES", get_aliasvar, assign_aliasvar, att_nofree); +# endif +#endif + + v = init_funcname_var (); +} + +/* **************************************************************** */ +/* */ +/* Retrieving variables and values */ +/* */ +/* **************************************************************** */ + +/* How to get a pointer to the shell variable or function named NAME. + HASHED_VARS is a pointer to the hash table containing the list + of interest (either variables or functions). */ + +static SHELL_VAR * +hash_lookup (name, hashed_vars) + const char *name; + HASH_TABLE *hashed_vars; +{ + BUCKET_CONTENTS *bucket; + + bucket = hash_search (name, hashed_vars, 0); + /* If we find the name in HASHED_VARS, set LAST_TABLE_SEARCHED to that + table. */ + if (bucket) + last_table_searched = hashed_vars; + return (bucket ? (SHELL_VAR *)bucket->data : (SHELL_VAR *)NULL); +} + +SHELL_VAR * +var_lookup (name, vcontext) + const char *name; + VAR_CONTEXT *vcontext; +{ + VAR_CONTEXT *vc; + SHELL_VAR *v; + + v = (SHELL_VAR *)NULL; + for (vc = vcontext; vc; vc = vc->down) + if (v = hash_lookup (name, vc->table)) + break; + + return v; +} + +/* Look up the variable entry named NAME. If SEARCH_TEMPENV is non-zero, + then also search the temporarily built list of exported variables. + The lookup order is: + temporary_env + shell_variables list +*/ + +SHELL_VAR * +find_variable_internal (name, force_tempenv) + const char *name; + int force_tempenv; +{ + SHELL_VAR *var; + int search_tempenv; + VAR_CONTEXT *vc; + + var = (SHELL_VAR *)NULL; + + /* If explicitly requested, first look in the temporary environment for + the variable. This allows constructs such as "foo=x eval 'echo $foo'" + to get the `exported' value of $foo. This happens if we are executing + a function or builtin, or if we are looking up a variable in a + "subshell environment". */ + search_tempenv = force_tempenv || (expanding_redir == 0 && subshell_environment); + + if (search_tempenv && temporary_env) + var = hash_lookup (name, temporary_env); + + vc = shell_variables; +#if 0 +if (search_tempenv == 0 && /* (subshell_environment & SUBSHELL_COMSUB) && */ + expanding_redir && + (this_shell_builtin == eval_builtin || this_shell_builtin == command_builtin)) + { + itrace("find_variable_internal: search_tempenv == 0: skipping VC_BLTNENV"); + while (vc && (vc->flags & VC_BLTNENV)) + vc = vc->down; + if (vc == 0) + vc = shell_variables; + } +#endif + + if (var == 0) + var = var_lookup (name, vc); + + if (var == 0) + return ((SHELL_VAR *)NULL); + + return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var); +} + +/* Look up and resolve the chain of nameref variables starting at V all the + way to NULL or non-nameref. */ +SHELL_VAR * +find_variable_nameref (v) + SHELL_VAR *v; +{ + int level; + char *newname; + SHELL_VAR *orig, *oldv; + + level = 0; + orig = v; + while (v && nameref_p (v)) + { + level++; + if (level > NAMEREF_MAX) + return ((SHELL_VAR *)0); /* error message here? */ + newname = nameref_cell (v); + if (newname == 0 || *newname == '\0') + return ((SHELL_VAR *)0); + oldv = v; + v = find_variable_internal (newname, (expanding_redir == 0 && (assigning_in_environment || executing_builtin))); + if (v == orig || v == oldv) + { + internal_warning (_("%s: circular name reference"), orig->name); + return ((SHELL_VAR *)0); + } + } + return v; +} + +/* Resolve the chain of nameref variables for NAME. XXX - could change later */ +SHELL_VAR * +find_variable_last_nameref (name) + const char *name; +{ + SHELL_VAR *v, *nv; + char *newname; + int level; + + nv = v = find_variable_noref (name); + level = 0; + while (v && nameref_p (v)) + { + level++; + if (level > NAMEREF_MAX) + return ((SHELL_VAR *)0); /* error message here? */ + newname = nameref_cell (v); + if (newname == 0 || *newname == '\0') + return ((SHELL_VAR *)0); + nv = v; + v = find_variable_internal (newname, (expanding_redir == 0 && (assigning_in_environment || executing_builtin))); + } + return nv; +} + +/* Resolve the chain of nameref variables for NAME. XXX - could change later */ +SHELL_VAR * +find_global_variable_last_nameref (name) + const char *name; +{ + SHELL_VAR *v, *nv; + char *newname; + int level; + + nv = v = find_global_variable_noref (name); + level = 0; + while (v && nameref_p (v)) + { + level++; + if (level > NAMEREF_MAX) + return ((SHELL_VAR *)0); /* error message here? */ + newname = nameref_cell (v); + if (newname == 0 || *newname == '\0') + return ((SHELL_VAR *)0); + nv = v; + v = find_global_variable_noref (newname); + } + return nv; +} + +static SHELL_VAR * +find_nameref_at_context (v, vc) + SHELL_VAR *v; + VAR_CONTEXT *vc; +{ + SHELL_VAR *nv, *nv2; + VAR_CONTEXT *nvc; + char *newname; + int level; + + nv = v; + level = 1; + while (nv && nameref_p (nv)) + { + level++; + if (level > NAMEREF_MAX) + return ((SHELL_VAR *)NULL); + newname = nameref_cell (nv); + if (newname == 0 || *newname == '\0') + return ((SHELL_VAR *)NULL); + nv2 = hash_lookup (newname, vc->table); + if (nv2 == 0) + break; + nv = nv2; + } + return nv; +} + +/* Do nameref resolution from the VC, which is the local context for some + function or builtin, `up' the chain to the global variables context. If + NVCP is not NULL, return the variable context where we finally ended the + nameref resolution (so the bind_variable_internal can use the correct + variable context and hash table). */ +static SHELL_VAR * +find_variable_nameref_context (v, vc, nvcp) + SHELL_VAR *v; + VAR_CONTEXT *vc; + VAR_CONTEXT **nvcp; +{ + SHELL_VAR *nv, *nv2; + VAR_CONTEXT *nvc; + + /* Look starting at the current context all the way `up' */ + for (nv = v, nvc = vc; nvc; nvc = nvc->down) + { + nv2 = find_nameref_at_context (nv, nvc); + if (nv2 == 0) + continue; + nv = nv2; + if (*nvcp) + *nvcp = nvc; + if (nameref_p (nv) == 0) + break; + } + return (nameref_p (nv) ? (SHELL_VAR *)NULL : nv); +} + +/* Do nameref resolution from the VC, which is the local context for some + function or builtin, `up' the chain to the global variables context. If + NVCP is not NULL, return the variable context where we finally ended the + nameref resolution (so the bind_variable_internal can use the correct + variable context and hash table). */ +static SHELL_VAR * +find_variable_last_nameref_context (v, vc, nvcp) + SHELL_VAR *v; + VAR_CONTEXT *vc; + VAR_CONTEXT **nvcp; +{ + SHELL_VAR *nv, *nv2; + VAR_CONTEXT *nvc; + + /* Look starting at the current context all the way `up' */ + for (nv = v, nvc = vc; nvc; nvc = nvc->down) + { + nv2 = find_nameref_at_context (nv, nvc); + if (nv2 == 0) + continue; + nv = nv2; + if (*nvcp) + *nvcp = nvc; + } + return (nameref_p (nv) ? nv : (SHELL_VAR *)NULL); +} + +/* Find a variable, forcing a search of the temporary environment first */ +SHELL_VAR * +find_variable_tempenv (name) + const char *name; +{ + SHELL_VAR *var; + + var = find_variable_internal (name, 1); + if (var && nameref_p (var)) + var = find_variable_nameref (var); + return (var); +} + +/* Find a variable, not forcing a search of the temporary environment first */ +SHELL_VAR * +find_variable_notempenv (name) + const char *name; +{ + SHELL_VAR *var; + + var = find_variable_internal (name, 0); + if (var && nameref_p (var)) + var = find_variable_nameref (var); + return (var); +} + +SHELL_VAR * +find_global_variable (name) + const char *name; +{ + SHELL_VAR *var; + + var = var_lookup (name, global_variables); + if (var && nameref_p (var)) + var = find_variable_nameref (var); + + if (var == 0) + return ((SHELL_VAR *)NULL); + + return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var); +} + +SHELL_VAR * +find_global_variable_noref (name) + const char *name; +{ + SHELL_VAR *var; + + var = var_lookup (name, global_variables); + + if (var == 0) + return ((SHELL_VAR *)NULL); + + return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var); +} + +SHELL_VAR * +find_shell_variable (name) + const char *name; +{ + SHELL_VAR *var; + + var = var_lookup (name, shell_variables); + if (var && nameref_p (var)) + var = find_variable_nameref (var); + + if (var == 0) + return ((SHELL_VAR *)NULL); + + return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var); +} + +/* Look up the variable entry named NAME. Returns the entry or NULL. */ +SHELL_VAR * +find_variable (name) + const char *name; +{ + SHELL_VAR *v; + + last_table_searched = 0; + v = find_variable_internal (name, (expanding_redir == 0 && (assigning_in_environment || executing_builtin))); + if (v && nameref_p (v)) + v = find_variable_nameref (v); + return v; +} + +SHELL_VAR * +find_variable_noref (name) + const char *name; +{ + SHELL_VAR *v; + + v = find_variable_internal (name, (expanding_redir == 0 && (assigning_in_environment || executing_builtin))); + return v; +} + +/* Look up the function entry whose name matches STRING. + Returns the entry or NULL. */ +SHELL_VAR * +find_function (name) + const char *name; +{ + return (hash_lookup (name, shell_functions)); +} + +/* Find the function definition for the shell function named NAME. Returns + the entry or NULL. */ +FUNCTION_DEF * +find_function_def (name) + const char *name; +{ +#if defined (DEBUGGER) + return ((FUNCTION_DEF *)hash_lookup (name, shell_function_defs)); +#else + return ((FUNCTION_DEF *)0); +#endif +} + +/* Return the value of VAR. VAR is assumed to have been the result of a + lookup without any subscript, if arrays are compiled into the shell. */ +char * +get_variable_value (var) + SHELL_VAR *var; +{ + if (var == 0) + return ((char *)NULL); +#if defined (ARRAY_VARS) + else if (array_p (var)) + return (array_reference (array_cell (var), 0)); + else if (assoc_p (var)) + return (assoc_reference (assoc_cell (var), "0")); +#endif + else + return (value_cell (var)); +} + +/* Return the string value of a variable. Return NULL if the variable + doesn't exist. Don't cons a new string. This is a potential memory + leak if the variable is found in the temporary environment. Since + functions and variables have separate name spaces, returns NULL if + var_name is a shell function only. */ +char * +get_string_value (var_name) + const char *var_name; +{ + SHELL_VAR *var; + + var = find_variable (var_name); + return ((var) ? get_variable_value (var) : (char *)NULL); +} + +/* This is present for use by the tilde and readline libraries. */ +char * +sh_get_env_value (v) + const char *v; +{ + return get_string_value (v); +} + +/* **************************************************************** */ +/* */ +/* Creating and setting variables */ +/* */ +/* **************************************************************** */ + +/* Set NAME to VALUE if NAME has no value. */ +SHELL_VAR * +set_if_not (name, value) + char *name, *value; +{ + SHELL_VAR *v; + + if (shell_variables == 0) + create_variable_tables (); + + v = find_variable (name); + if (v == 0) + v = bind_variable_internal (name, value, global_variables->table, HASH_NOSRCH, 0); + return (v); +} + +/* Create a local variable referenced by NAME. */ +SHELL_VAR * +make_local_variable (name) + const char *name; +{ + SHELL_VAR *new_var, *old_var; + VAR_CONTEXT *vc; + int was_tmpvar; + char *tmp_value; + + /* local foo; local foo; is a no-op. */ + old_var = find_variable (name); + if (old_var && local_p (old_var) && old_var->context == variable_context) + return (old_var); + + was_tmpvar = old_var && tempvar_p (old_var); + /* If we're making a local variable in a shell function, the temporary env + has already been merged into the function's variable context stack. We + can assume that a temporary var in the same context appears in the same + VAR_CONTEXT and can safely be returned without creating a new variable + (which results in duplicate names in the same VAR_CONTEXT->table */ + /* We can't just test tmpvar_p because variables in the temporary env given + to a shell function appear in the function's local variable VAR_CONTEXT + but retain their tempvar attribute. We want temporary variables that are + found in temporary_env, hence the test for last_table_searched, which is + set in hash_lookup and only (so far) checked here. */ + if (was_tmpvar && old_var->context == variable_context && last_table_searched != temporary_env) + { + VUNSETATTR (old_var, att_invisible); + return (old_var); + } + if (was_tmpvar) + tmp_value = value_cell (old_var); + + for (vc = shell_variables; vc; vc = vc->down) + if (vc_isfuncenv (vc) && vc->scope == variable_context) + break; + + if (vc == 0) + { + internal_error (_("make_local_variable: no function context at current scope")); + return ((SHELL_VAR *)NULL); + } + else if (vc->table == 0) + vc->table = hash_create (TEMPENV_HASH_BUCKETS); + + /* Since this is called only from the local/declare/typeset code, we can + call builtin_error here without worry (of course, it will also work + for anything that sets this_command_name). Variables with the `noassign' + attribute may not be made local. The test against old_var's context + level is to disallow local copies of readonly global variables (since I + believe that this could be a security hole). Readonly copies of calling + function local variables are OK. */ + if (old_var && (noassign_p (old_var) || + (readonly_p (old_var) && old_var->context == 0))) + { + if (readonly_p (old_var)) + sh_readonly (name); + else if (noassign_p (old_var)) + builtin_error (_("%s: variable may not be assigned value"), name); +#if 0 + /* Let noassign variables through with a warning */ + if (readonly_p (old_var)) +#endif + return ((SHELL_VAR *)NULL); + } + + if (old_var == 0) + new_var = make_new_variable (name, vc->table); + else + { + new_var = make_new_variable (name, vc->table); + + /* If we found this variable in one of the temporary environments, + inherit its value. Watch to see if this causes problems with + things like `x=4 local x'. XXX - see above for temporary env + variables with the same context level as variable_context */ + /* XXX - we should only do this if the variable is not an array. */ + if (was_tmpvar) + var_setvalue (new_var, savestring (tmp_value)); + + new_var->attributes = exported_p (old_var) ? att_exported : 0; + } + + vc->flags |= VC_HASLOCAL; + + new_var->context = variable_context; + VSETATTR (new_var, att_local); + + if (ifsname (name)) + setifs (new_var); + + if (was_tmpvar == 0) + VSETATTR (new_var, att_invisible); /* XXX */ + return (new_var); +} + +/* Create a new shell variable with name NAME. */ +static SHELL_VAR * +new_shell_variable (name) + const char *name; +{ + SHELL_VAR *entry; + + entry = (SHELL_VAR *)xmalloc (sizeof (SHELL_VAR)); + + entry->name = savestring (name); + var_setvalue (entry, (char *)NULL); + CLEAR_EXPORTSTR (entry); + + entry->dynamic_value = (sh_var_value_func_t *)NULL; + entry->assign_func = (sh_var_assign_func_t *)NULL; + + entry->attributes = 0; + + /* Always assume variables are to be made at toplevel! + make_local_variable has the responsibility of changing the + variable context. */ + entry->context = 0; + + return (entry); +} + +/* Create a new shell variable with name NAME and add it to the hash table + TABLE. */ +static SHELL_VAR * +make_new_variable (name, table) + const char *name; + HASH_TABLE *table; +{ + SHELL_VAR *entry; + BUCKET_CONTENTS *elt; + + entry = new_shell_variable (name); + + /* Make sure we have a shell_variables hash table to add to. */ + if (shell_variables == 0) + create_variable_tables (); + + elt = hash_insert (savestring (name), table, HASH_NOSRCH); + elt->data = (PTR_T)entry; + + return entry; +} + +#if defined (ARRAY_VARS) +SHELL_VAR * +make_new_array_variable (name) + char *name; +{ + SHELL_VAR *entry; + ARRAY *array; + + entry = make_new_variable (name, global_variables->table); + array = array_create (); + + var_setarray (entry, array); + VSETATTR (entry, att_array); + return entry; +} + +SHELL_VAR * +make_local_array_variable (name, assoc_ok) + char *name; + int assoc_ok; +{ + SHELL_VAR *var; + ARRAY *array; + + var = make_local_variable (name); + if (var == 0 || array_p (var) || (assoc_ok && assoc_p (var))) + return var; + + array = array_create (); + + dispose_variable_value (var); + var_setarray (var, array); + VSETATTR (var, att_array); + return var; +} + +SHELL_VAR * +make_new_assoc_variable (name) + char *name; +{ + SHELL_VAR *entry; + HASH_TABLE *hash; + + entry = make_new_variable (name, global_variables->table); + hash = assoc_create (0); + + var_setassoc (entry, hash); + VSETATTR (entry, att_assoc); + return entry; +} + +SHELL_VAR * +make_local_assoc_variable (name) + char *name; +{ + SHELL_VAR *var; + HASH_TABLE *hash; + + var = make_local_variable (name); + if (var == 0 || assoc_p (var)) + return var; + + dispose_variable_value (var); + hash = assoc_create (0); + + var_setassoc (var, hash); + VSETATTR (var, att_assoc); + return var; +} +#endif + +char * +make_variable_value (var, value, flags) + SHELL_VAR *var; + char *value; + int flags; +{ + char *retval, *oval; + intmax_t lval, rval; + int expok, olen, op; + + /* If this variable has had its type set to integer (via `declare -i'), + then do expression evaluation on it and store the result. The + functions in expr.c (evalexp()) and bind_int_variable() are responsible + for turning off the integer flag if they don't want further + evaluation done. */ + if (integer_p (var)) + { + if (flags & ASS_APPEND) + { + oval = value_cell (var); + lval = evalexp (oval, &expok); /* ksh93 seems to do this */ + if (expok == 0) + { + top_level_cleanup (); + jump_to_top_level (DISCARD); + } + } + rval = evalexp (value, &expok); + if (expok == 0) + { + top_level_cleanup (); + jump_to_top_level (DISCARD); + } + /* This can be fooled if the variable's value changes while evaluating + `rval'. We can change it if we move the evaluation of lval to here. */ + if (flags & ASS_APPEND) + rval += lval; + retval = itos (rval); + } +#if defined (CASEMOD_ATTRS) + else if (capcase_p (var) || uppercase_p (var) || lowercase_p (var)) + { + if (flags & ASS_APPEND) + { + oval = get_variable_value (var); + if (oval == 0) /* paranoia */ + oval = ""; + olen = STRLEN (oval); + retval = (char *)xmalloc (olen + (value ? STRLEN (value) : 0) + 1); + strcpy (retval, oval); + if (value) + strcpy (retval+olen, value); + } + else if (*value) + retval = savestring (value); + else + { + retval = (char *)xmalloc (1); + retval[0] = '\0'; + } + op = capcase_p (var) ? CASE_CAPITALIZE + : (uppercase_p (var) ? CASE_UPPER : CASE_LOWER); + oval = sh_modcase (retval, (char *)0, op); + free (retval); + retval = oval; + } +#endif /* CASEMOD_ATTRS */ + else if (value) + { + if (flags & ASS_APPEND) + { + oval = get_variable_value (var); + if (oval == 0) /* paranoia */ + oval = ""; + olen = STRLEN (oval); + retval = (char *)xmalloc (olen + (value ? STRLEN (value) : 0) + 1); + strcpy (retval, oval); + if (value) + strcpy (retval+olen, value); + } + else if (*value) + retval = savestring (value); + else + { + retval = (char *)xmalloc (1); + retval[0] = '\0'; + } + } + else + retval = (char *)NULL; + + return retval; +} + +/* Bind a variable NAME to VALUE in the HASH_TABLE TABLE, which may be the + temporary environment (but usually is not). */ +static SHELL_VAR * +bind_variable_internal (name, value, table, hflags, aflags) + const char *name; + char *value; + HASH_TABLE *table; + int hflags, aflags; +{ + char *newval; + SHELL_VAR *entry; + + entry = (hflags & HASH_NOSRCH) ? (SHELL_VAR *)NULL : hash_lookup (name, table); + /* Follow the nameref chain here if this is the global variables table */ + if (entry && nameref_p (entry) && (invisible_p (entry) == 0) && table == global_variables->table) + { + entry = find_global_variable (entry->name); + /* Let's see if we have a nameref referencing a variable that hasn't yet + been created. */ + if (entry == 0) + entry = find_variable_last_nameref (name); /* XXX */ + if (entry == 0) /* just in case */ + return (entry); + } + + /* The first clause handles `declare -n ref; ref=x;' */ + if (entry && invisible_p (entry) && nameref_p (entry)) + goto assign_value; + else if (entry && nameref_p (entry)) + { + newval = nameref_cell (entry); +#if defined (ARRAY_VARS) + /* declare -n foo=x[2] */ + if (valid_array_reference (newval)) + /* XXX - should it be aflags? */ + entry = assign_array_element (newval, make_variable_value (entry, value, 0), aflags); + else +#endif + { + entry = make_new_variable (newval, table); + var_setvalue (entry, make_variable_value (entry, value, 0)); + } + } + else if (entry == 0) + { + entry = make_new_variable (name, table); + var_setvalue (entry, make_variable_value (entry, value, 0)); /* XXX */ + } + else if (entry->assign_func) /* array vars have assign functions now */ + { + INVALIDATE_EXPORTSTR (entry); + newval = (aflags & ASS_APPEND) ? make_variable_value (entry, value, aflags) : value; + if (assoc_p (entry)) + entry = (*(entry->assign_func)) (entry, newval, -1, savestring ("0")); + else if (array_p (entry)) + entry = (*(entry->assign_func)) (entry, newval, 0, 0); + else + entry = (*(entry->assign_func)) (entry, newval, -1, 0); + if (newval != value) + free (newval); + return (entry); + } + else + { +assign_value: + if (readonly_p (entry) || noassign_p (entry)) + { + if (readonly_p (entry)) + err_readonly (name); + return (entry); + } + + /* Variables which are bound are visible. */ + VUNSETATTR (entry, att_invisible); + +#if defined (ARRAY_VARS) + if (assoc_p (entry) || array_p (entry)) + newval = make_array_variable_value (entry, 0, "0", value, aflags); + else +#endif + + newval = make_variable_value (entry, value, aflags); /* XXX */ + + /* Invalidate any cached export string */ + INVALIDATE_EXPORTSTR (entry); + +#if defined (ARRAY_VARS) + /* XXX -- this bears looking at again -- XXX */ + /* If an existing array variable x is being assigned to with x=b or + `read x' or something of that nature, silently convert it to + x[0]=b or `read x[0]'. */ + if (assoc_p (entry)) + { + assoc_insert (assoc_cell (entry), savestring ("0"), newval); + free (newval); + } + else if (array_p (entry)) + { + array_insert (array_cell (entry), 0, newval); + free (newval); + } + else +#endif + { + FREE (value_cell (entry)); + var_setvalue (entry, newval); + } + } + + if (mark_modified_vars) + VSETATTR (entry, att_exported); + + if (exported_p (entry)) + array_needs_making = 1; + + return (entry); +} + +/* Bind a variable NAME to VALUE. This conses up the name + and value strings. If we have a temporary environment, we bind there + first, then we bind into shell_variables. */ + +SHELL_VAR * +bind_variable (name, value, flags) + const char *name; + char *value; + int flags; +{ + SHELL_VAR *v, *nv; + VAR_CONTEXT *vc, *nvc; + int level; + + if (shell_variables == 0) + create_variable_tables (); + + /* If we have a temporary environment, look there first for the variable, + and, if found, modify the value there before modifying it in the + shell_variables table. This allows sourced scripts to modify values + given to them in a temporary environment while modifying the variable + value that the caller sees. */ + if (temporary_env) + bind_tempenv_variable (name, value); + + /* XXX -- handle local variables here. */ + for (vc = shell_variables; vc; vc = vc->down) + { + if (vc_isfuncenv (vc) || vc_isbltnenv (vc)) + { + v = hash_lookup (name, vc->table); + nvc = vc; + if (v && nameref_p (v)) + { + nv = find_variable_nameref_context (v, vc, &nvc); + if (nv == 0) + { + nv = find_variable_last_nameref_context (v, vc, &nvc); + if (nv && nameref_p (nv)) + { + /* If this nameref variable doesn't have a value yet, + set the value. Otherwise, assign using the value as + normal. */ + if (nameref_cell (nv) == 0) + return (bind_variable_internal (nv->name, value, nvc->table, 0, flags)); + return (bind_variable_internal (nameref_cell (nv), value, nvc->table, 0, flags)); + } + else + v = nv; + } + else + v = nv; + } + if (v) + return (bind_variable_internal (v->name, value, nvc->table, 0, flags)); + } + } + /* bind_variable_internal will handle nameref resolution in this case */ + return (bind_variable_internal (name, value, global_variables->table, 0, flags)); +} + +SHELL_VAR * +bind_global_variable (name, value, flags) + const char *name; + char *value; + int flags; +{ + SHELL_VAR *v, *nv; + VAR_CONTEXT *vc, *nvc; + int level; + + if (shell_variables == 0) + create_variable_tables (); + + /* bind_variable_internal will handle nameref resolution in this case */ + return (bind_variable_internal (name, value, global_variables->table, 0, flags)); +} + +/* Make VAR, a simple shell variable, have value VALUE. Once assigned a + value, variables are no longer invisible. This is a duplicate of part + of the internals of bind_variable. If the variable is exported, or + all modified variables should be exported, mark the variable for export + and note that the export environment needs to be recreated. */ +SHELL_VAR * +bind_variable_value (var, value, aflags) + SHELL_VAR *var; + char *value; + int aflags; +{ + char *t; + int invis; + + invis = invisible_p (var); + VUNSETATTR (var, att_invisible); + + if (var->assign_func) + { + /* If we're appending, we need the old value, so use + make_variable_value */ + t = (aflags & ASS_APPEND) ? make_variable_value (var, value, aflags) : value; + (*(var->assign_func)) (var, t, -1, 0); + if (t != value && t) + free (t); + } + else + { + t = make_variable_value (var, value, aflags); +#if defined (ARRAY_VARS) + if ((aflags & ASS_NAMEREF) && (t == 0 || *t == 0 || (legal_identifier (t) == 0 && valid_array_reference (t) == 0))) +#else + if ((aflags & ASS_NAMEREF) && (t == 0 || *t == 0 || legal_identifier (t) == 0)) +#endif + { + free (t); + if (invis) + VSETATTR (var, att_invisible); /* XXX */ + return ((SHELL_VAR *)NULL); + } + FREE (value_cell (var)); + var_setvalue (var, t); + } + + INVALIDATE_EXPORTSTR (var); + + if (mark_modified_vars) + VSETATTR (var, att_exported); + + if (exported_p (var)) + array_needs_making = 1; + + return (var); +} + +/* Bind/create a shell variable with the name LHS to the RHS. + This creates or modifies a variable such that it is an integer. + + This used to be in expr.c, but it is here so that all of the + variable binding stuff is localized. Since we don't want any + recursive evaluation from bind_variable() (possible without this code, + since bind_variable() calls the evaluator for variables with the integer + attribute set), we temporarily turn off the integer attribute for each + variable we set here, then turn it back on after binding as necessary. */ + +SHELL_VAR * +bind_int_variable (lhs, rhs) + char *lhs, *rhs; +{ + register SHELL_VAR *v; + int isint, isarr, implicitarray; + + isint = isarr = implicitarray = 0; +#if defined (ARRAY_VARS) + if (valid_array_reference (lhs)) + { + isarr = 1; + v = array_variable_part (lhs, (char **)0, (int *)0); + } + else +#endif + v = find_variable (lhs); + + if (v) + { + isint = integer_p (v); + VUNSETATTR (v, att_integer); +#if defined (ARRAY_VARS) + if (array_p (v) && isarr == 0) + implicitarray = 1; +#endif + } + +#if defined (ARRAY_VARS) + if (isarr) + v = assign_array_element (lhs, rhs, 0); + else if (implicitarray) + v = bind_array_variable (lhs, 0, rhs, 0); + else +#endif + v = bind_variable (lhs, rhs, 0); + + if (v && isint) + VSETATTR (v, att_integer); + + VUNSETATTR (v, att_invisible); + + return (v); +} + +SHELL_VAR * +bind_var_to_int (var, val) + char *var; + intmax_t val; +{ + char ibuf[INT_STRLEN_BOUND (intmax_t) + 1], *p; + + p = fmtulong (val, 10, ibuf, sizeof (ibuf), 0); + return (bind_int_variable (var, p)); +} + +/* Do a function binding to a variable. You pass the name and + the command to bind to. This conses the name and command. */ +SHELL_VAR * +bind_function (name, value) + const char *name; + COMMAND *value; +{ + SHELL_VAR *entry; + + entry = find_function (name); + if (entry == 0) + { + BUCKET_CONTENTS *elt; + + elt = hash_insert (savestring (name), shell_functions, HASH_NOSRCH); + entry = new_shell_variable (name); + elt->data = (PTR_T)entry; + } + else + INVALIDATE_EXPORTSTR (entry); + + if (var_isset (entry)) + dispose_command (function_cell (entry)); + + if (value) + var_setfunc (entry, copy_command (value)); + else + var_setfunc (entry, 0); + + VSETATTR (entry, att_function); + + if (mark_modified_vars) + VSETATTR (entry, att_exported); + + VUNSETATTR (entry, att_invisible); /* Just to be sure */ + + if (exported_p (entry)) + array_needs_making = 1; + +#if defined (PROGRAMMABLE_COMPLETION) + set_itemlist_dirty (&it_functions); +#endif + + return (entry); +} + +#if defined (DEBUGGER) +/* Bind a function definition, which includes source file and line number + information in addition to the command, into the FUNCTION_DEF hash table.*/ +void +bind_function_def (name, value) + const char *name; + FUNCTION_DEF *value; +{ + FUNCTION_DEF *entry; + BUCKET_CONTENTS *elt; + COMMAND *cmd; + + entry = find_function_def (name); + if (entry) + { + dispose_function_def_contents (entry); + entry = copy_function_def_contents (value, entry); + } + else + { + cmd = value->command; + value->command = 0; + entry = copy_function_def (value); + value->command = cmd; + + elt = hash_insert (savestring (name), shell_function_defs, HASH_NOSRCH); + elt->data = (PTR_T *)entry; + } +} +#endif /* DEBUGGER */ + +/* Add STRING, which is of the form foo=bar, to the temporary environment + HASH_TABLE (temporary_env). The functions in execute_cmd.c are + responsible for moving the main temporary env to one of the other + temporary environments. The expansion code in subst.c calls this. */ +int +assign_in_env (word, flags) + WORD_DESC *word; + int flags; +{ + int offset, aflags; + char *name, *temp, *value; + SHELL_VAR *var; + const char *string; + + string = word->word; + + aflags = 0; + offset = assignment (string, 0); + name = savestring (string); + value = (char *)NULL; + + if (name[offset] == '=') + { + name[offset] = 0; + + /* don't ignore the `+' when assigning temporary environment */ + if (name[offset - 1] == '+') + { + name[offset - 1] = '\0'; + aflags |= ASS_APPEND; + } + + var = find_variable (name); + if (var && (readonly_p (var) || noassign_p (var))) + { + if (readonly_p (var)) + err_readonly (name); + free (name); + return (0); + } + + temp = name + offset + 1; + value = expand_assignment_string_to_string (temp, 0); + + if (var && (aflags & ASS_APPEND)) + { + temp = make_variable_value (var, value, aflags); + FREE (value); + value = temp; + } + } + + if (temporary_env == 0) + temporary_env = hash_create (TEMPENV_HASH_BUCKETS); + + var = hash_lookup (name, temporary_env); + if (var == 0) + var = make_new_variable (name, temporary_env); + else + FREE (value_cell (var)); + + if (value == 0) + { + value = (char *)xmalloc (1); /* like do_assignment_internal */ + value[0] = '\0'; + } + + var_setvalue (var, value); + var->attributes |= (att_exported|att_tempvar); + var->context = variable_context; /* XXX */ + + INVALIDATE_EXPORTSTR (var); + var->exportstr = mk_env_string (name, value); + + array_needs_making = 1; + + if (flags) + stupidly_hack_special_variables (name); + + if (echo_command_at_execute) + /* The Korn shell prints the `+ ' in front of assignment statements, + so we do too. */ + xtrace_print_assignment (name, value, 0, 1); + + free (name); + return 1; +} + +/* **************************************************************** */ +/* */ +/* Copying variables */ +/* */ +/* **************************************************************** */ + +#ifdef INCLUDE_UNUSED +/* Copy VAR to a new data structure and return that structure. */ +SHELL_VAR * +copy_variable (var) + SHELL_VAR *var; +{ + SHELL_VAR *copy = (SHELL_VAR *)NULL; + + if (var) + { + copy = (SHELL_VAR *)xmalloc (sizeof (SHELL_VAR)); + + copy->attributes = var->attributes; + copy->name = savestring (var->name); + + if (function_p (var)) + var_setfunc (copy, copy_command (function_cell (var))); +#if defined (ARRAY_VARS) + else if (array_p (var)) + var_setarray (copy, array_copy (array_cell (var))); + else if (assoc_p (var)) + var_setassoc (copy, assoc_copy (assoc_cell (var))); +#endif + else if (nameref_cell (var)) /* XXX - nameref */ + var_setref (copy, savestring (nameref_cell (var))); + else if (value_cell (var)) /* XXX - nameref */ + var_setvalue (copy, savestring (value_cell (var))); + else + var_setvalue (copy, (char *)NULL); + + copy->dynamic_value = var->dynamic_value; + copy->assign_func = var->assign_func; + + copy->exportstr = COPY_EXPORTSTR (var); + + copy->context = var->context; + } + return (copy); +} +#endif + +/* **************************************************************** */ +/* */ +/* Deleting and unsetting variables */ +/* */ +/* **************************************************************** */ + +/* Dispose of the information attached to VAR. */ +static void +dispose_variable_value (var) + SHELL_VAR *var; +{ + if (function_p (var)) + dispose_command (function_cell (var)); +#if defined (ARRAY_VARS) + else if (array_p (var)) + array_dispose (array_cell (var)); + else if (assoc_p (var)) + assoc_dispose (assoc_cell (var)); +#endif + else if (nameref_p (var)) + FREE (nameref_cell (var)); + else + FREE (value_cell (var)); +} + +void +dispose_variable (var) + SHELL_VAR *var; +{ + if (var == 0) + return; + + if (nofree_p (var) == 0) + dispose_variable_value (var); + + FREE_EXPORTSTR (var); + + free (var->name); + + if (exported_p (var)) + array_needs_making = 1; + + free (var); +} + +/* Unset the shell variable referenced by NAME. Unsetting a nameref variable + unsets the variable it resolves to but leaves the nameref alone. */ +int +unbind_variable (name) + const char *name; +{ + SHELL_VAR *v, *nv; + int r; + + v = var_lookup (name, shell_variables); + nv = (v && nameref_p (v)) ? find_variable_nameref (v) : (SHELL_VAR *)NULL; + + r = nv ? makunbound (nv->name, shell_variables) : makunbound (name, shell_variables); + return r; +} + +/* Unbind NAME, where NAME is assumed to be a nameref variable */ +int +unbind_nameref (name) + const char *name; +{ + SHELL_VAR *v; + + v = var_lookup (name, shell_variables); + if (v && nameref_p (v)) + return makunbound (name, shell_variables); + return 0; +} + +/* Unset the shell function named NAME. */ +int +unbind_func (name) + const char *name; +{ + BUCKET_CONTENTS *elt; + SHELL_VAR *func; + + elt = hash_remove (name, shell_functions, 0); + + if (elt == 0) + return -1; + +#if defined (PROGRAMMABLE_COMPLETION) + set_itemlist_dirty (&it_functions); +#endif + + func = (SHELL_VAR *)elt->data; + if (func) + { + if (exported_p (func)) + array_needs_making++; + dispose_variable (func); + } + + free (elt->key); + free (elt); + + return 0; +} + +#if defined (DEBUGGER) +int +unbind_function_def (name) + const char *name; +{ + BUCKET_CONTENTS *elt; + FUNCTION_DEF *funcdef; + + elt = hash_remove (name, shell_function_defs, 0); + + if (elt == 0) + return -1; + + funcdef = (FUNCTION_DEF *)elt->data; + if (funcdef) + dispose_function_def (funcdef); + + free (elt->key); + free (elt); + + return 0; +} +#endif /* DEBUGGER */ + +int +delete_var (name, vc) + const char *name; + VAR_CONTEXT *vc; +{ + BUCKET_CONTENTS *elt; + SHELL_VAR *old_var; + VAR_CONTEXT *v; + + for (elt = (BUCKET_CONTENTS *)NULL, v = vc; v; v = v->down) + if (elt = hash_remove (name, v->table, 0)) + break; + + if (elt == 0) + return (-1); + + old_var = (SHELL_VAR *)elt->data; + free (elt->key); + free (elt); + + dispose_variable (old_var); + return (0); +} + +/* Make the variable associated with NAME go away. HASH_LIST is the + hash table from which this variable should be deleted (either + shell_variables or shell_functions). + Returns non-zero if the variable couldn't be found. */ +int +makunbound (name, vc) + const char *name; + VAR_CONTEXT *vc; +{ + BUCKET_CONTENTS *elt, *new_elt; + SHELL_VAR *old_var; + VAR_CONTEXT *v; + char *t; + + for (elt = (BUCKET_CONTENTS *)NULL, v = vc; v; v = v->down) + if (elt = hash_remove (name, v->table, 0)) + break; + + if (elt == 0) + return (-1); + + old_var = (SHELL_VAR *)elt->data; + + if (old_var && exported_p (old_var)) + array_needs_making++; + + /* If we're unsetting a local variable and we're still executing inside + the function, just mark the variable as invisible. The function + eventually called by pop_var_context() will clean it up later. This + must be done so that if the variable is subsequently assigned a new + value inside the function, the `local' attribute is still present. + We also need to add it back into the correct hash table. */ + if (old_var && local_p (old_var) && variable_context == old_var->context) + { + if (nofree_p (old_var)) + var_setvalue (old_var, (char *)NULL); +#if defined (ARRAY_VARS) + else if (array_p (old_var)) + array_dispose (array_cell (old_var)); + else if (assoc_p (old_var)) + assoc_dispose (assoc_cell (old_var)); +#endif + else if (nameref_p (old_var)) + FREE (nameref_cell (old_var)); + else + FREE (value_cell (old_var)); + /* Reset the attributes. Preserve the export attribute if the variable + came from a temporary environment. Make sure it stays local, and + make it invisible. */ + old_var->attributes = (exported_p (old_var) && tempvar_p (old_var)) ? att_exported : 0; + VSETATTR (old_var, att_local); + VSETATTR (old_var, att_invisible); + var_setvalue (old_var, (char *)NULL); + INVALIDATE_EXPORTSTR (old_var); + + new_elt = hash_insert (savestring (old_var->name), v->table, 0); + new_elt->data = (PTR_T)old_var; + stupidly_hack_special_variables (old_var->name); + + free (elt->key); + free (elt); + return (0); + } + + /* Have to save a copy of name here, because it might refer to + old_var->name. If so, stupidly_hack_special_variables will + reference freed memory. */ + t = savestring (name); + + free (elt->key); + free (elt); + + dispose_variable (old_var); + stupidly_hack_special_variables (t); + free (t); + + return (0); +} + +/* Get rid of all of the variables in the current context. */ +void +kill_all_local_variables () +{ + VAR_CONTEXT *vc; + + for (vc = shell_variables; vc; vc = vc->down) + if (vc_isfuncenv (vc) && vc->scope == variable_context) + break; + if (vc == 0) + return; /* XXX */ + + if (vc->table && vc_haslocals (vc)) + { + delete_all_variables (vc->table); + hash_dispose (vc->table); + } + vc->table = (HASH_TABLE *)NULL; +} + +static void +free_variable_hash_data (data) + PTR_T data; +{ + SHELL_VAR *var; + + var = (SHELL_VAR *)data; + dispose_variable (var); +} + +/* Delete the entire contents of the hash table. */ +void +delete_all_variables (hashed_vars) + HASH_TABLE *hashed_vars; +{ + hash_flush (hashed_vars, free_variable_hash_data); +} + +/* **************************************************************** */ +/* */ +/* Setting variable attributes */ +/* */ +/* **************************************************************** */ + +#define FIND_OR_MAKE_VARIABLE(name, entry) \ + do \ + { \ + entry = find_variable (name); \ + if (!entry) \ + { \ + entry = bind_variable (name, "", 0); \ + if (!no_invisible_vars && entry) entry->attributes |= att_invisible; \ + } \ + } \ + while (0) + +/* Make the variable associated with NAME be readonly. + If NAME does not exist yet, create it. */ +void +set_var_read_only (name) + char *name; +{ + SHELL_VAR *entry; + + FIND_OR_MAKE_VARIABLE (name, entry); + VSETATTR (entry, att_readonly); +} + +#ifdef INCLUDE_UNUSED +/* Make the function associated with NAME be readonly. + If NAME does not exist, we just punt, like auto_export code below. */ +void +set_func_read_only (name) + const char *name; +{ + SHELL_VAR *entry; + + entry = find_function (name); + if (entry) + VSETATTR (entry, att_readonly); +} + +/* Make the variable associated with NAME be auto-exported. + If NAME does not exist yet, create it. */ +void +set_var_auto_export (name) + char *name; +{ + SHELL_VAR *entry; + + FIND_OR_MAKE_VARIABLE (name, entry); + set_auto_export (entry); +} + +/* Make the function associated with NAME be auto-exported. */ +void +set_func_auto_export (name) + const char *name; +{ + SHELL_VAR *entry; + + entry = find_function (name); + if (entry) + set_auto_export (entry); +} +#endif + +/* **************************************************************** */ +/* */ +/* Creating lists of variables */ +/* */ +/* **************************************************************** */ + +static VARLIST * +vlist_alloc (nentries) + int nentries; +{ + VARLIST *vlist; + + vlist = (VARLIST *)xmalloc (sizeof (VARLIST)); + vlist->list = (SHELL_VAR **)xmalloc ((nentries + 1) * sizeof (SHELL_VAR *)); + vlist->list_size = nentries; + vlist->list_len = 0; + vlist->list[0] = (SHELL_VAR *)NULL; + + return vlist; +} + +static VARLIST * +vlist_realloc (vlist, n) + VARLIST *vlist; + int n; +{ + if (vlist == 0) + return (vlist = vlist_alloc (n)); + if (n > vlist->list_size) + { + vlist->list_size = n; + vlist->list = (SHELL_VAR **)xrealloc (vlist->list, (vlist->list_size + 1) * sizeof (SHELL_VAR *)); + } + return vlist; +} + +static void +vlist_add (vlist, var, flags) + VARLIST *vlist; + SHELL_VAR *var; + int flags; +{ + register int i; + + for (i = 0; i < vlist->list_len; i++) + if (STREQ (var->name, vlist->list[i]->name)) + break; + if (i < vlist->list_len) + return; + + if (i >= vlist->list_size) + vlist = vlist_realloc (vlist, vlist->list_size + 16); + + vlist->list[vlist->list_len++] = var; + vlist->list[vlist->list_len] = (SHELL_VAR *)NULL; +} + +/* Map FUNCTION over the variables in VAR_HASH_TABLE. Return an array of the + variables for which FUNCTION returns a non-zero value. A NULL value + for FUNCTION means to use all variables. */ +SHELL_VAR ** +map_over (function, vc) + sh_var_map_func_t *function; + VAR_CONTEXT *vc; +{ + VAR_CONTEXT *v; + VARLIST *vlist; + SHELL_VAR **ret; + int nentries; + + for (nentries = 0, v = vc; v; v = v->down) + nentries += HASH_ENTRIES (v->table); + + if (nentries == 0) + return (SHELL_VAR **)NULL; + + vlist = vlist_alloc (nentries); + + for (v = vc; v; v = v->down) + flatten (v->table, function, vlist, 0); + + ret = vlist->list; + free (vlist); + return ret; +} + +SHELL_VAR ** +map_over_funcs (function) + sh_var_map_func_t *function; +{ + VARLIST *vlist; + SHELL_VAR **ret; + + if (shell_functions == 0 || HASH_ENTRIES (shell_functions) == 0) + return ((SHELL_VAR **)NULL); + + vlist = vlist_alloc (HASH_ENTRIES (shell_functions)); + + flatten (shell_functions, function, vlist, 0); + + ret = vlist->list; + free (vlist); + return ret; +} + +/* Flatten VAR_HASH_TABLE, applying FUNC to each member and adding those + elements for which FUNC succeeds to VLIST->list. FLAGS is reserved + for future use. Only unique names are added to VLIST. If FUNC is + NULL, each variable in VAR_HASH_TABLE is added to VLIST. If VLIST is + NULL, FUNC is applied to each SHELL_VAR in VAR_HASH_TABLE. If VLIST + and FUNC are both NULL, nothing happens. */ +static void +flatten (var_hash_table, func, vlist, flags) + HASH_TABLE *var_hash_table; + sh_var_map_func_t *func; + VARLIST *vlist; + int flags; +{ + register int i; + register BUCKET_CONTENTS *tlist; + int r; + SHELL_VAR *var; + + if (var_hash_table == 0 || (HASH_ENTRIES (var_hash_table) == 0) || (vlist == 0 && func == 0)) + return; + + for (i = 0; i < var_hash_table->nbuckets; i++) + { + for (tlist = hash_items (i, var_hash_table); tlist; tlist = tlist->next) + { + var = (SHELL_VAR *)tlist->data; + + r = func ? (*func) (var) : 1; + if (r && vlist) + vlist_add (vlist, var, flags); + } + } +} + +void +sort_variables (array) + SHELL_VAR **array; +{ + qsort (array, strvec_len ((char **)array), sizeof (SHELL_VAR *), (QSFUNC *)qsort_var_comp); +} + +static int +qsort_var_comp (var1, var2) + SHELL_VAR **var1, **var2; +{ + int result; + + if ((result = (*var1)->name[0] - (*var2)->name[0]) == 0) + result = strcmp ((*var1)->name, (*var2)->name); + + return (result); +} + +/* Apply FUNC to each variable in SHELL_VARIABLES, adding each one for + which FUNC succeeds to an array of SHELL_VAR *s. Returns the array. */ +static SHELL_VAR ** +vapply (func) + sh_var_map_func_t *func; +{ + SHELL_VAR **list; + + list = map_over (func, shell_variables); + if (list /* && posixly_correct */) + sort_variables (list); + return (list); +} + +/* Apply FUNC to each variable in SHELL_FUNCTIONS, adding each one for + which FUNC succeeds to an array of SHELL_VAR *s. Returns the array. */ +static SHELL_VAR ** +fapply (func) + sh_var_map_func_t *func; +{ + SHELL_VAR **list; + + list = map_over_funcs (func); + if (list /* && posixly_correct */) + sort_variables (list); + return (list); +} + +/* Create a NULL terminated array of all the shell variables. */ +SHELL_VAR ** +all_shell_variables () +{ + return (vapply ((sh_var_map_func_t *)NULL)); +} + +/* Create a NULL terminated array of all the shell functions. */ +SHELL_VAR ** +all_shell_functions () +{ + return (fapply ((sh_var_map_func_t *)NULL)); +} + +static int +visible_var (var) + SHELL_VAR *var; +{ + return (invisible_p (var) == 0); +} + +SHELL_VAR ** +all_visible_functions () +{ + return (fapply (visible_var)); +} + +SHELL_VAR ** +all_visible_variables () +{ + return (vapply (visible_var)); +} + +/* Return non-zero if the variable VAR is visible and exported. Array + variables cannot be exported. */ +static int +visible_and_exported (var) + SHELL_VAR *var; +{ + return (invisible_p (var) == 0 && exported_p (var)); +} + +/* Candidate variables for the export environment are either valid variables + with the export attribute or invalid variables inherited from the initial + environment and simply passed through. */ +static int +export_environment_candidate (var) + SHELL_VAR *var; +{ + return (exported_p (var) && (invisible_p (var) == 0 || imported_p (var))); +} + +/* Return non-zero if VAR is a local variable in the current context and + is exported. */ +static int +local_and_exported (var) + SHELL_VAR *var; +{ + return (invisible_p (var) == 0 && local_p (var) && var->context == variable_context && exported_p (var)); +} + +SHELL_VAR ** +all_exported_variables () +{ + return (vapply (visible_and_exported)); +} + +SHELL_VAR ** +local_exported_variables () +{ + return (vapply (local_and_exported)); +} + +static int +variable_in_context (var) + SHELL_VAR *var; +{ + return (invisible_p (var) == 0 && local_p (var) && var->context == variable_context); +} + +SHELL_VAR ** +all_local_variables () +{ + VARLIST *vlist; + SHELL_VAR **ret; + VAR_CONTEXT *vc; + + vc = shell_variables; + for (vc = shell_variables; vc; vc = vc->down) + if (vc_isfuncenv (vc) && vc->scope == variable_context) + break; + + if (vc == 0) + { + internal_error (_("all_local_variables: no function context at current scope")); + return (SHELL_VAR **)NULL; + } + if (vc->table == 0 || HASH_ENTRIES (vc->table) == 0 || vc_haslocals (vc) == 0) + return (SHELL_VAR **)NULL; + + vlist = vlist_alloc (HASH_ENTRIES (vc->table)); + + flatten (vc->table, variable_in_context, vlist, 0); + + ret = vlist->list; + free (vlist); + if (ret) + sort_variables (ret); + return ret; +} + +#if defined (ARRAY_VARS) +/* Return non-zero if the variable VAR is visible and an array. */ +static int +visible_array_vars (var) + SHELL_VAR *var; +{ + return (invisible_p (var) == 0 && array_p (var)); +} + +SHELL_VAR ** +all_array_variables () +{ + return (vapply (visible_array_vars)); +} +#endif /* ARRAY_VARS */ + +char ** +all_variables_matching_prefix (prefix) + const char *prefix; +{ + SHELL_VAR **varlist; + char **rlist; + int vind, rind, plen; + + plen = STRLEN (prefix); + varlist = all_visible_variables (); + for (vind = 0; varlist && varlist[vind]; vind++) + ; + if (varlist == 0 || vind == 0) + return ((char **)NULL); + rlist = strvec_create (vind + 1); + for (vind = rind = 0; varlist[vind]; vind++) + { + if (plen == 0 || STREQN (prefix, varlist[vind]->name, plen)) + rlist[rind++] = savestring (varlist[vind]->name); + } + rlist[rind] = (char *)0; + free (varlist); + + return rlist; +} + +/* **************************************************************** */ +/* */ +/* Managing temporary variable scopes */ +/* */ +/* **************************************************************** */ + +/* Make variable NAME have VALUE in the temporary environment. */ +static SHELL_VAR * +bind_tempenv_variable (name, value) + const char *name; + char *value; +{ + SHELL_VAR *var; + + var = temporary_env ? hash_lookup (name, temporary_env) : (SHELL_VAR *)NULL; + + if (var) + { + FREE (value_cell (var)); + var_setvalue (var, savestring (value)); + INVALIDATE_EXPORTSTR (var); + } + + return (var); +} + +/* Find a variable in the temporary environment that is named NAME. + Return the SHELL_VAR *, or NULL if not found. */ +SHELL_VAR * +find_tempenv_variable (name) + const char *name; +{ + return (temporary_env ? hash_lookup (name, temporary_env) : (SHELL_VAR *)NULL); +} + +char **tempvar_list; +int tvlist_ind; + +/* Push the variable described by (SHELL_VAR *)DATA down to the next + variable context from the temporary environment. */ +static void +push_temp_var (data) + PTR_T data; +{ + SHELL_VAR *var, *v; + HASH_TABLE *binding_table; + + var = (SHELL_VAR *)data; + + binding_table = shell_variables->table; + if (binding_table == 0) + { + if (shell_variables == global_variables) + /* shouldn't happen */ + binding_table = shell_variables->table = global_variables->table = hash_create (0); + else + binding_table = shell_variables->table = hash_create (TEMPENV_HASH_BUCKETS); + } + + v = bind_variable_internal (var->name, value_cell (var), binding_table, 0, 0); + + /* XXX - should we set the context here? It shouldn't matter because of how + assign_in_env works, but might want to check. */ + if (binding_table == global_variables->table) /* XXX */ + var->attributes &= ~(att_tempvar|att_propagate); + else + { + var->attributes |= att_propagate; + if (binding_table == shell_variables->table) + shell_variables->flags |= VC_HASTMPVAR; + } + v->attributes |= var->attributes; + + if (find_special_var (var->name) >= 0) + tempvar_list[tvlist_ind++] = savestring (var->name); + + dispose_variable (var); +} + +static void +propagate_temp_var (data) + PTR_T data; +{ + SHELL_VAR *var; + + var = (SHELL_VAR *)data; + if (tempvar_p (var) && (var->attributes & att_propagate)) + push_temp_var (data); + else + { + if (find_special_var (var->name) >= 0) + tempvar_list[tvlist_ind++] = savestring (var->name); + dispose_variable (var); + } +} + +/* Free the storage used in the hash table for temporary + environment variables. PUSHF is a function to be called + to free each hash table entry. It takes care of pushing variables + to previous scopes if appropriate. PUSHF stores names of variables + that require special handling (e.g., IFS) on tempvar_list, so this + function can call stupidly_hack_special_variables on all the + variables in the list when the temporary hash table is destroyed. */ +static void +dispose_temporary_env (pushf) + sh_free_func_t *pushf; +{ + int i; + + tempvar_list = strvec_create (HASH_ENTRIES (temporary_env) + 1); + tempvar_list[tvlist_ind = 0] = 0; + + hash_flush (temporary_env, pushf); + hash_dispose (temporary_env); + temporary_env = (HASH_TABLE *)NULL; + + tempvar_list[tvlist_ind] = 0; + + array_needs_making = 1; + +#if 0 + sv_ifs ("IFS"); /* XXX here for now -- check setifs in assign_in_env */ +#endif + for (i = 0; i < tvlist_ind; i++) + stupidly_hack_special_variables (tempvar_list[i]); + + strvec_dispose (tempvar_list); + tempvar_list = 0; + tvlist_ind = 0; +} + +void +dispose_used_env_vars () +{ + if (temporary_env) + { + dispose_temporary_env (propagate_temp_var); + maybe_make_export_env (); + } +} + +/* Take all of the shell variables in the temporary environment HASH_TABLE + and make shell variables from them at the current variable context. */ +void +merge_temporary_env () +{ + if (temporary_env) + dispose_temporary_env (push_temp_var); +} + +/* **************************************************************** */ +/* */ +/* Creating and manipulating the environment */ +/* */ +/* **************************************************************** */ + +static inline char * +mk_env_string (name, value) + const char *name, *value; +{ + int name_len, value_len; + char *p; + + name_len = strlen (name); + value_len = STRLEN (value); + p = (char *)xmalloc (2 + name_len + value_len); + strcpy (p, name); + p[name_len] = '='; + if (value && *value) + strcpy (p + name_len + 1, value); + else + p[name_len + 1] = '\0'; + return (p); +} + +#ifdef DEBUG +/* Debugging */ +static int +valid_exportstr (v) + SHELL_VAR *v; +{ + char *s; + + s = v->exportstr; + if (s == 0) + { + internal_error (_("%s has null exportstr"), v->name); + return (0); + } + if (legal_variable_starter ((unsigned char)*s) == 0) + { + internal_error (_("invalid character %d in exportstr for %s"), *s, v->name); + return (0); + } + for (s = v->exportstr + 1; s && *s; s++) + { + if (*s == '=') + break; + if (legal_variable_char ((unsigned char)*s) == 0) + { + internal_error (_("invalid character %d in exportstr for %s"), *s, v->name); + return (0); + } + } + if (*s != '=') + { + internal_error (_("no `=' in exportstr for %s"), v->name); + return (0); + } + return (1); +} +#endif + +static char ** +make_env_array_from_var_list (vars) + SHELL_VAR **vars; +{ + register int i, list_index; + register SHELL_VAR *var; + char **list, *value; + + list = strvec_create ((1 + strvec_len ((char **)vars))); + +#define USE_EXPORTSTR (value == var->exportstr) + + for (i = 0, list_index = 0; var = vars[i]; i++) + { +#if defined (__CYGWIN__) + /* We don't use the exportstr stuff on Cygwin at all. */ + INVALIDATE_EXPORTSTR (var); +#endif + if (var->exportstr) + value = var->exportstr; + else if (function_p (var)) + value = named_function_string ((char *)NULL, function_cell (var), 0); +#if defined (ARRAY_VARS) + else if (array_p (var)) +# if ARRAY_EXPORT + value = array_to_assignment_string (array_cell (var)); +# else + continue; /* XXX array vars cannot yet be exported */ +# endif /* ARRAY_EXPORT */ + else if (assoc_p (var)) +# if 0 + value = assoc_to_assignment_string (assoc_cell (var)); +# else + continue; /* XXX associative array vars cannot yet be exported */ +# endif +#endif + else + value = value_cell (var); + + if (value) + { + /* Gee, I'd like to get away with not using savestring() if we're + using the cached exportstr... */ + list[list_index] = USE_EXPORTSTR ? savestring (value) + : mk_env_string (var->name, value); + + if (USE_EXPORTSTR == 0) + SAVE_EXPORTSTR (var, list[list_index]); + + list_index++; +#undef USE_EXPORTSTR + +#if 0 /* not yet */ +#if defined (ARRAY_VARS) + if (array_p (var) || assoc_p (var)) + free (value); +#endif +#endif + } + } + + list[list_index] = (char *)NULL; + return (list); +} + +/* Make an array of assignment statements from the hash table + HASHED_VARS which contains SHELL_VARs. Only visible, exported + variables are eligible. */ +static char ** +make_var_export_array (vcxt) + VAR_CONTEXT *vcxt; +{ + char **list; + SHELL_VAR **vars; + +#if 0 + vars = map_over (visible_and_exported, vcxt); +#else + vars = map_over (export_environment_candidate, vcxt); +#endif + + if (vars == 0) + return (char **)NULL; + + list = make_env_array_from_var_list (vars); + + free (vars); + return (list); +} + +static char ** +make_func_export_array () +{ + char **list; + SHELL_VAR **vars; + + vars = map_over_funcs (visible_and_exported); + if (vars == 0) + return (char **)NULL; + + list = make_env_array_from_var_list (vars); + + free (vars); + return (list); +} + +/* Add ENVSTR to the end of the exported environment, EXPORT_ENV. */ +#define add_to_export_env(envstr,do_alloc) \ +do \ + { \ + if (export_env_index >= (export_env_size - 1)) \ + { \ + export_env_size += 16; \ + export_env = strvec_resize (export_env, export_env_size); \ + environ = export_env; \ + } \ + export_env[export_env_index++] = (do_alloc) ? savestring (envstr) : envstr; \ + export_env[export_env_index] = (char *)NULL; \ + } while (0) + +/* Add ASSIGN to EXPORT_ENV, or supercede a previous assignment in the + array with the same left-hand side. Return the new EXPORT_ENV. */ +char ** +add_or_supercede_exported_var (assign, do_alloc) + char *assign; + int do_alloc; +{ + register int i; + int equal_offset; + + equal_offset = assignment (assign, 0); + if (equal_offset == 0) + return (export_env); + + /* If this is a function, then only supersede the function definition. + We do this by including the `=() {' in the comparison, like + initialize_shell_variables does. */ + if (assign[equal_offset + 1] == '(' && + strncmp (assign + equal_offset + 2, ") {", 3) == 0) /* } */ + equal_offset += 4; + + for (i = 0; i < export_env_index; i++) + { + if (STREQN (assign, export_env[i], equal_offset + 1)) + { + free (export_env[i]); + export_env[i] = do_alloc ? savestring (assign) : assign; + return (export_env); + } + } + add_to_export_env (assign, do_alloc); + return (export_env); +} + +static void +add_temp_array_to_env (temp_array, do_alloc, do_supercede) + char **temp_array; + int do_alloc, do_supercede; +{ + register int i; + + if (temp_array == 0) + return; + + for (i = 0; temp_array[i]; i++) + { + if (do_supercede) + export_env = add_or_supercede_exported_var (temp_array[i], do_alloc); + else + add_to_export_env (temp_array[i], do_alloc); + } + + free (temp_array); +} + +/* Make the environment array for the command about to be executed, if the + array needs making. Otherwise, do nothing. If a shell action could + change the array that commands receive for their environment, then the + code should `array_needs_making++'. + + The order to add to the array is: + temporary_env + list of var contexts whose head is shell_variables + shell_functions + + This is the shell variable lookup order. We add only new variable + names at each step, which allows local variables and variables in + the temporary environments to shadow variables in the global (or + any previous) scope. +*/ + +static int +n_shell_variables () +{ + VAR_CONTEXT *vc; + int n; + + for (n = 0, vc = shell_variables; vc; vc = vc->down) + n += HASH_ENTRIES (vc->table); + return n; +} + +int +chkexport (name) + char *name; +{ + SHELL_VAR *v; + + v = find_variable (name); + if (v && exported_p (v)) + { + array_needs_making = 1; + maybe_make_export_env (); + return 1; + } + return 0; +} + +void +maybe_make_export_env () +{ + register char **temp_array; + int new_size; + VAR_CONTEXT *tcxt; + + if (array_needs_making) + { + if (export_env) + strvec_flush (export_env); + + /* Make a guess based on how many shell variables and functions we + have. Since there will always be array variables, and array + variables are not (yet) exported, this will always be big enough + for the exported variables and functions. */ + new_size = n_shell_variables () + HASH_ENTRIES (shell_functions) + 1 + + HASH_ENTRIES (temporary_env); + if (new_size > export_env_size) + { + export_env_size = new_size; + export_env = strvec_resize (export_env, export_env_size); + environ = export_env; + } + export_env[export_env_index = 0] = (char *)NULL; + + /* Make a dummy variable context from the temporary_env, stick it on + the front of shell_variables, call make_var_export_array on the + whole thing to flatten it, and convert the list of SHELL_VAR *s + to the form needed by the environment. */ + if (temporary_env) + { + tcxt = new_var_context ((char *)NULL, 0); + tcxt->table = temporary_env; + tcxt->down = shell_variables; + } + else + tcxt = shell_variables; + + temp_array = make_var_export_array (tcxt); + if (temp_array) + add_temp_array_to_env (temp_array, 0, 0); + + if (tcxt != shell_variables) + free (tcxt); + +#if defined (RESTRICTED_SHELL) + /* Restricted shells may not export shell functions. */ + temp_array = restricted ? (char **)0 : make_func_export_array (); +#else + temp_array = make_func_export_array (); +#endif + if (temp_array) + add_temp_array_to_env (temp_array, 0, 0); + + array_needs_making = 0; + } +} + +/* This is an efficiency hack. PWD and OLDPWD are auto-exported, so + we will need to remake the exported environment every time we + change directories. `_' is always put into the environment for + every external command, so without special treatment it will always + cause the environment to be remade. + + If there is no other reason to make the exported environment, we can + just update the variables in place and mark the exported environment + as no longer needing a remake. */ +void +update_export_env_inplace (env_prefix, preflen, value) + char *env_prefix; + int preflen; + char *value; +{ + char *evar; + + evar = (char *)xmalloc (STRLEN (value) + preflen + 1); + strcpy (evar, env_prefix); + if (value) + strcpy (evar + preflen, value); + export_env = add_or_supercede_exported_var (evar, 0); +} + +/* We always put _ in the environment as the name of this command. */ +void +put_command_name_into_env (command_name) + char *command_name; +{ + update_export_env_inplace ("_=", 2, command_name); +} + +/* **************************************************************** */ +/* */ +/* Managing variable contexts */ +/* */ +/* **************************************************************** */ + +/* Allocate and return a new variable context with NAME and FLAGS. + NAME can be NULL. */ + +VAR_CONTEXT * +new_var_context (name, flags) + char *name; + int flags; +{ + VAR_CONTEXT *vc; + + vc = (VAR_CONTEXT *)xmalloc (sizeof (VAR_CONTEXT)); + vc->name = name ? savestring (name) : (char *)NULL; + vc->scope = variable_context; + vc->flags = flags; + + vc->up = vc->down = (VAR_CONTEXT *)NULL; + vc->table = (HASH_TABLE *)NULL; + + return vc; +} + +/* Free a variable context and its data, including the hash table. Dispose + all of the variables. */ +void +dispose_var_context (vc) + VAR_CONTEXT *vc; +{ + FREE (vc->name); + + if (vc->table) + { + delete_all_variables (vc->table); + hash_dispose (vc->table); + } + + free (vc); +} + +/* Set VAR's scope level to the current variable context. */ +static int +set_context (var) + SHELL_VAR *var; +{ + return (var->context = variable_context); +} + +/* Make a new variable context with NAME and FLAGS and a HASH_TABLE of + temporary variables, and push it onto shell_variables. This is + for shell functions. */ +VAR_CONTEXT * +push_var_context (name, flags, tempvars) + char *name; + int flags; + HASH_TABLE *tempvars; +{ + VAR_CONTEXT *vc; + + vc = new_var_context (name, flags); + vc->table = tempvars; + if (tempvars) + { + /* Have to do this because the temp environment was created before + variable_context was incremented. */ + flatten (tempvars, set_context, (VARLIST *)NULL, 0); + vc->flags |= VC_HASTMPVAR; + } + vc->down = shell_variables; + shell_variables->up = vc; + + return (shell_variables = vc); +} + +static void +push_func_var (data) + PTR_T data; +{ + SHELL_VAR *var, *v; + + var = (SHELL_VAR *)data; + + if (tempvar_p (var) && (posixly_correct || (var->attributes & att_propagate))) + { + /* Make sure we have a hash table to store the variable in while it is + being propagated down to the global variables table. Create one if + we have to */ + if ((vc_isfuncenv (shell_variables) || vc_istempenv (shell_variables)) && shell_variables->table == 0) + shell_variables->table = hash_create (0); + /* XXX - should we set v->context here? */ + v = bind_variable_internal (var->name, value_cell (var), shell_variables->table, 0, 0); + if (shell_variables == global_variables) + var->attributes &= ~(att_tempvar|att_propagate); + else + shell_variables->flags |= VC_HASTMPVAR; + v->attributes |= var->attributes; + } + else + stupidly_hack_special_variables (var->name); /* XXX */ + + dispose_variable (var); +} + +/* Pop the top context off of VCXT and dispose of it, returning the rest of + the stack. */ +void +pop_var_context () +{ + VAR_CONTEXT *ret, *vcxt; + + vcxt = shell_variables; + if (vc_isfuncenv (vcxt) == 0) + { + internal_error (_("pop_var_context: head of shell_variables not a function context")); + return; + } + + if (ret = vcxt->down) + { + ret->up = (VAR_CONTEXT *)NULL; + shell_variables = ret; + if (vcxt->table) + hash_flush (vcxt->table, push_func_var); + dispose_var_context (vcxt); + } + else + internal_error (_("pop_var_context: no global_variables context")); +} + +/* Delete the HASH_TABLEs for all variable contexts beginning at VCXT, and + all of the VAR_CONTEXTs except GLOBAL_VARIABLES. */ +void +delete_all_contexts (vcxt) + VAR_CONTEXT *vcxt; +{ + VAR_CONTEXT *v, *t; + + for (v = vcxt; v != global_variables; v = t) + { + t = v->down; + dispose_var_context (v); + } + + delete_all_variables (global_variables->table); + shell_variables = global_variables; +} + +/* **************************************************************** */ +/* */ +/* Pushing and Popping temporary variable scopes */ +/* */ +/* **************************************************************** */ + +VAR_CONTEXT * +push_scope (flags, tmpvars) + int flags; + HASH_TABLE *tmpvars; +{ + return (push_var_context ((char *)NULL, flags, tmpvars)); +} + +static void +push_exported_var (data) + PTR_T data; +{ + SHELL_VAR *var, *v; + + var = (SHELL_VAR *)data; + + /* If a temp var had its export attribute set, or it's marked to be + propagated, bind it in the previous scope before disposing it. */ + /* XXX - This isn't exactly right, because all tempenv variables have the + export attribute set. */ +#if 0 + if (exported_p (var) || (var->attributes & att_propagate)) +#else + if (tempvar_p (var) && exported_p (var) && (var->attributes & att_propagate)) +#endif + { + var->attributes &= ~att_tempvar; /* XXX */ + v = bind_variable_internal (var->name, value_cell (var), shell_variables->table, 0, 0); + if (shell_variables == global_variables) + var->attributes &= ~att_propagate; + v->attributes |= var->attributes; + } + else + stupidly_hack_special_variables (var->name); /* XXX */ + + dispose_variable (var); +} + +void +pop_scope (is_special) + int is_special; +{ + VAR_CONTEXT *vcxt, *ret; + + vcxt = shell_variables; + if (vc_istempscope (vcxt) == 0) + { + internal_error (_("pop_scope: head of shell_variables not a temporary environment scope")); + return; + } + + ret = vcxt->down; + if (ret) + ret->up = (VAR_CONTEXT *)NULL; + + shell_variables = ret; + + /* Now we can take care of merging variables in VCXT into set of scopes + whose head is RET (shell_variables). */ + FREE (vcxt->name); + if (vcxt->table) + { + if (is_special) + hash_flush (vcxt->table, push_func_var); + else + hash_flush (vcxt->table, push_exported_var); + hash_dispose (vcxt->table); + } + free (vcxt); + + sv_ifs ("IFS"); /* XXX here for now */ +} + +/* **************************************************************** */ +/* */ +/* Pushing and Popping function contexts */ +/* */ +/* **************************************************************** */ + +static WORD_LIST **dollar_arg_stack = (WORD_LIST **)NULL; +static int dollar_arg_stack_slots; +static int dollar_arg_stack_index; + +/* XXX - we might want to consider pushing and popping the `getopts' state + when we modify the positional parameters. */ +void +push_context (name, is_subshell, tempvars) + char *name; /* function name */ + int is_subshell; + HASH_TABLE *tempvars; +{ + if (is_subshell == 0) + push_dollar_vars (); + variable_context++; + push_var_context (name, VC_FUNCENV, tempvars); +} + +/* Only called when subshell == 0, so we don't need to check, and can + unconditionally pop the dollar vars off the stack. */ +void +pop_context () +{ + pop_dollar_vars (); + variable_context--; + pop_var_context (); + + sv_ifs ("IFS"); /* XXX here for now */ +} + +/* Save the existing positional parameters on a stack. */ +void +push_dollar_vars () +{ + if (dollar_arg_stack_index + 2 > dollar_arg_stack_slots) + { + dollar_arg_stack = (WORD_LIST **) + xrealloc (dollar_arg_stack, (dollar_arg_stack_slots += 10) + * sizeof (WORD_LIST *)); + } + dollar_arg_stack[dollar_arg_stack_index++] = list_rest_of_args (); + dollar_arg_stack[dollar_arg_stack_index] = (WORD_LIST *)NULL; +} + +/* Restore the positional parameters from our stack. */ +void +pop_dollar_vars () +{ + if (!dollar_arg_stack || dollar_arg_stack_index == 0) + return; + + remember_args (dollar_arg_stack[--dollar_arg_stack_index], 1); + dispose_words (dollar_arg_stack[dollar_arg_stack_index]); + dollar_arg_stack[dollar_arg_stack_index] = (WORD_LIST *)NULL; + set_dollar_vars_unchanged (); +} + +void +dispose_saved_dollar_vars () +{ + if (!dollar_arg_stack || dollar_arg_stack_index == 0) + return; + + dispose_words (dollar_arg_stack[dollar_arg_stack_index]); + dollar_arg_stack[dollar_arg_stack_index] = (WORD_LIST *)NULL; +} + +/* Manipulate the special BASH_ARGV and BASH_ARGC variables. */ + +void +push_args (list) + WORD_LIST *list; +{ +#if defined (ARRAY_VARS) && defined (DEBUGGER) + SHELL_VAR *bash_argv_v, *bash_argc_v; + ARRAY *bash_argv_a, *bash_argc_a; + WORD_LIST *l; + arrayind_t i; + char *t; + + GET_ARRAY_FROM_VAR ("BASH_ARGV", bash_argv_v, bash_argv_a); + GET_ARRAY_FROM_VAR ("BASH_ARGC", bash_argc_v, bash_argc_a); + + for (l = list, i = 0; l; l = l->next, i++) + array_push (bash_argv_a, l->word->word); + + t = itos (i); + array_push (bash_argc_a, t); + free (t); +#endif /* ARRAY_VARS && DEBUGGER */ +} + +/* Remove arguments from BASH_ARGV array. Pop top element off BASH_ARGC + array and use that value as the count of elements to remove from + BASH_ARGV. */ +void +pop_args () +{ +#if defined (ARRAY_VARS) && defined (DEBUGGER) + SHELL_VAR *bash_argv_v, *bash_argc_v; + ARRAY *bash_argv_a, *bash_argc_a; + ARRAY_ELEMENT *ce; + intmax_t i; + + GET_ARRAY_FROM_VAR ("BASH_ARGV", bash_argv_v, bash_argv_a); + GET_ARRAY_FROM_VAR ("BASH_ARGC", bash_argc_v, bash_argc_a); + + ce = array_shift (bash_argc_a, 1, 0); + if (ce == 0 || legal_number (element_value (ce), &i) == 0) + i = 0; + + for ( ; i > 0; i--) + array_pop (bash_argv_a); + array_dispose_element (ce); +#endif /* ARRAY_VARS && DEBUGGER */ +} + +/************************************************* + * * + * Functions to manage special variables * + * * + *************************************************/ + +/* Extern declarations for variables this code has to manage. */ +extern int eof_encountered, eof_encountered_limit, ignoreeof; + +#if defined (READLINE) +extern int hostname_list_initialized; +#endif + +/* An alist of name.function for each special variable. Most of the + functions don't do much, and in fact, this would be faster with a + switch statement, but by the end of this file, I am sick of switch + statements. */ + +#define SET_INT_VAR(name, intvar) intvar = find_variable (name) != 0 + +/* This table will be sorted with qsort() the first time it's accessed. */ +struct name_and_function { + char *name; + sh_sv_func_t *function; +}; + +static struct name_and_function special_vars[] = { + { "BASH_COMPAT", sv_shcompat }, + { "BASH_XTRACEFD", sv_xtracefd }, + +#if defined (JOB_CONTROL) + { "CHILD_MAX", sv_childmax }, +#endif + +#if defined (READLINE) +# if defined (STRICT_POSIX) + { "COLUMNS", sv_winsize }, +# endif + { "COMP_WORDBREAKS", sv_comp_wordbreaks }, +#endif + + { "FUNCNEST", sv_funcnest }, + + { "GLOBIGNORE", sv_globignore }, + +#if defined (HISTORY) + { "HISTCONTROL", sv_history_control }, + { "HISTFILESIZE", sv_histsize }, + { "HISTIGNORE", sv_histignore }, + { "HISTSIZE", sv_histsize }, + { "HISTTIMEFORMAT", sv_histtimefmt }, +#endif + +#if defined (__CYGWIN__) + { "HOME", sv_home }, +#endif + +#if defined (READLINE) + { "HOSTFILE", sv_hostfile }, +#endif + + { "IFS", sv_ifs }, + { "IGNOREEOF", sv_ignoreeof }, + + { "LANG", sv_locale }, + { "LC_ALL", sv_locale }, + { "LC_COLLATE", sv_locale }, + { "LC_CTYPE", sv_locale }, + { "LC_MESSAGES", sv_locale }, + { "LC_NUMERIC", sv_locale }, + { "LC_TIME", sv_locale }, + +#if defined (READLINE) && defined (STRICT_POSIX) + { "LINES", sv_winsize }, +#endif + + { "MAIL", sv_mail }, + { "MAILCHECK", sv_mail }, + { "MAILPATH", sv_mail }, + + { "OPTERR", sv_opterr }, + { "OPTIND", sv_optind }, + + { "PATH", sv_path }, + { "POSIXLY_CORRECT", sv_strict_posix }, + +#if defined (READLINE) + { "TERM", sv_terminal }, + { "TERMCAP", sv_terminal }, + { "TERMINFO", sv_terminal }, +#endif /* READLINE */ + + { "TEXTDOMAIN", sv_locale }, + { "TEXTDOMAINDIR", sv_locale }, + +#if defined (HAVE_TZSET) + { "TZ", sv_tz }, +#endif + +#if defined (HISTORY) && defined (BANG_HISTORY) + { "histchars", sv_histchars }, +#endif /* HISTORY && BANG_HISTORY */ + + { "ignoreeof", sv_ignoreeof }, + + { (char *)0, (sh_sv_func_t *)0 } +}; + +#define N_SPECIAL_VARS (sizeof (special_vars) / sizeof (special_vars[0]) - 1) + +static int +sv_compare (sv1, sv2) + struct name_and_function *sv1, *sv2; +{ + int r; + + if ((r = sv1->name[0] - sv2->name[0]) == 0) + r = strcmp (sv1->name, sv2->name); + return r; +} + +static inline int +find_special_var (name) + const char *name; +{ + register int i, r; + + for (i = 0; special_vars[i].name; i++) + { + r = special_vars[i].name[0] - name[0]; + if (r == 0) + r = strcmp (special_vars[i].name, name); + if (r == 0) + return i; + else if (r > 0) + /* Can't match any of rest of elements in sorted list. Take this out + if it causes problems in certain environments. */ + break; + } + return -1; +} + +/* The variable in NAME has just had its state changed. Check to see if it + is one of the special ones where something special happens. */ +void +stupidly_hack_special_variables (name) + char *name; +{ + static int sv_sorted = 0; + int i; + + if (sv_sorted == 0) /* shouldn't need, but it's fairly cheap. */ + { + qsort (special_vars, N_SPECIAL_VARS, sizeof (special_vars[0]), + (QSFUNC *)sv_compare); + sv_sorted = 1; + } + + i = find_special_var (name); + if (i != -1) + (*(special_vars[i].function)) (name); +} + +/* Special variables that need hooks to be run when they are unset as part + of shell reinitialization should have their sv_ functions run here. */ +void +reinit_special_variables () +{ +#if defined (READLINE) + sv_comp_wordbreaks ("COMP_WORDBREAKS"); +#endif + sv_globignore ("GLOBIGNORE"); + sv_opterr ("OPTERR"); +} + +void +sv_ifs (name) + char *name; +{ + SHELL_VAR *v; + + v = find_variable ("IFS"); + setifs (v); +} + +/* What to do just after the PATH variable has changed. */ +void +sv_path (name) + char *name; +{ + /* hash -r */ + phash_flush (); +} + +/* What to do just after one of the MAILxxxx variables has changed. NAME + is the name of the variable. This is called with NAME set to one of + MAIL, MAILCHECK, or MAILPATH. */ +void +sv_mail (name) + char *name; +{ + /* If the time interval for checking the files has changed, then + reset the mail timer. Otherwise, one of the pathname vars + to the users mailbox has changed, so rebuild the array of + filenames. */ + if (name[4] == 'C') /* if (strcmp (name, "MAILCHECK") == 0) */ + reset_mail_timer (); + else + { + free_mail_files (); + remember_mail_dates (); + } +} + +void +sv_funcnest (name) + char *name; +{ + SHELL_VAR *v; + intmax_t num; + + v = find_variable (name); + if (v == 0) + funcnest_max = 0; + else if (legal_number (value_cell (v), &num) == 0) + funcnest_max = 0; + else + funcnest_max = num; +} + +/* What to do when GLOBIGNORE changes. */ +void +sv_globignore (name) + char *name; +{ + if (privileged_mode == 0) + setup_glob_ignore (name); +} + +#if defined (READLINE) +void +sv_comp_wordbreaks (name) + char *name; +{ + SHELL_VAR *sv; + + sv = find_variable (name); + if (sv == 0) + reset_completer_word_break_chars (); +} + +/* What to do just after one of the TERMxxx variables has changed. + If we are an interactive shell, then try to reset the terminal + information in readline. */ +void +sv_terminal (name) + char *name; +{ + if (interactive_shell && no_line_editing == 0) + rl_reset_terminal (get_string_value ("TERM")); +} + +void +sv_hostfile (name) + char *name; +{ + SHELL_VAR *v; + + v = find_variable (name); + if (v == 0) + clear_hostname_list (); + else + hostname_list_initialized = 0; +} + +#if defined (STRICT_POSIX) +/* In strict posix mode, we allow assignments to LINES and COLUMNS (and values + found in the initial environment) to override the terminal size reported by + the kernel. */ +void +sv_winsize (name) + char *name; +{ + SHELL_VAR *v; + intmax_t xd; + int d; + + if (posixly_correct == 0 || interactive_shell == 0 || no_line_editing) + return; + + v = find_variable (name); + if (v == 0 || var_isnull (v)) + rl_reset_screen_size (); + else + { + if (legal_number (value_cell (v), &xd) == 0) + return; + winsize_assignment = 1; + d = xd; /* truncate */ + if (name[0] == 'L') /* LINES */ + rl_set_screen_size (d, -1); + else /* COLUMNS */ + rl_set_screen_size (-1, d); + winsize_assignment = 0; + } +} +#endif /* STRICT_POSIX */ +#endif /* READLINE */ + +/* Update the value of HOME in the export environment so tilde expansion will + work on cygwin. */ +#if defined (__CYGWIN__) +sv_home (name) + char *name; +{ + array_needs_making = 1; + maybe_make_export_env (); +} +#endif + +#if defined (HISTORY) +/* What to do after the HISTSIZE or HISTFILESIZE variables change. + If there is a value for this HISTSIZE (and it is numeric), then stifle + the history. Otherwise, if there is NO value for this variable, + unstifle the history. If name is HISTFILESIZE, and its value is + numeric, truncate the history file to hold no more than that many + lines. */ +void +sv_histsize (name) + char *name; +{ + char *temp; + intmax_t num; + int hmax; + + temp = get_string_value (name); + + if (temp && *temp) + { + if (legal_number (temp, &num)) + { + hmax = num; + if (hmax < 0 && name[4] == 'S') + unstifle_history (); /* unstifle history if HISTSIZE < 0 */ + else if (name[4] == 'S') + { + stifle_history (hmax); + hmax = where_history (); + if (history_lines_this_session > hmax) + history_lines_this_session = hmax; + } + else if (hmax >= 0) /* truncate HISTFILE if HISTFILESIZE >= 0 */ + { + history_truncate_file (get_string_value ("HISTFILE"), hmax); + if (hmax <= history_lines_in_file) + history_lines_in_file = hmax; + } + } + } + else if (name[4] == 'S') + unstifle_history (); +} + +/* What to do after the HISTIGNORE variable changes. */ +void +sv_histignore (name) + char *name; +{ + setup_history_ignore (name); +} + +/* What to do after the HISTCONTROL variable changes. */ +void +sv_history_control (name) + char *name; +{ + char *temp; + char *val; + int tptr; + + history_control = 0; + temp = get_string_value (name); + + if (temp == 0 || *temp == 0) + return; + + tptr = 0; + while (val = extract_colon_unit (temp, &tptr)) + { + if (STREQ (val, "ignorespace")) + history_control |= HC_IGNSPACE; + else if (STREQ (val, "ignoredups")) + history_control |= HC_IGNDUPS; + else if (STREQ (val, "ignoreboth")) + history_control |= HC_IGNBOTH; + else if (STREQ (val, "erasedups")) + history_control |= HC_ERASEDUPS; + + free (val); + } +} + +#if defined (BANG_HISTORY) +/* Setting/unsetting of the history expansion character. */ +void +sv_histchars (name) + char *name; +{ + char *temp; + + temp = get_string_value (name); + if (temp) + { + history_expansion_char = *temp; + if (temp[0] && temp[1]) + { + history_subst_char = temp[1]; + if (temp[2]) + history_comment_char = temp[2]; + } + } + else + { + history_expansion_char = '!'; + history_subst_char = '^'; + history_comment_char = '#'; + } +} +#endif /* BANG_HISTORY */ + +void +sv_histtimefmt (name) + char *name; +{ + SHELL_VAR *v; + + if (v = find_variable (name)) + { + if (history_comment_char == 0) + history_comment_char = '#'; + } + history_write_timestamps = (v != 0); +} +#endif /* HISTORY */ + +#if defined (HAVE_TZSET) +void +sv_tz (name) + char *name; +{ + if (chkexport (name)) + tzset (); +} +#endif + +/* If the variable exists, then the value of it can be the number + of times we actually ignore the EOF. The default is small, + (smaller than csh, anyway). */ +void +sv_ignoreeof (name) + char *name; +{ + SHELL_VAR *tmp_var; + char *temp; + + eof_encountered = 0; + + tmp_var = find_variable (name); + ignoreeof = tmp_var != 0; + temp = tmp_var ? value_cell (tmp_var) : (char *)NULL; + if (temp) + eof_encountered_limit = (*temp && all_digits (temp)) ? atoi (temp) : 10; + set_shellopts (); /* make sure `ignoreeof' is/is not in $SHELLOPTS */ +} + +void +sv_optind (name) + char *name; +{ + char *tt; + int s; + + tt = get_string_value ("OPTIND"); + if (tt && *tt) + { + s = atoi (tt); + + /* According to POSIX, setting OPTIND=1 resets the internal state + of getopt (). */ + if (s < 0 || s == 1) + s = 0; + } + else + s = 0; + getopts_reset (s); +} + +void +sv_opterr (name) + char *name; +{ + char *tt; + + tt = get_string_value ("OPTERR"); + sh_opterr = (tt && *tt) ? atoi (tt) : 1; +} + +void +sv_strict_posix (name) + char *name; +{ + SET_INT_VAR (name, posixly_correct); + posix_initialize (posixly_correct); +#if defined (READLINE) + if (interactive_shell) + posix_readline_initialize (posixly_correct); +#endif /* READLINE */ + set_shellopts (); /* make sure `posix' is/is not in $SHELLOPTS */ +} + +void +sv_locale (name) + char *name; +{ + char *v; + int r; + + v = get_string_value (name); + if (name[0] == 'L' && name[1] == 'A') /* LANG */ + r = set_lang (name, v); + else + r = set_locale_var (name, v); /* LC_*, TEXTDOMAIN* */ + +#if 1 + if (r == 0 && posixly_correct) + last_command_exit_value = 1; +#endif +} + +#if defined (ARRAY_VARS) +void +set_pipestatus_array (ps, nproc) + int *ps; + int nproc; +{ + SHELL_VAR *v; + ARRAY *a; + ARRAY_ELEMENT *ae; + register int i; + char *t, tbuf[INT_STRLEN_BOUND(int) + 1]; + + v = find_variable ("PIPESTATUS"); + if (v == 0) + v = make_new_array_variable ("PIPESTATUS"); + if (array_p (v) == 0) + return; /* Do nothing if not an array variable. */ + a = array_cell (v); + + if (a == 0 || array_num_elements (a) == 0) + { + for (i = 0; i < nproc; i++) /* was ps[i] != -1, not i < nproc */ + { + t = inttostr (ps[i], tbuf, sizeof (tbuf)); + array_insert (a, i, t); + } + return; + } + + /* Fast case */ + if (array_num_elements (a) == nproc && nproc == 1) + { + ae = element_forw (a->head); + free (element_value (ae)); + ae->value = itos (ps[0]); + } + else if (array_num_elements (a) <= nproc) + { + /* modify in array_num_elements members in place, then add */ + ae = a->head; + for (i = 0; i < array_num_elements (a); i++) + { + ae = element_forw (ae); + free (element_value (ae)); + ae->value = itos (ps[i]); + } + /* add any more */ + for ( ; i < nproc; i++) + { + t = inttostr (ps[i], tbuf, sizeof (tbuf)); + array_insert (a, i, t); + } + } + else + { + /* deleting elements. it's faster to rebuild the array. */ + array_flush (a); + for (i = 0; ps[i] != -1; i++) + { + t = inttostr (ps[i], tbuf, sizeof (tbuf)); + array_insert (a, i, t); + } + } +} + +ARRAY * +save_pipestatus_array () +{ + SHELL_VAR *v; + ARRAY *a, *a2; + + v = find_variable ("PIPESTATUS"); + if (v == 0 || array_p (v) == 0 || array_cell (v) == 0) + return ((ARRAY *)NULL); + + a = array_cell (v); + a2 = array_copy (array_cell (v)); + + return a2; +} + +void +restore_pipestatus_array (a) + ARRAY *a; +{ + SHELL_VAR *v; + ARRAY *a2; + + v = find_variable ("PIPESTATUS"); + /* XXX - should we still assign even if existing value is NULL? */ + if (v == 0 || array_p (v) == 0 || array_cell (v) == 0) + return; + + a2 = array_cell (v); + var_setarray (v, a); + + array_dispose (a2); +} +#endif + +void +set_pipestatus_from_exit (s) + int s; +{ +#if defined (ARRAY_VARS) + static int v[2] = { 0, -1 }; + + v[0] = s; + set_pipestatus_array (v, 1); +#endif +} + +void +sv_xtracefd (name) + char *name; +{ + SHELL_VAR *v; + char *t, *e; + int fd; + FILE *fp; + + v = find_variable (name); + if (v == 0) + { + xtrace_reset (); + return; + } + + t = value_cell (v); + if (t == 0 || *t == 0) + xtrace_reset (); + else + { + fd = (int)strtol (t, &e, 10); + if (e != t && *e == '\0' && sh_validfd (fd)) + { + fp = fdopen (fd, "w"); + if (fp == 0) + internal_error (_("%s: %s: cannot open as FILE"), name, value_cell (v)); + else + xtrace_set (fd, fp); + } + else + internal_error (_("%s: %s: invalid value for trace file descriptor"), name, value_cell (v)); + } +} + +#define MIN_COMPAT_LEVEL 31 + +void +sv_shcompat (name) + char *name; +{ + SHELL_VAR *v; + char *val; + int tens, ones, compatval; + + v = find_variable (name); + if (v == 0) + { + shell_compatibility_level = DEFAULT_COMPAT_LEVEL; + set_compatibility_opts (); + return; + } + val = value_cell (v); + if (val == 0 || *val == '\0') + { + shell_compatibility_level = DEFAULT_COMPAT_LEVEL; + set_compatibility_opts (); + return; + } + /* Handle decimal-like compatibility version specifications: 4.2 */ + if (isdigit (val[0]) && val[1] == '.' && isdigit (val[2]) && val[3] == 0) + { + tens = val[0] - '0'; + ones = val[2] - '0'; + compatval = tens*10 + ones; + } + /* Handle integer-like compatibility version specifications: 42 */ + else if (isdigit (val[0]) && isdigit (val[1]) && val[2] == 0) + { + tens = val[0] - '0'; + ones = val[1] - '0'; + compatval = tens*10 + ones; + } + else + { +compat_error: + internal_error (_("%s: %s: compatibility value out of range"), name, val); + shell_compatibility_level = DEFAULT_COMPAT_LEVEL; + set_compatibility_opts (); + return; + } + + if (compatval < MIN_COMPAT_LEVEL || compatval > DEFAULT_COMPAT_LEVEL) + goto compat_error; + + shell_compatibility_level = compatval; + set_compatibility_opts (); +} + +#if defined (JOB_CONTROL) +void +sv_childmax (name) + char *name; +{ + char *tt; + int s; + + tt = get_string_value (name); + s = (tt && *tt) ? atoi (tt) : 0; + set_maxchild (s); +} +#endif diff --git a/.pc/bashbug-editor.diff/support/bashbug.sh b/.pc/bashbug-editor.diff/support/bashbug.sh new file mode 100644 index 0000000..7b36d40 --- /dev/null +++ b/.pc/bashbug-editor.diff/support/bashbug.sh @@ -0,0 +1,271 @@ +#!/bin/sh - +# +# bashbug - create a bug report and mail it to the bug address +# +# The bug address depends on the release status of the shell. Versions +# with status `devel', `alpha', `beta', or `rc' mail bug reports to +# chet@cwru.edu and, optionally, to bash-testers@cwru.edu. +# Other versions send mail to bug-bash@gnu.org. +# +# Copyright (C) 1996-2004 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# +# configuration section: +# these variables are filled in by the make target in Makefile +# +MACHINE="!MACHINE!" +OS="!OS!" +CC="!CC!" +CFLAGS="!CFLAGS!" +RELEASE="!RELEASE!" +PATCHLEVEL="!PATCHLEVEL!" +RELSTATUS="!RELSTATUS!" +MACHTYPE="!MACHTYPE!" + +PATH=/bin:/usr/bin:/usr/local/bin:$PATH +export PATH + +# Check if TMPDIR is set, default to /tmp +: ${TMPDIR:=/tmp} + +#Securely create a temporary directory for the temporary files +TEMPDIR=$TMPDIR/bbug.$$ +(umask 077 && mkdir $TEMPDIR) || { + echo "$0: could not create temporary directory" >&2 + exit 1 +} + +TEMPFILE1=$TEMPDIR/bbug1 +TEMPFILE2=$TEMPDIR/bbug2 + +USAGE="Usage: $0 [--help] [--version] [bug-report-email-address]" +VERSTR="GNU bashbug, version ${RELEASE}.${PATCHLEVEL}-${RELSTATUS}" + +do_help= do_version= + +while [ $# -gt 0 ]; do + case "$1" in + --help) shift ; do_help=y ;; + --version) shift ; do_version=y ;; + --) shift ; break ;; + -*) echo "bashbug: ${1}: invalid option" >&2 + echo "$USAGE" >& 2 + exit 2 ;; + *) break ;; + esac +done + +if [ -n "$do_version" ]; then + echo "${VERSTR}" + exit 0 +fi + +if [ -n "$do_help" ]; then + echo "${VERSTR}" + echo "${USAGE}" + echo + cat << HERE_EOF +Bashbug is used to send mail to the Bash maintainers +for when Bash doesn't behave like you'd like, or expect. + +Bashbug will start up your editor (as defined by the shell's +EDITOR environment variable) with a preformatted bug report +template for you to fill in. The report will be mailed to the +bug-bash mailing list by default. See the manual for details. + +If you invoke bashbug by accident, just quit your editor without +saving any changes to the template, and no bug report will be sent. +HERE_EOF + exit 0 +fi + +# Figure out how to echo a string without a trailing newline +N=`echo 'hi there\c'` +case "$N" in +*c) n=-n c= ;; +*) n= c='\c' ;; +esac + +BASHTESTERS="bash-testers@cwru.edu" + +case "$RELSTATUS" in +alpha*|beta*|devel*|rc*) BUGBASH=chet@cwru.edu ;; +*) BUGBASH=bug-bash@gnu.org ;; +esac + +case "$RELSTATUS" in +alpha*|beta*|devel*|rc*) + echo "$0: This is a testing release. Would you like your bug report" + echo "$0: to be sent to the bash-testers mailing list?" + echo $n "$0: Send to bash-testers? $c" + read ans + case "$ans" in + y*|Y*) BUGBASH="${BUGBASH},${BASHTESTERS}" ;; + esac ;; +esac + +BUGADDR="${1-$BUGBASH}" + +if [ -z "$DEFEDITOR" ] && [ -z "$EDITOR" ]; then + if [ -x /usr/bin/editor ]; then + DEFEDITOR=editor + elif [ -x /usr/local/bin/ce ]; then + DEFEDITOR=ce + elif [ -x /usr/local/bin/emacs ]; then + DEFEDITOR=emacs + elif [ -x /usr/contrib/bin/emacs ]; then + DEFEDITOR=emacs + elif [ -x /usr/bin/emacs ]; then + DEFEDITOR=emacs + elif [ -x /usr/bin/xemacs ]; then + DEFEDITOR=xemacs + elif [ -x /usr/contrib/bin/jove ]; then + DEFEDITOR=jove + elif [ -x /usr/local/bin/jove ]; then + DEFEDITOR=jove + elif [ -x /usr/bin/vi ]; then + DEFEDITOR=vi + else + echo "$0: No default editor found: attempting to use vi" >&2 + DEFEDITOR=vi + fi +fi + + +: ${EDITOR=$DEFEDITOR} + +: ${USER=${LOGNAME-`whoami`}} + +trap 'rm -rf "$TEMPDIR"; exit 1' 1 2 3 13 15 +trap 'rm -rf "$TEMPDIR"' 0 + +UN= +if (uname) >/dev/null 2>&1; then + UN=`uname -a` +fi + +if [ -f /usr/lib/sendmail ] ; then + RMAIL="/usr/lib/sendmail" + SMARGS="-i -t" +elif [ -f /usr/sbin/sendmail ] ; then + RMAIL="/usr/sbin/sendmail" + SMARGS="-i -t" +else + RMAIL=rmail + SMARGS="$BUGADDR" +fi + +INITIAL_SUBJECT='[50 character or so descriptive subject here (for reference)]' + +cat > "$TEMPFILE1" <> $HOME/dead.bashbug + echo "$0: mail failed: report saved in $HOME/dead.bashbug" >&2 +} + +exit 0 diff --git a/.pc/bzero.diff/lib/sh/oslib.c b/.pc/bzero.diff/lib/sh/oslib.c new file mode 100644 index 0000000..65eb99d --- /dev/null +++ b/.pc/bzero.diff/lib/sh/oslib.c @@ -0,0 +1,301 @@ +/* oslib.c - functions present only in some unix versions. */ + +/* Copyright (C) 1995,2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include +#if defined (HAVE_SYS_PARAM_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (HAVE_LIMITS_H) +# include +#endif + +#include +#include +#include + +#if !defined (HAVE_KILLPG) +# include +#endif + +#include +#include +#include + +#include + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +/* Make the functions strchr and strrchr if they do not exist. */ +#if !defined (HAVE_STRCHR) +char * +strchr (string, c) + char *string; + int c; +{ + register char *s; + + for (s = string; s && *s; s++) + if (*s == c) + return (s); + + return ((char *) NULL); +} + +char * +strrchr (string, c) + char *string; + int c; +{ + register char *s, *t; + + for (s = string, t = (char *)NULL; s && *s; s++) + if (*s == c) + t = s; + return (t); +} +#endif /* !HAVE_STRCHR */ + +#if !defined (HAVE_DUP2) || defined (DUP2_BROKEN) +/* Replacement for dup2 (), for those systems which either don't have it, + or supply one with broken behaviour. */ +int +dup2 (fd1, fd2) + int fd1, fd2; +{ + int saved_errno, r; + + /* If FD1 is not a valid file descriptor, then return immediately with + an error. */ + if (fcntl (fd1, F_GETFL, 0) == -1) + return (-1); + + if (fd2 < 0 || fd2 >= getdtablesize ()) + { + errno = EBADF; + return (-1); + } + + if (fd1 == fd2) + return (0); + + saved_errno = errno; + + (void) close (fd2); + r = fcntl (fd1, F_DUPFD, fd2); + + if (r >= 0) + errno = saved_errno; + else + if (errno == EINVAL) + errno = EBADF; + + /* Force the new file descriptor to remain open across exec () calls. */ + SET_OPEN_ON_EXEC (fd2); + return (r); +} +#endif /* !HAVE_DUP2 */ + +/* + * Return the total number of available file descriptors. + * + * On some systems, like 4.2BSD and its descendants, there is a system call + * that returns the size of the descriptor table: getdtablesize(). There are + * lots of ways to emulate this on non-BSD systems. + * + * On System V.3, this can be obtained via a call to ulimit: + * return (ulimit(4, 0L)); + * + * On other System V systems, NOFILE is defined in /usr/include/sys/param.h + * (this is what we assume below), so we can simply use it: + * return (NOFILE); + * + * On POSIX systems, there are specific functions for retrieving various + * configuration parameters: + * return (sysconf(_SC_OPEN_MAX)); + * + */ + +#if !defined (HAVE_GETDTABLESIZE) +int +getdtablesize () +{ +# if defined (_POSIX_VERSION) && defined (HAVE_SYSCONF) && defined (_SC_OPEN_MAX) + return (sysconf(_SC_OPEN_MAX)); /* Posix systems use sysconf */ +# else /* ! (_POSIX_VERSION && HAVE_SYSCONF && _SC_OPEN_MAX) */ +# if defined (ULIMIT_MAXFDS) + return (ulimit (4, 0L)); /* System V.3 systems use ulimit(4, 0L) */ +# else /* !ULIMIT_MAXFDS */ +# if defined (NOFILE) /* Other systems use NOFILE */ + return (NOFILE); +# else /* !NOFILE */ + return (20); /* XXX - traditional value is 20 */ +# endif /* !NOFILE */ +# endif /* !ULIMIT_MAXFDS */ +# endif /* ! (_POSIX_VERSION && _SC_OPEN_MAX) */ +} +#endif /* !HAVE_GETDTABLESIZE */ + +#if !defined (HAVE_BCOPY) +# if defined (bcopy) +# undef bcopy +# endif +void +bcopy (s,d,n) + char *d, *s; + int n; +{ + FASTCOPY (s, d, n); +} +#endif /* !HAVE_BCOPY */ + +#if !defined (HAVE_BZERO) +# if defined (bzero) +# undef bzero +# endif +void +bzero (s, n) + char *s; + int n; +{ + register int i; + register char *r; + + for (i = 0, r = s; i < n; i++) + *r++ = '\0'; +} +#endif + +#if !defined (HAVE_GETHOSTNAME) +# if defined (HAVE_UNAME) +# include +int +gethostname (name, namelen) + char *name; + int namelen; +{ + int i; + struct utsname ut; + + --namelen; + + uname (&ut); + i = strlen (ut.nodename) + 1; + strncpy (name, ut.nodename, i < namelen ? i : namelen); + name[namelen] = '\0'; + return (0); +} +# else /* !HAVE_UNAME */ +int +gethostname (name, namelen) + char *name; + int namelen; +{ + strncpy (name, "unknown", namelen); + name[namelen] = '\0'; + return 0; +} +# endif /* !HAVE_UNAME */ +#endif /* !HAVE_GETHOSTNAME */ + +#if !defined (HAVE_KILLPG) +int +killpg (pgrp, sig) + pid_t pgrp; + int sig; +{ + return (kill (-pgrp, sig)); +} +#endif /* !HAVE_KILLPG */ + +#if !defined (HAVE_MKFIFO) && defined (PROCESS_SUBSTITUTION) +int +mkfifo (path, mode) + char *path; + int mode; +{ +#if defined (S_IFIFO) + return (mknod (path, (mode | S_IFIFO), 0)); +#else /* !S_IFIFO */ + return (-1); +#endif /* !S_IFIFO */ +} +#endif /* !HAVE_MKFIFO && PROCESS_SUBSTITUTION */ + +#define DEFAULT_MAXGROUPS 64 + +int +getmaxgroups () +{ + static int maxgroups = -1; + + if (maxgroups > 0) + return maxgroups; + +#if defined (HAVE_SYSCONF) && defined (_SC_NGROUPS_MAX) + maxgroups = sysconf (_SC_NGROUPS_MAX); +#else +# if defined (NGROUPS_MAX) + maxgroups = NGROUPS_MAX; +# else /* !NGROUPS_MAX */ +# if defined (NGROUPS) + maxgroups = NGROUPS; +# else /* !NGROUPS */ + maxgroups = DEFAULT_MAXGROUPS; +# endif /* !NGROUPS */ +# endif /* !NGROUPS_MAX */ +#endif /* !HAVE_SYSCONF || !SC_NGROUPS_MAX */ + + if (maxgroups <= 0) + maxgroups = DEFAULT_MAXGROUPS; + + return maxgroups; +} + +long +getmaxchild () +{ + static long maxchild = -1L; + + if (maxchild > 0) + return maxchild; + +#if defined (HAVE_SYSCONF) && defined (_SC_CHILD_MAX) + maxchild = sysconf (_SC_CHILD_MAX); +#else +# if defined (CHILD_MAX) + maxchild = CHILD_MAX; +# else +# if defined (MAXUPRC) + maxchild = MAXUPRC; +# endif /* MAXUPRC */ +# endif /* CHILD_MAX */ +#endif /* !HAVE_SYSCONF || !_SC_CHILD_MAX */ + + return (maxchild); +} diff --git a/.pc/deb-bash-config.diff/config-bot.h b/.pc/deb-bash-config.diff/config-bot.h new file mode 100644 index 0000000..334581a --- /dev/null +++ b/.pc/deb-bash-config.diff/config-bot.h @@ -0,0 +1,199 @@ +/* config-bot.h */ +/* modify settings or make new ones based on what autoconf tells us. */ + +/* Copyright (C) 1989-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/*********************************************************/ +/* Modify or set defines based on the configure results. */ +/*********************************************************/ + +#if !defined (HAVE_VPRINTF) && defined (HAVE_DOPRNT) +# define USE_VFPRINTF_EMULATION +# define HAVE_VPRINTF +#endif + +#if defined (HAVE_SYS_RESOURCE_H) && defined (HAVE_GETRLIMIT) +# define HAVE_RESOURCE +#endif + +#if !defined (GETPGRP_VOID) +# define HAVE_BSD_PGRP +#endif + +/* Try this without testing __STDC__ for the time being. */ +#if defined (HAVE_STDARG_H) +# define PREFER_STDARG +# define USE_VARARGS +#else +# if defined (HAVE_VARARGS_H) +# define PREFER_VARARGS +# define USE_VARARGS +# endif +#endif + +#if defined (HAVE_SYS_SOCKET_H) && defined (HAVE_GETPEERNAME) && defined (HAVE_NETINET_IN_H) +# define HAVE_NETWORK +#endif + +#if defined (HAVE_REGEX_H) && defined (HAVE_REGCOMP) && defined (HAVE_REGEXEC) +# define HAVE_POSIX_REGEXP +#endif + +/* backwards compatibility between different autoconf versions */ +#if HAVE_DECL_SYS_SIGLIST && !defined (SYS_SIGLIST_DECLARED) +# define SYS_SIGLIST_DECLARED +#endif + +/***********************************************************************/ +/* Unset defines based on what configure reports as missing or broken. */ +/***********************************************************************/ + +/* Ultrix botches type-ahead when switching from canonical to + non-canonical mode, at least through version 4.3 */ +#if !defined (HAVE_TERMIOS_H) || !defined (HAVE_TCGETATTR) || defined (ultrix) +# define TERMIOS_MISSING +#endif + +/* If we have a getcwd(3), but one that does not dynamically allocate memory, + #undef HAVE_GETCWD so the replacement in getcwd.c will be built. We do + not do this on Solaris, because their implementation of loopback mounts + breaks the traditional file system assumptions that getcwd uses. */ +#if defined (HAVE_GETCWD) && defined (GETCWD_BROKEN) && !defined (SOLARIS) +# undef HAVE_GETCWD +#endif + +#if !defined (HAVE_DEV_FD) && defined (NAMED_PIPES_MISSING) +# undef PROCESS_SUBSTITUTION +#endif + +#if defined (JOB_CONTROL_MISSING) +# undef JOB_CONTROL +#endif + +#if defined (STRCOLL_BROKEN) +# undef HAVE_STRCOLL +#endif + +#if !defined (HAVE_POSIX_REGEXP) +# undef COND_REGEXP +#endif + +/* If the shell is called by this name, it will become restricted. */ +#if defined (RESTRICTED_SHELL) +# define RESTRICTED_SHELL_NAME "rbash" +#endif + +/***********************************************************/ +/* Make sure feature defines have necessary prerequisites. */ +/***********************************************************/ + +/* BANG_HISTORY requires HISTORY. */ +#if defined (BANG_HISTORY) && !defined (HISTORY) +# define HISTORY +#endif /* BANG_HISTORY && !HISTORY */ + +#if defined (READLINE) && !defined (HISTORY) +# define HISTORY +#endif + +#if defined (PROGRAMMABLE_COMPLETION) && !defined (READLINE) +# undef PROGRAMMABLE_COMPLETION +#endif + +#if !defined (V9_ECHO) +# undef DEFAULT_ECHO_TO_XPG +#endif + +#if !defined (PROMPT_STRING_DECODE) +# undef PPROMPT +# define PPROMPT "$ " +#endif + +#if !defined (HAVE_SYSLOG) || !defined (HAVE_SYSLOG_H) +# undef SYSLOG_HISTORY +#endif + +/************************************************/ +/* check multibyte capability for I18N code */ +/************************************************/ + +/* For platforms which support the ISO C amendement 1 functionality we + support user defined character classes. */ +/* Solaris 2.5 has a bug: must be included before . */ +#if defined (HAVE_WCTYPE_H) && defined (HAVE_WCHAR_H) && defined (HAVE_LOCALE_H) +# include +# include +# if defined (HAVE_ISWCTYPE) && \ + defined (HAVE_ISWLOWER) && \ + defined (HAVE_ISWUPPER) && \ + defined (HAVE_MBSRTOWCS) && \ + defined (HAVE_MBRTOWC) && \ + defined (HAVE_MBRLEN) && \ + defined (HAVE_TOWLOWER) && \ + defined (HAVE_TOWUPPER) && \ + defined (HAVE_WCHAR_T) && \ + defined (HAVE_WCTYPE_T) && \ + defined (HAVE_WINT_T) && \ + defined (HAVE_WCWIDTH) && \ + defined (HAVE_WCTYPE) + /* system is supposed to support XPG5 */ +# define HANDLE_MULTIBYTE 1 +# endif +#endif + +/* If we don't want multibyte chars even on a system that supports them, let + the configuring user turn multibyte support off. */ +#if defined (NO_MULTIBYTE_SUPPORT) +# undef HANDLE_MULTIBYTE +#endif + +/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */ +#if HANDLE_MULTIBYTE && !defined (HAVE_MBSTATE_T) +# define wcsrtombs(dest, src, len, ps) (wcsrtombs) (dest, src, len, 0) +# define mbsrtowcs(dest, src, len, ps) (mbsrtowcs) (dest, src, len, 0) +# define wcrtomb(s, wc, ps) (wcrtomb) (s, wc, 0) +# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) +# define mbrlen(s, n, ps) (mbrlen) (s, n, 0) +# define mbstate_t int +#endif + +/* Make sure MB_LEN_MAX is at least 16 (some systems define + MB_LEN_MAX as 1) */ +#ifdef HANDLE_MULTIBYTE +# include +# if defined(MB_LEN_MAX) && (MB_LEN_MAX < 16) +# undef MB_LEN_MAX +# endif +# if !defined (MB_LEN_MAX) +# define MB_LEN_MAX 16 +# endif +#endif + +/************************************************/ +/* end of multibyte capability checks for I18N */ +/************************************************/ + +/******************************************************************/ +/* Placeholder for builders to #undef any unwanted features from */ +/* config-top.h or created by configure (such as the default mail */ +/* file for mail checking). */ +/******************************************************************/ + +/* If you don't want bash to provide a default mail file to check. */ +/* #undef DEFAULT_MAIL_DIRECTORY */ diff --git a/.pc/deb-bash-config.diff/config-top.h b/.pc/deb-bash-config.diff/config-top.h new file mode 100644 index 0000000..4f6373c --- /dev/null +++ b/.pc/deb-bash-config.diff/config-top.h @@ -0,0 +1,134 @@ +/* config-top.h - various user-settable options not under the control of autoconf. */ + +/* Copyright (C) 2002-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Define CONTINUE_AFTER_KILL_ERROR if you want the kill command to + continue processing arguments after one of them fails. This is + what POSIX.2 specifies. */ +#define CONTINUE_AFTER_KILL_ERROR + +/* Define BREAK_COMPLAINS if you want the non-standard, but useful + error messages about `break' and `continue' out of context. */ +#define BREAK_COMPLAINS + +/* Define BUFFERED_INPUT if you want the shell to do its own input + buffering, rather than using stdio. Do not undefine this; it's + required to preserve semantics required by POSIX. */ +#define BUFFERED_INPUT + +/* Define ONESHOT if you want sh -c 'command' to avoid forking to execute + `command' whenever possible. This is a big efficiency improvement. */ +#define ONESHOT + +/* Define V9_ECHO if you want to give the echo builtin backslash-escape + interpretation using the -e option, in the style of the Bell Labs 9th + Edition version of echo. You cannot emulate the System V echo behavior + without this option. */ +#define V9_ECHO + +/* Define DONT_REPORT_SIGPIPE if you don't want to see `Broken pipe' messages + when a job like `cat jobs.c | exit 1' terminates due to a SIGPIPE. */ +#define DONT_REPORT_SIGPIPE + +/* Define DONT_REPORT_SIGTERM if you don't want to see `Terminates' message + when a job exits due to SIGTERM, since that's the default signal sent + by the kill builtin. */ +/* #define DONT_REPORT_SIGTERM */ + +/* Define DONT_REPORT_BROKEN_PIPE_WRITE_ERRORS if you don't want builtins + like `echo' and `printf' to report errors when output does not succeed + due to EPIPE. */ +/* #define DONT_REPORT_BROKEN_PIPE_WRITE_ERRORS */ + +/* The default value of the PATH variable. */ +#ifndef DEFAULT_PATH_VALUE +#define DEFAULT_PATH_VALUE \ + "/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:." +#endif + +/* The value for PATH when invoking `command -p'. This is only used when + the Posix.2 confstr () function, or CS_PATH define are not present. */ +#ifndef STANDARD_UTILS_PATH +#define STANDARD_UTILS_PATH \ + "/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc" +#endif + +/* Default primary and secondary prompt strings. */ +#define PPROMPT "\\s-\\v\\$ " +#define SPROMPT "> " + +/* Undefine this if you don't want the ksh-compatible behavior of reprinting + the select menu after a valid choice is made only if REPLY is set to NULL + in the body of the select command. The menu is always reprinted if the + reply to the select query is an empty line. */ +#define KSH_COMPATIBLE_SELECT + +/* System-wide .bashrc file for interactive shells. */ +/* #define SYS_BASHRC "/etc/bash.bashrc" */ + +/* System-wide .bash_logout for login shells. */ +/* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */ + +/* Define this to make non-interactive shells begun with argv[0][0] == '-' + run the startup files when not in posix mode. */ +/* #define NON_INTERACTIVE_LOGIN_SHELLS */ + +/* Define this if you want bash to try to check whether it's being run by + sshd and source the .bashrc if so (like the rshd behavior). This checks + for the presence of SSH_CLIENT or SSH2_CLIENT in the initial environment, + which can be fooled under certain not-uncommon circumstances. */ +/* #define SSH_SOURCE_BASHRC */ + +/* Define if you want the case-capitalizing operators (~[~]) and the + `capcase' variable attribute (declare -c). */ +#define CASEMOD_CAPCASE + +/* This is used as the name of a shell function to call when a command + name is not found. If you want to name it something other than the + default ("command_not_found_handle"), change it here. */ +/* #define NOTFOUND_HOOK "command_not_found_handle" */ + +/* Define if you want each line saved to the history list in bashhist.c: + bash_add_history() to be sent to syslog(). */ +/* #define SYSLOG_HISTORY */ +#if defined (SYSLOG_HISTORY) +# define SYSLOG_FACILITY LOG_USER +# define SYSLOG_LEVEL LOG_INFO +#endif + +/* Define if you want to include code in shell.c to support wordexp(3) */ +/* #define WORDEXP_OPTION */ + +/* Define as 1 if you want to enable code that implements multiple coprocs */ +#ifndef MULTIPLE_COPROCS +# define MULTIPLE_COPROCS 0 +#endif + +/* Define to 0 if you want the checkwinsize option off by default, 1 if you + want it on. */ +#define CHECKWINSIZE_DEFAULT 0 + +/* Define to 1 if you want to optimize for sequential array assignment when + using indexed arrays, 0 if you want bash-4.2 behavior, which favors + random access but is O(N) for each array assignment. */ +#define OPTIMIZE_SEQUENTIAL_ARRAY_ASSIGNMENT 1 + +/* Define to 1 if you want to be able to export indexed arrays to processes + using the foo=([0]=one [1]=two) and so on */ +/* #define ARRAY_EXPORT 1 */ diff --git a/.pc/deb-examples.diff/examples/loadables/README b/.pc/deb-examples.diff/examples/loadables/README new file mode 100644 index 0000000..d29b43a --- /dev/null +++ b/.pc/deb-examples.diff/examples/loadables/README @@ -0,0 +1,66 @@ +Some examples of ready-to-dynamic-load builtins. Most of the +examples given are reimplementations of standard commands whose +execution time is dominated by process startup time. The +exceptions are sleep, which allows you to sleep for fractions +of a second, finfo, which provides access to the rest of the +elements of the `stat' structure that `test' doesn't let you +see, and pushd/popd/dirs, which allows you to compile them out +of the shell. + +All of the new builtins in ksh93 that bash didn't already have +are included here, as is the ksh `print' builtin. + +The configure script in the top-level source directory uses the +support/shobj-conf script to set the right values in the Makefile, +so you should not need to change the Makefile. If your system +is not supported by support/shobj-conf, and it has the necessary +facilities for building shared objects and support for the +dlopen/dlsyn/dlclose/dlerror family of functions, please make +the necessary changes to support/shobj-conf and send the changes +to bash-maintainers@gnu.org. + +Loadable builtins are loaded into a running shell with + + enable -f filename builtin-name + +enable uses a simple reference-counting scheme to avoid unloading a +shared object that implements more than one loadable builtin before +all loadable builtins implemented in the object are removed. + +Many of the details needed by builtin writers are found in hello.c, +the canonical example. There is no real `builtin writers' programming +guide'. The file template.c provides a template to use for creating +new loadable builtins. + +basename.c Return non-directory portion of pathname. +cat.c cat(1) replacement with no options - the way cat was intended. +cut.c cut(1) replacement. +dirname.c Return directory portion of pathname. +finfo.c Print file info. +getconf.c POSIX.2 getconf utility. +getconf.h Replacement definitions for ones the system doesn't provide. +head.c Copy first part of files. +hello.c Obligatory "Hello World" / sample loadable. +id.c POSIX.2 user identity. +ln.c Make links. +logname.c Print login name of current user. +Makefile.in Simple makefile for the sample loadable builtins. +mkdir.c Make directories. +necho.c echo without options or argument interpretation. +pathchk.c Check pathnames for validity and portability. +print.c Loadable ksh-93 style print builtin. +printenv.c Minimal builtin clone of BSD printenv(1). +push.c Anyone remember TOPS-20? +README README +realpath.c Canonicalize pathnames, resolving symlinks. +rmdir.c Remove directory. +sleep.c sleep for fractions of a second. +strftime.c Loadable builtin interface to strftime(3). +sync.c Sync the disks by forcing pending filesystem writes to complete. +tee.c Duplicate standard input. +template.c Example template for loadable builtin. +truefalse.c True and false builtins. +tty.c Return terminal name. +uname.c Print system information. +unlink.c Remove a directory entry. +whoami.c Print out username of current user. diff --git a/.pc/exec-redirections-doc.diff/doc/bash.1 b/.pc/exec-redirections-doc.diff/doc/bash.1 new file mode 100644 index 0000000..4113ae6 --- /dev/null +++ b/.pc/exec-redirections-doc.diff/doc/bash.1 @@ -0,0 +1,10357 @@ +.\" +.\" MAN PAGE COMMENTS to +.\" +.\" Chet Ramey +.\" Case Western Reserve University +.\" chet.ramey@case.edu +.\" +.\" Last Change: Sun Feb 2 16:21:40 EST 2014 +.\" +.\" bash_builtins, strip all but Built-Ins section +.if \n(zZ=1 .ig zZ +.if \n(zY=1 .ig zY +.TH BASH 1 "2014 February 2" "GNU Bash 4.3" +.\" +.\" There's some problem with having a `@' +.\" in a tagged paragraph with the BSD man macros. +.\" It has to do with `@' appearing in the }1 macro. +.\" This is a problem on 4.3 BSD and Ultrix, but Sun +.\" appears to have fixed it. +.\" If you're seeing the characters +.\" `@u-3p' appearing before the lines reading +.\" `possible-hostname-completions +.\" and `complete-hostname' down in READLINE, +.\" then uncomment this redefinition. +.\" +.de }1 +.ds ]X \&\\*(]B\\ +.nr )E 0 +.if !"\\$1"" .nr )I \\$1n +.}f +.ll \\n(LLu +.in \\n()Ru+\\n(INu+\\n()Iu +.ti \\n(INu +.ie !\\n()Iu+\\n()Ru-\w\\*(]Xu-3p \{\\*(]X +.br\} +.el \\*(]X\h|\\n()Iu+\\n()Ru\c +.}f +.. +.\" +.\" File Name macro. This used to be `.PN', for Path Name, +.\" but Sun doesn't seem to like that very much. +.\" +.de FN +\fI\|\\$1\|\fP +.. +.SH NAME +bash \- GNU Bourne-Again SHell +.SH SYNOPSIS +.B bash +[options] +[command_string | file] +.SH COPYRIGHT +.if n Bash is Copyright (C) 1989-2013 by the Free Software Foundation, Inc. +.if t Bash is Copyright \(co 1989-2013 by the Free Software Foundation, Inc. +.SH DESCRIPTION +.B Bash +is an \fBsh\fR-compatible command language interpreter that +executes commands read from the standard input or from a file. +.B Bash +also incorporates useful features from the \fIKorn\fP and \fIC\fP +shells (\fBksh\fP and \fBcsh\fP). +.PP +.B Bash +is intended to be a conformant implementation of the +Shell and Utilities portion of the IEEE POSIX specification +(IEEE Standard 1003.1). +.B Bash +can be configured to be POSIX-conformant by default. +.SH OPTIONS +All of the single-character shell options documented in the +description of the \fBset\fR builtin command can be used as options +when the shell is invoked. +In addition, \fBbash\fR +interprets the following options when it is invoked: +.PP +.PD 0 +.TP 10 +.B \-c +If the +.B \-c +option is present, then commands are read from the first non-option argument +.IR command_string . +If there are arguments after the +.IR command_string , +they are assigned to the positional parameters, starting with +.BR $0 . +.TP +.B \-i +If the +.B \-i +option is present, the shell is +.IR interactive . +.TP +.B \-l +Make +.B bash +act as if it had been invoked as a login shell (see +.SM +.B INVOCATION +below). +.TP +.B \-r +If the +.B \-r +option is present, the shell becomes +.I restricted +(see +.SM +.B "RESTRICTED SHELL" +below). +.TP +.B \-s +If the +.B \-s +option is present, or if no arguments remain after option +processing, then commands are read from the standard input. +This option allows the positional parameters to be set +when invoking an interactive shell. +.TP +.B \-D +A list of all double-quoted strings preceded by \fB$\fP +is printed on the standard output. +These are the strings that +are subject to language translation when the current locale +is not \fBC\fP or \fBPOSIX\fP. +This implies the \fB\-n\fP option; no commands will be executed. +.TP +.B [\-+]O [\fIshopt_option\fP] +\fIshopt_option\fP is one of the shell options accepted by the +\fBshopt\fP builtin (see +.SM +.B SHELL BUILTIN COMMANDS +below). +If \fIshopt_option\fP is present, \fB\-O\fP sets the value of that option; +\fB+O\fP unsets it. +If \fIshopt_option\fP is not supplied, the names and values of the shell +options accepted by \fBshopt\fP are printed on the standard output. +If the invocation option is \fB+O\fP, the output is displayed in a format +that may be reused as input. +.TP +.B \-\- +A +.B \-\- +signals the end of options and disables further option processing. +Any arguments after the +.B \-\- +are treated as filenames and arguments. An argument of +.B \- +is equivalent to \fB\-\-\fP. +.PD +.PP +.B Bash +also interprets a number of multi-character options. +These options must appear on the command line before the +single-character options to be recognized. +.PP +.PD 0 +.TP +.B \-\-debugger +Arrange for the debugger profile to be executed before the shell +starts. +Turns on extended debugging mode (see the description of the +.B extdebug +option to the +.B shopt +builtin below). +.TP +.B \-\-dump\-po\-strings +Equivalent to \fB\-D\fP, but the output is in the GNU \fIgettext\fP +\fBpo\fP (portable object) file format. +.TP +.B \-\-dump\-strings +Equivalent to \fB\-D\fP. +.TP +.B \-\-help +Display a usage message on standard output and exit successfully. +.TP +\fB\-\-init\-file\fP \fIfile\fP +.PD 0 +.TP +\fB\-\-rcfile\fP \fIfile\fP +.PD +Execute commands from +.I file +instead of the system wide initialization file +.I /etc/bash.bashrc +and the standard personal initialization file +.I ~/.bashrc +if the shell is interactive (see +.SM +.B INVOCATION +below). +.TP +.B \-\-login +Equivalent to \fB\-l\fP. +.TP +.B \-\-noediting +Do not use the GNU +.B readline +library to read command lines when the shell is interactive. +.TP +.B \-\-noprofile +Do not read either the system-wide startup file +.FN /etc/profile +or any of the personal initialization files +.IR ~/.bash_profile , +.IR ~/.bash_login , +or +.IR ~/.profile . +By default, +.B bash +reads these files when it is invoked as a login shell (see +.SM +.B INVOCATION +below). +.TP +.B \-\-norc +Do not read and execute the system wide initialization file +.I /etc/bash.bashrc +and the personal initialization file +.I ~/.bashrc +if the shell is interactive. +This option is on by default if the shell is invoked as +.BR sh . +.TP +.B \-\-posix +Change the behavior of \fBbash\fP where the default operation differs +from the POSIX standard to match the standard (\fIposix mode\fP). +See +.SM +.B "SEE ALSO" +below for a reference to a document that details how posix mode affects +bash's behavior. +.TP +.B \-\-restricted +The shell becomes restricted (see +.SM +.B "RESTRICTED SHELL" +below). +.TP +.B \-\-verbose +Equivalent to \fB\-v\fP. +.TP +.B \-\-version +Show version information for this instance of +.B bash +on the standard output and exit successfully. +.PD +.SH ARGUMENTS +If arguments remain after option processing, and neither the +.B \-c +nor the +.B \-s +option has been supplied, the first argument is assumed to +be the name of a file containing shell commands. +If +.B bash +is invoked in this fashion, +.B $0 +is set to the name of the file, and the positional parameters +are set to the remaining arguments. +.B Bash +reads and executes commands from this file, then exits. +\fBBash\fP's exit status is the exit status of the last command +executed in the script. +If no commands are executed, the exit status is 0. +An attempt is first made to open the file in the current directory, and, +if no file is found, then the shell searches the directories in +.SM +.B PATH +for the script. +.SH INVOCATION +A \fIlogin shell\fP is one whose first character of argument zero is a +.BR \- , +or one started with the +.B \-\-login +option. +.PP +An \fIinteractive\fP shell is one started without non-option arguments +and without the +.B \-c +option +whose standard input and error are +both connected to terminals (as determined by +.IR isatty (3)), +or one started with the +.B \-i +option. +.SM +.B PS1 +is set and +.B $\- +includes +.B i +if +.B bash +is interactive, +allowing a shell script or a startup file to test this state. +.PP +The following paragraphs describe how +.B bash +executes its startup files. +If any of the files exist but cannot be read, +.B bash +reports an error. +Tildes are expanded in filenames as described below under +.B "Tilde Expansion" +in the +.SM +.B EXPANSION +section. +.PP +When +.B bash +is invoked as an interactive login shell, or as a non-interactive shell +with the \fB\-\-login\fP option, it first reads and +executes commands from the file \fI/etc/profile\fP, if that +file exists. +After reading that file, it looks for \fI~/.bash_profile\fP, +\fI~/.bash_login\fP, and \fI~/.profile\fP, in that order, and reads +and executes commands from the first one that exists and is readable. +The +.B \-\-noprofile +option may be used when the shell is started to inhibit this behavior. +.PP +When a login shell exits, +.B bash +reads and executes commands from the file \fI~/.bash_logout\fP, if it +exists. +.PP +When an interactive shell that is not a login shell is started, +.B bash +reads and executes commands from \fI/etc/bash.bashrc\fP and \fI~/.bashrc\fP, +if these files exist. +This may be inhibited by using the +.B \-\-norc +option. +The \fB\-\-rcfile\fP \fIfile\fP option will force +.B bash +to read and execute commands from \fIfile\fP instead of +\fI/etc/bash.bashrc\fP and \fI~/.bashrc\fP. +.PP +When +.B bash +is started non-interactively, to run a shell script, for example, it +looks for the variable +.SM +.B BASH_ENV +in the environment, expands its value if it appears there, and uses the +expanded value as the name of a file to read and execute. +.B Bash +behaves as if the following command were executed: +.sp .5 +.RS +.if t \f(CWif [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi\fP +.if n if [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi +.RE +.sp .5 +but the value of the +.SM +.B PATH +variable is not used to search for the filename. +.PP +If +.B bash +is invoked with the name +.BR sh , +it tries to mimic the startup behavior of historical versions of +.B sh +as closely as possible, +while conforming to the POSIX standard as well. +When invoked as an interactive login shell, or a non-interactive +shell with the \fB\-\-login\fP option, it first attempts to +read and execute commands from +.I /etc/profile +and +.IR ~/.profile , +in that order. +The +.B \-\-noprofile +option may be used to inhibit this behavior. +When invoked as an interactive shell with the name +.BR sh , +.B bash +looks for the variable +.SM +.BR ENV , +expands its value if it is defined, and uses the +expanded value as the name of a file to read and execute. +Since a shell invoked as +.B sh +does not attempt to read and execute commands from any other startup +files, the +.B \-\-rcfile +option has no effect. +A non-interactive shell invoked with the name +.B sh +does not attempt to read any other startup files. +When invoked as +.BR sh , +.B bash +enters +.I posix +mode after the startup files are read. +.PP +When +.B bash +is started in +.I posix +mode, as with the +.B \-\-posix +command line option, it follows the POSIX standard for startup files. +In this mode, interactive shells expand the +.SM +.B ENV +variable and commands are read and executed from the file +whose name is the expanded value. +No other startup files are read. +.PP +.B Bash +attempts to determine when it is being run with its standard input +connected to a network connection, as when executed by the remote shell +daemon, usually \fIrshd\fP, or the secure shell daemon \fIsshd\fP. +If +.B bash +determines it is being run in this fashion, it reads and executes +commands from \fI~/.bashrc\fP and \fI~/.bashrc\fP, if these files +exist and are readable. +It will not do this if invoked as \fBsh\fP. +The +.B \-\-norc +option may be used to inhibit this behavior, and the +.B \-\-rcfile +option may be used to force another file to be read, but neither +\fIrshd\fP nor \fIsshd\fP generally invoke the shell with those options +or allow them to be specified. +.PP +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the \fB\-p\fP option is not supplied, no startup +files are read, shell functions are not inherited from the environment, the +.SM +.BR SHELLOPTS , +.SM +.BR BASHOPTS , +.SM +.BR CDPATH , +and +.SM +.B GLOBIGNORE +variables, if they appear in the environment, are ignored, +and the effective user id is set to the real user id. +If the \fB\-p\fP option is supplied at invocation, the startup behavior is +the same, but the effective user id is not reset. +.SH DEFINITIONS +.PP +The following definitions are used throughout the rest of this +document. +.PD 0 +.TP +.B blank +A space or tab. +.TP +.B word +A sequence of characters considered as a single unit by the shell. +Also known as a +.BR token . +.TP +.B name +A +.I word +consisting only of alphanumeric characters and underscores, and +beginning with an alphabetic character or an underscore. Also +referred to as an +.BR identifier . +.TP +.B metacharacter +A character that, when unquoted, separates words. One of the following: +.br +.RS +.PP +.if t \fB| & ; ( ) < > space tab\fP +.if n \fB| & ; ( ) < > space tab\fP +.RE +.PP +.TP +.B control operator +A \fItoken\fP that performs a control function. It is one of the following +symbols: +.RS +.PP +.if t \fB|| & && ; ;; ( ) | |& \fP +.if n \fB|| & && ; ;; ( ) | |& \fP +.RE +.PD +.SH "RESERVED WORDS" +\fIReserved words\fP are words that have a special meaning to the shell. +The following words are recognized as reserved when unquoted and either +the first word of a simple command (see +.SM +.B SHELL GRAMMAR +below) or the third word of a +.B case +or +.B for +command: +.if t .RS +.PP +.B +.if n ! case coproc do done elif else esac fi for function if in select then until while { } time [[ ]] +.if t ! case coproc do done elif else esac fi for function if in select then until while { } time [[ ]] +.if t .RE +.SH "SHELL GRAMMAR" +.SS Simple Commands +.PP +A \fIsimple command\fP is a sequence of optional variable assignments +followed by \fBblank\fP-separated words and redirections, and +terminated by a \fIcontrol operator\fP. The first word +specifies the command to be executed, and is passed as argument zero. +The remaining words are passed as arguments to the invoked command. +.PP +The return value of a \fIsimple command\fP is its exit status, or +128+\fIn\^\fP if the command is terminated by signal +.IR n . +.SS Pipelines +.PP +A \fIpipeline\fP is a sequence of one or more commands separated by +one of the control operators +.B | +or \fB|&\fP. +The format for a pipeline is: +.RS +.PP +[\fBtime\fP [\fB\-p\fP]] [ ! ] \fIcommand\fP [ [\fB|\fP\(bv\fB|&\fP] \fIcommand2\fP ... ] +.RE +.PP +The standard output of +.I command +is connected via a pipe to the standard input of +.IR command2 . +This connection is performed before any redirections specified by the +command (see +.SM +.B REDIRECTION +below). +If \fB|&\fP is used, \fIcommand\fP's standard error, in addition to its +standard output, is connected to +\fIcommand2\fP's standard input through the pipe; +it is shorthand for \fB2>&1 |\fP. +This implicit redirection of the standard error to the standard output is +performed after any redirections specified by the command. +.PP +The return status of a pipeline is the exit status of the last +command, unless the \fBpipefail\fP option is enabled. +If \fBpipefail\fP is enabled, the pipeline's return status is the +value of the last (rightmost) command to exit with a non-zero status, +or zero if all commands exit successfully. +If the reserved word +.B ! +precedes a pipeline, the exit status of that pipeline is the logical +negation of the exit status as described above. +The shell waits for all commands in the pipeline to +terminate before returning a value. +.PP +If the +.B time +reserved word precedes a pipeline, the elapsed as well as user and +system time consumed by its execution are reported when the pipeline +terminates. +The \fB\-p\fP option changes the output format to that specified by POSIX. +When the shell is in \fIposix mode\fP, it does not recognize +\fBtime\fP as a reserved word if the next token begins with a `-'. +The +.SM +.B TIMEFORMAT +variable may be set to a format string that specifies how the timing +information should be displayed; see the description of +.SM +.B TIMEFORMAT +under +.B "Shell Variables" +below. +.PP +When the shell is in \fIposix mode\fP, \fBtime\fP +may be followed by a newline. In this case, the shell displays the +total user and system time consumed by the shell and its children. +The +.SM +.B TIMEFORMAT +variable may be used to specify the format of +the time information. +.PP +Each command in a pipeline is executed as a separate process (i.e., in a +subshell). +.SS Lists +.PP +A \fIlist\fP is a sequence of one or more pipelines separated by one +of the operators +.BR ; , +.BR & , +.BR && , +or +.BR || , +and optionally terminated by one of +.BR ; , +.BR & , +or +.BR . +.PP +Of these list operators, +.B && +and +.B || +have equal precedence, followed by +.B ; +and +.BR & , +which have equal precedence. +.PP +A sequence of one or more newlines may appear in a \fIlist\fP instead +of a semicolon to delimit commands. +.PP +If a command is terminated by the control operator +.BR & , +the shell executes the command in the \fIbackground\fP +in a subshell. The shell does not wait for the command to +finish, and the return status is 0. Commands separated by a +.B ; +are executed sequentially; the shell waits for each +command to terminate in turn. The return status is the +exit status of the last command executed. +.PP +AND and OR lists are sequences of one of more pipelines separated by the +\fB&&\fP and \fB||\fP control operators, respectively. +AND and OR lists are executed with left associativity. +An AND list has the form +.RS +.PP +\fIcommand1\fP \fB&&\fP \fIcommand2\fP +.RE +.PP +.I command2 +is executed if, and only if, +.I command1 +returns an exit status of zero. +.PP +An OR list has the form +.RS +.PP +\fIcommand1\fP \fB||\fP \fIcommand2\fP +.PP +.RE +.PP +.I command2 +is executed if and only if +.I command1 +returns a non-zero exit status. +The return status of +AND and OR lists is the exit status of the last command +executed in the list. +.SS Compound Commands +.PP +A \fIcompound command\fP is one of the following. +In most cases a \fIlist\fP in a command's description may be separated from +the rest of the command by one or more newlines, and may be followed by a +newline in place of a semicolon. +.TP +(\fIlist\fP) +\fIlist\fP is executed in a subshell environment (see +.SM +\fBCOMMAND EXECUTION ENVIRONMENT\fP +below). +Variable assignments and builtin +commands that affect the shell's environment do not remain in effect +after the command completes. The return status is the exit status of +\fIlist\fP. +.TP +{ \fIlist\fP; } +\fIlist\fP is simply executed in the current shell environment. +\fIlist\fP must be terminated with a newline or semicolon. +This is known as a \fIgroup command\fP. +The return status is the exit status of +\fIlist\fP. +Note that unlike the metacharacters \fB(\fP and \fB)\fP, \fB{\fP and +\fB}\fP are \fIreserved words\fP and must occur where a reserved +word is permitted to be recognized. Since they do not cause a word +break, they must be separated from \fIlist\fP by whitespace or another +shell metacharacter. +.TP +((\fIexpression\fP)) +The \fIexpression\fP is evaluated according to the rules described +below under +.SM +.BR "ARITHMETIC EVALUATION" . +If the value of the expression is non-zero, the return status is 0; +otherwise the return status is 1. This is exactly equivalent to +\fBlet "\fIexpression\fP"\fR. +.TP +\fB[[\fP \fIexpression\fP \fB]]\fP +Return a status of 0 or 1 depending on the evaluation of +the conditional expression \fIexpression\fP. +Expressions are composed of the primaries described below under +.SM +.BR "CONDITIONAL EXPRESSIONS" . +Word splitting and pathname expansion are not performed on the words +between the \fB[[\fP and \fB]]\fP; tilde expansion, +parameter and variable expansion, +arithmetic expansion, command substitution, process +substitution, and quote removal are performed. +Conditional operators such as \fB\-f\fP must be unquoted to be recognized +as primaries. +.if t .sp 0.5 +.if n .sp 1 +When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort +lexicographically using the current locale. +.PP +See the description of the \fItest\fP builtin command (section SHELL +BUILTIN COMMANDS below) for the handling of parameters (i.e. +missing parameters). +.if t .sp 0.5 +.if n .sp 1 +When the \fB==\fP and \fB!=\fP operators are used, the string to the +right of the operator is considered a pattern and matched according +to the rules described below under \fBPattern Matching\fP, +as if the \fBextglob\fP shell option were enabled. +The \fB=\fP operator is equivalent to \fB==\fP. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +The return value is 0 if the string matches (\fB==\fP) or does not match +(\fB!=\fP) the pattern, and 1 otherwise. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +.if t .sp 0.5 +.if n .sp 1 +An additional binary operator, \fB=~\fP, is available, with the same +precedence as \fB==\fP and \fB!=\fP. +When it is used, the string to the right of the operator is considered +an extended regular expression and matched accordingly (as in \fIregex\fP(3)). +The return value is 0 if the string matches +the pattern, and 1 otherwise. +If the regular expression is syntactically incorrect, the conditional +expression's return value is 2. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +Bracket expressions in regular expressions must be treated carefully, +since normal quoting characters lose their meanings between brackets. +If the pattern is stored in a shell variable, quoting the variable +expansion forces the entire pattern to be matched as a string. +Substrings matched by parenthesized subexpressions within the regular +expression are saved in the array variable +.SM +.BR BASH_REMATCH . +The element of +.SM +.B BASH_REMATCH +with index 0 is the portion of the string +matching the entire regular expression. +The element of +.SM +.B BASH_REMATCH +with index \fIn\fP is the portion of the +string matching the \fIn\fPth parenthesized subexpression. +.if t .sp 0.5 +.if n .sp 1 +Expressions may be combined using the following operators, listed +in decreasing order of precedence: +.if t .sp 0.5 +.if n .sp 1 +.RS +.PD 0 +.TP +.B ( \fIexpression\fP ) +Returns the value of \fIexpression\fP. +This may be used to override the normal precedence of operators. +.TP +.B ! \fIexpression\fP +True if +.I expression +is false. +.TP +\fIexpression1\fP \fB&&\fP \fIexpression2\fP +True if both +.I expression1 +and +.I expression2 +are true. +.TP +\fIexpression1\fP \fB||\fP \fIexpression2\fP +True if either +.I expression1 +or +.I expression2 +is true. +.PD +.LP +The \fB&&\fP and \fB||\fP +operators do not evaluate \fIexpression2\fP if the value of +\fIexpression1\fP is sufficient to determine the return value of +the entire conditional expression. +.RE +.TP +\fBfor\fP \fIname\fP [ [ \fBin\fP [ \fIword ...\fP ] ] ; ] \fBdo\fP \fIlist\fP ; \fBdone\fP +The list of words following \fBin\fP is expanded, generating a list +of items. +The variable \fIname\fP is set to each element of this list +in turn, and \fIlist\fP is executed each time. +If the \fBin\fP \fIword\fP is omitted, the \fBfor\fP command executes +\fIlist\fP once for each positional parameter that is set (see +.SM +.B PARAMETERS +below). +The return status is the exit status of the last command that executes. +If the expansion of the items following \fBin\fP results in an empty +list, no commands are executed, and the return status is 0. +.TP +\fBfor\fP (( \fIexpr1\fP ; \fIexpr2\fP ; \fIexpr3\fP )) ; \fBdo\fP \fIlist\fP ; \fBdone\fP +First, the arithmetic expression \fIexpr1\fP is evaluated according +to the rules described below under +.SM +.BR "ARITHMETIC EVALUATION" . +The arithmetic expression \fIexpr2\fP is then evaluated repeatedly +until it evaluates to zero. +Each time \fIexpr2\fP evaluates to a non-zero value, \fIlist\fP is +executed and the arithmetic expression \fIexpr3\fP is evaluated. +If any expression is omitted, it behaves as if it evaluates to 1. +The return value is the exit status of the last command in \fIlist\fP +that is executed, or false if any of the expressions is invalid. +.TP +\fBselect\fP \fIname\fP [ \fBin\fP \fIword\fP ] ; \fBdo\fP \fIlist\fP ; \fBdone\fP +The list of words following \fBin\fP is expanded, generating a list +of items. The set of expanded words is printed on the standard +error, each preceded by a number. If the \fBin\fP +\fIword\fP is omitted, the positional parameters are printed (see +.SM +.B PARAMETERS +below). The +.SM +.B PS3 +prompt is then displayed and a line read from the standard input. +If the line consists of a number corresponding to one of +the displayed words, then the value of +.I name +is set to that word. If the line is empty, the words and prompt +are displayed again. If EOF is read, the command completes. Any +other value read causes +.I name +to be set to null. The line read is saved in the variable +.SM +.BR REPLY . +The +.I list +is executed after each selection until a +.B break +command is executed. +The exit status of +.B select +is the exit status of the last command executed in +.IR list , +or zero if no commands were executed. +.TP +\fBcase\fP \fIword\fP \fBin\fP [ [(] \fIpattern\fP [ \fB|\fP \fIpattern\fP ] \ +... ) \fIlist\fP ;; ] ... \fBesac\fP +A \fBcase\fP command first expands \fIword\fP, and tries to match +it against each \fIpattern\fP in turn, using the same matching rules +as for pathname expansion (see +.B Pathname Expansion +below). +The \fIword\fP is expanded using tilde +expansion, parameter and variable expansion, arithmetic substitution, +command substitution, process substitution and quote removal. +Each \fIpattern\fP examined is expanded using tilde +expansion, parameter and variable expansion, arithmetic substitution, +command substitution, and process substitution. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +When a match is found, the corresponding \fIlist\fP is executed. +If the \fB;;\fP operator is used, no subsequent matches are attempted after +the first pattern match. +Using \fB;&\fP in place of \fB;;\fP causes execution to continue with +the \fIlist\fP associated with the next set of patterns. +Using \fB;;&\fP in place of \fB;;\fP causes the shell to test the next +pattern list in the statement, if any, and execute any associated \fIlist\fP +on a successful match. +The exit status is zero if no +pattern matches. Otherwise, it is the exit status of the +last command executed in \fIlist\fP. +.TP +\fBif\fP \fIlist\fP; \fBthen\fP \fIlist\fP; \ +[ \fBelif\fP \fIlist\fP; \fBthen\fP \fIlist\fP; ] ... \ +[ \fBelse\fP \fIlist\fP; ] \fBfi\fP +The +.B if +.I list +is executed. If its exit status is zero, the +\fBthen\fP \fIlist\fP is executed. Otherwise, each \fBelif\fP +\fIlist\fP is executed in turn, and if its exit status is zero, +the corresponding \fBthen\fP \fIlist\fP is executed and the +command completes. Otherwise, the \fBelse\fP \fIlist\fP is +executed, if present. The exit status is the exit status of the +last command executed, or zero if no condition tested true. +.TP +\fBwhile\fP \fIlist-1\fP; \fBdo\fP \fIlist-2\fP; \fBdone\fP +.PD 0 +.TP +\fBuntil\fP \fIlist-1\fP; \fBdo\fP \fIlist-2\fP; \fBdone\fP +.PD +The \fBwhile\fP command continuously executes the list +\fIlist-2\fP as long as the last command in the list \fIlist-1\fP returns +an exit status of zero. The \fBuntil\fP command is identical +to the \fBwhile\fP command, except that the test is negated; +.I list-2 +is executed as long as the last command in +.I list-1 +returns a non-zero exit status. +The exit status of the \fBwhile\fP and \fBuntil\fP commands +is the exit status +of the last command executed in \fIlist-2\fP, or zero if +none was executed. +.SS Coprocesses +.PP +A \fIcoprocess\fP is a shell command preceded by the \fBcoproc\fP reserved +word. +A coprocess is executed asynchronously in a subshell, as if the command +had been terminated with the \fB&\fP control operator, with a two-way pipe +established between the executing shell and the coprocess. +.PP +The format for a coprocess is: +.RS +.PP +\fBcoproc\fP [\fINAME\fP] \fIcommand\fP [\fIredirections\fP] +.RE +.PP +This creates a coprocess named \fINAME\fP. +If \fINAME\fP is not supplied, the default name is \fBCOPROC\fP. +\fINAME\fP must not be supplied if \fIcommand\fP is a \fIsimple +command\fP (see above); otherwise, it is interpreted as the first word +of the simple command. +When the coprocess is executed, the shell creates an array variable (see +.B Arrays +below) named \fINAME\fP in the context of the executing shell. +The standard output of +.I command +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to \fINAME\fP[0]. +The standard input of +.I command +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to \fINAME\fP[1]. +This pipe is established before any redirections specified by the +command (see +.SM +.B REDIRECTION +below). +The file descriptors can be utilized as arguments to shell commands +and redirections using standard word expansions. +The file descriptors are not available in subshells. +The process ID of the shell spawned to execute the coprocess is +available as the value of the variable \fINAME\fP_PID. +The \fBwait\fP +builtin command may be used to wait for the coprocess to terminate. +.PP +Since the coprocess is created as an asynchronous command, +the \fBcoproc\fP command always returns success. +The return status of a coprocess is the exit status of \fIcommand\fP. +.SS Shell Function Definitions +.PP +A shell function is an object that is called like a simple command and +executes a compound command with a new set of positional parameters. +Shell functions are declared as follows: +.TP +\fIname\fP () \fIcompound\-command\fP [\fIredirection\fP] +.PD 0 +.TP +\fBfunction\fP \fIname\fP [()] \fIcompound\-command\fP [\fIredirection\fP] +.PD +This defines a function named \fIname\fP. +The reserved word \fBfunction\fP is optional. +If the \fBfunction\fP reserved word is supplied, the parentheses are optional. +The \fIbody\fP of the function is the compound command +.I compound\-command +(see \fBCompound Commands\fP above). +That command is usually a \fIlist\fP of commands between { and }, but +may be any command listed under \fBCompound Commands\fP above. +\fIcompound\-command\fP is executed whenever \fIname\fP is specified as the +name of a simple command. +When in \fIposix mode\fP, \fIname\fP may not be the name of one of the +POSIX \fIspecial builtins\fP. +Any redirections (see +.SM +.B REDIRECTION +below) specified when a function is defined are performed +when the function is executed. +The exit status of a function definition is zero unless a syntax error +occurs or a readonly function with the same name already exists. +When executed, the exit status of a function is the exit status of the +last command executed in the body. (See +.SM +.B FUNCTIONS +below.) +.SH COMMENTS +In a non-interactive shell, or an interactive shell in which the +.B interactive_comments +option to the +.B shopt +builtin is enabled (see +.SM +.B "SHELL BUILTIN COMMANDS" +below), a word beginning with +.B # +causes that word and all remaining characters on that line to +be ignored. An interactive shell without the +.B interactive_comments +option enabled does not allow comments. The +.B interactive_comments +option is on by default in interactive shells. +.SH QUOTING +\fIQuoting\fP is used to remove the special meaning of certain +characters or words to the shell. Quoting can be used to +disable special treatment for special characters, to prevent +reserved words from being recognized as such, and to prevent +parameter expansion. +.PP +Each of the \fImetacharacters\fP listed above under +.SM +.B DEFINITIONS +has special meaning to the shell and must be quoted if it is to +represent itself. +.PP +When the command history expansion facilities are being used +(see +.SM +.B HISTORY EXPANSION +below), the +\fIhistory expansion\fP character, usually \fB!\fP, must be quoted +to prevent history expansion. +.PP +There are three quoting mechanisms: the +.IR "escape character" , +single quotes, and double quotes. +.PP +A non-quoted backslash (\fB\e\fP) is the +.IR "escape character" . +It preserves the literal value of the next character that follows, +with the exception of . If a \fB\e\fP pair +appears, and the backslash is not itself quoted, the \fB\e\fP +is treated as a line continuation (that is, it is removed from the +input stream and effectively ignored). +.PP +Enclosing characters in single quotes preserves the literal value +of each character within the quotes. A single quote may not occur +between single quotes, even when preceded by a backslash. +.PP +Enclosing characters in double quotes preserves the literal value +of all characters within the quotes, with the exception of +.BR $ , +.BR \` , +.BR \e , +and, when history expansion is enabled, +.BR ! . +The characters +.B $ +and +.B \` +retain their special meaning within double quotes. The backslash +retains its special meaning only when followed by one of the following +characters: +.BR $ , +.BR \` , +\^\fB"\fP\^, +.BR \e , +or +.BR . +A double quote may be quoted within double quotes by preceding it with +a backslash. +If enabled, history expansion will be performed unless an +.B ! +appearing in double quotes is escaped using a backslash. +The backslash preceding the +.B ! +is not removed. +.PP +The special parameters +.B * +and +.B @ +have special meaning when in double +quotes (see +.SM +.B PARAMETERS +below). +.PP +Words of the form \fB$\fP\(aq\fIstring\fP\(aq are treated specially. The +word expands to \fIstring\fP, with backslash-escaped characters replaced +as specified by the ANSI C standard. Backslash escape sequences, if +present, are decoded as follows: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ee +.TP +.B \eE +an escape character +.TP +.B \ef +form feed +.TP +.B \en +new line +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\e +backslash +.TP +.B \e\(aq +single quote +.TP +.B \e\(dq +double quote +.TP +.B \e\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(one to three digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.TP +.B \eu\fIHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHH\fP (one to four hex digits) +.TP +.B \eU\fIHHHHHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHHHHHH\fP (one to eight hex digits) +.TP +.B \ec\fIx\fP +a control-\fIx\fP character +.PD +.RE +.LP +The expanded result is single-quoted, as if the dollar sign had +not been present. +.PP +A double-quoted string preceded by a dollar sign (\fB$\fP\(dq\fIstring\fP\(dq) +will cause the string to be translated according to the current locale. +If the current locale is \fBC\fP or \fBPOSIX\fP, the dollar sign +is ignored. +If the string is translated and replaced, the replacement is +double-quoted. +.SH PARAMETERS +A +.I parameter +is an entity that stores values. +It can be a +.IR name , +a number, or one of the special characters listed below under +.BR "Special Parameters" . +A +.I variable +is a parameter denoted by a +.IR name . +A variable has a \fIvalue\fP and zero or more \fIattributes\fP. +Attributes are assigned using the +.B declare +builtin command (see +.B declare +below in +.SM +.BR "SHELL BUILTIN COMMANDS" ). +.PP +A parameter is set if it has been assigned a value. The null string is +a valid value. Once a variable is set, it may be unset only by using +the +.B unset +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.PP +A +.I variable +may be assigned to by a statement of the form +.RS +.PP +\fIname\fP=[\fIvalue\fP] +.RE +.PP +If +.I value +is not given, the variable is assigned the null string. All +.I values +undergo tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote +removal (see +.SM +.B EXPANSION +below). If the variable has its +.B integer +attribute set, then +.I value +is evaluated as an arithmetic expression even if the $((...)) expansion is +not used (see +.B "Arithmetic Expansion" +below). +Word splitting is not performed, with the exception +of \fB"$@"\fP as explained below under +.BR "Special Parameters" . +Pathname expansion is not performed. +Assignment statements may also appear as arguments to the +.BR alias , +.BR declare , +.BR typeset , +.BR export , +.BR readonly , +and +.B local +builtin commands. +When in \fIposix mode\fP, these builtins may appear in a command after +one or more instances of the \fBcommand\fP builtin and retain these +assignment statement properties. +.PP +In the context where an assignment statement is assigning a value +to a shell variable or array index, the += operator can be used to +append to or add to the variable's previous value. +When += is applied to a variable for which the \fIinteger\fP attribute has been +set, \fIvalue\fP is evaluated as an arithmetic expression and added to the +variable's current value, which is also evaluated. +When += is applied to an array variable using compound assignment (see +.B Arrays +below), the +variable's value is not unset (as it is when using =), and new values are +appended to the array beginning at one greater than the array's maximum index +(for indexed arrays) or added as additional key\-value pairs in an +associative array. +When applied to a string-valued variable, \fIvalue\fP is expanded and +appended to the variable's value. +.PP +A variable can be assigned the \fInameref\fP attribute using the +\fB\-n\fP option to the \fBdeclare\fP or \fBlocal\fP builtin commands +(see the descriptions of \fBdeclare\fP and \fBlocal\fP below) +to create a \fInameref\fP, or a reference to another variable. +This allows variables to be manipulated indirectly. +Whenever the nameref variable is referenced or assigned to, the operation +is actually performed on the variable specified by the nameref variable's +value. +A nameref is commonly used within shell functions to refer to a variable +whose name is passed as an argument to the function. +For instance, if a variable name is passed to a shell function as its first +argument, running +.sp .5 +.RS +.if t \f(CWdeclare -n ref=$1\fP +.if n declare -n ref=$1 +.RE +.sp .5 +inside the function creates a nameref variable \fBref\fP whose value is +the variable name passed as the first argument. +References and assignments to \fBref\fP are treated as references and +assignments to the variable whose name was passed as \fB$1\fP. +If the control variable in a \fBfor\fP loop has the nameref attribute, +the list of words can be a list of shell variables, and a name reference +will be established for each word in the list, in turn, when the loop is +executed. +Array variables cannot be given the \fB\-n\fP attribute. +However, nameref variables can reference array variables and subscripted +array variables. +Namerefs can be unset using the \fB\-n\fP option to the \fBunset\fP builtin. +Otherwise, if \fBunset\fP is executed with the name of a nameref variable +as an argument, the variable referenced by the nameref variable will be unset. +.SS Positional Parameters +.PP +A +.I positional parameter +is a parameter denoted by one or more +digits, other than the single digit 0. Positional parameters are +assigned from the shell's arguments when it is invoked, +and may be reassigned using the +.B set +builtin command. Positional parameters may not be assigned to +with assignment statements. The positional parameters are +temporarily replaced when a shell function is executed (see +.SM +.B FUNCTIONS +below). +.PP +When a positional parameter consisting of more than a single +digit is expanded, it must be enclosed in braces (see +.SM +.B EXPANSION +below). +.SS Special Parameters +.PP +The shell treats several parameters specially. These parameters may +only be referenced; assignment to them is not allowed. +.PD 0 +.TP +.B * +Expands to the positional parameters, starting from one. +When the expansion is not within double quotes, each positional parameter +expands to a separate word. +In contexts where it is performed, those words +are subject to further word splitting and pathname expansion. +When the expansion occurs within double quotes, it expands to a single word +with the value of each parameter separated by the first character +of the +.SM +.B IFS +special variable. That is, "\fB$*\fP" is equivalent +to "\fB$1\fP\fIc\fP\fB$2\fP\fIc\fP\fB...\fP", where +.I c +is the first character of the value of the +.SM +.B IFS +variable. If +.SM +.B IFS +is unset, the parameters are separated by spaces. +If +.SM +.B IFS +is null, the parameters are joined without intervening separators. +.TP +.B @ +Expands to the positional parameters, starting from one. When the +expansion occurs within double quotes, each parameter expands to a +separate word. That is, "\fB$@\fP" is equivalent to +"\fB$1\fP" "\fB$2\fP" ... +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +When there are no positional parameters, "\fB$@\fP" and +.B $@ +expand to nothing (i.e., they are removed). +.TP +.B # +Expands to the number of positional parameters in decimal. +.TP +.B ? +Expands to the exit status of the most recently executed foreground +pipeline. +.TP +.B \- +Expands to the current option flags as specified upon invocation, +by the +.B set +builtin command, or those set by the shell itself +(such as the +.B \-i +option). +.TP +.B $ +Expands to the process ID of the shell. In a () subshell, it +expands to the process ID of the current shell, not the +subshell. +.TP +.B ! +Expands to the process ID of the job most recently placed into the +background, whether executed as an asynchronous command or using +the \fBbg\fP builtin (see +.SM +.B "JOB CONTROL" +below). +.TP +.B 0 +Expands to the name of the shell or shell script. This is set at +shell initialization. If +.B bash +is invoked with a file of commands, +.B $0 +is set to the name of that file. If +.B bash +is started with the +.B \-c +option, then +.B $0 +is set to the first argument after the string to be +executed, if one is present. Otherwise, it is set +to the filename used to invoke +.BR bash , +as given by argument zero. +.TP +.B _ +At shell startup, set to the absolute pathname used to invoke the +shell or shell script being executed as passed in the environment +or argument list. +Subsequently, expands to the last argument to the previous command, +after expansion. +Also set to the full pathname used to invoke each command executed +and placed in the environment exported to that command. +When checking mail, this parameter holds the name of the mail file +currently being checked. +.PD +.SS Shell Variables +.PP +The following variables are set by the shell: +.PP +.PD 0 +.TP +.B BASH +Expands to the full filename used to invoke this instance of +.BR bash . +.TP +.B BASHOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +.B \-s +option to the +.B shopt +builtin command (see +.SM +.B "SHELL BUILTIN COMMANDS" +below). The options appearing in +.SM +.B BASHOPTS +are those reported as +.I on +by \fBshopt\fP. +If this variable is in the environment when +.B bash +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +.TP +.B BASHPID +Expands to the process ID of the current \fBbash\fP process. +This differs from \fB$$\fP under certain circumstances, such as subshells +that do not require \fBbash\fP to be re-initialized. +.TP +.B BASH_ALIASES +An associative array variable whose members correspond to the internal +list of aliases as maintained by the \fBalias\fP builtin. +Elements added to this array appear in the alias list; unsetting array +elements cause aliases to be removed from the alias list. +.TP +.B BASH_ARGC +An array variable whose values are the number of parameters in each +frame of the current \fBbash\fP execution call stack. +The number of +parameters to the current subroutine (shell function or script executed +with \fB.\fP or \fBsource\fP) is at the top of the stack. +When a subroutine is executed, the number of parameters passed is pushed onto +.SM +.BR BASH_ARGC . +The shell sets +.SM +.B BASH_ARGC +only when in extended debugging mode (see the description of the +.B extdebug +option to the +.B shopt +builtin below) +.TP +.B BASH_ARGV +An array variable containing all of the parameters in the current \fBbash\fP +execution call stack. The final parameter of the last subroutine call +is at the top of the stack; the first parameter of the initial call is +at the bottom. When a subroutine is executed, the parameters supplied +are pushed onto +.SM +.BR BASH_ARGV . +The shell sets +.SM +.B BASH_ARGV +only when in extended debugging mode +(see the description of the +.B extdebug +option to the +.B shopt +builtin below) +.TP +.B BASH_CMDS +An associative array variable whose members correspond to the internal +hash table of commands as maintained by the \fBhash\fP builtin. +Elements added to this array appear in the hash table; unsetting array +elements cause commands to be removed from the hash table. +.TP +.B BASH_COMMAND +The command currently being executed or about to be executed, unless the +shell is executing a command as the result of a trap, +in which case it is the command executing at the time of the trap. +.TP +.B BASH_EXECUTION_STRING +The command argument to the \fB\-c\fP invocation option. +.TP +.B BASH_LINENO +An array variable whose members are the line numbers in source files +where each corresponding member of +.SM +.B FUNCNAME +was invoked. +\fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP is the line number in the source +file (\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP) where +\fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP was called +(or \fB${BASH_LINENO[\fP\fI$i-1\fP\fB]}\fP if referenced within another +shell function). +Use +.SM +.B LINENO +to obtain the current line number. +.TP +.B BASH_REMATCH +An array variable whose members are assigned by the \fB=~\fP binary +operator to the \fB[[\fP conditional command. +The element with index 0 is the portion of the string +matching the entire regular expression. +The element with index \fIn\fP is the portion of the +string matching the \fIn\fPth parenthesized subexpression. +This variable is read-only. +.TP +.B BASH_SOURCE +An array variable whose members are the source filenames +where the corresponding shell function names in the +.SM +.B FUNCNAME +array variable are defined. +The shell function +\fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP is defined in the file +\fB${BASH_SOURCE[\fP\fI$i\fP\fB]}\fP and called from +\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP. +.TP +.B BASH_SUBSHELL +Incremented by one within each subshell or subshell environment when +the shell begins executing in that environment. +The initial value is 0. +.TP +.B BASH_VERSINFO +A readonly array variable whose members hold version information for +this instance of +.BR bash . +The values assigned to the array members are as follows: +.sp .5 +.RS +.TP 24 +.B BASH_VERSINFO[\fR0\fP] +The major version number (the \fIrelease\fP). +.TP +.B BASH_VERSINFO[\fR1\fP] +The minor version number (the \fIversion\fP). +.TP +.B BASH_VERSINFO[\fR2\fP] +The patch level. +.TP +.B BASH_VERSINFO[\fR3\fP] +The build version. +.TP +.B BASH_VERSINFO[\fR4\fP] +The release status (e.g., \fIbeta1\fP). +.TP +.B BASH_VERSINFO[\fR5\fP] +The value of +.SM +.BR MACHTYPE . +.RE +.TP +.B BASH_VERSION +Expands to a string describing the version of this instance of +.BR bash . +.TP +.B COMP_CWORD +An index into \fB${COMP_WORDS}\fP of the word containing the current +cursor position. +This variable is available only in shell functions invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_KEY +The key (or final key of a key sequence) used to invoke the current +completion function. +.TP +.B COMP_LINE +The current command line. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_POINT +The index of the current cursor position relative to the beginning of +the current command. +If the current cursor position is at the end of the current command, +the value of this variable is equal to \fB${#COMP_LINE}\fP. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_TYPE +Set to an integer value corresponding to the type of completion attempted +that caused a completion function to be called: +\fITAB\fP, for normal completion, +\fI?\fP, for listing completions after successive tabs, +\fI!\fP, for listing alternatives on partial word completion, +\fI@\fP, to list completions if the word is not unmodified, +or +\fI%\fP, for menu completion. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_WORDBREAKS +The set of characters that the \fBreadline\fP library treats as word +separators when performing word completion. +If +.SM +.B COMP_WORDBREAKS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B COMP_WORDS +An array variable (see \fBArrays\fP below) consisting of the individual +words in the current command line. +The line is split into words as \fBreadline\fP would split it, using +.SM +.B COMP_WORDBREAKS +as described above. +This variable is available only in shell functions invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COPROC +An array variable (see \fBArrays\fP below) created to hold the file descriptors +for output from and input to an unnamed coprocess (see \fBCoprocesses\fP +above). +.TP +.B DIRSTACK +An array variable (see +.B Arrays +below) containing the current contents of the directory stack. +Directories appear in the stack in the order they are displayed by the +.B dirs +builtin. +Assigning to members of this array variable may be used to modify +directories already in the stack, but the +.B pushd +and +.B popd +builtins must be used to add and remove directories. +Assignment to this variable will not change the current directory. +If +.SM +.B DIRSTACK +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B EUID +Expands to the effective user ID of the current user, initialized at +shell startup. This variable is readonly. +.TP +.B FUNCNAME +An array variable containing the names of all shell functions +currently in the execution call stack. +The element with index 0 is the name of any currently-executing +shell function. +The bottom-most element (the one with the highest index) is +.if t \f(CW"main"\fP. +.if n "main". +This variable exists only when a shell function is executing. +Assignments to +.SM +.B FUNCNAME +have no effect and return an error status. +If +.SM +.B FUNCNAME +is unset, it loses its special properties, even if it is +subsequently reset. +.if t .sp 0.5 +.if n .sp 1 +This variable can be used with \fBBASH_LINENO\fP and \fBBASH_SOURCE\fP. +Each element of \fBFUNCNAME\fP has corresponding elements in +\fBBASH_LINENO\fP and \fBBASH_SOURCE\fP to describe the call stack. +For instance, \fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP was called from the file +\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP at line number +\fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP. +The \fBcaller\fP builtin displays the current call stack using this +information. +.TP +.B GROUPS +An array variable containing the list of groups of which the current +user is a member. +Assignments to +.SM +.B GROUPS +have no effect and return an error status. +If +.SM +.B GROUPS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B HISTCMD +The history number, or index in the history list, of the current +command. +If +.SM +.B HISTCMD +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B HOSTNAME +Automatically set to the name of the current host. +.TP +.B HOSTTYPE +Automatically set to a string that uniquely +describes the type of machine on which +.B bash +is executing. +The default is system-dependent. +.TP +.B LINENO +Each time this parameter is referenced, the shell substitutes +a decimal number representing the current sequential line number +(starting with 1) within a script or function. When not in a +script or function, the value substituted is not guaranteed to +be meaningful. +If +.SM +.B LINENO +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B MACHTYPE +Automatically set to a string that fully describes the system +type on which +.B bash +is executing, in the standard GNU \fIcpu-company-system\fP format. +The default is system-dependent. +.TP +.B MAPFILE +An array variable (see \fBArrays\fP below) created to hold the text +read by the \fBmapfile\fP builtin when no variable name is supplied. +.TP +.B OLDPWD +The previous working directory as set by the +.B cd +command. +.TP +.B OPTARG +The value of the last option argument processed by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.TP +.B OPTIND +The index of the next argument to be processed by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.TP +.B OSTYPE +Automatically set to a string that +describes the operating system on which +.B bash +is executing. +The default is system-dependent. +.TP +.B PIPESTATUS +An array variable (see +.B Arrays +below) containing a list of exit status values from the processes +in the most-recently-executed foreground pipeline (which may +contain only a single command). +.TP +.B PPID +The process ID of the shell's parent. This variable is readonly. +.TP +.B PWD +The current working directory as set by the +.B cd +command. +.TP +.B RANDOM +Each time this parameter is referenced, a random integer between +0 and 32767 is +generated. The sequence of random numbers may be initialized by assigning +a value to +.SM +.BR RANDOM . +If +.SM +.B RANDOM +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B READLINE_LINE +The contents of the +.B readline +line buffer, for use with +.if t \f(CWbind -x\fP +.if n "bind -x" +(see +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.TP +.B READLINE_POINT +The position of the insertion point in the +.B readline +line buffer, for use with +.if t \f(CWbind -x\fP +.if n "bind -x" +(see +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.TP +.B REPLY +Set to the line of input read by the +.B read +builtin command when no arguments are supplied. +.TP +.B SECONDS +Each time this parameter is +referenced, the number of seconds since shell invocation is returned. If a +value is assigned to +.SM +.BR SECONDS , +the value returned upon subsequent +references is +the number of seconds since the assignment plus the value assigned. +If +.SM +.B SECONDS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B SHELLOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +.B \-o +option to the +.B set +builtin command (see +.SM +.B "SHELL BUILTIN COMMANDS" +below). The options appearing in +.SM +.B SHELLOPTS +are those reported as +.I on +by \fBset \-o\fP. +If this variable is in the environment when +.B bash +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +.TP +.B SHLVL +Incremented by one each time an instance of +.B bash +is started. +.TP +.B UID +Expands to the user ID of the current user, initialized at shell startup. +This variable is readonly. +.PD +.PP +The following variables are used by the shell. In some cases, +.B bash +assigns a default value to a variable; these cases are noted +below. +.PP +.PD 0 +.TP +.B BASH_COMPAT +The value is used to set the shell's compatibility level. +See the description of the \fBshopt\fP builtin below under +\fBSHELL BUILTIN COMMANDS\fP +for a description of the various compatibility +levels and their effects. +The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42) +corresponding to the desired compatibility level. +If \fBBASH_COMPAT\fP is unset or set to the empty string, the compatibility +level is set to the default for the current version. +If \fBBASH_COMPAT\fP is set to a value that is not one of the valid +compatibility levels, the shell prints an error message and sets the +compatibility level to the default for the current version. +The valid compatibility levels correspond to the compatibility options +accepted by the \fBshopt\fP builtin described below (for example, +\fBcompat42\fP means that 4.2 and 42 are valid values). +The current version is also a valid value. +.TP +.B BASH_ENV +If this parameter is set when \fBbash\fP is executing a shell script, +its value is interpreted as a filename containing commands to +initialize the shell, as in +.IR ~/.bashrc . +The value of +.SM +.B BASH_ENV +is subjected to parameter expansion, command substitution, and arithmetic +expansion before being interpreted as a filename. +.SM +.B PATH +is not used to search for the resultant filename. +.TP +.B BASH_XTRACEFD +If set to an integer corresponding to a valid file descriptor, \fBbash\fP +will write the trace output generated when +.if t \f(CWset -x\fP +.if n \fIset -x\fP +is enabled to that file descriptor. +The file descriptor is closed when +.SM +.B BASH_XTRACEFD +is unset or assigned a new value. +Unsetting +.SM +.B BASH_XTRACEFD +or assigning it the empty string causes the +trace output to be sent to the standard error. +Note that setting +.SM +.B BASH_XTRACEFD +to 2 (the standard error file +descriptor) and then unsetting it will result in the standard error +being closed. +.TP +.B CDPATH +The search path for the +.B cd +command. +This is a colon-separated list of directories in which the shell looks +for destination directories specified by the +.B cd +command. +A sample value is +.if t \f(CW".:~:/usr"\fP. +.if n ".:~:/usr". +.TP +.B CHILD_MAX +Set the number of exited child status values for the shell to remember. +Bash will not allow this value to be decreased below a POSIX-mandated +minimum, and there is a maximum value (currently 8192) that this may +not exceed. +The minimum value is system-dependent. +.TP +.B COLUMNS +Used by the \fBselect\fP compound command to determine the terminal width +when printing selection lists. +Automatically set if the +.B checkwinsize +option is enabled or in an interactive shell upon receipt of a +.SM +.BR SIGWINCH . +.TP +.B COMPREPLY +An array variable from which \fBbash\fP reads the possible completions +generated by a shell function invoked by the programmable completion +facility (see \fBProgrammable Completion\fP below). +Each array element contains one possible completion. +.TP +.B EMACS +If \fBbash\fP finds this variable in the environment when the shell starts +with value +.if t \f(CWt\fP, +.if n "t", +it assumes that the shell is running in an Emacs shell buffer and disables +line editing. +.TP +.B ENV +Similar to +.SM +.BR BASH_ENV ; +used when the shell is invoked in POSIX mode. +.TP +.B FCEDIT +The default editor for the +.B fc +builtin command. +.TP +.B FIGNORE +A colon-separated list of suffixes to ignore when performing +filename completion (see +.SM +.B READLINE +below). +A filename whose suffix matches one of the entries in +.SM +.B FIGNORE +is excluded from the list of matched filenames. +A sample value is +.if t \f(CW".o:~"\fP. +.if n ".o:~" +(Quoting is needed when assigning a value to this variable, +which contains tildes). +.TP +.B FUNCNEST +If set to a numeric value greater than 0, defines a maximum function +nesting level. Function invocations that exceed this nesting level +will cause the current command to abort. +.TP +.B GLOBIGNORE +A colon-separated list of patterns defining the set of filenames to +be ignored by pathname expansion. +If a filename matched by a pathname expansion pattern also matches one +of the patterns in +.SM +.BR GLOBIGNORE , +it is removed from the list of matches. +.TP +.B HISTCONTROL +A colon-separated list of values controlling how commands are saved on +the history list. +If the list of values includes +.IR ignorespace , +lines which begin with a +.B space +character are not saved in the history list. +A value of +.I ignoredups +causes lines matching the previous history entry to not be saved. +A value of +.I ignoreboth +is shorthand for \fIignorespace\fP and \fIignoredups\fP. +A value of +.IR erasedups +causes all previous lines matching the current line to be removed from +the history list before that line is saved. +Any value not in the above list is ignored. +If +.SM +.B HISTCONTROL +is unset, or does not include a valid value, +all lines read by the shell parser are saved on the history list, +subject to the value of +.SM +.BR HISTIGNORE . +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +.SM +.BR HISTCONTROL . +.TP +.B HISTFILE +The name of the file in which command history is saved (see +.SM +.B HISTORY +below). The default value is \fI~/.bash_history\fP. If unset, the +command history is not saved when a shell exits. +.TP +.B HISTFILESIZE +The maximum number of lines contained in the history file. When this +variable is assigned a value, the history file is truncated, if +necessary, +to contain no more than that number of lines by removing the oldest entries. +The history file is also truncated to this size after +writing it when a shell exits. +If the value is 0, the history file is truncated to zero size. +Non-numeric values and numeric values less than zero inhibit truncation. +The shell sets the default value to the value of \fBHISTSIZE\fP +after reading any startup files. +.TP +.B HISTIGNORE +A colon-separated list of patterns used to decide which command lines +should be saved on the history list. Each pattern is anchored at the +beginning of the line and must match the complete line (no implicit +`\fB*\fP' is appended). Each pattern is tested against the line +after the checks specified by +.SM +.B HISTCONTROL +are applied. +In addition to the normal shell pattern matching characters, `\fB&\fP' +matches the previous history line. `\fB&\fP' may be escaped using a +backslash; the backslash is removed before attempting a match. +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +.SM +.BR HISTIGNORE . +.TP +.B HISTSIZE +The number of commands to remember in the command history (see +.SM +.B HISTORY +below). +If the value is 0, commands are not saved in the history list. +Numeric values less than zero result in every command being saved +on the history list (there is no limit). +The shell sets the default value to 500 after reading any startup files. +.TP +.B HISTTIMEFORMAT +If this variable is set and not null, its value is used as a format string +for \fIstrftime\fP(3) to print the time stamp associated with each history +entry displayed by the \fBhistory\fP builtin. +If this variable is set, time stamps are written to the history file so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +.TP +.B HOME +The home directory of the current user; the default argument for the +\fBcd\fP builtin command. +The value of this variable is also used when performing tilde expansion. +.TP +.B HOSTFILE +Contains the name of a file in the same format as +.FN /etc/hosts +that should be read when the shell needs to complete a +hostname. +The list of possible hostname completions may be changed while the +shell is running; +the next time hostname completion is attempted after the +value is changed, +.B bash +adds the contents of the new file to the existing list. +If +.SM +.B HOSTFILE +is set, but has no value, or does not name a readable file, +\fBbash\fP attempts to read +.FN /etc/hosts +to obtain the list of possible hostname completions. +When +.SM +.B HOSTFILE +is unset, the hostname list is cleared. +.TP +.B IFS +The +.I Internal Field Separator +that is used +for word splitting after expansion and to +split lines into words with the +.B read +builtin command. The default value is +``''. +.TP +.B IGNOREEOF +Controls the +action of an interactive shell on receipt of an +.SM +.B EOF +character as the sole input. If set, the value is the number of +consecutive +.SM +.B EOF +characters which must be +typed as the first characters on an input line before +.B bash +exits. If the variable exists but does not have a numeric value, or +has no value, the default value is 10. If it does not exist, +.SM +.B EOF +signifies the end of input to the shell. +.TP +.B INPUTRC +The filename for the +.B readline +startup file, overriding the default of +.FN ~/.inputrc +(see +.SM +.B READLINE +below). +.TP +.B LANG +Used to determine the locale category for any category not specifically +selected with a variable starting with \fBLC_\fP. +.TP +.B LC_ALL +This variable overrides the value of +.SM +.B LANG +and any other +\fBLC_\fP variable specifying a locale category. +.TP +.B LC_COLLATE +This variable determines the collation order used when sorting the +results of pathname expansion, and determines the behavior of range +expressions, equivalence classes, and collating sequences within +pathname expansion and pattern matching. +.TP +.B LC_CTYPE +This variable determines the interpretation of characters and the +behavior of character classes within pathname expansion and pattern +matching. +.TP +.B LC_MESSAGES +This variable determines the locale used to translate double-quoted +strings preceded by a \fB$\fP. +.TP +.B LC_NUMERIC +This variable determines the locale category used for number formatting. +.TP +.B LINES +Used by the \fBselect\fP compound command to determine the column length +for printing selection lists. +Automatically set if the +.B checkwinsize +option is enabled or in an interactive shell upon receipt of a +.SM +.BR SIGWINCH . +.TP +.B MAIL +If this parameter is set to a file or directory name and the +.SM +.B MAILPATH +variable is not set, +.B bash +informs the user of the arrival of mail in the specified file or +Maildir-format directory. +.TP +.B MAILCHECK +Specifies how +often (in seconds) +.B bash +checks for mail. The default is 60 seconds. When it is time to check +for mail, the shell does so before displaying the primary prompt. +If this variable is unset, or set to a value that is not a number +greater than or equal to zero, the shell disables mail checking. +.TP +.B MAILPATH +A colon-separated list of filenames to be checked for mail. +The message to be printed when mail arrives in a particular file +may be specified by separating the filename from the message with a `?'. +When used in the text of the message, \fB$_\fP expands to the name of +the current mailfile. +Example: +.RS +.PP +\fBMAILPATH\fP=\(aq/var/mail/bfox?"You have mail":~/shell\-mail?"$_ has mail!"\(aq +.PP +.B Bash +supplies a default value for this variable, but the location of the user +mail files that it uses is system dependent (e.g., /var/mail/\fB$USER\fP). +.RE +.TP +.B OPTERR +If set to the value 1, +.B bash +displays error messages generated by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SM +.B OPTERR +is initialized to 1 each time the shell is invoked or a shell +script is executed. +.TP +.B PATH +The search path for commands. It +is a colon-separated list of directories in which +the shell looks for commands (see +.SM +.B COMMAND EXECUTION +below). +A zero-length (null) directory name in the value of +.SM +.B PATH +indicates the current directory. +A null directory name may appear as two adjacent colons, or as an initial +or trailing colon. +The default path is system-dependent, +and is set by the administrator who installs +.BR bash . +A common value is +.if t \f(CW/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin\fP. +.if n ``/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin''. +.TP +.B POSIXLY_CORRECT +If this variable is in the environment when \fBbash\fP starts, the shell +enters \fIposix mode\fP before reading the startup files, as if the +.B \-\-posix +invocation option had been supplied. If it is set while the shell is +running, \fBbash\fP enables \fIposix mode\fP, as if the command +.if t \f(CWset -o posix\fP +.if n \fIset -o posix\fP +had been executed. +.TP +.B PROMPT_COMMAND +If set, the value is executed as a command prior to issuing each primary +prompt. +.TP +.B PROMPT_DIRTRIM +If set to a number greater than zero, the value is used as the number of +trailing directory components to retain when expanding the \fB\ew\fP and +\fB\eW\fP prompt string escapes (see +.SM +.B PROMPTING +below). Characters removed are replaced with an ellipsis. +.TP +.B PS1 +The value of this parameter is expanded (see +.SM +.B PROMPTING +below) and used as the primary prompt string. The default value is +``\fB\es\-\ev\e$ \fP''. +.TP +.B PS2 +The value of this parameter is expanded as with +.SM +.B PS1 +and used as the secondary prompt string. The default is +``\fB> \fP''. +.TP +.B PS3 +The value of this parameter is used as the prompt for the +.B select +command (see +.SM +.B SHELL GRAMMAR +above). +.TP +.B PS4 +The value of this parameter is expanded as with +.SM +.B PS1 +and the value is printed before each command +.B bash +displays during an execution trace. The first character of +.SM +.B PS4 +is replicated multiple times, as necessary, to indicate multiple +levels of indirection. The default is ``\fB+ \fP''. +.TP +.B SHELL +The full pathname to the shell is kept in this environment variable. +If it is not set when the shell starts, +.B bash +assigns to it the full pathname of the current user's login shell. +.TP +.B TIMEFORMAT +The value of this parameter is used as a format string specifying +how the timing information for pipelines prefixed with the +.B time +reserved word should be displayed. +The \fB%\fP character introduces an escape sequence that is +expanded to a time value or other information. +The escape sequences and their meanings are as follows; the +braces denote optional portions. +.sp .5 +.RS +.PD 0 +.TP 10 +.B %% +A literal \fB%\fP. +.TP +.B %[\fIp\fP][l]R +The elapsed time in seconds. +.TP +.B %[\fIp\fP][l]U +The number of CPU seconds spent in user mode. +.TP +.B %[\fIp\fP][l]S +The number of CPU seconds spent in system mode. +.TP +.B %P +The CPU percentage, computed as (%U + %S) / %R. +.PD +.RE +.IP +The optional \fIp\fP is a digit specifying the \fIprecision\fP, +the number of fractional digits after a decimal point. +A value of 0 causes no decimal point or fraction to be output. +At most three places after the decimal point may be specified; +values of \fIp\fP greater than 3 are changed to 3. +If \fIp\fP is not specified, the value 3 is used. +.IP +The optional \fBl\fP specifies a longer format, including +minutes, of the form \fIMM\fPm\fISS\fP.\fIFF\fPs. +The value of \fIp\fP determines whether or not the fraction is +included. +.IP +If this variable is not set, \fBbash\fP acts as if it had the +value \fB$\(aq\enreal\et%3lR\enuser\et%3lU\ensys\et%3lS\(aq\fP. +If the value is null, no timing information is displayed. +A trailing newline is added when the format string is displayed. +.PD 0 +.TP +.B TMOUT +If set to a value greater than zero, +.SM +.B TMOUT +is treated as the +default timeout for the \fBread\fP builtin. +The \fBselect\fP command terminates if input does not arrive +after +.SM +.B TMOUT +seconds when input is coming from a terminal. +In an interactive shell, the value is interpreted as the +number of seconds to wait for a line of input after issuing the +primary prompt. +.B Bash +terminates after waiting for that number of seconds if a complete +line of input does not arrive. +.TP +.B TMPDIR +If set, \fBbash\fP uses its value as the name of a directory in which +\fBbash\fP creates temporary files for the shell's use. +.TP +.B auto_resume +This variable controls how the shell interacts with the user and +job control. If this variable is set, single word simple +commands without redirections are treated as candidates for resumption +of an existing stopped job. There is no ambiguity allowed; if there is +more than one job beginning with the string typed, the job most recently +accessed is selected. The +.I name +of a stopped job, in this context, is the command line used to +start it. +If set to the value +.IR exact , +the string supplied must match the name of a stopped job exactly; +if set to +.IR substring , +the string supplied needs to match a substring of the name of a +stopped job. The +.I substring +value provides functionality analogous to the +.B %? +job identifier (see +.SM +.B JOB CONTROL +below). If set to any other value, the supplied string must +be a prefix of a stopped job's name; this provides functionality +analogous to the \fB%\fP\fIstring\fP job identifier. +.TP +.B histchars +The two or three characters which control history expansion +and tokenization (see +.SM +.B HISTORY EXPANSION +below). The first character is the \fIhistory expansion\fP character, +the character which signals the start of a history +expansion, normally `\fB!\fP'. +The second character is the \fIquick substitution\fP +character, which is used as shorthand for re-running the previous +command entered, substituting one string for another in the command. +The default is `\fB^\fP'. +The optional third character is the character +which indicates that the remainder of the line is a comment when found +as the first character of a word, normally `\fB#\fP'. The history +comment character causes history substitution to be skipped for the +remaining words on the line. It does not necessarily cause the shell +parser to treat the rest of the line as a comment. +.PD +.SS Arrays +.B Bash +provides one-dimensional indexed and associative array variables. +Any variable may be used as an indexed array; the +.B declare +builtin will explicitly declare an array. +There is no maximum +limit on the size of an array, nor any requirement that members +be indexed or assigned contiguously. +Indexed arrays are referenced using integers (including arithmetic +expressions) and are zero-based; associative arrays are referenced +using arbitrary strings. +Unless otherwise noted, indexed array indices must be non-negative integers. +.PP +An indexed array is created automatically if any variable is assigned to +using the syntax \fIname\fP[\fIsubscript\fP]=\fIvalue\fP. The +.I subscript +is treated as an arithmetic expression that must evaluate to a number. +To explicitly declare an indexed array, use +.B declare \-a \fIname\fP +(see +.SM +.B SHELL BUILTIN COMMANDS +below). +.B declare \-a \fIname\fP[\fIsubscript\fP] +is also accepted; the \fIsubscript\fP is ignored. +.PP +Associative arrays are created using +.BR "declare \-A \fIname\fP" . +.PP +Attributes may be +specified for an array variable using the +.B declare +and +.B readonly +builtins. Each attribute applies to all members of an array. +.PP +Arrays are assigned to using compound assignments of the form +\fIname\fP=\fB(\fPvalue\fI1\fP ... value\fIn\fP\fB)\fP, where each +\fIvalue\fP is of the form [\fIsubscript\fP]=\fIstring\fP. +Indexed array assignments do not require anything but \fIstring\fP. +When assigning to indexed arrays, if the optional brackets and subscript +are supplied, that index is assigned to; +otherwise the index of the element assigned is the last index assigned +to by the statement plus one. Indexing starts at zero. +.PP +When assigning to an associative array, the subscript is required. +.PP +This syntax is also accepted by the +.B declare +builtin. Individual array elements may be assigned to using the +\fIname\fP[\fIsubscript\fP]=\fIvalue\fP syntax introduced above. +When assigning to an indexed array, if +.I name +is subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +\fIname\fP, so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.PP +Any element of an array may be referenced using +${\fIname\fP[\fIsubscript\fP]}. The braces are required to avoid +conflicts with pathname expansion. If +\fIsubscript\fP is \fB@\fP or \fB*\fP, the word expands to +all members of \fIname\fP. These subscripts differ only when the +word appears within double quotes. If the word is double-quoted, +${\fIname\fP[*]} expands to a single +word with the value of each array member separated by the first +character of the +.SM +.B IFS +special variable, and ${\fIname\fP[@]} expands each element of +\fIname\fP to a separate word. When there are no array members, +${\fIname\fP[@]} expands to nothing. +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +This is analogous to the expansion +of the special parameters \fB*\fP and \fB@\fP (see +.B Special Parameters +above). ${#\fIname\fP[\fIsubscript\fP]} expands to the length of +${\fIname\fP[\fIsubscript\fP]}. If \fIsubscript\fP is \fB*\fP or +\fB@\fP, the expansion is the number of elements in the array. +Referencing an array variable without a subscript is equivalent to +referencing the array with a subscript of 0. +If the +.I subscript +used to reference an element of an indexed array +evaluates to a number less than zero, it is +interpreted as relative to one greater than the maximum index of the array, +so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.PP +An array variable is considered set if a subscript has been assigned a +value. The null string is a valid value. +.PP +It is possible to obtain the keys (indices) of an array as well as the values. +${\fB!\fP\fIname\fP[\fI@\fP]} and ${\fB!\fP\fIname\fP[\fI*\fP]} +expand to the indices assigned in array variable \fIname\fP. +The treatment when in double quotes is similar to the expansion of the +special parameters \fI@\fP and \fI*\fP within double quotes. +.PP +The +.B unset +builtin is used to destroy arrays. \fBunset\fP \fIname\fP[\fIsubscript\fP] +destroys the array element at index \fIsubscript\fP. +Negative subscripts to indexed arrays are interpreted as described above. +Care must be taken to avoid unwanted side effects caused by pathname +expansion. +\fBunset\fP \fIname\fP, where \fIname\fP is an array, or +\fBunset\fP \fIname\fP[\fIsubscript\fP], where +\fIsubscript\fP is \fB*\fP or \fB@\fP, removes the entire array. +.PP +The +.BR declare , +.BR local , +and +.B readonly +builtins each accept a +.B \-a +option to specify an indexed array and a +.B \-A +option to specify an associative array. +If both options are supplied, +.B \-A +takes precedence. +The +.B read +builtin accepts a +.B \-a +option to assign a list of words read from the standard input +to an array. The +.B set +and +.B declare +builtins display array values in a way that allows them to be +reused as assignments. +.SH EXPANSION +Expansion is performed on the command line after it has been split into +words. There are seven kinds of expansion performed: +.IR "brace expansion" , +.IR "tilde expansion" , +.IR "parameter and variable expansion" , +.IR "command substitution" , +.IR "arithmetic expansion" , +.IR "word splitting" , +and +.IR "pathname expansion" . +.PP +The order of expansions is: +brace expansion; +tilde expansion, parameter and variable expansion, arithmetic expansion, +and command substitution (done in a left-to-right fashion); +word splitting; +and pathname expansion. +.PP +On systems that can support it, there is an additional expansion +available: \fIprocess substitution\fP. +This is performed at the +same time as tilde, parameter, variable, and arithmetic expansion and +command substitution. +.PP +Only brace expansion, word splitting, and pathname expansion +can change the number of words of the expansion; other expansions +expand a single word to a single word. +The only exceptions to this are the expansions of +"\fB$@\fP" and "\fB${\fP\fIname\fP\fB[@]}\fP" +as explained above (see +.SM +.BR PARAMETERS ). +.SS Brace Expansion +.PP +.I "Brace expansion" +is a mechanism by which arbitrary strings +may be generated. This mechanism is similar to +\fIpathname expansion\fP, but the filenames generated +need not exist. Patterns to be brace expanded take +the form of an optional +.IR preamble , +followed by either a series of comma-separated strings or +a sequence expression between a pair of braces, followed by +an optional +.IR postscript . +The preamble is prefixed to each string contained +within the braces, and the postscript is then appended +to each resulting string, expanding left to right. +.PP +Brace expansions may be nested. The results of each expanded +string are not sorted; left to right order is preserved. +For example, a\fB{\fPd,c,b\fB}\fPe expands into `ade ace abe'. +.PP +A sequence expression takes the form +\fB{\fP\fIx\fP\fB..\fP\fIy\fP\fB[..\fP\fIincr\fP\fB]}\fP, +where \fIx\fP and \fIy\fP are either integers or single characters, +and \fIincr\fP, an optional increment, is an integer. +When integers are supplied, the expression expands to each number between +\fIx\fP and \fIy\fP, inclusive. +Supplied integers may be prefixed with \fI0\fP to force each term to have the +same width. +When either \fIx\fP or \fPy\fP begins with a zero, the shell +attempts to force all generated terms to contain the same number of digits, +zero-padding where necessary. +When characters are supplied, the expression expands to each character +lexicographically between \fIx\fP and \fIy\fP, inclusive, +using the default C locale. +Note that both \fIx\fP and \fIy\fP must be of the same type. +When the increment is supplied, it is used as the difference between +each term. The default increment is 1 or -1 as appropriate. +.PP +Brace expansion is performed before any other expansions, +and any characters special to other expansions are preserved +in the result. It is strictly textual. +.B Bash +does not apply any syntactic interpretation to the context of the +expansion or the text between the braces. +.PP +A correctly-formed brace expansion must contain unquoted opening +and closing braces, and at least one unquoted comma or a valid +sequence expression. +Any incorrectly formed brace expansion is left unchanged. +A \fB{\fP or \fB,\fP may be quoted with a backslash to prevent its +being considered part of a brace expression. +To avoid conflicts with parameter expansion, the string \fB${\fP +is not considered eligible for brace expansion. +.PP +This construct is typically used as shorthand when the common +prefix of the strings to be generated is longer than in the +above example: +.RS +.PP +mkdir /usr/local/src/bash/{old,new,dist,bugs} +.RE +or +.RS +chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} +.RE +.PP +Brace expansion introduces a slight incompatibility with +historical versions of +.BR sh . +.B sh +does not treat opening or closing braces specially when they +appear as part of a word, and preserves them in the output. +.B Bash +removes braces from words as a consequence of brace +expansion. For example, a word entered to +.B sh +as \fIfile{1,2}\fP +appears identically in the output. The same word is +output as +.I file1 file2 +after expansion by +.BR bash . +If strict compatibility with +.B sh +is desired, start +.B bash +with the +.B +B +option or disable brace expansion with the +.B +B +option to the +.B set +command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SS Tilde Expansion +.PP +If a word begins with an unquoted tilde character (`\fB~\fP'), all of +the characters preceding the first unquoted slash (or all characters, +if there is no unquoted slash) are considered a \fItilde-prefix\fP. +If none of the characters in the tilde-prefix are quoted, the +characters in the tilde-prefix following the tilde are treated as a +possible \fIlogin name\fP. +If this login name is the null string, the tilde is replaced with the +value of the shell parameter +.SM +.BR HOME . +If +.SM +.B HOME +is unset, the home directory of the user executing the shell is +substituted instead. +Otherwise, the tilde-prefix is replaced with the home directory +associated with the specified login name. +.PP +If the tilde-prefix is a `~+', the value of the shell variable +.SM +.B PWD +replaces the tilde-prefix. +If the tilde-prefix is a `~\-', the value of the shell variable +.SM +.BR OLDPWD , +if it is set, is substituted. +If the characters following the tilde in the tilde-prefix consist +of a number \fIN\fP, optionally prefixed +by a `+' or a `\-', the tilde-prefix is replaced with the corresponding +element from the directory stack, as it would be displayed by the +.B dirs +builtin invoked with the tilde-prefix as an argument. +If the characters following the tilde in the tilde-prefix consist of a +number without a leading `+' or `\-', `+' is assumed. +.PP +If the login name is invalid, or the tilde expansion fails, the word +is unchanged. +.PP +Each variable assignment is checked for unquoted tilde-prefixes immediately +following a +.B : +or the first +.BR = . +In these cases, tilde expansion is also performed. +Consequently, one may use filenames with tildes in assignments to +.SM +.BR PATH , +.SM +.BR MAILPATH , +and +.SM +.BR CDPATH , +and the shell assigns the expanded value. +.SS Parameter Expansion +.PP +The `\fB$\fP' character introduces parameter expansion, +command substitution, or arithmetic expansion. The parameter name +or symbol to be expanded may be enclosed in braces, which +are optional but serve to protect the variable to be expanded from +characters immediately following it which could be +interpreted as part of the name. +.PP +When braces are used, the matching ending brace is the first `\fB}\fP' +not escaped by a backslash or within a quoted string, and not within an +embedded arithmetic expansion, command substitution, or parameter +expansion. +.PP +.PD 0 +.TP +${\fIparameter\fP} +The value of \fIparameter\fP is substituted. The braces are required +when +.I parameter +is a positional parameter with more than one digit, +or when +.I parameter +is followed by a character which is not to be +interpreted as part of its name. +The \fIparameter\fP is a shell parameter as described above +\fBPARAMETERS\fP) or an array reference (\fBArrays\fP). +.PD +.PP +If the first character of \fIparameter\fP is an exclamation point (\fB!\fP), +it introduces a level of variable indirection. +\fBBash\fP uses the value of the variable formed from the rest of +\fIparameter\fP as the name of the variable; this variable is then +expanded and that value is used in the rest of the substitution, rather +than the value of \fIparameter\fP itself. +This is known as \fIindirect expansion\fP. +The exceptions to this are the expansions of ${\fB!\fP\fIprefix\fP\fB*\fP} and +${\fB!\fP\fIname\fP[\fI@\fP]} described below. +The exclamation point must immediately follow the left brace in order to +introduce indirection. +.PP +In each of the cases below, \fIword\fP is subject to tilde expansion, +parameter expansion, command substitution, and arithmetic expansion. +.PP +When not performing substring expansion, using the forms documented below +(e.g., \fB:-\fP), +\fBbash\fP tests for a parameter that is unset or null. Omitting the colon +results in a test only for a parameter that is unset. +.PP +.PD 0 +.TP +${\fIparameter\fP\fB:\-\fP\fIword\fP} +\fBUse Default Values\fP. If +.I parameter +is unset or null, the expansion of +.I word +is substituted. Otherwise, the value of +.I parameter +is substituted. +.TP +${\fIparameter\fP\fB:=\fP\fIword\fP} +\fBAssign Default Values\fP. +If +.I parameter +is unset or null, the expansion of +.I word +is assigned to +.IR parameter . +The value of +.I parameter +is then substituted. Positional parameters and special parameters may +not be assigned to in this way. +.TP +${\fIparameter\fP\fB:?\fP\fIword\fP} +\fBDisplay Error if Null or Unset\fP. +If +.I parameter +is null or unset, the expansion of \fIword\fP (or a message to that effect +if +.I word +is not present) is written to the standard error and the shell, if it +is not interactive, exits. Otherwise, the value of \fIparameter\fP is +substituted. +.TP +${\fIparameter\fP\fB:+\fP\fIword\fP} +\fBUse Alternate Value\fP. +If +.I parameter +is null or unset, nothing is substituted, otherwise the expansion of +.I word +is substituted. +.TP +${\fIparameter\fP\fB:\fP\fIoffset\fP} +.PD 0 +.TP +${\fIparameter\fP\fB:\fP\fIoffset\fP\fB:\fP\fIlength\fP} +.PD +\fBSubstring Expansion\fP. +Expands to up to \fIlength\fP characters of the value of \fIparameter\fP +starting at the character specified by \fIoffset\fP. +If \fIparameter\fP is \fB@\fP, an indexed array subscripted by +\fB@\fP or \fB*\fP, or an associative array name, the results differ as +described below. +If \fIlength\fP is omitted, expands to the substring of the value of +\fIparameter\fP starting at the character specified by \fIoffset\fP +and extending to the end of the value. +\fIlength\fP and \fIoffset\fP are arithmetic expressions (see +.SM +.B +ARITHMETIC EVALUATION +below). +.sp 1 +If \fIoffset\fP evaluates to a number less than zero, the value +is used as an offset in characters +from the end of the value of \fIparameter\fP. +If \fIlength\fP evaluates to a number less than zero, +it is interpreted as an offset in characters +from the end of the value of \fIparameter\fP rather than +a number of characters, and the expansion is the characters between +\fIoffset\fP and that result. +Note that a negative offset must be separated from the colon by at least +one space to avoid being confused with the \fB:-\fP expansion. +.sp 1 +If \fIparameter\fP is \fB@\fP, the result is \fIlength\fP positional +parameters beginning at \fIoffset\fP. +A negative \fIoffset\fP is taken relative to one greater than the greatest +positional parameter, so an offset of -1 evaluates to the last positional +parameter. +It is an expansion error if \fIlength\fP evaluates to a number less than +zero. +.sp 1 +If \fIparameter\fP is an indexed array name subscripted by @ or *, +the result is the \fIlength\fP +members of the array beginning with ${\fIparameter\fP[\fIoffset\fP]}. +A negative \fIoffset\fP is taken relative to one greater than the maximum +index of the specified array. +It is an expansion error if \fIlength\fP evaluates to a number less than +zero. +.sp 1 +Substring expansion applied to an associative array produces undefined +results. +.sp 1 +Substring indexing is zero-based unless the positional parameters +are used, in which case the indexing starts at 1 by default. +If \fIoffset\fP is 0, and the positional parameters are used, \fB$0\fP is +prefixed to the list. +.TP +${\fB!\fP\fIprefix\fP\fB*\fP} +.PD 0 +.TP +${\fB!\fP\fIprefix\fP\fB@\fP} +.PD +\fBNames matching prefix\fP. +Expands to the names of variables whose names begin with \fIprefix\fP, +separated by the first character of the +.SM +.B IFS +special variable. +When \fI@\fP is used and the expansion appears within double quotes, each +variable name expands to a separate word. +.TP +${\fB!\fP\fIname\fP[\fI@\fP]} +.PD 0 +.TP +${\fB!\fP\fIname\fP[\fI*\fP]} +.PD +\fBList of array keys\fP. +If \fIname\fP is an array variable, expands to the list of array indices +(keys) assigned in \fIname\fP. +If \fIname\fP is not an array, expands to 0 if \fIname\fP is set and null +otherwise. +When \fI@\fP is used and the expansion appears within double quotes, each +key expands to a separate word. +.TP +${\fB#\fP\fIparameter\fP} +\fBParameter length\fP. +The length in characters of the value of \fIparameter\fP is substituted. +If +.I parameter +is +.B * +or +.BR @ , +the value substituted is the number of positional parameters. +If +.I parameter +is an array name subscripted by +.B * +or +.BR @ , +the value substituted is the number of elements in the array. +If +.I parameter +is an indexed array name subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +\fIparameter\fP, so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.TP +${\fIparameter\fP\fB#\fP\fIword\fP} +.PD 0 +.TP +${\fIparameter\fP\fB##\fP\fIword\fP} +.PD +\fBRemove matching prefix pattern\fP. +The +.I word +is expanded to produce a pattern just as in pathname +expansion. If the pattern matches the beginning of +the value of +.IR parameter , +then the result of the expansion is the expanded value of +.I parameter +with the shortest matching pattern (the ``\fB#\fP'' case) or the +longest matching pattern (the ``\fB##\fP'' case) deleted. +If +.I parameter +is +.B @ +or +.BR * , +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB%\fP\fIword\fP} +.PD 0 +.TP +${\fIparameter\fP\fB%%\fP\fIword\fP} +.PD +\fBRemove matching suffix pattern\fP. +The \fIword\fP is expanded to produce a pattern just as in +pathname expansion. +If the pattern matches a trailing portion of the expanded value of +.IR parameter , +then the result of the expansion is the expanded value of +.I parameter +with the shortest matching pattern (the ``\fB%\fP'' case) or the +longest matching pattern (the ``\fB%%\fP'' case) deleted. +If +.I parameter +is +.B @ +or +.BR * , +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB/\fP\fIpattern\fP\fB/\fP\fIstring\fP} +\fBPattern substitution\fP. +The \fIpattern\fP is expanded to produce a pattern just as in +pathname expansion. +\fIParameter\fP is expanded and the longest match of \fIpattern\fP +against its value is replaced with \fIstring\fP. +If \fIpattern\fP begins with \fB/\fP, all matches of \fIpattern\fP are +replaced with \fIstring\fP. Normally only the first match is replaced. +If \fIpattern\fP begins with \fB#\fP, it must match at the beginning +of the expanded value of \fIparameter\fP. +If \fIpattern\fP begins with \fB%\fP, it must match at the end +of the expanded value of \fIparameter\fP. +If \fIstring\fP is null, matches of \fIpattern\fP are deleted +and the \fB/\fP following \fIpattern\fP may be omitted. +If +.I parameter +is +.B @ +or +.BR * , +the substitution operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the substitution operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB^\fP\fIpattern\fP} +.PD 0 +.TP +${\fIparameter\fP\fB^^\fP\fIpattern\fP} +.TP +${\fIparameter\fP\fB,\fP\fIpattern\fP} +.TP +${\fIparameter\fP\fB,,\fP\fIpattern\fP} +.PD +\fBCase modification\fP. +This expansion modifies the case of alphabetic characters in \fIparameter\fP. +The \fIpattern\fP is expanded to produce a pattern just as in +pathname expansion. +Each character in the expanded value of \fIparameter\fP is tested against +\fIpattern\fP, and, if it matches the pattern, its case is converted. +The pattern should not attempt to match more than one character. +The \fB^\fP operator converts lowercase letters matching \fIpattern\fP +to uppercase; the \fB,\fP operator converts matching uppercase letters +to lowercase. +The \fB^^\fP and \fB,,\fP expansions convert each matched character in the +expanded value; the \fB^\fP and \fB,\fP expansions match and convert only +the first character in the expanded value. +If \fIpattern\fP is omitted, it is treated like a \fB?\fP, which matches +every character. +If +.I parameter +is +.B @ +or +.BR * , +the case modification operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the case modification operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.SS Command Substitution +.PP +\fICommand substitution\fP allows the output of a command to replace +the command name. There are two forms: +.RS +.PP +\fB$(\fP\fIcommand\fP\|\fB)\fP +.RE +or +.RS +\fB\`\fP\fIcommand\fP\fB\`\fP +.RE +.PP +.B Bash +performs the expansion by executing \fIcommand\fP and +replacing the command substitution with the standard output of the +command, with any trailing newlines deleted. +Embedded newlines are not deleted, but they may be removed during +word splitting. +The command substitution \fB$(cat \fIfile\fP)\fR can be replaced by +the equivalent but faster \fB$(< \fIfile\fP)\fR. +.PP +When the old-style backquote form of substitution is used, +backslash retains its literal meaning except when followed by +.BR $ , +.BR \` , +or +.BR \e . +The first backquote not preceded by a backslash terminates the +command substitution. +When using the $(\^\fIcommand\fP\|) form, all characters between the +parentheses make up the command; none are treated specially. +.PP +Command substitutions may be nested. To nest when using the backquoted form, +escape the inner backquotes with backslashes. +.PP +If the substitution appears within double quotes, word splitting and +pathname expansion are not performed on the results. +.SS Arithmetic Expansion +.PP +Arithmetic expansion allows the evaluation of an arithmetic expression +and the substitution of the result. The format for arithmetic expansion is: +.RS +.PP +\fB$((\fP\fIexpression\fP\fB))\fP +.RE +.PP +The old format \fB$[\fP\fIexpression\fP\fB]\fP is deprecated and will +be removed in upcoming versions of bash. +.PP +The +.I expression +is treated as if it were within double quotes, but a double quote +inside the parentheses is not treated specially. +All tokens in the expression undergo parameter and variable expansion, +command substitution, and quote removal. +The result is treated as the arithmetic expression to be evaluated. +Arithmetic expansions may be nested. +.PP +The evaluation is performed according to the rules listed below under +.SM +.BR "ARITHMETIC EVALUATION" . +If +.I expression +is invalid, +.B bash +prints a message indicating failure and no substitution occurs. +.SS Process Substitution +.PP +\fIProcess substitution\fP is supported on systems that support named +pipes (\fIFIFOs\fP) or the \fB/dev/fd\fP method of naming open files. +It takes the form of +\fB<(\fP\fIlist\^\fP\fB)\fP +or +\fB>(\fP\fIlist\^\fP\fB)\fP. +The process \fIlist\fP is run with its input or output connected to a +\fIFIFO\fP or some file in \fB/dev/fd\fP. The name of this file is +passed as an argument to the current command as the result of the +expansion. If the \fB>(\fP\fIlist\^\fP\fB)\fP form is used, writing to +the file will provide input for \fIlist\fP. If the +\fB<(\fP\fIlist\^\fP\fB)\fP form is used, the file passed as an +argument should be read to obtain the output of \fIlist\fP. +.PP +When available, process substitution is performed +simultaneously with parameter and variable expansion, +command substitution, +and arithmetic expansion. +.SS Word Splitting +.PP +The shell scans the results of +parameter expansion, +command substitution, +and +arithmetic expansion +that did not occur within double quotes for +.IR "word splitting" . +.PP +The shell treats each character of +.SM +.B IFS +as a delimiter, and splits the results of the other +expansions into words using these characters as field terminators. +If +.SM +.B IFS +is unset, or its +value is exactly +.BR , +the default, then +sequences of +.BR , +.BR , +and +.B +at the beginning and end of the results of the previous +expansions are ignored, and +any sequence of +.SM +.B IFS +characters not at the beginning or end serves to delimit words. +If +.SM +.B IFS +has a value other than the default, then sequences of +the whitespace characters +.B space +and +.B tab +are ignored at the beginning and end of the +word, as long as the whitespace character is in the +value of +.SM +.BR IFS +(an +.SM +.B IFS +whitespace character). +Any character in +.SM +.B IFS +that is not +.SM +.B IFS +whitespace, along with any adjacent +.SM +.B IFS +whitespace characters, delimits a field. +A sequence of +.SM +.B IFS +whitespace characters is also treated as a delimiter. +If the value of +.SM +.B IFS +is null, no word splitting occurs. +.PP +Explicit null arguments (\^\f3"\^"\fP or \^\f3\(aq\^\(aq\fP\^) are retained. +Unquoted implicit null arguments, resulting from the expansion of +parameters that have no values, are removed. +If a parameter with no value is expanded within double quotes, a +null argument results and is retained. +.PP +Note that if no expansion occurs, no splitting +is performed. +.SS Pathname Expansion +.PP +After word splitting, +unless the +.B \-f +option has been set, +.B bash +scans each word for the characters +.BR * , +.BR ? , +and +.BR [ . +If one of these characters appears, then the word is +regarded as a +.IR pattern , +and replaced with an alphabetically sorted list of +filenames matching the pattern +(see +.SM +.B "Pattern Matching" +below). +If no matching filenames are found, +and the shell option +.B nullglob +is not enabled, the word is left unchanged. +If the +.B nullglob +option is set, and no matches are found, +the word is removed. +If the +.B failglob +shell option is set, and no matches are found, an error message +is printed and the command is not executed. +If the shell option +.B nocaseglob +is enabled, the match is performed without regard to the case +of alphabetic characters. +Note that when using range expressions like +[a-z] (see below), letters of the other case may be included, +depending on the setting of +.B LC_COLLATE. +When a pattern is used for pathname expansion, +the character +.B ``.'' +at the start of a name or immediately following a slash +must be matched explicitly, unless the shell option +.B dotglob +is set. +When matching a pathname, the slash character must always be +matched explicitly. +In other cases, the +.B ``.'' +character is not treated specially. +See the description of +.B shopt +below under +.SM +.B SHELL BUILTIN COMMANDS +for a description of the +.BR nocaseglob , +.BR nullglob , +.BR failglob , +and +.B dotglob +shell options. +.PP +The +.SM +.B GLOBIGNORE +shell variable may be used to restrict the set of filenames matching a +.IR pattern . +If +.SM +.B GLOBIGNORE +is set, each matching filename that also matches one of the patterns in +.SM +.B GLOBIGNORE +is removed from the list of matches. +The filenames +.B ``.'' +and +.B ``..'' +are always ignored when +.SM +.B GLOBIGNORE +is set and not null. However, setting +.SM +.B GLOBIGNORE +to a non-null value has the effect of enabling the +.B dotglob +shell option, so all other filenames beginning with a +.B ``.'' +will match. +To get the old behavior of ignoring filenames beginning with a +.BR ``.'' , +make +.B ``.*'' +one of the patterns in +.SM +.BR GLOBIGNORE . +The +.B dotglob +option is disabled when +.SM +.B GLOBIGNORE +is unset. +.PP +\fBPattern Matching\fP +.PP +Any character that appears in a pattern, other than the special pattern +characters described below, matches itself. The NUL character may not +occur in a pattern. A backslash escapes the following character; the +escaping backslash is discarded when matching. +The special pattern characters must be quoted if +they are to be matched literally. +.PP +The special pattern characters have the following meanings: +.PP +.PD 0 +.RS +.TP +.B * +Matches any string, including the null string. +When the \fBglobstar\fP shell option is enabled, and \fB*\fP is used in +a pathname expansion context, two adjacent \fB*\fPs used as a single +pattern will match all files and zero or more directories and +subdirectories. +If followed by a \fB/\fP, two adjacent \fB*\fPs will match only directories +and subdirectories. +.TP +.B ? +Matches any single character. +.TP +.B [...] +Matches any one of the enclosed characters. A pair of characters +separated by a hyphen denotes a +\fIrange expression\fP; +any character that falls between those two characters, inclusive, +using the current locale's collating sequence and character set, +is matched. If the first character following the +.B [ +is a +.B ! +or a +.B ^ +then any character not enclosed is matched. +The sorting order of characters in range expressions is determined by +the current locale and the values of the +.SM +.B LC_COLLATE +or +.SM +.B LC_ALL +shell variables, if set. +To obtain the traditional interpretation of range expressions, where +.B [a\-d] +is equivalent to +.BR [abcd] , +set value of the +.B LC_ALL +shell variable to +.BR C , +or enable the +.B globasciiranges +shell option. +A +.B \- +may be matched by including it as the first or last character +in the set. +A +.B ] +may be matched by including it as the first character +in the set. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +\fIcharacter classes\fP can be specified using the syntax +\fB[:\fP\fIclass\fP\fB:]\fP, where \fIclass\fP is one of the +following classes defined in the POSIX standard: +.PP +.RS +.B +.if n alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit +.if t alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit +.br +A character class matches any character belonging to that class. +The \fBword\fP character class matches letters, digits, and the character _. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +an \fIequivalence class\fP can be specified using the syntax +\fB[=\fP\fIc\fP\fB=]\fP, which matches all characters with the +same collation weight (as defined by the current locale) as +the character \fIc\fP. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +the syntax \fB[.\fP\fIsymbol\fP\fB.]\fP matches the collating symbol +\fIsymbol\fP. +.RE +.RE +.PD +.PP +If the \fBextglob\fP shell option is enabled using the \fBshopt\fP +builtin, several extended pattern matching operators are recognized. +In the following description, a \fIpattern-list\fP is a list of one +or more patterns separated by a \fB|\fP. +Composite patterns may be formed using one or more of the following +sub-patterns: +.sp 1 +.PD 0 +.RS +.TP +\fB?(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches zero or one occurrence of the given patterns +.TP +\fB*(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches zero or more occurrences of the given patterns +.TP +\fB+(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches one or more occurrences of the given patterns +.TP +\fB@(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches one of the given patterns +.TP +\fB!(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches anything except one of the given patterns +.RE +.PD +.SS Quote Removal +.PP +After the preceding expansions, all unquoted occurrences of the +characters +.BR \e , +.BR \(aq , +and \^\f3"\fP\^ that did not result from one of the above +expansions are removed. +.SH REDIRECTION +Before a command is executed, its input and output +may be +.I redirected +using a special notation interpreted by the shell. +Redirection allows commands' file handles to be +duplicated, opened, closed, +made to refer to different files, +and can change the files the command reads from and writes to. +Redirection may also be used to modify file handles in the +current shell execution environment. +The following redirection +operators may precede or appear anywhere within a +.I simple command +or may follow a +.IR command . +Redirections are processed in the order they appear, from +left to right. +.PP +Each redirection that may be preceded by a file descriptor number +may instead be preceded by a word of the form {\fIvarname\fP}. +In this case, for each redirection operator except +>&- and <&-, the shell will allocate a file descriptor greater +than or equal to 10 and assign it to \fIvarname\fP. +If >&- or <&- is preceded +by {\fIvarname\fP}, the value of \fIvarname\fP defines the file +descriptor to close. +.PP +In the following descriptions, if the file descriptor number is +omitted, and the first character of the redirection operator is +.BR < , +the redirection refers to the standard input (file descriptor +0). If the first character of the redirection operator is +.BR > , +the redirection refers to the standard output (file descriptor +1). +.PP +The word following the redirection operator in the following +descriptions, unless otherwise noted, is subjected to +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, quote removal, +pathname expansion, and word splitting. +If it expands to more than one word, +.B bash +reports an error. +.PP +Note that the order of redirections is significant. For example, +the command +.RS +.PP +ls \fB>\fP dirlist 2\fB>&\fP1 +.RE +.PP +directs both standard output and standard error to the file +.IR dirlist , +while the command +.RS +.PP +ls 2\fB>&\fP1 \fB>\fP dirlist +.RE +.PP +directs only the standard output to file +.IR dirlist , +because the standard error was duplicated from the standard output +before the standard output was redirected to +.IR dirlist . +.PP +\fBBash\fP handles several filenames specially when they are used in +redirections, as described in the following table: +.RS +.PP +.PD 0 +.TP +.B /dev/fd/\fIfd\fP +If \fIfd\fP is a valid integer, file descriptor \fIfd\fP is duplicated. +.TP +.B /dev/stdin +File descriptor 0 is duplicated. +.TP +.B /dev/stdout +File descriptor 1 is duplicated. +.TP +.B /dev/stderr +File descriptor 2 is duplicated. +.TP +.B /dev/tcp/\fIhost\fP/\fIport\fP +If \fIhost\fP is a valid hostname or Internet address, and \fIport\fP +is an integer port number or service name, \fBbash\fP attempts to open +the corresponding TCP socket. +.TP +.B /dev/udp/\fIhost\fP/\fIport\fP +If \fIhost\fP is a valid hostname or Internet address, and \fIport\fP +is an integer port number or service name, \fBbash\fP attempts to open +the corresponding UDP socket. +.PD +.RE +.PP +A failure to open or create a file causes the redirection to fail. +.PP +Redirections using file descriptors greater than 9 should be used with +care, as they may conflict with file descriptors the shell uses +internally. +.SS Redirecting Input +.PP +Redirection of input causes the file whose name results from +the expansion of +.I word +to be opened for reading on file descriptor +.IR n , +or the standard input (file descriptor 0) if +.I n +is not specified. +.PP +The general format for redirecting input is: +.RS +.PP +[\fIn\fP]\fB<\fP\fIword\fP +.RE +.SS Redirecting Output +.PP +Redirection of output causes the file whose name results from +the expansion of +.I word +to be opened for writing on file descriptor +.IR n , +or the standard output (file descriptor 1) if +.I n +is not specified. If the file does not exist it is created; +if it does exist it is truncated to zero size. +.PP +The general format for redirecting output is: +.RS +.PP +[\fIn\fP]\fB>\fP\fIword\fP +.RE +.PP +If the redirection operator is +.BR > , +and the +.B noclobber +option to the +.B set +builtin has been enabled, the redirection will fail if the file +whose name results from the expansion of \fIword\fP exists and is +a regular file. +If the redirection operator is +.BR >| , +or the redirection operator is +.B > +and the +.B noclobber +option to the +.B set +builtin command is not enabled, the redirection is attempted even +if the file named by \fIword\fP exists. +.SS Appending Redirected Output +.PP +Redirection of output in this fashion +causes the file whose name results from +the expansion of +.I word +to be opened for appending on file descriptor +.IR n , +or the standard output (file descriptor 1) if +.I n +is not specified. If the file does not exist it is created. +.PP +The general format for appending output is: +.RS +.PP +[\fIn\fP]\fB>>\fP\fIword\fP +.RE +.PP +.SS Redirecting Standard Output and Standard Error +.PP +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be redirected to the file whose name is the +expansion of +.IR word . +.PP +There are two formats for redirecting standard output and +standard error: +.RS +.PP +\fB&>\fP\fIword\fP +.RE +and +.RS +\fB>&\fP\fIword\fP +.RE +.PP +Of the two forms, the first is preferred. +This is semantically equivalent to +.RS +.PP +\fB>\fP\fIword\fP 2\fB>&\fP1 +.RE +.PP +When using the second form, \fIword\fP may not expand to a number or +\fB\-\fP. If it does, other redirection operators apply +(see \fBDuplicating File Descriptors\fP below) for compatibility +reasons. +.SS Appending Standard Output and Standard Error +.PP +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be appended to the file whose name is the +expansion of +.IR word . +.PP +The format for appending standard output and standard error is: +.RS +.PP +\fB&>>\fP\fIword\fP +.RE +.PP +This is semantically equivalent to +.RS +.PP +\fB>>\fP\fIword\fP 2\fB>&\fP1 +.RE +.PP +(see \fBDuplicating File Descriptors\fP below). +.SS Here Documents +.PP +This type of redirection instructs the shell to read input from the +current source until a line containing only +.I delimiter +(with no trailing blanks) +is seen. All of +the lines read up to that point are then used as the standard +input for a command. +.PP +The format of here-documents is: +.RS +.PP +.nf +\fB<<\fP[\fB\-\fP]\fIword\fP + \fIhere-document\fP +\fIdelimiter\fP +.fi +.RE +.PP +No parameter and variable expansion, command substitution, +arithmetic expansion, or pathname expansion is performed on +.IR word . +If any characters in +.I word +are quoted, the +.I delimiter +is the result of quote removal on +.IR word , +and the lines in the here-document are not expanded. +If \fIword\fP is unquoted, +all lines of the here-document are subjected to +parameter expansion, command substitution, and arithmetic expansion, +the character sequence +.B \e +is ignored, and +.B \e +must be used to quote the characters +.BR \e , +.BR $ , +and +.BR \` . +.PP +If the redirection operator is +.BR <<\- , +then all leading tab characters are stripped from input lines and the +line containing +.IR delimiter . +This allows +here-documents within shell scripts to be indented in a +natural fashion. +.SS "Here Strings" +A variant of here documents, the format is: +.RS +.PP +.nf +\fB<<<\fP\fIword\fP +.fi +.RE +.PP +The \fIword\fP undergoes +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote removal. +Pathname expansion and word splitting are not performed. +The result is supplied as a single string to the command on its +standard input. +.SS "Duplicating File Descriptors" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<&\fP\fIword\fP +.RE +.PP +is used to duplicate input file descriptors. +If +.I word +expands to one or more digits, the file descriptor denoted by +.I n +is made to be a copy of that file descriptor. +If the digits in +.I word +do not specify a file descriptor open for input, a redirection error occurs. +If +.I word +evaluates to +.BR \- , +file descriptor +.I n +is closed. If +.I n +is not specified, the standard input (file descriptor 0) is used. +.PP +The operator +.RS +.PP +[\fIn\fP]\fB>&\fP\fIword\fP +.RE +.PP +is used similarly to duplicate output file descriptors. If +.I n +is not specified, the standard output (file descriptor 1) is used. +If the digits in +.I word +do not specify a file descriptor open for output, a redirection error occurs. +If +.I word +evaluates to +.BR \- , +file descriptor +.I n +is closed. +As a special case, if \fIn\fP is omitted, and \fIword\fP does not +expand to one or more digits or \fB\-\fP, the standard output and standard +error are redirected as described previously. +.SS "Moving File Descriptors" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<&\fP\fIdigit\fP\fB\-\fP +.RE +.PP +moves the file descriptor \fIdigit\fP to file descriptor +.IR n , +or the standard input (file descriptor 0) if \fIn\fP is not specified. +\fIdigit\fP is closed after being duplicated to \fIn\fP. +.PP +Similarly, the redirection operator +.RS +.PP +[\fIn\fP]\fB>&\fP\fIdigit\fP\fB\-\fP +.RE +.PP +moves the file descriptor \fIdigit\fP to file descriptor +.IR n , +or the standard output (file descriptor 1) if \fIn\fP is not specified. +.SS "Opening File Descriptors for Reading and Writing" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<>\fP\fIword\fP +.RE +.PP +causes the file whose name is the expansion of +.I word +to be opened for both reading and writing on file descriptor +.IR n , +or on file descriptor 0 if +.I n +is not specified. If the file does not exist, it is created. +.SH ALIASES +\fIAliases\fP allow a string to be substituted for a word when it is used +as the first word of a simple command. +The shell maintains a list of aliases that may be set and unset with the +.B alias +and +.B unalias +builtin commands (see +.SM +.B SHELL BUILTIN COMMANDS +below). +The first word of each simple command, if unquoted, +is checked to see if it has an +alias. If so, that word is replaced by the text of the alias. +The characters \fB/\fP, \fB$\fP, \fB\`\fP, and \fB=\fP and +any of the shell \fImetacharacters\fP or quoting characters +listed above may not appear in an alias name. +The replacement text may contain any valid shell input, +including shell metacharacters. +The first word of the replacement text is tested +for aliases, but a word that is identical to an alias being expanded +is not expanded a second time. +This means that one may alias +.B ls +to +.BR "ls \-F" , +for instance, and +.B bash +does not try to recursively expand the replacement text. +If the last character of the alias value is a +.IR blank , +then the next command +word following the alias is also checked for alias expansion. +.PP +Aliases are created and listed with the +.B alias +command, and removed with the +.B unalias +command. +.PP +There is no mechanism for using arguments in the replacement text. +If arguments are needed, a shell function should be used (see +.SM +.B FUNCTIONS +below). +.PP +Aliases are not expanded when the shell is not interactive, unless +the +.B expand_aliases +shell option is set using +.B shopt +(see the description of +.B shopt +under +.SM +\fBSHELL BUILTIN COMMANDS\fP +below). +.PP +The rules concerning the definition and use of aliases are +somewhat confusing. +.B Bash +always reads at least one complete line +of input before executing any +of the commands on that line. Aliases are expanded when a +command is read, not when it is executed. Therefore, an +alias definition appearing on the same line as another +command does not take effect until the next line of input is read. +The commands following the alias definition +on that line are not affected by the new alias. +This behavior is also an issue when functions are executed. +Aliases are expanded when a function definition is read, +not when the function is executed, because a function definition +is itself a compound command. As a consequence, aliases +defined in a function are not available until after that +function is executed. To be safe, always put +alias definitions on a separate line, and do not use +.B alias +in compound commands. +.PP +For almost every purpose, aliases are superseded by +shell functions. +.SH FUNCTIONS +A shell function, defined as described above under +.SM +.BR "SHELL GRAMMAR" , +stores a series of commands for later execution. +When the name of a shell function is used as a simple command name, +the list of commands associated with that function name is executed. +Functions are executed in the context of the +current shell; no new process is created to interpret +them (contrast this with the execution of a shell script). +When a function is executed, the arguments to the +function become the positional parameters +during its execution. +The special parameter +.B # +is updated to reflect the change. Special parameter \fB0\fP +is unchanged. +The first element of the +.SM +.B FUNCNAME +variable is set to the name of the function while the function +is executing. +.PP +All other aspects of the shell execution +environment are identical between a function and its caller +with these exceptions: the +.SM +.B DEBUG +and +.B RETURN +traps (see the description of the +.B trap +builtin under +.SM +.B SHELL BUILTIN COMMANDS +below) are not inherited unless the function has been given the +\fBtrace\fP attribute (see the description of the +.SM +.B declare +builtin below) or the +\fB\-o functrace\fP shell option has been enabled with +the \fBset\fP builtin +(in which case all functions inherit the \fBDEBUG\fP and \fBRETURN\fP traps), +and the +.SM +.B ERR +trap is not inherited unless the \fB\-o errtrace\fP shell option has +been enabled. +.PP +Variables local to the function may be declared with the +.B local +builtin command. Ordinarily, variables and their values +are shared between the function and its caller. +.PP +The \fBFUNCNEST\fP variable, if set to a numeric value greater +than 0, defines a maximum function nesting level. Function +invocations that exceed the limit cause the entire command to +abort. +.PP +If the builtin command +.B return +is executed in a function, the function completes and +execution resumes with the next command after the function +call. +Any command associated with the \fBRETURN\fP trap is executed +before execution resumes. +When a function completes, the values of the +positional parameters and the special parameter +.B # +are restored to the values they had prior to the function's +execution. +.PP +Function names and definitions may be listed with the +.B \-f +option to the +.B declare +or +.B typeset +builtin commands. The +.B \-F +option to +.B declare +or +.B typeset +will list the function names only +(and optionally the source file and line number, if the \fBextdebug\fP +shell option is enabled). +Functions may be exported so that subshells +automatically have them defined with the +.B \-f +option to the +.B export +builtin. +A function definition may be deleted using the \fB\-f\fP option to +the +.B unset +builtin. +Note that shell functions and variables with the same name may result +in multiple identically-named entries in the environment passed to the +shell's children. +Care should be taken in cases where this may cause a problem. +.PP +Functions may be recursive. +The \fBFUNCNEST\fP variable may be used to limit the depth of the +function call stack and restrict the number of function invocations. +By default, no limit is imposed on the number of recursive calls. +.SH "ARITHMETIC EVALUATION" +The shell allows arithmetic expressions to be evaluated, under +certain circumstances (see the \fBlet\fP and \fBdeclare\fP builtin +commands and \fBArithmetic Expansion\fP). +Evaluation is done in fixed-width integers with no check for overflow, +though division by 0 is trapped and flagged as an error. +The operators and their precedence, associativity, and values +are the same as in the C language. +The following list of operators is grouped into levels of +equal-precedence operators. +The levels are listed in order of decreasing precedence. +.PP +.PD 0 +.TP +.B \fIid\fP++ \fIid\fP\-\- +variable post-increment and post-decrement +.TP +.B ++\fIid\fP \-\-\fIid\fP +variable pre-increment and pre-decrement +.TP +.B \- + +unary minus and plus +.TP +.B ! ~ +logical and bitwise negation +.TP +.B ** +exponentiation +.TP +.B * / % +multiplication, division, remainder +.TP +.B + \- +addition, subtraction +.TP +.B << >> +left and right bitwise shifts +.TP +.B <= >= < > +comparison +.TP +.B == != +equality and inequality +.TP +.B & +bitwise AND +.TP +.B ^ +bitwise exclusive OR +.TP +.B | +bitwise OR +.TP +.B && +logical AND +.TP +.B || +logical OR +.TP +.B \fIexpr\fP?\fIexpr\fP:\fIexpr\fP +conditional operator +.TP +.B = *= /= %= += \-= <<= >>= &= ^= |= +assignment +.TP +.B \fIexpr1\fP , \fIexpr2\fP +comma +.PD +.PP +Shell variables are allowed as operands; parameter expansion is +performed before the expression is evaluated. +Within an expression, shell variables may also be referenced by name +without using the parameter expansion syntax. +A shell variable that is null or unset evaluates to 0 when referenced +by name without using the parameter expansion syntax. +The value of a variable is evaluated as an arithmetic expression +when it is referenced, or when a variable which has been given the +\fIinteger\fP attribute using \fBdeclare -i\fP is assigned a value. +A null value evaluates to 0. +A shell variable need not have its \fIinteger\fP attribute +turned on to be used in an expression. +.PP +Constants with a leading 0 are interpreted as octal numbers. +A leading 0x or 0X denotes hexadecimal. +Otherwise, numbers take the form [\fIbase#\fP]n, where the optional \fIbase\fP +is a decimal number between 2 and 64 representing the arithmetic +base, and \fIn\fP is a number in that base. +If \fIbase#\fP is omitted, then base 10 is used. +When specifying \fIn\fP, +the digits greater< than 9 are represented by the lowercase letters, +the uppercase letters, @, and _, in that order. +If \fIbase\fP is less than or equal to 36, lowercase and uppercase +letters may be used interchangeably to represent numbers between 10 +and 35. +.PP +Operators are evaluated in order of precedence. Sub-expressions in +parentheses are evaluated first and may override the precedence +rules above. +.SH "CONDITIONAL EXPRESSIONS" +Conditional expressions are used by the \fB[[\fP compound command and +the \fBtest\fP and \fB[\fP builtin commands to test file attributes +and perform string and arithmetic comparisons. +Expressions are formed from the following unary or binary primaries. +If any \fIfile\fP argument to one of the primaries is of the form +\fI/dev/fd/n\fP, then file descriptor \fIn\fP is checked. +If the \fIfile\fP argument to one of the primaries is one of +\fI/dev/stdin\fP, \fI/dev/stdout\fP, or \fI/dev/stderr\fP, file +descriptor 0, 1, or 2, respectively, is checked. +.PP +Unless otherwise specified, primaries that operate on files follow symbolic +links and operate on the target of the link, rather than the link itself. +.if t .sp 0.5 +.if n .sp 1 +When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort +lexicographically using the current locale. +The \fBtest\fP command sorts using ASCII ordering. +.sp 1 +.PD 0 +.TP +.B \-a \fIfile\fP +True if \fIfile\fP exists. +.TP +.B \-b \fIfile\fP +True if \fIfile\fP exists and is a block special file. +.TP +.B \-c \fIfile\fP +True if \fIfile\fP exists and is a character special file. +.TP +.B \-d \fIfile\fP +True if \fIfile\fP exists and is a directory. +.TP +.B \-e \fIfile\fP +True if \fIfile\fP exists. +.TP +.B \-f \fIfile\fP +True if \fIfile\fP exists and is a regular file. +.TP +.B \-g \fIfile\fP +True if \fIfile\fP exists and is set-group-id. +.TP +.B \-h \fIfile\fP +True if \fIfile\fP exists and is a symbolic link. +.TP +.B \-k \fIfile\fP +True if \fIfile\fP exists and its ``sticky'' bit is set. +.TP +.B \-p \fIfile\fP +True if \fIfile\fP exists and is a named pipe (FIFO). +.TP +.B \-r \fIfile\fP +True if \fIfile\fP exists and is readable. +.TP +.B \-s \fIfile\fP +True if \fIfile\fP exists and has a size greater than zero. +.TP +.B \-t \fIfd\fP +True if file descriptor +.I fd +is open and refers to a terminal. +.TP +.B \-u \fIfile\fP +True if \fIfile\fP exists and its set-user-id bit is set. +.TP +.B \-w \fIfile\fP +True if \fIfile\fP exists and is writable. +.TP +.B \-x \fIfile\fP +True if \fIfile\fP exists and is executable. +.TP +.B \-G \fIfile\fP +True if \fIfile\fP exists and is owned by the effective group id. +.TP +.B \-L \fIfile\fP +True if \fIfile\fP exists and is a symbolic link. +.TP +.B \-N \fIfile\fP +True if \fIfile\fP exists and has been modified since it was last read. +.TP +.B \-O \fIfile\fP +True if \fIfile\fP exists and is owned by the effective user id. +.TP +.B \-S \fIfile\fP +True if \fIfile\fP exists and is a socket. +.TP +\fIfile1\fP \fB\-ef\fP \fIfile2\fP +True if \fIfile1\fP and \fIfile2\fP refer to the same device and +inode numbers. +.TP +\fIfile1\fP \-\fBnt\fP \fIfile2\fP +True if \fIfile1\fP is newer (according to modification date) than \fIfile2\fP, +or if \fIfile1\fP exists and \fPfile2\fP does not. +.TP +\fIfile1\fP \-\fBot\fP \fIfile2\fP +True if \fIfile1\fP is older than \fIfile2\fP, or if \fIfile2\fP exists +and \fIfile1\fP does not. +.TP +.B \-o \fIoptname\fP +True if the shell option +.I optname +is enabled. +See the list of options under the description of the +.B \-o +option to the +.B set +builtin below. +.TP +.B \-v \fIvarname\fP +True if the shell variable +.I varname +is set (has been assigned a value). +.TP +.B \-R \fIvarname\fP +True if the shell variable +.I varname +is set and is a name reference. +.TP +.B \-z \fIstring\fP +True if the length of \fIstring\fP is zero. +.TP +\fIstring\fP +.PD 0 +.TP +.B \-n \fIstring\fP +.PD +True if the length of +.I string +is non-zero. +.TP +\fIstring1\fP \fB==\fP \fIstring2\fP +.PD 0 +.TP +\fIstring1\fP \fB=\fP \fIstring2\fP +.PD +True if the strings are equal. \fB=\fP should be used +with the \fBtest\fP command for POSIX conformance. +When used with the \fB[[\fP command, this performs pattern matching as +described above (\fBCompound Commands\fP). +.TP +\fIstring1\fP \fB!=\fP \fIstring2\fP +True if the strings are not equal. +.TP +\fIstring1\fP \fB<\fP \fIstring2\fP +True if \fIstring1\fP sorts before \fIstring2\fP lexicographically. +.TP +\fIstring1\fP \fB>\fP \fIstring2\fP +True if \fIstring1\fP sorts after \fIstring2\fP lexicographically. +.TP +.I \fIarg1\fP \fBOP\fP \fIarg2\fP +.SM +.B OP +is one of +.BR \-eq , +.BR \-ne , +.BR \-lt , +.BR \-le , +.BR \-gt , +or +.BR \-ge . +These arithmetic binary operators return true if \fIarg1\fP +is equal to, not equal to, less than, less than or equal to, +greater than, or greater than or equal to \fIarg2\fP, respectively. +.I Arg1 +and +.I arg2 +may be positive or negative integers. +.PD +.SH "SIMPLE COMMAND EXPANSION" +When a simple command is executed, the shell performs the following +expansions, assignments, and redirections, from left to right. +.IP 1. +The words that the parser has marked as variable assignments (those +preceding the command name) and redirections are saved for later +processing. +.IP 2. +The words that are not variable assignments or redirections are +expanded. If any words remain after expansion, the first word +is taken to be the name of the command and the remaining words are +the arguments. +.IP 3. +Redirections are performed as described above under +.SM +.BR REDIRECTION . +.IP 4. +The text after the \fB=\fP in each variable assignment undergoes tilde +expansion, parameter expansion, command substitution, arithmetic expansion, +and quote removal before being assigned to the variable. +.PP +If no command name results, the variable assignments affect the current +shell environment. Otherwise, the variables are added to the environment +of the executed command and do not affect the current shell environment. +If any of the assignments attempts to assign a value to a readonly variable, +an error occurs, and the command exits with a non-zero status. +.PP +If no command name results, redirections are performed, but do not +affect the current shell environment. A redirection error causes the +command to exit with a non-zero status. +.PP +If there is a command name left after expansion, execution proceeds as +described below. Otherwise, the command exits. If one of the expansions +contained a command substitution, the exit status of the command is +the exit status of the last command substitution performed. If there +were no command substitutions, the command exits with a status of zero. +.SH "COMMAND EXECUTION" +After a command has been split into words, if it results in a +simple command and an optional list of arguments, the following +actions are taken. +.PP +If the command name contains no slashes, the shell attempts to +locate it. If there exists a shell function by that name, that +function is invoked as described above in +.SM +.BR FUNCTIONS . +If the name does not match a function, the shell searches for +it in the list of shell builtins. If a match is found, that +builtin is invoked. +.PP +If the name is neither a shell function nor a builtin, +and contains no slashes, +.B bash +searches each element of the +.SM +.B PATH +for a directory containing an executable file by that name. +.B Bash +uses a hash table to remember the full pathnames of executable +files (see +.B hash +under +.SM +.B "SHELL BUILTIN COMMANDS" +below). +A full search of the directories in +.SM +.B PATH +is performed only if the command is not found in the hash table. +If the search is unsuccessful, the shell searches for a defined shell +function named \fBcommand_not_found_handle\fP. +If that function exists, it is invoked with the original command and +the original command's arguments as its arguments, and the function's +exit status becomes the exit status of the shell. +If that function is not defined, the shell prints an error +message and returns an exit status of 127. +.PP +If the search is successful, or if the command name contains +one or more slashes, the shell executes the named program in a +separate execution environment. +Argument 0 is set to the name given, and the remaining arguments +to the command are set to the arguments given, if any. +.PP +If this execution fails because the file is not in executable +format, and the file is not a directory, it is assumed to be +a \fIshell script\fP, a file +containing shell commands. A subshell is spawned to execute +it. This subshell reinitializes itself, so +that the effect is as if a new shell had been invoked +to handle the script, with the exception that the locations of +commands remembered by the parent (see +.B hash +below under +.SM +\fBSHELL BUILTIN COMMANDS\fP) +are retained by the child. +.PP +If the program is a file beginning with +.BR #! , +the remainder of the first line specifies an interpreter +for the program. The shell executes the +specified interpreter on operating systems that do not +handle this executable format themselves. The arguments to the +interpreter consist of a single optional argument following the +interpreter name on the first line of the program, followed +by the name of the program, followed by the command +arguments, if any. +.SH COMMAND EXECUTION ENVIRONMENT +The shell has an \fIexecution environment\fP, which consists of the +following: +.IP \(bu +open files inherited by the shell at invocation, as modified by +redirections supplied to the \fBexec\fP builtin +.IP \(bu +the current working directory as set by \fBcd\fP, \fBpushd\fP, or +\fBpopd\fP, or inherited by the shell at invocation +.IP \(bu +the file creation mode mask as set by \fBumask\fP or inherited from +the shell's parent +.IP \(bu +current traps set by \fBtrap\fP +.IP \(bu +shell parameters that are set by variable assignment or with \fBset\fP +or inherited from the shell's parent in the environment +.IP \(bu +shell functions defined during execution or inherited from the shell's +parent in the environment +.IP \(bu +options enabled at invocation (either by default or with command-line +arguments) or by \fBset\fP +.IP \(bu +options enabled by \fBshopt\fP +.IP \(bu +shell aliases defined with \fBalias\fP +.IP \(bu +various process IDs, including those of background jobs, the value +of \fB$$\fP, and the value of +.SM +.B PPID +.PP +When a simple command other than a builtin or shell function +is to be executed, it +is invoked in a separate execution environment that consists of +the following. Unless otherwise noted, the values are inherited +from the shell. +.if n .sp 1 +.IP \(bu +the shell's open files, plus any modifications and additions specified +by redirections to the command +.IP \(bu +the current working directory +.IP \(bu +the file creation mode mask +.IP \(bu +shell variables and functions marked for export, along with variables +exported for the command, passed in the environment +.IP \(bu +traps caught by the shell are reset to the values inherited from the +shell's parent, and traps ignored by the shell are ignored +.PP +A command invoked in this separate environment cannot affect the +shell's execution environment. +.PP +Command substitution, commands grouped with parentheses, +and asynchronous commands are invoked in a +subshell environment that is a duplicate of the shell environment, +except that traps caught by the shell are reset to the values +that the shell inherited from its parent at invocation. Builtin +commands that are invoked as part of a pipeline are also executed in a +subshell environment. Changes made to the subshell environment +cannot affect the shell's execution environment. +.PP +Subshells spawned to execute command substitutions inherit the value of +the \fB\-e\fP option from the parent shell. When not in \fIposix\fP mode, +\fBbash\fP clears the \fB\-e\fP option in such subshells. +.PP +If a command is followed by a \fB&\fP and job control is not active, the +default standard input for the command is the empty file \fI/dev/null\fP. +Otherwise, the invoked command inherits the file descriptors of the calling +shell as modified by redirections. +.SH ENVIRONMENT +When a program is invoked it is given an array of strings +called the +.IR environment . +This is a list of +\fIname\fP\-\fIvalue\fP pairs, of the form +.IR "name\fR=\fPvalue" . +.PP +The shell provides several ways to manipulate the environment. +On invocation, the shell scans its own environment and +creates a parameter for each name found, automatically marking +it for +.I export +to child processes. Executed commands inherit the environment. +The +.B export +and +.B declare \-x +commands allow parameters and functions to be added to and +deleted from the environment. If the value of a parameter +in the environment is modified, the new value becomes part +of the environment, replacing the old. The environment +inherited by any executed command consists of the shell's +initial environment, whose values may be modified in the shell, +less any pairs removed by the +.B unset +command, plus any additions via the +.B export +and +.B declare \-x +commands. +.PP +The environment for any +.I simple command +or function may be augmented temporarily by prefixing it with +parameter assignments, as described above in +.SM +.BR PARAMETERS . +These assignment statements affect only the environment seen +by that command. +.PP +If the +.B \-k +option is set (see the +.B set +builtin command below), then +.I all +parameter assignments are placed in the environment for a command, +not just those that precede the command name. +.PP +When +.B bash +invokes an external command, the variable +.B _ +is set to the full filename of the command and passed to that +command in its environment. +.SH "EXIT STATUS" +.PP +The exit status of an executed command is the value returned by the +\fIwaitpid\fP system call or equivalent function. Exit statuses +fall between 0 and 255, though, as explained below, the shell may +use values above 125 specially. Exit statuses from shell builtins and +compound commands are also limited to this range. Under certain +circumstances, the shell will use special values to indicate specific +failure modes. +.PP +For the shell's purposes, a command which exits with a +zero exit status has succeeded. An exit status of zero +indicates success. A non-zero exit status indicates failure. +When a command terminates on a fatal signal \fIN\fP, \fBbash\fP uses +the value of 128+\fIN\fP as the exit status. +.PP +If a command is not found, the child process created to +execute it returns a status of 127. If a command is found +but is not executable, the return status is 126. +.PP +If a command fails because of an error during expansion or redirection, +the exit status is greater than zero. +.PP +Shell builtin commands return a status of 0 (\fItrue\fP) if +successful, and non-zero (\fIfalse\fP) if an error occurs +while they execute. +All builtins return an exit status of 2 to indicate incorrect usage. +.PP +\fBBash\fP itself returns the exit status of the last command +executed, unless a syntax error occurs, in which case it exits +with a non-zero value. See also the \fBexit\fP builtin +command below. +.SH SIGNALS +When \fBbash\fP is interactive, in the absence of any traps, it ignores +.SM +.B SIGTERM +(so that \fBkill 0\fP does not kill an interactive shell), +and +.SM +.B SIGINT +is caught and handled (so that the \fBwait\fP builtin is interruptible). +In all cases, \fBbash\fP ignores +.SM +.BR SIGQUIT . +If job control is in effect, +.B bash +ignores +.SM +.BR SIGTTIN , +.SM +.BR SIGTTOU , +and +.SM +.BR SIGTSTP . +.PP +Non-builtin commands run by \fBbash\fP have signal handlers +set to the values inherited by the shell from its parent. +When job control is not in effect, asynchronous commands +ignore +.SM +.B SIGINT +and +.SM +.B SIGQUIT +in addition to these inherited handlers. +Commands run as a result of command substitution ignore the +keyboard-generated job control signals +.SM +.BR SIGTTIN , +.SM +.BR SIGTTOU , +and +.SM +.BR SIGTSTP . +.PP +The shell exits by default upon receipt of a +.SM +.BR SIGHUP . +Before exiting, an interactive shell resends the +.SM +.B SIGHUP +to all jobs, running or stopped. +Stopped jobs are sent +.SM +.B SIGCONT +to ensure that they receive the +.SM +.BR SIGHUP . +To prevent the shell from +sending the signal to a particular job, it should be removed from the +jobs table with the +.B disown +builtin (see +.SM +.B "SHELL BUILTIN COMMANDS" +below) or marked +to not receive +.SM +.B SIGHUP +using +.BR "disown \-h" . +.PP +If the +.B huponexit +shell option has been set with +.BR shopt , +.B bash +sends a +.SM +.B SIGHUP +to all jobs when an interactive login shell exits. +.PP +If \fBbash\fP is waiting for a command to complete and receives a signal +for which a trap has been set, the trap will not be executed until +the command completes. +When \fBbash\fP is waiting for an asynchronous command via the \fBwait\fP +builtin, the reception of a signal for which a trap has been set will +cause the \fBwait\fP builtin to return immediately with an exit status +greater than 128, immediately after which the trap is executed. +.SH "JOB CONTROL" +.I Job control +refers to the ability to selectively stop (\fIsuspend\fP) +the execution of processes and continue (\fIresume\fP) +their execution at a later point. A user typically employs +this facility via an interactive interface supplied jointly +by the operating system kernel's terminal driver and +.BR bash . +.PP +The shell associates a +.I job +with each pipeline. It keeps a table of currently executing +jobs, which may be listed with the +.B jobs +command. When +.B bash +starts a job asynchronously (in the +.IR background ), +it prints a line that looks like: +.RS +.PP +[1] 25647 +.RE +.PP +indicating that this job is job number 1 and that the process ID +of the last process in the pipeline associated with this job is 25647. +All of the processes in a single pipeline are members of the same job. +.B Bash +uses the +.I job +abstraction as the basis for job control. +.PP +To facilitate the implementation of the user interface to job +control, the operating system maintains the notion of a \fIcurrent terminal +process group ID\fP. Members of this process group (processes whose +process group ID is equal to the current terminal process group ID) +receive keyboard-generated signals such as +.SM +.BR SIGINT . +These processes are said to be in the +.IR foreground . +.I Background +processes are those whose process group ID differs from the terminal's; +such processes are immune to keyboard-generated signals. +Only foreground processes are allowed to read from or, if the +user so specifies with \f(CWstty tostop\fP, write to the +terminal. +Background processes which attempt to read from (write to when +\f(CWstty tostop\fP is in effect) the +terminal are sent a +.SM +.B SIGTTIN (SIGTTOU) +signal by the kernel's terminal driver, +which, unless caught, suspends the process. +.PP +If the operating system on which +.B bash +is running supports +job control, +.B bash +contains facilities to use it. +Typing the +.I suspend +character (typically +.BR ^Z , +Control-Z) while a process is running +causes that process to be stopped and returns control to +.BR bash . +Typing the +.I "delayed suspend" +character (typically +.BR ^Y , +Control-Y) causes the process to be stopped when it +attempts to read input from the terminal, and control to +be returned to +.BR bash . +The user may then manipulate the state of this job, using the +.B bg +command to continue it in the background, the +.B fg +command to continue it in the foreground, or +the +.B kill +command to kill it. A \fB^Z\fP takes effect immediately, +and has the additional side effect of causing pending output +and typeahead to be discarded. +.PP +There are a number of ways to refer to a job in the shell. +The character +.B % +introduces a job specification (\fIjobspec\fP). Job number +.I n +may be referred to as +.BR %n . +A job may also be referred to using a prefix of the name used to +start it, or using a substring that appears in its command line. +For example, +.B %ce +refers to a stopped +.B ce +job. If a prefix matches more than one job, +.B bash +reports an error. Using +.BR %?ce , +on the other hand, refers to any job containing the string +.B ce +in its command line. If the substring matches more than one job, +.B bash +reports an error. The symbols +.B %% +and +.B %+ +refer to the shell's notion of the +.IR "current job" , +which is the last job stopped while it was in +the foreground or started in the background. +The +.I "previous job" +may be referenced using +.BR %\- . +If there is only a single job, \fB%+\fP and \fB%\-\fP can both be used +to refer to that job. +In output pertaining to jobs (e.g., the output of the +.B jobs +command), the current job is always flagged with a +.BR + , +and the previous job with a +.BR \- . +A single % (with no accompanying job specification) also refers to the +current job. +.PP +Simply naming a job can be used to bring it into the +foreground: +.B %1 +is a synonym for +\fB``fg %1''\fP, +bringing job 1 from the background into the foreground. +Similarly, +.B ``%1 &'' +resumes job 1 in the background, equivalent to +\fB``bg %1''\fP. +.PP +The shell learns immediately whenever a job changes state. +Normally, +.B bash +waits until it is about to print a prompt before reporting +changes in a job's status so as to not interrupt +any other output. If the +.B \-b +option to the +.B set +builtin command +is enabled, +.B bash +reports such changes immediately. +Any trap on +.SM +.B SIGCHLD +is executed for each child that exits. +.PP +If an attempt to exit +.B bash +is made while jobs are stopped (or, if the \fBcheckjobs\fP shell option has +been enabled using the \fBshopt\fP builtin, running), the shell prints a +warning message, and, if the \fBcheckjobs\fP option is enabled, lists the +jobs and their statuses. +The +.B jobs +command may then be used to inspect their status. +If a second attempt to exit is made without an intervening command, +the shell does not print another warning, and any stopped +jobs are terminated. +.SH PROMPTING +When executing interactively, +.B bash +displays the primary prompt +.SM +.B PS1 +when it is ready to read a command, and the secondary prompt +.SM +.B PS2 +when it needs more input to complete a command. +.B Bash +allows these prompt strings to be customized by inserting a number of +backslash-escaped special characters that are decoded as follows: +.RS +.PD 0 +.TP +.B \ea +an ASCII bell character (07) +.TP +.B \ed +the date in "Weekday Month Date" format (e.g., "Tue May 26") +.TP +.B \eD{\fIformat\fP} +the \fIformat\fP is passed to \fIstrftime\fP(3) and the result is inserted +into the prompt string; an empty \fIformat\fP results in a locale-specific +time representation. The braces are required +.TP +.B \ee +an ASCII escape character (033) +.TP +.B \eh +the hostname up to the first `.' +.TP +.B \eH +the hostname +.TP +.B \ej +the number of jobs currently managed by the shell +.TP +.B \el +the basename of the shell's terminal device name +.TP +.B \en +newline +.TP +.B \er +carriage return +.TP +.B \es +the name of the shell, the basename of +.B $0 +(the portion following the final slash) +.TP +.B \et +the current time in 24-hour HH:MM:SS format +.TP +.B \eT +the current time in 12-hour HH:MM:SS format +.TP +.B \e@ +the current time in 12-hour am/pm format +.TP +.B \eA +the current time in 24-hour HH:MM format +.TP +.B \eu +the username of the current user +.TP +.B \ev +the version of \fBbash\fP (e.g., 2.00) +.TP +.B \eV +the release of \fBbash\fP, version + patch level (e.g., 2.00.0) +.TP +.B \ew +the current working directory, with +.SM +.B $HOME +abbreviated with a tilde +(uses the value of the +.SM +.B PROMPT_DIRTRIM +variable) +.TP +.B \eW +the basename of the current working directory, with +.SM +.B $HOME +abbreviated with a tilde +.TP +.B \e! +the history number of this command +.TP +.B \e# +the command number of this command +.TP +.B \e$ +if the effective UID is 0, a +.BR # , +otherwise a +.B $ +.TP +.B \e\fInnn\fP +the character corresponding to the octal number \fInnn\fP +.TP +.B \e\e +a backslash +.TP +.B \e[ +begin a sequence of non-printing characters, which could be used to +embed a terminal control sequence into the prompt +.TP +.B \e] +end a sequence of non-printing characters +.PD +.RE +.PP +The command number and the history number are usually different: +the history number of a command is its position in the history +list, which may include commands restored from the history file +(see +.SM +.B HISTORY +below), while the command number is the position in the sequence +of commands executed during the current shell session. +After the string is decoded, it is expanded via +parameter expansion, command substitution, arithmetic +expansion, and quote removal, subject to the value of the +.B promptvars +shell option (see the description of the +.B shopt +command under +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.SH READLINE +This is the library that handles reading input when using an interactive +shell, unless the +.B \-\-noediting +option is given at shell invocation. +Line editing is also used when using the \fB\-e\fP option to the +\fBread\fP builtin. +By default, the line editing commands are similar to those of Emacs. +A vi-style line editing interface is also available. +Line editing can be enabled at any time using the +.B \-o emacs +or +.B \-o vi +options to the +.B set +builtin (see +.SM +.B SHELL BUILTIN COMMANDS +below). +To turn off line editing after the shell is running, use the +.B +o emacs +or +.B +o vi +options to the +.B set +builtin. +.SS "Readline Notation" +.PP +In this section, the Emacs-style notation is used to denote +keystrokes. Control keys are denoted by C\-\fIkey\fR, e.g., C\-n +means Control\-N. Similarly, +.I meta +keys are denoted by M\-\fIkey\fR, so M\-x means Meta\-X. (On keyboards +without a +.I meta +key, M\-\fIx\fP means ESC \fIx\fP, i.e., press the Escape key +then the +.I x +key. This makes ESC the \fImeta prefix\fP. +The combination M\-C\-\fIx\fP means ESC\-Control\-\fIx\fP, +or press the Escape key +then hold the Control key while pressing the +.I x +key.) +.PP +Readline commands may be given numeric +.IR arguments , +which normally act as a repeat count. +Sometimes, however, it is the sign of the argument that is significant. +Passing a negative argument to a command that acts in the forward +direction (e.g., \fBkill\-line\fP) causes that command to act in a +backward direction. +Commands whose behavior with arguments deviates from this are noted +below. +.PP +When a command is described as \fIkilling\fP text, the text +deleted is saved for possible future retrieval +(\fIyanking\fP). The killed text is saved in a +\fIkill ring\fP. Consecutive kills cause the text to be +accumulated into one unit, which can be yanked all at once. +Commands which do not kill text separate the chunks of text +on the kill ring. +.SS "Readline Initialization" +.PP +Readline is customized by putting commands in an initialization +file (the \fIinputrc\fP file). +The name of this file is taken from the value of the +.SM +.B INPUTRC +variable. If that variable is unset, the default is +.IR ~/.inputrc . +When a program which uses the readline library starts up, the +initialization file is read, and the key bindings and variables +are set. +There are only a few basic constructs allowed in the +readline initialization file. +Blank lines are ignored. +Lines beginning with a \fB#\fP are comments. +Lines beginning with a \fB$\fP indicate conditional constructs. +Other lines denote key bindings and variable settings. +.PP +The default key-bindings may be changed with an +.I inputrc +file. +Other programs that use this library may add their own commands +and bindings. +.PP +For example, placing +.RS +.PP +M\-Control\-u: universal\-argument +.RE +or +.RS +C\-Meta\-u: universal\-argument +.RE +into the +.I inputrc +would make M\-C\-u execute the readline command +.IR universal\-argument . +.PP +The following symbolic character names are recognized: +.IR RUBOUT , +.IR DEL , +.IR ESC , +.IR LFD , +.IR NEWLINE , +.IR RET , +.IR RETURN , +.IR SPC , +.IR SPACE , +and +.IR TAB . +.PP +In addition to command names, readline allows keys to be bound +to a string that is inserted when the key is pressed (a \fImacro\fP). +.SS "Readline Key Bindings" +.PP +The syntax for controlling key bindings in the +.I inputrc +file is simple. All that is required is the name of the +command or the text of a macro and a key sequence to which +it should be bound. The name may be specified in one of two ways: +as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP +prefixes, or as a key sequence. +.PP +When using the form \fBkeyname\fP:\^\fIfunction\-name\fP or \fImacro\fP, +.I keyname +is the name of a key spelled out in English. For example: +.sp +.RS +Control-u: universal\-argument +.br +Meta-Rubout: backward-kill-word +.br +Control-o: "> output" +.RE +.LP +In the above example, +.I C\-u +is bound to the function +.BR universal\-argument , +.I M\-DEL +is bound to the function +.BR backward\-kill\-word , +and +.I C\-o +is bound to run the macro +expressed on the right hand side (that is, to insert the text +.if t \f(CW> output\fP +.if n ``> output'' +into the line). +.PP +In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP, +.B keyseq +differs from +.B keyname +above in that strings denoting +an entire key sequence may be specified by placing the sequence +within double quotes. Some GNU Emacs style key escapes can be +used, as in the following example, but the symbolic character names +are not recognized. +.sp +.RS +"\eC\-u": universal\-argument +.br +"\eC\-x\eC\-r": re\-read\-init\-file +.br +"\ee[11~": "Function Key 1" +.RE +.PP +In this example, +.I C\-u +is again bound to the function +.BR universal\-argument . +.I "C\-x C\-r" +is bound to the function +.BR re\-read\-init\-file , +and +.I "ESC [ 1 1 ~" +is bound to insert the text +.if t \f(CWFunction Key 1\fP. +.if n ``Function Key 1''. +.PP +The full set of GNU Emacs style escape sequences is +.RS +.PD 0 +.TP +.B \eC\- +control prefix +.TP +.B \eM\- +meta prefix +.TP +.B \ee +an escape character +.TP +.B \e\e +backslash +.TP +.B \e" +literal " +.TP +.B \e\(aq +literal \(aq +.RE +.PD +.PP +In addition to the GNU Emacs style escape sequences, a second +set of backslash escapes is available: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ed +delete +.TP +.B \ef +form feed +.TP +.B \en +newline +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(one to three digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.RE +.PD +.PP +When entering the text of a macro, single or double quotes must +be used to indicate a macro definition. +Unquoted text is assumed to be a function name. +In the macro body, the backslash escapes described above are expanded. +Backslash will quote any other character in the macro text, +including " and \(aq. +.PP +.B Bash +allows the current readline key bindings to be displayed or modified +with the +.B bind +builtin command. The editing mode may be switched during interactive +use by using the +.B \-o +option to the +.B set +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SS "Readline Variables" +.PP +Readline has variables that can be used to further customize its +behavior. A variable may be set in the +.I inputrc +file with a statement of the form +.RS +.PP +\fBset\fP \fIvariable\-name\fP \fIvalue\fP +.RE +.PP +Except where noted, readline variables can take the values +.B On +or +.B Off +(without regard to case). +Unrecognized variable names are ignored. +When a variable value is read, empty or null values, "on" (case-insensitive), +and "1" are equivalent to \fBOn\fP. All other values are equivalent to +\fBOff\fP. +The variables and their default values are: +.PP +.PD 0 +.TP +.B bell\-style (audible) +Controls what happens when readline wants to ring the terminal bell. +If set to \fBnone\fP, readline never rings the bell. If set to +\fBvisible\fP, readline uses a visible bell if one is available. +If set to \fBaudible\fP, readline attempts to ring the terminal's bell. +.TP +.B bind\-tty\-special\-chars (On) +If set to \fBOn\fP, readline attempts to bind the control characters +treated specially by the kernel's terminal driver to their readline +equivalents. +.TP +.B colored\-stats (Off) +If set to \fBOn\fP, readline displays possible completions using different +colors to indicate their file type. +The color definitions are taken from the value of the \fBLS_COLORS\fP +environment variable. +.TP +.B comment\-begin (``#'') +The string that is inserted when the readline +.B insert\-comment +command is executed. +This command is bound to +.B M\-# +in emacs mode and to +.B # +in vi command mode. +.TP +.B completion\-ignore\-case (Off) +If set to \fBOn\fP, readline performs filename matching and completion +in a case\-insensitive fashion. +.TP +.B completion\-prefix\-display\-length (0) +The length in characters of the common prefix of a list of possible +completions that is displayed without modification. When set to a +value greater than zero, common prefixes longer than this value are +replaced with an ellipsis when displaying possible completions. +.TP +.B completion\-query\-items (100) +This determines when the user is queried about viewing +the number of possible completions +generated by the \fBpossible\-completions\fP command. +It may be set to any integer value greater than or equal to +zero. If the number of possible completions is greater than +or equal to the value of this variable, the user is asked whether +or not he wishes to view them; otherwise they are simply listed +on the terminal. +.TP +.B convert\-meta (On) +If set to \fBOn\fP, readline will convert characters with the +eighth bit set to an ASCII key sequence +by stripping the eighth bit and prefixing an +escape character (in effect, using escape as the \fImeta prefix\fP). +.TP +.B disable\-completion (Off) +If set to \fBOn\fP, readline will inhibit word completion. Completion +characters will be inserted into the line as if they had been +mapped to \fBself-insert\fP. +.TP +.B editing\-mode (emacs) +Controls whether readline begins with a set of key bindings similar +to \fIEmacs\fP or \fIvi\fP. +.B editing\-mode +can be set to either +.B emacs +or +.BR vi . +.TP +.B echo\-control\-characters (On) +When set to \fBOn\fP, on operating systems that indicate they support it, +readline echoes a character corresponding to a signal generated from the +keyboard. +.TP +.B enable\-keypad (Off) +When set to \fBOn\fP, readline will try to enable the application +keypad when it is called. Some systems need this to enable the +arrow keys. +.TP +.B enable\-meta\-key (On) +When set to \fBOn\fP, readline will try to enable any meta modifier +key the terminal claims to support when it is called. On many terminals, +the meta key is used to send eight-bit characters. +.TP +.B expand\-tilde (Off) +If set to \fBOn\fP, tilde expansion is performed when readline +attempts word completion. +.TP +.B history\-preserve\-point (Off) +If set to \fBOn\fP, the history code attempts to place point at the +same location on each history line retrieved with \fBprevious-history\fP +or \fBnext-history\fP. +.TP +.B history\-size (0) +Set the maximum number of history entries saved in the history list. +If set to zero, any existing history entries are deleted and no new entries +are saved. +If set to a value less than zero, the number of history entries is not +limited. +By default, the number of history entries is not limited. +.TP +.B horizontal\-scroll\-mode (Off) +When set to \fBOn\fP, makes readline use a single line for display, +scrolling the input horizontally on a single screen line when it +becomes longer than the screen width rather than wrapping to a new line. +.TP +.B input\-meta (Off) +If set to \fBOn\fP, readline will enable eight-bit input (that is, +it will not strip the high bit from the characters it reads), +regardless of what the terminal claims it can support. The name +.B meta\-flag +is a synonym for this variable. +.TP +.B isearch\-terminators (``C\-[C\-J'') +The string of characters that should terminate an incremental +search without subsequently executing the character as a command. +If this variable has not been given a value, the characters +\fIESC\fP and \fIC\-J\fP will terminate an incremental search. +.TP +.B keymap (emacs) +Set the current readline keymap. The set of valid keymap names is +\fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi, +vi\-command\fP, and +.IR vi\-insert . +\fIvi\fP is equivalent to \fIvi\-command\fP; \fIemacs\fP is +equivalent to \fIemacs\-standard\fP. The default value is +.IR emacs ; +the value of +.B editing\-mode +also affects the default keymap. +.TP +.B keyseq\-timeout (500) +Specifies the duration \fIreadline\fP will wait for a character when reading an +ambiguous key sequence (one that can form a complete key sequence using +the input read so far, or can take additional input to complete a longer +key sequence). +If no input is received within the timeout, \fIreadline\fP will use the shorter +but complete key sequence. +The value is specified in milliseconds, so a value of 1000 means that +\fIreadline\fP will wait one second for additional input. +If this variable is set to a value less than or equal to zero, or to a +non-numeric value, \fIreadline\fP will wait until another key is pressed to +decide which key sequence to complete. +.TP +.B mark\-directories (On) +If set to \fBOn\fP, completed directory names have a slash +appended. +.TP +.B mark\-modified\-lines (Off) +If set to \fBOn\fP, history lines that have been modified are displayed +with a preceding asterisk (\fB*\fP). +.TP +.B mark\-symlinked\-directories (Off) +If set to \fBOn\fP, completed names which are symbolic links to directories +have a slash appended (subject to the value of +\fBmark\-directories\fP). +.TP +.B match\-hidden\-files (On) +This variable, when set to \fBOn\fP, causes readline to match files whose +names begin with a `.' (hidden files) when performing filename +completion. +If set to \fBOff\fP, the leading `.' must be +supplied by the user in the filename to be completed. +.TP +.B menu\-complete\-display\-prefix (Off) +If set to \fBOn\fP, menu completion displays the common prefix of the +list of possible completions (which may be empty) before cycling through +the list. +.TP +.B output\-meta (Off) +If set to \fBOn\fP, readline will display characters with the +eighth bit set directly rather than as a meta-prefixed escape +sequence. +.TP +.B page\-completions (On) +If set to \fBOn\fP, readline uses an internal \fImore\fP-like pager +to display a screenful of possible completions at a time. +.TP +.B print\-completions\-horizontally (Off) +If set to \fBOn\fP, readline will display completions with matches +sorted horizontally in alphabetical order, rather than down the screen. +.TP +.B revert\-all\-at\-newline (Off) +If set to \fBOn\fP, readline will undo all changes to history lines +before returning when \fBaccept\-line\fP is executed. By default, +history lines may be modified and retain individual undo lists across +calls to \fBreadline\fP. +.TP +.B show\-all\-if\-ambiguous (Off) +This alters the default behavior of the completion functions. If +set to +.BR On , +words which have more than one possible completion cause the +matches to be listed immediately instead of ringing the bell. +.TP +.B show\-all\-if\-unmodified (Off) +This alters the default behavior of the completion functions in +a fashion similar to \fBshow\-all\-if\-ambiguous\fP. +If set to +.BR On , +words which have more than one possible completion without any +possible partial completion (the possible completions don't share +a common prefix) cause the matches to be listed immediately instead +of ringing the bell. +.TP +.B show\-mode\-in\-prompt (Off) +If set to \fBOn\fP, add a character to the beginning of the prompt +indicating the editing mode: emacs (@), vi command (:) or vi +insertion (+). +.TP +.B skip\-completed\-text (Off) +If set to \fBOn\fP, this alters the default completion behavior when +inserting a single match into the line. It's only active when +performing completion in the middle of a word. If enabled, readline +does not insert characters from the completion that match characters +after point in the word being completed, so portions of the word +following the cursor are not duplicated. +.TP +.B visible\-stats (Off) +If set to \fBOn\fP, a character denoting a file's type as reported +by \fIstat\fP(2) is appended to the filename when listing possible +completions. +.PD +.SS "Readline Conditional Constructs" +.PP +Readline implements a facility similar in spirit to the conditional +compilation features of the C preprocessor which allows key +bindings and variable settings to be performed as the result +of tests. There are four parser directives used. +.IP \fB$if\fP +The +.B $if +construct allows bindings to be made based on the +editing mode, the terminal being used, or the application using +readline. The text of the test extends to the end of the line; +no characters are required to isolate it. +.RS +.IP \fBmode\fP +The \fBmode=\fP form of the \fB$if\fP directive is used to test +whether readline is in emacs or vi mode. +This may be used in conjunction +with the \fBset keymap\fP command, for instance, to set bindings in +the \fIemacs\-standard\fP and \fIemacs\-ctlx\fP keymaps only if +readline is starting out in emacs mode. +.IP \fBterm\fP +The \fBterm=\fP form may be used to include terminal-specific +key bindings, perhaps to bind the key sequences output by the +terminal's function keys. The word on the right side of the +.B = +is tested against the both full name of the terminal and the portion +of the terminal name before the first \fB\-\fP. This allows +.I sun +to match both +.I sun +and +.IR sun\-cmd , +for instance. +.IP \fBapplication\fP +The \fBapplication\fP construct is used to include +application-specific settings. Each program using the readline +library sets the \fIapplication name\fP, and an initialization +file can test for a particular value. +This could be used to bind key sequences to functions useful for +a specific program. For instance, the following command adds a +key sequence that quotes the current or previous word in \fBbash\fP: +.sp 1 +.RS +.nf +\fB$if\fP Bash +# Quote the current or previous word +"\eC\-xq": "\eeb\e"\eef\e"" +\fB$endif\fP +.fi +.RE +.RE +.IP \fB$endif\fP +This command, as seen in the previous example, terminates an +\fB$if\fP command. +.IP \fB$else\fP +Commands in this branch of the \fB$if\fP directive are executed if +the test fails. +.IP \fB$include\fP +This directive takes a single filename as an argument and reads commands +and bindings from that file. For example, the following directive +would read \fI/etc/inputrc\fP: +.sp 1 +.RS +.nf +\fB$include\fP \^ \fI/etc/inputrc\fP +.fi +.RE +.SS Searching +.PP +Readline provides commands for searching through the command history +(see +.SM +.B HISTORY +below) for lines containing a specified string. +There are two search modes: +.I incremental +and +.IR non-incremental . +.PP +Incremental searches begin before the user has finished typing the +search string. +As each character of the search string is typed, readline displays +the next entry from the history matching the string typed so far. +An incremental search requires only as many characters as needed to +find the desired history entry. +The characters present in the value of the \fBisearch-terminators\fP +variable are used to terminate an incremental search. +If that variable has not been assigned a value the Escape and +Control-J characters will terminate an incremental search. +Control-G will abort an incremental search and restore the original +line. +When the search is terminated, the history entry containing the +search string becomes the current line. +.PP +To find other matching entries in the history list, type Control-S or +Control-R as appropriate. +This will search backward or forward in the history for the next +entry matching the search string typed so far. +Any other key sequence bound to a readline command will terminate +the search and execute that command. +For instance, a \fInewline\fP will terminate the search and accept +the line, thereby executing the command from the history list. +.PP +Readline remembers the last incremental search string. If two +Control-Rs are typed without any intervening characters defining a +new search string, any remembered search string is used. +.PP +Non-incremental searches read the entire search string before starting +to search for matching history lines. The search string may be +typed by the user or be part of the contents of the current line. +.SS "Readline Command Names" +.PP +The following is a list of the names of the commands and the default +key sequences to which they are bound. +Command names without an accompanying key sequence are unbound by default. +In the following descriptions, \fIpoint\fP refers to the current cursor +position, and \fImark\fP refers to a cursor position saved by the +\fBset\-mark\fP command. +The text between the point and mark is referred to as the \fIregion\fP. +.SS Commands for Moving +.PP +.PD 0 +.TP +.B beginning\-of\-line (C\-a) +Move to the start of the current line. +.TP +.B end\-of\-line (C\-e) +Move to the end of the line. +.TP +.B forward\-char (C\-f) +Move forward a character. +.TP +.B backward\-char (C\-b) +Move back a character. +.TP +.B forward\-word (M\-f) +Move forward to the end of the next word. Words are composed of +alphanumeric characters (letters and digits). +.TP +.B backward\-word (M\-b) +Move back to the start of the current or previous word. +Words are composed of alphanumeric characters (letters and digits). +.TP +.B shell\-forward\-word +Move forward to the end of the next word. +Words are delimited by non-quoted shell metacharacters. +.TP +.B shell\-backward\-word +Move back to the start of the current or previous word. +Words are delimited by non-quoted shell metacharacters. +.TP +.B clear\-screen (C\-l) +Clear the screen leaving the current line at the top of the screen. +With an argument, refresh the current line without clearing the +screen. +.TP +.B redraw\-current\-line +Refresh the current line. +.PD +.SS Commands for Manipulating the History +.PP +.PD 0 +.TP +.B accept\-line (Newline, Return) +Accept the line regardless of where the cursor is. If this line is +non-empty, add it to the history list according to the state of the +.SM +.B HISTCONTROL +variable. If the line is a modified history +line, then restore the history line to its original state. +.TP +.B previous\-history (C\-p) +Fetch the previous command from the history list, moving back in +the list. +.TP +.B next\-history (C\-n) +Fetch the next command from the history list, moving forward in the +list. +.TP +.B beginning\-of\-history (M\-<) +Move to the first line in the history. +.TP +.B end\-of\-history (M\->) +Move to the end of the input history, i.e., the line currently being +entered. +.TP +.B reverse\-search\-history (C\-r) +Search backward starting at the current line and moving `up' through +the history as necessary. This is an incremental search. +.TP +.B forward\-search\-history (C\-s) +Search forward starting at the current line and moving `down' through +the history as necessary. This is an incremental search. +.TP +.B non\-incremental\-reverse\-search\-history (M\-p) +Search backward through the history starting at the current line +using a non-incremental search for a string supplied by the user. +.TP +.B non\-incremental\-forward\-search\-history (M\-n) +Search forward through the history using a non-incremental search for +a string supplied by the user. +.TP +.B history\-search\-forward +Search forward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +.TP +.B history\-search\-backward +Search backward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +.TP +.B yank\-nth\-arg (M\-C\-y) +Insert the first argument to the previous command (usually +the second word on the previous line) at point. +With an argument +.IR n , +insert the \fIn\fPth word from the previous command (the words +in the previous command begin with word 0). A negative argument +inserts the \fIn\fPth word from the end of the previous command. +Once the argument \fIn\fP is computed, the argument is extracted +as if the "!\fIn\fP" history expansion had been specified. +.TP +.B +yank\-last\-arg (M\-.\^, M\-_\^) +Insert the last argument to the previous command (the last word of +the previous history entry). +With a numeric argument, behave exactly like \fByank\-nth\-arg\fP. +Successive calls to \fByank\-last\-arg\fP move back through the history +list, inserting the last word (or the word specified by the argument to +the first call) of each line in turn. +Any numeric argument supplied to these successive calls determines +the direction to move through the history. A negative argument switches +the direction through the history (back or forward). +The history expansion facilities are used to extract the last word, +as if the "!$" history expansion had been specified. +.TP +.B shell\-expand\-line (M\-C\-e) +Expand the line as the shell does. This +performs alias and history expansion as well as all of the shell +word expansions. See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B history\-expand\-line (M\-^) +Perform history expansion on the current line. +See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B magic\-space +Perform history expansion on the current line and insert a space. +See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B alias\-expand\-line +Perform alias expansion on the current line. +See +.SM +.B ALIASES +above for a description of alias expansion. +.TP +.B history\-and\-alias\-expand\-line +Perform history and alias expansion on the current line. +.TP +.B insert\-last\-argument (M\-.\^, M\-_\^) +A synonym for \fByank\-last\-arg\fP. +.TP +.B operate\-and\-get\-next (C\-o) +Accept the current line for execution and fetch the next line +relative to the current line from the history for editing. Any +argument is ignored. +.TP +.B edit\-and\-execute\-command (C\-xC\-e) +Invoke an editor on the current command line, and execute the result as shell +commands. +\fBBash\fP attempts to invoke +.SM +.BR $VISUAL , +.SM +.BR $EDITOR , +and \fIemacs\fP as the editor, in that order. +.PD +.SS Commands for Changing Text +.PP +.PD 0 +.TP +.B \fIend\-of\-file\fP (usually C\-d) +The character indicating end-of-file as set, for example, by +.if t \f(CWstty\fP. +.if n ``stty''. +If this character is read when there are no characters +on the line, and point is at the beginning of the line, Readline +interprets it as the end of input and returns +.SM +.BR EOF . +.TP +.B delete\-char (C\-d) +Delete the character at point. +If this function is bound to the +same character as the tty \fBEOF\fP character, as \fBC\-d\fP +commonly is, see above for the effects. +.TP +.B backward\-delete\-char (Rubout) +Delete the character behind the cursor. When given a numeric argument, +save the deleted text on the kill ring. +.TP +.B forward\-backward\-delete\-char +Delete the character under the cursor, unless the cursor is at the +end of the line, in which case the character behind the cursor is +deleted. +.TP +.B quoted\-insert (C\-q, C\-v) +Add the next character typed to the line verbatim. This is +how to insert characters like \fBC\-q\fP, for example. +.TP +.B tab\-insert (C\-v TAB) +Insert a tab character. +.TP +.B self\-insert (a,\ b,\ A,\ 1,\ !,\ ...) +Insert the character typed. +.TP +.B transpose\-chars (C\-t) +Drag the character before point forward over the character at point, +moving point forward as well. +If point is at the end of the line, then this transposes +the two characters before point. +Negative arguments have no effect. +.TP +.B transpose\-words (M\-t) +Drag the word before point past the word after point, +moving point over that word as well. +If point is at the end of the line, this transposes +the last two words on the line. +.TP +.B upcase\-word (M\-u) +Uppercase the current (or following) word. With a negative argument, +uppercase the previous word, but do not move point. +.TP +.B downcase\-word (M\-l) +Lowercase the current (or following) word. With a negative argument, +lowercase the previous word, but do not move point. +.TP +.B capitalize\-word (M\-c) +Capitalize the current (or following) word. With a negative argument, +capitalize the previous word, but do not move point. +.TP +.B overwrite\-mode +Toggle overwrite mode. With an explicit positive numeric argument, +switches to overwrite mode. With an explicit non-positive numeric +argument, switches to insert mode. This command affects only +\fBemacs\fP mode; \fBvi\fP mode does overwrite differently. +Each call to \fIreadline()\fP starts in insert mode. +In overwrite mode, characters bound to \fBself\-insert\fP replace +the text at point rather than pushing the text to the right. +Characters bound to \fBbackward\-delete\-char\fP replace the character +before point with a space. By default, this command is unbound. +.PD +.SS Killing and Yanking +.PP +.PD 0 +.TP +.B kill\-line (C\-k) +Kill the text from point to the end of the line. +.TP +.B backward\-kill\-line (C\-x Rubout) +Kill backward to the beginning of the line. +.TP +.B unix\-line\-discard (C\-u) +Kill backward from point to the beginning of the line. +The killed text is saved on the kill-ring. +.\" There is no real difference between this and backward-kill-line +.TP +.B kill\-whole\-line +Kill all characters on the current line, no matter where point is. +.TP +.B kill\-word (M\-d) +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as those used by \fBforward\-word\fP. +.TP +.B backward\-kill\-word (M\-Rubout) +Kill the word behind point. +Word boundaries are the same as those used by \fBbackward\-word\fP. +.TP +.B shell\-kill\-word (M\-d) +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as those used by \fBshell\-forward\-word\fP. +.TP +.B shell\-backward\-kill\-word (M\-Rubout) +Kill the word behind point. +Word boundaries are the same as those used by \fBshell\-backward\-word\fP. +.TP +.B unix\-word\-rubout (C\-w) +Kill the word behind point, using white space as a word boundary. +The killed text is saved on the kill-ring. +.TP +.B unix\-filename\-rubout +Kill the word behind point, using white space and the slash character +as the word boundaries. +The killed text is saved on the kill-ring. +.TP +.B delete\-horizontal\-space (M\-\e) +Delete all spaces and tabs around point. +.TP +.B kill\-region +Kill the text in the current region. +.TP +.B copy\-region\-as\-kill +Copy the text in the region to the kill buffer. +.TP +.B copy\-backward\-word +Copy the word before point to the kill buffer. +The word boundaries are the same as \fBbackward\-word\fP. +.TP +.B copy\-forward\-word +Copy the word following point to the kill buffer. +The word boundaries are the same as \fBforward\-word\fP. +.TP +.B yank (C\-y) +Yank the top of the kill ring into the buffer at point. +.TP +.B yank\-pop (M\-y) +Rotate the kill ring, and yank the new top. Only works following +.B yank +or +.BR yank\-pop . +.PD +.SS Numeric Arguments +.PP +.PD 0 +.TP +.B digit\-argument (M\-0, M\-1, ..., M\-\-) +Add this digit to the argument already accumulating, or start a new +argument. M\-\- starts a negative argument. +.TP +.B universal\-argument +This is another way to specify an argument. +If this command is followed by one or more digits, optionally with a +leading minus sign, those digits define the argument. +If the command is followed by digits, executing +.B universal\-argument +again ends the numeric argument, but is otherwise ignored. +As a special case, if this command is immediately followed by a +character that is neither a digit or minus sign, the argument count +for the next command is multiplied by four. +The argument count is initially one, so executing this function the +first time makes the argument count four, a second time makes the +argument count sixteen, and so on. +.PD +.SS Completing +.PP +.PD 0 +.TP +.B complete (TAB) +Attempt to perform completion on the text before point. +.B Bash +attempts completion treating the text as a variable (if the +text begins with \fB$\fP), username (if the text begins with +\fB~\fP), hostname (if the text begins with \fB@\fP), or +command (including aliases and functions) in turn. If none +of these produces a match, filename completion is attempted. +.TP +.B possible\-completions (M\-?) +List the possible completions of the text before point. +.TP +.B insert\-completions (M\-*) +Insert all completions of the text before point +that would have been generated by +\fBpossible\-completions\fP. +.TP +.B menu\-complete +Similar to \fBcomplete\fP, but replaces the word to be completed +with a single match from the list of possible completions. +Repeated execution of \fBmenu\-complete\fP steps through the list +of possible completions, inserting each match in turn. +At the end of the list of completions, the bell is rung +(subject to the setting of \fBbell\-style\fP) +and the original text is restored. +An argument of \fIn\fP moves \fIn\fP positions forward in the list +of matches; a negative argument may be used to move backward +through the list. +This command is intended to be bound to \fBTAB\fP, but is unbound +by default. +.TP +.B menu\-complete\-backward +Identical to \fBmenu\-complete\fP, but moves backward through the list +of possible completions, as if \fBmenu\-complete\fP had been given a +negative argument. This command is unbound by default. +.TP +.B delete\-char\-or\-list +Deletes the character under the cursor if not at the beginning or +end of the line (like \fBdelete\-char\fP). +If at the end of the line, behaves identically to +\fBpossible\-completions\fP. +This command is unbound by default. +.TP +.B complete\-filename (M\-/) +Attempt filename completion on the text before point. +.TP +.B possible\-filename\-completions (C\-x /) +List the possible completions of the text before point, +treating it as a filename. +.TP +.B complete\-username (M\-~) +Attempt completion on the text before point, treating +it as a username. +.TP +.B possible\-username\-completions (C\-x ~) +List the possible completions of the text before point, +treating it as a username. +.TP +.B complete\-variable (M\-$) +Attempt completion on the text before point, treating +it as a shell variable. +.TP +.B possible\-variable\-completions (C\-x $) +List the possible completions of the text before point, +treating it as a shell variable. +.TP +.B complete\-hostname (M\-@) +Attempt completion on the text before point, treating +it as a hostname. +.TP +.B possible\-hostname\-completions (C\-x @) +List the possible completions of the text before point, +treating it as a hostname. +.TP +.B complete\-command (M\-!) +Attempt completion on the text before point, treating +it as a command name. Command completion attempts to +match the text against aliases, reserved words, shell +functions, shell builtins, and finally executable filenames, +in that order. +.TP +.B possible\-command\-completions (C\-x !) +List the possible completions of the text before point, +treating it as a command name. +.TP +.B dynamic\-complete\-history (M\-TAB) +Attempt completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +.TP +.B dabbrev\-expand +Attempt menu completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +.TP +.B complete\-into\-braces (M\-{) +Perform filename completion and insert the list of possible completions +enclosed within braces so the list is available to the shell (see +.B Brace Expansion +above). +.PD +.SS Keyboard Macros +.PP +.PD 0 +.TP +.B start\-kbd\-macro (C\-x (\^) +Begin saving the characters typed into the current keyboard macro. +.TP +.B end\-kbd\-macro (C\-x )\^) +Stop saving the characters typed into the current keyboard macro +and store the definition. +.TP +.B call\-last\-kbd\-macro (C\-x e) +Re-execute the last keyboard macro defined, by making the characters +in the macro appear as if typed at the keyboard. +.TP +.B print\-last\-kbd\-macro () +Print the last keyboard macro defined in a format suitable for the +\fIinputrc\fP file. +.PD +.SS Miscellaneous +.PP +.PD 0 +.TP +.B re\-read\-init\-file (C\-x C\-r) +Read in the contents of the \fIinputrc\fP file, and incorporate +any bindings or variable assignments found there. +.TP +.B abort (C\-g) +Abort the current editing command and +ring the terminal's bell (subject to the setting of +.BR bell\-style ). +.TP +.B do\-uppercase\-version (M\-a, M\-b, M\-\fIx\fP, ...) +If the metafied character \fIx\fP is lowercase, run the command +that is bound to the corresponding uppercase character. +.TP +.B prefix\-meta (ESC) +Metafy the next character typed. +.SM +.B ESC +.B f +is equivalent to +.BR Meta\-f . +.TP +.B undo (C\-_, C\-x C\-u) +Incremental undo, separately remembered for each line. +.TP +.B revert\-line (M\-r) +Undo all changes made to this line. This is like executing the +.B undo +command enough times to return the line to its initial state. +.TP +.B tilde\-expand (M\-&) +Perform tilde expansion on the current word. +.TP +.B set\-mark (C\-@, M\-) +Set the mark to the point. If a +numeric argument is supplied, the mark is set to that position. +.TP +.B exchange\-point\-and\-mark (C\-x C\-x) +Swap the point with the mark. The current cursor position is set to +the saved position, and the old cursor position is saved as the mark. +.TP +.B character\-search (C\-]) +A character is read and point is moved to the next occurrence of that +character. A negative count searches for previous occurrences. +.TP +.B character\-search\-backward (M\-C\-]) +A character is read and point is moved to the previous occurrence of that +character. A negative count searches for subsequent occurrences. +.TP +.B skip\-csi\-sequence +Read enough characters to consume a multi-key sequence such as those +defined for keys like Home and End. Such sequences begin with a +Control Sequence Indicator (CSI), usually ESC\-[. If this sequence is +bound to "\e[", keys producing such sequences will have no effect +unless explicitly bound to a readline command, instead of inserting +stray characters into the editing buffer. This is unbound by default, +but usually bound to ESC\-[. +.TP +.B insert\-comment (M\-#) +Without a numeric argument, the value of the readline +.B comment\-begin +variable is inserted at the beginning of the current line. +If a numeric argument is supplied, this command acts as a toggle: if +the characters at the beginning of the line do not match the value +of \fBcomment\-begin\fP, the value is inserted, otherwise +the characters in \fBcomment\-begin\fP are deleted from the beginning of +the line. +In either case, the line is accepted as if a newline had been typed. +The default value of +\fBcomment\-begin\fP causes this command to make the current line +a shell comment. +If a numeric argument causes the comment character to be removed, the line +will be executed by the shell. +.TP +.B glob\-complete\-word (M\-g) +The word before point is treated as a pattern for pathname expansion, +with an asterisk implicitly appended. This pattern is used to +generate a list of matching filenames for possible completions. +.TP +.B glob\-expand\-word (C\-x *) +The word before point is treated as a pattern for pathname expansion, +and the list of matching filenames is inserted, replacing the word. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +.TP +.B glob\-list\-expansions (C\-x g) +The list of expansions that would have been generated by +.B glob\-expand\-word +is displayed, and the line is redrawn. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +.TP +.B dump\-functions +Print all of the functions and their key bindings to the +readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B dump\-variables +Print all of the settable readline variables and their values to the +readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B dump\-macros +Print all of the readline key sequences bound to macros and the +strings they output. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B display\-shell\-version (C\-x C\-v) +Display version information about the current instance of +.BR bash . +.PD +.SS Programmable Completion +.PP +When word completion is attempted for an argument to a command for +which a completion specification (a \fIcompspec\fP) has been defined +using the \fBcomplete\fP builtin (see +.SM +.B "SHELL BUILTIN COMMANDS" +below), the programmable completion facilities are invoked. +.PP +First, the command name is identified. +If the command word is the empty string (completion attempted at the +beginning of an empty line), any compspec defined with +the \fB\-E\fP option to \fBcomplete\fP is used. +If a compspec has been defined for that command, the +compspec is used to generate the list of possible completions for the word. +If the command word is a full pathname, a compspec for the full +pathname is searched for first. +If no compspec is found for the full pathname, an attempt is made to +find a compspec for the portion following the final slash. +If those searches do not result in a compspec, any compspec defined with +the \fB\-D\fP option to \fBcomplete\fP is used as the default. +.PP +Once a compspec has been found, it is used to generate the list of +matching words. +If a compspec is not found, the default \fBbash\fP completion as +described above under \fBCompleting\fP is performed. +.PP +First, the actions specified by the compspec are used. +Only matches which are prefixed by the word being completed are +returned. +When the +.B \-f +or +.B \-d +option is used for filename or directory name completion, the shell +variable +.SM +.B FIGNORE +is used to filter the matches. +.PP +Any completions specified by a pathname expansion pattern to the +\fB\-G\fP option are generated next. +The words generated by the pattern need not match the word +being completed. +The +.SM +.B GLOBIGNORE +shell variable is not used to filter the matches, but the +.SM +.B FIGNORE +variable is used. +.PP +Next, the string specified as the argument to the \fB\-W\fP option +is considered. +The string is first split using the characters in the +.SM +.B IFS +special variable as delimiters. +Shell quoting is honored. +Each word is then expanded using +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, and arithmetic expansion, +as described above under +.SM +.BR EXPANSION . +The results are split using the rules described above under +\fBWord Splitting\fP. +The results of the expansion are prefix-matched against the word being +completed, and the matching words become the possible completions. +.PP +After these matches have been generated, any shell function or command +specified with the \fB\-F\fP and \fB\-C\fP options is invoked. +When the command or function is invoked, the +.SM +.BR COMP_LINE , +.SM +.BR COMP_POINT , +.SM +.BR COMP_KEY , +and +.SM +.B COMP_TYPE +variables are assigned values as described above under +\fBShell Variables\fP. +If a shell function is being invoked, the +.SM +.B COMP_WORDS +and +.SM +.B COMP_CWORD +variables are also set. +When the function or command is invoked, +the first argument (\fB$1\fP) is the name of the command whose arguments are +being completed, +the second argument (\fB$2\fP) is the word being completed, +and the third argument (\fB$3\fP) is the word preceding the word being +completed on the current command line. +No filtering of the generated completions against the word being completed +is performed; the function or command has complete freedom in generating +the matches. +.PP +Any function specified with \fB\-F\fP is invoked first. +The function may use any of the shell facilities, including the +\fBcompgen\fP builtin described below, to generate the matches. +It must put the possible completions in the +.SM +.B COMPREPLY +array variable, one per array element. +.PP +Next, any command specified with the \fB\-C\fP option is invoked +in an environment equivalent to command substitution. +It should print a list of completions, one per line, to the +standard output. +Backslash may be used to escape a newline, if necessary. +.PP +After all of the possible completions are generated, any filter +specified with the \fB\-X\fP option is applied to the list. +The filter is a pattern as used for pathname expansion; a \fB&\fP +in the pattern is replaced with the text of the word being completed. +A literal \fB&\fP may be escaped with a backslash; the backslash +is removed before attempting a match. +Any completion that matches the pattern will be removed from the list. +A leading \fB!\fP negates the pattern; in this case any completion +not matching the pattern will be removed. +.PP +Finally, any prefix and suffix specified with the \fB\-P\fP and \fB\-S\fP +options are added to each member of the completion list, and the result is +returned to the readline completion code as the list of possible +completions. +.PP +If the previously-applied actions do not generate any matches, and the +\fB\-o dirnames\fP option was supplied to \fBcomplete\fP when the +compspec was defined, directory name completion is attempted. +.PP +If the \fB\-o plusdirs\fP option was supplied to \fBcomplete\fP when the +compspec was defined, directory name completion is attempted and any +matches are added to the results of the other actions. +.PP +By default, if a compspec is found, whatever it generates is returned +to the completion code as the full set of possible completions. +The default \fBbash\fP completions are not attempted, and the readline +default of filename completion is disabled. +If the \fB\-o bashdefault\fP option was supplied to \fBcomplete\fP when +the compspec was defined, the \fBbash\fP default completions are attempted +if the compspec generates no matches. +If the \fB\-o default\fP option was supplied to \fBcomplete\fP when the +compspec was defined, readline's default completion will be performed +if the compspec (and, if attempted, the default \fBbash\fP completions) +generate no matches. +.PP +When a compspec indicates that directory name completion is desired, +the programmable completion functions force readline to append a slash +to completed names which are symbolic links to directories, subject to +the value of the \fBmark\-directories\fP readline variable, regardless +of the setting of the \fBmark-symlinked\-directories\fP readline variable. +.PP +There is some support for dynamically modifying completions. This is +most useful when used in combination with a default completion specified +with \fBcomplete -D\fP. +It's possible for shell functions executed as completion +handlers to indicate that completion should be retried by returning an +exit status of 124. If a shell function returns 124, and changes +the compspec associated with the command on which completion is being +attempted (supplied as the first argument when the function is executed), +programmable completion restarts from the beginning, with an +attempt to find a new compspec for that command. This allows a set of +completions to be built dynamically as completion is attempted, rather than +being loaded all at once. +.PP +For instance, assuming that there is a library of compspecs, each kept in a +file corresponding to the name of the command, the following default +completion function would load completions dynamically: +.PP +\f(CW_completion_loader() +.br +{ +.br + . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124 +.br +} +.br +complete -D -F _completion_loader -o bashdefault -o default +.br +\fP +.SH HISTORY +When the +.B \-o history +option to the +.B set +builtin is enabled, the shell provides access to the +\fIcommand history\fP, +the list of commands previously typed. +The value of the +.SM +.B HISTSIZE +variable is used as the +number of commands to save in a history list. +The text of the last +.SM +.B HISTSIZE +commands (default 500) is saved. The shell +stores each command in the history list prior to parameter and +variable expansion (see +.SM +.B EXPANSION +above) but after history expansion is performed, subject to the +values of the shell variables +.SM +.B HISTIGNORE +and +.SM +.BR HISTCONTROL . +.PP +On startup, the history is initialized from the file named by +the variable +.SM +.B HISTFILE +(default \fI~/.bash_history\fP). +The file named by the value of +.SM +.B HISTFILE +is truncated, if necessary, to contain no more than +the number of lines specified by the value of +.SM +.BR HISTFILESIZE . +If \fBHISTFILESIZE\fP is unset, or set to null, a non-numeric value, +or a numeric value less than zero, the history file is not truncated. +When the history file is read, +lines beginning with the history comment character followed immediately +by a digit are interpreted as timestamps for the preceding history line. +These timestamps are optionally displayed depending on the value of the +.SM +.B HISTTIMEFORMAT +variable. +When a shell with history enabled exits, the last +.SM +.B $HISTSIZE +lines are copied from the history list to +.SM +.BR $HISTFILE . +If the +.B histappend +shell option is enabled +(see the description of +.B shopt +under +.SM +.B "SHELL BUILTIN COMMANDS" +below), the lines are appended to the history file, +otherwise the history file is overwritten. +If +.SM +.B HISTFILE +is unset, or if the history file is unwritable, the history is +not saved. +If the +.SM +.B HISTTIMEFORMAT +variable is set, time stamps are written to the history file, marked +with the history comment character, so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +After saving the history, the history file is truncated +to contain no more than +.SM +.B HISTFILESIZE +lines. If +.SM +.B HISTFILESIZE +is unset, or set to null, a non-numeric value, +or a numeric value less than zero, the history file is not truncated. +.PP +The builtin command +.B fc +(see +.SM +.B SHELL BUILTIN COMMANDS +below) may be used to list or edit and re-execute a portion of +the history list. +The +.B history +builtin may be used to display or modify the history list and +manipulate the history file. +When using command-line editing, search commands +are available in each editing mode that provide access to the +history list. +.PP +The shell allows control over which commands are saved on the history +list. The +.SM +.B HISTCONTROL +and +.SM +.B HISTIGNORE +variables may be set to cause the shell to save only a subset of the +commands entered. +The +.B cmdhist +shell option, if enabled, causes the shell to attempt to save each +line of a multi-line command in the same history entry, adding +semicolons where necessary to preserve syntactic correctness. +The +.B lithist +shell option causes the shell to save the command with embedded newlines +instead of semicolons. See the description of the +.B shopt +builtin below under +.SM +.B "SHELL BUILTIN COMMANDS" +for information on setting and unsetting shell options. +.SH "HISTORY EXPANSION" +.PP +The shell supports a history expansion feature that +is similar to the history expansion in +.BR csh. +This section describes what syntax features are available. This +feature is enabled by default for interactive shells, and can be +disabled using the +.B +H +option to the +.B set +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). Non-interactive shells do not perform history expansion +by default. +.PP +History expansions introduce words from the history list into +the input stream, making it easy to repeat commands, insert the +arguments to a previous command into the current input line, or +fix errors in previous commands quickly. +.PP +History expansion is performed immediately after a complete line +is read, before the shell breaks it into words. +It takes place in two parts. +The first is to determine which line from the history list +to use during substitution. +The second is to select portions of that line for inclusion into +the current one. +The line selected from the history is the \fIevent\fP, +and the portions of that line that are acted upon are \fIwords\fP. +Various \fImodifiers\fP are available to manipulate the selected words. +The line is broken into words in the same fashion as when reading input, +so that several \fImetacharacter\fP-separated words surrounded by +quotes are considered one word. +History expansions are introduced by the appearance of the +history expansion character, which is \^\fB!\fP\^ by default. +Only backslash (\^\fB\e\fP\^) and single quotes can quote +the history expansion character. +.PP +Several characters inhibit history expansion if found immediately +following the history expansion character, even if it is unquoted: +space, tab, newline, carriage return, and \fB=\fP. +If the \fBextglob\fP shell option is enabled, \fB(\fP will also +inhibit expansion. +.PP +Several shell options settable with the +.B shopt +builtin may be used to tailor the behavior of history expansion. +If the +.B histverify +shell option is enabled (see the description of the +.B shopt +builtin below), and +.B readline +is being used, history substitutions are not immediately passed to +the shell parser. +Instead, the expanded line is reloaded into the +.B readline +editing buffer for further modification. +If +.B readline +is being used, and the +.B histreedit +shell option is enabled, a failed history substitution will be reloaded +into the +.B readline +editing buffer for correction. +The +.B \-p +option to the +.B history +builtin command may be used to see what a history expansion will +do before using it. +The +.B \-s +option to the +.B history +builtin may be used to add commands to the end of the history list +without actually executing them, so that they are available for +subsequent recall. +.PP +The shell allows control of the various characters used by the +history expansion mechanism (see the description of +.B histchars +above under +.BR "Shell Variables" ). +The shell uses +the history comment character to mark history timestamps when +writing the history file. +.SS Event Designators +.PP +An event designator is a reference to a command line entry in the +history list. +Unless the reference is absolute, events are relative to the current +position in the history list. +.PP +.PD 0 +.TP +.B ! +Start a history substitution, except when followed by a +.BR blank , +newline, carriage return, = +or ( (when the \fBextglob\fP shell option is enabled using +the \fBshopt\fP builtin). +.TP +.B !\fIn\fR +Refer to command line +.IR n . +.TP +.B !\-\fIn\fR +Refer to the current command minus +.IR n . +.TP +.B !! +Refer to the previous command. This is a synonym for `!\-1'. +.TP +.B !\fIstring\fR +Refer to the most recent command preceding the current position in the +history list starting with +.IR string . +.TP +.B !?\fIstring\fR\fB[?]\fR +Refer to the most recent command preceding the current position in the +history list containing +.IR string . +The trailing \fB?\fP may be omitted if +.I string +is followed immediately by a newline. +.TP +.B \d\s+2^\s-2\u\fIstring1\fP\d\s+2^\s-2\u\fIstring2\fP\d\s+2^\s-2\u +Quick substitution. Repeat the previous command, replacing +.I string1 +with +.IR string2 . +Equivalent to +``!!:s/\fIstring1\fP/\fIstring2\fP/'' +(see \fBModifiers\fP below). +.TP +.B !# +The entire command line typed so far. +.PD +.SS Word Designators +.PP +Word designators are used to select desired words from the event. +A +.B : +separates the event specification from the word designator. +It may be omitted if the word designator begins with a +.BR ^ , +.BR $ , +.BR * , +.BR \- , +or +.BR % . +Words are numbered from the beginning of the line, +with the first word being denoted by 0 (zero). +Words are inserted into the current line separated by single spaces. +.PP +.PD 0 +.TP +.B 0 (zero) +The zeroth word. For the shell, this is the command +word. +.TP +.I n +The \fIn\fRth word. +.TP +.B ^ +The first argument. That is, word 1. +.TP +.B $ +The last word. This is usually the last argument, but will expand to the +zeroth word if there is only one word in the line. +.TP +.B % +The word matched by the most recent `?\fIstring\fR?' search. +.TP +.I x\fB\-\fPy +A range of words; `\-\fIy\fR' abbreviates `0\-\fIy\fR'. +.TP +.B * +All of the words but the zeroth. This is a synonym +for `\fI1\-$\fP'. It is not an error to use +.B * +if there is just one +word in the event; the empty string is returned in that case. +.TP +.B x* +Abbreviates \fIx\-$\fP. +.TP +.B x\- +Abbreviates \fIx\-$\fP like \fBx*\fP, but omits the last word. +.PD +.PP +If a word designator is supplied without an event specification, the +previous command is used as the event. +.SS Modifiers +.PP +After the optional word designator, there may appear a sequence of +one or more of the following modifiers, each preceded by a `:'. +.PP +.PD 0 +.PP +.TP +.B h +Remove a trailing filename component, leaving only the head. +.TP +.B t +Remove all leading filename components, leaving the tail. +.TP +.B r +Remove a trailing suffix of the form \fI.xxx\fP, leaving the +basename. +.TP +.B e +Remove all but the trailing suffix. +.TP +.B p +Print the new command but do not execute it. +.TP +.B q +Quote the substituted words, escaping further substitutions. +.TP +.B x +Quote the substituted words as with +.BR q , +but break into words at +.B blanks +and newlines. +.TP +.B s/\fIold\fP/\fInew\fP/ +Substitute +.I new +for the first occurrence of +.I old +in the event line. Any delimiter can be used in place of /. The +final delimiter is optional if it is the last character of the +event line. The delimiter may be quoted in +.I old +and +.I new +with a single backslash. If & appears in +.IR new , +it is replaced by +.IR old . +A single backslash will quote the &. If +.I old +is null, it is set to the last +.I old +substituted, or, if no previous history substitutions took place, +the last +.I string +in a +.B !?\fIstring\fR\fB[?]\fR +search. +.TP +.B & +Repeat the previous substitution. +.TP +.B g +Cause changes to be applied over the entire event line. This is +used in conjunction with `\fB:s\fP' (e.g., `\fB:gs/\fIold\fP/\fInew\fP/\fR') +or `\fB:&\fP'. If used with +`\fB:s\fP', any delimiter can be used +in place of /, and the final delimiter is optional +if it is the last character of the event line. +An \fBa\fP may be used as a synonym for \fBg\fP. +.TP +.B G +Apply the following `\fBs\fP' modifier once to each word in the event line. +.PD +.SH "SHELL BUILTIN COMMANDS" +.\" start of bash_builtins +.zZ +.PP +Unless otherwise noted, each builtin command documented in this +section as accepting options preceded by +.B \- +accepts +.B \-\- +to signify the end of the options. +The \fB:\fP, \fBtrue\fP, \fBfalse\fP, and \fBtest\fP builtins +do not accept options and do not treat \fB\-\-\fP specially. +The \fBexit\fP, \fBlogout\fP, \fBbreak\fP, \fBcontinue\fP, \fBlet\fP, +and \fBshift\fP builtins accept and process arguments beginning with +\fB\-\fP without requiring \fB\-\-\fP. +Other builtins that accept arguments but are not specified as accepting +options interpret arguments beginning with \fB\-\fP as invalid options and +require \fB\-\-\fP to prevent this interpretation. +.sp .5 +.PD 0 +.TP +\fB:\fP [\fIarguments\fP] +.PD +No effect; the command does nothing beyond expanding +.I arguments +and performing any specified +redirections. A zero exit code is returned. +.TP +\fB .\| \fP \fIfilename\fP [\fIarguments\fP] +.PD 0 +.TP +\fBsource\fP \fIfilename\fP [\fIarguments\fP] +.PD +Read and execute commands from +.I filename +in the current +shell environment and return the exit status of the last command +executed from +.IR filename . +If +.I filename +does not contain a slash, filenames in +.SM +.B PATH +are used to find the directory containing +.IR filename . +The file searched for in +.SM +.B PATH +need not be executable. +When \fBbash\fP is not in \fIposix mode\fP, the current directory is +searched if no file is found in +.SM +.BR PATH . +If the +.B sourcepath +option to the +.B shopt +builtin command is turned off, the +.SM +.B PATH +is not searched. +If any \fIarguments\fP are supplied, they become the positional +parameters when \fIfilename\fP is executed. Otherwise the positional +parameters are unchanged. +The return status is the status of the last command exited within +the script (0 if no commands are executed), and false if +.I filename +is not found or cannot be read. +.TP +\fBalias\fP [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +\fBAlias\fP with no arguments or with the +.B \-p +option prints the list of aliases in the form +\fBalias\fP \fIname\fP=\fIvalue\fP on standard output. +When arguments are supplied, an alias is defined for +each \fIname\fP whose \fIvalue\fP is given. +A trailing space in \fIvalue\fP causes the next word to be +checked for alias substitution when the alias is expanded. +For each \fIname\fP in the argument list for which no \fIvalue\fP +is supplied, the name and value of the alias is printed. +\fBAlias\fP returns true unless a \fIname\fP is given for which +no alias has been defined. +.TP +\fBbg\fP [\fIjobspec\fP ...] +Resume each suspended job \fIjobspec\fP in the background, as if it +had been started with +.BR & . +If +.I jobspec +is not present, the shell's notion of the \fIcurrent job\fP is used. +.B bg +.I jobspec +returns 0 unless run when job control is disabled or, when run with +job control enabled, any specified \fIjobspec\fP was not found +or was started without job control. +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] [\fB\-lpsvPSVX\fP] +.PD 0 +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] [\fB\-q\fP \fIfunction\fP] [\fB\-u\fP \fIfunction\fP] [\fB\-r\fP \fIkeyseq\fP] +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fB\-f\fP \fIfilename\fP +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fB\-x\fP \fIkeyseq\fP:\fIshell\-command\fP +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fIkeyseq\fP:\fIfunction\-name\fP +.TP +\fBbind\fP \fIreadline\-command\fP +.PD +Display current +.B readline +key and function bindings, bind a key sequence to a +.B readline +function or macro, or set a +.B readline +variable. +Each non-option argument is a command as it would appear in +.IR .inputrc , +but each binding or command must be passed as a separate argument; +e.g., '"\eC\-x\eC\-r": re\-read\-init\-file'. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-m \fIkeymap\fP +Use +.I keymap +as the keymap to be affected by the subsequent bindings. +Acceptable +.I keymap +names are +\fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi, +vi\-move, vi\-command\fP, and +.IR vi\-insert . +\fIvi\fP is equivalent to \fIvi\-command\fP; \fIemacs\fP is +equivalent to \fIemacs\-standard\fP. +.TP +.B \-l +List the names of all \fBreadline\fP functions. +.TP +.B \-p +Display \fBreadline\fP function names and bindings in such a way +that they can be re-read. +.TP +.B \-P +List current \fBreadline\fP function names and bindings. +.TP +.B \-s +Display \fBreadline\fP key sequences bound to macros and the strings +they output in such a way that they can be re-read. +.TP +.B \-S +Display \fBreadline\fP key sequences bound to macros and the strings +they output. +.TP +.B \-v +Display \fBreadline\fP variable names and values in such a way that they +can be re-read. +.TP +.B \-V +List current \fBreadline\fP variable names and values. +.TP +.B \-f \fIfilename\fP +Read key bindings from \fIfilename\fP. +.TP +.B \-q \fIfunction\fP +Query about which keys invoke the named \fIfunction\fP. +.TP +.B \-u \fIfunction\fP +Unbind all keys bound to the named \fIfunction\fP. +.TP +.B \-r \fIkeyseq\fP +Remove any current binding for \fIkeyseq\fP. +.TP +.B \-x \fIkeyseq\fP:\fIshell\-command\fP +Cause \fIshell\-command\fP to be executed whenever \fIkeyseq\fP is +entered. +When \fIshell\-command\fP is executed, the shell sets the +.SM +.B READLINE_LINE +variable to the contents of the \fBreadline\fP line buffer and the +.SM +.B READLINE_POINT +variable to the current location of the insertion point. +If the executed command changes the value of +.SM +.B READLINE_LINE +or +.SM +.BR READLINE_POINT , +those new values will be reflected in the editing state. +.TP +.B \-X +List all key sequences bound to shell commands and the associated commands +in a format that can be reused as input. +.PD +.PP +The return value is 0 unless an unrecognized option is given or an +error occurred. +.RE +.TP +\fBbreak\fP [\fIn\fP] +Exit from within a +.BR for , +.BR while , +.BR until , +or +.B select +loop. If \fIn\fP is specified, break \fIn\fP levels. +.I n +must be \(>= 1. If +.I n +is greater than the number of enclosing loops, all enclosing loops +are exited. +The return value is 0 unless \fIn\fP is not greater than or equal to 1. +.TP +\fBbuiltin\fP \fIshell\-builtin\fP [\fIarguments\fP] +Execute the specified shell builtin, passing it +.IR arguments , +and return its exit status. +This is useful when defining a +function whose name is the same as a shell builtin, +retaining the functionality of the builtin within the function. +The \fBcd\fP builtin is commonly redefined this way. +The return status is false if +.I shell\-builtin +is not a shell builtin command. +.TP +\fBcaller\fP [\fIexpr\fP] +Returns the context of any active subroutine call (a shell function or +a script executed with the \fB.\fP or \fBsource\fP builtins). +Without \fIexpr\fP, \fBcaller\fP displays the line number and source +filename of the current subroutine call. +If a non-negative integer is supplied as \fIexpr\fP, \fBcaller\fP +displays the line number, subroutine name, and source file corresponding +to that position in the current execution call stack. This extra +information may be used, for example, to print a stack trace. The +current frame is frame 0. +The return value is 0 unless the shell is not executing a subroutine +call or \fIexpr\fP does not correspond to a valid position in the +call stack. +.TP +\fBcd\fP [\fB\-L\fP|[\fB\-P\fP [\fB\-e\fP]] [\-@]] [\fIdir\fP] +Change the current directory to \fIdir\fP. +if \fIdir\fP is not supplied, the value of the +.SM +.B HOME +shell variable is the default. +Any additional arguments following \fIdir\fP are ignored. +The variable +.SM +.B CDPATH +defines the search path for the directory containing +.IR dir : +each directory name in +.SM +.B CDPATH +is searched for \fIdir\fP. +Alternative directory names in +.SM +.B CDPATH +are separated by a colon (:). A null directory name in +.SM +.B CDPATH +is the same as the current directory, i.e., ``\fB.\fP''. If +.I dir +begins with a slash (/), +then +.SM +.B CDPATH +is not used. The +.B \-P +option causes \fBcd\fP to use the physical directory structure +by resolving symbolic links while traversing \fIdir\fP and +before processing instances of \fI..\fP in \fIdir\fP (see also the +.B \-P +option to the +.B set +builtin command); the +.B \-L +option forces symbolic links to be followed by resolving the link +after processing instances of \fI..\fP in \fIdir\fP. +If \fI..\fP appears in \fIdir\fP, it is processed by removing the +immediately previous pathname component from \fIdir\fP, back to a slash +or the beginning of \fIdir\fP. +If the +.B \-e +option is supplied with +.BR \-P , +and the current working directory cannot be successfully determined +after a successful directory change, \fBcd\fP will return an unsuccessful +status. +On systems that support it, the \fB\-@\fP option presents the extended +attributes associated with a file as a directory. +An argument of +.B \- +is converted to +.SM +.B $OLDPWD +before the directory change is attempted. +If a non-empty directory name from +.SM +.B CDPATH +is used, or if +\fB\-\fP is the first argument, and the directory change is +successful, the absolute pathname of the new working directory is +written to the standard output. +The return value is true if the directory was successfully changed; +false otherwise. +.TP +\fBcommand\fP [\fB\-pVv\fP] \fIcommand\fP [\fIarg\fP ...] +Run +.I command +with +.I args +suppressing the normal shell function lookup. Only builtin +commands or commands found in the +.SM +.B PATH +are executed. If the +.B \-p +option is given, the search for +.I command +is performed using a default value for +.SM +.B PATH +that is guaranteed to find all of the standard utilities. +If either the +.B \-V +or +.B \-v +option is supplied, a description of +.I command +is printed. The +.B \-v +option causes a single word indicating the command or filename +used to invoke +.I command +to be displayed; the +.B \-V +option produces a more verbose description. +If the +.B \-V +or +.B \-v +option is supplied, the exit status is 0 if +.I command +was found, and 1 if not. If neither option is supplied and +an error occurred or +.I command +cannot be found, the exit status is 127. Otherwise, the exit status of the +.B command +builtin is the exit status of +.IR command . +.TP +\fBcompgen\fP [\fIoption\fP] [\fIword\fP] +Generate possible completion matches for \fIword\fP according to +the \fIoption\fPs, which may be any option accepted by the +.B complete +builtin with the exception of \fB\-p\fP and \fB\-r\fP, and write +the matches to the standard output. +When using the \fB\-F\fP or \fB\-C\fP options, the various shell variables +set by the programmable completion facilities, while available, will not +have useful values. +.sp 1 +The matches will be generated in the same way as if the programmable +completion code had generated them directly from a completion specification +with the same flags. +If \fIword\fP is specified, only those completions matching \fIword\fP +will be displayed. +.sp 1 +The return value is true unless an invalid option is supplied, or no +matches were generated. +.TP +\fBcomplete\fP [\fB\-abcdefgjksuv\fP] [\fB\-o\fP \fIcomp-option\fP] [\fB\-DE\fP] [\fB\-A\fP \fIaction\fP] [\fB\-G\fP \fIglobpat\fP] [\fB\-W\fP \fIwordlist\fP] [\fB\-F\fP \fIfunction\fP] [\fB\-C\fP \fIcommand\fP] +.br +[\fB\-X\fP \fIfilterpat\fP] [\fB\-P\fP \fIprefix\fP] [\fB\-S\fP \fIsuffix\fP] \fIname\fP [\fIname ...\fP] +.PD 0 +.TP +\fBcomplete\fP \fB\-pr\fP [\fB\-DE\fP] [\fIname\fP ...] +.PD +Specify how arguments to each \fIname\fP should be completed. +If the \fB\-p\fP option is supplied, or if no options are supplied, +existing completion specifications are printed in a way that allows +them to be reused as input. +The \fB\-r\fP option removes a completion specification for +each \fIname\fP, or, if no \fIname\fPs are supplied, all +completion specifications. +The \fB\-D\fP option indicates that the remaining options and actions should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The \fB\-E\fP option indicates that the remaining options and actions should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +.sp 1 +The process of applying these completion specifications when word completion +is attempted is described above under \fBProgrammable Completion\fP. +.sp 1 +Other options, if specified, have the following meanings. +The arguments to the \fB\-G\fP, \fB\-W\fP, and \fB\-X\fP options +(and, if necessary, the \fB\-P\fP and \fB\-S\fP options) +should be quoted to protect them from expansion before the +.B complete +builtin is invoked. +.RS +.PD 0 +.TP 8 +\fB\-o\fP \fIcomp-option\fP +The \fIcomp-option\fP controls several aspects of the compspec's behavior +beyond the simple generation of completions. +\fIcomp-option\fP may be one of: +.RS +.TP 8 +.B bashdefault +Perform the rest of the default \fBbash\fP completions if the compspec +generates no matches. +.TP 8 +.B default +Use readline's default filename completion if the compspec generates +no matches. +.TP 8 +.B dirnames +Perform directory name completion if the compspec generates no matches. +.TP 8 +.B filenames +Tell readline that the compspec generates filenames, so it can perform any +filename\-specific processing (like adding a slash to directory names, +quoting special characters, or suppressing trailing spaces). +Intended to be used with shell functions. +.TP 8 +.B noquote +Tell readline not to quote the completed words if they are filenames +(quoting filenames is the default). +.TP 8 +.B nospace +Tell readline not to append a space (the default) to words completed at +the end of the line. +.TP 8 +.B plusdirs +After any matches defined by the compspec are generated, +directory name completion is attempted and any +matches are added to the results of the other actions. +.RE +.TP 8 +\fB\-A\fP \fIaction\fP +The \fIaction\fP may be one of the following to generate a list of possible +completions: +.RS +.TP 8 +.B alias +Alias names. May also be specified as \fB\-a\fP. +.TP 8 +.B arrayvar +Array variable names. +.TP 8 +.B binding +\fBReadline\fP key binding names. +.TP 8 +.B builtin +Names of shell builtin commands. May also be specified as \fB\-b\fP. +.TP 8 +.B command +Command names. May also be specified as \fB\-c\fP. +.TP 8 +.B directory +Directory names. May also be specified as \fB\-d\fP. +.TP 8 +.B disabled +Names of disabled shell builtins. +.TP 8 +.B enabled +Names of enabled shell builtins. +.TP 8 +.B export +Names of exported shell variables. May also be specified as \fB\-e\fP. +.TP 8 +.B file +File names. May also be specified as \fB\-f\fP. +.TP 8 +.B function +Names of shell functions. +.TP 8 +.B group +Group names. May also be specified as \fB\-g\fP. +.TP 8 +.B helptopic +Help topics as accepted by the \fBhelp\fP builtin. +.TP 8 +.B hostname +Hostnames, as taken from the file specified by the +.SM +.B HOSTFILE +shell variable. +.TP 8 +.B job +Job names, if job control is active. May also be specified as \fB\-j\fP. +.TP 8 +.B keyword +Shell reserved words. May also be specified as \fB\-k\fP. +.TP 8 +.B running +Names of running jobs, if job control is active. +.TP 8 +.B service +Service names. May also be specified as \fB\-s\fP. +.TP 8 +.B setopt +Valid arguments for the \fB\-o\fP option to the \fBset\fP builtin. +.TP 8 +.B shopt +Shell option names as accepted by the \fBshopt\fP builtin. +.TP 8 +.B signal +Signal names. +.TP 8 +.B stopped +Names of stopped jobs, if job control is active. +.TP 8 +.B user +User names. May also be specified as \fB\-u\fP. +.TP 8 +.B variable +Names of all shell variables. May also be specified as \fB\-v\fP. +.RE +.TP 8 +\fB\-C\fP \fIcommand\fP +\fIcommand\fP is executed in a subshell environment, and its output is +used as the possible completions. +.TP 8 +\fB\-F\fP \fIfunction\fP +The shell function \fIfunction\fP is executed in the current shell +environment. +When the function is executed, +the first argument (\fB$1\fP) is the name of the command whose arguments are +being completed, +the second argument (\fB$2\fP) is the word being completed, +and the third argument (\fB$3\fP) is the word preceding the word being +completed on the current command line. +When it finishes, the possible completions are retrieved from the value +of the +.SM +.B COMPREPLY +array variable. +.TP 8 +\fB\-G\fP \fIglobpat\fP +The pathname expansion pattern \fIglobpat\fP is expanded to generate +the possible completions. +.TP 8 +\fB\-P\fP \fIprefix\fP +\fIprefix\fP is added at the beginning of each possible completion +after all other options have been applied. +.TP 8 +\fB\-S\fP \fIsuffix\fP +\fIsuffix\fP is appended to each possible completion +after all other options have been applied. +.TP 8 +\fB\-W\fP \fIwordlist\fP +The \fIwordlist\fP is split using the characters in the +.SM +.B IFS +special variable as delimiters, and each resultant word is expanded. +The possible completions are the members of the resultant list which +match the word being completed. +.TP 8 +\fB\-X\fP \fIfilterpat\fP +\fIfilterpat\fP is a pattern as used for pathname expansion. +It is applied to the list of possible completions generated by the +preceding options and arguments, and each completion matching +\fIfilterpat\fP is removed from the list. +A leading \fB!\fP in \fIfilterpat\fP negates the pattern; in this +case, any completion not matching \fIfilterpat\fP is removed. +.PD +.PP +The return value is true unless an invalid option is supplied, an option +other than \fB\-p\fP or \fB\-r\fP is supplied without a \fIname\fP +argument, an attempt is made to remove a completion specification for +a \fIname\fP for which no specification exists, or +an error occurs adding a completion specification. +.RE +.TP +\fBcompopt\fP [\fB\-o\fP \fIoption\fP] [\fB\-DE\fP] [\fB+o\fP \fIoption\fP] [\fIname\fP] +Modify completion options for each \fIname\fP according to the +\fIoption\fPs, or for the +currently-executing completion if no \fIname\fPs are supplied. +If no \fIoption\fPs are given, display the completion options for each +\fIname\fP or the current completion. +The possible values of \fIoption\fP are those valid for the \fBcomplete\fP +builtin described above. +The \fB\-D\fP option indicates that the remaining options should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The \fB\-E\fP option indicates that the remaining options should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +.sp 1 +The return value is true unless an invalid option is supplied, an attempt +is made to modify the options for a \fIname\fP for which no completion +specification exists, or an output error occurs. +.TP +\fBcontinue\fP [\fIn\fP] +Resume the next iteration of the enclosing +.BR for , +.BR while , +.BR until , +or +.B select +loop. +If +.I n +is specified, resume at the \fIn\fPth enclosing loop. +.I n +must be \(>= 1. If +.I n +is greater than the number of enclosing loops, the last enclosing loop +(the ``top-level'' loop) is resumed. +The return value is 0 unless \fIn\fP is not greater than or equal to 1. +.TP +\fBdeclare\fP [\fB\-aAfFgilnrtux\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +.PD 0 +.TP +\fBtypeset\fP [\fB\-aAfFgilnrtux\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +.PD +Declare variables and/or give them attributes. +If no \fIname\fPs are given then display the values of variables. +The +.B \-p +option will display the attributes and values of each +.IR name . +When +.B \-p +is used with \fIname\fP arguments, additional options, +other than \fB\-f\fP and \fB\-F\fP, are ignored. +When +.B \-p +is supplied without \fIname\fP arguments, it will display the attributes +and values of all variables having the attributes specified by the +additional options. +If no other options are supplied with \fB\-p\fP, \fBdeclare\fP will display +the attributes and values of all shell variables. The \fB\-f\fP option +will restrict the display to shell functions. +The +.B \-F +option inhibits the display of function definitions; only the +function name and attributes are printed. +If the \fBextdebug\fP shell option is enabled using \fBshopt\fP, +the source file name and line number where the function is defined +are displayed as well. The +.B \-F +option implies +.BR \-f . +The +.B \-g +option forces variables to be created or modified at the global scope, +even when \fBdeclare\fP is executed in a shell function. +It is ignored in all other cases. +The following options can +be used to restrict output to variables with the specified attribute or +to give variables attributes: +.RS +.PD 0 +.TP +.B \-a +Each \fIname\fP is an indexed array variable (see +.B Arrays +above). +.TP +.B \-A +Each \fIname\fP is an associative array variable (see +.B Arrays +above). +.TP +.B \-f +Use function names only. +.TP +.B \-i +The variable is treated as an integer; arithmetic evaluation (see +.SM +.B "ARITHMETIC EVALUATION" +above) is performed when the variable is assigned a value. +.TP +.B \-l +When the variable is assigned a value, all upper-case characters are +converted to lower-case. +The upper-case attribute is disabled. +.TP +.B \-n +Give each \fIname\fP the \fInameref\fP attribute, making +it a name reference to another variable. +That other variable is defined by the value of \fIname\fP. +All references and assignments to \fIname\fP, except for changing the +\fB\-n\fP attribute itself, are performed on the variable referenced by +\fIname\fP's value. +The \fB\-n\fP attribute cannot be applied to array variables. +.TP +.B \-r +Make \fIname\fPs readonly. These names cannot then be assigned values +by subsequent assignment statements or unset. +.TP +.B \-t +Give each \fIname\fP the \fItrace\fP attribute. +Traced functions inherit the \fBDEBUG\fP and \fBRETURN\fP traps from +the calling shell. +The trace attribute has no special meaning for variables. +.TP +.B \-u +When the variable is assigned a value, all lower-case characters are +converted to upper-case. +The lower-case attribute is disabled. +.TP +.B \-x +Mark \fIname\fPs for export to subsequent commands via the environment. +.PD +.PP +Using `+' instead of `\-' +turns off the attribute instead, +with the exceptions that \fB+a\fP +may not be used to destroy an array variable and \fB+r\fP will not +remove the readonly attribute. +When used in a function, +.B declare +and +.B typeset +make each +\fIname\fP local, as with the +.B local +command, +unless the \fB\-g\fP option is supplied. +If a variable name is followed by =\fIvalue\fP, the value of +the variable is set to \fIvalue\fP. +When using \fB\-a\fP or \fB\-A\fP and the compound assignment syntax to +create array variables, additional attributes do not take effect until +subsequent assignments. +The return value is 0 unless an invalid option is encountered, +an attempt is made to define a function using +.if n ``\-f foo=bar'', +.if t \f(CW\-f foo=bar\fP, +an attempt is made to assign a value to a readonly variable, +an attempt is made to assign a value to an array variable without +using the compound assignment syntax (see +.B Arrays +above), one of the \fInames\fP is not a valid shell variable name, +an attempt is made to turn off readonly status for a readonly variable, +an attempt is made to turn off array status for an array variable, +or an attempt is made to display a non-existent function with \fB\-f\fP. +.RE +.TP +.B dirs [\fB\-clpv\fP] [+\fIn\fP] [\-\fIn\fP] +Without options, displays the list of currently remembered directories. +The default display is on a single line with directory names separated +by spaces. +Directories are added to the list with the +.B pushd +command; the +.B popd +command removes entries from the list. +.RS +.PD 0 +.TP +.B \-c +Clears the directory stack by deleting all of the entries. +.TP +.B \-l +Produces a listing using full pathnames; +the default listing format uses a tilde to denote the home directory. +.TP +.B \-p +Print the directory stack with one entry per line. +.TP +.B \-v +Print the directory stack with one entry per line, +prefixing each entry with its index in the stack. +.TP +\fB+\fP\fIn\fP +Displays the \fIn\fPth entry counting from the left of the list +shown by +.B dirs +when invoked without options, starting with zero. +.TP +\fB\-\fP\fIn\fP +Displays the \fIn\fPth entry counting from the right of the list +shown by +.B dirs +when invoked without options, starting with zero. +.PD +.PP +The return value is 0 unless an +invalid option is supplied or \fIn\fP indexes beyond the end +of the directory stack. +.RE +.TP +\fBdisown\fP [\fB\-ar\fP] [\fB\-h\fP] [\fIjobspec\fP ...] +Without options, remove each +.I jobspec +from the table of active jobs. +If +.I jobspec +is not present, and neither the \fB\-a\fP nor the \fB\-r\fP option +is supplied, the \fIcurrent job\fP is used. +If the \fB\-h\fP option is given, each +.I jobspec +is not removed from the table, but is marked so that +.SM +.B SIGHUP +is not sent to the job if the shell receives a +.SM +.BR SIGHUP . +If no +.I jobspec +is supplied, the +.B \-a +option means to remove or mark all jobs; the +.B \-r +option without a +.I jobspec +argument restricts operation to running jobs. +The return value is 0 unless a +.I jobspec +does not specify a valid job. +.TP +\fBecho\fP [\fB\-neE\fP] [\fIarg\fP ...] +Output the \fIarg\fPs, separated by spaces, followed by a newline. +The return status is 0 unless a write error occurs. +If \fB\-n\fP is specified, the trailing newline is +suppressed. If the \fB\-e\fP option is given, interpretation of +the following backslash-escaped characters is enabled. The +.B \-E +option disables the interpretation of these escape characters, +even on systems where they are interpreted by default. +The \fBxpg_echo\fP shell option may be used to +dynamically determine whether or not \fBecho\fP expands these +escape characters by default. +.B echo +does not interpret \fB\-\-\fP to mean the end of options. +.B echo +interprets the following escape sequences: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ec +suppress further output +.TP +.B \ee +.TP +.B \eE +an escape character +.TP +.B \ef +form feed +.TP +.B \en +new line +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\e +backslash +.TP +.B \e0\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(zero to three octal digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.TP +.B \eu\fIHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHH\fP (one to four hex digits) +.TP +.B \eU\fIHHHHHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHHHHHH\fP (one to eight hex digits) +.PD +.RE +.TP +\fBenable\fP [\fB\-a\fP] [\fB\-dnps\fP] [\fB\-f\fP \fIfilename\fP] [\fIname\fP ...] +Enable and disable builtin shell commands. +Disabling a builtin allows a disk command which has the same name +as a shell builtin to be executed without specifying a full pathname, +even though the shell normally searches for builtins before disk commands. +If \fB\-n\fP is used, each \fIname\fP +is disabled; otherwise, +\fInames\fP are enabled. For example, to use the +.B test +binary found via the +.SM +.B PATH +instead of the shell builtin version, run +.if t \f(CWenable -n test\fP. +.if n ``enable -n test''. +The +.B \-f +option means to load the new builtin command +.I name +from shared object +.IR filename , +on systems that support dynamic loading. The +.B \-d +option will delete a builtin previously loaded with +.BR \-f . +If no \fIname\fP arguments are given, or if the +.B \-p +option is supplied, a list of shell builtins is printed. +With no other option arguments, the list consists of all enabled +shell builtins. +If \fB\-n\fP is supplied, only disabled builtins are printed. +If \fB\-a\fP is supplied, the list printed includes all builtins, with an +indication of whether or not each is enabled. +If \fB\-s\fP is supplied, the output is restricted to the POSIX +\fIspecial\fP builtins. +The return value is 0 unless a +.I name +is not a shell builtin or there is an error loading a new builtin +from a shared object. +.TP +\fBeval\fP [\fIarg\fP ...] +The \fIarg\fPs are read and concatenated together into a single +command. This command is then read and executed by the shell, and +its exit status is returned as the value of +.BR eval . +If there are no +.IR args , +or only null arguments, +.B eval +returns 0. +.TP +\fBexec\fP [\fB\-cl\fP] [\fB\-a\fP \fIname\fP] [\fIcommand\fP [\fIarguments\fP]] +If +.I command +is specified, it replaces the shell. +No new process is created. The +.I arguments +become the arguments to \fIcommand\fP. +If the +.B \-l +option is supplied, +the shell places a dash at the beginning of the zeroth argument passed to +.IR command . +This is what +.IR login (1) +does. The +.B \-c +option causes +.I command +to be executed with an empty environment. If +.B \-a +is supplied, the shell passes +.I name +as the zeroth argument to the executed command. +If +.I command +cannot be executed for some reason, a non-interactive shell exits, +unless the +.B execfail +shell option +is enabled. In that case, it returns failure. +An interactive shell returns failure if the file cannot be executed. +If +.I command +is not specified, any redirections take effect in the current shell, +and the return status is 0. If there is a redirection error, the +return status is 1. +.TP +\fBexit\fP [\fIn\fP] +Cause the shell to exit +with a status of \fIn\fP. If +.I n +is omitted, the exit status +is that of the last command executed. +A trap on +.SM +.B EXIT +is executed before the shell terminates. +.TP +\fBexport\fP [\fB\-fn\fP\^] [\fIname\fP[=\fIword\fP]] ... +.PD 0 +.TP +.B export \-p +.PD +The supplied +.I names +are marked for automatic export to the environment of +subsequently executed commands. If the +.B \-f +option is given, +the +.I names +refer to functions. +If no +.I names +are given, or if the +.B \-p +option is supplied, a list +of names of all exported variables is printed. +The +.B \-n +option causes the export property to be removed from each +\fIname\fP. +If a variable name is followed by =\fIword\fP, the value of +the variable is set to \fIword\fP. +.B export +returns an exit status of 0 unless an invalid option is +encountered, +one of the \fInames\fP is not a valid shell variable name, or +.B \-f +is supplied with a +.I name +that is not a function. +.TP +\fBfc\fP [\fB\-e\fP \fIename\fP] [\fB\-lnr\fP] [\fIfirst\fP] [\fIlast\fP] +.PD 0 +.TP +\fBfc\fP \fB\-s\fP [\fIpat\fP=\fIrep\fP] [\fIcmd\fP] +.PD +The first form selects a range of commands from +.I first +to +.I last +from the history list and displays or edits and re-executes them. +.I First +and +.I last +may be specified as a string (to locate the last command beginning +with that string) or as a number (an index into the history list, +where a negative number is used as an offset from the current +command number). If +.I last +is not specified it is set to +the current command for listing (so that +.if n ``fc \-l \-10'' +.if t \f(CWfc \-l \-10\fP +prints the last 10 commands) and to +.I first +otherwise. +If +.I first +is not specified it is set to the previous +command for editing and \-16 for listing. +.sp 1 +The +.B \-n +option suppresses +the command numbers when listing. The +.B \-r +option reverses the order of +the commands. If the +.B \-l +option is given, +the commands are listed on +standard output. Otherwise, the editor given by +.I ename +is invoked +on a file containing those commands. If +.I ename +is not given, the +value of the +.SM +.B FCEDIT +variable is used, and +the value of +.SM +.B EDITOR +if +.SM +.B FCEDIT +is not set. If neither variable is set, +.FN vi +is used. When editing is complete, the edited commands are +echoed and executed. +.sp 1 +In the second form, \fIcommand\fP is re-executed after each instance +of \fIpat\fP is replaced by \fIrep\fP. +\fICommand\fP is intepreted the same as \fIfirst\fP above. +A useful alias to use with this is +.if n ``r="fc -s"'', +.if t \f(CWr='fc \-s'\fP, +so that typing +.if n ``r cc'' +.if t \f(CWr cc\fP +runs the last command beginning with +.if n ``cc'' +.if t \f(CWcc\fP +and typing +.if n ``r'' +.if t \f(CWr\fP +re-executes the last command. +.sp 1 +If the first form is used, the return value is 0 unless an invalid +option is encountered or +.I first +or +.I last +specify history lines out of range. +If the +.B \-e +option is supplied, the return value is the value of the last +command executed or failure if an error occurs with the temporary +file of commands. If the second form is used, the return status +is that of the command re-executed, unless +.I cmd +does not specify a valid history line, in which case +.B fc +returns failure. +.TP +\fBfg\fP [\fIjobspec\fP] +Resume +.I jobspec +in the foreground, and make it the current job. +If +.I jobspec +is not present, the shell's notion of the \fIcurrent job\fP is used. +The return value is that of the command placed into the foreground, +or failure if run when job control is disabled or, when run with +job control enabled, if +.I jobspec +does not specify a valid job or +.I jobspec +specifies a job that was started without job control. +.TP +\fBgetopts\fP \fIoptstring\fP \fIname\fP [\fIargs\fP] +.B getopts +is used by shell procedures to parse positional parameters. +.I optstring +contains the option characters to be recognized; if a character +is followed by a colon, the option is expected to have an +argument, which should be separated from it by white space. +The colon and question mark characters may not be used as +option characters. +Each time it is invoked, +.B getopts +places the next option in the shell variable +.IR name , +initializing +.I name +if it does not exist, +and the index of the next argument to be processed into the +variable +.SM +.BR OPTIND . +.SM +.B OPTIND +is initialized to 1 each time the shell or a shell script +is invoked. When an option requires an argument, +.B getopts +places that argument into the variable +.SM +.BR OPTARG . +The shell does not reset +.SM +.B OPTIND +automatically; it must be manually reset between multiple +calls to +.B getopts +within the same shell invocation if a new set of parameters +is to be used. +.sp 1 +When the end of options is encountered, \fBgetopts\fP exits with a +return value greater than zero. +.SM +.B OPTIND +is set to the index of the first non-option argument, +and \fIname\fP is set to ?. +.sp 1 +.B getopts +normally parses the positional parameters, but if more arguments are +given in +.IR args , +.B getopts +parses those instead. +.sp 1 +.B getopts +can report errors in two ways. If the first character of +.I optstring +is a colon, +.I silent +error reporting is used. In normal operation, diagnostic messages +are printed when invalid options or missing option arguments are +encountered. +If the variable +.SM +.B OPTERR +is set to 0, no error messages will be displayed, even if the first +character of +.I optstring +is not a colon. +.sp 1 +If an invalid option is seen, +.B getopts +places ? into +.I name +and, if not silent, +prints an error message and unsets +.SM +.BR OPTARG . +If +.B getopts +is silent, +the option character found is placed in +.SM +.B OPTARG +and no diagnostic message is printed. +.sp 1 +If a required argument is not found, and +.B getopts +is not silent, +a question mark (\^\fB?\fP\^) is placed in +.IR name , +.SM +.B OPTARG +is unset, and a diagnostic message is printed. +If +.B getopts +is silent, then a colon (\^\fB:\fP\^) is placed in +.I name +and +.SM +.B OPTARG +is set to the option character found. +.sp 1 +.B getopts +returns true if an option, specified or unspecified, is found. +It returns false if the end of options is encountered or an +error occurs. +.TP +\fBhash\fP [\fB\-lr\fP] [\fB\-p\fP \fIfilename\fP] [\fB\-dt\fP] [\fIname\fP] +Each time \fBhash\fP is invoked, +the full pathname of the command +.I name +is determined by searching +the directories in +.B $PATH +and remembered. Any previously-remembered pathname is discarded. +If the +.B \-p +option is supplied, no path search is performed, and +.I filename +is used as the full filename of the command. +The +.B \-r +option causes the shell to forget all +remembered locations. +The +.B \-d +option causes the shell to forget the remembered location of each \fIname\fP. +If the +.B \-t +option is supplied, the full pathname to which each \fIname\fP corresponds +is printed. If multiple \fIname\fP arguments are supplied with \fB\-t\fP, +the \fIname\fP is printed before the hashed full pathname. +The +.B \-l +option causes output to be displayed in a format that may be reused as input. +If no arguments are given, or if only \fB\-l\fP is supplied, +information about remembered commands is printed. +The return status is true unless a +.I name +is not found or an invalid option is supplied. +.TP +\fBhelp\fP [\fB\-dms\fP] [\fIpattern\fP] +Display helpful information about builtin commands. If +.I pattern +is specified, +.B help +gives detailed help on all commands matching +.IR pattern ; +otherwise help for all the builtins and shell control structures +is printed. +.RS +.PD 0 +.TP +.B \-d +Display a short description of each \fIpattern\fP +.TP +.B \-m +Display the description of each \fIpattern\fP in a manpage-like format +.TP +.B \-s +Display only a short usage synopsis for each \fIpattern\fP +.PD +.PP +The return status is 0 unless no command matches +.IR pattern . +.RE +.TP +\fBhistory [\fIn\fP] +.PD 0 +.TP +\fBhistory\fP \fB\-c\fP +.TP +\fBhistory \-d\fP \fIoffset\fP +.TP +\fBhistory\fP \fB\-anrw\fP [\fIfilename\fP] +.TP +\fBhistory\fP \fB\-p\fP \fIarg\fP [\fIarg ...\fP] +.TP +\fBhistory\fP \fB\-s\fP \fIarg\fP [\fIarg ...\fP] +.PD +With no options, display the command +history list with line numbers. Lines listed +with a +.B * +have been modified. An argument of +.I n +lists only the last +.I n +lines. +If the shell variable +.SM +.B HISTTIMEFORMAT +is set and not null, +it is used as a format string for \fIstrftime\fP(3) to display +the time stamp associated with each displayed history entry. +No intervening blank is printed between the formatted time stamp +and the history line. +If \fIfilename\fP is supplied, it is used as the +name of the history file; if not, the value of +.SM +.B HISTFILE +is used. Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-c +Clear the history list by deleting all the entries. +.TP +\fB\-d\fP \fIoffset\fP +Delete the history entry at position \fIoffset\fP. +.TP +.B \-a +Append the ``new'' history lines (history lines entered since the +beginning of the current \fBbash\fP session) to the history file. +.TP +.B \-n +Read the history lines not already read from the history +file into the current history list. These are lines +appended to the history file since the beginning of the +current \fBbash\fP session. +.TP +.B \-r +Read the contents of the history file +and append them to the current history list. +.TP +.B \-w +Write the current history list to the history file, overwriting the +history file's contents. +.TP +.B \-p +Perform history substitution on the following \fIargs\fP and display +the result on the standard output. +Does not store the results in the history list. +Each \fIarg\fP must be quoted to disable normal history expansion. +.TP +.B \-s +Store the +.I args +in the history list as a single entry. The last command in the +history list is removed before the +.I args +are added. +.PD +.PP +If the +.SM +.B HISTTIMEFORMAT +variable is set, the time stamp information +associated with each history entry is written to the history file, +marked with the history comment character. +When the history file is read, lines beginning with the history +comment character followed immediately by a digit are interpreted +as timestamps for the previous history line. +The return value is 0 unless an invalid option is encountered, an +error occurs while reading or writing the history file, an invalid +\fIoffset\fP is supplied as an argument to \fB\-d\fP, or the +history expansion supplied as an argument to \fB\-p\fP fails. +.RE +.TP +\fBjobs\fP [\fB\-lnprs\fP] [ \fIjobspec\fP ... ] +.PD 0 +.TP +\fBjobs\fP \fB\-x\fP \fIcommand\fP [ \fIargs\fP ... ] +.PD +The first form lists the active jobs. The options have the following +meanings: +.RS +.PD 0 +.TP +.B \-l +List process IDs +in addition to the normal information. +.TP +.B \-n +Display information only about jobs that have changed status since +the user was last notified of their status. +.TP +.B \-p +List only the process ID of the job's process group +leader. +.TP +.B \-r +Display only running jobs. +.TP +.B \-s +Display only stopped jobs. +.PD +.PP +If +.I jobspec +is given, output is restricted to information about that job. +The return status is 0 unless an invalid option is encountered +or an invalid +.I jobspec +is supplied. +.PP +If the +.B \-x +option is supplied, +.B jobs +replaces any +.I jobspec +found in +.I command +or +.I args +with the corresponding process group ID, and executes +.I command +passing it +.IR args , +returning its exit status. +.RE +.TP +\fBkill\fP [\fB\-s\fP \fIsigspec\fP | \fB\-n\fP \fIsignum\fP | \fB\-\fP\fIsigspec\fP] [\fIpid\fP | \fIjobspec\fP] ... +.PD 0 +.TP +\fBkill\fP \fB\-l\fP [\fIsigspec\fP | \fIexit_status\fP] +.PD +Send the signal named by +.I sigspec +or +.I signum +to the processes named by +.I pid +or +.IR jobspec . +.I sigspec +is either a case-insensitive signal name such as +.SM +.B SIGKILL +(with or without the +.SM +.B SIG +prefix) or a signal number; +.I signum +is a signal number. +If +.I sigspec +is not present, then +.SM +.B SIGTERM +is assumed. +An argument of +.B \-l +lists the signal names. +If any arguments are supplied when +.B \-l +is given, the names of the signals corresponding to the arguments are +listed, and the return status is 0. +The \fIexit_status\fP argument to +.B \-l +is a number specifying either a signal number or the exit status of +a process terminated by a signal. +.B kill +returns true if at least one signal was successfully sent, or false +if an error occurs or an invalid option is encountered. +.TP +\fBlet\fP \fIarg\fP [\fIarg\fP ...] +Each +.I arg +is an arithmetic expression to be evaluated (see +.SM +.B "ARITHMETIC EVALUATION" +above). +If the last +.I arg +evaluates to 0, +.B let +returns 1; 0 is returned otherwise. +.TP +\fBlocal\fP [\fIoption\fP] [\fIname\fP[=\fIvalue\fP] ...] +For each argument, a local variable named +.I name +is created, and assigned +.IR value . +The \fIoption\fP can be any of the options accepted by \fBdeclare\fP. +When +.B local +is used within a function, it causes the variable +.I name +to have a visible scope restricted to that function and its children. +With no operands, +.B local +writes a list of local variables to the standard output. It is +an error to use +.B local +when not within a function. The return status is 0 unless +.B local +is used outside a function, an invalid +.I name +is supplied, or +\fIname\fP is a readonly variable. +.TP +.B logout +Exit a login shell. +.TP +\fBmapfile\fP [\fB\-n\fP \fIcount\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-s\fP \fIcount\fP] [\fB\-t\fP] [\fB\-u\fP \fIfd\fP] [\fB\-C\fP \fIcallback\fP] [\fB\-c\fP \fIquantum\fP] [\fIarray\fP] +.PD 0 +.TP +\fBreadarray\fP [\fB\-n\fP \fIcount\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-s\fP \fIcount\fP] [\fB\-t\fP] [\fB\-u\fP \fIfd\fP] [\fB\-C\fP \fIcallback\fP] [\fB\-c\fP \fIquantum\fP] [\fIarray\fP] +.PD +Read lines from the standard input into the indexed array variable +.IR array , +or from file descriptor +.IR fd +if the +.B \-u +option is supplied. +The variable +.SM +.B MAPFILE +is the default \fIarray\fP. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Copy at most +.I count +lines. If \fIcount\fP is 0, all lines are copied. +.TP +.B \-O +Begin assigning to +.I array +at index +.IR origin . +The default index is 0. +.TP +.B \-s +Discard the first \fIcount\fP lines read. +.TP +.B \-t +Remove a trailing newline from each line read. +.TP +.B \-u +Read lines from file descriptor \fIfd\fP instead of the standard input. +.TP +.B \-C +Evaluate +.I callback +each time \fIquantum\fP lines are read. The \fB\-c\fP option specifies +.IR quantum . +.TP +.B \-c +Specify the number of lines read between each call to +.IR callback . +.PD +.PP +If +.B \-C +is specified without +.BR \-c , +the default quantum is 5000. +When \fIcallback\fP is evaluated, it is supplied the index of the next +array element to be assigned and the line to be assigned to that element +as additional arguments. +\fIcallback\fP is evaluated after the line is read but before the +array element is assigned. +.PP +If not supplied with an explicit origin, \fBmapfile\fP will clear \fIarray\fP +before assigning to it. +.PP +\fBmapfile\fP returns successfully unless an invalid option or option +argument is supplied, \fIarray\fP is invalid or unassignable, or if +\fIarray\fP is not an indexed array. +.RE +.TP +\fBpopd\fP [\-\fBn\fP] [+\fIn\fP] [\-\fIn\fP] +Removes entries from the directory stack. With no arguments, +removes the top directory from the stack, and performs a +.B cd +to the new top directory. +Arguments, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Suppresses the normal change of directory when removing directories +from the stack, so that only the stack is manipulated. +.TP +\fB+\fP\fIn\fP +Removes the \fIn\fPth entry counting from the left of the list +shown by +.BR dirs , +starting with zero. For example: +.if n ``popd +0'' +.if t \f(CWpopd +0\fP +removes the first directory, +.if n ``popd +1'' +.if t \f(CWpopd +1\fP +the second. +.TP +\fB\-\fP\fIn\fP +Removes the \fIn\fPth entry counting from the right of the list +shown by +.BR dirs , +starting with zero. For example: +.if n ``popd -0'' +.if t \f(CWpopd -0\fP +removes the last directory, +.if n ``popd -1'' +.if t \f(CWpopd -1\fP +the next to last. +.PD +.PP +If the +.B popd +command is successful, a +.B dirs +is performed as well, and the return status is 0. +.B popd +returns false if an invalid option is encountered, the directory stack +is empty, a non-existent directory stack entry is specified, or the +directory change fails. +.RE +.TP +\fBprintf\fP [\fB\-v\fP \fIvar\fP] \fIformat\fP [\fIarguments\fP] +Write the formatted \fIarguments\fP to the standard output under the +control of the \fIformat\fP. +The \fB\-v\fP option causes the output to be assigned to the variable +\fIvar\fP rather than being printed to the standard output. +.sp 1 +The \fIformat\fP is a character string which contains three types of objects: +plain characters, which are simply copied to standard output, character +escape sequences, which are converted and copied to the standard output, and +format specifications, each of which causes printing of the next successive +\fIargument\fP. +In addition to the standard \fIprintf\fP(1) format specifications, +\fBprintf\fP interprets the following extensions: +.RS +.PD 0 +.TP +.B %b +causes +\fBprintf\fP to expand backslash escape sequences in the corresponding +\fIargument\fP (except that \fB\ec\fP terminates output, backslashes in +\fB\e\(aq\fP, \fB\e"\fP, and \fB\e?\fP are not removed, and octal escapes +beginning with \fB\e0\fP may contain up to four digits). +.TP +.B %q +causes \fBprintf\fP to output the corresponding +\fIargument\fP in a format that can be reused as shell input. +.TP +.B %(\fIdatefmt\fP)T +causes \fBprintf\fP to output the date-time string resulting from using +\fIdatefmt\fP as a format string for \fIstrftime\fP(3). +The corresponding \fIargument\fP is an integer representing the number of +seconds since the epoch. +Two special argument values may be used: -1 represents the current +time, and -2 represents the time the shell was invoked. +If no argument is specified, conversion behaves as if -1 had been given. +This is an exception to the usual \fBprintf\fP behavior. +.PD +.PP +Arguments to non-string format specifiers are treated as C constants, +except that a leading plus or minus sign is allowed, and if the leading +character is a single or double quote, the value is the ASCII value of +the following character. +.PP +The \fIformat\fP is reused as necessary to consume all of the \fIarguments\fP. +If the \fIformat\fP requires more \fIarguments\fP than are supplied, the +extra format specifications behave as if a zero value or null string, as +appropriate, had been supplied. +The return value is zero on success, non-zero on failure. +.RE +.TP +\fBpushd\fP [\fB\-n\fP] [+\fIn\fP] [\-\fIn\fP] +.PD 0 +.TP +\fBpushd\fP [\fB\-n\fP] [\fIdir\fP] +.PD +Adds a directory to the top of the directory stack, or rotates +the stack, making the new top of the stack the current working +directory. With no arguments, exchanges the top two directories +and returns 0, unless the directory stack is empty. +Arguments, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Suppresses the normal change of directory when adding directories +to the stack, so that only the stack is manipulated. +.TP +\fB+\fP\fIn\fP +Rotates the stack so that the \fIn\fPth directory +(counting from the left of the list shown by +.BR dirs , +starting with zero) +is at the top. +.TP +\fB\-\fP\fIn\fP +Rotates the stack so that the \fIn\fPth directory +(counting from the right of the list shown by +.BR dirs , +starting with zero) is at the top. +.TP +.I dir +Adds +.I dir +to the directory stack at the top, making it the +new current working directory as if it had been supplied as the argument +to the \fBcd\fP builtin. +.PD +.PP +If the +.B pushd +command is successful, a +.B dirs +is performed as well. +If the first form is used, +.B pushd +returns 0 unless the cd to +.I dir +fails. With the second form, +.B pushd +returns 0 unless the directory stack is empty, +a non-existent directory stack element is specified, +or the directory change to the specified new current directory +fails. +.RE +.TP +\fBpwd\fP [\fB\-LP\fP] +Print the absolute pathname of the current working directory. +The pathname printed contains no symbolic links if the +.B \-P +option is supplied or the +.B \-o physical +option to the +.B set +builtin command is enabled. +If the +.B \-L +option is used, the pathname printed may contain symbolic links. +The return status is 0 unless an error occurs while +reading the name of the current directory or an +invalid option is supplied. +.TP +\fBread\fP [\fB\-ers\fP] [\fB\-a\fP \fIaname\fP] [\fB\-d\fP \fIdelim\fP] [\fB\-i\fP \fItext\fP] [\fB\-n\fP \fInchars\fP] [\fB\-N\fP \fInchars\fP] [\fB\-p\fP \fIprompt\fP] [\fB\-t\fP \fItimeout\fP] [\fB\-u\fP \fIfd\fP] [\fIname\fP ...] +One line is read from the standard input, or from the file descriptor +\fIfd\fP supplied as an argument to the \fB\-u\fP option, and the first word +is assigned to the first +.IR name , +the second word to the second +.IR name , +and so on, with leftover words and their intervening separators assigned +to the last +.IR name . +If there are fewer words read from the input stream than names, +the remaining names are assigned empty values. +The characters in +.SM +.B IFS +are used to split the line into words using the same rules the shell +uses for expansion (described above under \fBWord Splitting\fP). +The backslash character (\fB\e\fP) may be used to remove any special +meaning for the next character read and for line continuation. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-a \fIaname\fP +The words are assigned to sequential indices +of the array variable +.IR aname , +starting at 0. +.I aname +is unset before any new values are assigned. +Other \fIname\fP arguments are ignored. +.TP +.B \-d \fIdelim\fP +The first character of \fIdelim\fP is used to terminate the input line, +rather than newline. +.TP +.B \-e +If the standard input +is coming from a terminal, +.B readline +(see +.SM +.B READLINE +above) is used to obtain the line. +Readline uses the current (or default, if line editing was not previously +active) editing settings. +.TP +.B \-i \fItext\fP +If +.B readline +is being used to read the line, \fItext\fP is placed into the editing +buffer before editing begins. +.TP +.B \-n \fInchars\fP +\fBread\fP returns after reading \fInchars\fP characters rather than +waiting for a complete line of input, but honor a delimiter if fewer +than \fInchars\fP characters are read before the delimiter. +.TP +.B \-N \fInchars\fP +\fBread\fP returns after reading exactly \fInchars\fP characters rather +than waiting for a complete line of input, unless EOF is encountered or +\fBread\fP times out. +Delimiter characters encountered in the input are +not treated specially and do not cause \fBread\fP to return until +\fInchars\fP characters are read. +.TP +.B \-p \fIprompt\fP +Display \fIprompt\fP on standard error, without a +trailing newline, before attempting to read any input. The prompt +is displayed only if input is coming from a terminal. +.TP +.B \-r +Backslash does not act as an escape character. +The backslash is considered to be part of the line. +In particular, a backslash-newline pair may not be used as a line +continuation. +.TP +.B \-s +Silent mode. If input is coming from a terminal, characters are +not echoed. +.TP +.B \-t \fItimeout\fP +Cause \fBread\fP to time out and return failure if a complete line of +input (or a specified number of characters) +is not read within \fItimeout\fP seconds. +\fItimeout\fP may be a decimal number with a fractional portion following +the decimal point. +This option is only effective if \fBread\fP is reading input from a +terminal, pipe, or other special file; it has no effect when reading +from regular files. +If \fBread\fP times out, \fBread\fP saves any partial input read into +the specified variable \fIname\fP. +If \fItimeout\fP is 0, \fBread\fP returns immediately, without trying to +read any data. The exit status is 0 if input is available on +the specified file descriptor, non-zero otherwise. +The exit status is greater than 128 if the timeout is exceeded. +.TP +.B \-u \fIfd\fP +Read input from file descriptor \fIfd\fP. +.PD +.PP +If no +.I names +are supplied, the line read is assigned to the variable +.SM +.BR REPLY . +The return code is zero, unless end-of-file is encountered, \fBread\fP +times out (in which case the return code is greater than 128), +a variable assignment error (such as assigning to a readonly variable) occurs, +or an invalid file descriptor is supplied as the argument to \fB\-u\fP. +.RE +.TP +\fBreadonly\fP [\fB\-aAf\fP] [\fB\-p\fP] [\fIname\fP[=\fIword\fP] ...] +.PD +The given +\fInames\fP are marked readonly; the values of these +.I names +may not be changed by subsequent assignment. +If the +.B \-f +option is supplied, the functions corresponding to the +\fInames\fP are so +marked. +The +.B \-a +option restricts the variables to indexed arrays; the +.B \-A +option restricts the variables to associative arrays. +If both options are supplied, +.B \-A +takes precedence. +If no +.I name +arguments are given, or if the +.B \-p +option is supplied, a list of all readonly names is printed. +The other options may be used to restrict the output to a subset of +the set of readonly names. +The +.B \-p +option causes output to be displayed in a format that +may be reused as input. +If a variable name is followed by =\fIword\fP, the value of +the variable is set to \fIword\fP. +The return status is 0 unless an invalid option is encountered, +one of the +.I names +is not a valid shell variable name, or +.B \-f +is supplied with a +.I name +that is not a function. +.TP +\fBreturn\fP [\fIn\fP] +Causes a function to stop executing and return the value specified by +.I n +to its caller. +If +.I n +is omitted, the return status is that of the last command +executed in the function body. If +.B return +is used outside a function, +but during execution of a script by the +.B . +(\fBsource\fP) command, it causes the shell to stop executing +that script and return either +.I n +or the exit status of the last command executed within the +script as the exit status of the script. +If \fIn\fP is supplied, the return value is its least significant +8 bits. +The return status is non-zero if +.B return +is supplied a non-numeric argument, or +is used outside a +function and not during execution of a script by \fB.\fP\^ or \fBsource\fP. +Any command associated with the \fBRETURN\fP trap is executed +before execution resumes after the function or script. +.TP +\fBset\fP [\fB\-\-abefhkmnptuvxBCEHPT\fP] [\fB\-o\fP \fIoption\-name\fP] [\fIarg\fP ...] +.PD 0 +.TP +\fBset\fP [\fB+abefhkmnptuvxBCEHPT\fP] [\fB+o\fP \fIoption\-name\fP] [\fIarg\fP ...] +.PD +Without options, the name and value of each shell variable are displayed +in a format that can be reused as input +for setting or resetting the currently-set variables. +Read-only variables cannot be reset. +In \fIposix\fP mode, only shell variables are listed. +The output is sorted according to the current locale. +When options are specified, they set or unset shell attributes. +Any arguments remaining after option processing are treated +as values for the positional parameters and are assigned, in order, to +.BR $1 , +.BR $2 , +.B ... +.BR $\fIn\fP . +Options, if specified, have the following meanings: +.RS +.PD 0 +.TP 8 +.B \-a +Automatically mark variables and functions which are modified or +created for export to the environment of subsequent commands. +.TP 8 +.B \-b +Report the status of terminated background jobs +immediately, rather than before the next primary prompt. This is +effective only when job control is enabled. +.TP 8 +.B \-e +Exit immediately if a +\fIpipeline\fP (which may consist of a single \fIsimple command\fP), +a \fIlist\fP, +or a \fIcompound command\fP +(see +.SM +.B SHELL GRAMMAR +above), exits with a non-zero status. +The shell does not exit if the +command that fails is part of the command list immediately following a +.B while +or +.B until +keyword, +part of the test following the +.B if +or +.B elif +reserved words, part of any command executed in a +.B && +or +.B || +list except the command following the final \fB&&\fP or \fB||\fP, +any command in a pipeline but the last, +or if the command's return value is +being inverted with +.BR ! . +If a compound command other than a subshell +returns a non-zero status because a command failed +while \fB\-e\fP was being ignored, the shell does not exit. +A trap on \fBERR\fP, if set, is executed before the shell exits. +This option applies to the shell environment and each subshell environment +separately (see +.SM +.B "COMMAND EXECUTION ENVIRONMENT" +above), and may cause +subshells to exit before executing all the commands in the subshell. +.if t .sp 0.5 +.if n .sp 1 +If a compound command or shell function executes in a context +where \fB\-e\fP is being ignored, +none of the commands executed within the compound command or function body +will be affected by the \fB\-e\fP setting, even if \fB\-e\fP is set +and a command returns a failure status. +If a compound command or shell function sets \fB\-e\fP while executing in +a context where \fB\-e\fP is ignored, that setting will not have any +effect until the compound command or the command containing the function +call completes. +.TP 8 +.B \-f +Disable pathname expansion. +.TP 8 +.B \-h +Remember the location of commands as they are looked up for execution. +This is enabled by default. +.TP 8 +.B \-k +All arguments in the form of assignment statements +are placed in the environment for a command, not just +those that precede the command name. +.TP 8 +.B \-m +Monitor mode. Job control is enabled. This option is on +by default for interactive shells on systems that support +it (see +.SM +.B JOB CONTROL +above). +All processes run in a separate process group. +When a background job completes, the shell prints a line +containing its exit status. +.TP 8 +.B \-n +Read commands but do not execute them. This may be used to +check a shell script for syntax errors. This is ignored by +interactive shells. +.TP 8 +.B \-o \fIoption\-name\fP +The \fIoption\-name\fP can be one of the following: +.RS +.TP 8 +.B allexport +Same as +.BR \-a . +.TP 8 +.B braceexpand +Same as +.BR \-B . +.TP 8 +.B emacs +Use an emacs-style command line editing interface. This is enabled +by default when the shell is interactive, unless the shell is started +with the +.B \-\-noediting +option. +This also affects the editing interface used for \fBread \-e\fP. +.TP 8 +.B errexit +Same as +.BR \-e . +.TP 8 +.B errtrace +Same as +.BR \-E . +.TP 8 +.B functrace +Same as +.BR \-T . +.TP 8 +.B hashall +Same as +.BR \-h . +.TP 8 +.B histexpand +Same as +.BR \-H . +.TP 8 +.B history +Enable command history, as described above under +.SM +.BR HISTORY . +This option is on by default in interactive shells. +.TP 8 +.B ignoreeof +The effect is as if the shell command +.if t \f(CWIGNOREEOF=10\fP +.if n ``IGNOREEOF=10'' +had been executed +(see +.B Shell Variables +above). +.TP 8 +.B keyword +Same as +.BR \-k . +.TP 8 +.B monitor +Same as +.BR \-m . +.TP 8 +.B noclobber +Same as +.BR \-C . +.TP 8 +.B noexec +Same as +.BR \-n . +.TP 8 +.B noglob +Same as +.BR \-f . +.TP 8 +.B nolog +Currently ignored. +.TP 8 +.B notify +Same as +.BR \-b . +.TP 8 +.B nounset +Same as +.BR \-u . +.TP 8 +.B onecmd +Same as +.BR \-t . +.TP 8 +.B physical +Same as +.BR \-P . +.TP 8 +.B pipefail +If set, the return value of a pipeline is the value of the last +(rightmost) command to exit with a non-zero status, or zero if all +commands in the pipeline exit successfully. +This option is disabled by default. +.TP 8 +.B posix +Change the behavior of +.B bash +where the default operation differs +from the POSIX standard to match the standard (\fIposix mode\fP). +See +.SM +.B "SEE ALSO" +below for a reference to a document that details how posix mode affects +bash's behavior. +.TP 8 +.B privileged +Same as +.BR \-p . +.TP 8 +.B verbose +Same as +.BR \-v . +.TP 8 +.B vi +Use a vi-style command line editing interface. +This also affects the editing interface used for \fBread \-e\fP. +.TP 8 +.B xtrace +Same as +.BR \-x . +.sp .5 +.PP +If +.B \-o +is supplied with no \fIoption\-name\fP, the values of the current options are +printed. +If +.B +o +is supplied with no \fIoption\-name\fP, a series of +.B set +commands to recreate the current option settings is displayed on +the standard output. +.RE +.TP 8 +.B \-p +Turn on +.I privileged +mode. In this mode, the +.SM +.B $ENV +and +.SM +.B $BASH_ENV +files are not processed, shell functions are not inherited from the +environment, and the +.SM +.BR SHELLOPTS , +.SM +.BR BASHOPTS , +.SM +.BR CDPATH , +and +.SM +.B GLOBIGNORE +variables, if they appear in the environment, are ignored. +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the \fB\-p\fP option is not supplied, these actions +are taken and the effective user id is set to the real user id. +If the \fB\-p\fP option is supplied at startup, the effective user id is +not reset. +Turning this option off causes the effective user +and group ids to be set to the real user and group ids. +.TP 8 +.B \-t +Exit after reading and executing one command. +.TP 8 +.B \-u +Treat unset variables and parameters other than the special +parameters "@" and "*" as an error when performing +parameter expansion. If expansion is attempted on an +unset variable or parameter, the shell prints an error message, and, +if not interactive, exits with a non-zero status. +.TP 8 +.B \-v +Print shell input lines as they are read. +.TP 8 +.B \-x +After expanding each \fIsimple command\fP, +\fBfor\fP command, \fBcase\fP command, \fBselect\fP command, or +arithmetic \fBfor\fP command, display the expanded value of +.SM +.BR PS4 , +followed by the command and its expanded arguments +or associated word list. +.TP 8 +.B \-B +The shell performs brace expansion (see +.B Brace Expansion +above). This is on by default. +.TP 8 +.B \-C +If set, +.B bash +does not overwrite an existing file with the +.BR > , +.BR >& , +and +.B <> +redirection operators. This may be overridden when +creating output files by using the redirection operator +.B >| +instead of +.BR > . +.TP 8 +.B \-E +If set, any trap on \fBERR\fP is inherited by shell functions, command +substitutions, and commands executed in a subshell environment. +The \fBERR\fP trap is normally not inherited in such cases. +.TP 8 +.B \-H +Enable +.B ! +style history substitution. This option is on by +default when the shell is interactive. +.TP 8 +.B \-P +If set, the shell does not resolve symbolic links when executing +commands such as +.B cd +that change the current working directory. It uses the +physical directory structure instead. By default, +.B bash +follows the logical chain of directories when performing commands +which change the current directory. +.TP 8 +.B \-T +If set, any traps on \fBDEBUG\fP and \fBRETURN\fP are inherited by shell +functions, command substitutions, and commands executed in a +subshell environment. +The \fBDEBUG\fP and \fBRETURN\fP traps are normally not inherited +in such cases. +.TP 8 +.B \-\- +If no arguments follow this option, then the positional parameters are +unset. Otherwise, the positional parameters are set to the +\fIarg\fPs, even if some of them begin with a +.BR \- . +.TP 8 +.B \- +Signal the end of options, cause all remaining \fIarg\fPs to be +assigned to the positional parameters. The +.B \-x +and +.B \-v +options are turned off. +If there are no \fIarg\fPs, +the positional parameters remain unchanged. +.PD +.PP +The options are off by default unless otherwise noted. +Using + rather than \- causes these options to be turned off. +The options can also be specified as arguments to an invocation of +the shell. +The current set of options may be found in +.BR $\- . +The return status is always true unless an invalid option is encountered. +.RE +.TP +\fBshift\fP [\fIn\fP] +The positional parameters from \fIn\fP+1 ... are renamed to +.B $1 +.B .... +Parameters represented by the numbers \fB$#\fP +down to \fB$#\fP\-\fIn\fP+1 are unset. +.I n +must be a non-negative number less than or equal to \fB$#\fP. +If +.I n +is 0, no parameters are changed. +If +.I n +is not given, it is assumed to be 1. +If +.I n +is greater than \fB$#\fP, the positional parameters are not changed. +The return status is greater than zero if +.I n +is greater than +.B $# +or less than zero; otherwise 0. +.TP +\fBshopt\fP [\fB\-pqsu\fP] [\fB\-o\fP] [\fIoptname\fP ...] +Toggle the values of settings controlling optional shell behavior. +The settings can be either those listed below, or, if the +.B \-o +option is used, those available with the +.B \-o +option to the \fBset\fP builtin command. +With no options, or with the +.B \-p +option, a list of all settable options is displayed, with +an indication of whether or not each is set. +The \fB\-p\fP option causes output to be displayed in a form that +may be reused as input. +Other options have the following meanings: +.RS +.PD 0 +.TP +.B \-s +Enable (set) each \fIoptname\fP. +.TP +.B \-u +Disable (unset) each \fIoptname\fP. +.TP +.B \-q +Suppresses normal output (quiet mode); the return status indicates +whether the \fIoptname\fP is set or unset. +If multiple \fIoptname\fP arguments are given with +.BR \-q , +the return status is zero if all \fIoptnames\fP are enabled; non-zero +otherwise. +.TP +.B \-o +Restricts the values of \fIoptname\fP to be those defined for the +.B \-o +option to the +.B set +builtin. +.PD +.PP +If either +.B \-s +or +.B \-u +is used with no \fIoptname\fP arguments, +.B shopt +shows only those options which are set or unset, respectively. +Unless otherwise noted, the \fBshopt\fP options are disabled (unset) +by default. +.PP +The return status when listing options is zero if all \fIoptnames\fP +are enabled, non-zero otherwise. When setting or unsetting options, +the return status is zero unless an \fIoptname\fP is not a valid shell +option. +.PP +The list of \fBshopt\fP options is: +.if t .sp .5v +.if n .sp 1v +.PD 0 +.TP 8 +.B autocd +If set, a command name that is the name of a directory is executed as if +it were the argument to the \fBcd\fP command. +This option is only used by interactive shells. +.TP 8 +.B cdable_vars +If set, an argument to the +.B cd +builtin command that +is not a directory is assumed to be the name of a variable whose +value is the directory to change to. +.TP 8 +.B cdspell +If set, minor errors in the spelling of a directory component in a +.B cd +command will be corrected. +The errors checked for are transposed characters, +a missing character, and one character too many. +If a correction is found, the corrected filename is printed, +and the command proceeds. +This option is only used by interactive shells. +.TP 8 +.B checkhash +If set, \fBbash\fP checks that a command found in the hash +table exists before trying to execute it. If a hashed command no +longer exists, a normal path search is performed. +.TP 8 +.B checkjobs +If set, \fBbash\fP lists the status of any stopped and running jobs before +exiting an interactive shell. If any jobs are running, this causes +the exit to be deferred until a second exit is attempted without an +intervening command (see +.SM +.B "JOB CONTROL" +above). The shell always +postpones exiting if any jobs are stopped. +.TP 8 +.B checkwinsize +If set, \fBbash\fP checks the window size after each command +and, if necessary, updates the values of +.SM +.B LINES +and +.SM +.BR COLUMNS . +.TP 8 +.B cmdhist +If set, +.B bash +attempts to save all lines of a multiple-line +command in the same history entry. This allows +easy re-editing of multi-line commands. +.TP 8 +.B compat31 +If set, +.B bash +changes its behavior to that of version 3.1 with respect to quoted +arguments to the \fB[[\fP conditional command's \fB=~\fP operator +and locale-specific string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators. +Bash versions prior to bash-4.1 use ASCII collation and +.IR strcmp (3); +bash-4.1 and later use the current locale's collation sequence and +.IR strcoll (3). +.TP 8 +.B compat32 +If set, +.B bash +changes its behavior to that of version 3.2 with respect to +locale-specific string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators (see previous item). +.TP 8 +.B compat40 +If set, +.B bash +changes its behavior to that of version 4.0 with respect to locale-specific +string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators (see description of +\fBcompat31\fP) +and the effect of interrupting a command list. +Bash versions 4.0 and later interrupt the list as if the shell received the +interrupt; previous versions continue with the next command in the list. +.TP 8 +.B compat41 +If set, +.BR bash , +when in \fIposix\fP mode, treats a single quote in a double-quoted +parameter expansion as a special character. The single quotes must match +(an even number) and the characters between the single quotes are considered +quoted. This is the behavior of posix mode through version 4.1. +The default bash behavior remains as in previous versions. +.TP 8 +.B compat42 +If set, +.B bash +does not process the replacement string in the pattern substitution word +expansion using quote removal. +.TP 8 +.B complete_fullquote +If set, +.B bash +quotes all shell metacharacters in filenames and directory names when +performing completion. +If not set, +.B bash +removes metacharacters such as the dollar sign from the set of +characters that will be quoted in completed filenames +when these metacharacters appear in shell variable references in words to be +completed. +This means that dollar signs in variable names that expand to directories +will not be quoted; +however, any dollar signs appearing in filenames will not be quoted, either. +This is active only when bash is using backslashes to quote completed +filenames. +This variable is set by default, which is the default bash behavior in +versions through 4.2. +.TP 8 +.B direxpand +If set, +.B bash +replaces directory names with the results of word expansion when performing +filename completion. This changes the contents of the readline editing +buffer. +If not set, +.B bash +attempts to preserve what the user typed. +.TP 8 +.B dirspell +If set, +.B bash +attempts spelling correction on directory names during word completion +if the directory name initially supplied does not exist. +.TP 8 +.B dotglob +If set, +.B bash +includes filenames beginning with a `.' in the results of pathname +expansion. +.TP 8 +.B execfail +If set, a non-interactive shell will not exit if +it cannot execute the file specified as an argument to the +.B exec +builtin command. An interactive shell does not exit if +.B exec +fails. +.TP 8 +.B expand_aliases +If set, aliases are expanded as described above under +.SM +.BR ALIASES . +This option is enabled by default for interactive shells. +.TP 8 +.B extdebug +If set, behavior intended for use by debuggers is enabled: +.RS +.TP +.B 1. +The \fB\-F\fP option to the \fBdeclare\fP builtin displays the source +file name and line number corresponding to each function name supplied +as an argument. +.TP +.B 2. +If the command run by the \fBDEBUG\fP trap returns a non-zero value, the +next command is skipped and not executed. +.TP +.B 3. +If the command run by the \fBDEBUG\fP trap returns a value of 2, and the +shell is executing in a subroutine (a shell function or a shell script +executed by the \fB.\fP or \fBsource\fP builtins), a call to +\fBreturn\fP is simulated. +.TP +.B 4. +.SM +.B BASH_ARGC +and +.SM +.B BASH_ARGV +are updated as described in their descriptions above. +.TP +.B 5. +Function tracing is enabled: command substitution, shell functions, and +subshells invoked with \fB(\fP \fIcommand\fP \fB)\fP inherit the +\fBDEBUG\fP and \fBRETURN\fP traps. +.TP +.B 6. +Error tracing is enabled: command substitution, shell functions, and +subshells invoked with \fB(\fP \fIcommand\fP \fB)\fP inherit the +\fBERR\fP trap. +.RE +.TP 8 +.B extglob +If set, the extended pattern matching features described above under +\fBPathname Expansion\fP are enabled. +.TP 8 +.B extquote +If set, \fB$\fP\(aq\fIstring\fP\(aq and \fB$\fP"\fIstring\fP" quoting is +performed within \fB${\fP\fIparameter\fP\fB}\fP expansions +enclosed in double quotes. This option is enabled by default. +.TP 8 +.B failglob +If set, patterns which fail to match filenames during pathname expansion +result in an expansion error. +.TP 8 +.B force_fignore +If set, the suffixes specified by the +.SM +.B FIGNORE +shell variable +cause words to be ignored when performing word completion even if +the ignored words are the only possible completions. +See +.SM +\fBSHELL VARIABLES\fP +above for a description of +.SM +.BR FIGNORE . +This option is enabled by default. +.TP 8 +.B globasciiranges +If set, range expressions used in pattern matching bracket expressions (see +.SM +.B Pattern Matching +above) behave as if in the traditional C locale when performing +comparisons. That is, the current locale's collating sequence +is not taken into account, so +.B b +will not collate between +.B A +and +.BR B , +and upper-case and lower-case ASCII characters will collate together. +.TP 8 +.B globstar +If set, the pattern \fB**\fP used in a pathname expansion context will +match all files and zero or more directories and subdirectories. +If the pattern is followed by a \fB/\fP, only directories and +subdirectories match. +.TP 8 +.B gnu_errfmt +If set, shell error messages are written in the standard GNU error +message format. +.TP 8 +.B histappend +If set, the history list is appended to the file named by the value +of the +.SM +.B HISTFILE +variable when the shell exits, rather than overwriting the file. +.TP 8 +.B histreedit +If set, and +.B readline +is being used, a user is given the opportunity to re-edit a +failed history substitution. +.TP 8 +.B histverify +If set, and +.B readline +is being used, the results of history substitution are not immediately +passed to the shell parser. Instead, the resulting line is loaded into +the \fBreadline\fP editing buffer, allowing further modification. +.TP 8 +.B hostcomplete +If set, and +.B readline +is being used, \fBbash\fP will attempt to perform hostname completion when a +word containing a \fB@\fP is being completed (see +.B Completing +under +.SM +.B READLINE +above). +This is enabled by default. +.TP 8 +.B huponexit +If set, \fBbash\fP will send +.SM +.B SIGHUP +to all jobs when an interactive login shell exits. +.TP 8 +.B interactive_comments +If set, allow a word beginning with +.B # +to cause that word and all remaining characters on that +line to be ignored in an interactive shell (see +.SM +.B COMMENTS +above). This option is enabled by default. +.TP 8 +.B lastpipe +If set, and job control is not active, the shell runs the last command of +a pipeline not executed in the background in the current shell environment. +.TP 8 +.B lithist +If set, and the +.B cmdhist +option is enabled, multi-line commands are saved to the history with +embedded newlines rather than using semicolon separators where possible. +.TP 8 +.B login_shell +The shell sets this option if it is started as a login shell (see +.SM +.B "INVOCATION" +above). +The value may not be changed. +.TP 8 +.B mailwarn +If set, and a file that \fBbash\fP is checking for mail has been +accessed since the last time it was checked, the message ``The mail in +\fImailfile\fP has been read'' is displayed. +.TP 8 +.B no_empty_cmd_completion +If set, and +.B readline +is being used, +.B bash +will not attempt to search the +.SM +.B PATH +for possible completions when +completion is attempted on an empty line. +.TP 8 +.B nocaseglob +If set, +.B bash +matches filenames in a case\-insensitive fashion when performing pathname +expansion (see +.B Pathname Expansion +above). +.TP 8 +.B nocasematch +If set, +.B bash +matches patterns in a case\-insensitive fashion when performing matching +while executing \fBcase\fP or \fB[[\fP conditional commands. +.TP 8 +.B nullglob +If set, +.B bash +allows patterns which match no +files (see +.B Pathname Expansion +above) +to expand to a null string, rather than themselves. +.TP 8 +.B progcomp +If set, the programmable completion facilities (see +\fBProgrammable Completion\fP above) are enabled. +This option is enabled by default. +.TP 8 +.B promptvars +If set, prompt strings undergo +parameter expansion, command substitution, arithmetic +expansion, and quote removal after being expanded as described in +.SM +.B PROMPTING +above. This option is enabled by default. +.TP 8 +.B restricted_shell +The shell sets this option if it is started in restricted mode (see +.SM +.B "RESTRICTED SHELL" +below). +The value may not be changed. +This is not reset when the startup files are executed, allowing +the startup files to discover whether or not a shell is restricted. +.TP 8 +.B shift_verbose +If set, the +.B shift +builtin prints an error message when the shift count exceeds the +number of positional parameters. +.TP 8 +.B sourcepath +If set, the +\fBsource\fP (\fB.\fP) builtin uses the value of +.SM +.B PATH +to find the directory containing the file supplied as an argument. +This option is enabled by default. +.TP 8 +.B xpg_echo +If set, the \fBecho\fP builtin expands backslash-escape sequences +by default. +.RE +.PD +.TP +\fBsuspend\fP [\fB\-f\fP] +Suspend the execution of this shell until it receives a +.SM +.B SIGCONT +signal. A login shell cannot be suspended; the +.B \-f +option can be used to override this and force the suspension. +The return status is 0 unless the shell is a login shell and +.B \-f +is not supplied, or if job control is not enabled. +.TP +\fBtest\fP \fIexpr\fP +.PD 0 +.TP +\fB[\fP \fIexpr\fP \fB]\fP +Return a status of 0 (true) or 1 (false) depending on +the evaluation of the conditional expression +.IR expr . +Each operator and operand must be a separate argument. +Expressions are composed of the primaries described above under +.SM +.BR "CONDITIONAL EXPRESSIONS" . +\fBtest\fP does not accept any options, nor does it accept and ignore +an argument of \fB\-\-\fP as signifying the end of options. +.if t .sp 0.5 +.if n .sp 1 +Expressions may be combined using the following operators, listed +in decreasing order of precedence. +The evaluation depends on the number of arguments; see below. +Operator precedence is used when there are five or more arguments. +.RS +.PD 0 +.TP +.B ! \fIexpr\fP +True if +.I expr +is false. +.TP +.B ( \fIexpr\fP ) +Returns the value of \fIexpr\fP. +This may be used to override the normal precedence of operators. +.TP +\fIexpr1\fP \-\fBa\fP \fIexpr2\fP +True if both +.I expr1 +and +.I expr2 +are true. +.TP +\fIexpr1\fP \-\fBo\fP \fIexpr2\fP +True if either +.I expr1 +or +.I expr2 +is true. +.PD +.PP +\fBtest\fP and \fB[\fP evaluate conditional +expressions using a set of rules based on the number of arguments. +.if t .sp 0.5 +.if n .sp 1 +.PD 0 +.TP +0 arguments +The expression is false. +.TP +1 argument +The expression is true if and only if the argument is not null. +.TP +2 arguments +If the first argument is \fB!\fP, the expression is true if and +only if the second argument is null. +If the first argument is one of the unary conditional operators listed above +under +.SM +.BR "CONDITIONAL EXPRESSIONS" , +the expression is true if the unary test is true. +If the first argument is not a valid unary conditional operator, the expression +is false. +.TP +3 arguments +The following conditions are applied in the order listed. +If the second argument is one of the binary conditional operators listed above +under +.SM +.BR "CONDITIONAL EXPRESSIONS" , +the result of the expression is the result of the binary test using +the first and third arguments as operands. +The \fB\-a\fP and \fB\-o\fP operators are considered binary operators +when there are three arguments. +If the first argument is \fB!\fP, the value is the negation of +the two-argument test using the second and third arguments. +If the first argument is exactly \fB(\fP and the third argument is +exactly \fB)\fP, the result is the one-argument test of the second +argument. +Otherwise, the expression is false. +.TP +4 arguments +If the first argument is \fB!\fP, the result is the negation of +the three-argument expression composed of the remaining arguments. +Otherwise, the expression is parsed and evaluated according to +precedence using the rules listed above. +.TP +5 or more arguments +The expression is parsed and evaluated according to precedence +using the rules listed above. +.if t .sp 0.5 +.if n .sp 1 +.LP +When used with \fBtest\fP or \fB[\fP, the \fB<\fP and \fB>\fP operators +sort lexicographically using ASCII ordering. +.RE +.PD +.TP +.B times +Print the accumulated user and system times for the shell and +for processes run from the shell. The return status is 0. +.TP +\fBtrap\fP [\fB\-lp\fP] [[\fIarg\fP] \fIsigspec\fP ...] +The command +.I arg +is to be read and executed when the shell receives +signal(s) +.IR sigspec . +If +.I arg +is absent (and there is a single \fIsigspec\fP) or +.BR \- , +each specified signal is +reset to its original disposition (the value it had +upon entrance to the shell). +If +.I arg +is the null string the signal specified by each +.I sigspec +is ignored by the shell and by the commands it invokes. +If +.I arg +is not present and +.B \-p +has been supplied, then the trap commands associated with each +.I sigspec +are displayed. +If no arguments are supplied or if only +.B \-p +is given, +.B trap +prints the list of commands associated with each signal. +The +.B \-l +option causes the shell to print a list of signal names and +their corresponding numbers. +Each +.I sigspec +is either +a signal name defined in <\fIsignal.h\fP>, or a signal number. +Signal names are case insensitive and the +.SM +.B SIG +prefix is optional. +.if t .sp 0.5 +.if n .sp 1 +If a +.I sigspec +is +.SM +.B EXIT +(0) the command +.I arg +is executed on exit from the shell. +If a +.I sigspec +is +.SM +.BR DEBUG , +the command +.I arg +is executed before every \fIsimple command\fP, \fIfor\fP command, +\fIcase\fP command, \fIselect\fP command, every arithmetic \fIfor\fP +command, and before the first command executes in a shell function (see +.SM +.B SHELL GRAMMAR +above). +Refer to the description of the \fBextdebug\fP option to the +\fBshopt\fP builtin for details of its effect on the \fBDEBUG\fP trap. +If a +.I sigspec +is +.SM +.BR RETURN , +the command +.I arg +is executed each time a shell function or a script executed with +the \fB.\fP or \fBsource\fP builtins finishes executing. +.if t .sp 0.5 +.if n .sp 1 +If a +.I sigspec +is +.SM +.BR ERR , +the command +.I arg +is executed whenever a +a pipeline (which may consist of a single simple +command), a list, or a compound command returns a +non\-zero exit status, +subject to the following conditions. +The +.SM +.B ERR +trap is not executed if the failed +command is part of the command list immediately following a +.B while +or +.B until +keyword, +part of the test in an +.I if +statement, part of a command executed in a +.B && +or +.B || +list except the command following the final \fB&&\fP or \fB||\fP, +any command in a pipeline but the last, +or if the command's return value is +being inverted using +.BR ! . +These are the same conditions obeyed by the \fBerrexit\fP (\fB\-e\fP) option. +.if t .sp 0.5 +.if n .sp 1 +Signals ignored upon entry to the shell cannot be trapped or reset. +Trapped signals that are not being ignored are reset to their original +values in a subshell or subshell environment when one is created. +The return status is false if any +.I sigspec +is invalid; otherwise +.B trap +returns true. +.TP +\fBtype\fP [\fB\-aftpP\fP] \fIname\fP [\fIname\fP ...] +With no options, +indicate how each +.I name +would be interpreted if used as a command name. +If the +.B \-t +option is used, +.B type +prints a string which is one of +.IR alias , +.IR keyword , +.IR function , +.IR builtin , +or +.I file +if +.I name +is an alias, shell reserved word, function, builtin, or disk file, +respectively. +If the +.I name +is not found, then nothing is printed, and an exit status of false +is returned. +If the +.B \-p +option is used, +.B type +either returns the name of the disk file +that would be executed if +.I name +were specified as a command name, +or nothing if +.if t \f(CWtype -t name\fP +.if n ``type -t name'' +would not return +.IR file . +The +.B \-P +option forces a +.SM +.B PATH +search for each \fIname\fP, even if +.if t \f(CWtype -t name\fP +.if n ``type -t name'' +would not return +.IR file . +If a command is hashed, +.B \-p +and +.B \-P +print the hashed value, which is not necessarily the file that appears +first in +.SM +.BR PATH . +If the +.B \-a +option is used, +.B type +prints all of the places that contain +an executable named +.IR name . +This includes aliases and functions, +if and only if the +.B \-p +option is not also used. +The table of hashed commands is not consulted +when using +.BR \-a . +The +.B \-f +option suppresses shell function lookup, as with the \fBcommand\fP builtin. +.B type +returns true if all of the arguments are found, false if +any are not found. +.TP +\fBulimit\fP [\fB\-HSTabcdefilmnpqrstuvx\fP [\fIlimit\fP]] +Provides control over the resources available to the shell and to +processes started by it, on systems that allow such control. +The \fB\-H\fP and \fB\-S\fP options specify that the hard or soft limit is +set for the given resource. +A hard limit cannot be increased by a non-root user once it is set; +a soft limit may be increased up to the value of the hard limit. +If neither \fB\-H\fP nor \fB\-S\fP is specified, both the soft and hard +limits are set. +The value of +.I limit +can be a number in the unit specified for the resource +or one of the special values +.BR hard , +.BR soft , +or +.BR unlimited , +which stand for the current hard limit, the current soft limit, and +no limit, respectively. +If +.I limit +is omitted, the current value of the soft limit of the resource is +printed, unless the \fB\-H\fP option is given. When more than one +resource is specified, the limit name and unit are printed before the value. +Other options are interpreted as follows: +.RS +.PD 0 +.TP +.B \-a +All current limits are reported +.TP +.B \-b +The maximum socket buffer size +.TP +.B \-c +The maximum size of core files created +.TP +.B \-d +The maximum size of a process's data segment +.TP +.B \-e +The maximum scheduling priority ("nice") +.TP +.B \-f +The maximum size of files written by the shell and its children +.TP +.B \-i +The maximum number of pending signals +.TP +.B \-l +The maximum size that may be locked into memory +.TP +.B \-m +The maximum resident set size (many systems do not honor this limit) +.TP +.B \-n +The maximum number of open file descriptors (most systems do not +allow this value to be set) +.TP +.B \-p +The pipe size in 512-byte blocks (this may not be set) +.TP +.B \-q +The maximum number of bytes in POSIX message queues +.TP +.B \-r +The maximum real-time scheduling priority +.TP +.B \-s +The maximum stack size +.TP +.B \-t +The maximum amount of cpu time in seconds +.TP +.B \-u +The maximum number of processes available to a single user +.TP +.B \-v +The maximum amount of virtual memory available to the shell and, on +some systems, to its children +.TP +.B \-x +The maximum number of file locks +.TP +.B \-T +The maximum number of threads +.PD +.PP +If +.I limit +is given, and the +.B \-a +option is not used, +\fIlimit\fP is the new value of the specified resource. +If no option is given, then +.B \-f +is assumed. Values are in 1024-byte increments, except for +.BR \-t , +which is in seconds; +.BR \-p , +which is in units of 512-byte blocks; +and +.BR \-T , +.BR \-b , +.BR \-n , +and +.BR \-u , +which are unscaled values. +The return status is 0 unless an invalid option or argument is supplied, +or an error occurs while setting a new limit. +.RE +.TP +\fBumask\fP [\fB\-p\fP] [\fB\-S\fP] [\fImode\fP] +The user file-creation mask is set to +.IR mode . +If +.I mode +begins with a digit, it +is interpreted as an octal number; otherwise +it is interpreted as a symbolic mode mask similar +to that accepted by +.IR chmod (1). +If +.I mode +is omitted, the current value of the mask is printed. +The +.B \-S +option causes the mask to be printed in symbolic form; the +default output is an octal number. +If the +.B \-p +option is supplied, and +.I mode +is omitted, the output is in a form that may be reused as input. +The return status is 0 if the mode was successfully changed or if +no \fImode\fP argument was supplied, and false otherwise. +.TP +\fBunalias\fP [\-\fBa\fP] [\fIname\fP ...] +Remove each \fIname\fP from the list of defined aliases. If +.B \-a +is supplied, all alias definitions are removed. The return +value is true unless a supplied +.I name +is not a defined alias. +.TP +\fBunset\fP [\-\fBfv\fP] [\-\fBn\fP] [\fIname\fP ...] +For each +.IR name , +remove the corresponding variable or function. +If the +.B \-v +option is given, each +.I name +refers to a shell variable, and that variable is removed. +Read-only variables may not be unset. +If +.B \-f +is specified, each +.I name +refers to a shell function, and the function definition +is removed. +If the +.B \-n +option is supplied, and \fIname\fP is a variable with the \fInameref\fP +attribute, \fIname\fP will be unset rather than the variable it +references. +\fB\-n\fP has no effect if the \fB\-f\fP option is supplied. +If no options are supplied, each \fIname\fP refers to a variable; if +there is no variable by that name, any function with that name is +unset. +Each unset variable or function is removed from the environment +passed to subsequent commands. +If any of +.SM +.BR COMP_WORDBREAKS , +.SM +.BR RANDOM , +.SM +.BR SECONDS , +.SM +.BR LINENO , +.SM +.BR HISTCMD , +.SM +.BR FUNCNAME , +.SM +.BR GROUPS , +or +.SM +.B DIRSTACK +are unset, they lose their special properties, even if they are +subsequently reset. The exit status is true unless a +.I name +is readonly. +.TP +\fBwait\fP [\fB\-n\fP] [\fIn ...\fP] +Wait for each specified child process and return its termination status. +Each +.I n +may be a process +ID or a job specification; if a job spec is given, all processes +in that job's pipeline are waited for. If +.I n +is not given, all currently active child processes +are waited for, and the return status is zero. +If the \fB\-n\fP option is supplied, \fBwait\fP waits for any job to +terminate and returns its exit status. +If +.I n +specifies a non-existent process or job, the return status is +127. Otherwise, the return status is the exit status of the last +process or job waited for. +.\" bash_builtins +.if \n(zZ=1 .ig zZ +.SH "RESTRICTED SHELL" +.\" rbash.1 +.zY +.PP +If +.B bash +is started with the name +.BR rbash , +or the +.B \-r +option is supplied at invocation, +the shell becomes restricted. +A restricted shell is used to +set up an environment more controlled than the standard shell. +It behaves identically to +.B bash +with the exception that the following are disallowed or not performed: +.IP \(bu +changing directories with \fBcd\fP +.IP \(bu +setting or unsetting the values of +.SM +.BR SHELL , +.SM +.BR PATH , +.SM +.BR ENV , +or +.SM +.B BASH_ENV +.IP \(bu +specifying command names containing +.B / +.IP \(bu +specifying a filename containing a +.B / +as an argument to the +.B . +builtin command +.IP \(bu +specifying a filename containing a slash as an argument to the +.B \-p +option to the +.B hash +builtin command +.IP \(bu +importing function definitions from the shell environment at startup +.IP \(bu +parsing the value of +.SM +.B SHELLOPTS +from the shell environment at startup +.IP \(bu +redirecting output using the >, >|, <>, >&, &>, and >> redirection operators +.IP \(bu +using the +.B exec +builtin command to replace the shell with another command +.IP \(bu +adding or deleting builtin commands with the +.B \-f +and +.B \-d +options to the +.B enable +builtin command +.IP \(bu +using the \fBenable\fP builtin command to enable disabled shell builtins +.IP \(bu +specifying the +.B \-p +option to the +.B command +builtin command +.IP \(bu +turning off restricted mode with +\fBset +r\fP or \fBset +o restricted\fP. +.PP +These restrictions are enforced after any startup files are read. +.PP +.ie \n(zY=1 When a command that is found to be a shell script is executed, +.el \{ When a command that is found to be a shell script is executed +(see +.SM +.B "COMMAND EXECUTION" +above), +\} +.B rbash +turns off any restrictions in the shell spawned to execute the +script. +.\" end of rbash.1 +.if \n(zY=1 .ig zY +.SH "SEE ALSO" +.PD 0 +.TP +\fIBash Reference Manual\fP, Brian Fox and Chet Ramey +.TP +\fIThe Gnu Readline Library\fP, Brian Fox and Chet Ramey +.TP +\fIThe Gnu History Library\fP, Brian Fox and Chet Ramey +.TP +\fIPortable Operating System Interface (POSIX) Part 2: Shell and Utilities\fP, IEEE -- +http://pubs.opengroup.org/onlinepubs/9699919799/ +.TP +http://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode +.TP +\fIsh\fP(1), \fIksh\fP(1), \fIcsh\fP(1) +.TP +\fIemacs\fP(1), \fIvi\fP(1) +.TP +\fIreadline\fP(3) +.PD +.SH FILES +.PD 0 +.TP +.FN /bin/bash +The \fBbash\fP executable +.TP +.FN /etc/profile +The systemwide initialization file, executed for login shells +.TP +.FN /etc/bash.bashrc +The systemwide per-interactive-shell startup file +.TP +.FN /etc/bash.bash.logout +The systemwide login shell cleanup file, executed when a login shell exits +.TP +.FN ~/.bash_profile +The personal initialization file, executed for login shells +.TP +.FN ~/.bashrc +The individual per-interactive-shell startup file +.TP +.FN ~/.bash_logout +The individual login shell cleanup file, executed when a login shell exits +.TP +.FN ~/.inputrc +Individual \fIreadline\fP initialization file +.PD +.SH AUTHORS +Brian Fox, Free Software Foundation +.br +bfox@gnu.org +.PP +Chet Ramey, Case Western Reserve University +.br +chet.ramey@case.edu +.SH BUG REPORTS +If you find a bug in +.B bash, +you should report it. But first, you should +make sure that it really is a bug, and that it appears in the latest +version of +.BR bash . +The latest version is always available from +\fIftp://ftp.gnu.org/pub/gnu/bash/\fP. +.PP +Once you have determined that a bug actually exists, use the +.I bashbug +command to submit a bug report. +If you have a fix, you are encouraged to mail that as well! +Suggestions and `philosophical' bug reports may be mailed +to \fIbug-bash@gnu.org\fP or posted to the Usenet +newsgroup +.BR gnu.bash.bug . +.PP +ALL bug reports should include: +.PP +.PD 0 +.TP 20 +The version number of \fBbash\fR +.TP +The hardware and operating system +.TP +The compiler used to compile +.TP +A description of the bug behaviour +.TP +A short script or `recipe' which exercises the bug +.PD +.PP +.I bashbug +inserts the first three items automatically into the template +it provides for filing a bug report. +.PP +Comments and bug reports concerning +this manual page should be directed to +.IR chet.ramey@case.edu . +.SH BUGS +.PP +It's too big and too slow. +.PP +There are some subtle differences between +.B bash +and traditional versions of +.BR sh , +mostly because of the +.SM +.B POSIX +specification. +.PP +Aliases are confusing in some uses. +.PP +Shell builtin commands and functions are not stoppable/restartable. +.PP +Compound commands and command sequences of the form `a ; b ; c' +are not handled gracefully when process suspension is attempted. +When a process is stopped, the shell immediately executes the next +command in the sequence. +It suffices to place the sequence of commands between +parentheses to force it into a subshell, which may be stopped as +a unit. +.PP +Array variables may not (yet) be exported. +.PP +There may be only one active coprocess at a time. +.zZ +.zY diff --git a/.pc/exec-redirections-doc.diff/doc/bashref.texi b/.pc/exec-redirections-doc.diff/doc/bashref.texi new file mode 100644 index 0000000..2f6862f --- /dev/null +++ b/.pc/exec-redirections-doc.diff/doc/bashref.texi @@ -0,0 +1,8747 @@ +\input texinfo.tex @c -*- texinfo -*- +@c %**start of header +@setfilename bashref.info +@settitle Bash Reference Manual + +@include version.texi +@c %**end of header + +@copying +This text is a brief description of the features that are present in +the Bash shell (version @value{VERSION}, @value{UPDATED}). + +This is Edition @value{EDITION}, last updated @value{UPDATED}, +of @cite{The GNU Bash Reference Manual}, +for @code{Bash}, Version @value{VERSION}. + +Copyright @copyright{} 1988--2014 Free Software Foundation, Inc. + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 or +any later version published by the Free Software Foundation; with no +Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. +A copy of the license is included in the section entitled +``GNU Free Documentation License''. +@end quotation +@end copying + +@defcodeindex bt +@defcodeindex rw +@set BashFeatures + +@dircategory Basics +@direntry +* Bash: (bash). The GNU Bourne-Again SHell. +@end direntry + +@finalout + +@titlepage +@title Bash Reference Manual +@subtitle Reference Documentation for Bash +@subtitle Edition @value{EDITION}, for @code{Bash} Version @value{VERSION}. +@subtitle @value{UPDATED-MONTH} +@author Chet Ramey, Case Western Reserve University +@author Brian Fox, Free Software Foundation + +@page +@vskip 0pt plus 1filll +@insertcopying + +@end titlepage + +@contents + +@ifnottex +@node Top, Introduction, (dir), (dir) +@top Bash Features + +This text is a brief description of the features that are present in +the Bash shell (version @value{VERSION}, @value{UPDATED}). +The Bash home page is @url{http://www.gnu.org/software/bash/}. + +This is Edition @value{EDITION}, last updated @value{UPDATED}, +of @cite{The GNU Bash Reference Manual}, +for @code{Bash}, Version @value{VERSION}. + +Bash contains features that appear in other popular shells, and some +features that only appear in Bash. Some of the shells that Bash has +borrowed concepts from are the Bourne Shell (@file{sh}), the Korn Shell +(@file{ksh}), and the C-shell (@file{csh} and its successor, +@file{tcsh}). The following menu breaks the features up into +categories, noting which features were inspired by other shells and +which are specific to Bash. + +This manual is meant as a brief introduction to features found in +Bash. The Bash manual page should be used as the definitive +reference on shell behavior. + +@menu +* Introduction:: An introduction to the shell. +* Definitions:: Some definitions used in the rest of this + manual. +* Basic Shell Features:: The shell "building blocks". +* Shell Builtin Commands:: Commands that are a part of the shell. +* Shell Variables:: Variables used or set by Bash. +* Bash Features:: Features found only in Bash. +* Job Control:: What job control is and how Bash allows you + to use it. +* Command Line Editing:: Chapter describing the command line + editing features. +* Using History Interactively:: Command History Expansion +* Installing Bash:: How to build and install Bash on your system. +* Reporting Bugs:: How to report bugs in Bash. +* Major Differences From The Bourne Shell:: A terse list of the differences + between Bash and historical + versions of /bin/sh. +* GNU Free Documentation License:: Copying and sharing this documentation. +* Indexes:: Various indexes for this manual. +@end menu +@end ifnottex + +@node Introduction +@chapter Introduction +@menu +* What is Bash?:: A short description of Bash. +* What is a shell?:: A brief introduction to shells. +@end menu + +@node What is Bash? +@section What is Bash? + +Bash is the shell, or command language interpreter, +for the @sc{gnu} operating system. +The name is an acronym for the @samp{Bourne-Again SHell}, +a pun on Stephen Bourne, the author of the direct ancestor of +the current Unix shell @code{sh}, +which appeared in the Seventh Edition Bell Labs Research version +of Unix. + +Bash is largely compatible with @code{sh} and incorporates useful +features from the Korn shell @code{ksh} and the C shell @code{csh}. +It is intended to be a conformant implementation of the @sc{ieee} +@sc{posix} Shell and Tools portion of the @sc{ieee} @sc{posix} +specification (@sc{ieee} Standard 1003.1). +It offers functional improvements over @code{sh} for both interactive and +programming use. + +While the @sc{gnu} operating system provides other shells, including +a version of @code{csh}, Bash is the default shell. +Like other @sc{gnu} software, Bash is quite portable. It currently runs +on nearly every version of Unix and a few other operating systems @minus{} +independently-supported ports exist for @sc{ms-dos}, @sc{os/2}, +and Windows platforms. + +@node What is a shell? +@section What is a shell? + +At its base, a shell is simply a macro processor that executes +commands. The term macro processor means functionality where text +and symbols are expanded to create larger expressions. + +A Unix shell is both a command interpreter and a programming +language. As a command interpreter, the shell provides the user +interface to the rich set of @sc{gnu} utilities. The programming +language features allow these utilities to be combined. +Files containing commands can be created, and become +commands themselves. These new commands have the same status as +system commands in directories such as @file{/bin}, allowing users +or groups to establish custom environments to automate their common +tasks. + +Shells may be used interactively or non-interactively. In +interactive mode, they accept input typed from the keyboard. +When executing non-interactively, shells execute commands read +from a file. + +A shell allows execution of @sc{gnu} commands, both synchronously and +asynchronously. +The shell waits for synchronous commands to complete before accepting +more input; asynchronous commands continue to execute in parallel +with the shell while it reads and executes additional commands. +The @dfn{redirection} constructs permit +fine-grained control of the input and output of those commands. +Moreover, the shell allows control over the contents of commands' +environments. + +Shells also provide a small set of built-in +commands (@dfn{builtins}) implementing functionality impossible +or inconvenient to obtain via separate utilities. +For example, @code{cd}, @code{break}, @code{continue}, and +@code{exec} cannot be implemented outside of the shell because +they directly manipulate the shell itself. +The @code{history}, @code{getopts}, @code{kill}, or @code{pwd} +builtins, among others, could be implemented in separate utilities, +but they are more convenient to use as builtin commands. +All of the shell builtins are described in +subsequent sections. + +While executing commands is essential, most of the power (and +complexity) of shells is due to their embedded programming +languages. Like any high-level language, the shell provides +variables, flow control constructs, quoting, and functions. + +Shells offer features geared specifically for +interactive use rather than to augment the programming language. +These interactive features include job control, command line +editing, command history and aliases. Each of these features is +described in this manual. + +@node Definitions +@chapter Definitions +These definitions are used throughout the remainder of this manual. + +@table @code + +@item POSIX +@cindex POSIX +A family of open system standards based on Unix. Bash +is primarily concerned with the Shell and Utilities portion of the +@sc{posix} 1003.1 standard. + +@item blank +A space or tab character. + +@item builtin +@cindex builtin +A command that is implemented internally by the shell itself, rather +than by an executable program somewhere in the file system. + +@item control operator +@cindex control operator +A @code{token} that performs a control function. It is a @code{newline} +or one of the following: +@samp{||}, @samp{&&}, @samp{&}, @samp{;}, @samp{;;}, +@samp{|}, @samp{|&}, @samp{(}, or @samp{)}. + +@item exit status +@cindex exit status +The value returned by a command to its caller. The value is restricted +to eight bits, so the maximum value is 255. + +@item field +@cindex field +A unit of text that is the result of one of the shell expansions. After +expansion, when executing a command, the resulting fields are used as +the command name and arguments. + +@item filename +@cindex filename +A string of characters used to identify a file. + +@item job +@cindex job +A set of processes comprising a pipeline, and any processes descended +from it, that are all in the same process group. + +@item job control +@cindex job control +A mechanism by which users can selectively stop (suspend) and restart +(resume) execution of processes. + +@item metacharacter +@cindex metacharacter +A character that, when unquoted, separates words. A metacharacter is +a @code{blank} or one of the following characters: +@samp{|}, @samp{&}, @samp{;}, @samp{(}, @samp{)}, @samp{<}, or +@samp{>}. + +@item name +@cindex name +@cindex identifier +A @code{word} consisting solely of letters, numbers, and underscores, +and beginning with a letter or underscore. @code{Name}s are used as +shell variable and function names. +Also referred to as an @code{identifier}. + +@item operator +@cindex operator, shell +A @code{control operator} or a @code{redirection operator}. +@xref{Redirections}, for a list of redirection operators. +Operators contain at least one unquoted @code{metacharacter}. + +@item process group +@cindex process group +A collection of related processes each having the same process +group @sc{id}. + +@item process group ID +@cindex process group ID +A unique identifier that represents a @code{process group} +during its lifetime. + +@item reserved word +@cindex reserved word +A @code{word} that has a special meaning to the shell. Most reserved +words introduce shell flow control constructs, such as @code{for} and +@code{while}. + +@item return status +@cindex return status +A synonym for @code{exit status}. + +@item signal +@cindex signal +A mechanism by which a process may be notified by the kernel +of an event occurring in the system. + +@item special builtin +@cindex special builtin +A shell builtin command that has been classified as special by the +@sc{posix} standard. + +@item token +@cindex token +A sequence of characters considered a single unit by the shell. +It is either a @code{word} or an @code{operator}. + +@item word +@cindex word +A sequence of characters treated as a unit by the shell. +Words may not include unquoted @code{metacharacters}. +@end table + +@node Basic Shell Features +@chapter Basic Shell Features +@cindex Bourne shell + +Bash is an acronym for @samp{Bourne-Again SHell}. +The Bourne shell is +the traditional Unix shell originally written by Stephen Bourne. +All of the Bourne shell builtin commands are available in Bash, +The rules for evaluation and quoting are taken from the @sc{posix} +specification for the `standard' Unix shell. + +This chapter briefly summarizes the shell's `building blocks': +commands, control structures, shell functions, shell @i{parameters}, +shell expansions, +@i{redirections}, which are a way to direct input and output from +and to named files, and how the shell executes commands. + +@menu +* Shell Syntax:: What your input means to the shell. +* Shell Commands:: The types of commands you can use. +* Shell Functions:: Grouping commands by name. +* Shell Parameters:: How the shell stores values. +* Shell Expansions:: How Bash expands parameters and the various + expansions available. +* Redirections:: A way to control where input and output go. +* Executing Commands:: What happens when you run a command. +* Shell Scripts:: Executing files of shell commands. +@end menu + +@node Shell Syntax +@section Shell Syntax +@menu +* Shell Operation:: The basic operation of the shell. +* Quoting:: How to remove the special meaning from characters. +* Comments:: How to specify comments. +@end menu + +When the shell reads input, it proceeds through a +sequence of operations. If the input indicates the beginning of a +comment, the shell ignores the comment symbol (@samp{#}), and the rest +of that line. + +Otherwise, roughly speaking, the shell reads its input and +divides the input into words and operators, employing the quoting rules +to select which meanings to assign various words and characters. + +The shell then parses these tokens into commands and other constructs, +removes the special meaning of certain words or characters, expands +others, redirects input and output as needed, executes the specified +command, waits for the command's exit status, and makes that exit status +available for further inspection or processing. + +@node Shell Operation +@subsection Shell Operation + +The following is a brief description of the shell's operation when it +reads and executes a command. Basically, the shell does the +following: + +@enumerate +@item +Reads its input from a file (@pxref{Shell Scripts}), from a string +supplied as an argument to the @option{-c} invocation option +(@pxref{Invoking Bash}), or from the user's terminal. + +@item +Breaks the input into words and operators, obeying the quoting rules +described in @ref{Quoting}. These tokens are separated by +@code{metacharacters}. Alias expansion is performed by this step +(@pxref{Aliases}). + +@item +Parses the tokens into simple and compound commands +(@pxref{Shell Commands}). + +@item +Performs the various shell expansions (@pxref{Shell Expansions}), breaking +the expanded tokens into lists of filenames (@pxref{Filename Expansion}) +and commands and arguments. + +@item +Performs any necessary redirections (@pxref{Redirections}) and removes +the redirection operators and their operands from the argument list. + +@item +Executes the command (@pxref{Executing Commands}). + +@item +Optionally waits for the command to complete and collects its exit +status (@pxref{Exit Status}). + +@end enumerate + +@node Quoting +@subsection Quoting +@cindex quoting +@menu +* Escape Character:: How to remove the special meaning from a single + character. +* Single Quotes:: How to inhibit all interpretation of a sequence + of characters. +* Double Quotes:: How to suppress most of the interpretation of a + sequence of characters. +* ANSI-C Quoting:: How to expand ANSI-C sequences in quoted strings. +* Locale Translation:: How to translate strings into different languages. +@end menu + +Quoting is used to remove the special meaning of certain +characters or words to the shell. Quoting can be used to +disable special treatment for special characters, to prevent +reserved words from being recognized as such, and to prevent +parameter expansion. + +Each of the shell metacharacters (@pxref{Definitions}) +has special meaning to the shell and must be quoted if it is to +represent itself. +When the command history expansion facilities are being used +(@pxref{History Interaction}), the +@var{history expansion} character, usually @samp{!}, must be quoted +to prevent history expansion. @xref{Bash History Facilities}, for +more details concerning history expansion. + +There are three quoting mechanisms: the +@var{escape character}, single quotes, and double quotes. + +@node Escape Character +@subsubsection Escape Character +A non-quoted backslash @samp{\} is the Bash escape character. +It preserves the literal value of the next character that follows, +with the exception of @code{newline}. If a @code{\newline} pair +appears, and the backslash itself is not quoted, the @code{\newline} +is treated as a line continuation (that is, it is removed from +the input stream and effectively ignored). + +@node Single Quotes +@subsubsection Single Quotes + +Enclosing characters in single quotes (@samp{'}) preserves the literal value +of each character within the quotes. A single quote may not occur +between single quotes, even when preceded by a backslash. + +@node Double Quotes +@subsubsection Double Quotes + +Enclosing characters in double quotes (@samp{"}) preserves the literal value +of all characters within the quotes, with the exception of +@samp{$}, @samp{`}, @samp{\}, +and, when history expansion is enabled, @samp{!}. +The characters @samp{$} and @samp{`} +retain their special meaning within double quotes (@pxref{Shell Expansions}). +The backslash retains its special meaning only when followed by one of +the following characters: +@samp{$}, @samp{`}, @samp{"}, @samp{\}, or @code{newline}. +Within double quotes, backslashes that are followed by one of these +characters are removed. Backslashes preceding characters without a +special meaning are left unmodified. +A double quote may be quoted within double quotes by preceding it with +a backslash. +If enabled, history expansion will be performed unless an @samp{!} +appearing in double quotes is escaped using a backslash. +The backslash preceding the @samp{!} is not removed. + +The special parameters @samp{*} and @samp{@@} have special meaning +when in double quotes (@pxref{Shell Parameter Expansion}). + +@node ANSI-C Quoting +@subsubsection ANSI-C Quoting +@cindex quoting, ANSI + +Words of the form @code{$'@var{string}'} are treated specially. The +word expands to @var{string}, with backslash-escaped characters replaced +as specified by the ANSI C standard. Backslash escape sequences, if +present, are decoded as follows: + +@table @code +@item \a +alert (bell) +@item \b +backspace +@item \e +@itemx \E +an escape character (not ANSI C) +@item \f +form feed +@item \n +newline +@item \r +carriage return +@item \t +horizontal tab +@item \v +vertical tab +@item \\ +backslash +@item \' +single quote +@item \" +double quote +@item \@var{nnn} +the eight-bit character whose value is the octal value @var{nnn} +(one to three digits) +@item \x@var{HH} +the eight-bit character whose value is the hexadecimal value @var{HH} +(one or two hex digits) +@item \u@var{HHHH} +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +@var{HHHH} (one to four hex digits) +@item \U@var{HHHHHHHH} +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +@var{HHHHHHHH} (one to eight hex digits) +@item \c@var{x} +a control-@var{x} character +@end table + +@noindent +The expanded result is single-quoted, as if the dollar sign had not +been present. + +@node Locale Translation +@subsubsection Locale-Specific Translation +@cindex localization +@cindex internationalization +@cindex native languages +@cindex translation, native languages + +A double-quoted string preceded by a dollar sign (@samp{$}) will cause +the string to be translated according to the current locale. +If the current locale is @code{C} or @code{POSIX}, the dollar sign +is ignored. +If the string is translated and replaced, the replacement is +double-quoted. + +@vindex LC_MESSAGES +@vindex TEXTDOMAIN +@vindex TEXTDOMAINDIR +Some systems use the message catalog selected by the @env{LC_MESSAGES} +shell variable. Others create the name of the message catalog from the +value of the @env{TEXTDOMAIN} shell variable, possibly adding a +suffix of @samp{.mo}. If you use the @env{TEXTDOMAIN} variable, you +may need to set the @env{TEXTDOMAINDIR} variable to the location of +the message catalog files. Still others use both variables in this +fashion: +@env{TEXTDOMAINDIR}/@env{LC_MESSAGES}/LC_MESSAGES/@env{TEXTDOMAIN}.mo. + +@node Comments +@subsection Comments +@cindex comments, shell + +In a non-interactive shell, or an interactive shell in which the +@code{interactive_comments} option to the @code{shopt} +builtin is enabled (@pxref{The Shopt Builtin}), +a word beginning with @samp{#} +causes that word and all remaining characters on that line to +be ignored. An interactive shell without the @code{interactive_comments} +option enabled does not allow comments. The @code{interactive_comments} +option is on by default in interactive shells. +@xref{Interactive Shells}, for a description of what makes +a shell interactive. + +@node Shell Commands +@section Shell Commands +@cindex commands, shell + +A simple shell command such as @code{echo a b c} consists of the command +itself followed by arguments, separated by spaces. + +More complex shell commands are composed of simple commands arranged together +in a variety of ways: in a pipeline in which the output of one command +becomes the input of a second, in a loop or conditional construct, or in +some other grouping. + +@menu +* Simple Commands:: The most common type of command. +* Pipelines:: Connecting the input and output of several + commands. +* Lists:: How to execute commands sequentially. +* Compound Commands:: Shell commands for control flow. +* Coprocesses:: Two-way communication between commands. +* GNU Parallel:: Running commands in parallel. +@end menu + +@node Simple Commands +@subsection Simple Commands +@cindex commands, simple + +A simple command is the kind of command encountered most often. +It's just a sequence of words separated by @code{blank}s, terminated +by one of the shell's control operators (@pxref{Definitions}). The +first word generally specifies a command to be executed, with the +rest of the words being that command's arguments. + +The return status (@pxref{Exit Status}) of a simple command is +its exit status as provided +by the @sc{posix} 1003.1 @code{waitpid} function, or 128+@var{n} if +the command was terminated by signal @var{n}. + +@node Pipelines +@subsection Pipelines +@cindex pipeline +@cindex commands, pipelines + +A @code{pipeline} is a sequence of simple commands separated by one of +the control operators @samp{|} or @samp{|&}. + +@rwindex time +@rwindex ! +@cindex command timing +The format for a pipeline is +@example +[time [-p]] [!] @var{command1} [ | or |& @var{command2} ] @dots{} +@end example + +@noindent +The output of each command in the pipeline is connected via a pipe +to the input of the next command. +That is, each command reads the previous command's output. This +connection is performed before any redirections specified by the +command. + +If @samp{|&} is used, @var{command1}'s standard error, in addition to +its standard output, is connected to +@var{command2}'s standard input through the pipe; +it is shorthand for @code{2>&1 |}. +This implicit redirection of the standard error to the standard output is +performed after any redirections specified by the command. + +The reserved word @code{time} causes timing statistics +to be printed for the pipeline once it finishes. +The statistics currently consist of elapsed (wall-clock) time and +user and system time consumed by the command's execution. +The @option{-p} option changes the output format to that specified +by @sc{posix}. +When the shell is in @sc{posix} mode (@pxref{Bash POSIX Mode}), +it does not recognize @code{time} as a reserved word if the next +token begins with a @samp{-}. +The @env{TIMEFORMAT} variable may be set to a format string that +specifies how the timing information should be displayed. +@xref{Bash Variables}, for a description of the available formats. +The use of @code{time} as a reserved word permits the timing of +shell builtins, shell functions, and pipelines. An external +@code{time} command cannot time these easily. + +When the shell is in @sc{posix} mode (@pxref{Bash POSIX Mode}), @code{time} +may be followed by a newline. In this case, the shell displays the +total user and system time consumed by the shell and its children. +The @env{TIMEFORMAT} variable may be used to specify the format of +the time information. + +If the pipeline is not executed asynchronously (@pxref{Lists}), the +shell waits for all commands in the pipeline to complete. + +Each command in a pipeline is executed in its own subshell +(@pxref{Command Execution Environment}). The exit +status of a pipeline is the exit status of the last command in the +pipeline, unless the @code{pipefail} option is enabled +(@pxref{The Set Builtin}). +If @code{pipefail} is enabled, the pipeline's return status is the +value of the last (rightmost) command to exit with a non-zero status, +or zero if all commands exit successfully. +If the reserved word @samp{!} precedes the pipeline, the +exit status is the logical negation of the exit status as described +above. +The shell waits for all commands in the pipeline to terminate before +returning a value. + +@node Lists +@subsection Lists of Commands +@cindex commands, lists + +A @code{list} is a sequence of one or more pipelines separated by one +of the operators @samp{;}, @samp{&}, @samp{&&}, or @samp{||}, +and optionally terminated by one of @samp{;}, @samp{&}, or a +@code{newline}. + +Of these list operators, @samp{&&} and @samp{||} +have equal precedence, followed by @samp{;} and @samp{&}, +which have equal precedence. + +A sequence of one or more newlines may appear in a @code{list} +to delimit commands, equivalent to a semicolon. + +If a command is terminated by the control operator @samp{&}, +the shell executes the command asynchronously in a subshell. +This is known as executing the command in the @var{background}. +The shell does not wait for the command to finish, and the return +status is 0 (true). +When job control is not active (@pxref{Job Control}), +the standard input for asynchronous commands, in the absence of any +explicit redirections, is redirected from @code{/dev/null}. + +Commands separated by a @samp{;} are executed sequentially; the shell +waits for each command to terminate in turn. The return status is the +exit status of the last command executed. + +@sc{and} and @sc{or} lists are sequences of one or more pipelines +separated by the control operators @samp{&&} and @samp{||}, +respectively. @sc{and} and @sc{or} lists are executed with left +associativity. + +An @sc{and} list has the form +@example +@var{command1} && @var{command2} +@end example + +@noindent +@var{command2} is executed if, and only if, @var{command1} +returns an exit status of zero. + +An @sc{or} list has the form +@example +@var{command1} || @var{command2} +@end example + +@noindent +@var{command2} is executed if, and only if, @var{command1} +returns a non-zero exit status. + +The return status of +@sc{and} and @sc{or} lists is the exit status of the last command +executed in the list. + +@node Compound Commands +@subsection Compound Commands +@cindex commands, compound + +@menu +* Looping Constructs:: Shell commands for iterative action. +* Conditional Constructs:: Shell commands for conditional execution. +* Command Grouping:: Ways to group commands. +@end menu + +Compound commands are the shell programming constructs. +Each construct begins with a reserved word or control operator and is +terminated by a corresponding reserved word or operator. +Any redirections (@pxref{Redirections}) associated with a compound command +apply to all commands within that compound command unless explicitly overridden. + +In most cases a list of commands in a compound command's description may be +separated from the rest of the command by one or more newlines, and may be +followed by a newline in place of a semicolon. + +Bash provides looping constructs, conditional commands, and mechanisms +to group commands and execute them as a unit. + +@node Looping Constructs +@subsubsection Looping Constructs +@cindex commands, looping + +Bash supports the following looping constructs. + +Note that wherever a @samp{;} appears in the description of a +command's syntax, it may be replaced with one or more newlines. + +@table @code +@item until +@rwindex until +@rwindex do +@rwindex done +The syntax of the @code{until} command is: + +@example +until @var{test-commands}; do @var{consequent-commands}; done +@end example + +Execute @var{consequent-commands} as long as +@var{test-commands} has an exit status which is not zero. +The return status is the exit status of the last command executed +in @var{consequent-commands}, or zero if none was executed. + +@item while +@rwindex while +The syntax of the @code{while} command is: + +@example +while @var{test-commands}; do @var{consequent-commands}; done +@end example + +Execute @var{consequent-commands} as long as +@var{test-commands} has an exit status of zero. +The return status is the exit status of the last command executed +in @var{consequent-commands}, or zero if none was executed. + +@item for +@rwindex for +The syntax of the @code{for} command is: + +@example +for @var{name} [ [in [@var{words} @dots{}] ] ; ] do @var{commands}; done +@end example + +Expand @var{words}, and execute @var{commands} once for each member +in the resultant list, with @var{name} bound to the current member. +If @samp{in @var{words}} is not present, the @code{for} command +executes the @var{commands} once for each positional parameter that is +set, as if @samp{in "$@@"} had been specified +(@pxref{Special Parameters}). +The return status is the exit status of the last command that executes. +If there are no items in the expansion of @var{words}, no commands are +executed, and the return status is zero. + +An alternate form of the @code{for} command is also supported: + +@example +for (( @var{expr1} ; @var{expr2} ; @var{expr3} )) ; do @var{commands} ; done +@end example + +First, the arithmetic expression @var{expr1} is evaluated according +to the rules described below (@pxref{Shell Arithmetic}). +The arithmetic expression @var{expr2} is then evaluated repeatedly +until it evaluates to zero. +Each time @var{expr2} evaluates to a non-zero value, @var{commands} are +executed and the arithmetic expression @var{expr3} is evaluated. +If any expression is omitted, it behaves as if it evaluates to 1. +The return value is the exit status of the last command in @var{commands} +that is executed, or false if any of the expressions is invalid. +@end table + +The @code{break} and @code{continue} builtins (@pxref{Bourne Shell Builtins}) +may be used to control loop execution. + +@node Conditional Constructs +@subsubsection Conditional Constructs +@cindex commands, conditional + +@table @code +@item if +@rwindex if +@rwindex then +@rwindex else +@rwindex elif +@rwindex fi +The syntax of the @code{if} command is: + +@example +if @var{test-commands}; then + @var{consequent-commands}; +[elif @var{more-test-commands}; then + @var{more-consequents};] +[else @var{alternate-consequents};] +fi +@end example + +The @var{test-commands} list is executed, and if its return status is zero, +the @var{consequent-commands} list is executed. +If @var{test-commands} returns a non-zero status, each @code{elif} list +is executed in turn, and if its exit status is zero, +the corresponding @var{more-consequents} is executed and the +command completes. +If @samp{else @var{alternate-consequents}} is present, and +the final command in the final @code{if} or @code{elif} clause +has a non-zero exit status, then @var{alternate-consequents} is executed. +The return status is the exit status of the last command executed, or +zero if no condition tested true. + +@item case +@rwindex case +@rwindex in +@rwindex esac +The syntax of the @code{case} command is: + +@example +case @var{word} in [ [(] @var{pattern} [| @var{pattern}]@dots{}) @var{command-list} ;;]@dots{} esac +@end example + +@code{case} will selectively execute the @var{command-list} corresponding to +the first @var{pattern} that matches @var{word}. +If the shell option @code{nocasematch} +(see the description of @code{shopt} in @ref{The Shopt Builtin}) +is enabled, the match is performed without regard to the case +of alphabetic characters. +The @samp{|} is used to separate multiple patterns, and the @samp{)} +operator terminates a pattern list. +A list of patterns and an associated command-list is known +as a @var{clause}. + +Each clause must be terminated with @samp{;;}, @samp{;&}, or @samp{;;&}. +The @var{word} undergoes tilde expansion, parameter expansion, command +substitution, arithmetic expansion, and quote removal before matching is +attempted. Each @var{pattern} undergoes tilde expansion, parameter +expansion, command substitution, and arithmetic expansion. + +There may be an arbitrary number of @code{case} clauses, each terminated +by a @samp{;;}, @samp{;&}, or @samp{;;&}. +The first pattern that matches determines the +command-list that is executed. +It's a common idiom to use @samp{*} as the final pattern to define the +default case, since that pattern will always match. + +Here is an example using @code{case} in a script that could be used to +describe one interesting feature of an animal: + +@example +echo -n "Enter the name of an animal: " +read ANIMAL +echo -n "The $ANIMAL has " +case $ANIMAL in + horse | dog | cat) echo -n "four";; + man | kangaroo ) echo -n "two";; + *) echo -n "an unknown number of";; +esac +echo " legs." +@end example + +@noindent + +If the @samp{;;} operator is used, no subsequent matches are attempted after +the first pattern match. +Using @samp{;&} in place of @samp{;;} causes execution to continue with +the @var{command-list} associated with the next clause, if any. +Using @samp{;;&} in place of @samp{;;} causes the shell to test the patterns +in the next clause, if any, and execute any associated @var{command-list} +on a successful match. + +The return status is zero if no @var{pattern} is matched. Otherwise, the +return status is the exit status of the @var{command-list} executed. + +@item select +@rwindex select + +The @code{select} construct allows the easy generation of menus. +It has almost the same syntax as the @code{for} command: + +@example +select @var{name} [in @var{words} @dots{}]; do @var{commands}; done +@end example + +The list of words following @code{in} is expanded, generating a list +of items. The set of expanded words is printed on the standard +error output stream, each preceded by a number. If the +@samp{in @var{words}} is omitted, the positional parameters are printed, +as if @samp{in "$@@"} had been specified. +The @env{PS3} prompt is then displayed and a line is read from the +standard input. +If the line consists of a number corresponding to one of the displayed +words, then the value of @var{name} is set to that word. +If the line is empty, the words and prompt are displayed again. +If @code{EOF} is read, the @code{select} command completes. +Any other value read causes @var{name} to be set to null. +The line read is saved in the variable @env{REPLY}. + +The @var{commands} are executed after each selection until a +@code{break} command is executed, at which +point the @code{select} command completes. + +Here is an example that allows the user to pick a filename from the +current directory, and displays the name and index of the file +selected. + +@example +select fname in *; +do + echo you picked $fname \($REPLY\) + break; +done +@end example + +@item ((@dots{})) +@example +(( @var{expression} )) +@end example + +The arithmetic @var{expression} is evaluated according to the rules +described below (@pxref{Shell Arithmetic}). +If the value of the expression is non-zero, the return status is 0; +otherwise the return status is 1. This is exactly equivalent to +@example +let "@var{expression}" +@end example +@noindent +@xref{Bash Builtins}, for a full description of the @code{let} builtin. + +@item [[@dots{}]] +@rwindex [[ +@rwindex ]] +@example +[[ @var{expression} ]] +@end example + +Return a status of 0 or 1 depending on the evaluation of +the conditional expression @var{expression}. +Expressions are composed of the primaries described below in +@ref{Bash Conditional Expressions}. +Word splitting and filename expansion are not performed on the words +between the @code{[[} and @code{]]}; tilde expansion, parameter and +variable expansion, arithmetic expansion, command substitution, process +substitution, and quote removal are performed. +Conditional operators such as @samp{-f} must be unquoted to be recognized +as primaries. + +When used with @code{[[}, the @samp{<} and @samp{>} operators sort +lexicographically using the current locale. + +When the @samp{==} and @samp{!=} operators are used, the string to the +right of the operator is considered a pattern and matched according +to the rules described below in @ref{Pattern Matching}, +as if the @code{extglob} shell option were enabled. +The @samp{=} operator is identical to @samp{==}. +If the shell option @code{nocasematch} +(see the description of @code{shopt} in @ref{The Shopt Builtin}) +is enabled, the match is performed without regard to the case +of alphabetic characters. +The return value is 0 if the string matches (@samp{==}) or does not +match (@samp{!=})the pattern, and 1 otherwise. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. + +An additional binary operator, @samp{=~}, is available, with the same +precedence as @samp{==} and @samp{!=}. +When it is used, the string to the right of the operator is considered +an extended regular expression and matched accordingly (as in @i{regex}3)). +The return value is 0 if the string matches +the pattern, and 1 otherwise. +If the regular expression is syntactically incorrect, the conditional +expression's return value is 2. +If the shell option @code{nocasematch} +(see the description of @code{shopt} in @ref{The Shopt Builtin}) +is enabled, the match is performed without regard to the case +of alphabetic characters. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +Bracket expressions in regular expressions must be treated carefully, +since normal quoting characters lose their meanings between brackets. +If the pattern is stored in a shell variable, quoting the variable +expansion forces the entire pattern to be matched as a string. +Substrings matched by parenthesized subexpressions within the regular +expression are saved in the array variable @code{BASH_REMATCH}. +The element of @code{BASH_REMATCH} with index 0 is the portion of the string +matching the entire regular expression. +The element of @code{BASH_REMATCH} with index @var{n} is the portion of the +string matching the @var{n}th parenthesized subexpression. + +For example, the following will match a line +(stored in the shell variable @var{line}) +if there is a sequence of characters in the value consisting of +any number, including zero, of +space characters, zero or one instances of @samp{a}, then a @samp{b}: +@example +[[ $line =~ [[:space:]]*(a)?b ]] +@end example + +@noindent +That means values like @samp{aab} and @samp{ aaaaaab} will match, as +will a line containing a @samp{b} anywhere in its value. + +Storing the regular expression in a shell variable is often a useful +way to avoid problems with quoting characters that are special to the +shell. +It is sometimes difficult to specify a regular expression literally +without using quotes, or to keep track of the quoting used by regular +expressions while paying attention to the shell's quote removal. +Using a shell variable to store the pattern decreases these problems. +For example, the following is equivalent to the above: +@example +pattern='[[:space:]]*(a)?b' +[[ $line =~ $pattern ]] +@end example + +@noindent +If you want to match a character that's special to the regular expression +grammar, it has to be quoted to remove its special meaning. +This means that in the pattern @samp{xxx.txt}, the @samp{.} matches any +character in the string (its usual regular expression meaning), but in the +pattern @samp{"xxx.txt"} it can only match a literal @samp{.}. +Shell programmers should take special care with backslashes, since backslashes +are used both by the shell and regular expressions to remove the special +meaning from the following character. +The following two sets of commands are @emph{not} equivalent: +@example +pattern='\.' + +[[ . =~ $pattern ]] +[[ . =~ \. ]] + +[[ . =~ "$pattern" ]] +[[ . =~ '\.' ]] +@end example + +@noindent +The first two matches will succeed, but the second two will not, because +in the second two the backslash will be part of the pattern to be matched. +In the first two examples, the backslash removes the special meaning from +@samp{.}, so the literal @samp{.} matches. +If the string in the first examples were anything other than @samp{.}, say +@samp{a}, the pattern would not match, because the quoted @samp{.} in the +pattern loses its special meaning of matching any single character. + +Expressions may be combined using the following operators, listed +in decreasing order of precedence: + +@table @code +@item ( @var{expression} ) +Returns the value of @var{expression}. +This may be used to override the normal precedence of operators. + +@item ! @var{expression} +True if @var{expression} is false. + +@item @var{expression1} && @var{expression2} +True if both @var{expression1} and @var{expression2} are true. + +@item @var{expression1} || @var{expression2} +True if either @var{expression1} or @var{expression2} is true. +@end table + +@noindent +The @code{&&} and @code{||} operators do not evaluate @var{expression2} if the +value of @var{expression1} is sufficient to determine the return +value of the entire conditional expression. +@end table + +@node Command Grouping +@subsubsection Grouping Commands +@cindex commands, grouping + +Bash provides two ways to group a list of commands to be executed +as a unit. When commands are grouped, redirections may be applied +to the entire command list. For example, the output of all the +commands in the list may be redirected to a single stream. + +@table @code +@item () +@example +( @var{list} ) +@end example + +Placing a list of commands between parentheses causes a subshell +environment to be created (@pxref{Command Execution Environment}), and each +of the commands in @var{list} to be executed in that subshell. Since the +@var{list} is executed in a subshell, variable assignments do not remain in +effect after the subshell completes. + +@item @{@} +@rwindex @{ +@rwindex @} +@example +@{ @var{list}; @} +@end example + +Placing a list of commands between curly braces causes the list to +be executed in the current shell context. No subshell is created. +The semicolon (or newline) following @var{list} is required. +@end table + +In addition to the creation of a subshell, there is a subtle difference +between these two constructs due to historical reasons. The braces +are @code{reserved words}, so they must be separated from the @var{list} +by @code{blank}s or other shell metacharacters. +The parentheses are @code{operators}, and are +recognized as separate tokens by the shell even if they are not separated +from the @var{list} by whitespace. + +The exit status of both of these constructs is the exit status of +@var{list}. + +@node Coprocesses +@subsection Coprocesses +@cindex coprocess + +A @code{coprocess} is a shell command preceded by the @code{coproc} +reserved word. +A coprocess is executed asynchronously in a subshell, as if the command +had been terminated with the @samp{&} control operator, with a two-way pipe +established between the executing shell and the coprocess. + +The format for a coprocess is: +@example +coproc [@var{NAME}] @var{command} [@var{redirections}] +@end example + +@noindent +This creates a coprocess named @var{NAME}. +If @var{NAME} is not supplied, the default name is @var{COPROC}. +@var{NAME} must not be supplied if @var{command} is a simple +command (@pxref{Simple Commands}); otherwise, it is interpreted as +the first word of the simple command. + +When the coprocess is executed, the shell creates an array variable +(@pxref{Arrays}) +named @env{NAME} in the context of the executing shell. +The standard output of @var{command} +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to @env{NAME}[0]. +The standard input of @var{command} +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to @env{NAME}[1]. +This pipe is established before any redirections specified by the +command (@pxref{Redirections}). +The file descriptors can be utilized as arguments to shell commands +and redirections using standard word expansions. +The file descriptors are not available in subshells. + +The process ID of the shell spawned to execute the coprocess is +available as the value of the variable @env{NAME}_PID. +The @code{wait} +builtin command may be used to wait for the coprocess to terminate. + +Since the coprocess is created as an asynchronous command, +the @code{coproc} command always returns success. +The return status of a coprocess is the exit status of @var{command}. + +@node GNU Parallel +@subsection GNU Parallel + +There are ways to run commands in parallel that are not built into Bash. +GNU Parallel is a tool to do just that. + +GNU Parallel, as its name suggests, can be used to build and run commands +in parallel. You may run the same command with different arguments, whether +they are filenames, usernames, hostnames, or lines read from files. GNU +Parallel provides shorthand references to many of the most common operations +(input lines, various portions of the input line, different ways to specify +the input source, and so on). Parallel can replace @code{xargs} or feed +commands from its input sources to several different instances of Bash. + +For a complete description, refer to the GNU Parallel documentation. A few +examples should provide a brief introduction to its use. + +For example, it is easy to replace @code{xargs} to gzip all html files in the +current directory and its subdirectories: +@example +find . -type f -name '*.html' -print | parallel gzip +@end example +@noindent +If you need to protect special characters such as newlines in file names, +use find's @option{-print0} option and parallel's @option{-0} option. + +You can use Parallel to move files from the current directory when the +number of files is too large to process with one @code{mv} invocation: +@example +ls | parallel mv @{@} destdir +@end example + +As you can see, the @{@} is replaced with each line read from standard input. +While using @code{ls} will work in most instances, it is not sufficient to +deal with all filenames. +If you need to accommodate special characters in filenames, you can use + +@example +find . -depth 1 \! -name '.*' -print0 | parallel -0 mv @{@} destdir +@end example + +@noindent +as alluded to above. + +This will run as many @code{mv} commands as there are files in the current +directory. +You can emulate a parallel @code{xargs} by adding the @option{-X} option: +@example +find . -depth 1 \! -name '.*' -print0 | parallel -0 -X mv @{@} destdir +@end example + +GNU Parallel can replace certain common idioms that operate on lines read +from a file (in this case, filenames listed one per line): +@example + while IFS= read -r x; do + do-something1 "$x" "config-$x" + do-something2 < "$x" + done < file | process-output +@end example + +@noindent +with a more compact syntax reminiscent of lambdas: +@example +cat list | parallel "do-something1 @{@} config-@{@} ; do-something2 < @{@}" | process-output +@end example + +Parallel provides a built-in mechanism to remove filename extensions, which +lends itself to batch file transformations or renaming: +@example +ls *.gz | parallel -j+0 "zcat @{@} | bzip2 >@{.@}.bz2 && rm @{@}" +@end example +@noindent +This will recompress all files in the current directory with names ending +in .gz using bzip2, running one job per CPU (-j+0) in parallel. +(We use @code{ls} for brevity here; using @code{find} as above is more +robust in the face of filenames containing unexpected characters.) +Parallel can take arguments from the command line; the above can also be +written as + +@example +parallel "zcat @{@} | bzip2 >@{.@}.bz2 && rm @{@}" ::: *.gz +@end example + +If a command generates output, you may want to preserve the input order in +the output. For instance, the following command +@example +@{ echo foss.org.my ; echo debian.org; echo freenetproject.org; @} | parallel traceroute +@end example +@noindent +will display as output the traceroute invocation that finishes first. +Adding the @option{-k} option +@example +@{ echo foss.org.my ; echo debian.org; echo freenetproject.org; @} | parallel -k traceroute +@end example +@noindent +will ensure that the output of @code{traceroute foss.org.my} is displayed first. + +Finally, Parallel can be used to run a sequence of shell commands in parallel, +similar to @samp{cat file | bash}. +It is not uncommon to take a list of filenames, create a series of shell +commands to operate on them, and feed that list of commnds to a shell. +Parallel can speed this up. Assuming that @file{file} contains a list of +shell commands, one per line, + +@example +parallel -j 10 < file +@end example + +@noindent +will evaluate the commands using the shell (since no explicit command is +supplied as an argument), in blocks of ten shell jobs at a time. + +@node Shell Functions +@section Shell Functions +@cindex shell function +@cindex functions, shell + +Shell functions are a way to group commands for later execution +using a single name for the group. They are executed just like +a "regular" command. +When the name of a shell function is used as a simple command name, +the list of commands associated with that function name is executed. +Shell functions are executed in the current +shell context; no new process is created to interpret them. + +Functions are declared using this syntax: +@rwindex function +@example +@var{name} () @var{compound-command} [ @var{redirections} ] +@end example + +or + +@example +function @var{name} [()] @var{compound-command} [ @var{redirections} ] +@end example + +This defines a shell function named @var{name}. The reserved +word @code{function} is optional. +If the @code{function} reserved +word is supplied, the parentheses are optional. +The @var{body} of the function is the compound command +@var{compound-command} (@pxref{Compound Commands}). +That command is usually a @var{list} enclosed between @{ and @}, but +may be any compound command listed above. +@var{compound-command} is executed whenever @var{name} is specified as the +name of a command. +When the shell is in @sc{posix} mode (@pxref{Bash POSIX Mode}), +@var{name} may not be the same as one of the special builtins +(@pxref{Special Builtins}). +Any redirections (@pxref{Redirections}) associated with the shell function +are performed when the function is executed. + +A function definition may be deleted using the @option{-f} option to the +@code{unset} builtin (@pxref{Bourne Shell Builtins}). + +The exit status of a function definition is zero unless a syntax error +occurs or a readonly function with the same name already exists. +When executed, the exit status of a function is the exit status of the +last command executed in the body. + +Note that for historical reasons, in the most common usage the curly braces +that surround the body of the function must be separated from the body by +@code{blank}s or newlines. +This is because the braces are reserved words and are only recognized +as such when they are separated from the command list +by whitespace or another shell metacharacter. +Also, when using the braces, the @var{list} must be terminated by a semicolon, +a @samp{&}, or a newline. + +When a function is executed, the arguments to the +function become the positional parameters +during its execution (@pxref{Positional Parameters}). +The special parameter @samp{#} that expands to the number of +positional parameters is updated to reflect the change. +Special parameter @code{0} is unchanged. +The first element of the @env{FUNCNAME} variable is set to the +name of the function while the function is executing. + +All other aspects of the shell execution +environment are identical between a function and its caller +with these exceptions: +the @env{DEBUG} and @env{RETURN} traps +are not inherited unless the function has been given the +@code{trace} attribute using the @code{declare} builtin or +the @code{-o functrace} option has been enabled with +the @code{set} builtin, +(in which case all functions inherit the @env{DEBUG} and @env{RETURN} traps), +and the @env{ERR} trap is not inherited unless the @code{-o errtrace} +shell option has been enabled. +@xref{Bourne Shell Builtins}, for the description of the +@code{trap} builtin. + +The @env{FUNCNEST} variable, if set to a numeric value greater +than 0, defines a maximum function nesting level. Function +invocations that exceed the limit cause the entire command to +abort. + +If the builtin command @code{return} +is executed in a function, the function completes and +execution resumes with the next command after the function +call. +Any command associated with the @code{RETURN} trap is executed +before execution resumes. +When a function completes, the values of the +positional parameters and the special parameter @samp{#} +are restored to the values they had prior to the function's +execution. If a numeric argument is given to @code{return}, +that is the function's return status; otherwise the function's +return status is the exit status of the last command executed +before the @code{return}. + +Variables local to the function may be declared with the +@code{local} builtin. These variables are visible only to +the function and the commands it invokes. + +Function names and definitions may be listed with the +@option{-f} option to the @code{declare} (@code{typeset}) +builtin command (@pxref{Bash Builtins}). +The @option{-F} option to @code{declare} or @code{typeset} +will list the function names only +(and optionally the source file and line number, if the @code{extdebug} +shell option is enabled). +Functions may be exported so that subshells +automatically have them defined with the +@option{-f} option to the @code{export} builtin +(@pxref{Bourne Shell Builtins}). +Note that shell functions and variables with the same name may result +in multiple identically-named entries in the environment passed to the +shell's children. +Care should be taken in cases where this may cause a problem. + +Functions may be recursive. +The @code{FUNCNEST} variable may be used to limit the depth of the +function call stack and restrict the number of function invocations. +By default, no limit is placed on the number of recursive calls. + +@node Shell Parameters +@section Shell Parameters +@cindex parameters +@cindex variable, shell +@cindex shell variable + +@menu +* Positional Parameters:: The shell's command-line arguments. +* Special Parameters:: Parameters denoted by special characters. +@end menu + +A @var{parameter} is an entity that stores values. +It can be a @code{name}, a number, or one of the special characters +listed below. +A @var{variable} is a parameter denoted by a @code{name}. +A variable has a @var{value} and zero or more @var{attributes}. +Attributes are assigned using the @code{declare} builtin command +(see the description of the @code{declare} builtin in @ref{Bash Builtins}). + +A parameter is set if it has been assigned a value. The null string is +a valid value. Once a variable is set, it may be unset only by using +the @code{unset} builtin command. + +A variable may be assigned to by a statement of the form +@example +@var{name}=[@var{value}] +@end example +@noindent +If @var{value} +is not given, the variable is assigned the null string. All +@var{value}s undergo tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote +removal (detailed below). If the variable has its @code{integer} +attribute set, then @var{value} +is evaluated as an arithmetic expression even if the @code{$((@dots{}))} +expansion is not used (@pxref{Arithmetic Expansion}). +Word splitting is not performed, with the exception +of @code{"$@@"} as explained below. +Filename expansion is not performed. +Assignment statements may also appear as arguments to the +@code{alias}, +@code{declare}, @code{typeset}, @code{export}, @code{readonly}, +and @code{local} builtin commands. +When in @sc{posix} mode (@pxref{Bash POSIX Mode}), these builtins may appear +in a command after one or more instances of the @code{command} builtin +and retain these assignment statement properties. + +In the context where an assignment statement is assigning a value +to a shell variable or array index (@pxref{Arrays}), the @samp{+=} +operator can be used to +append to or add to the variable's previous value. +When @samp{+=} is applied to a variable for which the @var{integer} attribute +has been set, @var{value} is evaluated as an arithmetic expression and +added to the variable's current value, which is also evaluated. +When @samp{+=} is applied to an array variable using compound assignment +(@pxref{Arrays}), the +variable's value is not unset (as it is when using @samp{=}), and new +values are appended to the array beginning at one greater than the array's +maximum index (for indexed arrays), or added as additional key-value pairs +in an associative array. +When applied to a string-valued variable, @var{value} is expanded and +appended to the variable's value. + +A variable can be assigned the @var{nameref} attribute using the +@option{-n} option to the \fBdeclare\fP or \fBlocal\fP builtin commands +(@pxref{Bash Builtins}) +to create a @var{nameref}, or a reference to another variable. +This allows variables to be manipulated indirectly. +Whenever the nameref variable is referenced or assigned to, the operation +is actually performed on the variable specified by the nameref variable's +value. +A nameref is commonly used within shell functions to refer to a variable +whose name is passed as an argument to the function. +For instance, if a variable name is passed to a shell function as its first +argument, running +@example +declare -n ref=$1 +@end example +@noindent +inside the function creates a nameref variable @var{ref} whose value is +the variable name passed as the first argument. +References and assignments to @var{ref} are treated as references and +assignments to the variable whose name was passed as @code{$1}. + +If the control variable in a @code{for} loop has the nameref attribute, +the list of words can be a list of shell variables, and a name reference +will be established for each word in the list, in turn, when the loop is +executed. +Array variables cannot be given the @option{-n} attribute. +However, nameref variables can reference array variables and subscripted +array variables. +Namerefs can be unset using the @option{-n} option to the @code{unset} builtin +(@pxref{Bourne Shell Builtins}). +Otherwise, if @code{unset} is executed with the name of a nameref variable +as an argument, the variable referenced by the nameref variable will be unset. + +@node Positional Parameters +@subsection Positional Parameters +@cindex parameters, positional + +A @var{positional parameter} is a parameter denoted by one or more +digits, other than the single digit @code{0}. Positional parameters are +assigned from the shell's arguments when it is invoked, +and may be reassigned using the @code{set} builtin command. +Positional parameter @code{N} may be referenced as @code{$@{N@}}, or +as @code{$N} when @code{N} consists of a single digit. +Positional parameters may not be assigned to with assignment statements. +The @code{set} and @code{shift} builtins are used to set and +unset them (@pxref{Shell Builtin Commands}). +The positional parameters are +temporarily replaced when a shell function is executed +(@pxref{Shell Functions}). + +When a positional parameter consisting of more than a single +digit is expanded, it must be enclosed in braces. + +@node Special Parameters +@subsection Special Parameters +@cindex parameters, special + +The shell treats several parameters specially. These parameters may +only be referenced; assignment to them is not allowed. + +@vtable @code + +@item * +@vindex $* +($*) Expands to the positional parameters, starting from one. +When the expansion is not within double quotes, each positional parameter +expands to a separate word. +In contexts where it is performed, those words +are subject to further word splitting and pathname expansion. +When the expansion occurs within double quotes, it expands to a single word +with the value of each parameter separated by the first character +of the @env{IFS} +special variable. That is, @code{"$*"} is equivalent +to @code{"$1@var{c}$2@var{c}@dots{}"}, where @var{c} +is the first character of the value of the @code{IFS} +variable. +If @env{IFS} is unset, the parameters are separated by spaces. +If @env{IFS} is null, the parameters are joined without intervening +separators. + +@item @@ +@vindex $@@ +($@@) Expands to the positional parameters, starting from one. When the +expansion occurs within double quotes, each parameter expands to a +separate word. That is, @code{"$@@"} is equivalent to +@code{"$1" "$2" @dots{}}. +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +When there are no positional parameters, @code{"$@@"} and +@code{$@@} +expand to nothing (i.e., they are removed). + +@item # +@vindex $# +($#) Expands to the number of positional parameters in decimal. + +@item ? +@vindex $? +($?) Expands to the exit status of the most recently executed foreground +pipeline. + +@item - +@vindex $- +($-, a hyphen.) Expands to the current option flags as specified upon +invocation, by the @code{set} +builtin command, or those set by the shell itself +(such as the @option{-i} option). + +@item $ +@vindex $$ +($$) Expands to the process @sc{id} of the shell. In a @code{()} subshell, it +expands to the process @sc{id} of the invoking shell, not the subshell. + +@item ! +@vindex $! +($!) Expands to the process @sc{id} of the job most recently placed into the +background, whether executed as an asynchronous command or using +the @code{bg} builtin (@pxref{Job Control Builtins}). + +@item 0 +@vindex $0 +($0) Expands to the name of the shell or shell script. This is set at +shell initialization. If Bash is invoked with a file of commands +(@pxref{Shell Scripts}), @code{$0} is set to the name of that file. +If Bash is started with the @option{-c} option (@pxref{Invoking Bash}), +then @code{$0} is set to the first argument after the string to be +executed, if one is present. Otherwise, it is set +to the filename used to invoke Bash, as given by argument zero. + +@item _ +@vindex $_ +($_, an underscore.) +At shell startup, set to the absolute pathname used to invoke the +shell or shell script being executed as passed in the environment +or argument list. +Subsequently, expands to the last argument to the previous command, +after expansion. +Also set to the full pathname used to invoke each command executed +and placed in the environment exported to that command. +When checking mail, this parameter holds the name of the mail file. +@end vtable + +@node Shell Expansions +@section Shell Expansions +@cindex expansion + +Expansion is performed on the command line after it has been split into +@code{token}s. There are seven kinds of expansion performed: + +@itemize @bullet +@item brace expansion +@item tilde expansion +@item parameter and variable expansion +@item command substitution +@item arithmetic expansion +@item word splitting +@item filename expansion +@end itemize + +@menu +* Brace Expansion:: Expansion of expressions within braces. +* Tilde Expansion:: Expansion of the ~ character. +* Shell Parameter Expansion:: How Bash expands variables to their values. +* Command Substitution:: Using the output of a command as an argument. +* Arithmetic Expansion:: How to use arithmetic in shell expansions. +* Process Substitution:: A way to write and read to and from a + command. +* Word Splitting:: How the results of expansion are split into separate + arguments. +* Filename Expansion:: A shorthand for specifying filenames matching patterns. +* Quote Removal:: How and when quote characters are removed from + words. +@end menu + +The order of expansions is: +brace expansion; +tilde expansion, parameter and variable expansion, arithmetic expansion, +and command substitution (done in a left-to-right fashion); +word splitting; +and filename expansion. + +On systems that can support it, there is an additional expansion +available: @var{process substitution}. +This is performed at the +same time as tilde, parameter, variable, and arithmetic expansion and +command substitution. + +Only brace expansion, word splitting, and filename expansion +can change the number of words of the expansion; other expansions +expand a single word to a single word. +The only exceptions to this are the expansions of +@code{"$@@"} (@pxref{Special Parameters}) and @code{"$@{@var{name}[@@]@}"} +(@pxref{Arrays}). + +After all expansions, @code{quote removal} (@pxref{Quote Removal}) +is performed. + +@node Brace Expansion +@subsection Brace Expansion +@cindex brace expansion +@cindex expansion, brace + +Brace expansion is a mechanism by which arbitrary strings may be generated. +This mechanism is similar to +@var{filename expansion} (@pxref{Filename Expansion}), +but the filenames generated need not exist. +Patterns to be brace expanded take the form of an optional @var{preamble}, +followed by either a series of comma-separated strings or a sequence expression +between a pair of braces, +followed by an optional @var{postscript}. +The preamble is prefixed to each string contained within the braces, and +the postscript is then appended to each resulting string, expanding left +to right. + +Brace expansions may be nested. +The results of each expanded string are not sorted; left to right order +is preserved. +For example, +@example +bash$ echo a@{d,c,b@}e +ade ace abe +@end example + +A sequence expression takes the form @code{@{@var{x}..@var{y}[..@var{incr}]@}}, +where @var{x} and @var{y} are either integers or single characters, +and @var{incr}, an optional increment, is an integer. +When integers are supplied, the expression expands to each number between +@var{x} and @var{y}, inclusive. +Supplied integers may be prefixed with @samp{0} to force each term to have the +same width. +When either @var{x} or @var{y} begins with a zero, the shell +attempts to force all generated terms to contain the same number of digits, +zero-padding where necessary. +When characters are supplied, the expression expands to each character +lexicographically between @var{x} and @var{y}, inclusive, +using the default C locale. +Note that both @var{x} and @var{y} must be of the same type. +When the increment is supplied, it is used as the difference between +each term. The default increment is 1 or -1 as appropriate. + +Brace expansion is performed before any other expansions, +and any characters special to other expansions are preserved +in the result. It is strictly textual. Bash +does not apply any syntactic interpretation to the context of the +expansion or the text between the braces. +To avoid conflicts with parameter expansion, the string @samp{$@{} +is not considered eligible for brace expansion. + +A correctly-formed brace expansion must contain unquoted opening +and closing braces, and at least one unquoted comma or a valid +sequence expression. +Any incorrectly formed brace expansion is left unchanged. + +A @{ or @samp{,} may be quoted with a backslash to prevent its +being considered part of a brace expression. +To avoid conflicts with parameter expansion, the string @samp{$@{} +is not considered eligible for brace expansion. + +This construct is typically used as shorthand when the common +prefix of the strings to be generated is longer than in the +above example: +@example +mkdir /usr/local/src/bash/@{old,new,dist,bugs@} +@end example +or +@example +chown root /usr/@{ucb/@{ex,edit@},lib/@{ex?.?*,how_ex@}@} +@end example + +@node Tilde Expansion +@subsection Tilde Expansion +@cindex tilde expansion +@cindex expansion, tilde + +If a word begins with an unquoted tilde character (@samp{~}), all of the +characters up to the first unquoted slash (or all characters, +if there is no unquoted slash) are considered a @var{tilde-prefix}. +If none of the characters in the tilde-prefix are quoted, the +characters in the tilde-prefix following the tilde are treated as a +possible @var{login name}. +If this login name is the null string, the tilde is replaced with the +value of the @env{HOME} shell variable. +If @env{HOME} is unset, the home directory of the user executing the +shell is substituted instead. +Otherwise, the tilde-prefix is replaced with the home directory +associated with the specified login name. + +If the tilde-prefix is @samp{~+}, the value of +the shell variable @env{PWD} replaces the tilde-prefix. +If the tilde-prefix is @samp{~-}, the value of the shell variable +@env{OLDPWD}, if it is set, is substituted. + +If the characters following the tilde in the tilde-prefix consist of a +number @var{N}, optionally prefixed by a @samp{+} or a @samp{-}, +the tilde-prefix is replaced with the +corresponding element from the directory stack, as it would be displayed +by the @code{dirs} builtin invoked with the characters following tilde +in the tilde-prefix as an argument (@pxref{The Directory Stack}). +If the tilde-prefix, sans the tilde, consists of a number without a +leading @samp{+} or @samp{-}, @samp{+} is assumed. + +If the login name is invalid, or the tilde expansion fails, the word is +left unchanged. + +Each variable assignment is checked for unquoted tilde-prefixes immediately +following a @samp{:} or the first @samp{=}. +In these cases, tilde expansion is also performed. +Consequently, one may use filenames with tildes in assignments to +@env{PATH}, @env{MAILPATH}, and @env{CDPATH}, +and the shell assigns the expanded value. + +The following table shows how Bash treats unquoted tilde-prefixes: + +@table @code +@item ~ +The value of @code{$HOME} +@item ~/foo +@file{$HOME/foo} + +@item ~fred/foo +The subdirectory @code{foo} of the home directory of the user +@code{fred} + +@item ~+/foo +@file{$PWD/foo} + +@item ~-/foo +@file{$@{OLDPWD-'~-'@}/foo} + +@item ~@var{N} +The string that would be displayed by @samp{dirs +@var{N}} + +@item ~+@var{N} +The string that would be displayed by @samp{dirs +@var{N}} + +@item ~-@var{N} +The string that would be displayed by @samp{dirs -@var{N}} +@end table + +@node Shell Parameter Expansion +@subsection Shell Parameter Expansion +@cindex parameter expansion +@cindex expansion, parameter + +The @samp{$} character introduces parameter expansion, +command substitution, or arithmetic expansion. The parameter name +or symbol to be expanded may be enclosed in braces, which +are optional but serve to protect the variable to be expanded from +characters immediately following it which could be +interpreted as part of the name. + +When braces are used, the matching ending brace is the first @samp{@}} +not escaped by a backslash or within a quoted string, and not within an +embedded arithmetic expansion, command substitution, or parameter +expansion. + +The basic form of parameter expansion is $@{@var{parameter}@}. +The value of @var{parameter} is substituted. +The @var{parameter} is a shell parameter as described above +(@pxref{Shell Parameters}) or an array reference (@pxref{Arrays}). +The braces are required when @var{parameter} +is a positional parameter with more than one digit, +or when @var{parameter} is followed by a character that is not to be +interpreted as part of its name. + +If the first character of @var{parameter} is an exclamation point (!), +it introduces a level of variable indirection. +Bash uses the value of the variable formed from the rest of +@var{parameter} as the name of the variable; this variable is then +expanded and that value is used in the rest of the substitution, rather +than the value of @var{parameter} itself. +This is known as @code{indirect expansion}. +The exceptions to this are the expansions of $@{!@var{prefix}*@} +and $@{!@var{name}[@@]@} +described below. +The exclamation point must immediately follow the left brace in order to +introduce indirection. + +In each of the cases below, @var{word} is subject to tilde expansion, +parameter expansion, command substitution, and arithmetic expansion. + +When not performing substring expansion, using the form described +below (e.g., @samp{:-}), Bash tests for a parameter that is unset or null. +Omitting the colon results in a test only for a parameter that is unset. +Put another way, if the colon is included, +the operator tests for both @var{parameter}'s existence and that its value +is not null; if the colon is omitted, the operator tests only for existence. + +@table @code + +@item $@{@var{parameter}:@minus{}@var{word}@} +If @var{parameter} is unset or null, the expansion of +@var{word} is substituted. Otherwise, the value of +@var{parameter} is substituted. + +@item $@{@var{parameter}:=@var{word}@} +If @var{parameter} +is unset or null, the expansion of @var{word} +is assigned to @var{parameter}. +The value of @var{parameter} is then substituted. +Positional parameters and special parameters may not be assigned to +in this way. + +@item $@{@var{parameter}:?@var{word}@} +If @var{parameter} +is null or unset, the expansion of @var{word} (or a message +to that effect if @var{word} +is not present) is written to the standard error and the shell, if it +is not interactive, exits. Otherwise, the value of @var{parameter} is +substituted. + +@item $@{@var{parameter}:+@var{word}@} +If @var{parameter} +is null or unset, nothing is substituted, otherwise the expansion of +@var{word} is substituted. + +@item $@{@var{parameter}:@var{offset}@} +@itemx $@{@var{parameter}:@var{offset}:@var{length}@} +This is referred to as Substring Expansion. +It expands to up to @var{length} characters of the value of @var{parameter} +starting at the character specified by @var{offset}. +If @var{parameter} is @samp{@@}, an indexed array subscripted by +@samp{@@} or @samp{*}, or an associative array name, the results differ as +described below. +If @var{length} is omitted, it expands to the substring of the value of +@var{parameter} starting at the character specified by @var{offset} +and extending to the end of the value. +@var{length} and @var{offset} are arithmetic expressions +(@pxref{Shell Arithmetic}). + +If @var{offset} evaluates to a number less than zero, the value +is used as an offset in characters +from the end of the value of @var{parameter}. +If @var{length} evaluates to a number less than zero, +it is interpreted as an offset in characters +from the end of the value of @var{parameter} rather than +a number of characters, and the expansion is the characters between +@var{offset} and that result. +Note that a negative offset must be separated from the colon by at least +one space to avoid being confused with the @samp{:-} expansion. + +Here are some examples illustrating substring expansion on parameters and +subscripted arrays: + +@verbatim +$ string=01234567890abcdefgh +$ echo ${string:7} +7890abcdefgh +$ echo ${string:7:0} + +$ echo ${string:7:2} +78 +$ echo ${string:7:-2} +7890abcdef +$ echo ${string: -7} +bcdefgh +$ echo ${string: -7:0} + +$ echo ${string: -7:2} +bc +$ echo ${string: -7:-2} +bcdef +$ set -- 01234567890abcdefgh +$ echo ${1:7} +7890abcdefgh +$ echo ${1:7:0} + +$ echo ${1:7:2} +78 +$ echo ${1:7:-2} +7890abcdef +$ echo ${1: -7} +bcdefgh +$ echo ${1: -7:0} + +$ echo ${1: -7:2} +bc +$ echo ${1: -7:-2} +bcdef +$ array[0]=01234567890abcdefgh +$ echo ${array[0]:7} +7890abcdefgh +$ echo ${array[0]:7:0} + +$ echo ${array[0]:7:2} +78 +$ echo ${array[0]:7:-2} +7890abcdef +$ echo ${array[0]: -7} +bcdefgh +$ echo ${array[0]: -7:0} + +$ echo ${array[0]: -7:2} +bc +$ echo ${array[0]: -7:-2} +bcdef +@end verbatim + +If @var{parameter} is @samp{@@}, the result is @var{length} positional +parameters beginning at @var{offset}. +A negative @var{offset} is taken relative to one greater than the greatest +positional parameter, so an offset of -1 evaluates to the last positional +parameter. +It is an expansion error if @var{length} evaluates to a number less than zero. + +The following examples illustrate substring expansion using positional +parameters: + +@verbatim +$ set -- 1 2 3 4 5 6 7 8 9 0 a b c d e f g h +$ echo ${@:7} +7 8 9 0 a b c d e f g h +$ echo ${@:7:0} + +$ echo ${@:7:2} +7 8 +$ echo ${@:7:-2} +bash: -2: substring expression < 0 +$ echo ${@: -7:2} +b c +$ echo ${@:0} +./bash 1 2 3 4 5 6 7 8 9 0 a b c d e f g h +$ echo ${@:0:2} +./bash 1 +$ echo ${@: -7:0} + +@end verbatim + +If @var{parameter} is an indexed array name subscripted +by @samp{@@} or @samp{*}, the result is the @var{length} +members of the array beginning with @code{$@{@var{parameter}[@var{offset}]@}}. +A negative @var{offset} is taken relative to one greater than the maximum +index of the specified array. +It is an expansion error if @var{length} evaluates to a number less than zero. + +These examples show how you can use substring expansion with indexed +arrays: + +@verbatim +$ array=(0 1 2 3 4 5 6 7 8 9 0 a b c d e f g h) +$ echo ${array[@]:7} +7 8 9 0 a b c d e f g h +$ echo ${array[@]:7:2} +7 8 +$ echo ${array[@]: -7:2} +b c +$ echo ${array[@]: -7:-2} +bash: -2: substring expression < 0 +$ echo ${array[@]:0} +0 1 2 3 4 5 6 7 8 9 0 a b c d e f g h +$ echo ${array[@]:0:2} +0 1 +$ echo ${array[@]: -7:0} + +@end verbatim + +Substring expansion applied to an associative array produces undefined +results. + +Substring indexing is zero-based unless the positional parameters +are used, in which case the indexing starts at 1 by default. +If @var{offset} is 0, and the positional parameters are used, @code{$@@} is +prefixed to the list. + +@item $@{!@var{prefix}*@} +@itemx $@{!@var{prefix}@@@} +Expands to the names of variables whose names begin with @var{prefix}, +separated by the first character of the @env{IFS} special variable. +When @samp{@@} is used and the expansion appears within double quotes, each +variable name expands to a separate word. + +@item $@{!@var{name}[@@]@} +@itemx $@{!@var{name}[*]@} +If @var{name} is an array variable, expands to the list of array indices +(keys) assigned in @var{name}. +If @var{name} is not an array, expands to 0 if @var{name} is set and null +otherwise. +When @samp{@@} is used and the expansion appears within double quotes, each +key expands to a separate word. + +@item $@{#@var{parameter}@} +The length in characters of the expanded value of @var{parameter} is +substituted. +If @var{parameter} is @samp{*} or @samp{@@}, the value substituted +is the number of positional parameters. +If @var{parameter} is an array name subscripted by @samp{*} or @samp{@@}, +the value substituted is the number of elements in the array. +If @var{parameter} +is an indexed array name subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +@var{parameter}, so negative indices count back from the end of the +array, and an index of -1 references the last element. + +@item $@{@var{parameter}#@var{word}@} +@itemx $@{@var{parameter}##@var{word}@} +The @var{word} +is expanded to produce a pattern just as in filename +expansion (@pxref{Filename Expansion}). If the pattern matches +the beginning of the expanded value of @var{parameter}, +then the result of the expansion is the expanded value of @var{parameter} +with the shortest matching pattern (the @samp{#} case) or the +longest matching pattern (the @samp{##} case) deleted. +If @var{parameter} is @samp{@@} or @samp{*}, +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If @var{parameter} is an array variable subscripted with +@samp{@@} or @samp{*}, +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. + +@item $@{@var{parameter}%@var{word}@} +@itemx $@{@var{parameter}%%@var{word}@} +The @var{word} is expanded to produce a pattern just as in +filename expansion. +If the pattern matches a trailing portion of the expanded value of +@var{parameter}, then the result of the expansion is the value of +@var{parameter} with the shortest matching pattern (the @samp{%} case) +or the longest matching pattern (the @samp{%%} case) deleted. +If @var{parameter} is @samp{@@} or @samp{*}, +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If @var{parameter} +is an array variable subscripted with @samp{@@} or @samp{*}, +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. + +@item $@{@var{parameter}/@var{pattern}/@var{string}@} + +The @var{pattern} is expanded to produce a pattern just as in +filename expansion. +@var{Parameter} is expanded and the longest match of @var{pattern} +against its value is replaced with @var{string}. +If @var{pattern} begins with @samp{/}, all matches of @var{pattern} are +replaced with @var{string}. Normally only the first match is replaced. +If @var{pattern} begins with @samp{#}, it must match at the beginning +of the expanded value of @var{parameter}. +If @var{pattern} begins with @samp{%}, it must match at the end +of the expanded value of @var{parameter}. +If @var{string} is null, matches of @var{pattern} are deleted +and the @code{/} following @var{pattern} may be omitted. +If @var{parameter} is @samp{@@} or @samp{*}, +the substitution operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If @var{parameter} +is an array variable subscripted with @samp{@@} or @samp{*}, +the substitution operation is applied to each member of the +array in turn, and the expansion is the resultant list. + +@item $@{@var{parameter}^@var{pattern}@} +@itemx $@{@var{parameter}^^@var{pattern}@} +@itemx $@{@var{parameter},@var{pattern}@} +@itemx $@{@var{parameter},,@var{pattern}@} +This expansion modifies the case of alphabetic characters in @var{parameter}. +The @var{pattern} is expanded to produce a pattern just as in +filename expansion. +Each character in the expanded value of @var{parameter} is tested against +@var{pattern}, and, if it matches the pattern, its case is converted. +The pattern should not attempt to match more than one character. +The @samp{^} operator converts lowercase letters matching @var{pattern} +to uppercase; the @samp{,} operator converts matching uppercase letters +to lowercase. +The @samp{^^} and @samp{,,} expansions convert each matched character in the +expanded value; the @samp{^} and @samp{,} expansions match and convert only +the first character in the expanded value. +If @var{pattern} is omitted, it is treated like a @samp{?}, which matches +every character. +If @var{parameter} is @samp{@@} or @samp{*}, +the case modification operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If @var{parameter} +is an array variable subscripted with @samp{@@} or @samp{*}, +the case modification operation is applied to each member of the +array in turn, and the expansion is the resultant list. +@end table + +@node Command Substitution +@subsection Command Substitution +@cindex command substitution + +Command substitution allows the output of a command to replace +the command itself. +Command substitution occurs when a command is enclosed as follows: +@example +$(@var{command}) +@end example +@noindent +or +@example +`@var{command}` +@end example + +@noindent +Bash performs the expansion by executing @var{command} and +replacing the command substitution with the standard output of the +command, with any trailing newlines deleted. +Embedded newlines are not deleted, but they may be removed during +word splitting. +The command substitution @code{$(cat @var{file})} can be +replaced by the equivalent but faster @code{$(< @var{file})}. + +When the old-style backquote form of substitution is used, +backslash retains its literal meaning except when followed by +@samp{$}, @samp{`}, or @samp{\}. +The first backquote not preceded by a backslash terminates the +command substitution. +When using the @code{$(@var{command})} form, all characters between +the parentheses make up the command; none are treated specially. + +Command substitutions may be nested. To nest when using the backquoted +form, escape the inner backquotes with backslashes. + +If the substitution appears within double quotes, word splitting and +filename expansion are not performed on the results. + +@node Arithmetic Expansion +@subsection Arithmetic Expansion +@cindex expansion, arithmetic +@cindex arithmetic expansion + +Arithmetic expansion allows the evaluation of an arithmetic expression +and the substitution of the result. The format for arithmetic expansion is: + +@example +$(( @var{expression} )) +@end example + +The expression is treated as if it were within double quotes, but +a double quote inside the parentheses is not treated specially. +All tokens in the expression undergo parameter and variable expansion, +command substitution, and quote removal. +The result is treated as the arithmetic expression to be evaluated. +Arithmetic expansions may be nested. + +The evaluation is performed according to the rules listed below +(@pxref{Shell Arithmetic}). +If the expression is invalid, Bash prints a message indicating +failure to the standard error and no substitution occurs. + +@node Process Substitution +@subsection Process Substitution +@cindex process substitution + +Process substitution is supported on systems that support named +pipes (@sc{fifo}s) or the @file{/dev/fd} method of naming open files. +It takes the form of +@example +<(@var{list}) +@end example +@noindent +or +@example +>(@var{list}) +@end example +@noindent +The process @var{list} is run with its input or output connected to a +@sc{fifo} or some file in @file{/dev/fd}. The name of this file is +passed as an argument to the current command as the result of the +expansion. If the @code{>(@var{list})} form is used, writing to +the file will provide input for @var{list}. If the +@code{<(@var{list})} form is used, the file passed as an +argument should be read to obtain the output of @var{list}. +Note that no space may appear between the @code{<} or @code{>} +and the left parenthesis, otherwise the construct would be interpreted +as a redirection. + +When available, process substitution is performed simultaneously with +parameter and variable expansion, command substitution, and arithmetic +expansion. + +@node Word Splitting +@subsection Word Splitting +@cindex word splitting + +The shell scans the results of parameter expansion, command substitution, +and arithmetic expansion that did not occur within double quotes for +word splitting. + +The shell treats each character of @env{$IFS} as a delimiter, and splits +the results of the other expansions into words using these characters +as field terminators. +If @env{IFS} is unset, or its value is exactly @code{}, +the default, then sequences of +@code{ }, @code{}, and @code{} +at the beginning and end of the results of the previous +expansions are ignored, and any sequence of @env{IFS} +characters not at the beginning or end serves to delimit words. +If @env{IFS} has a value other than the default, then sequences of +the whitespace characters @code{space} and @code{tab} +are ignored at the beginning and end of the +word, as long as the whitespace character is in the +value of @env{IFS} (an @env{IFS} whitespace character). +Any character in @env{IFS} that is not @env{IFS} +whitespace, along with any adjacent @env{IFS} +whitespace characters, delimits a field. A sequence of @env{IFS} +whitespace characters is also treated as a delimiter. +If the value of @env{IFS} is null, no word splitting occurs. + +Explicit null arguments (@code{""} or @code{''}) are retained. +Unquoted implicit null arguments, resulting from the expansion of +parameters that have no values, are removed. +If a parameter with no value is expanded within double quotes, a +null argument results and is retained. + +Note that if no expansion occurs, no splitting +is performed. + +@node Filename Expansion +@subsection Filename Expansion +@menu +* Pattern Matching:: How the shell matches patterns. +@end menu +@cindex expansion, filename +@cindex expansion, pathname +@cindex filename expansion +@cindex pathname expansion + +After word splitting, unless the @option{-f} option has been set +(@pxref{The Set Builtin}), Bash scans each word for the characters +@samp{*}, @samp{?}, and @samp{[}. +If one of these characters appears, then the word is +regarded as a @var{pattern}, +and replaced with an alphabetically sorted list of +filenames matching the pattern (@pxref{Pattern Matching}). +If no matching filenames are found, +and the shell option @code{nullglob} is disabled, the word is left +unchanged. +If the @code{nullglob} option is set, and no matches are found, the word +is removed. +If the @code{failglob} shell option is set, and no matches are found, +an error message is printed and the command is not executed. +If the shell option @code{nocaseglob} is enabled, the match is performed +without regard to the case of alphabetic characters. + +When a pattern is used for filename expansion, the character @samp{.} +at the start of a filename or immediately following a slash +must be matched explicitly, unless the shell option @code{dotglob} is set. +When matching a filename, the slash character must always be +matched explicitly. +In other cases, the @samp{.} character is not treated specially. + +See the description of @code{shopt} in @ref{The Shopt Builtin}, +for a description of the @code{nocaseglob}, @code{nullglob}, +@code{failglob}, and @code{dotglob} options. + +The @env{GLOBIGNORE} +shell variable may be used to restrict the set of filenames matching a +pattern. If @env{GLOBIGNORE} +is set, each matching filename that also matches one of the patterns in +@env{GLOBIGNORE} is removed from the list of matches. The filenames +@file{.} and @file{..} +are always ignored when @env{GLOBIGNORE} +is set and not null. +However, setting @env{GLOBIGNORE} to a non-null value has the effect of +enabling the @code{dotglob} +shell option, so all other filenames beginning with a +@samp{.} will match. +To get the old behavior of ignoring filenames beginning with a +@samp{.}, make @samp{.*} one of the patterns in @env{GLOBIGNORE}. +The @code{dotglob} option is disabled when @env{GLOBIGNORE} +is unset. + +@node Pattern Matching +@subsubsection Pattern Matching +@cindex pattern matching +@cindex matching, pattern + +Any character that appears in a pattern, other than the special pattern +characters described below, matches itself. +The @sc{nul} character may not occur in a pattern. +A backslash escapes the following character; the +escaping backslash is discarded when matching. +The special pattern characters must be quoted if they are to be matched +literally. + +The special pattern characters have the following meanings: +@table @code +@item * +Matches any string, including the null string. +When the @code{globstar} shell option is enabled, and @samp{*} is used in +a filename expansion context, two adjacent @samp{*}s used as a single +pattern will match all files and zero or more directories and +subdirectories. +If followed by a @samp{/}, two adjacent @samp{*}s will match only +directories and subdirectories. +@item ? +Matches any single character. +@item [@dots{}] +Matches any one of the enclosed characters. A pair of characters +separated by a hyphen denotes a @var{range expression}; +any character that falls between those two characters, inclusive, +using the current locale's collating sequence and character set, +is matched. If the first character following the +@samp{[} is a @samp{!} or a @samp{^} +then any character not enclosed is matched. A @samp{@minus{}} +may be matched by including it as the first or last character +in the set. A @samp{]} may be matched by including it as the first +character in the set. +The sorting order of characters in range expressions is determined by +the current locale and the values of the +@env{LC_COLLATE} and @env{LC_ALL} shell variables, if set. + +For example, in the default C locale, @samp{[a-dx-z]} is equivalent to +@samp{[abcdxyz]}. Many locales sort characters in dictionary order, and in +these locales @samp{[a-dx-z]} is typically not equivalent to @samp{[abcdxyz]}; +it might be equivalent to @samp{[aBbCcDdxXyYz]}, for example. To obtain +the traditional interpretation of ranges in bracket expressions, you can +force the use of the C locale by setting the @env{LC_COLLATE} or +@env{LC_ALL} environment variable to the value @samp{C}, or enable the +@code{globasciiranges} shell option. + +Within @samp{[} and @samp{]}, @var{character classes} can be specified +using the syntax +@code{[:}@var{class}@code{:]}, where @var{class} is one of the +following classes defined in the @sc{posix} standard: +@example +alnum alpha ascii blank cntrl digit graph lower +print punct space upper word xdigit +@end example +@noindent +A character class matches any character belonging to that class. +The @code{word} character class matches letters, digits, and the character +@samp{_}. + +Within @samp{[} and @samp{]}, an @var{equivalence class} can be +specified using the syntax @code{[=}@var{c}@code{=]}, which +matches all characters with the same collation weight (as defined +by the current locale) as the character @var{c}. + +Within @samp{[} and @samp{]}, the syntax @code{[.}@var{symbol}@code{.]} +matches the collating symbol @var{symbol}. +@end table + +If the @code{extglob} shell option is enabled using the @code{shopt} +builtin, several extended pattern matching operators are recognized. +In the following description, a @var{pattern-list} is a list of one +or more patterns separated by a @samp{|}. +Composite patterns may be formed using one or more of the following +sub-patterns: + +@table @code +@item ?(@var{pattern-list}) +Matches zero or one occurrence of the given patterns. + +@item *(@var{pattern-list}) +Matches zero or more occurrences of the given patterns. + +@item +(@var{pattern-list}) +Matches one or more occurrences of the given patterns. + +@item @@(@var{pattern-list}) +Matches one of the given patterns. + +@item !(@var{pattern-list}) +Matches anything except one of the given patterns. +@end table + +@node Quote Removal +@subsection Quote Removal + +After the preceding expansions, all unquoted occurrences of the +characters @samp{\}, @samp{'}, and @samp{"} that did not +result from one of the above expansions are removed. + +@node Redirections +@section Redirections +@cindex redirection + +Before a command is executed, its input and output +may be @var{redirected} +using a special notation interpreted by the shell. +Redirection allows commands' file handles to be +duplicated, opened, closed, +made to refer to different files, +and can change the files the command reads from and writes to. +Redirection may also be used to modify file handles in the +current shell execution environment. The following redirection +operators may precede or appear anywhere within a +simple command or may follow a command. +Redirections are processed in the order they appear, from +left to right. + +Each redirection that may be preceded by a file descriptor number +may instead be preceded by a word of the form @{@var{varname}@}. +In this case, for each redirection operator except +>&- and <&-, the shell will allocate a file descriptor greater +than 10 and assign it to @{@var{varname}@}. If >&- or <&- is preceded +by @{@var{varname}@}, the value of @var{varname} defines the file +descriptor to close. + +In the following descriptions, if the file descriptor number is +omitted, and the first character of the redirection operator is +@samp{<}, the redirection refers to the standard input (file +descriptor 0). If the first character of the redirection operator +is @samp{>}, the redirection refers to the standard output (file +descriptor 1). + +The word following the redirection operator in the following +descriptions, unless otherwise noted, is subjected to brace expansion, +tilde expansion, parameter expansion, command substitution, arithmetic +expansion, quote removal, filename expansion, and word splitting. +If it expands to more than one word, Bash reports an error. + +Note that the order of redirections is significant. For example, +the command +@example +ls > @var{dirlist} 2>&1 +@end example +@noindent +directs both standard output (file descriptor 1) and standard error +(file descriptor 2) to the file @var{dirlist}, while the command +@example +ls 2>&1 > @var{dirlist} +@end example +@noindent +directs only the standard output to file @var{dirlist}, +because the standard error was made a copy of the standard output +before the standard output was redirected to @var{dirlist}. + +Bash handles several filenames specially when they are used in +redirections, as described in the following table: + +@table @code +@item /dev/fd/@var{fd} +If @var{fd} is a valid integer, file descriptor @var{fd} is duplicated. + +@item /dev/stdin +File descriptor 0 is duplicated. + +@item /dev/stdout +File descriptor 1 is duplicated. + +@item /dev/stderr +File descriptor 2 is duplicated. + +@item /dev/tcp/@var{host}/@var{port} +If @var{host} is a valid hostname or Internet address, and @var{port} +is an integer port number or service name, Bash attempts to open +the corresponding TCP socket. + +@item /dev/udp/@var{host}/@var{port} +If @var{host} is a valid hostname or Internet address, and @var{port} +is an integer port number or service name, Bash attempts to open +the corresponding UDP socket. +@end table + +A failure to open or create a file causes the redirection to fail. + +Redirections using file descriptors greater than 9 should be used with +care, as they may conflict with file descriptors the shell uses +internally. + +@subsection Redirecting Input +Redirection of input causes the file whose name results from +the expansion of @var{word} +to be opened for reading on file descriptor @code{n}, +or the standard input (file descriptor 0) if @code{n} +is not specified. + +The general format for redirecting input is: +@example +[@var{n}]<@var{word} +@end example + +@subsection Redirecting Output +Redirection of output causes the file whose name results from +the expansion of @var{word} +to be opened for writing on file descriptor @var{n}, +or the standard output (file descriptor 1) if @var{n} +is not specified. If the file does not exist it is created; +if it does exist it is truncated to zero size. + +The general format for redirecting output is: +@example +[@var{n}]>[|]@var{word} +@end example + +If the redirection operator is @samp{>}, and the @code{noclobber} +option to the @code{set} builtin has been enabled, the redirection +will fail if the file whose name results from the expansion of +@var{word} exists and is a regular file. +If the redirection operator is @samp{>|}, or the redirection operator is +@samp{>} and the @code{noclobber} option is not enabled, the redirection +is attempted even if the file named by @var{word} exists. + +@subsection Appending Redirected Output +Redirection of output in this fashion +causes the file whose name results from +the expansion of @var{word} +to be opened for appending on file descriptor @var{n}, +or the standard output (file descriptor 1) if @var{n} +is not specified. If the file does not exist it is created. + +The general format for appending output is: +@example +[@var{n}]>>@var{word} +@end example + +@subsection Redirecting Standard Output and Standard Error +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be redirected to the file whose name is the +expansion of @var{word}. + +There are two formats for redirecting standard output and +standard error: +@example +&>@var{word} +@end example +@noindent +and +@example +>&@var{word} +@end example +@noindent +Of the two forms, the first is preferred. +This is semantically equivalent to +@example +>@var{word} 2>&1 +@end example +When using the second form, @var{word} may not expand to a number or +@samp{-}. If it does, other redirection operators apply +(see Duplicating File Descriptors below) for compatibility reasons. + +@subsection Appending Standard Output and Standard Error +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be appended to the file whose name is the +expansion of @var{word}. + +The format for appending standard output and standard error is: +@example +&>>@var{word} +@end example +@noindent +This is semantically equivalent to +@example +>>@var{word} 2>&1 +@end example +(see Duplicating File Descriptors below). + +@subsection Here Documents +This type of redirection instructs the shell to read input from the +current source until a line containing only @var{word} +(with no trailing blanks) is seen. All of +the lines read up to that point are then used as the standard +input for a command. + +The format of here-documents is: +@example +<<[@minus{}]@var{word} + @var{here-document} +@var{delimiter} +@end example + +No parameter and variable expansion, command substitution, +arithmetic expansion, or filename expansion is performed on +@var{word}. If any characters in @var{word} are quoted, the +@var{delimiter} is the result of quote removal on @var{word}, +and the lines in the here-document are not expanded. +If @var{word} is unquoted, +all lines of the here-document are subjected to +parameter expansion, command substitution, and arithmetic expansion, +the character sequence @code{\newline} is ignored, and @samp{\} +must be used to quote the characters +@samp{\}, @samp{$}, and @samp{`}. + +If the redirection operator is @samp{<<-}, +then all leading tab characters are stripped from input lines and the +line containing @var{delimiter}. +This allows here-documents within shell scripts to be indented in a +natural fashion. + +@subsection Here Strings +A variant of here documents, the format is: +@example +<<< @var{word} +@end example + +The @var{word} undergoes +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote removal. +Pathname expansion and word splitting are not performed. +The result is supplied as a single string to the command on its +standard input. + +@subsection Duplicating File Descriptors +The redirection operator +@example +[@var{n}]<&@var{word} +@end example +@noindent +is used to duplicate input file descriptors. +If @var{word} +expands to one or more digits, the file descriptor denoted by @var{n} +is made to be a copy of that file descriptor. +If the digits in @var{word} do not specify a file descriptor open for +input, a redirection error occurs. +If @var{word} +evaluates to @samp{-}, file descriptor @var{n} is closed. +If @var{n} is not specified, the standard input (file descriptor 0) is used. + +The operator +@example +[@var{n}]>&@var{word} +@end example +@noindent +is used similarly to duplicate output file descriptors. If +@var{n} is not specified, the standard output (file descriptor 1) is used. +If the digits in @var{word} do not specify a file descriptor open for +output, a redirection error occurs. +If @var{word} +evaluates to @samp{-}, file descriptor @var{n} is closed. +As a special case, if @var{n} is omitted, and @var{word} does not +expand to one or more digits or @samp{-}, the standard output and standard +error are redirected as described previously. + +@subsection Moving File Descriptors +The redirection operator +@example +[@var{n}]<&@var{digit}- +@end example +@noindent +moves the file descriptor @var{digit} to file descriptor @var{n}, +or the standard input (file descriptor 0) if @var{n} is not specified. +@var{digit} is closed after being duplicated to @var{n}. + +Similarly, the redirection operator +@example +[@var{n}]>&@var{digit}- +@end example +@noindent +moves the file descriptor @var{digit} to file descriptor @var{n}, +or the standard output (file descriptor 1) if @var{n} is not specified. + +@subsection Opening File Descriptors for Reading and Writing +The redirection operator +@example +[@var{n}]<>@var{word} +@end example +@noindent +causes the file whose name is the expansion of @var{word} +to be opened for both reading and writing on file descriptor +@var{n}, or on file descriptor 0 if @var{n} +is not specified. If the file does not exist, it is created. + +@node Executing Commands +@section Executing Commands + +@menu +* Simple Command Expansion:: How Bash expands simple commands before + executing them. +* Command Search and Execution:: How Bash finds commands and runs them. +* Command Execution Environment:: The environment in which Bash + executes commands that are not + shell builtins. +* Environment:: The environment given to a command. +* Exit Status:: The status returned by commands and how Bash + interprets it. +* Signals:: What happens when Bash or a command it runs + receives a signal. +@end menu + +@node Simple Command Expansion +@subsection Simple Command Expansion +@cindex command expansion + +When a simple command is executed, the shell performs the following +expansions, assignments, and redirections, from left to right. + +@enumerate +@item +The words that the parser has marked as variable assignments (those +preceding the command name) and redirections are saved for later +processing. + +@item +The words that are not variable assignments or redirections are +expanded (@pxref{Shell Expansions}). +If any words remain after expansion, the first word +is taken to be the name of the command and the remaining words are +the arguments. + +@item +Redirections are performed as described above (@pxref{Redirections}). + +@item +The text after the @samp{=} in each variable assignment undergoes tilde +expansion, parameter expansion, command substitution, arithmetic expansion, +and quote removal before being assigned to the variable. +@end enumerate + +If no command name results, the variable assignments affect the current +shell environment. Otherwise, the variables are added to the environment +of the executed command and do not affect the current shell environment. +If any of the assignments attempts to assign a value to a readonly variable, +an error occurs, and the command exits with a non-zero status. + +If no command name results, redirections are performed, but do not +affect the current shell environment. A redirection error causes the +command to exit with a non-zero status. + +If there is a command name left after expansion, execution proceeds as +described below. Otherwise, the command exits. If one of the expansions +contained a command substitution, the exit status of the command is +the exit status of the last command substitution performed. If there +were no command substitutions, the command exits with a status of zero. + +@node Command Search and Execution +@subsection Command Search and Execution +@cindex command execution +@cindex command search + +After a command has been split into words, if it results in a +simple command and an optional list of arguments, the following +actions are taken. + +@enumerate +@item +If the command name contains no slashes, the shell attempts to +locate it. If there exists a shell function by that name, that +function is invoked as described in @ref{Shell Functions}. + +@item +If the name does not match a function, the shell searches for +it in the list of shell builtins. If a match is found, that +builtin is invoked. + +@item +If the name is neither a shell function nor a builtin, +and contains no slashes, Bash searches each element of +@env{$PATH} for a directory containing an executable file +by that name. Bash uses a hash table to remember the full +pathnames of executable files to avoid multiple @env{PATH} searches +(see the description of @code{hash} in @ref{Bourne Shell Builtins}). +A full search of the directories in @env{$PATH} +is performed only if the command is not found in the hash table. +If the search is unsuccessful, the shell searches for a defined shell +function named @code{command_not_found_handle}. +If that function exists, it is invoked with the original command and +the original command's arguments as its arguments, and the function's +exit status becomes the exit status of the shell. +If that function is not defined, the shell prints an error +message and returns an exit status of 127. + +@item +If the search is successful, or if the command name contains +one or more slashes, the shell executes the named program in +a separate execution environment. +Argument 0 is set to the name given, and the remaining arguments +to the command are set to the arguments supplied, if any. + +@item +If this execution fails because the file is not in executable +format, and the file is not a directory, it is assumed to be a +@var{shell script} and the shell executes it as described in +@ref{Shell Scripts}. + +@item +If the command was not begun asynchronously, the shell waits for +the command to complete and collects its exit status. + +@end enumerate + +@node Command Execution Environment +@subsection Command Execution Environment +@cindex execution environment + +The shell has an @var{execution environment}, which consists of the +following: + +@itemize @bullet +@item +open files inherited by the shell at invocation, as modified by +redirections supplied to the @code{exec} builtin + +@item +the current working directory as set by @code{cd}, @code{pushd}, or +@code{popd}, or inherited by the shell at invocation + +@item +the file creation mode mask as set by @code{umask} or inherited from +the shell's parent + +@item +current traps set by @code{trap} + +@item +shell parameters that are set by variable assignment or with @code{set} +or inherited from the shell's parent in the environment + +@item +shell functions defined during execution or inherited from the shell's +parent in the environment + +@item +options enabled at invocation (either by default or with command-line +arguments) or by @code{set} + +@item +options enabled by @code{shopt} (@pxref{The Shopt Builtin}) + +@item +shell aliases defined with @code{alias} (@pxref{Aliases}) + +@item +various process @sc{id}s, including those of background jobs +(@pxref{Lists}), the value of @code{$$}, and the value of +@env{$PPID} + +@end itemize + +When a simple command other than a builtin or shell function +is to be executed, it +is invoked in a separate execution environment that consists of +the following. Unless otherwise noted, the values are inherited +from the shell. + +@itemize @bullet +@item +the shell's open files, plus any modifications and additions specified +by redirections to the command + +@item +the current working directory + +@item +the file creation mode mask + +@item +shell variables and functions marked for export, along with variables +exported for the command, passed in the environment (@pxref{Environment}) + +@item +traps caught by the shell are reset to the values inherited from the +shell's parent, and traps ignored by the shell are ignored + +@end itemize + +A command invoked in this separate environment cannot affect the +shell's execution environment. + +Command substitution, commands grouped with parentheses, +and asynchronous commands are invoked in a +subshell environment that is a duplicate of the shell environment, +except that traps caught by the shell are reset to the values +that the shell inherited from its parent at invocation. Builtin +commands that are invoked as part of a pipeline are also executed +in a subshell environment. Changes made to the subshell environment +cannot affect the shell's execution environment. + +Subshells spawned to execute command substitutions inherit the value of +the @option{-e} option from the parent shell. When not in @sc{posix} mode, +Bash clears the @option{-e} option in such subshells. + +If a command is followed by a @samp{&} and job control is not active, the +default standard input for the command is the empty file @file{/dev/null}. +Otherwise, the invoked command inherits the file descriptors of the calling +shell as modified by redirections. + +@node Environment +@subsection Environment +@cindex environment + +When a program is invoked it is given an array of strings +called the @var{environment}. +This is a list of name-value pairs, of the form @code{name=value}. + +Bash provides several ways to manipulate the environment. +On invocation, the shell scans its own environment and +creates a parameter for each name found, automatically marking +it for @var{export} +to child processes. Executed commands inherit the environment. +The @code{export} and @samp{declare -x} +commands allow parameters and functions to be added to and +deleted from the environment. If the value of a parameter +in the environment is modified, the new value becomes part +of the environment, replacing the old. The environment +inherited by any executed command consists of the shell's +initial environment, whose values may be modified in the shell, +less any pairs removed by the @code{unset} and @samp{export -n} +commands, plus any additions via the @code{export} and +@samp{declare -x} commands. + +The environment for any simple command +or function may be augmented temporarily by prefixing it with +parameter assignments, as described in @ref{Shell Parameters}. +These assignment statements affect only the environment seen +by that command. + +If the @option{-k} option is set (@pxref{The Set Builtin}), then all +parameter assignments are placed in the environment for a command, +not just those that precede the command name. + +When Bash invokes an external command, the variable @samp{$_} +is set to the full pathname of the command and passed to that +command in its environment. + +@node Exit Status +@subsection Exit Status +@cindex exit status + +The exit status of an executed command is the value returned by the +@var{waitpid} system call or equivalent function. Exit statuses +fall between 0 and 255, though, as explained below, the shell may +use values above 125 specially. Exit statuses from shell builtins and +compound commands are also limited to this range. Under certain +circumstances, the shell will use special values to indicate specific +failure modes. + +For the shell's purposes, a command which exits with a +zero exit status has succeeded. +A non-zero exit status indicates failure. +This seemingly counter-intuitive scheme is used so there +is one well-defined way to indicate success and a variety of +ways to indicate various failure modes. +When a command terminates on a fatal signal whose number is @var{N}, +Bash uses the value 128+@var{N} as the exit status. + +If a command is not found, the child process created to +execute it returns a status of 127. If a command is found +but is not executable, the return status is 126. + +If a command fails because of an error during expansion or redirection, +the exit status is greater than zero. + +The exit status is used by the Bash conditional commands +(@pxref{Conditional Constructs}) and some of the list +constructs (@pxref{Lists}). + +All of the Bash builtins return an exit status of zero if they succeed +and a non-zero status on failure, so they may be used by the +conditional and list constructs. +All builtins return an exit status of 2 to indicate incorrect usage. + +@node Signals +@subsection Signals +@cindex signal handling + +When Bash is interactive, in the absence of any traps, it ignores +@code{SIGTERM} (so that @samp{kill 0} does not kill an interactive shell), +and @code{SIGINT} +is caught and handled (so that the @code{wait} builtin is interruptible). +When Bash receives a @code{SIGINT}, it breaks out of any executing loops. +In all cases, Bash ignores @code{SIGQUIT}. +If job control is in effect (@pxref{Job Control}), Bash +ignores @code{SIGTTIN}, @code{SIGTTOU}, and @code{SIGTSTP}. + +Non-builtin commands started by Bash have signal handlers set to the +values inherited by the shell from its parent. +When job control is not in effect, asynchronous commands +ignore @code{SIGINT} and @code{SIGQUIT} in addition to these inherited +handlers. +Commands run as a result of +command substitution ignore the keyboard-generated job control signals +@code{SIGTTIN}, @code{SIGTTOU}, and @code{SIGTSTP}. + +The shell exits by default upon receipt of a @code{SIGHUP}. +Before exiting, an interactive shell resends the @code{SIGHUP} to +all jobs, running or stopped. +Stopped jobs are sent @code{SIGCONT} to ensure that they receive +the @code{SIGHUP}. +To prevent the shell from sending the @code{SIGHUP} signal to a +particular job, it should be removed +from the jobs table with the @code{disown} +builtin (@pxref{Job Control Builtins}) or marked +to not receive @code{SIGHUP} using @code{disown -h}. + +If the @code{huponexit} shell option has been set with @code{shopt} +(@pxref{The Shopt Builtin}), Bash sends a @code{SIGHUP} to all jobs when +an interactive login shell exits. + +If Bash is waiting for a command to complete and receives a signal +for which a trap has been set, the trap will not be executed until +the command completes. +When Bash is waiting for an asynchronous +command via the @code{wait} builtin, the reception of a signal for +which a trap has been set will cause the @code{wait} builtin to return +immediately with an exit status greater than 128, immediately after +which the trap is executed. + +@node Shell Scripts +@section Shell Scripts +@cindex shell script + +A shell script is a text file containing shell commands. When such +a file is used as the first non-option argument when invoking Bash, +and neither the @option{-c} nor @option{-s} option is supplied +(@pxref{Invoking Bash}), +Bash reads and executes commands from the file, then exits. This +mode of operation creates a non-interactive shell. The shell first +searches for the file in the current directory, and looks in the +directories in @env{$PATH} if not found there. + +When Bash runs +a shell script, it sets the special parameter @code{0} to the name +of the file, rather than the name of the shell, and the positional +parameters are set to the remaining arguments, if any are given. +If no additional arguments are supplied, the positional parameters +are unset. + +A shell script may be made executable by using the @code{chmod} command +to turn on the execute bit. When Bash finds such a file while +searching the @env{$PATH} for a command, it spawns a subshell to +execute it. In other words, executing +@example +filename @var{arguments} +@end example +@noindent +is equivalent to executing +@example +bash filename @var{arguments} +@end example + +@noindent +if @code{filename} is an executable shell script. +This subshell reinitializes itself, so that the effect is as if a +new shell had been invoked to interpret the script, with the +exception that the locations of commands remembered by the parent +(see the description of @code{hash} in @ref{Bourne Shell Builtins}) +are retained by the child. + +Most versions of Unix make this a part of the operating system's command +execution mechanism. If the first line of a script begins with +the two characters @samp{#!}, the remainder of the line specifies +an interpreter for the program. +Thus, you can specify Bash, @code{awk}, Perl, or some other +interpreter and write the rest of the script file in that language. + +The arguments to the interpreter +consist of a single optional argument following the interpreter +name on the first line of the script file, followed by the name of +the script file, followed by the rest of the arguments. Bash +will perform this action on operating systems that do not handle it +themselves. Note that some older versions of Unix limit the interpreter +name and argument to a maximum of 32 characters. + +Bash scripts often begin with @code{#! /bin/bash} (assuming that +Bash has been installed in @file{/bin}), since this ensures that +Bash will be used to interpret the script, even if it is executed +under another shell. + +@node Shell Builtin Commands +@chapter Shell Builtin Commands + +@menu +* Bourne Shell Builtins:: Builtin commands inherited from the Bourne + Shell. +* Bash Builtins:: Table of builtins specific to Bash. +* Modifying Shell Behavior:: Builtins to modify shell attributes and + optional behavior. +* Special Builtins:: Builtin commands classified specially by + POSIX. +@end menu + +Builtin commands are contained within the shell itself. +When the name of a builtin command is used as the first word of +a simple command (@pxref{Simple Commands}), the shell executes +the command directly, without invoking another program. +Builtin commands are necessary to implement functionality impossible +or inconvenient to obtain with separate utilities. + +This section briefly describes the builtins which Bash inherits from +the Bourne Shell, as well as the builtin commands which are unique +to or have been extended in Bash. + +Several builtin commands are described in other chapters: builtin +commands which provide the Bash interface to the job control +facilities (@pxref{Job Control Builtins}), the directory stack +(@pxref{Directory Stack Builtins}), the command history +(@pxref{Bash History Builtins}), and the programmable completion +facilities (@pxref{Programmable Completion Builtins}). + +Many of the builtins have been extended by @sc{posix} or Bash. + +Unless otherwise noted, each builtin command documented as accepting +options preceded by @samp{-} accepts @samp{--} +to signify the end of the options. +The @code{:}, @code{true}, @code{false}, and @code{test} +builtins do not accept options and do not treat @samp{--} specially. +The @code{exit}, @code{logout}, @code{break}, @code{continue}, @code{let}, +and @code{shift} builtins accept and process arguments beginning +with @samp{-} without requiring @samp{--}. +Other builtins that accept arguments but are not specified as accepting +options interpret arguments beginning with @samp{-} as invalid options and +require @samp{--} to prevent this interpretation. + +@node Bourne Shell Builtins +@section Bourne Shell Builtins + +The following shell builtin commands are inherited from the Bourne Shell. +These commands are implemented as specified by the @sc{posix} standard. + +@table @code +@item : @r{(a colon)} +@btindex : +@example +: [@var{arguments}] +@end example + +Do nothing beyond expanding @var{arguments} and performing redirections. +The return status is zero. + +@item . @r{(a period)} +@btindex . +@example +. @var{filename} [@var{arguments}] +@end example + +Read and execute commands from the @var{filename} argument in the +current shell context. If @var{filename} does not contain a slash, +the @env{PATH} variable is used to find @var{filename}. +When Bash is not in @sc{posix} mode, the current directory is searched +if @var{filename} is not found in @env{$PATH}. +If any @var{arguments} are supplied, they become the positional +parameters when @var{filename} is executed. Otherwise the positional +parameters are unchanged. +The return status is the exit status of the last command executed, or +zero if no commands are executed. If @var{filename} is not found, or +cannot be read, the return status is non-zero. +This builtin is equivalent to @code{source}. + +@item break +@btindex break +@example +break [@var{n}] +@end example + +Exit from a @code{for}, @code{while}, @code{until}, or @code{select} loop. +If @var{n} is supplied, the @var{n}th enclosing loop is exited. +@var{n} must be greater than or equal to 1. +The return status is zero unless @var{n} is not greater than or equal to 1. + +@item cd +@btindex cd +@example +cd [-L|[-P [-e]] [-@@] [@var{directory}] +@end example + +Change the current working directory to @var{directory}. +If @var{directory} is not supplied, the value of the @env{HOME} +shell variable is used. +Any additional arguments following @var{directory} are ignored. +If the shell variable +@env{CDPATH} exists, it is used as a search path: +each directory name in @env{CDPATH} is searched for +@var{directory}, with alternative directory names in @env{CDPATH} +separated by a colon (@samp{:}). +If @var{directory} begins with a slash, @env{CDPATH} is not used. + +The @option{-P} option means to not follow symbolic links: symbolic links +are resolved while @code{cd} is traversing @var{directory} and before +processing an instance of @samp{..} in @var{directory}. + +By default, or when the @option{-L} option is supplied, symbolic links +in @var{directory} are resolved after @code{cd} processes an instance +of @samp{..} in @var{directory}. + +If @samp{..} appears in @var{directory}, it is processed by removing the +immediately preceding pathname component, back to a slash or the beginning +of @var{directory}. + +If the @option{-e} option is supplied with @option{-P} +and the current working directory cannot be successfully determined +after a successful directory change, @code{cd} will return an unsuccessful +status. + +On systems that support it, the @option{-@@} option presents the extended +attributes associated with a file as a directory. + +If @var{directory} is @samp{-}, it is converted to @env{$OLDPWD} +before the directory change is attempted. + +If a non-empty directory name from @env{CDPATH} is used, or if +@samp{-} is the first argument, and the directory change is +successful, the absolute pathname of the new working directory is +written to the standard output. + +The return status is zero if the directory is successfully changed, +non-zero otherwise. + +@item continue +@btindex continue +@example +continue [@var{n}] +@end example + +Resume the next iteration of an enclosing @code{for}, @code{while}, +@code{until}, or @code{select} loop. +If @var{n} is supplied, the execution of the @var{n}th enclosing loop +is resumed. +@var{n} must be greater than or equal to 1. +The return status is zero unless @var{n} is not greater than or equal to 1. + +@item eval +@btindex eval +@example +eval [@var{arguments}] +@end example + +The arguments are concatenated together into a single command, which is +then read and executed, and its exit status returned as the exit status +of @code{eval}. +If there are no arguments or only empty arguments, the return status is +zero. + +@item exec +@btindex exec +@example +exec [-cl] [-a @var{name}] [@var{command} [@var{arguments}]] +@end example + +If @var{command} +is supplied, it replaces the shell without creating a new process. +If the @option{-l} option is supplied, the shell places a dash at the +beginning of the zeroth argument passed to @var{command}. +This is what the @code{login} program does. +The @option{-c} option causes @var{command} to be executed with an empty +environment. +If @option{-a} is supplied, the shell passes @var{name} as the zeroth +argument to @var{command}. +If @var{command} +cannot be executed for some reason, a non-interactive shell exits, +unless the @code{execfail} shell option +is enabled. In that case, it returns failure. +An interactive shell returns failure if the file cannot be executed. +If no @var{command} is specified, redirections may be used to affect +the current shell environment. If there are no redirection errors, the +return status is zero; otherwise the return status is non-zero. + +@item exit +@btindex exit +@example +exit [@var{n}] +@end example + +Exit the shell, returning a status of @var{n} to the shell's parent. +If @var{n} is omitted, the exit status is that of the last command executed. +Any trap on @code{EXIT} is executed before the shell terminates. + +@item export +@btindex export +@example +export [-fn] [-p] [@var{name}[=@var{value}]] +@end example + +Mark each @var{name} to be passed to child processes +in the environment. If the @option{-f} option is supplied, the @var{name}s +refer to shell functions; otherwise the names refer to shell variables. +The @option{-n} option means to no longer mark each @var{name} for export. +If no @var{names} are supplied, or if the @option{-p} option is given, a +list of names of all exported variables is displayed. +The @option{-p} option displays output in a form that may be reused as input. +If a variable name is followed by =@var{value}, the value of +the variable is set to @var{value}. + +The return status is zero unless an invalid option is supplied, one of +the names is not a valid shell variable name, or @option{-f} is supplied +with a name that is not a shell function. + +@item getopts +@btindex getopts +@example +getopts @var{optstring} @var{name} [@var{args}] +@end example + +@code{getopts} is used by shell scripts to parse positional parameters. +@var{optstring} contains the option characters to be recognized; if a +character is followed by a colon, the option is expected to have an +argument, which should be separated from it by whitespace. +The colon (@samp{:}) and question mark (@samp{?}) may not be +used as option characters. +Each time it is invoked, @code{getopts} +places the next option in the shell variable @var{name}, initializing +@var{name} if it does not exist, +and the index of the next argument to be processed into the +variable @env{OPTIND}. +@env{OPTIND} is initialized to 1 each time the shell or a shell script +is invoked. +When an option requires an argument, +@code{getopts} places that argument into the variable @env{OPTARG}. +The shell does not reset @env{OPTIND} automatically; it must be manually +reset between multiple calls to @code{getopts} within the same shell +invocation if a new set of parameters is to be used. + +When the end of options is encountered, @code{getopts} exits with a +return value greater than zero. +@env{OPTIND} is set to the index of the first non-option argument, +and @var{name} is set to @samp{?}. + +@code{getopts} +normally parses the positional parameters, but if more arguments are +given in @var{args}, @code{getopts} parses those instead. + +@code{getopts} can report errors in two ways. If the first character of +@var{optstring} is a colon, @var{silent} +error reporting is used. In normal operation, diagnostic messages +are printed when invalid options or missing option arguments are +encountered. +If the variable @env{OPTERR} +is set to 0, no error messages will be displayed, even if the first +character of @code{optstring} is not a colon. + +If an invalid option is seen, +@code{getopts} places @samp{?} into @var{name} and, if not silent, +prints an error message and unsets @env{OPTARG}. +If @code{getopts} is silent, the option character found is placed in +@env{OPTARG} and no diagnostic message is printed. + +If a required argument is not found, and @code{getopts} +is not silent, a question mark (@samp{?}) is placed in @var{name}, +@code{OPTARG} is unset, and a diagnostic message is printed. +If @code{getopts} is silent, then a colon (@samp{:}) is placed in +@var{name} and @env{OPTARG} is set to the option character found. + +@item hash +@btindex hash +@example +hash [-r] [-p @var{filename}] [-dt] [@var{name}] +@end example + +Each time @code{hash} is invoked, it remembers the full pathnames of the +commands specified as @var{name} arguments, +so they need not be searched for on subsequent invocations. +The commands are found by searching through the directories listed in +@env{$PATH}. +Any previously-remembered pathname is discarded. +The @option{-p} option inhibits the path search, and @var{filename} is +used as the location of @var{name}. +The @option{-r} option causes the shell to forget all remembered locations. +The @option{-d} option causes the shell to forget the remembered location +of each @var{name}. +If the @option{-t} option is supplied, the full pathname to which each +@var{name} corresponds is printed. If multiple @var{name} arguments are +supplied with @option{-t} the @var{name} is printed before the hashed +full pathname. +The @option{-l} option causes output to be displayed in a format +that may be reused as input. +If no arguments are given, or if only @option{-l} is supplied, +information about remembered commands is printed. +The return status is zero unless a @var{name} is not found or an invalid +option is supplied. + +@item pwd +@btindex pwd +@example +pwd [-LP] +@end example + +Print the absolute pathname of the current working directory. +If the @option{-P} option is supplied, the pathname printed will not +contain symbolic links. +If the @option{-L} option is supplied, the pathname printed may contain +symbolic links. +The return status is zero unless an error is encountered while +determining the name of the current directory or an invalid option +is supplied. + +@item readonly +@btindex readonly +@example +readonly [-aAf] [-p] [@var{name}[=@var{value}]] @dots{} +@end example + +Mark each @var{name} as readonly. +The values of these names may not be changed by subsequent assignment. +If the @option{-f} option is supplied, each @var{name} refers to a shell +function. +The @option{-a} option means each @var{name} refers to an indexed +array variable; the @option{-A} option means each @var{name} refers +to an associative array variable. +If both options are supplied, @option{-A} takes precedence. +If no @var{name} arguments are given, or if the @option{-p} +option is supplied, a list of all readonly names is printed. +The other options may be used to restrict the output to a subset of +the set of readonly names. +The @option{-p} option causes output to be displayed in a format that +may be reused as input. +If a variable name is followed by =@var{value}, the value of +the variable is set to @var{value}. +The return status is zero unless an invalid option is supplied, one of +the @var{name} arguments is not a valid shell variable or function name, +or the @option{-f} option is supplied with a name that is not a shell function. + +@item return +@btindex return +@example +return [@var{n}] +@end example + +Cause a shell function to stop executing and return the value @var{n} +to its caller. +If @var{n} is not supplied, the return value is the exit status of the +last command executed in the function. +@code{return} may also be used to terminate execution of a script +being executed with the @code{.} (@code{source}) builtin, +returning either @var{n} or +the exit status of the last command executed within the script as the exit +status of the script. +If @var{n} is supplied, the return value is its least significant +8 bits. +Any command associated with the @code{RETURN} trap is executed +before execution resumes after the function or script. +The return status is non-zero if @code{return} is supplied a non-numeric +argument or is used outside a function +and not during the execution of a script by @code{.} or @code{source}. + +@item shift +@btindex shift +@example +shift [@var{n}] +@end example + +Shift the positional parameters to the left by @var{n}. +The positional parameters from @var{n}+1 @dots{} @code{$#} are +renamed to @code{$1} @dots{} @code{$#}-@var{n}. +Parameters represented by the numbers @code{$#} to @code{$#}-@var{n}+1 +are unset. +@var{n} must be a non-negative number less than or equal to @code{$#}. +If @var{n} is zero or greater than @code{$#}, the positional parameters +are not changed. +If @var{n} is not supplied, it is assumed to be 1. +The return status is zero unless @var{n} is greater than @code{$#} or +less than zero, non-zero otherwise. + +@item test +@itemx [ +@btindex test +@btindex [ +@example +test @var{expr} +@end example + +Evaluate a conditional express +ion @var{expr} and return a status of 0 +(true) or 1 (false). +Each operator and operand must be a separate argument. +Expressions are composed of the primaries described below in +@ref{Bash Conditional Expressions}. +@code{test} does not accept any options, nor does it accept and ignore +an argument of @option{--} as signifying the end of options. + +When the @code{[} form is used, the last argument to the command must +be a @code{]}. + +Expressions may be combined using the following operators, listed in +decreasing order of precedence. +The evaluation depends on the number of arguments; see below. +Operator precedence is used when there are five or more arguments. + +@table @code +@item ! @var{expr} +True if @var{expr} is false. + +@item ( @var{expr} ) +Returns the value of @var{expr}. +This may be used to override the normal precedence of operators. + +@item @var{expr1} -a @var{expr2} +True if both @var{expr1} and @var{expr2} are true. + +@item @var{expr1} -o @var{expr2} +True if either @var{expr1} or @var{expr2} is true. +@end table + +The @code{test} and @code{[} builtins evaluate conditional +expressions using a set of rules based on the number of arguments. + +@table @asis +@item 0 arguments +The expression is false. + +@item 1 argument +The expression is true if and only if the argument is not null. + +@item 2 arguments +If the first argument is @samp{!}, the expression is true if and +only if the second argument is null. +If the first argument is one of the unary conditional operators +(@pxref{Bash Conditional Expressions}), the expression +is true if the unary test is true. +If the first argument is not a valid unary operator, the expression is +false. + +@item 3 arguments +The following conditions are applied in the order listed. +If the second argument is one of the binary conditional +operators (@pxref{Bash Conditional Expressions}), the +result of the expression is the result of the binary test using the +first and third arguments as operands. +The @samp{-a} and @samp{-o} operators are considered binary operators +when there are three arguments. +If the first argument is @samp{!}, the value is the negation of +the two-argument test using the second and third arguments. +If the first argument is exactly @samp{(} and the third argument is +exactly @samp{)}, the result is the one-argument test of the second +argument. +Otherwise, the expression is false. + +@item 4 arguments +If the first argument is @samp{!}, the result is the negation of +the three-argument expression composed of the remaining arguments. +Otherwise, the expression is parsed and evaluated according to +precedence using the rules listed above. + +@item 5 or more arguments +The expression is parsed and evaluated according to precedence +using the rules listed above. +@end table + +When used with @code{test} or @samp{[}, the @samp{<} and @samp{>} +operators sort lexicographically using ASCII ordering. + +@item times +@btindex times +@example +times +@end example + +Print out the user and system times used by the shell and its children. +The return status is zero. + +@item trap +@btindex trap +@example +trap [-lp] [@var{arg}] [@var{sigspec} @dots{}] +@end example + +The commands in @var{arg} are to be read and executed when the +shell receives signal @var{sigspec}. If @var{arg} is absent (and +there is a single @var{sigspec}) or +equal to @samp{-}, each specified signal's disposition is reset +to the value it had when the shell was started. +If @var{arg} is the null string, then the signal specified by +each @var{sigspec} is ignored by the shell and commands it invokes. +If @var{arg} is not present and @option{-p} has been supplied, +the shell displays the trap commands associated with each @var{sigspec}. +If no arguments are supplied, or +only @option{-p} is given, @code{trap} prints the list of commands +associated with each signal number in a form that may be reused as +shell input. +The @option{-l} option causes the shell to print a list of signal names +and their corresponding numbers. +Each @var{sigspec} is either a signal name or a signal number. +Signal names are case insensitive and the @code{SIG} prefix is optional. + +If a @var{sigspec} +is @code{0} or @code{EXIT}, @var{arg} is executed when the shell exits. +If a @var{sigspec} is @code{DEBUG}, the command @var{arg} is executed +before every simple command, @code{for} command, @code{case} command, +@code{select} command, every arithmetic @code{for} command, and before +the first command executes in a shell function. +Refer to the description of the @code{extdebug} option to the +@code{shopt} builtin (@pxref{The Shopt Builtin}) for details of its +effect on the @code{DEBUG} trap. +If a @var{sigspec} is @code{RETURN}, the command @var{arg} is executed +each time a shell function or a script executed with the @code{.} or +@code{source} builtins finishes executing. + +If a @var{sigspec} is @code{ERR}, the command @var{arg} +is executed whenever +a pipeline (which may consist of a single simple +command), a list, or a compound command returns a +non-zero exit status, +subject to the following conditions. +The @code{ERR} trap is not executed if the failed command is part of the +command list immediately following an @code{until} or @code{while} keyword, +part of the test following the @code{if} or @code{elif} reserved words, +part of a command executed in a @code{&&} or @code{||} list +except the command following the final @code{&&} or @code{||}, +any command in a pipeline but the last, +or if the command's return +status is being inverted using @code{!}. +These are the same conditions obeyed by the @code{errexit} (@option{-e}) +option. + +Signals ignored upon entry to the shell cannot be trapped or reset. +Trapped signals that are not being ignored are reset to their original +values in a subshell or subshell environment when one is created. + +The return status is zero unless a @var{sigspec} does not specify a +valid signal. + +@item umask +@btindex umask +@example +umask [-p] [-S] [@var{mode}] +@end example + +Set the shell process's file creation mask to @var{mode}. If +@var{mode} begins with a digit, it is interpreted as an octal number; +if not, it is interpreted as a symbolic mode mask similar +to that accepted by the @code{chmod} command. If @var{mode} is +omitted, the current value of the mask is printed. If the @option{-S} +option is supplied without a @var{mode} argument, the mask is printed +in a symbolic format. +If the @option{-p} option is supplied, and @var{mode} +is omitted, the output is in a form that may be reused as input. +The return status is zero if the mode is successfully changed or if +no @var{mode} argument is supplied, and non-zero otherwise. + +Note that when the mode is interpreted as an octal number, each number +of the umask is subtracted from @code{7}. Thus, a umask of @code{022} +results in permissions of @code{755}. + +@item unset +@btindex unset +@example +unset [-fnv] [@var{name}] +@end example + +Remove each variable or function @var{name}. +If the @option{-v} option is given, each +@var{name} refers to a shell variable and that variable is remvoved. +If the @option{-f} option is given, the @var{name}s refer to shell +functions, and the function definition is removed. +If the @option{-n} option is supplied, and @var{name} is a variable with +the @var{nameref} attribute, @var{name} will be unset rather than the +variable it references. +@option{-n} has no effect if the @option{-f} option is supplied. +If no options are supplied, each @var{name} refers to a variable; if +there is no variable by that name, any function with that name is +unset. +Readonly variables and functions may not be unset. +The return status is zero unless a @var{name} is readonly. +@end table + +@node Bash Builtins +@section Bash Builtin Commands + +This section describes builtin commands which are unique to +or have been extended in Bash. +Some of these commands are specified in the @sc{posix} standard. + +@table @code + +@item alias +@btindex alias +@example +alias [-p] [@var{name}[=@var{value}] @dots{}] +@end example + +Without arguments or with the @option{-p} option, @code{alias} prints +the list of aliases on the standard output in a form that allows +them to be reused as input. +If arguments are supplied, an alias is defined for each @var{name} +whose @var{value} is given. If no @var{value} is given, the name +and value of the alias is printed. +Aliases are described in @ref{Aliases}. + +@item bind +@btindex bind +@example +bind [-m @var{keymap}] [-lpsvPSVX] +bind [-m @var{keymap}] [-q @var{function}] [-u @var{function}] [-r @var{keyseq}] +bind [-m @var{keymap}] -f @var{filename} +bind [-m @var{keymap}] -x @var{keyseq:shell-command} +bind [-m @var{keymap}] @var{keyseq:function-name} +bind @var{readline-command} +@end example + +Display current Readline (@pxref{Command Line Editing}) +key and function bindings, +bind a key sequence to a Readline function or macro, +or set a Readline variable. +Each non-option argument is a command as it would appear in a +Readline initialization file (@pxref{Readline Init File}), +but each binding or command must be passed as a separate argument; e.g., +@samp{"\C-x\C-r":re-read-init-file}. + +Options, if supplied, have the following meanings: + +@table @code +@item -m @var{keymap} +Use @var{keymap} as the keymap to be affected by +the subsequent bindings. Acceptable @var{keymap} +names are +@code{emacs}, +@code{emacs-standard}, +@code{emacs-meta}, +@code{emacs-ctlx}, +@code{vi}, +@code{vi-move}, +@code{vi-command}, and +@code{vi-insert}. +@code{vi} is equivalent to @code{vi-command}; +@code{emacs} is equivalent to @code{emacs-standard}. + +@item -l +List the names of all Readline functions. + +@item -p +Display Readline function names and bindings in such a way that they +can be used as input or in a Readline initialization file. + +@item -P +List current Readline function names and bindings. + +@item -v +Display Readline variable names and values in such a way that they +can be used as input or in a Readline initialization file. + +@item -V +List current Readline variable names and values. + +@item -s +Display Readline key sequences bound to macros and the strings they output +in such a way that they can be used as input or in a Readline +initialization file. + +@item -S +Display Readline key sequences bound to macros and the strings they output. + +@item -f @var{filename} +Read key bindings from @var{filename}. + +@item -q @var{function} +Query about which keys invoke the named @var{function}. + +@item -u @var{function} +Unbind all keys bound to the named @var{function}. + +@item -r @var{keyseq} +Remove any current binding for @var{keyseq}. + +@item -x @var{keyseq:shell-command} +Cause @var{shell-command} to be executed whenever @var{keyseq} is +entered. +When @var{shell-command} is executed, the shell sets the +@code{READLINE_LINE} variable to the contents of the Readline line +buffer and the @code{READLINE_POINT} variable to the current location +of the insertion point. +If the executed command changes the value of @code{READLINE_LINE} or +@code{READLINE_POINT}, those new values will be reflected in the +editing state. + +@item -X +List all key sequences bound to shell commands and the associated commands +in a format that can be reused as input. +@end table + +@noindent +The return status is zero unless an invalid option is supplied or an +error occurs. + +@item builtin +@btindex builtin +@example +builtin [@var{shell-builtin} [@var{args}]] +@end example + +Run a shell builtin, passing it @var{args}, and return its exit status. +This is useful when defining a shell function with the same +name as a shell builtin, retaining the functionality of the builtin within +the function. +The return status is non-zero if @var{shell-builtin} is not a shell +builtin command. + +@item caller +@btindex caller +@example +caller [@var{expr}] +@end example + +Returns the context of any active subroutine call (a shell function or +a script executed with the @code{.} or @code{source} builtins). + +Without @var{expr}, @code{caller} displays the line number and source +filename of the current subroutine call. +If a non-negative integer is supplied as @var{expr}, @code{caller} +displays the line number, subroutine name, and source file corresponding +to that position in the current execution call stack. This extra +information may be used, for example, to print a stack trace. The +current frame is frame 0. + +The return value is 0 unless the shell is not executing a subroutine +call or @var{expr} does not correspond to a valid position in the +call stack. + +@item command +@btindex command +@example +command [-pVv] @var{command} [@var{arguments} @dots{}] +@end example + +Runs @var{command} with @var{arguments} ignoring any shell function +named @var{command}. +Only shell builtin commands or commands found by searching the +@env{PATH} are executed. +If there is a shell function named @code{ls}, running @samp{command ls} +within the function will execute the external command @code{ls} +instead of calling the function recursively. +The @option{-p} option means to use a default value for @env{PATH} +that is guaranteed to find all of the standard utilities. +The return status in this case is 127 if @var{command} cannot be +found or an error occurred, and the exit status of @var{command} +otherwise. + +If either the @option{-V} or @option{-v} option is supplied, a +description of @var{command} is printed. The @option{-v} option +causes a single word indicating the command or file name used to +invoke @var{command} to be displayed; the @option{-V} option produces +a more verbose description. In this case, the return status is +zero if @var{command} is found, and non-zero if not. + +@item declare +@btindex declare +@example +declare [-aAfFgilnrtux] [-p] [@var{name}[=@var{value}] @dots{}] +@end example + +Declare variables and give them attributes. If no @var{name}s +are given, then display the values of variables instead. + +The @option{-p} option will display the attributes and values of each +@var{name}. +When @option{-p} is used with @var{name} arguments, additional options, +other than @option{-f} and @option{-F}, are ignored. + +When @option{-p} is supplied without @var{name} arguments, @code{declare} +will display the attributes and values of all variables having the +attributes specified by the additional options. +If no other options are supplied with @option{-p}, @code{declare} will +display the attributes and values of all shell variables. The @option{-f} +option will restrict the display to shell functions. + +The @option{-F} option inhibits the display of function definitions; +only the function name and attributes are printed. +If the @code{extdebug} shell option is enabled using @code{shopt} +(@pxref{The Shopt Builtin}), the source file name and line number where +the function is defined are displayed as well. +@option{-F} implies @option{-f}. + +The @option{-g} option forces variables to be created or modified at +the global scope, even when @code{declare} is executed in a shell function. +It is ignored in all other cases. + +The following options can be used to restrict output to variables with +the specified attributes or to give variables attributes: + +@table @code +@item -a +Each @var{name} is an indexed array variable (@pxref{Arrays}). + +@item -A +Each @var{name} is an associative array variable (@pxref{Arrays}). + +@item -f +Use function names only. + +@item -i +The variable is to be treated as +an integer; arithmetic evaluation (@pxref{Shell Arithmetic}) is +performed when the variable is assigned a value. + +@item -l +When the variable is assigned a value, all upper-case characters are +converted to lower-case. +The upper-case attribute is disabled. + +@item -n +Give each @var{name} the @var{nameref} attribute, making +it a name reference to another variable. +That other variable is defined by the value of @var{name}. +All references and assignments to @var{name}, except for changing the +@option{-n} attribute itself, are performed on the variable referenced by +@var{name}'s value. +The @option{-n} attribute cannot be applied to array variables. + +@item -r +Make @var{name}s readonly. These names cannot then be assigned values +by subsequent assignment statements or unset. + +@item -t +Give each @var{name} the @code{trace} attribute. +Traced functions inherit the @code{DEBUG} and @code{RETURN} traps from +the calling shell. +The trace attribute has no special meaning for variables. + +@item -u +When the variable is assigned a value, all lower-case characters are +converted to upper-case. +The lower-case attribute is disabled. + +@item -x +Mark each @var{name} for export to subsequent commands via +the environment. +@end table + +Using @samp{+} instead of @samp{-} turns off the attribute instead, +with the exceptions that @samp{+a} +may not be used to destroy an array variable and @samp{+r} will not +remove the readonly attribute. +When used in a function, @code{declare} makes each @var{name} local, +as with the @code{local} command, unless the @option{-g} option is used. +If a variable name is followed by =@var{value}, the value of the variable +is set to @var{value}. + +When using @option{-a} or @option{-A} and the compound assignment syntax to +create array variables, additional attributes do not take effect until +subsequent assignments. + +The return status is zero unless an invalid option is encountered, +an attempt is made to define a function using @samp{-f foo=bar}, +an attempt is made to assign a value to a readonly variable, +an attempt is made to assign a value to an array variable without +using the compound assignment syntax (@pxref{Arrays}), +one of the @var{names} is not a valid shell variable name, +an attempt is made to turn off readonly status for a readonly variable, +an attempt is made to turn off array status for an array variable, +or an attempt is made to display a non-existent function with @option{-f}. + +@item echo +@btindex echo +@example +echo [-neE] [@var{arg} @dots{}] +@end example + +Output the @var{arg}s, separated by spaces, terminated with a +newline. +The return status is 0 unless a write error occurs. +If @option{-n} is specified, the trailing newline is suppressed. +If the @option{-e} option is given, interpretation of the following +backslash-escaped characters is enabled. +The @option{-E} option disables the interpretation of these escape characters, +even on systems where they are interpreted by default. +The @code{xpg_echo} shell option may be used to +dynamically determine whether or not @code{echo} expands these +escape characters by default. +@code{echo} does not interpret @option{--} to mean the end of options. + +@code{echo} interprets the following escape sequences: +@table @code +@item \a +alert (bell) +@item \b +backspace +@item \c +suppress further output +@item \e +@itemx \E +escape +@item \f +form feed +@item \n +new line +@item \r +carriage return +@item \t +horizontal tab +@item \v +vertical tab +@item \\ +backslash +@item \0@var{nnn} +the eight-bit character whose value is the octal value @var{nnn} +(zero to three octal digits) +@item \x@var{HH} +the eight-bit character whose value is the hexadecimal value @var{HH} +(one or two hex digits) +@item \u@var{HHHH} +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +@var{HHHH} (one to four hex digits) +@item \U@var{HHHHHHHH} +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +@var{HHHHHHHH} (one to eight hex digits) +@end table + +@item enable +@btindex enable +@example +enable [-a] [-dnps] [-f @var{filename}] [@var{name} @dots{}] +@end example + +Enable and disable builtin shell commands. +Disabling a builtin allows a disk command which has the same name +as a shell builtin to be executed without specifying a full pathname, +even though the shell normally searches for builtins before disk commands. +If @option{-n} is used, the @var{name}s become disabled. Otherwise +@var{name}s are enabled. For example, to use the @code{test} binary +found via @env{$PATH} instead of the shell builtin version, type +@samp{enable -n test}. + +If the @option{-p} option is supplied, or no @var{name} arguments appear, +a list of shell builtins is printed. With no other arguments, the list +consists of all enabled shell builtins. +The @option{-a} option means to list +each builtin with an indication of whether or not it is enabled. + +The @option{-f} option means to load the new builtin command @var{name} +from shared object @var{filename}, on systems that support dynamic loading. +The @option{-d} option will delete a builtin loaded with @option{-f}. + +If there are no options, a list of the shell builtins is displayed. +The @option{-s} option restricts @code{enable} to the @sc{posix} special +builtins. If @option{-s} is used with @option{-f}, the new builtin becomes +a special builtin (@pxref{Special Builtins}). + +The return status is zero unless a @var{name} is not a shell builtin +or there is an error loading a new builtin from a shared object. + +@item help +@btindex help +@example +help [-dms] [@var{pattern}] +@end example + +Display helpful information about builtin commands. +If @var{pattern} is specified, @code{help} gives detailed help +on all commands matching @var{pattern}, otherwise a list of +the builtins is printed. + +Options, if supplied, have the following meanings: + +@table @code +@item -d +Display a short description of each @var{pattern} +@item -m +Display the description of each @var{pattern} in a manpage-like format +@item -s +Display only a short usage synopsis for each @var{pattern} +@end table + +The return status is zero unless no command matches @var{pattern}. + +@item let +@btindex let +@example +let @var{expression} [@var{expression} @dots{}] +@end example + +The @code{let} builtin allows arithmetic to be performed on shell +variables. Each @var{expression} is evaluated according to the +rules given below in @ref{Shell Arithmetic}. If the +last @var{expression} evaluates to 0, @code{let} returns 1; +otherwise 0 is returned. + +@item local +@btindex local +@example +local [@var{option}] @var{name}[=@var{value}] @dots{} +@end example + +For each argument, a local variable named @var{name} is created, +and assigned @var{value}. +The @var{option} can be any of the options accepted by @code{declare}. +@code{local} can only be used within a function; it makes the variable +@var{name} have a visible scope restricted to that function and its +children. The return status is zero unless @code{local} is used outside +a function, an invalid @var{name} is supplied, or @var{name} is a +readonly variable. + +@item logout +@btindex logout +@example +logout [@var{n}] +@end example + +Exit a login shell, returning a status of @var{n} to the shell's +parent. + +@item mapfile +@btindex mapfile +@example +mapfile [-n @var{count}] [-O @var{origin}] [-s @var{count}] [-t] [-u @var{fd}] + [-C @var{callback}] [-c @var{quantum}] [@var{array}] +@end example + +Read lines from the standard input into the indexed array variable @var{array}, +or from file descriptor @var{fd} +if the @option{-u} option is supplied. +The variable @code{MAPFILE} is the default @var{array}. +Options, if supplied, have the following meanings: + +@table @code + +@item -n +Copy at most @var{count} lines. If @var{count} is 0, all lines are copied. +@item -O +Begin assigning to @var{array} at index @var{origin}. +The default index is 0. +@item -s +Discard the first @var{count} lines read. +@item -t +Remove a trailing newline from each line read. +@item -u +Read lines from file descriptor @var{fd} instead of the standard input. +@item -C +Evaluate @var{callback} each time @var{quantum}P lines are read. +The @option{-c} option specifies @var{quantum}. +@item -c +Specify the number of lines read between each call to @var{callback}. +@end table + +If @option{-C} is specified without @option{-c}, +the default quantum is 5000. +When @var{callback} is evaluated, it is supplied the index of the next +array element to be assigned and the line to be assigned to that element +as additional arguments. +@var{callback} is evaluated after the line is read but before the +array element is assigned. + +If not supplied with an explicit origin, @code{mapfile} will clear @var{array} +before assigning to it. + +@code{mapfile} returns successfully unless an invalid option or option +argument is supplied, @var{array} is invalid or unassignable, or @var{array} +is not an indexed array. + +@item printf +@btindex printf +@example +printf [-v @var{var}] @var{format} [@var{arguments}] +@end example + +Write the formatted @var{arguments} to the standard output under the +control of the @var{format}. +The @option{-v} option causes the output to be assigned to the variable +@var{var} rather than being printed to the standard output. + +The @var{format} is a character string which contains three types of objects: +plain characters, which are simply copied to standard output, character +escape sequences, which are converted and copied to the standard output, and +format specifications, each of which causes printing of the next successive +@var{argument}. +In addition to the standard @code{printf(1)} formats, @code{printf} +interprets the following extensions: + +@table @code +@item %b +Causes @code{printf} to expand backslash escape sequences in the +corresponding @var{argument}, +except that @samp{\c} terminates output, backslashes in +@samp{\'}, @samp{\"}, and @samp{\?} are not removed, and octal escapes +beginning with @samp{\0} may contain up to four digits. +@item %q +Causes @code{printf} to output the +corresponding @var{argument} in a format that can be reused as shell input. +@item %(@var{datefmt})T +Causes @code{printf} to output the date-time string resulting from using +@var{datefmt} as a format string for @code{strftime}(3). +The corresponding @var{argument} is an integer representing the number of +seconds since the epoch. +Two special argument values may be used: -1 represents the current +time, and -2 represents the time the shell was invoked. +If no argument is specified, conversion behaves as if -1 had been given. +This is an exception to the usual @code{printf} behavior. +@end table + +@noindent +Arguments to non-string format specifiers are treated as C language constants, +except that a leading plus or minus sign is allowed, and if the leading +character is a single or double quote, the value is the ASCII value of +the following character. + +The @var{format} is reused as necessary to consume all of the @var{arguments}. +If the @var{format} requires more @var{arguments} than are supplied, the +extra format specifications behave as if a zero value or null string, as +appropriate, had been supplied. The return value is zero on success, +non-zero on failure. + +@item read +@btindex read +@example +read [-ers] [-a @var{aname}] [-d @var{delim}] [-i @var{text}] [-n @var{nchars}] + [-N @var{nchars}] [-p @var{prompt}] [-t @var{timeout}] [-u @var{fd}] [@var{name} @dots{}] +@end example + +One line is read from the standard input, or from the file descriptor +@var{fd} supplied as an argument to the @option{-u} option, and the first word +is assigned to the first @var{name}, the second word to the second @var{name}, +and so on, with leftover words and their intervening separators assigned +to the last @var{name}. +If there are fewer words read from the input stream than names, +the remaining names are assigned empty values. +The characters in the value of the @env{IFS} variable +are used to split the line into words using the same rules the shell +uses for expansion (described above in @ref{Word Splitting}). +The backslash character @samp{\} may be used to remove any special +meaning for the next character read and for line continuation. +If no names are supplied, the line read is assigned to the +variable @env{REPLY}. +The return code is zero, unless end-of-file is encountered, @code{read} +times out (in which case the return code is greater than 128), +a variable assignment error (such as assigning to a readonly variable) occurs, +or an invalid file descriptor is supplied as the argument to @option{-u}. + +Options, if supplied, have the following meanings: + +@table @code +@item -a @var{aname} +The words are assigned to sequential indices of the array variable +@var{aname}, starting at 0. +All elements are removed from @var{aname} before the assignment. +Other @var{name} arguments are ignored. + +@item -d @var{delim} +The first character of @var{delim} is used to terminate the input line, +rather than newline. + +@item -e +Readline (@pxref{Command Line Editing}) is used to obtain the line. +Readline uses the current (or default, if line editing was not previously +active) editing settings. + +@item -i @var{text} +If Readline is being used to read the line, @var{text} is placed into +the editing buffer before editing begins. + +@item -n @var{nchars} +@code{read} returns after reading @var{nchars} characters rather than +waiting for a complete line of input, but honor a delimiter if fewer +than @var{nchars} characters are read before the delimiter. + +@item -N @var{nchars} +@code{read} returns after reading exactly @var{nchars} characters rather +than waiting for a complete line of input, unless EOF is encountered or +@code{read} times out. +Delimiter characters encountered in the input are +not treated specially and do not cause @code{read} to return until +@var{nchars} characters are read. + +@item -p @var{prompt} +Display @var{prompt}, without a trailing newline, before attempting +to read any input. +The prompt is displayed only if input is coming from a terminal. + +@item -r +If this option is given, backslash does not act as an escape character. +The backslash is considered to be part of the line. +In particular, a backslash-newline pair may not be used as a line +continuation. + +@item -s +Silent mode. If input is coming from a terminal, characters are +not echoed. + +@item -t @var{timeout} +Cause @code{read} to time out and return failure if a complete line of +input (or a specified number of characters) +is not read within @var{timeout} seconds. +@var{timeout} may be a decimal number with a fractional portion following +the decimal point. +This option is only effective if @code{read} is reading input from a +terminal, pipe, or other special file; it has no effect when reading +from regular files. +If @code{read} times out, @code{read} saves any partial input read into +the specified variable @var{name}. +If @var{timeout} is 0, @code{read} returns immediately, without trying to +read and data. The exit status is 0 if input is available on +the specified file descriptor, non-zero otherwise. +The exit status is greater than 128 if the timeout is exceeded. + +@item -u @var{fd} +Read input from file descriptor @var{fd}. +@end table + +@item readarray +@btindex readarray +@example +readarray [-n @var{count}] [-O @var{origin}] [-s @var{count}] [-t] [-u @var{fd}] + [-C @var{callback}] [-c @var{quantum}] [@var{array}] +@end example + +Read lines from the standard input into the indexed array variable @var{array}, +or from file descriptor @var{fd} +if the @option{-u} option is supplied. + +A synonym for @code{mapfile}. + +@item source +@btindex source +@example +source @var{filename} +@end example + +A synonym for @code{.} (@pxref{Bourne Shell Builtins}). + +@item type +@btindex type +@example +type [-afptP] [@var{name} @dots{}] +@end example + +For each @var{name}, indicate how it would be interpreted if used as a +command name. + +If the @option{-t} option is used, @code{type} prints a single word +which is one of @samp{alias}, @samp{function}, @samp{builtin}, +@samp{file} or @samp{keyword}, +if @var{name} is an alias, shell function, shell builtin, +disk file, or shell reserved word, respectively. +If the @var{name} is not found, then nothing is printed, and +@code{type} returns a failure status. + +If the @option{-p} option is used, @code{type} either returns the name +of the disk file that would be executed, or nothing if @option{-t} +would not return @samp{file}. + +The @option{-P} option forces a path search for each @var{name}, even if +@option{-t} would not return @samp{file}. + +If a command is hashed, @option{-p} and @option{-P} print the hashed value, +which is not necessarily the file that appears first in @code{$PATH}. + +If the @option{-a} option is used, @code{type} returns all of the places +that contain an executable named @var{file}. +This includes aliases and functions, if and only if the @option{-p} option +is not also used. + +If the @option{-f} option is used, @code{type} does not attempt to find +shell functions, as with the @code{command} builtin. + +The return status is zero if all of the @var{names} are found, non-zero +if any are not found. + +@item typeset +@btindex typeset +@example +typeset [-afFgrxilnrtux] [-p] [@var{name}[=@var{value}] @dots{}] +@end example + +The @code{typeset} command is supplied for compatibility with the Korn +shell. +It is a synonym for the @code{declare} builtin command. + +@item ulimit +@btindex ulimit +@example +ulimit [-abcdefilmnpqrstuvxHST] [@var{limit}] +@end example + +@code{ulimit} provides control over the resources available to processes +started by the shell, on systems that allow such control. If an +option is given, it is interpreted as follows: + +@table @code +@item -S +Change and report the soft limit associated with a resource. + +@item -H +Change and report the hard limit associated with a resource. + +@item -a +All current limits are reported. + +@item -b +The maximum socket buffer size. + +@item -c +The maximum size of core files created. + +@item -d +The maximum size of a process's data segment. + +@item -e +The maximum scheduling priority ("nice"). + +@item -f +The maximum size of files written by the shell and its children. + +@item -i +The maximum number of pending signals. + +@item -l +The maximum size that may be locked into memory. + +@item -m +The maximum resident set size (many systems do not honor this limit). + +@item -n +The maximum number of open file descriptors (most systems do not +allow this value to be set). + +@item -p +The pipe buffer size. + +@item -q +The maximum number of bytes in POSIX message queues. + +@item -r +The maximum real-time scheduling priority. + +@item -s +The maximum stack size. + +@item -t +The maximum amount of cpu time in seconds. + +@item -u +The maximum number of processes available to a single user. + +@item -v +The maximum amount of virtual memory available to the shell, and, on +some systems, to its children. + +@item -x +The maximum number of file locks. + +@item -T +The maximum number of threads. +@end table + +If @var{limit} is given, and the @option{-a} option is not used, +@var{limit} is the new value of the specified resource. +The special @var{limit} values @code{hard}, @code{soft}, and +@code{unlimited} stand for the current hard limit, the current soft limit, +and no limit, respectively. +A hard limit cannot be increased by a non-root user once it is set; +a soft limit may be increased up to the value of the hard limit. +Otherwise, the current value of the soft limit for the specified resource +is printed, unless the @option{-H} option is supplied. +When setting new limits, if neither @option{-H} nor @option{-S} is supplied, +both the hard and soft limits are set. +If no option is given, then @option{-f} is assumed. Values are in 1024-byte +increments, except for @option{-t}, which is in seconds; @option{-p}, +which is in units of 512-byte blocks; and @option{-T}, @option{-b}, +@option{-n} and @option{-u}, which are unscaled values. + +The return status is zero unless an invalid option or argument is supplied, +or an error occurs while setting a new limit. + +@item unalias +@btindex unalias +@example +unalias [-a] [@var{name} @dots{} ] +@end example + +Remove each @var{name} from the list of aliases. If @option{-a} is +supplied, all aliases are removed. +Aliases are described in @ref{Aliases}. +@end table + +@node Modifying Shell Behavior +@section Modifying Shell Behavior + +@menu +* The Set Builtin:: Change the values of shell attributes and + positional parameters. +* The Shopt Builtin:: Modify shell optional behavior. +@end menu + +@node The Set Builtin +@subsection The Set Builtin + +This builtin is so complicated that it deserves its own section. @code{set} +allows you to change the values of shell options and set the positional +parameters, or to display the names and values of shell variables. + +@table @code +@item set +@btindex set +@example +set [--abefhkmnptuvxBCEHPT] [-o @var{option-name}] [@var{argument} @dots{}] +set [+abefhkmnptuvxBCEHPT] [+o @var{option-name}] [@var{argument} @dots{}] +@end example + +If no options or arguments are supplied, @code{set} displays the names +and values of all shell variables and functions, sorted according to the +current locale, in a format that may be reused as input +for setting or resetting the currently-set variables. +Read-only variables cannot be reset. +In @sc{posix} mode, only shell variables are listed. + +When options are supplied, they set or unset shell attributes. +Options, if specified, have the following meanings: + +@table @code +@item -a +Mark variables and function which are modified or created for export +to the environment of subsequent commands. + +@item -b +Cause the status of terminated background jobs to be reported +immediately, rather than before printing the next primary prompt. + +@item -e +Exit immediately if +a pipeline (@pxref{Pipelines}), which may consist of a single simple command +(@pxref{Simple Commands}), +a list (@pxref{Lists}), +or a compound command (@pxref{Compound Commands}) +returns a non-zero status. +The shell does not exit if the command that fails is part of the +command list immediately following a @code{while} or @code{until} keyword, +part of the test in an @code{if} statement, +part of any command executed in a @code{&&} or @code{||} list except +the command following the final @code{&&} or @code{||}, +any command in a pipeline but the last, +or if the command's return status is being inverted with @code{!}. +If a compound command other than a subshell +returns a non-zero status because a command failed +while @option{-e} was being ignored, the shell does not exit. +A trap on @code{ERR}, if set, is executed before the shell exits. + +This option applies to the shell environment and each subshell environment +separately (@pxref{Command Execution Environment}), and may cause +subshells to exit before executing all the commands in the subshell. + +If a compound command or shell function executes in a context where +@option{-e} is being ignored, +none of the commands executed within the compound command or function body +will be affected by the @option{-e} setting, even if @option{-e} is set +and a command returns a failure status. +If a compound command or shell function sets @option{-e} while executing in +a context where @option{-e} is ignored, that setting will not have any +effect until the compound command or the command containing the function +call completes. + +@item -f +Disable filename expansion (globbing). + +@item -h +Locate and remember (hash) commands as they are looked up for execution. +This option is enabled by default. + +@item -k +All arguments in the form of assignment statements are placed +in the environment for a command, not just those that precede +the command name. + +@item -m +Job control is enabled (@pxref{Job Control}). +All processes run in a separate process group. +When a background job completes, the shell prints a line +containing its exit status. + +@item -n +Read commands but do not execute them; this may be used to check a +script for syntax errors. +This option is ignored by interactive shells. + +@item -o @var{option-name} + +Set the option corresponding to @var{option-name}: + +@table @code +@item allexport +Same as @code{-a}. + +@item braceexpand +Same as @code{-B}. + +@item emacs +Use an @code{emacs}-style line editing interface (@pxref{Command Line Editing}). +This also affects the editing interface used for @code{read -e}. + +@item errexit +Same as @code{-e}. + +@item errtrace +Same as @code{-E}. + +@item functrace +Same as @code{-T}. + +@item hashall +Same as @code{-h}. + +@item histexpand +Same as @code{-H}. + +@item history +Enable command history, as described in @ref{Bash History Facilities}. +This option is on by default in interactive shells. + +@item ignoreeof +An interactive shell will not exit upon reading EOF. + +@item keyword +Same as @code{-k}. + +@item monitor +Same as @code{-m}. + +@item noclobber +Same as @code{-C}. + +@item noexec +Same as @code{-n}. + +@item noglob +Same as @code{-f}. + +@item nolog +Currently ignored. + +@item notify +Same as @code{-b}. + +@item nounset +Same as @code{-u}. + +@item onecmd +Same as @code{-t}. + +@item physical +Same as @code{-P}. + +@item pipefail +If set, the return value of a pipeline is the value of the last +(rightmost) command to exit with a non-zero status, or zero if all +commands in the pipeline exit successfully. +This option is disabled by default. + +@item posix +Change the behavior of Bash where the default operation differs +from the @sc{posix} standard to match the standard +(@pxref{Bash POSIX Mode}). +This is intended to make Bash behave as a strict superset of that +standard. + +@item privileged +Same as @code{-p}. + +@item verbose +Same as @code{-v}. + +@item vi +Use a @code{vi}-style line editing interface. +This also affects the editing interface used for @code{read -e}. + +@item xtrace +Same as @code{-x}. +@end table + +@item -p +Turn on privileged mode. +In this mode, the @env{$BASH_ENV} and @env{$ENV} files are not +processed, shell functions are not inherited from the environment, +and the @env{SHELLOPTS}, @env{BASHOPTS}, @env{CDPATH} and @env{GLOBIGNORE} +variables, if they appear in the environment, are ignored. +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the @option{-p} option is not supplied, these actions +are taken and the effective user id is set to the real user id. +If the @option{-p} option is supplied at startup, the effective user id is +not reset. +Turning this option off causes the effective user +and group ids to be set to the real user and group ids. + +@item -t +Exit after reading and executing one command. + +@item -u +Treat unset variables and parameters other than the special parameters +@samp{@@} or @samp{*} as an error when performing parameter expansion. +An error message will be written to the standard error, and a non-interactive +shell will exit. + +@item -v +Print shell input lines as they are read. + +@item -x +Print a trace of simple commands, @code{for} commands, @code{case} +commands, @code{select} commands, and arithmetic @code{for} commands +and their arguments or associated word lists after they are +expanded and before they are executed. The value of the @env{PS4} +variable is expanded and the resultant value is printed before +the command and its expanded arguments. + +@item -B +The shell will perform brace expansion (@pxref{Brace Expansion}). +This option is on by default. + +@item -C +Prevent output redirection using @samp{>}, @samp{>&}, and @samp{<>} +from overwriting existing files. + +@item -E +If set, any trap on @code{ERR} is inherited by shell functions, command +substitutions, and commands executed in a subshell environment. +The @code{ERR} trap is normally not inherited in such cases. + +@item -H +Enable @samp{!} style history substitution (@pxref{History Interaction}). +This option is on by default for interactive shells. + +@item -P +If set, do not resolve symbolic links when performing commands such as +@code{cd} which change the current directory. The physical directory +is used instead. By default, Bash follows +the logical chain of directories when performing commands +which change the current directory. + +For example, if @file{/usr/sys} is a symbolic link to @file{/usr/local/sys} +then: +@example +$ cd /usr/sys; echo $PWD +/usr/sys +$ cd ..; pwd +/usr +@end example + +@noindent +If @code{set -P} is on, then: +@example +$ cd /usr/sys; echo $PWD +/usr/local/sys +$ cd ..; pwd +/usr/local +@end example + +@item -T +If set, any trap on @code{DEBUG} and @code{RETURN} are inherited by +shell functions, command substitutions, and commands executed +in a subshell environment. +The @code{DEBUG} and @code{RETURN} traps are normally not inherited +in such cases. + +@item -- +If no arguments follow this option, then the positional parameters are +unset. Otherwise, the positional parameters are set to the +@var{arguments}, even if some of them begin with a @samp{-}. + +@item - +Signal the end of options, cause all remaining @var{arguments} +to be assigned to the positional parameters. The @option{-x} +and @option{-v} options are turned off. +If there are no arguments, the positional parameters remain unchanged. +@end table + +Using @samp{+} rather than @samp{-} causes these options to be +turned off. The options can also be used upon invocation of the +shell. The current set of options may be found in @code{$-}. + +The remaining N @var{arguments} are positional parameters and are +assigned, in order, to @code{$1}, @code{$2}, @dots{} @code{$N}. +The special parameter @code{#} is set to N. + +The return status is always zero unless an invalid option is supplied. +@end table + +@node The Shopt Builtin +@subsection The Shopt Builtin + +This builtin allows you to change additional shell optional behavior. + +@table @code + +@item shopt +@btindex shopt +@example +shopt [-pqsu] [-o] [@var{optname} @dots{}] +@end example + +Toggle the values of settings controlling optional shell behavior. +The settings can be either those listed below, or, if the +@option{-o} option is used, those available with the @option{-o} +option to the @code{set} builtin command (@pxref{The Set Builtin}). +With no options, or with the @option{-p} option, a list of all settable +options is displayed, with an indication of whether or not each is set. +The @option{-p} option causes output to be displayed in a form that +may be reused as input. +Other options have the following meanings: + +@table @code +@item -s +Enable (set) each @var{optname}. + +@item -u +Disable (unset) each @var{optname}. + +@item -q +Suppresses normal output; the return status +indicates whether the @var{optname} is set or unset. +If multiple @var{optname} arguments are given with @option{-q}, +the return status is zero if all @var{optnames} are enabled; +non-zero otherwise. + +@item -o +Restricts the values of +@var{optname} to be those defined for the @option{-o} option to the +@code{set} builtin (@pxref{The Set Builtin}). +@end table + +If either @option{-s} or @option{-u} +is used with no @var{optname} arguments, @code{shopt} shows only +those options which are set or unset, respectively. + +Unless otherwise noted, the @code{shopt} options are disabled (off) +by default. + +The return status when listing options is zero if all @var{optnames} +are enabled, non-zero otherwise. When setting or unsetting options, +the return status is zero unless an @var{optname} is not a valid shell +option. + +The list of @code{shopt} options is: +@table @code + +@item autocd +If set, a command name that is the name of a directory is executed as if +it were the argument to the @code{cd} command. +This option is only used by interactive shells. + +@item cdable_vars +If this is set, an argument to the @code{cd} builtin command that +is not a directory is assumed to be the name of a variable whose +value is the directory to change to. + +@item cdspell +If set, minor errors in the spelling of a directory component in a +@code{cd} command will be corrected. +The errors checked for are transposed characters, +a missing character, and a character too many. +If a correction is found, the corrected path is printed, +and the command proceeds. +This option is only used by interactive shells. + +@item checkhash +If this is set, Bash checks that a command found in the hash +table exists before trying to execute it. If a hashed command no +longer exists, a normal path search is performed. + +@item checkjobs +If set, Bash lists the status of any stopped and running jobs before +exiting an interactive shell. If any jobs are running, this causes +the exit to be deferred until a second exit is attempted without an +intervening command (@pxref{Job Control}). +The shell always postpones exiting if any jobs are stopped. + +@item checkwinsize +If set, Bash checks the window size after each command + and, if necessary, updates the values of +@env{LINES} and @env{COLUMNS}. + +@item cmdhist +If set, Bash +attempts to save all lines of a multiple-line +command in the same history entry. This allows +easy re-editing of multi-line commands. + +@item compat31 +If set, Bash +changes its behavior to that of version 3.1 with respect to quoted +arguments to the conditional command's @samp{=~} operator +and with respect to locale-specific +string comparison when using the @code{[[} +conditional command's @samp{<} and @samp{>} operators. +Bash versions prior to bash-4.1 use ASCII collation and strcmp(3); +bash-4.1 and later use the current locale's collation sequence and strcoll(3). + +@item compat32 +If set, Bash +changes its behavior to that of version 3.2 with respect to locale-specific +string comparison when using the @code{[[} +conditional command's @samp{<} and @samp{>} operators (see previous item). + +@item compat40 +If set, Bash +changes its behavior to that of version 4.0 with respect to locale-specific +string comparison when using the @code{[[} +conditional command's @samp{<} and @samp{>} operators (see description +of @code{compat31}) +and the effect of interrupting a command list. +Bash versions 4.0 and later interrupt the list as if the shell received the +interrupt; previous versions continue with the next command in the list. + +@item compat41 +If set, Bash, when in @sc{posix} mode, treats a single quote in a double-quoted +parameter expansion as a special character. The single quotes must match +(an even number) and the characters between the single quotes are considered +quoted. This is the behavior of @sc{posix} mode through version 4.1. +The default Bash behavior remains as in previous versions. + +@item compat42 +If set, Bash +does not process the replacement string in the pattern substitution word +expansion using quote removal. + +@item complete_fullquote +If set, Bash +quotes all shell metacharacters in filenames and directory names when +performing completion. +If not set, Bash +removes metacharacters such as the dollar sign from the set of +characters that will be quoted in completed filenames +when these metacharacters appear in shell variable references in words to be +completed. +This means that dollar signs in variable names that expand to directories +will not be quoted; +however, any dollar signs appearing in filenames will not be quoted, either. +This is active only when bash is using backslashes to quote completed +filenames. +This variable is set by default, which is the default Bash behavior in +versions through 4.2. + +@item direxpand +If set, Bash +replaces directory names with the results of word expansion when performing +filename completion. This changes the contents of the readline editing +buffer. +If not set, Bash attempts to preserve what the user typed. + +@item dirspell +If set, Bash +attempts spelling correction on directory names during word completion +if the directory name initially supplied does not exist. + +@item dotglob +If set, Bash includes filenames beginning with a `.' in +the results of filename expansion. + +@item execfail +If this is set, a non-interactive shell will not exit if +it cannot execute the file specified as an argument to the @code{exec} +builtin command. An interactive shell does not exit if @code{exec} +fails. + +@item expand_aliases +If set, aliases are expanded as described below under Aliases, +@ref{Aliases}. +This option is enabled by default for interactive shells. + +@item extdebug +If set, behavior intended for use by debuggers is enabled: + +@enumerate +@item +The @option{-F} option to the @code{declare} builtin (@pxref{Bash Builtins}) +displays the source file name and line number corresponding to each function +name supplied as an argument. + +@item +If the command run by the @code{DEBUG} trap returns a non-zero value, the +next command is skipped and not executed. + +@item +If the command run by the @code{DEBUG} trap returns a value of 2, and the +shell is executing in a subroutine (a shell function or a shell script +executed by the @code{.} or @code{source} builtins), a call to +@code{return} is simulated. + +@item +@code{BASH_ARGC} and @code{BASH_ARGV} are updated as described in their +descriptions (@pxref{Bash Variables}). + +@item +Function tracing is enabled: command substitution, shell functions, and +subshells invoked with @code{( @var{command} )} inherit the +@code{DEBUG} and @code{RETURN} traps. + +@item +Error tracing is enabled: command substitution, shell functions, and +subshells invoked with @code{( @var{command} )} inherit the +@code{ERR} trap. +@end enumerate + +@item extglob +If set, the extended pattern matching features described above +(@pxref{Pattern Matching}) are enabled. + +@item extquote +If set, @code{$'@var{string}'} and @code{$"@var{string}"} quoting is +performed within @code{$@{@var{parameter}@}} expansions +enclosed in double quotes. This option is enabled by default. + +@item failglob +If set, patterns which fail to match filenames during filename expansion +result in an expansion error. + +@item force_fignore +If set, the suffixes specified by the @env{FIGNORE} shell variable +cause words to be ignored when performing word completion even if +the ignored words are the only possible completions. +@xref{Bash Variables}, for a description of @env{FIGNORE}. +This option is enabled by default. + +@item globasciiranges +If set, range expressions used in pattern matching bracket expressions +(@pxref{Pattern Matching}) +behave as if in the traditional C locale when performing +comparisons. That is, the current locale's collating sequence +is not taken into account, so +@samp{b} will not collate between @samp{A} and @samp{B}, +and upper-case and lower-case ASCII characters will collate together. + +@item globstar +If set, the pattern @samp{**} used in a filename expansion context will +match all files and zero or more directories and subdirectories. +If the pattern is followed by a @samp{/}, only directories and +subdirectories match. + +@item gnu_errfmt +If set, shell error messages are written in the standard @sc{gnu} error +message format. + +@item histappend +If set, the history list is appended to the file named by the value +of the @env{HISTFILE} +variable when the shell exits, rather than overwriting the file. + +@item histreedit +If set, and Readline +is being used, a user is given the opportunity to re-edit a +failed history substitution. + +@item histverify +If set, and Readline +is being used, the results of history substitution are not immediately +passed to the shell parser. Instead, the resulting line is loaded into +the Readline editing buffer, allowing further modification. + +@item hostcomplete +If set, and Readline is being used, Bash will attempt to perform +hostname completion when a word containing a @samp{@@} is being +completed (@pxref{Commands For Completion}). This option is enabled +by default. + +@item huponexit +If set, Bash will send @code{SIGHUP} to all jobs when an interactive +login shell exits (@pxref{Signals}). + +@item interactive_comments +Allow a word beginning with @samp{#} +to cause that word and all remaining characters on that +line to be ignored in an interactive shell. +This option is enabled by default. + +@item lastpipe +If set, and job control is not active, the shell runs the last command of +a pipeline not executed in the background in the current shell environment. + +@item lithist +If enabled, and the @code{cmdhist} +option is enabled, multi-line commands are saved to the history with +embedded newlines rather than using semicolon separators where possible. + +@item login_shell +The shell sets this option if it is started as a login shell +(@pxref{Invoking Bash}). +The value may not be changed. + +@item mailwarn +If set, and a file that Bash is checking for mail has been +accessed since the last time it was checked, the message +@code{"The mail in @var{mailfile} has been read"} is displayed. + +@item no_empty_cmd_completion +If set, and Readline is being used, Bash will not attempt to search +the @env{PATH} for possible completions when completion is attempted +on an empty line. + +@item nocaseglob +If set, Bash matches filenames in a case-insensitive fashion when +performing filename expansion. + +@item nocasematch +If set, Bash matches patterns in a case-insensitive fashion when +performing matching while executing @code{case} or @code{[[} +conditional commands. + +@item nullglob +If set, Bash allows filename patterns which match no +files to expand to a null string, rather than themselves. + +@item progcomp +If set, the programmable completion facilities +(@pxref{Programmable Completion}) are enabled. +This option is enabled by default. + +@item promptvars +If set, prompt strings undergo +parameter expansion, command substitution, arithmetic +expansion, and quote removal after being expanded +as described below (@pxref{Controlling the Prompt}). +This option is enabled by default. + +@item restricted_shell +The shell sets this option if it is started in restricted mode +(@pxref{The Restricted Shell}). +The value may not be changed. +This is not reset when the startup files are executed, allowing +the startup files to discover whether or not a shell is restricted. + +@item shift_verbose +If this is set, the @code{shift} +builtin prints an error message when the shift count exceeds the +number of positional parameters. + +@item sourcepath +If set, the @code{source} builtin uses the value of @env{PATH} +to find the directory containing the file supplied as an argument. +This option is enabled by default. + +@item xpg_echo +If set, the @code{echo} builtin expands backslash-escape sequences +by default. + +@end table + +@noindent +The return status when listing options is zero if all @var{optnames} +are enabled, non-zero otherwise. +When setting or unsetting options, the return status is zero unless an +@var{optname} is not a valid shell option. +@end table + +@node Special Builtins +@section Special Builtins +@cindex special builtin + +For historical reasons, the @sc{posix} standard has classified +several builtin commands as @emph{special}. +When Bash is executing in @sc{posix} mode, the special builtins +differ from other builtin commands in three respects: + +@enumerate +@item +Special builtins are found before shell functions during command lookup. + +@item +If a special builtin returns an error status, a non-interactive shell exits. + +@item +Assignment statements preceding the command stay in effect in the shell +environment after the command completes. +@end enumerate + +When Bash is not executing in @sc{posix} mode, these builtins behave no +differently than the rest of the Bash builtin commands. +The Bash @sc{posix} mode is described in @ref{Bash POSIX Mode}. + +These are the @sc{posix} special builtins: +@example +@w{break : . continue eval exec exit export readonly return set} +@w{shift trap unset} +@end example + +@node Shell Variables +@chapter Shell Variables + +@menu +* Bourne Shell Variables:: Variables which Bash uses in the same way + as the Bourne Shell. +* Bash Variables:: List of variables that exist in Bash. +@end menu + +This chapter describes the shell variables that Bash uses. +Bash automatically assigns default values to a number of variables. + +@node Bourne Shell Variables +@section Bourne Shell Variables + +Bash uses certain shell variables in the same way as the Bourne shell. +In some cases, Bash assigns a default value to the variable. + +@vtable @code + +@item CDPATH +A colon-separated list of directories used as a search path for +the @code{cd} builtin command. + +@item HOME +The current user's home directory; the default for the @code{cd} builtin +command. +The value of this variable is also used by tilde expansion +(@pxref{Tilde Expansion}). + +@item IFS +A list of characters that separate fields; used when the shell splits +words as part of expansion. + +@item MAIL +If this parameter is set to a filename or directory name +and the @env{MAILPATH} variable +is not set, Bash informs the user of the arrival of mail in +the specified file or Maildir-format directory. + +@item MAILPATH +A colon-separated list of filenames which the shell periodically checks +for new mail. +Each list entry can specify the message that is printed when new mail +arrives in the mail file by separating the filename from the message with +a @samp{?}. +When used in the text of the message, @code{$_} expands to the name of +the current mail file. + +@item OPTARG +The value of the last option argument processed by the @code{getopts} builtin. + +@item OPTIND +The index of the last option argument processed by the @code{getopts} builtin. + +@item PATH +A colon-separated list of directories in which the shell looks for +commands. +A zero-length (null) directory name in the value of @code{PATH} indicates the +current directory. +A null directory name may appear as two adjacent colons, or as an initial +or trailing colon. + + +@item PS1 +The primary prompt string. The default value is @samp{\s-\v\$ }. +@xref{Controlling the Prompt}, for the complete list of escape +sequences that are expanded before @env{PS1} is displayed. + +@item PS2 +The secondary prompt string. The default value is @samp{> }. + +@end vtable + +@node Bash Variables +@section Bash Variables + +These variables are set or used by Bash, but other shells +do not normally treat them specially. + +A few variables used by Bash are described in different chapters: +variables for controlling the job control facilities +(@pxref{Job Control Variables}). + +@vtable @code + +@item BASH +The full pathname used to execute the current instance of Bash. + +@item BASHOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the @option{-s} option to the +@code{shopt} builtin command (@pxref{The Shopt Builtin}). +The options appearing in @env{BASHOPTS} are those reported +as @samp{on} by @samp{shopt}. +If this variable is in the environment when Bash +starts up, each shell option in the list will be enabled before +reading any startup files. This variable is readonly. + +@item BASHPID +Expands to the process ID of the current Bash process. +This differs from @code{$$} under certain circumstances, such as subshells +that do not require Bash to be re-initialized. + +@item BASH_ALIASES +An associative array variable whose members correspond to the internal +list of aliases as maintained by the @code{alias} builtin. +(@pxref{Bourne Shell Builtins}). +Elements added to this array appear in the alias list; unsetting array +elements cause aliases to be removed from the alias list. + +@item BASH_ARGC +An array variable whose values are the number of parameters in each +frame of the current bash execution call stack. The number of +parameters to the current subroutine (shell function or script executed +with @code{.} or @code{source}) is at the top of the stack. When a +subroutine is executed, the number of parameters passed is pushed onto +@code{BASH_ARGC}. +The shell sets @code{BASH_ARGC} only when in extended debugging mode +(see @ref{The Shopt Builtin} +for a description of the @code{extdebug} option to the @code{shopt} +builtin). + +@item BASH_ARGV +An array variable containing all of the parameters in the current bash +execution call stack. The final parameter of the last subroutine call +is at the top of the stack; the first parameter of the initial call is +at the bottom. When a subroutine is executed, the parameters supplied +are pushed onto @code{BASH_ARGV}. +The shell sets @code{BASH_ARGV} only when in extended debugging mode +(see @ref{The Shopt Builtin} +for a description of the @code{extdebug} option to the @code{shopt} +builtin). + +@item BASH_CMDS +An associative array variable whose members correspond to the internal +hash table of commands as maintained by the @code{hash} builtin +(@pxref{Bourne Shell Builtins}). +Elements added to this array appear in the hash table; unsetting array +elements cause commands to be removed from the hash table. + +@item BASH_COMMAND +The command currently being executed or about to be executed, unless the +shell is executing a command as the result of a trap, +in which case it is the command executing at the time of the trap. + +@item BASH_COMPAT +The value is used to set the shell's compatibility level. +@xref{The Shopt Builtin}, for a description of the various compatibility +levels and their effects. +The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42) +corresponding to the desired compatibility level. +If @code{BASH_COMPAT} is unset or set to the empty string, the compatibility +level is set to the default for the current version. +If @code{BASH_COMPAT} is set to a value that is not one of the valid +compatibility levels, the shell prints an error message and sets the +compatibility level to the default for the current version. +The valid compatibility levels correspond to the compatibility options +accepted by the @code{shopt} builtin described above (for example, +@var{compat42} means that 4.2 and 42 are valid values). +The current version is also a valid value. + +@item BASH_ENV +If this variable is set when Bash is invoked to execute a shell +script, its value is expanded and used as the name of a startup file +to read before executing the script. @xref{Bash Startup Files}. + +@item BASH_EXECUTION_STRING +The command argument to the @option{-c} invocation option. + +@item BASH_LINENO +An array variable whose members are the line numbers in source files +where each corresponding member of @var{FUNCNAME} was invoked. +@code{$@{BASH_LINENO[$i]@}} is the line number in the source file +(@code{$@{BASH_SOURCE[$i+1]@}}) where +@code{$@{FUNCNAME[$i]@}} was called (or @code{$@{BASH_LINENO[$i-1]@}} if +referenced within another shell function). +Use @code{LINENO} to obtain the current line number. + +@item BASH_REMATCH +An array variable whose members are assigned by the @samp{=~} binary +operator to the @code{[[} conditional command +(@pxref{Conditional Constructs}). +The element with index 0 is the portion of the string +matching the entire regular expression. +The element with index @var{n} is the portion of the +string matching the @var{n}th parenthesized subexpression. +This variable is read-only. + +@item BASH_SOURCE +An array variable whose members are the source filenames where the +corresponding shell function names in the @code{FUNCNAME} array +variable are defined. +The shell function @code{$@{FUNCNAME[$i]@}} is defined in the file +@code{$@{BASH_SOURCE[$i]@}} and called from @code{$@{BASH_SOURCE[$i+1]@}} + +@item BASH_SUBSHELL +Incremented by one within each subshell or subshell environment when +the shell begins executing in that environment. +The initial value is 0. + +@item BASH_VERSINFO +A readonly array variable (@pxref{Arrays}) +whose members hold version information for this instance of Bash. +The values assigned to the array members are as follows: + +@table @code + +@item BASH_VERSINFO[0] +The major version number (the @var{release}). + +@item BASH_VERSINFO[1] +The minor version number (the @var{version}). + +@item BASH_VERSINFO[2] +The patch level. + +@item BASH_VERSINFO[3] +The build version. + +@item BASH_VERSINFO[4] +The release status (e.g., @var{beta1}). + +@item BASH_VERSINFO[5] +The value of @env{MACHTYPE}. +@end table + +@item BASH_VERSION +The version number of the current instance of Bash. + +@item BASH_XTRACEFD +If set to an integer corresponding to a valid file descriptor, Bash +will write the trace output generated when @samp{set -x} +is enabled to that file descriptor. +This allows tracing output to be separated from diagnostic and error +messages. +The file descriptor is closed when @code{BASH_XTRACEFD} is unset or assigned +a new value. +Unsetting @code{BASH_XTRACEFD} or assigning it the empty string causes the +trace output to be sent to the standard error. +Note that setting @code{BASH_XTRACEFD} to 2 (the standard error file +descriptor) and then unsetting it will result in the standard error +being closed. + +@item CHILD_MAX +Set the number of exited child status values for the shell to remember. +Bash will not allow this value to be decreased below a @sc{posix}-mandated +minimum, and there is a maximum value (currently 8192) that this may +not exceed. +The minimum value is system-dependent. + +@item COLUMNS +Used by the @code{select} command to determine the terminal width +when printing selection lists. +Automatically set if the @code{checkwinsize} option is enabled +(@pxref{The Shopt Builtin}), or in an interactive shell upon receipt of a +@code{SIGWINCH}. + +@item COMP_CWORD +An index into @env{$@{COMP_WORDS@}} of the word containing the current +cursor position. +This variable is available only in shell functions invoked by the +programmable completion facilities (@pxref{Programmable Completion}). + +@item COMP_LINE +The current command line. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (@pxref{Programmable Completion}). + +@item COMP_POINT +The index of the current cursor position relative to the beginning of +the current command. +If the current cursor position is at the end of the current command, +the value of this variable is equal to @code{$@{#COMP_LINE@}}. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (@pxref{Programmable Completion}). + +@item COMP_TYPE +Set to an integer value corresponding to the type of completion attempted +that caused a completion function to be called: +@var{TAB}, for normal completion, +@samp{?}, for listing completions after successive tabs, +@samp{!}, for listing alternatives on partial word completion, +@samp{@@}, to list completions if the word is not unmodified, +or +@samp{%}, for menu completion. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (@pxref{Programmable Completion}). + +@item COMP_KEY +The key (or final key of a key sequence) used to invoke the current +completion function. + +@item COMP_WORDBREAKS +The set of characters that the Readline library treats as word +separators when performing word completion. +If @code{COMP_WORDBREAKS} is unset, it loses its special properties, +even if it is subsequently reset. + +@item COMP_WORDS +An array variable consisting of the individual +words in the current command line. +The line is split into words as Readline would split it, using +@code{COMP_WORDBREAKS} as described above. +This variable is available only in shell functions invoked by the +programmable completion facilities (@pxref{Programmable Completion}). + +@item COMPREPLY +An array variable from which Bash reads the possible completions +generated by a shell function invoked by the programmable completion +facility (@pxref{Programmable Completion}). +Each array element contains one possible completion. + +@item COPROC +An array variable created to hold the file descriptors +for output from and input to an unnamed coprocess (@pxref{Coprocesses}). + +@item DIRSTACK +An array variable containing the current contents of the directory stack. +Directories appear in the stack in the order they are displayed by the +@code{dirs} builtin. +Assigning to members of this array variable may be used to modify +directories already in the stack, but the @code{pushd} and @code{popd} +builtins must be used to add and remove directories. +Assignment to this variable will not change the current directory. +If @env{DIRSTACK} is unset, it loses its special properties, even if +it is subsequently reset. + +@item EMACS +If Bash finds this variable in the environment when the shell +starts with value @samp{t}, it assumes that the shell is running in an +Emacs shell buffer and disables line editing. + +@item ENV +Similar to @code{BASH_ENV}; used when the shell is invoked in +@sc{posix} Mode (@pxref{Bash POSIX Mode}). + +@item EUID +The numeric effective user id of the current user. This variable +is readonly. + +@item FCEDIT +The editor used as a default by the @option{-e} option to the @code{fc} +builtin command. + +@item FIGNORE +A colon-separated list of suffixes to ignore when performing +filename completion. +A filename whose suffix matches one of the entries in +@env{FIGNORE} +is excluded from the list of matched filenames. A sample +value is @samp{.o:~} + +@item FUNCNAME +An array variable containing the names of all shell functions +currently in the execution call stack. +The element with index 0 is the name of any currently-executing +shell function. +The bottom-most element (the one with the highest index) +is @code{"main"}. +This variable exists only when a shell function is executing. +Assignments to @env{FUNCNAME} have no effect and return an error status. +If @env{FUNCNAME} is unset, it loses its special properties, even if +it is subsequently reset. + +This variable can be used with @code{BASH_LINENO} and @code{BASH_SOURCE}. +Each element of @code{FUNCNAME} has corresponding elements in +@code{BASH_LINENO} and @code{BASH_SOURCE} to describe the call stack. +For instance, @code{$@{FUNCNAME[$i]@}} was called from the file +@code{$@{BASH_SOURCE[$i+1]@}} at line number @code{$@{BASH_LINENO[$i]@}}. +The @code{caller} builtin displays the current call stack using this +information. + +@item FUNCNEST +If set to a numeric value greater than 0, defines a maximum function +nesting level. Function invocations that exceed this nesting level +will cause the current command to abort. + +@item GLOBIGNORE +A colon-separated list of patterns defining the set of filenames to +be ignored by filename expansion. +If a filename matched by a filename expansion pattern also matches one +of the patterns in @env{GLOBIGNORE}, it is removed from the list +of matches. + +@item GROUPS +An array variable containing the list of groups of which the current +user is a member. +Assignments to @env{GROUPS} have no effect and return an error status. +If @env{GROUPS} is unset, it loses its special properties, even if it is +subsequently reset. + +@item histchars +Up to three characters which control history expansion, quick +substitution, and tokenization (@pxref{History Interaction}). +The first character is the +@var{history expansion} character, that is, the character which signifies the +start of a history expansion, normally @samp{!}. The second character is the +character which signifies `quick substitution' when seen as the first +character on a line, normally @samp{^}. The optional third character is the +character which indicates that the remainder of the line is a comment when +found as the first character of a word, usually @samp{#}. The history +comment character causes history substitution to be skipped for the +remaining words on the line. It does not necessarily cause the shell +parser to treat the rest of the line as a comment. + +@item HISTCMD +The history number, or index in the history list, of the current +command. If @env{HISTCMD} is unset, it loses its special properties, +even if it is subsequently reset. + +@item HISTCONTROL +A colon-separated list of values controlling how commands are saved on +the history list. +If the list of values includes @samp{ignorespace}, lines which begin +with a space character are not saved in the history list. +A value of @samp{ignoredups} causes lines which match the previous +history entry to not be saved. +A value of @samp{ignoreboth} is shorthand for +@samp{ignorespace} and @samp{ignoredups}. +A value of @samp{erasedups} causes all previous lines matching the +current line to be removed from the history list before that line +is saved. +Any value not in the above list is ignored. +If @env{HISTCONTROL} is unset, or does not include a valid value, +all lines read by the shell parser are saved on the history list, +subject to the value of @env{HISTIGNORE}. +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +@env{HISTCONTROL}. + +@item HISTFILE +The name of the file to which the command history is saved. The +default value is @file{~/.bash_history}. + +@item HISTFILESIZE +The maximum number of lines contained in the history file. +When this variable is assigned a value, the history file is truncated, +if necessary, to contain no more than that number of lines +by removing the oldest entries. +The history file is also truncated to this size after +writing it when a shell exits. +If the value is 0, the history file is truncated to zero size. +Non-numeric values and numeric values less than zero inhibit truncation. +The shell sets the default value to the value of @env{HISTSIZE} +after reading any startup files. + +@item HISTIGNORE +A colon-separated list of patterns used to decide which command +lines should be saved on the history list. Each pattern is +anchored at the beginning of the line and must match the complete +line (no implicit @samp{*} is appended). Each pattern is tested +against the line after the checks specified by @env{HISTCONTROL} +are applied. In addition to the normal shell pattern matching +characters, @samp{&} matches the previous history line. @samp{&} +may be escaped using a backslash; the backslash is removed +before attempting a match. +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +@env{HISTIGNORE}. + +@env{HISTIGNORE} subsumes the function of @env{HISTCONTROL}. A +pattern of @samp{&} is identical to @code{ignoredups}, and a +pattern of @samp{[ ]*} is identical to @code{ignorespace}. +Combining these two patterns, separating them with a colon, +provides the functionality of @code{ignoreboth}. + +@item HISTSIZE +The maximum number of commands to remember on the history list. +If the value is 0, commands are not saved in the history list. +Numeric values less than zero result in every command being saved +on the history list (there is no limit). +The shell sets the default value to 500 after reading any startup files. + +@item HISTTIMEFORMAT +If this variable is set and not null, its value is used as a format string +for @var{strftime} to print the time stamp associated with each history +entry displayed by the @code{history} builtin. +If this variable is set, time stamps are written to the history file so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. + +@item HOSTFILE +Contains the name of a file in the same format as @file{/etc/hosts} that +should be read when the shell needs to complete a hostname. +The list of possible hostname completions may be changed while the shell +is running; +the next time hostname completion is attempted after the +value is changed, Bash adds the contents of the new file to the +existing list. +If @env{HOSTFILE} is set, but has no value, or does not name a readable file, +Bash attempts to read +@file{/etc/hosts} to obtain the list of possible hostname completions. +When @env{HOSTFILE} is unset, the hostname list is cleared. + +@item HOSTNAME +The name of the current host. + +@item HOSTTYPE +A string describing the machine Bash is running on. + +@item IGNOREEOF +Controls the action of the shell on receipt of an @code{EOF} character +as the sole input. If set, the value denotes the number +of consecutive @code{EOF} characters that can be read as the +first character on an input line +before the shell will exit. If the variable exists but does not +have a numeric value (or has no value) then the default is 10. +If the variable does not exist, then @code{EOF} signifies the end of +input to the shell. This is only in effect for interactive shells. + +@item INPUTRC +The name of the Readline initialization file, overriding the default +of @file{~/.inputrc}. + +@item LANG +Used to determine the locale category for any category not specifically +selected with a variable starting with @code{LC_}. + +@item LC_ALL +This variable overrides the value of @env{LANG} and any other +@code{LC_} variable specifying a locale category. + +@item LC_COLLATE +This variable determines the collation order used when sorting the +results of filename expansion, and +determines the behavior of range expressions, equivalence classes, +and collating sequences within filename expansion and pattern matching +(@pxref{Filename Expansion}). + +@item LC_CTYPE +This variable determines the interpretation of characters and the +behavior of character classes within filename expansion and pattern +matching (@pxref{Filename Expansion}). + +@item LC_MESSAGES +This variable determines the locale used to translate double-quoted +strings preceded by a @samp{$} (@pxref{Locale Translation}). + +@item LC_NUMERIC +This variable determines the locale category used for number formatting. + +@item LINENO +The line number in the script or shell function currently executing. + +@item LINES +Used by the @code{select} command to determine the column length +for printing selection lists. +Automatically set if the @code{checkwinsize} option is enabled +(@pxref{The Shopt Builtin}), or in an interactive shell upon receipt of a +@code{SIGWINCH}. + +@item MACHTYPE +A string that fully describes the system type on which Bash +is executing, in the standard @sc{gnu} @var{cpu-company-system} format. + +@item MAILCHECK +How often (in seconds) that the shell should check for mail in the +files specified in the @env{MAILPATH} or @env{MAIL} variables. +The default is 60 seconds. When it is time to check +for mail, the shell does so before displaying the primary prompt. +If this variable is unset, or set to a value that is not a number +greater than or equal to zero, the shell disables mail checking. + +@item MAPFILE +An array variable created to hold the text read by the +@code{mapfile} builtin when no variable name is supplied. + +@item OLDPWD +The previous working directory as set by the @code{cd} builtin. + +@item OPTERR +If set to the value 1, Bash displays error messages +generated by the @code{getopts} builtin command. + +@item OSTYPE +A string describing the operating system Bash is running on. + +@item PIPESTATUS +An array variable (@pxref{Arrays}) +containing a list of exit status values from the processes +in the most-recently-executed foreground pipeline (which may +contain only a single command). + +@item POSIXLY_CORRECT +If this variable is in the environment when Bash starts, the shell +enters @sc{posix} mode (@pxref{Bash POSIX Mode}) before reading the +startup files, as if the @option{--posix} invocation option had been supplied. +If it is set while the shell is running, Bash enables @sc{posix} mode, +as if the command +@example +@code{set -o posix} +@end example +@noindent +had been executed. + +@item PPID +The process @sc{id} of the shell's parent process. This variable +is readonly. + +@item PROMPT_COMMAND +If set, the value is interpreted as a command to execute +before the printing of each primary prompt (@env{$PS1}). + +@item PROMPT_DIRTRIM +If set to a number greater than zero, the value is used as the number of +trailing directory components to retain when expanding the @code{\w} and +@code{\W} prompt string escapes (@pxref{Controlling the Prompt}). +Characters removed are replaced with an ellipsis. + +@item PS3 +The value of this variable is used as the prompt for the +@code{select} command. If this variable is not set, the +@code{select} command prompts with @samp{#? } + +@item PS4 +The value is the prompt printed before the command line is echoed +when the @option{-x} option is set (@pxref{The Set Builtin}). +The first character of @env{PS4} is replicated multiple times, as +necessary, to indicate multiple levels of indirection. +The default is @samp{+ }. + +@item PWD +The current working directory as set by the @code{cd} builtin. + +@item RANDOM +Each time this parameter is referenced, a random integer +between 0 and 32767 is generated. Assigning a value to this +variable seeds the random number generator. + +@item READLINE_LINE +The contents of the Readline line buffer, for use +with @samp{bind -x} (@pxref{Bash Builtins}). + +@item READLINE_POINT +The position of the insertion point in the Readline line buffer, for use +with @samp{bind -x} (@pxref{Bash Builtins}). + +@item REPLY +The default variable for the @code{read} builtin. + +@item SECONDS +This variable expands to the number of seconds since the +shell was started. Assignment to this variable resets +the count to the value assigned, and the expanded value +becomes the value assigned plus the number of seconds +since the assignment. + +@item SHELL +The full pathname to the shell is kept in this environment variable. +If it is not set when the shell starts, +Bash assigns to it the full pathname of the current user's login shell. + +@item SHELLOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the @option{-o} option to the +@code{set} builtin command (@pxref{The Set Builtin}). +The options appearing in @env{SHELLOPTS} are those reported +as @samp{on} by @samp{set -o}. +If this variable is in the environment when Bash +starts up, each shell option in the list will be enabled before +reading any startup files. This variable is readonly. + +@item SHLVL +Incremented by one each time a new instance of Bash is started. This is +intended to be a count of how deeply your Bash shells are nested. + +@item TIMEFORMAT +The value of this parameter is used as a format string specifying +how the timing information for pipelines prefixed with the @code{time} +reserved word should be displayed. +The @samp{%} character introduces an +escape sequence that is expanded to a time value or other +information. +The escape sequences and their meanings are as +follows; the braces denote optional portions. + +@table @code + +@item %% +A literal @samp{%}. + +@item %[@var{p}][l]R +The elapsed time in seconds. + +@item %[@var{p}][l]U +The number of CPU seconds spent in user mode. + +@item %[@var{p}][l]S +The number of CPU seconds spent in system mode. + +@item %P +The CPU percentage, computed as (%U + %S) / %R. +@end table + +The optional @var{p} is a digit specifying the precision, the number of +fractional digits after a decimal point. +A value of 0 causes no decimal point or fraction to be output. +At most three places after the decimal point may be specified; values +of @var{p} greater than 3 are changed to 3. +If @var{p} is not specified, the value 3 is used. + +The optional @code{l} specifies a longer format, including minutes, of +the form @var{MM}m@var{SS}.@var{FF}s. +The value of @var{p} determines whether or not the fraction is included. + +If this variable is not set, Bash acts as if it had the value +@example +@code{$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'} +@end example +If the value is null, no timing information is displayed. +A trailing newline is added when the format string is displayed. + +@item TMOUT +If set to a value greater than zero, @code{TMOUT} is treated as the +default timeout for the @code{read} builtin (@pxref{Bash Builtins}). +The @code{select} command (@pxref{Conditional Constructs}) terminates +if input does not arrive after @code{TMOUT} seconds when input is coming +from a terminal. + +In an interactive shell, the value is interpreted as +the number of seconds to wait for a line of input after issuing +the primary prompt. +Bash +terminates after waiting for that number of seconds if a complete +line of input does not arrive. + +@item TMPDIR +If set, Bash uses its value as the name of a directory in which +Bash creates temporary files for the shell's use. + +@item UID +The numeric real user id of the current user. This variable is readonly. + +@end vtable + +@node Bash Features +@chapter Bash Features + +This chapter describes features unique to Bash. + +@menu +* Invoking Bash:: Command line options that you can give + to Bash. +* Bash Startup Files:: When and how Bash executes scripts. +* Interactive Shells:: What an interactive shell is. +* Bash Conditional Expressions:: Primitives used in composing expressions for + the @code{test} builtin. +* Shell Arithmetic:: Arithmetic on shell variables. +* Aliases:: Substituting one command for another. +* Arrays:: Array Variables. +* The Directory Stack:: History of visited directories. +* Controlling the Prompt:: Customizing the various prompt strings. +* The Restricted Shell:: A more controlled mode of shell execution. +* Bash POSIX Mode:: Making Bash behave more closely to what + the POSIX standard specifies. +@end menu + +@node Invoking Bash +@section Invoking Bash + +@example +bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o @var{option}] [-O @var{shopt_option}] [@var{argument} @dots{}] +bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o @var{option}] [-O @var{shopt_option}] -c @var{string} [@var{argument} @dots{}] +bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o @var{option}] [-O @var{shopt_option}] [@var{argument} @dots{}] +@end example + +All of the single-character options used with the @code{set} builtin +(@pxref{The Set Builtin}) can be used as options when the shell is invoked. +In addition, there are several multi-character +options that you can use. These options must appear on the command +line before the single-character options to be recognized. + +@table @code +@item --debugger +Arrange for the debugger profile to be executed before the shell +starts. Turns on extended debugging mode (see @ref{The Shopt Builtin} +for a description of the @code{extdebug} option to the @code{shopt} +builtin). + +@item --dump-po-strings +A list of all double-quoted strings preceded by @samp{$} +is printed on the standard output +in the @sc{gnu} @code{gettext} PO (portable object) file format. +Equivalent to @option{-D} except for the output format. + +@item --dump-strings +Equivalent to @option{-D}. + +@item --help +Display a usage message on standard output and exit successfully. + +@item --init-file @var{filename} +@itemx --rcfile @var{filename} +Execute commands from @var{filename} (instead of @file{~/.bashrc}) +in an interactive shell. + +@item --login +Equivalent to @option{-l}. + +@item --noediting +Do not use the @sc{gnu} Readline library (@pxref{Command Line Editing}) +to read command lines when the shell is interactive. + +@item --noprofile +Don't load the system-wide startup file @file{/etc/profile} +or any of the personal initialization files +@file{~/.bash_profile}, @file{~/.bash_login}, or @file{~/.profile} +when Bash is invoked as a login shell. + +@item --norc +Don't read the @file{~/.bashrc} initialization file in an +interactive shell. This is on by default if the shell is +invoked as @code{sh}. + +@item --posix +Change the behavior of Bash where the default operation differs +from the @sc{posix} standard to match the standard. This +is intended to make Bash behave as a strict superset of that +standard. @xref{Bash POSIX Mode}, for a description of the Bash +@sc{posix} mode. + +@item --restricted +Make the shell a restricted shell (@pxref{The Restricted Shell}). + +@item --verbose +Equivalent to @option{-v}. Print shell input lines as they're read. + +@item --version +Show version information for this instance of +Bash on the standard output and exit successfully. +@end table + +There are several single-character options that may be supplied at +invocation which are not available with the @code{set} builtin. + +@table @code +@item -c +Read and execute commands from the first non-option @var{argument} +after processing the options, then exit. +Any remaining arguments are assigned to the +positional parameters, starting with @code{$0}. + +@item -i +Force the shell to run interactively. Interactive shells are +described in @ref{Interactive Shells}. + +@item -l +Make this shell act as if it had been directly invoked by login. +When the shell is interactive, this is equivalent to starting a +login shell with @samp{exec -l bash}. +When the shell is not interactive, the login shell startup files will +be executed. +@samp{exec bash -l} or @samp{exec bash --login} +will replace the current shell with a Bash login shell. +@xref{Bash Startup Files}, for a description of the special behavior +of a login shell. + +@item -r +Make the shell a restricted shell (@pxref{The Restricted Shell}). + +@item -s +If this option is present, or if no arguments remain after option +processing, then commands are read from the standard input. +This option allows the positional parameters to be set +when invoking an interactive shell. + +@item -D +A list of all double-quoted strings preceded by @samp{$} +is printed on the standard output. +These are the strings that +are subject to language translation when the current locale +is not @code{C} or @code{POSIX} (@pxref{Locale Translation}). +This implies the @option{-n} option; no commands will be executed. + +@item [-+]O [@var{shopt_option}] +@var{shopt_option} is one of the shell options accepted by the +@code{shopt} builtin (@pxref{The Shopt Builtin}). +If @var{shopt_option} is present, @option{-O} sets the value of that option; +@option{+O} unsets it. +If @var{shopt_option} is not supplied, the names and values of the shell +options accepted by @code{shopt} are printed on the standard output. +If the invocation option is @option{+O}, the output is displayed in a format +that may be reused as input. + +@item -- +A @code{--} signals the end of options and disables further option +processing. +Any arguments after the @code{--} are treated as filenames and arguments. +@end table + +@cindex login shell +A @emph{login} shell is one whose first character of argument zero is +@samp{-}, or one invoked with the @option{--login} option. + +@cindex interactive shell +An @emph{interactive} shell is one started without non-option arguments, +unless @option{-s} is specified, +without specifying the @option{-c} option, and whose input and output are both +connected to terminals (as determined by @code{isatty(3)}), or one +started with the @option{-i} option. @xref{Interactive Shells}, for more +information. + +If arguments remain after option processing, and neither the +@option{-c} nor the @option{-s} +option has been supplied, the first argument is assumed to +be the name of a file containing shell commands (@pxref{Shell Scripts}). +When Bash is invoked in this fashion, @code{$0} +is set to the name of the file, and the positional parameters +are set to the remaining arguments. +Bash reads and executes commands from this file, then exits. +Bash's exit status is the exit status of the last command executed +in the script. If no commands are executed, the exit status is 0. + +@node Bash Startup Files +@section Bash Startup Files +@cindex startup files + +This section describes how Bash executes its startup files. +If any of the files exist but cannot be read, Bash reports an error. +Tildes are expanded in filenames as described above under +Tilde Expansion (@pxref{Tilde Expansion}). + +Interactive shells are described in @ref{Interactive Shells}. + +@subsubheading Invoked as an interactive login shell, or with @option{--login} + +When Bash is invoked as an interactive login shell, or as a +non-interactive shell with the @option{--login} option, it first reads and +executes commands from the file @file{/etc/profile}, if that file exists. +After reading that file, it looks for @file{~/.bash_profile}, +@file{~/.bash_login}, and @file{~/.profile}, in that order, and reads +and executes commands from the first one that exists and is readable. +The @option{--noprofile} option may be used when the shell is started to +inhibit this behavior. + +When a login shell exits, Bash reads and executes commands from +the file @file{~/.bash_logout}, if it exists. + +@subsubheading Invoked as an interactive non-login shell + +When an interactive shell that is not a login shell is started, Bash +reads and executes commands from @file{~/.bashrc}, if that file exists. +This may be inhibited by using the @option{--norc} option. +The @option{--rcfile @var{file}} option will force Bash to read and +execute commands from @var{file} instead of @file{~/.bashrc}. + +So, typically, your @file{~/.bash_profile} contains the line +@example +@code{if [ -f ~/.bashrc ]; then . ~/.bashrc; fi} +@end example +@noindent +after (or before) any login-specific initializations. + +@subsubheading Invoked non-interactively + +When Bash is started non-interactively, to run a shell script, +for example, it looks for the variable @env{BASH_ENV} in the environment, +expands its value if it appears there, and uses the expanded value as +the name of a file to read and execute. Bash behaves as if the +following command were executed: +@example +@code{if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi} +@end example +@noindent +but the value of the @env{PATH} variable is not used to search for the +filename. + +As noted above, if a non-interactive shell is invoked with the +@option{--login} option, Bash attempts to read and execute commands from the +login shell startup files. + +@subsubheading Invoked with name @code{sh} + +If Bash is invoked with the name @code{sh}, it tries to mimic the +startup behavior of historical versions of @code{sh} as closely as +possible, while conforming to the @sc{posix} standard as well. + +When invoked as an interactive login shell, or as a non-interactive +shell with the @option{--login} option, it first attempts to read +and execute commands from @file{/etc/profile} and @file{~/.profile}, in +that order. +The @option{--noprofile} option may be used to inhibit this behavior. +When invoked as an interactive shell with the name @code{sh}, Bash +looks for the variable @env{ENV}, expands its value if it is defined, +and uses the expanded value as the name of a file to read and execute. +Since a shell invoked as @code{sh} does not attempt to read and execute +commands from any other startup files, the @option{--rcfile} option has +no effect. +A non-interactive shell invoked with the name @code{sh} does not attempt +to read any other startup files. + +When invoked as @code{sh}, Bash enters @sc{posix} mode after +the startup files are read. + +@subsubheading Invoked in @sc{posix} mode + +When Bash is started in @sc{posix} mode, as with the +@option{--posix} command line option, it follows the @sc{posix} standard +for startup files. +In this mode, interactive shells expand the @env{ENV} variable +and commands are read and executed from the file whose name is the +expanded value. +No other startup files are read. + +@subsubheading Invoked by remote shell daemon + +Bash attempts to determine when it is being run with its standard input +connected to a network connection, as when executed by the remote shell +daemon, usually @code{rshd}, or the secure shell daemon @code{sshd}. +If Bash determines it is being run in +this fashion, it reads and executes commands from @file{~/.bashrc}, if that +file exists and is readable. +It will not do this if invoked as @code{sh}. +The @option{--norc} option may be used to inhibit this behavior, and the +@option{--rcfile} option may be used to force another file to be read, but +neither @code{rshd} nor @code{sshd} generally invoke the shell with those +options or allow them to be specified. + +@subsubheading Invoked with unequal effective and real @sc{uid/gid}s + +If Bash is started with the effective user (group) id not equal to the +real user (group) id, and the @option{-p} option is not supplied, no startup +files are read, shell functions are not inherited from the environment, +the @env{SHELLOPTS}, @env{BASHOPTS}, @env{CDPATH}, and @env{GLOBIGNORE} +variables, if they appear in the environment, are ignored, and the effective +user id is set to the real user id. +If the @option{-p} option is supplied at invocation, the startup behavior is +the same, but the effective user id is not reset. + +@node Interactive Shells +@section Interactive Shells +@cindex interactive shell +@cindex shell, interactive + +@menu +* What is an Interactive Shell?:: What determines whether a shell is Interactive. +* Is this Shell Interactive?:: How to tell if a shell is interactive. +* Interactive Shell Behavior:: What changes in a interactive shell? +@end menu + +@node What is an Interactive Shell? +@subsection What is an Interactive Shell? + +An interactive shell +is one started without non-option arguments, unless @option{-s} is +specified, without specifying the @option{-c} option, and +whose input and error output are both +connected to terminals (as determined by @code{isatty(3)}), +or one started with the @option{-i} option. + +An interactive shell generally reads from and writes to a user's +terminal. + +The @option{-s} invocation option may be used to set the positional parameters +when an interactive shell is started. + +@node Is this Shell Interactive? +@subsection Is this Shell Interactive? + +To determine within a startup script whether or not Bash is +running interactively, +test the value of the @samp{-} special parameter. +It contains @code{i} when the shell is interactive. For example: + +@example +case "$-" in +*i*) echo This shell is interactive ;; +*) echo This shell is not interactive ;; +esac +@end example + +Alternatively, startup scripts may examine the variable +@env{PS1}; it is unset in non-interactive shells, and set in +interactive shells. Thus: + +@example +if [ -z "$PS1" ]; then + echo This shell is not interactive +else + echo This shell is interactive +fi +@end example + +@node Interactive Shell Behavior +@subsection Interactive Shell Behavior + +When the shell is running interactively, it changes its behavior in +several ways. + +@enumerate +@item +Startup files are read and executed as described in @ref{Bash Startup Files}. + +@item +Job Control (@pxref{Job Control}) is enabled by default. When job +control is in effect, Bash ignores the keyboard-generated job control +signals @code{SIGTTIN}, @code{SIGTTOU}, and @code{SIGTSTP}. + +@item +Bash expands and displays @env{PS1} before reading the first line +of a command, and expands and displays @env{PS2} before reading the +second and subsequent lines of a multi-line command. + +@item +Bash executes the value of the @env{PROMPT_COMMAND} variable as a command +before printing the primary prompt, @env{$PS1} +(@pxref{Bash Variables}). + +@item +Readline (@pxref{Command Line Editing}) is used to read commands from +the user's terminal. + +@item +Bash inspects the value of the @code{ignoreeof} option to @code{set -o} +instead of exiting immediately when it receives an @code{EOF} on its +standard input when reading a command (@pxref{The Set Builtin}). + +@item +Command history (@pxref{Bash History Facilities}) +and history expansion (@pxref{History Interaction}) +are enabled by default. +Bash will save the command history to the file named by @env{$HISTFILE} +when a shell with history enabled exits. + +@item +Alias expansion (@pxref{Aliases}) is performed by default. + +@item +In the absence of any traps, Bash ignores @code{SIGTERM} +(@pxref{Signals}). + +@item +In the absence of any traps, @code{SIGINT} is caught and handled +((@pxref{Signals}). +@code{SIGINT} will interrupt some shell builtins. + +@item +An interactive login shell sends a @code{SIGHUP} to all jobs on exit +if the @code{huponexit} shell option has been enabled (@pxref{Signals}). + +@item +The @option{-n} invocation option is ignored, and @samp{set -n} has +no effect (@pxref{The Set Builtin}). + +@item +Bash will check for mail periodically, depending on the values of the +@env{MAIL}, @env{MAILPATH}, and @env{MAILCHECK} shell variables +(@pxref{Bash Variables}). + +@item +Expansion errors due to references to unbound shell variables after +@samp{set -u} has been enabled will not cause the shell to exit +(@pxref{The Set Builtin}). + +@item +The shell will not exit on expansion errors caused by @var{var} being unset +or null in @code{$@{@var{var}:?@var{word}@}} expansions +(@pxref{Shell Parameter Expansion}). + +@item +Redirection errors encountered by shell builtins will not cause the +shell to exit. + +@item +When running in @sc{posix} mode, a special builtin returning an error +status will not cause the shell to exit (@pxref{Bash POSIX Mode}). + +@item +A failed @code{exec} will not cause the shell to exit +(@pxref{Bourne Shell Builtins}). + +@item +Parser syntax errors will not cause the shell to exit. + +@item +Simple spelling correction for directory arguments to the @code{cd} +builtin is enabled by default (see the description of the @code{cdspell} +option to the @code{shopt} builtin in @ref{The Shopt Builtin}). + +@item +The shell will check the value of the @env{TMOUT} variable and exit +if a command is not read within the specified number of seconds after +printing @env{$PS1} (@pxref{Bash Variables}). + +@end enumerate + +@node Bash Conditional Expressions +@section Bash Conditional Expressions +@cindex expressions, conditional + +Conditional expressions are used by the @code{[[} compound command +and the @code{test} and @code{[} builtin commands. + +Expressions may be unary or binary. +Unary expressions are often used to examine the status of a file. +There are string operators and numeric comparison operators as well. +If the @var{file} argument to one of the primaries is of the form +@file{/dev/fd/@var{N}}, then file descriptor @var{N} is checked. +If the @var{file} argument to one of the primaries is one of +@file{/dev/stdin}, @file{/dev/stdout}, or @file{/dev/stderr}, file +descriptor 0, 1, or 2, respectively, is checked. + +When used with @code{[[}, the @samp{<} and @samp{>} operators sort +lexicographically using the current locale. +The @code{test} command uses ASCII ordering. + +Unless otherwise specified, primaries that operate on files follow symbolic +links and operate on the target of the link, rather than the link itself. + +See the description of the @code{test} builtin command (section +@pxref{Bash Builtins} below) for the handling of parameters +(i.e. missing parameters). + +@table @code +@item -a @var{file} +True if @var{file} exists. + +@item -b @var{file} +True if @var{file} exists and is a block special file. + +@item -c @var{file} +True if @var{file} exists and is a character special file. + +@item -d @var{file} +True if @var{file} exists and is a directory. + +@item -e @var{file} +True if @var{file} exists. + +@item -f @var{file} +True if @var{file} exists and is a regular file. + +@item -g @var{file} +True if @var{file} exists and its set-group-id bit is set. + +@item -h @var{file} +True if @var{file} exists and is a symbolic link. + +@item -k @var{file} +True if @var{file} exists and its "sticky" bit is set. + +@item -p @var{file} +True if @var{file} exists and is a named pipe (FIFO). + +@item -r @var{file} +True if @var{file} exists and is readable. + +@item -s @var{file} +True if @var{file} exists and has a size greater than zero. + +@item -t @var{fd} +True if file descriptor @var{fd} is open and refers to a terminal. + +@item -u @var{file} +True if @var{file} exists and its set-user-id bit is set. + +@item -w @var{file} +True if @var{file} exists and is writable. + +@item -x @var{file} +True if @var{file} exists and is executable. + +@item -G @var{file} +True if @var{file} exists and is owned by the effective group id. + +@item -L @var{file} +True if @var{file} exists and is a symbolic link. + +@item -N @var{file} +True if @var{file} exists and has been modified since it was last read. + +@item -O @var{file} +True if @var{file} exists and is owned by the effective user id. + +@item -S @var{file} +True if @var{file} exists and is a socket. + +@item @var{file1} -ef @var{file2} +True if @var{file1} and @var{file2} refer to the same device and +inode numbers. + +@item @var{file1} -nt @var{file2} +True if @var{file1} is newer (according to modification date) +than @var{file2}, or if @var{file1} exists and @var{file2} does not. + +@item @var{file1} -ot @var{file2} +True if @var{file1} is older than @var{file2}, +or if @var{file2} exists and @var{file1} does not. + +@item -o @var{optname} +True if the shell option @var{optname} is enabled. +The list of options appears in the description of the @option{-o} +option to the @code{set} builtin (@pxref{The Set Builtin}). + +@item -v @var{varname} +True if the shell variable @var{varname} is set (has been assigned a value). + +@item -R @var{varname} +True if the shell variable @var{varname} is set and is a name reference. + +@item -z @var{string} +True if the length of @var{string} is zero. + +@item -n @var{string} +@itemx @var{string} +True if the length of @var{string} is non-zero. + +@item @var{string1} == @var{string2} +@itemx @var{string1} = @var{string2} +True if the strings are equal. +When used with the @code{[[} command, this performs pattern matching as +described above (@pxref{Conditional Constructs}). + +@samp{=} should be used with the @code{test} command for @sc{posix} conformance. + +@item @var{string1} != @var{string2} +True if the strings are not equal. + +@item @var{string1} < @var{string2} +True if @var{string1} sorts before @var{string2} lexicographically. + +@item @var{string1} > @var{string2} +True if @var{string1} sorts after @var{string2} lexicographically. + +@item @var{arg1} OP @var{arg2} +@code{OP} is one of +@samp{-eq}, @samp{-ne}, @samp{-lt}, @samp{-le}, @samp{-gt}, or @samp{-ge}. +These arithmetic binary operators return true if @var{arg1} +is equal to, not equal to, less than, less than or equal to, +greater than, or greater than or equal to @var{arg2}, +respectively. @var{Arg1} and @var{arg2} +may be positive or negative integers. +@end table + +@node Shell Arithmetic +@section Shell Arithmetic +@cindex arithmetic, shell +@cindex shell arithmetic +@cindex expressions, arithmetic +@cindex evaluation, arithmetic +@cindex arithmetic evaluation + +The shell allows arithmetic expressions to be evaluated, as one of +the shell expansions or by the @code{let} and the @option{-i} option +to the @code{declare} builtins. + +Evaluation is done in fixed-width integers with no check for overflow, +though division by 0 is trapped and flagged as an error. +The operators and their precedence, associativity, and values +are the same as in the C language. +The following list of operators is grouped into levels of +equal-precedence operators. +The levels are listed in order of decreasing precedence. + +@table @code + +@item @var{id}++ @var{id}-- +variable post-increment and post-decrement + +@item ++@var{id} --@var{id} +variable pre-increment and pre-decrement + +@item - + +unary minus and plus + +@item ! ~ +logical and bitwise negation + +@item ** +exponentiation + +@item * / % +multiplication, division, remainder + +@item + - +addition, subtraction + +@item << >> +left and right bitwise shifts + +@item <= >= < > +comparison + +@item == != +equality and inequality + +@item & +bitwise AND + +@item ^ +bitwise exclusive OR + +@item | +bitwise OR + +@item && +logical AND + +@item || +logical OR + +@item expr ? expr : expr +conditional operator + +@item = *= /= %= += -= <<= >>= &= ^= |= +assignment + +@item expr1 , expr2 +comma +@end table + +Shell variables are allowed as operands; parameter expansion is +performed before the expression is evaluated. +Within an expression, shell variables may also be referenced by name +without using the parameter expansion syntax. +A shell variable that is null or unset evaluates to 0 when referenced +by name without using the parameter expansion syntax. +The value of a variable is evaluated as an arithmetic expression +when it is referenced, or when a variable which has been given the +@var{integer} attribute using @samp{declare -i} is assigned a value. +A null value evaluates to 0. +A shell variable need not have its @var{integer} attribute turned on +to be used in an expression. + +Constants with a leading 0 are interpreted as octal numbers. +A leading @samp{0x} or @samp{0X} denotes hexadecimal. Otherwise, +numbers take the form [@var{base}@code{#}]@var{n}, where the optional @var{base} +is a decimal number between 2 and 64 representing the arithmetic +base, and @var{n} is a number in that base. +If @var{base}@code{#} is omitted, then base 10 is used. +When specifying @var{n}, +he digits greater than 9 are represented by the lowercase letters, +the uppercase letters, @samp{@@}, and @samp{_}, in that order. +If @var{base} is less than or equal to 36, lowercase and uppercase +letters may be used interchangeably to represent numbers between 10 +and 35. + +Operators are evaluated in order of precedence. Sub-expressions in +parentheses are evaluated first and may override the precedence +rules above. + +@node Aliases +@section Aliases +@cindex alias expansion + +@var{Aliases} allow a string to be substituted for a word when it is used +as the first word of a simple command. +The shell maintains a list of aliases that may be set and unset with +the @code{alias} and @code{unalias} builtin commands. + +The first word of each simple command, if unquoted, is checked to see +if it has an alias. +If so, that word is replaced by the text of the alias. +The characters @samp{/}, @samp{$}, @samp{`}, @samp{=} and any of the +shell metacharacters or quoting characters listed above may not appear +in an alias name. +The replacement text may contain any valid +shell input, including shell metacharacters. +The first word of the replacement text is tested for +aliases, but a word that is identical to an alias being expanded +is not expanded a second time. +This means that one may alias @code{ls} to @code{"ls -F"}, +for instance, and Bash does not try to recursively expand the +replacement text. +If the last character of the alias value is a +@var{blank}, then the next command word following the +alias is also checked for alias expansion. + +Aliases are created and listed with the @code{alias} +command, and removed with the @code{unalias} command. + +There is no mechanism for using arguments in the replacement text, +as in @code{csh}. +If arguments are needed, a shell function should be used +(@pxref{Shell Functions}). + +Aliases are not expanded when the shell is not interactive, +unless the @code{expand_aliases} shell option is set using +@code{shopt} (@pxref{The Shopt Builtin}). + +The rules concerning the definition and use of aliases are +somewhat confusing. Bash +always reads at least one complete line +of input before executing any +of the commands on that line. Aliases are expanded when a +command is read, not when it is executed. Therefore, an +alias definition appearing on the same line as another +command does not take effect until the next line of input is read. +The commands following the alias definition +on that line are not affected by the new alias. +This behavior is also an issue when functions are executed. +Aliases are expanded when a function definition is read, +not when the function is executed, because a function definition +is itself a compound command. As a consequence, aliases +defined in a function are not available until after that +function is executed. To be safe, always put +alias definitions on a separate line, and do not use @code{alias} +in compound commands. + +For almost every purpose, shell functions are preferred over aliases. + +@node Arrays +@section Arrays +@cindex arrays + +Bash provides one-dimensional indexed and associative array variables. +Any variable may be used as an indexed array; +the @code{declare} builtin will explicitly declare an array. +There is no maximum +limit on the size of an array, nor any requirement that members +be indexed or assigned contiguously. +Indexed arrays are referenced using integers (including arithmetic +expressions (@pxref{Shell Arithmetic})) and are zero-based; +associative arrays use arbitrary strings. +Unless otherwise noted, indexed array indices must be non-negative integers. + +An indexed array is created automatically if any variable is assigned to +using the syntax +@example +@var{name}[@var{subscript}]=@var{value} +@end example + +@noindent +The @var{subscript} +is treated as an arithmetic expression that must evaluate to a number. +To explicitly declare an array, use +@example +declare -a @var{name} +@end example +@noindent +The syntax +@example +declare -a @var{name}[@var{subscript}] +@end example +@noindent +is also accepted; the @var{subscript} is ignored. + +@noindent +Associative arrays are created using +@example +declare -A @var{name}. +@end example + +Attributes may be +specified for an array variable using the @code{declare} and +@code{readonly} builtins. Each attribute applies to all members of +an array. + +Arrays are assigned to using compound assignments of the form +@example +@var{name}=(@var{value1} @var{value2} @dots{} ) +@end example +@noindent +where each +@var{value} is of the form @code{[@var{subscript}]=}@var{string}. +Indexed array assignments do not require anything but @var{string}. +When assigning to indexed arrays, if +the optional subscript is supplied, that index is assigned to; +otherwise the index of the element assigned is the last index assigned +to by the statement plus one. Indexing starts at zero. + +When assigning to an associative array, the subscript is required. + +This syntax is also accepted by the @code{declare} +builtin. Individual array elements may be assigned to using the +@code{@var{name}[@var{subscript}]=@var{value}} syntax introduced above. + +When assigning to an indexed array, if @var{name} +is subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +@var{name}, so negative indices count back from the end of the +array, and an index of -1 references the last element. + +Any element of an array may be referenced using +@code{$@{@var{name}[@var{subscript}]@}}. +The braces are required to avoid +conflicts with the shell's filename expansion operators. If the +@var{subscript} is @samp{@@} or @samp{*}, the word expands to all members +of the array @var{name}. These subscripts differ only when the word +appears within double quotes. +If the word is double-quoted, +@code{$@{@var{name}[*]@}} expands to a single word with +the value of each array member separated by the first character of the +@env{IFS} variable, and @code{$@{@var{name}[@@]@}} expands each element of +@var{name} to a separate word. When there are no array members, +@code{$@{@var{name}[@@]@}} expands to nothing. +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +This is analogous to the +expansion of the special parameters @samp{@@} and @samp{*}. +@code{$@{#@var{name}[@var{subscript}]@}} expands to the length of +@code{$@{@var{name}[@var{subscript}]@}}. +If @var{subscript} is @samp{@@} or +@samp{*}, the expansion is the number of elements in the array. +Referencing an array variable without a subscript is equivalent to +referencing with a subscript of 0. +If the @var{subscript} +used to reference an element of an indexed array +evaluates to a number less than zero, it is +interpreted as relative to one greater than the maximum index of the array, +so negative indices count back from the end of the array, +and an index of -1 refers to the last element. + +An array variable is considered set if a subscript has been assigned a +value. The null string is a valid value. + +It is possible to obtain the keys (indices) of an array as well as the values. +$@{!@var{name}[@@]@} and $@{!@var{name}[*]@} expand to the indices +assigned in array variable @var{name}. +The treatment when in double quotes is similar to the expansion of the +special parameters @samp{@@} and @samp{*} within double quotes. + +The @code{unset} builtin is used to destroy arrays. +@code{unset @var{name}[@var{subscript}]} +destroys the array element at index @var{subscript}. +Negative subscripts to indexed arrays are interpreted as described above. +Care must be taken to avoid unwanted side effects caused by filename +expansion. +@code{unset @var{name}}, where @var{name} is an array, removes the +entire array. A subscript of @samp{*} or @samp{@@} also removes the +entire array. + +The @code{declare}, @code{local}, and @code{readonly} +builtins each accept a @option{-a} option to specify an indexed +array and a @option{-A} option to specify an associative array. +If both options are supplied, @option{-A} takes precedence. +The @code{read} builtin accepts a @option{-a} +option to assign a list of words read from the standard input +to an array, and can read values from the standard input into +individual array elements. The @code{set} and @code{declare} +builtins display array values in a way that allows them to be +reused as input. + +@node The Directory Stack +@section The Directory Stack +@cindex directory stack + +@menu +* Directory Stack Builtins:: Bash builtin commands to manipulate + the directory stack. +@end menu + +The directory stack is a list of recently-visited directories. The +@code{pushd} builtin adds directories to the stack as it changes +the current directory, and the @code{popd} builtin removes specified +directories from the stack and changes the current directory to +the directory removed. The @code{dirs} builtin displays the contents +of the directory stack. + +The contents of the directory stack are also visible +as the value of the @env{DIRSTACK} shell variable. + +@node Directory Stack Builtins +@subsection Directory Stack Builtins + +@table @code + +@item dirs +@btindex dirs +@example +dirs [-clpv] [+@var{N} | -@var{N}] +@end example + +Display the list of currently remembered directories. Directories +are added to the list with the @code{pushd} command; the +@code{popd} command removes directories from the list. + +@table @code +@item -c +Clears the directory stack by deleting all of the elements. +@item -l +Produces a listing using full pathnames; +the default listing format uses a tilde to denote the home directory. +@item -p +Causes @code{dirs} to print the directory stack with one entry per +line. +@item -v +Causes @code{dirs} to print the directory stack with one entry per +line, prefixing each entry with its index in the stack. +@item +@var{N} +Displays the @var{N}th directory (counting from the left of the +list printed by @code{dirs} when invoked without options), starting +with zero. +@item -@var{N} +Displays the @var{N}th directory (counting from the right of the +list printed by @code{dirs} when invoked without options), starting +with zero. +@end table + +@item popd +@btindex popd +@example +popd [-n] [+@var{N} | -@var{N}] +@end example + +Remove the top entry from the directory stack, and @code{cd} +to the new top directory. +When no arguments are given, @code{popd} +removes the top directory from the stack and +performs a @code{cd} to the new top directory. The +elements are numbered from 0 starting at the first directory listed with +@code{dirs}; that is, @code{popd} is equivalent to @code{popd +0}. + +@table @code +@item -n +Suppresses the normal change of directory when removing directories +from the stack, so that only the stack is manipulated. +@item +@var{N} +Removes the @var{N}th directory (counting from the left of the +list printed by @code{dirs}), starting with zero. +@item -@var{N} +Removes the @var{N}th directory (counting from the right of the +list printed by @code{dirs}), starting with zero. +@end table + +@btindex pushd +@item pushd +@example +pushd [-n] [@var{+N} | @var{-N} | @var{dir}] +@end example + +Save the current directory on the top of the directory stack +and then @code{cd} to @var{dir}. +With no arguments, @code{pushd} exchanges the top two directories. + +@table @code +@item -n +Suppresses the normal change of directory when adding directories +to the stack, so that only the stack is manipulated. +@item +@var{N} +Brings the @var{N}th directory (counting from the left of the +list printed by @code{dirs}, starting with zero) to the top of +the list by rotating the stack. +@item -@var{N} +Brings the @var{N}th directory (counting from the right of the +list printed by @code{dirs}, starting with zero) to the top of +the list by rotating the stack. +@item @var{dir} +Makes the current working directory be the top of the stack, making +it the new current directory as if it had been supplied as an argument +to the @code{cd} builtin. +@end table +@end table + +@node Controlling the Prompt +@section Controlling the Prompt +@cindex prompting + +The value of the variable @env{PROMPT_COMMAND} is examined just before +Bash prints each primary prompt. If @env{PROMPT_COMMAND} is set and +has a non-null value, then the +value is executed just as if it had been typed on the command line. + +In addition, the following table describes the special characters which +can appear in the prompt variables @env{PS1} to @env{PS4}: + +@table @code +@item \a +A bell character. +@item \d +The date, in "Weekday Month Date" format (e.g., "Tue May 26"). +@item \D@{@var{format}@} +The @var{format} is passed to @code{strftime}(3) and the result is inserted +into the prompt string; an empty @var{format} results in a locale-specific +time representation. The braces are required. +@item \e +An escape character. +@item \h +The hostname, up to the first `.'. +@item \H +The hostname. +@item \j +The number of jobs currently managed by the shell. +@item \l +The basename of the shell's terminal device name. +@item \n +A newline. +@item \r +A carriage return. +@item \s +The name of the shell, the basename of @code{$0} (the portion +following the final slash). +@item \t +The time, in 24-hour HH:MM:SS format. +@item \T +The time, in 12-hour HH:MM:SS format. +@item \@@ +The time, in 12-hour am/pm format. +@item \A +The time, in 24-hour HH:MM format. +@item \u +The username of the current user. +@item \v +The version of Bash (e.g., 2.00) +@item \V +The release of Bash, version + patchlevel (e.g., 2.00.0) +@item \w +The current working directory, with @env{$HOME} abbreviated with a tilde +(uses the @env{$PROMPT_DIRTRIM} variable). +@item \W +The basename of @env{$PWD}, with @env{$HOME} abbreviated with a tilde. +@item \! +The history number of this command. +@item \# +The command number of this command. +@item \$ +If the effective uid is 0, @code{#}, otherwise @code{$}. +@item \@var{nnn} +The character whose ASCII code is the octal value @var{nnn}. +@item \\ +A backslash. +@item \[ +Begin a sequence of non-printing characters. This could be used to +embed a terminal control sequence into the prompt. +@item \] +End a sequence of non-printing characters. +@end table + +The command number and the history number are usually different: +the history number of a command is its position in the history +list, which may include commands restored from the history file +(@pxref{Bash History Facilities}), while the command number is +the position in the sequence of commands executed during the current +shell session. + +After the string is decoded, it is expanded via +parameter expansion, command substitution, arithmetic +expansion, and quote removal, subject to the value of the +@code{promptvars} shell option (@pxref{Bash Builtins}). + +@node The Restricted Shell +@section The Restricted Shell +@cindex restricted shell + +If Bash is started with the name @code{rbash}, or the +@option{--restricted} +or +@option{-r} +option is supplied at invocation, the shell becomes restricted. +A restricted shell is used to +set up an environment more controlled than the standard shell. +A restricted shell behaves identically to @code{bash} +with the exception that the following are disallowed or not performed: + +@itemize @bullet +@item +Changing directories with the @code{cd} builtin. +@item +Setting or unsetting the values of the @env{SHELL}, @env{PATH}, +@env{ENV}, or @env{BASH_ENV} variables. +@item +Specifying command names containing slashes. +@item +Specifying a filename containing a slash as an argument to the @code{.} +builtin command. +@item +Specifying a filename containing a slash as an argument to the @option{-p} +option to the @code{hash} builtin command. +@item +Importing function definitions from the shell environment at startup. +@item +Parsing the value of @env{SHELLOPTS} from the shell environment at startup. +@item +Redirecting output using the @samp{>}, @samp{>|}, @samp{<>}, @samp{>&}, +@samp{&>}, and @samp{>>} redirection operators. +@item +Using the @code{exec} builtin to replace the shell with another command. +@item +Adding or deleting builtin commands with the +@option{-f} and @option{-d} options to the @code{enable} builtin. +@item +Using the @code{enable} builtin command to enable disabled shell builtins. +@item +Specifying the @option{-p} option to the @code{command} builtin. +@item +Turning off restricted mode with @samp{set +r} or @samp{set +o restricted}. +@end itemize + +These restrictions are enforced after any startup files are read. + +When a command that is found to be a shell script is executed +(@pxref{Shell Scripts}), @code{rbash} turns off any restrictions in +the shell spawned to execute the script. + +@node Bash POSIX Mode +@section Bash POSIX Mode +@cindex POSIX Mode + +Starting Bash with the @option{--posix} command-line option or executing +@samp{set -o posix} while Bash is running will cause Bash to conform more +closely to the @sc{posix} standard by changing the behavior to +match that specified by @sc{posix} in areas where the Bash default differs. + +When invoked as @code{sh}, Bash enters @sc{posix} mode after reading the +startup files. + +The following list is what's changed when `@sc{posix} mode' is in effect: + +@enumerate +@item +When a command in the hash table no longer exists, Bash will re-search +@env{$PATH} to find the new location. This is also available with +@samp{shopt -s checkhash}. + +@item +The message printed by the job control code and builtins when a job +exits with a non-zero status is `Done(status)'. + +@item +The message printed by the job control code and builtins when a job +is stopped is `Stopped(@var{signame})', where @var{signame} is, for +example, @code{SIGTSTP}. + +@item +The @code{bg} builtin uses the required format to describe each job placed +in the background, which does not include an indication of whether the job +is the current or previous job. + +@item +Reserved words appearing in a context where reserved words are recognized +do not undergo alias expansion. + +@item +The @sc{posix} @env{PS1} and @env{PS2} expansions of @samp{!} to +the history number and @samp{!!} to @samp{!} are enabled, +and parameter expansion is performed on the values of @env{PS1} and +@env{PS2} regardless of the setting of the @code{promptvars} option. + +@item +The @sc{posix} startup files are executed (@env{$ENV}) rather than +the normal Bash files. + +@item +Tilde expansion is only performed on assignments preceding a command +name, rather than on all assignment statements on the line. + +@item +The @code{command} builtin does not prevent builtins that take assignment +statements as arguments from expanding them as assignment statements; +when not in @sc{posix} mode, assignment builtins lose their assignment +statement expansion properties when preceded by @code{command}. + +@item +The default history file is @file{~/.sh_history} (this is the +default value of @env{$HISTFILE}). + +@item +The output of @samp{kill -l} prints all the signal names on a single line, +separated by spaces, without the @samp{SIG} prefix. + +@item +The @code{kill} builtin does not accept signal names with a @samp{SIG} +prefix. + +@item +Non-interactive shells exit if @var{filename} in @code{.} @var{filename} +is not found. + +@item +Non-interactive shells exit if a syntax error in an arithmetic expansion +results in an invalid expression. + +@item +Non-interactive shells exit if there is a syntax error in a script read +with the @code{.} or @code{source} builtins, or in a string processed by +the @code{eval} builtin. + +@item +Redirection operators do not perform filename expansion on the word +in the redirection unless the shell is interactive. + +@item +Redirection operators do not perform word splitting on the word in the +redirection. + +@item +Function names must be valid shell @code{name}s. That is, they may not +contain characters other than letters, digits, and underscores, and +may not start with a digit. Declaring a function with an invalid name +causes a fatal syntax error in non-interactive shells. + +@item +Function names may not be the same as one of the @sc{posix} special +builtins. + +@item +@sc{posix} special builtins are found before shell functions +during command lookup. + +@item +The @code{time} reserved word may be used by itself as a command. When +used in this way, it displays timing statistics for the shell and its +completed children. The @env{TIMEFORMAT} variable controls the format +of the timing information. + +@item +When parsing and expanding a $@{@dots{}@} expansion that appears within +double quotes, single quotes are no longer special and cannot be used to +quote a closing brace or other special character, unless the operator is +one of those defined to perform pattern removal. In this case, they do +not have to appear as matched pairs. + +@item +The parser does not recognize @code{time} as a reserved word if the next +token begins with a @samp{-}. + +@item +If a @sc{posix} special builtin returns an error status, a +non-interactive shell exits. The fatal errors are those listed in +the @sc{posix} standard, and include things like passing incorrect options, +redirection errors, variable assignment errors for assignments preceding +the command name, and so on. + +@item +A non-interactive shell exits with an error status if a variable +assignment error occurs when no command name follows the assignment +statements. +A variable assignment error occurs, for example, when trying to assign +a value to a readonly variable. + +@item +A non-interactive shell exits with an error status if a variable +assignment error occurs in an assignment statement preceding a special +builtin, but not with any other simple command. + +@item +A non-interactive shell exits with an error status if the iteration +variable in a @code{for} statement or the selection variable in a +@code{select} statement is a readonly variable. + +@item +Process substitution is not available. + +@item +While variable indirection is available, it may not be applied to the +@samp{#} and @samp{?} special parameters. + +@item +Assignment statements preceding @sc{posix} special builtins +persist in the shell environment after the builtin completes. + +@item +Assignment statements preceding shell function calls persist in the +shell environment after the function returns, as if a @sc{posix} +special builtin command had been executed. + +@item +The @code{export} and @code{readonly} builtin commands display their +output in the format required by @sc{posix}. + +@item +The @code{trap} builtin displays signal names without the leading +@code{SIG}. + +@item +The @code{trap} builtin doesn't check the first argument for a possible +signal specification and revert the signal handling to the original +disposition if it is, unless that argument consists solely of digits and +is a valid signal number. If users want to reset the handler for a given +signal to the original disposition, they should use @samp{-} as the +first argument. + +@item +The @code{.} and @code{source} builtins do not search the current directory +for the filename argument if it is not found by searching @env{PATH}. + +@item +Subshells spawned to execute command substitutions inherit the value of +the @option{-e} option from the parent shell. When not in @sc{posix} mode, +Bash clears the @option{-e} option in such subshells. + +@item +Alias expansion is always enabled, even in non-interactive shells. + +@item +When the @code{alias} builtin displays alias definitions, it does not +display them with a leading @samp{alias } unless the @option{-p} option +is supplied. + +@item +When the @code{set} builtin is invoked without options, it does not display +shell function names and definitions. + +@item +When the @code{set} builtin is invoked without options, it displays +variable values without quotes, unless they contain shell metacharacters, +even if the result contains nonprinting characters. + +@item +When the @code{cd} builtin is invoked in @var{logical} mode, and the pathname +constructed from @code{$PWD} and the directory name supplied as an argument +does not refer to an existing directory, @code{cd} will fail instead of +falling back to @var{physical} mode. + +@item +The @code{pwd} builtin verifies that the value it prints is the same as the +current directory, even if it is not asked to check the file system with the +@option{-P} option. + +@item +When listing the history, the @code{fc} builtin does not include an +indication of whether or not a history entry has been modified. + +@item +The default editor used by @code{fc} is @code{ed}. + +@item +The @code{type} and @code{command} builtins will not report a non-executable +file as having been found, though the shell will attempt to execute such a +file if it is the only so-named file found in @code{$PATH}. + +@item +The @code{vi} editing mode will invoke the @code{vi} editor directly when +the @samp{v} command is run, instead of checking @code{$VISUAL} and +@code{$EDITOR}. + +@item +When the @code{xpg_echo} option is enabled, Bash does not attempt to interpret +any arguments to @code{echo} as options. Each argument is displayed, after +escape characters are converted. + +@item +The @code{ulimit} builtin uses a block size of 512 bytes for the @option{-c} +and @option{-f} options. + +@item +The arrival of @code{SIGCHLD} when a trap is set on @code{SIGCHLD} does +not interrupt the @code{wait} builtin and cause it to return immediately. +The trap command is run once for each child that exits. + +@item +The @code{read} builtin may be interrupted by a signal for which a trap +has been set. +If Bash receives a trapped signal while executing @code{read}, the trap +handler executes and @code{read} returns an exit status greater than 128. + +@end enumerate + +There is other @sc{posix} behavior that Bash does not implement by +default even when in @sc{posix} mode. +Specifically: + +@enumerate + +@item +The @code{fc} builtin checks @code{$EDITOR} as a program to edit history +entries if @code{FCEDIT} is unset, rather than defaulting directly to +@code{ed}. @code{fc} uses @code{ed} if @code{EDITOR} is unset. + +@item +As noted above, Bash requires the @code{xpg_echo} option to be enabled for +the @code{echo} builtin to be fully conformant. + +@end enumerate + +Bash can be configured to be @sc{posix}-conformant by default, by specifying +the @option{--enable-strict-posix-default} to @code{configure} when building +(@pxref{Optional Features}). + +@node Job Control +@chapter Job Control + +This chapter discusses what job control is, how it works, and how +Bash allows you to access its facilities. + +@menu +* Job Control Basics:: How job control works. +* Job Control Builtins:: Bash builtin commands used to interact + with job control. +* Job Control Variables:: Variables Bash uses to customize job + control. +@end menu + +@node Job Control Basics +@section Job Control Basics +@cindex job control +@cindex foreground +@cindex background +@cindex suspending jobs + +Job control +refers to the ability to selectively stop (suspend) +the execution of processes and continue (resume) +their execution at a later point. A user typically employs +this facility via an interactive interface supplied jointly +by the operating system kernel's terminal driver and Bash. + +The shell associates a @var{job} with each pipeline. It keeps a +table of currently executing jobs, which may be listed with the +@code{jobs} command. When Bash starts a job +asynchronously, it prints a line that looks +like: +@example +[1] 25647 +@end example +@noindent +indicating that this job is job number 1 and that the process @sc{id} +of the last process in the pipeline associated with this job is +25647. All of the processes in a single pipeline are members of +the same job. Bash uses the @var{job} abstraction as the +basis for job control. + +To facilitate the implementation of the user interface to job +control, the operating system maintains the notion of a current terminal +process group @sc{id}. Members of this process group (processes whose +process group @sc{id} is equal to the current terminal process group +@sc{id}) receive keyboard-generated signals such as @code{SIGINT}. +These processes are said to be in the foreground. Background +processes are those whose process group @sc{id} differs from the +terminal's; such processes are immune to keyboard-generated +signals. Only foreground processes are allowed to read from or, if +the user so specifies with @code{stty tostop}, write to the terminal. +Background processes which attempt to +read from (write to when @code{stty tostop} is in effect) the +terminal are sent a @code{SIGTTIN} (@code{SIGTTOU}) +signal by the kernel's terminal driver, +which, unless caught, suspends the process. + +If the operating system on which Bash is running supports +job control, Bash contains facilities to use it. Typing the +@var{suspend} character (typically @samp{^Z}, Control-Z) while a +process is running causes that process to be stopped and returns +control to Bash. Typing the @var{delayed suspend} character +(typically @samp{^Y}, Control-Y) causes the process to be stopped +when it attempts to read input from the terminal, and control to +be returned to Bash. The user then manipulates the state of +this job, using the @code{bg} command to continue it in the +background, the @code{fg} command to continue it in the +foreground, or the @code{kill} command to kill it. A @samp{^Z} +takes effect immediately, and has the additional side effect of +causing pending output and typeahead to be discarded. + +There are a number of ways to refer to a job in the shell. The +character @samp{%} introduces a job specification (@var{jobspec}). + +Job number @code{n} may be referred to as @samp{%n}. +The symbols @samp{%%} and @samp{%+} refer to the shell's notion of the +current job, which is the last job stopped while it was in the foreground +or started in the background. +A single @samp{%} (with no accompanying job specification) also refers +to the current job. +The previous job may be referenced using @samp{%-}. +If there is only a single job, @samp{%+} and @samp{%-} can both be used +to refer to that job. +In output pertaining to jobs (e.g., the output of the @code{jobs} +command), the current job is always flagged with a @samp{+}, and the +previous job with a @samp{-}. + +A job may also be referred to +using a prefix of the name used to start it, or using a substring +that appears in its command line. For example, @samp{%ce} refers +to a stopped @code{ce} job. Using @samp{%?ce}, on the +other hand, refers to any job containing the string @samp{ce} in +its command line. If the prefix or substring matches more than one job, +Bash reports an error. + +Simply naming a job can be used to bring it into the foreground: +@samp{%1} is a synonym for @samp{fg %1}, bringing job 1 from the +background into the foreground. Similarly, @samp{%1 &} resumes +job 1 in the background, equivalent to @samp{bg %1} + +The shell learns immediately whenever a job changes state. +Normally, Bash waits until it is about to print a prompt +before reporting changes in a job's status so as to not interrupt +any other output. +If the @option{-b} option to the @code{set} builtin is enabled, +Bash reports such changes immediately (@pxref{The Set Builtin}). +Any trap on @code{SIGCHLD} is executed for each child process +that exits. + +If an attempt to exit Bash is made while jobs are stopped, (or running, if +the @code{checkjobs} option is enabled -- see @ref{The Shopt Builtin}), the +shell prints a warning message, and if the @code{checkjobs} option is +enabled, lists the jobs and their statuses. +The @code{jobs} command may then be used to inspect their status. +If a second attempt to exit is made without an intervening command, +Bash does not print another warning, and any stopped jobs are terminated. + +@node Job Control Builtins +@section Job Control Builtins + +@table @code + +@item bg +@btindex bg +@example +bg [@var{jobspec} @dots{}] +@end example + +Resume each suspended job @var{jobspec} in the background, as if it +had been started with @samp{&}. +If @var{jobspec} is not supplied, the current job is used. +The return status is zero unless it is run when job control is not +enabled, or, when run with job control enabled, any +@var{jobspec} was not found or specifies a job +that was started without job control. + +@item fg +@btindex fg +@example +fg [@var{jobspec}] +@end example + +Resume the job @var{jobspec} in the foreground and make it the current job. +If @var{jobspec} is not supplied, the current job is used. +The return status is that of the command placed into the foreground, +or non-zero if run when job control is disabled or, when run with +job control enabled, @var{jobspec} does not specify a valid job or +@var{jobspec} specifies a job that was started without job control. + +@item jobs +@btindex jobs +@example +jobs [-lnprs] [@var{jobspec}] +jobs -x @var{command} [@var{arguments}] +@end example + +The first form lists the active jobs. The options have the +following meanings: + +@table @code +@item -l +List process @sc{id}s in addition to the normal information. + +@item -n +Display information only about jobs that have changed status since +the user was last notified of their status. + +@item -p +List only the process @sc{id} of the job's process group leader. + +@item -r +Display only running jobs. + +@item -s +Display only stopped jobs. +@end table + +If @var{jobspec} is given, +output is restricted to information about that job. +If @var{jobspec} is not supplied, the status of all jobs is +listed. + +If the @option{-x} option is supplied, @code{jobs} replaces any +@var{jobspec} found in @var{command} or @var{arguments} with the +corresponding process group @sc{id}, and executes @var{command}, +passing it @var{argument}s, returning its exit status. + +@item kill +@btindex kill +@example +kill [-s @var{sigspec}] [-n @var{signum}] [-@var{sigspec}] @var{jobspec} or @var{pid} +kill -l [@var{exit_status}] +@end example + +Send a signal specified by @var{sigspec} or @var{signum} to the process +named by job specification @var{jobspec} or process @sc{id} @var{pid}. +@var{sigspec} is either a case-insensitive signal name such as +@code{SIGINT} (with or without the @code{SIG} prefix) +or a signal number; @var{signum} is a signal number. +If @var{sigspec} and @var{signum} are not present, @code{SIGTERM} is used. +The @option{-l} option lists the signal names. +If any arguments are supplied when @option{-l} is given, the names of the +signals corresponding to the arguments are listed, and the return status +is zero. +@var{exit_status} is a number specifying a signal number or the exit +status of a process terminated by a signal. +The return status is zero if at least one signal was successfully sent, +or non-zero if an error occurs or an invalid option is encountered. + +@item wait +@btindex wait +@example +wait [-n] [@var{jobspec} or @var{pid} @dots{}] +@end example + +Wait until the child process specified by each process @sc{id} @var{pid} +or job specification @var{jobspec} exits and return the exit status of the +last command waited for. +If a job spec is given, all processes in the job are waited for. +If no arguments are given, all currently active child processes are +waited for, and the return status is zero. +If the @option{-n} option is supplied, @code{wait} waits for any job to +terminate and returns its exit status. +If neither @var{jobspec} nor @var{pid} specifies an active child process +of the shell, the return status is 127. + +@item disown +@btindex disown +@example +disown [-ar] [-h] [@var{jobspec} @dots{}] +@end example + +Without options, remove each @var{jobspec} from the table of +active jobs. +If the @option{-h} option is given, the job is not removed from the table, +but is marked so that @code{SIGHUP} is not sent to the job if the shell +receives a @code{SIGHUP}. +If @var{jobspec} is not present, and neither the @option{-a} nor the +@option{-r} option is supplied, the current job is used. +If no @var{jobspec} is supplied, the @option{-a} option means to remove or +mark all jobs; the @option{-r} option without a @var{jobspec} +argument restricts operation to running jobs. + +@item suspend +@btindex suspend +@example +suspend [-f] +@end example + +Suspend the execution of this shell until it receives a +@code{SIGCONT} signal. +A login shell cannot be suspended; the @option{-f} +option can be used to override this and force the suspension. +@end table + +When job control is not active, the @code{kill} and @code{wait} +builtins do not accept @var{jobspec} arguments. They must be +supplied process @sc{id}s. + +@node Job Control Variables +@section Job Control Variables + +@vtable @code + +@item auto_resume +This variable controls how the shell interacts with the user and +job control. If this variable exists then single word simple +commands without redirections are treated as candidates for resumption +of an existing job. There is no ambiguity allowed; if there is +more than one job beginning with the string typed, then +the most recently accessed job will be selected. +The name of a stopped job, in this context, is the command line +used to start it. If this variable is set to the value @samp{exact}, +the string supplied must match the name of a stopped job exactly; +if set to @samp{substring}, +the string supplied needs to match a substring of the name of a +stopped job. The @samp{substring} value provides functionality +analogous to the @samp{%?} job @sc{id} (@pxref{Job Control Basics}). +If set to any other value, the supplied string must +be a prefix of a stopped job's name; this provides functionality +analogous to the @samp{%} job @sc{id}. + +@end vtable + +@set readline-appendix +@set history-appendix +@cindex Readline, how to use +@include rluser.texi +@cindex History, how to use +@include hsuser.texi +@clear readline-appendix +@clear history-appendix + +@node Installing Bash +@chapter Installing Bash + +This chapter provides basic instructions for installing Bash on +the various supported platforms. The distribution supports the +@sc{gnu} operating systems, nearly every version of Unix, and several +non-Unix systems such as BeOS and Interix. +Other independent ports exist for +@sc{ms-dos}, @sc{os/2}, and Windows platforms. + +@menu +* Basic Installation:: Installation instructions. +* Compilers and Options:: How to set special options for various + systems. +* Compiling For Multiple Architectures:: How to compile Bash for more + than one kind of system from + the same source tree. +* Installation Names:: How to set the various paths used by the installation. +* Specifying the System Type:: How to configure Bash for a particular system. +* Sharing Defaults:: How to share default configuration values among GNU + programs. +* Operation Controls:: Options recognized by the configuration program. +* Optional Features:: How to enable and disable optional features when + building Bash. +@end menu + +@node Basic Installation +@section Basic Installation +@cindex installation +@cindex configuration +@cindex Bash installation +@cindex Bash configuration + +These are installation instructions for Bash. + +The simplest way to compile Bash is: + +@enumerate +@item +@code{cd} to the directory containing the source code and type +@samp{./configure} to configure Bash for your system. If you're +using @code{csh} on an old version of System V, you might need to +type @samp{sh ./configure} instead to prevent @code{csh} from trying +to execute @code{configure} itself. + +Running @code{configure} takes some time. +While running, it prints messages telling which features it is +checking for. + +@item +Type @samp{make} to compile Bash and build the @code{bashbug} bug +reporting script. + +@item +Optionally, type @samp{make tests} to run the Bash test suite. + +@item +Type @samp{make install} to install @code{bash} and @code{bashbug}. +This will also install the manual pages and Info file. + +@end enumerate + +The @code{configure} shell script attempts to guess correct +values for various system-dependent variables used during +compilation. It uses those values to create a @file{Makefile} in +each directory of the package (the top directory, the +@file{builtins}, @file{doc}, and @file{support} directories, +each directory under @file{lib}, and several others). It also creates a +@file{config.h} file containing system-dependent definitions. +Finally, it creates a shell script named @code{config.status} that you +can run in the future to recreate the current configuration, a +file @file{config.cache} that saves the results of its tests to +speed up reconfiguring, and a file @file{config.log} containing +compiler output (useful mainly for debugging @code{configure}). +If at some point +@file{config.cache} contains results you don't want to keep, you +may remove or edit it. + +To find out more about the options and arguments that the +@code{configure} script understands, type + +@example +bash-2.04$ ./configure --help +@end example + +@noindent +at the Bash prompt in your Bash source directory. + +If you need to do unusual things to compile Bash, please +try to figure out how @code{configure} could check whether or not +to do them, and mail diffs or instructions to +@email{bash-maintainers@@gnu.org} so they can be +considered for the next release. + +The file @file{configure.ac} is used to create @code{configure} +by a program called Autoconf. You only need +@file{configure.ac} if you want to change it or regenerate +@code{configure} using a newer version of Autoconf. If +you do this, make sure you are using Autoconf version 2.50 or +newer. + +You can remove the program binaries and object files from the +source code directory by typing @samp{make clean}. To also remove the +files that @code{configure} created (so you can compile Bash for +a different kind of computer), type @samp{make distclean}. + +@node Compilers and Options +@section Compilers and Options + +Some systems require unusual options for compilation or linking +that the @code{configure} script does not know about. You can +give @code{configure} initial values for variables by setting +them in the environment. Using a Bourne-compatible shell, you +can do that on the command line like this: + +@example +CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure +@end example + +On systems that have the @code{env} program, you can do it like this: + +@example +env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure +@end example + +The configuration process uses GCC to build Bash if it +is available. + +@node Compiling For Multiple Architectures +@section Compiling For Multiple Architectures + +You can compile Bash for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of @code{make} that +supports the @code{VPATH} variable, such as GNU @code{make}. +@code{cd} to the +directory where you want the object files and executables to go and run +the @code{configure} script from the source directory. You may need to +supply the @option{--srcdir=PATH} argument to tell @code{configure} where the +source files are. @code{configure} automatically checks for the +source code in the directory that @code{configure} is in and in `..'. + +If you have to use a @code{make} that does not supports the @code{VPATH} +variable, you can compile Bash for one architecture at a +time in the source code directory. After you have installed +Bash for one architecture, use @samp{make distclean} before +reconfiguring for another architecture. + +Alternatively, if your system supports symbolic links, you can use the +@file{support/mkclone} script to create a build tree which has +symbolic links back to each file in the source directory. Here's an +example that creates a build directory in the current directory from a +source directory @file{/usr/gnu/src/bash-2.0}: + +@example +bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 . +@end example + +@noindent +The @code{mkclone} script requires Bash, so you must have already built +Bash for at least one architecture before you can create build +directories for other architectures. + +@node Installation Names +@section Installation Names + +By default, @samp{make install} will install into +@file{/usr/local/bin}, @file{/usr/local/man}, etc. You can +specify an installation prefix other than @file{/usr/local} by +giving @code{configure} the option @option{--prefix=@var{PATH}}, +or by specifying a value for the @code{DESTDIR} @samp{make} +variable when running @samp{make install}. + +You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. +If you give @code{configure} the option +@option{--exec-prefix=@var{PATH}}, @samp{make install} will use +@var{PATH} as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + +@node Specifying the System Type +@section Specifying the System Type + +There may be some features @code{configure} can not figure out +automatically, but need to determine by the type of host Bash +will run on. Usually @code{configure} can figure that +out, but if it prints a message saying it can not guess the host +type, give it the @option{--host=TYPE} option. @samp{TYPE} can +either be a short name for the system type, such as @samp{sun4}, +or a canonical name with three fields: @samp{CPU-COMPANY-SYSTEM} +(e.g., @samp{i386-unknown-freebsd4.2}). + +See the file @file{support/config.sub} for the possible +values of each field. + +@node Sharing Defaults +@section Sharing Defaults + +If you want to set default values for @code{configure} scripts to +share, you can create a site shell script called +@code{config.site} that gives default values for variables like +@code{CC}, @code{cache_file}, and @code{prefix}. @code{configure} +looks for @file{PREFIX/share/config.site} if it exists, then +@file{PREFIX/etc/config.site} if it exists. Or, you can set the +@code{CONFIG_SITE} environment variable to the location of the site +script. A warning: the Bash @code{configure} looks for a site script, +but not all @code{configure} scripts do. + +@node Operation Controls +@section Operation Controls + +@code{configure} recognizes the following options to control how it +operates. + +@table @code + +@item --cache-file=@var{file} +Use and save the results of the tests in +@var{file} instead of @file{./config.cache}. Set @var{file} to +@file{/dev/null} to disable caching, for debugging +@code{configure}. + +@item --help +Print a summary of the options to @code{configure}, and exit. + +@item --quiet +@itemx --silent +@itemx -q +Do not print messages saying which checks are being made. + +@item --srcdir=@var{dir} +Look for the Bash source code in directory @var{dir}. Usually +@code{configure} can determine that directory automatically. + +@item --version +Print the version of Autoconf used to generate the @code{configure} +script, and exit. +@end table + +@code{configure} also accepts some other, not widely used, boilerplate +options. @samp{configure --help} prints the complete list. + +@node Optional Features +@section Optional Features + +The Bash @code{configure} has a number of @option{--enable-@var{feature}} +options, where @var{feature} indicates an optional part of Bash. +There are also several @option{--with-@var{package}} options, +where @var{package} is something like @samp{bash-malloc} or @samp{purify}. +To turn off the default use of a package, use +@option{--without-@var{package}}. To configure Bash without a feature +that is enabled by default, use @option{--disable-@var{feature}}. + +Here is a complete list of the @option{--enable-} and +@option{--with-} options that the Bash @code{configure} recognizes. + +@table @code +@item --with-afs +Define if you are using the Andrew File System from Transarc. + +@item --with-bash-malloc +Use the Bash version of +@code{malloc} in the directory @file{lib/malloc}. This is not the same +@code{malloc} that appears in @sc{gnu} libc, but an older version +originally derived from the 4.2 @sc{bsd} @code{malloc}. This @code{malloc} +is very fast, but wastes some space on each allocation. +This option is enabled by default. +The @file{NOTES} file contains a list of systems for +which this should be turned off, and @code{configure} disables this +option automatically for a number of systems. + +@item --with-curses +Use the curses library instead of the termcap library. This should +be supplied if your system has an inadequate or incomplete termcap +database. + +@item --with-gnu-malloc +A synonym for @code{--with-bash-malloc}. + +@item --with-installed-readline[=@var{PREFIX}] +Define this to make Bash link with a locally-installed version of Readline +rather than the version in @file{lib/readline}. This works only with +Readline 5.0 and later versions. If @var{PREFIX} is @code{yes} or not +supplied, @code{configure} uses the values of the make variables +@code{includedir} and @code{libdir}, which are subdirectories of @code{prefix} +by default, to find the installed version of Readline if it is not in +the standard system include and library directories. +If @var{PREFIX} is @code{no}, Bash links with the version in +@file{lib/readline}. +If @var{PREFIX} is set to any other value, @code{configure} treats it as +a directory pathname and looks for +the installed version of Readline in subdirectories of that directory +(include files in @var{PREFIX}/@code{include} and the library in +@var{PREFIX}/@code{lib}). + +@item --with-purify +Define this to use the Purify memory allocation checker from Rational +Software. + +@item --enable-minimal-config +This produces a shell with minimal features, close to the historical +Bourne shell. +@end table + +There are several @option{--enable-} options that alter how Bash is +compiled and linked, rather than changing run-time features. + +@table @code +@item --enable-largefile +Enable support for @uref{http://www.sas.com/standards/large_file/x_open.20Mar96.html, +large files} if the operating system requires special compiler options +to build programs which can access large files. This is enabled by +default, if the operating system provides large file support. + +@item --enable-profiling +This builds a Bash binary that produces profiling information to be +processed by @code{gprof} each time it is executed. + +@item --enable-static-link +This causes Bash to be linked statically, if @code{gcc} is being used. +This could be used to build a version to use as root's shell. +@end table + +The @samp{minimal-config} option can be used to disable all of +the following options, but it is processed first, so individual +options may be enabled using @samp{enable-@var{feature}}. + +All of the following options except for @samp{disabled-builtins}, +@samp{directpand-default}, and +@samp{xpg-echo-default} are +enabled by default, unless the operating system does not provide the +necessary support. + +@table @code +@item --enable-alias +Allow alias expansion and include the @code{alias} and @code{unalias} +builtins (@pxref{Aliases}). + +@item --enable-arith-for-command +Include support for the alternate form of the @code{for} command +that behaves like the C language @code{for} statement +(@pxref{Looping Constructs}). + +@item --enable-array-variables +Include support for one-dimensional array shell variables +(@pxref{Arrays}). + +@item --enable-bang-history +Include support for @code{csh}-like history substitution +(@pxref{History Interaction}). + +@item --enable-brace-expansion +Include @code{csh}-like brace expansion +( @code{b@{a,b@}c} @expansion{} @code{bac bbc} ). +See @ref{Brace Expansion}, for a complete description. + +@item --enable-casemod-attributes +Include support for case-modifying attributes in the @code{declare} builtin +and assignment statements. Variables with the @var{uppercase} attribute, +for example, will have their values converted to uppercase upon assignment. + +@item --enable-casemod-expansion +Include support for case-modifying word expansions. + +@item --enable-command-timing +Include support for recognizing @code{time} as a reserved word and for +displaying timing statistics for the pipeline following @code{time} +(@pxref{Pipelines}). +This allows pipelines as well as shell builtins and functions to be timed. + +@item --enable-cond-command +Include support for the @code{[[} conditional command. +(@pxref{Conditional Constructs}). + +@item --enable-cond-regexp +Include support for matching @sc{posix} regular expressions using the +@samp{=~} binary operator in the @code{[[} conditional command. +(@pxref{Conditional Constructs}). + +@item --enable-coprocesses +Include support for coprocesses and the @code{coproc} reserved word +(@pxref{Pipelines}). + +@item --enable-debugger +Include support for the bash debugger (distributed separately). + +@item --enable-direxpand-default +Cause the @code{direxpand} shell option (@pxref{The Shopt Builtin}) +to be enabled by default when the shell starts. +It is normally disabled by default. + +@item --enable-directory-stack +Include support for a @code{csh}-like directory stack and the +@code{pushd}, @code{popd}, and @code{dirs} builtins +(@pxref{The Directory Stack}). + +@item --enable-disabled-builtins +Allow builtin commands to be invoked via @samp{builtin xxx} +even after @code{xxx} has been disabled using @samp{enable -n xxx}. +See @ref{Bash Builtins}, for details of the @code{builtin} and +@code{enable} builtin commands. + +@item --enable-dparen-arithmetic +Include support for the @code{((@dots{}))} command +(@pxref{Conditional Constructs}). + +@item --enable-extended-glob +Include support for the extended pattern matching features described +above under @ref{Pattern Matching}. + +@item --enable-extended-glob-default +Set the default value of the @var{extglob} shell option described +above under @ref{The Shopt Builtin} to be enabled. + +@item --enable-glob-asciirange-default +Set the default value of the @var{globasciiranges} shell option described +above under @ref{The Shopt Builtin} to be enabled. +This controls the behavior of character ranges when used in pattern matching +bracket expressions. + +@item --enable-help-builtin +Include the @code{help} builtin, which displays help on shell builtins and +variables (@pxref{Bash Builtins}). + +@item --enable-history +Include command history and the @code{fc} and @code{history} +builtin commands (@pxref{Bash History Facilities}). + +@item --enable-job-control +This enables the job control features (@pxref{Job Control}), +if the operating system supports them. + +@item --enable-multibyte +This enables support for multibyte characters if the operating +system provides the necessary support. + +@item --enable-net-redirections +This enables the special handling of filenames of the form +@code{/dev/tcp/@var{host}/@var{port}} and +@code{/dev/udp/@var{host}/@var{port}} +when used in redirections (@pxref{Redirections}). + +@item --enable-process-substitution +This enables process substitution (@pxref{Process Substitution}) if +the operating system provides the necessary support. + +@item --enable-progcomp +Enable the programmable completion facilities +(@pxref{Programmable Completion}). +If Readline is not enabled, this option has no effect. + +@item --enable-prompt-string-decoding +Turn on the interpretation of a number of backslash-escaped characters +in the @env{$PS1}, @env{$PS2}, @env{$PS3}, and @env{$PS4} prompt +strings. See @ref{Controlling the Prompt}, for a complete list of prompt +string escape sequences. + +@item --enable-readline +Include support for command-line editing and history with the Bash +version of the Readline library (@pxref{Command Line Editing}). + +@item --enable-restricted +Include support for a @dfn{restricted shell}. If this is enabled, Bash, +when called as @code{rbash}, enters a restricted mode. See +@ref{The Restricted Shell}, for a description of restricted mode. + +@item --enable-select +Include the @code{select} compound command, which allows the generation of +simple menus (@pxref{Conditional Constructs}). + +@item --enable-separate-helpfiles +Use external files for the documentation displayed by the @code{help} builtin +instead of storing the text internally. + +@item --enable-single-help-strings +Store the text displayed by the @code{help} builtin as a single string for +each help topic. This aids in translating the text to different languages. +You may need to disable this if your compiler cannot handle very long string +literals. + +@item --enable-strict-posix-default +Make Bash @sc{posix}-conformant by default (@pxref{Bash POSIX Mode}). + +@item --enable-usg-echo-default +A synonym for @code{--enable-xpg-echo-default}. + +@item --enable-xpg-echo-default +Make the @code{echo} builtin expand backslash-escaped characters by default, +without requiring the @option{-e} option. +This sets the default value of the @code{xpg_echo} shell option to @code{on}, +which makes the Bash @code{echo} behave more like the version specified in +the Single Unix Specification, version 3. +@xref{Bash Builtins}, for a description of the escape sequences that +@code{echo} recognizes. +@end table + +The file @file{config-top.h} contains C Preprocessor +@samp{#define} statements for options which are not settable from +@code{configure}. +Some of these are not meant to be changed; beware of the consequences if +you do. +Read the comments associated with each definition for more +information about its effect. + +@node Reporting Bugs +@appendix Reporting Bugs + +Please report all bugs you find in Bash. +But first, you should +make sure that it really is a bug, and that it appears in the latest +version of Bash. +The latest version of Bash is always available for FTP from +@uref{ftp://ftp.gnu.org/pub/gnu/bash/}. + +Once you have determined that a bug actually exists, use the +@code{bashbug} command to submit a bug report. +If you have a fix, you are encouraged to mail that as well! +Suggestions and `philosophical' bug reports may be mailed +to @email{bug-bash@@gnu.org} or posted to the Usenet +newsgroup @code{gnu.bash.bug}. + +All bug reports should include: +@itemize @bullet +@item +The version number of Bash. +@item +The hardware and operating system. +@item +The compiler used to compile Bash. +@item +A description of the bug behaviour. +@item +A short script or `recipe' which exercises the bug and may be used +to reproduce it. +@end itemize + +@noindent +@code{bashbug} inserts the first three items automatically into +the template it provides for filing a bug report. + +Please send all reports concerning this manual to +@email{bug-bash@@gnu.org}. + +@node Major Differences From The Bourne Shell +@appendix Major Differences From The Bourne Shell + +Bash implements essentially the same grammar, parameter and +variable expansion, redirection, and quoting as the Bourne Shell. +Bash uses the @sc{posix} standard as the specification of +how these features are to be implemented. There are some +differences between the traditional Bourne shell and Bash; this +section quickly details the differences of significance. A +number of these differences are explained in greater depth in +previous sections. +This section uses the version of @code{sh} included in SVR4.2 (the +last version of the historical Bourne shell) as the baseline reference. + +@itemize @bullet + +@item +Bash is @sc{posix}-conformant, even where the @sc{posix} specification +differs from traditional @code{sh} behavior (@pxref{Bash POSIX Mode}). + +@item +Bash has multi-character invocation options (@pxref{Invoking Bash}). + +@item +Bash has command-line editing (@pxref{Command Line Editing}) and +the @code{bind} builtin. + +@item +Bash provides a programmable word completion mechanism +(@pxref{Programmable Completion}), and builtin commands +@code{complete}, @code{compgen}, and @code{compopt}, to +manipulate it. + +@item +Bash has command history (@pxref{Bash History Facilities}) and the +@code{history} and @code{fc} builtins to manipulate it. +The Bash history list maintains timestamp information and uses the +value of the @code{HISTTIMEFORMAT} variable to display it. + +@item +Bash implements @code{csh}-like history expansion +(@pxref{History Interaction}). + +@item +Bash has one-dimensional array variables (@pxref{Arrays}), and the +appropriate variable expansions and assignment syntax to use them. +Several of the Bash builtins take options to act on arrays. +Bash provides a number of built-in array variables. + +@item +The @code{$'@dots{}'} quoting syntax, which expands ANSI-C +backslash-escaped characters in the text between the single quotes, +is supported (@pxref{ANSI-C Quoting}). + +@item +Bash supports the @code{$"@dots{}"} quoting syntax to do +locale-specific translation of the characters between the double +quotes. The @option{-D}, @option{--dump-strings}, and @option{--dump-po-strings} +invocation options list the translatable strings found in a script +(@pxref{Locale Translation}). + +@item +Bash implements the @code{!} keyword to negate the return value of +a pipeline (@pxref{Pipelines}). +Very useful when an @code{if} statement needs to act only if a test fails. +The Bash @samp{-o pipefail} option to @code{set} will cause a pipeline to +return a failure status if any command fails. + +@item +Bash has the @code{time} reserved word and command timing (@pxref{Pipelines}). +The display of the timing statistics may be controlled with the +@env{TIMEFORMAT} variable. + +@item +Bash implements the @code{for (( @var{expr1} ; @var{expr2} ; @var{expr3} ))} +arithmetic for command, similar to the C language (@pxref{Looping Constructs}). + +@item +Bash includes the @code{select} compound command, which allows the +generation of simple menus (@pxref{Conditional Constructs}). + +@item +Bash includes the @code{[[} compound command, which makes conditional +testing part of the shell grammar (@pxref{Conditional Constructs}), including +optional regular expression matching. + +@item +Bash provides optional case-insensitive matching for the @code{case} and +@code{[[} constructs. + +@item +Bash includes brace expansion (@pxref{Brace Expansion}) and tilde +expansion (@pxref{Tilde Expansion}). + +@item +Bash implements command aliases and the @code{alias} and @code{unalias} +builtins (@pxref{Aliases}). + +@item +Bash provides shell arithmetic, the @code{((} compound command +(@pxref{Conditional Constructs}), +and arithmetic expansion (@pxref{Shell Arithmetic}). + +@item +Variables present in the shell's initial environment are automatically +exported to child processes. The Bourne shell does not normally do +this unless the variables are explicitly marked using the @code{export} +command. + +@item +Bash supports the @samp{+=} assignment operator, which appends to the value +of the variable named on the left hand side. + +@item +Bash includes the @sc{posix} pattern removal @samp{%}, @samp{#}, @samp{%%} +and @samp{##} expansions to remove leading or trailing substrings from +variable values (@pxref{Shell Parameter Expansion}). + +@item +The expansion @code{$@{#xx@}}, which returns the length of @code{$@{xx@}}, +is supported (@pxref{Shell Parameter Expansion}). + +@item +The expansion @code{$@{var:}@var{offset}@code{[:}@var{length}@code{]@}}, +which expands to the substring of @code{var}'s value of length +@var{length}, beginning at @var{offset}, is present +(@pxref{Shell Parameter Expansion}). + +@item +The expansion +@code{$@{var/[/]}@var{pattern}@code{[/}@var{replacement}@code{]@}}, +which matches @var{pattern} and replaces it with @var{replacement} in +the value of @code{var}, is available (@pxref{Shell Parameter Expansion}). + +@item +The expansion @code{$@{!@var{prefix}*@}} expansion, which expands to +the names of all shell variables whose names begin with @var{prefix}, +is available (@pxref{Shell Parameter Expansion}). + +@item +Bash has @var{indirect} variable expansion using @code{$@{!word@}} +(@pxref{Shell Parameter Expansion}). + +@item +Bash can expand positional parameters beyond @code{$9} using +@code{$@{@var{num}@}}. + +@item +The @sc{posix} @code{$()} form of command substitution +is implemented (@pxref{Command Substitution}), +and preferred to the Bourne shell's @code{``} (which +is also implemented for backwards compatibility). + +@item +Bash has process substitution (@pxref{Process Substitution}). + +@item +Bash automatically assigns variables that provide information about the +current user (@env{UID}, @env{EUID}, and @env{GROUPS}), the current host +(@env{HOSTTYPE}, @env{OSTYPE}, @env{MACHTYPE}, and @env{HOSTNAME}), +and the instance of Bash that is running (@env{BASH}, +@env{BASH_VERSION}, and @env{BASH_VERSINFO}). @xref{Bash Variables}, +for details. + +@item +The @env{IFS} variable is used to split only the results of expansion, +not all words (@pxref{Word Splitting}). +This closes a longstanding shell security hole. + +@item +The filename expansion bracket expression code uses @samp{!} and @samp{^} +to negate the set of characters between the brackets. +The Bourne shell uses only @samp{!}. + +@item +Bash implements the full set of @sc{posix} filename expansion operators, +including @var{character classes}, @var{equivalence classes}, and +@var{collating symbols} (@pxref{Filename Expansion}). + +@item +Bash implements extended pattern matching features when the @code{extglob} +shell option is enabled (@pxref{Pattern Matching}). + +@item +It is possible to have a variable and a function with the same name; +@code{sh} does not separate the two name spaces. + +@item +Bash functions are permitted to have local variables using the +@code{local} builtin, and thus useful recursive functions may be written +(@pxref{Bash Builtins}). + +@item +Variable assignments preceding commands affect only that command, even +builtins and functions (@pxref{Environment}). +In @code{sh}, all variable assignments +preceding commands are global unless the command is executed from the +file system. + +@item +Bash performs filename expansion on filenames specified as operands +to input and output redirection operators (@pxref{Redirections}). + +@item +Bash contains the @samp{<>} redirection operator, allowing a file to be +opened for both reading and writing, and the @samp{&>} redirection +operator, for directing standard output and standard error to the same +file (@pxref{Redirections}). + +@item +Bash includes the @samp{<<<} redirection operator, allowing a string to +be used as the standard input to a command. + +@item +Bash implements the @samp{[n]<&@var{word}} and @samp{[n]>&@var{word}} +redirection operators, which move one file descriptor to another. + +@item +Bash treats a number of filenames specially when they are +used in redirection operators (@pxref{Redirections}). + +@item +Bash can open network connections to arbitrary machines and services +with the redirection operators (@pxref{Redirections}). + +@item +The @code{noclobber} option is available to avoid overwriting existing +files with output redirection (@pxref{The Set Builtin}). +The @samp{>|} redirection operator may be used to override @code{noclobber}. + +@item +The Bash @code{cd} and @code{pwd} builtins (@pxref{Bourne Shell Builtins}) +each take @option{-L} and @option{-P} options to switch between logical and +physical modes. + +@item +Bash allows a function to override a builtin with the same name, and provides +access to that builtin's functionality within the function via the +@code{builtin} and @code{command} builtins (@pxref{Bash Builtins}). + +@item +The @code{command} builtin allows selective disabling of functions +when command lookup is performed (@pxref{Bash Builtins}). + +@item +Individual builtins may be enabled or disabled using the @code{enable} +builtin (@pxref{Bash Builtins}). + +@item +The Bash @code{exec} builtin takes additional options that allow users +to control the contents of the environment passed to the executed +command, and what the zeroth argument to the command is to be +(@pxref{Bourne Shell Builtins}). + +@item +Shell functions may be exported to children via the environment +using @code{export -f} (@pxref{Shell Functions}). + +@item +The Bash @code{export}, @code{readonly}, and @code{declare} builtins can +take a @option{-f} option to act on shell functions, a @option{-p} option to +display variables with various attributes set in a format that can be +used as shell input, a @option{-n} option to remove various variable +attributes, and @samp{name=value} arguments to set variable attributes +and values simultaneously. + +@item +The Bash @code{hash} builtin allows a name to be associated with +an arbitrary filename, even when that filename cannot be found by +searching the @env{$PATH}, using @samp{hash -p} +(@pxref{Bourne Shell Builtins}). + +@item +Bash includes a @code{help} builtin for quick reference to shell +facilities (@pxref{Bash Builtins}). + +@item +The @code{printf} builtin is available to display formatted output +(@pxref{Bash Builtins}). + +@item +The Bash @code{read} builtin (@pxref{Bash Builtins}) +will read a line ending in @samp{\} with +the @option{-r} option, and will use the @env{REPLY} variable as a +default if no non-option arguments are supplied. +The Bash @code{read} builtin +also accepts a prompt string with the @option{-p} option and will use +Readline to obtain the line when given the @option{-e} option. +The @code{read} builtin also has additional options to control input: +the @option{-s} option will turn off echoing of input characters as +they are read, the @option{-t} option will allow @code{read} to time out +if input does not arrive within a specified number of seconds, the +@option{-n} option will allow reading only a specified number of +characters rather than a full line, and the @option{-d} option will read +until a particular character rather than newline. + +@item +The @code{return} builtin may be used to abort execution of scripts +executed with the @code{.} or @code{source} builtins +(@pxref{Bourne Shell Builtins}). + +@item +Bash includes the @code{shopt} builtin, for finer control of shell +optional capabilities (@pxref{The Shopt Builtin}), and allows these options +to be set and unset at shell invocation (@pxref{Invoking Bash}). + +@item +Bash has much more optional behavior controllable with the @code{set} +builtin (@pxref{The Set Builtin}). + +@item +The @samp{-x} (@option{xtrace}) option displays commands other than +simple commands when performing an execution trace +(@pxref{The Set Builtin}). + +@item +The @code{test} builtin (@pxref{Bourne Shell Builtins}) +is slightly different, as it implements the @sc{posix} algorithm, +which specifies the behavior based on the number of arguments. + +@item +Bash includes the @code{caller} builtin, which displays the context of +any active subroutine call (a shell function or a script executed with +the @code{.} or @code{source} builtins). This supports the bash +debugger. + +@item +The @code{trap} builtin (@pxref{Bourne Shell Builtins}) allows a +@code{DEBUG} pseudo-signal specification, similar to @code{EXIT}. +Commands specified with a @code{DEBUG} trap are executed before every +simple command, @code{for} command, @code{case} command, +@code{select} command, every arithmetic @code{for} command, and before +the first command executes in a shell function. +The @code{DEBUG} trap is not inherited by shell functions unless the +function has been given the @code{trace} attribute or the +@code{functrace} option has been enabled using the @code{shopt} builtin. +The @code{extdebug} shell option has additional effects on the +@code{DEBUG} trap. + +The @code{trap} builtin (@pxref{Bourne Shell Builtins}) allows an +@code{ERR} pseudo-signal specification, similar to @code{EXIT} and @code{DEBUG}. +Commands specified with an @code{ERR} trap are executed after a simple +command fails, with a few exceptions. +The @code{ERR} trap is not inherited by shell functions unless the +@code{-o errtrace} option to the @code{set} builtin is enabled. + +The @code{trap} builtin (@pxref{Bourne Shell Builtins}) allows a +@code{RETURN} pseudo-signal specification, similar to +@code{EXIT} and @code{DEBUG}. +Commands specified with an @code{RETURN} trap are executed before +execution resumes after a shell function or a shell script executed with +@code{.} or @code{source} returns. +The @code{RETURN} trap is not inherited by shell functions unless the +function has been given the @code{trace} attribute or the +@code{functrace} option has been enabled using the @code{shopt} builtin. + +@item +The Bash @code{type} builtin is more extensive and gives more information +about the names it finds (@pxref{Bash Builtins}). + +@item +The Bash @code{umask} builtin permits a @option{-p} option to cause +the output to be displayed in the form of a @code{umask} command +that may be reused as input (@pxref{Bourne Shell Builtins}). + +@item +Bash implements a @code{csh}-like directory stack, and provides the +@code{pushd}, @code{popd}, and @code{dirs} builtins to manipulate it +(@pxref{The Directory Stack}). +Bash also makes the directory stack visible as the value of the +@env{DIRSTACK} shell variable. + +@item +Bash interprets special backslash-escaped characters in the prompt +strings when interactive (@pxref{Controlling the Prompt}). + +@item +The Bash restricted mode is more useful (@pxref{The Restricted Shell}); +the SVR4.2 shell restricted mode is too limited. + +@item +The @code{disown} builtin can remove a job from the internal shell +job table (@pxref{Job Control Builtins}) or suppress the sending +of @code{SIGHUP} to a job when the shell exits as the result of a +@code{SIGHUP}. + +@item +Bash includes a number of features to support a separate debugger for +shell scripts. + +@item +The SVR4.2 shell has two privilege-related builtins +(@code{mldmode} and @code{priv}) not present in Bash. + +@item +Bash does not have the @code{stop} or @code{newgrp} builtins. + +@item +Bash does not use the @env{SHACCT} variable or perform shell accounting. + +@item +The SVR4.2 @code{sh} uses a @env{TIMEOUT} variable like Bash uses +@env{TMOUT}. + +@end itemize + +@noindent +More features unique to Bash may be found in @ref{Bash Features}. + + +@appendixsec Implementation Differences From The SVR4.2 Shell + +Since Bash is a completely new implementation, it does not suffer from +many of the limitations of the SVR4.2 shell. For instance: + +@itemize @bullet + +@item +Bash does not fork a subshell when redirecting into or out of +a shell control structure such as an @code{if} or @code{while} +statement. + +@item +Bash does not allow unbalanced quotes. The SVR4.2 shell will silently +insert a needed closing quote at @code{EOF} under certain circumstances. +This can be the cause of some hard-to-find errors. + +@item +The SVR4.2 shell uses a baroque memory management scheme based on +trapping @code{SIGSEGV}. If the shell is started from a process with +@code{SIGSEGV} blocked (e.g., by using the @code{system()} C library +function call), it misbehaves badly. + +@item +In a questionable attempt at security, the SVR4.2 shell, +when invoked without the @option{-p} option, will alter its real +and effective @sc{uid} and @sc{gid} if they are less than some +magic threshold value, commonly 100. +This can lead to unexpected results. + +@item +The SVR4.2 shell does not allow users to trap @code{SIGSEGV}, +@code{SIGALRM}, or @code{SIGCHLD}. + +@item +The SVR4.2 shell does not allow the @env{IFS}, @env{MAILCHECK}, +@env{PATH}, @env{PS1}, or @env{PS2} variables to be unset. + +@item +The SVR4.2 shell treats @samp{^} as the undocumented equivalent of +@samp{|}. + +@item +Bash allows multiple option arguments when it is invoked (@code{-x -v}); +the SVR4.2 shell allows only one option argument (@code{-xv}). In +fact, some versions of the shell dump core if the second argument begins +with a @samp{-}. + +@item +The SVR4.2 shell exits a script if any builtin fails; Bash exits +a script only if one of the @sc{posix} special builtins fails, and +only for certain failures, as enumerated in the @sc{posix} standard. + +@item +The SVR4.2 shell behaves differently when invoked as @code{jsh} +(it turns on job control). +@end itemize + +@node GNU Free Documentation License +@appendix GNU Free Documentation License + +@include fdl.texi + +@node Indexes +@appendix Indexes + +@menu +* Builtin Index:: Index of Bash builtin commands. +* Reserved Word Index:: Index of Bash reserved words. +* Variable Index:: Quick reference helps you find the + variable you want. +* Function Index:: Index of bindable Readline functions. +* Concept Index:: General index for concepts described in + this manual. +@end menu + +@node Builtin Index +@appendixsec Index of Shell Builtin Commands +@printindex bt + +@node Reserved Word Index +@appendixsec Index of Shell Reserved Words +@printindex rw + +@node Variable Index +@appendixsec Parameter and Variable Index +@printindex vr + +@node Function Index +@appendixsec Function Index +@printindex fn + +@node Concept Index +@appendixsec Concept Index +@printindex cp + +@bye diff --git a/.pc/input-err.diff/input.c b/.pc/input-err.diff/input.c new file mode 100644 index 0000000..14c6f4e --- /dev/null +++ b/.pc/input-err.diff/input.c @@ -0,0 +1,666 @@ +/* input.c -- functions to perform buffered input with synchronization. */ + +/* Copyright (C) 1992-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" +#if !defined (_MINIX) && defined (HAVE_SYS_FILE_H) +# include +#endif +#include "filecntl.h" +#include "posixstat.h" +#include +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" +#include "bashintl.h" + +#include "command.h" +#include "general.h" +#include "input.h" +#include "error.h" +#include "externs.h" +#include "quit.h" +#include "trap.h" + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +#if defined (EAGAIN) +# define X_EAGAIN EAGAIN +#else +# define X_EAGAIN -99 +#endif + +#if defined (EWOULDBLOCK) +# define X_EWOULDBLOCK EWOULDBLOCK +#else +# define X_EWOULDBLOCK -99 +#endif + +extern void termsig_handler __P((int)); + +/* Functions to handle reading input on systems that don't restart read(2) + if a signal is received. */ + +static char localbuf[128]; +static int local_index = 0, local_bufused = 0; + +/* Posix and USG systems do not guarantee to restart read () if it is + interrupted by a signal. We do the read ourselves, and restart it + if it returns EINTR. */ +int +getc_with_restart (stream) + FILE *stream; +{ + unsigned char uc; + + CHECK_TERMSIG; + + /* Try local buffering to reduce the number of read(2) calls. */ + if (local_index == local_bufused || local_bufused == 0) + { + while (1) + { + QUIT; + run_pending_traps (); + + local_bufused = read (fileno (stream), localbuf, sizeof(localbuf)); + if (local_bufused > 0) + break; + else if (local_bufused == 0) + { + local_index = 0; + return EOF; + } + else if (errno == X_EAGAIN || errno == X_EWOULDBLOCK) + { + if (sh_unset_nodelay_mode (fileno (stream)) < 0) + { + sys_error (_("cannot reset nodelay mode for fd %d"), fileno (stream)); + local_index = local_bufused = 0; + return EOF; + } + continue; + } + else if (errno != EINTR) + { + local_index = local_bufused = 0; + return EOF; + } + else if (interrupt_state || terminating_signal) /* QUIT; */ + local_index = local_bufused = 0; + } + local_index = 0; + } + uc = localbuf[local_index++]; + return uc; +} + +int +ungetc_with_restart (c, stream) + int c; + FILE *stream; +{ + if (local_index == 0 || c == EOF) + return EOF; + localbuf[--local_index] = c; + return c; +} + +#if defined (BUFFERED_INPUT) + +/* A facility similar to stdio, but input-only. */ + +#if defined (USING_BASH_MALLOC) +# define MAX_INPUT_BUFFER_SIZE 8176 +#else +# define MAX_INPUT_BUFFER_SIZE 8192 +#endif + +#if !defined (SEEK_CUR) +# define SEEK_CUR 1 +#endif /* !SEEK_CUR */ + +#ifdef max +# undef max +#endif +#define max(a, b) (((a) > (b)) ? (a) : (b)) +#ifdef min +# undef min +#endif +#define min(a, b) ((a) > (b) ? (b) : (a)) + +extern int interactive_shell; + +int bash_input_fd_changed; + +/* This provides a way to map from a file descriptor to the buffer + associated with that file descriptor, rather than just the other + way around. This is needed so that buffers are managed properly + in constructs like 3<&4. buffers[x]->b_fd == x -- that is how the + correspondence is maintained. */ +static BUFFERED_STREAM **buffers = (BUFFERED_STREAM **)NULL; +static int nbuffers; + +#define ALLOCATE_BUFFERS(n) \ + do { if ((n) >= nbuffers) allocate_buffers (n); } while (0) + +/* Make sure `buffers' has at least N elements. */ +static void +allocate_buffers (n) + int n; +{ + register int i, orig_nbuffers; + + orig_nbuffers = nbuffers; + nbuffers = n + 20; + buffers = (BUFFERED_STREAM **)xrealloc + (buffers, nbuffers * sizeof (BUFFERED_STREAM *)); + + /* Zero out the new buffers. */ + for (i = orig_nbuffers; i < nbuffers; i++) + buffers[i] = (BUFFERED_STREAM *)NULL; +} + +/* Construct and return a BUFFERED_STREAM corresponding to file descriptor + FD, using BUFFER. */ +static BUFFERED_STREAM * +make_buffered_stream (fd, buffer, bufsize) + int fd; + char *buffer; + size_t bufsize; +{ + BUFFERED_STREAM *bp; + + bp = (BUFFERED_STREAM *)xmalloc (sizeof (BUFFERED_STREAM)); + ALLOCATE_BUFFERS (fd); + buffers[fd] = bp; + bp->b_fd = fd; + bp->b_buffer = buffer; + bp->b_size = bufsize; + bp->b_used = bp->b_inputp = bp->b_flag = 0; + if (bufsize == 1) + bp->b_flag |= B_UNBUFF; + if (O_TEXT && (fcntl (fd, F_GETFL) & O_TEXT) != 0) + bp->b_flag |= O_TEXT; + return (bp); +} + +/* Allocate a new BUFFERED_STREAM, copy BP to it, and return the new copy. */ +static BUFFERED_STREAM * +copy_buffered_stream (bp) + BUFFERED_STREAM *bp; +{ + BUFFERED_STREAM *nbp; + + if (!bp) + return ((BUFFERED_STREAM *)NULL); + + nbp = (BUFFERED_STREAM *)xmalloc (sizeof (BUFFERED_STREAM)); + xbcopy ((char *)bp, (char *)nbp, sizeof (BUFFERED_STREAM)); + return (nbp); +} + +int +set_bash_input_fd (fd) + int fd; +{ + if (bash_input.type == st_bstream) + bash_input.location.buffered_fd = fd; + else if (interactive_shell == 0) + default_buffered_input = fd; + return 0; +} + +int +fd_is_bash_input (fd) + int fd; +{ + if (bash_input.type == st_bstream && bash_input.location.buffered_fd == fd) + return 1; + else if (interactive_shell == 0 && default_buffered_input == fd) + return 1; + return 0; +} + +/* Save the buffered stream corresponding to file descriptor FD (which bash + is using to read input) to a buffered stream associated with NEW_FD. If + NEW_FD is -1, a new file descriptor is allocated with fcntl. The new + file descriptor is returned on success, -1 on error. */ +int +save_bash_input (fd, new_fd) + int fd, new_fd; +{ + int nfd; + + /* Sync the stream so we can re-read from the new file descriptor. We + might be able to avoid this by copying the buffered stream verbatim + to the new file descriptor. */ + if (buffers[fd]) + sync_buffered_stream (fd); + + /* Now take care of duplicating the file descriptor that bash is + using for input, so we can reinitialize it later. */ + nfd = (new_fd == -1) ? fcntl (fd, F_DUPFD, 10) : new_fd; + if (nfd == -1) + { + if (fcntl (fd, F_GETFD, 0) == 0) + sys_error (_("cannot allocate new file descriptor for bash input from fd %d"), fd); + return -1; + } + + if (buffers[nfd]) + { + /* What's this? A stray buffer without an associated open file + descriptor? Free up the buffer and report the error. */ + internal_error (_("save_bash_input: buffer already exists for new fd %d"), nfd); + free_buffered_stream (buffers[nfd]); + } + + /* Reinitialize bash_input.location. */ + if (bash_input.type == st_bstream) + { + bash_input.location.buffered_fd = nfd; + fd_to_buffered_stream (nfd); + close_buffered_fd (fd); /* XXX */ + } + else + /* If the current input type is not a buffered stream, but the shell + is not interactive and therefore using a buffered stream to read + input (e.g. with an `eval exec 3>output' inside a script), note + that the input fd has been changed. pop_stream() looks at this + value and adjusts the input fd to the new value of + default_buffered_input accordingly. */ + bash_input_fd_changed++; + + if (default_buffered_input == fd) + default_buffered_input = nfd; + + SET_CLOSE_ON_EXEC (nfd); + return nfd; +} + +/* Check that file descriptor FD is not the one that bash is currently + using to read input from a script. FD is about to be duplicated onto, + which means that the kernel will close it for us. If FD is the bash + input file descriptor, we need to seek backwards in the script (if + possible and necessary -- scripts read from stdin are still unbuffered), + allocate a new file descriptor to use for bash input, and re-initialize + the buffered stream. Make sure the file descriptor used to save bash + input is set close-on-exec. Returns 0 on success, -1 on failure. This + works only if fd is > 0 -- if fd == 0 and bash is reading input from + fd 0, sync_buffered_stream is used instead, to cooperate with input + redirection (look at redir.c:add_undo_redirect()). */ +int +check_bash_input (fd) + int fd; +{ + if (fd_is_bash_input (fd)) + { + if (fd > 0) + return ((save_bash_input (fd, -1) == -1) ? -1 : 0); + else if (fd == 0) + return ((sync_buffered_stream (fd) == -1) ? -1 : 0); + } + return 0; +} + +/* This is the buffered stream analogue of dup2(fd1, fd2). The + BUFFERED_STREAM corresponding to fd2 is deallocated, if one exists. + BUFFERS[fd1] is copied to BUFFERS[fd2]. This is called by the + redirect code for constructs like 4<&0 and 3b_buffer && buffers[fd1]->b_buffer == buffers[fd2]->b_buffer) + buffers[fd2] = (BUFFERED_STREAM *)NULL; + else + free_buffered_stream (buffers[fd2]); + } + buffers[fd2] = copy_buffered_stream (buffers[fd1]); + if (buffers[fd2]) + buffers[fd2]->b_fd = fd2; + + if (is_bash_input) + { + if (!buffers[fd2]) + fd_to_buffered_stream (fd2); + buffers[fd2]->b_flag |= B_WASBASHINPUT; + } + + return (fd2); +} + +/* Return 1 if a seek on FD will succeed. */ +#define fd_is_seekable(fd) (lseek ((fd), 0L, SEEK_CUR) >= 0) + +/* Take FD, a file descriptor, and create and return a buffered stream + corresponding to it. If something is wrong and the file descriptor + is invalid, return a NULL stream. */ +BUFFERED_STREAM * +fd_to_buffered_stream (fd) + int fd; +{ + char *buffer; + size_t size; + struct stat sb; + + if (fstat (fd, &sb) < 0) + { + close (fd); + return ((BUFFERED_STREAM *)NULL); + } + + size = (fd_is_seekable (fd)) ? min (sb.st_size, MAX_INPUT_BUFFER_SIZE) : 1; + if (size == 0) + size = 1; + buffer = (char *)xmalloc (size); + + return (make_buffered_stream (fd, buffer, size)); +} + +/* Return a buffered stream corresponding to FILE, a file name. */ +BUFFERED_STREAM * +open_buffered_stream (file) + char *file; +{ + int fd; + + fd = open (file, O_RDONLY); + return ((fd >= 0) ? fd_to_buffered_stream (fd) : (BUFFERED_STREAM *)NULL); +} + +/* Deallocate a buffered stream and free up its resources. Make sure we + zero out the slot in BUFFERS that points to BP. */ +void +free_buffered_stream (bp) + BUFFERED_STREAM *bp; +{ + int n; + + if (!bp) + return; + + n = bp->b_fd; + if (bp->b_buffer) + free (bp->b_buffer); + free (bp); + buffers[n] = (BUFFERED_STREAM *)NULL; +} + +/* Close the file descriptor associated with BP, a buffered stream, and free + up the stream. Return the status of closing BP's file descriptor. */ +int +close_buffered_stream (bp) + BUFFERED_STREAM *bp; +{ + int fd; + + if (!bp) + return (0); + fd = bp->b_fd; + free_buffered_stream (bp); + return (close (fd)); +} + +/* Deallocate the buffered stream associated with file descriptor FD, and + close FD. Return the status of the close on FD. */ +int +close_buffered_fd (fd) + int fd; +{ + if (fd < 0) + { + errno = EBADF; + return -1; + } + if (fd >= nbuffers || !buffers || !buffers[fd]) + return (close (fd)); + return (close_buffered_stream (buffers[fd])); +} + +/* Make the BUFFERED_STREAM associated with buffers[FD] be BP, and return + the old BUFFERED_STREAM. */ +BUFFERED_STREAM * +set_buffered_stream (fd, bp) + int fd; + BUFFERED_STREAM *bp; +{ + BUFFERED_STREAM *ret; + + ret = buffers[fd]; + buffers[fd] = bp; + return ret; +} + +/* Read a buffer full of characters from BP, a buffered stream. */ +static int +b_fill_buffer (bp) + BUFFERED_STREAM *bp; +{ + ssize_t nr; + off_t o; + + CHECK_TERMSIG; + /* In an environment where text and binary files are treated differently, + compensate for lseek() on text files returning an offset different from + the count of characters read() returns. Text-mode streams have to be + treated as unbuffered. */ + if ((bp->b_flag & (B_TEXT | B_UNBUFF)) == B_TEXT) + { + o = lseek (bp->b_fd, 0, SEEK_CUR); + nr = zread (bp->b_fd, bp->b_buffer, bp->b_size); + if (nr > 0 && nr < lseek (bp->b_fd, 0, SEEK_CUR) - o) + { + lseek (bp->b_fd, o, SEEK_SET); + bp->b_flag |= B_UNBUFF; + bp->b_size = 1; + nr = zread (bp->b_fd, bp->b_buffer, bp->b_size); + } + } + else + nr = zread (bp->b_fd, bp->b_buffer, bp->b_size); + if (nr <= 0) + { + bp->b_used = 0; + bp->b_buffer[0] = 0; + if (nr == 0) + bp->b_flag |= B_EOF; + else + bp->b_flag |= B_ERROR; + return (EOF); + } + + bp->b_used = nr; + bp->b_inputp = 0; + return (bp->b_buffer[bp->b_inputp++] & 0xFF); +} + +/* Get a character from buffered stream BP. */ +#define bufstream_getc(bp) \ + (bp->b_inputp == bp->b_used || !bp->b_used) \ + ? b_fill_buffer (bp) \ + : bp->b_buffer[bp->b_inputp++] & 0xFF + +/* Push C back onto buffered stream BP. */ +static int +bufstream_ungetc(c, bp) + int c; + BUFFERED_STREAM *bp; +{ + if (c == EOF || bp->b_inputp == 0) + return (EOF); + + bp->b_buffer[--bp->b_inputp] = c; + return (c); +} + +/* Seek backwards on file BFD to synchronize what we've read so far + with the underlying file pointer. */ +int +sync_buffered_stream (bfd) + int bfd; +{ + BUFFERED_STREAM *bp; + off_t chars_left; + + if (buffers == 0 || (bp = buffers[bfd]) == 0) + return (-1); + + chars_left = bp->b_used - bp->b_inputp; + if (chars_left) + lseek (bp->b_fd, -chars_left, SEEK_CUR); + bp->b_used = bp->b_inputp = 0; + return (0); +} + +int +buffered_getchar () +{ + CHECK_TERMSIG; + +#if !defined (DJGPP) + return (bufstream_getc (buffers[bash_input.location.buffered_fd])); +#else + /* On DJGPP, ignore \r. */ + int ch; + while ((ch = bufstream_getc (buffers[bash_input.location.buffered_fd])) == '\r') + ; + return ch; +#endif +} + +int +buffered_ungetchar (c) + int c; +{ + return (bufstream_ungetc (c, buffers[bash_input.location.buffered_fd])); +} + +/* Make input come from file descriptor BFD through a buffered stream. */ +void +with_input_from_buffered_stream (bfd, name) + int bfd; + char *name; +{ + INPUT_STREAM location; + BUFFERED_STREAM *bp; + + location.buffered_fd = bfd; + /* Make sure the buffered stream exists. */ + bp = fd_to_buffered_stream (bfd); + init_yy_io (bp == 0 ? return_EOF : buffered_getchar, + buffered_ungetchar, st_bstream, name, location); +} + +#if defined (TEST) +void * +xmalloc(s) +int s; +{ + return (malloc (s)); +} + +void * +xrealloc(s, size) +char *s; +int size; +{ + if (!s) + return(malloc (size)); + else + return(realloc (s, size)); +} + +void +init_yy_io () +{ +} + +process(bp) +BUFFERED_STREAM *bp; +{ + int c; + + while ((c = bufstream_getc(bp)) != EOF) + putchar(c); +} + +BASH_INPUT bash_input; + +struct stat dsb; /* can be used from gdb */ + +/* imitate /bin/cat */ +main(argc, argv) +int argc; +char **argv; +{ + register int i; + BUFFERED_STREAM *bp; + + if (argc == 1) { + bp = fd_to_buffered_stream (0); + process(bp); + exit(0); + } + for (i = 1; i < argc; i++) { + if (argv[i][0] == '-' && argv[i][1] == '\0') { + bp = fd_to_buffered_stream (0); + if (!bp) + continue; + process(bp); + free_buffered_stream (bp); + } else { + bp = open_buffered_stream (argv[i]); + if (!bp) + continue; + process(bp); + close_buffered_stream (bp); + } + } + exit(0); +} +#endif /* TEST */ +#endif /* BUFFERED_INPUT */ diff --git a/.pc/man-arithmetic.diff/doc/bash.1 b/.pc/man-arithmetic.diff/doc/bash.1 new file mode 100644 index 0000000..ec41462 --- /dev/null +++ b/.pc/man-arithmetic.diff/doc/bash.1 @@ -0,0 +1,10331 @@ +.\" +.\" MAN PAGE COMMENTS to +.\" +.\" Chet Ramey +.\" Case Western Reserve University +.\" chet.ramey@case.edu +.\" +.\" Last Change: Sun Feb 2 16:21:40 EST 2014 +.\" +.\" bash_builtins, strip all but Built-Ins section +.if \n(zZ=1 .ig zZ +.if \n(zY=1 .ig zY +.TH BASH 1 "2014 February 2" "GNU Bash 4.3" +.\" +.\" There's some problem with having a `@' +.\" in a tagged paragraph with the BSD man macros. +.\" It has to do with `@' appearing in the }1 macro. +.\" This is a problem on 4.3 BSD and Ultrix, but Sun +.\" appears to have fixed it. +.\" If you're seeing the characters +.\" `@u-3p' appearing before the lines reading +.\" `possible-hostname-completions +.\" and `complete-hostname' down in READLINE, +.\" then uncomment this redefinition. +.\" +.de }1 +.ds ]X \&\\*(]B\\ +.nr )E 0 +.if !"\\$1"" .nr )I \\$1n +.}f +.ll \\n(LLu +.in \\n()Ru+\\n(INu+\\n()Iu +.ti \\n(INu +.ie !\\n()Iu+\\n()Ru-\w\\*(]Xu-3p \{\\*(]X +.br\} +.el \\*(]X\h|\\n()Iu+\\n()Ru\c +.}f +.. +.\" +.\" File Name macro. This used to be `.PN', for Path Name, +.\" but Sun doesn't seem to like that very much. +.\" +.de FN +\fI\|\\$1\|\fP +.. +.SH NAME +bash \- GNU Bourne-Again SHell +.SH SYNOPSIS +.B bash +[options] +[command_string | file] +.SH COPYRIGHT +.if n Bash is Copyright (C) 1989-2013 by the Free Software Foundation, Inc. +.if t Bash is Copyright \(co 1989-2013 by the Free Software Foundation, Inc. +.SH DESCRIPTION +.B Bash +is an \fBsh\fR-compatible command language interpreter that +executes commands read from the standard input or from a file. +.B Bash +also incorporates useful features from the \fIKorn\fP and \fIC\fP +shells (\fBksh\fP and \fBcsh\fP). +.PP +.B Bash +is intended to be a conformant implementation of the +Shell and Utilities portion of the IEEE POSIX specification +(IEEE Standard 1003.1). +.B Bash +can be configured to be POSIX-conformant by default. +.SH OPTIONS +All of the single-character shell options documented in the +description of the \fBset\fR builtin command can be used as options +when the shell is invoked. +In addition, \fBbash\fR +interprets the following options when it is invoked: +.PP +.PD 0 +.TP 10 +.B \-c +If the +.B \-c +option is present, then commands are read from the first non-option argument +.IR command_string . +If there are arguments after the +.IR command_string , +they are assigned to the positional parameters, starting with +.BR $0 . +.TP +.B \-i +If the +.B \-i +option is present, the shell is +.IR interactive . +.TP +.B \-l +Make +.B bash +act as if it had been invoked as a login shell (see +.SM +.B INVOCATION +below). +.TP +.B \-r +If the +.B \-r +option is present, the shell becomes +.I restricted +(see +.SM +.B "RESTRICTED SHELL" +below). +.TP +.B \-s +If the +.B \-s +option is present, or if no arguments remain after option +processing, then commands are read from the standard input. +This option allows the positional parameters to be set +when invoking an interactive shell. +.TP +.B \-D +A list of all double-quoted strings preceded by \fB$\fP +is printed on the standard output. +These are the strings that +are subject to language translation when the current locale +is not \fBC\fP or \fBPOSIX\fP. +This implies the \fB\-n\fP option; no commands will be executed. +.TP +.B [\-+]O [\fIshopt_option\fP] +\fIshopt_option\fP is one of the shell options accepted by the +\fBshopt\fP builtin (see +.SM +.B SHELL BUILTIN COMMANDS +below). +If \fIshopt_option\fP is present, \fB\-O\fP sets the value of that option; +\fB+O\fP unsets it. +If \fIshopt_option\fP is not supplied, the names and values of the shell +options accepted by \fBshopt\fP are printed on the standard output. +If the invocation option is \fB+O\fP, the output is displayed in a format +that may be reused as input. +.TP +.B \-\- +A +.B \-\- +signals the end of options and disables further option processing. +Any arguments after the +.B \-\- +are treated as filenames and arguments. An argument of +.B \- +is equivalent to \fB\-\-\fP. +.PD +.PP +.B Bash +also interprets a number of multi-character options. +These options must appear on the command line before the +single-character options to be recognized. +.PP +.PD 0 +.TP +.B \-\-debugger +Arrange for the debugger profile to be executed before the shell +starts. +Turns on extended debugging mode (see the description of the +.B extdebug +option to the +.B shopt +builtin below). +.TP +.B \-\-dump\-po\-strings +Equivalent to \fB\-D\fP, but the output is in the GNU \fIgettext\fP +\fBpo\fP (portable object) file format. +.TP +.B \-\-dump\-strings +Equivalent to \fB\-D\fP. +.TP +.B \-\-help +Display a usage message on standard output and exit successfully. +.TP +\fB\-\-init\-file\fP \fIfile\fP +.PD 0 +.TP +\fB\-\-rcfile\fP \fIfile\fP +.PD +Execute commands from +.I file +instead of the standard personal initialization file +.I ~/.bashrc +if the shell is interactive (see +.SM +.B INVOCATION +below). +.TP +.B \-\-login +Equivalent to \fB\-l\fP. +.TP +.B \-\-noediting +Do not use the GNU +.B readline +library to read command lines when the shell is interactive. +.TP +.B \-\-noprofile +Do not read either the system-wide startup file +.FN /etc/profile +or any of the personal initialization files +.IR ~/.bash_profile , +.IR ~/.bash_login , +or +.IR ~/.profile . +By default, +.B bash +reads these files when it is invoked as a login shell (see +.SM +.B INVOCATION +below). +.TP +.B \-\-norc +Do not read and execute the personal initialization file +.I ~/.bashrc +if the shell is interactive. +This option is on by default if the shell is invoked as +.BR sh . +.TP +.B \-\-posix +Change the behavior of \fBbash\fP where the default operation differs +from the POSIX standard to match the standard (\fIposix mode\fP). +See +.SM +.B "SEE ALSO" +below for a reference to a document that details how posix mode affects +bash's behavior. +.TP +.B \-\-restricted +The shell becomes restricted (see +.SM +.B "RESTRICTED SHELL" +below). +.TP +.B \-\-verbose +Equivalent to \fB\-v\fP. +.TP +.B \-\-version +Show version information for this instance of +.B bash +on the standard output and exit successfully. +.PD +.SH ARGUMENTS +If arguments remain after option processing, and neither the +.B \-c +nor the +.B \-s +option has been supplied, the first argument is assumed to +be the name of a file containing shell commands. +If +.B bash +is invoked in this fashion, +.B $0 +is set to the name of the file, and the positional parameters +are set to the remaining arguments. +.B Bash +reads and executes commands from this file, then exits. +\fBBash\fP's exit status is the exit status of the last command +executed in the script. +If no commands are executed, the exit status is 0. +An attempt is first made to open the file in the current directory, and, +if no file is found, then the shell searches the directories in +.SM +.B PATH +for the script. +.SH INVOCATION +A \fIlogin shell\fP is one whose first character of argument zero is a +.BR \- , +or one started with the +.B \-\-login +option. +.PP +An \fIinteractive\fP shell is one started without non-option arguments +and without the +.B \-c +option +whose standard input and error are +both connected to terminals (as determined by +.IR isatty (3)), +or one started with the +.B \-i +option. +.SM +.B PS1 +is set and +.B $\- +includes +.B i +if +.B bash +is interactive, +allowing a shell script or a startup file to test this state. +.PP +The following paragraphs describe how +.B bash +executes its startup files. +If any of the files exist but cannot be read, +.B bash +reports an error. +Tildes are expanded in filenames as described below under +.B "Tilde Expansion" +in the +.SM +.B EXPANSION +section. +.PP +When +.B bash +is invoked as an interactive login shell, or as a non-interactive shell +with the \fB\-\-login\fP option, it first reads and +executes commands from the file \fI/etc/profile\fP, if that +file exists. +After reading that file, it looks for \fI~/.bash_profile\fP, +\fI~/.bash_login\fP, and \fI~/.profile\fP, in that order, and reads +and executes commands from the first one that exists and is readable. +The +.B \-\-noprofile +option may be used when the shell is started to inhibit this behavior. +.PP +When a login shell exits, +.B bash +reads and executes commands from the file \fI~/.bash_logout\fP, if it +exists. +.PP +When an interactive shell that is not a login shell is started, +.B bash +reads and executes commands from \fI~/.bashrc\fP, if that file exists. +This may be inhibited by using the +.B \-\-norc +option. +The \fB\-\-rcfile\fP \fIfile\fP option will force +.B bash +to read and execute commands from \fIfile\fP instead of \fI~/.bashrc\fP. +.PP +When +.B bash +is started non-interactively, to run a shell script, for example, it +looks for the variable +.SM +.B BASH_ENV +in the environment, expands its value if it appears there, and uses the +expanded value as the name of a file to read and execute. +.B Bash +behaves as if the following command were executed: +.sp .5 +.RS +.if t \f(CWif [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi\fP +.if n if [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi +.RE +.sp .5 +but the value of the +.SM +.B PATH +variable is not used to search for the filename. +.PP +If +.B bash +is invoked with the name +.BR sh , +it tries to mimic the startup behavior of historical versions of +.B sh +as closely as possible, +while conforming to the POSIX standard as well. +When invoked as an interactive login shell, or a non-interactive +shell with the \fB\-\-login\fP option, it first attempts to +read and execute commands from +.I /etc/profile +and +.IR ~/.profile , +in that order. +The +.B \-\-noprofile +option may be used to inhibit this behavior. +When invoked as an interactive shell with the name +.BR sh , +.B bash +looks for the variable +.SM +.BR ENV , +expands its value if it is defined, and uses the +expanded value as the name of a file to read and execute. +Since a shell invoked as +.B sh +does not attempt to read and execute commands from any other startup +files, the +.B \-\-rcfile +option has no effect. +A non-interactive shell invoked with the name +.B sh +does not attempt to read any other startup files. +When invoked as +.BR sh , +.B bash +enters +.I posix +mode after the startup files are read. +.PP +When +.B bash +is started in +.I posix +mode, as with the +.B \-\-posix +command line option, it follows the POSIX standard for startup files. +In this mode, interactive shells expand the +.SM +.B ENV +variable and commands are read and executed from the file +whose name is the expanded value. +No other startup files are read. +.PP +.B Bash +attempts to determine when it is being run with its standard input +connected to a network connection, as when executed by the remote shell +daemon, usually \fIrshd\fP, or the secure shell daemon \fIsshd\fP. +If +.B bash +determines it is being run in this fashion, it reads and executes +commands from \fI~/.bashrc\fP, if that file exists and is readable. +It will not do this if invoked as \fBsh\fP. +The +.B \-\-norc +option may be used to inhibit this behavior, and the +.B \-\-rcfile +option may be used to force another file to be read, but neither +\fIrshd\fP nor \fIsshd\fP generally invoke the shell with those options +or allow them to be specified. +.PP +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the \fB\-p\fP option is not supplied, no startup +files are read, shell functions are not inherited from the environment, the +.SM +.BR SHELLOPTS , +.SM +.BR BASHOPTS , +.SM +.BR CDPATH , +and +.SM +.B GLOBIGNORE +variables, if they appear in the environment, are ignored, +and the effective user id is set to the real user id. +If the \fB\-p\fP option is supplied at invocation, the startup behavior is +the same, but the effective user id is not reset. +.SH DEFINITIONS +.PP +The following definitions are used throughout the rest of this +document. +.PD 0 +.TP +.B blank +A space or tab. +.TP +.B word +A sequence of characters considered as a single unit by the shell. +Also known as a +.BR token . +.TP +.B name +A +.I word +consisting only of alphanumeric characters and underscores, and +beginning with an alphabetic character or an underscore. Also +referred to as an +.BR identifier . +.TP +.B metacharacter +A character that, when unquoted, separates words. One of the following: +.br +.RS +.PP +.if t \fB| & ; ( ) < > space tab\fP +.if n \fB| & ; ( ) < > space tab\fP +.RE +.PP +.TP +.B control operator +A \fItoken\fP that performs a control function. It is one of the following +symbols: +.RS +.PP +.if t \fB|| & && ; ;; ( ) | |& \fP +.if n \fB|| & && ; ;; ( ) | |& \fP +.RE +.PD +.SH "RESERVED WORDS" +\fIReserved words\fP are words that have a special meaning to the shell. +The following words are recognized as reserved when unquoted and either +the first word of a simple command (see +.SM +.B SHELL GRAMMAR +below) or the third word of a +.B case +or +.B for +command: +.if t .RS +.PP +.B +.if n ! case coproc do done elif else esac fi for function if in select then until while { } time [[ ]] +.if t ! case coproc do done elif else esac fi for function if in select then until while { } time [[ ]] +.if t .RE +.SH "SHELL GRAMMAR" +.SS Simple Commands +.PP +A \fIsimple command\fP is a sequence of optional variable assignments +followed by \fBblank\fP-separated words and redirections, and +terminated by a \fIcontrol operator\fP. The first word +specifies the command to be executed, and is passed as argument zero. +The remaining words are passed as arguments to the invoked command. +.PP +The return value of a \fIsimple command\fP is its exit status, or +128+\fIn\^\fP if the command is terminated by signal +.IR n . +.SS Pipelines +.PP +A \fIpipeline\fP is a sequence of one or more commands separated by +one of the control operators +.B | +or \fB|&\fP. +The format for a pipeline is: +.RS +.PP +[\fBtime\fP [\fB\-p\fP]] [ ! ] \fIcommand\fP [ [\fB|\fP\(bv\fB|&\fP] \fIcommand2\fP ... ] +.RE +.PP +The standard output of +.I command +is connected via a pipe to the standard input of +.IR command2 . +This connection is performed before any redirections specified by the +command (see +.SM +.B REDIRECTION +below). +If \fB|&\fP is used, \fIcommand\fP's standard error, in addition to its +standard output, is connected to +\fIcommand2\fP's standard input through the pipe; +it is shorthand for \fB2>&1 |\fP. +This implicit redirection of the standard error to the standard output is +performed after any redirections specified by the command. +.PP +The return status of a pipeline is the exit status of the last +command, unless the \fBpipefail\fP option is enabled. +If \fBpipefail\fP is enabled, the pipeline's return status is the +value of the last (rightmost) command to exit with a non-zero status, +or zero if all commands exit successfully. +If the reserved word +.B ! +precedes a pipeline, the exit status of that pipeline is the logical +negation of the exit status as described above. +The shell waits for all commands in the pipeline to +terminate before returning a value. +.PP +If the +.B time +reserved word precedes a pipeline, the elapsed as well as user and +system time consumed by its execution are reported when the pipeline +terminates. +The \fB\-p\fP option changes the output format to that specified by POSIX. +When the shell is in \fIposix mode\fP, it does not recognize +\fBtime\fP as a reserved word if the next token begins with a `-'. +The +.SM +.B TIMEFORMAT +variable may be set to a format string that specifies how the timing +information should be displayed; see the description of +.SM +.B TIMEFORMAT +under +.B "Shell Variables" +below. +.PP +When the shell is in \fIposix mode\fP, \fBtime\fP +may be followed by a newline. In this case, the shell displays the +total user and system time consumed by the shell and its children. +The +.SM +.B TIMEFORMAT +variable may be used to specify the format of +the time information. +.PP +Each command in a pipeline is executed as a separate process (i.e., in a +subshell). +.SS Lists +.PP +A \fIlist\fP is a sequence of one or more pipelines separated by one +of the operators +.BR ; , +.BR & , +.BR && , +or +.BR || , +and optionally terminated by one of +.BR ; , +.BR & , +or +.BR . +.PP +Of these list operators, +.B && +and +.B || +have equal precedence, followed by +.B ; +and +.BR & , +which have equal precedence. +.PP +A sequence of one or more newlines may appear in a \fIlist\fP instead +of a semicolon to delimit commands. +.PP +If a command is terminated by the control operator +.BR & , +the shell executes the command in the \fIbackground\fP +in a subshell. The shell does not wait for the command to +finish, and the return status is 0. Commands separated by a +.B ; +are executed sequentially; the shell waits for each +command to terminate in turn. The return status is the +exit status of the last command executed. +.PP +AND and OR lists are sequences of one of more pipelines separated by the +\fB&&\fP and \fB||\fP control operators, respectively. +AND and OR lists are executed with left associativity. +An AND list has the form +.RS +.PP +\fIcommand1\fP \fB&&\fP \fIcommand2\fP +.RE +.PP +.I command2 +is executed if, and only if, +.I command1 +returns an exit status of zero. +.PP +An OR list has the form +.RS +.PP +\fIcommand1\fP \fB||\fP \fIcommand2\fP +.PP +.RE +.PP +.I command2 +is executed if and only if +.I command1 +returns a non-zero exit status. +The return status of +AND and OR lists is the exit status of the last command +executed in the list. +.SS Compound Commands +.PP +A \fIcompound command\fP is one of the following. +In most cases a \fIlist\fP in a command's description may be separated from +the rest of the command by one or more newlines, and may be followed by a +newline in place of a semicolon. +.TP +(\fIlist\fP) +\fIlist\fP is executed in a subshell environment (see +.SM +\fBCOMMAND EXECUTION ENVIRONMENT\fP +below). +Variable assignments and builtin +commands that affect the shell's environment do not remain in effect +after the command completes. The return status is the exit status of +\fIlist\fP. +.TP +{ \fIlist\fP; } +\fIlist\fP is simply executed in the current shell environment. +\fIlist\fP must be terminated with a newline or semicolon. +This is known as a \fIgroup command\fP. +The return status is the exit status of +\fIlist\fP. +Note that unlike the metacharacters \fB(\fP and \fB)\fP, \fB{\fP and +\fB}\fP are \fIreserved words\fP and must occur where a reserved +word is permitted to be recognized. Since they do not cause a word +break, they must be separated from \fIlist\fP by whitespace or another +shell metacharacter. +.TP +((\fIexpression\fP)) +The \fIexpression\fP is evaluated according to the rules described +below under +.SM +.BR "ARITHMETIC EVALUATION" . +If the value of the expression is non-zero, the return status is 0; +otherwise the return status is 1. This is exactly equivalent to +\fBlet "\fIexpression\fP"\fR. +.TP +\fB[[\fP \fIexpression\fP \fB]]\fP +Return a status of 0 or 1 depending on the evaluation of +the conditional expression \fIexpression\fP. +Expressions are composed of the primaries described below under +.SM +.BR "CONDITIONAL EXPRESSIONS" . +Word splitting and pathname expansion are not performed on the words +between the \fB[[\fP and \fB]]\fP; tilde expansion, +parameter and variable expansion, +arithmetic expansion, command substitution, process +substitution, and quote removal are performed. +Conditional operators such as \fB\-f\fP must be unquoted to be recognized +as primaries. +.if t .sp 0.5 +.if n .sp 1 +When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort +lexicographically using the current locale. +.if t .sp 0.5 +.if n .sp 1 +When the \fB==\fP and \fB!=\fP operators are used, the string to the +right of the operator is considered a pattern and matched according +to the rules described below under \fBPattern Matching\fP, +as if the \fBextglob\fP shell option were enabled. +The \fB=\fP operator is equivalent to \fB==\fP. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +The return value is 0 if the string matches (\fB==\fP) or does not match +(\fB!=\fP) the pattern, and 1 otherwise. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +.if t .sp 0.5 +.if n .sp 1 +An additional binary operator, \fB=~\fP, is available, with the same +precedence as \fB==\fP and \fB!=\fP. +When it is used, the string to the right of the operator is considered +an extended regular expression and matched accordingly (as in \fIregex\fP(3)). +The return value is 0 if the string matches +the pattern, and 1 otherwise. +If the regular expression is syntactically incorrect, the conditional +expression's return value is 2. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +Bracket expressions in regular expressions must be treated carefully, +since normal quoting characters lose their meanings between brackets. +If the pattern is stored in a shell variable, quoting the variable +expansion forces the entire pattern to be matched as a string. +Substrings matched by parenthesized subexpressions within the regular +expression are saved in the array variable +.SM +.BR BASH_REMATCH . +The element of +.SM +.B BASH_REMATCH +with index 0 is the portion of the string +matching the entire regular expression. +The element of +.SM +.B BASH_REMATCH +with index \fIn\fP is the portion of the +string matching the \fIn\fPth parenthesized subexpression. +.if t .sp 0.5 +.if n .sp 1 +Expressions may be combined using the following operators, listed +in decreasing order of precedence: +.if t .sp 0.5 +.if n .sp 1 +.RS +.PD 0 +.TP +.B ( \fIexpression\fP ) +Returns the value of \fIexpression\fP. +This may be used to override the normal precedence of operators. +.TP +.B ! \fIexpression\fP +True if +.I expression +is false. +.TP +\fIexpression1\fP \fB&&\fP \fIexpression2\fP +True if both +.I expression1 +and +.I expression2 +are true. +.TP +\fIexpression1\fP \fB||\fP \fIexpression2\fP +True if either +.I expression1 +or +.I expression2 +is true. +.PD +.LP +The \fB&&\fP and \fB||\fP +operators do not evaluate \fIexpression2\fP if the value of +\fIexpression1\fP is sufficient to determine the return value of +the entire conditional expression. +.RE +.TP +\fBfor\fP \fIname\fP [ [ \fBin\fP [ \fIword ...\fP ] ] ; ] \fBdo\fP \fIlist\fP ; \fBdone\fP +The list of words following \fBin\fP is expanded, generating a list +of items. +The variable \fIname\fP is set to each element of this list +in turn, and \fIlist\fP is executed each time. +If the \fBin\fP \fIword\fP is omitted, the \fBfor\fP command executes +\fIlist\fP once for each positional parameter that is set (see +.SM +.B PARAMETERS +below). +The return status is the exit status of the last command that executes. +If the expansion of the items following \fBin\fP results in an empty +list, no commands are executed, and the return status is 0. +.TP +\fBfor\fP (( \fIexpr1\fP ; \fIexpr2\fP ; \fIexpr3\fP )) ; \fBdo\fP \fIlist\fP ; \fBdone\fP +First, the arithmetic expression \fIexpr1\fP is evaluated according +to the rules described below under +.SM +.BR "ARITHMETIC EVALUATION" . +The arithmetic expression \fIexpr2\fP is then evaluated repeatedly +until it evaluates to zero. +Each time \fIexpr2\fP evaluates to a non-zero value, \fIlist\fP is +executed and the arithmetic expression \fIexpr3\fP is evaluated. +If any expression is omitted, it behaves as if it evaluates to 1. +The return value is the exit status of the last command in \fIlist\fP +that is executed, or false if any of the expressions is invalid. +.TP +\fBselect\fP \fIname\fP [ \fBin\fP \fIword\fP ] ; \fBdo\fP \fIlist\fP ; \fBdone\fP +The list of words following \fBin\fP is expanded, generating a list +of items. The set of expanded words is printed on the standard +error, each preceded by a number. If the \fBin\fP +\fIword\fP is omitted, the positional parameters are printed (see +.SM +.B PARAMETERS +below). The +.SM +.B PS3 +prompt is then displayed and a line read from the standard input. +If the line consists of a number corresponding to one of +the displayed words, then the value of +.I name +is set to that word. If the line is empty, the words and prompt +are displayed again. If EOF is read, the command completes. Any +other value read causes +.I name +to be set to null. The line read is saved in the variable +.SM +.BR REPLY . +The +.I list +is executed after each selection until a +.B break +command is executed. +The exit status of +.B select +is the exit status of the last command executed in +.IR list , +or zero if no commands were executed. +.TP +\fBcase\fP \fIword\fP \fBin\fP [ [(] \fIpattern\fP [ \fB|\fP \fIpattern\fP ] \ +... ) \fIlist\fP ;; ] ... \fBesac\fP +A \fBcase\fP command first expands \fIword\fP, and tries to match +it against each \fIpattern\fP in turn, using the same matching rules +as for pathname expansion (see +.B Pathname Expansion +below). +The \fIword\fP is expanded using tilde +expansion, parameter and variable expansion, arithmetic substitution, +command substitution, process substitution and quote removal. +Each \fIpattern\fP examined is expanded using tilde +expansion, parameter and variable expansion, arithmetic substitution, +command substitution, and process substitution. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +When a match is found, the corresponding \fIlist\fP is executed. +If the \fB;;\fP operator is used, no subsequent matches are attempted after +the first pattern match. +Using \fB;&\fP in place of \fB;;\fP causes execution to continue with +the \fIlist\fP associated with the next set of patterns. +Using \fB;;&\fP in place of \fB;;\fP causes the shell to test the next +pattern list in the statement, if any, and execute any associated \fIlist\fP +on a successful match. +The exit status is zero if no +pattern matches. Otherwise, it is the exit status of the +last command executed in \fIlist\fP. +.TP +\fBif\fP \fIlist\fP; \fBthen\fP \fIlist\fP; \ +[ \fBelif\fP \fIlist\fP; \fBthen\fP \fIlist\fP; ] ... \ +[ \fBelse\fP \fIlist\fP; ] \fBfi\fP +The +.B if +.I list +is executed. If its exit status is zero, the +\fBthen\fP \fIlist\fP is executed. Otherwise, each \fBelif\fP +\fIlist\fP is executed in turn, and if its exit status is zero, +the corresponding \fBthen\fP \fIlist\fP is executed and the +command completes. Otherwise, the \fBelse\fP \fIlist\fP is +executed, if present. The exit status is the exit status of the +last command executed, or zero if no condition tested true. +.TP +\fBwhile\fP \fIlist-1\fP; \fBdo\fP \fIlist-2\fP; \fBdone\fP +.PD 0 +.TP +\fBuntil\fP \fIlist-1\fP; \fBdo\fP \fIlist-2\fP; \fBdone\fP +.PD +The \fBwhile\fP command continuously executes the list +\fIlist-2\fP as long as the last command in the list \fIlist-1\fP returns +an exit status of zero. The \fBuntil\fP command is identical +to the \fBwhile\fP command, except that the test is negated; +.I list-2 +is executed as long as the last command in +.I list-1 +returns a non-zero exit status. +The exit status of the \fBwhile\fP and \fBuntil\fP commands +is the exit status +of the last command executed in \fIlist-2\fP, or zero if +none was executed. +.SS Coprocesses +.PP +A \fIcoprocess\fP is a shell command preceded by the \fBcoproc\fP reserved +word. +A coprocess is executed asynchronously in a subshell, as if the command +had been terminated with the \fB&\fP control operator, with a two-way pipe +established between the executing shell and the coprocess. +.PP +The format for a coprocess is: +.RS +.PP +\fBcoproc\fP [\fINAME\fP] \fIcommand\fP [\fIredirections\fP] +.RE +.PP +This creates a coprocess named \fINAME\fP. +If \fINAME\fP is not supplied, the default name is \fBCOPROC\fP. +\fINAME\fP must not be supplied if \fIcommand\fP is a \fIsimple +command\fP (see above); otherwise, it is interpreted as the first word +of the simple command. +When the coprocess is executed, the shell creates an array variable (see +.B Arrays +below) named \fINAME\fP in the context of the executing shell. +The standard output of +.I command +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to \fINAME\fP[0]. +The standard input of +.I command +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to \fINAME\fP[1]. +This pipe is established before any redirections specified by the +command (see +.SM +.B REDIRECTION +below). +The file descriptors can be utilized as arguments to shell commands +and redirections using standard word expansions. +The file descriptors are not available in subshells. +The process ID of the shell spawned to execute the coprocess is +available as the value of the variable \fINAME\fP_PID. +The \fBwait\fP +builtin command may be used to wait for the coprocess to terminate. +.PP +Since the coprocess is created as an asynchronous command, +the \fBcoproc\fP command always returns success. +The return status of a coprocess is the exit status of \fIcommand\fP. +.SS Shell Function Definitions +.PP +A shell function is an object that is called like a simple command and +executes a compound command with a new set of positional parameters. +Shell functions are declared as follows: +.TP +\fIname\fP () \fIcompound\-command\fP [\fIredirection\fP] +.PD 0 +.TP +\fBfunction\fP \fIname\fP [()] \fIcompound\-command\fP [\fIredirection\fP] +.PD +This defines a function named \fIname\fP. +The reserved word \fBfunction\fP is optional. +If the \fBfunction\fP reserved word is supplied, the parentheses are optional. +The \fIbody\fP of the function is the compound command +.I compound\-command +(see \fBCompound Commands\fP above). +That command is usually a \fIlist\fP of commands between { and }, but +may be any command listed under \fBCompound Commands\fP above. +\fIcompound\-command\fP is executed whenever \fIname\fP is specified as the +name of a simple command. +When in \fIposix mode\fP, \fIname\fP may not be the name of one of the +POSIX \fIspecial builtins\fP. +Any redirections (see +.SM +.B REDIRECTION +below) specified when a function is defined are performed +when the function is executed. +The exit status of a function definition is zero unless a syntax error +occurs or a readonly function with the same name already exists. +When executed, the exit status of a function is the exit status of the +last command executed in the body. (See +.SM +.B FUNCTIONS +below.) +.SH COMMENTS +In a non-interactive shell, or an interactive shell in which the +.B interactive_comments +option to the +.B shopt +builtin is enabled (see +.SM +.B "SHELL BUILTIN COMMANDS" +below), a word beginning with +.B # +causes that word and all remaining characters on that line to +be ignored. An interactive shell without the +.B interactive_comments +option enabled does not allow comments. The +.B interactive_comments +option is on by default in interactive shells. +.SH QUOTING +\fIQuoting\fP is used to remove the special meaning of certain +characters or words to the shell. Quoting can be used to +disable special treatment for special characters, to prevent +reserved words from being recognized as such, and to prevent +parameter expansion. +.PP +Each of the \fImetacharacters\fP listed above under +.SM +.B DEFINITIONS +has special meaning to the shell and must be quoted if it is to +represent itself. +.PP +When the command history expansion facilities are being used +(see +.SM +.B HISTORY EXPANSION +below), the +\fIhistory expansion\fP character, usually \fB!\fP, must be quoted +to prevent history expansion. +.PP +There are three quoting mechanisms: the +.IR "escape character" , +single quotes, and double quotes. +.PP +A non-quoted backslash (\fB\e\fP) is the +.IR "escape character" . +It preserves the literal value of the next character that follows, +with the exception of . If a \fB\e\fP pair +appears, and the backslash is not itself quoted, the \fB\e\fP +is treated as a line continuation (that is, it is removed from the +input stream and effectively ignored). +.PP +Enclosing characters in single quotes preserves the literal value +of each character within the quotes. A single quote may not occur +between single quotes, even when preceded by a backslash. +.PP +Enclosing characters in double quotes preserves the literal value +of all characters within the quotes, with the exception of +.BR $ , +.BR \` , +.BR \e , +and, when history expansion is enabled, +.BR ! . +The characters +.B $ +and +.B \` +retain their special meaning within double quotes. The backslash +retains its special meaning only when followed by one of the following +characters: +.BR $ , +.BR \` , +\^\fB"\fP\^, +.BR \e , +or +.BR . +A double quote may be quoted within double quotes by preceding it with +a backslash. +If enabled, history expansion will be performed unless an +.B ! +appearing in double quotes is escaped using a backslash. +The backslash preceding the +.B ! +is not removed. +.PP +The special parameters +.B * +and +.B @ +have special meaning when in double +quotes (see +.SM +.B PARAMETERS +below). +.PP +Words of the form \fB$\fP\(aq\fIstring\fP\(aq are treated specially. The +word expands to \fIstring\fP, with backslash-escaped characters replaced +as specified by the ANSI C standard. Backslash escape sequences, if +present, are decoded as follows: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ee +.TP +.B \eE +an escape character +.TP +.B \ef +form feed +.TP +.B \en +new line +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\e +backslash +.TP +.B \e\(aq +single quote +.TP +.B \e\(dq +double quote +.TP +.B \e\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(one to three digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.TP +.B \eu\fIHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHH\fP (one to four hex digits) +.TP +.B \eU\fIHHHHHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHHHHHH\fP (one to eight hex digits) +.TP +.B \ec\fIx\fP +a control-\fIx\fP character +.PD +.RE +.LP +The expanded result is single-quoted, as if the dollar sign had +not been present. +.PP +A double-quoted string preceded by a dollar sign (\fB$\fP\(dq\fIstring\fP\(dq) +will cause the string to be translated according to the current locale. +If the current locale is \fBC\fP or \fBPOSIX\fP, the dollar sign +is ignored. +If the string is translated and replaced, the replacement is +double-quoted. +.SH PARAMETERS +A +.I parameter +is an entity that stores values. +It can be a +.IR name , +a number, or one of the special characters listed below under +.BR "Special Parameters" . +A +.I variable +is a parameter denoted by a +.IR name . +A variable has a \fIvalue\fP and zero or more \fIattributes\fP. +Attributes are assigned using the +.B declare +builtin command (see +.B declare +below in +.SM +.BR "SHELL BUILTIN COMMANDS" ). +.PP +A parameter is set if it has been assigned a value. The null string is +a valid value. Once a variable is set, it may be unset only by using +the +.B unset +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.PP +A +.I variable +may be assigned to by a statement of the form +.RS +.PP +\fIname\fP=[\fIvalue\fP] +.RE +.PP +If +.I value +is not given, the variable is assigned the null string. All +.I values +undergo tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote +removal (see +.SM +.B EXPANSION +below). If the variable has its +.B integer +attribute set, then +.I value +is evaluated as an arithmetic expression even if the $((...)) expansion is +not used (see +.B "Arithmetic Expansion" +below). +Word splitting is not performed, with the exception +of \fB"$@"\fP as explained below under +.BR "Special Parameters" . +Pathname expansion is not performed. +Assignment statements may also appear as arguments to the +.BR alias , +.BR declare , +.BR typeset , +.BR export , +.BR readonly , +and +.B local +builtin commands. +When in \fIposix mode\fP, these builtins may appear in a command after +one or more instances of the \fBcommand\fP builtin and retain these +assignment statement properties. +.PP +In the context where an assignment statement is assigning a value +to a shell variable or array index, the += operator can be used to +append to or add to the variable's previous value. +When += is applied to a variable for which the \fIinteger\fP attribute has been +set, \fIvalue\fP is evaluated as an arithmetic expression and added to the +variable's current value, which is also evaluated. +When += is applied to an array variable using compound assignment (see +.B Arrays +below), the +variable's value is not unset (as it is when using =), and new values are +appended to the array beginning at one greater than the array's maximum index +(for indexed arrays) or added as additional key\-value pairs in an +associative array. +When applied to a string-valued variable, \fIvalue\fP is expanded and +appended to the variable's value. +.PP +A variable can be assigned the \fInameref\fP attribute using the +\fB\-n\fP option to the \fBdeclare\fP or \fBlocal\fP builtin commands +(see the descriptions of \fBdeclare\fP and \fBlocal\fP below) +to create a \fInameref\fP, or a reference to another variable. +This allows variables to be manipulated indirectly. +Whenever the nameref variable is referenced or assigned to, the operation +is actually performed on the variable specified by the nameref variable's +value. +A nameref is commonly used within shell functions to refer to a variable +whose name is passed as an argument to the function. +For instance, if a variable name is passed to a shell function as its first +argument, running +.sp .5 +.RS +.if t \f(CWdeclare -n ref=$1\fP +.if n declare -n ref=$1 +.RE +.sp .5 +inside the function creates a nameref variable \fBref\fP whose value is +the variable name passed as the first argument. +References and assignments to \fBref\fP are treated as references and +assignments to the variable whose name was passed as \fB$1\fP. +If the control variable in a \fBfor\fP loop has the nameref attribute, +the list of words can be a list of shell variables, and a name reference +will be established for each word in the list, in turn, when the loop is +executed. +Array variables cannot be given the \fB\-n\fP attribute. +However, nameref variables can reference array variables and subscripted +array variables. +Namerefs can be unset using the \fB\-n\fP option to the \fBunset\fP builtin. +Otherwise, if \fBunset\fP is executed with the name of a nameref variable +as an argument, the variable referenced by the nameref variable will be unset. +.SS Positional Parameters +.PP +A +.I positional parameter +is a parameter denoted by one or more +digits, other than the single digit 0. Positional parameters are +assigned from the shell's arguments when it is invoked, +and may be reassigned using the +.B set +builtin command. Positional parameters may not be assigned to +with assignment statements. The positional parameters are +temporarily replaced when a shell function is executed (see +.SM +.B FUNCTIONS +below). +.PP +When a positional parameter consisting of more than a single +digit is expanded, it must be enclosed in braces (see +.SM +.B EXPANSION +below). +.SS Special Parameters +.PP +The shell treats several parameters specially. These parameters may +only be referenced; assignment to them is not allowed. +.PD 0 +.TP +.B * +Expands to the positional parameters, starting from one. +When the expansion is not within double quotes, each positional parameter +expands to a separate word. +In contexts where it is performed, those words +are subject to further word splitting and pathname expansion. +When the expansion occurs within double quotes, it expands to a single word +with the value of each parameter separated by the first character +of the +.SM +.B IFS +special variable. That is, "\fB$*\fP" is equivalent +to "\fB$1\fP\fIc\fP\fB$2\fP\fIc\fP\fB...\fP", where +.I c +is the first character of the value of the +.SM +.B IFS +variable. If +.SM +.B IFS +is unset, the parameters are separated by spaces. +If +.SM +.B IFS +is null, the parameters are joined without intervening separators. +.TP +.B @ +Expands to the positional parameters, starting from one. When the +expansion occurs within double quotes, each parameter expands to a +separate word. That is, "\fB$@\fP" is equivalent to +"\fB$1\fP" "\fB$2\fP" ... +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +When there are no positional parameters, "\fB$@\fP" and +.B $@ +expand to nothing (i.e., they are removed). +.TP +.B # +Expands to the number of positional parameters in decimal. +.TP +.B ? +Expands to the exit status of the most recently executed foreground +pipeline. +.TP +.B \- +Expands to the current option flags as specified upon invocation, +by the +.B set +builtin command, or those set by the shell itself +(such as the +.B \-i +option). +.TP +.B $ +Expands to the process ID of the shell. In a () subshell, it +expands to the process ID of the current shell, not the +subshell. +.TP +.B ! +Expands to the process ID of the job most recently placed into the +background, whether executed as an asynchronous command or using +the \fBbg\fP builtin (see +.SM +.B "JOB CONTROL" +below). +.TP +.B 0 +Expands to the name of the shell or shell script. This is set at +shell initialization. If +.B bash +is invoked with a file of commands, +.B $0 +is set to the name of that file. If +.B bash +is started with the +.B \-c +option, then +.B $0 +is set to the first argument after the string to be +executed, if one is present. Otherwise, it is set +to the filename used to invoke +.BR bash , +as given by argument zero. +.TP +.B _ +At shell startup, set to the absolute pathname used to invoke the +shell or shell script being executed as passed in the environment +or argument list. +Subsequently, expands to the last argument to the previous command, +after expansion. +Also set to the full pathname used to invoke each command executed +and placed in the environment exported to that command. +When checking mail, this parameter holds the name of the mail file +currently being checked. +.PD +.SS Shell Variables +.PP +The following variables are set by the shell: +.PP +.PD 0 +.TP +.B BASH +Expands to the full filename used to invoke this instance of +.BR bash . +.TP +.B BASHOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +.B \-s +option to the +.B shopt +builtin command (see +.SM +.B "SHELL BUILTIN COMMANDS" +below). The options appearing in +.SM +.B BASHOPTS +are those reported as +.I on +by \fBshopt\fP. +If this variable is in the environment when +.B bash +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +.TP +.B BASHPID +Expands to the process ID of the current \fBbash\fP process. +This differs from \fB$$\fP under certain circumstances, such as subshells +that do not require \fBbash\fP to be re-initialized. +.TP +.B BASH_ALIASES +An associative array variable whose members correspond to the internal +list of aliases as maintained by the \fBalias\fP builtin. +Elements added to this array appear in the alias list; unsetting array +elements cause aliases to be removed from the alias list. +.TP +.B BASH_ARGC +An array variable whose values are the number of parameters in each +frame of the current \fBbash\fP execution call stack. +The number of +parameters to the current subroutine (shell function or script executed +with \fB.\fP or \fBsource\fP) is at the top of the stack. +When a subroutine is executed, the number of parameters passed is pushed onto +.SM +.BR BASH_ARGC . +The shell sets +.SM +.B BASH_ARGC +only when in extended debugging mode (see the description of the +.B extdebug +option to the +.B shopt +builtin below) +.TP +.B BASH_ARGV +An array variable containing all of the parameters in the current \fBbash\fP +execution call stack. The final parameter of the last subroutine call +is at the top of the stack; the first parameter of the initial call is +at the bottom. When a subroutine is executed, the parameters supplied +are pushed onto +.SM +.BR BASH_ARGV . +The shell sets +.SM +.B BASH_ARGV +only when in extended debugging mode +(see the description of the +.B extdebug +option to the +.B shopt +builtin below) +.TP +.B BASH_CMDS +An associative array variable whose members correspond to the internal +hash table of commands as maintained by the \fBhash\fP builtin. +Elements added to this array appear in the hash table; unsetting array +elements cause commands to be removed from the hash table. +.TP +.B BASH_COMMAND +The command currently being executed or about to be executed, unless the +shell is executing a command as the result of a trap, +in which case it is the command executing at the time of the trap. +.TP +.B BASH_EXECUTION_STRING +The command argument to the \fB\-c\fP invocation option. +.TP +.B BASH_LINENO +An array variable whose members are the line numbers in source files +where each corresponding member of +.SM +.B FUNCNAME +was invoked. +\fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP is the line number in the source +file (\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP) where +\fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP was called +(or \fB${BASH_LINENO[\fP\fI$i-1\fP\fB]}\fP if referenced within another +shell function). +Use +.SM +.B LINENO +to obtain the current line number. +.TP +.B BASH_REMATCH +An array variable whose members are assigned by the \fB=~\fP binary +operator to the \fB[[\fP conditional command. +The element with index 0 is the portion of the string +matching the entire regular expression. +The element with index \fIn\fP is the portion of the +string matching the \fIn\fPth parenthesized subexpression. +This variable is read-only. +.TP +.B BASH_SOURCE +An array variable whose members are the source filenames +where the corresponding shell function names in the +.SM +.B FUNCNAME +array variable are defined. +The shell function +\fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP is defined in the file +\fB${BASH_SOURCE[\fP\fI$i\fP\fB]}\fP and called from +\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP. +.TP +.B BASH_SUBSHELL +Incremented by one within each subshell or subshell environment when +the shell begins executing in that environment. +The initial value is 0. +.TP +.B BASH_VERSINFO +A readonly array variable whose members hold version information for +this instance of +.BR bash . +The values assigned to the array members are as follows: +.sp .5 +.RS +.TP 24 +.B BASH_VERSINFO[\fR0\fP] +The major version number (the \fIrelease\fP). +.TP +.B BASH_VERSINFO[\fR1\fP] +The minor version number (the \fIversion\fP). +.TP +.B BASH_VERSINFO[\fR2\fP] +The patch level. +.TP +.B BASH_VERSINFO[\fR3\fP] +The build version. +.TP +.B BASH_VERSINFO[\fR4\fP] +The release status (e.g., \fIbeta1\fP). +.TP +.B BASH_VERSINFO[\fR5\fP] +The value of +.SM +.BR MACHTYPE . +.RE +.TP +.B BASH_VERSION +Expands to a string describing the version of this instance of +.BR bash . +.TP +.B COMP_CWORD +An index into \fB${COMP_WORDS}\fP of the word containing the current +cursor position. +This variable is available only in shell functions invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_KEY +The key (or final key of a key sequence) used to invoke the current +completion function. +.TP +.B COMP_LINE +The current command line. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_POINT +The index of the current cursor position relative to the beginning of +the current command. +If the current cursor position is at the end of the current command, +the value of this variable is equal to \fB${#COMP_LINE}\fP. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_TYPE +Set to an integer value corresponding to the type of completion attempted +that caused a completion function to be called: +\fITAB\fP, for normal completion, +\fI?\fP, for listing completions after successive tabs, +\fI!\fP, for listing alternatives on partial word completion, +\fI@\fP, to list completions if the word is not unmodified, +or +\fI%\fP, for menu completion. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_WORDBREAKS +The set of characters that the \fBreadline\fP library treats as word +separators when performing word completion. +If +.SM +.B COMP_WORDBREAKS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B COMP_WORDS +An array variable (see \fBArrays\fP below) consisting of the individual +words in the current command line. +The line is split into words as \fBreadline\fP would split it, using +.SM +.B COMP_WORDBREAKS +as described above. +This variable is available only in shell functions invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COPROC +An array variable (see \fBArrays\fP below) created to hold the file descriptors +for output from and input to an unnamed coprocess (see \fBCoprocesses\fP +above). +.TP +.B DIRSTACK +An array variable (see +.B Arrays +below) containing the current contents of the directory stack. +Directories appear in the stack in the order they are displayed by the +.B dirs +builtin. +Assigning to members of this array variable may be used to modify +directories already in the stack, but the +.B pushd +and +.B popd +builtins must be used to add and remove directories. +Assignment to this variable will not change the current directory. +If +.SM +.B DIRSTACK +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B EUID +Expands to the effective user ID of the current user, initialized at +shell startup. This variable is readonly. +.TP +.B FUNCNAME +An array variable containing the names of all shell functions +currently in the execution call stack. +The element with index 0 is the name of any currently-executing +shell function. +The bottom-most element (the one with the highest index) is +.if t \f(CW"main"\fP. +.if n "main". +This variable exists only when a shell function is executing. +Assignments to +.SM +.B FUNCNAME +have no effect and return an error status. +If +.SM +.B FUNCNAME +is unset, it loses its special properties, even if it is +subsequently reset. +.if t .sp 0.5 +.if n .sp 1 +This variable can be used with \fBBASH_LINENO\fP and \fBBASH_SOURCE\fP. +Each element of \fBFUNCNAME\fP has corresponding elements in +\fBBASH_LINENO\fP and \fBBASH_SOURCE\fP to describe the call stack. +For instance, \fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP was called from the file +\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP at line number +\fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP. +The \fBcaller\fP builtin displays the current call stack using this +information. +.TP +.B GROUPS +An array variable containing the list of groups of which the current +user is a member. +Assignments to +.SM +.B GROUPS +have no effect and return an error status. +If +.SM +.B GROUPS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B HISTCMD +The history number, or index in the history list, of the current +command. +If +.SM +.B HISTCMD +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B HOSTNAME +Automatically set to the name of the current host. +.TP +.B HOSTTYPE +Automatically set to a string that uniquely +describes the type of machine on which +.B bash +is executing. +The default is system-dependent. +.TP +.B LINENO +Each time this parameter is referenced, the shell substitutes +a decimal number representing the current sequential line number +(starting with 1) within a script or function. When not in a +script or function, the value substituted is not guaranteed to +be meaningful. +If +.SM +.B LINENO +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B MACHTYPE +Automatically set to a string that fully describes the system +type on which +.B bash +is executing, in the standard GNU \fIcpu-company-system\fP format. +The default is system-dependent. +.TP +.B MAPFILE +An array variable (see \fBArrays\fP below) created to hold the text +read by the \fBmapfile\fP builtin when no variable name is supplied. +.TP +.B OLDPWD +The previous working directory as set by the +.B cd +command. +.TP +.B OPTARG +The value of the last option argument processed by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.TP +.B OPTIND +The index of the next argument to be processed by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.TP +.B OSTYPE +Automatically set to a string that +describes the operating system on which +.B bash +is executing. +The default is system-dependent. +.TP +.B PIPESTATUS +An array variable (see +.B Arrays +below) containing a list of exit status values from the processes +in the most-recently-executed foreground pipeline (which may +contain only a single command). +.TP +.B PPID +The process ID of the shell's parent. This variable is readonly. +.TP +.B PWD +The current working directory as set by the +.B cd +command. +.TP +.B RANDOM +Each time this parameter is referenced, a random integer between +0 and 32767 is +generated. The sequence of random numbers may be initialized by assigning +a value to +.SM +.BR RANDOM . +If +.SM +.B RANDOM +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B READLINE_LINE +The contents of the +.B readline +line buffer, for use with +.if t \f(CWbind -x\fP +.if n "bind -x" +(see +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.TP +.B READLINE_POINT +The position of the insertion point in the +.B readline +line buffer, for use with +.if t \f(CWbind -x\fP +.if n "bind -x" +(see +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.TP +.B REPLY +Set to the line of input read by the +.B read +builtin command when no arguments are supplied. +.TP +.B SECONDS +Each time this parameter is +referenced, the number of seconds since shell invocation is returned. If a +value is assigned to +.SM +.BR SECONDS , +the value returned upon subsequent +references is +the number of seconds since the assignment plus the value assigned. +If +.SM +.B SECONDS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B SHELLOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +.B \-o +option to the +.B set +builtin command (see +.SM +.B "SHELL BUILTIN COMMANDS" +below). The options appearing in +.SM +.B SHELLOPTS +are those reported as +.I on +by \fBset \-o\fP. +If this variable is in the environment when +.B bash +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +.TP +.B SHLVL +Incremented by one each time an instance of +.B bash +is started. +.TP +.B UID +Expands to the user ID of the current user, initialized at shell startup. +This variable is readonly. +.PD +.PP +The following variables are used by the shell. In some cases, +.B bash +assigns a default value to a variable; these cases are noted +below. +.PP +.PD 0 +.TP +.B BASH_COMPAT +The value is used to set the shell's compatibility level. +See the description of the \fBshopt\fP builtin below under +\fBSHELL BUILTIN COMMANDS\fP +for a description of the various compatibility +levels and their effects. +The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42) +corresponding to the desired compatibility level. +If \fBBASH_COMPAT\fP is unset or set to the empty string, the compatibility +level is set to the default for the current version. +If \fBBASH_COMPAT\fP is set to a value that is not one of the valid +compatibility levels, the shell prints an error message and sets the +compatibility level to the default for the current version. +The valid compatibility levels correspond to the compatibility options +accepted by the \fBshopt\fP builtin described below (for example, +\fBcompat42\fP means that 4.2 and 42 are valid values). +The current version is also a valid value. +.TP +.B BASH_ENV +If this parameter is set when \fBbash\fP is executing a shell script, +its value is interpreted as a filename containing commands to +initialize the shell, as in +.IR ~/.bashrc . +The value of +.SM +.B BASH_ENV +is subjected to parameter expansion, command substitution, and arithmetic +expansion before being interpreted as a filename. +.SM +.B PATH +is not used to search for the resultant filename. +.TP +.B BASH_XTRACEFD +If set to an integer corresponding to a valid file descriptor, \fBbash\fP +will write the trace output generated when +.if t \f(CWset -x\fP +.if n \fIset -x\fP +is enabled to that file descriptor. +The file descriptor is closed when +.SM +.B BASH_XTRACEFD +is unset or assigned a new value. +Unsetting +.SM +.B BASH_XTRACEFD +or assigning it the empty string causes the +trace output to be sent to the standard error. +Note that setting +.SM +.B BASH_XTRACEFD +to 2 (the standard error file +descriptor) and then unsetting it will result in the standard error +being closed. +.TP +.B CDPATH +The search path for the +.B cd +command. +This is a colon-separated list of directories in which the shell looks +for destination directories specified by the +.B cd +command. +A sample value is +.if t \f(CW".:~:/usr"\fP. +.if n ".:~:/usr". +.TP +.B CHILD_MAX +Set the number of exited child status values for the shell to remember. +Bash will not allow this value to be decreased below a POSIX-mandated +minimum, and there is a maximum value (currently 8192) that this may +not exceed. +The minimum value is system-dependent. +.TP +.B COLUMNS +Used by the \fBselect\fP compound command to determine the terminal width +when printing selection lists. +Automatically set if the +.B checkwinsize +option is enabled or in an interactive shell upon receipt of a +.SM +.BR SIGWINCH . +.TP +.B COMPREPLY +An array variable from which \fBbash\fP reads the possible completions +generated by a shell function invoked by the programmable completion +facility (see \fBProgrammable Completion\fP below). +Each array element contains one possible completion. +.TP +.B EMACS +If \fBbash\fP finds this variable in the environment when the shell starts +with value +.if t \f(CWt\fP, +.if n "t", +it assumes that the shell is running in an Emacs shell buffer and disables +line editing. +.TP +.B ENV +Similar to +.SM +.BR BASH_ENV ; +used when the shell is invoked in POSIX mode. +.TP +.B FCEDIT +The default editor for the +.B fc +builtin command. +.TP +.B FIGNORE +A colon-separated list of suffixes to ignore when performing +filename completion (see +.SM +.B READLINE +below). +A filename whose suffix matches one of the entries in +.SM +.B FIGNORE +is excluded from the list of matched filenames. +A sample value is +.if t \f(CW".o:~"\fP. +.if n ".o:~". +.TP +.B FUNCNEST +If set to a numeric value greater than 0, defines a maximum function +nesting level. Function invocations that exceed this nesting level +will cause the current command to abort. +.TP +.B GLOBIGNORE +A colon-separated list of patterns defining the set of filenames to +be ignored by pathname expansion. +If a filename matched by a pathname expansion pattern also matches one +of the patterns in +.SM +.BR GLOBIGNORE , +it is removed from the list of matches. +.TP +.B HISTCONTROL +A colon-separated list of values controlling how commands are saved on +the history list. +If the list of values includes +.IR ignorespace , +lines which begin with a +.B space +character are not saved in the history list. +A value of +.I ignoredups +causes lines matching the previous history entry to not be saved. +A value of +.I ignoreboth +is shorthand for \fIignorespace\fP and \fIignoredups\fP. +A value of +.IR erasedups +causes all previous lines matching the current line to be removed from +the history list before that line is saved. +Any value not in the above list is ignored. +If +.SM +.B HISTCONTROL +is unset, or does not include a valid value, +all lines read by the shell parser are saved on the history list, +subject to the value of +.SM +.BR HISTIGNORE . +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +.SM +.BR HISTCONTROL . +.TP +.B HISTFILE +The name of the file in which command history is saved (see +.SM +.B HISTORY +below). The default value is \fI~/.bash_history\fP. If unset, the +command history is not saved when a shell exits. +.TP +.B HISTFILESIZE +The maximum number of lines contained in the history file. When this +variable is assigned a value, the history file is truncated, if +necessary, +to contain no more than that number of lines by removing the oldest entries. +The history file is also truncated to this size after +writing it when a shell exits. +If the value is 0, the history file is truncated to zero size. +Non-numeric values and numeric values less than zero inhibit truncation. +The shell sets the default value to the value of \fBHISTSIZE\fP +after reading any startup files. +.TP +.B HISTIGNORE +A colon-separated list of patterns used to decide which command lines +should be saved on the history list. Each pattern is anchored at the +beginning of the line and must match the complete line (no implicit +`\fB*\fP' is appended). Each pattern is tested against the line +after the checks specified by +.SM +.B HISTCONTROL +are applied. +In addition to the normal shell pattern matching characters, `\fB&\fP' +matches the previous history line. `\fB&\fP' may be escaped using a +backslash; the backslash is removed before attempting a match. +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +.SM +.BR HISTIGNORE . +.TP +.B HISTSIZE +The number of commands to remember in the command history (see +.SM +.B HISTORY +below). +If the value is 0, commands are not saved in the history list. +Numeric values less than zero result in every command being saved +on the history list (there is no limit). +The shell sets the default value to 500 after reading any startup files. +.TP +.B HISTTIMEFORMAT +If this variable is set and not null, its value is used as a format string +for \fIstrftime\fP(3) to print the time stamp associated with each history +entry displayed by the \fBhistory\fP builtin. +If this variable is set, time stamps are written to the history file so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +.TP +.B HOME +The home directory of the current user; the default argument for the +\fBcd\fP builtin command. +The value of this variable is also used when performing tilde expansion. +.TP +.B HOSTFILE +Contains the name of a file in the same format as +.FN /etc/hosts +that should be read when the shell needs to complete a +hostname. +The list of possible hostname completions may be changed while the +shell is running; +the next time hostname completion is attempted after the +value is changed, +.B bash +adds the contents of the new file to the existing list. +If +.SM +.B HOSTFILE +is set, but has no value, or does not name a readable file, +\fBbash\fP attempts to read +.FN /etc/hosts +to obtain the list of possible hostname completions. +When +.SM +.B HOSTFILE +is unset, the hostname list is cleared. +.TP +.B IFS +The +.I Internal Field Separator +that is used +for word splitting after expansion and to +split lines into words with the +.B read +builtin command. The default value is +``''. +.TP +.B IGNOREEOF +Controls the +action of an interactive shell on receipt of an +.SM +.B EOF +character as the sole input. If set, the value is the number of +consecutive +.SM +.B EOF +characters which must be +typed as the first characters on an input line before +.B bash +exits. If the variable exists but does not have a numeric value, or +has no value, the default value is 10. If it does not exist, +.SM +.B EOF +signifies the end of input to the shell. +.TP +.B INPUTRC +The filename for the +.B readline +startup file, overriding the default of +.FN ~/.inputrc +(see +.SM +.B READLINE +below). +.TP +.B LANG +Used to determine the locale category for any category not specifically +selected with a variable starting with \fBLC_\fP. +.TP +.B LC_ALL +This variable overrides the value of +.SM +.B LANG +and any other +\fBLC_\fP variable specifying a locale category. +.TP +.B LC_COLLATE +This variable determines the collation order used when sorting the +results of pathname expansion, and determines the behavior of range +expressions, equivalence classes, and collating sequences within +pathname expansion and pattern matching. +.TP +.B LC_CTYPE +This variable determines the interpretation of characters and the +behavior of character classes within pathname expansion and pattern +matching. +.TP +.B LC_MESSAGES +This variable determines the locale used to translate double-quoted +strings preceded by a \fB$\fP. +.TP +.B LC_NUMERIC +This variable determines the locale category used for number formatting. +.TP +.B LINES +Used by the \fBselect\fP compound command to determine the column length +for printing selection lists. +Automatically set if the +.B checkwinsize +option is enabled or in an interactive shell upon receipt of a +.SM +.BR SIGWINCH . +.TP +.B MAIL +If this parameter is set to a file or directory name and the +.SM +.B MAILPATH +variable is not set, +.B bash +informs the user of the arrival of mail in the specified file or +Maildir-format directory. +.TP +.B MAILCHECK +Specifies how +often (in seconds) +.B bash +checks for mail. The default is 60 seconds. When it is time to check +for mail, the shell does so before displaying the primary prompt. +If this variable is unset, or set to a value that is not a number +greater than or equal to zero, the shell disables mail checking. +.TP +.B MAILPATH +A colon-separated list of filenames to be checked for mail. +The message to be printed when mail arrives in a particular file +may be specified by separating the filename from the message with a `?'. +When used in the text of the message, \fB$_\fP expands to the name of +the current mailfile. +Example: +.RS +.PP +\fBMAILPATH\fP=\(aq/var/mail/bfox?"You have mail":~/shell\-mail?"$_ has mail!"\(aq +.PP +.B Bash +supplies a default value for this variable, but the location of the user +mail files that it uses is system dependent (e.g., /var/mail/\fB$USER\fP). +.RE +.TP +.B OPTERR +If set to the value 1, +.B bash +displays error messages generated by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SM +.B OPTERR +is initialized to 1 each time the shell is invoked or a shell +script is executed. +.TP +.B PATH +The search path for commands. It +is a colon-separated list of directories in which +the shell looks for commands (see +.SM +.B COMMAND EXECUTION +below). +A zero-length (null) directory name in the value of +.SM +.B PATH +indicates the current directory. +A null directory name may appear as two adjacent colons, or as an initial +or trailing colon. +The default path is system-dependent, +and is set by the administrator who installs +.BR bash . +A common value is +.if t \f(CW/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin\fP. +.if n ``/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin''. +.TP +.B POSIXLY_CORRECT +If this variable is in the environment when \fBbash\fP starts, the shell +enters \fIposix mode\fP before reading the startup files, as if the +.B \-\-posix +invocation option had been supplied. If it is set while the shell is +running, \fBbash\fP enables \fIposix mode\fP, as if the command +.if t \f(CWset -o posix\fP +.if n \fIset -o posix\fP +had been executed. +.TP +.B PROMPT_COMMAND +If set, the value is executed as a command prior to issuing each primary +prompt. +.TP +.B PROMPT_DIRTRIM +If set to a number greater than zero, the value is used as the number of +trailing directory components to retain when expanding the \fB\ew\fP and +\fB\eW\fP prompt string escapes (see +.SM +.B PROMPTING +below). Characters removed are replaced with an ellipsis. +.TP +.B PS1 +The value of this parameter is expanded (see +.SM +.B PROMPTING +below) and used as the primary prompt string. The default value is +``\fB\es\-\ev\e$ \fP''. +.TP +.B PS2 +The value of this parameter is expanded as with +.SM +.B PS1 +and used as the secondary prompt string. The default is +``\fB> \fP''. +.TP +.B PS3 +The value of this parameter is used as the prompt for the +.B select +command (see +.SM +.B SHELL GRAMMAR +above). +.TP +.B PS4 +The value of this parameter is expanded as with +.SM +.B PS1 +and the value is printed before each command +.B bash +displays during an execution trace. The first character of +.SM +.B PS4 +is replicated multiple times, as necessary, to indicate multiple +levels of indirection. The default is ``\fB+ \fP''. +.TP +.B SHELL +The full pathname to the shell is kept in this environment variable. +If it is not set when the shell starts, +.B bash +assigns to it the full pathname of the current user's login shell. +.TP +.B TIMEFORMAT +The value of this parameter is used as a format string specifying +how the timing information for pipelines prefixed with the +.B time +reserved word should be displayed. +The \fB%\fP character introduces an escape sequence that is +expanded to a time value or other information. +The escape sequences and their meanings are as follows; the +braces denote optional portions. +.sp .5 +.RS +.PD 0 +.TP 10 +.B %% +A literal \fB%\fP. +.TP +.B %[\fIp\fP][l]R +The elapsed time in seconds. +.TP +.B %[\fIp\fP][l]U +The number of CPU seconds spent in user mode. +.TP +.B %[\fIp\fP][l]S +The number of CPU seconds spent in system mode. +.TP +.B %P +The CPU percentage, computed as (%U + %S) / %R. +.PD +.RE +.IP +The optional \fIp\fP is a digit specifying the \fIprecision\fP, +the number of fractional digits after a decimal point. +A value of 0 causes no decimal point or fraction to be output. +At most three places after the decimal point may be specified; +values of \fIp\fP greater than 3 are changed to 3. +If \fIp\fP is not specified, the value 3 is used. +.IP +The optional \fBl\fP specifies a longer format, including +minutes, of the form \fIMM\fPm\fISS\fP.\fIFF\fPs. +The value of \fIp\fP determines whether or not the fraction is +included. +.IP +If this variable is not set, \fBbash\fP acts as if it had the +value \fB$\(aq\enreal\et%3lR\enuser\et%3lU\ensys\et%3lS\(aq\fP. +If the value is null, no timing information is displayed. +A trailing newline is added when the format string is displayed. +.PD 0 +.TP +.B TMOUT +If set to a value greater than zero, +.SM +.B TMOUT +is treated as the +default timeout for the \fBread\fP builtin. +The \fBselect\fP command terminates if input does not arrive +after +.SM +.B TMOUT +seconds when input is coming from a terminal. +In an interactive shell, the value is interpreted as the +number of seconds to wait for a line of input after issuing the +primary prompt. +.B Bash +terminates after waiting for that number of seconds if a complete +line of input does not arrive. +.TP +.B TMPDIR +If set, \fBbash\fP uses its value as the name of a directory in which +\fBbash\fP creates temporary files for the shell's use. +.TP +.B auto_resume +This variable controls how the shell interacts with the user and +job control. If this variable is set, single word simple +commands without redirections are treated as candidates for resumption +of an existing stopped job. There is no ambiguity allowed; if there is +more than one job beginning with the string typed, the job most recently +accessed is selected. The +.I name +of a stopped job, in this context, is the command line used to +start it. +If set to the value +.IR exact , +the string supplied must match the name of a stopped job exactly; +if set to +.IR substring , +the string supplied needs to match a substring of the name of a +stopped job. The +.I substring +value provides functionality analogous to the +.B %? +job identifier (see +.SM +.B JOB CONTROL +below). If set to any other value, the supplied string must +be a prefix of a stopped job's name; this provides functionality +analogous to the \fB%\fP\fIstring\fP job identifier. +.TP +.B histchars +The two or three characters which control history expansion +and tokenization (see +.SM +.B HISTORY EXPANSION +below). The first character is the \fIhistory expansion\fP character, +the character which signals the start of a history +expansion, normally `\fB!\fP'. +The second character is the \fIquick substitution\fP +character, which is used as shorthand for re-running the previous +command entered, substituting one string for another in the command. +The default is `\fB^\fP'. +The optional third character is the character +which indicates that the remainder of the line is a comment when found +as the first character of a word, normally `\fB#\fP'. The history +comment character causes history substitution to be skipped for the +remaining words on the line. It does not necessarily cause the shell +parser to treat the rest of the line as a comment. +.PD +.SS Arrays +.B Bash +provides one-dimensional indexed and associative array variables. +Any variable may be used as an indexed array; the +.B declare +builtin will explicitly declare an array. +There is no maximum +limit on the size of an array, nor any requirement that members +be indexed or assigned contiguously. +Indexed arrays are referenced using integers (including arithmetic +expressions) and are zero-based; associative arrays are referenced +using arbitrary strings. +Unless otherwise noted, indexed array indices must be non-negative integers. +.PP +An indexed array is created automatically if any variable is assigned to +using the syntax \fIname\fP[\fIsubscript\fP]=\fIvalue\fP. The +.I subscript +is treated as an arithmetic expression that must evaluate to a number. +To explicitly declare an indexed array, use +.B declare \-a \fIname\fP +(see +.SM +.B SHELL BUILTIN COMMANDS +below). +.B declare \-a \fIname\fP[\fIsubscript\fP] +is also accepted; the \fIsubscript\fP is ignored. +.PP +Associative arrays are created using +.BR "declare \-A \fIname\fP" . +.PP +Attributes may be +specified for an array variable using the +.B declare +and +.B readonly +builtins. Each attribute applies to all members of an array. +.PP +Arrays are assigned to using compound assignments of the form +\fIname\fP=\fB(\fPvalue\fI1\fP ... value\fIn\fP\fB)\fP, where each +\fIvalue\fP is of the form [\fIsubscript\fP]=\fIstring\fP. +Indexed array assignments do not require anything but \fIstring\fP. +When assigning to indexed arrays, if the optional brackets and subscript +are supplied, that index is assigned to; +otherwise the index of the element assigned is the last index assigned +to by the statement plus one. Indexing starts at zero. +.PP +When assigning to an associative array, the subscript is required. +.PP +This syntax is also accepted by the +.B declare +builtin. Individual array elements may be assigned to using the +\fIname\fP[\fIsubscript\fP]=\fIvalue\fP syntax introduced above. +When assigning to an indexed array, if +.I name +is subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +\fIname\fP, so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.PP +Any element of an array may be referenced using +${\fIname\fP[\fIsubscript\fP]}. The braces are required to avoid +conflicts with pathname expansion. If +\fIsubscript\fP is \fB@\fP or \fB*\fP, the word expands to +all members of \fIname\fP. These subscripts differ only when the +word appears within double quotes. If the word is double-quoted, +${\fIname\fP[*]} expands to a single +word with the value of each array member separated by the first +character of the +.SM +.B IFS +special variable, and ${\fIname\fP[@]} expands each element of +\fIname\fP to a separate word. When there are no array members, +${\fIname\fP[@]} expands to nothing. +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +This is analogous to the expansion +of the special parameters \fB*\fP and \fB@\fP (see +.B Special Parameters +above). ${#\fIname\fP[\fIsubscript\fP]} expands to the length of +${\fIname\fP[\fIsubscript\fP]}. If \fIsubscript\fP is \fB*\fP or +\fB@\fP, the expansion is the number of elements in the array. +Referencing an array variable without a subscript is equivalent to +referencing the array with a subscript of 0. +If the +.I subscript +used to reference an element of an indexed array +evaluates to a number less than zero, it is +interpreted as relative to one greater than the maximum index of the array, +so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.PP +An array variable is considered set if a subscript has been assigned a +value. The null string is a valid value. +.PP +It is possible to obtain the keys (indices) of an array as well as the values. +${\fB!\fP\fIname\fP[\fI@\fP]} and ${\fB!\fP\fIname\fP[\fI*\fP]} +expand to the indices assigned in array variable \fIname\fP. +The treatment when in double quotes is similar to the expansion of the +special parameters \fI@\fP and \fI*\fP within double quotes. +.PP +The +.B unset +builtin is used to destroy arrays. \fBunset\fP \fIname\fP[\fIsubscript\fP] +destroys the array element at index \fIsubscript\fP. +Negative subscripts to indexed arrays are interpreted as described above. +Care must be taken to avoid unwanted side effects caused by pathname +expansion. +\fBunset\fP \fIname\fP, where \fIname\fP is an array, or +\fBunset\fP \fIname\fP[\fIsubscript\fP], where +\fIsubscript\fP is \fB*\fP or \fB@\fP, removes the entire array. +.PP +The +.BR declare , +.BR local , +and +.B readonly +builtins each accept a +.B \-a +option to specify an indexed array and a +.B \-A +option to specify an associative array. +If both options are supplied, +.B \-A +takes precedence. +The +.B read +builtin accepts a +.B \-a +option to assign a list of words read from the standard input +to an array. The +.B set +and +.B declare +builtins display array values in a way that allows them to be +reused as assignments. +.SH EXPANSION +Expansion is performed on the command line after it has been split into +words. There are seven kinds of expansion performed: +.IR "brace expansion" , +.IR "tilde expansion" , +.IR "parameter and variable expansion" , +.IR "command substitution" , +.IR "arithmetic expansion" , +.IR "word splitting" , +and +.IR "pathname expansion" . +.PP +The order of expansions is: +brace expansion; +tilde expansion, parameter and variable expansion, arithmetic expansion, +and command substitution (done in a left-to-right fashion); +word splitting; +and pathname expansion. +.PP +On systems that can support it, there is an additional expansion +available: \fIprocess substitution\fP. +This is performed at the +same time as tilde, parameter, variable, and arithmetic expansion and +command substitution. +.PP +Only brace expansion, word splitting, and pathname expansion +can change the number of words of the expansion; other expansions +expand a single word to a single word. +The only exceptions to this are the expansions of +"\fB$@\fP" and "\fB${\fP\fIname\fP\fB[@]}\fP" +as explained above (see +.SM +.BR PARAMETERS ). +.SS Brace Expansion +.PP +.I "Brace expansion" +is a mechanism by which arbitrary strings +may be generated. This mechanism is similar to +\fIpathname expansion\fP, but the filenames generated +need not exist. Patterns to be brace expanded take +the form of an optional +.IR preamble , +followed by either a series of comma-separated strings or +a sequence expression between a pair of braces, followed by +an optional +.IR postscript . +The preamble is prefixed to each string contained +within the braces, and the postscript is then appended +to each resulting string, expanding left to right. +.PP +Brace expansions may be nested. The results of each expanded +string are not sorted; left to right order is preserved. +For example, a\fB{\fPd,c,b\fB}\fPe expands into `ade ace abe'. +.PP +A sequence expression takes the form +\fB{\fP\fIx\fP\fB..\fP\fIy\fP\fB[..\fP\fIincr\fP\fB]}\fP, +where \fIx\fP and \fIy\fP are either integers or single characters, +and \fIincr\fP, an optional increment, is an integer. +When integers are supplied, the expression expands to each number between +\fIx\fP and \fIy\fP, inclusive. +Supplied integers may be prefixed with \fI0\fP to force each term to have the +same width. +When either \fIx\fP or \fPy\fP begins with a zero, the shell +attempts to force all generated terms to contain the same number of digits, +zero-padding where necessary. +When characters are supplied, the expression expands to each character +lexicographically between \fIx\fP and \fIy\fP, inclusive, +using the default C locale. +Note that both \fIx\fP and \fIy\fP must be of the same type. +When the increment is supplied, it is used as the difference between +each term. The default increment is 1 or -1 as appropriate. +.PP +Brace expansion is performed before any other expansions, +and any characters special to other expansions are preserved +in the result. It is strictly textual. +.B Bash +does not apply any syntactic interpretation to the context of the +expansion or the text between the braces. +.PP +A correctly-formed brace expansion must contain unquoted opening +and closing braces, and at least one unquoted comma or a valid +sequence expression. +Any incorrectly formed brace expansion is left unchanged. +A \fB{\fP or \fB,\fP may be quoted with a backslash to prevent its +being considered part of a brace expression. +To avoid conflicts with parameter expansion, the string \fB${\fP +is not considered eligible for brace expansion. +.PP +This construct is typically used as shorthand when the common +prefix of the strings to be generated is longer than in the +above example: +.RS +.PP +mkdir /usr/local/src/bash/{old,new,dist,bugs} +.RE +or +.RS +chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} +.RE +.PP +Brace expansion introduces a slight incompatibility with +historical versions of +.BR sh . +.B sh +does not treat opening or closing braces specially when they +appear as part of a word, and preserves them in the output. +.B Bash +removes braces from words as a consequence of brace +expansion. For example, a word entered to +.B sh +as \fIfile{1,2}\fP +appears identically in the output. The same word is +output as +.I file1 file2 +after expansion by +.BR bash . +If strict compatibility with +.B sh +is desired, start +.B bash +with the +.B +B +option or disable brace expansion with the +.B +B +option to the +.B set +command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SS Tilde Expansion +.PP +If a word begins with an unquoted tilde character (`\fB~\fP'), all of +the characters preceding the first unquoted slash (or all characters, +if there is no unquoted slash) are considered a \fItilde-prefix\fP. +If none of the characters in the tilde-prefix are quoted, the +characters in the tilde-prefix following the tilde are treated as a +possible \fIlogin name\fP. +If this login name is the null string, the tilde is replaced with the +value of the shell parameter +.SM +.BR HOME . +If +.SM +.B HOME +is unset, the home directory of the user executing the shell is +substituted instead. +Otherwise, the tilde-prefix is replaced with the home directory +associated with the specified login name. +.PP +If the tilde-prefix is a `~+', the value of the shell variable +.SM +.B PWD +replaces the tilde-prefix. +If the tilde-prefix is a `~\-', the value of the shell variable +.SM +.BR OLDPWD , +if it is set, is substituted. +If the characters following the tilde in the tilde-prefix consist +of a number \fIN\fP, optionally prefixed +by a `+' or a `\-', the tilde-prefix is replaced with the corresponding +element from the directory stack, as it would be displayed by the +.B dirs +builtin invoked with the tilde-prefix as an argument. +If the characters following the tilde in the tilde-prefix consist of a +number without a leading `+' or `\-', `+' is assumed. +.PP +If the login name is invalid, or the tilde expansion fails, the word +is unchanged. +.PP +Each variable assignment is checked for unquoted tilde-prefixes immediately +following a +.B : +or the first +.BR = . +In these cases, tilde expansion is also performed. +Consequently, one may use filenames with tildes in assignments to +.SM +.BR PATH , +.SM +.BR MAILPATH , +and +.SM +.BR CDPATH , +and the shell assigns the expanded value. +.SS Parameter Expansion +.PP +The `\fB$\fP' character introduces parameter expansion, +command substitution, or arithmetic expansion. The parameter name +or symbol to be expanded may be enclosed in braces, which +are optional but serve to protect the variable to be expanded from +characters immediately following it which could be +interpreted as part of the name. +.PP +When braces are used, the matching ending brace is the first `\fB}\fP' +not escaped by a backslash or within a quoted string, and not within an +embedded arithmetic expansion, command substitution, or parameter +expansion. +.PP +.PD 0 +.TP +${\fIparameter\fP} +The value of \fIparameter\fP is substituted. The braces are required +when +.I parameter +is a positional parameter with more than one digit, +or when +.I parameter +is followed by a character which is not to be +interpreted as part of its name. +The \fIparameter\fP is a shell parameter as described above +\fBPARAMETERS\fP) or an array reference (\fBArrays\fP). +.PD +.PP +If the first character of \fIparameter\fP is an exclamation point (\fB!\fP), +it introduces a level of variable indirection. +\fBBash\fP uses the value of the variable formed from the rest of +\fIparameter\fP as the name of the variable; this variable is then +expanded and that value is used in the rest of the substitution, rather +than the value of \fIparameter\fP itself. +This is known as \fIindirect expansion\fP. +The exceptions to this are the expansions of ${\fB!\fP\fIprefix\fP\fB*\fP} and +${\fB!\fP\fIname\fP[\fI@\fP]} described below. +The exclamation point must immediately follow the left brace in order to +introduce indirection. +.PP +In each of the cases below, \fIword\fP is subject to tilde expansion, +parameter expansion, command substitution, and arithmetic expansion. +.PP +When not performing substring expansion, using the forms documented below +(e.g., \fB:-\fP), +\fBbash\fP tests for a parameter that is unset or null. Omitting the colon +results in a test only for a parameter that is unset. +.PP +.PD 0 +.TP +${\fIparameter\fP\fB:\-\fP\fIword\fP} +\fBUse Default Values\fP. If +.I parameter +is unset or null, the expansion of +.I word +is substituted. Otherwise, the value of +.I parameter +is substituted. +.TP +${\fIparameter\fP\fB:=\fP\fIword\fP} +\fBAssign Default Values\fP. +If +.I parameter +is unset or null, the expansion of +.I word +is assigned to +.IR parameter . +The value of +.I parameter +is then substituted. Positional parameters and special parameters may +not be assigned to in this way. +.TP +${\fIparameter\fP\fB:?\fP\fIword\fP} +\fBDisplay Error if Null or Unset\fP. +If +.I parameter +is null or unset, the expansion of \fIword\fP (or a message to that effect +if +.I word +is not present) is written to the standard error and the shell, if it +is not interactive, exits. Otherwise, the value of \fIparameter\fP is +substituted. +.TP +${\fIparameter\fP\fB:+\fP\fIword\fP} +\fBUse Alternate Value\fP. +If +.I parameter +is null or unset, nothing is substituted, otherwise the expansion of +.I word +is substituted. +.TP +${\fIparameter\fP\fB:\fP\fIoffset\fP} +.PD 0 +.TP +${\fIparameter\fP\fB:\fP\fIoffset\fP\fB:\fP\fIlength\fP} +.PD +\fBSubstring Expansion\fP. +Expands to up to \fIlength\fP characters of the value of \fIparameter\fP +starting at the character specified by \fIoffset\fP. +If \fIparameter\fP is \fB@\fP, an indexed array subscripted by +\fB@\fP or \fB*\fP, or an associative array name, the results differ as +described below. +If \fIlength\fP is omitted, expands to the substring of the value of +\fIparameter\fP starting at the character specified by \fIoffset\fP +and extending to the end of the value. +\fIlength\fP and \fIoffset\fP are arithmetic expressions (see +.SM +.B +ARITHMETIC EVALUATION +below). +.sp 1 +If \fIoffset\fP evaluates to a number less than zero, the value +is used as an offset in characters +from the end of the value of \fIparameter\fP. +If \fIlength\fP evaluates to a number less than zero, +it is interpreted as an offset in characters +from the end of the value of \fIparameter\fP rather than +a number of characters, and the expansion is the characters between +\fIoffset\fP and that result. +Note that a negative offset must be separated from the colon by at least +one space to avoid being confused with the \fB:-\fP expansion. +.sp 1 +If \fIparameter\fP is \fB@\fP, the result is \fIlength\fP positional +parameters beginning at \fIoffset\fP. +A negative \fIoffset\fP is taken relative to one greater than the greatest +positional parameter, so an offset of -1 evaluates to the last positional +parameter. +It is an expansion error if \fIlength\fP evaluates to a number less than +zero. +.sp 1 +If \fIparameter\fP is an indexed array name subscripted by @ or *, +the result is the \fIlength\fP +members of the array beginning with ${\fIparameter\fP[\fIoffset\fP]}. +A negative \fIoffset\fP is taken relative to one greater than the maximum +index of the specified array. +It is an expansion error if \fIlength\fP evaluates to a number less than +zero. +.sp 1 +Substring expansion applied to an associative array produces undefined +results. +.sp 1 +Substring indexing is zero-based unless the positional parameters +are used, in which case the indexing starts at 1 by default. +If \fIoffset\fP is 0, and the positional parameters are used, \fB$0\fP is +prefixed to the list. +.TP +${\fB!\fP\fIprefix\fP\fB*\fP} +.PD 0 +.TP +${\fB!\fP\fIprefix\fP\fB@\fP} +.PD +\fBNames matching prefix\fP. +Expands to the names of variables whose names begin with \fIprefix\fP, +separated by the first character of the +.SM +.B IFS +special variable. +When \fI@\fP is used and the expansion appears within double quotes, each +variable name expands to a separate word. +.TP +${\fB!\fP\fIname\fP[\fI@\fP]} +.PD 0 +.TP +${\fB!\fP\fIname\fP[\fI*\fP]} +.PD +\fBList of array keys\fP. +If \fIname\fP is an array variable, expands to the list of array indices +(keys) assigned in \fIname\fP. +If \fIname\fP is not an array, expands to 0 if \fIname\fP is set and null +otherwise. +When \fI@\fP is used and the expansion appears within double quotes, each +key expands to a separate word. +.TP +${\fB#\fP\fIparameter\fP} +\fBParameter length\fP. +The length in characters of the value of \fIparameter\fP is substituted. +If +.I parameter +is +.B * +or +.BR @ , +the value substituted is the number of positional parameters. +If +.I parameter +is an array name subscripted by +.B * +or +.BR @ , +the value substituted is the number of elements in the array. +If +.I parameter +is an indexed array name subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +\fIparameter\fP, so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.TP +${\fIparameter\fP\fB#\fP\fIword\fP} +.PD 0 +.TP +${\fIparameter\fP\fB##\fP\fIword\fP} +.PD +\fBRemove matching prefix pattern\fP. +The +.I word +is expanded to produce a pattern just as in pathname +expansion. If the pattern matches the beginning of +the value of +.IR parameter , +then the result of the expansion is the expanded value of +.I parameter +with the shortest matching pattern (the ``\fB#\fP'' case) or the +longest matching pattern (the ``\fB##\fP'' case) deleted. +If +.I parameter +is +.B @ +or +.BR * , +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB%\fP\fIword\fP} +.PD 0 +.TP +${\fIparameter\fP\fB%%\fP\fIword\fP} +.PD +\fBRemove matching suffix pattern\fP. +The \fIword\fP is expanded to produce a pattern just as in +pathname expansion. +If the pattern matches a trailing portion of the expanded value of +.IR parameter , +then the result of the expansion is the expanded value of +.I parameter +with the shortest matching pattern (the ``\fB%\fP'' case) or the +longest matching pattern (the ``\fB%%\fP'' case) deleted. +If +.I parameter +is +.B @ +or +.BR * , +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB/\fP\fIpattern\fP\fB/\fP\fIstring\fP} +\fBPattern substitution\fP. +The \fIpattern\fP is expanded to produce a pattern just as in +pathname expansion. +\fIParameter\fP is expanded and the longest match of \fIpattern\fP +against its value is replaced with \fIstring\fP. +If \fIpattern\fP begins with \fB/\fP, all matches of \fIpattern\fP are +replaced with \fIstring\fP. Normally only the first match is replaced. +If \fIpattern\fP begins with \fB#\fP, it must match at the beginning +of the expanded value of \fIparameter\fP. +If \fIpattern\fP begins with \fB%\fP, it must match at the end +of the expanded value of \fIparameter\fP. +If \fIstring\fP is null, matches of \fIpattern\fP are deleted +and the \fB/\fP following \fIpattern\fP may be omitted. +If +.I parameter +is +.B @ +or +.BR * , +the substitution operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the substitution operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB^\fP\fIpattern\fP} +.PD 0 +.TP +${\fIparameter\fP\fB^^\fP\fIpattern\fP} +.TP +${\fIparameter\fP\fB,\fP\fIpattern\fP} +.TP +${\fIparameter\fP\fB,,\fP\fIpattern\fP} +.PD +\fBCase modification\fP. +This expansion modifies the case of alphabetic characters in \fIparameter\fP. +The \fIpattern\fP is expanded to produce a pattern just as in +pathname expansion. +Each character in the expanded value of \fIparameter\fP is tested against +\fIpattern\fP, and, if it matches the pattern, its case is converted. +The pattern should not attempt to match more than one character. +The \fB^\fP operator converts lowercase letters matching \fIpattern\fP +to uppercase; the \fB,\fP operator converts matching uppercase letters +to lowercase. +The \fB^^\fP and \fB,,\fP expansions convert each matched character in the +expanded value; the \fB^\fP and \fB,\fP expansions match and convert only +the first character in the expanded value. +If \fIpattern\fP is omitted, it is treated like a \fB?\fP, which matches +every character. +If +.I parameter +is +.B @ +or +.BR * , +the case modification operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the case modification operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.SS Command Substitution +.PP +\fICommand substitution\fP allows the output of a command to replace +the command name. There are two forms: +.RS +.PP +\fB$(\fP\fIcommand\fP\|\fB)\fP +.RE +or +.RS +\fB\`\fP\fIcommand\fP\fB\`\fP +.RE +.PP +.B Bash +performs the expansion by executing \fIcommand\fP and +replacing the command substitution with the standard output of the +command, with any trailing newlines deleted. +Embedded newlines are not deleted, but they may be removed during +word splitting. +The command substitution \fB$(cat \fIfile\fP)\fR can be replaced by +the equivalent but faster \fB$(< \fIfile\fP)\fR. +.PP +When the old-style backquote form of substitution is used, +backslash retains its literal meaning except when followed by +.BR $ , +.BR \` , +or +.BR \e . +The first backquote not preceded by a backslash terminates the +command substitution. +When using the $(\^\fIcommand\fP\|) form, all characters between the +parentheses make up the command; none are treated specially. +.PP +Command substitutions may be nested. To nest when using the backquoted form, +escape the inner backquotes with backslashes. +.PP +If the substitution appears within double quotes, word splitting and +pathname expansion are not performed on the results. +.SS Arithmetic Expansion +.PP +Arithmetic expansion allows the evaluation of an arithmetic expression +and the substitution of the result. The format for arithmetic expansion is: +.RS +.PP +\fB$((\fP\fIexpression\fP\fB))\fP +.RE +.PP +The +.I expression +is treated as if it were within double quotes, but a double quote +inside the parentheses is not treated specially. +All tokens in the expression undergo parameter and variable expansion, +command substitution, and quote removal. +The result is treated as the arithmetic expression to be evaluated. +Arithmetic expansions may be nested. +.PP +The evaluation is performed according to the rules listed below under +.SM +.BR "ARITHMETIC EVALUATION" . +If +.I expression +is invalid, +.B bash +prints a message indicating failure and no substitution occurs. +.SS Process Substitution +.PP +\fIProcess substitution\fP is supported on systems that support named +pipes (\fIFIFOs\fP) or the \fB/dev/fd\fP method of naming open files. +It takes the form of +\fB<(\fP\fIlist\^\fP\fB)\fP +or +\fB>(\fP\fIlist\^\fP\fB)\fP. +The process \fIlist\fP is run with its input or output connected to a +\fIFIFO\fP or some file in \fB/dev/fd\fP. The name of this file is +passed as an argument to the current command as the result of the +expansion. If the \fB>(\fP\fIlist\^\fP\fB)\fP form is used, writing to +the file will provide input for \fIlist\fP. If the +\fB<(\fP\fIlist\^\fP\fB)\fP form is used, the file passed as an +argument should be read to obtain the output of \fIlist\fP. +.PP +When available, process substitution is performed +simultaneously with parameter and variable expansion, +command substitution, +and arithmetic expansion. +.SS Word Splitting +.PP +The shell scans the results of +parameter expansion, +command substitution, +and +arithmetic expansion +that did not occur within double quotes for +.IR "word splitting" . +.PP +The shell treats each character of +.SM +.B IFS +as a delimiter, and splits the results of the other +expansions into words using these characters as field terminators. +If +.SM +.B IFS +is unset, or its +value is exactly +.BR , +the default, then +sequences of +.BR , +.BR , +and +.B +at the beginning and end of the results of the previous +expansions are ignored, and +any sequence of +.SM +.B IFS +characters not at the beginning or end serves to delimit words. +If +.SM +.B IFS +has a value other than the default, then sequences of +the whitespace characters +.B space +and +.B tab +are ignored at the beginning and end of the +word, as long as the whitespace character is in the +value of +.SM +.BR IFS +(an +.SM +.B IFS +whitespace character). +Any character in +.SM +.B IFS +that is not +.SM +.B IFS +whitespace, along with any adjacent +.SM +.B IFS +whitespace characters, delimits a field. +A sequence of +.SM +.B IFS +whitespace characters is also treated as a delimiter. +If the value of +.SM +.B IFS +is null, no word splitting occurs. +.PP +Explicit null arguments (\^\f3"\^"\fP or \^\f3\(aq\^\(aq\fP\^) are retained. +Unquoted implicit null arguments, resulting from the expansion of +parameters that have no values, are removed. +If a parameter with no value is expanded within double quotes, a +null argument results and is retained. +.PP +Note that if no expansion occurs, no splitting +is performed. +.SS Pathname Expansion +.PP +After word splitting, +unless the +.B \-f +option has been set, +.B bash +scans each word for the characters +.BR * , +.BR ? , +and +.BR [ . +If one of these characters appears, then the word is +regarded as a +.IR pattern , +and replaced with an alphabetically sorted list of +filenames matching the pattern +(see +.SM +.B "Pattern Matching" +below). +If no matching filenames are found, +and the shell option +.B nullglob +is not enabled, the word is left unchanged. +If the +.B nullglob +option is set, and no matches are found, +the word is removed. +If the +.B failglob +shell option is set, and no matches are found, an error message +is printed and the command is not executed. +If the shell option +.B nocaseglob +is enabled, the match is performed without regard to the case +of alphabetic characters. +When a pattern is used for pathname expansion, +the character +.B ``.'' +at the start of a name or immediately following a slash +must be matched explicitly, unless the shell option +.B dotglob +is set. +When matching a pathname, the slash character must always be +matched explicitly. +In other cases, the +.B ``.'' +character is not treated specially. +See the description of +.B shopt +below under +.SM +.B SHELL BUILTIN COMMANDS +for a description of the +.BR nocaseglob , +.BR nullglob , +.BR failglob , +and +.B dotglob +shell options. +.PP +The +.SM +.B GLOBIGNORE +shell variable may be used to restrict the set of filenames matching a +.IR pattern . +If +.SM +.B GLOBIGNORE +is set, each matching filename that also matches one of the patterns in +.SM +.B GLOBIGNORE +is removed from the list of matches. +The filenames +.B ``.'' +and +.B ``..'' +are always ignored when +.SM +.B GLOBIGNORE +is set and not null. However, setting +.SM +.B GLOBIGNORE +to a non-null value has the effect of enabling the +.B dotglob +shell option, so all other filenames beginning with a +.B ``.'' +will match. +To get the old behavior of ignoring filenames beginning with a +.BR ``.'' , +make +.B ``.*'' +one of the patterns in +.SM +.BR GLOBIGNORE . +The +.B dotglob +option is disabled when +.SM +.B GLOBIGNORE +is unset. +.PP +\fBPattern Matching\fP +.PP +Any character that appears in a pattern, other than the special pattern +characters described below, matches itself. The NUL character may not +occur in a pattern. A backslash escapes the following character; the +escaping backslash is discarded when matching. +The special pattern characters must be quoted if +they are to be matched literally. +.PP +The special pattern characters have the following meanings: +.PP +.PD 0 +.RS +.TP +.B * +Matches any string, including the null string. +When the \fBglobstar\fP shell option is enabled, and \fB*\fP is used in +a pathname expansion context, two adjacent \fB*\fPs used as a single +pattern will match all files and zero or more directories and +subdirectories. +If followed by a \fB/\fP, two adjacent \fB*\fPs will match only directories +and subdirectories. +.TP +.B ? +Matches any single character. +.TP +.B [...] +Matches any one of the enclosed characters. A pair of characters +separated by a hyphen denotes a +\fIrange expression\fP; +any character that falls between those two characters, inclusive, +using the current locale's collating sequence and character set, +is matched. If the first character following the +.B [ +is a +.B ! +or a +.B ^ +then any character not enclosed is matched. +The sorting order of characters in range expressions is determined by +the current locale and the values of the +.SM +.B LC_COLLATE +or +.SM +.B LC_ALL +shell variables, if set. +To obtain the traditional interpretation of range expressions, where +.B [a\-d] +is equivalent to +.BR [abcd] , +set value of the +.B LC_ALL +shell variable to +.BR C , +or enable the +.B globasciiranges +shell option. +A +.B \- +may be matched by including it as the first or last character +in the set. +A +.B ] +may be matched by including it as the first character +in the set. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +\fIcharacter classes\fP can be specified using the syntax +\fB[:\fP\fIclass\fP\fB:]\fP, where \fIclass\fP is one of the +following classes defined in the POSIX standard: +.PP +.RS +.B +.if n alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit +.if t alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit +.br +A character class matches any character belonging to that class. +The \fBword\fP character class matches letters, digits, and the character _. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +an \fIequivalence class\fP can be specified using the syntax +\fB[=\fP\fIc\fP\fB=]\fP, which matches all characters with the +same collation weight (as defined by the current locale) as +the character \fIc\fP. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +the syntax \fB[.\fP\fIsymbol\fP\fB.]\fP matches the collating symbol +\fIsymbol\fP. +.RE +.RE +.PD +.PP +If the \fBextglob\fP shell option is enabled using the \fBshopt\fP +builtin, several extended pattern matching operators are recognized. +In the following description, a \fIpattern-list\fP is a list of one +or more patterns separated by a \fB|\fP. +Composite patterns may be formed using one or more of the following +sub-patterns: +.sp 1 +.PD 0 +.RS +.TP +\fB?(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches zero or one occurrence of the given patterns +.TP +\fB*(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches zero or more occurrences of the given patterns +.TP +\fB+(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches one or more occurrences of the given patterns +.TP +\fB@(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches one of the given patterns +.TP +\fB!(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches anything except one of the given patterns +.RE +.PD +.SS Quote Removal +.PP +After the preceding expansions, all unquoted occurrences of the +characters +.BR \e , +.BR \(aq , +and \^\f3"\fP\^ that did not result from one of the above +expansions are removed. +.SH REDIRECTION +Before a command is executed, its input and output +may be +.I redirected +using a special notation interpreted by the shell. +Redirection allows commands' file handles to be +duplicated, opened, closed, +made to refer to different files, +and can change the files the command reads from and writes to. +Redirection may also be used to modify file handles in the +current shell execution environment. +The following redirection +operators may precede or appear anywhere within a +.I simple command +or may follow a +.IR command . +Redirections are processed in the order they appear, from +left to right. +.PP +Each redirection that may be preceded by a file descriptor number +may instead be preceded by a word of the form {\fIvarname\fP}. +In this case, for each redirection operator except +>&- and <&-, the shell will allocate a file descriptor greater +than or equal to 10 and assign it to \fIvarname\fP. +If >&- or <&- is preceded +by {\fIvarname\fP}, the value of \fIvarname\fP defines the file +descriptor to close. +.PP +In the following descriptions, if the file descriptor number is +omitted, and the first character of the redirection operator is +.BR < , +the redirection refers to the standard input (file descriptor +0). If the first character of the redirection operator is +.BR > , +the redirection refers to the standard output (file descriptor +1). +.PP +The word following the redirection operator in the following +descriptions, unless otherwise noted, is subjected to +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, quote removal, +pathname expansion, and word splitting. +If it expands to more than one word, +.B bash +reports an error. +.PP +Note that the order of redirections is significant. For example, +the command +.RS +.PP +ls \fB>\fP dirlist 2\fB>&\fP1 +.RE +.PP +directs both standard output and standard error to the file +.IR dirlist , +while the command +.RS +.PP +ls 2\fB>&\fP1 \fB>\fP dirlist +.RE +.PP +directs only the standard output to file +.IR dirlist , +because the standard error was duplicated from the standard output +before the standard output was redirected to +.IR dirlist . +.PP +\fBBash\fP handles several filenames specially when they are used in +redirections, as described in the following table: +.RS +.PP +.PD 0 +.TP +.B /dev/fd/\fIfd\fP +If \fIfd\fP is a valid integer, file descriptor \fIfd\fP is duplicated. +.TP +.B /dev/stdin +File descriptor 0 is duplicated. +.TP +.B /dev/stdout +File descriptor 1 is duplicated. +.TP +.B /dev/stderr +File descriptor 2 is duplicated. +.TP +.B /dev/tcp/\fIhost\fP/\fIport\fP +If \fIhost\fP is a valid hostname or Internet address, and \fIport\fP +is an integer port number or service name, \fBbash\fP attempts to open +the corresponding TCP socket. +.TP +.B /dev/udp/\fIhost\fP/\fIport\fP +If \fIhost\fP is a valid hostname or Internet address, and \fIport\fP +is an integer port number or service name, \fBbash\fP attempts to open +the corresponding UDP socket. +.PD +.RE +.PP +A failure to open or create a file causes the redirection to fail. +.PP +Redirections using file descriptors greater than 9 should be used with +care, as they may conflict with file descriptors the shell uses +internally. +.SS Redirecting Input +.PP +Redirection of input causes the file whose name results from +the expansion of +.I word +to be opened for reading on file descriptor +.IR n , +or the standard input (file descriptor 0) if +.I n +is not specified. +.PP +The general format for redirecting input is: +.RS +.PP +[\fIn\fP]\fB<\fP\fIword\fP +.RE +.SS Redirecting Output +.PP +Redirection of output causes the file whose name results from +the expansion of +.I word +to be opened for writing on file descriptor +.IR n , +or the standard output (file descriptor 1) if +.I n +is not specified. If the file does not exist it is created; +if it does exist it is truncated to zero size. +.PP +The general format for redirecting output is: +.RS +.PP +[\fIn\fP]\fB>\fP\fIword\fP +.RE +.PP +If the redirection operator is +.BR > , +and the +.B noclobber +option to the +.B set +builtin has been enabled, the redirection will fail if the file +whose name results from the expansion of \fIword\fP exists and is +a regular file. +If the redirection operator is +.BR >| , +or the redirection operator is +.B > +and the +.B noclobber +option to the +.B set +builtin command is not enabled, the redirection is attempted even +if the file named by \fIword\fP exists. +.SS Appending Redirected Output +.PP +Redirection of output in this fashion +causes the file whose name results from +the expansion of +.I word +to be opened for appending on file descriptor +.IR n , +or the standard output (file descriptor 1) if +.I n +is not specified. If the file does not exist it is created. +.PP +The general format for appending output is: +.RS +.PP +[\fIn\fP]\fB>>\fP\fIword\fP +.RE +.PP +.SS Redirecting Standard Output and Standard Error +.PP +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be redirected to the file whose name is the +expansion of +.IR word . +.PP +There are two formats for redirecting standard output and +standard error: +.RS +.PP +\fB&>\fP\fIword\fP +.RE +and +.RS +\fB>&\fP\fIword\fP +.RE +.PP +Of the two forms, the first is preferred. +This is semantically equivalent to +.RS +.PP +\fB>\fP\fIword\fP 2\fB>&\fP1 +.RE +.PP +When using the second form, \fIword\fP may not expand to a number or +\fB\-\fP. If it does, other redirection operators apply +(see \fBDuplicating File Descriptors\fP below) for compatibility +reasons. +.SS Appending Standard Output and Standard Error +.PP +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be appended to the file whose name is the +expansion of +.IR word . +.PP +The format for appending standard output and standard error is: +.RS +.PP +\fB&>>\fP\fIword\fP +.RE +.PP +This is semantically equivalent to +.RS +.PP +\fB>>\fP\fIword\fP 2\fB>&\fP1 +.RE +.PP +(see \fBDuplicating File Descriptors\fP below). +.SS Here Documents +.PP +This type of redirection instructs the shell to read input from the +current source until a line containing only +.I delimiter +(with no trailing blanks) +is seen. All of +the lines read up to that point are then used as the standard +input for a command. +.PP +The format of here-documents is: +.RS +.PP +.nf +\fB<<\fP[\fB\-\fP]\fIword\fP + \fIhere-document\fP +\fIdelimiter\fP +.fi +.RE +.PP +No parameter and variable expansion, command substitution, +arithmetic expansion, or pathname expansion is performed on +.IR word . +If any characters in +.I word +are quoted, the +.I delimiter +is the result of quote removal on +.IR word , +and the lines in the here-document are not expanded. +If \fIword\fP is unquoted, +all lines of the here-document are subjected to +parameter expansion, command substitution, and arithmetic expansion, +the character sequence +.B \e +is ignored, and +.B \e +must be used to quote the characters +.BR \e , +.BR $ , +and +.BR \` . +.PP +If the redirection operator is +.BR <<\- , +then all leading tab characters are stripped from input lines and the +line containing +.IR delimiter . +This allows +here-documents within shell scripts to be indented in a +natural fashion. +.SS "Here Strings" +A variant of here documents, the format is: +.RS +.PP +.nf +\fB<<<\fP\fIword\fP +.fi +.RE +.PP +The \fIword\fP undergoes +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote removal. +Pathname expansion and word splitting are not performed. +The result is supplied as a single string to the command on its +standard input. +.SS "Duplicating File Descriptors" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<&\fP\fIword\fP +.RE +.PP +is used to duplicate input file descriptors. +If +.I word +expands to one or more digits, the file descriptor denoted by +.I n +is made to be a copy of that file descriptor. +If the digits in +.I word +do not specify a file descriptor open for input, a redirection error occurs. +If +.I word +evaluates to +.BR \- , +file descriptor +.I n +is closed. If +.I n +is not specified, the standard input (file descriptor 0) is used. +.PP +The operator +.RS +.PP +[\fIn\fP]\fB>&\fP\fIword\fP +.RE +.PP +is used similarly to duplicate output file descriptors. If +.I n +is not specified, the standard output (file descriptor 1) is used. +If the digits in +.I word +do not specify a file descriptor open for output, a redirection error occurs. +If +.I word +evaluates to +.BR \- , +file descriptor +.I n +is closed. +As a special case, if \fIn\fP is omitted, and \fIword\fP does not +expand to one or more digits or \fB\-\fP, the standard output and standard +error are redirected as described previously. +.SS "Moving File Descriptors" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<&\fP\fIdigit\fP\fB\-\fP +.RE +.PP +moves the file descriptor \fIdigit\fP to file descriptor +.IR n , +or the standard input (file descriptor 0) if \fIn\fP is not specified. +\fIdigit\fP is closed after being duplicated to \fIn\fP. +.PP +Similarly, the redirection operator +.RS +.PP +[\fIn\fP]\fB>&\fP\fIdigit\fP\fB\-\fP +.RE +.PP +moves the file descriptor \fIdigit\fP to file descriptor +.IR n , +or the standard output (file descriptor 1) if \fIn\fP is not specified. +.SS "Opening File Descriptors for Reading and Writing" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<>\fP\fIword\fP +.RE +.PP +causes the file whose name is the expansion of +.I word +to be opened for both reading and writing on file descriptor +.IR n , +or on file descriptor 0 if +.I n +is not specified. If the file does not exist, it is created. +.SH ALIASES +\fIAliases\fP allow a string to be substituted for a word when it is used +as the first word of a simple command. +The shell maintains a list of aliases that may be set and unset with the +.B alias +and +.B unalias +builtin commands (see +.SM +.B SHELL BUILTIN COMMANDS +below). +The first word of each simple command, if unquoted, +is checked to see if it has an +alias. If so, that word is replaced by the text of the alias. +The characters \fB/\fP, \fB$\fP, \fB\`\fP, and \fB=\fP and +any of the shell \fImetacharacters\fP or quoting characters +listed above may not appear in an alias name. +The replacement text may contain any valid shell input, +including shell metacharacters. +The first word of the replacement text is tested +for aliases, but a word that is identical to an alias being expanded +is not expanded a second time. +This means that one may alias +.B ls +to +.BR "ls \-F" , +for instance, and +.B bash +does not try to recursively expand the replacement text. +If the last character of the alias value is a +.IR blank , +then the next command +word following the alias is also checked for alias expansion. +.PP +Aliases are created and listed with the +.B alias +command, and removed with the +.B unalias +command. +.PP +There is no mechanism for using arguments in the replacement text. +If arguments are needed, a shell function should be used (see +.SM +.B FUNCTIONS +below). +.PP +Aliases are not expanded when the shell is not interactive, unless +the +.B expand_aliases +shell option is set using +.B shopt +(see the description of +.B shopt +under +.SM +\fBSHELL BUILTIN COMMANDS\fP +below). +.PP +The rules concerning the definition and use of aliases are +somewhat confusing. +.B Bash +always reads at least one complete line +of input before executing any +of the commands on that line. Aliases are expanded when a +command is read, not when it is executed. Therefore, an +alias definition appearing on the same line as another +command does not take effect until the next line of input is read. +The commands following the alias definition +on that line are not affected by the new alias. +This behavior is also an issue when functions are executed. +Aliases are expanded when a function definition is read, +not when the function is executed, because a function definition +is itself a compound command. As a consequence, aliases +defined in a function are not available until after that +function is executed. To be safe, always put +alias definitions on a separate line, and do not use +.B alias +in compound commands. +.PP +For almost every purpose, aliases are superseded by +shell functions. +.SH FUNCTIONS +A shell function, defined as described above under +.SM +.BR "SHELL GRAMMAR" , +stores a series of commands for later execution. +When the name of a shell function is used as a simple command name, +the list of commands associated with that function name is executed. +Functions are executed in the context of the +current shell; no new process is created to interpret +them (contrast this with the execution of a shell script). +When a function is executed, the arguments to the +function become the positional parameters +during its execution. +The special parameter +.B # +is updated to reflect the change. Special parameter \fB0\fP +is unchanged. +The first element of the +.SM +.B FUNCNAME +variable is set to the name of the function while the function +is executing. +.PP +All other aspects of the shell execution +environment are identical between a function and its caller +with these exceptions: the +.SM +.B DEBUG +and +.B RETURN +traps (see the description of the +.B trap +builtin under +.SM +.B SHELL BUILTIN COMMANDS +below) are not inherited unless the function has been given the +\fBtrace\fP attribute (see the description of the +.SM +.B declare +builtin below) or the +\fB\-o functrace\fP shell option has been enabled with +the \fBset\fP builtin +(in which case all functions inherit the \fBDEBUG\fP and \fBRETURN\fP traps), +and the +.SM +.B ERR +trap is not inherited unless the \fB\-o errtrace\fP shell option has +been enabled. +.PP +Variables local to the function may be declared with the +.B local +builtin command. Ordinarily, variables and their values +are shared between the function and its caller. +.PP +The \fBFUNCNEST\fP variable, if set to a numeric value greater +than 0, defines a maximum function nesting level. Function +invocations that exceed the limit cause the entire command to +abort. +.PP +If the builtin command +.B return +is executed in a function, the function completes and +execution resumes with the next command after the function +call. +Any command associated with the \fBRETURN\fP trap is executed +before execution resumes. +When a function completes, the values of the +positional parameters and the special parameter +.B # +are restored to the values they had prior to the function's +execution. +.PP +Function names and definitions may be listed with the +.B \-f +option to the +.B declare +or +.B typeset +builtin commands. The +.B \-F +option to +.B declare +or +.B typeset +will list the function names only +(and optionally the source file and line number, if the \fBextdebug\fP +shell option is enabled). +Functions may be exported so that subshells +automatically have them defined with the +.B \-f +option to the +.B export +builtin. +A function definition may be deleted using the \fB\-f\fP option to +the +.B unset +builtin. +Note that shell functions and variables with the same name may result +in multiple identically-named entries in the environment passed to the +shell's children. +Care should be taken in cases where this may cause a problem. +.PP +Functions may be recursive. +The \fBFUNCNEST\fP variable may be used to limit the depth of the +function call stack and restrict the number of function invocations. +By default, no limit is imposed on the number of recursive calls. +.SH "ARITHMETIC EVALUATION" +The shell allows arithmetic expressions to be evaluated, under +certain circumstances (see the \fBlet\fP and \fBdeclare\fP builtin +commands and \fBArithmetic Expansion\fP). +Evaluation is done in fixed-width integers with no check for overflow, +though division by 0 is trapped and flagged as an error. +The operators and their precedence, associativity, and values +are the same as in the C language. +The following list of operators is grouped into levels of +equal-precedence operators. +The levels are listed in order of decreasing precedence. +.PP +.PD 0 +.TP +.B \fIid\fP++ \fIid\fP\-\- +variable post-increment and post-decrement +.TP +.B ++\fIid\fP \-\-\fIid\fP +variable pre-increment and pre-decrement +.TP +.B \- + +unary minus and plus +.TP +.B ! ~ +logical and bitwise negation +.TP +.B ** +exponentiation +.TP +.B * / % +multiplication, division, remainder +.TP +.B + \- +addition, subtraction +.TP +.B << >> +left and right bitwise shifts +.TP +.B <= >= < > +comparison +.TP +.B == != +equality and inequality +.TP +.B & +bitwise AND +.TP +.B ^ +bitwise exclusive OR +.TP +.B | +bitwise OR +.TP +.B && +logical AND +.TP +.B || +logical OR +.TP +.B \fIexpr\fP?\fIexpr\fP:\fIexpr\fP +conditional operator +.TP +.B = *= /= %= += \-= <<= >>= &= ^= |= +assignment +.TP +.B \fIexpr1\fP , \fIexpr2\fP +comma +.PD +.PP +Shell variables are allowed as operands; parameter expansion is +performed before the expression is evaluated. +Within an expression, shell variables may also be referenced by name +without using the parameter expansion syntax. +A shell variable that is null or unset evaluates to 0 when referenced +by name without using the parameter expansion syntax. +The value of a variable is evaluated as an arithmetic expression +when it is referenced, or when a variable which has been given the +\fIinteger\fP attribute using \fBdeclare -i\fP is assigned a value. +A null value evaluates to 0. +A shell variable need not have its \fIinteger\fP attribute +turned on to be used in an expression. +.PP +Constants with a leading 0 are interpreted as octal numbers. +A leading 0x or 0X denotes hexadecimal. +Otherwise, numbers take the form [\fIbase#\fP]n, where the optional \fIbase\fP +is a decimal number between 2 and 64 representing the arithmetic +base, and \fIn\fP is a number in that base. +If \fIbase#\fP is omitted, then base 10 is used. +When specifying \fIn\fP, +the digits greater< than 9 are represented by the lowercase letters, +the uppercase letters, @, and _, in that order. +If \fIbase\fP is less than or equal to 36, lowercase and uppercase +letters may be used interchangeably to represent numbers between 10 +and 35. +.PP +Operators are evaluated in order of precedence. Sub-expressions in +parentheses are evaluated first and may override the precedence +rules above. +.SH "CONDITIONAL EXPRESSIONS" +Conditional expressions are used by the \fB[[\fP compound command and +the \fBtest\fP and \fB[\fP builtin commands to test file attributes +and perform string and arithmetic comparisons. +Expressions are formed from the following unary or binary primaries. +If any \fIfile\fP argument to one of the primaries is of the form +\fI/dev/fd/n\fP, then file descriptor \fIn\fP is checked. +If the \fIfile\fP argument to one of the primaries is one of +\fI/dev/stdin\fP, \fI/dev/stdout\fP, or \fI/dev/stderr\fP, file +descriptor 0, 1, or 2, respectively, is checked. +.PP +Unless otherwise specified, primaries that operate on files follow symbolic +links and operate on the target of the link, rather than the link itself. +.if t .sp 0.5 +.if n .sp 1 +When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort +lexicographically using the current locale. +The \fBtest\fP command sorts using ASCII ordering. +.sp 1 +.PD 0 +.TP +.B \-a \fIfile\fP +True if \fIfile\fP exists. +.TP +.B \-b \fIfile\fP +True if \fIfile\fP exists and is a block special file. +.TP +.B \-c \fIfile\fP +True if \fIfile\fP exists and is a character special file. +.TP +.B \-d \fIfile\fP +True if \fIfile\fP exists and is a directory. +.TP +.B \-e \fIfile\fP +True if \fIfile\fP exists. +.TP +.B \-f \fIfile\fP +True if \fIfile\fP exists and is a regular file. +.TP +.B \-g \fIfile\fP +True if \fIfile\fP exists and is set-group-id. +.TP +.B \-h \fIfile\fP +True if \fIfile\fP exists and is a symbolic link. +.TP +.B \-k \fIfile\fP +True if \fIfile\fP exists and its ``sticky'' bit is set. +.TP +.B \-p \fIfile\fP +True if \fIfile\fP exists and is a named pipe (FIFO). +.TP +.B \-r \fIfile\fP +True if \fIfile\fP exists and is readable. +.TP +.B \-s \fIfile\fP +True if \fIfile\fP exists and has a size greater than zero. +.TP +.B \-t \fIfd\fP +True if file descriptor +.I fd +is open and refers to a terminal. +.TP +.B \-u \fIfile\fP +True if \fIfile\fP exists and its set-user-id bit is set. +.TP +.B \-w \fIfile\fP +True if \fIfile\fP exists and is writable. +.TP +.B \-x \fIfile\fP +True if \fIfile\fP exists and is executable. +.TP +.B \-G \fIfile\fP +True if \fIfile\fP exists and is owned by the effective group id. +.TP +.B \-L \fIfile\fP +True if \fIfile\fP exists and is a symbolic link. +.TP +.B \-N \fIfile\fP +True if \fIfile\fP exists and has been modified since it was last read. +.TP +.B \-O \fIfile\fP +True if \fIfile\fP exists and is owned by the effective user id. +.TP +.B \-S \fIfile\fP +True if \fIfile\fP exists and is a socket. +.TP +\fIfile1\fP \fB\-ef\fP \fIfile2\fP +True if \fIfile1\fP and \fIfile2\fP refer to the same device and +inode numbers. +.TP +\fIfile1\fP \-\fBnt\fP \fIfile2\fP +True if \fIfile1\fP is newer (according to modification date) than \fIfile2\fP, +or if \fIfile1\fP exists and \fPfile2\fP does not. +.TP +\fIfile1\fP \-\fBot\fP \fIfile2\fP +True if \fIfile1\fP is older than \fIfile2\fP, or if \fIfile2\fP exists +and \fIfile1\fP does not. +.TP +.B \-o \fIoptname\fP +True if the shell option +.I optname +is enabled. +See the list of options under the description of the +.B \-o +option to the +.B set +builtin below. +.TP +.B \-v \fIvarname\fP +True if the shell variable +.I varname +is set (has been assigned a value). +.TP +.B \-R \fIvarname\fP +True if the shell variable +.I varname +is set and is a name reference. +.TP +.B \-z \fIstring\fP +True if the length of \fIstring\fP is zero. +.TP +\fIstring\fP +.PD 0 +.TP +.B \-n \fIstring\fP +.PD +True if the length of +.I string +is non-zero. +.TP +\fIstring1\fP \fB==\fP \fIstring2\fP +.PD 0 +.TP +\fIstring1\fP \fB=\fP \fIstring2\fP +.PD +True if the strings are equal. \fB=\fP should be used +with the \fBtest\fP command for POSIX conformance. +When used with the \fB[[\fP command, this performs pattern matching as +described above (\fBCompound Commands\fP). +.TP +\fIstring1\fP \fB!=\fP \fIstring2\fP +True if the strings are not equal. +.TP +\fIstring1\fP \fB<\fP \fIstring2\fP +True if \fIstring1\fP sorts before \fIstring2\fP lexicographically. +.TP +\fIstring1\fP \fB>\fP \fIstring2\fP +True if \fIstring1\fP sorts after \fIstring2\fP lexicographically. +.TP +.I \fIarg1\fP \fBOP\fP \fIarg2\fP +.SM +.B OP +is one of +.BR \-eq , +.BR \-ne , +.BR \-lt , +.BR \-le , +.BR \-gt , +or +.BR \-ge . +These arithmetic binary operators return true if \fIarg1\fP +is equal to, not equal to, less than, less than or equal to, +greater than, or greater than or equal to \fIarg2\fP, respectively. +.I Arg1 +and +.I arg2 +may be positive or negative integers. +.PD +.SH "SIMPLE COMMAND EXPANSION" +When a simple command is executed, the shell performs the following +expansions, assignments, and redirections, from left to right. +.IP 1. +The words that the parser has marked as variable assignments (those +preceding the command name) and redirections are saved for later +processing. +.IP 2. +The words that are not variable assignments or redirections are +expanded. If any words remain after expansion, the first word +is taken to be the name of the command and the remaining words are +the arguments. +.IP 3. +Redirections are performed as described above under +.SM +.BR REDIRECTION . +.IP 4. +The text after the \fB=\fP in each variable assignment undergoes tilde +expansion, parameter expansion, command substitution, arithmetic expansion, +and quote removal before being assigned to the variable. +.PP +If no command name results, the variable assignments affect the current +shell environment. Otherwise, the variables are added to the environment +of the executed command and do not affect the current shell environment. +If any of the assignments attempts to assign a value to a readonly variable, +an error occurs, and the command exits with a non-zero status. +.PP +If no command name results, redirections are performed, but do not +affect the current shell environment. A redirection error causes the +command to exit with a non-zero status. +.PP +If there is a command name left after expansion, execution proceeds as +described below. Otherwise, the command exits. If one of the expansions +contained a command substitution, the exit status of the command is +the exit status of the last command substitution performed. If there +were no command substitutions, the command exits with a status of zero. +.SH "COMMAND EXECUTION" +After a command has been split into words, if it results in a +simple command and an optional list of arguments, the following +actions are taken. +.PP +If the command name contains no slashes, the shell attempts to +locate it. If there exists a shell function by that name, that +function is invoked as described above in +.SM +.BR FUNCTIONS . +If the name does not match a function, the shell searches for +it in the list of shell builtins. If a match is found, that +builtin is invoked. +.PP +If the name is neither a shell function nor a builtin, +and contains no slashes, +.B bash +searches each element of the +.SM +.B PATH +for a directory containing an executable file by that name. +.B Bash +uses a hash table to remember the full pathnames of executable +files (see +.B hash +under +.SM +.B "SHELL BUILTIN COMMANDS" +below). +A full search of the directories in +.SM +.B PATH +is performed only if the command is not found in the hash table. +If the search is unsuccessful, the shell searches for a defined shell +function named \fBcommand_not_found_handle\fP. +If that function exists, it is invoked with the original command and +the original command's arguments as its arguments, and the function's +exit status becomes the exit status of the shell. +If that function is not defined, the shell prints an error +message and returns an exit status of 127. +.PP +If the search is successful, or if the command name contains +one or more slashes, the shell executes the named program in a +separate execution environment. +Argument 0 is set to the name given, and the remaining arguments +to the command are set to the arguments given, if any. +.PP +If this execution fails because the file is not in executable +format, and the file is not a directory, it is assumed to be +a \fIshell script\fP, a file +containing shell commands. A subshell is spawned to execute +it. This subshell reinitializes itself, so +that the effect is as if a new shell had been invoked +to handle the script, with the exception that the locations of +commands remembered by the parent (see +.B hash +below under +.SM +\fBSHELL BUILTIN COMMANDS\fP) +are retained by the child. +.PP +If the program is a file beginning with +.BR #! , +the remainder of the first line specifies an interpreter +for the program. The shell executes the +specified interpreter on operating systems that do not +handle this executable format themselves. The arguments to the +interpreter consist of a single optional argument following the +interpreter name on the first line of the program, followed +by the name of the program, followed by the command +arguments, if any. +.SH COMMAND EXECUTION ENVIRONMENT +The shell has an \fIexecution environment\fP, which consists of the +following: +.IP \(bu +open files inherited by the shell at invocation, as modified by +redirections supplied to the \fBexec\fP builtin +.IP \(bu +the current working directory as set by \fBcd\fP, \fBpushd\fP, or +\fBpopd\fP, or inherited by the shell at invocation +.IP \(bu +the file creation mode mask as set by \fBumask\fP or inherited from +the shell's parent +.IP \(bu +current traps set by \fBtrap\fP +.IP \(bu +shell parameters that are set by variable assignment or with \fBset\fP +or inherited from the shell's parent in the environment +.IP \(bu +shell functions defined during execution or inherited from the shell's +parent in the environment +.IP \(bu +options enabled at invocation (either by default or with command-line +arguments) or by \fBset\fP +.IP \(bu +options enabled by \fBshopt\fP +.IP \(bu +shell aliases defined with \fBalias\fP +.IP \(bu +various process IDs, including those of background jobs, the value +of \fB$$\fP, and the value of +.SM +.B PPID +.PP +When a simple command other than a builtin or shell function +is to be executed, it +is invoked in a separate execution environment that consists of +the following. Unless otherwise noted, the values are inherited +from the shell. +.if n .sp 1 +.IP \(bu +the shell's open files, plus any modifications and additions specified +by redirections to the command +.IP \(bu +the current working directory +.IP \(bu +the file creation mode mask +.IP \(bu +shell variables and functions marked for export, along with variables +exported for the command, passed in the environment +.IP \(bu +traps caught by the shell are reset to the values inherited from the +shell's parent, and traps ignored by the shell are ignored +.PP +A command invoked in this separate environment cannot affect the +shell's execution environment. +.PP +Command substitution, commands grouped with parentheses, +and asynchronous commands are invoked in a +subshell environment that is a duplicate of the shell environment, +except that traps caught by the shell are reset to the values +that the shell inherited from its parent at invocation. Builtin +commands that are invoked as part of a pipeline are also executed in a +subshell environment. Changes made to the subshell environment +cannot affect the shell's execution environment. +.PP +Subshells spawned to execute command substitutions inherit the value of +the \fB\-e\fP option from the parent shell. When not in \fIposix\fP mode, +\fBbash\fP clears the \fB\-e\fP option in such subshells. +.PP +If a command is followed by a \fB&\fP and job control is not active, the +default standard input for the command is the empty file \fI/dev/null\fP. +Otherwise, the invoked command inherits the file descriptors of the calling +shell as modified by redirections. +.SH ENVIRONMENT +When a program is invoked it is given an array of strings +called the +.IR environment . +This is a list of +\fIname\fP\-\fIvalue\fP pairs, of the form +.IR "name\fR=\fPvalue" . +.PP +The shell provides several ways to manipulate the environment. +On invocation, the shell scans its own environment and +creates a parameter for each name found, automatically marking +it for +.I export +to child processes. Executed commands inherit the environment. +The +.B export +and +.B declare \-x +commands allow parameters and functions to be added to and +deleted from the environment. If the value of a parameter +in the environment is modified, the new value becomes part +of the environment, replacing the old. The environment +inherited by any executed command consists of the shell's +initial environment, whose values may be modified in the shell, +less any pairs removed by the +.B unset +command, plus any additions via the +.B export +and +.B declare \-x +commands. +.PP +The environment for any +.I simple command +or function may be augmented temporarily by prefixing it with +parameter assignments, as described above in +.SM +.BR PARAMETERS . +These assignment statements affect only the environment seen +by that command. +.PP +If the +.B \-k +option is set (see the +.B set +builtin command below), then +.I all +parameter assignments are placed in the environment for a command, +not just those that precede the command name. +.PP +When +.B bash +invokes an external command, the variable +.B _ +is set to the full filename of the command and passed to that +command in its environment. +.SH "EXIT STATUS" +.PP +The exit status of an executed command is the value returned by the +\fIwaitpid\fP system call or equivalent function. Exit statuses +fall between 0 and 255, though, as explained below, the shell may +use values above 125 specially. Exit statuses from shell builtins and +compound commands are also limited to this range. Under certain +circumstances, the shell will use special values to indicate specific +failure modes. +.PP +For the shell's purposes, a command which exits with a +zero exit status has succeeded. An exit status of zero +indicates success. A non-zero exit status indicates failure. +When a command terminates on a fatal signal \fIN\fP, \fBbash\fP uses +the value of 128+\fIN\fP as the exit status. +.PP +If a command is not found, the child process created to +execute it returns a status of 127. If a command is found +but is not executable, the return status is 126. +.PP +If a command fails because of an error during expansion or redirection, +the exit status is greater than zero. +.PP +Shell builtin commands return a status of 0 (\fItrue\fP) if +successful, and non-zero (\fIfalse\fP) if an error occurs +while they execute. +All builtins return an exit status of 2 to indicate incorrect usage. +.PP +\fBBash\fP itself returns the exit status of the last command +executed, unless a syntax error occurs, in which case it exits +with a non-zero value. See also the \fBexit\fP builtin +command below. +.SH SIGNALS +When \fBbash\fP is interactive, in the absence of any traps, it ignores +.SM +.B SIGTERM +(so that \fBkill 0\fP does not kill an interactive shell), +and +.SM +.B SIGINT +is caught and handled (so that the \fBwait\fP builtin is interruptible). +In all cases, \fBbash\fP ignores +.SM +.BR SIGQUIT . +If job control is in effect, +.B bash +ignores +.SM +.BR SIGTTIN , +.SM +.BR SIGTTOU , +and +.SM +.BR SIGTSTP . +.PP +Non-builtin commands run by \fBbash\fP have signal handlers +set to the values inherited by the shell from its parent. +When job control is not in effect, asynchronous commands +ignore +.SM +.B SIGINT +and +.SM +.B SIGQUIT +in addition to these inherited handlers. +Commands run as a result of command substitution ignore the +keyboard-generated job control signals +.SM +.BR SIGTTIN , +.SM +.BR SIGTTOU , +and +.SM +.BR SIGTSTP . +.PP +The shell exits by default upon receipt of a +.SM +.BR SIGHUP . +Before exiting, an interactive shell resends the +.SM +.B SIGHUP +to all jobs, running or stopped. +Stopped jobs are sent +.SM +.B SIGCONT +to ensure that they receive the +.SM +.BR SIGHUP . +To prevent the shell from +sending the signal to a particular job, it should be removed from the +jobs table with the +.B disown +builtin (see +.SM +.B "SHELL BUILTIN COMMANDS" +below) or marked +to not receive +.SM +.B SIGHUP +using +.BR "disown \-h" . +.PP +If the +.B huponexit +shell option has been set with +.BR shopt , +.B bash +sends a +.SM +.B SIGHUP +to all jobs when an interactive login shell exits. +.PP +If \fBbash\fP is waiting for a command to complete and receives a signal +for which a trap has been set, the trap will not be executed until +the command completes. +When \fBbash\fP is waiting for an asynchronous command via the \fBwait\fP +builtin, the reception of a signal for which a trap has been set will +cause the \fBwait\fP builtin to return immediately with an exit status +greater than 128, immediately after which the trap is executed. +.SH "JOB CONTROL" +.I Job control +refers to the ability to selectively stop (\fIsuspend\fP) +the execution of processes and continue (\fIresume\fP) +their execution at a later point. A user typically employs +this facility via an interactive interface supplied jointly +by the operating system kernel's terminal driver and +.BR bash . +.PP +The shell associates a +.I job +with each pipeline. It keeps a table of currently executing +jobs, which may be listed with the +.B jobs +command. When +.B bash +starts a job asynchronously (in the +.IR background ), +it prints a line that looks like: +.RS +.PP +[1] 25647 +.RE +.PP +indicating that this job is job number 1 and that the process ID +of the last process in the pipeline associated with this job is 25647. +All of the processes in a single pipeline are members of the same job. +.B Bash +uses the +.I job +abstraction as the basis for job control. +.PP +To facilitate the implementation of the user interface to job +control, the operating system maintains the notion of a \fIcurrent terminal +process group ID\fP. Members of this process group (processes whose +process group ID is equal to the current terminal process group ID) +receive keyboard-generated signals such as +.SM +.BR SIGINT . +These processes are said to be in the +.IR foreground . +.I Background +processes are those whose process group ID differs from the terminal's; +such processes are immune to keyboard-generated signals. +Only foreground processes are allowed to read from or, if the +user so specifies with \f(CWstty tostop\fP, write to the +terminal. +Background processes which attempt to read from (write to when +\f(CWstty tostop\fP is in effect) the +terminal are sent a +.SM +.B SIGTTIN (SIGTTOU) +signal by the kernel's terminal driver, +which, unless caught, suspends the process. +.PP +If the operating system on which +.B bash +is running supports +job control, +.B bash +contains facilities to use it. +Typing the +.I suspend +character (typically +.BR ^Z , +Control-Z) while a process is running +causes that process to be stopped and returns control to +.BR bash . +Typing the +.I "delayed suspend" +character (typically +.BR ^Y , +Control-Y) causes the process to be stopped when it +attempts to read input from the terminal, and control to +be returned to +.BR bash . +The user may then manipulate the state of this job, using the +.B bg +command to continue it in the background, the +.B fg +command to continue it in the foreground, or +the +.B kill +command to kill it. A \fB^Z\fP takes effect immediately, +and has the additional side effect of causing pending output +and typeahead to be discarded. +.PP +There are a number of ways to refer to a job in the shell. +The character +.B % +introduces a job specification (\fIjobspec\fP). Job number +.I n +may be referred to as +.BR %n . +A job may also be referred to using a prefix of the name used to +start it, or using a substring that appears in its command line. +For example, +.B %ce +refers to a stopped +.B ce +job. If a prefix matches more than one job, +.B bash +reports an error. Using +.BR %?ce , +on the other hand, refers to any job containing the string +.B ce +in its command line. If the substring matches more than one job, +.B bash +reports an error. The symbols +.B %% +and +.B %+ +refer to the shell's notion of the +.IR "current job" , +which is the last job stopped while it was in +the foreground or started in the background. +The +.I "previous job" +may be referenced using +.BR %\- . +If there is only a single job, \fB%+\fP and \fB%\-\fP can both be used +to refer to that job. +In output pertaining to jobs (e.g., the output of the +.B jobs +command), the current job is always flagged with a +.BR + , +and the previous job with a +.BR \- . +A single % (with no accompanying job specification) also refers to the +current job. +.PP +Simply naming a job can be used to bring it into the +foreground: +.B %1 +is a synonym for +\fB``fg %1''\fP, +bringing job 1 from the background into the foreground. +Similarly, +.B ``%1 &'' +resumes job 1 in the background, equivalent to +\fB``bg %1''\fP. +.PP +The shell learns immediately whenever a job changes state. +Normally, +.B bash +waits until it is about to print a prompt before reporting +changes in a job's status so as to not interrupt +any other output. If the +.B \-b +option to the +.B set +builtin command +is enabled, +.B bash +reports such changes immediately. +Any trap on +.SM +.B SIGCHLD +is executed for each child that exits. +.PP +If an attempt to exit +.B bash +is made while jobs are stopped (or, if the \fBcheckjobs\fP shell option has +been enabled using the \fBshopt\fP builtin, running), the shell prints a +warning message, and, if the \fBcheckjobs\fP option is enabled, lists the +jobs and their statuses. +The +.B jobs +command may then be used to inspect their status. +If a second attempt to exit is made without an intervening command, +the shell does not print another warning, and any stopped +jobs are terminated. +.SH PROMPTING +When executing interactively, +.B bash +displays the primary prompt +.SM +.B PS1 +when it is ready to read a command, and the secondary prompt +.SM +.B PS2 +when it needs more input to complete a command. +.B Bash +allows these prompt strings to be customized by inserting a number of +backslash-escaped special characters that are decoded as follows: +.RS +.PD 0 +.TP +.B \ea +an ASCII bell character (07) +.TP +.B \ed +the date in "Weekday Month Date" format (e.g., "Tue May 26") +.TP +.B \eD{\fIformat\fP} +the \fIformat\fP is passed to \fIstrftime\fP(3) and the result is inserted +into the prompt string; an empty \fIformat\fP results in a locale-specific +time representation. The braces are required +.TP +.B \ee +an ASCII escape character (033) +.TP +.B \eh +the hostname up to the first `.' +.TP +.B \eH +the hostname +.TP +.B \ej +the number of jobs currently managed by the shell +.TP +.B \el +the basename of the shell's terminal device name +.TP +.B \en +newline +.TP +.B \er +carriage return +.TP +.B \es +the name of the shell, the basename of +.B $0 +(the portion following the final slash) +.TP +.B \et +the current time in 24-hour HH:MM:SS format +.TP +.B \eT +the current time in 12-hour HH:MM:SS format +.TP +.B \e@ +the current time in 12-hour am/pm format +.TP +.B \eA +the current time in 24-hour HH:MM format +.TP +.B \eu +the username of the current user +.TP +.B \ev +the version of \fBbash\fP (e.g., 2.00) +.TP +.B \eV +the release of \fBbash\fP, version + patch level (e.g., 2.00.0) +.TP +.B \ew +the current working directory, with +.SM +.B $HOME +abbreviated with a tilde +(uses the value of the +.SM +.B PROMPT_DIRTRIM +variable) +.TP +.B \eW +the basename of the current working directory, with +.SM +.B $HOME +abbreviated with a tilde +.TP +.B \e! +the history number of this command +.TP +.B \e# +the command number of this command +.TP +.B \e$ +if the effective UID is 0, a +.BR # , +otherwise a +.B $ +.TP +.B \e\fInnn\fP +the character corresponding to the octal number \fInnn\fP +.TP +.B \e\e +a backslash +.TP +.B \e[ +begin a sequence of non-printing characters, which could be used to +embed a terminal control sequence into the prompt +.TP +.B \e] +end a sequence of non-printing characters +.PD +.RE +.PP +The command number and the history number are usually different: +the history number of a command is its position in the history +list, which may include commands restored from the history file +(see +.SM +.B HISTORY +below), while the command number is the position in the sequence +of commands executed during the current shell session. +After the string is decoded, it is expanded via +parameter expansion, command substitution, arithmetic +expansion, and quote removal, subject to the value of the +.B promptvars +shell option (see the description of the +.B shopt +command under +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.SH READLINE +This is the library that handles reading input when using an interactive +shell, unless the +.B \-\-noediting +option is given at shell invocation. +Line editing is also used when using the \fB\-e\fP option to the +\fBread\fP builtin. +By default, the line editing commands are similar to those of Emacs. +A vi-style line editing interface is also available. +Line editing can be enabled at any time using the +.B \-o emacs +or +.B \-o vi +options to the +.B set +builtin (see +.SM +.B SHELL BUILTIN COMMANDS +below). +To turn off line editing after the shell is running, use the +.B +o emacs +or +.B +o vi +options to the +.B set +builtin. +.SS "Readline Notation" +.PP +In this section, the Emacs-style notation is used to denote +keystrokes. Control keys are denoted by C\-\fIkey\fR, e.g., C\-n +means Control\-N. Similarly, +.I meta +keys are denoted by M\-\fIkey\fR, so M\-x means Meta\-X. (On keyboards +without a +.I meta +key, M\-\fIx\fP means ESC \fIx\fP, i.e., press the Escape key +then the +.I x +key. This makes ESC the \fImeta prefix\fP. +The combination M\-C\-\fIx\fP means ESC\-Control\-\fIx\fP, +or press the Escape key +then hold the Control key while pressing the +.I x +key.) +.PP +Readline commands may be given numeric +.IR arguments , +which normally act as a repeat count. +Sometimes, however, it is the sign of the argument that is significant. +Passing a negative argument to a command that acts in the forward +direction (e.g., \fBkill\-line\fP) causes that command to act in a +backward direction. +Commands whose behavior with arguments deviates from this are noted +below. +.PP +When a command is described as \fIkilling\fP text, the text +deleted is saved for possible future retrieval +(\fIyanking\fP). The killed text is saved in a +\fIkill ring\fP. Consecutive kills cause the text to be +accumulated into one unit, which can be yanked all at once. +Commands which do not kill text separate the chunks of text +on the kill ring. +.SS "Readline Initialization" +.PP +Readline is customized by putting commands in an initialization +file (the \fIinputrc\fP file). +The name of this file is taken from the value of the +.SM +.B INPUTRC +variable. If that variable is unset, the default is +.IR ~/.inputrc . +When a program which uses the readline library starts up, the +initialization file is read, and the key bindings and variables +are set. +There are only a few basic constructs allowed in the +readline initialization file. +Blank lines are ignored. +Lines beginning with a \fB#\fP are comments. +Lines beginning with a \fB$\fP indicate conditional constructs. +Other lines denote key bindings and variable settings. +.PP +The default key-bindings may be changed with an +.I inputrc +file. +Other programs that use this library may add their own commands +and bindings. +.PP +For example, placing +.RS +.PP +M\-Control\-u: universal\-argument +.RE +or +.RS +C\-Meta\-u: universal\-argument +.RE +into the +.I inputrc +would make M\-C\-u execute the readline command +.IR universal\-argument . +.PP +The following symbolic character names are recognized: +.IR RUBOUT , +.IR DEL , +.IR ESC , +.IR LFD , +.IR NEWLINE , +.IR RET , +.IR RETURN , +.IR SPC , +.IR SPACE , +and +.IR TAB . +.PP +In addition to command names, readline allows keys to be bound +to a string that is inserted when the key is pressed (a \fImacro\fP). +.SS "Readline Key Bindings" +.PP +The syntax for controlling key bindings in the +.I inputrc +file is simple. All that is required is the name of the +command or the text of a macro and a key sequence to which +it should be bound. The name may be specified in one of two ways: +as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP +prefixes, or as a key sequence. +.PP +When using the form \fBkeyname\fP:\^\fIfunction\-name\fP or \fImacro\fP, +.I keyname +is the name of a key spelled out in English. For example: +.sp +.RS +Control-u: universal\-argument +.br +Meta-Rubout: backward-kill-word +.br +Control-o: "> output" +.RE +.LP +In the above example, +.I C\-u +is bound to the function +.BR universal\-argument , +.I M\-DEL +is bound to the function +.BR backward\-kill\-word , +and +.I C\-o +is bound to run the macro +expressed on the right hand side (that is, to insert the text +.if t \f(CW> output\fP +.if n ``> output'' +into the line). +.PP +In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP, +.B keyseq +differs from +.B keyname +above in that strings denoting +an entire key sequence may be specified by placing the sequence +within double quotes. Some GNU Emacs style key escapes can be +used, as in the following example, but the symbolic character names +are not recognized. +.sp +.RS +"\eC\-u": universal\-argument +.br +"\eC\-x\eC\-r": re\-read\-init\-file +.br +"\ee[11~": "Function Key 1" +.RE +.PP +In this example, +.I C\-u +is again bound to the function +.BR universal\-argument . +.I "C\-x C\-r" +is bound to the function +.BR re\-read\-init\-file , +and +.I "ESC [ 1 1 ~" +is bound to insert the text +.if t \f(CWFunction Key 1\fP. +.if n ``Function Key 1''. +.PP +The full set of GNU Emacs style escape sequences is +.RS +.PD 0 +.TP +.B \eC\- +control prefix +.TP +.B \eM\- +meta prefix +.TP +.B \ee +an escape character +.TP +.B \e\e +backslash +.TP +.B \e" +literal " +.TP +.B \e\(aq +literal \(aq +.RE +.PD +.PP +In addition to the GNU Emacs style escape sequences, a second +set of backslash escapes is available: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ed +delete +.TP +.B \ef +form feed +.TP +.B \en +newline +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(one to three digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.RE +.PD +.PP +When entering the text of a macro, single or double quotes must +be used to indicate a macro definition. +Unquoted text is assumed to be a function name. +In the macro body, the backslash escapes described above are expanded. +Backslash will quote any other character in the macro text, +including " and \(aq. +.PP +.B Bash +allows the current readline key bindings to be displayed or modified +with the +.B bind +builtin command. The editing mode may be switched during interactive +use by using the +.B \-o +option to the +.B set +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SS "Readline Variables" +.PP +Readline has variables that can be used to further customize its +behavior. A variable may be set in the +.I inputrc +file with a statement of the form +.RS +.PP +\fBset\fP \fIvariable\-name\fP \fIvalue\fP +.RE +.PP +Except where noted, readline variables can take the values +.B On +or +.B Off +(without regard to case). +Unrecognized variable names are ignored. +When a variable value is read, empty or null values, "on" (case-insensitive), +and "1" are equivalent to \fBOn\fP. All other values are equivalent to +\fBOff\fP. +The variables and their default values are: +.PP +.PD 0 +.TP +.B bell\-style (audible) +Controls what happens when readline wants to ring the terminal bell. +If set to \fBnone\fP, readline never rings the bell. If set to +\fBvisible\fP, readline uses a visible bell if one is available. +If set to \fBaudible\fP, readline attempts to ring the terminal's bell. +.TP +.B bind\-tty\-special\-chars (On) +If set to \fBOn\fP, readline attempts to bind the control characters +treated specially by the kernel's terminal driver to their readline +equivalents. +.TP +.B colored\-stats (Off) +If set to \fBOn\fP, readline displays possible completions using different +colors to indicate their file type. +The color definitions are taken from the value of the \fBLS_COLORS\fP +environment variable. +.TP +.B comment\-begin (``#'') +The string that is inserted when the readline +.B insert\-comment +command is executed. +This command is bound to +.B M\-# +in emacs mode and to +.B # +in vi command mode. +.TP +.B completion\-ignore\-case (Off) +If set to \fBOn\fP, readline performs filename matching and completion +in a case\-insensitive fashion. +.TP +.B completion\-prefix\-display\-length (0) +The length in characters of the common prefix of a list of possible +completions that is displayed without modification. When set to a +value greater than zero, common prefixes longer than this value are +replaced with an ellipsis when displaying possible completions. +.TP +.B completion\-query\-items (100) +This determines when the user is queried about viewing +the number of possible completions +generated by the \fBpossible\-completions\fP command. +It may be set to any integer value greater than or equal to +zero. If the number of possible completions is greater than +or equal to the value of this variable, the user is asked whether +or not he wishes to view them; otherwise they are simply listed +on the terminal. +.TP +.B convert\-meta (On) +If set to \fBOn\fP, readline will convert characters with the +eighth bit set to an ASCII key sequence +by stripping the eighth bit and prefixing an +escape character (in effect, using escape as the \fImeta prefix\fP). +.TP +.B disable\-completion (Off) +If set to \fBOn\fP, readline will inhibit word completion. Completion +characters will be inserted into the line as if they had been +mapped to \fBself-insert\fP. +.TP +.B editing\-mode (emacs) +Controls whether readline begins with a set of key bindings similar +to \fIEmacs\fP or \fIvi\fP. +.B editing\-mode +can be set to either +.B emacs +or +.BR vi . +.TP +.B echo\-control\-characters (On) +When set to \fBOn\fP, on operating systems that indicate they support it, +readline echoes a character corresponding to a signal generated from the +keyboard. +.TP +.B enable\-keypad (Off) +When set to \fBOn\fP, readline will try to enable the application +keypad when it is called. Some systems need this to enable the +arrow keys. +.TP +.B enable\-meta\-key (On) +When set to \fBOn\fP, readline will try to enable any meta modifier +key the terminal claims to support when it is called. On many terminals, +the meta key is used to send eight-bit characters. +.TP +.B expand\-tilde (Off) +If set to \fBOn\fP, tilde expansion is performed when readline +attempts word completion. +.TP +.B history\-preserve\-point (Off) +If set to \fBOn\fP, the history code attempts to place point at the +same location on each history line retrieved with \fBprevious-history\fP +or \fBnext-history\fP. +.TP +.B history\-size (0) +Set the maximum number of history entries saved in the history list. +If set to zero, any existing history entries are deleted and no new entries +are saved. +If set to a value less than zero, the number of history entries is not +limited. +By default, the number of history entries is not limited. +.TP +.B horizontal\-scroll\-mode (Off) +When set to \fBOn\fP, makes readline use a single line for display, +scrolling the input horizontally on a single screen line when it +becomes longer than the screen width rather than wrapping to a new line. +.TP +.B input\-meta (Off) +If set to \fBOn\fP, readline will enable eight-bit input (that is, +it will not strip the high bit from the characters it reads), +regardless of what the terminal claims it can support. The name +.B meta\-flag +is a synonym for this variable. +.TP +.B isearch\-terminators (``C\-[C\-J'') +The string of characters that should terminate an incremental +search without subsequently executing the character as a command. +If this variable has not been given a value, the characters +\fIESC\fP and \fIC\-J\fP will terminate an incremental search. +.TP +.B keymap (emacs) +Set the current readline keymap. The set of valid keymap names is +\fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi, +vi\-command\fP, and +.IR vi\-insert . +\fIvi\fP is equivalent to \fIvi\-command\fP; \fIemacs\fP is +equivalent to \fIemacs\-standard\fP. The default value is +.IR emacs ; +the value of +.B editing\-mode +also affects the default keymap. +.TP +.B keyseq\-timeout (500) +Specifies the duration \fIreadline\fP will wait for a character when reading an +ambiguous key sequence (one that can form a complete key sequence using +the input read so far, or can take additional input to complete a longer +key sequence). +If no input is received within the timeout, \fIreadline\fP will use the shorter +but complete key sequence. +The value is specified in milliseconds, so a value of 1000 means that +\fIreadline\fP will wait one second for additional input. +If this variable is set to a value less than or equal to zero, or to a +non-numeric value, \fIreadline\fP will wait until another key is pressed to +decide which key sequence to complete. +.TP +.B mark\-directories (On) +If set to \fBOn\fP, completed directory names have a slash +appended. +.TP +.B mark\-modified\-lines (Off) +If set to \fBOn\fP, history lines that have been modified are displayed +with a preceding asterisk (\fB*\fP). +.TP +.B mark\-symlinked\-directories (Off) +If set to \fBOn\fP, completed names which are symbolic links to directories +have a slash appended (subject to the value of +\fBmark\-directories\fP). +.TP +.B match\-hidden\-files (On) +This variable, when set to \fBOn\fP, causes readline to match files whose +names begin with a `.' (hidden files) when performing filename +completion. +If set to \fBOff\fP, the leading `.' must be +supplied by the user in the filename to be completed. +.TP +.B menu\-complete\-display\-prefix (Off) +If set to \fBOn\fP, menu completion displays the common prefix of the +list of possible completions (which may be empty) before cycling through +the list. +.TP +.B output\-meta (Off) +If set to \fBOn\fP, readline will display characters with the +eighth bit set directly rather than as a meta-prefixed escape +sequence. +.TP +.B page\-completions (On) +If set to \fBOn\fP, readline uses an internal \fImore\fP-like pager +to display a screenful of possible completions at a time. +.TP +.B print\-completions\-horizontally (Off) +If set to \fBOn\fP, readline will display completions with matches +sorted horizontally in alphabetical order, rather than down the screen. +.TP +.B revert\-all\-at\-newline (Off) +If set to \fBOn\fP, readline will undo all changes to history lines +before returning when \fBaccept\-line\fP is executed. By default, +history lines may be modified and retain individual undo lists across +calls to \fBreadline\fP. +.TP +.B show\-all\-if\-ambiguous (Off) +This alters the default behavior of the completion functions. If +set to +.BR On , +words which have more than one possible completion cause the +matches to be listed immediately instead of ringing the bell. +.TP +.B show\-all\-if\-unmodified (Off) +This alters the default behavior of the completion functions in +a fashion similar to \fBshow\-all\-if\-ambiguous\fP. +If set to +.BR On , +words which have more than one possible completion without any +possible partial completion (the possible completions don't share +a common prefix) cause the matches to be listed immediately instead +of ringing the bell. +.TP +.B show\-mode\-in\-prompt (Off) +If set to \fBOn\fP, add a character to the beginning of the prompt +indicating the editing mode: emacs (@), vi command (:) or vi +insertion (+). +.TP +.B skip\-completed\-text (Off) +If set to \fBOn\fP, this alters the default completion behavior when +inserting a single match into the line. It's only active when +performing completion in the middle of a word. If enabled, readline +does not insert characters from the completion that match characters +after point in the word being completed, so portions of the word +following the cursor are not duplicated. +.TP +.B visible\-stats (Off) +If set to \fBOn\fP, a character denoting a file's type as reported +by \fIstat\fP(2) is appended to the filename when listing possible +completions. +.PD +.SS "Readline Conditional Constructs" +.PP +Readline implements a facility similar in spirit to the conditional +compilation features of the C preprocessor which allows key +bindings and variable settings to be performed as the result +of tests. There are four parser directives used. +.IP \fB$if\fP +The +.B $if +construct allows bindings to be made based on the +editing mode, the terminal being used, or the application using +readline. The text of the test extends to the end of the line; +no characters are required to isolate it. +.RS +.IP \fBmode\fP +The \fBmode=\fP form of the \fB$if\fP directive is used to test +whether readline is in emacs or vi mode. +This may be used in conjunction +with the \fBset keymap\fP command, for instance, to set bindings in +the \fIemacs\-standard\fP and \fIemacs\-ctlx\fP keymaps only if +readline is starting out in emacs mode. +.IP \fBterm\fP +The \fBterm=\fP form may be used to include terminal-specific +key bindings, perhaps to bind the key sequences output by the +terminal's function keys. The word on the right side of the +.B = +is tested against the both full name of the terminal and the portion +of the terminal name before the first \fB\-\fP. This allows +.I sun +to match both +.I sun +and +.IR sun\-cmd , +for instance. +.IP \fBapplication\fP +The \fBapplication\fP construct is used to include +application-specific settings. Each program using the readline +library sets the \fIapplication name\fP, and an initialization +file can test for a particular value. +This could be used to bind key sequences to functions useful for +a specific program. For instance, the following command adds a +key sequence that quotes the current or previous word in \fBbash\fP: +.sp 1 +.RS +.nf +\fB$if\fP Bash +# Quote the current or previous word +"\eC\-xq": "\eeb\e"\eef\e"" +\fB$endif\fP +.fi +.RE +.RE +.IP \fB$endif\fP +This command, as seen in the previous example, terminates an +\fB$if\fP command. +.IP \fB$else\fP +Commands in this branch of the \fB$if\fP directive are executed if +the test fails. +.IP \fB$include\fP +This directive takes a single filename as an argument and reads commands +and bindings from that file. For example, the following directive +would read \fI/etc/inputrc\fP: +.sp 1 +.RS +.nf +\fB$include\fP \^ \fI/etc/inputrc\fP +.fi +.RE +.SS Searching +.PP +Readline provides commands for searching through the command history +(see +.SM +.B HISTORY +below) for lines containing a specified string. +There are two search modes: +.I incremental +and +.IR non-incremental . +.PP +Incremental searches begin before the user has finished typing the +search string. +As each character of the search string is typed, readline displays +the next entry from the history matching the string typed so far. +An incremental search requires only as many characters as needed to +find the desired history entry. +The characters present in the value of the \fBisearch-terminators\fP +variable are used to terminate an incremental search. +If that variable has not been assigned a value the Escape and +Control-J characters will terminate an incremental search. +Control-G will abort an incremental search and restore the original +line. +When the search is terminated, the history entry containing the +search string becomes the current line. +.PP +To find other matching entries in the history list, type Control-S or +Control-R as appropriate. +This will search backward or forward in the history for the next +entry matching the search string typed so far. +Any other key sequence bound to a readline command will terminate +the search and execute that command. +For instance, a \fInewline\fP will terminate the search and accept +the line, thereby executing the command from the history list. +.PP +Readline remembers the last incremental search string. If two +Control-Rs are typed without any intervening characters defining a +new search string, any remembered search string is used. +.PP +Non-incremental searches read the entire search string before starting +to search for matching history lines. The search string may be +typed by the user or be part of the contents of the current line. +.SS "Readline Command Names" +.PP +The following is a list of the names of the commands and the default +key sequences to which they are bound. +Command names without an accompanying key sequence are unbound by default. +In the following descriptions, \fIpoint\fP refers to the current cursor +position, and \fImark\fP refers to a cursor position saved by the +\fBset\-mark\fP command. +The text between the point and mark is referred to as the \fIregion\fP. +.SS Commands for Moving +.PP +.PD 0 +.TP +.B beginning\-of\-line (C\-a) +Move to the start of the current line. +.TP +.B end\-of\-line (C\-e) +Move to the end of the line. +.TP +.B forward\-char (C\-f) +Move forward a character. +.TP +.B backward\-char (C\-b) +Move back a character. +.TP +.B forward\-word (M\-f) +Move forward to the end of the next word. Words are composed of +alphanumeric characters (letters and digits). +.TP +.B backward\-word (M\-b) +Move back to the start of the current or previous word. +Words are composed of alphanumeric characters (letters and digits). +.TP +.B shell\-forward\-word +Move forward to the end of the next word. +Words are delimited by non-quoted shell metacharacters. +.TP +.B shell\-backward\-word +Move back to the start of the current or previous word. +Words are delimited by non-quoted shell metacharacters. +.TP +.B clear\-screen (C\-l) +Clear the screen leaving the current line at the top of the screen. +With an argument, refresh the current line without clearing the +screen. +.TP +.B redraw\-current\-line +Refresh the current line. +.PD +.SS Commands for Manipulating the History +.PP +.PD 0 +.TP +.B accept\-line (Newline, Return) +Accept the line regardless of where the cursor is. If this line is +non-empty, add it to the history list according to the state of the +.SM +.B HISTCONTROL +variable. If the line is a modified history +line, then restore the history line to its original state. +.TP +.B previous\-history (C\-p) +Fetch the previous command from the history list, moving back in +the list. +.TP +.B next\-history (C\-n) +Fetch the next command from the history list, moving forward in the +list. +.TP +.B beginning\-of\-history (M\-<) +Move to the first line in the history. +.TP +.B end\-of\-history (M\->) +Move to the end of the input history, i.e., the line currently being +entered. +.TP +.B reverse\-search\-history (C\-r) +Search backward starting at the current line and moving `up' through +the history as necessary. This is an incremental search. +.TP +.B forward\-search\-history (C\-s) +Search forward starting at the current line and moving `down' through +the history as necessary. This is an incremental search. +.TP +.B non\-incremental\-reverse\-search\-history (M\-p) +Search backward through the history starting at the current line +using a non-incremental search for a string supplied by the user. +.TP +.B non\-incremental\-forward\-search\-history (M\-n) +Search forward through the history using a non-incremental search for +a string supplied by the user. +.TP +.B history\-search\-forward +Search forward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +.TP +.B history\-search\-backward +Search backward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +.TP +.B yank\-nth\-arg (M\-C\-y) +Insert the first argument to the previous command (usually +the second word on the previous line) at point. +With an argument +.IR n , +insert the \fIn\fPth word from the previous command (the words +in the previous command begin with word 0). A negative argument +inserts the \fIn\fPth word from the end of the previous command. +Once the argument \fIn\fP is computed, the argument is extracted +as if the "!\fIn\fP" history expansion had been specified. +.TP +.B +yank\-last\-arg (M\-.\^, M\-_\^) +Insert the last argument to the previous command (the last word of +the previous history entry). +With a numeric argument, behave exactly like \fByank\-nth\-arg\fP. +Successive calls to \fByank\-last\-arg\fP move back through the history +list, inserting the last word (or the word specified by the argument to +the first call) of each line in turn. +Any numeric argument supplied to these successive calls determines +the direction to move through the history. A negative argument switches +the direction through the history (back or forward). +The history expansion facilities are used to extract the last word, +as if the "!$" history expansion had been specified. +.TP +.B shell\-expand\-line (M\-C\-e) +Expand the line as the shell does. This +performs alias and history expansion as well as all of the shell +word expansions. See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B history\-expand\-line (M\-^) +Perform history expansion on the current line. +See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B magic\-space +Perform history expansion on the current line and insert a space. +See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B alias\-expand\-line +Perform alias expansion on the current line. +See +.SM +.B ALIASES +above for a description of alias expansion. +.TP +.B history\-and\-alias\-expand\-line +Perform history and alias expansion on the current line. +.TP +.B insert\-last\-argument (M\-.\^, M\-_\^) +A synonym for \fByank\-last\-arg\fP. +.TP +.B operate\-and\-get\-next (C\-o) +Accept the current line for execution and fetch the next line +relative to the current line from the history for editing. Any +argument is ignored. +.TP +.B edit\-and\-execute\-command (C\-xC\-e) +Invoke an editor on the current command line, and execute the result as shell +commands. +\fBBash\fP attempts to invoke +.SM +.BR $VISUAL , +.SM +.BR $EDITOR , +and \fIemacs\fP as the editor, in that order. +.PD +.SS Commands for Changing Text +.PP +.PD 0 +.TP +.B \fIend\-of\-file\fP (usually C\-d) +The character indicating end-of-file as set, for example, by +.if t \f(CWstty\fP. +.if n ``stty''. +If this character is read when there are no characters +on the line, and point is at the beginning of the line, Readline +interprets it as the end of input and returns +.SM +.BR EOF . +.TP +.B delete\-char (C\-d) +Delete the character at point. +If this function is bound to the +same character as the tty \fBEOF\fP character, as \fBC\-d\fP +commonly is, see above for the effects. +.TP +.B backward\-delete\-char (Rubout) +Delete the character behind the cursor. When given a numeric argument, +save the deleted text on the kill ring. +.TP +.B forward\-backward\-delete\-char +Delete the character under the cursor, unless the cursor is at the +end of the line, in which case the character behind the cursor is +deleted. +.TP +.B quoted\-insert (C\-q, C\-v) +Add the next character typed to the line verbatim. This is +how to insert characters like \fBC\-q\fP, for example. +.TP +.B tab\-insert (C\-v TAB) +Insert a tab character. +.TP +.B self\-insert (a,\ b,\ A,\ 1,\ !,\ ...) +Insert the character typed. +.TP +.B transpose\-chars (C\-t) +Drag the character before point forward over the character at point, +moving point forward as well. +If point is at the end of the line, then this transposes +the two characters before point. +Negative arguments have no effect. +.TP +.B transpose\-words (M\-t) +Drag the word before point past the word after point, +moving point over that word as well. +If point is at the end of the line, this transposes +the last two words on the line. +.TP +.B upcase\-word (M\-u) +Uppercase the current (or following) word. With a negative argument, +uppercase the previous word, but do not move point. +.TP +.B downcase\-word (M\-l) +Lowercase the current (or following) word. With a negative argument, +lowercase the previous word, but do not move point. +.TP +.B capitalize\-word (M\-c) +Capitalize the current (or following) word. With a negative argument, +capitalize the previous word, but do not move point. +.TP +.B overwrite\-mode +Toggle overwrite mode. With an explicit positive numeric argument, +switches to overwrite mode. With an explicit non-positive numeric +argument, switches to insert mode. This command affects only +\fBemacs\fP mode; \fBvi\fP mode does overwrite differently. +Each call to \fIreadline()\fP starts in insert mode. +In overwrite mode, characters bound to \fBself\-insert\fP replace +the text at point rather than pushing the text to the right. +Characters bound to \fBbackward\-delete\-char\fP replace the character +before point with a space. By default, this command is unbound. +.PD +.SS Killing and Yanking +.PP +.PD 0 +.TP +.B kill\-line (C\-k) +Kill the text from point to the end of the line. +.TP +.B backward\-kill\-line (C\-x Rubout) +Kill backward to the beginning of the line. +.TP +.B unix\-line\-discard (C\-u) +Kill backward from point to the beginning of the line. +The killed text is saved on the kill-ring. +.\" There is no real difference between this and backward-kill-line +.TP +.B kill\-whole\-line +Kill all characters on the current line, no matter where point is. +.TP +.B kill\-word (M\-d) +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as those used by \fBforward\-word\fP. +.TP +.B backward\-kill\-word (M\-Rubout) +Kill the word behind point. +Word boundaries are the same as those used by \fBbackward\-word\fP. +.TP +.B shell\-kill\-word (M\-d) +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as those used by \fBshell\-forward\-word\fP. +.TP +.B shell\-backward\-kill\-word (M\-Rubout) +Kill the word behind point. +Word boundaries are the same as those used by \fBshell\-backward\-word\fP. +.TP +.B unix\-word\-rubout (C\-w) +Kill the word behind point, using white space as a word boundary. +The killed text is saved on the kill-ring. +.TP +.B unix\-filename\-rubout +Kill the word behind point, using white space and the slash character +as the word boundaries. +The killed text is saved on the kill-ring. +.TP +.B delete\-horizontal\-space (M\-\e) +Delete all spaces and tabs around point. +.TP +.B kill\-region +Kill the text in the current region. +.TP +.B copy\-region\-as\-kill +Copy the text in the region to the kill buffer. +.TP +.B copy\-backward\-word +Copy the word before point to the kill buffer. +The word boundaries are the same as \fBbackward\-word\fP. +.TP +.B copy\-forward\-word +Copy the word following point to the kill buffer. +The word boundaries are the same as \fBforward\-word\fP. +.TP +.B yank (C\-y) +Yank the top of the kill ring into the buffer at point. +.TP +.B yank\-pop (M\-y) +Rotate the kill ring, and yank the new top. Only works following +.B yank +or +.BR yank\-pop . +.PD +.SS Numeric Arguments +.PP +.PD 0 +.TP +.B digit\-argument (M\-0, M\-1, ..., M\-\-) +Add this digit to the argument already accumulating, or start a new +argument. M\-\- starts a negative argument. +.TP +.B universal\-argument +This is another way to specify an argument. +If this command is followed by one or more digits, optionally with a +leading minus sign, those digits define the argument. +If the command is followed by digits, executing +.B universal\-argument +again ends the numeric argument, but is otherwise ignored. +As a special case, if this command is immediately followed by a +character that is neither a digit or minus sign, the argument count +for the next command is multiplied by four. +The argument count is initially one, so executing this function the +first time makes the argument count four, a second time makes the +argument count sixteen, and so on. +.PD +.SS Completing +.PP +.PD 0 +.TP +.B complete (TAB) +Attempt to perform completion on the text before point. +.B Bash +attempts completion treating the text as a variable (if the +text begins with \fB$\fP), username (if the text begins with +\fB~\fP), hostname (if the text begins with \fB@\fP), or +command (including aliases and functions) in turn. If none +of these produces a match, filename completion is attempted. +.TP +.B possible\-completions (M\-?) +List the possible completions of the text before point. +.TP +.B insert\-completions (M\-*) +Insert all completions of the text before point +that would have been generated by +\fBpossible\-completions\fP. +.TP +.B menu\-complete +Similar to \fBcomplete\fP, but replaces the word to be completed +with a single match from the list of possible completions. +Repeated execution of \fBmenu\-complete\fP steps through the list +of possible completions, inserting each match in turn. +At the end of the list of completions, the bell is rung +(subject to the setting of \fBbell\-style\fP) +and the original text is restored. +An argument of \fIn\fP moves \fIn\fP positions forward in the list +of matches; a negative argument may be used to move backward +through the list. +This command is intended to be bound to \fBTAB\fP, but is unbound +by default. +.TP +.B menu\-complete\-backward +Identical to \fBmenu\-complete\fP, but moves backward through the list +of possible completions, as if \fBmenu\-complete\fP had been given a +negative argument. This command is unbound by default. +.TP +.B delete\-char\-or\-list +Deletes the character under the cursor if not at the beginning or +end of the line (like \fBdelete\-char\fP). +If at the end of the line, behaves identically to +\fBpossible\-completions\fP. +This command is unbound by default. +.TP +.B complete\-filename (M\-/) +Attempt filename completion on the text before point. +.TP +.B possible\-filename\-completions (C\-x /) +List the possible completions of the text before point, +treating it as a filename. +.TP +.B complete\-username (M\-~) +Attempt completion on the text before point, treating +it as a username. +.TP +.B possible\-username\-completions (C\-x ~) +List the possible completions of the text before point, +treating it as a username. +.TP +.B complete\-variable (M\-$) +Attempt completion on the text before point, treating +it as a shell variable. +.TP +.B possible\-variable\-completions (C\-x $) +List the possible completions of the text before point, +treating it as a shell variable. +.TP +.B complete\-hostname (M\-@) +Attempt completion on the text before point, treating +it as a hostname. +.TP +.B possible\-hostname\-completions (C\-x @) +List the possible completions of the text before point, +treating it as a hostname. +.TP +.B complete\-command (M\-!) +Attempt completion on the text before point, treating +it as a command name. Command completion attempts to +match the text against aliases, reserved words, shell +functions, shell builtins, and finally executable filenames, +in that order. +.TP +.B possible\-command\-completions (C\-x !) +List the possible completions of the text before point, +treating it as a command name. +.TP +.B dynamic\-complete\-history (M\-TAB) +Attempt completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +.TP +.B dabbrev\-expand +Attempt menu completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +.TP +.B complete\-into\-braces (M\-{) +Perform filename completion and insert the list of possible completions +enclosed within braces so the list is available to the shell (see +.B Brace Expansion +above). +.PD +.SS Keyboard Macros +.PP +.PD 0 +.TP +.B start\-kbd\-macro (C\-x (\^) +Begin saving the characters typed into the current keyboard macro. +.TP +.B end\-kbd\-macro (C\-x )\^) +Stop saving the characters typed into the current keyboard macro +and store the definition. +.TP +.B call\-last\-kbd\-macro (C\-x e) +Re-execute the last keyboard macro defined, by making the characters +in the macro appear as if typed at the keyboard. +.TP +.B print\-last\-kbd\-macro () +Print the last keyboard macro defined in a format suitable for the +\fIinputrc\fP file. +.PD +.SS Miscellaneous +.PP +.PD 0 +.TP +.B re\-read\-init\-file (C\-x C\-r) +Read in the contents of the \fIinputrc\fP file, and incorporate +any bindings or variable assignments found there. +.TP +.B abort (C\-g) +Abort the current editing command and +ring the terminal's bell (subject to the setting of +.BR bell\-style ). +.TP +.B do\-uppercase\-version (M\-a, M\-b, M\-\fIx\fP, ...) +If the metafied character \fIx\fP is lowercase, run the command +that is bound to the corresponding uppercase character. +.TP +.B prefix\-meta (ESC) +Metafy the next character typed. +.SM +.B ESC +.B f +is equivalent to +.BR Meta\-f . +.TP +.B undo (C\-_, C\-x C\-u) +Incremental undo, separately remembered for each line. +.TP +.B revert\-line (M\-r) +Undo all changes made to this line. This is like executing the +.B undo +command enough times to return the line to its initial state. +.TP +.B tilde\-expand (M\-&) +Perform tilde expansion on the current word. +.TP +.B set\-mark (C\-@, M\-) +Set the mark to the point. If a +numeric argument is supplied, the mark is set to that position. +.TP +.B exchange\-point\-and\-mark (C\-x C\-x) +Swap the point with the mark. The current cursor position is set to +the saved position, and the old cursor position is saved as the mark. +.TP +.B character\-search (C\-]) +A character is read and point is moved to the next occurrence of that +character. A negative count searches for previous occurrences. +.TP +.B character\-search\-backward (M\-C\-]) +A character is read and point is moved to the previous occurrence of that +character. A negative count searches for subsequent occurrences. +.TP +.B skip\-csi\-sequence +Read enough characters to consume a multi-key sequence such as those +defined for keys like Home and End. Such sequences begin with a +Control Sequence Indicator (CSI), usually ESC\-[. If this sequence is +bound to "\e[", keys producing such sequences will have no effect +unless explicitly bound to a readline command, instead of inserting +stray characters into the editing buffer. This is unbound by default, +but usually bound to ESC\-[. +.TP +.B insert\-comment (M\-#) +Without a numeric argument, the value of the readline +.B comment\-begin +variable is inserted at the beginning of the current line. +If a numeric argument is supplied, this command acts as a toggle: if +the characters at the beginning of the line do not match the value +of \fBcomment\-begin\fP, the value is inserted, otherwise +the characters in \fBcomment\-begin\fP are deleted from the beginning of +the line. +In either case, the line is accepted as if a newline had been typed. +The default value of +\fBcomment\-begin\fP causes this command to make the current line +a shell comment. +If a numeric argument causes the comment character to be removed, the line +will be executed by the shell. +.TP +.B glob\-complete\-word (M\-g) +The word before point is treated as a pattern for pathname expansion, +with an asterisk implicitly appended. This pattern is used to +generate a list of matching filenames for possible completions. +.TP +.B glob\-expand\-word (C\-x *) +The word before point is treated as a pattern for pathname expansion, +and the list of matching filenames is inserted, replacing the word. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +.TP +.B glob\-list\-expansions (C\-x g) +The list of expansions that would have been generated by +.B glob\-expand\-word +is displayed, and the line is redrawn. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +.TP +.B dump\-functions +Print all of the functions and their key bindings to the +readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B dump\-variables +Print all of the settable readline variables and their values to the +readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B dump\-macros +Print all of the readline key sequences bound to macros and the +strings they output. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B display\-shell\-version (C\-x C\-v) +Display version information about the current instance of +.BR bash . +.PD +.SS Programmable Completion +.PP +When word completion is attempted for an argument to a command for +which a completion specification (a \fIcompspec\fP) has been defined +using the \fBcomplete\fP builtin (see +.SM +.B "SHELL BUILTIN COMMANDS" +below), the programmable completion facilities are invoked. +.PP +First, the command name is identified. +If the command word is the empty string (completion attempted at the +beginning of an empty line), any compspec defined with +the \fB\-E\fP option to \fBcomplete\fP is used. +If a compspec has been defined for that command, the +compspec is used to generate the list of possible completions for the word. +If the command word is a full pathname, a compspec for the full +pathname is searched for first. +If no compspec is found for the full pathname, an attempt is made to +find a compspec for the portion following the final slash. +If those searches do not result in a compspec, any compspec defined with +the \fB\-D\fP option to \fBcomplete\fP is used as the default. +.PP +Once a compspec has been found, it is used to generate the list of +matching words. +If a compspec is not found, the default \fBbash\fP completion as +described above under \fBCompleting\fP is performed. +.PP +First, the actions specified by the compspec are used. +Only matches which are prefixed by the word being completed are +returned. +When the +.B \-f +or +.B \-d +option is used for filename or directory name completion, the shell +variable +.SM +.B FIGNORE +is used to filter the matches. +.PP +Any completions specified by a pathname expansion pattern to the +\fB\-G\fP option are generated next. +The words generated by the pattern need not match the word +being completed. +The +.SM +.B GLOBIGNORE +shell variable is not used to filter the matches, but the +.SM +.B FIGNORE +variable is used. +.PP +Next, the string specified as the argument to the \fB\-W\fP option +is considered. +The string is first split using the characters in the +.SM +.B IFS +special variable as delimiters. +Shell quoting is honored. +Each word is then expanded using +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, and arithmetic expansion, +as described above under +.SM +.BR EXPANSION . +The results are split using the rules described above under +\fBWord Splitting\fP. +The results of the expansion are prefix-matched against the word being +completed, and the matching words become the possible completions. +.PP +After these matches have been generated, any shell function or command +specified with the \fB\-F\fP and \fB\-C\fP options is invoked. +When the command or function is invoked, the +.SM +.BR COMP_LINE , +.SM +.BR COMP_POINT , +.SM +.BR COMP_KEY , +and +.SM +.B COMP_TYPE +variables are assigned values as described above under +\fBShell Variables\fP. +If a shell function is being invoked, the +.SM +.B COMP_WORDS +and +.SM +.B COMP_CWORD +variables are also set. +When the function or command is invoked, +the first argument (\fB$1\fP) is the name of the command whose arguments are +being completed, +the second argument (\fB$2\fP) is the word being completed, +and the third argument (\fB$3\fP) is the word preceding the word being +completed on the current command line. +No filtering of the generated completions against the word being completed +is performed; the function or command has complete freedom in generating +the matches. +.PP +Any function specified with \fB\-F\fP is invoked first. +The function may use any of the shell facilities, including the +\fBcompgen\fP builtin described below, to generate the matches. +It must put the possible completions in the +.SM +.B COMPREPLY +array variable, one per array element. +.PP +Next, any command specified with the \fB\-C\fP option is invoked +in an environment equivalent to command substitution. +It should print a list of completions, one per line, to the +standard output. +Backslash may be used to escape a newline, if necessary. +.PP +After all of the possible completions are generated, any filter +specified with the \fB\-X\fP option is applied to the list. +The filter is a pattern as used for pathname expansion; a \fB&\fP +in the pattern is replaced with the text of the word being completed. +A literal \fB&\fP may be escaped with a backslash; the backslash +is removed before attempting a match. +Any completion that matches the pattern will be removed from the list. +A leading \fB!\fP negates the pattern; in this case any completion +not matching the pattern will be removed. +.PP +Finally, any prefix and suffix specified with the \fB\-P\fP and \fB\-S\fP +options are added to each member of the completion list, and the result is +returned to the readline completion code as the list of possible +completions. +.PP +If the previously-applied actions do not generate any matches, and the +\fB\-o dirnames\fP option was supplied to \fBcomplete\fP when the +compspec was defined, directory name completion is attempted. +.PP +If the \fB\-o plusdirs\fP option was supplied to \fBcomplete\fP when the +compspec was defined, directory name completion is attempted and any +matches are added to the results of the other actions. +.PP +By default, if a compspec is found, whatever it generates is returned +to the completion code as the full set of possible completions. +The default \fBbash\fP completions are not attempted, and the readline +default of filename completion is disabled. +If the \fB\-o bashdefault\fP option was supplied to \fBcomplete\fP when +the compspec was defined, the \fBbash\fP default completions are attempted +if the compspec generates no matches. +If the \fB\-o default\fP option was supplied to \fBcomplete\fP when the +compspec was defined, readline's default completion will be performed +if the compspec (and, if attempted, the default \fBbash\fP completions) +generate no matches. +.PP +When a compspec indicates that directory name completion is desired, +the programmable completion functions force readline to append a slash +to completed names which are symbolic links to directories, subject to +the value of the \fBmark\-directories\fP readline variable, regardless +of the setting of the \fBmark-symlinked\-directories\fP readline variable. +.PP +There is some support for dynamically modifying completions. This is +most useful when used in combination with a default completion specified +with \fBcomplete -D\fP. +It's possible for shell functions executed as completion +handlers to indicate that completion should be retried by returning an +exit status of 124. If a shell function returns 124, and changes +the compspec associated with the command on which completion is being +attempted (supplied as the first argument when the function is executed), +programmable completion restarts from the beginning, with an +attempt to find a new compspec for that command. This allows a set of +completions to be built dynamically as completion is attempted, rather than +being loaded all at once. +.PP +For instance, assuming that there is a library of compspecs, each kept in a +file corresponding to the name of the command, the following default +completion function would load completions dynamically: +.PP +\f(CW_completion_loader() +.br +{ +.br + . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124 +.br +} +.br +complete -D -F _completion_loader -o bashdefault -o default +.br +\fP +.SH HISTORY +When the +.B \-o history +option to the +.B set +builtin is enabled, the shell provides access to the +\fIcommand history\fP, +the list of commands previously typed. +The value of the +.SM +.B HISTSIZE +variable is used as the +number of commands to save in a history list. +The text of the last +.SM +.B HISTSIZE +commands (default 500) is saved. The shell +stores each command in the history list prior to parameter and +variable expansion (see +.SM +.B EXPANSION +above) but after history expansion is performed, subject to the +values of the shell variables +.SM +.B HISTIGNORE +and +.SM +.BR HISTCONTROL . +.PP +On startup, the history is initialized from the file named by +the variable +.SM +.B HISTFILE +(default \fI~/.bash_history\fP). +The file named by the value of +.SM +.B HISTFILE +is truncated, if necessary, to contain no more than +the number of lines specified by the value of +.SM +.BR HISTFILESIZE . +If \fBHISTFILESIZE\fP is unset, or set to null, a non-numeric value, +or a numeric value less than zero, the history file is not truncated. +When the history file is read, +lines beginning with the history comment character followed immediately +by a digit are interpreted as timestamps for the preceding history line. +These timestamps are optionally displayed depending on the value of the +.SM +.B HISTTIMEFORMAT +variable. +When a shell with history enabled exits, the last +.SM +.B $HISTSIZE +lines are copied from the history list to +.SM +.BR $HISTFILE . +If the +.B histappend +shell option is enabled +(see the description of +.B shopt +under +.SM +.B "SHELL BUILTIN COMMANDS" +below), the lines are appended to the history file, +otherwise the history file is overwritten. +If +.SM +.B HISTFILE +is unset, or if the history file is unwritable, the history is +not saved. +If the +.SM +.B HISTTIMEFORMAT +variable is set, time stamps are written to the history file, marked +with the history comment character, so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +After saving the history, the history file is truncated +to contain no more than +.SM +.B HISTFILESIZE +lines. If +.SM +.B HISTFILESIZE +is unset, or set to null, a non-numeric value, +or a numeric value less than zero, the history file is not truncated. +.PP +The builtin command +.B fc +(see +.SM +.B SHELL BUILTIN COMMANDS +below) may be used to list or edit and re-execute a portion of +the history list. +The +.B history +builtin may be used to display or modify the history list and +manipulate the history file. +When using command-line editing, search commands +are available in each editing mode that provide access to the +history list. +.PP +The shell allows control over which commands are saved on the history +list. The +.SM +.B HISTCONTROL +and +.SM +.B HISTIGNORE +variables may be set to cause the shell to save only a subset of the +commands entered. +The +.B cmdhist +shell option, if enabled, causes the shell to attempt to save each +line of a multi-line command in the same history entry, adding +semicolons where necessary to preserve syntactic correctness. +The +.B lithist +shell option causes the shell to save the command with embedded newlines +instead of semicolons. See the description of the +.B shopt +builtin below under +.SM +.B "SHELL BUILTIN COMMANDS" +for information on setting and unsetting shell options. +.SH "HISTORY EXPANSION" +.PP +The shell supports a history expansion feature that +is similar to the history expansion in +.BR csh. +This section describes what syntax features are available. This +feature is enabled by default for interactive shells, and can be +disabled using the +.B +H +option to the +.B set +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). Non-interactive shells do not perform history expansion +by default. +.PP +History expansions introduce words from the history list into +the input stream, making it easy to repeat commands, insert the +arguments to a previous command into the current input line, or +fix errors in previous commands quickly. +.PP +History expansion is performed immediately after a complete line +is read, before the shell breaks it into words. +It takes place in two parts. +The first is to determine which line from the history list +to use during substitution. +The second is to select portions of that line for inclusion into +the current one. +The line selected from the history is the \fIevent\fP, +and the portions of that line that are acted upon are \fIwords\fP. +Various \fImodifiers\fP are available to manipulate the selected words. +The line is broken into words in the same fashion as when reading input, +so that several \fImetacharacter\fP-separated words surrounded by +quotes are considered one word. +History expansions are introduced by the appearance of the +history expansion character, which is \^\fB!\fP\^ by default. +Only backslash (\^\fB\e\fP\^) and single quotes can quote +the history expansion character. +.PP +Several characters inhibit history expansion if found immediately +following the history expansion character, even if it is unquoted: +space, tab, newline, carriage return, and \fB=\fP. +If the \fBextglob\fP shell option is enabled, \fB(\fP will also +inhibit expansion. +.PP +Several shell options settable with the +.B shopt +builtin may be used to tailor the behavior of history expansion. +If the +.B histverify +shell option is enabled (see the description of the +.B shopt +builtin below), and +.B readline +is being used, history substitutions are not immediately passed to +the shell parser. +Instead, the expanded line is reloaded into the +.B readline +editing buffer for further modification. +If +.B readline +is being used, and the +.B histreedit +shell option is enabled, a failed history substitution will be reloaded +into the +.B readline +editing buffer for correction. +The +.B \-p +option to the +.B history +builtin command may be used to see what a history expansion will +do before using it. +The +.B \-s +option to the +.B history +builtin may be used to add commands to the end of the history list +without actually executing them, so that they are available for +subsequent recall. +.PP +The shell allows control of the various characters used by the +history expansion mechanism (see the description of +.B histchars +above under +.BR "Shell Variables" ). +The shell uses +the history comment character to mark history timestamps when +writing the history file. +.SS Event Designators +.PP +An event designator is a reference to a command line entry in the +history list. +Unless the reference is absolute, events are relative to the current +position in the history list. +.PP +.PD 0 +.TP +.B ! +Start a history substitution, except when followed by a +.BR blank , +newline, carriage return, = +or ( (when the \fBextglob\fP shell option is enabled using +the \fBshopt\fP builtin). +.TP +.B !\fIn\fR +Refer to command line +.IR n . +.TP +.B !\-\fIn\fR +Refer to the current command minus +.IR n . +.TP +.B !! +Refer to the previous command. This is a synonym for `!\-1'. +.TP +.B !\fIstring\fR +Refer to the most recent command preceding the current position in the +history list starting with +.IR string . +.TP +.B !?\fIstring\fR\fB[?]\fR +Refer to the most recent command preceding the current position in the +history list containing +.IR string . +The trailing \fB?\fP may be omitted if +.I string +is followed immediately by a newline. +.TP +.B \d\s+2^\s-2\u\fIstring1\fP\d\s+2^\s-2\u\fIstring2\fP\d\s+2^\s-2\u +Quick substitution. Repeat the previous command, replacing +.I string1 +with +.IR string2 . +Equivalent to +``!!:s/\fIstring1\fP/\fIstring2\fP/'' +(see \fBModifiers\fP below). +.TP +.B !# +The entire command line typed so far. +.PD +.SS Word Designators +.PP +Word designators are used to select desired words from the event. +A +.B : +separates the event specification from the word designator. +It may be omitted if the word designator begins with a +.BR ^ , +.BR $ , +.BR * , +.BR \- , +or +.BR % . +Words are numbered from the beginning of the line, +with the first word being denoted by 0 (zero). +Words are inserted into the current line separated by single spaces. +.PP +.PD 0 +.TP +.B 0 (zero) +The zeroth word. For the shell, this is the command +word. +.TP +.I n +The \fIn\fRth word. +.TP +.B ^ +The first argument. That is, word 1. +.TP +.B $ +The last word. This is usually the last argument, but will expand to the +zeroth word if there is only one word in the line. +.TP +.B % +The word matched by the most recent `?\fIstring\fR?' search. +.TP +.I x\fB\-\fPy +A range of words; `\-\fIy\fR' abbreviates `0\-\fIy\fR'. +.TP +.B * +All of the words but the zeroth. This is a synonym +for `\fI1\-$\fP'. It is not an error to use +.B * +if there is just one +word in the event; the empty string is returned in that case. +.TP +.B x* +Abbreviates \fIx\-$\fP. +.TP +.B x\- +Abbreviates \fIx\-$\fP like \fBx*\fP, but omits the last word. +.PD +.PP +If a word designator is supplied without an event specification, the +previous command is used as the event. +.SS Modifiers +.PP +After the optional word designator, there may appear a sequence of +one or more of the following modifiers, each preceded by a `:'. +.PP +.PD 0 +.PP +.TP +.B h +Remove a trailing filename component, leaving only the head. +.TP +.B t +Remove all leading filename components, leaving the tail. +.TP +.B r +Remove a trailing suffix of the form \fI.xxx\fP, leaving the +basename. +.TP +.B e +Remove all but the trailing suffix. +.TP +.B p +Print the new command but do not execute it. +.TP +.B q +Quote the substituted words, escaping further substitutions. +.TP +.B x +Quote the substituted words as with +.BR q , +but break into words at +.B blanks +and newlines. +.TP +.B s/\fIold\fP/\fInew\fP/ +Substitute +.I new +for the first occurrence of +.I old +in the event line. Any delimiter can be used in place of /. The +final delimiter is optional if it is the last character of the +event line. The delimiter may be quoted in +.I old +and +.I new +with a single backslash. If & appears in +.IR new , +it is replaced by +.IR old . +A single backslash will quote the &. If +.I old +is null, it is set to the last +.I old +substituted, or, if no previous history substitutions took place, +the last +.I string +in a +.B !?\fIstring\fR\fB[?]\fR +search. +.TP +.B & +Repeat the previous substitution. +.TP +.B g +Cause changes to be applied over the entire event line. This is +used in conjunction with `\fB:s\fP' (e.g., `\fB:gs/\fIold\fP/\fInew\fP/\fR') +or `\fB:&\fP'. If used with +`\fB:s\fP', any delimiter can be used +in place of /, and the final delimiter is optional +if it is the last character of the event line. +An \fBa\fP may be used as a synonym for \fBg\fP. +.TP +.B G +Apply the following `\fBs\fP' modifier once to each word in the event line. +.PD +.SH "SHELL BUILTIN COMMANDS" +.\" start of bash_builtins +.zZ +.PP +Unless otherwise noted, each builtin command documented in this +section as accepting options preceded by +.B \- +accepts +.B \-\- +to signify the end of the options. +The \fB:\fP, \fBtrue\fP, \fBfalse\fP, and \fBtest\fP builtins +do not accept options and do not treat \fB\-\-\fP specially. +The \fBexit\fP, \fBlogout\fP, \fBbreak\fP, \fBcontinue\fP, \fBlet\fP, +and \fBshift\fP builtins accept and process arguments beginning with +\fB\-\fP without requiring \fB\-\-\fP. +Other builtins that accept arguments but are not specified as accepting +options interpret arguments beginning with \fB\-\fP as invalid options and +require \fB\-\-\fP to prevent this interpretation. +.sp .5 +.PD 0 +.TP +\fB:\fP [\fIarguments\fP] +.PD +No effect; the command does nothing beyond expanding +.I arguments +and performing any specified +redirections. A zero exit code is returned. +.TP +\fB .\| \fP \fIfilename\fP [\fIarguments\fP] +.PD 0 +.TP +\fBsource\fP \fIfilename\fP [\fIarguments\fP] +.PD +Read and execute commands from +.I filename +in the current +shell environment and return the exit status of the last command +executed from +.IR filename . +If +.I filename +does not contain a slash, filenames in +.SM +.B PATH +are used to find the directory containing +.IR filename . +The file searched for in +.SM +.B PATH +need not be executable. +When \fBbash\fP is not in \fIposix mode\fP, the current directory is +searched if no file is found in +.SM +.BR PATH . +If the +.B sourcepath +option to the +.B shopt +builtin command is turned off, the +.SM +.B PATH +is not searched. +If any \fIarguments\fP are supplied, they become the positional +parameters when \fIfilename\fP is executed. Otherwise the positional +parameters are unchanged. +The return status is the status of the last command exited within +the script (0 if no commands are executed), and false if +.I filename +is not found or cannot be read. +.TP +\fBalias\fP [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +\fBAlias\fP with no arguments or with the +.B \-p +option prints the list of aliases in the form +\fBalias\fP \fIname\fP=\fIvalue\fP on standard output. +When arguments are supplied, an alias is defined for +each \fIname\fP whose \fIvalue\fP is given. +A trailing space in \fIvalue\fP causes the next word to be +checked for alias substitution when the alias is expanded. +For each \fIname\fP in the argument list for which no \fIvalue\fP +is supplied, the name and value of the alias is printed. +\fBAlias\fP returns true unless a \fIname\fP is given for which +no alias has been defined. +.TP +\fBbg\fP [\fIjobspec\fP ...] +Resume each suspended job \fIjobspec\fP in the background, as if it +had been started with +.BR & . +If +.I jobspec +is not present, the shell's notion of the \fIcurrent job\fP is used. +.B bg +.I jobspec +returns 0 unless run when job control is disabled or, when run with +job control enabled, any specified \fIjobspec\fP was not found +or was started without job control. +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] [\fB\-lpsvPSVX\fP] +.PD 0 +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] [\fB\-q\fP \fIfunction\fP] [\fB\-u\fP \fIfunction\fP] [\fB\-r\fP \fIkeyseq\fP] +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fB\-f\fP \fIfilename\fP +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fB\-x\fP \fIkeyseq\fP:\fIshell\-command\fP +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fIkeyseq\fP:\fIfunction\-name\fP +.TP +\fBbind\fP \fIreadline\-command\fP +.PD +Display current +.B readline +key and function bindings, bind a key sequence to a +.B readline +function or macro, or set a +.B readline +variable. +Each non-option argument is a command as it would appear in +.IR .inputrc , +but each binding or command must be passed as a separate argument; +e.g., '"\eC\-x\eC\-r": re\-read\-init\-file'. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-m \fIkeymap\fP +Use +.I keymap +as the keymap to be affected by the subsequent bindings. +Acceptable +.I keymap +names are +\fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi, +vi\-move, vi\-command\fP, and +.IR vi\-insert . +\fIvi\fP is equivalent to \fIvi\-command\fP; \fIemacs\fP is +equivalent to \fIemacs\-standard\fP. +.TP +.B \-l +List the names of all \fBreadline\fP functions. +.TP +.B \-p +Display \fBreadline\fP function names and bindings in such a way +that they can be re-read. +.TP +.B \-P +List current \fBreadline\fP function names and bindings. +.TP +.B \-s +Display \fBreadline\fP key sequences bound to macros and the strings +they output in such a way that they can be re-read. +.TP +.B \-S +Display \fBreadline\fP key sequences bound to macros and the strings +they output. +.TP +.B \-v +Display \fBreadline\fP variable names and values in such a way that they +can be re-read. +.TP +.B \-V +List current \fBreadline\fP variable names and values. +.TP +.B \-f \fIfilename\fP +Read key bindings from \fIfilename\fP. +.TP +.B \-q \fIfunction\fP +Query about which keys invoke the named \fIfunction\fP. +.TP +.B \-u \fIfunction\fP +Unbind all keys bound to the named \fIfunction\fP. +.TP +.B \-r \fIkeyseq\fP +Remove any current binding for \fIkeyseq\fP. +.TP +.B \-x \fIkeyseq\fP:\fIshell\-command\fP +Cause \fIshell\-command\fP to be executed whenever \fIkeyseq\fP is +entered. +When \fIshell\-command\fP is executed, the shell sets the +.SM +.B READLINE_LINE +variable to the contents of the \fBreadline\fP line buffer and the +.SM +.B READLINE_POINT +variable to the current location of the insertion point. +If the executed command changes the value of +.SM +.B READLINE_LINE +or +.SM +.BR READLINE_POINT , +those new values will be reflected in the editing state. +.TP +.B \-X +List all key sequences bound to shell commands and the associated commands +in a format that can be reused as input. +.PD +.PP +The return value is 0 unless an unrecognized option is given or an +error occurred. +.RE +.TP +\fBbreak\fP [\fIn\fP] +Exit from within a +.BR for , +.BR while , +.BR until , +or +.B select +loop. If \fIn\fP is specified, break \fIn\fP levels. +.I n +must be \(>= 1. If +.I n +is greater than the number of enclosing loops, all enclosing loops +are exited. +The return value is 0 unless \fIn\fP is not greater than or equal to 1. +.TP +\fBbuiltin\fP \fIshell\-builtin\fP [\fIarguments\fP] +Execute the specified shell builtin, passing it +.IR arguments , +and return its exit status. +This is useful when defining a +function whose name is the same as a shell builtin, +retaining the functionality of the builtin within the function. +The \fBcd\fP builtin is commonly redefined this way. +The return status is false if +.I shell\-builtin +is not a shell builtin command. +.TP +\fBcaller\fP [\fIexpr\fP] +Returns the context of any active subroutine call (a shell function or +a script executed with the \fB.\fP or \fBsource\fP builtins). +Without \fIexpr\fP, \fBcaller\fP displays the line number and source +filename of the current subroutine call. +If a non-negative integer is supplied as \fIexpr\fP, \fBcaller\fP +displays the line number, subroutine name, and source file corresponding +to that position in the current execution call stack. This extra +information may be used, for example, to print a stack trace. The +current frame is frame 0. +The return value is 0 unless the shell is not executing a subroutine +call or \fIexpr\fP does not correspond to a valid position in the +call stack. +.TP +\fBcd\fP [\fB\-L\fP|[\fB\-P\fP [\fB\-e\fP]] [\-@]] [\fIdir\fP] +Change the current directory to \fIdir\fP. +if \fIdir\fP is not supplied, the value of the +.SM +.B HOME +shell variable is the default. +Any additional arguments following \fIdir\fP are ignored. +The variable +.SM +.B CDPATH +defines the search path for the directory containing +.IR dir : +each directory name in +.SM +.B CDPATH +is searched for \fIdir\fP. +Alternative directory names in +.SM +.B CDPATH +are separated by a colon (:). A null directory name in +.SM +.B CDPATH +is the same as the current directory, i.e., ``\fB.\fP''. If +.I dir +begins with a slash (/), +then +.SM +.B CDPATH +is not used. The +.B \-P +option causes \fBcd\fP to use the physical directory structure +by resolving symbolic links while traversing \fIdir\fP and +before processing instances of \fI..\fP in \fIdir\fP (see also the +.B \-P +option to the +.B set +builtin command); the +.B \-L +option forces symbolic links to be followed by resolving the link +after processing instances of \fI..\fP in \fIdir\fP. +If \fI..\fP appears in \fIdir\fP, it is processed by removing the +immediately previous pathname component from \fIdir\fP, back to a slash +or the beginning of \fIdir\fP. +If the +.B \-e +option is supplied with +.BR \-P , +and the current working directory cannot be successfully determined +after a successful directory change, \fBcd\fP will return an unsuccessful +status. +On systems that support it, the \fB\-@\fP option presents the extended +attributes associated with a file as a directory. +An argument of +.B \- +is converted to +.SM +.B $OLDPWD +before the directory change is attempted. +If a non-empty directory name from +.SM +.B CDPATH +is used, or if +\fB\-\fP is the first argument, and the directory change is +successful, the absolute pathname of the new working directory is +written to the standard output. +The return value is true if the directory was successfully changed; +false otherwise. +.TP +\fBcommand\fP [\fB\-pVv\fP] \fIcommand\fP [\fIarg\fP ...] +Run +.I command +with +.I args +suppressing the normal shell function lookup. Only builtin +commands or commands found in the +.SM +.B PATH +are executed. If the +.B \-p +option is given, the search for +.I command +is performed using a default value for +.SM +.B PATH +that is guaranteed to find all of the standard utilities. +If either the +.B \-V +or +.B \-v +option is supplied, a description of +.I command +is printed. The +.B \-v +option causes a single word indicating the command or filename +used to invoke +.I command +to be displayed; the +.B \-V +option produces a more verbose description. +If the +.B \-V +or +.B \-v +option is supplied, the exit status is 0 if +.I command +was found, and 1 if not. If neither option is supplied and +an error occurred or +.I command +cannot be found, the exit status is 127. Otherwise, the exit status of the +.B command +builtin is the exit status of +.IR command . +.TP +\fBcompgen\fP [\fIoption\fP] [\fIword\fP] +Generate possible completion matches for \fIword\fP according to +the \fIoption\fPs, which may be any option accepted by the +.B complete +builtin with the exception of \fB\-p\fP and \fB\-r\fP, and write +the matches to the standard output. +When using the \fB\-F\fP or \fB\-C\fP options, the various shell variables +set by the programmable completion facilities, while available, will not +have useful values. +.sp 1 +The matches will be generated in the same way as if the programmable +completion code had generated them directly from a completion specification +with the same flags. +If \fIword\fP is specified, only those completions matching \fIword\fP +will be displayed. +.sp 1 +The return value is true unless an invalid option is supplied, or no +matches were generated. +.TP +\fBcomplete\fP [\fB\-abcdefgjksuv\fP] [\fB\-o\fP \fIcomp-option\fP] [\fB\-DE\fP] [\fB\-A\fP \fIaction\fP] [\fB\-G\fP \fIglobpat\fP] [\fB\-W\fP \fIwordlist\fP] [\fB\-F\fP \fIfunction\fP] [\fB\-C\fP \fIcommand\fP] +.br +[\fB\-X\fP \fIfilterpat\fP] [\fB\-P\fP \fIprefix\fP] [\fB\-S\fP \fIsuffix\fP] \fIname\fP [\fIname ...\fP] +.PD 0 +.TP +\fBcomplete\fP \fB\-pr\fP [\fB\-DE\fP] [\fIname\fP ...] +.PD +Specify how arguments to each \fIname\fP should be completed. +If the \fB\-p\fP option is supplied, or if no options are supplied, +existing completion specifications are printed in a way that allows +them to be reused as input. +The \fB\-r\fP option removes a completion specification for +each \fIname\fP, or, if no \fIname\fPs are supplied, all +completion specifications. +The \fB\-D\fP option indicates that the remaining options and actions should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The \fB\-E\fP option indicates that the remaining options and actions should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +.sp 1 +The process of applying these completion specifications when word completion +is attempted is described above under \fBProgrammable Completion\fP. +.sp 1 +Other options, if specified, have the following meanings. +The arguments to the \fB\-G\fP, \fB\-W\fP, and \fB\-X\fP options +(and, if necessary, the \fB\-P\fP and \fB\-S\fP options) +should be quoted to protect them from expansion before the +.B complete +builtin is invoked. +.RS +.PD 0 +.TP 8 +\fB\-o\fP \fIcomp-option\fP +The \fIcomp-option\fP controls several aspects of the compspec's behavior +beyond the simple generation of completions. +\fIcomp-option\fP may be one of: +.RS +.TP 8 +.B bashdefault +Perform the rest of the default \fBbash\fP completions if the compspec +generates no matches. +.TP 8 +.B default +Use readline's default filename completion if the compspec generates +no matches. +.TP 8 +.B dirnames +Perform directory name completion if the compspec generates no matches. +.TP 8 +.B filenames +Tell readline that the compspec generates filenames, so it can perform any +filename\-specific processing (like adding a slash to directory names, +quoting special characters, or suppressing trailing spaces). +Intended to be used with shell functions. +.TP 8 +.B noquote +Tell readline not to quote the completed words if they are filenames +(quoting filenames is the default). +.TP 8 +.B nospace +Tell readline not to append a space (the default) to words completed at +the end of the line. +.TP 8 +.B plusdirs +After any matches defined by the compspec are generated, +directory name completion is attempted and any +matches are added to the results of the other actions. +.RE +.TP 8 +\fB\-A\fP \fIaction\fP +The \fIaction\fP may be one of the following to generate a list of possible +completions: +.RS +.TP 8 +.B alias +Alias names. May also be specified as \fB\-a\fP. +.TP 8 +.B arrayvar +Array variable names. +.TP 8 +.B binding +\fBReadline\fP key binding names. +.TP 8 +.B builtin +Names of shell builtin commands. May also be specified as \fB\-b\fP. +.TP 8 +.B command +Command names. May also be specified as \fB\-c\fP. +.TP 8 +.B directory +Directory names. May also be specified as \fB\-d\fP. +.TP 8 +.B disabled +Names of disabled shell builtins. +.TP 8 +.B enabled +Names of enabled shell builtins. +.TP 8 +.B export +Names of exported shell variables. May also be specified as \fB\-e\fP. +.TP 8 +.B file +File names. May also be specified as \fB\-f\fP. +.TP 8 +.B function +Names of shell functions. +.TP 8 +.B group +Group names. May also be specified as \fB\-g\fP. +.TP 8 +.B helptopic +Help topics as accepted by the \fBhelp\fP builtin. +.TP 8 +.B hostname +Hostnames, as taken from the file specified by the +.SM +.B HOSTFILE +shell variable. +.TP 8 +.B job +Job names, if job control is active. May also be specified as \fB\-j\fP. +.TP 8 +.B keyword +Shell reserved words. May also be specified as \fB\-k\fP. +.TP 8 +.B running +Names of running jobs, if job control is active. +.TP 8 +.B service +Service names. May also be specified as \fB\-s\fP. +.TP 8 +.B setopt +Valid arguments for the \fB\-o\fP option to the \fBset\fP builtin. +.TP 8 +.B shopt +Shell option names as accepted by the \fBshopt\fP builtin. +.TP 8 +.B signal +Signal names. +.TP 8 +.B stopped +Names of stopped jobs, if job control is active. +.TP 8 +.B user +User names. May also be specified as \fB\-u\fP. +.TP 8 +.B variable +Names of all shell variables. May also be specified as \fB\-v\fP. +.RE +.TP 8 +\fB\-C\fP \fIcommand\fP +\fIcommand\fP is executed in a subshell environment, and its output is +used as the possible completions. +.TP 8 +\fB\-F\fP \fIfunction\fP +The shell function \fIfunction\fP is executed in the current shell +environment. +When the function is executed, +the first argument (\fB$1\fP) is the name of the command whose arguments are +being completed, +the second argument (\fB$2\fP) is the word being completed, +and the third argument (\fB$3\fP) is the word preceding the word being +completed on the current command line. +When it finishes, the possible completions are retrieved from the value +of the +.SM +.B COMPREPLY +array variable. +.TP 8 +\fB\-G\fP \fIglobpat\fP +The pathname expansion pattern \fIglobpat\fP is expanded to generate +the possible completions. +.TP 8 +\fB\-P\fP \fIprefix\fP +\fIprefix\fP is added at the beginning of each possible completion +after all other options have been applied. +.TP 8 +\fB\-S\fP \fIsuffix\fP +\fIsuffix\fP is appended to each possible completion +after all other options have been applied. +.TP 8 +\fB\-W\fP \fIwordlist\fP +The \fIwordlist\fP is split using the characters in the +.SM +.B IFS +special variable as delimiters, and each resultant word is expanded. +The possible completions are the members of the resultant list which +match the word being completed. +.TP 8 +\fB\-X\fP \fIfilterpat\fP +\fIfilterpat\fP is a pattern as used for pathname expansion. +It is applied to the list of possible completions generated by the +preceding options and arguments, and each completion matching +\fIfilterpat\fP is removed from the list. +A leading \fB!\fP in \fIfilterpat\fP negates the pattern; in this +case, any completion not matching \fIfilterpat\fP is removed. +.PD +.PP +The return value is true unless an invalid option is supplied, an option +other than \fB\-p\fP or \fB\-r\fP is supplied without a \fIname\fP +argument, an attempt is made to remove a completion specification for +a \fIname\fP for which no specification exists, or +an error occurs adding a completion specification. +.RE +.TP +\fBcompopt\fP [\fB\-o\fP \fIoption\fP] [\fB\-DE\fP] [\fB+o\fP \fIoption\fP] [\fIname\fP] +Modify completion options for each \fIname\fP according to the +\fIoption\fPs, or for the +currently-executing completion if no \fIname\fPs are supplied. +If no \fIoption\fPs are given, display the completion options for each +\fIname\fP or the current completion. +The possible values of \fIoption\fP are those valid for the \fBcomplete\fP +builtin described above. +The \fB\-D\fP option indicates that the remaining options should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The \fB\-E\fP option indicates that the remaining options should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +.sp 1 +The return value is true unless an invalid option is supplied, an attempt +is made to modify the options for a \fIname\fP for which no completion +specification exists, or an output error occurs. +.TP +\fBcontinue\fP [\fIn\fP] +Resume the next iteration of the enclosing +.BR for , +.BR while , +.BR until , +or +.B select +loop. +If +.I n +is specified, resume at the \fIn\fPth enclosing loop. +.I n +must be \(>= 1. If +.I n +is greater than the number of enclosing loops, the last enclosing loop +(the ``top-level'' loop) is resumed. +The return value is 0 unless \fIn\fP is not greater than or equal to 1. +.TP +\fBdeclare\fP [\fB\-aAfFgilnrtux\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +.PD 0 +.TP +\fBtypeset\fP [\fB\-aAfFgilnrtux\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +.PD +Declare variables and/or give them attributes. +If no \fIname\fPs are given then display the values of variables. +The +.B \-p +option will display the attributes and values of each +.IR name . +When +.B \-p +is used with \fIname\fP arguments, additional options, +other than \fB\-f\fP and \fB\-F\fP, are ignored. +When +.B \-p +is supplied without \fIname\fP arguments, it will display the attributes +and values of all variables having the attributes specified by the +additional options. +If no other options are supplied with \fB\-p\fP, \fBdeclare\fP will display +the attributes and values of all shell variables. The \fB\-f\fP option +will restrict the display to shell functions. +The +.B \-F +option inhibits the display of function definitions; only the +function name and attributes are printed. +If the \fBextdebug\fP shell option is enabled using \fBshopt\fP, +the source file name and line number where the function is defined +are displayed as well. The +.B \-F +option implies +.BR \-f . +The +.B \-g +option forces variables to be created or modified at the global scope, +even when \fBdeclare\fP is executed in a shell function. +It is ignored in all other cases. +The following options can +be used to restrict output to variables with the specified attribute or +to give variables attributes: +.RS +.PD 0 +.TP +.B \-a +Each \fIname\fP is an indexed array variable (see +.B Arrays +above). +.TP +.B \-A +Each \fIname\fP is an associative array variable (see +.B Arrays +above). +.TP +.B \-f +Use function names only. +.TP +.B \-i +The variable is treated as an integer; arithmetic evaluation (see +.SM +.B "ARITHMETIC EVALUATION" +above) is performed when the variable is assigned a value. +.TP +.B \-l +When the variable is assigned a value, all upper-case characters are +converted to lower-case. +The upper-case attribute is disabled. +.TP +.B \-n +Give each \fIname\fP the \fInameref\fP attribute, making +it a name reference to another variable. +That other variable is defined by the value of \fIname\fP. +All references and assignments to \fIname\fP, except for changing the +\fB\-n\fP attribute itself, are performed on the variable referenced by +\fIname\fP's value. +The \fB\-n\fP attribute cannot be applied to array variables. +.TP +.B \-r +Make \fIname\fPs readonly. These names cannot then be assigned values +by subsequent assignment statements or unset. +.TP +.B \-t +Give each \fIname\fP the \fItrace\fP attribute. +Traced functions inherit the \fBDEBUG\fP and \fBRETURN\fP traps from +the calling shell. +The trace attribute has no special meaning for variables. +.TP +.B \-u +When the variable is assigned a value, all lower-case characters are +converted to upper-case. +The lower-case attribute is disabled. +.TP +.B \-x +Mark \fIname\fPs for export to subsequent commands via the environment. +.PD +.PP +Using `+' instead of `\-' +turns off the attribute instead, +with the exceptions that \fB+a\fP +may not be used to destroy an array variable and \fB+r\fP will not +remove the readonly attribute. +When used in a function, +.B declare +and +.B typeset +make each +\fIname\fP local, as with the +.B local +command, +unless the \fB\-g\fP option is supplied. +If a variable name is followed by =\fIvalue\fP, the value of +the variable is set to \fIvalue\fP. +When using \fB\-a\fP or \fB\-A\fP and the compound assignment syntax to +create array variables, additional attributes do not take effect until +subsequent assignments. +The return value is 0 unless an invalid option is encountered, +an attempt is made to define a function using +.if n ``\-f foo=bar'', +.if t \f(CW\-f foo=bar\fP, +an attempt is made to assign a value to a readonly variable, +an attempt is made to assign a value to an array variable without +using the compound assignment syntax (see +.B Arrays +above), one of the \fInames\fP is not a valid shell variable name, +an attempt is made to turn off readonly status for a readonly variable, +an attempt is made to turn off array status for an array variable, +or an attempt is made to display a non-existent function with \fB\-f\fP. +.RE +.TP +.B dirs [\fB\-clpv\fP] [+\fIn\fP] [\-\fIn\fP] +Without options, displays the list of currently remembered directories. +The default display is on a single line with directory names separated +by spaces. +Directories are added to the list with the +.B pushd +command; the +.B popd +command removes entries from the list. +.RS +.PD 0 +.TP +.B \-c +Clears the directory stack by deleting all of the entries. +.TP +.B \-l +Produces a listing using full pathnames; +the default listing format uses a tilde to denote the home directory. +.TP +.B \-p +Print the directory stack with one entry per line. +.TP +.B \-v +Print the directory stack with one entry per line, +prefixing each entry with its index in the stack. +.TP +\fB+\fP\fIn\fP +Displays the \fIn\fPth entry counting from the left of the list +shown by +.B dirs +when invoked without options, starting with zero. +.TP +\fB\-\fP\fIn\fP +Displays the \fIn\fPth entry counting from the right of the list +shown by +.B dirs +when invoked without options, starting with zero. +.PD +.PP +The return value is 0 unless an +invalid option is supplied or \fIn\fP indexes beyond the end +of the directory stack. +.RE +.TP +\fBdisown\fP [\fB\-ar\fP] [\fB\-h\fP] [\fIjobspec\fP ...] +Without options, remove each +.I jobspec +from the table of active jobs. +If +.I jobspec +is not present, and neither the \fB\-a\fP nor the \fB\-r\fP option +is supplied, the \fIcurrent job\fP is used. +If the \fB\-h\fP option is given, each +.I jobspec +is not removed from the table, but is marked so that +.SM +.B SIGHUP +is not sent to the job if the shell receives a +.SM +.BR SIGHUP . +If no +.I jobspec +is supplied, the +.B \-a +option means to remove or mark all jobs; the +.B \-r +option without a +.I jobspec +argument restricts operation to running jobs. +The return value is 0 unless a +.I jobspec +does not specify a valid job. +.TP +\fBecho\fP [\fB\-neE\fP] [\fIarg\fP ...] +Output the \fIarg\fPs, separated by spaces, followed by a newline. +The return status is 0 unless a write error occurs. +If \fB\-n\fP is specified, the trailing newline is +suppressed. If the \fB\-e\fP option is given, interpretation of +the following backslash-escaped characters is enabled. The +.B \-E +option disables the interpretation of these escape characters, +even on systems where they are interpreted by default. +The \fBxpg_echo\fP shell option may be used to +dynamically determine whether or not \fBecho\fP expands these +escape characters by default. +.B echo +does not interpret \fB\-\-\fP to mean the end of options. +.B echo +interprets the following escape sequences: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ec +suppress further output +.TP +.B \ee +.TP +.B \eE +an escape character +.TP +.B \ef +form feed +.TP +.B \en +new line +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\e +backslash +.TP +.B \e0\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(zero to three octal digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.TP +.B \eu\fIHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHH\fP (one to four hex digits) +.TP +.B \eU\fIHHHHHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHHHHHH\fP (one to eight hex digits) +.PD +.RE +.TP +\fBenable\fP [\fB\-a\fP] [\fB\-dnps\fP] [\fB\-f\fP \fIfilename\fP] [\fIname\fP ...] +Enable and disable builtin shell commands. +Disabling a builtin allows a disk command which has the same name +as a shell builtin to be executed without specifying a full pathname, +even though the shell normally searches for builtins before disk commands. +If \fB\-n\fP is used, each \fIname\fP +is disabled; otherwise, +\fInames\fP are enabled. For example, to use the +.B test +binary found via the +.SM +.B PATH +instead of the shell builtin version, run +.if t \f(CWenable -n test\fP. +.if n ``enable -n test''. +The +.B \-f +option means to load the new builtin command +.I name +from shared object +.IR filename , +on systems that support dynamic loading. The +.B \-d +option will delete a builtin previously loaded with +.BR \-f . +If no \fIname\fP arguments are given, or if the +.B \-p +option is supplied, a list of shell builtins is printed. +With no other option arguments, the list consists of all enabled +shell builtins. +If \fB\-n\fP is supplied, only disabled builtins are printed. +If \fB\-a\fP is supplied, the list printed includes all builtins, with an +indication of whether or not each is enabled. +If \fB\-s\fP is supplied, the output is restricted to the POSIX +\fIspecial\fP builtins. +The return value is 0 unless a +.I name +is not a shell builtin or there is an error loading a new builtin +from a shared object. +.TP +\fBeval\fP [\fIarg\fP ...] +The \fIarg\fPs are read and concatenated together into a single +command. This command is then read and executed by the shell, and +its exit status is returned as the value of +.BR eval . +If there are no +.IR args , +or only null arguments, +.B eval +returns 0. +.TP +\fBexec\fP [\fB\-cl\fP] [\fB\-a\fP \fIname\fP] [\fIcommand\fP [\fIarguments\fP]] +If +.I command +is specified, it replaces the shell. +No new process is created. The +.I arguments +become the arguments to \fIcommand\fP. +If the +.B \-l +option is supplied, +the shell places a dash at the beginning of the zeroth argument passed to +.IR command . +This is what +.IR login (1) +does. The +.B \-c +option causes +.I command +to be executed with an empty environment. If +.B \-a +is supplied, the shell passes +.I name +as the zeroth argument to the executed command. +If +.I command +cannot be executed for some reason, a non-interactive shell exits, +unless the +.B execfail +shell option +is enabled. In that case, it returns failure. +An interactive shell returns failure if the file cannot be executed. +If +.I command +is not specified, any redirections take effect in the current shell, +and the return status is 0. If there is a redirection error, the +return status is 1. +.TP +\fBexit\fP [\fIn\fP] +Cause the shell to exit +with a status of \fIn\fP. If +.I n +is omitted, the exit status +is that of the last command executed. +A trap on +.SM +.B EXIT +is executed before the shell terminates. +.TP +\fBexport\fP [\fB\-fn\fP\^] [\fIname\fP[=\fIword\fP]] ... +.PD 0 +.TP +.B export \-p +.PD +The supplied +.I names +are marked for automatic export to the environment of +subsequently executed commands. If the +.B \-f +option is given, +the +.I names +refer to functions. +If no +.I names +are given, or if the +.B \-p +option is supplied, a list +of names of all exported variables is printed. +The +.B \-n +option causes the export property to be removed from each +\fIname\fP. +If a variable name is followed by =\fIword\fP, the value of +the variable is set to \fIword\fP. +.B export +returns an exit status of 0 unless an invalid option is +encountered, +one of the \fInames\fP is not a valid shell variable name, or +.B \-f +is supplied with a +.I name +that is not a function. +.TP +\fBfc\fP [\fB\-e\fP \fIename\fP] [\fB\-lnr\fP] [\fIfirst\fP] [\fIlast\fP] +.PD 0 +.TP +\fBfc\fP \fB\-s\fP [\fIpat\fP=\fIrep\fP] [\fIcmd\fP] +.PD +The first form selects a range of commands from +.I first +to +.I last +from the history list and displays or edits and re-executes them. +.I First +and +.I last +may be specified as a string (to locate the last command beginning +with that string) or as a number (an index into the history list, +where a negative number is used as an offset from the current +command number). If +.I last +is not specified it is set to +the current command for listing (so that +.if n ``fc \-l \-10'' +.if t \f(CWfc \-l \-10\fP +prints the last 10 commands) and to +.I first +otherwise. +If +.I first +is not specified it is set to the previous +command for editing and \-16 for listing. +.sp 1 +The +.B \-n +option suppresses +the command numbers when listing. The +.B \-r +option reverses the order of +the commands. If the +.B \-l +option is given, +the commands are listed on +standard output. Otherwise, the editor given by +.I ename +is invoked +on a file containing those commands. If +.I ename +is not given, the +value of the +.SM +.B FCEDIT +variable is used, and +the value of +.SM +.B EDITOR +if +.SM +.B FCEDIT +is not set. If neither variable is set, +.FN vi +is used. When editing is complete, the edited commands are +echoed and executed. +.sp 1 +In the second form, \fIcommand\fP is re-executed after each instance +of \fIpat\fP is replaced by \fIrep\fP. +\fICommand\fP is intepreted the same as \fIfirst\fP above. +A useful alias to use with this is +.if n ``r="fc -s"'', +.if t \f(CWr='fc \-s'\fP, +so that typing +.if n ``r cc'' +.if t \f(CWr cc\fP +runs the last command beginning with +.if n ``cc'' +.if t \f(CWcc\fP +and typing +.if n ``r'' +.if t \f(CWr\fP +re-executes the last command. +.sp 1 +If the first form is used, the return value is 0 unless an invalid +option is encountered or +.I first +or +.I last +specify history lines out of range. +If the +.B \-e +option is supplied, the return value is the value of the last +command executed or failure if an error occurs with the temporary +file of commands. If the second form is used, the return status +is that of the command re-executed, unless +.I cmd +does not specify a valid history line, in which case +.B fc +returns failure. +.TP +\fBfg\fP [\fIjobspec\fP] +Resume +.I jobspec +in the foreground, and make it the current job. +If +.I jobspec +is not present, the shell's notion of the \fIcurrent job\fP is used. +The return value is that of the command placed into the foreground, +or failure if run when job control is disabled or, when run with +job control enabled, if +.I jobspec +does not specify a valid job or +.I jobspec +specifies a job that was started without job control. +.TP +\fBgetopts\fP \fIoptstring\fP \fIname\fP [\fIargs\fP] +.B getopts +is used by shell procedures to parse positional parameters. +.I optstring +contains the option characters to be recognized; if a character +is followed by a colon, the option is expected to have an +argument, which should be separated from it by white space. +The colon and question mark characters may not be used as +option characters. +Each time it is invoked, +.B getopts +places the next option in the shell variable +.IR name , +initializing +.I name +if it does not exist, +and the index of the next argument to be processed into the +variable +.SM +.BR OPTIND . +.SM +.B OPTIND +is initialized to 1 each time the shell or a shell script +is invoked. When an option requires an argument, +.B getopts +places that argument into the variable +.SM +.BR OPTARG . +The shell does not reset +.SM +.B OPTIND +automatically; it must be manually reset between multiple +calls to +.B getopts +within the same shell invocation if a new set of parameters +is to be used. +.sp 1 +When the end of options is encountered, \fBgetopts\fP exits with a +return value greater than zero. +.SM +.B OPTIND +is set to the index of the first non-option argument, +and \fIname\fP is set to ?. +.sp 1 +.B getopts +normally parses the positional parameters, but if more arguments are +given in +.IR args , +.B getopts +parses those instead. +.sp 1 +.B getopts +can report errors in two ways. If the first character of +.I optstring +is a colon, +.I silent +error reporting is used. In normal operation, diagnostic messages +are printed when invalid options or missing option arguments are +encountered. +If the variable +.SM +.B OPTERR +is set to 0, no error messages will be displayed, even if the first +character of +.I optstring +is not a colon. +.sp 1 +If an invalid option is seen, +.B getopts +places ? into +.I name +and, if not silent, +prints an error message and unsets +.SM +.BR OPTARG . +If +.B getopts +is silent, +the option character found is placed in +.SM +.B OPTARG +and no diagnostic message is printed. +.sp 1 +If a required argument is not found, and +.B getopts +is not silent, +a question mark (\^\fB?\fP\^) is placed in +.IR name , +.SM +.B OPTARG +is unset, and a diagnostic message is printed. +If +.B getopts +is silent, then a colon (\^\fB:\fP\^) is placed in +.I name +and +.SM +.B OPTARG +is set to the option character found. +.sp 1 +.B getopts +returns true if an option, specified or unspecified, is found. +It returns false if the end of options is encountered or an +error occurs. +.TP +\fBhash\fP [\fB\-lr\fP] [\fB\-p\fP \fIfilename\fP] [\fB\-dt\fP] [\fIname\fP] +Each time \fBhash\fP is invoked, +the full pathname of the command +.I name +is determined by searching +the directories in +.B $PATH +and remembered. Any previously-remembered pathname is discarded. +If the +.B \-p +option is supplied, no path search is performed, and +.I filename +is used as the full filename of the command. +The +.B \-r +option causes the shell to forget all +remembered locations. +The +.B \-d +option causes the shell to forget the remembered location of each \fIname\fP. +If the +.B \-t +option is supplied, the full pathname to which each \fIname\fP corresponds +is printed. If multiple \fIname\fP arguments are supplied with \fB\-t\fP, +the \fIname\fP is printed before the hashed full pathname. +The +.B \-l +option causes output to be displayed in a format that may be reused as input. +If no arguments are given, or if only \fB\-l\fP is supplied, +information about remembered commands is printed. +The return status is true unless a +.I name +is not found or an invalid option is supplied. +.TP +\fBhelp\fP [\fB\-dms\fP] [\fIpattern\fP] +Display helpful information about builtin commands. If +.I pattern +is specified, +.B help +gives detailed help on all commands matching +.IR pattern ; +otherwise help for all the builtins and shell control structures +is printed. +.RS +.PD 0 +.TP +.B \-d +Display a short description of each \fIpattern\fP +.TP +.B \-m +Display the description of each \fIpattern\fP in a manpage-like format +.TP +.B \-s +Display only a short usage synopsis for each \fIpattern\fP +.PD +.PP +The return status is 0 unless no command matches +.IR pattern . +.RE +.TP +\fBhistory [\fIn\fP] +.PD 0 +.TP +\fBhistory\fP \fB\-c\fP +.TP +\fBhistory \-d\fP \fIoffset\fP +.TP +\fBhistory\fP \fB\-anrw\fP [\fIfilename\fP] +.TP +\fBhistory\fP \fB\-p\fP \fIarg\fP [\fIarg ...\fP] +.TP +\fBhistory\fP \fB\-s\fP \fIarg\fP [\fIarg ...\fP] +.PD +With no options, display the command +history list with line numbers. Lines listed +with a +.B * +have been modified. An argument of +.I n +lists only the last +.I n +lines. +If the shell variable +.SM +.B HISTTIMEFORMAT +is set and not null, +it is used as a format string for \fIstrftime\fP(3) to display +the time stamp associated with each displayed history entry. +No intervening blank is printed between the formatted time stamp +and the history line. +If \fIfilename\fP is supplied, it is used as the +name of the history file; if not, the value of +.SM +.B HISTFILE +is used. Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-c +Clear the history list by deleting all the entries. +.TP +\fB\-d\fP \fIoffset\fP +Delete the history entry at position \fIoffset\fP. +.TP +.B \-a +Append the ``new'' history lines (history lines entered since the +beginning of the current \fBbash\fP session) to the history file. +.TP +.B \-n +Read the history lines not already read from the history +file into the current history list. These are lines +appended to the history file since the beginning of the +current \fBbash\fP session. +.TP +.B \-r +Read the contents of the history file +and append them to the current history list. +.TP +.B \-w +Write the current history list to the history file, overwriting the +history file's contents. +.TP +.B \-p +Perform history substitution on the following \fIargs\fP and display +the result on the standard output. +Does not store the results in the history list. +Each \fIarg\fP must be quoted to disable normal history expansion. +.TP +.B \-s +Store the +.I args +in the history list as a single entry. The last command in the +history list is removed before the +.I args +are added. +.PD +.PP +If the +.SM +.B HISTTIMEFORMAT +variable is set, the time stamp information +associated with each history entry is written to the history file, +marked with the history comment character. +When the history file is read, lines beginning with the history +comment character followed immediately by a digit are interpreted +as timestamps for the previous history line. +The return value is 0 unless an invalid option is encountered, an +error occurs while reading or writing the history file, an invalid +\fIoffset\fP is supplied as an argument to \fB\-d\fP, or the +history expansion supplied as an argument to \fB\-p\fP fails. +.RE +.TP +\fBjobs\fP [\fB\-lnprs\fP] [ \fIjobspec\fP ... ] +.PD 0 +.TP +\fBjobs\fP \fB\-x\fP \fIcommand\fP [ \fIargs\fP ... ] +.PD +The first form lists the active jobs. The options have the following +meanings: +.RS +.PD 0 +.TP +.B \-l +List process IDs +in addition to the normal information. +.TP +.B \-n +Display information only about jobs that have changed status since +the user was last notified of their status. +.TP +.B \-p +List only the process ID of the job's process group +leader. +.TP +.B \-r +Display only running jobs. +.TP +.B \-s +Display only stopped jobs. +.PD +.PP +If +.I jobspec +is given, output is restricted to information about that job. +The return status is 0 unless an invalid option is encountered +or an invalid +.I jobspec +is supplied. +.PP +If the +.B \-x +option is supplied, +.B jobs +replaces any +.I jobspec +found in +.I command +or +.I args +with the corresponding process group ID, and executes +.I command +passing it +.IR args , +returning its exit status. +.RE +.TP +\fBkill\fP [\fB\-s\fP \fIsigspec\fP | \fB\-n\fP \fIsignum\fP | \fB\-\fP\fIsigspec\fP] [\fIpid\fP | \fIjobspec\fP] ... +.PD 0 +.TP +\fBkill\fP \fB\-l\fP [\fIsigspec\fP | \fIexit_status\fP] +.PD +Send the signal named by +.I sigspec +or +.I signum +to the processes named by +.I pid +or +.IR jobspec . +.I sigspec +is either a case-insensitive signal name such as +.SM +.B SIGKILL +(with or without the +.SM +.B SIG +prefix) or a signal number; +.I signum +is a signal number. +If +.I sigspec +is not present, then +.SM +.B SIGTERM +is assumed. +An argument of +.B \-l +lists the signal names. +If any arguments are supplied when +.B \-l +is given, the names of the signals corresponding to the arguments are +listed, and the return status is 0. +The \fIexit_status\fP argument to +.B \-l +is a number specifying either a signal number or the exit status of +a process terminated by a signal. +.B kill +returns true if at least one signal was successfully sent, or false +if an error occurs or an invalid option is encountered. +.TP +\fBlet\fP \fIarg\fP [\fIarg\fP ...] +Each +.I arg +is an arithmetic expression to be evaluated (see +.SM +.B "ARITHMETIC EVALUATION" +above). +If the last +.I arg +evaluates to 0, +.B let +returns 1; 0 is returned otherwise. +.TP +\fBlocal\fP [\fIoption\fP] [\fIname\fP[=\fIvalue\fP] ...] +For each argument, a local variable named +.I name +is created, and assigned +.IR value . +The \fIoption\fP can be any of the options accepted by \fBdeclare\fP. +When +.B local +is used within a function, it causes the variable +.I name +to have a visible scope restricted to that function and its children. +With no operands, +.B local +writes a list of local variables to the standard output. It is +an error to use +.B local +when not within a function. The return status is 0 unless +.B local +is used outside a function, an invalid +.I name +is supplied, or +\fIname\fP is a readonly variable. +.TP +.B logout +Exit a login shell. +.TP +\fBmapfile\fP [\fB\-n\fP \fIcount\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-s\fP \fIcount\fP] [\fB\-t\fP] [\fB\-u\fP \fIfd\fP] [\fB\-C\fP \fIcallback\fP] [\fB\-c\fP \fIquantum\fP] [\fIarray\fP] +.PD 0 +.TP +\fBreadarray\fP [\fB\-n\fP \fIcount\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-s\fP \fIcount\fP] [\fB\-t\fP] [\fB\-u\fP \fIfd\fP] [\fB\-C\fP \fIcallback\fP] [\fB\-c\fP \fIquantum\fP] [\fIarray\fP] +.PD +Read lines from the standard input into the indexed array variable +.IR array , +or from file descriptor +.IR fd +if the +.B \-u +option is supplied. +The variable +.SM +.B MAPFILE +is the default \fIarray\fP. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Copy at most +.I count +lines. If \fIcount\fP is 0, all lines are copied. +.TP +.B \-O +Begin assigning to +.I array +at index +.IR origin . +The default index is 0. +.TP +.B \-s +Discard the first \fIcount\fP lines read. +.TP +.B \-t +Remove a trailing newline from each line read. +.TP +.B \-u +Read lines from file descriptor \fIfd\fP instead of the standard input. +.TP +.B \-C +Evaluate +.I callback +each time \fIquantum\fP lines are read. The \fB\-c\fP option specifies +.IR quantum . +.TP +.B \-c +Specify the number of lines read between each call to +.IR callback . +.PD +.PP +If +.B \-C +is specified without +.BR \-c , +the default quantum is 5000. +When \fIcallback\fP is evaluated, it is supplied the index of the next +array element to be assigned and the line to be assigned to that element +as additional arguments. +\fIcallback\fP is evaluated after the line is read but before the +array element is assigned. +.PP +If not supplied with an explicit origin, \fBmapfile\fP will clear \fIarray\fP +before assigning to it. +.PP +\fBmapfile\fP returns successfully unless an invalid option or option +argument is supplied, \fIarray\fP is invalid or unassignable, or if +\fIarray\fP is not an indexed array. +.RE +.TP +\fBpopd\fP [\-\fBn\fP] [+\fIn\fP] [\-\fIn\fP] +Removes entries from the directory stack. With no arguments, +removes the top directory from the stack, and performs a +.B cd +to the new top directory. +Arguments, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Suppresses the normal change of directory when removing directories +from the stack, so that only the stack is manipulated. +.TP +\fB+\fP\fIn\fP +Removes the \fIn\fPth entry counting from the left of the list +shown by +.BR dirs , +starting with zero. For example: +.if n ``popd +0'' +.if t \f(CWpopd +0\fP +removes the first directory, +.if n ``popd +1'' +.if t \f(CWpopd +1\fP +the second. +.TP +\fB\-\fP\fIn\fP +Removes the \fIn\fPth entry counting from the right of the list +shown by +.BR dirs , +starting with zero. For example: +.if n ``popd -0'' +.if t \f(CWpopd -0\fP +removes the last directory, +.if n ``popd -1'' +.if t \f(CWpopd -1\fP +the next to last. +.PD +.PP +If the +.B popd +command is successful, a +.B dirs +is performed as well, and the return status is 0. +.B popd +returns false if an invalid option is encountered, the directory stack +is empty, a non-existent directory stack entry is specified, or the +directory change fails. +.RE +.TP +\fBprintf\fP [\fB\-v\fP \fIvar\fP] \fIformat\fP [\fIarguments\fP] +Write the formatted \fIarguments\fP to the standard output under the +control of the \fIformat\fP. +The \fB\-v\fP option causes the output to be assigned to the variable +\fIvar\fP rather than being printed to the standard output. +.sp 1 +The \fIformat\fP is a character string which contains three types of objects: +plain characters, which are simply copied to standard output, character +escape sequences, which are converted and copied to the standard output, and +format specifications, each of which causes printing of the next successive +\fIargument\fP. +In addition to the standard \fIprintf\fP(1) format specifications, +\fBprintf\fP interprets the following extensions: +.RS +.PD 0 +.TP +.B %b +causes +\fBprintf\fP to expand backslash escape sequences in the corresponding +\fIargument\fP (except that \fB\ec\fP terminates output, backslashes in +\fB\e\(aq\fP, \fB\e"\fP, and \fB\e?\fP are not removed, and octal escapes +beginning with \fB\e0\fP may contain up to four digits). +.TP +.B %q +causes \fBprintf\fP to output the corresponding +\fIargument\fP in a format that can be reused as shell input. +.TP +.B %(\fIdatefmt\fP)T +causes \fBprintf\fP to output the date-time string resulting from using +\fIdatefmt\fP as a format string for \fIstrftime\fP(3). +The corresponding \fIargument\fP is an integer representing the number of +seconds since the epoch. +Two special argument values may be used: -1 represents the current +time, and -2 represents the time the shell was invoked. +If no argument is specified, conversion behaves as if -1 had been given. +This is an exception to the usual \fBprintf\fP behavior. +.PD +.PP +Arguments to non-string format specifiers are treated as C constants, +except that a leading plus or minus sign is allowed, and if the leading +character is a single or double quote, the value is the ASCII value of +the following character. +.PP +The \fIformat\fP is reused as necessary to consume all of the \fIarguments\fP. +If the \fIformat\fP requires more \fIarguments\fP than are supplied, the +extra format specifications behave as if a zero value or null string, as +appropriate, had been supplied. +The return value is zero on success, non-zero on failure. +.RE +.TP +\fBpushd\fP [\fB\-n\fP] [+\fIn\fP] [\-\fIn\fP] +.PD 0 +.TP +\fBpushd\fP [\fB\-n\fP] [\fIdir\fP] +.PD +Adds a directory to the top of the directory stack, or rotates +the stack, making the new top of the stack the current working +directory. With no arguments, exchanges the top two directories +and returns 0, unless the directory stack is empty. +Arguments, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Suppresses the normal change of directory when adding directories +to the stack, so that only the stack is manipulated. +.TP +\fB+\fP\fIn\fP +Rotates the stack so that the \fIn\fPth directory +(counting from the left of the list shown by +.BR dirs , +starting with zero) +is at the top. +.TP +\fB\-\fP\fIn\fP +Rotates the stack so that the \fIn\fPth directory +(counting from the right of the list shown by +.BR dirs , +starting with zero) is at the top. +.TP +.I dir +Adds +.I dir +to the directory stack at the top, making it the +new current working directory as if it had been supplied as the argument +to the \fBcd\fP builtin. +.PD +.PP +If the +.B pushd +command is successful, a +.B dirs +is performed as well. +If the first form is used, +.B pushd +returns 0 unless the cd to +.I dir +fails. With the second form, +.B pushd +returns 0 unless the directory stack is empty, +a non-existent directory stack element is specified, +or the directory change to the specified new current directory +fails. +.RE +.TP +\fBpwd\fP [\fB\-LP\fP] +Print the absolute pathname of the current working directory. +The pathname printed contains no symbolic links if the +.B \-P +option is supplied or the +.B \-o physical +option to the +.B set +builtin command is enabled. +If the +.B \-L +option is used, the pathname printed may contain symbolic links. +The return status is 0 unless an error occurs while +reading the name of the current directory or an +invalid option is supplied. +.TP +\fBread\fP [\fB\-ers\fP] [\fB\-a\fP \fIaname\fP] [\fB\-d\fP \fIdelim\fP] [\fB\-i\fP \fItext\fP] [\fB\-n\fP \fInchars\fP] [\fB\-N\fP \fInchars\fP] [\fB\-p\fP \fIprompt\fP] [\fB\-t\fP \fItimeout\fP] [\fB\-u\fP \fIfd\fP] [\fIname\fP ...] +One line is read from the standard input, or from the file descriptor +\fIfd\fP supplied as an argument to the \fB\-u\fP option, and the first word +is assigned to the first +.IR name , +the second word to the second +.IR name , +and so on, with leftover words and their intervening separators assigned +to the last +.IR name . +If there are fewer words read from the input stream than names, +the remaining names are assigned empty values. +The characters in +.SM +.B IFS +are used to split the line into words using the same rules the shell +uses for expansion (described above under \fBWord Splitting\fP). +The backslash character (\fB\e\fP) may be used to remove any special +meaning for the next character read and for line continuation. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-a \fIaname\fP +The words are assigned to sequential indices +of the array variable +.IR aname , +starting at 0. +.I aname +is unset before any new values are assigned. +Other \fIname\fP arguments are ignored. +.TP +.B \-d \fIdelim\fP +The first character of \fIdelim\fP is used to terminate the input line, +rather than newline. +.TP +.B \-e +If the standard input +is coming from a terminal, +.B readline +(see +.SM +.B READLINE +above) is used to obtain the line. +Readline uses the current (or default, if line editing was not previously +active) editing settings. +.TP +.B \-i \fItext\fP +If +.B readline +is being used to read the line, \fItext\fP is placed into the editing +buffer before editing begins. +.TP +.B \-n \fInchars\fP +\fBread\fP returns after reading \fInchars\fP characters rather than +waiting for a complete line of input, but honor a delimiter if fewer +than \fInchars\fP characters are read before the delimiter. +.TP +.B \-N \fInchars\fP +\fBread\fP returns after reading exactly \fInchars\fP characters rather +than waiting for a complete line of input, unless EOF is encountered or +\fBread\fP times out. +Delimiter characters encountered in the input are +not treated specially and do not cause \fBread\fP to return until +\fInchars\fP characters are read. +.TP +.B \-p \fIprompt\fP +Display \fIprompt\fP on standard error, without a +trailing newline, before attempting to read any input. The prompt +is displayed only if input is coming from a terminal. +.TP +.B \-r +Backslash does not act as an escape character. +The backslash is considered to be part of the line. +In particular, a backslash-newline pair may not be used as a line +continuation. +.TP +.B \-s +Silent mode. If input is coming from a terminal, characters are +not echoed. +.TP +.B \-t \fItimeout\fP +Cause \fBread\fP to time out and return failure if a complete line of +input (or a specified number of characters) +is not read within \fItimeout\fP seconds. +\fItimeout\fP may be a decimal number with a fractional portion following +the decimal point. +This option is only effective if \fBread\fP is reading input from a +terminal, pipe, or other special file; it has no effect when reading +from regular files. +If \fBread\fP times out, \fBread\fP saves any partial input read into +the specified variable \fIname\fP. +If \fItimeout\fP is 0, \fBread\fP returns immediately, without trying to +read any data. The exit status is 0 if input is available on +the specified file descriptor, non-zero otherwise. +The exit status is greater than 128 if the timeout is exceeded. +.TP +.B \-u \fIfd\fP +Read input from file descriptor \fIfd\fP. +.PD +.PP +If no +.I names +are supplied, the line read is assigned to the variable +.SM +.BR REPLY . +The return code is zero, unless end-of-file is encountered, \fBread\fP +times out (in which case the return code is greater than 128), +a variable assignment error (such as assigning to a readonly variable) occurs, +or an invalid file descriptor is supplied as the argument to \fB\-u\fP. +.RE +.TP +\fBreadonly\fP [\fB\-aAf\fP] [\fB\-p\fP] [\fIname\fP[=\fIword\fP] ...] +.PD +The given +\fInames\fP are marked readonly; the values of these +.I names +may not be changed by subsequent assignment. +If the +.B \-f +option is supplied, the functions corresponding to the +\fInames\fP are so +marked. +The +.B \-a +option restricts the variables to indexed arrays; the +.B \-A +option restricts the variables to associative arrays. +If both options are supplied, +.B \-A +takes precedence. +If no +.I name +arguments are given, or if the +.B \-p +option is supplied, a list of all readonly names is printed. +The other options may be used to restrict the output to a subset of +the set of readonly names. +The +.B \-p +option causes output to be displayed in a format that +may be reused as input. +If a variable name is followed by =\fIword\fP, the value of +the variable is set to \fIword\fP. +The return status is 0 unless an invalid option is encountered, +one of the +.I names +is not a valid shell variable name, or +.B \-f +is supplied with a +.I name +that is not a function. +.TP +\fBreturn\fP [\fIn\fP] +Causes a function to stop executing and return the value specified by +.I n +to its caller. +If +.I n +is omitted, the return status is that of the last command +executed in the function body. If +.B return +is used outside a function, +but during execution of a script by the +.B . +(\fBsource\fP) command, it causes the shell to stop executing +that script and return either +.I n +or the exit status of the last command executed within the +script as the exit status of the script. +If \fIn\fP is supplied, the return value is its least significant +8 bits. +The return status is non-zero if +.B return +is supplied a non-numeric argument, or +is used outside a +function and not during execution of a script by \fB.\fP\^ or \fBsource\fP. +Any command associated with the \fBRETURN\fP trap is executed +before execution resumes after the function or script. +.TP +\fBset\fP [\fB\-\-abefhkmnptuvxBCEHPT\fP] [\fB\-o\fP \fIoption\-name\fP] [\fIarg\fP ...] +.PD 0 +.TP +\fBset\fP [\fB+abefhkmnptuvxBCEHPT\fP] [\fB+o\fP \fIoption\-name\fP] [\fIarg\fP ...] +.PD +Without options, the name and value of each shell variable are displayed +in a format that can be reused as input +for setting or resetting the currently-set variables. +Read-only variables cannot be reset. +In \fIposix\fP mode, only shell variables are listed. +The output is sorted according to the current locale. +When options are specified, they set or unset shell attributes. +Any arguments remaining after option processing are treated +as values for the positional parameters and are assigned, in order, to +.BR $1 , +.BR $2 , +.B ... +.BR $\fIn\fP . +Options, if specified, have the following meanings: +.RS +.PD 0 +.TP 8 +.B \-a +Automatically mark variables and functions which are modified or +created for export to the environment of subsequent commands. +.TP 8 +.B \-b +Report the status of terminated background jobs +immediately, rather than before the next primary prompt. This is +effective only when job control is enabled. +.TP 8 +.B \-e +Exit immediately if a +\fIpipeline\fP (which may consist of a single \fIsimple command\fP), +a \fIlist\fP, +or a \fIcompound command\fP +(see +.SM +.B SHELL GRAMMAR +above), exits with a non-zero status. +The shell does not exit if the +command that fails is part of the command list immediately following a +.B while +or +.B until +keyword, +part of the test following the +.B if +or +.B elif +reserved words, part of any command executed in a +.B && +or +.B || +list except the command following the final \fB&&\fP or \fB||\fP, +any command in a pipeline but the last, +or if the command's return value is +being inverted with +.BR ! . +If a compound command other than a subshell +returns a non-zero status because a command failed +while \fB\-e\fP was being ignored, the shell does not exit. +A trap on \fBERR\fP, if set, is executed before the shell exits. +This option applies to the shell environment and each subshell environment +separately (see +.SM +.B "COMMAND EXECUTION ENVIRONMENT" +above), and may cause +subshells to exit before executing all the commands in the subshell. +.if t .sp 0.5 +.if n .sp 1 +If a compound command or shell function executes in a context +where \fB\-e\fP is being ignored, +none of the commands executed within the compound command or function body +will be affected by the \fB\-e\fP setting, even if \fB\-e\fP is set +and a command returns a failure status. +If a compound command or shell function sets \fB\-e\fP while executing in +a context where \fB\-e\fP is ignored, that setting will not have any +effect until the compound command or the command containing the function +call completes. +.TP 8 +.B \-f +Disable pathname expansion. +.TP 8 +.B \-h +Remember the location of commands as they are looked up for execution. +This is enabled by default. +.TP 8 +.B \-k +All arguments in the form of assignment statements +are placed in the environment for a command, not just +those that precede the command name. +.TP 8 +.B \-m +Monitor mode. Job control is enabled. This option is on +by default for interactive shells on systems that support +it (see +.SM +.B JOB CONTROL +above). +All processes run in a separate process group. +When a background job completes, the shell prints a line +containing its exit status. +.TP 8 +.B \-n +Read commands but do not execute them. This may be used to +check a shell script for syntax errors. This is ignored by +interactive shells. +.TP 8 +.B \-o \fIoption\-name\fP +The \fIoption\-name\fP can be one of the following: +.RS +.TP 8 +.B allexport +Same as +.BR \-a . +.TP 8 +.B braceexpand +Same as +.BR \-B . +.TP 8 +.B emacs +Use an emacs-style command line editing interface. This is enabled +by default when the shell is interactive, unless the shell is started +with the +.B \-\-noediting +option. +This also affects the editing interface used for \fBread \-e\fP. +.TP 8 +.B errexit +Same as +.BR \-e . +.TP 8 +.B errtrace +Same as +.BR \-E . +.TP 8 +.B functrace +Same as +.BR \-T . +.TP 8 +.B hashall +Same as +.BR \-h . +.TP 8 +.B histexpand +Same as +.BR \-H . +.TP 8 +.B history +Enable command history, as described above under +.SM +.BR HISTORY . +This option is on by default in interactive shells. +.TP 8 +.B ignoreeof +The effect is as if the shell command +.if t \f(CWIGNOREEOF=10\fP +.if n ``IGNOREEOF=10'' +had been executed +(see +.B Shell Variables +above). +.TP 8 +.B keyword +Same as +.BR \-k . +.TP 8 +.B monitor +Same as +.BR \-m . +.TP 8 +.B noclobber +Same as +.BR \-C . +.TP 8 +.B noexec +Same as +.BR \-n . +.TP 8 +.B noglob +Same as +.BR \-f . +.TP 8 +.B nolog +Currently ignored. +.TP 8 +.B notify +Same as +.BR \-b . +.TP 8 +.B nounset +Same as +.BR \-u . +.TP 8 +.B onecmd +Same as +.BR \-t . +.TP 8 +.B physical +Same as +.BR \-P . +.TP 8 +.B pipefail +If set, the return value of a pipeline is the value of the last +(rightmost) command to exit with a non-zero status, or zero if all +commands in the pipeline exit successfully. +This option is disabled by default. +.TP 8 +.B posix +Change the behavior of +.B bash +where the default operation differs +from the POSIX standard to match the standard (\fIposix mode\fP). +See +.SM +.B "SEE ALSO" +below for a reference to a document that details how posix mode affects +bash's behavior. +.TP 8 +.B privileged +Same as +.BR \-p . +.TP 8 +.B verbose +Same as +.BR \-v . +.TP 8 +.B vi +Use a vi-style command line editing interface. +This also affects the editing interface used for \fBread \-e\fP. +.TP 8 +.B xtrace +Same as +.BR \-x . +.sp .5 +.PP +If +.B \-o +is supplied with no \fIoption\-name\fP, the values of the current options are +printed. +If +.B +o +is supplied with no \fIoption\-name\fP, a series of +.B set +commands to recreate the current option settings is displayed on +the standard output. +.RE +.TP 8 +.B \-p +Turn on +.I privileged +mode. In this mode, the +.SM +.B $ENV +and +.SM +.B $BASH_ENV +files are not processed, shell functions are not inherited from the +environment, and the +.SM +.BR SHELLOPTS , +.SM +.BR BASHOPTS , +.SM +.BR CDPATH , +and +.SM +.B GLOBIGNORE +variables, if they appear in the environment, are ignored. +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the \fB\-p\fP option is not supplied, these actions +are taken and the effective user id is set to the real user id. +If the \fB\-p\fP option is supplied at startup, the effective user id is +not reset. +Turning this option off causes the effective user +and group ids to be set to the real user and group ids. +.TP 8 +.B \-t +Exit after reading and executing one command. +.TP 8 +.B \-u +Treat unset variables and parameters other than the special +parameters "@" and "*" as an error when performing +parameter expansion. If expansion is attempted on an +unset variable or parameter, the shell prints an error message, and, +if not interactive, exits with a non-zero status. +.TP 8 +.B \-v +Print shell input lines as they are read. +.TP 8 +.B \-x +After expanding each \fIsimple command\fP, +\fBfor\fP command, \fBcase\fP command, \fBselect\fP command, or +arithmetic \fBfor\fP command, display the expanded value of +.SM +.BR PS4 , +followed by the command and its expanded arguments +or associated word list. +.TP 8 +.B \-B +The shell performs brace expansion (see +.B Brace Expansion +above). This is on by default. +.TP 8 +.B \-C +If set, +.B bash +does not overwrite an existing file with the +.BR > , +.BR >& , +and +.B <> +redirection operators. This may be overridden when +creating output files by using the redirection operator +.B >| +instead of +.BR > . +.TP 8 +.B \-E +If set, any trap on \fBERR\fP is inherited by shell functions, command +substitutions, and commands executed in a subshell environment. +The \fBERR\fP trap is normally not inherited in such cases. +.TP 8 +.B \-H +Enable +.B ! +style history substitution. This option is on by +default when the shell is interactive. +.TP 8 +.B \-P +If set, the shell does not resolve symbolic links when executing +commands such as +.B cd +that change the current working directory. It uses the +physical directory structure instead. By default, +.B bash +follows the logical chain of directories when performing commands +which change the current directory. +.TP 8 +.B \-T +If set, any traps on \fBDEBUG\fP and \fBRETURN\fP are inherited by shell +functions, command substitutions, and commands executed in a +subshell environment. +The \fBDEBUG\fP and \fBRETURN\fP traps are normally not inherited +in such cases. +.TP 8 +.B \-\- +If no arguments follow this option, then the positional parameters are +unset. Otherwise, the positional parameters are set to the +\fIarg\fPs, even if some of them begin with a +.BR \- . +.TP 8 +.B \- +Signal the end of options, cause all remaining \fIarg\fPs to be +assigned to the positional parameters. The +.B \-x +and +.B \-v +options are turned off. +If there are no \fIarg\fPs, +the positional parameters remain unchanged. +.PD +.PP +The options are off by default unless otherwise noted. +Using + rather than \- causes these options to be turned off. +The options can also be specified as arguments to an invocation of +the shell. +The current set of options may be found in +.BR $\- . +The return status is always true unless an invalid option is encountered. +.RE +.TP +\fBshift\fP [\fIn\fP] +The positional parameters from \fIn\fP+1 ... are renamed to +.B $1 +.B .... +Parameters represented by the numbers \fB$#\fP +down to \fB$#\fP\-\fIn\fP+1 are unset. +.I n +must be a non-negative number less than or equal to \fB$#\fP. +If +.I n +is 0, no parameters are changed. +If +.I n +is not given, it is assumed to be 1. +If +.I n +is greater than \fB$#\fP, the positional parameters are not changed. +The return status is greater than zero if +.I n +is greater than +.B $# +or less than zero; otherwise 0. +.TP +\fBshopt\fP [\fB\-pqsu\fP] [\fB\-o\fP] [\fIoptname\fP ...] +Toggle the values of settings controlling optional shell behavior. +The settings can be either those listed below, or, if the +.B \-o +option is used, those available with the +.B \-o +option to the \fBset\fP builtin command. +With no options, or with the +.B \-p +option, a list of all settable options is displayed, with +an indication of whether or not each is set. +The \fB\-p\fP option causes output to be displayed in a form that +may be reused as input. +Other options have the following meanings: +.RS +.PD 0 +.TP +.B \-s +Enable (set) each \fIoptname\fP. +.TP +.B \-u +Disable (unset) each \fIoptname\fP. +.TP +.B \-q +Suppresses normal output (quiet mode); the return status indicates +whether the \fIoptname\fP is set or unset. +If multiple \fIoptname\fP arguments are given with +.BR \-q , +the return status is zero if all \fIoptnames\fP are enabled; non-zero +otherwise. +.TP +.B \-o +Restricts the values of \fIoptname\fP to be those defined for the +.B \-o +option to the +.B set +builtin. +.PD +.PP +If either +.B \-s +or +.B \-u +is used with no \fIoptname\fP arguments, +.B shopt +shows only those options which are set or unset, respectively. +Unless otherwise noted, the \fBshopt\fP options are disabled (unset) +by default. +.PP +The return status when listing options is zero if all \fIoptnames\fP +are enabled, non-zero otherwise. When setting or unsetting options, +the return status is zero unless an \fIoptname\fP is not a valid shell +option. +.PP +The list of \fBshopt\fP options is: +.if t .sp .5v +.if n .sp 1v +.PD 0 +.TP 8 +.B autocd +If set, a command name that is the name of a directory is executed as if +it were the argument to the \fBcd\fP command. +This option is only used by interactive shells. +.TP 8 +.B cdable_vars +If set, an argument to the +.B cd +builtin command that +is not a directory is assumed to be the name of a variable whose +value is the directory to change to. +.TP 8 +.B cdspell +If set, minor errors in the spelling of a directory component in a +.B cd +command will be corrected. +The errors checked for are transposed characters, +a missing character, and one character too many. +If a correction is found, the corrected filename is printed, +and the command proceeds. +This option is only used by interactive shells. +.TP 8 +.B checkhash +If set, \fBbash\fP checks that a command found in the hash +table exists before trying to execute it. If a hashed command no +longer exists, a normal path search is performed. +.TP 8 +.B checkjobs +If set, \fBbash\fP lists the status of any stopped and running jobs before +exiting an interactive shell. If any jobs are running, this causes +the exit to be deferred until a second exit is attempted without an +intervening command (see +.SM +.B "JOB CONTROL" +above). The shell always +postpones exiting if any jobs are stopped. +.TP 8 +.B checkwinsize +If set, \fBbash\fP checks the window size after each command +and, if necessary, updates the values of +.SM +.B LINES +and +.SM +.BR COLUMNS . +.TP 8 +.B cmdhist +If set, +.B bash +attempts to save all lines of a multiple-line +command in the same history entry. This allows +easy re-editing of multi-line commands. +.TP 8 +.B compat31 +If set, +.B bash +changes its behavior to that of version 3.1 with respect to quoted +arguments to the \fB[[\fP conditional command's \fB=~\fP operator +and locale-specific string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators. +Bash versions prior to bash-4.1 use ASCII collation and +.IR strcmp (3); +bash-4.1 and later use the current locale's collation sequence and +.IR strcoll (3). +.TP 8 +.B compat32 +If set, +.B bash +changes its behavior to that of version 3.2 with respect to +locale-specific string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators (see previous item). +.TP 8 +.B compat40 +If set, +.B bash +changes its behavior to that of version 4.0 with respect to locale-specific +string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators (see description of +\fBcompat31\fP) +and the effect of interrupting a command list. +Bash versions 4.0 and later interrupt the list as if the shell received the +interrupt; previous versions continue with the next command in the list. +.TP 8 +.B compat41 +If set, +.BR bash , +when in \fIposix\fP mode, treats a single quote in a double-quoted +parameter expansion as a special character. The single quotes must match +(an even number) and the characters between the single quotes are considered +quoted. This is the behavior of posix mode through version 4.1. +The default bash behavior remains as in previous versions. +.TP 8 +.B compat42 +If set, +.B bash +does not process the replacement string in the pattern substitution word +expansion using quote removal. +.TP 8 +.B complete_fullquote +If set, +.B bash +quotes all shell metacharacters in filenames and directory names when +performing completion. +If not set, +.B bash +removes metacharacters such as the dollar sign from the set of +characters that will be quoted in completed filenames +when these metacharacters appear in shell variable references in words to be +completed. +This means that dollar signs in variable names that expand to directories +will not be quoted; +however, any dollar signs appearing in filenames will not be quoted, either. +This is active only when bash is using backslashes to quote completed +filenames. +This variable is set by default, which is the default bash behavior in +versions through 4.2. +.TP 8 +.B direxpand +If set, +.B bash +replaces directory names with the results of word expansion when performing +filename completion. This changes the contents of the readline editing +buffer. +If not set, +.B bash +attempts to preserve what the user typed. +.TP 8 +.B dirspell +If set, +.B bash +attempts spelling correction on directory names during word completion +if the directory name initially supplied does not exist. +.TP 8 +.B dotglob +If set, +.B bash +includes filenames beginning with a `.' in the results of pathname +expansion. +.TP 8 +.B execfail +If set, a non-interactive shell will not exit if +it cannot execute the file specified as an argument to the +.B exec +builtin command. An interactive shell does not exit if +.B exec +fails. +.TP 8 +.B expand_aliases +If set, aliases are expanded as described above under +.SM +.BR ALIASES . +This option is enabled by default for interactive shells. +.TP 8 +.B extdebug +If set, behavior intended for use by debuggers is enabled: +.RS +.TP +.B 1. +The \fB\-F\fP option to the \fBdeclare\fP builtin displays the source +file name and line number corresponding to each function name supplied +as an argument. +.TP +.B 2. +If the command run by the \fBDEBUG\fP trap returns a non-zero value, the +next command is skipped and not executed. +.TP +.B 3. +If the command run by the \fBDEBUG\fP trap returns a value of 2, and the +shell is executing in a subroutine (a shell function or a shell script +executed by the \fB.\fP or \fBsource\fP builtins), a call to +\fBreturn\fP is simulated. +.TP +.B 4. +.SM +.B BASH_ARGC +and +.SM +.B BASH_ARGV +are updated as described in their descriptions above. +.TP +.B 5. +Function tracing is enabled: command substitution, shell functions, and +subshells invoked with \fB(\fP \fIcommand\fP \fB)\fP inherit the +\fBDEBUG\fP and \fBRETURN\fP traps. +.TP +.B 6. +Error tracing is enabled: command substitution, shell functions, and +subshells invoked with \fB(\fP \fIcommand\fP \fB)\fP inherit the +\fBERR\fP trap. +.RE +.TP 8 +.B extglob +If set, the extended pattern matching features described above under +\fBPathname Expansion\fP are enabled. +.TP 8 +.B extquote +If set, \fB$\fP\(aq\fIstring\fP\(aq and \fB$\fP"\fIstring\fP" quoting is +performed within \fB${\fP\fIparameter\fP\fB}\fP expansions +enclosed in double quotes. This option is enabled by default. +.TP 8 +.B failglob +If set, patterns which fail to match filenames during pathname expansion +result in an expansion error. +.TP 8 +.B force_fignore +If set, the suffixes specified by the +.SM +.B FIGNORE +shell variable +cause words to be ignored when performing word completion even if +the ignored words are the only possible completions. +See +.SM +\fBSHELL VARIABLES\fP +above for a description of +.SM +.BR FIGNORE . +This option is enabled by default. +.TP 8 +.B globasciiranges +If set, range expressions used in pattern matching bracket expressions (see +.SM +.B Pattern Matching +above) behave as if in the traditional C locale when performing +comparisons. That is, the current locale's collating sequence +is not taken into account, so +.B b +will not collate between +.B A +and +.BR B , +and upper-case and lower-case ASCII characters will collate together. +.TP 8 +.B globstar +If set, the pattern \fB**\fP used in a pathname expansion context will +match all files and zero or more directories and subdirectories. +If the pattern is followed by a \fB/\fP, only directories and +subdirectories match. +.TP 8 +.B gnu_errfmt +If set, shell error messages are written in the standard GNU error +message format. +.TP 8 +.B histappend +If set, the history list is appended to the file named by the value +of the +.SM +.B HISTFILE +variable when the shell exits, rather than overwriting the file. +.TP 8 +.B histreedit +If set, and +.B readline +is being used, a user is given the opportunity to re-edit a +failed history substitution. +.TP 8 +.B histverify +If set, and +.B readline +is being used, the results of history substitution are not immediately +passed to the shell parser. Instead, the resulting line is loaded into +the \fBreadline\fP editing buffer, allowing further modification. +.TP 8 +.B hostcomplete +If set, and +.B readline +is being used, \fBbash\fP will attempt to perform hostname completion when a +word containing a \fB@\fP is being completed (see +.B Completing +under +.SM +.B READLINE +above). +This is enabled by default. +.TP 8 +.B huponexit +If set, \fBbash\fP will send +.SM +.B SIGHUP +to all jobs when an interactive login shell exits. +.TP 8 +.B interactive_comments +If set, allow a word beginning with +.B # +to cause that word and all remaining characters on that +line to be ignored in an interactive shell (see +.SM +.B COMMENTS +above). This option is enabled by default. +.TP 8 +.B lastpipe +If set, and job control is not active, the shell runs the last command of +a pipeline not executed in the background in the current shell environment. +.TP 8 +.B lithist +If set, and the +.B cmdhist +option is enabled, multi-line commands are saved to the history with +embedded newlines rather than using semicolon separators where possible. +.TP 8 +.B login_shell +The shell sets this option if it is started as a login shell (see +.SM +.B "INVOCATION" +above). +The value may not be changed. +.TP 8 +.B mailwarn +If set, and a file that \fBbash\fP is checking for mail has been +accessed since the last time it was checked, the message ``The mail in +\fImailfile\fP has been read'' is displayed. +.TP 8 +.B no_empty_cmd_completion +If set, and +.B readline +is being used, +.B bash +will not attempt to search the +.SM +.B PATH +for possible completions when +completion is attempted on an empty line. +.TP 8 +.B nocaseglob +If set, +.B bash +matches filenames in a case\-insensitive fashion when performing pathname +expansion (see +.B Pathname Expansion +above). +.TP 8 +.B nocasematch +If set, +.B bash +matches patterns in a case\-insensitive fashion when performing matching +while executing \fBcase\fP or \fB[[\fP conditional commands. +.TP 8 +.B nullglob +If set, +.B bash +allows patterns which match no +files (see +.B Pathname Expansion +above) +to expand to a null string, rather than themselves. +.TP 8 +.B progcomp +If set, the programmable completion facilities (see +\fBProgrammable Completion\fP above) are enabled. +This option is enabled by default. +.TP 8 +.B promptvars +If set, prompt strings undergo +parameter expansion, command substitution, arithmetic +expansion, and quote removal after being expanded as described in +.SM +.B PROMPTING +above. This option is enabled by default. +.TP 8 +.B restricted_shell +The shell sets this option if it is started in restricted mode (see +.SM +.B "RESTRICTED SHELL" +below). +The value may not be changed. +This is not reset when the startup files are executed, allowing +the startup files to discover whether or not a shell is restricted. +.TP 8 +.B shift_verbose +If set, the +.B shift +builtin prints an error message when the shift count exceeds the +number of positional parameters. +.TP 8 +.B sourcepath +If set, the +\fBsource\fP (\fB.\fP) builtin uses the value of +.SM +.B PATH +to find the directory containing the file supplied as an argument. +This option is enabled by default. +.TP 8 +.B xpg_echo +If set, the \fBecho\fP builtin expands backslash-escape sequences +by default. +.RE +.PD +.TP +\fBsuspend\fP [\fB\-f\fP] +Suspend the execution of this shell until it receives a +.SM +.B SIGCONT +signal. A login shell cannot be suspended; the +.B \-f +option can be used to override this and force the suspension. +The return status is 0 unless the shell is a login shell and +.B \-f +is not supplied, or if job control is not enabled. +.TP +\fBtest\fP \fIexpr\fP +.PD 0 +.TP +\fB[\fP \fIexpr\fP \fB]\fP +Return a status of 0 (true) or 1 (false) depending on +the evaluation of the conditional expression +.IR expr . +Each operator and operand must be a separate argument. +Expressions are composed of the primaries described above under +.SM +.BR "CONDITIONAL EXPRESSIONS" . +\fBtest\fP does not accept any options, nor does it accept and ignore +an argument of \fB\-\-\fP as signifying the end of options. +.if t .sp 0.5 +.if n .sp 1 +Expressions may be combined using the following operators, listed +in decreasing order of precedence. +The evaluation depends on the number of arguments; see below. +Operator precedence is used when there are five or more arguments. +.RS +.PD 0 +.TP +.B ! \fIexpr\fP +True if +.I expr +is false. +.TP +.B ( \fIexpr\fP ) +Returns the value of \fIexpr\fP. +This may be used to override the normal precedence of operators. +.TP +\fIexpr1\fP \-\fBa\fP \fIexpr2\fP +True if both +.I expr1 +and +.I expr2 +are true. +.TP +\fIexpr1\fP \-\fBo\fP \fIexpr2\fP +True if either +.I expr1 +or +.I expr2 +is true. +.PD +.PP +\fBtest\fP and \fB[\fP evaluate conditional +expressions using a set of rules based on the number of arguments. +.if t .sp 0.5 +.if n .sp 1 +.PD 0 +.TP +0 arguments +The expression is false. +.TP +1 argument +The expression is true if and only if the argument is not null. +.TP +2 arguments +If the first argument is \fB!\fP, the expression is true if and +only if the second argument is null. +If the first argument is one of the unary conditional operators listed above +under +.SM +.BR "CONDITIONAL EXPRESSIONS" , +the expression is true if the unary test is true. +If the first argument is not a valid unary conditional operator, the expression +is false. +.TP +3 arguments +The following conditions are applied in the order listed. +If the second argument is one of the binary conditional operators listed above +under +.SM +.BR "CONDITIONAL EXPRESSIONS" , +the result of the expression is the result of the binary test using +the first and third arguments as operands. +The \fB\-a\fP and \fB\-o\fP operators are considered binary operators +when there are three arguments. +If the first argument is \fB!\fP, the value is the negation of +the two-argument test using the second and third arguments. +If the first argument is exactly \fB(\fP and the third argument is +exactly \fB)\fP, the result is the one-argument test of the second +argument. +Otherwise, the expression is false. +.TP +4 arguments +If the first argument is \fB!\fP, the result is the negation of +the three-argument expression composed of the remaining arguments. +Otherwise, the expression is parsed and evaluated according to +precedence using the rules listed above. +.TP +5 or more arguments +The expression is parsed and evaluated according to precedence +using the rules listed above. +.if t .sp 0.5 +.if n .sp 1 +.LP +When used with \fBtest\fP or \fB[\fP, the \fB<\fP and \fB>\fP operators +sort lexicographically using ASCII ordering. +.RE +.PD +.TP +.B times +Print the accumulated user and system times for the shell and +for processes run from the shell. The return status is 0. +.TP +\fBtrap\fP [\fB\-lp\fP] [[\fIarg\fP] \fIsigspec\fP ...] +The command +.I arg +is to be read and executed when the shell receives +signal(s) +.IR sigspec . +If +.I arg +is absent (and there is a single \fIsigspec\fP) or +.BR \- , +each specified signal is +reset to its original disposition (the value it had +upon entrance to the shell). +If +.I arg +is the null string the signal specified by each +.I sigspec +is ignored by the shell and by the commands it invokes. +If +.I arg +is not present and +.B \-p +has been supplied, then the trap commands associated with each +.I sigspec +are displayed. +If no arguments are supplied or if only +.B \-p +is given, +.B trap +prints the list of commands associated with each signal. +The +.B \-l +option causes the shell to print a list of signal names and +their corresponding numbers. +Each +.I sigspec +is either +a signal name defined in <\fIsignal.h\fP>, or a signal number. +Signal names are case insensitive and the +.SM +.B SIG +prefix is optional. +.if t .sp 0.5 +.if n .sp 1 +If a +.I sigspec +is +.SM +.B EXIT +(0) the command +.I arg +is executed on exit from the shell. +If a +.I sigspec +is +.SM +.BR DEBUG , +the command +.I arg +is executed before every \fIsimple command\fP, \fIfor\fP command, +\fIcase\fP command, \fIselect\fP command, every arithmetic \fIfor\fP +command, and before the first command executes in a shell function (see +.SM +.B SHELL GRAMMAR +above). +Refer to the description of the \fBextdebug\fP option to the +\fBshopt\fP builtin for details of its effect on the \fBDEBUG\fP trap. +If a +.I sigspec +is +.SM +.BR RETURN , +the command +.I arg +is executed each time a shell function or a script executed with +the \fB.\fP or \fBsource\fP builtins finishes executing. +.if t .sp 0.5 +.if n .sp 1 +If a +.I sigspec +is +.SM +.BR ERR , +the command +.I arg +is executed whenever a +a pipeline (which may consist of a single simple +command), a list, or a compound command returns a +non\-zero exit status, +subject to the following conditions. +The +.SM +.B ERR +trap is not executed if the failed +command is part of the command list immediately following a +.B while +or +.B until +keyword, +part of the test in an +.I if +statement, part of a command executed in a +.B && +or +.B || +list except the command following the final \fB&&\fP or \fB||\fP, +any command in a pipeline but the last, +or if the command's return value is +being inverted using +.BR ! . +These are the same conditions obeyed by the \fBerrexit\fP (\fB\-e\fP) option. +.if t .sp 0.5 +.if n .sp 1 +Signals ignored upon entry to the shell cannot be trapped or reset. +Trapped signals that are not being ignored are reset to their original +values in a subshell or subshell environment when one is created. +The return status is false if any +.I sigspec +is invalid; otherwise +.B trap +returns true. +.TP +\fBtype\fP [\fB\-aftpP\fP] \fIname\fP [\fIname\fP ...] +With no options, +indicate how each +.I name +would be interpreted if used as a command name. +If the +.B \-t +option is used, +.B type +prints a string which is one of +.IR alias , +.IR keyword , +.IR function , +.IR builtin , +or +.I file +if +.I name +is an alias, shell reserved word, function, builtin, or disk file, +respectively. +If the +.I name +is not found, then nothing is printed, and an exit status of false +is returned. +If the +.B \-p +option is used, +.B type +either returns the name of the disk file +that would be executed if +.I name +were specified as a command name, +or nothing if +.if t \f(CWtype -t name\fP +.if n ``type -t name'' +would not return +.IR file . +The +.B \-P +option forces a +.SM +.B PATH +search for each \fIname\fP, even if +.if t \f(CWtype -t name\fP +.if n ``type -t name'' +would not return +.IR file . +If a command is hashed, +.B \-p +and +.B \-P +print the hashed value, which is not necessarily the file that appears +first in +.SM +.BR PATH . +If the +.B \-a +option is used, +.B type +prints all of the places that contain +an executable named +.IR name . +This includes aliases and functions, +if and only if the +.B \-p +option is not also used. +The table of hashed commands is not consulted +when using +.BR \-a . +The +.B \-f +option suppresses shell function lookup, as with the \fBcommand\fP builtin. +.B type +returns true if all of the arguments are found, false if +any are not found. +.TP +\fBulimit\fP [\fB\-HSTabcdefilmnpqrstuvx\fP [\fIlimit\fP]] +Provides control over the resources available to the shell and to +processes started by it, on systems that allow such control. +The \fB\-H\fP and \fB\-S\fP options specify that the hard or soft limit is +set for the given resource. +A hard limit cannot be increased by a non-root user once it is set; +a soft limit may be increased up to the value of the hard limit. +If neither \fB\-H\fP nor \fB\-S\fP is specified, both the soft and hard +limits are set. +The value of +.I limit +can be a number in the unit specified for the resource +or one of the special values +.BR hard , +.BR soft , +or +.BR unlimited , +which stand for the current hard limit, the current soft limit, and +no limit, respectively. +If +.I limit +is omitted, the current value of the soft limit of the resource is +printed, unless the \fB\-H\fP option is given. When more than one +resource is specified, the limit name and unit are printed before the value. +Other options are interpreted as follows: +.RS +.PD 0 +.TP +.B \-a +All current limits are reported +.TP +.B \-b +The maximum socket buffer size +.TP +.B \-c +The maximum size of core files created +.TP +.B \-d +The maximum size of a process's data segment +.TP +.B \-e +The maximum scheduling priority ("nice") +.TP +.B \-f +The maximum size of files written by the shell and its children +.TP +.B \-i +The maximum number of pending signals +.TP +.B \-l +The maximum size that may be locked into memory +.TP +.B \-m +The maximum resident set size (many systems do not honor this limit) +.TP +.B \-n +The maximum number of open file descriptors (most systems do not +allow this value to be set) +.TP +.B \-p +The pipe size in 512-byte blocks (this may not be set) +.TP +.B \-q +The maximum number of bytes in POSIX message queues +.TP +.B \-r +The maximum real-time scheduling priority +.TP +.B \-s +The maximum stack size +.TP +.B \-t +The maximum amount of cpu time in seconds +.TP +.B \-u +The maximum number of processes available to a single user +.TP +.B \-v +The maximum amount of virtual memory available to the shell and, on +some systems, to its children +.TP +.B \-x +The maximum number of file locks +.TP +.B \-T +The maximum number of threads +.PD +.PP +If +.I limit +is given, and the +.B \-a +option is not used, +\fIlimit\fP is the new value of the specified resource. +If no option is given, then +.B \-f +is assumed. Values are in 1024-byte increments, except for +.BR \-t , +which is in seconds; +.BR \-p , +which is in units of 512-byte blocks; +and +.BR \-T , +.BR \-b , +.BR \-n , +and +.BR \-u , +which are unscaled values. +The return status is 0 unless an invalid option or argument is supplied, +or an error occurs while setting a new limit. +.RE +.TP +\fBumask\fP [\fB\-p\fP] [\fB\-S\fP] [\fImode\fP] +The user file-creation mask is set to +.IR mode . +If +.I mode +begins with a digit, it +is interpreted as an octal number; otherwise +it is interpreted as a symbolic mode mask similar +to that accepted by +.IR chmod (1). +If +.I mode +is omitted, the current value of the mask is printed. +The +.B \-S +option causes the mask to be printed in symbolic form; the +default output is an octal number. +If the +.B \-p +option is supplied, and +.I mode +is omitted, the output is in a form that may be reused as input. +The return status is 0 if the mode was successfully changed or if +no \fImode\fP argument was supplied, and false otherwise. +.TP +\fBunalias\fP [\-\fBa\fP] [\fIname\fP ...] +Remove each \fIname\fP from the list of defined aliases. If +.B \-a +is supplied, all alias definitions are removed. The return +value is true unless a supplied +.I name +is not a defined alias. +.TP +\fBunset\fP [\-\fBfv\fP] [\-\fBn\fP] [\fIname\fP ...] +For each +.IR name , +remove the corresponding variable or function. +If the +.B \-v +option is given, each +.I name +refers to a shell variable, and that variable is removed. +Read-only variables may not be unset. +If +.B \-f +is specified, each +.I name +refers to a shell function, and the function definition +is removed. +If the +.B \-n +option is supplied, and \fIname\fP is a variable with the \fInameref\fP +attribute, \fIname\fP will be unset rather than the variable it +references. +\fB\-n\fP has no effect if the \fB\-f\fP option is supplied. +If no options are supplied, each \fIname\fP refers to a variable; if +there is no variable by that name, any function with that name is +unset. +Each unset variable or function is removed from the environment +passed to subsequent commands. +If any of +.SM +.BR COMP_WORDBREAKS , +.SM +.BR RANDOM , +.SM +.BR SECONDS , +.SM +.BR LINENO , +.SM +.BR HISTCMD , +.SM +.BR FUNCNAME , +.SM +.BR GROUPS , +or +.SM +.B DIRSTACK +are unset, they lose their special properties, even if they are +subsequently reset. The exit status is true unless a +.I name +is readonly. +.TP +\fBwait\fP [\fB\-n\fP] [\fIn ...\fP] +Wait for each specified child process and return its termination status. +Each +.I n +may be a process +ID or a job specification; if a job spec is given, all processes +in that job's pipeline are waited for. If +.I n +is not given, all currently active child processes +are waited for, and the return status is zero. +If the \fB\-n\fP option is supplied, \fBwait\fP waits for any job to +terminate and returns its exit status. +If +.I n +specifies a non-existent process or job, the return status is +127. Otherwise, the return status is the exit status of the last +process or job waited for. +.\" bash_builtins +.if \n(zZ=1 .ig zZ +.SH "RESTRICTED SHELL" +.\" rbash.1 +.zY +.PP +If +.B bash +is started with the name +.BR rbash , +or the +.B \-r +option is supplied at invocation, +the shell becomes restricted. +A restricted shell is used to +set up an environment more controlled than the standard shell. +It behaves identically to +.B bash +with the exception that the following are disallowed or not performed: +.IP \(bu +changing directories with \fBcd\fP +.IP \(bu +setting or unsetting the values of +.SM +.BR SHELL , +.SM +.BR PATH , +.SM +.BR ENV , +or +.SM +.B BASH_ENV +.IP \(bu +specifying command names containing +.B / +.IP \(bu +specifying a filename containing a +.B / +as an argument to the +.B . +builtin command +.IP \(bu +specifying a filename containing a slash as an argument to the +.B \-p +option to the +.B hash +builtin command +.IP \(bu +importing function definitions from the shell environment at startup +.IP \(bu +parsing the value of +.SM +.B SHELLOPTS +from the shell environment at startup +.IP \(bu +redirecting output using the >, >|, <>, >&, &>, and >> redirection operators +.IP \(bu +using the +.B exec +builtin command to replace the shell with another command +.IP \(bu +adding or deleting builtin commands with the +.B \-f +and +.B \-d +options to the +.B enable +builtin command +.IP \(bu +using the \fBenable\fP builtin command to enable disabled shell builtins +.IP \(bu +specifying the +.B \-p +option to the +.B command +builtin command +.IP \(bu +turning off restricted mode with +\fBset +r\fP or \fBset +o restricted\fP. +.PP +These restrictions are enforced after any startup files are read. +.PP +.ie \n(zY=1 When a command that is found to be a shell script is executed, +.el \{ When a command that is found to be a shell script is executed +(see +.SM +.B "COMMAND EXECUTION" +above), +\} +.B rbash +turns off any restrictions in the shell spawned to execute the +script. +.\" end of rbash.1 +.if \n(zY=1 .ig zY +.SH "SEE ALSO" +.PD 0 +.TP +\fIBash Reference Manual\fP, Brian Fox and Chet Ramey +.TP +\fIThe Gnu Readline Library\fP, Brian Fox and Chet Ramey +.TP +\fIThe Gnu History Library\fP, Brian Fox and Chet Ramey +.TP +\fIPortable Operating System Interface (POSIX) Part 2: Shell and Utilities\fP, IEEE -- +http://pubs.opengroup.org/onlinepubs/9699919799/ +.TP +http://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode +.TP +\fIsh\fP(1), \fIksh\fP(1), \fIcsh\fP(1) +.TP +\fIemacs\fP(1), \fIvi\fP(1) +.TP +\fIreadline\fP(3) +.PD +.SH FILES +.PD 0 +.TP +.FN /bin/bash +The \fBbash\fP executable +.TP +.FN /etc/profile +The systemwide initialization file, executed for login shells +.TP +.FN ~/.bash_profile +The personal initialization file, executed for login shells +.TP +.FN ~/.bashrc +The individual per-interactive-shell startup file +.TP +.FN ~/.bash_logout +The individual login shell cleanup file, executed when a login shell exits +.TP +.FN ~/.inputrc +Individual \fIreadline\fP initialization file +.PD +.SH AUTHORS +Brian Fox, Free Software Foundation +.br +bfox@gnu.org +.PP +Chet Ramey, Case Western Reserve University +.br +chet.ramey@case.edu +.SH BUG REPORTS +If you find a bug in +.B bash, +you should report it. But first, you should +make sure that it really is a bug, and that it appears in the latest +version of +.BR bash . +The latest version is always available from +\fIftp://ftp.gnu.org/pub/gnu/bash/\fP. +.PP +Once you have determined that a bug actually exists, use the +.I bashbug +command to submit a bug report. +If you have a fix, you are encouraged to mail that as well! +Suggestions and `philosophical' bug reports may be mailed +to \fIbug-bash@gnu.org\fP or posted to the Usenet +newsgroup +.BR gnu.bash.bug . +.PP +ALL bug reports should include: +.PP +.PD 0 +.TP 20 +The version number of \fBbash\fR +.TP +The hardware and operating system +.TP +The compiler used to compile +.TP +A description of the bug behaviour +.TP +A short script or `recipe' which exercises the bug +.PD +.PP +.I bashbug +inserts the first three items automatically into the template +it provides for filing a bug report. +.PP +Comments and bug reports concerning +this manual page should be directed to +.IR chet.ramey@case.edu . +.SH BUGS +.PP +It's too big and too slow. +.PP +There are some subtle differences between +.B bash +and traditional versions of +.BR sh , +mostly because of the +.SM +.B POSIX +specification. +.PP +Aliases are confusing in some uses. +.PP +Shell builtin commands and functions are not stoppable/restartable. +.PP +Compound commands and command sequences of the form `a ; b ; c' +are not handled gracefully when process suspension is attempted. +When a process is stopped, the shell immediately executes the next +command in the sequence. +It suffices to place the sequence of commands between +parentheses to force it into a subshell, which may be stopped as +a unit. +.PP +Array variables may not (yet) be exported. +.PP +There may be only one active coprocess at a time. +.zZ +.zY diff --git a/.pc/man-bashlogout.diff/doc/bash.1 b/.pc/man-bashlogout.diff/doc/bash.1 new file mode 100644 index 0000000..8373ec3 --- /dev/null +++ b/.pc/man-bashlogout.diff/doc/bash.1 @@ -0,0 +1,10346 @@ +.\" +.\" MAN PAGE COMMENTS to +.\" +.\" Chet Ramey +.\" Case Western Reserve University +.\" chet.ramey@case.edu +.\" +.\" Last Change: Sun Feb 2 16:21:40 EST 2014 +.\" +.\" bash_builtins, strip all but Built-Ins section +.if \n(zZ=1 .ig zZ +.if \n(zY=1 .ig zY +.TH BASH 1 "2014 February 2" "GNU Bash 4.3" +.\" +.\" There's some problem with having a `@' +.\" in a tagged paragraph with the BSD man macros. +.\" It has to do with `@' appearing in the }1 macro. +.\" This is a problem on 4.3 BSD and Ultrix, but Sun +.\" appears to have fixed it. +.\" If you're seeing the characters +.\" `@u-3p' appearing before the lines reading +.\" `possible-hostname-completions +.\" and `complete-hostname' down in READLINE, +.\" then uncomment this redefinition. +.\" +.de }1 +.ds ]X \&\\*(]B\\ +.nr )E 0 +.if !"\\$1"" .nr )I \\$1n +.}f +.ll \\n(LLu +.in \\n()Ru+\\n(INu+\\n()Iu +.ti \\n(INu +.ie !\\n()Iu+\\n()Ru-\w\\*(]Xu-3p \{\\*(]X +.br\} +.el \\*(]X\h|\\n()Iu+\\n()Ru\c +.}f +.. +.\" +.\" File Name macro. This used to be `.PN', for Path Name, +.\" but Sun doesn't seem to like that very much. +.\" +.de FN +\fI\|\\$1\|\fP +.. +.SH NAME +bash \- GNU Bourne-Again SHell +.SH SYNOPSIS +.B bash +[options] +[command_string | file] +.SH COPYRIGHT +.if n Bash is Copyright (C) 1989-2013 by the Free Software Foundation, Inc. +.if t Bash is Copyright \(co 1989-2013 by the Free Software Foundation, Inc. +.SH DESCRIPTION +.B Bash +is an \fBsh\fR-compatible command language interpreter that +executes commands read from the standard input or from a file. +.B Bash +also incorporates useful features from the \fIKorn\fP and \fIC\fP +shells (\fBksh\fP and \fBcsh\fP). +.PP +.B Bash +is intended to be a conformant implementation of the +Shell and Utilities portion of the IEEE POSIX specification +(IEEE Standard 1003.1). +.B Bash +can be configured to be POSIX-conformant by default. +.SH OPTIONS +All of the single-character shell options documented in the +description of the \fBset\fR builtin command can be used as options +when the shell is invoked. +In addition, \fBbash\fR +interprets the following options when it is invoked: +.PP +.PD 0 +.TP 10 +.B \-c +If the +.B \-c +option is present, then commands are read from the first non-option argument +.IR command_string . +If there are arguments after the +.IR command_string , +they are assigned to the positional parameters, starting with +.BR $0 . +.TP +.B \-i +If the +.B \-i +option is present, the shell is +.IR interactive . +.TP +.B \-l +Make +.B bash +act as if it had been invoked as a login shell (see +.SM +.B INVOCATION +below). +.TP +.B \-r +If the +.B \-r +option is present, the shell becomes +.I restricted +(see +.SM +.B "RESTRICTED SHELL" +below). +.TP +.B \-s +If the +.B \-s +option is present, or if no arguments remain after option +processing, then commands are read from the standard input. +This option allows the positional parameters to be set +when invoking an interactive shell. +.TP +.B \-D +A list of all double-quoted strings preceded by \fB$\fP +is printed on the standard output. +These are the strings that +are subject to language translation when the current locale +is not \fBC\fP or \fBPOSIX\fP. +This implies the \fB\-n\fP option; no commands will be executed. +.TP +.B [\-+]O [\fIshopt_option\fP] +\fIshopt_option\fP is one of the shell options accepted by the +\fBshopt\fP builtin (see +.SM +.B SHELL BUILTIN COMMANDS +below). +If \fIshopt_option\fP is present, \fB\-O\fP sets the value of that option; +\fB+O\fP unsets it. +If \fIshopt_option\fP is not supplied, the names and values of the shell +options accepted by \fBshopt\fP are printed on the standard output. +If the invocation option is \fB+O\fP, the output is displayed in a format +that may be reused as input. +.TP +.B \-\- +A +.B \-\- +signals the end of options and disables further option processing. +Any arguments after the +.B \-\- +are treated as filenames and arguments. An argument of +.B \- +is equivalent to \fB\-\-\fP. +.PD +.PP +.B Bash +also interprets a number of multi-character options. +These options must appear on the command line before the +single-character options to be recognized. +.PP +.PD 0 +.TP +.B \-\-debugger +Arrange for the debugger profile to be executed before the shell +starts. +Turns on extended debugging mode (see the description of the +.B extdebug +option to the +.B shopt +builtin below). +.TP +.B \-\-dump\-po\-strings +Equivalent to \fB\-D\fP, but the output is in the GNU \fIgettext\fP +\fBpo\fP (portable object) file format. +.TP +.B \-\-dump\-strings +Equivalent to \fB\-D\fP. +.TP +.B \-\-help +Display a usage message on standard output and exit successfully. +.TP +\fB\-\-init\-file\fP \fIfile\fP +.PD 0 +.TP +\fB\-\-rcfile\fP \fIfile\fP +.PD +Execute commands from +.I file +instead of the system wide initialization file +.I /etc/bash.bashrc +and the standard personal initialization file +.I ~/.bashrc +if the shell is interactive (see +.SM +.B INVOCATION +below). +.TP +.B \-\-login +Equivalent to \fB\-l\fP. +.TP +.B \-\-noediting +Do not use the GNU +.B readline +library to read command lines when the shell is interactive. +.TP +.B \-\-noprofile +Do not read either the system-wide startup file +.FN /etc/profile +or any of the personal initialization files +.IR ~/.bash_profile , +.IR ~/.bash_login , +or +.IR ~/.profile . +By default, +.B bash +reads these files when it is invoked as a login shell (see +.SM +.B INVOCATION +below). +.TP +.B \-\-norc +Do not read and execute the system wide initialization file +.I /etc/bash.bashrc +and the personal initialization file +.I ~/.bashrc +if the shell is interactive. +This option is on by default if the shell is invoked as +.BR sh . +.TP +.B \-\-posix +Change the behavior of \fBbash\fP where the default operation differs +from the POSIX standard to match the standard (\fIposix mode\fP). +See +.SM +.B "SEE ALSO" +below for a reference to a document that details how posix mode affects +bash's behavior. +.TP +.B \-\-restricted +The shell becomes restricted (see +.SM +.B "RESTRICTED SHELL" +below). +.TP +.B \-\-verbose +Equivalent to \fB\-v\fP. +.TP +.B \-\-version +Show version information for this instance of +.B bash +on the standard output and exit successfully. +.PD +.SH ARGUMENTS +If arguments remain after option processing, and neither the +.B \-c +nor the +.B \-s +option has been supplied, the first argument is assumed to +be the name of a file containing shell commands. +If +.B bash +is invoked in this fashion, +.B $0 +is set to the name of the file, and the positional parameters +are set to the remaining arguments. +.B Bash +reads and executes commands from this file, then exits. +\fBBash\fP's exit status is the exit status of the last command +executed in the script. +If no commands are executed, the exit status is 0. +An attempt is first made to open the file in the current directory, and, +if no file is found, then the shell searches the directories in +.SM +.B PATH +for the script. +.SH INVOCATION +A \fIlogin shell\fP is one whose first character of argument zero is a +.BR \- , +or one started with the +.B \-\-login +option. +.PP +An \fIinteractive\fP shell is one started without non-option arguments +and without the +.B \-c +option +whose standard input and error are +both connected to terminals (as determined by +.IR isatty (3)), +or one started with the +.B \-i +option. +.SM +.B PS1 +is set and +.B $\- +includes +.B i +if +.B bash +is interactive, +allowing a shell script or a startup file to test this state. +.PP +The following paragraphs describe how +.B bash +executes its startup files. +If any of the files exist but cannot be read, +.B bash +reports an error. +Tildes are expanded in filenames as described below under +.B "Tilde Expansion" +in the +.SM +.B EXPANSION +section. +.PP +When +.B bash +is invoked as an interactive login shell, or as a non-interactive shell +with the \fB\-\-login\fP option, it first reads and +executes commands from the file \fI/etc/profile\fP, if that +file exists. +After reading that file, it looks for \fI~/.bash_profile\fP, +\fI~/.bash_login\fP, and \fI~/.profile\fP, in that order, and reads +and executes commands from the first one that exists and is readable. +The +.B \-\-noprofile +option may be used when the shell is started to inhibit this behavior. +.PP +When a login shell exits, +.B bash +reads and executes commands from the file \fI~/.bash_logout\fP, if it +exists. +.PP +When an interactive shell that is not a login shell is started, +.B bash +reads and executes commands from \fI/etc/bash.bashrc\fP and \fI~/.bashrc\fP, +if these files exist. +This may be inhibited by using the +.B \-\-norc +option. +The \fB\-\-rcfile\fP \fIfile\fP option will force +.B bash +to read and execute commands from \fIfile\fP instead of +\fI/etc/bash.bashrc\fP and \fI~/.bashrc\fP. +.PP +When +.B bash +is started non-interactively, to run a shell script, for example, it +looks for the variable +.SM +.B BASH_ENV +in the environment, expands its value if it appears there, and uses the +expanded value as the name of a file to read and execute. +.B Bash +behaves as if the following command were executed: +.sp .5 +.RS +.if t \f(CWif [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi\fP +.if n if [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi +.RE +.sp .5 +but the value of the +.SM +.B PATH +variable is not used to search for the filename. +.PP +If +.B bash +is invoked with the name +.BR sh , +it tries to mimic the startup behavior of historical versions of +.B sh +as closely as possible, +while conforming to the POSIX standard as well. +When invoked as an interactive login shell, or a non-interactive +shell with the \fB\-\-login\fP option, it first attempts to +read and execute commands from +.I /etc/profile +and +.IR ~/.profile , +in that order. +The +.B \-\-noprofile +option may be used to inhibit this behavior. +When invoked as an interactive shell with the name +.BR sh , +.B bash +looks for the variable +.SM +.BR ENV , +expands its value if it is defined, and uses the +expanded value as the name of a file to read and execute. +Since a shell invoked as +.B sh +does not attempt to read and execute commands from any other startup +files, the +.B \-\-rcfile +option has no effect. +A non-interactive shell invoked with the name +.B sh +does not attempt to read any other startup files. +When invoked as +.BR sh , +.B bash +enters +.I posix +mode after the startup files are read. +.PP +When +.B bash +is started in +.I posix +mode, as with the +.B \-\-posix +command line option, it follows the POSIX standard for startup files. +In this mode, interactive shells expand the +.SM +.B ENV +variable and commands are read and executed from the file +whose name is the expanded value. +No other startup files are read. +.PP +.B Bash +attempts to determine when it is being run with its standard input +connected to a network connection, as when executed by the remote shell +daemon, usually \fIrshd\fP, or the secure shell daemon \fIsshd\fP. +If +.B bash +determines it is being run in this fashion, it reads and executes +commands from \fI~/.bashrc\fP and \fI~/.bashrc\fP, if these files +exist and are readable. +It will not do this if invoked as \fBsh\fP. +The +.B \-\-norc +option may be used to inhibit this behavior, and the +.B \-\-rcfile +option may be used to force another file to be read, but neither +\fIrshd\fP nor \fIsshd\fP generally invoke the shell with those options +or allow them to be specified. +.PP +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the \fB\-p\fP option is not supplied, no startup +files are read, shell functions are not inherited from the environment, the +.SM +.BR SHELLOPTS , +.SM +.BR BASHOPTS , +.SM +.BR CDPATH , +and +.SM +.B GLOBIGNORE +variables, if they appear in the environment, are ignored, +and the effective user id is set to the real user id. +If the \fB\-p\fP option is supplied at invocation, the startup behavior is +the same, but the effective user id is not reset. +.SH DEFINITIONS +.PP +The following definitions are used throughout the rest of this +document. +.PD 0 +.TP +.B blank +A space or tab. +.TP +.B word +A sequence of characters considered as a single unit by the shell. +Also known as a +.BR token . +.TP +.B name +A +.I word +consisting only of alphanumeric characters and underscores, and +beginning with an alphabetic character or an underscore. Also +referred to as an +.BR identifier . +.TP +.B metacharacter +A character that, when unquoted, separates words. One of the following: +.br +.RS +.PP +.if t \fB| & ; ( ) < > space tab\fP +.if n \fB| & ; ( ) < > space tab\fP +.RE +.PP +.TP +.B control operator +A \fItoken\fP that performs a control function. It is one of the following +symbols: +.RS +.PP +.if t \fB|| & && ; ;; ( ) | |& \fP +.if n \fB|| & && ; ;; ( ) | |& \fP +.RE +.PD +.SH "RESERVED WORDS" +\fIReserved words\fP are words that have a special meaning to the shell. +The following words are recognized as reserved when unquoted and either +the first word of a simple command (see +.SM +.B SHELL GRAMMAR +below) or the third word of a +.B case +or +.B for +command: +.if t .RS +.PP +.B +.if n ! case coproc do done elif else esac fi for function if in select then until while { } time [[ ]] +.if t ! case coproc do done elif else esac fi for function if in select then until while { } time [[ ]] +.if t .RE +.SH "SHELL GRAMMAR" +.SS Simple Commands +.PP +A \fIsimple command\fP is a sequence of optional variable assignments +followed by \fBblank\fP-separated words and redirections, and +terminated by a \fIcontrol operator\fP. The first word +specifies the command to be executed, and is passed as argument zero. +The remaining words are passed as arguments to the invoked command. +.PP +The return value of a \fIsimple command\fP is its exit status, or +128+\fIn\^\fP if the command is terminated by signal +.IR n . +.SS Pipelines +.PP +A \fIpipeline\fP is a sequence of one or more commands separated by +one of the control operators +.B | +or \fB|&\fP. +The format for a pipeline is: +.RS +.PP +[\fBtime\fP [\fB\-p\fP]] [ ! ] \fIcommand\fP [ [\fB|\fP\(bv\fB|&\fP] \fIcommand2\fP ... ] +.RE +.PP +The standard output of +.I command +is connected via a pipe to the standard input of +.IR command2 . +This connection is performed before any redirections specified by the +command (see +.SM +.B REDIRECTION +below). +If \fB|&\fP is used, \fIcommand\fP's standard error, in addition to its +standard output, is connected to +\fIcommand2\fP's standard input through the pipe; +it is shorthand for \fB2>&1 |\fP. +This implicit redirection of the standard error to the standard output is +performed after any redirections specified by the command. +.PP +The return status of a pipeline is the exit status of the last +command, unless the \fBpipefail\fP option is enabled. +If \fBpipefail\fP is enabled, the pipeline's return status is the +value of the last (rightmost) command to exit with a non-zero status, +or zero if all commands exit successfully. +If the reserved word +.B ! +precedes a pipeline, the exit status of that pipeline is the logical +negation of the exit status as described above. +The shell waits for all commands in the pipeline to +terminate before returning a value. +.PP +If the +.B time +reserved word precedes a pipeline, the elapsed as well as user and +system time consumed by its execution are reported when the pipeline +terminates. +The \fB\-p\fP option changes the output format to that specified by POSIX. +When the shell is in \fIposix mode\fP, it does not recognize +\fBtime\fP as a reserved word if the next token begins with a `-'. +The +.SM +.B TIMEFORMAT +variable may be set to a format string that specifies how the timing +information should be displayed; see the description of +.SM +.B TIMEFORMAT +under +.B "Shell Variables" +below. +.PP +When the shell is in \fIposix mode\fP, \fBtime\fP +may be followed by a newline. In this case, the shell displays the +total user and system time consumed by the shell and its children. +The +.SM +.B TIMEFORMAT +variable may be used to specify the format of +the time information. +.PP +Each command in a pipeline is executed as a separate process (i.e., in a +subshell). +.SS Lists +.PP +A \fIlist\fP is a sequence of one or more pipelines separated by one +of the operators +.BR ; , +.BR & , +.BR && , +or +.BR || , +and optionally terminated by one of +.BR ; , +.BR & , +or +.BR . +.PP +Of these list operators, +.B && +and +.B || +have equal precedence, followed by +.B ; +and +.BR & , +which have equal precedence. +.PP +A sequence of one or more newlines may appear in a \fIlist\fP instead +of a semicolon to delimit commands. +.PP +If a command is terminated by the control operator +.BR & , +the shell executes the command in the \fIbackground\fP +in a subshell. The shell does not wait for the command to +finish, and the return status is 0. Commands separated by a +.B ; +are executed sequentially; the shell waits for each +command to terminate in turn. The return status is the +exit status of the last command executed. +.PP +AND and OR lists are sequences of one of more pipelines separated by the +\fB&&\fP and \fB||\fP control operators, respectively. +AND and OR lists are executed with left associativity. +An AND list has the form +.RS +.PP +\fIcommand1\fP \fB&&\fP \fIcommand2\fP +.RE +.PP +.I command2 +is executed if, and only if, +.I command1 +returns an exit status of zero. +.PP +An OR list has the form +.RS +.PP +\fIcommand1\fP \fB||\fP \fIcommand2\fP +.PP +.RE +.PP +.I command2 +is executed if and only if +.I command1 +returns a non-zero exit status. +The return status of +AND and OR lists is the exit status of the last command +executed in the list. +.SS Compound Commands +.PP +A \fIcompound command\fP is one of the following. +In most cases a \fIlist\fP in a command's description may be separated from +the rest of the command by one or more newlines, and may be followed by a +newline in place of a semicolon. +.TP +(\fIlist\fP) +\fIlist\fP is executed in a subshell environment (see +.SM +\fBCOMMAND EXECUTION ENVIRONMENT\fP +below). +Variable assignments and builtin +commands that affect the shell's environment do not remain in effect +after the command completes. The return status is the exit status of +\fIlist\fP. +.TP +{ \fIlist\fP; } +\fIlist\fP is simply executed in the current shell environment. +\fIlist\fP must be terminated with a newline or semicolon. +This is known as a \fIgroup command\fP. +The return status is the exit status of +\fIlist\fP. +Note that unlike the metacharacters \fB(\fP and \fB)\fP, \fB{\fP and +\fB}\fP are \fIreserved words\fP and must occur where a reserved +word is permitted to be recognized. Since they do not cause a word +break, they must be separated from \fIlist\fP by whitespace or another +shell metacharacter. +.TP +((\fIexpression\fP)) +The \fIexpression\fP is evaluated according to the rules described +below under +.SM +.BR "ARITHMETIC EVALUATION" . +If the value of the expression is non-zero, the return status is 0; +otherwise the return status is 1. This is exactly equivalent to +\fBlet "\fIexpression\fP"\fR. +.TP +\fB[[\fP \fIexpression\fP \fB]]\fP +Return a status of 0 or 1 depending on the evaluation of +the conditional expression \fIexpression\fP. +Expressions are composed of the primaries described below under +.SM +.BR "CONDITIONAL EXPRESSIONS" . +Word splitting and pathname expansion are not performed on the words +between the \fB[[\fP and \fB]]\fP; tilde expansion, +parameter and variable expansion, +arithmetic expansion, command substitution, process +substitution, and quote removal are performed. +Conditional operators such as \fB\-f\fP must be unquoted to be recognized +as primaries. +.if t .sp 0.5 +.if n .sp 1 +When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort +lexicographically using the current locale. +.if t .sp 0.5 +.if n .sp 1 +When the \fB==\fP and \fB!=\fP operators are used, the string to the +right of the operator is considered a pattern and matched according +to the rules described below under \fBPattern Matching\fP, +as if the \fBextglob\fP shell option were enabled. +The \fB=\fP operator is equivalent to \fB==\fP. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +The return value is 0 if the string matches (\fB==\fP) or does not match +(\fB!=\fP) the pattern, and 1 otherwise. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +.if t .sp 0.5 +.if n .sp 1 +An additional binary operator, \fB=~\fP, is available, with the same +precedence as \fB==\fP and \fB!=\fP. +When it is used, the string to the right of the operator is considered +an extended regular expression and matched accordingly (as in \fIregex\fP(3)). +The return value is 0 if the string matches +the pattern, and 1 otherwise. +If the regular expression is syntactically incorrect, the conditional +expression's return value is 2. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +Bracket expressions in regular expressions must be treated carefully, +since normal quoting characters lose their meanings between brackets. +If the pattern is stored in a shell variable, quoting the variable +expansion forces the entire pattern to be matched as a string. +Substrings matched by parenthesized subexpressions within the regular +expression are saved in the array variable +.SM +.BR BASH_REMATCH . +The element of +.SM +.B BASH_REMATCH +with index 0 is the portion of the string +matching the entire regular expression. +The element of +.SM +.B BASH_REMATCH +with index \fIn\fP is the portion of the +string matching the \fIn\fPth parenthesized subexpression. +.if t .sp 0.5 +.if n .sp 1 +Expressions may be combined using the following operators, listed +in decreasing order of precedence: +.if t .sp 0.5 +.if n .sp 1 +.RS +.PD 0 +.TP +.B ( \fIexpression\fP ) +Returns the value of \fIexpression\fP. +This may be used to override the normal precedence of operators. +.TP +.B ! \fIexpression\fP +True if +.I expression +is false. +.TP +\fIexpression1\fP \fB&&\fP \fIexpression2\fP +True if both +.I expression1 +and +.I expression2 +are true. +.TP +\fIexpression1\fP \fB||\fP \fIexpression2\fP +True if either +.I expression1 +or +.I expression2 +is true. +.PD +.LP +The \fB&&\fP and \fB||\fP +operators do not evaluate \fIexpression2\fP if the value of +\fIexpression1\fP is sufficient to determine the return value of +the entire conditional expression. +.RE +.TP +\fBfor\fP \fIname\fP [ [ \fBin\fP [ \fIword ...\fP ] ] ; ] \fBdo\fP \fIlist\fP ; \fBdone\fP +The list of words following \fBin\fP is expanded, generating a list +of items. +The variable \fIname\fP is set to each element of this list +in turn, and \fIlist\fP is executed each time. +If the \fBin\fP \fIword\fP is omitted, the \fBfor\fP command executes +\fIlist\fP once for each positional parameter that is set (see +.SM +.B PARAMETERS +below). +The return status is the exit status of the last command that executes. +If the expansion of the items following \fBin\fP results in an empty +list, no commands are executed, and the return status is 0. +.TP +\fBfor\fP (( \fIexpr1\fP ; \fIexpr2\fP ; \fIexpr3\fP )) ; \fBdo\fP \fIlist\fP ; \fBdone\fP +First, the arithmetic expression \fIexpr1\fP is evaluated according +to the rules described below under +.SM +.BR "ARITHMETIC EVALUATION" . +The arithmetic expression \fIexpr2\fP is then evaluated repeatedly +until it evaluates to zero. +Each time \fIexpr2\fP evaluates to a non-zero value, \fIlist\fP is +executed and the arithmetic expression \fIexpr3\fP is evaluated. +If any expression is omitted, it behaves as if it evaluates to 1. +The return value is the exit status of the last command in \fIlist\fP +that is executed, or false if any of the expressions is invalid. +.TP +\fBselect\fP \fIname\fP [ \fBin\fP \fIword\fP ] ; \fBdo\fP \fIlist\fP ; \fBdone\fP +The list of words following \fBin\fP is expanded, generating a list +of items. The set of expanded words is printed on the standard +error, each preceded by a number. If the \fBin\fP +\fIword\fP is omitted, the positional parameters are printed (see +.SM +.B PARAMETERS +below). The +.SM +.B PS3 +prompt is then displayed and a line read from the standard input. +If the line consists of a number corresponding to one of +the displayed words, then the value of +.I name +is set to that word. If the line is empty, the words and prompt +are displayed again. If EOF is read, the command completes. Any +other value read causes +.I name +to be set to null. The line read is saved in the variable +.SM +.BR REPLY . +The +.I list +is executed after each selection until a +.B break +command is executed. +The exit status of +.B select +is the exit status of the last command executed in +.IR list , +or zero if no commands were executed. +.TP +\fBcase\fP \fIword\fP \fBin\fP [ [(] \fIpattern\fP [ \fB|\fP \fIpattern\fP ] \ +... ) \fIlist\fP ;; ] ... \fBesac\fP +A \fBcase\fP command first expands \fIword\fP, and tries to match +it against each \fIpattern\fP in turn, using the same matching rules +as for pathname expansion (see +.B Pathname Expansion +below). +The \fIword\fP is expanded using tilde +expansion, parameter and variable expansion, arithmetic substitution, +command substitution, process substitution and quote removal. +Each \fIpattern\fP examined is expanded using tilde +expansion, parameter and variable expansion, arithmetic substitution, +command substitution, and process substitution. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +When a match is found, the corresponding \fIlist\fP is executed. +If the \fB;;\fP operator is used, no subsequent matches are attempted after +the first pattern match. +Using \fB;&\fP in place of \fB;;\fP causes execution to continue with +the \fIlist\fP associated with the next set of patterns. +Using \fB;;&\fP in place of \fB;;\fP causes the shell to test the next +pattern list in the statement, if any, and execute any associated \fIlist\fP +on a successful match. +The exit status is zero if no +pattern matches. Otherwise, it is the exit status of the +last command executed in \fIlist\fP. +.TP +\fBif\fP \fIlist\fP; \fBthen\fP \fIlist\fP; \ +[ \fBelif\fP \fIlist\fP; \fBthen\fP \fIlist\fP; ] ... \ +[ \fBelse\fP \fIlist\fP; ] \fBfi\fP +The +.B if +.I list +is executed. If its exit status is zero, the +\fBthen\fP \fIlist\fP is executed. Otherwise, each \fBelif\fP +\fIlist\fP is executed in turn, and if its exit status is zero, +the corresponding \fBthen\fP \fIlist\fP is executed and the +command completes. Otherwise, the \fBelse\fP \fIlist\fP is +executed, if present. The exit status is the exit status of the +last command executed, or zero if no condition tested true. +.TP +\fBwhile\fP \fIlist-1\fP; \fBdo\fP \fIlist-2\fP; \fBdone\fP +.PD 0 +.TP +\fBuntil\fP \fIlist-1\fP; \fBdo\fP \fIlist-2\fP; \fBdone\fP +.PD +The \fBwhile\fP command continuously executes the list +\fIlist-2\fP as long as the last command in the list \fIlist-1\fP returns +an exit status of zero. The \fBuntil\fP command is identical +to the \fBwhile\fP command, except that the test is negated; +.I list-2 +is executed as long as the last command in +.I list-1 +returns a non-zero exit status. +The exit status of the \fBwhile\fP and \fBuntil\fP commands +is the exit status +of the last command executed in \fIlist-2\fP, or zero if +none was executed. +.SS Coprocesses +.PP +A \fIcoprocess\fP is a shell command preceded by the \fBcoproc\fP reserved +word. +A coprocess is executed asynchronously in a subshell, as if the command +had been terminated with the \fB&\fP control operator, with a two-way pipe +established between the executing shell and the coprocess. +.PP +The format for a coprocess is: +.RS +.PP +\fBcoproc\fP [\fINAME\fP] \fIcommand\fP [\fIredirections\fP] +.RE +.PP +This creates a coprocess named \fINAME\fP. +If \fINAME\fP is not supplied, the default name is \fBCOPROC\fP. +\fINAME\fP must not be supplied if \fIcommand\fP is a \fIsimple +command\fP (see above); otherwise, it is interpreted as the first word +of the simple command. +When the coprocess is executed, the shell creates an array variable (see +.B Arrays +below) named \fINAME\fP in the context of the executing shell. +The standard output of +.I command +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to \fINAME\fP[0]. +The standard input of +.I command +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to \fINAME\fP[1]. +This pipe is established before any redirections specified by the +command (see +.SM +.B REDIRECTION +below). +The file descriptors can be utilized as arguments to shell commands +and redirections using standard word expansions. +The file descriptors are not available in subshells. +The process ID of the shell spawned to execute the coprocess is +available as the value of the variable \fINAME\fP_PID. +The \fBwait\fP +builtin command may be used to wait for the coprocess to terminate. +.PP +Since the coprocess is created as an asynchronous command, +the \fBcoproc\fP command always returns success. +The return status of a coprocess is the exit status of \fIcommand\fP. +.SS Shell Function Definitions +.PP +A shell function is an object that is called like a simple command and +executes a compound command with a new set of positional parameters. +Shell functions are declared as follows: +.TP +\fIname\fP () \fIcompound\-command\fP [\fIredirection\fP] +.PD 0 +.TP +\fBfunction\fP \fIname\fP [()] \fIcompound\-command\fP [\fIredirection\fP] +.PD +This defines a function named \fIname\fP. +The reserved word \fBfunction\fP is optional. +If the \fBfunction\fP reserved word is supplied, the parentheses are optional. +The \fIbody\fP of the function is the compound command +.I compound\-command +(see \fBCompound Commands\fP above). +That command is usually a \fIlist\fP of commands between { and }, but +may be any command listed under \fBCompound Commands\fP above. +\fIcompound\-command\fP is executed whenever \fIname\fP is specified as the +name of a simple command. +When in \fIposix mode\fP, \fIname\fP may not be the name of one of the +POSIX \fIspecial builtins\fP. +Any redirections (see +.SM +.B REDIRECTION +below) specified when a function is defined are performed +when the function is executed. +The exit status of a function definition is zero unless a syntax error +occurs or a readonly function with the same name already exists. +When executed, the exit status of a function is the exit status of the +last command executed in the body. (See +.SM +.B FUNCTIONS +below.) +.SH COMMENTS +In a non-interactive shell, or an interactive shell in which the +.B interactive_comments +option to the +.B shopt +builtin is enabled (see +.SM +.B "SHELL BUILTIN COMMANDS" +below), a word beginning with +.B # +causes that word and all remaining characters on that line to +be ignored. An interactive shell without the +.B interactive_comments +option enabled does not allow comments. The +.B interactive_comments +option is on by default in interactive shells. +.SH QUOTING +\fIQuoting\fP is used to remove the special meaning of certain +characters or words to the shell. Quoting can be used to +disable special treatment for special characters, to prevent +reserved words from being recognized as such, and to prevent +parameter expansion. +.PP +Each of the \fImetacharacters\fP listed above under +.SM +.B DEFINITIONS +has special meaning to the shell and must be quoted if it is to +represent itself. +.PP +When the command history expansion facilities are being used +(see +.SM +.B HISTORY EXPANSION +below), the +\fIhistory expansion\fP character, usually \fB!\fP, must be quoted +to prevent history expansion. +.PP +There are three quoting mechanisms: the +.IR "escape character" , +single quotes, and double quotes. +.PP +A non-quoted backslash (\fB\e\fP) is the +.IR "escape character" . +It preserves the literal value of the next character that follows, +with the exception of . If a \fB\e\fP pair +appears, and the backslash is not itself quoted, the \fB\e\fP +is treated as a line continuation (that is, it is removed from the +input stream and effectively ignored). +.PP +Enclosing characters in single quotes preserves the literal value +of each character within the quotes. A single quote may not occur +between single quotes, even when preceded by a backslash. +.PP +Enclosing characters in double quotes preserves the literal value +of all characters within the quotes, with the exception of +.BR $ , +.BR \` , +.BR \e , +and, when history expansion is enabled, +.BR ! . +The characters +.B $ +and +.B \` +retain their special meaning within double quotes. The backslash +retains its special meaning only when followed by one of the following +characters: +.BR $ , +.BR \` , +\^\fB"\fP\^, +.BR \e , +or +.BR . +A double quote may be quoted within double quotes by preceding it with +a backslash. +If enabled, history expansion will be performed unless an +.B ! +appearing in double quotes is escaped using a backslash. +The backslash preceding the +.B ! +is not removed. +.PP +The special parameters +.B * +and +.B @ +have special meaning when in double +quotes (see +.SM +.B PARAMETERS +below). +.PP +Words of the form \fB$\fP\(aq\fIstring\fP\(aq are treated specially. The +word expands to \fIstring\fP, with backslash-escaped characters replaced +as specified by the ANSI C standard. Backslash escape sequences, if +present, are decoded as follows: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ee +.TP +.B \eE +an escape character +.TP +.B \ef +form feed +.TP +.B \en +new line +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\e +backslash +.TP +.B \e\(aq +single quote +.TP +.B \e\(dq +double quote +.TP +.B \e\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(one to three digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.TP +.B \eu\fIHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHH\fP (one to four hex digits) +.TP +.B \eU\fIHHHHHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHHHHHH\fP (one to eight hex digits) +.TP +.B \ec\fIx\fP +a control-\fIx\fP character +.PD +.RE +.LP +The expanded result is single-quoted, as if the dollar sign had +not been present. +.PP +A double-quoted string preceded by a dollar sign (\fB$\fP\(dq\fIstring\fP\(dq) +will cause the string to be translated according to the current locale. +If the current locale is \fBC\fP or \fBPOSIX\fP, the dollar sign +is ignored. +If the string is translated and replaced, the replacement is +double-quoted. +.SH PARAMETERS +A +.I parameter +is an entity that stores values. +It can be a +.IR name , +a number, or one of the special characters listed below under +.BR "Special Parameters" . +A +.I variable +is a parameter denoted by a +.IR name . +A variable has a \fIvalue\fP and zero or more \fIattributes\fP. +Attributes are assigned using the +.B declare +builtin command (see +.B declare +below in +.SM +.BR "SHELL BUILTIN COMMANDS" ). +.PP +A parameter is set if it has been assigned a value. The null string is +a valid value. Once a variable is set, it may be unset only by using +the +.B unset +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.PP +A +.I variable +may be assigned to by a statement of the form +.RS +.PP +\fIname\fP=[\fIvalue\fP] +.RE +.PP +If +.I value +is not given, the variable is assigned the null string. All +.I values +undergo tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote +removal (see +.SM +.B EXPANSION +below). If the variable has its +.B integer +attribute set, then +.I value +is evaluated as an arithmetic expression even if the $((...)) expansion is +not used (see +.B "Arithmetic Expansion" +below). +Word splitting is not performed, with the exception +of \fB"$@"\fP as explained below under +.BR "Special Parameters" . +Pathname expansion is not performed. +Assignment statements may also appear as arguments to the +.BR alias , +.BR declare , +.BR typeset , +.BR export , +.BR readonly , +and +.B local +builtin commands. +When in \fIposix mode\fP, these builtins may appear in a command after +one or more instances of the \fBcommand\fP builtin and retain these +assignment statement properties. +.PP +In the context where an assignment statement is assigning a value +to a shell variable or array index, the += operator can be used to +append to or add to the variable's previous value. +When += is applied to a variable for which the \fIinteger\fP attribute has been +set, \fIvalue\fP is evaluated as an arithmetic expression and added to the +variable's current value, which is also evaluated. +When += is applied to an array variable using compound assignment (see +.B Arrays +below), the +variable's value is not unset (as it is when using =), and new values are +appended to the array beginning at one greater than the array's maximum index +(for indexed arrays) or added as additional key\-value pairs in an +associative array. +When applied to a string-valued variable, \fIvalue\fP is expanded and +appended to the variable's value. +.PP +A variable can be assigned the \fInameref\fP attribute using the +\fB\-n\fP option to the \fBdeclare\fP or \fBlocal\fP builtin commands +(see the descriptions of \fBdeclare\fP and \fBlocal\fP below) +to create a \fInameref\fP, or a reference to another variable. +This allows variables to be manipulated indirectly. +Whenever the nameref variable is referenced or assigned to, the operation +is actually performed on the variable specified by the nameref variable's +value. +A nameref is commonly used within shell functions to refer to a variable +whose name is passed as an argument to the function. +For instance, if a variable name is passed to a shell function as its first +argument, running +.sp .5 +.RS +.if t \f(CWdeclare -n ref=$1\fP +.if n declare -n ref=$1 +.RE +.sp .5 +inside the function creates a nameref variable \fBref\fP whose value is +the variable name passed as the first argument. +References and assignments to \fBref\fP are treated as references and +assignments to the variable whose name was passed as \fB$1\fP. +If the control variable in a \fBfor\fP loop has the nameref attribute, +the list of words can be a list of shell variables, and a name reference +will be established for each word in the list, in turn, when the loop is +executed. +Array variables cannot be given the \fB\-n\fP attribute. +However, nameref variables can reference array variables and subscripted +array variables. +Namerefs can be unset using the \fB\-n\fP option to the \fBunset\fP builtin. +Otherwise, if \fBunset\fP is executed with the name of a nameref variable +as an argument, the variable referenced by the nameref variable will be unset. +.SS Positional Parameters +.PP +A +.I positional parameter +is a parameter denoted by one or more +digits, other than the single digit 0. Positional parameters are +assigned from the shell's arguments when it is invoked, +and may be reassigned using the +.B set +builtin command. Positional parameters may not be assigned to +with assignment statements. The positional parameters are +temporarily replaced when a shell function is executed (see +.SM +.B FUNCTIONS +below). +.PP +When a positional parameter consisting of more than a single +digit is expanded, it must be enclosed in braces (see +.SM +.B EXPANSION +below). +.SS Special Parameters +.PP +The shell treats several parameters specially. These parameters may +only be referenced; assignment to them is not allowed. +.PD 0 +.TP +.B * +Expands to the positional parameters, starting from one. +When the expansion is not within double quotes, each positional parameter +expands to a separate word. +In contexts where it is performed, those words +are subject to further word splitting and pathname expansion. +When the expansion occurs within double quotes, it expands to a single word +with the value of each parameter separated by the first character +of the +.SM +.B IFS +special variable. That is, "\fB$*\fP" is equivalent +to "\fB$1\fP\fIc\fP\fB$2\fP\fIc\fP\fB...\fP", where +.I c +is the first character of the value of the +.SM +.B IFS +variable. If +.SM +.B IFS +is unset, the parameters are separated by spaces. +If +.SM +.B IFS +is null, the parameters are joined without intervening separators. +.TP +.B @ +Expands to the positional parameters, starting from one. When the +expansion occurs within double quotes, each parameter expands to a +separate word. That is, "\fB$@\fP" is equivalent to +"\fB$1\fP" "\fB$2\fP" ... +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +When there are no positional parameters, "\fB$@\fP" and +.B $@ +expand to nothing (i.e., they are removed). +.TP +.B # +Expands to the number of positional parameters in decimal. +.TP +.B ? +Expands to the exit status of the most recently executed foreground +pipeline. +.TP +.B \- +Expands to the current option flags as specified upon invocation, +by the +.B set +builtin command, or those set by the shell itself +(such as the +.B \-i +option). +.TP +.B $ +Expands to the process ID of the shell. In a () subshell, it +expands to the process ID of the current shell, not the +subshell. +.TP +.B ! +Expands to the process ID of the job most recently placed into the +background, whether executed as an asynchronous command or using +the \fBbg\fP builtin (see +.SM +.B "JOB CONTROL" +below). +.TP +.B 0 +Expands to the name of the shell or shell script. This is set at +shell initialization. If +.B bash +is invoked with a file of commands, +.B $0 +is set to the name of that file. If +.B bash +is started with the +.B \-c +option, then +.B $0 +is set to the first argument after the string to be +executed, if one is present. Otherwise, it is set +to the filename used to invoke +.BR bash , +as given by argument zero. +.TP +.B _ +At shell startup, set to the absolute pathname used to invoke the +shell or shell script being executed as passed in the environment +or argument list. +Subsequently, expands to the last argument to the previous command, +after expansion. +Also set to the full pathname used to invoke each command executed +and placed in the environment exported to that command. +When checking mail, this parameter holds the name of the mail file +currently being checked. +.PD +.SS Shell Variables +.PP +The following variables are set by the shell: +.PP +.PD 0 +.TP +.B BASH +Expands to the full filename used to invoke this instance of +.BR bash . +.TP +.B BASHOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +.B \-s +option to the +.B shopt +builtin command (see +.SM +.B "SHELL BUILTIN COMMANDS" +below). The options appearing in +.SM +.B BASHOPTS +are those reported as +.I on +by \fBshopt\fP. +If this variable is in the environment when +.B bash +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +.TP +.B BASHPID +Expands to the process ID of the current \fBbash\fP process. +This differs from \fB$$\fP under certain circumstances, such as subshells +that do not require \fBbash\fP to be re-initialized. +.TP +.B BASH_ALIASES +An associative array variable whose members correspond to the internal +list of aliases as maintained by the \fBalias\fP builtin. +Elements added to this array appear in the alias list; unsetting array +elements cause aliases to be removed from the alias list. +.TP +.B BASH_ARGC +An array variable whose values are the number of parameters in each +frame of the current \fBbash\fP execution call stack. +The number of +parameters to the current subroutine (shell function or script executed +with \fB.\fP or \fBsource\fP) is at the top of the stack. +When a subroutine is executed, the number of parameters passed is pushed onto +.SM +.BR BASH_ARGC . +The shell sets +.SM +.B BASH_ARGC +only when in extended debugging mode (see the description of the +.B extdebug +option to the +.B shopt +builtin below) +.TP +.B BASH_ARGV +An array variable containing all of the parameters in the current \fBbash\fP +execution call stack. The final parameter of the last subroutine call +is at the top of the stack; the first parameter of the initial call is +at the bottom. When a subroutine is executed, the parameters supplied +are pushed onto +.SM +.BR BASH_ARGV . +The shell sets +.SM +.B BASH_ARGV +only when in extended debugging mode +(see the description of the +.B extdebug +option to the +.B shopt +builtin below) +.TP +.B BASH_CMDS +An associative array variable whose members correspond to the internal +hash table of commands as maintained by the \fBhash\fP builtin. +Elements added to this array appear in the hash table; unsetting array +elements cause commands to be removed from the hash table. +.TP +.B BASH_COMMAND +The command currently being executed or about to be executed, unless the +shell is executing a command as the result of a trap, +in which case it is the command executing at the time of the trap. +.TP +.B BASH_EXECUTION_STRING +The command argument to the \fB\-c\fP invocation option. +.TP +.B BASH_LINENO +An array variable whose members are the line numbers in source files +where each corresponding member of +.SM +.B FUNCNAME +was invoked. +\fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP is the line number in the source +file (\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP) where +\fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP was called +(or \fB${BASH_LINENO[\fP\fI$i-1\fP\fB]}\fP if referenced within another +shell function). +Use +.SM +.B LINENO +to obtain the current line number. +.TP +.B BASH_REMATCH +An array variable whose members are assigned by the \fB=~\fP binary +operator to the \fB[[\fP conditional command. +The element with index 0 is the portion of the string +matching the entire regular expression. +The element with index \fIn\fP is the portion of the +string matching the \fIn\fPth parenthesized subexpression. +This variable is read-only. +.TP +.B BASH_SOURCE +An array variable whose members are the source filenames +where the corresponding shell function names in the +.SM +.B FUNCNAME +array variable are defined. +The shell function +\fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP is defined in the file +\fB${BASH_SOURCE[\fP\fI$i\fP\fB]}\fP and called from +\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP. +.TP +.B BASH_SUBSHELL +Incremented by one within each subshell or subshell environment when +the shell begins executing in that environment. +The initial value is 0. +.TP +.B BASH_VERSINFO +A readonly array variable whose members hold version information for +this instance of +.BR bash . +The values assigned to the array members are as follows: +.sp .5 +.RS +.TP 24 +.B BASH_VERSINFO[\fR0\fP] +The major version number (the \fIrelease\fP). +.TP +.B BASH_VERSINFO[\fR1\fP] +The minor version number (the \fIversion\fP). +.TP +.B BASH_VERSINFO[\fR2\fP] +The patch level. +.TP +.B BASH_VERSINFO[\fR3\fP] +The build version. +.TP +.B BASH_VERSINFO[\fR4\fP] +The release status (e.g., \fIbeta1\fP). +.TP +.B BASH_VERSINFO[\fR5\fP] +The value of +.SM +.BR MACHTYPE . +.RE +.TP +.B BASH_VERSION +Expands to a string describing the version of this instance of +.BR bash . +.TP +.B COMP_CWORD +An index into \fB${COMP_WORDS}\fP of the word containing the current +cursor position. +This variable is available only in shell functions invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_KEY +The key (or final key of a key sequence) used to invoke the current +completion function. +.TP +.B COMP_LINE +The current command line. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_POINT +The index of the current cursor position relative to the beginning of +the current command. +If the current cursor position is at the end of the current command, +the value of this variable is equal to \fB${#COMP_LINE}\fP. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_TYPE +Set to an integer value corresponding to the type of completion attempted +that caused a completion function to be called: +\fITAB\fP, for normal completion, +\fI?\fP, for listing completions after successive tabs, +\fI!\fP, for listing alternatives on partial word completion, +\fI@\fP, to list completions if the word is not unmodified, +or +\fI%\fP, for menu completion. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_WORDBREAKS +The set of characters that the \fBreadline\fP library treats as word +separators when performing word completion. +If +.SM +.B COMP_WORDBREAKS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B COMP_WORDS +An array variable (see \fBArrays\fP below) consisting of the individual +words in the current command line. +The line is split into words as \fBreadline\fP would split it, using +.SM +.B COMP_WORDBREAKS +as described above. +This variable is available only in shell functions invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COPROC +An array variable (see \fBArrays\fP below) created to hold the file descriptors +for output from and input to an unnamed coprocess (see \fBCoprocesses\fP +above). +.TP +.B DIRSTACK +An array variable (see +.B Arrays +below) containing the current contents of the directory stack. +Directories appear in the stack in the order they are displayed by the +.B dirs +builtin. +Assigning to members of this array variable may be used to modify +directories already in the stack, but the +.B pushd +and +.B popd +builtins must be used to add and remove directories. +Assignment to this variable will not change the current directory. +If +.SM +.B DIRSTACK +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B EUID +Expands to the effective user ID of the current user, initialized at +shell startup. This variable is readonly. +.TP +.B FUNCNAME +An array variable containing the names of all shell functions +currently in the execution call stack. +The element with index 0 is the name of any currently-executing +shell function. +The bottom-most element (the one with the highest index) is +.if t \f(CW"main"\fP. +.if n "main". +This variable exists only when a shell function is executing. +Assignments to +.SM +.B FUNCNAME +have no effect and return an error status. +If +.SM +.B FUNCNAME +is unset, it loses its special properties, even if it is +subsequently reset. +.if t .sp 0.5 +.if n .sp 1 +This variable can be used with \fBBASH_LINENO\fP and \fBBASH_SOURCE\fP. +Each element of \fBFUNCNAME\fP has corresponding elements in +\fBBASH_LINENO\fP and \fBBASH_SOURCE\fP to describe the call stack. +For instance, \fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP was called from the file +\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP at line number +\fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP. +The \fBcaller\fP builtin displays the current call stack using this +information. +.TP +.B GROUPS +An array variable containing the list of groups of which the current +user is a member. +Assignments to +.SM +.B GROUPS +have no effect and return an error status. +If +.SM +.B GROUPS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B HISTCMD +The history number, or index in the history list, of the current +command. +If +.SM +.B HISTCMD +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B HOSTNAME +Automatically set to the name of the current host. +.TP +.B HOSTTYPE +Automatically set to a string that uniquely +describes the type of machine on which +.B bash +is executing. +The default is system-dependent. +.TP +.B LINENO +Each time this parameter is referenced, the shell substitutes +a decimal number representing the current sequential line number +(starting with 1) within a script or function. When not in a +script or function, the value substituted is not guaranteed to +be meaningful. +If +.SM +.B LINENO +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B MACHTYPE +Automatically set to a string that fully describes the system +type on which +.B bash +is executing, in the standard GNU \fIcpu-company-system\fP format. +The default is system-dependent. +.TP +.B MAPFILE +An array variable (see \fBArrays\fP below) created to hold the text +read by the \fBmapfile\fP builtin when no variable name is supplied. +.TP +.B OLDPWD +The previous working directory as set by the +.B cd +command. +.TP +.B OPTARG +The value of the last option argument processed by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.TP +.B OPTIND +The index of the next argument to be processed by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.TP +.B OSTYPE +Automatically set to a string that +describes the operating system on which +.B bash +is executing. +The default is system-dependent. +.TP +.B PIPESTATUS +An array variable (see +.B Arrays +below) containing a list of exit status values from the processes +in the most-recently-executed foreground pipeline (which may +contain only a single command). +.TP +.B PPID +The process ID of the shell's parent. This variable is readonly. +.TP +.B PWD +The current working directory as set by the +.B cd +command. +.TP +.B RANDOM +Each time this parameter is referenced, a random integer between +0 and 32767 is +generated. The sequence of random numbers may be initialized by assigning +a value to +.SM +.BR RANDOM . +If +.SM +.B RANDOM +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B READLINE_LINE +The contents of the +.B readline +line buffer, for use with +.if t \f(CWbind -x\fP +.if n "bind -x" +(see +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.TP +.B READLINE_POINT +The position of the insertion point in the +.B readline +line buffer, for use with +.if t \f(CWbind -x\fP +.if n "bind -x" +(see +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.TP +.B REPLY +Set to the line of input read by the +.B read +builtin command when no arguments are supplied. +.TP +.B SECONDS +Each time this parameter is +referenced, the number of seconds since shell invocation is returned. If a +value is assigned to +.SM +.BR SECONDS , +the value returned upon subsequent +references is +the number of seconds since the assignment plus the value assigned. +If +.SM +.B SECONDS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B SHELLOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +.B \-o +option to the +.B set +builtin command (see +.SM +.B "SHELL BUILTIN COMMANDS" +below). The options appearing in +.SM +.B SHELLOPTS +are those reported as +.I on +by \fBset \-o\fP. +If this variable is in the environment when +.B bash +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +.TP +.B SHLVL +Incremented by one each time an instance of +.B bash +is started. +.TP +.B UID +Expands to the user ID of the current user, initialized at shell startup. +This variable is readonly. +.PD +.PP +The following variables are used by the shell. In some cases, +.B bash +assigns a default value to a variable; these cases are noted +below. +.PP +.PD 0 +.TP +.B BASH_COMPAT +The value is used to set the shell's compatibility level. +See the description of the \fBshopt\fP builtin below under +\fBSHELL BUILTIN COMMANDS\fP +for a description of the various compatibility +levels and their effects. +The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42) +corresponding to the desired compatibility level. +If \fBBASH_COMPAT\fP is unset or set to the empty string, the compatibility +level is set to the default for the current version. +If \fBBASH_COMPAT\fP is set to a value that is not one of the valid +compatibility levels, the shell prints an error message and sets the +compatibility level to the default for the current version. +The valid compatibility levels correspond to the compatibility options +accepted by the \fBshopt\fP builtin described below (for example, +\fBcompat42\fP means that 4.2 and 42 are valid values). +The current version is also a valid value. +.TP +.B BASH_ENV +If this parameter is set when \fBbash\fP is executing a shell script, +its value is interpreted as a filename containing commands to +initialize the shell, as in +.IR ~/.bashrc . +The value of +.SM +.B BASH_ENV +is subjected to parameter expansion, command substitution, and arithmetic +expansion before being interpreted as a filename. +.SM +.B PATH +is not used to search for the resultant filename. +.TP +.B BASH_XTRACEFD +If set to an integer corresponding to a valid file descriptor, \fBbash\fP +will write the trace output generated when +.if t \f(CWset -x\fP +.if n \fIset -x\fP +is enabled to that file descriptor. +The file descriptor is closed when +.SM +.B BASH_XTRACEFD +is unset or assigned a new value. +Unsetting +.SM +.B BASH_XTRACEFD +or assigning it the empty string causes the +trace output to be sent to the standard error. +Note that setting +.SM +.B BASH_XTRACEFD +to 2 (the standard error file +descriptor) and then unsetting it will result in the standard error +being closed. +.TP +.B CDPATH +The search path for the +.B cd +command. +This is a colon-separated list of directories in which the shell looks +for destination directories specified by the +.B cd +command. +A sample value is +.if t \f(CW".:~:/usr"\fP. +.if n ".:~:/usr". +.TP +.B CHILD_MAX +Set the number of exited child status values for the shell to remember. +Bash will not allow this value to be decreased below a POSIX-mandated +minimum, and there is a maximum value (currently 8192) that this may +not exceed. +The minimum value is system-dependent. +.TP +.B COLUMNS +Used by the \fBselect\fP compound command to determine the terminal width +when printing selection lists. +Automatically set if the +.B checkwinsize +option is enabled or in an interactive shell upon receipt of a +.SM +.BR SIGWINCH . +.TP +.B COMPREPLY +An array variable from which \fBbash\fP reads the possible completions +generated by a shell function invoked by the programmable completion +facility (see \fBProgrammable Completion\fP below). +Each array element contains one possible completion. +.TP +.B EMACS +If \fBbash\fP finds this variable in the environment when the shell starts +with value +.if t \f(CWt\fP, +.if n "t", +it assumes that the shell is running in an Emacs shell buffer and disables +line editing. +.TP +.B ENV +Similar to +.SM +.BR BASH_ENV ; +used when the shell is invoked in POSIX mode. +.TP +.B FCEDIT +The default editor for the +.B fc +builtin command. +.TP +.B FIGNORE +A colon-separated list of suffixes to ignore when performing +filename completion (see +.SM +.B READLINE +below). +A filename whose suffix matches one of the entries in +.SM +.B FIGNORE +is excluded from the list of matched filenames. +A sample value is +.if t \f(CW".o:~"\fP. +.if n ".o:~" +(Quoting is needed when assigning a value to this variable, +which contains tildes). +.TP +.B FUNCNEST +If set to a numeric value greater than 0, defines a maximum function +nesting level. Function invocations that exceed this nesting level +will cause the current command to abort. +.TP +.B GLOBIGNORE +A colon-separated list of patterns defining the set of filenames to +be ignored by pathname expansion. +If a filename matched by a pathname expansion pattern also matches one +of the patterns in +.SM +.BR GLOBIGNORE , +it is removed from the list of matches. +.TP +.B HISTCONTROL +A colon-separated list of values controlling how commands are saved on +the history list. +If the list of values includes +.IR ignorespace , +lines which begin with a +.B space +character are not saved in the history list. +A value of +.I ignoredups +causes lines matching the previous history entry to not be saved. +A value of +.I ignoreboth +is shorthand for \fIignorespace\fP and \fIignoredups\fP. +A value of +.IR erasedups +causes all previous lines matching the current line to be removed from +the history list before that line is saved. +Any value not in the above list is ignored. +If +.SM +.B HISTCONTROL +is unset, or does not include a valid value, +all lines read by the shell parser are saved on the history list, +subject to the value of +.SM +.BR HISTIGNORE . +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +.SM +.BR HISTCONTROL . +.TP +.B HISTFILE +The name of the file in which command history is saved (see +.SM +.B HISTORY +below). The default value is \fI~/.bash_history\fP. If unset, the +command history is not saved when a shell exits. +.TP +.B HISTFILESIZE +The maximum number of lines contained in the history file. When this +variable is assigned a value, the history file is truncated, if +necessary, +to contain no more than that number of lines by removing the oldest entries. +The history file is also truncated to this size after +writing it when a shell exits. +If the value is 0, the history file is truncated to zero size. +Non-numeric values and numeric values less than zero inhibit truncation. +The shell sets the default value to the value of \fBHISTSIZE\fP +after reading any startup files. +.TP +.B HISTIGNORE +A colon-separated list of patterns used to decide which command lines +should be saved on the history list. Each pattern is anchored at the +beginning of the line and must match the complete line (no implicit +`\fB*\fP' is appended). Each pattern is tested against the line +after the checks specified by +.SM +.B HISTCONTROL +are applied. +In addition to the normal shell pattern matching characters, `\fB&\fP' +matches the previous history line. `\fB&\fP' may be escaped using a +backslash; the backslash is removed before attempting a match. +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +.SM +.BR HISTIGNORE . +.TP +.B HISTSIZE +The number of commands to remember in the command history (see +.SM +.B HISTORY +below). +If the value is 0, commands are not saved in the history list. +Numeric values less than zero result in every command being saved +on the history list (there is no limit). +The shell sets the default value to 500 after reading any startup files. +.TP +.B HISTTIMEFORMAT +If this variable is set and not null, its value is used as a format string +for \fIstrftime\fP(3) to print the time stamp associated with each history +entry displayed by the \fBhistory\fP builtin. +If this variable is set, time stamps are written to the history file so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +.TP +.B HOME +The home directory of the current user; the default argument for the +\fBcd\fP builtin command. +The value of this variable is also used when performing tilde expansion. +.TP +.B HOSTFILE +Contains the name of a file in the same format as +.FN /etc/hosts +that should be read when the shell needs to complete a +hostname. +The list of possible hostname completions may be changed while the +shell is running; +the next time hostname completion is attempted after the +value is changed, +.B bash +adds the contents of the new file to the existing list. +If +.SM +.B HOSTFILE +is set, but has no value, or does not name a readable file, +\fBbash\fP attempts to read +.FN /etc/hosts +to obtain the list of possible hostname completions. +When +.SM +.B HOSTFILE +is unset, the hostname list is cleared. +.TP +.B IFS +The +.I Internal Field Separator +that is used +for word splitting after expansion and to +split lines into words with the +.B read +builtin command. The default value is +``''. +.TP +.B IGNOREEOF +Controls the +action of an interactive shell on receipt of an +.SM +.B EOF +character as the sole input. If set, the value is the number of +consecutive +.SM +.B EOF +characters which must be +typed as the first characters on an input line before +.B bash +exits. If the variable exists but does not have a numeric value, or +has no value, the default value is 10. If it does not exist, +.SM +.B EOF +signifies the end of input to the shell. +.TP +.B INPUTRC +The filename for the +.B readline +startup file, overriding the default of +.FN ~/.inputrc +(see +.SM +.B READLINE +below). +.TP +.B LANG +Used to determine the locale category for any category not specifically +selected with a variable starting with \fBLC_\fP. +.TP +.B LC_ALL +This variable overrides the value of +.SM +.B LANG +and any other +\fBLC_\fP variable specifying a locale category. +.TP +.B LC_COLLATE +This variable determines the collation order used when sorting the +results of pathname expansion, and determines the behavior of range +expressions, equivalence classes, and collating sequences within +pathname expansion and pattern matching. +.TP +.B LC_CTYPE +This variable determines the interpretation of characters and the +behavior of character classes within pathname expansion and pattern +matching. +.TP +.B LC_MESSAGES +This variable determines the locale used to translate double-quoted +strings preceded by a \fB$\fP. +.TP +.B LC_NUMERIC +This variable determines the locale category used for number formatting. +.TP +.B LINES +Used by the \fBselect\fP compound command to determine the column length +for printing selection lists. +Automatically set if the +.B checkwinsize +option is enabled or in an interactive shell upon receipt of a +.SM +.BR SIGWINCH . +.TP +.B MAIL +If this parameter is set to a file or directory name and the +.SM +.B MAILPATH +variable is not set, +.B bash +informs the user of the arrival of mail in the specified file or +Maildir-format directory. +.TP +.B MAILCHECK +Specifies how +often (in seconds) +.B bash +checks for mail. The default is 60 seconds. When it is time to check +for mail, the shell does so before displaying the primary prompt. +If this variable is unset, or set to a value that is not a number +greater than or equal to zero, the shell disables mail checking. +.TP +.B MAILPATH +A colon-separated list of filenames to be checked for mail. +The message to be printed when mail arrives in a particular file +may be specified by separating the filename from the message with a `?'. +When used in the text of the message, \fB$_\fP expands to the name of +the current mailfile. +Example: +.RS +.PP +\fBMAILPATH\fP=\(aq/var/mail/bfox?"You have mail":~/shell\-mail?"$_ has mail!"\(aq +.PP +.B Bash +supplies a default value for this variable, but the location of the user +mail files that it uses is system dependent (e.g., /var/mail/\fB$USER\fP). +.RE +.TP +.B OPTERR +If set to the value 1, +.B bash +displays error messages generated by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SM +.B OPTERR +is initialized to 1 each time the shell is invoked or a shell +script is executed. +.TP +.B PATH +The search path for commands. It +is a colon-separated list of directories in which +the shell looks for commands (see +.SM +.B COMMAND EXECUTION +below). +A zero-length (null) directory name in the value of +.SM +.B PATH +indicates the current directory. +A null directory name may appear as two adjacent colons, or as an initial +or trailing colon. +The default path is system-dependent, +and is set by the administrator who installs +.BR bash . +A common value is +.if t \f(CW/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin\fP. +.if n ``/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin''. +.TP +.B POSIXLY_CORRECT +If this variable is in the environment when \fBbash\fP starts, the shell +enters \fIposix mode\fP before reading the startup files, as if the +.B \-\-posix +invocation option had been supplied. If it is set while the shell is +running, \fBbash\fP enables \fIposix mode\fP, as if the command +.if t \f(CWset -o posix\fP +.if n \fIset -o posix\fP +had been executed. +.TP +.B PROMPT_COMMAND +If set, the value is executed as a command prior to issuing each primary +prompt. +.TP +.B PROMPT_DIRTRIM +If set to a number greater than zero, the value is used as the number of +trailing directory components to retain when expanding the \fB\ew\fP and +\fB\eW\fP prompt string escapes (see +.SM +.B PROMPTING +below). Characters removed are replaced with an ellipsis. +.TP +.B PS1 +The value of this parameter is expanded (see +.SM +.B PROMPTING +below) and used as the primary prompt string. The default value is +``\fB\es\-\ev\e$ \fP''. +.TP +.B PS2 +The value of this parameter is expanded as with +.SM +.B PS1 +and used as the secondary prompt string. The default is +``\fB> \fP''. +.TP +.B PS3 +The value of this parameter is used as the prompt for the +.B select +command (see +.SM +.B SHELL GRAMMAR +above). +.TP +.B PS4 +The value of this parameter is expanded as with +.SM +.B PS1 +and the value is printed before each command +.B bash +displays during an execution trace. The first character of +.SM +.B PS4 +is replicated multiple times, as necessary, to indicate multiple +levels of indirection. The default is ``\fB+ \fP''. +.TP +.B SHELL +The full pathname to the shell is kept in this environment variable. +If it is not set when the shell starts, +.B bash +assigns to it the full pathname of the current user's login shell. +.TP +.B TIMEFORMAT +The value of this parameter is used as a format string specifying +how the timing information for pipelines prefixed with the +.B time +reserved word should be displayed. +The \fB%\fP character introduces an escape sequence that is +expanded to a time value or other information. +The escape sequences and their meanings are as follows; the +braces denote optional portions. +.sp .5 +.RS +.PD 0 +.TP 10 +.B %% +A literal \fB%\fP. +.TP +.B %[\fIp\fP][l]R +The elapsed time in seconds. +.TP +.B %[\fIp\fP][l]U +The number of CPU seconds spent in user mode. +.TP +.B %[\fIp\fP][l]S +The number of CPU seconds spent in system mode. +.TP +.B %P +The CPU percentage, computed as (%U + %S) / %R. +.PD +.RE +.IP +The optional \fIp\fP is a digit specifying the \fIprecision\fP, +the number of fractional digits after a decimal point. +A value of 0 causes no decimal point or fraction to be output. +At most three places after the decimal point may be specified; +values of \fIp\fP greater than 3 are changed to 3. +If \fIp\fP is not specified, the value 3 is used. +.IP +The optional \fBl\fP specifies a longer format, including +minutes, of the form \fIMM\fPm\fISS\fP.\fIFF\fPs. +The value of \fIp\fP determines whether or not the fraction is +included. +.IP +If this variable is not set, \fBbash\fP acts as if it had the +value \fB$\(aq\enreal\et%3lR\enuser\et%3lU\ensys\et%3lS\(aq\fP. +If the value is null, no timing information is displayed. +A trailing newline is added when the format string is displayed. +.PD 0 +.TP +.B TMOUT +If set to a value greater than zero, +.SM +.B TMOUT +is treated as the +default timeout for the \fBread\fP builtin. +The \fBselect\fP command terminates if input does not arrive +after +.SM +.B TMOUT +seconds when input is coming from a terminal. +In an interactive shell, the value is interpreted as the +number of seconds to wait for a line of input after issuing the +primary prompt. +.B Bash +terminates after waiting for that number of seconds if a complete +line of input does not arrive. +.TP +.B TMPDIR +If set, \fBbash\fP uses its value as the name of a directory in which +\fBbash\fP creates temporary files for the shell's use. +.TP +.B auto_resume +This variable controls how the shell interacts with the user and +job control. If this variable is set, single word simple +commands without redirections are treated as candidates for resumption +of an existing stopped job. There is no ambiguity allowed; if there is +more than one job beginning with the string typed, the job most recently +accessed is selected. The +.I name +of a stopped job, in this context, is the command line used to +start it. +If set to the value +.IR exact , +the string supplied must match the name of a stopped job exactly; +if set to +.IR substring , +the string supplied needs to match a substring of the name of a +stopped job. The +.I substring +value provides functionality analogous to the +.B %? +job identifier (see +.SM +.B JOB CONTROL +below). If set to any other value, the supplied string must +be a prefix of a stopped job's name; this provides functionality +analogous to the \fB%\fP\fIstring\fP job identifier. +.TP +.B histchars +The two or three characters which control history expansion +and tokenization (see +.SM +.B HISTORY EXPANSION +below). The first character is the \fIhistory expansion\fP character, +the character which signals the start of a history +expansion, normally `\fB!\fP'. +The second character is the \fIquick substitution\fP +character, which is used as shorthand for re-running the previous +command entered, substituting one string for another in the command. +The default is `\fB^\fP'. +The optional third character is the character +which indicates that the remainder of the line is a comment when found +as the first character of a word, normally `\fB#\fP'. The history +comment character causes history substitution to be skipped for the +remaining words on the line. It does not necessarily cause the shell +parser to treat the rest of the line as a comment. +.PD +.SS Arrays +.B Bash +provides one-dimensional indexed and associative array variables. +Any variable may be used as an indexed array; the +.B declare +builtin will explicitly declare an array. +There is no maximum +limit on the size of an array, nor any requirement that members +be indexed or assigned contiguously. +Indexed arrays are referenced using integers (including arithmetic +expressions) and are zero-based; associative arrays are referenced +using arbitrary strings. +Unless otherwise noted, indexed array indices must be non-negative integers. +.PP +An indexed array is created automatically if any variable is assigned to +using the syntax \fIname\fP[\fIsubscript\fP]=\fIvalue\fP. The +.I subscript +is treated as an arithmetic expression that must evaluate to a number. +To explicitly declare an indexed array, use +.B declare \-a \fIname\fP +(see +.SM +.B SHELL BUILTIN COMMANDS +below). +.B declare \-a \fIname\fP[\fIsubscript\fP] +is also accepted; the \fIsubscript\fP is ignored. +.PP +Associative arrays are created using +.BR "declare \-A \fIname\fP" . +.PP +Attributes may be +specified for an array variable using the +.B declare +and +.B readonly +builtins. Each attribute applies to all members of an array. +.PP +Arrays are assigned to using compound assignments of the form +\fIname\fP=\fB(\fPvalue\fI1\fP ... value\fIn\fP\fB)\fP, where each +\fIvalue\fP is of the form [\fIsubscript\fP]=\fIstring\fP. +Indexed array assignments do not require anything but \fIstring\fP. +When assigning to indexed arrays, if the optional brackets and subscript +are supplied, that index is assigned to; +otherwise the index of the element assigned is the last index assigned +to by the statement plus one. Indexing starts at zero. +.PP +When assigning to an associative array, the subscript is required. +.PP +This syntax is also accepted by the +.B declare +builtin. Individual array elements may be assigned to using the +\fIname\fP[\fIsubscript\fP]=\fIvalue\fP syntax introduced above. +When assigning to an indexed array, if +.I name +is subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +\fIname\fP, so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.PP +Any element of an array may be referenced using +${\fIname\fP[\fIsubscript\fP]}. The braces are required to avoid +conflicts with pathname expansion. If +\fIsubscript\fP is \fB@\fP or \fB*\fP, the word expands to +all members of \fIname\fP. These subscripts differ only when the +word appears within double quotes. If the word is double-quoted, +${\fIname\fP[*]} expands to a single +word with the value of each array member separated by the first +character of the +.SM +.B IFS +special variable, and ${\fIname\fP[@]} expands each element of +\fIname\fP to a separate word. When there are no array members, +${\fIname\fP[@]} expands to nothing. +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +This is analogous to the expansion +of the special parameters \fB*\fP and \fB@\fP (see +.B Special Parameters +above). ${#\fIname\fP[\fIsubscript\fP]} expands to the length of +${\fIname\fP[\fIsubscript\fP]}. If \fIsubscript\fP is \fB*\fP or +\fB@\fP, the expansion is the number of elements in the array. +Referencing an array variable without a subscript is equivalent to +referencing the array with a subscript of 0. +If the +.I subscript +used to reference an element of an indexed array +evaluates to a number less than zero, it is +interpreted as relative to one greater than the maximum index of the array, +so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.PP +An array variable is considered set if a subscript has been assigned a +value. The null string is a valid value. +.PP +It is possible to obtain the keys (indices) of an array as well as the values. +${\fB!\fP\fIname\fP[\fI@\fP]} and ${\fB!\fP\fIname\fP[\fI*\fP]} +expand to the indices assigned in array variable \fIname\fP. +The treatment when in double quotes is similar to the expansion of the +special parameters \fI@\fP and \fI*\fP within double quotes. +.PP +The +.B unset +builtin is used to destroy arrays. \fBunset\fP \fIname\fP[\fIsubscript\fP] +destroys the array element at index \fIsubscript\fP. +Negative subscripts to indexed arrays are interpreted as described above. +Care must be taken to avoid unwanted side effects caused by pathname +expansion. +\fBunset\fP \fIname\fP, where \fIname\fP is an array, or +\fBunset\fP \fIname\fP[\fIsubscript\fP], where +\fIsubscript\fP is \fB*\fP or \fB@\fP, removes the entire array. +.PP +The +.BR declare , +.BR local , +and +.B readonly +builtins each accept a +.B \-a +option to specify an indexed array and a +.B \-A +option to specify an associative array. +If both options are supplied, +.B \-A +takes precedence. +The +.B read +builtin accepts a +.B \-a +option to assign a list of words read from the standard input +to an array. The +.B set +and +.B declare +builtins display array values in a way that allows them to be +reused as assignments. +.SH EXPANSION +Expansion is performed on the command line after it has been split into +words. There are seven kinds of expansion performed: +.IR "brace expansion" , +.IR "tilde expansion" , +.IR "parameter and variable expansion" , +.IR "command substitution" , +.IR "arithmetic expansion" , +.IR "word splitting" , +and +.IR "pathname expansion" . +.PP +The order of expansions is: +brace expansion; +tilde expansion, parameter and variable expansion, arithmetic expansion, +and command substitution (done in a left-to-right fashion); +word splitting; +and pathname expansion. +.PP +On systems that can support it, there is an additional expansion +available: \fIprocess substitution\fP. +This is performed at the +same time as tilde, parameter, variable, and arithmetic expansion and +command substitution. +.PP +Only brace expansion, word splitting, and pathname expansion +can change the number of words of the expansion; other expansions +expand a single word to a single word. +The only exceptions to this are the expansions of +"\fB$@\fP" and "\fB${\fP\fIname\fP\fB[@]}\fP" +as explained above (see +.SM +.BR PARAMETERS ). +.SS Brace Expansion +.PP +.I "Brace expansion" +is a mechanism by which arbitrary strings +may be generated. This mechanism is similar to +\fIpathname expansion\fP, but the filenames generated +need not exist. Patterns to be brace expanded take +the form of an optional +.IR preamble , +followed by either a series of comma-separated strings or +a sequence expression between a pair of braces, followed by +an optional +.IR postscript . +The preamble is prefixed to each string contained +within the braces, and the postscript is then appended +to each resulting string, expanding left to right. +.PP +Brace expansions may be nested. The results of each expanded +string are not sorted; left to right order is preserved. +For example, a\fB{\fPd,c,b\fB}\fPe expands into `ade ace abe'. +.PP +A sequence expression takes the form +\fB{\fP\fIx\fP\fB..\fP\fIy\fP\fB[..\fP\fIincr\fP\fB]}\fP, +where \fIx\fP and \fIy\fP are either integers or single characters, +and \fIincr\fP, an optional increment, is an integer. +When integers are supplied, the expression expands to each number between +\fIx\fP and \fIy\fP, inclusive. +Supplied integers may be prefixed with \fI0\fP to force each term to have the +same width. +When either \fIx\fP or \fPy\fP begins with a zero, the shell +attempts to force all generated terms to contain the same number of digits, +zero-padding where necessary. +When characters are supplied, the expression expands to each character +lexicographically between \fIx\fP and \fIy\fP, inclusive, +using the default C locale. +Note that both \fIx\fP and \fIy\fP must be of the same type. +When the increment is supplied, it is used as the difference between +each term. The default increment is 1 or -1 as appropriate. +.PP +Brace expansion is performed before any other expansions, +and any characters special to other expansions are preserved +in the result. It is strictly textual. +.B Bash +does not apply any syntactic interpretation to the context of the +expansion or the text between the braces. +.PP +A correctly-formed brace expansion must contain unquoted opening +and closing braces, and at least one unquoted comma or a valid +sequence expression. +Any incorrectly formed brace expansion is left unchanged. +A \fB{\fP or \fB,\fP may be quoted with a backslash to prevent its +being considered part of a brace expression. +To avoid conflicts with parameter expansion, the string \fB${\fP +is not considered eligible for brace expansion. +.PP +This construct is typically used as shorthand when the common +prefix of the strings to be generated is longer than in the +above example: +.RS +.PP +mkdir /usr/local/src/bash/{old,new,dist,bugs} +.RE +or +.RS +chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} +.RE +.PP +Brace expansion introduces a slight incompatibility with +historical versions of +.BR sh . +.B sh +does not treat opening or closing braces specially when they +appear as part of a word, and preserves them in the output. +.B Bash +removes braces from words as a consequence of brace +expansion. For example, a word entered to +.B sh +as \fIfile{1,2}\fP +appears identically in the output. The same word is +output as +.I file1 file2 +after expansion by +.BR bash . +If strict compatibility with +.B sh +is desired, start +.B bash +with the +.B +B +option or disable brace expansion with the +.B +B +option to the +.B set +command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SS Tilde Expansion +.PP +If a word begins with an unquoted tilde character (`\fB~\fP'), all of +the characters preceding the first unquoted slash (or all characters, +if there is no unquoted slash) are considered a \fItilde-prefix\fP. +If none of the characters in the tilde-prefix are quoted, the +characters in the tilde-prefix following the tilde are treated as a +possible \fIlogin name\fP. +If this login name is the null string, the tilde is replaced with the +value of the shell parameter +.SM +.BR HOME . +If +.SM +.B HOME +is unset, the home directory of the user executing the shell is +substituted instead. +Otherwise, the tilde-prefix is replaced with the home directory +associated with the specified login name. +.PP +If the tilde-prefix is a `~+', the value of the shell variable +.SM +.B PWD +replaces the tilde-prefix. +If the tilde-prefix is a `~\-', the value of the shell variable +.SM +.BR OLDPWD , +if it is set, is substituted. +If the characters following the tilde in the tilde-prefix consist +of a number \fIN\fP, optionally prefixed +by a `+' or a `\-', the tilde-prefix is replaced with the corresponding +element from the directory stack, as it would be displayed by the +.B dirs +builtin invoked with the tilde-prefix as an argument. +If the characters following the tilde in the tilde-prefix consist of a +number without a leading `+' or `\-', `+' is assumed. +.PP +If the login name is invalid, or the tilde expansion fails, the word +is unchanged. +.PP +Each variable assignment is checked for unquoted tilde-prefixes immediately +following a +.B : +or the first +.BR = . +In these cases, tilde expansion is also performed. +Consequently, one may use filenames with tildes in assignments to +.SM +.BR PATH , +.SM +.BR MAILPATH , +and +.SM +.BR CDPATH , +and the shell assigns the expanded value. +.SS Parameter Expansion +.PP +The `\fB$\fP' character introduces parameter expansion, +command substitution, or arithmetic expansion. The parameter name +or symbol to be expanded may be enclosed in braces, which +are optional but serve to protect the variable to be expanded from +characters immediately following it which could be +interpreted as part of the name. +.PP +When braces are used, the matching ending brace is the first `\fB}\fP' +not escaped by a backslash or within a quoted string, and not within an +embedded arithmetic expansion, command substitution, or parameter +expansion. +.PP +.PD 0 +.TP +${\fIparameter\fP} +The value of \fIparameter\fP is substituted. The braces are required +when +.I parameter +is a positional parameter with more than one digit, +or when +.I parameter +is followed by a character which is not to be +interpreted as part of its name. +The \fIparameter\fP is a shell parameter as described above +\fBPARAMETERS\fP) or an array reference (\fBArrays\fP). +.PD +.PP +If the first character of \fIparameter\fP is an exclamation point (\fB!\fP), +it introduces a level of variable indirection. +\fBBash\fP uses the value of the variable formed from the rest of +\fIparameter\fP as the name of the variable; this variable is then +expanded and that value is used in the rest of the substitution, rather +than the value of \fIparameter\fP itself. +This is known as \fIindirect expansion\fP. +The exceptions to this are the expansions of ${\fB!\fP\fIprefix\fP\fB*\fP} and +${\fB!\fP\fIname\fP[\fI@\fP]} described below. +The exclamation point must immediately follow the left brace in order to +introduce indirection. +.PP +In each of the cases below, \fIword\fP is subject to tilde expansion, +parameter expansion, command substitution, and arithmetic expansion. +.PP +When not performing substring expansion, using the forms documented below +(e.g., \fB:-\fP), +\fBbash\fP tests for a parameter that is unset or null. Omitting the colon +results in a test only for a parameter that is unset. +.PP +.PD 0 +.TP +${\fIparameter\fP\fB:\-\fP\fIword\fP} +\fBUse Default Values\fP. If +.I parameter +is unset or null, the expansion of +.I word +is substituted. Otherwise, the value of +.I parameter +is substituted. +.TP +${\fIparameter\fP\fB:=\fP\fIword\fP} +\fBAssign Default Values\fP. +If +.I parameter +is unset or null, the expansion of +.I word +is assigned to +.IR parameter . +The value of +.I parameter +is then substituted. Positional parameters and special parameters may +not be assigned to in this way. +.TP +${\fIparameter\fP\fB:?\fP\fIword\fP} +\fBDisplay Error if Null or Unset\fP. +If +.I parameter +is null or unset, the expansion of \fIword\fP (or a message to that effect +if +.I word +is not present) is written to the standard error and the shell, if it +is not interactive, exits. Otherwise, the value of \fIparameter\fP is +substituted. +.TP +${\fIparameter\fP\fB:+\fP\fIword\fP} +\fBUse Alternate Value\fP. +If +.I parameter +is null or unset, nothing is substituted, otherwise the expansion of +.I word +is substituted. +.TP +${\fIparameter\fP\fB:\fP\fIoffset\fP} +.PD 0 +.TP +${\fIparameter\fP\fB:\fP\fIoffset\fP\fB:\fP\fIlength\fP} +.PD +\fBSubstring Expansion\fP. +Expands to up to \fIlength\fP characters of the value of \fIparameter\fP +starting at the character specified by \fIoffset\fP. +If \fIparameter\fP is \fB@\fP, an indexed array subscripted by +\fB@\fP or \fB*\fP, or an associative array name, the results differ as +described below. +If \fIlength\fP is omitted, expands to the substring of the value of +\fIparameter\fP starting at the character specified by \fIoffset\fP +and extending to the end of the value. +\fIlength\fP and \fIoffset\fP are arithmetic expressions (see +.SM +.B +ARITHMETIC EVALUATION +below). +.sp 1 +If \fIoffset\fP evaluates to a number less than zero, the value +is used as an offset in characters +from the end of the value of \fIparameter\fP. +If \fIlength\fP evaluates to a number less than zero, +it is interpreted as an offset in characters +from the end of the value of \fIparameter\fP rather than +a number of characters, and the expansion is the characters between +\fIoffset\fP and that result. +Note that a negative offset must be separated from the colon by at least +one space to avoid being confused with the \fB:-\fP expansion. +.sp 1 +If \fIparameter\fP is \fB@\fP, the result is \fIlength\fP positional +parameters beginning at \fIoffset\fP. +A negative \fIoffset\fP is taken relative to one greater than the greatest +positional parameter, so an offset of -1 evaluates to the last positional +parameter. +It is an expansion error if \fIlength\fP evaluates to a number less than +zero. +.sp 1 +If \fIparameter\fP is an indexed array name subscripted by @ or *, +the result is the \fIlength\fP +members of the array beginning with ${\fIparameter\fP[\fIoffset\fP]}. +A negative \fIoffset\fP is taken relative to one greater than the maximum +index of the specified array. +It is an expansion error if \fIlength\fP evaluates to a number less than +zero. +.sp 1 +Substring expansion applied to an associative array produces undefined +results. +.sp 1 +Substring indexing is zero-based unless the positional parameters +are used, in which case the indexing starts at 1 by default. +If \fIoffset\fP is 0, and the positional parameters are used, \fB$0\fP is +prefixed to the list. +.TP +${\fB!\fP\fIprefix\fP\fB*\fP} +.PD 0 +.TP +${\fB!\fP\fIprefix\fP\fB@\fP} +.PD +\fBNames matching prefix\fP. +Expands to the names of variables whose names begin with \fIprefix\fP, +separated by the first character of the +.SM +.B IFS +special variable. +When \fI@\fP is used and the expansion appears within double quotes, each +variable name expands to a separate word. +.TP +${\fB!\fP\fIname\fP[\fI@\fP]} +.PD 0 +.TP +${\fB!\fP\fIname\fP[\fI*\fP]} +.PD +\fBList of array keys\fP. +If \fIname\fP is an array variable, expands to the list of array indices +(keys) assigned in \fIname\fP. +If \fIname\fP is not an array, expands to 0 if \fIname\fP is set and null +otherwise. +When \fI@\fP is used and the expansion appears within double quotes, each +key expands to a separate word. +.TP +${\fB#\fP\fIparameter\fP} +\fBParameter length\fP. +The length in characters of the value of \fIparameter\fP is substituted. +If +.I parameter +is +.B * +or +.BR @ , +the value substituted is the number of positional parameters. +If +.I parameter +is an array name subscripted by +.B * +or +.BR @ , +the value substituted is the number of elements in the array. +If +.I parameter +is an indexed array name subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +\fIparameter\fP, so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.TP +${\fIparameter\fP\fB#\fP\fIword\fP} +.PD 0 +.TP +${\fIparameter\fP\fB##\fP\fIword\fP} +.PD +\fBRemove matching prefix pattern\fP. +The +.I word +is expanded to produce a pattern just as in pathname +expansion. If the pattern matches the beginning of +the value of +.IR parameter , +then the result of the expansion is the expanded value of +.I parameter +with the shortest matching pattern (the ``\fB#\fP'' case) or the +longest matching pattern (the ``\fB##\fP'' case) deleted. +If +.I parameter +is +.B @ +or +.BR * , +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB%\fP\fIword\fP} +.PD 0 +.TP +${\fIparameter\fP\fB%%\fP\fIword\fP} +.PD +\fBRemove matching suffix pattern\fP. +The \fIword\fP is expanded to produce a pattern just as in +pathname expansion. +If the pattern matches a trailing portion of the expanded value of +.IR parameter , +then the result of the expansion is the expanded value of +.I parameter +with the shortest matching pattern (the ``\fB%\fP'' case) or the +longest matching pattern (the ``\fB%%\fP'' case) deleted. +If +.I parameter +is +.B @ +or +.BR * , +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB/\fP\fIpattern\fP\fB/\fP\fIstring\fP} +\fBPattern substitution\fP. +The \fIpattern\fP is expanded to produce a pattern just as in +pathname expansion. +\fIParameter\fP is expanded and the longest match of \fIpattern\fP +against its value is replaced with \fIstring\fP. +If \fIpattern\fP begins with \fB/\fP, all matches of \fIpattern\fP are +replaced with \fIstring\fP. Normally only the first match is replaced. +If \fIpattern\fP begins with \fB#\fP, it must match at the beginning +of the expanded value of \fIparameter\fP. +If \fIpattern\fP begins with \fB%\fP, it must match at the end +of the expanded value of \fIparameter\fP. +If \fIstring\fP is null, matches of \fIpattern\fP are deleted +and the \fB/\fP following \fIpattern\fP may be omitted. +If +.I parameter +is +.B @ +or +.BR * , +the substitution operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the substitution operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB^\fP\fIpattern\fP} +.PD 0 +.TP +${\fIparameter\fP\fB^^\fP\fIpattern\fP} +.TP +${\fIparameter\fP\fB,\fP\fIpattern\fP} +.TP +${\fIparameter\fP\fB,,\fP\fIpattern\fP} +.PD +\fBCase modification\fP. +This expansion modifies the case of alphabetic characters in \fIparameter\fP. +The \fIpattern\fP is expanded to produce a pattern just as in +pathname expansion. +Each character in the expanded value of \fIparameter\fP is tested against +\fIpattern\fP, and, if it matches the pattern, its case is converted. +The pattern should not attempt to match more than one character. +The \fB^\fP operator converts lowercase letters matching \fIpattern\fP +to uppercase; the \fB,\fP operator converts matching uppercase letters +to lowercase. +The \fB^^\fP and \fB,,\fP expansions convert each matched character in the +expanded value; the \fB^\fP and \fB,\fP expansions match and convert only +the first character in the expanded value. +If \fIpattern\fP is omitted, it is treated like a \fB?\fP, which matches +every character. +If +.I parameter +is +.B @ +or +.BR * , +the case modification operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the case modification operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.SS Command Substitution +.PP +\fICommand substitution\fP allows the output of a command to replace +the command name. There are two forms: +.RS +.PP +\fB$(\fP\fIcommand\fP\|\fB)\fP +.RE +or +.RS +\fB\`\fP\fIcommand\fP\fB\`\fP +.RE +.PP +.B Bash +performs the expansion by executing \fIcommand\fP and +replacing the command substitution with the standard output of the +command, with any trailing newlines deleted. +Embedded newlines are not deleted, but they may be removed during +word splitting. +The command substitution \fB$(cat \fIfile\fP)\fR can be replaced by +the equivalent but faster \fB$(< \fIfile\fP)\fR. +.PP +When the old-style backquote form of substitution is used, +backslash retains its literal meaning except when followed by +.BR $ , +.BR \` , +or +.BR \e . +The first backquote not preceded by a backslash terminates the +command substitution. +When using the $(\^\fIcommand\fP\|) form, all characters between the +parentheses make up the command; none are treated specially. +.PP +Command substitutions may be nested. To nest when using the backquoted form, +escape the inner backquotes with backslashes. +.PP +If the substitution appears within double quotes, word splitting and +pathname expansion are not performed on the results. +.SS Arithmetic Expansion +.PP +Arithmetic expansion allows the evaluation of an arithmetic expression +and the substitution of the result. The format for arithmetic expansion is: +.RS +.PP +\fB$((\fP\fIexpression\fP\fB))\fP +.RE +.PP +The old format \fB$[\fP\fIexpression\fP\fB]\fP is deprecated and will +be removed in upcoming versions of bash. +.PP +The +.I expression +is treated as if it were within double quotes, but a double quote +inside the parentheses is not treated specially. +All tokens in the expression undergo parameter and variable expansion, +command substitution, and quote removal. +The result is treated as the arithmetic expression to be evaluated. +Arithmetic expansions may be nested. +.PP +The evaluation is performed according to the rules listed below under +.SM +.BR "ARITHMETIC EVALUATION" . +If +.I expression +is invalid, +.B bash +prints a message indicating failure and no substitution occurs. +.SS Process Substitution +.PP +\fIProcess substitution\fP is supported on systems that support named +pipes (\fIFIFOs\fP) or the \fB/dev/fd\fP method of naming open files. +It takes the form of +\fB<(\fP\fIlist\^\fP\fB)\fP +or +\fB>(\fP\fIlist\^\fP\fB)\fP. +The process \fIlist\fP is run with its input or output connected to a +\fIFIFO\fP or some file in \fB/dev/fd\fP. The name of this file is +passed as an argument to the current command as the result of the +expansion. If the \fB>(\fP\fIlist\^\fP\fB)\fP form is used, writing to +the file will provide input for \fIlist\fP. If the +\fB<(\fP\fIlist\^\fP\fB)\fP form is used, the file passed as an +argument should be read to obtain the output of \fIlist\fP. +.PP +When available, process substitution is performed +simultaneously with parameter and variable expansion, +command substitution, +and arithmetic expansion. +.SS Word Splitting +.PP +The shell scans the results of +parameter expansion, +command substitution, +and +arithmetic expansion +that did not occur within double quotes for +.IR "word splitting" . +.PP +The shell treats each character of +.SM +.B IFS +as a delimiter, and splits the results of the other +expansions into words using these characters as field terminators. +If +.SM +.B IFS +is unset, or its +value is exactly +.BR , +the default, then +sequences of +.BR , +.BR , +and +.B +at the beginning and end of the results of the previous +expansions are ignored, and +any sequence of +.SM +.B IFS +characters not at the beginning or end serves to delimit words. +If +.SM +.B IFS +has a value other than the default, then sequences of +the whitespace characters +.B space +and +.B tab +are ignored at the beginning and end of the +word, as long as the whitespace character is in the +value of +.SM +.BR IFS +(an +.SM +.B IFS +whitespace character). +Any character in +.SM +.B IFS +that is not +.SM +.B IFS +whitespace, along with any adjacent +.SM +.B IFS +whitespace characters, delimits a field. +A sequence of +.SM +.B IFS +whitespace characters is also treated as a delimiter. +If the value of +.SM +.B IFS +is null, no word splitting occurs. +.PP +Explicit null arguments (\^\f3"\^"\fP or \^\f3\(aq\^\(aq\fP\^) are retained. +Unquoted implicit null arguments, resulting from the expansion of +parameters that have no values, are removed. +If a parameter with no value is expanded within double quotes, a +null argument results and is retained. +.PP +Note that if no expansion occurs, no splitting +is performed. +.SS Pathname Expansion +.PP +After word splitting, +unless the +.B \-f +option has been set, +.B bash +scans each word for the characters +.BR * , +.BR ? , +and +.BR [ . +If one of these characters appears, then the word is +regarded as a +.IR pattern , +and replaced with an alphabetically sorted list of +filenames matching the pattern +(see +.SM +.B "Pattern Matching" +below). +If no matching filenames are found, +and the shell option +.B nullglob +is not enabled, the word is left unchanged. +If the +.B nullglob +option is set, and no matches are found, +the word is removed. +If the +.B failglob +shell option is set, and no matches are found, an error message +is printed and the command is not executed. +If the shell option +.B nocaseglob +is enabled, the match is performed without regard to the case +of alphabetic characters. +When a pattern is used for pathname expansion, +the character +.B ``.'' +at the start of a name or immediately following a slash +must be matched explicitly, unless the shell option +.B dotglob +is set. +When matching a pathname, the slash character must always be +matched explicitly. +In other cases, the +.B ``.'' +character is not treated specially. +See the description of +.B shopt +below under +.SM +.B SHELL BUILTIN COMMANDS +for a description of the +.BR nocaseglob , +.BR nullglob , +.BR failglob , +and +.B dotglob +shell options. +.PP +The +.SM +.B GLOBIGNORE +shell variable may be used to restrict the set of filenames matching a +.IR pattern . +If +.SM +.B GLOBIGNORE +is set, each matching filename that also matches one of the patterns in +.SM +.B GLOBIGNORE +is removed from the list of matches. +The filenames +.B ``.'' +and +.B ``..'' +are always ignored when +.SM +.B GLOBIGNORE +is set and not null. However, setting +.SM +.B GLOBIGNORE +to a non-null value has the effect of enabling the +.B dotglob +shell option, so all other filenames beginning with a +.B ``.'' +will match. +To get the old behavior of ignoring filenames beginning with a +.BR ``.'' , +make +.B ``.*'' +one of the patterns in +.SM +.BR GLOBIGNORE . +The +.B dotglob +option is disabled when +.SM +.B GLOBIGNORE +is unset. +.PP +\fBPattern Matching\fP +.PP +Any character that appears in a pattern, other than the special pattern +characters described below, matches itself. The NUL character may not +occur in a pattern. A backslash escapes the following character; the +escaping backslash is discarded when matching. +The special pattern characters must be quoted if +they are to be matched literally. +.PP +The special pattern characters have the following meanings: +.PP +.PD 0 +.RS +.TP +.B * +Matches any string, including the null string. +When the \fBglobstar\fP shell option is enabled, and \fB*\fP is used in +a pathname expansion context, two adjacent \fB*\fPs used as a single +pattern will match all files and zero or more directories and +subdirectories. +If followed by a \fB/\fP, two adjacent \fB*\fPs will match only directories +and subdirectories. +.TP +.B ? +Matches any single character. +.TP +.B [...] +Matches any one of the enclosed characters. A pair of characters +separated by a hyphen denotes a +\fIrange expression\fP; +any character that falls between those two characters, inclusive, +using the current locale's collating sequence and character set, +is matched. If the first character following the +.B [ +is a +.B ! +or a +.B ^ +then any character not enclosed is matched. +The sorting order of characters in range expressions is determined by +the current locale and the values of the +.SM +.B LC_COLLATE +or +.SM +.B LC_ALL +shell variables, if set. +To obtain the traditional interpretation of range expressions, where +.B [a\-d] +is equivalent to +.BR [abcd] , +set value of the +.B LC_ALL +shell variable to +.BR C , +or enable the +.B globasciiranges +shell option. +A +.B \- +may be matched by including it as the first or last character +in the set. +A +.B ] +may be matched by including it as the first character +in the set. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +\fIcharacter classes\fP can be specified using the syntax +\fB[:\fP\fIclass\fP\fB:]\fP, where \fIclass\fP is one of the +following classes defined in the POSIX standard: +.PP +.RS +.B +.if n alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit +.if t alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit +.br +A character class matches any character belonging to that class. +The \fBword\fP character class matches letters, digits, and the character _. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +an \fIequivalence class\fP can be specified using the syntax +\fB[=\fP\fIc\fP\fB=]\fP, which matches all characters with the +same collation weight (as defined by the current locale) as +the character \fIc\fP. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +the syntax \fB[.\fP\fIsymbol\fP\fB.]\fP matches the collating symbol +\fIsymbol\fP. +.RE +.RE +.PD +.PP +If the \fBextglob\fP shell option is enabled using the \fBshopt\fP +builtin, several extended pattern matching operators are recognized. +In the following description, a \fIpattern-list\fP is a list of one +or more patterns separated by a \fB|\fP. +Composite patterns may be formed using one or more of the following +sub-patterns: +.sp 1 +.PD 0 +.RS +.TP +\fB?(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches zero or one occurrence of the given patterns +.TP +\fB*(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches zero or more occurrences of the given patterns +.TP +\fB+(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches one or more occurrences of the given patterns +.TP +\fB@(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches one of the given patterns +.TP +\fB!(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches anything except one of the given patterns +.RE +.PD +.SS Quote Removal +.PP +After the preceding expansions, all unquoted occurrences of the +characters +.BR \e , +.BR \(aq , +and \^\f3"\fP\^ that did not result from one of the above +expansions are removed. +.SH REDIRECTION +Before a command is executed, its input and output +may be +.I redirected +using a special notation interpreted by the shell. +Redirection allows commands' file handles to be +duplicated, opened, closed, +made to refer to different files, +and can change the files the command reads from and writes to. +Redirection may also be used to modify file handles in the +current shell execution environment. +The following redirection +operators may precede or appear anywhere within a +.I simple command +or may follow a +.IR command . +Redirections are processed in the order they appear, from +left to right. +.PP +Each redirection that may be preceded by a file descriptor number +may instead be preceded by a word of the form {\fIvarname\fP}. +In this case, for each redirection operator except +>&- and <&-, the shell will allocate a file descriptor greater +than or equal to 10 and assign it to \fIvarname\fP. +If >&- or <&- is preceded +by {\fIvarname\fP}, the value of \fIvarname\fP defines the file +descriptor to close. +.PP +In the following descriptions, if the file descriptor number is +omitted, and the first character of the redirection operator is +.BR < , +the redirection refers to the standard input (file descriptor +0). If the first character of the redirection operator is +.BR > , +the redirection refers to the standard output (file descriptor +1). +.PP +The word following the redirection operator in the following +descriptions, unless otherwise noted, is subjected to +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, quote removal, +pathname expansion, and word splitting. +If it expands to more than one word, +.B bash +reports an error. +.PP +Note that the order of redirections is significant. For example, +the command +.RS +.PP +ls \fB>\fP dirlist 2\fB>&\fP1 +.RE +.PP +directs both standard output and standard error to the file +.IR dirlist , +while the command +.RS +.PP +ls 2\fB>&\fP1 \fB>\fP dirlist +.RE +.PP +directs only the standard output to file +.IR dirlist , +because the standard error was duplicated from the standard output +before the standard output was redirected to +.IR dirlist . +.PP +\fBBash\fP handles several filenames specially when they are used in +redirections, as described in the following table: +.RS +.PP +.PD 0 +.TP +.B /dev/fd/\fIfd\fP +If \fIfd\fP is a valid integer, file descriptor \fIfd\fP is duplicated. +.TP +.B /dev/stdin +File descriptor 0 is duplicated. +.TP +.B /dev/stdout +File descriptor 1 is duplicated. +.TP +.B /dev/stderr +File descriptor 2 is duplicated. +.TP +.B /dev/tcp/\fIhost\fP/\fIport\fP +If \fIhost\fP is a valid hostname or Internet address, and \fIport\fP +is an integer port number or service name, \fBbash\fP attempts to open +the corresponding TCP socket. +.TP +.B /dev/udp/\fIhost\fP/\fIport\fP +If \fIhost\fP is a valid hostname or Internet address, and \fIport\fP +is an integer port number or service name, \fBbash\fP attempts to open +the corresponding UDP socket. +.PD +.RE +.PP +A failure to open or create a file causes the redirection to fail. +.PP +Redirections using file descriptors greater than 9 should be used with +care, as they may conflict with file descriptors the shell uses +internally. +.SS Redirecting Input +.PP +Redirection of input causes the file whose name results from +the expansion of +.I word +to be opened for reading on file descriptor +.IR n , +or the standard input (file descriptor 0) if +.I n +is not specified. +.PP +The general format for redirecting input is: +.RS +.PP +[\fIn\fP]\fB<\fP\fIword\fP +.RE +.SS Redirecting Output +.PP +Redirection of output causes the file whose name results from +the expansion of +.I word +to be opened for writing on file descriptor +.IR n , +or the standard output (file descriptor 1) if +.I n +is not specified. If the file does not exist it is created; +if it does exist it is truncated to zero size. +.PP +The general format for redirecting output is: +.RS +.PP +[\fIn\fP]\fB>\fP\fIword\fP +.RE +.PP +If the redirection operator is +.BR > , +and the +.B noclobber +option to the +.B set +builtin has been enabled, the redirection will fail if the file +whose name results from the expansion of \fIword\fP exists and is +a regular file. +If the redirection operator is +.BR >| , +or the redirection operator is +.B > +and the +.B noclobber +option to the +.B set +builtin command is not enabled, the redirection is attempted even +if the file named by \fIword\fP exists. +.SS Appending Redirected Output +.PP +Redirection of output in this fashion +causes the file whose name results from +the expansion of +.I word +to be opened for appending on file descriptor +.IR n , +or the standard output (file descriptor 1) if +.I n +is not specified. If the file does not exist it is created. +.PP +The general format for appending output is: +.RS +.PP +[\fIn\fP]\fB>>\fP\fIword\fP +.RE +.PP +.SS Redirecting Standard Output and Standard Error +.PP +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be redirected to the file whose name is the +expansion of +.IR word . +.PP +There are two formats for redirecting standard output and +standard error: +.RS +.PP +\fB&>\fP\fIword\fP +.RE +and +.RS +\fB>&\fP\fIword\fP +.RE +.PP +Of the two forms, the first is preferred. +This is semantically equivalent to +.RS +.PP +\fB>\fP\fIword\fP 2\fB>&\fP1 +.RE +.PP +When using the second form, \fIword\fP may not expand to a number or +\fB\-\fP. If it does, other redirection operators apply +(see \fBDuplicating File Descriptors\fP below) for compatibility +reasons. +.SS Appending Standard Output and Standard Error +.PP +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be appended to the file whose name is the +expansion of +.IR word . +.PP +The format for appending standard output and standard error is: +.RS +.PP +\fB&>>\fP\fIword\fP +.RE +.PP +This is semantically equivalent to +.RS +.PP +\fB>>\fP\fIword\fP 2\fB>&\fP1 +.RE +.PP +(see \fBDuplicating File Descriptors\fP below). +.SS Here Documents +.PP +This type of redirection instructs the shell to read input from the +current source until a line containing only +.I delimiter +(with no trailing blanks) +is seen. All of +the lines read up to that point are then used as the standard +input for a command. +.PP +The format of here-documents is: +.RS +.PP +.nf +\fB<<\fP[\fB\-\fP]\fIword\fP + \fIhere-document\fP +\fIdelimiter\fP +.fi +.RE +.PP +No parameter and variable expansion, command substitution, +arithmetic expansion, or pathname expansion is performed on +.IR word . +If any characters in +.I word +are quoted, the +.I delimiter +is the result of quote removal on +.IR word , +and the lines in the here-document are not expanded. +If \fIword\fP is unquoted, +all lines of the here-document are subjected to +parameter expansion, command substitution, and arithmetic expansion, +the character sequence +.B \e +is ignored, and +.B \e +must be used to quote the characters +.BR \e , +.BR $ , +and +.BR \` . +.PP +If the redirection operator is +.BR <<\- , +then all leading tab characters are stripped from input lines and the +line containing +.IR delimiter . +This allows +here-documents within shell scripts to be indented in a +natural fashion. +.SS "Here Strings" +A variant of here documents, the format is: +.RS +.PP +.nf +\fB<<<\fP\fIword\fP +.fi +.RE +.PP +The \fIword\fP undergoes +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote removal. +Pathname expansion and word splitting are not performed. +The result is supplied as a single string to the command on its +standard input. +.SS "Duplicating File Descriptors" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<&\fP\fIword\fP +.RE +.PP +is used to duplicate input file descriptors. +If +.I word +expands to one or more digits, the file descriptor denoted by +.I n +is made to be a copy of that file descriptor. +If the digits in +.I word +do not specify a file descriptor open for input, a redirection error occurs. +If +.I word +evaluates to +.BR \- , +file descriptor +.I n +is closed. If +.I n +is not specified, the standard input (file descriptor 0) is used. +.PP +The operator +.RS +.PP +[\fIn\fP]\fB>&\fP\fIword\fP +.RE +.PP +is used similarly to duplicate output file descriptors. If +.I n +is not specified, the standard output (file descriptor 1) is used. +If the digits in +.I word +do not specify a file descriptor open for output, a redirection error occurs. +If +.I word +evaluates to +.BR \- , +file descriptor +.I n +is closed. +As a special case, if \fIn\fP is omitted, and \fIword\fP does not +expand to one or more digits or \fB\-\fP, the standard output and standard +error are redirected as described previously. +.SS "Moving File Descriptors" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<&\fP\fIdigit\fP\fB\-\fP +.RE +.PP +moves the file descriptor \fIdigit\fP to file descriptor +.IR n , +or the standard input (file descriptor 0) if \fIn\fP is not specified. +\fIdigit\fP is closed after being duplicated to \fIn\fP. +.PP +Similarly, the redirection operator +.RS +.PP +[\fIn\fP]\fB>&\fP\fIdigit\fP\fB\-\fP +.RE +.PP +moves the file descriptor \fIdigit\fP to file descriptor +.IR n , +or the standard output (file descriptor 1) if \fIn\fP is not specified. +.SS "Opening File Descriptors for Reading and Writing" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<>\fP\fIword\fP +.RE +.PP +causes the file whose name is the expansion of +.I word +to be opened for both reading and writing on file descriptor +.IR n , +or on file descriptor 0 if +.I n +is not specified. If the file does not exist, it is created. +.SH ALIASES +\fIAliases\fP allow a string to be substituted for a word when it is used +as the first word of a simple command. +The shell maintains a list of aliases that may be set and unset with the +.B alias +and +.B unalias +builtin commands (see +.SM +.B SHELL BUILTIN COMMANDS +below). +The first word of each simple command, if unquoted, +is checked to see if it has an +alias. If so, that word is replaced by the text of the alias. +The characters \fB/\fP, \fB$\fP, \fB\`\fP, and \fB=\fP and +any of the shell \fImetacharacters\fP or quoting characters +listed above may not appear in an alias name. +The replacement text may contain any valid shell input, +including shell metacharacters. +The first word of the replacement text is tested +for aliases, but a word that is identical to an alias being expanded +is not expanded a second time. +This means that one may alias +.B ls +to +.BR "ls \-F" , +for instance, and +.B bash +does not try to recursively expand the replacement text. +If the last character of the alias value is a +.IR blank , +then the next command +word following the alias is also checked for alias expansion. +.PP +Aliases are created and listed with the +.B alias +command, and removed with the +.B unalias +command. +.PP +There is no mechanism for using arguments in the replacement text. +If arguments are needed, a shell function should be used (see +.SM +.B FUNCTIONS +below). +.PP +Aliases are not expanded when the shell is not interactive, unless +the +.B expand_aliases +shell option is set using +.B shopt +(see the description of +.B shopt +under +.SM +\fBSHELL BUILTIN COMMANDS\fP +below). +.PP +The rules concerning the definition and use of aliases are +somewhat confusing. +.B Bash +always reads at least one complete line +of input before executing any +of the commands on that line. Aliases are expanded when a +command is read, not when it is executed. Therefore, an +alias definition appearing on the same line as another +command does not take effect until the next line of input is read. +The commands following the alias definition +on that line are not affected by the new alias. +This behavior is also an issue when functions are executed. +Aliases are expanded when a function definition is read, +not when the function is executed, because a function definition +is itself a compound command. As a consequence, aliases +defined in a function are not available until after that +function is executed. To be safe, always put +alias definitions on a separate line, and do not use +.B alias +in compound commands. +.PP +For almost every purpose, aliases are superseded by +shell functions. +.SH FUNCTIONS +A shell function, defined as described above under +.SM +.BR "SHELL GRAMMAR" , +stores a series of commands for later execution. +When the name of a shell function is used as a simple command name, +the list of commands associated with that function name is executed. +Functions are executed in the context of the +current shell; no new process is created to interpret +them (contrast this with the execution of a shell script). +When a function is executed, the arguments to the +function become the positional parameters +during its execution. +The special parameter +.B # +is updated to reflect the change. Special parameter \fB0\fP +is unchanged. +The first element of the +.SM +.B FUNCNAME +variable is set to the name of the function while the function +is executing. +.PP +All other aspects of the shell execution +environment are identical between a function and its caller +with these exceptions: the +.SM +.B DEBUG +and +.B RETURN +traps (see the description of the +.B trap +builtin under +.SM +.B SHELL BUILTIN COMMANDS +below) are not inherited unless the function has been given the +\fBtrace\fP attribute (see the description of the +.SM +.B declare +builtin below) or the +\fB\-o functrace\fP shell option has been enabled with +the \fBset\fP builtin +(in which case all functions inherit the \fBDEBUG\fP and \fBRETURN\fP traps), +and the +.SM +.B ERR +trap is not inherited unless the \fB\-o errtrace\fP shell option has +been enabled. +.PP +Variables local to the function may be declared with the +.B local +builtin command. Ordinarily, variables and their values +are shared between the function and its caller. +.PP +The \fBFUNCNEST\fP variable, if set to a numeric value greater +than 0, defines a maximum function nesting level. Function +invocations that exceed the limit cause the entire command to +abort. +.PP +If the builtin command +.B return +is executed in a function, the function completes and +execution resumes with the next command after the function +call. +Any command associated with the \fBRETURN\fP trap is executed +before execution resumes. +When a function completes, the values of the +positional parameters and the special parameter +.B # +are restored to the values they had prior to the function's +execution. +.PP +Function names and definitions may be listed with the +.B \-f +option to the +.B declare +or +.B typeset +builtin commands. The +.B \-F +option to +.B declare +or +.B typeset +will list the function names only +(and optionally the source file and line number, if the \fBextdebug\fP +shell option is enabled). +Functions may be exported so that subshells +automatically have them defined with the +.B \-f +option to the +.B export +builtin. +A function definition may be deleted using the \fB\-f\fP option to +the +.B unset +builtin. +Note that shell functions and variables with the same name may result +in multiple identically-named entries in the environment passed to the +shell's children. +Care should be taken in cases where this may cause a problem. +.PP +Functions may be recursive. +The \fBFUNCNEST\fP variable may be used to limit the depth of the +function call stack and restrict the number of function invocations. +By default, no limit is imposed on the number of recursive calls. +.SH "ARITHMETIC EVALUATION" +The shell allows arithmetic expressions to be evaluated, under +certain circumstances (see the \fBlet\fP and \fBdeclare\fP builtin +commands and \fBArithmetic Expansion\fP). +Evaluation is done in fixed-width integers with no check for overflow, +though division by 0 is trapped and flagged as an error. +The operators and their precedence, associativity, and values +are the same as in the C language. +The following list of operators is grouped into levels of +equal-precedence operators. +The levels are listed in order of decreasing precedence. +.PP +.PD 0 +.TP +.B \fIid\fP++ \fIid\fP\-\- +variable post-increment and post-decrement +.TP +.B ++\fIid\fP \-\-\fIid\fP +variable pre-increment and pre-decrement +.TP +.B \- + +unary minus and plus +.TP +.B ! ~ +logical and bitwise negation +.TP +.B ** +exponentiation +.TP +.B * / % +multiplication, division, remainder +.TP +.B + \- +addition, subtraction +.TP +.B << >> +left and right bitwise shifts +.TP +.B <= >= < > +comparison +.TP +.B == != +equality and inequality +.TP +.B & +bitwise AND +.TP +.B ^ +bitwise exclusive OR +.TP +.B | +bitwise OR +.TP +.B && +logical AND +.TP +.B || +logical OR +.TP +.B \fIexpr\fP?\fIexpr\fP:\fIexpr\fP +conditional operator +.TP +.B = *= /= %= += \-= <<= >>= &= ^= |= +assignment +.TP +.B \fIexpr1\fP , \fIexpr2\fP +comma +.PD +.PP +Shell variables are allowed as operands; parameter expansion is +performed before the expression is evaluated. +Within an expression, shell variables may also be referenced by name +without using the parameter expansion syntax. +A shell variable that is null or unset evaluates to 0 when referenced +by name without using the parameter expansion syntax. +The value of a variable is evaluated as an arithmetic expression +when it is referenced, or when a variable which has been given the +\fIinteger\fP attribute using \fBdeclare -i\fP is assigned a value. +A null value evaluates to 0. +A shell variable need not have its \fIinteger\fP attribute +turned on to be used in an expression. +.PP +Constants with a leading 0 are interpreted as octal numbers. +A leading 0x or 0X denotes hexadecimal. +Otherwise, numbers take the form [\fIbase#\fP]n, where the optional \fIbase\fP +is a decimal number between 2 and 64 representing the arithmetic +base, and \fIn\fP is a number in that base. +If \fIbase#\fP is omitted, then base 10 is used. +When specifying \fIn\fP, +the digits greater< than 9 are represented by the lowercase letters, +the uppercase letters, @, and _, in that order. +If \fIbase\fP is less than or equal to 36, lowercase and uppercase +letters may be used interchangeably to represent numbers between 10 +and 35. +.PP +Operators are evaluated in order of precedence. Sub-expressions in +parentheses are evaluated first and may override the precedence +rules above. +.SH "CONDITIONAL EXPRESSIONS" +Conditional expressions are used by the \fB[[\fP compound command and +the \fBtest\fP and \fB[\fP builtin commands to test file attributes +and perform string and arithmetic comparisons. +Expressions are formed from the following unary or binary primaries. +If any \fIfile\fP argument to one of the primaries is of the form +\fI/dev/fd/n\fP, then file descriptor \fIn\fP is checked. +If the \fIfile\fP argument to one of the primaries is one of +\fI/dev/stdin\fP, \fI/dev/stdout\fP, or \fI/dev/stderr\fP, file +descriptor 0, 1, or 2, respectively, is checked. +.PP +Unless otherwise specified, primaries that operate on files follow symbolic +links and operate on the target of the link, rather than the link itself. +.if t .sp 0.5 +.if n .sp 1 +When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort +lexicographically using the current locale. +The \fBtest\fP command sorts using ASCII ordering. +.sp 1 +.PD 0 +.TP +.B \-a \fIfile\fP +True if \fIfile\fP exists. +.TP +.B \-b \fIfile\fP +True if \fIfile\fP exists and is a block special file. +.TP +.B \-c \fIfile\fP +True if \fIfile\fP exists and is a character special file. +.TP +.B \-d \fIfile\fP +True if \fIfile\fP exists and is a directory. +.TP +.B \-e \fIfile\fP +True if \fIfile\fP exists. +.TP +.B \-f \fIfile\fP +True if \fIfile\fP exists and is a regular file. +.TP +.B \-g \fIfile\fP +True if \fIfile\fP exists and is set-group-id. +.TP +.B \-h \fIfile\fP +True if \fIfile\fP exists and is a symbolic link. +.TP +.B \-k \fIfile\fP +True if \fIfile\fP exists and its ``sticky'' bit is set. +.TP +.B \-p \fIfile\fP +True if \fIfile\fP exists and is a named pipe (FIFO). +.TP +.B \-r \fIfile\fP +True if \fIfile\fP exists and is readable. +.TP +.B \-s \fIfile\fP +True if \fIfile\fP exists and has a size greater than zero. +.TP +.B \-t \fIfd\fP +True if file descriptor +.I fd +is open and refers to a terminal. +.TP +.B \-u \fIfile\fP +True if \fIfile\fP exists and its set-user-id bit is set. +.TP +.B \-w \fIfile\fP +True if \fIfile\fP exists and is writable. +.TP +.B \-x \fIfile\fP +True if \fIfile\fP exists and is executable. +.TP +.B \-G \fIfile\fP +True if \fIfile\fP exists and is owned by the effective group id. +.TP +.B \-L \fIfile\fP +True if \fIfile\fP exists and is a symbolic link. +.TP +.B \-N \fIfile\fP +True if \fIfile\fP exists and has been modified since it was last read. +.TP +.B \-O \fIfile\fP +True if \fIfile\fP exists and is owned by the effective user id. +.TP +.B \-S \fIfile\fP +True if \fIfile\fP exists and is a socket. +.TP +\fIfile1\fP \fB\-ef\fP \fIfile2\fP +True if \fIfile1\fP and \fIfile2\fP refer to the same device and +inode numbers. +.TP +\fIfile1\fP \-\fBnt\fP \fIfile2\fP +True if \fIfile1\fP is newer (according to modification date) than \fIfile2\fP, +or if \fIfile1\fP exists and \fPfile2\fP does not. +.TP +\fIfile1\fP \-\fBot\fP \fIfile2\fP +True if \fIfile1\fP is older than \fIfile2\fP, or if \fIfile2\fP exists +and \fIfile1\fP does not. +.TP +.B \-o \fIoptname\fP +True if the shell option +.I optname +is enabled. +See the list of options under the description of the +.B \-o +option to the +.B set +builtin below. +.TP +.B \-v \fIvarname\fP +True if the shell variable +.I varname +is set (has been assigned a value). +.TP +.B \-R \fIvarname\fP +True if the shell variable +.I varname +is set and is a name reference. +.TP +.B \-z \fIstring\fP +True if the length of \fIstring\fP is zero. +.TP +\fIstring\fP +.PD 0 +.TP +.B \-n \fIstring\fP +.PD +True if the length of +.I string +is non-zero. +.TP +\fIstring1\fP \fB==\fP \fIstring2\fP +.PD 0 +.TP +\fIstring1\fP \fB=\fP \fIstring2\fP +.PD +True if the strings are equal. \fB=\fP should be used +with the \fBtest\fP command for POSIX conformance. +When used with the \fB[[\fP command, this performs pattern matching as +described above (\fBCompound Commands\fP). +.TP +\fIstring1\fP \fB!=\fP \fIstring2\fP +True if the strings are not equal. +.TP +\fIstring1\fP \fB<\fP \fIstring2\fP +True if \fIstring1\fP sorts before \fIstring2\fP lexicographically. +.TP +\fIstring1\fP \fB>\fP \fIstring2\fP +True if \fIstring1\fP sorts after \fIstring2\fP lexicographically. +.TP +.I \fIarg1\fP \fBOP\fP \fIarg2\fP +.SM +.B OP +is one of +.BR \-eq , +.BR \-ne , +.BR \-lt , +.BR \-le , +.BR \-gt , +or +.BR \-ge . +These arithmetic binary operators return true if \fIarg1\fP +is equal to, not equal to, less than, less than or equal to, +greater than, or greater than or equal to \fIarg2\fP, respectively. +.I Arg1 +and +.I arg2 +may be positive or negative integers. +.PD +.SH "SIMPLE COMMAND EXPANSION" +When a simple command is executed, the shell performs the following +expansions, assignments, and redirections, from left to right. +.IP 1. +The words that the parser has marked as variable assignments (those +preceding the command name) and redirections are saved for later +processing. +.IP 2. +The words that are not variable assignments or redirections are +expanded. If any words remain after expansion, the first word +is taken to be the name of the command and the remaining words are +the arguments. +.IP 3. +Redirections are performed as described above under +.SM +.BR REDIRECTION . +.IP 4. +The text after the \fB=\fP in each variable assignment undergoes tilde +expansion, parameter expansion, command substitution, arithmetic expansion, +and quote removal before being assigned to the variable. +.PP +If no command name results, the variable assignments affect the current +shell environment. Otherwise, the variables are added to the environment +of the executed command and do not affect the current shell environment. +If any of the assignments attempts to assign a value to a readonly variable, +an error occurs, and the command exits with a non-zero status. +.PP +If no command name results, redirections are performed, but do not +affect the current shell environment. A redirection error causes the +command to exit with a non-zero status. +.PP +If there is a command name left after expansion, execution proceeds as +described below. Otherwise, the command exits. If one of the expansions +contained a command substitution, the exit status of the command is +the exit status of the last command substitution performed. If there +were no command substitutions, the command exits with a status of zero. +.SH "COMMAND EXECUTION" +After a command has been split into words, if it results in a +simple command and an optional list of arguments, the following +actions are taken. +.PP +If the command name contains no slashes, the shell attempts to +locate it. If there exists a shell function by that name, that +function is invoked as described above in +.SM +.BR FUNCTIONS . +If the name does not match a function, the shell searches for +it in the list of shell builtins. If a match is found, that +builtin is invoked. +.PP +If the name is neither a shell function nor a builtin, +and contains no slashes, +.B bash +searches each element of the +.SM +.B PATH +for a directory containing an executable file by that name. +.B Bash +uses a hash table to remember the full pathnames of executable +files (see +.B hash +under +.SM +.B "SHELL BUILTIN COMMANDS" +below). +A full search of the directories in +.SM +.B PATH +is performed only if the command is not found in the hash table. +If the search is unsuccessful, the shell searches for a defined shell +function named \fBcommand_not_found_handle\fP. +If that function exists, it is invoked with the original command and +the original command's arguments as its arguments, and the function's +exit status becomes the exit status of the shell. +If that function is not defined, the shell prints an error +message and returns an exit status of 127. +.PP +If the search is successful, or if the command name contains +one or more slashes, the shell executes the named program in a +separate execution environment. +Argument 0 is set to the name given, and the remaining arguments +to the command are set to the arguments given, if any. +.PP +If this execution fails because the file is not in executable +format, and the file is not a directory, it is assumed to be +a \fIshell script\fP, a file +containing shell commands. A subshell is spawned to execute +it. This subshell reinitializes itself, so +that the effect is as if a new shell had been invoked +to handle the script, with the exception that the locations of +commands remembered by the parent (see +.B hash +below under +.SM +\fBSHELL BUILTIN COMMANDS\fP) +are retained by the child. +.PP +If the program is a file beginning with +.BR #! , +the remainder of the first line specifies an interpreter +for the program. The shell executes the +specified interpreter on operating systems that do not +handle this executable format themselves. The arguments to the +interpreter consist of a single optional argument following the +interpreter name on the first line of the program, followed +by the name of the program, followed by the command +arguments, if any. +.SH COMMAND EXECUTION ENVIRONMENT +The shell has an \fIexecution environment\fP, which consists of the +following: +.IP \(bu +open files inherited by the shell at invocation, as modified by +redirections supplied to the \fBexec\fP builtin +.IP \(bu +the current working directory as set by \fBcd\fP, \fBpushd\fP, or +\fBpopd\fP, or inherited by the shell at invocation +.IP \(bu +the file creation mode mask as set by \fBumask\fP or inherited from +the shell's parent +.IP \(bu +current traps set by \fBtrap\fP +.IP \(bu +shell parameters that are set by variable assignment or with \fBset\fP +or inherited from the shell's parent in the environment +.IP \(bu +shell functions defined during execution or inherited from the shell's +parent in the environment +.IP \(bu +options enabled at invocation (either by default or with command-line +arguments) or by \fBset\fP +.IP \(bu +options enabled by \fBshopt\fP +.IP \(bu +shell aliases defined with \fBalias\fP +.IP \(bu +various process IDs, including those of background jobs, the value +of \fB$$\fP, and the value of +.SM +.B PPID +.PP +When a simple command other than a builtin or shell function +is to be executed, it +is invoked in a separate execution environment that consists of +the following. Unless otherwise noted, the values are inherited +from the shell. +.if n .sp 1 +.IP \(bu +the shell's open files, plus any modifications and additions specified +by redirections to the command +.IP \(bu +the current working directory +.IP \(bu +the file creation mode mask +.IP \(bu +shell variables and functions marked for export, along with variables +exported for the command, passed in the environment +.IP \(bu +traps caught by the shell are reset to the values inherited from the +shell's parent, and traps ignored by the shell are ignored +.PP +A command invoked in this separate environment cannot affect the +shell's execution environment. +.PP +Command substitution, commands grouped with parentheses, +and asynchronous commands are invoked in a +subshell environment that is a duplicate of the shell environment, +except that traps caught by the shell are reset to the values +that the shell inherited from its parent at invocation. Builtin +commands that are invoked as part of a pipeline are also executed in a +subshell environment. Changes made to the subshell environment +cannot affect the shell's execution environment. +.PP +Subshells spawned to execute command substitutions inherit the value of +the \fB\-e\fP option from the parent shell. When not in \fIposix\fP mode, +\fBbash\fP clears the \fB\-e\fP option in such subshells. +.PP +If a command is followed by a \fB&\fP and job control is not active, the +default standard input for the command is the empty file \fI/dev/null\fP. +Otherwise, the invoked command inherits the file descriptors of the calling +shell as modified by redirections. +.SH ENVIRONMENT +When a program is invoked it is given an array of strings +called the +.IR environment . +This is a list of +\fIname\fP\-\fIvalue\fP pairs, of the form +.IR "name\fR=\fPvalue" . +.PP +The shell provides several ways to manipulate the environment. +On invocation, the shell scans its own environment and +creates a parameter for each name found, automatically marking +it for +.I export +to child processes. Executed commands inherit the environment. +The +.B export +and +.B declare \-x +commands allow parameters and functions to be added to and +deleted from the environment. If the value of a parameter +in the environment is modified, the new value becomes part +of the environment, replacing the old. The environment +inherited by any executed command consists of the shell's +initial environment, whose values may be modified in the shell, +less any pairs removed by the +.B unset +command, plus any additions via the +.B export +and +.B declare \-x +commands. +.PP +The environment for any +.I simple command +or function may be augmented temporarily by prefixing it with +parameter assignments, as described above in +.SM +.BR PARAMETERS . +These assignment statements affect only the environment seen +by that command. +.PP +If the +.B \-k +option is set (see the +.B set +builtin command below), then +.I all +parameter assignments are placed in the environment for a command, +not just those that precede the command name. +.PP +When +.B bash +invokes an external command, the variable +.B _ +is set to the full filename of the command and passed to that +command in its environment. +.SH "EXIT STATUS" +.PP +The exit status of an executed command is the value returned by the +\fIwaitpid\fP system call or equivalent function. Exit statuses +fall between 0 and 255, though, as explained below, the shell may +use values above 125 specially. Exit statuses from shell builtins and +compound commands are also limited to this range. Under certain +circumstances, the shell will use special values to indicate specific +failure modes. +.PP +For the shell's purposes, a command which exits with a +zero exit status has succeeded. An exit status of zero +indicates success. A non-zero exit status indicates failure. +When a command terminates on a fatal signal \fIN\fP, \fBbash\fP uses +the value of 128+\fIN\fP as the exit status. +.PP +If a command is not found, the child process created to +execute it returns a status of 127. If a command is found +but is not executable, the return status is 126. +.PP +If a command fails because of an error during expansion or redirection, +the exit status is greater than zero. +.PP +Shell builtin commands return a status of 0 (\fItrue\fP) if +successful, and non-zero (\fIfalse\fP) if an error occurs +while they execute. +All builtins return an exit status of 2 to indicate incorrect usage. +.PP +\fBBash\fP itself returns the exit status of the last command +executed, unless a syntax error occurs, in which case it exits +with a non-zero value. See also the \fBexit\fP builtin +command below. +.SH SIGNALS +When \fBbash\fP is interactive, in the absence of any traps, it ignores +.SM +.B SIGTERM +(so that \fBkill 0\fP does not kill an interactive shell), +and +.SM +.B SIGINT +is caught and handled (so that the \fBwait\fP builtin is interruptible). +In all cases, \fBbash\fP ignores +.SM +.BR SIGQUIT . +If job control is in effect, +.B bash +ignores +.SM +.BR SIGTTIN , +.SM +.BR SIGTTOU , +and +.SM +.BR SIGTSTP . +.PP +Non-builtin commands run by \fBbash\fP have signal handlers +set to the values inherited by the shell from its parent. +When job control is not in effect, asynchronous commands +ignore +.SM +.B SIGINT +and +.SM +.B SIGQUIT +in addition to these inherited handlers. +Commands run as a result of command substitution ignore the +keyboard-generated job control signals +.SM +.BR SIGTTIN , +.SM +.BR SIGTTOU , +and +.SM +.BR SIGTSTP . +.PP +The shell exits by default upon receipt of a +.SM +.BR SIGHUP . +Before exiting, an interactive shell resends the +.SM +.B SIGHUP +to all jobs, running or stopped. +Stopped jobs are sent +.SM +.B SIGCONT +to ensure that they receive the +.SM +.BR SIGHUP . +To prevent the shell from +sending the signal to a particular job, it should be removed from the +jobs table with the +.B disown +builtin (see +.SM +.B "SHELL BUILTIN COMMANDS" +below) or marked +to not receive +.SM +.B SIGHUP +using +.BR "disown \-h" . +.PP +If the +.B huponexit +shell option has been set with +.BR shopt , +.B bash +sends a +.SM +.B SIGHUP +to all jobs when an interactive login shell exits. +.PP +If \fBbash\fP is waiting for a command to complete and receives a signal +for which a trap has been set, the trap will not be executed until +the command completes. +When \fBbash\fP is waiting for an asynchronous command via the \fBwait\fP +builtin, the reception of a signal for which a trap has been set will +cause the \fBwait\fP builtin to return immediately with an exit status +greater than 128, immediately after which the trap is executed. +.SH "JOB CONTROL" +.I Job control +refers to the ability to selectively stop (\fIsuspend\fP) +the execution of processes and continue (\fIresume\fP) +their execution at a later point. A user typically employs +this facility via an interactive interface supplied jointly +by the operating system kernel's terminal driver and +.BR bash . +.PP +The shell associates a +.I job +with each pipeline. It keeps a table of currently executing +jobs, which may be listed with the +.B jobs +command. When +.B bash +starts a job asynchronously (in the +.IR background ), +it prints a line that looks like: +.RS +.PP +[1] 25647 +.RE +.PP +indicating that this job is job number 1 and that the process ID +of the last process in the pipeline associated with this job is 25647. +All of the processes in a single pipeline are members of the same job. +.B Bash +uses the +.I job +abstraction as the basis for job control. +.PP +To facilitate the implementation of the user interface to job +control, the operating system maintains the notion of a \fIcurrent terminal +process group ID\fP. Members of this process group (processes whose +process group ID is equal to the current terminal process group ID) +receive keyboard-generated signals such as +.SM +.BR SIGINT . +These processes are said to be in the +.IR foreground . +.I Background +processes are those whose process group ID differs from the terminal's; +such processes are immune to keyboard-generated signals. +Only foreground processes are allowed to read from or, if the +user so specifies with \f(CWstty tostop\fP, write to the +terminal. +Background processes which attempt to read from (write to when +\f(CWstty tostop\fP is in effect) the +terminal are sent a +.SM +.B SIGTTIN (SIGTTOU) +signal by the kernel's terminal driver, +which, unless caught, suspends the process. +.PP +If the operating system on which +.B bash +is running supports +job control, +.B bash +contains facilities to use it. +Typing the +.I suspend +character (typically +.BR ^Z , +Control-Z) while a process is running +causes that process to be stopped and returns control to +.BR bash . +Typing the +.I "delayed suspend" +character (typically +.BR ^Y , +Control-Y) causes the process to be stopped when it +attempts to read input from the terminal, and control to +be returned to +.BR bash . +The user may then manipulate the state of this job, using the +.B bg +command to continue it in the background, the +.B fg +command to continue it in the foreground, or +the +.B kill +command to kill it. A \fB^Z\fP takes effect immediately, +and has the additional side effect of causing pending output +and typeahead to be discarded. +.PP +There are a number of ways to refer to a job in the shell. +The character +.B % +introduces a job specification (\fIjobspec\fP). Job number +.I n +may be referred to as +.BR %n . +A job may also be referred to using a prefix of the name used to +start it, or using a substring that appears in its command line. +For example, +.B %ce +refers to a stopped +.B ce +job. If a prefix matches more than one job, +.B bash +reports an error. Using +.BR %?ce , +on the other hand, refers to any job containing the string +.B ce +in its command line. If the substring matches more than one job, +.B bash +reports an error. The symbols +.B %% +and +.B %+ +refer to the shell's notion of the +.IR "current job" , +which is the last job stopped while it was in +the foreground or started in the background. +The +.I "previous job" +may be referenced using +.BR %\- . +If there is only a single job, \fB%+\fP and \fB%\-\fP can both be used +to refer to that job. +In output pertaining to jobs (e.g., the output of the +.B jobs +command), the current job is always flagged with a +.BR + , +and the previous job with a +.BR \- . +A single % (with no accompanying job specification) also refers to the +current job. +.PP +Simply naming a job can be used to bring it into the +foreground: +.B %1 +is a synonym for +\fB``fg %1''\fP, +bringing job 1 from the background into the foreground. +Similarly, +.B ``%1 &'' +resumes job 1 in the background, equivalent to +\fB``bg %1''\fP. +.PP +The shell learns immediately whenever a job changes state. +Normally, +.B bash +waits until it is about to print a prompt before reporting +changes in a job's status so as to not interrupt +any other output. If the +.B \-b +option to the +.B set +builtin command +is enabled, +.B bash +reports such changes immediately. +Any trap on +.SM +.B SIGCHLD +is executed for each child that exits. +.PP +If an attempt to exit +.B bash +is made while jobs are stopped (or, if the \fBcheckjobs\fP shell option has +been enabled using the \fBshopt\fP builtin, running), the shell prints a +warning message, and, if the \fBcheckjobs\fP option is enabled, lists the +jobs and their statuses. +The +.B jobs +command may then be used to inspect their status. +If a second attempt to exit is made without an intervening command, +the shell does not print another warning, and any stopped +jobs are terminated. +.SH PROMPTING +When executing interactively, +.B bash +displays the primary prompt +.SM +.B PS1 +when it is ready to read a command, and the secondary prompt +.SM +.B PS2 +when it needs more input to complete a command. +.B Bash +allows these prompt strings to be customized by inserting a number of +backslash-escaped special characters that are decoded as follows: +.RS +.PD 0 +.TP +.B \ea +an ASCII bell character (07) +.TP +.B \ed +the date in "Weekday Month Date" format (e.g., "Tue May 26") +.TP +.B \eD{\fIformat\fP} +the \fIformat\fP is passed to \fIstrftime\fP(3) and the result is inserted +into the prompt string; an empty \fIformat\fP results in a locale-specific +time representation. The braces are required +.TP +.B \ee +an ASCII escape character (033) +.TP +.B \eh +the hostname up to the first `.' +.TP +.B \eH +the hostname +.TP +.B \ej +the number of jobs currently managed by the shell +.TP +.B \el +the basename of the shell's terminal device name +.TP +.B \en +newline +.TP +.B \er +carriage return +.TP +.B \es +the name of the shell, the basename of +.B $0 +(the portion following the final slash) +.TP +.B \et +the current time in 24-hour HH:MM:SS format +.TP +.B \eT +the current time in 12-hour HH:MM:SS format +.TP +.B \e@ +the current time in 12-hour am/pm format +.TP +.B \eA +the current time in 24-hour HH:MM format +.TP +.B \eu +the username of the current user +.TP +.B \ev +the version of \fBbash\fP (e.g., 2.00) +.TP +.B \eV +the release of \fBbash\fP, version + patch level (e.g., 2.00.0) +.TP +.B \ew +the current working directory, with +.SM +.B $HOME +abbreviated with a tilde +(uses the value of the +.SM +.B PROMPT_DIRTRIM +variable) +.TP +.B \eW +the basename of the current working directory, with +.SM +.B $HOME +abbreviated with a tilde +.TP +.B \e! +the history number of this command +.TP +.B \e# +the command number of this command +.TP +.B \e$ +if the effective UID is 0, a +.BR # , +otherwise a +.B $ +.TP +.B \e\fInnn\fP +the character corresponding to the octal number \fInnn\fP +.TP +.B \e\e +a backslash +.TP +.B \e[ +begin a sequence of non-printing characters, which could be used to +embed a terminal control sequence into the prompt +.TP +.B \e] +end a sequence of non-printing characters +.PD +.RE +.PP +The command number and the history number are usually different: +the history number of a command is its position in the history +list, which may include commands restored from the history file +(see +.SM +.B HISTORY +below), while the command number is the position in the sequence +of commands executed during the current shell session. +After the string is decoded, it is expanded via +parameter expansion, command substitution, arithmetic +expansion, and quote removal, subject to the value of the +.B promptvars +shell option (see the description of the +.B shopt +command under +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.SH READLINE +This is the library that handles reading input when using an interactive +shell, unless the +.B \-\-noediting +option is given at shell invocation. +Line editing is also used when using the \fB\-e\fP option to the +\fBread\fP builtin. +By default, the line editing commands are similar to those of Emacs. +A vi-style line editing interface is also available. +Line editing can be enabled at any time using the +.B \-o emacs +or +.B \-o vi +options to the +.B set +builtin (see +.SM +.B SHELL BUILTIN COMMANDS +below). +To turn off line editing after the shell is running, use the +.B +o emacs +or +.B +o vi +options to the +.B set +builtin. +.SS "Readline Notation" +.PP +In this section, the Emacs-style notation is used to denote +keystrokes. Control keys are denoted by C\-\fIkey\fR, e.g., C\-n +means Control\-N. Similarly, +.I meta +keys are denoted by M\-\fIkey\fR, so M\-x means Meta\-X. (On keyboards +without a +.I meta +key, M\-\fIx\fP means ESC \fIx\fP, i.e., press the Escape key +then the +.I x +key. This makes ESC the \fImeta prefix\fP. +The combination M\-C\-\fIx\fP means ESC\-Control\-\fIx\fP, +or press the Escape key +then hold the Control key while pressing the +.I x +key.) +.PP +Readline commands may be given numeric +.IR arguments , +which normally act as a repeat count. +Sometimes, however, it is the sign of the argument that is significant. +Passing a negative argument to a command that acts in the forward +direction (e.g., \fBkill\-line\fP) causes that command to act in a +backward direction. +Commands whose behavior with arguments deviates from this are noted +below. +.PP +When a command is described as \fIkilling\fP text, the text +deleted is saved for possible future retrieval +(\fIyanking\fP). The killed text is saved in a +\fIkill ring\fP. Consecutive kills cause the text to be +accumulated into one unit, which can be yanked all at once. +Commands which do not kill text separate the chunks of text +on the kill ring. +.SS "Readline Initialization" +.PP +Readline is customized by putting commands in an initialization +file (the \fIinputrc\fP file). +The name of this file is taken from the value of the +.SM +.B INPUTRC +variable. If that variable is unset, the default is +.IR ~/.inputrc . +When a program which uses the readline library starts up, the +initialization file is read, and the key bindings and variables +are set. +There are only a few basic constructs allowed in the +readline initialization file. +Blank lines are ignored. +Lines beginning with a \fB#\fP are comments. +Lines beginning with a \fB$\fP indicate conditional constructs. +Other lines denote key bindings and variable settings. +.PP +The default key-bindings may be changed with an +.I inputrc +file. +Other programs that use this library may add their own commands +and bindings. +.PP +For example, placing +.RS +.PP +M\-Control\-u: universal\-argument +.RE +or +.RS +C\-Meta\-u: universal\-argument +.RE +into the +.I inputrc +would make M\-C\-u execute the readline command +.IR universal\-argument . +.PP +The following symbolic character names are recognized: +.IR RUBOUT , +.IR DEL , +.IR ESC , +.IR LFD , +.IR NEWLINE , +.IR RET , +.IR RETURN , +.IR SPC , +.IR SPACE , +and +.IR TAB . +.PP +In addition to command names, readline allows keys to be bound +to a string that is inserted when the key is pressed (a \fImacro\fP). +.SS "Readline Key Bindings" +.PP +The syntax for controlling key bindings in the +.I inputrc +file is simple. All that is required is the name of the +command or the text of a macro and a key sequence to which +it should be bound. The name may be specified in one of two ways: +as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP +prefixes, or as a key sequence. +.PP +When using the form \fBkeyname\fP:\^\fIfunction\-name\fP or \fImacro\fP, +.I keyname +is the name of a key spelled out in English. For example: +.sp +.RS +Control-u: universal\-argument +.br +Meta-Rubout: backward-kill-word +.br +Control-o: "> output" +.RE +.LP +In the above example, +.I C\-u +is bound to the function +.BR universal\-argument , +.I M\-DEL +is bound to the function +.BR backward\-kill\-word , +and +.I C\-o +is bound to run the macro +expressed on the right hand side (that is, to insert the text +.if t \f(CW> output\fP +.if n ``> output'' +into the line). +.PP +In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP, +.B keyseq +differs from +.B keyname +above in that strings denoting +an entire key sequence may be specified by placing the sequence +within double quotes. Some GNU Emacs style key escapes can be +used, as in the following example, but the symbolic character names +are not recognized. +.sp +.RS +"\eC\-u": universal\-argument +.br +"\eC\-x\eC\-r": re\-read\-init\-file +.br +"\ee[11~": "Function Key 1" +.RE +.PP +In this example, +.I C\-u +is again bound to the function +.BR universal\-argument . +.I "C\-x C\-r" +is bound to the function +.BR re\-read\-init\-file , +and +.I "ESC [ 1 1 ~" +is bound to insert the text +.if t \f(CWFunction Key 1\fP. +.if n ``Function Key 1''. +.PP +The full set of GNU Emacs style escape sequences is +.RS +.PD 0 +.TP +.B \eC\- +control prefix +.TP +.B \eM\- +meta prefix +.TP +.B \ee +an escape character +.TP +.B \e\e +backslash +.TP +.B \e" +literal " +.TP +.B \e\(aq +literal \(aq +.RE +.PD +.PP +In addition to the GNU Emacs style escape sequences, a second +set of backslash escapes is available: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ed +delete +.TP +.B \ef +form feed +.TP +.B \en +newline +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(one to three digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.RE +.PD +.PP +When entering the text of a macro, single or double quotes must +be used to indicate a macro definition. +Unquoted text is assumed to be a function name. +In the macro body, the backslash escapes described above are expanded. +Backslash will quote any other character in the macro text, +including " and \(aq. +.PP +.B Bash +allows the current readline key bindings to be displayed or modified +with the +.B bind +builtin command. The editing mode may be switched during interactive +use by using the +.B \-o +option to the +.B set +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SS "Readline Variables" +.PP +Readline has variables that can be used to further customize its +behavior. A variable may be set in the +.I inputrc +file with a statement of the form +.RS +.PP +\fBset\fP \fIvariable\-name\fP \fIvalue\fP +.RE +.PP +Except where noted, readline variables can take the values +.B On +or +.B Off +(without regard to case). +Unrecognized variable names are ignored. +When a variable value is read, empty or null values, "on" (case-insensitive), +and "1" are equivalent to \fBOn\fP. All other values are equivalent to +\fBOff\fP. +The variables and their default values are: +.PP +.PD 0 +.TP +.B bell\-style (audible) +Controls what happens when readline wants to ring the terminal bell. +If set to \fBnone\fP, readline never rings the bell. If set to +\fBvisible\fP, readline uses a visible bell if one is available. +If set to \fBaudible\fP, readline attempts to ring the terminal's bell. +.TP +.B bind\-tty\-special\-chars (On) +If set to \fBOn\fP, readline attempts to bind the control characters +treated specially by the kernel's terminal driver to their readline +equivalents. +.TP +.B colored\-stats (Off) +If set to \fBOn\fP, readline displays possible completions using different +colors to indicate their file type. +The color definitions are taken from the value of the \fBLS_COLORS\fP +environment variable. +.TP +.B comment\-begin (``#'') +The string that is inserted when the readline +.B insert\-comment +command is executed. +This command is bound to +.B M\-# +in emacs mode and to +.B # +in vi command mode. +.TP +.B completion\-ignore\-case (Off) +If set to \fBOn\fP, readline performs filename matching and completion +in a case\-insensitive fashion. +.TP +.B completion\-prefix\-display\-length (0) +The length in characters of the common prefix of a list of possible +completions that is displayed without modification. When set to a +value greater than zero, common prefixes longer than this value are +replaced with an ellipsis when displaying possible completions. +.TP +.B completion\-query\-items (100) +This determines when the user is queried about viewing +the number of possible completions +generated by the \fBpossible\-completions\fP command. +It may be set to any integer value greater than or equal to +zero. If the number of possible completions is greater than +or equal to the value of this variable, the user is asked whether +or not he wishes to view them; otherwise they are simply listed +on the terminal. +.TP +.B convert\-meta (On) +If set to \fBOn\fP, readline will convert characters with the +eighth bit set to an ASCII key sequence +by stripping the eighth bit and prefixing an +escape character (in effect, using escape as the \fImeta prefix\fP). +.TP +.B disable\-completion (Off) +If set to \fBOn\fP, readline will inhibit word completion. Completion +characters will be inserted into the line as if they had been +mapped to \fBself-insert\fP. +.TP +.B editing\-mode (emacs) +Controls whether readline begins with a set of key bindings similar +to \fIEmacs\fP or \fIvi\fP. +.B editing\-mode +can be set to either +.B emacs +or +.BR vi . +.TP +.B echo\-control\-characters (On) +When set to \fBOn\fP, on operating systems that indicate they support it, +readline echoes a character corresponding to a signal generated from the +keyboard. +.TP +.B enable\-keypad (Off) +When set to \fBOn\fP, readline will try to enable the application +keypad when it is called. Some systems need this to enable the +arrow keys. +.TP +.B enable\-meta\-key (On) +When set to \fBOn\fP, readline will try to enable any meta modifier +key the terminal claims to support when it is called. On many terminals, +the meta key is used to send eight-bit characters. +.TP +.B expand\-tilde (Off) +If set to \fBOn\fP, tilde expansion is performed when readline +attempts word completion. +.TP +.B history\-preserve\-point (Off) +If set to \fBOn\fP, the history code attempts to place point at the +same location on each history line retrieved with \fBprevious-history\fP +or \fBnext-history\fP. +.TP +.B history\-size (0) +Set the maximum number of history entries saved in the history list. +If set to zero, any existing history entries are deleted and no new entries +are saved. +If set to a value less than zero, the number of history entries is not +limited. +By default, the number of history entries is not limited. +.TP +.B horizontal\-scroll\-mode (Off) +When set to \fBOn\fP, makes readline use a single line for display, +scrolling the input horizontally on a single screen line when it +becomes longer than the screen width rather than wrapping to a new line. +.TP +.B input\-meta (Off) +If set to \fBOn\fP, readline will enable eight-bit input (that is, +it will not strip the high bit from the characters it reads), +regardless of what the terminal claims it can support. The name +.B meta\-flag +is a synonym for this variable. +.TP +.B isearch\-terminators (``C\-[C\-J'') +The string of characters that should terminate an incremental +search without subsequently executing the character as a command. +If this variable has not been given a value, the characters +\fIESC\fP and \fIC\-J\fP will terminate an incremental search. +.TP +.B keymap (emacs) +Set the current readline keymap. The set of valid keymap names is +\fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi, +vi\-command\fP, and +.IR vi\-insert . +\fIvi\fP is equivalent to \fIvi\-command\fP; \fIemacs\fP is +equivalent to \fIemacs\-standard\fP. The default value is +.IR emacs ; +the value of +.B editing\-mode +also affects the default keymap. +.TP +.B keyseq\-timeout (500) +Specifies the duration \fIreadline\fP will wait for a character when reading an +ambiguous key sequence (one that can form a complete key sequence using +the input read so far, or can take additional input to complete a longer +key sequence). +If no input is received within the timeout, \fIreadline\fP will use the shorter +but complete key sequence. +The value is specified in milliseconds, so a value of 1000 means that +\fIreadline\fP will wait one second for additional input. +If this variable is set to a value less than or equal to zero, or to a +non-numeric value, \fIreadline\fP will wait until another key is pressed to +decide which key sequence to complete. +.TP +.B mark\-directories (On) +If set to \fBOn\fP, completed directory names have a slash +appended. +.TP +.B mark\-modified\-lines (Off) +If set to \fBOn\fP, history lines that have been modified are displayed +with a preceding asterisk (\fB*\fP). +.TP +.B mark\-symlinked\-directories (Off) +If set to \fBOn\fP, completed names which are symbolic links to directories +have a slash appended (subject to the value of +\fBmark\-directories\fP). +.TP +.B match\-hidden\-files (On) +This variable, when set to \fBOn\fP, causes readline to match files whose +names begin with a `.' (hidden files) when performing filename +completion. +If set to \fBOff\fP, the leading `.' must be +supplied by the user in the filename to be completed. +.TP +.B menu\-complete\-display\-prefix (Off) +If set to \fBOn\fP, menu completion displays the common prefix of the +list of possible completions (which may be empty) before cycling through +the list. +.TP +.B output\-meta (Off) +If set to \fBOn\fP, readline will display characters with the +eighth bit set directly rather than as a meta-prefixed escape +sequence. +.TP +.B page\-completions (On) +If set to \fBOn\fP, readline uses an internal \fImore\fP-like pager +to display a screenful of possible completions at a time. +.TP +.B print\-completions\-horizontally (Off) +If set to \fBOn\fP, readline will display completions with matches +sorted horizontally in alphabetical order, rather than down the screen. +.TP +.B revert\-all\-at\-newline (Off) +If set to \fBOn\fP, readline will undo all changes to history lines +before returning when \fBaccept\-line\fP is executed. By default, +history lines may be modified and retain individual undo lists across +calls to \fBreadline\fP. +.TP +.B show\-all\-if\-ambiguous (Off) +This alters the default behavior of the completion functions. If +set to +.BR On , +words which have more than one possible completion cause the +matches to be listed immediately instead of ringing the bell. +.TP +.B show\-all\-if\-unmodified (Off) +This alters the default behavior of the completion functions in +a fashion similar to \fBshow\-all\-if\-ambiguous\fP. +If set to +.BR On , +words which have more than one possible completion without any +possible partial completion (the possible completions don't share +a common prefix) cause the matches to be listed immediately instead +of ringing the bell. +.TP +.B show\-mode\-in\-prompt (Off) +If set to \fBOn\fP, add a character to the beginning of the prompt +indicating the editing mode: emacs (@), vi command (:) or vi +insertion (+). +.TP +.B skip\-completed\-text (Off) +If set to \fBOn\fP, this alters the default completion behavior when +inserting a single match into the line. It's only active when +performing completion in the middle of a word. If enabled, readline +does not insert characters from the completion that match characters +after point in the word being completed, so portions of the word +following the cursor are not duplicated. +.TP +.B visible\-stats (Off) +If set to \fBOn\fP, a character denoting a file's type as reported +by \fIstat\fP(2) is appended to the filename when listing possible +completions. +.PD +.SS "Readline Conditional Constructs" +.PP +Readline implements a facility similar in spirit to the conditional +compilation features of the C preprocessor which allows key +bindings and variable settings to be performed as the result +of tests. There are four parser directives used. +.IP \fB$if\fP +The +.B $if +construct allows bindings to be made based on the +editing mode, the terminal being used, or the application using +readline. The text of the test extends to the end of the line; +no characters are required to isolate it. +.RS +.IP \fBmode\fP +The \fBmode=\fP form of the \fB$if\fP directive is used to test +whether readline is in emacs or vi mode. +This may be used in conjunction +with the \fBset keymap\fP command, for instance, to set bindings in +the \fIemacs\-standard\fP and \fIemacs\-ctlx\fP keymaps only if +readline is starting out in emacs mode. +.IP \fBterm\fP +The \fBterm=\fP form may be used to include terminal-specific +key bindings, perhaps to bind the key sequences output by the +terminal's function keys. The word on the right side of the +.B = +is tested against the both full name of the terminal and the portion +of the terminal name before the first \fB\-\fP. This allows +.I sun +to match both +.I sun +and +.IR sun\-cmd , +for instance. +.IP \fBapplication\fP +The \fBapplication\fP construct is used to include +application-specific settings. Each program using the readline +library sets the \fIapplication name\fP, and an initialization +file can test for a particular value. +This could be used to bind key sequences to functions useful for +a specific program. For instance, the following command adds a +key sequence that quotes the current or previous word in \fBbash\fP: +.sp 1 +.RS +.nf +\fB$if\fP Bash +# Quote the current or previous word +"\eC\-xq": "\eeb\e"\eef\e"" +\fB$endif\fP +.fi +.RE +.RE +.IP \fB$endif\fP +This command, as seen in the previous example, terminates an +\fB$if\fP command. +.IP \fB$else\fP +Commands in this branch of the \fB$if\fP directive are executed if +the test fails. +.IP \fB$include\fP +This directive takes a single filename as an argument and reads commands +and bindings from that file. For example, the following directive +would read \fI/etc/inputrc\fP: +.sp 1 +.RS +.nf +\fB$include\fP \^ \fI/etc/inputrc\fP +.fi +.RE +.SS Searching +.PP +Readline provides commands for searching through the command history +(see +.SM +.B HISTORY +below) for lines containing a specified string. +There are two search modes: +.I incremental +and +.IR non-incremental . +.PP +Incremental searches begin before the user has finished typing the +search string. +As each character of the search string is typed, readline displays +the next entry from the history matching the string typed so far. +An incremental search requires only as many characters as needed to +find the desired history entry. +The characters present in the value of the \fBisearch-terminators\fP +variable are used to terminate an incremental search. +If that variable has not been assigned a value the Escape and +Control-J characters will terminate an incremental search. +Control-G will abort an incremental search and restore the original +line. +When the search is terminated, the history entry containing the +search string becomes the current line. +.PP +To find other matching entries in the history list, type Control-S or +Control-R as appropriate. +This will search backward or forward in the history for the next +entry matching the search string typed so far. +Any other key sequence bound to a readline command will terminate +the search and execute that command. +For instance, a \fInewline\fP will terminate the search and accept +the line, thereby executing the command from the history list. +.PP +Readline remembers the last incremental search string. If two +Control-Rs are typed without any intervening characters defining a +new search string, any remembered search string is used. +.PP +Non-incremental searches read the entire search string before starting +to search for matching history lines. The search string may be +typed by the user or be part of the contents of the current line. +.SS "Readline Command Names" +.PP +The following is a list of the names of the commands and the default +key sequences to which they are bound. +Command names without an accompanying key sequence are unbound by default. +In the following descriptions, \fIpoint\fP refers to the current cursor +position, and \fImark\fP refers to a cursor position saved by the +\fBset\-mark\fP command. +The text between the point and mark is referred to as the \fIregion\fP. +.SS Commands for Moving +.PP +.PD 0 +.TP +.B beginning\-of\-line (C\-a) +Move to the start of the current line. +.TP +.B end\-of\-line (C\-e) +Move to the end of the line. +.TP +.B forward\-char (C\-f) +Move forward a character. +.TP +.B backward\-char (C\-b) +Move back a character. +.TP +.B forward\-word (M\-f) +Move forward to the end of the next word. Words are composed of +alphanumeric characters (letters and digits). +.TP +.B backward\-word (M\-b) +Move back to the start of the current or previous word. +Words are composed of alphanumeric characters (letters and digits). +.TP +.B shell\-forward\-word +Move forward to the end of the next word. +Words are delimited by non-quoted shell metacharacters. +.TP +.B shell\-backward\-word +Move back to the start of the current or previous word. +Words are delimited by non-quoted shell metacharacters. +.TP +.B clear\-screen (C\-l) +Clear the screen leaving the current line at the top of the screen. +With an argument, refresh the current line without clearing the +screen. +.TP +.B redraw\-current\-line +Refresh the current line. +.PD +.SS Commands for Manipulating the History +.PP +.PD 0 +.TP +.B accept\-line (Newline, Return) +Accept the line regardless of where the cursor is. If this line is +non-empty, add it to the history list according to the state of the +.SM +.B HISTCONTROL +variable. If the line is a modified history +line, then restore the history line to its original state. +.TP +.B previous\-history (C\-p) +Fetch the previous command from the history list, moving back in +the list. +.TP +.B next\-history (C\-n) +Fetch the next command from the history list, moving forward in the +list. +.TP +.B beginning\-of\-history (M\-<) +Move to the first line in the history. +.TP +.B end\-of\-history (M\->) +Move to the end of the input history, i.e., the line currently being +entered. +.TP +.B reverse\-search\-history (C\-r) +Search backward starting at the current line and moving `up' through +the history as necessary. This is an incremental search. +.TP +.B forward\-search\-history (C\-s) +Search forward starting at the current line and moving `down' through +the history as necessary. This is an incremental search. +.TP +.B non\-incremental\-reverse\-search\-history (M\-p) +Search backward through the history starting at the current line +using a non-incremental search for a string supplied by the user. +.TP +.B non\-incremental\-forward\-search\-history (M\-n) +Search forward through the history using a non-incremental search for +a string supplied by the user. +.TP +.B history\-search\-forward +Search forward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +.TP +.B history\-search\-backward +Search backward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +.TP +.B yank\-nth\-arg (M\-C\-y) +Insert the first argument to the previous command (usually +the second word on the previous line) at point. +With an argument +.IR n , +insert the \fIn\fPth word from the previous command (the words +in the previous command begin with word 0). A negative argument +inserts the \fIn\fPth word from the end of the previous command. +Once the argument \fIn\fP is computed, the argument is extracted +as if the "!\fIn\fP" history expansion had been specified. +.TP +.B +yank\-last\-arg (M\-.\^, M\-_\^) +Insert the last argument to the previous command (the last word of +the previous history entry). +With a numeric argument, behave exactly like \fByank\-nth\-arg\fP. +Successive calls to \fByank\-last\-arg\fP move back through the history +list, inserting the last word (or the word specified by the argument to +the first call) of each line in turn. +Any numeric argument supplied to these successive calls determines +the direction to move through the history. A negative argument switches +the direction through the history (back or forward). +The history expansion facilities are used to extract the last word, +as if the "!$" history expansion had been specified. +.TP +.B shell\-expand\-line (M\-C\-e) +Expand the line as the shell does. This +performs alias and history expansion as well as all of the shell +word expansions. See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B history\-expand\-line (M\-^) +Perform history expansion on the current line. +See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B magic\-space +Perform history expansion on the current line and insert a space. +See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B alias\-expand\-line +Perform alias expansion on the current line. +See +.SM +.B ALIASES +above for a description of alias expansion. +.TP +.B history\-and\-alias\-expand\-line +Perform history and alias expansion on the current line. +.TP +.B insert\-last\-argument (M\-.\^, M\-_\^) +A synonym for \fByank\-last\-arg\fP. +.TP +.B operate\-and\-get\-next (C\-o) +Accept the current line for execution and fetch the next line +relative to the current line from the history for editing. Any +argument is ignored. +.TP +.B edit\-and\-execute\-command (C\-xC\-e) +Invoke an editor on the current command line, and execute the result as shell +commands. +\fBBash\fP attempts to invoke +.SM +.BR $VISUAL , +.SM +.BR $EDITOR , +and \fIemacs\fP as the editor, in that order. +.PD +.SS Commands for Changing Text +.PP +.PD 0 +.TP +.B \fIend\-of\-file\fP (usually C\-d) +The character indicating end-of-file as set, for example, by +.if t \f(CWstty\fP. +.if n ``stty''. +If this character is read when there are no characters +on the line, and point is at the beginning of the line, Readline +interprets it as the end of input and returns +.SM +.BR EOF . +.TP +.B delete\-char (C\-d) +Delete the character at point. +If this function is bound to the +same character as the tty \fBEOF\fP character, as \fBC\-d\fP +commonly is, see above for the effects. +.TP +.B backward\-delete\-char (Rubout) +Delete the character behind the cursor. When given a numeric argument, +save the deleted text on the kill ring. +.TP +.B forward\-backward\-delete\-char +Delete the character under the cursor, unless the cursor is at the +end of the line, in which case the character behind the cursor is +deleted. +.TP +.B quoted\-insert (C\-q, C\-v) +Add the next character typed to the line verbatim. This is +how to insert characters like \fBC\-q\fP, for example. +.TP +.B tab\-insert (C\-v TAB) +Insert a tab character. +.TP +.B self\-insert (a,\ b,\ A,\ 1,\ !,\ ...) +Insert the character typed. +.TP +.B transpose\-chars (C\-t) +Drag the character before point forward over the character at point, +moving point forward as well. +If point is at the end of the line, then this transposes +the two characters before point. +Negative arguments have no effect. +.TP +.B transpose\-words (M\-t) +Drag the word before point past the word after point, +moving point over that word as well. +If point is at the end of the line, this transposes +the last two words on the line. +.TP +.B upcase\-word (M\-u) +Uppercase the current (or following) word. With a negative argument, +uppercase the previous word, but do not move point. +.TP +.B downcase\-word (M\-l) +Lowercase the current (or following) word. With a negative argument, +lowercase the previous word, but do not move point. +.TP +.B capitalize\-word (M\-c) +Capitalize the current (or following) word. With a negative argument, +capitalize the previous word, but do not move point. +.TP +.B overwrite\-mode +Toggle overwrite mode. With an explicit positive numeric argument, +switches to overwrite mode. With an explicit non-positive numeric +argument, switches to insert mode. This command affects only +\fBemacs\fP mode; \fBvi\fP mode does overwrite differently. +Each call to \fIreadline()\fP starts in insert mode. +In overwrite mode, characters bound to \fBself\-insert\fP replace +the text at point rather than pushing the text to the right. +Characters bound to \fBbackward\-delete\-char\fP replace the character +before point with a space. By default, this command is unbound. +.PD +.SS Killing and Yanking +.PP +.PD 0 +.TP +.B kill\-line (C\-k) +Kill the text from point to the end of the line. +.TP +.B backward\-kill\-line (C\-x Rubout) +Kill backward to the beginning of the line. +.TP +.B unix\-line\-discard (C\-u) +Kill backward from point to the beginning of the line. +The killed text is saved on the kill-ring. +.\" There is no real difference between this and backward-kill-line +.TP +.B kill\-whole\-line +Kill all characters on the current line, no matter where point is. +.TP +.B kill\-word (M\-d) +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as those used by \fBforward\-word\fP. +.TP +.B backward\-kill\-word (M\-Rubout) +Kill the word behind point. +Word boundaries are the same as those used by \fBbackward\-word\fP. +.TP +.B shell\-kill\-word (M\-d) +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as those used by \fBshell\-forward\-word\fP. +.TP +.B shell\-backward\-kill\-word (M\-Rubout) +Kill the word behind point. +Word boundaries are the same as those used by \fBshell\-backward\-word\fP. +.TP +.B unix\-word\-rubout (C\-w) +Kill the word behind point, using white space as a word boundary. +The killed text is saved on the kill-ring. +.TP +.B unix\-filename\-rubout +Kill the word behind point, using white space and the slash character +as the word boundaries. +The killed text is saved on the kill-ring. +.TP +.B delete\-horizontal\-space (M\-\e) +Delete all spaces and tabs around point. +.TP +.B kill\-region +Kill the text in the current region. +.TP +.B copy\-region\-as\-kill +Copy the text in the region to the kill buffer. +.TP +.B copy\-backward\-word +Copy the word before point to the kill buffer. +The word boundaries are the same as \fBbackward\-word\fP. +.TP +.B copy\-forward\-word +Copy the word following point to the kill buffer. +The word boundaries are the same as \fBforward\-word\fP. +.TP +.B yank (C\-y) +Yank the top of the kill ring into the buffer at point. +.TP +.B yank\-pop (M\-y) +Rotate the kill ring, and yank the new top. Only works following +.B yank +or +.BR yank\-pop . +.PD +.SS Numeric Arguments +.PP +.PD 0 +.TP +.B digit\-argument (M\-0, M\-1, ..., M\-\-) +Add this digit to the argument already accumulating, or start a new +argument. M\-\- starts a negative argument. +.TP +.B universal\-argument +This is another way to specify an argument. +If this command is followed by one or more digits, optionally with a +leading minus sign, those digits define the argument. +If the command is followed by digits, executing +.B universal\-argument +again ends the numeric argument, but is otherwise ignored. +As a special case, if this command is immediately followed by a +character that is neither a digit or minus sign, the argument count +for the next command is multiplied by four. +The argument count is initially one, so executing this function the +first time makes the argument count four, a second time makes the +argument count sixteen, and so on. +.PD +.SS Completing +.PP +.PD 0 +.TP +.B complete (TAB) +Attempt to perform completion on the text before point. +.B Bash +attempts completion treating the text as a variable (if the +text begins with \fB$\fP), username (if the text begins with +\fB~\fP), hostname (if the text begins with \fB@\fP), or +command (including aliases and functions) in turn. If none +of these produces a match, filename completion is attempted. +.TP +.B possible\-completions (M\-?) +List the possible completions of the text before point. +.TP +.B insert\-completions (M\-*) +Insert all completions of the text before point +that would have been generated by +\fBpossible\-completions\fP. +.TP +.B menu\-complete +Similar to \fBcomplete\fP, but replaces the word to be completed +with a single match from the list of possible completions. +Repeated execution of \fBmenu\-complete\fP steps through the list +of possible completions, inserting each match in turn. +At the end of the list of completions, the bell is rung +(subject to the setting of \fBbell\-style\fP) +and the original text is restored. +An argument of \fIn\fP moves \fIn\fP positions forward in the list +of matches; a negative argument may be used to move backward +through the list. +This command is intended to be bound to \fBTAB\fP, but is unbound +by default. +.TP +.B menu\-complete\-backward +Identical to \fBmenu\-complete\fP, but moves backward through the list +of possible completions, as if \fBmenu\-complete\fP had been given a +negative argument. This command is unbound by default. +.TP +.B delete\-char\-or\-list +Deletes the character under the cursor if not at the beginning or +end of the line (like \fBdelete\-char\fP). +If at the end of the line, behaves identically to +\fBpossible\-completions\fP. +This command is unbound by default. +.TP +.B complete\-filename (M\-/) +Attempt filename completion on the text before point. +.TP +.B possible\-filename\-completions (C\-x /) +List the possible completions of the text before point, +treating it as a filename. +.TP +.B complete\-username (M\-~) +Attempt completion on the text before point, treating +it as a username. +.TP +.B possible\-username\-completions (C\-x ~) +List the possible completions of the text before point, +treating it as a username. +.TP +.B complete\-variable (M\-$) +Attempt completion on the text before point, treating +it as a shell variable. +.TP +.B possible\-variable\-completions (C\-x $) +List the possible completions of the text before point, +treating it as a shell variable. +.TP +.B complete\-hostname (M\-@) +Attempt completion on the text before point, treating +it as a hostname. +.TP +.B possible\-hostname\-completions (C\-x @) +List the possible completions of the text before point, +treating it as a hostname. +.TP +.B complete\-command (M\-!) +Attempt completion on the text before point, treating +it as a command name. Command completion attempts to +match the text against aliases, reserved words, shell +functions, shell builtins, and finally executable filenames, +in that order. +.TP +.B possible\-command\-completions (C\-x !) +List the possible completions of the text before point, +treating it as a command name. +.TP +.B dynamic\-complete\-history (M\-TAB) +Attempt completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +.TP +.B dabbrev\-expand +Attempt menu completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +.TP +.B complete\-into\-braces (M\-{) +Perform filename completion and insert the list of possible completions +enclosed within braces so the list is available to the shell (see +.B Brace Expansion +above). +.PD +.SS Keyboard Macros +.PP +.PD 0 +.TP +.B start\-kbd\-macro (C\-x (\^) +Begin saving the characters typed into the current keyboard macro. +.TP +.B end\-kbd\-macro (C\-x )\^) +Stop saving the characters typed into the current keyboard macro +and store the definition. +.TP +.B call\-last\-kbd\-macro (C\-x e) +Re-execute the last keyboard macro defined, by making the characters +in the macro appear as if typed at the keyboard. +.TP +.B print\-last\-kbd\-macro () +Print the last keyboard macro defined in a format suitable for the +\fIinputrc\fP file. +.PD +.SS Miscellaneous +.PP +.PD 0 +.TP +.B re\-read\-init\-file (C\-x C\-r) +Read in the contents of the \fIinputrc\fP file, and incorporate +any bindings or variable assignments found there. +.TP +.B abort (C\-g) +Abort the current editing command and +ring the terminal's bell (subject to the setting of +.BR bell\-style ). +.TP +.B do\-uppercase\-version (M\-a, M\-b, M\-\fIx\fP, ...) +If the metafied character \fIx\fP is lowercase, run the command +that is bound to the corresponding uppercase character. +.TP +.B prefix\-meta (ESC) +Metafy the next character typed. +.SM +.B ESC +.B f +is equivalent to +.BR Meta\-f . +.TP +.B undo (C\-_, C\-x C\-u) +Incremental undo, separately remembered for each line. +.TP +.B revert\-line (M\-r) +Undo all changes made to this line. This is like executing the +.B undo +command enough times to return the line to its initial state. +.TP +.B tilde\-expand (M\-&) +Perform tilde expansion on the current word. +.TP +.B set\-mark (C\-@, M\-) +Set the mark to the point. If a +numeric argument is supplied, the mark is set to that position. +.TP +.B exchange\-point\-and\-mark (C\-x C\-x) +Swap the point with the mark. The current cursor position is set to +the saved position, and the old cursor position is saved as the mark. +.TP +.B character\-search (C\-]) +A character is read and point is moved to the next occurrence of that +character. A negative count searches for previous occurrences. +.TP +.B character\-search\-backward (M\-C\-]) +A character is read and point is moved to the previous occurrence of that +character. A negative count searches for subsequent occurrences. +.TP +.B skip\-csi\-sequence +Read enough characters to consume a multi-key sequence such as those +defined for keys like Home and End. Such sequences begin with a +Control Sequence Indicator (CSI), usually ESC\-[. If this sequence is +bound to "\e[", keys producing such sequences will have no effect +unless explicitly bound to a readline command, instead of inserting +stray characters into the editing buffer. This is unbound by default, +but usually bound to ESC\-[. +.TP +.B insert\-comment (M\-#) +Without a numeric argument, the value of the readline +.B comment\-begin +variable is inserted at the beginning of the current line. +If a numeric argument is supplied, this command acts as a toggle: if +the characters at the beginning of the line do not match the value +of \fBcomment\-begin\fP, the value is inserted, otherwise +the characters in \fBcomment\-begin\fP are deleted from the beginning of +the line. +In either case, the line is accepted as if a newline had been typed. +The default value of +\fBcomment\-begin\fP causes this command to make the current line +a shell comment. +If a numeric argument causes the comment character to be removed, the line +will be executed by the shell. +.TP +.B glob\-complete\-word (M\-g) +The word before point is treated as a pattern for pathname expansion, +with an asterisk implicitly appended. This pattern is used to +generate a list of matching filenames for possible completions. +.TP +.B glob\-expand\-word (C\-x *) +The word before point is treated as a pattern for pathname expansion, +and the list of matching filenames is inserted, replacing the word. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +.TP +.B glob\-list\-expansions (C\-x g) +The list of expansions that would have been generated by +.B glob\-expand\-word +is displayed, and the line is redrawn. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +.TP +.B dump\-functions +Print all of the functions and their key bindings to the +readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B dump\-variables +Print all of the settable readline variables and their values to the +readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B dump\-macros +Print all of the readline key sequences bound to macros and the +strings they output. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B display\-shell\-version (C\-x C\-v) +Display version information about the current instance of +.BR bash . +.PD +.SS Programmable Completion +.PP +When word completion is attempted for an argument to a command for +which a completion specification (a \fIcompspec\fP) has been defined +using the \fBcomplete\fP builtin (see +.SM +.B "SHELL BUILTIN COMMANDS" +below), the programmable completion facilities are invoked. +.PP +First, the command name is identified. +If the command word is the empty string (completion attempted at the +beginning of an empty line), any compspec defined with +the \fB\-E\fP option to \fBcomplete\fP is used. +If a compspec has been defined for that command, the +compspec is used to generate the list of possible completions for the word. +If the command word is a full pathname, a compspec for the full +pathname is searched for first. +If no compspec is found for the full pathname, an attempt is made to +find a compspec for the portion following the final slash. +If those searches do not result in a compspec, any compspec defined with +the \fB\-D\fP option to \fBcomplete\fP is used as the default. +.PP +Once a compspec has been found, it is used to generate the list of +matching words. +If a compspec is not found, the default \fBbash\fP completion as +described above under \fBCompleting\fP is performed. +.PP +First, the actions specified by the compspec are used. +Only matches which are prefixed by the word being completed are +returned. +When the +.B \-f +or +.B \-d +option is used for filename or directory name completion, the shell +variable +.SM +.B FIGNORE +is used to filter the matches. +.PP +Any completions specified by a pathname expansion pattern to the +\fB\-G\fP option are generated next. +The words generated by the pattern need not match the word +being completed. +The +.SM +.B GLOBIGNORE +shell variable is not used to filter the matches, but the +.SM +.B FIGNORE +variable is used. +.PP +Next, the string specified as the argument to the \fB\-W\fP option +is considered. +The string is first split using the characters in the +.SM +.B IFS +special variable as delimiters. +Shell quoting is honored. +Each word is then expanded using +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, and arithmetic expansion, +as described above under +.SM +.BR EXPANSION . +The results are split using the rules described above under +\fBWord Splitting\fP. +The results of the expansion are prefix-matched against the word being +completed, and the matching words become the possible completions. +.PP +After these matches have been generated, any shell function or command +specified with the \fB\-F\fP and \fB\-C\fP options is invoked. +When the command or function is invoked, the +.SM +.BR COMP_LINE , +.SM +.BR COMP_POINT , +.SM +.BR COMP_KEY , +and +.SM +.B COMP_TYPE +variables are assigned values as described above under +\fBShell Variables\fP. +If a shell function is being invoked, the +.SM +.B COMP_WORDS +and +.SM +.B COMP_CWORD +variables are also set. +When the function or command is invoked, +the first argument (\fB$1\fP) is the name of the command whose arguments are +being completed, +the second argument (\fB$2\fP) is the word being completed, +and the third argument (\fB$3\fP) is the word preceding the word being +completed on the current command line. +No filtering of the generated completions against the word being completed +is performed; the function or command has complete freedom in generating +the matches. +.PP +Any function specified with \fB\-F\fP is invoked first. +The function may use any of the shell facilities, including the +\fBcompgen\fP builtin described below, to generate the matches. +It must put the possible completions in the +.SM +.B COMPREPLY +array variable, one per array element. +.PP +Next, any command specified with the \fB\-C\fP option is invoked +in an environment equivalent to command substitution. +It should print a list of completions, one per line, to the +standard output. +Backslash may be used to escape a newline, if necessary. +.PP +After all of the possible completions are generated, any filter +specified with the \fB\-X\fP option is applied to the list. +The filter is a pattern as used for pathname expansion; a \fB&\fP +in the pattern is replaced with the text of the word being completed. +A literal \fB&\fP may be escaped with a backslash; the backslash +is removed before attempting a match. +Any completion that matches the pattern will be removed from the list. +A leading \fB!\fP negates the pattern; in this case any completion +not matching the pattern will be removed. +.PP +Finally, any prefix and suffix specified with the \fB\-P\fP and \fB\-S\fP +options are added to each member of the completion list, and the result is +returned to the readline completion code as the list of possible +completions. +.PP +If the previously-applied actions do not generate any matches, and the +\fB\-o dirnames\fP option was supplied to \fBcomplete\fP when the +compspec was defined, directory name completion is attempted. +.PP +If the \fB\-o plusdirs\fP option was supplied to \fBcomplete\fP when the +compspec was defined, directory name completion is attempted and any +matches are added to the results of the other actions. +.PP +By default, if a compspec is found, whatever it generates is returned +to the completion code as the full set of possible completions. +The default \fBbash\fP completions are not attempted, and the readline +default of filename completion is disabled. +If the \fB\-o bashdefault\fP option was supplied to \fBcomplete\fP when +the compspec was defined, the \fBbash\fP default completions are attempted +if the compspec generates no matches. +If the \fB\-o default\fP option was supplied to \fBcomplete\fP when the +compspec was defined, readline's default completion will be performed +if the compspec (and, if attempted, the default \fBbash\fP completions) +generate no matches. +.PP +When a compspec indicates that directory name completion is desired, +the programmable completion functions force readline to append a slash +to completed names which are symbolic links to directories, subject to +the value of the \fBmark\-directories\fP readline variable, regardless +of the setting of the \fBmark-symlinked\-directories\fP readline variable. +.PP +There is some support for dynamically modifying completions. This is +most useful when used in combination with a default completion specified +with \fBcomplete -D\fP. +It's possible for shell functions executed as completion +handlers to indicate that completion should be retried by returning an +exit status of 124. If a shell function returns 124, and changes +the compspec associated with the command on which completion is being +attempted (supplied as the first argument when the function is executed), +programmable completion restarts from the beginning, with an +attempt to find a new compspec for that command. This allows a set of +completions to be built dynamically as completion is attempted, rather than +being loaded all at once. +.PP +For instance, assuming that there is a library of compspecs, each kept in a +file corresponding to the name of the command, the following default +completion function would load completions dynamically: +.PP +\f(CW_completion_loader() +.br +{ +.br + . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124 +.br +} +.br +complete -D -F _completion_loader -o bashdefault -o default +.br +\fP +.SH HISTORY +When the +.B \-o history +option to the +.B set +builtin is enabled, the shell provides access to the +\fIcommand history\fP, +the list of commands previously typed. +The value of the +.SM +.B HISTSIZE +variable is used as the +number of commands to save in a history list. +The text of the last +.SM +.B HISTSIZE +commands (default 500) is saved. The shell +stores each command in the history list prior to parameter and +variable expansion (see +.SM +.B EXPANSION +above) but after history expansion is performed, subject to the +values of the shell variables +.SM +.B HISTIGNORE +and +.SM +.BR HISTCONTROL . +.PP +On startup, the history is initialized from the file named by +the variable +.SM +.B HISTFILE +(default \fI~/.bash_history\fP). +The file named by the value of +.SM +.B HISTFILE +is truncated, if necessary, to contain no more than +the number of lines specified by the value of +.SM +.BR HISTFILESIZE . +If \fBHISTFILESIZE\fP is unset, or set to null, a non-numeric value, +or a numeric value less than zero, the history file is not truncated. +When the history file is read, +lines beginning with the history comment character followed immediately +by a digit are interpreted as timestamps for the preceding history line. +These timestamps are optionally displayed depending on the value of the +.SM +.B HISTTIMEFORMAT +variable. +When a shell with history enabled exits, the last +.SM +.B $HISTSIZE +lines are copied from the history list to +.SM +.BR $HISTFILE . +If the +.B histappend +shell option is enabled +(see the description of +.B shopt +under +.SM +.B "SHELL BUILTIN COMMANDS" +below), the lines are appended to the history file, +otherwise the history file is overwritten. +If +.SM +.B HISTFILE +is unset, or if the history file is unwritable, the history is +not saved. +If the +.SM +.B HISTTIMEFORMAT +variable is set, time stamps are written to the history file, marked +with the history comment character, so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +After saving the history, the history file is truncated +to contain no more than +.SM +.B HISTFILESIZE +lines. If +.SM +.B HISTFILESIZE +is unset, or set to null, a non-numeric value, +or a numeric value less than zero, the history file is not truncated. +.PP +The builtin command +.B fc +(see +.SM +.B SHELL BUILTIN COMMANDS +below) may be used to list or edit and re-execute a portion of +the history list. +The +.B history +builtin may be used to display or modify the history list and +manipulate the history file. +When using command-line editing, search commands +are available in each editing mode that provide access to the +history list. +.PP +The shell allows control over which commands are saved on the history +list. The +.SM +.B HISTCONTROL +and +.SM +.B HISTIGNORE +variables may be set to cause the shell to save only a subset of the +commands entered. +The +.B cmdhist +shell option, if enabled, causes the shell to attempt to save each +line of a multi-line command in the same history entry, adding +semicolons where necessary to preserve syntactic correctness. +The +.B lithist +shell option causes the shell to save the command with embedded newlines +instead of semicolons. See the description of the +.B shopt +builtin below under +.SM +.B "SHELL BUILTIN COMMANDS" +for information on setting and unsetting shell options. +.SH "HISTORY EXPANSION" +.PP +The shell supports a history expansion feature that +is similar to the history expansion in +.BR csh. +This section describes what syntax features are available. This +feature is enabled by default for interactive shells, and can be +disabled using the +.B +H +option to the +.B set +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). Non-interactive shells do not perform history expansion +by default. +.PP +History expansions introduce words from the history list into +the input stream, making it easy to repeat commands, insert the +arguments to a previous command into the current input line, or +fix errors in previous commands quickly. +.PP +History expansion is performed immediately after a complete line +is read, before the shell breaks it into words. +It takes place in two parts. +The first is to determine which line from the history list +to use during substitution. +The second is to select portions of that line for inclusion into +the current one. +The line selected from the history is the \fIevent\fP, +and the portions of that line that are acted upon are \fIwords\fP. +Various \fImodifiers\fP are available to manipulate the selected words. +The line is broken into words in the same fashion as when reading input, +so that several \fImetacharacter\fP-separated words surrounded by +quotes are considered one word. +History expansions are introduced by the appearance of the +history expansion character, which is \^\fB!\fP\^ by default. +Only backslash (\^\fB\e\fP\^) and single quotes can quote +the history expansion character. +.PP +Several characters inhibit history expansion if found immediately +following the history expansion character, even if it is unquoted: +space, tab, newline, carriage return, and \fB=\fP. +If the \fBextglob\fP shell option is enabled, \fB(\fP will also +inhibit expansion. +.PP +Several shell options settable with the +.B shopt +builtin may be used to tailor the behavior of history expansion. +If the +.B histverify +shell option is enabled (see the description of the +.B shopt +builtin below), and +.B readline +is being used, history substitutions are not immediately passed to +the shell parser. +Instead, the expanded line is reloaded into the +.B readline +editing buffer for further modification. +If +.B readline +is being used, and the +.B histreedit +shell option is enabled, a failed history substitution will be reloaded +into the +.B readline +editing buffer for correction. +The +.B \-p +option to the +.B history +builtin command may be used to see what a history expansion will +do before using it. +The +.B \-s +option to the +.B history +builtin may be used to add commands to the end of the history list +without actually executing them, so that they are available for +subsequent recall. +.PP +The shell allows control of the various characters used by the +history expansion mechanism (see the description of +.B histchars +above under +.BR "Shell Variables" ). +The shell uses +the history comment character to mark history timestamps when +writing the history file. +.SS Event Designators +.PP +An event designator is a reference to a command line entry in the +history list. +Unless the reference is absolute, events are relative to the current +position in the history list. +.PP +.PD 0 +.TP +.B ! +Start a history substitution, except when followed by a +.BR blank , +newline, carriage return, = +or ( (when the \fBextglob\fP shell option is enabled using +the \fBshopt\fP builtin). +.TP +.B !\fIn\fR +Refer to command line +.IR n . +.TP +.B !\-\fIn\fR +Refer to the current command minus +.IR n . +.TP +.B !! +Refer to the previous command. This is a synonym for `!\-1'. +.TP +.B !\fIstring\fR +Refer to the most recent command preceding the current position in the +history list starting with +.IR string . +.TP +.B !?\fIstring\fR\fB[?]\fR +Refer to the most recent command preceding the current position in the +history list containing +.IR string . +The trailing \fB?\fP may be omitted if +.I string +is followed immediately by a newline. +.TP +.B \d\s+2^\s-2\u\fIstring1\fP\d\s+2^\s-2\u\fIstring2\fP\d\s+2^\s-2\u +Quick substitution. Repeat the previous command, replacing +.I string1 +with +.IR string2 . +Equivalent to +``!!:s/\fIstring1\fP/\fIstring2\fP/'' +(see \fBModifiers\fP below). +.TP +.B !# +The entire command line typed so far. +.PD +.SS Word Designators +.PP +Word designators are used to select desired words from the event. +A +.B : +separates the event specification from the word designator. +It may be omitted if the word designator begins with a +.BR ^ , +.BR $ , +.BR * , +.BR \- , +or +.BR % . +Words are numbered from the beginning of the line, +with the first word being denoted by 0 (zero). +Words are inserted into the current line separated by single spaces. +.PP +.PD 0 +.TP +.B 0 (zero) +The zeroth word. For the shell, this is the command +word. +.TP +.I n +The \fIn\fRth word. +.TP +.B ^ +The first argument. That is, word 1. +.TP +.B $ +The last word. This is usually the last argument, but will expand to the +zeroth word if there is only one word in the line. +.TP +.B % +The word matched by the most recent `?\fIstring\fR?' search. +.TP +.I x\fB\-\fPy +A range of words; `\-\fIy\fR' abbreviates `0\-\fIy\fR'. +.TP +.B * +All of the words but the zeroth. This is a synonym +for `\fI1\-$\fP'. It is not an error to use +.B * +if there is just one +word in the event; the empty string is returned in that case. +.TP +.B x* +Abbreviates \fIx\-$\fP. +.TP +.B x\- +Abbreviates \fIx\-$\fP like \fBx*\fP, but omits the last word. +.PD +.PP +If a word designator is supplied without an event specification, the +previous command is used as the event. +.SS Modifiers +.PP +After the optional word designator, there may appear a sequence of +one or more of the following modifiers, each preceded by a `:'. +.PP +.PD 0 +.PP +.TP +.B h +Remove a trailing filename component, leaving only the head. +.TP +.B t +Remove all leading filename components, leaving the tail. +.TP +.B r +Remove a trailing suffix of the form \fI.xxx\fP, leaving the +basename. +.TP +.B e +Remove all but the trailing suffix. +.TP +.B p +Print the new command but do not execute it. +.TP +.B q +Quote the substituted words, escaping further substitutions. +.TP +.B x +Quote the substituted words as with +.BR q , +but break into words at +.B blanks +and newlines. +.TP +.B s/\fIold\fP/\fInew\fP/ +Substitute +.I new +for the first occurrence of +.I old +in the event line. Any delimiter can be used in place of /. The +final delimiter is optional if it is the last character of the +event line. The delimiter may be quoted in +.I old +and +.I new +with a single backslash. If & appears in +.IR new , +it is replaced by +.IR old . +A single backslash will quote the &. If +.I old +is null, it is set to the last +.I old +substituted, or, if no previous history substitutions took place, +the last +.I string +in a +.B !?\fIstring\fR\fB[?]\fR +search. +.TP +.B & +Repeat the previous substitution. +.TP +.B g +Cause changes to be applied over the entire event line. This is +used in conjunction with `\fB:s\fP' (e.g., `\fB:gs/\fIold\fP/\fInew\fP/\fR') +or `\fB:&\fP'. If used with +`\fB:s\fP', any delimiter can be used +in place of /, and the final delimiter is optional +if it is the last character of the event line. +An \fBa\fP may be used as a synonym for \fBg\fP. +.TP +.B G +Apply the following `\fBs\fP' modifier once to each word in the event line. +.PD +.SH "SHELL BUILTIN COMMANDS" +.\" start of bash_builtins +.zZ +.PP +Unless otherwise noted, each builtin command documented in this +section as accepting options preceded by +.B \- +accepts +.B \-\- +to signify the end of the options. +The \fB:\fP, \fBtrue\fP, \fBfalse\fP, and \fBtest\fP builtins +do not accept options and do not treat \fB\-\-\fP specially. +The \fBexit\fP, \fBlogout\fP, \fBbreak\fP, \fBcontinue\fP, \fBlet\fP, +and \fBshift\fP builtins accept and process arguments beginning with +\fB\-\fP without requiring \fB\-\-\fP. +Other builtins that accept arguments but are not specified as accepting +options interpret arguments beginning with \fB\-\fP as invalid options and +require \fB\-\-\fP to prevent this interpretation. +.sp .5 +.PD 0 +.TP +\fB:\fP [\fIarguments\fP] +.PD +No effect; the command does nothing beyond expanding +.I arguments +and performing any specified +redirections. A zero exit code is returned. +.TP +\fB .\| \fP \fIfilename\fP [\fIarguments\fP] +.PD 0 +.TP +\fBsource\fP \fIfilename\fP [\fIarguments\fP] +.PD +Read and execute commands from +.I filename +in the current +shell environment and return the exit status of the last command +executed from +.IR filename . +If +.I filename +does not contain a slash, filenames in +.SM +.B PATH +are used to find the directory containing +.IR filename . +The file searched for in +.SM +.B PATH +need not be executable. +When \fBbash\fP is not in \fIposix mode\fP, the current directory is +searched if no file is found in +.SM +.BR PATH . +If the +.B sourcepath +option to the +.B shopt +builtin command is turned off, the +.SM +.B PATH +is not searched. +If any \fIarguments\fP are supplied, they become the positional +parameters when \fIfilename\fP is executed. Otherwise the positional +parameters are unchanged. +The return status is the status of the last command exited within +the script (0 if no commands are executed), and false if +.I filename +is not found or cannot be read. +.TP +\fBalias\fP [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +\fBAlias\fP with no arguments or with the +.B \-p +option prints the list of aliases in the form +\fBalias\fP \fIname\fP=\fIvalue\fP on standard output. +When arguments are supplied, an alias is defined for +each \fIname\fP whose \fIvalue\fP is given. +A trailing space in \fIvalue\fP causes the next word to be +checked for alias substitution when the alias is expanded. +For each \fIname\fP in the argument list for which no \fIvalue\fP +is supplied, the name and value of the alias is printed. +\fBAlias\fP returns true unless a \fIname\fP is given for which +no alias has been defined. +.TP +\fBbg\fP [\fIjobspec\fP ...] +Resume each suspended job \fIjobspec\fP in the background, as if it +had been started with +.BR & . +If +.I jobspec +is not present, the shell's notion of the \fIcurrent job\fP is used. +.B bg +.I jobspec +returns 0 unless run when job control is disabled or, when run with +job control enabled, any specified \fIjobspec\fP was not found +or was started without job control. +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] [\fB\-lpsvPSVX\fP] +.PD 0 +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] [\fB\-q\fP \fIfunction\fP] [\fB\-u\fP \fIfunction\fP] [\fB\-r\fP \fIkeyseq\fP] +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fB\-f\fP \fIfilename\fP +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fB\-x\fP \fIkeyseq\fP:\fIshell\-command\fP +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fIkeyseq\fP:\fIfunction\-name\fP +.TP +\fBbind\fP \fIreadline\-command\fP +.PD +Display current +.B readline +key and function bindings, bind a key sequence to a +.B readline +function or macro, or set a +.B readline +variable. +Each non-option argument is a command as it would appear in +.IR .inputrc , +but each binding or command must be passed as a separate argument; +e.g., '"\eC\-x\eC\-r": re\-read\-init\-file'. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-m \fIkeymap\fP +Use +.I keymap +as the keymap to be affected by the subsequent bindings. +Acceptable +.I keymap +names are +\fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi, +vi\-move, vi\-command\fP, and +.IR vi\-insert . +\fIvi\fP is equivalent to \fIvi\-command\fP; \fIemacs\fP is +equivalent to \fIemacs\-standard\fP. +.TP +.B \-l +List the names of all \fBreadline\fP functions. +.TP +.B \-p +Display \fBreadline\fP function names and bindings in such a way +that they can be re-read. +.TP +.B \-P +List current \fBreadline\fP function names and bindings. +.TP +.B \-s +Display \fBreadline\fP key sequences bound to macros and the strings +they output in such a way that they can be re-read. +.TP +.B \-S +Display \fBreadline\fP key sequences bound to macros and the strings +they output. +.TP +.B \-v +Display \fBreadline\fP variable names and values in such a way that they +can be re-read. +.TP +.B \-V +List current \fBreadline\fP variable names and values. +.TP +.B \-f \fIfilename\fP +Read key bindings from \fIfilename\fP. +.TP +.B \-q \fIfunction\fP +Query about which keys invoke the named \fIfunction\fP. +.TP +.B \-u \fIfunction\fP +Unbind all keys bound to the named \fIfunction\fP. +.TP +.B \-r \fIkeyseq\fP +Remove any current binding for \fIkeyseq\fP. +.TP +.B \-x \fIkeyseq\fP:\fIshell\-command\fP +Cause \fIshell\-command\fP to be executed whenever \fIkeyseq\fP is +entered. +When \fIshell\-command\fP is executed, the shell sets the +.SM +.B READLINE_LINE +variable to the contents of the \fBreadline\fP line buffer and the +.SM +.B READLINE_POINT +variable to the current location of the insertion point. +If the executed command changes the value of +.SM +.B READLINE_LINE +or +.SM +.BR READLINE_POINT , +those new values will be reflected in the editing state. +.TP +.B \-X +List all key sequences bound to shell commands and the associated commands +in a format that can be reused as input. +.PD +.PP +The return value is 0 unless an unrecognized option is given or an +error occurred. +.RE +.TP +\fBbreak\fP [\fIn\fP] +Exit from within a +.BR for , +.BR while , +.BR until , +or +.B select +loop. If \fIn\fP is specified, break \fIn\fP levels. +.I n +must be \(>= 1. If +.I n +is greater than the number of enclosing loops, all enclosing loops +are exited. +The return value is 0 unless \fIn\fP is not greater than or equal to 1. +.TP +\fBbuiltin\fP \fIshell\-builtin\fP [\fIarguments\fP] +Execute the specified shell builtin, passing it +.IR arguments , +and return its exit status. +This is useful when defining a +function whose name is the same as a shell builtin, +retaining the functionality of the builtin within the function. +The \fBcd\fP builtin is commonly redefined this way. +The return status is false if +.I shell\-builtin +is not a shell builtin command. +.TP +\fBcaller\fP [\fIexpr\fP] +Returns the context of any active subroutine call (a shell function or +a script executed with the \fB.\fP or \fBsource\fP builtins). +Without \fIexpr\fP, \fBcaller\fP displays the line number and source +filename of the current subroutine call. +If a non-negative integer is supplied as \fIexpr\fP, \fBcaller\fP +displays the line number, subroutine name, and source file corresponding +to that position in the current execution call stack. This extra +information may be used, for example, to print a stack trace. The +current frame is frame 0. +The return value is 0 unless the shell is not executing a subroutine +call or \fIexpr\fP does not correspond to a valid position in the +call stack. +.TP +\fBcd\fP [\fB\-L\fP|[\fB\-P\fP [\fB\-e\fP]] [\-@]] [\fIdir\fP] +Change the current directory to \fIdir\fP. +if \fIdir\fP is not supplied, the value of the +.SM +.B HOME +shell variable is the default. +Any additional arguments following \fIdir\fP are ignored. +The variable +.SM +.B CDPATH +defines the search path for the directory containing +.IR dir : +each directory name in +.SM +.B CDPATH +is searched for \fIdir\fP. +Alternative directory names in +.SM +.B CDPATH +are separated by a colon (:). A null directory name in +.SM +.B CDPATH +is the same as the current directory, i.e., ``\fB.\fP''. If +.I dir +begins with a slash (/), +then +.SM +.B CDPATH +is not used. The +.B \-P +option causes \fBcd\fP to use the physical directory structure +by resolving symbolic links while traversing \fIdir\fP and +before processing instances of \fI..\fP in \fIdir\fP (see also the +.B \-P +option to the +.B set +builtin command); the +.B \-L +option forces symbolic links to be followed by resolving the link +after processing instances of \fI..\fP in \fIdir\fP. +If \fI..\fP appears in \fIdir\fP, it is processed by removing the +immediately previous pathname component from \fIdir\fP, back to a slash +or the beginning of \fIdir\fP. +If the +.B \-e +option is supplied with +.BR \-P , +and the current working directory cannot be successfully determined +after a successful directory change, \fBcd\fP will return an unsuccessful +status. +On systems that support it, the \fB\-@\fP option presents the extended +attributes associated with a file as a directory. +An argument of +.B \- +is converted to +.SM +.B $OLDPWD +before the directory change is attempted. +If a non-empty directory name from +.SM +.B CDPATH +is used, or if +\fB\-\fP is the first argument, and the directory change is +successful, the absolute pathname of the new working directory is +written to the standard output. +The return value is true if the directory was successfully changed; +false otherwise. +.TP +\fBcommand\fP [\fB\-pVv\fP] \fIcommand\fP [\fIarg\fP ...] +Run +.I command +with +.I args +suppressing the normal shell function lookup. Only builtin +commands or commands found in the +.SM +.B PATH +are executed. If the +.B \-p +option is given, the search for +.I command +is performed using a default value for +.SM +.B PATH +that is guaranteed to find all of the standard utilities. +If either the +.B \-V +or +.B \-v +option is supplied, a description of +.I command +is printed. The +.B \-v +option causes a single word indicating the command or filename +used to invoke +.I command +to be displayed; the +.B \-V +option produces a more verbose description. +If the +.B \-V +or +.B \-v +option is supplied, the exit status is 0 if +.I command +was found, and 1 if not. If neither option is supplied and +an error occurred or +.I command +cannot be found, the exit status is 127. Otherwise, the exit status of the +.B command +builtin is the exit status of +.IR command . +.TP +\fBcompgen\fP [\fIoption\fP] [\fIword\fP] +Generate possible completion matches for \fIword\fP according to +the \fIoption\fPs, which may be any option accepted by the +.B complete +builtin with the exception of \fB\-p\fP and \fB\-r\fP, and write +the matches to the standard output. +When using the \fB\-F\fP or \fB\-C\fP options, the various shell variables +set by the programmable completion facilities, while available, will not +have useful values. +.sp 1 +The matches will be generated in the same way as if the programmable +completion code had generated them directly from a completion specification +with the same flags. +If \fIword\fP is specified, only those completions matching \fIword\fP +will be displayed. +.sp 1 +The return value is true unless an invalid option is supplied, or no +matches were generated. +.TP +\fBcomplete\fP [\fB\-abcdefgjksuv\fP] [\fB\-o\fP \fIcomp-option\fP] [\fB\-DE\fP] [\fB\-A\fP \fIaction\fP] [\fB\-G\fP \fIglobpat\fP] [\fB\-W\fP \fIwordlist\fP] [\fB\-F\fP \fIfunction\fP] [\fB\-C\fP \fIcommand\fP] +.br +[\fB\-X\fP \fIfilterpat\fP] [\fB\-P\fP \fIprefix\fP] [\fB\-S\fP \fIsuffix\fP] \fIname\fP [\fIname ...\fP] +.PD 0 +.TP +\fBcomplete\fP \fB\-pr\fP [\fB\-DE\fP] [\fIname\fP ...] +.PD +Specify how arguments to each \fIname\fP should be completed. +If the \fB\-p\fP option is supplied, or if no options are supplied, +existing completion specifications are printed in a way that allows +them to be reused as input. +The \fB\-r\fP option removes a completion specification for +each \fIname\fP, or, if no \fIname\fPs are supplied, all +completion specifications. +The \fB\-D\fP option indicates that the remaining options and actions should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The \fB\-E\fP option indicates that the remaining options and actions should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +.sp 1 +The process of applying these completion specifications when word completion +is attempted is described above under \fBProgrammable Completion\fP. +.sp 1 +Other options, if specified, have the following meanings. +The arguments to the \fB\-G\fP, \fB\-W\fP, and \fB\-X\fP options +(and, if necessary, the \fB\-P\fP and \fB\-S\fP options) +should be quoted to protect them from expansion before the +.B complete +builtin is invoked. +.RS +.PD 0 +.TP 8 +\fB\-o\fP \fIcomp-option\fP +The \fIcomp-option\fP controls several aspects of the compspec's behavior +beyond the simple generation of completions. +\fIcomp-option\fP may be one of: +.RS +.TP 8 +.B bashdefault +Perform the rest of the default \fBbash\fP completions if the compspec +generates no matches. +.TP 8 +.B default +Use readline's default filename completion if the compspec generates +no matches. +.TP 8 +.B dirnames +Perform directory name completion if the compspec generates no matches. +.TP 8 +.B filenames +Tell readline that the compspec generates filenames, so it can perform any +filename\-specific processing (like adding a slash to directory names, +quoting special characters, or suppressing trailing spaces). +Intended to be used with shell functions. +.TP 8 +.B noquote +Tell readline not to quote the completed words if they are filenames +(quoting filenames is the default). +.TP 8 +.B nospace +Tell readline not to append a space (the default) to words completed at +the end of the line. +.TP 8 +.B plusdirs +After any matches defined by the compspec are generated, +directory name completion is attempted and any +matches are added to the results of the other actions. +.RE +.TP 8 +\fB\-A\fP \fIaction\fP +The \fIaction\fP may be one of the following to generate a list of possible +completions: +.RS +.TP 8 +.B alias +Alias names. May also be specified as \fB\-a\fP. +.TP 8 +.B arrayvar +Array variable names. +.TP 8 +.B binding +\fBReadline\fP key binding names. +.TP 8 +.B builtin +Names of shell builtin commands. May also be specified as \fB\-b\fP. +.TP 8 +.B command +Command names. May also be specified as \fB\-c\fP. +.TP 8 +.B directory +Directory names. May also be specified as \fB\-d\fP. +.TP 8 +.B disabled +Names of disabled shell builtins. +.TP 8 +.B enabled +Names of enabled shell builtins. +.TP 8 +.B export +Names of exported shell variables. May also be specified as \fB\-e\fP. +.TP 8 +.B file +File names. May also be specified as \fB\-f\fP. +.TP 8 +.B function +Names of shell functions. +.TP 8 +.B group +Group names. May also be specified as \fB\-g\fP. +.TP 8 +.B helptopic +Help topics as accepted by the \fBhelp\fP builtin. +.TP 8 +.B hostname +Hostnames, as taken from the file specified by the +.SM +.B HOSTFILE +shell variable. +.TP 8 +.B job +Job names, if job control is active. May also be specified as \fB\-j\fP. +.TP 8 +.B keyword +Shell reserved words. May also be specified as \fB\-k\fP. +.TP 8 +.B running +Names of running jobs, if job control is active. +.TP 8 +.B service +Service names. May also be specified as \fB\-s\fP. +.TP 8 +.B setopt +Valid arguments for the \fB\-o\fP option to the \fBset\fP builtin. +.TP 8 +.B shopt +Shell option names as accepted by the \fBshopt\fP builtin. +.TP 8 +.B signal +Signal names. +.TP 8 +.B stopped +Names of stopped jobs, if job control is active. +.TP 8 +.B user +User names. May also be specified as \fB\-u\fP. +.TP 8 +.B variable +Names of all shell variables. May also be specified as \fB\-v\fP. +.RE +.TP 8 +\fB\-C\fP \fIcommand\fP +\fIcommand\fP is executed in a subshell environment, and its output is +used as the possible completions. +.TP 8 +\fB\-F\fP \fIfunction\fP +The shell function \fIfunction\fP is executed in the current shell +environment. +When the function is executed, +the first argument (\fB$1\fP) is the name of the command whose arguments are +being completed, +the second argument (\fB$2\fP) is the word being completed, +and the third argument (\fB$3\fP) is the word preceding the word being +completed on the current command line. +When it finishes, the possible completions are retrieved from the value +of the +.SM +.B COMPREPLY +array variable. +.TP 8 +\fB\-G\fP \fIglobpat\fP +The pathname expansion pattern \fIglobpat\fP is expanded to generate +the possible completions. +.TP 8 +\fB\-P\fP \fIprefix\fP +\fIprefix\fP is added at the beginning of each possible completion +after all other options have been applied. +.TP 8 +\fB\-S\fP \fIsuffix\fP +\fIsuffix\fP is appended to each possible completion +after all other options have been applied. +.TP 8 +\fB\-W\fP \fIwordlist\fP +The \fIwordlist\fP is split using the characters in the +.SM +.B IFS +special variable as delimiters, and each resultant word is expanded. +The possible completions are the members of the resultant list which +match the word being completed. +.TP 8 +\fB\-X\fP \fIfilterpat\fP +\fIfilterpat\fP is a pattern as used for pathname expansion. +It is applied to the list of possible completions generated by the +preceding options and arguments, and each completion matching +\fIfilterpat\fP is removed from the list. +A leading \fB!\fP in \fIfilterpat\fP negates the pattern; in this +case, any completion not matching \fIfilterpat\fP is removed. +.PD +.PP +The return value is true unless an invalid option is supplied, an option +other than \fB\-p\fP or \fB\-r\fP is supplied without a \fIname\fP +argument, an attempt is made to remove a completion specification for +a \fIname\fP for which no specification exists, or +an error occurs adding a completion specification. +.RE +.TP +\fBcompopt\fP [\fB\-o\fP \fIoption\fP] [\fB\-DE\fP] [\fB+o\fP \fIoption\fP] [\fIname\fP] +Modify completion options for each \fIname\fP according to the +\fIoption\fPs, or for the +currently-executing completion if no \fIname\fPs are supplied. +If no \fIoption\fPs are given, display the completion options for each +\fIname\fP or the current completion. +The possible values of \fIoption\fP are those valid for the \fBcomplete\fP +builtin described above. +The \fB\-D\fP option indicates that the remaining options should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The \fB\-E\fP option indicates that the remaining options should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +.sp 1 +The return value is true unless an invalid option is supplied, an attempt +is made to modify the options for a \fIname\fP for which no completion +specification exists, or an output error occurs. +.TP +\fBcontinue\fP [\fIn\fP] +Resume the next iteration of the enclosing +.BR for , +.BR while , +.BR until , +or +.B select +loop. +If +.I n +is specified, resume at the \fIn\fPth enclosing loop. +.I n +must be \(>= 1. If +.I n +is greater than the number of enclosing loops, the last enclosing loop +(the ``top-level'' loop) is resumed. +The return value is 0 unless \fIn\fP is not greater than or equal to 1. +.TP +\fBdeclare\fP [\fB\-aAfFgilnrtux\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +.PD 0 +.TP +\fBtypeset\fP [\fB\-aAfFgilnrtux\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +.PD +Declare variables and/or give them attributes. +If no \fIname\fPs are given then display the values of variables. +The +.B \-p +option will display the attributes and values of each +.IR name . +When +.B \-p +is used with \fIname\fP arguments, additional options, +other than \fB\-f\fP and \fB\-F\fP, are ignored. +When +.B \-p +is supplied without \fIname\fP arguments, it will display the attributes +and values of all variables having the attributes specified by the +additional options. +If no other options are supplied with \fB\-p\fP, \fBdeclare\fP will display +the attributes and values of all shell variables. The \fB\-f\fP option +will restrict the display to shell functions. +The +.B \-F +option inhibits the display of function definitions; only the +function name and attributes are printed. +If the \fBextdebug\fP shell option is enabled using \fBshopt\fP, +the source file name and line number where the function is defined +are displayed as well. The +.B \-F +option implies +.BR \-f . +The +.B \-g +option forces variables to be created or modified at the global scope, +even when \fBdeclare\fP is executed in a shell function. +It is ignored in all other cases. +The following options can +be used to restrict output to variables with the specified attribute or +to give variables attributes: +.RS +.PD 0 +.TP +.B \-a +Each \fIname\fP is an indexed array variable (see +.B Arrays +above). +.TP +.B \-A +Each \fIname\fP is an associative array variable (see +.B Arrays +above). +.TP +.B \-f +Use function names only. +.TP +.B \-i +The variable is treated as an integer; arithmetic evaluation (see +.SM +.B "ARITHMETIC EVALUATION" +above) is performed when the variable is assigned a value. +.TP +.B \-l +When the variable is assigned a value, all upper-case characters are +converted to lower-case. +The upper-case attribute is disabled. +.TP +.B \-n +Give each \fIname\fP the \fInameref\fP attribute, making +it a name reference to another variable. +That other variable is defined by the value of \fIname\fP. +All references and assignments to \fIname\fP, except for changing the +\fB\-n\fP attribute itself, are performed on the variable referenced by +\fIname\fP's value. +The \fB\-n\fP attribute cannot be applied to array variables. +.TP +.B \-r +Make \fIname\fPs readonly. These names cannot then be assigned values +by subsequent assignment statements or unset. +.TP +.B \-t +Give each \fIname\fP the \fItrace\fP attribute. +Traced functions inherit the \fBDEBUG\fP and \fBRETURN\fP traps from +the calling shell. +The trace attribute has no special meaning for variables. +.TP +.B \-u +When the variable is assigned a value, all lower-case characters are +converted to upper-case. +The lower-case attribute is disabled. +.TP +.B \-x +Mark \fIname\fPs for export to subsequent commands via the environment. +.PD +.PP +Using `+' instead of `\-' +turns off the attribute instead, +with the exceptions that \fB+a\fP +may not be used to destroy an array variable and \fB+r\fP will not +remove the readonly attribute. +When used in a function, +.B declare +and +.B typeset +make each +\fIname\fP local, as with the +.B local +command, +unless the \fB\-g\fP option is supplied. +If a variable name is followed by =\fIvalue\fP, the value of +the variable is set to \fIvalue\fP. +When using \fB\-a\fP or \fB\-A\fP and the compound assignment syntax to +create array variables, additional attributes do not take effect until +subsequent assignments. +The return value is 0 unless an invalid option is encountered, +an attempt is made to define a function using +.if n ``\-f foo=bar'', +.if t \f(CW\-f foo=bar\fP, +an attempt is made to assign a value to a readonly variable, +an attempt is made to assign a value to an array variable without +using the compound assignment syntax (see +.B Arrays +above), one of the \fInames\fP is not a valid shell variable name, +an attempt is made to turn off readonly status for a readonly variable, +an attempt is made to turn off array status for an array variable, +or an attempt is made to display a non-existent function with \fB\-f\fP. +.RE +.TP +.B dirs [\fB\-clpv\fP] [+\fIn\fP] [\-\fIn\fP] +Without options, displays the list of currently remembered directories. +The default display is on a single line with directory names separated +by spaces. +Directories are added to the list with the +.B pushd +command; the +.B popd +command removes entries from the list. +.RS +.PD 0 +.TP +.B \-c +Clears the directory stack by deleting all of the entries. +.TP +.B \-l +Produces a listing using full pathnames; +the default listing format uses a tilde to denote the home directory. +.TP +.B \-p +Print the directory stack with one entry per line. +.TP +.B \-v +Print the directory stack with one entry per line, +prefixing each entry with its index in the stack. +.TP +\fB+\fP\fIn\fP +Displays the \fIn\fPth entry counting from the left of the list +shown by +.B dirs +when invoked without options, starting with zero. +.TP +\fB\-\fP\fIn\fP +Displays the \fIn\fPth entry counting from the right of the list +shown by +.B dirs +when invoked without options, starting with zero. +.PD +.PP +The return value is 0 unless an +invalid option is supplied or \fIn\fP indexes beyond the end +of the directory stack. +.RE +.TP +\fBdisown\fP [\fB\-ar\fP] [\fB\-h\fP] [\fIjobspec\fP ...] +Without options, remove each +.I jobspec +from the table of active jobs. +If +.I jobspec +is not present, and neither the \fB\-a\fP nor the \fB\-r\fP option +is supplied, the \fIcurrent job\fP is used. +If the \fB\-h\fP option is given, each +.I jobspec +is not removed from the table, but is marked so that +.SM +.B SIGHUP +is not sent to the job if the shell receives a +.SM +.BR SIGHUP . +If no +.I jobspec +is supplied, the +.B \-a +option means to remove or mark all jobs; the +.B \-r +option without a +.I jobspec +argument restricts operation to running jobs. +The return value is 0 unless a +.I jobspec +does not specify a valid job. +.TP +\fBecho\fP [\fB\-neE\fP] [\fIarg\fP ...] +Output the \fIarg\fPs, separated by spaces, followed by a newline. +The return status is 0 unless a write error occurs. +If \fB\-n\fP is specified, the trailing newline is +suppressed. If the \fB\-e\fP option is given, interpretation of +the following backslash-escaped characters is enabled. The +.B \-E +option disables the interpretation of these escape characters, +even on systems where they are interpreted by default. +The \fBxpg_echo\fP shell option may be used to +dynamically determine whether or not \fBecho\fP expands these +escape characters by default. +.B echo +does not interpret \fB\-\-\fP to mean the end of options. +.B echo +interprets the following escape sequences: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ec +suppress further output +.TP +.B \ee +.TP +.B \eE +an escape character +.TP +.B \ef +form feed +.TP +.B \en +new line +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\e +backslash +.TP +.B \e0\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(zero to three octal digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.TP +.B \eu\fIHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHH\fP (one to four hex digits) +.TP +.B \eU\fIHHHHHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHHHHHH\fP (one to eight hex digits) +.PD +.RE +.TP +\fBenable\fP [\fB\-a\fP] [\fB\-dnps\fP] [\fB\-f\fP \fIfilename\fP] [\fIname\fP ...] +Enable and disable builtin shell commands. +Disabling a builtin allows a disk command which has the same name +as a shell builtin to be executed without specifying a full pathname, +even though the shell normally searches for builtins before disk commands. +If \fB\-n\fP is used, each \fIname\fP +is disabled; otherwise, +\fInames\fP are enabled. For example, to use the +.B test +binary found via the +.SM +.B PATH +instead of the shell builtin version, run +.if t \f(CWenable -n test\fP. +.if n ``enable -n test''. +The +.B \-f +option means to load the new builtin command +.I name +from shared object +.IR filename , +on systems that support dynamic loading. The +.B \-d +option will delete a builtin previously loaded with +.BR \-f . +If no \fIname\fP arguments are given, or if the +.B \-p +option is supplied, a list of shell builtins is printed. +With no other option arguments, the list consists of all enabled +shell builtins. +If \fB\-n\fP is supplied, only disabled builtins are printed. +If \fB\-a\fP is supplied, the list printed includes all builtins, with an +indication of whether or not each is enabled. +If \fB\-s\fP is supplied, the output is restricted to the POSIX +\fIspecial\fP builtins. +The return value is 0 unless a +.I name +is not a shell builtin or there is an error loading a new builtin +from a shared object. +.TP +\fBeval\fP [\fIarg\fP ...] +The \fIarg\fPs are read and concatenated together into a single +command. This command is then read and executed by the shell, and +its exit status is returned as the value of +.BR eval . +If there are no +.IR args , +or only null arguments, +.B eval +returns 0. +.TP +\fBexec\fP [\fB\-cl\fP] [\fB\-a\fP \fIname\fP] [\fIcommand\fP [\fIarguments\fP]] +If +.I command +is specified, it replaces the shell. +No new process is created. The +.I arguments +become the arguments to \fIcommand\fP. +If the +.B \-l +option is supplied, +the shell places a dash at the beginning of the zeroth argument passed to +.IR command . +This is what +.IR login (1) +does. The +.B \-c +option causes +.I command +to be executed with an empty environment. If +.B \-a +is supplied, the shell passes +.I name +as the zeroth argument to the executed command. +If +.I command +cannot be executed for some reason, a non-interactive shell exits, +unless the +.B execfail +shell option +is enabled. In that case, it returns failure. +An interactive shell returns failure if the file cannot be executed. +If +.I command +is not specified, any redirections take effect in the current shell, +and the return status is 0. If there is a redirection error, the +return status is 1. +.TP +\fBexit\fP [\fIn\fP] +Cause the shell to exit +with a status of \fIn\fP. If +.I n +is omitted, the exit status +is that of the last command executed. +A trap on +.SM +.B EXIT +is executed before the shell terminates. +.TP +\fBexport\fP [\fB\-fn\fP\^] [\fIname\fP[=\fIword\fP]] ... +.PD 0 +.TP +.B export \-p +.PD +The supplied +.I names +are marked for automatic export to the environment of +subsequently executed commands. If the +.B \-f +option is given, +the +.I names +refer to functions. +If no +.I names +are given, or if the +.B \-p +option is supplied, a list +of names of all exported variables is printed. +The +.B \-n +option causes the export property to be removed from each +\fIname\fP. +If a variable name is followed by =\fIword\fP, the value of +the variable is set to \fIword\fP. +.B export +returns an exit status of 0 unless an invalid option is +encountered, +one of the \fInames\fP is not a valid shell variable name, or +.B \-f +is supplied with a +.I name +that is not a function. +.TP +\fBfc\fP [\fB\-e\fP \fIename\fP] [\fB\-lnr\fP] [\fIfirst\fP] [\fIlast\fP] +.PD 0 +.TP +\fBfc\fP \fB\-s\fP [\fIpat\fP=\fIrep\fP] [\fIcmd\fP] +.PD +The first form selects a range of commands from +.I first +to +.I last +from the history list and displays or edits and re-executes them. +.I First +and +.I last +may be specified as a string (to locate the last command beginning +with that string) or as a number (an index into the history list, +where a negative number is used as an offset from the current +command number). If +.I last +is not specified it is set to +the current command for listing (so that +.if n ``fc \-l \-10'' +.if t \f(CWfc \-l \-10\fP +prints the last 10 commands) and to +.I first +otherwise. +If +.I first +is not specified it is set to the previous +command for editing and \-16 for listing. +.sp 1 +The +.B \-n +option suppresses +the command numbers when listing. The +.B \-r +option reverses the order of +the commands. If the +.B \-l +option is given, +the commands are listed on +standard output. Otherwise, the editor given by +.I ename +is invoked +on a file containing those commands. If +.I ename +is not given, the +value of the +.SM +.B FCEDIT +variable is used, and +the value of +.SM +.B EDITOR +if +.SM +.B FCEDIT +is not set. If neither variable is set, +.FN vi +is used. When editing is complete, the edited commands are +echoed and executed. +.sp 1 +In the second form, \fIcommand\fP is re-executed after each instance +of \fIpat\fP is replaced by \fIrep\fP. +\fICommand\fP is intepreted the same as \fIfirst\fP above. +A useful alias to use with this is +.if n ``r="fc -s"'', +.if t \f(CWr='fc \-s'\fP, +so that typing +.if n ``r cc'' +.if t \f(CWr cc\fP +runs the last command beginning with +.if n ``cc'' +.if t \f(CWcc\fP +and typing +.if n ``r'' +.if t \f(CWr\fP +re-executes the last command. +.sp 1 +If the first form is used, the return value is 0 unless an invalid +option is encountered or +.I first +or +.I last +specify history lines out of range. +If the +.B \-e +option is supplied, the return value is the value of the last +command executed or failure if an error occurs with the temporary +file of commands. If the second form is used, the return status +is that of the command re-executed, unless +.I cmd +does not specify a valid history line, in which case +.B fc +returns failure. +.TP +\fBfg\fP [\fIjobspec\fP] +Resume +.I jobspec +in the foreground, and make it the current job. +If +.I jobspec +is not present, the shell's notion of the \fIcurrent job\fP is used. +The return value is that of the command placed into the foreground, +or failure if run when job control is disabled or, when run with +job control enabled, if +.I jobspec +does not specify a valid job or +.I jobspec +specifies a job that was started without job control. +.TP +\fBgetopts\fP \fIoptstring\fP \fIname\fP [\fIargs\fP] +.B getopts +is used by shell procedures to parse positional parameters. +.I optstring +contains the option characters to be recognized; if a character +is followed by a colon, the option is expected to have an +argument, which should be separated from it by white space. +The colon and question mark characters may not be used as +option characters. +Each time it is invoked, +.B getopts +places the next option in the shell variable +.IR name , +initializing +.I name +if it does not exist, +and the index of the next argument to be processed into the +variable +.SM +.BR OPTIND . +.SM +.B OPTIND +is initialized to 1 each time the shell or a shell script +is invoked. When an option requires an argument, +.B getopts +places that argument into the variable +.SM +.BR OPTARG . +The shell does not reset +.SM +.B OPTIND +automatically; it must be manually reset between multiple +calls to +.B getopts +within the same shell invocation if a new set of parameters +is to be used. +.sp 1 +When the end of options is encountered, \fBgetopts\fP exits with a +return value greater than zero. +.SM +.B OPTIND +is set to the index of the first non-option argument, +and \fIname\fP is set to ?. +.sp 1 +.B getopts +normally parses the positional parameters, but if more arguments are +given in +.IR args , +.B getopts +parses those instead. +.sp 1 +.B getopts +can report errors in two ways. If the first character of +.I optstring +is a colon, +.I silent +error reporting is used. In normal operation, diagnostic messages +are printed when invalid options or missing option arguments are +encountered. +If the variable +.SM +.B OPTERR +is set to 0, no error messages will be displayed, even if the first +character of +.I optstring +is not a colon. +.sp 1 +If an invalid option is seen, +.B getopts +places ? into +.I name +and, if not silent, +prints an error message and unsets +.SM +.BR OPTARG . +If +.B getopts +is silent, +the option character found is placed in +.SM +.B OPTARG +and no diagnostic message is printed. +.sp 1 +If a required argument is not found, and +.B getopts +is not silent, +a question mark (\^\fB?\fP\^) is placed in +.IR name , +.SM +.B OPTARG +is unset, and a diagnostic message is printed. +If +.B getopts +is silent, then a colon (\^\fB:\fP\^) is placed in +.I name +and +.SM +.B OPTARG +is set to the option character found. +.sp 1 +.B getopts +returns true if an option, specified or unspecified, is found. +It returns false if the end of options is encountered or an +error occurs. +.TP +\fBhash\fP [\fB\-lr\fP] [\fB\-p\fP \fIfilename\fP] [\fB\-dt\fP] [\fIname\fP] +Each time \fBhash\fP is invoked, +the full pathname of the command +.I name +is determined by searching +the directories in +.B $PATH +and remembered. Any previously-remembered pathname is discarded. +If the +.B \-p +option is supplied, no path search is performed, and +.I filename +is used as the full filename of the command. +The +.B \-r +option causes the shell to forget all +remembered locations. +The +.B \-d +option causes the shell to forget the remembered location of each \fIname\fP. +If the +.B \-t +option is supplied, the full pathname to which each \fIname\fP corresponds +is printed. If multiple \fIname\fP arguments are supplied with \fB\-t\fP, +the \fIname\fP is printed before the hashed full pathname. +The +.B \-l +option causes output to be displayed in a format that may be reused as input. +If no arguments are given, or if only \fB\-l\fP is supplied, +information about remembered commands is printed. +The return status is true unless a +.I name +is not found or an invalid option is supplied. +.TP +\fBhelp\fP [\fB\-dms\fP] [\fIpattern\fP] +Display helpful information about builtin commands. If +.I pattern +is specified, +.B help +gives detailed help on all commands matching +.IR pattern ; +otherwise help for all the builtins and shell control structures +is printed. +.RS +.PD 0 +.TP +.B \-d +Display a short description of each \fIpattern\fP +.TP +.B \-m +Display the description of each \fIpattern\fP in a manpage-like format +.TP +.B \-s +Display only a short usage synopsis for each \fIpattern\fP +.PD +.PP +The return status is 0 unless no command matches +.IR pattern . +.RE +.TP +\fBhistory [\fIn\fP] +.PD 0 +.TP +\fBhistory\fP \fB\-c\fP +.TP +\fBhistory \-d\fP \fIoffset\fP +.TP +\fBhistory\fP \fB\-anrw\fP [\fIfilename\fP] +.TP +\fBhistory\fP \fB\-p\fP \fIarg\fP [\fIarg ...\fP] +.TP +\fBhistory\fP \fB\-s\fP \fIarg\fP [\fIarg ...\fP] +.PD +With no options, display the command +history list with line numbers. Lines listed +with a +.B * +have been modified. An argument of +.I n +lists only the last +.I n +lines. +If the shell variable +.SM +.B HISTTIMEFORMAT +is set and not null, +it is used as a format string for \fIstrftime\fP(3) to display +the time stamp associated with each displayed history entry. +No intervening blank is printed between the formatted time stamp +and the history line. +If \fIfilename\fP is supplied, it is used as the +name of the history file; if not, the value of +.SM +.B HISTFILE +is used. Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-c +Clear the history list by deleting all the entries. +.TP +\fB\-d\fP \fIoffset\fP +Delete the history entry at position \fIoffset\fP. +.TP +.B \-a +Append the ``new'' history lines (history lines entered since the +beginning of the current \fBbash\fP session) to the history file. +.TP +.B \-n +Read the history lines not already read from the history +file into the current history list. These are lines +appended to the history file since the beginning of the +current \fBbash\fP session. +.TP +.B \-r +Read the contents of the history file +and append them to the current history list. +.TP +.B \-w +Write the current history list to the history file, overwriting the +history file's contents. +.TP +.B \-p +Perform history substitution on the following \fIargs\fP and display +the result on the standard output. +Does not store the results in the history list. +Each \fIarg\fP must be quoted to disable normal history expansion. +.TP +.B \-s +Store the +.I args +in the history list as a single entry. The last command in the +history list is removed before the +.I args +are added. +.PD +.PP +If the +.SM +.B HISTTIMEFORMAT +variable is set, the time stamp information +associated with each history entry is written to the history file, +marked with the history comment character. +When the history file is read, lines beginning with the history +comment character followed immediately by a digit are interpreted +as timestamps for the previous history line. +The return value is 0 unless an invalid option is encountered, an +error occurs while reading or writing the history file, an invalid +\fIoffset\fP is supplied as an argument to \fB\-d\fP, or the +history expansion supplied as an argument to \fB\-p\fP fails. +.RE +.TP +\fBjobs\fP [\fB\-lnprs\fP] [ \fIjobspec\fP ... ] +.PD 0 +.TP +\fBjobs\fP \fB\-x\fP \fIcommand\fP [ \fIargs\fP ... ] +.PD +The first form lists the active jobs. The options have the following +meanings: +.RS +.PD 0 +.TP +.B \-l +List process IDs +in addition to the normal information. +.TP +.B \-n +Display information only about jobs that have changed status since +the user was last notified of their status. +.TP +.B \-p +List only the process ID of the job's process group +leader. +.TP +.B \-r +Display only running jobs. +.TP +.B \-s +Display only stopped jobs. +.PD +.PP +If +.I jobspec +is given, output is restricted to information about that job. +The return status is 0 unless an invalid option is encountered +or an invalid +.I jobspec +is supplied. +.PP +If the +.B \-x +option is supplied, +.B jobs +replaces any +.I jobspec +found in +.I command +or +.I args +with the corresponding process group ID, and executes +.I command +passing it +.IR args , +returning its exit status. +.RE +.TP +\fBkill\fP [\fB\-s\fP \fIsigspec\fP | \fB\-n\fP \fIsignum\fP | \fB\-\fP\fIsigspec\fP] [\fIpid\fP | \fIjobspec\fP] ... +.PD 0 +.TP +\fBkill\fP \fB\-l\fP [\fIsigspec\fP | \fIexit_status\fP] +.PD +Send the signal named by +.I sigspec +or +.I signum +to the processes named by +.I pid +or +.IR jobspec . +.I sigspec +is either a case-insensitive signal name such as +.SM +.B SIGKILL +(with or without the +.SM +.B SIG +prefix) or a signal number; +.I signum +is a signal number. +If +.I sigspec +is not present, then +.SM +.B SIGTERM +is assumed. +An argument of +.B \-l +lists the signal names. +If any arguments are supplied when +.B \-l +is given, the names of the signals corresponding to the arguments are +listed, and the return status is 0. +The \fIexit_status\fP argument to +.B \-l +is a number specifying either a signal number or the exit status of +a process terminated by a signal. +.B kill +returns true if at least one signal was successfully sent, or false +if an error occurs or an invalid option is encountered. +.TP +\fBlet\fP \fIarg\fP [\fIarg\fP ...] +Each +.I arg +is an arithmetic expression to be evaluated (see +.SM +.B "ARITHMETIC EVALUATION" +above). +If the last +.I arg +evaluates to 0, +.B let +returns 1; 0 is returned otherwise. +.TP +\fBlocal\fP [\fIoption\fP] [\fIname\fP[=\fIvalue\fP] ...] +For each argument, a local variable named +.I name +is created, and assigned +.IR value . +The \fIoption\fP can be any of the options accepted by \fBdeclare\fP. +When +.B local +is used within a function, it causes the variable +.I name +to have a visible scope restricted to that function and its children. +With no operands, +.B local +writes a list of local variables to the standard output. It is +an error to use +.B local +when not within a function. The return status is 0 unless +.B local +is used outside a function, an invalid +.I name +is supplied, or +\fIname\fP is a readonly variable. +.TP +.B logout +Exit a login shell. +.TP +\fBmapfile\fP [\fB\-n\fP \fIcount\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-s\fP \fIcount\fP] [\fB\-t\fP] [\fB\-u\fP \fIfd\fP] [\fB\-C\fP \fIcallback\fP] [\fB\-c\fP \fIquantum\fP] [\fIarray\fP] +.PD 0 +.TP +\fBreadarray\fP [\fB\-n\fP \fIcount\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-s\fP \fIcount\fP] [\fB\-t\fP] [\fB\-u\fP \fIfd\fP] [\fB\-C\fP \fIcallback\fP] [\fB\-c\fP \fIquantum\fP] [\fIarray\fP] +.PD +Read lines from the standard input into the indexed array variable +.IR array , +or from file descriptor +.IR fd +if the +.B \-u +option is supplied. +The variable +.SM +.B MAPFILE +is the default \fIarray\fP. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Copy at most +.I count +lines. If \fIcount\fP is 0, all lines are copied. +.TP +.B \-O +Begin assigning to +.I array +at index +.IR origin . +The default index is 0. +.TP +.B \-s +Discard the first \fIcount\fP lines read. +.TP +.B \-t +Remove a trailing newline from each line read. +.TP +.B \-u +Read lines from file descriptor \fIfd\fP instead of the standard input. +.TP +.B \-C +Evaluate +.I callback +each time \fIquantum\fP lines are read. The \fB\-c\fP option specifies +.IR quantum . +.TP +.B \-c +Specify the number of lines read between each call to +.IR callback . +.PD +.PP +If +.B \-C +is specified without +.BR \-c , +the default quantum is 5000. +When \fIcallback\fP is evaluated, it is supplied the index of the next +array element to be assigned and the line to be assigned to that element +as additional arguments. +\fIcallback\fP is evaluated after the line is read but before the +array element is assigned. +.PP +If not supplied with an explicit origin, \fBmapfile\fP will clear \fIarray\fP +before assigning to it. +.PP +\fBmapfile\fP returns successfully unless an invalid option or option +argument is supplied, \fIarray\fP is invalid or unassignable, or if +\fIarray\fP is not an indexed array. +.RE +.TP +\fBpopd\fP [\-\fBn\fP] [+\fIn\fP] [\-\fIn\fP] +Removes entries from the directory stack. With no arguments, +removes the top directory from the stack, and performs a +.B cd +to the new top directory. +Arguments, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Suppresses the normal change of directory when removing directories +from the stack, so that only the stack is manipulated. +.TP +\fB+\fP\fIn\fP +Removes the \fIn\fPth entry counting from the left of the list +shown by +.BR dirs , +starting with zero. For example: +.if n ``popd +0'' +.if t \f(CWpopd +0\fP +removes the first directory, +.if n ``popd +1'' +.if t \f(CWpopd +1\fP +the second. +.TP +\fB\-\fP\fIn\fP +Removes the \fIn\fPth entry counting from the right of the list +shown by +.BR dirs , +starting with zero. For example: +.if n ``popd -0'' +.if t \f(CWpopd -0\fP +removes the last directory, +.if n ``popd -1'' +.if t \f(CWpopd -1\fP +the next to last. +.PD +.PP +If the +.B popd +command is successful, a +.B dirs +is performed as well, and the return status is 0. +.B popd +returns false if an invalid option is encountered, the directory stack +is empty, a non-existent directory stack entry is specified, or the +directory change fails. +.RE +.TP +\fBprintf\fP [\fB\-v\fP \fIvar\fP] \fIformat\fP [\fIarguments\fP] +Write the formatted \fIarguments\fP to the standard output under the +control of the \fIformat\fP. +The \fB\-v\fP option causes the output to be assigned to the variable +\fIvar\fP rather than being printed to the standard output. +.sp 1 +The \fIformat\fP is a character string which contains three types of objects: +plain characters, which are simply copied to standard output, character +escape sequences, which are converted and copied to the standard output, and +format specifications, each of which causes printing of the next successive +\fIargument\fP. +In addition to the standard \fIprintf\fP(1) format specifications, +\fBprintf\fP interprets the following extensions: +.RS +.PD 0 +.TP +.B %b +causes +\fBprintf\fP to expand backslash escape sequences in the corresponding +\fIargument\fP (except that \fB\ec\fP terminates output, backslashes in +\fB\e\(aq\fP, \fB\e"\fP, and \fB\e?\fP are not removed, and octal escapes +beginning with \fB\e0\fP may contain up to four digits). +.TP +.B %q +causes \fBprintf\fP to output the corresponding +\fIargument\fP in a format that can be reused as shell input. +.TP +.B %(\fIdatefmt\fP)T +causes \fBprintf\fP to output the date-time string resulting from using +\fIdatefmt\fP as a format string for \fIstrftime\fP(3). +The corresponding \fIargument\fP is an integer representing the number of +seconds since the epoch. +Two special argument values may be used: -1 represents the current +time, and -2 represents the time the shell was invoked. +If no argument is specified, conversion behaves as if -1 had been given. +This is an exception to the usual \fBprintf\fP behavior. +.PD +.PP +Arguments to non-string format specifiers are treated as C constants, +except that a leading plus or minus sign is allowed, and if the leading +character is a single or double quote, the value is the ASCII value of +the following character. +.PP +The \fIformat\fP is reused as necessary to consume all of the \fIarguments\fP. +If the \fIformat\fP requires more \fIarguments\fP than are supplied, the +extra format specifications behave as if a zero value or null string, as +appropriate, had been supplied. +The return value is zero on success, non-zero on failure. +.RE +.TP +\fBpushd\fP [\fB\-n\fP] [+\fIn\fP] [\-\fIn\fP] +.PD 0 +.TP +\fBpushd\fP [\fB\-n\fP] [\fIdir\fP] +.PD +Adds a directory to the top of the directory stack, or rotates +the stack, making the new top of the stack the current working +directory. With no arguments, exchanges the top two directories +and returns 0, unless the directory stack is empty. +Arguments, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Suppresses the normal change of directory when adding directories +to the stack, so that only the stack is manipulated. +.TP +\fB+\fP\fIn\fP +Rotates the stack so that the \fIn\fPth directory +(counting from the left of the list shown by +.BR dirs , +starting with zero) +is at the top. +.TP +\fB\-\fP\fIn\fP +Rotates the stack so that the \fIn\fPth directory +(counting from the right of the list shown by +.BR dirs , +starting with zero) is at the top. +.TP +.I dir +Adds +.I dir +to the directory stack at the top, making it the +new current working directory as if it had been supplied as the argument +to the \fBcd\fP builtin. +.PD +.PP +If the +.B pushd +command is successful, a +.B dirs +is performed as well. +If the first form is used, +.B pushd +returns 0 unless the cd to +.I dir +fails. With the second form, +.B pushd +returns 0 unless the directory stack is empty, +a non-existent directory stack element is specified, +or the directory change to the specified new current directory +fails. +.RE +.TP +\fBpwd\fP [\fB\-LP\fP] +Print the absolute pathname of the current working directory. +The pathname printed contains no symbolic links if the +.B \-P +option is supplied or the +.B \-o physical +option to the +.B set +builtin command is enabled. +If the +.B \-L +option is used, the pathname printed may contain symbolic links. +The return status is 0 unless an error occurs while +reading the name of the current directory or an +invalid option is supplied. +.TP +\fBread\fP [\fB\-ers\fP] [\fB\-a\fP \fIaname\fP] [\fB\-d\fP \fIdelim\fP] [\fB\-i\fP \fItext\fP] [\fB\-n\fP \fInchars\fP] [\fB\-N\fP \fInchars\fP] [\fB\-p\fP \fIprompt\fP] [\fB\-t\fP \fItimeout\fP] [\fB\-u\fP \fIfd\fP] [\fIname\fP ...] +One line is read from the standard input, or from the file descriptor +\fIfd\fP supplied as an argument to the \fB\-u\fP option, and the first word +is assigned to the first +.IR name , +the second word to the second +.IR name , +and so on, with leftover words and their intervening separators assigned +to the last +.IR name . +If there are fewer words read from the input stream than names, +the remaining names are assigned empty values. +The characters in +.SM +.B IFS +are used to split the line into words using the same rules the shell +uses for expansion (described above under \fBWord Splitting\fP). +The backslash character (\fB\e\fP) may be used to remove any special +meaning for the next character read and for line continuation. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-a \fIaname\fP +The words are assigned to sequential indices +of the array variable +.IR aname , +starting at 0. +.I aname +is unset before any new values are assigned. +Other \fIname\fP arguments are ignored. +.TP +.B \-d \fIdelim\fP +The first character of \fIdelim\fP is used to terminate the input line, +rather than newline. +.TP +.B \-e +If the standard input +is coming from a terminal, +.B readline +(see +.SM +.B READLINE +above) is used to obtain the line. +Readline uses the current (or default, if line editing was not previously +active) editing settings. +.TP +.B \-i \fItext\fP +If +.B readline +is being used to read the line, \fItext\fP is placed into the editing +buffer before editing begins. +.TP +.B \-n \fInchars\fP +\fBread\fP returns after reading \fInchars\fP characters rather than +waiting for a complete line of input, but honor a delimiter if fewer +than \fInchars\fP characters are read before the delimiter. +.TP +.B \-N \fInchars\fP +\fBread\fP returns after reading exactly \fInchars\fP characters rather +than waiting for a complete line of input, unless EOF is encountered or +\fBread\fP times out. +Delimiter characters encountered in the input are +not treated specially and do not cause \fBread\fP to return until +\fInchars\fP characters are read. +.TP +.B \-p \fIprompt\fP +Display \fIprompt\fP on standard error, without a +trailing newline, before attempting to read any input. The prompt +is displayed only if input is coming from a terminal. +.TP +.B \-r +Backslash does not act as an escape character. +The backslash is considered to be part of the line. +In particular, a backslash-newline pair may not be used as a line +continuation. +.TP +.B \-s +Silent mode. If input is coming from a terminal, characters are +not echoed. +.TP +.B \-t \fItimeout\fP +Cause \fBread\fP to time out and return failure if a complete line of +input (or a specified number of characters) +is not read within \fItimeout\fP seconds. +\fItimeout\fP may be a decimal number with a fractional portion following +the decimal point. +This option is only effective if \fBread\fP is reading input from a +terminal, pipe, or other special file; it has no effect when reading +from regular files. +If \fBread\fP times out, \fBread\fP saves any partial input read into +the specified variable \fIname\fP. +If \fItimeout\fP is 0, \fBread\fP returns immediately, without trying to +read any data. The exit status is 0 if input is available on +the specified file descriptor, non-zero otherwise. +The exit status is greater than 128 if the timeout is exceeded. +.TP +.B \-u \fIfd\fP +Read input from file descriptor \fIfd\fP. +.PD +.PP +If no +.I names +are supplied, the line read is assigned to the variable +.SM +.BR REPLY . +The return code is zero, unless end-of-file is encountered, \fBread\fP +times out (in which case the return code is greater than 128), +a variable assignment error (such as assigning to a readonly variable) occurs, +or an invalid file descriptor is supplied as the argument to \fB\-u\fP. +.RE +.TP +\fBreadonly\fP [\fB\-aAf\fP] [\fB\-p\fP] [\fIname\fP[=\fIword\fP] ...] +.PD +The given +\fInames\fP are marked readonly; the values of these +.I names +may not be changed by subsequent assignment. +If the +.B \-f +option is supplied, the functions corresponding to the +\fInames\fP are so +marked. +The +.B \-a +option restricts the variables to indexed arrays; the +.B \-A +option restricts the variables to associative arrays. +If both options are supplied, +.B \-A +takes precedence. +If no +.I name +arguments are given, or if the +.B \-p +option is supplied, a list of all readonly names is printed. +The other options may be used to restrict the output to a subset of +the set of readonly names. +The +.B \-p +option causes output to be displayed in a format that +may be reused as input. +If a variable name is followed by =\fIword\fP, the value of +the variable is set to \fIword\fP. +The return status is 0 unless an invalid option is encountered, +one of the +.I names +is not a valid shell variable name, or +.B \-f +is supplied with a +.I name +that is not a function. +.TP +\fBreturn\fP [\fIn\fP] +Causes a function to stop executing and return the value specified by +.I n +to its caller. +If +.I n +is omitted, the return status is that of the last command +executed in the function body. If +.B return +is used outside a function, +but during execution of a script by the +.B . +(\fBsource\fP) command, it causes the shell to stop executing +that script and return either +.I n +or the exit status of the last command executed within the +script as the exit status of the script. +If \fIn\fP is supplied, the return value is its least significant +8 bits. +The return status is non-zero if +.B return +is supplied a non-numeric argument, or +is used outside a +function and not during execution of a script by \fB.\fP\^ or \fBsource\fP. +Any command associated with the \fBRETURN\fP trap is executed +before execution resumes after the function or script. +.TP +\fBset\fP [\fB\-\-abefhkmnptuvxBCEHPT\fP] [\fB\-o\fP \fIoption\-name\fP] [\fIarg\fP ...] +.PD 0 +.TP +\fBset\fP [\fB+abefhkmnptuvxBCEHPT\fP] [\fB+o\fP \fIoption\-name\fP] [\fIarg\fP ...] +.PD +Without options, the name and value of each shell variable are displayed +in a format that can be reused as input +for setting or resetting the currently-set variables. +Read-only variables cannot be reset. +In \fIposix\fP mode, only shell variables are listed. +The output is sorted according to the current locale. +When options are specified, they set or unset shell attributes. +Any arguments remaining after option processing are treated +as values for the positional parameters and are assigned, in order, to +.BR $1 , +.BR $2 , +.B ... +.BR $\fIn\fP . +Options, if specified, have the following meanings: +.RS +.PD 0 +.TP 8 +.B \-a +Automatically mark variables and functions which are modified or +created for export to the environment of subsequent commands. +.TP 8 +.B \-b +Report the status of terminated background jobs +immediately, rather than before the next primary prompt. This is +effective only when job control is enabled. +.TP 8 +.B \-e +Exit immediately if a +\fIpipeline\fP (which may consist of a single \fIsimple command\fP), +a \fIlist\fP, +or a \fIcompound command\fP +(see +.SM +.B SHELL GRAMMAR +above), exits with a non-zero status. +The shell does not exit if the +command that fails is part of the command list immediately following a +.B while +or +.B until +keyword, +part of the test following the +.B if +or +.B elif +reserved words, part of any command executed in a +.B && +or +.B || +list except the command following the final \fB&&\fP or \fB||\fP, +any command in a pipeline but the last, +or if the command's return value is +being inverted with +.BR ! . +If a compound command other than a subshell +returns a non-zero status because a command failed +while \fB\-e\fP was being ignored, the shell does not exit. +A trap on \fBERR\fP, if set, is executed before the shell exits. +This option applies to the shell environment and each subshell environment +separately (see +.SM +.B "COMMAND EXECUTION ENVIRONMENT" +above), and may cause +subshells to exit before executing all the commands in the subshell. +.if t .sp 0.5 +.if n .sp 1 +If a compound command or shell function executes in a context +where \fB\-e\fP is being ignored, +none of the commands executed within the compound command or function body +will be affected by the \fB\-e\fP setting, even if \fB\-e\fP is set +and a command returns a failure status. +If a compound command or shell function sets \fB\-e\fP while executing in +a context where \fB\-e\fP is ignored, that setting will not have any +effect until the compound command or the command containing the function +call completes. +.TP 8 +.B \-f +Disable pathname expansion. +.TP 8 +.B \-h +Remember the location of commands as they are looked up for execution. +This is enabled by default. +.TP 8 +.B \-k +All arguments in the form of assignment statements +are placed in the environment for a command, not just +those that precede the command name. +.TP 8 +.B \-m +Monitor mode. Job control is enabled. This option is on +by default for interactive shells on systems that support +it (see +.SM +.B JOB CONTROL +above). +All processes run in a separate process group. +When a background job completes, the shell prints a line +containing its exit status. +.TP 8 +.B \-n +Read commands but do not execute them. This may be used to +check a shell script for syntax errors. This is ignored by +interactive shells. +.TP 8 +.B \-o \fIoption\-name\fP +The \fIoption\-name\fP can be one of the following: +.RS +.TP 8 +.B allexport +Same as +.BR \-a . +.TP 8 +.B braceexpand +Same as +.BR \-B . +.TP 8 +.B emacs +Use an emacs-style command line editing interface. This is enabled +by default when the shell is interactive, unless the shell is started +with the +.B \-\-noediting +option. +This also affects the editing interface used for \fBread \-e\fP. +.TP 8 +.B errexit +Same as +.BR \-e . +.TP 8 +.B errtrace +Same as +.BR \-E . +.TP 8 +.B functrace +Same as +.BR \-T . +.TP 8 +.B hashall +Same as +.BR \-h . +.TP 8 +.B histexpand +Same as +.BR \-H . +.TP 8 +.B history +Enable command history, as described above under +.SM +.BR HISTORY . +This option is on by default in interactive shells. +.TP 8 +.B ignoreeof +The effect is as if the shell command +.if t \f(CWIGNOREEOF=10\fP +.if n ``IGNOREEOF=10'' +had been executed +(see +.B Shell Variables +above). +.TP 8 +.B keyword +Same as +.BR \-k . +.TP 8 +.B monitor +Same as +.BR \-m . +.TP 8 +.B noclobber +Same as +.BR \-C . +.TP 8 +.B noexec +Same as +.BR \-n . +.TP 8 +.B noglob +Same as +.BR \-f . +.TP 8 +.B nolog +Currently ignored. +.TP 8 +.B notify +Same as +.BR \-b . +.TP 8 +.B nounset +Same as +.BR \-u . +.TP 8 +.B onecmd +Same as +.BR \-t . +.TP 8 +.B physical +Same as +.BR \-P . +.TP 8 +.B pipefail +If set, the return value of a pipeline is the value of the last +(rightmost) command to exit with a non-zero status, or zero if all +commands in the pipeline exit successfully. +This option is disabled by default. +.TP 8 +.B posix +Change the behavior of +.B bash +where the default operation differs +from the POSIX standard to match the standard (\fIposix mode\fP). +See +.SM +.B "SEE ALSO" +below for a reference to a document that details how posix mode affects +bash's behavior. +.TP 8 +.B privileged +Same as +.BR \-p . +.TP 8 +.B verbose +Same as +.BR \-v . +.TP 8 +.B vi +Use a vi-style command line editing interface. +This also affects the editing interface used for \fBread \-e\fP. +.TP 8 +.B xtrace +Same as +.BR \-x . +.sp .5 +.PP +If +.B \-o +is supplied with no \fIoption\-name\fP, the values of the current options are +printed. +If +.B +o +is supplied with no \fIoption\-name\fP, a series of +.B set +commands to recreate the current option settings is displayed on +the standard output. +.RE +.TP 8 +.B \-p +Turn on +.I privileged +mode. In this mode, the +.SM +.B $ENV +and +.SM +.B $BASH_ENV +files are not processed, shell functions are not inherited from the +environment, and the +.SM +.BR SHELLOPTS , +.SM +.BR BASHOPTS , +.SM +.BR CDPATH , +and +.SM +.B GLOBIGNORE +variables, if they appear in the environment, are ignored. +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the \fB\-p\fP option is not supplied, these actions +are taken and the effective user id is set to the real user id. +If the \fB\-p\fP option is supplied at startup, the effective user id is +not reset. +Turning this option off causes the effective user +and group ids to be set to the real user and group ids. +.TP 8 +.B \-t +Exit after reading and executing one command. +.TP 8 +.B \-u +Treat unset variables and parameters other than the special +parameters "@" and "*" as an error when performing +parameter expansion. If expansion is attempted on an +unset variable or parameter, the shell prints an error message, and, +if not interactive, exits with a non-zero status. +.TP 8 +.B \-v +Print shell input lines as they are read. +.TP 8 +.B \-x +After expanding each \fIsimple command\fP, +\fBfor\fP command, \fBcase\fP command, \fBselect\fP command, or +arithmetic \fBfor\fP command, display the expanded value of +.SM +.BR PS4 , +followed by the command and its expanded arguments +or associated word list. +.TP 8 +.B \-B +The shell performs brace expansion (see +.B Brace Expansion +above). This is on by default. +.TP 8 +.B \-C +If set, +.B bash +does not overwrite an existing file with the +.BR > , +.BR >& , +and +.B <> +redirection operators. This may be overridden when +creating output files by using the redirection operator +.B >| +instead of +.BR > . +.TP 8 +.B \-E +If set, any trap on \fBERR\fP is inherited by shell functions, command +substitutions, and commands executed in a subshell environment. +The \fBERR\fP trap is normally not inherited in such cases. +.TP 8 +.B \-H +Enable +.B ! +style history substitution. This option is on by +default when the shell is interactive. +.TP 8 +.B \-P +If set, the shell does not resolve symbolic links when executing +commands such as +.B cd +that change the current working directory. It uses the +physical directory structure instead. By default, +.B bash +follows the logical chain of directories when performing commands +which change the current directory. +.TP 8 +.B \-T +If set, any traps on \fBDEBUG\fP and \fBRETURN\fP are inherited by shell +functions, command substitutions, and commands executed in a +subshell environment. +The \fBDEBUG\fP and \fBRETURN\fP traps are normally not inherited +in such cases. +.TP 8 +.B \-\- +If no arguments follow this option, then the positional parameters are +unset. Otherwise, the positional parameters are set to the +\fIarg\fPs, even if some of them begin with a +.BR \- . +.TP 8 +.B \- +Signal the end of options, cause all remaining \fIarg\fPs to be +assigned to the positional parameters. The +.B \-x +and +.B \-v +options are turned off. +If there are no \fIarg\fPs, +the positional parameters remain unchanged. +.PD +.PP +The options are off by default unless otherwise noted. +Using + rather than \- causes these options to be turned off. +The options can also be specified as arguments to an invocation of +the shell. +The current set of options may be found in +.BR $\- . +The return status is always true unless an invalid option is encountered. +.RE +.TP +\fBshift\fP [\fIn\fP] +The positional parameters from \fIn\fP+1 ... are renamed to +.B $1 +.B .... +Parameters represented by the numbers \fB$#\fP +down to \fB$#\fP\-\fIn\fP+1 are unset. +.I n +must be a non-negative number less than or equal to \fB$#\fP. +If +.I n +is 0, no parameters are changed. +If +.I n +is not given, it is assumed to be 1. +If +.I n +is greater than \fB$#\fP, the positional parameters are not changed. +The return status is greater than zero if +.I n +is greater than +.B $# +or less than zero; otherwise 0. +.TP +\fBshopt\fP [\fB\-pqsu\fP] [\fB\-o\fP] [\fIoptname\fP ...] +Toggle the values of settings controlling optional shell behavior. +The settings can be either those listed below, or, if the +.B \-o +option is used, those available with the +.B \-o +option to the \fBset\fP builtin command. +With no options, or with the +.B \-p +option, a list of all settable options is displayed, with +an indication of whether or not each is set. +The \fB\-p\fP option causes output to be displayed in a form that +may be reused as input. +Other options have the following meanings: +.RS +.PD 0 +.TP +.B \-s +Enable (set) each \fIoptname\fP. +.TP +.B \-u +Disable (unset) each \fIoptname\fP. +.TP +.B \-q +Suppresses normal output (quiet mode); the return status indicates +whether the \fIoptname\fP is set or unset. +If multiple \fIoptname\fP arguments are given with +.BR \-q , +the return status is zero if all \fIoptnames\fP are enabled; non-zero +otherwise. +.TP +.B \-o +Restricts the values of \fIoptname\fP to be those defined for the +.B \-o +option to the +.B set +builtin. +.PD +.PP +If either +.B \-s +or +.B \-u +is used with no \fIoptname\fP arguments, +.B shopt +shows only those options which are set or unset, respectively. +Unless otherwise noted, the \fBshopt\fP options are disabled (unset) +by default. +.PP +The return status when listing options is zero if all \fIoptnames\fP +are enabled, non-zero otherwise. When setting or unsetting options, +the return status is zero unless an \fIoptname\fP is not a valid shell +option. +.PP +The list of \fBshopt\fP options is: +.if t .sp .5v +.if n .sp 1v +.PD 0 +.TP 8 +.B autocd +If set, a command name that is the name of a directory is executed as if +it were the argument to the \fBcd\fP command. +This option is only used by interactive shells. +.TP 8 +.B cdable_vars +If set, an argument to the +.B cd +builtin command that +is not a directory is assumed to be the name of a variable whose +value is the directory to change to. +.TP 8 +.B cdspell +If set, minor errors in the spelling of a directory component in a +.B cd +command will be corrected. +The errors checked for are transposed characters, +a missing character, and one character too many. +If a correction is found, the corrected filename is printed, +and the command proceeds. +This option is only used by interactive shells. +.TP 8 +.B checkhash +If set, \fBbash\fP checks that a command found in the hash +table exists before trying to execute it. If a hashed command no +longer exists, a normal path search is performed. +.TP 8 +.B checkjobs +If set, \fBbash\fP lists the status of any stopped and running jobs before +exiting an interactive shell. If any jobs are running, this causes +the exit to be deferred until a second exit is attempted without an +intervening command (see +.SM +.B "JOB CONTROL" +above). The shell always +postpones exiting if any jobs are stopped. +.TP 8 +.B checkwinsize +If set, \fBbash\fP checks the window size after each command +and, if necessary, updates the values of +.SM +.B LINES +and +.SM +.BR COLUMNS . +.TP 8 +.B cmdhist +If set, +.B bash +attempts to save all lines of a multiple-line +command in the same history entry. This allows +easy re-editing of multi-line commands. +.TP 8 +.B compat31 +If set, +.B bash +changes its behavior to that of version 3.1 with respect to quoted +arguments to the \fB[[\fP conditional command's \fB=~\fP operator +and locale-specific string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators. +Bash versions prior to bash-4.1 use ASCII collation and +.IR strcmp (3); +bash-4.1 and later use the current locale's collation sequence and +.IR strcoll (3). +.TP 8 +.B compat32 +If set, +.B bash +changes its behavior to that of version 3.2 with respect to +locale-specific string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators (see previous item). +.TP 8 +.B compat40 +If set, +.B bash +changes its behavior to that of version 4.0 with respect to locale-specific +string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators (see description of +\fBcompat31\fP) +and the effect of interrupting a command list. +Bash versions 4.0 and later interrupt the list as if the shell received the +interrupt; previous versions continue with the next command in the list. +.TP 8 +.B compat41 +If set, +.BR bash , +when in \fIposix\fP mode, treats a single quote in a double-quoted +parameter expansion as a special character. The single quotes must match +(an even number) and the characters between the single quotes are considered +quoted. This is the behavior of posix mode through version 4.1. +The default bash behavior remains as in previous versions. +.TP 8 +.B compat42 +If set, +.B bash +does not process the replacement string in the pattern substitution word +expansion using quote removal. +.TP 8 +.B complete_fullquote +If set, +.B bash +quotes all shell metacharacters in filenames and directory names when +performing completion. +If not set, +.B bash +removes metacharacters such as the dollar sign from the set of +characters that will be quoted in completed filenames +when these metacharacters appear in shell variable references in words to be +completed. +This means that dollar signs in variable names that expand to directories +will not be quoted; +however, any dollar signs appearing in filenames will not be quoted, either. +This is active only when bash is using backslashes to quote completed +filenames. +This variable is set by default, which is the default bash behavior in +versions through 4.2. +.TP 8 +.B direxpand +If set, +.B bash +replaces directory names with the results of word expansion when performing +filename completion. This changes the contents of the readline editing +buffer. +If not set, +.B bash +attempts to preserve what the user typed. +.TP 8 +.B dirspell +If set, +.B bash +attempts spelling correction on directory names during word completion +if the directory name initially supplied does not exist. +.TP 8 +.B dotglob +If set, +.B bash +includes filenames beginning with a `.' in the results of pathname +expansion. +.TP 8 +.B execfail +If set, a non-interactive shell will not exit if +it cannot execute the file specified as an argument to the +.B exec +builtin command. An interactive shell does not exit if +.B exec +fails. +.TP 8 +.B expand_aliases +If set, aliases are expanded as described above under +.SM +.BR ALIASES . +This option is enabled by default for interactive shells. +.TP 8 +.B extdebug +If set, behavior intended for use by debuggers is enabled: +.RS +.TP +.B 1. +The \fB\-F\fP option to the \fBdeclare\fP builtin displays the source +file name and line number corresponding to each function name supplied +as an argument. +.TP +.B 2. +If the command run by the \fBDEBUG\fP trap returns a non-zero value, the +next command is skipped and not executed. +.TP +.B 3. +If the command run by the \fBDEBUG\fP trap returns a value of 2, and the +shell is executing in a subroutine (a shell function or a shell script +executed by the \fB.\fP or \fBsource\fP builtins), a call to +\fBreturn\fP is simulated. +.TP +.B 4. +.SM +.B BASH_ARGC +and +.SM +.B BASH_ARGV +are updated as described in their descriptions above. +.TP +.B 5. +Function tracing is enabled: command substitution, shell functions, and +subshells invoked with \fB(\fP \fIcommand\fP \fB)\fP inherit the +\fBDEBUG\fP and \fBRETURN\fP traps. +.TP +.B 6. +Error tracing is enabled: command substitution, shell functions, and +subshells invoked with \fB(\fP \fIcommand\fP \fB)\fP inherit the +\fBERR\fP trap. +.RE +.TP 8 +.B extglob +If set, the extended pattern matching features described above under +\fBPathname Expansion\fP are enabled. +.TP 8 +.B extquote +If set, \fB$\fP\(aq\fIstring\fP\(aq and \fB$\fP"\fIstring\fP" quoting is +performed within \fB${\fP\fIparameter\fP\fB}\fP expansions +enclosed in double quotes. This option is enabled by default. +.TP 8 +.B failglob +If set, patterns which fail to match filenames during pathname expansion +result in an expansion error. +.TP 8 +.B force_fignore +If set, the suffixes specified by the +.SM +.B FIGNORE +shell variable +cause words to be ignored when performing word completion even if +the ignored words are the only possible completions. +See +.SM +\fBSHELL VARIABLES\fP +above for a description of +.SM +.BR FIGNORE . +This option is enabled by default. +.TP 8 +.B globasciiranges +If set, range expressions used in pattern matching bracket expressions (see +.SM +.B Pattern Matching +above) behave as if in the traditional C locale when performing +comparisons. That is, the current locale's collating sequence +is not taken into account, so +.B b +will not collate between +.B A +and +.BR B , +and upper-case and lower-case ASCII characters will collate together. +.TP 8 +.B globstar +If set, the pattern \fB**\fP used in a pathname expansion context will +match all files and zero or more directories and subdirectories. +If the pattern is followed by a \fB/\fP, only directories and +subdirectories match. +.TP 8 +.B gnu_errfmt +If set, shell error messages are written in the standard GNU error +message format. +.TP 8 +.B histappend +If set, the history list is appended to the file named by the value +of the +.SM +.B HISTFILE +variable when the shell exits, rather than overwriting the file. +.TP 8 +.B histreedit +If set, and +.B readline +is being used, a user is given the opportunity to re-edit a +failed history substitution. +.TP 8 +.B histverify +If set, and +.B readline +is being used, the results of history substitution are not immediately +passed to the shell parser. Instead, the resulting line is loaded into +the \fBreadline\fP editing buffer, allowing further modification. +.TP 8 +.B hostcomplete +If set, and +.B readline +is being used, \fBbash\fP will attempt to perform hostname completion when a +word containing a \fB@\fP is being completed (see +.B Completing +under +.SM +.B READLINE +above). +This is enabled by default. +.TP 8 +.B huponexit +If set, \fBbash\fP will send +.SM +.B SIGHUP +to all jobs when an interactive login shell exits. +.TP 8 +.B interactive_comments +If set, allow a word beginning with +.B # +to cause that word and all remaining characters on that +line to be ignored in an interactive shell (see +.SM +.B COMMENTS +above). This option is enabled by default. +.TP 8 +.B lastpipe +If set, and job control is not active, the shell runs the last command of +a pipeline not executed in the background in the current shell environment. +.TP 8 +.B lithist +If set, and the +.B cmdhist +option is enabled, multi-line commands are saved to the history with +embedded newlines rather than using semicolon separators where possible. +.TP 8 +.B login_shell +The shell sets this option if it is started as a login shell (see +.SM +.B "INVOCATION" +above). +The value may not be changed. +.TP 8 +.B mailwarn +If set, and a file that \fBbash\fP is checking for mail has been +accessed since the last time it was checked, the message ``The mail in +\fImailfile\fP has been read'' is displayed. +.TP 8 +.B no_empty_cmd_completion +If set, and +.B readline +is being used, +.B bash +will not attempt to search the +.SM +.B PATH +for possible completions when +completion is attempted on an empty line. +.TP 8 +.B nocaseglob +If set, +.B bash +matches filenames in a case\-insensitive fashion when performing pathname +expansion (see +.B Pathname Expansion +above). +.TP 8 +.B nocasematch +If set, +.B bash +matches patterns in a case\-insensitive fashion when performing matching +while executing \fBcase\fP or \fB[[\fP conditional commands. +.TP 8 +.B nullglob +If set, +.B bash +allows patterns which match no +files (see +.B Pathname Expansion +above) +to expand to a null string, rather than themselves. +.TP 8 +.B progcomp +If set, the programmable completion facilities (see +\fBProgrammable Completion\fP above) are enabled. +This option is enabled by default. +.TP 8 +.B promptvars +If set, prompt strings undergo +parameter expansion, command substitution, arithmetic +expansion, and quote removal after being expanded as described in +.SM +.B PROMPTING +above. This option is enabled by default. +.TP 8 +.B restricted_shell +The shell sets this option if it is started in restricted mode (see +.SM +.B "RESTRICTED SHELL" +below). +The value may not be changed. +This is not reset when the startup files are executed, allowing +the startup files to discover whether or not a shell is restricted. +.TP 8 +.B shift_verbose +If set, the +.B shift +builtin prints an error message when the shift count exceeds the +number of positional parameters. +.TP 8 +.B sourcepath +If set, the +\fBsource\fP (\fB.\fP) builtin uses the value of +.SM +.B PATH +to find the directory containing the file supplied as an argument. +This option is enabled by default. +.TP 8 +.B xpg_echo +If set, the \fBecho\fP builtin expands backslash-escape sequences +by default. +.RE +.PD +.TP +\fBsuspend\fP [\fB\-f\fP] +Suspend the execution of this shell until it receives a +.SM +.B SIGCONT +signal. A login shell cannot be suspended; the +.B \-f +option can be used to override this and force the suspension. +The return status is 0 unless the shell is a login shell and +.B \-f +is not supplied, or if job control is not enabled. +.TP +\fBtest\fP \fIexpr\fP +.PD 0 +.TP +\fB[\fP \fIexpr\fP \fB]\fP +Return a status of 0 (true) or 1 (false) depending on +the evaluation of the conditional expression +.IR expr . +Each operator and operand must be a separate argument. +Expressions are composed of the primaries described above under +.SM +.BR "CONDITIONAL EXPRESSIONS" . +\fBtest\fP does not accept any options, nor does it accept and ignore +an argument of \fB\-\-\fP as signifying the end of options. +.if t .sp 0.5 +.if n .sp 1 +Expressions may be combined using the following operators, listed +in decreasing order of precedence. +The evaluation depends on the number of arguments; see below. +Operator precedence is used when there are five or more arguments. +.RS +.PD 0 +.TP +.B ! \fIexpr\fP +True if +.I expr +is false. +.TP +.B ( \fIexpr\fP ) +Returns the value of \fIexpr\fP. +This may be used to override the normal precedence of operators. +.TP +\fIexpr1\fP \-\fBa\fP \fIexpr2\fP +True if both +.I expr1 +and +.I expr2 +are true. +.TP +\fIexpr1\fP \-\fBo\fP \fIexpr2\fP +True if either +.I expr1 +or +.I expr2 +is true. +.PD +.PP +\fBtest\fP and \fB[\fP evaluate conditional +expressions using a set of rules based on the number of arguments. +.if t .sp 0.5 +.if n .sp 1 +.PD 0 +.TP +0 arguments +The expression is false. +.TP +1 argument +The expression is true if and only if the argument is not null. +.TP +2 arguments +If the first argument is \fB!\fP, the expression is true if and +only if the second argument is null. +If the first argument is one of the unary conditional operators listed above +under +.SM +.BR "CONDITIONAL EXPRESSIONS" , +the expression is true if the unary test is true. +If the first argument is not a valid unary conditional operator, the expression +is false. +.TP +3 arguments +The following conditions are applied in the order listed. +If the second argument is one of the binary conditional operators listed above +under +.SM +.BR "CONDITIONAL EXPRESSIONS" , +the result of the expression is the result of the binary test using +the first and third arguments as operands. +The \fB\-a\fP and \fB\-o\fP operators are considered binary operators +when there are three arguments. +If the first argument is \fB!\fP, the value is the negation of +the two-argument test using the second and third arguments. +If the first argument is exactly \fB(\fP and the third argument is +exactly \fB)\fP, the result is the one-argument test of the second +argument. +Otherwise, the expression is false. +.TP +4 arguments +If the first argument is \fB!\fP, the result is the negation of +the three-argument expression composed of the remaining arguments. +Otherwise, the expression is parsed and evaluated according to +precedence using the rules listed above. +.TP +5 or more arguments +The expression is parsed and evaluated according to precedence +using the rules listed above. +.if t .sp 0.5 +.if n .sp 1 +.LP +When used with \fBtest\fP or \fB[\fP, the \fB<\fP and \fB>\fP operators +sort lexicographically using ASCII ordering. +.RE +.PD +.TP +.B times +Print the accumulated user and system times for the shell and +for processes run from the shell. The return status is 0. +.TP +\fBtrap\fP [\fB\-lp\fP] [[\fIarg\fP] \fIsigspec\fP ...] +The command +.I arg +is to be read and executed when the shell receives +signal(s) +.IR sigspec . +If +.I arg +is absent (and there is a single \fIsigspec\fP) or +.BR \- , +each specified signal is +reset to its original disposition (the value it had +upon entrance to the shell). +If +.I arg +is the null string the signal specified by each +.I sigspec +is ignored by the shell and by the commands it invokes. +If +.I arg +is not present and +.B \-p +has been supplied, then the trap commands associated with each +.I sigspec +are displayed. +If no arguments are supplied or if only +.B \-p +is given, +.B trap +prints the list of commands associated with each signal. +The +.B \-l +option causes the shell to print a list of signal names and +their corresponding numbers. +Each +.I sigspec +is either +a signal name defined in <\fIsignal.h\fP>, or a signal number. +Signal names are case insensitive and the +.SM +.B SIG +prefix is optional. +.if t .sp 0.5 +.if n .sp 1 +If a +.I sigspec +is +.SM +.B EXIT +(0) the command +.I arg +is executed on exit from the shell. +If a +.I sigspec +is +.SM +.BR DEBUG , +the command +.I arg +is executed before every \fIsimple command\fP, \fIfor\fP command, +\fIcase\fP command, \fIselect\fP command, every arithmetic \fIfor\fP +command, and before the first command executes in a shell function (see +.SM +.B SHELL GRAMMAR +above). +Refer to the description of the \fBextdebug\fP option to the +\fBshopt\fP builtin for details of its effect on the \fBDEBUG\fP trap. +If a +.I sigspec +is +.SM +.BR RETURN , +the command +.I arg +is executed each time a shell function or a script executed with +the \fB.\fP or \fBsource\fP builtins finishes executing. +.if t .sp 0.5 +.if n .sp 1 +If a +.I sigspec +is +.SM +.BR ERR , +the command +.I arg +is executed whenever a +a pipeline (which may consist of a single simple +command), a list, or a compound command returns a +non\-zero exit status, +subject to the following conditions. +The +.SM +.B ERR +trap is not executed if the failed +command is part of the command list immediately following a +.B while +or +.B until +keyword, +part of the test in an +.I if +statement, part of a command executed in a +.B && +or +.B || +list except the command following the final \fB&&\fP or \fB||\fP, +any command in a pipeline but the last, +or if the command's return value is +being inverted using +.BR ! . +These are the same conditions obeyed by the \fBerrexit\fP (\fB\-e\fP) option. +.if t .sp 0.5 +.if n .sp 1 +Signals ignored upon entry to the shell cannot be trapped or reset. +Trapped signals that are not being ignored are reset to their original +values in a subshell or subshell environment when one is created. +The return status is false if any +.I sigspec +is invalid; otherwise +.B trap +returns true. +.TP +\fBtype\fP [\fB\-aftpP\fP] \fIname\fP [\fIname\fP ...] +With no options, +indicate how each +.I name +would be interpreted if used as a command name. +If the +.B \-t +option is used, +.B type +prints a string which is one of +.IR alias , +.IR keyword , +.IR function , +.IR builtin , +or +.I file +if +.I name +is an alias, shell reserved word, function, builtin, or disk file, +respectively. +If the +.I name +is not found, then nothing is printed, and an exit status of false +is returned. +If the +.B \-p +option is used, +.B type +either returns the name of the disk file +that would be executed if +.I name +were specified as a command name, +or nothing if +.if t \f(CWtype -t name\fP +.if n ``type -t name'' +would not return +.IR file . +The +.B \-P +option forces a +.SM +.B PATH +search for each \fIname\fP, even if +.if t \f(CWtype -t name\fP +.if n ``type -t name'' +would not return +.IR file . +If a command is hashed, +.B \-p +and +.B \-P +print the hashed value, which is not necessarily the file that appears +first in +.SM +.BR PATH . +If the +.B \-a +option is used, +.B type +prints all of the places that contain +an executable named +.IR name . +This includes aliases and functions, +if and only if the +.B \-p +option is not also used. +The table of hashed commands is not consulted +when using +.BR \-a . +The +.B \-f +option suppresses shell function lookup, as with the \fBcommand\fP builtin. +.B type +returns true if all of the arguments are found, false if +any are not found. +.TP +\fBulimit\fP [\fB\-HSTabcdefilmnpqrstuvx\fP [\fIlimit\fP]] +Provides control over the resources available to the shell and to +processes started by it, on systems that allow such control. +The \fB\-H\fP and \fB\-S\fP options specify that the hard or soft limit is +set for the given resource. +A hard limit cannot be increased by a non-root user once it is set; +a soft limit may be increased up to the value of the hard limit. +If neither \fB\-H\fP nor \fB\-S\fP is specified, both the soft and hard +limits are set. +The value of +.I limit +can be a number in the unit specified for the resource +or one of the special values +.BR hard , +.BR soft , +or +.BR unlimited , +which stand for the current hard limit, the current soft limit, and +no limit, respectively. +If +.I limit +is omitted, the current value of the soft limit of the resource is +printed, unless the \fB\-H\fP option is given. When more than one +resource is specified, the limit name and unit are printed before the value. +Other options are interpreted as follows: +.RS +.PD 0 +.TP +.B \-a +All current limits are reported +.TP +.B \-b +The maximum socket buffer size +.TP +.B \-c +The maximum size of core files created +.TP +.B \-d +The maximum size of a process's data segment +.TP +.B \-e +The maximum scheduling priority ("nice") +.TP +.B \-f +The maximum size of files written by the shell and its children +.TP +.B \-i +The maximum number of pending signals +.TP +.B \-l +The maximum size that may be locked into memory +.TP +.B \-m +The maximum resident set size (many systems do not honor this limit) +.TP +.B \-n +The maximum number of open file descriptors (most systems do not +allow this value to be set) +.TP +.B \-p +The pipe size in 512-byte blocks (this may not be set) +.TP +.B \-q +The maximum number of bytes in POSIX message queues +.TP +.B \-r +The maximum real-time scheduling priority +.TP +.B \-s +The maximum stack size +.TP +.B \-t +The maximum amount of cpu time in seconds +.TP +.B \-u +The maximum number of processes available to a single user +.TP +.B \-v +The maximum amount of virtual memory available to the shell and, on +some systems, to its children +.TP +.B \-x +The maximum number of file locks +.TP +.B \-T +The maximum number of threads +.PD +.PP +If +.I limit +is given, and the +.B \-a +option is not used, +\fIlimit\fP is the new value of the specified resource. +If no option is given, then +.B \-f +is assumed. Values are in 1024-byte increments, except for +.BR \-t , +which is in seconds; +.BR \-p , +which is in units of 512-byte blocks; +and +.BR \-T , +.BR \-b , +.BR \-n , +and +.BR \-u , +which are unscaled values. +The return status is 0 unless an invalid option or argument is supplied, +or an error occurs while setting a new limit. +.RE +.TP +\fBumask\fP [\fB\-p\fP] [\fB\-S\fP] [\fImode\fP] +The user file-creation mask is set to +.IR mode . +If +.I mode +begins with a digit, it +is interpreted as an octal number; otherwise +it is interpreted as a symbolic mode mask similar +to that accepted by +.IR chmod (1). +If +.I mode +is omitted, the current value of the mask is printed. +The +.B \-S +option causes the mask to be printed in symbolic form; the +default output is an octal number. +If the +.B \-p +option is supplied, and +.I mode +is omitted, the output is in a form that may be reused as input. +The return status is 0 if the mode was successfully changed or if +no \fImode\fP argument was supplied, and false otherwise. +.TP +\fBunalias\fP [\-\fBa\fP] [\fIname\fP ...] +Remove each \fIname\fP from the list of defined aliases. If +.B \-a +is supplied, all alias definitions are removed. The return +value is true unless a supplied +.I name +is not a defined alias. +.TP +\fBunset\fP [\-\fBfv\fP] [\-\fBn\fP] [\fIname\fP ...] +For each +.IR name , +remove the corresponding variable or function. +If the +.B \-v +option is given, each +.I name +refers to a shell variable, and that variable is removed. +Read-only variables may not be unset. +If +.B \-f +is specified, each +.I name +refers to a shell function, and the function definition +is removed. +If the +.B \-n +option is supplied, and \fIname\fP is a variable with the \fInameref\fP +attribute, \fIname\fP will be unset rather than the variable it +references. +\fB\-n\fP has no effect if the \fB\-f\fP option is supplied. +If no options are supplied, each \fIname\fP refers to a variable; if +there is no variable by that name, any function with that name is +unset. +Each unset variable or function is removed from the environment +passed to subsequent commands. +If any of +.SM +.BR COMP_WORDBREAKS , +.SM +.BR RANDOM , +.SM +.BR SECONDS , +.SM +.BR LINENO , +.SM +.BR HISTCMD , +.SM +.BR FUNCNAME , +.SM +.BR GROUPS , +or +.SM +.B DIRSTACK +are unset, they lose their special properties, even if they are +subsequently reset. The exit status is true unless a +.I name +is readonly. +.TP +\fBwait\fP [\fB\-n\fP] [\fIn ...\fP] +Wait for each specified child process and return its termination status. +Each +.I n +may be a process +ID or a job specification; if a job spec is given, all processes +in that job's pipeline are waited for. If +.I n +is not given, all currently active child processes +are waited for, and the return status is zero. +If the \fB\-n\fP option is supplied, \fBwait\fP waits for any job to +terminate and returns its exit status. +If +.I n +specifies a non-existent process or job, the return status is +127. Otherwise, the return status is the exit status of the last +process or job waited for. +.\" bash_builtins +.if \n(zZ=1 .ig zZ +.SH "RESTRICTED SHELL" +.\" rbash.1 +.zY +.PP +If +.B bash +is started with the name +.BR rbash , +or the +.B \-r +option is supplied at invocation, +the shell becomes restricted. +A restricted shell is used to +set up an environment more controlled than the standard shell. +It behaves identically to +.B bash +with the exception that the following are disallowed or not performed: +.IP \(bu +changing directories with \fBcd\fP +.IP \(bu +setting or unsetting the values of +.SM +.BR SHELL , +.SM +.BR PATH , +.SM +.BR ENV , +or +.SM +.B BASH_ENV +.IP \(bu +specifying command names containing +.B / +.IP \(bu +specifying a filename containing a +.B / +as an argument to the +.B . +builtin command +.IP \(bu +specifying a filename containing a slash as an argument to the +.B \-p +option to the +.B hash +builtin command +.IP \(bu +importing function definitions from the shell environment at startup +.IP \(bu +parsing the value of +.SM +.B SHELLOPTS +from the shell environment at startup +.IP \(bu +redirecting output using the >, >|, <>, >&, &>, and >> redirection operators +.IP \(bu +using the +.B exec +builtin command to replace the shell with another command +.IP \(bu +adding or deleting builtin commands with the +.B \-f +and +.B \-d +options to the +.B enable +builtin command +.IP \(bu +using the \fBenable\fP builtin command to enable disabled shell builtins +.IP \(bu +specifying the +.B \-p +option to the +.B command +builtin command +.IP \(bu +turning off restricted mode with +\fBset +r\fP or \fBset +o restricted\fP. +.PP +These restrictions are enforced after any startup files are read. +.PP +.ie \n(zY=1 When a command that is found to be a shell script is executed, +.el \{ When a command that is found to be a shell script is executed +(see +.SM +.B "COMMAND EXECUTION" +above), +\} +.B rbash +turns off any restrictions in the shell spawned to execute the +script. +.\" end of rbash.1 +.if \n(zY=1 .ig zY +.SH "SEE ALSO" +.PD 0 +.TP +\fIBash Reference Manual\fP, Brian Fox and Chet Ramey +.TP +\fIThe Gnu Readline Library\fP, Brian Fox and Chet Ramey +.TP +\fIThe Gnu History Library\fP, Brian Fox and Chet Ramey +.TP +\fIPortable Operating System Interface (POSIX) Part 2: Shell and Utilities\fP, IEEE -- +http://pubs.opengroup.org/onlinepubs/9699919799/ +.TP +http://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode +.TP +\fIsh\fP(1), \fIksh\fP(1), \fIcsh\fP(1) +.TP +\fIemacs\fP(1), \fIvi\fP(1) +.TP +\fIreadline\fP(3) +.PD +.SH FILES +.PD 0 +.TP +.FN /bin/bash +The \fBbash\fP executable +.TP +.FN /etc/profile +The systemwide initialization file, executed for login shells +.TP +.FN /etc/bash.bashrc +The systemwide per-interactive-shell startup file +.TP +.FN ~/.bash_profile +The personal initialization file, executed for login shells +.TP +.FN ~/.bashrc +The individual per-interactive-shell startup file +.TP +.FN ~/.bash_logout +The individual login shell cleanup file, executed when a login shell exits +.TP +.FN ~/.inputrc +Individual \fIreadline\fP initialization file +.PD +.SH AUTHORS +Brian Fox, Free Software Foundation +.br +bfox@gnu.org +.PP +Chet Ramey, Case Western Reserve University +.br +chet.ramey@case.edu +.SH BUG REPORTS +If you find a bug in +.B bash, +you should report it. But first, you should +make sure that it really is a bug, and that it appears in the latest +version of +.BR bash . +The latest version is always available from +\fIftp://ftp.gnu.org/pub/gnu/bash/\fP. +.PP +Once you have determined that a bug actually exists, use the +.I bashbug +command to submit a bug report. +If you have a fix, you are encouraged to mail that as well! +Suggestions and `philosophical' bug reports may be mailed +to \fIbug-bash@gnu.org\fP or posted to the Usenet +newsgroup +.BR gnu.bash.bug . +.PP +ALL bug reports should include: +.PP +.PD 0 +.TP 20 +The version number of \fBbash\fR +.TP +The hardware and operating system +.TP +The compiler used to compile +.TP +A description of the bug behaviour +.TP +A short script or `recipe' which exercises the bug +.PD +.PP +.I bashbug +inserts the first three items automatically into the template +it provides for filing a bug report. +.PP +Comments and bug reports concerning +this manual page should be directed to +.IR chet.ramey@case.edu . +.SH BUGS +.PP +It's too big and too slow. +.PP +There are some subtle differences between +.B bash +and traditional versions of +.BR sh , +mostly because of the +.SM +.B POSIX +specification. +.PP +Aliases are confusing in some uses. +.PP +Shell builtin commands and functions are not stoppable/restartable. +.PP +Compound commands and command sequences of the form `a ; b ; c' +are not handled gracefully when process suspension is attempted. +When a process is stopped, the shell immediately executes the next +command in the sequence. +It suffices to place the sequence of commands between +parentheses to force it into a subshell, which may be stopped as +a unit. +.PP +Array variables may not (yet) be exported. +.PP +There may be only one active coprocess at a time. +.zZ +.zY diff --git a/.pc/man-bashrc.diff/doc/bash.1 b/.pc/man-bashrc.diff/doc/bash.1 new file mode 100644 index 0000000..023c131 --- /dev/null +++ b/.pc/man-bashrc.diff/doc/bash.1 @@ -0,0 +1,10336 @@ +.\" +.\" MAN PAGE COMMENTS to +.\" +.\" Chet Ramey +.\" Case Western Reserve University +.\" chet.ramey@case.edu +.\" +.\" Last Change: Sun Feb 2 16:21:40 EST 2014 +.\" +.\" bash_builtins, strip all but Built-Ins section +.if \n(zZ=1 .ig zZ +.if \n(zY=1 .ig zY +.TH BASH 1 "2014 February 2" "GNU Bash 4.3" +.\" +.\" There's some problem with having a `@' +.\" in a tagged paragraph with the BSD man macros. +.\" It has to do with `@' appearing in the }1 macro. +.\" This is a problem on 4.3 BSD and Ultrix, but Sun +.\" appears to have fixed it. +.\" If you're seeing the characters +.\" `@u-3p' appearing before the lines reading +.\" `possible-hostname-completions +.\" and `complete-hostname' down in READLINE, +.\" then uncomment this redefinition. +.\" +.de }1 +.ds ]X \&\\*(]B\\ +.nr )E 0 +.if !"\\$1"" .nr )I \\$1n +.}f +.ll \\n(LLu +.in \\n()Ru+\\n(INu+\\n()Iu +.ti \\n(INu +.ie !\\n()Iu+\\n()Ru-\w\\*(]Xu-3p \{\\*(]X +.br\} +.el \\*(]X\h|\\n()Iu+\\n()Ru\c +.}f +.. +.\" +.\" File Name macro. This used to be `.PN', for Path Name, +.\" but Sun doesn't seem to like that very much. +.\" +.de FN +\fI\|\\$1\|\fP +.. +.SH NAME +bash \- GNU Bourne-Again SHell +.SH SYNOPSIS +.B bash +[options] +[command_string | file] +.SH COPYRIGHT +.if n Bash is Copyright (C) 1989-2013 by the Free Software Foundation, Inc. +.if t Bash is Copyright \(co 1989-2013 by the Free Software Foundation, Inc. +.SH DESCRIPTION +.B Bash +is an \fBsh\fR-compatible command language interpreter that +executes commands read from the standard input or from a file. +.B Bash +also incorporates useful features from the \fIKorn\fP and \fIC\fP +shells (\fBksh\fP and \fBcsh\fP). +.PP +.B Bash +is intended to be a conformant implementation of the +Shell and Utilities portion of the IEEE POSIX specification +(IEEE Standard 1003.1). +.B Bash +can be configured to be POSIX-conformant by default. +.SH OPTIONS +All of the single-character shell options documented in the +description of the \fBset\fR builtin command can be used as options +when the shell is invoked. +In addition, \fBbash\fR +interprets the following options when it is invoked: +.PP +.PD 0 +.TP 10 +.B \-c +If the +.B \-c +option is present, then commands are read from the first non-option argument +.IR command_string . +If there are arguments after the +.IR command_string , +they are assigned to the positional parameters, starting with +.BR $0 . +.TP +.B \-i +If the +.B \-i +option is present, the shell is +.IR interactive . +.TP +.B \-l +Make +.B bash +act as if it had been invoked as a login shell (see +.SM +.B INVOCATION +below). +.TP +.B \-r +If the +.B \-r +option is present, the shell becomes +.I restricted +(see +.SM +.B "RESTRICTED SHELL" +below). +.TP +.B \-s +If the +.B \-s +option is present, or if no arguments remain after option +processing, then commands are read from the standard input. +This option allows the positional parameters to be set +when invoking an interactive shell. +.TP +.B \-D +A list of all double-quoted strings preceded by \fB$\fP +is printed on the standard output. +These are the strings that +are subject to language translation when the current locale +is not \fBC\fP or \fBPOSIX\fP. +This implies the \fB\-n\fP option; no commands will be executed. +.TP +.B [\-+]O [\fIshopt_option\fP] +\fIshopt_option\fP is one of the shell options accepted by the +\fBshopt\fP builtin (see +.SM +.B SHELL BUILTIN COMMANDS +below). +If \fIshopt_option\fP is present, \fB\-O\fP sets the value of that option; +\fB+O\fP unsets it. +If \fIshopt_option\fP is not supplied, the names and values of the shell +options accepted by \fBshopt\fP are printed on the standard output. +If the invocation option is \fB+O\fP, the output is displayed in a format +that may be reused as input. +.TP +.B \-\- +A +.B \-\- +signals the end of options and disables further option processing. +Any arguments after the +.B \-\- +are treated as filenames and arguments. An argument of +.B \- +is equivalent to \fB\-\-\fP. +.PD +.PP +.B Bash +also interprets a number of multi-character options. +These options must appear on the command line before the +single-character options to be recognized. +.PP +.PD 0 +.TP +.B \-\-debugger +Arrange for the debugger profile to be executed before the shell +starts. +Turns on extended debugging mode (see the description of the +.B extdebug +option to the +.B shopt +builtin below). +.TP +.B \-\-dump\-po\-strings +Equivalent to \fB\-D\fP, but the output is in the GNU \fIgettext\fP +\fBpo\fP (portable object) file format. +.TP +.B \-\-dump\-strings +Equivalent to \fB\-D\fP. +.TP +.B \-\-help +Display a usage message on standard output and exit successfully. +.TP +\fB\-\-init\-file\fP \fIfile\fP +.PD 0 +.TP +\fB\-\-rcfile\fP \fIfile\fP +.PD +Execute commands from +.I file +instead of the standard personal initialization file +.I ~/.bashrc +if the shell is interactive (see +.SM +.B INVOCATION +below). +.TP +.B \-\-login +Equivalent to \fB\-l\fP. +.TP +.B \-\-noediting +Do not use the GNU +.B readline +library to read command lines when the shell is interactive. +.TP +.B \-\-noprofile +Do not read either the system-wide startup file +.FN /etc/profile +or any of the personal initialization files +.IR ~/.bash_profile , +.IR ~/.bash_login , +or +.IR ~/.profile . +By default, +.B bash +reads these files when it is invoked as a login shell (see +.SM +.B INVOCATION +below). +.TP +.B \-\-norc +Do not read and execute the personal initialization file +.I ~/.bashrc +if the shell is interactive. +This option is on by default if the shell is invoked as +.BR sh . +.TP +.B \-\-posix +Change the behavior of \fBbash\fP where the default operation differs +from the POSIX standard to match the standard (\fIposix mode\fP). +See +.SM +.B "SEE ALSO" +below for a reference to a document that details how posix mode affects +bash's behavior. +.TP +.B \-\-restricted +The shell becomes restricted (see +.SM +.B "RESTRICTED SHELL" +below). +.TP +.B \-\-verbose +Equivalent to \fB\-v\fP. +.TP +.B \-\-version +Show version information for this instance of +.B bash +on the standard output and exit successfully. +.PD +.SH ARGUMENTS +If arguments remain after option processing, and neither the +.B \-c +nor the +.B \-s +option has been supplied, the first argument is assumed to +be the name of a file containing shell commands. +If +.B bash +is invoked in this fashion, +.B $0 +is set to the name of the file, and the positional parameters +are set to the remaining arguments. +.B Bash +reads and executes commands from this file, then exits. +\fBBash\fP's exit status is the exit status of the last command +executed in the script. +If no commands are executed, the exit status is 0. +An attempt is first made to open the file in the current directory, and, +if no file is found, then the shell searches the directories in +.SM +.B PATH +for the script. +.SH INVOCATION +A \fIlogin shell\fP is one whose first character of argument zero is a +.BR \- , +or one started with the +.B \-\-login +option. +.PP +An \fIinteractive\fP shell is one started without non-option arguments +and without the +.B \-c +option +whose standard input and error are +both connected to terminals (as determined by +.IR isatty (3)), +or one started with the +.B \-i +option. +.SM +.B PS1 +is set and +.B $\- +includes +.B i +if +.B bash +is interactive, +allowing a shell script or a startup file to test this state. +.PP +The following paragraphs describe how +.B bash +executes its startup files. +If any of the files exist but cannot be read, +.B bash +reports an error. +Tildes are expanded in filenames as described below under +.B "Tilde Expansion" +in the +.SM +.B EXPANSION +section. +.PP +When +.B bash +is invoked as an interactive login shell, or as a non-interactive shell +with the \fB\-\-login\fP option, it first reads and +executes commands from the file \fI/etc/profile\fP, if that +file exists. +After reading that file, it looks for \fI~/.bash_profile\fP, +\fI~/.bash_login\fP, and \fI~/.profile\fP, in that order, and reads +and executes commands from the first one that exists and is readable. +The +.B \-\-noprofile +option may be used when the shell is started to inhibit this behavior. +.PP +When a login shell exits, +.B bash +reads and executes commands from the file \fI~/.bash_logout\fP, if it +exists. +.PP +When an interactive shell that is not a login shell is started, +.B bash +reads and executes commands from \fI~/.bashrc\fP, if that file exists. +This may be inhibited by using the +.B \-\-norc +option. +The \fB\-\-rcfile\fP \fIfile\fP option will force +.B bash +to read and execute commands from \fIfile\fP instead of \fI~/.bashrc\fP. +.PP +When +.B bash +is started non-interactively, to run a shell script, for example, it +looks for the variable +.SM +.B BASH_ENV +in the environment, expands its value if it appears there, and uses the +expanded value as the name of a file to read and execute. +.B Bash +behaves as if the following command were executed: +.sp .5 +.RS +.if t \f(CWif [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi\fP +.if n if [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi +.RE +.sp .5 +but the value of the +.SM +.B PATH +variable is not used to search for the filename. +.PP +If +.B bash +is invoked with the name +.BR sh , +it tries to mimic the startup behavior of historical versions of +.B sh +as closely as possible, +while conforming to the POSIX standard as well. +When invoked as an interactive login shell, or a non-interactive +shell with the \fB\-\-login\fP option, it first attempts to +read and execute commands from +.I /etc/profile +and +.IR ~/.profile , +in that order. +The +.B \-\-noprofile +option may be used to inhibit this behavior. +When invoked as an interactive shell with the name +.BR sh , +.B bash +looks for the variable +.SM +.BR ENV , +expands its value if it is defined, and uses the +expanded value as the name of a file to read and execute. +Since a shell invoked as +.B sh +does not attempt to read and execute commands from any other startup +files, the +.B \-\-rcfile +option has no effect. +A non-interactive shell invoked with the name +.B sh +does not attempt to read any other startup files. +When invoked as +.BR sh , +.B bash +enters +.I posix +mode after the startup files are read. +.PP +When +.B bash +is started in +.I posix +mode, as with the +.B \-\-posix +command line option, it follows the POSIX standard for startup files. +In this mode, interactive shells expand the +.SM +.B ENV +variable and commands are read and executed from the file +whose name is the expanded value. +No other startup files are read. +.PP +.B Bash +attempts to determine when it is being run with its standard input +connected to a network connection, as when executed by the remote shell +daemon, usually \fIrshd\fP, or the secure shell daemon \fIsshd\fP. +If +.B bash +determines it is being run in this fashion, it reads and executes +commands from \fI~/.bashrc\fP, if that file exists and is readable. +It will not do this if invoked as \fBsh\fP. +The +.B \-\-norc +option may be used to inhibit this behavior, and the +.B \-\-rcfile +option may be used to force another file to be read, but neither +\fIrshd\fP nor \fIsshd\fP generally invoke the shell with those options +or allow them to be specified. +.PP +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the \fB\-p\fP option is not supplied, no startup +files are read, shell functions are not inherited from the environment, the +.SM +.BR SHELLOPTS , +.SM +.BR BASHOPTS , +.SM +.BR CDPATH , +and +.SM +.B GLOBIGNORE +variables, if they appear in the environment, are ignored, +and the effective user id is set to the real user id. +If the \fB\-p\fP option is supplied at invocation, the startup behavior is +the same, but the effective user id is not reset. +.SH DEFINITIONS +.PP +The following definitions are used throughout the rest of this +document. +.PD 0 +.TP +.B blank +A space or tab. +.TP +.B word +A sequence of characters considered as a single unit by the shell. +Also known as a +.BR token . +.TP +.B name +A +.I word +consisting only of alphanumeric characters and underscores, and +beginning with an alphabetic character or an underscore. Also +referred to as an +.BR identifier . +.TP +.B metacharacter +A character that, when unquoted, separates words. One of the following: +.br +.RS +.PP +.if t \fB| & ; ( ) < > space tab\fP +.if n \fB| & ; ( ) < > space tab\fP +.RE +.PP +.TP +.B control operator +A \fItoken\fP that performs a control function. It is one of the following +symbols: +.RS +.PP +.if t \fB|| & && ; ;; ( ) | |& \fP +.if n \fB|| & && ; ;; ( ) | |& \fP +.RE +.PD +.SH "RESERVED WORDS" +\fIReserved words\fP are words that have a special meaning to the shell. +The following words are recognized as reserved when unquoted and either +the first word of a simple command (see +.SM +.B SHELL GRAMMAR +below) or the third word of a +.B case +or +.B for +command: +.if t .RS +.PP +.B +.if n ! case coproc do done elif else esac fi for function if in select then until while { } time [[ ]] +.if t ! case coproc do done elif else esac fi for function if in select then until while { } time [[ ]] +.if t .RE +.SH "SHELL GRAMMAR" +.SS Simple Commands +.PP +A \fIsimple command\fP is a sequence of optional variable assignments +followed by \fBblank\fP-separated words and redirections, and +terminated by a \fIcontrol operator\fP. The first word +specifies the command to be executed, and is passed as argument zero. +The remaining words are passed as arguments to the invoked command. +.PP +The return value of a \fIsimple command\fP is its exit status, or +128+\fIn\^\fP if the command is terminated by signal +.IR n . +.SS Pipelines +.PP +A \fIpipeline\fP is a sequence of one or more commands separated by +one of the control operators +.B | +or \fB|&\fP. +The format for a pipeline is: +.RS +.PP +[\fBtime\fP [\fB\-p\fP]] [ ! ] \fIcommand\fP [ [\fB|\fP\(bv\fB|&\fP] \fIcommand2\fP ... ] +.RE +.PP +The standard output of +.I command +is connected via a pipe to the standard input of +.IR command2 . +This connection is performed before any redirections specified by the +command (see +.SM +.B REDIRECTION +below). +If \fB|&\fP is used, \fIcommand\fP's standard error, in addition to its +standard output, is connected to +\fIcommand2\fP's standard input through the pipe; +it is shorthand for \fB2>&1 |\fP. +This implicit redirection of the standard error to the standard output is +performed after any redirections specified by the command. +.PP +The return status of a pipeline is the exit status of the last +command, unless the \fBpipefail\fP option is enabled. +If \fBpipefail\fP is enabled, the pipeline's return status is the +value of the last (rightmost) command to exit with a non-zero status, +or zero if all commands exit successfully. +If the reserved word +.B ! +precedes a pipeline, the exit status of that pipeline is the logical +negation of the exit status as described above. +The shell waits for all commands in the pipeline to +terminate before returning a value. +.PP +If the +.B time +reserved word precedes a pipeline, the elapsed as well as user and +system time consumed by its execution are reported when the pipeline +terminates. +The \fB\-p\fP option changes the output format to that specified by POSIX. +When the shell is in \fIposix mode\fP, it does not recognize +\fBtime\fP as a reserved word if the next token begins with a `-'. +The +.SM +.B TIMEFORMAT +variable may be set to a format string that specifies how the timing +information should be displayed; see the description of +.SM +.B TIMEFORMAT +under +.B "Shell Variables" +below. +.PP +When the shell is in \fIposix mode\fP, \fBtime\fP +may be followed by a newline. In this case, the shell displays the +total user and system time consumed by the shell and its children. +The +.SM +.B TIMEFORMAT +variable may be used to specify the format of +the time information. +.PP +Each command in a pipeline is executed as a separate process (i.e., in a +subshell). +.SS Lists +.PP +A \fIlist\fP is a sequence of one or more pipelines separated by one +of the operators +.BR ; , +.BR & , +.BR && , +or +.BR || , +and optionally terminated by one of +.BR ; , +.BR & , +or +.BR . +.PP +Of these list operators, +.B && +and +.B || +have equal precedence, followed by +.B ; +and +.BR & , +which have equal precedence. +.PP +A sequence of one or more newlines may appear in a \fIlist\fP instead +of a semicolon to delimit commands. +.PP +If a command is terminated by the control operator +.BR & , +the shell executes the command in the \fIbackground\fP +in a subshell. The shell does not wait for the command to +finish, and the return status is 0. Commands separated by a +.B ; +are executed sequentially; the shell waits for each +command to terminate in turn. The return status is the +exit status of the last command executed. +.PP +AND and OR lists are sequences of one of more pipelines separated by the +\fB&&\fP and \fB||\fP control operators, respectively. +AND and OR lists are executed with left associativity. +An AND list has the form +.RS +.PP +\fIcommand1\fP \fB&&\fP \fIcommand2\fP +.RE +.PP +.I command2 +is executed if, and only if, +.I command1 +returns an exit status of zero. +.PP +An OR list has the form +.RS +.PP +\fIcommand1\fP \fB||\fP \fIcommand2\fP +.PP +.RE +.PP +.I command2 +is executed if and only if +.I command1 +returns a non-zero exit status. +The return status of +AND and OR lists is the exit status of the last command +executed in the list. +.SS Compound Commands +.PP +A \fIcompound command\fP is one of the following. +In most cases a \fIlist\fP in a command's description may be separated from +the rest of the command by one or more newlines, and may be followed by a +newline in place of a semicolon. +.TP +(\fIlist\fP) +\fIlist\fP is executed in a subshell environment (see +.SM +\fBCOMMAND EXECUTION ENVIRONMENT\fP +below). +Variable assignments and builtin +commands that affect the shell's environment do not remain in effect +after the command completes. The return status is the exit status of +\fIlist\fP. +.TP +{ \fIlist\fP; } +\fIlist\fP is simply executed in the current shell environment. +\fIlist\fP must be terminated with a newline or semicolon. +This is known as a \fIgroup command\fP. +The return status is the exit status of +\fIlist\fP. +Note that unlike the metacharacters \fB(\fP and \fB)\fP, \fB{\fP and +\fB}\fP are \fIreserved words\fP and must occur where a reserved +word is permitted to be recognized. Since they do not cause a word +break, they must be separated from \fIlist\fP by whitespace or another +shell metacharacter. +.TP +((\fIexpression\fP)) +The \fIexpression\fP is evaluated according to the rules described +below under +.SM +.BR "ARITHMETIC EVALUATION" . +If the value of the expression is non-zero, the return status is 0; +otherwise the return status is 1. This is exactly equivalent to +\fBlet "\fIexpression\fP"\fR. +.TP +\fB[[\fP \fIexpression\fP \fB]]\fP +Return a status of 0 or 1 depending on the evaluation of +the conditional expression \fIexpression\fP. +Expressions are composed of the primaries described below under +.SM +.BR "CONDITIONAL EXPRESSIONS" . +Word splitting and pathname expansion are not performed on the words +between the \fB[[\fP and \fB]]\fP; tilde expansion, +parameter and variable expansion, +arithmetic expansion, command substitution, process +substitution, and quote removal are performed. +Conditional operators such as \fB\-f\fP must be unquoted to be recognized +as primaries. +.if t .sp 0.5 +.if n .sp 1 +When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort +lexicographically using the current locale. +.if t .sp 0.5 +.if n .sp 1 +When the \fB==\fP and \fB!=\fP operators are used, the string to the +right of the operator is considered a pattern and matched according +to the rules described below under \fBPattern Matching\fP, +as if the \fBextglob\fP shell option were enabled. +The \fB=\fP operator is equivalent to \fB==\fP. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +The return value is 0 if the string matches (\fB==\fP) or does not match +(\fB!=\fP) the pattern, and 1 otherwise. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +.if t .sp 0.5 +.if n .sp 1 +An additional binary operator, \fB=~\fP, is available, with the same +precedence as \fB==\fP and \fB!=\fP. +When it is used, the string to the right of the operator is considered +an extended regular expression and matched accordingly (as in \fIregex\fP(3)). +The return value is 0 if the string matches +the pattern, and 1 otherwise. +If the regular expression is syntactically incorrect, the conditional +expression's return value is 2. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +Bracket expressions in regular expressions must be treated carefully, +since normal quoting characters lose their meanings between brackets. +If the pattern is stored in a shell variable, quoting the variable +expansion forces the entire pattern to be matched as a string. +Substrings matched by parenthesized subexpressions within the regular +expression are saved in the array variable +.SM +.BR BASH_REMATCH . +The element of +.SM +.B BASH_REMATCH +with index 0 is the portion of the string +matching the entire regular expression. +The element of +.SM +.B BASH_REMATCH +with index \fIn\fP is the portion of the +string matching the \fIn\fPth parenthesized subexpression. +.if t .sp 0.5 +.if n .sp 1 +Expressions may be combined using the following operators, listed +in decreasing order of precedence: +.if t .sp 0.5 +.if n .sp 1 +.RS +.PD 0 +.TP +.B ( \fIexpression\fP ) +Returns the value of \fIexpression\fP. +This may be used to override the normal precedence of operators. +.TP +.B ! \fIexpression\fP +True if +.I expression +is false. +.TP +\fIexpression1\fP \fB&&\fP \fIexpression2\fP +True if both +.I expression1 +and +.I expression2 +are true. +.TP +\fIexpression1\fP \fB||\fP \fIexpression2\fP +True if either +.I expression1 +or +.I expression2 +is true. +.PD +.LP +The \fB&&\fP and \fB||\fP +operators do not evaluate \fIexpression2\fP if the value of +\fIexpression1\fP is sufficient to determine the return value of +the entire conditional expression. +.RE +.TP +\fBfor\fP \fIname\fP [ [ \fBin\fP [ \fIword ...\fP ] ] ; ] \fBdo\fP \fIlist\fP ; \fBdone\fP +The list of words following \fBin\fP is expanded, generating a list +of items. +The variable \fIname\fP is set to each element of this list +in turn, and \fIlist\fP is executed each time. +If the \fBin\fP \fIword\fP is omitted, the \fBfor\fP command executes +\fIlist\fP once for each positional parameter that is set (see +.SM +.B PARAMETERS +below). +The return status is the exit status of the last command that executes. +If the expansion of the items following \fBin\fP results in an empty +list, no commands are executed, and the return status is 0. +.TP +\fBfor\fP (( \fIexpr1\fP ; \fIexpr2\fP ; \fIexpr3\fP )) ; \fBdo\fP \fIlist\fP ; \fBdone\fP +First, the arithmetic expression \fIexpr1\fP is evaluated according +to the rules described below under +.SM +.BR "ARITHMETIC EVALUATION" . +The arithmetic expression \fIexpr2\fP is then evaluated repeatedly +until it evaluates to zero. +Each time \fIexpr2\fP evaluates to a non-zero value, \fIlist\fP is +executed and the arithmetic expression \fIexpr3\fP is evaluated. +If any expression is omitted, it behaves as if it evaluates to 1. +The return value is the exit status of the last command in \fIlist\fP +that is executed, or false if any of the expressions is invalid. +.TP +\fBselect\fP \fIname\fP [ \fBin\fP \fIword\fP ] ; \fBdo\fP \fIlist\fP ; \fBdone\fP +The list of words following \fBin\fP is expanded, generating a list +of items. The set of expanded words is printed on the standard +error, each preceded by a number. If the \fBin\fP +\fIword\fP is omitted, the positional parameters are printed (see +.SM +.B PARAMETERS +below). The +.SM +.B PS3 +prompt is then displayed and a line read from the standard input. +If the line consists of a number corresponding to one of +the displayed words, then the value of +.I name +is set to that word. If the line is empty, the words and prompt +are displayed again. If EOF is read, the command completes. Any +other value read causes +.I name +to be set to null. The line read is saved in the variable +.SM +.BR REPLY . +The +.I list +is executed after each selection until a +.B break +command is executed. +The exit status of +.B select +is the exit status of the last command executed in +.IR list , +or zero if no commands were executed. +.TP +\fBcase\fP \fIword\fP \fBin\fP [ [(] \fIpattern\fP [ \fB|\fP \fIpattern\fP ] \ +... ) \fIlist\fP ;; ] ... \fBesac\fP +A \fBcase\fP command first expands \fIword\fP, and tries to match +it against each \fIpattern\fP in turn, using the same matching rules +as for pathname expansion (see +.B Pathname Expansion +below). +The \fIword\fP is expanded using tilde +expansion, parameter and variable expansion, arithmetic substitution, +command substitution, process substitution and quote removal. +Each \fIpattern\fP examined is expanded using tilde +expansion, parameter and variable expansion, arithmetic substitution, +command substitution, and process substitution. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +When a match is found, the corresponding \fIlist\fP is executed. +If the \fB;;\fP operator is used, no subsequent matches are attempted after +the first pattern match. +Using \fB;&\fP in place of \fB;;\fP causes execution to continue with +the \fIlist\fP associated with the next set of patterns. +Using \fB;;&\fP in place of \fB;;\fP causes the shell to test the next +pattern list in the statement, if any, and execute any associated \fIlist\fP +on a successful match. +The exit status is zero if no +pattern matches. Otherwise, it is the exit status of the +last command executed in \fIlist\fP. +.TP +\fBif\fP \fIlist\fP; \fBthen\fP \fIlist\fP; \ +[ \fBelif\fP \fIlist\fP; \fBthen\fP \fIlist\fP; ] ... \ +[ \fBelse\fP \fIlist\fP; ] \fBfi\fP +The +.B if +.I list +is executed. If its exit status is zero, the +\fBthen\fP \fIlist\fP is executed. Otherwise, each \fBelif\fP +\fIlist\fP is executed in turn, and if its exit status is zero, +the corresponding \fBthen\fP \fIlist\fP is executed and the +command completes. Otherwise, the \fBelse\fP \fIlist\fP is +executed, if present. The exit status is the exit status of the +last command executed, or zero if no condition tested true. +.TP +\fBwhile\fP \fIlist-1\fP; \fBdo\fP \fIlist-2\fP; \fBdone\fP +.PD 0 +.TP +\fBuntil\fP \fIlist-1\fP; \fBdo\fP \fIlist-2\fP; \fBdone\fP +.PD +The \fBwhile\fP command continuously executes the list +\fIlist-2\fP as long as the last command in the list \fIlist-1\fP returns +an exit status of zero. The \fBuntil\fP command is identical +to the \fBwhile\fP command, except that the test is negated; +.I list-2 +is executed as long as the last command in +.I list-1 +returns a non-zero exit status. +The exit status of the \fBwhile\fP and \fBuntil\fP commands +is the exit status +of the last command executed in \fIlist-2\fP, or zero if +none was executed. +.SS Coprocesses +.PP +A \fIcoprocess\fP is a shell command preceded by the \fBcoproc\fP reserved +word. +A coprocess is executed asynchronously in a subshell, as if the command +had been terminated with the \fB&\fP control operator, with a two-way pipe +established between the executing shell and the coprocess. +.PP +The format for a coprocess is: +.RS +.PP +\fBcoproc\fP [\fINAME\fP] \fIcommand\fP [\fIredirections\fP] +.RE +.PP +This creates a coprocess named \fINAME\fP. +If \fINAME\fP is not supplied, the default name is \fBCOPROC\fP. +\fINAME\fP must not be supplied if \fIcommand\fP is a \fIsimple +command\fP (see above); otherwise, it is interpreted as the first word +of the simple command. +When the coprocess is executed, the shell creates an array variable (see +.B Arrays +below) named \fINAME\fP in the context of the executing shell. +The standard output of +.I command +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to \fINAME\fP[0]. +The standard input of +.I command +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to \fINAME\fP[1]. +This pipe is established before any redirections specified by the +command (see +.SM +.B REDIRECTION +below). +The file descriptors can be utilized as arguments to shell commands +and redirections using standard word expansions. +The file descriptors are not available in subshells. +The process ID of the shell spawned to execute the coprocess is +available as the value of the variable \fINAME\fP_PID. +The \fBwait\fP +builtin command may be used to wait for the coprocess to terminate. +.PP +Since the coprocess is created as an asynchronous command, +the \fBcoproc\fP command always returns success. +The return status of a coprocess is the exit status of \fIcommand\fP. +.SS Shell Function Definitions +.PP +A shell function is an object that is called like a simple command and +executes a compound command with a new set of positional parameters. +Shell functions are declared as follows: +.TP +\fIname\fP () \fIcompound\-command\fP [\fIredirection\fP] +.PD 0 +.TP +\fBfunction\fP \fIname\fP [()] \fIcompound\-command\fP [\fIredirection\fP] +.PD +This defines a function named \fIname\fP. +The reserved word \fBfunction\fP is optional. +If the \fBfunction\fP reserved word is supplied, the parentheses are optional. +The \fIbody\fP of the function is the compound command +.I compound\-command +(see \fBCompound Commands\fP above). +That command is usually a \fIlist\fP of commands between { and }, but +may be any command listed under \fBCompound Commands\fP above. +\fIcompound\-command\fP is executed whenever \fIname\fP is specified as the +name of a simple command. +When in \fIposix mode\fP, \fIname\fP may not be the name of one of the +POSIX \fIspecial builtins\fP. +Any redirections (see +.SM +.B REDIRECTION +below) specified when a function is defined are performed +when the function is executed. +The exit status of a function definition is zero unless a syntax error +occurs or a readonly function with the same name already exists. +When executed, the exit status of a function is the exit status of the +last command executed in the body. (See +.SM +.B FUNCTIONS +below.) +.SH COMMENTS +In a non-interactive shell, or an interactive shell in which the +.B interactive_comments +option to the +.B shopt +builtin is enabled (see +.SM +.B "SHELL BUILTIN COMMANDS" +below), a word beginning with +.B # +causes that word and all remaining characters on that line to +be ignored. An interactive shell without the +.B interactive_comments +option enabled does not allow comments. The +.B interactive_comments +option is on by default in interactive shells. +.SH QUOTING +\fIQuoting\fP is used to remove the special meaning of certain +characters or words to the shell. Quoting can be used to +disable special treatment for special characters, to prevent +reserved words from being recognized as such, and to prevent +parameter expansion. +.PP +Each of the \fImetacharacters\fP listed above under +.SM +.B DEFINITIONS +has special meaning to the shell and must be quoted if it is to +represent itself. +.PP +When the command history expansion facilities are being used +(see +.SM +.B HISTORY EXPANSION +below), the +\fIhistory expansion\fP character, usually \fB!\fP, must be quoted +to prevent history expansion. +.PP +There are three quoting mechanisms: the +.IR "escape character" , +single quotes, and double quotes. +.PP +A non-quoted backslash (\fB\e\fP) is the +.IR "escape character" . +It preserves the literal value of the next character that follows, +with the exception of . If a \fB\e\fP pair +appears, and the backslash is not itself quoted, the \fB\e\fP +is treated as a line continuation (that is, it is removed from the +input stream and effectively ignored). +.PP +Enclosing characters in single quotes preserves the literal value +of each character within the quotes. A single quote may not occur +between single quotes, even when preceded by a backslash. +.PP +Enclosing characters in double quotes preserves the literal value +of all characters within the quotes, with the exception of +.BR $ , +.BR \` , +.BR \e , +and, when history expansion is enabled, +.BR ! . +The characters +.B $ +and +.B \` +retain their special meaning within double quotes. The backslash +retains its special meaning only when followed by one of the following +characters: +.BR $ , +.BR \` , +\^\fB"\fP\^, +.BR \e , +or +.BR . +A double quote may be quoted within double quotes by preceding it with +a backslash. +If enabled, history expansion will be performed unless an +.B ! +appearing in double quotes is escaped using a backslash. +The backslash preceding the +.B ! +is not removed. +.PP +The special parameters +.B * +and +.B @ +have special meaning when in double +quotes (see +.SM +.B PARAMETERS +below). +.PP +Words of the form \fB$\fP\(aq\fIstring\fP\(aq are treated specially. The +word expands to \fIstring\fP, with backslash-escaped characters replaced +as specified by the ANSI C standard. Backslash escape sequences, if +present, are decoded as follows: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ee +.TP +.B \eE +an escape character +.TP +.B \ef +form feed +.TP +.B \en +new line +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\e +backslash +.TP +.B \e\(aq +single quote +.TP +.B \e\(dq +double quote +.TP +.B \e\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(one to three digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.TP +.B \eu\fIHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHH\fP (one to four hex digits) +.TP +.B \eU\fIHHHHHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHHHHHH\fP (one to eight hex digits) +.TP +.B \ec\fIx\fP +a control-\fIx\fP character +.PD +.RE +.LP +The expanded result is single-quoted, as if the dollar sign had +not been present. +.PP +A double-quoted string preceded by a dollar sign (\fB$\fP\(dq\fIstring\fP\(dq) +will cause the string to be translated according to the current locale. +If the current locale is \fBC\fP or \fBPOSIX\fP, the dollar sign +is ignored. +If the string is translated and replaced, the replacement is +double-quoted. +.SH PARAMETERS +A +.I parameter +is an entity that stores values. +It can be a +.IR name , +a number, or one of the special characters listed below under +.BR "Special Parameters" . +A +.I variable +is a parameter denoted by a +.IR name . +A variable has a \fIvalue\fP and zero or more \fIattributes\fP. +Attributes are assigned using the +.B declare +builtin command (see +.B declare +below in +.SM +.BR "SHELL BUILTIN COMMANDS" ). +.PP +A parameter is set if it has been assigned a value. The null string is +a valid value. Once a variable is set, it may be unset only by using +the +.B unset +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.PP +A +.I variable +may be assigned to by a statement of the form +.RS +.PP +\fIname\fP=[\fIvalue\fP] +.RE +.PP +If +.I value +is not given, the variable is assigned the null string. All +.I values +undergo tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote +removal (see +.SM +.B EXPANSION +below). If the variable has its +.B integer +attribute set, then +.I value +is evaluated as an arithmetic expression even if the $((...)) expansion is +not used (see +.B "Arithmetic Expansion" +below). +Word splitting is not performed, with the exception +of \fB"$@"\fP as explained below under +.BR "Special Parameters" . +Pathname expansion is not performed. +Assignment statements may also appear as arguments to the +.BR alias , +.BR declare , +.BR typeset , +.BR export , +.BR readonly , +and +.B local +builtin commands. +When in \fIposix mode\fP, these builtins may appear in a command after +one or more instances of the \fBcommand\fP builtin and retain these +assignment statement properties. +.PP +In the context where an assignment statement is assigning a value +to a shell variable or array index, the += operator can be used to +append to or add to the variable's previous value. +When += is applied to a variable for which the \fIinteger\fP attribute has been +set, \fIvalue\fP is evaluated as an arithmetic expression and added to the +variable's current value, which is also evaluated. +When += is applied to an array variable using compound assignment (see +.B Arrays +below), the +variable's value is not unset (as it is when using =), and new values are +appended to the array beginning at one greater than the array's maximum index +(for indexed arrays) or added as additional key\-value pairs in an +associative array. +When applied to a string-valued variable, \fIvalue\fP is expanded and +appended to the variable's value. +.PP +A variable can be assigned the \fInameref\fP attribute using the +\fB\-n\fP option to the \fBdeclare\fP or \fBlocal\fP builtin commands +(see the descriptions of \fBdeclare\fP and \fBlocal\fP below) +to create a \fInameref\fP, or a reference to another variable. +This allows variables to be manipulated indirectly. +Whenever the nameref variable is referenced or assigned to, the operation +is actually performed on the variable specified by the nameref variable's +value. +A nameref is commonly used within shell functions to refer to a variable +whose name is passed as an argument to the function. +For instance, if a variable name is passed to a shell function as its first +argument, running +.sp .5 +.RS +.if t \f(CWdeclare -n ref=$1\fP +.if n declare -n ref=$1 +.RE +.sp .5 +inside the function creates a nameref variable \fBref\fP whose value is +the variable name passed as the first argument. +References and assignments to \fBref\fP are treated as references and +assignments to the variable whose name was passed as \fB$1\fP. +If the control variable in a \fBfor\fP loop has the nameref attribute, +the list of words can be a list of shell variables, and a name reference +will be established for each word in the list, in turn, when the loop is +executed. +Array variables cannot be given the \fB\-n\fP attribute. +However, nameref variables can reference array variables and subscripted +array variables. +Namerefs can be unset using the \fB\-n\fP option to the \fBunset\fP builtin. +Otherwise, if \fBunset\fP is executed with the name of a nameref variable +as an argument, the variable referenced by the nameref variable will be unset. +.SS Positional Parameters +.PP +A +.I positional parameter +is a parameter denoted by one or more +digits, other than the single digit 0. Positional parameters are +assigned from the shell's arguments when it is invoked, +and may be reassigned using the +.B set +builtin command. Positional parameters may not be assigned to +with assignment statements. The positional parameters are +temporarily replaced when a shell function is executed (see +.SM +.B FUNCTIONS +below). +.PP +When a positional parameter consisting of more than a single +digit is expanded, it must be enclosed in braces (see +.SM +.B EXPANSION +below). +.SS Special Parameters +.PP +The shell treats several parameters specially. These parameters may +only be referenced; assignment to them is not allowed. +.PD 0 +.TP +.B * +Expands to the positional parameters, starting from one. +When the expansion is not within double quotes, each positional parameter +expands to a separate word. +In contexts where it is performed, those words +are subject to further word splitting and pathname expansion. +When the expansion occurs within double quotes, it expands to a single word +with the value of each parameter separated by the first character +of the +.SM +.B IFS +special variable. That is, "\fB$*\fP" is equivalent +to "\fB$1\fP\fIc\fP\fB$2\fP\fIc\fP\fB...\fP", where +.I c +is the first character of the value of the +.SM +.B IFS +variable. If +.SM +.B IFS +is unset, the parameters are separated by spaces. +If +.SM +.B IFS +is null, the parameters are joined without intervening separators. +.TP +.B @ +Expands to the positional parameters, starting from one. When the +expansion occurs within double quotes, each parameter expands to a +separate word. That is, "\fB$@\fP" is equivalent to +"\fB$1\fP" "\fB$2\fP" ... +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +When there are no positional parameters, "\fB$@\fP" and +.B $@ +expand to nothing (i.e., they are removed). +.TP +.B # +Expands to the number of positional parameters in decimal. +.TP +.B ? +Expands to the exit status of the most recently executed foreground +pipeline. +.TP +.B \- +Expands to the current option flags as specified upon invocation, +by the +.B set +builtin command, or those set by the shell itself +(such as the +.B \-i +option). +.TP +.B $ +Expands to the process ID of the shell. In a () subshell, it +expands to the process ID of the current shell, not the +subshell. +.TP +.B ! +Expands to the process ID of the job most recently placed into the +background, whether executed as an asynchronous command or using +the \fBbg\fP builtin (see +.SM +.B "JOB CONTROL" +below). +.TP +.B 0 +Expands to the name of the shell or shell script. This is set at +shell initialization. If +.B bash +is invoked with a file of commands, +.B $0 +is set to the name of that file. If +.B bash +is started with the +.B \-c +option, then +.B $0 +is set to the first argument after the string to be +executed, if one is present. Otherwise, it is set +to the filename used to invoke +.BR bash , +as given by argument zero. +.TP +.B _ +At shell startup, set to the absolute pathname used to invoke the +shell or shell script being executed as passed in the environment +or argument list. +Subsequently, expands to the last argument to the previous command, +after expansion. +Also set to the full pathname used to invoke each command executed +and placed in the environment exported to that command. +When checking mail, this parameter holds the name of the mail file +currently being checked. +.PD +.SS Shell Variables +.PP +The following variables are set by the shell: +.PP +.PD 0 +.TP +.B BASH +Expands to the full filename used to invoke this instance of +.BR bash . +.TP +.B BASHOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +.B \-s +option to the +.B shopt +builtin command (see +.SM +.B "SHELL BUILTIN COMMANDS" +below). The options appearing in +.SM +.B BASHOPTS +are those reported as +.I on +by \fBshopt\fP. +If this variable is in the environment when +.B bash +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +.TP +.B BASHPID +Expands to the process ID of the current \fBbash\fP process. +This differs from \fB$$\fP under certain circumstances, such as subshells +that do not require \fBbash\fP to be re-initialized. +.TP +.B BASH_ALIASES +An associative array variable whose members correspond to the internal +list of aliases as maintained by the \fBalias\fP builtin. +Elements added to this array appear in the alias list; unsetting array +elements cause aliases to be removed from the alias list. +.TP +.B BASH_ARGC +An array variable whose values are the number of parameters in each +frame of the current \fBbash\fP execution call stack. +The number of +parameters to the current subroutine (shell function or script executed +with \fB.\fP or \fBsource\fP) is at the top of the stack. +When a subroutine is executed, the number of parameters passed is pushed onto +.SM +.BR BASH_ARGC . +The shell sets +.SM +.B BASH_ARGC +only when in extended debugging mode (see the description of the +.B extdebug +option to the +.B shopt +builtin below) +.TP +.B BASH_ARGV +An array variable containing all of the parameters in the current \fBbash\fP +execution call stack. The final parameter of the last subroutine call +is at the top of the stack; the first parameter of the initial call is +at the bottom. When a subroutine is executed, the parameters supplied +are pushed onto +.SM +.BR BASH_ARGV . +The shell sets +.SM +.B BASH_ARGV +only when in extended debugging mode +(see the description of the +.B extdebug +option to the +.B shopt +builtin below) +.TP +.B BASH_CMDS +An associative array variable whose members correspond to the internal +hash table of commands as maintained by the \fBhash\fP builtin. +Elements added to this array appear in the hash table; unsetting array +elements cause commands to be removed from the hash table. +.TP +.B BASH_COMMAND +The command currently being executed or about to be executed, unless the +shell is executing a command as the result of a trap, +in which case it is the command executing at the time of the trap. +.TP +.B BASH_EXECUTION_STRING +The command argument to the \fB\-c\fP invocation option. +.TP +.B BASH_LINENO +An array variable whose members are the line numbers in source files +where each corresponding member of +.SM +.B FUNCNAME +was invoked. +\fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP is the line number in the source +file (\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP) where +\fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP was called +(or \fB${BASH_LINENO[\fP\fI$i-1\fP\fB]}\fP if referenced within another +shell function). +Use +.SM +.B LINENO +to obtain the current line number. +.TP +.B BASH_REMATCH +An array variable whose members are assigned by the \fB=~\fP binary +operator to the \fB[[\fP conditional command. +The element with index 0 is the portion of the string +matching the entire regular expression. +The element with index \fIn\fP is the portion of the +string matching the \fIn\fPth parenthesized subexpression. +This variable is read-only. +.TP +.B BASH_SOURCE +An array variable whose members are the source filenames +where the corresponding shell function names in the +.SM +.B FUNCNAME +array variable are defined. +The shell function +\fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP is defined in the file +\fB${BASH_SOURCE[\fP\fI$i\fP\fB]}\fP and called from +\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP. +.TP +.B BASH_SUBSHELL +Incremented by one within each subshell or subshell environment when +the shell begins executing in that environment. +The initial value is 0. +.TP +.B BASH_VERSINFO +A readonly array variable whose members hold version information for +this instance of +.BR bash . +The values assigned to the array members are as follows: +.sp .5 +.RS +.TP 24 +.B BASH_VERSINFO[\fR0\fP] +The major version number (the \fIrelease\fP). +.TP +.B BASH_VERSINFO[\fR1\fP] +The minor version number (the \fIversion\fP). +.TP +.B BASH_VERSINFO[\fR2\fP] +The patch level. +.TP +.B BASH_VERSINFO[\fR3\fP] +The build version. +.TP +.B BASH_VERSINFO[\fR4\fP] +The release status (e.g., \fIbeta1\fP). +.TP +.B BASH_VERSINFO[\fR5\fP] +The value of +.SM +.BR MACHTYPE . +.RE +.TP +.B BASH_VERSION +Expands to a string describing the version of this instance of +.BR bash . +.TP +.B COMP_CWORD +An index into \fB${COMP_WORDS}\fP of the word containing the current +cursor position. +This variable is available only in shell functions invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_KEY +The key (or final key of a key sequence) used to invoke the current +completion function. +.TP +.B COMP_LINE +The current command line. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_POINT +The index of the current cursor position relative to the beginning of +the current command. +If the current cursor position is at the end of the current command, +the value of this variable is equal to \fB${#COMP_LINE}\fP. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_TYPE +Set to an integer value corresponding to the type of completion attempted +that caused a completion function to be called: +\fITAB\fP, for normal completion, +\fI?\fP, for listing completions after successive tabs, +\fI!\fP, for listing alternatives on partial word completion, +\fI@\fP, to list completions if the word is not unmodified, +or +\fI%\fP, for menu completion. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_WORDBREAKS +The set of characters that the \fBreadline\fP library treats as word +separators when performing word completion. +If +.SM +.B COMP_WORDBREAKS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B COMP_WORDS +An array variable (see \fBArrays\fP below) consisting of the individual +words in the current command line. +The line is split into words as \fBreadline\fP would split it, using +.SM +.B COMP_WORDBREAKS +as described above. +This variable is available only in shell functions invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COPROC +An array variable (see \fBArrays\fP below) created to hold the file descriptors +for output from and input to an unnamed coprocess (see \fBCoprocesses\fP +above). +.TP +.B DIRSTACK +An array variable (see +.B Arrays +below) containing the current contents of the directory stack. +Directories appear in the stack in the order they are displayed by the +.B dirs +builtin. +Assigning to members of this array variable may be used to modify +directories already in the stack, but the +.B pushd +and +.B popd +builtins must be used to add and remove directories. +Assignment to this variable will not change the current directory. +If +.SM +.B DIRSTACK +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B EUID +Expands to the effective user ID of the current user, initialized at +shell startup. This variable is readonly. +.TP +.B FUNCNAME +An array variable containing the names of all shell functions +currently in the execution call stack. +The element with index 0 is the name of any currently-executing +shell function. +The bottom-most element (the one with the highest index) is +.if t \f(CW"main"\fP. +.if n "main". +This variable exists only when a shell function is executing. +Assignments to +.SM +.B FUNCNAME +have no effect and return an error status. +If +.SM +.B FUNCNAME +is unset, it loses its special properties, even if it is +subsequently reset. +.if t .sp 0.5 +.if n .sp 1 +This variable can be used with \fBBASH_LINENO\fP and \fBBASH_SOURCE\fP. +Each element of \fBFUNCNAME\fP has corresponding elements in +\fBBASH_LINENO\fP and \fBBASH_SOURCE\fP to describe the call stack. +For instance, \fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP was called from the file +\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP at line number +\fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP. +The \fBcaller\fP builtin displays the current call stack using this +information. +.TP +.B GROUPS +An array variable containing the list of groups of which the current +user is a member. +Assignments to +.SM +.B GROUPS +have no effect and return an error status. +If +.SM +.B GROUPS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B HISTCMD +The history number, or index in the history list, of the current +command. +If +.SM +.B HISTCMD +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B HOSTNAME +Automatically set to the name of the current host. +.TP +.B HOSTTYPE +Automatically set to a string that uniquely +describes the type of machine on which +.B bash +is executing. +The default is system-dependent. +.TP +.B LINENO +Each time this parameter is referenced, the shell substitutes +a decimal number representing the current sequential line number +(starting with 1) within a script or function. When not in a +script or function, the value substituted is not guaranteed to +be meaningful. +If +.SM +.B LINENO +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B MACHTYPE +Automatically set to a string that fully describes the system +type on which +.B bash +is executing, in the standard GNU \fIcpu-company-system\fP format. +The default is system-dependent. +.TP +.B MAPFILE +An array variable (see \fBArrays\fP below) created to hold the text +read by the \fBmapfile\fP builtin when no variable name is supplied. +.TP +.B OLDPWD +The previous working directory as set by the +.B cd +command. +.TP +.B OPTARG +The value of the last option argument processed by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.TP +.B OPTIND +The index of the next argument to be processed by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.TP +.B OSTYPE +Automatically set to a string that +describes the operating system on which +.B bash +is executing. +The default is system-dependent. +.TP +.B PIPESTATUS +An array variable (see +.B Arrays +below) containing a list of exit status values from the processes +in the most-recently-executed foreground pipeline (which may +contain only a single command). +.TP +.B PPID +The process ID of the shell's parent. This variable is readonly. +.TP +.B PWD +The current working directory as set by the +.B cd +command. +.TP +.B RANDOM +Each time this parameter is referenced, a random integer between +0 and 32767 is +generated. The sequence of random numbers may be initialized by assigning +a value to +.SM +.BR RANDOM . +If +.SM +.B RANDOM +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B READLINE_LINE +The contents of the +.B readline +line buffer, for use with +.if t \f(CWbind -x\fP +.if n "bind -x" +(see +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.TP +.B READLINE_POINT +The position of the insertion point in the +.B readline +line buffer, for use with +.if t \f(CWbind -x\fP +.if n "bind -x" +(see +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.TP +.B REPLY +Set to the line of input read by the +.B read +builtin command when no arguments are supplied. +.TP +.B SECONDS +Each time this parameter is +referenced, the number of seconds since shell invocation is returned. If a +value is assigned to +.SM +.BR SECONDS , +the value returned upon subsequent +references is +the number of seconds since the assignment plus the value assigned. +If +.SM +.B SECONDS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B SHELLOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +.B \-o +option to the +.B set +builtin command (see +.SM +.B "SHELL BUILTIN COMMANDS" +below). The options appearing in +.SM +.B SHELLOPTS +are those reported as +.I on +by \fBset \-o\fP. +If this variable is in the environment when +.B bash +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +.TP +.B SHLVL +Incremented by one each time an instance of +.B bash +is started. +.TP +.B UID +Expands to the user ID of the current user, initialized at shell startup. +This variable is readonly. +.PD +.PP +The following variables are used by the shell. In some cases, +.B bash +assigns a default value to a variable; these cases are noted +below. +.PP +.PD 0 +.TP +.B BASH_COMPAT +The value is used to set the shell's compatibility level. +See the description of the \fBshopt\fP builtin below under +\fBSHELL BUILTIN COMMANDS\fP +for a description of the various compatibility +levels and their effects. +The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42) +corresponding to the desired compatibility level. +If \fBBASH_COMPAT\fP is unset or set to the empty string, the compatibility +level is set to the default for the current version. +If \fBBASH_COMPAT\fP is set to a value that is not one of the valid +compatibility levels, the shell prints an error message and sets the +compatibility level to the default for the current version. +The valid compatibility levels correspond to the compatibility options +accepted by the \fBshopt\fP builtin described below (for example, +\fBcompat42\fP means that 4.2 and 42 are valid values). +The current version is also a valid value. +.TP +.B BASH_ENV +If this parameter is set when \fBbash\fP is executing a shell script, +its value is interpreted as a filename containing commands to +initialize the shell, as in +.IR ~/.bashrc . +The value of +.SM +.B BASH_ENV +is subjected to parameter expansion, command substitution, and arithmetic +expansion before being interpreted as a filename. +.SM +.B PATH +is not used to search for the resultant filename. +.TP +.B BASH_XTRACEFD +If set to an integer corresponding to a valid file descriptor, \fBbash\fP +will write the trace output generated when +.if t \f(CWset -x\fP +.if n \fIset -x\fP +is enabled to that file descriptor. +The file descriptor is closed when +.SM +.B BASH_XTRACEFD +is unset or assigned a new value. +Unsetting +.SM +.B BASH_XTRACEFD +or assigning it the empty string causes the +trace output to be sent to the standard error. +Note that setting +.SM +.B BASH_XTRACEFD +to 2 (the standard error file +descriptor) and then unsetting it will result in the standard error +being closed. +.TP +.B CDPATH +The search path for the +.B cd +command. +This is a colon-separated list of directories in which the shell looks +for destination directories specified by the +.B cd +command. +A sample value is +.if t \f(CW".:~:/usr"\fP. +.if n ".:~:/usr". +.TP +.B CHILD_MAX +Set the number of exited child status values for the shell to remember. +Bash will not allow this value to be decreased below a POSIX-mandated +minimum, and there is a maximum value (currently 8192) that this may +not exceed. +The minimum value is system-dependent. +.TP +.B COLUMNS +Used by the \fBselect\fP compound command to determine the terminal width +when printing selection lists. +Automatically set if the +.B checkwinsize +option is enabled or in an interactive shell upon receipt of a +.SM +.BR SIGWINCH . +.TP +.B COMPREPLY +An array variable from which \fBbash\fP reads the possible completions +generated by a shell function invoked by the programmable completion +facility (see \fBProgrammable Completion\fP below). +Each array element contains one possible completion. +.TP +.B EMACS +If \fBbash\fP finds this variable in the environment when the shell starts +with value +.if t \f(CWt\fP, +.if n "t", +it assumes that the shell is running in an Emacs shell buffer and disables +line editing. +.TP +.B ENV +Similar to +.SM +.BR BASH_ENV ; +used when the shell is invoked in POSIX mode. +.TP +.B FCEDIT +The default editor for the +.B fc +builtin command. +.TP +.B FIGNORE +A colon-separated list of suffixes to ignore when performing +filename completion (see +.SM +.B READLINE +below). +A filename whose suffix matches one of the entries in +.SM +.B FIGNORE +is excluded from the list of matched filenames. +A sample value is +.if t \f(CW".o:~"\fP. +.if n ".o:~" +(Quoting is needed when assigning a value to this variable, +which contains tildes). +.TP +.B FUNCNEST +If set to a numeric value greater than 0, defines a maximum function +nesting level. Function invocations that exceed this nesting level +will cause the current command to abort. +.TP +.B GLOBIGNORE +A colon-separated list of patterns defining the set of filenames to +be ignored by pathname expansion. +If a filename matched by a pathname expansion pattern also matches one +of the patterns in +.SM +.BR GLOBIGNORE , +it is removed from the list of matches. +.TP +.B HISTCONTROL +A colon-separated list of values controlling how commands are saved on +the history list. +If the list of values includes +.IR ignorespace , +lines which begin with a +.B space +character are not saved in the history list. +A value of +.I ignoredups +causes lines matching the previous history entry to not be saved. +A value of +.I ignoreboth +is shorthand for \fIignorespace\fP and \fIignoredups\fP. +A value of +.IR erasedups +causes all previous lines matching the current line to be removed from +the history list before that line is saved. +Any value not in the above list is ignored. +If +.SM +.B HISTCONTROL +is unset, or does not include a valid value, +all lines read by the shell parser are saved on the history list, +subject to the value of +.SM +.BR HISTIGNORE . +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +.SM +.BR HISTCONTROL . +.TP +.B HISTFILE +The name of the file in which command history is saved (see +.SM +.B HISTORY +below). The default value is \fI~/.bash_history\fP. If unset, the +command history is not saved when a shell exits. +.TP +.B HISTFILESIZE +The maximum number of lines contained in the history file. When this +variable is assigned a value, the history file is truncated, if +necessary, +to contain no more than that number of lines by removing the oldest entries. +The history file is also truncated to this size after +writing it when a shell exits. +If the value is 0, the history file is truncated to zero size. +Non-numeric values and numeric values less than zero inhibit truncation. +The shell sets the default value to the value of \fBHISTSIZE\fP +after reading any startup files. +.TP +.B HISTIGNORE +A colon-separated list of patterns used to decide which command lines +should be saved on the history list. Each pattern is anchored at the +beginning of the line and must match the complete line (no implicit +`\fB*\fP' is appended). Each pattern is tested against the line +after the checks specified by +.SM +.B HISTCONTROL +are applied. +In addition to the normal shell pattern matching characters, `\fB&\fP' +matches the previous history line. `\fB&\fP' may be escaped using a +backslash; the backslash is removed before attempting a match. +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +.SM +.BR HISTIGNORE . +.TP +.B HISTSIZE +The number of commands to remember in the command history (see +.SM +.B HISTORY +below). +If the value is 0, commands are not saved in the history list. +Numeric values less than zero result in every command being saved +on the history list (there is no limit). +The shell sets the default value to 500 after reading any startup files. +.TP +.B HISTTIMEFORMAT +If this variable is set and not null, its value is used as a format string +for \fIstrftime\fP(3) to print the time stamp associated with each history +entry displayed by the \fBhistory\fP builtin. +If this variable is set, time stamps are written to the history file so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +.TP +.B HOME +The home directory of the current user; the default argument for the +\fBcd\fP builtin command. +The value of this variable is also used when performing tilde expansion. +.TP +.B HOSTFILE +Contains the name of a file in the same format as +.FN /etc/hosts +that should be read when the shell needs to complete a +hostname. +The list of possible hostname completions may be changed while the +shell is running; +the next time hostname completion is attempted after the +value is changed, +.B bash +adds the contents of the new file to the existing list. +If +.SM +.B HOSTFILE +is set, but has no value, or does not name a readable file, +\fBbash\fP attempts to read +.FN /etc/hosts +to obtain the list of possible hostname completions. +When +.SM +.B HOSTFILE +is unset, the hostname list is cleared. +.TP +.B IFS +The +.I Internal Field Separator +that is used +for word splitting after expansion and to +split lines into words with the +.B read +builtin command. The default value is +``''. +.TP +.B IGNOREEOF +Controls the +action of an interactive shell on receipt of an +.SM +.B EOF +character as the sole input. If set, the value is the number of +consecutive +.SM +.B EOF +characters which must be +typed as the first characters on an input line before +.B bash +exits. If the variable exists but does not have a numeric value, or +has no value, the default value is 10. If it does not exist, +.SM +.B EOF +signifies the end of input to the shell. +.TP +.B INPUTRC +The filename for the +.B readline +startup file, overriding the default of +.FN ~/.inputrc +(see +.SM +.B READLINE +below). +.TP +.B LANG +Used to determine the locale category for any category not specifically +selected with a variable starting with \fBLC_\fP. +.TP +.B LC_ALL +This variable overrides the value of +.SM +.B LANG +and any other +\fBLC_\fP variable specifying a locale category. +.TP +.B LC_COLLATE +This variable determines the collation order used when sorting the +results of pathname expansion, and determines the behavior of range +expressions, equivalence classes, and collating sequences within +pathname expansion and pattern matching. +.TP +.B LC_CTYPE +This variable determines the interpretation of characters and the +behavior of character classes within pathname expansion and pattern +matching. +.TP +.B LC_MESSAGES +This variable determines the locale used to translate double-quoted +strings preceded by a \fB$\fP. +.TP +.B LC_NUMERIC +This variable determines the locale category used for number formatting. +.TP +.B LINES +Used by the \fBselect\fP compound command to determine the column length +for printing selection lists. +Automatically set if the +.B checkwinsize +option is enabled or in an interactive shell upon receipt of a +.SM +.BR SIGWINCH . +.TP +.B MAIL +If this parameter is set to a file or directory name and the +.SM +.B MAILPATH +variable is not set, +.B bash +informs the user of the arrival of mail in the specified file or +Maildir-format directory. +.TP +.B MAILCHECK +Specifies how +often (in seconds) +.B bash +checks for mail. The default is 60 seconds. When it is time to check +for mail, the shell does so before displaying the primary prompt. +If this variable is unset, or set to a value that is not a number +greater than or equal to zero, the shell disables mail checking. +.TP +.B MAILPATH +A colon-separated list of filenames to be checked for mail. +The message to be printed when mail arrives in a particular file +may be specified by separating the filename from the message with a `?'. +When used in the text of the message, \fB$_\fP expands to the name of +the current mailfile. +Example: +.RS +.PP +\fBMAILPATH\fP=\(aq/var/mail/bfox?"You have mail":~/shell\-mail?"$_ has mail!"\(aq +.PP +.B Bash +supplies a default value for this variable, but the location of the user +mail files that it uses is system dependent (e.g., /var/mail/\fB$USER\fP). +.RE +.TP +.B OPTERR +If set to the value 1, +.B bash +displays error messages generated by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SM +.B OPTERR +is initialized to 1 each time the shell is invoked or a shell +script is executed. +.TP +.B PATH +The search path for commands. It +is a colon-separated list of directories in which +the shell looks for commands (see +.SM +.B COMMAND EXECUTION +below). +A zero-length (null) directory name in the value of +.SM +.B PATH +indicates the current directory. +A null directory name may appear as two adjacent colons, or as an initial +or trailing colon. +The default path is system-dependent, +and is set by the administrator who installs +.BR bash . +A common value is +.if t \f(CW/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin\fP. +.if n ``/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin''. +.TP +.B POSIXLY_CORRECT +If this variable is in the environment when \fBbash\fP starts, the shell +enters \fIposix mode\fP before reading the startup files, as if the +.B \-\-posix +invocation option had been supplied. If it is set while the shell is +running, \fBbash\fP enables \fIposix mode\fP, as if the command +.if t \f(CWset -o posix\fP +.if n \fIset -o posix\fP +had been executed. +.TP +.B PROMPT_COMMAND +If set, the value is executed as a command prior to issuing each primary +prompt. +.TP +.B PROMPT_DIRTRIM +If set to a number greater than zero, the value is used as the number of +trailing directory components to retain when expanding the \fB\ew\fP and +\fB\eW\fP prompt string escapes (see +.SM +.B PROMPTING +below). Characters removed are replaced with an ellipsis. +.TP +.B PS1 +The value of this parameter is expanded (see +.SM +.B PROMPTING +below) and used as the primary prompt string. The default value is +``\fB\es\-\ev\e$ \fP''. +.TP +.B PS2 +The value of this parameter is expanded as with +.SM +.B PS1 +and used as the secondary prompt string. The default is +``\fB> \fP''. +.TP +.B PS3 +The value of this parameter is used as the prompt for the +.B select +command (see +.SM +.B SHELL GRAMMAR +above). +.TP +.B PS4 +The value of this parameter is expanded as with +.SM +.B PS1 +and the value is printed before each command +.B bash +displays during an execution trace. The first character of +.SM +.B PS4 +is replicated multiple times, as necessary, to indicate multiple +levels of indirection. The default is ``\fB+ \fP''. +.TP +.B SHELL +The full pathname to the shell is kept in this environment variable. +If it is not set when the shell starts, +.B bash +assigns to it the full pathname of the current user's login shell. +.TP +.B TIMEFORMAT +The value of this parameter is used as a format string specifying +how the timing information for pipelines prefixed with the +.B time +reserved word should be displayed. +The \fB%\fP character introduces an escape sequence that is +expanded to a time value or other information. +The escape sequences and their meanings are as follows; the +braces denote optional portions. +.sp .5 +.RS +.PD 0 +.TP 10 +.B %% +A literal \fB%\fP. +.TP +.B %[\fIp\fP][l]R +The elapsed time in seconds. +.TP +.B %[\fIp\fP][l]U +The number of CPU seconds spent in user mode. +.TP +.B %[\fIp\fP][l]S +The number of CPU seconds spent in system mode. +.TP +.B %P +The CPU percentage, computed as (%U + %S) / %R. +.PD +.RE +.IP +The optional \fIp\fP is a digit specifying the \fIprecision\fP, +the number of fractional digits after a decimal point. +A value of 0 causes no decimal point or fraction to be output. +At most three places after the decimal point may be specified; +values of \fIp\fP greater than 3 are changed to 3. +If \fIp\fP is not specified, the value 3 is used. +.IP +The optional \fBl\fP specifies a longer format, including +minutes, of the form \fIMM\fPm\fISS\fP.\fIFF\fPs. +The value of \fIp\fP determines whether or not the fraction is +included. +.IP +If this variable is not set, \fBbash\fP acts as if it had the +value \fB$\(aq\enreal\et%3lR\enuser\et%3lU\ensys\et%3lS\(aq\fP. +If the value is null, no timing information is displayed. +A trailing newline is added when the format string is displayed. +.PD 0 +.TP +.B TMOUT +If set to a value greater than zero, +.SM +.B TMOUT +is treated as the +default timeout for the \fBread\fP builtin. +The \fBselect\fP command terminates if input does not arrive +after +.SM +.B TMOUT +seconds when input is coming from a terminal. +In an interactive shell, the value is interpreted as the +number of seconds to wait for a line of input after issuing the +primary prompt. +.B Bash +terminates after waiting for that number of seconds if a complete +line of input does not arrive. +.TP +.B TMPDIR +If set, \fBbash\fP uses its value as the name of a directory in which +\fBbash\fP creates temporary files for the shell's use. +.TP +.B auto_resume +This variable controls how the shell interacts with the user and +job control. If this variable is set, single word simple +commands without redirections are treated as candidates for resumption +of an existing stopped job. There is no ambiguity allowed; if there is +more than one job beginning with the string typed, the job most recently +accessed is selected. The +.I name +of a stopped job, in this context, is the command line used to +start it. +If set to the value +.IR exact , +the string supplied must match the name of a stopped job exactly; +if set to +.IR substring , +the string supplied needs to match a substring of the name of a +stopped job. The +.I substring +value provides functionality analogous to the +.B %? +job identifier (see +.SM +.B JOB CONTROL +below). If set to any other value, the supplied string must +be a prefix of a stopped job's name; this provides functionality +analogous to the \fB%\fP\fIstring\fP job identifier. +.TP +.B histchars +The two or three characters which control history expansion +and tokenization (see +.SM +.B HISTORY EXPANSION +below). The first character is the \fIhistory expansion\fP character, +the character which signals the start of a history +expansion, normally `\fB!\fP'. +The second character is the \fIquick substitution\fP +character, which is used as shorthand for re-running the previous +command entered, substituting one string for another in the command. +The default is `\fB^\fP'. +The optional third character is the character +which indicates that the remainder of the line is a comment when found +as the first character of a word, normally `\fB#\fP'. The history +comment character causes history substitution to be skipped for the +remaining words on the line. It does not necessarily cause the shell +parser to treat the rest of the line as a comment. +.PD +.SS Arrays +.B Bash +provides one-dimensional indexed and associative array variables. +Any variable may be used as an indexed array; the +.B declare +builtin will explicitly declare an array. +There is no maximum +limit on the size of an array, nor any requirement that members +be indexed or assigned contiguously. +Indexed arrays are referenced using integers (including arithmetic +expressions) and are zero-based; associative arrays are referenced +using arbitrary strings. +Unless otherwise noted, indexed array indices must be non-negative integers. +.PP +An indexed array is created automatically if any variable is assigned to +using the syntax \fIname\fP[\fIsubscript\fP]=\fIvalue\fP. The +.I subscript +is treated as an arithmetic expression that must evaluate to a number. +To explicitly declare an indexed array, use +.B declare \-a \fIname\fP +(see +.SM +.B SHELL BUILTIN COMMANDS +below). +.B declare \-a \fIname\fP[\fIsubscript\fP] +is also accepted; the \fIsubscript\fP is ignored. +.PP +Associative arrays are created using +.BR "declare \-A \fIname\fP" . +.PP +Attributes may be +specified for an array variable using the +.B declare +and +.B readonly +builtins. Each attribute applies to all members of an array. +.PP +Arrays are assigned to using compound assignments of the form +\fIname\fP=\fB(\fPvalue\fI1\fP ... value\fIn\fP\fB)\fP, where each +\fIvalue\fP is of the form [\fIsubscript\fP]=\fIstring\fP. +Indexed array assignments do not require anything but \fIstring\fP. +When assigning to indexed arrays, if the optional brackets and subscript +are supplied, that index is assigned to; +otherwise the index of the element assigned is the last index assigned +to by the statement plus one. Indexing starts at zero. +.PP +When assigning to an associative array, the subscript is required. +.PP +This syntax is also accepted by the +.B declare +builtin. Individual array elements may be assigned to using the +\fIname\fP[\fIsubscript\fP]=\fIvalue\fP syntax introduced above. +When assigning to an indexed array, if +.I name +is subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +\fIname\fP, so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.PP +Any element of an array may be referenced using +${\fIname\fP[\fIsubscript\fP]}. The braces are required to avoid +conflicts with pathname expansion. If +\fIsubscript\fP is \fB@\fP or \fB*\fP, the word expands to +all members of \fIname\fP. These subscripts differ only when the +word appears within double quotes. If the word is double-quoted, +${\fIname\fP[*]} expands to a single +word with the value of each array member separated by the first +character of the +.SM +.B IFS +special variable, and ${\fIname\fP[@]} expands each element of +\fIname\fP to a separate word. When there are no array members, +${\fIname\fP[@]} expands to nothing. +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +This is analogous to the expansion +of the special parameters \fB*\fP and \fB@\fP (see +.B Special Parameters +above). ${#\fIname\fP[\fIsubscript\fP]} expands to the length of +${\fIname\fP[\fIsubscript\fP]}. If \fIsubscript\fP is \fB*\fP or +\fB@\fP, the expansion is the number of elements in the array. +Referencing an array variable without a subscript is equivalent to +referencing the array with a subscript of 0. +If the +.I subscript +used to reference an element of an indexed array +evaluates to a number less than zero, it is +interpreted as relative to one greater than the maximum index of the array, +so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.PP +An array variable is considered set if a subscript has been assigned a +value. The null string is a valid value. +.PP +It is possible to obtain the keys (indices) of an array as well as the values. +${\fB!\fP\fIname\fP[\fI@\fP]} and ${\fB!\fP\fIname\fP[\fI*\fP]} +expand to the indices assigned in array variable \fIname\fP. +The treatment when in double quotes is similar to the expansion of the +special parameters \fI@\fP and \fI*\fP within double quotes. +.PP +The +.B unset +builtin is used to destroy arrays. \fBunset\fP \fIname\fP[\fIsubscript\fP] +destroys the array element at index \fIsubscript\fP. +Negative subscripts to indexed arrays are interpreted as described above. +Care must be taken to avoid unwanted side effects caused by pathname +expansion. +\fBunset\fP \fIname\fP, where \fIname\fP is an array, or +\fBunset\fP \fIname\fP[\fIsubscript\fP], where +\fIsubscript\fP is \fB*\fP or \fB@\fP, removes the entire array. +.PP +The +.BR declare , +.BR local , +and +.B readonly +builtins each accept a +.B \-a +option to specify an indexed array and a +.B \-A +option to specify an associative array. +If both options are supplied, +.B \-A +takes precedence. +The +.B read +builtin accepts a +.B \-a +option to assign a list of words read from the standard input +to an array. The +.B set +and +.B declare +builtins display array values in a way that allows them to be +reused as assignments. +.SH EXPANSION +Expansion is performed on the command line after it has been split into +words. There are seven kinds of expansion performed: +.IR "brace expansion" , +.IR "tilde expansion" , +.IR "parameter and variable expansion" , +.IR "command substitution" , +.IR "arithmetic expansion" , +.IR "word splitting" , +and +.IR "pathname expansion" . +.PP +The order of expansions is: +brace expansion; +tilde expansion, parameter and variable expansion, arithmetic expansion, +and command substitution (done in a left-to-right fashion); +word splitting; +and pathname expansion. +.PP +On systems that can support it, there is an additional expansion +available: \fIprocess substitution\fP. +This is performed at the +same time as tilde, parameter, variable, and arithmetic expansion and +command substitution. +.PP +Only brace expansion, word splitting, and pathname expansion +can change the number of words of the expansion; other expansions +expand a single word to a single word. +The only exceptions to this are the expansions of +"\fB$@\fP" and "\fB${\fP\fIname\fP\fB[@]}\fP" +as explained above (see +.SM +.BR PARAMETERS ). +.SS Brace Expansion +.PP +.I "Brace expansion" +is a mechanism by which arbitrary strings +may be generated. This mechanism is similar to +\fIpathname expansion\fP, but the filenames generated +need not exist. Patterns to be brace expanded take +the form of an optional +.IR preamble , +followed by either a series of comma-separated strings or +a sequence expression between a pair of braces, followed by +an optional +.IR postscript . +The preamble is prefixed to each string contained +within the braces, and the postscript is then appended +to each resulting string, expanding left to right. +.PP +Brace expansions may be nested. The results of each expanded +string are not sorted; left to right order is preserved. +For example, a\fB{\fPd,c,b\fB}\fPe expands into `ade ace abe'. +.PP +A sequence expression takes the form +\fB{\fP\fIx\fP\fB..\fP\fIy\fP\fB[..\fP\fIincr\fP\fB]}\fP, +where \fIx\fP and \fIy\fP are either integers or single characters, +and \fIincr\fP, an optional increment, is an integer. +When integers are supplied, the expression expands to each number between +\fIx\fP and \fIy\fP, inclusive. +Supplied integers may be prefixed with \fI0\fP to force each term to have the +same width. +When either \fIx\fP or \fPy\fP begins with a zero, the shell +attempts to force all generated terms to contain the same number of digits, +zero-padding where necessary. +When characters are supplied, the expression expands to each character +lexicographically between \fIx\fP and \fIy\fP, inclusive, +using the default C locale. +Note that both \fIx\fP and \fIy\fP must be of the same type. +When the increment is supplied, it is used as the difference between +each term. The default increment is 1 or -1 as appropriate. +.PP +Brace expansion is performed before any other expansions, +and any characters special to other expansions are preserved +in the result. It is strictly textual. +.B Bash +does not apply any syntactic interpretation to the context of the +expansion or the text between the braces. +.PP +A correctly-formed brace expansion must contain unquoted opening +and closing braces, and at least one unquoted comma or a valid +sequence expression. +Any incorrectly formed brace expansion is left unchanged. +A \fB{\fP or \fB,\fP may be quoted with a backslash to prevent its +being considered part of a brace expression. +To avoid conflicts with parameter expansion, the string \fB${\fP +is not considered eligible for brace expansion. +.PP +This construct is typically used as shorthand when the common +prefix of the strings to be generated is longer than in the +above example: +.RS +.PP +mkdir /usr/local/src/bash/{old,new,dist,bugs} +.RE +or +.RS +chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} +.RE +.PP +Brace expansion introduces a slight incompatibility with +historical versions of +.BR sh . +.B sh +does not treat opening or closing braces specially when they +appear as part of a word, and preserves them in the output. +.B Bash +removes braces from words as a consequence of brace +expansion. For example, a word entered to +.B sh +as \fIfile{1,2}\fP +appears identically in the output. The same word is +output as +.I file1 file2 +after expansion by +.BR bash . +If strict compatibility with +.B sh +is desired, start +.B bash +with the +.B +B +option or disable brace expansion with the +.B +B +option to the +.B set +command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SS Tilde Expansion +.PP +If a word begins with an unquoted tilde character (`\fB~\fP'), all of +the characters preceding the first unquoted slash (or all characters, +if there is no unquoted slash) are considered a \fItilde-prefix\fP. +If none of the characters in the tilde-prefix are quoted, the +characters in the tilde-prefix following the tilde are treated as a +possible \fIlogin name\fP. +If this login name is the null string, the tilde is replaced with the +value of the shell parameter +.SM +.BR HOME . +If +.SM +.B HOME +is unset, the home directory of the user executing the shell is +substituted instead. +Otherwise, the tilde-prefix is replaced with the home directory +associated with the specified login name. +.PP +If the tilde-prefix is a `~+', the value of the shell variable +.SM +.B PWD +replaces the tilde-prefix. +If the tilde-prefix is a `~\-', the value of the shell variable +.SM +.BR OLDPWD , +if it is set, is substituted. +If the characters following the tilde in the tilde-prefix consist +of a number \fIN\fP, optionally prefixed +by a `+' or a `\-', the tilde-prefix is replaced with the corresponding +element from the directory stack, as it would be displayed by the +.B dirs +builtin invoked with the tilde-prefix as an argument. +If the characters following the tilde in the tilde-prefix consist of a +number without a leading `+' or `\-', `+' is assumed. +.PP +If the login name is invalid, or the tilde expansion fails, the word +is unchanged. +.PP +Each variable assignment is checked for unquoted tilde-prefixes immediately +following a +.B : +or the first +.BR = . +In these cases, tilde expansion is also performed. +Consequently, one may use filenames with tildes in assignments to +.SM +.BR PATH , +.SM +.BR MAILPATH , +and +.SM +.BR CDPATH , +and the shell assigns the expanded value. +.SS Parameter Expansion +.PP +The `\fB$\fP' character introduces parameter expansion, +command substitution, or arithmetic expansion. The parameter name +or symbol to be expanded may be enclosed in braces, which +are optional but serve to protect the variable to be expanded from +characters immediately following it which could be +interpreted as part of the name. +.PP +When braces are used, the matching ending brace is the first `\fB}\fP' +not escaped by a backslash or within a quoted string, and not within an +embedded arithmetic expansion, command substitution, or parameter +expansion. +.PP +.PD 0 +.TP +${\fIparameter\fP} +The value of \fIparameter\fP is substituted. The braces are required +when +.I parameter +is a positional parameter with more than one digit, +or when +.I parameter +is followed by a character which is not to be +interpreted as part of its name. +The \fIparameter\fP is a shell parameter as described above +\fBPARAMETERS\fP) or an array reference (\fBArrays\fP). +.PD +.PP +If the first character of \fIparameter\fP is an exclamation point (\fB!\fP), +it introduces a level of variable indirection. +\fBBash\fP uses the value of the variable formed from the rest of +\fIparameter\fP as the name of the variable; this variable is then +expanded and that value is used in the rest of the substitution, rather +than the value of \fIparameter\fP itself. +This is known as \fIindirect expansion\fP. +The exceptions to this are the expansions of ${\fB!\fP\fIprefix\fP\fB*\fP} and +${\fB!\fP\fIname\fP[\fI@\fP]} described below. +The exclamation point must immediately follow the left brace in order to +introduce indirection. +.PP +In each of the cases below, \fIword\fP is subject to tilde expansion, +parameter expansion, command substitution, and arithmetic expansion. +.PP +When not performing substring expansion, using the forms documented below +(e.g., \fB:-\fP), +\fBbash\fP tests for a parameter that is unset or null. Omitting the colon +results in a test only for a parameter that is unset. +.PP +.PD 0 +.TP +${\fIparameter\fP\fB:\-\fP\fIword\fP} +\fBUse Default Values\fP. If +.I parameter +is unset or null, the expansion of +.I word +is substituted. Otherwise, the value of +.I parameter +is substituted. +.TP +${\fIparameter\fP\fB:=\fP\fIword\fP} +\fBAssign Default Values\fP. +If +.I parameter +is unset or null, the expansion of +.I word +is assigned to +.IR parameter . +The value of +.I parameter +is then substituted. Positional parameters and special parameters may +not be assigned to in this way. +.TP +${\fIparameter\fP\fB:?\fP\fIword\fP} +\fBDisplay Error if Null or Unset\fP. +If +.I parameter +is null or unset, the expansion of \fIword\fP (or a message to that effect +if +.I word +is not present) is written to the standard error and the shell, if it +is not interactive, exits. Otherwise, the value of \fIparameter\fP is +substituted. +.TP +${\fIparameter\fP\fB:+\fP\fIword\fP} +\fBUse Alternate Value\fP. +If +.I parameter +is null or unset, nothing is substituted, otherwise the expansion of +.I word +is substituted. +.TP +${\fIparameter\fP\fB:\fP\fIoffset\fP} +.PD 0 +.TP +${\fIparameter\fP\fB:\fP\fIoffset\fP\fB:\fP\fIlength\fP} +.PD +\fBSubstring Expansion\fP. +Expands to up to \fIlength\fP characters of the value of \fIparameter\fP +starting at the character specified by \fIoffset\fP. +If \fIparameter\fP is \fB@\fP, an indexed array subscripted by +\fB@\fP or \fB*\fP, or an associative array name, the results differ as +described below. +If \fIlength\fP is omitted, expands to the substring of the value of +\fIparameter\fP starting at the character specified by \fIoffset\fP +and extending to the end of the value. +\fIlength\fP and \fIoffset\fP are arithmetic expressions (see +.SM +.B +ARITHMETIC EVALUATION +below). +.sp 1 +If \fIoffset\fP evaluates to a number less than zero, the value +is used as an offset in characters +from the end of the value of \fIparameter\fP. +If \fIlength\fP evaluates to a number less than zero, +it is interpreted as an offset in characters +from the end of the value of \fIparameter\fP rather than +a number of characters, and the expansion is the characters between +\fIoffset\fP and that result. +Note that a negative offset must be separated from the colon by at least +one space to avoid being confused with the \fB:-\fP expansion. +.sp 1 +If \fIparameter\fP is \fB@\fP, the result is \fIlength\fP positional +parameters beginning at \fIoffset\fP. +A negative \fIoffset\fP is taken relative to one greater than the greatest +positional parameter, so an offset of -1 evaluates to the last positional +parameter. +It is an expansion error if \fIlength\fP evaluates to a number less than +zero. +.sp 1 +If \fIparameter\fP is an indexed array name subscripted by @ or *, +the result is the \fIlength\fP +members of the array beginning with ${\fIparameter\fP[\fIoffset\fP]}. +A negative \fIoffset\fP is taken relative to one greater than the maximum +index of the specified array. +It is an expansion error if \fIlength\fP evaluates to a number less than +zero. +.sp 1 +Substring expansion applied to an associative array produces undefined +results. +.sp 1 +Substring indexing is zero-based unless the positional parameters +are used, in which case the indexing starts at 1 by default. +If \fIoffset\fP is 0, and the positional parameters are used, \fB$0\fP is +prefixed to the list. +.TP +${\fB!\fP\fIprefix\fP\fB*\fP} +.PD 0 +.TP +${\fB!\fP\fIprefix\fP\fB@\fP} +.PD +\fBNames matching prefix\fP. +Expands to the names of variables whose names begin with \fIprefix\fP, +separated by the first character of the +.SM +.B IFS +special variable. +When \fI@\fP is used and the expansion appears within double quotes, each +variable name expands to a separate word. +.TP +${\fB!\fP\fIname\fP[\fI@\fP]} +.PD 0 +.TP +${\fB!\fP\fIname\fP[\fI*\fP]} +.PD +\fBList of array keys\fP. +If \fIname\fP is an array variable, expands to the list of array indices +(keys) assigned in \fIname\fP. +If \fIname\fP is not an array, expands to 0 if \fIname\fP is set and null +otherwise. +When \fI@\fP is used and the expansion appears within double quotes, each +key expands to a separate word. +.TP +${\fB#\fP\fIparameter\fP} +\fBParameter length\fP. +The length in characters of the value of \fIparameter\fP is substituted. +If +.I parameter +is +.B * +or +.BR @ , +the value substituted is the number of positional parameters. +If +.I parameter +is an array name subscripted by +.B * +or +.BR @ , +the value substituted is the number of elements in the array. +If +.I parameter +is an indexed array name subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +\fIparameter\fP, so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.TP +${\fIparameter\fP\fB#\fP\fIword\fP} +.PD 0 +.TP +${\fIparameter\fP\fB##\fP\fIword\fP} +.PD +\fBRemove matching prefix pattern\fP. +The +.I word +is expanded to produce a pattern just as in pathname +expansion. If the pattern matches the beginning of +the value of +.IR parameter , +then the result of the expansion is the expanded value of +.I parameter +with the shortest matching pattern (the ``\fB#\fP'' case) or the +longest matching pattern (the ``\fB##\fP'' case) deleted. +If +.I parameter +is +.B @ +or +.BR * , +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB%\fP\fIword\fP} +.PD 0 +.TP +${\fIparameter\fP\fB%%\fP\fIword\fP} +.PD +\fBRemove matching suffix pattern\fP. +The \fIword\fP is expanded to produce a pattern just as in +pathname expansion. +If the pattern matches a trailing portion of the expanded value of +.IR parameter , +then the result of the expansion is the expanded value of +.I parameter +with the shortest matching pattern (the ``\fB%\fP'' case) or the +longest matching pattern (the ``\fB%%\fP'' case) deleted. +If +.I parameter +is +.B @ +or +.BR * , +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB/\fP\fIpattern\fP\fB/\fP\fIstring\fP} +\fBPattern substitution\fP. +The \fIpattern\fP is expanded to produce a pattern just as in +pathname expansion. +\fIParameter\fP is expanded and the longest match of \fIpattern\fP +against its value is replaced with \fIstring\fP. +If \fIpattern\fP begins with \fB/\fP, all matches of \fIpattern\fP are +replaced with \fIstring\fP. Normally only the first match is replaced. +If \fIpattern\fP begins with \fB#\fP, it must match at the beginning +of the expanded value of \fIparameter\fP. +If \fIpattern\fP begins with \fB%\fP, it must match at the end +of the expanded value of \fIparameter\fP. +If \fIstring\fP is null, matches of \fIpattern\fP are deleted +and the \fB/\fP following \fIpattern\fP may be omitted. +If +.I parameter +is +.B @ +or +.BR * , +the substitution operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the substitution operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB^\fP\fIpattern\fP} +.PD 0 +.TP +${\fIparameter\fP\fB^^\fP\fIpattern\fP} +.TP +${\fIparameter\fP\fB,\fP\fIpattern\fP} +.TP +${\fIparameter\fP\fB,,\fP\fIpattern\fP} +.PD +\fBCase modification\fP. +This expansion modifies the case of alphabetic characters in \fIparameter\fP. +The \fIpattern\fP is expanded to produce a pattern just as in +pathname expansion. +Each character in the expanded value of \fIparameter\fP is tested against +\fIpattern\fP, and, if it matches the pattern, its case is converted. +The pattern should not attempt to match more than one character. +The \fB^\fP operator converts lowercase letters matching \fIpattern\fP +to uppercase; the \fB,\fP operator converts matching uppercase letters +to lowercase. +The \fB^^\fP and \fB,,\fP expansions convert each matched character in the +expanded value; the \fB^\fP and \fB,\fP expansions match and convert only +the first character in the expanded value. +If \fIpattern\fP is omitted, it is treated like a \fB?\fP, which matches +every character. +If +.I parameter +is +.B @ +or +.BR * , +the case modification operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the case modification operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.SS Command Substitution +.PP +\fICommand substitution\fP allows the output of a command to replace +the command name. There are two forms: +.RS +.PP +\fB$(\fP\fIcommand\fP\|\fB)\fP +.RE +or +.RS +\fB\`\fP\fIcommand\fP\fB\`\fP +.RE +.PP +.B Bash +performs the expansion by executing \fIcommand\fP and +replacing the command substitution with the standard output of the +command, with any trailing newlines deleted. +Embedded newlines are not deleted, but they may be removed during +word splitting. +The command substitution \fB$(cat \fIfile\fP)\fR can be replaced by +the equivalent but faster \fB$(< \fIfile\fP)\fR. +.PP +When the old-style backquote form of substitution is used, +backslash retains its literal meaning except when followed by +.BR $ , +.BR \` , +or +.BR \e . +The first backquote not preceded by a backslash terminates the +command substitution. +When using the $(\^\fIcommand\fP\|) form, all characters between the +parentheses make up the command; none are treated specially. +.PP +Command substitutions may be nested. To nest when using the backquoted form, +escape the inner backquotes with backslashes. +.PP +If the substitution appears within double quotes, word splitting and +pathname expansion are not performed on the results. +.SS Arithmetic Expansion +.PP +Arithmetic expansion allows the evaluation of an arithmetic expression +and the substitution of the result. The format for arithmetic expansion is: +.RS +.PP +\fB$((\fP\fIexpression\fP\fB))\fP +.RE +.PP +The old format \fB$[\fP\fIexpression\fP\fB]\fP is deprecated and will +be removed in upcoming versions of bash. +.PP +The +.I expression +is treated as if it were within double quotes, but a double quote +inside the parentheses is not treated specially. +All tokens in the expression undergo parameter and variable expansion, +command substitution, and quote removal. +The result is treated as the arithmetic expression to be evaluated. +Arithmetic expansions may be nested. +.PP +The evaluation is performed according to the rules listed below under +.SM +.BR "ARITHMETIC EVALUATION" . +If +.I expression +is invalid, +.B bash +prints a message indicating failure and no substitution occurs. +.SS Process Substitution +.PP +\fIProcess substitution\fP is supported on systems that support named +pipes (\fIFIFOs\fP) or the \fB/dev/fd\fP method of naming open files. +It takes the form of +\fB<(\fP\fIlist\^\fP\fB)\fP +or +\fB>(\fP\fIlist\^\fP\fB)\fP. +The process \fIlist\fP is run with its input or output connected to a +\fIFIFO\fP or some file in \fB/dev/fd\fP. The name of this file is +passed as an argument to the current command as the result of the +expansion. If the \fB>(\fP\fIlist\^\fP\fB)\fP form is used, writing to +the file will provide input for \fIlist\fP. If the +\fB<(\fP\fIlist\^\fP\fB)\fP form is used, the file passed as an +argument should be read to obtain the output of \fIlist\fP. +.PP +When available, process substitution is performed +simultaneously with parameter and variable expansion, +command substitution, +and arithmetic expansion. +.SS Word Splitting +.PP +The shell scans the results of +parameter expansion, +command substitution, +and +arithmetic expansion +that did not occur within double quotes for +.IR "word splitting" . +.PP +The shell treats each character of +.SM +.B IFS +as a delimiter, and splits the results of the other +expansions into words using these characters as field terminators. +If +.SM +.B IFS +is unset, or its +value is exactly +.BR , +the default, then +sequences of +.BR , +.BR , +and +.B +at the beginning and end of the results of the previous +expansions are ignored, and +any sequence of +.SM +.B IFS +characters not at the beginning or end serves to delimit words. +If +.SM +.B IFS +has a value other than the default, then sequences of +the whitespace characters +.B space +and +.B tab +are ignored at the beginning and end of the +word, as long as the whitespace character is in the +value of +.SM +.BR IFS +(an +.SM +.B IFS +whitespace character). +Any character in +.SM +.B IFS +that is not +.SM +.B IFS +whitespace, along with any adjacent +.SM +.B IFS +whitespace characters, delimits a field. +A sequence of +.SM +.B IFS +whitespace characters is also treated as a delimiter. +If the value of +.SM +.B IFS +is null, no word splitting occurs. +.PP +Explicit null arguments (\^\f3"\^"\fP or \^\f3\(aq\^\(aq\fP\^) are retained. +Unquoted implicit null arguments, resulting from the expansion of +parameters that have no values, are removed. +If a parameter with no value is expanded within double quotes, a +null argument results and is retained. +.PP +Note that if no expansion occurs, no splitting +is performed. +.SS Pathname Expansion +.PP +After word splitting, +unless the +.B \-f +option has been set, +.B bash +scans each word for the characters +.BR * , +.BR ? , +and +.BR [ . +If one of these characters appears, then the word is +regarded as a +.IR pattern , +and replaced with an alphabetically sorted list of +filenames matching the pattern +(see +.SM +.B "Pattern Matching" +below). +If no matching filenames are found, +and the shell option +.B nullglob +is not enabled, the word is left unchanged. +If the +.B nullglob +option is set, and no matches are found, +the word is removed. +If the +.B failglob +shell option is set, and no matches are found, an error message +is printed and the command is not executed. +If the shell option +.B nocaseglob +is enabled, the match is performed without regard to the case +of alphabetic characters. +When a pattern is used for pathname expansion, +the character +.B ``.'' +at the start of a name or immediately following a slash +must be matched explicitly, unless the shell option +.B dotglob +is set. +When matching a pathname, the slash character must always be +matched explicitly. +In other cases, the +.B ``.'' +character is not treated specially. +See the description of +.B shopt +below under +.SM +.B SHELL BUILTIN COMMANDS +for a description of the +.BR nocaseglob , +.BR nullglob , +.BR failglob , +and +.B dotglob +shell options. +.PP +The +.SM +.B GLOBIGNORE +shell variable may be used to restrict the set of filenames matching a +.IR pattern . +If +.SM +.B GLOBIGNORE +is set, each matching filename that also matches one of the patterns in +.SM +.B GLOBIGNORE +is removed from the list of matches. +The filenames +.B ``.'' +and +.B ``..'' +are always ignored when +.SM +.B GLOBIGNORE +is set and not null. However, setting +.SM +.B GLOBIGNORE +to a non-null value has the effect of enabling the +.B dotglob +shell option, so all other filenames beginning with a +.B ``.'' +will match. +To get the old behavior of ignoring filenames beginning with a +.BR ``.'' , +make +.B ``.*'' +one of the patterns in +.SM +.BR GLOBIGNORE . +The +.B dotglob +option is disabled when +.SM +.B GLOBIGNORE +is unset. +.PP +\fBPattern Matching\fP +.PP +Any character that appears in a pattern, other than the special pattern +characters described below, matches itself. The NUL character may not +occur in a pattern. A backslash escapes the following character; the +escaping backslash is discarded when matching. +The special pattern characters must be quoted if +they are to be matched literally. +.PP +The special pattern characters have the following meanings: +.PP +.PD 0 +.RS +.TP +.B * +Matches any string, including the null string. +When the \fBglobstar\fP shell option is enabled, and \fB*\fP is used in +a pathname expansion context, two adjacent \fB*\fPs used as a single +pattern will match all files and zero or more directories and +subdirectories. +If followed by a \fB/\fP, two adjacent \fB*\fPs will match only directories +and subdirectories. +.TP +.B ? +Matches any single character. +.TP +.B [...] +Matches any one of the enclosed characters. A pair of characters +separated by a hyphen denotes a +\fIrange expression\fP; +any character that falls between those two characters, inclusive, +using the current locale's collating sequence and character set, +is matched. If the first character following the +.B [ +is a +.B ! +or a +.B ^ +then any character not enclosed is matched. +The sorting order of characters in range expressions is determined by +the current locale and the values of the +.SM +.B LC_COLLATE +or +.SM +.B LC_ALL +shell variables, if set. +To obtain the traditional interpretation of range expressions, where +.B [a\-d] +is equivalent to +.BR [abcd] , +set value of the +.B LC_ALL +shell variable to +.BR C , +or enable the +.B globasciiranges +shell option. +A +.B \- +may be matched by including it as the first or last character +in the set. +A +.B ] +may be matched by including it as the first character +in the set. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +\fIcharacter classes\fP can be specified using the syntax +\fB[:\fP\fIclass\fP\fB:]\fP, where \fIclass\fP is one of the +following classes defined in the POSIX standard: +.PP +.RS +.B +.if n alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit +.if t alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit +.br +A character class matches any character belonging to that class. +The \fBword\fP character class matches letters, digits, and the character _. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +an \fIequivalence class\fP can be specified using the syntax +\fB[=\fP\fIc\fP\fB=]\fP, which matches all characters with the +same collation weight (as defined by the current locale) as +the character \fIc\fP. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +the syntax \fB[.\fP\fIsymbol\fP\fB.]\fP matches the collating symbol +\fIsymbol\fP. +.RE +.RE +.PD +.PP +If the \fBextglob\fP shell option is enabled using the \fBshopt\fP +builtin, several extended pattern matching operators are recognized. +In the following description, a \fIpattern-list\fP is a list of one +or more patterns separated by a \fB|\fP. +Composite patterns may be formed using one or more of the following +sub-patterns: +.sp 1 +.PD 0 +.RS +.TP +\fB?(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches zero or one occurrence of the given patterns +.TP +\fB*(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches zero or more occurrences of the given patterns +.TP +\fB+(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches one or more occurrences of the given patterns +.TP +\fB@(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches one of the given patterns +.TP +\fB!(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches anything except one of the given patterns +.RE +.PD +.SS Quote Removal +.PP +After the preceding expansions, all unquoted occurrences of the +characters +.BR \e , +.BR \(aq , +and \^\f3"\fP\^ that did not result from one of the above +expansions are removed. +.SH REDIRECTION +Before a command is executed, its input and output +may be +.I redirected +using a special notation interpreted by the shell. +Redirection allows commands' file handles to be +duplicated, opened, closed, +made to refer to different files, +and can change the files the command reads from and writes to. +Redirection may also be used to modify file handles in the +current shell execution environment. +The following redirection +operators may precede or appear anywhere within a +.I simple command +or may follow a +.IR command . +Redirections are processed in the order they appear, from +left to right. +.PP +Each redirection that may be preceded by a file descriptor number +may instead be preceded by a word of the form {\fIvarname\fP}. +In this case, for each redirection operator except +>&- and <&-, the shell will allocate a file descriptor greater +than or equal to 10 and assign it to \fIvarname\fP. +If >&- or <&- is preceded +by {\fIvarname\fP}, the value of \fIvarname\fP defines the file +descriptor to close. +.PP +In the following descriptions, if the file descriptor number is +omitted, and the first character of the redirection operator is +.BR < , +the redirection refers to the standard input (file descriptor +0). If the first character of the redirection operator is +.BR > , +the redirection refers to the standard output (file descriptor +1). +.PP +The word following the redirection operator in the following +descriptions, unless otherwise noted, is subjected to +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, quote removal, +pathname expansion, and word splitting. +If it expands to more than one word, +.B bash +reports an error. +.PP +Note that the order of redirections is significant. For example, +the command +.RS +.PP +ls \fB>\fP dirlist 2\fB>&\fP1 +.RE +.PP +directs both standard output and standard error to the file +.IR dirlist , +while the command +.RS +.PP +ls 2\fB>&\fP1 \fB>\fP dirlist +.RE +.PP +directs only the standard output to file +.IR dirlist , +because the standard error was duplicated from the standard output +before the standard output was redirected to +.IR dirlist . +.PP +\fBBash\fP handles several filenames specially when they are used in +redirections, as described in the following table: +.RS +.PP +.PD 0 +.TP +.B /dev/fd/\fIfd\fP +If \fIfd\fP is a valid integer, file descriptor \fIfd\fP is duplicated. +.TP +.B /dev/stdin +File descriptor 0 is duplicated. +.TP +.B /dev/stdout +File descriptor 1 is duplicated. +.TP +.B /dev/stderr +File descriptor 2 is duplicated. +.TP +.B /dev/tcp/\fIhost\fP/\fIport\fP +If \fIhost\fP is a valid hostname or Internet address, and \fIport\fP +is an integer port number or service name, \fBbash\fP attempts to open +the corresponding TCP socket. +.TP +.B /dev/udp/\fIhost\fP/\fIport\fP +If \fIhost\fP is a valid hostname or Internet address, and \fIport\fP +is an integer port number or service name, \fBbash\fP attempts to open +the corresponding UDP socket. +.PD +.RE +.PP +A failure to open or create a file causes the redirection to fail. +.PP +Redirections using file descriptors greater than 9 should be used with +care, as they may conflict with file descriptors the shell uses +internally. +.SS Redirecting Input +.PP +Redirection of input causes the file whose name results from +the expansion of +.I word +to be opened for reading on file descriptor +.IR n , +or the standard input (file descriptor 0) if +.I n +is not specified. +.PP +The general format for redirecting input is: +.RS +.PP +[\fIn\fP]\fB<\fP\fIword\fP +.RE +.SS Redirecting Output +.PP +Redirection of output causes the file whose name results from +the expansion of +.I word +to be opened for writing on file descriptor +.IR n , +or the standard output (file descriptor 1) if +.I n +is not specified. If the file does not exist it is created; +if it does exist it is truncated to zero size. +.PP +The general format for redirecting output is: +.RS +.PP +[\fIn\fP]\fB>\fP\fIword\fP +.RE +.PP +If the redirection operator is +.BR > , +and the +.B noclobber +option to the +.B set +builtin has been enabled, the redirection will fail if the file +whose name results from the expansion of \fIword\fP exists and is +a regular file. +If the redirection operator is +.BR >| , +or the redirection operator is +.B > +and the +.B noclobber +option to the +.B set +builtin command is not enabled, the redirection is attempted even +if the file named by \fIword\fP exists. +.SS Appending Redirected Output +.PP +Redirection of output in this fashion +causes the file whose name results from +the expansion of +.I word +to be opened for appending on file descriptor +.IR n , +or the standard output (file descriptor 1) if +.I n +is not specified. If the file does not exist it is created. +.PP +The general format for appending output is: +.RS +.PP +[\fIn\fP]\fB>>\fP\fIword\fP +.RE +.PP +.SS Redirecting Standard Output and Standard Error +.PP +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be redirected to the file whose name is the +expansion of +.IR word . +.PP +There are two formats for redirecting standard output and +standard error: +.RS +.PP +\fB&>\fP\fIword\fP +.RE +and +.RS +\fB>&\fP\fIword\fP +.RE +.PP +Of the two forms, the first is preferred. +This is semantically equivalent to +.RS +.PP +\fB>\fP\fIword\fP 2\fB>&\fP1 +.RE +.PP +When using the second form, \fIword\fP may not expand to a number or +\fB\-\fP. If it does, other redirection operators apply +(see \fBDuplicating File Descriptors\fP below) for compatibility +reasons. +.SS Appending Standard Output and Standard Error +.PP +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be appended to the file whose name is the +expansion of +.IR word . +.PP +The format for appending standard output and standard error is: +.RS +.PP +\fB&>>\fP\fIword\fP +.RE +.PP +This is semantically equivalent to +.RS +.PP +\fB>>\fP\fIword\fP 2\fB>&\fP1 +.RE +.PP +(see \fBDuplicating File Descriptors\fP below). +.SS Here Documents +.PP +This type of redirection instructs the shell to read input from the +current source until a line containing only +.I delimiter +(with no trailing blanks) +is seen. All of +the lines read up to that point are then used as the standard +input for a command. +.PP +The format of here-documents is: +.RS +.PP +.nf +\fB<<\fP[\fB\-\fP]\fIword\fP + \fIhere-document\fP +\fIdelimiter\fP +.fi +.RE +.PP +No parameter and variable expansion, command substitution, +arithmetic expansion, or pathname expansion is performed on +.IR word . +If any characters in +.I word +are quoted, the +.I delimiter +is the result of quote removal on +.IR word , +and the lines in the here-document are not expanded. +If \fIword\fP is unquoted, +all lines of the here-document are subjected to +parameter expansion, command substitution, and arithmetic expansion, +the character sequence +.B \e +is ignored, and +.B \e +must be used to quote the characters +.BR \e , +.BR $ , +and +.BR \` . +.PP +If the redirection operator is +.BR <<\- , +then all leading tab characters are stripped from input lines and the +line containing +.IR delimiter . +This allows +here-documents within shell scripts to be indented in a +natural fashion. +.SS "Here Strings" +A variant of here documents, the format is: +.RS +.PP +.nf +\fB<<<\fP\fIword\fP +.fi +.RE +.PP +The \fIword\fP undergoes +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote removal. +Pathname expansion and word splitting are not performed. +The result is supplied as a single string to the command on its +standard input. +.SS "Duplicating File Descriptors" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<&\fP\fIword\fP +.RE +.PP +is used to duplicate input file descriptors. +If +.I word +expands to one or more digits, the file descriptor denoted by +.I n +is made to be a copy of that file descriptor. +If the digits in +.I word +do not specify a file descriptor open for input, a redirection error occurs. +If +.I word +evaluates to +.BR \- , +file descriptor +.I n +is closed. If +.I n +is not specified, the standard input (file descriptor 0) is used. +.PP +The operator +.RS +.PP +[\fIn\fP]\fB>&\fP\fIword\fP +.RE +.PP +is used similarly to duplicate output file descriptors. If +.I n +is not specified, the standard output (file descriptor 1) is used. +If the digits in +.I word +do not specify a file descriptor open for output, a redirection error occurs. +If +.I word +evaluates to +.BR \- , +file descriptor +.I n +is closed. +As a special case, if \fIn\fP is omitted, and \fIword\fP does not +expand to one or more digits or \fB\-\fP, the standard output and standard +error are redirected as described previously. +.SS "Moving File Descriptors" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<&\fP\fIdigit\fP\fB\-\fP +.RE +.PP +moves the file descriptor \fIdigit\fP to file descriptor +.IR n , +or the standard input (file descriptor 0) if \fIn\fP is not specified. +\fIdigit\fP is closed after being duplicated to \fIn\fP. +.PP +Similarly, the redirection operator +.RS +.PP +[\fIn\fP]\fB>&\fP\fIdigit\fP\fB\-\fP +.RE +.PP +moves the file descriptor \fIdigit\fP to file descriptor +.IR n , +or the standard output (file descriptor 1) if \fIn\fP is not specified. +.SS "Opening File Descriptors for Reading and Writing" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<>\fP\fIword\fP +.RE +.PP +causes the file whose name is the expansion of +.I word +to be opened for both reading and writing on file descriptor +.IR n , +or on file descriptor 0 if +.I n +is not specified. If the file does not exist, it is created. +.SH ALIASES +\fIAliases\fP allow a string to be substituted for a word when it is used +as the first word of a simple command. +The shell maintains a list of aliases that may be set and unset with the +.B alias +and +.B unalias +builtin commands (see +.SM +.B SHELL BUILTIN COMMANDS +below). +The first word of each simple command, if unquoted, +is checked to see if it has an +alias. If so, that word is replaced by the text of the alias. +The characters \fB/\fP, \fB$\fP, \fB\`\fP, and \fB=\fP and +any of the shell \fImetacharacters\fP or quoting characters +listed above may not appear in an alias name. +The replacement text may contain any valid shell input, +including shell metacharacters. +The first word of the replacement text is tested +for aliases, but a word that is identical to an alias being expanded +is not expanded a second time. +This means that one may alias +.B ls +to +.BR "ls \-F" , +for instance, and +.B bash +does not try to recursively expand the replacement text. +If the last character of the alias value is a +.IR blank , +then the next command +word following the alias is also checked for alias expansion. +.PP +Aliases are created and listed with the +.B alias +command, and removed with the +.B unalias +command. +.PP +There is no mechanism for using arguments in the replacement text. +If arguments are needed, a shell function should be used (see +.SM +.B FUNCTIONS +below). +.PP +Aliases are not expanded when the shell is not interactive, unless +the +.B expand_aliases +shell option is set using +.B shopt +(see the description of +.B shopt +under +.SM +\fBSHELL BUILTIN COMMANDS\fP +below). +.PP +The rules concerning the definition and use of aliases are +somewhat confusing. +.B Bash +always reads at least one complete line +of input before executing any +of the commands on that line. Aliases are expanded when a +command is read, not when it is executed. Therefore, an +alias definition appearing on the same line as another +command does not take effect until the next line of input is read. +The commands following the alias definition +on that line are not affected by the new alias. +This behavior is also an issue when functions are executed. +Aliases are expanded when a function definition is read, +not when the function is executed, because a function definition +is itself a compound command. As a consequence, aliases +defined in a function are not available until after that +function is executed. To be safe, always put +alias definitions on a separate line, and do not use +.B alias +in compound commands. +.PP +For almost every purpose, aliases are superseded by +shell functions. +.SH FUNCTIONS +A shell function, defined as described above under +.SM +.BR "SHELL GRAMMAR" , +stores a series of commands for later execution. +When the name of a shell function is used as a simple command name, +the list of commands associated with that function name is executed. +Functions are executed in the context of the +current shell; no new process is created to interpret +them (contrast this with the execution of a shell script). +When a function is executed, the arguments to the +function become the positional parameters +during its execution. +The special parameter +.B # +is updated to reflect the change. Special parameter \fB0\fP +is unchanged. +The first element of the +.SM +.B FUNCNAME +variable is set to the name of the function while the function +is executing. +.PP +All other aspects of the shell execution +environment are identical between a function and its caller +with these exceptions: the +.SM +.B DEBUG +and +.B RETURN +traps (see the description of the +.B trap +builtin under +.SM +.B SHELL BUILTIN COMMANDS +below) are not inherited unless the function has been given the +\fBtrace\fP attribute (see the description of the +.SM +.B declare +builtin below) or the +\fB\-o functrace\fP shell option has been enabled with +the \fBset\fP builtin +(in which case all functions inherit the \fBDEBUG\fP and \fBRETURN\fP traps), +and the +.SM +.B ERR +trap is not inherited unless the \fB\-o errtrace\fP shell option has +been enabled. +.PP +Variables local to the function may be declared with the +.B local +builtin command. Ordinarily, variables and their values +are shared between the function and its caller. +.PP +The \fBFUNCNEST\fP variable, if set to a numeric value greater +than 0, defines a maximum function nesting level. Function +invocations that exceed the limit cause the entire command to +abort. +.PP +If the builtin command +.B return +is executed in a function, the function completes and +execution resumes with the next command after the function +call. +Any command associated with the \fBRETURN\fP trap is executed +before execution resumes. +When a function completes, the values of the +positional parameters and the special parameter +.B # +are restored to the values they had prior to the function's +execution. +.PP +Function names and definitions may be listed with the +.B \-f +option to the +.B declare +or +.B typeset +builtin commands. The +.B \-F +option to +.B declare +or +.B typeset +will list the function names only +(and optionally the source file and line number, if the \fBextdebug\fP +shell option is enabled). +Functions may be exported so that subshells +automatically have them defined with the +.B \-f +option to the +.B export +builtin. +A function definition may be deleted using the \fB\-f\fP option to +the +.B unset +builtin. +Note that shell functions and variables with the same name may result +in multiple identically-named entries in the environment passed to the +shell's children. +Care should be taken in cases where this may cause a problem. +.PP +Functions may be recursive. +The \fBFUNCNEST\fP variable may be used to limit the depth of the +function call stack and restrict the number of function invocations. +By default, no limit is imposed on the number of recursive calls. +.SH "ARITHMETIC EVALUATION" +The shell allows arithmetic expressions to be evaluated, under +certain circumstances (see the \fBlet\fP and \fBdeclare\fP builtin +commands and \fBArithmetic Expansion\fP). +Evaluation is done in fixed-width integers with no check for overflow, +though division by 0 is trapped and flagged as an error. +The operators and their precedence, associativity, and values +are the same as in the C language. +The following list of operators is grouped into levels of +equal-precedence operators. +The levels are listed in order of decreasing precedence. +.PP +.PD 0 +.TP +.B \fIid\fP++ \fIid\fP\-\- +variable post-increment and post-decrement +.TP +.B ++\fIid\fP \-\-\fIid\fP +variable pre-increment and pre-decrement +.TP +.B \- + +unary minus and plus +.TP +.B ! ~ +logical and bitwise negation +.TP +.B ** +exponentiation +.TP +.B * / % +multiplication, division, remainder +.TP +.B + \- +addition, subtraction +.TP +.B << >> +left and right bitwise shifts +.TP +.B <= >= < > +comparison +.TP +.B == != +equality and inequality +.TP +.B & +bitwise AND +.TP +.B ^ +bitwise exclusive OR +.TP +.B | +bitwise OR +.TP +.B && +logical AND +.TP +.B || +logical OR +.TP +.B \fIexpr\fP?\fIexpr\fP:\fIexpr\fP +conditional operator +.TP +.B = *= /= %= += \-= <<= >>= &= ^= |= +assignment +.TP +.B \fIexpr1\fP , \fIexpr2\fP +comma +.PD +.PP +Shell variables are allowed as operands; parameter expansion is +performed before the expression is evaluated. +Within an expression, shell variables may also be referenced by name +without using the parameter expansion syntax. +A shell variable that is null or unset evaluates to 0 when referenced +by name without using the parameter expansion syntax. +The value of a variable is evaluated as an arithmetic expression +when it is referenced, or when a variable which has been given the +\fIinteger\fP attribute using \fBdeclare -i\fP is assigned a value. +A null value evaluates to 0. +A shell variable need not have its \fIinteger\fP attribute +turned on to be used in an expression. +.PP +Constants with a leading 0 are interpreted as octal numbers. +A leading 0x or 0X denotes hexadecimal. +Otherwise, numbers take the form [\fIbase#\fP]n, where the optional \fIbase\fP +is a decimal number between 2 and 64 representing the arithmetic +base, and \fIn\fP is a number in that base. +If \fIbase#\fP is omitted, then base 10 is used. +When specifying \fIn\fP, +the digits greater< than 9 are represented by the lowercase letters, +the uppercase letters, @, and _, in that order. +If \fIbase\fP is less than or equal to 36, lowercase and uppercase +letters may be used interchangeably to represent numbers between 10 +and 35. +.PP +Operators are evaluated in order of precedence. Sub-expressions in +parentheses are evaluated first and may override the precedence +rules above. +.SH "CONDITIONAL EXPRESSIONS" +Conditional expressions are used by the \fB[[\fP compound command and +the \fBtest\fP and \fB[\fP builtin commands to test file attributes +and perform string and arithmetic comparisons. +Expressions are formed from the following unary or binary primaries. +If any \fIfile\fP argument to one of the primaries is of the form +\fI/dev/fd/n\fP, then file descriptor \fIn\fP is checked. +If the \fIfile\fP argument to one of the primaries is one of +\fI/dev/stdin\fP, \fI/dev/stdout\fP, or \fI/dev/stderr\fP, file +descriptor 0, 1, or 2, respectively, is checked. +.PP +Unless otherwise specified, primaries that operate on files follow symbolic +links and operate on the target of the link, rather than the link itself. +.if t .sp 0.5 +.if n .sp 1 +When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort +lexicographically using the current locale. +The \fBtest\fP command sorts using ASCII ordering. +.sp 1 +.PD 0 +.TP +.B \-a \fIfile\fP +True if \fIfile\fP exists. +.TP +.B \-b \fIfile\fP +True if \fIfile\fP exists and is a block special file. +.TP +.B \-c \fIfile\fP +True if \fIfile\fP exists and is a character special file. +.TP +.B \-d \fIfile\fP +True if \fIfile\fP exists and is a directory. +.TP +.B \-e \fIfile\fP +True if \fIfile\fP exists. +.TP +.B \-f \fIfile\fP +True if \fIfile\fP exists and is a regular file. +.TP +.B \-g \fIfile\fP +True if \fIfile\fP exists and is set-group-id. +.TP +.B \-h \fIfile\fP +True if \fIfile\fP exists and is a symbolic link. +.TP +.B \-k \fIfile\fP +True if \fIfile\fP exists and its ``sticky'' bit is set. +.TP +.B \-p \fIfile\fP +True if \fIfile\fP exists and is a named pipe (FIFO). +.TP +.B \-r \fIfile\fP +True if \fIfile\fP exists and is readable. +.TP +.B \-s \fIfile\fP +True if \fIfile\fP exists and has a size greater than zero. +.TP +.B \-t \fIfd\fP +True if file descriptor +.I fd +is open and refers to a terminal. +.TP +.B \-u \fIfile\fP +True if \fIfile\fP exists and its set-user-id bit is set. +.TP +.B \-w \fIfile\fP +True if \fIfile\fP exists and is writable. +.TP +.B \-x \fIfile\fP +True if \fIfile\fP exists and is executable. +.TP +.B \-G \fIfile\fP +True if \fIfile\fP exists and is owned by the effective group id. +.TP +.B \-L \fIfile\fP +True if \fIfile\fP exists and is a symbolic link. +.TP +.B \-N \fIfile\fP +True if \fIfile\fP exists and has been modified since it was last read. +.TP +.B \-O \fIfile\fP +True if \fIfile\fP exists and is owned by the effective user id. +.TP +.B \-S \fIfile\fP +True if \fIfile\fP exists and is a socket. +.TP +\fIfile1\fP \fB\-ef\fP \fIfile2\fP +True if \fIfile1\fP and \fIfile2\fP refer to the same device and +inode numbers. +.TP +\fIfile1\fP \-\fBnt\fP \fIfile2\fP +True if \fIfile1\fP is newer (according to modification date) than \fIfile2\fP, +or if \fIfile1\fP exists and \fPfile2\fP does not. +.TP +\fIfile1\fP \-\fBot\fP \fIfile2\fP +True if \fIfile1\fP is older than \fIfile2\fP, or if \fIfile2\fP exists +and \fIfile1\fP does not. +.TP +.B \-o \fIoptname\fP +True if the shell option +.I optname +is enabled. +See the list of options under the description of the +.B \-o +option to the +.B set +builtin below. +.TP +.B \-v \fIvarname\fP +True if the shell variable +.I varname +is set (has been assigned a value). +.TP +.B \-R \fIvarname\fP +True if the shell variable +.I varname +is set and is a name reference. +.TP +.B \-z \fIstring\fP +True if the length of \fIstring\fP is zero. +.TP +\fIstring\fP +.PD 0 +.TP +.B \-n \fIstring\fP +.PD +True if the length of +.I string +is non-zero. +.TP +\fIstring1\fP \fB==\fP \fIstring2\fP +.PD 0 +.TP +\fIstring1\fP \fB=\fP \fIstring2\fP +.PD +True if the strings are equal. \fB=\fP should be used +with the \fBtest\fP command for POSIX conformance. +When used with the \fB[[\fP command, this performs pattern matching as +described above (\fBCompound Commands\fP). +.TP +\fIstring1\fP \fB!=\fP \fIstring2\fP +True if the strings are not equal. +.TP +\fIstring1\fP \fB<\fP \fIstring2\fP +True if \fIstring1\fP sorts before \fIstring2\fP lexicographically. +.TP +\fIstring1\fP \fB>\fP \fIstring2\fP +True if \fIstring1\fP sorts after \fIstring2\fP lexicographically. +.TP +.I \fIarg1\fP \fBOP\fP \fIarg2\fP +.SM +.B OP +is one of +.BR \-eq , +.BR \-ne , +.BR \-lt , +.BR \-le , +.BR \-gt , +or +.BR \-ge . +These arithmetic binary operators return true if \fIarg1\fP +is equal to, not equal to, less than, less than or equal to, +greater than, or greater than or equal to \fIarg2\fP, respectively. +.I Arg1 +and +.I arg2 +may be positive or negative integers. +.PD +.SH "SIMPLE COMMAND EXPANSION" +When a simple command is executed, the shell performs the following +expansions, assignments, and redirections, from left to right. +.IP 1. +The words that the parser has marked as variable assignments (those +preceding the command name) and redirections are saved for later +processing. +.IP 2. +The words that are not variable assignments or redirections are +expanded. If any words remain after expansion, the first word +is taken to be the name of the command and the remaining words are +the arguments. +.IP 3. +Redirections are performed as described above under +.SM +.BR REDIRECTION . +.IP 4. +The text after the \fB=\fP in each variable assignment undergoes tilde +expansion, parameter expansion, command substitution, arithmetic expansion, +and quote removal before being assigned to the variable. +.PP +If no command name results, the variable assignments affect the current +shell environment. Otherwise, the variables are added to the environment +of the executed command and do not affect the current shell environment. +If any of the assignments attempts to assign a value to a readonly variable, +an error occurs, and the command exits with a non-zero status. +.PP +If no command name results, redirections are performed, but do not +affect the current shell environment. A redirection error causes the +command to exit with a non-zero status. +.PP +If there is a command name left after expansion, execution proceeds as +described below. Otherwise, the command exits. If one of the expansions +contained a command substitution, the exit status of the command is +the exit status of the last command substitution performed. If there +were no command substitutions, the command exits with a status of zero. +.SH "COMMAND EXECUTION" +After a command has been split into words, if it results in a +simple command and an optional list of arguments, the following +actions are taken. +.PP +If the command name contains no slashes, the shell attempts to +locate it. If there exists a shell function by that name, that +function is invoked as described above in +.SM +.BR FUNCTIONS . +If the name does not match a function, the shell searches for +it in the list of shell builtins. If a match is found, that +builtin is invoked. +.PP +If the name is neither a shell function nor a builtin, +and contains no slashes, +.B bash +searches each element of the +.SM +.B PATH +for a directory containing an executable file by that name. +.B Bash +uses a hash table to remember the full pathnames of executable +files (see +.B hash +under +.SM +.B "SHELL BUILTIN COMMANDS" +below). +A full search of the directories in +.SM +.B PATH +is performed only if the command is not found in the hash table. +If the search is unsuccessful, the shell searches for a defined shell +function named \fBcommand_not_found_handle\fP. +If that function exists, it is invoked with the original command and +the original command's arguments as its arguments, and the function's +exit status becomes the exit status of the shell. +If that function is not defined, the shell prints an error +message and returns an exit status of 127. +.PP +If the search is successful, or if the command name contains +one or more slashes, the shell executes the named program in a +separate execution environment. +Argument 0 is set to the name given, and the remaining arguments +to the command are set to the arguments given, if any. +.PP +If this execution fails because the file is not in executable +format, and the file is not a directory, it is assumed to be +a \fIshell script\fP, a file +containing shell commands. A subshell is spawned to execute +it. This subshell reinitializes itself, so +that the effect is as if a new shell had been invoked +to handle the script, with the exception that the locations of +commands remembered by the parent (see +.B hash +below under +.SM +\fBSHELL BUILTIN COMMANDS\fP) +are retained by the child. +.PP +If the program is a file beginning with +.BR #! , +the remainder of the first line specifies an interpreter +for the program. The shell executes the +specified interpreter on operating systems that do not +handle this executable format themselves. The arguments to the +interpreter consist of a single optional argument following the +interpreter name on the first line of the program, followed +by the name of the program, followed by the command +arguments, if any. +.SH COMMAND EXECUTION ENVIRONMENT +The shell has an \fIexecution environment\fP, which consists of the +following: +.IP \(bu +open files inherited by the shell at invocation, as modified by +redirections supplied to the \fBexec\fP builtin +.IP \(bu +the current working directory as set by \fBcd\fP, \fBpushd\fP, or +\fBpopd\fP, or inherited by the shell at invocation +.IP \(bu +the file creation mode mask as set by \fBumask\fP or inherited from +the shell's parent +.IP \(bu +current traps set by \fBtrap\fP +.IP \(bu +shell parameters that are set by variable assignment or with \fBset\fP +or inherited from the shell's parent in the environment +.IP \(bu +shell functions defined during execution or inherited from the shell's +parent in the environment +.IP \(bu +options enabled at invocation (either by default or with command-line +arguments) or by \fBset\fP +.IP \(bu +options enabled by \fBshopt\fP +.IP \(bu +shell aliases defined with \fBalias\fP +.IP \(bu +various process IDs, including those of background jobs, the value +of \fB$$\fP, and the value of +.SM +.B PPID +.PP +When a simple command other than a builtin or shell function +is to be executed, it +is invoked in a separate execution environment that consists of +the following. Unless otherwise noted, the values are inherited +from the shell. +.if n .sp 1 +.IP \(bu +the shell's open files, plus any modifications and additions specified +by redirections to the command +.IP \(bu +the current working directory +.IP \(bu +the file creation mode mask +.IP \(bu +shell variables and functions marked for export, along with variables +exported for the command, passed in the environment +.IP \(bu +traps caught by the shell are reset to the values inherited from the +shell's parent, and traps ignored by the shell are ignored +.PP +A command invoked in this separate environment cannot affect the +shell's execution environment. +.PP +Command substitution, commands grouped with parentheses, +and asynchronous commands are invoked in a +subshell environment that is a duplicate of the shell environment, +except that traps caught by the shell are reset to the values +that the shell inherited from its parent at invocation. Builtin +commands that are invoked as part of a pipeline are also executed in a +subshell environment. Changes made to the subshell environment +cannot affect the shell's execution environment. +.PP +Subshells spawned to execute command substitutions inherit the value of +the \fB\-e\fP option from the parent shell. When not in \fIposix\fP mode, +\fBbash\fP clears the \fB\-e\fP option in such subshells. +.PP +If a command is followed by a \fB&\fP and job control is not active, the +default standard input for the command is the empty file \fI/dev/null\fP. +Otherwise, the invoked command inherits the file descriptors of the calling +shell as modified by redirections. +.SH ENVIRONMENT +When a program is invoked it is given an array of strings +called the +.IR environment . +This is a list of +\fIname\fP\-\fIvalue\fP pairs, of the form +.IR "name\fR=\fPvalue" . +.PP +The shell provides several ways to manipulate the environment. +On invocation, the shell scans its own environment and +creates a parameter for each name found, automatically marking +it for +.I export +to child processes. Executed commands inherit the environment. +The +.B export +and +.B declare \-x +commands allow parameters and functions to be added to and +deleted from the environment. If the value of a parameter +in the environment is modified, the new value becomes part +of the environment, replacing the old. The environment +inherited by any executed command consists of the shell's +initial environment, whose values may be modified in the shell, +less any pairs removed by the +.B unset +command, plus any additions via the +.B export +and +.B declare \-x +commands. +.PP +The environment for any +.I simple command +or function may be augmented temporarily by prefixing it with +parameter assignments, as described above in +.SM +.BR PARAMETERS . +These assignment statements affect only the environment seen +by that command. +.PP +If the +.B \-k +option is set (see the +.B set +builtin command below), then +.I all +parameter assignments are placed in the environment for a command, +not just those that precede the command name. +.PP +When +.B bash +invokes an external command, the variable +.B _ +is set to the full filename of the command and passed to that +command in its environment. +.SH "EXIT STATUS" +.PP +The exit status of an executed command is the value returned by the +\fIwaitpid\fP system call or equivalent function. Exit statuses +fall between 0 and 255, though, as explained below, the shell may +use values above 125 specially. Exit statuses from shell builtins and +compound commands are also limited to this range. Under certain +circumstances, the shell will use special values to indicate specific +failure modes. +.PP +For the shell's purposes, a command which exits with a +zero exit status has succeeded. An exit status of zero +indicates success. A non-zero exit status indicates failure. +When a command terminates on a fatal signal \fIN\fP, \fBbash\fP uses +the value of 128+\fIN\fP as the exit status. +.PP +If a command is not found, the child process created to +execute it returns a status of 127. If a command is found +but is not executable, the return status is 126. +.PP +If a command fails because of an error during expansion or redirection, +the exit status is greater than zero. +.PP +Shell builtin commands return a status of 0 (\fItrue\fP) if +successful, and non-zero (\fIfalse\fP) if an error occurs +while they execute. +All builtins return an exit status of 2 to indicate incorrect usage. +.PP +\fBBash\fP itself returns the exit status of the last command +executed, unless a syntax error occurs, in which case it exits +with a non-zero value. See also the \fBexit\fP builtin +command below. +.SH SIGNALS +When \fBbash\fP is interactive, in the absence of any traps, it ignores +.SM +.B SIGTERM +(so that \fBkill 0\fP does not kill an interactive shell), +and +.SM +.B SIGINT +is caught and handled (so that the \fBwait\fP builtin is interruptible). +In all cases, \fBbash\fP ignores +.SM +.BR SIGQUIT . +If job control is in effect, +.B bash +ignores +.SM +.BR SIGTTIN , +.SM +.BR SIGTTOU , +and +.SM +.BR SIGTSTP . +.PP +Non-builtin commands run by \fBbash\fP have signal handlers +set to the values inherited by the shell from its parent. +When job control is not in effect, asynchronous commands +ignore +.SM +.B SIGINT +and +.SM +.B SIGQUIT +in addition to these inherited handlers. +Commands run as a result of command substitution ignore the +keyboard-generated job control signals +.SM +.BR SIGTTIN , +.SM +.BR SIGTTOU , +and +.SM +.BR SIGTSTP . +.PP +The shell exits by default upon receipt of a +.SM +.BR SIGHUP . +Before exiting, an interactive shell resends the +.SM +.B SIGHUP +to all jobs, running or stopped. +Stopped jobs are sent +.SM +.B SIGCONT +to ensure that they receive the +.SM +.BR SIGHUP . +To prevent the shell from +sending the signal to a particular job, it should be removed from the +jobs table with the +.B disown +builtin (see +.SM +.B "SHELL BUILTIN COMMANDS" +below) or marked +to not receive +.SM +.B SIGHUP +using +.BR "disown \-h" . +.PP +If the +.B huponexit +shell option has been set with +.BR shopt , +.B bash +sends a +.SM +.B SIGHUP +to all jobs when an interactive login shell exits. +.PP +If \fBbash\fP is waiting for a command to complete and receives a signal +for which a trap has been set, the trap will not be executed until +the command completes. +When \fBbash\fP is waiting for an asynchronous command via the \fBwait\fP +builtin, the reception of a signal for which a trap has been set will +cause the \fBwait\fP builtin to return immediately with an exit status +greater than 128, immediately after which the trap is executed. +.SH "JOB CONTROL" +.I Job control +refers to the ability to selectively stop (\fIsuspend\fP) +the execution of processes and continue (\fIresume\fP) +their execution at a later point. A user typically employs +this facility via an interactive interface supplied jointly +by the operating system kernel's terminal driver and +.BR bash . +.PP +The shell associates a +.I job +with each pipeline. It keeps a table of currently executing +jobs, which may be listed with the +.B jobs +command. When +.B bash +starts a job asynchronously (in the +.IR background ), +it prints a line that looks like: +.RS +.PP +[1] 25647 +.RE +.PP +indicating that this job is job number 1 and that the process ID +of the last process in the pipeline associated with this job is 25647. +All of the processes in a single pipeline are members of the same job. +.B Bash +uses the +.I job +abstraction as the basis for job control. +.PP +To facilitate the implementation of the user interface to job +control, the operating system maintains the notion of a \fIcurrent terminal +process group ID\fP. Members of this process group (processes whose +process group ID is equal to the current terminal process group ID) +receive keyboard-generated signals such as +.SM +.BR SIGINT . +These processes are said to be in the +.IR foreground . +.I Background +processes are those whose process group ID differs from the terminal's; +such processes are immune to keyboard-generated signals. +Only foreground processes are allowed to read from or, if the +user so specifies with \f(CWstty tostop\fP, write to the +terminal. +Background processes which attempt to read from (write to when +\f(CWstty tostop\fP is in effect) the +terminal are sent a +.SM +.B SIGTTIN (SIGTTOU) +signal by the kernel's terminal driver, +which, unless caught, suspends the process. +.PP +If the operating system on which +.B bash +is running supports +job control, +.B bash +contains facilities to use it. +Typing the +.I suspend +character (typically +.BR ^Z , +Control-Z) while a process is running +causes that process to be stopped and returns control to +.BR bash . +Typing the +.I "delayed suspend" +character (typically +.BR ^Y , +Control-Y) causes the process to be stopped when it +attempts to read input from the terminal, and control to +be returned to +.BR bash . +The user may then manipulate the state of this job, using the +.B bg +command to continue it in the background, the +.B fg +command to continue it in the foreground, or +the +.B kill +command to kill it. A \fB^Z\fP takes effect immediately, +and has the additional side effect of causing pending output +and typeahead to be discarded. +.PP +There are a number of ways to refer to a job in the shell. +The character +.B % +introduces a job specification (\fIjobspec\fP). Job number +.I n +may be referred to as +.BR %n . +A job may also be referred to using a prefix of the name used to +start it, or using a substring that appears in its command line. +For example, +.B %ce +refers to a stopped +.B ce +job. If a prefix matches more than one job, +.B bash +reports an error. Using +.BR %?ce , +on the other hand, refers to any job containing the string +.B ce +in its command line. If the substring matches more than one job, +.B bash +reports an error. The symbols +.B %% +and +.B %+ +refer to the shell's notion of the +.IR "current job" , +which is the last job stopped while it was in +the foreground or started in the background. +The +.I "previous job" +may be referenced using +.BR %\- . +If there is only a single job, \fB%+\fP and \fB%\-\fP can both be used +to refer to that job. +In output pertaining to jobs (e.g., the output of the +.B jobs +command), the current job is always flagged with a +.BR + , +and the previous job with a +.BR \- . +A single % (with no accompanying job specification) also refers to the +current job. +.PP +Simply naming a job can be used to bring it into the +foreground: +.B %1 +is a synonym for +\fB``fg %1''\fP, +bringing job 1 from the background into the foreground. +Similarly, +.B ``%1 &'' +resumes job 1 in the background, equivalent to +\fB``bg %1''\fP. +.PP +The shell learns immediately whenever a job changes state. +Normally, +.B bash +waits until it is about to print a prompt before reporting +changes in a job's status so as to not interrupt +any other output. If the +.B \-b +option to the +.B set +builtin command +is enabled, +.B bash +reports such changes immediately. +Any trap on +.SM +.B SIGCHLD +is executed for each child that exits. +.PP +If an attempt to exit +.B bash +is made while jobs are stopped (or, if the \fBcheckjobs\fP shell option has +been enabled using the \fBshopt\fP builtin, running), the shell prints a +warning message, and, if the \fBcheckjobs\fP option is enabled, lists the +jobs and their statuses. +The +.B jobs +command may then be used to inspect their status. +If a second attempt to exit is made without an intervening command, +the shell does not print another warning, and any stopped +jobs are terminated. +.SH PROMPTING +When executing interactively, +.B bash +displays the primary prompt +.SM +.B PS1 +when it is ready to read a command, and the secondary prompt +.SM +.B PS2 +when it needs more input to complete a command. +.B Bash +allows these prompt strings to be customized by inserting a number of +backslash-escaped special characters that are decoded as follows: +.RS +.PD 0 +.TP +.B \ea +an ASCII bell character (07) +.TP +.B \ed +the date in "Weekday Month Date" format (e.g., "Tue May 26") +.TP +.B \eD{\fIformat\fP} +the \fIformat\fP is passed to \fIstrftime\fP(3) and the result is inserted +into the prompt string; an empty \fIformat\fP results in a locale-specific +time representation. The braces are required +.TP +.B \ee +an ASCII escape character (033) +.TP +.B \eh +the hostname up to the first `.' +.TP +.B \eH +the hostname +.TP +.B \ej +the number of jobs currently managed by the shell +.TP +.B \el +the basename of the shell's terminal device name +.TP +.B \en +newline +.TP +.B \er +carriage return +.TP +.B \es +the name of the shell, the basename of +.B $0 +(the portion following the final slash) +.TP +.B \et +the current time in 24-hour HH:MM:SS format +.TP +.B \eT +the current time in 12-hour HH:MM:SS format +.TP +.B \e@ +the current time in 12-hour am/pm format +.TP +.B \eA +the current time in 24-hour HH:MM format +.TP +.B \eu +the username of the current user +.TP +.B \ev +the version of \fBbash\fP (e.g., 2.00) +.TP +.B \eV +the release of \fBbash\fP, version + patch level (e.g., 2.00.0) +.TP +.B \ew +the current working directory, with +.SM +.B $HOME +abbreviated with a tilde +(uses the value of the +.SM +.B PROMPT_DIRTRIM +variable) +.TP +.B \eW +the basename of the current working directory, with +.SM +.B $HOME +abbreviated with a tilde +.TP +.B \e! +the history number of this command +.TP +.B \e# +the command number of this command +.TP +.B \e$ +if the effective UID is 0, a +.BR # , +otherwise a +.B $ +.TP +.B \e\fInnn\fP +the character corresponding to the octal number \fInnn\fP +.TP +.B \e\e +a backslash +.TP +.B \e[ +begin a sequence of non-printing characters, which could be used to +embed a terminal control sequence into the prompt +.TP +.B \e] +end a sequence of non-printing characters +.PD +.RE +.PP +The command number and the history number are usually different: +the history number of a command is its position in the history +list, which may include commands restored from the history file +(see +.SM +.B HISTORY +below), while the command number is the position in the sequence +of commands executed during the current shell session. +After the string is decoded, it is expanded via +parameter expansion, command substitution, arithmetic +expansion, and quote removal, subject to the value of the +.B promptvars +shell option (see the description of the +.B shopt +command under +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.SH READLINE +This is the library that handles reading input when using an interactive +shell, unless the +.B \-\-noediting +option is given at shell invocation. +Line editing is also used when using the \fB\-e\fP option to the +\fBread\fP builtin. +By default, the line editing commands are similar to those of Emacs. +A vi-style line editing interface is also available. +Line editing can be enabled at any time using the +.B \-o emacs +or +.B \-o vi +options to the +.B set +builtin (see +.SM +.B SHELL BUILTIN COMMANDS +below). +To turn off line editing after the shell is running, use the +.B +o emacs +or +.B +o vi +options to the +.B set +builtin. +.SS "Readline Notation" +.PP +In this section, the Emacs-style notation is used to denote +keystrokes. Control keys are denoted by C\-\fIkey\fR, e.g., C\-n +means Control\-N. Similarly, +.I meta +keys are denoted by M\-\fIkey\fR, so M\-x means Meta\-X. (On keyboards +without a +.I meta +key, M\-\fIx\fP means ESC \fIx\fP, i.e., press the Escape key +then the +.I x +key. This makes ESC the \fImeta prefix\fP. +The combination M\-C\-\fIx\fP means ESC\-Control\-\fIx\fP, +or press the Escape key +then hold the Control key while pressing the +.I x +key.) +.PP +Readline commands may be given numeric +.IR arguments , +which normally act as a repeat count. +Sometimes, however, it is the sign of the argument that is significant. +Passing a negative argument to a command that acts in the forward +direction (e.g., \fBkill\-line\fP) causes that command to act in a +backward direction. +Commands whose behavior with arguments deviates from this are noted +below. +.PP +When a command is described as \fIkilling\fP text, the text +deleted is saved for possible future retrieval +(\fIyanking\fP). The killed text is saved in a +\fIkill ring\fP. Consecutive kills cause the text to be +accumulated into one unit, which can be yanked all at once. +Commands which do not kill text separate the chunks of text +on the kill ring. +.SS "Readline Initialization" +.PP +Readline is customized by putting commands in an initialization +file (the \fIinputrc\fP file). +The name of this file is taken from the value of the +.SM +.B INPUTRC +variable. If that variable is unset, the default is +.IR ~/.inputrc . +When a program which uses the readline library starts up, the +initialization file is read, and the key bindings and variables +are set. +There are only a few basic constructs allowed in the +readline initialization file. +Blank lines are ignored. +Lines beginning with a \fB#\fP are comments. +Lines beginning with a \fB$\fP indicate conditional constructs. +Other lines denote key bindings and variable settings. +.PP +The default key-bindings may be changed with an +.I inputrc +file. +Other programs that use this library may add their own commands +and bindings. +.PP +For example, placing +.RS +.PP +M\-Control\-u: universal\-argument +.RE +or +.RS +C\-Meta\-u: universal\-argument +.RE +into the +.I inputrc +would make M\-C\-u execute the readline command +.IR universal\-argument . +.PP +The following symbolic character names are recognized: +.IR RUBOUT , +.IR DEL , +.IR ESC , +.IR LFD , +.IR NEWLINE , +.IR RET , +.IR RETURN , +.IR SPC , +.IR SPACE , +and +.IR TAB . +.PP +In addition to command names, readline allows keys to be bound +to a string that is inserted when the key is pressed (a \fImacro\fP). +.SS "Readline Key Bindings" +.PP +The syntax for controlling key bindings in the +.I inputrc +file is simple. All that is required is the name of the +command or the text of a macro and a key sequence to which +it should be bound. The name may be specified in one of two ways: +as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP +prefixes, or as a key sequence. +.PP +When using the form \fBkeyname\fP:\^\fIfunction\-name\fP or \fImacro\fP, +.I keyname +is the name of a key spelled out in English. For example: +.sp +.RS +Control-u: universal\-argument +.br +Meta-Rubout: backward-kill-word +.br +Control-o: "> output" +.RE +.LP +In the above example, +.I C\-u +is bound to the function +.BR universal\-argument , +.I M\-DEL +is bound to the function +.BR backward\-kill\-word , +and +.I C\-o +is bound to run the macro +expressed on the right hand side (that is, to insert the text +.if t \f(CW> output\fP +.if n ``> output'' +into the line). +.PP +In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP, +.B keyseq +differs from +.B keyname +above in that strings denoting +an entire key sequence may be specified by placing the sequence +within double quotes. Some GNU Emacs style key escapes can be +used, as in the following example, but the symbolic character names +are not recognized. +.sp +.RS +"\eC\-u": universal\-argument +.br +"\eC\-x\eC\-r": re\-read\-init\-file +.br +"\ee[11~": "Function Key 1" +.RE +.PP +In this example, +.I C\-u +is again bound to the function +.BR universal\-argument . +.I "C\-x C\-r" +is bound to the function +.BR re\-read\-init\-file , +and +.I "ESC [ 1 1 ~" +is bound to insert the text +.if t \f(CWFunction Key 1\fP. +.if n ``Function Key 1''. +.PP +The full set of GNU Emacs style escape sequences is +.RS +.PD 0 +.TP +.B \eC\- +control prefix +.TP +.B \eM\- +meta prefix +.TP +.B \ee +an escape character +.TP +.B \e\e +backslash +.TP +.B \e" +literal " +.TP +.B \e\(aq +literal \(aq +.RE +.PD +.PP +In addition to the GNU Emacs style escape sequences, a second +set of backslash escapes is available: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ed +delete +.TP +.B \ef +form feed +.TP +.B \en +newline +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(one to three digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.RE +.PD +.PP +When entering the text of a macro, single or double quotes must +be used to indicate a macro definition. +Unquoted text is assumed to be a function name. +In the macro body, the backslash escapes described above are expanded. +Backslash will quote any other character in the macro text, +including " and \(aq. +.PP +.B Bash +allows the current readline key bindings to be displayed or modified +with the +.B bind +builtin command. The editing mode may be switched during interactive +use by using the +.B \-o +option to the +.B set +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SS "Readline Variables" +.PP +Readline has variables that can be used to further customize its +behavior. A variable may be set in the +.I inputrc +file with a statement of the form +.RS +.PP +\fBset\fP \fIvariable\-name\fP \fIvalue\fP +.RE +.PP +Except where noted, readline variables can take the values +.B On +or +.B Off +(without regard to case). +Unrecognized variable names are ignored. +When a variable value is read, empty or null values, "on" (case-insensitive), +and "1" are equivalent to \fBOn\fP. All other values are equivalent to +\fBOff\fP. +The variables and their default values are: +.PP +.PD 0 +.TP +.B bell\-style (audible) +Controls what happens when readline wants to ring the terminal bell. +If set to \fBnone\fP, readline never rings the bell. If set to +\fBvisible\fP, readline uses a visible bell if one is available. +If set to \fBaudible\fP, readline attempts to ring the terminal's bell. +.TP +.B bind\-tty\-special\-chars (On) +If set to \fBOn\fP, readline attempts to bind the control characters +treated specially by the kernel's terminal driver to their readline +equivalents. +.TP +.B colored\-stats (Off) +If set to \fBOn\fP, readline displays possible completions using different +colors to indicate their file type. +The color definitions are taken from the value of the \fBLS_COLORS\fP +environment variable. +.TP +.B comment\-begin (``#'') +The string that is inserted when the readline +.B insert\-comment +command is executed. +This command is bound to +.B M\-# +in emacs mode and to +.B # +in vi command mode. +.TP +.B completion\-ignore\-case (Off) +If set to \fBOn\fP, readline performs filename matching and completion +in a case\-insensitive fashion. +.TP +.B completion\-prefix\-display\-length (0) +The length in characters of the common prefix of a list of possible +completions that is displayed without modification. When set to a +value greater than zero, common prefixes longer than this value are +replaced with an ellipsis when displaying possible completions. +.TP +.B completion\-query\-items (100) +This determines when the user is queried about viewing +the number of possible completions +generated by the \fBpossible\-completions\fP command. +It may be set to any integer value greater than or equal to +zero. If the number of possible completions is greater than +or equal to the value of this variable, the user is asked whether +or not he wishes to view them; otherwise they are simply listed +on the terminal. +.TP +.B convert\-meta (On) +If set to \fBOn\fP, readline will convert characters with the +eighth bit set to an ASCII key sequence +by stripping the eighth bit and prefixing an +escape character (in effect, using escape as the \fImeta prefix\fP). +.TP +.B disable\-completion (Off) +If set to \fBOn\fP, readline will inhibit word completion. Completion +characters will be inserted into the line as if they had been +mapped to \fBself-insert\fP. +.TP +.B editing\-mode (emacs) +Controls whether readline begins with a set of key bindings similar +to \fIEmacs\fP or \fIvi\fP. +.B editing\-mode +can be set to either +.B emacs +or +.BR vi . +.TP +.B echo\-control\-characters (On) +When set to \fBOn\fP, on operating systems that indicate they support it, +readline echoes a character corresponding to a signal generated from the +keyboard. +.TP +.B enable\-keypad (Off) +When set to \fBOn\fP, readline will try to enable the application +keypad when it is called. Some systems need this to enable the +arrow keys. +.TP +.B enable\-meta\-key (On) +When set to \fBOn\fP, readline will try to enable any meta modifier +key the terminal claims to support when it is called. On many terminals, +the meta key is used to send eight-bit characters. +.TP +.B expand\-tilde (Off) +If set to \fBOn\fP, tilde expansion is performed when readline +attempts word completion. +.TP +.B history\-preserve\-point (Off) +If set to \fBOn\fP, the history code attempts to place point at the +same location on each history line retrieved with \fBprevious-history\fP +or \fBnext-history\fP. +.TP +.B history\-size (0) +Set the maximum number of history entries saved in the history list. +If set to zero, any existing history entries are deleted and no new entries +are saved. +If set to a value less than zero, the number of history entries is not +limited. +By default, the number of history entries is not limited. +.TP +.B horizontal\-scroll\-mode (Off) +When set to \fBOn\fP, makes readline use a single line for display, +scrolling the input horizontally on a single screen line when it +becomes longer than the screen width rather than wrapping to a new line. +.TP +.B input\-meta (Off) +If set to \fBOn\fP, readline will enable eight-bit input (that is, +it will not strip the high bit from the characters it reads), +regardless of what the terminal claims it can support. The name +.B meta\-flag +is a synonym for this variable. +.TP +.B isearch\-terminators (``C\-[C\-J'') +The string of characters that should terminate an incremental +search without subsequently executing the character as a command. +If this variable has not been given a value, the characters +\fIESC\fP and \fIC\-J\fP will terminate an incremental search. +.TP +.B keymap (emacs) +Set the current readline keymap. The set of valid keymap names is +\fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi, +vi\-command\fP, and +.IR vi\-insert . +\fIvi\fP is equivalent to \fIvi\-command\fP; \fIemacs\fP is +equivalent to \fIemacs\-standard\fP. The default value is +.IR emacs ; +the value of +.B editing\-mode +also affects the default keymap. +.TP +.B keyseq\-timeout (500) +Specifies the duration \fIreadline\fP will wait for a character when reading an +ambiguous key sequence (one that can form a complete key sequence using +the input read so far, or can take additional input to complete a longer +key sequence). +If no input is received within the timeout, \fIreadline\fP will use the shorter +but complete key sequence. +The value is specified in milliseconds, so a value of 1000 means that +\fIreadline\fP will wait one second for additional input. +If this variable is set to a value less than or equal to zero, or to a +non-numeric value, \fIreadline\fP will wait until another key is pressed to +decide which key sequence to complete. +.TP +.B mark\-directories (On) +If set to \fBOn\fP, completed directory names have a slash +appended. +.TP +.B mark\-modified\-lines (Off) +If set to \fBOn\fP, history lines that have been modified are displayed +with a preceding asterisk (\fB*\fP). +.TP +.B mark\-symlinked\-directories (Off) +If set to \fBOn\fP, completed names which are symbolic links to directories +have a slash appended (subject to the value of +\fBmark\-directories\fP). +.TP +.B match\-hidden\-files (On) +This variable, when set to \fBOn\fP, causes readline to match files whose +names begin with a `.' (hidden files) when performing filename +completion. +If set to \fBOff\fP, the leading `.' must be +supplied by the user in the filename to be completed. +.TP +.B menu\-complete\-display\-prefix (Off) +If set to \fBOn\fP, menu completion displays the common prefix of the +list of possible completions (which may be empty) before cycling through +the list. +.TP +.B output\-meta (Off) +If set to \fBOn\fP, readline will display characters with the +eighth bit set directly rather than as a meta-prefixed escape +sequence. +.TP +.B page\-completions (On) +If set to \fBOn\fP, readline uses an internal \fImore\fP-like pager +to display a screenful of possible completions at a time. +.TP +.B print\-completions\-horizontally (Off) +If set to \fBOn\fP, readline will display completions with matches +sorted horizontally in alphabetical order, rather than down the screen. +.TP +.B revert\-all\-at\-newline (Off) +If set to \fBOn\fP, readline will undo all changes to history lines +before returning when \fBaccept\-line\fP is executed. By default, +history lines may be modified and retain individual undo lists across +calls to \fBreadline\fP. +.TP +.B show\-all\-if\-ambiguous (Off) +This alters the default behavior of the completion functions. If +set to +.BR On , +words which have more than one possible completion cause the +matches to be listed immediately instead of ringing the bell. +.TP +.B show\-all\-if\-unmodified (Off) +This alters the default behavior of the completion functions in +a fashion similar to \fBshow\-all\-if\-ambiguous\fP. +If set to +.BR On , +words which have more than one possible completion without any +possible partial completion (the possible completions don't share +a common prefix) cause the matches to be listed immediately instead +of ringing the bell. +.TP +.B show\-mode\-in\-prompt (Off) +If set to \fBOn\fP, add a character to the beginning of the prompt +indicating the editing mode: emacs (@), vi command (:) or vi +insertion (+). +.TP +.B skip\-completed\-text (Off) +If set to \fBOn\fP, this alters the default completion behavior when +inserting a single match into the line. It's only active when +performing completion in the middle of a word. If enabled, readline +does not insert characters from the completion that match characters +after point in the word being completed, so portions of the word +following the cursor are not duplicated. +.TP +.B visible\-stats (Off) +If set to \fBOn\fP, a character denoting a file's type as reported +by \fIstat\fP(2) is appended to the filename when listing possible +completions. +.PD +.SS "Readline Conditional Constructs" +.PP +Readline implements a facility similar in spirit to the conditional +compilation features of the C preprocessor which allows key +bindings and variable settings to be performed as the result +of tests. There are four parser directives used. +.IP \fB$if\fP +The +.B $if +construct allows bindings to be made based on the +editing mode, the terminal being used, or the application using +readline. The text of the test extends to the end of the line; +no characters are required to isolate it. +.RS +.IP \fBmode\fP +The \fBmode=\fP form of the \fB$if\fP directive is used to test +whether readline is in emacs or vi mode. +This may be used in conjunction +with the \fBset keymap\fP command, for instance, to set bindings in +the \fIemacs\-standard\fP and \fIemacs\-ctlx\fP keymaps only if +readline is starting out in emacs mode. +.IP \fBterm\fP +The \fBterm=\fP form may be used to include terminal-specific +key bindings, perhaps to bind the key sequences output by the +terminal's function keys. The word on the right side of the +.B = +is tested against the both full name of the terminal and the portion +of the terminal name before the first \fB\-\fP. This allows +.I sun +to match both +.I sun +and +.IR sun\-cmd , +for instance. +.IP \fBapplication\fP +The \fBapplication\fP construct is used to include +application-specific settings. Each program using the readline +library sets the \fIapplication name\fP, and an initialization +file can test for a particular value. +This could be used to bind key sequences to functions useful for +a specific program. For instance, the following command adds a +key sequence that quotes the current or previous word in \fBbash\fP: +.sp 1 +.RS +.nf +\fB$if\fP Bash +# Quote the current or previous word +"\eC\-xq": "\eeb\e"\eef\e"" +\fB$endif\fP +.fi +.RE +.RE +.IP \fB$endif\fP +This command, as seen in the previous example, terminates an +\fB$if\fP command. +.IP \fB$else\fP +Commands in this branch of the \fB$if\fP directive are executed if +the test fails. +.IP \fB$include\fP +This directive takes a single filename as an argument and reads commands +and bindings from that file. For example, the following directive +would read \fI/etc/inputrc\fP: +.sp 1 +.RS +.nf +\fB$include\fP \^ \fI/etc/inputrc\fP +.fi +.RE +.SS Searching +.PP +Readline provides commands for searching through the command history +(see +.SM +.B HISTORY +below) for lines containing a specified string. +There are two search modes: +.I incremental +and +.IR non-incremental . +.PP +Incremental searches begin before the user has finished typing the +search string. +As each character of the search string is typed, readline displays +the next entry from the history matching the string typed so far. +An incremental search requires only as many characters as needed to +find the desired history entry. +The characters present in the value of the \fBisearch-terminators\fP +variable are used to terminate an incremental search. +If that variable has not been assigned a value the Escape and +Control-J characters will terminate an incremental search. +Control-G will abort an incremental search and restore the original +line. +When the search is terminated, the history entry containing the +search string becomes the current line. +.PP +To find other matching entries in the history list, type Control-S or +Control-R as appropriate. +This will search backward or forward in the history for the next +entry matching the search string typed so far. +Any other key sequence bound to a readline command will terminate +the search and execute that command. +For instance, a \fInewline\fP will terminate the search and accept +the line, thereby executing the command from the history list. +.PP +Readline remembers the last incremental search string. If two +Control-Rs are typed without any intervening characters defining a +new search string, any remembered search string is used. +.PP +Non-incremental searches read the entire search string before starting +to search for matching history lines. The search string may be +typed by the user or be part of the contents of the current line. +.SS "Readline Command Names" +.PP +The following is a list of the names of the commands and the default +key sequences to which they are bound. +Command names without an accompanying key sequence are unbound by default. +In the following descriptions, \fIpoint\fP refers to the current cursor +position, and \fImark\fP refers to a cursor position saved by the +\fBset\-mark\fP command. +The text between the point and mark is referred to as the \fIregion\fP. +.SS Commands for Moving +.PP +.PD 0 +.TP +.B beginning\-of\-line (C\-a) +Move to the start of the current line. +.TP +.B end\-of\-line (C\-e) +Move to the end of the line. +.TP +.B forward\-char (C\-f) +Move forward a character. +.TP +.B backward\-char (C\-b) +Move back a character. +.TP +.B forward\-word (M\-f) +Move forward to the end of the next word. Words are composed of +alphanumeric characters (letters and digits). +.TP +.B backward\-word (M\-b) +Move back to the start of the current or previous word. +Words are composed of alphanumeric characters (letters and digits). +.TP +.B shell\-forward\-word +Move forward to the end of the next word. +Words are delimited by non-quoted shell metacharacters. +.TP +.B shell\-backward\-word +Move back to the start of the current or previous word. +Words are delimited by non-quoted shell metacharacters. +.TP +.B clear\-screen (C\-l) +Clear the screen leaving the current line at the top of the screen. +With an argument, refresh the current line without clearing the +screen. +.TP +.B redraw\-current\-line +Refresh the current line. +.PD +.SS Commands for Manipulating the History +.PP +.PD 0 +.TP +.B accept\-line (Newline, Return) +Accept the line regardless of where the cursor is. If this line is +non-empty, add it to the history list according to the state of the +.SM +.B HISTCONTROL +variable. If the line is a modified history +line, then restore the history line to its original state. +.TP +.B previous\-history (C\-p) +Fetch the previous command from the history list, moving back in +the list. +.TP +.B next\-history (C\-n) +Fetch the next command from the history list, moving forward in the +list. +.TP +.B beginning\-of\-history (M\-<) +Move to the first line in the history. +.TP +.B end\-of\-history (M\->) +Move to the end of the input history, i.e., the line currently being +entered. +.TP +.B reverse\-search\-history (C\-r) +Search backward starting at the current line and moving `up' through +the history as necessary. This is an incremental search. +.TP +.B forward\-search\-history (C\-s) +Search forward starting at the current line and moving `down' through +the history as necessary. This is an incremental search. +.TP +.B non\-incremental\-reverse\-search\-history (M\-p) +Search backward through the history starting at the current line +using a non-incremental search for a string supplied by the user. +.TP +.B non\-incremental\-forward\-search\-history (M\-n) +Search forward through the history using a non-incremental search for +a string supplied by the user. +.TP +.B history\-search\-forward +Search forward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +.TP +.B history\-search\-backward +Search backward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +.TP +.B yank\-nth\-arg (M\-C\-y) +Insert the first argument to the previous command (usually +the second word on the previous line) at point. +With an argument +.IR n , +insert the \fIn\fPth word from the previous command (the words +in the previous command begin with word 0). A negative argument +inserts the \fIn\fPth word from the end of the previous command. +Once the argument \fIn\fP is computed, the argument is extracted +as if the "!\fIn\fP" history expansion had been specified. +.TP +.B +yank\-last\-arg (M\-.\^, M\-_\^) +Insert the last argument to the previous command (the last word of +the previous history entry). +With a numeric argument, behave exactly like \fByank\-nth\-arg\fP. +Successive calls to \fByank\-last\-arg\fP move back through the history +list, inserting the last word (or the word specified by the argument to +the first call) of each line in turn. +Any numeric argument supplied to these successive calls determines +the direction to move through the history. A negative argument switches +the direction through the history (back or forward). +The history expansion facilities are used to extract the last word, +as if the "!$" history expansion had been specified. +.TP +.B shell\-expand\-line (M\-C\-e) +Expand the line as the shell does. This +performs alias and history expansion as well as all of the shell +word expansions. See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B history\-expand\-line (M\-^) +Perform history expansion on the current line. +See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B magic\-space +Perform history expansion on the current line and insert a space. +See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B alias\-expand\-line +Perform alias expansion on the current line. +See +.SM +.B ALIASES +above for a description of alias expansion. +.TP +.B history\-and\-alias\-expand\-line +Perform history and alias expansion on the current line. +.TP +.B insert\-last\-argument (M\-.\^, M\-_\^) +A synonym for \fByank\-last\-arg\fP. +.TP +.B operate\-and\-get\-next (C\-o) +Accept the current line for execution and fetch the next line +relative to the current line from the history for editing. Any +argument is ignored. +.TP +.B edit\-and\-execute\-command (C\-xC\-e) +Invoke an editor on the current command line, and execute the result as shell +commands. +\fBBash\fP attempts to invoke +.SM +.BR $VISUAL , +.SM +.BR $EDITOR , +and \fIemacs\fP as the editor, in that order. +.PD +.SS Commands for Changing Text +.PP +.PD 0 +.TP +.B \fIend\-of\-file\fP (usually C\-d) +The character indicating end-of-file as set, for example, by +.if t \f(CWstty\fP. +.if n ``stty''. +If this character is read when there are no characters +on the line, and point is at the beginning of the line, Readline +interprets it as the end of input and returns +.SM +.BR EOF . +.TP +.B delete\-char (C\-d) +Delete the character at point. +If this function is bound to the +same character as the tty \fBEOF\fP character, as \fBC\-d\fP +commonly is, see above for the effects. +.TP +.B backward\-delete\-char (Rubout) +Delete the character behind the cursor. When given a numeric argument, +save the deleted text on the kill ring. +.TP +.B forward\-backward\-delete\-char +Delete the character under the cursor, unless the cursor is at the +end of the line, in which case the character behind the cursor is +deleted. +.TP +.B quoted\-insert (C\-q, C\-v) +Add the next character typed to the line verbatim. This is +how to insert characters like \fBC\-q\fP, for example. +.TP +.B tab\-insert (C\-v TAB) +Insert a tab character. +.TP +.B self\-insert (a,\ b,\ A,\ 1,\ !,\ ...) +Insert the character typed. +.TP +.B transpose\-chars (C\-t) +Drag the character before point forward over the character at point, +moving point forward as well. +If point is at the end of the line, then this transposes +the two characters before point. +Negative arguments have no effect. +.TP +.B transpose\-words (M\-t) +Drag the word before point past the word after point, +moving point over that word as well. +If point is at the end of the line, this transposes +the last two words on the line. +.TP +.B upcase\-word (M\-u) +Uppercase the current (or following) word. With a negative argument, +uppercase the previous word, but do not move point. +.TP +.B downcase\-word (M\-l) +Lowercase the current (or following) word. With a negative argument, +lowercase the previous word, but do not move point. +.TP +.B capitalize\-word (M\-c) +Capitalize the current (or following) word. With a negative argument, +capitalize the previous word, but do not move point. +.TP +.B overwrite\-mode +Toggle overwrite mode. With an explicit positive numeric argument, +switches to overwrite mode. With an explicit non-positive numeric +argument, switches to insert mode. This command affects only +\fBemacs\fP mode; \fBvi\fP mode does overwrite differently. +Each call to \fIreadline()\fP starts in insert mode. +In overwrite mode, characters bound to \fBself\-insert\fP replace +the text at point rather than pushing the text to the right. +Characters bound to \fBbackward\-delete\-char\fP replace the character +before point with a space. By default, this command is unbound. +.PD +.SS Killing and Yanking +.PP +.PD 0 +.TP +.B kill\-line (C\-k) +Kill the text from point to the end of the line. +.TP +.B backward\-kill\-line (C\-x Rubout) +Kill backward to the beginning of the line. +.TP +.B unix\-line\-discard (C\-u) +Kill backward from point to the beginning of the line. +The killed text is saved on the kill-ring. +.\" There is no real difference between this and backward-kill-line +.TP +.B kill\-whole\-line +Kill all characters on the current line, no matter where point is. +.TP +.B kill\-word (M\-d) +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as those used by \fBforward\-word\fP. +.TP +.B backward\-kill\-word (M\-Rubout) +Kill the word behind point. +Word boundaries are the same as those used by \fBbackward\-word\fP. +.TP +.B shell\-kill\-word (M\-d) +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as those used by \fBshell\-forward\-word\fP. +.TP +.B shell\-backward\-kill\-word (M\-Rubout) +Kill the word behind point. +Word boundaries are the same as those used by \fBshell\-backward\-word\fP. +.TP +.B unix\-word\-rubout (C\-w) +Kill the word behind point, using white space as a word boundary. +The killed text is saved on the kill-ring. +.TP +.B unix\-filename\-rubout +Kill the word behind point, using white space and the slash character +as the word boundaries. +The killed text is saved on the kill-ring. +.TP +.B delete\-horizontal\-space (M\-\e) +Delete all spaces and tabs around point. +.TP +.B kill\-region +Kill the text in the current region. +.TP +.B copy\-region\-as\-kill +Copy the text in the region to the kill buffer. +.TP +.B copy\-backward\-word +Copy the word before point to the kill buffer. +The word boundaries are the same as \fBbackward\-word\fP. +.TP +.B copy\-forward\-word +Copy the word following point to the kill buffer. +The word boundaries are the same as \fBforward\-word\fP. +.TP +.B yank (C\-y) +Yank the top of the kill ring into the buffer at point. +.TP +.B yank\-pop (M\-y) +Rotate the kill ring, and yank the new top. Only works following +.B yank +or +.BR yank\-pop . +.PD +.SS Numeric Arguments +.PP +.PD 0 +.TP +.B digit\-argument (M\-0, M\-1, ..., M\-\-) +Add this digit to the argument already accumulating, or start a new +argument. M\-\- starts a negative argument. +.TP +.B universal\-argument +This is another way to specify an argument. +If this command is followed by one or more digits, optionally with a +leading minus sign, those digits define the argument. +If the command is followed by digits, executing +.B universal\-argument +again ends the numeric argument, but is otherwise ignored. +As a special case, if this command is immediately followed by a +character that is neither a digit or minus sign, the argument count +for the next command is multiplied by four. +The argument count is initially one, so executing this function the +first time makes the argument count four, a second time makes the +argument count sixteen, and so on. +.PD +.SS Completing +.PP +.PD 0 +.TP +.B complete (TAB) +Attempt to perform completion on the text before point. +.B Bash +attempts completion treating the text as a variable (if the +text begins with \fB$\fP), username (if the text begins with +\fB~\fP), hostname (if the text begins with \fB@\fP), or +command (including aliases and functions) in turn. If none +of these produces a match, filename completion is attempted. +.TP +.B possible\-completions (M\-?) +List the possible completions of the text before point. +.TP +.B insert\-completions (M\-*) +Insert all completions of the text before point +that would have been generated by +\fBpossible\-completions\fP. +.TP +.B menu\-complete +Similar to \fBcomplete\fP, but replaces the word to be completed +with a single match from the list of possible completions. +Repeated execution of \fBmenu\-complete\fP steps through the list +of possible completions, inserting each match in turn. +At the end of the list of completions, the bell is rung +(subject to the setting of \fBbell\-style\fP) +and the original text is restored. +An argument of \fIn\fP moves \fIn\fP positions forward in the list +of matches; a negative argument may be used to move backward +through the list. +This command is intended to be bound to \fBTAB\fP, but is unbound +by default. +.TP +.B menu\-complete\-backward +Identical to \fBmenu\-complete\fP, but moves backward through the list +of possible completions, as if \fBmenu\-complete\fP had been given a +negative argument. This command is unbound by default. +.TP +.B delete\-char\-or\-list +Deletes the character under the cursor if not at the beginning or +end of the line (like \fBdelete\-char\fP). +If at the end of the line, behaves identically to +\fBpossible\-completions\fP. +This command is unbound by default. +.TP +.B complete\-filename (M\-/) +Attempt filename completion on the text before point. +.TP +.B possible\-filename\-completions (C\-x /) +List the possible completions of the text before point, +treating it as a filename. +.TP +.B complete\-username (M\-~) +Attempt completion on the text before point, treating +it as a username. +.TP +.B possible\-username\-completions (C\-x ~) +List the possible completions of the text before point, +treating it as a username. +.TP +.B complete\-variable (M\-$) +Attempt completion on the text before point, treating +it as a shell variable. +.TP +.B possible\-variable\-completions (C\-x $) +List the possible completions of the text before point, +treating it as a shell variable. +.TP +.B complete\-hostname (M\-@) +Attempt completion on the text before point, treating +it as a hostname. +.TP +.B possible\-hostname\-completions (C\-x @) +List the possible completions of the text before point, +treating it as a hostname. +.TP +.B complete\-command (M\-!) +Attempt completion on the text before point, treating +it as a command name. Command completion attempts to +match the text against aliases, reserved words, shell +functions, shell builtins, and finally executable filenames, +in that order. +.TP +.B possible\-command\-completions (C\-x !) +List the possible completions of the text before point, +treating it as a command name. +.TP +.B dynamic\-complete\-history (M\-TAB) +Attempt completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +.TP +.B dabbrev\-expand +Attempt menu completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +.TP +.B complete\-into\-braces (M\-{) +Perform filename completion and insert the list of possible completions +enclosed within braces so the list is available to the shell (see +.B Brace Expansion +above). +.PD +.SS Keyboard Macros +.PP +.PD 0 +.TP +.B start\-kbd\-macro (C\-x (\^) +Begin saving the characters typed into the current keyboard macro. +.TP +.B end\-kbd\-macro (C\-x )\^) +Stop saving the characters typed into the current keyboard macro +and store the definition. +.TP +.B call\-last\-kbd\-macro (C\-x e) +Re-execute the last keyboard macro defined, by making the characters +in the macro appear as if typed at the keyboard. +.TP +.B print\-last\-kbd\-macro () +Print the last keyboard macro defined in a format suitable for the +\fIinputrc\fP file. +.PD +.SS Miscellaneous +.PP +.PD 0 +.TP +.B re\-read\-init\-file (C\-x C\-r) +Read in the contents of the \fIinputrc\fP file, and incorporate +any bindings or variable assignments found there. +.TP +.B abort (C\-g) +Abort the current editing command and +ring the terminal's bell (subject to the setting of +.BR bell\-style ). +.TP +.B do\-uppercase\-version (M\-a, M\-b, M\-\fIx\fP, ...) +If the metafied character \fIx\fP is lowercase, run the command +that is bound to the corresponding uppercase character. +.TP +.B prefix\-meta (ESC) +Metafy the next character typed. +.SM +.B ESC +.B f +is equivalent to +.BR Meta\-f . +.TP +.B undo (C\-_, C\-x C\-u) +Incremental undo, separately remembered for each line. +.TP +.B revert\-line (M\-r) +Undo all changes made to this line. This is like executing the +.B undo +command enough times to return the line to its initial state. +.TP +.B tilde\-expand (M\-&) +Perform tilde expansion on the current word. +.TP +.B set\-mark (C\-@, M\-) +Set the mark to the point. If a +numeric argument is supplied, the mark is set to that position. +.TP +.B exchange\-point\-and\-mark (C\-x C\-x) +Swap the point with the mark. The current cursor position is set to +the saved position, and the old cursor position is saved as the mark. +.TP +.B character\-search (C\-]) +A character is read and point is moved to the next occurrence of that +character. A negative count searches for previous occurrences. +.TP +.B character\-search\-backward (M\-C\-]) +A character is read and point is moved to the previous occurrence of that +character. A negative count searches for subsequent occurrences. +.TP +.B skip\-csi\-sequence +Read enough characters to consume a multi-key sequence such as those +defined for keys like Home and End. Such sequences begin with a +Control Sequence Indicator (CSI), usually ESC\-[. If this sequence is +bound to "\e[", keys producing such sequences will have no effect +unless explicitly bound to a readline command, instead of inserting +stray characters into the editing buffer. This is unbound by default, +but usually bound to ESC\-[. +.TP +.B insert\-comment (M\-#) +Without a numeric argument, the value of the readline +.B comment\-begin +variable is inserted at the beginning of the current line. +If a numeric argument is supplied, this command acts as a toggle: if +the characters at the beginning of the line do not match the value +of \fBcomment\-begin\fP, the value is inserted, otherwise +the characters in \fBcomment\-begin\fP are deleted from the beginning of +the line. +In either case, the line is accepted as if a newline had been typed. +The default value of +\fBcomment\-begin\fP causes this command to make the current line +a shell comment. +If a numeric argument causes the comment character to be removed, the line +will be executed by the shell. +.TP +.B glob\-complete\-word (M\-g) +The word before point is treated as a pattern for pathname expansion, +with an asterisk implicitly appended. This pattern is used to +generate a list of matching filenames for possible completions. +.TP +.B glob\-expand\-word (C\-x *) +The word before point is treated as a pattern for pathname expansion, +and the list of matching filenames is inserted, replacing the word. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +.TP +.B glob\-list\-expansions (C\-x g) +The list of expansions that would have been generated by +.B glob\-expand\-word +is displayed, and the line is redrawn. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +.TP +.B dump\-functions +Print all of the functions and their key bindings to the +readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B dump\-variables +Print all of the settable readline variables and their values to the +readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B dump\-macros +Print all of the readline key sequences bound to macros and the +strings they output. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B display\-shell\-version (C\-x C\-v) +Display version information about the current instance of +.BR bash . +.PD +.SS Programmable Completion +.PP +When word completion is attempted for an argument to a command for +which a completion specification (a \fIcompspec\fP) has been defined +using the \fBcomplete\fP builtin (see +.SM +.B "SHELL BUILTIN COMMANDS" +below), the programmable completion facilities are invoked. +.PP +First, the command name is identified. +If the command word is the empty string (completion attempted at the +beginning of an empty line), any compspec defined with +the \fB\-E\fP option to \fBcomplete\fP is used. +If a compspec has been defined for that command, the +compspec is used to generate the list of possible completions for the word. +If the command word is a full pathname, a compspec for the full +pathname is searched for first. +If no compspec is found for the full pathname, an attempt is made to +find a compspec for the portion following the final slash. +If those searches do not result in a compspec, any compspec defined with +the \fB\-D\fP option to \fBcomplete\fP is used as the default. +.PP +Once a compspec has been found, it is used to generate the list of +matching words. +If a compspec is not found, the default \fBbash\fP completion as +described above under \fBCompleting\fP is performed. +.PP +First, the actions specified by the compspec are used. +Only matches which are prefixed by the word being completed are +returned. +When the +.B \-f +or +.B \-d +option is used for filename or directory name completion, the shell +variable +.SM +.B FIGNORE +is used to filter the matches. +.PP +Any completions specified by a pathname expansion pattern to the +\fB\-G\fP option are generated next. +The words generated by the pattern need not match the word +being completed. +The +.SM +.B GLOBIGNORE +shell variable is not used to filter the matches, but the +.SM +.B FIGNORE +variable is used. +.PP +Next, the string specified as the argument to the \fB\-W\fP option +is considered. +The string is first split using the characters in the +.SM +.B IFS +special variable as delimiters. +Shell quoting is honored. +Each word is then expanded using +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, and arithmetic expansion, +as described above under +.SM +.BR EXPANSION . +The results are split using the rules described above under +\fBWord Splitting\fP. +The results of the expansion are prefix-matched against the word being +completed, and the matching words become the possible completions. +.PP +After these matches have been generated, any shell function or command +specified with the \fB\-F\fP and \fB\-C\fP options is invoked. +When the command or function is invoked, the +.SM +.BR COMP_LINE , +.SM +.BR COMP_POINT , +.SM +.BR COMP_KEY , +and +.SM +.B COMP_TYPE +variables are assigned values as described above under +\fBShell Variables\fP. +If a shell function is being invoked, the +.SM +.B COMP_WORDS +and +.SM +.B COMP_CWORD +variables are also set. +When the function or command is invoked, +the first argument (\fB$1\fP) is the name of the command whose arguments are +being completed, +the second argument (\fB$2\fP) is the word being completed, +and the third argument (\fB$3\fP) is the word preceding the word being +completed on the current command line. +No filtering of the generated completions against the word being completed +is performed; the function or command has complete freedom in generating +the matches. +.PP +Any function specified with \fB\-F\fP is invoked first. +The function may use any of the shell facilities, including the +\fBcompgen\fP builtin described below, to generate the matches. +It must put the possible completions in the +.SM +.B COMPREPLY +array variable, one per array element. +.PP +Next, any command specified with the \fB\-C\fP option is invoked +in an environment equivalent to command substitution. +It should print a list of completions, one per line, to the +standard output. +Backslash may be used to escape a newline, if necessary. +.PP +After all of the possible completions are generated, any filter +specified with the \fB\-X\fP option is applied to the list. +The filter is a pattern as used for pathname expansion; a \fB&\fP +in the pattern is replaced with the text of the word being completed. +A literal \fB&\fP may be escaped with a backslash; the backslash +is removed before attempting a match. +Any completion that matches the pattern will be removed from the list. +A leading \fB!\fP negates the pattern; in this case any completion +not matching the pattern will be removed. +.PP +Finally, any prefix and suffix specified with the \fB\-P\fP and \fB\-S\fP +options are added to each member of the completion list, and the result is +returned to the readline completion code as the list of possible +completions. +.PP +If the previously-applied actions do not generate any matches, and the +\fB\-o dirnames\fP option was supplied to \fBcomplete\fP when the +compspec was defined, directory name completion is attempted. +.PP +If the \fB\-o plusdirs\fP option was supplied to \fBcomplete\fP when the +compspec was defined, directory name completion is attempted and any +matches are added to the results of the other actions. +.PP +By default, if a compspec is found, whatever it generates is returned +to the completion code as the full set of possible completions. +The default \fBbash\fP completions are not attempted, and the readline +default of filename completion is disabled. +If the \fB\-o bashdefault\fP option was supplied to \fBcomplete\fP when +the compspec was defined, the \fBbash\fP default completions are attempted +if the compspec generates no matches. +If the \fB\-o default\fP option was supplied to \fBcomplete\fP when the +compspec was defined, readline's default completion will be performed +if the compspec (and, if attempted, the default \fBbash\fP completions) +generate no matches. +.PP +When a compspec indicates that directory name completion is desired, +the programmable completion functions force readline to append a slash +to completed names which are symbolic links to directories, subject to +the value of the \fBmark\-directories\fP readline variable, regardless +of the setting of the \fBmark-symlinked\-directories\fP readline variable. +.PP +There is some support for dynamically modifying completions. This is +most useful when used in combination with a default completion specified +with \fBcomplete -D\fP. +It's possible for shell functions executed as completion +handlers to indicate that completion should be retried by returning an +exit status of 124. If a shell function returns 124, and changes +the compspec associated with the command on which completion is being +attempted (supplied as the first argument when the function is executed), +programmable completion restarts from the beginning, with an +attempt to find a new compspec for that command. This allows a set of +completions to be built dynamically as completion is attempted, rather than +being loaded all at once. +.PP +For instance, assuming that there is a library of compspecs, each kept in a +file corresponding to the name of the command, the following default +completion function would load completions dynamically: +.PP +\f(CW_completion_loader() +.br +{ +.br + . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124 +.br +} +.br +complete -D -F _completion_loader -o bashdefault -o default +.br +\fP +.SH HISTORY +When the +.B \-o history +option to the +.B set +builtin is enabled, the shell provides access to the +\fIcommand history\fP, +the list of commands previously typed. +The value of the +.SM +.B HISTSIZE +variable is used as the +number of commands to save in a history list. +The text of the last +.SM +.B HISTSIZE +commands (default 500) is saved. The shell +stores each command in the history list prior to parameter and +variable expansion (see +.SM +.B EXPANSION +above) but after history expansion is performed, subject to the +values of the shell variables +.SM +.B HISTIGNORE +and +.SM +.BR HISTCONTROL . +.PP +On startup, the history is initialized from the file named by +the variable +.SM +.B HISTFILE +(default \fI~/.bash_history\fP). +The file named by the value of +.SM +.B HISTFILE +is truncated, if necessary, to contain no more than +the number of lines specified by the value of +.SM +.BR HISTFILESIZE . +If \fBHISTFILESIZE\fP is unset, or set to null, a non-numeric value, +or a numeric value less than zero, the history file is not truncated. +When the history file is read, +lines beginning with the history comment character followed immediately +by a digit are interpreted as timestamps for the preceding history line. +These timestamps are optionally displayed depending on the value of the +.SM +.B HISTTIMEFORMAT +variable. +When a shell with history enabled exits, the last +.SM +.B $HISTSIZE +lines are copied from the history list to +.SM +.BR $HISTFILE . +If the +.B histappend +shell option is enabled +(see the description of +.B shopt +under +.SM +.B "SHELL BUILTIN COMMANDS" +below), the lines are appended to the history file, +otherwise the history file is overwritten. +If +.SM +.B HISTFILE +is unset, or if the history file is unwritable, the history is +not saved. +If the +.SM +.B HISTTIMEFORMAT +variable is set, time stamps are written to the history file, marked +with the history comment character, so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +After saving the history, the history file is truncated +to contain no more than +.SM +.B HISTFILESIZE +lines. If +.SM +.B HISTFILESIZE +is unset, or set to null, a non-numeric value, +or a numeric value less than zero, the history file is not truncated. +.PP +The builtin command +.B fc +(see +.SM +.B SHELL BUILTIN COMMANDS +below) may be used to list or edit and re-execute a portion of +the history list. +The +.B history +builtin may be used to display or modify the history list and +manipulate the history file. +When using command-line editing, search commands +are available in each editing mode that provide access to the +history list. +.PP +The shell allows control over which commands are saved on the history +list. The +.SM +.B HISTCONTROL +and +.SM +.B HISTIGNORE +variables may be set to cause the shell to save only a subset of the +commands entered. +The +.B cmdhist +shell option, if enabled, causes the shell to attempt to save each +line of a multi-line command in the same history entry, adding +semicolons where necessary to preserve syntactic correctness. +The +.B lithist +shell option causes the shell to save the command with embedded newlines +instead of semicolons. See the description of the +.B shopt +builtin below under +.SM +.B "SHELL BUILTIN COMMANDS" +for information on setting and unsetting shell options. +.SH "HISTORY EXPANSION" +.PP +The shell supports a history expansion feature that +is similar to the history expansion in +.BR csh. +This section describes what syntax features are available. This +feature is enabled by default for interactive shells, and can be +disabled using the +.B +H +option to the +.B set +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). Non-interactive shells do not perform history expansion +by default. +.PP +History expansions introduce words from the history list into +the input stream, making it easy to repeat commands, insert the +arguments to a previous command into the current input line, or +fix errors in previous commands quickly. +.PP +History expansion is performed immediately after a complete line +is read, before the shell breaks it into words. +It takes place in two parts. +The first is to determine which line from the history list +to use during substitution. +The second is to select portions of that line for inclusion into +the current one. +The line selected from the history is the \fIevent\fP, +and the portions of that line that are acted upon are \fIwords\fP. +Various \fImodifiers\fP are available to manipulate the selected words. +The line is broken into words in the same fashion as when reading input, +so that several \fImetacharacter\fP-separated words surrounded by +quotes are considered one word. +History expansions are introduced by the appearance of the +history expansion character, which is \^\fB!\fP\^ by default. +Only backslash (\^\fB\e\fP\^) and single quotes can quote +the history expansion character. +.PP +Several characters inhibit history expansion if found immediately +following the history expansion character, even if it is unquoted: +space, tab, newline, carriage return, and \fB=\fP. +If the \fBextglob\fP shell option is enabled, \fB(\fP will also +inhibit expansion. +.PP +Several shell options settable with the +.B shopt +builtin may be used to tailor the behavior of history expansion. +If the +.B histverify +shell option is enabled (see the description of the +.B shopt +builtin below), and +.B readline +is being used, history substitutions are not immediately passed to +the shell parser. +Instead, the expanded line is reloaded into the +.B readline +editing buffer for further modification. +If +.B readline +is being used, and the +.B histreedit +shell option is enabled, a failed history substitution will be reloaded +into the +.B readline +editing buffer for correction. +The +.B \-p +option to the +.B history +builtin command may be used to see what a history expansion will +do before using it. +The +.B \-s +option to the +.B history +builtin may be used to add commands to the end of the history list +without actually executing them, so that they are available for +subsequent recall. +.PP +The shell allows control of the various characters used by the +history expansion mechanism (see the description of +.B histchars +above under +.BR "Shell Variables" ). +The shell uses +the history comment character to mark history timestamps when +writing the history file. +.SS Event Designators +.PP +An event designator is a reference to a command line entry in the +history list. +Unless the reference is absolute, events are relative to the current +position in the history list. +.PP +.PD 0 +.TP +.B ! +Start a history substitution, except when followed by a +.BR blank , +newline, carriage return, = +or ( (when the \fBextglob\fP shell option is enabled using +the \fBshopt\fP builtin). +.TP +.B !\fIn\fR +Refer to command line +.IR n . +.TP +.B !\-\fIn\fR +Refer to the current command minus +.IR n . +.TP +.B !! +Refer to the previous command. This is a synonym for `!\-1'. +.TP +.B !\fIstring\fR +Refer to the most recent command preceding the current position in the +history list starting with +.IR string . +.TP +.B !?\fIstring\fR\fB[?]\fR +Refer to the most recent command preceding the current position in the +history list containing +.IR string . +The trailing \fB?\fP may be omitted if +.I string +is followed immediately by a newline. +.TP +.B \d\s+2^\s-2\u\fIstring1\fP\d\s+2^\s-2\u\fIstring2\fP\d\s+2^\s-2\u +Quick substitution. Repeat the previous command, replacing +.I string1 +with +.IR string2 . +Equivalent to +``!!:s/\fIstring1\fP/\fIstring2\fP/'' +(see \fBModifiers\fP below). +.TP +.B !# +The entire command line typed so far. +.PD +.SS Word Designators +.PP +Word designators are used to select desired words from the event. +A +.B : +separates the event specification from the word designator. +It may be omitted if the word designator begins with a +.BR ^ , +.BR $ , +.BR * , +.BR \- , +or +.BR % . +Words are numbered from the beginning of the line, +with the first word being denoted by 0 (zero). +Words are inserted into the current line separated by single spaces. +.PP +.PD 0 +.TP +.B 0 (zero) +The zeroth word. For the shell, this is the command +word. +.TP +.I n +The \fIn\fRth word. +.TP +.B ^ +The first argument. That is, word 1. +.TP +.B $ +The last word. This is usually the last argument, but will expand to the +zeroth word if there is only one word in the line. +.TP +.B % +The word matched by the most recent `?\fIstring\fR?' search. +.TP +.I x\fB\-\fPy +A range of words; `\-\fIy\fR' abbreviates `0\-\fIy\fR'. +.TP +.B * +All of the words but the zeroth. This is a synonym +for `\fI1\-$\fP'. It is not an error to use +.B * +if there is just one +word in the event; the empty string is returned in that case. +.TP +.B x* +Abbreviates \fIx\-$\fP. +.TP +.B x\- +Abbreviates \fIx\-$\fP like \fBx*\fP, but omits the last word. +.PD +.PP +If a word designator is supplied without an event specification, the +previous command is used as the event. +.SS Modifiers +.PP +After the optional word designator, there may appear a sequence of +one or more of the following modifiers, each preceded by a `:'. +.PP +.PD 0 +.PP +.TP +.B h +Remove a trailing filename component, leaving only the head. +.TP +.B t +Remove all leading filename components, leaving the tail. +.TP +.B r +Remove a trailing suffix of the form \fI.xxx\fP, leaving the +basename. +.TP +.B e +Remove all but the trailing suffix. +.TP +.B p +Print the new command but do not execute it. +.TP +.B q +Quote the substituted words, escaping further substitutions. +.TP +.B x +Quote the substituted words as with +.BR q , +but break into words at +.B blanks +and newlines. +.TP +.B s/\fIold\fP/\fInew\fP/ +Substitute +.I new +for the first occurrence of +.I old +in the event line. Any delimiter can be used in place of /. The +final delimiter is optional if it is the last character of the +event line. The delimiter may be quoted in +.I old +and +.I new +with a single backslash. If & appears in +.IR new , +it is replaced by +.IR old . +A single backslash will quote the &. If +.I old +is null, it is set to the last +.I old +substituted, or, if no previous history substitutions took place, +the last +.I string +in a +.B !?\fIstring\fR\fB[?]\fR +search. +.TP +.B & +Repeat the previous substitution. +.TP +.B g +Cause changes to be applied over the entire event line. This is +used in conjunction with `\fB:s\fP' (e.g., `\fB:gs/\fIold\fP/\fInew\fP/\fR') +or `\fB:&\fP'. If used with +`\fB:s\fP', any delimiter can be used +in place of /, and the final delimiter is optional +if it is the last character of the event line. +An \fBa\fP may be used as a synonym for \fBg\fP. +.TP +.B G +Apply the following `\fBs\fP' modifier once to each word in the event line. +.PD +.SH "SHELL BUILTIN COMMANDS" +.\" start of bash_builtins +.zZ +.PP +Unless otherwise noted, each builtin command documented in this +section as accepting options preceded by +.B \- +accepts +.B \-\- +to signify the end of the options. +The \fB:\fP, \fBtrue\fP, \fBfalse\fP, and \fBtest\fP builtins +do not accept options and do not treat \fB\-\-\fP specially. +The \fBexit\fP, \fBlogout\fP, \fBbreak\fP, \fBcontinue\fP, \fBlet\fP, +and \fBshift\fP builtins accept and process arguments beginning with +\fB\-\fP without requiring \fB\-\-\fP. +Other builtins that accept arguments but are not specified as accepting +options interpret arguments beginning with \fB\-\fP as invalid options and +require \fB\-\-\fP to prevent this interpretation. +.sp .5 +.PD 0 +.TP +\fB:\fP [\fIarguments\fP] +.PD +No effect; the command does nothing beyond expanding +.I arguments +and performing any specified +redirections. A zero exit code is returned. +.TP +\fB .\| \fP \fIfilename\fP [\fIarguments\fP] +.PD 0 +.TP +\fBsource\fP \fIfilename\fP [\fIarguments\fP] +.PD +Read and execute commands from +.I filename +in the current +shell environment and return the exit status of the last command +executed from +.IR filename . +If +.I filename +does not contain a slash, filenames in +.SM +.B PATH +are used to find the directory containing +.IR filename . +The file searched for in +.SM +.B PATH +need not be executable. +When \fBbash\fP is not in \fIposix mode\fP, the current directory is +searched if no file is found in +.SM +.BR PATH . +If the +.B sourcepath +option to the +.B shopt +builtin command is turned off, the +.SM +.B PATH +is not searched. +If any \fIarguments\fP are supplied, they become the positional +parameters when \fIfilename\fP is executed. Otherwise the positional +parameters are unchanged. +The return status is the status of the last command exited within +the script (0 if no commands are executed), and false if +.I filename +is not found or cannot be read. +.TP +\fBalias\fP [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +\fBAlias\fP with no arguments or with the +.B \-p +option prints the list of aliases in the form +\fBalias\fP \fIname\fP=\fIvalue\fP on standard output. +When arguments are supplied, an alias is defined for +each \fIname\fP whose \fIvalue\fP is given. +A trailing space in \fIvalue\fP causes the next word to be +checked for alias substitution when the alias is expanded. +For each \fIname\fP in the argument list for which no \fIvalue\fP +is supplied, the name and value of the alias is printed. +\fBAlias\fP returns true unless a \fIname\fP is given for which +no alias has been defined. +.TP +\fBbg\fP [\fIjobspec\fP ...] +Resume each suspended job \fIjobspec\fP in the background, as if it +had been started with +.BR & . +If +.I jobspec +is not present, the shell's notion of the \fIcurrent job\fP is used. +.B bg +.I jobspec +returns 0 unless run when job control is disabled or, when run with +job control enabled, any specified \fIjobspec\fP was not found +or was started without job control. +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] [\fB\-lpsvPSVX\fP] +.PD 0 +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] [\fB\-q\fP \fIfunction\fP] [\fB\-u\fP \fIfunction\fP] [\fB\-r\fP \fIkeyseq\fP] +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fB\-f\fP \fIfilename\fP +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fB\-x\fP \fIkeyseq\fP:\fIshell\-command\fP +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fIkeyseq\fP:\fIfunction\-name\fP +.TP +\fBbind\fP \fIreadline\-command\fP +.PD +Display current +.B readline +key and function bindings, bind a key sequence to a +.B readline +function or macro, or set a +.B readline +variable. +Each non-option argument is a command as it would appear in +.IR .inputrc , +but each binding or command must be passed as a separate argument; +e.g., '"\eC\-x\eC\-r": re\-read\-init\-file'. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-m \fIkeymap\fP +Use +.I keymap +as the keymap to be affected by the subsequent bindings. +Acceptable +.I keymap +names are +\fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi, +vi\-move, vi\-command\fP, and +.IR vi\-insert . +\fIvi\fP is equivalent to \fIvi\-command\fP; \fIemacs\fP is +equivalent to \fIemacs\-standard\fP. +.TP +.B \-l +List the names of all \fBreadline\fP functions. +.TP +.B \-p +Display \fBreadline\fP function names and bindings in such a way +that they can be re-read. +.TP +.B \-P +List current \fBreadline\fP function names and bindings. +.TP +.B \-s +Display \fBreadline\fP key sequences bound to macros and the strings +they output in such a way that they can be re-read. +.TP +.B \-S +Display \fBreadline\fP key sequences bound to macros and the strings +they output. +.TP +.B \-v +Display \fBreadline\fP variable names and values in such a way that they +can be re-read. +.TP +.B \-V +List current \fBreadline\fP variable names and values. +.TP +.B \-f \fIfilename\fP +Read key bindings from \fIfilename\fP. +.TP +.B \-q \fIfunction\fP +Query about which keys invoke the named \fIfunction\fP. +.TP +.B \-u \fIfunction\fP +Unbind all keys bound to the named \fIfunction\fP. +.TP +.B \-r \fIkeyseq\fP +Remove any current binding for \fIkeyseq\fP. +.TP +.B \-x \fIkeyseq\fP:\fIshell\-command\fP +Cause \fIshell\-command\fP to be executed whenever \fIkeyseq\fP is +entered. +When \fIshell\-command\fP is executed, the shell sets the +.SM +.B READLINE_LINE +variable to the contents of the \fBreadline\fP line buffer and the +.SM +.B READLINE_POINT +variable to the current location of the insertion point. +If the executed command changes the value of +.SM +.B READLINE_LINE +or +.SM +.BR READLINE_POINT , +those new values will be reflected in the editing state. +.TP +.B \-X +List all key sequences bound to shell commands and the associated commands +in a format that can be reused as input. +.PD +.PP +The return value is 0 unless an unrecognized option is given or an +error occurred. +.RE +.TP +\fBbreak\fP [\fIn\fP] +Exit from within a +.BR for , +.BR while , +.BR until , +or +.B select +loop. If \fIn\fP is specified, break \fIn\fP levels. +.I n +must be \(>= 1. If +.I n +is greater than the number of enclosing loops, all enclosing loops +are exited. +The return value is 0 unless \fIn\fP is not greater than or equal to 1. +.TP +\fBbuiltin\fP \fIshell\-builtin\fP [\fIarguments\fP] +Execute the specified shell builtin, passing it +.IR arguments , +and return its exit status. +This is useful when defining a +function whose name is the same as a shell builtin, +retaining the functionality of the builtin within the function. +The \fBcd\fP builtin is commonly redefined this way. +The return status is false if +.I shell\-builtin +is not a shell builtin command. +.TP +\fBcaller\fP [\fIexpr\fP] +Returns the context of any active subroutine call (a shell function or +a script executed with the \fB.\fP or \fBsource\fP builtins). +Without \fIexpr\fP, \fBcaller\fP displays the line number and source +filename of the current subroutine call. +If a non-negative integer is supplied as \fIexpr\fP, \fBcaller\fP +displays the line number, subroutine name, and source file corresponding +to that position in the current execution call stack. This extra +information may be used, for example, to print a stack trace. The +current frame is frame 0. +The return value is 0 unless the shell is not executing a subroutine +call or \fIexpr\fP does not correspond to a valid position in the +call stack. +.TP +\fBcd\fP [\fB\-L\fP|[\fB\-P\fP [\fB\-e\fP]] [\-@]] [\fIdir\fP] +Change the current directory to \fIdir\fP. +if \fIdir\fP is not supplied, the value of the +.SM +.B HOME +shell variable is the default. +Any additional arguments following \fIdir\fP are ignored. +The variable +.SM +.B CDPATH +defines the search path for the directory containing +.IR dir : +each directory name in +.SM +.B CDPATH +is searched for \fIdir\fP. +Alternative directory names in +.SM +.B CDPATH +are separated by a colon (:). A null directory name in +.SM +.B CDPATH +is the same as the current directory, i.e., ``\fB.\fP''. If +.I dir +begins with a slash (/), +then +.SM +.B CDPATH +is not used. The +.B \-P +option causes \fBcd\fP to use the physical directory structure +by resolving symbolic links while traversing \fIdir\fP and +before processing instances of \fI..\fP in \fIdir\fP (see also the +.B \-P +option to the +.B set +builtin command); the +.B \-L +option forces symbolic links to be followed by resolving the link +after processing instances of \fI..\fP in \fIdir\fP. +If \fI..\fP appears in \fIdir\fP, it is processed by removing the +immediately previous pathname component from \fIdir\fP, back to a slash +or the beginning of \fIdir\fP. +If the +.B \-e +option is supplied with +.BR \-P , +and the current working directory cannot be successfully determined +after a successful directory change, \fBcd\fP will return an unsuccessful +status. +On systems that support it, the \fB\-@\fP option presents the extended +attributes associated with a file as a directory. +An argument of +.B \- +is converted to +.SM +.B $OLDPWD +before the directory change is attempted. +If a non-empty directory name from +.SM +.B CDPATH +is used, or if +\fB\-\fP is the first argument, and the directory change is +successful, the absolute pathname of the new working directory is +written to the standard output. +The return value is true if the directory was successfully changed; +false otherwise. +.TP +\fBcommand\fP [\fB\-pVv\fP] \fIcommand\fP [\fIarg\fP ...] +Run +.I command +with +.I args +suppressing the normal shell function lookup. Only builtin +commands or commands found in the +.SM +.B PATH +are executed. If the +.B \-p +option is given, the search for +.I command +is performed using a default value for +.SM +.B PATH +that is guaranteed to find all of the standard utilities. +If either the +.B \-V +or +.B \-v +option is supplied, a description of +.I command +is printed. The +.B \-v +option causes a single word indicating the command or filename +used to invoke +.I command +to be displayed; the +.B \-V +option produces a more verbose description. +If the +.B \-V +or +.B \-v +option is supplied, the exit status is 0 if +.I command +was found, and 1 if not. If neither option is supplied and +an error occurred or +.I command +cannot be found, the exit status is 127. Otherwise, the exit status of the +.B command +builtin is the exit status of +.IR command . +.TP +\fBcompgen\fP [\fIoption\fP] [\fIword\fP] +Generate possible completion matches for \fIword\fP according to +the \fIoption\fPs, which may be any option accepted by the +.B complete +builtin with the exception of \fB\-p\fP and \fB\-r\fP, and write +the matches to the standard output. +When using the \fB\-F\fP or \fB\-C\fP options, the various shell variables +set by the programmable completion facilities, while available, will not +have useful values. +.sp 1 +The matches will be generated in the same way as if the programmable +completion code had generated them directly from a completion specification +with the same flags. +If \fIword\fP is specified, only those completions matching \fIword\fP +will be displayed. +.sp 1 +The return value is true unless an invalid option is supplied, or no +matches were generated. +.TP +\fBcomplete\fP [\fB\-abcdefgjksuv\fP] [\fB\-o\fP \fIcomp-option\fP] [\fB\-DE\fP] [\fB\-A\fP \fIaction\fP] [\fB\-G\fP \fIglobpat\fP] [\fB\-W\fP \fIwordlist\fP] [\fB\-F\fP \fIfunction\fP] [\fB\-C\fP \fIcommand\fP] +.br +[\fB\-X\fP \fIfilterpat\fP] [\fB\-P\fP \fIprefix\fP] [\fB\-S\fP \fIsuffix\fP] \fIname\fP [\fIname ...\fP] +.PD 0 +.TP +\fBcomplete\fP \fB\-pr\fP [\fB\-DE\fP] [\fIname\fP ...] +.PD +Specify how arguments to each \fIname\fP should be completed. +If the \fB\-p\fP option is supplied, or if no options are supplied, +existing completion specifications are printed in a way that allows +them to be reused as input. +The \fB\-r\fP option removes a completion specification for +each \fIname\fP, or, if no \fIname\fPs are supplied, all +completion specifications. +The \fB\-D\fP option indicates that the remaining options and actions should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The \fB\-E\fP option indicates that the remaining options and actions should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +.sp 1 +The process of applying these completion specifications when word completion +is attempted is described above under \fBProgrammable Completion\fP. +.sp 1 +Other options, if specified, have the following meanings. +The arguments to the \fB\-G\fP, \fB\-W\fP, and \fB\-X\fP options +(and, if necessary, the \fB\-P\fP and \fB\-S\fP options) +should be quoted to protect them from expansion before the +.B complete +builtin is invoked. +.RS +.PD 0 +.TP 8 +\fB\-o\fP \fIcomp-option\fP +The \fIcomp-option\fP controls several aspects of the compspec's behavior +beyond the simple generation of completions. +\fIcomp-option\fP may be one of: +.RS +.TP 8 +.B bashdefault +Perform the rest of the default \fBbash\fP completions if the compspec +generates no matches. +.TP 8 +.B default +Use readline's default filename completion if the compspec generates +no matches. +.TP 8 +.B dirnames +Perform directory name completion if the compspec generates no matches. +.TP 8 +.B filenames +Tell readline that the compspec generates filenames, so it can perform any +filename\-specific processing (like adding a slash to directory names, +quoting special characters, or suppressing trailing spaces). +Intended to be used with shell functions. +.TP 8 +.B noquote +Tell readline not to quote the completed words if they are filenames +(quoting filenames is the default). +.TP 8 +.B nospace +Tell readline not to append a space (the default) to words completed at +the end of the line. +.TP 8 +.B plusdirs +After any matches defined by the compspec are generated, +directory name completion is attempted and any +matches are added to the results of the other actions. +.RE +.TP 8 +\fB\-A\fP \fIaction\fP +The \fIaction\fP may be one of the following to generate a list of possible +completions: +.RS +.TP 8 +.B alias +Alias names. May also be specified as \fB\-a\fP. +.TP 8 +.B arrayvar +Array variable names. +.TP 8 +.B binding +\fBReadline\fP key binding names. +.TP 8 +.B builtin +Names of shell builtin commands. May also be specified as \fB\-b\fP. +.TP 8 +.B command +Command names. May also be specified as \fB\-c\fP. +.TP 8 +.B directory +Directory names. May also be specified as \fB\-d\fP. +.TP 8 +.B disabled +Names of disabled shell builtins. +.TP 8 +.B enabled +Names of enabled shell builtins. +.TP 8 +.B export +Names of exported shell variables. May also be specified as \fB\-e\fP. +.TP 8 +.B file +File names. May also be specified as \fB\-f\fP. +.TP 8 +.B function +Names of shell functions. +.TP 8 +.B group +Group names. May also be specified as \fB\-g\fP. +.TP 8 +.B helptopic +Help topics as accepted by the \fBhelp\fP builtin. +.TP 8 +.B hostname +Hostnames, as taken from the file specified by the +.SM +.B HOSTFILE +shell variable. +.TP 8 +.B job +Job names, if job control is active. May also be specified as \fB\-j\fP. +.TP 8 +.B keyword +Shell reserved words. May also be specified as \fB\-k\fP. +.TP 8 +.B running +Names of running jobs, if job control is active. +.TP 8 +.B service +Service names. May also be specified as \fB\-s\fP. +.TP 8 +.B setopt +Valid arguments for the \fB\-o\fP option to the \fBset\fP builtin. +.TP 8 +.B shopt +Shell option names as accepted by the \fBshopt\fP builtin. +.TP 8 +.B signal +Signal names. +.TP 8 +.B stopped +Names of stopped jobs, if job control is active. +.TP 8 +.B user +User names. May also be specified as \fB\-u\fP. +.TP 8 +.B variable +Names of all shell variables. May also be specified as \fB\-v\fP. +.RE +.TP 8 +\fB\-C\fP \fIcommand\fP +\fIcommand\fP is executed in a subshell environment, and its output is +used as the possible completions. +.TP 8 +\fB\-F\fP \fIfunction\fP +The shell function \fIfunction\fP is executed in the current shell +environment. +When the function is executed, +the first argument (\fB$1\fP) is the name of the command whose arguments are +being completed, +the second argument (\fB$2\fP) is the word being completed, +and the third argument (\fB$3\fP) is the word preceding the word being +completed on the current command line. +When it finishes, the possible completions are retrieved from the value +of the +.SM +.B COMPREPLY +array variable. +.TP 8 +\fB\-G\fP \fIglobpat\fP +The pathname expansion pattern \fIglobpat\fP is expanded to generate +the possible completions. +.TP 8 +\fB\-P\fP \fIprefix\fP +\fIprefix\fP is added at the beginning of each possible completion +after all other options have been applied. +.TP 8 +\fB\-S\fP \fIsuffix\fP +\fIsuffix\fP is appended to each possible completion +after all other options have been applied. +.TP 8 +\fB\-W\fP \fIwordlist\fP +The \fIwordlist\fP is split using the characters in the +.SM +.B IFS +special variable as delimiters, and each resultant word is expanded. +The possible completions are the members of the resultant list which +match the word being completed. +.TP 8 +\fB\-X\fP \fIfilterpat\fP +\fIfilterpat\fP is a pattern as used for pathname expansion. +It is applied to the list of possible completions generated by the +preceding options and arguments, and each completion matching +\fIfilterpat\fP is removed from the list. +A leading \fB!\fP in \fIfilterpat\fP negates the pattern; in this +case, any completion not matching \fIfilterpat\fP is removed. +.PD +.PP +The return value is true unless an invalid option is supplied, an option +other than \fB\-p\fP or \fB\-r\fP is supplied without a \fIname\fP +argument, an attempt is made to remove a completion specification for +a \fIname\fP for which no specification exists, or +an error occurs adding a completion specification. +.RE +.TP +\fBcompopt\fP [\fB\-o\fP \fIoption\fP] [\fB\-DE\fP] [\fB+o\fP \fIoption\fP] [\fIname\fP] +Modify completion options for each \fIname\fP according to the +\fIoption\fPs, or for the +currently-executing completion if no \fIname\fPs are supplied. +If no \fIoption\fPs are given, display the completion options for each +\fIname\fP or the current completion. +The possible values of \fIoption\fP are those valid for the \fBcomplete\fP +builtin described above. +The \fB\-D\fP option indicates that the remaining options should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The \fB\-E\fP option indicates that the remaining options should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +.sp 1 +The return value is true unless an invalid option is supplied, an attempt +is made to modify the options for a \fIname\fP for which no completion +specification exists, or an output error occurs. +.TP +\fBcontinue\fP [\fIn\fP] +Resume the next iteration of the enclosing +.BR for , +.BR while , +.BR until , +or +.B select +loop. +If +.I n +is specified, resume at the \fIn\fPth enclosing loop. +.I n +must be \(>= 1. If +.I n +is greater than the number of enclosing loops, the last enclosing loop +(the ``top-level'' loop) is resumed. +The return value is 0 unless \fIn\fP is not greater than or equal to 1. +.TP +\fBdeclare\fP [\fB\-aAfFgilnrtux\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +.PD 0 +.TP +\fBtypeset\fP [\fB\-aAfFgilnrtux\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +.PD +Declare variables and/or give them attributes. +If no \fIname\fPs are given then display the values of variables. +The +.B \-p +option will display the attributes and values of each +.IR name . +When +.B \-p +is used with \fIname\fP arguments, additional options, +other than \fB\-f\fP and \fB\-F\fP, are ignored. +When +.B \-p +is supplied without \fIname\fP arguments, it will display the attributes +and values of all variables having the attributes specified by the +additional options. +If no other options are supplied with \fB\-p\fP, \fBdeclare\fP will display +the attributes and values of all shell variables. The \fB\-f\fP option +will restrict the display to shell functions. +The +.B \-F +option inhibits the display of function definitions; only the +function name and attributes are printed. +If the \fBextdebug\fP shell option is enabled using \fBshopt\fP, +the source file name and line number where the function is defined +are displayed as well. The +.B \-F +option implies +.BR \-f . +The +.B \-g +option forces variables to be created or modified at the global scope, +even when \fBdeclare\fP is executed in a shell function. +It is ignored in all other cases. +The following options can +be used to restrict output to variables with the specified attribute or +to give variables attributes: +.RS +.PD 0 +.TP +.B \-a +Each \fIname\fP is an indexed array variable (see +.B Arrays +above). +.TP +.B \-A +Each \fIname\fP is an associative array variable (see +.B Arrays +above). +.TP +.B \-f +Use function names only. +.TP +.B \-i +The variable is treated as an integer; arithmetic evaluation (see +.SM +.B "ARITHMETIC EVALUATION" +above) is performed when the variable is assigned a value. +.TP +.B \-l +When the variable is assigned a value, all upper-case characters are +converted to lower-case. +The upper-case attribute is disabled. +.TP +.B \-n +Give each \fIname\fP the \fInameref\fP attribute, making +it a name reference to another variable. +That other variable is defined by the value of \fIname\fP. +All references and assignments to \fIname\fP, except for changing the +\fB\-n\fP attribute itself, are performed on the variable referenced by +\fIname\fP's value. +The \fB\-n\fP attribute cannot be applied to array variables. +.TP +.B \-r +Make \fIname\fPs readonly. These names cannot then be assigned values +by subsequent assignment statements or unset. +.TP +.B \-t +Give each \fIname\fP the \fItrace\fP attribute. +Traced functions inherit the \fBDEBUG\fP and \fBRETURN\fP traps from +the calling shell. +The trace attribute has no special meaning for variables. +.TP +.B \-u +When the variable is assigned a value, all lower-case characters are +converted to upper-case. +The lower-case attribute is disabled. +.TP +.B \-x +Mark \fIname\fPs for export to subsequent commands via the environment. +.PD +.PP +Using `+' instead of `\-' +turns off the attribute instead, +with the exceptions that \fB+a\fP +may not be used to destroy an array variable and \fB+r\fP will not +remove the readonly attribute. +When used in a function, +.B declare +and +.B typeset +make each +\fIname\fP local, as with the +.B local +command, +unless the \fB\-g\fP option is supplied. +If a variable name is followed by =\fIvalue\fP, the value of +the variable is set to \fIvalue\fP. +When using \fB\-a\fP or \fB\-A\fP and the compound assignment syntax to +create array variables, additional attributes do not take effect until +subsequent assignments. +The return value is 0 unless an invalid option is encountered, +an attempt is made to define a function using +.if n ``\-f foo=bar'', +.if t \f(CW\-f foo=bar\fP, +an attempt is made to assign a value to a readonly variable, +an attempt is made to assign a value to an array variable without +using the compound assignment syntax (see +.B Arrays +above), one of the \fInames\fP is not a valid shell variable name, +an attempt is made to turn off readonly status for a readonly variable, +an attempt is made to turn off array status for an array variable, +or an attempt is made to display a non-existent function with \fB\-f\fP. +.RE +.TP +.B dirs [\fB\-clpv\fP] [+\fIn\fP] [\-\fIn\fP] +Without options, displays the list of currently remembered directories. +The default display is on a single line with directory names separated +by spaces. +Directories are added to the list with the +.B pushd +command; the +.B popd +command removes entries from the list. +.RS +.PD 0 +.TP +.B \-c +Clears the directory stack by deleting all of the entries. +.TP +.B \-l +Produces a listing using full pathnames; +the default listing format uses a tilde to denote the home directory. +.TP +.B \-p +Print the directory stack with one entry per line. +.TP +.B \-v +Print the directory stack with one entry per line, +prefixing each entry with its index in the stack. +.TP +\fB+\fP\fIn\fP +Displays the \fIn\fPth entry counting from the left of the list +shown by +.B dirs +when invoked without options, starting with zero. +.TP +\fB\-\fP\fIn\fP +Displays the \fIn\fPth entry counting from the right of the list +shown by +.B dirs +when invoked without options, starting with zero. +.PD +.PP +The return value is 0 unless an +invalid option is supplied or \fIn\fP indexes beyond the end +of the directory stack. +.RE +.TP +\fBdisown\fP [\fB\-ar\fP] [\fB\-h\fP] [\fIjobspec\fP ...] +Without options, remove each +.I jobspec +from the table of active jobs. +If +.I jobspec +is not present, and neither the \fB\-a\fP nor the \fB\-r\fP option +is supplied, the \fIcurrent job\fP is used. +If the \fB\-h\fP option is given, each +.I jobspec +is not removed from the table, but is marked so that +.SM +.B SIGHUP +is not sent to the job if the shell receives a +.SM +.BR SIGHUP . +If no +.I jobspec +is supplied, the +.B \-a +option means to remove or mark all jobs; the +.B \-r +option without a +.I jobspec +argument restricts operation to running jobs. +The return value is 0 unless a +.I jobspec +does not specify a valid job. +.TP +\fBecho\fP [\fB\-neE\fP] [\fIarg\fP ...] +Output the \fIarg\fPs, separated by spaces, followed by a newline. +The return status is 0 unless a write error occurs. +If \fB\-n\fP is specified, the trailing newline is +suppressed. If the \fB\-e\fP option is given, interpretation of +the following backslash-escaped characters is enabled. The +.B \-E +option disables the interpretation of these escape characters, +even on systems where they are interpreted by default. +The \fBxpg_echo\fP shell option may be used to +dynamically determine whether or not \fBecho\fP expands these +escape characters by default. +.B echo +does not interpret \fB\-\-\fP to mean the end of options. +.B echo +interprets the following escape sequences: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ec +suppress further output +.TP +.B \ee +.TP +.B \eE +an escape character +.TP +.B \ef +form feed +.TP +.B \en +new line +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\e +backslash +.TP +.B \e0\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(zero to three octal digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.TP +.B \eu\fIHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHH\fP (one to four hex digits) +.TP +.B \eU\fIHHHHHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHHHHHH\fP (one to eight hex digits) +.PD +.RE +.TP +\fBenable\fP [\fB\-a\fP] [\fB\-dnps\fP] [\fB\-f\fP \fIfilename\fP] [\fIname\fP ...] +Enable and disable builtin shell commands. +Disabling a builtin allows a disk command which has the same name +as a shell builtin to be executed without specifying a full pathname, +even though the shell normally searches for builtins before disk commands. +If \fB\-n\fP is used, each \fIname\fP +is disabled; otherwise, +\fInames\fP are enabled. For example, to use the +.B test +binary found via the +.SM +.B PATH +instead of the shell builtin version, run +.if t \f(CWenable -n test\fP. +.if n ``enable -n test''. +The +.B \-f +option means to load the new builtin command +.I name +from shared object +.IR filename , +on systems that support dynamic loading. The +.B \-d +option will delete a builtin previously loaded with +.BR \-f . +If no \fIname\fP arguments are given, or if the +.B \-p +option is supplied, a list of shell builtins is printed. +With no other option arguments, the list consists of all enabled +shell builtins. +If \fB\-n\fP is supplied, only disabled builtins are printed. +If \fB\-a\fP is supplied, the list printed includes all builtins, with an +indication of whether or not each is enabled. +If \fB\-s\fP is supplied, the output is restricted to the POSIX +\fIspecial\fP builtins. +The return value is 0 unless a +.I name +is not a shell builtin or there is an error loading a new builtin +from a shared object. +.TP +\fBeval\fP [\fIarg\fP ...] +The \fIarg\fPs are read and concatenated together into a single +command. This command is then read and executed by the shell, and +its exit status is returned as the value of +.BR eval . +If there are no +.IR args , +or only null arguments, +.B eval +returns 0. +.TP +\fBexec\fP [\fB\-cl\fP] [\fB\-a\fP \fIname\fP] [\fIcommand\fP [\fIarguments\fP]] +If +.I command +is specified, it replaces the shell. +No new process is created. The +.I arguments +become the arguments to \fIcommand\fP. +If the +.B \-l +option is supplied, +the shell places a dash at the beginning of the zeroth argument passed to +.IR command . +This is what +.IR login (1) +does. The +.B \-c +option causes +.I command +to be executed with an empty environment. If +.B \-a +is supplied, the shell passes +.I name +as the zeroth argument to the executed command. +If +.I command +cannot be executed for some reason, a non-interactive shell exits, +unless the +.B execfail +shell option +is enabled. In that case, it returns failure. +An interactive shell returns failure if the file cannot be executed. +If +.I command +is not specified, any redirections take effect in the current shell, +and the return status is 0. If there is a redirection error, the +return status is 1. +.TP +\fBexit\fP [\fIn\fP] +Cause the shell to exit +with a status of \fIn\fP. If +.I n +is omitted, the exit status +is that of the last command executed. +A trap on +.SM +.B EXIT +is executed before the shell terminates. +.TP +\fBexport\fP [\fB\-fn\fP\^] [\fIname\fP[=\fIword\fP]] ... +.PD 0 +.TP +.B export \-p +.PD +The supplied +.I names +are marked for automatic export to the environment of +subsequently executed commands. If the +.B \-f +option is given, +the +.I names +refer to functions. +If no +.I names +are given, or if the +.B \-p +option is supplied, a list +of names of all exported variables is printed. +The +.B \-n +option causes the export property to be removed from each +\fIname\fP. +If a variable name is followed by =\fIword\fP, the value of +the variable is set to \fIword\fP. +.B export +returns an exit status of 0 unless an invalid option is +encountered, +one of the \fInames\fP is not a valid shell variable name, or +.B \-f +is supplied with a +.I name +that is not a function. +.TP +\fBfc\fP [\fB\-e\fP \fIename\fP] [\fB\-lnr\fP] [\fIfirst\fP] [\fIlast\fP] +.PD 0 +.TP +\fBfc\fP \fB\-s\fP [\fIpat\fP=\fIrep\fP] [\fIcmd\fP] +.PD +The first form selects a range of commands from +.I first +to +.I last +from the history list and displays or edits and re-executes them. +.I First +and +.I last +may be specified as a string (to locate the last command beginning +with that string) or as a number (an index into the history list, +where a negative number is used as an offset from the current +command number). If +.I last +is not specified it is set to +the current command for listing (so that +.if n ``fc \-l \-10'' +.if t \f(CWfc \-l \-10\fP +prints the last 10 commands) and to +.I first +otherwise. +If +.I first +is not specified it is set to the previous +command for editing and \-16 for listing. +.sp 1 +The +.B \-n +option suppresses +the command numbers when listing. The +.B \-r +option reverses the order of +the commands. If the +.B \-l +option is given, +the commands are listed on +standard output. Otherwise, the editor given by +.I ename +is invoked +on a file containing those commands. If +.I ename +is not given, the +value of the +.SM +.B FCEDIT +variable is used, and +the value of +.SM +.B EDITOR +if +.SM +.B FCEDIT +is not set. If neither variable is set, +.FN vi +is used. When editing is complete, the edited commands are +echoed and executed. +.sp 1 +In the second form, \fIcommand\fP is re-executed after each instance +of \fIpat\fP is replaced by \fIrep\fP. +\fICommand\fP is intepreted the same as \fIfirst\fP above. +A useful alias to use with this is +.if n ``r="fc -s"'', +.if t \f(CWr='fc \-s'\fP, +so that typing +.if n ``r cc'' +.if t \f(CWr cc\fP +runs the last command beginning with +.if n ``cc'' +.if t \f(CWcc\fP +and typing +.if n ``r'' +.if t \f(CWr\fP +re-executes the last command. +.sp 1 +If the first form is used, the return value is 0 unless an invalid +option is encountered or +.I first +or +.I last +specify history lines out of range. +If the +.B \-e +option is supplied, the return value is the value of the last +command executed or failure if an error occurs with the temporary +file of commands. If the second form is used, the return status +is that of the command re-executed, unless +.I cmd +does not specify a valid history line, in which case +.B fc +returns failure. +.TP +\fBfg\fP [\fIjobspec\fP] +Resume +.I jobspec +in the foreground, and make it the current job. +If +.I jobspec +is not present, the shell's notion of the \fIcurrent job\fP is used. +The return value is that of the command placed into the foreground, +or failure if run when job control is disabled or, when run with +job control enabled, if +.I jobspec +does not specify a valid job or +.I jobspec +specifies a job that was started without job control. +.TP +\fBgetopts\fP \fIoptstring\fP \fIname\fP [\fIargs\fP] +.B getopts +is used by shell procedures to parse positional parameters. +.I optstring +contains the option characters to be recognized; if a character +is followed by a colon, the option is expected to have an +argument, which should be separated from it by white space. +The colon and question mark characters may not be used as +option characters. +Each time it is invoked, +.B getopts +places the next option in the shell variable +.IR name , +initializing +.I name +if it does not exist, +and the index of the next argument to be processed into the +variable +.SM +.BR OPTIND . +.SM +.B OPTIND +is initialized to 1 each time the shell or a shell script +is invoked. When an option requires an argument, +.B getopts +places that argument into the variable +.SM +.BR OPTARG . +The shell does not reset +.SM +.B OPTIND +automatically; it must be manually reset between multiple +calls to +.B getopts +within the same shell invocation if a new set of parameters +is to be used. +.sp 1 +When the end of options is encountered, \fBgetopts\fP exits with a +return value greater than zero. +.SM +.B OPTIND +is set to the index of the first non-option argument, +and \fIname\fP is set to ?. +.sp 1 +.B getopts +normally parses the positional parameters, but if more arguments are +given in +.IR args , +.B getopts +parses those instead. +.sp 1 +.B getopts +can report errors in two ways. If the first character of +.I optstring +is a colon, +.I silent +error reporting is used. In normal operation, diagnostic messages +are printed when invalid options or missing option arguments are +encountered. +If the variable +.SM +.B OPTERR +is set to 0, no error messages will be displayed, even if the first +character of +.I optstring +is not a colon. +.sp 1 +If an invalid option is seen, +.B getopts +places ? into +.I name +and, if not silent, +prints an error message and unsets +.SM +.BR OPTARG . +If +.B getopts +is silent, +the option character found is placed in +.SM +.B OPTARG +and no diagnostic message is printed. +.sp 1 +If a required argument is not found, and +.B getopts +is not silent, +a question mark (\^\fB?\fP\^) is placed in +.IR name , +.SM +.B OPTARG +is unset, and a diagnostic message is printed. +If +.B getopts +is silent, then a colon (\^\fB:\fP\^) is placed in +.I name +and +.SM +.B OPTARG +is set to the option character found. +.sp 1 +.B getopts +returns true if an option, specified or unspecified, is found. +It returns false if the end of options is encountered or an +error occurs. +.TP +\fBhash\fP [\fB\-lr\fP] [\fB\-p\fP \fIfilename\fP] [\fB\-dt\fP] [\fIname\fP] +Each time \fBhash\fP is invoked, +the full pathname of the command +.I name +is determined by searching +the directories in +.B $PATH +and remembered. Any previously-remembered pathname is discarded. +If the +.B \-p +option is supplied, no path search is performed, and +.I filename +is used as the full filename of the command. +The +.B \-r +option causes the shell to forget all +remembered locations. +The +.B \-d +option causes the shell to forget the remembered location of each \fIname\fP. +If the +.B \-t +option is supplied, the full pathname to which each \fIname\fP corresponds +is printed. If multiple \fIname\fP arguments are supplied with \fB\-t\fP, +the \fIname\fP is printed before the hashed full pathname. +The +.B \-l +option causes output to be displayed in a format that may be reused as input. +If no arguments are given, or if only \fB\-l\fP is supplied, +information about remembered commands is printed. +The return status is true unless a +.I name +is not found or an invalid option is supplied. +.TP +\fBhelp\fP [\fB\-dms\fP] [\fIpattern\fP] +Display helpful information about builtin commands. If +.I pattern +is specified, +.B help +gives detailed help on all commands matching +.IR pattern ; +otherwise help for all the builtins and shell control structures +is printed. +.RS +.PD 0 +.TP +.B \-d +Display a short description of each \fIpattern\fP +.TP +.B \-m +Display the description of each \fIpattern\fP in a manpage-like format +.TP +.B \-s +Display only a short usage synopsis for each \fIpattern\fP +.PD +.PP +The return status is 0 unless no command matches +.IR pattern . +.RE +.TP +\fBhistory [\fIn\fP] +.PD 0 +.TP +\fBhistory\fP \fB\-c\fP +.TP +\fBhistory \-d\fP \fIoffset\fP +.TP +\fBhistory\fP \fB\-anrw\fP [\fIfilename\fP] +.TP +\fBhistory\fP \fB\-p\fP \fIarg\fP [\fIarg ...\fP] +.TP +\fBhistory\fP \fB\-s\fP \fIarg\fP [\fIarg ...\fP] +.PD +With no options, display the command +history list with line numbers. Lines listed +with a +.B * +have been modified. An argument of +.I n +lists only the last +.I n +lines. +If the shell variable +.SM +.B HISTTIMEFORMAT +is set and not null, +it is used as a format string for \fIstrftime\fP(3) to display +the time stamp associated with each displayed history entry. +No intervening blank is printed between the formatted time stamp +and the history line. +If \fIfilename\fP is supplied, it is used as the +name of the history file; if not, the value of +.SM +.B HISTFILE +is used. Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-c +Clear the history list by deleting all the entries. +.TP +\fB\-d\fP \fIoffset\fP +Delete the history entry at position \fIoffset\fP. +.TP +.B \-a +Append the ``new'' history lines (history lines entered since the +beginning of the current \fBbash\fP session) to the history file. +.TP +.B \-n +Read the history lines not already read from the history +file into the current history list. These are lines +appended to the history file since the beginning of the +current \fBbash\fP session. +.TP +.B \-r +Read the contents of the history file +and append them to the current history list. +.TP +.B \-w +Write the current history list to the history file, overwriting the +history file's contents. +.TP +.B \-p +Perform history substitution on the following \fIargs\fP and display +the result on the standard output. +Does not store the results in the history list. +Each \fIarg\fP must be quoted to disable normal history expansion. +.TP +.B \-s +Store the +.I args +in the history list as a single entry. The last command in the +history list is removed before the +.I args +are added. +.PD +.PP +If the +.SM +.B HISTTIMEFORMAT +variable is set, the time stamp information +associated with each history entry is written to the history file, +marked with the history comment character. +When the history file is read, lines beginning with the history +comment character followed immediately by a digit are interpreted +as timestamps for the previous history line. +The return value is 0 unless an invalid option is encountered, an +error occurs while reading or writing the history file, an invalid +\fIoffset\fP is supplied as an argument to \fB\-d\fP, or the +history expansion supplied as an argument to \fB\-p\fP fails. +.RE +.TP +\fBjobs\fP [\fB\-lnprs\fP] [ \fIjobspec\fP ... ] +.PD 0 +.TP +\fBjobs\fP \fB\-x\fP \fIcommand\fP [ \fIargs\fP ... ] +.PD +The first form lists the active jobs. The options have the following +meanings: +.RS +.PD 0 +.TP +.B \-l +List process IDs +in addition to the normal information. +.TP +.B \-n +Display information only about jobs that have changed status since +the user was last notified of their status. +.TP +.B \-p +List only the process ID of the job's process group +leader. +.TP +.B \-r +Display only running jobs. +.TP +.B \-s +Display only stopped jobs. +.PD +.PP +If +.I jobspec +is given, output is restricted to information about that job. +The return status is 0 unless an invalid option is encountered +or an invalid +.I jobspec +is supplied. +.PP +If the +.B \-x +option is supplied, +.B jobs +replaces any +.I jobspec +found in +.I command +or +.I args +with the corresponding process group ID, and executes +.I command +passing it +.IR args , +returning its exit status. +.RE +.TP +\fBkill\fP [\fB\-s\fP \fIsigspec\fP | \fB\-n\fP \fIsignum\fP | \fB\-\fP\fIsigspec\fP] [\fIpid\fP | \fIjobspec\fP] ... +.PD 0 +.TP +\fBkill\fP \fB\-l\fP [\fIsigspec\fP | \fIexit_status\fP] +.PD +Send the signal named by +.I sigspec +or +.I signum +to the processes named by +.I pid +or +.IR jobspec . +.I sigspec +is either a case-insensitive signal name such as +.SM +.B SIGKILL +(with or without the +.SM +.B SIG +prefix) or a signal number; +.I signum +is a signal number. +If +.I sigspec +is not present, then +.SM +.B SIGTERM +is assumed. +An argument of +.B \-l +lists the signal names. +If any arguments are supplied when +.B \-l +is given, the names of the signals corresponding to the arguments are +listed, and the return status is 0. +The \fIexit_status\fP argument to +.B \-l +is a number specifying either a signal number or the exit status of +a process terminated by a signal. +.B kill +returns true if at least one signal was successfully sent, or false +if an error occurs or an invalid option is encountered. +.TP +\fBlet\fP \fIarg\fP [\fIarg\fP ...] +Each +.I arg +is an arithmetic expression to be evaluated (see +.SM +.B "ARITHMETIC EVALUATION" +above). +If the last +.I arg +evaluates to 0, +.B let +returns 1; 0 is returned otherwise. +.TP +\fBlocal\fP [\fIoption\fP] [\fIname\fP[=\fIvalue\fP] ...] +For each argument, a local variable named +.I name +is created, and assigned +.IR value . +The \fIoption\fP can be any of the options accepted by \fBdeclare\fP. +When +.B local +is used within a function, it causes the variable +.I name +to have a visible scope restricted to that function and its children. +With no operands, +.B local +writes a list of local variables to the standard output. It is +an error to use +.B local +when not within a function. The return status is 0 unless +.B local +is used outside a function, an invalid +.I name +is supplied, or +\fIname\fP is a readonly variable. +.TP +.B logout +Exit a login shell. +.TP +\fBmapfile\fP [\fB\-n\fP \fIcount\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-s\fP \fIcount\fP] [\fB\-t\fP] [\fB\-u\fP \fIfd\fP] [\fB\-C\fP \fIcallback\fP] [\fB\-c\fP \fIquantum\fP] [\fIarray\fP] +.PD 0 +.TP +\fBreadarray\fP [\fB\-n\fP \fIcount\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-s\fP \fIcount\fP] [\fB\-t\fP] [\fB\-u\fP \fIfd\fP] [\fB\-C\fP \fIcallback\fP] [\fB\-c\fP \fIquantum\fP] [\fIarray\fP] +.PD +Read lines from the standard input into the indexed array variable +.IR array , +or from file descriptor +.IR fd +if the +.B \-u +option is supplied. +The variable +.SM +.B MAPFILE +is the default \fIarray\fP. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Copy at most +.I count +lines. If \fIcount\fP is 0, all lines are copied. +.TP +.B \-O +Begin assigning to +.I array +at index +.IR origin . +The default index is 0. +.TP +.B \-s +Discard the first \fIcount\fP lines read. +.TP +.B \-t +Remove a trailing newline from each line read. +.TP +.B \-u +Read lines from file descriptor \fIfd\fP instead of the standard input. +.TP +.B \-C +Evaluate +.I callback +each time \fIquantum\fP lines are read. The \fB\-c\fP option specifies +.IR quantum . +.TP +.B \-c +Specify the number of lines read between each call to +.IR callback . +.PD +.PP +If +.B \-C +is specified without +.BR \-c , +the default quantum is 5000. +When \fIcallback\fP is evaluated, it is supplied the index of the next +array element to be assigned and the line to be assigned to that element +as additional arguments. +\fIcallback\fP is evaluated after the line is read but before the +array element is assigned. +.PP +If not supplied with an explicit origin, \fBmapfile\fP will clear \fIarray\fP +before assigning to it. +.PP +\fBmapfile\fP returns successfully unless an invalid option or option +argument is supplied, \fIarray\fP is invalid or unassignable, or if +\fIarray\fP is not an indexed array. +.RE +.TP +\fBpopd\fP [\-\fBn\fP] [+\fIn\fP] [\-\fIn\fP] +Removes entries from the directory stack. With no arguments, +removes the top directory from the stack, and performs a +.B cd +to the new top directory. +Arguments, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Suppresses the normal change of directory when removing directories +from the stack, so that only the stack is manipulated. +.TP +\fB+\fP\fIn\fP +Removes the \fIn\fPth entry counting from the left of the list +shown by +.BR dirs , +starting with zero. For example: +.if n ``popd +0'' +.if t \f(CWpopd +0\fP +removes the first directory, +.if n ``popd +1'' +.if t \f(CWpopd +1\fP +the second. +.TP +\fB\-\fP\fIn\fP +Removes the \fIn\fPth entry counting from the right of the list +shown by +.BR dirs , +starting with zero. For example: +.if n ``popd -0'' +.if t \f(CWpopd -0\fP +removes the last directory, +.if n ``popd -1'' +.if t \f(CWpopd -1\fP +the next to last. +.PD +.PP +If the +.B popd +command is successful, a +.B dirs +is performed as well, and the return status is 0. +.B popd +returns false if an invalid option is encountered, the directory stack +is empty, a non-existent directory stack entry is specified, or the +directory change fails. +.RE +.TP +\fBprintf\fP [\fB\-v\fP \fIvar\fP] \fIformat\fP [\fIarguments\fP] +Write the formatted \fIarguments\fP to the standard output under the +control of the \fIformat\fP. +The \fB\-v\fP option causes the output to be assigned to the variable +\fIvar\fP rather than being printed to the standard output. +.sp 1 +The \fIformat\fP is a character string which contains three types of objects: +plain characters, which are simply copied to standard output, character +escape sequences, which are converted and copied to the standard output, and +format specifications, each of which causes printing of the next successive +\fIargument\fP. +In addition to the standard \fIprintf\fP(1) format specifications, +\fBprintf\fP interprets the following extensions: +.RS +.PD 0 +.TP +.B %b +causes +\fBprintf\fP to expand backslash escape sequences in the corresponding +\fIargument\fP (except that \fB\ec\fP terminates output, backslashes in +\fB\e\(aq\fP, \fB\e"\fP, and \fB\e?\fP are not removed, and octal escapes +beginning with \fB\e0\fP may contain up to four digits). +.TP +.B %q +causes \fBprintf\fP to output the corresponding +\fIargument\fP in a format that can be reused as shell input. +.TP +.B %(\fIdatefmt\fP)T +causes \fBprintf\fP to output the date-time string resulting from using +\fIdatefmt\fP as a format string for \fIstrftime\fP(3). +The corresponding \fIargument\fP is an integer representing the number of +seconds since the epoch. +Two special argument values may be used: -1 represents the current +time, and -2 represents the time the shell was invoked. +If no argument is specified, conversion behaves as if -1 had been given. +This is an exception to the usual \fBprintf\fP behavior. +.PD +.PP +Arguments to non-string format specifiers are treated as C constants, +except that a leading plus or minus sign is allowed, and if the leading +character is a single or double quote, the value is the ASCII value of +the following character. +.PP +The \fIformat\fP is reused as necessary to consume all of the \fIarguments\fP. +If the \fIformat\fP requires more \fIarguments\fP than are supplied, the +extra format specifications behave as if a zero value or null string, as +appropriate, had been supplied. +The return value is zero on success, non-zero on failure. +.RE +.TP +\fBpushd\fP [\fB\-n\fP] [+\fIn\fP] [\-\fIn\fP] +.PD 0 +.TP +\fBpushd\fP [\fB\-n\fP] [\fIdir\fP] +.PD +Adds a directory to the top of the directory stack, or rotates +the stack, making the new top of the stack the current working +directory. With no arguments, exchanges the top two directories +and returns 0, unless the directory stack is empty. +Arguments, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Suppresses the normal change of directory when adding directories +to the stack, so that only the stack is manipulated. +.TP +\fB+\fP\fIn\fP +Rotates the stack so that the \fIn\fPth directory +(counting from the left of the list shown by +.BR dirs , +starting with zero) +is at the top. +.TP +\fB\-\fP\fIn\fP +Rotates the stack so that the \fIn\fPth directory +(counting from the right of the list shown by +.BR dirs , +starting with zero) is at the top. +.TP +.I dir +Adds +.I dir +to the directory stack at the top, making it the +new current working directory as if it had been supplied as the argument +to the \fBcd\fP builtin. +.PD +.PP +If the +.B pushd +command is successful, a +.B dirs +is performed as well. +If the first form is used, +.B pushd +returns 0 unless the cd to +.I dir +fails. With the second form, +.B pushd +returns 0 unless the directory stack is empty, +a non-existent directory stack element is specified, +or the directory change to the specified new current directory +fails. +.RE +.TP +\fBpwd\fP [\fB\-LP\fP] +Print the absolute pathname of the current working directory. +The pathname printed contains no symbolic links if the +.B \-P +option is supplied or the +.B \-o physical +option to the +.B set +builtin command is enabled. +If the +.B \-L +option is used, the pathname printed may contain symbolic links. +The return status is 0 unless an error occurs while +reading the name of the current directory or an +invalid option is supplied. +.TP +\fBread\fP [\fB\-ers\fP] [\fB\-a\fP \fIaname\fP] [\fB\-d\fP \fIdelim\fP] [\fB\-i\fP \fItext\fP] [\fB\-n\fP \fInchars\fP] [\fB\-N\fP \fInchars\fP] [\fB\-p\fP \fIprompt\fP] [\fB\-t\fP \fItimeout\fP] [\fB\-u\fP \fIfd\fP] [\fIname\fP ...] +One line is read from the standard input, or from the file descriptor +\fIfd\fP supplied as an argument to the \fB\-u\fP option, and the first word +is assigned to the first +.IR name , +the second word to the second +.IR name , +and so on, with leftover words and their intervening separators assigned +to the last +.IR name . +If there are fewer words read from the input stream than names, +the remaining names are assigned empty values. +The characters in +.SM +.B IFS +are used to split the line into words using the same rules the shell +uses for expansion (described above under \fBWord Splitting\fP). +The backslash character (\fB\e\fP) may be used to remove any special +meaning for the next character read and for line continuation. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-a \fIaname\fP +The words are assigned to sequential indices +of the array variable +.IR aname , +starting at 0. +.I aname +is unset before any new values are assigned. +Other \fIname\fP arguments are ignored. +.TP +.B \-d \fIdelim\fP +The first character of \fIdelim\fP is used to terminate the input line, +rather than newline. +.TP +.B \-e +If the standard input +is coming from a terminal, +.B readline +(see +.SM +.B READLINE +above) is used to obtain the line. +Readline uses the current (or default, if line editing was not previously +active) editing settings. +.TP +.B \-i \fItext\fP +If +.B readline +is being used to read the line, \fItext\fP is placed into the editing +buffer before editing begins. +.TP +.B \-n \fInchars\fP +\fBread\fP returns after reading \fInchars\fP characters rather than +waiting for a complete line of input, but honor a delimiter if fewer +than \fInchars\fP characters are read before the delimiter. +.TP +.B \-N \fInchars\fP +\fBread\fP returns after reading exactly \fInchars\fP characters rather +than waiting for a complete line of input, unless EOF is encountered or +\fBread\fP times out. +Delimiter characters encountered in the input are +not treated specially and do not cause \fBread\fP to return until +\fInchars\fP characters are read. +.TP +.B \-p \fIprompt\fP +Display \fIprompt\fP on standard error, without a +trailing newline, before attempting to read any input. The prompt +is displayed only if input is coming from a terminal. +.TP +.B \-r +Backslash does not act as an escape character. +The backslash is considered to be part of the line. +In particular, a backslash-newline pair may not be used as a line +continuation. +.TP +.B \-s +Silent mode. If input is coming from a terminal, characters are +not echoed. +.TP +.B \-t \fItimeout\fP +Cause \fBread\fP to time out and return failure if a complete line of +input (or a specified number of characters) +is not read within \fItimeout\fP seconds. +\fItimeout\fP may be a decimal number with a fractional portion following +the decimal point. +This option is only effective if \fBread\fP is reading input from a +terminal, pipe, or other special file; it has no effect when reading +from regular files. +If \fBread\fP times out, \fBread\fP saves any partial input read into +the specified variable \fIname\fP. +If \fItimeout\fP is 0, \fBread\fP returns immediately, without trying to +read any data. The exit status is 0 if input is available on +the specified file descriptor, non-zero otherwise. +The exit status is greater than 128 if the timeout is exceeded. +.TP +.B \-u \fIfd\fP +Read input from file descriptor \fIfd\fP. +.PD +.PP +If no +.I names +are supplied, the line read is assigned to the variable +.SM +.BR REPLY . +The return code is zero, unless end-of-file is encountered, \fBread\fP +times out (in which case the return code is greater than 128), +a variable assignment error (such as assigning to a readonly variable) occurs, +or an invalid file descriptor is supplied as the argument to \fB\-u\fP. +.RE +.TP +\fBreadonly\fP [\fB\-aAf\fP] [\fB\-p\fP] [\fIname\fP[=\fIword\fP] ...] +.PD +The given +\fInames\fP are marked readonly; the values of these +.I names +may not be changed by subsequent assignment. +If the +.B \-f +option is supplied, the functions corresponding to the +\fInames\fP are so +marked. +The +.B \-a +option restricts the variables to indexed arrays; the +.B \-A +option restricts the variables to associative arrays. +If both options are supplied, +.B \-A +takes precedence. +If no +.I name +arguments are given, or if the +.B \-p +option is supplied, a list of all readonly names is printed. +The other options may be used to restrict the output to a subset of +the set of readonly names. +The +.B \-p +option causes output to be displayed in a format that +may be reused as input. +If a variable name is followed by =\fIword\fP, the value of +the variable is set to \fIword\fP. +The return status is 0 unless an invalid option is encountered, +one of the +.I names +is not a valid shell variable name, or +.B \-f +is supplied with a +.I name +that is not a function. +.TP +\fBreturn\fP [\fIn\fP] +Causes a function to stop executing and return the value specified by +.I n +to its caller. +If +.I n +is omitted, the return status is that of the last command +executed in the function body. If +.B return +is used outside a function, +but during execution of a script by the +.B . +(\fBsource\fP) command, it causes the shell to stop executing +that script and return either +.I n +or the exit status of the last command executed within the +script as the exit status of the script. +If \fIn\fP is supplied, the return value is its least significant +8 bits. +The return status is non-zero if +.B return +is supplied a non-numeric argument, or +is used outside a +function and not during execution of a script by \fB.\fP\^ or \fBsource\fP. +Any command associated with the \fBRETURN\fP trap is executed +before execution resumes after the function or script. +.TP +\fBset\fP [\fB\-\-abefhkmnptuvxBCEHPT\fP] [\fB\-o\fP \fIoption\-name\fP] [\fIarg\fP ...] +.PD 0 +.TP +\fBset\fP [\fB+abefhkmnptuvxBCEHPT\fP] [\fB+o\fP \fIoption\-name\fP] [\fIarg\fP ...] +.PD +Without options, the name and value of each shell variable are displayed +in a format that can be reused as input +for setting or resetting the currently-set variables. +Read-only variables cannot be reset. +In \fIposix\fP mode, only shell variables are listed. +The output is sorted according to the current locale. +When options are specified, they set or unset shell attributes. +Any arguments remaining after option processing are treated +as values for the positional parameters and are assigned, in order, to +.BR $1 , +.BR $2 , +.B ... +.BR $\fIn\fP . +Options, if specified, have the following meanings: +.RS +.PD 0 +.TP 8 +.B \-a +Automatically mark variables and functions which are modified or +created for export to the environment of subsequent commands. +.TP 8 +.B \-b +Report the status of terminated background jobs +immediately, rather than before the next primary prompt. This is +effective only when job control is enabled. +.TP 8 +.B \-e +Exit immediately if a +\fIpipeline\fP (which may consist of a single \fIsimple command\fP), +a \fIlist\fP, +or a \fIcompound command\fP +(see +.SM +.B SHELL GRAMMAR +above), exits with a non-zero status. +The shell does not exit if the +command that fails is part of the command list immediately following a +.B while +or +.B until +keyword, +part of the test following the +.B if +or +.B elif +reserved words, part of any command executed in a +.B && +or +.B || +list except the command following the final \fB&&\fP or \fB||\fP, +any command in a pipeline but the last, +or if the command's return value is +being inverted with +.BR ! . +If a compound command other than a subshell +returns a non-zero status because a command failed +while \fB\-e\fP was being ignored, the shell does not exit. +A trap on \fBERR\fP, if set, is executed before the shell exits. +This option applies to the shell environment and each subshell environment +separately (see +.SM +.B "COMMAND EXECUTION ENVIRONMENT" +above), and may cause +subshells to exit before executing all the commands in the subshell. +.if t .sp 0.5 +.if n .sp 1 +If a compound command or shell function executes in a context +where \fB\-e\fP is being ignored, +none of the commands executed within the compound command or function body +will be affected by the \fB\-e\fP setting, even if \fB\-e\fP is set +and a command returns a failure status. +If a compound command or shell function sets \fB\-e\fP while executing in +a context where \fB\-e\fP is ignored, that setting will not have any +effect until the compound command or the command containing the function +call completes. +.TP 8 +.B \-f +Disable pathname expansion. +.TP 8 +.B \-h +Remember the location of commands as they are looked up for execution. +This is enabled by default. +.TP 8 +.B \-k +All arguments in the form of assignment statements +are placed in the environment for a command, not just +those that precede the command name. +.TP 8 +.B \-m +Monitor mode. Job control is enabled. This option is on +by default for interactive shells on systems that support +it (see +.SM +.B JOB CONTROL +above). +All processes run in a separate process group. +When a background job completes, the shell prints a line +containing its exit status. +.TP 8 +.B \-n +Read commands but do not execute them. This may be used to +check a shell script for syntax errors. This is ignored by +interactive shells. +.TP 8 +.B \-o \fIoption\-name\fP +The \fIoption\-name\fP can be one of the following: +.RS +.TP 8 +.B allexport +Same as +.BR \-a . +.TP 8 +.B braceexpand +Same as +.BR \-B . +.TP 8 +.B emacs +Use an emacs-style command line editing interface. This is enabled +by default when the shell is interactive, unless the shell is started +with the +.B \-\-noediting +option. +This also affects the editing interface used for \fBread \-e\fP. +.TP 8 +.B errexit +Same as +.BR \-e . +.TP 8 +.B errtrace +Same as +.BR \-E . +.TP 8 +.B functrace +Same as +.BR \-T . +.TP 8 +.B hashall +Same as +.BR \-h . +.TP 8 +.B histexpand +Same as +.BR \-H . +.TP 8 +.B history +Enable command history, as described above under +.SM +.BR HISTORY . +This option is on by default in interactive shells. +.TP 8 +.B ignoreeof +The effect is as if the shell command +.if t \f(CWIGNOREEOF=10\fP +.if n ``IGNOREEOF=10'' +had been executed +(see +.B Shell Variables +above). +.TP 8 +.B keyword +Same as +.BR \-k . +.TP 8 +.B monitor +Same as +.BR \-m . +.TP 8 +.B noclobber +Same as +.BR \-C . +.TP 8 +.B noexec +Same as +.BR \-n . +.TP 8 +.B noglob +Same as +.BR \-f . +.TP 8 +.B nolog +Currently ignored. +.TP 8 +.B notify +Same as +.BR \-b . +.TP 8 +.B nounset +Same as +.BR \-u . +.TP 8 +.B onecmd +Same as +.BR \-t . +.TP 8 +.B physical +Same as +.BR \-P . +.TP 8 +.B pipefail +If set, the return value of a pipeline is the value of the last +(rightmost) command to exit with a non-zero status, or zero if all +commands in the pipeline exit successfully. +This option is disabled by default. +.TP 8 +.B posix +Change the behavior of +.B bash +where the default operation differs +from the POSIX standard to match the standard (\fIposix mode\fP). +See +.SM +.B "SEE ALSO" +below for a reference to a document that details how posix mode affects +bash's behavior. +.TP 8 +.B privileged +Same as +.BR \-p . +.TP 8 +.B verbose +Same as +.BR \-v . +.TP 8 +.B vi +Use a vi-style command line editing interface. +This also affects the editing interface used for \fBread \-e\fP. +.TP 8 +.B xtrace +Same as +.BR \-x . +.sp .5 +.PP +If +.B \-o +is supplied with no \fIoption\-name\fP, the values of the current options are +printed. +If +.B +o +is supplied with no \fIoption\-name\fP, a series of +.B set +commands to recreate the current option settings is displayed on +the standard output. +.RE +.TP 8 +.B \-p +Turn on +.I privileged +mode. In this mode, the +.SM +.B $ENV +and +.SM +.B $BASH_ENV +files are not processed, shell functions are not inherited from the +environment, and the +.SM +.BR SHELLOPTS , +.SM +.BR BASHOPTS , +.SM +.BR CDPATH , +and +.SM +.B GLOBIGNORE +variables, if they appear in the environment, are ignored. +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the \fB\-p\fP option is not supplied, these actions +are taken and the effective user id is set to the real user id. +If the \fB\-p\fP option is supplied at startup, the effective user id is +not reset. +Turning this option off causes the effective user +and group ids to be set to the real user and group ids. +.TP 8 +.B \-t +Exit after reading and executing one command. +.TP 8 +.B \-u +Treat unset variables and parameters other than the special +parameters "@" and "*" as an error when performing +parameter expansion. If expansion is attempted on an +unset variable or parameter, the shell prints an error message, and, +if not interactive, exits with a non-zero status. +.TP 8 +.B \-v +Print shell input lines as they are read. +.TP 8 +.B \-x +After expanding each \fIsimple command\fP, +\fBfor\fP command, \fBcase\fP command, \fBselect\fP command, or +arithmetic \fBfor\fP command, display the expanded value of +.SM +.BR PS4 , +followed by the command and its expanded arguments +or associated word list. +.TP 8 +.B \-B +The shell performs brace expansion (see +.B Brace Expansion +above). This is on by default. +.TP 8 +.B \-C +If set, +.B bash +does not overwrite an existing file with the +.BR > , +.BR >& , +and +.B <> +redirection operators. This may be overridden when +creating output files by using the redirection operator +.B >| +instead of +.BR > . +.TP 8 +.B \-E +If set, any trap on \fBERR\fP is inherited by shell functions, command +substitutions, and commands executed in a subshell environment. +The \fBERR\fP trap is normally not inherited in such cases. +.TP 8 +.B \-H +Enable +.B ! +style history substitution. This option is on by +default when the shell is interactive. +.TP 8 +.B \-P +If set, the shell does not resolve symbolic links when executing +commands such as +.B cd +that change the current working directory. It uses the +physical directory structure instead. By default, +.B bash +follows the logical chain of directories when performing commands +which change the current directory. +.TP 8 +.B \-T +If set, any traps on \fBDEBUG\fP and \fBRETURN\fP are inherited by shell +functions, command substitutions, and commands executed in a +subshell environment. +The \fBDEBUG\fP and \fBRETURN\fP traps are normally not inherited +in such cases. +.TP 8 +.B \-\- +If no arguments follow this option, then the positional parameters are +unset. Otherwise, the positional parameters are set to the +\fIarg\fPs, even if some of them begin with a +.BR \- . +.TP 8 +.B \- +Signal the end of options, cause all remaining \fIarg\fPs to be +assigned to the positional parameters. The +.B \-x +and +.B \-v +options are turned off. +If there are no \fIarg\fPs, +the positional parameters remain unchanged. +.PD +.PP +The options are off by default unless otherwise noted. +Using + rather than \- causes these options to be turned off. +The options can also be specified as arguments to an invocation of +the shell. +The current set of options may be found in +.BR $\- . +The return status is always true unless an invalid option is encountered. +.RE +.TP +\fBshift\fP [\fIn\fP] +The positional parameters from \fIn\fP+1 ... are renamed to +.B $1 +.B .... +Parameters represented by the numbers \fB$#\fP +down to \fB$#\fP\-\fIn\fP+1 are unset. +.I n +must be a non-negative number less than or equal to \fB$#\fP. +If +.I n +is 0, no parameters are changed. +If +.I n +is not given, it is assumed to be 1. +If +.I n +is greater than \fB$#\fP, the positional parameters are not changed. +The return status is greater than zero if +.I n +is greater than +.B $# +or less than zero; otherwise 0. +.TP +\fBshopt\fP [\fB\-pqsu\fP] [\fB\-o\fP] [\fIoptname\fP ...] +Toggle the values of settings controlling optional shell behavior. +The settings can be either those listed below, or, if the +.B \-o +option is used, those available with the +.B \-o +option to the \fBset\fP builtin command. +With no options, or with the +.B \-p +option, a list of all settable options is displayed, with +an indication of whether or not each is set. +The \fB\-p\fP option causes output to be displayed in a form that +may be reused as input. +Other options have the following meanings: +.RS +.PD 0 +.TP +.B \-s +Enable (set) each \fIoptname\fP. +.TP +.B \-u +Disable (unset) each \fIoptname\fP. +.TP +.B \-q +Suppresses normal output (quiet mode); the return status indicates +whether the \fIoptname\fP is set or unset. +If multiple \fIoptname\fP arguments are given with +.BR \-q , +the return status is zero if all \fIoptnames\fP are enabled; non-zero +otherwise. +.TP +.B \-o +Restricts the values of \fIoptname\fP to be those defined for the +.B \-o +option to the +.B set +builtin. +.PD +.PP +If either +.B \-s +or +.B \-u +is used with no \fIoptname\fP arguments, +.B shopt +shows only those options which are set or unset, respectively. +Unless otherwise noted, the \fBshopt\fP options are disabled (unset) +by default. +.PP +The return status when listing options is zero if all \fIoptnames\fP +are enabled, non-zero otherwise. When setting or unsetting options, +the return status is zero unless an \fIoptname\fP is not a valid shell +option. +.PP +The list of \fBshopt\fP options is: +.if t .sp .5v +.if n .sp 1v +.PD 0 +.TP 8 +.B autocd +If set, a command name that is the name of a directory is executed as if +it were the argument to the \fBcd\fP command. +This option is only used by interactive shells. +.TP 8 +.B cdable_vars +If set, an argument to the +.B cd +builtin command that +is not a directory is assumed to be the name of a variable whose +value is the directory to change to. +.TP 8 +.B cdspell +If set, minor errors in the spelling of a directory component in a +.B cd +command will be corrected. +The errors checked for are transposed characters, +a missing character, and one character too many. +If a correction is found, the corrected filename is printed, +and the command proceeds. +This option is only used by interactive shells. +.TP 8 +.B checkhash +If set, \fBbash\fP checks that a command found in the hash +table exists before trying to execute it. If a hashed command no +longer exists, a normal path search is performed. +.TP 8 +.B checkjobs +If set, \fBbash\fP lists the status of any stopped and running jobs before +exiting an interactive shell. If any jobs are running, this causes +the exit to be deferred until a second exit is attempted without an +intervening command (see +.SM +.B "JOB CONTROL" +above). The shell always +postpones exiting if any jobs are stopped. +.TP 8 +.B checkwinsize +If set, \fBbash\fP checks the window size after each command +and, if necessary, updates the values of +.SM +.B LINES +and +.SM +.BR COLUMNS . +.TP 8 +.B cmdhist +If set, +.B bash +attempts to save all lines of a multiple-line +command in the same history entry. This allows +easy re-editing of multi-line commands. +.TP 8 +.B compat31 +If set, +.B bash +changes its behavior to that of version 3.1 with respect to quoted +arguments to the \fB[[\fP conditional command's \fB=~\fP operator +and locale-specific string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators. +Bash versions prior to bash-4.1 use ASCII collation and +.IR strcmp (3); +bash-4.1 and later use the current locale's collation sequence and +.IR strcoll (3). +.TP 8 +.B compat32 +If set, +.B bash +changes its behavior to that of version 3.2 with respect to +locale-specific string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators (see previous item). +.TP 8 +.B compat40 +If set, +.B bash +changes its behavior to that of version 4.0 with respect to locale-specific +string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators (see description of +\fBcompat31\fP) +and the effect of interrupting a command list. +Bash versions 4.0 and later interrupt the list as if the shell received the +interrupt; previous versions continue with the next command in the list. +.TP 8 +.B compat41 +If set, +.BR bash , +when in \fIposix\fP mode, treats a single quote in a double-quoted +parameter expansion as a special character. The single quotes must match +(an even number) and the characters between the single quotes are considered +quoted. This is the behavior of posix mode through version 4.1. +The default bash behavior remains as in previous versions. +.TP 8 +.B compat42 +If set, +.B bash +does not process the replacement string in the pattern substitution word +expansion using quote removal. +.TP 8 +.B complete_fullquote +If set, +.B bash +quotes all shell metacharacters in filenames and directory names when +performing completion. +If not set, +.B bash +removes metacharacters such as the dollar sign from the set of +characters that will be quoted in completed filenames +when these metacharacters appear in shell variable references in words to be +completed. +This means that dollar signs in variable names that expand to directories +will not be quoted; +however, any dollar signs appearing in filenames will not be quoted, either. +This is active only when bash is using backslashes to quote completed +filenames. +This variable is set by default, which is the default bash behavior in +versions through 4.2. +.TP 8 +.B direxpand +If set, +.B bash +replaces directory names with the results of word expansion when performing +filename completion. This changes the contents of the readline editing +buffer. +If not set, +.B bash +attempts to preserve what the user typed. +.TP 8 +.B dirspell +If set, +.B bash +attempts spelling correction on directory names during word completion +if the directory name initially supplied does not exist. +.TP 8 +.B dotglob +If set, +.B bash +includes filenames beginning with a `.' in the results of pathname +expansion. +.TP 8 +.B execfail +If set, a non-interactive shell will not exit if +it cannot execute the file specified as an argument to the +.B exec +builtin command. An interactive shell does not exit if +.B exec +fails. +.TP 8 +.B expand_aliases +If set, aliases are expanded as described above under +.SM +.BR ALIASES . +This option is enabled by default for interactive shells. +.TP 8 +.B extdebug +If set, behavior intended for use by debuggers is enabled: +.RS +.TP +.B 1. +The \fB\-F\fP option to the \fBdeclare\fP builtin displays the source +file name and line number corresponding to each function name supplied +as an argument. +.TP +.B 2. +If the command run by the \fBDEBUG\fP trap returns a non-zero value, the +next command is skipped and not executed. +.TP +.B 3. +If the command run by the \fBDEBUG\fP trap returns a value of 2, and the +shell is executing in a subroutine (a shell function or a shell script +executed by the \fB.\fP or \fBsource\fP builtins), a call to +\fBreturn\fP is simulated. +.TP +.B 4. +.SM +.B BASH_ARGC +and +.SM +.B BASH_ARGV +are updated as described in their descriptions above. +.TP +.B 5. +Function tracing is enabled: command substitution, shell functions, and +subshells invoked with \fB(\fP \fIcommand\fP \fB)\fP inherit the +\fBDEBUG\fP and \fBRETURN\fP traps. +.TP +.B 6. +Error tracing is enabled: command substitution, shell functions, and +subshells invoked with \fB(\fP \fIcommand\fP \fB)\fP inherit the +\fBERR\fP trap. +.RE +.TP 8 +.B extglob +If set, the extended pattern matching features described above under +\fBPathname Expansion\fP are enabled. +.TP 8 +.B extquote +If set, \fB$\fP\(aq\fIstring\fP\(aq and \fB$\fP"\fIstring\fP" quoting is +performed within \fB${\fP\fIparameter\fP\fB}\fP expansions +enclosed in double quotes. This option is enabled by default. +.TP 8 +.B failglob +If set, patterns which fail to match filenames during pathname expansion +result in an expansion error. +.TP 8 +.B force_fignore +If set, the suffixes specified by the +.SM +.B FIGNORE +shell variable +cause words to be ignored when performing word completion even if +the ignored words are the only possible completions. +See +.SM +\fBSHELL VARIABLES\fP +above for a description of +.SM +.BR FIGNORE . +This option is enabled by default. +.TP 8 +.B globasciiranges +If set, range expressions used in pattern matching bracket expressions (see +.SM +.B Pattern Matching +above) behave as if in the traditional C locale when performing +comparisons. That is, the current locale's collating sequence +is not taken into account, so +.B b +will not collate between +.B A +and +.BR B , +and upper-case and lower-case ASCII characters will collate together. +.TP 8 +.B globstar +If set, the pattern \fB**\fP used in a pathname expansion context will +match all files and zero or more directories and subdirectories. +If the pattern is followed by a \fB/\fP, only directories and +subdirectories match. +.TP 8 +.B gnu_errfmt +If set, shell error messages are written in the standard GNU error +message format. +.TP 8 +.B histappend +If set, the history list is appended to the file named by the value +of the +.SM +.B HISTFILE +variable when the shell exits, rather than overwriting the file. +.TP 8 +.B histreedit +If set, and +.B readline +is being used, a user is given the opportunity to re-edit a +failed history substitution. +.TP 8 +.B histverify +If set, and +.B readline +is being used, the results of history substitution are not immediately +passed to the shell parser. Instead, the resulting line is loaded into +the \fBreadline\fP editing buffer, allowing further modification. +.TP 8 +.B hostcomplete +If set, and +.B readline +is being used, \fBbash\fP will attempt to perform hostname completion when a +word containing a \fB@\fP is being completed (see +.B Completing +under +.SM +.B READLINE +above). +This is enabled by default. +.TP 8 +.B huponexit +If set, \fBbash\fP will send +.SM +.B SIGHUP +to all jobs when an interactive login shell exits. +.TP 8 +.B interactive_comments +If set, allow a word beginning with +.B # +to cause that word and all remaining characters on that +line to be ignored in an interactive shell (see +.SM +.B COMMENTS +above). This option is enabled by default. +.TP 8 +.B lastpipe +If set, and job control is not active, the shell runs the last command of +a pipeline not executed in the background in the current shell environment. +.TP 8 +.B lithist +If set, and the +.B cmdhist +option is enabled, multi-line commands are saved to the history with +embedded newlines rather than using semicolon separators where possible. +.TP 8 +.B login_shell +The shell sets this option if it is started as a login shell (see +.SM +.B "INVOCATION" +above). +The value may not be changed. +.TP 8 +.B mailwarn +If set, and a file that \fBbash\fP is checking for mail has been +accessed since the last time it was checked, the message ``The mail in +\fImailfile\fP has been read'' is displayed. +.TP 8 +.B no_empty_cmd_completion +If set, and +.B readline +is being used, +.B bash +will not attempt to search the +.SM +.B PATH +for possible completions when +completion is attempted on an empty line. +.TP 8 +.B nocaseglob +If set, +.B bash +matches filenames in a case\-insensitive fashion when performing pathname +expansion (see +.B Pathname Expansion +above). +.TP 8 +.B nocasematch +If set, +.B bash +matches patterns in a case\-insensitive fashion when performing matching +while executing \fBcase\fP or \fB[[\fP conditional commands. +.TP 8 +.B nullglob +If set, +.B bash +allows patterns which match no +files (see +.B Pathname Expansion +above) +to expand to a null string, rather than themselves. +.TP 8 +.B progcomp +If set, the programmable completion facilities (see +\fBProgrammable Completion\fP above) are enabled. +This option is enabled by default. +.TP 8 +.B promptvars +If set, prompt strings undergo +parameter expansion, command substitution, arithmetic +expansion, and quote removal after being expanded as described in +.SM +.B PROMPTING +above. This option is enabled by default. +.TP 8 +.B restricted_shell +The shell sets this option if it is started in restricted mode (see +.SM +.B "RESTRICTED SHELL" +below). +The value may not be changed. +This is not reset when the startup files are executed, allowing +the startup files to discover whether or not a shell is restricted. +.TP 8 +.B shift_verbose +If set, the +.B shift +builtin prints an error message when the shift count exceeds the +number of positional parameters. +.TP 8 +.B sourcepath +If set, the +\fBsource\fP (\fB.\fP) builtin uses the value of +.SM +.B PATH +to find the directory containing the file supplied as an argument. +This option is enabled by default. +.TP 8 +.B xpg_echo +If set, the \fBecho\fP builtin expands backslash-escape sequences +by default. +.RE +.PD +.TP +\fBsuspend\fP [\fB\-f\fP] +Suspend the execution of this shell until it receives a +.SM +.B SIGCONT +signal. A login shell cannot be suspended; the +.B \-f +option can be used to override this and force the suspension. +The return status is 0 unless the shell is a login shell and +.B \-f +is not supplied, or if job control is not enabled. +.TP +\fBtest\fP \fIexpr\fP +.PD 0 +.TP +\fB[\fP \fIexpr\fP \fB]\fP +Return a status of 0 (true) or 1 (false) depending on +the evaluation of the conditional expression +.IR expr . +Each operator and operand must be a separate argument. +Expressions are composed of the primaries described above under +.SM +.BR "CONDITIONAL EXPRESSIONS" . +\fBtest\fP does not accept any options, nor does it accept and ignore +an argument of \fB\-\-\fP as signifying the end of options. +.if t .sp 0.5 +.if n .sp 1 +Expressions may be combined using the following operators, listed +in decreasing order of precedence. +The evaluation depends on the number of arguments; see below. +Operator precedence is used when there are five or more arguments. +.RS +.PD 0 +.TP +.B ! \fIexpr\fP +True if +.I expr +is false. +.TP +.B ( \fIexpr\fP ) +Returns the value of \fIexpr\fP. +This may be used to override the normal precedence of operators. +.TP +\fIexpr1\fP \-\fBa\fP \fIexpr2\fP +True if both +.I expr1 +and +.I expr2 +are true. +.TP +\fIexpr1\fP \-\fBo\fP \fIexpr2\fP +True if either +.I expr1 +or +.I expr2 +is true. +.PD +.PP +\fBtest\fP and \fB[\fP evaluate conditional +expressions using a set of rules based on the number of arguments. +.if t .sp 0.5 +.if n .sp 1 +.PD 0 +.TP +0 arguments +The expression is false. +.TP +1 argument +The expression is true if and only if the argument is not null. +.TP +2 arguments +If the first argument is \fB!\fP, the expression is true if and +only if the second argument is null. +If the first argument is one of the unary conditional operators listed above +under +.SM +.BR "CONDITIONAL EXPRESSIONS" , +the expression is true if the unary test is true. +If the first argument is not a valid unary conditional operator, the expression +is false. +.TP +3 arguments +The following conditions are applied in the order listed. +If the second argument is one of the binary conditional operators listed above +under +.SM +.BR "CONDITIONAL EXPRESSIONS" , +the result of the expression is the result of the binary test using +the first and third arguments as operands. +The \fB\-a\fP and \fB\-o\fP operators are considered binary operators +when there are three arguments. +If the first argument is \fB!\fP, the value is the negation of +the two-argument test using the second and third arguments. +If the first argument is exactly \fB(\fP and the third argument is +exactly \fB)\fP, the result is the one-argument test of the second +argument. +Otherwise, the expression is false. +.TP +4 arguments +If the first argument is \fB!\fP, the result is the negation of +the three-argument expression composed of the remaining arguments. +Otherwise, the expression is parsed and evaluated according to +precedence using the rules listed above. +.TP +5 or more arguments +The expression is parsed and evaluated according to precedence +using the rules listed above. +.if t .sp 0.5 +.if n .sp 1 +.LP +When used with \fBtest\fP or \fB[\fP, the \fB<\fP and \fB>\fP operators +sort lexicographically using ASCII ordering. +.RE +.PD +.TP +.B times +Print the accumulated user and system times for the shell and +for processes run from the shell. The return status is 0. +.TP +\fBtrap\fP [\fB\-lp\fP] [[\fIarg\fP] \fIsigspec\fP ...] +The command +.I arg +is to be read and executed when the shell receives +signal(s) +.IR sigspec . +If +.I arg +is absent (and there is a single \fIsigspec\fP) or +.BR \- , +each specified signal is +reset to its original disposition (the value it had +upon entrance to the shell). +If +.I arg +is the null string the signal specified by each +.I sigspec +is ignored by the shell and by the commands it invokes. +If +.I arg +is not present and +.B \-p +has been supplied, then the trap commands associated with each +.I sigspec +are displayed. +If no arguments are supplied or if only +.B \-p +is given, +.B trap +prints the list of commands associated with each signal. +The +.B \-l +option causes the shell to print a list of signal names and +their corresponding numbers. +Each +.I sigspec +is either +a signal name defined in <\fIsignal.h\fP>, or a signal number. +Signal names are case insensitive and the +.SM +.B SIG +prefix is optional. +.if t .sp 0.5 +.if n .sp 1 +If a +.I sigspec +is +.SM +.B EXIT +(0) the command +.I arg +is executed on exit from the shell. +If a +.I sigspec +is +.SM +.BR DEBUG , +the command +.I arg +is executed before every \fIsimple command\fP, \fIfor\fP command, +\fIcase\fP command, \fIselect\fP command, every arithmetic \fIfor\fP +command, and before the first command executes in a shell function (see +.SM +.B SHELL GRAMMAR +above). +Refer to the description of the \fBextdebug\fP option to the +\fBshopt\fP builtin for details of its effect on the \fBDEBUG\fP trap. +If a +.I sigspec +is +.SM +.BR RETURN , +the command +.I arg +is executed each time a shell function or a script executed with +the \fB.\fP or \fBsource\fP builtins finishes executing. +.if t .sp 0.5 +.if n .sp 1 +If a +.I sigspec +is +.SM +.BR ERR , +the command +.I arg +is executed whenever a +a pipeline (which may consist of a single simple +command), a list, or a compound command returns a +non\-zero exit status, +subject to the following conditions. +The +.SM +.B ERR +trap is not executed if the failed +command is part of the command list immediately following a +.B while +or +.B until +keyword, +part of the test in an +.I if +statement, part of a command executed in a +.B && +or +.B || +list except the command following the final \fB&&\fP or \fB||\fP, +any command in a pipeline but the last, +or if the command's return value is +being inverted using +.BR ! . +These are the same conditions obeyed by the \fBerrexit\fP (\fB\-e\fP) option. +.if t .sp 0.5 +.if n .sp 1 +Signals ignored upon entry to the shell cannot be trapped or reset. +Trapped signals that are not being ignored are reset to their original +values in a subshell or subshell environment when one is created. +The return status is false if any +.I sigspec +is invalid; otherwise +.B trap +returns true. +.TP +\fBtype\fP [\fB\-aftpP\fP] \fIname\fP [\fIname\fP ...] +With no options, +indicate how each +.I name +would be interpreted if used as a command name. +If the +.B \-t +option is used, +.B type +prints a string which is one of +.IR alias , +.IR keyword , +.IR function , +.IR builtin , +or +.I file +if +.I name +is an alias, shell reserved word, function, builtin, or disk file, +respectively. +If the +.I name +is not found, then nothing is printed, and an exit status of false +is returned. +If the +.B \-p +option is used, +.B type +either returns the name of the disk file +that would be executed if +.I name +were specified as a command name, +or nothing if +.if t \f(CWtype -t name\fP +.if n ``type -t name'' +would not return +.IR file . +The +.B \-P +option forces a +.SM +.B PATH +search for each \fIname\fP, even if +.if t \f(CWtype -t name\fP +.if n ``type -t name'' +would not return +.IR file . +If a command is hashed, +.B \-p +and +.B \-P +print the hashed value, which is not necessarily the file that appears +first in +.SM +.BR PATH . +If the +.B \-a +option is used, +.B type +prints all of the places that contain +an executable named +.IR name . +This includes aliases and functions, +if and only if the +.B \-p +option is not also used. +The table of hashed commands is not consulted +when using +.BR \-a . +The +.B \-f +option suppresses shell function lookup, as with the \fBcommand\fP builtin. +.B type +returns true if all of the arguments are found, false if +any are not found. +.TP +\fBulimit\fP [\fB\-HSTabcdefilmnpqrstuvx\fP [\fIlimit\fP]] +Provides control over the resources available to the shell and to +processes started by it, on systems that allow such control. +The \fB\-H\fP and \fB\-S\fP options specify that the hard or soft limit is +set for the given resource. +A hard limit cannot be increased by a non-root user once it is set; +a soft limit may be increased up to the value of the hard limit. +If neither \fB\-H\fP nor \fB\-S\fP is specified, both the soft and hard +limits are set. +The value of +.I limit +can be a number in the unit specified for the resource +or one of the special values +.BR hard , +.BR soft , +or +.BR unlimited , +which stand for the current hard limit, the current soft limit, and +no limit, respectively. +If +.I limit +is omitted, the current value of the soft limit of the resource is +printed, unless the \fB\-H\fP option is given. When more than one +resource is specified, the limit name and unit are printed before the value. +Other options are interpreted as follows: +.RS +.PD 0 +.TP +.B \-a +All current limits are reported +.TP +.B \-b +The maximum socket buffer size +.TP +.B \-c +The maximum size of core files created +.TP +.B \-d +The maximum size of a process's data segment +.TP +.B \-e +The maximum scheduling priority ("nice") +.TP +.B \-f +The maximum size of files written by the shell and its children +.TP +.B \-i +The maximum number of pending signals +.TP +.B \-l +The maximum size that may be locked into memory +.TP +.B \-m +The maximum resident set size (many systems do not honor this limit) +.TP +.B \-n +The maximum number of open file descriptors (most systems do not +allow this value to be set) +.TP +.B \-p +The pipe size in 512-byte blocks (this may not be set) +.TP +.B \-q +The maximum number of bytes in POSIX message queues +.TP +.B \-r +The maximum real-time scheduling priority +.TP +.B \-s +The maximum stack size +.TP +.B \-t +The maximum amount of cpu time in seconds +.TP +.B \-u +The maximum number of processes available to a single user +.TP +.B \-v +The maximum amount of virtual memory available to the shell and, on +some systems, to its children +.TP +.B \-x +The maximum number of file locks +.TP +.B \-T +The maximum number of threads +.PD +.PP +If +.I limit +is given, and the +.B \-a +option is not used, +\fIlimit\fP is the new value of the specified resource. +If no option is given, then +.B \-f +is assumed. Values are in 1024-byte increments, except for +.BR \-t , +which is in seconds; +.BR \-p , +which is in units of 512-byte blocks; +and +.BR \-T , +.BR \-b , +.BR \-n , +and +.BR \-u , +which are unscaled values. +The return status is 0 unless an invalid option or argument is supplied, +or an error occurs while setting a new limit. +.RE +.TP +\fBumask\fP [\fB\-p\fP] [\fB\-S\fP] [\fImode\fP] +The user file-creation mask is set to +.IR mode . +If +.I mode +begins with a digit, it +is interpreted as an octal number; otherwise +it is interpreted as a symbolic mode mask similar +to that accepted by +.IR chmod (1). +If +.I mode +is omitted, the current value of the mask is printed. +The +.B \-S +option causes the mask to be printed in symbolic form; the +default output is an octal number. +If the +.B \-p +option is supplied, and +.I mode +is omitted, the output is in a form that may be reused as input. +The return status is 0 if the mode was successfully changed or if +no \fImode\fP argument was supplied, and false otherwise. +.TP +\fBunalias\fP [\-\fBa\fP] [\fIname\fP ...] +Remove each \fIname\fP from the list of defined aliases. If +.B \-a +is supplied, all alias definitions are removed. The return +value is true unless a supplied +.I name +is not a defined alias. +.TP +\fBunset\fP [\-\fBfv\fP] [\-\fBn\fP] [\fIname\fP ...] +For each +.IR name , +remove the corresponding variable or function. +If the +.B \-v +option is given, each +.I name +refers to a shell variable, and that variable is removed. +Read-only variables may not be unset. +If +.B \-f +is specified, each +.I name +refers to a shell function, and the function definition +is removed. +If the +.B \-n +option is supplied, and \fIname\fP is a variable with the \fInameref\fP +attribute, \fIname\fP will be unset rather than the variable it +references. +\fB\-n\fP has no effect if the \fB\-f\fP option is supplied. +If no options are supplied, each \fIname\fP refers to a variable; if +there is no variable by that name, any function with that name is +unset. +Each unset variable or function is removed from the environment +passed to subsequent commands. +If any of +.SM +.BR COMP_WORDBREAKS , +.SM +.BR RANDOM , +.SM +.BR SECONDS , +.SM +.BR LINENO , +.SM +.BR HISTCMD , +.SM +.BR FUNCNAME , +.SM +.BR GROUPS , +or +.SM +.B DIRSTACK +are unset, they lose their special properties, even if they are +subsequently reset. The exit status is true unless a +.I name +is readonly. +.TP +\fBwait\fP [\fB\-n\fP] [\fIn ...\fP] +Wait for each specified child process and return its termination status. +Each +.I n +may be a process +ID or a job specification; if a job spec is given, all processes +in that job's pipeline are waited for. If +.I n +is not given, all currently active child processes +are waited for, and the return status is zero. +If the \fB\-n\fP option is supplied, \fBwait\fP waits for any job to +terminate and returns its exit status. +If +.I n +specifies a non-existent process or job, the return status is +127. Otherwise, the return status is the exit status of the last +process or job waited for. +.\" bash_builtins +.if \n(zZ=1 .ig zZ +.SH "RESTRICTED SHELL" +.\" rbash.1 +.zY +.PP +If +.B bash +is started with the name +.BR rbash , +or the +.B \-r +option is supplied at invocation, +the shell becomes restricted. +A restricted shell is used to +set up an environment more controlled than the standard shell. +It behaves identically to +.B bash +with the exception that the following are disallowed or not performed: +.IP \(bu +changing directories with \fBcd\fP +.IP \(bu +setting or unsetting the values of +.SM +.BR SHELL , +.SM +.BR PATH , +.SM +.BR ENV , +or +.SM +.B BASH_ENV +.IP \(bu +specifying command names containing +.B / +.IP \(bu +specifying a filename containing a +.B / +as an argument to the +.B . +builtin command +.IP \(bu +specifying a filename containing a slash as an argument to the +.B \-p +option to the +.B hash +builtin command +.IP \(bu +importing function definitions from the shell environment at startup +.IP \(bu +parsing the value of +.SM +.B SHELLOPTS +from the shell environment at startup +.IP \(bu +redirecting output using the >, >|, <>, >&, &>, and >> redirection operators +.IP \(bu +using the +.B exec +builtin command to replace the shell with another command +.IP \(bu +adding or deleting builtin commands with the +.B \-f +and +.B \-d +options to the +.B enable +builtin command +.IP \(bu +using the \fBenable\fP builtin command to enable disabled shell builtins +.IP \(bu +specifying the +.B \-p +option to the +.B command +builtin command +.IP \(bu +turning off restricted mode with +\fBset +r\fP or \fBset +o restricted\fP. +.PP +These restrictions are enforced after any startup files are read. +.PP +.ie \n(zY=1 When a command that is found to be a shell script is executed, +.el \{ When a command that is found to be a shell script is executed +(see +.SM +.B "COMMAND EXECUTION" +above), +\} +.B rbash +turns off any restrictions in the shell spawned to execute the +script. +.\" end of rbash.1 +.if \n(zY=1 .ig zY +.SH "SEE ALSO" +.PD 0 +.TP +\fIBash Reference Manual\fP, Brian Fox and Chet Ramey +.TP +\fIThe Gnu Readline Library\fP, Brian Fox and Chet Ramey +.TP +\fIThe Gnu History Library\fP, Brian Fox and Chet Ramey +.TP +\fIPortable Operating System Interface (POSIX) Part 2: Shell and Utilities\fP, IEEE -- +http://pubs.opengroup.org/onlinepubs/9699919799/ +.TP +http://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode +.TP +\fIsh\fP(1), \fIksh\fP(1), \fIcsh\fP(1) +.TP +\fIemacs\fP(1), \fIvi\fP(1) +.TP +\fIreadline\fP(3) +.PD +.SH FILES +.PD 0 +.TP +.FN /bin/bash +The \fBbash\fP executable +.TP +.FN /etc/profile +The systemwide initialization file, executed for login shells +.TP +.FN ~/.bash_profile +The personal initialization file, executed for login shells +.TP +.FN ~/.bashrc +The individual per-interactive-shell startup file +.TP +.FN ~/.bash_logout +The individual login shell cleanup file, executed when a login shell exits +.TP +.FN ~/.inputrc +Individual \fIreadline\fP initialization file +.PD +.SH AUTHORS +Brian Fox, Free Software Foundation +.br +bfox@gnu.org +.PP +Chet Ramey, Case Western Reserve University +.br +chet.ramey@case.edu +.SH BUG REPORTS +If you find a bug in +.B bash, +you should report it. But first, you should +make sure that it really is a bug, and that it appears in the latest +version of +.BR bash . +The latest version is always available from +\fIftp://ftp.gnu.org/pub/gnu/bash/\fP. +.PP +Once you have determined that a bug actually exists, use the +.I bashbug +command to submit a bug report. +If you have a fix, you are encouraged to mail that as well! +Suggestions and `philosophical' bug reports may be mailed +to \fIbug-bash@gnu.org\fP or posted to the Usenet +newsgroup +.BR gnu.bash.bug . +.PP +ALL bug reports should include: +.PP +.PD 0 +.TP 20 +The version number of \fBbash\fR +.TP +The hardware and operating system +.TP +The compiler used to compile +.TP +A description of the bug behaviour +.TP +A short script or `recipe' which exercises the bug +.PD +.PP +.I bashbug +inserts the first three items automatically into the template +it provides for filing a bug report. +.PP +Comments and bug reports concerning +this manual page should be directed to +.IR chet.ramey@case.edu . +.SH BUGS +.PP +It's too big and too slow. +.PP +There are some subtle differences between +.B bash +and traditional versions of +.BR sh , +mostly because of the +.SM +.B POSIX +specification. +.PP +Aliases are confusing in some uses. +.PP +Shell builtin commands and functions are not stoppable/restartable. +.PP +Compound commands and command sequences of the form `a ; b ; c' +are not handled gracefully when process suspension is attempted. +When a process is stopped, the shell immediately executes the next +command in the sequence. +It suffices to place the sequence of commands between +parentheses to force it into a subshell, which may be stopped as +a unit. +.PP +Array variables may not (yet) be exported. +.PP +There may be only one active coprocess at a time. +.zZ +.zY diff --git a/.pc/man-fignore.diff/doc/bash.1 b/.pc/man-fignore.diff/doc/bash.1 new file mode 100644 index 0000000..bcdb957 --- /dev/null +++ b/.pc/man-fignore.diff/doc/bash.1 @@ -0,0 +1,10334 @@ +.\" +.\" MAN PAGE COMMENTS to +.\" +.\" Chet Ramey +.\" Case Western Reserve University +.\" chet.ramey@case.edu +.\" +.\" Last Change: Sun Feb 2 16:21:40 EST 2014 +.\" +.\" bash_builtins, strip all but Built-Ins section +.if \n(zZ=1 .ig zZ +.if \n(zY=1 .ig zY +.TH BASH 1 "2014 February 2" "GNU Bash 4.3" +.\" +.\" There's some problem with having a `@' +.\" in a tagged paragraph with the BSD man macros. +.\" It has to do with `@' appearing in the }1 macro. +.\" This is a problem on 4.3 BSD and Ultrix, but Sun +.\" appears to have fixed it. +.\" If you're seeing the characters +.\" `@u-3p' appearing before the lines reading +.\" `possible-hostname-completions +.\" and `complete-hostname' down in READLINE, +.\" then uncomment this redefinition. +.\" +.de }1 +.ds ]X \&\\*(]B\\ +.nr )E 0 +.if !"\\$1"" .nr )I \\$1n +.}f +.ll \\n(LLu +.in \\n()Ru+\\n(INu+\\n()Iu +.ti \\n(INu +.ie !\\n()Iu+\\n()Ru-\w\\*(]Xu-3p \{\\*(]X +.br\} +.el \\*(]X\h|\\n()Iu+\\n()Ru\c +.}f +.. +.\" +.\" File Name macro. This used to be `.PN', for Path Name, +.\" but Sun doesn't seem to like that very much. +.\" +.de FN +\fI\|\\$1\|\fP +.. +.SH NAME +bash \- GNU Bourne-Again SHell +.SH SYNOPSIS +.B bash +[options] +[command_string | file] +.SH COPYRIGHT +.if n Bash is Copyright (C) 1989-2013 by the Free Software Foundation, Inc. +.if t Bash is Copyright \(co 1989-2013 by the Free Software Foundation, Inc. +.SH DESCRIPTION +.B Bash +is an \fBsh\fR-compatible command language interpreter that +executes commands read from the standard input or from a file. +.B Bash +also incorporates useful features from the \fIKorn\fP and \fIC\fP +shells (\fBksh\fP and \fBcsh\fP). +.PP +.B Bash +is intended to be a conformant implementation of the +Shell and Utilities portion of the IEEE POSIX specification +(IEEE Standard 1003.1). +.B Bash +can be configured to be POSIX-conformant by default. +.SH OPTIONS +All of the single-character shell options documented in the +description of the \fBset\fR builtin command can be used as options +when the shell is invoked. +In addition, \fBbash\fR +interprets the following options when it is invoked: +.PP +.PD 0 +.TP 10 +.B \-c +If the +.B \-c +option is present, then commands are read from the first non-option argument +.IR command_string . +If there are arguments after the +.IR command_string , +they are assigned to the positional parameters, starting with +.BR $0 . +.TP +.B \-i +If the +.B \-i +option is present, the shell is +.IR interactive . +.TP +.B \-l +Make +.B bash +act as if it had been invoked as a login shell (see +.SM +.B INVOCATION +below). +.TP +.B \-r +If the +.B \-r +option is present, the shell becomes +.I restricted +(see +.SM +.B "RESTRICTED SHELL" +below). +.TP +.B \-s +If the +.B \-s +option is present, or if no arguments remain after option +processing, then commands are read from the standard input. +This option allows the positional parameters to be set +when invoking an interactive shell. +.TP +.B \-D +A list of all double-quoted strings preceded by \fB$\fP +is printed on the standard output. +These are the strings that +are subject to language translation when the current locale +is not \fBC\fP or \fBPOSIX\fP. +This implies the \fB\-n\fP option; no commands will be executed. +.TP +.B [\-+]O [\fIshopt_option\fP] +\fIshopt_option\fP is one of the shell options accepted by the +\fBshopt\fP builtin (see +.SM +.B SHELL BUILTIN COMMANDS +below). +If \fIshopt_option\fP is present, \fB\-O\fP sets the value of that option; +\fB+O\fP unsets it. +If \fIshopt_option\fP is not supplied, the names and values of the shell +options accepted by \fBshopt\fP are printed on the standard output. +If the invocation option is \fB+O\fP, the output is displayed in a format +that may be reused as input. +.TP +.B \-\- +A +.B \-\- +signals the end of options and disables further option processing. +Any arguments after the +.B \-\- +are treated as filenames and arguments. An argument of +.B \- +is equivalent to \fB\-\-\fP. +.PD +.PP +.B Bash +also interprets a number of multi-character options. +These options must appear on the command line before the +single-character options to be recognized. +.PP +.PD 0 +.TP +.B \-\-debugger +Arrange for the debugger profile to be executed before the shell +starts. +Turns on extended debugging mode (see the description of the +.B extdebug +option to the +.B shopt +builtin below). +.TP +.B \-\-dump\-po\-strings +Equivalent to \fB\-D\fP, but the output is in the GNU \fIgettext\fP +\fBpo\fP (portable object) file format. +.TP +.B \-\-dump\-strings +Equivalent to \fB\-D\fP. +.TP +.B \-\-help +Display a usage message on standard output and exit successfully. +.TP +\fB\-\-init\-file\fP \fIfile\fP +.PD 0 +.TP +\fB\-\-rcfile\fP \fIfile\fP +.PD +Execute commands from +.I file +instead of the standard personal initialization file +.I ~/.bashrc +if the shell is interactive (see +.SM +.B INVOCATION +below). +.TP +.B \-\-login +Equivalent to \fB\-l\fP. +.TP +.B \-\-noediting +Do not use the GNU +.B readline +library to read command lines when the shell is interactive. +.TP +.B \-\-noprofile +Do not read either the system-wide startup file +.FN /etc/profile +or any of the personal initialization files +.IR ~/.bash_profile , +.IR ~/.bash_login , +or +.IR ~/.profile . +By default, +.B bash +reads these files when it is invoked as a login shell (see +.SM +.B INVOCATION +below). +.TP +.B \-\-norc +Do not read and execute the personal initialization file +.I ~/.bashrc +if the shell is interactive. +This option is on by default if the shell is invoked as +.BR sh . +.TP +.B \-\-posix +Change the behavior of \fBbash\fP where the default operation differs +from the POSIX standard to match the standard (\fIposix mode\fP). +See +.SM +.B "SEE ALSO" +below for a reference to a document that details how posix mode affects +bash's behavior. +.TP +.B \-\-restricted +The shell becomes restricted (see +.SM +.B "RESTRICTED SHELL" +below). +.TP +.B \-\-verbose +Equivalent to \fB\-v\fP. +.TP +.B \-\-version +Show version information for this instance of +.B bash +on the standard output and exit successfully. +.PD +.SH ARGUMENTS +If arguments remain after option processing, and neither the +.B \-c +nor the +.B \-s +option has been supplied, the first argument is assumed to +be the name of a file containing shell commands. +If +.B bash +is invoked in this fashion, +.B $0 +is set to the name of the file, and the positional parameters +are set to the remaining arguments. +.B Bash +reads and executes commands from this file, then exits. +\fBBash\fP's exit status is the exit status of the last command +executed in the script. +If no commands are executed, the exit status is 0. +An attempt is first made to open the file in the current directory, and, +if no file is found, then the shell searches the directories in +.SM +.B PATH +for the script. +.SH INVOCATION +A \fIlogin shell\fP is one whose first character of argument zero is a +.BR \- , +or one started with the +.B \-\-login +option. +.PP +An \fIinteractive\fP shell is one started without non-option arguments +and without the +.B \-c +option +whose standard input and error are +both connected to terminals (as determined by +.IR isatty (3)), +or one started with the +.B \-i +option. +.SM +.B PS1 +is set and +.B $\- +includes +.B i +if +.B bash +is interactive, +allowing a shell script or a startup file to test this state. +.PP +The following paragraphs describe how +.B bash +executes its startup files. +If any of the files exist but cannot be read, +.B bash +reports an error. +Tildes are expanded in filenames as described below under +.B "Tilde Expansion" +in the +.SM +.B EXPANSION +section. +.PP +When +.B bash +is invoked as an interactive login shell, or as a non-interactive shell +with the \fB\-\-login\fP option, it first reads and +executes commands from the file \fI/etc/profile\fP, if that +file exists. +After reading that file, it looks for \fI~/.bash_profile\fP, +\fI~/.bash_login\fP, and \fI~/.profile\fP, in that order, and reads +and executes commands from the first one that exists and is readable. +The +.B \-\-noprofile +option may be used when the shell is started to inhibit this behavior. +.PP +When a login shell exits, +.B bash +reads and executes commands from the file \fI~/.bash_logout\fP, if it +exists. +.PP +When an interactive shell that is not a login shell is started, +.B bash +reads and executes commands from \fI~/.bashrc\fP, if that file exists. +This may be inhibited by using the +.B \-\-norc +option. +The \fB\-\-rcfile\fP \fIfile\fP option will force +.B bash +to read and execute commands from \fIfile\fP instead of \fI~/.bashrc\fP. +.PP +When +.B bash +is started non-interactively, to run a shell script, for example, it +looks for the variable +.SM +.B BASH_ENV +in the environment, expands its value if it appears there, and uses the +expanded value as the name of a file to read and execute. +.B Bash +behaves as if the following command were executed: +.sp .5 +.RS +.if t \f(CWif [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi\fP +.if n if [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi +.RE +.sp .5 +but the value of the +.SM +.B PATH +variable is not used to search for the filename. +.PP +If +.B bash +is invoked with the name +.BR sh , +it tries to mimic the startup behavior of historical versions of +.B sh +as closely as possible, +while conforming to the POSIX standard as well. +When invoked as an interactive login shell, or a non-interactive +shell with the \fB\-\-login\fP option, it first attempts to +read and execute commands from +.I /etc/profile +and +.IR ~/.profile , +in that order. +The +.B \-\-noprofile +option may be used to inhibit this behavior. +When invoked as an interactive shell with the name +.BR sh , +.B bash +looks for the variable +.SM +.BR ENV , +expands its value if it is defined, and uses the +expanded value as the name of a file to read and execute. +Since a shell invoked as +.B sh +does not attempt to read and execute commands from any other startup +files, the +.B \-\-rcfile +option has no effect. +A non-interactive shell invoked with the name +.B sh +does not attempt to read any other startup files. +When invoked as +.BR sh , +.B bash +enters +.I posix +mode after the startup files are read. +.PP +When +.B bash +is started in +.I posix +mode, as with the +.B \-\-posix +command line option, it follows the POSIX standard for startup files. +In this mode, interactive shells expand the +.SM +.B ENV +variable and commands are read and executed from the file +whose name is the expanded value. +No other startup files are read. +.PP +.B Bash +attempts to determine when it is being run with its standard input +connected to a network connection, as when executed by the remote shell +daemon, usually \fIrshd\fP, or the secure shell daemon \fIsshd\fP. +If +.B bash +determines it is being run in this fashion, it reads and executes +commands from \fI~/.bashrc\fP, if that file exists and is readable. +It will not do this if invoked as \fBsh\fP. +The +.B \-\-norc +option may be used to inhibit this behavior, and the +.B \-\-rcfile +option may be used to force another file to be read, but neither +\fIrshd\fP nor \fIsshd\fP generally invoke the shell with those options +or allow them to be specified. +.PP +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the \fB\-p\fP option is not supplied, no startup +files are read, shell functions are not inherited from the environment, the +.SM +.BR SHELLOPTS , +.SM +.BR BASHOPTS , +.SM +.BR CDPATH , +and +.SM +.B GLOBIGNORE +variables, if they appear in the environment, are ignored, +and the effective user id is set to the real user id. +If the \fB\-p\fP option is supplied at invocation, the startup behavior is +the same, but the effective user id is not reset. +.SH DEFINITIONS +.PP +The following definitions are used throughout the rest of this +document. +.PD 0 +.TP +.B blank +A space or tab. +.TP +.B word +A sequence of characters considered as a single unit by the shell. +Also known as a +.BR token . +.TP +.B name +A +.I word +consisting only of alphanumeric characters and underscores, and +beginning with an alphabetic character or an underscore. Also +referred to as an +.BR identifier . +.TP +.B metacharacter +A character that, when unquoted, separates words. One of the following: +.br +.RS +.PP +.if t \fB| & ; ( ) < > space tab\fP +.if n \fB| & ; ( ) < > space tab\fP +.RE +.PP +.TP +.B control operator +A \fItoken\fP that performs a control function. It is one of the following +symbols: +.RS +.PP +.if t \fB|| & && ; ;; ( ) | |& \fP +.if n \fB|| & && ; ;; ( ) | |& \fP +.RE +.PD +.SH "RESERVED WORDS" +\fIReserved words\fP are words that have a special meaning to the shell. +The following words are recognized as reserved when unquoted and either +the first word of a simple command (see +.SM +.B SHELL GRAMMAR +below) or the third word of a +.B case +or +.B for +command: +.if t .RS +.PP +.B +.if n ! case coproc do done elif else esac fi for function if in select then until while { } time [[ ]] +.if t ! case coproc do done elif else esac fi for function if in select then until while { } time [[ ]] +.if t .RE +.SH "SHELL GRAMMAR" +.SS Simple Commands +.PP +A \fIsimple command\fP is a sequence of optional variable assignments +followed by \fBblank\fP-separated words and redirections, and +terminated by a \fIcontrol operator\fP. The first word +specifies the command to be executed, and is passed as argument zero. +The remaining words are passed as arguments to the invoked command. +.PP +The return value of a \fIsimple command\fP is its exit status, or +128+\fIn\^\fP if the command is terminated by signal +.IR n . +.SS Pipelines +.PP +A \fIpipeline\fP is a sequence of one or more commands separated by +one of the control operators +.B | +or \fB|&\fP. +The format for a pipeline is: +.RS +.PP +[\fBtime\fP [\fB\-p\fP]] [ ! ] \fIcommand\fP [ [\fB|\fP\(bv\fB|&\fP] \fIcommand2\fP ... ] +.RE +.PP +The standard output of +.I command +is connected via a pipe to the standard input of +.IR command2 . +This connection is performed before any redirections specified by the +command (see +.SM +.B REDIRECTION +below). +If \fB|&\fP is used, \fIcommand\fP's standard error, in addition to its +standard output, is connected to +\fIcommand2\fP's standard input through the pipe; +it is shorthand for \fB2>&1 |\fP. +This implicit redirection of the standard error to the standard output is +performed after any redirections specified by the command. +.PP +The return status of a pipeline is the exit status of the last +command, unless the \fBpipefail\fP option is enabled. +If \fBpipefail\fP is enabled, the pipeline's return status is the +value of the last (rightmost) command to exit with a non-zero status, +or zero if all commands exit successfully. +If the reserved word +.B ! +precedes a pipeline, the exit status of that pipeline is the logical +negation of the exit status as described above. +The shell waits for all commands in the pipeline to +terminate before returning a value. +.PP +If the +.B time +reserved word precedes a pipeline, the elapsed as well as user and +system time consumed by its execution are reported when the pipeline +terminates. +The \fB\-p\fP option changes the output format to that specified by POSIX. +When the shell is in \fIposix mode\fP, it does not recognize +\fBtime\fP as a reserved word if the next token begins with a `-'. +The +.SM +.B TIMEFORMAT +variable may be set to a format string that specifies how the timing +information should be displayed; see the description of +.SM +.B TIMEFORMAT +under +.B "Shell Variables" +below. +.PP +When the shell is in \fIposix mode\fP, \fBtime\fP +may be followed by a newline. In this case, the shell displays the +total user and system time consumed by the shell and its children. +The +.SM +.B TIMEFORMAT +variable may be used to specify the format of +the time information. +.PP +Each command in a pipeline is executed as a separate process (i.e., in a +subshell). +.SS Lists +.PP +A \fIlist\fP is a sequence of one or more pipelines separated by one +of the operators +.BR ; , +.BR & , +.BR && , +or +.BR || , +and optionally terminated by one of +.BR ; , +.BR & , +or +.BR . +.PP +Of these list operators, +.B && +and +.B || +have equal precedence, followed by +.B ; +and +.BR & , +which have equal precedence. +.PP +A sequence of one or more newlines may appear in a \fIlist\fP instead +of a semicolon to delimit commands. +.PP +If a command is terminated by the control operator +.BR & , +the shell executes the command in the \fIbackground\fP +in a subshell. The shell does not wait for the command to +finish, and the return status is 0. Commands separated by a +.B ; +are executed sequentially; the shell waits for each +command to terminate in turn. The return status is the +exit status of the last command executed. +.PP +AND and OR lists are sequences of one of more pipelines separated by the +\fB&&\fP and \fB||\fP control operators, respectively. +AND and OR lists are executed with left associativity. +An AND list has the form +.RS +.PP +\fIcommand1\fP \fB&&\fP \fIcommand2\fP +.RE +.PP +.I command2 +is executed if, and only if, +.I command1 +returns an exit status of zero. +.PP +An OR list has the form +.RS +.PP +\fIcommand1\fP \fB||\fP \fIcommand2\fP +.PP +.RE +.PP +.I command2 +is executed if and only if +.I command1 +returns a non-zero exit status. +The return status of +AND and OR lists is the exit status of the last command +executed in the list. +.SS Compound Commands +.PP +A \fIcompound command\fP is one of the following. +In most cases a \fIlist\fP in a command's description may be separated from +the rest of the command by one or more newlines, and may be followed by a +newline in place of a semicolon. +.TP +(\fIlist\fP) +\fIlist\fP is executed in a subshell environment (see +.SM +\fBCOMMAND EXECUTION ENVIRONMENT\fP +below). +Variable assignments and builtin +commands that affect the shell's environment do not remain in effect +after the command completes. The return status is the exit status of +\fIlist\fP. +.TP +{ \fIlist\fP; } +\fIlist\fP is simply executed in the current shell environment. +\fIlist\fP must be terminated with a newline or semicolon. +This is known as a \fIgroup command\fP. +The return status is the exit status of +\fIlist\fP. +Note that unlike the metacharacters \fB(\fP and \fB)\fP, \fB{\fP and +\fB}\fP are \fIreserved words\fP and must occur where a reserved +word is permitted to be recognized. Since they do not cause a word +break, they must be separated from \fIlist\fP by whitespace or another +shell metacharacter. +.TP +((\fIexpression\fP)) +The \fIexpression\fP is evaluated according to the rules described +below under +.SM +.BR "ARITHMETIC EVALUATION" . +If the value of the expression is non-zero, the return status is 0; +otherwise the return status is 1. This is exactly equivalent to +\fBlet "\fIexpression\fP"\fR. +.TP +\fB[[\fP \fIexpression\fP \fB]]\fP +Return a status of 0 or 1 depending on the evaluation of +the conditional expression \fIexpression\fP. +Expressions are composed of the primaries described below under +.SM +.BR "CONDITIONAL EXPRESSIONS" . +Word splitting and pathname expansion are not performed on the words +between the \fB[[\fP and \fB]]\fP; tilde expansion, +parameter and variable expansion, +arithmetic expansion, command substitution, process +substitution, and quote removal are performed. +Conditional operators such as \fB\-f\fP must be unquoted to be recognized +as primaries. +.if t .sp 0.5 +.if n .sp 1 +When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort +lexicographically using the current locale. +.if t .sp 0.5 +.if n .sp 1 +When the \fB==\fP and \fB!=\fP operators are used, the string to the +right of the operator is considered a pattern and matched according +to the rules described below under \fBPattern Matching\fP, +as if the \fBextglob\fP shell option were enabled. +The \fB=\fP operator is equivalent to \fB==\fP. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +The return value is 0 if the string matches (\fB==\fP) or does not match +(\fB!=\fP) the pattern, and 1 otherwise. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +.if t .sp 0.5 +.if n .sp 1 +An additional binary operator, \fB=~\fP, is available, with the same +precedence as \fB==\fP and \fB!=\fP. +When it is used, the string to the right of the operator is considered +an extended regular expression and matched accordingly (as in \fIregex\fP(3)). +The return value is 0 if the string matches +the pattern, and 1 otherwise. +If the regular expression is syntactically incorrect, the conditional +expression's return value is 2. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +Bracket expressions in regular expressions must be treated carefully, +since normal quoting characters lose their meanings between brackets. +If the pattern is stored in a shell variable, quoting the variable +expansion forces the entire pattern to be matched as a string. +Substrings matched by parenthesized subexpressions within the regular +expression are saved in the array variable +.SM +.BR BASH_REMATCH . +The element of +.SM +.B BASH_REMATCH +with index 0 is the portion of the string +matching the entire regular expression. +The element of +.SM +.B BASH_REMATCH +with index \fIn\fP is the portion of the +string matching the \fIn\fPth parenthesized subexpression. +.if t .sp 0.5 +.if n .sp 1 +Expressions may be combined using the following operators, listed +in decreasing order of precedence: +.if t .sp 0.5 +.if n .sp 1 +.RS +.PD 0 +.TP +.B ( \fIexpression\fP ) +Returns the value of \fIexpression\fP. +This may be used to override the normal precedence of operators. +.TP +.B ! \fIexpression\fP +True if +.I expression +is false. +.TP +\fIexpression1\fP \fB&&\fP \fIexpression2\fP +True if both +.I expression1 +and +.I expression2 +are true. +.TP +\fIexpression1\fP \fB||\fP \fIexpression2\fP +True if either +.I expression1 +or +.I expression2 +is true. +.PD +.LP +The \fB&&\fP and \fB||\fP +operators do not evaluate \fIexpression2\fP if the value of +\fIexpression1\fP is sufficient to determine the return value of +the entire conditional expression. +.RE +.TP +\fBfor\fP \fIname\fP [ [ \fBin\fP [ \fIword ...\fP ] ] ; ] \fBdo\fP \fIlist\fP ; \fBdone\fP +The list of words following \fBin\fP is expanded, generating a list +of items. +The variable \fIname\fP is set to each element of this list +in turn, and \fIlist\fP is executed each time. +If the \fBin\fP \fIword\fP is omitted, the \fBfor\fP command executes +\fIlist\fP once for each positional parameter that is set (see +.SM +.B PARAMETERS +below). +The return status is the exit status of the last command that executes. +If the expansion of the items following \fBin\fP results in an empty +list, no commands are executed, and the return status is 0. +.TP +\fBfor\fP (( \fIexpr1\fP ; \fIexpr2\fP ; \fIexpr3\fP )) ; \fBdo\fP \fIlist\fP ; \fBdone\fP +First, the arithmetic expression \fIexpr1\fP is evaluated according +to the rules described below under +.SM +.BR "ARITHMETIC EVALUATION" . +The arithmetic expression \fIexpr2\fP is then evaluated repeatedly +until it evaluates to zero. +Each time \fIexpr2\fP evaluates to a non-zero value, \fIlist\fP is +executed and the arithmetic expression \fIexpr3\fP is evaluated. +If any expression is omitted, it behaves as if it evaluates to 1. +The return value is the exit status of the last command in \fIlist\fP +that is executed, or false if any of the expressions is invalid. +.TP +\fBselect\fP \fIname\fP [ \fBin\fP \fIword\fP ] ; \fBdo\fP \fIlist\fP ; \fBdone\fP +The list of words following \fBin\fP is expanded, generating a list +of items. The set of expanded words is printed on the standard +error, each preceded by a number. If the \fBin\fP +\fIword\fP is omitted, the positional parameters are printed (see +.SM +.B PARAMETERS +below). The +.SM +.B PS3 +prompt is then displayed and a line read from the standard input. +If the line consists of a number corresponding to one of +the displayed words, then the value of +.I name +is set to that word. If the line is empty, the words and prompt +are displayed again. If EOF is read, the command completes. Any +other value read causes +.I name +to be set to null. The line read is saved in the variable +.SM +.BR REPLY . +The +.I list +is executed after each selection until a +.B break +command is executed. +The exit status of +.B select +is the exit status of the last command executed in +.IR list , +or zero if no commands were executed. +.TP +\fBcase\fP \fIword\fP \fBin\fP [ [(] \fIpattern\fP [ \fB|\fP \fIpattern\fP ] \ +... ) \fIlist\fP ;; ] ... \fBesac\fP +A \fBcase\fP command first expands \fIword\fP, and tries to match +it against each \fIpattern\fP in turn, using the same matching rules +as for pathname expansion (see +.B Pathname Expansion +below). +The \fIword\fP is expanded using tilde +expansion, parameter and variable expansion, arithmetic substitution, +command substitution, process substitution and quote removal. +Each \fIpattern\fP examined is expanded using tilde +expansion, parameter and variable expansion, arithmetic substitution, +command substitution, and process substitution. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +When a match is found, the corresponding \fIlist\fP is executed. +If the \fB;;\fP operator is used, no subsequent matches are attempted after +the first pattern match. +Using \fB;&\fP in place of \fB;;\fP causes execution to continue with +the \fIlist\fP associated with the next set of patterns. +Using \fB;;&\fP in place of \fB;;\fP causes the shell to test the next +pattern list in the statement, if any, and execute any associated \fIlist\fP +on a successful match. +The exit status is zero if no +pattern matches. Otherwise, it is the exit status of the +last command executed in \fIlist\fP. +.TP +\fBif\fP \fIlist\fP; \fBthen\fP \fIlist\fP; \ +[ \fBelif\fP \fIlist\fP; \fBthen\fP \fIlist\fP; ] ... \ +[ \fBelse\fP \fIlist\fP; ] \fBfi\fP +The +.B if +.I list +is executed. If its exit status is zero, the +\fBthen\fP \fIlist\fP is executed. Otherwise, each \fBelif\fP +\fIlist\fP is executed in turn, and if its exit status is zero, +the corresponding \fBthen\fP \fIlist\fP is executed and the +command completes. Otherwise, the \fBelse\fP \fIlist\fP is +executed, if present. The exit status is the exit status of the +last command executed, or zero if no condition tested true. +.TP +\fBwhile\fP \fIlist-1\fP; \fBdo\fP \fIlist-2\fP; \fBdone\fP +.PD 0 +.TP +\fBuntil\fP \fIlist-1\fP; \fBdo\fP \fIlist-2\fP; \fBdone\fP +.PD +The \fBwhile\fP command continuously executes the list +\fIlist-2\fP as long as the last command in the list \fIlist-1\fP returns +an exit status of zero. The \fBuntil\fP command is identical +to the \fBwhile\fP command, except that the test is negated; +.I list-2 +is executed as long as the last command in +.I list-1 +returns a non-zero exit status. +The exit status of the \fBwhile\fP and \fBuntil\fP commands +is the exit status +of the last command executed in \fIlist-2\fP, or zero if +none was executed. +.SS Coprocesses +.PP +A \fIcoprocess\fP is a shell command preceded by the \fBcoproc\fP reserved +word. +A coprocess is executed asynchronously in a subshell, as if the command +had been terminated with the \fB&\fP control operator, with a two-way pipe +established between the executing shell and the coprocess. +.PP +The format for a coprocess is: +.RS +.PP +\fBcoproc\fP [\fINAME\fP] \fIcommand\fP [\fIredirections\fP] +.RE +.PP +This creates a coprocess named \fINAME\fP. +If \fINAME\fP is not supplied, the default name is \fBCOPROC\fP. +\fINAME\fP must not be supplied if \fIcommand\fP is a \fIsimple +command\fP (see above); otherwise, it is interpreted as the first word +of the simple command. +When the coprocess is executed, the shell creates an array variable (see +.B Arrays +below) named \fINAME\fP in the context of the executing shell. +The standard output of +.I command +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to \fINAME\fP[0]. +The standard input of +.I command +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to \fINAME\fP[1]. +This pipe is established before any redirections specified by the +command (see +.SM +.B REDIRECTION +below). +The file descriptors can be utilized as arguments to shell commands +and redirections using standard word expansions. +The file descriptors are not available in subshells. +The process ID of the shell spawned to execute the coprocess is +available as the value of the variable \fINAME\fP_PID. +The \fBwait\fP +builtin command may be used to wait for the coprocess to terminate. +.PP +Since the coprocess is created as an asynchronous command, +the \fBcoproc\fP command always returns success. +The return status of a coprocess is the exit status of \fIcommand\fP. +.SS Shell Function Definitions +.PP +A shell function is an object that is called like a simple command and +executes a compound command with a new set of positional parameters. +Shell functions are declared as follows: +.TP +\fIname\fP () \fIcompound\-command\fP [\fIredirection\fP] +.PD 0 +.TP +\fBfunction\fP \fIname\fP [()] \fIcompound\-command\fP [\fIredirection\fP] +.PD +This defines a function named \fIname\fP. +The reserved word \fBfunction\fP is optional. +If the \fBfunction\fP reserved word is supplied, the parentheses are optional. +The \fIbody\fP of the function is the compound command +.I compound\-command +(see \fBCompound Commands\fP above). +That command is usually a \fIlist\fP of commands between { and }, but +may be any command listed under \fBCompound Commands\fP above. +\fIcompound\-command\fP is executed whenever \fIname\fP is specified as the +name of a simple command. +When in \fIposix mode\fP, \fIname\fP may not be the name of one of the +POSIX \fIspecial builtins\fP. +Any redirections (see +.SM +.B REDIRECTION +below) specified when a function is defined are performed +when the function is executed. +The exit status of a function definition is zero unless a syntax error +occurs or a readonly function with the same name already exists. +When executed, the exit status of a function is the exit status of the +last command executed in the body. (See +.SM +.B FUNCTIONS +below.) +.SH COMMENTS +In a non-interactive shell, or an interactive shell in which the +.B interactive_comments +option to the +.B shopt +builtin is enabled (see +.SM +.B "SHELL BUILTIN COMMANDS" +below), a word beginning with +.B # +causes that word and all remaining characters on that line to +be ignored. An interactive shell without the +.B interactive_comments +option enabled does not allow comments. The +.B interactive_comments +option is on by default in interactive shells. +.SH QUOTING +\fIQuoting\fP is used to remove the special meaning of certain +characters or words to the shell. Quoting can be used to +disable special treatment for special characters, to prevent +reserved words from being recognized as such, and to prevent +parameter expansion. +.PP +Each of the \fImetacharacters\fP listed above under +.SM +.B DEFINITIONS +has special meaning to the shell and must be quoted if it is to +represent itself. +.PP +When the command history expansion facilities are being used +(see +.SM +.B HISTORY EXPANSION +below), the +\fIhistory expansion\fP character, usually \fB!\fP, must be quoted +to prevent history expansion. +.PP +There are three quoting mechanisms: the +.IR "escape character" , +single quotes, and double quotes. +.PP +A non-quoted backslash (\fB\e\fP) is the +.IR "escape character" . +It preserves the literal value of the next character that follows, +with the exception of . If a \fB\e\fP pair +appears, and the backslash is not itself quoted, the \fB\e\fP +is treated as a line continuation (that is, it is removed from the +input stream and effectively ignored). +.PP +Enclosing characters in single quotes preserves the literal value +of each character within the quotes. A single quote may not occur +between single quotes, even when preceded by a backslash. +.PP +Enclosing characters in double quotes preserves the literal value +of all characters within the quotes, with the exception of +.BR $ , +.BR \` , +.BR \e , +and, when history expansion is enabled, +.BR ! . +The characters +.B $ +and +.B \` +retain their special meaning within double quotes. The backslash +retains its special meaning only when followed by one of the following +characters: +.BR $ , +.BR \` , +\^\fB"\fP\^, +.BR \e , +or +.BR . +A double quote may be quoted within double quotes by preceding it with +a backslash. +If enabled, history expansion will be performed unless an +.B ! +appearing in double quotes is escaped using a backslash. +The backslash preceding the +.B ! +is not removed. +.PP +The special parameters +.B * +and +.B @ +have special meaning when in double +quotes (see +.SM +.B PARAMETERS +below). +.PP +Words of the form \fB$\fP\(aq\fIstring\fP\(aq are treated specially. The +word expands to \fIstring\fP, with backslash-escaped characters replaced +as specified by the ANSI C standard. Backslash escape sequences, if +present, are decoded as follows: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ee +.TP +.B \eE +an escape character +.TP +.B \ef +form feed +.TP +.B \en +new line +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\e +backslash +.TP +.B \e\(aq +single quote +.TP +.B \e\(dq +double quote +.TP +.B \e\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(one to three digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.TP +.B \eu\fIHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHH\fP (one to four hex digits) +.TP +.B \eU\fIHHHHHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHHHHHH\fP (one to eight hex digits) +.TP +.B \ec\fIx\fP +a control-\fIx\fP character +.PD +.RE +.LP +The expanded result is single-quoted, as if the dollar sign had +not been present. +.PP +A double-quoted string preceded by a dollar sign (\fB$\fP\(dq\fIstring\fP\(dq) +will cause the string to be translated according to the current locale. +If the current locale is \fBC\fP or \fBPOSIX\fP, the dollar sign +is ignored. +If the string is translated and replaced, the replacement is +double-quoted. +.SH PARAMETERS +A +.I parameter +is an entity that stores values. +It can be a +.IR name , +a number, or one of the special characters listed below under +.BR "Special Parameters" . +A +.I variable +is a parameter denoted by a +.IR name . +A variable has a \fIvalue\fP and zero or more \fIattributes\fP. +Attributes are assigned using the +.B declare +builtin command (see +.B declare +below in +.SM +.BR "SHELL BUILTIN COMMANDS" ). +.PP +A parameter is set if it has been assigned a value. The null string is +a valid value. Once a variable is set, it may be unset only by using +the +.B unset +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.PP +A +.I variable +may be assigned to by a statement of the form +.RS +.PP +\fIname\fP=[\fIvalue\fP] +.RE +.PP +If +.I value +is not given, the variable is assigned the null string. All +.I values +undergo tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote +removal (see +.SM +.B EXPANSION +below). If the variable has its +.B integer +attribute set, then +.I value +is evaluated as an arithmetic expression even if the $((...)) expansion is +not used (see +.B "Arithmetic Expansion" +below). +Word splitting is not performed, with the exception +of \fB"$@"\fP as explained below under +.BR "Special Parameters" . +Pathname expansion is not performed. +Assignment statements may also appear as arguments to the +.BR alias , +.BR declare , +.BR typeset , +.BR export , +.BR readonly , +and +.B local +builtin commands. +When in \fIposix mode\fP, these builtins may appear in a command after +one or more instances of the \fBcommand\fP builtin and retain these +assignment statement properties. +.PP +In the context where an assignment statement is assigning a value +to a shell variable or array index, the += operator can be used to +append to or add to the variable's previous value. +When += is applied to a variable for which the \fIinteger\fP attribute has been +set, \fIvalue\fP is evaluated as an arithmetic expression and added to the +variable's current value, which is also evaluated. +When += is applied to an array variable using compound assignment (see +.B Arrays +below), the +variable's value is not unset (as it is when using =), and new values are +appended to the array beginning at one greater than the array's maximum index +(for indexed arrays) or added as additional key\-value pairs in an +associative array. +When applied to a string-valued variable, \fIvalue\fP is expanded and +appended to the variable's value. +.PP +A variable can be assigned the \fInameref\fP attribute using the +\fB\-n\fP option to the \fBdeclare\fP or \fBlocal\fP builtin commands +(see the descriptions of \fBdeclare\fP and \fBlocal\fP below) +to create a \fInameref\fP, or a reference to another variable. +This allows variables to be manipulated indirectly. +Whenever the nameref variable is referenced or assigned to, the operation +is actually performed on the variable specified by the nameref variable's +value. +A nameref is commonly used within shell functions to refer to a variable +whose name is passed as an argument to the function. +For instance, if a variable name is passed to a shell function as its first +argument, running +.sp .5 +.RS +.if t \f(CWdeclare -n ref=$1\fP +.if n declare -n ref=$1 +.RE +.sp .5 +inside the function creates a nameref variable \fBref\fP whose value is +the variable name passed as the first argument. +References and assignments to \fBref\fP are treated as references and +assignments to the variable whose name was passed as \fB$1\fP. +If the control variable in a \fBfor\fP loop has the nameref attribute, +the list of words can be a list of shell variables, and a name reference +will be established for each word in the list, in turn, when the loop is +executed. +Array variables cannot be given the \fB\-n\fP attribute. +However, nameref variables can reference array variables and subscripted +array variables. +Namerefs can be unset using the \fB\-n\fP option to the \fBunset\fP builtin. +Otherwise, if \fBunset\fP is executed with the name of a nameref variable +as an argument, the variable referenced by the nameref variable will be unset. +.SS Positional Parameters +.PP +A +.I positional parameter +is a parameter denoted by one or more +digits, other than the single digit 0. Positional parameters are +assigned from the shell's arguments when it is invoked, +and may be reassigned using the +.B set +builtin command. Positional parameters may not be assigned to +with assignment statements. The positional parameters are +temporarily replaced when a shell function is executed (see +.SM +.B FUNCTIONS +below). +.PP +When a positional parameter consisting of more than a single +digit is expanded, it must be enclosed in braces (see +.SM +.B EXPANSION +below). +.SS Special Parameters +.PP +The shell treats several parameters specially. These parameters may +only be referenced; assignment to them is not allowed. +.PD 0 +.TP +.B * +Expands to the positional parameters, starting from one. +When the expansion is not within double quotes, each positional parameter +expands to a separate word. +In contexts where it is performed, those words +are subject to further word splitting and pathname expansion. +When the expansion occurs within double quotes, it expands to a single word +with the value of each parameter separated by the first character +of the +.SM +.B IFS +special variable. That is, "\fB$*\fP" is equivalent +to "\fB$1\fP\fIc\fP\fB$2\fP\fIc\fP\fB...\fP", where +.I c +is the first character of the value of the +.SM +.B IFS +variable. If +.SM +.B IFS +is unset, the parameters are separated by spaces. +If +.SM +.B IFS +is null, the parameters are joined without intervening separators. +.TP +.B @ +Expands to the positional parameters, starting from one. When the +expansion occurs within double quotes, each parameter expands to a +separate word. That is, "\fB$@\fP" is equivalent to +"\fB$1\fP" "\fB$2\fP" ... +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +When there are no positional parameters, "\fB$@\fP" and +.B $@ +expand to nothing (i.e., they are removed). +.TP +.B # +Expands to the number of positional parameters in decimal. +.TP +.B ? +Expands to the exit status of the most recently executed foreground +pipeline. +.TP +.B \- +Expands to the current option flags as specified upon invocation, +by the +.B set +builtin command, or those set by the shell itself +(such as the +.B \-i +option). +.TP +.B $ +Expands to the process ID of the shell. In a () subshell, it +expands to the process ID of the current shell, not the +subshell. +.TP +.B ! +Expands to the process ID of the job most recently placed into the +background, whether executed as an asynchronous command or using +the \fBbg\fP builtin (see +.SM +.B "JOB CONTROL" +below). +.TP +.B 0 +Expands to the name of the shell or shell script. This is set at +shell initialization. If +.B bash +is invoked with a file of commands, +.B $0 +is set to the name of that file. If +.B bash +is started with the +.B \-c +option, then +.B $0 +is set to the first argument after the string to be +executed, if one is present. Otherwise, it is set +to the filename used to invoke +.BR bash , +as given by argument zero. +.TP +.B _ +At shell startup, set to the absolute pathname used to invoke the +shell or shell script being executed as passed in the environment +or argument list. +Subsequently, expands to the last argument to the previous command, +after expansion. +Also set to the full pathname used to invoke each command executed +and placed in the environment exported to that command. +When checking mail, this parameter holds the name of the mail file +currently being checked. +.PD +.SS Shell Variables +.PP +The following variables are set by the shell: +.PP +.PD 0 +.TP +.B BASH +Expands to the full filename used to invoke this instance of +.BR bash . +.TP +.B BASHOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +.B \-s +option to the +.B shopt +builtin command (see +.SM +.B "SHELL BUILTIN COMMANDS" +below). The options appearing in +.SM +.B BASHOPTS +are those reported as +.I on +by \fBshopt\fP. +If this variable is in the environment when +.B bash +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +.TP +.B BASHPID +Expands to the process ID of the current \fBbash\fP process. +This differs from \fB$$\fP under certain circumstances, such as subshells +that do not require \fBbash\fP to be re-initialized. +.TP +.B BASH_ALIASES +An associative array variable whose members correspond to the internal +list of aliases as maintained by the \fBalias\fP builtin. +Elements added to this array appear in the alias list; unsetting array +elements cause aliases to be removed from the alias list. +.TP +.B BASH_ARGC +An array variable whose values are the number of parameters in each +frame of the current \fBbash\fP execution call stack. +The number of +parameters to the current subroutine (shell function or script executed +with \fB.\fP or \fBsource\fP) is at the top of the stack. +When a subroutine is executed, the number of parameters passed is pushed onto +.SM +.BR BASH_ARGC . +The shell sets +.SM +.B BASH_ARGC +only when in extended debugging mode (see the description of the +.B extdebug +option to the +.B shopt +builtin below) +.TP +.B BASH_ARGV +An array variable containing all of the parameters in the current \fBbash\fP +execution call stack. The final parameter of the last subroutine call +is at the top of the stack; the first parameter of the initial call is +at the bottom. When a subroutine is executed, the parameters supplied +are pushed onto +.SM +.BR BASH_ARGV . +The shell sets +.SM +.B BASH_ARGV +only when in extended debugging mode +(see the description of the +.B extdebug +option to the +.B shopt +builtin below) +.TP +.B BASH_CMDS +An associative array variable whose members correspond to the internal +hash table of commands as maintained by the \fBhash\fP builtin. +Elements added to this array appear in the hash table; unsetting array +elements cause commands to be removed from the hash table. +.TP +.B BASH_COMMAND +The command currently being executed or about to be executed, unless the +shell is executing a command as the result of a trap, +in which case it is the command executing at the time of the trap. +.TP +.B BASH_EXECUTION_STRING +The command argument to the \fB\-c\fP invocation option. +.TP +.B BASH_LINENO +An array variable whose members are the line numbers in source files +where each corresponding member of +.SM +.B FUNCNAME +was invoked. +\fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP is the line number in the source +file (\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP) where +\fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP was called +(or \fB${BASH_LINENO[\fP\fI$i-1\fP\fB]}\fP if referenced within another +shell function). +Use +.SM +.B LINENO +to obtain the current line number. +.TP +.B BASH_REMATCH +An array variable whose members are assigned by the \fB=~\fP binary +operator to the \fB[[\fP conditional command. +The element with index 0 is the portion of the string +matching the entire regular expression. +The element with index \fIn\fP is the portion of the +string matching the \fIn\fPth parenthesized subexpression. +This variable is read-only. +.TP +.B BASH_SOURCE +An array variable whose members are the source filenames +where the corresponding shell function names in the +.SM +.B FUNCNAME +array variable are defined. +The shell function +\fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP is defined in the file +\fB${BASH_SOURCE[\fP\fI$i\fP\fB]}\fP and called from +\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP. +.TP +.B BASH_SUBSHELL +Incremented by one within each subshell or subshell environment when +the shell begins executing in that environment. +The initial value is 0. +.TP +.B BASH_VERSINFO +A readonly array variable whose members hold version information for +this instance of +.BR bash . +The values assigned to the array members are as follows: +.sp .5 +.RS +.TP 24 +.B BASH_VERSINFO[\fR0\fP] +The major version number (the \fIrelease\fP). +.TP +.B BASH_VERSINFO[\fR1\fP] +The minor version number (the \fIversion\fP). +.TP +.B BASH_VERSINFO[\fR2\fP] +The patch level. +.TP +.B BASH_VERSINFO[\fR3\fP] +The build version. +.TP +.B BASH_VERSINFO[\fR4\fP] +The release status (e.g., \fIbeta1\fP). +.TP +.B BASH_VERSINFO[\fR5\fP] +The value of +.SM +.BR MACHTYPE . +.RE +.TP +.B BASH_VERSION +Expands to a string describing the version of this instance of +.BR bash . +.TP +.B COMP_CWORD +An index into \fB${COMP_WORDS}\fP of the word containing the current +cursor position. +This variable is available only in shell functions invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_KEY +The key (or final key of a key sequence) used to invoke the current +completion function. +.TP +.B COMP_LINE +The current command line. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_POINT +The index of the current cursor position relative to the beginning of +the current command. +If the current cursor position is at the end of the current command, +the value of this variable is equal to \fB${#COMP_LINE}\fP. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_TYPE +Set to an integer value corresponding to the type of completion attempted +that caused a completion function to be called: +\fITAB\fP, for normal completion, +\fI?\fP, for listing completions after successive tabs, +\fI!\fP, for listing alternatives on partial word completion, +\fI@\fP, to list completions if the word is not unmodified, +or +\fI%\fP, for menu completion. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_WORDBREAKS +The set of characters that the \fBreadline\fP library treats as word +separators when performing word completion. +If +.SM +.B COMP_WORDBREAKS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B COMP_WORDS +An array variable (see \fBArrays\fP below) consisting of the individual +words in the current command line. +The line is split into words as \fBreadline\fP would split it, using +.SM +.B COMP_WORDBREAKS +as described above. +This variable is available only in shell functions invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COPROC +An array variable (see \fBArrays\fP below) created to hold the file descriptors +for output from and input to an unnamed coprocess (see \fBCoprocesses\fP +above). +.TP +.B DIRSTACK +An array variable (see +.B Arrays +below) containing the current contents of the directory stack. +Directories appear in the stack in the order they are displayed by the +.B dirs +builtin. +Assigning to members of this array variable may be used to modify +directories already in the stack, but the +.B pushd +and +.B popd +builtins must be used to add and remove directories. +Assignment to this variable will not change the current directory. +If +.SM +.B DIRSTACK +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B EUID +Expands to the effective user ID of the current user, initialized at +shell startup. This variable is readonly. +.TP +.B FUNCNAME +An array variable containing the names of all shell functions +currently in the execution call stack. +The element with index 0 is the name of any currently-executing +shell function. +The bottom-most element (the one with the highest index) is +.if t \f(CW"main"\fP. +.if n "main". +This variable exists only when a shell function is executing. +Assignments to +.SM +.B FUNCNAME +have no effect and return an error status. +If +.SM +.B FUNCNAME +is unset, it loses its special properties, even if it is +subsequently reset. +.if t .sp 0.5 +.if n .sp 1 +This variable can be used with \fBBASH_LINENO\fP and \fBBASH_SOURCE\fP. +Each element of \fBFUNCNAME\fP has corresponding elements in +\fBBASH_LINENO\fP and \fBBASH_SOURCE\fP to describe the call stack. +For instance, \fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP was called from the file +\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP at line number +\fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP. +The \fBcaller\fP builtin displays the current call stack using this +information. +.TP +.B GROUPS +An array variable containing the list of groups of which the current +user is a member. +Assignments to +.SM +.B GROUPS +have no effect and return an error status. +If +.SM +.B GROUPS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B HISTCMD +The history number, or index in the history list, of the current +command. +If +.SM +.B HISTCMD +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B HOSTNAME +Automatically set to the name of the current host. +.TP +.B HOSTTYPE +Automatically set to a string that uniquely +describes the type of machine on which +.B bash +is executing. +The default is system-dependent. +.TP +.B LINENO +Each time this parameter is referenced, the shell substitutes +a decimal number representing the current sequential line number +(starting with 1) within a script or function. When not in a +script or function, the value substituted is not guaranteed to +be meaningful. +If +.SM +.B LINENO +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B MACHTYPE +Automatically set to a string that fully describes the system +type on which +.B bash +is executing, in the standard GNU \fIcpu-company-system\fP format. +The default is system-dependent. +.TP +.B MAPFILE +An array variable (see \fBArrays\fP below) created to hold the text +read by the \fBmapfile\fP builtin when no variable name is supplied. +.TP +.B OLDPWD +The previous working directory as set by the +.B cd +command. +.TP +.B OPTARG +The value of the last option argument processed by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.TP +.B OPTIND +The index of the next argument to be processed by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.TP +.B OSTYPE +Automatically set to a string that +describes the operating system on which +.B bash +is executing. +The default is system-dependent. +.TP +.B PIPESTATUS +An array variable (see +.B Arrays +below) containing a list of exit status values from the processes +in the most-recently-executed foreground pipeline (which may +contain only a single command). +.TP +.B PPID +The process ID of the shell's parent. This variable is readonly. +.TP +.B PWD +The current working directory as set by the +.B cd +command. +.TP +.B RANDOM +Each time this parameter is referenced, a random integer between +0 and 32767 is +generated. The sequence of random numbers may be initialized by assigning +a value to +.SM +.BR RANDOM . +If +.SM +.B RANDOM +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B READLINE_LINE +The contents of the +.B readline +line buffer, for use with +.if t \f(CWbind -x\fP +.if n "bind -x" +(see +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.TP +.B READLINE_POINT +The position of the insertion point in the +.B readline +line buffer, for use with +.if t \f(CWbind -x\fP +.if n "bind -x" +(see +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.TP +.B REPLY +Set to the line of input read by the +.B read +builtin command when no arguments are supplied. +.TP +.B SECONDS +Each time this parameter is +referenced, the number of seconds since shell invocation is returned. If a +value is assigned to +.SM +.BR SECONDS , +the value returned upon subsequent +references is +the number of seconds since the assignment plus the value assigned. +If +.SM +.B SECONDS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B SHELLOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +.B \-o +option to the +.B set +builtin command (see +.SM +.B "SHELL BUILTIN COMMANDS" +below). The options appearing in +.SM +.B SHELLOPTS +are those reported as +.I on +by \fBset \-o\fP. +If this variable is in the environment when +.B bash +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +.TP +.B SHLVL +Incremented by one each time an instance of +.B bash +is started. +.TP +.B UID +Expands to the user ID of the current user, initialized at shell startup. +This variable is readonly. +.PD +.PP +The following variables are used by the shell. In some cases, +.B bash +assigns a default value to a variable; these cases are noted +below. +.PP +.PD 0 +.TP +.B BASH_COMPAT +The value is used to set the shell's compatibility level. +See the description of the \fBshopt\fP builtin below under +\fBSHELL BUILTIN COMMANDS\fP +for a description of the various compatibility +levels and their effects. +The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42) +corresponding to the desired compatibility level. +If \fBBASH_COMPAT\fP is unset or set to the empty string, the compatibility +level is set to the default for the current version. +If \fBBASH_COMPAT\fP is set to a value that is not one of the valid +compatibility levels, the shell prints an error message and sets the +compatibility level to the default for the current version. +The valid compatibility levels correspond to the compatibility options +accepted by the \fBshopt\fP builtin described below (for example, +\fBcompat42\fP means that 4.2 and 42 are valid values). +The current version is also a valid value. +.TP +.B BASH_ENV +If this parameter is set when \fBbash\fP is executing a shell script, +its value is interpreted as a filename containing commands to +initialize the shell, as in +.IR ~/.bashrc . +The value of +.SM +.B BASH_ENV +is subjected to parameter expansion, command substitution, and arithmetic +expansion before being interpreted as a filename. +.SM +.B PATH +is not used to search for the resultant filename. +.TP +.B BASH_XTRACEFD +If set to an integer corresponding to a valid file descriptor, \fBbash\fP +will write the trace output generated when +.if t \f(CWset -x\fP +.if n \fIset -x\fP +is enabled to that file descriptor. +The file descriptor is closed when +.SM +.B BASH_XTRACEFD +is unset or assigned a new value. +Unsetting +.SM +.B BASH_XTRACEFD +or assigning it the empty string causes the +trace output to be sent to the standard error. +Note that setting +.SM +.B BASH_XTRACEFD +to 2 (the standard error file +descriptor) and then unsetting it will result in the standard error +being closed. +.TP +.B CDPATH +The search path for the +.B cd +command. +This is a colon-separated list of directories in which the shell looks +for destination directories specified by the +.B cd +command. +A sample value is +.if t \f(CW".:~:/usr"\fP. +.if n ".:~:/usr". +.TP +.B CHILD_MAX +Set the number of exited child status values for the shell to remember. +Bash will not allow this value to be decreased below a POSIX-mandated +minimum, and there is a maximum value (currently 8192) that this may +not exceed. +The minimum value is system-dependent. +.TP +.B COLUMNS +Used by the \fBselect\fP compound command to determine the terminal width +when printing selection lists. +Automatically set if the +.B checkwinsize +option is enabled or in an interactive shell upon receipt of a +.SM +.BR SIGWINCH . +.TP +.B COMPREPLY +An array variable from which \fBbash\fP reads the possible completions +generated by a shell function invoked by the programmable completion +facility (see \fBProgrammable Completion\fP below). +Each array element contains one possible completion. +.TP +.B EMACS +If \fBbash\fP finds this variable in the environment when the shell starts +with value +.if t \f(CWt\fP, +.if n "t", +it assumes that the shell is running in an Emacs shell buffer and disables +line editing. +.TP +.B ENV +Similar to +.SM +.BR BASH_ENV ; +used when the shell is invoked in POSIX mode. +.TP +.B FCEDIT +The default editor for the +.B fc +builtin command. +.TP +.B FIGNORE +A colon-separated list of suffixes to ignore when performing +filename completion (see +.SM +.B READLINE +below). +A filename whose suffix matches one of the entries in +.SM +.B FIGNORE +is excluded from the list of matched filenames. +A sample value is +.if t \f(CW".o:~"\fP. +.if n ".o:~". +.TP +.B FUNCNEST +If set to a numeric value greater than 0, defines a maximum function +nesting level. Function invocations that exceed this nesting level +will cause the current command to abort. +.TP +.B GLOBIGNORE +A colon-separated list of patterns defining the set of filenames to +be ignored by pathname expansion. +If a filename matched by a pathname expansion pattern also matches one +of the patterns in +.SM +.BR GLOBIGNORE , +it is removed from the list of matches. +.TP +.B HISTCONTROL +A colon-separated list of values controlling how commands are saved on +the history list. +If the list of values includes +.IR ignorespace , +lines which begin with a +.B space +character are not saved in the history list. +A value of +.I ignoredups +causes lines matching the previous history entry to not be saved. +A value of +.I ignoreboth +is shorthand for \fIignorespace\fP and \fIignoredups\fP. +A value of +.IR erasedups +causes all previous lines matching the current line to be removed from +the history list before that line is saved. +Any value not in the above list is ignored. +If +.SM +.B HISTCONTROL +is unset, or does not include a valid value, +all lines read by the shell parser are saved on the history list, +subject to the value of +.SM +.BR HISTIGNORE . +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +.SM +.BR HISTCONTROL . +.TP +.B HISTFILE +The name of the file in which command history is saved (see +.SM +.B HISTORY +below). The default value is \fI~/.bash_history\fP. If unset, the +command history is not saved when a shell exits. +.TP +.B HISTFILESIZE +The maximum number of lines contained in the history file. When this +variable is assigned a value, the history file is truncated, if +necessary, +to contain no more than that number of lines by removing the oldest entries. +The history file is also truncated to this size after +writing it when a shell exits. +If the value is 0, the history file is truncated to zero size. +Non-numeric values and numeric values less than zero inhibit truncation. +The shell sets the default value to the value of \fBHISTSIZE\fP +after reading any startup files. +.TP +.B HISTIGNORE +A colon-separated list of patterns used to decide which command lines +should be saved on the history list. Each pattern is anchored at the +beginning of the line and must match the complete line (no implicit +`\fB*\fP' is appended). Each pattern is tested against the line +after the checks specified by +.SM +.B HISTCONTROL +are applied. +In addition to the normal shell pattern matching characters, `\fB&\fP' +matches the previous history line. `\fB&\fP' may be escaped using a +backslash; the backslash is removed before attempting a match. +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +.SM +.BR HISTIGNORE . +.TP +.B HISTSIZE +The number of commands to remember in the command history (see +.SM +.B HISTORY +below). +If the value is 0, commands are not saved in the history list. +Numeric values less than zero result in every command being saved +on the history list (there is no limit). +The shell sets the default value to 500 after reading any startup files. +.TP +.B HISTTIMEFORMAT +If this variable is set and not null, its value is used as a format string +for \fIstrftime\fP(3) to print the time stamp associated with each history +entry displayed by the \fBhistory\fP builtin. +If this variable is set, time stamps are written to the history file so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +.TP +.B HOME +The home directory of the current user; the default argument for the +\fBcd\fP builtin command. +The value of this variable is also used when performing tilde expansion. +.TP +.B HOSTFILE +Contains the name of a file in the same format as +.FN /etc/hosts +that should be read when the shell needs to complete a +hostname. +The list of possible hostname completions may be changed while the +shell is running; +the next time hostname completion is attempted after the +value is changed, +.B bash +adds the contents of the new file to the existing list. +If +.SM +.B HOSTFILE +is set, but has no value, or does not name a readable file, +\fBbash\fP attempts to read +.FN /etc/hosts +to obtain the list of possible hostname completions. +When +.SM +.B HOSTFILE +is unset, the hostname list is cleared. +.TP +.B IFS +The +.I Internal Field Separator +that is used +for word splitting after expansion and to +split lines into words with the +.B read +builtin command. The default value is +``''. +.TP +.B IGNOREEOF +Controls the +action of an interactive shell on receipt of an +.SM +.B EOF +character as the sole input. If set, the value is the number of +consecutive +.SM +.B EOF +characters which must be +typed as the first characters on an input line before +.B bash +exits. If the variable exists but does not have a numeric value, or +has no value, the default value is 10. If it does not exist, +.SM +.B EOF +signifies the end of input to the shell. +.TP +.B INPUTRC +The filename for the +.B readline +startup file, overriding the default of +.FN ~/.inputrc +(see +.SM +.B READLINE +below). +.TP +.B LANG +Used to determine the locale category for any category not specifically +selected with a variable starting with \fBLC_\fP. +.TP +.B LC_ALL +This variable overrides the value of +.SM +.B LANG +and any other +\fBLC_\fP variable specifying a locale category. +.TP +.B LC_COLLATE +This variable determines the collation order used when sorting the +results of pathname expansion, and determines the behavior of range +expressions, equivalence classes, and collating sequences within +pathname expansion and pattern matching. +.TP +.B LC_CTYPE +This variable determines the interpretation of characters and the +behavior of character classes within pathname expansion and pattern +matching. +.TP +.B LC_MESSAGES +This variable determines the locale used to translate double-quoted +strings preceded by a \fB$\fP. +.TP +.B LC_NUMERIC +This variable determines the locale category used for number formatting. +.TP +.B LINES +Used by the \fBselect\fP compound command to determine the column length +for printing selection lists. +Automatically set if the +.B checkwinsize +option is enabled or in an interactive shell upon receipt of a +.SM +.BR SIGWINCH . +.TP +.B MAIL +If this parameter is set to a file or directory name and the +.SM +.B MAILPATH +variable is not set, +.B bash +informs the user of the arrival of mail in the specified file or +Maildir-format directory. +.TP +.B MAILCHECK +Specifies how +often (in seconds) +.B bash +checks for mail. The default is 60 seconds. When it is time to check +for mail, the shell does so before displaying the primary prompt. +If this variable is unset, or set to a value that is not a number +greater than or equal to zero, the shell disables mail checking. +.TP +.B MAILPATH +A colon-separated list of filenames to be checked for mail. +The message to be printed when mail arrives in a particular file +may be specified by separating the filename from the message with a `?'. +When used in the text of the message, \fB$_\fP expands to the name of +the current mailfile. +Example: +.RS +.PP +\fBMAILPATH\fP=\(aq/var/mail/bfox?"You have mail":~/shell\-mail?"$_ has mail!"\(aq +.PP +.B Bash +supplies a default value for this variable, but the location of the user +mail files that it uses is system dependent (e.g., /var/mail/\fB$USER\fP). +.RE +.TP +.B OPTERR +If set to the value 1, +.B bash +displays error messages generated by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SM +.B OPTERR +is initialized to 1 each time the shell is invoked or a shell +script is executed. +.TP +.B PATH +The search path for commands. It +is a colon-separated list of directories in which +the shell looks for commands (see +.SM +.B COMMAND EXECUTION +below). +A zero-length (null) directory name in the value of +.SM +.B PATH +indicates the current directory. +A null directory name may appear as two adjacent colons, or as an initial +or trailing colon. +The default path is system-dependent, +and is set by the administrator who installs +.BR bash . +A common value is +.if t \f(CW/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin\fP. +.if n ``/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin''. +.TP +.B POSIXLY_CORRECT +If this variable is in the environment when \fBbash\fP starts, the shell +enters \fIposix mode\fP before reading the startup files, as if the +.B \-\-posix +invocation option had been supplied. If it is set while the shell is +running, \fBbash\fP enables \fIposix mode\fP, as if the command +.if t \f(CWset -o posix\fP +.if n \fIset -o posix\fP +had been executed. +.TP +.B PROMPT_COMMAND +If set, the value is executed as a command prior to issuing each primary +prompt. +.TP +.B PROMPT_DIRTRIM +If set to a number greater than zero, the value is used as the number of +trailing directory components to retain when expanding the \fB\ew\fP and +\fB\eW\fP prompt string escapes (see +.SM +.B PROMPTING +below). Characters removed are replaced with an ellipsis. +.TP +.B PS1 +The value of this parameter is expanded (see +.SM +.B PROMPTING +below) and used as the primary prompt string. The default value is +``\fB\es\-\ev\e$ \fP''. +.TP +.B PS2 +The value of this parameter is expanded as with +.SM +.B PS1 +and used as the secondary prompt string. The default is +``\fB> \fP''. +.TP +.B PS3 +The value of this parameter is used as the prompt for the +.B select +command (see +.SM +.B SHELL GRAMMAR +above). +.TP +.B PS4 +The value of this parameter is expanded as with +.SM +.B PS1 +and the value is printed before each command +.B bash +displays during an execution trace. The first character of +.SM +.B PS4 +is replicated multiple times, as necessary, to indicate multiple +levels of indirection. The default is ``\fB+ \fP''. +.TP +.B SHELL +The full pathname to the shell is kept in this environment variable. +If it is not set when the shell starts, +.B bash +assigns to it the full pathname of the current user's login shell. +.TP +.B TIMEFORMAT +The value of this parameter is used as a format string specifying +how the timing information for pipelines prefixed with the +.B time +reserved word should be displayed. +The \fB%\fP character introduces an escape sequence that is +expanded to a time value or other information. +The escape sequences and their meanings are as follows; the +braces denote optional portions. +.sp .5 +.RS +.PD 0 +.TP 10 +.B %% +A literal \fB%\fP. +.TP +.B %[\fIp\fP][l]R +The elapsed time in seconds. +.TP +.B %[\fIp\fP][l]U +The number of CPU seconds spent in user mode. +.TP +.B %[\fIp\fP][l]S +The number of CPU seconds spent in system mode. +.TP +.B %P +The CPU percentage, computed as (%U + %S) / %R. +.PD +.RE +.IP +The optional \fIp\fP is a digit specifying the \fIprecision\fP, +the number of fractional digits after a decimal point. +A value of 0 causes no decimal point or fraction to be output. +At most three places after the decimal point may be specified; +values of \fIp\fP greater than 3 are changed to 3. +If \fIp\fP is not specified, the value 3 is used. +.IP +The optional \fBl\fP specifies a longer format, including +minutes, of the form \fIMM\fPm\fISS\fP.\fIFF\fPs. +The value of \fIp\fP determines whether or not the fraction is +included. +.IP +If this variable is not set, \fBbash\fP acts as if it had the +value \fB$\(aq\enreal\et%3lR\enuser\et%3lU\ensys\et%3lS\(aq\fP. +If the value is null, no timing information is displayed. +A trailing newline is added when the format string is displayed. +.PD 0 +.TP +.B TMOUT +If set to a value greater than zero, +.SM +.B TMOUT +is treated as the +default timeout for the \fBread\fP builtin. +The \fBselect\fP command terminates if input does not arrive +after +.SM +.B TMOUT +seconds when input is coming from a terminal. +In an interactive shell, the value is interpreted as the +number of seconds to wait for a line of input after issuing the +primary prompt. +.B Bash +terminates after waiting for that number of seconds if a complete +line of input does not arrive. +.TP +.B TMPDIR +If set, \fBbash\fP uses its value as the name of a directory in which +\fBbash\fP creates temporary files for the shell's use. +.TP +.B auto_resume +This variable controls how the shell interacts with the user and +job control. If this variable is set, single word simple +commands without redirections are treated as candidates for resumption +of an existing stopped job. There is no ambiguity allowed; if there is +more than one job beginning with the string typed, the job most recently +accessed is selected. The +.I name +of a stopped job, in this context, is the command line used to +start it. +If set to the value +.IR exact , +the string supplied must match the name of a stopped job exactly; +if set to +.IR substring , +the string supplied needs to match a substring of the name of a +stopped job. The +.I substring +value provides functionality analogous to the +.B %? +job identifier (see +.SM +.B JOB CONTROL +below). If set to any other value, the supplied string must +be a prefix of a stopped job's name; this provides functionality +analogous to the \fB%\fP\fIstring\fP job identifier. +.TP +.B histchars +The two or three characters which control history expansion +and tokenization (see +.SM +.B HISTORY EXPANSION +below). The first character is the \fIhistory expansion\fP character, +the character which signals the start of a history +expansion, normally `\fB!\fP'. +The second character is the \fIquick substitution\fP +character, which is used as shorthand for re-running the previous +command entered, substituting one string for another in the command. +The default is `\fB^\fP'. +The optional third character is the character +which indicates that the remainder of the line is a comment when found +as the first character of a word, normally `\fB#\fP'. The history +comment character causes history substitution to be skipped for the +remaining words on the line. It does not necessarily cause the shell +parser to treat the rest of the line as a comment. +.PD +.SS Arrays +.B Bash +provides one-dimensional indexed and associative array variables. +Any variable may be used as an indexed array; the +.B declare +builtin will explicitly declare an array. +There is no maximum +limit on the size of an array, nor any requirement that members +be indexed or assigned contiguously. +Indexed arrays are referenced using integers (including arithmetic +expressions) and are zero-based; associative arrays are referenced +using arbitrary strings. +Unless otherwise noted, indexed array indices must be non-negative integers. +.PP +An indexed array is created automatically if any variable is assigned to +using the syntax \fIname\fP[\fIsubscript\fP]=\fIvalue\fP. The +.I subscript +is treated as an arithmetic expression that must evaluate to a number. +To explicitly declare an indexed array, use +.B declare \-a \fIname\fP +(see +.SM +.B SHELL BUILTIN COMMANDS +below). +.B declare \-a \fIname\fP[\fIsubscript\fP] +is also accepted; the \fIsubscript\fP is ignored. +.PP +Associative arrays are created using +.BR "declare \-A \fIname\fP" . +.PP +Attributes may be +specified for an array variable using the +.B declare +and +.B readonly +builtins. Each attribute applies to all members of an array. +.PP +Arrays are assigned to using compound assignments of the form +\fIname\fP=\fB(\fPvalue\fI1\fP ... value\fIn\fP\fB)\fP, where each +\fIvalue\fP is of the form [\fIsubscript\fP]=\fIstring\fP. +Indexed array assignments do not require anything but \fIstring\fP. +When assigning to indexed arrays, if the optional brackets and subscript +are supplied, that index is assigned to; +otherwise the index of the element assigned is the last index assigned +to by the statement plus one. Indexing starts at zero. +.PP +When assigning to an associative array, the subscript is required. +.PP +This syntax is also accepted by the +.B declare +builtin. Individual array elements may be assigned to using the +\fIname\fP[\fIsubscript\fP]=\fIvalue\fP syntax introduced above. +When assigning to an indexed array, if +.I name +is subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +\fIname\fP, so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.PP +Any element of an array may be referenced using +${\fIname\fP[\fIsubscript\fP]}. The braces are required to avoid +conflicts with pathname expansion. If +\fIsubscript\fP is \fB@\fP or \fB*\fP, the word expands to +all members of \fIname\fP. These subscripts differ only when the +word appears within double quotes. If the word is double-quoted, +${\fIname\fP[*]} expands to a single +word with the value of each array member separated by the first +character of the +.SM +.B IFS +special variable, and ${\fIname\fP[@]} expands each element of +\fIname\fP to a separate word. When there are no array members, +${\fIname\fP[@]} expands to nothing. +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +This is analogous to the expansion +of the special parameters \fB*\fP and \fB@\fP (see +.B Special Parameters +above). ${#\fIname\fP[\fIsubscript\fP]} expands to the length of +${\fIname\fP[\fIsubscript\fP]}. If \fIsubscript\fP is \fB*\fP or +\fB@\fP, the expansion is the number of elements in the array. +Referencing an array variable without a subscript is equivalent to +referencing the array with a subscript of 0. +If the +.I subscript +used to reference an element of an indexed array +evaluates to a number less than zero, it is +interpreted as relative to one greater than the maximum index of the array, +so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.PP +An array variable is considered set if a subscript has been assigned a +value. The null string is a valid value. +.PP +It is possible to obtain the keys (indices) of an array as well as the values. +${\fB!\fP\fIname\fP[\fI@\fP]} and ${\fB!\fP\fIname\fP[\fI*\fP]} +expand to the indices assigned in array variable \fIname\fP. +The treatment when in double quotes is similar to the expansion of the +special parameters \fI@\fP and \fI*\fP within double quotes. +.PP +The +.B unset +builtin is used to destroy arrays. \fBunset\fP \fIname\fP[\fIsubscript\fP] +destroys the array element at index \fIsubscript\fP. +Negative subscripts to indexed arrays are interpreted as described above. +Care must be taken to avoid unwanted side effects caused by pathname +expansion. +\fBunset\fP \fIname\fP, where \fIname\fP is an array, or +\fBunset\fP \fIname\fP[\fIsubscript\fP], where +\fIsubscript\fP is \fB*\fP or \fB@\fP, removes the entire array. +.PP +The +.BR declare , +.BR local , +and +.B readonly +builtins each accept a +.B \-a +option to specify an indexed array and a +.B \-A +option to specify an associative array. +If both options are supplied, +.B \-A +takes precedence. +The +.B read +builtin accepts a +.B \-a +option to assign a list of words read from the standard input +to an array. The +.B set +and +.B declare +builtins display array values in a way that allows them to be +reused as assignments. +.SH EXPANSION +Expansion is performed on the command line after it has been split into +words. There are seven kinds of expansion performed: +.IR "brace expansion" , +.IR "tilde expansion" , +.IR "parameter and variable expansion" , +.IR "command substitution" , +.IR "arithmetic expansion" , +.IR "word splitting" , +and +.IR "pathname expansion" . +.PP +The order of expansions is: +brace expansion; +tilde expansion, parameter and variable expansion, arithmetic expansion, +and command substitution (done in a left-to-right fashion); +word splitting; +and pathname expansion. +.PP +On systems that can support it, there is an additional expansion +available: \fIprocess substitution\fP. +This is performed at the +same time as tilde, parameter, variable, and arithmetic expansion and +command substitution. +.PP +Only brace expansion, word splitting, and pathname expansion +can change the number of words of the expansion; other expansions +expand a single word to a single word. +The only exceptions to this are the expansions of +"\fB$@\fP" and "\fB${\fP\fIname\fP\fB[@]}\fP" +as explained above (see +.SM +.BR PARAMETERS ). +.SS Brace Expansion +.PP +.I "Brace expansion" +is a mechanism by which arbitrary strings +may be generated. This mechanism is similar to +\fIpathname expansion\fP, but the filenames generated +need not exist. Patterns to be brace expanded take +the form of an optional +.IR preamble , +followed by either a series of comma-separated strings or +a sequence expression between a pair of braces, followed by +an optional +.IR postscript . +The preamble is prefixed to each string contained +within the braces, and the postscript is then appended +to each resulting string, expanding left to right. +.PP +Brace expansions may be nested. The results of each expanded +string are not sorted; left to right order is preserved. +For example, a\fB{\fPd,c,b\fB}\fPe expands into `ade ace abe'. +.PP +A sequence expression takes the form +\fB{\fP\fIx\fP\fB..\fP\fIy\fP\fB[..\fP\fIincr\fP\fB]}\fP, +where \fIx\fP and \fIy\fP are either integers or single characters, +and \fIincr\fP, an optional increment, is an integer. +When integers are supplied, the expression expands to each number between +\fIx\fP and \fIy\fP, inclusive. +Supplied integers may be prefixed with \fI0\fP to force each term to have the +same width. +When either \fIx\fP or \fPy\fP begins with a zero, the shell +attempts to force all generated terms to contain the same number of digits, +zero-padding where necessary. +When characters are supplied, the expression expands to each character +lexicographically between \fIx\fP and \fIy\fP, inclusive, +using the default C locale. +Note that both \fIx\fP and \fIy\fP must be of the same type. +When the increment is supplied, it is used as the difference between +each term. The default increment is 1 or -1 as appropriate. +.PP +Brace expansion is performed before any other expansions, +and any characters special to other expansions are preserved +in the result. It is strictly textual. +.B Bash +does not apply any syntactic interpretation to the context of the +expansion or the text between the braces. +.PP +A correctly-formed brace expansion must contain unquoted opening +and closing braces, and at least one unquoted comma or a valid +sequence expression. +Any incorrectly formed brace expansion is left unchanged. +A \fB{\fP or \fB,\fP may be quoted with a backslash to prevent its +being considered part of a brace expression. +To avoid conflicts with parameter expansion, the string \fB${\fP +is not considered eligible for brace expansion. +.PP +This construct is typically used as shorthand when the common +prefix of the strings to be generated is longer than in the +above example: +.RS +.PP +mkdir /usr/local/src/bash/{old,new,dist,bugs} +.RE +or +.RS +chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} +.RE +.PP +Brace expansion introduces a slight incompatibility with +historical versions of +.BR sh . +.B sh +does not treat opening or closing braces specially when they +appear as part of a word, and preserves them in the output. +.B Bash +removes braces from words as a consequence of brace +expansion. For example, a word entered to +.B sh +as \fIfile{1,2}\fP +appears identically in the output. The same word is +output as +.I file1 file2 +after expansion by +.BR bash . +If strict compatibility with +.B sh +is desired, start +.B bash +with the +.B +B +option or disable brace expansion with the +.B +B +option to the +.B set +command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SS Tilde Expansion +.PP +If a word begins with an unquoted tilde character (`\fB~\fP'), all of +the characters preceding the first unquoted slash (or all characters, +if there is no unquoted slash) are considered a \fItilde-prefix\fP. +If none of the characters in the tilde-prefix are quoted, the +characters in the tilde-prefix following the tilde are treated as a +possible \fIlogin name\fP. +If this login name is the null string, the tilde is replaced with the +value of the shell parameter +.SM +.BR HOME . +If +.SM +.B HOME +is unset, the home directory of the user executing the shell is +substituted instead. +Otherwise, the tilde-prefix is replaced with the home directory +associated with the specified login name. +.PP +If the tilde-prefix is a `~+', the value of the shell variable +.SM +.B PWD +replaces the tilde-prefix. +If the tilde-prefix is a `~\-', the value of the shell variable +.SM +.BR OLDPWD , +if it is set, is substituted. +If the characters following the tilde in the tilde-prefix consist +of a number \fIN\fP, optionally prefixed +by a `+' or a `\-', the tilde-prefix is replaced with the corresponding +element from the directory stack, as it would be displayed by the +.B dirs +builtin invoked with the tilde-prefix as an argument. +If the characters following the tilde in the tilde-prefix consist of a +number without a leading `+' or `\-', `+' is assumed. +.PP +If the login name is invalid, or the tilde expansion fails, the word +is unchanged. +.PP +Each variable assignment is checked for unquoted tilde-prefixes immediately +following a +.B : +or the first +.BR = . +In these cases, tilde expansion is also performed. +Consequently, one may use filenames with tildes in assignments to +.SM +.BR PATH , +.SM +.BR MAILPATH , +and +.SM +.BR CDPATH , +and the shell assigns the expanded value. +.SS Parameter Expansion +.PP +The `\fB$\fP' character introduces parameter expansion, +command substitution, or arithmetic expansion. The parameter name +or symbol to be expanded may be enclosed in braces, which +are optional but serve to protect the variable to be expanded from +characters immediately following it which could be +interpreted as part of the name. +.PP +When braces are used, the matching ending brace is the first `\fB}\fP' +not escaped by a backslash or within a quoted string, and not within an +embedded arithmetic expansion, command substitution, or parameter +expansion. +.PP +.PD 0 +.TP +${\fIparameter\fP} +The value of \fIparameter\fP is substituted. The braces are required +when +.I parameter +is a positional parameter with more than one digit, +or when +.I parameter +is followed by a character which is not to be +interpreted as part of its name. +The \fIparameter\fP is a shell parameter as described above +\fBPARAMETERS\fP) or an array reference (\fBArrays\fP). +.PD +.PP +If the first character of \fIparameter\fP is an exclamation point (\fB!\fP), +it introduces a level of variable indirection. +\fBBash\fP uses the value of the variable formed from the rest of +\fIparameter\fP as the name of the variable; this variable is then +expanded and that value is used in the rest of the substitution, rather +than the value of \fIparameter\fP itself. +This is known as \fIindirect expansion\fP. +The exceptions to this are the expansions of ${\fB!\fP\fIprefix\fP\fB*\fP} and +${\fB!\fP\fIname\fP[\fI@\fP]} described below. +The exclamation point must immediately follow the left brace in order to +introduce indirection. +.PP +In each of the cases below, \fIword\fP is subject to tilde expansion, +parameter expansion, command substitution, and arithmetic expansion. +.PP +When not performing substring expansion, using the forms documented below +(e.g., \fB:-\fP), +\fBbash\fP tests for a parameter that is unset or null. Omitting the colon +results in a test only for a parameter that is unset. +.PP +.PD 0 +.TP +${\fIparameter\fP\fB:\-\fP\fIword\fP} +\fBUse Default Values\fP. If +.I parameter +is unset or null, the expansion of +.I word +is substituted. Otherwise, the value of +.I parameter +is substituted. +.TP +${\fIparameter\fP\fB:=\fP\fIword\fP} +\fBAssign Default Values\fP. +If +.I parameter +is unset or null, the expansion of +.I word +is assigned to +.IR parameter . +The value of +.I parameter +is then substituted. Positional parameters and special parameters may +not be assigned to in this way. +.TP +${\fIparameter\fP\fB:?\fP\fIword\fP} +\fBDisplay Error if Null or Unset\fP. +If +.I parameter +is null or unset, the expansion of \fIword\fP (or a message to that effect +if +.I word +is not present) is written to the standard error and the shell, if it +is not interactive, exits. Otherwise, the value of \fIparameter\fP is +substituted. +.TP +${\fIparameter\fP\fB:+\fP\fIword\fP} +\fBUse Alternate Value\fP. +If +.I parameter +is null or unset, nothing is substituted, otherwise the expansion of +.I word +is substituted. +.TP +${\fIparameter\fP\fB:\fP\fIoffset\fP} +.PD 0 +.TP +${\fIparameter\fP\fB:\fP\fIoffset\fP\fB:\fP\fIlength\fP} +.PD +\fBSubstring Expansion\fP. +Expands to up to \fIlength\fP characters of the value of \fIparameter\fP +starting at the character specified by \fIoffset\fP. +If \fIparameter\fP is \fB@\fP, an indexed array subscripted by +\fB@\fP or \fB*\fP, or an associative array name, the results differ as +described below. +If \fIlength\fP is omitted, expands to the substring of the value of +\fIparameter\fP starting at the character specified by \fIoffset\fP +and extending to the end of the value. +\fIlength\fP and \fIoffset\fP are arithmetic expressions (see +.SM +.B +ARITHMETIC EVALUATION +below). +.sp 1 +If \fIoffset\fP evaluates to a number less than zero, the value +is used as an offset in characters +from the end of the value of \fIparameter\fP. +If \fIlength\fP evaluates to a number less than zero, +it is interpreted as an offset in characters +from the end of the value of \fIparameter\fP rather than +a number of characters, and the expansion is the characters between +\fIoffset\fP and that result. +Note that a negative offset must be separated from the colon by at least +one space to avoid being confused with the \fB:-\fP expansion. +.sp 1 +If \fIparameter\fP is \fB@\fP, the result is \fIlength\fP positional +parameters beginning at \fIoffset\fP. +A negative \fIoffset\fP is taken relative to one greater than the greatest +positional parameter, so an offset of -1 evaluates to the last positional +parameter. +It is an expansion error if \fIlength\fP evaluates to a number less than +zero. +.sp 1 +If \fIparameter\fP is an indexed array name subscripted by @ or *, +the result is the \fIlength\fP +members of the array beginning with ${\fIparameter\fP[\fIoffset\fP]}. +A negative \fIoffset\fP is taken relative to one greater than the maximum +index of the specified array. +It is an expansion error if \fIlength\fP evaluates to a number less than +zero. +.sp 1 +Substring expansion applied to an associative array produces undefined +results. +.sp 1 +Substring indexing is zero-based unless the positional parameters +are used, in which case the indexing starts at 1 by default. +If \fIoffset\fP is 0, and the positional parameters are used, \fB$0\fP is +prefixed to the list. +.TP +${\fB!\fP\fIprefix\fP\fB*\fP} +.PD 0 +.TP +${\fB!\fP\fIprefix\fP\fB@\fP} +.PD +\fBNames matching prefix\fP. +Expands to the names of variables whose names begin with \fIprefix\fP, +separated by the first character of the +.SM +.B IFS +special variable. +When \fI@\fP is used and the expansion appears within double quotes, each +variable name expands to a separate word. +.TP +${\fB!\fP\fIname\fP[\fI@\fP]} +.PD 0 +.TP +${\fB!\fP\fIname\fP[\fI*\fP]} +.PD +\fBList of array keys\fP. +If \fIname\fP is an array variable, expands to the list of array indices +(keys) assigned in \fIname\fP. +If \fIname\fP is not an array, expands to 0 if \fIname\fP is set and null +otherwise. +When \fI@\fP is used and the expansion appears within double quotes, each +key expands to a separate word. +.TP +${\fB#\fP\fIparameter\fP} +\fBParameter length\fP. +The length in characters of the value of \fIparameter\fP is substituted. +If +.I parameter +is +.B * +or +.BR @ , +the value substituted is the number of positional parameters. +If +.I parameter +is an array name subscripted by +.B * +or +.BR @ , +the value substituted is the number of elements in the array. +If +.I parameter +is an indexed array name subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +\fIparameter\fP, so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.TP +${\fIparameter\fP\fB#\fP\fIword\fP} +.PD 0 +.TP +${\fIparameter\fP\fB##\fP\fIword\fP} +.PD +\fBRemove matching prefix pattern\fP. +The +.I word +is expanded to produce a pattern just as in pathname +expansion. If the pattern matches the beginning of +the value of +.IR parameter , +then the result of the expansion is the expanded value of +.I parameter +with the shortest matching pattern (the ``\fB#\fP'' case) or the +longest matching pattern (the ``\fB##\fP'' case) deleted. +If +.I parameter +is +.B @ +or +.BR * , +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB%\fP\fIword\fP} +.PD 0 +.TP +${\fIparameter\fP\fB%%\fP\fIword\fP} +.PD +\fBRemove matching suffix pattern\fP. +The \fIword\fP is expanded to produce a pattern just as in +pathname expansion. +If the pattern matches a trailing portion of the expanded value of +.IR parameter , +then the result of the expansion is the expanded value of +.I parameter +with the shortest matching pattern (the ``\fB%\fP'' case) or the +longest matching pattern (the ``\fB%%\fP'' case) deleted. +If +.I parameter +is +.B @ +or +.BR * , +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB/\fP\fIpattern\fP\fB/\fP\fIstring\fP} +\fBPattern substitution\fP. +The \fIpattern\fP is expanded to produce a pattern just as in +pathname expansion. +\fIParameter\fP is expanded and the longest match of \fIpattern\fP +against its value is replaced with \fIstring\fP. +If \fIpattern\fP begins with \fB/\fP, all matches of \fIpattern\fP are +replaced with \fIstring\fP. Normally only the first match is replaced. +If \fIpattern\fP begins with \fB#\fP, it must match at the beginning +of the expanded value of \fIparameter\fP. +If \fIpattern\fP begins with \fB%\fP, it must match at the end +of the expanded value of \fIparameter\fP. +If \fIstring\fP is null, matches of \fIpattern\fP are deleted +and the \fB/\fP following \fIpattern\fP may be omitted. +If +.I parameter +is +.B @ +or +.BR * , +the substitution operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the substitution operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB^\fP\fIpattern\fP} +.PD 0 +.TP +${\fIparameter\fP\fB^^\fP\fIpattern\fP} +.TP +${\fIparameter\fP\fB,\fP\fIpattern\fP} +.TP +${\fIparameter\fP\fB,,\fP\fIpattern\fP} +.PD +\fBCase modification\fP. +This expansion modifies the case of alphabetic characters in \fIparameter\fP. +The \fIpattern\fP is expanded to produce a pattern just as in +pathname expansion. +Each character in the expanded value of \fIparameter\fP is tested against +\fIpattern\fP, and, if it matches the pattern, its case is converted. +The pattern should not attempt to match more than one character. +The \fB^\fP operator converts lowercase letters matching \fIpattern\fP +to uppercase; the \fB,\fP operator converts matching uppercase letters +to lowercase. +The \fB^^\fP and \fB,,\fP expansions convert each matched character in the +expanded value; the \fB^\fP and \fB,\fP expansions match and convert only +the first character in the expanded value. +If \fIpattern\fP is omitted, it is treated like a \fB?\fP, which matches +every character. +If +.I parameter +is +.B @ +or +.BR * , +the case modification operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the case modification operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.SS Command Substitution +.PP +\fICommand substitution\fP allows the output of a command to replace +the command name. There are two forms: +.RS +.PP +\fB$(\fP\fIcommand\fP\|\fB)\fP +.RE +or +.RS +\fB\`\fP\fIcommand\fP\fB\`\fP +.RE +.PP +.B Bash +performs the expansion by executing \fIcommand\fP and +replacing the command substitution with the standard output of the +command, with any trailing newlines deleted. +Embedded newlines are not deleted, but they may be removed during +word splitting. +The command substitution \fB$(cat \fIfile\fP)\fR can be replaced by +the equivalent but faster \fB$(< \fIfile\fP)\fR. +.PP +When the old-style backquote form of substitution is used, +backslash retains its literal meaning except when followed by +.BR $ , +.BR \` , +or +.BR \e . +The first backquote not preceded by a backslash terminates the +command substitution. +When using the $(\^\fIcommand\fP\|) form, all characters between the +parentheses make up the command; none are treated specially. +.PP +Command substitutions may be nested. To nest when using the backquoted form, +escape the inner backquotes with backslashes. +.PP +If the substitution appears within double quotes, word splitting and +pathname expansion are not performed on the results. +.SS Arithmetic Expansion +.PP +Arithmetic expansion allows the evaluation of an arithmetic expression +and the substitution of the result. The format for arithmetic expansion is: +.RS +.PP +\fB$((\fP\fIexpression\fP\fB))\fP +.RE +.PP +The old format \fB$[\fP\fIexpression\fP\fB]\fP is deprecated and will +be removed in upcoming versions of bash. +.PP +The +.I expression +is treated as if it were within double quotes, but a double quote +inside the parentheses is not treated specially. +All tokens in the expression undergo parameter and variable expansion, +command substitution, and quote removal. +The result is treated as the arithmetic expression to be evaluated. +Arithmetic expansions may be nested. +.PP +The evaluation is performed according to the rules listed below under +.SM +.BR "ARITHMETIC EVALUATION" . +If +.I expression +is invalid, +.B bash +prints a message indicating failure and no substitution occurs. +.SS Process Substitution +.PP +\fIProcess substitution\fP is supported on systems that support named +pipes (\fIFIFOs\fP) or the \fB/dev/fd\fP method of naming open files. +It takes the form of +\fB<(\fP\fIlist\^\fP\fB)\fP +or +\fB>(\fP\fIlist\^\fP\fB)\fP. +The process \fIlist\fP is run with its input or output connected to a +\fIFIFO\fP or some file in \fB/dev/fd\fP. The name of this file is +passed as an argument to the current command as the result of the +expansion. If the \fB>(\fP\fIlist\^\fP\fB)\fP form is used, writing to +the file will provide input for \fIlist\fP. If the +\fB<(\fP\fIlist\^\fP\fB)\fP form is used, the file passed as an +argument should be read to obtain the output of \fIlist\fP. +.PP +When available, process substitution is performed +simultaneously with parameter and variable expansion, +command substitution, +and arithmetic expansion. +.SS Word Splitting +.PP +The shell scans the results of +parameter expansion, +command substitution, +and +arithmetic expansion +that did not occur within double quotes for +.IR "word splitting" . +.PP +The shell treats each character of +.SM +.B IFS +as a delimiter, and splits the results of the other +expansions into words using these characters as field terminators. +If +.SM +.B IFS +is unset, or its +value is exactly +.BR , +the default, then +sequences of +.BR , +.BR , +and +.B +at the beginning and end of the results of the previous +expansions are ignored, and +any sequence of +.SM +.B IFS +characters not at the beginning or end serves to delimit words. +If +.SM +.B IFS +has a value other than the default, then sequences of +the whitespace characters +.B space +and +.B tab +are ignored at the beginning and end of the +word, as long as the whitespace character is in the +value of +.SM +.BR IFS +(an +.SM +.B IFS +whitespace character). +Any character in +.SM +.B IFS +that is not +.SM +.B IFS +whitespace, along with any adjacent +.SM +.B IFS +whitespace characters, delimits a field. +A sequence of +.SM +.B IFS +whitespace characters is also treated as a delimiter. +If the value of +.SM +.B IFS +is null, no word splitting occurs. +.PP +Explicit null arguments (\^\f3"\^"\fP or \^\f3\(aq\^\(aq\fP\^) are retained. +Unquoted implicit null arguments, resulting from the expansion of +parameters that have no values, are removed. +If a parameter with no value is expanded within double quotes, a +null argument results and is retained. +.PP +Note that if no expansion occurs, no splitting +is performed. +.SS Pathname Expansion +.PP +After word splitting, +unless the +.B \-f +option has been set, +.B bash +scans each word for the characters +.BR * , +.BR ? , +and +.BR [ . +If one of these characters appears, then the word is +regarded as a +.IR pattern , +and replaced with an alphabetically sorted list of +filenames matching the pattern +(see +.SM +.B "Pattern Matching" +below). +If no matching filenames are found, +and the shell option +.B nullglob +is not enabled, the word is left unchanged. +If the +.B nullglob +option is set, and no matches are found, +the word is removed. +If the +.B failglob +shell option is set, and no matches are found, an error message +is printed and the command is not executed. +If the shell option +.B nocaseglob +is enabled, the match is performed without regard to the case +of alphabetic characters. +When a pattern is used for pathname expansion, +the character +.B ``.'' +at the start of a name or immediately following a slash +must be matched explicitly, unless the shell option +.B dotglob +is set. +When matching a pathname, the slash character must always be +matched explicitly. +In other cases, the +.B ``.'' +character is not treated specially. +See the description of +.B shopt +below under +.SM +.B SHELL BUILTIN COMMANDS +for a description of the +.BR nocaseglob , +.BR nullglob , +.BR failglob , +and +.B dotglob +shell options. +.PP +The +.SM +.B GLOBIGNORE +shell variable may be used to restrict the set of filenames matching a +.IR pattern . +If +.SM +.B GLOBIGNORE +is set, each matching filename that also matches one of the patterns in +.SM +.B GLOBIGNORE +is removed from the list of matches. +The filenames +.B ``.'' +and +.B ``..'' +are always ignored when +.SM +.B GLOBIGNORE +is set and not null. However, setting +.SM +.B GLOBIGNORE +to a non-null value has the effect of enabling the +.B dotglob +shell option, so all other filenames beginning with a +.B ``.'' +will match. +To get the old behavior of ignoring filenames beginning with a +.BR ``.'' , +make +.B ``.*'' +one of the patterns in +.SM +.BR GLOBIGNORE . +The +.B dotglob +option is disabled when +.SM +.B GLOBIGNORE +is unset. +.PP +\fBPattern Matching\fP +.PP +Any character that appears in a pattern, other than the special pattern +characters described below, matches itself. The NUL character may not +occur in a pattern. A backslash escapes the following character; the +escaping backslash is discarded when matching. +The special pattern characters must be quoted if +they are to be matched literally. +.PP +The special pattern characters have the following meanings: +.PP +.PD 0 +.RS +.TP +.B * +Matches any string, including the null string. +When the \fBglobstar\fP shell option is enabled, and \fB*\fP is used in +a pathname expansion context, two adjacent \fB*\fPs used as a single +pattern will match all files and zero or more directories and +subdirectories. +If followed by a \fB/\fP, two adjacent \fB*\fPs will match only directories +and subdirectories. +.TP +.B ? +Matches any single character. +.TP +.B [...] +Matches any one of the enclosed characters. A pair of characters +separated by a hyphen denotes a +\fIrange expression\fP; +any character that falls between those two characters, inclusive, +using the current locale's collating sequence and character set, +is matched. If the first character following the +.B [ +is a +.B ! +or a +.B ^ +then any character not enclosed is matched. +The sorting order of characters in range expressions is determined by +the current locale and the values of the +.SM +.B LC_COLLATE +or +.SM +.B LC_ALL +shell variables, if set. +To obtain the traditional interpretation of range expressions, where +.B [a\-d] +is equivalent to +.BR [abcd] , +set value of the +.B LC_ALL +shell variable to +.BR C , +or enable the +.B globasciiranges +shell option. +A +.B \- +may be matched by including it as the first or last character +in the set. +A +.B ] +may be matched by including it as the first character +in the set. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +\fIcharacter classes\fP can be specified using the syntax +\fB[:\fP\fIclass\fP\fB:]\fP, where \fIclass\fP is one of the +following classes defined in the POSIX standard: +.PP +.RS +.B +.if n alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit +.if t alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit +.br +A character class matches any character belonging to that class. +The \fBword\fP character class matches letters, digits, and the character _. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +an \fIequivalence class\fP can be specified using the syntax +\fB[=\fP\fIc\fP\fB=]\fP, which matches all characters with the +same collation weight (as defined by the current locale) as +the character \fIc\fP. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +the syntax \fB[.\fP\fIsymbol\fP\fB.]\fP matches the collating symbol +\fIsymbol\fP. +.RE +.RE +.PD +.PP +If the \fBextglob\fP shell option is enabled using the \fBshopt\fP +builtin, several extended pattern matching operators are recognized. +In the following description, a \fIpattern-list\fP is a list of one +or more patterns separated by a \fB|\fP. +Composite patterns may be formed using one or more of the following +sub-patterns: +.sp 1 +.PD 0 +.RS +.TP +\fB?(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches zero or one occurrence of the given patterns +.TP +\fB*(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches zero or more occurrences of the given patterns +.TP +\fB+(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches one or more occurrences of the given patterns +.TP +\fB@(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches one of the given patterns +.TP +\fB!(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches anything except one of the given patterns +.RE +.PD +.SS Quote Removal +.PP +After the preceding expansions, all unquoted occurrences of the +characters +.BR \e , +.BR \(aq , +and \^\f3"\fP\^ that did not result from one of the above +expansions are removed. +.SH REDIRECTION +Before a command is executed, its input and output +may be +.I redirected +using a special notation interpreted by the shell. +Redirection allows commands' file handles to be +duplicated, opened, closed, +made to refer to different files, +and can change the files the command reads from and writes to. +Redirection may also be used to modify file handles in the +current shell execution environment. +The following redirection +operators may precede or appear anywhere within a +.I simple command +or may follow a +.IR command . +Redirections are processed in the order they appear, from +left to right. +.PP +Each redirection that may be preceded by a file descriptor number +may instead be preceded by a word of the form {\fIvarname\fP}. +In this case, for each redirection operator except +>&- and <&-, the shell will allocate a file descriptor greater +than or equal to 10 and assign it to \fIvarname\fP. +If >&- or <&- is preceded +by {\fIvarname\fP}, the value of \fIvarname\fP defines the file +descriptor to close. +.PP +In the following descriptions, if the file descriptor number is +omitted, and the first character of the redirection operator is +.BR < , +the redirection refers to the standard input (file descriptor +0). If the first character of the redirection operator is +.BR > , +the redirection refers to the standard output (file descriptor +1). +.PP +The word following the redirection operator in the following +descriptions, unless otherwise noted, is subjected to +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, quote removal, +pathname expansion, and word splitting. +If it expands to more than one word, +.B bash +reports an error. +.PP +Note that the order of redirections is significant. For example, +the command +.RS +.PP +ls \fB>\fP dirlist 2\fB>&\fP1 +.RE +.PP +directs both standard output and standard error to the file +.IR dirlist , +while the command +.RS +.PP +ls 2\fB>&\fP1 \fB>\fP dirlist +.RE +.PP +directs only the standard output to file +.IR dirlist , +because the standard error was duplicated from the standard output +before the standard output was redirected to +.IR dirlist . +.PP +\fBBash\fP handles several filenames specially when they are used in +redirections, as described in the following table: +.RS +.PP +.PD 0 +.TP +.B /dev/fd/\fIfd\fP +If \fIfd\fP is a valid integer, file descriptor \fIfd\fP is duplicated. +.TP +.B /dev/stdin +File descriptor 0 is duplicated. +.TP +.B /dev/stdout +File descriptor 1 is duplicated. +.TP +.B /dev/stderr +File descriptor 2 is duplicated. +.TP +.B /dev/tcp/\fIhost\fP/\fIport\fP +If \fIhost\fP is a valid hostname or Internet address, and \fIport\fP +is an integer port number or service name, \fBbash\fP attempts to open +the corresponding TCP socket. +.TP +.B /dev/udp/\fIhost\fP/\fIport\fP +If \fIhost\fP is a valid hostname or Internet address, and \fIport\fP +is an integer port number or service name, \fBbash\fP attempts to open +the corresponding UDP socket. +.PD +.RE +.PP +A failure to open or create a file causes the redirection to fail. +.PP +Redirections using file descriptors greater than 9 should be used with +care, as they may conflict with file descriptors the shell uses +internally. +.SS Redirecting Input +.PP +Redirection of input causes the file whose name results from +the expansion of +.I word +to be opened for reading on file descriptor +.IR n , +or the standard input (file descriptor 0) if +.I n +is not specified. +.PP +The general format for redirecting input is: +.RS +.PP +[\fIn\fP]\fB<\fP\fIword\fP +.RE +.SS Redirecting Output +.PP +Redirection of output causes the file whose name results from +the expansion of +.I word +to be opened for writing on file descriptor +.IR n , +or the standard output (file descriptor 1) if +.I n +is not specified. If the file does not exist it is created; +if it does exist it is truncated to zero size. +.PP +The general format for redirecting output is: +.RS +.PP +[\fIn\fP]\fB>\fP\fIword\fP +.RE +.PP +If the redirection operator is +.BR > , +and the +.B noclobber +option to the +.B set +builtin has been enabled, the redirection will fail if the file +whose name results from the expansion of \fIword\fP exists and is +a regular file. +If the redirection operator is +.BR >| , +or the redirection operator is +.B > +and the +.B noclobber +option to the +.B set +builtin command is not enabled, the redirection is attempted even +if the file named by \fIword\fP exists. +.SS Appending Redirected Output +.PP +Redirection of output in this fashion +causes the file whose name results from +the expansion of +.I word +to be opened for appending on file descriptor +.IR n , +or the standard output (file descriptor 1) if +.I n +is not specified. If the file does not exist it is created. +.PP +The general format for appending output is: +.RS +.PP +[\fIn\fP]\fB>>\fP\fIword\fP +.RE +.PP +.SS Redirecting Standard Output and Standard Error +.PP +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be redirected to the file whose name is the +expansion of +.IR word . +.PP +There are two formats for redirecting standard output and +standard error: +.RS +.PP +\fB&>\fP\fIword\fP +.RE +and +.RS +\fB>&\fP\fIword\fP +.RE +.PP +Of the two forms, the first is preferred. +This is semantically equivalent to +.RS +.PP +\fB>\fP\fIword\fP 2\fB>&\fP1 +.RE +.PP +When using the second form, \fIword\fP may not expand to a number or +\fB\-\fP. If it does, other redirection operators apply +(see \fBDuplicating File Descriptors\fP below) for compatibility +reasons. +.SS Appending Standard Output and Standard Error +.PP +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be appended to the file whose name is the +expansion of +.IR word . +.PP +The format for appending standard output and standard error is: +.RS +.PP +\fB&>>\fP\fIword\fP +.RE +.PP +This is semantically equivalent to +.RS +.PP +\fB>>\fP\fIword\fP 2\fB>&\fP1 +.RE +.PP +(see \fBDuplicating File Descriptors\fP below). +.SS Here Documents +.PP +This type of redirection instructs the shell to read input from the +current source until a line containing only +.I delimiter +(with no trailing blanks) +is seen. All of +the lines read up to that point are then used as the standard +input for a command. +.PP +The format of here-documents is: +.RS +.PP +.nf +\fB<<\fP[\fB\-\fP]\fIword\fP + \fIhere-document\fP +\fIdelimiter\fP +.fi +.RE +.PP +No parameter and variable expansion, command substitution, +arithmetic expansion, or pathname expansion is performed on +.IR word . +If any characters in +.I word +are quoted, the +.I delimiter +is the result of quote removal on +.IR word , +and the lines in the here-document are not expanded. +If \fIword\fP is unquoted, +all lines of the here-document are subjected to +parameter expansion, command substitution, and arithmetic expansion, +the character sequence +.B \e +is ignored, and +.B \e +must be used to quote the characters +.BR \e , +.BR $ , +and +.BR \` . +.PP +If the redirection operator is +.BR <<\- , +then all leading tab characters are stripped from input lines and the +line containing +.IR delimiter . +This allows +here-documents within shell scripts to be indented in a +natural fashion. +.SS "Here Strings" +A variant of here documents, the format is: +.RS +.PP +.nf +\fB<<<\fP\fIword\fP +.fi +.RE +.PP +The \fIword\fP undergoes +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote removal. +Pathname expansion and word splitting are not performed. +The result is supplied as a single string to the command on its +standard input. +.SS "Duplicating File Descriptors" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<&\fP\fIword\fP +.RE +.PP +is used to duplicate input file descriptors. +If +.I word +expands to one or more digits, the file descriptor denoted by +.I n +is made to be a copy of that file descriptor. +If the digits in +.I word +do not specify a file descriptor open for input, a redirection error occurs. +If +.I word +evaluates to +.BR \- , +file descriptor +.I n +is closed. If +.I n +is not specified, the standard input (file descriptor 0) is used. +.PP +The operator +.RS +.PP +[\fIn\fP]\fB>&\fP\fIword\fP +.RE +.PP +is used similarly to duplicate output file descriptors. If +.I n +is not specified, the standard output (file descriptor 1) is used. +If the digits in +.I word +do not specify a file descriptor open for output, a redirection error occurs. +If +.I word +evaluates to +.BR \- , +file descriptor +.I n +is closed. +As a special case, if \fIn\fP is omitted, and \fIword\fP does not +expand to one or more digits or \fB\-\fP, the standard output and standard +error are redirected as described previously. +.SS "Moving File Descriptors" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<&\fP\fIdigit\fP\fB\-\fP +.RE +.PP +moves the file descriptor \fIdigit\fP to file descriptor +.IR n , +or the standard input (file descriptor 0) if \fIn\fP is not specified. +\fIdigit\fP is closed after being duplicated to \fIn\fP. +.PP +Similarly, the redirection operator +.RS +.PP +[\fIn\fP]\fB>&\fP\fIdigit\fP\fB\-\fP +.RE +.PP +moves the file descriptor \fIdigit\fP to file descriptor +.IR n , +or the standard output (file descriptor 1) if \fIn\fP is not specified. +.SS "Opening File Descriptors for Reading and Writing" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<>\fP\fIword\fP +.RE +.PP +causes the file whose name is the expansion of +.I word +to be opened for both reading and writing on file descriptor +.IR n , +or on file descriptor 0 if +.I n +is not specified. If the file does not exist, it is created. +.SH ALIASES +\fIAliases\fP allow a string to be substituted for a word when it is used +as the first word of a simple command. +The shell maintains a list of aliases that may be set and unset with the +.B alias +and +.B unalias +builtin commands (see +.SM +.B SHELL BUILTIN COMMANDS +below). +The first word of each simple command, if unquoted, +is checked to see if it has an +alias. If so, that word is replaced by the text of the alias. +The characters \fB/\fP, \fB$\fP, \fB\`\fP, and \fB=\fP and +any of the shell \fImetacharacters\fP or quoting characters +listed above may not appear in an alias name. +The replacement text may contain any valid shell input, +including shell metacharacters. +The first word of the replacement text is tested +for aliases, but a word that is identical to an alias being expanded +is not expanded a second time. +This means that one may alias +.B ls +to +.BR "ls \-F" , +for instance, and +.B bash +does not try to recursively expand the replacement text. +If the last character of the alias value is a +.IR blank , +then the next command +word following the alias is also checked for alias expansion. +.PP +Aliases are created and listed with the +.B alias +command, and removed with the +.B unalias +command. +.PP +There is no mechanism for using arguments in the replacement text. +If arguments are needed, a shell function should be used (see +.SM +.B FUNCTIONS +below). +.PP +Aliases are not expanded when the shell is not interactive, unless +the +.B expand_aliases +shell option is set using +.B shopt +(see the description of +.B shopt +under +.SM +\fBSHELL BUILTIN COMMANDS\fP +below). +.PP +The rules concerning the definition and use of aliases are +somewhat confusing. +.B Bash +always reads at least one complete line +of input before executing any +of the commands on that line. Aliases are expanded when a +command is read, not when it is executed. Therefore, an +alias definition appearing on the same line as another +command does not take effect until the next line of input is read. +The commands following the alias definition +on that line are not affected by the new alias. +This behavior is also an issue when functions are executed. +Aliases are expanded when a function definition is read, +not when the function is executed, because a function definition +is itself a compound command. As a consequence, aliases +defined in a function are not available until after that +function is executed. To be safe, always put +alias definitions on a separate line, and do not use +.B alias +in compound commands. +.PP +For almost every purpose, aliases are superseded by +shell functions. +.SH FUNCTIONS +A shell function, defined as described above under +.SM +.BR "SHELL GRAMMAR" , +stores a series of commands for later execution. +When the name of a shell function is used as a simple command name, +the list of commands associated with that function name is executed. +Functions are executed in the context of the +current shell; no new process is created to interpret +them (contrast this with the execution of a shell script). +When a function is executed, the arguments to the +function become the positional parameters +during its execution. +The special parameter +.B # +is updated to reflect the change. Special parameter \fB0\fP +is unchanged. +The first element of the +.SM +.B FUNCNAME +variable is set to the name of the function while the function +is executing. +.PP +All other aspects of the shell execution +environment are identical between a function and its caller +with these exceptions: the +.SM +.B DEBUG +and +.B RETURN +traps (see the description of the +.B trap +builtin under +.SM +.B SHELL BUILTIN COMMANDS +below) are not inherited unless the function has been given the +\fBtrace\fP attribute (see the description of the +.SM +.B declare +builtin below) or the +\fB\-o functrace\fP shell option has been enabled with +the \fBset\fP builtin +(in which case all functions inherit the \fBDEBUG\fP and \fBRETURN\fP traps), +and the +.SM +.B ERR +trap is not inherited unless the \fB\-o errtrace\fP shell option has +been enabled. +.PP +Variables local to the function may be declared with the +.B local +builtin command. Ordinarily, variables and their values +are shared between the function and its caller. +.PP +The \fBFUNCNEST\fP variable, if set to a numeric value greater +than 0, defines a maximum function nesting level. Function +invocations that exceed the limit cause the entire command to +abort. +.PP +If the builtin command +.B return +is executed in a function, the function completes and +execution resumes with the next command after the function +call. +Any command associated with the \fBRETURN\fP trap is executed +before execution resumes. +When a function completes, the values of the +positional parameters and the special parameter +.B # +are restored to the values they had prior to the function's +execution. +.PP +Function names and definitions may be listed with the +.B \-f +option to the +.B declare +or +.B typeset +builtin commands. The +.B \-F +option to +.B declare +or +.B typeset +will list the function names only +(and optionally the source file and line number, if the \fBextdebug\fP +shell option is enabled). +Functions may be exported so that subshells +automatically have them defined with the +.B \-f +option to the +.B export +builtin. +A function definition may be deleted using the \fB\-f\fP option to +the +.B unset +builtin. +Note that shell functions and variables with the same name may result +in multiple identically-named entries in the environment passed to the +shell's children. +Care should be taken in cases where this may cause a problem. +.PP +Functions may be recursive. +The \fBFUNCNEST\fP variable may be used to limit the depth of the +function call stack and restrict the number of function invocations. +By default, no limit is imposed on the number of recursive calls. +.SH "ARITHMETIC EVALUATION" +The shell allows arithmetic expressions to be evaluated, under +certain circumstances (see the \fBlet\fP and \fBdeclare\fP builtin +commands and \fBArithmetic Expansion\fP). +Evaluation is done in fixed-width integers with no check for overflow, +though division by 0 is trapped and flagged as an error. +The operators and their precedence, associativity, and values +are the same as in the C language. +The following list of operators is grouped into levels of +equal-precedence operators. +The levels are listed in order of decreasing precedence. +.PP +.PD 0 +.TP +.B \fIid\fP++ \fIid\fP\-\- +variable post-increment and post-decrement +.TP +.B ++\fIid\fP \-\-\fIid\fP +variable pre-increment and pre-decrement +.TP +.B \- + +unary minus and plus +.TP +.B ! ~ +logical and bitwise negation +.TP +.B ** +exponentiation +.TP +.B * / % +multiplication, division, remainder +.TP +.B + \- +addition, subtraction +.TP +.B << >> +left and right bitwise shifts +.TP +.B <= >= < > +comparison +.TP +.B == != +equality and inequality +.TP +.B & +bitwise AND +.TP +.B ^ +bitwise exclusive OR +.TP +.B | +bitwise OR +.TP +.B && +logical AND +.TP +.B || +logical OR +.TP +.B \fIexpr\fP?\fIexpr\fP:\fIexpr\fP +conditional operator +.TP +.B = *= /= %= += \-= <<= >>= &= ^= |= +assignment +.TP +.B \fIexpr1\fP , \fIexpr2\fP +comma +.PD +.PP +Shell variables are allowed as operands; parameter expansion is +performed before the expression is evaluated. +Within an expression, shell variables may also be referenced by name +without using the parameter expansion syntax. +A shell variable that is null or unset evaluates to 0 when referenced +by name without using the parameter expansion syntax. +The value of a variable is evaluated as an arithmetic expression +when it is referenced, or when a variable which has been given the +\fIinteger\fP attribute using \fBdeclare -i\fP is assigned a value. +A null value evaluates to 0. +A shell variable need not have its \fIinteger\fP attribute +turned on to be used in an expression. +.PP +Constants with a leading 0 are interpreted as octal numbers. +A leading 0x or 0X denotes hexadecimal. +Otherwise, numbers take the form [\fIbase#\fP]n, where the optional \fIbase\fP +is a decimal number between 2 and 64 representing the arithmetic +base, and \fIn\fP is a number in that base. +If \fIbase#\fP is omitted, then base 10 is used. +When specifying \fIn\fP, +the digits greater< than 9 are represented by the lowercase letters, +the uppercase letters, @, and _, in that order. +If \fIbase\fP is less than or equal to 36, lowercase and uppercase +letters may be used interchangeably to represent numbers between 10 +and 35. +.PP +Operators are evaluated in order of precedence. Sub-expressions in +parentheses are evaluated first and may override the precedence +rules above. +.SH "CONDITIONAL EXPRESSIONS" +Conditional expressions are used by the \fB[[\fP compound command and +the \fBtest\fP and \fB[\fP builtin commands to test file attributes +and perform string and arithmetic comparisons. +Expressions are formed from the following unary or binary primaries. +If any \fIfile\fP argument to one of the primaries is of the form +\fI/dev/fd/n\fP, then file descriptor \fIn\fP is checked. +If the \fIfile\fP argument to one of the primaries is one of +\fI/dev/stdin\fP, \fI/dev/stdout\fP, or \fI/dev/stderr\fP, file +descriptor 0, 1, or 2, respectively, is checked. +.PP +Unless otherwise specified, primaries that operate on files follow symbolic +links and operate on the target of the link, rather than the link itself. +.if t .sp 0.5 +.if n .sp 1 +When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort +lexicographically using the current locale. +The \fBtest\fP command sorts using ASCII ordering. +.sp 1 +.PD 0 +.TP +.B \-a \fIfile\fP +True if \fIfile\fP exists. +.TP +.B \-b \fIfile\fP +True if \fIfile\fP exists and is a block special file. +.TP +.B \-c \fIfile\fP +True if \fIfile\fP exists and is a character special file. +.TP +.B \-d \fIfile\fP +True if \fIfile\fP exists and is a directory. +.TP +.B \-e \fIfile\fP +True if \fIfile\fP exists. +.TP +.B \-f \fIfile\fP +True if \fIfile\fP exists and is a regular file. +.TP +.B \-g \fIfile\fP +True if \fIfile\fP exists and is set-group-id. +.TP +.B \-h \fIfile\fP +True if \fIfile\fP exists and is a symbolic link. +.TP +.B \-k \fIfile\fP +True if \fIfile\fP exists and its ``sticky'' bit is set. +.TP +.B \-p \fIfile\fP +True if \fIfile\fP exists and is a named pipe (FIFO). +.TP +.B \-r \fIfile\fP +True if \fIfile\fP exists and is readable. +.TP +.B \-s \fIfile\fP +True if \fIfile\fP exists and has a size greater than zero. +.TP +.B \-t \fIfd\fP +True if file descriptor +.I fd +is open and refers to a terminal. +.TP +.B \-u \fIfile\fP +True if \fIfile\fP exists and its set-user-id bit is set. +.TP +.B \-w \fIfile\fP +True if \fIfile\fP exists and is writable. +.TP +.B \-x \fIfile\fP +True if \fIfile\fP exists and is executable. +.TP +.B \-G \fIfile\fP +True if \fIfile\fP exists and is owned by the effective group id. +.TP +.B \-L \fIfile\fP +True if \fIfile\fP exists and is a symbolic link. +.TP +.B \-N \fIfile\fP +True if \fIfile\fP exists and has been modified since it was last read. +.TP +.B \-O \fIfile\fP +True if \fIfile\fP exists and is owned by the effective user id. +.TP +.B \-S \fIfile\fP +True if \fIfile\fP exists and is a socket. +.TP +\fIfile1\fP \fB\-ef\fP \fIfile2\fP +True if \fIfile1\fP and \fIfile2\fP refer to the same device and +inode numbers. +.TP +\fIfile1\fP \-\fBnt\fP \fIfile2\fP +True if \fIfile1\fP is newer (according to modification date) than \fIfile2\fP, +or if \fIfile1\fP exists and \fPfile2\fP does not. +.TP +\fIfile1\fP \-\fBot\fP \fIfile2\fP +True if \fIfile1\fP is older than \fIfile2\fP, or if \fIfile2\fP exists +and \fIfile1\fP does not. +.TP +.B \-o \fIoptname\fP +True if the shell option +.I optname +is enabled. +See the list of options under the description of the +.B \-o +option to the +.B set +builtin below. +.TP +.B \-v \fIvarname\fP +True if the shell variable +.I varname +is set (has been assigned a value). +.TP +.B \-R \fIvarname\fP +True if the shell variable +.I varname +is set and is a name reference. +.TP +.B \-z \fIstring\fP +True if the length of \fIstring\fP is zero. +.TP +\fIstring\fP +.PD 0 +.TP +.B \-n \fIstring\fP +.PD +True if the length of +.I string +is non-zero. +.TP +\fIstring1\fP \fB==\fP \fIstring2\fP +.PD 0 +.TP +\fIstring1\fP \fB=\fP \fIstring2\fP +.PD +True if the strings are equal. \fB=\fP should be used +with the \fBtest\fP command for POSIX conformance. +When used with the \fB[[\fP command, this performs pattern matching as +described above (\fBCompound Commands\fP). +.TP +\fIstring1\fP \fB!=\fP \fIstring2\fP +True if the strings are not equal. +.TP +\fIstring1\fP \fB<\fP \fIstring2\fP +True if \fIstring1\fP sorts before \fIstring2\fP lexicographically. +.TP +\fIstring1\fP \fB>\fP \fIstring2\fP +True if \fIstring1\fP sorts after \fIstring2\fP lexicographically. +.TP +.I \fIarg1\fP \fBOP\fP \fIarg2\fP +.SM +.B OP +is one of +.BR \-eq , +.BR \-ne , +.BR \-lt , +.BR \-le , +.BR \-gt , +or +.BR \-ge . +These arithmetic binary operators return true if \fIarg1\fP +is equal to, not equal to, less than, less than or equal to, +greater than, or greater than or equal to \fIarg2\fP, respectively. +.I Arg1 +and +.I arg2 +may be positive or negative integers. +.PD +.SH "SIMPLE COMMAND EXPANSION" +When a simple command is executed, the shell performs the following +expansions, assignments, and redirections, from left to right. +.IP 1. +The words that the parser has marked as variable assignments (those +preceding the command name) and redirections are saved for later +processing. +.IP 2. +The words that are not variable assignments or redirections are +expanded. If any words remain after expansion, the first word +is taken to be the name of the command and the remaining words are +the arguments. +.IP 3. +Redirections are performed as described above under +.SM +.BR REDIRECTION . +.IP 4. +The text after the \fB=\fP in each variable assignment undergoes tilde +expansion, parameter expansion, command substitution, arithmetic expansion, +and quote removal before being assigned to the variable. +.PP +If no command name results, the variable assignments affect the current +shell environment. Otherwise, the variables are added to the environment +of the executed command and do not affect the current shell environment. +If any of the assignments attempts to assign a value to a readonly variable, +an error occurs, and the command exits with a non-zero status. +.PP +If no command name results, redirections are performed, but do not +affect the current shell environment. A redirection error causes the +command to exit with a non-zero status. +.PP +If there is a command name left after expansion, execution proceeds as +described below. Otherwise, the command exits. If one of the expansions +contained a command substitution, the exit status of the command is +the exit status of the last command substitution performed. If there +were no command substitutions, the command exits with a status of zero. +.SH "COMMAND EXECUTION" +After a command has been split into words, if it results in a +simple command and an optional list of arguments, the following +actions are taken. +.PP +If the command name contains no slashes, the shell attempts to +locate it. If there exists a shell function by that name, that +function is invoked as described above in +.SM +.BR FUNCTIONS . +If the name does not match a function, the shell searches for +it in the list of shell builtins. If a match is found, that +builtin is invoked. +.PP +If the name is neither a shell function nor a builtin, +and contains no slashes, +.B bash +searches each element of the +.SM +.B PATH +for a directory containing an executable file by that name. +.B Bash +uses a hash table to remember the full pathnames of executable +files (see +.B hash +under +.SM +.B "SHELL BUILTIN COMMANDS" +below). +A full search of the directories in +.SM +.B PATH +is performed only if the command is not found in the hash table. +If the search is unsuccessful, the shell searches for a defined shell +function named \fBcommand_not_found_handle\fP. +If that function exists, it is invoked with the original command and +the original command's arguments as its arguments, and the function's +exit status becomes the exit status of the shell. +If that function is not defined, the shell prints an error +message and returns an exit status of 127. +.PP +If the search is successful, or if the command name contains +one or more slashes, the shell executes the named program in a +separate execution environment. +Argument 0 is set to the name given, and the remaining arguments +to the command are set to the arguments given, if any. +.PP +If this execution fails because the file is not in executable +format, and the file is not a directory, it is assumed to be +a \fIshell script\fP, a file +containing shell commands. A subshell is spawned to execute +it. This subshell reinitializes itself, so +that the effect is as if a new shell had been invoked +to handle the script, with the exception that the locations of +commands remembered by the parent (see +.B hash +below under +.SM +\fBSHELL BUILTIN COMMANDS\fP) +are retained by the child. +.PP +If the program is a file beginning with +.BR #! , +the remainder of the first line specifies an interpreter +for the program. The shell executes the +specified interpreter on operating systems that do not +handle this executable format themselves. The arguments to the +interpreter consist of a single optional argument following the +interpreter name on the first line of the program, followed +by the name of the program, followed by the command +arguments, if any. +.SH COMMAND EXECUTION ENVIRONMENT +The shell has an \fIexecution environment\fP, which consists of the +following: +.IP \(bu +open files inherited by the shell at invocation, as modified by +redirections supplied to the \fBexec\fP builtin +.IP \(bu +the current working directory as set by \fBcd\fP, \fBpushd\fP, or +\fBpopd\fP, or inherited by the shell at invocation +.IP \(bu +the file creation mode mask as set by \fBumask\fP or inherited from +the shell's parent +.IP \(bu +current traps set by \fBtrap\fP +.IP \(bu +shell parameters that are set by variable assignment or with \fBset\fP +or inherited from the shell's parent in the environment +.IP \(bu +shell functions defined during execution or inherited from the shell's +parent in the environment +.IP \(bu +options enabled at invocation (either by default or with command-line +arguments) or by \fBset\fP +.IP \(bu +options enabled by \fBshopt\fP +.IP \(bu +shell aliases defined with \fBalias\fP +.IP \(bu +various process IDs, including those of background jobs, the value +of \fB$$\fP, and the value of +.SM +.B PPID +.PP +When a simple command other than a builtin or shell function +is to be executed, it +is invoked in a separate execution environment that consists of +the following. Unless otherwise noted, the values are inherited +from the shell. +.if n .sp 1 +.IP \(bu +the shell's open files, plus any modifications and additions specified +by redirections to the command +.IP \(bu +the current working directory +.IP \(bu +the file creation mode mask +.IP \(bu +shell variables and functions marked for export, along with variables +exported for the command, passed in the environment +.IP \(bu +traps caught by the shell are reset to the values inherited from the +shell's parent, and traps ignored by the shell are ignored +.PP +A command invoked in this separate environment cannot affect the +shell's execution environment. +.PP +Command substitution, commands grouped with parentheses, +and asynchronous commands are invoked in a +subshell environment that is a duplicate of the shell environment, +except that traps caught by the shell are reset to the values +that the shell inherited from its parent at invocation. Builtin +commands that are invoked as part of a pipeline are also executed in a +subshell environment. Changes made to the subshell environment +cannot affect the shell's execution environment. +.PP +Subshells spawned to execute command substitutions inherit the value of +the \fB\-e\fP option from the parent shell. When not in \fIposix\fP mode, +\fBbash\fP clears the \fB\-e\fP option in such subshells. +.PP +If a command is followed by a \fB&\fP and job control is not active, the +default standard input for the command is the empty file \fI/dev/null\fP. +Otherwise, the invoked command inherits the file descriptors of the calling +shell as modified by redirections. +.SH ENVIRONMENT +When a program is invoked it is given an array of strings +called the +.IR environment . +This is a list of +\fIname\fP\-\fIvalue\fP pairs, of the form +.IR "name\fR=\fPvalue" . +.PP +The shell provides several ways to manipulate the environment. +On invocation, the shell scans its own environment and +creates a parameter for each name found, automatically marking +it for +.I export +to child processes. Executed commands inherit the environment. +The +.B export +and +.B declare \-x +commands allow parameters and functions to be added to and +deleted from the environment. If the value of a parameter +in the environment is modified, the new value becomes part +of the environment, replacing the old. The environment +inherited by any executed command consists of the shell's +initial environment, whose values may be modified in the shell, +less any pairs removed by the +.B unset +command, plus any additions via the +.B export +and +.B declare \-x +commands. +.PP +The environment for any +.I simple command +or function may be augmented temporarily by prefixing it with +parameter assignments, as described above in +.SM +.BR PARAMETERS . +These assignment statements affect only the environment seen +by that command. +.PP +If the +.B \-k +option is set (see the +.B set +builtin command below), then +.I all +parameter assignments are placed in the environment for a command, +not just those that precede the command name. +.PP +When +.B bash +invokes an external command, the variable +.B _ +is set to the full filename of the command and passed to that +command in its environment. +.SH "EXIT STATUS" +.PP +The exit status of an executed command is the value returned by the +\fIwaitpid\fP system call or equivalent function. Exit statuses +fall between 0 and 255, though, as explained below, the shell may +use values above 125 specially. Exit statuses from shell builtins and +compound commands are also limited to this range. Under certain +circumstances, the shell will use special values to indicate specific +failure modes. +.PP +For the shell's purposes, a command which exits with a +zero exit status has succeeded. An exit status of zero +indicates success. A non-zero exit status indicates failure. +When a command terminates on a fatal signal \fIN\fP, \fBbash\fP uses +the value of 128+\fIN\fP as the exit status. +.PP +If a command is not found, the child process created to +execute it returns a status of 127. If a command is found +but is not executable, the return status is 126. +.PP +If a command fails because of an error during expansion or redirection, +the exit status is greater than zero. +.PP +Shell builtin commands return a status of 0 (\fItrue\fP) if +successful, and non-zero (\fIfalse\fP) if an error occurs +while they execute. +All builtins return an exit status of 2 to indicate incorrect usage. +.PP +\fBBash\fP itself returns the exit status of the last command +executed, unless a syntax error occurs, in which case it exits +with a non-zero value. See also the \fBexit\fP builtin +command below. +.SH SIGNALS +When \fBbash\fP is interactive, in the absence of any traps, it ignores +.SM +.B SIGTERM +(so that \fBkill 0\fP does not kill an interactive shell), +and +.SM +.B SIGINT +is caught and handled (so that the \fBwait\fP builtin is interruptible). +In all cases, \fBbash\fP ignores +.SM +.BR SIGQUIT . +If job control is in effect, +.B bash +ignores +.SM +.BR SIGTTIN , +.SM +.BR SIGTTOU , +and +.SM +.BR SIGTSTP . +.PP +Non-builtin commands run by \fBbash\fP have signal handlers +set to the values inherited by the shell from its parent. +When job control is not in effect, asynchronous commands +ignore +.SM +.B SIGINT +and +.SM +.B SIGQUIT +in addition to these inherited handlers. +Commands run as a result of command substitution ignore the +keyboard-generated job control signals +.SM +.BR SIGTTIN , +.SM +.BR SIGTTOU , +and +.SM +.BR SIGTSTP . +.PP +The shell exits by default upon receipt of a +.SM +.BR SIGHUP . +Before exiting, an interactive shell resends the +.SM +.B SIGHUP +to all jobs, running or stopped. +Stopped jobs are sent +.SM +.B SIGCONT +to ensure that they receive the +.SM +.BR SIGHUP . +To prevent the shell from +sending the signal to a particular job, it should be removed from the +jobs table with the +.B disown +builtin (see +.SM +.B "SHELL BUILTIN COMMANDS" +below) or marked +to not receive +.SM +.B SIGHUP +using +.BR "disown \-h" . +.PP +If the +.B huponexit +shell option has been set with +.BR shopt , +.B bash +sends a +.SM +.B SIGHUP +to all jobs when an interactive login shell exits. +.PP +If \fBbash\fP is waiting for a command to complete and receives a signal +for which a trap has been set, the trap will not be executed until +the command completes. +When \fBbash\fP is waiting for an asynchronous command via the \fBwait\fP +builtin, the reception of a signal for which a trap has been set will +cause the \fBwait\fP builtin to return immediately with an exit status +greater than 128, immediately after which the trap is executed. +.SH "JOB CONTROL" +.I Job control +refers to the ability to selectively stop (\fIsuspend\fP) +the execution of processes and continue (\fIresume\fP) +their execution at a later point. A user typically employs +this facility via an interactive interface supplied jointly +by the operating system kernel's terminal driver and +.BR bash . +.PP +The shell associates a +.I job +with each pipeline. It keeps a table of currently executing +jobs, which may be listed with the +.B jobs +command. When +.B bash +starts a job asynchronously (in the +.IR background ), +it prints a line that looks like: +.RS +.PP +[1] 25647 +.RE +.PP +indicating that this job is job number 1 and that the process ID +of the last process in the pipeline associated with this job is 25647. +All of the processes in a single pipeline are members of the same job. +.B Bash +uses the +.I job +abstraction as the basis for job control. +.PP +To facilitate the implementation of the user interface to job +control, the operating system maintains the notion of a \fIcurrent terminal +process group ID\fP. Members of this process group (processes whose +process group ID is equal to the current terminal process group ID) +receive keyboard-generated signals such as +.SM +.BR SIGINT . +These processes are said to be in the +.IR foreground . +.I Background +processes are those whose process group ID differs from the terminal's; +such processes are immune to keyboard-generated signals. +Only foreground processes are allowed to read from or, if the +user so specifies with \f(CWstty tostop\fP, write to the +terminal. +Background processes which attempt to read from (write to when +\f(CWstty tostop\fP is in effect) the +terminal are sent a +.SM +.B SIGTTIN (SIGTTOU) +signal by the kernel's terminal driver, +which, unless caught, suspends the process. +.PP +If the operating system on which +.B bash +is running supports +job control, +.B bash +contains facilities to use it. +Typing the +.I suspend +character (typically +.BR ^Z , +Control-Z) while a process is running +causes that process to be stopped and returns control to +.BR bash . +Typing the +.I "delayed suspend" +character (typically +.BR ^Y , +Control-Y) causes the process to be stopped when it +attempts to read input from the terminal, and control to +be returned to +.BR bash . +The user may then manipulate the state of this job, using the +.B bg +command to continue it in the background, the +.B fg +command to continue it in the foreground, or +the +.B kill +command to kill it. A \fB^Z\fP takes effect immediately, +and has the additional side effect of causing pending output +and typeahead to be discarded. +.PP +There are a number of ways to refer to a job in the shell. +The character +.B % +introduces a job specification (\fIjobspec\fP). Job number +.I n +may be referred to as +.BR %n . +A job may also be referred to using a prefix of the name used to +start it, or using a substring that appears in its command line. +For example, +.B %ce +refers to a stopped +.B ce +job. If a prefix matches more than one job, +.B bash +reports an error. Using +.BR %?ce , +on the other hand, refers to any job containing the string +.B ce +in its command line. If the substring matches more than one job, +.B bash +reports an error. The symbols +.B %% +and +.B %+ +refer to the shell's notion of the +.IR "current job" , +which is the last job stopped while it was in +the foreground or started in the background. +The +.I "previous job" +may be referenced using +.BR %\- . +If there is only a single job, \fB%+\fP and \fB%\-\fP can both be used +to refer to that job. +In output pertaining to jobs (e.g., the output of the +.B jobs +command), the current job is always flagged with a +.BR + , +and the previous job with a +.BR \- . +A single % (with no accompanying job specification) also refers to the +current job. +.PP +Simply naming a job can be used to bring it into the +foreground: +.B %1 +is a synonym for +\fB``fg %1''\fP, +bringing job 1 from the background into the foreground. +Similarly, +.B ``%1 &'' +resumes job 1 in the background, equivalent to +\fB``bg %1''\fP. +.PP +The shell learns immediately whenever a job changes state. +Normally, +.B bash +waits until it is about to print a prompt before reporting +changes in a job's status so as to not interrupt +any other output. If the +.B \-b +option to the +.B set +builtin command +is enabled, +.B bash +reports such changes immediately. +Any trap on +.SM +.B SIGCHLD +is executed for each child that exits. +.PP +If an attempt to exit +.B bash +is made while jobs are stopped (or, if the \fBcheckjobs\fP shell option has +been enabled using the \fBshopt\fP builtin, running), the shell prints a +warning message, and, if the \fBcheckjobs\fP option is enabled, lists the +jobs and their statuses. +The +.B jobs +command may then be used to inspect their status. +If a second attempt to exit is made without an intervening command, +the shell does not print another warning, and any stopped +jobs are terminated. +.SH PROMPTING +When executing interactively, +.B bash +displays the primary prompt +.SM +.B PS1 +when it is ready to read a command, and the secondary prompt +.SM +.B PS2 +when it needs more input to complete a command. +.B Bash +allows these prompt strings to be customized by inserting a number of +backslash-escaped special characters that are decoded as follows: +.RS +.PD 0 +.TP +.B \ea +an ASCII bell character (07) +.TP +.B \ed +the date in "Weekday Month Date" format (e.g., "Tue May 26") +.TP +.B \eD{\fIformat\fP} +the \fIformat\fP is passed to \fIstrftime\fP(3) and the result is inserted +into the prompt string; an empty \fIformat\fP results in a locale-specific +time representation. The braces are required +.TP +.B \ee +an ASCII escape character (033) +.TP +.B \eh +the hostname up to the first `.' +.TP +.B \eH +the hostname +.TP +.B \ej +the number of jobs currently managed by the shell +.TP +.B \el +the basename of the shell's terminal device name +.TP +.B \en +newline +.TP +.B \er +carriage return +.TP +.B \es +the name of the shell, the basename of +.B $0 +(the portion following the final slash) +.TP +.B \et +the current time in 24-hour HH:MM:SS format +.TP +.B \eT +the current time in 12-hour HH:MM:SS format +.TP +.B \e@ +the current time in 12-hour am/pm format +.TP +.B \eA +the current time in 24-hour HH:MM format +.TP +.B \eu +the username of the current user +.TP +.B \ev +the version of \fBbash\fP (e.g., 2.00) +.TP +.B \eV +the release of \fBbash\fP, version + patch level (e.g., 2.00.0) +.TP +.B \ew +the current working directory, with +.SM +.B $HOME +abbreviated with a tilde +(uses the value of the +.SM +.B PROMPT_DIRTRIM +variable) +.TP +.B \eW +the basename of the current working directory, with +.SM +.B $HOME +abbreviated with a tilde +.TP +.B \e! +the history number of this command +.TP +.B \e# +the command number of this command +.TP +.B \e$ +if the effective UID is 0, a +.BR # , +otherwise a +.B $ +.TP +.B \e\fInnn\fP +the character corresponding to the octal number \fInnn\fP +.TP +.B \e\e +a backslash +.TP +.B \e[ +begin a sequence of non-printing characters, which could be used to +embed a terminal control sequence into the prompt +.TP +.B \e] +end a sequence of non-printing characters +.PD +.RE +.PP +The command number and the history number are usually different: +the history number of a command is its position in the history +list, which may include commands restored from the history file +(see +.SM +.B HISTORY +below), while the command number is the position in the sequence +of commands executed during the current shell session. +After the string is decoded, it is expanded via +parameter expansion, command substitution, arithmetic +expansion, and quote removal, subject to the value of the +.B promptvars +shell option (see the description of the +.B shopt +command under +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.SH READLINE +This is the library that handles reading input when using an interactive +shell, unless the +.B \-\-noediting +option is given at shell invocation. +Line editing is also used when using the \fB\-e\fP option to the +\fBread\fP builtin. +By default, the line editing commands are similar to those of Emacs. +A vi-style line editing interface is also available. +Line editing can be enabled at any time using the +.B \-o emacs +or +.B \-o vi +options to the +.B set +builtin (see +.SM +.B SHELL BUILTIN COMMANDS +below). +To turn off line editing after the shell is running, use the +.B +o emacs +or +.B +o vi +options to the +.B set +builtin. +.SS "Readline Notation" +.PP +In this section, the Emacs-style notation is used to denote +keystrokes. Control keys are denoted by C\-\fIkey\fR, e.g., C\-n +means Control\-N. Similarly, +.I meta +keys are denoted by M\-\fIkey\fR, so M\-x means Meta\-X. (On keyboards +without a +.I meta +key, M\-\fIx\fP means ESC \fIx\fP, i.e., press the Escape key +then the +.I x +key. This makes ESC the \fImeta prefix\fP. +The combination M\-C\-\fIx\fP means ESC\-Control\-\fIx\fP, +or press the Escape key +then hold the Control key while pressing the +.I x +key.) +.PP +Readline commands may be given numeric +.IR arguments , +which normally act as a repeat count. +Sometimes, however, it is the sign of the argument that is significant. +Passing a negative argument to a command that acts in the forward +direction (e.g., \fBkill\-line\fP) causes that command to act in a +backward direction. +Commands whose behavior with arguments deviates from this are noted +below. +.PP +When a command is described as \fIkilling\fP text, the text +deleted is saved for possible future retrieval +(\fIyanking\fP). The killed text is saved in a +\fIkill ring\fP. Consecutive kills cause the text to be +accumulated into one unit, which can be yanked all at once. +Commands which do not kill text separate the chunks of text +on the kill ring. +.SS "Readline Initialization" +.PP +Readline is customized by putting commands in an initialization +file (the \fIinputrc\fP file). +The name of this file is taken from the value of the +.SM +.B INPUTRC +variable. If that variable is unset, the default is +.IR ~/.inputrc . +When a program which uses the readline library starts up, the +initialization file is read, and the key bindings and variables +are set. +There are only a few basic constructs allowed in the +readline initialization file. +Blank lines are ignored. +Lines beginning with a \fB#\fP are comments. +Lines beginning with a \fB$\fP indicate conditional constructs. +Other lines denote key bindings and variable settings. +.PP +The default key-bindings may be changed with an +.I inputrc +file. +Other programs that use this library may add their own commands +and bindings. +.PP +For example, placing +.RS +.PP +M\-Control\-u: universal\-argument +.RE +or +.RS +C\-Meta\-u: universal\-argument +.RE +into the +.I inputrc +would make M\-C\-u execute the readline command +.IR universal\-argument . +.PP +The following symbolic character names are recognized: +.IR RUBOUT , +.IR DEL , +.IR ESC , +.IR LFD , +.IR NEWLINE , +.IR RET , +.IR RETURN , +.IR SPC , +.IR SPACE , +and +.IR TAB . +.PP +In addition to command names, readline allows keys to be bound +to a string that is inserted when the key is pressed (a \fImacro\fP). +.SS "Readline Key Bindings" +.PP +The syntax for controlling key bindings in the +.I inputrc +file is simple. All that is required is the name of the +command or the text of a macro and a key sequence to which +it should be bound. The name may be specified in one of two ways: +as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP +prefixes, or as a key sequence. +.PP +When using the form \fBkeyname\fP:\^\fIfunction\-name\fP or \fImacro\fP, +.I keyname +is the name of a key spelled out in English. For example: +.sp +.RS +Control-u: universal\-argument +.br +Meta-Rubout: backward-kill-word +.br +Control-o: "> output" +.RE +.LP +In the above example, +.I C\-u +is bound to the function +.BR universal\-argument , +.I M\-DEL +is bound to the function +.BR backward\-kill\-word , +and +.I C\-o +is bound to run the macro +expressed on the right hand side (that is, to insert the text +.if t \f(CW> output\fP +.if n ``> output'' +into the line). +.PP +In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP, +.B keyseq +differs from +.B keyname +above in that strings denoting +an entire key sequence may be specified by placing the sequence +within double quotes. Some GNU Emacs style key escapes can be +used, as in the following example, but the symbolic character names +are not recognized. +.sp +.RS +"\eC\-u": universal\-argument +.br +"\eC\-x\eC\-r": re\-read\-init\-file +.br +"\ee[11~": "Function Key 1" +.RE +.PP +In this example, +.I C\-u +is again bound to the function +.BR universal\-argument . +.I "C\-x C\-r" +is bound to the function +.BR re\-read\-init\-file , +and +.I "ESC [ 1 1 ~" +is bound to insert the text +.if t \f(CWFunction Key 1\fP. +.if n ``Function Key 1''. +.PP +The full set of GNU Emacs style escape sequences is +.RS +.PD 0 +.TP +.B \eC\- +control prefix +.TP +.B \eM\- +meta prefix +.TP +.B \ee +an escape character +.TP +.B \e\e +backslash +.TP +.B \e" +literal " +.TP +.B \e\(aq +literal \(aq +.RE +.PD +.PP +In addition to the GNU Emacs style escape sequences, a second +set of backslash escapes is available: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ed +delete +.TP +.B \ef +form feed +.TP +.B \en +newline +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(one to three digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.RE +.PD +.PP +When entering the text of a macro, single or double quotes must +be used to indicate a macro definition. +Unquoted text is assumed to be a function name. +In the macro body, the backslash escapes described above are expanded. +Backslash will quote any other character in the macro text, +including " and \(aq. +.PP +.B Bash +allows the current readline key bindings to be displayed or modified +with the +.B bind +builtin command. The editing mode may be switched during interactive +use by using the +.B \-o +option to the +.B set +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SS "Readline Variables" +.PP +Readline has variables that can be used to further customize its +behavior. A variable may be set in the +.I inputrc +file with a statement of the form +.RS +.PP +\fBset\fP \fIvariable\-name\fP \fIvalue\fP +.RE +.PP +Except where noted, readline variables can take the values +.B On +or +.B Off +(without regard to case). +Unrecognized variable names are ignored. +When a variable value is read, empty or null values, "on" (case-insensitive), +and "1" are equivalent to \fBOn\fP. All other values are equivalent to +\fBOff\fP. +The variables and their default values are: +.PP +.PD 0 +.TP +.B bell\-style (audible) +Controls what happens when readline wants to ring the terminal bell. +If set to \fBnone\fP, readline never rings the bell. If set to +\fBvisible\fP, readline uses a visible bell if one is available. +If set to \fBaudible\fP, readline attempts to ring the terminal's bell. +.TP +.B bind\-tty\-special\-chars (On) +If set to \fBOn\fP, readline attempts to bind the control characters +treated specially by the kernel's terminal driver to their readline +equivalents. +.TP +.B colored\-stats (Off) +If set to \fBOn\fP, readline displays possible completions using different +colors to indicate their file type. +The color definitions are taken from the value of the \fBLS_COLORS\fP +environment variable. +.TP +.B comment\-begin (``#'') +The string that is inserted when the readline +.B insert\-comment +command is executed. +This command is bound to +.B M\-# +in emacs mode and to +.B # +in vi command mode. +.TP +.B completion\-ignore\-case (Off) +If set to \fBOn\fP, readline performs filename matching and completion +in a case\-insensitive fashion. +.TP +.B completion\-prefix\-display\-length (0) +The length in characters of the common prefix of a list of possible +completions that is displayed without modification. When set to a +value greater than zero, common prefixes longer than this value are +replaced with an ellipsis when displaying possible completions. +.TP +.B completion\-query\-items (100) +This determines when the user is queried about viewing +the number of possible completions +generated by the \fBpossible\-completions\fP command. +It may be set to any integer value greater than or equal to +zero. If the number of possible completions is greater than +or equal to the value of this variable, the user is asked whether +or not he wishes to view them; otherwise they are simply listed +on the terminal. +.TP +.B convert\-meta (On) +If set to \fBOn\fP, readline will convert characters with the +eighth bit set to an ASCII key sequence +by stripping the eighth bit and prefixing an +escape character (in effect, using escape as the \fImeta prefix\fP). +.TP +.B disable\-completion (Off) +If set to \fBOn\fP, readline will inhibit word completion. Completion +characters will be inserted into the line as if they had been +mapped to \fBself-insert\fP. +.TP +.B editing\-mode (emacs) +Controls whether readline begins with a set of key bindings similar +to \fIEmacs\fP or \fIvi\fP. +.B editing\-mode +can be set to either +.B emacs +or +.BR vi . +.TP +.B echo\-control\-characters (On) +When set to \fBOn\fP, on operating systems that indicate they support it, +readline echoes a character corresponding to a signal generated from the +keyboard. +.TP +.B enable\-keypad (Off) +When set to \fBOn\fP, readline will try to enable the application +keypad when it is called. Some systems need this to enable the +arrow keys. +.TP +.B enable\-meta\-key (On) +When set to \fBOn\fP, readline will try to enable any meta modifier +key the terminal claims to support when it is called. On many terminals, +the meta key is used to send eight-bit characters. +.TP +.B expand\-tilde (Off) +If set to \fBOn\fP, tilde expansion is performed when readline +attempts word completion. +.TP +.B history\-preserve\-point (Off) +If set to \fBOn\fP, the history code attempts to place point at the +same location on each history line retrieved with \fBprevious-history\fP +or \fBnext-history\fP. +.TP +.B history\-size (0) +Set the maximum number of history entries saved in the history list. +If set to zero, any existing history entries are deleted and no new entries +are saved. +If set to a value less than zero, the number of history entries is not +limited. +By default, the number of history entries is not limited. +.TP +.B horizontal\-scroll\-mode (Off) +When set to \fBOn\fP, makes readline use a single line for display, +scrolling the input horizontally on a single screen line when it +becomes longer than the screen width rather than wrapping to a new line. +.TP +.B input\-meta (Off) +If set to \fBOn\fP, readline will enable eight-bit input (that is, +it will not strip the high bit from the characters it reads), +regardless of what the terminal claims it can support. The name +.B meta\-flag +is a synonym for this variable. +.TP +.B isearch\-terminators (``C\-[C\-J'') +The string of characters that should terminate an incremental +search without subsequently executing the character as a command. +If this variable has not been given a value, the characters +\fIESC\fP and \fIC\-J\fP will terminate an incremental search. +.TP +.B keymap (emacs) +Set the current readline keymap. The set of valid keymap names is +\fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi, +vi\-command\fP, and +.IR vi\-insert . +\fIvi\fP is equivalent to \fIvi\-command\fP; \fIemacs\fP is +equivalent to \fIemacs\-standard\fP. The default value is +.IR emacs ; +the value of +.B editing\-mode +also affects the default keymap. +.TP +.B keyseq\-timeout (500) +Specifies the duration \fIreadline\fP will wait for a character when reading an +ambiguous key sequence (one that can form a complete key sequence using +the input read so far, or can take additional input to complete a longer +key sequence). +If no input is received within the timeout, \fIreadline\fP will use the shorter +but complete key sequence. +The value is specified in milliseconds, so a value of 1000 means that +\fIreadline\fP will wait one second for additional input. +If this variable is set to a value less than or equal to zero, or to a +non-numeric value, \fIreadline\fP will wait until another key is pressed to +decide which key sequence to complete. +.TP +.B mark\-directories (On) +If set to \fBOn\fP, completed directory names have a slash +appended. +.TP +.B mark\-modified\-lines (Off) +If set to \fBOn\fP, history lines that have been modified are displayed +with a preceding asterisk (\fB*\fP). +.TP +.B mark\-symlinked\-directories (Off) +If set to \fBOn\fP, completed names which are symbolic links to directories +have a slash appended (subject to the value of +\fBmark\-directories\fP). +.TP +.B match\-hidden\-files (On) +This variable, when set to \fBOn\fP, causes readline to match files whose +names begin with a `.' (hidden files) when performing filename +completion. +If set to \fBOff\fP, the leading `.' must be +supplied by the user in the filename to be completed. +.TP +.B menu\-complete\-display\-prefix (Off) +If set to \fBOn\fP, menu completion displays the common prefix of the +list of possible completions (which may be empty) before cycling through +the list. +.TP +.B output\-meta (Off) +If set to \fBOn\fP, readline will display characters with the +eighth bit set directly rather than as a meta-prefixed escape +sequence. +.TP +.B page\-completions (On) +If set to \fBOn\fP, readline uses an internal \fImore\fP-like pager +to display a screenful of possible completions at a time. +.TP +.B print\-completions\-horizontally (Off) +If set to \fBOn\fP, readline will display completions with matches +sorted horizontally in alphabetical order, rather than down the screen. +.TP +.B revert\-all\-at\-newline (Off) +If set to \fBOn\fP, readline will undo all changes to history lines +before returning when \fBaccept\-line\fP is executed. By default, +history lines may be modified and retain individual undo lists across +calls to \fBreadline\fP. +.TP +.B show\-all\-if\-ambiguous (Off) +This alters the default behavior of the completion functions. If +set to +.BR On , +words which have more than one possible completion cause the +matches to be listed immediately instead of ringing the bell. +.TP +.B show\-all\-if\-unmodified (Off) +This alters the default behavior of the completion functions in +a fashion similar to \fBshow\-all\-if\-ambiguous\fP. +If set to +.BR On , +words which have more than one possible completion without any +possible partial completion (the possible completions don't share +a common prefix) cause the matches to be listed immediately instead +of ringing the bell. +.TP +.B show\-mode\-in\-prompt (Off) +If set to \fBOn\fP, add a character to the beginning of the prompt +indicating the editing mode: emacs (@), vi command (:) or vi +insertion (+). +.TP +.B skip\-completed\-text (Off) +If set to \fBOn\fP, this alters the default completion behavior when +inserting a single match into the line. It's only active when +performing completion in the middle of a word. If enabled, readline +does not insert characters from the completion that match characters +after point in the word being completed, so portions of the word +following the cursor are not duplicated. +.TP +.B visible\-stats (Off) +If set to \fBOn\fP, a character denoting a file's type as reported +by \fIstat\fP(2) is appended to the filename when listing possible +completions. +.PD +.SS "Readline Conditional Constructs" +.PP +Readline implements a facility similar in spirit to the conditional +compilation features of the C preprocessor which allows key +bindings and variable settings to be performed as the result +of tests. There are four parser directives used. +.IP \fB$if\fP +The +.B $if +construct allows bindings to be made based on the +editing mode, the terminal being used, or the application using +readline. The text of the test extends to the end of the line; +no characters are required to isolate it. +.RS +.IP \fBmode\fP +The \fBmode=\fP form of the \fB$if\fP directive is used to test +whether readline is in emacs or vi mode. +This may be used in conjunction +with the \fBset keymap\fP command, for instance, to set bindings in +the \fIemacs\-standard\fP and \fIemacs\-ctlx\fP keymaps only if +readline is starting out in emacs mode. +.IP \fBterm\fP +The \fBterm=\fP form may be used to include terminal-specific +key bindings, perhaps to bind the key sequences output by the +terminal's function keys. The word on the right side of the +.B = +is tested against the both full name of the terminal and the portion +of the terminal name before the first \fB\-\fP. This allows +.I sun +to match both +.I sun +and +.IR sun\-cmd , +for instance. +.IP \fBapplication\fP +The \fBapplication\fP construct is used to include +application-specific settings. Each program using the readline +library sets the \fIapplication name\fP, and an initialization +file can test for a particular value. +This could be used to bind key sequences to functions useful for +a specific program. For instance, the following command adds a +key sequence that quotes the current or previous word in \fBbash\fP: +.sp 1 +.RS +.nf +\fB$if\fP Bash +# Quote the current or previous word +"\eC\-xq": "\eeb\e"\eef\e"" +\fB$endif\fP +.fi +.RE +.RE +.IP \fB$endif\fP +This command, as seen in the previous example, terminates an +\fB$if\fP command. +.IP \fB$else\fP +Commands in this branch of the \fB$if\fP directive are executed if +the test fails. +.IP \fB$include\fP +This directive takes a single filename as an argument and reads commands +and bindings from that file. For example, the following directive +would read \fI/etc/inputrc\fP: +.sp 1 +.RS +.nf +\fB$include\fP \^ \fI/etc/inputrc\fP +.fi +.RE +.SS Searching +.PP +Readline provides commands for searching through the command history +(see +.SM +.B HISTORY +below) for lines containing a specified string. +There are two search modes: +.I incremental +and +.IR non-incremental . +.PP +Incremental searches begin before the user has finished typing the +search string. +As each character of the search string is typed, readline displays +the next entry from the history matching the string typed so far. +An incremental search requires only as many characters as needed to +find the desired history entry. +The characters present in the value of the \fBisearch-terminators\fP +variable are used to terminate an incremental search. +If that variable has not been assigned a value the Escape and +Control-J characters will terminate an incremental search. +Control-G will abort an incremental search and restore the original +line. +When the search is terminated, the history entry containing the +search string becomes the current line. +.PP +To find other matching entries in the history list, type Control-S or +Control-R as appropriate. +This will search backward or forward in the history for the next +entry matching the search string typed so far. +Any other key sequence bound to a readline command will terminate +the search and execute that command. +For instance, a \fInewline\fP will terminate the search and accept +the line, thereby executing the command from the history list. +.PP +Readline remembers the last incremental search string. If two +Control-Rs are typed without any intervening characters defining a +new search string, any remembered search string is used. +.PP +Non-incremental searches read the entire search string before starting +to search for matching history lines. The search string may be +typed by the user or be part of the contents of the current line. +.SS "Readline Command Names" +.PP +The following is a list of the names of the commands and the default +key sequences to which they are bound. +Command names without an accompanying key sequence are unbound by default. +In the following descriptions, \fIpoint\fP refers to the current cursor +position, and \fImark\fP refers to a cursor position saved by the +\fBset\-mark\fP command. +The text between the point and mark is referred to as the \fIregion\fP. +.SS Commands for Moving +.PP +.PD 0 +.TP +.B beginning\-of\-line (C\-a) +Move to the start of the current line. +.TP +.B end\-of\-line (C\-e) +Move to the end of the line. +.TP +.B forward\-char (C\-f) +Move forward a character. +.TP +.B backward\-char (C\-b) +Move back a character. +.TP +.B forward\-word (M\-f) +Move forward to the end of the next word. Words are composed of +alphanumeric characters (letters and digits). +.TP +.B backward\-word (M\-b) +Move back to the start of the current or previous word. +Words are composed of alphanumeric characters (letters and digits). +.TP +.B shell\-forward\-word +Move forward to the end of the next word. +Words are delimited by non-quoted shell metacharacters. +.TP +.B shell\-backward\-word +Move back to the start of the current or previous word. +Words are delimited by non-quoted shell metacharacters. +.TP +.B clear\-screen (C\-l) +Clear the screen leaving the current line at the top of the screen. +With an argument, refresh the current line without clearing the +screen. +.TP +.B redraw\-current\-line +Refresh the current line. +.PD +.SS Commands for Manipulating the History +.PP +.PD 0 +.TP +.B accept\-line (Newline, Return) +Accept the line regardless of where the cursor is. If this line is +non-empty, add it to the history list according to the state of the +.SM +.B HISTCONTROL +variable. If the line is a modified history +line, then restore the history line to its original state. +.TP +.B previous\-history (C\-p) +Fetch the previous command from the history list, moving back in +the list. +.TP +.B next\-history (C\-n) +Fetch the next command from the history list, moving forward in the +list. +.TP +.B beginning\-of\-history (M\-<) +Move to the first line in the history. +.TP +.B end\-of\-history (M\->) +Move to the end of the input history, i.e., the line currently being +entered. +.TP +.B reverse\-search\-history (C\-r) +Search backward starting at the current line and moving `up' through +the history as necessary. This is an incremental search. +.TP +.B forward\-search\-history (C\-s) +Search forward starting at the current line and moving `down' through +the history as necessary. This is an incremental search. +.TP +.B non\-incremental\-reverse\-search\-history (M\-p) +Search backward through the history starting at the current line +using a non-incremental search for a string supplied by the user. +.TP +.B non\-incremental\-forward\-search\-history (M\-n) +Search forward through the history using a non-incremental search for +a string supplied by the user. +.TP +.B history\-search\-forward +Search forward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +.TP +.B history\-search\-backward +Search backward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +.TP +.B yank\-nth\-arg (M\-C\-y) +Insert the first argument to the previous command (usually +the second word on the previous line) at point. +With an argument +.IR n , +insert the \fIn\fPth word from the previous command (the words +in the previous command begin with word 0). A negative argument +inserts the \fIn\fPth word from the end of the previous command. +Once the argument \fIn\fP is computed, the argument is extracted +as if the "!\fIn\fP" history expansion had been specified. +.TP +.B +yank\-last\-arg (M\-.\^, M\-_\^) +Insert the last argument to the previous command (the last word of +the previous history entry). +With a numeric argument, behave exactly like \fByank\-nth\-arg\fP. +Successive calls to \fByank\-last\-arg\fP move back through the history +list, inserting the last word (or the word specified by the argument to +the first call) of each line in turn. +Any numeric argument supplied to these successive calls determines +the direction to move through the history. A negative argument switches +the direction through the history (back or forward). +The history expansion facilities are used to extract the last word, +as if the "!$" history expansion had been specified. +.TP +.B shell\-expand\-line (M\-C\-e) +Expand the line as the shell does. This +performs alias and history expansion as well as all of the shell +word expansions. See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B history\-expand\-line (M\-^) +Perform history expansion on the current line. +See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B magic\-space +Perform history expansion on the current line and insert a space. +See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B alias\-expand\-line +Perform alias expansion on the current line. +See +.SM +.B ALIASES +above for a description of alias expansion. +.TP +.B history\-and\-alias\-expand\-line +Perform history and alias expansion on the current line. +.TP +.B insert\-last\-argument (M\-.\^, M\-_\^) +A synonym for \fByank\-last\-arg\fP. +.TP +.B operate\-and\-get\-next (C\-o) +Accept the current line for execution and fetch the next line +relative to the current line from the history for editing. Any +argument is ignored. +.TP +.B edit\-and\-execute\-command (C\-xC\-e) +Invoke an editor on the current command line, and execute the result as shell +commands. +\fBBash\fP attempts to invoke +.SM +.BR $VISUAL , +.SM +.BR $EDITOR , +and \fIemacs\fP as the editor, in that order. +.PD +.SS Commands for Changing Text +.PP +.PD 0 +.TP +.B \fIend\-of\-file\fP (usually C\-d) +The character indicating end-of-file as set, for example, by +.if t \f(CWstty\fP. +.if n ``stty''. +If this character is read when there are no characters +on the line, and point is at the beginning of the line, Readline +interprets it as the end of input and returns +.SM +.BR EOF . +.TP +.B delete\-char (C\-d) +Delete the character at point. +If this function is bound to the +same character as the tty \fBEOF\fP character, as \fBC\-d\fP +commonly is, see above for the effects. +.TP +.B backward\-delete\-char (Rubout) +Delete the character behind the cursor. When given a numeric argument, +save the deleted text on the kill ring. +.TP +.B forward\-backward\-delete\-char +Delete the character under the cursor, unless the cursor is at the +end of the line, in which case the character behind the cursor is +deleted. +.TP +.B quoted\-insert (C\-q, C\-v) +Add the next character typed to the line verbatim. This is +how to insert characters like \fBC\-q\fP, for example. +.TP +.B tab\-insert (C\-v TAB) +Insert a tab character. +.TP +.B self\-insert (a,\ b,\ A,\ 1,\ !,\ ...) +Insert the character typed. +.TP +.B transpose\-chars (C\-t) +Drag the character before point forward over the character at point, +moving point forward as well. +If point is at the end of the line, then this transposes +the two characters before point. +Negative arguments have no effect. +.TP +.B transpose\-words (M\-t) +Drag the word before point past the word after point, +moving point over that word as well. +If point is at the end of the line, this transposes +the last two words on the line. +.TP +.B upcase\-word (M\-u) +Uppercase the current (or following) word. With a negative argument, +uppercase the previous word, but do not move point. +.TP +.B downcase\-word (M\-l) +Lowercase the current (or following) word. With a negative argument, +lowercase the previous word, but do not move point. +.TP +.B capitalize\-word (M\-c) +Capitalize the current (or following) word. With a negative argument, +capitalize the previous word, but do not move point. +.TP +.B overwrite\-mode +Toggle overwrite mode. With an explicit positive numeric argument, +switches to overwrite mode. With an explicit non-positive numeric +argument, switches to insert mode. This command affects only +\fBemacs\fP mode; \fBvi\fP mode does overwrite differently. +Each call to \fIreadline()\fP starts in insert mode. +In overwrite mode, characters bound to \fBself\-insert\fP replace +the text at point rather than pushing the text to the right. +Characters bound to \fBbackward\-delete\-char\fP replace the character +before point with a space. By default, this command is unbound. +.PD +.SS Killing and Yanking +.PP +.PD 0 +.TP +.B kill\-line (C\-k) +Kill the text from point to the end of the line. +.TP +.B backward\-kill\-line (C\-x Rubout) +Kill backward to the beginning of the line. +.TP +.B unix\-line\-discard (C\-u) +Kill backward from point to the beginning of the line. +The killed text is saved on the kill-ring. +.\" There is no real difference between this and backward-kill-line +.TP +.B kill\-whole\-line +Kill all characters on the current line, no matter where point is. +.TP +.B kill\-word (M\-d) +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as those used by \fBforward\-word\fP. +.TP +.B backward\-kill\-word (M\-Rubout) +Kill the word behind point. +Word boundaries are the same as those used by \fBbackward\-word\fP. +.TP +.B shell\-kill\-word (M\-d) +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as those used by \fBshell\-forward\-word\fP. +.TP +.B shell\-backward\-kill\-word (M\-Rubout) +Kill the word behind point. +Word boundaries are the same as those used by \fBshell\-backward\-word\fP. +.TP +.B unix\-word\-rubout (C\-w) +Kill the word behind point, using white space as a word boundary. +The killed text is saved on the kill-ring. +.TP +.B unix\-filename\-rubout +Kill the word behind point, using white space and the slash character +as the word boundaries. +The killed text is saved on the kill-ring. +.TP +.B delete\-horizontal\-space (M\-\e) +Delete all spaces and tabs around point. +.TP +.B kill\-region +Kill the text in the current region. +.TP +.B copy\-region\-as\-kill +Copy the text in the region to the kill buffer. +.TP +.B copy\-backward\-word +Copy the word before point to the kill buffer. +The word boundaries are the same as \fBbackward\-word\fP. +.TP +.B copy\-forward\-word +Copy the word following point to the kill buffer. +The word boundaries are the same as \fBforward\-word\fP. +.TP +.B yank (C\-y) +Yank the top of the kill ring into the buffer at point. +.TP +.B yank\-pop (M\-y) +Rotate the kill ring, and yank the new top. Only works following +.B yank +or +.BR yank\-pop . +.PD +.SS Numeric Arguments +.PP +.PD 0 +.TP +.B digit\-argument (M\-0, M\-1, ..., M\-\-) +Add this digit to the argument already accumulating, or start a new +argument. M\-\- starts a negative argument. +.TP +.B universal\-argument +This is another way to specify an argument. +If this command is followed by one or more digits, optionally with a +leading minus sign, those digits define the argument. +If the command is followed by digits, executing +.B universal\-argument +again ends the numeric argument, but is otherwise ignored. +As a special case, if this command is immediately followed by a +character that is neither a digit or minus sign, the argument count +for the next command is multiplied by four. +The argument count is initially one, so executing this function the +first time makes the argument count four, a second time makes the +argument count sixteen, and so on. +.PD +.SS Completing +.PP +.PD 0 +.TP +.B complete (TAB) +Attempt to perform completion on the text before point. +.B Bash +attempts completion treating the text as a variable (if the +text begins with \fB$\fP), username (if the text begins with +\fB~\fP), hostname (if the text begins with \fB@\fP), or +command (including aliases and functions) in turn. If none +of these produces a match, filename completion is attempted. +.TP +.B possible\-completions (M\-?) +List the possible completions of the text before point. +.TP +.B insert\-completions (M\-*) +Insert all completions of the text before point +that would have been generated by +\fBpossible\-completions\fP. +.TP +.B menu\-complete +Similar to \fBcomplete\fP, but replaces the word to be completed +with a single match from the list of possible completions. +Repeated execution of \fBmenu\-complete\fP steps through the list +of possible completions, inserting each match in turn. +At the end of the list of completions, the bell is rung +(subject to the setting of \fBbell\-style\fP) +and the original text is restored. +An argument of \fIn\fP moves \fIn\fP positions forward in the list +of matches; a negative argument may be used to move backward +through the list. +This command is intended to be bound to \fBTAB\fP, but is unbound +by default. +.TP +.B menu\-complete\-backward +Identical to \fBmenu\-complete\fP, but moves backward through the list +of possible completions, as if \fBmenu\-complete\fP had been given a +negative argument. This command is unbound by default. +.TP +.B delete\-char\-or\-list +Deletes the character under the cursor if not at the beginning or +end of the line (like \fBdelete\-char\fP). +If at the end of the line, behaves identically to +\fBpossible\-completions\fP. +This command is unbound by default. +.TP +.B complete\-filename (M\-/) +Attempt filename completion on the text before point. +.TP +.B possible\-filename\-completions (C\-x /) +List the possible completions of the text before point, +treating it as a filename. +.TP +.B complete\-username (M\-~) +Attempt completion on the text before point, treating +it as a username. +.TP +.B possible\-username\-completions (C\-x ~) +List the possible completions of the text before point, +treating it as a username. +.TP +.B complete\-variable (M\-$) +Attempt completion on the text before point, treating +it as a shell variable. +.TP +.B possible\-variable\-completions (C\-x $) +List the possible completions of the text before point, +treating it as a shell variable. +.TP +.B complete\-hostname (M\-@) +Attempt completion on the text before point, treating +it as a hostname. +.TP +.B possible\-hostname\-completions (C\-x @) +List the possible completions of the text before point, +treating it as a hostname. +.TP +.B complete\-command (M\-!) +Attempt completion on the text before point, treating +it as a command name. Command completion attempts to +match the text against aliases, reserved words, shell +functions, shell builtins, and finally executable filenames, +in that order. +.TP +.B possible\-command\-completions (C\-x !) +List the possible completions of the text before point, +treating it as a command name. +.TP +.B dynamic\-complete\-history (M\-TAB) +Attempt completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +.TP +.B dabbrev\-expand +Attempt menu completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +.TP +.B complete\-into\-braces (M\-{) +Perform filename completion and insert the list of possible completions +enclosed within braces so the list is available to the shell (see +.B Brace Expansion +above). +.PD +.SS Keyboard Macros +.PP +.PD 0 +.TP +.B start\-kbd\-macro (C\-x (\^) +Begin saving the characters typed into the current keyboard macro. +.TP +.B end\-kbd\-macro (C\-x )\^) +Stop saving the characters typed into the current keyboard macro +and store the definition. +.TP +.B call\-last\-kbd\-macro (C\-x e) +Re-execute the last keyboard macro defined, by making the characters +in the macro appear as if typed at the keyboard. +.TP +.B print\-last\-kbd\-macro () +Print the last keyboard macro defined in a format suitable for the +\fIinputrc\fP file. +.PD +.SS Miscellaneous +.PP +.PD 0 +.TP +.B re\-read\-init\-file (C\-x C\-r) +Read in the contents of the \fIinputrc\fP file, and incorporate +any bindings or variable assignments found there. +.TP +.B abort (C\-g) +Abort the current editing command and +ring the terminal's bell (subject to the setting of +.BR bell\-style ). +.TP +.B do\-uppercase\-version (M\-a, M\-b, M\-\fIx\fP, ...) +If the metafied character \fIx\fP is lowercase, run the command +that is bound to the corresponding uppercase character. +.TP +.B prefix\-meta (ESC) +Metafy the next character typed. +.SM +.B ESC +.B f +is equivalent to +.BR Meta\-f . +.TP +.B undo (C\-_, C\-x C\-u) +Incremental undo, separately remembered for each line. +.TP +.B revert\-line (M\-r) +Undo all changes made to this line. This is like executing the +.B undo +command enough times to return the line to its initial state. +.TP +.B tilde\-expand (M\-&) +Perform tilde expansion on the current word. +.TP +.B set\-mark (C\-@, M\-) +Set the mark to the point. If a +numeric argument is supplied, the mark is set to that position. +.TP +.B exchange\-point\-and\-mark (C\-x C\-x) +Swap the point with the mark. The current cursor position is set to +the saved position, and the old cursor position is saved as the mark. +.TP +.B character\-search (C\-]) +A character is read and point is moved to the next occurrence of that +character. A negative count searches for previous occurrences. +.TP +.B character\-search\-backward (M\-C\-]) +A character is read and point is moved to the previous occurrence of that +character. A negative count searches for subsequent occurrences. +.TP +.B skip\-csi\-sequence +Read enough characters to consume a multi-key sequence such as those +defined for keys like Home and End. Such sequences begin with a +Control Sequence Indicator (CSI), usually ESC\-[. If this sequence is +bound to "\e[", keys producing such sequences will have no effect +unless explicitly bound to a readline command, instead of inserting +stray characters into the editing buffer. This is unbound by default, +but usually bound to ESC\-[. +.TP +.B insert\-comment (M\-#) +Without a numeric argument, the value of the readline +.B comment\-begin +variable is inserted at the beginning of the current line. +If a numeric argument is supplied, this command acts as a toggle: if +the characters at the beginning of the line do not match the value +of \fBcomment\-begin\fP, the value is inserted, otherwise +the characters in \fBcomment\-begin\fP are deleted from the beginning of +the line. +In either case, the line is accepted as if a newline had been typed. +The default value of +\fBcomment\-begin\fP causes this command to make the current line +a shell comment. +If a numeric argument causes the comment character to be removed, the line +will be executed by the shell. +.TP +.B glob\-complete\-word (M\-g) +The word before point is treated as a pattern for pathname expansion, +with an asterisk implicitly appended. This pattern is used to +generate a list of matching filenames for possible completions. +.TP +.B glob\-expand\-word (C\-x *) +The word before point is treated as a pattern for pathname expansion, +and the list of matching filenames is inserted, replacing the word. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +.TP +.B glob\-list\-expansions (C\-x g) +The list of expansions that would have been generated by +.B glob\-expand\-word +is displayed, and the line is redrawn. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +.TP +.B dump\-functions +Print all of the functions and their key bindings to the +readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B dump\-variables +Print all of the settable readline variables and their values to the +readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B dump\-macros +Print all of the readline key sequences bound to macros and the +strings they output. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B display\-shell\-version (C\-x C\-v) +Display version information about the current instance of +.BR bash . +.PD +.SS Programmable Completion +.PP +When word completion is attempted for an argument to a command for +which a completion specification (a \fIcompspec\fP) has been defined +using the \fBcomplete\fP builtin (see +.SM +.B "SHELL BUILTIN COMMANDS" +below), the programmable completion facilities are invoked. +.PP +First, the command name is identified. +If the command word is the empty string (completion attempted at the +beginning of an empty line), any compspec defined with +the \fB\-E\fP option to \fBcomplete\fP is used. +If a compspec has been defined for that command, the +compspec is used to generate the list of possible completions for the word. +If the command word is a full pathname, a compspec for the full +pathname is searched for first. +If no compspec is found for the full pathname, an attempt is made to +find a compspec for the portion following the final slash. +If those searches do not result in a compspec, any compspec defined with +the \fB\-D\fP option to \fBcomplete\fP is used as the default. +.PP +Once a compspec has been found, it is used to generate the list of +matching words. +If a compspec is not found, the default \fBbash\fP completion as +described above under \fBCompleting\fP is performed. +.PP +First, the actions specified by the compspec are used. +Only matches which are prefixed by the word being completed are +returned. +When the +.B \-f +or +.B \-d +option is used for filename or directory name completion, the shell +variable +.SM +.B FIGNORE +is used to filter the matches. +.PP +Any completions specified by a pathname expansion pattern to the +\fB\-G\fP option are generated next. +The words generated by the pattern need not match the word +being completed. +The +.SM +.B GLOBIGNORE +shell variable is not used to filter the matches, but the +.SM +.B FIGNORE +variable is used. +.PP +Next, the string specified as the argument to the \fB\-W\fP option +is considered. +The string is first split using the characters in the +.SM +.B IFS +special variable as delimiters. +Shell quoting is honored. +Each word is then expanded using +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, and arithmetic expansion, +as described above under +.SM +.BR EXPANSION . +The results are split using the rules described above under +\fBWord Splitting\fP. +The results of the expansion are prefix-matched against the word being +completed, and the matching words become the possible completions. +.PP +After these matches have been generated, any shell function or command +specified with the \fB\-F\fP and \fB\-C\fP options is invoked. +When the command or function is invoked, the +.SM +.BR COMP_LINE , +.SM +.BR COMP_POINT , +.SM +.BR COMP_KEY , +and +.SM +.B COMP_TYPE +variables are assigned values as described above under +\fBShell Variables\fP. +If a shell function is being invoked, the +.SM +.B COMP_WORDS +and +.SM +.B COMP_CWORD +variables are also set. +When the function or command is invoked, +the first argument (\fB$1\fP) is the name of the command whose arguments are +being completed, +the second argument (\fB$2\fP) is the word being completed, +and the third argument (\fB$3\fP) is the word preceding the word being +completed on the current command line. +No filtering of the generated completions against the word being completed +is performed; the function or command has complete freedom in generating +the matches. +.PP +Any function specified with \fB\-F\fP is invoked first. +The function may use any of the shell facilities, including the +\fBcompgen\fP builtin described below, to generate the matches. +It must put the possible completions in the +.SM +.B COMPREPLY +array variable, one per array element. +.PP +Next, any command specified with the \fB\-C\fP option is invoked +in an environment equivalent to command substitution. +It should print a list of completions, one per line, to the +standard output. +Backslash may be used to escape a newline, if necessary. +.PP +After all of the possible completions are generated, any filter +specified with the \fB\-X\fP option is applied to the list. +The filter is a pattern as used for pathname expansion; a \fB&\fP +in the pattern is replaced with the text of the word being completed. +A literal \fB&\fP may be escaped with a backslash; the backslash +is removed before attempting a match. +Any completion that matches the pattern will be removed from the list. +A leading \fB!\fP negates the pattern; in this case any completion +not matching the pattern will be removed. +.PP +Finally, any prefix and suffix specified with the \fB\-P\fP and \fB\-S\fP +options are added to each member of the completion list, and the result is +returned to the readline completion code as the list of possible +completions. +.PP +If the previously-applied actions do not generate any matches, and the +\fB\-o dirnames\fP option was supplied to \fBcomplete\fP when the +compspec was defined, directory name completion is attempted. +.PP +If the \fB\-o plusdirs\fP option was supplied to \fBcomplete\fP when the +compspec was defined, directory name completion is attempted and any +matches are added to the results of the other actions. +.PP +By default, if a compspec is found, whatever it generates is returned +to the completion code as the full set of possible completions. +The default \fBbash\fP completions are not attempted, and the readline +default of filename completion is disabled. +If the \fB\-o bashdefault\fP option was supplied to \fBcomplete\fP when +the compspec was defined, the \fBbash\fP default completions are attempted +if the compspec generates no matches. +If the \fB\-o default\fP option was supplied to \fBcomplete\fP when the +compspec was defined, readline's default completion will be performed +if the compspec (and, if attempted, the default \fBbash\fP completions) +generate no matches. +.PP +When a compspec indicates that directory name completion is desired, +the programmable completion functions force readline to append a slash +to completed names which are symbolic links to directories, subject to +the value of the \fBmark\-directories\fP readline variable, regardless +of the setting of the \fBmark-symlinked\-directories\fP readline variable. +.PP +There is some support for dynamically modifying completions. This is +most useful when used in combination with a default completion specified +with \fBcomplete -D\fP. +It's possible for shell functions executed as completion +handlers to indicate that completion should be retried by returning an +exit status of 124. If a shell function returns 124, and changes +the compspec associated with the command on which completion is being +attempted (supplied as the first argument when the function is executed), +programmable completion restarts from the beginning, with an +attempt to find a new compspec for that command. This allows a set of +completions to be built dynamically as completion is attempted, rather than +being loaded all at once. +.PP +For instance, assuming that there is a library of compspecs, each kept in a +file corresponding to the name of the command, the following default +completion function would load completions dynamically: +.PP +\f(CW_completion_loader() +.br +{ +.br + . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124 +.br +} +.br +complete -D -F _completion_loader -o bashdefault -o default +.br +\fP +.SH HISTORY +When the +.B \-o history +option to the +.B set +builtin is enabled, the shell provides access to the +\fIcommand history\fP, +the list of commands previously typed. +The value of the +.SM +.B HISTSIZE +variable is used as the +number of commands to save in a history list. +The text of the last +.SM +.B HISTSIZE +commands (default 500) is saved. The shell +stores each command in the history list prior to parameter and +variable expansion (see +.SM +.B EXPANSION +above) but after history expansion is performed, subject to the +values of the shell variables +.SM +.B HISTIGNORE +and +.SM +.BR HISTCONTROL . +.PP +On startup, the history is initialized from the file named by +the variable +.SM +.B HISTFILE +(default \fI~/.bash_history\fP). +The file named by the value of +.SM +.B HISTFILE +is truncated, if necessary, to contain no more than +the number of lines specified by the value of +.SM +.BR HISTFILESIZE . +If \fBHISTFILESIZE\fP is unset, or set to null, a non-numeric value, +or a numeric value less than zero, the history file is not truncated. +When the history file is read, +lines beginning with the history comment character followed immediately +by a digit are interpreted as timestamps for the preceding history line. +These timestamps are optionally displayed depending on the value of the +.SM +.B HISTTIMEFORMAT +variable. +When a shell with history enabled exits, the last +.SM +.B $HISTSIZE +lines are copied from the history list to +.SM +.BR $HISTFILE . +If the +.B histappend +shell option is enabled +(see the description of +.B shopt +under +.SM +.B "SHELL BUILTIN COMMANDS" +below), the lines are appended to the history file, +otherwise the history file is overwritten. +If +.SM +.B HISTFILE +is unset, or if the history file is unwritable, the history is +not saved. +If the +.SM +.B HISTTIMEFORMAT +variable is set, time stamps are written to the history file, marked +with the history comment character, so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +After saving the history, the history file is truncated +to contain no more than +.SM +.B HISTFILESIZE +lines. If +.SM +.B HISTFILESIZE +is unset, or set to null, a non-numeric value, +or a numeric value less than zero, the history file is not truncated. +.PP +The builtin command +.B fc +(see +.SM +.B SHELL BUILTIN COMMANDS +below) may be used to list or edit and re-execute a portion of +the history list. +The +.B history +builtin may be used to display or modify the history list and +manipulate the history file. +When using command-line editing, search commands +are available in each editing mode that provide access to the +history list. +.PP +The shell allows control over which commands are saved on the history +list. The +.SM +.B HISTCONTROL +and +.SM +.B HISTIGNORE +variables may be set to cause the shell to save only a subset of the +commands entered. +The +.B cmdhist +shell option, if enabled, causes the shell to attempt to save each +line of a multi-line command in the same history entry, adding +semicolons where necessary to preserve syntactic correctness. +The +.B lithist +shell option causes the shell to save the command with embedded newlines +instead of semicolons. See the description of the +.B shopt +builtin below under +.SM +.B "SHELL BUILTIN COMMANDS" +for information on setting and unsetting shell options. +.SH "HISTORY EXPANSION" +.PP +The shell supports a history expansion feature that +is similar to the history expansion in +.BR csh. +This section describes what syntax features are available. This +feature is enabled by default for interactive shells, and can be +disabled using the +.B +H +option to the +.B set +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). Non-interactive shells do not perform history expansion +by default. +.PP +History expansions introduce words from the history list into +the input stream, making it easy to repeat commands, insert the +arguments to a previous command into the current input line, or +fix errors in previous commands quickly. +.PP +History expansion is performed immediately after a complete line +is read, before the shell breaks it into words. +It takes place in two parts. +The first is to determine which line from the history list +to use during substitution. +The second is to select portions of that line for inclusion into +the current one. +The line selected from the history is the \fIevent\fP, +and the portions of that line that are acted upon are \fIwords\fP. +Various \fImodifiers\fP are available to manipulate the selected words. +The line is broken into words in the same fashion as when reading input, +so that several \fImetacharacter\fP-separated words surrounded by +quotes are considered one word. +History expansions are introduced by the appearance of the +history expansion character, which is \^\fB!\fP\^ by default. +Only backslash (\^\fB\e\fP\^) and single quotes can quote +the history expansion character. +.PP +Several characters inhibit history expansion if found immediately +following the history expansion character, even if it is unquoted: +space, tab, newline, carriage return, and \fB=\fP. +If the \fBextglob\fP shell option is enabled, \fB(\fP will also +inhibit expansion. +.PP +Several shell options settable with the +.B shopt +builtin may be used to tailor the behavior of history expansion. +If the +.B histverify +shell option is enabled (see the description of the +.B shopt +builtin below), and +.B readline +is being used, history substitutions are not immediately passed to +the shell parser. +Instead, the expanded line is reloaded into the +.B readline +editing buffer for further modification. +If +.B readline +is being used, and the +.B histreedit +shell option is enabled, a failed history substitution will be reloaded +into the +.B readline +editing buffer for correction. +The +.B \-p +option to the +.B history +builtin command may be used to see what a history expansion will +do before using it. +The +.B \-s +option to the +.B history +builtin may be used to add commands to the end of the history list +without actually executing them, so that they are available for +subsequent recall. +.PP +The shell allows control of the various characters used by the +history expansion mechanism (see the description of +.B histchars +above under +.BR "Shell Variables" ). +The shell uses +the history comment character to mark history timestamps when +writing the history file. +.SS Event Designators +.PP +An event designator is a reference to a command line entry in the +history list. +Unless the reference is absolute, events are relative to the current +position in the history list. +.PP +.PD 0 +.TP +.B ! +Start a history substitution, except when followed by a +.BR blank , +newline, carriage return, = +or ( (when the \fBextglob\fP shell option is enabled using +the \fBshopt\fP builtin). +.TP +.B !\fIn\fR +Refer to command line +.IR n . +.TP +.B !\-\fIn\fR +Refer to the current command minus +.IR n . +.TP +.B !! +Refer to the previous command. This is a synonym for `!\-1'. +.TP +.B !\fIstring\fR +Refer to the most recent command preceding the current position in the +history list starting with +.IR string . +.TP +.B !?\fIstring\fR\fB[?]\fR +Refer to the most recent command preceding the current position in the +history list containing +.IR string . +The trailing \fB?\fP may be omitted if +.I string +is followed immediately by a newline. +.TP +.B \d\s+2^\s-2\u\fIstring1\fP\d\s+2^\s-2\u\fIstring2\fP\d\s+2^\s-2\u +Quick substitution. Repeat the previous command, replacing +.I string1 +with +.IR string2 . +Equivalent to +``!!:s/\fIstring1\fP/\fIstring2\fP/'' +(see \fBModifiers\fP below). +.TP +.B !# +The entire command line typed so far. +.PD +.SS Word Designators +.PP +Word designators are used to select desired words from the event. +A +.B : +separates the event specification from the word designator. +It may be omitted if the word designator begins with a +.BR ^ , +.BR $ , +.BR * , +.BR \- , +or +.BR % . +Words are numbered from the beginning of the line, +with the first word being denoted by 0 (zero). +Words are inserted into the current line separated by single spaces. +.PP +.PD 0 +.TP +.B 0 (zero) +The zeroth word. For the shell, this is the command +word. +.TP +.I n +The \fIn\fRth word. +.TP +.B ^ +The first argument. That is, word 1. +.TP +.B $ +The last word. This is usually the last argument, but will expand to the +zeroth word if there is only one word in the line. +.TP +.B % +The word matched by the most recent `?\fIstring\fR?' search. +.TP +.I x\fB\-\fPy +A range of words; `\-\fIy\fR' abbreviates `0\-\fIy\fR'. +.TP +.B * +All of the words but the zeroth. This is a synonym +for `\fI1\-$\fP'. It is not an error to use +.B * +if there is just one +word in the event; the empty string is returned in that case. +.TP +.B x* +Abbreviates \fIx\-$\fP. +.TP +.B x\- +Abbreviates \fIx\-$\fP like \fBx*\fP, but omits the last word. +.PD +.PP +If a word designator is supplied without an event specification, the +previous command is used as the event. +.SS Modifiers +.PP +After the optional word designator, there may appear a sequence of +one or more of the following modifiers, each preceded by a `:'. +.PP +.PD 0 +.PP +.TP +.B h +Remove a trailing filename component, leaving only the head. +.TP +.B t +Remove all leading filename components, leaving the tail. +.TP +.B r +Remove a trailing suffix of the form \fI.xxx\fP, leaving the +basename. +.TP +.B e +Remove all but the trailing suffix. +.TP +.B p +Print the new command but do not execute it. +.TP +.B q +Quote the substituted words, escaping further substitutions. +.TP +.B x +Quote the substituted words as with +.BR q , +but break into words at +.B blanks +and newlines. +.TP +.B s/\fIold\fP/\fInew\fP/ +Substitute +.I new +for the first occurrence of +.I old +in the event line. Any delimiter can be used in place of /. The +final delimiter is optional if it is the last character of the +event line. The delimiter may be quoted in +.I old +and +.I new +with a single backslash. If & appears in +.IR new , +it is replaced by +.IR old . +A single backslash will quote the &. If +.I old +is null, it is set to the last +.I old +substituted, or, if no previous history substitutions took place, +the last +.I string +in a +.B !?\fIstring\fR\fB[?]\fR +search. +.TP +.B & +Repeat the previous substitution. +.TP +.B g +Cause changes to be applied over the entire event line. This is +used in conjunction with `\fB:s\fP' (e.g., `\fB:gs/\fIold\fP/\fInew\fP/\fR') +or `\fB:&\fP'. If used with +`\fB:s\fP', any delimiter can be used +in place of /, and the final delimiter is optional +if it is the last character of the event line. +An \fBa\fP may be used as a synonym for \fBg\fP. +.TP +.B G +Apply the following `\fBs\fP' modifier once to each word in the event line. +.PD +.SH "SHELL BUILTIN COMMANDS" +.\" start of bash_builtins +.zZ +.PP +Unless otherwise noted, each builtin command documented in this +section as accepting options preceded by +.B \- +accepts +.B \-\- +to signify the end of the options. +The \fB:\fP, \fBtrue\fP, \fBfalse\fP, and \fBtest\fP builtins +do not accept options and do not treat \fB\-\-\fP specially. +The \fBexit\fP, \fBlogout\fP, \fBbreak\fP, \fBcontinue\fP, \fBlet\fP, +and \fBshift\fP builtins accept and process arguments beginning with +\fB\-\fP without requiring \fB\-\-\fP. +Other builtins that accept arguments but are not specified as accepting +options interpret arguments beginning with \fB\-\fP as invalid options and +require \fB\-\-\fP to prevent this interpretation. +.sp .5 +.PD 0 +.TP +\fB:\fP [\fIarguments\fP] +.PD +No effect; the command does nothing beyond expanding +.I arguments +and performing any specified +redirections. A zero exit code is returned. +.TP +\fB .\| \fP \fIfilename\fP [\fIarguments\fP] +.PD 0 +.TP +\fBsource\fP \fIfilename\fP [\fIarguments\fP] +.PD +Read and execute commands from +.I filename +in the current +shell environment and return the exit status of the last command +executed from +.IR filename . +If +.I filename +does not contain a slash, filenames in +.SM +.B PATH +are used to find the directory containing +.IR filename . +The file searched for in +.SM +.B PATH +need not be executable. +When \fBbash\fP is not in \fIposix mode\fP, the current directory is +searched if no file is found in +.SM +.BR PATH . +If the +.B sourcepath +option to the +.B shopt +builtin command is turned off, the +.SM +.B PATH +is not searched. +If any \fIarguments\fP are supplied, they become the positional +parameters when \fIfilename\fP is executed. Otherwise the positional +parameters are unchanged. +The return status is the status of the last command exited within +the script (0 if no commands are executed), and false if +.I filename +is not found or cannot be read. +.TP +\fBalias\fP [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +\fBAlias\fP with no arguments or with the +.B \-p +option prints the list of aliases in the form +\fBalias\fP \fIname\fP=\fIvalue\fP on standard output. +When arguments are supplied, an alias is defined for +each \fIname\fP whose \fIvalue\fP is given. +A trailing space in \fIvalue\fP causes the next word to be +checked for alias substitution when the alias is expanded. +For each \fIname\fP in the argument list for which no \fIvalue\fP +is supplied, the name and value of the alias is printed. +\fBAlias\fP returns true unless a \fIname\fP is given for which +no alias has been defined. +.TP +\fBbg\fP [\fIjobspec\fP ...] +Resume each suspended job \fIjobspec\fP in the background, as if it +had been started with +.BR & . +If +.I jobspec +is not present, the shell's notion of the \fIcurrent job\fP is used. +.B bg +.I jobspec +returns 0 unless run when job control is disabled or, when run with +job control enabled, any specified \fIjobspec\fP was not found +or was started without job control. +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] [\fB\-lpsvPSVX\fP] +.PD 0 +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] [\fB\-q\fP \fIfunction\fP] [\fB\-u\fP \fIfunction\fP] [\fB\-r\fP \fIkeyseq\fP] +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fB\-f\fP \fIfilename\fP +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fB\-x\fP \fIkeyseq\fP:\fIshell\-command\fP +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fIkeyseq\fP:\fIfunction\-name\fP +.TP +\fBbind\fP \fIreadline\-command\fP +.PD +Display current +.B readline +key and function bindings, bind a key sequence to a +.B readline +function or macro, or set a +.B readline +variable. +Each non-option argument is a command as it would appear in +.IR .inputrc , +but each binding or command must be passed as a separate argument; +e.g., '"\eC\-x\eC\-r": re\-read\-init\-file'. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-m \fIkeymap\fP +Use +.I keymap +as the keymap to be affected by the subsequent bindings. +Acceptable +.I keymap +names are +\fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi, +vi\-move, vi\-command\fP, and +.IR vi\-insert . +\fIvi\fP is equivalent to \fIvi\-command\fP; \fIemacs\fP is +equivalent to \fIemacs\-standard\fP. +.TP +.B \-l +List the names of all \fBreadline\fP functions. +.TP +.B \-p +Display \fBreadline\fP function names and bindings in such a way +that they can be re-read. +.TP +.B \-P +List current \fBreadline\fP function names and bindings. +.TP +.B \-s +Display \fBreadline\fP key sequences bound to macros and the strings +they output in such a way that they can be re-read. +.TP +.B \-S +Display \fBreadline\fP key sequences bound to macros and the strings +they output. +.TP +.B \-v +Display \fBreadline\fP variable names and values in such a way that they +can be re-read. +.TP +.B \-V +List current \fBreadline\fP variable names and values. +.TP +.B \-f \fIfilename\fP +Read key bindings from \fIfilename\fP. +.TP +.B \-q \fIfunction\fP +Query about which keys invoke the named \fIfunction\fP. +.TP +.B \-u \fIfunction\fP +Unbind all keys bound to the named \fIfunction\fP. +.TP +.B \-r \fIkeyseq\fP +Remove any current binding for \fIkeyseq\fP. +.TP +.B \-x \fIkeyseq\fP:\fIshell\-command\fP +Cause \fIshell\-command\fP to be executed whenever \fIkeyseq\fP is +entered. +When \fIshell\-command\fP is executed, the shell sets the +.SM +.B READLINE_LINE +variable to the contents of the \fBreadline\fP line buffer and the +.SM +.B READLINE_POINT +variable to the current location of the insertion point. +If the executed command changes the value of +.SM +.B READLINE_LINE +or +.SM +.BR READLINE_POINT , +those new values will be reflected in the editing state. +.TP +.B \-X +List all key sequences bound to shell commands and the associated commands +in a format that can be reused as input. +.PD +.PP +The return value is 0 unless an unrecognized option is given or an +error occurred. +.RE +.TP +\fBbreak\fP [\fIn\fP] +Exit from within a +.BR for , +.BR while , +.BR until , +or +.B select +loop. If \fIn\fP is specified, break \fIn\fP levels. +.I n +must be \(>= 1. If +.I n +is greater than the number of enclosing loops, all enclosing loops +are exited. +The return value is 0 unless \fIn\fP is not greater than or equal to 1. +.TP +\fBbuiltin\fP \fIshell\-builtin\fP [\fIarguments\fP] +Execute the specified shell builtin, passing it +.IR arguments , +and return its exit status. +This is useful when defining a +function whose name is the same as a shell builtin, +retaining the functionality of the builtin within the function. +The \fBcd\fP builtin is commonly redefined this way. +The return status is false if +.I shell\-builtin +is not a shell builtin command. +.TP +\fBcaller\fP [\fIexpr\fP] +Returns the context of any active subroutine call (a shell function or +a script executed with the \fB.\fP or \fBsource\fP builtins). +Without \fIexpr\fP, \fBcaller\fP displays the line number and source +filename of the current subroutine call. +If a non-negative integer is supplied as \fIexpr\fP, \fBcaller\fP +displays the line number, subroutine name, and source file corresponding +to that position in the current execution call stack. This extra +information may be used, for example, to print a stack trace. The +current frame is frame 0. +The return value is 0 unless the shell is not executing a subroutine +call or \fIexpr\fP does not correspond to a valid position in the +call stack. +.TP +\fBcd\fP [\fB\-L\fP|[\fB\-P\fP [\fB\-e\fP]] [\-@]] [\fIdir\fP] +Change the current directory to \fIdir\fP. +if \fIdir\fP is not supplied, the value of the +.SM +.B HOME +shell variable is the default. +Any additional arguments following \fIdir\fP are ignored. +The variable +.SM +.B CDPATH +defines the search path for the directory containing +.IR dir : +each directory name in +.SM +.B CDPATH +is searched for \fIdir\fP. +Alternative directory names in +.SM +.B CDPATH +are separated by a colon (:). A null directory name in +.SM +.B CDPATH +is the same as the current directory, i.e., ``\fB.\fP''. If +.I dir +begins with a slash (/), +then +.SM +.B CDPATH +is not used. The +.B \-P +option causes \fBcd\fP to use the physical directory structure +by resolving symbolic links while traversing \fIdir\fP and +before processing instances of \fI..\fP in \fIdir\fP (see also the +.B \-P +option to the +.B set +builtin command); the +.B \-L +option forces symbolic links to be followed by resolving the link +after processing instances of \fI..\fP in \fIdir\fP. +If \fI..\fP appears in \fIdir\fP, it is processed by removing the +immediately previous pathname component from \fIdir\fP, back to a slash +or the beginning of \fIdir\fP. +If the +.B \-e +option is supplied with +.BR \-P , +and the current working directory cannot be successfully determined +after a successful directory change, \fBcd\fP will return an unsuccessful +status. +On systems that support it, the \fB\-@\fP option presents the extended +attributes associated with a file as a directory. +An argument of +.B \- +is converted to +.SM +.B $OLDPWD +before the directory change is attempted. +If a non-empty directory name from +.SM +.B CDPATH +is used, or if +\fB\-\fP is the first argument, and the directory change is +successful, the absolute pathname of the new working directory is +written to the standard output. +The return value is true if the directory was successfully changed; +false otherwise. +.TP +\fBcommand\fP [\fB\-pVv\fP] \fIcommand\fP [\fIarg\fP ...] +Run +.I command +with +.I args +suppressing the normal shell function lookup. Only builtin +commands or commands found in the +.SM +.B PATH +are executed. If the +.B \-p +option is given, the search for +.I command +is performed using a default value for +.SM +.B PATH +that is guaranteed to find all of the standard utilities. +If either the +.B \-V +or +.B \-v +option is supplied, a description of +.I command +is printed. The +.B \-v +option causes a single word indicating the command or filename +used to invoke +.I command +to be displayed; the +.B \-V +option produces a more verbose description. +If the +.B \-V +or +.B \-v +option is supplied, the exit status is 0 if +.I command +was found, and 1 if not. If neither option is supplied and +an error occurred or +.I command +cannot be found, the exit status is 127. Otherwise, the exit status of the +.B command +builtin is the exit status of +.IR command . +.TP +\fBcompgen\fP [\fIoption\fP] [\fIword\fP] +Generate possible completion matches for \fIword\fP according to +the \fIoption\fPs, which may be any option accepted by the +.B complete +builtin with the exception of \fB\-p\fP and \fB\-r\fP, and write +the matches to the standard output. +When using the \fB\-F\fP or \fB\-C\fP options, the various shell variables +set by the programmable completion facilities, while available, will not +have useful values. +.sp 1 +The matches will be generated in the same way as if the programmable +completion code had generated them directly from a completion specification +with the same flags. +If \fIword\fP is specified, only those completions matching \fIword\fP +will be displayed. +.sp 1 +The return value is true unless an invalid option is supplied, or no +matches were generated. +.TP +\fBcomplete\fP [\fB\-abcdefgjksuv\fP] [\fB\-o\fP \fIcomp-option\fP] [\fB\-DE\fP] [\fB\-A\fP \fIaction\fP] [\fB\-G\fP \fIglobpat\fP] [\fB\-W\fP \fIwordlist\fP] [\fB\-F\fP \fIfunction\fP] [\fB\-C\fP \fIcommand\fP] +.br +[\fB\-X\fP \fIfilterpat\fP] [\fB\-P\fP \fIprefix\fP] [\fB\-S\fP \fIsuffix\fP] \fIname\fP [\fIname ...\fP] +.PD 0 +.TP +\fBcomplete\fP \fB\-pr\fP [\fB\-DE\fP] [\fIname\fP ...] +.PD +Specify how arguments to each \fIname\fP should be completed. +If the \fB\-p\fP option is supplied, or if no options are supplied, +existing completion specifications are printed in a way that allows +them to be reused as input. +The \fB\-r\fP option removes a completion specification for +each \fIname\fP, or, if no \fIname\fPs are supplied, all +completion specifications. +The \fB\-D\fP option indicates that the remaining options and actions should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The \fB\-E\fP option indicates that the remaining options and actions should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +.sp 1 +The process of applying these completion specifications when word completion +is attempted is described above under \fBProgrammable Completion\fP. +.sp 1 +Other options, if specified, have the following meanings. +The arguments to the \fB\-G\fP, \fB\-W\fP, and \fB\-X\fP options +(and, if necessary, the \fB\-P\fP and \fB\-S\fP options) +should be quoted to protect them from expansion before the +.B complete +builtin is invoked. +.RS +.PD 0 +.TP 8 +\fB\-o\fP \fIcomp-option\fP +The \fIcomp-option\fP controls several aspects of the compspec's behavior +beyond the simple generation of completions. +\fIcomp-option\fP may be one of: +.RS +.TP 8 +.B bashdefault +Perform the rest of the default \fBbash\fP completions if the compspec +generates no matches. +.TP 8 +.B default +Use readline's default filename completion if the compspec generates +no matches. +.TP 8 +.B dirnames +Perform directory name completion if the compspec generates no matches. +.TP 8 +.B filenames +Tell readline that the compspec generates filenames, so it can perform any +filename\-specific processing (like adding a slash to directory names, +quoting special characters, or suppressing trailing spaces). +Intended to be used with shell functions. +.TP 8 +.B noquote +Tell readline not to quote the completed words if they are filenames +(quoting filenames is the default). +.TP 8 +.B nospace +Tell readline not to append a space (the default) to words completed at +the end of the line. +.TP 8 +.B plusdirs +After any matches defined by the compspec are generated, +directory name completion is attempted and any +matches are added to the results of the other actions. +.RE +.TP 8 +\fB\-A\fP \fIaction\fP +The \fIaction\fP may be one of the following to generate a list of possible +completions: +.RS +.TP 8 +.B alias +Alias names. May also be specified as \fB\-a\fP. +.TP 8 +.B arrayvar +Array variable names. +.TP 8 +.B binding +\fBReadline\fP key binding names. +.TP 8 +.B builtin +Names of shell builtin commands. May also be specified as \fB\-b\fP. +.TP 8 +.B command +Command names. May also be specified as \fB\-c\fP. +.TP 8 +.B directory +Directory names. May also be specified as \fB\-d\fP. +.TP 8 +.B disabled +Names of disabled shell builtins. +.TP 8 +.B enabled +Names of enabled shell builtins. +.TP 8 +.B export +Names of exported shell variables. May also be specified as \fB\-e\fP. +.TP 8 +.B file +File names. May also be specified as \fB\-f\fP. +.TP 8 +.B function +Names of shell functions. +.TP 8 +.B group +Group names. May also be specified as \fB\-g\fP. +.TP 8 +.B helptopic +Help topics as accepted by the \fBhelp\fP builtin. +.TP 8 +.B hostname +Hostnames, as taken from the file specified by the +.SM +.B HOSTFILE +shell variable. +.TP 8 +.B job +Job names, if job control is active. May also be specified as \fB\-j\fP. +.TP 8 +.B keyword +Shell reserved words. May also be specified as \fB\-k\fP. +.TP 8 +.B running +Names of running jobs, if job control is active. +.TP 8 +.B service +Service names. May also be specified as \fB\-s\fP. +.TP 8 +.B setopt +Valid arguments for the \fB\-o\fP option to the \fBset\fP builtin. +.TP 8 +.B shopt +Shell option names as accepted by the \fBshopt\fP builtin. +.TP 8 +.B signal +Signal names. +.TP 8 +.B stopped +Names of stopped jobs, if job control is active. +.TP 8 +.B user +User names. May also be specified as \fB\-u\fP. +.TP 8 +.B variable +Names of all shell variables. May also be specified as \fB\-v\fP. +.RE +.TP 8 +\fB\-C\fP \fIcommand\fP +\fIcommand\fP is executed in a subshell environment, and its output is +used as the possible completions. +.TP 8 +\fB\-F\fP \fIfunction\fP +The shell function \fIfunction\fP is executed in the current shell +environment. +When the function is executed, +the first argument (\fB$1\fP) is the name of the command whose arguments are +being completed, +the second argument (\fB$2\fP) is the word being completed, +and the third argument (\fB$3\fP) is the word preceding the word being +completed on the current command line. +When it finishes, the possible completions are retrieved from the value +of the +.SM +.B COMPREPLY +array variable. +.TP 8 +\fB\-G\fP \fIglobpat\fP +The pathname expansion pattern \fIglobpat\fP is expanded to generate +the possible completions. +.TP 8 +\fB\-P\fP \fIprefix\fP +\fIprefix\fP is added at the beginning of each possible completion +after all other options have been applied. +.TP 8 +\fB\-S\fP \fIsuffix\fP +\fIsuffix\fP is appended to each possible completion +after all other options have been applied. +.TP 8 +\fB\-W\fP \fIwordlist\fP +The \fIwordlist\fP is split using the characters in the +.SM +.B IFS +special variable as delimiters, and each resultant word is expanded. +The possible completions are the members of the resultant list which +match the word being completed. +.TP 8 +\fB\-X\fP \fIfilterpat\fP +\fIfilterpat\fP is a pattern as used for pathname expansion. +It is applied to the list of possible completions generated by the +preceding options and arguments, and each completion matching +\fIfilterpat\fP is removed from the list. +A leading \fB!\fP in \fIfilterpat\fP negates the pattern; in this +case, any completion not matching \fIfilterpat\fP is removed. +.PD +.PP +The return value is true unless an invalid option is supplied, an option +other than \fB\-p\fP or \fB\-r\fP is supplied without a \fIname\fP +argument, an attempt is made to remove a completion specification for +a \fIname\fP for which no specification exists, or +an error occurs adding a completion specification. +.RE +.TP +\fBcompopt\fP [\fB\-o\fP \fIoption\fP] [\fB\-DE\fP] [\fB+o\fP \fIoption\fP] [\fIname\fP] +Modify completion options for each \fIname\fP according to the +\fIoption\fPs, or for the +currently-executing completion if no \fIname\fPs are supplied. +If no \fIoption\fPs are given, display the completion options for each +\fIname\fP or the current completion. +The possible values of \fIoption\fP are those valid for the \fBcomplete\fP +builtin described above. +The \fB\-D\fP option indicates that the remaining options should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The \fB\-E\fP option indicates that the remaining options should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +.sp 1 +The return value is true unless an invalid option is supplied, an attempt +is made to modify the options for a \fIname\fP for which no completion +specification exists, or an output error occurs. +.TP +\fBcontinue\fP [\fIn\fP] +Resume the next iteration of the enclosing +.BR for , +.BR while , +.BR until , +or +.B select +loop. +If +.I n +is specified, resume at the \fIn\fPth enclosing loop. +.I n +must be \(>= 1. If +.I n +is greater than the number of enclosing loops, the last enclosing loop +(the ``top-level'' loop) is resumed. +The return value is 0 unless \fIn\fP is not greater than or equal to 1. +.TP +\fBdeclare\fP [\fB\-aAfFgilnrtux\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +.PD 0 +.TP +\fBtypeset\fP [\fB\-aAfFgilnrtux\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +.PD +Declare variables and/or give them attributes. +If no \fIname\fPs are given then display the values of variables. +The +.B \-p +option will display the attributes and values of each +.IR name . +When +.B \-p +is used with \fIname\fP arguments, additional options, +other than \fB\-f\fP and \fB\-F\fP, are ignored. +When +.B \-p +is supplied without \fIname\fP arguments, it will display the attributes +and values of all variables having the attributes specified by the +additional options. +If no other options are supplied with \fB\-p\fP, \fBdeclare\fP will display +the attributes and values of all shell variables. The \fB\-f\fP option +will restrict the display to shell functions. +The +.B \-F +option inhibits the display of function definitions; only the +function name and attributes are printed. +If the \fBextdebug\fP shell option is enabled using \fBshopt\fP, +the source file name and line number where the function is defined +are displayed as well. The +.B \-F +option implies +.BR \-f . +The +.B \-g +option forces variables to be created or modified at the global scope, +even when \fBdeclare\fP is executed in a shell function. +It is ignored in all other cases. +The following options can +be used to restrict output to variables with the specified attribute or +to give variables attributes: +.RS +.PD 0 +.TP +.B \-a +Each \fIname\fP is an indexed array variable (see +.B Arrays +above). +.TP +.B \-A +Each \fIname\fP is an associative array variable (see +.B Arrays +above). +.TP +.B \-f +Use function names only. +.TP +.B \-i +The variable is treated as an integer; arithmetic evaluation (see +.SM +.B "ARITHMETIC EVALUATION" +above) is performed when the variable is assigned a value. +.TP +.B \-l +When the variable is assigned a value, all upper-case characters are +converted to lower-case. +The upper-case attribute is disabled. +.TP +.B \-n +Give each \fIname\fP the \fInameref\fP attribute, making +it a name reference to another variable. +That other variable is defined by the value of \fIname\fP. +All references and assignments to \fIname\fP, except for changing the +\fB\-n\fP attribute itself, are performed on the variable referenced by +\fIname\fP's value. +The \fB\-n\fP attribute cannot be applied to array variables. +.TP +.B \-r +Make \fIname\fPs readonly. These names cannot then be assigned values +by subsequent assignment statements or unset. +.TP +.B \-t +Give each \fIname\fP the \fItrace\fP attribute. +Traced functions inherit the \fBDEBUG\fP and \fBRETURN\fP traps from +the calling shell. +The trace attribute has no special meaning for variables. +.TP +.B \-u +When the variable is assigned a value, all lower-case characters are +converted to upper-case. +The lower-case attribute is disabled. +.TP +.B \-x +Mark \fIname\fPs for export to subsequent commands via the environment. +.PD +.PP +Using `+' instead of `\-' +turns off the attribute instead, +with the exceptions that \fB+a\fP +may not be used to destroy an array variable and \fB+r\fP will not +remove the readonly attribute. +When used in a function, +.B declare +and +.B typeset +make each +\fIname\fP local, as with the +.B local +command, +unless the \fB\-g\fP option is supplied. +If a variable name is followed by =\fIvalue\fP, the value of +the variable is set to \fIvalue\fP. +When using \fB\-a\fP or \fB\-A\fP and the compound assignment syntax to +create array variables, additional attributes do not take effect until +subsequent assignments. +The return value is 0 unless an invalid option is encountered, +an attempt is made to define a function using +.if n ``\-f foo=bar'', +.if t \f(CW\-f foo=bar\fP, +an attempt is made to assign a value to a readonly variable, +an attempt is made to assign a value to an array variable without +using the compound assignment syntax (see +.B Arrays +above), one of the \fInames\fP is not a valid shell variable name, +an attempt is made to turn off readonly status for a readonly variable, +an attempt is made to turn off array status for an array variable, +or an attempt is made to display a non-existent function with \fB\-f\fP. +.RE +.TP +.B dirs [\fB\-clpv\fP] [+\fIn\fP] [\-\fIn\fP] +Without options, displays the list of currently remembered directories. +The default display is on a single line with directory names separated +by spaces. +Directories are added to the list with the +.B pushd +command; the +.B popd +command removes entries from the list. +.RS +.PD 0 +.TP +.B \-c +Clears the directory stack by deleting all of the entries. +.TP +.B \-l +Produces a listing using full pathnames; +the default listing format uses a tilde to denote the home directory. +.TP +.B \-p +Print the directory stack with one entry per line. +.TP +.B \-v +Print the directory stack with one entry per line, +prefixing each entry with its index in the stack. +.TP +\fB+\fP\fIn\fP +Displays the \fIn\fPth entry counting from the left of the list +shown by +.B dirs +when invoked without options, starting with zero. +.TP +\fB\-\fP\fIn\fP +Displays the \fIn\fPth entry counting from the right of the list +shown by +.B dirs +when invoked without options, starting with zero. +.PD +.PP +The return value is 0 unless an +invalid option is supplied or \fIn\fP indexes beyond the end +of the directory stack. +.RE +.TP +\fBdisown\fP [\fB\-ar\fP] [\fB\-h\fP] [\fIjobspec\fP ...] +Without options, remove each +.I jobspec +from the table of active jobs. +If +.I jobspec +is not present, and neither the \fB\-a\fP nor the \fB\-r\fP option +is supplied, the \fIcurrent job\fP is used. +If the \fB\-h\fP option is given, each +.I jobspec +is not removed from the table, but is marked so that +.SM +.B SIGHUP +is not sent to the job if the shell receives a +.SM +.BR SIGHUP . +If no +.I jobspec +is supplied, the +.B \-a +option means to remove or mark all jobs; the +.B \-r +option without a +.I jobspec +argument restricts operation to running jobs. +The return value is 0 unless a +.I jobspec +does not specify a valid job. +.TP +\fBecho\fP [\fB\-neE\fP] [\fIarg\fP ...] +Output the \fIarg\fPs, separated by spaces, followed by a newline. +The return status is 0 unless a write error occurs. +If \fB\-n\fP is specified, the trailing newline is +suppressed. If the \fB\-e\fP option is given, interpretation of +the following backslash-escaped characters is enabled. The +.B \-E +option disables the interpretation of these escape characters, +even on systems where they are interpreted by default. +The \fBxpg_echo\fP shell option may be used to +dynamically determine whether or not \fBecho\fP expands these +escape characters by default. +.B echo +does not interpret \fB\-\-\fP to mean the end of options. +.B echo +interprets the following escape sequences: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ec +suppress further output +.TP +.B \ee +.TP +.B \eE +an escape character +.TP +.B \ef +form feed +.TP +.B \en +new line +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\e +backslash +.TP +.B \e0\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(zero to three octal digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.TP +.B \eu\fIHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHH\fP (one to four hex digits) +.TP +.B \eU\fIHHHHHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHHHHHH\fP (one to eight hex digits) +.PD +.RE +.TP +\fBenable\fP [\fB\-a\fP] [\fB\-dnps\fP] [\fB\-f\fP \fIfilename\fP] [\fIname\fP ...] +Enable and disable builtin shell commands. +Disabling a builtin allows a disk command which has the same name +as a shell builtin to be executed without specifying a full pathname, +even though the shell normally searches for builtins before disk commands. +If \fB\-n\fP is used, each \fIname\fP +is disabled; otherwise, +\fInames\fP are enabled. For example, to use the +.B test +binary found via the +.SM +.B PATH +instead of the shell builtin version, run +.if t \f(CWenable -n test\fP. +.if n ``enable -n test''. +The +.B \-f +option means to load the new builtin command +.I name +from shared object +.IR filename , +on systems that support dynamic loading. The +.B \-d +option will delete a builtin previously loaded with +.BR \-f . +If no \fIname\fP arguments are given, or if the +.B \-p +option is supplied, a list of shell builtins is printed. +With no other option arguments, the list consists of all enabled +shell builtins. +If \fB\-n\fP is supplied, only disabled builtins are printed. +If \fB\-a\fP is supplied, the list printed includes all builtins, with an +indication of whether or not each is enabled. +If \fB\-s\fP is supplied, the output is restricted to the POSIX +\fIspecial\fP builtins. +The return value is 0 unless a +.I name +is not a shell builtin or there is an error loading a new builtin +from a shared object. +.TP +\fBeval\fP [\fIarg\fP ...] +The \fIarg\fPs are read and concatenated together into a single +command. This command is then read and executed by the shell, and +its exit status is returned as the value of +.BR eval . +If there are no +.IR args , +or only null arguments, +.B eval +returns 0. +.TP +\fBexec\fP [\fB\-cl\fP] [\fB\-a\fP \fIname\fP] [\fIcommand\fP [\fIarguments\fP]] +If +.I command +is specified, it replaces the shell. +No new process is created. The +.I arguments +become the arguments to \fIcommand\fP. +If the +.B \-l +option is supplied, +the shell places a dash at the beginning of the zeroth argument passed to +.IR command . +This is what +.IR login (1) +does. The +.B \-c +option causes +.I command +to be executed with an empty environment. If +.B \-a +is supplied, the shell passes +.I name +as the zeroth argument to the executed command. +If +.I command +cannot be executed for some reason, a non-interactive shell exits, +unless the +.B execfail +shell option +is enabled. In that case, it returns failure. +An interactive shell returns failure if the file cannot be executed. +If +.I command +is not specified, any redirections take effect in the current shell, +and the return status is 0. If there is a redirection error, the +return status is 1. +.TP +\fBexit\fP [\fIn\fP] +Cause the shell to exit +with a status of \fIn\fP. If +.I n +is omitted, the exit status +is that of the last command executed. +A trap on +.SM +.B EXIT +is executed before the shell terminates. +.TP +\fBexport\fP [\fB\-fn\fP\^] [\fIname\fP[=\fIword\fP]] ... +.PD 0 +.TP +.B export \-p +.PD +The supplied +.I names +are marked for automatic export to the environment of +subsequently executed commands. If the +.B \-f +option is given, +the +.I names +refer to functions. +If no +.I names +are given, or if the +.B \-p +option is supplied, a list +of names of all exported variables is printed. +The +.B \-n +option causes the export property to be removed from each +\fIname\fP. +If a variable name is followed by =\fIword\fP, the value of +the variable is set to \fIword\fP. +.B export +returns an exit status of 0 unless an invalid option is +encountered, +one of the \fInames\fP is not a valid shell variable name, or +.B \-f +is supplied with a +.I name +that is not a function. +.TP +\fBfc\fP [\fB\-e\fP \fIename\fP] [\fB\-lnr\fP] [\fIfirst\fP] [\fIlast\fP] +.PD 0 +.TP +\fBfc\fP \fB\-s\fP [\fIpat\fP=\fIrep\fP] [\fIcmd\fP] +.PD +The first form selects a range of commands from +.I first +to +.I last +from the history list and displays or edits and re-executes them. +.I First +and +.I last +may be specified as a string (to locate the last command beginning +with that string) or as a number (an index into the history list, +where a negative number is used as an offset from the current +command number). If +.I last +is not specified it is set to +the current command for listing (so that +.if n ``fc \-l \-10'' +.if t \f(CWfc \-l \-10\fP +prints the last 10 commands) and to +.I first +otherwise. +If +.I first +is not specified it is set to the previous +command for editing and \-16 for listing. +.sp 1 +The +.B \-n +option suppresses +the command numbers when listing. The +.B \-r +option reverses the order of +the commands. If the +.B \-l +option is given, +the commands are listed on +standard output. Otherwise, the editor given by +.I ename +is invoked +on a file containing those commands. If +.I ename +is not given, the +value of the +.SM +.B FCEDIT +variable is used, and +the value of +.SM +.B EDITOR +if +.SM +.B FCEDIT +is not set. If neither variable is set, +.FN vi +is used. When editing is complete, the edited commands are +echoed and executed. +.sp 1 +In the second form, \fIcommand\fP is re-executed after each instance +of \fIpat\fP is replaced by \fIrep\fP. +\fICommand\fP is intepreted the same as \fIfirst\fP above. +A useful alias to use with this is +.if n ``r="fc -s"'', +.if t \f(CWr='fc \-s'\fP, +so that typing +.if n ``r cc'' +.if t \f(CWr cc\fP +runs the last command beginning with +.if n ``cc'' +.if t \f(CWcc\fP +and typing +.if n ``r'' +.if t \f(CWr\fP +re-executes the last command. +.sp 1 +If the first form is used, the return value is 0 unless an invalid +option is encountered or +.I first +or +.I last +specify history lines out of range. +If the +.B \-e +option is supplied, the return value is the value of the last +command executed or failure if an error occurs with the temporary +file of commands. If the second form is used, the return status +is that of the command re-executed, unless +.I cmd +does not specify a valid history line, in which case +.B fc +returns failure. +.TP +\fBfg\fP [\fIjobspec\fP] +Resume +.I jobspec +in the foreground, and make it the current job. +If +.I jobspec +is not present, the shell's notion of the \fIcurrent job\fP is used. +The return value is that of the command placed into the foreground, +or failure if run when job control is disabled or, when run with +job control enabled, if +.I jobspec +does not specify a valid job or +.I jobspec +specifies a job that was started without job control. +.TP +\fBgetopts\fP \fIoptstring\fP \fIname\fP [\fIargs\fP] +.B getopts +is used by shell procedures to parse positional parameters. +.I optstring +contains the option characters to be recognized; if a character +is followed by a colon, the option is expected to have an +argument, which should be separated from it by white space. +The colon and question mark characters may not be used as +option characters. +Each time it is invoked, +.B getopts +places the next option in the shell variable +.IR name , +initializing +.I name +if it does not exist, +and the index of the next argument to be processed into the +variable +.SM +.BR OPTIND . +.SM +.B OPTIND +is initialized to 1 each time the shell or a shell script +is invoked. When an option requires an argument, +.B getopts +places that argument into the variable +.SM +.BR OPTARG . +The shell does not reset +.SM +.B OPTIND +automatically; it must be manually reset between multiple +calls to +.B getopts +within the same shell invocation if a new set of parameters +is to be used. +.sp 1 +When the end of options is encountered, \fBgetopts\fP exits with a +return value greater than zero. +.SM +.B OPTIND +is set to the index of the first non-option argument, +and \fIname\fP is set to ?. +.sp 1 +.B getopts +normally parses the positional parameters, but if more arguments are +given in +.IR args , +.B getopts +parses those instead. +.sp 1 +.B getopts +can report errors in two ways. If the first character of +.I optstring +is a colon, +.I silent +error reporting is used. In normal operation, diagnostic messages +are printed when invalid options or missing option arguments are +encountered. +If the variable +.SM +.B OPTERR +is set to 0, no error messages will be displayed, even if the first +character of +.I optstring +is not a colon. +.sp 1 +If an invalid option is seen, +.B getopts +places ? into +.I name +and, if not silent, +prints an error message and unsets +.SM +.BR OPTARG . +If +.B getopts +is silent, +the option character found is placed in +.SM +.B OPTARG +and no diagnostic message is printed. +.sp 1 +If a required argument is not found, and +.B getopts +is not silent, +a question mark (\^\fB?\fP\^) is placed in +.IR name , +.SM +.B OPTARG +is unset, and a diagnostic message is printed. +If +.B getopts +is silent, then a colon (\^\fB:\fP\^) is placed in +.I name +and +.SM +.B OPTARG +is set to the option character found. +.sp 1 +.B getopts +returns true if an option, specified or unspecified, is found. +It returns false if the end of options is encountered or an +error occurs. +.TP +\fBhash\fP [\fB\-lr\fP] [\fB\-p\fP \fIfilename\fP] [\fB\-dt\fP] [\fIname\fP] +Each time \fBhash\fP is invoked, +the full pathname of the command +.I name +is determined by searching +the directories in +.B $PATH +and remembered. Any previously-remembered pathname is discarded. +If the +.B \-p +option is supplied, no path search is performed, and +.I filename +is used as the full filename of the command. +The +.B \-r +option causes the shell to forget all +remembered locations. +The +.B \-d +option causes the shell to forget the remembered location of each \fIname\fP. +If the +.B \-t +option is supplied, the full pathname to which each \fIname\fP corresponds +is printed. If multiple \fIname\fP arguments are supplied with \fB\-t\fP, +the \fIname\fP is printed before the hashed full pathname. +The +.B \-l +option causes output to be displayed in a format that may be reused as input. +If no arguments are given, or if only \fB\-l\fP is supplied, +information about remembered commands is printed. +The return status is true unless a +.I name +is not found or an invalid option is supplied. +.TP +\fBhelp\fP [\fB\-dms\fP] [\fIpattern\fP] +Display helpful information about builtin commands. If +.I pattern +is specified, +.B help +gives detailed help on all commands matching +.IR pattern ; +otherwise help for all the builtins and shell control structures +is printed. +.RS +.PD 0 +.TP +.B \-d +Display a short description of each \fIpattern\fP +.TP +.B \-m +Display the description of each \fIpattern\fP in a manpage-like format +.TP +.B \-s +Display only a short usage synopsis for each \fIpattern\fP +.PD +.PP +The return status is 0 unless no command matches +.IR pattern . +.RE +.TP +\fBhistory [\fIn\fP] +.PD 0 +.TP +\fBhistory\fP \fB\-c\fP +.TP +\fBhistory \-d\fP \fIoffset\fP +.TP +\fBhistory\fP \fB\-anrw\fP [\fIfilename\fP] +.TP +\fBhistory\fP \fB\-p\fP \fIarg\fP [\fIarg ...\fP] +.TP +\fBhistory\fP \fB\-s\fP \fIarg\fP [\fIarg ...\fP] +.PD +With no options, display the command +history list with line numbers. Lines listed +with a +.B * +have been modified. An argument of +.I n +lists only the last +.I n +lines. +If the shell variable +.SM +.B HISTTIMEFORMAT +is set and not null, +it is used as a format string for \fIstrftime\fP(3) to display +the time stamp associated with each displayed history entry. +No intervening blank is printed between the formatted time stamp +and the history line. +If \fIfilename\fP is supplied, it is used as the +name of the history file; if not, the value of +.SM +.B HISTFILE +is used. Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-c +Clear the history list by deleting all the entries. +.TP +\fB\-d\fP \fIoffset\fP +Delete the history entry at position \fIoffset\fP. +.TP +.B \-a +Append the ``new'' history lines (history lines entered since the +beginning of the current \fBbash\fP session) to the history file. +.TP +.B \-n +Read the history lines not already read from the history +file into the current history list. These are lines +appended to the history file since the beginning of the +current \fBbash\fP session. +.TP +.B \-r +Read the contents of the history file +and append them to the current history list. +.TP +.B \-w +Write the current history list to the history file, overwriting the +history file's contents. +.TP +.B \-p +Perform history substitution on the following \fIargs\fP and display +the result on the standard output. +Does not store the results in the history list. +Each \fIarg\fP must be quoted to disable normal history expansion. +.TP +.B \-s +Store the +.I args +in the history list as a single entry. The last command in the +history list is removed before the +.I args +are added. +.PD +.PP +If the +.SM +.B HISTTIMEFORMAT +variable is set, the time stamp information +associated with each history entry is written to the history file, +marked with the history comment character. +When the history file is read, lines beginning with the history +comment character followed immediately by a digit are interpreted +as timestamps for the previous history line. +The return value is 0 unless an invalid option is encountered, an +error occurs while reading or writing the history file, an invalid +\fIoffset\fP is supplied as an argument to \fB\-d\fP, or the +history expansion supplied as an argument to \fB\-p\fP fails. +.RE +.TP +\fBjobs\fP [\fB\-lnprs\fP] [ \fIjobspec\fP ... ] +.PD 0 +.TP +\fBjobs\fP \fB\-x\fP \fIcommand\fP [ \fIargs\fP ... ] +.PD +The first form lists the active jobs. The options have the following +meanings: +.RS +.PD 0 +.TP +.B \-l +List process IDs +in addition to the normal information. +.TP +.B \-n +Display information only about jobs that have changed status since +the user was last notified of their status. +.TP +.B \-p +List only the process ID of the job's process group +leader. +.TP +.B \-r +Display only running jobs. +.TP +.B \-s +Display only stopped jobs. +.PD +.PP +If +.I jobspec +is given, output is restricted to information about that job. +The return status is 0 unless an invalid option is encountered +or an invalid +.I jobspec +is supplied. +.PP +If the +.B \-x +option is supplied, +.B jobs +replaces any +.I jobspec +found in +.I command +or +.I args +with the corresponding process group ID, and executes +.I command +passing it +.IR args , +returning its exit status. +.RE +.TP +\fBkill\fP [\fB\-s\fP \fIsigspec\fP | \fB\-n\fP \fIsignum\fP | \fB\-\fP\fIsigspec\fP] [\fIpid\fP | \fIjobspec\fP] ... +.PD 0 +.TP +\fBkill\fP \fB\-l\fP [\fIsigspec\fP | \fIexit_status\fP] +.PD +Send the signal named by +.I sigspec +or +.I signum +to the processes named by +.I pid +or +.IR jobspec . +.I sigspec +is either a case-insensitive signal name such as +.SM +.B SIGKILL +(with or without the +.SM +.B SIG +prefix) or a signal number; +.I signum +is a signal number. +If +.I sigspec +is not present, then +.SM +.B SIGTERM +is assumed. +An argument of +.B \-l +lists the signal names. +If any arguments are supplied when +.B \-l +is given, the names of the signals corresponding to the arguments are +listed, and the return status is 0. +The \fIexit_status\fP argument to +.B \-l +is a number specifying either a signal number or the exit status of +a process terminated by a signal. +.B kill +returns true if at least one signal was successfully sent, or false +if an error occurs or an invalid option is encountered. +.TP +\fBlet\fP \fIarg\fP [\fIarg\fP ...] +Each +.I arg +is an arithmetic expression to be evaluated (see +.SM +.B "ARITHMETIC EVALUATION" +above). +If the last +.I arg +evaluates to 0, +.B let +returns 1; 0 is returned otherwise. +.TP +\fBlocal\fP [\fIoption\fP] [\fIname\fP[=\fIvalue\fP] ...] +For each argument, a local variable named +.I name +is created, and assigned +.IR value . +The \fIoption\fP can be any of the options accepted by \fBdeclare\fP. +When +.B local +is used within a function, it causes the variable +.I name +to have a visible scope restricted to that function and its children. +With no operands, +.B local +writes a list of local variables to the standard output. It is +an error to use +.B local +when not within a function. The return status is 0 unless +.B local +is used outside a function, an invalid +.I name +is supplied, or +\fIname\fP is a readonly variable. +.TP +.B logout +Exit a login shell. +.TP +\fBmapfile\fP [\fB\-n\fP \fIcount\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-s\fP \fIcount\fP] [\fB\-t\fP] [\fB\-u\fP \fIfd\fP] [\fB\-C\fP \fIcallback\fP] [\fB\-c\fP \fIquantum\fP] [\fIarray\fP] +.PD 0 +.TP +\fBreadarray\fP [\fB\-n\fP \fIcount\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-s\fP \fIcount\fP] [\fB\-t\fP] [\fB\-u\fP \fIfd\fP] [\fB\-C\fP \fIcallback\fP] [\fB\-c\fP \fIquantum\fP] [\fIarray\fP] +.PD +Read lines from the standard input into the indexed array variable +.IR array , +or from file descriptor +.IR fd +if the +.B \-u +option is supplied. +The variable +.SM +.B MAPFILE +is the default \fIarray\fP. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Copy at most +.I count +lines. If \fIcount\fP is 0, all lines are copied. +.TP +.B \-O +Begin assigning to +.I array +at index +.IR origin . +The default index is 0. +.TP +.B \-s +Discard the first \fIcount\fP lines read. +.TP +.B \-t +Remove a trailing newline from each line read. +.TP +.B \-u +Read lines from file descriptor \fIfd\fP instead of the standard input. +.TP +.B \-C +Evaluate +.I callback +each time \fIquantum\fP lines are read. The \fB\-c\fP option specifies +.IR quantum . +.TP +.B \-c +Specify the number of lines read between each call to +.IR callback . +.PD +.PP +If +.B \-C +is specified without +.BR \-c , +the default quantum is 5000. +When \fIcallback\fP is evaluated, it is supplied the index of the next +array element to be assigned and the line to be assigned to that element +as additional arguments. +\fIcallback\fP is evaluated after the line is read but before the +array element is assigned. +.PP +If not supplied with an explicit origin, \fBmapfile\fP will clear \fIarray\fP +before assigning to it. +.PP +\fBmapfile\fP returns successfully unless an invalid option or option +argument is supplied, \fIarray\fP is invalid or unassignable, or if +\fIarray\fP is not an indexed array. +.RE +.TP +\fBpopd\fP [\-\fBn\fP] [+\fIn\fP] [\-\fIn\fP] +Removes entries from the directory stack. With no arguments, +removes the top directory from the stack, and performs a +.B cd +to the new top directory. +Arguments, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Suppresses the normal change of directory when removing directories +from the stack, so that only the stack is manipulated. +.TP +\fB+\fP\fIn\fP +Removes the \fIn\fPth entry counting from the left of the list +shown by +.BR dirs , +starting with zero. For example: +.if n ``popd +0'' +.if t \f(CWpopd +0\fP +removes the first directory, +.if n ``popd +1'' +.if t \f(CWpopd +1\fP +the second. +.TP +\fB\-\fP\fIn\fP +Removes the \fIn\fPth entry counting from the right of the list +shown by +.BR dirs , +starting with zero. For example: +.if n ``popd -0'' +.if t \f(CWpopd -0\fP +removes the last directory, +.if n ``popd -1'' +.if t \f(CWpopd -1\fP +the next to last. +.PD +.PP +If the +.B popd +command is successful, a +.B dirs +is performed as well, and the return status is 0. +.B popd +returns false if an invalid option is encountered, the directory stack +is empty, a non-existent directory stack entry is specified, or the +directory change fails. +.RE +.TP +\fBprintf\fP [\fB\-v\fP \fIvar\fP] \fIformat\fP [\fIarguments\fP] +Write the formatted \fIarguments\fP to the standard output under the +control of the \fIformat\fP. +The \fB\-v\fP option causes the output to be assigned to the variable +\fIvar\fP rather than being printed to the standard output. +.sp 1 +The \fIformat\fP is a character string which contains three types of objects: +plain characters, which are simply copied to standard output, character +escape sequences, which are converted and copied to the standard output, and +format specifications, each of which causes printing of the next successive +\fIargument\fP. +In addition to the standard \fIprintf\fP(1) format specifications, +\fBprintf\fP interprets the following extensions: +.RS +.PD 0 +.TP +.B %b +causes +\fBprintf\fP to expand backslash escape sequences in the corresponding +\fIargument\fP (except that \fB\ec\fP terminates output, backslashes in +\fB\e\(aq\fP, \fB\e"\fP, and \fB\e?\fP are not removed, and octal escapes +beginning with \fB\e0\fP may contain up to four digits). +.TP +.B %q +causes \fBprintf\fP to output the corresponding +\fIargument\fP in a format that can be reused as shell input. +.TP +.B %(\fIdatefmt\fP)T +causes \fBprintf\fP to output the date-time string resulting from using +\fIdatefmt\fP as a format string for \fIstrftime\fP(3). +The corresponding \fIargument\fP is an integer representing the number of +seconds since the epoch. +Two special argument values may be used: -1 represents the current +time, and -2 represents the time the shell was invoked. +If no argument is specified, conversion behaves as if -1 had been given. +This is an exception to the usual \fBprintf\fP behavior. +.PD +.PP +Arguments to non-string format specifiers are treated as C constants, +except that a leading plus or minus sign is allowed, and if the leading +character is a single or double quote, the value is the ASCII value of +the following character. +.PP +The \fIformat\fP is reused as necessary to consume all of the \fIarguments\fP. +If the \fIformat\fP requires more \fIarguments\fP than are supplied, the +extra format specifications behave as if a zero value or null string, as +appropriate, had been supplied. +The return value is zero on success, non-zero on failure. +.RE +.TP +\fBpushd\fP [\fB\-n\fP] [+\fIn\fP] [\-\fIn\fP] +.PD 0 +.TP +\fBpushd\fP [\fB\-n\fP] [\fIdir\fP] +.PD +Adds a directory to the top of the directory stack, or rotates +the stack, making the new top of the stack the current working +directory. With no arguments, exchanges the top two directories +and returns 0, unless the directory stack is empty. +Arguments, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Suppresses the normal change of directory when adding directories +to the stack, so that only the stack is manipulated. +.TP +\fB+\fP\fIn\fP +Rotates the stack so that the \fIn\fPth directory +(counting from the left of the list shown by +.BR dirs , +starting with zero) +is at the top. +.TP +\fB\-\fP\fIn\fP +Rotates the stack so that the \fIn\fPth directory +(counting from the right of the list shown by +.BR dirs , +starting with zero) is at the top. +.TP +.I dir +Adds +.I dir +to the directory stack at the top, making it the +new current working directory as if it had been supplied as the argument +to the \fBcd\fP builtin. +.PD +.PP +If the +.B pushd +command is successful, a +.B dirs +is performed as well. +If the first form is used, +.B pushd +returns 0 unless the cd to +.I dir +fails. With the second form, +.B pushd +returns 0 unless the directory stack is empty, +a non-existent directory stack element is specified, +or the directory change to the specified new current directory +fails. +.RE +.TP +\fBpwd\fP [\fB\-LP\fP] +Print the absolute pathname of the current working directory. +The pathname printed contains no symbolic links if the +.B \-P +option is supplied or the +.B \-o physical +option to the +.B set +builtin command is enabled. +If the +.B \-L +option is used, the pathname printed may contain symbolic links. +The return status is 0 unless an error occurs while +reading the name of the current directory or an +invalid option is supplied. +.TP +\fBread\fP [\fB\-ers\fP] [\fB\-a\fP \fIaname\fP] [\fB\-d\fP \fIdelim\fP] [\fB\-i\fP \fItext\fP] [\fB\-n\fP \fInchars\fP] [\fB\-N\fP \fInchars\fP] [\fB\-p\fP \fIprompt\fP] [\fB\-t\fP \fItimeout\fP] [\fB\-u\fP \fIfd\fP] [\fIname\fP ...] +One line is read from the standard input, or from the file descriptor +\fIfd\fP supplied as an argument to the \fB\-u\fP option, and the first word +is assigned to the first +.IR name , +the second word to the second +.IR name , +and so on, with leftover words and their intervening separators assigned +to the last +.IR name . +If there are fewer words read from the input stream than names, +the remaining names are assigned empty values. +The characters in +.SM +.B IFS +are used to split the line into words using the same rules the shell +uses for expansion (described above under \fBWord Splitting\fP). +The backslash character (\fB\e\fP) may be used to remove any special +meaning for the next character read and for line continuation. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-a \fIaname\fP +The words are assigned to sequential indices +of the array variable +.IR aname , +starting at 0. +.I aname +is unset before any new values are assigned. +Other \fIname\fP arguments are ignored. +.TP +.B \-d \fIdelim\fP +The first character of \fIdelim\fP is used to terminate the input line, +rather than newline. +.TP +.B \-e +If the standard input +is coming from a terminal, +.B readline +(see +.SM +.B READLINE +above) is used to obtain the line. +Readline uses the current (or default, if line editing was not previously +active) editing settings. +.TP +.B \-i \fItext\fP +If +.B readline +is being used to read the line, \fItext\fP is placed into the editing +buffer before editing begins. +.TP +.B \-n \fInchars\fP +\fBread\fP returns after reading \fInchars\fP characters rather than +waiting for a complete line of input, but honor a delimiter if fewer +than \fInchars\fP characters are read before the delimiter. +.TP +.B \-N \fInchars\fP +\fBread\fP returns after reading exactly \fInchars\fP characters rather +than waiting for a complete line of input, unless EOF is encountered or +\fBread\fP times out. +Delimiter characters encountered in the input are +not treated specially and do not cause \fBread\fP to return until +\fInchars\fP characters are read. +.TP +.B \-p \fIprompt\fP +Display \fIprompt\fP on standard error, without a +trailing newline, before attempting to read any input. The prompt +is displayed only if input is coming from a terminal. +.TP +.B \-r +Backslash does not act as an escape character. +The backslash is considered to be part of the line. +In particular, a backslash-newline pair may not be used as a line +continuation. +.TP +.B \-s +Silent mode. If input is coming from a terminal, characters are +not echoed. +.TP +.B \-t \fItimeout\fP +Cause \fBread\fP to time out and return failure if a complete line of +input (or a specified number of characters) +is not read within \fItimeout\fP seconds. +\fItimeout\fP may be a decimal number with a fractional portion following +the decimal point. +This option is only effective if \fBread\fP is reading input from a +terminal, pipe, or other special file; it has no effect when reading +from regular files. +If \fBread\fP times out, \fBread\fP saves any partial input read into +the specified variable \fIname\fP. +If \fItimeout\fP is 0, \fBread\fP returns immediately, without trying to +read any data. The exit status is 0 if input is available on +the specified file descriptor, non-zero otherwise. +The exit status is greater than 128 if the timeout is exceeded. +.TP +.B \-u \fIfd\fP +Read input from file descriptor \fIfd\fP. +.PD +.PP +If no +.I names +are supplied, the line read is assigned to the variable +.SM +.BR REPLY . +The return code is zero, unless end-of-file is encountered, \fBread\fP +times out (in which case the return code is greater than 128), +a variable assignment error (such as assigning to a readonly variable) occurs, +or an invalid file descriptor is supplied as the argument to \fB\-u\fP. +.RE +.TP +\fBreadonly\fP [\fB\-aAf\fP] [\fB\-p\fP] [\fIname\fP[=\fIword\fP] ...] +.PD +The given +\fInames\fP are marked readonly; the values of these +.I names +may not be changed by subsequent assignment. +If the +.B \-f +option is supplied, the functions corresponding to the +\fInames\fP are so +marked. +The +.B \-a +option restricts the variables to indexed arrays; the +.B \-A +option restricts the variables to associative arrays. +If both options are supplied, +.B \-A +takes precedence. +If no +.I name +arguments are given, or if the +.B \-p +option is supplied, a list of all readonly names is printed. +The other options may be used to restrict the output to a subset of +the set of readonly names. +The +.B \-p +option causes output to be displayed in a format that +may be reused as input. +If a variable name is followed by =\fIword\fP, the value of +the variable is set to \fIword\fP. +The return status is 0 unless an invalid option is encountered, +one of the +.I names +is not a valid shell variable name, or +.B \-f +is supplied with a +.I name +that is not a function. +.TP +\fBreturn\fP [\fIn\fP] +Causes a function to stop executing and return the value specified by +.I n +to its caller. +If +.I n +is omitted, the return status is that of the last command +executed in the function body. If +.B return +is used outside a function, +but during execution of a script by the +.B . +(\fBsource\fP) command, it causes the shell to stop executing +that script and return either +.I n +or the exit status of the last command executed within the +script as the exit status of the script. +If \fIn\fP is supplied, the return value is its least significant +8 bits. +The return status is non-zero if +.B return +is supplied a non-numeric argument, or +is used outside a +function and not during execution of a script by \fB.\fP\^ or \fBsource\fP. +Any command associated with the \fBRETURN\fP trap is executed +before execution resumes after the function or script. +.TP +\fBset\fP [\fB\-\-abefhkmnptuvxBCEHPT\fP] [\fB\-o\fP \fIoption\-name\fP] [\fIarg\fP ...] +.PD 0 +.TP +\fBset\fP [\fB+abefhkmnptuvxBCEHPT\fP] [\fB+o\fP \fIoption\-name\fP] [\fIarg\fP ...] +.PD +Without options, the name and value of each shell variable are displayed +in a format that can be reused as input +for setting or resetting the currently-set variables. +Read-only variables cannot be reset. +In \fIposix\fP mode, only shell variables are listed. +The output is sorted according to the current locale. +When options are specified, they set or unset shell attributes. +Any arguments remaining after option processing are treated +as values for the positional parameters and are assigned, in order, to +.BR $1 , +.BR $2 , +.B ... +.BR $\fIn\fP . +Options, if specified, have the following meanings: +.RS +.PD 0 +.TP 8 +.B \-a +Automatically mark variables and functions which are modified or +created for export to the environment of subsequent commands. +.TP 8 +.B \-b +Report the status of terminated background jobs +immediately, rather than before the next primary prompt. This is +effective only when job control is enabled. +.TP 8 +.B \-e +Exit immediately if a +\fIpipeline\fP (which may consist of a single \fIsimple command\fP), +a \fIlist\fP, +or a \fIcompound command\fP +(see +.SM +.B SHELL GRAMMAR +above), exits with a non-zero status. +The shell does not exit if the +command that fails is part of the command list immediately following a +.B while +or +.B until +keyword, +part of the test following the +.B if +or +.B elif +reserved words, part of any command executed in a +.B && +or +.B || +list except the command following the final \fB&&\fP or \fB||\fP, +any command in a pipeline but the last, +or if the command's return value is +being inverted with +.BR ! . +If a compound command other than a subshell +returns a non-zero status because a command failed +while \fB\-e\fP was being ignored, the shell does not exit. +A trap on \fBERR\fP, if set, is executed before the shell exits. +This option applies to the shell environment and each subshell environment +separately (see +.SM +.B "COMMAND EXECUTION ENVIRONMENT" +above), and may cause +subshells to exit before executing all the commands in the subshell. +.if t .sp 0.5 +.if n .sp 1 +If a compound command or shell function executes in a context +where \fB\-e\fP is being ignored, +none of the commands executed within the compound command or function body +will be affected by the \fB\-e\fP setting, even if \fB\-e\fP is set +and a command returns a failure status. +If a compound command or shell function sets \fB\-e\fP while executing in +a context where \fB\-e\fP is ignored, that setting will not have any +effect until the compound command or the command containing the function +call completes. +.TP 8 +.B \-f +Disable pathname expansion. +.TP 8 +.B \-h +Remember the location of commands as they are looked up for execution. +This is enabled by default. +.TP 8 +.B \-k +All arguments in the form of assignment statements +are placed in the environment for a command, not just +those that precede the command name. +.TP 8 +.B \-m +Monitor mode. Job control is enabled. This option is on +by default for interactive shells on systems that support +it (see +.SM +.B JOB CONTROL +above). +All processes run in a separate process group. +When a background job completes, the shell prints a line +containing its exit status. +.TP 8 +.B \-n +Read commands but do not execute them. This may be used to +check a shell script for syntax errors. This is ignored by +interactive shells. +.TP 8 +.B \-o \fIoption\-name\fP +The \fIoption\-name\fP can be one of the following: +.RS +.TP 8 +.B allexport +Same as +.BR \-a . +.TP 8 +.B braceexpand +Same as +.BR \-B . +.TP 8 +.B emacs +Use an emacs-style command line editing interface. This is enabled +by default when the shell is interactive, unless the shell is started +with the +.B \-\-noediting +option. +This also affects the editing interface used for \fBread \-e\fP. +.TP 8 +.B errexit +Same as +.BR \-e . +.TP 8 +.B errtrace +Same as +.BR \-E . +.TP 8 +.B functrace +Same as +.BR \-T . +.TP 8 +.B hashall +Same as +.BR \-h . +.TP 8 +.B histexpand +Same as +.BR \-H . +.TP 8 +.B history +Enable command history, as described above under +.SM +.BR HISTORY . +This option is on by default in interactive shells. +.TP 8 +.B ignoreeof +The effect is as if the shell command +.if t \f(CWIGNOREEOF=10\fP +.if n ``IGNOREEOF=10'' +had been executed +(see +.B Shell Variables +above). +.TP 8 +.B keyword +Same as +.BR \-k . +.TP 8 +.B monitor +Same as +.BR \-m . +.TP 8 +.B noclobber +Same as +.BR \-C . +.TP 8 +.B noexec +Same as +.BR \-n . +.TP 8 +.B noglob +Same as +.BR \-f . +.TP 8 +.B nolog +Currently ignored. +.TP 8 +.B notify +Same as +.BR \-b . +.TP 8 +.B nounset +Same as +.BR \-u . +.TP 8 +.B onecmd +Same as +.BR \-t . +.TP 8 +.B physical +Same as +.BR \-P . +.TP 8 +.B pipefail +If set, the return value of a pipeline is the value of the last +(rightmost) command to exit with a non-zero status, or zero if all +commands in the pipeline exit successfully. +This option is disabled by default. +.TP 8 +.B posix +Change the behavior of +.B bash +where the default operation differs +from the POSIX standard to match the standard (\fIposix mode\fP). +See +.SM +.B "SEE ALSO" +below for a reference to a document that details how posix mode affects +bash's behavior. +.TP 8 +.B privileged +Same as +.BR \-p . +.TP 8 +.B verbose +Same as +.BR \-v . +.TP 8 +.B vi +Use a vi-style command line editing interface. +This also affects the editing interface used for \fBread \-e\fP. +.TP 8 +.B xtrace +Same as +.BR \-x . +.sp .5 +.PP +If +.B \-o +is supplied with no \fIoption\-name\fP, the values of the current options are +printed. +If +.B +o +is supplied with no \fIoption\-name\fP, a series of +.B set +commands to recreate the current option settings is displayed on +the standard output. +.RE +.TP 8 +.B \-p +Turn on +.I privileged +mode. In this mode, the +.SM +.B $ENV +and +.SM +.B $BASH_ENV +files are not processed, shell functions are not inherited from the +environment, and the +.SM +.BR SHELLOPTS , +.SM +.BR BASHOPTS , +.SM +.BR CDPATH , +and +.SM +.B GLOBIGNORE +variables, if they appear in the environment, are ignored. +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the \fB\-p\fP option is not supplied, these actions +are taken and the effective user id is set to the real user id. +If the \fB\-p\fP option is supplied at startup, the effective user id is +not reset. +Turning this option off causes the effective user +and group ids to be set to the real user and group ids. +.TP 8 +.B \-t +Exit after reading and executing one command. +.TP 8 +.B \-u +Treat unset variables and parameters other than the special +parameters "@" and "*" as an error when performing +parameter expansion. If expansion is attempted on an +unset variable or parameter, the shell prints an error message, and, +if not interactive, exits with a non-zero status. +.TP 8 +.B \-v +Print shell input lines as they are read. +.TP 8 +.B \-x +After expanding each \fIsimple command\fP, +\fBfor\fP command, \fBcase\fP command, \fBselect\fP command, or +arithmetic \fBfor\fP command, display the expanded value of +.SM +.BR PS4 , +followed by the command and its expanded arguments +or associated word list. +.TP 8 +.B \-B +The shell performs brace expansion (see +.B Brace Expansion +above). This is on by default. +.TP 8 +.B \-C +If set, +.B bash +does not overwrite an existing file with the +.BR > , +.BR >& , +and +.B <> +redirection operators. This may be overridden when +creating output files by using the redirection operator +.B >| +instead of +.BR > . +.TP 8 +.B \-E +If set, any trap on \fBERR\fP is inherited by shell functions, command +substitutions, and commands executed in a subshell environment. +The \fBERR\fP trap is normally not inherited in such cases. +.TP 8 +.B \-H +Enable +.B ! +style history substitution. This option is on by +default when the shell is interactive. +.TP 8 +.B \-P +If set, the shell does not resolve symbolic links when executing +commands such as +.B cd +that change the current working directory. It uses the +physical directory structure instead. By default, +.B bash +follows the logical chain of directories when performing commands +which change the current directory. +.TP 8 +.B \-T +If set, any traps on \fBDEBUG\fP and \fBRETURN\fP are inherited by shell +functions, command substitutions, and commands executed in a +subshell environment. +The \fBDEBUG\fP and \fBRETURN\fP traps are normally not inherited +in such cases. +.TP 8 +.B \-\- +If no arguments follow this option, then the positional parameters are +unset. Otherwise, the positional parameters are set to the +\fIarg\fPs, even if some of them begin with a +.BR \- . +.TP 8 +.B \- +Signal the end of options, cause all remaining \fIarg\fPs to be +assigned to the positional parameters. The +.B \-x +and +.B \-v +options are turned off. +If there are no \fIarg\fPs, +the positional parameters remain unchanged. +.PD +.PP +The options are off by default unless otherwise noted. +Using + rather than \- causes these options to be turned off. +The options can also be specified as arguments to an invocation of +the shell. +The current set of options may be found in +.BR $\- . +The return status is always true unless an invalid option is encountered. +.RE +.TP +\fBshift\fP [\fIn\fP] +The positional parameters from \fIn\fP+1 ... are renamed to +.B $1 +.B .... +Parameters represented by the numbers \fB$#\fP +down to \fB$#\fP\-\fIn\fP+1 are unset. +.I n +must be a non-negative number less than or equal to \fB$#\fP. +If +.I n +is 0, no parameters are changed. +If +.I n +is not given, it is assumed to be 1. +If +.I n +is greater than \fB$#\fP, the positional parameters are not changed. +The return status is greater than zero if +.I n +is greater than +.B $# +or less than zero; otherwise 0. +.TP +\fBshopt\fP [\fB\-pqsu\fP] [\fB\-o\fP] [\fIoptname\fP ...] +Toggle the values of settings controlling optional shell behavior. +The settings can be either those listed below, or, if the +.B \-o +option is used, those available with the +.B \-o +option to the \fBset\fP builtin command. +With no options, or with the +.B \-p +option, a list of all settable options is displayed, with +an indication of whether or not each is set. +The \fB\-p\fP option causes output to be displayed in a form that +may be reused as input. +Other options have the following meanings: +.RS +.PD 0 +.TP +.B \-s +Enable (set) each \fIoptname\fP. +.TP +.B \-u +Disable (unset) each \fIoptname\fP. +.TP +.B \-q +Suppresses normal output (quiet mode); the return status indicates +whether the \fIoptname\fP is set or unset. +If multiple \fIoptname\fP arguments are given with +.BR \-q , +the return status is zero if all \fIoptnames\fP are enabled; non-zero +otherwise. +.TP +.B \-o +Restricts the values of \fIoptname\fP to be those defined for the +.B \-o +option to the +.B set +builtin. +.PD +.PP +If either +.B \-s +or +.B \-u +is used with no \fIoptname\fP arguments, +.B shopt +shows only those options which are set or unset, respectively. +Unless otherwise noted, the \fBshopt\fP options are disabled (unset) +by default. +.PP +The return status when listing options is zero if all \fIoptnames\fP +are enabled, non-zero otherwise. When setting or unsetting options, +the return status is zero unless an \fIoptname\fP is not a valid shell +option. +.PP +The list of \fBshopt\fP options is: +.if t .sp .5v +.if n .sp 1v +.PD 0 +.TP 8 +.B autocd +If set, a command name that is the name of a directory is executed as if +it were the argument to the \fBcd\fP command. +This option is only used by interactive shells. +.TP 8 +.B cdable_vars +If set, an argument to the +.B cd +builtin command that +is not a directory is assumed to be the name of a variable whose +value is the directory to change to. +.TP 8 +.B cdspell +If set, minor errors in the spelling of a directory component in a +.B cd +command will be corrected. +The errors checked for are transposed characters, +a missing character, and one character too many. +If a correction is found, the corrected filename is printed, +and the command proceeds. +This option is only used by interactive shells. +.TP 8 +.B checkhash +If set, \fBbash\fP checks that a command found in the hash +table exists before trying to execute it. If a hashed command no +longer exists, a normal path search is performed. +.TP 8 +.B checkjobs +If set, \fBbash\fP lists the status of any stopped and running jobs before +exiting an interactive shell. If any jobs are running, this causes +the exit to be deferred until a second exit is attempted without an +intervening command (see +.SM +.B "JOB CONTROL" +above). The shell always +postpones exiting if any jobs are stopped. +.TP 8 +.B checkwinsize +If set, \fBbash\fP checks the window size after each command +and, if necessary, updates the values of +.SM +.B LINES +and +.SM +.BR COLUMNS . +.TP 8 +.B cmdhist +If set, +.B bash +attempts to save all lines of a multiple-line +command in the same history entry. This allows +easy re-editing of multi-line commands. +.TP 8 +.B compat31 +If set, +.B bash +changes its behavior to that of version 3.1 with respect to quoted +arguments to the \fB[[\fP conditional command's \fB=~\fP operator +and locale-specific string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators. +Bash versions prior to bash-4.1 use ASCII collation and +.IR strcmp (3); +bash-4.1 and later use the current locale's collation sequence and +.IR strcoll (3). +.TP 8 +.B compat32 +If set, +.B bash +changes its behavior to that of version 3.2 with respect to +locale-specific string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators (see previous item). +.TP 8 +.B compat40 +If set, +.B bash +changes its behavior to that of version 4.0 with respect to locale-specific +string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators (see description of +\fBcompat31\fP) +and the effect of interrupting a command list. +Bash versions 4.0 and later interrupt the list as if the shell received the +interrupt; previous versions continue with the next command in the list. +.TP 8 +.B compat41 +If set, +.BR bash , +when in \fIposix\fP mode, treats a single quote in a double-quoted +parameter expansion as a special character. The single quotes must match +(an even number) and the characters between the single quotes are considered +quoted. This is the behavior of posix mode through version 4.1. +The default bash behavior remains as in previous versions. +.TP 8 +.B compat42 +If set, +.B bash +does not process the replacement string in the pattern substitution word +expansion using quote removal. +.TP 8 +.B complete_fullquote +If set, +.B bash +quotes all shell metacharacters in filenames and directory names when +performing completion. +If not set, +.B bash +removes metacharacters such as the dollar sign from the set of +characters that will be quoted in completed filenames +when these metacharacters appear in shell variable references in words to be +completed. +This means that dollar signs in variable names that expand to directories +will not be quoted; +however, any dollar signs appearing in filenames will not be quoted, either. +This is active only when bash is using backslashes to quote completed +filenames. +This variable is set by default, which is the default bash behavior in +versions through 4.2. +.TP 8 +.B direxpand +If set, +.B bash +replaces directory names with the results of word expansion when performing +filename completion. This changes the contents of the readline editing +buffer. +If not set, +.B bash +attempts to preserve what the user typed. +.TP 8 +.B dirspell +If set, +.B bash +attempts spelling correction on directory names during word completion +if the directory name initially supplied does not exist. +.TP 8 +.B dotglob +If set, +.B bash +includes filenames beginning with a `.' in the results of pathname +expansion. +.TP 8 +.B execfail +If set, a non-interactive shell will not exit if +it cannot execute the file specified as an argument to the +.B exec +builtin command. An interactive shell does not exit if +.B exec +fails. +.TP 8 +.B expand_aliases +If set, aliases are expanded as described above under +.SM +.BR ALIASES . +This option is enabled by default for interactive shells. +.TP 8 +.B extdebug +If set, behavior intended for use by debuggers is enabled: +.RS +.TP +.B 1. +The \fB\-F\fP option to the \fBdeclare\fP builtin displays the source +file name and line number corresponding to each function name supplied +as an argument. +.TP +.B 2. +If the command run by the \fBDEBUG\fP trap returns a non-zero value, the +next command is skipped and not executed. +.TP +.B 3. +If the command run by the \fBDEBUG\fP trap returns a value of 2, and the +shell is executing in a subroutine (a shell function or a shell script +executed by the \fB.\fP or \fBsource\fP builtins), a call to +\fBreturn\fP is simulated. +.TP +.B 4. +.SM +.B BASH_ARGC +and +.SM +.B BASH_ARGV +are updated as described in their descriptions above. +.TP +.B 5. +Function tracing is enabled: command substitution, shell functions, and +subshells invoked with \fB(\fP \fIcommand\fP \fB)\fP inherit the +\fBDEBUG\fP and \fBRETURN\fP traps. +.TP +.B 6. +Error tracing is enabled: command substitution, shell functions, and +subshells invoked with \fB(\fP \fIcommand\fP \fB)\fP inherit the +\fBERR\fP trap. +.RE +.TP 8 +.B extglob +If set, the extended pattern matching features described above under +\fBPathname Expansion\fP are enabled. +.TP 8 +.B extquote +If set, \fB$\fP\(aq\fIstring\fP\(aq and \fB$\fP"\fIstring\fP" quoting is +performed within \fB${\fP\fIparameter\fP\fB}\fP expansions +enclosed in double quotes. This option is enabled by default. +.TP 8 +.B failglob +If set, patterns which fail to match filenames during pathname expansion +result in an expansion error. +.TP 8 +.B force_fignore +If set, the suffixes specified by the +.SM +.B FIGNORE +shell variable +cause words to be ignored when performing word completion even if +the ignored words are the only possible completions. +See +.SM +\fBSHELL VARIABLES\fP +above for a description of +.SM +.BR FIGNORE . +This option is enabled by default. +.TP 8 +.B globasciiranges +If set, range expressions used in pattern matching bracket expressions (see +.SM +.B Pattern Matching +above) behave as if in the traditional C locale when performing +comparisons. That is, the current locale's collating sequence +is not taken into account, so +.B b +will not collate between +.B A +and +.BR B , +and upper-case and lower-case ASCII characters will collate together. +.TP 8 +.B globstar +If set, the pattern \fB**\fP used in a pathname expansion context will +match all files and zero or more directories and subdirectories. +If the pattern is followed by a \fB/\fP, only directories and +subdirectories match. +.TP 8 +.B gnu_errfmt +If set, shell error messages are written in the standard GNU error +message format. +.TP 8 +.B histappend +If set, the history list is appended to the file named by the value +of the +.SM +.B HISTFILE +variable when the shell exits, rather than overwriting the file. +.TP 8 +.B histreedit +If set, and +.B readline +is being used, a user is given the opportunity to re-edit a +failed history substitution. +.TP 8 +.B histverify +If set, and +.B readline +is being used, the results of history substitution are not immediately +passed to the shell parser. Instead, the resulting line is loaded into +the \fBreadline\fP editing buffer, allowing further modification. +.TP 8 +.B hostcomplete +If set, and +.B readline +is being used, \fBbash\fP will attempt to perform hostname completion when a +word containing a \fB@\fP is being completed (see +.B Completing +under +.SM +.B READLINE +above). +This is enabled by default. +.TP 8 +.B huponexit +If set, \fBbash\fP will send +.SM +.B SIGHUP +to all jobs when an interactive login shell exits. +.TP 8 +.B interactive_comments +If set, allow a word beginning with +.B # +to cause that word and all remaining characters on that +line to be ignored in an interactive shell (see +.SM +.B COMMENTS +above). This option is enabled by default. +.TP 8 +.B lastpipe +If set, and job control is not active, the shell runs the last command of +a pipeline not executed in the background in the current shell environment. +.TP 8 +.B lithist +If set, and the +.B cmdhist +option is enabled, multi-line commands are saved to the history with +embedded newlines rather than using semicolon separators where possible. +.TP 8 +.B login_shell +The shell sets this option if it is started as a login shell (see +.SM +.B "INVOCATION" +above). +The value may not be changed. +.TP 8 +.B mailwarn +If set, and a file that \fBbash\fP is checking for mail has been +accessed since the last time it was checked, the message ``The mail in +\fImailfile\fP has been read'' is displayed. +.TP 8 +.B no_empty_cmd_completion +If set, and +.B readline +is being used, +.B bash +will not attempt to search the +.SM +.B PATH +for possible completions when +completion is attempted on an empty line. +.TP 8 +.B nocaseglob +If set, +.B bash +matches filenames in a case\-insensitive fashion when performing pathname +expansion (see +.B Pathname Expansion +above). +.TP 8 +.B nocasematch +If set, +.B bash +matches patterns in a case\-insensitive fashion when performing matching +while executing \fBcase\fP or \fB[[\fP conditional commands. +.TP 8 +.B nullglob +If set, +.B bash +allows patterns which match no +files (see +.B Pathname Expansion +above) +to expand to a null string, rather than themselves. +.TP 8 +.B progcomp +If set, the programmable completion facilities (see +\fBProgrammable Completion\fP above) are enabled. +This option is enabled by default. +.TP 8 +.B promptvars +If set, prompt strings undergo +parameter expansion, command substitution, arithmetic +expansion, and quote removal after being expanded as described in +.SM +.B PROMPTING +above. This option is enabled by default. +.TP 8 +.B restricted_shell +The shell sets this option if it is started in restricted mode (see +.SM +.B "RESTRICTED SHELL" +below). +The value may not be changed. +This is not reset when the startup files are executed, allowing +the startup files to discover whether or not a shell is restricted. +.TP 8 +.B shift_verbose +If set, the +.B shift +builtin prints an error message when the shift count exceeds the +number of positional parameters. +.TP 8 +.B sourcepath +If set, the +\fBsource\fP (\fB.\fP) builtin uses the value of +.SM +.B PATH +to find the directory containing the file supplied as an argument. +This option is enabled by default. +.TP 8 +.B xpg_echo +If set, the \fBecho\fP builtin expands backslash-escape sequences +by default. +.RE +.PD +.TP +\fBsuspend\fP [\fB\-f\fP] +Suspend the execution of this shell until it receives a +.SM +.B SIGCONT +signal. A login shell cannot be suspended; the +.B \-f +option can be used to override this and force the suspension. +The return status is 0 unless the shell is a login shell and +.B \-f +is not supplied, or if job control is not enabled. +.TP +\fBtest\fP \fIexpr\fP +.PD 0 +.TP +\fB[\fP \fIexpr\fP \fB]\fP +Return a status of 0 (true) or 1 (false) depending on +the evaluation of the conditional expression +.IR expr . +Each operator and operand must be a separate argument. +Expressions are composed of the primaries described above under +.SM +.BR "CONDITIONAL EXPRESSIONS" . +\fBtest\fP does not accept any options, nor does it accept and ignore +an argument of \fB\-\-\fP as signifying the end of options. +.if t .sp 0.5 +.if n .sp 1 +Expressions may be combined using the following operators, listed +in decreasing order of precedence. +The evaluation depends on the number of arguments; see below. +Operator precedence is used when there are five or more arguments. +.RS +.PD 0 +.TP +.B ! \fIexpr\fP +True if +.I expr +is false. +.TP +.B ( \fIexpr\fP ) +Returns the value of \fIexpr\fP. +This may be used to override the normal precedence of operators. +.TP +\fIexpr1\fP \-\fBa\fP \fIexpr2\fP +True if both +.I expr1 +and +.I expr2 +are true. +.TP +\fIexpr1\fP \-\fBo\fP \fIexpr2\fP +True if either +.I expr1 +or +.I expr2 +is true. +.PD +.PP +\fBtest\fP and \fB[\fP evaluate conditional +expressions using a set of rules based on the number of arguments. +.if t .sp 0.5 +.if n .sp 1 +.PD 0 +.TP +0 arguments +The expression is false. +.TP +1 argument +The expression is true if and only if the argument is not null. +.TP +2 arguments +If the first argument is \fB!\fP, the expression is true if and +only if the second argument is null. +If the first argument is one of the unary conditional operators listed above +under +.SM +.BR "CONDITIONAL EXPRESSIONS" , +the expression is true if the unary test is true. +If the first argument is not a valid unary conditional operator, the expression +is false. +.TP +3 arguments +The following conditions are applied in the order listed. +If the second argument is one of the binary conditional operators listed above +under +.SM +.BR "CONDITIONAL EXPRESSIONS" , +the result of the expression is the result of the binary test using +the first and third arguments as operands. +The \fB\-a\fP and \fB\-o\fP operators are considered binary operators +when there are three arguments. +If the first argument is \fB!\fP, the value is the negation of +the two-argument test using the second and third arguments. +If the first argument is exactly \fB(\fP and the third argument is +exactly \fB)\fP, the result is the one-argument test of the second +argument. +Otherwise, the expression is false. +.TP +4 arguments +If the first argument is \fB!\fP, the result is the negation of +the three-argument expression composed of the remaining arguments. +Otherwise, the expression is parsed and evaluated according to +precedence using the rules listed above. +.TP +5 or more arguments +The expression is parsed and evaluated according to precedence +using the rules listed above. +.if t .sp 0.5 +.if n .sp 1 +.LP +When used with \fBtest\fP or \fB[\fP, the \fB<\fP and \fB>\fP operators +sort lexicographically using ASCII ordering. +.RE +.PD +.TP +.B times +Print the accumulated user and system times for the shell and +for processes run from the shell. The return status is 0. +.TP +\fBtrap\fP [\fB\-lp\fP] [[\fIarg\fP] \fIsigspec\fP ...] +The command +.I arg +is to be read and executed when the shell receives +signal(s) +.IR sigspec . +If +.I arg +is absent (and there is a single \fIsigspec\fP) or +.BR \- , +each specified signal is +reset to its original disposition (the value it had +upon entrance to the shell). +If +.I arg +is the null string the signal specified by each +.I sigspec +is ignored by the shell and by the commands it invokes. +If +.I arg +is not present and +.B \-p +has been supplied, then the trap commands associated with each +.I sigspec +are displayed. +If no arguments are supplied or if only +.B \-p +is given, +.B trap +prints the list of commands associated with each signal. +The +.B \-l +option causes the shell to print a list of signal names and +their corresponding numbers. +Each +.I sigspec +is either +a signal name defined in <\fIsignal.h\fP>, or a signal number. +Signal names are case insensitive and the +.SM +.B SIG +prefix is optional. +.if t .sp 0.5 +.if n .sp 1 +If a +.I sigspec +is +.SM +.B EXIT +(0) the command +.I arg +is executed on exit from the shell. +If a +.I sigspec +is +.SM +.BR DEBUG , +the command +.I arg +is executed before every \fIsimple command\fP, \fIfor\fP command, +\fIcase\fP command, \fIselect\fP command, every arithmetic \fIfor\fP +command, and before the first command executes in a shell function (see +.SM +.B SHELL GRAMMAR +above). +Refer to the description of the \fBextdebug\fP option to the +\fBshopt\fP builtin for details of its effect on the \fBDEBUG\fP trap. +If a +.I sigspec +is +.SM +.BR RETURN , +the command +.I arg +is executed each time a shell function or a script executed with +the \fB.\fP or \fBsource\fP builtins finishes executing. +.if t .sp 0.5 +.if n .sp 1 +If a +.I sigspec +is +.SM +.BR ERR , +the command +.I arg +is executed whenever a +a pipeline (which may consist of a single simple +command), a list, or a compound command returns a +non\-zero exit status, +subject to the following conditions. +The +.SM +.B ERR +trap is not executed if the failed +command is part of the command list immediately following a +.B while +or +.B until +keyword, +part of the test in an +.I if +statement, part of a command executed in a +.B && +or +.B || +list except the command following the final \fB&&\fP or \fB||\fP, +any command in a pipeline but the last, +or if the command's return value is +being inverted using +.BR ! . +These are the same conditions obeyed by the \fBerrexit\fP (\fB\-e\fP) option. +.if t .sp 0.5 +.if n .sp 1 +Signals ignored upon entry to the shell cannot be trapped or reset. +Trapped signals that are not being ignored are reset to their original +values in a subshell or subshell environment when one is created. +The return status is false if any +.I sigspec +is invalid; otherwise +.B trap +returns true. +.TP +\fBtype\fP [\fB\-aftpP\fP] \fIname\fP [\fIname\fP ...] +With no options, +indicate how each +.I name +would be interpreted if used as a command name. +If the +.B \-t +option is used, +.B type +prints a string which is one of +.IR alias , +.IR keyword , +.IR function , +.IR builtin , +or +.I file +if +.I name +is an alias, shell reserved word, function, builtin, or disk file, +respectively. +If the +.I name +is not found, then nothing is printed, and an exit status of false +is returned. +If the +.B \-p +option is used, +.B type +either returns the name of the disk file +that would be executed if +.I name +were specified as a command name, +or nothing if +.if t \f(CWtype -t name\fP +.if n ``type -t name'' +would not return +.IR file . +The +.B \-P +option forces a +.SM +.B PATH +search for each \fIname\fP, even if +.if t \f(CWtype -t name\fP +.if n ``type -t name'' +would not return +.IR file . +If a command is hashed, +.B \-p +and +.B \-P +print the hashed value, which is not necessarily the file that appears +first in +.SM +.BR PATH . +If the +.B \-a +option is used, +.B type +prints all of the places that contain +an executable named +.IR name . +This includes aliases and functions, +if and only if the +.B \-p +option is not also used. +The table of hashed commands is not consulted +when using +.BR \-a . +The +.B \-f +option suppresses shell function lookup, as with the \fBcommand\fP builtin. +.B type +returns true if all of the arguments are found, false if +any are not found. +.TP +\fBulimit\fP [\fB\-HSTabcdefilmnpqrstuvx\fP [\fIlimit\fP]] +Provides control over the resources available to the shell and to +processes started by it, on systems that allow such control. +The \fB\-H\fP and \fB\-S\fP options specify that the hard or soft limit is +set for the given resource. +A hard limit cannot be increased by a non-root user once it is set; +a soft limit may be increased up to the value of the hard limit. +If neither \fB\-H\fP nor \fB\-S\fP is specified, both the soft and hard +limits are set. +The value of +.I limit +can be a number in the unit specified for the resource +or one of the special values +.BR hard , +.BR soft , +or +.BR unlimited , +which stand for the current hard limit, the current soft limit, and +no limit, respectively. +If +.I limit +is omitted, the current value of the soft limit of the resource is +printed, unless the \fB\-H\fP option is given. When more than one +resource is specified, the limit name and unit are printed before the value. +Other options are interpreted as follows: +.RS +.PD 0 +.TP +.B \-a +All current limits are reported +.TP +.B \-b +The maximum socket buffer size +.TP +.B \-c +The maximum size of core files created +.TP +.B \-d +The maximum size of a process's data segment +.TP +.B \-e +The maximum scheduling priority ("nice") +.TP +.B \-f +The maximum size of files written by the shell and its children +.TP +.B \-i +The maximum number of pending signals +.TP +.B \-l +The maximum size that may be locked into memory +.TP +.B \-m +The maximum resident set size (many systems do not honor this limit) +.TP +.B \-n +The maximum number of open file descriptors (most systems do not +allow this value to be set) +.TP +.B \-p +The pipe size in 512-byte blocks (this may not be set) +.TP +.B \-q +The maximum number of bytes in POSIX message queues +.TP +.B \-r +The maximum real-time scheduling priority +.TP +.B \-s +The maximum stack size +.TP +.B \-t +The maximum amount of cpu time in seconds +.TP +.B \-u +The maximum number of processes available to a single user +.TP +.B \-v +The maximum amount of virtual memory available to the shell and, on +some systems, to its children +.TP +.B \-x +The maximum number of file locks +.TP +.B \-T +The maximum number of threads +.PD +.PP +If +.I limit +is given, and the +.B \-a +option is not used, +\fIlimit\fP is the new value of the specified resource. +If no option is given, then +.B \-f +is assumed. Values are in 1024-byte increments, except for +.BR \-t , +which is in seconds; +.BR \-p , +which is in units of 512-byte blocks; +and +.BR \-T , +.BR \-b , +.BR \-n , +and +.BR \-u , +which are unscaled values. +The return status is 0 unless an invalid option or argument is supplied, +or an error occurs while setting a new limit. +.RE +.TP +\fBumask\fP [\fB\-p\fP] [\fB\-S\fP] [\fImode\fP] +The user file-creation mask is set to +.IR mode . +If +.I mode +begins with a digit, it +is interpreted as an octal number; otherwise +it is interpreted as a symbolic mode mask similar +to that accepted by +.IR chmod (1). +If +.I mode +is omitted, the current value of the mask is printed. +The +.B \-S +option causes the mask to be printed in symbolic form; the +default output is an octal number. +If the +.B \-p +option is supplied, and +.I mode +is omitted, the output is in a form that may be reused as input. +The return status is 0 if the mode was successfully changed or if +no \fImode\fP argument was supplied, and false otherwise. +.TP +\fBunalias\fP [\-\fBa\fP] [\fIname\fP ...] +Remove each \fIname\fP from the list of defined aliases. If +.B \-a +is supplied, all alias definitions are removed. The return +value is true unless a supplied +.I name +is not a defined alias. +.TP +\fBunset\fP [\-\fBfv\fP] [\-\fBn\fP] [\fIname\fP ...] +For each +.IR name , +remove the corresponding variable or function. +If the +.B \-v +option is given, each +.I name +refers to a shell variable, and that variable is removed. +Read-only variables may not be unset. +If +.B \-f +is specified, each +.I name +refers to a shell function, and the function definition +is removed. +If the +.B \-n +option is supplied, and \fIname\fP is a variable with the \fInameref\fP +attribute, \fIname\fP will be unset rather than the variable it +references. +\fB\-n\fP has no effect if the \fB\-f\fP option is supplied. +If no options are supplied, each \fIname\fP refers to a variable; if +there is no variable by that name, any function with that name is +unset. +Each unset variable or function is removed from the environment +passed to subsequent commands. +If any of +.SM +.BR COMP_WORDBREAKS , +.SM +.BR RANDOM , +.SM +.BR SECONDS , +.SM +.BR LINENO , +.SM +.BR HISTCMD , +.SM +.BR FUNCNAME , +.SM +.BR GROUPS , +or +.SM +.B DIRSTACK +are unset, they lose their special properties, even if they are +subsequently reset. The exit status is true unless a +.I name +is readonly. +.TP +\fBwait\fP [\fB\-n\fP] [\fIn ...\fP] +Wait for each specified child process and return its termination status. +Each +.I n +may be a process +ID or a job specification; if a job spec is given, all processes +in that job's pipeline are waited for. If +.I n +is not given, all currently active child processes +are waited for, and the return status is zero. +If the \fB\-n\fP option is supplied, \fBwait\fP waits for any job to +terminate and returns its exit status. +If +.I n +specifies a non-existent process or job, the return status is +127. Otherwise, the return status is the exit status of the last +process or job waited for. +.\" bash_builtins +.if \n(zZ=1 .ig zZ +.SH "RESTRICTED SHELL" +.\" rbash.1 +.zY +.PP +If +.B bash +is started with the name +.BR rbash , +or the +.B \-r +option is supplied at invocation, +the shell becomes restricted. +A restricted shell is used to +set up an environment more controlled than the standard shell. +It behaves identically to +.B bash +with the exception that the following are disallowed or not performed: +.IP \(bu +changing directories with \fBcd\fP +.IP \(bu +setting or unsetting the values of +.SM +.BR SHELL , +.SM +.BR PATH , +.SM +.BR ENV , +or +.SM +.B BASH_ENV +.IP \(bu +specifying command names containing +.B / +.IP \(bu +specifying a filename containing a +.B / +as an argument to the +.B . +builtin command +.IP \(bu +specifying a filename containing a slash as an argument to the +.B \-p +option to the +.B hash +builtin command +.IP \(bu +importing function definitions from the shell environment at startup +.IP \(bu +parsing the value of +.SM +.B SHELLOPTS +from the shell environment at startup +.IP \(bu +redirecting output using the >, >|, <>, >&, &>, and >> redirection operators +.IP \(bu +using the +.B exec +builtin command to replace the shell with another command +.IP \(bu +adding or deleting builtin commands with the +.B \-f +and +.B \-d +options to the +.B enable +builtin command +.IP \(bu +using the \fBenable\fP builtin command to enable disabled shell builtins +.IP \(bu +specifying the +.B \-p +option to the +.B command +builtin command +.IP \(bu +turning off restricted mode with +\fBset +r\fP or \fBset +o restricted\fP. +.PP +These restrictions are enforced after any startup files are read. +.PP +.ie \n(zY=1 When a command that is found to be a shell script is executed, +.el \{ When a command that is found to be a shell script is executed +(see +.SM +.B "COMMAND EXECUTION" +above), +\} +.B rbash +turns off any restrictions in the shell spawned to execute the +script. +.\" end of rbash.1 +.if \n(zY=1 .ig zY +.SH "SEE ALSO" +.PD 0 +.TP +\fIBash Reference Manual\fP, Brian Fox and Chet Ramey +.TP +\fIThe Gnu Readline Library\fP, Brian Fox and Chet Ramey +.TP +\fIThe Gnu History Library\fP, Brian Fox and Chet Ramey +.TP +\fIPortable Operating System Interface (POSIX) Part 2: Shell and Utilities\fP, IEEE -- +http://pubs.opengroup.org/onlinepubs/9699919799/ +.TP +http://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode +.TP +\fIsh\fP(1), \fIksh\fP(1), \fIcsh\fP(1) +.TP +\fIemacs\fP(1), \fIvi\fP(1) +.TP +\fIreadline\fP(3) +.PD +.SH FILES +.PD 0 +.TP +.FN /bin/bash +The \fBbash\fP executable +.TP +.FN /etc/profile +The systemwide initialization file, executed for login shells +.TP +.FN ~/.bash_profile +The personal initialization file, executed for login shells +.TP +.FN ~/.bashrc +The individual per-interactive-shell startup file +.TP +.FN ~/.bash_logout +The individual login shell cleanup file, executed when a login shell exits +.TP +.FN ~/.inputrc +Individual \fIreadline\fP initialization file +.PD +.SH AUTHORS +Brian Fox, Free Software Foundation +.br +bfox@gnu.org +.PP +Chet Ramey, Case Western Reserve University +.br +chet.ramey@case.edu +.SH BUG REPORTS +If you find a bug in +.B bash, +you should report it. But first, you should +make sure that it really is a bug, and that it appears in the latest +version of +.BR bash . +The latest version is always available from +\fIftp://ftp.gnu.org/pub/gnu/bash/\fP. +.PP +Once you have determined that a bug actually exists, use the +.I bashbug +command to submit a bug report. +If you have a fix, you are encouraged to mail that as well! +Suggestions and `philosophical' bug reports may be mailed +to \fIbug-bash@gnu.org\fP or posted to the Usenet +newsgroup +.BR gnu.bash.bug . +.PP +ALL bug reports should include: +.PP +.PD 0 +.TP 20 +The version number of \fBbash\fR +.TP +The hardware and operating system +.TP +The compiler used to compile +.TP +A description of the bug behaviour +.TP +A short script or `recipe' which exercises the bug +.PD +.PP +.I bashbug +inserts the first three items automatically into the template +it provides for filing a bug report. +.PP +Comments and bug reports concerning +this manual page should be directed to +.IR chet.ramey@case.edu . +.SH BUGS +.PP +It's too big and too slow. +.PP +There are some subtle differences between +.B bash +and traditional versions of +.BR sh , +mostly because of the +.SM +.B POSIX +specification. +.PP +Aliases are confusing in some uses. +.PP +Shell builtin commands and functions are not stoppable/restartable. +.PP +Compound commands and command sequences of the form `a ; b ; c' +are not handled gracefully when process suspension is attempted. +When a process is stopped, the shell immediately executes the next +command in the sequence. +It suffices to place the sequence of commands between +parentheses to force it into a subshell, which may be stopped as +a unit. +.PP +Array variables may not (yet) be exported. +.PP +There may be only one active coprocess at a time. +.zZ +.zY diff --git a/.pc/man-nocaseglob.diff/doc/bash.1 b/.pc/man-nocaseglob.diff/doc/bash.1 new file mode 100644 index 0000000..f157891 --- /dev/null +++ b/.pc/man-nocaseglob.diff/doc/bash.1 @@ -0,0 +1,10349 @@ +.\" +.\" MAN PAGE COMMENTS to +.\" +.\" Chet Ramey +.\" Case Western Reserve University +.\" chet.ramey@case.edu +.\" +.\" Last Change: Sun Feb 2 16:21:40 EST 2014 +.\" +.\" bash_builtins, strip all but Built-Ins section +.if \n(zZ=1 .ig zZ +.if \n(zY=1 .ig zY +.TH BASH 1 "2014 February 2" "GNU Bash 4.3" +.\" +.\" There's some problem with having a `@' +.\" in a tagged paragraph with the BSD man macros. +.\" It has to do with `@' appearing in the }1 macro. +.\" This is a problem on 4.3 BSD and Ultrix, but Sun +.\" appears to have fixed it. +.\" If you're seeing the characters +.\" `@u-3p' appearing before the lines reading +.\" `possible-hostname-completions +.\" and `complete-hostname' down in READLINE, +.\" then uncomment this redefinition. +.\" +.de }1 +.ds ]X \&\\*(]B\\ +.nr )E 0 +.if !"\\$1"" .nr )I \\$1n +.}f +.ll \\n(LLu +.in \\n()Ru+\\n(INu+\\n()Iu +.ti \\n(INu +.ie !\\n()Iu+\\n()Ru-\w\\*(]Xu-3p \{\\*(]X +.br\} +.el \\*(]X\h|\\n()Iu+\\n()Ru\c +.}f +.. +.\" +.\" File Name macro. This used to be `.PN', for Path Name, +.\" but Sun doesn't seem to like that very much. +.\" +.de FN +\fI\|\\$1\|\fP +.. +.SH NAME +bash \- GNU Bourne-Again SHell +.SH SYNOPSIS +.B bash +[options] +[command_string | file] +.SH COPYRIGHT +.if n Bash is Copyright (C) 1989-2013 by the Free Software Foundation, Inc. +.if t Bash is Copyright \(co 1989-2013 by the Free Software Foundation, Inc. +.SH DESCRIPTION +.B Bash +is an \fBsh\fR-compatible command language interpreter that +executes commands read from the standard input or from a file. +.B Bash +also incorporates useful features from the \fIKorn\fP and \fIC\fP +shells (\fBksh\fP and \fBcsh\fP). +.PP +.B Bash +is intended to be a conformant implementation of the +Shell and Utilities portion of the IEEE POSIX specification +(IEEE Standard 1003.1). +.B Bash +can be configured to be POSIX-conformant by default. +.SH OPTIONS +All of the single-character shell options documented in the +description of the \fBset\fR builtin command can be used as options +when the shell is invoked. +In addition, \fBbash\fR +interprets the following options when it is invoked: +.PP +.PD 0 +.TP 10 +.B \-c +If the +.B \-c +option is present, then commands are read from the first non-option argument +.IR command_string . +If there are arguments after the +.IR command_string , +they are assigned to the positional parameters, starting with +.BR $0 . +.TP +.B \-i +If the +.B \-i +option is present, the shell is +.IR interactive . +.TP +.B \-l +Make +.B bash +act as if it had been invoked as a login shell (see +.SM +.B INVOCATION +below). +.TP +.B \-r +If the +.B \-r +option is present, the shell becomes +.I restricted +(see +.SM +.B "RESTRICTED SHELL" +below). +.TP +.B \-s +If the +.B \-s +option is present, or if no arguments remain after option +processing, then commands are read from the standard input. +This option allows the positional parameters to be set +when invoking an interactive shell. +.TP +.B \-D +A list of all double-quoted strings preceded by \fB$\fP +is printed on the standard output. +These are the strings that +are subject to language translation when the current locale +is not \fBC\fP or \fBPOSIX\fP. +This implies the \fB\-n\fP option; no commands will be executed. +.TP +.B [\-+]O [\fIshopt_option\fP] +\fIshopt_option\fP is one of the shell options accepted by the +\fBshopt\fP builtin (see +.SM +.B SHELL BUILTIN COMMANDS +below). +If \fIshopt_option\fP is present, \fB\-O\fP sets the value of that option; +\fB+O\fP unsets it. +If \fIshopt_option\fP is not supplied, the names and values of the shell +options accepted by \fBshopt\fP are printed on the standard output. +If the invocation option is \fB+O\fP, the output is displayed in a format +that may be reused as input. +.TP +.B \-\- +A +.B \-\- +signals the end of options and disables further option processing. +Any arguments after the +.B \-\- +are treated as filenames and arguments. An argument of +.B \- +is equivalent to \fB\-\-\fP. +.PD +.PP +.B Bash +also interprets a number of multi-character options. +These options must appear on the command line before the +single-character options to be recognized. +.PP +.PD 0 +.TP +.B \-\-debugger +Arrange for the debugger profile to be executed before the shell +starts. +Turns on extended debugging mode (see the description of the +.B extdebug +option to the +.B shopt +builtin below). +.TP +.B \-\-dump\-po\-strings +Equivalent to \fB\-D\fP, but the output is in the GNU \fIgettext\fP +\fBpo\fP (portable object) file format. +.TP +.B \-\-dump\-strings +Equivalent to \fB\-D\fP. +.TP +.B \-\-help +Display a usage message on standard output and exit successfully. +.TP +\fB\-\-init\-file\fP \fIfile\fP +.PD 0 +.TP +\fB\-\-rcfile\fP \fIfile\fP +.PD +Execute commands from +.I file +instead of the system wide initialization file +.I /etc/bash.bashrc +and the standard personal initialization file +.I ~/.bashrc +if the shell is interactive (see +.SM +.B INVOCATION +below). +.TP +.B \-\-login +Equivalent to \fB\-l\fP. +.TP +.B \-\-noediting +Do not use the GNU +.B readline +library to read command lines when the shell is interactive. +.TP +.B \-\-noprofile +Do not read either the system-wide startup file +.FN /etc/profile +or any of the personal initialization files +.IR ~/.bash_profile , +.IR ~/.bash_login , +or +.IR ~/.profile . +By default, +.B bash +reads these files when it is invoked as a login shell (see +.SM +.B INVOCATION +below). +.TP +.B \-\-norc +Do not read and execute the system wide initialization file +.I /etc/bash.bashrc +and the personal initialization file +.I ~/.bashrc +if the shell is interactive. +This option is on by default if the shell is invoked as +.BR sh . +.TP +.B \-\-posix +Change the behavior of \fBbash\fP where the default operation differs +from the POSIX standard to match the standard (\fIposix mode\fP). +See +.SM +.B "SEE ALSO" +below for a reference to a document that details how posix mode affects +bash's behavior. +.TP +.B \-\-restricted +The shell becomes restricted (see +.SM +.B "RESTRICTED SHELL" +below). +.TP +.B \-\-verbose +Equivalent to \fB\-v\fP. +.TP +.B \-\-version +Show version information for this instance of +.B bash +on the standard output and exit successfully. +.PD +.SH ARGUMENTS +If arguments remain after option processing, and neither the +.B \-c +nor the +.B \-s +option has been supplied, the first argument is assumed to +be the name of a file containing shell commands. +If +.B bash +is invoked in this fashion, +.B $0 +is set to the name of the file, and the positional parameters +are set to the remaining arguments. +.B Bash +reads and executes commands from this file, then exits. +\fBBash\fP's exit status is the exit status of the last command +executed in the script. +If no commands are executed, the exit status is 0. +An attempt is first made to open the file in the current directory, and, +if no file is found, then the shell searches the directories in +.SM +.B PATH +for the script. +.SH INVOCATION +A \fIlogin shell\fP is one whose first character of argument zero is a +.BR \- , +or one started with the +.B \-\-login +option. +.PP +An \fIinteractive\fP shell is one started without non-option arguments +and without the +.B \-c +option +whose standard input and error are +both connected to terminals (as determined by +.IR isatty (3)), +or one started with the +.B \-i +option. +.SM +.B PS1 +is set and +.B $\- +includes +.B i +if +.B bash +is interactive, +allowing a shell script or a startup file to test this state. +.PP +The following paragraphs describe how +.B bash +executes its startup files. +If any of the files exist but cannot be read, +.B bash +reports an error. +Tildes are expanded in filenames as described below under +.B "Tilde Expansion" +in the +.SM +.B EXPANSION +section. +.PP +When +.B bash +is invoked as an interactive login shell, or as a non-interactive shell +with the \fB\-\-login\fP option, it first reads and +executes commands from the file \fI/etc/profile\fP, if that +file exists. +After reading that file, it looks for \fI~/.bash_profile\fP, +\fI~/.bash_login\fP, and \fI~/.profile\fP, in that order, and reads +and executes commands from the first one that exists and is readable. +The +.B \-\-noprofile +option may be used when the shell is started to inhibit this behavior. +.PP +When a login shell exits, +.B bash +reads and executes commands from the file \fI~/.bash_logout\fP, if it +exists. +.PP +When an interactive shell that is not a login shell is started, +.B bash +reads and executes commands from \fI/etc/bash.bashrc\fP and \fI~/.bashrc\fP, +if these files exist. +This may be inhibited by using the +.B \-\-norc +option. +The \fB\-\-rcfile\fP \fIfile\fP option will force +.B bash +to read and execute commands from \fIfile\fP instead of +\fI/etc/bash.bashrc\fP and \fI~/.bashrc\fP. +.PP +When +.B bash +is started non-interactively, to run a shell script, for example, it +looks for the variable +.SM +.B BASH_ENV +in the environment, expands its value if it appears there, and uses the +expanded value as the name of a file to read and execute. +.B Bash +behaves as if the following command were executed: +.sp .5 +.RS +.if t \f(CWif [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi\fP +.if n if [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi +.RE +.sp .5 +but the value of the +.SM +.B PATH +variable is not used to search for the filename. +.PP +If +.B bash +is invoked with the name +.BR sh , +it tries to mimic the startup behavior of historical versions of +.B sh +as closely as possible, +while conforming to the POSIX standard as well. +When invoked as an interactive login shell, or a non-interactive +shell with the \fB\-\-login\fP option, it first attempts to +read and execute commands from +.I /etc/profile +and +.IR ~/.profile , +in that order. +The +.B \-\-noprofile +option may be used to inhibit this behavior. +When invoked as an interactive shell with the name +.BR sh , +.B bash +looks for the variable +.SM +.BR ENV , +expands its value if it is defined, and uses the +expanded value as the name of a file to read and execute. +Since a shell invoked as +.B sh +does not attempt to read and execute commands from any other startup +files, the +.B \-\-rcfile +option has no effect. +A non-interactive shell invoked with the name +.B sh +does not attempt to read any other startup files. +When invoked as +.BR sh , +.B bash +enters +.I posix +mode after the startup files are read. +.PP +When +.B bash +is started in +.I posix +mode, as with the +.B \-\-posix +command line option, it follows the POSIX standard for startup files. +In this mode, interactive shells expand the +.SM +.B ENV +variable and commands are read and executed from the file +whose name is the expanded value. +No other startup files are read. +.PP +.B Bash +attempts to determine when it is being run with its standard input +connected to a network connection, as when executed by the remote shell +daemon, usually \fIrshd\fP, or the secure shell daemon \fIsshd\fP. +If +.B bash +determines it is being run in this fashion, it reads and executes +commands from \fI~/.bashrc\fP and \fI~/.bashrc\fP, if these files +exist and are readable. +It will not do this if invoked as \fBsh\fP. +The +.B \-\-norc +option may be used to inhibit this behavior, and the +.B \-\-rcfile +option may be used to force another file to be read, but neither +\fIrshd\fP nor \fIsshd\fP generally invoke the shell with those options +or allow them to be specified. +.PP +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the \fB\-p\fP option is not supplied, no startup +files are read, shell functions are not inherited from the environment, the +.SM +.BR SHELLOPTS , +.SM +.BR BASHOPTS , +.SM +.BR CDPATH , +and +.SM +.B GLOBIGNORE +variables, if they appear in the environment, are ignored, +and the effective user id is set to the real user id. +If the \fB\-p\fP option is supplied at invocation, the startup behavior is +the same, but the effective user id is not reset. +.SH DEFINITIONS +.PP +The following definitions are used throughout the rest of this +document. +.PD 0 +.TP +.B blank +A space or tab. +.TP +.B word +A sequence of characters considered as a single unit by the shell. +Also known as a +.BR token . +.TP +.B name +A +.I word +consisting only of alphanumeric characters and underscores, and +beginning with an alphabetic character or an underscore. Also +referred to as an +.BR identifier . +.TP +.B metacharacter +A character that, when unquoted, separates words. One of the following: +.br +.RS +.PP +.if t \fB| & ; ( ) < > space tab\fP +.if n \fB| & ; ( ) < > space tab\fP +.RE +.PP +.TP +.B control operator +A \fItoken\fP that performs a control function. It is one of the following +symbols: +.RS +.PP +.if t \fB|| & && ; ;; ( ) | |& \fP +.if n \fB|| & && ; ;; ( ) | |& \fP +.RE +.PD +.SH "RESERVED WORDS" +\fIReserved words\fP are words that have a special meaning to the shell. +The following words are recognized as reserved when unquoted and either +the first word of a simple command (see +.SM +.B SHELL GRAMMAR +below) or the third word of a +.B case +or +.B for +command: +.if t .RS +.PP +.B +.if n ! case coproc do done elif else esac fi for function if in select then until while { } time [[ ]] +.if t ! case coproc do done elif else esac fi for function if in select then until while { } time [[ ]] +.if t .RE +.SH "SHELL GRAMMAR" +.SS Simple Commands +.PP +A \fIsimple command\fP is a sequence of optional variable assignments +followed by \fBblank\fP-separated words and redirections, and +terminated by a \fIcontrol operator\fP. The first word +specifies the command to be executed, and is passed as argument zero. +The remaining words are passed as arguments to the invoked command. +.PP +The return value of a \fIsimple command\fP is its exit status, or +128+\fIn\^\fP if the command is terminated by signal +.IR n . +.SS Pipelines +.PP +A \fIpipeline\fP is a sequence of one or more commands separated by +one of the control operators +.B | +or \fB|&\fP. +The format for a pipeline is: +.RS +.PP +[\fBtime\fP [\fB\-p\fP]] [ ! ] \fIcommand\fP [ [\fB|\fP\(bv\fB|&\fP] \fIcommand2\fP ... ] +.RE +.PP +The standard output of +.I command +is connected via a pipe to the standard input of +.IR command2 . +This connection is performed before any redirections specified by the +command (see +.SM +.B REDIRECTION +below). +If \fB|&\fP is used, \fIcommand\fP's standard error, in addition to its +standard output, is connected to +\fIcommand2\fP's standard input through the pipe; +it is shorthand for \fB2>&1 |\fP. +This implicit redirection of the standard error to the standard output is +performed after any redirections specified by the command. +.PP +The return status of a pipeline is the exit status of the last +command, unless the \fBpipefail\fP option is enabled. +If \fBpipefail\fP is enabled, the pipeline's return status is the +value of the last (rightmost) command to exit with a non-zero status, +or zero if all commands exit successfully. +If the reserved word +.B ! +precedes a pipeline, the exit status of that pipeline is the logical +negation of the exit status as described above. +The shell waits for all commands in the pipeline to +terminate before returning a value. +.PP +If the +.B time +reserved word precedes a pipeline, the elapsed as well as user and +system time consumed by its execution are reported when the pipeline +terminates. +The \fB\-p\fP option changes the output format to that specified by POSIX. +When the shell is in \fIposix mode\fP, it does not recognize +\fBtime\fP as a reserved word if the next token begins with a `-'. +The +.SM +.B TIMEFORMAT +variable may be set to a format string that specifies how the timing +information should be displayed; see the description of +.SM +.B TIMEFORMAT +under +.B "Shell Variables" +below. +.PP +When the shell is in \fIposix mode\fP, \fBtime\fP +may be followed by a newline. In this case, the shell displays the +total user and system time consumed by the shell and its children. +The +.SM +.B TIMEFORMAT +variable may be used to specify the format of +the time information. +.PP +Each command in a pipeline is executed as a separate process (i.e., in a +subshell). +.SS Lists +.PP +A \fIlist\fP is a sequence of one or more pipelines separated by one +of the operators +.BR ; , +.BR & , +.BR && , +or +.BR || , +and optionally terminated by one of +.BR ; , +.BR & , +or +.BR . +.PP +Of these list operators, +.B && +and +.B || +have equal precedence, followed by +.B ; +and +.BR & , +which have equal precedence. +.PP +A sequence of one or more newlines may appear in a \fIlist\fP instead +of a semicolon to delimit commands. +.PP +If a command is terminated by the control operator +.BR & , +the shell executes the command in the \fIbackground\fP +in a subshell. The shell does not wait for the command to +finish, and the return status is 0. Commands separated by a +.B ; +are executed sequentially; the shell waits for each +command to terminate in turn. The return status is the +exit status of the last command executed. +.PP +AND and OR lists are sequences of one of more pipelines separated by the +\fB&&\fP and \fB||\fP control operators, respectively. +AND and OR lists are executed with left associativity. +An AND list has the form +.RS +.PP +\fIcommand1\fP \fB&&\fP \fIcommand2\fP +.RE +.PP +.I command2 +is executed if, and only if, +.I command1 +returns an exit status of zero. +.PP +An OR list has the form +.RS +.PP +\fIcommand1\fP \fB||\fP \fIcommand2\fP +.PP +.RE +.PP +.I command2 +is executed if and only if +.I command1 +returns a non-zero exit status. +The return status of +AND and OR lists is the exit status of the last command +executed in the list. +.SS Compound Commands +.PP +A \fIcompound command\fP is one of the following. +In most cases a \fIlist\fP in a command's description may be separated from +the rest of the command by one or more newlines, and may be followed by a +newline in place of a semicolon. +.TP +(\fIlist\fP) +\fIlist\fP is executed in a subshell environment (see +.SM +\fBCOMMAND EXECUTION ENVIRONMENT\fP +below). +Variable assignments and builtin +commands that affect the shell's environment do not remain in effect +after the command completes. The return status is the exit status of +\fIlist\fP. +.TP +{ \fIlist\fP; } +\fIlist\fP is simply executed in the current shell environment. +\fIlist\fP must be terminated with a newline or semicolon. +This is known as a \fIgroup command\fP. +The return status is the exit status of +\fIlist\fP. +Note that unlike the metacharacters \fB(\fP and \fB)\fP, \fB{\fP and +\fB}\fP are \fIreserved words\fP and must occur where a reserved +word is permitted to be recognized. Since they do not cause a word +break, they must be separated from \fIlist\fP by whitespace or another +shell metacharacter. +.TP +((\fIexpression\fP)) +The \fIexpression\fP is evaluated according to the rules described +below under +.SM +.BR "ARITHMETIC EVALUATION" . +If the value of the expression is non-zero, the return status is 0; +otherwise the return status is 1. This is exactly equivalent to +\fBlet "\fIexpression\fP"\fR. +.TP +\fB[[\fP \fIexpression\fP \fB]]\fP +Return a status of 0 or 1 depending on the evaluation of +the conditional expression \fIexpression\fP. +Expressions are composed of the primaries described below under +.SM +.BR "CONDITIONAL EXPRESSIONS" . +Word splitting and pathname expansion are not performed on the words +between the \fB[[\fP and \fB]]\fP; tilde expansion, +parameter and variable expansion, +arithmetic expansion, command substitution, process +substitution, and quote removal are performed. +Conditional operators such as \fB\-f\fP must be unquoted to be recognized +as primaries. +.if t .sp 0.5 +.if n .sp 1 +When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort +lexicographically using the current locale. +.if t .sp 0.5 +.if n .sp 1 +When the \fB==\fP and \fB!=\fP operators are used, the string to the +right of the operator is considered a pattern and matched according +to the rules described below under \fBPattern Matching\fP, +as if the \fBextglob\fP shell option were enabled. +The \fB=\fP operator is equivalent to \fB==\fP. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +The return value is 0 if the string matches (\fB==\fP) or does not match +(\fB!=\fP) the pattern, and 1 otherwise. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +.if t .sp 0.5 +.if n .sp 1 +An additional binary operator, \fB=~\fP, is available, with the same +precedence as \fB==\fP and \fB!=\fP. +When it is used, the string to the right of the operator is considered +an extended regular expression and matched accordingly (as in \fIregex\fP(3)). +The return value is 0 if the string matches +the pattern, and 1 otherwise. +If the regular expression is syntactically incorrect, the conditional +expression's return value is 2. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +Bracket expressions in regular expressions must be treated carefully, +since normal quoting characters lose their meanings between brackets. +If the pattern is stored in a shell variable, quoting the variable +expansion forces the entire pattern to be matched as a string. +Substrings matched by parenthesized subexpressions within the regular +expression are saved in the array variable +.SM +.BR BASH_REMATCH . +The element of +.SM +.B BASH_REMATCH +with index 0 is the portion of the string +matching the entire regular expression. +The element of +.SM +.B BASH_REMATCH +with index \fIn\fP is the portion of the +string matching the \fIn\fPth parenthesized subexpression. +.if t .sp 0.5 +.if n .sp 1 +Expressions may be combined using the following operators, listed +in decreasing order of precedence: +.if t .sp 0.5 +.if n .sp 1 +.RS +.PD 0 +.TP +.B ( \fIexpression\fP ) +Returns the value of \fIexpression\fP. +This may be used to override the normal precedence of operators. +.TP +.B ! \fIexpression\fP +True if +.I expression +is false. +.TP +\fIexpression1\fP \fB&&\fP \fIexpression2\fP +True if both +.I expression1 +and +.I expression2 +are true. +.TP +\fIexpression1\fP \fB||\fP \fIexpression2\fP +True if either +.I expression1 +or +.I expression2 +is true. +.PD +.LP +The \fB&&\fP and \fB||\fP +operators do not evaluate \fIexpression2\fP if the value of +\fIexpression1\fP is sufficient to determine the return value of +the entire conditional expression. +.RE +.TP +\fBfor\fP \fIname\fP [ [ \fBin\fP [ \fIword ...\fP ] ] ; ] \fBdo\fP \fIlist\fP ; \fBdone\fP +The list of words following \fBin\fP is expanded, generating a list +of items. +The variable \fIname\fP is set to each element of this list +in turn, and \fIlist\fP is executed each time. +If the \fBin\fP \fIword\fP is omitted, the \fBfor\fP command executes +\fIlist\fP once for each positional parameter that is set (see +.SM +.B PARAMETERS +below). +The return status is the exit status of the last command that executes. +If the expansion of the items following \fBin\fP results in an empty +list, no commands are executed, and the return status is 0. +.TP +\fBfor\fP (( \fIexpr1\fP ; \fIexpr2\fP ; \fIexpr3\fP )) ; \fBdo\fP \fIlist\fP ; \fBdone\fP +First, the arithmetic expression \fIexpr1\fP is evaluated according +to the rules described below under +.SM +.BR "ARITHMETIC EVALUATION" . +The arithmetic expression \fIexpr2\fP is then evaluated repeatedly +until it evaluates to zero. +Each time \fIexpr2\fP evaluates to a non-zero value, \fIlist\fP is +executed and the arithmetic expression \fIexpr3\fP is evaluated. +If any expression is omitted, it behaves as if it evaluates to 1. +The return value is the exit status of the last command in \fIlist\fP +that is executed, or false if any of the expressions is invalid. +.TP +\fBselect\fP \fIname\fP [ \fBin\fP \fIword\fP ] ; \fBdo\fP \fIlist\fP ; \fBdone\fP +The list of words following \fBin\fP is expanded, generating a list +of items. The set of expanded words is printed on the standard +error, each preceded by a number. If the \fBin\fP +\fIword\fP is omitted, the positional parameters are printed (see +.SM +.B PARAMETERS +below). The +.SM +.B PS3 +prompt is then displayed and a line read from the standard input. +If the line consists of a number corresponding to one of +the displayed words, then the value of +.I name +is set to that word. If the line is empty, the words and prompt +are displayed again. If EOF is read, the command completes. Any +other value read causes +.I name +to be set to null. The line read is saved in the variable +.SM +.BR REPLY . +The +.I list +is executed after each selection until a +.B break +command is executed. +The exit status of +.B select +is the exit status of the last command executed in +.IR list , +or zero if no commands were executed. +.TP +\fBcase\fP \fIword\fP \fBin\fP [ [(] \fIpattern\fP [ \fB|\fP \fIpattern\fP ] \ +... ) \fIlist\fP ;; ] ... \fBesac\fP +A \fBcase\fP command first expands \fIword\fP, and tries to match +it against each \fIpattern\fP in turn, using the same matching rules +as for pathname expansion (see +.B Pathname Expansion +below). +The \fIword\fP is expanded using tilde +expansion, parameter and variable expansion, arithmetic substitution, +command substitution, process substitution and quote removal. +Each \fIpattern\fP examined is expanded using tilde +expansion, parameter and variable expansion, arithmetic substitution, +command substitution, and process substitution. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +When a match is found, the corresponding \fIlist\fP is executed. +If the \fB;;\fP operator is used, no subsequent matches are attempted after +the first pattern match. +Using \fB;&\fP in place of \fB;;\fP causes execution to continue with +the \fIlist\fP associated with the next set of patterns. +Using \fB;;&\fP in place of \fB;;\fP causes the shell to test the next +pattern list in the statement, if any, and execute any associated \fIlist\fP +on a successful match. +The exit status is zero if no +pattern matches. Otherwise, it is the exit status of the +last command executed in \fIlist\fP. +.TP +\fBif\fP \fIlist\fP; \fBthen\fP \fIlist\fP; \ +[ \fBelif\fP \fIlist\fP; \fBthen\fP \fIlist\fP; ] ... \ +[ \fBelse\fP \fIlist\fP; ] \fBfi\fP +The +.B if +.I list +is executed. If its exit status is zero, the +\fBthen\fP \fIlist\fP is executed. Otherwise, each \fBelif\fP +\fIlist\fP is executed in turn, and if its exit status is zero, +the corresponding \fBthen\fP \fIlist\fP is executed and the +command completes. Otherwise, the \fBelse\fP \fIlist\fP is +executed, if present. The exit status is the exit status of the +last command executed, or zero if no condition tested true. +.TP +\fBwhile\fP \fIlist-1\fP; \fBdo\fP \fIlist-2\fP; \fBdone\fP +.PD 0 +.TP +\fBuntil\fP \fIlist-1\fP; \fBdo\fP \fIlist-2\fP; \fBdone\fP +.PD +The \fBwhile\fP command continuously executes the list +\fIlist-2\fP as long as the last command in the list \fIlist-1\fP returns +an exit status of zero. The \fBuntil\fP command is identical +to the \fBwhile\fP command, except that the test is negated; +.I list-2 +is executed as long as the last command in +.I list-1 +returns a non-zero exit status. +The exit status of the \fBwhile\fP and \fBuntil\fP commands +is the exit status +of the last command executed in \fIlist-2\fP, or zero if +none was executed. +.SS Coprocesses +.PP +A \fIcoprocess\fP is a shell command preceded by the \fBcoproc\fP reserved +word. +A coprocess is executed asynchronously in a subshell, as if the command +had been terminated with the \fB&\fP control operator, with a two-way pipe +established between the executing shell and the coprocess. +.PP +The format for a coprocess is: +.RS +.PP +\fBcoproc\fP [\fINAME\fP] \fIcommand\fP [\fIredirections\fP] +.RE +.PP +This creates a coprocess named \fINAME\fP. +If \fINAME\fP is not supplied, the default name is \fBCOPROC\fP. +\fINAME\fP must not be supplied if \fIcommand\fP is a \fIsimple +command\fP (see above); otherwise, it is interpreted as the first word +of the simple command. +When the coprocess is executed, the shell creates an array variable (see +.B Arrays +below) named \fINAME\fP in the context of the executing shell. +The standard output of +.I command +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to \fINAME\fP[0]. +The standard input of +.I command +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to \fINAME\fP[1]. +This pipe is established before any redirections specified by the +command (see +.SM +.B REDIRECTION +below). +The file descriptors can be utilized as arguments to shell commands +and redirections using standard word expansions. +The file descriptors are not available in subshells. +The process ID of the shell spawned to execute the coprocess is +available as the value of the variable \fINAME\fP_PID. +The \fBwait\fP +builtin command may be used to wait for the coprocess to terminate. +.PP +Since the coprocess is created as an asynchronous command, +the \fBcoproc\fP command always returns success. +The return status of a coprocess is the exit status of \fIcommand\fP. +.SS Shell Function Definitions +.PP +A shell function is an object that is called like a simple command and +executes a compound command with a new set of positional parameters. +Shell functions are declared as follows: +.TP +\fIname\fP () \fIcompound\-command\fP [\fIredirection\fP] +.PD 0 +.TP +\fBfunction\fP \fIname\fP [()] \fIcompound\-command\fP [\fIredirection\fP] +.PD +This defines a function named \fIname\fP. +The reserved word \fBfunction\fP is optional. +If the \fBfunction\fP reserved word is supplied, the parentheses are optional. +The \fIbody\fP of the function is the compound command +.I compound\-command +(see \fBCompound Commands\fP above). +That command is usually a \fIlist\fP of commands between { and }, but +may be any command listed under \fBCompound Commands\fP above. +\fIcompound\-command\fP is executed whenever \fIname\fP is specified as the +name of a simple command. +When in \fIposix mode\fP, \fIname\fP may not be the name of one of the +POSIX \fIspecial builtins\fP. +Any redirections (see +.SM +.B REDIRECTION +below) specified when a function is defined are performed +when the function is executed. +The exit status of a function definition is zero unless a syntax error +occurs or a readonly function with the same name already exists. +When executed, the exit status of a function is the exit status of the +last command executed in the body. (See +.SM +.B FUNCTIONS +below.) +.SH COMMENTS +In a non-interactive shell, or an interactive shell in which the +.B interactive_comments +option to the +.B shopt +builtin is enabled (see +.SM +.B "SHELL BUILTIN COMMANDS" +below), a word beginning with +.B # +causes that word and all remaining characters on that line to +be ignored. An interactive shell without the +.B interactive_comments +option enabled does not allow comments. The +.B interactive_comments +option is on by default in interactive shells. +.SH QUOTING +\fIQuoting\fP is used to remove the special meaning of certain +characters or words to the shell. Quoting can be used to +disable special treatment for special characters, to prevent +reserved words from being recognized as such, and to prevent +parameter expansion. +.PP +Each of the \fImetacharacters\fP listed above under +.SM +.B DEFINITIONS +has special meaning to the shell and must be quoted if it is to +represent itself. +.PP +When the command history expansion facilities are being used +(see +.SM +.B HISTORY EXPANSION +below), the +\fIhistory expansion\fP character, usually \fB!\fP, must be quoted +to prevent history expansion. +.PP +There are three quoting mechanisms: the +.IR "escape character" , +single quotes, and double quotes. +.PP +A non-quoted backslash (\fB\e\fP) is the +.IR "escape character" . +It preserves the literal value of the next character that follows, +with the exception of . If a \fB\e\fP pair +appears, and the backslash is not itself quoted, the \fB\e\fP +is treated as a line continuation (that is, it is removed from the +input stream and effectively ignored). +.PP +Enclosing characters in single quotes preserves the literal value +of each character within the quotes. A single quote may not occur +between single quotes, even when preceded by a backslash. +.PP +Enclosing characters in double quotes preserves the literal value +of all characters within the quotes, with the exception of +.BR $ , +.BR \` , +.BR \e , +and, when history expansion is enabled, +.BR ! . +The characters +.B $ +and +.B \` +retain their special meaning within double quotes. The backslash +retains its special meaning only when followed by one of the following +characters: +.BR $ , +.BR \` , +\^\fB"\fP\^, +.BR \e , +or +.BR . +A double quote may be quoted within double quotes by preceding it with +a backslash. +If enabled, history expansion will be performed unless an +.B ! +appearing in double quotes is escaped using a backslash. +The backslash preceding the +.B ! +is not removed. +.PP +The special parameters +.B * +and +.B @ +have special meaning when in double +quotes (see +.SM +.B PARAMETERS +below). +.PP +Words of the form \fB$\fP\(aq\fIstring\fP\(aq are treated specially. The +word expands to \fIstring\fP, with backslash-escaped characters replaced +as specified by the ANSI C standard. Backslash escape sequences, if +present, are decoded as follows: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ee +.TP +.B \eE +an escape character +.TP +.B \ef +form feed +.TP +.B \en +new line +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\e +backslash +.TP +.B \e\(aq +single quote +.TP +.B \e\(dq +double quote +.TP +.B \e\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(one to three digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.TP +.B \eu\fIHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHH\fP (one to four hex digits) +.TP +.B \eU\fIHHHHHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHHHHHH\fP (one to eight hex digits) +.TP +.B \ec\fIx\fP +a control-\fIx\fP character +.PD +.RE +.LP +The expanded result is single-quoted, as if the dollar sign had +not been present. +.PP +A double-quoted string preceded by a dollar sign (\fB$\fP\(dq\fIstring\fP\(dq) +will cause the string to be translated according to the current locale. +If the current locale is \fBC\fP or \fBPOSIX\fP, the dollar sign +is ignored. +If the string is translated and replaced, the replacement is +double-quoted. +.SH PARAMETERS +A +.I parameter +is an entity that stores values. +It can be a +.IR name , +a number, or one of the special characters listed below under +.BR "Special Parameters" . +A +.I variable +is a parameter denoted by a +.IR name . +A variable has a \fIvalue\fP and zero or more \fIattributes\fP. +Attributes are assigned using the +.B declare +builtin command (see +.B declare +below in +.SM +.BR "SHELL BUILTIN COMMANDS" ). +.PP +A parameter is set if it has been assigned a value. The null string is +a valid value. Once a variable is set, it may be unset only by using +the +.B unset +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.PP +A +.I variable +may be assigned to by a statement of the form +.RS +.PP +\fIname\fP=[\fIvalue\fP] +.RE +.PP +If +.I value +is not given, the variable is assigned the null string. All +.I values +undergo tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote +removal (see +.SM +.B EXPANSION +below). If the variable has its +.B integer +attribute set, then +.I value +is evaluated as an arithmetic expression even if the $((...)) expansion is +not used (see +.B "Arithmetic Expansion" +below). +Word splitting is not performed, with the exception +of \fB"$@"\fP as explained below under +.BR "Special Parameters" . +Pathname expansion is not performed. +Assignment statements may also appear as arguments to the +.BR alias , +.BR declare , +.BR typeset , +.BR export , +.BR readonly , +and +.B local +builtin commands. +When in \fIposix mode\fP, these builtins may appear in a command after +one or more instances of the \fBcommand\fP builtin and retain these +assignment statement properties. +.PP +In the context where an assignment statement is assigning a value +to a shell variable or array index, the += operator can be used to +append to or add to the variable's previous value. +When += is applied to a variable for which the \fIinteger\fP attribute has been +set, \fIvalue\fP is evaluated as an arithmetic expression and added to the +variable's current value, which is also evaluated. +When += is applied to an array variable using compound assignment (see +.B Arrays +below), the +variable's value is not unset (as it is when using =), and new values are +appended to the array beginning at one greater than the array's maximum index +(for indexed arrays) or added as additional key\-value pairs in an +associative array. +When applied to a string-valued variable, \fIvalue\fP is expanded and +appended to the variable's value. +.PP +A variable can be assigned the \fInameref\fP attribute using the +\fB\-n\fP option to the \fBdeclare\fP or \fBlocal\fP builtin commands +(see the descriptions of \fBdeclare\fP and \fBlocal\fP below) +to create a \fInameref\fP, or a reference to another variable. +This allows variables to be manipulated indirectly. +Whenever the nameref variable is referenced or assigned to, the operation +is actually performed on the variable specified by the nameref variable's +value. +A nameref is commonly used within shell functions to refer to a variable +whose name is passed as an argument to the function. +For instance, if a variable name is passed to a shell function as its first +argument, running +.sp .5 +.RS +.if t \f(CWdeclare -n ref=$1\fP +.if n declare -n ref=$1 +.RE +.sp .5 +inside the function creates a nameref variable \fBref\fP whose value is +the variable name passed as the first argument. +References and assignments to \fBref\fP are treated as references and +assignments to the variable whose name was passed as \fB$1\fP. +If the control variable in a \fBfor\fP loop has the nameref attribute, +the list of words can be a list of shell variables, and a name reference +will be established for each word in the list, in turn, when the loop is +executed. +Array variables cannot be given the \fB\-n\fP attribute. +However, nameref variables can reference array variables and subscripted +array variables. +Namerefs can be unset using the \fB\-n\fP option to the \fBunset\fP builtin. +Otherwise, if \fBunset\fP is executed with the name of a nameref variable +as an argument, the variable referenced by the nameref variable will be unset. +.SS Positional Parameters +.PP +A +.I positional parameter +is a parameter denoted by one or more +digits, other than the single digit 0. Positional parameters are +assigned from the shell's arguments when it is invoked, +and may be reassigned using the +.B set +builtin command. Positional parameters may not be assigned to +with assignment statements. The positional parameters are +temporarily replaced when a shell function is executed (see +.SM +.B FUNCTIONS +below). +.PP +When a positional parameter consisting of more than a single +digit is expanded, it must be enclosed in braces (see +.SM +.B EXPANSION +below). +.SS Special Parameters +.PP +The shell treats several parameters specially. These parameters may +only be referenced; assignment to them is not allowed. +.PD 0 +.TP +.B * +Expands to the positional parameters, starting from one. +When the expansion is not within double quotes, each positional parameter +expands to a separate word. +In contexts where it is performed, those words +are subject to further word splitting and pathname expansion. +When the expansion occurs within double quotes, it expands to a single word +with the value of each parameter separated by the first character +of the +.SM +.B IFS +special variable. That is, "\fB$*\fP" is equivalent +to "\fB$1\fP\fIc\fP\fB$2\fP\fIc\fP\fB...\fP", where +.I c +is the first character of the value of the +.SM +.B IFS +variable. If +.SM +.B IFS +is unset, the parameters are separated by spaces. +If +.SM +.B IFS +is null, the parameters are joined without intervening separators. +.TP +.B @ +Expands to the positional parameters, starting from one. When the +expansion occurs within double quotes, each parameter expands to a +separate word. That is, "\fB$@\fP" is equivalent to +"\fB$1\fP" "\fB$2\fP" ... +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +When there are no positional parameters, "\fB$@\fP" and +.B $@ +expand to nothing (i.e., they are removed). +.TP +.B # +Expands to the number of positional parameters in decimal. +.TP +.B ? +Expands to the exit status of the most recently executed foreground +pipeline. +.TP +.B \- +Expands to the current option flags as specified upon invocation, +by the +.B set +builtin command, or those set by the shell itself +(such as the +.B \-i +option). +.TP +.B $ +Expands to the process ID of the shell. In a () subshell, it +expands to the process ID of the current shell, not the +subshell. +.TP +.B ! +Expands to the process ID of the job most recently placed into the +background, whether executed as an asynchronous command or using +the \fBbg\fP builtin (see +.SM +.B "JOB CONTROL" +below). +.TP +.B 0 +Expands to the name of the shell or shell script. This is set at +shell initialization. If +.B bash +is invoked with a file of commands, +.B $0 +is set to the name of that file. If +.B bash +is started with the +.B \-c +option, then +.B $0 +is set to the first argument after the string to be +executed, if one is present. Otherwise, it is set +to the filename used to invoke +.BR bash , +as given by argument zero. +.TP +.B _ +At shell startup, set to the absolute pathname used to invoke the +shell or shell script being executed as passed in the environment +or argument list. +Subsequently, expands to the last argument to the previous command, +after expansion. +Also set to the full pathname used to invoke each command executed +and placed in the environment exported to that command. +When checking mail, this parameter holds the name of the mail file +currently being checked. +.PD +.SS Shell Variables +.PP +The following variables are set by the shell: +.PP +.PD 0 +.TP +.B BASH +Expands to the full filename used to invoke this instance of +.BR bash . +.TP +.B BASHOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +.B \-s +option to the +.B shopt +builtin command (see +.SM +.B "SHELL BUILTIN COMMANDS" +below). The options appearing in +.SM +.B BASHOPTS +are those reported as +.I on +by \fBshopt\fP. +If this variable is in the environment when +.B bash +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +.TP +.B BASHPID +Expands to the process ID of the current \fBbash\fP process. +This differs from \fB$$\fP under certain circumstances, such as subshells +that do not require \fBbash\fP to be re-initialized. +.TP +.B BASH_ALIASES +An associative array variable whose members correspond to the internal +list of aliases as maintained by the \fBalias\fP builtin. +Elements added to this array appear in the alias list; unsetting array +elements cause aliases to be removed from the alias list. +.TP +.B BASH_ARGC +An array variable whose values are the number of parameters in each +frame of the current \fBbash\fP execution call stack. +The number of +parameters to the current subroutine (shell function or script executed +with \fB.\fP or \fBsource\fP) is at the top of the stack. +When a subroutine is executed, the number of parameters passed is pushed onto +.SM +.BR BASH_ARGC . +The shell sets +.SM +.B BASH_ARGC +only when in extended debugging mode (see the description of the +.B extdebug +option to the +.B shopt +builtin below) +.TP +.B BASH_ARGV +An array variable containing all of the parameters in the current \fBbash\fP +execution call stack. The final parameter of the last subroutine call +is at the top of the stack; the first parameter of the initial call is +at the bottom. When a subroutine is executed, the parameters supplied +are pushed onto +.SM +.BR BASH_ARGV . +The shell sets +.SM +.B BASH_ARGV +only when in extended debugging mode +(see the description of the +.B extdebug +option to the +.B shopt +builtin below) +.TP +.B BASH_CMDS +An associative array variable whose members correspond to the internal +hash table of commands as maintained by the \fBhash\fP builtin. +Elements added to this array appear in the hash table; unsetting array +elements cause commands to be removed from the hash table. +.TP +.B BASH_COMMAND +The command currently being executed or about to be executed, unless the +shell is executing a command as the result of a trap, +in which case it is the command executing at the time of the trap. +.TP +.B BASH_EXECUTION_STRING +The command argument to the \fB\-c\fP invocation option. +.TP +.B BASH_LINENO +An array variable whose members are the line numbers in source files +where each corresponding member of +.SM +.B FUNCNAME +was invoked. +\fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP is the line number in the source +file (\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP) where +\fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP was called +(or \fB${BASH_LINENO[\fP\fI$i-1\fP\fB]}\fP if referenced within another +shell function). +Use +.SM +.B LINENO +to obtain the current line number. +.TP +.B BASH_REMATCH +An array variable whose members are assigned by the \fB=~\fP binary +operator to the \fB[[\fP conditional command. +The element with index 0 is the portion of the string +matching the entire regular expression. +The element with index \fIn\fP is the portion of the +string matching the \fIn\fPth parenthesized subexpression. +This variable is read-only. +.TP +.B BASH_SOURCE +An array variable whose members are the source filenames +where the corresponding shell function names in the +.SM +.B FUNCNAME +array variable are defined. +The shell function +\fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP is defined in the file +\fB${BASH_SOURCE[\fP\fI$i\fP\fB]}\fP and called from +\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP. +.TP +.B BASH_SUBSHELL +Incremented by one within each subshell or subshell environment when +the shell begins executing in that environment. +The initial value is 0. +.TP +.B BASH_VERSINFO +A readonly array variable whose members hold version information for +this instance of +.BR bash . +The values assigned to the array members are as follows: +.sp .5 +.RS +.TP 24 +.B BASH_VERSINFO[\fR0\fP] +The major version number (the \fIrelease\fP). +.TP +.B BASH_VERSINFO[\fR1\fP] +The minor version number (the \fIversion\fP). +.TP +.B BASH_VERSINFO[\fR2\fP] +The patch level. +.TP +.B BASH_VERSINFO[\fR3\fP] +The build version. +.TP +.B BASH_VERSINFO[\fR4\fP] +The release status (e.g., \fIbeta1\fP). +.TP +.B BASH_VERSINFO[\fR5\fP] +The value of +.SM +.BR MACHTYPE . +.RE +.TP +.B BASH_VERSION +Expands to a string describing the version of this instance of +.BR bash . +.TP +.B COMP_CWORD +An index into \fB${COMP_WORDS}\fP of the word containing the current +cursor position. +This variable is available only in shell functions invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_KEY +The key (or final key of a key sequence) used to invoke the current +completion function. +.TP +.B COMP_LINE +The current command line. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_POINT +The index of the current cursor position relative to the beginning of +the current command. +If the current cursor position is at the end of the current command, +the value of this variable is equal to \fB${#COMP_LINE}\fP. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_TYPE +Set to an integer value corresponding to the type of completion attempted +that caused a completion function to be called: +\fITAB\fP, for normal completion, +\fI?\fP, for listing completions after successive tabs, +\fI!\fP, for listing alternatives on partial word completion, +\fI@\fP, to list completions if the word is not unmodified, +or +\fI%\fP, for menu completion. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_WORDBREAKS +The set of characters that the \fBreadline\fP library treats as word +separators when performing word completion. +If +.SM +.B COMP_WORDBREAKS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B COMP_WORDS +An array variable (see \fBArrays\fP below) consisting of the individual +words in the current command line. +The line is split into words as \fBreadline\fP would split it, using +.SM +.B COMP_WORDBREAKS +as described above. +This variable is available only in shell functions invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COPROC +An array variable (see \fBArrays\fP below) created to hold the file descriptors +for output from and input to an unnamed coprocess (see \fBCoprocesses\fP +above). +.TP +.B DIRSTACK +An array variable (see +.B Arrays +below) containing the current contents of the directory stack. +Directories appear in the stack in the order they are displayed by the +.B dirs +builtin. +Assigning to members of this array variable may be used to modify +directories already in the stack, but the +.B pushd +and +.B popd +builtins must be used to add and remove directories. +Assignment to this variable will not change the current directory. +If +.SM +.B DIRSTACK +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B EUID +Expands to the effective user ID of the current user, initialized at +shell startup. This variable is readonly. +.TP +.B FUNCNAME +An array variable containing the names of all shell functions +currently in the execution call stack. +The element with index 0 is the name of any currently-executing +shell function. +The bottom-most element (the one with the highest index) is +.if t \f(CW"main"\fP. +.if n "main". +This variable exists only when a shell function is executing. +Assignments to +.SM +.B FUNCNAME +have no effect and return an error status. +If +.SM +.B FUNCNAME +is unset, it loses its special properties, even if it is +subsequently reset. +.if t .sp 0.5 +.if n .sp 1 +This variable can be used with \fBBASH_LINENO\fP and \fBBASH_SOURCE\fP. +Each element of \fBFUNCNAME\fP has corresponding elements in +\fBBASH_LINENO\fP and \fBBASH_SOURCE\fP to describe the call stack. +For instance, \fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP was called from the file +\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP at line number +\fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP. +The \fBcaller\fP builtin displays the current call stack using this +information. +.TP +.B GROUPS +An array variable containing the list of groups of which the current +user is a member. +Assignments to +.SM +.B GROUPS +have no effect and return an error status. +If +.SM +.B GROUPS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B HISTCMD +The history number, or index in the history list, of the current +command. +If +.SM +.B HISTCMD +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B HOSTNAME +Automatically set to the name of the current host. +.TP +.B HOSTTYPE +Automatically set to a string that uniquely +describes the type of machine on which +.B bash +is executing. +The default is system-dependent. +.TP +.B LINENO +Each time this parameter is referenced, the shell substitutes +a decimal number representing the current sequential line number +(starting with 1) within a script or function. When not in a +script or function, the value substituted is not guaranteed to +be meaningful. +If +.SM +.B LINENO +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B MACHTYPE +Automatically set to a string that fully describes the system +type on which +.B bash +is executing, in the standard GNU \fIcpu-company-system\fP format. +The default is system-dependent. +.TP +.B MAPFILE +An array variable (see \fBArrays\fP below) created to hold the text +read by the \fBmapfile\fP builtin when no variable name is supplied. +.TP +.B OLDPWD +The previous working directory as set by the +.B cd +command. +.TP +.B OPTARG +The value of the last option argument processed by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.TP +.B OPTIND +The index of the next argument to be processed by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.TP +.B OSTYPE +Automatically set to a string that +describes the operating system on which +.B bash +is executing. +The default is system-dependent. +.TP +.B PIPESTATUS +An array variable (see +.B Arrays +below) containing a list of exit status values from the processes +in the most-recently-executed foreground pipeline (which may +contain only a single command). +.TP +.B PPID +The process ID of the shell's parent. This variable is readonly. +.TP +.B PWD +The current working directory as set by the +.B cd +command. +.TP +.B RANDOM +Each time this parameter is referenced, a random integer between +0 and 32767 is +generated. The sequence of random numbers may be initialized by assigning +a value to +.SM +.BR RANDOM . +If +.SM +.B RANDOM +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B READLINE_LINE +The contents of the +.B readline +line buffer, for use with +.if t \f(CWbind -x\fP +.if n "bind -x" +(see +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.TP +.B READLINE_POINT +The position of the insertion point in the +.B readline +line buffer, for use with +.if t \f(CWbind -x\fP +.if n "bind -x" +(see +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.TP +.B REPLY +Set to the line of input read by the +.B read +builtin command when no arguments are supplied. +.TP +.B SECONDS +Each time this parameter is +referenced, the number of seconds since shell invocation is returned. If a +value is assigned to +.SM +.BR SECONDS , +the value returned upon subsequent +references is +the number of seconds since the assignment plus the value assigned. +If +.SM +.B SECONDS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B SHELLOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +.B \-o +option to the +.B set +builtin command (see +.SM +.B "SHELL BUILTIN COMMANDS" +below). The options appearing in +.SM +.B SHELLOPTS +are those reported as +.I on +by \fBset \-o\fP. +If this variable is in the environment when +.B bash +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +.TP +.B SHLVL +Incremented by one each time an instance of +.B bash +is started. +.TP +.B UID +Expands to the user ID of the current user, initialized at shell startup. +This variable is readonly. +.PD +.PP +The following variables are used by the shell. In some cases, +.B bash +assigns a default value to a variable; these cases are noted +below. +.PP +.PD 0 +.TP +.B BASH_COMPAT +The value is used to set the shell's compatibility level. +See the description of the \fBshopt\fP builtin below under +\fBSHELL BUILTIN COMMANDS\fP +for a description of the various compatibility +levels and their effects. +The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42) +corresponding to the desired compatibility level. +If \fBBASH_COMPAT\fP is unset or set to the empty string, the compatibility +level is set to the default for the current version. +If \fBBASH_COMPAT\fP is set to a value that is not one of the valid +compatibility levels, the shell prints an error message and sets the +compatibility level to the default for the current version. +The valid compatibility levels correspond to the compatibility options +accepted by the \fBshopt\fP builtin described below (for example, +\fBcompat42\fP means that 4.2 and 42 are valid values). +The current version is also a valid value. +.TP +.B BASH_ENV +If this parameter is set when \fBbash\fP is executing a shell script, +its value is interpreted as a filename containing commands to +initialize the shell, as in +.IR ~/.bashrc . +The value of +.SM +.B BASH_ENV +is subjected to parameter expansion, command substitution, and arithmetic +expansion before being interpreted as a filename. +.SM +.B PATH +is not used to search for the resultant filename. +.TP +.B BASH_XTRACEFD +If set to an integer corresponding to a valid file descriptor, \fBbash\fP +will write the trace output generated when +.if t \f(CWset -x\fP +.if n \fIset -x\fP +is enabled to that file descriptor. +The file descriptor is closed when +.SM +.B BASH_XTRACEFD +is unset or assigned a new value. +Unsetting +.SM +.B BASH_XTRACEFD +or assigning it the empty string causes the +trace output to be sent to the standard error. +Note that setting +.SM +.B BASH_XTRACEFD +to 2 (the standard error file +descriptor) and then unsetting it will result in the standard error +being closed. +.TP +.B CDPATH +The search path for the +.B cd +command. +This is a colon-separated list of directories in which the shell looks +for destination directories specified by the +.B cd +command. +A sample value is +.if t \f(CW".:~:/usr"\fP. +.if n ".:~:/usr". +.TP +.B CHILD_MAX +Set the number of exited child status values for the shell to remember. +Bash will not allow this value to be decreased below a POSIX-mandated +minimum, and there is a maximum value (currently 8192) that this may +not exceed. +The minimum value is system-dependent. +.TP +.B COLUMNS +Used by the \fBselect\fP compound command to determine the terminal width +when printing selection lists. +Automatically set if the +.B checkwinsize +option is enabled or in an interactive shell upon receipt of a +.SM +.BR SIGWINCH . +.TP +.B COMPREPLY +An array variable from which \fBbash\fP reads the possible completions +generated by a shell function invoked by the programmable completion +facility (see \fBProgrammable Completion\fP below). +Each array element contains one possible completion. +.TP +.B EMACS +If \fBbash\fP finds this variable in the environment when the shell starts +with value +.if t \f(CWt\fP, +.if n "t", +it assumes that the shell is running in an Emacs shell buffer and disables +line editing. +.TP +.B ENV +Similar to +.SM +.BR BASH_ENV ; +used when the shell is invoked in POSIX mode. +.TP +.B FCEDIT +The default editor for the +.B fc +builtin command. +.TP +.B FIGNORE +A colon-separated list of suffixes to ignore when performing +filename completion (see +.SM +.B READLINE +below). +A filename whose suffix matches one of the entries in +.SM +.B FIGNORE +is excluded from the list of matched filenames. +A sample value is +.if t \f(CW".o:~"\fP. +.if n ".o:~" +(Quoting is needed when assigning a value to this variable, +which contains tildes). +.TP +.B FUNCNEST +If set to a numeric value greater than 0, defines a maximum function +nesting level. Function invocations that exceed this nesting level +will cause the current command to abort. +.TP +.B GLOBIGNORE +A colon-separated list of patterns defining the set of filenames to +be ignored by pathname expansion. +If a filename matched by a pathname expansion pattern also matches one +of the patterns in +.SM +.BR GLOBIGNORE , +it is removed from the list of matches. +.TP +.B HISTCONTROL +A colon-separated list of values controlling how commands are saved on +the history list. +If the list of values includes +.IR ignorespace , +lines which begin with a +.B space +character are not saved in the history list. +A value of +.I ignoredups +causes lines matching the previous history entry to not be saved. +A value of +.I ignoreboth +is shorthand for \fIignorespace\fP and \fIignoredups\fP. +A value of +.IR erasedups +causes all previous lines matching the current line to be removed from +the history list before that line is saved. +Any value not in the above list is ignored. +If +.SM +.B HISTCONTROL +is unset, or does not include a valid value, +all lines read by the shell parser are saved on the history list, +subject to the value of +.SM +.BR HISTIGNORE . +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +.SM +.BR HISTCONTROL . +.TP +.B HISTFILE +The name of the file in which command history is saved (see +.SM +.B HISTORY +below). The default value is \fI~/.bash_history\fP. If unset, the +command history is not saved when a shell exits. +.TP +.B HISTFILESIZE +The maximum number of lines contained in the history file. When this +variable is assigned a value, the history file is truncated, if +necessary, +to contain no more than that number of lines by removing the oldest entries. +The history file is also truncated to this size after +writing it when a shell exits. +If the value is 0, the history file is truncated to zero size. +Non-numeric values and numeric values less than zero inhibit truncation. +The shell sets the default value to the value of \fBHISTSIZE\fP +after reading any startup files. +.TP +.B HISTIGNORE +A colon-separated list of patterns used to decide which command lines +should be saved on the history list. Each pattern is anchored at the +beginning of the line and must match the complete line (no implicit +`\fB*\fP' is appended). Each pattern is tested against the line +after the checks specified by +.SM +.B HISTCONTROL +are applied. +In addition to the normal shell pattern matching characters, `\fB&\fP' +matches the previous history line. `\fB&\fP' may be escaped using a +backslash; the backslash is removed before attempting a match. +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +.SM +.BR HISTIGNORE . +.TP +.B HISTSIZE +The number of commands to remember in the command history (see +.SM +.B HISTORY +below). +If the value is 0, commands are not saved in the history list. +Numeric values less than zero result in every command being saved +on the history list (there is no limit). +The shell sets the default value to 500 after reading any startup files. +.TP +.B HISTTIMEFORMAT +If this variable is set and not null, its value is used as a format string +for \fIstrftime\fP(3) to print the time stamp associated with each history +entry displayed by the \fBhistory\fP builtin. +If this variable is set, time stamps are written to the history file so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +.TP +.B HOME +The home directory of the current user; the default argument for the +\fBcd\fP builtin command. +The value of this variable is also used when performing tilde expansion. +.TP +.B HOSTFILE +Contains the name of a file in the same format as +.FN /etc/hosts +that should be read when the shell needs to complete a +hostname. +The list of possible hostname completions may be changed while the +shell is running; +the next time hostname completion is attempted after the +value is changed, +.B bash +adds the contents of the new file to the existing list. +If +.SM +.B HOSTFILE +is set, but has no value, or does not name a readable file, +\fBbash\fP attempts to read +.FN /etc/hosts +to obtain the list of possible hostname completions. +When +.SM +.B HOSTFILE +is unset, the hostname list is cleared. +.TP +.B IFS +The +.I Internal Field Separator +that is used +for word splitting after expansion and to +split lines into words with the +.B read +builtin command. The default value is +``''. +.TP +.B IGNOREEOF +Controls the +action of an interactive shell on receipt of an +.SM +.B EOF +character as the sole input. If set, the value is the number of +consecutive +.SM +.B EOF +characters which must be +typed as the first characters on an input line before +.B bash +exits. If the variable exists but does not have a numeric value, or +has no value, the default value is 10. If it does not exist, +.SM +.B EOF +signifies the end of input to the shell. +.TP +.B INPUTRC +The filename for the +.B readline +startup file, overriding the default of +.FN ~/.inputrc +(see +.SM +.B READLINE +below). +.TP +.B LANG +Used to determine the locale category for any category not specifically +selected with a variable starting with \fBLC_\fP. +.TP +.B LC_ALL +This variable overrides the value of +.SM +.B LANG +and any other +\fBLC_\fP variable specifying a locale category. +.TP +.B LC_COLLATE +This variable determines the collation order used when sorting the +results of pathname expansion, and determines the behavior of range +expressions, equivalence classes, and collating sequences within +pathname expansion and pattern matching. +.TP +.B LC_CTYPE +This variable determines the interpretation of characters and the +behavior of character classes within pathname expansion and pattern +matching. +.TP +.B LC_MESSAGES +This variable determines the locale used to translate double-quoted +strings preceded by a \fB$\fP. +.TP +.B LC_NUMERIC +This variable determines the locale category used for number formatting. +.TP +.B LINES +Used by the \fBselect\fP compound command to determine the column length +for printing selection lists. +Automatically set if the +.B checkwinsize +option is enabled or in an interactive shell upon receipt of a +.SM +.BR SIGWINCH . +.TP +.B MAIL +If this parameter is set to a file or directory name and the +.SM +.B MAILPATH +variable is not set, +.B bash +informs the user of the arrival of mail in the specified file or +Maildir-format directory. +.TP +.B MAILCHECK +Specifies how +often (in seconds) +.B bash +checks for mail. The default is 60 seconds. When it is time to check +for mail, the shell does so before displaying the primary prompt. +If this variable is unset, or set to a value that is not a number +greater than or equal to zero, the shell disables mail checking. +.TP +.B MAILPATH +A colon-separated list of filenames to be checked for mail. +The message to be printed when mail arrives in a particular file +may be specified by separating the filename from the message with a `?'. +When used in the text of the message, \fB$_\fP expands to the name of +the current mailfile. +Example: +.RS +.PP +\fBMAILPATH\fP=\(aq/var/mail/bfox?"You have mail":~/shell\-mail?"$_ has mail!"\(aq +.PP +.B Bash +supplies a default value for this variable, but the location of the user +mail files that it uses is system dependent (e.g., /var/mail/\fB$USER\fP). +.RE +.TP +.B OPTERR +If set to the value 1, +.B bash +displays error messages generated by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SM +.B OPTERR +is initialized to 1 each time the shell is invoked or a shell +script is executed. +.TP +.B PATH +The search path for commands. It +is a colon-separated list of directories in which +the shell looks for commands (see +.SM +.B COMMAND EXECUTION +below). +A zero-length (null) directory name in the value of +.SM +.B PATH +indicates the current directory. +A null directory name may appear as two adjacent colons, or as an initial +or trailing colon. +The default path is system-dependent, +and is set by the administrator who installs +.BR bash . +A common value is +.if t \f(CW/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin\fP. +.if n ``/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin''. +.TP +.B POSIXLY_CORRECT +If this variable is in the environment when \fBbash\fP starts, the shell +enters \fIposix mode\fP before reading the startup files, as if the +.B \-\-posix +invocation option had been supplied. If it is set while the shell is +running, \fBbash\fP enables \fIposix mode\fP, as if the command +.if t \f(CWset -o posix\fP +.if n \fIset -o posix\fP +had been executed. +.TP +.B PROMPT_COMMAND +If set, the value is executed as a command prior to issuing each primary +prompt. +.TP +.B PROMPT_DIRTRIM +If set to a number greater than zero, the value is used as the number of +trailing directory components to retain when expanding the \fB\ew\fP and +\fB\eW\fP prompt string escapes (see +.SM +.B PROMPTING +below). Characters removed are replaced with an ellipsis. +.TP +.B PS1 +The value of this parameter is expanded (see +.SM +.B PROMPTING +below) and used as the primary prompt string. The default value is +``\fB\es\-\ev\e$ \fP''. +.TP +.B PS2 +The value of this parameter is expanded as with +.SM +.B PS1 +and used as the secondary prompt string. The default is +``\fB> \fP''. +.TP +.B PS3 +The value of this parameter is used as the prompt for the +.B select +command (see +.SM +.B SHELL GRAMMAR +above). +.TP +.B PS4 +The value of this parameter is expanded as with +.SM +.B PS1 +and the value is printed before each command +.B bash +displays during an execution trace. The first character of +.SM +.B PS4 +is replicated multiple times, as necessary, to indicate multiple +levels of indirection. The default is ``\fB+ \fP''. +.TP +.B SHELL +The full pathname to the shell is kept in this environment variable. +If it is not set when the shell starts, +.B bash +assigns to it the full pathname of the current user's login shell. +.TP +.B TIMEFORMAT +The value of this parameter is used as a format string specifying +how the timing information for pipelines prefixed with the +.B time +reserved word should be displayed. +The \fB%\fP character introduces an escape sequence that is +expanded to a time value or other information. +The escape sequences and their meanings are as follows; the +braces denote optional portions. +.sp .5 +.RS +.PD 0 +.TP 10 +.B %% +A literal \fB%\fP. +.TP +.B %[\fIp\fP][l]R +The elapsed time in seconds. +.TP +.B %[\fIp\fP][l]U +The number of CPU seconds spent in user mode. +.TP +.B %[\fIp\fP][l]S +The number of CPU seconds spent in system mode. +.TP +.B %P +The CPU percentage, computed as (%U + %S) / %R. +.PD +.RE +.IP +The optional \fIp\fP is a digit specifying the \fIprecision\fP, +the number of fractional digits after a decimal point. +A value of 0 causes no decimal point or fraction to be output. +At most three places after the decimal point may be specified; +values of \fIp\fP greater than 3 are changed to 3. +If \fIp\fP is not specified, the value 3 is used. +.IP +The optional \fBl\fP specifies a longer format, including +minutes, of the form \fIMM\fPm\fISS\fP.\fIFF\fPs. +The value of \fIp\fP determines whether or not the fraction is +included. +.IP +If this variable is not set, \fBbash\fP acts as if it had the +value \fB$\(aq\enreal\et%3lR\enuser\et%3lU\ensys\et%3lS\(aq\fP. +If the value is null, no timing information is displayed. +A trailing newline is added when the format string is displayed. +.PD 0 +.TP +.B TMOUT +If set to a value greater than zero, +.SM +.B TMOUT +is treated as the +default timeout for the \fBread\fP builtin. +The \fBselect\fP command terminates if input does not arrive +after +.SM +.B TMOUT +seconds when input is coming from a terminal. +In an interactive shell, the value is interpreted as the +number of seconds to wait for a line of input after issuing the +primary prompt. +.B Bash +terminates after waiting for that number of seconds if a complete +line of input does not arrive. +.TP +.B TMPDIR +If set, \fBbash\fP uses its value as the name of a directory in which +\fBbash\fP creates temporary files for the shell's use. +.TP +.B auto_resume +This variable controls how the shell interacts with the user and +job control. If this variable is set, single word simple +commands without redirections are treated as candidates for resumption +of an existing stopped job. There is no ambiguity allowed; if there is +more than one job beginning with the string typed, the job most recently +accessed is selected. The +.I name +of a stopped job, in this context, is the command line used to +start it. +If set to the value +.IR exact , +the string supplied must match the name of a stopped job exactly; +if set to +.IR substring , +the string supplied needs to match a substring of the name of a +stopped job. The +.I substring +value provides functionality analogous to the +.B %? +job identifier (see +.SM +.B JOB CONTROL +below). If set to any other value, the supplied string must +be a prefix of a stopped job's name; this provides functionality +analogous to the \fB%\fP\fIstring\fP job identifier. +.TP +.B histchars +The two or three characters which control history expansion +and tokenization (see +.SM +.B HISTORY EXPANSION +below). The first character is the \fIhistory expansion\fP character, +the character which signals the start of a history +expansion, normally `\fB!\fP'. +The second character is the \fIquick substitution\fP +character, which is used as shorthand for re-running the previous +command entered, substituting one string for another in the command. +The default is `\fB^\fP'. +The optional third character is the character +which indicates that the remainder of the line is a comment when found +as the first character of a word, normally `\fB#\fP'. The history +comment character causes history substitution to be skipped for the +remaining words on the line. It does not necessarily cause the shell +parser to treat the rest of the line as a comment. +.PD +.SS Arrays +.B Bash +provides one-dimensional indexed and associative array variables. +Any variable may be used as an indexed array; the +.B declare +builtin will explicitly declare an array. +There is no maximum +limit on the size of an array, nor any requirement that members +be indexed or assigned contiguously. +Indexed arrays are referenced using integers (including arithmetic +expressions) and are zero-based; associative arrays are referenced +using arbitrary strings. +Unless otherwise noted, indexed array indices must be non-negative integers. +.PP +An indexed array is created automatically if any variable is assigned to +using the syntax \fIname\fP[\fIsubscript\fP]=\fIvalue\fP. The +.I subscript +is treated as an arithmetic expression that must evaluate to a number. +To explicitly declare an indexed array, use +.B declare \-a \fIname\fP +(see +.SM +.B SHELL BUILTIN COMMANDS +below). +.B declare \-a \fIname\fP[\fIsubscript\fP] +is also accepted; the \fIsubscript\fP is ignored. +.PP +Associative arrays are created using +.BR "declare \-A \fIname\fP" . +.PP +Attributes may be +specified for an array variable using the +.B declare +and +.B readonly +builtins. Each attribute applies to all members of an array. +.PP +Arrays are assigned to using compound assignments of the form +\fIname\fP=\fB(\fPvalue\fI1\fP ... value\fIn\fP\fB)\fP, where each +\fIvalue\fP is of the form [\fIsubscript\fP]=\fIstring\fP. +Indexed array assignments do not require anything but \fIstring\fP. +When assigning to indexed arrays, if the optional brackets and subscript +are supplied, that index is assigned to; +otherwise the index of the element assigned is the last index assigned +to by the statement plus one. Indexing starts at zero. +.PP +When assigning to an associative array, the subscript is required. +.PP +This syntax is also accepted by the +.B declare +builtin. Individual array elements may be assigned to using the +\fIname\fP[\fIsubscript\fP]=\fIvalue\fP syntax introduced above. +When assigning to an indexed array, if +.I name +is subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +\fIname\fP, so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.PP +Any element of an array may be referenced using +${\fIname\fP[\fIsubscript\fP]}. The braces are required to avoid +conflicts with pathname expansion. If +\fIsubscript\fP is \fB@\fP or \fB*\fP, the word expands to +all members of \fIname\fP. These subscripts differ only when the +word appears within double quotes. If the word is double-quoted, +${\fIname\fP[*]} expands to a single +word with the value of each array member separated by the first +character of the +.SM +.B IFS +special variable, and ${\fIname\fP[@]} expands each element of +\fIname\fP to a separate word. When there are no array members, +${\fIname\fP[@]} expands to nothing. +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +This is analogous to the expansion +of the special parameters \fB*\fP and \fB@\fP (see +.B Special Parameters +above). ${#\fIname\fP[\fIsubscript\fP]} expands to the length of +${\fIname\fP[\fIsubscript\fP]}. If \fIsubscript\fP is \fB*\fP or +\fB@\fP, the expansion is the number of elements in the array. +Referencing an array variable without a subscript is equivalent to +referencing the array with a subscript of 0. +If the +.I subscript +used to reference an element of an indexed array +evaluates to a number less than zero, it is +interpreted as relative to one greater than the maximum index of the array, +so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.PP +An array variable is considered set if a subscript has been assigned a +value. The null string is a valid value. +.PP +It is possible to obtain the keys (indices) of an array as well as the values. +${\fB!\fP\fIname\fP[\fI@\fP]} and ${\fB!\fP\fIname\fP[\fI*\fP]} +expand to the indices assigned in array variable \fIname\fP. +The treatment when in double quotes is similar to the expansion of the +special parameters \fI@\fP and \fI*\fP within double quotes. +.PP +The +.B unset +builtin is used to destroy arrays. \fBunset\fP \fIname\fP[\fIsubscript\fP] +destroys the array element at index \fIsubscript\fP. +Negative subscripts to indexed arrays are interpreted as described above. +Care must be taken to avoid unwanted side effects caused by pathname +expansion. +\fBunset\fP \fIname\fP, where \fIname\fP is an array, or +\fBunset\fP \fIname\fP[\fIsubscript\fP], where +\fIsubscript\fP is \fB*\fP or \fB@\fP, removes the entire array. +.PP +The +.BR declare , +.BR local , +and +.B readonly +builtins each accept a +.B \-a +option to specify an indexed array and a +.B \-A +option to specify an associative array. +If both options are supplied, +.B \-A +takes precedence. +The +.B read +builtin accepts a +.B \-a +option to assign a list of words read from the standard input +to an array. The +.B set +and +.B declare +builtins display array values in a way that allows them to be +reused as assignments. +.SH EXPANSION +Expansion is performed on the command line after it has been split into +words. There are seven kinds of expansion performed: +.IR "brace expansion" , +.IR "tilde expansion" , +.IR "parameter and variable expansion" , +.IR "command substitution" , +.IR "arithmetic expansion" , +.IR "word splitting" , +and +.IR "pathname expansion" . +.PP +The order of expansions is: +brace expansion; +tilde expansion, parameter and variable expansion, arithmetic expansion, +and command substitution (done in a left-to-right fashion); +word splitting; +and pathname expansion. +.PP +On systems that can support it, there is an additional expansion +available: \fIprocess substitution\fP. +This is performed at the +same time as tilde, parameter, variable, and arithmetic expansion and +command substitution. +.PP +Only brace expansion, word splitting, and pathname expansion +can change the number of words of the expansion; other expansions +expand a single word to a single word. +The only exceptions to this are the expansions of +"\fB$@\fP" and "\fB${\fP\fIname\fP\fB[@]}\fP" +as explained above (see +.SM +.BR PARAMETERS ). +.SS Brace Expansion +.PP +.I "Brace expansion" +is a mechanism by which arbitrary strings +may be generated. This mechanism is similar to +\fIpathname expansion\fP, but the filenames generated +need not exist. Patterns to be brace expanded take +the form of an optional +.IR preamble , +followed by either a series of comma-separated strings or +a sequence expression between a pair of braces, followed by +an optional +.IR postscript . +The preamble is prefixed to each string contained +within the braces, and the postscript is then appended +to each resulting string, expanding left to right. +.PP +Brace expansions may be nested. The results of each expanded +string are not sorted; left to right order is preserved. +For example, a\fB{\fPd,c,b\fB}\fPe expands into `ade ace abe'. +.PP +A sequence expression takes the form +\fB{\fP\fIx\fP\fB..\fP\fIy\fP\fB[..\fP\fIincr\fP\fB]}\fP, +where \fIx\fP and \fIy\fP are either integers or single characters, +and \fIincr\fP, an optional increment, is an integer. +When integers are supplied, the expression expands to each number between +\fIx\fP and \fIy\fP, inclusive. +Supplied integers may be prefixed with \fI0\fP to force each term to have the +same width. +When either \fIx\fP or \fPy\fP begins with a zero, the shell +attempts to force all generated terms to contain the same number of digits, +zero-padding where necessary. +When characters are supplied, the expression expands to each character +lexicographically between \fIx\fP and \fIy\fP, inclusive, +using the default C locale. +Note that both \fIx\fP and \fIy\fP must be of the same type. +When the increment is supplied, it is used as the difference between +each term. The default increment is 1 or -1 as appropriate. +.PP +Brace expansion is performed before any other expansions, +and any characters special to other expansions are preserved +in the result. It is strictly textual. +.B Bash +does not apply any syntactic interpretation to the context of the +expansion or the text between the braces. +.PP +A correctly-formed brace expansion must contain unquoted opening +and closing braces, and at least one unquoted comma or a valid +sequence expression. +Any incorrectly formed brace expansion is left unchanged. +A \fB{\fP or \fB,\fP may be quoted with a backslash to prevent its +being considered part of a brace expression. +To avoid conflicts with parameter expansion, the string \fB${\fP +is not considered eligible for brace expansion. +.PP +This construct is typically used as shorthand when the common +prefix of the strings to be generated is longer than in the +above example: +.RS +.PP +mkdir /usr/local/src/bash/{old,new,dist,bugs} +.RE +or +.RS +chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} +.RE +.PP +Brace expansion introduces a slight incompatibility with +historical versions of +.BR sh . +.B sh +does not treat opening or closing braces specially when they +appear as part of a word, and preserves them in the output. +.B Bash +removes braces from words as a consequence of brace +expansion. For example, a word entered to +.B sh +as \fIfile{1,2}\fP +appears identically in the output. The same word is +output as +.I file1 file2 +after expansion by +.BR bash . +If strict compatibility with +.B sh +is desired, start +.B bash +with the +.B +B +option or disable brace expansion with the +.B +B +option to the +.B set +command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SS Tilde Expansion +.PP +If a word begins with an unquoted tilde character (`\fB~\fP'), all of +the characters preceding the first unquoted slash (or all characters, +if there is no unquoted slash) are considered a \fItilde-prefix\fP. +If none of the characters in the tilde-prefix are quoted, the +characters in the tilde-prefix following the tilde are treated as a +possible \fIlogin name\fP. +If this login name is the null string, the tilde is replaced with the +value of the shell parameter +.SM +.BR HOME . +If +.SM +.B HOME +is unset, the home directory of the user executing the shell is +substituted instead. +Otherwise, the tilde-prefix is replaced with the home directory +associated with the specified login name. +.PP +If the tilde-prefix is a `~+', the value of the shell variable +.SM +.B PWD +replaces the tilde-prefix. +If the tilde-prefix is a `~\-', the value of the shell variable +.SM +.BR OLDPWD , +if it is set, is substituted. +If the characters following the tilde in the tilde-prefix consist +of a number \fIN\fP, optionally prefixed +by a `+' or a `\-', the tilde-prefix is replaced with the corresponding +element from the directory stack, as it would be displayed by the +.B dirs +builtin invoked with the tilde-prefix as an argument. +If the characters following the tilde in the tilde-prefix consist of a +number without a leading `+' or `\-', `+' is assumed. +.PP +If the login name is invalid, or the tilde expansion fails, the word +is unchanged. +.PP +Each variable assignment is checked for unquoted tilde-prefixes immediately +following a +.B : +or the first +.BR = . +In these cases, tilde expansion is also performed. +Consequently, one may use filenames with tildes in assignments to +.SM +.BR PATH , +.SM +.BR MAILPATH , +and +.SM +.BR CDPATH , +and the shell assigns the expanded value. +.SS Parameter Expansion +.PP +The `\fB$\fP' character introduces parameter expansion, +command substitution, or arithmetic expansion. The parameter name +or symbol to be expanded may be enclosed in braces, which +are optional but serve to protect the variable to be expanded from +characters immediately following it which could be +interpreted as part of the name. +.PP +When braces are used, the matching ending brace is the first `\fB}\fP' +not escaped by a backslash or within a quoted string, and not within an +embedded arithmetic expansion, command substitution, or parameter +expansion. +.PP +.PD 0 +.TP +${\fIparameter\fP} +The value of \fIparameter\fP is substituted. The braces are required +when +.I parameter +is a positional parameter with more than one digit, +or when +.I parameter +is followed by a character which is not to be +interpreted as part of its name. +The \fIparameter\fP is a shell parameter as described above +\fBPARAMETERS\fP) or an array reference (\fBArrays\fP). +.PD +.PP +If the first character of \fIparameter\fP is an exclamation point (\fB!\fP), +it introduces a level of variable indirection. +\fBBash\fP uses the value of the variable formed from the rest of +\fIparameter\fP as the name of the variable; this variable is then +expanded and that value is used in the rest of the substitution, rather +than the value of \fIparameter\fP itself. +This is known as \fIindirect expansion\fP. +The exceptions to this are the expansions of ${\fB!\fP\fIprefix\fP\fB*\fP} and +${\fB!\fP\fIname\fP[\fI@\fP]} described below. +The exclamation point must immediately follow the left brace in order to +introduce indirection. +.PP +In each of the cases below, \fIword\fP is subject to tilde expansion, +parameter expansion, command substitution, and arithmetic expansion. +.PP +When not performing substring expansion, using the forms documented below +(e.g., \fB:-\fP), +\fBbash\fP tests for a parameter that is unset or null. Omitting the colon +results in a test only for a parameter that is unset. +.PP +.PD 0 +.TP +${\fIparameter\fP\fB:\-\fP\fIword\fP} +\fBUse Default Values\fP. If +.I parameter +is unset or null, the expansion of +.I word +is substituted. Otherwise, the value of +.I parameter +is substituted. +.TP +${\fIparameter\fP\fB:=\fP\fIword\fP} +\fBAssign Default Values\fP. +If +.I parameter +is unset or null, the expansion of +.I word +is assigned to +.IR parameter . +The value of +.I parameter +is then substituted. Positional parameters and special parameters may +not be assigned to in this way. +.TP +${\fIparameter\fP\fB:?\fP\fIword\fP} +\fBDisplay Error if Null or Unset\fP. +If +.I parameter +is null or unset, the expansion of \fIword\fP (or a message to that effect +if +.I word +is not present) is written to the standard error and the shell, if it +is not interactive, exits. Otherwise, the value of \fIparameter\fP is +substituted. +.TP +${\fIparameter\fP\fB:+\fP\fIword\fP} +\fBUse Alternate Value\fP. +If +.I parameter +is null or unset, nothing is substituted, otherwise the expansion of +.I word +is substituted. +.TP +${\fIparameter\fP\fB:\fP\fIoffset\fP} +.PD 0 +.TP +${\fIparameter\fP\fB:\fP\fIoffset\fP\fB:\fP\fIlength\fP} +.PD +\fBSubstring Expansion\fP. +Expands to up to \fIlength\fP characters of the value of \fIparameter\fP +starting at the character specified by \fIoffset\fP. +If \fIparameter\fP is \fB@\fP, an indexed array subscripted by +\fB@\fP or \fB*\fP, or an associative array name, the results differ as +described below. +If \fIlength\fP is omitted, expands to the substring of the value of +\fIparameter\fP starting at the character specified by \fIoffset\fP +and extending to the end of the value. +\fIlength\fP and \fIoffset\fP are arithmetic expressions (see +.SM +.B +ARITHMETIC EVALUATION +below). +.sp 1 +If \fIoffset\fP evaluates to a number less than zero, the value +is used as an offset in characters +from the end of the value of \fIparameter\fP. +If \fIlength\fP evaluates to a number less than zero, +it is interpreted as an offset in characters +from the end of the value of \fIparameter\fP rather than +a number of characters, and the expansion is the characters between +\fIoffset\fP and that result. +Note that a negative offset must be separated from the colon by at least +one space to avoid being confused with the \fB:-\fP expansion. +.sp 1 +If \fIparameter\fP is \fB@\fP, the result is \fIlength\fP positional +parameters beginning at \fIoffset\fP. +A negative \fIoffset\fP is taken relative to one greater than the greatest +positional parameter, so an offset of -1 evaluates to the last positional +parameter. +It is an expansion error if \fIlength\fP evaluates to a number less than +zero. +.sp 1 +If \fIparameter\fP is an indexed array name subscripted by @ or *, +the result is the \fIlength\fP +members of the array beginning with ${\fIparameter\fP[\fIoffset\fP]}. +A negative \fIoffset\fP is taken relative to one greater than the maximum +index of the specified array. +It is an expansion error if \fIlength\fP evaluates to a number less than +zero. +.sp 1 +Substring expansion applied to an associative array produces undefined +results. +.sp 1 +Substring indexing is zero-based unless the positional parameters +are used, in which case the indexing starts at 1 by default. +If \fIoffset\fP is 0, and the positional parameters are used, \fB$0\fP is +prefixed to the list. +.TP +${\fB!\fP\fIprefix\fP\fB*\fP} +.PD 0 +.TP +${\fB!\fP\fIprefix\fP\fB@\fP} +.PD +\fBNames matching prefix\fP. +Expands to the names of variables whose names begin with \fIprefix\fP, +separated by the first character of the +.SM +.B IFS +special variable. +When \fI@\fP is used and the expansion appears within double quotes, each +variable name expands to a separate word. +.TP +${\fB!\fP\fIname\fP[\fI@\fP]} +.PD 0 +.TP +${\fB!\fP\fIname\fP[\fI*\fP]} +.PD +\fBList of array keys\fP. +If \fIname\fP is an array variable, expands to the list of array indices +(keys) assigned in \fIname\fP. +If \fIname\fP is not an array, expands to 0 if \fIname\fP is set and null +otherwise. +When \fI@\fP is used and the expansion appears within double quotes, each +key expands to a separate word. +.TP +${\fB#\fP\fIparameter\fP} +\fBParameter length\fP. +The length in characters of the value of \fIparameter\fP is substituted. +If +.I parameter +is +.B * +or +.BR @ , +the value substituted is the number of positional parameters. +If +.I parameter +is an array name subscripted by +.B * +or +.BR @ , +the value substituted is the number of elements in the array. +If +.I parameter +is an indexed array name subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +\fIparameter\fP, so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.TP +${\fIparameter\fP\fB#\fP\fIword\fP} +.PD 0 +.TP +${\fIparameter\fP\fB##\fP\fIword\fP} +.PD +\fBRemove matching prefix pattern\fP. +The +.I word +is expanded to produce a pattern just as in pathname +expansion. If the pattern matches the beginning of +the value of +.IR parameter , +then the result of the expansion is the expanded value of +.I parameter +with the shortest matching pattern (the ``\fB#\fP'' case) or the +longest matching pattern (the ``\fB##\fP'' case) deleted. +If +.I parameter +is +.B @ +or +.BR * , +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB%\fP\fIword\fP} +.PD 0 +.TP +${\fIparameter\fP\fB%%\fP\fIword\fP} +.PD +\fBRemove matching suffix pattern\fP. +The \fIword\fP is expanded to produce a pattern just as in +pathname expansion. +If the pattern matches a trailing portion of the expanded value of +.IR parameter , +then the result of the expansion is the expanded value of +.I parameter +with the shortest matching pattern (the ``\fB%\fP'' case) or the +longest matching pattern (the ``\fB%%\fP'' case) deleted. +If +.I parameter +is +.B @ +or +.BR * , +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB/\fP\fIpattern\fP\fB/\fP\fIstring\fP} +\fBPattern substitution\fP. +The \fIpattern\fP is expanded to produce a pattern just as in +pathname expansion. +\fIParameter\fP is expanded and the longest match of \fIpattern\fP +against its value is replaced with \fIstring\fP. +If \fIpattern\fP begins with \fB/\fP, all matches of \fIpattern\fP are +replaced with \fIstring\fP. Normally only the first match is replaced. +If \fIpattern\fP begins with \fB#\fP, it must match at the beginning +of the expanded value of \fIparameter\fP. +If \fIpattern\fP begins with \fB%\fP, it must match at the end +of the expanded value of \fIparameter\fP. +If \fIstring\fP is null, matches of \fIpattern\fP are deleted +and the \fB/\fP following \fIpattern\fP may be omitted. +If +.I parameter +is +.B @ +or +.BR * , +the substitution operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the substitution operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB^\fP\fIpattern\fP} +.PD 0 +.TP +${\fIparameter\fP\fB^^\fP\fIpattern\fP} +.TP +${\fIparameter\fP\fB,\fP\fIpattern\fP} +.TP +${\fIparameter\fP\fB,,\fP\fIpattern\fP} +.PD +\fBCase modification\fP. +This expansion modifies the case of alphabetic characters in \fIparameter\fP. +The \fIpattern\fP is expanded to produce a pattern just as in +pathname expansion. +Each character in the expanded value of \fIparameter\fP is tested against +\fIpattern\fP, and, if it matches the pattern, its case is converted. +The pattern should not attempt to match more than one character. +The \fB^\fP operator converts lowercase letters matching \fIpattern\fP +to uppercase; the \fB,\fP operator converts matching uppercase letters +to lowercase. +The \fB^^\fP and \fB,,\fP expansions convert each matched character in the +expanded value; the \fB^\fP and \fB,\fP expansions match and convert only +the first character in the expanded value. +If \fIpattern\fP is omitted, it is treated like a \fB?\fP, which matches +every character. +If +.I parameter +is +.B @ +or +.BR * , +the case modification operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the case modification operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.SS Command Substitution +.PP +\fICommand substitution\fP allows the output of a command to replace +the command name. There are two forms: +.RS +.PP +\fB$(\fP\fIcommand\fP\|\fB)\fP +.RE +or +.RS +\fB\`\fP\fIcommand\fP\fB\`\fP +.RE +.PP +.B Bash +performs the expansion by executing \fIcommand\fP and +replacing the command substitution with the standard output of the +command, with any trailing newlines deleted. +Embedded newlines are not deleted, but they may be removed during +word splitting. +The command substitution \fB$(cat \fIfile\fP)\fR can be replaced by +the equivalent but faster \fB$(< \fIfile\fP)\fR. +.PP +When the old-style backquote form of substitution is used, +backslash retains its literal meaning except when followed by +.BR $ , +.BR \` , +or +.BR \e . +The first backquote not preceded by a backslash terminates the +command substitution. +When using the $(\^\fIcommand\fP\|) form, all characters between the +parentheses make up the command; none are treated specially. +.PP +Command substitutions may be nested. To nest when using the backquoted form, +escape the inner backquotes with backslashes. +.PP +If the substitution appears within double quotes, word splitting and +pathname expansion are not performed on the results. +.SS Arithmetic Expansion +.PP +Arithmetic expansion allows the evaluation of an arithmetic expression +and the substitution of the result. The format for arithmetic expansion is: +.RS +.PP +\fB$((\fP\fIexpression\fP\fB))\fP +.RE +.PP +The old format \fB$[\fP\fIexpression\fP\fB]\fP is deprecated and will +be removed in upcoming versions of bash. +.PP +The +.I expression +is treated as if it were within double quotes, but a double quote +inside the parentheses is not treated specially. +All tokens in the expression undergo parameter and variable expansion, +command substitution, and quote removal. +The result is treated as the arithmetic expression to be evaluated. +Arithmetic expansions may be nested. +.PP +The evaluation is performed according to the rules listed below under +.SM +.BR "ARITHMETIC EVALUATION" . +If +.I expression +is invalid, +.B bash +prints a message indicating failure and no substitution occurs. +.SS Process Substitution +.PP +\fIProcess substitution\fP is supported on systems that support named +pipes (\fIFIFOs\fP) or the \fB/dev/fd\fP method of naming open files. +It takes the form of +\fB<(\fP\fIlist\^\fP\fB)\fP +or +\fB>(\fP\fIlist\^\fP\fB)\fP. +The process \fIlist\fP is run with its input or output connected to a +\fIFIFO\fP or some file in \fB/dev/fd\fP. The name of this file is +passed as an argument to the current command as the result of the +expansion. If the \fB>(\fP\fIlist\^\fP\fB)\fP form is used, writing to +the file will provide input for \fIlist\fP. If the +\fB<(\fP\fIlist\^\fP\fB)\fP form is used, the file passed as an +argument should be read to obtain the output of \fIlist\fP. +.PP +When available, process substitution is performed +simultaneously with parameter and variable expansion, +command substitution, +and arithmetic expansion. +.SS Word Splitting +.PP +The shell scans the results of +parameter expansion, +command substitution, +and +arithmetic expansion +that did not occur within double quotes for +.IR "word splitting" . +.PP +The shell treats each character of +.SM +.B IFS +as a delimiter, and splits the results of the other +expansions into words using these characters as field terminators. +If +.SM +.B IFS +is unset, or its +value is exactly +.BR , +the default, then +sequences of +.BR , +.BR , +and +.B +at the beginning and end of the results of the previous +expansions are ignored, and +any sequence of +.SM +.B IFS +characters not at the beginning or end serves to delimit words. +If +.SM +.B IFS +has a value other than the default, then sequences of +the whitespace characters +.B space +and +.B tab +are ignored at the beginning and end of the +word, as long as the whitespace character is in the +value of +.SM +.BR IFS +(an +.SM +.B IFS +whitespace character). +Any character in +.SM +.B IFS +that is not +.SM +.B IFS +whitespace, along with any adjacent +.SM +.B IFS +whitespace characters, delimits a field. +A sequence of +.SM +.B IFS +whitespace characters is also treated as a delimiter. +If the value of +.SM +.B IFS +is null, no word splitting occurs. +.PP +Explicit null arguments (\^\f3"\^"\fP or \^\f3\(aq\^\(aq\fP\^) are retained. +Unquoted implicit null arguments, resulting from the expansion of +parameters that have no values, are removed. +If a parameter with no value is expanded within double quotes, a +null argument results and is retained. +.PP +Note that if no expansion occurs, no splitting +is performed. +.SS Pathname Expansion +.PP +After word splitting, +unless the +.B \-f +option has been set, +.B bash +scans each word for the characters +.BR * , +.BR ? , +and +.BR [ . +If one of these characters appears, then the word is +regarded as a +.IR pattern , +and replaced with an alphabetically sorted list of +filenames matching the pattern +(see +.SM +.B "Pattern Matching" +below). +If no matching filenames are found, +and the shell option +.B nullglob +is not enabled, the word is left unchanged. +If the +.B nullglob +option is set, and no matches are found, +the word is removed. +If the +.B failglob +shell option is set, and no matches are found, an error message +is printed and the command is not executed. +If the shell option +.B nocaseglob +is enabled, the match is performed without regard to the case +of alphabetic characters. +When a pattern is used for pathname expansion, +the character +.B ``.'' +at the start of a name or immediately following a slash +must be matched explicitly, unless the shell option +.B dotglob +is set. +When matching a pathname, the slash character must always be +matched explicitly. +In other cases, the +.B ``.'' +character is not treated specially. +See the description of +.B shopt +below under +.SM +.B SHELL BUILTIN COMMANDS +for a description of the +.BR nocaseglob , +.BR nullglob , +.BR failglob , +and +.B dotglob +shell options. +.PP +The +.SM +.B GLOBIGNORE +shell variable may be used to restrict the set of filenames matching a +.IR pattern . +If +.SM +.B GLOBIGNORE +is set, each matching filename that also matches one of the patterns in +.SM +.B GLOBIGNORE +is removed from the list of matches. +The filenames +.B ``.'' +and +.B ``..'' +are always ignored when +.SM +.B GLOBIGNORE +is set and not null. However, setting +.SM +.B GLOBIGNORE +to a non-null value has the effect of enabling the +.B dotglob +shell option, so all other filenames beginning with a +.B ``.'' +will match. +To get the old behavior of ignoring filenames beginning with a +.BR ``.'' , +make +.B ``.*'' +one of the patterns in +.SM +.BR GLOBIGNORE . +The +.B dotglob +option is disabled when +.SM +.B GLOBIGNORE +is unset. +.PP +\fBPattern Matching\fP +.PP +Any character that appears in a pattern, other than the special pattern +characters described below, matches itself. The NUL character may not +occur in a pattern. A backslash escapes the following character; the +escaping backslash is discarded when matching. +The special pattern characters must be quoted if +they are to be matched literally. +.PP +The special pattern characters have the following meanings: +.PP +.PD 0 +.RS +.TP +.B * +Matches any string, including the null string. +When the \fBglobstar\fP shell option is enabled, and \fB*\fP is used in +a pathname expansion context, two adjacent \fB*\fPs used as a single +pattern will match all files and zero or more directories and +subdirectories. +If followed by a \fB/\fP, two adjacent \fB*\fPs will match only directories +and subdirectories. +.TP +.B ? +Matches any single character. +.TP +.B [...] +Matches any one of the enclosed characters. A pair of characters +separated by a hyphen denotes a +\fIrange expression\fP; +any character that falls between those two characters, inclusive, +using the current locale's collating sequence and character set, +is matched. If the first character following the +.B [ +is a +.B ! +or a +.B ^ +then any character not enclosed is matched. +The sorting order of characters in range expressions is determined by +the current locale and the values of the +.SM +.B LC_COLLATE +or +.SM +.B LC_ALL +shell variables, if set. +To obtain the traditional interpretation of range expressions, where +.B [a\-d] +is equivalent to +.BR [abcd] , +set value of the +.B LC_ALL +shell variable to +.BR C , +or enable the +.B globasciiranges +shell option. +A +.B \- +may be matched by including it as the first or last character +in the set. +A +.B ] +may be matched by including it as the first character +in the set. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +\fIcharacter classes\fP can be specified using the syntax +\fB[:\fP\fIclass\fP\fB:]\fP, where \fIclass\fP is one of the +following classes defined in the POSIX standard: +.PP +.RS +.B +.if n alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit +.if t alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit +.br +A character class matches any character belonging to that class. +The \fBword\fP character class matches letters, digits, and the character _. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +an \fIequivalence class\fP can be specified using the syntax +\fB[=\fP\fIc\fP\fB=]\fP, which matches all characters with the +same collation weight (as defined by the current locale) as +the character \fIc\fP. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +the syntax \fB[.\fP\fIsymbol\fP\fB.]\fP matches the collating symbol +\fIsymbol\fP. +.RE +.RE +.PD +.PP +If the \fBextglob\fP shell option is enabled using the \fBshopt\fP +builtin, several extended pattern matching operators are recognized. +In the following description, a \fIpattern-list\fP is a list of one +or more patterns separated by a \fB|\fP. +Composite patterns may be formed using one or more of the following +sub-patterns: +.sp 1 +.PD 0 +.RS +.TP +\fB?(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches zero or one occurrence of the given patterns +.TP +\fB*(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches zero or more occurrences of the given patterns +.TP +\fB+(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches one or more occurrences of the given patterns +.TP +\fB@(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches one of the given patterns +.TP +\fB!(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches anything except one of the given patterns +.RE +.PD +.SS Quote Removal +.PP +After the preceding expansions, all unquoted occurrences of the +characters +.BR \e , +.BR \(aq , +and \^\f3"\fP\^ that did not result from one of the above +expansions are removed. +.SH REDIRECTION +Before a command is executed, its input and output +may be +.I redirected +using a special notation interpreted by the shell. +Redirection allows commands' file handles to be +duplicated, opened, closed, +made to refer to different files, +and can change the files the command reads from and writes to. +Redirection may also be used to modify file handles in the +current shell execution environment. +The following redirection +operators may precede or appear anywhere within a +.I simple command +or may follow a +.IR command . +Redirections are processed in the order they appear, from +left to right. +.PP +Each redirection that may be preceded by a file descriptor number +may instead be preceded by a word of the form {\fIvarname\fP}. +In this case, for each redirection operator except +>&- and <&-, the shell will allocate a file descriptor greater +than or equal to 10 and assign it to \fIvarname\fP. +If >&- or <&- is preceded +by {\fIvarname\fP}, the value of \fIvarname\fP defines the file +descriptor to close. +.PP +In the following descriptions, if the file descriptor number is +omitted, and the first character of the redirection operator is +.BR < , +the redirection refers to the standard input (file descriptor +0). If the first character of the redirection operator is +.BR > , +the redirection refers to the standard output (file descriptor +1). +.PP +The word following the redirection operator in the following +descriptions, unless otherwise noted, is subjected to +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, quote removal, +pathname expansion, and word splitting. +If it expands to more than one word, +.B bash +reports an error. +.PP +Note that the order of redirections is significant. For example, +the command +.RS +.PP +ls \fB>\fP dirlist 2\fB>&\fP1 +.RE +.PP +directs both standard output and standard error to the file +.IR dirlist , +while the command +.RS +.PP +ls 2\fB>&\fP1 \fB>\fP dirlist +.RE +.PP +directs only the standard output to file +.IR dirlist , +because the standard error was duplicated from the standard output +before the standard output was redirected to +.IR dirlist . +.PP +\fBBash\fP handles several filenames specially when they are used in +redirections, as described in the following table: +.RS +.PP +.PD 0 +.TP +.B /dev/fd/\fIfd\fP +If \fIfd\fP is a valid integer, file descriptor \fIfd\fP is duplicated. +.TP +.B /dev/stdin +File descriptor 0 is duplicated. +.TP +.B /dev/stdout +File descriptor 1 is duplicated. +.TP +.B /dev/stderr +File descriptor 2 is duplicated. +.TP +.B /dev/tcp/\fIhost\fP/\fIport\fP +If \fIhost\fP is a valid hostname or Internet address, and \fIport\fP +is an integer port number or service name, \fBbash\fP attempts to open +the corresponding TCP socket. +.TP +.B /dev/udp/\fIhost\fP/\fIport\fP +If \fIhost\fP is a valid hostname or Internet address, and \fIport\fP +is an integer port number or service name, \fBbash\fP attempts to open +the corresponding UDP socket. +.PD +.RE +.PP +A failure to open or create a file causes the redirection to fail. +.PP +Redirections using file descriptors greater than 9 should be used with +care, as they may conflict with file descriptors the shell uses +internally. +.SS Redirecting Input +.PP +Redirection of input causes the file whose name results from +the expansion of +.I word +to be opened for reading on file descriptor +.IR n , +or the standard input (file descriptor 0) if +.I n +is not specified. +.PP +The general format for redirecting input is: +.RS +.PP +[\fIn\fP]\fB<\fP\fIword\fP +.RE +.SS Redirecting Output +.PP +Redirection of output causes the file whose name results from +the expansion of +.I word +to be opened for writing on file descriptor +.IR n , +or the standard output (file descriptor 1) if +.I n +is not specified. If the file does not exist it is created; +if it does exist it is truncated to zero size. +.PP +The general format for redirecting output is: +.RS +.PP +[\fIn\fP]\fB>\fP\fIword\fP +.RE +.PP +If the redirection operator is +.BR > , +and the +.B noclobber +option to the +.B set +builtin has been enabled, the redirection will fail if the file +whose name results from the expansion of \fIword\fP exists and is +a regular file. +If the redirection operator is +.BR >| , +or the redirection operator is +.B > +and the +.B noclobber +option to the +.B set +builtin command is not enabled, the redirection is attempted even +if the file named by \fIword\fP exists. +.SS Appending Redirected Output +.PP +Redirection of output in this fashion +causes the file whose name results from +the expansion of +.I word +to be opened for appending on file descriptor +.IR n , +or the standard output (file descriptor 1) if +.I n +is not specified. If the file does not exist it is created. +.PP +The general format for appending output is: +.RS +.PP +[\fIn\fP]\fB>>\fP\fIword\fP +.RE +.PP +.SS Redirecting Standard Output and Standard Error +.PP +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be redirected to the file whose name is the +expansion of +.IR word . +.PP +There are two formats for redirecting standard output and +standard error: +.RS +.PP +\fB&>\fP\fIword\fP +.RE +and +.RS +\fB>&\fP\fIword\fP +.RE +.PP +Of the two forms, the first is preferred. +This is semantically equivalent to +.RS +.PP +\fB>\fP\fIword\fP 2\fB>&\fP1 +.RE +.PP +When using the second form, \fIword\fP may not expand to a number or +\fB\-\fP. If it does, other redirection operators apply +(see \fBDuplicating File Descriptors\fP below) for compatibility +reasons. +.SS Appending Standard Output and Standard Error +.PP +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be appended to the file whose name is the +expansion of +.IR word . +.PP +The format for appending standard output and standard error is: +.RS +.PP +\fB&>>\fP\fIword\fP +.RE +.PP +This is semantically equivalent to +.RS +.PP +\fB>>\fP\fIword\fP 2\fB>&\fP1 +.RE +.PP +(see \fBDuplicating File Descriptors\fP below). +.SS Here Documents +.PP +This type of redirection instructs the shell to read input from the +current source until a line containing only +.I delimiter +(with no trailing blanks) +is seen. All of +the lines read up to that point are then used as the standard +input for a command. +.PP +The format of here-documents is: +.RS +.PP +.nf +\fB<<\fP[\fB\-\fP]\fIword\fP + \fIhere-document\fP +\fIdelimiter\fP +.fi +.RE +.PP +No parameter and variable expansion, command substitution, +arithmetic expansion, or pathname expansion is performed on +.IR word . +If any characters in +.I word +are quoted, the +.I delimiter +is the result of quote removal on +.IR word , +and the lines in the here-document are not expanded. +If \fIword\fP is unquoted, +all lines of the here-document are subjected to +parameter expansion, command substitution, and arithmetic expansion, +the character sequence +.B \e +is ignored, and +.B \e +must be used to quote the characters +.BR \e , +.BR $ , +and +.BR \` . +.PP +If the redirection operator is +.BR <<\- , +then all leading tab characters are stripped from input lines and the +line containing +.IR delimiter . +This allows +here-documents within shell scripts to be indented in a +natural fashion. +.SS "Here Strings" +A variant of here documents, the format is: +.RS +.PP +.nf +\fB<<<\fP\fIword\fP +.fi +.RE +.PP +The \fIword\fP undergoes +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote removal. +Pathname expansion and word splitting are not performed. +The result is supplied as a single string to the command on its +standard input. +.SS "Duplicating File Descriptors" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<&\fP\fIword\fP +.RE +.PP +is used to duplicate input file descriptors. +If +.I word +expands to one or more digits, the file descriptor denoted by +.I n +is made to be a copy of that file descriptor. +If the digits in +.I word +do not specify a file descriptor open for input, a redirection error occurs. +If +.I word +evaluates to +.BR \- , +file descriptor +.I n +is closed. If +.I n +is not specified, the standard input (file descriptor 0) is used. +.PP +The operator +.RS +.PP +[\fIn\fP]\fB>&\fP\fIword\fP +.RE +.PP +is used similarly to duplicate output file descriptors. If +.I n +is not specified, the standard output (file descriptor 1) is used. +If the digits in +.I word +do not specify a file descriptor open for output, a redirection error occurs. +If +.I word +evaluates to +.BR \- , +file descriptor +.I n +is closed. +As a special case, if \fIn\fP is omitted, and \fIword\fP does not +expand to one or more digits or \fB\-\fP, the standard output and standard +error are redirected as described previously. +.SS "Moving File Descriptors" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<&\fP\fIdigit\fP\fB\-\fP +.RE +.PP +moves the file descriptor \fIdigit\fP to file descriptor +.IR n , +or the standard input (file descriptor 0) if \fIn\fP is not specified. +\fIdigit\fP is closed after being duplicated to \fIn\fP. +.PP +Similarly, the redirection operator +.RS +.PP +[\fIn\fP]\fB>&\fP\fIdigit\fP\fB\-\fP +.RE +.PP +moves the file descriptor \fIdigit\fP to file descriptor +.IR n , +or the standard output (file descriptor 1) if \fIn\fP is not specified. +.SS "Opening File Descriptors for Reading and Writing" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<>\fP\fIword\fP +.RE +.PP +causes the file whose name is the expansion of +.I word +to be opened for both reading and writing on file descriptor +.IR n , +or on file descriptor 0 if +.I n +is not specified. If the file does not exist, it is created. +.SH ALIASES +\fIAliases\fP allow a string to be substituted for a word when it is used +as the first word of a simple command. +The shell maintains a list of aliases that may be set and unset with the +.B alias +and +.B unalias +builtin commands (see +.SM +.B SHELL BUILTIN COMMANDS +below). +The first word of each simple command, if unquoted, +is checked to see if it has an +alias. If so, that word is replaced by the text of the alias. +The characters \fB/\fP, \fB$\fP, \fB\`\fP, and \fB=\fP and +any of the shell \fImetacharacters\fP or quoting characters +listed above may not appear in an alias name. +The replacement text may contain any valid shell input, +including shell metacharacters. +The first word of the replacement text is tested +for aliases, but a word that is identical to an alias being expanded +is not expanded a second time. +This means that one may alias +.B ls +to +.BR "ls \-F" , +for instance, and +.B bash +does not try to recursively expand the replacement text. +If the last character of the alias value is a +.IR blank , +then the next command +word following the alias is also checked for alias expansion. +.PP +Aliases are created and listed with the +.B alias +command, and removed with the +.B unalias +command. +.PP +There is no mechanism for using arguments in the replacement text. +If arguments are needed, a shell function should be used (see +.SM +.B FUNCTIONS +below). +.PP +Aliases are not expanded when the shell is not interactive, unless +the +.B expand_aliases +shell option is set using +.B shopt +(see the description of +.B shopt +under +.SM +\fBSHELL BUILTIN COMMANDS\fP +below). +.PP +The rules concerning the definition and use of aliases are +somewhat confusing. +.B Bash +always reads at least one complete line +of input before executing any +of the commands on that line. Aliases are expanded when a +command is read, not when it is executed. Therefore, an +alias definition appearing on the same line as another +command does not take effect until the next line of input is read. +The commands following the alias definition +on that line are not affected by the new alias. +This behavior is also an issue when functions are executed. +Aliases are expanded when a function definition is read, +not when the function is executed, because a function definition +is itself a compound command. As a consequence, aliases +defined in a function are not available until after that +function is executed. To be safe, always put +alias definitions on a separate line, and do not use +.B alias +in compound commands. +.PP +For almost every purpose, aliases are superseded by +shell functions. +.SH FUNCTIONS +A shell function, defined as described above under +.SM +.BR "SHELL GRAMMAR" , +stores a series of commands for later execution. +When the name of a shell function is used as a simple command name, +the list of commands associated with that function name is executed. +Functions are executed in the context of the +current shell; no new process is created to interpret +them (contrast this with the execution of a shell script). +When a function is executed, the arguments to the +function become the positional parameters +during its execution. +The special parameter +.B # +is updated to reflect the change. Special parameter \fB0\fP +is unchanged. +The first element of the +.SM +.B FUNCNAME +variable is set to the name of the function while the function +is executing. +.PP +All other aspects of the shell execution +environment are identical between a function and its caller +with these exceptions: the +.SM +.B DEBUG +and +.B RETURN +traps (see the description of the +.B trap +builtin under +.SM +.B SHELL BUILTIN COMMANDS +below) are not inherited unless the function has been given the +\fBtrace\fP attribute (see the description of the +.SM +.B declare +builtin below) or the +\fB\-o functrace\fP shell option has been enabled with +the \fBset\fP builtin +(in which case all functions inherit the \fBDEBUG\fP and \fBRETURN\fP traps), +and the +.SM +.B ERR +trap is not inherited unless the \fB\-o errtrace\fP shell option has +been enabled. +.PP +Variables local to the function may be declared with the +.B local +builtin command. Ordinarily, variables and their values +are shared between the function and its caller. +.PP +The \fBFUNCNEST\fP variable, if set to a numeric value greater +than 0, defines a maximum function nesting level. Function +invocations that exceed the limit cause the entire command to +abort. +.PP +If the builtin command +.B return +is executed in a function, the function completes and +execution resumes with the next command after the function +call. +Any command associated with the \fBRETURN\fP trap is executed +before execution resumes. +When a function completes, the values of the +positional parameters and the special parameter +.B # +are restored to the values they had prior to the function's +execution. +.PP +Function names and definitions may be listed with the +.B \-f +option to the +.B declare +or +.B typeset +builtin commands. The +.B \-F +option to +.B declare +or +.B typeset +will list the function names only +(and optionally the source file and line number, if the \fBextdebug\fP +shell option is enabled). +Functions may be exported so that subshells +automatically have them defined with the +.B \-f +option to the +.B export +builtin. +A function definition may be deleted using the \fB\-f\fP option to +the +.B unset +builtin. +Note that shell functions and variables with the same name may result +in multiple identically-named entries in the environment passed to the +shell's children. +Care should be taken in cases where this may cause a problem. +.PP +Functions may be recursive. +The \fBFUNCNEST\fP variable may be used to limit the depth of the +function call stack and restrict the number of function invocations. +By default, no limit is imposed on the number of recursive calls. +.SH "ARITHMETIC EVALUATION" +The shell allows arithmetic expressions to be evaluated, under +certain circumstances (see the \fBlet\fP and \fBdeclare\fP builtin +commands and \fBArithmetic Expansion\fP). +Evaluation is done in fixed-width integers with no check for overflow, +though division by 0 is trapped and flagged as an error. +The operators and their precedence, associativity, and values +are the same as in the C language. +The following list of operators is grouped into levels of +equal-precedence operators. +The levels are listed in order of decreasing precedence. +.PP +.PD 0 +.TP +.B \fIid\fP++ \fIid\fP\-\- +variable post-increment and post-decrement +.TP +.B ++\fIid\fP \-\-\fIid\fP +variable pre-increment and pre-decrement +.TP +.B \- + +unary minus and plus +.TP +.B ! ~ +logical and bitwise negation +.TP +.B ** +exponentiation +.TP +.B * / % +multiplication, division, remainder +.TP +.B + \- +addition, subtraction +.TP +.B << >> +left and right bitwise shifts +.TP +.B <= >= < > +comparison +.TP +.B == != +equality and inequality +.TP +.B & +bitwise AND +.TP +.B ^ +bitwise exclusive OR +.TP +.B | +bitwise OR +.TP +.B && +logical AND +.TP +.B || +logical OR +.TP +.B \fIexpr\fP?\fIexpr\fP:\fIexpr\fP +conditional operator +.TP +.B = *= /= %= += \-= <<= >>= &= ^= |= +assignment +.TP +.B \fIexpr1\fP , \fIexpr2\fP +comma +.PD +.PP +Shell variables are allowed as operands; parameter expansion is +performed before the expression is evaluated. +Within an expression, shell variables may also be referenced by name +without using the parameter expansion syntax. +A shell variable that is null or unset evaluates to 0 when referenced +by name without using the parameter expansion syntax. +The value of a variable is evaluated as an arithmetic expression +when it is referenced, or when a variable which has been given the +\fIinteger\fP attribute using \fBdeclare -i\fP is assigned a value. +A null value evaluates to 0. +A shell variable need not have its \fIinteger\fP attribute +turned on to be used in an expression. +.PP +Constants with a leading 0 are interpreted as octal numbers. +A leading 0x or 0X denotes hexadecimal. +Otherwise, numbers take the form [\fIbase#\fP]n, where the optional \fIbase\fP +is a decimal number between 2 and 64 representing the arithmetic +base, and \fIn\fP is a number in that base. +If \fIbase#\fP is omitted, then base 10 is used. +When specifying \fIn\fP, +the digits greater< than 9 are represented by the lowercase letters, +the uppercase letters, @, and _, in that order. +If \fIbase\fP is less than or equal to 36, lowercase and uppercase +letters may be used interchangeably to represent numbers between 10 +and 35. +.PP +Operators are evaluated in order of precedence. Sub-expressions in +parentheses are evaluated first and may override the precedence +rules above. +.SH "CONDITIONAL EXPRESSIONS" +Conditional expressions are used by the \fB[[\fP compound command and +the \fBtest\fP and \fB[\fP builtin commands to test file attributes +and perform string and arithmetic comparisons. +Expressions are formed from the following unary or binary primaries. +If any \fIfile\fP argument to one of the primaries is of the form +\fI/dev/fd/n\fP, then file descriptor \fIn\fP is checked. +If the \fIfile\fP argument to one of the primaries is one of +\fI/dev/stdin\fP, \fI/dev/stdout\fP, or \fI/dev/stderr\fP, file +descriptor 0, 1, or 2, respectively, is checked. +.PP +Unless otherwise specified, primaries that operate on files follow symbolic +links and operate on the target of the link, rather than the link itself. +.if t .sp 0.5 +.if n .sp 1 +When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort +lexicographically using the current locale. +The \fBtest\fP command sorts using ASCII ordering. +.sp 1 +.PD 0 +.TP +.B \-a \fIfile\fP +True if \fIfile\fP exists. +.TP +.B \-b \fIfile\fP +True if \fIfile\fP exists and is a block special file. +.TP +.B \-c \fIfile\fP +True if \fIfile\fP exists and is a character special file. +.TP +.B \-d \fIfile\fP +True if \fIfile\fP exists and is a directory. +.TP +.B \-e \fIfile\fP +True if \fIfile\fP exists. +.TP +.B \-f \fIfile\fP +True if \fIfile\fP exists and is a regular file. +.TP +.B \-g \fIfile\fP +True if \fIfile\fP exists and is set-group-id. +.TP +.B \-h \fIfile\fP +True if \fIfile\fP exists and is a symbolic link. +.TP +.B \-k \fIfile\fP +True if \fIfile\fP exists and its ``sticky'' bit is set. +.TP +.B \-p \fIfile\fP +True if \fIfile\fP exists and is a named pipe (FIFO). +.TP +.B \-r \fIfile\fP +True if \fIfile\fP exists and is readable. +.TP +.B \-s \fIfile\fP +True if \fIfile\fP exists and has a size greater than zero. +.TP +.B \-t \fIfd\fP +True if file descriptor +.I fd +is open and refers to a terminal. +.TP +.B \-u \fIfile\fP +True if \fIfile\fP exists and its set-user-id bit is set. +.TP +.B \-w \fIfile\fP +True if \fIfile\fP exists and is writable. +.TP +.B \-x \fIfile\fP +True if \fIfile\fP exists and is executable. +.TP +.B \-G \fIfile\fP +True if \fIfile\fP exists and is owned by the effective group id. +.TP +.B \-L \fIfile\fP +True if \fIfile\fP exists and is a symbolic link. +.TP +.B \-N \fIfile\fP +True if \fIfile\fP exists and has been modified since it was last read. +.TP +.B \-O \fIfile\fP +True if \fIfile\fP exists and is owned by the effective user id. +.TP +.B \-S \fIfile\fP +True if \fIfile\fP exists and is a socket. +.TP +\fIfile1\fP \fB\-ef\fP \fIfile2\fP +True if \fIfile1\fP and \fIfile2\fP refer to the same device and +inode numbers. +.TP +\fIfile1\fP \-\fBnt\fP \fIfile2\fP +True if \fIfile1\fP is newer (according to modification date) than \fIfile2\fP, +or if \fIfile1\fP exists and \fPfile2\fP does not. +.TP +\fIfile1\fP \-\fBot\fP \fIfile2\fP +True if \fIfile1\fP is older than \fIfile2\fP, or if \fIfile2\fP exists +and \fIfile1\fP does not. +.TP +.B \-o \fIoptname\fP +True if the shell option +.I optname +is enabled. +See the list of options under the description of the +.B \-o +option to the +.B set +builtin below. +.TP +.B \-v \fIvarname\fP +True if the shell variable +.I varname +is set (has been assigned a value). +.TP +.B \-R \fIvarname\fP +True if the shell variable +.I varname +is set and is a name reference. +.TP +.B \-z \fIstring\fP +True if the length of \fIstring\fP is zero. +.TP +\fIstring\fP +.PD 0 +.TP +.B \-n \fIstring\fP +.PD +True if the length of +.I string +is non-zero. +.TP +\fIstring1\fP \fB==\fP \fIstring2\fP +.PD 0 +.TP +\fIstring1\fP \fB=\fP \fIstring2\fP +.PD +True if the strings are equal. \fB=\fP should be used +with the \fBtest\fP command for POSIX conformance. +When used with the \fB[[\fP command, this performs pattern matching as +described above (\fBCompound Commands\fP). +.TP +\fIstring1\fP \fB!=\fP \fIstring2\fP +True if the strings are not equal. +.TP +\fIstring1\fP \fB<\fP \fIstring2\fP +True if \fIstring1\fP sorts before \fIstring2\fP lexicographically. +.TP +\fIstring1\fP \fB>\fP \fIstring2\fP +True if \fIstring1\fP sorts after \fIstring2\fP lexicographically. +.TP +.I \fIarg1\fP \fBOP\fP \fIarg2\fP +.SM +.B OP +is one of +.BR \-eq , +.BR \-ne , +.BR \-lt , +.BR \-le , +.BR \-gt , +or +.BR \-ge . +These arithmetic binary operators return true if \fIarg1\fP +is equal to, not equal to, less than, less than or equal to, +greater than, or greater than or equal to \fIarg2\fP, respectively. +.I Arg1 +and +.I arg2 +may be positive or negative integers. +.PD +.SH "SIMPLE COMMAND EXPANSION" +When a simple command is executed, the shell performs the following +expansions, assignments, and redirections, from left to right. +.IP 1. +The words that the parser has marked as variable assignments (those +preceding the command name) and redirections are saved for later +processing. +.IP 2. +The words that are not variable assignments or redirections are +expanded. If any words remain after expansion, the first word +is taken to be the name of the command and the remaining words are +the arguments. +.IP 3. +Redirections are performed as described above under +.SM +.BR REDIRECTION . +.IP 4. +The text after the \fB=\fP in each variable assignment undergoes tilde +expansion, parameter expansion, command substitution, arithmetic expansion, +and quote removal before being assigned to the variable. +.PP +If no command name results, the variable assignments affect the current +shell environment. Otherwise, the variables are added to the environment +of the executed command and do not affect the current shell environment. +If any of the assignments attempts to assign a value to a readonly variable, +an error occurs, and the command exits with a non-zero status. +.PP +If no command name results, redirections are performed, but do not +affect the current shell environment. A redirection error causes the +command to exit with a non-zero status. +.PP +If there is a command name left after expansion, execution proceeds as +described below. Otherwise, the command exits. If one of the expansions +contained a command substitution, the exit status of the command is +the exit status of the last command substitution performed. If there +were no command substitutions, the command exits with a status of zero. +.SH "COMMAND EXECUTION" +After a command has been split into words, if it results in a +simple command and an optional list of arguments, the following +actions are taken. +.PP +If the command name contains no slashes, the shell attempts to +locate it. If there exists a shell function by that name, that +function is invoked as described above in +.SM +.BR FUNCTIONS . +If the name does not match a function, the shell searches for +it in the list of shell builtins. If a match is found, that +builtin is invoked. +.PP +If the name is neither a shell function nor a builtin, +and contains no slashes, +.B bash +searches each element of the +.SM +.B PATH +for a directory containing an executable file by that name. +.B Bash +uses a hash table to remember the full pathnames of executable +files (see +.B hash +under +.SM +.B "SHELL BUILTIN COMMANDS" +below). +A full search of the directories in +.SM +.B PATH +is performed only if the command is not found in the hash table. +If the search is unsuccessful, the shell searches for a defined shell +function named \fBcommand_not_found_handle\fP. +If that function exists, it is invoked with the original command and +the original command's arguments as its arguments, and the function's +exit status becomes the exit status of the shell. +If that function is not defined, the shell prints an error +message and returns an exit status of 127. +.PP +If the search is successful, or if the command name contains +one or more slashes, the shell executes the named program in a +separate execution environment. +Argument 0 is set to the name given, and the remaining arguments +to the command are set to the arguments given, if any. +.PP +If this execution fails because the file is not in executable +format, and the file is not a directory, it is assumed to be +a \fIshell script\fP, a file +containing shell commands. A subshell is spawned to execute +it. This subshell reinitializes itself, so +that the effect is as if a new shell had been invoked +to handle the script, with the exception that the locations of +commands remembered by the parent (see +.B hash +below under +.SM +\fBSHELL BUILTIN COMMANDS\fP) +are retained by the child. +.PP +If the program is a file beginning with +.BR #! , +the remainder of the first line specifies an interpreter +for the program. The shell executes the +specified interpreter on operating systems that do not +handle this executable format themselves. The arguments to the +interpreter consist of a single optional argument following the +interpreter name on the first line of the program, followed +by the name of the program, followed by the command +arguments, if any. +.SH COMMAND EXECUTION ENVIRONMENT +The shell has an \fIexecution environment\fP, which consists of the +following: +.IP \(bu +open files inherited by the shell at invocation, as modified by +redirections supplied to the \fBexec\fP builtin +.IP \(bu +the current working directory as set by \fBcd\fP, \fBpushd\fP, or +\fBpopd\fP, or inherited by the shell at invocation +.IP \(bu +the file creation mode mask as set by \fBumask\fP or inherited from +the shell's parent +.IP \(bu +current traps set by \fBtrap\fP +.IP \(bu +shell parameters that are set by variable assignment or with \fBset\fP +or inherited from the shell's parent in the environment +.IP \(bu +shell functions defined during execution or inherited from the shell's +parent in the environment +.IP \(bu +options enabled at invocation (either by default or with command-line +arguments) or by \fBset\fP +.IP \(bu +options enabled by \fBshopt\fP +.IP \(bu +shell aliases defined with \fBalias\fP +.IP \(bu +various process IDs, including those of background jobs, the value +of \fB$$\fP, and the value of +.SM +.B PPID +.PP +When a simple command other than a builtin or shell function +is to be executed, it +is invoked in a separate execution environment that consists of +the following. Unless otherwise noted, the values are inherited +from the shell. +.if n .sp 1 +.IP \(bu +the shell's open files, plus any modifications and additions specified +by redirections to the command +.IP \(bu +the current working directory +.IP \(bu +the file creation mode mask +.IP \(bu +shell variables and functions marked for export, along with variables +exported for the command, passed in the environment +.IP \(bu +traps caught by the shell are reset to the values inherited from the +shell's parent, and traps ignored by the shell are ignored +.PP +A command invoked in this separate environment cannot affect the +shell's execution environment. +.PP +Command substitution, commands grouped with parentheses, +and asynchronous commands are invoked in a +subshell environment that is a duplicate of the shell environment, +except that traps caught by the shell are reset to the values +that the shell inherited from its parent at invocation. Builtin +commands that are invoked as part of a pipeline are also executed in a +subshell environment. Changes made to the subshell environment +cannot affect the shell's execution environment. +.PP +Subshells spawned to execute command substitutions inherit the value of +the \fB\-e\fP option from the parent shell. When not in \fIposix\fP mode, +\fBbash\fP clears the \fB\-e\fP option in such subshells. +.PP +If a command is followed by a \fB&\fP and job control is not active, the +default standard input for the command is the empty file \fI/dev/null\fP. +Otherwise, the invoked command inherits the file descriptors of the calling +shell as modified by redirections. +.SH ENVIRONMENT +When a program is invoked it is given an array of strings +called the +.IR environment . +This is a list of +\fIname\fP\-\fIvalue\fP pairs, of the form +.IR "name\fR=\fPvalue" . +.PP +The shell provides several ways to manipulate the environment. +On invocation, the shell scans its own environment and +creates a parameter for each name found, automatically marking +it for +.I export +to child processes. Executed commands inherit the environment. +The +.B export +and +.B declare \-x +commands allow parameters and functions to be added to and +deleted from the environment. If the value of a parameter +in the environment is modified, the new value becomes part +of the environment, replacing the old. The environment +inherited by any executed command consists of the shell's +initial environment, whose values may be modified in the shell, +less any pairs removed by the +.B unset +command, plus any additions via the +.B export +and +.B declare \-x +commands. +.PP +The environment for any +.I simple command +or function may be augmented temporarily by prefixing it with +parameter assignments, as described above in +.SM +.BR PARAMETERS . +These assignment statements affect only the environment seen +by that command. +.PP +If the +.B \-k +option is set (see the +.B set +builtin command below), then +.I all +parameter assignments are placed in the environment for a command, +not just those that precede the command name. +.PP +When +.B bash +invokes an external command, the variable +.B _ +is set to the full filename of the command and passed to that +command in its environment. +.SH "EXIT STATUS" +.PP +The exit status of an executed command is the value returned by the +\fIwaitpid\fP system call or equivalent function. Exit statuses +fall between 0 and 255, though, as explained below, the shell may +use values above 125 specially. Exit statuses from shell builtins and +compound commands are also limited to this range. Under certain +circumstances, the shell will use special values to indicate specific +failure modes. +.PP +For the shell's purposes, a command which exits with a +zero exit status has succeeded. An exit status of zero +indicates success. A non-zero exit status indicates failure. +When a command terminates on a fatal signal \fIN\fP, \fBbash\fP uses +the value of 128+\fIN\fP as the exit status. +.PP +If a command is not found, the child process created to +execute it returns a status of 127. If a command is found +but is not executable, the return status is 126. +.PP +If a command fails because of an error during expansion or redirection, +the exit status is greater than zero. +.PP +Shell builtin commands return a status of 0 (\fItrue\fP) if +successful, and non-zero (\fIfalse\fP) if an error occurs +while they execute. +All builtins return an exit status of 2 to indicate incorrect usage. +.PP +\fBBash\fP itself returns the exit status of the last command +executed, unless a syntax error occurs, in which case it exits +with a non-zero value. See also the \fBexit\fP builtin +command below. +.SH SIGNALS +When \fBbash\fP is interactive, in the absence of any traps, it ignores +.SM +.B SIGTERM +(so that \fBkill 0\fP does not kill an interactive shell), +and +.SM +.B SIGINT +is caught and handled (so that the \fBwait\fP builtin is interruptible). +In all cases, \fBbash\fP ignores +.SM +.BR SIGQUIT . +If job control is in effect, +.B bash +ignores +.SM +.BR SIGTTIN , +.SM +.BR SIGTTOU , +and +.SM +.BR SIGTSTP . +.PP +Non-builtin commands run by \fBbash\fP have signal handlers +set to the values inherited by the shell from its parent. +When job control is not in effect, asynchronous commands +ignore +.SM +.B SIGINT +and +.SM +.B SIGQUIT +in addition to these inherited handlers. +Commands run as a result of command substitution ignore the +keyboard-generated job control signals +.SM +.BR SIGTTIN , +.SM +.BR SIGTTOU , +and +.SM +.BR SIGTSTP . +.PP +The shell exits by default upon receipt of a +.SM +.BR SIGHUP . +Before exiting, an interactive shell resends the +.SM +.B SIGHUP +to all jobs, running or stopped. +Stopped jobs are sent +.SM +.B SIGCONT +to ensure that they receive the +.SM +.BR SIGHUP . +To prevent the shell from +sending the signal to a particular job, it should be removed from the +jobs table with the +.B disown +builtin (see +.SM +.B "SHELL BUILTIN COMMANDS" +below) or marked +to not receive +.SM +.B SIGHUP +using +.BR "disown \-h" . +.PP +If the +.B huponexit +shell option has been set with +.BR shopt , +.B bash +sends a +.SM +.B SIGHUP +to all jobs when an interactive login shell exits. +.PP +If \fBbash\fP is waiting for a command to complete and receives a signal +for which a trap has been set, the trap will not be executed until +the command completes. +When \fBbash\fP is waiting for an asynchronous command via the \fBwait\fP +builtin, the reception of a signal for which a trap has been set will +cause the \fBwait\fP builtin to return immediately with an exit status +greater than 128, immediately after which the trap is executed. +.SH "JOB CONTROL" +.I Job control +refers to the ability to selectively stop (\fIsuspend\fP) +the execution of processes and continue (\fIresume\fP) +their execution at a later point. A user typically employs +this facility via an interactive interface supplied jointly +by the operating system kernel's terminal driver and +.BR bash . +.PP +The shell associates a +.I job +with each pipeline. It keeps a table of currently executing +jobs, which may be listed with the +.B jobs +command. When +.B bash +starts a job asynchronously (in the +.IR background ), +it prints a line that looks like: +.RS +.PP +[1] 25647 +.RE +.PP +indicating that this job is job number 1 and that the process ID +of the last process in the pipeline associated with this job is 25647. +All of the processes in a single pipeline are members of the same job. +.B Bash +uses the +.I job +abstraction as the basis for job control. +.PP +To facilitate the implementation of the user interface to job +control, the operating system maintains the notion of a \fIcurrent terminal +process group ID\fP. Members of this process group (processes whose +process group ID is equal to the current terminal process group ID) +receive keyboard-generated signals such as +.SM +.BR SIGINT . +These processes are said to be in the +.IR foreground . +.I Background +processes are those whose process group ID differs from the terminal's; +such processes are immune to keyboard-generated signals. +Only foreground processes are allowed to read from or, if the +user so specifies with \f(CWstty tostop\fP, write to the +terminal. +Background processes which attempt to read from (write to when +\f(CWstty tostop\fP is in effect) the +terminal are sent a +.SM +.B SIGTTIN (SIGTTOU) +signal by the kernel's terminal driver, +which, unless caught, suspends the process. +.PP +If the operating system on which +.B bash +is running supports +job control, +.B bash +contains facilities to use it. +Typing the +.I suspend +character (typically +.BR ^Z , +Control-Z) while a process is running +causes that process to be stopped and returns control to +.BR bash . +Typing the +.I "delayed suspend" +character (typically +.BR ^Y , +Control-Y) causes the process to be stopped when it +attempts to read input from the terminal, and control to +be returned to +.BR bash . +The user may then manipulate the state of this job, using the +.B bg +command to continue it in the background, the +.B fg +command to continue it in the foreground, or +the +.B kill +command to kill it. A \fB^Z\fP takes effect immediately, +and has the additional side effect of causing pending output +and typeahead to be discarded. +.PP +There are a number of ways to refer to a job in the shell. +The character +.B % +introduces a job specification (\fIjobspec\fP). Job number +.I n +may be referred to as +.BR %n . +A job may also be referred to using a prefix of the name used to +start it, or using a substring that appears in its command line. +For example, +.B %ce +refers to a stopped +.B ce +job. If a prefix matches more than one job, +.B bash +reports an error. Using +.BR %?ce , +on the other hand, refers to any job containing the string +.B ce +in its command line. If the substring matches more than one job, +.B bash +reports an error. The symbols +.B %% +and +.B %+ +refer to the shell's notion of the +.IR "current job" , +which is the last job stopped while it was in +the foreground or started in the background. +The +.I "previous job" +may be referenced using +.BR %\- . +If there is only a single job, \fB%+\fP and \fB%\-\fP can both be used +to refer to that job. +In output pertaining to jobs (e.g., the output of the +.B jobs +command), the current job is always flagged with a +.BR + , +and the previous job with a +.BR \- . +A single % (with no accompanying job specification) also refers to the +current job. +.PP +Simply naming a job can be used to bring it into the +foreground: +.B %1 +is a synonym for +\fB``fg %1''\fP, +bringing job 1 from the background into the foreground. +Similarly, +.B ``%1 &'' +resumes job 1 in the background, equivalent to +\fB``bg %1''\fP. +.PP +The shell learns immediately whenever a job changes state. +Normally, +.B bash +waits until it is about to print a prompt before reporting +changes in a job's status so as to not interrupt +any other output. If the +.B \-b +option to the +.B set +builtin command +is enabled, +.B bash +reports such changes immediately. +Any trap on +.SM +.B SIGCHLD +is executed for each child that exits. +.PP +If an attempt to exit +.B bash +is made while jobs are stopped (or, if the \fBcheckjobs\fP shell option has +been enabled using the \fBshopt\fP builtin, running), the shell prints a +warning message, and, if the \fBcheckjobs\fP option is enabled, lists the +jobs and their statuses. +The +.B jobs +command may then be used to inspect their status. +If a second attempt to exit is made without an intervening command, +the shell does not print another warning, and any stopped +jobs are terminated. +.SH PROMPTING +When executing interactively, +.B bash +displays the primary prompt +.SM +.B PS1 +when it is ready to read a command, and the secondary prompt +.SM +.B PS2 +when it needs more input to complete a command. +.B Bash +allows these prompt strings to be customized by inserting a number of +backslash-escaped special characters that are decoded as follows: +.RS +.PD 0 +.TP +.B \ea +an ASCII bell character (07) +.TP +.B \ed +the date in "Weekday Month Date" format (e.g., "Tue May 26") +.TP +.B \eD{\fIformat\fP} +the \fIformat\fP is passed to \fIstrftime\fP(3) and the result is inserted +into the prompt string; an empty \fIformat\fP results in a locale-specific +time representation. The braces are required +.TP +.B \ee +an ASCII escape character (033) +.TP +.B \eh +the hostname up to the first `.' +.TP +.B \eH +the hostname +.TP +.B \ej +the number of jobs currently managed by the shell +.TP +.B \el +the basename of the shell's terminal device name +.TP +.B \en +newline +.TP +.B \er +carriage return +.TP +.B \es +the name of the shell, the basename of +.B $0 +(the portion following the final slash) +.TP +.B \et +the current time in 24-hour HH:MM:SS format +.TP +.B \eT +the current time in 12-hour HH:MM:SS format +.TP +.B \e@ +the current time in 12-hour am/pm format +.TP +.B \eA +the current time in 24-hour HH:MM format +.TP +.B \eu +the username of the current user +.TP +.B \ev +the version of \fBbash\fP (e.g., 2.00) +.TP +.B \eV +the release of \fBbash\fP, version + patch level (e.g., 2.00.0) +.TP +.B \ew +the current working directory, with +.SM +.B $HOME +abbreviated with a tilde +(uses the value of the +.SM +.B PROMPT_DIRTRIM +variable) +.TP +.B \eW +the basename of the current working directory, with +.SM +.B $HOME +abbreviated with a tilde +.TP +.B \e! +the history number of this command +.TP +.B \e# +the command number of this command +.TP +.B \e$ +if the effective UID is 0, a +.BR # , +otherwise a +.B $ +.TP +.B \e\fInnn\fP +the character corresponding to the octal number \fInnn\fP +.TP +.B \e\e +a backslash +.TP +.B \e[ +begin a sequence of non-printing characters, which could be used to +embed a terminal control sequence into the prompt +.TP +.B \e] +end a sequence of non-printing characters +.PD +.RE +.PP +The command number and the history number are usually different: +the history number of a command is its position in the history +list, which may include commands restored from the history file +(see +.SM +.B HISTORY +below), while the command number is the position in the sequence +of commands executed during the current shell session. +After the string is decoded, it is expanded via +parameter expansion, command substitution, arithmetic +expansion, and quote removal, subject to the value of the +.B promptvars +shell option (see the description of the +.B shopt +command under +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.SH READLINE +This is the library that handles reading input when using an interactive +shell, unless the +.B \-\-noediting +option is given at shell invocation. +Line editing is also used when using the \fB\-e\fP option to the +\fBread\fP builtin. +By default, the line editing commands are similar to those of Emacs. +A vi-style line editing interface is also available. +Line editing can be enabled at any time using the +.B \-o emacs +or +.B \-o vi +options to the +.B set +builtin (see +.SM +.B SHELL BUILTIN COMMANDS +below). +To turn off line editing after the shell is running, use the +.B +o emacs +or +.B +o vi +options to the +.B set +builtin. +.SS "Readline Notation" +.PP +In this section, the Emacs-style notation is used to denote +keystrokes. Control keys are denoted by C\-\fIkey\fR, e.g., C\-n +means Control\-N. Similarly, +.I meta +keys are denoted by M\-\fIkey\fR, so M\-x means Meta\-X. (On keyboards +without a +.I meta +key, M\-\fIx\fP means ESC \fIx\fP, i.e., press the Escape key +then the +.I x +key. This makes ESC the \fImeta prefix\fP. +The combination M\-C\-\fIx\fP means ESC\-Control\-\fIx\fP, +or press the Escape key +then hold the Control key while pressing the +.I x +key.) +.PP +Readline commands may be given numeric +.IR arguments , +which normally act as a repeat count. +Sometimes, however, it is the sign of the argument that is significant. +Passing a negative argument to a command that acts in the forward +direction (e.g., \fBkill\-line\fP) causes that command to act in a +backward direction. +Commands whose behavior with arguments deviates from this are noted +below. +.PP +When a command is described as \fIkilling\fP text, the text +deleted is saved for possible future retrieval +(\fIyanking\fP). The killed text is saved in a +\fIkill ring\fP. Consecutive kills cause the text to be +accumulated into one unit, which can be yanked all at once. +Commands which do not kill text separate the chunks of text +on the kill ring. +.SS "Readline Initialization" +.PP +Readline is customized by putting commands in an initialization +file (the \fIinputrc\fP file). +The name of this file is taken from the value of the +.SM +.B INPUTRC +variable. If that variable is unset, the default is +.IR ~/.inputrc . +When a program which uses the readline library starts up, the +initialization file is read, and the key bindings and variables +are set. +There are only a few basic constructs allowed in the +readline initialization file. +Blank lines are ignored. +Lines beginning with a \fB#\fP are comments. +Lines beginning with a \fB$\fP indicate conditional constructs. +Other lines denote key bindings and variable settings. +.PP +The default key-bindings may be changed with an +.I inputrc +file. +Other programs that use this library may add their own commands +and bindings. +.PP +For example, placing +.RS +.PP +M\-Control\-u: universal\-argument +.RE +or +.RS +C\-Meta\-u: universal\-argument +.RE +into the +.I inputrc +would make M\-C\-u execute the readline command +.IR universal\-argument . +.PP +The following symbolic character names are recognized: +.IR RUBOUT , +.IR DEL , +.IR ESC , +.IR LFD , +.IR NEWLINE , +.IR RET , +.IR RETURN , +.IR SPC , +.IR SPACE , +and +.IR TAB . +.PP +In addition to command names, readline allows keys to be bound +to a string that is inserted when the key is pressed (a \fImacro\fP). +.SS "Readline Key Bindings" +.PP +The syntax for controlling key bindings in the +.I inputrc +file is simple. All that is required is the name of the +command or the text of a macro and a key sequence to which +it should be bound. The name may be specified in one of two ways: +as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP +prefixes, or as a key sequence. +.PP +When using the form \fBkeyname\fP:\^\fIfunction\-name\fP or \fImacro\fP, +.I keyname +is the name of a key spelled out in English. For example: +.sp +.RS +Control-u: universal\-argument +.br +Meta-Rubout: backward-kill-word +.br +Control-o: "> output" +.RE +.LP +In the above example, +.I C\-u +is bound to the function +.BR universal\-argument , +.I M\-DEL +is bound to the function +.BR backward\-kill\-word , +and +.I C\-o +is bound to run the macro +expressed on the right hand side (that is, to insert the text +.if t \f(CW> output\fP +.if n ``> output'' +into the line). +.PP +In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP, +.B keyseq +differs from +.B keyname +above in that strings denoting +an entire key sequence may be specified by placing the sequence +within double quotes. Some GNU Emacs style key escapes can be +used, as in the following example, but the symbolic character names +are not recognized. +.sp +.RS +"\eC\-u": universal\-argument +.br +"\eC\-x\eC\-r": re\-read\-init\-file +.br +"\ee[11~": "Function Key 1" +.RE +.PP +In this example, +.I C\-u +is again bound to the function +.BR universal\-argument . +.I "C\-x C\-r" +is bound to the function +.BR re\-read\-init\-file , +and +.I "ESC [ 1 1 ~" +is bound to insert the text +.if t \f(CWFunction Key 1\fP. +.if n ``Function Key 1''. +.PP +The full set of GNU Emacs style escape sequences is +.RS +.PD 0 +.TP +.B \eC\- +control prefix +.TP +.B \eM\- +meta prefix +.TP +.B \ee +an escape character +.TP +.B \e\e +backslash +.TP +.B \e" +literal " +.TP +.B \e\(aq +literal \(aq +.RE +.PD +.PP +In addition to the GNU Emacs style escape sequences, a second +set of backslash escapes is available: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ed +delete +.TP +.B \ef +form feed +.TP +.B \en +newline +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(one to three digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.RE +.PD +.PP +When entering the text of a macro, single or double quotes must +be used to indicate a macro definition. +Unquoted text is assumed to be a function name. +In the macro body, the backslash escapes described above are expanded. +Backslash will quote any other character in the macro text, +including " and \(aq. +.PP +.B Bash +allows the current readline key bindings to be displayed or modified +with the +.B bind +builtin command. The editing mode may be switched during interactive +use by using the +.B \-o +option to the +.B set +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SS "Readline Variables" +.PP +Readline has variables that can be used to further customize its +behavior. A variable may be set in the +.I inputrc +file with a statement of the form +.RS +.PP +\fBset\fP \fIvariable\-name\fP \fIvalue\fP +.RE +.PP +Except where noted, readline variables can take the values +.B On +or +.B Off +(without regard to case). +Unrecognized variable names are ignored. +When a variable value is read, empty or null values, "on" (case-insensitive), +and "1" are equivalent to \fBOn\fP. All other values are equivalent to +\fBOff\fP. +The variables and their default values are: +.PP +.PD 0 +.TP +.B bell\-style (audible) +Controls what happens when readline wants to ring the terminal bell. +If set to \fBnone\fP, readline never rings the bell. If set to +\fBvisible\fP, readline uses a visible bell if one is available. +If set to \fBaudible\fP, readline attempts to ring the terminal's bell. +.TP +.B bind\-tty\-special\-chars (On) +If set to \fBOn\fP, readline attempts to bind the control characters +treated specially by the kernel's terminal driver to their readline +equivalents. +.TP +.B colored\-stats (Off) +If set to \fBOn\fP, readline displays possible completions using different +colors to indicate their file type. +The color definitions are taken from the value of the \fBLS_COLORS\fP +environment variable. +.TP +.B comment\-begin (``#'') +The string that is inserted when the readline +.B insert\-comment +command is executed. +This command is bound to +.B M\-# +in emacs mode and to +.B # +in vi command mode. +.TP +.B completion\-ignore\-case (Off) +If set to \fBOn\fP, readline performs filename matching and completion +in a case\-insensitive fashion. +.TP +.B completion\-prefix\-display\-length (0) +The length in characters of the common prefix of a list of possible +completions that is displayed without modification. When set to a +value greater than zero, common prefixes longer than this value are +replaced with an ellipsis when displaying possible completions. +.TP +.B completion\-query\-items (100) +This determines when the user is queried about viewing +the number of possible completions +generated by the \fBpossible\-completions\fP command. +It may be set to any integer value greater than or equal to +zero. If the number of possible completions is greater than +or equal to the value of this variable, the user is asked whether +or not he wishes to view them; otherwise they are simply listed +on the terminal. +.TP +.B convert\-meta (On) +If set to \fBOn\fP, readline will convert characters with the +eighth bit set to an ASCII key sequence +by stripping the eighth bit and prefixing an +escape character (in effect, using escape as the \fImeta prefix\fP). +.TP +.B disable\-completion (Off) +If set to \fBOn\fP, readline will inhibit word completion. Completion +characters will be inserted into the line as if they had been +mapped to \fBself-insert\fP. +.TP +.B editing\-mode (emacs) +Controls whether readline begins with a set of key bindings similar +to \fIEmacs\fP or \fIvi\fP. +.B editing\-mode +can be set to either +.B emacs +or +.BR vi . +.TP +.B echo\-control\-characters (On) +When set to \fBOn\fP, on operating systems that indicate they support it, +readline echoes a character corresponding to a signal generated from the +keyboard. +.TP +.B enable\-keypad (Off) +When set to \fBOn\fP, readline will try to enable the application +keypad when it is called. Some systems need this to enable the +arrow keys. +.TP +.B enable\-meta\-key (On) +When set to \fBOn\fP, readline will try to enable any meta modifier +key the terminal claims to support when it is called. On many terminals, +the meta key is used to send eight-bit characters. +.TP +.B expand\-tilde (Off) +If set to \fBOn\fP, tilde expansion is performed when readline +attempts word completion. +.TP +.B history\-preserve\-point (Off) +If set to \fBOn\fP, the history code attempts to place point at the +same location on each history line retrieved with \fBprevious-history\fP +or \fBnext-history\fP. +.TP +.B history\-size (0) +Set the maximum number of history entries saved in the history list. +If set to zero, any existing history entries are deleted and no new entries +are saved. +If set to a value less than zero, the number of history entries is not +limited. +By default, the number of history entries is not limited. +.TP +.B horizontal\-scroll\-mode (Off) +When set to \fBOn\fP, makes readline use a single line for display, +scrolling the input horizontally on a single screen line when it +becomes longer than the screen width rather than wrapping to a new line. +.TP +.B input\-meta (Off) +If set to \fBOn\fP, readline will enable eight-bit input (that is, +it will not strip the high bit from the characters it reads), +regardless of what the terminal claims it can support. The name +.B meta\-flag +is a synonym for this variable. +.TP +.B isearch\-terminators (``C\-[C\-J'') +The string of characters that should terminate an incremental +search without subsequently executing the character as a command. +If this variable has not been given a value, the characters +\fIESC\fP and \fIC\-J\fP will terminate an incremental search. +.TP +.B keymap (emacs) +Set the current readline keymap. The set of valid keymap names is +\fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi, +vi\-command\fP, and +.IR vi\-insert . +\fIvi\fP is equivalent to \fIvi\-command\fP; \fIemacs\fP is +equivalent to \fIemacs\-standard\fP. The default value is +.IR emacs ; +the value of +.B editing\-mode +also affects the default keymap. +.TP +.B keyseq\-timeout (500) +Specifies the duration \fIreadline\fP will wait for a character when reading an +ambiguous key sequence (one that can form a complete key sequence using +the input read so far, or can take additional input to complete a longer +key sequence). +If no input is received within the timeout, \fIreadline\fP will use the shorter +but complete key sequence. +The value is specified in milliseconds, so a value of 1000 means that +\fIreadline\fP will wait one second for additional input. +If this variable is set to a value less than or equal to zero, or to a +non-numeric value, \fIreadline\fP will wait until another key is pressed to +decide which key sequence to complete. +.TP +.B mark\-directories (On) +If set to \fBOn\fP, completed directory names have a slash +appended. +.TP +.B mark\-modified\-lines (Off) +If set to \fBOn\fP, history lines that have been modified are displayed +with a preceding asterisk (\fB*\fP). +.TP +.B mark\-symlinked\-directories (Off) +If set to \fBOn\fP, completed names which are symbolic links to directories +have a slash appended (subject to the value of +\fBmark\-directories\fP). +.TP +.B match\-hidden\-files (On) +This variable, when set to \fBOn\fP, causes readline to match files whose +names begin with a `.' (hidden files) when performing filename +completion. +If set to \fBOff\fP, the leading `.' must be +supplied by the user in the filename to be completed. +.TP +.B menu\-complete\-display\-prefix (Off) +If set to \fBOn\fP, menu completion displays the common prefix of the +list of possible completions (which may be empty) before cycling through +the list. +.TP +.B output\-meta (Off) +If set to \fBOn\fP, readline will display characters with the +eighth bit set directly rather than as a meta-prefixed escape +sequence. +.TP +.B page\-completions (On) +If set to \fBOn\fP, readline uses an internal \fImore\fP-like pager +to display a screenful of possible completions at a time. +.TP +.B print\-completions\-horizontally (Off) +If set to \fBOn\fP, readline will display completions with matches +sorted horizontally in alphabetical order, rather than down the screen. +.TP +.B revert\-all\-at\-newline (Off) +If set to \fBOn\fP, readline will undo all changes to history lines +before returning when \fBaccept\-line\fP is executed. By default, +history lines may be modified and retain individual undo lists across +calls to \fBreadline\fP. +.TP +.B show\-all\-if\-ambiguous (Off) +This alters the default behavior of the completion functions. If +set to +.BR On , +words which have more than one possible completion cause the +matches to be listed immediately instead of ringing the bell. +.TP +.B show\-all\-if\-unmodified (Off) +This alters the default behavior of the completion functions in +a fashion similar to \fBshow\-all\-if\-ambiguous\fP. +If set to +.BR On , +words which have more than one possible completion without any +possible partial completion (the possible completions don't share +a common prefix) cause the matches to be listed immediately instead +of ringing the bell. +.TP +.B show\-mode\-in\-prompt (Off) +If set to \fBOn\fP, add a character to the beginning of the prompt +indicating the editing mode: emacs (@), vi command (:) or vi +insertion (+). +.TP +.B skip\-completed\-text (Off) +If set to \fBOn\fP, this alters the default completion behavior when +inserting a single match into the line. It's only active when +performing completion in the middle of a word. If enabled, readline +does not insert characters from the completion that match characters +after point in the word being completed, so portions of the word +following the cursor are not duplicated. +.TP +.B visible\-stats (Off) +If set to \fBOn\fP, a character denoting a file's type as reported +by \fIstat\fP(2) is appended to the filename when listing possible +completions. +.PD +.SS "Readline Conditional Constructs" +.PP +Readline implements a facility similar in spirit to the conditional +compilation features of the C preprocessor which allows key +bindings and variable settings to be performed as the result +of tests. There are four parser directives used. +.IP \fB$if\fP +The +.B $if +construct allows bindings to be made based on the +editing mode, the terminal being used, or the application using +readline. The text of the test extends to the end of the line; +no characters are required to isolate it. +.RS +.IP \fBmode\fP +The \fBmode=\fP form of the \fB$if\fP directive is used to test +whether readline is in emacs or vi mode. +This may be used in conjunction +with the \fBset keymap\fP command, for instance, to set bindings in +the \fIemacs\-standard\fP and \fIemacs\-ctlx\fP keymaps only if +readline is starting out in emacs mode. +.IP \fBterm\fP +The \fBterm=\fP form may be used to include terminal-specific +key bindings, perhaps to bind the key sequences output by the +terminal's function keys. The word on the right side of the +.B = +is tested against the both full name of the terminal and the portion +of the terminal name before the first \fB\-\fP. This allows +.I sun +to match both +.I sun +and +.IR sun\-cmd , +for instance. +.IP \fBapplication\fP +The \fBapplication\fP construct is used to include +application-specific settings. Each program using the readline +library sets the \fIapplication name\fP, and an initialization +file can test for a particular value. +This could be used to bind key sequences to functions useful for +a specific program. For instance, the following command adds a +key sequence that quotes the current or previous word in \fBbash\fP: +.sp 1 +.RS +.nf +\fB$if\fP Bash +# Quote the current or previous word +"\eC\-xq": "\eeb\e"\eef\e"" +\fB$endif\fP +.fi +.RE +.RE +.IP \fB$endif\fP +This command, as seen in the previous example, terminates an +\fB$if\fP command. +.IP \fB$else\fP +Commands in this branch of the \fB$if\fP directive are executed if +the test fails. +.IP \fB$include\fP +This directive takes a single filename as an argument and reads commands +and bindings from that file. For example, the following directive +would read \fI/etc/inputrc\fP: +.sp 1 +.RS +.nf +\fB$include\fP \^ \fI/etc/inputrc\fP +.fi +.RE +.SS Searching +.PP +Readline provides commands for searching through the command history +(see +.SM +.B HISTORY +below) for lines containing a specified string. +There are two search modes: +.I incremental +and +.IR non-incremental . +.PP +Incremental searches begin before the user has finished typing the +search string. +As each character of the search string is typed, readline displays +the next entry from the history matching the string typed so far. +An incremental search requires only as many characters as needed to +find the desired history entry. +The characters present in the value of the \fBisearch-terminators\fP +variable are used to terminate an incremental search. +If that variable has not been assigned a value the Escape and +Control-J characters will terminate an incremental search. +Control-G will abort an incremental search and restore the original +line. +When the search is terminated, the history entry containing the +search string becomes the current line. +.PP +To find other matching entries in the history list, type Control-S or +Control-R as appropriate. +This will search backward or forward in the history for the next +entry matching the search string typed so far. +Any other key sequence bound to a readline command will terminate +the search and execute that command. +For instance, a \fInewline\fP will terminate the search and accept +the line, thereby executing the command from the history list. +.PP +Readline remembers the last incremental search string. If two +Control-Rs are typed without any intervening characters defining a +new search string, any remembered search string is used. +.PP +Non-incremental searches read the entire search string before starting +to search for matching history lines. The search string may be +typed by the user or be part of the contents of the current line. +.SS "Readline Command Names" +.PP +The following is a list of the names of the commands and the default +key sequences to which they are bound. +Command names without an accompanying key sequence are unbound by default. +In the following descriptions, \fIpoint\fP refers to the current cursor +position, and \fImark\fP refers to a cursor position saved by the +\fBset\-mark\fP command. +The text between the point and mark is referred to as the \fIregion\fP. +.SS Commands for Moving +.PP +.PD 0 +.TP +.B beginning\-of\-line (C\-a) +Move to the start of the current line. +.TP +.B end\-of\-line (C\-e) +Move to the end of the line. +.TP +.B forward\-char (C\-f) +Move forward a character. +.TP +.B backward\-char (C\-b) +Move back a character. +.TP +.B forward\-word (M\-f) +Move forward to the end of the next word. Words are composed of +alphanumeric characters (letters and digits). +.TP +.B backward\-word (M\-b) +Move back to the start of the current or previous word. +Words are composed of alphanumeric characters (letters and digits). +.TP +.B shell\-forward\-word +Move forward to the end of the next word. +Words are delimited by non-quoted shell metacharacters. +.TP +.B shell\-backward\-word +Move back to the start of the current or previous word. +Words are delimited by non-quoted shell metacharacters. +.TP +.B clear\-screen (C\-l) +Clear the screen leaving the current line at the top of the screen. +With an argument, refresh the current line without clearing the +screen. +.TP +.B redraw\-current\-line +Refresh the current line. +.PD +.SS Commands for Manipulating the History +.PP +.PD 0 +.TP +.B accept\-line (Newline, Return) +Accept the line regardless of where the cursor is. If this line is +non-empty, add it to the history list according to the state of the +.SM +.B HISTCONTROL +variable. If the line is a modified history +line, then restore the history line to its original state. +.TP +.B previous\-history (C\-p) +Fetch the previous command from the history list, moving back in +the list. +.TP +.B next\-history (C\-n) +Fetch the next command from the history list, moving forward in the +list. +.TP +.B beginning\-of\-history (M\-<) +Move to the first line in the history. +.TP +.B end\-of\-history (M\->) +Move to the end of the input history, i.e., the line currently being +entered. +.TP +.B reverse\-search\-history (C\-r) +Search backward starting at the current line and moving `up' through +the history as necessary. This is an incremental search. +.TP +.B forward\-search\-history (C\-s) +Search forward starting at the current line and moving `down' through +the history as necessary. This is an incremental search. +.TP +.B non\-incremental\-reverse\-search\-history (M\-p) +Search backward through the history starting at the current line +using a non-incremental search for a string supplied by the user. +.TP +.B non\-incremental\-forward\-search\-history (M\-n) +Search forward through the history using a non-incremental search for +a string supplied by the user. +.TP +.B history\-search\-forward +Search forward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +.TP +.B history\-search\-backward +Search backward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +.TP +.B yank\-nth\-arg (M\-C\-y) +Insert the first argument to the previous command (usually +the second word on the previous line) at point. +With an argument +.IR n , +insert the \fIn\fPth word from the previous command (the words +in the previous command begin with word 0). A negative argument +inserts the \fIn\fPth word from the end of the previous command. +Once the argument \fIn\fP is computed, the argument is extracted +as if the "!\fIn\fP" history expansion had been specified. +.TP +.B +yank\-last\-arg (M\-.\^, M\-_\^) +Insert the last argument to the previous command (the last word of +the previous history entry). +With a numeric argument, behave exactly like \fByank\-nth\-arg\fP. +Successive calls to \fByank\-last\-arg\fP move back through the history +list, inserting the last word (or the word specified by the argument to +the first call) of each line in turn. +Any numeric argument supplied to these successive calls determines +the direction to move through the history. A negative argument switches +the direction through the history (back or forward). +The history expansion facilities are used to extract the last word, +as if the "!$" history expansion had been specified. +.TP +.B shell\-expand\-line (M\-C\-e) +Expand the line as the shell does. This +performs alias and history expansion as well as all of the shell +word expansions. See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B history\-expand\-line (M\-^) +Perform history expansion on the current line. +See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B magic\-space +Perform history expansion on the current line and insert a space. +See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B alias\-expand\-line +Perform alias expansion on the current line. +See +.SM +.B ALIASES +above for a description of alias expansion. +.TP +.B history\-and\-alias\-expand\-line +Perform history and alias expansion on the current line. +.TP +.B insert\-last\-argument (M\-.\^, M\-_\^) +A synonym for \fByank\-last\-arg\fP. +.TP +.B operate\-and\-get\-next (C\-o) +Accept the current line for execution and fetch the next line +relative to the current line from the history for editing. Any +argument is ignored. +.TP +.B edit\-and\-execute\-command (C\-xC\-e) +Invoke an editor on the current command line, and execute the result as shell +commands. +\fBBash\fP attempts to invoke +.SM +.BR $VISUAL , +.SM +.BR $EDITOR , +and \fIemacs\fP as the editor, in that order. +.PD +.SS Commands for Changing Text +.PP +.PD 0 +.TP +.B \fIend\-of\-file\fP (usually C\-d) +The character indicating end-of-file as set, for example, by +.if t \f(CWstty\fP. +.if n ``stty''. +If this character is read when there are no characters +on the line, and point is at the beginning of the line, Readline +interprets it as the end of input and returns +.SM +.BR EOF . +.TP +.B delete\-char (C\-d) +Delete the character at point. +If this function is bound to the +same character as the tty \fBEOF\fP character, as \fBC\-d\fP +commonly is, see above for the effects. +.TP +.B backward\-delete\-char (Rubout) +Delete the character behind the cursor. When given a numeric argument, +save the deleted text on the kill ring. +.TP +.B forward\-backward\-delete\-char +Delete the character under the cursor, unless the cursor is at the +end of the line, in which case the character behind the cursor is +deleted. +.TP +.B quoted\-insert (C\-q, C\-v) +Add the next character typed to the line verbatim. This is +how to insert characters like \fBC\-q\fP, for example. +.TP +.B tab\-insert (C\-v TAB) +Insert a tab character. +.TP +.B self\-insert (a,\ b,\ A,\ 1,\ !,\ ...) +Insert the character typed. +.TP +.B transpose\-chars (C\-t) +Drag the character before point forward over the character at point, +moving point forward as well. +If point is at the end of the line, then this transposes +the two characters before point. +Negative arguments have no effect. +.TP +.B transpose\-words (M\-t) +Drag the word before point past the word after point, +moving point over that word as well. +If point is at the end of the line, this transposes +the last two words on the line. +.TP +.B upcase\-word (M\-u) +Uppercase the current (or following) word. With a negative argument, +uppercase the previous word, but do not move point. +.TP +.B downcase\-word (M\-l) +Lowercase the current (or following) word. With a negative argument, +lowercase the previous word, but do not move point. +.TP +.B capitalize\-word (M\-c) +Capitalize the current (or following) word. With a negative argument, +capitalize the previous word, but do not move point. +.TP +.B overwrite\-mode +Toggle overwrite mode. With an explicit positive numeric argument, +switches to overwrite mode. With an explicit non-positive numeric +argument, switches to insert mode. This command affects only +\fBemacs\fP mode; \fBvi\fP mode does overwrite differently. +Each call to \fIreadline()\fP starts in insert mode. +In overwrite mode, characters bound to \fBself\-insert\fP replace +the text at point rather than pushing the text to the right. +Characters bound to \fBbackward\-delete\-char\fP replace the character +before point with a space. By default, this command is unbound. +.PD +.SS Killing and Yanking +.PP +.PD 0 +.TP +.B kill\-line (C\-k) +Kill the text from point to the end of the line. +.TP +.B backward\-kill\-line (C\-x Rubout) +Kill backward to the beginning of the line. +.TP +.B unix\-line\-discard (C\-u) +Kill backward from point to the beginning of the line. +The killed text is saved on the kill-ring. +.\" There is no real difference between this and backward-kill-line +.TP +.B kill\-whole\-line +Kill all characters on the current line, no matter where point is. +.TP +.B kill\-word (M\-d) +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as those used by \fBforward\-word\fP. +.TP +.B backward\-kill\-word (M\-Rubout) +Kill the word behind point. +Word boundaries are the same as those used by \fBbackward\-word\fP. +.TP +.B shell\-kill\-word (M\-d) +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as those used by \fBshell\-forward\-word\fP. +.TP +.B shell\-backward\-kill\-word (M\-Rubout) +Kill the word behind point. +Word boundaries are the same as those used by \fBshell\-backward\-word\fP. +.TP +.B unix\-word\-rubout (C\-w) +Kill the word behind point, using white space as a word boundary. +The killed text is saved on the kill-ring. +.TP +.B unix\-filename\-rubout +Kill the word behind point, using white space and the slash character +as the word boundaries. +The killed text is saved on the kill-ring. +.TP +.B delete\-horizontal\-space (M\-\e) +Delete all spaces and tabs around point. +.TP +.B kill\-region +Kill the text in the current region. +.TP +.B copy\-region\-as\-kill +Copy the text in the region to the kill buffer. +.TP +.B copy\-backward\-word +Copy the word before point to the kill buffer. +The word boundaries are the same as \fBbackward\-word\fP. +.TP +.B copy\-forward\-word +Copy the word following point to the kill buffer. +The word boundaries are the same as \fBforward\-word\fP. +.TP +.B yank (C\-y) +Yank the top of the kill ring into the buffer at point. +.TP +.B yank\-pop (M\-y) +Rotate the kill ring, and yank the new top. Only works following +.B yank +or +.BR yank\-pop . +.PD +.SS Numeric Arguments +.PP +.PD 0 +.TP +.B digit\-argument (M\-0, M\-1, ..., M\-\-) +Add this digit to the argument already accumulating, or start a new +argument. M\-\- starts a negative argument. +.TP +.B universal\-argument +This is another way to specify an argument. +If this command is followed by one or more digits, optionally with a +leading minus sign, those digits define the argument. +If the command is followed by digits, executing +.B universal\-argument +again ends the numeric argument, but is otherwise ignored. +As a special case, if this command is immediately followed by a +character that is neither a digit or minus sign, the argument count +for the next command is multiplied by four. +The argument count is initially one, so executing this function the +first time makes the argument count four, a second time makes the +argument count sixteen, and so on. +.PD +.SS Completing +.PP +.PD 0 +.TP +.B complete (TAB) +Attempt to perform completion on the text before point. +.B Bash +attempts completion treating the text as a variable (if the +text begins with \fB$\fP), username (if the text begins with +\fB~\fP), hostname (if the text begins with \fB@\fP), or +command (including aliases and functions) in turn. If none +of these produces a match, filename completion is attempted. +.TP +.B possible\-completions (M\-?) +List the possible completions of the text before point. +.TP +.B insert\-completions (M\-*) +Insert all completions of the text before point +that would have been generated by +\fBpossible\-completions\fP. +.TP +.B menu\-complete +Similar to \fBcomplete\fP, but replaces the word to be completed +with a single match from the list of possible completions. +Repeated execution of \fBmenu\-complete\fP steps through the list +of possible completions, inserting each match in turn. +At the end of the list of completions, the bell is rung +(subject to the setting of \fBbell\-style\fP) +and the original text is restored. +An argument of \fIn\fP moves \fIn\fP positions forward in the list +of matches; a negative argument may be used to move backward +through the list. +This command is intended to be bound to \fBTAB\fP, but is unbound +by default. +.TP +.B menu\-complete\-backward +Identical to \fBmenu\-complete\fP, but moves backward through the list +of possible completions, as if \fBmenu\-complete\fP had been given a +negative argument. This command is unbound by default. +.TP +.B delete\-char\-or\-list +Deletes the character under the cursor if not at the beginning or +end of the line (like \fBdelete\-char\fP). +If at the end of the line, behaves identically to +\fBpossible\-completions\fP. +This command is unbound by default. +.TP +.B complete\-filename (M\-/) +Attempt filename completion on the text before point. +.TP +.B possible\-filename\-completions (C\-x /) +List the possible completions of the text before point, +treating it as a filename. +.TP +.B complete\-username (M\-~) +Attempt completion on the text before point, treating +it as a username. +.TP +.B possible\-username\-completions (C\-x ~) +List the possible completions of the text before point, +treating it as a username. +.TP +.B complete\-variable (M\-$) +Attempt completion on the text before point, treating +it as a shell variable. +.TP +.B possible\-variable\-completions (C\-x $) +List the possible completions of the text before point, +treating it as a shell variable. +.TP +.B complete\-hostname (M\-@) +Attempt completion on the text before point, treating +it as a hostname. +.TP +.B possible\-hostname\-completions (C\-x @) +List the possible completions of the text before point, +treating it as a hostname. +.TP +.B complete\-command (M\-!) +Attempt completion on the text before point, treating +it as a command name. Command completion attempts to +match the text against aliases, reserved words, shell +functions, shell builtins, and finally executable filenames, +in that order. +.TP +.B possible\-command\-completions (C\-x !) +List the possible completions of the text before point, +treating it as a command name. +.TP +.B dynamic\-complete\-history (M\-TAB) +Attempt completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +.TP +.B dabbrev\-expand +Attempt menu completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +.TP +.B complete\-into\-braces (M\-{) +Perform filename completion and insert the list of possible completions +enclosed within braces so the list is available to the shell (see +.B Brace Expansion +above). +.PD +.SS Keyboard Macros +.PP +.PD 0 +.TP +.B start\-kbd\-macro (C\-x (\^) +Begin saving the characters typed into the current keyboard macro. +.TP +.B end\-kbd\-macro (C\-x )\^) +Stop saving the characters typed into the current keyboard macro +and store the definition. +.TP +.B call\-last\-kbd\-macro (C\-x e) +Re-execute the last keyboard macro defined, by making the characters +in the macro appear as if typed at the keyboard. +.TP +.B print\-last\-kbd\-macro () +Print the last keyboard macro defined in a format suitable for the +\fIinputrc\fP file. +.PD +.SS Miscellaneous +.PP +.PD 0 +.TP +.B re\-read\-init\-file (C\-x C\-r) +Read in the contents of the \fIinputrc\fP file, and incorporate +any bindings or variable assignments found there. +.TP +.B abort (C\-g) +Abort the current editing command and +ring the terminal's bell (subject to the setting of +.BR bell\-style ). +.TP +.B do\-uppercase\-version (M\-a, M\-b, M\-\fIx\fP, ...) +If the metafied character \fIx\fP is lowercase, run the command +that is bound to the corresponding uppercase character. +.TP +.B prefix\-meta (ESC) +Metafy the next character typed. +.SM +.B ESC +.B f +is equivalent to +.BR Meta\-f . +.TP +.B undo (C\-_, C\-x C\-u) +Incremental undo, separately remembered for each line. +.TP +.B revert\-line (M\-r) +Undo all changes made to this line. This is like executing the +.B undo +command enough times to return the line to its initial state. +.TP +.B tilde\-expand (M\-&) +Perform tilde expansion on the current word. +.TP +.B set\-mark (C\-@, M\-) +Set the mark to the point. If a +numeric argument is supplied, the mark is set to that position. +.TP +.B exchange\-point\-and\-mark (C\-x C\-x) +Swap the point with the mark. The current cursor position is set to +the saved position, and the old cursor position is saved as the mark. +.TP +.B character\-search (C\-]) +A character is read and point is moved to the next occurrence of that +character. A negative count searches for previous occurrences. +.TP +.B character\-search\-backward (M\-C\-]) +A character is read and point is moved to the previous occurrence of that +character. A negative count searches for subsequent occurrences. +.TP +.B skip\-csi\-sequence +Read enough characters to consume a multi-key sequence such as those +defined for keys like Home and End. Such sequences begin with a +Control Sequence Indicator (CSI), usually ESC\-[. If this sequence is +bound to "\e[", keys producing such sequences will have no effect +unless explicitly bound to a readline command, instead of inserting +stray characters into the editing buffer. This is unbound by default, +but usually bound to ESC\-[. +.TP +.B insert\-comment (M\-#) +Without a numeric argument, the value of the readline +.B comment\-begin +variable is inserted at the beginning of the current line. +If a numeric argument is supplied, this command acts as a toggle: if +the characters at the beginning of the line do not match the value +of \fBcomment\-begin\fP, the value is inserted, otherwise +the characters in \fBcomment\-begin\fP are deleted from the beginning of +the line. +In either case, the line is accepted as if a newline had been typed. +The default value of +\fBcomment\-begin\fP causes this command to make the current line +a shell comment. +If a numeric argument causes the comment character to be removed, the line +will be executed by the shell. +.TP +.B glob\-complete\-word (M\-g) +The word before point is treated as a pattern for pathname expansion, +with an asterisk implicitly appended. This pattern is used to +generate a list of matching filenames for possible completions. +.TP +.B glob\-expand\-word (C\-x *) +The word before point is treated as a pattern for pathname expansion, +and the list of matching filenames is inserted, replacing the word. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +.TP +.B glob\-list\-expansions (C\-x g) +The list of expansions that would have been generated by +.B glob\-expand\-word +is displayed, and the line is redrawn. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +.TP +.B dump\-functions +Print all of the functions and their key bindings to the +readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B dump\-variables +Print all of the settable readline variables and their values to the +readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B dump\-macros +Print all of the readline key sequences bound to macros and the +strings they output. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B display\-shell\-version (C\-x C\-v) +Display version information about the current instance of +.BR bash . +.PD +.SS Programmable Completion +.PP +When word completion is attempted for an argument to a command for +which a completion specification (a \fIcompspec\fP) has been defined +using the \fBcomplete\fP builtin (see +.SM +.B "SHELL BUILTIN COMMANDS" +below), the programmable completion facilities are invoked. +.PP +First, the command name is identified. +If the command word is the empty string (completion attempted at the +beginning of an empty line), any compspec defined with +the \fB\-E\fP option to \fBcomplete\fP is used. +If a compspec has been defined for that command, the +compspec is used to generate the list of possible completions for the word. +If the command word is a full pathname, a compspec for the full +pathname is searched for first. +If no compspec is found for the full pathname, an attempt is made to +find a compspec for the portion following the final slash. +If those searches do not result in a compspec, any compspec defined with +the \fB\-D\fP option to \fBcomplete\fP is used as the default. +.PP +Once a compspec has been found, it is used to generate the list of +matching words. +If a compspec is not found, the default \fBbash\fP completion as +described above under \fBCompleting\fP is performed. +.PP +First, the actions specified by the compspec are used. +Only matches which are prefixed by the word being completed are +returned. +When the +.B \-f +or +.B \-d +option is used for filename or directory name completion, the shell +variable +.SM +.B FIGNORE +is used to filter the matches. +.PP +Any completions specified by a pathname expansion pattern to the +\fB\-G\fP option are generated next. +The words generated by the pattern need not match the word +being completed. +The +.SM +.B GLOBIGNORE +shell variable is not used to filter the matches, but the +.SM +.B FIGNORE +variable is used. +.PP +Next, the string specified as the argument to the \fB\-W\fP option +is considered. +The string is first split using the characters in the +.SM +.B IFS +special variable as delimiters. +Shell quoting is honored. +Each word is then expanded using +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, and arithmetic expansion, +as described above under +.SM +.BR EXPANSION . +The results are split using the rules described above under +\fBWord Splitting\fP. +The results of the expansion are prefix-matched against the word being +completed, and the matching words become the possible completions. +.PP +After these matches have been generated, any shell function or command +specified with the \fB\-F\fP and \fB\-C\fP options is invoked. +When the command or function is invoked, the +.SM +.BR COMP_LINE , +.SM +.BR COMP_POINT , +.SM +.BR COMP_KEY , +and +.SM +.B COMP_TYPE +variables are assigned values as described above under +\fBShell Variables\fP. +If a shell function is being invoked, the +.SM +.B COMP_WORDS +and +.SM +.B COMP_CWORD +variables are also set. +When the function or command is invoked, +the first argument (\fB$1\fP) is the name of the command whose arguments are +being completed, +the second argument (\fB$2\fP) is the word being completed, +and the third argument (\fB$3\fP) is the word preceding the word being +completed on the current command line. +No filtering of the generated completions against the word being completed +is performed; the function or command has complete freedom in generating +the matches. +.PP +Any function specified with \fB\-F\fP is invoked first. +The function may use any of the shell facilities, including the +\fBcompgen\fP builtin described below, to generate the matches. +It must put the possible completions in the +.SM +.B COMPREPLY +array variable, one per array element. +.PP +Next, any command specified with the \fB\-C\fP option is invoked +in an environment equivalent to command substitution. +It should print a list of completions, one per line, to the +standard output. +Backslash may be used to escape a newline, if necessary. +.PP +After all of the possible completions are generated, any filter +specified with the \fB\-X\fP option is applied to the list. +The filter is a pattern as used for pathname expansion; a \fB&\fP +in the pattern is replaced with the text of the word being completed. +A literal \fB&\fP may be escaped with a backslash; the backslash +is removed before attempting a match. +Any completion that matches the pattern will be removed from the list. +A leading \fB!\fP negates the pattern; in this case any completion +not matching the pattern will be removed. +.PP +Finally, any prefix and suffix specified with the \fB\-P\fP and \fB\-S\fP +options are added to each member of the completion list, and the result is +returned to the readline completion code as the list of possible +completions. +.PP +If the previously-applied actions do not generate any matches, and the +\fB\-o dirnames\fP option was supplied to \fBcomplete\fP when the +compspec was defined, directory name completion is attempted. +.PP +If the \fB\-o plusdirs\fP option was supplied to \fBcomplete\fP when the +compspec was defined, directory name completion is attempted and any +matches are added to the results of the other actions. +.PP +By default, if a compspec is found, whatever it generates is returned +to the completion code as the full set of possible completions. +The default \fBbash\fP completions are not attempted, and the readline +default of filename completion is disabled. +If the \fB\-o bashdefault\fP option was supplied to \fBcomplete\fP when +the compspec was defined, the \fBbash\fP default completions are attempted +if the compspec generates no matches. +If the \fB\-o default\fP option was supplied to \fBcomplete\fP when the +compspec was defined, readline's default completion will be performed +if the compspec (and, if attempted, the default \fBbash\fP completions) +generate no matches. +.PP +When a compspec indicates that directory name completion is desired, +the programmable completion functions force readline to append a slash +to completed names which are symbolic links to directories, subject to +the value of the \fBmark\-directories\fP readline variable, regardless +of the setting of the \fBmark-symlinked\-directories\fP readline variable. +.PP +There is some support for dynamically modifying completions. This is +most useful when used in combination with a default completion specified +with \fBcomplete -D\fP. +It's possible for shell functions executed as completion +handlers to indicate that completion should be retried by returning an +exit status of 124. If a shell function returns 124, and changes +the compspec associated with the command on which completion is being +attempted (supplied as the first argument when the function is executed), +programmable completion restarts from the beginning, with an +attempt to find a new compspec for that command. This allows a set of +completions to be built dynamically as completion is attempted, rather than +being loaded all at once. +.PP +For instance, assuming that there is a library of compspecs, each kept in a +file corresponding to the name of the command, the following default +completion function would load completions dynamically: +.PP +\f(CW_completion_loader() +.br +{ +.br + . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124 +.br +} +.br +complete -D -F _completion_loader -o bashdefault -o default +.br +\fP +.SH HISTORY +When the +.B \-o history +option to the +.B set +builtin is enabled, the shell provides access to the +\fIcommand history\fP, +the list of commands previously typed. +The value of the +.SM +.B HISTSIZE +variable is used as the +number of commands to save in a history list. +The text of the last +.SM +.B HISTSIZE +commands (default 500) is saved. The shell +stores each command in the history list prior to parameter and +variable expansion (see +.SM +.B EXPANSION +above) but after history expansion is performed, subject to the +values of the shell variables +.SM +.B HISTIGNORE +and +.SM +.BR HISTCONTROL . +.PP +On startup, the history is initialized from the file named by +the variable +.SM +.B HISTFILE +(default \fI~/.bash_history\fP). +The file named by the value of +.SM +.B HISTFILE +is truncated, if necessary, to contain no more than +the number of lines specified by the value of +.SM +.BR HISTFILESIZE . +If \fBHISTFILESIZE\fP is unset, or set to null, a non-numeric value, +or a numeric value less than zero, the history file is not truncated. +When the history file is read, +lines beginning with the history comment character followed immediately +by a digit are interpreted as timestamps for the preceding history line. +These timestamps are optionally displayed depending on the value of the +.SM +.B HISTTIMEFORMAT +variable. +When a shell with history enabled exits, the last +.SM +.B $HISTSIZE +lines are copied from the history list to +.SM +.BR $HISTFILE . +If the +.B histappend +shell option is enabled +(see the description of +.B shopt +under +.SM +.B "SHELL BUILTIN COMMANDS" +below), the lines are appended to the history file, +otherwise the history file is overwritten. +If +.SM +.B HISTFILE +is unset, or if the history file is unwritable, the history is +not saved. +If the +.SM +.B HISTTIMEFORMAT +variable is set, time stamps are written to the history file, marked +with the history comment character, so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +After saving the history, the history file is truncated +to contain no more than +.SM +.B HISTFILESIZE +lines. If +.SM +.B HISTFILESIZE +is unset, or set to null, a non-numeric value, +or a numeric value less than zero, the history file is not truncated. +.PP +The builtin command +.B fc +(see +.SM +.B SHELL BUILTIN COMMANDS +below) may be used to list or edit and re-execute a portion of +the history list. +The +.B history +builtin may be used to display or modify the history list and +manipulate the history file. +When using command-line editing, search commands +are available in each editing mode that provide access to the +history list. +.PP +The shell allows control over which commands are saved on the history +list. The +.SM +.B HISTCONTROL +and +.SM +.B HISTIGNORE +variables may be set to cause the shell to save only a subset of the +commands entered. +The +.B cmdhist +shell option, if enabled, causes the shell to attempt to save each +line of a multi-line command in the same history entry, adding +semicolons where necessary to preserve syntactic correctness. +The +.B lithist +shell option causes the shell to save the command with embedded newlines +instead of semicolons. See the description of the +.B shopt +builtin below under +.SM +.B "SHELL BUILTIN COMMANDS" +for information on setting and unsetting shell options. +.SH "HISTORY EXPANSION" +.PP +The shell supports a history expansion feature that +is similar to the history expansion in +.BR csh. +This section describes what syntax features are available. This +feature is enabled by default for interactive shells, and can be +disabled using the +.B +H +option to the +.B set +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). Non-interactive shells do not perform history expansion +by default. +.PP +History expansions introduce words from the history list into +the input stream, making it easy to repeat commands, insert the +arguments to a previous command into the current input line, or +fix errors in previous commands quickly. +.PP +History expansion is performed immediately after a complete line +is read, before the shell breaks it into words. +It takes place in two parts. +The first is to determine which line from the history list +to use during substitution. +The second is to select portions of that line for inclusion into +the current one. +The line selected from the history is the \fIevent\fP, +and the portions of that line that are acted upon are \fIwords\fP. +Various \fImodifiers\fP are available to manipulate the selected words. +The line is broken into words in the same fashion as when reading input, +so that several \fImetacharacter\fP-separated words surrounded by +quotes are considered one word. +History expansions are introduced by the appearance of the +history expansion character, which is \^\fB!\fP\^ by default. +Only backslash (\^\fB\e\fP\^) and single quotes can quote +the history expansion character. +.PP +Several characters inhibit history expansion if found immediately +following the history expansion character, even if it is unquoted: +space, tab, newline, carriage return, and \fB=\fP. +If the \fBextglob\fP shell option is enabled, \fB(\fP will also +inhibit expansion. +.PP +Several shell options settable with the +.B shopt +builtin may be used to tailor the behavior of history expansion. +If the +.B histverify +shell option is enabled (see the description of the +.B shopt +builtin below), and +.B readline +is being used, history substitutions are not immediately passed to +the shell parser. +Instead, the expanded line is reloaded into the +.B readline +editing buffer for further modification. +If +.B readline +is being used, and the +.B histreedit +shell option is enabled, a failed history substitution will be reloaded +into the +.B readline +editing buffer for correction. +The +.B \-p +option to the +.B history +builtin command may be used to see what a history expansion will +do before using it. +The +.B \-s +option to the +.B history +builtin may be used to add commands to the end of the history list +without actually executing them, so that they are available for +subsequent recall. +.PP +The shell allows control of the various characters used by the +history expansion mechanism (see the description of +.B histchars +above under +.BR "Shell Variables" ). +The shell uses +the history comment character to mark history timestamps when +writing the history file. +.SS Event Designators +.PP +An event designator is a reference to a command line entry in the +history list. +Unless the reference is absolute, events are relative to the current +position in the history list. +.PP +.PD 0 +.TP +.B ! +Start a history substitution, except when followed by a +.BR blank , +newline, carriage return, = +or ( (when the \fBextglob\fP shell option is enabled using +the \fBshopt\fP builtin). +.TP +.B !\fIn\fR +Refer to command line +.IR n . +.TP +.B !\-\fIn\fR +Refer to the current command minus +.IR n . +.TP +.B !! +Refer to the previous command. This is a synonym for `!\-1'. +.TP +.B !\fIstring\fR +Refer to the most recent command preceding the current position in the +history list starting with +.IR string . +.TP +.B !?\fIstring\fR\fB[?]\fR +Refer to the most recent command preceding the current position in the +history list containing +.IR string . +The trailing \fB?\fP may be omitted if +.I string +is followed immediately by a newline. +.TP +.B \d\s+2^\s-2\u\fIstring1\fP\d\s+2^\s-2\u\fIstring2\fP\d\s+2^\s-2\u +Quick substitution. Repeat the previous command, replacing +.I string1 +with +.IR string2 . +Equivalent to +``!!:s/\fIstring1\fP/\fIstring2\fP/'' +(see \fBModifiers\fP below). +.TP +.B !# +The entire command line typed so far. +.PD +.SS Word Designators +.PP +Word designators are used to select desired words from the event. +A +.B : +separates the event specification from the word designator. +It may be omitted if the word designator begins with a +.BR ^ , +.BR $ , +.BR * , +.BR \- , +or +.BR % . +Words are numbered from the beginning of the line, +with the first word being denoted by 0 (zero). +Words are inserted into the current line separated by single spaces. +.PP +.PD 0 +.TP +.B 0 (zero) +The zeroth word. For the shell, this is the command +word. +.TP +.I n +The \fIn\fRth word. +.TP +.B ^ +The first argument. That is, word 1. +.TP +.B $ +The last word. This is usually the last argument, but will expand to the +zeroth word if there is only one word in the line. +.TP +.B % +The word matched by the most recent `?\fIstring\fR?' search. +.TP +.I x\fB\-\fPy +A range of words; `\-\fIy\fR' abbreviates `0\-\fIy\fR'. +.TP +.B * +All of the words but the zeroth. This is a synonym +for `\fI1\-$\fP'. It is not an error to use +.B * +if there is just one +word in the event; the empty string is returned in that case. +.TP +.B x* +Abbreviates \fIx\-$\fP. +.TP +.B x\- +Abbreviates \fIx\-$\fP like \fBx*\fP, but omits the last word. +.PD +.PP +If a word designator is supplied without an event specification, the +previous command is used as the event. +.SS Modifiers +.PP +After the optional word designator, there may appear a sequence of +one or more of the following modifiers, each preceded by a `:'. +.PP +.PD 0 +.PP +.TP +.B h +Remove a trailing filename component, leaving only the head. +.TP +.B t +Remove all leading filename components, leaving the tail. +.TP +.B r +Remove a trailing suffix of the form \fI.xxx\fP, leaving the +basename. +.TP +.B e +Remove all but the trailing suffix. +.TP +.B p +Print the new command but do not execute it. +.TP +.B q +Quote the substituted words, escaping further substitutions. +.TP +.B x +Quote the substituted words as with +.BR q , +but break into words at +.B blanks +and newlines. +.TP +.B s/\fIold\fP/\fInew\fP/ +Substitute +.I new +for the first occurrence of +.I old +in the event line. Any delimiter can be used in place of /. The +final delimiter is optional if it is the last character of the +event line. The delimiter may be quoted in +.I old +and +.I new +with a single backslash. If & appears in +.IR new , +it is replaced by +.IR old . +A single backslash will quote the &. If +.I old +is null, it is set to the last +.I old +substituted, or, if no previous history substitutions took place, +the last +.I string +in a +.B !?\fIstring\fR\fB[?]\fR +search. +.TP +.B & +Repeat the previous substitution. +.TP +.B g +Cause changes to be applied over the entire event line. This is +used in conjunction with `\fB:s\fP' (e.g., `\fB:gs/\fIold\fP/\fInew\fP/\fR') +or `\fB:&\fP'. If used with +`\fB:s\fP', any delimiter can be used +in place of /, and the final delimiter is optional +if it is the last character of the event line. +An \fBa\fP may be used as a synonym for \fBg\fP. +.TP +.B G +Apply the following `\fBs\fP' modifier once to each word in the event line. +.PD +.SH "SHELL BUILTIN COMMANDS" +.\" start of bash_builtins +.zZ +.PP +Unless otherwise noted, each builtin command documented in this +section as accepting options preceded by +.B \- +accepts +.B \-\- +to signify the end of the options. +The \fB:\fP, \fBtrue\fP, \fBfalse\fP, and \fBtest\fP builtins +do not accept options and do not treat \fB\-\-\fP specially. +The \fBexit\fP, \fBlogout\fP, \fBbreak\fP, \fBcontinue\fP, \fBlet\fP, +and \fBshift\fP builtins accept and process arguments beginning with +\fB\-\fP without requiring \fB\-\-\fP. +Other builtins that accept arguments but are not specified as accepting +options interpret arguments beginning with \fB\-\fP as invalid options and +require \fB\-\-\fP to prevent this interpretation. +.sp .5 +.PD 0 +.TP +\fB:\fP [\fIarguments\fP] +.PD +No effect; the command does nothing beyond expanding +.I arguments +and performing any specified +redirections. A zero exit code is returned. +.TP +\fB .\| \fP \fIfilename\fP [\fIarguments\fP] +.PD 0 +.TP +\fBsource\fP \fIfilename\fP [\fIarguments\fP] +.PD +Read and execute commands from +.I filename +in the current +shell environment and return the exit status of the last command +executed from +.IR filename . +If +.I filename +does not contain a slash, filenames in +.SM +.B PATH +are used to find the directory containing +.IR filename . +The file searched for in +.SM +.B PATH +need not be executable. +When \fBbash\fP is not in \fIposix mode\fP, the current directory is +searched if no file is found in +.SM +.BR PATH . +If the +.B sourcepath +option to the +.B shopt +builtin command is turned off, the +.SM +.B PATH +is not searched. +If any \fIarguments\fP are supplied, they become the positional +parameters when \fIfilename\fP is executed. Otherwise the positional +parameters are unchanged. +The return status is the status of the last command exited within +the script (0 if no commands are executed), and false if +.I filename +is not found or cannot be read. +.TP +\fBalias\fP [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +\fBAlias\fP with no arguments or with the +.B \-p +option prints the list of aliases in the form +\fBalias\fP \fIname\fP=\fIvalue\fP on standard output. +When arguments are supplied, an alias is defined for +each \fIname\fP whose \fIvalue\fP is given. +A trailing space in \fIvalue\fP causes the next word to be +checked for alias substitution when the alias is expanded. +For each \fIname\fP in the argument list for which no \fIvalue\fP +is supplied, the name and value of the alias is printed. +\fBAlias\fP returns true unless a \fIname\fP is given for which +no alias has been defined. +.TP +\fBbg\fP [\fIjobspec\fP ...] +Resume each suspended job \fIjobspec\fP in the background, as if it +had been started with +.BR & . +If +.I jobspec +is not present, the shell's notion of the \fIcurrent job\fP is used. +.B bg +.I jobspec +returns 0 unless run when job control is disabled or, when run with +job control enabled, any specified \fIjobspec\fP was not found +or was started without job control. +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] [\fB\-lpsvPSVX\fP] +.PD 0 +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] [\fB\-q\fP \fIfunction\fP] [\fB\-u\fP \fIfunction\fP] [\fB\-r\fP \fIkeyseq\fP] +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fB\-f\fP \fIfilename\fP +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fB\-x\fP \fIkeyseq\fP:\fIshell\-command\fP +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fIkeyseq\fP:\fIfunction\-name\fP +.TP +\fBbind\fP \fIreadline\-command\fP +.PD +Display current +.B readline +key and function bindings, bind a key sequence to a +.B readline +function or macro, or set a +.B readline +variable. +Each non-option argument is a command as it would appear in +.IR .inputrc , +but each binding or command must be passed as a separate argument; +e.g., '"\eC\-x\eC\-r": re\-read\-init\-file'. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-m \fIkeymap\fP +Use +.I keymap +as the keymap to be affected by the subsequent bindings. +Acceptable +.I keymap +names are +\fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi, +vi\-move, vi\-command\fP, and +.IR vi\-insert . +\fIvi\fP is equivalent to \fIvi\-command\fP; \fIemacs\fP is +equivalent to \fIemacs\-standard\fP. +.TP +.B \-l +List the names of all \fBreadline\fP functions. +.TP +.B \-p +Display \fBreadline\fP function names and bindings in such a way +that they can be re-read. +.TP +.B \-P +List current \fBreadline\fP function names and bindings. +.TP +.B \-s +Display \fBreadline\fP key sequences bound to macros and the strings +they output in such a way that they can be re-read. +.TP +.B \-S +Display \fBreadline\fP key sequences bound to macros and the strings +they output. +.TP +.B \-v +Display \fBreadline\fP variable names and values in such a way that they +can be re-read. +.TP +.B \-V +List current \fBreadline\fP variable names and values. +.TP +.B \-f \fIfilename\fP +Read key bindings from \fIfilename\fP. +.TP +.B \-q \fIfunction\fP +Query about which keys invoke the named \fIfunction\fP. +.TP +.B \-u \fIfunction\fP +Unbind all keys bound to the named \fIfunction\fP. +.TP +.B \-r \fIkeyseq\fP +Remove any current binding for \fIkeyseq\fP. +.TP +.B \-x \fIkeyseq\fP:\fIshell\-command\fP +Cause \fIshell\-command\fP to be executed whenever \fIkeyseq\fP is +entered. +When \fIshell\-command\fP is executed, the shell sets the +.SM +.B READLINE_LINE +variable to the contents of the \fBreadline\fP line buffer and the +.SM +.B READLINE_POINT +variable to the current location of the insertion point. +If the executed command changes the value of +.SM +.B READLINE_LINE +or +.SM +.BR READLINE_POINT , +those new values will be reflected in the editing state. +.TP +.B \-X +List all key sequences bound to shell commands and the associated commands +in a format that can be reused as input. +.PD +.PP +The return value is 0 unless an unrecognized option is given or an +error occurred. +.RE +.TP +\fBbreak\fP [\fIn\fP] +Exit from within a +.BR for , +.BR while , +.BR until , +or +.B select +loop. If \fIn\fP is specified, break \fIn\fP levels. +.I n +must be \(>= 1. If +.I n +is greater than the number of enclosing loops, all enclosing loops +are exited. +The return value is 0 unless \fIn\fP is not greater than or equal to 1. +.TP +\fBbuiltin\fP \fIshell\-builtin\fP [\fIarguments\fP] +Execute the specified shell builtin, passing it +.IR arguments , +and return its exit status. +This is useful when defining a +function whose name is the same as a shell builtin, +retaining the functionality of the builtin within the function. +The \fBcd\fP builtin is commonly redefined this way. +The return status is false if +.I shell\-builtin +is not a shell builtin command. +.TP +\fBcaller\fP [\fIexpr\fP] +Returns the context of any active subroutine call (a shell function or +a script executed with the \fB.\fP or \fBsource\fP builtins). +Without \fIexpr\fP, \fBcaller\fP displays the line number and source +filename of the current subroutine call. +If a non-negative integer is supplied as \fIexpr\fP, \fBcaller\fP +displays the line number, subroutine name, and source file corresponding +to that position in the current execution call stack. This extra +information may be used, for example, to print a stack trace. The +current frame is frame 0. +The return value is 0 unless the shell is not executing a subroutine +call or \fIexpr\fP does not correspond to a valid position in the +call stack. +.TP +\fBcd\fP [\fB\-L\fP|[\fB\-P\fP [\fB\-e\fP]] [\-@]] [\fIdir\fP] +Change the current directory to \fIdir\fP. +if \fIdir\fP is not supplied, the value of the +.SM +.B HOME +shell variable is the default. +Any additional arguments following \fIdir\fP are ignored. +The variable +.SM +.B CDPATH +defines the search path for the directory containing +.IR dir : +each directory name in +.SM +.B CDPATH +is searched for \fIdir\fP. +Alternative directory names in +.SM +.B CDPATH +are separated by a colon (:). A null directory name in +.SM +.B CDPATH +is the same as the current directory, i.e., ``\fB.\fP''. If +.I dir +begins with a slash (/), +then +.SM +.B CDPATH +is not used. The +.B \-P +option causes \fBcd\fP to use the physical directory structure +by resolving symbolic links while traversing \fIdir\fP and +before processing instances of \fI..\fP in \fIdir\fP (see also the +.B \-P +option to the +.B set +builtin command); the +.B \-L +option forces symbolic links to be followed by resolving the link +after processing instances of \fI..\fP in \fIdir\fP. +If \fI..\fP appears in \fIdir\fP, it is processed by removing the +immediately previous pathname component from \fIdir\fP, back to a slash +or the beginning of \fIdir\fP. +If the +.B \-e +option is supplied with +.BR \-P , +and the current working directory cannot be successfully determined +after a successful directory change, \fBcd\fP will return an unsuccessful +status. +On systems that support it, the \fB\-@\fP option presents the extended +attributes associated with a file as a directory. +An argument of +.B \- +is converted to +.SM +.B $OLDPWD +before the directory change is attempted. +If a non-empty directory name from +.SM +.B CDPATH +is used, or if +\fB\-\fP is the first argument, and the directory change is +successful, the absolute pathname of the new working directory is +written to the standard output. +The return value is true if the directory was successfully changed; +false otherwise. +.TP +\fBcommand\fP [\fB\-pVv\fP] \fIcommand\fP [\fIarg\fP ...] +Run +.I command +with +.I args +suppressing the normal shell function lookup. Only builtin +commands or commands found in the +.SM +.B PATH +are executed. If the +.B \-p +option is given, the search for +.I command +is performed using a default value for +.SM +.B PATH +that is guaranteed to find all of the standard utilities. +If either the +.B \-V +or +.B \-v +option is supplied, a description of +.I command +is printed. The +.B \-v +option causes a single word indicating the command or filename +used to invoke +.I command +to be displayed; the +.B \-V +option produces a more verbose description. +If the +.B \-V +or +.B \-v +option is supplied, the exit status is 0 if +.I command +was found, and 1 if not. If neither option is supplied and +an error occurred or +.I command +cannot be found, the exit status is 127. Otherwise, the exit status of the +.B command +builtin is the exit status of +.IR command . +.TP +\fBcompgen\fP [\fIoption\fP] [\fIword\fP] +Generate possible completion matches for \fIword\fP according to +the \fIoption\fPs, which may be any option accepted by the +.B complete +builtin with the exception of \fB\-p\fP and \fB\-r\fP, and write +the matches to the standard output. +When using the \fB\-F\fP or \fB\-C\fP options, the various shell variables +set by the programmable completion facilities, while available, will not +have useful values. +.sp 1 +The matches will be generated in the same way as if the programmable +completion code had generated them directly from a completion specification +with the same flags. +If \fIword\fP is specified, only those completions matching \fIword\fP +will be displayed. +.sp 1 +The return value is true unless an invalid option is supplied, or no +matches were generated. +.TP +\fBcomplete\fP [\fB\-abcdefgjksuv\fP] [\fB\-o\fP \fIcomp-option\fP] [\fB\-DE\fP] [\fB\-A\fP \fIaction\fP] [\fB\-G\fP \fIglobpat\fP] [\fB\-W\fP \fIwordlist\fP] [\fB\-F\fP \fIfunction\fP] [\fB\-C\fP \fIcommand\fP] +.br +[\fB\-X\fP \fIfilterpat\fP] [\fB\-P\fP \fIprefix\fP] [\fB\-S\fP \fIsuffix\fP] \fIname\fP [\fIname ...\fP] +.PD 0 +.TP +\fBcomplete\fP \fB\-pr\fP [\fB\-DE\fP] [\fIname\fP ...] +.PD +Specify how arguments to each \fIname\fP should be completed. +If the \fB\-p\fP option is supplied, or if no options are supplied, +existing completion specifications are printed in a way that allows +them to be reused as input. +The \fB\-r\fP option removes a completion specification for +each \fIname\fP, or, if no \fIname\fPs are supplied, all +completion specifications. +The \fB\-D\fP option indicates that the remaining options and actions should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The \fB\-E\fP option indicates that the remaining options and actions should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +.sp 1 +The process of applying these completion specifications when word completion +is attempted is described above under \fBProgrammable Completion\fP. +.sp 1 +Other options, if specified, have the following meanings. +The arguments to the \fB\-G\fP, \fB\-W\fP, and \fB\-X\fP options +(and, if necessary, the \fB\-P\fP and \fB\-S\fP options) +should be quoted to protect them from expansion before the +.B complete +builtin is invoked. +.RS +.PD 0 +.TP 8 +\fB\-o\fP \fIcomp-option\fP +The \fIcomp-option\fP controls several aspects of the compspec's behavior +beyond the simple generation of completions. +\fIcomp-option\fP may be one of: +.RS +.TP 8 +.B bashdefault +Perform the rest of the default \fBbash\fP completions if the compspec +generates no matches. +.TP 8 +.B default +Use readline's default filename completion if the compspec generates +no matches. +.TP 8 +.B dirnames +Perform directory name completion if the compspec generates no matches. +.TP 8 +.B filenames +Tell readline that the compspec generates filenames, so it can perform any +filename\-specific processing (like adding a slash to directory names, +quoting special characters, or suppressing trailing spaces). +Intended to be used with shell functions. +.TP 8 +.B noquote +Tell readline not to quote the completed words if they are filenames +(quoting filenames is the default). +.TP 8 +.B nospace +Tell readline not to append a space (the default) to words completed at +the end of the line. +.TP 8 +.B plusdirs +After any matches defined by the compspec are generated, +directory name completion is attempted and any +matches are added to the results of the other actions. +.RE +.TP 8 +\fB\-A\fP \fIaction\fP +The \fIaction\fP may be one of the following to generate a list of possible +completions: +.RS +.TP 8 +.B alias +Alias names. May also be specified as \fB\-a\fP. +.TP 8 +.B arrayvar +Array variable names. +.TP 8 +.B binding +\fBReadline\fP key binding names. +.TP 8 +.B builtin +Names of shell builtin commands. May also be specified as \fB\-b\fP. +.TP 8 +.B command +Command names. May also be specified as \fB\-c\fP. +.TP 8 +.B directory +Directory names. May also be specified as \fB\-d\fP. +.TP 8 +.B disabled +Names of disabled shell builtins. +.TP 8 +.B enabled +Names of enabled shell builtins. +.TP 8 +.B export +Names of exported shell variables. May also be specified as \fB\-e\fP. +.TP 8 +.B file +File names. May also be specified as \fB\-f\fP. +.TP 8 +.B function +Names of shell functions. +.TP 8 +.B group +Group names. May also be specified as \fB\-g\fP. +.TP 8 +.B helptopic +Help topics as accepted by the \fBhelp\fP builtin. +.TP 8 +.B hostname +Hostnames, as taken from the file specified by the +.SM +.B HOSTFILE +shell variable. +.TP 8 +.B job +Job names, if job control is active. May also be specified as \fB\-j\fP. +.TP 8 +.B keyword +Shell reserved words. May also be specified as \fB\-k\fP. +.TP 8 +.B running +Names of running jobs, if job control is active. +.TP 8 +.B service +Service names. May also be specified as \fB\-s\fP. +.TP 8 +.B setopt +Valid arguments for the \fB\-o\fP option to the \fBset\fP builtin. +.TP 8 +.B shopt +Shell option names as accepted by the \fBshopt\fP builtin. +.TP 8 +.B signal +Signal names. +.TP 8 +.B stopped +Names of stopped jobs, if job control is active. +.TP 8 +.B user +User names. May also be specified as \fB\-u\fP. +.TP 8 +.B variable +Names of all shell variables. May also be specified as \fB\-v\fP. +.RE +.TP 8 +\fB\-C\fP \fIcommand\fP +\fIcommand\fP is executed in a subshell environment, and its output is +used as the possible completions. +.TP 8 +\fB\-F\fP \fIfunction\fP +The shell function \fIfunction\fP is executed in the current shell +environment. +When the function is executed, +the first argument (\fB$1\fP) is the name of the command whose arguments are +being completed, +the second argument (\fB$2\fP) is the word being completed, +and the third argument (\fB$3\fP) is the word preceding the word being +completed on the current command line. +When it finishes, the possible completions are retrieved from the value +of the +.SM +.B COMPREPLY +array variable. +.TP 8 +\fB\-G\fP \fIglobpat\fP +The pathname expansion pattern \fIglobpat\fP is expanded to generate +the possible completions. +.TP 8 +\fB\-P\fP \fIprefix\fP +\fIprefix\fP is added at the beginning of each possible completion +after all other options have been applied. +.TP 8 +\fB\-S\fP \fIsuffix\fP +\fIsuffix\fP is appended to each possible completion +after all other options have been applied. +.TP 8 +\fB\-W\fP \fIwordlist\fP +The \fIwordlist\fP is split using the characters in the +.SM +.B IFS +special variable as delimiters, and each resultant word is expanded. +The possible completions are the members of the resultant list which +match the word being completed. +.TP 8 +\fB\-X\fP \fIfilterpat\fP +\fIfilterpat\fP is a pattern as used for pathname expansion. +It is applied to the list of possible completions generated by the +preceding options and arguments, and each completion matching +\fIfilterpat\fP is removed from the list. +A leading \fB!\fP in \fIfilterpat\fP negates the pattern; in this +case, any completion not matching \fIfilterpat\fP is removed. +.PD +.PP +The return value is true unless an invalid option is supplied, an option +other than \fB\-p\fP or \fB\-r\fP is supplied without a \fIname\fP +argument, an attempt is made to remove a completion specification for +a \fIname\fP for which no specification exists, or +an error occurs adding a completion specification. +.RE +.TP +\fBcompopt\fP [\fB\-o\fP \fIoption\fP] [\fB\-DE\fP] [\fB+o\fP \fIoption\fP] [\fIname\fP] +Modify completion options for each \fIname\fP according to the +\fIoption\fPs, or for the +currently-executing completion if no \fIname\fPs are supplied. +If no \fIoption\fPs are given, display the completion options for each +\fIname\fP or the current completion. +The possible values of \fIoption\fP are those valid for the \fBcomplete\fP +builtin described above. +The \fB\-D\fP option indicates that the remaining options should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The \fB\-E\fP option indicates that the remaining options should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +.sp 1 +The return value is true unless an invalid option is supplied, an attempt +is made to modify the options for a \fIname\fP for which no completion +specification exists, or an output error occurs. +.TP +\fBcontinue\fP [\fIn\fP] +Resume the next iteration of the enclosing +.BR for , +.BR while , +.BR until , +or +.B select +loop. +If +.I n +is specified, resume at the \fIn\fPth enclosing loop. +.I n +must be \(>= 1. If +.I n +is greater than the number of enclosing loops, the last enclosing loop +(the ``top-level'' loop) is resumed. +The return value is 0 unless \fIn\fP is not greater than or equal to 1. +.TP +\fBdeclare\fP [\fB\-aAfFgilnrtux\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +.PD 0 +.TP +\fBtypeset\fP [\fB\-aAfFgilnrtux\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +.PD +Declare variables and/or give them attributes. +If no \fIname\fPs are given then display the values of variables. +The +.B \-p +option will display the attributes and values of each +.IR name . +When +.B \-p +is used with \fIname\fP arguments, additional options, +other than \fB\-f\fP and \fB\-F\fP, are ignored. +When +.B \-p +is supplied without \fIname\fP arguments, it will display the attributes +and values of all variables having the attributes specified by the +additional options. +If no other options are supplied with \fB\-p\fP, \fBdeclare\fP will display +the attributes and values of all shell variables. The \fB\-f\fP option +will restrict the display to shell functions. +The +.B \-F +option inhibits the display of function definitions; only the +function name and attributes are printed. +If the \fBextdebug\fP shell option is enabled using \fBshopt\fP, +the source file name and line number where the function is defined +are displayed as well. The +.B \-F +option implies +.BR \-f . +The +.B \-g +option forces variables to be created or modified at the global scope, +even when \fBdeclare\fP is executed in a shell function. +It is ignored in all other cases. +The following options can +be used to restrict output to variables with the specified attribute or +to give variables attributes: +.RS +.PD 0 +.TP +.B \-a +Each \fIname\fP is an indexed array variable (see +.B Arrays +above). +.TP +.B \-A +Each \fIname\fP is an associative array variable (see +.B Arrays +above). +.TP +.B \-f +Use function names only. +.TP +.B \-i +The variable is treated as an integer; arithmetic evaluation (see +.SM +.B "ARITHMETIC EVALUATION" +above) is performed when the variable is assigned a value. +.TP +.B \-l +When the variable is assigned a value, all upper-case characters are +converted to lower-case. +The upper-case attribute is disabled. +.TP +.B \-n +Give each \fIname\fP the \fInameref\fP attribute, making +it a name reference to another variable. +That other variable is defined by the value of \fIname\fP. +All references and assignments to \fIname\fP, except for changing the +\fB\-n\fP attribute itself, are performed on the variable referenced by +\fIname\fP's value. +The \fB\-n\fP attribute cannot be applied to array variables. +.TP +.B \-r +Make \fIname\fPs readonly. These names cannot then be assigned values +by subsequent assignment statements or unset. +.TP +.B \-t +Give each \fIname\fP the \fItrace\fP attribute. +Traced functions inherit the \fBDEBUG\fP and \fBRETURN\fP traps from +the calling shell. +The trace attribute has no special meaning for variables. +.TP +.B \-u +When the variable is assigned a value, all lower-case characters are +converted to upper-case. +The lower-case attribute is disabled. +.TP +.B \-x +Mark \fIname\fPs for export to subsequent commands via the environment. +.PD +.PP +Using `+' instead of `\-' +turns off the attribute instead, +with the exceptions that \fB+a\fP +may not be used to destroy an array variable and \fB+r\fP will not +remove the readonly attribute. +When used in a function, +.B declare +and +.B typeset +make each +\fIname\fP local, as with the +.B local +command, +unless the \fB\-g\fP option is supplied. +If a variable name is followed by =\fIvalue\fP, the value of +the variable is set to \fIvalue\fP. +When using \fB\-a\fP or \fB\-A\fP and the compound assignment syntax to +create array variables, additional attributes do not take effect until +subsequent assignments. +The return value is 0 unless an invalid option is encountered, +an attempt is made to define a function using +.if n ``\-f foo=bar'', +.if t \f(CW\-f foo=bar\fP, +an attempt is made to assign a value to a readonly variable, +an attempt is made to assign a value to an array variable without +using the compound assignment syntax (see +.B Arrays +above), one of the \fInames\fP is not a valid shell variable name, +an attempt is made to turn off readonly status for a readonly variable, +an attempt is made to turn off array status for an array variable, +or an attempt is made to display a non-existent function with \fB\-f\fP. +.RE +.TP +.B dirs [\fB\-clpv\fP] [+\fIn\fP] [\-\fIn\fP] +Without options, displays the list of currently remembered directories. +The default display is on a single line with directory names separated +by spaces. +Directories are added to the list with the +.B pushd +command; the +.B popd +command removes entries from the list. +.RS +.PD 0 +.TP +.B \-c +Clears the directory stack by deleting all of the entries. +.TP +.B \-l +Produces a listing using full pathnames; +the default listing format uses a tilde to denote the home directory. +.TP +.B \-p +Print the directory stack with one entry per line. +.TP +.B \-v +Print the directory stack with one entry per line, +prefixing each entry with its index in the stack. +.TP +\fB+\fP\fIn\fP +Displays the \fIn\fPth entry counting from the left of the list +shown by +.B dirs +when invoked without options, starting with zero. +.TP +\fB\-\fP\fIn\fP +Displays the \fIn\fPth entry counting from the right of the list +shown by +.B dirs +when invoked without options, starting with zero. +.PD +.PP +The return value is 0 unless an +invalid option is supplied or \fIn\fP indexes beyond the end +of the directory stack. +.RE +.TP +\fBdisown\fP [\fB\-ar\fP] [\fB\-h\fP] [\fIjobspec\fP ...] +Without options, remove each +.I jobspec +from the table of active jobs. +If +.I jobspec +is not present, and neither the \fB\-a\fP nor the \fB\-r\fP option +is supplied, the \fIcurrent job\fP is used. +If the \fB\-h\fP option is given, each +.I jobspec +is not removed from the table, but is marked so that +.SM +.B SIGHUP +is not sent to the job if the shell receives a +.SM +.BR SIGHUP . +If no +.I jobspec +is supplied, the +.B \-a +option means to remove or mark all jobs; the +.B \-r +option without a +.I jobspec +argument restricts operation to running jobs. +The return value is 0 unless a +.I jobspec +does not specify a valid job. +.TP +\fBecho\fP [\fB\-neE\fP] [\fIarg\fP ...] +Output the \fIarg\fPs, separated by spaces, followed by a newline. +The return status is 0 unless a write error occurs. +If \fB\-n\fP is specified, the trailing newline is +suppressed. If the \fB\-e\fP option is given, interpretation of +the following backslash-escaped characters is enabled. The +.B \-E +option disables the interpretation of these escape characters, +even on systems where they are interpreted by default. +The \fBxpg_echo\fP shell option may be used to +dynamically determine whether or not \fBecho\fP expands these +escape characters by default. +.B echo +does not interpret \fB\-\-\fP to mean the end of options. +.B echo +interprets the following escape sequences: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ec +suppress further output +.TP +.B \ee +.TP +.B \eE +an escape character +.TP +.B \ef +form feed +.TP +.B \en +new line +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\e +backslash +.TP +.B \e0\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(zero to three octal digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.TP +.B \eu\fIHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHH\fP (one to four hex digits) +.TP +.B \eU\fIHHHHHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHHHHHH\fP (one to eight hex digits) +.PD +.RE +.TP +\fBenable\fP [\fB\-a\fP] [\fB\-dnps\fP] [\fB\-f\fP \fIfilename\fP] [\fIname\fP ...] +Enable and disable builtin shell commands. +Disabling a builtin allows a disk command which has the same name +as a shell builtin to be executed without specifying a full pathname, +even though the shell normally searches for builtins before disk commands. +If \fB\-n\fP is used, each \fIname\fP +is disabled; otherwise, +\fInames\fP are enabled. For example, to use the +.B test +binary found via the +.SM +.B PATH +instead of the shell builtin version, run +.if t \f(CWenable -n test\fP. +.if n ``enable -n test''. +The +.B \-f +option means to load the new builtin command +.I name +from shared object +.IR filename , +on systems that support dynamic loading. The +.B \-d +option will delete a builtin previously loaded with +.BR \-f . +If no \fIname\fP arguments are given, or if the +.B \-p +option is supplied, a list of shell builtins is printed. +With no other option arguments, the list consists of all enabled +shell builtins. +If \fB\-n\fP is supplied, only disabled builtins are printed. +If \fB\-a\fP is supplied, the list printed includes all builtins, with an +indication of whether or not each is enabled. +If \fB\-s\fP is supplied, the output is restricted to the POSIX +\fIspecial\fP builtins. +The return value is 0 unless a +.I name +is not a shell builtin or there is an error loading a new builtin +from a shared object. +.TP +\fBeval\fP [\fIarg\fP ...] +The \fIarg\fPs are read and concatenated together into a single +command. This command is then read and executed by the shell, and +its exit status is returned as the value of +.BR eval . +If there are no +.IR args , +or only null arguments, +.B eval +returns 0. +.TP +\fBexec\fP [\fB\-cl\fP] [\fB\-a\fP \fIname\fP] [\fIcommand\fP [\fIarguments\fP]] +If +.I command +is specified, it replaces the shell. +No new process is created. The +.I arguments +become the arguments to \fIcommand\fP. +If the +.B \-l +option is supplied, +the shell places a dash at the beginning of the zeroth argument passed to +.IR command . +This is what +.IR login (1) +does. The +.B \-c +option causes +.I command +to be executed with an empty environment. If +.B \-a +is supplied, the shell passes +.I name +as the zeroth argument to the executed command. +If +.I command +cannot be executed for some reason, a non-interactive shell exits, +unless the +.B execfail +shell option +is enabled. In that case, it returns failure. +An interactive shell returns failure if the file cannot be executed. +If +.I command +is not specified, any redirections take effect in the current shell, +and the return status is 0. If there is a redirection error, the +return status is 1. +.TP +\fBexit\fP [\fIn\fP] +Cause the shell to exit +with a status of \fIn\fP. If +.I n +is omitted, the exit status +is that of the last command executed. +A trap on +.SM +.B EXIT +is executed before the shell terminates. +.TP +\fBexport\fP [\fB\-fn\fP\^] [\fIname\fP[=\fIword\fP]] ... +.PD 0 +.TP +.B export \-p +.PD +The supplied +.I names +are marked for automatic export to the environment of +subsequently executed commands. If the +.B \-f +option is given, +the +.I names +refer to functions. +If no +.I names +are given, or if the +.B \-p +option is supplied, a list +of names of all exported variables is printed. +The +.B \-n +option causes the export property to be removed from each +\fIname\fP. +If a variable name is followed by =\fIword\fP, the value of +the variable is set to \fIword\fP. +.B export +returns an exit status of 0 unless an invalid option is +encountered, +one of the \fInames\fP is not a valid shell variable name, or +.B \-f +is supplied with a +.I name +that is not a function. +.TP +\fBfc\fP [\fB\-e\fP \fIename\fP] [\fB\-lnr\fP] [\fIfirst\fP] [\fIlast\fP] +.PD 0 +.TP +\fBfc\fP \fB\-s\fP [\fIpat\fP=\fIrep\fP] [\fIcmd\fP] +.PD +The first form selects a range of commands from +.I first +to +.I last +from the history list and displays or edits and re-executes them. +.I First +and +.I last +may be specified as a string (to locate the last command beginning +with that string) or as a number (an index into the history list, +where a negative number is used as an offset from the current +command number). If +.I last +is not specified it is set to +the current command for listing (so that +.if n ``fc \-l \-10'' +.if t \f(CWfc \-l \-10\fP +prints the last 10 commands) and to +.I first +otherwise. +If +.I first +is not specified it is set to the previous +command for editing and \-16 for listing. +.sp 1 +The +.B \-n +option suppresses +the command numbers when listing. The +.B \-r +option reverses the order of +the commands. If the +.B \-l +option is given, +the commands are listed on +standard output. Otherwise, the editor given by +.I ename +is invoked +on a file containing those commands. If +.I ename +is not given, the +value of the +.SM +.B FCEDIT +variable is used, and +the value of +.SM +.B EDITOR +if +.SM +.B FCEDIT +is not set. If neither variable is set, +.FN vi +is used. When editing is complete, the edited commands are +echoed and executed. +.sp 1 +In the second form, \fIcommand\fP is re-executed after each instance +of \fIpat\fP is replaced by \fIrep\fP. +\fICommand\fP is intepreted the same as \fIfirst\fP above. +A useful alias to use with this is +.if n ``r="fc -s"'', +.if t \f(CWr='fc \-s'\fP, +so that typing +.if n ``r cc'' +.if t \f(CWr cc\fP +runs the last command beginning with +.if n ``cc'' +.if t \f(CWcc\fP +and typing +.if n ``r'' +.if t \f(CWr\fP +re-executes the last command. +.sp 1 +If the first form is used, the return value is 0 unless an invalid +option is encountered or +.I first +or +.I last +specify history lines out of range. +If the +.B \-e +option is supplied, the return value is the value of the last +command executed or failure if an error occurs with the temporary +file of commands. If the second form is used, the return status +is that of the command re-executed, unless +.I cmd +does not specify a valid history line, in which case +.B fc +returns failure. +.TP +\fBfg\fP [\fIjobspec\fP] +Resume +.I jobspec +in the foreground, and make it the current job. +If +.I jobspec +is not present, the shell's notion of the \fIcurrent job\fP is used. +The return value is that of the command placed into the foreground, +or failure if run when job control is disabled or, when run with +job control enabled, if +.I jobspec +does not specify a valid job or +.I jobspec +specifies a job that was started without job control. +.TP +\fBgetopts\fP \fIoptstring\fP \fIname\fP [\fIargs\fP] +.B getopts +is used by shell procedures to parse positional parameters. +.I optstring +contains the option characters to be recognized; if a character +is followed by a colon, the option is expected to have an +argument, which should be separated from it by white space. +The colon and question mark characters may not be used as +option characters. +Each time it is invoked, +.B getopts +places the next option in the shell variable +.IR name , +initializing +.I name +if it does not exist, +and the index of the next argument to be processed into the +variable +.SM +.BR OPTIND . +.SM +.B OPTIND +is initialized to 1 each time the shell or a shell script +is invoked. When an option requires an argument, +.B getopts +places that argument into the variable +.SM +.BR OPTARG . +The shell does not reset +.SM +.B OPTIND +automatically; it must be manually reset between multiple +calls to +.B getopts +within the same shell invocation if a new set of parameters +is to be used. +.sp 1 +When the end of options is encountered, \fBgetopts\fP exits with a +return value greater than zero. +.SM +.B OPTIND +is set to the index of the first non-option argument, +and \fIname\fP is set to ?. +.sp 1 +.B getopts +normally parses the positional parameters, but if more arguments are +given in +.IR args , +.B getopts +parses those instead. +.sp 1 +.B getopts +can report errors in two ways. If the first character of +.I optstring +is a colon, +.I silent +error reporting is used. In normal operation, diagnostic messages +are printed when invalid options or missing option arguments are +encountered. +If the variable +.SM +.B OPTERR +is set to 0, no error messages will be displayed, even if the first +character of +.I optstring +is not a colon. +.sp 1 +If an invalid option is seen, +.B getopts +places ? into +.I name +and, if not silent, +prints an error message and unsets +.SM +.BR OPTARG . +If +.B getopts +is silent, +the option character found is placed in +.SM +.B OPTARG +and no diagnostic message is printed. +.sp 1 +If a required argument is not found, and +.B getopts +is not silent, +a question mark (\^\fB?\fP\^) is placed in +.IR name , +.SM +.B OPTARG +is unset, and a diagnostic message is printed. +If +.B getopts +is silent, then a colon (\^\fB:\fP\^) is placed in +.I name +and +.SM +.B OPTARG +is set to the option character found. +.sp 1 +.B getopts +returns true if an option, specified or unspecified, is found. +It returns false if the end of options is encountered or an +error occurs. +.TP +\fBhash\fP [\fB\-lr\fP] [\fB\-p\fP \fIfilename\fP] [\fB\-dt\fP] [\fIname\fP] +Each time \fBhash\fP is invoked, +the full pathname of the command +.I name +is determined by searching +the directories in +.B $PATH +and remembered. Any previously-remembered pathname is discarded. +If the +.B \-p +option is supplied, no path search is performed, and +.I filename +is used as the full filename of the command. +The +.B \-r +option causes the shell to forget all +remembered locations. +The +.B \-d +option causes the shell to forget the remembered location of each \fIname\fP. +If the +.B \-t +option is supplied, the full pathname to which each \fIname\fP corresponds +is printed. If multiple \fIname\fP arguments are supplied with \fB\-t\fP, +the \fIname\fP is printed before the hashed full pathname. +The +.B \-l +option causes output to be displayed in a format that may be reused as input. +If no arguments are given, or if only \fB\-l\fP is supplied, +information about remembered commands is printed. +The return status is true unless a +.I name +is not found or an invalid option is supplied. +.TP +\fBhelp\fP [\fB\-dms\fP] [\fIpattern\fP] +Display helpful information about builtin commands. If +.I pattern +is specified, +.B help +gives detailed help on all commands matching +.IR pattern ; +otherwise help for all the builtins and shell control structures +is printed. +.RS +.PD 0 +.TP +.B \-d +Display a short description of each \fIpattern\fP +.TP +.B \-m +Display the description of each \fIpattern\fP in a manpage-like format +.TP +.B \-s +Display only a short usage synopsis for each \fIpattern\fP +.PD +.PP +The return status is 0 unless no command matches +.IR pattern . +.RE +.TP +\fBhistory [\fIn\fP] +.PD 0 +.TP +\fBhistory\fP \fB\-c\fP +.TP +\fBhistory \-d\fP \fIoffset\fP +.TP +\fBhistory\fP \fB\-anrw\fP [\fIfilename\fP] +.TP +\fBhistory\fP \fB\-p\fP \fIarg\fP [\fIarg ...\fP] +.TP +\fBhistory\fP \fB\-s\fP \fIarg\fP [\fIarg ...\fP] +.PD +With no options, display the command +history list with line numbers. Lines listed +with a +.B * +have been modified. An argument of +.I n +lists only the last +.I n +lines. +If the shell variable +.SM +.B HISTTIMEFORMAT +is set and not null, +it is used as a format string for \fIstrftime\fP(3) to display +the time stamp associated with each displayed history entry. +No intervening blank is printed between the formatted time stamp +and the history line. +If \fIfilename\fP is supplied, it is used as the +name of the history file; if not, the value of +.SM +.B HISTFILE +is used. Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-c +Clear the history list by deleting all the entries. +.TP +\fB\-d\fP \fIoffset\fP +Delete the history entry at position \fIoffset\fP. +.TP +.B \-a +Append the ``new'' history lines (history lines entered since the +beginning of the current \fBbash\fP session) to the history file. +.TP +.B \-n +Read the history lines not already read from the history +file into the current history list. These are lines +appended to the history file since the beginning of the +current \fBbash\fP session. +.TP +.B \-r +Read the contents of the history file +and append them to the current history list. +.TP +.B \-w +Write the current history list to the history file, overwriting the +history file's contents. +.TP +.B \-p +Perform history substitution on the following \fIargs\fP and display +the result on the standard output. +Does not store the results in the history list. +Each \fIarg\fP must be quoted to disable normal history expansion. +.TP +.B \-s +Store the +.I args +in the history list as a single entry. The last command in the +history list is removed before the +.I args +are added. +.PD +.PP +If the +.SM +.B HISTTIMEFORMAT +variable is set, the time stamp information +associated with each history entry is written to the history file, +marked with the history comment character. +When the history file is read, lines beginning with the history +comment character followed immediately by a digit are interpreted +as timestamps for the previous history line. +The return value is 0 unless an invalid option is encountered, an +error occurs while reading or writing the history file, an invalid +\fIoffset\fP is supplied as an argument to \fB\-d\fP, or the +history expansion supplied as an argument to \fB\-p\fP fails. +.RE +.TP +\fBjobs\fP [\fB\-lnprs\fP] [ \fIjobspec\fP ... ] +.PD 0 +.TP +\fBjobs\fP \fB\-x\fP \fIcommand\fP [ \fIargs\fP ... ] +.PD +The first form lists the active jobs. The options have the following +meanings: +.RS +.PD 0 +.TP +.B \-l +List process IDs +in addition to the normal information. +.TP +.B \-n +Display information only about jobs that have changed status since +the user was last notified of their status. +.TP +.B \-p +List only the process ID of the job's process group +leader. +.TP +.B \-r +Display only running jobs. +.TP +.B \-s +Display only stopped jobs. +.PD +.PP +If +.I jobspec +is given, output is restricted to information about that job. +The return status is 0 unless an invalid option is encountered +or an invalid +.I jobspec +is supplied. +.PP +If the +.B \-x +option is supplied, +.B jobs +replaces any +.I jobspec +found in +.I command +or +.I args +with the corresponding process group ID, and executes +.I command +passing it +.IR args , +returning its exit status. +.RE +.TP +\fBkill\fP [\fB\-s\fP \fIsigspec\fP | \fB\-n\fP \fIsignum\fP | \fB\-\fP\fIsigspec\fP] [\fIpid\fP | \fIjobspec\fP] ... +.PD 0 +.TP +\fBkill\fP \fB\-l\fP [\fIsigspec\fP | \fIexit_status\fP] +.PD +Send the signal named by +.I sigspec +or +.I signum +to the processes named by +.I pid +or +.IR jobspec . +.I sigspec +is either a case-insensitive signal name such as +.SM +.B SIGKILL +(with or without the +.SM +.B SIG +prefix) or a signal number; +.I signum +is a signal number. +If +.I sigspec +is not present, then +.SM +.B SIGTERM +is assumed. +An argument of +.B \-l +lists the signal names. +If any arguments are supplied when +.B \-l +is given, the names of the signals corresponding to the arguments are +listed, and the return status is 0. +The \fIexit_status\fP argument to +.B \-l +is a number specifying either a signal number or the exit status of +a process terminated by a signal. +.B kill +returns true if at least one signal was successfully sent, or false +if an error occurs or an invalid option is encountered. +.TP +\fBlet\fP \fIarg\fP [\fIarg\fP ...] +Each +.I arg +is an arithmetic expression to be evaluated (see +.SM +.B "ARITHMETIC EVALUATION" +above). +If the last +.I arg +evaluates to 0, +.B let +returns 1; 0 is returned otherwise. +.TP +\fBlocal\fP [\fIoption\fP] [\fIname\fP[=\fIvalue\fP] ...] +For each argument, a local variable named +.I name +is created, and assigned +.IR value . +The \fIoption\fP can be any of the options accepted by \fBdeclare\fP. +When +.B local +is used within a function, it causes the variable +.I name +to have a visible scope restricted to that function and its children. +With no operands, +.B local +writes a list of local variables to the standard output. It is +an error to use +.B local +when not within a function. The return status is 0 unless +.B local +is used outside a function, an invalid +.I name +is supplied, or +\fIname\fP is a readonly variable. +.TP +.B logout +Exit a login shell. +.TP +\fBmapfile\fP [\fB\-n\fP \fIcount\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-s\fP \fIcount\fP] [\fB\-t\fP] [\fB\-u\fP \fIfd\fP] [\fB\-C\fP \fIcallback\fP] [\fB\-c\fP \fIquantum\fP] [\fIarray\fP] +.PD 0 +.TP +\fBreadarray\fP [\fB\-n\fP \fIcount\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-s\fP \fIcount\fP] [\fB\-t\fP] [\fB\-u\fP \fIfd\fP] [\fB\-C\fP \fIcallback\fP] [\fB\-c\fP \fIquantum\fP] [\fIarray\fP] +.PD +Read lines from the standard input into the indexed array variable +.IR array , +or from file descriptor +.IR fd +if the +.B \-u +option is supplied. +The variable +.SM +.B MAPFILE +is the default \fIarray\fP. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Copy at most +.I count +lines. If \fIcount\fP is 0, all lines are copied. +.TP +.B \-O +Begin assigning to +.I array +at index +.IR origin . +The default index is 0. +.TP +.B \-s +Discard the first \fIcount\fP lines read. +.TP +.B \-t +Remove a trailing newline from each line read. +.TP +.B \-u +Read lines from file descriptor \fIfd\fP instead of the standard input. +.TP +.B \-C +Evaluate +.I callback +each time \fIquantum\fP lines are read. The \fB\-c\fP option specifies +.IR quantum . +.TP +.B \-c +Specify the number of lines read between each call to +.IR callback . +.PD +.PP +If +.B \-C +is specified without +.BR \-c , +the default quantum is 5000. +When \fIcallback\fP is evaluated, it is supplied the index of the next +array element to be assigned and the line to be assigned to that element +as additional arguments. +\fIcallback\fP is evaluated after the line is read but before the +array element is assigned. +.PP +If not supplied with an explicit origin, \fBmapfile\fP will clear \fIarray\fP +before assigning to it. +.PP +\fBmapfile\fP returns successfully unless an invalid option or option +argument is supplied, \fIarray\fP is invalid or unassignable, or if +\fIarray\fP is not an indexed array. +.RE +.TP +\fBpopd\fP [\-\fBn\fP] [+\fIn\fP] [\-\fIn\fP] +Removes entries from the directory stack. With no arguments, +removes the top directory from the stack, and performs a +.B cd +to the new top directory. +Arguments, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Suppresses the normal change of directory when removing directories +from the stack, so that only the stack is manipulated. +.TP +\fB+\fP\fIn\fP +Removes the \fIn\fPth entry counting from the left of the list +shown by +.BR dirs , +starting with zero. For example: +.if n ``popd +0'' +.if t \f(CWpopd +0\fP +removes the first directory, +.if n ``popd +1'' +.if t \f(CWpopd +1\fP +the second. +.TP +\fB\-\fP\fIn\fP +Removes the \fIn\fPth entry counting from the right of the list +shown by +.BR dirs , +starting with zero. For example: +.if n ``popd -0'' +.if t \f(CWpopd -0\fP +removes the last directory, +.if n ``popd -1'' +.if t \f(CWpopd -1\fP +the next to last. +.PD +.PP +If the +.B popd +command is successful, a +.B dirs +is performed as well, and the return status is 0. +.B popd +returns false if an invalid option is encountered, the directory stack +is empty, a non-existent directory stack entry is specified, or the +directory change fails. +.RE +.TP +\fBprintf\fP [\fB\-v\fP \fIvar\fP] \fIformat\fP [\fIarguments\fP] +Write the formatted \fIarguments\fP to the standard output under the +control of the \fIformat\fP. +The \fB\-v\fP option causes the output to be assigned to the variable +\fIvar\fP rather than being printed to the standard output. +.sp 1 +The \fIformat\fP is a character string which contains three types of objects: +plain characters, which are simply copied to standard output, character +escape sequences, which are converted and copied to the standard output, and +format specifications, each of which causes printing of the next successive +\fIargument\fP. +In addition to the standard \fIprintf\fP(1) format specifications, +\fBprintf\fP interprets the following extensions: +.RS +.PD 0 +.TP +.B %b +causes +\fBprintf\fP to expand backslash escape sequences in the corresponding +\fIargument\fP (except that \fB\ec\fP terminates output, backslashes in +\fB\e\(aq\fP, \fB\e"\fP, and \fB\e?\fP are not removed, and octal escapes +beginning with \fB\e0\fP may contain up to four digits). +.TP +.B %q +causes \fBprintf\fP to output the corresponding +\fIargument\fP in a format that can be reused as shell input. +.TP +.B %(\fIdatefmt\fP)T +causes \fBprintf\fP to output the date-time string resulting from using +\fIdatefmt\fP as a format string for \fIstrftime\fP(3). +The corresponding \fIargument\fP is an integer representing the number of +seconds since the epoch. +Two special argument values may be used: -1 represents the current +time, and -2 represents the time the shell was invoked. +If no argument is specified, conversion behaves as if -1 had been given. +This is an exception to the usual \fBprintf\fP behavior. +.PD +.PP +Arguments to non-string format specifiers are treated as C constants, +except that a leading plus or minus sign is allowed, and if the leading +character is a single or double quote, the value is the ASCII value of +the following character. +.PP +The \fIformat\fP is reused as necessary to consume all of the \fIarguments\fP. +If the \fIformat\fP requires more \fIarguments\fP than are supplied, the +extra format specifications behave as if a zero value or null string, as +appropriate, had been supplied. +The return value is zero on success, non-zero on failure. +.RE +.TP +\fBpushd\fP [\fB\-n\fP] [+\fIn\fP] [\-\fIn\fP] +.PD 0 +.TP +\fBpushd\fP [\fB\-n\fP] [\fIdir\fP] +.PD +Adds a directory to the top of the directory stack, or rotates +the stack, making the new top of the stack the current working +directory. With no arguments, exchanges the top two directories +and returns 0, unless the directory stack is empty. +Arguments, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Suppresses the normal change of directory when adding directories +to the stack, so that only the stack is manipulated. +.TP +\fB+\fP\fIn\fP +Rotates the stack so that the \fIn\fPth directory +(counting from the left of the list shown by +.BR dirs , +starting with zero) +is at the top. +.TP +\fB\-\fP\fIn\fP +Rotates the stack so that the \fIn\fPth directory +(counting from the right of the list shown by +.BR dirs , +starting with zero) is at the top. +.TP +.I dir +Adds +.I dir +to the directory stack at the top, making it the +new current working directory as if it had been supplied as the argument +to the \fBcd\fP builtin. +.PD +.PP +If the +.B pushd +command is successful, a +.B dirs +is performed as well. +If the first form is used, +.B pushd +returns 0 unless the cd to +.I dir +fails. With the second form, +.B pushd +returns 0 unless the directory stack is empty, +a non-existent directory stack element is specified, +or the directory change to the specified new current directory +fails. +.RE +.TP +\fBpwd\fP [\fB\-LP\fP] +Print the absolute pathname of the current working directory. +The pathname printed contains no symbolic links if the +.B \-P +option is supplied or the +.B \-o physical +option to the +.B set +builtin command is enabled. +If the +.B \-L +option is used, the pathname printed may contain symbolic links. +The return status is 0 unless an error occurs while +reading the name of the current directory or an +invalid option is supplied. +.TP +\fBread\fP [\fB\-ers\fP] [\fB\-a\fP \fIaname\fP] [\fB\-d\fP \fIdelim\fP] [\fB\-i\fP \fItext\fP] [\fB\-n\fP \fInchars\fP] [\fB\-N\fP \fInchars\fP] [\fB\-p\fP \fIprompt\fP] [\fB\-t\fP \fItimeout\fP] [\fB\-u\fP \fIfd\fP] [\fIname\fP ...] +One line is read from the standard input, or from the file descriptor +\fIfd\fP supplied as an argument to the \fB\-u\fP option, and the first word +is assigned to the first +.IR name , +the second word to the second +.IR name , +and so on, with leftover words and their intervening separators assigned +to the last +.IR name . +If there are fewer words read from the input stream than names, +the remaining names are assigned empty values. +The characters in +.SM +.B IFS +are used to split the line into words using the same rules the shell +uses for expansion (described above under \fBWord Splitting\fP). +The backslash character (\fB\e\fP) may be used to remove any special +meaning for the next character read and for line continuation. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-a \fIaname\fP +The words are assigned to sequential indices +of the array variable +.IR aname , +starting at 0. +.I aname +is unset before any new values are assigned. +Other \fIname\fP arguments are ignored. +.TP +.B \-d \fIdelim\fP +The first character of \fIdelim\fP is used to terminate the input line, +rather than newline. +.TP +.B \-e +If the standard input +is coming from a terminal, +.B readline +(see +.SM +.B READLINE +above) is used to obtain the line. +Readline uses the current (or default, if line editing was not previously +active) editing settings. +.TP +.B \-i \fItext\fP +If +.B readline +is being used to read the line, \fItext\fP is placed into the editing +buffer before editing begins. +.TP +.B \-n \fInchars\fP +\fBread\fP returns after reading \fInchars\fP characters rather than +waiting for a complete line of input, but honor a delimiter if fewer +than \fInchars\fP characters are read before the delimiter. +.TP +.B \-N \fInchars\fP +\fBread\fP returns after reading exactly \fInchars\fP characters rather +than waiting for a complete line of input, unless EOF is encountered or +\fBread\fP times out. +Delimiter characters encountered in the input are +not treated specially and do not cause \fBread\fP to return until +\fInchars\fP characters are read. +.TP +.B \-p \fIprompt\fP +Display \fIprompt\fP on standard error, without a +trailing newline, before attempting to read any input. The prompt +is displayed only if input is coming from a terminal. +.TP +.B \-r +Backslash does not act as an escape character. +The backslash is considered to be part of the line. +In particular, a backslash-newline pair may not be used as a line +continuation. +.TP +.B \-s +Silent mode. If input is coming from a terminal, characters are +not echoed. +.TP +.B \-t \fItimeout\fP +Cause \fBread\fP to time out and return failure if a complete line of +input (or a specified number of characters) +is not read within \fItimeout\fP seconds. +\fItimeout\fP may be a decimal number with a fractional portion following +the decimal point. +This option is only effective if \fBread\fP is reading input from a +terminal, pipe, or other special file; it has no effect when reading +from regular files. +If \fBread\fP times out, \fBread\fP saves any partial input read into +the specified variable \fIname\fP. +If \fItimeout\fP is 0, \fBread\fP returns immediately, without trying to +read any data. The exit status is 0 if input is available on +the specified file descriptor, non-zero otherwise. +The exit status is greater than 128 if the timeout is exceeded. +.TP +.B \-u \fIfd\fP +Read input from file descriptor \fIfd\fP. +.PD +.PP +If no +.I names +are supplied, the line read is assigned to the variable +.SM +.BR REPLY . +The return code is zero, unless end-of-file is encountered, \fBread\fP +times out (in which case the return code is greater than 128), +a variable assignment error (such as assigning to a readonly variable) occurs, +or an invalid file descriptor is supplied as the argument to \fB\-u\fP. +.RE +.TP +\fBreadonly\fP [\fB\-aAf\fP] [\fB\-p\fP] [\fIname\fP[=\fIword\fP] ...] +.PD +The given +\fInames\fP are marked readonly; the values of these +.I names +may not be changed by subsequent assignment. +If the +.B \-f +option is supplied, the functions corresponding to the +\fInames\fP are so +marked. +The +.B \-a +option restricts the variables to indexed arrays; the +.B \-A +option restricts the variables to associative arrays. +If both options are supplied, +.B \-A +takes precedence. +If no +.I name +arguments are given, or if the +.B \-p +option is supplied, a list of all readonly names is printed. +The other options may be used to restrict the output to a subset of +the set of readonly names. +The +.B \-p +option causes output to be displayed in a format that +may be reused as input. +If a variable name is followed by =\fIword\fP, the value of +the variable is set to \fIword\fP. +The return status is 0 unless an invalid option is encountered, +one of the +.I names +is not a valid shell variable name, or +.B \-f +is supplied with a +.I name +that is not a function. +.TP +\fBreturn\fP [\fIn\fP] +Causes a function to stop executing and return the value specified by +.I n +to its caller. +If +.I n +is omitted, the return status is that of the last command +executed in the function body. If +.B return +is used outside a function, +but during execution of a script by the +.B . +(\fBsource\fP) command, it causes the shell to stop executing +that script and return either +.I n +or the exit status of the last command executed within the +script as the exit status of the script. +If \fIn\fP is supplied, the return value is its least significant +8 bits. +The return status is non-zero if +.B return +is supplied a non-numeric argument, or +is used outside a +function and not during execution of a script by \fB.\fP\^ or \fBsource\fP. +Any command associated with the \fBRETURN\fP trap is executed +before execution resumes after the function or script. +.TP +\fBset\fP [\fB\-\-abefhkmnptuvxBCEHPT\fP] [\fB\-o\fP \fIoption\-name\fP] [\fIarg\fP ...] +.PD 0 +.TP +\fBset\fP [\fB+abefhkmnptuvxBCEHPT\fP] [\fB+o\fP \fIoption\-name\fP] [\fIarg\fP ...] +.PD +Without options, the name and value of each shell variable are displayed +in a format that can be reused as input +for setting or resetting the currently-set variables. +Read-only variables cannot be reset. +In \fIposix\fP mode, only shell variables are listed. +The output is sorted according to the current locale. +When options are specified, they set or unset shell attributes. +Any arguments remaining after option processing are treated +as values for the positional parameters and are assigned, in order, to +.BR $1 , +.BR $2 , +.B ... +.BR $\fIn\fP . +Options, if specified, have the following meanings: +.RS +.PD 0 +.TP 8 +.B \-a +Automatically mark variables and functions which are modified or +created for export to the environment of subsequent commands. +.TP 8 +.B \-b +Report the status of terminated background jobs +immediately, rather than before the next primary prompt. This is +effective only when job control is enabled. +.TP 8 +.B \-e +Exit immediately if a +\fIpipeline\fP (which may consist of a single \fIsimple command\fP), +a \fIlist\fP, +or a \fIcompound command\fP +(see +.SM +.B SHELL GRAMMAR +above), exits with a non-zero status. +The shell does not exit if the +command that fails is part of the command list immediately following a +.B while +or +.B until +keyword, +part of the test following the +.B if +or +.B elif +reserved words, part of any command executed in a +.B && +or +.B || +list except the command following the final \fB&&\fP or \fB||\fP, +any command in a pipeline but the last, +or if the command's return value is +being inverted with +.BR ! . +If a compound command other than a subshell +returns a non-zero status because a command failed +while \fB\-e\fP was being ignored, the shell does not exit. +A trap on \fBERR\fP, if set, is executed before the shell exits. +This option applies to the shell environment and each subshell environment +separately (see +.SM +.B "COMMAND EXECUTION ENVIRONMENT" +above), and may cause +subshells to exit before executing all the commands in the subshell. +.if t .sp 0.5 +.if n .sp 1 +If a compound command or shell function executes in a context +where \fB\-e\fP is being ignored, +none of the commands executed within the compound command or function body +will be affected by the \fB\-e\fP setting, even if \fB\-e\fP is set +and a command returns a failure status. +If a compound command or shell function sets \fB\-e\fP while executing in +a context where \fB\-e\fP is ignored, that setting will not have any +effect until the compound command or the command containing the function +call completes. +.TP 8 +.B \-f +Disable pathname expansion. +.TP 8 +.B \-h +Remember the location of commands as they are looked up for execution. +This is enabled by default. +.TP 8 +.B \-k +All arguments in the form of assignment statements +are placed in the environment for a command, not just +those that precede the command name. +.TP 8 +.B \-m +Monitor mode. Job control is enabled. This option is on +by default for interactive shells on systems that support +it (see +.SM +.B JOB CONTROL +above). +All processes run in a separate process group. +When a background job completes, the shell prints a line +containing its exit status. +.TP 8 +.B \-n +Read commands but do not execute them. This may be used to +check a shell script for syntax errors. This is ignored by +interactive shells. +.TP 8 +.B \-o \fIoption\-name\fP +The \fIoption\-name\fP can be one of the following: +.RS +.TP 8 +.B allexport +Same as +.BR \-a . +.TP 8 +.B braceexpand +Same as +.BR \-B . +.TP 8 +.B emacs +Use an emacs-style command line editing interface. This is enabled +by default when the shell is interactive, unless the shell is started +with the +.B \-\-noediting +option. +This also affects the editing interface used for \fBread \-e\fP. +.TP 8 +.B errexit +Same as +.BR \-e . +.TP 8 +.B errtrace +Same as +.BR \-E . +.TP 8 +.B functrace +Same as +.BR \-T . +.TP 8 +.B hashall +Same as +.BR \-h . +.TP 8 +.B histexpand +Same as +.BR \-H . +.TP 8 +.B history +Enable command history, as described above under +.SM +.BR HISTORY . +This option is on by default in interactive shells. +.TP 8 +.B ignoreeof +The effect is as if the shell command +.if t \f(CWIGNOREEOF=10\fP +.if n ``IGNOREEOF=10'' +had been executed +(see +.B Shell Variables +above). +.TP 8 +.B keyword +Same as +.BR \-k . +.TP 8 +.B monitor +Same as +.BR \-m . +.TP 8 +.B noclobber +Same as +.BR \-C . +.TP 8 +.B noexec +Same as +.BR \-n . +.TP 8 +.B noglob +Same as +.BR \-f . +.TP 8 +.B nolog +Currently ignored. +.TP 8 +.B notify +Same as +.BR \-b . +.TP 8 +.B nounset +Same as +.BR \-u . +.TP 8 +.B onecmd +Same as +.BR \-t . +.TP 8 +.B physical +Same as +.BR \-P . +.TP 8 +.B pipefail +If set, the return value of a pipeline is the value of the last +(rightmost) command to exit with a non-zero status, or zero if all +commands in the pipeline exit successfully. +This option is disabled by default. +.TP 8 +.B posix +Change the behavior of +.B bash +where the default operation differs +from the POSIX standard to match the standard (\fIposix mode\fP). +See +.SM +.B "SEE ALSO" +below for a reference to a document that details how posix mode affects +bash's behavior. +.TP 8 +.B privileged +Same as +.BR \-p . +.TP 8 +.B verbose +Same as +.BR \-v . +.TP 8 +.B vi +Use a vi-style command line editing interface. +This also affects the editing interface used for \fBread \-e\fP. +.TP 8 +.B xtrace +Same as +.BR \-x . +.sp .5 +.PP +If +.B \-o +is supplied with no \fIoption\-name\fP, the values of the current options are +printed. +If +.B +o +is supplied with no \fIoption\-name\fP, a series of +.B set +commands to recreate the current option settings is displayed on +the standard output. +.RE +.TP 8 +.B \-p +Turn on +.I privileged +mode. In this mode, the +.SM +.B $ENV +and +.SM +.B $BASH_ENV +files are not processed, shell functions are not inherited from the +environment, and the +.SM +.BR SHELLOPTS , +.SM +.BR BASHOPTS , +.SM +.BR CDPATH , +and +.SM +.B GLOBIGNORE +variables, if they appear in the environment, are ignored. +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the \fB\-p\fP option is not supplied, these actions +are taken and the effective user id is set to the real user id. +If the \fB\-p\fP option is supplied at startup, the effective user id is +not reset. +Turning this option off causes the effective user +and group ids to be set to the real user and group ids. +.TP 8 +.B \-t +Exit after reading and executing one command. +.TP 8 +.B \-u +Treat unset variables and parameters other than the special +parameters "@" and "*" as an error when performing +parameter expansion. If expansion is attempted on an +unset variable or parameter, the shell prints an error message, and, +if not interactive, exits with a non-zero status. +.TP 8 +.B \-v +Print shell input lines as they are read. +.TP 8 +.B \-x +After expanding each \fIsimple command\fP, +\fBfor\fP command, \fBcase\fP command, \fBselect\fP command, or +arithmetic \fBfor\fP command, display the expanded value of +.SM +.BR PS4 , +followed by the command and its expanded arguments +or associated word list. +.TP 8 +.B \-B +The shell performs brace expansion (see +.B Brace Expansion +above). This is on by default. +.TP 8 +.B \-C +If set, +.B bash +does not overwrite an existing file with the +.BR > , +.BR >& , +and +.B <> +redirection operators. This may be overridden when +creating output files by using the redirection operator +.B >| +instead of +.BR > . +.TP 8 +.B \-E +If set, any trap on \fBERR\fP is inherited by shell functions, command +substitutions, and commands executed in a subshell environment. +The \fBERR\fP trap is normally not inherited in such cases. +.TP 8 +.B \-H +Enable +.B ! +style history substitution. This option is on by +default when the shell is interactive. +.TP 8 +.B \-P +If set, the shell does not resolve symbolic links when executing +commands such as +.B cd +that change the current working directory. It uses the +physical directory structure instead. By default, +.B bash +follows the logical chain of directories when performing commands +which change the current directory. +.TP 8 +.B \-T +If set, any traps on \fBDEBUG\fP and \fBRETURN\fP are inherited by shell +functions, command substitutions, and commands executed in a +subshell environment. +The \fBDEBUG\fP and \fBRETURN\fP traps are normally not inherited +in such cases. +.TP 8 +.B \-\- +If no arguments follow this option, then the positional parameters are +unset. Otherwise, the positional parameters are set to the +\fIarg\fPs, even if some of them begin with a +.BR \- . +.TP 8 +.B \- +Signal the end of options, cause all remaining \fIarg\fPs to be +assigned to the positional parameters. The +.B \-x +and +.B \-v +options are turned off. +If there are no \fIarg\fPs, +the positional parameters remain unchanged. +.PD +.PP +The options are off by default unless otherwise noted. +Using + rather than \- causes these options to be turned off. +The options can also be specified as arguments to an invocation of +the shell. +The current set of options may be found in +.BR $\- . +The return status is always true unless an invalid option is encountered. +.RE +.TP +\fBshift\fP [\fIn\fP] +The positional parameters from \fIn\fP+1 ... are renamed to +.B $1 +.B .... +Parameters represented by the numbers \fB$#\fP +down to \fB$#\fP\-\fIn\fP+1 are unset. +.I n +must be a non-negative number less than or equal to \fB$#\fP. +If +.I n +is 0, no parameters are changed. +If +.I n +is not given, it is assumed to be 1. +If +.I n +is greater than \fB$#\fP, the positional parameters are not changed. +The return status is greater than zero if +.I n +is greater than +.B $# +or less than zero; otherwise 0. +.TP +\fBshopt\fP [\fB\-pqsu\fP] [\fB\-o\fP] [\fIoptname\fP ...] +Toggle the values of settings controlling optional shell behavior. +The settings can be either those listed below, or, if the +.B \-o +option is used, those available with the +.B \-o +option to the \fBset\fP builtin command. +With no options, or with the +.B \-p +option, a list of all settable options is displayed, with +an indication of whether or not each is set. +The \fB\-p\fP option causes output to be displayed in a form that +may be reused as input. +Other options have the following meanings: +.RS +.PD 0 +.TP +.B \-s +Enable (set) each \fIoptname\fP. +.TP +.B \-u +Disable (unset) each \fIoptname\fP. +.TP +.B \-q +Suppresses normal output (quiet mode); the return status indicates +whether the \fIoptname\fP is set or unset. +If multiple \fIoptname\fP arguments are given with +.BR \-q , +the return status is zero if all \fIoptnames\fP are enabled; non-zero +otherwise. +.TP +.B \-o +Restricts the values of \fIoptname\fP to be those defined for the +.B \-o +option to the +.B set +builtin. +.PD +.PP +If either +.B \-s +or +.B \-u +is used with no \fIoptname\fP arguments, +.B shopt +shows only those options which are set or unset, respectively. +Unless otherwise noted, the \fBshopt\fP options are disabled (unset) +by default. +.PP +The return status when listing options is zero if all \fIoptnames\fP +are enabled, non-zero otherwise. When setting or unsetting options, +the return status is zero unless an \fIoptname\fP is not a valid shell +option. +.PP +The list of \fBshopt\fP options is: +.if t .sp .5v +.if n .sp 1v +.PD 0 +.TP 8 +.B autocd +If set, a command name that is the name of a directory is executed as if +it were the argument to the \fBcd\fP command. +This option is only used by interactive shells. +.TP 8 +.B cdable_vars +If set, an argument to the +.B cd +builtin command that +is not a directory is assumed to be the name of a variable whose +value is the directory to change to. +.TP 8 +.B cdspell +If set, minor errors in the spelling of a directory component in a +.B cd +command will be corrected. +The errors checked for are transposed characters, +a missing character, and one character too many. +If a correction is found, the corrected filename is printed, +and the command proceeds. +This option is only used by interactive shells. +.TP 8 +.B checkhash +If set, \fBbash\fP checks that a command found in the hash +table exists before trying to execute it. If a hashed command no +longer exists, a normal path search is performed. +.TP 8 +.B checkjobs +If set, \fBbash\fP lists the status of any stopped and running jobs before +exiting an interactive shell. If any jobs are running, this causes +the exit to be deferred until a second exit is attempted without an +intervening command (see +.SM +.B "JOB CONTROL" +above). The shell always +postpones exiting if any jobs are stopped. +.TP 8 +.B checkwinsize +If set, \fBbash\fP checks the window size after each command +and, if necessary, updates the values of +.SM +.B LINES +and +.SM +.BR COLUMNS . +.TP 8 +.B cmdhist +If set, +.B bash +attempts to save all lines of a multiple-line +command in the same history entry. This allows +easy re-editing of multi-line commands. +.TP 8 +.B compat31 +If set, +.B bash +changes its behavior to that of version 3.1 with respect to quoted +arguments to the \fB[[\fP conditional command's \fB=~\fP operator +and locale-specific string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators. +Bash versions prior to bash-4.1 use ASCII collation and +.IR strcmp (3); +bash-4.1 and later use the current locale's collation sequence and +.IR strcoll (3). +.TP 8 +.B compat32 +If set, +.B bash +changes its behavior to that of version 3.2 with respect to +locale-specific string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators (see previous item). +.TP 8 +.B compat40 +If set, +.B bash +changes its behavior to that of version 4.0 with respect to locale-specific +string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators (see description of +\fBcompat31\fP) +and the effect of interrupting a command list. +Bash versions 4.0 and later interrupt the list as if the shell received the +interrupt; previous versions continue with the next command in the list. +.TP 8 +.B compat41 +If set, +.BR bash , +when in \fIposix\fP mode, treats a single quote in a double-quoted +parameter expansion as a special character. The single quotes must match +(an even number) and the characters between the single quotes are considered +quoted. This is the behavior of posix mode through version 4.1. +The default bash behavior remains as in previous versions. +.TP 8 +.B compat42 +If set, +.B bash +does not process the replacement string in the pattern substitution word +expansion using quote removal. +.TP 8 +.B complete_fullquote +If set, +.B bash +quotes all shell metacharacters in filenames and directory names when +performing completion. +If not set, +.B bash +removes metacharacters such as the dollar sign from the set of +characters that will be quoted in completed filenames +when these metacharacters appear in shell variable references in words to be +completed. +This means that dollar signs in variable names that expand to directories +will not be quoted; +however, any dollar signs appearing in filenames will not be quoted, either. +This is active only when bash is using backslashes to quote completed +filenames. +This variable is set by default, which is the default bash behavior in +versions through 4.2. +.TP 8 +.B direxpand +If set, +.B bash +replaces directory names with the results of word expansion when performing +filename completion. This changes the contents of the readline editing +buffer. +If not set, +.B bash +attempts to preserve what the user typed. +.TP 8 +.B dirspell +If set, +.B bash +attempts spelling correction on directory names during word completion +if the directory name initially supplied does not exist. +.TP 8 +.B dotglob +If set, +.B bash +includes filenames beginning with a `.' in the results of pathname +expansion. +.TP 8 +.B execfail +If set, a non-interactive shell will not exit if +it cannot execute the file specified as an argument to the +.B exec +builtin command. An interactive shell does not exit if +.B exec +fails. +.TP 8 +.B expand_aliases +If set, aliases are expanded as described above under +.SM +.BR ALIASES . +This option is enabled by default for interactive shells. +.TP 8 +.B extdebug +If set, behavior intended for use by debuggers is enabled: +.RS +.TP +.B 1. +The \fB\-F\fP option to the \fBdeclare\fP builtin displays the source +file name and line number corresponding to each function name supplied +as an argument. +.TP +.B 2. +If the command run by the \fBDEBUG\fP trap returns a non-zero value, the +next command is skipped and not executed. +.TP +.B 3. +If the command run by the \fBDEBUG\fP trap returns a value of 2, and the +shell is executing in a subroutine (a shell function or a shell script +executed by the \fB.\fP or \fBsource\fP builtins), a call to +\fBreturn\fP is simulated. +.TP +.B 4. +.SM +.B BASH_ARGC +and +.SM +.B BASH_ARGV +are updated as described in their descriptions above. +.TP +.B 5. +Function tracing is enabled: command substitution, shell functions, and +subshells invoked with \fB(\fP \fIcommand\fP \fB)\fP inherit the +\fBDEBUG\fP and \fBRETURN\fP traps. +.TP +.B 6. +Error tracing is enabled: command substitution, shell functions, and +subshells invoked with \fB(\fP \fIcommand\fP \fB)\fP inherit the +\fBERR\fP trap. +.RE +.TP 8 +.B extglob +If set, the extended pattern matching features described above under +\fBPathname Expansion\fP are enabled. +.TP 8 +.B extquote +If set, \fB$\fP\(aq\fIstring\fP\(aq and \fB$\fP"\fIstring\fP" quoting is +performed within \fB${\fP\fIparameter\fP\fB}\fP expansions +enclosed in double quotes. This option is enabled by default. +.TP 8 +.B failglob +If set, patterns which fail to match filenames during pathname expansion +result in an expansion error. +.TP 8 +.B force_fignore +If set, the suffixes specified by the +.SM +.B FIGNORE +shell variable +cause words to be ignored when performing word completion even if +the ignored words are the only possible completions. +See +.SM +\fBSHELL VARIABLES\fP +above for a description of +.SM +.BR FIGNORE . +This option is enabled by default. +.TP 8 +.B globasciiranges +If set, range expressions used in pattern matching bracket expressions (see +.SM +.B Pattern Matching +above) behave as if in the traditional C locale when performing +comparisons. That is, the current locale's collating sequence +is not taken into account, so +.B b +will not collate between +.B A +and +.BR B , +and upper-case and lower-case ASCII characters will collate together. +.TP 8 +.B globstar +If set, the pattern \fB**\fP used in a pathname expansion context will +match all files and zero or more directories and subdirectories. +If the pattern is followed by a \fB/\fP, only directories and +subdirectories match. +.TP 8 +.B gnu_errfmt +If set, shell error messages are written in the standard GNU error +message format. +.TP 8 +.B histappend +If set, the history list is appended to the file named by the value +of the +.SM +.B HISTFILE +variable when the shell exits, rather than overwriting the file. +.TP 8 +.B histreedit +If set, and +.B readline +is being used, a user is given the opportunity to re-edit a +failed history substitution. +.TP 8 +.B histverify +If set, and +.B readline +is being used, the results of history substitution are not immediately +passed to the shell parser. Instead, the resulting line is loaded into +the \fBreadline\fP editing buffer, allowing further modification. +.TP 8 +.B hostcomplete +If set, and +.B readline +is being used, \fBbash\fP will attempt to perform hostname completion when a +word containing a \fB@\fP is being completed (see +.B Completing +under +.SM +.B READLINE +above). +This is enabled by default. +.TP 8 +.B huponexit +If set, \fBbash\fP will send +.SM +.B SIGHUP +to all jobs when an interactive login shell exits. +.TP 8 +.B interactive_comments +If set, allow a word beginning with +.B # +to cause that word and all remaining characters on that +line to be ignored in an interactive shell (see +.SM +.B COMMENTS +above). This option is enabled by default. +.TP 8 +.B lastpipe +If set, and job control is not active, the shell runs the last command of +a pipeline not executed in the background in the current shell environment. +.TP 8 +.B lithist +If set, and the +.B cmdhist +option is enabled, multi-line commands are saved to the history with +embedded newlines rather than using semicolon separators where possible. +.TP 8 +.B login_shell +The shell sets this option if it is started as a login shell (see +.SM +.B "INVOCATION" +above). +The value may not be changed. +.TP 8 +.B mailwarn +If set, and a file that \fBbash\fP is checking for mail has been +accessed since the last time it was checked, the message ``The mail in +\fImailfile\fP has been read'' is displayed. +.TP 8 +.B no_empty_cmd_completion +If set, and +.B readline +is being used, +.B bash +will not attempt to search the +.SM +.B PATH +for possible completions when +completion is attempted on an empty line. +.TP 8 +.B nocaseglob +If set, +.B bash +matches filenames in a case\-insensitive fashion when performing pathname +expansion (see +.B Pathname Expansion +above). +.TP 8 +.B nocasematch +If set, +.B bash +matches patterns in a case\-insensitive fashion when performing matching +while executing \fBcase\fP or \fB[[\fP conditional commands. +.TP 8 +.B nullglob +If set, +.B bash +allows patterns which match no +files (see +.B Pathname Expansion +above) +to expand to a null string, rather than themselves. +.TP 8 +.B progcomp +If set, the programmable completion facilities (see +\fBProgrammable Completion\fP above) are enabled. +This option is enabled by default. +.TP 8 +.B promptvars +If set, prompt strings undergo +parameter expansion, command substitution, arithmetic +expansion, and quote removal after being expanded as described in +.SM +.B PROMPTING +above. This option is enabled by default. +.TP 8 +.B restricted_shell +The shell sets this option if it is started in restricted mode (see +.SM +.B "RESTRICTED SHELL" +below). +The value may not be changed. +This is not reset when the startup files are executed, allowing +the startup files to discover whether or not a shell is restricted. +.TP 8 +.B shift_verbose +If set, the +.B shift +builtin prints an error message when the shift count exceeds the +number of positional parameters. +.TP 8 +.B sourcepath +If set, the +\fBsource\fP (\fB.\fP) builtin uses the value of +.SM +.B PATH +to find the directory containing the file supplied as an argument. +This option is enabled by default. +.TP 8 +.B xpg_echo +If set, the \fBecho\fP builtin expands backslash-escape sequences +by default. +.RE +.PD +.TP +\fBsuspend\fP [\fB\-f\fP] +Suspend the execution of this shell until it receives a +.SM +.B SIGCONT +signal. A login shell cannot be suspended; the +.B \-f +option can be used to override this and force the suspension. +The return status is 0 unless the shell is a login shell and +.B \-f +is not supplied, or if job control is not enabled. +.TP +\fBtest\fP \fIexpr\fP +.PD 0 +.TP +\fB[\fP \fIexpr\fP \fB]\fP +Return a status of 0 (true) or 1 (false) depending on +the evaluation of the conditional expression +.IR expr . +Each operator and operand must be a separate argument. +Expressions are composed of the primaries described above under +.SM +.BR "CONDITIONAL EXPRESSIONS" . +\fBtest\fP does not accept any options, nor does it accept and ignore +an argument of \fB\-\-\fP as signifying the end of options. +.if t .sp 0.5 +.if n .sp 1 +Expressions may be combined using the following operators, listed +in decreasing order of precedence. +The evaluation depends on the number of arguments; see below. +Operator precedence is used when there are five or more arguments. +.RS +.PD 0 +.TP +.B ! \fIexpr\fP +True if +.I expr +is false. +.TP +.B ( \fIexpr\fP ) +Returns the value of \fIexpr\fP. +This may be used to override the normal precedence of operators. +.TP +\fIexpr1\fP \-\fBa\fP \fIexpr2\fP +True if both +.I expr1 +and +.I expr2 +are true. +.TP +\fIexpr1\fP \-\fBo\fP \fIexpr2\fP +True if either +.I expr1 +or +.I expr2 +is true. +.PD +.PP +\fBtest\fP and \fB[\fP evaluate conditional +expressions using a set of rules based on the number of arguments. +.if t .sp 0.5 +.if n .sp 1 +.PD 0 +.TP +0 arguments +The expression is false. +.TP +1 argument +The expression is true if and only if the argument is not null. +.TP +2 arguments +If the first argument is \fB!\fP, the expression is true if and +only if the second argument is null. +If the first argument is one of the unary conditional operators listed above +under +.SM +.BR "CONDITIONAL EXPRESSIONS" , +the expression is true if the unary test is true. +If the first argument is not a valid unary conditional operator, the expression +is false. +.TP +3 arguments +The following conditions are applied in the order listed. +If the second argument is one of the binary conditional operators listed above +under +.SM +.BR "CONDITIONAL EXPRESSIONS" , +the result of the expression is the result of the binary test using +the first and third arguments as operands. +The \fB\-a\fP and \fB\-o\fP operators are considered binary operators +when there are three arguments. +If the first argument is \fB!\fP, the value is the negation of +the two-argument test using the second and third arguments. +If the first argument is exactly \fB(\fP and the third argument is +exactly \fB)\fP, the result is the one-argument test of the second +argument. +Otherwise, the expression is false. +.TP +4 arguments +If the first argument is \fB!\fP, the result is the negation of +the three-argument expression composed of the remaining arguments. +Otherwise, the expression is parsed and evaluated according to +precedence using the rules listed above. +.TP +5 or more arguments +The expression is parsed and evaluated according to precedence +using the rules listed above. +.if t .sp 0.5 +.if n .sp 1 +.LP +When used with \fBtest\fP or \fB[\fP, the \fB<\fP and \fB>\fP operators +sort lexicographically using ASCII ordering. +.RE +.PD +.TP +.B times +Print the accumulated user and system times for the shell and +for processes run from the shell. The return status is 0. +.TP +\fBtrap\fP [\fB\-lp\fP] [[\fIarg\fP] \fIsigspec\fP ...] +The command +.I arg +is to be read and executed when the shell receives +signal(s) +.IR sigspec . +If +.I arg +is absent (and there is a single \fIsigspec\fP) or +.BR \- , +each specified signal is +reset to its original disposition (the value it had +upon entrance to the shell). +If +.I arg +is the null string the signal specified by each +.I sigspec +is ignored by the shell and by the commands it invokes. +If +.I arg +is not present and +.B \-p +has been supplied, then the trap commands associated with each +.I sigspec +are displayed. +If no arguments are supplied or if only +.B \-p +is given, +.B trap +prints the list of commands associated with each signal. +The +.B \-l +option causes the shell to print a list of signal names and +their corresponding numbers. +Each +.I sigspec +is either +a signal name defined in <\fIsignal.h\fP>, or a signal number. +Signal names are case insensitive and the +.SM +.B SIG +prefix is optional. +.if t .sp 0.5 +.if n .sp 1 +If a +.I sigspec +is +.SM +.B EXIT +(0) the command +.I arg +is executed on exit from the shell. +If a +.I sigspec +is +.SM +.BR DEBUG , +the command +.I arg +is executed before every \fIsimple command\fP, \fIfor\fP command, +\fIcase\fP command, \fIselect\fP command, every arithmetic \fIfor\fP +command, and before the first command executes in a shell function (see +.SM +.B SHELL GRAMMAR +above). +Refer to the description of the \fBextdebug\fP option to the +\fBshopt\fP builtin for details of its effect on the \fBDEBUG\fP trap. +If a +.I sigspec +is +.SM +.BR RETURN , +the command +.I arg +is executed each time a shell function or a script executed with +the \fB.\fP or \fBsource\fP builtins finishes executing. +.if t .sp 0.5 +.if n .sp 1 +If a +.I sigspec +is +.SM +.BR ERR , +the command +.I arg +is executed whenever a +a pipeline (which may consist of a single simple +command), a list, or a compound command returns a +non\-zero exit status, +subject to the following conditions. +The +.SM +.B ERR +trap is not executed if the failed +command is part of the command list immediately following a +.B while +or +.B until +keyword, +part of the test in an +.I if +statement, part of a command executed in a +.B && +or +.B || +list except the command following the final \fB&&\fP or \fB||\fP, +any command in a pipeline but the last, +or if the command's return value is +being inverted using +.BR ! . +These are the same conditions obeyed by the \fBerrexit\fP (\fB\-e\fP) option. +.if t .sp 0.5 +.if n .sp 1 +Signals ignored upon entry to the shell cannot be trapped or reset. +Trapped signals that are not being ignored are reset to their original +values in a subshell or subshell environment when one is created. +The return status is false if any +.I sigspec +is invalid; otherwise +.B trap +returns true. +.TP +\fBtype\fP [\fB\-aftpP\fP] \fIname\fP [\fIname\fP ...] +With no options, +indicate how each +.I name +would be interpreted if used as a command name. +If the +.B \-t +option is used, +.B type +prints a string which is one of +.IR alias , +.IR keyword , +.IR function , +.IR builtin , +or +.I file +if +.I name +is an alias, shell reserved word, function, builtin, or disk file, +respectively. +If the +.I name +is not found, then nothing is printed, and an exit status of false +is returned. +If the +.B \-p +option is used, +.B type +either returns the name of the disk file +that would be executed if +.I name +were specified as a command name, +or nothing if +.if t \f(CWtype -t name\fP +.if n ``type -t name'' +would not return +.IR file . +The +.B \-P +option forces a +.SM +.B PATH +search for each \fIname\fP, even if +.if t \f(CWtype -t name\fP +.if n ``type -t name'' +would not return +.IR file . +If a command is hashed, +.B \-p +and +.B \-P +print the hashed value, which is not necessarily the file that appears +first in +.SM +.BR PATH . +If the +.B \-a +option is used, +.B type +prints all of the places that contain +an executable named +.IR name . +This includes aliases and functions, +if and only if the +.B \-p +option is not also used. +The table of hashed commands is not consulted +when using +.BR \-a . +The +.B \-f +option suppresses shell function lookup, as with the \fBcommand\fP builtin. +.B type +returns true if all of the arguments are found, false if +any are not found. +.TP +\fBulimit\fP [\fB\-HSTabcdefilmnpqrstuvx\fP [\fIlimit\fP]] +Provides control over the resources available to the shell and to +processes started by it, on systems that allow such control. +The \fB\-H\fP and \fB\-S\fP options specify that the hard or soft limit is +set for the given resource. +A hard limit cannot be increased by a non-root user once it is set; +a soft limit may be increased up to the value of the hard limit. +If neither \fB\-H\fP nor \fB\-S\fP is specified, both the soft and hard +limits are set. +The value of +.I limit +can be a number in the unit specified for the resource +or one of the special values +.BR hard , +.BR soft , +or +.BR unlimited , +which stand for the current hard limit, the current soft limit, and +no limit, respectively. +If +.I limit +is omitted, the current value of the soft limit of the resource is +printed, unless the \fB\-H\fP option is given. When more than one +resource is specified, the limit name and unit are printed before the value. +Other options are interpreted as follows: +.RS +.PD 0 +.TP +.B \-a +All current limits are reported +.TP +.B \-b +The maximum socket buffer size +.TP +.B \-c +The maximum size of core files created +.TP +.B \-d +The maximum size of a process's data segment +.TP +.B \-e +The maximum scheduling priority ("nice") +.TP +.B \-f +The maximum size of files written by the shell and its children +.TP +.B \-i +The maximum number of pending signals +.TP +.B \-l +The maximum size that may be locked into memory +.TP +.B \-m +The maximum resident set size (many systems do not honor this limit) +.TP +.B \-n +The maximum number of open file descriptors (most systems do not +allow this value to be set) +.TP +.B \-p +The pipe size in 512-byte blocks (this may not be set) +.TP +.B \-q +The maximum number of bytes in POSIX message queues +.TP +.B \-r +The maximum real-time scheduling priority +.TP +.B \-s +The maximum stack size +.TP +.B \-t +The maximum amount of cpu time in seconds +.TP +.B \-u +The maximum number of processes available to a single user +.TP +.B \-v +The maximum amount of virtual memory available to the shell and, on +some systems, to its children +.TP +.B \-x +The maximum number of file locks +.TP +.B \-T +The maximum number of threads +.PD +.PP +If +.I limit +is given, and the +.B \-a +option is not used, +\fIlimit\fP is the new value of the specified resource. +If no option is given, then +.B \-f +is assumed. Values are in 1024-byte increments, except for +.BR \-t , +which is in seconds; +.BR \-p , +which is in units of 512-byte blocks; +and +.BR \-T , +.BR \-b , +.BR \-n , +and +.BR \-u , +which are unscaled values. +The return status is 0 unless an invalid option or argument is supplied, +or an error occurs while setting a new limit. +.RE +.TP +\fBumask\fP [\fB\-p\fP] [\fB\-S\fP] [\fImode\fP] +The user file-creation mask is set to +.IR mode . +If +.I mode +begins with a digit, it +is interpreted as an octal number; otherwise +it is interpreted as a symbolic mode mask similar +to that accepted by +.IR chmod (1). +If +.I mode +is omitted, the current value of the mask is printed. +The +.B \-S +option causes the mask to be printed in symbolic form; the +default output is an octal number. +If the +.B \-p +option is supplied, and +.I mode +is omitted, the output is in a form that may be reused as input. +The return status is 0 if the mode was successfully changed or if +no \fImode\fP argument was supplied, and false otherwise. +.TP +\fBunalias\fP [\-\fBa\fP] [\fIname\fP ...] +Remove each \fIname\fP from the list of defined aliases. If +.B \-a +is supplied, all alias definitions are removed. The return +value is true unless a supplied +.I name +is not a defined alias. +.TP +\fBunset\fP [\-\fBfv\fP] [\-\fBn\fP] [\fIname\fP ...] +For each +.IR name , +remove the corresponding variable or function. +If the +.B \-v +option is given, each +.I name +refers to a shell variable, and that variable is removed. +Read-only variables may not be unset. +If +.B \-f +is specified, each +.I name +refers to a shell function, and the function definition +is removed. +If the +.B \-n +option is supplied, and \fIname\fP is a variable with the \fInameref\fP +attribute, \fIname\fP will be unset rather than the variable it +references. +\fB\-n\fP has no effect if the \fB\-f\fP option is supplied. +If no options are supplied, each \fIname\fP refers to a variable; if +there is no variable by that name, any function with that name is +unset. +Each unset variable or function is removed from the environment +passed to subsequent commands. +If any of +.SM +.BR COMP_WORDBREAKS , +.SM +.BR RANDOM , +.SM +.BR SECONDS , +.SM +.BR LINENO , +.SM +.BR HISTCMD , +.SM +.BR FUNCNAME , +.SM +.BR GROUPS , +or +.SM +.B DIRSTACK +are unset, they lose their special properties, even if they are +subsequently reset. The exit status is true unless a +.I name +is readonly. +.TP +\fBwait\fP [\fB\-n\fP] [\fIn ...\fP] +Wait for each specified child process and return its termination status. +Each +.I n +may be a process +ID or a job specification; if a job spec is given, all processes +in that job's pipeline are waited for. If +.I n +is not given, all currently active child processes +are waited for, and the return status is zero. +If the \fB\-n\fP option is supplied, \fBwait\fP waits for any job to +terminate and returns its exit status. +If +.I n +specifies a non-existent process or job, the return status is +127. Otherwise, the return status is the exit status of the last +process or job waited for. +.\" bash_builtins +.if \n(zZ=1 .ig zZ +.SH "RESTRICTED SHELL" +.\" rbash.1 +.zY +.PP +If +.B bash +is started with the name +.BR rbash , +or the +.B \-r +option is supplied at invocation, +the shell becomes restricted. +A restricted shell is used to +set up an environment more controlled than the standard shell. +It behaves identically to +.B bash +with the exception that the following are disallowed or not performed: +.IP \(bu +changing directories with \fBcd\fP +.IP \(bu +setting or unsetting the values of +.SM +.BR SHELL , +.SM +.BR PATH , +.SM +.BR ENV , +or +.SM +.B BASH_ENV +.IP \(bu +specifying command names containing +.B / +.IP \(bu +specifying a filename containing a +.B / +as an argument to the +.B . +builtin command +.IP \(bu +specifying a filename containing a slash as an argument to the +.B \-p +option to the +.B hash +builtin command +.IP \(bu +importing function definitions from the shell environment at startup +.IP \(bu +parsing the value of +.SM +.B SHELLOPTS +from the shell environment at startup +.IP \(bu +redirecting output using the >, >|, <>, >&, &>, and >> redirection operators +.IP \(bu +using the +.B exec +builtin command to replace the shell with another command +.IP \(bu +adding or deleting builtin commands with the +.B \-f +and +.B \-d +options to the +.B enable +builtin command +.IP \(bu +using the \fBenable\fP builtin command to enable disabled shell builtins +.IP \(bu +specifying the +.B \-p +option to the +.B command +builtin command +.IP \(bu +turning off restricted mode with +\fBset +r\fP or \fBset +o restricted\fP. +.PP +These restrictions are enforced after any startup files are read. +.PP +.ie \n(zY=1 When a command that is found to be a shell script is executed, +.el \{ When a command that is found to be a shell script is executed +(see +.SM +.B "COMMAND EXECUTION" +above), +\} +.B rbash +turns off any restrictions in the shell spawned to execute the +script. +.\" end of rbash.1 +.if \n(zY=1 .ig zY +.SH "SEE ALSO" +.PD 0 +.TP +\fIBash Reference Manual\fP, Brian Fox and Chet Ramey +.TP +\fIThe Gnu Readline Library\fP, Brian Fox and Chet Ramey +.TP +\fIThe Gnu History Library\fP, Brian Fox and Chet Ramey +.TP +\fIPortable Operating System Interface (POSIX) Part 2: Shell and Utilities\fP, IEEE -- +http://pubs.opengroup.org/onlinepubs/9699919799/ +.TP +http://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode +.TP +\fIsh\fP(1), \fIksh\fP(1), \fIcsh\fP(1) +.TP +\fIemacs\fP(1), \fIvi\fP(1) +.TP +\fIreadline\fP(3) +.PD +.SH FILES +.PD 0 +.TP +.FN /bin/bash +The \fBbash\fP executable +.TP +.FN /etc/profile +The systemwide initialization file, executed for login shells +.TP +.FN /etc/bash.bashrc +The systemwide per-interactive-shell startup file +.TP +.FN /etc/bash.bash.logout +The systemwide login shell cleanup file, executed when a login shell exits +.TP +.FN ~/.bash_profile +The personal initialization file, executed for login shells +.TP +.FN ~/.bashrc +The individual per-interactive-shell startup file +.TP +.FN ~/.bash_logout +The individual login shell cleanup file, executed when a login shell exits +.TP +.FN ~/.inputrc +Individual \fIreadline\fP initialization file +.PD +.SH AUTHORS +Brian Fox, Free Software Foundation +.br +bfox@gnu.org +.PP +Chet Ramey, Case Western Reserve University +.br +chet.ramey@case.edu +.SH BUG REPORTS +If you find a bug in +.B bash, +you should report it. But first, you should +make sure that it really is a bug, and that it appears in the latest +version of +.BR bash . +The latest version is always available from +\fIftp://ftp.gnu.org/pub/gnu/bash/\fP. +.PP +Once you have determined that a bug actually exists, use the +.I bashbug +command to submit a bug report. +If you have a fix, you are encouraged to mail that as well! +Suggestions and `philosophical' bug reports may be mailed +to \fIbug-bash@gnu.org\fP or posted to the Usenet +newsgroup +.BR gnu.bash.bug . +.PP +ALL bug reports should include: +.PP +.PD 0 +.TP 20 +The version number of \fBbash\fR +.TP +The hardware and operating system +.TP +The compiler used to compile +.TP +A description of the bug behaviour +.TP +A short script or `recipe' which exercises the bug +.PD +.PP +.I bashbug +inserts the first three items automatically into the template +it provides for filing a bug report. +.PP +Comments and bug reports concerning +this manual page should be directed to +.IR chet.ramey@case.edu . +.SH BUGS +.PP +It's too big and too slow. +.PP +There are some subtle differences between +.B bash +and traditional versions of +.BR sh , +mostly because of the +.SM +.B POSIX +specification. +.PP +Aliases are confusing in some uses. +.PP +Shell builtin commands and functions are not stoppable/restartable. +.PP +Compound commands and command sequences of the form `a ; b ; c' +are not handled gracefully when process suspension is attempted. +When a process is stopped, the shell immediately executes the next +command in the sequence. +It suffices to place the sequence of commands between +parentheses to force it into a subshell, which may be stopped as +a unit. +.PP +Array variables may not (yet) be exported. +.PP +There may be only one active coprocess at a time. +.zZ +.zY diff --git a/.pc/man-test.diff/builtins/test.def b/.pc/man-test.diff/builtins/test.def new file mode 100644 index 0000000..f144400 --- /dev/null +++ b/.pc/man-test.diff/builtins/test.def @@ -0,0 +1,159 @@ +This file is test.def, from which is created test.c. +It implements the builtin "test" in Bash. + +Copyright (C) 1987-2010 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES test.c + +$BUILTIN test +$FUNCTION test_builtin +$SHORT_DOC test [expr] +Evaluate conditional expression. + +Exits with a status of 0 (true) or 1 (false) depending on +the evaluation of EXPR. Expressions may be unary or binary. Unary +expressions are often used to examine the status of a file. There +are string operators and numeric comparison operators as well. + +The behavior of test depends on the number of arguments. Read the +bash manual page for the complete specification. + +File operators: + + -a FILE True if file exists. + -b FILE True if file is block special. + -c FILE True if file is character special. + -d FILE True if file is a directory. + -e FILE True if file exists. + -f FILE True if file exists and is a regular file. + -g FILE True if file is set-group-id. + -h FILE True if file is a symbolic link. + -L FILE True if file is a symbolic link. + -k FILE True if file has its `sticky' bit set. + -p FILE True if file is a named pipe. + -r FILE True if file is readable by you. + -s FILE True if file exists and is not empty. + -S FILE True if file is a socket. + -t FD True if FD is opened on a terminal. + -u FILE True if the file is set-user-id. + -w FILE True if the file is writable by you. + -x FILE True if the file is executable by you. + -O FILE True if the file is effectively owned by you. + -G FILE True if the file is effectively owned by your group. + -N FILE True if the file has been modified since it was last read. + + FILE1 -nt FILE2 True if file1 is newer than file2 (according to + modification date). + + FILE1 -ot FILE2 True if file1 is older than file2. + + FILE1 -ef FILE2 True if file1 is a hard link to file2. + +String operators: + + -z STRING True if string is empty. + + -n STRING + STRING True if string is not empty. + + STRING1 = STRING2 + True if the strings are equal. + STRING1 != STRING2 + True if the strings are not equal. + STRING1 < STRING2 + True if STRING1 sorts before STRING2 lexicographically. + STRING1 > STRING2 + True if STRING1 sorts after STRING2 lexicographically. + +Other operators: + + -o OPTION True if the shell option OPTION is enabled. + -v VAR True if the shell variable VAR is set + -R VAR True if the shell variable VAR is set and is a name reference. + ! EXPR True if expr is false. + EXPR1 -a EXPR2 True if both expr1 AND expr2 are true. + EXPR1 -o EXPR2 True if either expr1 OR expr2 is true. + + arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne, + -lt, -le, -gt, or -ge. + +Arithmetic binary operators return true if ARG1 is equal, not-equal, +less-than, less-than-or-equal, greater-than, or greater-than-or-equal +than ARG2. + +Exit Status: +Returns success if EXPR evaluates to true; fails if EXPR evaluates to +false or an invalid argument is given. +$END + +$BUILTIN [ +$DOCNAME test_bracket +$FUNCTION test_builtin +$SHORT_DOC [ arg... ] +Evaluate conditional expression. + +This is a synonym for the "test" builtin, but the last argument must +be a literal `]', to match the opening `['. +$END + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "../bashansi.h" +#include "../bashintl.h" + +#include "../shell.h" +#include "../test.h" +#include "common.h" + +extern char *this_command_name; + +/* TEST/[ builtin. */ +int +test_builtin (list) + WORD_LIST *list; +{ + char **argv; + int argc, result; + + /* We let Matthew Bradburn and Kevin Braunsdorf's code do the + actual test command. So turn the list of args into an array + of strings, since that is what their code wants. */ + if (list == 0) + { + if (this_command_name[0] == '[' && !this_command_name[1]) + { + builtin_error (_("missing `]'")); + return (EX_BADUSAGE); + } + + return (EXECUTION_FAILURE); + } + + argv = make_builtin_argv (list, &argc); + result = test_command (argc, argv); + free ((char *)argv); + + return (result); +} diff --git a/.pc/man-test2.diff/builtins/test.def b/.pc/man-test2.diff/builtins/test.def new file mode 100644 index 0000000..eb4c298 --- /dev/null +++ b/.pc/man-test2.diff/builtins/test.def @@ -0,0 +1,162 @@ +This file is test.def, from which is created test.c. +It implements the builtin "test" in Bash. + +Copyright (C) 1987-2010 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES test.c + +$BUILTIN test +$FUNCTION test_builtin +$SHORT_DOC test [expr] +Evaluate conditional expression. + +Exits with a status of 0 (true) or 1 (false) depending on +the evaluation of EXPR. Expressions may be unary or binary. Unary +expressions are often used to examine the status of a file. There +are string operators and numeric comparison operators as well. + +The behavior of test depends on the number of arguments. Read the +bash manual page for the complete specification. + +File operators: + + -a FILE True if file exists. + -b FILE True if file is block special. + -c FILE True if file is character special. + -d FILE True if file is a directory. + -e FILE True if file exists. + -f FILE True if file exists and is a regular file. + -g FILE True if file is set-group-id. + -h FILE True if file is a symbolic link. + -L FILE True if file is a symbolic link. + -k FILE True if file has its `sticky' bit set. + -p FILE True if file is a named pipe. + -r FILE True if file is readable by you. + -s FILE True if file exists and is not empty. + -S FILE True if file is a socket. + -t FD True if FD is opened on a terminal. + -u FILE True if the file is set-user-id. + -w FILE True if the file is writable by you. + -x FILE True if the file is executable by you. + -O FILE True if the file is effectively owned by you. + -G FILE True if the file is effectively owned by your group. + -N FILE True if the file has been modified since it was last read. + + FILE1 -nt FILE2 True if file1 is newer than file2 (according to + modification date). + + FILE1 -ot FILE2 True if file1 is older than file2. + + FILE1 -ef FILE2 True if file1 is a hard link to file2. + +All file operators except -h and -L are acting on the target of a symbolic +link, not on the symlink itself, if FILE is a symbolic link. + +String operators: + + -z STRING True if string is empty. + + -n STRING + STRING True if string is not empty. + + STRING1 = STRING2 + True if the strings are equal. + STRING1 != STRING2 + True if the strings are not equal. + STRING1 < STRING2 + True if STRING1 sorts before STRING2 lexicographically. + STRING1 > STRING2 + True if STRING1 sorts after STRING2 lexicographically. + +Other operators: + + -o OPTION True if the shell option OPTION is enabled. + -v VAR True if the shell variable VAR is set + -R VAR True if the shell variable VAR is set and is a name reference. + ! EXPR True if expr is false. + EXPR1 -a EXPR2 True if both expr1 AND expr2 are true. + EXPR1 -o EXPR2 True if either expr1 OR expr2 is true. + + arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne, + -lt, -le, -gt, or -ge. + +Arithmetic binary operators return true if ARG1 is equal, not-equal, +less-than, less-than-or-equal, greater-than, or greater-than-or-equal +than ARG2. + +Exit Status: +Returns success if EXPR evaluates to true; fails if EXPR evaluates to +false or an invalid argument is given. +$END + +$BUILTIN [ +$DOCNAME test_bracket +$FUNCTION test_builtin +$SHORT_DOC [ arg... ] +Evaluate conditional expression. + +This is a synonym for the "test" builtin, but the last argument must +be a literal `]', to match the opening `['. +$END + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "../bashansi.h" +#include "../bashintl.h" + +#include "../shell.h" +#include "../test.h" +#include "common.h" + +extern char *this_command_name; + +/* TEST/[ builtin. */ +int +test_builtin (list) + WORD_LIST *list; +{ + char **argv; + int argc, result; + + /* We let Matthew Bradburn and Kevin Braunsdorf's code do the + actual test command. So turn the list of args into an array + of strings, since that is what their code wants. */ + if (list == 0) + { + if (this_command_name[0] == '[' && !this_command_name[1]) + { + builtin_error (_("missing `]'")); + return (EX_BADUSAGE); + } + + return (EXECUTION_FAILURE); + } + + argv = make_builtin_argv (list, &argc); + result = test_command (argc, argv); + free ((char *)argv); + + return (result); +} diff --git a/.pc/man-test2.diff/doc/bash.1 b/.pc/man-test2.diff/doc/bash.1 new file mode 100644 index 0000000..afae76d --- /dev/null +++ b/.pc/man-test2.diff/doc/bash.1 @@ -0,0 +1,10353 @@ +.\" +.\" MAN PAGE COMMENTS to +.\" +.\" Chet Ramey +.\" Case Western Reserve University +.\" chet.ramey@case.edu +.\" +.\" Last Change: Sun Feb 2 16:21:40 EST 2014 +.\" +.\" bash_builtins, strip all but Built-Ins section +.if \n(zZ=1 .ig zZ +.if \n(zY=1 .ig zY +.TH BASH 1 "2014 February 2" "GNU Bash 4.3" +.\" +.\" There's some problem with having a `@' +.\" in a tagged paragraph with the BSD man macros. +.\" It has to do with `@' appearing in the }1 macro. +.\" This is a problem on 4.3 BSD and Ultrix, but Sun +.\" appears to have fixed it. +.\" If you're seeing the characters +.\" `@u-3p' appearing before the lines reading +.\" `possible-hostname-completions +.\" and `complete-hostname' down in READLINE, +.\" then uncomment this redefinition. +.\" +.de }1 +.ds ]X \&\\*(]B\\ +.nr )E 0 +.if !"\\$1"" .nr )I \\$1n +.}f +.ll \\n(LLu +.in \\n()Ru+\\n(INu+\\n()Iu +.ti \\n(INu +.ie !\\n()Iu+\\n()Ru-\w\\*(]Xu-3p \{\\*(]X +.br\} +.el \\*(]X\h|\\n()Iu+\\n()Ru\c +.}f +.. +.\" +.\" File Name macro. This used to be `.PN', for Path Name, +.\" but Sun doesn't seem to like that very much. +.\" +.de FN +\fI\|\\$1\|\fP +.. +.SH NAME +bash \- GNU Bourne-Again SHell +.SH SYNOPSIS +.B bash +[options] +[command_string | file] +.SH COPYRIGHT +.if n Bash is Copyright (C) 1989-2013 by the Free Software Foundation, Inc. +.if t Bash is Copyright \(co 1989-2013 by the Free Software Foundation, Inc. +.SH DESCRIPTION +.B Bash +is an \fBsh\fR-compatible command language interpreter that +executes commands read from the standard input or from a file. +.B Bash +also incorporates useful features from the \fIKorn\fP and \fIC\fP +shells (\fBksh\fP and \fBcsh\fP). +.PP +.B Bash +is intended to be a conformant implementation of the +Shell and Utilities portion of the IEEE POSIX specification +(IEEE Standard 1003.1). +.B Bash +can be configured to be POSIX-conformant by default. +.SH OPTIONS +All of the single-character shell options documented in the +description of the \fBset\fR builtin command can be used as options +when the shell is invoked. +In addition, \fBbash\fR +interprets the following options when it is invoked: +.PP +.PD 0 +.TP 10 +.B \-c +If the +.B \-c +option is present, then commands are read from the first non-option argument +.IR command_string . +If there are arguments after the +.IR command_string , +they are assigned to the positional parameters, starting with +.BR $0 . +.TP +.B \-i +If the +.B \-i +option is present, the shell is +.IR interactive . +.TP +.B \-l +Make +.B bash +act as if it had been invoked as a login shell (see +.SM +.B INVOCATION +below). +.TP +.B \-r +If the +.B \-r +option is present, the shell becomes +.I restricted +(see +.SM +.B "RESTRICTED SHELL" +below). +.TP +.B \-s +If the +.B \-s +option is present, or if no arguments remain after option +processing, then commands are read from the standard input. +This option allows the positional parameters to be set +when invoking an interactive shell. +.TP +.B \-D +A list of all double-quoted strings preceded by \fB$\fP +is printed on the standard output. +These are the strings that +are subject to language translation when the current locale +is not \fBC\fP or \fBPOSIX\fP. +This implies the \fB\-n\fP option; no commands will be executed. +.TP +.B [\-+]O [\fIshopt_option\fP] +\fIshopt_option\fP is one of the shell options accepted by the +\fBshopt\fP builtin (see +.SM +.B SHELL BUILTIN COMMANDS +below). +If \fIshopt_option\fP is present, \fB\-O\fP sets the value of that option; +\fB+O\fP unsets it. +If \fIshopt_option\fP is not supplied, the names and values of the shell +options accepted by \fBshopt\fP are printed on the standard output. +If the invocation option is \fB+O\fP, the output is displayed in a format +that may be reused as input. +.TP +.B \-\- +A +.B \-\- +signals the end of options and disables further option processing. +Any arguments after the +.B \-\- +are treated as filenames and arguments. An argument of +.B \- +is equivalent to \fB\-\-\fP. +.PD +.PP +.B Bash +also interprets a number of multi-character options. +These options must appear on the command line before the +single-character options to be recognized. +.PP +.PD 0 +.TP +.B \-\-debugger +Arrange for the debugger profile to be executed before the shell +starts. +Turns on extended debugging mode (see the description of the +.B extdebug +option to the +.B shopt +builtin below). +.TP +.B \-\-dump\-po\-strings +Equivalent to \fB\-D\fP, but the output is in the GNU \fIgettext\fP +\fBpo\fP (portable object) file format. +.TP +.B \-\-dump\-strings +Equivalent to \fB\-D\fP. +.TP +.B \-\-help +Display a usage message on standard output and exit successfully. +.TP +\fB\-\-init\-file\fP \fIfile\fP +.PD 0 +.TP +\fB\-\-rcfile\fP \fIfile\fP +.PD +Execute commands from +.I file +instead of the system wide initialization file +.I /etc/bash.bashrc +and the standard personal initialization file +.I ~/.bashrc +if the shell is interactive (see +.SM +.B INVOCATION +below). +.TP +.B \-\-login +Equivalent to \fB\-l\fP. +.TP +.B \-\-noediting +Do not use the GNU +.B readline +library to read command lines when the shell is interactive. +.TP +.B \-\-noprofile +Do not read either the system-wide startup file +.FN /etc/profile +or any of the personal initialization files +.IR ~/.bash_profile , +.IR ~/.bash_login , +or +.IR ~/.profile . +By default, +.B bash +reads these files when it is invoked as a login shell (see +.SM +.B INVOCATION +below). +.TP +.B \-\-norc +Do not read and execute the system wide initialization file +.I /etc/bash.bashrc +and the personal initialization file +.I ~/.bashrc +if the shell is interactive. +This option is on by default if the shell is invoked as +.BR sh . +.TP +.B \-\-posix +Change the behavior of \fBbash\fP where the default operation differs +from the POSIX standard to match the standard (\fIposix mode\fP). +See +.SM +.B "SEE ALSO" +below for a reference to a document that details how posix mode affects +bash's behavior. +.TP +.B \-\-restricted +The shell becomes restricted (see +.SM +.B "RESTRICTED SHELL" +below). +.TP +.B \-\-verbose +Equivalent to \fB\-v\fP. +.TP +.B \-\-version +Show version information for this instance of +.B bash +on the standard output and exit successfully. +.PD +.SH ARGUMENTS +If arguments remain after option processing, and neither the +.B \-c +nor the +.B \-s +option has been supplied, the first argument is assumed to +be the name of a file containing shell commands. +If +.B bash +is invoked in this fashion, +.B $0 +is set to the name of the file, and the positional parameters +are set to the remaining arguments. +.B Bash +reads and executes commands from this file, then exits. +\fBBash\fP's exit status is the exit status of the last command +executed in the script. +If no commands are executed, the exit status is 0. +An attempt is first made to open the file in the current directory, and, +if no file is found, then the shell searches the directories in +.SM +.B PATH +for the script. +.SH INVOCATION +A \fIlogin shell\fP is one whose first character of argument zero is a +.BR \- , +or one started with the +.B \-\-login +option. +.PP +An \fIinteractive\fP shell is one started without non-option arguments +and without the +.B \-c +option +whose standard input and error are +both connected to terminals (as determined by +.IR isatty (3)), +or one started with the +.B \-i +option. +.SM +.B PS1 +is set and +.B $\- +includes +.B i +if +.B bash +is interactive, +allowing a shell script or a startup file to test this state. +.PP +The following paragraphs describe how +.B bash +executes its startup files. +If any of the files exist but cannot be read, +.B bash +reports an error. +Tildes are expanded in filenames as described below under +.B "Tilde Expansion" +in the +.SM +.B EXPANSION +section. +.PP +When +.B bash +is invoked as an interactive login shell, or as a non-interactive shell +with the \fB\-\-login\fP option, it first reads and +executes commands from the file \fI/etc/profile\fP, if that +file exists. +After reading that file, it looks for \fI~/.bash_profile\fP, +\fI~/.bash_login\fP, and \fI~/.profile\fP, in that order, and reads +and executes commands from the first one that exists and is readable. +The +.B \-\-noprofile +option may be used when the shell is started to inhibit this behavior. +.PP +When a login shell exits, +.B bash +reads and executes commands from the file \fI~/.bash_logout\fP, if it +exists. +.PP +When an interactive shell that is not a login shell is started, +.B bash +reads and executes commands from \fI/etc/bash.bashrc\fP and \fI~/.bashrc\fP, +if these files exist. +This may be inhibited by using the +.B \-\-norc +option. +The \fB\-\-rcfile\fP \fIfile\fP option will force +.B bash +to read and execute commands from \fIfile\fP instead of +\fI/etc/bash.bashrc\fP and \fI~/.bashrc\fP. +.PP +When +.B bash +is started non-interactively, to run a shell script, for example, it +looks for the variable +.SM +.B BASH_ENV +in the environment, expands its value if it appears there, and uses the +expanded value as the name of a file to read and execute. +.B Bash +behaves as if the following command were executed: +.sp .5 +.RS +.if t \f(CWif [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi\fP +.if n if [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi +.RE +.sp .5 +but the value of the +.SM +.B PATH +variable is not used to search for the filename. +.PP +If +.B bash +is invoked with the name +.BR sh , +it tries to mimic the startup behavior of historical versions of +.B sh +as closely as possible, +while conforming to the POSIX standard as well. +When invoked as an interactive login shell, or a non-interactive +shell with the \fB\-\-login\fP option, it first attempts to +read and execute commands from +.I /etc/profile +and +.IR ~/.profile , +in that order. +The +.B \-\-noprofile +option may be used to inhibit this behavior. +When invoked as an interactive shell with the name +.BR sh , +.B bash +looks for the variable +.SM +.BR ENV , +expands its value if it is defined, and uses the +expanded value as the name of a file to read and execute. +Since a shell invoked as +.B sh +does not attempt to read and execute commands from any other startup +files, the +.B \-\-rcfile +option has no effect. +A non-interactive shell invoked with the name +.B sh +does not attempt to read any other startup files. +When invoked as +.BR sh , +.B bash +enters +.I posix +mode after the startup files are read. +.PP +When +.B bash +is started in +.I posix +mode, as with the +.B \-\-posix +command line option, it follows the POSIX standard for startup files. +In this mode, interactive shells expand the +.SM +.B ENV +variable and commands are read and executed from the file +whose name is the expanded value. +No other startup files are read. +.PP +.B Bash +attempts to determine when it is being run with its standard input +connected to a network connection, as when executed by the remote shell +daemon, usually \fIrshd\fP, or the secure shell daemon \fIsshd\fP. +If +.B bash +determines it is being run in this fashion, it reads and executes +commands from \fI~/.bashrc\fP and \fI~/.bashrc\fP, if these files +exist and are readable. +It will not do this if invoked as \fBsh\fP. +The +.B \-\-norc +option may be used to inhibit this behavior, and the +.B \-\-rcfile +option may be used to force another file to be read, but neither +\fIrshd\fP nor \fIsshd\fP generally invoke the shell with those options +or allow them to be specified. +.PP +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the \fB\-p\fP option is not supplied, no startup +files are read, shell functions are not inherited from the environment, the +.SM +.BR SHELLOPTS , +.SM +.BR BASHOPTS , +.SM +.BR CDPATH , +and +.SM +.B GLOBIGNORE +variables, if they appear in the environment, are ignored, +and the effective user id is set to the real user id. +If the \fB\-p\fP option is supplied at invocation, the startup behavior is +the same, but the effective user id is not reset. +.SH DEFINITIONS +.PP +The following definitions are used throughout the rest of this +document. +.PD 0 +.TP +.B blank +A space or tab. +.TP +.B word +A sequence of characters considered as a single unit by the shell. +Also known as a +.BR token . +.TP +.B name +A +.I word +consisting only of alphanumeric characters and underscores, and +beginning with an alphabetic character or an underscore. Also +referred to as an +.BR identifier . +.TP +.B metacharacter +A character that, when unquoted, separates words. One of the following: +.br +.RS +.PP +.if t \fB| & ; ( ) < > space tab\fP +.if n \fB| & ; ( ) < > space tab\fP +.RE +.PP +.TP +.B control operator +A \fItoken\fP that performs a control function. It is one of the following +symbols: +.RS +.PP +.if t \fB|| & && ; ;; ( ) | |& \fP +.if n \fB|| & && ; ;; ( ) | |& \fP +.RE +.PD +.SH "RESERVED WORDS" +\fIReserved words\fP are words that have a special meaning to the shell. +The following words are recognized as reserved when unquoted and either +the first word of a simple command (see +.SM +.B SHELL GRAMMAR +below) or the third word of a +.B case +or +.B for +command: +.if t .RS +.PP +.B +.if n ! case coproc do done elif else esac fi for function if in select then until while { } time [[ ]] +.if t ! case coproc do done elif else esac fi for function if in select then until while { } time [[ ]] +.if t .RE +.SH "SHELL GRAMMAR" +.SS Simple Commands +.PP +A \fIsimple command\fP is a sequence of optional variable assignments +followed by \fBblank\fP-separated words and redirections, and +terminated by a \fIcontrol operator\fP. The first word +specifies the command to be executed, and is passed as argument zero. +The remaining words are passed as arguments to the invoked command. +.PP +The return value of a \fIsimple command\fP is its exit status, or +128+\fIn\^\fP if the command is terminated by signal +.IR n . +.SS Pipelines +.PP +A \fIpipeline\fP is a sequence of one or more commands separated by +one of the control operators +.B | +or \fB|&\fP. +The format for a pipeline is: +.RS +.PP +[\fBtime\fP [\fB\-p\fP]] [ ! ] \fIcommand\fP [ [\fB|\fP\(bv\fB|&\fP] \fIcommand2\fP ... ] +.RE +.PP +The standard output of +.I command +is connected via a pipe to the standard input of +.IR command2 . +This connection is performed before any redirections specified by the +command (see +.SM +.B REDIRECTION +below). +If \fB|&\fP is used, \fIcommand\fP's standard error, in addition to its +standard output, is connected to +\fIcommand2\fP's standard input through the pipe; +it is shorthand for \fB2>&1 |\fP. +This implicit redirection of the standard error to the standard output is +performed after any redirections specified by the command. +.PP +The return status of a pipeline is the exit status of the last +command, unless the \fBpipefail\fP option is enabled. +If \fBpipefail\fP is enabled, the pipeline's return status is the +value of the last (rightmost) command to exit with a non-zero status, +or zero if all commands exit successfully. +If the reserved word +.B ! +precedes a pipeline, the exit status of that pipeline is the logical +negation of the exit status as described above. +The shell waits for all commands in the pipeline to +terminate before returning a value. +.PP +If the +.B time +reserved word precedes a pipeline, the elapsed as well as user and +system time consumed by its execution are reported when the pipeline +terminates. +The \fB\-p\fP option changes the output format to that specified by POSIX. +When the shell is in \fIposix mode\fP, it does not recognize +\fBtime\fP as a reserved word if the next token begins with a `-'. +The +.SM +.B TIMEFORMAT +variable may be set to a format string that specifies how the timing +information should be displayed; see the description of +.SM +.B TIMEFORMAT +under +.B "Shell Variables" +below. +.PP +When the shell is in \fIposix mode\fP, \fBtime\fP +may be followed by a newline. In this case, the shell displays the +total user and system time consumed by the shell and its children. +The +.SM +.B TIMEFORMAT +variable may be used to specify the format of +the time information. +.PP +Each command in a pipeline is executed as a separate process (i.e., in a +subshell). +.SS Lists +.PP +A \fIlist\fP is a sequence of one or more pipelines separated by one +of the operators +.BR ; , +.BR & , +.BR && , +or +.BR || , +and optionally terminated by one of +.BR ; , +.BR & , +or +.BR . +.PP +Of these list operators, +.B && +and +.B || +have equal precedence, followed by +.B ; +and +.BR & , +which have equal precedence. +.PP +A sequence of one or more newlines may appear in a \fIlist\fP instead +of a semicolon to delimit commands. +.PP +If a command is terminated by the control operator +.BR & , +the shell executes the command in the \fIbackground\fP +in a subshell. The shell does not wait for the command to +finish, and the return status is 0. Commands separated by a +.B ; +are executed sequentially; the shell waits for each +command to terminate in turn. The return status is the +exit status of the last command executed. +.PP +AND and OR lists are sequences of one of more pipelines separated by the +\fB&&\fP and \fB||\fP control operators, respectively. +AND and OR lists are executed with left associativity. +An AND list has the form +.RS +.PP +\fIcommand1\fP \fB&&\fP \fIcommand2\fP +.RE +.PP +.I command2 +is executed if, and only if, +.I command1 +returns an exit status of zero. +.PP +An OR list has the form +.RS +.PP +\fIcommand1\fP \fB||\fP \fIcommand2\fP +.PP +.RE +.PP +.I command2 +is executed if and only if +.I command1 +returns a non-zero exit status. +The return status of +AND and OR lists is the exit status of the last command +executed in the list. +.SS Compound Commands +.PP +A \fIcompound command\fP is one of the following. +In most cases a \fIlist\fP in a command's description may be separated from +the rest of the command by one or more newlines, and may be followed by a +newline in place of a semicolon. +.TP +(\fIlist\fP) +\fIlist\fP is executed in a subshell environment (see +.SM +\fBCOMMAND EXECUTION ENVIRONMENT\fP +below). +Variable assignments and builtin +commands that affect the shell's environment do not remain in effect +after the command completes. The return status is the exit status of +\fIlist\fP. +.TP +{ \fIlist\fP; } +\fIlist\fP is simply executed in the current shell environment. +\fIlist\fP must be terminated with a newline or semicolon. +This is known as a \fIgroup command\fP. +The return status is the exit status of +\fIlist\fP. +Note that unlike the metacharacters \fB(\fP and \fB)\fP, \fB{\fP and +\fB}\fP are \fIreserved words\fP and must occur where a reserved +word is permitted to be recognized. Since they do not cause a word +break, they must be separated from \fIlist\fP by whitespace or another +shell metacharacter. +.TP +((\fIexpression\fP)) +The \fIexpression\fP is evaluated according to the rules described +below under +.SM +.BR "ARITHMETIC EVALUATION" . +If the value of the expression is non-zero, the return status is 0; +otherwise the return status is 1. This is exactly equivalent to +\fBlet "\fIexpression\fP"\fR. +.TP +\fB[[\fP \fIexpression\fP \fB]]\fP +Return a status of 0 or 1 depending on the evaluation of +the conditional expression \fIexpression\fP. +Expressions are composed of the primaries described below under +.SM +.BR "CONDITIONAL EXPRESSIONS" . +Word splitting and pathname expansion are not performed on the words +between the \fB[[\fP and \fB]]\fP; tilde expansion, +parameter and variable expansion, +arithmetic expansion, command substitution, process +substitution, and quote removal are performed. +Conditional operators such as \fB\-f\fP must be unquoted to be recognized +as primaries. +.if t .sp 0.5 +.if n .sp 1 +When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort +lexicographically using the current locale. +.if t .sp 0.5 +.if n .sp 1 +When the \fB==\fP and \fB!=\fP operators are used, the string to the +right of the operator is considered a pattern and matched according +to the rules described below under \fBPattern Matching\fP, +as if the \fBextglob\fP shell option were enabled. +The \fB=\fP operator is equivalent to \fB==\fP. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +The return value is 0 if the string matches (\fB==\fP) or does not match +(\fB!=\fP) the pattern, and 1 otherwise. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +.if t .sp 0.5 +.if n .sp 1 +An additional binary operator, \fB=~\fP, is available, with the same +precedence as \fB==\fP and \fB!=\fP. +When it is used, the string to the right of the operator is considered +an extended regular expression and matched accordingly (as in \fIregex\fP(3)). +The return value is 0 if the string matches +the pattern, and 1 otherwise. +If the regular expression is syntactically incorrect, the conditional +expression's return value is 2. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +Bracket expressions in regular expressions must be treated carefully, +since normal quoting characters lose their meanings between brackets. +If the pattern is stored in a shell variable, quoting the variable +expansion forces the entire pattern to be matched as a string. +Substrings matched by parenthesized subexpressions within the regular +expression are saved in the array variable +.SM +.BR BASH_REMATCH . +The element of +.SM +.B BASH_REMATCH +with index 0 is the portion of the string +matching the entire regular expression. +The element of +.SM +.B BASH_REMATCH +with index \fIn\fP is the portion of the +string matching the \fIn\fPth parenthesized subexpression. +.if t .sp 0.5 +.if n .sp 1 +Expressions may be combined using the following operators, listed +in decreasing order of precedence: +.if t .sp 0.5 +.if n .sp 1 +.RS +.PD 0 +.TP +.B ( \fIexpression\fP ) +Returns the value of \fIexpression\fP. +This may be used to override the normal precedence of operators. +.TP +.B ! \fIexpression\fP +True if +.I expression +is false. +.TP +\fIexpression1\fP \fB&&\fP \fIexpression2\fP +True if both +.I expression1 +and +.I expression2 +are true. +.TP +\fIexpression1\fP \fB||\fP \fIexpression2\fP +True if either +.I expression1 +or +.I expression2 +is true. +.PD +.LP +The \fB&&\fP and \fB||\fP +operators do not evaluate \fIexpression2\fP if the value of +\fIexpression1\fP is sufficient to determine the return value of +the entire conditional expression. +.RE +.TP +\fBfor\fP \fIname\fP [ [ \fBin\fP [ \fIword ...\fP ] ] ; ] \fBdo\fP \fIlist\fP ; \fBdone\fP +The list of words following \fBin\fP is expanded, generating a list +of items. +The variable \fIname\fP is set to each element of this list +in turn, and \fIlist\fP is executed each time. +If the \fBin\fP \fIword\fP is omitted, the \fBfor\fP command executes +\fIlist\fP once for each positional parameter that is set (see +.SM +.B PARAMETERS +below). +The return status is the exit status of the last command that executes. +If the expansion of the items following \fBin\fP results in an empty +list, no commands are executed, and the return status is 0. +.TP +\fBfor\fP (( \fIexpr1\fP ; \fIexpr2\fP ; \fIexpr3\fP )) ; \fBdo\fP \fIlist\fP ; \fBdone\fP +First, the arithmetic expression \fIexpr1\fP is evaluated according +to the rules described below under +.SM +.BR "ARITHMETIC EVALUATION" . +The arithmetic expression \fIexpr2\fP is then evaluated repeatedly +until it evaluates to zero. +Each time \fIexpr2\fP evaluates to a non-zero value, \fIlist\fP is +executed and the arithmetic expression \fIexpr3\fP is evaluated. +If any expression is omitted, it behaves as if it evaluates to 1. +The return value is the exit status of the last command in \fIlist\fP +that is executed, or false if any of the expressions is invalid. +.TP +\fBselect\fP \fIname\fP [ \fBin\fP \fIword\fP ] ; \fBdo\fP \fIlist\fP ; \fBdone\fP +The list of words following \fBin\fP is expanded, generating a list +of items. The set of expanded words is printed on the standard +error, each preceded by a number. If the \fBin\fP +\fIword\fP is omitted, the positional parameters are printed (see +.SM +.B PARAMETERS +below). The +.SM +.B PS3 +prompt is then displayed and a line read from the standard input. +If the line consists of a number corresponding to one of +the displayed words, then the value of +.I name +is set to that word. If the line is empty, the words and prompt +are displayed again. If EOF is read, the command completes. Any +other value read causes +.I name +to be set to null. The line read is saved in the variable +.SM +.BR REPLY . +The +.I list +is executed after each selection until a +.B break +command is executed. +The exit status of +.B select +is the exit status of the last command executed in +.IR list , +or zero if no commands were executed. +.TP +\fBcase\fP \fIword\fP \fBin\fP [ [(] \fIpattern\fP [ \fB|\fP \fIpattern\fP ] \ +... ) \fIlist\fP ;; ] ... \fBesac\fP +A \fBcase\fP command first expands \fIword\fP, and tries to match +it against each \fIpattern\fP in turn, using the same matching rules +as for pathname expansion (see +.B Pathname Expansion +below). +The \fIword\fP is expanded using tilde +expansion, parameter and variable expansion, arithmetic substitution, +command substitution, process substitution and quote removal. +Each \fIpattern\fP examined is expanded using tilde +expansion, parameter and variable expansion, arithmetic substitution, +command substitution, and process substitution. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +When a match is found, the corresponding \fIlist\fP is executed. +If the \fB;;\fP operator is used, no subsequent matches are attempted after +the first pattern match. +Using \fB;&\fP in place of \fB;;\fP causes execution to continue with +the \fIlist\fP associated with the next set of patterns. +Using \fB;;&\fP in place of \fB;;\fP causes the shell to test the next +pattern list in the statement, if any, and execute any associated \fIlist\fP +on a successful match. +The exit status is zero if no +pattern matches. Otherwise, it is the exit status of the +last command executed in \fIlist\fP. +.TP +\fBif\fP \fIlist\fP; \fBthen\fP \fIlist\fP; \ +[ \fBelif\fP \fIlist\fP; \fBthen\fP \fIlist\fP; ] ... \ +[ \fBelse\fP \fIlist\fP; ] \fBfi\fP +The +.B if +.I list +is executed. If its exit status is zero, the +\fBthen\fP \fIlist\fP is executed. Otherwise, each \fBelif\fP +\fIlist\fP is executed in turn, and if its exit status is zero, +the corresponding \fBthen\fP \fIlist\fP is executed and the +command completes. Otherwise, the \fBelse\fP \fIlist\fP is +executed, if present. The exit status is the exit status of the +last command executed, or zero if no condition tested true. +.TP +\fBwhile\fP \fIlist-1\fP; \fBdo\fP \fIlist-2\fP; \fBdone\fP +.PD 0 +.TP +\fBuntil\fP \fIlist-1\fP; \fBdo\fP \fIlist-2\fP; \fBdone\fP +.PD +The \fBwhile\fP command continuously executes the list +\fIlist-2\fP as long as the last command in the list \fIlist-1\fP returns +an exit status of zero. The \fBuntil\fP command is identical +to the \fBwhile\fP command, except that the test is negated; +.I list-2 +is executed as long as the last command in +.I list-1 +returns a non-zero exit status. +The exit status of the \fBwhile\fP and \fBuntil\fP commands +is the exit status +of the last command executed in \fIlist-2\fP, or zero if +none was executed. +.SS Coprocesses +.PP +A \fIcoprocess\fP is a shell command preceded by the \fBcoproc\fP reserved +word. +A coprocess is executed asynchronously in a subshell, as if the command +had been terminated with the \fB&\fP control operator, with a two-way pipe +established between the executing shell and the coprocess. +.PP +The format for a coprocess is: +.RS +.PP +\fBcoproc\fP [\fINAME\fP] \fIcommand\fP [\fIredirections\fP] +.RE +.PP +This creates a coprocess named \fINAME\fP. +If \fINAME\fP is not supplied, the default name is \fBCOPROC\fP. +\fINAME\fP must not be supplied if \fIcommand\fP is a \fIsimple +command\fP (see above); otherwise, it is interpreted as the first word +of the simple command. +When the coprocess is executed, the shell creates an array variable (see +.B Arrays +below) named \fINAME\fP in the context of the executing shell. +The standard output of +.I command +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to \fINAME\fP[0]. +The standard input of +.I command +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to \fINAME\fP[1]. +This pipe is established before any redirections specified by the +command (see +.SM +.B REDIRECTION +below). +The file descriptors can be utilized as arguments to shell commands +and redirections using standard word expansions. +The file descriptors are not available in subshells. +The process ID of the shell spawned to execute the coprocess is +available as the value of the variable \fINAME\fP_PID. +The \fBwait\fP +builtin command may be used to wait for the coprocess to terminate. +.PP +Since the coprocess is created as an asynchronous command, +the \fBcoproc\fP command always returns success. +The return status of a coprocess is the exit status of \fIcommand\fP. +.SS Shell Function Definitions +.PP +A shell function is an object that is called like a simple command and +executes a compound command with a new set of positional parameters. +Shell functions are declared as follows: +.TP +\fIname\fP () \fIcompound\-command\fP [\fIredirection\fP] +.PD 0 +.TP +\fBfunction\fP \fIname\fP [()] \fIcompound\-command\fP [\fIredirection\fP] +.PD +This defines a function named \fIname\fP. +The reserved word \fBfunction\fP is optional. +If the \fBfunction\fP reserved word is supplied, the parentheses are optional. +The \fIbody\fP of the function is the compound command +.I compound\-command +(see \fBCompound Commands\fP above). +That command is usually a \fIlist\fP of commands between { and }, but +may be any command listed under \fBCompound Commands\fP above. +\fIcompound\-command\fP is executed whenever \fIname\fP is specified as the +name of a simple command. +When in \fIposix mode\fP, \fIname\fP may not be the name of one of the +POSIX \fIspecial builtins\fP. +Any redirections (see +.SM +.B REDIRECTION +below) specified when a function is defined are performed +when the function is executed. +The exit status of a function definition is zero unless a syntax error +occurs or a readonly function with the same name already exists. +When executed, the exit status of a function is the exit status of the +last command executed in the body. (See +.SM +.B FUNCTIONS +below.) +.SH COMMENTS +In a non-interactive shell, or an interactive shell in which the +.B interactive_comments +option to the +.B shopt +builtin is enabled (see +.SM +.B "SHELL BUILTIN COMMANDS" +below), a word beginning with +.B # +causes that word and all remaining characters on that line to +be ignored. An interactive shell without the +.B interactive_comments +option enabled does not allow comments. The +.B interactive_comments +option is on by default in interactive shells. +.SH QUOTING +\fIQuoting\fP is used to remove the special meaning of certain +characters or words to the shell. Quoting can be used to +disable special treatment for special characters, to prevent +reserved words from being recognized as such, and to prevent +parameter expansion. +.PP +Each of the \fImetacharacters\fP listed above under +.SM +.B DEFINITIONS +has special meaning to the shell and must be quoted if it is to +represent itself. +.PP +When the command history expansion facilities are being used +(see +.SM +.B HISTORY EXPANSION +below), the +\fIhistory expansion\fP character, usually \fB!\fP, must be quoted +to prevent history expansion. +.PP +There are three quoting mechanisms: the +.IR "escape character" , +single quotes, and double quotes. +.PP +A non-quoted backslash (\fB\e\fP) is the +.IR "escape character" . +It preserves the literal value of the next character that follows, +with the exception of . If a \fB\e\fP pair +appears, and the backslash is not itself quoted, the \fB\e\fP +is treated as a line continuation (that is, it is removed from the +input stream and effectively ignored). +.PP +Enclosing characters in single quotes preserves the literal value +of each character within the quotes. A single quote may not occur +between single quotes, even when preceded by a backslash. +.PP +Enclosing characters in double quotes preserves the literal value +of all characters within the quotes, with the exception of +.BR $ , +.BR \` , +.BR \e , +and, when history expansion is enabled, +.BR ! . +The characters +.B $ +and +.B \` +retain their special meaning within double quotes. The backslash +retains its special meaning only when followed by one of the following +characters: +.BR $ , +.BR \` , +\^\fB"\fP\^, +.BR \e , +or +.BR . +A double quote may be quoted within double quotes by preceding it with +a backslash. +If enabled, history expansion will be performed unless an +.B ! +appearing in double quotes is escaped using a backslash. +The backslash preceding the +.B ! +is not removed. +.PP +The special parameters +.B * +and +.B @ +have special meaning when in double +quotes (see +.SM +.B PARAMETERS +below). +.PP +Words of the form \fB$\fP\(aq\fIstring\fP\(aq are treated specially. The +word expands to \fIstring\fP, with backslash-escaped characters replaced +as specified by the ANSI C standard. Backslash escape sequences, if +present, are decoded as follows: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ee +.TP +.B \eE +an escape character +.TP +.B \ef +form feed +.TP +.B \en +new line +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\e +backslash +.TP +.B \e\(aq +single quote +.TP +.B \e\(dq +double quote +.TP +.B \e\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(one to three digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.TP +.B \eu\fIHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHH\fP (one to four hex digits) +.TP +.B \eU\fIHHHHHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHHHHHH\fP (one to eight hex digits) +.TP +.B \ec\fIx\fP +a control-\fIx\fP character +.PD +.RE +.LP +The expanded result is single-quoted, as if the dollar sign had +not been present. +.PP +A double-quoted string preceded by a dollar sign (\fB$\fP\(dq\fIstring\fP\(dq) +will cause the string to be translated according to the current locale. +If the current locale is \fBC\fP or \fBPOSIX\fP, the dollar sign +is ignored. +If the string is translated and replaced, the replacement is +double-quoted. +.SH PARAMETERS +A +.I parameter +is an entity that stores values. +It can be a +.IR name , +a number, or one of the special characters listed below under +.BR "Special Parameters" . +A +.I variable +is a parameter denoted by a +.IR name . +A variable has a \fIvalue\fP and zero or more \fIattributes\fP. +Attributes are assigned using the +.B declare +builtin command (see +.B declare +below in +.SM +.BR "SHELL BUILTIN COMMANDS" ). +.PP +A parameter is set if it has been assigned a value. The null string is +a valid value. Once a variable is set, it may be unset only by using +the +.B unset +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.PP +A +.I variable +may be assigned to by a statement of the form +.RS +.PP +\fIname\fP=[\fIvalue\fP] +.RE +.PP +If +.I value +is not given, the variable is assigned the null string. All +.I values +undergo tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote +removal (see +.SM +.B EXPANSION +below). If the variable has its +.B integer +attribute set, then +.I value +is evaluated as an arithmetic expression even if the $((...)) expansion is +not used (see +.B "Arithmetic Expansion" +below). +Word splitting is not performed, with the exception +of \fB"$@"\fP as explained below under +.BR "Special Parameters" . +Pathname expansion is not performed. +Assignment statements may also appear as arguments to the +.BR alias , +.BR declare , +.BR typeset , +.BR export , +.BR readonly , +and +.B local +builtin commands. +When in \fIposix mode\fP, these builtins may appear in a command after +one or more instances of the \fBcommand\fP builtin and retain these +assignment statement properties. +.PP +In the context where an assignment statement is assigning a value +to a shell variable or array index, the += operator can be used to +append to or add to the variable's previous value. +When += is applied to a variable for which the \fIinteger\fP attribute has been +set, \fIvalue\fP is evaluated as an arithmetic expression and added to the +variable's current value, which is also evaluated. +When += is applied to an array variable using compound assignment (see +.B Arrays +below), the +variable's value is not unset (as it is when using =), and new values are +appended to the array beginning at one greater than the array's maximum index +(for indexed arrays) or added as additional key\-value pairs in an +associative array. +When applied to a string-valued variable, \fIvalue\fP is expanded and +appended to the variable's value. +.PP +A variable can be assigned the \fInameref\fP attribute using the +\fB\-n\fP option to the \fBdeclare\fP or \fBlocal\fP builtin commands +(see the descriptions of \fBdeclare\fP and \fBlocal\fP below) +to create a \fInameref\fP, or a reference to another variable. +This allows variables to be manipulated indirectly. +Whenever the nameref variable is referenced or assigned to, the operation +is actually performed on the variable specified by the nameref variable's +value. +A nameref is commonly used within shell functions to refer to a variable +whose name is passed as an argument to the function. +For instance, if a variable name is passed to a shell function as its first +argument, running +.sp .5 +.RS +.if t \f(CWdeclare -n ref=$1\fP +.if n declare -n ref=$1 +.RE +.sp .5 +inside the function creates a nameref variable \fBref\fP whose value is +the variable name passed as the first argument. +References and assignments to \fBref\fP are treated as references and +assignments to the variable whose name was passed as \fB$1\fP. +If the control variable in a \fBfor\fP loop has the nameref attribute, +the list of words can be a list of shell variables, and a name reference +will be established for each word in the list, in turn, when the loop is +executed. +Array variables cannot be given the \fB\-n\fP attribute. +However, nameref variables can reference array variables and subscripted +array variables. +Namerefs can be unset using the \fB\-n\fP option to the \fBunset\fP builtin. +Otherwise, if \fBunset\fP is executed with the name of a nameref variable +as an argument, the variable referenced by the nameref variable will be unset. +.SS Positional Parameters +.PP +A +.I positional parameter +is a parameter denoted by one or more +digits, other than the single digit 0. Positional parameters are +assigned from the shell's arguments when it is invoked, +and may be reassigned using the +.B set +builtin command. Positional parameters may not be assigned to +with assignment statements. The positional parameters are +temporarily replaced when a shell function is executed (see +.SM +.B FUNCTIONS +below). +.PP +When a positional parameter consisting of more than a single +digit is expanded, it must be enclosed in braces (see +.SM +.B EXPANSION +below). +.SS Special Parameters +.PP +The shell treats several parameters specially. These parameters may +only be referenced; assignment to them is not allowed. +.PD 0 +.TP +.B * +Expands to the positional parameters, starting from one. +When the expansion is not within double quotes, each positional parameter +expands to a separate word. +In contexts where it is performed, those words +are subject to further word splitting and pathname expansion. +When the expansion occurs within double quotes, it expands to a single word +with the value of each parameter separated by the first character +of the +.SM +.B IFS +special variable. That is, "\fB$*\fP" is equivalent +to "\fB$1\fP\fIc\fP\fB$2\fP\fIc\fP\fB...\fP", where +.I c +is the first character of the value of the +.SM +.B IFS +variable. If +.SM +.B IFS +is unset, the parameters are separated by spaces. +If +.SM +.B IFS +is null, the parameters are joined without intervening separators. +.TP +.B @ +Expands to the positional parameters, starting from one. When the +expansion occurs within double quotes, each parameter expands to a +separate word. That is, "\fB$@\fP" is equivalent to +"\fB$1\fP" "\fB$2\fP" ... +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +When there are no positional parameters, "\fB$@\fP" and +.B $@ +expand to nothing (i.e., they are removed). +.TP +.B # +Expands to the number of positional parameters in decimal. +.TP +.B ? +Expands to the exit status of the most recently executed foreground +pipeline. +.TP +.B \- +Expands to the current option flags as specified upon invocation, +by the +.B set +builtin command, or those set by the shell itself +(such as the +.B \-i +option). +.TP +.B $ +Expands to the process ID of the shell. In a () subshell, it +expands to the process ID of the current shell, not the +subshell. +.TP +.B ! +Expands to the process ID of the job most recently placed into the +background, whether executed as an asynchronous command or using +the \fBbg\fP builtin (see +.SM +.B "JOB CONTROL" +below). +.TP +.B 0 +Expands to the name of the shell or shell script. This is set at +shell initialization. If +.B bash +is invoked with a file of commands, +.B $0 +is set to the name of that file. If +.B bash +is started with the +.B \-c +option, then +.B $0 +is set to the first argument after the string to be +executed, if one is present. Otherwise, it is set +to the filename used to invoke +.BR bash , +as given by argument zero. +.TP +.B _ +At shell startup, set to the absolute pathname used to invoke the +shell or shell script being executed as passed in the environment +or argument list. +Subsequently, expands to the last argument to the previous command, +after expansion. +Also set to the full pathname used to invoke each command executed +and placed in the environment exported to that command. +When checking mail, this parameter holds the name of the mail file +currently being checked. +.PD +.SS Shell Variables +.PP +The following variables are set by the shell: +.PP +.PD 0 +.TP +.B BASH +Expands to the full filename used to invoke this instance of +.BR bash . +.TP +.B BASHOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +.B \-s +option to the +.B shopt +builtin command (see +.SM +.B "SHELL BUILTIN COMMANDS" +below). The options appearing in +.SM +.B BASHOPTS +are those reported as +.I on +by \fBshopt\fP. +If this variable is in the environment when +.B bash +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +.TP +.B BASHPID +Expands to the process ID of the current \fBbash\fP process. +This differs from \fB$$\fP under certain circumstances, such as subshells +that do not require \fBbash\fP to be re-initialized. +.TP +.B BASH_ALIASES +An associative array variable whose members correspond to the internal +list of aliases as maintained by the \fBalias\fP builtin. +Elements added to this array appear in the alias list; unsetting array +elements cause aliases to be removed from the alias list. +.TP +.B BASH_ARGC +An array variable whose values are the number of parameters in each +frame of the current \fBbash\fP execution call stack. +The number of +parameters to the current subroutine (shell function or script executed +with \fB.\fP or \fBsource\fP) is at the top of the stack. +When a subroutine is executed, the number of parameters passed is pushed onto +.SM +.BR BASH_ARGC . +The shell sets +.SM +.B BASH_ARGC +only when in extended debugging mode (see the description of the +.B extdebug +option to the +.B shopt +builtin below) +.TP +.B BASH_ARGV +An array variable containing all of the parameters in the current \fBbash\fP +execution call stack. The final parameter of the last subroutine call +is at the top of the stack; the first parameter of the initial call is +at the bottom. When a subroutine is executed, the parameters supplied +are pushed onto +.SM +.BR BASH_ARGV . +The shell sets +.SM +.B BASH_ARGV +only when in extended debugging mode +(see the description of the +.B extdebug +option to the +.B shopt +builtin below) +.TP +.B BASH_CMDS +An associative array variable whose members correspond to the internal +hash table of commands as maintained by the \fBhash\fP builtin. +Elements added to this array appear in the hash table; unsetting array +elements cause commands to be removed from the hash table. +.TP +.B BASH_COMMAND +The command currently being executed or about to be executed, unless the +shell is executing a command as the result of a trap, +in which case it is the command executing at the time of the trap. +.TP +.B BASH_EXECUTION_STRING +The command argument to the \fB\-c\fP invocation option. +.TP +.B BASH_LINENO +An array variable whose members are the line numbers in source files +where each corresponding member of +.SM +.B FUNCNAME +was invoked. +\fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP is the line number in the source +file (\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP) where +\fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP was called +(or \fB${BASH_LINENO[\fP\fI$i-1\fP\fB]}\fP if referenced within another +shell function). +Use +.SM +.B LINENO +to obtain the current line number. +.TP +.B BASH_REMATCH +An array variable whose members are assigned by the \fB=~\fP binary +operator to the \fB[[\fP conditional command. +The element with index 0 is the portion of the string +matching the entire regular expression. +The element with index \fIn\fP is the portion of the +string matching the \fIn\fPth parenthesized subexpression. +This variable is read-only. +.TP +.B BASH_SOURCE +An array variable whose members are the source filenames +where the corresponding shell function names in the +.SM +.B FUNCNAME +array variable are defined. +The shell function +\fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP is defined in the file +\fB${BASH_SOURCE[\fP\fI$i\fP\fB]}\fP and called from +\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP. +.TP +.B BASH_SUBSHELL +Incremented by one within each subshell or subshell environment when +the shell begins executing in that environment. +The initial value is 0. +.TP +.B BASH_VERSINFO +A readonly array variable whose members hold version information for +this instance of +.BR bash . +The values assigned to the array members are as follows: +.sp .5 +.RS +.TP 24 +.B BASH_VERSINFO[\fR0\fP] +The major version number (the \fIrelease\fP). +.TP +.B BASH_VERSINFO[\fR1\fP] +The minor version number (the \fIversion\fP). +.TP +.B BASH_VERSINFO[\fR2\fP] +The patch level. +.TP +.B BASH_VERSINFO[\fR3\fP] +The build version. +.TP +.B BASH_VERSINFO[\fR4\fP] +The release status (e.g., \fIbeta1\fP). +.TP +.B BASH_VERSINFO[\fR5\fP] +The value of +.SM +.BR MACHTYPE . +.RE +.TP +.B BASH_VERSION +Expands to a string describing the version of this instance of +.BR bash . +.TP +.B COMP_CWORD +An index into \fB${COMP_WORDS}\fP of the word containing the current +cursor position. +This variable is available only in shell functions invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_KEY +The key (or final key of a key sequence) used to invoke the current +completion function. +.TP +.B COMP_LINE +The current command line. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_POINT +The index of the current cursor position relative to the beginning of +the current command. +If the current cursor position is at the end of the current command, +the value of this variable is equal to \fB${#COMP_LINE}\fP. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_TYPE +Set to an integer value corresponding to the type of completion attempted +that caused a completion function to be called: +\fITAB\fP, for normal completion, +\fI?\fP, for listing completions after successive tabs, +\fI!\fP, for listing alternatives on partial word completion, +\fI@\fP, to list completions if the word is not unmodified, +or +\fI%\fP, for menu completion. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_WORDBREAKS +The set of characters that the \fBreadline\fP library treats as word +separators when performing word completion. +If +.SM +.B COMP_WORDBREAKS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B COMP_WORDS +An array variable (see \fBArrays\fP below) consisting of the individual +words in the current command line. +The line is split into words as \fBreadline\fP would split it, using +.SM +.B COMP_WORDBREAKS +as described above. +This variable is available only in shell functions invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COPROC +An array variable (see \fBArrays\fP below) created to hold the file descriptors +for output from and input to an unnamed coprocess (see \fBCoprocesses\fP +above). +.TP +.B DIRSTACK +An array variable (see +.B Arrays +below) containing the current contents of the directory stack. +Directories appear in the stack in the order they are displayed by the +.B dirs +builtin. +Assigning to members of this array variable may be used to modify +directories already in the stack, but the +.B pushd +and +.B popd +builtins must be used to add and remove directories. +Assignment to this variable will not change the current directory. +If +.SM +.B DIRSTACK +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B EUID +Expands to the effective user ID of the current user, initialized at +shell startup. This variable is readonly. +.TP +.B FUNCNAME +An array variable containing the names of all shell functions +currently in the execution call stack. +The element with index 0 is the name of any currently-executing +shell function. +The bottom-most element (the one with the highest index) is +.if t \f(CW"main"\fP. +.if n "main". +This variable exists only when a shell function is executing. +Assignments to +.SM +.B FUNCNAME +have no effect and return an error status. +If +.SM +.B FUNCNAME +is unset, it loses its special properties, even if it is +subsequently reset. +.if t .sp 0.5 +.if n .sp 1 +This variable can be used with \fBBASH_LINENO\fP and \fBBASH_SOURCE\fP. +Each element of \fBFUNCNAME\fP has corresponding elements in +\fBBASH_LINENO\fP and \fBBASH_SOURCE\fP to describe the call stack. +For instance, \fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP was called from the file +\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP at line number +\fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP. +The \fBcaller\fP builtin displays the current call stack using this +information. +.TP +.B GROUPS +An array variable containing the list of groups of which the current +user is a member. +Assignments to +.SM +.B GROUPS +have no effect and return an error status. +If +.SM +.B GROUPS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B HISTCMD +The history number, or index in the history list, of the current +command. +If +.SM +.B HISTCMD +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B HOSTNAME +Automatically set to the name of the current host. +.TP +.B HOSTTYPE +Automatically set to a string that uniquely +describes the type of machine on which +.B bash +is executing. +The default is system-dependent. +.TP +.B LINENO +Each time this parameter is referenced, the shell substitutes +a decimal number representing the current sequential line number +(starting with 1) within a script or function. When not in a +script or function, the value substituted is not guaranteed to +be meaningful. +If +.SM +.B LINENO +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B MACHTYPE +Automatically set to a string that fully describes the system +type on which +.B bash +is executing, in the standard GNU \fIcpu-company-system\fP format. +The default is system-dependent. +.TP +.B MAPFILE +An array variable (see \fBArrays\fP below) created to hold the text +read by the \fBmapfile\fP builtin when no variable name is supplied. +.TP +.B OLDPWD +The previous working directory as set by the +.B cd +command. +.TP +.B OPTARG +The value of the last option argument processed by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.TP +.B OPTIND +The index of the next argument to be processed by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.TP +.B OSTYPE +Automatically set to a string that +describes the operating system on which +.B bash +is executing. +The default is system-dependent. +.TP +.B PIPESTATUS +An array variable (see +.B Arrays +below) containing a list of exit status values from the processes +in the most-recently-executed foreground pipeline (which may +contain only a single command). +.TP +.B PPID +The process ID of the shell's parent. This variable is readonly. +.TP +.B PWD +The current working directory as set by the +.B cd +command. +.TP +.B RANDOM +Each time this parameter is referenced, a random integer between +0 and 32767 is +generated. The sequence of random numbers may be initialized by assigning +a value to +.SM +.BR RANDOM . +If +.SM +.B RANDOM +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B READLINE_LINE +The contents of the +.B readline +line buffer, for use with +.if t \f(CWbind -x\fP +.if n "bind -x" +(see +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.TP +.B READLINE_POINT +The position of the insertion point in the +.B readline +line buffer, for use with +.if t \f(CWbind -x\fP +.if n "bind -x" +(see +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.TP +.B REPLY +Set to the line of input read by the +.B read +builtin command when no arguments are supplied. +.TP +.B SECONDS +Each time this parameter is +referenced, the number of seconds since shell invocation is returned. If a +value is assigned to +.SM +.BR SECONDS , +the value returned upon subsequent +references is +the number of seconds since the assignment plus the value assigned. +If +.SM +.B SECONDS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B SHELLOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +.B \-o +option to the +.B set +builtin command (see +.SM +.B "SHELL BUILTIN COMMANDS" +below). The options appearing in +.SM +.B SHELLOPTS +are those reported as +.I on +by \fBset \-o\fP. +If this variable is in the environment when +.B bash +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +.TP +.B SHLVL +Incremented by one each time an instance of +.B bash +is started. +.TP +.B UID +Expands to the user ID of the current user, initialized at shell startup. +This variable is readonly. +.PD +.PP +The following variables are used by the shell. In some cases, +.B bash +assigns a default value to a variable; these cases are noted +below. +.PP +.PD 0 +.TP +.B BASH_COMPAT +The value is used to set the shell's compatibility level. +See the description of the \fBshopt\fP builtin below under +\fBSHELL BUILTIN COMMANDS\fP +for a description of the various compatibility +levels and their effects. +The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42) +corresponding to the desired compatibility level. +If \fBBASH_COMPAT\fP is unset or set to the empty string, the compatibility +level is set to the default for the current version. +If \fBBASH_COMPAT\fP is set to a value that is not one of the valid +compatibility levels, the shell prints an error message and sets the +compatibility level to the default for the current version. +The valid compatibility levels correspond to the compatibility options +accepted by the \fBshopt\fP builtin described below (for example, +\fBcompat42\fP means that 4.2 and 42 are valid values). +The current version is also a valid value. +.TP +.B BASH_ENV +If this parameter is set when \fBbash\fP is executing a shell script, +its value is interpreted as a filename containing commands to +initialize the shell, as in +.IR ~/.bashrc . +The value of +.SM +.B BASH_ENV +is subjected to parameter expansion, command substitution, and arithmetic +expansion before being interpreted as a filename. +.SM +.B PATH +is not used to search for the resultant filename. +.TP +.B BASH_XTRACEFD +If set to an integer corresponding to a valid file descriptor, \fBbash\fP +will write the trace output generated when +.if t \f(CWset -x\fP +.if n \fIset -x\fP +is enabled to that file descriptor. +The file descriptor is closed when +.SM +.B BASH_XTRACEFD +is unset or assigned a new value. +Unsetting +.SM +.B BASH_XTRACEFD +or assigning it the empty string causes the +trace output to be sent to the standard error. +Note that setting +.SM +.B BASH_XTRACEFD +to 2 (the standard error file +descriptor) and then unsetting it will result in the standard error +being closed. +.TP +.B CDPATH +The search path for the +.B cd +command. +This is a colon-separated list of directories in which the shell looks +for destination directories specified by the +.B cd +command. +A sample value is +.if t \f(CW".:~:/usr"\fP. +.if n ".:~:/usr". +.TP +.B CHILD_MAX +Set the number of exited child status values for the shell to remember. +Bash will not allow this value to be decreased below a POSIX-mandated +minimum, and there is a maximum value (currently 8192) that this may +not exceed. +The minimum value is system-dependent. +.TP +.B COLUMNS +Used by the \fBselect\fP compound command to determine the terminal width +when printing selection lists. +Automatically set if the +.B checkwinsize +option is enabled or in an interactive shell upon receipt of a +.SM +.BR SIGWINCH . +.TP +.B COMPREPLY +An array variable from which \fBbash\fP reads the possible completions +generated by a shell function invoked by the programmable completion +facility (see \fBProgrammable Completion\fP below). +Each array element contains one possible completion. +.TP +.B EMACS +If \fBbash\fP finds this variable in the environment when the shell starts +with value +.if t \f(CWt\fP, +.if n "t", +it assumes that the shell is running in an Emacs shell buffer and disables +line editing. +.TP +.B ENV +Similar to +.SM +.BR BASH_ENV ; +used when the shell is invoked in POSIX mode. +.TP +.B FCEDIT +The default editor for the +.B fc +builtin command. +.TP +.B FIGNORE +A colon-separated list of suffixes to ignore when performing +filename completion (see +.SM +.B READLINE +below). +A filename whose suffix matches one of the entries in +.SM +.B FIGNORE +is excluded from the list of matched filenames. +A sample value is +.if t \f(CW".o:~"\fP. +.if n ".o:~" +(Quoting is needed when assigning a value to this variable, +which contains tildes). +.TP +.B FUNCNEST +If set to a numeric value greater than 0, defines a maximum function +nesting level. Function invocations that exceed this nesting level +will cause the current command to abort. +.TP +.B GLOBIGNORE +A colon-separated list of patterns defining the set of filenames to +be ignored by pathname expansion. +If a filename matched by a pathname expansion pattern also matches one +of the patterns in +.SM +.BR GLOBIGNORE , +it is removed from the list of matches. +.TP +.B HISTCONTROL +A colon-separated list of values controlling how commands are saved on +the history list. +If the list of values includes +.IR ignorespace , +lines which begin with a +.B space +character are not saved in the history list. +A value of +.I ignoredups +causes lines matching the previous history entry to not be saved. +A value of +.I ignoreboth +is shorthand for \fIignorespace\fP and \fIignoredups\fP. +A value of +.IR erasedups +causes all previous lines matching the current line to be removed from +the history list before that line is saved. +Any value not in the above list is ignored. +If +.SM +.B HISTCONTROL +is unset, or does not include a valid value, +all lines read by the shell parser are saved on the history list, +subject to the value of +.SM +.BR HISTIGNORE . +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +.SM +.BR HISTCONTROL . +.TP +.B HISTFILE +The name of the file in which command history is saved (see +.SM +.B HISTORY +below). The default value is \fI~/.bash_history\fP. If unset, the +command history is not saved when a shell exits. +.TP +.B HISTFILESIZE +The maximum number of lines contained in the history file. When this +variable is assigned a value, the history file is truncated, if +necessary, +to contain no more than that number of lines by removing the oldest entries. +The history file is also truncated to this size after +writing it when a shell exits. +If the value is 0, the history file is truncated to zero size. +Non-numeric values and numeric values less than zero inhibit truncation. +The shell sets the default value to the value of \fBHISTSIZE\fP +after reading any startup files. +.TP +.B HISTIGNORE +A colon-separated list of patterns used to decide which command lines +should be saved on the history list. Each pattern is anchored at the +beginning of the line and must match the complete line (no implicit +`\fB*\fP' is appended). Each pattern is tested against the line +after the checks specified by +.SM +.B HISTCONTROL +are applied. +In addition to the normal shell pattern matching characters, `\fB&\fP' +matches the previous history line. `\fB&\fP' may be escaped using a +backslash; the backslash is removed before attempting a match. +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +.SM +.BR HISTIGNORE . +.TP +.B HISTSIZE +The number of commands to remember in the command history (see +.SM +.B HISTORY +below). +If the value is 0, commands are not saved in the history list. +Numeric values less than zero result in every command being saved +on the history list (there is no limit). +The shell sets the default value to 500 after reading any startup files. +.TP +.B HISTTIMEFORMAT +If this variable is set and not null, its value is used as a format string +for \fIstrftime\fP(3) to print the time stamp associated with each history +entry displayed by the \fBhistory\fP builtin. +If this variable is set, time stamps are written to the history file so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +.TP +.B HOME +The home directory of the current user; the default argument for the +\fBcd\fP builtin command. +The value of this variable is also used when performing tilde expansion. +.TP +.B HOSTFILE +Contains the name of a file in the same format as +.FN /etc/hosts +that should be read when the shell needs to complete a +hostname. +The list of possible hostname completions may be changed while the +shell is running; +the next time hostname completion is attempted after the +value is changed, +.B bash +adds the contents of the new file to the existing list. +If +.SM +.B HOSTFILE +is set, but has no value, or does not name a readable file, +\fBbash\fP attempts to read +.FN /etc/hosts +to obtain the list of possible hostname completions. +When +.SM +.B HOSTFILE +is unset, the hostname list is cleared. +.TP +.B IFS +The +.I Internal Field Separator +that is used +for word splitting after expansion and to +split lines into words with the +.B read +builtin command. The default value is +``''. +.TP +.B IGNOREEOF +Controls the +action of an interactive shell on receipt of an +.SM +.B EOF +character as the sole input. If set, the value is the number of +consecutive +.SM +.B EOF +characters which must be +typed as the first characters on an input line before +.B bash +exits. If the variable exists but does not have a numeric value, or +has no value, the default value is 10. If it does not exist, +.SM +.B EOF +signifies the end of input to the shell. +.TP +.B INPUTRC +The filename for the +.B readline +startup file, overriding the default of +.FN ~/.inputrc +(see +.SM +.B READLINE +below). +.TP +.B LANG +Used to determine the locale category for any category not specifically +selected with a variable starting with \fBLC_\fP. +.TP +.B LC_ALL +This variable overrides the value of +.SM +.B LANG +and any other +\fBLC_\fP variable specifying a locale category. +.TP +.B LC_COLLATE +This variable determines the collation order used when sorting the +results of pathname expansion, and determines the behavior of range +expressions, equivalence classes, and collating sequences within +pathname expansion and pattern matching. +.TP +.B LC_CTYPE +This variable determines the interpretation of characters and the +behavior of character classes within pathname expansion and pattern +matching. +.TP +.B LC_MESSAGES +This variable determines the locale used to translate double-quoted +strings preceded by a \fB$\fP. +.TP +.B LC_NUMERIC +This variable determines the locale category used for number formatting. +.TP +.B LINES +Used by the \fBselect\fP compound command to determine the column length +for printing selection lists. +Automatically set if the +.B checkwinsize +option is enabled or in an interactive shell upon receipt of a +.SM +.BR SIGWINCH . +.TP +.B MAIL +If this parameter is set to a file or directory name and the +.SM +.B MAILPATH +variable is not set, +.B bash +informs the user of the arrival of mail in the specified file or +Maildir-format directory. +.TP +.B MAILCHECK +Specifies how +often (in seconds) +.B bash +checks for mail. The default is 60 seconds. When it is time to check +for mail, the shell does so before displaying the primary prompt. +If this variable is unset, or set to a value that is not a number +greater than or equal to zero, the shell disables mail checking. +.TP +.B MAILPATH +A colon-separated list of filenames to be checked for mail. +The message to be printed when mail arrives in a particular file +may be specified by separating the filename from the message with a `?'. +When used in the text of the message, \fB$_\fP expands to the name of +the current mailfile. +Example: +.RS +.PP +\fBMAILPATH\fP=\(aq/var/mail/bfox?"You have mail":~/shell\-mail?"$_ has mail!"\(aq +.PP +.B Bash +supplies a default value for this variable, but the location of the user +mail files that it uses is system dependent (e.g., /var/mail/\fB$USER\fP). +.RE +.TP +.B OPTERR +If set to the value 1, +.B bash +displays error messages generated by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SM +.B OPTERR +is initialized to 1 each time the shell is invoked or a shell +script is executed. +.TP +.B PATH +The search path for commands. It +is a colon-separated list of directories in which +the shell looks for commands (see +.SM +.B COMMAND EXECUTION +below). +A zero-length (null) directory name in the value of +.SM +.B PATH +indicates the current directory. +A null directory name may appear as two adjacent colons, or as an initial +or trailing colon. +The default path is system-dependent, +and is set by the administrator who installs +.BR bash . +A common value is +.if t \f(CW/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin\fP. +.if n ``/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin''. +.TP +.B POSIXLY_CORRECT +If this variable is in the environment when \fBbash\fP starts, the shell +enters \fIposix mode\fP before reading the startup files, as if the +.B \-\-posix +invocation option had been supplied. If it is set while the shell is +running, \fBbash\fP enables \fIposix mode\fP, as if the command +.if t \f(CWset -o posix\fP +.if n \fIset -o posix\fP +had been executed. +.TP +.B PROMPT_COMMAND +If set, the value is executed as a command prior to issuing each primary +prompt. +.TP +.B PROMPT_DIRTRIM +If set to a number greater than zero, the value is used as the number of +trailing directory components to retain when expanding the \fB\ew\fP and +\fB\eW\fP prompt string escapes (see +.SM +.B PROMPTING +below). Characters removed are replaced with an ellipsis. +.TP +.B PS1 +The value of this parameter is expanded (see +.SM +.B PROMPTING +below) and used as the primary prompt string. The default value is +``\fB\es\-\ev\e$ \fP''. +.TP +.B PS2 +The value of this parameter is expanded as with +.SM +.B PS1 +and used as the secondary prompt string. The default is +``\fB> \fP''. +.TP +.B PS3 +The value of this parameter is used as the prompt for the +.B select +command (see +.SM +.B SHELL GRAMMAR +above). +.TP +.B PS4 +The value of this parameter is expanded as with +.SM +.B PS1 +and the value is printed before each command +.B bash +displays during an execution trace. The first character of +.SM +.B PS4 +is replicated multiple times, as necessary, to indicate multiple +levels of indirection. The default is ``\fB+ \fP''. +.TP +.B SHELL +The full pathname to the shell is kept in this environment variable. +If it is not set when the shell starts, +.B bash +assigns to it the full pathname of the current user's login shell. +.TP +.B TIMEFORMAT +The value of this parameter is used as a format string specifying +how the timing information for pipelines prefixed with the +.B time +reserved word should be displayed. +The \fB%\fP character introduces an escape sequence that is +expanded to a time value or other information. +The escape sequences and their meanings are as follows; the +braces denote optional portions. +.sp .5 +.RS +.PD 0 +.TP 10 +.B %% +A literal \fB%\fP. +.TP +.B %[\fIp\fP][l]R +The elapsed time in seconds. +.TP +.B %[\fIp\fP][l]U +The number of CPU seconds spent in user mode. +.TP +.B %[\fIp\fP][l]S +The number of CPU seconds spent in system mode. +.TP +.B %P +The CPU percentage, computed as (%U + %S) / %R. +.PD +.RE +.IP +The optional \fIp\fP is a digit specifying the \fIprecision\fP, +the number of fractional digits after a decimal point. +A value of 0 causes no decimal point or fraction to be output. +At most three places after the decimal point may be specified; +values of \fIp\fP greater than 3 are changed to 3. +If \fIp\fP is not specified, the value 3 is used. +.IP +The optional \fBl\fP specifies a longer format, including +minutes, of the form \fIMM\fPm\fISS\fP.\fIFF\fPs. +The value of \fIp\fP determines whether or not the fraction is +included. +.IP +If this variable is not set, \fBbash\fP acts as if it had the +value \fB$\(aq\enreal\et%3lR\enuser\et%3lU\ensys\et%3lS\(aq\fP. +If the value is null, no timing information is displayed. +A trailing newline is added when the format string is displayed. +.PD 0 +.TP +.B TMOUT +If set to a value greater than zero, +.SM +.B TMOUT +is treated as the +default timeout for the \fBread\fP builtin. +The \fBselect\fP command terminates if input does not arrive +after +.SM +.B TMOUT +seconds when input is coming from a terminal. +In an interactive shell, the value is interpreted as the +number of seconds to wait for a line of input after issuing the +primary prompt. +.B Bash +terminates after waiting for that number of seconds if a complete +line of input does not arrive. +.TP +.B TMPDIR +If set, \fBbash\fP uses its value as the name of a directory in which +\fBbash\fP creates temporary files for the shell's use. +.TP +.B auto_resume +This variable controls how the shell interacts with the user and +job control. If this variable is set, single word simple +commands without redirections are treated as candidates for resumption +of an existing stopped job. There is no ambiguity allowed; if there is +more than one job beginning with the string typed, the job most recently +accessed is selected. The +.I name +of a stopped job, in this context, is the command line used to +start it. +If set to the value +.IR exact , +the string supplied must match the name of a stopped job exactly; +if set to +.IR substring , +the string supplied needs to match a substring of the name of a +stopped job. The +.I substring +value provides functionality analogous to the +.B %? +job identifier (see +.SM +.B JOB CONTROL +below). If set to any other value, the supplied string must +be a prefix of a stopped job's name; this provides functionality +analogous to the \fB%\fP\fIstring\fP job identifier. +.TP +.B histchars +The two or three characters which control history expansion +and tokenization (see +.SM +.B HISTORY EXPANSION +below). The first character is the \fIhistory expansion\fP character, +the character which signals the start of a history +expansion, normally `\fB!\fP'. +The second character is the \fIquick substitution\fP +character, which is used as shorthand for re-running the previous +command entered, substituting one string for another in the command. +The default is `\fB^\fP'. +The optional third character is the character +which indicates that the remainder of the line is a comment when found +as the first character of a word, normally `\fB#\fP'. The history +comment character causes history substitution to be skipped for the +remaining words on the line. It does not necessarily cause the shell +parser to treat the rest of the line as a comment. +.PD +.SS Arrays +.B Bash +provides one-dimensional indexed and associative array variables. +Any variable may be used as an indexed array; the +.B declare +builtin will explicitly declare an array. +There is no maximum +limit on the size of an array, nor any requirement that members +be indexed or assigned contiguously. +Indexed arrays are referenced using integers (including arithmetic +expressions) and are zero-based; associative arrays are referenced +using arbitrary strings. +Unless otherwise noted, indexed array indices must be non-negative integers. +.PP +An indexed array is created automatically if any variable is assigned to +using the syntax \fIname\fP[\fIsubscript\fP]=\fIvalue\fP. The +.I subscript +is treated as an arithmetic expression that must evaluate to a number. +To explicitly declare an indexed array, use +.B declare \-a \fIname\fP +(see +.SM +.B SHELL BUILTIN COMMANDS +below). +.B declare \-a \fIname\fP[\fIsubscript\fP] +is also accepted; the \fIsubscript\fP is ignored. +.PP +Associative arrays are created using +.BR "declare \-A \fIname\fP" . +.PP +Attributes may be +specified for an array variable using the +.B declare +and +.B readonly +builtins. Each attribute applies to all members of an array. +.PP +Arrays are assigned to using compound assignments of the form +\fIname\fP=\fB(\fPvalue\fI1\fP ... value\fIn\fP\fB)\fP, where each +\fIvalue\fP is of the form [\fIsubscript\fP]=\fIstring\fP. +Indexed array assignments do not require anything but \fIstring\fP. +When assigning to indexed arrays, if the optional brackets and subscript +are supplied, that index is assigned to; +otherwise the index of the element assigned is the last index assigned +to by the statement plus one. Indexing starts at zero. +.PP +When assigning to an associative array, the subscript is required. +.PP +This syntax is also accepted by the +.B declare +builtin. Individual array elements may be assigned to using the +\fIname\fP[\fIsubscript\fP]=\fIvalue\fP syntax introduced above. +When assigning to an indexed array, if +.I name +is subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +\fIname\fP, so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.PP +Any element of an array may be referenced using +${\fIname\fP[\fIsubscript\fP]}. The braces are required to avoid +conflicts with pathname expansion. If +\fIsubscript\fP is \fB@\fP or \fB*\fP, the word expands to +all members of \fIname\fP. These subscripts differ only when the +word appears within double quotes. If the word is double-quoted, +${\fIname\fP[*]} expands to a single +word with the value of each array member separated by the first +character of the +.SM +.B IFS +special variable, and ${\fIname\fP[@]} expands each element of +\fIname\fP to a separate word. When there are no array members, +${\fIname\fP[@]} expands to nothing. +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +This is analogous to the expansion +of the special parameters \fB*\fP and \fB@\fP (see +.B Special Parameters +above). ${#\fIname\fP[\fIsubscript\fP]} expands to the length of +${\fIname\fP[\fIsubscript\fP]}. If \fIsubscript\fP is \fB*\fP or +\fB@\fP, the expansion is the number of elements in the array. +Referencing an array variable without a subscript is equivalent to +referencing the array with a subscript of 0. +If the +.I subscript +used to reference an element of an indexed array +evaluates to a number less than zero, it is +interpreted as relative to one greater than the maximum index of the array, +so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.PP +An array variable is considered set if a subscript has been assigned a +value. The null string is a valid value. +.PP +It is possible to obtain the keys (indices) of an array as well as the values. +${\fB!\fP\fIname\fP[\fI@\fP]} and ${\fB!\fP\fIname\fP[\fI*\fP]} +expand to the indices assigned in array variable \fIname\fP. +The treatment when in double quotes is similar to the expansion of the +special parameters \fI@\fP and \fI*\fP within double quotes. +.PP +The +.B unset +builtin is used to destroy arrays. \fBunset\fP \fIname\fP[\fIsubscript\fP] +destroys the array element at index \fIsubscript\fP. +Negative subscripts to indexed arrays are interpreted as described above. +Care must be taken to avoid unwanted side effects caused by pathname +expansion. +\fBunset\fP \fIname\fP, where \fIname\fP is an array, or +\fBunset\fP \fIname\fP[\fIsubscript\fP], where +\fIsubscript\fP is \fB*\fP or \fB@\fP, removes the entire array. +.PP +The +.BR declare , +.BR local , +and +.B readonly +builtins each accept a +.B \-a +option to specify an indexed array and a +.B \-A +option to specify an associative array. +If both options are supplied, +.B \-A +takes precedence. +The +.B read +builtin accepts a +.B \-a +option to assign a list of words read from the standard input +to an array. The +.B set +and +.B declare +builtins display array values in a way that allows them to be +reused as assignments. +.SH EXPANSION +Expansion is performed on the command line after it has been split into +words. There are seven kinds of expansion performed: +.IR "brace expansion" , +.IR "tilde expansion" , +.IR "parameter and variable expansion" , +.IR "command substitution" , +.IR "arithmetic expansion" , +.IR "word splitting" , +and +.IR "pathname expansion" . +.PP +The order of expansions is: +brace expansion; +tilde expansion, parameter and variable expansion, arithmetic expansion, +and command substitution (done in a left-to-right fashion); +word splitting; +and pathname expansion. +.PP +On systems that can support it, there is an additional expansion +available: \fIprocess substitution\fP. +This is performed at the +same time as tilde, parameter, variable, and arithmetic expansion and +command substitution. +.PP +Only brace expansion, word splitting, and pathname expansion +can change the number of words of the expansion; other expansions +expand a single word to a single word. +The only exceptions to this are the expansions of +"\fB$@\fP" and "\fB${\fP\fIname\fP\fB[@]}\fP" +as explained above (see +.SM +.BR PARAMETERS ). +.SS Brace Expansion +.PP +.I "Brace expansion" +is a mechanism by which arbitrary strings +may be generated. This mechanism is similar to +\fIpathname expansion\fP, but the filenames generated +need not exist. Patterns to be brace expanded take +the form of an optional +.IR preamble , +followed by either a series of comma-separated strings or +a sequence expression between a pair of braces, followed by +an optional +.IR postscript . +The preamble is prefixed to each string contained +within the braces, and the postscript is then appended +to each resulting string, expanding left to right. +.PP +Brace expansions may be nested. The results of each expanded +string are not sorted; left to right order is preserved. +For example, a\fB{\fPd,c,b\fB}\fPe expands into `ade ace abe'. +.PP +A sequence expression takes the form +\fB{\fP\fIx\fP\fB..\fP\fIy\fP\fB[..\fP\fIincr\fP\fB]}\fP, +where \fIx\fP and \fIy\fP are either integers or single characters, +and \fIincr\fP, an optional increment, is an integer. +When integers are supplied, the expression expands to each number between +\fIx\fP and \fIy\fP, inclusive. +Supplied integers may be prefixed with \fI0\fP to force each term to have the +same width. +When either \fIx\fP or \fPy\fP begins with a zero, the shell +attempts to force all generated terms to contain the same number of digits, +zero-padding where necessary. +When characters are supplied, the expression expands to each character +lexicographically between \fIx\fP and \fIy\fP, inclusive, +using the default C locale. +Note that both \fIx\fP and \fIy\fP must be of the same type. +When the increment is supplied, it is used as the difference between +each term. The default increment is 1 or -1 as appropriate. +.PP +Brace expansion is performed before any other expansions, +and any characters special to other expansions are preserved +in the result. It is strictly textual. +.B Bash +does not apply any syntactic interpretation to the context of the +expansion or the text between the braces. +.PP +A correctly-formed brace expansion must contain unquoted opening +and closing braces, and at least one unquoted comma or a valid +sequence expression. +Any incorrectly formed brace expansion is left unchanged. +A \fB{\fP or \fB,\fP may be quoted with a backslash to prevent its +being considered part of a brace expression. +To avoid conflicts with parameter expansion, the string \fB${\fP +is not considered eligible for brace expansion. +.PP +This construct is typically used as shorthand when the common +prefix of the strings to be generated is longer than in the +above example: +.RS +.PP +mkdir /usr/local/src/bash/{old,new,dist,bugs} +.RE +or +.RS +chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} +.RE +.PP +Brace expansion introduces a slight incompatibility with +historical versions of +.BR sh . +.B sh +does not treat opening or closing braces specially when they +appear as part of a word, and preserves them in the output. +.B Bash +removes braces from words as a consequence of brace +expansion. For example, a word entered to +.B sh +as \fIfile{1,2}\fP +appears identically in the output. The same word is +output as +.I file1 file2 +after expansion by +.BR bash . +If strict compatibility with +.B sh +is desired, start +.B bash +with the +.B +B +option or disable brace expansion with the +.B +B +option to the +.B set +command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SS Tilde Expansion +.PP +If a word begins with an unquoted tilde character (`\fB~\fP'), all of +the characters preceding the first unquoted slash (or all characters, +if there is no unquoted slash) are considered a \fItilde-prefix\fP. +If none of the characters in the tilde-prefix are quoted, the +characters in the tilde-prefix following the tilde are treated as a +possible \fIlogin name\fP. +If this login name is the null string, the tilde is replaced with the +value of the shell parameter +.SM +.BR HOME . +If +.SM +.B HOME +is unset, the home directory of the user executing the shell is +substituted instead. +Otherwise, the tilde-prefix is replaced with the home directory +associated with the specified login name. +.PP +If the tilde-prefix is a `~+', the value of the shell variable +.SM +.B PWD +replaces the tilde-prefix. +If the tilde-prefix is a `~\-', the value of the shell variable +.SM +.BR OLDPWD , +if it is set, is substituted. +If the characters following the tilde in the tilde-prefix consist +of a number \fIN\fP, optionally prefixed +by a `+' or a `\-', the tilde-prefix is replaced with the corresponding +element from the directory stack, as it would be displayed by the +.B dirs +builtin invoked with the tilde-prefix as an argument. +If the characters following the tilde in the tilde-prefix consist of a +number without a leading `+' or `\-', `+' is assumed. +.PP +If the login name is invalid, or the tilde expansion fails, the word +is unchanged. +.PP +Each variable assignment is checked for unquoted tilde-prefixes immediately +following a +.B : +or the first +.BR = . +In these cases, tilde expansion is also performed. +Consequently, one may use filenames with tildes in assignments to +.SM +.BR PATH , +.SM +.BR MAILPATH , +and +.SM +.BR CDPATH , +and the shell assigns the expanded value. +.SS Parameter Expansion +.PP +The `\fB$\fP' character introduces parameter expansion, +command substitution, or arithmetic expansion. The parameter name +or symbol to be expanded may be enclosed in braces, which +are optional but serve to protect the variable to be expanded from +characters immediately following it which could be +interpreted as part of the name. +.PP +When braces are used, the matching ending brace is the first `\fB}\fP' +not escaped by a backslash or within a quoted string, and not within an +embedded arithmetic expansion, command substitution, or parameter +expansion. +.PP +.PD 0 +.TP +${\fIparameter\fP} +The value of \fIparameter\fP is substituted. The braces are required +when +.I parameter +is a positional parameter with more than one digit, +or when +.I parameter +is followed by a character which is not to be +interpreted as part of its name. +The \fIparameter\fP is a shell parameter as described above +\fBPARAMETERS\fP) or an array reference (\fBArrays\fP). +.PD +.PP +If the first character of \fIparameter\fP is an exclamation point (\fB!\fP), +it introduces a level of variable indirection. +\fBBash\fP uses the value of the variable formed from the rest of +\fIparameter\fP as the name of the variable; this variable is then +expanded and that value is used in the rest of the substitution, rather +than the value of \fIparameter\fP itself. +This is known as \fIindirect expansion\fP. +The exceptions to this are the expansions of ${\fB!\fP\fIprefix\fP\fB*\fP} and +${\fB!\fP\fIname\fP[\fI@\fP]} described below. +The exclamation point must immediately follow the left brace in order to +introduce indirection. +.PP +In each of the cases below, \fIword\fP is subject to tilde expansion, +parameter expansion, command substitution, and arithmetic expansion. +.PP +When not performing substring expansion, using the forms documented below +(e.g., \fB:-\fP), +\fBbash\fP tests for a parameter that is unset or null. Omitting the colon +results in a test only for a parameter that is unset. +.PP +.PD 0 +.TP +${\fIparameter\fP\fB:\-\fP\fIword\fP} +\fBUse Default Values\fP. If +.I parameter +is unset or null, the expansion of +.I word +is substituted. Otherwise, the value of +.I parameter +is substituted. +.TP +${\fIparameter\fP\fB:=\fP\fIword\fP} +\fBAssign Default Values\fP. +If +.I parameter +is unset or null, the expansion of +.I word +is assigned to +.IR parameter . +The value of +.I parameter +is then substituted. Positional parameters and special parameters may +not be assigned to in this way. +.TP +${\fIparameter\fP\fB:?\fP\fIword\fP} +\fBDisplay Error if Null or Unset\fP. +If +.I parameter +is null or unset, the expansion of \fIword\fP (or a message to that effect +if +.I word +is not present) is written to the standard error and the shell, if it +is not interactive, exits. Otherwise, the value of \fIparameter\fP is +substituted. +.TP +${\fIparameter\fP\fB:+\fP\fIword\fP} +\fBUse Alternate Value\fP. +If +.I parameter +is null or unset, nothing is substituted, otherwise the expansion of +.I word +is substituted. +.TP +${\fIparameter\fP\fB:\fP\fIoffset\fP} +.PD 0 +.TP +${\fIparameter\fP\fB:\fP\fIoffset\fP\fB:\fP\fIlength\fP} +.PD +\fBSubstring Expansion\fP. +Expands to up to \fIlength\fP characters of the value of \fIparameter\fP +starting at the character specified by \fIoffset\fP. +If \fIparameter\fP is \fB@\fP, an indexed array subscripted by +\fB@\fP or \fB*\fP, or an associative array name, the results differ as +described below. +If \fIlength\fP is omitted, expands to the substring of the value of +\fIparameter\fP starting at the character specified by \fIoffset\fP +and extending to the end of the value. +\fIlength\fP and \fIoffset\fP are arithmetic expressions (see +.SM +.B +ARITHMETIC EVALUATION +below). +.sp 1 +If \fIoffset\fP evaluates to a number less than zero, the value +is used as an offset in characters +from the end of the value of \fIparameter\fP. +If \fIlength\fP evaluates to a number less than zero, +it is interpreted as an offset in characters +from the end of the value of \fIparameter\fP rather than +a number of characters, and the expansion is the characters between +\fIoffset\fP and that result. +Note that a negative offset must be separated from the colon by at least +one space to avoid being confused with the \fB:-\fP expansion. +.sp 1 +If \fIparameter\fP is \fB@\fP, the result is \fIlength\fP positional +parameters beginning at \fIoffset\fP. +A negative \fIoffset\fP is taken relative to one greater than the greatest +positional parameter, so an offset of -1 evaluates to the last positional +parameter. +It is an expansion error if \fIlength\fP evaluates to a number less than +zero. +.sp 1 +If \fIparameter\fP is an indexed array name subscripted by @ or *, +the result is the \fIlength\fP +members of the array beginning with ${\fIparameter\fP[\fIoffset\fP]}. +A negative \fIoffset\fP is taken relative to one greater than the maximum +index of the specified array. +It is an expansion error if \fIlength\fP evaluates to a number less than +zero. +.sp 1 +Substring expansion applied to an associative array produces undefined +results. +.sp 1 +Substring indexing is zero-based unless the positional parameters +are used, in which case the indexing starts at 1 by default. +If \fIoffset\fP is 0, and the positional parameters are used, \fB$0\fP is +prefixed to the list. +.TP +${\fB!\fP\fIprefix\fP\fB*\fP} +.PD 0 +.TP +${\fB!\fP\fIprefix\fP\fB@\fP} +.PD +\fBNames matching prefix\fP. +Expands to the names of variables whose names begin with \fIprefix\fP, +separated by the first character of the +.SM +.B IFS +special variable. +When \fI@\fP is used and the expansion appears within double quotes, each +variable name expands to a separate word. +.TP +${\fB!\fP\fIname\fP[\fI@\fP]} +.PD 0 +.TP +${\fB!\fP\fIname\fP[\fI*\fP]} +.PD +\fBList of array keys\fP. +If \fIname\fP is an array variable, expands to the list of array indices +(keys) assigned in \fIname\fP. +If \fIname\fP is not an array, expands to 0 if \fIname\fP is set and null +otherwise. +When \fI@\fP is used and the expansion appears within double quotes, each +key expands to a separate word. +.TP +${\fB#\fP\fIparameter\fP} +\fBParameter length\fP. +The length in characters of the value of \fIparameter\fP is substituted. +If +.I parameter +is +.B * +or +.BR @ , +the value substituted is the number of positional parameters. +If +.I parameter +is an array name subscripted by +.B * +or +.BR @ , +the value substituted is the number of elements in the array. +If +.I parameter +is an indexed array name subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +\fIparameter\fP, so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.TP +${\fIparameter\fP\fB#\fP\fIword\fP} +.PD 0 +.TP +${\fIparameter\fP\fB##\fP\fIword\fP} +.PD +\fBRemove matching prefix pattern\fP. +The +.I word +is expanded to produce a pattern just as in pathname +expansion. If the pattern matches the beginning of +the value of +.IR parameter , +then the result of the expansion is the expanded value of +.I parameter +with the shortest matching pattern (the ``\fB#\fP'' case) or the +longest matching pattern (the ``\fB##\fP'' case) deleted. +If +.I parameter +is +.B @ +or +.BR * , +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB%\fP\fIword\fP} +.PD 0 +.TP +${\fIparameter\fP\fB%%\fP\fIword\fP} +.PD +\fBRemove matching suffix pattern\fP. +The \fIword\fP is expanded to produce a pattern just as in +pathname expansion. +If the pattern matches a trailing portion of the expanded value of +.IR parameter , +then the result of the expansion is the expanded value of +.I parameter +with the shortest matching pattern (the ``\fB%\fP'' case) or the +longest matching pattern (the ``\fB%%\fP'' case) deleted. +If +.I parameter +is +.B @ +or +.BR * , +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB/\fP\fIpattern\fP\fB/\fP\fIstring\fP} +\fBPattern substitution\fP. +The \fIpattern\fP is expanded to produce a pattern just as in +pathname expansion. +\fIParameter\fP is expanded and the longest match of \fIpattern\fP +against its value is replaced with \fIstring\fP. +If \fIpattern\fP begins with \fB/\fP, all matches of \fIpattern\fP are +replaced with \fIstring\fP. Normally only the first match is replaced. +If \fIpattern\fP begins with \fB#\fP, it must match at the beginning +of the expanded value of \fIparameter\fP. +If \fIpattern\fP begins with \fB%\fP, it must match at the end +of the expanded value of \fIparameter\fP. +If \fIstring\fP is null, matches of \fIpattern\fP are deleted +and the \fB/\fP following \fIpattern\fP may be omitted. +If +.I parameter +is +.B @ +or +.BR * , +the substitution operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the substitution operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB^\fP\fIpattern\fP} +.PD 0 +.TP +${\fIparameter\fP\fB^^\fP\fIpattern\fP} +.TP +${\fIparameter\fP\fB,\fP\fIpattern\fP} +.TP +${\fIparameter\fP\fB,,\fP\fIpattern\fP} +.PD +\fBCase modification\fP. +This expansion modifies the case of alphabetic characters in \fIparameter\fP. +The \fIpattern\fP is expanded to produce a pattern just as in +pathname expansion. +Each character in the expanded value of \fIparameter\fP is tested against +\fIpattern\fP, and, if it matches the pattern, its case is converted. +The pattern should not attempt to match more than one character. +The \fB^\fP operator converts lowercase letters matching \fIpattern\fP +to uppercase; the \fB,\fP operator converts matching uppercase letters +to lowercase. +The \fB^^\fP and \fB,,\fP expansions convert each matched character in the +expanded value; the \fB^\fP and \fB,\fP expansions match and convert only +the first character in the expanded value. +If \fIpattern\fP is omitted, it is treated like a \fB?\fP, which matches +every character. +If +.I parameter +is +.B @ +or +.BR * , +the case modification operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the case modification operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.SS Command Substitution +.PP +\fICommand substitution\fP allows the output of a command to replace +the command name. There are two forms: +.RS +.PP +\fB$(\fP\fIcommand\fP\|\fB)\fP +.RE +or +.RS +\fB\`\fP\fIcommand\fP\fB\`\fP +.RE +.PP +.B Bash +performs the expansion by executing \fIcommand\fP and +replacing the command substitution with the standard output of the +command, with any trailing newlines deleted. +Embedded newlines are not deleted, but they may be removed during +word splitting. +The command substitution \fB$(cat \fIfile\fP)\fR can be replaced by +the equivalent but faster \fB$(< \fIfile\fP)\fR. +.PP +When the old-style backquote form of substitution is used, +backslash retains its literal meaning except when followed by +.BR $ , +.BR \` , +or +.BR \e . +The first backquote not preceded by a backslash terminates the +command substitution. +When using the $(\^\fIcommand\fP\|) form, all characters between the +parentheses make up the command; none are treated specially. +.PP +Command substitutions may be nested. To nest when using the backquoted form, +escape the inner backquotes with backslashes. +.PP +If the substitution appears within double quotes, word splitting and +pathname expansion are not performed on the results. +.SS Arithmetic Expansion +.PP +Arithmetic expansion allows the evaluation of an arithmetic expression +and the substitution of the result. The format for arithmetic expansion is: +.RS +.PP +\fB$((\fP\fIexpression\fP\fB))\fP +.RE +.PP +The old format \fB$[\fP\fIexpression\fP\fB]\fP is deprecated and will +be removed in upcoming versions of bash. +.PP +The +.I expression +is treated as if it were within double quotes, but a double quote +inside the parentheses is not treated specially. +All tokens in the expression undergo parameter and variable expansion, +command substitution, and quote removal. +The result is treated as the arithmetic expression to be evaluated. +Arithmetic expansions may be nested. +.PP +The evaluation is performed according to the rules listed below under +.SM +.BR "ARITHMETIC EVALUATION" . +If +.I expression +is invalid, +.B bash +prints a message indicating failure and no substitution occurs. +.SS Process Substitution +.PP +\fIProcess substitution\fP is supported on systems that support named +pipes (\fIFIFOs\fP) or the \fB/dev/fd\fP method of naming open files. +It takes the form of +\fB<(\fP\fIlist\^\fP\fB)\fP +or +\fB>(\fP\fIlist\^\fP\fB)\fP. +The process \fIlist\fP is run with its input or output connected to a +\fIFIFO\fP or some file in \fB/dev/fd\fP. The name of this file is +passed as an argument to the current command as the result of the +expansion. If the \fB>(\fP\fIlist\^\fP\fB)\fP form is used, writing to +the file will provide input for \fIlist\fP. If the +\fB<(\fP\fIlist\^\fP\fB)\fP form is used, the file passed as an +argument should be read to obtain the output of \fIlist\fP. +.PP +When available, process substitution is performed +simultaneously with parameter and variable expansion, +command substitution, +and arithmetic expansion. +.SS Word Splitting +.PP +The shell scans the results of +parameter expansion, +command substitution, +and +arithmetic expansion +that did not occur within double quotes for +.IR "word splitting" . +.PP +The shell treats each character of +.SM +.B IFS +as a delimiter, and splits the results of the other +expansions into words using these characters as field terminators. +If +.SM +.B IFS +is unset, or its +value is exactly +.BR , +the default, then +sequences of +.BR , +.BR , +and +.B +at the beginning and end of the results of the previous +expansions are ignored, and +any sequence of +.SM +.B IFS +characters not at the beginning or end serves to delimit words. +If +.SM +.B IFS +has a value other than the default, then sequences of +the whitespace characters +.B space +and +.B tab +are ignored at the beginning and end of the +word, as long as the whitespace character is in the +value of +.SM +.BR IFS +(an +.SM +.B IFS +whitespace character). +Any character in +.SM +.B IFS +that is not +.SM +.B IFS +whitespace, along with any adjacent +.SM +.B IFS +whitespace characters, delimits a field. +A sequence of +.SM +.B IFS +whitespace characters is also treated as a delimiter. +If the value of +.SM +.B IFS +is null, no word splitting occurs. +.PP +Explicit null arguments (\^\f3"\^"\fP or \^\f3\(aq\^\(aq\fP\^) are retained. +Unquoted implicit null arguments, resulting from the expansion of +parameters that have no values, are removed. +If a parameter with no value is expanded within double quotes, a +null argument results and is retained. +.PP +Note that if no expansion occurs, no splitting +is performed. +.SS Pathname Expansion +.PP +After word splitting, +unless the +.B \-f +option has been set, +.B bash +scans each word for the characters +.BR * , +.BR ? , +and +.BR [ . +If one of these characters appears, then the word is +regarded as a +.IR pattern , +and replaced with an alphabetically sorted list of +filenames matching the pattern +(see +.SM +.B "Pattern Matching" +below). +If no matching filenames are found, +and the shell option +.B nullglob +is not enabled, the word is left unchanged. +If the +.B nullglob +option is set, and no matches are found, +the word is removed. +If the +.B failglob +shell option is set, and no matches are found, an error message +is printed and the command is not executed. +If the shell option +.B nocaseglob +is enabled, the match is performed without regard to the case +of alphabetic characters. +Note that when using range expressions like +[a-z] (see below), letters of the other case may be included, +depending on the setting of +.B LC_COLLATE. +When a pattern is used for pathname expansion, +the character +.B ``.'' +at the start of a name or immediately following a slash +must be matched explicitly, unless the shell option +.B dotglob +is set. +When matching a pathname, the slash character must always be +matched explicitly. +In other cases, the +.B ``.'' +character is not treated specially. +See the description of +.B shopt +below under +.SM +.B SHELL BUILTIN COMMANDS +for a description of the +.BR nocaseglob , +.BR nullglob , +.BR failglob , +and +.B dotglob +shell options. +.PP +The +.SM +.B GLOBIGNORE +shell variable may be used to restrict the set of filenames matching a +.IR pattern . +If +.SM +.B GLOBIGNORE +is set, each matching filename that also matches one of the patterns in +.SM +.B GLOBIGNORE +is removed from the list of matches. +The filenames +.B ``.'' +and +.B ``..'' +are always ignored when +.SM +.B GLOBIGNORE +is set and not null. However, setting +.SM +.B GLOBIGNORE +to a non-null value has the effect of enabling the +.B dotglob +shell option, so all other filenames beginning with a +.B ``.'' +will match. +To get the old behavior of ignoring filenames beginning with a +.BR ``.'' , +make +.B ``.*'' +one of the patterns in +.SM +.BR GLOBIGNORE . +The +.B dotglob +option is disabled when +.SM +.B GLOBIGNORE +is unset. +.PP +\fBPattern Matching\fP +.PP +Any character that appears in a pattern, other than the special pattern +characters described below, matches itself. The NUL character may not +occur in a pattern. A backslash escapes the following character; the +escaping backslash is discarded when matching. +The special pattern characters must be quoted if +they are to be matched literally. +.PP +The special pattern characters have the following meanings: +.PP +.PD 0 +.RS +.TP +.B * +Matches any string, including the null string. +When the \fBglobstar\fP shell option is enabled, and \fB*\fP is used in +a pathname expansion context, two adjacent \fB*\fPs used as a single +pattern will match all files and zero or more directories and +subdirectories. +If followed by a \fB/\fP, two adjacent \fB*\fPs will match only directories +and subdirectories. +.TP +.B ? +Matches any single character. +.TP +.B [...] +Matches any one of the enclosed characters. A pair of characters +separated by a hyphen denotes a +\fIrange expression\fP; +any character that falls between those two characters, inclusive, +using the current locale's collating sequence and character set, +is matched. If the first character following the +.B [ +is a +.B ! +or a +.B ^ +then any character not enclosed is matched. +The sorting order of characters in range expressions is determined by +the current locale and the values of the +.SM +.B LC_COLLATE +or +.SM +.B LC_ALL +shell variables, if set. +To obtain the traditional interpretation of range expressions, where +.B [a\-d] +is equivalent to +.BR [abcd] , +set value of the +.B LC_ALL +shell variable to +.BR C , +or enable the +.B globasciiranges +shell option. +A +.B \- +may be matched by including it as the first or last character +in the set. +A +.B ] +may be matched by including it as the first character +in the set. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +\fIcharacter classes\fP can be specified using the syntax +\fB[:\fP\fIclass\fP\fB:]\fP, where \fIclass\fP is one of the +following classes defined in the POSIX standard: +.PP +.RS +.B +.if n alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit +.if t alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit +.br +A character class matches any character belonging to that class. +The \fBword\fP character class matches letters, digits, and the character _. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +an \fIequivalence class\fP can be specified using the syntax +\fB[=\fP\fIc\fP\fB=]\fP, which matches all characters with the +same collation weight (as defined by the current locale) as +the character \fIc\fP. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +the syntax \fB[.\fP\fIsymbol\fP\fB.]\fP matches the collating symbol +\fIsymbol\fP. +.RE +.RE +.PD +.PP +If the \fBextglob\fP shell option is enabled using the \fBshopt\fP +builtin, several extended pattern matching operators are recognized. +In the following description, a \fIpattern-list\fP is a list of one +or more patterns separated by a \fB|\fP. +Composite patterns may be formed using one or more of the following +sub-patterns: +.sp 1 +.PD 0 +.RS +.TP +\fB?(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches zero or one occurrence of the given patterns +.TP +\fB*(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches zero or more occurrences of the given patterns +.TP +\fB+(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches one or more occurrences of the given patterns +.TP +\fB@(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches one of the given patterns +.TP +\fB!(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches anything except one of the given patterns +.RE +.PD +.SS Quote Removal +.PP +After the preceding expansions, all unquoted occurrences of the +characters +.BR \e , +.BR \(aq , +and \^\f3"\fP\^ that did not result from one of the above +expansions are removed. +.SH REDIRECTION +Before a command is executed, its input and output +may be +.I redirected +using a special notation interpreted by the shell. +Redirection allows commands' file handles to be +duplicated, opened, closed, +made to refer to different files, +and can change the files the command reads from and writes to. +Redirection may also be used to modify file handles in the +current shell execution environment. +The following redirection +operators may precede or appear anywhere within a +.I simple command +or may follow a +.IR command . +Redirections are processed in the order they appear, from +left to right. +.PP +Each redirection that may be preceded by a file descriptor number +may instead be preceded by a word of the form {\fIvarname\fP}. +In this case, for each redirection operator except +>&- and <&-, the shell will allocate a file descriptor greater +than or equal to 10 and assign it to \fIvarname\fP. +If >&- or <&- is preceded +by {\fIvarname\fP}, the value of \fIvarname\fP defines the file +descriptor to close. +.PP +In the following descriptions, if the file descriptor number is +omitted, and the first character of the redirection operator is +.BR < , +the redirection refers to the standard input (file descriptor +0). If the first character of the redirection operator is +.BR > , +the redirection refers to the standard output (file descriptor +1). +.PP +The word following the redirection operator in the following +descriptions, unless otherwise noted, is subjected to +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, quote removal, +pathname expansion, and word splitting. +If it expands to more than one word, +.B bash +reports an error. +.PP +Note that the order of redirections is significant. For example, +the command +.RS +.PP +ls \fB>\fP dirlist 2\fB>&\fP1 +.RE +.PP +directs both standard output and standard error to the file +.IR dirlist , +while the command +.RS +.PP +ls 2\fB>&\fP1 \fB>\fP dirlist +.RE +.PP +directs only the standard output to file +.IR dirlist , +because the standard error was duplicated from the standard output +before the standard output was redirected to +.IR dirlist . +.PP +\fBBash\fP handles several filenames specially when they are used in +redirections, as described in the following table: +.RS +.PP +.PD 0 +.TP +.B /dev/fd/\fIfd\fP +If \fIfd\fP is a valid integer, file descriptor \fIfd\fP is duplicated. +.TP +.B /dev/stdin +File descriptor 0 is duplicated. +.TP +.B /dev/stdout +File descriptor 1 is duplicated. +.TP +.B /dev/stderr +File descriptor 2 is duplicated. +.TP +.B /dev/tcp/\fIhost\fP/\fIport\fP +If \fIhost\fP is a valid hostname or Internet address, and \fIport\fP +is an integer port number or service name, \fBbash\fP attempts to open +the corresponding TCP socket. +.TP +.B /dev/udp/\fIhost\fP/\fIport\fP +If \fIhost\fP is a valid hostname or Internet address, and \fIport\fP +is an integer port number or service name, \fBbash\fP attempts to open +the corresponding UDP socket. +.PD +.RE +.PP +A failure to open or create a file causes the redirection to fail. +.PP +Redirections using file descriptors greater than 9 should be used with +care, as they may conflict with file descriptors the shell uses +internally. +.SS Redirecting Input +.PP +Redirection of input causes the file whose name results from +the expansion of +.I word +to be opened for reading on file descriptor +.IR n , +or the standard input (file descriptor 0) if +.I n +is not specified. +.PP +The general format for redirecting input is: +.RS +.PP +[\fIn\fP]\fB<\fP\fIword\fP +.RE +.SS Redirecting Output +.PP +Redirection of output causes the file whose name results from +the expansion of +.I word +to be opened for writing on file descriptor +.IR n , +or the standard output (file descriptor 1) if +.I n +is not specified. If the file does not exist it is created; +if it does exist it is truncated to zero size. +.PP +The general format for redirecting output is: +.RS +.PP +[\fIn\fP]\fB>\fP\fIword\fP +.RE +.PP +If the redirection operator is +.BR > , +and the +.B noclobber +option to the +.B set +builtin has been enabled, the redirection will fail if the file +whose name results from the expansion of \fIword\fP exists and is +a regular file. +If the redirection operator is +.BR >| , +or the redirection operator is +.B > +and the +.B noclobber +option to the +.B set +builtin command is not enabled, the redirection is attempted even +if the file named by \fIword\fP exists. +.SS Appending Redirected Output +.PP +Redirection of output in this fashion +causes the file whose name results from +the expansion of +.I word +to be opened for appending on file descriptor +.IR n , +or the standard output (file descriptor 1) if +.I n +is not specified. If the file does not exist it is created. +.PP +The general format for appending output is: +.RS +.PP +[\fIn\fP]\fB>>\fP\fIword\fP +.RE +.PP +.SS Redirecting Standard Output and Standard Error +.PP +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be redirected to the file whose name is the +expansion of +.IR word . +.PP +There are two formats for redirecting standard output and +standard error: +.RS +.PP +\fB&>\fP\fIword\fP +.RE +and +.RS +\fB>&\fP\fIword\fP +.RE +.PP +Of the two forms, the first is preferred. +This is semantically equivalent to +.RS +.PP +\fB>\fP\fIword\fP 2\fB>&\fP1 +.RE +.PP +When using the second form, \fIword\fP may not expand to a number or +\fB\-\fP. If it does, other redirection operators apply +(see \fBDuplicating File Descriptors\fP below) for compatibility +reasons. +.SS Appending Standard Output and Standard Error +.PP +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be appended to the file whose name is the +expansion of +.IR word . +.PP +The format for appending standard output and standard error is: +.RS +.PP +\fB&>>\fP\fIword\fP +.RE +.PP +This is semantically equivalent to +.RS +.PP +\fB>>\fP\fIword\fP 2\fB>&\fP1 +.RE +.PP +(see \fBDuplicating File Descriptors\fP below). +.SS Here Documents +.PP +This type of redirection instructs the shell to read input from the +current source until a line containing only +.I delimiter +(with no trailing blanks) +is seen. All of +the lines read up to that point are then used as the standard +input for a command. +.PP +The format of here-documents is: +.RS +.PP +.nf +\fB<<\fP[\fB\-\fP]\fIword\fP + \fIhere-document\fP +\fIdelimiter\fP +.fi +.RE +.PP +No parameter and variable expansion, command substitution, +arithmetic expansion, or pathname expansion is performed on +.IR word . +If any characters in +.I word +are quoted, the +.I delimiter +is the result of quote removal on +.IR word , +and the lines in the here-document are not expanded. +If \fIword\fP is unquoted, +all lines of the here-document are subjected to +parameter expansion, command substitution, and arithmetic expansion, +the character sequence +.B \e +is ignored, and +.B \e +must be used to quote the characters +.BR \e , +.BR $ , +and +.BR \` . +.PP +If the redirection operator is +.BR <<\- , +then all leading tab characters are stripped from input lines and the +line containing +.IR delimiter . +This allows +here-documents within shell scripts to be indented in a +natural fashion. +.SS "Here Strings" +A variant of here documents, the format is: +.RS +.PP +.nf +\fB<<<\fP\fIword\fP +.fi +.RE +.PP +The \fIword\fP undergoes +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote removal. +Pathname expansion and word splitting are not performed. +The result is supplied as a single string to the command on its +standard input. +.SS "Duplicating File Descriptors" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<&\fP\fIword\fP +.RE +.PP +is used to duplicate input file descriptors. +If +.I word +expands to one or more digits, the file descriptor denoted by +.I n +is made to be a copy of that file descriptor. +If the digits in +.I word +do not specify a file descriptor open for input, a redirection error occurs. +If +.I word +evaluates to +.BR \- , +file descriptor +.I n +is closed. If +.I n +is not specified, the standard input (file descriptor 0) is used. +.PP +The operator +.RS +.PP +[\fIn\fP]\fB>&\fP\fIword\fP +.RE +.PP +is used similarly to duplicate output file descriptors. If +.I n +is not specified, the standard output (file descriptor 1) is used. +If the digits in +.I word +do not specify a file descriptor open for output, a redirection error occurs. +If +.I word +evaluates to +.BR \- , +file descriptor +.I n +is closed. +As a special case, if \fIn\fP is omitted, and \fIword\fP does not +expand to one or more digits or \fB\-\fP, the standard output and standard +error are redirected as described previously. +.SS "Moving File Descriptors" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<&\fP\fIdigit\fP\fB\-\fP +.RE +.PP +moves the file descriptor \fIdigit\fP to file descriptor +.IR n , +or the standard input (file descriptor 0) if \fIn\fP is not specified. +\fIdigit\fP is closed after being duplicated to \fIn\fP. +.PP +Similarly, the redirection operator +.RS +.PP +[\fIn\fP]\fB>&\fP\fIdigit\fP\fB\-\fP +.RE +.PP +moves the file descriptor \fIdigit\fP to file descriptor +.IR n , +or the standard output (file descriptor 1) if \fIn\fP is not specified. +.SS "Opening File Descriptors for Reading and Writing" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<>\fP\fIword\fP +.RE +.PP +causes the file whose name is the expansion of +.I word +to be opened for both reading and writing on file descriptor +.IR n , +or on file descriptor 0 if +.I n +is not specified. If the file does not exist, it is created. +.SH ALIASES +\fIAliases\fP allow a string to be substituted for a word when it is used +as the first word of a simple command. +The shell maintains a list of aliases that may be set and unset with the +.B alias +and +.B unalias +builtin commands (see +.SM +.B SHELL BUILTIN COMMANDS +below). +The first word of each simple command, if unquoted, +is checked to see if it has an +alias. If so, that word is replaced by the text of the alias. +The characters \fB/\fP, \fB$\fP, \fB\`\fP, and \fB=\fP and +any of the shell \fImetacharacters\fP or quoting characters +listed above may not appear in an alias name. +The replacement text may contain any valid shell input, +including shell metacharacters. +The first word of the replacement text is tested +for aliases, but a word that is identical to an alias being expanded +is not expanded a second time. +This means that one may alias +.B ls +to +.BR "ls \-F" , +for instance, and +.B bash +does not try to recursively expand the replacement text. +If the last character of the alias value is a +.IR blank , +then the next command +word following the alias is also checked for alias expansion. +.PP +Aliases are created and listed with the +.B alias +command, and removed with the +.B unalias +command. +.PP +There is no mechanism for using arguments in the replacement text. +If arguments are needed, a shell function should be used (see +.SM +.B FUNCTIONS +below). +.PP +Aliases are not expanded when the shell is not interactive, unless +the +.B expand_aliases +shell option is set using +.B shopt +(see the description of +.B shopt +under +.SM +\fBSHELL BUILTIN COMMANDS\fP +below). +.PP +The rules concerning the definition and use of aliases are +somewhat confusing. +.B Bash +always reads at least one complete line +of input before executing any +of the commands on that line. Aliases are expanded when a +command is read, not when it is executed. Therefore, an +alias definition appearing on the same line as another +command does not take effect until the next line of input is read. +The commands following the alias definition +on that line are not affected by the new alias. +This behavior is also an issue when functions are executed. +Aliases are expanded when a function definition is read, +not when the function is executed, because a function definition +is itself a compound command. As a consequence, aliases +defined in a function are not available until after that +function is executed. To be safe, always put +alias definitions on a separate line, and do not use +.B alias +in compound commands. +.PP +For almost every purpose, aliases are superseded by +shell functions. +.SH FUNCTIONS +A shell function, defined as described above under +.SM +.BR "SHELL GRAMMAR" , +stores a series of commands for later execution. +When the name of a shell function is used as a simple command name, +the list of commands associated with that function name is executed. +Functions are executed in the context of the +current shell; no new process is created to interpret +them (contrast this with the execution of a shell script). +When a function is executed, the arguments to the +function become the positional parameters +during its execution. +The special parameter +.B # +is updated to reflect the change. Special parameter \fB0\fP +is unchanged. +The first element of the +.SM +.B FUNCNAME +variable is set to the name of the function while the function +is executing. +.PP +All other aspects of the shell execution +environment are identical between a function and its caller +with these exceptions: the +.SM +.B DEBUG +and +.B RETURN +traps (see the description of the +.B trap +builtin under +.SM +.B SHELL BUILTIN COMMANDS +below) are not inherited unless the function has been given the +\fBtrace\fP attribute (see the description of the +.SM +.B declare +builtin below) or the +\fB\-o functrace\fP shell option has been enabled with +the \fBset\fP builtin +(in which case all functions inherit the \fBDEBUG\fP and \fBRETURN\fP traps), +and the +.SM +.B ERR +trap is not inherited unless the \fB\-o errtrace\fP shell option has +been enabled. +.PP +Variables local to the function may be declared with the +.B local +builtin command. Ordinarily, variables and their values +are shared between the function and its caller. +.PP +The \fBFUNCNEST\fP variable, if set to a numeric value greater +than 0, defines a maximum function nesting level. Function +invocations that exceed the limit cause the entire command to +abort. +.PP +If the builtin command +.B return +is executed in a function, the function completes and +execution resumes with the next command after the function +call. +Any command associated with the \fBRETURN\fP trap is executed +before execution resumes. +When a function completes, the values of the +positional parameters and the special parameter +.B # +are restored to the values they had prior to the function's +execution. +.PP +Function names and definitions may be listed with the +.B \-f +option to the +.B declare +or +.B typeset +builtin commands. The +.B \-F +option to +.B declare +or +.B typeset +will list the function names only +(and optionally the source file and line number, if the \fBextdebug\fP +shell option is enabled). +Functions may be exported so that subshells +automatically have them defined with the +.B \-f +option to the +.B export +builtin. +A function definition may be deleted using the \fB\-f\fP option to +the +.B unset +builtin. +Note that shell functions and variables with the same name may result +in multiple identically-named entries in the environment passed to the +shell's children. +Care should be taken in cases where this may cause a problem. +.PP +Functions may be recursive. +The \fBFUNCNEST\fP variable may be used to limit the depth of the +function call stack and restrict the number of function invocations. +By default, no limit is imposed on the number of recursive calls. +.SH "ARITHMETIC EVALUATION" +The shell allows arithmetic expressions to be evaluated, under +certain circumstances (see the \fBlet\fP and \fBdeclare\fP builtin +commands and \fBArithmetic Expansion\fP). +Evaluation is done in fixed-width integers with no check for overflow, +though division by 0 is trapped and flagged as an error. +The operators and their precedence, associativity, and values +are the same as in the C language. +The following list of operators is grouped into levels of +equal-precedence operators. +The levels are listed in order of decreasing precedence. +.PP +.PD 0 +.TP +.B \fIid\fP++ \fIid\fP\-\- +variable post-increment and post-decrement +.TP +.B ++\fIid\fP \-\-\fIid\fP +variable pre-increment and pre-decrement +.TP +.B \- + +unary minus and plus +.TP +.B ! ~ +logical and bitwise negation +.TP +.B ** +exponentiation +.TP +.B * / % +multiplication, division, remainder +.TP +.B + \- +addition, subtraction +.TP +.B << >> +left and right bitwise shifts +.TP +.B <= >= < > +comparison +.TP +.B == != +equality and inequality +.TP +.B & +bitwise AND +.TP +.B ^ +bitwise exclusive OR +.TP +.B | +bitwise OR +.TP +.B && +logical AND +.TP +.B || +logical OR +.TP +.B \fIexpr\fP?\fIexpr\fP:\fIexpr\fP +conditional operator +.TP +.B = *= /= %= += \-= <<= >>= &= ^= |= +assignment +.TP +.B \fIexpr1\fP , \fIexpr2\fP +comma +.PD +.PP +Shell variables are allowed as operands; parameter expansion is +performed before the expression is evaluated. +Within an expression, shell variables may also be referenced by name +without using the parameter expansion syntax. +A shell variable that is null or unset evaluates to 0 when referenced +by name without using the parameter expansion syntax. +The value of a variable is evaluated as an arithmetic expression +when it is referenced, or when a variable which has been given the +\fIinteger\fP attribute using \fBdeclare -i\fP is assigned a value. +A null value evaluates to 0. +A shell variable need not have its \fIinteger\fP attribute +turned on to be used in an expression. +.PP +Constants with a leading 0 are interpreted as octal numbers. +A leading 0x or 0X denotes hexadecimal. +Otherwise, numbers take the form [\fIbase#\fP]n, where the optional \fIbase\fP +is a decimal number between 2 and 64 representing the arithmetic +base, and \fIn\fP is a number in that base. +If \fIbase#\fP is omitted, then base 10 is used. +When specifying \fIn\fP, +the digits greater< than 9 are represented by the lowercase letters, +the uppercase letters, @, and _, in that order. +If \fIbase\fP is less than or equal to 36, lowercase and uppercase +letters may be used interchangeably to represent numbers between 10 +and 35. +.PP +Operators are evaluated in order of precedence. Sub-expressions in +parentheses are evaluated first and may override the precedence +rules above. +.SH "CONDITIONAL EXPRESSIONS" +Conditional expressions are used by the \fB[[\fP compound command and +the \fBtest\fP and \fB[\fP builtin commands to test file attributes +and perform string and arithmetic comparisons. +Expressions are formed from the following unary or binary primaries. +If any \fIfile\fP argument to one of the primaries is of the form +\fI/dev/fd/n\fP, then file descriptor \fIn\fP is checked. +If the \fIfile\fP argument to one of the primaries is one of +\fI/dev/stdin\fP, \fI/dev/stdout\fP, or \fI/dev/stderr\fP, file +descriptor 0, 1, or 2, respectively, is checked. +.PP +Unless otherwise specified, primaries that operate on files follow symbolic +links and operate on the target of the link, rather than the link itself. +.if t .sp 0.5 +.if n .sp 1 +When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort +lexicographically using the current locale. +The \fBtest\fP command sorts using ASCII ordering. +.sp 1 +.PD 0 +.TP +.B \-a \fIfile\fP +True if \fIfile\fP exists. +.TP +.B \-b \fIfile\fP +True if \fIfile\fP exists and is a block special file. +.TP +.B \-c \fIfile\fP +True if \fIfile\fP exists and is a character special file. +.TP +.B \-d \fIfile\fP +True if \fIfile\fP exists and is a directory. +.TP +.B \-e \fIfile\fP +True if \fIfile\fP exists. +.TP +.B \-f \fIfile\fP +True if \fIfile\fP exists and is a regular file. +.TP +.B \-g \fIfile\fP +True if \fIfile\fP exists and is set-group-id. +.TP +.B \-h \fIfile\fP +True if \fIfile\fP exists and is a symbolic link. +.TP +.B \-k \fIfile\fP +True if \fIfile\fP exists and its ``sticky'' bit is set. +.TP +.B \-p \fIfile\fP +True if \fIfile\fP exists and is a named pipe (FIFO). +.TP +.B \-r \fIfile\fP +True if \fIfile\fP exists and is readable. +.TP +.B \-s \fIfile\fP +True if \fIfile\fP exists and has a size greater than zero. +.TP +.B \-t \fIfd\fP +True if file descriptor +.I fd +is open and refers to a terminal. +.TP +.B \-u \fIfile\fP +True if \fIfile\fP exists and its set-user-id bit is set. +.TP +.B \-w \fIfile\fP +True if \fIfile\fP exists and is writable. +.TP +.B \-x \fIfile\fP +True if \fIfile\fP exists and is executable. +.TP +.B \-G \fIfile\fP +True if \fIfile\fP exists and is owned by the effective group id. +.TP +.B \-L \fIfile\fP +True if \fIfile\fP exists and is a symbolic link. +.TP +.B \-N \fIfile\fP +True if \fIfile\fP exists and has been modified since it was last read. +.TP +.B \-O \fIfile\fP +True if \fIfile\fP exists and is owned by the effective user id. +.TP +.B \-S \fIfile\fP +True if \fIfile\fP exists and is a socket. +.TP +\fIfile1\fP \fB\-ef\fP \fIfile2\fP +True if \fIfile1\fP and \fIfile2\fP refer to the same device and +inode numbers. +.TP +\fIfile1\fP \-\fBnt\fP \fIfile2\fP +True if \fIfile1\fP is newer (according to modification date) than \fIfile2\fP, +or if \fIfile1\fP exists and \fPfile2\fP does not. +.TP +\fIfile1\fP \-\fBot\fP \fIfile2\fP +True if \fIfile1\fP is older than \fIfile2\fP, or if \fIfile2\fP exists +and \fIfile1\fP does not. +.TP +.B \-o \fIoptname\fP +True if the shell option +.I optname +is enabled. +See the list of options under the description of the +.B \-o +option to the +.B set +builtin below. +.TP +.B \-v \fIvarname\fP +True if the shell variable +.I varname +is set (has been assigned a value). +.TP +.B \-R \fIvarname\fP +True if the shell variable +.I varname +is set and is a name reference. +.TP +.B \-z \fIstring\fP +True if the length of \fIstring\fP is zero. +.TP +\fIstring\fP +.PD 0 +.TP +.B \-n \fIstring\fP +.PD +True if the length of +.I string +is non-zero. +.TP +\fIstring1\fP \fB==\fP \fIstring2\fP +.PD 0 +.TP +\fIstring1\fP \fB=\fP \fIstring2\fP +.PD +True if the strings are equal. \fB=\fP should be used +with the \fBtest\fP command for POSIX conformance. +When used with the \fB[[\fP command, this performs pattern matching as +described above (\fBCompound Commands\fP). +.TP +\fIstring1\fP \fB!=\fP \fIstring2\fP +True if the strings are not equal. +.TP +\fIstring1\fP \fB<\fP \fIstring2\fP +True if \fIstring1\fP sorts before \fIstring2\fP lexicographically. +.TP +\fIstring1\fP \fB>\fP \fIstring2\fP +True if \fIstring1\fP sorts after \fIstring2\fP lexicographically. +.TP +.I \fIarg1\fP \fBOP\fP \fIarg2\fP +.SM +.B OP +is one of +.BR \-eq , +.BR \-ne , +.BR \-lt , +.BR \-le , +.BR \-gt , +or +.BR \-ge . +These arithmetic binary operators return true if \fIarg1\fP +is equal to, not equal to, less than, less than or equal to, +greater than, or greater than or equal to \fIarg2\fP, respectively. +.I Arg1 +and +.I arg2 +may be positive or negative integers. +.PD +.SH "SIMPLE COMMAND EXPANSION" +When a simple command is executed, the shell performs the following +expansions, assignments, and redirections, from left to right. +.IP 1. +The words that the parser has marked as variable assignments (those +preceding the command name) and redirections are saved for later +processing. +.IP 2. +The words that are not variable assignments or redirections are +expanded. If any words remain after expansion, the first word +is taken to be the name of the command and the remaining words are +the arguments. +.IP 3. +Redirections are performed as described above under +.SM +.BR REDIRECTION . +.IP 4. +The text after the \fB=\fP in each variable assignment undergoes tilde +expansion, parameter expansion, command substitution, arithmetic expansion, +and quote removal before being assigned to the variable. +.PP +If no command name results, the variable assignments affect the current +shell environment. Otherwise, the variables are added to the environment +of the executed command and do not affect the current shell environment. +If any of the assignments attempts to assign a value to a readonly variable, +an error occurs, and the command exits with a non-zero status. +.PP +If no command name results, redirections are performed, but do not +affect the current shell environment. A redirection error causes the +command to exit with a non-zero status. +.PP +If there is a command name left after expansion, execution proceeds as +described below. Otherwise, the command exits. If one of the expansions +contained a command substitution, the exit status of the command is +the exit status of the last command substitution performed. If there +were no command substitutions, the command exits with a status of zero. +.SH "COMMAND EXECUTION" +After a command has been split into words, if it results in a +simple command and an optional list of arguments, the following +actions are taken. +.PP +If the command name contains no slashes, the shell attempts to +locate it. If there exists a shell function by that name, that +function is invoked as described above in +.SM +.BR FUNCTIONS . +If the name does not match a function, the shell searches for +it in the list of shell builtins. If a match is found, that +builtin is invoked. +.PP +If the name is neither a shell function nor a builtin, +and contains no slashes, +.B bash +searches each element of the +.SM +.B PATH +for a directory containing an executable file by that name. +.B Bash +uses a hash table to remember the full pathnames of executable +files (see +.B hash +under +.SM +.B "SHELL BUILTIN COMMANDS" +below). +A full search of the directories in +.SM +.B PATH +is performed only if the command is not found in the hash table. +If the search is unsuccessful, the shell searches for a defined shell +function named \fBcommand_not_found_handle\fP. +If that function exists, it is invoked with the original command and +the original command's arguments as its arguments, and the function's +exit status becomes the exit status of the shell. +If that function is not defined, the shell prints an error +message and returns an exit status of 127. +.PP +If the search is successful, or if the command name contains +one or more slashes, the shell executes the named program in a +separate execution environment. +Argument 0 is set to the name given, and the remaining arguments +to the command are set to the arguments given, if any. +.PP +If this execution fails because the file is not in executable +format, and the file is not a directory, it is assumed to be +a \fIshell script\fP, a file +containing shell commands. A subshell is spawned to execute +it. This subshell reinitializes itself, so +that the effect is as if a new shell had been invoked +to handle the script, with the exception that the locations of +commands remembered by the parent (see +.B hash +below under +.SM +\fBSHELL BUILTIN COMMANDS\fP) +are retained by the child. +.PP +If the program is a file beginning with +.BR #! , +the remainder of the first line specifies an interpreter +for the program. The shell executes the +specified interpreter on operating systems that do not +handle this executable format themselves. The arguments to the +interpreter consist of a single optional argument following the +interpreter name on the first line of the program, followed +by the name of the program, followed by the command +arguments, if any. +.SH COMMAND EXECUTION ENVIRONMENT +The shell has an \fIexecution environment\fP, which consists of the +following: +.IP \(bu +open files inherited by the shell at invocation, as modified by +redirections supplied to the \fBexec\fP builtin +.IP \(bu +the current working directory as set by \fBcd\fP, \fBpushd\fP, or +\fBpopd\fP, or inherited by the shell at invocation +.IP \(bu +the file creation mode mask as set by \fBumask\fP or inherited from +the shell's parent +.IP \(bu +current traps set by \fBtrap\fP +.IP \(bu +shell parameters that are set by variable assignment or with \fBset\fP +or inherited from the shell's parent in the environment +.IP \(bu +shell functions defined during execution or inherited from the shell's +parent in the environment +.IP \(bu +options enabled at invocation (either by default or with command-line +arguments) or by \fBset\fP +.IP \(bu +options enabled by \fBshopt\fP +.IP \(bu +shell aliases defined with \fBalias\fP +.IP \(bu +various process IDs, including those of background jobs, the value +of \fB$$\fP, and the value of +.SM +.B PPID +.PP +When a simple command other than a builtin or shell function +is to be executed, it +is invoked in a separate execution environment that consists of +the following. Unless otherwise noted, the values are inherited +from the shell. +.if n .sp 1 +.IP \(bu +the shell's open files, plus any modifications and additions specified +by redirections to the command +.IP \(bu +the current working directory +.IP \(bu +the file creation mode mask +.IP \(bu +shell variables and functions marked for export, along with variables +exported for the command, passed in the environment +.IP \(bu +traps caught by the shell are reset to the values inherited from the +shell's parent, and traps ignored by the shell are ignored +.PP +A command invoked in this separate environment cannot affect the +shell's execution environment. +.PP +Command substitution, commands grouped with parentheses, +and asynchronous commands are invoked in a +subshell environment that is a duplicate of the shell environment, +except that traps caught by the shell are reset to the values +that the shell inherited from its parent at invocation. Builtin +commands that are invoked as part of a pipeline are also executed in a +subshell environment. Changes made to the subshell environment +cannot affect the shell's execution environment. +.PP +Subshells spawned to execute command substitutions inherit the value of +the \fB\-e\fP option from the parent shell. When not in \fIposix\fP mode, +\fBbash\fP clears the \fB\-e\fP option in such subshells. +.PP +If a command is followed by a \fB&\fP and job control is not active, the +default standard input for the command is the empty file \fI/dev/null\fP. +Otherwise, the invoked command inherits the file descriptors of the calling +shell as modified by redirections. +.SH ENVIRONMENT +When a program is invoked it is given an array of strings +called the +.IR environment . +This is a list of +\fIname\fP\-\fIvalue\fP pairs, of the form +.IR "name\fR=\fPvalue" . +.PP +The shell provides several ways to manipulate the environment. +On invocation, the shell scans its own environment and +creates a parameter for each name found, automatically marking +it for +.I export +to child processes. Executed commands inherit the environment. +The +.B export +and +.B declare \-x +commands allow parameters and functions to be added to and +deleted from the environment. If the value of a parameter +in the environment is modified, the new value becomes part +of the environment, replacing the old. The environment +inherited by any executed command consists of the shell's +initial environment, whose values may be modified in the shell, +less any pairs removed by the +.B unset +command, plus any additions via the +.B export +and +.B declare \-x +commands. +.PP +The environment for any +.I simple command +or function may be augmented temporarily by prefixing it with +parameter assignments, as described above in +.SM +.BR PARAMETERS . +These assignment statements affect only the environment seen +by that command. +.PP +If the +.B \-k +option is set (see the +.B set +builtin command below), then +.I all +parameter assignments are placed in the environment for a command, +not just those that precede the command name. +.PP +When +.B bash +invokes an external command, the variable +.B _ +is set to the full filename of the command and passed to that +command in its environment. +.SH "EXIT STATUS" +.PP +The exit status of an executed command is the value returned by the +\fIwaitpid\fP system call or equivalent function. Exit statuses +fall between 0 and 255, though, as explained below, the shell may +use values above 125 specially. Exit statuses from shell builtins and +compound commands are also limited to this range. Under certain +circumstances, the shell will use special values to indicate specific +failure modes. +.PP +For the shell's purposes, a command which exits with a +zero exit status has succeeded. An exit status of zero +indicates success. A non-zero exit status indicates failure. +When a command terminates on a fatal signal \fIN\fP, \fBbash\fP uses +the value of 128+\fIN\fP as the exit status. +.PP +If a command is not found, the child process created to +execute it returns a status of 127. If a command is found +but is not executable, the return status is 126. +.PP +If a command fails because of an error during expansion or redirection, +the exit status is greater than zero. +.PP +Shell builtin commands return a status of 0 (\fItrue\fP) if +successful, and non-zero (\fIfalse\fP) if an error occurs +while they execute. +All builtins return an exit status of 2 to indicate incorrect usage. +.PP +\fBBash\fP itself returns the exit status of the last command +executed, unless a syntax error occurs, in which case it exits +with a non-zero value. See also the \fBexit\fP builtin +command below. +.SH SIGNALS +When \fBbash\fP is interactive, in the absence of any traps, it ignores +.SM +.B SIGTERM +(so that \fBkill 0\fP does not kill an interactive shell), +and +.SM +.B SIGINT +is caught and handled (so that the \fBwait\fP builtin is interruptible). +In all cases, \fBbash\fP ignores +.SM +.BR SIGQUIT . +If job control is in effect, +.B bash +ignores +.SM +.BR SIGTTIN , +.SM +.BR SIGTTOU , +and +.SM +.BR SIGTSTP . +.PP +Non-builtin commands run by \fBbash\fP have signal handlers +set to the values inherited by the shell from its parent. +When job control is not in effect, asynchronous commands +ignore +.SM +.B SIGINT +and +.SM +.B SIGQUIT +in addition to these inherited handlers. +Commands run as a result of command substitution ignore the +keyboard-generated job control signals +.SM +.BR SIGTTIN , +.SM +.BR SIGTTOU , +and +.SM +.BR SIGTSTP . +.PP +The shell exits by default upon receipt of a +.SM +.BR SIGHUP . +Before exiting, an interactive shell resends the +.SM +.B SIGHUP +to all jobs, running or stopped. +Stopped jobs are sent +.SM +.B SIGCONT +to ensure that they receive the +.SM +.BR SIGHUP . +To prevent the shell from +sending the signal to a particular job, it should be removed from the +jobs table with the +.B disown +builtin (see +.SM +.B "SHELL BUILTIN COMMANDS" +below) or marked +to not receive +.SM +.B SIGHUP +using +.BR "disown \-h" . +.PP +If the +.B huponexit +shell option has been set with +.BR shopt , +.B bash +sends a +.SM +.B SIGHUP +to all jobs when an interactive login shell exits. +.PP +If \fBbash\fP is waiting for a command to complete and receives a signal +for which a trap has been set, the trap will not be executed until +the command completes. +When \fBbash\fP is waiting for an asynchronous command via the \fBwait\fP +builtin, the reception of a signal for which a trap has been set will +cause the \fBwait\fP builtin to return immediately with an exit status +greater than 128, immediately after which the trap is executed. +.SH "JOB CONTROL" +.I Job control +refers to the ability to selectively stop (\fIsuspend\fP) +the execution of processes and continue (\fIresume\fP) +their execution at a later point. A user typically employs +this facility via an interactive interface supplied jointly +by the operating system kernel's terminal driver and +.BR bash . +.PP +The shell associates a +.I job +with each pipeline. It keeps a table of currently executing +jobs, which may be listed with the +.B jobs +command. When +.B bash +starts a job asynchronously (in the +.IR background ), +it prints a line that looks like: +.RS +.PP +[1] 25647 +.RE +.PP +indicating that this job is job number 1 and that the process ID +of the last process in the pipeline associated with this job is 25647. +All of the processes in a single pipeline are members of the same job. +.B Bash +uses the +.I job +abstraction as the basis for job control. +.PP +To facilitate the implementation of the user interface to job +control, the operating system maintains the notion of a \fIcurrent terminal +process group ID\fP. Members of this process group (processes whose +process group ID is equal to the current terminal process group ID) +receive keyboard-generated signals such as +.SM +.BR SIGINT . +These processes are said to be in the +.IR foreground . +.I Background +processes are those whose process group ID differs from the terminal's; +such processes are immune to keyboard-generated signals. +Only foreground processes are allowed to read from or, if the +user so specifies with \f(CWstty tostop\fP, write to the +terminal. +Background processes which attempt to read from (write to when +\f(CWstty tostop\fP is in effect) the +terminal are sent a +.SM +.B SIGTTIN (SIGTTOU) +signal by the kernel's terminal driver, +which, unless caught, suspends the process. +.PP +If the operating system on which +.B bash +is running supports +job control, +.B bash +contains facilities to use it. +Typing the +.I suspend +character (typically +.BR ^Z , +Control-Z) while a process is running +causes that process to be stopped and returns control to +.BR bash . +Typing the +.I "delayed suspend" +character (typically +.BR ^Y , +Control-Y) causes the process to be stopped when it +attempts to read input from the terminal, and control to +be returned to +.BR bash . +The user may then manipulate the state of this job, using the +.B bg +command to continue it in the background, the +.B fg +command to continue it in the foreground, or +the +.B kill +command to kill it. A \fB^Z\fP takes effect immediately, +and has the additional side effect of causing pending output +and typeahead to be discarded. +.PP +There are a number of ways to refer to a job in the shell. +The character +.B % +introduces a job specification (\fIjobspec\fP). Job number +.I n +may be referred to as +.BR %n . +A job may also be referred to using a prefix of the name used to +start it, or using a substring that appears in its command line. +For example, +.B %ce +refers to a stopped +.B ce +job. If a prefix matches more than one job, +.B bash +reports an error. Using +.BR %?ce , +on the other hand, refers to any job containing the string +.B ce +in its command line. If the substring matches more than one job, +.B bash +reports an error. The symbols +.B %% +and +.B %+ +refer to the shell's notion of the +.IR "current job" , +which is the last job stopped while it was in +the foreground or started in the background. +The +.I "previous job" +may be referenced using +.BR %\- . +If there is only a single job, \fB%+\fP and \fB%\-\fP can both be used +to refer to that job. +In output pertaining to jobs (e.g., the output of the +.B jobs +command), the current job is always flagged with a +.BR + , +and the previous job with a +.BR \- . +A single % (with no accompanying job specification) also refers to the +current job. +.PP +Simply naming a job can be used to bring it into the +foreground: +.B %1 +is a synonym for +\fB``fg %1''\fP, +bringing job 1 from the background into the foreground. +Similarly, +.B ``%1 &'' +resumes job 1 in the background, equivalent to +\fB``bg %1''\fP. +.PP +The shell learns immediately whenever a job changes state. +Normally, +.B bash +waits until it is about to print a prompt before reporting +changes in a job's status so as to not interrupt +any other output. If the +.B \-b +option to the +.B set +builtin command +is enabled, +.B bash +reports such changes immediately. +Any trap on +.SM +.B SIGCHLD +is executed for each child that exits. +.PP +If an attempt to exit +.B bash +is made while jobs are stopped (or, if the \fBcheckjobs\fP shell option has +been enabled using the \fBshopt\fP builtin, running), the shell prints a +warning message, and, if the \fBcheckjobs\fP option is enabled, lists the +jobs and their statuses. +The +.B jobs +command may then be used to inspect their status. +If a second attempt to exit is made without an intervening command, +the shell does not print another warning, and any stopped +jobs are terminated. +.SH PROMPTING +When executing interactively, +.B bash +displays the primary prompt +.SM +.B PS1 +when it is ready to read a command, and the secondary prompt +.SM +.B PS2 +when it needs more input to complete a command. +.B Bash +allows these prompt strings to be customized by inserting a number of +backslash-escaped special characters that are decoded as follows: +.RS +.PD 0 +.TP +.B \ea +an ASCII bell character (07) +.TP +.B \ed +the date in "Weekday Month Date" format (e.g., "Tue May 26") +.TP +.B \eD{\fIformat\fP} +the \fIformat\fP is passed to \fIstrftime\fP(3) and the result is inserted +into the prompt string; an empty \fIformat\fP results in a locale-specific +time representation. The braces are required +.TP +.B \ee +an ASCII escape character (033) +.TP +.B \eh +the hostname up to the first `.' +.TP +.B \eH +the hostname +.TP +.B \ej +the number of jobs currently managed by the shell +.TP +.B \el +the basename of the shell's terminal device name +.TP +.B \en +newline +.TP +.B \er +carriage return +.TP +.B \es +the name of the shell, the basename of +.B $0 +(the portion following the final slash) +.TP +.B \et +the current time in 24-hour HH:MM:SS format +.TP +.B \eT +the current time in 12-hour HH:MM:SS format +.TP +.B \e@ +the current time in 12-hour am/pm format +.TP +.B \eA +the current time in 24-hour HH:MM format +.TP +.B \eu +the username of the current user +.TP +.B \ev +the version of \fBbash\fP (e.g., 2.00) +.TP +.B \eV +the release of \fBbash\fP, version + patch level (e.g., 2.00.0) +.TP +.B \ew +the current working directory, with +.SM +.B $HOME +abbreviated with a tilde +(uses the value of the +.SM +.B PROMPT_DIRTRIM +variable) +.TP +.B \eW +the basename of the current working directory, with +.SM +.B $HOME +abbreviated with a tilde +.TP +.B \e! +the history number of this command +.TP +.B \e# +the command number of this command +.TP +.B \e$ +if the effective UID is 0, a +.BR # , +otherwise a +.B $ +.TP +.B \e\fInnn\fP +the character corresponding to the octal number \fInnn\fP +.TP +.B \e\e +a backslash +.TP +.B \e[ +begin a sequence of non-printing characters, which could be used to +embed a terminal control sequence into the prompt +.TP +.B \e] +end a sequence of non-printing characters +.PD +.RE +.PP +The command number and the history number are usually different: +the history number of a command is its position in the history +list, which may include commands restored from the history file +(see +.SM +.B HISTORY +below), while the command number is the position in the sequence +of commands executed during the current shell session. +After the string is decoded, it is expanded via +parameter expansion, command substitution, arithmetic +expansion, and quote removal, subject to the value of the +.B promptvars +shell option (see the description of the +.B shopt +command under +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.SH READLINE +This is the library that handles reading input when using an interactive +shell, unless the +.B \-\-noediting +option is given at shell invocation. +Line editing is also used when using the \fB\-e\fP option to the +\fBread\fP builtin. +By default, the line editing commands are similar to those of Emacs. +A vi-style line editing interface is also available. +Line editing can be enabled at any time using the +.B \-o emacs +or +.B \-o vi +options to the +.B set +builtin (see +.SM +.B SHELL BUILTIN COMMANDS +below). +To turn off line editing after the shell is running, use the +.B +o emacs +or +.B +o vi +options to the +.B set +builtin. +.SS "Readline Notation" +.PP +In this section, the Emacs-style notation is used to denote +keystrokes. Control keys are denoted by C\-\fIkey\fR, e.g., C\-n +means Control\-N. Similarly, +.I meta +keys are denoted by M\-\fIkey\fR, so M\-x means Meta\-X. (On keyboards +without a +.I meta +key, M\-\fIx\fP means ESC \fIx\fP, i.e., press the Escape key +then the +.I x +key. This makes ESC the \fImeta prefix\fP. +The combination M\-C\-\fIx\fP means ESC\-Control\-\fIx\fP, +or press the Escape key +then hold the Control key while pressing the +.I x +key.) +.PP +Readline commands may be given numeric +.IR arguments , +which normally act as a repeat count. +Sometimes, however, it is the sign of the argument that is significant. +Passing a negative argument to a command that acts in the forward +direction (e.g., \fBkill\-line\fP) causes that command to act in a +backward direction. +Commands whose behavior with arguments deviates from this are noted +below. +.PP +When a command is described as \fIkilling\fP text, the text +deleted is saved for possible future retrieval +(\fIyanking\fP). The killed text is saved in a +\fIkill ring\fP. Consecutive kills cause the text to be +accumulated into one unit, which can be yanked all at once. +Commands which do not kill text separate the chunks of text +on the kill ring. +.SS "Readline Initialization" +.PP +Readline is customized by putting commands in an initialization +file (the \fIinputrc\fP file). +The name of this file is taken from the value of the +.SM +.B INPUTRC +variable. If that variable is unset, the default is +.IR ~/.inputrc . +When a program which uses the readline library starts up, the +initialization file is read, and the key bindings and variables +are set. +There are only a few basic constructs allowed in the +readline initialization file. +Blank lines are ignored. +Lines beginning with a \fB#\fP are comments. +Lines beginning with a \fB$\fP indicate conditional constructs. +Other lines denote key bindings and variable settings. +.PP +The default key-bindings may be changed with an +.I inputrc +file. +Other programs that use this library may add their own commands +and bindings. +.PP +For example, placing +.RS +.PP +M\-Control\-u: universal\-argument +.RE +or +.RS +C\-Meta\-u: universal\-argument +.RE +into the +.I inputrc +would make M\-C\-u execute the readline command +.IR universal\-argument . +.PP +The following symbolic character names are recognized: +.IR RUBOUT , +.IR DEL , +.IR ESC , +.IR LFD , +.IR NEWLINE , +.IR RET , +.IR RETURN , +.IR SPC , +.IR SPACE , +and +.IR TAB . +.PP +In addition to command names, readline allows keys to be bound +to a string that is inserted when the key is pressed (a \fImacro\fP). +.SS "Readline Key Bindings" +.PP +The syntax for controlling key bindings in the +.I inputrc +file is simple. All that is required is the name of the +command or the text of a macro and a key sequence to which +it should be bound. The name may be specified in one of two ways: +as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP +prefixes, or as a key sequence. +.PP +When using the form \fBkeyname\fP:\^\fIfunction\-name\fP or \fImacro\fP, +.I keyname +is the name of a key spelled out in English. For example: +.sp +.RS +Control-u: universal\-argument +.br +Meta-Rubout: backward-kill-word +.br +Control-o: "> output" +.RE +.LP +In the above example, +.I C\-u +is bound to the function +.BR universal\-argument , +.I M\-DEL +is bound to the function +.BR backward\-kill\-word , +and +.I C\-o +is bound to run the macro +expressed on the right hand side (that is, to insert the text +.if t \f(CW> output\fP +.if n ``> output'' +into the line). +.PP +In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP, +.B keyseq +differs from +.B keyname +above in that strings denoting +an entire key sequence may be specified by placing the sequence +within double quotes. Some GNU Emacs style key escapes can be +used, as in the following example, but the symbolic character names +are not recognized. +.sp +.RS +"\eC\-u": universal\-argument +.br +"\eC\-x\eC\-r": re\-read\-init\-file +.br +"\ee[11~": "Function Key 1" +.RE +.PP +In this example, +.I C\-u +is again bound to the function +.BR universal\-argument . +.I "C\-x C\-r" +is bound to the function +.BR re\-read\-init\-file , +and +.I "ESC [ 1 1 ~" +is bound to insert the text +.if t \f(CWFunction Key 1\fP. +.if n ``Function Key 1''. +.PP +The full set of GNU Emacs style escape sequences is +.RS +.PD 0 +.TP +.B \eC\- +control prefix +.TP +.B \eM\- +meta prefix +.TP +.B \ee +an escape character +.TP +.B \e\e +backslash +.TP +.B \e" +literal " +.TP +.B \e\(aq +literal \(aq +.RE +.PD +.PP +In addition to the GNU Emacs style escape sequences, a second +set of backslash escapes is available: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ed +delete +.TP +.B \ef +form feed +.TP +.B \en +newline +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(one to three digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.RE +.PD +.PP +When entering the text of a macro, single or double quotes must +be used to indicate a macro definition. +Unquoted text is assumed to be a function name. +In the macro body, the backslash escapes described above are expanded. +Backslash will quote any other character in the macro text, +including " and \(aq. +.PP +.B Bash +allows the current readline key bindings to be displayed or modified +with the +.B bind +builtin command. The editing mode may be switched during interactive +use by using the +.B \-o +option to the +.B set +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SS "Readline Variables" +.PP +Readline has variables that can be used to further customize its +behavior. A variable may be set in the +.I inputrc +file with a statement of the form +.RS +.PP +\fBset\fP \fIvariable\-name\fP \fIvalue\fP +.RE +.PP +Except where noted, readline variables can take the values +.B On +or +.B Off +(without regard to case). +Unrecognized variable names are ignored. +When a variable value is read, empty or null values, "on" (case-insensitive), +and "1" are equivalent to \fBOn\fP. All other values are equivalent to +\fBOff\fP. +The variables and their default values are: +.PP +.PD 0 +.TP +.B bell\-style (audible) +Controls what happens when readline wants to ring the terminal bell. +If set to \fBnone\fP, readline never rings the bell. If set to +\fBvisible\fP, readline uses a visible bell if one is available. +If set to \fBaudible\fP, readline attempts to ring the terminal's bell. +.TP +.B bind\-tty\-special\-chars (On) +If set to \fBOn\fP, readline attempts to bind the control characters +treated specially by the kernel's terminal driver to their readline +equivalents. +.TP +.B colored\-stats (Off) +If set to \fBOn\fP, readline displays possible completions using different +colors to indicate their file type. +The color definitions are taken from the value of the \fBLS_COLORS\fP +environment variable. +.TP +.B comment\-begin (``#'') +The string that is inserted when the readline +.B insert\-comment +command is executed. +This command is bound to +.B M\-# +in emacs mode and to +.B # +in vi command mode. +.TP +.B completion\-ignore\-case (Off) +If set to \fBOn\fP, readline performs filename matching and completion +in a case\-insensitive fashion. +.TP +.B completion\-prefix\-display\-length (0) +The length in characters of the common prefix of a list of possible +completions that is displayed without modification. When set to a +value greater than zero, common prefixes longer than this value are +replaced with an ellipsis when displaying possible completions. +.TP +.B completion\-query\-items (100) +This determines when the user is queried about viewing +the number of possible completions +generated by the \fBpossible\-completions\fP command. +It may be set to any integer value greater than or equal to +zero. If the number of possible completions is greater than +or equal to the value of this variable, the user is asked whether +or not he wishes to view them; otherwise they are simply listed +on the terminal. +.TP +.B convert\-meta (On) +If set to \fBOn\fP, readline will convert characters with the +eighth bit set to an ASCII key sequence +by stripping the eighth bit and prefixing an +escape character (in effect, using escape as the \fImeta prefix\fP). +.TP +.B disable\-completion (Off) +If set to \fBOn\fP, readline will inhibit word completion. Completion +characters will be inserted into the line as if they had been +mapped to \fBself-insert\fP. +.TP +.B editing\-mode (emacs) +Controls whether readline begins with a set of key bindings similar +to \fIEmacs\fP or \fIvi\fP. +.B editing\-mode +can be set to either +.B emacs +or +.BR vi . +.TP +.B echo\-control\-characters (On) +When set to \fBOn\fP, on operating systems that indicate they support it, +readline echoes a character corresponding to a signal generated from the +keyboard. +.TP +.B enable\-keypad (Off) +When set to \fBOn\fP, readline will try to enable the application +keypad when it is called. Some systems need this to enable the +arrow keys. +.TP +.B enable\-meta\-key (On) +When set to \fBOn\fP, readline will try to enable any meta modifier +key the terminal claims to support when it is called. On many terminals, +the meta key is used to send eight-bit characters. +.TP +.B expand\-tilde (Off) +If set to \fBOn\fP, tilde expansion is performed when readline +attempts word completion. +.TP +.B history\-preserve\-point (Off) +If set to \fBOn\fP, the history code attempts to place point at the +same location on each history line retrieved with \fBprevious-history\fP +or \fBnext-history\fP. +.TP +.B history\-size (0) +Set the maximum number of history entries saved in the history list. +If set to zero, any existing history entries are deleted and no new entries +are saved. +If set to a value less than zero, the number of history entries is not +limited. +By default, the number of history entries is not limited. +.TP +.B horizontal\-scroll\-mode (Off) +When set to \fBOn\fP, makes readline use a single line for display, +scrolling the input horizontally on a single screen line when it +becomes longer than the screen width rather than wrapping to a new line. +.TP +.B input\-meta (Off) +If set to \fBOn\fP, readline will enable eight-bit input (that is, +it will not strip the high bit from the characters it reads), +regardless of what the terminal claims it can support. The name +.B meta\-flag +is a synonym for this variable. +.TP +.B isearch\-terminators (``C\-[C\-J'') +The string of characters that should terminate an incremental +search without subsequently executing the character as a command. +If this variable has not been given a value, the characters +\fIESC\fP and \fIC\-J\fP will terminate an incremental search. +.TP +.B keymap (emacs) +Set the current readline keymap. The set of valid keymap names is +\fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi, +vi\-command\fP, and +.IR vi\-insert . +\fIvi\fP is equivalent to \fIvi\-command\fP; \fIemacs\fP is +equivalent to \fIemacs\-standard\fP. The default value is +.IR emacs ; +the value of +.B editing\-mode +also affects the default keymap. +.TP +.B keyseq\-timeout (500) +Specifies the duration \fIreadline\fP will wait for a character when reading an +ambiguous key sequence (one that can form a complete key sequence using +the input read so far, or can take additional input to complete a longer +key sequence). +If no input is received within the timeout, \fIreadline\fP will use the shorter +but complete key sequence. +The value is specified in milliseconds, so a value of 1000 means that +\fIreadline\fP will wait one second for additional input. +If this variable is set to a value less than or equal to zero, or to a +non-numeric value, \fIreadline\fP will wait until another key is pressed to +decide which key sequence to complete. +.TP +.B mark\-directories (On) +If set to \fBOn\fP, completed directory names have a slash +appended. +.TP +.B mark\-modified\-lines (Off) +If set to \fBOn\fP, history lines that have been modified are displayed +with a preceding asterisk (\fB*\fP). +.TP +.B mark\-symlinked\-directories (Off) +If set to \fBOn\fP, completed names which are symbolic links to directories +have a slash appended (subject to the value of +\fBmark\-directories\fP). +.TP +.B match\-hidden\-files (On) +This variable, when set to \fBOn\fP, causes readline to match files whose +names begin with a `.' (hidden files) when performing filename +completion. +If set to \fBOff\fP, the leading `.' must be +supplied by the user in the filename to be completed. +.TP +.B menu\-complete\-display\-prefix (Off) +If set to \fBOn\fP, menu completion displays the common prefix of the +list of possible completions (which may be empty) before cycling through +the list. +.TP +.B output\-meta (Off) +If set to \fBOn\fP, readline will display characters with the +eighth bit set directly rather than as a meta-prefixed escape +sequence. +.TP +.B page\-completions (On) +If set to \fBOn\fP, readline uses an internal \fImore\fP-like pager +to display a screenful of possible completions at a time. +.TP +.B print\-completions\-horizontally (Off) +If set to \fBOn\fP, readline will display completions with matches +sorted horizontally in alphabetical order, rather than down the screen. +.TP +.B revert\-all\-at\-newline (Off) +If set to \fBOn\fP, readline will undo all changes to history lines +before returning when \fBaccept\-line\fP is executed. By default, +history lines may be modified and retain individual undo lists across +calls to \fBreadline\fP. +.TP +.B show\-all\-if\-ambiguous (Off) +This alters the default behavior of the completion functions. If +set to +.BR On , +words which have more than one possible completion cause the +matches to be listed immediately instead of ringing the bell. +.TP +.B show\-all\-if\-unmodified (Off) +This alters the default behavior of the completion functions in +a fashion similar to \fBshow\-all\-if\-ambiguous\fP. +If set to +.BR On , +words which have more than one possible completion without any +possible partial completion (the possible completions don't share +a common prefix) cause the matches to be listed immediately instead +of ringing the bell. +.TP +.B show\-mode\-in\-prompt (Off) +If set to \fBOn\fP, add a character to the beginning of the prompt +indicating the editing mode: emacs (@), vi command (:) or vi +insertion (+). +.TP +.B skip\-completed\-text (Off) +If set to \fBOn\fP, this alters the default completion behavior when +inserting a single match into the line. It's only active when +performing completion in the middle of a word. If enabled, readline +does not insert characters from the completion that match characters +after point in the word being completed, so portions of the word +following the cursor are not duplicated. +.TP +.B visible\-stats (Off) +If set to \fBOn\fP, a character denoting a file's type as reported +by \fIstat\fP(2) is appended to the filename when listing possible +completions. +.PD +.SS "Readline Conditional Constructs" +.PP +Readline implements a facility similar in spirit to the conditional +compilation features of the C preprocessor which allows key +bindings and variable settings to be performed as the result +of tests. There are four parser directives used. +.IP \fB$if\fP +The +.B $if +construct allows bindings to be made based on the +editing mode, the terminal being used, or the application using +readline. The text of the test extends to the end of the line; +no characters are required to isolate it. +.RS +.IP \fBmode\fP +The \fBmode=\fP form of the \fB$if\fP directive is used to test +whether readline is in emacs or vi mode. +This may be used in conjunction +with the \fBset keymap\fP command, for instance, to set bindings in +the \fIemacs\-standard\fP and \fIemacs\-ctlx\fP keymaps only if +readline is starting out in emacs mode. +.IP \fBterm\fP +The \fBterm=\fP form may be used to include terminal-specific +key bindings, perhaps to bind the key sequences output by the +terminal's function keys. The word on the right side of the +.B = +is tested against the both full name of the terminal and the portion +of the terminal name before the first \fB\-\fP. This allows +.I sun +to match both +.I sun +and +.IR sun\-cmd , +for instance. +.IP \fBapplication\fP +The \fBapplication\fP construct is used to include +application-specific settings. Each program using the readline +library sets the \fIapplication name\fP, and an initialization +file can test for a particular value. +This could be used to bind key sequences to functions useful for +a specific program. For instance, the following command adds a +key sequence that quotes the current or previous word in \fBbash\fP: +.sp 1 +.RS +.nf +\fB$if\fP Bash +# Quote the current or previous word +"\eC\-xq": "\eeb\e"\eef\e"" +\fB$endif\fP +.fi +.RE +.RE +.IP \fB$endif\fP +This command, as seen in the previous example, terminates an +\fB$if\fP command. +.IP \fB$else\fP +Commands in this branch of the \fB$if\fP directive are executed if +the test fails. +.IP \fB$include\fP +This directive takes a single filename as an argument and reads commands +and bindings from that file. For example, the following directive +would read \fI/etc/inputrc\fP: +.sp 1 +.RS +.nf +\fB$include\fP \^ \fI/etc/inputrc\fP +.fi +.RE +.SS Searching +.PP +Readline provides commands for searching through the command history +(see +.SM +.B HISTORY +below) for lines containing a specified string. +There are two search modes: +.I incremental +and +.IR non-incremental . +.PP +Incremental searches begin before the user has finished typing the +search string. +As each character of the search string is typed, readline displays +the next entry from the history matching the string typed so far. +An incremental search requires only as many characters as needed to +find the desired history entry. +The characters present in the value of the \fBisearch-terminators\fP +variable are used to terminate an incremental search. +If that variable has not been assigned a value the Escape and +Control-J characters will terminate an incremental search. +Control-G will abort an incremental search and restore the original +line. +When the search is terminated, the history entry containing the +search string becomes the current line. +.PP +To find other matching entries in the history list, type Control-S or +Control-R as appropriate. +This will search backward or forward in the history for the next +entry matching the search string typed so far. +Any other key sequence bound to a readline command will terminate +the search and execute that command. +For instance, a \fInewline\fP will terminate the search and accept +the line, thereby executing the command from the history list. +.PP +Readline remembers the last incremental search string. If two +Control-Rs are typed without any intervening characters defining a +new search string, any remembered search string is used. +.PP +Non-incremental searches read the entire search string before starting +to search for matching history lines. The search string may be +typed by the user or be part of the contents of the current line. +.SS "Readline Command Names" +.PP +The following is a list of the names of the commands and the default +key sequences to which they are bound. +Command names without an accompanying key sequence are unbound by default. +In the following descriptions, \fIpoint\fP refers to the current cursor +position, and \fImark\fP refers to a cursor position saved by the +\fBset\-mark\fP command. +The text between the point and mark is referred to as the \fIregion\fP. +.SS Commands for Moving +.PP +.PD 0 +.TP +.B beginning\-of\-line (C\-a) +Move to the start of the current line. +.TP +.B end\-of\-line (C\-e) +Move to the end of the line. +.TP +.B forward\-char (C\-f) +Move forward a character. +.TP +.B backward\-char (C\-b) +Move back a character. +.TP +.B forward\-word (M\-f) +Move forward to the end of the next word. Words are composed of +alphanumeric characters (letters and digits). +.TP +.B backward\-word (M\-b) +Move back to the start of the current or previous word. +Words are composed of alphanumeric characters (letters and digits). +.TP +.B shell\-forward\-word +Move forward to the end of the next word. +Words are delimited by non-quoted shell metacharacters. +.TP +.B shell\-backward\-word +Move back to the start of the current or previous word. +Words are delimited by non-quoted shell metacharacters. +.TP +.B clear\-screen (C\-l) +Clear the screen leaving the current line at the top of the screen. +With an argument, refresh the current line without clearing the +screen. +.TP +.B redraw\-current\-line +Refresh the current line. +.PD +.SS Commands for Manipulating the History +.PP +.PD 0 +.TP +.B accept\-line (Newline, Return) +Accept the line regardless of where the cursor is. If this line is +non-empty, add it to the history list according to the state of the +.SM +.B HISTCONTROL +variable. If the line is a modified history +line, then restore the history line to its original state. +.TP +.B previous\-history (C\-p) +Fetch the previous command from the history list, moving back in +the list. +.TP +.B next\-history (C\-n) +Fetch the next command from the history list, moving forward in the +list. +.TP +.B beginning\-of\-history (M\-<) +Move to the first line in the history. +.TP +.B end\-of\-history (M\->) +Move to the end of the input history, i.e., the line currently being +entered. +.TP +.B reverse\-search\-history (C\-r) +Search backward starting at the current line and moving `up' through +the history as necessary. This is an incremental search. +.TP +.B forward\-search\-history (C\-s) +Search forward starting at the current line and moving `down' through +the history as necessary. This is an incremental search. +.TP +.B non\-incremental\-reverse\-search\-history (M\-p) +Search backward through the history starting at the current line +using a non-incremental search for a string supplied by the user. +.TP +.B non\-incremental\-forward\-search\-history (M\-n) +Search forward through the history using a non-incremental search for +a string supplied by the user. +.TP +.B history\-search\-forward +Search forward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +.TP +.B history\-search\-backward +Search backward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +.TP +.B yank\-nth\-arg (M\-C\-y) +Insert the first argument to the previous command (usually +the second word on the previous line) at point. +With an argument +.IR n , +insert the \fIn\fPth word from the previous command (the words +in the previous command begin with word 0). A negative argument +inserts the \fIn\fPth word from the end of the previous command. +Once the argument \fIn\fP is computed, the argument is extracted +as if the "!\fIn\fP" history expansion had been specified. +.TP +.B +yank\-last\-arg (M\-.\^, M\-_\^) +Insert the last argument to the previous command (the last word of +the previous history entry). +With a numeric argument, behave exactly like \fByank\-nth\-arg\fP. +Successive calls to \fByank\-last\-arg\fP move back through the history +list, inserting the last word (or the word specified by the argument to +the first call) of each line in turn. +Any numeric argument supplied to these successive calls determines +the direction to move through the history. A negative argument switches +the direction through the history (back or forward). +The history expansion facilities are used to extract the last word, +as if the "!$" history expansion had been specified. +.TP +.B shell\-expand\-line (M\-C\-e) +Expand the line as the shell does. This +performs alias and history expansion as well as all of the shell +word expansions. See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B history\-expand\-line (M\-^) +Perform history expansion on the current line. +See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B magic\-space +Perform history expansion on the current line and insert a space. +See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B alias\-expand\-line +Perform alias expansion on the current line. +See +.SM +.B ALIASES +above for a description of alias expansion. +.TP +.B history\-and\-alias\-expand\-line +Perform history and alias expansion on the current line. +.TP +.B insert\-last\-argument (M\-.\^, M\-_\^) +A synonym for \fByank\-last\-arg\fP. +.TP +.B operate\-and\-get\-next (C\-o) +Accept the current line for execution and fetch the next line +relative to the current line from the history for editing. Any +argument is ignored. +.TP +.B edit\-and\-execute\-command (C\-xC\-e) +Invoke an editor on the current command line, and execute the result as shell +commands. +\fBBash\fP attempts to invoke +.SM +.BR $VISUAL , +.SM +.BR $EDITOR , +and \fIemacs\fP as the editor, in that order. +.PD +.SS Commands for Changing Text +.PP +.PD 0 +.TP +.B \fIend\-of\-file\fP (usually C\-d) +The character indicating end-of-file as set, for example, by +.if t \f(CWstty\fP. +.if n ``stty''. +If this character is read when there are no characters +on the line, and point is at the beginning of the line, Readline +interprets it as the end of input and returns +.SM +.BR EOF . +.TP +.B delete\-char (C\-d) +Delete the character at point. +If this function is bound to the +same character as the tty \fBEOF\fP character, as \fBC\-d\fP +commonly is, see above for the effects. +.TP +.B backward\-delete\-char (Rubout) +Delete the character behind the cursor. When given a numeric argument, +save the deleted text on the kill ring. +.TP +.B forward\-backward\-delete\-char +Delete the character under the cursor, unless the cursor is at the +end of the line, in which case the character behind the cursor is +deleted. +.TP +.B quoted\-insert (C\-q, C\-v) +Add the next character typed to the line verbatim. This is +how to insert characters like \fBC\-q\fP, for example. +.TP +.B tab\-insert (C\-v TAB) +Insert a tab character. +.TP +.B self\-insert (a,\ b,\ A,\ 1,\ !,\ ...) +Insert the character typed. +.TP +.B transpose\-chars (C\-t) +Drag the character before point forward over the character at point, +moving point forward as well. +If point is at the end of the line, then this transposes +the two characters before point. +Negative arguments have no effect. +.TP +.B transpose\-words (M\-t) +Drag the word before point past the word after point, +moving point over that word as well. +If point is at the end of the line, this transposes +the last two words on the line. +.TP +.B upcase\-word (M\-u) +Uppercase the current (or following) word. With a negative argument, +uppercase the previous word, but do not move point. +.TP +.B downcase\-word (M\-l) +Lowercase the current (or following) word. With a negative argument, +lowercase the previous word, but do not move point. +.TP +.B capitalize\-word (M\-c) +Capitalize the current (or following) word. With a negative argument, +capitalize the previous word, but do not move point. +.TP +.B overwrite\-mode +Toggle overwrite mode. With an explicit positive numeric argument, +switches to overwrite mode. With an explicit non-positive numeric +argument, switches to insert mode. This command affects only +\fBemacs\fP mode; \fBvi\fP mode does overwrite differently. +Each call to \fIreadline()\fP starts in insert mode. +In overwrite mode, characters bound to \fBself\-insert\fP replace +the text at point rather than pushing the text to the right. +Characters bound to \fBbackward\-delete\-char\fP replace the character +before point with a space. By default, this command is unbound. +.PD +.SS Killing and Yanking +.PP +.PD 0 +.TP +.B kill\-line (C\-k) +Kill the text from point to the end of the line. +.TP +.B backward\-kill\-line (C\-x Rubout) +Kill backward to the beginning of the line. +.TP +.B unix\-line\-discard (C\-u) +Kill backward from point to the beginning of the line. +The killed text is saved on the kill-ring. +.\" There is no real difference between this and backward-kill-line +.TP +.B kill\-whole\-line +Kill all characters on the current line, no matter where point is. +.TP +.B kill\-word (M\-d) +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as those used by \fBforward\-word\fP. +.TP +.B backward\-kill\-word (M\-Rubout) +Kill the word behind point. +Word boundaries are the same as those used by \fBbackward\-word\fP. +.TP +.B shell\-kill\-word (M\-d) +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as those used by \fBshell\-forward\-word\fP. +.TP +.B shell\-backward\-kill\-word (M\-Rubout) +Kill the word behind point. +Word boundaries are the same as those used by \fBshell\-backward\-word\fP. +.TP +.B unix\-word\-rubout (C\-w) +Kill the word behind point, using white space as a word boundary. +The killed text is saved on the kill-ring. +.TP +.B unix\-filename\-rubout +Kill the word behind point, using white space and the slash character +as the word boundaries. +The killed text is saved on the kill-ring. +.TP +.B delete\-horizontal\-space (M\-\e) +Delete all spaces and tabs around point. +.TP +.B kill\-region +Kill the text in the current region. +.TP +.B copy\-region\-as\-kill +Copy the text in the region to the kill buffer. +.TP +.B copy\-backward\-word +Copy the word before point to the kill buffer. +The word boundaries are the same as \fBbackward\-word\fP. +.TP +.B copy\-forward\-word +Copy the word following point to the kill buffer. +The word boundaries are the same as \fBforward\-word\fP. +.TP +.B yank (C\-y) +Yank the top of the kill ring into the buffer at point. +.TP +.B yank\-pop (M\-y) +Rotate the kill ring, and yank the new top. Only works following +.B yank +or +.BR yank\-pop . +.PD +.SS Numeric Arguments +.PP +.PD 0 +.TP +.B digit\-argument (M\-0, M\-1, ..., M\-\-) +Add this digit to the argument already accumulating, or start a new +argument. M\-\- starts a negative argument. +.TP +.B universal\-argument +This is another way to specify an argument. +If this command is followed by one or more digits, optionally with a +leading minus sign, those digits define the argument. +If the command is followed by digits, executing +.B universal\-argument +again ends the numeric argument, but is otherwise ignored. +As a special case, if this command is immediately followed by a +character that is neither a digit or minus sign, the argument count +for the next command is multiplied by four. +The argument count is initially one, so executing this function the +first time makes the argument count four, a second time makes the +argument count sixteen, and so on. +.PD +.SS Completing +.PP +.PD 0 +.TP +.B complete (TAB) +Attempt to perform completion on the text before point. +.B Bash +attempts completion treating the text as a variable (if the +text begins with \fB$\fP), username (if the text begins with +\fB~\fP), hostname (if the text begins with \fB@\fP), or +command (including aliases and functions) in turn. If none +of these produces a match, filename completion is attempted. +.TP +.B possible\-completions (M\-?) +List the possible completions of the text before point. +.TP +.B insert\-completions (M\-*) +Insert all completions of the text before point +that would have been generated by +\fBpossible\-completions\fP. +.TP +.B menu\-complete +Similar to \fBcomplete\fP, but replaces the word to be completed +with a single match from the list of possible completions. +Repeated execution of \fBmenu\-complete\fP steps through the list +of possible completions, inserting each match in turn. +At the end of the list of completions, the bell is rung +(subject to the setting of \fBbell\-style\fP) +and the original text is restored. +An argument of \fIn\fP moves \fIn\fP positions forward in the list +of matches; a negative argument may be used to move backward +through the list. +This command is intended to be bound to \fBTAB\fP, but is unbound +by default. +.TP +.B menu\-complete\-backward +Identical to \fBmenu\-complete\fP, but moves backward through the list +of possible completions, as if \fBmenu\-complete\fP had been given a +negative argument. This command is unbound by default. +.TP +.B delete\-char\-or\-list +Deletes the character under the cursor if not at the beginning or +end of the line (like \fBdelete\-char\fP). +If at the end of the line, behaves identically to +\fBpossible\-completions\fP. +This command is unbound by default. +.TP +.B complete\-filename (M\-/) +Attempt filename completion on the text before point. +.TP +.B possible\-filename\-completions (C\-x /) +List the possible completions of the text before point, +treating it as a filename. +.TP +.B complete\-username (M\-~) +Attempt completion on the text before point, treating +it as a username. +.TP +.B possible\-username\-completions (C\-x ~) +List the possible completions of the text before point, +treating it as a username. +.TP +.B complete\-variable (M\-$) +Attempt completion on the text before point, treating +it as a shell variable. +.TP +.B possible\-variable\-completions (C\-x $) +List the possible completions of the text before point, +treating it as a shell variable. +.TP +.B complete\-hostname (M\-@) +Attempt completion on the text before point, treating +it as a hostname. +.TP +.B possible\-hostname\-completions (C\-x @) +List the possible completions of the text before point, +treating it as a hostname. +.TP +.B complete\-command (M\-!) +Attempt completion on the text before point, treating +it as a command name. Command completion attempts to +match the text against aliases, reserved words, shell +functions, shell builtins, and finally executable filenames, +in that order. +.TP +.B possible\-command\-completions (C\-x !) +List the possible completions of the text before point, +treating it as a command name. +.TP +.B dynamic\-complete\-history (M\-TAB) +Attempt completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +.TP +.B dabbrev\-expand +Attempt menu completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +.TP +.B complete\-into\-braces (M\-{) +Perform filename completion and insert the list of possible completions +enclosed within braces so the list is available to the shell (see +.B Brace Expansion +above). +.PD +.SS Keyboard Macros +.PP +.PD 0 +.TP +.B start\-kbd\-macro (C\-x (\^) +Begin saving the characters typed into the current keyboard macro. +.TP +.B end\-kbd\-macro (C\-x )\^) +Stop saving the characters typed into the current keyboard macro +and store the definition. +.TP +.B call\-last\-kbd\-macro (C\-x e) +Re-execute the last keyboard macro defined, by making the characters +in the macro appear as if typed at the keyboard. +.TP +.B print\-last\-kbd\-macro () +Print the last keyboard macro defined in a format suitable for the +\fIinputrc\fP file. +.PD +.SS Miscellaneous +.PP +.PD 0 +.TP +.B re\-read\-init\-file (C\-x C\-r) +Read in the contents of the \fIinputrc\fP file, and incorporate +any bindings or variable assignments found there. +.TP +.B abort (C\-g) +Abort the current editing command and +ring the terminal's bell (subject to the setting of +.BR bell\-style ). +.TP +.B do\-uppercase\-version (M\-a, M\-b, M\-\fIx\fP, ...) +If the metafied character \fIx\fP is lowercase, run the command +that is bound to the corresponding uppercase character. +.TP +.B prefix\-meta (ESC) +Metafy the next character typed. +.SM +.B ESC +.B f +is equivalent to +.BR Meta\-f . +.TP +.B undo (C\-_, C\-x C\-u) +Incremental undo, separately remembered for each line. +.TP +.B revert\-line (M\-r) +Undo all changes made to this line. This is like executing the +.B undo +command enough times to return the line to its initial state. +.TP +.B tilde\-expand (M\-&) +Perform tilde expansion on the current word. +.TP +.B set\-mark (C\-@, M\-) +Set the mark to the point. If a +numeric argument is supplied, the mark is set to that position. +.TP +.B exchange\-point\-and\-mark (C\-x C\-x) +Swap the point with the mark. The current cursor position is set to +the saved position, and the old cursor position is saved as the mark. +.TP +.B character\-search (C\-]) +A character is read and point is moved to the next occurrence of that +character. A negative count searches for previous occurrences. +.TP +.B character\-search\-backward (M\-C\-]) +A character is read and point is moved to the previous occurrence of that +character. A negative count searches for subsequent occurrences. +.TP +.B skip\-csi\-sequence +Read enough characters to consume a multi-key sequence such as those +defined for keys like Home and End. Such sequences begin with a +Control Sequence Indicator (CSI), usually ESC\-[. If this sequence is +bound to "\e[", keys producing such sequences will have no effect +unless explicitly bound to a readline command, instead of inserting +stray characters into the editing buffer. This is unbound by default, +but usually bound to ESC\-[. +.TP +.B insert\-comment (M\-#) +Without a numeric argument, the value of the readline +.B comment\-begin +variable is inserted at the beginning of the current line. +If a numeric argument is supplied, this command acts as a toggle: if +the characters at the beginning of the line do not match the value +of \fBcomment\-begin\fP, the value is inserted, otherwise +the characters in \fBcomment\-begin\fP are deleted from the beginning of +the line. +In either case, the line is accepted as if a newline had been typed. +The default value of +\fBcomment\-begin\fP causes this command to make the current line +a shell comment. +If a numeric argument causes the comment character to be removed, the line +will be executed by the shell. +.TP +.B glob\-complete\-word (M\-g) +The word before point is treated as a pattern for pathname expansion, +with an asterisk implicitly appended. This pattern is used to +generate a list of matching filenames for possible completions. +.TP +.B glob\-expand\-word (C\-x *) +The word before point is treated as a pattern for pathname expansion, +and the list of matching filenames is inserted, replacing the word. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +.TP +.B glob\-list\-expansions (C\-x g) +The list of expansions that would have been generated by +.B glob\-expand\-word +is displayed, and the line is redrawn. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +.TP +.B dump\-functions +Print all of the functions and their key bindings to the +readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B dump\-variables +Print all of the settable readline variables and their values to the +readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B dump\-macros +Print all of the readline key sequences bound to macros and the +strings they output. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B display\-shell\-version (C\-x C\-v) +Display version information about the current instance of +.BR bash . +.PD +.SS Programmable Completion +.PP +When word completion is attempted for an argument to a command for +which a completion specification (a \fIcompspec\fP) has been defined +using the \fBcomplete\fP builtin (see +.SM +.B "SHELL BUILTIN COMMANDS" +below), the programmable completion facilities are invoked. +.PP +First, the command name is identified. +If the command word is the empty string (completion attempted at the +beginning of an empty line), any compspec defined with +the \fB\-E\fP option to \fBcomplete\fP is used. +If a compspec has been defined for that command, the +compspec is used to generate the list of possible completions for the word. +If the command word is a full pathname, a compspec for the full +pathname is searched for first. +If no compspec is found for the full pathname, an attempt is made to +find a compspec for the portion following the final slash. +If those searches do not result in a compspec, any compspec defined with +the \fB\-D\fP option to \fBcomplete\fP is used as the default. +.PP +Once a compspec has been found, it is used to generate the list of +matching words. +If a compspec is not found, the default \fBbash\fP completion as +described above under \fBCompleting\fP is performed. +.PP +First, the actions specified by the compspec are used. +Only matches which are prefixed by the word being completed are +returned. +When the +.B \-f +or +.B \-d +option is used for filename or directory name completion, the shell +variable +.SM +.B FIGNORE +is used to filter the matches. +.PP +Any completions specified by a pathname expansion pattern to the +\fB\-G\fP option are generated next. +The words generated by the pattern need not match the word +being completed. +The +.SM +.B GLOBIGNORE +shell variable is not used to filter the matches, but the +.SM +.B FIGNORE +variable is used. +.PP +Next, the string specified as the argument to the \fB\-W\fP option +is considered. +The string is first split using the characters in the +.SM +.B IFS +special variable as delimiters. +Shell quoting is honored. +Each word is then expanded using +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, and arithmetic expansion, +as described above under +.SM +.BR EXPANSION . +The results are split using the rules described above under +\fBWord Splitting\fP. +The results of the expansion are prefix-matched against the word being +completed, and the matching words become the possible completions. +.PP +After these matches have been generated, any shell function or command +specified with the \fB\-F\fP and \fB\-C\fP options is invoked. +When the command or function is invoked, the +.SM +.BR COMP_LINE , +.SM +.BR COMP_POINT , +.SM +.BR COMP_KEY , +and +.SM +.B COMP_TYPE +variables are assigned values as described above under +\fBShell Variables\fP. +If a shell function is being invoked, the +.SM +.B COMP_WORDS +and +.SM +.B COMP_CWORD +variables are also set. +When the function or command is invoked, +the first argument (\fB$1\fP) is the name of the command whose arguments are +being completed, +the second argument (\fB$2\fP) is the word being completed, +and the third argument (\fB$3\fP) is the word preceding the word being +completed on the current command line. +No filtering of the generated completions against the word being completed +is performed; the function or command has complete freedom in generating +the matches. +.PP +Any function specified with \fB\-F\fP is invoked first. +The function may use any of the shell facilities, including the +\fBcompgen\fP builtin described below, to generate the matches. +It must put the possible completions in the +.SM +.B COMPREPLY +array variable, one per array element. +.PP +Next, any command specified with the \fB\-C\fP option is invoked +in an environment equivalent to command substitution. +It should print a list of completions, one per line, to the +standard output. +Backslash may be used to escape a newline, if necessary. +.PP +After all of the possible completions are generated, any filter +specified with the \fB\-X\fP option is applied to the list. +The filter is a pattern as used for pathname expansion; a \fB&\fP +in the pattern is replaced with the text of the word being completed. +A literal \fB&\fP may be escaped with a backslash; the backslash +is removed before attempting a match. +Any completion that matches the pattern will be removed from the list. +A leading \fB!\fP negates the pattern; in this case any completion +not matching the pattern will be removed. +.PP +Finally, any prefix and suffix specified with the \fB\-P\fP and \fB\-S\fP +options are added to each member of the completion list, and the result is +returned to the readline completion code as the list of possible +completions. +.PP +If the previously-applied actions do not generate any matches, and the +\fB\-o dirnames\fP option was supplied to \fBcomplete\fP when the +compspec was defined, directory name completion is attempted. +.PP +If the \fB\-o plusdirs\fP option was supplied to \fBcomplete\fP when the +compspec was defined, directory name completion is attempted and any +matches are added to the results of the other actions. +.PP +By default, if a compspec is found, whatever it generates is returned +to the completion code as the full set of possible completions. +The default \fBbash\fP completions are not attempted, and the readline +default of filename completion is disabled. +If the \fB\-o bashdefault\fP option was supplied to \fBcomplete\fP when +the compspec was defined, the \fBbash\fP default completions are attempted +if the compspec generates no matches. +If the \fB\-o default\fP option was supplied to \fBcomplete\fP when the +compspec was defined, readline's default completion will be performed +if the compspec (and, if attempted, the default \fBbash\fP completions) +generate no matches. +.PP +When a compspec indicates that directory name completion is desired, +the programmable completion functions force readline to append a slash +to completed names which are symbolic links to directories, subject to +the value of the \fBmark\-directories\fP readline variable, regardless +of the setting of the \fBmark-symlinked\-directories\fP readline variable. +.PP +There is some support for dynamically modifying completions. This is +most useful when used in combination with a default completion specified +with \fBcomplete -D\fP. +It's possible for shell functions executed as completion +handlers to indicate that completion should be retried by returning an +exit status of 124. If a shell function returns 124, and changes +the compspec associated with the command on which completion is being +attempted (supplied as the first argument when the function is executed), +programmable completion restarts from the beginning, with an +attempt to find a new compspec for that command. This allows a set of +completions to be built dynamically as completion is attempted, rather than +being loaded all at once. +.PP +For instance, assuming that there is a library of compspecs, each kept in a +file corresponding to the name of the command, the following default +completion function would load completions dynamically: +.PP +\f(CW_completion_loader() +.br +{ +.br + . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124 +.br +} +.br +complete -D -F _completion_loader -o bashdefault -o default +.br +\fP +.SH HISTORY +When the +.B \-o history +option to the +.B set +builtin is enabled, the shell provides access to the +\fIcommand history\fP, +the list of commands previously typed. +The value of the +.SM +.B HISTSIZE +variable is used as the +number of commands to save in a history list. +The text of the last +.SM +.B HISTSIZE +commands (default 500) is saved. The shell +stores each command in the history list prior to parameter and +variable expansion (see +.SM +.B EXPANSION +above) but after history expansion is performed, subject to the +values of the shell variables +.SM +.B HISTIGNORE +and +.SM +.BR HISTCONTROL . +.PP +On startup, the history is initialized from the file named by +the variable +.SM +.B HISTFILE +(default \fI~/.bash_history\fP). +The file named by the value of +.SM +.B HISTFILE +is truncated, if necessary, to contain no more than +the number of lines specified by the value of +.SM +.BR HISTFILESIZE . +If \fBHISTFILESIZE\fP is unset, or set to null, a non-numeric value, +or a numeric value less than zero, the history file is not truncated. +When the history file is read, +lines beginning with the history comment character followed immediately +by a digit are interpreted as timestamps for the preceding history line. +These timestamps are optionally displayed depending on the value of the +.SM +.B HISTTIMEFORMAT +variable. +When a shell with history enabled exits, the last +.SM +.B $HISTSIZE +lines are copied from the history list to +.SM +.BR $HISTFILE . +If the +.B histappend +shell option is enabled +(see the description of +.B shopt +under +.SM +.B "SHELL BUILTIN COMMANDS" +below), the lines are appended to the history file, +otherwise the history file is overwritten. +If +.SM +.B HISTFILE +is unset, or if the history file is unwritable, the history is +not saved. +If the +.SM +.B HISTTIMEFORMAT +variable is set, time stamps are written to the history file, marked +with the history comment character, so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +After saving the history, the history file is truncated +to contain no more than +.SM +.B HISTFILESIZE +lines. If +.SM +.B HISTFILESIZE +is unset, or set to null, a non-numeric value, +or a numeric value less than zero, the history file is not truncated. +.PP +The builtin command +.B fc +(see +.SM +.B SHELL BUILTIN COMMANDS +below) may be used to list or edit and re-execute a portion of +the history list. +The +.B history +builtin may be used to display or modify the history list and +manipulate the history file. +When using command-line editing, search commands +are available in each editing mode that provide access to the +history list. +.PP +The shell allows control over which commands are saved on the history +list. The +.SM +.B HISTCONTROL +and +.SM +.B HISTIGNORE +variables may be set to cause the shell to save only a subset of the +commands entered. +The +.B cmdhist +shell option, if enabled, causes the shell to attempt to save each +line of a multi-line command in the same history entry, adding +semicolons where necessary to preserve syntactic correctness. +The +.B lithist +shell option causes the shell to save the command with embedded newlines +instead of semicolons. See the description of the +.B shopt +builtin below under +.SM +.B "SHELL BUILTIN COMMANDS" +for information on setting and unsetting shell options. +.SH "HISTORY EXPANSION" +.PP +The shell supports a history expansion feature that +is similar to the history expansion in +.BR csh. +This section describes what syntax features are available. This +feature is enabled by default for interactive shells, and can be +disabled using the +.B +H +option to the +.B set +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). Non-interactive shells do not perform history expansion +by default. +.PP +History expansions introduce words from the history list into +the input stream, making it easy to repeat commands, insert the +arguments to a previous command into the current input line, or +fix errors in previous commands quickly. +.PP +History expansion is performed immediately after a complete line +is read, before the shell breaks it into words. +It takes place in two parts. +The first is to determine which line from the history list +to use during substitution. +The second is to select portions of that line for inclusion into +the current one. +The line selected from the history is the \fIevent\fP, +and the portions of that line that are acted upon are \fIwords\fP. +Various \fImodifiers\fP are available to manipulate the selected words. +The line is broken into words in the same fashion as when reading input, +so that several \fImetacharacter\fP-separated words surrounded by +quotes are considered one word. +History expansions are introduced by the appearance of the +history expansion character, which is \^\fB!\fP\^ by default. +Only backslash (\^\fB\e\fP\^) and single quotes can quote +the history expansion character. +.PP +Several characters inhibit history expansion if found immediately +following the history expansion character, even if it is unquoted: +space, tab, newline, carriage return, and \fB=\fP. +If the \fBextglob\fP shell option is enabled, \fB(\fP will also +inhibit expansion. +.PP +Several shell options settable with the +.B shopt +builtin may be used to tailor the behavior of history expansion. +If the +.B histverify +shell option is enabled (see the description of the +.B shopt +builtin below), and +.B readline +is being used, history substitutions are not immediately passed to +the shell parser. +Instead, the expanded line is reloaded into the +.B readline +editing buffer for further modification. +If +.B readline +is being used, and the +.B histreedit +shell option is enabled, a failed history substitution will be reloaded +into the +.B readline +editing buffer for correction. +The +.B \-p +option to the +.B history +builtin command may be used to see what a history expansion will +do before using it. +The +.B \-s +option to the +.B history +builtin may be used to add commands to the end of the history list +without actually executing them, so that they are available for +subsequent recall. +.PP +The shell allows control of the various characters used by the +history expansion mechanism (see the description of +.B histchars +above under +.BR "Shell Variables" ). +The shell uses +the history comment character to mark history timestamps when +writing the history file. +.SS Event Designators +.PP +An event designator is a reference to a command line entry in the +history list. +Unless the reference is absolute, events are relative to the current +position in the history list. +.PP +.PD 0 +.TP +.B ! +Start a history substitution, except when followed by a +.BR blank , +newline, carriage return, = +or ( (when the \fBextglob\fP shell option is enabled using +the \fBshopt\fP builtin). +.TP +.B !\fIn\fR +Refer to command line +.IR n . +.TP +.B !\-\fIn\fR +Refer to the current command minus +.IR n . +.TP +.B !! +Refer to the previous command. This is a synonym for `!\-1'. +.TP +.B !\fIstring\fR +Refer to the most recent command preceding the current position in the +history list starting with +.IR string . +.TP +.B !?\fIstring\fR\fB[?]\fR +Refer to the most recent command preceding the current position in the +history list containing +.IR string . +The trailing \fB?\fP may be omitted if +.I string +is followed immediately by a newline. +.TP +.B \d\s+2^\s-2\u\fIstring1\fP\d\s+2^\s-2\u\fIstring2\fP\d\s+2^\s-2\u +Quick substitution. Repeat the previous command, replacing +.I string1 +with +.IR string2 . +Equivalent to +``!!:s/\fIstring1\fP/\fIstring2\fP/'' +(see \fBModifiers\fP below). +.TP +.B !# +The entire command line typed so far. +.PD +.SS Word Designators +.PP +Word designators are used to select desired words from the event. +A +.B : +separates the event specification from the word designator. +It may be omitted if the word designator begins with a +.BR ^ , +.BR $ , +.BR * , +.BR \- , +or +.BR % . +Words are numbered from the beginning of the line, +with the first word being denoted by 0 (zero). +Words are inserted into the current line separated by single spaces. +.PP +.PD 0 +.TP +.B 0 (zero) +The zeroth word. For the shell, this is the command +word. +.TP +.I n +The \fIn\fRth word. +.TP +.B ^ +The first argument. That is, word 1. +.TP +.B $ +The last word. This is usually the last argument, but will expand to the +zeroth word if there is only one word in the line. +.TP +.B % +The word matched by the most recent `?\fIstring\fR?' search. +.TP +.I x\fB\-\fPy +A range of words; `\-\fIy\fR' abbreviates `0\-\fIy\fR'. +.TP +.B * +All of the words but the zeroth. This is a synonym +for `\fI1\-$\fP'. It is not an error to use +.B * +if there is just one +word in the event; the empty string is returned in that case. +.TP +.B x* +Abbreviates \fIx\-$\fP. +.TP +.B x\- +Abbreviates \fIx\-$\fP like \fBx*\fP, but omits the last word. +.PD +.PP +If a word designator is supplied without an event specification, the +previous command is used as the event. +.SS Modifiers +.PP +After the optional word designator, there may appear a sequence of +one or more of the following modifiers, each preceded by a `:'. +.PP +.PD 0 +.PP +.TP +.B h +Remove a trailing filename component, leaving only the head. +.TP +.B t +Remove all leading filename components, leaving the tail. +.TP +.B r +Remove a trailing suffix of the form \fI.xxx\fP, leaving the +basename. +.TP +.B e +Remove all but the trailing suffix. +.TP +.B p +Print the new command but do not execute it. +.TP +.B q +Quote the substituted words, escaping further substitutions. +.TP +.B x +Quote the substituted words as with +.BR q , +but break into words at +.B blanks +and newlines. +.TP +.B s/\fIold\fP/\fInew\fP/ +Substitute +.I new +for the first occurrence of +.I old +in the event line. Any delimiter can be used in place of /. The +final delimiter is optional if it is the last character of the +event line. The delimiter may be quoted in +.I old +and +.I new +with a single backslash. If & appears in +.IR new , +it is replaced by +.IR old . +A single backslash will quote the &. If +.I old +is null, it is set to the last +.I old +substituted, or, if no previous history substitutions took place, +the last +.I string +in a +.B !?\fIstring\fR\fB[?]\fR +search. +.TP +.B & +Repeat the previous substitution. +.TP +.B g +Cause changes to be applied over the entire event line. This is +used in conjunction with `\fB:s\fP' (e.g., `\fB:gs/\fIold\fP/\fInew\fP/\fR') +or `\fB:&\fP'. If used with +`\fB:s\fP', any delimiter can be used +in place of /, and the final delimiter is optional +if it is the last character of the event line. +An \fBa\fP may be used as a synonym for \fBg\fP. +.TP +.B G +Apply the following `\fBs\fP' modifier once to each word in the event line. +.PD +.SH "SHELL BUILTIN COMMANDS" +.\" start of bash_builtins +.zZ +.PP +Unless otherwise noted, each builtin command documented in this +section as accepting options preceded by +.B \- +accepts +.B \-\- +to signify the end of the options. +The \fB:\fP, \fBtrue\fP, \fBfalse\fP, and \fBtest\fP builtins +do not accept options and do not treat \fB\-\-\fP specially. +The \fBexit\fP, \fBlogout\fP, \fBbreak\fP, \fBcontinue\fP, \fBlet\fP, +and \fBshift\fP builtins accept and process arguments beginning with +\fB\-\fP without requiring \fB\-\-\fP. +Other builtins that accept arguments but are not specified as accepting +options interpret arguments beginning with \fB\-\fP as invalid options and +require \fB\-\-\fP to prevent this interpretation. +.sp .5 +.PD 0 +.TP +\fB:\fP [\fIarguments\fP] +.PD +No effect; the command does nothing beyond expanding +.I arguments +and performing any specified +redirections. A zero exit code is returned. +.TP +\fB .\| \fP \fIfilename\fP [\fIarguments\fP] +.PD 0 +.TP +\fBsource\fP \fIfilename\fP [\fIarguments\fP] +.PD +Read and execute commands from +.I filename +in the current +shell environment and return the exit status of the last command +executed from +.IR filename . +If +.I filename +does not contain a slash, filenames in +.SM +.B PATH +are used to find the directory containing +.IR filename . +The file searched for in +.SM +.B PATH +need not be executable. +When \fBbash\fP is not in \fIposix mode\fP, the current directory is +searched if no file is found in +.SM +.BR PATH . +If the +.B sourcepath +option to the +.B shopt +builtin command is turned off, the +.SM +.B PATH +is not searched. +If any \fIarguments\fP are supplied, they become the positional +parameters when \fIfilename\fP is executed. Otherwise the positional +parameters are unchanged. +The return status is the status of the last command exited within +the script (0 if no commands are executed), and false if +.I filename +is not found or cannot be read. +.TP +\fBalias\fP [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +\fBAlias\fP with no arguments or with the +.B \-p +option prints the list of aliases in the form +\fBalias\fP \fIname\fP=\fIvalue\fP on standard output. +When arguments are supplied, an alias is defined for +each \fIname\fP whose \fIvalue\fP is given. +A trailing space in \fIvalue\fP causes the next word to be +checked for alias substitution when the alias is expanded. +For each \fIname\fP in the argument list for which no \fIvalue\fP +is supplied, the name and value of the alias is printed. +\fBAlias\fP returns true unless a \fIname\fP is given for which +no alias has been defined. +.TP +\fBbg\fP [\fIjobspec\fP ...] +Resume each suspended job \fIjobspec\fP in the background, as if it +had been started with +.BR & . +If +.I jobspec +is not present, the shell's notion of the \fIcurrent job\fP is used. +.B bg +.I jobspec +returns 0 unless run when job control is disabled or, when run with +job control enabled, any specified \fIjobspec\fP was not found +or was started without job control. +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] [\fB\-lpsvPSVX\fP] +.PD 0 +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] [\fB\-q\fP \fIfunction\fP] [\fB\-u\fP \fIfunction\fP] [\fB\-r\fP \fIkeyseq\fP] +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fB\-f\fP \fIfilename\fP +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fB\-x\fP \fIkeyseq\fP:\fIshell\-command\fP +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fIkeyseq\fP:\fIfunction\-name\fP +.TP +\fBbind\fP \fIreadline\-command\fP +.PD +Display current +.B readline +key and function bindings, bind a key sequence to a +.B readline +function or macro, or set a +.B readline +variable. +Each non-option argument is a command as it would appear in +.IR .inputrc , +but each binding or command must be passed as a separate argument; +e.g., '"\eC\-x\eC\-r": re\-read\-init\-file'. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-m \fIkeymap\fP +Use +.I keymap +as the keymap to be affected by the subsequent bindings. +Acceptable +.I keymap +names are +\fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi, +vi\-move, vi\-command\fP, and +.IR vi\-insert . +\fIvi\fP is equivalent to \fIvi\-command\fP; \fIemacs\fP is +equivalent to \fIemacs\-standard\fP. +.TP +.B \-l +List the names of all \fBreadline\fP functions. +.TP +.B \-p +Display \fBreadline\fP function names and bindings in such a way +that they can be re-read. +.TP +.B \-P +List current \fBreadline\fP function names and bindings. +.TP +.B \-s +Display \fBreadline\fP key sequences bound to macros and the strings +they output in such a way that they can be re-read. +.TP +.B \-S +Display \fBreadline\fP key sequences bound to macros and the strings +they output. +.TP +.B \-v +Display \fBreadline\fP variable names and values in such a way that they +can be re-read. +.TP +.B \-V +List current \fBreadline\fP variable names and values. +.TP +.B \-f \fIfilename\fP +Read key bindings from \fIfilename\fP. +.TP +.B \-q \fIfunction\fP +Query about which keys invoke the named \fIfunction\fP. +.TP +.B \-u \fIfunction\fP +Unbind all keys bound to the named \fIfunction\fP. +.TP +.B \-r \fIkeyseq\fP +Remove any current binding for \fIkeyseq\fP. +.TP +.B \-x \fIkeyseq\fP:\fIshell\-command\fP +Cause \fIshell\-command\fP to be executed whenever \fIkeyseq\fP is +entered. +When \fIshell\-command\fP is executed, the shell sets the +.SM +.B READLINE_LINE +variable to the contents of the \fBreadline\fP line buffer and the +.SM +.B READLINE_POINT +variable to the current location of the insertion point. +If the executed command changes the value of +.SM +.B READLINE_LINE +or +.SM +.BR READLINE_POINT , +those new values will be reflected in the editing state. +.TP +.B \-X +List all key sequences bound to shell commands and the associated commands +in a format that can be reused as input. +.PD +.PP +The return value is 0 unless an unrecognized option is given or an +error occurred. +.RE +.TP +\fBbreak\fP [\fIn\fP] +Exit from within a +.BR for , +.BR while , +.BR until , +or +.B select +loop. If \fIn\fP is specified, break \fIn\fP levels. +.I n +must be \(>= 1. If +.I n +is greater than the number of enclosing loops, all enclosing loops +are exited. +The return value is 0 unless \fIn\fP is not greater than or equal to 1. +.TP +\fBbuiltin\fP \fIshell\-builtin\fP [\fIarguments\fP] +Execute the specified shell builtin, passing it +.IR arguments , +and return its exit status. +This is useful when defining a +function whose name is the same as a shell builtin, +retaining the functionality of the builtin within the function. +The \fBcd\fP builtin is commonly redefined this way. +The return status is false if +.I shell\-builtin +is not a shell builtin command. +.TP +\fBcaller\fP [\fIexpr\fP] +Returns the context of any active subroutine call (a shell function or +a script executed with the \fB.\fP or \fBsource\fP builtins). +Without \fIexpr\fP, \fBcaller\fP displays the line number and source +filename of the current subroutine call. +If a non-negative integer is supplied as \fIexpr\fP, \fBcaller\fP +displays the line number, subroutine name, and source file corresponding +to that position in the current execution call stack. This extra +information may be used, for example, to print a stack trace. The +current frame is frame 0. +The return value is 0 unless the shell is not executing a subroutine +call or \fIexpr\fP does not correspond to a valid position in the +call stack. +.TP +\fBcd\fP [\fB\-L\fP|[\fB\-P\fP [\fB\-e\fP]] [\-@]] [\fIdir\fP] +Change the current directory to \fIdir\fP. +if \fIdir\fP is not supplied, the value of the +.SM +.B HOME +shell variable is the default. +Any additional arguments following \fIdir\fP are ignored. +The variable +.SM +.B CDPATH +defines the search path for the directory containing +.IR dir : +each directory name in +.SM +.B CDPATH +is searched for \fIdir\fP. +Alternative directory names in +.SM +.B CDPATH +are separated by a colon (:). A null directory name in +.SM +.B CDPATH +is the same as the current directory, i.e., ``\fB.\fP''. If +.I dir +begins with a slash (/), +then +.SM +.B CDPATH +is not used. The +.B \-P +option causes \fBcd\fP to use the physical directory structure +by resolving symbolic links while traversing \fIdir\fP and +before processing instances of \fI..\fP in \fIdir\fP (see also the +.B \-P +option to the +.B set +builtin command); the +.B \-L +option forces symbolic links to be followed by resolving the link +after processing instances of \fI..\fP in \fIdir\fP. +If \fI..\fP appears in \fIdir\fP, it is processed by removing the +immediately previous pathname component from \fIdir\fP, back to a slash +or the beginning of \fIdir\fP. +If the +.B \-e +option is supplied with +.BR \-P , +and the current working directory cannot be successfully determined +after a successful directory change, \fBcd\fP will return an unsuccessful +status. +On systems that support it, the \fB\-@\fP option presents the extended +attributes associated with a file as a directory. +An argument of +.B \- +is converted to +.SM +.B $OLDPWD +before the directory change is attempted. +If a non-empty directory name from +.SM +.B CDPATH +is used, or if +\fB\-\fP is the first argument, and the directory change is +successful, the absolute pathname of the new working directory is +written to the standard output. +The return value is true if the directory was successfully changed; +false otherwise. +.TP +\fBcommand\fP [\fB\-pVv\fP] \fIcommand\fP [\fIarg\fP ...] +Run +.I command +with +.I args +suppressing the normal shell function lookup. Only builtin +commands or commands found in the +.SM +.B PATH +are executed. If the +.B \-p +option is given, the search for +.I command +is performed using a default value for +.SM +.B PATH +that is guaranteed to find all of the standard utilities. +If either the +.B \-V +or +.B \-v +option is supplied, a description of +.I command +is printed. The +.B \-v +option causes a single word indicating the command or filename +used to invoke +.I command +to be displayed; the +.B \-V +option produces a more verbose description. +If the +.B \-V +or +.B \-v +option is supplied, the exit status is 0 if +.I command +was found, and 1 if not. If neither option is supplied and +an error occurred or +.I command +cannot be found, the exit status is 127. Otherwise, the exit status of the +.B command +builtin is the exit status of +.IR command . +.TP +\fBcompgen\fP [\fIoption\fP] [\fIword\fP] +Generate possible completion matches for \fIword\fP according to +the \fIoption\fPs, which may be any option accepted by the +.B complete +builtin with the exception of \fB\-p\fP and \fB\-r\fP, and write +the matches to the standard output. +When using the \fB\-F\fP or \fB\-C\fP options, the various shell variables +set by the programmable completion facilities, while available, will not +have useful values. +.sp 1 +The matches will be generated in the same way as if the programmable +completion code had generated them directly from a completion specification +with the same flags. +If \fIword\fP is specified, only those completions matching \fIword\fP +will be displayed. +.sp 1 +The return value is true unless an invalid option is supplied, or no +matches were generated. +.TP +\fBcomplete\fP [\fB\-abcdefgjksuv\fP] [\fB\-o\fP \fIcomp-option\fP] [\fB\-DE\fP] [\fB\-A\fP \fIaction\fP] [\fB\-G\fP \fIglobpat\fP] [\fB\-W\fP \fIwordlist\fP] [\fB\-F\fP \fIfunction\fP] [\fB\-C\fP \fIcommand\fP] +.br +[\fB\-X\fP \fIfilterpat\fP] [\fB\-P\fP \fIprefix\fP] [\fB\-S\fP \fIsuffix\fP] \fIname\fP [\fIname ...\fP] +.PD 0 +.TP +\fBcomplete\fP \fB\-pr\fP [\fB\-DE\fP] [\fIname\fP ...] +.PD +Specify how arguments to each \fIname\fP should be completed. +If the \fB\-p\fP option is supplied, or if no options are supplied, +existing completion specifications are printed in a way that allows +them to be reused as input. +The \fB\-r\fP option removes a completion specification for +each \fIname\fP, or, if no \fIname\fPs are supplied, all +completion specifications. +The \fB\-D\fP option indicates that the remaining options and actions should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The \fB\-E\fP option indicates that the remaining options and actions should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +.sp 1 +The process of applying these completion specifications when word completion +is attempted is described above under \fBProgrammable Completion\fP. +.sp 1 +Other options, if specified, have the following meanings. +The arguments to the \fB\-G\fP, \fB\-W\fP, and \fB\-X\fP options +(and, if necessary, the \fB\-P\fP and \fB\-S\fP options) +should be quoted to protect them from expansion before the +.B complete +builtin is invoked. +.RS +.PD 0 +.TP 8 +\fB\-o\fP \fIcomp-option\fP +The \fIcomp-option\fP controls several aspects of the compspec's behavior +beyond the simple generation of completions. +\fIcomp-option\fP may be one of: +.RS +.TP 8 +.B bashdefault +Perform the rest of the default \fBbash\fP completions if the compspec +generates no matches. +.TP 8 +.B default +Use readline's default filename completion if the compspec generates +no matches. +.TP 8 +.B dirnames +Perform directory name completion if the compspec generates no matches. +.TP 8 +.B filenames +Tell readline that the compspec generates filenames, so it can perform any +filename\-specific processing (like adding a slash to directory names, +quoting special characters, or suppressing trailing spaces). +Intended to be used with shell functions. +.TP 8 +.B noquote +Tell readline not to quote the completed words if they are filenames +(quoting filenames is the default). +.TP 8 +.B nospace +Tell readline not to append a space (the default) to words completed at +the end of the line. +.TP 8 +.B plusdirs +After any matches defined by the compspec are generated, +directory name completion is attempted and any +matches are added to the results of the other actions. +.RE +.TP 8 +\fB\-A\fP \fIaction\fP +The \fIaction\fP may be one of the following to generate a list of possible +completions: +.RS +.TP 8 +.B alias +Alias names. May also be specified as \fB\-a\fP. +.TP 8 +.B arrayvar +Array variable names. +.TP 8 +.B binding +\fBReadline\fP key binding names. +.TP 8 +.B builtin +Names of shell builtin commands. May also be specified as \fB\-b\fP. +.TP 8 +.B command +Command names. May also be specified as \fB\-c\fP. +.TP 8 +.B directory +Directory names. May also be specified as \fB\-d\fP. +.TP 8 +.B disabled +Names of disabled shell builtins. +.TP 8 +.B enabled +Names of enabled shell builtins. +.TP 8 +.B export +Names of exported shell variables. May also be specified as \fB\-e\fP. +.TP 8 +.B file +File names. May also be specified as \fB\-f\fP. +.TP 8 +.B function +Names of shell functions. +.TP 8 +.B group +Group names. May also be specified as \fB\-g\fP. +.TP 8 +.B helptopic +Help topics as accepted by the \fBhelp\fP builtin. +.TP 8 +.B hostname +Hostnames, as taken from the file specified by the +.SM +.B HOSTFILE +shell variable. +.TP 8 +.B job +Job names, if job control is active. May also be specified as \fB\-j\fP. +.TP 8 +.B keyword +Shell reserved words. May also be specified as \fB\-k\fP. +.TP 8 +.B running +Names of running jobs, if job control is active. +.TP 8 +.B service +Service names. May also be specified as \fB\-s\fP. +.TP 8 +.B setopt +Valid arguments for the \fB\-o\fP option to the \fBset\fP builtin. +.TP 8 +.B shopt +Shell option names as accepted by the \fBshopt\fP builtin. +.TP 8 +.B signal +Signal names. +.TP 8 +.B stopped +Names of stopped jobs, if job control is active. +.TP 8 +.B user +User names. May also be specified as \fB\-u\fP. +.TP 8 +.B variable +Names of all shell variables. May also be specified as \fB\-v\fP. +.RE +.TP 8 +\fB\-C\fP \fIcommand\fP +\fIcommand\fP is executed in a subshell environment, and its output is +used as the possible completions. +.TP 8 +\fB\-F\fP \fIfunction\fP +The shell function \fIfunction\fP is executed in the current shell +environment. +When the function is executed, +the first argument (\fB$1\fP) is the name of the command whose arguments are +being completed, +the second argument (\fB$2\fP) is the word being completed, +and the third argument (\fB$3\fP) is the word preceding the word being +completed on the current command line. +When it finishes, the possible completions are retrieved from the value +of the +.SM +.B COMPREPLY +array variable. +.TP 8 +\fB\-G\fP \fIglobpat\fP +The pathname expansion pattern \fIglobpat\fP is expanded to generate +the possible completions. +.TP 8 +\fB\-P\fP \fIprefix\fP +\fIprefix\fP is added at the beginning of each possible completion +after all other options have been applied. +.TP 8 +\fB\-S\fP \fIsuffix\fP +\fIsuffix\fP is appended to each possible completion +after all other options have been applied. +.TP 8 +\fB\-W\fP \fIwordlist\fP +The \fIwordlist\fP is split using the characters in the +.SM +.B IFS +special variable as delimiters, and each resultant word is expanded. +The possible completions are the members of the resultant list which +match the word being completed. +.TP 8 +\fB\-X\fP \fIfilterpat\fP +\fIfilterpat\fP is a pattern as used for pathname expansion. +It is applied to the list of possible completions generated by the +preceding options and arguments, and each completion matching +\fIfilterpat\fP is removed from the list. +A leading \fB!\fP in \fIfilterpat\fP negates the pattern; in this +case, any completion not matching \fIfilterpat\fP is removed. +.PD +.PP +The return value is true unless an invalid option is supplied, an option +other than \fB\-p\fP or \fB\-r\fP is supplied without a \fIname\fP +argument, an attempt is made to remove a completion specification for +a \fIname\fP for which no specification exists, or +an error occurs adding a completion specification. +.RE +.TP +\fBcompopt\fP [\fB\-o\fP \fIoption\fP] [\fB\-DE\fP] [\fB+o\fP \fIoption\fP] [\fIname\fP] +Modify completion options for each \fIname\fP according to the +\fIoption\fPs, or for the +currently-executing completion if no \fIname\fPs are supplied. +If no \fIoption\fPs are given, display the completion options for each +\fIname\fP or the current completion. +The possible values of \fIoption\fP are those valid for the \fBcomplete\fP +builtin described above. +The \fB\-D\fP option indicates that the remaining options should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The \fB\-E\fP option indicates that the remaining options should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +.sp 1 +The return value is true unless an invalid option is supplied, an attempt +is made to modify the options for a \fIname\fP for which no completion +specification exists, or an output error occurs. +.TP +\fBcontinue\fP [\fIn\fP] +Resume the next iteration of the enclosing +.BR for , +.BR while , +.BR until , +or +.B select +loop. +If +.I n +is specified, resume at the \fIn\fPth enclosing loop. +.I n +must be \(>= 1. If +.I n +is greater than the number of enclosing loops, the last enclosing loop +(the ``top-level'' loop) is resumed. +The return value is 0 unless \fIn\fP is not greater than or equal to 1. +.TP +\fBdeclare\fP [\fB\-aAfFgilnrtux\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +.PD 0 +.TP +\fBtypeset\fP [\fB\-aAfFgilnrtux\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +.PD +Declare variables and/or give them attributes. +If no \fIname\fPs are given then display the values of variables. +The +.B \-p +option will display the attributes and values of each +.IR name . +When +.B \-p +is used with \fIname\fP arguments, additional options, +other than \fB\-f\fP and \fB\-F\fP, are ignored. +When +.B \-p +is supplied without \fIname\fP arguments, it will display the attributes +and values of all variables having the attributes specified by the +additional options. +If no other options are supplied with \fB\-p\fP, \fBdeclare\fP will display +the attributes and values of all shell variables. The \fB\-f\fP option +will restrict the display to shell functions. +The +.B \-F +option inhibits the display of function definitions; only the +function name and attributes are printed. +If the \fBextdebug\fP shell option is enabled using \fBshopt\fP, +the source file name and line number where the function is defined +are displayed as well. The +.B \-F +option implies +.BR \-f . +The +.B \-g +option forces variables to be created or modified at the global scope, +even when \fBdeclare\fP is executed in a shell function. +It is ignored in all other cases. +The following options can +be used to restrict output to variables with the specified attribute or +to give variables attributes: +.RS +.PD 0 +.TP +.B \-a +Each \fIname\fP is an indexed array variable (see +.B Arrays +above). +.TP +.B \-A +Each \fIname\fP is an associative array variable (see +.B Arrays +above). +.TP +.B \-f +Use function names only. +.TP +.B \-i +The variable is treated as an integer; arithmetic evaluation (see +.SM +.B "ARITHMETIC EVALUATION" +above) is performed when the variable is assigned a value. +.TP +.B \-l +When the variable is assigned a value, all upper-case characters are +converted to lower-case. +The upper-case attribute is disabled. +.TP +.B \-n +Give each \fIname\fP the \fInameref\fP attribute, making +it a name reference to another variable. +That other variable is defined by the value of \fIname\fP. +All references and assignments to \fIname\fP, except for changing the +\fB\-n\fP attribute itself, are performed on the variable referenced by +\fIname\fP's value. +The \fB\-n\fP attribute cannot be applied to array variables. +.TP +.B \-r +Make \fIname\fPs readonly. These names cannot then be assigned values +by subsequent assignment statements or unset. +.TP +.B \-t +Give each \fIname\fP the \fItrace\fP attribute. +Traced functions inherit the \fBDEBUG\fP and \fBRETURN\fP traps from +the calling shell. +The trace attribute has no special meaning for variables. +.TP +.B \-u +When the variable is assigned a value, all lower-case characters are +converted to upper-case. +The lower-case attribute is disabled. +.TP +.B \-x +Mark \fIname\fPs for export to subsequent commands via the environment. +.PD +.PP +Using `+' instead of `\-' +turns off the attribute instead, +with the exceptions that \fB+a\fP +may not be used to destroy an array variable and \fB+r\fP will not +remove the readonly attribute. +When used in a function, +.B declare +and +.B typeset +make each +\fIname\fP local, as with the +.B local +command, +unless the \fB\-g\fP option is supplied. +If a variable name is followed by =\fIvalue\fP, the value of +the variable is set to \fIvalue\fP. +When using \fB\-a\fP or \fB\-A\fP and the compound assignment syntax to +create array variables, additional attributes do not take effect until +subsequent assignments. +The return value is 0 unless an invalid option is encountered, +an attempt is made to define a function using +.if n ``\-f foo=bar'', +.if t \f(CW\-f foo=bar\fP, +an attempt is made to assign a value to a readonly variable, +an attempt is made to assign a value to an array variable without +using the compound assignment syntax (see +.B Arrays +above), one of the \fInames\fP is not a valid shell variable name, +an attempt is made to turn off readonly status for a readonly variable, +an attempt is made to turn off array status for an array variable, +or an attempt is made to display a non-existent function with \fB\-f\fP. +.RE +.TP +.B dirs [\fB\-clpv\fP] [+\fIn\fP] [\-\fIn\fP] +Without options, displays the list of currently remembered directories. +The default display is on a single line with directory names separated +by spaces. +Directories are added to the list with the +.B pushd +command; the +.B popd +command removes entries from the list. +.RS +.PD 0 +.TP +.B \-c +Clears the directory stack by deleting all of the entries. +.TP +.B \-l +Produces a listing using full pathnames; +the default listing format uses a tilde to denote the home directory. +.TP +.B \-p +Print the directory stack with one entry per line. +.TP +.B \-v +Print the directory stack with one entry per line, +prefixing each entry with its index in the stack. +.TP +\fB+\fP\fIn\fP +Displays the \fIn\fPth entry counting from the left of the list +shown by +.B dirs +when invoked without options, starting with zero. +.TP +\fB\-\fP\fIn\fP +Displays the \fIn\fPth entry counting from the right of the list +shown by +.B dirs +when invoked without options, starting with zero. +.PD +.PP +The return value is 0 unless an +invalid option is supplied or \fIn\fP indexes beyond the end +of the directory stack. +.RE +.TP +\fBdisown\fP [\fB\-ar\fP] [\fB\-h\fP] [\fIjobspec\fP ...] +Without options, remove each +.I jobspec +from the table of active jobs. +If +.I jobspec +is not present, and neither the \fB\-a\fP nor the \fB\-r\fP option +is supplied, the \fIcurrent job\fP is used. +If the \fB\-h\fP option is given, each +.I jobspec +is not removed from the table, but is marked so that +.SM +.B SIGHUP +is not sent to the job if the shell receives a +.SM +.BR SIGHUP . +If no +.I jobspec +is supplied, the +.B \-a +option means to remove or mark all jobs; the +.B \-r +option without a +.I jobspec +argument restricts operation to running jobs. +The return value is 0 unless a +.I jobspec +does not specify a valid job. +.TP +\fBecho\fP [\fB\-neE\fP] [\fIarg\fP ...] +Output the \fIarg\fPs, separated by spaces, followed by a newline. +The return status is 0 unless a write error occurs. +If \fB\-n\fP is specified, the trailing newline is +suppressed. If the \fB\-e\fP option is given, interpretation of +the following backslash-escaped characters is enabled. The +.B \-E +option disables the interpretation of these escape characters, +even on systems where they are interpreted by default. +The \fBxpg_echo\fP shell option may be used to +dynamically determine whether or not \fBecho\fP expands these +escape characters by default. +.B echo +does not interpret \fB\-\-\fP to mean the end of options. +.B echo +interprets the following escape sequences: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ec +suppress further output +.TP +.B \ee +.TP +.B \eE +an escape character +.TP +.B \ef +form feed +.TP +.B \en +new line +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\e +backslash +.TP +.B \e0\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(zero to three octal digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.TP +.B \eu\fIHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHH\fP (one to four hex digits) +.TP +.B \eU\fIHHHHHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHHHHHH\fP (one to eight hex digits) +.PD +.RE +.TP +\fBenable\fP [\fB\-a\fP] [\fB\-dnps\fP] [\fB\-f\fP \fIfilename\fP] [\fIname\fP ...] +Enable and disable builtin shell commands. +Disabling a builtin allows a disk command which has the same name +as a shell builtin to be executed without specifying a full pathname, +even though the shell normally searches for builtins before disk commands. +If \fB\-n\fP is used, each \fIname\fP +is disabled; otherwise, +\fInames\fP are enabled. For example, to use the +.B test +binary found via the +.SM +.B PATH +instead of the shell builtin version, run +.if t \f(CWenable -n test\fP. +.if n ``enable -n test''. +The +.B \-f +option means to load the new builtin command +.I name +from shared object +.IR filename , +on systems that support dynamic loading. The +.B \-d +option will delete a builtin previously loaded with +.BR \-f . +If no \fIname\fP arguments are given, or if the +.B \-p +option is supplied, a list of shell builtins is printed. +With no other option arguments, the list consists of all enabled +shell builtins. +If \fB\-n\fP is supplied, only disabled builtins are printed. +If \fB\-a\fP is supplied, the list printed includes all builtins, with an +indication of whether or not each is enabled. +If \fB\-s\fP is supplied, the output is restricted to the POSIX +\fIspecial\fP builtins. +The return value is 0 unless a +.I name +is not a shell builtin or there is an error loading a new builtin +from a shared object. +.TP +\fBeval\fP [\fIarg\fP ...] +The \fIarg\fPs are read and concatenated together into a single +command. This command is then read and executed by the shell, and +its exit status is returned as the value of +.BR eval . +If there are no +.IR args , +or only null arguments, +.B eval +returns 0. +.TP +\fBexec\fP [\fB\-cl\fP] [\fB\-a\fP \fIname\fP] [\fIcommand\fP [\fIarguments\fP]] +If +.I command +is specified, it replaces the shell. +No new process is created. The +.I arguments +become the arguments to \fIcommand\fP. +If the +.B \-l +option is supplied, +the shell places a dash at the beginning of the zeroth argument passed to +.IR command . +This is what +.IR login (1) +does. The +.B \-c +option causes +.I command +to be executed with an empty environment. If +.B \-a +is supplied, the shell passes +.I name +as the zeroth argument to the executed command. +If +.I command +cannot be executed for some reason, a non-interactive shell exits, +unless the +.B execfail +shell option +is enabled. In that case, it returns failure. +An interactive shell returns failure if the file cannot be executed. +If +.I command +is not specified, any redirections take effect in the current shell, +and the return status is 0. If there is a redirection error, the +return status is 1. +.TP +\fBexit\fP [\fIn\fP] +Cause the shell to exit +with a status of \fIn\fP. If +.I n +is omitted, the exit status +is that of the last command executed. +A trap on +.SM +.B EXIT +is executed before the shell terminates. +.TP +\fBexport\fP [\fB\-fn\fP\^] [\fIname\fP[=\fIword\fP]] ... +.PD 0 +.TP +.B export \-p +.PD +The supplied +.I names +are marked for automatic export to the environment of +subsequently executed commands. If the +.B \-f +option is given, +the +.I names +refer to functions. +If no +.I names +are given, or if the +.B \-p +option is supplied, a list +of names of all exported variables is printed. +The +.B \-n +option causes the export property to be removed from each +\fIname\fP. +If a variable name is followed by =\fIword\fP, the value of +the variable is set to \fIword\fP. +.B export +returns an exit status of 0 unless an invalid option is +encountered, +one of the \fInames\fP is not a valid shell variable name, or +.B \-f +is supplied with a +.I name +that is not a function. +.TP +\fBfc\fP [\fB\-e\fP \fIename\fP] [\fB\-lnr\fP] [\fIfirst\fP] [\fIlast\fP] +.PD 0 +.TP +\fBfc\fP \fB\-s\fP [\fIpat\fP=\fIrep\fP] [\fIcmd\fP] +.PD +The first form selects a range of commands from +.I first +to +.I last +from the history list and displays or edits and re-executes them. +.I First +and +.I last +may be specified as a string (to locate the last command beginning +with that string) or as a number (an index into the history list, +where a negative number is used as an offset from the current +command number). If +.I last +is not specified it is set to +the current command for listing (so that +.if n ``fc \-l \-10'' +.if t \f(CWfc \-l \-10\fP +prints the last 10 commands) and to +.I first +otherwise. +If +.I first +is not specified it is set to the previous +command for editing and \-16 for listing. +.sp 1 +The +.B \-n +option suppresses +the command numbers when listing. The +.B \-r +option reverses the order of +the commands. If the +.B \-l +option is given, +the commands are listed on +standard output. Otherwise, the editor given by +.I ename +is invoked +on a file containing those commands. If +.I ename +is not given, the +value of the +.SM +.B FCEDIT +variable is used, and +the value of +.SM +.B EDITOR +if +.SM +.B FCEDIT +is not set. If neither variable is set, +.FN vi +is used. When editing is complete, the edited commands are +echoed and executed. +.sp 1 +In the second form, \fIcommand\fP is re-executed after each instance +of \fIpat\fP is replaced by \fIrep\fP. +\fICommand\fP is intepreted the same as \fIfirst\fP above. +A useful alias to use with this is +.if n ``r="fc -s"'', +.if t \f(CWr='fc \-s'\fP, +so that typing +.if n ``r cc'' +.if t \f(CWr cc\fP +runs the last command beginning with +.if n ``cc'' +.if t \f(CWcc\fP +and typing +.if n ``r'' +.if t \f(CWr\fP +re-executes the last command. +.sp 1 +If the first form is used, the return value is 0 unless an invalid +option is encountered or +.I first +or +.I last +specify history lines out of range. +If the +.B \-e +option is supplied, the return value is the value of the last +command executed or failure if an error occurs with the temporary +file of commands. If the second form is used, the return status +is that of the command re-executed, unless +.I cmd +does not specify a valid history line, in which case +.B fc +returns failure. +.TP +\fBfg\fP [\fIjobspec\fP] +Resume +.I jobspec +in the foreground, and make it the current job. +If +.I jobspec +is not present, the shell's notion of the \fIcurrent job\fP is used. +The return value is that of the command placed into the foreground, +or failure if run when job control is disabled or, when run with +job control enabled, if +.I jobspec +does not specify a valid job or +.I jobspec +specifies a job that was started without job control. +.TP +\fBgetopts\fP \fIoptstring\fP \fIname\fP [\fIargs\fP] +.B getopts +is used by shell procedures to parse positional parameters. +.I optstring +contains the option characters to be recognized; if a character +is followed by a colon, the option is expected to have an +argument, which should be separated from it by white space. +The colon and question mark characters may not be used as +option characters. +Each time it is invoked, +.B getopts +places the next option in the shell variable +.IR name , +initializing +.I name +if it does not exist, +and the index of the next argument to be processed into the +variable +.SM +.BR OPTIND . +.SM +.B OPTIND +is initialized to 1 each time the shell or a shell script +is invoked. When an option requires an argument, +.B getopts +places that argument into the variable +.SM +.BR OPTARG . +The shell does not reset +.SM +.B OPTIND +automatically; it must be manually reset between multiple +calls to +.B getopts +within the same shell invocation if a new set of parameters +is to be used. +.sp 1 +When the end of options is encountered, \fBgetopts\fP exits with a +return value greater than zero. +.SM +.B OPTIND +is set to the index of the first non-option argument, +and \fIname\fP is set to ?. +.sp 1 +.B getopts +normally parses the positional parameters, but if more arguments are +given in +.IR args , +.B getopts +parses those instead. +.sp 1 +.B getopts +can report errors in two ways. If the first character of +.I optstring +is a colon, +.I silent +error reporting is used. In normal operation, diagnostic messages +are printed when invalid options or missing option arguments are +encountered. +If the variable +.SM +.B OPTERR +is set to 0, no error messages will be displayed, even if the first +character of +.I optstring +is not a colon. +.sp 1 +If an invalid option is seen, +.B getopts +places ? into +.I name +and, if not silent, +prints an error message and unsets +.SM +.BR OPTARG . +If +.B getopts +is silent, +the option character found is placed in +.SM +.B OPTARG +and no diagnostic message is printed. +.sp 1 +If a required argument is not found, and +.B getopts +is not silent, +a question mark (\^\fB?\fP\^) is placed in +.IR name , +.SM +.B OPTARG +is unset, and a diagnostic message is printed. +If +.B getopts +is silent, then a colon (\^\fB:\fP\^) is placed in +.I name +and +.SM +.B OPTARG +is set to the option character found. +.sp 1 +.B getopts +returns true if an option, specified or unspecified, is found. +It returns false if the end of options is encountered or an +error occurs. +.TP +\fBhash\fP [\fB\-lr\fP] [\fB\-p\fP \fIfilename\fP] [\fB\-dt\fP] [\fIname\fP] +Each time \fBhash\fP is invoked, +the full pathname of the command +.I name +is determined by searching +the directories in +.B $PATH +and remembered. Any previously-remembered pathname is discarded. +If the +.B \-p +option is supplied, no path search is performed, and +.I filename +is used as the full filename of the command. +The +.B \-r +option causes the shell to forget all +remembered locations. +The +.B \-d +option causes the shell to forget the remembered location of each \fIname\fP. +If the +.B \-t +option is supplied, the full pathname to which each \fIname\fP corresponds +is printed. If multiple \fIname\fP arguments are supplied with \fB\-t\fP, +the \fIname\fP is printed before the hashed full pathname. +The +.B \-l +option causes output to be displayed in a format that may be reused as input. +If no arguments are given, or if only \fB\-l\fP is supplied, +information about remembered commands is printed. +The return status is true unless a +.I name +is not found or an invalid option is supplied. +.TP +\fBhelp\fP [\fB\-dms\fP] [\fIpattern\fP] +Display helpful information about builtin commands. If +.I pattern +is specified, +.B help +gives detailed help on all commands matching +.IR pattern ; +otherwise help for all the builtins and shell control structures +is printed. +.RS +.PD 0 +.TP +.B \-d +Display a short description of each \fIpattern\fP +.TP +.B \-m +Display the description of each \fIpattern\fP in a manpage-like format +.TP +.B \-s +Display only a short usage synopsis for each \fIpattern\fP +.PD +.PP +The return status is 0 unless no command matches +.IR pattern . +.RE +.TP +\fBhistory [\fIn\fP] +.PD 0 +.TP +\fBhistory\fP \fB\-c\fP +.TP +\fBhistory \-d\fP \fIoffset\fP +.TP +\fBhistory\fP \fB\-anrw\fP [\fIfilename\fP] +.TP +\fBhistory\fP \fB\-p\fP \fIarg\fP [\fIarg ...\fP] +.TP +\fBhistory\fP \fB\-s\fP \fIarg\fP [\fIarg ...\fP] +.PD +With no options, display the command +history list with line numbers. Lines listed +with a +.B * +have been modified. An argument of +.I n +lists only the last +.I n +lines. +If the shell variable +.SM +.B HISTTIMEFORMAT +is set and not null, +it is used as a format string for \fIstrftime\fP(3) to display +the time stamp associated with each displayed history entry. +No intervening blank is printed between the formatted time stamp +and the history line. +If \fIfilename\fP is supplied, it is used as the +name of the history file; if not, the value of +.SM +.B HISTFILE +is used. Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-c +Clear the history list by deleting all the entries. +.TP +\fB\-d\fP \fIoffset\fP +Delete the history entry at position \fIoffset\fP. +.TP +.B \-a +Append the ``new'' history lines (history lines entered since the +beginning of the current \fBbash\fP session) to the history file. +.TP +.B \-n +Read the history lines not already read from the history +file into the current history list. These are lines +appended to the history file since the beginning of the +current \fBbash\fP session. +.TP +.B \-r +Read the contents of the history file +and append them to the current history list. +.TP +.B \-w +Write the current history list to the history file, overwriting the +history file's contents. +.TP +.B \-p +Perform history substitution on the following \fIargs\fP and display +the result on the standard output. +Does not store the results in the history list. +Each \fIarg\fP must be quoted to disable normal history expansion. +.TP +.B \-s +Store the +.I args +in the history list as a single entry. The last command in the +history list is removed before the +.I args +are added. +.PD +.PP +If the +.SM +.B HISTTIMEFORMAT +variable is set, the time stamp information +associated with each history entry is written to the history file, +marked with the history comment character. +When the history file is read, lines beginning with the history +comment character followed immediately by a digit are interpreted +as timestamps for the previous history line. +The return value is 0 unless an invalid option is encountered, an +error occurs while reading or writing the history file, an invalid +\fIoffset\fP is supplied as an argument to \fB\-d\fP, or the +history expansion supplied as an argument to \fB\-p\fP fails. +.RE +.TP +\fBjobs\fP [\fB\-lnprs\fP] [ \fIjobspec\fP ... ] +.PD 0 +.TP +\fBjobs\fP \fB\-x\fP \fIcommand\fP [ \fIargs\fP ... ] +.PD +The first form lists the active jobs. The options have the following +meanings: +.RS +.PD 0 +.TP +.B \-l +List process IDs +in addition to the normal information. +.TP +.B \-n +Display information only about jobs that have changed status since +the user was last notified of their status. +.TP +.B \-p +List only the process ID of the job's process group +leader. +.TP +.B \-r +Display only running jobs. +.TP +.B \-s +Display only stopped jobs. +.PD +.PP +If +.I jobspec +is given, output is restricted to information about that job. +The return status is 0 unless an invalid option is encountered +or an invalid +.I jobspec +is supplied. +.PP +If the +.B \-x +option is supplied, +.B jobs +replaces any +.I jobspec +found in +.I command +or +.I args +with the corresponding process group ID, and executes +.I command +passing it +.IR args , +returning its exit status. +.RE +.TP +\fBkill\fP [\fB\-s\fP \fIsigspec\fP | \fB\-n\fP \fIsignum\fP | \fB\-\fP\fIsigspec\fP] [\fIpid\fP | \fIjobspec\fP] ... +.PD 0 +.TP +\fBkill\fP \fB\-l\fP [\fIsigspec\fP | \fIexit_status\fP] +.PD +Send the signal named by +.I sigspec +or +.I signum +to the processes named by +.I pid +or +.IR jobspec . +.I sigspec +is either a case-insensitive signal name such as +.SM +.B SIGKILL +(with or without the +.SM +.B SIG +prefix) or a signal number; +.I signum +is a signal number. +If +.I sigspec +is not present, then +.SM +.B SIGTERM +is assumed. +An argument of +.B \-l +lists the signal names. +If any arguments are supplied when +.B \-l +is given, the names of the signals corresponding to the arguments are +listed, and the return status is 0. +The \fIexit_status\fP argument to +.B \-l +is a number specifying either a signal number or the exit status of +a process terminated by a signal. +.B kill +returns true if at least one signal was successfully sent, or false +if an error occurs or an invalid option is encountered. +.TP +\fBlet\fP \fIarg\fP [\fIarg\fP ...] +Each +.I arg +is an arithmetic expression to be evaluated (see +.SM +.B "ARITHMETIC EVALUATION" +above). +If the last +.I arg +evaluates to 0, +.B let +returns 1; 0 is returned otherwise. +.TP +\fBlocal\fP [\fIoption\fP] [\fIname\fP[=\fIvalue\fP] ...] +For each argument, a local variable named +.I name +is created, and assigned +.IR value . +The \fIoption\fP can be any of the options accepted by \fBdeclare\fP. +When +.B local +is used within a function, it causes the variable +.I name +to have a visible scope restricted to that function and its children. +With no operands, +.B local +writes a list of local variables to the standard output. It is +an error to use +.B local +when not within a function. The return status is 0 unless +.B local +is used outside a function, an invalid +.I name +is supplied, or +\fIname\fP is a readonly variable. +.TP +.B logout +Exit a login shell. +.TP +\fBmapfile\fP [\fB\-n\fP \fIcount\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-s\fP \fIcount\fP] [\fB\-t\fP] [\fB\-u\fP \fIfd\fP] [\fB\-C\fP \fIcallback\fP] [\fB\-c\fP \fIquantum\fP] [\fIarray\fP] +.PD 0 +.TP +\fBreadarray\fP [\fB\-n\fP \fIcount\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-s\fP \fIcount\fP] [\fB\-t\fP] [\fB\-u\fP \fIfd\fP] [\fB\-C\fP \fIcallback\fP] [\fB\-c\fP \fIquantum\fP] [\fIarray\fP] +.PD +Read lines from the standard input into the indexed array variable +.IR array , +or from file descriptor +.IR fd +if the +.B \-u +option is supplied. +The variable +.SM +.B MAPFILE +is the default \fIarray\fP. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Copy at most +.I count +lines. If \fIcount\fP is 0, all lines are copied. +.TP +.B \-O +Begin assigning to +.I array +at index +.IR origin . +The default index is 0. +.TP +.B \-s +Discard the first \fIcount\fP lines read. +.TP +.B \-t +Remove a trailing newline from each line read. +.TP +.B \-u +Read lines from file descriptor \fIfd\fP instead of the standard input. +.TP +.B \-C +Evaluate +.I callback +each time \fIquantum\fP lines are read. The \fB\-c\fP option specifies +.IR quantum . +.TP +.B \-c +Specify the number of lines read between each call to +.IR callback . +.PD +.PP +If +.B \-C +is specified without +.BR \-c , +the default quantum is 5000. +When \fIcallback\fP is evaluated, it is supplied the index of the next +array element to be assigned and the line to be assigned to that element +as additional arguments. +\fIcallback\fP is evaluated after the line is read but before the +array element is assigned. +.PP +If not supplied with an explicit origin, \fBmapfile\fP will clear \fIarray\fP +before assigning to it. +.PP +\fBmapfile\fP returns successfully unless an invalid option or option +argument is supplied, \fIarray\fP is invalid or unassignable, or if +\fIarray\fP is not an indexed array. +.RE +.TP +\fBpopd\fP [\-\fBn\fP] [+\fIn\fP] [\-\fIn\fP] +Removes entries from the directory stack. With no arguments, +removes the top directory from the stack, and performs a +.B cd +to the new top directory. +Arguments, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Suppresses the normal change of directory when removing directories +from the stack, so that only the stack is manipulated. +.TP +\fB+\fP\fIn\fP +Removes the \fIn\fPth entry counting from the left of the list +shown by +.BR dirs , +starting with zero. For example: +.if n ``popd +0'' +.if t \f(CWpopd +0\fP +removes the first directory, +.if n ``popd +1'' +.if t \f(CWpopd +1\fP +the second. +.TP +\fB\-\fP\fIn\fP +Removes the \fIn\fPth entry counting from the right of the list +shown by +.BR dirs , +starting with zero. For example: +.if n ``popd -0'' +.if t \f(CWpopd -0\fP +removes the last directory, +.if n ``popd -1'' +.if t \f(CWpopd -1\fP +the next to last. +.PD +.PP +If the +.B popd +command is successful, a +.B dirs +is performed as well, and the return status is 0. +.B popd +returns false if an invalid option is encountered, the directory stack +is empty, a non-existent directory stack entry is specified, or the +directory change fails. +.RE +.TP +\fBprintf\fP [\fB\-v\fP \fIvar\fP] \fIformat\fP [\fIarguments\fP] +Write the formatted \fIarguments\fP to the standard output under the +control of the \fIformat\fP. +The \fB\-v\fP option causes the output to be assigned to the variable +\fIvar\fP rather than being printed to the standard output. +.sp 1 +The \fIformat\fP is a character string which contains three types of objects: +plain characters, which are simply copied to standard output, character +escape sequences, which are converted and copied to the standard output, and +format specifications, each of which causes printing of the next successive +\fIargument\fP. +In addition to the standard \fIprintf\fP(1) format specifications, +\fBprintf\fP interprets the following extensions: +.RS +.PD 0 +.TP +.B %b +causes +\fBprintf\fP to expand backslash escape sequences in the corresponding +\fIargument\fP (except that \fB\ec\fP terminates output, backslashes in +\fB\e\(aq\fP, \fB\e"\fP, and \fB\e?\fP are not removed, and octal escapes +beginning with \fB\e0\fP may contain up to four digits). +.TP +.B %q +causes \fBprintf\fP to output the corresponding +\fIargument\fP in a format that can be reused as shell input. +.TP +.B %(\fIdatefmt\fP)T +causes \fBprintf\fP to output the date-time string resulting from using +\fIdatefmt\fP as a format string for \fIstrftime\fP(3). +The corresponding \fIargument\fP is an integer representing the number of +seconds since the epoch. +Two special argument values may be used: -1 represents the current +time, and -2 represents the time the shell was invoked. +If no argument is specified, conversion behaves as if -1 had been given. +This is an exception to the usual \fBprintf\fP behavior. +.PD +.PP +Arguments to non-string format specifiers are treated as C constants, +except that a leading plus or minus sign is allowed, and if the leading +character is a single or double quote, the value is the ASCII value of +the following character. +.PP +The \fIformat\fP is reused as necessary to consume all of the \fIarguments\fP. +If the \fIformat\fP requires more \fIarguments\fP than are supplied, the +extra format specifications behave as if a zero value or null string, as +appropriate, had been supplied. +The return value is zero on success, non-zero on failure. +.RE +.TP +\fBpushd\fP [\fB\-n\fP] [+\fIn\fP] [\-\fIn\fP] +.PD 0 +.TP +\fBpushd\fP [\fB\-n\fP] [\fIdir\fP] +.PD +Adds a directory to the top of the directory stack, or rotates +the stack, making the new top of the stack the current working +directory. With no arguments, exchanges the top two directories +and returns 0, unless the directory stack is empty. +Arguments, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Suppresses the normal change of directory when adding directories +to the stack, so that only the stack is manipulated. +.TP +\fB+\fP\fIn\fP +Rotates the stack so that the \fIn\fPth directory +(counting from the left of the list shown by +.BR dirs , +starting with zero) +is at the top. +.TP +\fB\-\fP\fIn\fP +Rotates the stack so that the \fIn\fPth directory +(counting from the right of the list shown by +.BR dirs , +starting with zero) is at the top. +.TP +.I dir +Adds +.I dir +to the directory stack at the top, making it the +new current working directory as if it had been supplied as the argument +to the \fBcd\fP builtin. +.PD +.PP +If the +.B pushd +command is successful, a +.B dirs +is performed as well. +If the first form is used, +.B pushd +returns 0 unless the cd to +.I dir +fails. With the second form, +.B pushd +returns 0 unless the directory stack is empty, +a non-existent directory stack element is specified, +or the directory change to the specified new current directory +fails. +.RE +.TP +\fBpwd\fP [\fB\-LP\fP] +Print the absolute pathname of the current working directory. +The pathname printed contains no symbolic links if the +.B \-P +option is supplied or the +.B \-o physical +option to the +.B set +builtin command is enabled. +If the +.B \-L +option is used, the pathname printed may contain symbolic links. +The return status is 0 unless an error occurs while +reading the name of the current directory or an +invalid option is supplied. +.TP +\fBread\fP [\fB\-ers\fP] [\fB\-a\fP \fIaname\fP] [\fB\-d\fP \fIdelim\fP] [\fB\-i\fP \fItext\fP] [\fB\-n\fP \fInchars\fP] [\fB\-N\fP \fInchars\fP] [\fB\-p\fP \fIprompt\fP] [\fB\-t\fP \fItimeout\fP] [\fB\-u\fP \fIfd\fP] [\fIname\fP ...] +One line is read from the standard input, or from the file descriptor +\fIfd\fP supplied as an argument to the \fB\-u\fP option, and the first word +is assigned to the first +.IR name , +the second word to the second +.IR name , +and so on, with leftover words and their intervening separators assigned +to the last +.IR name . +If there are fewer words read from the input stream than names, +the remaining names are assigned empty values. +The characters in +.SM +.B IFS +are used to split the line into words using the same rules the shell +uses for expansion (described above under \fBWord Splitting\fP). +The backslash character (\fB\e\fP) may be used to remove any special +meaning for the next character read and for line continuation. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-a \fIaname\fP +The words are assigned to sequential indices +of the array variable +.IR aname , +starting at 0. +.I aname +is unset before any new values are assigned. +Other \fIname\fP arguments are ignored. +.TP +.B \-d \fIdelim\fP +The first character of \fIdelim\fP is used to terminate the input line, +rather than newline. +.TP +.B \-e +If the standard input +is coming from a terminal, +.B readline +(see +.SM +.B READLINE +above) is used to obtain the line. +Readline uses the current (or default, if line editing was not previously +active) editing settings. +.TP +.B \-i \fItext\fP +If +.B readline +is being used to read the line, \fItext\fP is placed into the editing +buffer before editing begins. +.TP +.B \-n \fInchars\fP +\fBread\fP returns after reading \fInchars\fP characters rather than +waiting for a complete line of input, but honor a delimiter if fewer +than \fInchars\fP characters are read before the delimiter. +.TP +.B \-N \fInchars\fP +\fBread\fP returns after reading exactly \fInchars\fP characters rather +than waiting for a complete line of input, unless EOF is encountered or +\fBread\fP times out. +Delimiter characters encountered in the input are +not treated specially and do not cause \fBread\fP to return until +\fInchars\fP characters are read. +.TP +.B \-p \fIprompt\fP +Display \fIprompt\fP on standard error, without a +trailing newline, before attempting to read any input. The prompt +is displayed only if input is coming from a terminal. +.TP +.B \-r +Backslash does not act as an escape character. +The backslash is considered to be part of the line. +In particular, a backslash-newline pair may not be used as a line +continuation. +.TP +.B \-s +Silent mode. If input is coming from a terminal, characters are +not echoed. +.TP +.B \-t \fItimeout\fP +Cause \fBread\fP to time out and return failure if a complete line of +input (or a specified number of characters) +is not read within \fItimeout\fP seconds. +\fItimeout\fP may be a decimal number with a fractional portion following +the decimal point. +This option is only effective if \fBread\fP is reading input from a +terminal, pipe, or other special file; it has no effect when reading +from regular files. +If \fBread\fP times out, \fBread\fP saves any partial input read into +the specified variable \fIname\fP. +If \fItimeout\fP is 0, \fBread\fP returns immediately, without trying to +read any data. The exit status is 0 if input is available on +the specified file descriptor, non-zero otherwise. +The exit status is greater than 128 if the timeout is exceeded. +.TP +.B \-u \fIfd\fP +Read input from file descriptor \fIfd\fP. +.PD +.PP +If no +.I names +are supplied, the line read is assigned to the variable +.SM +.BR REPLY . +The return code is zero, unless end-of-file is encountered, \fBread\fP +times out (in which case the return code is greater than 128), +a variable assignment error (such as assigning to a readonly variable) occurs, +or an invalid file descriptor is supplied as the argument to \fB\-u\fP. +.RE +.TP +\fBreadonly\fP [\fB\-aAf\fP] [\fB\-p\fP] [\fIname\fP[=\fIword\fP] ...] +.PD +The given +\fInames\fP are marked readonly; the values of these +.I names +may not be changed by subsequent assignment. +If the +.B \-f +option is supplied, the functions corresponding to the +\fInames\fP are so +marked. +The +.B \-a +option restricts the variables to indexed arrays; the +.B \-A +option restricts the variables to associative arrays. +If both options are supplied, +.B \-A +takes precedence. +If no +.I name +arguments are given, or if the +.B \-p +option is supplied, a list of all readonly names is printed. +The other options may be used to restrict the output to a subset of +the set of readonly names. +The +.B \-p +option causes output to be displayed in a format that +may be reused as input. +If a variable name is followed by =\fIword\fP, the value of +the variable is set to \fIword\fP. +The return status is 0 unless an invalid option is encountered, +one of the +.I names +is not a valid shell variable name, or +.B \-f +is supplied with a +.I name +that is not a function. +.TP +\fBreturn\fP [\fIn\fP] +Causes a function to stop executing and return the value specified by +.I n +to its caller. +If +.I n +is omitted, the return status is that of the last command +executed in the function body. If +.B return +is used outside a function, +but during execution of a script by the +.B . +(\fBsource\fP) command, it causes the shell to stop executing +that script and return either +.I n +or the exit status of the last command executed within the +script as the exit status of the script. +If \fIn\fP is supplied, the return value is its least significant +8 bits. +The return status is non-zero if +.B return +is supplied a non-numeric argument, or +is used outside a +function and not during execution of a script by \fB.\fP\^ or \fBsource\fP. +Any command associated with the \fBRETURN\fP trap is executed +before execution resumes after the function or script. +.TP +\fBset\fP [\fB\-\-abefhkmnptuvxBCEHPT\fP] [\fB\-o\fP \fIoption\-name\fP] [\fIarg\fP ...] +.PD 0 +.TP +\fBset\fP [\fB+abefhkmnptuvxBCEHPT\fP] [\fB+o\fP \fIoption\-name\fP] [\fIarg\fP ...] +.PD +Without options, the name and value of each shell variable are displayed +in a format that can be reused as input +for setting or resetting the currently-set variables. +Read-only variables cannot be reset. +In \fIposix\fP mode, only shell variables are listed. +The output is sorted according to the current locale. +When options are specified, they set or unset shell attributes. +Any arguments remaining after option processing are treated +as values for the positional parameters and are assigned, in order, to +.BR $1 , +.BR $2 , +.B ... +.BR $\fIn\fP . +Options, if specified, have the following meanings: +.RS +.PD 0 +.TP 8 +.B \-a +Automatically mark variables and functions which are modified or +created for export to the environment of subsequent commands. +.TP 8 +.B \-b +Report the status of terminated background jobs +immediately, rather than before the next primary prompt. This is +effective only when job control is enabled. +.TP 8 +.B \-e +Exit immediately if a +\fIpipeline\fP (which may consist of a single \fIsimple command\fP), +a \fIlist\fP, +or a \fIcompound command\fP +(see +.SM +.B SHELL GRAMMAR +above), exits with a non-zero status. +The shell does not exit if the +command that fails is part of the command list immediately following a +.B while +or +.B until +keyword, +part of the test following the +.B if +or +.B elif +reserved words, part of any command executed in a +.B && +or +.B || +list except the command following the final \fB&&\fP or \fB||\fP, +any command in a pipeline but the last, +or if the command's return value is +being inverted with +.BR ! . +If a compound command other than a subshell +returns a non-zero status because a command failed +while \fB\-e\fP was being ignored, the shell does not exit. +A trap on \fBERR\fP, if set, is executed before the shell exits. +This option applies to the shell environment and each subshell environment +separately (see +.SM +.B "COMMAND EXECUTION ENVIRONMENT" +above), and may cause +subshells to exit before executing all the commands in the subshell. +.if t .sp 0.5 +.if n .sp 1 +If a compound command or shell function executes in a context +where \fB\-e\fP is being ignored, +none of the commands executed within the compound command or function body +will be affected by the \fB\-e\fP setting, even if \fB\-e\fP is set +and a command returns a failure status. +If a compound command or shell function sets \fB\-e\fP while executing in +a context where \fB\-e\fP is ignored, that setting will not have any +effect until the compound command or the command containing the function +call completes. +.TP 8 +.B \-f +Disable pathname expansion. +.TP 8 +.B \-h +Remember the location of commands as they are looked up for execution. +This is enabled by default. +.TP 8 +.B \-k +All arguments in the form of assignment statements +are placed in the environment for a command, not just +those that precede the command name. +.TP 8 +.B \-m +Monitor mode. Job control is enabled. This option is on +by default for interactive shells on systems that support +it (see +.SM +.B JOB CONTROL +above). +All processes run in a separate process group. +When a background job completes, the shell prints a line +containing its exit status. +.TP 8 +.B \-n +Read commands but do not execute them. This may be used to +check a shell script for syntax errors. This is ignored by +interactive shells. +.TP 8 +.B \-o \fIoption\-name\fP +The \fIoption\-name\fP can be one of the following: +.RS +.TP 8 +.B allexport +Same as +.BR \-a . +.TP 8 +.B braceexpand +Same as +.BR \-B . +.TP 8 +.B emacs +Use an emacs-style command line editing interface. This is enabled +by default when the shell is interactive, unless the shell is started +with the +.B \-\-noediting +option. +This also affects the editing interface used for \fBread \-e\fP. +.TP 8 +.B errexit +Same as +.BR \-e . +.TP 8 +.B errtrace +Same as +.BR \-E . +.TP 8 +.B functrace +Same as +.BR \-T . +.TP 8 +.B hashall +Same as +.BR \-h . +.TP 8 +.B histexpand +Same as +.BR \-H . +.TP 8 +.B history +Enable command history, as described above under +.SM +.BR HISTORY . +This option is on by default in interactive shells. +.TP 8 +.B ignoreeof +The effect is as if the shell command +.if t \f(CWIGNOREEOF=10\fP +.if n ``IGNOREEOF=10'' +had been executed +(see +.B Shell Variables +above). +.TP 8 +.B keyword +Same as +.BR \-k . +.TP 8 +.B monitor +Same as +.BR \-m . +.TP 8 +.B noclobber +Same as +.BR \-C . +.TP 8 +.B noexec +Same as +.BR \-n . +.TP 8 +.B noglob +Same as +.BR \-f . +.TP 8 +.B nolog +Currently ignored. +.TP 8 +.B notify +Same as +.BR \-b . +.TP 8 +.B nounset +Same as +.BR \-u . +.TP 8 +.B onecmd +Same as +.BR \-t . +.TP 8 +.B physical +Same as +.BR \-P . +.TP 8 +.B pipefail +If set, the return value of a pipeline is the value of the last +(rightmost) command to exit with a non-zero status, or zero if all +commands in the pipeline exit successfully. +This option is disabled by default. +.TP 8 +.B posix +Change the behavior of +.B bash +where the default operation differs +from the POSIX standard to match the standard (\fIposix mode\fP). +See +.SM +.B "SEE ALSO" +below for a reference to a document that details how posix mode affects +bash's behavior. +.TP 8 +.B privileged +Same as +.BR \-p . +.TP 8 +.B verbose +Same as +.BR \-v . +.TP 8 +.B vi +Use a vi-style command line editing interface. +This also affects the editing interface used for \fBread \-e\fP. +.TP 8 +.B xtrace +Same as +.BR \-x . +.sp .5 +.PP +If +.B \-o +is supplied with no \fIoption\-name\fP, the values of the current options are +printed. +If +.B +o +is supplied with no \fIoption\-name\fP, a series of +.B set +commands to recreate the current option settings is displayed on +the standard output. +.RE +.TP 8 +.B \-p +Turn on +.I privileged +mode. In this mode, the +.SM +.B $ENV +and +.SM +.B $BASH_ENV +files are not processed, shell functions are not inherited from the +environment, and the +.SM +.BR SHELLOPTS , +.SM +.BR BASHOPTS , +.SM +.BR CDPATH , +and +.SM +.B GLOBIGNORE +variables, if they appear in the environment, are ignored. +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the \fB\-p\fP option is not supplied, these actions +are taken and the effective user id is set to the real user id. +If the \fB\-p\fP option is supplied at startup, the effective user id is +not reset. +Turning this option off causes the effective user +and group ids to be set to the real user and group ids. +.TP 8 +.B \-t +Exit after reading and executing one command. +.TP 8 +.B \-u +Treat unset variables and parameters other than the special +parameters "@" and "*" as an error when performing +parameter expansion. If expansion is attempted on an +unset variable or parameter, the shell prints an error message, and, +if not interactive, exits with a non-zero status. +.TP 8 +.B \-v +Print shell input lines as they are read. +.TP 8 +.B \-x +After expanding each \fIsimple command\fP, +\fBfor\fP command, \fBcase\fP command, \fBselect\fP command, or +arithmetic \fBfor\fP command, display the expanded value of +.SM +.BR PS4 , +followed by the command and its expanded arguments +or associated word list. +.TP 8 +.B \-B +The shell performs brace expansion (see +.B Brace Expansion +above). This is on by default. +.TP 8 +.B \-C +If set, +.B bash +does not overwrite an existing file with the +.BR > , +.BR >& , +and +.B <> +redirection operators. This may be overridden when +creating output files by using the redirection operator +.B >| +instead of +.BR > . +.TP 8 +.B \-E +If set, any trap on \fBERR\fP is inherited by shell functions, command +substitutions, and commands executed in a subshell environment. +The \fBERR\fP trap is normally not inherited in such cases. +.TP 8 +.B \-H +Enable +.B ! +style history substitution. This option is on by +default when the shell is interactive. +.TP 8 +.B \-P +If set, the shell does not resolve symbolic links when executing +commands such as +.B cd +that change the current working directory. It uses the +physical directory structure instead. By default, +.B bash +follows the logical chain of directories when performing commands +which change the current directory. +.TP 8 +.B \-T +If set, any traps on \fBDEBUG\fP and \fBRETURN\fP are inherited by shell +functions, command substitutions, and commands executed in a +subshell environment. +The \fBDEBUG\fP and \fBRETURN\fP traps are normally not inherited +in such cases. +.TP 8 +.B \-\- +If no arguments follow this option, then the positional parameters are +unset. Otherwise, the positional parameters are set to the +\fIarg\fPs, even if some of them begin with a +.BR \- . +.TP 8 +.B \- +Signal the end of options, cause all remaining \fIarg\fPs to be +assigned to the positional parameters. The +.B \-x +and +.B \-v +options are turned off. +If there are no \fIarg\fPs, +the positional parameters remain unchanged. +.PD +.PP +The options are off by default unless otherwise noted. +Using + rather than \- causes these options to be turned off. +The options can also be specified as arguments to an invocation of +the shell. +The current set of options may be found in +.BR $\- . +The return status is always true unless an invalid option is encountered. +.RE +.TP +\fBshift\fP [\fIn\fP] +The positional parameters from \fIn\fP+1 ... are renamed to +.B $1 +.B .... +Parameters represented by the numbers \fB$#\fP +down to \fB$#\fP\-\fIn\fP+1 are unset. +.I n +must be a non-negative number less than or equal to \fB$#\fP. +If +.I n +is 0, no parameters are changed. +If +.I n +is not given, it is assumed to be 1. +If +.I n +is greater than \fB$#\fP, the positional parameters are not changed. +The return status is greater than zero if +.I n +is greater than +.B $# +or less than zero; otherwise 0. +.TP +\fBshopt\fP [\fB\-pqsu\fP] [\fB\-o\fP] [\fIoptname\fP ...] +Toggle the values of settings controlling optional shell behavior. +The settings can be either those listed below, or, if the +.B \-o +option is used, those available with the +.B \-o +option to the \fBset\fP builtin command. +With no options, or with the +.B \-p +option, a list of all settable options is displayed, with +an indication of whether or not each is set. +The \fB\-p\fP option causes output to be displayed in a form that +may be reused as input. +Other options have the following meanings: +.RS +.PD 0 +.TP +.B \-s +Enable (set) each \fIoptname\fP. +.TP +.B \-u +Disable (unset) each \fIoptname\fP. +.TP +.B \-q +Suppresses normal output (quiet mode); the return status indicates +whether the \fIoptname\fP is set or unset. +If multiple \fIoptname\fP arguments are given with +.BR \-q , +the return status is zero if all \fIoptnames\fP are enabled; non-zero +otherwise. +.TP +.B \-o +Restricts the values of \fIoptname\fP to be those defined for the +.B \-o +option to the +.B set +builtin. +.PD +.PP +If either +.B \-s +or +.B \-u +is used with no \fIoptname\fP arguments, +.B shopt +shows only those options which are set or unset, respectively. +Unless otherwise noted, the \fBshopt\fP options are disabled (unset) +by default. +.PP +The return status when listing options is zero if all \fIoptnames\fP +are enabled, non-zero otherwise. When setting or unsetting options, +the return status is zero unless an \fIoptname\fP is not a valid shell +option. +.PP +The list of \fBshopt\fP options is: +.if t .sp .5v +.if n .sp 1v +.PD 0 +.TP 8 +.B autocd +If set, a command name that is the name of a directory is executed as if +it were the argument to the \fBcd\fP command. +This option is only used by interactive shells. +.TP 8 +.B cdable_vars +If set, an argument to the +.B cd +builtin command that +is not a directory is assumed to be the name of a variable whose +value is the directory to change to. +.TP 8 +.B cdspell +If set, minor errors in the spelling of a directory component in a +.B cd +command will be corrected. +The errors checked for are transposed characters, +a missing character, and one character too many. +If a correction is found, the corrected filename is printed, +and the command proceeds. +This option is only used by interactive shells. +.TP 8 +.B checkhash +If set, \fBbash\fP checks that a command found in the hash +table exists before trying to execute it. If a hashed command no +longer exists, a normal path search is performed. +.TP 8 +.B checkjobs +If set, \fBbash\fP lists the status of any stopped and running jobs before +exiting an interactive shell. If any jobs are running, this causes +the exit to be deferred until a second exit is attempted without an +intervening command (see +.SM +.B "JOB CONTROL" +above). The shell always +postpones exiting if any jobs are stopped. +.TP 8 +.B checkwinsize +If set, \fBbash\fP checks the window size after each command +and, if necessary, updates the values of +.SM +.B LINES +and +.SM +.BR COLUMNS . +.TP 8 +.B cmdhist +If set, +.B bash +attempts to save all lines of a multiple-line +command in the same history entry. This allows +easy re-editing of multi-line commands. +.TP 8 +.B compat31 +If set, +.B bash +changes its behavior to that of version 3.1 with respect to quoted +arguments to the \fB[[\fP conditional command's \fB=~\fP operator +and locale-specific string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators. +Bash versions prior to bash-4.1 use ASCII collation and +.IR strcmp (3); +bash-4.1 and later use the current locale's collation sequence and +.IR strcoll (3). +.TP 8 +.B compat32 +If set, +.B bash +changes its behavior to that of version 3.2 with respect to +locale-specific string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators (see previous item). +.TP 8 +.B compat40 +If set, +.B bash +changes its behavior to that of version 4.0 with respect to locale-specific +string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators (see description of +\fBcompat31\fP) +and the effect of interrupting a command list. +Bash versions 4.0 and later interrupt the list as if the shell received the +interrupt; previous versions continue with the next command in the list. +.TP 8 +.B compat41 +If set, +.BR bash , +when in \fIposix\fP mode, treats a single quote in a double-quoted +parameter expansion as a special character. The single quotes must match +(an even number) and the characters between the single quotes are considered +quoted. This is the behavior of posix mode through version 4.1. +The default bash behavior remains as in previous versions. +.TP 8 +.B compat42 +If set, +.B bash +does not process the replacement string in the pattern substitution word +expansion using quote removal. +.TP 8 +.B complete_fullquote +If set, +.B bash +quotes all shell metacharacters in filenames and directory names when +performing completion. +If not set, +.B bash +removes metacharacters such as the dollar sign from the set of +characters that will be quoted in completed filenames +when these metacharacters appear in shell variable references in words to be +completed. +This means that dollar signs in variable names that expand to directories +will not be quoted; +however, any dollar signs appearing in filenames will not be quoted, either. +This is active only when bash is using backslashes to quote completed +filenames. +This variable is set by default, which is the default bash behavior in +versions through 4.2. +.TP 8 +.B direxpand +If set, +.B bash +replaces directory names with the results of word expansion when performing +filename completion. This changes the contents of the readline editing +buffer. +If not set, +.B bash +attempts to preserve what the user typed. +.TP 8 +.B dirspell +If set, +.B bash +attempts spelling correction on directory names during word completion +if the directory name initially supplied does not exist. +.TP 8 +.B dotglob +If set, +.B bash +includes filenames beginning with a `.' in the results of pathname +expansion. +.TP 8 +.B execfail +If set, a non-interactive shell will not exit if +it cannot execute the file specified as an argument to the +.B exec +builtin command. An interactive shell does not exit if +.B exec +fails. +.TP 8 +.B expand_aliases +If set, aliases are expanded as described above under +.SM +.BR ALIASES . +This option is enabled by default for interactive shells. +.TP 8 +.B extdebug +If set, behavior intended for use by debuggers is enabled: +.RS +.TP +.B 1. +The \fB\-F\fP option to the \fBdeclare\fP builtin displays the source +file name and line number corresponding to each function name supplied +as an argument. +.TP +.B 2. +If the command run by the \fBDEBUG\fP trap returns a non-zero value, the +next command is skipped and not executed. +.TP +.B 3. +If the command run by the \fBDEBUG\fP trap returns a value of 2, and the +shell is executing in a subroutine (a shell function or a shell script +executed by the \fB.\fP or \fBsource\fP builtins), a call to +\fBreturn\fP is simulated. +.TP +.B 4. +.SM +.B BASH_ARGC +and +.SM +.B BASH_ARGV +are updated as described in their descriptions above. +.TP +.B 5. +Function tracing is enabled: command substitution, shell functions, and +subshells invoked with \fB(\fP \fIcommand\fP \fB)\fP inherit the +\fBDEBUG\fP and \fBRETURN\fP traps. +.TP +.B 6. +Error tracing is enabled: command substitution, shell functions, and +subshells invoked with \fB(\fP \fIcommand\fP \fB)\fP inherit the +\fBERR\fP trap. +.RE +.TP 8 +.B extglob +If set, the extended pattern matching features described above under +\fBPathname Expansion\fP are enabled. +.TP 8 +.B extquote +If set, \fB$\fP\(aq\fIstring\fP\(aq and \fB$\fP"\fIstring\fP" quoting is +performed within \fB${\fP\fIparameter\fP\fB}\fP expansions +enclosed in double quotes. This option is enabled by default. +.TP 8 +.B failglob +If set, patterns which fail to match filenames during pathname expansion +result in an expansion error. +.TP 8 +.B force_fignore +If set, the suffixes specified by the +.SM +.B FIGNORE +shell variable +cause words to be ignored when performing word completion even if +the ignored words are the only possible completions. +See +.SM +\fBSHELL VARIABLES\fP +above for a description of +.SM +.BR FIGNORE . +This option is enabled by default. +.TP 8 +.B globasciiranges +If set, range expressions used in pattern matching bracket expressions (see +.SM +.B Pattern Matching +above) behave as if in the traditional C locale when performing +comparisons. That is, the current locale's collating sequence +is not taken into account, so +.B b +will not collate between +.B A +and +.BR B , +and upper-case and lower-case ASCII characters will collate together. +.TP 8 +.B globstar +If set, the pattern \fB**\fP used in a pathname expansion context will +match all files and zero or more directories and subdirectories. +If the pattern is followed by a \fB/\fP, only directories and +subdirectories match. +.TP 8 +.B gnu_errfmt +If set, shell error messages are written in the standard GNU error +message format. +.TP 8 +.B histappend +If set, the history list is appended to the file named by the value +of the +.SM +.B HISTFILE +variable when the shell exits, rather than overwriting the file. +.TP 8 +.B histreedit +If set, and +.B readline +is being used, a user is given the opportunity to re-edit a +failed history substitution. +.TP 8 +.B histverify +If set, and +.B readline +is being used, the results of history substitution are not immediately +passed to the shell parser. Instead, the resulting line is loaded into +the \fBreadline\fP editing buffer, allowing further modification. +.TP 8 +.B hostcomplete +If set, and +.B readline +is being used, \fBbash\fP will attempt to perform hostname completion when a +word containing a \fB@\fP is being completed (see +.B Completing +under +.SM +.B READLINE +above). +This is enabled by default. +.TP 8 +.B huponexit +If set, \fBbash\fP will send +.SM +.B SIGHUP +to all jobs when an interactive login shell exits. +.TP 8 +.B interactive_comments +If set, allow a word beginning with +.B # +to cause that word and all remaining characters on that +line to be ignored in an interactive shell (see +.SM +.B COMMENTS +above). This option is enabled by default. +.TP 8 +.B lastpipe +If set, and job control is not active, the shell runs the last command of +a pipeline not executed in the background in the current shell environment. +.TP 8 +.B lithist +If set, and the +.B cmdhist +option is enabled, multi-line commands are saved to the history with +embedded newlines rather than using semicolon separators where possible. +.TP 8 +.B login_shell +The shell sets this option if it is started as a login shell (see +.SM +.B "INVOCATION" +above). +The value may not be changed. +.TP 8 +.B mailwarn +If set, and a file that \fBbash\fP is checking for mail has been +accessed since the last time it was checked, the message ``The mail in +\fImailfile\fP has been read'' is displayed. +.TP 8 +.B no_empty_cmd_completion +If set, and +.B readline +is being used, +.B bash +will not attempt to search the +.SM +.B PATH +for possible completions when +completion is attempted on an empty line. +.TP 8 +.B nocaseglob +If set, +.B bash +matches filenames in a case\-insensitive fashion when performing pathname +expansion (see +.B Pathname Expansion +above). +.TP 8 +.B nocasematch +If set, +.B bash +matches patterns in a case\-insensitive fashion when performing matching +while executing \fBcase\fP or \fB[[\fP conditional commands. +.TP 8 +.B nullglob +If set, +.B bash +allows patterns which match no +files (see +.B Pathname Expansion +above) +to expand to a null string, rather than themselves. +.TP 8 +.B progcomp +If set, the programmable completion facilities (see +\fBProgrammable Completion\fP above) are enabled. +This option is enabled by default. +.TP 8 +.B promptvars +If set, prompt strings undergo +parameter expansion, command substitution, arithmetic +expansion, and quote removal after being expanded as described in +.SM +.B PROMPTING +above. This option is enabled by default. +.TP 8 +.B restricted_shell +The shell sets this option if it is started in restricted mode (see +.SM +.B "RESTRICTED SHELL" +below). +The value may not be changed. +This is not reset when the startup files are executed, allowing +the startup files to discover whether or not a shell is restricted. +.TP 8 +.B shift_verbose +If set, the +.B shift +builtin prints an error message when the shift count exceeds the +number of positional parameters. +.TP 8 +.B sourcepath +If set, the +\fBsource\fP (\fB.\fP) builtin uses the value of +.SM +.B PATH +to find the directory containing the file supplied as an argument. +This option is enabled by default. +.TP 8 +.B xpg_echo +If set, the \fBecho\fP builtin expands backslash-escape sequences +by default. +.RE +.PD +.TP +\fBsuspend\fP [\fB\-f\fP] +Suspend the execution of this shell until it receives a +.SM +.B SIGCONT +signal. A login shell cannot be suspended; the +.B \-f +option can be used to override this and force the suspension. +The return status is 0 unless the shell is a login shell and +.B \-f +is not supplied, or if job control is not enabled. +.TP +\fBtest\fP \fIexpr\fP +.PD 0 +.TP +\fB[\fP \fIexpr\fP \fB]\fP +Return a status of 0 (true) or 1 (false) depending on +the evaluation of the conditional expression +.IR expr . +Each operator and operand must be a separate argument. +Expressions are composed of the primaries described above under +.SM +.BR "CONDITIONAL EXPRESSIONS" . +\fBtest\fP does not accept any options, nor does it accept and ignore +an argument of \fB\-\-\fP as signifying the end of options. +.if t .sp 0.5 +.if n .sp 1 +Expressions may be combined using the following operators, listed +in decreasing order of precedence. +The evaluation depends on the number of arguments; see below. +Operator precedence is used when there are five or more arguments. +.RS +.PD 0 +.TP +.B ! \fIexpr\fP +True if +.I expr +is false. +.TP +.B ( \fIexpr\fP ) +Returns the value of \fIexpr\fP. +This may be used to override the normal precedence of operators. +.TP +\fIexpr1\fP \-\fBa\fP \fIexpr2\fP +True if both +.I expr1 +and +.I expr2 +are true. +.TP +\fIexpr1\fP \-\fBo\fP \fIexpr2\fP +True if either +.I expr1 +or +.I expr2 +is true. +.PD +.PP +\fBtest\fP and \fB[\fP evaluate conditional +expressions using a set of rules based on the number of arguments. +.if t .sp 0.5 +.if n .sp 1 +.PD 0 +.TP +0 arguments +The expression is false. +.TP +1 argument +The expression is true if and only if the argument is not null. +.TP +2 arguments +If the first argument is \fB!\fP, the expression is true if and +only if the second argument is null. +If the first argument is one of the unary conditional operators listed above +under +.SM +.BR "CONDITIONAL EXPRESSIONS" , +the expression is true if the unary test is true. +If the first argument is not a valid unary conditional operator, the expression +is false. +.TP +3 arguments +The following conditions are applied in the order listed. +If the second argument is one of the binary conditional operators listed above +under +.SM +.BR "CONDITIONAL EXPRESSIONS" , +the result of the expression is the result of the binary test using +the first and third arguments as operands. +The \fB\-a\fP and \fB\-o\fP operators are considered binary operators +when there are three arguments. +If the first argument is \fB!\fP, the value is the negation of +the two-argument test using the second and third arguments. +If the first argument is exactly \fB(\fP and the third argument is +exactly \fB)\fP, the result is the one-argument test of the second +argument. +Otherwise, the expression is false. +.TP +4 arguments +If the first argument is \fB!\fP, the result is the negation of +the three-argument expression composed of the remaining arguments. +Otherwise, the expression is parsed and evaluated according to +precedence using the rules listed above. +.TP +5 or more arguments +The expression is parsed and evaluated according to precedence +using the rules listed above. +.if t .sp 0.5 +.if n .sp 1 +.LP +When used with \fBtest\fP or \fB[\fP, the \fB<\fP and \fB>\fP operators +sort lexicographically using ASCII ordering. +.RE +.PD +.TP +.B times +Print the accumulated user and system times for the shell and +for processes run from the shell. The return status is 0. +.TP +\fBtrap\fP [\fB\-lp\fP] [[\fIarg\fP] \fIsigspec\fP ...] +The command +.I arg +is to be read and executed when the shell receives +signal(s) +.IR sigspec . +If +.I arg +is absent (and there is a single \fIsigspec\fP) or +.BR \- , +each specified signal is +reset to its original disposition (the value it had +upon entrance to the shell). +If +.I arg +is the null string the signal specified by each +.I sigspec +is ignored by the shell and by the commands it invokes. +If +.I arg +is not present and +.B \-p +has been supplied, then the trap commands associated with each +.I sigspec +are displayed. +If no arguments are supplied or if only +.B \-p +is given, +.B trap +prints the list of commands associated with each signal. +The +.B \-l +option causes the shell to print a list of signal names and +their corresponding numbers. +Each +.I sigspec +is either +a signal name defined in <\fIsignal.h\fP>, or a signal number. +Signal names are case insensitive and the +.SM +.B SIG +prefix is optional. +.if t .sp 0.5 +.if n .sp 1 +If a +.I sigspec +is +.SM +.B EXIT +(0) the command +.I arg +is executed on exit from the shell. +If a +.I sigspec +is +.SM +.BR DEBUG , +the command +.I arg +is executed before every \fIsimple command\fP, \fIfor\fP command, +\fIcase\fP command, \fIselect\fP command, every arithmetic \fIfor\fP +command, and before the first command executes in a shell function (see +.SM +.B SHELL GRAMMAR +above). +Refer to the description of the \fBextdebug\fP option to the +\fBshopt\fP builtin for details of its effect on the \fBDEBUG\fP trap. +If a +.I sigspec +is +.SM +.BR RETURN , +the command +.I arg +is executed each time a shell function or a script executed with +the \fB.\fP or \fBsource\fP builtins finishes executing. +.if t .sp 0.5 +.if n .sp 1 +If a +.I sigspec +is +.SM +.BR ERR , +the command +.I arg +is executed whenever a +a pipeline (which may consist of a single simple +command), a list, or a compound command returns a +non\-zero exit status, +subject to the following conditions. +The +.SM +.B ERR +trap is not executed if the failed +command is part of the command list immediately following a +.B while +or +.B until +keyword, +part of the test in an +.I if +statement, part of a command executed in a +.B && +or +.B || +list except the command following the final \fB&&\fP or \fB||\fP, +any command in a pipeline but the last, +or if the command's return value is +being inverted using +.BR ! . +These are the same conditions obeyed by the \fBerrexit\fP (\fB\-e\fP) option. +.if t .sp 0.5 +.if n .sp 1 +Signals ignored upon entry to the shell cannot be trapped or reset. +Trapped signals that are not being ignored are reset to their original +values in a subshell or subshell environment when one is created. +The return status is false if any +.I sigspec +is invalid; otherwise +.B trap +returns true. +.TP +\fBtype\fP [\fB\-aftpP\fP] \fIname\fP [\fIname\fP ...] +With no options, +indicate how each +.I name +would be interpreted if used as a command name. +If the +.B \-t +option is used, +.B type +prints a string which is one of +.IR alias , +.IR keyword , +.IR function , +.IR builtin , +or +.I file +if +.I name +is an alias, shell reserved word, function, builtin, or disk file, +respectively. +If the +.I name +is not found, then nothing is printed, and an exit status of false +is returned. +If the +.B \-p +option is used, +.B type +either returns the name of the disk file +that would be executed if +.I name +were specified as a command name, +or nothing if +.if t \f(CWtype -t name\fP +.if n ``type -t name'' +would not return +.IR file . +The +.B \-P +option forces a +.SM +.B PATH +search for each \fIname\fP, even if +.if t \f(CWtype -t name\fP +.if n ``type -t name'' +would not return +.IR file . +If a command is hashed, +.B \-p +and +.B \-P +print the hashed value, which is not necessarily the file that appears +first in +.SM +.BR PATH . +If the +.B \-a +option is used, +.B type +prints all of the places that contain +an executable named +.IR name . +This includes aliases and functions, +if and only if the +.B \-p +option is not also used. +The table of hashed commands is not consulted +when using +.BR \-a . +The +.B \-f +option suppresses shell function lookup, as with the \fBcommand\fP builtin. +.B type +returns true if all of the arguments are found, false if +any are not found. +.TP +\fBulimit\fP [\fB\-HSTabcdefilmnpqrstuvx\fP [\fIlimit\fP]] +Provides control over the resources available to the shell and to +processes started by it, on systems that allow such control. +The \fB\-H\fP and \fB\-S\fP options specify that the hard or soft limit is +set for the given resource. +A hard limit cannot be increased by a non-root user once it is set; +a soft limit may be increased up to the value of the hard limit. +If neither \fB\-H\fP nor \fB\-S\fP is specified, both the soft and hard +limits are set. +The value of +.I limit +can be a number in the unit specified for the resource +or one of the special values +.BR hard , +.BR soft , +or +.BR unlimited , +which stand for the current hard limit, the current soft limit, and +no limit, respectively. +If +.I limit +is omitted, the current value of the soft limit of the resource is +printed, unless the \fB\-H\fP option is given. When more than one +resource is specified, the limit name and unit are printed before the value. +Other options are interpreted as follows: +.RS +.PD 0 +.TP +.B \-a +All current limits are reported +.TP +.B \-b +The maximum socket buffer size +.TP +.B \-c +The maximum size of core files created +.TP +.B \-d +The maximum size of a process's data segment +.TP +.B \-e +The maximum scheduling priority ("nice") +.TP +.B \-f +The maximum size of files written by the shell and its children +.TP +.B \-i +The maximum number of pending signals +.TP +.B \-l +The maximum size that may be locked into memory +.TP +.B \-m +The maximum resident set size (many systems do not honor this limit) +.TP +.B \-n +The maximum number of open file descriptors (most systems do not +allow this value to be set) +.TP +.B \-p +The pipe size in 512-byte blocks (this may not be set) +.TP +.B \-q +The maximum number of bytes in POSIX message queues +.TP +.B \-r +The maximum real-time scheduling priority +.TP +.B \-s +The maximum stack size +.TP +.B \-t +The maximum amount of cpu time in seconds +.TP +.B \-u +The maximum number of processes available to a single user +.TP +.B \-v +The maximum amount of virtual memory available to the shell and, on +some systems, to its children +.TP +.B \-x +The maximum number of file locks +.TP +.B \-T +The maximum number of threads +.PD +.PP +If +.I limit +is given, and the +.B \-a +option is not used, +\fIlimit\fP is the new value of the specified resource. +If no option is given, then +.B \-f +is assumed. Values are in 1024-byte increments, except for +.BR \-t , +which is in seconds; +.BR \-p , +which is in units of 512-byte blocks; +and +.BR \-T , +.BR \-b , +.BR \-n , +and +.BR \-u , +which are unscaled values. +The return status is 0 unless an invalid option or argument is supplied, +or an error occurs while setting a new limit. +.RE +.TP +\fBumask\fP [\fB\-p\fP] [\fB\-S\fP] [\fImode\fP] +The user file-creation mask is set to +.IR mode . +If +.I mode +begins with a digit, it +is interpreted as an octal number; otherwise +it is interpreted as a symbolic mode mask similar +to that accepted by +.IR chmod (1). +If +.I mode +is omitted, the current value of the mask is printed. +The +.B \-S +option causes the mask to be printed in symbolic form; the +default output is an octal number. +If the +.B \-p +option is supplied, and +.I mode +is omitted, the output is in a form that may be reused as input. +The return status is 0 if the mode was successfully changed or if +no \fImode\fP argument was supplied, and false otherwise. +.TP +\fBunalias\fP [\-\fBa\fP] [\fIname\fP ...] +Remove each \fIname\fP from the list of defined aliases. If +.B \-a +is supplied, all alias definitions are removed. The return +value is true unless a supplied +.I name +is not a defined alias. +.TP +\fBunset\fP [\-\fBfv\fP] [\-\fBn\fP] [\fIname\fP ...] +For each +.IR name , +remove the corresponding variable or function. +If the +.B \-v +option is given, each +.I name +refers to a shell variable, and that variable is removed. +Read-only variables may not be unset. +If +.B \-f +is specified, each +.I name +refers to a shell function, and the function definition +is removed. +If the +.B \-n +option is supplied, and \fIname\fP is a variable with the \fInameref\fP +attribute, \fIname\fP will be unset rather than the variable it +references. +\fB\-n\fP has no effect if the \fB\-f\fP option is supplied. +If no options are supplied, each \fIname\fP refers to a variable; if +there is no variable by that name, any function with that name is +unset. +Each unset variable or function is removed from the environment +passed to subsequent commands. +If any of +.SM +.BR COMP_WORDBREAKS , +.SM +.BR RANDOM , +.SM +.BR SECONDS , +.SM +.BR LINENO , +.SM +.BR HISTCMD , +.SM +.BR FUNCNAME , +.SM +.BR GROUPS , +or +.SM +.B DIRSTACK +are unset, they lose their special properties, even if they are +subsequently reset. The exit status is true unless a +.I name +is readonly. +.TP +\fBwait\fP [\fB\-n\fP] [\fIn ...\fP] +Wait for each specified child process and return its termination status. +Each +.I n +may be a process +ID or a job specification; if a job spec is given, all processes +in that job's pipeline are waited for. If +.I n +is not given, all currently active child processes +are waited for, and the return status is zero. +If the \fB\-n\fP option is supplied, \fBwait\fP waits for any job to +terminate and returns its exit status. +If +.I n +specifies a non-existent process or job, the return status is +127. Otherwise, the return status is the exit status of the last +process or job waited for. +.\" bash_builtins +.if \n(zZ=1 .ig zZ +.SH "RESTRICTED SHELL" +.\" rbash.1 +.zY +.PP +If +.B bash +is started with the name +.BR rbash , +or the +.B \-r +option is supplied at invocation, +the shell becomes restricted. +A restricted shell is used to +set up an environment more controlled than the standard shell. +It behaves identically to +.B bash +with the exception that the following are disallowed or not performed: +.IP \(bu +changing directories with \fBcd\fP +.IP \(bu +setting or unsetting the values of +.SM +.BR SHELL , +.SM +.BR PATH , +.SM +.BR ENV , +or +.SM +.B BASH_ENV +.IP \(bu +specifying command names containing +.B / +.IP \(bu +specifying a filename containing a +.B / +as an argument to the +.B . +builtin command +.IP \(bu +specifying a filename containing a slash as an argument to the +.B \-p +option to the +.B hash +builtin command +.IP \(bu +importing function definitions from the shell environment at startup +.IP \(bu +parsing the value of +.SM +.B SHELLOPTS +from the shell environment at startup +.IP \(bu +redirecting output using the >, >|, <>, >&, &>, and >> redirection operators +.IP \(bu +using the +.B exec +builtin command to replace the shell with another command +.IP \(bu +adding or deleting builtin commands with the +.B \-f +and +.B \-d +options to the +.B enable +builtin command +.IP \(bu +using the \fBenable\fP builtin command to enable disabled shell builtins +.IP \(bu +specifying the +.B \-p +option to the +.B command +builtin command +.IP \(bu +turning off restricted mode with +\fBset +r\fP or \fBset +o restricted\fP. +.PP +These restrictions are enforced after any startup files are read. +.PP +.ie \n(zY=1 When a command that is found to be a shell script is executed, +.el \{ When a command that is found to be a shell script is executed +(see +.SM +.B "COMMAND EXECUTION" +above), +\} +.B rbash +turns off any restrictions in the shell spawned to execute the +script. +.\" end of rbash.1 +.if \n(zY=1 .ig zY +.SH "SEE ALSO" +.PD 0 +.TP +\fIBash Reference Manual\fP, Brian Fox and Chet Ramey +.TP +\fIThe Gnu Readline Library\fP, Brian Fox and Chet Ramey +.TP +\fIThe Gnu History Library\fP, Brian Fox and Chet Ramey +.TP +\fIPortable Operating System Interface (POSIX) Part 2: Shell and Utilities\fP, IEEE -- +http://pubs.opengroup.org/onlinepubs/9699919799/ +.TP +http://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode +.TP +\fIsh\fP(1), \fIksh\fP(1), \fIcsh\fP(1) +.TP +\fIemacs\fP(1), \fIvi\fP(1) +.TP +\fIreadline\fP(3) +.PD +.SH FILES +.PD 0 +.TP +.FN /bin/bash +The \fBbash\fP executable +.TP +.FN /etc/profile +The systemwide initialization file, executed for login shells +.TP +.FN /etc/bash.bashrc +The systemwide per-interactive-shell startup file +.TP +.FN /etc/bash.bash.logout +The systemwide login shell cleanup file, executed when a login shell exits +.TP +.FN ~/.bash_profile +The personal initialization file, executed for login shells +.TP +.FN ~/.bashrc +The individual per-interactive-shell startup file +.TP +.FN ~/.bash_logout +The individual login shell cleanup file, executed when a login shell exits +.TP +.FN ~/.inputrc +Individual \fIreadline\fP initialization file +.PD +.SH AUTHORS +Brian Fox, Free Software Foundation +.br +bfox@gnu.org +.PP +Chet Ramey, Case Western Reserve University +.br +chet.ramey@case.edu +.SH BUG REPORTS +If you find a bug in +.B bash, +you should report it. But first, you should +make sure that it really is a bug, and that it appears in the latest +version of +.BR bash . +The latest version is always available from +\fIftp://ftp.gnu.org/pub/gnu/bash/\fP. +.PP +Once you have determined that a bug actually exists, use the +.I bashbug +command to submit a bug report. +If you have a fix, you are encouraged to mail that as well! +Suggestions and `philosophical' bug reports may be mailed +to \fIbug-bash@gnu.org\fP or posted to the Usenet +newsgroup +.BR gnu.bash.bug . +.PP +ALL bug reports should include: +.PP +.PD 0 +.TP 20 +The version number of \fBbash\fR +.TP +The hardware and operating system +.TP +The compiler used to compile +.TP +A description of the bug behaviour +.TP +A short script or `recipe' which exercises the bug +.PD +.PP +.I bashbug +inserts the first three items automatically into the template +it provides for filing a bug report. +.PP +Comments and bug reports concerning +this manual page should be directed to +.IR chet.ramey@case.edu . +.SH BUGS +.PP +It's too big and too slow. +.PP +There are some subtle differences between +.B bash +and traditional versions of +.BR sh , +mostly because of the +.SM +.B POSIX +specification. +.PP +Aliases are confusing in some uses. +.PP +Shell builtin commands and functions are not stoppable/restartable. +.PP +Compound commands and command sequences of the form `a ; b ; c' +are not handled gracefully when process suspension is attempted. +When a process is stopped, the shell immediately executes the next +command in the sequence. +It suffices to place the sequence of commands between +parentheses to force it into a subshell, which may be stopped as +a unit. +.PP +Array variables may not (yet) be exported. +.PP +There may be only one active coprocess at a time. +.zZ +.zY diff --git a/.pc/man-test2.diff/doc/bashref.texi b/.pc/man-test2.diff/doc/bashref.texi new file mode 100644 index 0000000..eca3c26 --- /dev/null +++ b/.pc/man-test2.diff/doc/bashref.texi @@ -0,0 +1,8743 @@ +\input texinfo.tex @c -*- texinfo -*- +@c %**start of header +@setfilename bashref.info +@settitle Bash Reference Manual + +@include version.texi +@c %**end of header + +@copying +This text is a brief description of the features that are present in +the Bash shell (version @value{VERSION}, @value{UPDATED}). + +This is Edition @value{EDITION}, last updated @value{UPDATED}, +of @cite{The GNU Bash Reference Manual}, +for @code{Bash}, Version @value{VERSION}. + +Copyright @copyright{} 1988--2014 Free Software Foundation, Inc. + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 or +any later version published by the Free Software Foundation; with no +Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. +A copy of the license is included in the section entitled +``GNU Free Documentation License''. +@end quotation +@end copying + +@defcodeindex bt +@defcodeindex rw +@set BashFeatures + +@dircategory Basics +@direntry +* Bash: (bash). The GNU Bourne-Again SHell. +@end direntry + +@finalout + +@titlepage +@title Bash Reference Manual +@subtitle Reference Documentation for Bash +@subtitle Edition @value{EDITION}, for @code{Bash} Version @value{VERSION}. +@subtitle @value{UPDATED-MONTH} +@author Chet Ramey, Case Western Reserve University +@author Brian Fox, Free Software Foundation + +@page +@vskip 0pt plus 1filll +@insertcopying + +@end titlepage + +@contents + +@ifnottex +@node Top, Introduction, (dir), (dir) +@top Bash Features + +This text is a brief description of the features that are present in +the Bash shell (version @value{VERSION}, @value{UPDATED}). +The Bash home page is @url{http://www.gnu.org/software/bash/}. + +This is Edition @value{EDITION}, last updated @value{UPDATED}, +of @cite{The GNU Bash Reference Manual}, +for @code{Bash}, Version @value{VERSION}. + +Bash contains features that appear in other popular shells, and some +features that only appear in Bash. Some of the shells that Bash has +borrowed concepts from are the Bourne Shell (@file{sh}), the Korn Shell +(@file{ksh}), and the C-shell (@file{csh} and its successor, +@file{tcsh}). The following menu breaks the features up into +categories, noting which features were inspired by other shells and +which are specific to Bash. + +This manual is meant as a brief introduction to features found in +Bash. The Bash manual page should be used as the definitive +reference on shell behavior. + +@menu +* Introduction:: An introduction to the shell. +* Definitions:: Some definitions used in the rest of this + manual. +* Basic Shell Features:: The shell "building blocks". +* Shell Builtin Commands:: Commands that are a part of the shell. +* Shell Variables:: Variables used or set by Bash. +* Bash Features:: Features found only in Bash. +* Job Control:: What job control is and how Bash allows you + to use it. +* Command Line Editing:: Chapter describing the command line + editing features. +* Using History Interactively:: Command History Expansion +* Installing Bash:: How to build and install Bash on your system. +* Reporting Bugs:: How to report bugs in Bash. +* Major Differences From The Bourne Shell:: A terse list of the differences + between Bash and historical + versions of /bin/sh. +* GNU Free Documentation License:: Copying and sharing this documentation. +* Indexes:: Various indexes for this manual. +@end menu +@end ifnottex + +@node Introduction +@chapter Introduction +@menu +* What is Bash?:: A short description of Bash. +* What is a shell?:: A brief introduction to shells. +@end menu + +@node What is Bash? +@section What is Bash? + +Bash is the shell, or command language interpreter, +for the @sc{gnu} operating system. +The name is an acronym for the @samp{Bourne-Again SHell}, +a pun on Stephen Bourne, the author of the direct ancestor of +the current Unix shell @code{sh}, +which appeared in the Seventh Edition Bell Labs Research version +of Unix. + +Bash is largely compatible with @code{sh} and incorporates useful +features from the Korn shell @code{ksh} and the C shell @code{csh}. +It is intended to be a conformant implementation of the @sc{ieee} +@sc{posix} Shell and Tools portion of the @sc{ieee} @sc{posix} +specification (@sc{ieee} Standard 1003.1). +It offers functional improvements over @code{sh} for both interactive and +programming use. + +While the @sc{gnu} operating system provides other shells, including +a version of @code{csh}, Bash is the default shell. +Like other @sc{gnu} software, Bash is quite portable. It currently runs +on nearly every version of Unix and a few other operating systems @minus{} +independently-supported ports exist for @sc{ms-dos}, @sc{os/2}, +and Windows platforms. + +@node What is a shell? +@section What is a shell? + +At its base, a shell is simply a macro processor that executes +commands. The term macro processor means functionality where text +and symbols are expanded to create larger expressions. + +A Unix shell is both a command interpreter and a programming +language. As a command interpreter, the shell provides the user +interface to the rich set of @sc{gnu} utilities. The programming +language features allow these utilities to be combined. +Files containing commands can be created, and become +commands themselves. These new commands have the same status as +system commands in directories such as @file{/bin}, allowing users +or groups to establish custom environments to automate their common +tasks. + +Shells may be used interactively or non-interactively. In +interactive mode, they accept input typed from the keyboard. +When executing non-interactively, shells execute commands read +from a file. + +A shell allows execution of @sc{gnu} commands, both synchronously and +asynchronously. +The shell waits for synchronous commands to complete before accepting +more input; asynchronous commands continue to execute in parallel +with the shell while it reads and executes additional commands. +The @dfn{redirection} constructs permit +fine-grained control of the input and output of those commands. +Moreover, the shell allows control over the contents of commands' +environments. + +Shells also provide a small set of built-in +commands (@dfn{builtins}) implementing functionality impossible +or inconvenient to obtain via separate utilities. +For example, @code{cd}, @code{break}, @code{continue}, and +@code{exec} cannot be implemented outside of the shell because +they directly manipulate the shell itself. +The @code{history}, @code{getopts}, @code{kill}, or @code{pwd} +builtins, among others, could be implemented in separate utilities, +but they are more convenient to use as builtin commands. +All of the shell builtins are described in +subsequent sections. + +While executing commands is essential, most of the power (and +complexity) of shells is due to their embedded programming +languages. Like any high-level language, the shell provides +variables, flow control constructs, quoting, and functions. + +Shells offer features geared specifically for +interactive use rather than to augment the programming language. +These interactive features include job control, command line +editing, command history and aliases. Each of these features is +described in this manual. + +@node Definitions +@chapter Definitions +These definitions are used throughout the remainder of this manual. + +@table @code + +@item POSIX +@cindex POSIX +A family of open system standards based on Unix. Bash +is primarily concerned with the Shell and Utilities portion of the +@sc{posix} 1003.1 standard. + +@item blank +A space or tab character. + +@item builtin +@cindex builtin +A command that is implemented internally by the shell itself, rather +than by an executable program somewhere in the file system. + +@item control operator +@cindex control operator +A @code{token} that performs a control function. It is a @code{newline} +or one of the following: +@samp{||}, @samp{&&}, @samp{&}, @samp{;}, @samp{;;}, +@samp{|}, @samp{|&}, @samp{(}, or @samp{)}. + +@item exit status +@cindex exit status +The value returned by a command to its caller. The value is restricted +to eight bits, so the maximum value is 255. + +@item field +@cindex field +A unit of text that is the result of one of the shell expansions. After +expansion, when executing a command, the resulting fields are used as +the command name and arguments. + +@item filename +@cindex filename +A string of characters used to identify a file. + +@item job +@cindex job +A set of processes comprising a pipeline, and any processes descended +from it, that are all in the same process group. + +@item job control +@cindex job control +A mechanism by which users can selectively stop (suspend) and restart +(resume) execution of processes. + +@item metacharacter +@cindex metacharacter +A character that, when unquoted, separates words. A metacharacter is +a @code{blank} or one of the following characters: +@samp{|}, @samp{&}, @samp{;}, @samp{(}, @samp{)}, @samp{<}, or +@samp{>}. + +@item name +@cindex name +@cindex identifier +A @code{word} consisting solely of letters, numbers, and underscores, +and beginning with a letter or underscore. @code{Name}s are used as +shell variable and function names. +Also referred to as an @code{identifier}. + +@item operator +@cindex operator, shell +A @code{control operator} or a @code{redirection operator}. +@xref{Redirections}, for a list of redirection operators. +Operators contain at least one unquoted @code{metacharacter}. + +@item process group +@cindex process group +A collection of related processes each having the same process +group @sc{id}. + +@item process group ID +@cindex process group ID +A unique identifier that represents a @code{process group} +during its lifetime. + +@item reserved word +@cindex reserved word +A @code{word} that has a special meaning to the shell. Most reserved +words introduce shell flow control constructs, such as @code{for} and +@code{while}. + +@item return status +@cindex return status +A synonym for @code{exit status}. + +@item signal +@cindex signal +A mechanism by which a process may be notified by the kernel +of an event occurring in the system. + +@item special builtin +@cindex special builtin +A shell builtin command that has been classified as special by the +@sc{posix} standard. + +@item token +@cindex token +A sequence of characters considered a single unit by the shell. +It is either a @code{word} or an @code{operator}. + +@item word +@cindex word +A sequence of characters treated as a unit by the shell. +Words may not include unquoted @code{metacharacters}. +@end table + +@node Basic Shell Features +@chapter Basic Shell Features +@cindex Bourne shell + +Bash is an acronym for @samp{Bourne-Again SHell}. +The Bourne shell is +the traditional Unix shell originally written by Stephen Bourne. +All of the Bourne shell builtin commands are available in Bash, +The rules for evaluation and quoting are taken from the @sc{posix} +specification for the `standard' Unix shell. + +This chapter briefly summarizes the shell's `building blocks': +commands, control structures, shell functions, shell @i{parameters}, +shell expansions, +@i{redirections}, which are a way to direct input and output from +and to named files, and how the shell executes commands. + +@menu +* Shell Syntax:: What your input means to the shell. +* Shell Commands:: The types of commands you can use. +* Shell Functions:: Grouping commands by name. +* Shell Parameters:: How the shell stores values. +* Shell Expansions:: How Bash expands parameters and the various + expansions available. +* Redirections:: A way to control where input and output go. +* Executing Commands:: What happens when you run a command. +* Shell Scripts:: Executing files of shell commands. +@end menu + +@node Shell Syntax +@section Shell Syntax +@menu +* Shell Operation:: The basic operation of the shell. +* Quoting:: How to remove the special meaning from characters. +* Comments:: How to specify comments. +@end menu + +When the shell reads input, it proceeds through a +sequence of operations. If the input indicates the beginning of a +comment, the shell ignores the comment symbol (@samp{#}), and the rest +of that line. + +Otherwise, roughly speaking, the shell reads its input and +divides the input into words and operators, employing the quoting rules +to select which meanings to assign various words and characters. + +The shell then parses these tokens into commands and other constructs, +removes the special meaning of certain words or characters, expands +others, redirects input and output as needed, executes the specified +command, waits for the command's exit status, and makes that exit status +available for further inspection or processing. + +@node Shell Operation +@subsection Shell Operation + +The following is a brief description of the shell's operation when it +reads and executes a command. Basically, the shell does the +following: + +@enumerate +@item +Reads its input from a file (@pxref{Shell Scripts}), from a string +supplied as an argument to the @option{-c} invocation option +(@pxref{Invoking Bash}), or from the user's terminal. + +@item +Breaks the input into words and operators, obeying the quoting rules +described in @ref{Quoting}. These tokens are separated by +@code{metacharacters}. Alias expansion is performed by this step +(@pxref{Aliases}). + +@item +Parses the tokens into simple and compound commands +(@pxref{Shell Commands}). + +@item +Performs the various shell expansions (@pxref{Shell Expansions}), breaking +the expanded tokens into lists of filenames (@pxref{Filename Expansion}) +and commands and arguments. + +@item +Performs any necessary redirections (@pxref{Redirections}) and removes +the redirection operators and their operands from the argument list. + +@item +Executes the command (@pxref{Executing Commands}). + +@item +Optionally waits for the command to complete and collects its exit +status (@pxref{Exit Status}). + +@end enumerate + +@node Quoting +@subsection Quoting +@cindex quoting +@menu +* Escape Character:: How to remove the special meaning from a single + character. +* Single Quotes:: How to inhibit all interpretation of a sequence + of characters. +* Double Quotes:: How to suppress most of the interpretation of a + sequence of characters. +* ANSI-C Quoting:: How to expand ANSI-C sequences in quoted strings. +* Locale Translation:: How to translate strings into different languages. +@end menu + +Quoting is used to remove the special meaning of certain +characters or words to the shell. Quoting can be used to +disable special treatment for special characters, to prevent +reserved words from being recognized as such, and to prevent +parameter expansion. + +Each of the shell metacharacters (@pxref{Definitions}) +has special meaning to the shell and must be quoted if it is to +represent itself. +When the command history expansion facilities are being used +(@pxref{History Interaction}), the +@var{history expansion} character, usually @samp{!}, must be quoted +to prevent history expansion. @xref{Bash History Facilities}, for +more details concerning history expansion. + +There are three quoting mechanisms: the +@var{escape character}, single quotes, and double quotes. + +@node Escape Character +@subsubsection Escape Character +A non-quoted backslash @samp{\} is the Bash escape character. +It preserves the literal value of the next character that follows, +with the exception of @code{newline}. If a @code{\newline} pair +appears, and the backslash itself is not quoted, the @code{\newline} +is treated as a line continuation (that is, it is removed from +the input stream and effectively ignored). + +@node Single Quotes +@subsubsection Single Quotes + +Enclosing characters in single quotes (@samp{'}) preserves the literal value +of each character within the quotes. A single quote may not occur +between single quotes, even when preceded by a backslash. + +@node Double Quotes +@subsubsection Double Quotes + +Enclosing characters in double quotes (@samp{"}) preserves the literal value +of all characters within the quotes, with the exception of +@samp{$}, @samp{`}, @samp{\}, +and, when history expansion is enabled, @samp{!}. +The characters @samp{$} and @samp{`} +retain their special meaning within double quotes (@pxref{Shell Expansions}). +The backslash retains its special meaning only when followed by one of +the following characters: +@samp{$}, @samp{`}, @samp{"}, @samp{\}, or @code{newline}. +Within double quotes, backslashes that are followed by one of these +characters are removed. Backslashes preceding characters without a +special meaning are left unmodified. +A double quote may be quoted within double quotes by preceding it with +a backslash. +If enabled, history expansion will be performed unless an @samp{!} +appearing in double quotes is escaped using a backslash. +The backslash preceding the @samp{!} is not removed. + +The special parameters @samp{*} and @samp{@@} have special meaning +when in double quotes (@pxref{Shell Parameter Expansion}). + +@node ANSI-C Quoting +@subsubsection ANSI-C Quoting +@cindex quoting, ANSI + +Words of the form @code{$'@var{string}'} are treated specially. The +word expands to @var{string}, with backslash-escaped characters replaced +as specified by the ANSI C standard. Backslash escape sequences, if +present, are decoded as follows: + +@table @code +@item \a +alert (bell) +@item \b +backspace +@item \e +@itemx \E +an escape character (not ANSI C) +@item \f +form feed +@item \n +newline +@item \r +carriage return +@item \t +horizontal tab +@item \v +vertical tab +@item \\ +backslash +@item \' +single quote +@item \" +double quote +@item \@var{nnn} +the eight-bit character whose value is the octal value @var{nnn} +(one to three digits) +@item \x@var{HH} +the eight-bit character whose value is the hexadecimal value @var{HH} +(one or two hex digits) +@item \u@var{HHHH} +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +@var{HHHH} (one to four hex digits) +@item \U@var{HHHHHHHH} +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +@var{HHHHHHHH} (one to eight hex digits) +@item \c@var{x} +a control-@var{x} character +@end table + +@noindent +The expanded result is single-quoted, as if the dollar sign had not +been present. + +@node Locale Translation +@subsubsection Locale-Specific Translation +@cindex localization +@cindex internationalization +@cindex native languages +@cindex translation, native languages + +A double-quoted string preceded by a dollar sign (@samp{$}) will cause +the string to be translated according to the current locale. +If the current locale is @code{C} or @code{POSIX}, the dollar sign +is ignored. +If the string is translated and replaced, the replacement is +double-quoted. + +@vindex LC_MESSAGES +@vindex TEXTDOMAIN +@vindex TEXTDOMAINDIR +Some systems use the message catalog selected by the @env{LC_MESSAGES} +shell variable. Others create the name of the message catalog from the +value of the @env{TEXTDOMAIN} shell variable, possibly adding a +suffix of @samp{.mo}. If you use the @env{TEXTDOMAIN} variable, you +may need to set the @env{TEXTDOMAINDIR} variable to the location of +the message catalog files. Still others use both variables in this +fashion: +@env{TEXTDOMAINDIR}/@env{LC_MESSAGES}/LC_MESSAGES/@env{TEXTDOMAIN}.mo. + +@node Comments +@subsection Comments +@cindex comments, shell + +In a non-interactive shell, or an interactive shell in which the +@code{interactive_comments} option to the @code{shopt} +builtin is enabled (@pxref{The Shopt Builtin}), +a word beginning with @samp{#} +causes that word and all remaining characters on that line to +be ignored. An interactive shell without the @code{interactive_comments} +option enabled does not allow comments. The @code{interactive_comments} +option is on by default in interactive shells. +@xref{Interactive Shells}, for a description of what makes +a shell interactive. + +@node Shell Commands +@section Shell Commands +@cindex commands, shell + +A simple shell command such as @code{echo a b c} consists of the command +itself followed by arguments, separated by spaces. + +More complex shell commands are composed of simple commands arranged together +in a variety of ways: in a pipeline in which the output of one command +becomes the input of a second, in a loop or conditional construct, or in +some other grouping. + +@menu +* Simple Commands:: The most common type of command. +* Pipelines:: Connecting the input and output of several + commands. +* Lists:: How to execute commands sequentially. +* Compound Commands:: Shell commands for control flow. +* Coprocesses:: Two-way communication between commands. +* GNU Parallel:: Running commands in parallel. +@end menu + +@node Simple Commands +@subsection Simple Commands +@cindex commands, simple + +A simple command is the kind of command encountered most often. +It's just a sequence of words separated by @code{blank}s, terminated +by one of the shell's control operators (@pxref{Definitions}). The +first word generally specifies a command to be executed, with the +rest of the words being that command's arguments. + +The return status (@pxref{Exit Status}) of a simple command is +its exit status as provided +by the @sc{posix} 1003.1 @code{waitpid} function, or 128+@var{n} if +the command was terminated by signal @var{n}. + +@node Pipelines +@subsection Pipelines +@cindex pipeline +@cindex commands, pipelines + +A @code{pipeline} is a sequence of simple commands separated by one of +the control operators @samp{|} or @samp{|&}. + +@rwindex time +@rwindex ! +@cindex command timing +The format for a pipeline is +@example +[time [-p]] [!] @var{command1} [ | or |& @var{command2} ] @dots{} +@end example + +@noindent +The output of each command in the pipeline is connected via a pipe +to the input of the next command. +That is, each command reads the previous command's output. This +connection is performed before any redirections specified by the +command. + +If @samp{|&} is used, @var{command1}'s standard error, in addition to +its standard output, is connected to +@var{command2}'s standard input through the pipe; +it is shorthand for @code{2>&1 |}. +This implicit redirection of the standard error to the standard output is +performed after any redirections specified by the command. + +The reserved word @code{time} causes timing statistics +to be printed for the pipeline once it finishes. +The statistics currently consist of elapsed (wall-clock) time and +user and system time consumed by the command's execution. +The @option{-p} option changes the output format to that specified +by @sc{posix}. +When the shell is in @sc{posix} mode (@pxref{Bash POSIX Mode}), +it does not recognize @code{time} as a reserved word if the next +token begins with a @samp{-}. +The @env{TIMEFORMAT} variable may be set to a format string that +specifies how the timing information should be displayed. +@xref{Bash Variables}, for a description of the available formats. +The use of @code{time} as a reserved word permits the timing of +shell builtins, shell functions, and pipelines. An external +@code{time} command cannot time these easily. + +When the shell is in @sc{posix} mode (@pxref{Bash POSIX Mode}), @code{time} +may be followed by a newline. In this case, the shell displays the +total user and system time consumed by the shell and its children. +The @env{TIMEFORMAT} variable may be used to specify the format of +the time information. + +If the pipeline is not executed asynchronously (@pxref{Lists}), the +shell waits for all commands in the pipeline to complete. + +Each command in a pipeline is executed in its own subshell +(@pxref{Command Execution Environment}). The exit +status of a pipeline is the exit status of the last command in the +pipeline, unless the @code{pipefail} option is enabled +(@pxref{The Set Builtin}). +If @code{pipefail} is enabled, the pipeline's return status is the +value of the last (rightmost) command to exit with a non-zero status, +or zero if all commands exit successfully. +If the reserved word @samp{!} precedes the pipeline, the +exit status is the logical negation of the exit status as described +above. +The shell waits for all commands in the pipeline to terminate before +returning a value. + +@node Lists +@subsection Lists of Commands +@cindex commands, lists + +A @code{list} is a sequence of one or more pipelines separated by one +of the operators @samp{;}, @samp{&}, @samp{&&}, or @samp{||}, +and optionally terminated by one of @samp{;}, @samp{&}, or a +@code{newline}. + +Of these list operators, @samp{&&} and @samp{||} +have equal precedence, followed by @samp{;} and @samp{&}, +which have equal precedence. + +A sequence of one or more newlines may appear in a @code{list} +to delimit commands, equivalent to a semicolon. + +If a command is terminated by the control operator @samp{&}, +the shell executes the command asynchronously in a subshell. +This is known as executing the command in the @var{background}. +The shell does not wait for the command to finish, and the return +status is 0 (true). +When job control is not active (@pxref{Job Control}), +the standard input for asynchronous commands, in the absence of any +explicit redirections, is redirected from @code{/dev/null}. + +Commands separated by a @samp{;} are executed sequentially; the shell +waits for each command to terminate in turn. The return status is the +exit status of the last command executed. + +@sc{and} and @sc{or} lists are sequences of one or more pipelines +separated by the control operators @samp{&&} and @samp{||}, +respectively. @sc{and} and @sc{or} lists are executed with left +associativity. + +An @sc{and} list has the form +@example +@var{command1} && @var{command2} +@end example + +@noindent +@var{command2} is executed if, and only if, @var{command1} +returns an exit status of zero. + +An @sc{or} list has the form +@example +@var{command1} || @var{command2} +@end example + +@noindent +@var{command2} is executed if, and only if, @var{command1} +returns a non-zero exit status. + +The return status of +@sc{and} and @sc{or} lists is the exit status of the last command +executed in the list. + +@node Compound Commands +@subsection Compound Commands +@cindex commands, compound + +@menu +* Looping Constructs:: Shell commands for iterative action. +* Conditional Constructs:: Shell commands for conditional execution. +* Command Grouping:: Ways to group commands. +@end menu + +Compound commands are the shell programming constructs. +Each construct begins with a reserved word or control operator and is +terminated by a corresponding reserved word or operator. +Any redirections (@pxref{Redirections}) associated with a compound command +apply to all commands within that compound command unless explicitly overridden. + +In most cases a list of commands in a compound command's description may be +separated from the rest of the command by one or more newlines, and may be +followed by a newline in place of a semicolon. + +Bash provides looping constructs, conditional commands, and mechanisms +to group commands and execute them as a unit. + +@node Looping Constructs +@subsubsection Looping Constructs +@cindex commands, looping + +Bash supports the following looping constructs. + +Note that wherever a @samp{;} appears in the description of a +command's syntax, it may be replaced with one or more newlines. + +@table @code +@item until +@rwindex until +@rwindex do +@rwindex done +The syntax of the @code{until} command is: + +@example +until @var{test-commands}; do @var{consequent-commands}; done +@end example + +Execute @var{consequent-commands} as long as +@var{test-commands} has an exit status which is not zero. +The return status is the exit status of the last command executed +in @var{consequent-commands}, or zero if none was executed. + +@item while +@rwindex while +The syntax of the @code{while} command is: + +@example +while @var{test-commands}; do @var{consequent-commands}; done +@end example + +Execute @var{consequent-commands} as long as +@var{test-commands} has an exit status of zero. +The return status is the exit status of the last command executed +in @var{consequent-commands}, or zero if none was executed. + +@item for +@rwindex for +The syntax of the @code{for} command is: + +@example +for @var{name} [ [in [@var{words} @dots{}] ] ; ] do @var{commands}; done +@end example + +Expand @var{words}, and execute @var{commands} once for each member +in the resultant list, with @var{name} bound to the current member. +If @samp{in @var{words}} is not present, the @code{for} command +executes the @var{commands} once for each positional parameter that is +set, as if @samp{in "$@@"} had been specified +(@pxref{Special Parameters}). +The return status is the exit status of the last command that executes. +If there are no items in the expansion of @var{words}, no commands are +executed, and the return status is zero. + +An alternate form of the @code{for} command is also supported: + +@example +for (( @var{expr1} ; @var{expr2} ; @var{expr3} )) ; do @var{commands} ; done +@end example + +First, the arithmetic expression @var{expr1} is evaluated according +to the rules described below (@pxref{Shell Arithmetic}). +The arithmetic expression @var{expr2} is then evaluated repeatedly +until it evaluates to zero. +Each time @var{expr2} evaluates to a non-zero value, @var{commands} are +executed and the arithmetic expression @var{expr3} is evaluated. +If any expression is omitted, it behaves as if it evaluates to 1. +The return value is the exit status of the last command in @var{commands} +that is executed, or false if any of the expressions is invalid. +@end table + +The @code{break} and @code{continue} builtins (@pxref{Bourne Shell Builtins}) +may be used to control loop execution. + +@node Conditional Constructs +@subsubsection Conditional Constructs +@cindex commands, conditional + +@table @code +@item if +@rwindex if +@rwindex then +@rwindex else +@rwindex elif +@rwindex fi +The syntax of the @code{if} command is: + +@example +if @var{test-commands}; then + @var{consequent-commands}; +[elif @var{more-test-commands}; then + @var{more-consequents};] +[else @var{alternate-consequents};] +fi +@end example + +The @var{test-commands} list is executed, and if its return status is zero, +the @var{consequent-commands} list is executed. +If @var{test-commands} returns a non-zero status, each @code{elif} list +is executed in turn, and if its exit status is zero, +the corresponding @var{more-consequents} is executed and the +command completes. +If @samp{else @var{alternate-consequents}} is present, and +the final command in the final @code{if} or @code{elif} clause +has a non-zero exit status, then @var{alternate-consequents} is executed. +The return status is the exit status of the last command executed, or +zero if no condition tested true. + +@item case +@rwindex case +@rwindex in +@rwindex esac +The syntax of the @code{case} command is: + +@example +case @var{word} in [ [(] @var{pattern} [| @var{pattern}]@dots{}) @var{command-list} ;;]@dots{} esac +@end example + +@code{case} will selectively execute the @var{command-list} corresponding to +the first @var{pattern} that matches @var{word}. +If the shell option @code{nocasematch} +(see the description of @code{shopt} in @ref{The Shopt Builtin}) +is enabled, the match is performed without regard to the case +of alphabetic characters. +The @samp{|} is used to separate multiple patterns, and the @samp{)} +operator terminates a pattern list. +A list of patterns and an associated command-list is known +as a @var{clause}. + +Each clause must be terminated with @samp{;;}, @samp{;&}, or @samp{;;&}. +The @var{word} undergoes tilde expansion, parameter expansion, command +substitution, arithmetic expansion, and quote removal before matching is +attempted. Each @var{pattern} undergoes tilde expansion, parameter +expansion, command substitution, and arithmetic expansion. + +There may be an arbitrary number of @code{case} clauses, each terminated +by a @samp{;;}, @samp{;&}, or @samp{;;&}. +The first pattern that matches determines the +command-list that is executed. +It's a common idiom to use @samp{*} as the final pattern to define the +default case, since that pattern will always match. + +Here is an example using @code{case} in a script that could be used to +describe one interesting feature of an animal: + +@example +echo -n "Enter the name of an animal: " +read ANIMAL +echo -n "The $ANIMAL has " +case $ANIMAL in + horse | dog | cat) echo -n "four";; + man | kangaroo ) echo -n "two";; + *) echo -n "an unknown number of";; +esac +echo " legs." +@end example + +@noindent + +If the @samp{;;} operator is used, no subsequent matches are attempted after +the first pattern match. +Using @samp{;&} in place of @samp{;;} causes execution to continue with +the @var{command-list} associated with the next clause, if any. +Using @samp{;;&} in place of @samp{;;} causes the shell to test the patterns +in the next clause, if any, and execute any associated @var{command-list} +on a successful match. + +The return status is zero if no @var{pattern} is matched. Otherwise, the +return status is the exit status of the @var{command-list} executed. + +@item select +@rwindex select + +The @code{select} construct allows the easy generation of menus. +It has almost the same syntax as the @code{for} command: + +@example +select @var{name} [in @var{words} @dots{}]; do @var{commands}; done +@end example + +The list of words following @code{in} is expanded, generating a list +of items. The set of expanded words is printed on the standard +error output stream, each preceded by a number. If the +@samp{in @var{words}} is omitted, the positional parameters are printed, +as if @samp{in "$@@"} had been specified. +The @env{PS3} prompt is then displayed and a line is read from the +standard input. +If the line consists of a number corresponding to one of the displayed +words, then the value of @var{name} is set to that word. +If the line is empty, the words and prompt are displayed again. +If @code{EOF} is read, the @code{select} command completes. +Any other value read causes @var{name} to be set to null. +The line read is saved in the variable @env{REPLY}. + +The @var{commands} are executed after each selection until a +@code{break} command is executed, at which +point the @code{select} command completes. + +Here is an example that allows the user to pick a filename from the +current directory, and displays the name and index of the file +selected. + +@example +select fname in *; +do + echo you picked $fname \($REPLY\) + break; +done +@end example + +@item ((@dots{})) +@example +(( @var{expression} )) +@end example + +The arithmetic @var{expression} is evaluated according to the rules +described below (@pxref{Shell Arithmetic}). +If the value of the expression is non-zero, the return status is 0; +otherwise the return status is 1. This is exactly equivalent to +@example +let "@var{expression}" +@end example +@noindent +@xref{Bash Builtins}, for a full description of the @code{let} builtin. + +@item [[@dots{}]] +@rwindex [[ +@rwindex ]] +@example +[[ @var{expression} ]] +@end example + +Return a status of 0 or 1 depending on the evaluation of +the conditional expression @var{expression}. +Expressions are composed of the primaries described below in +@ref{Bash Conditional Expressions}. +Word splitting and filename expansion are not performed on the words +between the @code{[[} and @code{]]}; tilde expansion, parameter and +variable expansion, arithmetic expansion, command substitution, process +substitution, and quote removal are performed. +Conditional operators such as @samp{-f} must be unquoted to be recognized +as primaries. + +When used with @code{[[}, the @samp{<} and @samp{>} operators sort +lexicographically using the current locale. + +When the @samp{==} and @samp{!=} operators are used, the string to the +right of the operator is considered a pattern and matched according +to the rules described below in @ref{Pattern Matching}, +as if the @code{extglob} shell option were enabled. +The @samp{=} operator is identical to @samp{==}. +If the shell option @code{nocasematch} +(see the description of @code{shopt} in @ref{The Shopt Builtin}) +is enabled, the match is performed without regard to the case +of alphabetic characters. +The return value is 0 if the string matches (@samp{==}) or does not +match (@samp{!=})the pattern, and 1 otherwise. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. + +An additional binary operator, @samp{=~}, is available, with the same +precedence as @samp{==} and @samp{!=}. +When it is used, the string to the right of the operator is considered +an extended regular expression and matched accordingly (as in @i{regex}3)). +The return value is 0 if the string matches +the pattern, and 1 otherwise. +If the regular expression is syntactically incorrect, the conditional +expression's return value is 2. +If the shell option @code{nocasematch} +(see the description of @code{shopt} in @ref{The Shopt Builtin}) +is enabled, the match is performed without regard to the case +of alphabetic characters. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +Bracket expressions in regular expressions must be treated carefully, +since normal quoting characters lose their meanings between brackets. +If the pattern is stored in a shell variable, quoting the variable +expansion forces the entire pattern to be matched as a string. +Substrings matched by parenthesized subexpressions within the regular +expression are saved in the array variable @code{BASH_REMATCH}. +The element of @code{BASH_REMATCH} with index 0 is the portion of the string +matching the entire regular expression. +The element of @code{BASH_REMATCH} with index @var{n} is the portion of the +string matching the @var{n}th parenthesized subexpression. + +For example, the following will match a line +(stored in the shell variable @var{line}) +if there is a sequence of characters in the value consisting of +any number, including zero, of +space characters, zero or one instances of @samp{a}, then a @samp{b}: +@example +[[ $line =~ [[:space:]]*(a)?b ]] +@end example + +@noindent +That means values like @samp{aab} and @samp{ aaaaaab} will match, as +will a line containing a @samp{b} anywhere in its value. + +Storing the regular expression in a shell variable is often a useful +way to avoid problems with quoting characters that are special to the +shell. +It is sometimes difficult to specify a regular expression literally +without using quotes, or to keep track of the quoting used by regular +expressions while paying attention to the shell's quote removal. +Using a shell variable to store the pattern decreases these problems. +For example, the following is equivalent to the above: +@example +pattern='[[:space:]]*(a)?b' +[[ $line =~ $pattern ]] +@end example + +@noindent +If you want to match a character that's special to the regular expression +grammar, it has to be quoted to remove its special meaning. +This means that in the pattern @samp{xxx.txt}, the @samp{.} matches any +character in the string (its usual regular expression meaning), but in the +pattern @samp{"xxx.txt"} it can only match a literal @samp{.}. +Shell programmers should take special care with backslashes, since backslashes +are used both by the shell and regular expressions to remove the special +meaning from the following character. +The following two sets of commands are @emph{not} equivalent: +@example +pattern='\.' + +[[ . =~ $pattern ]] +[[ . =~ \. ]] + +[[ . =~ "$pattern" ]] +[[ . =~ '\.' ]] +@end example + +@noindent +The first two matches will succeed, but the second two will not, because +in the second two the backslash will be part of the pattern to be matched. +In the first two examples, the backslash removes the special meaning from +@samp{.}, so the literal @samp{.} matches. +If the string in the first examples were anything other than @samp{.}, say +@samp{a}, the pattern would not match, because the quoted @samp{.} in the +pattern loses its special meaning of matching any single character. + +Expressions may be combined using the following operators, listed +in decreasing order of precedence: + +@table @code +@item ( @var{expression} ) +Returns the value of @var{expression}. +This may be used to override the normal precedence of operators. + +@item ! @var{expression} +True if @var{expression} is false. + +@item @var{expression1} && @var{expression2} +True if both @var{expression1} and @var{expression2} are true. + +@item @var{expression1} || @var{expression2} +True if either @var{expression1} or @var{expression2} is true. +@end table + +@noindent +The @code{&&} and @code{||} operators do not evaluate @var{expression2} if the +value of @var{expression1} is sufficient to determine the return +value of the entire conditional expression. +@end table + +@node Command Grouping +@subsubsection Grouping Commands +@cindex commands, grouping + +Bash provides two ways to group a list of commands to be executed +as a unit. When commands are grouped, redirections may be applied +to the entire command list. For example, the output of all the +commands in the list may be redirected to a single stream. + +@table @code +@item () +@example +( @var{list} ) +@end example + +Placing a list of commands between parentheses causes a subshell +environment to be created (@pxref{Command Execution Environment}), and each +of the commands in @var{list} to be executed in that subshell. Since the +@var{list} is executed in a subshell, variable assignments do not remain in +effect after the subshell completes. + +@item @{@} +@rwindex @{ +@rwindex @} +@example +@{ @var{list}; @} +@end example + +Placing a list of commands between curly braces causes the list to +be executed in the current shell context. No subshell is created. +The semicolon (or newline) following @var{list} is required. +@end table + +In addition to the creation of a subshell, there is a subtle difference +between these two constructs due to historical reasons. The braces +are @code{reserved words}, so they must be separated from the @var{list} +by @code{blank}s or other shell metacharacters. +The parentheses are @code{operators}, and are +recognized as separate tokens by the shell even if they are not separated +from the @var{list} by whitespace. + +The exit status of both of these constructs is the exit status of +@var{list}. + +@node Coprocesses +@subsection Coprocesses +@cindex coprocess + +A @code{coprocess} is a shell command preceded by the @code{coproc} +reserved word. +A coprocess is executed asynchronously in a subshell, as if the command +had been terminated with the @samp{&} control operator, with a two-way pipe +established between the executing shell and the coprocess. + +The format for a coprocess is: +@example +coproc [@var{NAME}] @var{command} [@var{redirections}] +@end example + +@noindent +This creates a coprocess named @var{NAME}. +If @var{NAME} is not supplied, the default name is @var{COPROC}. +@var{NAME} must not be supplied if @var{command} is a simple +command (@pxref{Simple Commands}); otherwise, it is interpreted as +the first word of the simple command. + +When the coprocess is executed, the shell creates an array variable +(@pxref{Arrays}) +named @env{NAME} in the context of the executing shell. +The standard output of @var{command} +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to @env{NAME}[0]. +The standard input of @var{command} +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to @env{NAME}[1]. +This pipe is established before any redirections specified by the +command (@pxref{Redirections}). +The file descriptors can be utilized as arguments to shell commands +and redirections using standard word expansions. +The file descriptors are not available in subshells. + +The process ID of the shell spawned to execute the coprocess is +available as the value of the variable @env{NAME}_PID. +The @code{wait} +builtin command may be used to wait for the coprocess to terminate. + +Since the coprocess is created as an asynchronous command, +the @code{coproc} command always returns success. +The return status of a coprocess is the exit status of @var{command}. + +@node GNU Parallel +@subsection GNU Parallel + +There are ways to run commands in parallel that are not built into Bash. +GNU Parallel is a tool to do just that. + +GNU Parallel, as its name suggests, can be used to build and run commands +in parallel. You may run the same command with different arguments, whether +they are filenames, usernames, hostnames, or lines read from files. GNU +Parallel provides shorthand references to many of the most common operations +(input lines, various portions of the input line, different ways to specify +the input source, and so on). Parallel can replace @code{xargs} or feed +commands from its input sources to several different instances of Bash. + +For a complete description, refer to the GNU Parallel documentation. A few +examples should provide a brief introduction to its use. + +For example, it is easy to replace @code{xargs} to gzip all html files in the +current directory and its subdirectories: +@example +find . -type f -name '*.html' -print | parallel gzip +@end example +@noindent +If you need to protect special characters such as newlines in file names, +use find's @option{-print0} option and parallel's @option{-0} option. + +You can use Parallel to move files from the current directory when the +number of files is too large to process with one @code{mv} invocation: +@example +ls | parallel mv @{@} destdir +@end example + +As you can see, the @{@} is replaced with each line read from standard input. +While using @code{ls} will work in most instances, it is not sufficient to +deal with all filenames. +If you need to accommodate special characters in filenames, you can use + +@example +find . -depth 1 \! -name '.*' -print0 | parallel -0 mv @{@} destdir +@end example + +@noindent +as alluded to above. + +This will run as many @code{mv} commands as there are files in the current +directory. +You can emulate a parallel @code{xargs} by adding the @option{-X} option: +@example +find . -depth 1 \! -name '.*' -print0 | parallel -0 -X mv @{@} destdir +@end example + +GNU Parallel can replace certain common idioms that operate on lines read +from a file (in this case, filenames listed one per line): +@example + while IFS= read -r x; do + do-something1 "$x" "config-$x" + do-something2 < "$x" + done < file | process-output +@end example + +@noindent +with a more compact syntax reminiscent of lambdas: +@example +cat list | parallel "do-something1 @{@} config-@{@} ; do-something2 < @{@}" | process-output +@end example + +Parallel provides a built-in mechanism to remove filename extensions, which +lends itself to batch file transformations or renaming: +@example +ls *.gz | parallel -j+0 "zcat @{@} | bzip2 >@{.@}.bz2 && rm @{@}" +@end example +@noindent +This will recompress all files in the current directory with names ending +in .gz using bzip2, running one job per CPU (-j+0) in parallel. +(We use @code{ls} for brevity here; using @code{find} as above is more +robust in the face of filenames containing unexpected characters.) +Parallel can take arguments from the command line; the above can also be +written as + +@example +parallel "zcat @{@} | bzip2 >@{.@}.bz2 && rm @{@}" ::: *.gz +@end example + +If a command generates output, you may want to preserve the input order in +the output. For instance, the following command +@example +@{ echo foss.org.my ; echo debian.org; echo freenetproject.org; @} | parallel traceroute +@end example +@noindent +will display as output the traceroute invocation that finishes first. +Adding the @option{-k} option +@example +@{ echo foss.org.my ; echo debian.org; echo freenetproject.org; @} | parallel -k traceroute +@end example +@noindent +will ensure that the output of @code{traceroute foss.org.my} is displayed first. + +Finally, Parallel can be used to run a sequence of shell commands in parallel, +similar to @samp{cat file | bash}. +It is not uncommon to take a list of filenames, create a series of shell +commands to operate on them, and feed that list of commnds to a shell. +Parallel can speed this up. Assuming that @file{file} contains a list of +shell commands, one per line, + +@example +parallel -j 10 < file +@end example + +@noindent +will evaluate the commands using the shell (since no explicit command is +supplied as an argument), in blocks of ten shell jobs at a time. + +@node Shell Functions +@section Shell Functions +@cindex shell function +@cindex functions, shell + +Shell functions are a way to group commands for later execution +using a single name for the group. They are executed just like +a "regular" command. +When the name of a shell function is used as a simple command name, +the list of commands associated with that function name is executed. +Shell functions are executed in the current +shell context; no new process is created to interpret them. + +Functions are declared using this syntax: +@rwindex function +@example +@var{name} () @var{compound-command} [ @var{redirections} ] +@end example + +or + +@example +function @var{name} [()] @var{compound-command} [ @var{redirections} ] +@end example + +This defines a shell function named @var{name}. The reserved +word @code{function} is optional. +If the @code{function} reserved +word is supplied, the parentheses are optional. +The @var{body} of the function is the compound command +@var{compound-command} (@pxref{Compound Commands}). +That command is usually a @var{list} enclosed between @{ and @}, but +may be any compound command listed above. +@var{compound-command} is executed whenever @var{name} is specified as the +name of a command. +When the shell is in @sc{posix} mode (@pxref{Bash POSIX Mode}), +@var{name} may not be the same as one of the special builtins +(@pxref{Special Builtins}). +Any redirections (@pxref{Redirections}) associated with the shell function +are performed when the function is executed. + +A function definition may be deleted using the @option{-f} option to the +@code{unset} builtin (@pxref{Bourne Shell Builtins}). + +The exit status of a function definition is zero unless a syntax error +occurs or a readonly function with the same name already exists. +When executed, the exit status of a function is the exit status of the +last command executed in the body. + +Note that for historical reasons, in the most common usage the curly braces +that surround the body of the function must be separated from the body by +@code{blank}s or newlines. +This is because the braces are reserved words and are only recognized +as such when they are separated from the command list +by whitespace or another shell metacharacter. +Also, when using the braces, the @var{list} must be terminated by a semicolon, +a @samp{&}, or a newline. + +When a function is executed, the arguments to the +function become the positional parameters +during its execution (@pxref{Positional Parameters}). +The special parameter @samp{#} that expands to the number of +positional parameters is updated to reflect the change. +Special parameter @code{0} is unchanged. +The first element of the @env{FUNCNAME} variable is set to the +name of the function while the function is executing. + +All other aspects of the shell execution +environment are identical between a function and its caller +with these exceptions: +the @env{DEBUG} and @env{RETURN} traps +are not inherited unless the function has been given the +@code{trace} attribute using the @code{declare} builtin or +the @code{-o functrace} option has been enabled with +the @code{set} builtin, +(in which case all functions inherit the @env{DEBUG} and @env{RETURN} traps), +and the @env{ERR} trap is not inherited unless the @code{-o errtrace} +shell option has been enabled. +@xref{Bourne Shell Builtins}, for the description of the +@code{trap} builtin. + +The @env{FUNCNEST} variable, if set to a numeric value greater +than 0, defines a maximum function nesting level. Function +invocations that exceed the limit cause the entire command to +abort. + +If the builtin command @code{return} +is executed in a function, the function completes and +execution resumes with the next command after the function +call. +Any command associated with the @code{RETURN} trap is executed +before execution resumes. +When a function completes, the values of the +positional parameters and the special parameter @samp{#} +are restored to the values they had prior to the function's +execution. If a numeric argument is given to @code{return}, +that is the function's return status; otherwise the function's +return status is the exit status of the last command executed +before the @code{return}. + +Variables local to the function may be declared with the +@code{local} builtin. These variables are visible only to +the function and the commands it invokes. + +Function names and definitions may be listed with the +@option{-f} option to the @code{declare} (@code{typeset}) +builtin command (@pxref{Bash Builtins}). +The @option{-F} option to @code{declare} or @code{typeset} +will list the function names only +(and optionally the source file and line number, if the @code{extdebug} +shell option is enabled). +Functions may be exported so that subshells +automatically have them defined with the +@option{-f} option to the @code{export} builtin +(@pxref{Bourne Shell Builtins}). +Note that shell functions and variables with the same name may result +in multiple identically-named entries in the environment passed to the +shell's children. +Care should be taken in cases where this may cause a problem. + +Functions may be recursive. +The @code{FUNCNEST} variable may be used to limit the depth of the +function call stack and restrict the number of function invocations. +By default, no limit is placed on the number of recursive calls. + +@node Shell Parameters +@section Shell Parameters +@cindex parameters +@cindex variable, shell +@cindex shell variable + +@menu +* Positional Parameters:: The shell's command-line arguments. +* Special Parameters:: Parameters denoted by special characters. +@end menu + +A @var{parameter} is an entity that stores values. +It can be a @code{name}, a number, or one of the special characters +listed below. +A @var{variable} is a parameter denoted by a @code{name}. +A variable has a @var{value} and zero or more @var{attributes}. +Attributes are assigned using the @code{declare} builtin command +(see the description of the @code{declare} builtin in @ref{Bash Builtins}). + +A parameter is set if it has been assigned a value. The null string is +a valid value. Once a variable is set, it may be unset only by using +the @code{unset} builtin command. + +A variable may be assigned to by a statement of the form +@example +@var{name}=[@var{value}] +@end example +@noindent +If @var{value} +is not given, the variable is assigned the null string. All +@var{value}s undergo tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote +removal (detailed below). If the variable has its @code{integer} +attribute set, then @var{value} +is evaluated as an arithmetic expression even if the @code{$((@dots{}))} +expansion is not used (@pxref{Arithmetic Expansion}). +Word splitting is not performed, with the exception +of @code{"$@@"} as explained below. +Filename expansion is not performed. +Assignment statements may also appear as arguments to the +@code{alias}, +@code{declare}, @code{typeset}, @code{export}, @code{readonly}, +and @code{local} builtin commands. +When in @sc{posix} mode (@pxref{Bash POSIX Mode}), these builtins may appear +in a command after one or more instances of the @code{command} builtin +and retain these assignment statement properties. + +In the context where an assignment statement is assigning a value +to a shell variable or array index (@pxref{Arrays}), the @samp{+=} +operator can be used to +append to or add to the variable's previous value. +When @samp{+=} is applied to a variable for which the @var{integer} attribute +has been set, @var{value} is evaluated as an arithmetic expression and +added to the variable's current value, which is also evaluated. +When @samp{+=} is applied to an array variable using compound assignment +(@pxref{Arrays}), the +variable's value is not unset (as it is when using @samp{=}), and new +values are appended to the array beginning at one greater than the array's +maximum index (for indexed arrays), or added as additional key-value pairs +in an associative array. +When applied to a string-valued variable, @var{value} is expanded and +appended to the variable's value. + +A variable can be assigned the @var{nameref} attribute using the +@option{-n} option to the \fBdeclare\fP or \fBlocal\fP builtin commands +(@pxref{Bash Builtins}) +to create a @var{nameref}, or a reference to another variable. +This allows variables to be manipulated indirectly. +Whenever the nameref variable is referenced or assigned to, the operation +is actually performed on the variable specified by the nameref variable's +value. +A nameref is commonly used within shell functions to refer to a variable +whose name is passed as an argument to the function. +For instance, if a variable name is passed to a shell function as its first +argument, running +@example +declare -n ref=$1 +@end example +@noindent +inside the function creates a nameref variable @var{ref} whose value is +the variable name passed as the first argument. +References and assignments to @var{ref} are treated as references and +assignments to the variable whose name was passed as @code{$1}. + +If the control variable in a @code{for} loop has the nameref attribute, +the list of words can be a list of shell variables, and a name reference +will be established for each word in the list, in turn, when the loop is +executed. +Array variables cannot be given the @option{-n} attribute. +However, nameref variables can reference array variables and subscripted +array variables. +Namerefs can be unset using the @option{-n} option to the @code{unset} builtin +(@pxref{Bourne Shell Builtins}). +Otherwise, if @code{unset} is executed with the name of a nameref variable +as an argument, the variable referenced by the nameref variable will be unset. + +@node Positional Parameters +@subsection Positional Parameters +@cindex parameters, positional + +A @var{positional parameter} is a parameter denoted by one or more +digits, other than the single digit @code{0}. Positional parameters are +assigned from the shell's arguments when it is invoked, +and may be reassigned using the @code{set} builtin command. +Positional parameter @code{N} may be referenced as @code{$@{N@}}, or +as @code{$N} when @code{N} consists of a single digit. +Positional parameters may not be assigned to with assignment statements. +The @code{set} and @code{shift} builtins are used to set and +unset them (@pxref{Shell Builtin Commands}). +The positional parameters are +temporarily replaced when a shell function is executed +(@pxref{Shell Functions}). + +When a positional parameter consisting of more than a single +digit is expanded, it must be enclosed in braces. + +@node Special Parameters +@subsection Special Parameters +@cindex parameters, special + +The shell treats several parameters specially. These parameters may +only be referenced; assignment to them is not allowed. + +@vtable @code + +@item * +@vindex $* +($*) Expands to the positional parameters, starting from one. +When the expansion is not within double quotes, each positional parameter +expands to a separate word. +In contexts where it is performed, those words +are subject to further word splitting and pathname expansion. +When the expansion occurs within double quotes, it expands to a single word +with the value of each parameter separated by the first character +of the @env{IFS} +special variable. That is, @code{"$*"} is equivalent +to @code{"$1@var{c}$2@var{c}@dots{}"}, where @var{c} +is the first character of the value of the @code{IFS} +variable. +If @env{IFS} is unset, the parameters are separated by spaces. +If @env{IFS} is null, the parameters are joined without intervening +separators. + +@item @@ +@vindex $@@ +($@@) Expands to the positional parameters, starting from one. When the +expansion occurs within double quotes, each parameter expands to a +separate word. That is, @code{"$@@"} is equivalent to +@code{"$1" "$2" @dots{}}. +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +When there are no positional parameters, @code{"$@@"} and +@code{$@@} +expand to nothing (i.e., they are removed). + +@item # +@vindex $# +($#) Expands to the number of positional parameters in decimal. + +@item ? +@vindex $? +($?) Expands to the exit status of the most recently executed foreground +pipeline. + +@item - +@vindex $- +($-, a hyphen.) Expands to the current option flags as specified upon +invocation, by the @code{set} +builtin command, or those set by the shell itself +(such as the @option{-i} option). + +@item $ +@vindex $$ +($$) Expands to the process @sc{id} of the shell. In a @code{()} subshell, it +expands to the process @sc{id} of the invoking shell, not the subshell. + +@item ! +@vindex $! +($!) Expands to the process @sc{id} of the job most recently placed into the +background, whether executed as an asynchronous command or using +the @code{bg} builtin (@pxref{Job Control Builtins}). + +@item 0 +@vindex $0 +($0) Expands to the name of the shell or shell script. This is set at +shell initialization. If Bash is invoked with a file of commands +(@pxref{Shell Scripts}), @code{$0} is set to the name of that file. +If Bash is started with the @option{-c} option (@pxref{Invoking Bash}), +then @code{$0} is set to the first argument after the string to be +executed, if one is present. Otherwise, it is set +to the filename used to invoke Bash, as given by argument zero. + +@item _ +@vindex $_ +($_, an underscore.) +At shell startup, set to the absolute pathname used to invoke the +shell or shell script being executed as passed in the environment +or argument list. +Subsequently, expands to the last argument to the previous command, +after expansion. +Also set to the full pathname used to invoke each command executed +and placed in the environment exported to that command. +When checking mail, this parameter holds the name of the mail file. +@end vtable + +@node Shell Expansions +@section Shell Expansions +@cindex expansion + +Expansion is performed on the command line after it has been split into +@code{token}s. There are seven kinds of expansion performed: + +@itemize @bullet +@item brace expansion +@item tilde expansion +@item parameter and variable expansion +@item command substitution +@item arithmetic expansion +@item word splitting +@item filename expansion +@end itemize + +@menu +* Brace Expansion:: Expansion of expressions within braces. +* Tilde Expansion:: Expansion of the ~ character. +* Shell Parameter Expansion:: How Bash expands variables to their values. +* Command Substitution:: Using the output of a command as an argument. +* Arithmetic Expansion:: How to use arithmetic in shell expansions. +* Process Substitution:: A way to write and read to and from a + command. +* Word Splitting:: How the results of expansion are split into separate + arguments. +* Filename Expansion:: A shorthand for specifying filenames matching patterns. +* Quote Removal:: How and when quote characters are removed from + words. +@end menu + +The order of expansions is: +brace expansion; +tilde expansion, parameter and variable expansion, arithmetic expansion, +and command substitution (done in a left-to-right fashion); +word splitting; +and filename expansion. + +On systems that can support it, there is an additional expansion +available: @var{process substitution}. +This is performed at the +same time as tilde, parameter, variable, and arithmetic expansion and +command substitution. + +Only brace expansion, word splitting, and filename expansion +can change the number of words of the expansion; other expansions +expand a single word to a single word. +The only exceptions to this are the expansions of +@code{"$@@"} (@pxref{Special Parameters}) and @code{"$@{@var{name}[@@]@}"} +(@pxref{Arrays}). + +After all expansions, @code{quote removal} (@pxref{Quote Removal}) +is performed. + +@node Brace Expansion +@subsection Brace Expansion +@cindex brace expansion +@cindex expansion, brace + +Brace expansion is a mechanism by which arbitrary strings may be generated. +This mechanism is similar to +@var{filename expansion} (@pxref{Filename Expansion}), +but the filenames generated need not exist. +Patterns to be brace expanded take the form of an optional @var{preamble}, +followed by either a series of comma-separated strings or a sequence expression +between a pair of braces, +followed by an optional @var{postscript}. +The preamble is prefixed to each string contained within the braces, and +the postscript is then appended to each resulting string, expanding left +to right. + +Brace expansions may be nested. +The results of each expanded string are not sorted; left to right order +is preserved. +For example, +@example +bash$ echo a@{d,c,b@}e +ade ace abe +@end example + +A sequence expression takes the form @code{@{@var{x}..@var{y}[..@var{incr}]@}}, +where @var{x} and @var{y} are either integers or single characters, +and @var{incr}, an optional increment, is an integer. +When integers are supplied, the expression expands to each number between +@var{x} and @var{y}, inclusive. +Supplied integers may be prefixed with @samp{0} to force each term to have the +same width. +When either @var{x} or @var{y} begins with a zero, the shell +attempts to force all generated terms to contain the same number of digits, +zero-padding where necessary. +When characters are supplied, the expression expands to each character +lexicographically between @var{x} and @var{y}, inclusive, +using the default C locale. +Note that both @var{x} and @var{y} must be of the same type. +When the increment is supplied, it is used as the difference between +each term. The default increment is 1 or -1 as appropriate. + +Brace expansion is performed before any other expansions, +and any characters special to other expansions are preserved +in the result. It is strictly textual. Bash +does not apply any syntactic interpretation to the context of the +expansion or the text between the braces. +To avoid conflicts with parameter expansion, the string @samp{$@{} +is not considered eligible for brace expansion. + +A correctly-formed brace expansion must contain unquoted opening +and closing braces, and at least one unquoted comma or a valid +sequence expression. +Any incorrectly formed brace expansion is left unchanged. + +A @{ or @samp{,} may be quoted with a backslash to prevent its +being considered part of a brace expression. +To avoid conflicts with parameter expansion, the string @samp{$@{} +is not considered eligible for brace expansion. + +This construct is typically used as shorthand when the common +prefix of the strings to be generated is longer than in the +above example: +@example +mkdir /usr/local/src/bash/@{old,new,dist,bugs@} +@end example +or +@example +chown root /usr/@{ucb/@{ex,edit@},lib/@{ex?.?*,how_ex@}@} +@end example + +@node Tilde Expansion +@subsection Tilde Expansion +@cindex tilde expansion +@cindex expansion, tilde + +If a word begins with an unquoted tilde character (@samp{~}), all of the +characters up to the first unquoted slash (or all characters, +if there is no unquoted slash) are considered a @var{tilde-prefix}. +If none of the characters in the tilde-prefix are quoted, the +characters in the tilde-prefix following the tilde are treated as a +possible @var{login name}. +If this login name is the null string, the tilde is replaced with the +value of the @env{HOME} shell variable. +If @env{HOME} is unset, the home directory of the user executing the +shell is substituted instead. +Otherwise, the tilde-prefix is replaced with the home directory +associated with the specified login name. + +If the tilde-prefix is @samp{~+}, the value of +the shell variable @env{PWD} replaces the tilde-prefix. +If the tilde-prefix is @samp{~-}, the value of the shell variable +@env{OLDPWD}, if it is set, is substituted. + +If the characters following the tilde in the tilde-prefix consist of a +number @var{N}, optionally prefixed by a @samp{+} or a @samp{-}, +the tilde-prefix is replaced with the +corresponding element from the directory stack, as it would be displayed +by the @code{dirs} builtin invoked with the characters following tilde +in the tilde-prefix as an argument (@pxref{The Directory Stack}). +If the tilde-prefix, sans the tilde, consists of a number without a +leading @samp{+} or @samp{-}, @samp{+} is assumed. + +If the login name is invalid, or the tilde expansion fails, the word is +left unchanged. + +Each variable assignment is checked for unquoted tilde-prefixes immediately +following a @samp{:} or the first @samp{=}. +In these cases, tilde expansion is also performed. +Consequently, one may use filenames with tildes in assignments to +@env{PATH}, @env{MAILPATH}, and @env{CDPATH}, +and the shell assigns the expanded value. + +The following table shows how Bash treats unquoted tilde-prefixes: + +@table @code +@item ~ +The value of @code{$HOME} +@item ~/foo +@file{$HOME/foo} + +@item ~fred/foo +The subdirectory @code{foo} of the home directory of the user +@code{fred} + +@item ~+/foo +@file{$PWD/foo} + +@item ~-/foo +@file{$@{OLDPWD-'~-'@}/foo} + +@item ~@var{N} +The string that would be displayed by @samp{dirs +@var{N}} + +@item ~+@var{N} +The string that would be displayed by @samp{dirs +@var{N}} + +@item ~-@var{N} +The string that would be displayed by @samp{dirs -@var{N}} +@end table + +@node Shell Parameter Expansion +@subsection Shell Parameter Expansion +@cindex parameter expansion +@cindex expansion, parameter + +The @samp{$} character introduces parameter expansion, +command substitution, or arithmetic expansion. The parameter name +or symbol to be expanded may be enclosed in braces, which +are optional but serve to protect the variable to be expanded from +characters immediately following it which could be +interpreted as part of the name. + +When braces are used, the matching ending brace is the first @samp{@}} +not escaped by a backslash or within a quoted string, and not within an +embedded arithmetic expansion, command substitution, or parameter +expansion. + +The basic form of parameter expansion is $@{@var{parameter}@}. +The value of @var{parameter} is substituted. +The @var{parameter} is a shell parameter as described above +(@pxref{Shell Parameters}) or an array reference (@pxref{Arrays}). +The braces are required when @var{parameter} +is a positional parameter with more than one digit, +or when @var{parameter} is followed by a character that is not to be +interpreted as part of its name. + +If the first character of @var{parameter} is an exclamation point (!), +it introduces a level of variable indirection. +Bash uses the value of the variable formed from the rest of +@var{parameter} as the name of the variable; this variable is then +expanded and that value is used in the rest of the substitution, rather +than the value of @var{parameter} itself. +This is known as @code{indirect expansion}. +The exceptions to this are the expansions of $@{!@var{prefix}*@} +and $@{!@var{name}[@@]@} +described below. +The exclamation point must immediately follow the left brace in order to +introduce indirection. + +In each of the cases below, @var{word} is subject to tilde expansion, +parameter expansion, command substitution, and arithmetic expansion. + +When not performing substring expansion, using the form described +below (e.g., @samp{:-}), Bash tests for a parameter that is unset or null. +Omitting the colon results in a test only for a parameter that is unset. +Put another way, if the colon is included, +the operator tests for both @var{parameter}'s existence and that its value +is not null; if the colon is omitted, the operator tests only for existence. + +@table @code + +@item $@{@var{parameter}:@minus{}@var{word}@} +If @var{parameter} is unset or null, the expansion of +@var{word} is substituted. Otherwise, the value of +@var{parameter} is substituted. + +@item $@{@var{parameter}:=@var{word}@} +If @var{parameter} +is unset or null, the expansion of @var{word} +is assigned to @var{parameter}. +The value of @var{parameter} is then substituted. +Positional parameters and special parameters may not be assigned to +in this way. + +@item $@{@var{parameter}:?@var{word}@} +If @var{parameter} +is null or unset, the expansion of @var{word} (or a message +to that effect if @var{word} +is not present) is written to the standard error and the shell, if it +is not interactive, exits. Otherwise, the value of @var{parameter} is +substituted. + +@item $@{@var{parameter}:+@var{word}@} +If @var{parameter} +is null or unset, nothing is substituted, otherwise the expansion of +@var{word} is substituted. + +@item $@{@var{parameter}:@var{offset}@} +@itemx $@{@var{parameter}:@var{offset}:@var{length}@} +This is referred to as Substring Expansion. +It expands to up to @var{length} characters of the value of @var{parameter} +starting at the character specified by @var{offset}. +If @var{parameter} is @samp{@@}, an indexed array subscripted by +@samp{@@} or @samp{*}, or an associative array name, the results differ as +described below. +If @var{length} is omitted, it expands to the substring of the value of +@var{parameter} starting at the character specified by @var{offset} +and extending to the end of the value. +@var{length} and @var{offset} are arithmetic expressions +(@pxref{Shell Arithmetic}). + +If @var{offset} evaluates to a number less than zero, the value +is used as an offset in characters +from the end of the value of @var{parameter}. +If @var{length} evaluates to a number less than zero, +it is interpreted as an offset in characters +from the end of the value of @var{parameter} rather than +a number of characters, and the expansion is the characters between +@var{offset} and that result. +Note that a negative offset must be separated from the colon by at least +one space to avoid being confused with the @samp{:-} expansion. + +Here are some examples illustrating substring expansion on parameters and +subscripted arrays: + +@verbatim +$ string=01234567890abcdefgh +$ echo ${string:7} +7890abcdefgh +$ echo ${string:7:0} + +$ echo ${string:7:2} +78 +$ echo ${string:7:-2} +7890abcdef +$ echo ${string: -7} +bcdefgh +$ echo ${string: -7:0} + +$ echo ${string: -7:2} +bc +$ echo ${string: -7:-2} +bcdef +$ set -- 01234567890abcdefgh +$ echo ${1:7} +7890abcdefgh +$ echo ${1:7:0} + +$ echo ${1:7:2} +78 +$ echo ${1:7:-2} +7890abcdef +$ echo ${1: -7} +bcdefgh +$ echo ${1: -7:0} + +$ echo ${1: -7:2} +bc +$ echo ${1: -7:-2} +bcdef +$ array[0]=01234567890abcdefgh +$ echo ${array[0]:7} +7890abcdefgh +$ echo ${array[0]:7:0} + +$ echo ${array[0]:7:2} +78 +$ echo ${array[0]:7:-2} +7890abcdef +$ echo ${array[0]: -7} +bcdefgh +$ echo ${array[0]: -7:0} + +$ echo ${array[0]: -7:2} +bc +$ echo ${array[0]: -7:-2} +bcdef +@end verbatim + +If @var{parameter} is @samp{@@}, the result is @var{length} positional +parameters beginning at @var{offset}. +A negative @var{offset} is taken relative to one greater than the greatest +positional parameter, so an offset of -1 evaluates to the last positional +parameter. +It is an expansion error if @var{length} evaluates to a number less than zero. + +The following examples illustrate substring expansion using positional +parameters: + +@verbatim +$ set -- 1 2 3 4 5 6 7 8 9 0 a b c d e f g h +$ echo ${@:7} +7 8 9 0 a b c d e f g h +$ echo ${@:7:0} + +$ echo ${@:7:2} +7 8 +$ echo ${@:7:-2} +bash: -2: substring expression < 0 +$ echo ${@: -7:2} +b c +$ echo ${@:0} +./bash 1 2 3 4 5 6 7 8 9 0 a b c d e f g h +$ echo ${@:0:2} +./bash 1 +$ echo ${@: -7:0} + +@end verbatim + +If @var{parameter} is an indexed array name subscripted +by @samp{@@} or @samp{*}, the result is the @var{length} +members of the array beginning with @code{$@{@var{parameter}[@var{offset}]@}}. +A negative @var{offset} is taken relative to one greater than the maximum +index of the specified array. +It is an expansion error if @var{length} evaluates to a number less than zero. + +These examples show how you can use substring expansion with indexed +arrays: + +@verbatim +$ array=(0 1 2 3 4 5 6 7 8 9 0 a b c d e f g h) +$ echo ${array[@]:7} +7 8 9 0 a b c d e f g h +$ echo ${array[@]:7:2} +7 8 +$ echo ${array[@]: -7:2} +b c +$ echo ${array[@]: -7:-2} +bash: -2: substring expression < 0 +$ echo ${array[@]:0} +0 1 2 3 4 5 6 7 8 9 0 a b c d e f g h +$ echo ${array[@]:0:2} +0 1 +$ echo ${array[@]: -7:0} + +@end verbatim + +Substring expansion applied to an associative array produces undefined +results. + +Substring indexing is zero-based unless the positional parameters +are used, in which case the indexing starts at 1 by default. +If @var{offset} is 0, and the positional parameters are used, @code{$@@} is +prefixed to the list. + +@item $@{!@var{prefix}*@} +@itemx $@{!@var{prefix}@@@} +Expands to the names of variables whose names begin with @var{prefix}, +separated by the first character of the @env{IFS} special variable. +When @samp{@@} is used and the expansion appears within double quotes, each +variable name expands to a separate word. + +@item $@{!@var{name}[@@]@} +@itemx $@{!@var{name}[*]@} +If @var{name} is an array variable, expands to the list of array indices +(keys) assigned in @var{name}. +If @var{name} is not an array, expands to 0 if @var{name} is set and null +otherwise. +When @samp{@@} is used and the expansion appears within double quotes, each +key expands to a separate word. + +@item $@{#@var{parameter}@} +The length in characters of the expanded value of @var{parameter} is +substituted. +If @var{parameter} is @samp{*} or @samp{@@}, the value substituted +is the number of positional parameters. +If @var{parameter} is an array name subscripted by @samp{*} or @samp{@@}, +the value substituted is the number of elements in the array. +If @var{parameter} +is an indexed array name subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +@var{parameter}, so negative indices count back from the end of the +array, and an index of -1 references the last element. + +@item $@{@var{parameter}#@var{word}@} +@itemx $@{@var{parameter}##@var{word}@} +The @var{word} +is expanded to produce a pattern just as in filename +expansion (@pxref{Filename Expansion}). If the pattern matches +the beginning of the expanded value of @var{parameter}, +then the result of the expansion is the expanded value of @var{parameter} +with the shortest matching pattern (the @samp{#} case) or the +longest matching pattern (the @samp{##} case) deleted. +If @var{parameter} is @samp{@@} or @samp{*}, +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If @var{parameter} is an array variable subscripted with +@samp{@@} or @samp{*}, +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. + +@item $@{@var{parameter}%@var{word}@} +@itemx $@{@var{parameter}%%@var{word}@} +The @var{word} is expanded to produce a pattern just as in +filename expansion. +If the pattern matches a trailing portion of the expanded value of +@var{parameter}, then the result of the expansion is the value of +@var{parameter} with the shortest matching pattern (the @samp{%} case) +or the longest matching pattern (the @samp{%%} case) deleted. +If @var{parameter} is @samp{@@} or @samp{*}, +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If @var{parameter} +is an array variable subscripted with @samp{@@} or @samp{*}, +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. + +@item $@{@var{parameter}/@var{pattern}/@var{string}@} + +The @var{pattern} is expanded to produce a pattern just as in +filename expansion. +@var{Parameter} is expanded and the longest match of @var{pattern} +against its value is replaced with @var{string}. +If @var{pattern} begins with @samp{/}, all matches of @var{pattern} are +replaced with @var{string}. Normally only the first match is replaced. +If @var{pattern} begins with @samp{#}, it must match at the beginning +of the expanded value of @var{parameter}. +If @var{pattern} begins with @samp{%}, it must match at the end +of the expanded value of @var{parameter}. +If @var{string} is null, matches of @var{pattern} are deleted +and the @code{/} following @var{pattern} may be omitted. +If @var{parameter} is @samp{@@} or @samp{*}, +the substitution operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If @var{parameter} +is an array variable subscripted with @samp{@@} or @samp{*}, +the substitution operation is applied to each member of the +array in turn, and the expansion is the resultant list. + +@item $@{@var{parameter}^@var{pattern}@} +@itemx $@{@var{parameter}^^@var{pattern}@} +@itemx $@{@var{parameter},@var{pattern}@} +@itemx $@{@var{parameter},,@var{pattern}@} +This expansion modifies the case of alphabetic characters in @var{parameter}. +The @var{pattern} is expanded to produce a pattern just as in +filename expansion. +Each character in the expanded value of @var{parameter} is tested against +@var{pattern}, and, if it matches the pattern, its case is converted. +The pattern should not attempt to match more than one character. +The @samp{^} operator converts lowercase letters matching @var{pattern} +to uppercase; the @samp{,} operator converts matching uppercase letters +to lowercase. +The @samp{^^} and @samp{,,} expansions convert each matched character in the +expanded value; the @samp{^} and @samp{,} expansions match and convert only +the first character in the expanded value. +If @var{pattern} is omitted, it is treated like a @samp{?}, which matches +every character. +If @var{parameter} is @samp{@@} or @samp{*}, +the case modification operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If @var{parameter} +is an array variable subscripted with @samp{@@} or @samp{*}, +the case modification operation is applied to each member of the +array in turn, and the expansion is the resultant list. +@end table + +@node Command Substitution +@subsection Command Substitution +@cindex command substitution + +Command substitution allows the output of a command to replace +the command itself. +Command substitution occurs when a command is enclosed as follows: +@example +$(@var{command}) +@end example +@noindent +or +@example +`@var{command}` +@end example + +@noindent +Bash performs the expansion by executing @var{command} and +replacing the command substitution with the standard output of the +command, with any trailing newlines deleted. +Embedded newlines are not deleted, but they may be removed during +word splitting. +The command substitution @code{$(cat @var{file})} can be +replaced by the equivalent but faster @code{$(< @var{file})}. + +When the old-style backquote form of substitution is used, +backslash retains its literal meaning except when followed by +@samp{$}, @samp{`}, or @samp{\}. +The first backquote not preceded by a backslash terminates the +command substitution. +When using the @code{$(@var{command})} form, all characters between +the parentheses make up the command; none are treated specially. + +Command substitutions may be nested. To nest when using the backquoted +form, escape the inner backquotes with backslashes. + +If the substitution appears within double quotes, word splitting and +filename expansion are not performed on the results. + +@node Arithmetic Expansion +@subsection Arithmetic Expansion +@cindex expansion, arithmetic +@cindex arithmetic expansion + +Arithmetic expansion allows the evaluation of an arithmetic expression +and the substitution of the result. The format for arithmetic expansion is: + +@example +$(( @var{expression} )) +@end example + +The expression is treated as if it were within double quotes, but +a double quote inside the parentheses is not treated specially. +All tokens in the expression undergo parameter and variable expansion, +command substitution, and quote removal. +The result is treated as the arithmetic expression to be evaluated. +Arithmetic expansions may be nested. + +The evaluation is performed according to the rules listed below +(@pxref{Shell Arithmetic}). +If the expression is invalid, Bash prints a message indicating +failure to the standard error and no substitution occurs. + +@node Process Substitution +@subsection Process Substitution +@cindex process substitution + +Process substitution is supported on systems that support named +pipes (@sc{fifo}s) or the @file{/dev/fd} method of naming open files. +It takes the form of +@example +<(@var{list}) +@end example +@noindent +or +@example +>(@var{list}) +@end example +@noindent +The process @var{list} is run with its input or output connected to a +@sc{fifo} or some file in @file{/dev/fd}. The name of this file is +passed as an argument to the current command as the result of the +expansion. If the @code{>(@var{list})} form is used, writing to +the file will provide input for @var{list}. If the +@code{<(@var{list})} form is used, the file passed as an +argument should be read to obtain the output of @var{list}. +Note that no space may appear between the @code{<} or @code{>} +and the left parenthesis, otherwise the construct would be interpreted +as a redirection. + +When available, process substitution is performed simultaneously with +parameter and variable expansion, command substitution, and arithmetic +expansion. + +@node Word Splitting +@subsection Word Splitting +@cindex word splitting + +The shell scans the results of parameter expansion, command substitution, +and arithmetic expansion that did not occur within double quotes for +word splitting. + +The shell treats each character of @env{$IFS} as a delimiter, and splits +the results of the other expansions into words using these characters +as field terminators. +If @env{IFS} is unset, or its value is exactly @code{}, +the default, then sequences of +@code{ }, @code{}, and @code{} +at the beginning and end of the results of the previous +expansions are ignored, and any sequence of @env{IFS} +characters not at the beginning or end serves to delimit words. +If @env{IFS} has a value other than the default, then sequences of +the whitespace characters @code{space} and @code{tab} +are ignored at the beginning and end of the +word, as long as the whitespace character is in the +value of @env{IFS} (an @env{IFS} whitespace character). +Any character in @env{IFS} that is not @env{IFS} +whitespace, along with any adjacent @env{IFS} +whitespace characters, delimits a field. A sequence of @env{IFS} +whitespace characters is also treated as a delimiter. +If the value of @env{IFS} is null, no word splitting occurs. + +Explicit null arguments (@code{""} or @code{''}) are retained. +Unquoted implicit null arguments, resulting from the expansion of +parameters that have no values, are removed. +If a parameter with no value is expanded within double quotes, a +null argument results and is retained. + +Note that if no expansion occurs, no splitting +is performed. + +@node Filename Expansion +@subsection Filename Expansion +@menu +* Pattern Matching:: How the shell matches patterns. +@end menu +@cindex expansion, filename +@cindex expansion, pathname +@cindex filename expansion +@cindex pathname expansion + +After word splitting, unless the @option{-f} option has been set +(@pxref{The Set Builtin}), Bash scans each word for the characters +@samp{*}, @samp{?}, and @samp{[}. +If one of these characters appears, then the word is +regarded as a @var{pattern}, +and replaced with an alphabetically sorted list of +filenames matching the pattern (@pxref{Pattern Matching}). +If no matching filenames are found, +and the shell option @code{nullglob} is disabled, the word is left +unchanged. +If the @code{nullglob} option is set, and no matches are found, the word +is removed. +If the @code{failglob} shell option is set, and no matches are found, +an error message is printed and the command is not executed. +If the shell option @code{nocaseglob} is enabled, the match is performed +without regard to the case of alphabetic characters. + +When a pattern is used for filename expansion, the character @samp{.} +at the start of a filename or immediately following a slash +must be matched explicitly, unless the shell option @code{dotglob} is set. +When matching a filename, the slash character must always be +matched explicitly. +In other cases, the @samp{.} character is not treated specially. + +See the description of @code{shopt} in @ref{The Shopt Builtin}, +for a description of the @code{nocaseglob}, @code{nullglob}, +@code{failglob}, and @code{dotglob} options. + +The @env{GLOBIGNORE} +shell variable may be used to restrict the set of filenames matching a +pattern. If @env{GLOBIGNORE} +is set, each matching filename that also matches one of the patterns in +@env{GLOBIGNORE} is removed from the list of matches. The filenames +@file{.} and @file{..} +are always ignored when @env{GLOBIGNORE} +is set and not null. +However, setting @env{GLOBIGNORE} to a non-null value has the effect of +enabling the @code{dotglob} +shell option, so all other filenames beginning with a +@samp{.} will match. +To get the old behavior of ignoring filenames beginning with a +@samp{.}, make @samp{.*} one of the patterns in @env{GLOBIGNORE}. +The @code{dotglob} option is disabled when @env{GLOBIGNORE} +is unset. + +@node Pattern Matching +@subsubsection Pattern Matching +@cindex pattern matching +@cindex matching, pattern + +Any character that appears in a pattern, other than the special pattern +characters described below, matches itself. +The @sc{nul} character may not occur in a pattern. +A backslash escapes the following character; the +escaping backslash is discarded when matching. +The special pattern characters must be quoted if they are to be matched +literally. + +The special pattern characters have the following meanings: +@table @code +@item * +Matches any string, including the null string. +When the @code{globstar} shell option is enabled, and @samp{*} is used in +a filename expansion context, two adjacent @samp{*}s used as a single +pattern will match all files and zero or more directories and +subdirectories. +If followed by a @samp{/}, two adjacent @samp{*}s will match only +directories and subdirectories. +@item ? +Matches any single character. +@item [@dots{}] +Matches any one of the enclosed characters. A pair of characters +separated by a hyphen denotes a @var{range expression}; +any character that falls between those two characters, inclusive, +using the current locale's collating sequence and character set, +is matched. If the first character following the +@samp{[} is a @samp{!} or a @samp{^} +then any character not enclosed is matched. A @samp{@minus{}} +may be matched by including it as the first or last character +in the set. A @samp{]} may be matched by including it as the first +character in the set. +The sorting order of characters in range expressions is determined by +the current locale and the values of the +@env{LC_COLLATE} and @env{LC_ALL} shell variables, if set. + +For example, in the default C locale, @samp{[a-dx-z]} is equivalent to +@samp{[abcdxyz]}. Many locales sort characters in dictionary order, and in +these locales @samp{[a-dx-z]} is typically not equivalent to @samp{[abcdxyz]}; +it might be equivalent to @samp{[aBbCcDdxXyYz]}, for example. To obtain +the traditional interpretation of ranges in bracket expressions, you can +force the use of the C locale by setting the @env{LC_COLLATE} or +@env{LC_ALL} environment variable to the value @samp{C}, or enable the +@code{globasciiranges} shell option. + +Within @samp{[} and @samp{]}, @var{character classes} can be specified +using the syntax +@code{[:}@var{class}@code{:]}, where @var{class} is one of the +following classes defined in the @sc{posix} standard: +@example +alnum alpha ascii blank cntrl digit graph lower +print punct space upper word xdigit +@end example +@noindent +A character class matches any character belonging to that class. +The @code{word} character class matches letters, digits, and the character +@samp{_}. + +Within @samp{[} and @samp{]}, an @var{equivalence class} can be +specified using the syntax @code{[=}@var{c}@code{=]}, which +matches all characters with the same collation weight (as defined +by the current locale) as the character @var{c}. + +Within @samp{[} and @samp{]}, the syntax @code{[.}@var{symbol}@code{.]} +matches the collating symbol @var{symbol}. +@end table + +If the @code{extglob} shell option is enabled using the @code{shopt} +builtin, several extended pattern matching operators are recognized. +In the following description, a @var{pattern-list} is a list of one +or more patterns separated by a @samp{|}. +Composite patterns may be formed using one or more of the following +sub-patterns: + +@table @code +@item ?(@var{pattern-list}) +Matches zero or one occurrence of the given patterns. + +@item *(@var{pattern-list}) +Matches zero or more occurrences of the given patterns. + +@item +(@var{pattern-list}) +Matches one or more occurrences of the given patterns. + +@item @@(@var{pattern-list}) +Matches one of the given patterns. + +@item !(@var{pattern-list}) +Matches anything except one of the given patterns. +@end table + +@node Quote Removal +@subsection Quote Removal + +After the preceding expansions, all unquoted occurrences of the +characters @samp{\}, @samp{'}, and @samp{"} that did not +result from one of the above expansions are removed. + +@node Redirections +@section Redirections +@cindex redirection + +Before a command is executed, its input and output +may be @var{redirected} +using a special notation interpreted by the shell. +Redirection allows commands' file handles to be +duplicated, opened, closed, +made to refer to different files, +and can change the files the command reads from and writes to. +Redirection may also be used to modify file handles in the +current shell execution environment. The following redirection +operators may precede or appear anywhere within a +simple command or may follow a command. +Redirections are processed in the order they appear, from +left to right. + +Each redirection that may be preceded by a file descriptor number +may instead be preceded by a word of the form @{@var{varname}@}. +In this case, for each redirection operator except +>&- and <&-, the shell will allocate a file descriptor greater +than 10 and assign it to @{@var{varname}@}. If >&- or <&- is preceded +by @{@var{varname}@}, the value of @var{varname} defines the file +descriptor to close. + +In the following descriptions, if the file descriptor number is +omitted, and the first character of the redirection operator is +@samp{<}, the redirection refers to the standard input (file +descriptor 0). If the first character of the redirection operator +is @samp{>}, the redirection refers to the standard output (file +descriptor 1). + +The word following the redirection operator in the following +descriptions, unless otherwise noted, is subjected to brace expansion, +tilde expansion, parameter expansion, command substitution, arithmetic +expansion, quote removal, filename expansion, and word splitting. +If it expands to more than one word, Bash reports an error. + +Note that the order of redirections is significant. For example, +the command +@example +ls > @var{dirlist} 2>&1 +@end example +@noindent +directs both standard output (file descriptor 1) and standard error +(file descriptor 2) to the file @var{dirlist}, while the command +@example +ls 2>&1 > @var{dirlist} +@end example +@noindent +directs only the standard output to file @var{dirlist}, +because the standard error was made a copy of the standard output +before the standard output was redirected to @var{dirlist}. + +Bash handles several filenames specially when they are used in +redirections, as described in the following table: + +@table @code +@item /dev/fd/@var{fd} +If @var{fd} is a valid integer, file descriptor @var{fd} is duplicated. + +@item /dev/stdin +File descriptor 0 is duplicated. + +@item /dev/stdout +File descriptor 1 is duplicated. + +@item /dev/stderr +File descriptor 2 is duplicated. + +@item /dev/tcp/@var{host}/@var{port} +If @var{host} is a valid hostname or Internet address, and @var{port} +is an integer port number or service name, Bash attempts to open +the corresponding TCP socket. + +@item /dev/udp/@var{host}/@var{port} +If @var{host} is a valid hostname or Internet address, and @var{port} +is an integer port number or service name, Bash attempts to open +the corresponding UDP socket. +@end table + +A failure to open or create a file causes the redirection to fail. + +Redirections using file descriptors greater than 9 should be used with +care, as they may conflict with file descriptors the shell uses +internally. + +@subsection Redirecting Input +Redirection of input causes the file whose name results from +the expansion of @var{word} +to be opened for reading on file descriptor @code{n}, +or the standard input (file descriptor 0) if @code{n} +is not specified. + +The general format for redirecting input is: +@example +[@var{n}]<@var{word} +@end example + +@subsection Redirecting Output +Redirection of output causes the file whose name results from +the expansion of @var{word} +to be opened for writing on file descriptor @var{n}, +or the standard output (file descriptor 1) if @var{n} +is not specified. If the file does not exist it is created; +if it does exist it is truncated to zero size. + +The general format for redirecting output is: +@example +[@var{n}]>[|]@var{word} +@end example + +If the redirection operator is @samp{>}, and the @code{noclobber} +option to the @code{set} builtin has been enabled, the redirection +will fail if the file whose name results from the expansion of +@var{word} exists and is a regular file. +If the redirection operator is @samp{>|}, or the redirection operator is +@samp{>} and the @code{noclobber} option is not enabled, the redirection +is attempted even if the file named by @var{word} exists. + +@subsection Appending Redirected Output +Redirection of output in this fashion +causes the file whose name results from +the expansion of @var{word} +to be opened for appending on file descriptor @var{n}, +or the standard output (file descriptor 1) if @var{n} +is not specified. If the file does not exist it is created. + +The general format for appending output is: +@example +[@var{n}]>>@var{word} +@end example + +@subsection Redirecting Standard Output and Standard Error +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be redirected to the file whose name is the +expansion of @var{word}. + +There are two formats for redirecting standard output and +standard error: +@example +&>@var{word} +@end example +@noindent +and +@example +>&@var{word} +@end example +@noindent +Of the two forms, the first is preferred. +This is semantically equivalent to +@example +>@var{word} 2>&1 +@end example +When using the second form, @var{word} may not expand to a number or +@samp{-}. If it does, other redirection operators apply +(see Duplicating File Descriptors below) for compatibility reasons. + +@subsection Appending Standard Output and Standard Error +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be appended to the file whose name is the +expansion of @var{word}. + +The format for appending standard output and standard error is: +@example +&>>@var{word} +@end example +@noindent +This is semantically equivalent to +@example +>>@var{word} 2>&1 +@end example +(see Duplicating File Descriptors below). + +@subsection Here Documents +This type of redirection instructs the shell to read input from the +current source until a line containing only @var{word} +(with no trailing blanks) is seen. All of +the lines read up to that point are then used as the standard +input for a command. + +The format of here-documents is: +@example +<<[@minus{}]@var{word} + @var{here-document} +@var{delimiter} +@end example + +No parameter and variable expansion, command substitution, +arithmetic expansion, or filename expansion is performed on +@var{word}. If any characters in @var{word} are quoted, the +@var{delimiter} is the result of quote removal on @var{word}, +and the lines in the here-document are not expanded. +If @var{word} is unquoted, +all lines of the here-document are subjected to +parameter expansion, command substitution, and arithmetic expansion, +the character sequence @code{\newline} is ignored, and @samp{\} +must be used to quote the characters +@samp{\}, @samp{$}, and @samp{`}. + +If the redirection operator is @samp{<<-}, +then all leading tab characters are stripped from input lines and the +line containing @var{delimiter}. +This allows here-documents within shell scripts to be indented in a +natural fashion. + +@subsection Here Strings +A variant of here documents, the format is: +@example +<<< @var{word} +@end example + +The @var{word} undergoes +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote removal. +Pathname expansion and word splitting are not performed. +The result is supplied as a single string to the command on its +standard input. + +@subsection Duplicating File Descriptors +The redirection operator +@example +[@var{n}]<&@var{word} +@end example +@noindent +is used to duplicate input file descriptors. +If @var{word} +expands to one or more digits, the file descriptor denoted by @var{n} +is made to be a copy of that file descriptor. +If the digits in @var{word} do not specify a file descriptor open for +input, a redirection error occurs. +If @var{word} +evaluates to @samp{-}, file descriptor @var{n} is closed. +If @var{n} is not specified, the standard input (file descriptor 0) is used. + +The operator +@example +[@var{n}]>&@var{word} +@end example +@noindent +is used similarly to duplicate output file descriptors. If +@var{n} is not specified, the standard output (file descriptor 1) is used. +If the digits in @var{word} do not specify a file descriptor open for +output, a redirection error occurs. +If @var{word} +evaluates to @samp{-}, file descriptor @var{n} is closed. +As a special case, if @var{n} is omitted, and @var{word} does not +expand to one or more digits or @samp{-}, the standard output and standard +error are redirected as described previously. + +@subsection Moving File Descriptors +The redirection operator +@example +[@var{n}]<&@var{digit}- +@end example +@noindent +moves the file descriptor @var{digit} to file descriptor @var{n}, +or the standard input (file descriptor 0) if @var{n} is not specified. +@var{digit} is closed after being duplicated to @var{n}. + +Similarly, the redirection operator +@example +[@var{n}]>&@var{digit}- +@end example +@noindent +moves the file descriptor @var{digit} to file descriptor @var{n}, +or the standard output (file descriptor 1) if @var{n} is not specified. + +@subsection Opening File Descriptors for Reading and Writing +The redirection operator +@example +[@var{n}]<>@var{word} +@end example +@noindent +causes the file whose name is the expansion of @var{word} +to be opened for both reading and writing on file descriptor +@var{n}, or on file descriptor 0 if @var{n} +is not specified. If the file does not exist, it is created. + +@node Executing Commands +@section Executing Commands + +@menu +* Simple Command Expansion:: How Bash expands simple commands before + executing them. +* Command Search and Execution:: How Bash finds commands and runs them. +* Command Execution Environment:: The environment in which Bash + executes commands that are not + shell builtins. +* Environment:: The environment given to a command. +* Exit Status:: The status returned by commands and how Bash + interprets it. +* Signals:: What happens when Bash or a command it runs + receives a signal. +@end menu + +@node Simple Command Expansion +@subsection Simple Command Expansion +@cindex command expansion + +When a simple command is executed, the shell performs the following +expansions, assignments, and redirections, from left to right. + +@enumerate +@item +The words that the parser has marked as variable assignments (those +preceding the command name) and redirections are saved for later +processing. + +@item +The words that are not variable assignments or redirections are +expanded (@pxref{Shell Expansions}). +If any words remain after expansion, the first word +is taken to be the name of the command and the remaining words are +the arguments. + +@item +Redirections are performed as described above (@pxref{Redirections}). + +@item +The text after the @samp{=} in each variable assignment undergoes tilde +expansion, parameter expansion, command substitution, arithmetic expansion, +and quote removal before being assigned to the variable. +@end enumerate + +If no command name results, the variable assignments affect the current +shell environment. Otherwise, the variables are added to the environment +of the executed command and do not affect the current shell environment. +If any of the assignments attempts to assign a value to a readonly variable, +an error occurs, and the command exits with a non-zero status. + +If no command name results, redirections are performed, but do not +affect the current shell environment. A redirection error causes the +command to exit with a non-zero status. + +If there is a command name left after expansion, execution proceeds as +described below. Otherwise, the command exits. If one of the expansions +contained a command substitution, the exit status of the command is +the exit status of the last command substitution performed. If there +were no command substitutions, the command exits with a status of zero. + +@node Command Search and Execution +@subsection Command Search and Execution +@cindex command execution +@cindex command search + +After a command has been split into words, if it results in a +simple command and an optional list of arguments, the following +actions are taken. + +@enumerate +@item +If the command name contains no slashes, the shell attempts to +locate it. If there exists a shell function by that name, that +function is invoked as described in @ref{Shell Functions}. + +@item +If the name does not match a function, the shell searches for +it in the list of shell builtins. If a match is found, that +builtin is invoked. + +@item +If the name is neither a shell function nor a builtin, +and contains no slashes, Bash searches each element of +@env{$PATH} for a directory containing an executable file +by that name. Bash uses a hash table to remember the full +pathnames of executable files to avoid multiple @env{PATH} searches +(see the description of @code{hash} in @ref{Bourne Shell Builtins}). +A full search of the directories in @env{$PATH} +is performed only if the command is not found in the hash table. +If the search is unsuccessful, the shell searches for a defined shell +function named @code{command_not_found_handle}. +If that function exists, it is invoked with the original command and +the original command's arguments as its arguments, and the function's +exit status becomes the exit status of the shell. +If that function is not defined, the shell prints an error +message and returns an exit status of 127. + +@item +If the search is successful, or if the command name contains +one or more slashes, the shell executes the named program in +a separate execution environment. +Argument 0 is set to the name given, and the remaining arguments +to the command are set to the arguments supplied, if any. + +@item +If this execution fails because the file is not in executable +format, and the file is not a directory, it is assumed to be a +@var{shell script} and the shell executes it as described in +@ref{Shell Scripts}. + +@item +If the command was not begun asynchronously, the shell waits for +the command to complete and collects its exit status. + +@end enumerate + +@node Command Execution Environment +@subsection Command Execution Environment +@cindex execution environment + +The shell has an @var{execution environment}, which consists of the +following: + +@itemize @bullet +@item +open files inherited by the shell at invocation, as modified by +redirections supplied to the @code{exec} builtin + +@item +the current working directory as set by @code{cd}, @code{pushd}, or +@code{popd}, or inherited by the shell at invocation + +@item +the file creation mode mask as set by @code{umask} or inherited from +the shell's parent + +@item +current traps set by @code{trap} + +@item +shell parameters that are set by variable assignment or with @code{set} +or inherited from the shell's parent in the environment + +@item +shell functions defined during execution or inherited from the shell's +parent in the environment + +@item +options enabled at invocation (either by default or with command-line +arguments) or by @code{set} + +@item +options enabled by @code{shopt} (@pxref{The Shopt Builtin}) + +@item +shell aliases defined with @code{alias} (@pxref{Aliases}) + +@item +various process @sc{id}s, including those of background jobs +(@pxref{Lists}), the value of @code{$$}, and the value of +@env{$PPID} + +@end itemize + +When a simple command other than a builtin or shell function +is to be executed, it +is invoked in a separate execution environment that consists of +the following. Unless otherwise noted, the values are inherited +from the shell. + +@itemize @bullet +@item +the shell's open files, plus any modifications and additions specified +by redirections to the command + +@item +the current working directory + +@item +the file creation mode mask + +@item +shell variables and functions marked for export, along with variables +exported for the command, passed in the environment (@pxref{Environment}) + +@item +traps caught by the shell are reset to the values inherited from the +shell's parent, and traps ignored by the shell are ignored + +@end itemize + +A command invoked in this separate environment cannot affect the +shell's execution environment. + +Command substitution, commands grouped with parentheses, +and asynchronous commands are invoked in a +subshell environment that is a duplicate of the shell environment, +except that traps caught by the shell are reset to the values +that the shell inherited from its parent at invocation. Builtin +commands that are invoked as part of a pipeline are also executed +in a subshell environment. Changes made to the subshell environment +cannot affect the shell's execution environment. + +Subshells spawned to execute command substitutions inherit the value of +the @option{-e} option from the parent shell. When not in @sc{posix} mode, +Bash clears the @option{-e} option in such subshells. + +If a command is followed by a @samp{&} and job control is not active, the +default standard input for the command is the empty file @file{/dev/null}. +Otherwise, the invoked command inherits the file descriptors of the calling +shell as modified by redirections. + +@node Environment +@subsection Environment +@cindex environment + +When a program is invoked it is given an array of strings +called the @var{environment}. +This is a list of name-value pairs, of the form @code{name=value}. + +Bash provides several ways to manipulate the environment. +On invocation, the shell scans its own environment and +creates a parameter for each name found, automatically marking +it for @var{export} +to child processes. Executed commands inherit the environment. +The @code{export} and @samp{declare -x} +commands allow parameters and functions to be added to and +deleted from the environment. If the value of a parameter +in the environment is modified, the new value becomes part +of the environment, replacing the old. The environment +inherited by any executed command consists of the shell's +initial environment, whose values may be modified in the shell, +less any pairs removed by the @code{unset} and @samp{export -n} +commands, plus any additions via the @code{export} and +@samp{declare -x} commands. + +The environment for any simple command +or function may be augmented temporarily by prefixing it with +parameter assignments, as described in @ref{Shell Parameters}. +These assignment statements affect only the environment seen +by that command. + +If the @option{-k} option is set (@pxref{The Set Builtin}), then all +parameter assignments are placed in the environment for a command, +not just those that precede the command name. + +When Bash invokes an external command, the variable @samp{$_} +is set to the full pathname of the command and passed to that +command in its environment. + +@node Exit Status +@subsection Exit Status +@cindex exit status + +The exit status of an executed command is the value returned by the +@var{waitpid} system call or equivalent function. Exit statuses +fall between 0 and 255, though, as explained below, the shell may +use values above 125 specially. Exit statuses from shell builtins and +compound commands are also limited to this range. Under certain +circumstances, the shell will use special values to indicate specific +failure modes. + +For the shell's purposes, a command which exits with a +zero exit status has succeeded. +A non-zero exit status indicates failure. +This seemingly counter-intuitive scheme is used so there +is one well-defined way to indicate success and a variety of +ways to indicate various failure modes. +When a command terminates on a fatal signal whose number is @var{N}, +Bash uses the value 128+@var{N} as the exit status. + +If a command is not found, the child process created to +execute it returns a status of 127. If a command is found +but is not executable, the return status is 126. + +If a command fails because of an error during expansion or redirection, +the exit status is greater than zero. + +The exit status is used by the Bash conditional commands +(@pxref{Conditional Constructs}) and some of the list +constructs (@pxref{Lists}). + +All of the Bash builtins return an exit status of zero if they succeed +and a non-zero status on failure, so they may be used by the +conditional and list constructs. +All builtins return an exit status of 2 to indicate incorrect usage. + +@node Signals +@subsection Signals +@cindex signal handling + +When Bash is interactive, in the absence of any traps, it ignores +@code{SIGTERM} (so that @samp{kill 0} does not kill an interactive shell), +and @code{SIGINT} +is caught and handled (so that the @code{wait} builtin is interruptible). +When Bash receives a @code{SIGINT}, it breaks out of any executing loops. +In all cases, Bash ignores @code{SIGQUIT}. +If job control is in effect (@pxref{Job Control}), Bash +ignores @code{SIGTTIN}, @code{SIGTTOU}, and @code{SIGTSTP}. + +Non-builtin commands started by Bash have signal handlers set to the +values inherited by the shell from its parent. +When job control is not in effect, asynchronous commands +ignore @code{SIGINT} and @code{SIGQUIT} in addition to these inherited +handlers. +Commands run as a result of +command substitution ignore the keyboard-generated job control signals +@code{SIGTTIN}, @code{SIGTTOU}, and @code{SIGTSTP}. + +The shell exits by default upon receipt of a @code{SIGHUP}. +Before exiting, an interactive shell resends the @code{SIGHUP} to +all jobs, running or stopped. +Stopped jobs are sent @code{SIGCONT} to ensure that they receive +the @code{SIGHUP}. +To prevent the shell from sending the @code{SIGHUP} signal to a +particular job, it should be removed +from the jobs table with the @code{disown} +builtin (@pxref{Job Control Builtins}) or marked +to not receive @code{SIGHUP} using @code{disown -h}. + +If the @code{huponexit} shell option has been set with @code{shopt} +(@pxref{The Shopt Builtin}), Bash sends a @code{SIGHUP} to all jobs when +an interactive login shell exits. + +If Bash is waiting for a command to complete and receives a signal +for which a trap has been set, the trap will not be executed until +the command completes. +When Bash is waiting for an asynchronous +command via the @code{wait} builtin, the reception of a signal for +which a trap has been set will cause the @code{wait} builtin to return +immediately with an exit status greater than 128, immediately after +which the trap is executed. + +@node Shell Scripts +@section Shell Scripts +@cindex shell script + +A shell script is a text file containing shell commands. When such +a file is used as the first non-option argument when invoking Bash, +and neither the @option{-c} nor @option{-s} option is supplied +(@pxref{Invoking Bash}), +Bash reads and executes commands from the file, then exits. This +mode of operation creates a non-interactive shell. The shell first +searches for the file in the current directory, and looks in the +directories in @env{$PATH} if not found there. + +When Bash runs +a shell script, it sets the special parameter @code{0} to the name +of the file, rather than the name of the shell, and the positional +parameters are set to the remaining arguments, if any are given. +If no additional arguments are supplied, the positional parameters +are unset. + +A shell script may be made executable by using the @code{chmod} command +to turn on the execute bit. When Bash finds such a file while +searching the @env{$PATH} for a command, it spawns a subshell to +execute it. In other words, executing +@example +filename @var{arguments} +@end example +@noindent +is equivalent to executing +@example +bash filename @var{arguments} +@end example + +@noindent +if @code{filename} is an executable shell script. +This subshell reinitializes itself, so that the effect is as if a +new shell had been invoked to interpret the script, with the +exception that the locations of commands remembered by the parent +(see the description of @code{hash} in @ref{Bourne Shell Builtins}) +are retained by the child. + +Most versions of Unix make this a part of the operating system's command +execution mechanism. If the first line of a script begins with +the two characters @samp{#!}, the remainder of the line specifies +an interpreter for the program. +Thus, you can specify Bash, @code{awk}, Perl, or some other +interpreter and write the rest of the script file in that language. + +The arguments to the interpreter +consist of a single optional argument following the interpreter +name on the first line of the script file, followed by the name of +the script file, followed by the rest of the arguments. Bash +will perform this action on operating systems that do not handle it +themselves. Note that some older versions of Unix limit the interpreter +name and argument to a maximum of 32 characters. + +Bash scripts often begin with @code{#! /bin/bash} (assuming that +Bash has been installed in @file{/bin}), since this ensures that +Bash will be used to interpret the script, even if it is executed +under another shell. + +@node Shell Builtin Commands +@chapter Shell Builtin Commands + +@menu +* Bourne Shell Builtins:: Builtin commands inherited from the Bourne + Shell. +* Bash Builtins:: Table of builtins specific to Bash. +* Modifying Shell Behavior:: Builtins to modify shell attributes and + optional behavior. +* Special Builtins:: Builtin commands classified specially by + POSIX. +@end menu + +Builtin commands are contained within the shell itself. +When the name of a builtin command is used as the first word of +a simple command (@pxref{Simple Commands}), the shell executes +the command directly, without invoking another program. +Builtin commands are necessary to implement functionality impossible +or inconvenient to obtain with separate utilities. + +This section briefly describes the builtins which Bash inherits from +the Bourne Shell, as well as the builtin commands which are unique +to or have been extended in Bash. + +Several builtin commands are described in other chapters: builtin +commands which provide the Bash interface to the job control +facilities (@pxref{Job Control Builtins}), the directory stack +(@pxref{Directory Stack Builtins}), the command history +(@pxref{Bash History Builtins}), and the programmable completion +facilities (@pxref{Programmable Completion Builtins}). + +Many of the builtins have been extended by @sc{posix} or Bash. + +Unless otherwise noted, each builtin command documented as accepting +options preceded by @samp{-} accepts @samp{--} +to signify the end of the options. +The @code{:}, @code{true}, @code{false}, and @code{test} +builtins do not accept options and do not treat @samp{--} specially. +The @code{exit}, @code{logout}, @code{break}, @code{continue}, @code{let}, +and @code{shift} builtins accept and process arguments beginning +with @samp{-} without requiring @samp{--}. +Other builtins that accept arguments but are not specified as accepting +options interpret arguments beginning with @samp{-} as invalid options and +require @samp{--} to prevent this interpretation. + +@node Bourne Shell Builtins +@section Bourne Shell Builtins + +The following shell builtin commands are inherited from the Bourne Shell. +These commands are implemented as specified by the @sc{posix} standard. + +@table @code +@item : @r{(a colon)} +@btindex : +@example +: [@var{arguments}] +@end example + +Do nothing beyond expanding @var{arguments} and performing redirections. +The return status is zero. + +@item . @r{(a period)} +@btindex . +@example +. @var{filename} [@var{arguments}] +@end example + +Read and execute commands from the @var{filename} argument in the +current shell context. If @var{filename} does not contain a slash, +the @env{PATH} variable is used to find @var{filename}. +When Bash is not in @sc{posix} mode, the current directory is searched +if @var{filename} is not found in @env{$PATH}. +If any @var{arguments} are supplied, they become the positional +parameters when @var{filename} is executed. Otherwise the positional +parameters are unchanged. +The return status is the exit status of the last command executed, or +zero if no commands are executed. If @var{filename} is not found, or +cannot be read, the return status is non-zero. +This builtin is equivalent to @code{source}. + +@item break +@btindex break +@example +break [@var{n}] +@end example + +Exit from a @code{for}, @code{while}, @code{until}, or @code{select} loop. +If @var{n} is supplied, the @var{n}th enclosing loop is exited. +@var{n} must be greater than or equal to 1. +The return status is zero unless @var{n} is not greater than or equal to 1. + +@item cd +@btindex cd +@example +cd [-L|[-P [-e]] [-@@] [@var{directory}] +@end example + +Change the current working directory to @var{directory}. +If @var{directory} is not supplied, the value of the @env{HOME} +shell variable is used. +Any additional arguments following @var{directory} are ignored. +If the shell variable +@env{CDPATH} exists, it is used as a search path: +each directory name in @env{CDPATH} is searched for +@var{directory}, with alternative directory names in @env{CDPATH} +separated by a colon (@samp{:}). +If @var{directory} begins with a slash, @env{CDPATH} is not used. + +The @option{-P} option means to not follow symbolic links: symbolic links +are resolved while @code{cd} is traversing @var{directory} and before +processing an instance of @samp{..} in @var{directory}. + +By default, or when the @option{-L} option is supplied, symbolic links +in @var{directory} are resolved after @code{cd} processes an instance +of @samp{..} in @var{directory}. + +If @samp{..} appears in @var{directory}, it is processed by removing the +immediately preceding pathname component, back to a slash or the beginning +of @var{directory}. + +If the @option{-e} option is supplied with @option{-P} +and the current working directory cannot be successfully determined +after a successful directory change, @code{cd} will return an unsuccessful +status. + +On systems that support it, the @option{-@@} option presents the extended +attributes associated with a file as a directory. + +If @var{directory} is @samp{-}, it is converted to @env{$OLDPWD} +before the directory change is attempted. + +If a non-empty directory name from @env{CDPATH} is used, or if +@samp{-} is the first argument, and the directory change is +successful, the absolute pathname of the new working directory is +written to the standard output. + +The return status is zero if the directory is successfully changed, +non-zero otherwise. + +@item continue +@btindex continue +@example +continue [@var{n}] +@end example + +Resume the next iteration of an enclosing @code{for}, @code{while}, +@code{until}, or @code{select} loop. +If @var{n} is supplied, the execution of the @var{n}th enclosing loop +is resumed. +@var{n} must be greater than or equal to 1. +The return status is zero unless @var{n} is not greater than or equal to 1. + +@item eval +@btindex eval +@example +eval [@var{arguments}] +@end example + +The arguments are concatenated together into a single command, which is +then read and executed, and its exit status returned as the exit status +of @code{eval}. +If there are no arguments or only empty arguments, the return status is +zero. + +@item exec +@btindex exec +@example +exec [-cl] [-a @var{name}] [@var{command} [@var{arguments}]] +@end example + +If @var{command} +is supplied, it replaces the shell without creating a new process. +If the @option{-l} option is supplied, the shell places a dash at the +beginning of the zeroth argument passed to @var{command}. +This is what the @code{login} program does. +The @option{-c} option causes @var{command} to be executed with an empty +environment. +If @option{-a} is supplied, the shell passes @var{name} as the zeroth +argument to @var{command}. +If @var{command} +cannot be executed for some reason, a non-interactive shell exits, +unless the @code{execfail} shell option +is enabled. In that case, it returns failure. +An interactive shell returns failure if the file cannot be executed. +If no @var{command} is specified, redirections may be used to affect +the current shell environment. If there are no redirection errors, the +return status is zero; otherwise the return status is non-zero. + +@item exit +@btindex exit +@example +exit [@var{n}] +@end example + +Exit the shell, returning a status of @var{n} to the shell's parent. +If @var{n} is omitted, the exit status is that of the last command executed. +Any trap on @code{EXIT} is executed before the shell terminates. + +@item export +@btindex export +@example +export [-fn] [-p] [@var{name}[=@var{value}]] +@end example + +Mark each @var{name} to be passed to child processes +in the environment. If the @option{-f} option is supplied, the @var{name}s +refer to shell functions; otherwise the names refer to shell variables. +The @option{-n} option means to no longer mark each @var{name} for export. +If no @var{names} are supplied, or if the @option{-p} option is given, a +list of names of all exported variables is displayed. +The @option{-p} option displays output in a form that may be reused as input. +If a variable name is followed by =@var{value}, the value of +the variable is set to @var{value}. + +The return status is zero unless an invalid option is supplied, one of +the names is not a valid shell variable name, or @option{-f} is supplied +with a name that is not a shell function. + +@item getopts +@btindex getopts +@example +getopts @var{optstring} @var{name} [@var{args}] +@end example + +@code{getopts} is used by shell scripts to parse positional parameters. +@var{optstring} contains the option characters to be recognized; if a +character is followed by a colon, the option is expected to have an +argument, which should be separated from it by whitespace. +The colon (@samp{:}) and question mark (@samp{?}) may not be +used as option characters. +Each time it is invoked, @code{getopts} +places the next option in the shell variable @var{name}, initializing +@var{name} if it does not exist, +and the index of the next argument to be processed into the +variable @env{OPTIND}. +@env{OPTIND} is initialized to 1 each time the shell or a shell script +is invoked. +When an option requires an argument, +@code{getopts} places that argument into the variable @env{OPTARG}. +The shell does not reset @env{OPTIND} automatically; it must be manually +reset between multiple calls to @code{getopts} within the same shell +invocation if a new set of parameters is to be used. + +When the end of options is encountered, @code{getopts} exits with a +return value greater than zero. +@env{OPTIND} is set to the index of the first non-option argument, +and @var{name} is set to @samp{?}. + +@code{getopts} +normally parses the positional parameters, but if more arguments are +given in @var{args}, @code{getopts} parses those instead. + +@code{getopts} can report errors in two ways. If the first character of +@var{optstring} is a colon, @var{silent} +error reporting is used. In normal operation, diagnostic messages +are printed when invalid options or missing option arguments are +encountered. +If the variable @env{OPTERR} +is set to 0, no error messages will be displayed, even if the first +character of @code{optstring} is not a colon. + +If an invalid option is seen, +@code{getopts} places @samp{?} into @var{name} and, if not silent, +prints an error message and unsets @env{OPTARG}. +If @code{getopts} is silent, the option character found is placed in +@env{OPTARG} and no diagnostic message is printed. + +If a required argument is not found, and @code{getopts} +is not silent, a question mark (@samp{?}) is placed in @var{name}, +@code{OPTARG} is unset, and a diagnostic message is printed. +If @code{getopts} is silent, then a colon (@samp{:}) is placed in +@var{name} and @env{OPTARG} is set to the option character found. + +@item hash +@btindex hash +@example +hash [-r] [-p @var{filename}] [-dt] [@var{name}] +@end example + +Each time @code{hash} is invoked, it remembers the full pathnames of the +commands specified as @var{name} arguments, +so they need not be searched for on subsequent invocations. +The commands are found by searching through the directories listed in +@env{$PATH}. +Any previously-remembered pathname is discarded. +The @option{-p} option inhibits the path search, and @var{filename} is +used as the location of @var{name}. +The @option{-r} option causes the shell to forget all remembered locations. +The @option{-d} option causes the shell to forget the remembered location +of each @var{name}. +If the @option{-t} option is supplied, the full pathname to which each +@var{name} corresponds is printed. If multiple @var{name} arguments are +supplied with @option{-t} the @var{name} is printed before the hashed +full pathname. +The @option{-l} option causes output to be displayed in a format +that may be reused as input. +If no arguments are given, or if only @option{-l} is supplied, +information about remembered commands is printed. +The return status is zero unless a @var{name} is not found or an invalid +option is supplied. + +@item pwd +@btindex pwd +@example +pwd [-LP] +@end example + +Print the absolute pathname of the current working directory. +If the @option{-P} option is supplied, the pathname printed will not +contain symbolic links. +If the @option{-L} option is supplied, the pathname printed may contain +symbolic links. +The return status is zero unless an error is encountered while +determining the name of the current directory or an invalid option +is supplied. + +@item readonly +@btindex readonly +@example +readonly [-aAf] [-p] [@var{name}[=@var{value}]] @dots{} +@end example + +Mark each @var{name} as readonly. +The values of these names may not be changed by subsequent assignment. +If the @option{-f} option is supplied, each @var{name} refers to a shell +function. +The @option{-a} option means each @var{name} refers to an indexed +array variable; the @option{-A} option means each @var{name} refers +to an associative array variable. +If both options are supplied, @option{-A} takes precedence. +If no @var{name} arguments are given, or if the @option{-p} +option is supplied, a list of all readonly names is printed. +The other options may be used to restrict the output to a subset of +the set of readonly names. +The @option{-p} option causes output to be displayed in a format that +may be reused as input. +If a variable name is followed by =@var{value}, the value of +the variable is set to @var{value}. +The return status is zero unless an invalid option is supplied, one of +the @var{name} arguments is not a valid shell variable or function name, +or the @option{-f} option is supplied with a name that is not a shell function. + +@item return +@btindex return +@example +return [@var{n}] +@end example + +Cause a shell function to stop executing and return the value @var{n} +to its caller. +If @var{n} is not supplied, the return value is the exit status of the +last command executed in the function. +@code{return} may also be used to terminate execution of a script +being executed with the @code{.} (@code{source}) builtin, +returning either @var{n} or +the exit status of the last command executed within the script as the exit +status of the script. +If @var{n} is supplied, the return value is its least significant +8 bits. +Any command associated with the @code{RETURN} trap is executed +before execution resumes after the function or script. +The return status is non-zero if @code{return} is supplied a non-numeric +argument or is used outside a function +and not during the execution of a script by @code{.} or @code{source}. + +@item shift +@btindex shift +@example +shift [@var{n}] +@end example + +Shift the positional parameters to the left by @var{n}. +The positional parameters from @var{n}+1 @dots{} @code{$#} are +renamed to @code{$1} @dots{} @code{$#}-@var{n}. +Parameters represented by the numbers @code{$#} to @code{$#}-@var{n}+1 +are unset. +@var{n} must be a non-negative number less than or equal to @code{$#}. +If @var{n} is zero or greater than @code{$#}, the positional parameters +are not changed. +If @var{n} is not supplied, it is assumed to be 1. +The return status is zero unless @var{n} is greater than @code{$#} or +less than zero, non-zero otherwise. + +@item test +@itemx [ +@btindex test +@btindex [ +@example +test @var{expr} +@end example + +Evaluate a conditional express +ion @var{expr} and return a status of 0 +(true) or 1 (false). +Each operator and operand must be a separate argument. +Expressions are composed of the primaries described below in +@ref{Bash Conditional Expressions}. +@code{test} does not accept any options, nor does it accept and ignore +an argument of @option{--} as signifying the end of options. + +When the @code{[} form is used, the last argument to the command must +be a @code{]}. + +Expressions may be combined using the following operators, listed in +decreasing order of precedence. +The evaluation depends on the number of arguments; see below. +Operator precedence is used when there are five or more arguments. + +@table @code +@item ! @var{expr} +True if @var{expr} is false. + +@item ( @var{expr} ) +Returns the value of @var{expr}. +This may be used to override the normal precedence of operators. + +@item @var{expr1} -a @var{expr2} +True if both @var{expr1} and @var{expr2} are true. + +@item @var{expr1} -o @var{expr2} +True if either @var{expr1} or @var{expr2} is true. +@end table + +The @code{test} and @code{[} builtins evaluate conditional +expressions using a set of rules based on the number of arguments. + +@table @asis +@item 0 arguments +The expression is false. + +@item 1 argument +The expression is true if and only if the argument is not null. + +@item 2 arguments +If the first argument is @samp{!}, the expression is true if and +only if the second argument is null. +If the first argument is one of the unary conditional operators +(@pxref{Bash Conditional Expressions}), the expression +is true if the unary test is true. +If the first argument is not a valid unary operator, the expression is +false. + +@item 3 arguments +The following conditions are applied in the order listed. +If the second argument is one of the binary conditional +operators (@pxref{Bash Conditional Expressions}), the +result of the expression is the result of the binary test using the +first and third arguments as operands. +The @samp{-a} and @samp{-o} operators are considered binary operators +when there are three arguments. +If the first argument is @samp{!}, the value is the negation of +the two-argument test using the second and third arguments. +If the first argument is exactly @samp{(} and the third argument is +exactly @samp{)}, the result is the one-argument test of the second +argument. +Otherwise, the expression is false. + +@item 4 arguments +If the first argument is @samp{!}, the result is the negation of +the three-argument expression composed of the remaining arguments. +Otherwise, the expression is parsed and evaluated according to +precedence using the rules listed above. + +@item 5 or more arguments +The expression is parsed and evaluated according to precedence +using the rules listed above. +@end table + +When used with @code{test} or @samp{[}, the @samp{<} and @samp{>} +operators sort lexicographically using ASCII ordering. + +@item times +@btindex times +@example +times +@end example + +Print out the user and system times used by the shell and its children. +The return status is zero. + +@item trap +@btindex trap +@example +trap [-lp] [@var{arg}] [@var{sigspec} @dots{}] +@end example + +The commands in @var{arg} are to be read and executed when the +shell receives signal @var{sigspec}. If @var{arg} is absent (and +there is a single @var{sigspec}) or +equal to @samp{-}, each specified signal's disposition is reset +to the value it had when the shell was started. +If @var{arg} is the null string, then the signal specified by +each @var{sigspec} is ignored by the shell and commands it invokes. +If @var{arg} is not present and @option{-p} has been supplied, +the shell displays the trap commands associated with each @var{sigspec}. +If no arguments are supplied, or +only @option{-p} is given, @code{trap} prints the list of commands +associated with each signal number in a form that may be reused as +shell input. +The @option{-l} option causes the shell to print a list of signal names +and their corresponding numbers. +Each @var{sigspec} is either a signal name or a signal number. +Signal names are case insensitive and the @code{SIG} prefix is optional. + +If a @var{sigspec} +is @code{0} or @code{EXIT}, @var{arg} is executed when the shell exits. +If a @var{sigspec} is @code{DEBUG}, the command @var{arg} is executed +before every simple command, @code{for} command, @code{case} command, +@code{select} command, every arithmetic @code{for} command, and before +the first command executes in a shell function. +Refer to the description of the @code{extdebug} option to the +@code{shopt} builtin (@pxref{The Shopt Builtin}) for details of its +effect on the @code{DEBUG} trap. +If a @var{sigspec} is @code{RETURN}, the command @var{arg} is executed +each time a shell function or a script executed with the @code{.} or +@code{source} builtins finishes executing. + +If a @var{sigspec} is @code{ERR}, the command @var{arg} +is executed whenever +a pipeline (which may consist of a single simple +command), a list, or a compound command returns a +non-zero exit status, +subject to the following conditions. +The @code{ERR} trap is not executed if the failed command is part of the +command list immediately following an @code{until} or @code{while} keyword, +part of the test following the @code{if} or @code{elif} reserved words, +part of a command executed in a @code{&&} or @code{||} list +except the command following the final @code{&&} or @code{||}, +any command in a pipeline but the last, +or if the command's return +status is being inverted using @code{!}. +These are the same conditions obeyed by the @code{errexit} (@option{-e}) +option. + +Signals ignored upon entry to the shell cannot be trapped or reset. +Trapped signals that are not being ignored are reset to their original +values in a subshell or subshell environment when one is created. + +The return status is zero unless a @var{sigspec} does not specify a +valid signal. + +@item umask +@btindex umask +@example +umask [-p] [-S] [@var{mode}] +@end example + +Set the shell process's file creation mask to @var{mode}. If +@var{mode} begins with a digit, it is interpreted as an octal number; +if not, it is interpreted as a symbolic mode mask similar +to that accepted by the @code{chmod} command. If @var{mode} is +omitted, the current value of the mask is printed. If the @option{-S} +option is supplied without a @var{mode} argument, the mask is printed +in a symbolic format. +If the @option{-p} option is supplied, and @var{mode} +is omitted, the output is in a form that may be reused as input. +The return status is zero if the mode is successfully changed or if +no @var{mode} argument is supplied, and non-zero otherwise. + +Note that when the mode is interpreted as an octal number, each number +of the umask is subtracted from @code{7}. Thus, a umask of @code{022} +results in permissions of @code{755}. + +@item unset +@btindex unset +@example +unset [-fnv] [@var{name}] +@end example + +Remove each variable or function @var{name}. +If the @option{-v} option is given, each +@var{name} refers to a shell variable and that variable is remvoved. +If the @option{-f} option is given, the @var{name}s refer to shell +functions, and the function definition is removed. +If the @option{-n} option is supplied, and @var{name} is a variable with +the @var{nameref} attribute, @var{name} will be unset rather than the +variable it references. +@option{-n} has no effect if the @option{-f} option is supplied. +If no options are supplied, each @var{name} refers to a variable; if +there is no variable by that name, any function with that name is +unset. +Readonly variables and functions may not be unset. +The return status is zero unless a @var{name} is readonly. +@end table + +@node Bash Builtins +@section Bash Builtin Commands + +This section describes builtin commands which are unique to +or have been extended in Bash. +Some of these commands are specified in the @sc{posix} standard. + +@table @code + +@item alias +@btindex alias +@example +alias [-p] [@var{name}[=@var{value}] @dots{}] +@end example + +Without arguments or with the @option{-p} option, @code{alias} prints +the list of aliases on the standard output in a form that allows +them to be reused as input. +If arguments are supplied, an alias is defined for each @var{name} +whose @var{value} is given. If no @var{value} is given, the name +and value of the alias is printed. +Aliases are described in @ref{Aliases}. + +@item bind +@btindex bind +@example +bind [-m @var{keymap}] [-lpsvPSVX] +bind [-m @var{keymap}] [-q @var{function}] [-u @var{function}] [-r @var{keyseq}] +bind [-m @var{keymap}] -f @var{filename} +bind [-m @var{keymap}] -x @var{keyseq:shell-command} +bind [-m @var{keymap}] @var{keyseq:function-name} +bind @var{readline-command} +@end example + +Display current Readline (@pxref{Command Line Editing}) +key and function bindings, +bind a key sequence to a Readline function or macro, +or set a Readline variable. +Each non-option argument is a command as it would appear in a +Readline initialization file (@pxref{Readline Init File}), +but each binding or command must be passed as a separate argument; e.g., +@samp{"\C-x\C-r":re-read-init-file}. + +Options, if supplied, have the following meanings: + +@table @code +@item -m @var{keymap} +Use @var{keymap} as the keymap to be affected by +the subsequent bindings. Acceptable @var{keymap} +names are +@code{emacs}, +@code{emacs-standard}, +@code{emacs-meta}, +@code{emacs-ctlx}, +@code{vi}, +@code{vi-move}, +@code{vi-command}, and +@code{vi-insert}. +@code{vi} is equivalent to @code{vi-command}; +@code{emacs} is equivalent to @code{emacs-standard}. + +@item -l +List the names of all Readline functions. + +@item -p +Display Readline function names and bindings in such a way that they +can be used as input or in a Readline initialization file. + +@item -P +List current Readline function names and bindings. + +@item -v +Display Readline variable names and values in such a way that they +can be used as input or in a Readline initialization file. + +@item -V +List current Readline variable names and values. + +@item -s +Display Readline key sequences bound to macros and the strings they output +in such a way that they can be used as input or in a Readline +initialization file. + +@item -S +Display Readline key sequences bound to macros and the strings they output. + +@item -f @var{filename} +Read key bindings from @var{filename}. + +@item -q @var{function} +Query about which keys invoke the named @var{function}. + +@item -u @var{function} +Unbind all keys bound to the named @var{function}. + +@item -r @var{keyseq} +Remove any current binding for @var{keyseq}. + +@item -x @var{keyseq:shell-command} +Cause @var{shell-command} to be executed whenever @var{keyseq} is +entered. +When @var{shell-command} is executed, the shell sets the +@code{READLINE_LINE} variable to the contents of the Readline line +buffer and the @code{READLINE_POINT} variable to the current location +of the insertion point. +If the executed command changes the value of @code{READLINE_LINE} or +@code{READLINE_POINT}, those new values will be reflected in the +editing state. + +@item -X +List all key sequences bound to shell commands and the associated commands +in a format that can be reused as input. +@end table + +@noindent +The return status is zero unless an invalid option is supplied or an +error occurs. + +@item builtin +@btindex builtin +@example +builtin [@var{shell-builtin} [@var{args}]] +@end example + +Run a shell builtin, passing it @var{args}, and return its exit status. +This is useful when defining a shell function with the same +name as a shell builtin, retaining the functionality of the builtin within +the function. +The return status is non-zero if @var{shell-builtin} is not a shell +builtin command. + +@item caller +@btindex caller +@example +caller [@var{expr}] +@end example + +Returns the context of any active subroutine call (a shell function or +a script executed with the @code{.} or @code{source} builtins). + +Without @var{expr}, @code{caller} displays the line number and source +filename of the current subroutine call. +If a non-negative integer is supplied as @var{expr}, @code{caller} +displays the line number, subroutine name, and source file corresponding +to that position in the current execution call stack. This extra +information may be used, for example, to print a stack trace. The +current frame is frame 0. + +The return value is 0 unless the shell is not executing a subroutine +call or @var{expr} does not correspond to a valid position in the +call stack. + +@item command +@btindex command +@example +command [-pVv] @var{command} [@var{arguments} @dots{}] +@end example + +Runs @var{command} with @var{arguments} ignoring any shell function +named @var{command}. +Only shell builtin commands or commands found by searching the +@env{PATH} are executed. +If there is a shell function named @code{ls}, running @samp{command ls} +within the function will execute the external command @code{ls} +instead of calling the function recursively. +The @option{-p} option means to use a default value for @env{PATH} +that is guaranteed to find all of the standard utilities. +The return status in this case is 127 if @var{command} cannot be +found or an error occurred, and the exit status of @var{command} +otherwise. + +If either the @option{-V} or @option{-v} option is supplied, a +description of @var{command} is printed. The @option{-v} option +causes a single word indicating the command or file name used to +invoke @var{command} to be displayed; the @option{-V} option produces +a more verbose description. In this case, the return status is +zero if @var{command} is found, and non-zero if not. + +@item declare +@btindex declare +@example +declare [-aAfFgilnrtux] [-p] [@var{name}[=@var{value}] @dots{}] +@end example + +Declare variables and give them attributes. If no @var{name}s +are given, then display the values of variables instead. + +The @option{-p} option will display the attributes and values of each +@var{name}. +When @option{-p} is used with @var{name} arguments, additional options, +other than @option{-f} and @option{-F}, are ignored. + +When @option{-p} is supplied without @var{name} arguments, @code{declare} +will display the attributes and values of all variables having the +attributes specified by the additional options. +If no other options are supplied with @option{-p}, @code{declare} will +display the attributes and values of all shell variables. The @option{-f} +option will restrict the display to shell functions. + +The @option{-F} option inhibits the display of function definitions; +only the function name and attributes are printed. +If the @code{extdebug} shell option is enabled using @code{shopt} +(@pxref{The Shopt Builtin}), the source file name and line number where +the function is defined are displayed as well. +@option{-F} implies @option{-f}. + +The @option{-g} option forces variables to be created or modified at +the global scope, even when @code{declare} is executed in a shell function. +It is ignored in all other cases. + +The following options can be used to restrict output to variables with +the specified attributes or to give variables attributes: + +@table @code +@item -a +Each @var{name} is an indexed array variable (@pxref{Arrays}). + +@item -A +Each @var{name} is an associative array variable (@pxref{Arrays}). + +@item -f +Use function names only. + +@item -i +The variable is to be treated as +an integer; arithmetic evaluation (@pxref{Shell Arithmetic}) is +performed when the variable is assigned a value. + +@item -l +When the variable is assigned a value, all upper-case characters are +converted to lower-case. +The upper-case attribute is disabled. + +@item -n +Give each @var{name} the @var{nameref} attribute, making +it a name reference to another variable. +That other variable is defined by the value of @var{name}. +All references and assignments to @var{name}, except for changing the +@option{-n} attribute itself, are performed on the variable referenced by +@var{name}'s value. +The @option{-n} attribute cannot be applied to array variables. + +@item -r +Make @var{name}s readonly. These names cannot then be assigned values +by subsequent assignment statements or unset. + +@item -t +Give each @var{name} the @code{trace} attribute. +Traced functions inherit the @code{DEBUG} and @code{RETURN} traps from +the calling shell. +The trace attribute has no special meaning for variables. + +@item -u +When the variable is assigned a value, all lower-case characters are +converted to upper-case. +The lower-case attribute is disabled. + +@item -x +Mark each @var{name} for export to subsequent commands via +the environment. +@end table + +Using @samp{+} instead of @samp{-} turns off the attribute instead, +with the exceptions that @samp{+a} +may not be used to destroy an array variable and @samp{+r} will not +remove the readonly attribute. +When used in a function, @code{declare} makes each @var{name} local, +as with the @code{local} command, unless the @option{-g} option is used. +If a variable name is followed by =@var{value}, the value of the variable +is set to @var{value}. + +When using @option{-a} or @option{-A} and the compound assignment syntax to +create array variables, additional attributes do not take effect until +subsequent assignments. + +The return status is zero unless an invalid option is encountered, +an attempt is made to define a function using @samp{-f foo=bar}, +an attempt is made to assign a value to a readonly variable, +an attempt is made to assign a value to an array variable without +using the compound assignment syntax (@pxref{Arrays}), +one of the @var{names} is not a valid shell variable name, +an attempt is made to turn off readonly status for a readonly variable, +an attempt is made to turn off array status for an array variable, +or an attempt is made to display a non-existent function with @option{-f}. + +@item echo +@btindex echo +@example +echo [-neE] [@var{arg} @dots{}] +@end example + +Output the @var{arg}s, separated by spaces, terminated with a +newline. +The return status is 0 unless a write error occurs. +If @option{-n} is specified, the trailing newline is suppressed. +If the @option{-e} option is given, interpretation of the following +backslash-escaped characters is enabled. +The @option{-E} option disables the interpretation of these escape characters, +even on systems where they are interpreted by default. +The @code{xpg_echo} shell option may be used to +dynamically determine whether or not @code{echo} expands these +escape characters by default. +@code{echo} does not interpret @option{--} to mean the end of options. + +@code{echo} interprets the following escape sequences: +@table @code +@item \a +alert (bell) +@item \b +backspace +@item \c +suppress further output +@item \e +@itemx \E +escape +@item \f +form feed +@item \n +new line +@item \r +carriage return +@item \t +horizontal tab +@item \v +vertical tab +@item \\ +backslash +@item \0@var{nnn} +the eight-bit character whose value is the octal value @var{nnn} +(zero to three octal digits) +@item \x@var{HH} +the eight-bit character whose value is the hexadecimal value @var{HH} +(one or two hex digits) +@item \u@var{HHHH} +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +@var{HHHH} (one to four hex digits) +@item \U@var{HHHHHHHH} +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +@var{HHHHHHHH} (one to eight hex digits) +@end table + +@item enable +@btindex enable +@example +enable [-a] [-dnps] [-f @var{filename}] [@var{name} @dots{}] +@end example + +Enable and disable builtin shell commands. +Disabling a builtin allows a disk command which has the same name +as a shell builtin to be executed without specifying a full pathname, +even though the shell normally searches for builtins before disk commands. +If @option{-n} is used, the @var{name}s become disabled. Otherwise +@var{name}s are enabled. For example, to use the @code{test} binary +found via @env{$PATH} instead of the shell builtin version, type +@samp{enable -n test}. + +If the @option{-p} option is supplied, or no @var{name} arguments appear, +a list of shell builtins is printed. With no other arguments, the list +consists of all enabled shell builtins. +The @option{-a} option means to list +each builtin with an indication of whether or not it is enabled. + +The @option{-f} option means to load the new builtin command @var{name} +from shared object @var{filename}, on systems that support dynamic loading. +The @option{-d} option will delete a builtin loaded with @option{-f}. + +If there are no options, a list of the shell builtins is displayed. +The @option{-s} option restricts @code{enable} to the @sc{posix} special +builtins. If @option{-s} is used with @option{-f}, the new builtin becomes +a special builtin (@pxref{Special Builtins}). + +The return status is zero unless a @var{name} is not a shell builtin +or there is an error loading a new builtin from a shared object. + +@item help +@btindex help +@example +help [-dms] [@var{pattern}] +@end example + +Display helpful information about builtin commands. +If @var{pattern} is specified, @code{help} gives detailed help +on all commands matching @var{pattern}, otherwise a list of +the builtins is printed. + +Options, if supplied, have the following meanings: + +@table @code +@item -d +Display a short description of each @var{pattern} +@item -m +Display the description of each @var{pattern} in a manpage-like format +@item -s +Display only a short usage synopsis for each @var{pattern} +@end table + +The return status is zero unless no command matches @var{pattern}. + +@item let +@btindex let +@example +let @var{expression} [@var{expression} @dots{}] +@end example + +The @code{let} builtin allows arithmetic to be performed on shell +variables. Each @var{expression} is evaluated according to the +rules given below in @ref{Shell Arithmetic}. If the +last @var{expression} evaluates to 0, @code{let} returns 1; +otherwise 0 is returned. + +@item local +@btindex local +@example +local [@var{option}] @var{name}[=@var{value}] @dots{} +@end example + +For each argument, a local variable named @var{name} is created, +and assigned @var{value}. +The @var{option} can be any of the options accepted by @code{declare}. +@code{local} can only be used within a function; it makes the variable +@var{name} have a visible scope restricted to that function and its +children. The return status is zero unless @code{local} is used outside +a function, an invalid @var{name} is supplied, or @var{name} is a +readonly variable. + +@item logout +@btindex logout +@example +logout [@var{n}] +@end example + +Exit a login shell, returning a status of @var{n} to the shell's +parent. + +@item mapfile +@btindex mapfile +@example +mapfile [-n @var{count}] [-O @var{origin}] [-s @var{count}] [-t] [-u @var{fd}] + [-C @var{callback}] [-c @var{quantum}] [@var{array}] +@end example + +Read lines from the standard input into the indexed array variable @var{array}, +or from file descriptor @var{fd} +if the @option{-u} option is supplied. +The variable @code{MAPFILE} is the default @var{array}. +Options, if supplied, have the following meanings: + +@table @code + +@item -n +Copy at most @var{count} lines. If @var{count} is 0, all lines are copied. +@item -O +Begin assigning to @var{array} at index @var{origin}. +The default index is 0. +@item -s +Discard the first @var{count} lines read. +@item -t +Remove a trailing newline from each line read. +@item -u +Read lines from file descriptor @var{fd} instead of the standard input. +@item -C +Evaluate @var{callback} each time @var{quantum}P lines are read. +The @option{-c} option specifies @var{quantum}. +@item -c +Specify the number of lines read between each call to @var{callback}. +@end table + +If @option{-C} is specified without @option{-c}, +the default quantum is 5000. +When @var{callback} is evaluated, it is supplied the index of the next +array element to be assigned and the line to be assigned to that element +as additional arguments. +@var{callback} is evaluated after the line is read but before the +array element is assigned. + +If not supplied with an explicit origin, @code{mapfile} will clear @var{array} +before assigning to it. + +@code{mapfile} returns successfully unless an invalid option or option +argument is supplied, @var{array} is invalid or unassignable, or @var{array} +is not an indexed array. + +@item printf +@btindex printf +@example +printf [-v @var{var}] @var{format} [@var{arguments}] +@end example + +Write the formatted @var{arguments} to the standard output under the +control of the @var{format}. +The @option{-v} option causes the output to be assigned to the variable +@var{var} rather than being printed to the standard output. + +The @var{format} is a character string which contains three types of objects: +plain characters, which are simply copied to standard output, character +escape sequences, which are converted and copied to the standard output, and +format specifications, each of which causes printing of the next successive +@var{argument}. +In addition to the standard @code{printf(1)} formats, @code{printf} +interprets the following extensions: + +@table @code +@item %b +Causes @code{printf} to expand backslash escape sequences in the +corresponding @var{argument}, +except that @samp{\c} terminates output, backslashes in +@samp{\'}, @samp{\"}, and @samp{\?} are not removed, and octal escapes +beginning with @samp{\0} may contain up to four digits. +@item %q +Causes @code{printf} to output the +corresponding @var{argument} in a format that can be reused as shell input. +@item %(@var{datefmt})T +Causes @code{printf} to output the date-time string resulting from using +@var{datefmt} as a format string for @code{strftime}(3). +The corresponding @var{argument} is an integer representing the number of +seconds since the epoch. +Two special argument values may be used: -1 represents the current +time, and -2 represents the time the shell was invoked. +If no argument is specified, conversion behaves as if -1 had been given. +This is an exception to the usual @code{printf} behavior. +@end table + +@noindent +Arguments to non-string format specifiers are treated as C language constants, +except that a leading plus or minus sign is allowed, and if the leading +character is a single or double quote, the value is the ASCII value of +the following character. + +The @var{format} is reused as necessary to consume all of the @var{arguments}. +If the @var{format} requires more @var{arguments} than are supplied, the +extra format specifications behave as if a zero value or null string, as +appropriate, had been supplied. The return value is zero on success, +non-zero on failure. + +@item read +@btindex read +@example +read [-ers] [-a @var{aname}] [-d @var{delim}] [-i @var{text}] [-n @var{nchars}] + [-N @var{nchars}] [-p @var{prompt}] [-t @var{timeout}] [-u @var{fd}] [@var{name} @dots{}] +@end example + +One line is read from the standard input, or from the file descriptor +@var{fd} supplied as an argument to the @option{-u} option, and the first word +is assigned to the first @var{name}, the second word to the second @var{name}, +and so on, with leftover words and their intervening separators assigned +to the last @var{name}. +If there are fewer words read from the input stream than names, +the remaining names are assigned empty values. +The characters in the value of the @env{IFS} variable +are used to split the line into words using the same rules the shell +uses for expansion (described above in @ref{Word Splitting}). +The backslash character @samp{\} may be used to remove any special +meaning for the next character read and for line continuation. +If no names are supplied, the line read is assigned to the +variable @env{REPLY}. +The return code is zero, unless end-of-file is encountered, @code{read} +times out (in which case the return code is greater than 128), +a variable assignment error (such as assigning to a readonly variable) occurs, +or an invalid file descriptor is supplied as the argument to @option{-u}. + +Options, if supplied, have the following meanings: + +@table @code +@item -a @var{aname} +The words are assigned to sequential indices of the array variable +@var{aname}, starting at 0. +All elements are removed from @var{aname} before the assignment. +Other @var{name} arguments are ignored. + +@item -d @var{delim} +The first character of @var{delim} is used to terminate the input line, +rather than newline. + +@item -e +Readline (@pxref{Command Line Editing}) is used to obtain the line. +Readline uses the current (or default, if line editing was not previously +active) editing settings. + +@item -i @var{text} +If Readline is being used to read the line, @var{text} is placed into +the editing buffer before editing begins. + +@item -n @var{nchars} +@code{read} returns after reading @var{nchars} characters rather than +waiting for a complete line of input, but honor a delimiter if fewer +than @var{nchars} characters are read before the delimiter. + +@item -N @var{nchars} +@code{read} returns after reading exactly @var{nchars} characters rather +than waiting for a complete line of input, unless EOF is encountered or +@code{read} times out. +Delimiter characters encountered in the input are +not treated specially and do not cause @code{read} to return until +@var{nchars} characters are read. + +@item -p @var{prompt} +Display @var{prompt}, without a trailing newline, before attempting +to read any input. +The prompt is displayed only if input is coming from a terminal. + +@item -r +If this option is given, backslash does not act as an escape character. +The backslash is considered to be part of the line. +In particular, a backslash-newline pair may not be used as a line +continuation. + +@item -s +Silent mode. If input is coming from a terminal, characters are +not echoed. + +@item -t @var{timeout} +Cause @code{read} to time out and return failure if a complete line of +input (or a specified number of characters) +is not read within @var{timeout} seconds. +@var{timeout} may be a decimal number with a fractional portion following +the decimal point. +This option is only effective if @code{read} is reading input from a +terminal, pipe, or other special file; it has no effect when reading +from regular files. +If @code{read} times out, @code{read} saves any partial input read into +the specified variable @var{name}. +If @var{timeout} is 0, @code{read} returns immediately, without trying to +read and data. The exit status is 0 if input is available on +the specified file descriptor, non-zero otherwise. +The exit status is greater than 128 if the timeout is exceeded. + +@item -u @var{fd} +Read input from file descriptor @var{fd}. +@end table + +@item readarray +@btindex readarray +@example +readarray [-n @var{count}] [-O @var{origin}] [-s @var{count}] [-t] [-u @var{fd}] + [-C @var{callback}] [-c @var{quantum}] [@var{array}] +@end example + +Read lines from the standard input into the indexed array variable @var{array}, +or from file descriptor @var{fd} +if the @option{-u} option is supplied. + +A synonym for @code{mapfile}. + +@item source +@btindex source +@example +source @var{filename} +@end example + +A synonym for @code{.} (@pxref{Bourne Shell Builtins}). + +@item type +@btindex type +@example +type [-afptP] [@var{name} @dots{}] +@end example + +For each @var{name}, indicate how it would be interpreted if used as a +command name. + +If the @option{-t} option is used, @code{type} prints a single word +which is one of @samp{alias}, @samp{function}, @samp{builtin}, +@samp{file} or @samp{keyword}, +if @var{name} is an alias, shell function, shell builtin, +disk file, or shell reserved word, respectively. +If the @var{name} is not found, then nothing is printed, and +@code{type} returns a failure status. + +If the @option{-p} option is used, @code{type} either returns the name +of the disk file that would be executed, or nothing if @option{-t} +would not return @samp{file}. + +The @option{-P} option forces a path search for each @var{name}, even if +@option{-t} would not return @samp{file}. + +If a command is hashed, @option{-p} and @option{-P} print the hashed value, +which is not necessarily the file that appears first in @code{$PATH}. + +If the @option{-a} option is used, @code{type} returns all of the places +that contain an executable named @var{file}. +This includes aliases and functions, if and only if the @option{-p} option +is not also used. + +If the @option{-f} option is used, @code{type} does not attempt to find +shell functions, as with the @code{command} builtin. + +The return status is zero if all of the @var{names} are found, non-zero +if any are not found. + +@item typeset +@btindex typeset +@example +typeset [-afFgrxilnrtux] [-p] [@var{name}[=@var{value}] @dots{}] +@end example + +The @code{typeset} command is supplied for compatibility with the Korn +shell. +It is a synonym for the @code{declare} builtin command. + +@item ulimit +@btindex ulimit +@example +ulimit [-abcdefilmnpqrstuvxHST] [@var{limit}] +@end example + +@code{ulimit} provides control over the resources available to processes +started by the shell, on systems that allow such control. If an +option is given, it is interpreted as follows: + +@table @code +@item -S +Change and report the soft limit associated with a resource. + +@item -H +Change and report the hard limit associated with a resource. + +@item -a +All current limits are reported. + +@item -b +The maximum socket buffer size. + +@item -c +The maximum size of core files created. + +@item -d +The maximum size of a process's data segment. + +@item -e +The maximum scheduling priority ("nice"). + +@item -f +The maximum size of files written by the shell and its children. + +@item -i +The maximum number of pending signals. + +@item -l +The maximum size that may be locked into memory. + +@item -m +The maximum resident set size (many systems do not honor this limit). + +@item -n +The maximum number of open file descriptors (most systems do not +allow this value to be set). + +@item -p +The pipe buffer size. + +@item -q +The maximum number of bytes in POSIX message queues. + +@item -r +The maximum real-time scheduling priority. + +@item -s +The maximum stack size. + +@item -t +The maximum amount of cpu time in seconds. + +@item -u +The maximum number of processes available to a single user. + +@item -v +The maximum amount of virtual memory available to the shell, and, on +some systems, to its children. + +@item -x +The maximum number of file locks. + +@item -T +The maximum number of threads. +@end table + +If @var{limit} is given, and the @option{-a} option is not used, +@var{limit} is the new value of the specified resource. +The special @var{limit} values @code{hard}, @code{soft}, and +@code{unlimited} stand for the current hard limit, the current soft limit, +and no limit, respectively. +A hard limit cannot be increased by a non-root user once it is set; +a soft limit may be increased up to the value of the hard limit. +Otherwise, the current value of the soft limit for the specified resource +is printed, unless the @option{-H} option is supplied. +When setting new limits, if neither @option{-H} nor @option{-S} is supplied, +both the hard and soft limits are set. +If no option is given, then @option{-f} is assumed. Values are in 1024-byte +increments, except for @option{-t}, which is in seconds; @option{-p}, +which is in units of 512-byte blocks; and @option{-T}, @option{-b}, +@option{-n} and @option{-u}, which are unscaled values. + +The return status is zero unless an invalid option or argument is supplied, +or an error occurs while setting a new limit. + +@item unalias +@btindex unalias +@example +unalias [-a] [@var{name} @dots{} ] +@end example + +Remove each @var{name} from the list of aliases. If @option{-a} is +supplied, all aliases are removed. +Aliases are described in @ref{Aliases}. +@end table + +@node Modifying Shell Behavior +@section Modifying Shell Behavior + +@menu +* The Set Builtin:: Change the values of shell attributes and + positional parameters. +* The Shopt Builtin:: Modify shell optional behavior. +@end menu + +@node The Set Builtin +@subsection The Set Builtin + +This builtin is so complicated that it deserves its own section. @code{set} +allows you to change the values of shell options and set the positional +parameters, or to display the names and values of shell variables. + +@table @code +@item set +@btindex set +@example +set [--abefhkmnptuvxBCEHPT] [-o @var{option-name}] [@var{argument} @dots{}] +set [+abefhkmnptuvxBCEHPT] [+o @var{option-name}] [@var{argument} @dots{}] +@end example + +If no options or arguments are supplied, @code{set} displays the names +and values of all shell variables and functions, sorted according to the +current locale, in a format that may be reused as input +for setting or resetting the currently-set variables. +Read-only variables cannot be reset. +In @sc{posix} mode, only shell variables are listed. + +When options are supplied, they set or unset shell attributes. +Options, if specified, have the following meanings: + +@table @code +@item -a +Mark variables and function which are modified or created for export +to the environment of subsequent commands. + +@item -b +Cause the status of terminated background jobs to be reported +immediately, rather than before printing the next primary prompt. + +@item -e +Exit immediately if +a pipeline (@pxref{Pipelines}), which may consist of a single simple command +(@pxref{Simple Commands}), +a list (@pxref{Lists}), +or a compound command (@pxref{Compound Commands}) +returns a non-zero status. +The shell does not exit if the command that fails is part of the +command list immediately following a @code{while} or @code{until} keyword, +part of the test in an @code{if} statement, +part of any command executed in a @code{&&} or @code{||} list except +the command following the final @code{&&} or @code{||}, +any command in a pipeline but the last, +or if the command's return status is being inverted with @code{!}. +If a compound command other than a subshell +returns a non-zero status because a command failed +while @option{-e} was being ignored, the shell does not exit. +A trap on @code{ERR}, if set, is executed before the shell exits. + +This option applies to the shell environment and each subshell environment +separately (@pxref{Command Execution Environment}), and may cause +subshells to exit before executing all the commands in the subshell. + +If a compound command or shell function executes in a context where +@option{-e} is being ignored, +none of the commands executed within the compound command or function body +will be affected by the @option{-e} setting, even if @option{-e} is set +and a command returns a failure status. +If a compound command or shell function sets @option{-e} while executing in +a context where @option{-e} is ignored, that setting will not have any +effect until the compound command or the command containing the function +call completes. + +@item -f +Disable filename expansion (globbing). + +@item -h +Locate and remember (hash) commands as they are looked up for execution. +This option is enabled by default. + +@item -k +All arguments in the form of assignment statements are placed +in the environment for a command, not just those that precede +the command name. + +@item -m +Job control is enabled (@pxref{Job Control}). +All processes run in a separate process group. +When a background job completes, the shell prints a line +containing its exit status. + +@item -n +Read commands but do not execute them; this may be used to check a +script for syntax errors. +This option is ignored by interactive shells. + +@item -o @var{option-name} + +Set the option corresponding to @var{option-name}: + +@table @code +@item allexport +Same as @code{-a}. + +@item braceexpand +Same as @code{-B}. + +@item emacs +Use an @code{emacs}-style line editing interface (@pxref{Command Line Editing}). +This also affects the editing interface used for @code{read -e}. + +@item errexit +Same as @code{-e}. + +@item errtrace +Same as @code{-E}. + +@item functrace +Same as @code{-T}. + +@item hashall +Same as @code{-h}. + +@item histexpand +Same as @code{-H}. + +@item history +Enable command history, as described in @ref{Bash History Facilities}. +This option is on by default in interactive shells. + +@item ignoreeof +An interactive shell will not exit upon reading EOF. + +@item keyword +Same as @code{-k}. + +@item monitor +Same as @code{-m}. + +@item noclobber +Same as @code{-C}. + +@item noexec +Same as @code{-n}. + +@item noglob +Same as @code{-f}. + +@item nolog +Currently ignored. + +@item notify +Same as @code{-b}. + +@item nounset +Same as @code{-u}. + +@item onecmd +Same as @code{-t}. + +@item physical +Same as @code{-P}. + +@item pipefail +If set, the return value of a pipeline is the value of the last +(rightmost) command to exit with a non-zero status, or zero if all +commands in the pipeline exit successfully. +This option is disabled by default. + +@item posix +Change the behavior of Bash where the default operation differs +from the @sc{posix} standard to match the standard +(@pxref{Bash POSIX Mode}). +This is intended to make Bash behave as a strict superset of that +standard. + +@item privileged +Same as @code{-p}. + +@item verbose +Same as @code{-v}. + +@item vi +Use a @code{vi}-style line editing interface. +This also affects the editing interface used for @code{read -e}. + +@item xtrace +Same as @code{-x}. +@end table + +@item -p +Turn on privileged mode. +In this mode, the @env{$BASH_ENV} and @env{$ENV} files are not +processed, shell functions are not inherited from the environment, +and the @env{SHELLOPTS}, @env{BASHOPTS}, @env{CDPATH} and @env{GLOBIGNORE} +variables, if they appear in the environment, are ignored. +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the @option{-p} option is not supplied, these actions +are taken and the effective user id is set to the real user id. +If the @option{-p} option is supplied at startup, the effective user id is +not reset. +Turning this option off causes the effective user +and group ids to be set to the real user and group ids. + +@item -t +Exit after reading and executing one command. + +@item -u +Treat unset variables and parameters other than the special parameters +@samp{@@} or @samp{*} as an error when performing parameter expansion. +An error message will be written to the standard error, and a non-interactive +shell will exit. + +@item -v +Print shell input lines as they are read. + +@item -x +Print a trace of simple commands, @code{for} commands, @code{case} +commands, @code{select} commands, and arithmetic @code{for} commands +and their arguments or associated word lists after they are +expanded and before they are executed. The value of the @env{PS4} +variable is expanded and the resultant value is printed before +the command and its expanded arguments. + +@item -B +The shell will perform brace expansion (@pxref{Brace Expansion}). +This option is on by default. + +@item -C +Prevent output redirection using @samp{>}, @samp{>&}, and @samp{<>} +from overwriting existing files. + +@item -E +If set, any trap on @code{ERR} is inherited by shell functions, command +substitutions, and commands executed in a subshell environment. +The @code{ERR} trap is normally not inherited in such cases. + +@item -H +Enable @samp{!} style history substitution (@pxref{History Interaction}). +This option is on by default for interactive shells. + +@item -P +If set, do not resolve symbolic links when performing commands such as +@code{cd} which change the current directory. The physical directory +is used instead. By default, Bash follows +the logical chain of directories when performing commands +which change the current directory. + +For example, if @file{/usr/sys} is a symbolic link to @file{/usr/local/sys} +then: +@example +$ cd /usr/sys; echo $PWD +/usr/sys +$ cd ..; pwd +/usr +@end example + +@noindent +If @code{set -P} is on, then: +@example +$ cd /usr/sys; echo $PWD +/usr/local/sys +$ cd ..; pwd +/usr/local +@end example + +@item -T +If set, any trap on @code{DEBUG} and @code{RETURN} are inherited by +shell functions, command substitutions, and commands executed +in a subshell environment. +The @code{DEBUG} and @code{RETURN} traps are normally not inherited +in such cases. + +@item -- +If no arguments follow this option, then the positional parameters are +unset. Otherwise, the positional parameters are set to the +@var{arguments}, even if some of them begin with a @samp{-}. + +@item - +Signal the end of options, cause all remaining @var{arguments} +to be assigned to the positional parameters. The @option{-x} +and @option{-v} options are turned off. +If there are no arguments, the positional parameters remain unchanged. +@end table + +Using @samp{+} rather than @samp{-} causes these options to be +turned off. The options can also be used upon invocation of the +shell. The current set of options may be found in @code{$-}. + +The remaining N @var{arguments} are positional parameters and are +assigned, in order, to @code{$1}, @code{$2}, @dots{} @code{$N}. +The special parameter @code{#} is set to N. + +The return status is always zero unless an invalid option is supplied. +@end table + +@node The Shopt Builtin +@subsection The Shopt Builtin + +This builtin allows you to change additional shell optional behavior. + +@table @code + +@item shopt +@btindex shopt +@example +shopt [-pqsu] [-o] [@var{optname} @dots{}] +@end example + +Toggle the values of settings controlling optional shell behavior. +The settings can be either those listed below, or, if the +@option{-o} option is used, those available with the @option{-o} +option to the @code{set} builtin command (@pxref{The Set Builtin}). +With no options, or with the @option{-p} option, a list of all settable +options is displayed, with an indication of whether or not each is set. +The @option{-p} option causes output to be displayed in a form that +may be reused as input. +Other options have the following meanings: + +@table @code +@item -s +Enable (set) each @var{optname}. + +@item -u +Disable (unset) each @var{optname}. + +@item -q +Suppresses normal output; the return status +indicates whether the @var{optname} is set or unset. +If multiple @var{optname} arguments are given with @option{-q}, +the return status is zero if all @var{optnames} are enabled; +non-zero otherwise. + +@item -o +Restricts the values of +@var{optname} to be those defined for the @option{-o} option to the +@code{set} builtin (@pxref{The Set Builtin}). +@end table + +If either @option{-s} or @option{-u} +is used with no @var{optname} arguments, @code{shopt} shows only +those options which are set or unset, respectively. + +Unless otherwise noted, the @code{shopt} options are disabled (off) +by default. + +The return status when listing options is zero if all @var{optnames} +are enabled, non-zero otherwise. When setting or unsetting options, +the return status is zero unless an @var{optname} is not a valid shell +option. + +The list of @code{shopt} options is: +@table @code + +@item autocd +If set, a command name that is the name of a directory is executed as if +it were the argument to the @code{cd} command. +This option is only used by interactive shells. + +@item cdable_vars +If this is set, an argument to the @code{cd} builtin command that +is not a directory is assumed to be the name of a variable whose +value is the directory to change to. + +@item cdspell +If set, minor errors in the spelling of a directory component in a +@code{cd} command will be corrected. +The errors checked for are transposed characters, +a missing character, and a character too many. +If a correction is found, the corrected path is printed, +and the command proceeds. +This option is only used by interactive shells. + +@item checkhash +If this is set, Bash checks that a command found in the hash +table exists before trying to execute it. If a hashed command no +longer exists, a normal path search is performed. + +@item checkjobs +If set, Bash lists the status of any stopped and running jobs before +exiting an interactive shell. If any jobs are running, this causes +the exit to be deferred until a second exit is attempted without an +intervening command (@pxref{Job Control}). +The shell always postpones exiting if any jobs are stopped. + +@item checkwinsize +If set, Bash checks the window size after each command + and, if necessary, updates the values of +@env{LINES} and @env{COLUMNS}. + +@item cmdhist +If set, Bash +attempts to save all lines of a multiple-line +command in the same history entry. This allows +easy re-editing of multi-line commands. + +@item compat31 +If set, Bash +changes its behavior to that of version 3.1 with respect to quoted +arguments to the conditional command's @samp{=~} operator +and with respect to locale-specific +string comparison when using the @code{[[} +conditional command's @samp{<} and @samp{>} operators. +Bash versions prior to bash-4.1 use ASCII collation and strcmp(3); +bash-4.1 and later use the current locale's collation sequence and strcoll(3). + +@item compat32 +If set, Bash +changes its behavior to that of version 3.2 with respect to locale-specific +string comparison when using the @code{[[} +conditional command's @samp{<} and @samp{>} operators (see previous item). + +@item compat40 +If set, Bash +changes its behavior to that of version 4.0 with respect to locale-specific +string comparison when using the @code{[[} +conditional command's @samp{<} and @samp{>} operators (see description +of @code{compat31}) +and the effect of interrupting a command list. +Bash versions 4.0 and later interrupt the list as if the shell received the +interrupt; previous versions continue with the next command in the list. + +@item compat41 +If set, Bash, when in @sc{posix} mode, treats a single quote in a double-quoted +parameter expansion as a special character. The single quotes must match +(an even number) and the characters between the single quotes are considered +quoted. This is the behavior of @sc{posix} mode through version 4.1. +The default Bash behavior remains as in previous versions. + +@item compat42 +If set, Bash +does not process the replacement string in the pattern substitution word +expansion using quote removal. + +@item complete_fullquote +If set, Bash +quotes all shell metacharacters in filenames and directory names when +performing completion. +If not set, Bash +removes metacharacters such as the dollar sign from the set of +characters that will be quoted in completed filenames +when these metacharacters appear in shell variable references in words to be +completed. +This means that dollar signs in variable names that expand to directories +will not be quoted; +however, any dollar signs appearing in filenames will not be quoted, either. +This is active only when bash is using backslashes to quote completed +filenames. +This variable is set by default, which is the default Bash behavior in +versions through 4.2. + +@item direxpand +If set, Bash +replaces directory names with the results of word expansion when performing +filename completion. This changes the contents of the readline editing +buffer. +If not set, Bash attempts to preserve what the user typed. + +@item dirspell +If set, Bash +attempts spelling correction on directory names during word completion +if the directory name initially supplied does not exist. + +@item dotglob +If set, Bash includes filenames beginning with a `.' in +the results of filename expansion. + +@item execfail +If this is set, a non-interactive shell will not exit if +it cannot execute the file specified as an argument to the @code{exec} +builtin command. An interactive shell does not exit if @code{exec} +fails. + +@item expand_aliases +If set, aliases are expanded as described below under Aliases, +@ref{Aliases}. +This option is enabled by default for interactive shells. + +@item extdebug +If set, behavior intended for use by debuggers is enabled: + +@enumerate +@item +The @option{-F} option to the @code{declare} builtin (@pxref{Bash Builtins}) +displays the source file name and line number corresponding to each function +name supplied as an argument. + +@item +If the command run by the @code{DEBUG} trap returns a non-zero value, the +next command is skipped and not executed. + +@item +If the command run by the @code{DEBUG} trap returns a value of 2, and the +shell is executing in a subroutine (a shell function or a shell script +executed by the @code{.} or @code{source} builtins), a call to +@code{return} is simulated. + +@item +@code{BASH_ARGC} and @code{BASH_ARGV} are updated as described in their +descriptions (@pxref{Bash Variables}). + +@item +Function tracing is enabled: command substitution, shell functions, and +subshells invoked with @code{( @var{command} )} inherit the +@code{DEBUG} and @code{RETURN} traps. + +@item +Error tracing is enabled: command substitution, shell functions, and +subshells invoked with @code{( @var{command} )} inherit the +@code{ERR} trap. +@end enumerate + +@item extglob +If set, the extended pattern matching features described above +(@pxref{Pattern Matching}) are enabled. + +@item extquote +If set, @code{$'@var{string}'} and @code{$"@var{string}"} quoting is +performed within @code{$@{@var{parameter}@}} expansions +enclosed in double quotes. This option is enabled by default. + +@item failglob +If set, patterns which fail to match filenames during filename expansion +result in an expansion error. + +@item force_fignore +If set, the suffixes specified by the @env{FIGNORE} shell variable +cause words to be ignored when performing word completion even if +the ignored words are the only possible completions. +@xref{Bash Variables}, for a description of @env{FIGNORE}. +This option is enabled by default. + +@item globasciiranges +If set, range expressions used in pattern matching bracket expressions +(@pxref{Pattern Matching}) +behave as if in the traditional C locale when performing +comparisons. That is, the current locale's collating sequence +is not taken into account, so +@samp{b} will not collate between @samp{A} and @samp{B}, +and upper-case and lower-case ASCII characters will collate together. + +@item globstar +If set, the pattern @samp{**} used in a filename expansion context will +match all files and zero or more directories and subdirectories. +If the pattern is followed by a @samp{/}, only directories and +subdirectories match. + +@item gnu_errfmt +If set, shell error messages are written in the standard @sc{gnu} error +message format. + +@item histappend +If set, the history list is appended to the file named by the value +of the @env{HISTFILE} +variable when the shell exits, rather than overwriting the file. + +@item histreedit +If set, and Readline +is being used, a user is given the opportunity to re-edit a +failed history substitution. + +@item histverify +If set, and Readline +is being used, the results of history substitution are not immediately +passed to the shell parser. Instead, the resulting line is loaded into +the Readline editing buffer, allowing further modification. + +@item hostcomplete +If set, and Readline is being used, Bash will attempt to perform +hostname completion when a word containing a @samp{@@} is being +completed (@pxref{Commands For Completion}). This option is enabled +by default. + +@item huponexit +If set, Bash will send @code{SIGHUP} to all jobs when an interactive +login shell exits (@pxref{Signals}). + +@item interactive_comments +Allow a word beginning with @samp{#} +to cause that word and all remaining characters on that +line to be ignored in an interactive shell. +This option is enabled by default. + +@item lastpipe +If set, and job control is not active, the shell runs the last command of +a pipeline not executed in the background in the current shell environment. + +@item lithist +If enabled, and the @code{cmdhist} +option is enabled, multi-line commands are saved to the history with +embedded newlines rather than using semicolon separators where possible. + +@item login_shell +The shell sets this option if it is started as a login shell +(@pxref{Invoking Bash}). +The value may not be changed. + +@item mailwarn +If set, and a file that Bash is checking for mail has been +accessed since the last time it was checked, the message +@code{"The mail in @var{mailfile} has been read"} is displayed. + +@item no_empty_cmd_completion +If set, and Readline is being used, Bash will not attempt to search +the @env{PATH} for possible completions when completion is attempted +on an empty line. + +@item nocaseglob +If set, Bash matches filenames in a case-insensitive fashion when +performing filename expansion. + +@item nocasematch +If set, Bash matches patterns in a case-insensitive fashion when +performing matching while executing @code{case} or @code{[[} +conditional commands. + +@item nullglob +If set, Bash allows filename patterns which match no +files to expand to a null string, rather than themselves. + +@item progcomp +If set, the programmable completion facilities +(@pxref{Programmable Completion}) are enabled. +This option is enabled by default. + +@item promptvars +If set, prompt strings undergo +parameter expansion, command substitution, arithmetic +expansion, and quote removal after being expanded +as described below (@pxref{Controlling the Prompt}). +This option is enabled by default. + +@item restricted_shell +The shell sets this option if it is started in restricted mode +(@pxref{The Restricted Shell}). +The value may not be changed. +This is not reset when the startup files are executed, allowing +the startup files to discover whether or not a shell is restricted. + +@item shift_verbose +If this is set, the @code{shift} +builtin prints an error message when the shift count exceeds the +number of positional parameters. + +@item sourcepath +If set, the @code{source} builtin uses the value of @env{PATH} +to find the directory containing the file supplied as an argument. +This option is enabled by default. + +@item xpg_echo +If set, the @code{echo} builtin expands backslash-escape sequences +by default. + +@end table + +@noindent +The return status when listing options is zero if all @var{optnames} +are enabled, non-zero otherwise. +When setting or unsetting options, the return status is zero unless an +@var{optname} is not a valid shell option. +@end table + +@node Special Builtins +@section Special Builtins +@cindex special builtin + +For historical reasons, the @sc{posix} standard has classified +several builtin commands as @emph{special}. +When Bash is executing in @sc{posix} mode, the special builtins +differ from other builtin commands in three respects: + +@enumerate +@item +Special builtins are found before shell functions during command lookup. + +@item +If a special builtin returns an error status, a non-interactive shell exits. + +@item +Assignment statements preceding the command stay in effect in the shell +environment after the command completes. +@end enumerate + +When Bash is not executing in @sc{posix} mode, these builtins behave no +differently than the rest of the Bash builtin commands. +The Bash @sc{posix} mode is described in @ref{Bash POSIX Mode}. + +These are the @sc{posix} special builtins: +@example +@w{break : . continue eval exec exit export readonly return set} +@w{shift trap unset} +@end example + +@node Shell Variables +@chapter Shell Variables + +@menu +* Bourne Shell Variables:: Variables which Bash uses in the same way + as the Bourne Shell. +* Bash Variables:: List of variables that exist in Bash. +@end menu + +This chapter describes the shell variables that Bash uses. +Bash automatically assigns default values to a number of variables. + +@node Bourne Shell Variables +@section Bourne Shell Variables + +Bash uses certain shell variables in the same way as the Bourne shell. +In some cases, Bash assigns a default value to the variable. + +@vtable @code + +@item CDPATH +A colon-separated list of directories used as a search path for +the @code{cd} builtin command. + +@item HOME +The current user's home directory; the default for the @code{cd} builtin +command. +The value of this variable is also used by tilde expansion +(@pxref{Tilde Expansion}). + +@item IFS +A list of characters that separate fields; used when the shell splits +words as part of expansion. + +@item MAIL +If this parameter is set to a filename or directory name +and the @env{MAILPATH} variable +is not set, Bash informs the user of the arrival of mail in +the specified file or Maildir-format directory. + +@item MAILPATH +A colon-separated list of filenames which the shell periodically checks +for new mail. +Each list entry can specify the message that is printed when new mail +arrives in the mail file by separating the filename from the message with +a @samp{?}. +When used in the text of the message, @code{$_} expands to the name of +the current mail file. + +@item OPTARG +The value of the last option argument processed by the @code{getopts} builtin. + +@item OPTIND +The index of the last option argument processed by the @code{getopts} builtin. + +@item PATH +A colon-separated list of directories in which the shell looks for +commands. +A zero-length (null) directory name in the value of @code{PATH} indicates the +current directory. +A null directory name may appear as two adjacent colons, or as an initial +or trailing colon. + + +@item PS1 +The primary prompt string. The default value is @samp{\s-\v\$ }. +@xref{Controlling the Prompt}, for the complete list of escape +sequences that are expanded before @env{PS1} is displayed. + +@item PS2 +The secondary prompt string. The default value is @samp{> }. + +@end vtable + +@node Bash Variables +@section Bash Variables + +These variables are set or used by Bash, but other shells +do not normally treat them specially. + +A few variables used by Bash are described in different chapters: +variables for controlling the job control facilities +(@pxref{Job Control Variables}). + +@vtable @code + +@item BASH +The full pathname used to execute the current instance of Bash. + +@item BASHOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the @option{-s} option to the +@code{shopt} builtin command (@pxref{The Shopt Builtin}). +The options appearing in @env{BASHOPTS} are those reported +as @samp{on} by @samp{shopt}. +If this variable is in the environment when Bash +starts up, each shell option in the list will be enabled before +reading any startup files. This variable is readonly. + +@item BASHPID +Expands to the process ID of the current Bash process. +This differs from @code{$$} under certain circumstances, such as subshells +that do not require Bash to be re-initialized. + +@item BASH_ALIASES +An associative array variable whose members correspond to the internal +list of aliases as maintained by the @code{alias} builtin. +(@pxref{Bourne Shell Builtins}). +Elements added to this array appear in the alias list; unsetting array +elements cause aliases to be removed from the alias list. + +@item BASH_ARGC +An array variable whose values are the number of parameters in each +frame of the current bash execution call stack. The number of +parameters to the current subroutine (shell function or script executed +with @code{.} or @code{source}) is at the top of the stack. When a +subroutine is executed, the number of parameters passed is pushed onto +@code{BASH_ARGC}. +The shell sets @code{BASH_ARGC} only when in extended debugging mode +(see @ref{The Shopt Builtin} +for a description of the @code{extdebug} option to the @code{shopt} +builtin). + +@item BASH_ARGV +An array variable containing all of the parameters in the current bash +execution call stack. The final parameter of the last subroutine call +is at the top of the stack; the first parameter of the initial call is +at the bottom. When a subroutine is executed, the parameters supplied +are pushed onto @code{BASH_ARGV}. +The shell sets @code{BASH_ARGV} only when in extended debugging mode +(see @ref{The Shopt Builtin} +for a description of the @code{extdebug} option to the @code{shopt} +builtin). + +@item BASH_CMDS +An associative array variable whose members correspond to the internal +hash table of commands as maintained by the @code{hash} builtin +(@pxref{Bourne Shell Builtins}). +Elements added to this array appear in the hash table; unsetting array +elements cause commands to be removed from the hash table. + +@item BASH_COMMAND +The command currently being executed or about to be executed, unless the +shell is executing a command as the result of a trap, +in which case it is the command executing at the time of the trap. + +@item BASH_COMPAT +The value is used to set the shell's compatibility level. +@xref{The Shopt Builtin}, for a description of the various compatibility +levels and their effects. +The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42) +corresponding to the desired compatibility level. +If @code{BASH_COMPAT} is unset or set to the empty string, the compatibility +level is set to the default for the current version. +If @code{BASH_COMPAT} is set to a value that is not one of the valid +compatibility levels, the shell prints an error message and sets the +compatibility level to the default for the current version. +The valid compatibility levels correspond to the compatibility options +accepted by the @code{shopt} builtin described above (for example, +@var{compat42} means that 4.2 and 42 are valid values). +The current version is also a valid value. + +@item BASH_ENV +If this variable is set when Bash is invoked to execute a shell +script, its value is expanded and used as the name of a startup file +to read before executing the script. @xref{Bash Startup Files}. + +@item BASH_EXECUTION_STRING +The command argument to the @option{-c} invocation option. + +@item BASH_LINENO +An array variable whose members are the line numbers in source files +where each corresponding member of @var{FUNCNAME} was invoked. +@code{$@{BASH_LINENO[$i]@}} is the line number in the source file +(@code{$@{BASH_SOURCE[$i+1]@}}) where +@code{$@{FUNCNAME[$i]@}} was called (or @code{$@{BASH_LINENO[$i-1]@}} if +referenced within another shell function). +Use @code{LINENO} to obtain the current line number. + +@item BASH_REMATCH +An array variable whose members are assigned by the @samp{=~} binary +operator to the @code{[[} conditional command +(@pxref{Conditional Constructs}). +The element with index 0 is the portion of the string +matching the entire regular expression. +The element with index @var{n} is the portion of the +string matching the @var{n}th parenthesized subexpression. +This variable is read-only. + +@item BASH_SOURCE +An array variable whose members are the source filenames where the +corresponding shell function names in the @code{FUNCNAME} array +variable are defined. +The shell function @code{$@{FUNCNAME[$i]@}} is defined in the file +@code{$@{BASH_SOURCE[$i]@}} and called from @code{$@{BASH_SOURCE[$i+1]@}} + +@item BASH_SUBSHELL +Incremented by one within each subshell or subshell environment when +the shell begins executing in that environment. +The initial value is 0. + +@item BASH_VERSINFO +A readonly array variable (@pxref{Arrays}) +whose members hold version information for this instance of Bash. +The values assigned to the array members are as follows: + +@table @code + +@item BASH_VERSINFO[0] +The major version number (the @var{release}). + +@item BASH_VERSINFO[1] +The minor version number (the @var{version}). + +@item BASH_VERSINFO[2] +The patch level. + +@item BASH_VERSINFO[3] +The build version. + +@item BASH_VERSINFO[4] +The release status (e.g., @var{beta1}). + +@item BASH_VERSINFO[5] +The value of @env{MACHTYPE}. +@end table + +@item BASH_VERSION +The version number of the current instance of Bash. + +@item BASH_XTRACEFD +If set to an integer corresponding to a valid file descriptor, Bash +will write the trace output generated when @samp{set -x} +is enabled to that file descriptor. +This allows tracing output to be separated from diagnostic and error +messages. +The file descriptor is closed when @code{BASH_XTRACEFD} is unset or assigned +a new value. +Unsetting @code{BASH_XTRACEFD} or assigning it the empty string causes the +trace output to be sent to the standard error. +Note that setting @code{BASH_XTRACEFD} to 2 (the standard error file +descriptor) and then unsetting it will result in the standard error +being closed. + +@item CHILD_MAX +Set the number of exited child status values for the shell to remember. +Bash will not allow this value to be decreased below a @sc{posix}-mandated +minimum, and there is a maximum value (currently 8192) that this may +not exceed. +The minimum value is system-dependent. + +@item COLUMNS +Used by the @code{select} command to determine the terminal width +when printing selection lists. +Automatically set if the @code{checkwinsize} option is enabled +(@pxref{The Shopt Builtin}), or in an interactive shell upon receipt of a +@code{SIGWINCH}. + +@item COMP_CWORD +An index into @env{$@{COMP_WORDS@}} of the word containing the current +cursor position. +This variable is available only in shell functions invoked by the +programmable completion facilities (@pxref{Programmable Completion}). + +@item COMP_LINE +The current command line. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (@pxref{Programmable Completion}). + +@item COMP_POINT +The index of the current cursor position relative to the beginning of +the current command. +If the current cursor position is at the end of the current command, +the value of this variable is equal to @code{$@{#COMP_LINE@}}. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (@pxref{Programmable Completion}). + +@item COMP_TYPE +Set to an integer value corresponding to the type of completion attempted +that caused a completion function to be called: +@var{TAB}, for normal completion, +@samp{?}, for listing completions after successive tabs, +@samp{!}, for listing alternatives on partial word completion, +@samp{@@}, to list completions if the word is not unmodified, +or +@samp{%}, for menu completion. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (@pxref{Programmable Completion}). + +@item COMP_KEY +The key (or final key of a key sequence) used to invoke the current +completion function. + +@item COMP_WORDBREAKS +The set of characters that the Readline library treats as word +separators when performing word completion. +If @code{COMP_WORDBREAKS} is unset, it loses its special properties, +even if it is subsequently reset. + +@item COMP_WORDS +An array variable consisting of the individual +words in the current command line. +The line is split into words as Readline would split it, using +@code{COMP_WORDBREAKS} as described above. +This variable is available only in shell functions invoked by the +programmable completion facilities (@pxref{Programmable Completion}). + +@item COMPREPLY +An array variable from which Bash reads the possible completions +generated by a shell function invoked by the programmable completion +facility (@pxref{Programmable Completion}). +Each array element contains one possible completion. + +@item COPROC +An array variable created to hold the file descriptors +for output from and input to an unnamed coprocess (@pxref{Coprocesses}). + +@item DIRSTACK +An array variable containing the current contents of the directory stack. +Directories appear in the stack in the order they are displayed by the +@code{dirs} builtin. +Assigning to members of this array variable may be used to modify +directories already in the stack, but the @code{pushd} and @code{popd} +builtins must be used to add and remove directories. +Assignment to this variable will not change the current directory. +If @env{DIRSTACK} is unset, it loses its special properties, even if +it is subsequently reset. + +@item EMACS +If Bash finds this variable in the environment when the shell +starts with value @samp{t}, it assumes that the shell is running in an +Emacs shell buffer and disables line editing. + +@item ENV +Similar to @code{BASH_ENV}; used when the shell is invoked in +@sc{posix} Mode (@pxref{Bash POSIX Mode}). + +@item EUID +The numeric effective user id of the current user. This variable +is readonly. + +@item FCEDIT +The editor used as a default by the @option{-e} option to the @code{fc} +builtin command. + +@item FIGNORE +A colon-separated list of suffixes to ignore when performing +filename completion. +A filename whose suffix matches one of the entries in +@env{FIGNORE} +is excluded from the list of matched filenames. A sample +value is @samp{.o:~} + +@item FUNCNAME +An array variable containing the names of all shell functions +currently in the execution call stack. +The element with index 0 is the name of any currently-executing +shell function. +The bottom-most element (the one with the highest index) +is @code{"main"}. +This variable exists only when a shell function is executing. +Assignments to @env{FUNCNAME} have no effect and return an error status. +If @env{FUNCNAME} is unset, it loses its special properties, even if +it is subsequently reset. + +This variable can be used with @code{BASH_LINENO} and @code{BASH_SOURCE}. +Each element of @code{FUNCNAME} has corresponding elements in +@code{BASH_LINENO} and @code{BASH_SOURCE} to describe the call stack. +For instance, @code{$@{FUNCNAME[$i]@}} was called from the file +@code{$@{BASH_SOURCE[$i+1]@}} at line number @code{$@{BASH_LINENO[$i]@}}. +The @code{caller} builtin displays the current call stack using this +information. + +@item FUNCNEST +If set to a numeric value greater than 0, defines a maximum function +nesting level. Function invocations that exceed this nesting level +will cause the current command to abort. + +@item GLOBIGNORE +A colon-separated list of patterns defining the set of filenames to +be ignored by filename expansion. +If a filename matched by a filename expansion pattern also matches one +of the patterns in @env{GLOBIGNORE}, it is removed from the list +of matches. + +@item GROUPS +An array variable containing the list of groups of which the current +user is a member. +Assignments to @env{GROUPS} have no effect and return an error status. +If @env{GROUPS} is unset, it loses its special properties, even if it is +subsequently reset. + +@item histchars +Up to three characters which control history expansion, quick +substitution, and tokenization (@pxref{History Interaction}). +The first character is the +@var{history expansion} character, that is, the character which signifies the +start of a history expansion, normally @samp{!}. The second character is the +character which signifies `quick substitution' when seen as the first +character on a line, normally @samp{^}. The optional third character is the +character which indicates that the remainder of the line is a comment when +found as the first character of a word, usually @samp{#}. The history +comment character causes history substitution to be skipped for the +remaining words on the line. It does not necessarily cause the shell +parser to treat the rest of the line as a comment. + +@item HISTCMD +The history number, or index in the history list, of the current +command. If @env{HISTCMD} is unset, it loses its special properties, +even if it is subsequently reset. + +@item HISTCONTROL +A colon-separated list of values controlling how commands are saved on +the history list. +If the list of values includes @samp{ignorespace}, lines which begin +with a space character are not saved in the history list. +A value of @samp{ignoredups} causes lines which match the previous +history entry to not be saved. +A value of @samp{ignoreboth} is shorthand for +@samp{ignorespace} and @samp{ignoredups}. +A value of @samp{erasedups} causes all previous lines matching the +current line to be removed from the history list before that line +is saved. +Any value not in the above list is ignored. +If @env{HISTCONTROL} is unset, or does not include a valid value, +all lines read by the shell parser are saved on the history list, +subject to the value of @env{HISTIGNORE}. +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +@env{HISTCONTROL}. + +@item HISTFILE +The name of the file to which the command history is saved. The +default value is @file{~/.bash_history}. + +@item HISTFILESIZE +The maximum number of lines contained in the history file. +When this variable is assigned a value, the history file is truncated, +if necessary, to contain no more than that number of lines +by removing the oldest entries. +The history file is also truncated to this size after +writing it when a shell exits. +If the value is 0, the history file is truncated to zero size. +Non-numeric values and numeric values less than zero inhibit truncation. +The shell sets the default value to the value of @env{HISTSIZE} +after reading any startup files. + +@item HISTIGNORE +A colon-separated list of patterns used to decide which command +lines should be saved on the history list. Each pattern is +anchored at the beginning of the line and must match the complete +line (no implicit @samp{*} is appended). Each pattern is tested +against the line after the checks specified by @env{HISTCONTROL} +are applied. In addition to the normal shell pattern matching +characters, @samp{&} matches the previous history line. @samp{&} +may be escaped using a backslash; the backslash is removed +before attempting a match. +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +@env{HISTIGNORE}. + +@env{HISTIGNORE} subsumes the function of @env{HISTCONTROL}. A +pattern of @samp{&} is identical to @code{ignoredups}, and a +pattern of @samp{[ ]*} is identical to @code{ignorespace}. +Combining these two patterns, separating them with a colon, +provides the functionality of @code{ignoreboth}. + +@item HISTSIZE +The maximum number of commands to remember on the history list. +If the value is 0, commands are not saved in the history list. +Numeric values less than zero result in every command being saved +on the history list (there is no limit). +The shell sets the default value to 500 after reading any startup files. + +@item HISTTIMEFORMAT +If this variable is set and not null, its value is used as a format string +for @var{strftime} to print the time stamp associated with each history +entry displayed by the @code{history} builtin. +If this variable is set, time stamps are written to the history file so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. + +@item HOSTFILE +Contains the name of a file in the same format as @file{/etc/hosts} that +should be read when the shell needs to complete a hostname. +The list of possible hostname completions may be changed while the shell +is running; +the next time hostname completion is attempted after the +value is changed, Bash adds the contents of the new file to the +existing list. +If @env{HOSTFILE} is set, but has no value, or does not name a readable file, +Bash attempts to read +@file{/etc/hosts} to obtain the list of possible hostname completions. +When @env{HOSTFILE} is unset, the hostname list is cleared. + +@item HOSTNAME +The name of the current host. + +@item HOSTTYPE +A string describing the machine Bash is running on. + +@item IGNOREEOF +Controls the action of the shell on receipt of an @code{EOF} character +as the sole input. If set, the value denotes the number +of consecutive @code{EOF} characters that can be read as the +first character on an input line +before the shell will exit. If the variable exists but does not +have a numeric value (or has no value) then the default is 10. +If the variable does not exist, then @code{EOF} signifies the end of +input to the shell. This is only in effect for interactive shells. + +@item INPUTRC +The name of the Readline initialization file, overriding the default +of @file{~/.inputrc}. + +@item LANG +Used to determine the locale category for any category not specifically +selected with a variable starting with @code{LC_}. + +@item LC_ALL +This variable overrides the value of @env{LANG} and any other +@code{LC_} variable specifying a locale category. + +@item LC_COLLATE +This variable determines the collation order used when sorting the +results of filename expansion, and +determines the behavior of range expressions, equivalence classes, +and collating sequences within filename expansion and pattern matching +(@pxref{Filename Expansion}). + +@item LC_CTYPE +This variable determines the interpretation of characters and the +behavior of character classes within filename expansion and pattern +matching (@pxref{Filename Expansion}). + +@item LC_MESSAGES +This variable determines the locale used to translate double-quoted +strings preceded by a @samp{$} (@pxref{Locale Translation}). + +@item LC_NUMERIC +This variable determines the locale category used for number formatting. + +@item LINENO +The line number in the script or shell function currently executing. + +@item LINES +Used by the @code{select} command to determine the column length +for printing selection lists. +Automatically set if the @code{checkwinsize} option is enabled +(@pxref{The Shopt Builtin}), or in an interactive shell upon receipt of a +@code{SIGWINCH}. + +@item MACHTYPE +A string that fully describes the system type on which Bash +is executing, in the standard @sc{gnu} @var{cpu-company-system} format. + +@item MAILCHECK +How often (in seconds) that the shell should check for mail in the +files specified in the @env{MAILPATH} or @env{MAIL} variables. +The default is 60 seconds. When it is time to check +for mail, the shell does so before displaying the primary prompt. +If this variable is unset, or set to a value that is not a number +greater than or equal to zero, the shell disables mail checking. + +@item MAPFILE +An array variable created to hold the text read by the +@code{mapfile} builtin when no variable name is supplied. + +@item OLDPWD +The previous working directory as set by the @code{cd} builtin. + +@item OPTERR +If set to the value 1, Bash displays error messages +generated by the @code{getopts} builtin command. + +@item OSTYPE +A string describing the operating system Bash is running on. + +@item PIPESTATUS +An array variable (@pxref{Arrays}) +containing a list of exit status values from the processes +in the most-recently-executed foreground pipeline (which may +contain only a single command). + +@item POSIXLY_CORRECT +If this variable is in the environment when Bash starts, the shell +enters @sc{posix} mode (@pxref{Bash POSIX Mode}) before reading the +startup files, as if the @option{--posix} invocation option had been supplied. +If it is set while the shell is running, Bash enables @sc{posix} mode, +as if the command +@example +@code{set -o posix} +@end example +@noindent +had been executed. + +@item PPID +The process @sc{id} of the shell's parent process. This variable +is readonly. + +@item PROMPT_COMMAND +If set, the value is interpreted as a command to execute +before the printing of each primary prompt (@env{$PS1}). + +@item PROMPT_DIRTRIM +If set to a number greater than zero, the value is used as the number of +trailing directory components to retain when expanding the @code{\w} and +@code{\W} prompt string escapes (@pxref{Controlling the Prompt}). +Characters removed are replaced with an ellipsis. + +@item PS3 +The value of this variable is used as the prompt for the +@code{select} command. If this variable is not set, the +@code{select} command prompts with @samp{#? } + +@item PS4 +The value is the prompt printed before the command line is echoed +when the @option{-x} option is set (@pxref{The Set Builtin}). +The first character of @env{PS4} is replicated multiple times, as +necessary, to indicate multiple levels of indirection. +The default is @samp{+ }. + +@item PWD +The current working directory as set by the @code{cd} builtin. + +@item RANDOM +Each time this parameter is referenced, a random integer +between 0 and 32767 is generated. Assigning a value to this +variable seeds the random number generator. + +@item READLINE_LINE +The contents of the Readline line buffer, for use +with @samp{bind -x} (@pxref{Bash Builtins}). + +@item READLINE_POINT +The position of the insertion point in the Readline line buffer, for use +with @samp{bind -x} (@pxref{Bash Builtins}). + +@item REPLY +The default variable for the @code{read} builtin. + +@item SECONDS +This variable expands to the number of seconds since the +shell was started. Assignment to this variable resets +the count to the value assigned, and the expanded value +becomes the value assigned plus the number of seconds +since the assignment. + +@item SHELL +The full pathname to the shell is kept in this environment variable. +If it is not set when the shell starts, +Bash assigns to it the full pathname of the current user's login shell. + +@item SHELLOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the @option{-o} option to the +@code{set} builtin command (@pxref{The Set Builtin}). +The options appearing in @env{SHELLOPTS} are those reported +as @samp{on} by @samp{set -o}. +If this variable is in the environment when Bash +starts up, each shell option in the list will be enabled before +reading any startup files. This variable is readonly. + +@item SHLVL +Incremented by one each time a new instance of Bash is started. This is +intended to be a count of how deeply your Bash shells are nested. + +@item TIMEFORMAT +The value of this parameter is used as a format string specifying +how the timing information for pipelines prefixed with the @code{time} +reserved word should be displayed. +The @samp{%} character introduces an +escape sequence that is expanded to a time value or other +information. +The escape sequences and their meanings are as +follows; the braces denote optional portions. + +@table @code + +@item %% +A literal @samp{%}. + +@item %[@var{p}][l]R +The elapsed time in seconds. + +@item %[@var{p}][l]U +The number of CPU seconds spent in user mode. + +@item %[@var{p}][l]S +The number of CPU seconds spent in system mode. + +@item %P +The CPU percentage, computed as (%U + %S) / %R. +@end table + +The optional @var{p} is a digit specifying the precision, the number of +fractional digits after a decimal point. +A value of 0 causes no decimal point or fraction to be output. +At most three places after the decimal point may be specified; values +of @var{p} greater than 3 are changed to 3. +If @var{p} is not specified, the value 3 is used. + +The optional @code{l} specifies a longer format, including minutes, of +the form @var{MM}m@var{SS}.@var{FF}s. +The value of @var{p} determines whether or not the fraction is included. + +If this variable is not set, Bash acts as if it had the value +@example +@code{$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'} +@end example +If the value is null, no timing information is displayed. +A trailing newline is added when the format string is displayed. + +@item TMOUT +If set to a value greater than zero, @code{TMOUT} is treated as the +default timeout for the @code{read} builtin (@pxref{Bash Builtins}). +The @code{select} command (@pxref{Conditional Constructs}) terminates +if input does not arrive after @code{TMOUT} seconds when input is coming +from a terminal. + +In an interactive shell, the value is interpreted as +the number of seconds to wait for a line of input after issuing +the primary prompt. +Bash +terminates after waiting for that number of seconds if a complete +line of input does not arrive. + +@item TMPDIR +If set, Bash uses its value as the name of a directory in which +Bash creates temporary files for the shell's use. + +@item UID +The numeric real user id of the current user. This variable is readonly. + +@end vtable + +@node Bash Features +@chapter Bash Features + +This chapter describes features unique to Bash. + +@menu +* Invoking Bash:: Command line options that you can give + to Bash. +* Bash Startup Files:: When and how Bash executes scripts. +* Interactive Shells:: What an interactive shell is. +* Bash Conditional Expressions:: Primitives used in composing expressions for + the @code{test} builtin. +* Shell Arithmetic:: Arithmetic on shell variables. +* Aliases:: Substituting one command for another. +* Arrays:: Array Variables. +* The Directory Stack:: History of visited directories. +* Controlling the Prompt:: Customizing the various prompt strings. +* The Restricted Shell:: A more controlled mode of shell execution. +* Bash POSIX Mode:: Making Bash behave more closely to what + the POSIX standard specifies. +@end menu + +@node Invoking Bash +@section Invoking Bash + +@example +bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o @var{option}] [-O @var{shopt_option}] [@var{argument} @dots{}] +bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o @var{option}] [-O @var{shopt_option}] -c @var{string} [@var{argument} @dots{}] +bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o @var{option}] [-O @var{shopt_option}] [@var{argument} @dots{}] +@end example + +All of the single-character options used with the @code{set} builtin +(@pxref{The Set Builtin}) can be used as options when the shell is invoked. +In addition, there are several multi-character +options that you can use. These options must appear on the command +line before the single-character options to be recognized. + +@table @code +@item --debugger +Arrange for the debugger profile to be executed before the shell +starts. Turns on extended debugging mode (see @ref{The Shopt Builtin} +for a description of the @code{extdebug} option to the @code{shopt} +builtin). + +@item --dump-po-strings +A list of all double-quoted strings preceded by @samp{$} +is printed on the standard output +in the @sc{gnu} @code{gettext} PO (portable object) file format. +Equivalent to @option{-D} except for the output format. + +@item --dump-strings +Equivalent to @option{-D}. + +@item --help +Display a usage message on standard output and exit successfully. + +@item --init-file @var{filename} +@itemx --rcfile @var{filename} +Execute commands from @var{filename} (instead of @file{~/.bashrc}) +in an interactive shell. + +@item --login +Equivalent to @option{-l}. + +@item --noediting +Do not use the @sc{gnu} Readline library (@pxref{Command Line Editing}) +to read command lines when the shell is interactive. + +@item --noprofile +Don't load the system-wide startup file @file{/etc/profile} +or any of the personal initialization files +@file{~/.bash_profile}, @file{~/.bash_login}, or @file{~/.profile} +when Bash is invoked as a login shell. + +@item --norc +Don't read the @file{~/.bashrc} initialization file in an +interactive shell. This is on by default if the shell is +invoked as @code{sh}. + +@item --posix +Change the behavior of Bash where the default operation differs +from the @sc{posix} standard to match the standard. This +is intended to make Bash behave as a strict superset of that +standard. @xref{Bash POSIX Mode}, for a description of the Bash +@sc{posix} mode. + +@item --restricted +Make the shell a restricted shell (@pxref{The Restricted Shell}). + +@item --verbose +Equivalent to @option{-v}. Print shell input lines as they're read. + +@item --version +Show version information for this instance of +Bash on the standard output and exit successfully. +@end table + +There are several single-character options that may be supplied at +invocation which are not available with the @code{set} builtin. + +@table @code +@item -c +Read and execute commands from the first non-option @var{argument} +after processing the options, then exit. +Any remaining arguments are assigned to the +positional parameters, starting with @code{$0}. + +@item -i +Force the shell to run interactively. Interactive shells are +described in @ref{Interactive Shells}. + +@item -l +Make this shell act as if it had been directly invoked by login. +When the shell is interactive, this is equivalent to starting a +login shell with @samp{exec -l bash}. +When the shell is not interactive, the login shell startup files will +be executed. +@samp{exec bash -l} or @samp{exec bash --login} +will replace the current shell with a Bash login shell. +@xref{Bash Startup Files}, for a description of the special behavior +of a login shell. + +@item -r +Make the shell a restricted shell (@pxref{The Restricted Shell}). + +@item -s +If this option is present, or if no arguments remain after option +processing, then commands are read from the standard input. +This option allows the positional parameters to be set +when invoking an interactive shell. + +@item -D +A list of all double-quoted strings preceded by @samp{$} +is printed on the standard output. +These are the strings that +are subject to language translation when the current locale +is not @code{C} or @code{POSIX} (@pxref{Locale Translation}). +This implies the @option{-n} option; no commands will be executed. + +@item [-+]O [@var{shopt_option}] +@var{shopt_option} is one of the shell options accepted by the +@code{shopt} builtin (@pxref{The Shopt Builtin}). +If @var{shopt_option} is present, @option{-O} sets the value of that option; +@option{+O} unsets it. +If @var{shopt_option} is not supplied, the names and values of the shell +options accepted by @code{shopt} are printed on the standard output. +If the invocation option is @option{+O}, the output is displayed in a format +that may be reused as input. + +@item -- +A @code{--} signals the end of options and disables further option +processing. +Any arguments after the @code{--} are treated as filenames and arguments. +@end table + +@cindex login shell +A @emph{login} shell is one whose first character of argument zero is +@samp{-}, or one invoked with the @option{--login} option. + +@cindex interactive shell +An @emph{interactive} shell is one started without non-option arguments, +unless @option{-s} is specified, +without specifying the @option{-c} option, and whose input and output are both +connected to terminals (as determined by @code{isatty(3)}), or one +started with the @option{-i} option. @xref{Interactive Shells}, for more +information. + +If arguments remain after option processing, and neither the +@option{-c} nor the @option{-s} +option has been supplied, the first argument is assumed to +be the name of a file containing shell commands (@pxref{Shell Scripts}). +When Bash is invoked in this fashion, @code{$0} +is set to the name of the file, and the positional parameters +are set to the remaining arguments. +Bash reads and executes commands from this file, then exits. +Bash's exit status is the exit status of the last command executed +in the script. If no commands are executed, the exit status is 0. + +@node Bash Startup Files +@section Bash Startup Files +@cindex startup files + +This section describes how Bash executes its startup files. +If any of the files exist but cannot be read, Bash reports an error. +Tildes are expanded in filenames as described above under +Tilde Expansion (@pxref{Tilde Expansion}). + +Interactive shells are described in @ref{Interactive Shells}. + +@subsubheading Invoked as an interactive login shell, or with @option{--login} + +When Bash is invoked as an interactive login shell, or as a +non-interactive shell with the @option{--login} option, it first reads and +executes commands from the file @file{/etc/profile}, if that file exists. +After reading that file, it looks for @file{~/.bash_profile}, +@file{~/.bash_login}, and @file{~/.profile}, in that order, and reads +and executes commands from the first one that exists and is readable. +The @option{--noprofile} option may be used when the shell is started to +inhibit this behavior. + +When a login shell exits, Bash reads and executes commands from +the file @file{~/.bash_logout}, if it exists. + +@subsubheading Invoked as an interactive non-login shell + +When an interactive shell that is not a login shell is started, Bash +reads and executes commands from @file{~/.bashrc}, if that file exists. +This may be inhibited by using the @option{--norc} option. +The @option{--rcfile @var{file}} option will force Bash to read and +execute commands from @var{file} instead of @file{~/.bashrc}. + +So, typically, your @file{~/.bash_profile} contains the line +@example +@code{if [ -f ~/.bashrc ]; then . ~/.bashrc; fi} +@end example +@noindent +after (or before) any login-specific initializations. + +@subsubheading Invoked non-interactively + +When Bash is started non-interactively, to run a shell script, +for example, it looks for the variable @env{BASH_ENV} in the environment, +expands its value if it appears there, and uses the expanded value as +the name of a file to read and execute. Bash behaves as if the +following command were executed: +@example +@code{if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi} +@end example +@noindent +but the value of the @env{PATH} variable is not used to search for the +filename. + +As noted above, if a non-interactive shell is invoked with the +@option{--login} option, Bash attempts to read and execute commands from the +login shell startup files. + +@subsubheading Invoked with name @code{sh} + +If Bash is invoked with the name @code{sh}, it tries to mimic the +startup behavior of historical versions of @code{sh} as closely as +possible, while conforming to the @sc{posix} standard as well. + +When invoked as an interactive login shell, or as a non-interactive +shell with the @option{--login} option, it first attempts to read +and execute commands from @file{/etc/profile} and @file{~/.profile}, in +that order. +The @option{--noprofile} option may be used to inhibit this behavior. +When invoked as an interactive shell with the name @code{sh}, Bash +looks for the variable @env{ENV}, expands its value if it is defined, +and uses the expanded value as the name of a file to read and execute. +Since a shell invoked as @code{sh} does not attempt to read and execute +commands from any other startup files, the @option{--rcfile} option has +no effect. +A non-interactive shell invoked with the name @code{sh} does not attempt +to read any other startup files. + +When invoked as @code{sh}, Bash enters @sc{posix} mode after +the startup files are read. + +@subsubheading Invoked in @sc{posix} mode + +When Bash is started in @sc{posix} mode, as with the +@option{--posix} command line option, it follows the @sc{posix} standard +for startup files. +In this mode, interactive shells expand the @env{ENV} variable +and commands are read and executed from the file whose name is the +expanded value. +No other startup files are read. + +@subsubheading Invoked by remote shell daemon + +Bash attempts to determine when it is being run with its standard input +connected to a network connection, as when executed by the remote shell +daemon, usually @code{rshd}, or the secure shell daemon @code{sshd}. +If Bash determines it is being run in +this fashion, it reads and executes commands from @file{~/.bashrc}, if that +file exists and is readable. +It will not do this if invoked as @code{sh}. +The @option{--norc} option may be used to inhibit this behavior, and the +@option{--rcfile} option may be used to force another file to be read, but +neither @code{rshd} nor @code{sshd} generally invoke the shell with those +options or allow them to be specified. + +@subsubheading Invoked with unequal effective and real @sc{uid/gid}s + +If Bash is started with the effective user (group) id not equal to the +real user (group) id, and the @option{-p} option is not supplied, no startup +files are read, shell functions are not inherited from the environment, +the @env{SHELLOPTS}, @env{BASHOPTS}, @env{CDPATH}, and @env{GLOBIGNORE} +variables, if they appear in the environment, are ignored, and the effective +user id is set to the real user id. +If the @option{-p} option is supplied at invocation, the startup behavior is +the same, but the effective user id is not reset. + +@node Interactive Shells +@section Interactive Shells +@cindex interactive shell +@cindex shell, interactive + +@menu +* What is an Interactive Shell?:: What determines whether a shell is Interactive. +* Is this Shell Interactive?:: How to tell if a shell is interactive. +* Interactive Shell Behavior:: What changes in a interactive shell? +@end menu + +@node What is an Interactive Shell? +@subsection What is an Interactive Shell? + +An interactive shell +is one started without non-option arguments, unless @option{-s} is +specified, without specifying the @option{-c} option, and +whose input and error output are both +connected to terminals (as determined by @code{isatty(3)}), +or one started with the @option{-i} option. + +An interactive shell generally reads from and writes to a user's +terminal. + +The @option{-s} invocation option may be used to set the positional parameters +when an interactive shell is started. + +@node Is this Shell Interactive? +@subsection Is this Shell Interactive? + +To determine within a startup script whether or not Bash is +running interactively, +test the value of the @samp{-} special parameter. +It contains @code{i} when the shell is interactive. For example: + +@example +case "$-" in +*i*) echo This shell is interactive ;; +*) echo This shell is not interactive ;; +esac +@end example + +Alternatively, startup scripts may examine the variable +@env{PS1}; it is unset in non-interactive shells, and set in +interactive shells. Thus: + +@example +if [ -z "$PS1" ]; then + echo This shell is not interactive +else + echo This shell is interactive +fi +@end example + +@node Interactive Shell Behavior +@subsection Interactive Shell Behavior + +When the shell is running interactively, it changes its behavior in +several ways. + +@enumerate +@item +Startup files are read and executed as described in @ref{Bash Startup Files}. + +@item +Job Control (@pxref{Job Control}) is enabled by default. When job +control is in effect, Bash ignores the keyboard-generated job control +signals @code{SIGTTIN}, @code{SIGTTOU}, and @code{SIGTSTP}. + +@item +Bash expands and displays @env{PS1} before reading the first line +of a command, and expands and displays @env{PS2} before reading the +second and subsequent lines of a multi-line command. + +@item +Bash executes the value of the @env{PROMPT_COMMAND} variable as a command +before printing the primary prompt, @env{$PS1} +(@pxref{Bash Variables}). + +@item +Readline (@pxref{Command Line Editing}) is used to read commands from +the user's terminal. + +@item +Bash inspects the value of the @code{ignoreeof} option to @code{set -o} +instead of exiting immediately when it receives an @code{EOF} on its +standard input when reading a command (@pxref{The Set Builtin}). + +@item +Command history (@pxref{Bash History Facilities}) +and history expansion (@pxref{History Interaction}) +are enabled by default. +Bash will save the command history to the file named by @env{$HISTFILE} +when a shell with history enabled exits. + +@item +Alias expansion (@pxref{Aliases}) is performed by default. + +@item +In the absence of any traps, Bash ignores @code{SIGTERM} +(@pxref{Signals}). + +@item +In the absence of any traps, @code{SIGINT} is caught and handled +((@pxref{Signals}). +@code{SIGINT} will interrupt some shell builtins. + +@item +An interactive login shell sends a @code{SIGHUP} to all jobs on exit +if the @code{huponexit} shell option has been enabled (@pxref{Signals}). + +@item +The @option{-n} invocation option is ignored, and @samp{set -n} has +no effect (@pxref{The Set Builtin}). + +@item +Bash will check for mail periodically, depending on the values of the +@env{MAIL}, @env{MAILPATH}, and @env{MAILCHECK} shell variables +(@pxref{Bash Variables}). + +@item +Expansion errors due to references to unbound shell variables after +@samp{set -u} has been enabled will not cause the shell to exit +(@pxref{The Set Builtin}). + +@item +The shell will not exit on expansion errors caused by @var{var} being unset +or null in @code{$@{@var{var}:?@var{word}@}} expansions +(@pxref{Shell Parameter Expansion}). + +@item +Redirection errors encountered by shell builtins will not cause the +shell to exit. + +@item +When running in @sc{posix} mode, a special builtin returning an error +status will not cause the shell to exit (@pxref{Bash POSIX Mode}). + +@item +A failed @code{exec} will not cause the shell to exit +(@pxref{Bourne Shell Builtins}). + +@item +Parser syntax errors will not cause the shell to exit. + +@item +Simple spelling correction for directory arguments to the @code{cd} +builtin is enabled by default (see the description of the @code{cdspell} +option to the @code{shopt} builtin in @ref{The Shopt Builtin}). + +@item +The shell will check the value of the @env{TMOUT} variable and exit +if a command is not read within the specified number of seconds after +printing @env{$PS1} (@pxref{Bash Variables}). + +@end enumerate + +@node Bash Conditional Expressions +@section Bash Conditional Expressions +@cindex expressions, conditional + +Conditional expressions are used by the @code{[[} compound command +and the @code{test} and @code{[} builtin commands. + +Expressions may be unary or binary. +Unary expressions are often used to examine the status of a file. +There are string operators and numeric comparison operators as well. +If the @var{file} argument to one of the primaries is of the form +@file{/dev/fd/@var{N}}, then file descriptor @var{N} is checked. +If the @var{file} argument to one of the primaries is one of +@file{/dev/stdin}, @file{/dev/stdout}, or @file{/dev/stderr}, file +descriptor 0, 1, or 2, respectively, is checked. + +When used with @code{[[}, the @samp{<} and @samp{>} operators sort +lexicographically using the current locale. +The @code{test} command uses ASCII ordering. + +Unless otherwise specified, primaries that operate on files follow symbolic +links and operate on the target of the link, rather than the link itself. + +@table @code +@item -a @var{file} +True if @var{file} exists. + +@item -b @var{file} +True if @var{file} exists and is a block special file. + +@item -c @var{file} +True if @var{file} exists and is a character special file. + +@item -d @var{file} +True if @var{file} exists and is a directory. + +@item -e @var{file} +True if @var{file} exists. + +@item -f @var{file} +True if @var{file} exists and is a regular file. + +@item -g @var{file} +True if @var{file} exists and its set-group-id bit is set. + +@item -h @var{file} +True if @var{file} exists and is a symbolic link. + +@item -k @var{file} +True if @var{file} exists and its "sticky" bit is set. + +@item -p @var{file} +True if @var{file} exists and is a named pipe (FIFO). + +@item -r @var{file} +True if @var{file} exists and is readable. + +@item -s @var{file} +True if @var{file} exists and has a size greater than zero. + +@item -t @var{fd} +True if file descriptor @var{fd} is open and refers to a terminal. + +@item -u @var{file} +True if @var{file} exists and its set-user-id bit is set. + +@item -w @var{file} +True if @var{file} exists and is writable. + +@item -x @var{file} +True if @var{file} exists and is executable. + +@item -G @var{file} +True if @var{file} exists and is owned by the effective group id. + +@item -L @var{file} +True if @var{file} exists and is a symbolic link. + +@item -N @var{file} +True if @var{file} exists and has been modified since it was last read. + +@item -O @var{file} +True if @var{file} exists and is owned by the effective user id. + +@item -S @var{file} +True if @var{file} exists and is a socket. + +@item @var{file1} -ef @var{file2} +True if @var{file1} and @var{file2} refer to the same device and +inode numbers. + +@item @var{file1} -nt @var{file2} +True if @var{file1} is newer (according to modification date) +than @var{file2}, or if @var{file1} exists and @var{file2} does not. + +@item @var{file1} -ot @var{file2} +True if @var{file1} is older than @var{file2}, +or if @var{file2} exists and @var{file1} does not. + +@item -o @var{optname} +True if the shell option @var{optname} is enabled. +The list of options appears in the description of the @option{-o} +option to the @code{set} builtin (@pxref{The Set Builtin}). + +@item -v @var{varname} +True if the shell variable @var{varname} is set (has been assigned a value). + +@item -R @var{varname} +True if the shell variable @var{varname} is set and is a name reference. + +@item -z @var{string} +True if the length of @var{string} is zero. + +@item -n @var{string} +@itemx @var{string} +True if the length of @var{string} is non-zero. + +@item @var{string1} == @var{string2} +@itemx @var{string1} = @var{string2} +True if the strings are equal. +When used with the @code{[[} command, this performs pattern matching as +described above (@pxref{Conditional Constructs}). + +@samp{=} should be used with the @code{test} command for @sc{posix} conformance. + +@item @var{string1} != @var{string2} +True if the strings are not equal. + +@item @var{string1} < @var{string2} +True if @var{string1} sorts before @var{string2} lexicographically. + +@item @var{string1} > @var{string2} +True if @var{string1} sorts after @var{string2} lexicographically. + +@item @var{arg1} OP @var{arg2} +@code{OP} is one of +@samp{-eq}, @samp{-ne}, @samp{-lt}, @samp{-le}, @samp{-gt}, or @samp{-ge}. +These arithmetic binary operators return true if @var{arg1} +is equal to, not equal to, less than, less than or equal to, +greater than, or greater than or equal to @var{arg2}, +respectively. @var{Arg1} and @var{arg2} +may be positive or negative integers. +@end table + +@node Shell Arithmetic +@section Shell Arithmetic +@cindex arithmetic, shell +@cindex shell arithmetic +@cindex expressions, arithmetic +@cindex evaluation, arithmetic +@cindex arithmetic evaluation + +The shell allows arithmetic expressions to be evaluated, as one of +the shell expansions or by the @code{let} and the @option{-i} option +to the @code{declare} builtins. + +Evaluation is done in fixed-width integers with no check for overflow, +though division by 0 is trapped and flagged as an error. +The operators and their precedence, associativity, and values +are the same as in the C language. +The following list of operators is grouped into levels of +equal-precedence operators. +The levels are listed in order of decreasing precedence. + +@table @code + +@item @var{id}++ @var{id}-- +variable post-increment and post-decrement + +@item ++@var{id} --@var{id} +variable pre-increment and pre-decrement + +@item - + +unary minus and plus + +@item ! ~ +logical and bitwise negation + +@item ** +exponentiation + +@item * / % +multiplication, division, remainder + +@item + - +addition, subtraction + +@item << >> +left and right bitwise shifts + +@item <= >= < > +comparison + +@item == != +equality and inequality + +@item & +bitwise AND + +@item ^ +bitwise exclusive OR + +@item | +bitwise OR + +@item && +logical AND + +@item || +logical OR + +@item expr ? expr : expr +conditional operator + +@item = *= /= %= += -= <<= >>= &= ^= |= +assignment + +@item expr1 , expr2 +comma +@end table + +Shell variables are allowed as operands; parameter expansion is +performed before the expression is evaluated. +Within an expression, shell variables may also be referenced by name +without using the parameter expansion syntax. +A shell variable that is null or unset evaluates to 0 when referenced +by name without using the parameter expansion syntax. +The value of a variable is evaluated as an arithmetic expression +when it is referenced, or when a variable which has been given the +@var{integer} attribute using @samp{declare -i} is assigned a value. +A null value evaluates to 0. +A shell variable need not have its @var{integer} attribute turned on +to be used in an expression. + +Constants with a leading 0 are interpreted as octal numbers. +A leading @samp{0x} or @samp{0X} denotes hexadecimal. Otherwise, +numbers take the form [@var{base}@code{#}]@var{n}, where the optional @var{base} +is a decimal number between 2 and 64 representing the arithmetic +base, and @var{n} is a number in that base. +If @var{base}@code{#} is omitted, then base 10 is used. +When specifying @var{n}, +he digits greater than 9 are represented by the lowercase letters, +the uppercase letters, @samp{@@}, and @samp{_}, in that order. +If @var{base} is less than or equal to 36, lowercase and uppercase +letters may be used interchangeably to represent numbers between 10 +and 35. + +Operators are evaluated in order of precedence. Sub-expressions in +parentheses are evaluated first and may override the precedence +rules above. + +@node Aliases +@section Aliases +@cindex alias expansion + +@var{Aliases} allow a string to be substituted for a word when it is used +as the first word of a simple command. +The shell maintains a list of aliases that may be set and unset with +the @code{alias} and @code{unalias} builtin commands. + +The first word of each simple command, if unquoted, is checked to see +if it has an alias. +If so, that word is replaced by the text of the alias. +The characters @samp{/}, @samp{$}, @samp{`}, @samp{=} and any of the +shell metacharacters or quoting characters listed above may not appear +in an alias name. +The replacement text may contain any valid +shell input, including shell metacharacters. +The first word of the replacement text is tested for +aliases, but a word that is identical to an alias being expanded +is not expanded a second time. +This means that one may alias @code{ls} to @code{"ls -F"}, +for instance, and Bash does not try to recursively expand the +replacement text. +If the last character of the alias value is a +@var{blank}, then the next command word following the +alias is also checked for alias expansion. + +Aliases are created and listed with the @code{alias} +command, and removed with the @code{unalias} command. + +There is no mechanism for using arguments in the replacement text, +as in @code{csh}. +If arguments are needed, a shell function should be used +(@pxref{Shell Functions}). + +Aliases are not expanded when the shell is not interactive, +unless the @code{expand_aliases} shell option is set using +@code{shopt} (@pxref{The Shopt Builtin}). + +The rules concerning the definition and use of aliases are +somewhat confusing. Bash +always reads at least one complete line +of input before executing any +of the commands on that line. Aliases are expanded when a +command is read, not when it is executed. Therefore, an +alias definition appearing on the same line as another +command does not take effect until the next line of input is read. +The commands following the alias definition +on that line are not affected by the new alias. +This behavior is also an issue when functions are executed. +Aliases are expanded when a function definition is read, +not when the function is executed, because a function definition +is itself a compound command. As a consequence, aliases +defined in a function are not available until after that +function is executed. To be safe, always put +alias definitions on a separate line, and do not use @code{alias} +in compound commands. + +For almost every purpose, shell functions are preferred over aliases. + +@node Arrays +@section Arrays +@cindex arrays + +Bash provides one-dimensional indexed and associative array variables. +Any variable may be used as an indexed array; +the @code{declare} builtin will explicitly declare an array. +There is no maximum +limit on the size of an array, nor any requirement that members +be indexed or assigned contiguously. +Indexed arrays are referenced using integers (including arithmetic +expressions (@pxref{Shell Arithmetic})) and are zero-based; +associative arrays use arbitrary strings. +Unless otherwise noted, indexed array indices must be non-negative integers. + +An indexed array is created automatically if any variable is assigned to +using the syntax +@example +@var{name}[@var{subscript}]=@var{value} +@end example + +@noindent +The @var{subscript} +is treated as an arithmetic expression that must evaluate to a number. +To explicitly declare an array, use +@example +declare -a @var{name} +@end example +@noindent +The syntax +@example +declare -a @var{name}[@var{subscript}] +@end example +@noindent +is also accepted; the @var{subscript} is ignored. + +@noindent +Associative arrays are created using +@example +declare -A @var{name}. +@end example + +Attributes may be +specified for an array variable using the @code{declare} and +@code{readonly} builtins. Each attribute applies to all members of +an array. + +Arrays are assigned to using compound assignments of the form +@example +@var{name}=(@var{value1} @var{value2} @dots{} ) +@end example +@noindent +where each +@var{value} is of the form @code{[@var{subscript}]=}@var{string}. +Indexed array assignments do not require anything but @var{string}. +When assigning to indexed arrays, if +the optional subscript is supplied, that index is assigned to; +otherwise the index of the element assigned is the last index assigned +to by the statement plus one. Indexing starts at zero. + +When assigning to an associative array, the subscript is required. + +This syntax is also accepted by the @code{declare} +builtin. Individual array elements may be assigned to using the +@code{@var{name}[@var{subscript}]=@var{value}} syntax introduced above. + +When assigning to an indexed array, if @var{name} +is subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +@var{name}, so negative indices count back from the end of the +array, and an index of -1 references the last element. + +Any element of an array may be referenced using +@code{$@{@var{name}[@var{subscript}]@}}. +The braces are required to avoid +conflicts with the shell's filename expansion operators. If the +@var{subscript} is @samp{@@} or @samp{*}, the word expands to all members +of the array @var{name}. These subscripts differ only when the word +appears within double quotes. +If the word is double-quoted, +@code{$@{@var{name}[*]@}} expands to a single word with +the value of each array member separated by the first character of the +@env{IFS} variable, and @code{$@{@var{name}[@@]@}} expands each element of +@var{name} to a separate word. When there are no array members, +@code{$@{@var{name}[@@]@}} expands to nothing. +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +This is analogous to the +expansion of the special parameters @samp{@@} and @samp{*}. +@code{$@{#@var{name}[@var{subscript}]@}} expands to the length of +@code{$@{@var{name}[@var{subscript}]@}}. +If @var{subscript} is @samp{@@} or +@samp{*}, the expansion is the number of elements in the array. +Referencing an array variable without a subscript is equivalent to +referencing with a subscript of 0. +If the @var{subscript} +used to reference an element of an indexed array +evaluates to a number less than zero, it is +interpreted as relative to one greater than the maximum index of the array, +so negative indices count back from the end of the array, +and an index of -1 refers to the last element. + +An array variable is considered set if a subscript has been assigned a +value. The null string is a valid value. + +It is possible to obtain the keys (indices) of an array as well as the values. +$@{!@var{name}[@@]@} and $@{!@var{name}[*]@} expand to the indices +assigned in array variable @var{name}. +The treatment when in double quotes is similar to the expansion of the +special parameters @samp{@@} and @samp{*} within double quotes. + +The @code{unset} builtin is used to destroy arrays. +@code{unset @var{name}[@var{subscript}]} +destroys the array element at index @var{subscript}. +Negative subscripts to indexed arrays are interpreted as described above. +Care must be taken to avoid unwanted side effects caused by filename +expansion. +@code{unset @var{name}}, where @var{name} is an array, removes the +entire array. A subscript of @samp{*} or @samp{@@} also removes the +entire array. + +The @code{declare}, @code{local}, and @code{readonly} +builtins each accept a @option{-a} option to specify an indexed +array and a @option{-A} option to specify an associative array. +If both options are supplied, @option{-A} takes precedence. +The @code{read} builtin accepts a @option{-a} +option to assign a list of words read from the standard input +to an array, and can read values from the standard input into +individual array elements. The @code{set} and @code{declare} +builtins display array values in a way that allows them to be +reused as input. + +@node The Directory Stack +@section The Directory Stack +@cindex directory stack + +@menu +* Directory Stack Builtins:: Bash builtin commands to manipulate + the directory stack. +@end menu + +The directory stack is a list of recently-visited directories. The +@code{pushd} builtin adds directories to the stack as it changes +the current directory, and the @code{popd} builtin removes specified +directories from the stack and changes the current directory to +the directory removed. The @code{dirs} builtin displays the contents +of the directory stack. + +The contents of the directory stack are also visible +as the value of the @env{DIRSTACK} shell variable. + +@node Directory Stack Builtins +@subsection Directory Stack Builtins + +@table @code + +@item dirs +@btindex dirs +@example +dirs [-clpv] [+@var{N} | -@var{N}] +@end example + +Display the list of currently remembered directories. Directories +are added to the list with the @code{pushd} command; the +@code{popd} command removes directories from the list. + +@table @code +@item -c +Clears the directory stack by deleting all of the elements. +@item -l +Produces a listing using full pathnames; +the default listing format uses a tilde to denote the home directory. +@item -p +Causes @code{dirs} to print the directory stack with one entry per +line. +@item -v +Causes @code{dirs} to print the directory stack with one entry per +line, prefixing each entry with its index in the stack. +@item +@var{N} +Displays the @var{N}th directory (counting from the left of the +list printed by @code{dirs} when invoked without options), starting +with zero. +@item -@var{N} +Displays the @var{N}th directory (counting from the right of the +list printed by @code{dirs} when invoked without options), starting +with zero. +@end table + +@item popd +@btindex popd +@example +popd [-n] [+@var{N} | -@var{N}] +@end example + +Remove the top entry from the directory stack, and @code{cd} +to the new top directory. +When no arguments are given, @code{popd} +removes the top directory from the stack and +performs a @code{cd} to the new top directory. The +elements are numbered from 0 starting at the first directory listed with +@code{dirs}; that is, @code{popd} is equivalent to @code{popd +0}. + +@table @code +@item -n +Suppresses the normal change of directory when removing directories +from the stack, so that only the stack is manipulated. +@item +@var{N} +Removes the @var{N}th directory (counting from the left of the +list printed by @code{dirs}), starting with zero. +@item -@var{N} +Removes the @var{N}th directory (counting from the right of the +list printed by @code{dirs}), starting with zero. +@end table + +@btindex pushd +@item pushd +@example +pushd [-n] [@var{+N} | @var{-N} | @var{dir}] +@end example + +Save the current directory on the top of the directory stack +and then @code{cd} to @var{dir}. +With no arguments, @code{pushd} exchanges the top two directories. + +@table @code +@item -n +Suppresses the normal change of directory when adding directories +to the stack, so that only the stack is manipulated. +@item +@var{N} +Brings the @var{N}th directory (counting from the left of the +list printed by @code{dirs}, starting with zero) to the top of +the list by rotating the stack. +@item -@var{N} +Brings the @var{N}th directory (counting from the right of the +list printed by @code{dirs}, starting with zero) to the top of +the list by rotating the stack. +@item @var{dir} +Makes the current working directory be the top of the stack, making +it the new current directory as if it had been supplied as an argument +to the @code{cd} builtin. +@end table +@end table + +@node Controlling the Prompt +@section Controlling the Prompt +@cindex prompting + +The value of the variable @env{PROMPT_COMMAND} is examined just before +Bash prints each primary prompt. If @env{PROMPT_COMMAND} is set and +has a non-null value, then the +value is executed just as if it had been typed on the command line. + +In addition, the following table describes the special characters which +can appear in the prompt variables @env{PS1} to @env{PS4}: + +@table @code +@item \a +A bell character. +@item \d +The date, in "Weekday Month Date" format (e.g., "Tue May 26"). +@item \D@{@var{format}@} +The @var{format} is passed to @code{strftime}(3) and the result is inserted +into the prompt string; an empty @var{format} results in a locale-specific +time representation. The braces are required. +@item \e +An escape character. +@item \h +The hostname, up to the first `.'. +@item \H +The hostname. +@item \j +The number of jobs currently managed by the shell. +@item \l +The basename of the shell's terminal device name. +@item \n +A newline. +@item \r +A carriage return. +@item \s +The name of the shell, the basename of @code{$0} (the portion +following the final slash). +@item \t +The time, in 24-hour HH:MM:SS format. +@item \T +The time, in 12-hour HH:MM:SS format. +@item \@@ +The time, in 12-hour am/pm format. +@item \A +The time, in 24-hour HH:MM format. +@item \u +The username of the current user. +@item \v +The version of Bash (e.g., 2.00) +@item \V +The release of Bash, version + patchlevel (e.g., 2.00.0) +@item \w +The current working directory, with @env{$HOME} abbreviated with a tilde +(uses the @env{$PROMPT_DIRTRIM} variable). +@item \W +The basename of @env{$PWD}, with @env{$HOME} abbreviated with a tilde. +@item \! +The history number of this command. +@item \# +The command number of this command. +@item \$ +If the effective uid is 0, @code{#}, otherwise @code{$}. +@item \@var{nnn} +The character whose ASCII code is the octal value @var{nnn}. +@item \\ +A backslash. +@item \[ +Begin a sequence of non-printing characters. This could be used to +embed a terminal control sequence into the prompt. +@item \] +End a sequence of non-printing characters. +@end table + +The command number and the history number are usually different: +the history number of a command is its position in the history +list, which may include commands restored from the history file +(@pxref{Bash History Facilities}), while the command number is +the position in the sequence of commands executed during the current +shell session. + +After the string is decoded, it is expanded via +parameter expansion, command substitution, arithmetic +expansion, and quote removal, subject to the value of the +@code{promptvars} shell option (@pxref{Bash Builtins}). + +@node The Restricted Shell +@section The Restricted Shell +@cindex restricted shell + +If Bash is started with the name @code{rbash}, or the +@option{--restricted} +or +@option{-r} +option is supplied at invocation, the shell becomes restricted. +A restricted shell is used to +set up an environment more controlled than the standard shell. +A restricted shell behaves identically to @code{bash} +with the exception that the following are disallowed or not performed: + +@itemize @bullet +@item +Changing directories with the @code{cd} builtin. +@item +Setting or unsetting the values of the @env{SHELL}, @env{PATH}, +@env{ENV}, or @env{BASH_ENV} variables. +@item +Specifying command names containing slashes. +@item +Specifying a filename containing a slash as an argument to the @code{.} +builtin command. +@item +Specifying a filename containing a slash as an argument to the @option{-p} +option to the @code{hash} builtin command. +@item +Importing function definitions from the shell environment at startup. +@item +Parsing the value of @env{SHELLOPTS} from the shell environment at startup. +@item +Redirecting output using the @samp{>}, @samp{>|}, @samp{<>}, @samp{>&}, +@samp{&>}, and @samp{>>} redirection operators. +@item +Using the @code{exec} builtin to replace the shell with another command. +@item +Adding or deleting builtin commands with the +@option{-f} and @option{-d} options to the @code{enable} builtin. +@item +Using the @code{enable} builtin command to enable disabled shell builtins. +@item +Specifying the @option{-p} option to the @code{command} builtin. +@item +Turning off restricted mode with @samp{set +r} or @samp{set +o restricted}. +@end itemize + +These restrictions are enforced after any startup files are read. + +When a command that is found to be a shell script is executed +(@pxref{Shell Scripts}), @code{rbash} turns off any restrictions in +the shell spawned to execute the script. + +@node Bash POSIX Mode +@section Bash POSIX Mode +@cindex POSIX Mode + +Starting Bash with the @option{--posix} command-line option or executing +@samp{set -o posix} while Bash is running will cause Bash to conform more +closely to the @sc{posix} standard by changing the behavior to +match that specified by @sc{posix} in areas where the Bash default differs. + +When invoked as @code{sh}, Bash enters @sc{posix} mode after reading the +startup files. + +The following list is what's changed when `@sc{posix} mode' is in effect: + +@enumerate +@item +When a command in the hash table no longer exists, Bash will re-search +@env{$PATH} to find the new location. This is also available with +@samp{shopt -s checkhash}. + +@item +The message printed by the job control code and builtins when a job +exits with a non-zero status is `Done(status)'. + +@item +The message printed by the job control code and builtins when a job +is stopped is `Stopped(@var{signame})', where @var{signame} is, for +example, @code{SIGTSTP}. + +@item +The @code{bg} builtin uses the required format to describe each job placed +in the background, which does not include an indication of whether the job +is the current or previous job. + +@item +Reserved words appearing in a context where reserved words are recognized +do not undergo alias expansion. + +@item +The @sc{posix} @env{PS1} and @env{PS2} expansions of @samp{!} to +the history number and @samp{!!} to @samp{!} are enabled, +and parameter expansion is performed on the values of @env{PS1} and +@env{PS2} regardless of the setting of the @code{promptvars} option. + +@item +The @sc{posix} startup files are executed (@env{$ENV}) rather than +the normal Bash files. + +@item +Tilde expansion is only performed on assignments preceding a command +name, rather than on all assignment statements on the line. + +@item +The @code{command} builtin does not prevent builtins that take assignment +statements as arguments from expanding them as assignment statements; +when not in @sc{posix} mode, assignment builtins lose their assignment +statement expansion properties when preceded by @code{command}. + +@item +The default history file is @file{~/.sh_history} (this is the +default value of @env{$HISTFILE}). + +@item +The output of @samp{kill -l} prints all the signal names on a single line, +separated by spaces, without the @samp{SIG} prefix. + +@item +The @code{kill} builtin does not accept signal names with a @samp{SIG} +prefix. + +@item +Non-interactive shells exit if @var{filename} in @code{.} @var{filename} +is not found. + +@item +Non-interactive shells exit if a syntax error in an arithmetic expansion +results in an invalid expression. + +@item +Non-interactive shells exit if there is a syntax error in a script read +with the @code{.} or @code{source} builtins, or in a string processed by +the @code{eval} builtin. + +@item +Redirection operators do not perform filename expansion on the word +in the redirection unless the shell is interactive. + +@item +Redirection operators do not perform word splitting on the word in the +redirection. + +@item +Function names must be valid shell @code{name}s. That is, they may not +contain characters other than letters, digits, and underscores, and +may not start with a digit. Declaring a function with an invalid name +causes a fatal syntax error in non-interactive shells. + +@item +Function names may not be the same as one of the @sc{posix} special +builtins. + +@item +@sc{posix} special builtins are found before shell functions +during command lookup. + +@item +The @code{time} reserved word may be used by itself as a command. When +used in this way, it displays timing statistics for the shell and its +completed children. The @env{TIMEFORMAT} variable controls the format +of the timing information. + +@item +When parsing and expanding a $@{@dots{}@} expansion that appears within +double quotes, single quotes are no longer special and cannot be used to +quote a closing brace or other special character, unless the operator is +one of those defined to perform pattern removal. In this case, they do +not have to appear as matched pairs. + +@item +The parser does not recognize @code{time} as a reserved word if the next +token begins with a @samp{-}. + +@item +If a @sc{posix} special builtin returns an error status, a +non-interactive shell exits. The fatal errors are those listed in +the @sc{posix} standard, and include things like passing incorrect options, +redirection errors, variable assignment errors for assignments preceding +the command name, and so on. + +@item +A non-interactive shell exits with an error status if a variable +assignment error occurs when no command name follows the assignment +statements. +A variable assignment error occurs, for example, when trying to assign +a value to a readonly variable. + +@item +A non-interactive shell exits with an error status if a variable +assignment error occurs in an assignment statement preceding a special +builtin, but not with any other simple command. + +@item +A non-interactive shell exits with an error status if the iteration +variable in a @code{for} statement or the selection variable in a +@code{select} statement is a readonly variable. + +@item +Process substitution is not available. + +@item +While variable indirection is available, it may not be applied to the +@samp{#} and @samp{?} special parameters. + +@item +Assignment statements preceding @sc{posix} special builtins +persist in the shell environment after the builtin completes. + +@item +Assignment statements preceding shell function calls persist in the +shell environment after the function returns, as if a @sc{posix} +special builtin command had been executed. + +@item +The @code{export} and @code{readonly} builtin commands display their +output in the format required by @sc{posix}. + +@item +The @code{trap} builtin displays signal names without the leading +@code{SIG}. + +@item +The @code{trap} builtin doesn't check the first argument for a possible +signal specification and revert the signal handling to the original +disposition if it is, unless that argument consists solely of digits and +is a valid signal number. If users want to reset the handler for a given +signal to the original disposition, they should use @samp{-} as the +first argument. + +@item +The @code{.} and @code{source} builtins do not search the current directory +for the filename argument if it is not found by searching @env{PATH}. + +@item +Subshells spawned to execute command substitutions inherit the value of +the @option{-e} option from the parent shell. When not in @sc{posix} mode, +Bash clears the @option{-e} option in such subshells. + +@item +Alias expansion is always enabled, even in non-interactive shells. + +@item +When the @code{alias} builtin displays alias definitions, it does not +display them with a leading @samp{alias } unless the @option{-p} option +is supplied. + +@item +When the @code{set} builtin is invoked without options, it does not display +shell function names and definitions. + +@item +When the @code{set} builtin is invoked without options, it displays +variable values without quotes, unless they contain shell metacharacters, +even if the result contains nonprinting characters. + +@item +When the @code{cd} builtin is invoked in @var{logical} mode, and the pathname +constructed from @code{$PWD} and the directory name supplied as an argument +does not refer to an existing directory, @code{cd} will fail instead of +falling back to @var{physical} mode. + +@item +The @code{pwd} builtin verifies that the value it prints is the same as the +current directory, even if it is not asked to check the file system with the +@option{-P} option. + +@item +When listing the history, the @code{fc} builtin does not include an +indication of whether or not a history entry has been modified. + +@item +The default editor used by @code{fc} is @code{ed}. + +@item +The @code{type} and @code{command} builtins will not report a non-executable +file as having been found, though the shell will attempt to execute such a +file if it is the only so-named file found in @code{$PATH}. + +@item +The @code{vi} editing mode will invoke the @code{vi} editor directly when +the @samp{v} command is run, instead of checking @code{$VISUAL} and +@code{$EDITOR}. + +@item +When the @code{xpg_echo} option is enabled, Bash does not attempt to interpret +any arguments to @code{echo} as options. Each argument is displayed, after +escape characters are converted. + +@item +The @code{ulimit} builtin uses a block size of 512 bytes for the @option{-c} +and @option{-f} options. + +@item +The arrival of @code{SIGCHLD} when a trap is set on @code{SIGCHLD} does +not interrupt the @code{wait} builtin and cause it to return immediately. +The trap command is run once for each child that exits. + +@item +The @code{read} builtin may be interrupted by a signal for which a trap +has been set. +If Bash receives a trapped signal while executing @code{read}, the trap +handler executes and @code{read} returns an exit status greater than 128. + +@end enumerate + +There is other @sc{posix} behavior that Bash does not implement by +default even when in @sc{posix} mode. +Specifically: + +@enumerate + +@item +The @code{fc} builtin checks @code{$EDITOR} as a program to edit history +entries if @code{FCEDIT} is unset, rather than defaulting directly to +@code{ed}. @code{fc} uses @code{ed} if @code{EDITOR} is unset. + +@item +As noted above, Bash requires the @code{xpg_echo} option to be enabled for +the @code{echo} builtin to be fully conformant. + +@end enumerate + +Bash can be configured to be @sc{posix}-conformant by default, by specifying +the @option{--enable-strict-posix-default} to @code{configure} when building +(@pxref{Optional Features}). + +@node Job Control +@chapter Job Control + +This chapter discusses what job control is, how it works, and how +Bash allows you to access its facilities. + +@menu +* Job Control Basics:: How job control works. +* Job Control Builtins:: Bash builtin commands used to interact + with job control. +* Job Control Variables:: Variables Bash uses to customize job + control. +@end menu + +@node Job Control Basics +@section Job Control Basics +@cindex job control +@cindex foreground +@cindex background +@cindex suspending jobs + +Job control +refers to the ability to selectively stop (suspend) +the execution of processes and continue (resume) +their execution at a later point. A user typically employs +this facility via an interactive interface supplied jointly +by the operating system kernel's terminal driver and Bash. + +The shell associates a @var{job} with each pipeline. It keeps a +table of currently executing jobs, which may be listed with the +@code{jobs} command. When Bash starts a job +asynchronously, it prints a line that looks +like: +@example +[1] 25647 +@end example +@noindent +indicating that this job is job number 1 and that the process @sc{id} +of the last process in the pipeline associated with this job is +25647. All of the processes in a single pipeline are members of +the same job. Bash uses the @var{job} abstraction as the +basis for job control. + +To facilitate the implementation of the user interface to job +control, the operating system maintains the notion of a current terminal +process group @sc{id}. Members of this process group (processes whose +process group @sc{id} is equal to the current terminal process group +@sc{id}) receive keyboard-generated signals such as @code{SIGINT}. +These processes are said to be in the foreground. Background +processes are those whose process group @sc{id} differs from the +terminal's; such processes are immune to keyboard-generated +signals. Only foreground processes are allowed to read from or, if +the user so specifies with @code{stty tostop}, write to the terminal. +Background processes which attempt to +read from (write to when @code{stty tostop} is in effect) the +terminal are sent a @code{SIGTTIN} (@code{SIGTTOU}) +signal by the kernel's terminal driver, +which, unless caught, suspends the process. + +If the operating system on which Bash is running supports +job control, Bash contains facilities to use it. Typing the +@var{suspend} character (typically @samp{^Z}, Control-Z) while a +process is running causes that process to be stopped and returns +control to Bash. Typing the @var{delayed suspend} character +(typically @samp{^Y}, Control-Y) causes the process to be stopped +when it attempts to read input from the terminal, and control to +be returned to Bash. The user then manipulates the state of +this job, using the @code{bg} command to continue it in the +background, the @code{fg} command to continue it in the +foreground, or the @code{kill} command to kill it. A @samp{^Z} +takes effect immediately, and has the additional side effect of +causing pending output and typeahead to be discarded. + +There are a number of ways to refer to a job in the shell. The +character @samp{%} introduces a job specification (@var{jobspec}). + +Job number @code{n} may be referred to as @samp{%n}. +The symbols @samp{%%} and @samp{%+} refer to the shell's notion of the +current job, which is the last job stopped while it was in the foreground +or started in the background. +A single @samp{%} (with no accompanying job specification) also refers +to the current job. +The previous job may be referenced using @samp{%-}. +If there is only a single job, @samp{%+} and @samp{%-} can both be used +to refer to that job. +In output pertaining to jobs (e.g., the output of the @code{jobs} +command), the current job is always flagged with a @samp{+}, and the +previous job with a @samp{-}. + +A job may also be referred to +using a prefix of the name used to start it, or using a substring +that appears in its command line. For example, @samp{%ce} refers +to a stopped @code{ce} job. Using @samp{%?ce}, on the +other hand, refers to any job containing the string @samp{ce} in +its command line. If the prefix or substring matches more than one job, +Bash reports an error. + +Simply naming a job can be used to bring it into the foreground: +@samp{%1} is a synonym for @samp{fg %1}, bringing job 1 from the +background into the foreground. Similarly, @samp{%1 &} resumes +job 1 in the background, equivalent to @samp{bg %1} + +The shell learns immediately whenever a job changes state. +Normally, Bash waits until it is about to print a prompt +before reporting changes in a job's status so as to not interrupt +any other output. +If the @option{-b} option to the @code{set} builtin is enabled, +Bash reports such changes immediately (@pxref{The Set Builtin}). +Any trap on @code{SIGCHLD} is executed for each child process +that exits. + +If an attempt to exit Bash is made while jobs are stopped, (or running, if +the @code{checkjobs} option is enabled -- see @ref{The Shopt Builtin}), the +shell prints a warning message, and if the @code{checkjobs} option is +enabled, lists the jobs and their statuses. +The @code{jobs} command may then be used to inspect their status. +If a second attempt to exit is made without an intervening command, +Bash does not print another warning, and any stopped jobs are terminated. + +@node Job Control Builtins +@section Job Control Builtins + +@table @code + +@item bg +@btindex bg +@example +bg [@var{jobspec} @dots{}] +@end example + +Resume each suspended job @var{jobspec} in the background, as if it +had been started with @samp{&}. +If @var{jobspec} is not supplied, the current job is used. +The return status is zero unless it is run when job control is not +enabled, or, when run with job control enabled, any +@var{jobspec} was not found or specifies a job +that was started without job control. + +@item fg +@btindex fg +@example +fg [@var{jobspec}] +@end example + +Resume the job @var{jobspec} in the foreground and make it the current job. +If @var{jobspec} is not supplied, the current job is used. +The return status is that of the command placed into the foreground, +or non-zero if run when job control is disabled or, when run with +job control enabled, @var{jobspec} does not specify a valid job or +@var{jobspec} specifies a job that was started without job control. + +@item jobs +@btindex jobs +@example +jobs [-lnprs] [@var{jobspec}] +jobs -x @var{command} [@var{arguments}] +@end example + +The first form lists the active jobs. The options have the +following meanings: + +@table @code +@item -l +List process @sc{id}s in addition to the normal information. + +@item -n +Display information only about jobs that have changed status since +the user was last notified of their status. + +@item -p +List only the process @sc{id} of the job's process group leader. + +@item -r +Display only running jobs. + +@item -s +Display only stopped jobs. +@end table + +If @var{jobspec} is given, +output is restricted to information about that job. +If @var{jobspec} is not supplied, the status of all jobs is +listed. + +If the @option{-x} option is supplied, @code{jobs} replaces any +@var{jobspec} found in @var{command} or @var{arguments} with the +corresponding process group @sc{id}, and executes @var{command}, +passing it @var{argument}s, returning its exit status. + +@item kill +@btindex kill +@example +kill [-s @var{sigspec}] [-n @var{signum}] [-@var{sigspec}] @var{jobspec} or @var{pid} +kill -l [@var{exit_status}] +@end example + +Send a signal specified by @var{sigspec} or @var{signum} to the process +named by job specification @var{jobspec} or process @sc{id} @var{pid}. +@var{sigspec} is either a case-insensitive signal name such as +@code{SIGINT} (with or without the @code{SIG} prefix) +or a signal number; @var{signum} is a signal number. +If @var{sigspec} and @var{signum} are not present, @code{SIGTERM} is used. +The @option{-l} option lists the signal names. +If any arguments are supplied when @option{-l} is given, the names of the +signals corresponding to the arguments are listed, and the return status +is zero. +@var{exit_status} is a number specifying a signal number or the exit +status of a process terminated by a signal. +The return status is zero if at least one signal was successfully sent, +or non-zero if an error occurs or an invalid option is encountered. + +@item wait +@btindex wait +@example +wait [-n] [@var{jobspec} or @var{pid} @dots{}] +@end example + +Wait until the child process specified by each process @sc{id} @var{pid} +or job specification @var{jobspec} exits and return the exit status of the +last command waited for. +If a job spec is given, all processes in the job are waited for. +If no arguments are given, all currently active child processes are +waited for, and the return status is zero. +If the @option{-n} option is supplied, @code{wait} waits for any job to +terminate and returns its exit status. +If neither @var{jobspec} nor @var{pid} specifies an active child process +of the shell, the return status is 127. + +@item disown +@btindex disown +@example +disown [-ar] [-h] [@var{jobspec} @dots{}] +@end example + +Without options, remove each @var{jobspec} from the table of +active jobs. +If the @option{-h} option is given, the job is not removed from the table, +but is marked so that @code{SIGHUP} is not sent to the job if the shell +receives a @code{SIGHUP}. +If @var{jobspec} is not present, and neither the @option{-a} nor the +@option{-r} option is supplied, the current job is used. +If no @var{jobspec} is supplied, the @option{-a} option means to remove or +mark all jobs; the @option{-r} option without a @var{jobspec} +argument restricts operation to running jobs. + +@item suspend +@btindex suspend +@example +suspend [-f] +@end example + +Suspend the execution of this shell until it receives a +@code{SIGCONT} signal. +A login shell cannot be suspended; the @option{-f} +option can be used to override this and force the suspension. +@end table + +When job control is not active, the @code{kill} and @code{wait} +builtins do not accept @var{jobspec} arguments. They must be +supplied process @sc{id}s. + +@node Job Control Variables +@section Job Control Variables + +@vtable @code + +@item auto_resume +This variable controls how the shell interacts with the user and +job control. If this variable exists then single word simple +commands without redirections are treated as candidates for resumption +of an existing job. There is no ambiguity allowed; if there is +more than one job beginning with the string typed, then +the most recently accessed job will be selected. +The name of a stopped job, in this context, is the command line +used to start it. If this variable is set to the value @samp{exact}, +the string supplied must match the name of a stopped job exactly; +if set to @samp{substring}, +the string supplied needs to match a substring of the name of a +stopped job. The @samp{substring} value provides functionality +analogous to the @samp{%?} job @sc{id} (@pxref{Job Control Basics}). +If set to any other value, the supplied string must +be a prefix of a stopped job's name; this provides functionality +analogous to the @samp{%} job @sc{id}. + +@end vtable + +@set readline-appendix +@set history-appendix +@cindex Readline, how to use +@include rluser.texi +@cindex History, how to use +@include hsuser.texi +@clear readline-appendix +@clear history-appendix + +@node Installing Bash +@chapter Installing Bash + +This chapter provides basic instructions for installing Bash on +the various supported platforms. The distribution supports the +@sc{gnu} operating systems, nearly every version of Unix, and several +non-Unix systems such as BeOS and Interix. +Other independent ports exist for +@sc{ms-dos}, @sc{os/2}, and Windows platforms. + +@menu +* Basic Installation:: Installation instructions. +* Compilers and Options:: How to set special options for various + systems. +* Compiling For Multiple Architectures:: How to compile Bash for more + than one kind of system from + the same source tree. +* Installation Names:: How to set the various paths used by the installation. +* Specifying the System Type:: How to configure Bash for a particular system. +* Sharing Defaults:: How to share default configuration values among GNU + programs. +* Operation Controls:: Options recognized by the configuration program. +* Optional Features:: How to enable and disable optional features when + building Bash. +@end menu + +@node Basic Installation +@section Basic Installation +@cindex installation +@cindex configuration +@cindex Bash installation +@cindex Bash configuration + +These are installation instructions for Bash. + +The simplest way to compile Bash is: + +@enumerate +@item +@code{cd} to the directory containing the source code and type +@samp{./configure} to configure Bash for your system. If you're +using @code{csh} on an old version of System V, you might need to +type @samp{sh ./configure} instead to prevent @code{csh} from trying +to execute @code{configure} itself. + +Running @code{configure} takes some time. +While running, it prints messages telling which features it is +checking for. + +@item +Type @samp{make} to compile Bash and build the @code{bashbug} bug +reporting script. + +@item +Optionally, type @samp{make tests} to run the Bash test suite. + +@item +Type @samp{make install} to install @code{bash} and @code{bashbug}. +This will also install the manual pages and Info file. + +@end enumerate + +The @code{configure} shell script attempts to guess correct +values for various system-dependent variables used during +compilation. It uses those values to create a @file{Makefile} in +each directory of the package (the top directory, the +@file{builtins}, @file{doc}, and @file{support} directories, +each directory under @file{lib}, and several others). It also creates a +@file{config.h} file containing system-dependent definitions. +Finally, it creates a shell script named @code{config.status} that you +can run in the future to recreate the current configuration, a +file @file{config.cache} that saves the results of its tests to +speed up reconfiguring, and a file @file{config.log} containing +compiler output (useful mainly for debugging @code{configure}). +If at some point +@file{config.cache} contains results you don't want to keep, you +may remove or edit it. + +To find out more about the options and arguments that the +@code{configure} script understands, type + +@example +bash-2.04$ ./configure --help +@end example + +@noindent +at the Bash prompt in your Bash source directory. + +If you need to do unusual things to compile Bash, please +try to figure out how @code{configure} could check whether or not +to do them, and mail diffs or instructions to +@email{bash-maintainers@@gnu.org} so they can be +considered for the next release. + +The file @file{configure.ac} is used to create @code{configure} +by a program called Autoconf. You only need +@file{configure.ac} if you want to change it or regenerate +@code{configure} using a newer version of Autoconf. If +you do this, make sure you are using Autoconf version 2.50 or +newer. + +You can remove the program binaries and object files from the +source code directory by typing @samp{make clean}. To also remove the +files that @code{configure} created (so you can compile Bash for +a different kind of computer), type @samp{make distclean}. + +@node Compilers and Options +@section Compilers and Options + +Some systems require unusual options for compilation or linking +that the @code{configure} script does not know about. You can +give @code{configure} initial values for variables by setting +them in the environment. Using a Bourne-compatible shell, you +can do that on the command line like this: + +@example +CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure +@end example + +On systems that have the @code{env} program, you can do it like this: + +@example +env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure +@end example + +The configuration process uses GCC to build Bash if it +is available. + +@node Compiling For Multiple Architectures +@section Compiling For Multiple Architectures + +You can compile Bash for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of @code{make} that +supports the @code{VPATH} variable, such as GNU @code{make}. +@code{cd} to the +directory where you want the object files and executables to go and run +the @code{configure} script from the source directory. You may need to +supply the @option{--srcdir=PATH} argument to tell @code{configure} where the +source files are. @code{configure} automatically checks for the +source code in the directory that @code{configure} is in and in `..'. + +If you have to use a @code{make} that does not supports the @code{VPATH} +variable, you can compile Bash for one architecture at a +time in the source code directory. After you have installed +Bash for one architecture, use @samp{make distclean} before +reconfiguring for another architecture. + +Alternatively, if your system supports symbolic links, you can use the +@file{support/mkclone} script to create a build tree which has +symbolic links back to each file in the source directory. Here's an +example that creates a build directory in the current directory from a +source directory @file{/usr/gnu/src/bash-2.0}: + +@example +bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 . +@end example + +@noindent +The @code{mkclone} script requires Bash, so you must have already built +Bash for at least one architecture before you can create build +directories for other architectures. + +@node Installation Names +@section Installation Names + +By default, @samp{make install} will install into +@file{/usr/local/bin}, @file{/usr/local/man}, etc. You can +specify an installation prefix other than @file{/usr/local} by +giving @code{configure} the option @option{--prefix=@var{PATH}}, +or by specifying a value for the @code{DESTDIR} @samp{make} +variable when running @samp{make install}. + +You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. +If you give @code{configure} the option +@option{--exec-prefix=@var{PATH}}, @samp{make install} will use +@var{PATH} as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + +@node Specifying the System Type +@section Specifying the System Type + +There may be some features @code{configure} can not figure out +automatically, but need to determine by the type of host Bash +will run on. Usually @code{configure} can figure that +out, but if it prints a message saying it can not guess the host +type, give it the @option{--host=TYPE} option. @samp{TYPE} can +either be a short name for the system type, such as @samp{sun4}, +or a canonical name with three fields: @samp{CPU-COMPANY-SYSTEM} +(e.g., @samp{i386-unknown-freebsd4.2}). + +See the file @file{support/config.sub} for the possible +values of each field. + +@node Sharing Defaults +@section Sharing Defaults + +If you want to set default values for @code{configure} scripts to +share, you can create a site shell script called +@code{config.site} that gives default values for variables like +@code{CC}, @code{cache_file}, and @code{prefix}. @code{configure} +looks for @file{PREFIX/share/config.site} if it exists, then +@file{PREFIX/etc/config.site} if it exists. Or, you can set the +@code{CONFIG_SITE} environment variable to the location of the site +script. A warning: the Bash @code{configure} looks for a site script, +but not all @code{configure} scripts do. + +@node Operation Controls +@section Operation Controls + +@code{configure} recognizes the following options to control how it +operates. + +@table @code + +@item --cache-file=@var{file} +Use and save the results of the tests in +@var{file} instead of @file{./config.cache}. Set @var{file} to +@file{/dev/null} to disable caching, for debugging +@code{configure}. + +@item --help +Print a summary of the options to @code{configure}, and exit. + +@item --quiet +@itemx --silent +@itemx -q +Do not print messages saying which checks are being made. + +@item --srcdir=@var{dir} +Look for the Bash source code in directory @var{dir}. Usually +@code{configure} can determine that directory automatically. + +@item --version +Print the version of Autoconf used to generate the @code{configure} +script, and exit. +@end table + +@code{configure} also accepts some other, not widely used, boilerplate +options. @samp{configure --help} prints the complete list. + +@node Optional Features +@section Optional Features + +The Bash @code{configure} has a number of @option{--enable-@var{feature}} +options, where @var{feature} indicates an optional part of Bash. +There are also several @option{--with-@var{package}} options, +where @var{package} is something like @samp{bash-malloc} or @samp{purify}. +To turn off the default use of a package, use +@option{--without-@var{package}}. To configure Bash without a feature +that is enabled by default, use @option{--disable-@var{feature}}. + +Here is a complete list of the @option{--enable-} and +@option{--with-} options that the Bash @code{configure} recognizes. + +@table @code +@item --with-afs +Define if you are using the Andrew File System from Transarc. + +@item --with-bash-malloc +Use the Bash version of +@code{malloc} in the directory @file{lib/malloc}. This is not the same +@code{malloc} that appears in @sc{gnu} libc, but an older version +originally derived from the 4.2 @sc{bsd} @code{malloc}. This @code{malloc} +is very fast, but wastes some space on each allocation. +This option is enabled by default. +The @file{NOTES} file contains a list of systems for +which this should be turned off, and @code{configure} disables this +option automatically for a number of systems. + +@item --with-curses +Use the curses library instead of the termcap library. This should +be supplied if your system has an inadequate or incomplete termcap +database. + +@item --with-gnu-malloc +A synonym for @code{--with-bash-malloc}. + +@item --with-installed-readline[=@var{PREFIX}] +Define this to make Bash link with a locally-installed version of Readline +rather than the version in @file{lib/readline}. This works only with +Readline 5.0 and later versions. If @var{PREFIX} is @code{yes} or not +supplied, @code{configure} uses the values of the make variables +@code{includedir} and @code{libdir}, which are subdirectories of @code{prefix} +by default, to find the installed version of Readline if it is not in +the standard system include and library directories. +If @var{PREFIX} is @code{no}, Bash links with the version in +@file{lib/readline}. +If @var{PREFIX} is set to any other value, @code{configure} treats it as +a directory pathname and looks for +the installed version of Readline in subdirectories of that directory +(include files in @var{PREFIX}/@code{include} and the library in +@var{PREFIX}/@code{lib}). + +@item --with-purify +Define this to use the Purify memory allocation checker from Rational +Software. + +@item --enable-minimal-config +This produces a shell with minimal features, close to the historical +Bourne shell. +@end table + +There are several @option{--enable-} options that alter how Bash is +compiled and linked, rather than changing run-time features. + +@table @code +@item --enable-largefile +Enable support for @uref{http://www.sas.com/standards/large_file/x_open.20Mar96.html, +large files} if the operating system requires special compiler options +to build programs which can access large files. This is enabled by +default, if the operating system provides large file support. + +@item --enable-profiling +This builds a Bash binary that produces profiling information to be +processed by @code{gprof} each time it is executed. + +@item --enable-static-link +This causes Bash to be linked statically, if @code{gcc} is being used. +This could be used to build a version to use as root's shell. +@end table + +The @samp{minimal-config} option can be used to disable all of +the following options, but it is processed first, so individual +options may be enabled using @samp{enable-@var{feature}}. + +All of the following options except for @samp{disabled-builtins}, +@samp{directpand-default}, and +@samp{xpg-echo-default} are +enabled by default, unless the operating system does not provide the +necessary support. + +@table @code +@item --enable-alias +Allow alias expansion and include the @code{alias} and @code{unalias} +builtins (@pxref{Aliases}). + +@item --enable-arith-for-command +Include support for the alternate form of the @code{for} command +that behaves like the C language @code{for} statement +(@pxref{Looping Constructs}). + +@item --enable-array-variables +Include support for one-dimensional array shell variables +(@pxref{Arrays}). + +@item --enable-bang-history +Include support for @code{csh}-like history substitution +(@pxref{History Interaction}). + +@item --enable-brace-expansion +Include @code{csh}-like brace expansion +( @code{b@{a,b@}c} @expansion{} @code{bac bbc} ). +See @ref{Brace Expansion}, for a complete description. + +@item --enable-casemod-attributes +Include support for case-modifying attributes in the @code{declare} builtin +and assignment statements. Variables with the @var{uppercase} attribute, +for example, will have their values converted to uppercase upon assignment. + +@item --enable-casemod-expansion +Include support for case-modifying word expansions. + +@item --enable-command-timing +Include support for recognizing @code{time} as a reserved word and for +displaying timing statistics for the pipeline following @code{time} +(@pxref{Pipelines}). +This allows pipelines as well as shell builtins and functions to be timed. + +@item --enable-cond-command +Include support for the @code{[[} conditional command. +(@pxref{Conditional Constructs}). + +@item --enable-cond-regexp +Include support for matching @sc{posix} regular expressions using the +@samp{=~} binary operator in the @code{[[} conditional command. +(@pxref{Conditional Constructs}). + +@item --enable-coprocesses +Include support for coprocesses and the @code{coproc} reserved word +(@pxref{Pipelines}). + +@item --enable-debugger +Include support for the bash debugger (distributed separately). + +@item --enable-direxpand-default +Cause the @code{direxpand} shell option (@pxref{The Shopt Builtin}) +to be enabled by default when the shell starts. +It is normally disabled by default. + +@item --enable-directory-stack +Include support for a @code{csh}-like directory stack and the +@code{pushd}, @code{popd}, and @code{dirs} builtins +(@pxref{The Directory Stack}). + +@item --enable-disabled-builtins +Allow builtin commands to be invoked via @samp{builtin xxx} +even after @code{xxx} has been disabled using @samp{enable -n xxx}. +See @ref{Bash Builtins}, for details of the @code{builtin} and +@code{enable} builtin commands. + +@item --enable-dparen-arithmetic +Include support for the @code{((@dots{}))} command +(@pxref{Conditional Constructs}). + +@item --enable-extended-glob +Include support for the extended pattern matching features described +above under @ref{Pattern Matching}. + +@item --enable-extended-glob-default +Set the default value of the @var{extglob} shell option described +above under @ref{The Shopt Builtin} to be enabled. + +@item --enable-glob-asciirange-default +Set the default value of the @var{globasciiranges} shell option described +above under @ref{The Shopt Builtin} to be enabled. +This controls the behavior of character ranges when used in pattern matching +bracket expressions. + +@item --enable-help-builtin +Include the @code{help} builtin, which displays help on shell builtins and +variables (@pxref{Bash Builtins}). + +@item --enable-history +Include command history and the @code{fc} and @code{history} +builtin commands (@pxref{Bash History Facilities}). + +@item --enable-job-control +This enables the job control features (@pxref{Job Control}), +if the operating system supports them. + +@item --enable-multibyte +This enables support for multibyte characters if the operating +system provides the necessary support. + +@item --enable-net-redirections +This enables the special handling of filenames of the form +@code{/dev/tcp/@var{host}/@var{port}} and +@code{/dev/udp/@var{host}/@var{port}} +when used in redirections (@pxref{Redirections}). + +@item --enable-process-substitution +This enables process substitution (@pxref{Process Substitution}) if +the operating system provides the necessary support. + +@item --enable-progcomp +Enable the programmable completion facilities +(@pxref{Programmable Completion}). +If Readline is not enabled, this option has no effect. + +@item --enable-prompt-string-decoding +Turn on the interpretation of a number of backslash-escaped characters +in the @env{$PS1}, @env{$PS2}, @env{$PS3}, and @env{$PS4} prompt +strings. See @ref{Controlling the Prompt}, for a complete list of prompt +string escape sequences. + +@item --enable-readline +Include support for command-line editing and history with the Bash +version of the Readline library (@pxref{Command Line Editing}). + +@item --enable-restricted +Include support for a @dfn{restricted shell}. If this is enabled, Bash, +when called as @code{rbash}, enters a restricted mode. See +@ref{The Restricted Shell}, for a description of restricted mode. + +@item --enable-select +Include the @code{select} compound command, which allows the generation of +simple menus (@pxref{Conditional Constructs}). + +@item --enable-separate-helpfiles +Use external files for the documentation displayed by the @code{help} builtin +instead of storing the text internally. + +@item --enable-single-help-strings +Store the text displayed by the @code{help} builtin as a single string for +each help topic. This aids in translating the text to different languages. +You may need to disable this if your compiler cannot handle very long string +literals. + +@item --enable-strict-posix-default +Make Bash @sc{posix}-conformant by default (@pxref{Bash POSIX Mode}). + +@item --enable-usg-echo-default +A synonym for @code{--enable-xpg-echo-default}. + +@item --enable-xpg-echo-default +Make the @code{echo} builtin expand backslash-escaped characters by default, +without requiring the @option{-e} option. +This sets the default value of the @code{xpg_echo} shell option to @code{on}, +which makes the Bash @code{echo} behave more like the version specified in +the Single Unix Specification, version 3. +@xref{Bash Builtins}, for a description of the escape sequences that +@code{echo} recognizes. +@end table + +The file @file{config-top.h} contains C Preprocessor +@samp{#define} statements for options which are not settable from +@code{configure}. +Some of these are not meant to be changed; beware of the consequences if +you do. +Read the comments associated with each definition for more +information about its effect. + +@node Reporting Bugs +@appendix Reporting Bugs + +Please report all bugs you find in Bash. +But first, you should +make sure that it really is a bug, and that it appears in the latest +version of Bash. +The latest version of Bash is always available for FTP from +@uref{ftp://ftp.gnu.org/pub/gnu/bash/}. + +Once you have determined that a bug actually exists, use the +@code{bashbug} command to submit a bug report. +If you have a fix, you are encouraged to mail that as well! +Suggestions and `philosophical' bug reports may be mailed +to @email{bug-bash@@gnu.org} or posted to the Usenet +newsgroup @code{gnu.bash.bug}. + +All bug reports should include: +@itemize @bullet +@item +The version number of Bash. +@item +The hardware and operating system. +@item +The compiler used to compile Bash. +@item +A description of the bug behaviour. +@item +A short script or `recipe' which exercises the bug and may be used +to reproduce it. +@end itemize + +@noindent +@code{bashbug} inserts the first three items automatically into +the template it provides for filing a bug report. + +Please send all reports concerning this manual to +@email{bug-bash@@gnu.org}. + +@node Major Differences From The Bourne Shell +@appendix Major Differences From The Bourne Shell + +Bash implements essentially the same grammar, parameter and +variable expansion, redirection, and quoting as the Bourne Shell. +Bash uses the @sc{posix} standard as the specification of +how these features are to be implemented. There are some +differences between the traditional Bourne shell and Bash; this +section quickly details the differences of significance. A +number of these differences are explained in greater depth in +previous sections. +This section uses the version of @code{sh} included in SVR4.2 (the +last version of the historical Bourne shell) as the baseline reference. + +@itemize @bullet + +@item +Bash is @sc{posix}-conformant, even where the @sc{posix} specification +differs from traditional @code{sh} behavior (@pxref{Bash POSIX Mode}). + +@item +Bash has multi-character invocation options (@pxref{Invoking Bash}). + +@item +Bash has command-line editing (@pxref{Command Line Editing}) and +the @code{bind} builtin. + +@item +Bash provides a programmable word completion mechanism +(@pxref{Programmable Completion}), and builtin commands +@code{complete}, @code{compgen}, and @code{compopt}, to +manipulate it. + +@item +Bash has command history (@pxref{Bash History Facilities}) and the +@code{history} and @code{fc} builtins to manipulate it. +The Bash history list maintains timestamp information and uses the +value of the @code{HISTTIMEFORMAT} variable to display it. + +@item +Bash implements @code{csh}-like history expansion +(@pxref{History Interaction}). + +@item +Bash has one-dimensional array variables (@pxref{Arrays}), and the +appropriate variable expansions and assignment syntax to use them. +Several of the Bash builtins take options to act on arrays. +Bash provides a number of built-in array variables. + +@item +The @code{$'@dots{}'} quoting syntax, which expands ANSI-C +backslash-escaped characters in the text between the single quotes, +is supported (@pxref{ANSI-C Quoting}). + +@item +Bash supports the @code{$"@dots{}"} quoting syntax to do +locale-specific translation of the characters between the double +quotes. The @option{-D}, @option{--dump-strings}, and @option{--dump-po-strings} +invocation options list the translatable strings found in a script +(@pxref{Locale Translation}). + +@item +Bash implements the @code{!} keyword to negate the return value of +a pipeline (@pxref{Pipelines}). +Very useful when an @code{if} statement needs to act only if a test fails. +The Bash @samp{-o pipefail} option to @code{set} will cause a pipeline to +return a failure status if any command fails. + +@item +Bash has the @code{time} reserved word and command timing (@pxref{Pipelines}). +The display of the timing statistics may be controlled with the +@env{TIMEFORMAT} variable. + +@item +Bash implements the @code{for (( @var{expr1} ; @var{expr2} ; @var{expr3} ))} +arithmetic for command, similar to the C language (@pxref{Looping Constructs}). + +@item +Bash includes the @code{select} compound command, which allows the +generation of simple menus (@pxref{Conditional Constructs}). + +@item +Bash includes the @code{[[} compound command, which makes conditional +testing part of the shell grammar (@pxref{Conditional Constructs}), including +optional regular expression matching. + +@item +Bash provides optional case-insensitive matching for the @code{case} and +@code{[[} constructs. + +@item +Bash includes brace expansion (@pxref{Brace Expansion}) and tilde +expansion (@pxref{Tilde Expansion}). + +@item +Bash implements command aliases and the @code{alias} and @code{unalias} +builtins (@pxref{Aliases}). + +@item +Bash provides shell arithmetic, the @code{((} compound command +(@pxref{Conditional Constructs}), +and arithmetic expansion (@pxref{Shell Arithmetic}). + +@item +Variables present in the shell's initial environment are automatically +exported to child processes. The Bourne shell does not normally do +this unless the variables are explicitly marked using the @code{export} +command. + +@item +Bash supports the @samp{+=} assignment operator, which appends to the value +of the variable named on the left hand side. + +@item +Bash includes the @sc{posix} pattern removal @samp{%}, @samp{#}, @samp{%%} +and @samp{##} expansions to remove leading or trailing substrings from +variable values (@pxref{Shell Parameter Expansion}). + +@item +The expansion @code{$@{#xx@}}, which returns the length of @code{$@{xx@}}, +is supported (@pxref{Shell Parameter Expansion}). + +@item +The expansion @code{$@{var:}@var{offset}@code{[:}@var{length}@code{]@}}, +which expands to the substring of @code{var}'s value of length +@var{length}, beginning at @var{offset}, is present +(@pxref{Shell Parameter Expansion}). + +@item +The expansion +@code{$@{var/[/]}@var{pattern}@code{[/}@var{replacement}@code{]@}}, +which matches @var{pattern} and replaces it with @var{replacement} in +the value of @code{var}, is available (@pxref{Shell Parameter Expansion}). + +@item +The expansion @code{$@{!@var{prefix}*@}} expansion, which expands to +the names of all shell variables whose names begin with @var{prefix}, +is available (@pxref{Shell Parameter Expansion}). + +@item +Bash has @var{indirect} variable expansion using @code{$@{!word@}} +(@pxref{Shell Parameter Expansion}). + +@item +Bash can expand positional parameters beyond @code{$9} using +@code{$@{@var{num}@}}. + +@item +The @sc{posix} @code{$()} form of command substitution +is implemented (@pxref{Command Substitution}), +and preferred to the Bourne shell's @code{``} (which +is also implemented for backwards compatibility). + +@item +Bash has process substitution (@pxref{Process Substitution}). + +@item +Bash automatically assigns variables that provide information about the +current user (@env{UID}, @env{EUID}, and @env{GROUPS}), the current host +(@env{HOSTTYPE}, @env{OSTYPE}, @env{MACHTYPE}, and @env{HOSTNAME}), +and the instance of Bash that is running (@env{BASH}, +@env{BASH_VERSION}, and @env{BASH_VERSINFO}). @xref{Bash Variables}, +for details. + +@item +The @env{IFS} variable is used to split only the results of expansion, +not all words (@pxref{Word Splitting}). +This closes a longstanding shell security hole. + +@item +The filename expansion bracket expression code uses @samp{!} and @samp{^} +to negate the set of characters between the brackets. +The Bourne shell uses only @samp{!}. + +@item +Bash implements the full set of @sc{posix} filename expansion operators, +including @var{character classes}, @var{equivalence classes}, and +@var{collating symbols} (@pxref{Filename Expansion}). + +@item +Bash implements extended pattern matching features when the @code{extglob} +shell option is enabled (@pxref{Pattern Matching}). + +@item +It is possible to have a variable and a function with the same name; +@code{sh} does not separate the two name spaces. + +@item +Bash functions are permitted to have local variables using the +@code{local} builtin, and thus useful recursive functions may be written +(@pxref{Bash Builtins}). + +@item +Variable assignments preceding commands affect only that command, even +builtins and functions (@pxref{Environment}). +In @code{sh}, all variable assignments +preceding commands are global unless the command is executed from the +file system. + +@item +Bash performs filename expansion on filenames specified as operands +to input and output redirection operators (@pxref{Redirections}). + +@item +Bash contains the @samp{<>} redirection operator, allowing a file to be +opened for both reading and writing, and the @samp{&>} redirection +operator, for directing standard output and standard error to the same +file (@pxref{Redirections}). + +@item +Bash includes the @samp{<<<} redirection operator, allowing a string to +be used as the standard input to a command. + +@item +Bash implements the @samp{[n]<&@var{word}} and @samp{[n]>&@var{word}} +redirection operators, which move one file descriptor to another. + +@item +Bash treats a number of filenames specially when they are +used in redirection operators (@pxref{Redirections}). + +@item +Bash can open network connections to arbitrary machines and services +with the redirection operators (@pxref{Redirections}). + +@item +The @code{noclobber} option is available to avoid overwriting existing +files with output redirection (@pxref{The Set Builtin}). +The @samp{>|} redirection operator may be used to override @code{noclobber}. + +@item +The Bash @code{cd} and @code{pwd} builtins (@pxref{Bourne Shell Builtins}) +each take @option{-L} and @option{-P} options to switch between logical and +physical modes. + +@item +Bash allows a function to override a builtin with the same name, and provides +access to that builtin's functionality within the function via the +@code{builtin} and @code{command} builtins (@pxref{Bash Builtins}). + +@item +The @code{command} builtin allows selective disabling of functions +when command lookup is performed (@pxref{Bash Builtins}). + +@item +Individual builtins may be enabled or disabled using the @code{enable} +builtin (@pxref{Bash Builtins}). + +@item +The Bash @code{exec} builtin takes additional options that allow users +to control the contents of the environment passed to the executed +command, and what the zeroth argument to the command is to be +(@pxref{Bourne Shell Builtins}). + +@item +Shell functions may be exported to children via the environment +using @code{export -f} (@pxref{Shell Functions}). + +@item +The Bash @code{export}, @code{readonly}, and @code{declare} builtins can +take a @option{-f} option to act on shell functions, a @option{-p} option to +display variables with various attributes set in a format that can be +used as shell input, a @option{-n} option to remove various variable +attributes, and @samp{name=value} arguments to set variable attributes +and values simultaneously. + +@item +The Bash @code{hash} builtin allows a name to be associated with +an arbitrary filename, even when that filename cannot be found by +searching the @env{$PATH}, using @samp{hash -p} +(@pxref{Bourne Shell Builtins}). + +@item +Bash includes a @code{help} builtin for quick reference to shell +facilities (@pxref{Bash Builtins}). + +@item +The @code{printf} builtin is available to display formatted output +(@pxref{Bash Builtins}). + +@item +The Bash @code{read} builtin (@pxref{Bash Builtins}) +will read a line ending in @samp{\} with +the @option{-r} option, and will use the @env{REPLY} variable as a +default if no non-option arguments are supplied. +The Bash @code{read} builtin +also accepts a prompt string with the @option{-p} option and will use +Readline to obtain the line when given the @option{-e} option. +The @code{read} builtin also has additional options to control input: +the @option{-s} option will turn off echoing of input characters as +they are read, the @option{-t} option will allow @code{read} to time out +if input does not arrive within a specified number of seconds, the +@option{-n} option will allow reading only a specified number of +characters rather than a full line, and the @option{-d} option will read +until a particular character rather than newline. + +@item +The @code{return} builtin may be used to abort execution of scripts +executed with the @code{.} or @code{source} builtins +(@pxref{Bourne Shell Builtins}). + +@item +Bash includes the @code{shopt} builtin, for finer control of shell +optional capabilities (@pxref{The Shopt Builtin}), and allows these options +to be set and unset at shell invocation (@pxref{Invoking Bash}). + +@item +Bash has much more optional behavior controllable with the @code{set} +builtin (@pxref{The Set Builtin}). + +@item +The @samp{-x} (@option{xtrace}) option displays commands other than +simple commands when performing an execution trace +(@pxref{The Set Builtin}). + +@item +The @code{test} builtin (@pxref{Bourne Shell Builtins}) +is slightly different, as it implements the @sc{posix} algorithm, +which specifies the behavior based on the number of arguments. + +@item +Bash includes the @code{caller} builtin, which displays the context of +any active subroutine call (a shell function or a script executed with +the @code{.} or @code{source} builtins). This supports the bash +debugger. + +@item +The @code{trap} builtin (@pxref{Bourne Shell Builtins}) allows a +@code{DEBUG} pseudo-signal specification, similar to @code{EXIT}. +Commands specified with a @code{DEBUG} trap are executed before every +simple command, @code{for} command, @code{case} command, +@code{select} command, every arithmetic @code{for} command, and before +the first command executes in a shell function. +The @code{DEBUG} trap is not inherited by shell functions unless the +function has been given the @code{trace} attribute or the +@code{functrace} option has been enabled using the @code{shopt} builtin. +The @code{extdebug} shell option has additional effects on the +@code{DEBUG} trap. + +The @code{trap} builtin (@pxref{Bourne Shell Builtins}) allows an +@code{ERR} pseudo-signal specification, similar to @code{EXIT} and @code{DEBUG}. +Commands specified with an @code{ERR} trap are executed after a simple +command fails, with a few exceptions. +The @code{ERR} trap is not inherited by shell functions unless the +@code{-o errtrace} option to the @code{set} builtin is enabled. + +The @code{trap} builtin (@pxref{Bourne Shell Builtins}) allows a +@code{RETURN} pseudo-signal specification, similar to +@code{EXIT} and @code{DEBUG}. +Commands specified with an @code{RETURN} trap are executed before +execution resumes after a shell function or a shell script executed with +@code{.} or @code{source} returns. +The @code{RETURN} trap is not inherited by shell functions unless the +function has been given the @code{trace} attribute or the +@code{functrace} option has been enabled using the @code{shopt} builtin. + +@item +The Bash @code{type} builtin is more extensive and gives more information +about the names it finds (@pxref{Bash Builtins}). + +@item +The Bash @code{umask} builtin permits a @option{-p} option to cause +the output to be displayed in the form of a @code{umask} command +that may be reused as input (@pxref{Bourne Shell Builtins}). + +@item +Bash implements a @code{csh}-like directory stack, and provides the +@code{pushd}, @code{popd}, and @code{dirs} builtins to manipulate it +(@pxref{The Directory Stack}). +Bash also makes the directory stack visible as the value of the +@env{DIRSTACK} shell variable. + +@item +Bash interprets special backslash-escaped characters in the prompt +strings when interactive (@pxref{Controlling the Prompt}). + +@item +The Bash restricted mode is more useful (@pxref{The Restricted Shell}); +the SVR4.2 shell restricted mode is too limited. + +@item +The @code{disown} builtin can remove a job from the internal shell +job table (@pxref{Job Control Builtins}) or suppress the sending +of @code{SIGHUP} to a job when the shell exits as the result of a +@code{SIGHUP}. + +@item +Bash includes a number of features to support a separate debugger for +shell scripts. + +@item +The SVR4.2 shell has two privilege-related builtins +(@code{mldmode} and @code{priv}) not present in Bash. + +@item +Bash does not have the @code{stop} or @code{newgrp} builtins. + +@item +Bash does not use the @env{SHACCT} variable or perform shell accounting. + +@item +The SVR4.2 @code{sh} uses a @env{TIMEOUT} variable like Bash uses +@env{TMOUT}. + +@end itemize + +@noindent +More features unique to Bash may be found in @ref{Bash Features}. + + +@appendixsec Implementation Differences From The SVR4.2 Shell + +Since Bash is a completely new implementation, it does not suffer from +many of the limitations of the SVR4.2 shell. For instance: + +@itemize @bullet + +@item +Bash does not fork a subshell when redirecting into or out of +a shell control structure such as an @code{if} or @code{while} +statement. + +@item +Bash does not allow unbalanced quotes. The SVR4.2 shell will silently +insert a needed closing quote at @code{EOF} under certain circumstances. +This can be the cause of some hard-to-find errors. + +@item +The SVR4.2 shell uses a baroque memory management scheme based on +trapping @code{SIGSEGV}. If the shell is started from a process with +@code{SIGSEGV} blocked (e.g., by using the @code{system()} C library +function call), it misbehaves badly. + +@item +In a questionable attempt at security, the SVR4.2 shell, +when invoked without the @option{-p} option, will alter its real +and effective @sc{uid} and @sc{gid} if they are less than some +magic threshold value, commonly 100. +This can lead to unexpected results. + +@item +The SVR4.2 shell does not allow users to trap @code{SIGSEGV}, +@code{SIGALRM}, or @code{SIGCHLD}. + +@item +The SVR4.2 shell does not allow the @env{IFS}, @env{MAILCHECK}, +@env{PATH}, @env{PS1}, or @env{PS2} variables to be unset. + +@item +The SVR4.2 shell treats @samp{^} as the undocumented equivalent of +@samp{|}. + +@item +Bash allows multiple option arguments when it is invoked (@code{-x -v}); +the SVR4.2 shell allows only one option argument (@code{-xv}). In +fact, some versions of the shell dump core if the second argument begins +with a @samp{-}. + +@item +The SVR4.2 shell exits a script if any builtin fails; Bash exits +a script only if one of the @sc{posix} special builtins fails, and +only for certain failures, as enumerated in the @sc{posix} standard. + +@item +The SVR4.2 shell behaves differently when invoked as @code{jsh} +(it turns on job control). +@end itemize + +@node GNU Free Documentation License +@appendix GNU Free Documentation License + +@include fdl.texi + +@node Indexes +@appendix Indexes + +@menu +* Builtin Index:: Index of Bash builtin commands. +* Reserved Word Index:: Index of Bash reserved words. +* Variable Index:: Quick reference helps you find the + variable you want. +* Function Index:: Index of bindable Readline functions. +* Concept Index:: General index for concepts described in + this manual. +@end menu + +@node Builtin Index +@appendixsec Index of Shell Builtin Commands +@printindex bt + +@node Reserved Word Index +@appendixsec Index of Shell Reserved Words +@printindex rw + +@node Variable Index +@appendixsec Parameter and Variable Index +@printindex vr + +@node Function Index +@appendixsec Function Index +@printindex fn + +@node Concept Index +@appendixsec Concept Index +@printindex cp + +@bye diff --git a/.pc/pgrp-pipe.diff/config-bot.h b/.pc/pgrp-pipe.diff/config-bot.h new file mode 100644 index 0000000..86c388f --- /dev/null +++ b/.pc/pgrp-pipe.diff/config-bot.h @@ -0,0 +1,199 @@ +/* config-bot.h */ +/* modify settings or make new ones based on what autoconf tells us. */ + +/* Copyright (C) 1989-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/*********************************************************/ +/* Modify or set defines based on the configure results. */ +/*********************************************************/ + +#if !defined (HAVE_VPRINTF) && defined (HAVE_DOPRNT) +# define USE_VFPRINTF_EMULATION +# define HAVE_VPRINTF +#endif + +#if defined (HAVE_SYS_RESOURCE_H) && defined (HAVE_GETRLIMIT) +# define HAVE_RESOURCE +#endif + +#if !defined (GETPGRP_VOID) +# define HAVE_BSD_PGRP +#endif + +/* Try this without testing __STDC__ for the time being. */ +#if defined (HAVE_STDARG_H) +# define PREFER_STDARG +# define USE_VARARGS +#else +# if defined (HAVE_VARARGS_H) +# define PREFER_VARARGS +# define USE_VARARGS +# endif +#endif + +#if defined (HAVE_SYS_SOCKET_H) && defined (HAVE_GETPEERNAME) && defined (HAVE_NETINET_IN_H) +# define HAVE_NETWORK +#endif + +#if defined (HAVE_REGEX_H) && defined (HAVE_REGCOMP) && defined (HAVE_REGEXEC) +# define HAVE_POSIX_REGEXP +#endif + +/* backwards compatibility between different autoconf versions */ +#if HAVE_DECL_SYS_SIGLIST && !defined (SYS_SIGLIST_DECLARED) +# define SYS_SIGLIST_DECLARED +#endif + +/***********************************************************************/ +/* Unset defines based on what configure reports as missing or broken. */ +/***********************************************************************/ + +/* Ultrix botches type-ahead when switching from canonical to + non-canonical mode, at least through version 4.3 */ +#if !defined (HAVE_TERMIOS_H) || !defined (HAVE_TCGETATTR) || defined (ultrix) +# define TERMIOS_MISSING +#endif + +/* If we have a getcwd(3), but one that does not dynamically allocate memory, + #undef HAVE_GETCWD so the replacement in getcwd.c will be built. We do + not do this on Solaris, because their implementation of loopback mounts + breaks the traditional file system assumptions that getcwd uses. */ +#if defined (HAVE_GETCWD) && defined (GETCWD_BROKEN) && !defined (SOLARIS) +# undef HAVE_GETCWD +#endif + +#if !defined (HAVE_DEV_FD) && defined (NAMED_PIPES_MISSING) +# undef PROCESS_SUBSTITUTION +#endif + +#if defined (JOB_CONTROL_MISSING) +# undef JOB_CONTROL +#endif + +#if defined (STRCOLL_BROKEN) +# undef HAVE_STRCOLL +#endif + +#if !defined (HAVE_POSIX_REGEXP) +# undef COND_REGEXP +#endif + +/* If the shell is called by this name, it will become restricted. */ +#if defined (RESTRICTED_SHELL) +# define RESTRICTED_SHELL_NAME "rbash" +#endif + +/***********************************************************/ +/* Make sure feature defines have necessary prerequisites. */ +/***********************************************************/ + +/* BANG_HISTORY requires HISTORY. */ +#if defined (BANG_HISTORY) && !defined (HISTORY) +# define HISTORY +#endif /* BANG_HISTORY && !HISTORY */ + +#if defined (READLINE) && !defined (HISTORY) +# define HISTORY +#endif + +#if defined (PROGRAMMABLE_COMPLETION) && !defined (READLINE) +# undef PROGRAMMABLE_COMPLETION +#endif + +#if !defined (V9_ECHO) +# undef DEFAULT_ECHO_TO_XPG +#endif + +#if !defined (PROMPT_STRING_DECODE) +# undef PPROMPT +# define PPROMPT "$ " +#endif + +#if !defined (HAVE_SYSLOG) || !defined (HAVE_SYSLOG_H) +# undef SYSLOG_HISTORY +#endif + +/************************************************/ +/* check multibyte capability for I18N code */ +/************************************************/ + +/* For platforms which support the ISO C amendement 1 functionality we + support user defined character classes. */ +/* Solaris 2.5 has a bug: must be included before . */ +#if defined (HAVE_WCTYPE_H) && defined (HAVE_WCHAR_H) && defined (HAVE_LOCALE_H) +# include +# include +# if defined (HAVE_ISWCTYPE) && \ + defined (HAVE_ISWLOWER) && \ + defined (HAVE_ISWUPPER) && \ + defined (HAVE_MBSRTOWCS) && \ + defined (HAVE_MBRTOWC) && \ + defined (HAVE_MBRLEN) && \ + defined (HAVE_TOWLOWER) && \ + defined (HAVE_TOWUPPER) && \ + defined (HAVE_WCHAR_T) && \ + defined (HAVE_WCTYPE_T) && \ + defined (HAVE_WINT_T) && \ + defined (HAVE_WCWIDTH) && \ + defined (HAVE_WCTYPE) + /* system is supposed to support XPG5 */ +# define HANDLE_MULTIBYTE 1 +# endif +#endif + +/* If we don't want multibyte chars even on a system that supports them, let + the configuring user turn multibyte support off. */ +#if defined (NO_MULTIBYTE_SUPPORT) +# undef HANDLE_MULTIBYTE +#endif + +/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */ +#if HANDLE_MULTIBYTE && !defined (HAVE_MBSTATE_T) +# define wcsrtombs(dest, src, len, ps) (wcsrtombs) (dest, src, len, 0) +# define mbsrtowcs(dest, src, len, ps) (mbsrtowcs) (dest, src, len, 0) +# define wcrtomb(s, wc, ps) (wcrtomb) (s, wc, 0) +# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) +# define mbrlen(s, n, ps) (mbrlen) (s, n, 0) +# define mbstate_t int +#endif + +/* Make sure MB_LEN_MAX is at least 16 (some systems define + MB_LEN_MAX as 1) */ +#ifdef HANDLE_MULTIBYTE +# include +# if defined(MB_LEN_MAX) && (MB_LEN_MAX < 16) +# undef MB_LEN_MAX +# endif +# if !defined (MB_LEN_MAX) +# define MB_LEN_MAX 16 +# endif +#endif + +/************************************************/ +/* end of multibyte capability checks for I18N */ +/************************************************/ + +/******************************************************************/ +/* Placeholder for builders to #undef any unwanted features from */ +/* config-top.h or created by configure (such as the default mail */ +/* file for mail checking). */ +/******************************************************************/ + +/* If you don't want bash to provide a default mail file to check. */ +#undef DEFAULT_MAIL_DIRECTORY diff --git a/.pc/privmode.diff/shell.c b/.pc/privmode.diff/shell.c new file mode 100644 index 0000000..bbc8a66 --- /dev/null +++ b/.pc/privmode.diff/shell.c @@ -0,0 +1,1888 @@ +/* shell.c -- GNU's idea of the POSIX shell specification. */ + +/* Copyright (C) 1987-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* + Birthdate: + Sunday, January 10th, 1988. + Initial author: Brian Fox +*/ +#define INSTALL_DEBUG_MODE + +#include "config.h" + +#include "bashtypes.h" +#if !defined (_MINIX) && defined (HAVE_SYS_FILE_H) +# include +#endif +#include "posixstat.h" +#include "posixtime.h" +#include "bashansi.h" +#include +#include +#include +#include "filecntl.h" +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashintl.h" + +#define NEED_SH_SETLINEBUF_DECL /* used in externs.h */ + +#include "shell.h" +#include "flags.h" +#include "trap.h" +#include "mailcheck.h" +#include "builtins.h" +#include "builtins/common.h" + +#if defined (JOB_CONTROL) +#include "jobs.h" +#endif /* JOB_CONTROL */ + +#include "input.h" +#include "execute_cmd.h" +#include "findcmd.h" + +#if defined (USING_BASH_MALLOC) && defined (DEBUG) && !defined (DISABLE_MALLOC_WRAPPERS) +# include +#endif + +#if defined (HISTORY) +# include "bashhist.h" +# include +#endif + +#if defined (READLINE) +# include "bashline.h" +#endif + +#include +#include + +#if defined (__OPENNT) +# include +#endif + +#if !defined (HAVE_GETPW_DECLS) +extern struct passwd *getpwuid (); +#endif /* !HAVE_GETPW_DECLS */ + +#if !defined (errno) +extern int errno; +#endif + +#if defined (NO_MAIN_ENV_ARG) +extern char **environ; /* used if no third argument to main() */ +#endif + +extern char *dist_version, *release_status; +extern int patch_level, build_version; +extern int shell_level; +extern int subshell_environment; +extern int last_command_exit_value; +extern int line_number; +extern int expand_aliases; +extern int array_needs_making; +extern int gnu_error_format; +extern char *primary_prompt, *secondary_prompt; +extern char *this_command_name; + +/* Non-zero means that this shell has already been run; i.e. you should + call shell_reinitialize () if you need to start afresh. */ +int shell_initialized = 0; + +COMMAND *global_command = (COMMAND *)NULL; + +/* Information about the current user. */ +struct user_info current_user = +{ + (uid_t)-1, (uid_t)-1, (gid_t)-1, (gid_t)-1, + (char *)NULL, (char *)NULL, (char *)NULL +}; + +/* The current host's name. */ +char *current_host_name = (char *)NULL; + +/* Non-zero means that this shell is a login shell. + Specifically: + 0 = not login shell. + 1 = login shell from getty (or equivalent fake out) + -1 = login shell from "--login" (or -l) flag. + -2 = both from getty, and from flag. + */ +int login_shell = 0; + +/* Non-zero means that at this moment, the shell is interactive. In + general, this means that the shell is at this moment reading input + from the keyboard. */ +int interactive = 0; + +/* Non-zero means that the shell was started as an interactive shell. */ +int interactive_shell = 0; + +/* Non-zero means to send a SIGHUP to all jobs when an interactive login + shell exits. */ +int hup_on_exit = 0; + +/* Non-zero means to list status of running and stopped jobs at shell exit */ +int check_jobs_at_exit = 0; + +/* Non-zero means to change to a directory name supplied as a command name */ +int autocd = 0; + +/* Tells what state the shell was in when it started: + 0 = non-interactive shell script + 1 = interactive + 2 = -c command + 3 = wordexp evaluation + This is a superset of the information provided by interactive_shell. +*/ +int startup_state = 0; + +/* Special debugging helper. */ +int debugging_login_shell = 0; + +/* The environment that the shell passes to other commands. */ +char **shell_environment; + +/* Non-zero when we are executing a top-level command. */ +int executing = 0; + +/* The number of commands executed so far. */ +int current_command_number = 1; + +/* Non-zero is the recursion depth for commands. */ +int indirection_level = 0; + +/* The name of this shell, as taken from argv[0]. */ +char *shell_name = (char *)NULL; + +/* time in seconds when the shell was started */ +time_t shell_start_time; + +/* Are we running in an emacs shell window? */ +int running_under_emacs; + +/* Do we have /dev/fd? */ +#ifdef HAVE_DEV_FD +int have_devfd = HAVE_DEV_FD; +#else +int have_devfd = 0; +#endif + +/* The name of the .(shell)rc file. */ +static char *bashrc_file = "~/.bashrc"; + +/* Non-zero means to act more like the Bourne shell on startup. */ +static int act_like_sh; + +/* Non-zero if this shell is being run by `su'. */ +static int su_shell; + +/* Non-zero if we have already expanded and sourced $ENV. */ +static int sourced_env; + +/* Is this shell running setuid? */ +static int running_setuid; + +/* Values for the long-winded argument names. */ +static int debugging; /* Do debugging things. */ +static int no_rc; /* Don't execute ~/.bashrc */ +static int no_profile; /* Don't execute .profile */ +static int do_version; /* Display interesting version info. */ +static int make_login_shell; /* Make this shell be a `-bash' shell. */ +static int want_initial_help; /* --help option */ + +int debugging_mode = 0; /* In debugging mode with --debugger */ +#if defined (READLINE) +int no_line_editing = 0; /* non-zero -> don't do fancy line editing. */ +#else +int no_line_editing = 1; /* can't have line editing without readline */ +#endif +int dump_translatable_strings; /* Dump strings in $"...", don't execute. */ +int dump_po_strings; /* Dump strings in $"..." in po format */ +int wordexp_only = 0; /* Do word expansion only */ +int protected_mode = 0; /* No command substitution with --wordexp */ + +#if defined (STRICT_POSIX) +int posixly_correct = 1; /* Non-zero means posix.2 superset. */ +#else +int posixly_correct = 0; /* Non-zero means posix.2 superset. */ +#endif + +/* Some long-winded argument names. These are obviously new. */ +#define Int 1 +#define Charp 2 +static const struct { + const char *name; + int type; + int *int_value; + char **char_value; +} long_args[] = { + { "debug", Int, &debugging, (char **)0x0 }, +#if defined (DEBUGGER) + { "debugger", Int, &debugging_mode, (char **)0x0 }, +#endif + { "dump-po-strings", Int, &dump_po_strings, (char **)0x0 }, + { "dump-strings", Int, &dump_translatable_strings, (char **)0x0 }, + { "help", Int, &want_initial_help, (char **)0x0 }, + { "init-file", Charp, (int *)0x0, &bashrc_file }, + { "login", Int, &make_login_shell, (char **)0x0 }, + { "noediting", Int, &no_line_editing, (char **)0x0 }, + { "noprofile", Int, &no_profile, (char **)0x0 }, + { "norc", Int, &no_rc, (char **)0x0 }, + { "posix", Int, &posixly_correct, (char **)0x0 }, +#if defined (WORDEXP_OPTION) + { "protected", Int, &protected_mode, (char **)0x0 }, +#endif + { "rcfile", Charp, (int *)0x0, &bashrc_file }, +#if defined (RESTRICTED_SHELL) + { "restricted", Int, &restricted, (char **)0x0 }, +#endif + { "verbose", Int, &echo_input_at_read, (char **)0x0 }, + { "version", Int, &do_version, (char **)0x0 }, +#if defined (WORDEXP_OPTION) + { "wordexp", Int, &wordexp_only, (char **)0x0 }, +#endif + { (char *)0x0, Int, (int *)0x0, (char **)0x0 } +}; + +/* These are extern so execute_simple_command can set them, and then + longjmp back to main to execute a shell script, instead of calling + main () again and resulting in indefinite, possibly fatal, stack + growth. */ +procenv_t subshell_top_level; +int subshell_argc; +char **subshell_argv; +char **subshell_envp; + +char *exec_argv0; + +#if defined (BUFFERED_INPUT) +/* The file descriptor from which the shell is reading input. */ +int default_buffered_input = -1; +#endif + +/* The following two variables are not static so they can show up in $-. */ +int read_from_stdin; /* -s flag supplied */ +int want_pending_command; /* -c flag supplied */ + +/* This variable is not static so it can be bound to $BASH_EXECUTION_STRING */ +char *command_execution_string; /* argument to -c option */ + +int malloc_trace_at_exit = 0; + +static int shell_reinitialized = 0; + +static FILE *default_input; + +static STRING_INT_ALIST *shopt_alist; +static int shopt_ind = 0, shopt_len = 0; + +static int parse_long_options __P((char **, int, int)); +static int parse_shell_options __P((char **, int, int)); +static int bind_args __P((char **, int, int, int)); + +static void start_debugger __P((void)); + +static void add_shopt_to_alist __P((char *, int)); +static void run_shopt_alist __P((void)); + +static void execute_env_file __P((char *)); +static void run_startup_files __P((void)); +static int open_shell_script __P((char *)); +static void set_bash_input __P((void)); +static int run_one_command __P((char *)); +#if defined (WORDEXP_OPTION) +static int run_wordexp __P((char *)); +#endif + +static int uidget __P((void)); + +static void init_interactive __P((void)); +static void init_noninteractive __P((void)); +static void init_interactive_script __P((void)); + +static void set_shell_name __P((char *)); +static void shell_initialize __P((void)); +static void shell_reinitialize __P((void)); + +static void show_shell_usage __P((FILE *, int)); + +#ifdef __CYGWIN__ +static void +_cygwin32_check_tmp () +{ + struct stat sb; + + if (stat ("/tmp", &sb) < 0) + internal_warning (_("could not find /tmp, please create!")); + else + { + if (S_ISDIR (sb.st_mode) == 0) + internal_warning (_("/tmp must be a valid directory name")); + } +} +#endif /* __CYGWIN__ */ + +#if defined (NO_MAIN_ENV_ARG) +/* systems without third argument to main() */ +int +main (argc, argv) + int argc; + char **argv; +#else /* !NO_MAIN_ENV_ARG */ +int +main (argc, argv, env) + int argc; + char **argv, **env; +#endif /* !NO_MAIN_ENV_ARG */ +{ + register int i; + int code, old_errexit_flag; +#if defined (RESTRICTED_SHELL) + int saverst; +#endif + volatile int locally_skip_execution; + volatile int arg_index, top_level_arg_index; +#ifdef __OPENNT + char **env; + + env = environ; +#endif /* __OPENNT */ + + USE_VAR(argc); + USE_VAR(argv); + USE_VAR(env); + USE_VAR(code); + USE_VAR(old_errexit_flag); +#if defined (RESTRICTED_SHELL) + USE_VAR(saverst); +#endif + + /* Catch early SIGINTs. */ + code = setjmp_nosigs (top_level); + if (code) + exit (2); + + xtrace_init (); + +#if defined (USING_BASH_MALLOC) && defined (DEBUG) && !defined (DISABLE_MALLOC_WRAPPERS) +# if 1 + malloc_set_register (1); +# endif +#endif + + check_dev_tty (); + +#ifdef __CYGWIN__ + _cygwin32_check_tmp (); +#endif /* __CYGWIN__ */ + + /* Wait forever if we are debugging a login shell. */ + while (debugging_login_shell) sleep (3); + + set_default_locale (); + + running_setuid = uidget (); + + if (getenv ("POSIXLY_CORRECT") || getenv ("POSIX_PEDANTIC")) + posixly_correct = 1; + +#if defined (USE_GNU_MALLOC_LIBRARY) + mcheck (programming_error, (void (*) ())0); +#endif /* USE_GNU_MALLOC_LIBRARY */ + + if (setjmp (subshell_top_level)) + { + argc = subshell_argc; + argv = subshell_argv; + env = subshell_envp; + sourced_env = 0; + } + + shell_reinitialized = 0; + + /* Initialize `local' variables for all `invocations' of main (). */ + arg_index = 1; + if (arg_index > argc) + arg_index = argc; + command_execution_string = (char *)NULL; + want_pending_command = locally_skip_execution = read_from_stdin = 0; + default_input = stdin; +#if defined (BUFFERED_INPUT) + default_buffered_input = -1; +#endif + + /* Fix for the `infinite process creation' bug when running shell scripts + from startup files on System V. */ + login_shell = make_login_shell = 0; + + /* If this shell has already been run, then reinitialize it to a + vanilla state. */ + if (shell_initialized || shell_name) + { + /* Make sure that we do not infinitely recurse as a login shell. */ + if (*shell_name == '-') + shell_name++; + + shell_reinitialize (); + if (setjmp_nosigs (top_level)) + exit (2); + } + + shell_environment = env; + set_shell_name (argv[0]); + shell_start_time = NOW; /* NOW now defined in general.h */ + + /* Parse argument flags from the input line. */ + + /* Find full word arguments first. */ + arg_index = parse_long_options (argv, arg_index, argc); + + if (want_initial_help) + { + show_shell_usage (stdout, 1); + exit (EXECUTION_SUCCESS); + } + + if (do_version) + { + show_shell_version (1); + exit (EXECUTION_SUCCESS); + } + + /* All done with full word options; do standard shell option parsing.*/ + this_command_name = shell_name; /* for error reporting */ + arg_index = parse_shell_options (argv, arg_index, argc); + + /* If user supplied the "--login" (or -l) flag, then set and invert + LOGIN_SHELL. */ + if (make_login_shell) + { + login_shell++; + login_shell = -login_shell; + } + + set_login_shell ("login_shell", login_shell != 0); + + if (dump_po_strings) + dump_translatable_strings = 1; + + if (dump_translatable_strings) + read_but_dont_execute = 1; + + if (running_setuid && privileged_mode == 0) + disable_priv_mode (); + + /* Need to get the argument to a -c option processed in the + above loop. The next arg is a command to execute, and the + following args are $0...$n respectively. */ + if (want_pending_command) + { + command_execution_string = argv[arg_index]; + if (command_execution_string == 0) + { + report_error (_("%s: option requires an argument"), "-c"); + exit (EX_BADUSAGE); + } + arg_index++; + } + this_command_name = (char *)NULL; + + cmd_init(); /* initialize the command object caches */ + + /* First, let the outside world know about our interactive status. + A shell is interactive if the `-i' flag was given, or if all of + the following conditions are met: + no -c command + no arguments remaining or the -s flag given + standard input is a terminal + standard error is a terminal + Refer to Posix.2, the description of the `sh' utility. */ + + if (forced_interactive || /* -i flag */ + (!command_execution_string && /* No -c command and ... */ + wordexp_only == 0 && /* No --wordexp and ... */ + ((arg_index == argc) || /* no remaining args or... */ + read_from_stdin) && /* -s flag with args, and */ + isatty (fileno (stdin)) && /* Input is a terminal and */ + isatty (fileno (stderr)))) /* error output is a terminal. */ + init_interactive (); + else + init_noninteractive (); + + /* + * Some systems have the bad habit of starting login shells with lots of open + * file descriptors. For instance, most systems that have picked up the + * pre-4.0 Sun YP code leave a file descriptor open each time you call one + * of the getpw* functions, and it's set to be open across execs. That + * means one for login, one for xterm, one for shelltool, etc. There are + * also systems that open persistent FDs to other agents or files as part + * of process startup; these need to be set to be close-on-exec. + */ + if (login_shell && interactive_shell) + { + for (i = 3; i < 20; i++) + SET_CLOSE_ON_EXEC (i); + } + + /* If we're in a strict Posix.2 mode, turn on interactive comments, + alias expansion in non-interactive shells, and other Posix.2 things. */ + if (posixly_correct) + { + bind_variable ("POSIXLY_CORRECT", "y", 0); + sv_strict_posix ("POSIXLY_CORRECT"); + } + + /* Now we run the shopt_alist and process the options. */ + if (shopt_alist) + run_shopt_alist (); + + /* From here on in, the shell must be a normal functioning shell. + Variables from the environment are expected to be set, etc. */ + shell_initialize (); + + set_default_lang (); + set_default_locale_vars (); + + /* + * M-x term -> TERM=eterm EMACS=22.1 (term:0.96) (eterm) + * M-x shell -> TERM=dumb EMACS=t (no line editing) + * M-x terminal -> TERM=emacs-em7955 EMACS= (line editing) + */ + if (interactive_shell) + { + char *term, *emacs; + + term = get_string_value ("TERM"); + emacs = get_string_value ("EMACS"); + + /* Not sure any emacs terminal emulator sets TERM=emacs any more */ + no_line_editing |= term && (STREQ (term, "emacs")); + no_line_editing |= emacs && emacs[0] == 't' && emacs[1] == '\0' && STREQ (term, "dumb"); + + /* running_under_emacs == 2 for `eterm' */ + running_under_emacs = (emacs != 0) || (term && STREQN (term, "emacs", 5)); + running_under_emacs += term && STREQN (term, "eterm", 5) && emacs && strstr (emacs, "term"); + + if (running_under_emacs) + gnu_error_format = 1; + } + + top_level_arg_index = arg_index; + old_errexit_flag = exit_immediately_on_error; + + /* Give this shell a place to longjmp to before executing the + startup files. This allows users to press C-c to abort the + lengthy startup. */ + code = setjmp (top_level); + if (code) + { + if (code == EXITPROG || code == ERREXIT) + exit_shell (last_command_exit_value); + else + { +#if defined (JOB_CONTROL) + /* Reset job control, since run_startup_files turned it off. */ + set_job_control (interactive_shell); +#endif + /* Reset value of `set -e', since it's turned off before running + the startup files. */ + exit_immediately_on_error += old_errexit_flag; + locally_skip_execution++; + } + } + + arg_index = top_level_arg_index; + + /* Execute the start-up scripts. */ + + if (interactive_shell == 0) + { + unbind_variable ("PS1"); + unbind_variable ("PS2"); + interactive = 0; +#if 0 + /* This has already been done by init_noninteractive */ + expand_aliases = posixly_correct; +#endif + } + else + { + change_flag ('i', FLAG_ON); + interactive = 1; + } + +#if defined (RESTRICTED_SHELL) + /* Set restricted_shell based on whether the basename of $0 indicates that + the shell should be restricted or if the `-r' option was supplied at + startup. */ + restricted_shell = shell_is_restricted (shell_name); + + /* If the `-r' option is supplied at invocation, make sure that the shell + is not in restricted mode when running the startup files. */ + saverst = restricted; + restricted = 0; +#endif + + /* The startup files are run with `set -e' temporarily disabled. */ + if (locally_skip_execution == 0 && running_setuid == 0) + { + old_errexit_flag = exit_immediately_on_error; + exit_immediately_on_error = 0; + + run_startup_files (); + exit_immediately_on_error += old_errexit_flag; + } + + /* If we are invoked as `sh', turn on Posix mode. */ + if (act_like_sh) + { + bind_variable ("POSIXLY_CORRECT", "y", 0); + sv_strict_posix ("POSIXLY_CORRECT"); + } + +#if defined (RESTRICTED_SHELL) + /* Turn on the restrictions after executing the startup files. This + means that `bash -r' or `set -r' invoked from a startup file will + turn on the restrictions after the startup files are executed. */ + restricted = saverst || restricted; + if (shell_reinitialized == 0) + maybe_make_restricted (shell_name); +#endif /* RESTRICTED_SHELL */ + +#if defined (WORDEXP_OPTION) + if (wordexp_only) + { + startup_state = 3; + last_command_exit_value = run_wordexp (argv[arg_index]); + exit_shell (last_command_exit_value); + } +#endif + + if (command_execution_string) + { + arg_index = bind_args (argv, arg_index, argc, 0); + startup_state = 2; + + if (debugging_mode) + start_debugger (); + +#if defined (ONESHOT) + executing = 1; + run_one_command (command_execution_string); + exit_shell (last_command_exit_value); +#else /* ONESHOT */ + with_input_from_string (command_execution_string, "-c"); + goto read_and_execute; +#endif /* !ONESHOT */ + } + + /* Get possible input filename and set up default_buffered_input or + default_input as appropriate. */ + if (arg_index != argc && read_from_stdin == 0) + { + open_shell_script (argv[arg_index]); + arg_index++; + } + else if (interactive == 0) + /* In this mode, bash is reading a script from stdin, which is a + pipe or redirected file. */ +#if defined (BUFFERED_INPUT) + default_buffered_input = fileno (stdin); /* == 0 */ +#else + setbuf (default_input, (char *)NULL); +#endif /* !BUFFERED_INPUT */ + + set_bash_input (); + + /* Bind remaining args to $1 ... $n */ + arg_index = bind_args (argv, arg_index, argc, 1); + + if (debugging_mode && locally_skip_execution == 0 && running_setuid == 0 && dollar_vars[1]) + start_debugger (); + + /* Do the things that should be done only for interactive shells. */ + if (interactive_shell) + { + /* Set up for checking for presence of mail. */ + reset_mail_timer (); + init_mail_dates (); + +#if defined (HISTORY) + /* Initialize the interactive history stuff. */ + bash_initialize_history (); + /* Don't load the history from the history file if we've already + saved some lines in this session (e.g., by putting `history -s xx' + into one of the startup files). */ + if (shell_initialized == 0 && history_lines_this_session == 0) + load_history (); +#endif /* HISTORY */ + + /* Initialize terminal state for interactive shells after the + .bash_profile and .bashrc are interpreted. */ + get_tty_state (); + } + +#if !defined (ONESHOT) + read_and_execute: +#endif /* !ONESHOT */ + + shell_initialized = 1; + + /* Read commands until exit condition. */ + reader_loop (); + exit_shell (last_command_exit_value); +} + +static int +parse_long_options (argv, arg_start, arg_end) + char **argv; + int arg_start, arg_end; +{ + int arg_index, longarg, i; + char *arg_string; + + arg_index = arg_start; + while ((arg_index != arg_end) && (arg_string = argv[arg_index]) && + (*arg_string == '-')) + { + longarg = 0; + + /* Make --login equivalent to -login. */ + if (arg_string[1] == '-' && arg_string[2]) + { + longarg = 1; + arg_string++; + } + + for (i = 0; long_args[i].name; i++) + { + if (STREQ (arg_string + 1, long_args[i].name)) + { + if (long_args[i].type == Int) + *long_args[i].int_value = 1; + else if (argv[++arg_index] == 0) + { + report_error (_("%s: option requires an argument"), long_args[i].name); + exit (EX_BADUSAGE); + } + else + *long_args[i].char_value = argv[arg_index]; + + break; + } + } + if (long_args[i].name == 0) + { + if (longarg) + { + report_error (_("%s: invalid option"), argv[arg_index]); + show_shell_usage (stderr, 0); + exit (EX_BADUSAGE); + } + break; /* No such argument. Maybe flag arg. */ + } + + arg_index++; + } + + return (arg_index); +} + +static int +parse_shell_options (argv, arg_start, arg_end) + char **argv; + int arg_start, arg_end; +{ + int arg_index; + int arg_character, on_or_off, next_arg, i; + char *o_option, *arg_string; + + arg_index = arg_start; + while (arg_index != arg_end && (arg_string = argv[arg_index]) && + (*arg_string == '-' || *arg_string == '+')) + { + /* There are flag arguments, so parse them. */ + next_arg = arg_index + 1; + + /* A single `-' signals the end of options. From the 4.3 BSD sh. + An option `--' means the same thing; this is the standard + getopt(3) meaning. */ + if (arg_string[0] == '-' && + (arg_string[1] == '\0' || + (arg_string[1] == '-' && arg_string[2] == '\0'))) + return (next_arg); + + i = 1; + on_or_off = arg_string[0]; + while (arg_character = arg_string[i++]) + { + switch (arg_character) + { + case 'c': + want_pending_command = 1; + break; + + case 'l': + make_login_shell = 1; + break; + + case 's': + read_from_stdin = 1; + break; + + case 'o': + o_option = argv[next_arg]; + if (o_option == 0) + { + list_minus_o_opts (-1, (on_or_off == '-') ? 0 : 1); + break; + } + if (set_minus_o_option (on_or_off, o_option) != EXECUTION_SUCCESS) + exit (EX_BADUSAGE); + next_arg++; + break; + + case 'O': + /* Since some of these can be overridden by the normal + interactive/non-interactive shell initialization or + initializing posix mode, we save the options and process + them after initialization. */ + o_option = argv[next_arg]; + if (o_option == 0) + { + shopt_listopt (o_option, (on_or_off == '-') ? 0 : 1); + break; + } + add_shopt_to_alist (o_option, on_or_off); + next_arg++; + break; + + case 'D': + dump_translatable_strings = 1; + break; + + default: + if (change_flag (arg_character, on_or_off) == FLAG_ERROR) + { + report_error (_("%c%c: invalid option"), on_or_off, arg_character); + show_shell_usage (stderr, 0); + exit (EX_BADUSAGE); + } + } + } + /* Can't do just a simple increment anymore -- what about + "bash -abouo emacs ignoreeof -hP"? */ + arg_index = next_arg; + } + + return (arg_index); +} + +/* Exit the shell with status S. */ +void +exit_shell (s) + int s; +{ + fflush (stdout); /* XXX */ + fflush (stderr); + + /* Do trap[0] if defined. Allow it to override the exit status + passed to us. */ + if (signal_is_trapped (0)) + s = run_exit_trap (); + +#if defined (PROCESS_SUBSTITUTION) + unlink_fifo_list (); +#endif /* PROCESS_SUBSTITUTION */ + +#if defined (HISTORY) + if (remember_on_history) + maybe_save_shell_history (); +#endif /* HISTORY */ + +#if defined (COPROCESS_SUPPORT) + coproc_flush (); +#endif + +#if defined (JOB_CONTROL) + /* If the user has run `shopt -s huponexit', hangup all jobs when we exit + an interactive login shell. ksh does this unconditionally. */ + if (interactive_shell && login_shell && hup_on_exit) + hangup_all_jobs (); + + /* If this shell is interactive, terminate all stopped jobs and + restore the original terminal process group. Don't do this if we're + in a subshell and calling exit_shell after, for example, a failed + word expansion. */ + if (subshell_environment == 0) + end_job_control (); +#endif /* JOB_CONTROL */ + + /* Always return the exit status of the last command to our parent. */ + sh_exit (s); +} + +/* A wrapper for exit that (optionally) can do other things, like malloc + statistics tracing. */ +void +sh_exit (s) + int s; +{ +#if defined (MALLOC_DEBUG) && defined (USING_BASH_MALLOC) + if (malloc_trace_at_exit) + trace_malloc_stats (get_name_for_error (), (char *)NULL); +#endif + + exit (s); +} + +/* Exit a subshell, which includes calling the exit trap. We don't want to + do any more cleanup, since a subshell is created as an exact copy of its + parent. */ +void +subshell_exit (s) + int s; +{ + fflush (stdout); + fflush (stderr); + + /* Do trap[0] if defined. Allow it to override the exit status + passed to us. */ + if (signal_is_trapped (0)) + s = run_exit_trap (); + + sh_exit (s); +} + +/* Source the bash startup files. If POSIXLY_CORRECT is non-zero, we obey + the Posix.2 startup file rules: $ENV is expanded, and if the file it + names exists, that file is sourced. The Posix.2 rules are in effect + for interactive shells only. (section 4.56.5.3) */ + +/* Execute ~/.bashrc for most shells. Never execute it if + ACT_LIKE_SH is set, or if NO_RC is set. + + If the executable file "/usr/gnu/src/bash/foo" contains: + + #!/usr/gnu/bin/bash + echo hello + + then: + + COMMAND EXECUTE BASHRC + -------------------------------- + bash -c foo NO + bash foo NO + foo NO + rsh machine ls YES (for rsh, which calls `bash -c') + rsh machine foo YES (for shell started by rsh) NO (for foo!) + echo ls | bash NO + login NO + bash YES +*/ + +static void +execute_env_file (env_file) + char *env_file; +{ + char *fn; + + if (env_file && *env_file) + { + fn = expand_string_unsplit_to_string (env_file, Q_DOUBLE_QUOTES); + if (fn && *fn) + maybe_execute_file (fn, 1); + FREE (fn); + } +} + +static void +run_startup_files () +{ +#if defined (JOB_CONTROL) + int old_job_control; +#endif + int sourced_login, run_by_ssh; + + /* get the rshd/sshd case out of the way first. */ + if (interactive_shell == 0 && no_rc == 0 && login_shell == 0 && + act_like_sh == 0 && command_execution_string) + { +#ifdef SSH_SOURCE_BASHRC + run_by_ssh = (find_variable ("SSH_CLIENT") != (SHELL_VAR *)0) || + (find_variable ("SSH2_CLIENT") != (SHELL_VAR *)0); +#else + run_by_ssh = 0; +#endif + + /* If we were run by sshd or we think we were run by rshd, execute + ~/.bashrc if we are a top-level shell. */ + if ((run_by_ssh || isnetconn (fileno (stdin))) && shell_level < 2) + { +#ifdef SYS_BASHRC +# if defined (__OPENNT) + maybe_execute_file (_prefixInstallPath(SYS_BASHRC, NULL, 0), 1); +# else + maybe_execute_file (SYS_BASHRC, 1); +# endif +#endif + maybe_execute_file (bashrc_file, 1); + return; + } + } + +#if defined (JOB_CONTROL) + /* Startup files should be run without job control enabled. */ + old_job_control = interactive_shell ? set_job_control (0) : 0; +#endif + + sourced_login = 0; + + /* A shell begun with the --login (or -l) flag that is not in posix mode + runs the login shell startup files, no matter whether or not it is + interactive. If NON_INTERACTIVE_LOGIN_SHELLS is defined, run the + startup files if argv[0][0] == '-' as well. */ +#if defined (NON_INTERACTIVE_LOGIN_SHELLS) + if (login_shell && posixly_correct == 0) +#else + if (login_shell < 0 && posixly_correct == 0) +#endif + { + /* We don't execute .bashrc for login shells. */ + no_rc++; + + /* Execute /etc/profile and one of the personal login shell + initialization files. */ + if (no_profile == 0) + { + maybe_execute_file (SYS_PROFILE, 1); + + if (act_like_sh) /* sh */ + maybe_execute_file ("~/.profile", 1); + else if ((maybe_execute_file ("~/.bash_profile", 1) == 0) && + (maybe_execute_file ("~/.bash_login", 1) == 0)) /* bash */ + maybe_execute_file ("~/.profile", 1); + } + + sourced_login = 1; + } + + /* A non-interactive shell not named `sh' and not in posix mode reads and + executes commands from $BASH_ENV. If `su' starts a shell with `-c cmd' + and `-su' as the name of the shell, we want to read the startup files. + No other non-interactive shells read any startup files. */ + if (interactive_shell == 0 && !(su_shell && login_shell)) + { + if (posixly_correct == 0 && act_like_sh == 0 && privileged_mode == 0 && + sourced_env++ == 0) + execute_env_file (get_string_value ("BASH_ENV")); + return; + } + + /* Interactive shell or `-su' shell. */ + if (posixly_correct == 0) /* bash, sh */ + { + if (login_shell && sourced_login++ == 0) + { + /* We don't execute .bashrc for login shells. */ + no_rc++; + + /* Execute /etc/profile and one of the personal login shell + initialization files. */ + if (no_profile == 0) + { + maybe_execute_file (SYS_PROFILE, 1); + + if (act_like_sh) /* sh */ + maybe_execute_file ("~/.profile", 1); + else if ((maybe_execute_file ("~/.bash_profile", 1) == 0) && + (maybe_execute_file ("~/.bash_login", 1) == 0)) /* bash */ + maybe_execute_file ("~/.profile", 1); + } + } + + /* bash */ + if (act_like_sh == 0 && no_rc == 0) + { +#ifdef SYS_BASHRC +# if defined (__OPENNT) + maybe_execute_file (_prefixInstallPath(SYS_BASHRC, NULL, 0), 1); +# else + maybe_execute_file (SYS_BASHRC, 1); +# endif +#endif + maybe_execute_file (bashrc_file, 1); + } + /* sh */ + else if (act_like_sh && privileged_mode == 0 && sourced_env++ == 0) + execute_env_file (get_string_value ("ENV")); + } + else /* bash --posix, sh --posix */ + { + /* bash and sh */ + if (interactive_shell && privileged_mode == 0 && sourced_env++ == 0) + execute_env_file (get_string_value ("ENV")); + } + +#if defined (JOB_CONTROL) + set_job_control (old_job_control); +#endif +} + +#if defined (RESTRICTED_SHELL) +/* Return 1 if the shell should be a restricted one based on NAME or the + value of `restricted'. Don't actually do anything, just return a + boolean value. */ +int +shell_is_restricted (name) + char *name; +{ + char *temp; + + if (restricted) + return 1; + temp = base_pathname (name); + if (*temp == '-') + temp++; + return (STREQ (temp, RESTRICTED_SHELL_NAME)); +} + +/* Perhaps make this shell a `restricted' one, based on NAME. If the + basename of NAME is "rbash", then this shell is restricted. The + name of the restricted shell is a configurable option, see config.h. + In a restricted shell, PATH, SHELL, ENV, and BASH_ENV are read-only + and non-unsettable. + Do this also if `restricted' is already set to 1; maybe the shell was + started with -r. */ +int +maybe_make_restricted (name) + char *name; +{ + char *temp; + + temp = base_pathname (name); + if (*temp == '-') + temp++; + if (restricted || (STREQ (temp, RESTRICTED_SHELL_NAME))) + { + set_var_read_only ("PATH"); + set_var_read_only ("SHELL"); + set_var_read_only ("ENV"); + set_var_read_only ("BASH_ENV"); + restricted = 1; + } + return (restricted); +} +#endif /* RESTRICTED_SHELL */ + +/* Fetch the current set of uids and gids and return 1 if we're running + setuid or setgid. */ +static int +uidget () +{ + uid_t u; + + u = getuid (); + if (current_user.uid != u) + { + FREE (current_user.user_name); + FREE (current_user.shell); + FREE (current_user.home_dir); + current_user.user_name = current_user.shell = current_user.home_dir = (char *)NULL; + } + current_user.uid = u; + current_user.gid = getgid (); + current_user.euid = geteuid (); + current_user.egid = getegid (); + + /* See whether or not we are running setuid or setgid. */ + return (current_user.uid != current_user.euid) || + (current_user.gid != current_user.egid); +} + +void +disable_priv_mode () +{ + setuid (current_user.uid); + setgid (current_user.gid); + current_user.euid = current_user.uid; + current_user.egid = current_user.gid; +} + +#if defined (WORDEXP_OPTION) +static int +run_wordexp (words) + char *words; +{ + int code, nw, nb; + WORD_LIST *wl, *tl, *result; + + code = setjmp_nosigs (top_level); + + if (code != NOT_JUMPED) + { + switch (code) + { + /* Some kind of throw to top_level has occurred. */ + case FORCE_EOF: + return last_command_exit_value = 127; + case ERREXIT: + case EXITPROG: + return last_command_exit_value; + case DISCARD: + return last_command_exit_value = 1; + default: + command_error ("run_wordexp", CMDERR_BADJUMP, code, 0); + } + } + + /* Run it through the parser to get a list of words and expand them */ + if (words && *words) + { + with_input_from_string (words, "--wordexp"); + if (parse_command () != 0) + return (126); + if (global_command == 0) + { + printf ("0\n0\n"); + return (0); + } + if (global_command->type != cm_simple) + return (126); + wl = global_command->value.Simple->words; + if (protected_mode) + for (tl = wl; tl; tl = tl->next) + tl->word->flags |= W_NOCOMSUB|W_NOPROCSUB; + result = wl ? expand_words_no_vars (wl) : (WORD_LIST *)0; + } + else + result = (WORD_LIST *)0; + + last_command_exit_value = 0; + + if (result == 0) + { + printf ("0\n0\n"); + return (0); + } + + /* Count up the number of words and bytes, and print them. Don't count + the trailing NUL byte. */ + for (nw = nb = 0, wl = result; wl; wl = wl->next) + { + nw++; + nb += strlen (wl->word->word); + } + printf ("%u\n%u\n", nw, nb); + /* Print each word on a separate line. This will have to be changed when + the interface to glibc is completed. */ + for (wl = result; wl; wl = wl->next) + printf ("%s\n", wl->word->word); + + return (0); +} +#endif + +#if defined (ONESHOT) +/* Run one command, given as the argument to the -c option. Tell + parse_and_execute not to fork for a simple command. */ +static int +run_one_command (command) + char *command; +{ + int code; + + code = setjmp_nosigs (top_level); + + if (code != NOT_JUMPED) + { +#if defined (PROCESS_SUBSTITUTION) + unlink_fifo_list (); +#endif /* PROCESS_SUBSTITUTION */ + switch (code) + { + /* Some kind of throw to top_level has occurred. */ + case FORCE_EOF: + return last_command_exit_value = 127; + case ERREXIT: + case EXITPROG: + return last_command_exit_value; + case DISCARD: + return last_command_exit_value = 1; + default: + command_error ("run_one_command", CMDERR_BADJUMP, code, 0); + } + } + return (parse_and_execute (savestring (command), "-c", SEVAL_NOHIST)); +} +#endif /* ONESHOT */ + +static int +bind_args (argv, arg_start, arg_end, start_index) + char **argv; + int arg_start, arg_end, start_index; +{ + register int i; + WORD_LIST *args; + + for (i = arg_start, args = (WORD_LIST *)NULL; i < arg_end; i++) + args = make_word_list (make_word (argv[i]), args); + if (args) + { + args = REVERSE_LIST (args, WORD_LIST *); + if (start_index == 0) /* bind to $0...$n for sh -c command */ + { + /* Posix.2 4.56.3 says that the first argument after sh -c command + becomes $0, and the rest of the arguments become $1...$n */ + shell_name = savestring (args->word->word); + FREE (dollar_vars[0]); + dollar_vars[0] = savestring (args->word->word); + remember_args (args->next, 1); + push_args (args->next); /* BASH_ARGV and BASH_ARGC */ + } + else /* bind to $1...$n for shell script */ + { + remember_args (args, 1); + push_args (args); /* BASH_ARGV and BASH_ARGC */ + } + + dispose_words (args); + } + + return (i); +} + +void +unbind_args () +{ + remember_args ((WORD_LIST *)NULL, 1); + pop_args (); /* Reset BASH_ARGV and BASH_ARGC */ +} + +static void +start_debugger () +{ +#if defined (DEBUGGER) && defined (DEBUGGER_START_FILE) + int old_errexit; + + old_errexit = exit_immediately_on_error; + exit_immediately_on_error = 0; + + maybe_execute_file (DEBUGGER_START_FILE, 1); + function_trace_mode = 1; + + exit_immediately_on_error += old_errexit; +#endif +} + +static int +open_shell_script (script_name) + char *script_name; +{ + int fd, e, fd_is_tty; + char *filename, *path_filename, *t; + char sample[80]; + int sample_len; + struct stat sb; +#if defined (ARRAY_VARS) + SHELL_VAR *funcname_v, *bash_source_v, *bash_lineno_v; + ARRAY *funcname_a, *bash_source_a, *bash_lineno_a; +#endif + + filename = savestring (script_name); + + fd = open (filename, O_RDONLY); + if ((fd < 0) && (errno == ENOENT) && (absolute_program (filename) == 0)) + { + e = errno; + /* If it's not in the current directory, try looking through PATH + for it. */ + path_filename = find_path_file (script_name); + if (path_filename) + { + free (filename); + filename = path_filename; + fd = open (filename, O_RDONLY); + } + else + errno = e; + } + + if (fd < 0) + { + e = errno; + file_error (filename); + exit ((e == ENOENT) ? EX_NOTFOUND : EX_NOINPUT); + } + + free (dollar_vars[0]); + dollar_vars[0] = exec_argv0 ? savestring (exec_argv0) : savestring (script_name); + if (exec_argv0) + { + free (exec_argv0); + exec_argv0 = (char *)NULL; + } + +#if defined (ARRAY_VARS) + GET_ARRAY_FROM_VAR ("FUNCNAME", funcname_v, funcname_a); + GET_ARRAY_FROM_VAR ("BASH_SOURCE", bash_source_v, bash_source_a); + GET_ARRAY_FROM_VAR ("BASH_LINENO", bash_lineno_v, bash_lineno_a); + + array_push (bash_source_a, filename); + if (bash_lineno_a) + { + t = itos (executing_line_number ()); + array_push (bash_lineno_a, t); + free (t); + } + array_push (funcname_a, "main"); +#endif + +#ifdef HAVE_DEV_FD + fd_is_tty = isatty (fd); +#else + fd_is_tty = 0; +#endif + + /* Only do this with non-tty file descriptors we can seek on. */ + if (fd_is_tty == 0 && (lseek (fd, 0L, 1) != -1)) + { + /* Check to see if the `file' in `bash file' is a binary file + according to the same tests done by execute_simple_command (), + and report an error and exit if it is. */ + sample_len = read (fd, sample, sizeof (sample)); + if (sample_len < 0) + { + e = errno; + if ((fstat (fd, &sb) == 0) && S_ISDIR (sb.st_mode)) + internal_error (_("%s: is a directory"), filename); + else + { + errno = e; + file_error (filename); + } + exit (EX_NOEXEC); + } + else if (sample_len > 0 && (check_binary_file (sample, sample_len))) + { + internal_error (_("%s: cannot execute binary file"), filename); + exit (EX_BINARY_FILE); + } + /* Now rewind the file back to the beginning. */ + lseek (fd, 0L, 0); + } + + /* Open the script. But try to move the file descriptor to a randomly + large one, in the hopes that any descriptors used by the script will + not match with ours. */ + fd = move_to_high_fd (fd, 1, -1); + +#if defined (BUFFERED_INPUT) + default_buffered_input = fd; + SET_CLOSE_ON_EXEC (default_buffered_input); +#else /* !BUFFERED_INPUT */ + default_input = fdopen (fd, "r"); + + if (default_input == 0) + { + file_error (filename); + exit (EX_NOTFOUND); + } + + SET_CLOSE_ON_EXEC (fd); + if (fileno (default_input) != fd) + SET_CLOSE_ON_EXEC (fileno (default_input)); +#endif /* !BUFFERED_INPUT */ + + /* Just about the only way for this code to be executed is if something + like `bash -i /dev/stdin' is executed. */ + if (interactive_shell && fd_is_tty) + { + dup2 (fd, 0); + close (fd); + fd = 0; +#if defined (BUFFERED_INPUT) + default_buffered_input = 0; +#else + fclose (default_input); + default_input = stdin; +#endif + } + else if (forced_interactive && fd_is_tty == 0) + /* But if a script is called with something like `bash -i scriptname', + we need to do a non-interactive setup here, since we didn't do it + before. */ + init_interactive_script (); + + free (filename); + return (fd); +} + +/* Initialize the input routines for the parser. */ +static void +set_bash_input () +{ + /* Make sure the fd from which we are reading input is not in + no-delay mode. */ +#if defined (BUFFERED_INPUT) + if (interactive == 0) + sh_unset_nodelay_mode (default_buffered_input); + else +#endif /* !BUFFERED_INPUT */ + sh_unset_nodelay_mode (fileno (stdin)); + + /* with_input_from_stdin really means `with_input_from_readline' */ + if (interactive && no_line_editing == 0) + with_input_from_stdin (); +#if defined (BUFFERED_INPUT) + else if (interactive == 0) + with_input_from_buffered_stream (default_buffered_input, dollar_vars[0]); +#endif /* BUFFERED_INPUT */ + else + with_input_from_stream (default_input, dollar_vars[0]); +} + +/* Close the current shell script input source and forget about it. This is + extern so execute_cmd.c:initialize_subshell() can call it. If CHECK_ZERO + is non-zero, we close default_buffered_input even if it's the standard + input (fd 0). */ +void +unset_bash_input (check_zero) + int check_zero; +{ +#if defined (BUFFERED_INPUT) + if ((check_zero && default_buffered_input >= 0) || + (check_zero == 0 && default_buffered_input > 0)) + { + close_buffered_fd (default_buffered_input); + default_buffered_input = bash_input.location.buffered_fd = -1; + bash_input.type = st_none; /* XXX */ + } +#else /* !BUFFERED_INPUT */ + if (default_input) + { + fclose (default_input); + default_input = (FILE *)NULL; + } +#endif /* !BUFFERED_INPUT */ +} + + +#if !defined (PROGRAM) +# define PROGRAM "bash" +#endif + +static void +set_shell_name (argv0) + char *argv0; +{ + /* Here's a hack. If the name of this shell is "sh", then don't do + any startup files; just try to be more like /bin/sh. */ + shell_name = argv0 ? base_pathname (argv0) : PROGRAM; + + if (argv0 && *argv0 == '-') + { + if (*shell_name == '-') + shell_name++; + login_shell = 1; + } + + if (shell_name[0] == 's' && shell_name[1] == 'h' && shell_name[2] == '\0') + act_like_sh++; + if (shell_name[0] == 's' && shell_name[1] == 'u' && shell_name[2] == '\0') + su_shell++; + + shell_name = argv0 ? argv0 : PROGRAM; + FREE (dollar_vars[0]); + dollar_vars[0] = savestring (shell_name); + + /* A program may start an interactive shell with + "execl ("/bin/bash", "-", NULL)". + If so, default the name of this shell to our name. */ + if (!shell_name || !*shell_name || (shell_name[0] == '-' && !shell_name[1])) + shell_name = PROGRAM; +} + +static void +init_interactive () +{ + expand_aliases = interactive_shell = startup_state = 1; + interactive = 1; +} + +static void +init_noninteractive () +{ +#if defined (HISTORY) + bash_history_reinit (0); +#endif /* HISTORY */ + interactive_shell = startup_state = interactive = 0; + expand_aliases = posixly_correct; /* XXX - was 0 not posixly_correct */ + no_line_editing = 1; +#if defined (JOB_CONTROL) + /* Even if the shell is not interactive, enable job control if the -i or + -m option is supplied at startup. */ + set_job_control (forced_interactive||jobs_m_flag); +#endif /* JOB_CONTROL */ +} + +static void +init_interactive_script () +{ + init_noninteractive (); + expand_aliases = interactive_shell = startup_state = 1; +} + +void +get_current_user_info () +{ + struct passwd *entry; + + /* Don't fetch this more than once. */ + if (current_user.user_name == 0) + { +#if defined (__TANDEM) + entry = getpwnam (getlogin ()); +#else + entry = getpwuid (current_user.uid); +#endif + if (entry) + { + current_user.user_name = savestring (entry->pw_name); + current_user.shell = (entry->pw_shell && entry->pw_shell[0]) + ? savestring (entry->pw_shell) + : savestring ("/bin/sh"); + current_user.home_dir = savestring (entry->pw_dir); + } + else + { + current_user.user_name = _("I have no name!"); + current_user.user_name = savestring (current_user.user_name); + current_user.shell = savestring ("/bin/sh"); + current_user.home_dir = savestring ("/"); + } + endpwent (); + } +} + +/* Do whatever is necessary to initialize the shell. + Put new initializations in here. */ +static void +shell_initialize () +{ + char hostname[256]; + + /* Line buffer output for stderr and stdout. */ + if (shell_initialized == 0) + { + sh_setlinebuf (stderr); + sh_setlinebuf (stdout); + } + + /* Sort the array of shell builtins so that the binary search in + find_shell_builtin () works correctly. */ + initialize_shell_builtins (); + + /* Initialize the trap signal handlers before installing our own + signal handlers. traps.c:restore_original_signals () is responsible + for restoring the original default signal handlers. That function + is called when we make a new child. */ + initialize_traps (); + initialize_signals (0); + + /* It's highly unlikely that this will change. */ + if (current_host_name == 0) + { + /* Initialize current_host_name. */ + if (gethostname (hostname, 255) < 0) + current_host_name = "??host??"; + else + current_host_name = savestring (hostname); + } + + /* Initialize the stuff in current_user that comes from the password + file. We don't need to do this right away if the shell is not + interactive. */ + if (interactive_shell) + get_current_user_info (); + + /* Initialize our interface to the tilde expander. */ + tilde_initialize (); + + /* Initialize internal and environment variables. Don't import shell + functions from the environment if we are running in privileged or + restricted mode or if the shell is running setuid. */ +#if defined (RESTRICTED_SHELL) + initialize_shell_variables (shell_environment, privileged_mode||restricted||running_setuid); +#else + initialize_shell_variables (shell_environment, privileged_mode||running_setuid); +#endif + + /* Initialize the data structures for storing and running jobs. */ + initialize_job_control (jobs_m_flag); + + /* Initialize input streams to null. */ + initialize_bash_input (); + + initialize_flags (); + + /* Initialize the shell options. Don't import the shell options + from the environment variables $SHELLOPTS or $BASHOPTS if we are + running in privileged or restricted mode or if the shell is running + setuid. */ +#if defined (RESTRICTED_SHELL) + initialize_shell_options (privileged_mode||restricted||running_setuid); + initialize_bashopts (privileged_mode||restricted||running_setuid); +#else + initialize_shell_options (privileged_mode||running_setuid); + initialize_bashopts (privileged_mode||running_setuid); +#endif +} + +/* Function called by main () when it appears that the shell has already + had some initialization performed. This is supposed to reset the world + back to a pristine state, as if we had been exec'ed. */ +static void +shell_reinitialize () +{ + /* The default shell prompts. */ + primary_prompt = PPROMPT; + secondary_prompt = SPROMPT; + + /* Things that get 1. */ + current_command_number = 1; + + /* We have decided that the ~/.bashrc file should not be executed + for the invocation of each shell script. If the variable $ENV + (or $BASH_ENV) is set, its value is used as the name of a file + to source. */ + no_rc = no_profile = 1; + + /* Things that get 0. */ + login_shell = make_login_shell = interactive = executing = 0; + debugging = do_version = line_number = last_command_exit_value = 0; + forced_interactive = interactive_shell = subshell_environment = 0; + expand_aliases = 0; + + /* XXX - should we set jobs_m_flag to 0 here? */ + +#if defined (HISTORY) + bash_history_reinit (0); +#endif /* HISTORY */ + +#if defined (RESTRICTED_SHELL) + restricted = 0; +#endif /* RESTRICTED_SHELL */ + + /* Ensure that the default startup file is used. (Except that we don't + execute this file for reinitialized shells). */ + bashrc_file = "~/.bashrc"; + + /* Delete all variables and functions. They will be reinitialized when + the environment is parsed. */ + delete_all_contexts (shell_variables); + delete_all_variables (shell_functions); + + reinit_special_variables (); + +#if defined (READLINE) + bashline_reinitialize (); +#endif + + shell_reinitialized = 1; +} + +static void +show_shell_usage (fp, extra) + FILE *fp; + int extra; +{ + int i; + char *set_opts, *s, *t; + + if (extra) + fprintf (fp, _("GNU bash, version %s-(%s)\n"), shell_version_string (), MACHTYPE); + fprintf (fp, _("Usage:\t%s [GNU long option] [option] ...\n\t%s [GNU long option] [option] script-file ...\n"), + shell_name, shell_name); + fputs (_("GNU long options:\n"), fp); + for (i = 0; long_args[i].name; i++) + fprintf (fp, "\t--%s\n", long_args[i].name); + + fputs (_("Shell options:\n"), fp); + fputs (_("\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n"), fp); + + for (i = 0, set_opts = 0; shell_builtins[i].name; i++) + if (STREQ (shell_builtins[i].name, "set")) + set_opts = savestring (shell_builtins[i].short_doc); + if (set_opts) + { + s = strchr (set_opts, '['); + if (s == 0) + s = set_opts; + while (*++s == '-') + ; + t = strchr (s, ']'); + if (t) + *t = '\0'; + fprintf (fp, _("\t-%s or -o option\n"), s); + free (set_opts); + } + + if (extra) + { + fprintf (fp, _("Type `%s -c \"help set\"' for more information about shell options.\n"), shell_name); + fprintf (fp, _("Type `%s -c help' for more information about shell builtin commands.\n"), shell_name); + fprintf (fp, _("Use the `bashbug' command to report bugs.\n")); + } +} + +static void +add_shopt_to_alist (opt, on_or_off) + char *opt; + int on_or_off; +{ + if (shopt_ind >= shopt_len) + { + shopt_len += 8; + shopt_alist = (STRING_INT_ALIST *)xrealloc (shopt_alist, shopt_len * sizeof (shopt_alist[0])); + } + shopt_alist[shopt_ind].word = opt; + shopt_alist[shopt_ind].token = on_or_off; + shopt_ind++; +} + +static void +run_shopt_alist () +{ + register int i; + + for (i = 0; i < shopt_ind; i++) + if (shopt_setopt (shopt_alist[i].word, (shopt_alist[i].token == '-')) != EXECUTION_SUCCESS) + exit (EX_BADUSAGE); + free (shopt_alist); + shopt_alist = 0; + shopt_ind = shopt_len = 0; +} diff --git a/.pc/rbash-manpage.diff/doc/rbash.1 b/.pc/rbash-manpage.diff/doc/rbash.1 new file mode 100644 index 0000000..56e38fd --- /dev/null +++ b/.pc/rbash-manpage.diff/doc/rbash.1 @@ -0,0 +1,8 @@ +.TH RBASH 1 "2004 Apr 20" "GNU Bash-4.0" +.SH NAME +rbash \- restricted bash, see \fBbash\fR(1) +.SH RESTRICTED SHELL +.nr zY 1 +.so bash.1 +.SH SEE ALSO +bash(1) diff --git a/.pc/use-system-texi2html.diff/doc/Makefile.in b/.pc/use-system-texi2html.diff/doc/Makefile.in new file mode 100644 index 0000000..3c67db6 --- /dev/null +++ b/.pc/use-system-texi2html.diff/doc/Makefile.in @@ -0,0 +1,316 @@ +# This Makefile is for the Bash/documentation directory -*- text -*-. +# +# Copyright (C) 2003-2013 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +PACKAGE = @PACKAGE_NAME@ +VERSION = @PACKAGE_VERSION@ + +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_VERSION = @PACKAGE_VERSION@ + +PACKAGE_TARNAME = @PACKAGE_TARNAME@ + +# +SHELL = @MAKE_SHELL@ +RM = rm -f + +topdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = .:@srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +datarootdir = @datarootdir@ + +infodir = @infodir@ + +docdir = @docdir@ + +# set this to a directory name to have the HTML files installed +htmldir = @htmldir@ + +# Support an alternate destination root directory for package building +DESTDIR = + +mandir = @mandir@ +manpfx = man + +man1ext = .1 +man1dir = $(mandir)/$(manpfx)1 +man3ext = .3 +man3dir = $(mandir)/$(manpfx)3 + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +BUILD_DIR = @BUILD_DIR@ + +SUPPORT_SRCDIR = $(topdir)/support + +# bad style +RL_LIBDIR = $(topdir)/lib/readline + +# unused +TEXINDEX = texindex +TEX = tex + +MAKEINFO = makeinfo +TEXI2DVI = ${SUPPORT_SRCDIR}/texi2dvi +TEXI2HTML = ${SUPPORT_SRCDIR}/texi2html +MAN2HTML = ${BUILD_DIR}/support/man2html +HTMLPOST = ${srcdir}/htmlpost.sh +INFOPOST = ${srcdir}/infopost.sh +QUIETPS = #set this to -q to shut up dvips +PAPERSIZE = letter # change to a4 for A4-size paper +PSDPI = 600 # could be 300 if you like +DVIPS = dvips -D ${PSDPI} $(QUIETPS) -t ${PAPERSIZE} -o $@ # tricky + +TEXINPUTDIR = $(RL_LIBDIR)/doc +SET_TEXINPUTS = TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS + +# These tools might not be available; they're not required +DVIPDF = dvipdfm -o $@ -p ${PAPERSIZE} +PSPDF = gs -sPAPERSIZE=${PAPERSIZE} -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -sOutputFile=$@ + +MKDIRS = ${SUPPORT_SRCDIR}/mkdirs + +# This should be a program that converts troff to an ascii-readable format +NROFF = groff -Tascii + +# This should be a program that converts troff to postscript +GROFF = groff + +HSUSER = $(RL_LIBDIR)/doc/hsuser.texi +RLUSER = $(RL_LIBDIR)/doc/rluser.texi + +BASHREF_FILES = $(srcdir)/bashref.texi $(srcdir)/fdl.texi $(srcdir)/version.texi + +.SUFFIXES: .0 .1 .3 .ms .ps .txt .dvi .html .pdf + +.1.ps: + $(RM) $@ + -${GROFF} -man $< > $@ + +.1.0: + $(RM) $@ + -${NROFF} -man $< > $@ + +.1.html: + $(RM) $@ + -${MAN2HTML} $< | ${HTMLPOST} > $@ + +.ms.ps: + $(RM) $@ + -${GROFF} -ms $< > $@ + +.ms.txt: + $(RM) $@ + -${NROFF} -ms $< > $@ + +.3.ps: + $(RM) $@ + -${GROFF} -man $< > $@ + +.3.0: + $(RM) $@ + -${NROFF} -man $< > $@ + +.3.html: + $(RM) $@ + -${MAN2HTML} $< > $@ + +.ps.pdf: + $(RM) $@ + -${PSPDF} $< + +.dvi.pdf: + $(RM) $@ + -${DVIPDF} $< + +.dvi.ps: + ${RM} $@ + -${DVIPS} $< + +all: ps info dvi text html +nodvi: ps info text html +everything: all pdf + +PSFILES = bash.ps bashbug.ps article.ps builtins.ps rbash.ps +DVIFILES = bashref.dvi bashref.ps +INFOFILES = bashref.info +MAN0FILES = bash.0 bashbug.0 builtins.0 rbash.0 +HTMLFILES = bashref.html bash.html +PDFFILES = bash.pdf bashref.pdf article.pdf rose94.pdf + +ps: ${PSFILES} +dvi: ${DVIFILES} +info: ${INFOFILES} +text: ${MAN0FILES} +html: ${HTMLFILES} +pdf: ${PDFFILES} + +bashref.dvi: $(BASHREF_FILES) $(HSUSER) $(RLUSER) + ${SET_TEXINPUTS} $(TEXI2DVI) $(srcdir)/bashref.texi || { ${RM} $@ ; exit 1; } + +bashref.info: $(BASHREF_FILES) $(HSUSER) $(RLUSER) + $(MAKEINFO) --no-split -I$(TEXINPUTDIR) $(srcdir)/bashref.texi + +# can also use: +# $(MAKEINFO) --html --no-split -I$(TEXINPUTDIR) $(srcdir)/bashref.texi +bashref.html: $(BASHREF_FILES) $(HSUSER) $(RLUSER) + $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/bashref.texi + +bash.info: bashref.info + ${SHELL} ${INFOPOST} < $(srcdir)/bashref.info > $@ ; \ + +bash.txt: bash.1 +bash.ps: bash.1 +bash.html: bash.1 $(MAN2HTML) +bashbug.ps: bashbug.1 +builtins.ps: builtins.1 bash.1 +rbash.ps: rbash.1 bash.1 +bash.0: bash.1 +bashbug.0: bashbug.1 +builtins.0: builtins.1 bash.1 +rbash.0: rbash.1 bash.1 +article.ps: article.ms + +bashref.ps: bashref.dvi + +article.pdf: article.ps +bashref.pdf: bashref.dvi +bash.pdf: bash.ps +rose94.pdf: rose94.ps + +OTHER_DOCS = $(srcdir)/FAQ $(srcdir)/INTRO +OTHER_INSTALLED_DOCS = FAQ INTRO + +$(MAN2HTML): ${topdir}/support/man2html.c + -( cd ${BUILD_DIR}/support ; ${MAKE} ${MFLAGS} man2html) + +clean: + $(RM) *.aux *.bak *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps \ + *.pgs *.bt *.bts *.rw *.rws *.fns *.kys *.tps *.vrs *.o + ${RM} core *.core + +mostlyclean: clean + $(RM) Makefile + +distclean: clean maybe-clean + $(RM) Makefile + +maintainer-clean: clean + ${RM} ${PSFILES} ${DVIFILES} ${INFOFILES} ${MAN0FILES} ${HTMLFILES} + ${RM} ${CREATED_FAQ} + $(RM) Makefile + +maybe-clean: + -if test "X$(topdir)" != "X$(BUILD_DIR)"; then \ + $(RM) ${PSFILES} ${DVIFILES} ${INFOFILES} ${MAN0FILES} ${HTMLFILES}; \ + fi + +installdirs: + -$(SHELL) $(SUPPORT_SRCDIR)/mkinstalldirs $(DESTDIR)$(man1dir) + -$(SHELL) $(SUPPORT_SRCDIR)/mkinstalldirs $(DESTDIR)$(infodir) + -$(SHELL) $(SUPPORT_SRCDIR)/mkinstalldirs $(DESTDIR)$(docdir) + -if test -n "$(htmldir)" ; then \ + $(SHELL) $(SUPPORT_SRCDIR)/mkinstalldirs $(DESTDIR)$(htmldir) ; \ + fi + +install: info installdirs bash.info + -$(INSTALL_DATA) $(srcdir)/bash.1 $(DESTDIR)$(man1dir)/bash${man1ext} + -$(INSTALL_DATA) $(srcdir)/bashbug.1 $(DESTDIR)$(man1dir)/bashbug${man1ext} + -$(INSTALL_DATA) $(OTHER_DOCS) $(DESTDIR)$(docdir) +# uncomment the next lines to install the builtins man page +# sed 's:bash\.1:man1/&:' $(srcdir)/builtins.1 > $${TMPDIR:-/var/tmp}/builtins.1 +# -$(INSTALL_DATA) $${TMPDIR:-/var/tmp}/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext} +# -$(RM) $${TMPDIR:-/var/tmp}/builtins.1 + -if test -f bash.info; then d=.; else d=$(srcdir); fi; \ + $(INSTALL_DATA) $$d/bash.info $(DESTDIR)$(infodir)/bash.info +# run install-info if it is present to update the info directory + if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ + install-info --dir-file=$(DESTDIR)$(infodir)/dir $(DESTDIR)$(infodir)/bash.info; \ + else true; fi +# if htmldir is set, install the html files into that directory + -if test -n "${htmldir}" ; then \ + $(INSTALL_DATA) $(srcdir)/bash.html $(DESTDIR)$(htmldir) ; \ + $(INSTALL_DATA) $(srcdir)/bashref.html $(DESTDIR)$(htmldir) ; \ + fi + +install_builtins: installdirs + sed 's:bash\.1:man1/&:' $(srcdir)/builtins.1 > $${TMPDIR:-/var/tmp}/builtins.1 + -$(INSTALL_DATA) $${TMPDIR:-/var/tmp}/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext} + -$(RM) $${TMPDIR:-/var/tmp}/builtins.1 + +install_everything: install install_builtins + +uninstall: + -$(RM) $(DESTDIR)$(man1dir)/bash${man1ext} $(DESTDIR)$(man1dir)/bashbug${man1ext} + -$(RM) $(DESTDIR)$(man1dir)/bash_builtins${man1ext} + $(RM) $(DESTDIR)$(infodir)/bash.info + -( cd $(DESTDIR)$(docdir) && $(RM) $(OTHER_INSTALLED_DOCS) ) + -if test -n "$(htmldir)" ; then \ + $(RM) $(DESTDIR)$(htmldir)/bash.html ; \ + $(RM) $(DESTDIR)$(htmldir)/bashref.html ; \ + fi + +# for use by chet +CREATED_FAQ = faq.news faq.news2 faq.mail faq.version + +faq: ${CREATED_FAQ} + +faq.version: FAQ.version FAQ + sh mkfaqvers FAQ.version > $@ + +faq.headers.mail: FAQ.headers.mail FAQ + sh mkfaqvers FAQ.headers.mail > $@ + +faq.headers.news: FAQ.headers.news FAQ + sh mkfaqvers FAQ.headers.news > $@ + +faq.headers.news2: FAQ.headers.news2 FAQ + sh mkfaqvers FAQ.headers.news2 > $@ + +faq.news: FAQ faq.headers.news faq.version + $(RM) $@ + cat faq.headers.news faq.version FAQ > $@ + +faq.news2: FAQ faq.headers.news2 faq.version + $(RM) $@ + cat faq.headers.news2 faq.version FAQ > $@ + +faq.mail: FAQ faq.headers.mail faq.version + $(RM) $@ + cat faq.headers.mail faq.version FAQ > $@ + +inst: bashref.texi + $(SHELL) ./mkinstall + cmp -s INSTALL ../INSTALL || mv INSTALL ../INSTALL + $(RM) INSTALL + +posix: bashref.texi + $(SHELL) ./mkposix + cmp -s POSIX ../POSIX || mv POSIX ../POSIX + $(RM) POSIX + +rbash: bashref.texi + $(SH) ./mkrbash + cmp -s RBASH ../RBASH || mv RBASH ../RBASH + $(RM) RBASH + +xdist: pdf inst posix rbash diff --git a/ABOUT-NLS b/ABOUT-NLS new file mode 100644 index 0000000..47d5e39 --- /dev/null +++ b/ABOUT-NLS @@ -0,0 +1,625 @@ +Notes on the Free Translation Project +************************************* + + Free software is going international! The Free Translation Project +is a way to get maintainers of free software, translators, and users all +together, so that will gradually become able to speak many languages. +A few packages already provide translations for their messages. + + If you found this `ABOUT-NLS' file inside a distribution, you may +assume that the distributed package does use GNU `gettext' internally, +itself available at your nearest GNU archive site. But you do _not_ +need to install GNU `gettext' prior to configuring, installing or using +this package with messages translated. + + Installers will find here some useful hints. These notes also +explain how users should proceed for getting the programs to use the +available translations. They tell how people wanting to contribute and +work at translations should contact the appropriate team. + + When reporting bugs in the `intl/' directory or bugs which may be +related to internationalization, you should tell about the version of +`gettext' which is used. The information can be found in the +`intl/VERSION' file, in internationalized packages. + +Quick configuration advice +========================== + + If you want to exploit the full power of internationalization, you +should configure it using + + ./configure --with-included-gettext + +to force usage of internationalizing routines provided within this +package, despite the existence of internationalizing capabilities in the +operating system where this package is being installed. So far, only +the `gettext' implementation in the GNU C library version 2 provides as +many features (such as locale alias, message inheritance, automatic +charset conversion or plural form handling) as the implementation here. +It is also not possible to offer this additional functionality on top +of a `catgets' implementation. Future versions of GNU `gettext' will +very likely convey even more functionality. So it might be a good idea +to change to GNU `gettext' as soon as possible. + + So you need _not_ provide this option if you are using GNU libc 2 or +you have installed a recent copy of the GNU gettext package with the +included `libintl'. + +INSTALL Matters +=============== + + Some packages are "localizable" when properly installed; the +programs they contain can be made to speak your own native language. +Most such packages use GNU `gettext'. Other packages have their own +ways to internationalization, predating GNU `gettext'. + + By default, this package will be installed to allow translation of +messages. It will automatically detect whether the system already +provides the GNU `gettext' functions. If not, the GNU `gettext' own +library will be used. This library is wholly contained within this +package, usually in the `intl/' subdirectory, so prior installation of +the GNU `gettext' package is _not_ required. Installers may use +special options at configuration time for changing the default +behaviour. The commands: + + ./configure --with-included-gettext + ./configure --disable-nls + +will respectively bypass any pre-existing `gettext' to use the +internationalizing routines provided within this package, or else, +_totally_ disable translation of messages. + + When you already have GNU `gettext' installed on your system and run +configure without an option for your new package, `configure' will +probably detect the previously built and installed `libintl.a' file and +will decide to use this. This might be not what is desirable. You +should use the more recent version of the GNU `gettext' library. I.e. +if the file `intl/VERSION' shows that the library which comes with this +package is more recent, you should use + + ./configure --with-included-gettext + +to prevent auto-detection. + + The configuration process will not test for the `catgets' function +and therefore it will not be used. The reason is that even an +emulation of `gettext' on top of `catgets' could not provide all the +extensions of the GNU `gettext' library. + + Internationalized packages have usually many `po/LL.po' files, where +LL gives an ISO 639 two-letter code identifying the language. Unless +translations have been forbidden at `configure' time by using the +`--disable-nls' switch, all available translations are installed +together with the package. However, the environment variable `LINGUAS' +may be set, prior to configuration, to limit the installed set. +`LINGUAS' should then contain a space separated list of two-letter +codes, stating which languages are allowed. + +Using This Package +================== + + As a user, if your language has been installed for this package, you +only have to set the `LANG' environment variable to the appropriate +`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code, +and `CC' is an ISO 3166 two-letter country code. For example, let's +suppose that you speak German and live in Germany. At the shell +prompt, merely execute `setenv LANG de_DE' (in `csh'), +`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). +This can be done from your `.login' or `.profile' file, once and for +all. + + You might think that the country code specification is redundant. +But in fact, some languages have dialects in different countries. For +example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The +country code serves to distinguish the dialects. + + The locale naming convention of `LL_CC', with `LL' denoting the +language and `CC' denoting the country, is the one use on systems based +on GNU libc. On other systems, some variations of this scheme are +used, such as `LL' or `LL_CC.ENCODING'. You can get the list of +locales supported by your system for your country by running the command +`locale -a | grep '^LL''. + + Not all programs have translations for all languages. By default, an +English message is shown in place of a nonexistent translation. If you +understand other languages, you can set up a priority list of languages. +This is done through a different environment variable, called +`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' +for the purpose of message handling, but you still need to have `LANG' +set to the primary language; this is required by other parts of the +system libraries. For example, some Swedish users who would rather +read translations in German than English for when Swedish is not +available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. + + In the `LANGUAGE' environment variable, but not in the `LANG' +environment variable, `LL_CC' combinations can be abbreviated as `LL' +to denote the language's main dialect. For example, `de' is equivalent +to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' +(Portuguese as spoken in Portugal) in this context. + +Translating Teams +================= + + For the Free Translation Project to be a success, we need interested +people who like their own language and write it well, and who are also +able to synergize with other translators speaking the same language. +Each translation team has its own mailing list. The up-to-date list of +teams can be found at the Free Translation Project's homepage, +`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams" +area. + + If you'd like to volunteer to _work_ at translating messages, you +should become a member of the translating team for your own language. +The subscribing address is _not_ the same as the list itself, it has +`-request' appended. For example, speakers of Swedish can send a +message to `sv-request@li.org', having this message body: + + subscribe + + Keep in mind that team members are expected to participate +_actively_ in translations, or at solving translational difficulties, +rather than merely lurking around. If your team does not exist yet and +you want to start one, or if you are unsure about what to do or how to +get started, please write to `translation@iro.umontreal.ca' to reach the +coordinator for all translator teams. + + The English team is special. It works at improving and uniformizing +the terminology in use. Proven linguistic skill are praised more than +programming skill, here. + +Available Packages +================== + + Languages are not equally supported in all packages. The following +matrix shows the current state of internationalization, as of May 2003. +The matrix shows, in regard of each package, for which languages PO +files have been submitted to translation coordination, with a +translation percentage of at least 50%. + + Ready PO files am az be bg ca cs da de el en en_GB eo es + +-------------------------------------------+ + a2ps | [] [] [] [] | + aegis | () | + anubis | | + ap-utils | | + bash | [] [] [] | + batchelor | | + bfd | [] [] | + binutils | [] [] | + bison | [] [] [] | + bluez-pin | [] [] | + clisp | | + clisp | [] [] [] | + coreutils | [] [] [] [] | + cpio | [] [] [] | + darkstat | () [] | + diffutils | [] [] [] [] [] [] [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] | + error | [] [] [] [] [] | + fetchmail | [] () [] [] [] [] | + fileutils | [] [] [] | + findutils | [] [] [] [] [] [] | + flex | [] [] [] [] | + gas | [] | + gawk | [] [] [] [] | + gcal | [] | + gcc | [] [] | + gettext | [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] | + gettext-tools | [] [] | + gimp-print | [] [] [] [] [] | + gliv | | + glunarclock | [] [] [] | + gnucash | () [] | + gnucash-glossary | [] () [] | + gnupg | [] () [] [] [] [] | + gpe-calendar | [] | + gpe-conf | [] | + gpe-contacts | [] | + gpe-edit | | + gpe-login | [] | + gpe-ownerinfo | [] | + gpe-sketchbook | [] | + gpe-timesheet | | + gpe-today | [] | + gpe-todo | [] | + gphoto2 | [] [] [] [] | + gprof | [] [] | + gpsdrive | () () () | + grep | [] [] [] [] [] | + gretl | [] | + hello | [] [] [] [] [] [] | + id-utils | [] [] | + indent | [] [] [] [] | + jpilot | [] [] [] [] | + jwhois | [] | + kbd | [] [] [] [] [] | + ld | [] [] | + libc | [] [] [] [] [] [] | + libgpewidget | [] | + libiconv | [] [] [] [] [] | + lifelines | [] () | + lilypond | [] | + lingoteach | | + lingoteach_lessons | () () | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailutils | [] [] | + make | [] [] [] | + man-db | [] () [] [] () | + mysecretdiary | [] [] [] | + nano | [] () [] [] [] | + nano_1_0 | [] () [] [] [] | + opcodes | [] [] | + parted | [] [] [] [] [] | + ptx | [] [] [] [] [] | + python | | + radius | | + recode | [] [] [] [] [] [] | + screem | | + sed | [] [] [] [] [] | + sh-utils | [] [] [] | + sharutils | [] [] [] [] [] [] | + sketch | [] () [] | + soundtracker | [] [] [] | + sp | [] | + tar | [] [] [] [] | + texinfo | [] [] [] [] | + textutils | [] [] [] [] | + tin | () () | + util-linux | [] [] [] [] [] | + vorbis-tools | [] [] [] | + wastesedge | () | + wdiff | [] [] [] [] | + wget | [] [] [] [] [] [] [] | + xchat | [] [] [] | + xpad | | + +-------------------------------------------+ + am az be bg ca cs da de el en en_GB eo es + 0 1 4 2 31 17 54 60 14 1 4 12 56 + + et fa fi fr ga gl he hr hu id it ja ko + +----------------------------------------+ + a2ps | [] [] [] () () | + aegis | | + anubis | [] | + ap-utils | [] | + bash | [] [] | + batchelor | [] | + bfd | [] [] | + binutils | [] [] | + bison | [] [] [] [] | + bluez-pin | [] [] [] [] | + clisp | | + clisp | [] | + coreutils | [] [] [] [] | + cpio | [] [] [] [] | + darkstat | () [] [] [] | + diffutils | [] [] [] [] [] [] [] | + e2fsprogs | | + enscript | [] [] | + error | [] [] [] [] | + fetchmail | [] | + fileutils | [] [] [] [] [] | + findutils | [] [] [] [] [] [] [] [] [] [] [] | + flex | [] [] | + gas | [] | + gawk | [] [] | + gcal | [] | + gcc | [] | + gettext | [] [] [] | + gettext-runtime | [] [] [] [] | + gettext-tools | [] | + gimp-print | [] [] | + gliv | () | + glunarclock | [] [] [] [] | + gnucash | [] | + gnucash-glossary | [] | + gnupg | [] [] [] [] [] [] [] | + gpe-calendar | [] | + gpe-conf | | + gpe-contacts | [] | + gpe-edit | [] [] | + gpe-login | [] | + gpe-ownerinfo | [] [] [] | + gpe-sketchbook | [] | + gpe-timesheet | [] [] [] | + gpe-today | [] [] | + gpe-todo | [] [] | + gphoto2 | [] [] [] | + gprof | [] [] | + gpsdrive | () [] () () | + grep | [] [] [] [] [] [] [] [] [] [] [] | + gretl | [] | + hello | [] [] [] [] [] [] [] [] [] [] [] [] [] | + id-utils | [] [] [] | + indent | [] [] [] [] [] [] [] [] | + jpilot | [] () | + jwhois | [] [] [] [] | + kbd | [] | + ld | [] | + libc | [] [] [] [] [] [] | + libgpewidget | [] [] [] | + libiconv | [] [] [] [] [] [] [] [] | + lifelines | () | + lilypond | [] | + lingoteach | [] [] | + lingoteach_lessons | | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailutils | | + make | [] [] [] [] [] [] | + man-db | [] () () | + mysecretdiary | [] [] | + nano | [] [] [] [] | + nano_1_0 | [] [] [] [] | + opcodes | [] [] | + parted | [] [] [] | + ptx | [] [] [] [] [] [] [] | + python | | + radius | | + recode | [] [] [] [] [] [] | + screem | | + sed | [] [] [] [] [] [] [] [] | + sh-utils | [] [] [] [] [] [] | + sharutils | [] [] [] [] [] | + sketch | [] | + soundtracker | [] [] [] | + sp | [] () | + tar | [] [] [] [] [] [] [] [] [] | + texinfo | [] [] [] [] | + textutils | [] [] [] [] [] | + tin | [] () | + util-linux | [] [] [] [] () [] | + vorbis-tools | [] | + wastesedge | () | + wdiff | [] [] [] [] [] | + wget | [] [] [] [] [] [] [] [] | + xchat | [] [] [] | + xpad | | + +----------------------------------------+ + et fa fi fr ga gl he hr hu id it ja ko + 20 1 15 73 14 24 8 10 30 31 19 31 9 + + lg lt lv ms nb nl nn no pl pt pt_BR ro + +----------------------------------------+ + a2ps | [] [] () () () [] [] | + aegis | () | + anubis | [] [] | + ap-utils | () | + bash | [] | + batchelor | | + bfd | | + binutils | | + bison | [] [] [] [] | + bluez-pin | [] | + clisp | | + clisp | [] | + coreutils | [] | + cpio | [] [] [] | + darkstat | [] [] [] [] | + diffutils | [] [] [] | + e2fsprogs | | + enscript | [] [] | + error | [] [] | + fetchmail | () () | + fileutils | [] | + findutils | [] [] [] [] | + flex | [] | + gas | | + gawk | [] | + gcal | | + gcc | | + gettext | [] | + gettext-runtime | [] | + gettext-tools | | + gimp-print | [] | + gliv | [] | + glunarclock | [] | + gnucash | | + gnucash-glossary | [] [] | + gnupg | | + gpe-calendar | [] [] | + gpe-conf | [] [] | + gpe-contacts | [] | + gpe-edit | [] [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] | + gpe-sketchbook | [] [] | + gpe-timesheet | [] [] | + gpe-today | [] [] | + gpe-todo | [] [] | + gphoto2 | | + gprof | [] | + gpsdrive | () () () | + grep | [] [] [] [] | + gretl | | + hello | [] [] [] [] [] [] [] [] [] | + id-utils | [] [] [] | + indent | [] [] [] | + jpilot | () () | + jwhois | [] [] [] | + kbd | | + ld | | + libc | [] [] [] [] | + libgpewidget | [] [] | + libiconv | [] [] | + lifelines | | + lilypond | [] | + lingoteach | | + lingoteach_lessons | | + lynx | [] [] | + m4 | [] [] [] [] | + mailutils | | + make | [] [] | + man-db | [] | + mysecretdiary | [] | + nano | [] [] [] [] | + nano_1_0 | [] [] [] [] | + opcodes | [] [] [] | + parted | [] [] [] | + ptx | [] [] [] [] [] [] [] | + python | | + radius | | + recode | [] [] [] | + screem | | + sed | [] [] | + sh-utils | [] | + sharutils | [] | + sketch | [] | + soundtracker | | + sp | | + tar | [] [] [] [] [] [] | + texinfo | [] | + textutils | [] | + tin | | + util-linux | [] [] | + vorbis-tools | [] [] | + wastesedge | | + wdiff | [] [] [] [] | + wget | [] [] [] | + xchat | [] [] | + xpad | [] | + +----------------------------------------+ + lg lt lv ms nb nl nn no pl pt pt_BR ro + 0 0 2 11 7 26 3 4 18 15 34 34 + + ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW + +-------------------------------------------+ + a2ps | [] [] [] [] [] | 16 + aegis | () | 0 + anubis | [] [] | 5 + ap-utils | () | 1 + bash | [] | 7 + batchelor | | 1 + bfd | [] [] [] | 7 + binutils | [] [] [] | 7 + bison | [] [] | 13 + bluez-pin | | 7 + clisp | | 0 + clisp | | 5 + coreutils | [] [] [] [] [] | 14 + cpio | [] [] [] | 13 + darkstat | [] () () | 9 + diffutils | [] [] [] [] | 21 + e2fsprogs | [] | 3 + enscript | [] [] [] | 11 + error | [] [] [] | 14 + fetchmail | [] | 7 + fileutils | [] [] [] [] [] [] | 15 + findutils | [] [] [] [] [] [] | 27 + flex | [] [] [] | 10 + gas | [] | 3 + gawk | [] [] | 9 + gcal | [] [] | 4 + gcc | [] | 4 + gettext | [] [] [] [] [] [] | 15 + gettext-runtime | [] [] [] [] [] [] | 16 + gettext-tools | [] [] | 5 + gimp-print | [] [] | 10 + gliv | | 1 + glunarclock | [] [] [] | 11 + gnucash | [] [] | 4 + gnucash-glossary | [] [] [] | 8 + gnupg | [] [] [] [] | 16 + gpe-calendar | [] | 5 + gpe-conf | | 3 + gpe-contacts | [] | 4 + gpe-edit | [] | 5 + gpe-login | [] | 5 + gpe-ownerinfo | [] | 7 + gpe-sketchbook | [] | 5 + gpe-timesheet | [] | 6 + gpe-today | [] | 6 + gpe-todo | [] | 6 + gphoto2 | [] [] | 9 + gprof | [] [] | 7 + gpsdrive | [] [] | 3 + grep | [] [] [] [] | 24 + gretl | | 2 + hello | [] [] [] [] [] | 33 + id-utils | [] [] [] | 11 + indent | [] [] [] [] | 19 + jpilot | [] [] [] [] [] | 10 + jwhois | () () [] [] | 10 + kbd | [] [] | 8 + ld | [] [] | 5 + libc | [] [] [] [] | 20 + libgpewidget | | 6 + libiconv | [] [] [] [] [] [] | 21 + lifelines | [] | 2 + lilypond | [] | 4 + lingoteach | | 2 + lingoteach_lessons | () | 0 + lynx | [] [] [] [] | 14 + m4 | [] [] [] | 15 + mailutils | | 2 + make | [] [] [] [] | 15 + man-db | [] | 6 + mysecretdiary | [] [] | 8 + nano | [] [] [] | 15 + nano_1_0 | [] [] [] | 15 + opcodes | [] [] | 9 + parted | [] [] | 13 + ptx | [] [] [] | 22 + python | | 0 + radius | | 0 + recode | [] [] [] [] | 19 + screem | [] | 1 + sed | [] [] [] [] [] | 20 + sh-utils | [] [] [] | 13 + sharutils | [] [] [] [] | 16 + sketch | [] | 5 + soundtracker | [] | 7 + sp | [] | 3 + tar | [] [] [] [] [] | 24 + texinfo | [] [] [] [] | 13 + textutils | [] [] [] [] [] | 15 + tin | | 1 + util-linux | [] [] | 14 + vorbis-tools | [] | 7 + wastesedge | | 0 + wdiff | [] [] [] [] | 17 + wget | [] [] [] [] [] [] [] | 25 + xchat | [] [] [] | 11 + xpad | | 1 + +-------------------------------------------+ + 50 teams ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW + 97 domains 32 19 16 0 56 0 48 10 1 1 12 23 913 + + Some counters in the preceding matrix are higher than the number of +visible blocks let us expect. This is because a few extra PO files are +used for implementing regional variants of languages, or language +dialects. + + For a PO file in the matrix above to be effective, the package to +which it applies should also have been internationalized and +distributed as such by its maintainer. There might be an observable +lag between the mere existence a PO file and its wide availability in a +distribution. + + If May 2003 seems to be old, you may fetch a more recent copy of +this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date +matrix with full percentage details can be found at +`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'. + +Using `gettext' in new packages +=============================== + + If you are writing a freely available program and want to +internationalize it you are welcome to use GNU `gettext' in your +package. Of course you have to respect the GNU Library General Public +License which covers the use of the GNU `gettext' library. This means +in particular that even non-free programs can use `libintl' as a shared +library, whereas only free software can use `libintl' as a static +library or use modified versions of `libintl'. + + Once the sources are changed appropriately and the setup can handle +the use of `gettext' the only thing missing are the translations. The +Free Translation Project is also available for packages which are not +developed inside the GNU project. Therefore the information given above +applies also for every other Free Software Project. Contact +`translation@iro.umontreal.ca' to make the `.pot' files available to +the translation teams. + diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..9ad0ba2 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,466 @@ +# +# Master author manifest for bash +# +# The files in lib/intl were taken from the GNU gettext distribution. +# +# Any files appearing in the bash distribution not listed in this file +# were created by Chet Ramey. +# +# Filename authors (first is original author) +# +README Brian Fox, Chet Ramey +INSTALL Brian Fox, Chet Ramey +COPYING Brian Fox, Chet Ramey +MANIFEST Brian Fox, Chet Ramey +configure Chet Ramey +Makefile.in Brian Fox, Chet Ramey +configure.in Chet Ramey +aclocal.m4 Chet Ramey +config.h.top Chet Ramey +config.h.bot Chet Ramey +config.h.in Chet Ramey +array.c Chet Ramey +print_cmd.c Brian Fox, Chet Ramey +general.c Brian Fox, Chet Ramey +variables.c Brian Fox, Chet Ramey +make_cmd.c Brian Fox, Chet Ramey +copy_cmd.c Brian Fox, Chet Ramey +unwind_prot.c Brian Fox, Chet Ramey +dispose_cmd.c Brian Fox, Chet Ramey +getcwd.c Roland McGrath, Brian Fox, Chet Ramey +bashhist.c Chet Ramey +hash.c Brian Fox, Chet Ramey +parse.y Brian Fox, Chet Ramey +subst.c Brian Fox, Chet Ramey +shell.c Brian Fox, Chet Ramey +sig.c Chet Ramey +trap.c Brian Fox, Chet Ramey +siglist.c Brian Fox, Chet Ramey +version.c Brian Fox, Chet Ramey +flags.c Brian Fox, Chet Ramey +jobs.c Brian Fox, Chet Ramey +input.c Chet Ramey +mailcheck.c Brian Fox, Chet Ramey +pathexp.c Chet Ramey +test.c Brian Fox, Chet Ramey +expr.c Chet Ramey, Brian Fox +alias.c Brian Fox, Chet Ramey +execute_cmd.c Brian Fox, Chet Ramey +bashline.c Brian Fox, Chet Ramey +braces.c Brian Fox, Chet Ramey +bracecomp.c Brian Fox, Chet Ramey, Tom Tromey +nojobs.c Brian Fox, Chet Ramey +vprint.c Chet Ramey +oslib.c Chet Ramey +error.c Brian Fox, Chet Ramey +xmalloc.c Brian Fox, Chet Ramey +alias.h Brian Fox, Chet Ramey +array.h Chet Ramey +builtins.h Brian Fox, Chet Ramey +parser.h Brian Fox, Chet Ramey +variables.h Brian Fox, Chet Ramey +machines.h Brian Fox, Chet Ramey +jobs.h Brian Fox, Chet Ramey +maxpath.h Brian Fox, Chet Ramey +pathexp.h Chet Ramey +mailcheck.h Chet Ramey +filecntl.h Brian Fox, Chet Ramey +hash.h Brian Fox, Chet Ramey +quit.h Brian Fox, Chet Ramey +flags.h Brian Fox, Chet Ramey +shell.h Brian Fox, Chet Ramey +bashjmp.h Chet Ramey +sig.h Chet Ramey +trap.h Brian Fox, Chet Ramey +general.h Brian Fox, Chet Ramey +unwind_prot.h Brian Fox, Chet Ramey +input.h Brian Fox, Chet Ramey +error.h Brian Fox, Chet Ramey +command.h Brian Fox, Chet Ramey +externs.h Chet Ramey +siglist.h Chet Ramey +subst.h Brian Fox, Chet Ramey +dispose_cmd.h Brian Fox, Chet Ramey +bashansi.h Brian Fox, Chet Ramey +make_cmd.h Brian Fox, Chet Ramey +bashhist.h Chet Ramey +bashline.h Chet Ramey +execute_cmd.h Chet Ramey +bashtypes.h Chet Ramey +bashtty.h Chet Ramey +pathnames.h Chet Ramey +y.tab.c Brian Fox, Chet Ramey +y.tab.h Brian Fox, Chet Ramey +parser-built Brian Fox, Chet Ramey +posixstat.h Brian Fox, Chet Ramey +stdc.h Chet Ramey +ansi_stdlib.h Brian Fox, Chet Ramey +memalloc.h Chet Ramey +builtins/ChangeLog Brian Fox, Chet Ramey +builtins/Makefile.in Brian Fox, Chet Ramey +builtins/alias.def Brian Fox, Chet Ramey +builtins/bind.def Brian Fox, Chet Ramey +builtins/break.def Brian Fox, Chet Ramey +builtins/builtin.def Brian Fox, Chet Ramey +builtins/caller.def Rocky Bernstein, Chet Ramey +builtins/cd.def Brian Fox, Chet Ramey +builtins/colon.def Brian Fox, Chet Ramey +builtins/command.def Brian Fox, Chet Ramey +builtins/common.c Brian Fox, Chet Ramey +builtins/declare.def Brian Fox, Chet Ramey +builtins/echo.def Brian Fox, Chet Ramey +builtins/enable.def Brian Fox, Chet Ramey +builtins/eval.def Brian Fox, Chet Ramey +builtins/exec.def Brian Fox, Chet Ramey +builtins/exit.def Brian Fox, Chet Ramey +builtins/fc.def Brian Fox, Chet Ramey +builtins/fg_bg.def Brian Fox, Chet Ramey +builtins/getopt.c Roland McGrath, Brian Fox, Chet Ramey +builtins/getopt.h Roland McGrath, Brian Fox, Chet Ramey +builtins/getopts.def Brian Fox, Chet Ramey +builtins/hash.def Brian Fox, Chet Ramey +builtins/hashcom.h Brian Fox, Chet Ramey +builtins/help.def Brian Fox, Chet Ramey +builtins/let.def Chet Ramey, Brian Fox +builtins/history.def Brian Fox, Chet Ramey +builtins/jobs.def Brian Fox, Chet Ramey +builtins/kill.def Brian Fox, Chet Ramey +builtins/mapfile.def Rocky Bernstein +builtins/mkbuiltins.c Brian Fox, Chet Ramey +builtins/pushd.def Brian Fox, Chet Ramey +builtins/read.def Brian Fox, Chet Ramey +builtins/reserved.def Brian Fox, Chet Ramey +builtins/return.def Brian Fox, Chet Ramey +builtins/set.def Brian Fox, Chet Ramey +builtins/setattr.def Brian Fox, Chet Ramey +builtins/shift.def Brian Fox, Chet Ramey +builtins/shopt.def Chet Ramey +builtins/source.def Brian Fox, Chet Ramey +builtins/suspend.def Brian Fox, Chet Ramey +builtins/test.def Brian Fox, Chet Ramey +builtins/times.def Brian Fox, Chet Ramey +builtins/trap.def Brian Fox, Chet Ramey +builtins/type.def Brian Fox, Chet Ramey +builtins/ulimit.def Chet Ramey, Brian Fox +builtins/umask.def Brian Fox, Chet Ramey +builtins/wait.def Brian Fox, Chet Ramey +builtins/psize.c Chet Ramey, Brian Fox +builtins/psize.sh Chet Ramey, Brian Fox +builtins/inlib.def Chet Ramey +builtins/bashgetopt.c Chet Ramey +builtins/common.h Chet Ramey +builtins/bashgetopt.h Chet Ramey +lib/doc-support/texindex.c bug-texinfo@prep.ai.mit.edu, Chet Ramey +lib/doc-support/Makefile.in Chet Ramey +lib/doc-support/getopt.h Roland McGrath +lib/doc-support/getopt.c Roland McGrath +lib/doc-support/getopt1.c Roland McGrath +lib/glob/ChangeLog Brian Fox, Chet Ramey +lib/glob/Makefile.in Brian Fox, Chet Ramey +lib/glob/strmatch.c Roland McGrath, Brian Fox, Chet Ramey +lib/glob/strmatch.h Roland McGrath, Brian Fox, Chet Ramey +lib/glob/glob.c Richard Stallman, Roland McGrath, Brian Fox, Chet Ramey +lib/glob/glob.h Chet Ramey +lib/glob/ndir.h Doug Gwyn, Richard Stallman +lib/glob/doc/Makefile.in Brian Fox, Chet Ramey +lib/glob/doc/glob.texi Brian Fox, Chet Ramey +lib/malloc/Makefile.in Chet Ramey +lib/malloc/alloca.c Doug Gwyn, Richard Stallman, Brian Fox, Chet Ramey +lib/malloc/getpagesize.h Brian Fox, Chet Ramey +lib/malloc/malloc.c Chris Kingsley, Mike Muuss, Richard Stallman, Brian Fox, Chet Ramey +lib/malloc/gmalloc.c Mike Haertel, Roland McGrath +lib/malloc/stub.c Chet Ramey +lib/malloc/i386-alloca.s Richard Stallman +lib/malloc/x386-alloca.s Chip Salzenberg, Richard Stallman +lib/malloc/xmalloc.c Brian Fox, Chet Ramey +lib/posixheaders/posixstat.h Brian Fox, Chet Ramey +lib/posixheaders/ansi_stdlib.h Brian Fox, Chet Ramey +lib/posixheaders/stdc.h Chet Ramey +lib/posixheaders/memalloc.h Chet Ramey +lib/posixheaders/filecntl.h Brian Fox, Chet Ramey +lib/readline/Makefile.in Brian Fox, Chet Ramey +lib/readline/COPYING Brian Fox, Chet Ramey +lib/readline/ChangeLog Brian Fox, Chet Ramey +lib/readline/readline.c Brian Fox, Chet Ramey +lib/readline/vi_mode.c Brian Fox, Chet Ramey +lib/readline/emacs_keymap.c Brian Fox, Chet Ramey +lib/readline/vi_keymap.c Brian Fox, Chet Ramey +lib/readline/funmap.c Brian Fox, Chet Ramey +lib/readline/keymaps.c Brian Fox, Chet Ramey +lib/readline/xmalloc.c Brian Fox, Chet Ramey +lib/readline/search.c Brian Fox, Chet Ramey +lib/readline/isearch.c Brian Fox, Chet Ramey +lib/readline/parens.c Brian Fox, Chet Ramey +lib/readline/rltty.c Brian Fox, Chet Ramey +lib/readline/complete.c Brian Fox, Chet Ramey +lib/readline/bind.c Brian Fox, Chet Ramey +lib/readline/display.c Brian Fox, Chet Ramey +lib/readline/signals.c Brian Fox, Chet Ramey +lib/readline/kill.c Brian Fox, Chet Ramey +lib/readline/undo.c Brian Fox, Chet Ramey +lib/readline/input.c Brian Fox, Chet Ramey +lib/readline/macro.c Brian Fox, Chet Ramey +lib/readline/util.c Brian Fox, Chet Ramey +lib/readline/callback.c Chet Ramey +lib/readline/readline.h Brian Fox, Chet Ramey +lib/readline/chardefs.h Brian Fox, Chet Ramey +lib/readline/keymaps.h Brian Fox, Chet Ramey +lib/readline/rldefs.h Brian Fox, Chet Ramey +lib/readline/posixstat.h Brian Fox, Chet Ramey +lib/readline/ansi_stdlib.h Brian Fox, Chet Ramey +lib/readline/memalloc.h Chet Ramey +lib/readline/rlconf.h Chet Ramey +lib/readline/rltty.h Chet Ramey +lib/readline/history.c Brian Fox, Chet Ramey +lib/readline/histexpand.c Brian Fox, Chet Ramey +lib/readline/histfile.c Brian Fox, Chet Ramey +lib/readline/histsearch.c Brian Fox, Chet Ramey +lib/readline/history.h Brian Fox, Chet Ramey +lib/readline/histlib.h Brian Fox, Chet Ramey +lib/readline/tilde.c Brian Fox, Chet Ramey +lib/readline/tilde.h Brian Fox, Chet Ramey +lib/readline/doc/texindex.c bug-texinfo@prep.ai.mit.edu, Chet Ramey +lib/readline/doc/Makefile Brian Fox, Chet Ramey +lib/readline/doc/rlman.texinfo Brian Fox, Chet Ramey +lib/readline/doc/rltech.texinfo Brian Fox, Chet Ramey +lib/readline/doc/rluser.texinfo Brian Fox, Chet Ramey +lib/readline/doc/hist.texinfo Brian Fox, Chet Ramey +lib/readline/doc/hstech.texinfo Brian Fox, Chet Ramey +lib/readline/doc/hsuser.texinfo Brian Fox, Chet Ramey +lib/readline/examples/Makefile Brian Fox +lib/readline/examples/fileman.c Brian Fox +lib/readline/examples/manexamp.c Brian Fox +lib/readline/examples/histexamp.c Brian Fox, Chet Ramey +lib/readline/examples/rltest.c Brian Fox, Chet Ramey +lib/readline/examples/Inputrc Brian Fox, Chet Ramey +lib/termcap/Makefile.in David MacKenzie, Chet Ramey +lib/termcap/termcap.c David MacKenzie +lib/termcap/termcap.h David MacKenzie +lib/termcap/tparam.c David MacKenzie +lib/termcap/version.c David MacKenzie +lib/termcap/grot/termcap.info David MacKenzie +lib/termcap/grot/termcap.info-1 David MacKenzie +lib/termcap/grot/termcap.info-2 David MacKenzie +lib/termcap/grot/termcap.info-3 David MacKenzie +lib/termcap/grot/termcap.info-4 David MacKenzie +lib/termcap/grot/NEWS David MacKenzie +lib/termcap/grot/INSTALL David MacKenzie +lib/termcap/grot/ChangeLog David MacKenzie +lib/termcap/grot/texinfo.tex David MacKenzie +lib/termcap/grot/termcap.texi David MacKenzie +lib/termcap/grot/Makefile.in David MacKenzie +lib/termcap/grot/configure David MacKenzie +lib/termcap/grot/configure.in David MacKenzie +lib/termcap/grot/COPYING David MacKenzie +lib/termcap/grot/README David MacKenzie +lib/tilde/ChangeLog Brian Fox, Chet Ramey +lib/tilde/Makefile.in Brian Fox, Chet Ramey +lib/tilde/doc/tilde.texi Brian Fox, Chet Ramey +lib/tilde/doc/Makefile Brian Fox, Chet Ramey +lib/tilde/tilde.c Brian Fox, Chet Ramey +lib/tilde/tilde.h Brian Fox, Chet Ramey +lib/tilde/memalloc.h Brian Fox, Chet Ramey +CWRU/misc/open-files.c Chet Ramey +CWRU/misc/sigs.c Chet Ramey +CWRU/misc/pid.c Chet Ramey +CWRU/misc/sigstat.c Chet Ramey +CWRU/misc/bison Chet Ramey +CWRU/misc/aux-machine-desc Chet Ramey +CWRU/PLATFORMS Chet Ramey +CWRU/README Chet Ramey +CWRU/CWRU.CHANGES.051093 Chet Ramey +CWRU/POSIX.NOTES Chet Ramey +CWRU/CWRU.CHANGES.071193 Chet Ramey +CWRU/CWRU.CHANGES.090393 Chet Ramey +doc/Makefile.in Brian Fox, Chet Ramey +doc/bash.1 Chet Ramey +doc/builtins.1 Chet Ramey +doc/bash.ps Chet Ramey +doc/bash.txt Chet Ramey +doc/readline.3 Chet Ramey +doc/readline.ps Chet Ramey +doc/readline.txt Chet Ramey +doc/texinfo.tex Richard Stallman +doc/features.texi Brian Fox, Chet Ramey +doc/features.ps Brian Fox, Chet Ramey +doc/features.info Brian Fox, Chet Ramey +doc/features.dvi Brian Fox, Chet Ramey +doc/bash_builtins.1 Chet Ramey +doc/bash_builtins.ps Chet Ramey +doc/bash_builtins.txt Chet Ramey +doc/bash_builtins.readme Chet Ramey +doc/article.ms Chet Ramey +doc/FAQ Chet Ramey +support/cat-s Brian Fox, Chet Ramey +support/mksysdefs Brian Fox, Chet Ramey +support/mkversion.c Brian Fox, Chet Ramey +support/mksignames.c Brian Fox, Chet Ramey +support/getcppsyms.c Brian Fox, Chet Ramey +support/cppmagic Brian Fox, Chet Ramey +support/pagesize.sh Chet Ramey, Brian Fox +support/pagesize.c Chet Ramey, Brian Fox +support/bash.xbm Brian Fox +support/FAQ Brian Fox +support/PORTING Brian Fox +support/mklinks Brian Fox +support/fixlinks Chet Ramey +support/mkdirs Chet Ramey +support/clone-bash Chet Ramey +support/bashbug.sh Chet Ramey +support/mkmachtype Chet Ramey +support/recho.c Chet Ramey +support/config.guess Per Bothner, Chet Ramey +support/config.sub Richard Stallman, Chet Ramey +support/install.sh MIT X Consortium (X11R5) +support/endian.c Chet Ramey +support/printenv Chet Ramey +examples/precedence-tester Brian Fox, Chet Ramey +examples/functions/substr Brian Fox, Chet Ramey +examples/functions/kshenv Chet Ramey +examples/functions/autoload Chet Ramey +examples/functions/csh-compat Brian Fox, Chet Ramey +examples/functions/shcat Chet Ramey +examples/functions/substr2 Chet Ramey +examples/functions/term Chet Ramey +examples/functions/whatis Chet Ramey +examples/functions/whence Chet Ramey +examples/functions/func Chet Ramey +examples/functions/dirname Brian Fox, Noah Friedman +examples/functions/basename Brian Fox, Noah Friedman +examples/functions/exitstat Noah Friedman, Roland McGrath +examples/functions/external Noah Friedman +examples/functions/fact Brian Fox +examples/functions/manpage Tom Tromey +examples/functions/fstty Chet Ramey +examples/functions/jj.bash Chet Ramey +examples/functions/notify.bash Chet Ramey +examples/loadables/getconf.c J.T. Conklin +examples/scripts/shprompt Chet Ramey +examples/scripts/adventure.sh Chet Ramey, Doug Gwyn +examples/scripts/bcsh.sh Chris Robertson, Chet Ramey +examples/startup-files/Bashrc Brian Fox +examples/startup-files/Bash_aliases Brian Fox +examples/startup-files/Bash_profile Brian Fox +examples/startup-files/bash-profile Brian Fox +examples/startup-files/bashrc Chet Ramey +examples/suncmd.termcap Brian Fox, Chet Ramey +examples/alias-conv.sh Brian Fox, Chet Ramey +tests/README Chet Ramey +tests/arith.tests Chet Ramey +tests/arith.right Chet Ramey +tests/array.tests Chet Ramey +tests/array.right Chet Ramey +tests/dollar-at.sh Chet Ramey +tests/dollar-star.sh Chet Ramey +tests/dollar.right Chet Ramey +tests/exp-tests Chet Ramey +tests/exp.right Chet Ramey +tests/glob-test Chet Ramey +tests/glob.right Chet Ramey +tests/ifs-test-1.sh Chet Ramey +tests/ifs-test-2.sh Chet Ramey +tests/ifs-test-3.sh Chet Ramey +tests/ifs.1.right Chet Ramey +tests/ifs.2.right Chet Ramey +tests/ifs.3.right Chet Ramey +tests/input-line.sh Chet Ramey +tests/input-line.sub Chet Ramey +tests/input.right Chet Ramey +tests/minus-e Chet Ramey +tests/minus-e.right Chet Ramey +tests/new-exp.tests Chet Ramey +tests/new-exp.right Chet Ramey +tests/prec.right Chet Ramey +tests/precedence Chet Ramey +tests/run-all Chet Ramey +tests/run-dollars Chet Ramey +tests/run-exp-tests Chet Ramey +tests/run-glob-test Chet Ramey +tests/run-ifs-tests Chet Ramey +tests/run-input-test Chet Ramey +tests/run-minus-e Chet Ramey +tests/run-new-exp Chet Ramey +tests/run-precedence Chet Ramey +tests/run-set-e-test Chet Ramey +tests/run-strip Chet Ramey +tests/run-varenv Chet Ramey +tests/set-e-test Chet Ramey +tests/set-e.right Chet Ramey +tests/strip.tests Chet Ramey +tests/strip.right Chet Ramey +tests/tilde-tests Chet Ramey +tests/tilde.right Chet Ramey +tests/unicode1.sub Chet Ramey, John Kearney +tests/varenv.right Chet Ramey +tests/varenv.sh Chet Ramey +tests/misc/chld-trap.sh Chet Ramey +tests/misc/dot-test-1.sh Chet Ramey +tests/misc/dot-test-1.sub Chet Ramey +tests/misc/gotest Chet Ramey +tests/misc/perf-script Chet Ramey +tests/misc/redir.t1.sh Chet Ramey +tests/misc/redir.t2.sh Chet Ramey +tests/misc/redir.t3.sh Chet Ramey +tests/misc/redir.t3.sub Chet Ramey +tests/misc/redir.t4.sh Chet Ramey +tests/misc/run.r1.sh Chet Ramey +tests/misc/run.r2.sh Chet Ramey +tests/misc/run.r3.sh Chet Ramey +tests/misc/sigint.t1.sh Chet Ramey +tests/misc/sigint.t2.sh Chet Ramey +tests/misc/sigint.t3.sh Chet Ramey +tests/misc/sigint.t4.sh Chet Ramey +tests/misc/test-minus-e.1 Chet Ramey +tests/misc/test-minus-e.2 Chet Ramey +lib/sh/Makefile.in Chet Ramey +lib/sh/clktck.c Chet Ramey +lib/sh/clock.c Chet Ramey +lib/sh/fmtullong.c Chet Ramey +lib/sh/fmtulong.c Chet Ramey +lib/sh/getcwd.c Chet Ramey, Roland McGrath +lib/sh/getenv.c Chet Ramey, Brian Fox +lib/sh/inet_aton.c Chet Ramey, Ulrich Drepper, Paul Vixie +lib/sh/itos.c Chet Ramey +lib/sh/mailstat.c Chet Ramey +lib/sh/makepath.c Chet Ramey +lib/sh/mktime.c Chet Ramey, Paul Eggert +lib/sh/netconn.c Chet Ramey +lib/sh/netopen.c Chet Ramey +lib/sh/oslib.c Chet Ramey, Brian Fox +lib/sh/pathcanon.c Chet Ramey +lib/sh/pathphys.c Chet Ramey +lib/sh/rename.c Chet Ramey +lib/sh/setlinebuf.c Chet Ramey, Brian Fox +lib/sh/shquote.c Chet Ramey +lib/sh/shtty.c Chet Ramey +lib/sh/snprintf.c Chet Ramey, Unknown +lib/sh/spell.c Chet Ramey +lib/sh/strcasecmp.c Chet Ramey, Brian Fox +lib/sh/strerror.c Chet Ramey, Brian Fox +lib/sh/strftime.c Arnold Robbins +lib/sh/strindex.c Chet Ramey +lib/sh/stringlist.c Chet Ramey +lib/sh/stringvec.c Chet Ramey +lib/sh/strpbrk.c Roland McGrath +lib/sh/strtod.c Chet Ramey, Roland McGrath +lib/sh/strtoimax.c Chet Ramey, Paul Eggert +lib/sh/strtol.c Chet Ramey, Paul Eggert +lib/sh/strtoll.c Chet Ramey, Paul Eggert +lib/sh/strtoul.c Chet Ramey, Paul Eggert +lib/sh/strtoull.c Chet Ramey, Paul Eggert +lib/sh/strtoumax.c Chet Ramey, Paul Eggert +lib/sh/strtrans.c Chet Ramey +lib/sh/times.c Chet Ramey, Brian Fox +lib/sh/timeval.c Chet Ramey +lib/sh/tmpfile.c Chet Ramey +lib/sh/vprint.c Chet Ramey, Brian Fox +lib/sh/xstrchr.c Chet Ramey, Mitsuru Chinen +lib/sh/zread.c Chet Ramey +lib/sh/zwrite.c Chet Ramey + +tests/posix-ifs.sh Glenn Fowler + +support/checkbashisms Julian Gilbey, Debian Linux team + +lib/readline/colors.c Richard Stallman, David MacKenzie +lib/readline/parse-colors.c Richard Stallman, David MacKenzie diff --git a/CHANGES b/CHANGES new file mode 100644 index 0000000..5985e42 --- /dev/null +++ b/CHANGES @@ -0,0 +1,7829 @@ +This document details the changes between this version, bash-4.3-release, and +the previous version, bash-4.3-rc2. + +1. Changes to Bash + +a. Only Posix-mode shells should exit on an assignment failure in the + temporary environment preceding a special builtin. This is how it's been + documented. + +b. Fixed a bug that caused a failed special builtin to not exit a posix-mode + shell if the failing builtin was on the LHS of a && or ||. + +c. Changed the handling of unquoted backslashes in regular expressions to be + closer to bash-4.2. + +d. globstar (**) no longer traverses symbolic links that resolve to + directories. This eliminates some duplicate entries. + +e. Fixed a bug that caused a SIGCHLD trap handler to not be able to change the + SIGCHLD disposition. + +f. Fixed a bug that caused a crash when -x was enabled and a command + contained a printable multibyte (wide) character. + +g. Fixed a bug that caused an interactive shell without line editing enabled + to read invalid data after receiving a SIGINT. + +h. Fixed a bug that caused command word completion to fail if the directory in + $PATH where the completion would be found contained single or double quotes. + +i. Fixed a bug that caused a shell with -v enabled to print commands in $() + multiple times. + +2. Changes to Readline + +a. Fixed a bug that caused `undo' to reference freed memory or null pointers. + +3. New Features in Bash + +a. The [[ -v ]] option now understands array references (foo[1]) and returns + success if the referenced element has a value. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-4.3-rc2, and the +previous version, bash-4.3-rc1. + +1. Changes to Bash + +a. Fixed a bug that left variables set by printf -v marked as invisible. + +b. Fixed an off-by-one error in a job control warning message. + +c. Fixed a bug that caused the shell to crash after declaring a nameref variable + without a value. + +d. Fixed a bug that caused asynchronous commands to not set $? correctly. + +e. Fixed a bug that caused out-of-order execution when executing aliases with + embedded newlines containing `.' commands. + +f. Fixed a bug that caused error messages generated by expansion errors in + `for' commands to have the wrong line number. + +g. Fixed a bug that caused the `wait' builtin to not be interruptible in an + interactive shell with job control enabled. + +h. Fixed a bug that caused SIGINT and SIGQUIT to not be trappable in + asynchronous subshell commands. + +i. Bash now requires that the value assigned to a nameref variable be a valid + shell identifier (variable name or array reference). + +j. Converting an existing variable to a nameref variable now turns off the + -i/-l/-u/-c attributes. + +k. Displaying a nameref variable with `declare -p' now displays the nameref + variable and its value rather than following the nameref chain. + +l. Fixed a problem with interrupt handling that caused a second and subsequent + SIGINT to be ignored by interactive shells. + +m. Fixed a bug that caused certain positional parameter and array expansions + to mishandle (discard) null positional parameters and array elements. + +n. The shell no longer blocks receipt of signals while running trap handlers + for those signals, and allows most trap handlers to be run recursively + (running trap handlers while a trap handler is executing). + +o. The shell now handles backslashes in regular expression arguments to the + [[ command's =~ operator slightly differently, resulting in more + consistent behavior. + +2. Changes to Readline + +a. Fixed a bug that could cause readline to crash and seg fault attempting to + expand an empty history entry. + +b. Fixed a bug that caused a bad entry in the $LS_COLORS variable to abort all + color processing but leave color enabled. + +c. Fixed a bug that caused display problems with multi-line prompts containing + invisible characters on multiple lines. + +d. Fixed a bug that caused effects made by undoing changes to a history line to + be discarded. + +3. New Features in Bash + +4. New Features in Readline + +a. When creating shared libraries on Mac OS X, the pathname written into the + library (install_name) no longer includes the minor version number. +------------------------------------------------------------------------------ +This document details the changes between this version, bash-4.3-rc1, and the +previous version, bash-4.3-beta2. + +1. Changes to Bash + +a. Fixed a bug in bash completion that caused a tilde to be expanded even if + the `direxpand' option was not enabled. + +b. Fixed a potential bug that could cause corrupted input in interactive shells + running without line editing and with `ignoreeof' enabled. + +c. Fixed a bug that could cause failures when opening pipes back to shells + created to run process substitutions. + +d. Fixed a bug that caused an assignment to TEXTDOMAIN to require TEXTDOMAINDIR + to be set in order to actually change the current text domain. + +e. Changed the way redirections are printed to avoid confusion when the target + of an output redirection is a process substitution beginning with `>'. + +2. Changes to Readline + +a. Shared library building is now supported on Mac OS X 10.9 (Darwin 13). + +3. New Features in Bash + +a. `cd' has a new `-@' option to browse a file's extended attributes on + systems that support O_XATTR. + +4. New Features in Readline + +a. There are additional default key bindings for MinGW32 + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-4.3-beta2, and the +previous version, bash-4.3-beta. + +1. Changes to Bash + +a. Fixed a bug that caused assignment to an unset variable using a negative + subscript to result in a segmentation fault. + +b. Fixed a bug that caused assignment to a string variable using a negative + subscript to use the incorrect index. + +c. Fixed a bug that caused some strings to be interpreted as invalid + extended globbing expressions when used with the help builtin. + +d. Fixed a bug that caused an attempt to trap a signal whose disposition + cannot be changed to reference uninitialized memory. + +e. Command completion now skips assignment statements preceding a command + name and completes the command. + +f. Fixed a bug that caused `compgen -f' in a non-interactive shell to dump + core under certain circumstances. + +g. Fixed a bug that caused the `read -N' to misbehave when the input stream + contains 0xff. + +2. Changes to Readline + +a. Changed message when an incremental search fails to include "failed" in + the prompt and display the entire search string instead of just the last + matching portion. + +b. Fixed a bug that caused an arrow key typed to an incremental search prompt + to process the key sequence incorrectly. + +c. Additional key bindings for arrow keys on MinGW. + +3. New Features in Bash + +a. The help builtin now attempts substring matching (as it did through + bash-4.2) if exact string matching fails. + +b. The fc builtin now interprets -0 as the current command line. + +c. Completing directory names containing shell variables now adds a trailing + slash if the expanded result is a directory. + +4. New Features in Readline + +a. rl_change_environment: new application-settable variable that controls + whether or not Readline modifies the environment (currently readline + modifies only LINES and COLUMNS). + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-4.3-beta, and the +previous version, bash-4.3-alpha. + +1. Changes to Bash + +a. Fixed a bug in the prompt directory name "trimming" code that caused + memory corruption and garbled the results. + +b. Fixed a bug that caused single quotes that resulted from $'...' quoting + in the replacement portion of a double-quoted ${word/pat/rep} expansion + to be treated as quote characters. + +c. Fixed a bug that caused assignment statements preceding a command word to + result in assignment statements following a declaration command to not be + expanded like assignment statements. + +d. Fixed a bug with variable search order in the presence of local variables + with the same name as variables in the temporary environment supplied to + a shell function. + +e. Fixed a bug that caused constructs like 1<(2) to be interpreted as process + substitutions even in an arithmetic context. + +f. Fixed several cases where `invisible' variables (variables with attributes + but no values, which are technically unset) were treated incorrectly. + +g. Fixed a bug that caused group commands in pipelines that were not the + last element to not run the EXIT trap. + +h. Fixed a bug that caused `unset -n' to not unset a nameref variable in + certain cases. + +i. Fixed the nameref circular reference checking to be less strict and only + disallow a nameref variable with the same value as its name at the global + scope. + +j. Fixed a bug that caused trap handlers to be executed recursively, + corrupting internal data structures. + +k. Fixed a bug that could result in bash not compiling if certain options were + not enabled. + +l. Fixed a bug that caused the arithmetic expansion code to attempt variable + assignments when operator precedence prohibited them. + +m. Word expansions like ${foo##bar} now understand indirect variable references. + +n. Fixed a bug that caused `declare -fp name' to not display a function + definition. + +o. Fixed a bug that caused asynchronous child processes to modify the stdin + file pointer when bash was using it to read a script, which modified the + parent's value as well. + +2. Changes to Readline + +a. Fixed a bug in vi mode that caused the arrow keys to set the saved last + vi-mode command to the wrong value. + +b. Fixed a bug that caused double-quoted strings to be scanned incorrectly + when being used as the value of a readline variable assignment. + +c. Fixed a bug with vi mode that prevented `.' from repeating a command + entered on a previous line (command). + +d. Fixed a bug that could cause completion to core dump if it was interrupted + by a signal. + +e. Readline now sends the meta-key enable string to the terminal if the + terminal has been successfully initialized. + +f. Readline now calls the signal hook after resizing the terminal when it + receives a SIGWINCH. + +g. Fixed a bug that could cause the history list code to perform an out-of- + bounds array reference if the history list is empty. + +3. New Features in Bash + +a. Shells started to run process substitutions now run any trap set on EXIT. + +b. There is now a configure-time option to enable the globasciiranges option + by default. + +c. The read builtin now checks its first variable argument for validity before + trying to read any input. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-4.3-alpha, +and the previous version, bash-4.2-release. + +1. Changes to Bash + +a. Fixed several bugs concerning incomplete bracket expressions in filename + generation (globbing) patterns. + +b. Fixed a bug with single quotes and WORD in ${param op WORD} when running + in Posix mode. + +c. Fixed a bug that caused the pattern removal and pattern substitution word + expansions and case statement word expansion to not match the empty string. + +d. Fixed a bug that caused the tzset() function to not work after changing + the TZ enviroment variable. + +e. Fixed a bug that caused the RHS of an assignment statement to undergo + word splitting when it contained an unquoted $@. + +f. Fixed bugs that caused the shell to not react to a SIGINT sent while + waiting for a child process to exit. + +g. Bash doesn't try to run things in a signal handler context when it gets a + signal (SIGINT/SIGHUP/etc) while reading input using readline but still + be responsive to terminating signals. + +h. Fixed a bug that caused bash to go into an infinite loop if a filename + to be matched contained an invalid multibyte character. + +i. Fixed a bug that caused PS4 to end up being truncated if it is longer + than 128 bytes. + +j. Fixed a bug that caused brace expansion to not skip over double-quoted + command substitution. + +k. System-specific updates for: DJGPP, HP/UX, Mac OS X + +l. Fixed a bug in displaying commands that caused redirections to be associated + with the wrong part of the command. + +m. Fixed the coproc cleanup to unset the appropriate shell variables when a + coproc terminates. + +n. Fixed a bug that caused `fc' to dump core due to incorrect calculation of + the last history entry. + +o. Added workarounds for FreeBSD's implementation of faccessat/eaccess and + `test -x'. + +p. Fixed a bug that caused the shell to not match patterns containing + control-A. + +q. Fixed a bug that could result in doubled error messages when the `printf' + builtin got a write error. + +r. Fixed a bug that caused the shell to not correctly expand words containing + multiple consecutive quoted empty strings (""""""aa). + +s. Fixed a bug that caused the shell to not correctly parse multi-line + process substitutions containing comments and quoted strings. + +t. Fixed a problem with the bash malloc's internal idea of the top of the + memory heap that resulted in incorrect decisions to try to reduce the + break and give memory back to the kernel. + +u. There are changes to the expansions peformed on compound array assignments, + in an effort to make foo=( [ind1]=bar [ind2]=baz ) identical to + foo[ind1]=bar foo[ind2]=baz. + +v. Bash now reports an error if `read -a name' is used when `name' is an + existing associative array. + +w. Fixed a bug that allowed an attempted assignment to a readonly variable + in an arithmetic expression to not return failure. + +x. Fixed several bugs that caused completion functions to be invoked even when + the cursor was before the first word in the command. + +y. Fixed a bug that caused parsing a command substitution to overwrite the + parsing state associated with the complete input line. + +z. Fixed several bugs with the built-in snprintf replacement and field widths + and floating point. + +aa. Fixed a bug that caused incorrect offset calculations and input buffer + corruption when reading files longer than 2^31 bytes. + +bb. Fixed several bugs where bash performed arithmetic evaluation in contexts + where evaluation is suppressed. + +cc. Fixed a bug that caused bash to close FIFOs used for process substitution + too early when a shell function was executing, but protect against using + all file descriptors when the shell functions are invoked inside loops. + +dd. Added checks for printable (and non-printable) multibyte characters for + use in error messages. + +ee. Fixed a bug that caused ^O (operate-and-get-next) to not work correctly + at the end of the history list. + +ff. Fixed a bug that caused command-oriented history to incorrectly combine + here documents into one line. + +gg. Fixed a bug that caused importing SHELLOPTS from the environment into a + Posix-mode shell to print an error message and refuse to parse it. + +hh. Fixed a bug that caused the shell to delete an extra history entry when + using `history -s'. + +ii. Fixed a bug that caused floating-point exceptions and overflow errors + for the / and % arithmetic operators when using INTMAX_MIN and -1. + +jj. Fixed a bug that caused parsing errors when reading an arithmetic for + loop inside a command substitution. + +kk. Fixed a bug that caused a readonly function to be unset when unset was + called without the -f or -v option. + +ll. Fixed several bugs in the code that quotes characters special to regular + expressions when used in a quoted string on the RHS of the =~ operator + to the [[ command. + +mm. Fixed a bug that caused redirections to fail because the file descriptor + limit was set to a value less than 10. + +nn. Fixed a bug that caused the `read' builtin to execute code in a signal + handler context if read timed out. + +oo. Fixed a bug that caused extended globbing patterns to not match files + beginning with `.' correctly when a `.' was explicitly supplied in the + pattern. + +pp. Fixed a bug that caused key sequences longer than two characters to not + work when used with `bind -x'. + +qq. Fixed a bug that resulted in redefined functions having the wrong source + file names in BASH_SOURCE. + +rr. Fixed a bug that caused the read builtin to assign null strings to variables + when using `read -N', which caused core dumps when referenced + +ss. Fixed a bug that caused `bash -m script' to not enable job control while + running the script. + +tt. Fixed a bug that caused `printf -v var' to dump core when used with the + %b format code. + +uu. Fixed a bug that caused the shell to exit with the wrong status if -e was + active and the shell exited on a substitution error. + +vv. Fixed a bug that caused the shell to seg fault if an array variable with + the same name as an existing associative array was implicitly created by + an assignment (declare a[n]=b). + +ww. Fixed a bug that caused a redirection to misbehave if the number specified + for a file descriptor overflows an intmax_t. + +xx. Fixed several bugs with the handling of valid and invalid unicode character + values when used with the \u and \U escape sequences to printf and $'...'. + +yy. Fixed a bug that caused tildes to not be escaped in expanded filenames, + making them subject to later expansion. + +zz. When using the pattern substitution word expansion, bash now runs the + replacement string through quote removal, since it allows quotes in that + string to act as escape characters. This is not backwards compatible, so + it can be disabled by setting the bash compatibility mode to 4.2. + +aaa. Fixed the rest of the cases where the shell runs non-allowed code in a + signal handler context. + +bbb. Fixed a bug that caused spurious DEL characters (\177) to appear in + double-quoted expansion where the RHS is evaluated to the empty string. + +ccc. Fixed a bug that caused the use of the shell's internal random number + generator for temporary file names to perturb the random number + sequence. + +ddd. Fixed several bugs that caused `declare -g' to not set the right global + variables or to misbehave when declaring global indexed arrays. + +eee. Fixed a logic bug that caused extended globbing in a multibyte locale to + cause failures when using the pattern substititution word expansions. + +fff. Fixed a bug that caused the `lastpipe' option to corrupt the file + descriptor used to read the script. + +ggg. Fixed a bug that causes the shell to delete DEL characters in the + expanded value of variables used in the same quoted string as variables + that expand to nothing. + +hhh. Fixed a bug that caused the shell to assign the wrong value from an + assignment like (( x=7 )) when `x' was an existing array variable. + +iii. Fixed a bug that caused the shell to misbehave when generating sequences + and the boundary values overflow an intmax_t. + +jjj. Fixed a bug caused expansion errors if an expansion of "$@" appeared + next to another expansion (e.g.. "${@}${x}"). + +kkk. Fixed a potential buffer overflow bug when performing /dev/fd expansion. + +lll. Fixed a bug that resulted in an extra semicolon being added to compound + assignments when they were added to the history list. + +mmm. Fixed a bug that caused mapfile to read one extra line from the input. + +nnn. Fixed a bug that caused the mail checking code to use uninitialized + values. + +ooo. Fixed a bug that prevented history timestamps from being saved if the + history comment character is unset. + +ppp. Fixed a bug that caused the case-modifying expansions to not work with + multibyte characters. + +qqq. Fixed a bug that caused the edit-and-execute bindable readline command + to see the wrong data if invoked in the middle of a multi-line quoted + string. + +rrr. Fixed a bug that resulted in the shell returning the wrong exit status + for a background command on systems that recycle PIDs very quickly. + +sss. Fixed a bug that caused asynchronous group commands to not run any EXIT + trap defined in the body of the command. + +ttt. Fixed a bug that caused `eval "... ; return"' to not clean up properly. + +uuu. Fixed a bug that caused the shell to dump core if `read' reads an escaped + IFS whitespace character. + +vvv. Fixed a bug that caused BASH_COMMAND to be set to an incorrect value when + executing a (...) subshell. + +www. Fixed a couple of pointer aliasing bugs with the token string in arithmetic + evaluation. + +xxx. Fixed a bug with parsing multi-line command substitutions when reading + the `do' keyword followed by whitespace. + +yyy. Fixed a bug that caused the shell to seg fault if the time given to the + printf %(...)T format overflowed the value accepted by localtime(3). + +zzz. Fixed a problem with displaying help topics in two columns when the + translated text contained multibyte characters. + +aaaa. Fixed a bug with the extended globbing pattern matcher where a `*' was + followed by a negated extended glob pattern. + +bbbb. Fixed a race condition with short-lived coproc creation and reaping that + caused the child process to be reaped before the various coproc shell + variables were initialized. + +cccc. Fixed a bug where turning off `errexit' in command substitution subshells + was not reflected in $SHELLOPTS. + +dddd. Partially fixed an inconsistency in how the shell treated shell + functions run from an EXIT trap. + +eeee. Fixed a bug in how the shell invalidated FIFOs used for process + substitution when executing a pipeline (once rather than in every child). + +ffff. Fixed a bug that occurred when expanding a special variable ($@, $*) + within double quotes and the expansion resulted in an empty string. + +gggg. Fixed bugs with executing a SIGCHLD trap handler to make sure that it's + executed once per exited child. + +hhhh. Fixed a bug that caused `declare' and `test' to find variables that + had been given attributes but not assigned values. Such variables are + not set. + +iiii. Fixed a bug that caused commands in process substitutions to not look in + the local temporary environment when performing word expansions. + +jjjj. Fixed several problems with globstar expansions (**/**) returning null + filenames and multiple instances of the same pathname. + +kkkk. Fixed an oversight that did not allow the exit status of `coproc' to + be inverted using `!'. + +llll. Fixed a bug that caused the -e option to be re-enabled using `set -e' + even when executing in a context where -e is ignored. + +mmmm. Fixed a (mostly theoretical) bug with input lines longer than SIZE_MAX. + +nnnn. Fixed a bug that could result in double evaluation of command + substitutions when they appear in failed redirections. + +oooo. Fixed a bug that could cause seg faults during `mapfile' callbacks if + the callback unsets the array variable mapfile is using. + +pppp. Fixed several problems with variable assignments using ${var:=value} + when the variable assignment is supposed to have side effects. + +qqqq. Fixed a bug that caused a failure of an assignment statement preceding a + builtin caused the next invocation of a special builtin to exit the shell. + +rrrr. Fixed several problems with IFS when it appears in the temporary environment + and is used in redirections. + +ssss. Fixed a problem that caused IFS changes using ${IFS:=value} to modify + how preceding expansions were split. + +tttt. Fixed a problem that caused subshells to not run an EXIT trap they set. + +uuuu. Fixed a problem that caused shells started in posix mode to attempt to + import shell functions with invalid names from the environment. We now + print a warning. + +vvvv. Worked around a kernel problem that caused SIGCHLD to interrupt open(2) + on a FIFO used for process substitution, even if the SIGCHLD handler was + installed with the SA_RESTART flag. + +wwww. Fixed a problem that resulted in inconsistent expansion of $* and ${a[*]}. + +xxxx. Fixed a problem that caused `read -t' to crash when interrupted by + SIGINT. + +yyyy. Fixed a problem that caused pattern removal to fail randomly because the + pattern matcher read beyond the end of a string. + +zzzz. Fixed a bug that caused core dumps when shell functions tried to create + local shadow copies of special variables like GROUPS. + +aaaaa. Fixed a bug that caused SIGTERM to be occasionally lost by children of + interactive shells when it arrived before the child process reset the + handler from SIG_DFL. + +bbbbb. Fixed a bug that caused redirections like <&n- to leave file descriptor + n closed if executed with a builtin command. + +ccccc. Fixed a bug that caused incorrect completion quoting when completing a + word containing a globbing character with `show-all-if-ambiguous' set. + +ddddd. Fixed a bug that caused printf's %q format specifier not to quote a + tilde even if it appeared in a location where it would be subject to + tilde expansion. + +2. Changes to Readline + +a. Fixed a bug that did not allow the `dd', `cc', or `yy' vi editing mode + commands to work on the entire line. + +b. Fixed a bug that caused redisplay problems with prompts longer than 128 + characters and history searches. + +c. Fixed a bug that caused readline to try and run code to modify its idea + of the screen size in a signal handler context upon receiving a SIGWINCH. + +d. Fixed a bug that caused the `meta' key to be enabled beyond the duration + of an individual call top readline(). + +e. Added a workaround for a wcwidth bug in Mac OS X that caused readline's + redisplay to mishandle zero-width combining characters. + +f. Fixed a bug that caused readline to `forget' part of a key sequence when + a multiple-key sequence caused it to break out of an incremental search. + +g. Fixed bugs that caused readline to execute code in a signal handler + context if interrupted while reading from the file system during completion. + +h. Fixed a bug that caused readline to `forget' part of a key sequence when + reading an unbound multi-character key sequence. + +i. Fixed a bug that caused Readline's signal handlers to be installed beyond + the bounds of a single call to readline(). + +j. Fixed a bug that caused the `.' command to not redo the most recent `R' + command in vi mode. + +k. Fixed a bug that caused ignoring case in completion matches to result in + readline using the wrong match. + +l. Paren matching now works in vi insert mode. + +m. Fix menu-completion to make show-all-if-ambiguous and menu-complete-display-prefix + work together. + +n. Fixed a bug that didn't allow the `cc', `dd', or `yy' commands to be redone + in vi editing mode. + +o. Fixed a bug that caused the filename comparison code to not compare + multibyte characters correctly when using case-sensitive or case-mapping + comparisons. + +p. Fixed the input reading loop to call the input hook function only when there + is no terminal input available. + +q. Fixed a bug that caused binding a macro to a multi-character key sequence + where the sequence and macro value share a common prefix to not perform + the macro replacement. + +r. Fixed several redisplay errors with multibyte characters and prompts + containing invisible characters when using horizontal scrolling. + +s. Fixed a bug that caused redisplay errors when trying to overwrite + existing characters using multibyte characters. + +3. New Features in Bash + +a. The `helptopic' completion action now maps to all the help topics, not just + the shell builtins. + +b. The `help' builtin no longer does prefix substring matching, so `help read' + does not match `readonly'. + +c. The shell can be compiled to not display a message about processes that + terminate due to SIGTERM. + +d. Non-interactive shells now react to the setting of checkwinsize and set + LINES and COLUMNS after a foreground job exits. + +e. There is a new shell option, `globasciiranges', which, when set to on, + forces globbing range comparisons to use character ordering as if they + were run in the C locale. + +f. There is a new shell option, `direxpand', which makes filename completion + expand variables in directory names in the way bash-4.1 did. + +g. In Posix mode, the `command' builtin does not change whether or not a + builtin it shadows is treated as an assignment builtin. + +h. The `return' and `exit' builtins accept negative exit status arguments. + +i. The word completion code checks whether or not a filename containing a + shell variable expands to a directory name and appends `/' to the word + as appropriate. The same code expands shell variables in command names + when performing command completion. + +j. In Posix mode, it is now an error to attempt to define a shell function + with the same name as a Posix special builtin. + +k. When compiled for strict Posix conformance, history expansion is disabled + by default. + +l. The history expansion character (!) does not cause history expansion when + followed by the closing quote in a double-quoted string. + +m. `complete' and its siblings compgen/compopt now takes a new `-o noquote' + option to inhibit quoting of the completions. + +n. Setting HISTSIZE to a value less than zero causes the history list to be + unlimited (setting it 0 zero disables the history list). + +o. Setting HISTFILESIZE to a value less than zero causes the history file size + to be unlimited (setting it to 0 causes the history file to be truncated + to zero size). + +p. The `read' builtin now skips NUL bytes in the input. + +q. There is a new `bind -X' option to print all key sequences bound to Unix + commands. + +r. When in Posix mode, `read' is interruptible by a trapped signal. After + running the trap handler, read returns 128+signal and throws away any + partially-read input. + +s. The command completion code skips whitespace and assignment statements + before looking for the command name word to be completed. + +t. The build process has a new mechanism for constructing separate help files + that better reflects the current set of compilation options. + +u. The -nt and -ot options to test now work with files with nanosecond + timestamp resolution. + +v. The shell saves the command history in any shell for which history is + enabled and HISTFILE is set, not just interactive shells. + +w. The shell has `nameref' variables and new -n(/+n) options to declare and + unset to use them, and a `test -R' option to test for them. + +x. The shell now allows assigning, referencing, and unsetting elements of + indexed arrays using negative subscripts (a[-1]=2, echo ${a[-1]}) which + count back from the last element of the array. + +y. The {x} operators to [[ do string comparisons using the current locale + only if the compatibility level is greater than 40 (set to 41 by default). + +4. New Features in Readline + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-4.1-alpha, +and the previous version, bash-4.0-release. + +1. Changes to Bash + +a. Fixed bugs in the parser involving new parsing of the commands contained + in command substitution when the substitution is read. + +b. Fixed a bug that caused the shell to dump core when performing programmable + completion using a shell function. + +c. Fixed a bug in `mapfile' that caused it to invoke callbacks at the wrong + time. + +d. Fixed a bug that caused the shell to dump core when listing jobs in the + `exit' builtin. + +e. Fixed several bugs encountered when reading subscripts in associative + array assignments and expansions. + +f. Fixed a bug that under some circumstances caused an associative array to + be converted to an indexed array. + +g. Fixed a bug that caused syntax errors and SIGINT interrupts to not set + $? to a value > 128. + +h. Fixed a bug that caused the shell to remove FIFOs associated with process + substitution inside shell functions. + +i. Fixed a bug that caused terminal attributes to not be reset when the + `read' builtin timed out. + +j. Fixed a bug in brace expansion that caused unwanted zero padding of the + expanded terms. + +k. Fixed a bug that prevented the |& construct from working as intended when + used with a simple command with additional redirections. + +l. Fixed a bug with the case statment ;& terminator that caused the shell to + dereference a NULL pointer. + +m. Fixed a bug that caused assignment statements or redirections preceding + a simple command name to inhibit alias expansion. + +n. Fixed the behavior of `set -u' to conform to the latest Posix interpretation: + every expansion of an unset variable except $@ and $* will cause the + shell to exit. + +o. Fixed a bug that caused double-quoted expansions of $* inside word + expansions like ${x#$*} to not expand properly when $IFS is empty. + +p. Fixed a bug that caused traps to set $LINENO to the wrong value when they + execute. + +q. Fixed a bug that caused off-by-one errors when computing history lines in + the `fc' builtin. + +r. Fixed a bug that caused some terminating signals to not exit the shell + quickly enough, forcing the kernel to send the signal (e.g., SIGSEGV) + multiple times. + +s. Fixed a bug that caused the shell to attempt to add empty lines to the + history list when reading here documents. + +t. Made some internal changes that dramatically speeds up sequential indexed + array access. + +u. Fixed a bug that caused the shell to write past the end of a string when + completing a double-quoted string ending in a backslash. + +v. Fixed a bug that caused the shell to replace too many characters when a + pattern match was null in a ${foo//bar} expansion. + +w. Fixed bugs in the expansion of ** that caused duplicate directory names + and the contents of the current directory to be omitted. + +x. Fixed a bug that caused $? to not be set correctly when referencing an + unset variable with set -u and set -e enabled. + +y. Fixed a bug caused by executing an external program from the DEBUG trap + while a pipeline was running. The effect was to disturb the pipeline + state, occasionally causing it to hang. + +z. Fixed a bug that caused the ** glob expansion to dump core if it + encountered an unsearchable directory. + +aa. Fixed a bug that caused `command -v' and `command -V' to not honor the + path set by the -p option. + +bb. Fixed a bug that caused brace expansion to take place too soon in some + compound array assignments. + +cc. Fixed a bug that caused programmable completion functions' changes to + READLINE_POINT to not be reflected back to readline. + +dd. Fixed a bug that caused the shell to dump core if a trap was executed + during a shell assignment statement. + +ee. Fixed an off-by-one error when computing the number of positional + parameters for the ${@:0:n} expansion. + +ff. Fixed a problem with setting COMP_CWORD for programmable completion + functions that could leave it set to -1. + +gg. Fixed a bug that caused the ERR trap to be triggered in some cases where + `set -e' would not have caused the shell to exit. + +hh. Fixed a bug that caused changes made by `compopt' to not persist past the + completion function in which compopt was executed. + +ii. Fixed a bug that caused the list of hostname completions to not be cleared + when HOSTNAME was unset. + +jj. Fixed a bug that caused variable expansion in here documents to look in + any temporary environment. + +kk. Bash and readline can now convert file names between precomposed and + decomposed Unicode on Mac OS X ("keyboard" and file system forms, + respectively). This affects filename completion (using new + rl_filename_rewrite_hook), globbing, and readline redisplay. + +ll. The ERR and EXIT traps now see a non-zero value for $? when a parser + error after set -e has been enabled causes the shell to exit. + +mm. Fixed a bug that in brace expansion that caused zero-prefixed terms to + not contain the correct number of digits. + +nn. Fixed a bug that caused the shell to free non-allocated memory when + unsetting an associative array which had had a value implicitly assigned + to index "0". + +oo. Fixed a memory leak in the ${!prefix@} expansion. + +pp. Fixed a bug that caused printf to not correctly report all write errors. + +qq. Fixed a bug that caused single and double quotes to act as delimiters + when splitting a command line into words for programmable completion. + +rr. Fixed a bug that caused ** globbing that caused **/path/* to match every + directory, not just those matching `path'. + +ss. Fixed a bug that caused the shell to dump core when running `help' without + arguments if the terminal width was fewer than 7 characters. + +2. Changes to Readline + +a. The SIGWINCH signal handler now avoids calling the redisplay code if + one arrives while in the middle of redisplay. + +b. Changes to the timeout code to make sure that timeout values greater + than one second are handled better. + +c. Fixed a bug in the redisplay code that was triggered by a prompt + containing invisible characters exactly the width of the screen. + +d. Fixed a bug in the redisplay code encountered when running in horizontal + scroll mode. + +e. Fixed a bug that prevented menu completion from properly completing + filenames. + +f. Fixed a redisplay bug caused by a multibyte character causing a line to + wrap. + +g. Fixed a bug that caused key sequences of two characters to not be + recognized when a longer sequence identical in the first two characters + was bound. + +h. Fixed a bug that caused history expansion to be attempted on $'...' + single-quoted strings. + +i. Fixed a bug that caused incorrect redisplay when the prompt contained + multibyte characters in an `invisible' sequence bracketed by \[ and + \]. + +j. Fixed a bug that caused history expansion to short-circuit after + encountering a multibyte character. + +3. New Features in Bash + +a. Here-documents within $(...) command substitutions may once more be + delimited by the closing right paren, instead of requiring a newline. + +b. Bash's file status checks (executable, readable, etc.) now take file + system ACLs into account on file systems that support them. + +c. Bash now passes environment variables with names that are not valid + shell variable names through into the environment passed to child + processes. + +d. The `execute-unix-command' readline function now attempts to clear and + reuse the current line rather than move to a new one after the command + executes. + +e. `printf -v' can now assign values to array indices. + +f. New `complete -E' and `compopt -E' options that work on the "empty" + completion: completion attempted on an empty command line. + +g. New complete/compgen/compopt -D option to define a `default' completion: + a completion to be invoked on command for which no completion has been + defined. If this function returns 124, programmable completion is + attempted again, allowing a user to dynamically build a set of completions + as completion is attempted by having the default completion function + install individual completion functions each time it is invoked. + +h. When displaying associative arrays, subscripts are now quoted. + +i. Changes to dabbrev-expand to make it more `emacs-like': no space appended + after matches, completions are not sorted, and most recent history entries + are presented first. + +j. The [[ and (( commands are now subject to the setting of `set -e' and the + ERR trap. + +k. The source/. builtin now removes NUL bytes from the file before attempting + to parse commands. + +l. There is a new configuration option (in config-top.h) that forces bash to + forward all history entries to syslog. + +m. A new variable $BASHOPTS to export shell options settable using `shopt' to + child processes. + +n. There is a new confgure option that forces the extglob option to be + enabled by default. + +o. New variable $BASH_XTRACEFD; when set to an integer bash will write xtrace + output to that file descriptor. + +p. If the optional left-hand-side of a redirection is of the form {var}, the + shell assigns the file descriptor used to $var or uses $var as the file + descriptor to move or close, depending on the redirection operator. + +q. The < and > operators to the [[ conditional command now do string + comparison according to the current locale. + +r. Programmable completion now uses the completion for `b' instead of `a' + when completion is attempted on a line like: a $(b c. + +s. Force extglob on temporarily when parsing the pattern argument to + the == and != operators to the [[ command, for compatibility. + +t. Changed the behavior of interrupting the wait builtin when a SIGCHLD is + received and a trap on SIGCHLD is set to be Posix-mode only. + +u. The read builtin has a new `-N nchars' option, which reads exactly NCHARS + characters, ignoring delimiters like newline. + +4. New Features in Readline + +a. New bindable function: menu-complete-backward. + +b. In the vi insertion keymap, C-n is now bound to menu-complete by default, + and C-p to menu-complete-backward. + +c. When in vi command mode, repeatedly hitting ESC now does nothing, even + when ESC introduces a bound key sequence. This is closer to how + historical vi behaves. + +d. New bindable function: skip-csi-sequence. Can be used as a default to + consume key sequences generated by keys like Home and End without having + to bind all keys. + +e. New application-settable function: rl_filename_rewrite_hook. Can be used + to rewite or modify filenames read from the file system before they are + compared to the word to be completed. + +f. New bindable variable: skip-completed-text, active when completing in the + middle of a word. If enabled, it means that characters in the completion + that match characters in the remainder of the word are "skipped" rather + than inserted into the line. + +g. The pre-readline-6.0 version of menu completion is available as + "old-menu-complete" for users who do not like the readline-6.0 version. + +h. New bindable variable: echo-control-characters. If enabled, and the + tty ECHOCTL bit is set, controls the echoing of characters corresponding + to keyboard-generated signals. + +i. New bindable variable: enable-meta-key. Controls whether or not readline + sends the smm/rmm sequences if the terminal indicates it has a meta key + that enables eight-bit characters. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-4.0-release, +and the previous version, bash-4.0-rc1. + +1. Changes to Bash + +a. Changed the message printed when setlocale(3) fails to only include the + strerror error text if the call changes errno. + +b. Changed trap command execution to reset the line number before running a + trap (except DEBUG and RETURN traps). + +c. Fixed behavior of case-modifiying word expansions to not work on + individual words within a variable's value. + +d. Fixed a bug that caused mapfile to not be interruptible when run in an + interactive shell. + +e. Fixed a bug that caused mapfile to not run callbacks for the first line + read. + +f. Fixed a bug that caused mapfile to not honor EOF typed in an interactive + shell. + +g. Fixed the coprocess reaping code to not run straight from a signal handler. + +h. Fixed a bug that caused printf -b to ignore the first % conversion specifier + in the format string on 64-bit systems. + +i. Fixed a bug that caused incorrect word splitting when `:', `=', or `~' + appeared in $IFS. + +j. Fixed a bug that caused data corruption in the programmable completion code + when a shell function called from a completion aborted execution. + +k. Fixed a bug that caused the CPU usage reported by the `time' builtin to be + capped at 100%. + +l. Changed behavior of shell when -e option is in effect to reflect consensus + of Posix shell standardization working group. + +m. Fixed a bug introduced in bash-4.0-alpha that caused redirections to not + be displayed by `type' or `declare' when appearing in functions under + certain circumstances. + +2. Changes to Readline + +a. Fixed a bug that caused !(...) extended glob patterns to inhibit later + history expansion. + +b. Reworked the signal handling to avoid calling disallowed functions from a + signal handler. + +3. New Features in Bash + +a. `readarray' is now a synonym for `mapfile'. +------------------------------------------------------------------------------ +This document details the changes between this version, bash-4.0-rc1, +and the previous version, bash-4.0-beta2. + +1. Changes to Bash + +a. Fixed a bug that caused parsing errors when a $()-style command + substitution was follwed immediately by a quoted newline. + +b. Fixed a bug that caused extended shell globbing patterns beginning with + `*(' to not work when used with pattern substitution word expansions. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-4.0-beta2, +and the previous version, bash-4.0-beta. + +1. Changes to Bash + +a. Fixed a bug that caused failed word expansions to set $? but not + PIPESTATUS. + +b. Changed filename completion to quote the tilde in a filename with a + leading tilde that exists in the current directory. + +c. Fixed a bug that caused a file descriptor leak when performing + redirections attached to a compound command. + +d. Fixed a bug that caused expansions of $@ and $* to not exit the shell if + the -u option was enabled and there were no posititional parameters. + +e. Fixed a bug that resulted in bash not terminating immediately if a + terminating signal was received while performing output. + +f. Fixed a bug that caused the shell to crash after creating 256 process + substitutions during word completion. + +2. Changes to Readline + +a. Fixed a bug that caused redisplay errors when using prompts with invisible + characters and numeric arguments to a command in a multibyte locale. + +b. Fixed a bug that caused redisplay errors when using prompts with invisible + characters spanning more than two physical screen lines. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-4.0-beta, +and the previous version, bash-4.0-alpha. + +1. Changes to Bash + +a. Fixed a typo that caused a variable to be used before initialization + while parsing Posix-style command substitutions. + +b. Fixed a bug that caused stray ^? when the expansion of a parameter used + as part of a pattern removal expansion is empty, but part of a non- + empty string. + +c. Fixed a bug that could cause strings not converted to numbers by strtol + to be treated as if the conversion had been successful. + +d. The `return' builtin now accepts no options and requires a `--' before + a negative return value, as Posix requires. + +e. Fixed a bug that caused local variables to be created with the empty + string for a value rather than no value. + +f. Changed behavior so the shell now acts as if it received an interrupt + when a pipeline is killed by SIGINT while executing a list. + +g. Fixed a bug that caused `declare var' and `typeset var' to initialize + `var' to the empty string. + +h. Changed `bind' builtin to print a warning but proceed if invoked when + line editing is not active. + +i. Fixed a bug that caused the shell to exit when the `errexit' option is + set and a command in a pipeline returns a non-zero exit status. + +j. Fixed a bug that caused the shell to not run the exit trap in a command + run with `bash -c' under some circumstances. + +k. Fixed a bug that caused parser errors to occasionally not set $? when + running commands with `eval'. + +l. Fixed a bug that caused stray control characters when evaluating compound + array assignments containing $'\x7f' escapes. + +m. Fixed a bug that caused redirections involving file descriptor 10 as the + target to behave incorrectly. + +n. Fixed a bug that could cause memory to be freed multiple times when + assigning to COMP_WORDBREAKS. + +o. Fixed a bug that could cause NULL pointer dereferences when COMP_WORDBREAKS + was unset. + +2. Changes to Readline + +3. New Features in Bash + +a. A value of 0 for the -t option to `read' now returns success if there is + input available to be read from the specified file descriptor. + +b. CDPATH and GLOBIGNORE are ignored when the shell is running in privileged + mode. + +c. New bindable readline functions shell-forward-word and shell-backward-word, + which move forward and backward words delimited by shell metacharacters + and honor shell quoting. + +d. New bindable readline functions shell-backward-kill-word and shell-kill-word + which kill words backward and forward, but use the same word boundaries + as shell-forward-word and shell-backward-word. + +4. New Features in Readline + +a. If the kernel supports it, readline displays special characters + corresponding to a keyboard-generated signal when the signal is received. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-4.0-alpha, +and the previous version, bash-3.2-release. + +1. Changes to Bash + +a. Fixed several bugs in old-style `` command substitution parsing, including + comment parsing and quoted string handling. + +b. Fixed problems parsing arguments to the [[ command's =~ regular expression + matching operator: metacharacter and whitespace parsing. + +c. Fixed a bug that caused the shell to inappropriately reuse high-numbered + file descriptors it used internally. + +d. Fixed a bug in pattern replacement word expansions that caused a `/' as + the first character of an expanded pattern to be mistaken for a global + replacement specifier. + +e. Fixed several problems with the asprintf and snprintf replacement functions + that caused hangs and crashes. + +f. Fixed a bug in the calculation of the current and previous job that caused + it to refer to incorrect jobs. + +g. Fixed a bug in the check for the validity of a hashed command pathname that + caused unnecessary hash table deletions and additions. + +h. Fixed a bug that caused child processes to inherit the wrong value for $!. + +i. Fixed a bug that caused `.' to fail to read and execute commands from non- + regular files such as devices or named pipes. + +j. Fixed a bug in printf formatting for the %x and %X expansions that occurred + on some systems. + +k. Fixed a bug that caused the shell to crash when creating temporary files if + $TMPDIR named a non-writable directory. + +l. Fixed a bug that caused the shell to ignore $TMPDIR when creating temporary + files under some circumstances. + +m. Fixed a bug that caused named pipes created by process substitution to not + be cleaned up. + +n. Fixed a bug that caused HISTTIMEFORMAT to not be honored when it appeared + in the initial shell environment. + +o. Fixed several bugs in the expansion of $* and $@ (quoted and unquoted) + when IFS is null or contains non-whitespace characters; the same changes + apply to arrays subscripted with * or @. + +p. Fixed several problems with pattern substitution expansions on the + positional parameters and arrays subscripted with * or @ that occurred + when $IFS was set to the empty string. + +q. Made a change to the default locale initialization code that should + result in better behavior from the locale-aware library functions. + +r. Fixed a bug that caused compacting the jobs list to drop jobs. + +s. Fixed a bug that caused jumps back to the top-level processing loop from + a builtin command to leave the shell in an inconsistent state. + +t. Fixed a bug that caused characters that would be escaped internally to be + doubled when escaped with a backslash. + +u. Fixed the initialization of mailboxes to not cause maildirs to be read + (and stat(2) called for every message file) at shell startup. + +v. Fixed a bug that caused the shell to not display $PS2 when the read builtin + reads a line continued with a backslash. + +w. Fixed a bug that caused errors in word splitting when $IFS contained + characters used for internal quoting. + +x. Fixed bugs that caused problems with output from shell builtins not being + completely displayed on some systems. + +y. Fixed a bug that caused output to be lost when a redirection is acting on + the shell's output file descriptor. + +z. Fixed bugs caused by shell builtins not checking for all write errors. + +aa. Fixed a problem that caused the shell to dump core if expansions on the + pattern passed to the pattern removal word expansions resulted in expansion + errors. + +bb. Fixed a bug that caused bash to loop infinitely after creating and + waiting for 4096 jobs. + +cc. Fixed a bug that caused bash to lose the status of a background job under + certain circumstances. + +dd. Fixed a bug that caused bash to not look in the temporary environment + when performing variable lookup under certain circumstances. + +ee. Fixed a bug that caused bash to close file descriptors greater than 10 + when they were used in redirections. + +ff. Fixed a problem that caused the shell to attempt to read from the standard + input when called as `bash -i script'. + +gg. Fixed a memory leak and variable initialization problems when the -v option + was supplied to `printf' that could cause incorrect results. + +hh. Fixed a bug that caused the `read' builtin to count bytes when the -n option + was supplied, rather than (possibly multibyte) characters. + +ii. Fixed a bug when displaying a function due to not converting the function + to an external form. + +jj. Changed job control initialization to ensure that the shell has a tty + as its controlling terminal before enabling job control. + +kk. Fixed a bug with the `test' builtin that caused it to misinterpret + arguments beginning with `-' but containing more than one character. + +ll. Fixed bug that could cause the shell to dump core in certain cases where + a command sets the SIGINT disposition to the default. + +mm. Fixed a bug in the pattern replacement (affecting both word expansion + and the `fc' builtin) that occurred when the pattern and replacement + strings were empty. + +nn. Fixed a bug that caused an arithmetic evaluation error to disable all + further evaluation. + +oo. Fixed a bug in pathname expansion that caused it to interpret backslashes + in the pathname as quoting characters. + +pp. Fixed a bug in the replacement getcwd() implementation that could cause + memory to be overwritten. + +qq. When in Posix mode, the `ulimit' builtin now uses a block size of 512 for + the `-c' and `-f' options. + +rr. Brace expansion now allows process substitutions to pass through unchanged. + +ss. Fixed a problem in the command name completion code to avoid quoting + escaped special characters twice when the command name begins with a tilde. + +tt. Fixed a problem in the printf builtin that resulted in single-byte + output for the "'" escape, even when using multibyte characters. + +uu. Fixed a bug that caused the failure exit status to be lost when redirections + attached to a compound command failed. + +vv. Fixed a bug that caused the internal random number generator to not be + re-seeded correctly when creating a subshell. + +ww. Fixed a bug that could cause the bash replacement getcwd to overwrite + memory. + +xx. Fixed a bug that caused the shell to not receive SIGINT if it was sent + while the shell was waiting for a command substitution to terminate, and + make sure the exit status is correct when it does. + +yy. Fixed a bug that resulted in the second and subsequent children spawned + by a shell begun to run a command substitution being placed into the + wrong process group. + +zz. Fixed a bug that caused the results of successful tilde expansion to be + subject to pathname expansion and word splitting. + +aaa. Fixed a bug that could cause the shell to hang if it encountered an + error that caused it to jump back to the top processing loop during a + command substitution or `eval' command. + +bbb. Fixed a bug that caused the `read' builtin to use the tty's attributes + instead of those of the file descriptor passed with the -u option when + processing the -n and -d options. + +ccc. Fixed a bug that caused incorrect expansion of ${array[@]:foo} if the + first character of $IFS was not whitespace. + +ddd. Fixed a bug that occurred when scanning for the ending delimiter of a + ${parameter/pat/sub} expansion. + +eee. Fixed a bug that caused the shell to inappropriately expand command + substitutions in words when expanding directory names for completion. + +fff. Fixed a bug that caused the `fc' builtin to look too far back in the + history list under certain circumstances. + +ggg. Fixed a bug that caused a shell running in Posix mode to search $PWD for + a file specified as an argument to source/. when the file was not found + in $PATH. + +hhh. Fixed a bug that caused the shell to modify the case of a command word + found via command completion when the shell was performing case- + insensitive completion. + +iii. Fixed a bug that caused the shell to search $PATH for an argument to + source/. even when it contained a `/'. + +jjj. Fixed a bug that caused brace expansion to misorder expansions when the + locale did not have a collating order like aAbBcC...zZ. + +kkk. Fixed a bug that did not allow `set +o history' to have any effect when + run in a startup file or from a sourced file. + +lll. Fixed a bug with the precedence of the ?: conditional arithmetic operator. + +mmm. Fixed a bug that caused side effects of temporary variable assignments + to persist in the shell environment. + +nnn. Fixed a bug that caused the terminal to be left in non-canonical mode + when using editing commands that invoke the an editor on the current + command line. + +ooo. Fixed a bug that caused globbing characters and characters in $IFS to not + be quoted appropriately when displaying assignment statements. + +ppp. Fixed a bug that caused the `-e' option to be inherited when sourcing a + file or evaluating a command with `eval' even if the return value of the + command was supposed to be ignored. + +qqq. Fixed a bug that caused the shell to attempt to created variables with + invalid names if such names appeared in the initial environment. + +rrr. Fixed a bug with quote removal in strings where the final character is a + backslash. + +sss. Fixed a bug that caused the effects of special variables to persist even + when the variables were unset as part of the shell reinitializing itself + to execute a shell script. + +ttt. Fixed a bug that caused the history to not be saved after `history -c' or + `history -d' was executed until a sufficient number of commands had been + saved to the history. + +uuu. Bash now parses command substitutions according to Posix rules: parsing + the command contained in $() to find the closing delimiter. + +vvv. Fixed a bug that caused traps on SIGCHLD set in a SIGCHLD handler to + not persist. + +www. Fixed a bug that didn't allow SIGCHLD to interrupt the `wait' builtin + as Posix specifies. + +xxx. Invalid numeric arguments to shell builtins no longer cause the shell to + short-circuit any executing compound command. + +yyy. Fixed a bug that caused the exit status to be lost when `break' was + used to short-circuit a loop's execution. + +zzz. Fixed a bug that caused stray ^? characters to be left in expansions of + "${array[*]}". + +aaaa. Bash now prints better error messages for here documents terminated by + EOF and for identifying the incorrect token in an invalid arithmetic + expression. + +bbbb. Fixed a bug in the variable length word expansion that caused it to + incorrectly calculate the number of multibyte characters. + +cccc. Fixed a race condition that could result in the top-level shell setting + the terminal's process group to an incorrect value if the process + group was changed by a child of a child of the shell. + +dddd. Fixed a bug that caused here documents belonging to commands within a + compound command to be displayed in a syntactially-incorrect form, which + prevented them from being re-read as input. + +eeee. The shell displays more warnings about failures to set the locale. + +ffff. Fixed a bug that caused the body of a here-document to not be saved to + the history list. + +gggg. Fixed a bug that caused configure to incorrectly conclude that FreeBSD + had /dev/fd available, resulting in problems with process substitution. + +2. Changes to Readline + +a. Fixed a number of redisplay errors in environments supporting multibyte + characters. + +b. Fixed bugs in vi command mode that caused motion commands to inappropriately + set the mark. + +c. When using the arrow keys in vi insertion mode, readline allows movement + beyond the current end of the line (unlike command mode). + +d. Fixed bugs that caused readline to loop when the terminal has been taken + away and reads return -1/EIO. + +e. Fixed bugs in redisplay occurring when displaying prompts containing + invisible characters. + +f. Fixed a bug that caused the completion append character to not be reset to + the default after an application-specified completion function changed it. + +g. Fixed a problem that caused incorrect positioning of the cursor while in + emacs editing mode when moving forward at the end of a line while using + a locale supporting multibyte characters. + +h. Fixed an off-by-one error that caused readline to drop every 511th + character of buffered input. + +i. Fixed a bug that resulted in SIGTERM not being caught or cleaned up. + +j. Fixed redisplay bugs caused by multiline prompts with invisible characters + or no characters following the final newline. + +k. Fixed redisplay bug caused by prompts consisting solely of invisible + characters. + +l. Fixed a bug in the code that buffers characters received very quickly in + succession which caused characters to be dropped. + +m. Fixed a bug that caused readline to reference uninitialized data structures + if it received a SIGWINCH before completing initialzation. + +n. Fixed a bug that caused the vi-mode `last command' to be set incorrectly + and therefore unrepeatable. + +o. Fixed a bug that caused readline to disable echoing when it was being used + with an output file descriptor that was not a terminal. + +p. Readline now blocks SIGINT while manipulating internal data structures + during redisplay. + +q. Fixed a bug in redisplay that caused readline to segfault when pasting a + very long line (over 130,000 characters). + +r. Fixed bugs in redisplay when using prompts with no visible printing + characters. + +3. New Features in Bash + +a. When using substring expansion on the positional parameters, a starting + index of 0 now causes $0 to be prefixed to the list. + +b. The `help' builtin now prints its columns with entries sorted vertically + rather than horizontally. + +c. There is a new variable, $BASHPID, which always returns the process id of + the current shell. + +d. There is a new `autocd' option that, when enabled, causes bash to attempt + to `cd' to a directory name that is supplied as the first word of a + simple command. + +e. There is a new `checkjobs' option that causes the shell to check for and + report any running or stopped jobs at exit. + +f. The programmable completion code exports a new COMP_TYPE variable, set to + a character describing the type of completion being attempted. + +g. The programmable completion code exports a new COMP_KEY variable, set to + the character that caused the completion to be invoked (e.g., TAB). + +h. If creation of a child process fails due to insufficient resources, bash + will try again several times before reporting failure. + +i. The programmable completion code now uses the same set of characters as + readline when breaking the command line into a list of words. + +j. The block multiplier for the ulimit -c and -f options is now 512 when in + Posix mode, as Posix specifies. + +k. Changed the behavior of the read builtin to save any partial input received + in the specified variable when the read builtin times out. This also + results in variables specified as arguments to read to be set to the empty + string when there is no input available. When the read builtin times out, + it returns an exit status greater than 128. + +l. The shell now has the notion of a `compatibility level', controlled by + new variables settable by `shopt'. Setting this variable currently + restores the bash-3.1 behavior when processing quoted strings on the rhs + of the `=~' operator to the `[[' command. + +m. The `ulimit' builtin now has new -b (socket buffer size) and -T (number + of threads) options. + +n. The -p option to `declare' now displays all variable values and attributes + (or function values and attributes if used with -f). + +o. There is a new `compopt' builtin that allows completion functions to modify + completion options for existing completions or the completion currently + being executed. + +p. The `read' builtin has a new -i option which inserts text into the reply + buffer when using readline. + +q. A new `-E' option to the complete builtin allows control of the default + behavior for completion on an empty line. + +r. There is now limited support for completing command name words containing + globbing characters. + +s. Changed format of internal help documentation for all builtins to roughly + follow man page format. + +t. The `help' builtin now has a new -d option, to display a short description, + and a -m option, to print help information in a man page-like format. + +u. There is a new `mapfile' builtin to populate an array with lines from a + given file. + +v. If a command is not found, the shell attempts to execute a shell function + named `command_not_found_handle', supplying the command words as the + function arguments. + +w. There is a new shell option: `globstar'. When enabled, the globbing code + treats `**' specially -- it matches all directories (and files within + them, when appropriate) recursively. + +x. There is a new shell option: `dirspell'. When enabled, the filename + completion code performs spelling correction on directory names during + completion. + +y. The `-t' option to the `read' builtin now supports fractional timeout + values. + +z. Brace expansion now allows zero-padding of expanded numeric values and + will add the proper number of zeroes to make sure all values contain the + same number of digits. + +aa. There is a new bash-specific bindable readline function: `dabbrev-expand'. + It uses menu completion on a set of words taken from the history list. + +bb. The command assigned to a key sequence with `bind -x' now sets two new + variables in the environment of the executed command: READLINE_LINE_BUFFER + and READLINE_POINT. The command can change the current readline line + and cursor position by modifying READLINE_LINE_BUFFER and READLINE_POINT, + respectively. + +cc. There is a new &>> redirection operator, which appends the standard output + and standard error to the named file. + +dd. The parser now understands `|&' as a synonym for `2>&1 |', which redirects + the standard error for a command through a pipe. + +ee. The new `;&' case statement action list terminator causes execution to + continue with the action associated with the next pattern in the + statement rather than terminating the command. + +ff. The new `;;&' case statement action list terminator causes the shell to + test the next set of patterns after completing execution of the current + action, rather than terminating the command. + +gg. The shell understands a new variable: PROMPT_DIRTRIM. When set to an + integer value greater than zero, prompt expansion of \w and \W will + retain only that number of trailing pathname components and replace + the intervening characters with `...'. + +hh. There are new case-modifying word expansions: uppercase (^[^]) and + lowercase (,[,]). They can work on either the first character or + array element, or globally. They accept an optional shell pattern + that determines which characters to modify. There is an optionally- + configured feature to include capitalization operators. + +ii. The shell provides associative array variables, with the appropriate + support to create, delete, assign values to, and expand them. + +jj. The `declare' builtin now has new -l (convert value to lowercase upon + assignment) and -u (convert value to uppercase upon assignment) options. + There is an optionally-configurable -c option to capitalize a value at + assignment. + +kk. There is a new `coproc' reserved word that specifies a coprocess: an + asynchronous command run with two pipes connected to the creating shell. + Coprocs can be named. The input and output file descriptors and the + PID of the coprocess are available to the calling shell in variables + with coproc-specific names. + +4. New Features in Readline + +a. A new variable, rl_sort_completion_matches; allows applications to inhibit + match list sorting (but beware: some things don't work right if + applications do this). + +b. A new variable, rl_completion_invoking_key; allows applications to discover + the key that invoked rl_complete or rl_menu_complete. + +c. The functions rl_block_sigint and rl_release_sigint are now public and + available to calling applications who want to protect critical sections + (like redisplay). + +d. The functions rl_save_state and rl_restore_state are now public and + available to calling applications; documented rest of readline's state + flag values. + +e. A new user-settable variable, `history-size', allows setting the maximum + number of entries in the history list. + +f. There is a new implementation of menu completion, with several improvements + over the old; the most notable improvement is a better `completions + browsing' mode. + +g. The menu completion code now uses the rl_menu_completion_entry_function + variable, allowing applications to provide their own menu completion + generators. + +h. There is support for replacing a prefix of a pathname with a `...' when + displaying possible completions. This is controllable by setting the + `completion-prefix-display-length' variable. Matches with a common prefix + longer than this value have the common prefix replaced with `...'. + +i. There is a new `revert-all-at-newline' variable. If enabled, readline will + undo all outstanding changes to all history lines when `accept-line' is + executed. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-3.2-release, +and the previous version, bash-3.2-beta. + +1. Changes to Bash + +a. Fixed a bug that caused the temporary environment passed to a command to + affect the shell's environment under certain circumstances. + +b. Fixed a bug in the printf builtin that caused the %q format specifier to + ignore empty string arguments. + +c. Improved multibyte character environment detection at configuration time. + +d. Fixed a bug in the read builtin that left spurious escape characters in the + input after processing backslashes when assigning to an array variable. + +2. Changes to Readline + +a. Fixed a redisplay bug that occurred in multibyte-capable locales when the + prompt was one character longer than the screen width. +------------------------------------------------------------------------------ +This document details the changes between this version, bash-3.2-beta, +and the previous version, bash-3.2-alpha. + +1. Changes to Bash + +a. Changed the lexical analyzer to treat locale-specific blank characters as + white space. + +b. Fixed a bug in command printing to avoid confusion between redirections and + process substitution. + +c. Fixed problems with cross-compiling originating from inherited environment + variables. + +d. Added write error reporting to printf builtin. + +e. Fixed a bug in the variable expansion code that could cause a core dump in + a multi-byte locale. + +f. Fixed a bug that caused substring expansion of a null string to return + incorrect results. + +g. BASH_COMMAND now retains its previous value while executing commands as the + result of a trap, as the documentation states. + +2. Changes to Readline + +a. Fixed a bug with prompt redisplay in a multi-byte locale to avoid redrawing + the prompt and input line multiple times. + +b. Fixed history expansion to not be confused by here-string redirection. + +c. Readline no longer treats read errors by converting them to newlines, as + it does with EOF. This caused partial lines to be returned from readline(). + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-3.2-alpha, +and the previous version, bash-3.1-release. + +1. Changes to Bash + +a. Fixed a source bug that caused the minimal configuration to not compile. + +b. Fixed memory leaks in error handling for the `read' builtin. + +c. Changed the [[ and (( compound commands to set PIPESTATUS with their exit + status. + +d. Fixed some parsing problems with compound array assignments. + +e. Added additional configuration changes for: NetBSD (incomplete multibyte + character support) + +f. Fixed two bugs with local array variable creation when shadowing a variable + of the same name from a previous context. + +g. Fixed the `read' builtin to restore the correct set of completion functions + if a timeout occurs. + +h. Added code to defer the initialization of HISTSIZE (and its stifling of the + history list) until the history file is loaded, allowing a startup file to + override the default value. + +i. Tightened up the arithmetic expression parsing to produce better error + messages when presented with invalid operators. + +j. Fixed the cross-compilation support to build the signal list at shell + invocation rather than compile time if cross-compiling. + +k. Fixed multibyte support for non-gcc compilers (or compilers that do not + allow automatic array variable sizing based on a non-constant value). + +l. Several fixes to the code that manages the list of terminated jobs and + their exit statuses, and the list of active and recently-terminated jobs + to avoid pid aliasing/wraparound and allocation errors. + +m. Fixed a problem that allowed scripts to die due to SIGINT while waiting + for children, even when started in the background or otherwise ignoring + SIGINT. + +n. Fixed a bug that caused shells invoked as -/bin/bash from not being + recognized as login shells. + +o. Fixed a problem that caused shells in the background to give the terminal + to a process group other than the foreground shell process group. + +p. Fixed a problem with extracting the `varname' in ${#varname}. + +q. Fixed the code that handles SIGQUIT to not exit immediately -- thereby + calling functions that may not be called in a signal handler context -- + but set a flag and exit afterward (like SIGINT). + +r. Changed the brace expansion code to skip over braces that don't begin a + valid matched brace expansion construct. + +s. Fixed `typeset' and `declare' to not require that their shell function + operands to be valid shell identifiers. + +t. Changed `test' to use access(2) with a temporary uid/euid swap when testing + file attributes and running setuid, and access(2) in most other cases. + +u. Changed completion code to not attempt command name completion on a line + consisting solely of whitespace when no_empty_command_completion is set. + +v. The `hash' builtin now prints nothing in posix mode when the hash table is + empty, and prints a message to that effect to stdout instead of stderr + when not in posix mode. + +w. Fixed a bug in the extended pattern matching code that caused it to fail to + match periods with certain patterns. + +x. Fixed a bug that caused the shell to dump core when performing filename + generation in directories with thousands of files. + +y. Returned to the original Bourne shell rules for parsing ``: no recursive + parsing of embedded quoted strings or ${...} constructs. + +z. The inheritence of the DEBUG, RETURN, and ERR traps is now dependent only + on the settings of the `functrace' and `errtrace' shell options, rather + than whether or not the shell is in debugging mode. + +aa. Fixed a problem with $HOME being converted to ~ in the expansion of + members of the DIRSTACK array. + +bb. Fixed a problem with quoted arguments to arithmetic expansions in certain + constructs. + +cc. The command word completion code now no longer returns matching directories + while searching $PATH. + +dd. Fixed a bug with zero-padding and precision handling in snprintf() + replacement. + +ee. Fixed a bug that caused the command substitution code not to take embedded + shell comments into account. + +ff. Fixed a bug that caused $((...);(...)) to be misinterpreted as an + arithmetic substitution. + +gg. Fixed a bug in the prompt expansion code that inappropriately added a + \001 before a \002 under certain circumstances. + +hh. Fixed a bug that caused `unset LANG' to not properly reset the locale + (previous versions would set the locale back to what it was when bash + was started rather than the system's "native" locale). + +ii. Fixed a bug that could cause file descriptors > 10 to not be closed even + when closed explicitly by a script. + +jj. Fixed a bug that caused single quotes to be stripped from ANSI-C quoting + inside double-quoted command substitutions. + +kk. Fixed a bug that could cause core dumps when `return' was executed as the + last element of a pipeline inside a shell function. + +ll. Fixed a bug that caused DEBUG trap strings to overwrite commands stored in + the jobs list. + +2. Changes to Readline + +a. Fixed a problem that caused segmentation faults when using readline in + callback mode and typing consecutive DEL characters on an empty line. + +b. Fixed several redisplay problems with multibyte characters, all having to + do with the different code paths and variable meanings between single-byte + and multibyte character redisplay. + +c. Fixed a problem with key sequence translation when presented with the + sequence \M-\C-x. + +d. Fixed a problem that prevented the `a' command in vi mode from being + undone and redone properly. + +e. Fixed a problem that prevented empty inserts in vi mode from being undone + properly. + +f. Fixed a problem that caused readline to initialize with an incorrect idea + of whether or not the terminal can autowrap. + +g. Fixed output of key bindings (like bash `bind -p') to honor the setting of + convert-meta and use \e where appropriate. + +h. Changed the default filename completion function to call the filename + dequoting function if the directory completion hook isn't set. This means + that any directory completion hooks need to dequote the directory name, + since application-specific hooks need to know how the word was quoted, + even if no other changes are made. + +i. Fixed a bug with creating the prompt for a non-interactive search string + when there are non-printing characters in the primary prompt. + +j. Fixed a bug that caused prompts with invisible characters to be redrawn + multiple times in a multibyte locale. + +k. Fixed a bug that could cause the key sequence scanning code to return the + wrong function. + +l. Fixed a problem with the callback interface that caused it to fail when + using multi-character keyboard macros. + +m. Fixed a bug that could cause a core dump when an edited history entry was + re-executed under certain conditions. + +n. Fixed a bug that caused readline to reference freed memory when attmpting + to display a portion of the prompt. + +3. New Features in Bash + +a. Changed the parameter pattern replacement functions to not anchor the + pattern at the beginning of the string if doing global replacement - that + combination doesn't make any sense. + +b. When running in `word expansion only' mode (--wordexp option), inhibit + process substitution. + +c. Loadable builtins now work on MacOS X 10.[34]. + +d. Shells running in posix mode no longer set $HOME, as POSIX requires. + +e. The code that checks for binary files being executed as shell scripts now + checks only for NUL rather than any non-printing character. + +f. Quoting the string argument to the [[ command's =~ operator now forces + string matching, as with the other pattern-matching operators. + +4. New Features in Readline + +a. Calling applications can now set the keyboard timeout to 0, allowing + poll-like behavior. + +b. The value of SYS_INPUTRC (configurable at compilation time) is now used as + the default last-ditch startup file. + +c. The history file reading functions now allow windows-like \r\n line + terminators. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-3.1-release, +and the previous version, bash-3.1-rc2. + +1. Changes to Readline + +a. Several changes to the multibyte redisplay code to fix problems with + prompts containing invisible characters. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-3.1-rc2, +and the previous version, bash-3.1-rc1. + +1. Changes to Bash + +a. Fixed a bug that caused a DEBUG trap to overwrite a command string that's + eventually attached to a background job. + +b. Changed some code so that filenames with leading tildes with spaces in the + name aren't tilde-expanded by the bash completion code. + +c. Fixed a bug that caused the pushd builtin to fail to change to + directories with leading `-'. + +d. Fixed a small memory leak in the programmable completion code. + +2. Changes to Readline + +a. Fixed a redisplay bug caused by moving the cursor vertically to a line + with invisible characters in the prompt in a multibyte locale. + +b. Fixed a bug that could cause the terminal special chars to be bound in the + wrong keymap in vi mode. + +3. New Features in Bash + +a. If compiled for strict POSIX conformance, LINES and COLUMNS may now + override the true terminal size. + +4. New Features in Readline + +a. A new external application-controllable variable that allows the LINES + and COLUMNS environment variables to set the window size regardless of + what the kernel returns. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-3.1-rc1, +and the previous version, bash-3.1-beta1. + +1. Changes to Bash + +a. Fixed a bug that could cause core dumps due to accessing the current + pipeline while in the middle of modifying it. + +b. Fixed a bug that caused pathnames with backslashes still quoting characters + to be passed to opendir(). + +c. Command word completion now obeys the setting of completion-ignore-case. + +d. Fixed a problem with redirection that caused file descriptors greater than + 2 to be inappropriately marked as close-on-exec. + +e. In Posix mode, after `wait' is called to wait for a particular process + explicitly, that process is removed from the list of processes known to + the shell, and subsequent attempts to wait for it return errors. + +f. Fixed a bug that caused extended pattern matching to incorrectly scan + backslash-escaped pattern characters. + +g. Fixed a synchronization problem that could cause core dumps when handling + a SIGWINCH. + +h. Fixed a bug that caused an unmatched backquote to be accepted without an + error when processing here documents. + +i. Fixed a small memory leak in the `cd' builtin. + +j. Fix for MacOS X so it gets the values for the HOSTTYPE, MACHTYPE, and + OSTYPE variables at build time, to support universal binaries. + +k. Fixed a bug that could cause an exit trap to return the exit status of + the trap command rather than the status as it was before the trap was + run as the shell's exit status. + +2. New Features in Bash + +3. Changes to Readline + +a. Fixed a bug that caused reversing the incremental search direction to + not work correctly. + +b. Fixed the vi-mode `U' command to only undo up to the first time insert mode + was entered, as Posix specifies. + +c. Fixed a bug in the vi-mode `r' command that left the cursor in the wrong + place. + +4. New Features in Readline + +a. New application-callable auxiliary function, rl_variable_value, returns + a string corresponding to a readline variable's value. + +b. When parsing inputrc files and variable binding commands, the parser + strips trailing whitespace from values assigned to boolean variables + before checking them. + + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-3.1-beta1, +and the previous version, bash-3.1-alpha1. + +1. Changes to Bash + +a. Added some system-specific signal names. + +b. Fixed a typo in the ulimit builtin to make `x' the right option to + maniuplate the limit on file locks. + +c. Fixed a problem with using += to append to index 0 of an array variable + when not using subscript syntax. + +d. A few changes to configure.in to remove calls to obsolete or outdated + macros. + +e. Make sure changes to variables bash handles specially (e.g., LC_ALL) are + made when the variable is set in the temporary environment to a command. + +f. Make sure changes to variables bash handles specially (e.g., LC_ALL) are + made when the variable is modified using `printf -v'. + +g. The export environment is now remade on cygwin when HOME is changed, so + DLLs bash is linked against pick up the new value. This fixes problems + with tilde expansion when linking against and already-installed readline. + +h. Small fix to the logic for performing tilde expansion in posix mode, so + expansion on the right-hand side of an assignment statement takes place. + +i. Fixed a bug that prevented redirections associated with a shell function + from being executed when in a subshell. + +j. Fixed `source' and `.' builtins to not require an executable file when + searching $PATH for a file to source. + +k. Fixed a bug that caused incorrect word splitting in a function when IFS + was declared local, then unset. + +l. Fixed a problem with the `kill' builtin that prevented sending signals + to a process group under certain circumstances when providing a pid < 0. + +m. When in POSIX mode, `pwd' now checks that the value it prints is the same + directory as `.', even when displaying $PWD. + +n. Fixed a problem with the `read' builtin when reading a script from standard + input and reading data from the same file. + +o. Fixed a problem with the `type' and `command' builtins that caused absolute + pathnames to be displayed incorrectly. + +p. Some changes to the `bg' builtin for POSIX conformance. + +q. The `fc' builtin now removes the `fc' command that caused it to invoke an + editor on specified history entries from the history entirely, rather than + simply ignoring it. + +r. When in POSIX mode, the `v' command in vi editing mode simply invokes vi + on the current command, rather than checking $FCEDIT and $EDITOR. + +s. Fixed a small memory leak in the pathname canonicalization code. + +t. Fixed a bug that caused the expanded value of a $'...' string to be + incorrectly re-quoted if it occurred within a double-quoted ${...} + parameter expansion. + +u. Restored default emacs-mode key binding of M-TAB to dynamic-complete-history. + +v. Fixed a bug that caused core dumps when interrupting loops running builtins + on some systems. + +w. Make sure that some of the functions bash provides replacements for are + not cpp defines. + +x. The code that scans embedded commands for the parser (`...` and $(...)) is + now more aware of embedded comments and their effect on quoted strings. + +y. Changed the `-n' option to the `history' builtin to not reset the number of + history lines read in the current session after reading the new lines from + the history file if the history is being appended when it is written to + the file, since the appending takes care of the problem that the adjustment + was intended to solve. + +z. Improved the error message displayed when a shell script fails to execute + because the environment and size of command line arguments are too large. + +aa. A small fix to make sure that $HISTCMD is evaluated whenever the shell is + saving commands to the history list, not just when HISTSIZE is defined. + +2. Changes to Readline + +a. The `change-case' command now correctly changes the case of multibyte + characters. + +b. Changes to the shared library construction scripts to deal with Windows + DLL naming conventions for Cygwin. + +c. Fixed the redisplay code to avoid core dumps resulting from a poorly-timed + SIGWINCH. + +d. Fixed the non-incremental search code in vi mode to dispose of any current + undo list when copying a line from the history into the current editing + buffer. + +e. The variable assignment code now ignores whitespace at the end of lines + when assigning to boolean variables. + +f. The `C-w' binding in incremental search now understands multibyte + characters. + +3. New Features in Bash + +a. A new configuration option, `--enable-strict-posix-default', which will + build bash to be POSIX conforming by default. + +4. New Features in Readline + +a. If the rl_completion_query_items is set to a value < 0, readline never + asks the user whether or not to view the possible completions. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-3.1-alpha1, +and the previous version, bash-3.0-release. + +1. Changes to Bash + +a. Fixed a bug that caused bash to crash if referencing an unset local array. + +b. Fixed a problem that caused tilde expansion to not be performed before + attempting globbing word completion. + +c. Fixed an incompatibility so that a first argument to trap that's a valid + signal number will be trated as a signal rather than a command to execute. + +d. Fixed ${#word} expansion to correctly compute the length of a string + containing multibyte characters. + +e. Fixed a bug that caused bash to not pass the correct flags for signal + disposition to child processes. + +f. Fixed a bug that caused `fc -l' to list one too many history entries. + +g. Some fixes to `fc' for POSIX conformance. + +h. Some fixes to job status display for POSIX conformance. + +i. Fixed a bug that caused `command -v' to display output if a command was not + found -- it should be silent. + +j. In POSIX mode, `type' and `command -[vV]' do not report non-executable + files, even if the shell will attempt to execute them. + +k. Fixed a bug that caused the `==' operator to the [[ command to not attempt + extended pattern matching. + +l. Fixed the brace expansion code to handle characters whose value exceeds 128. + +m. Fixed `printf' to handle strings with a leading `\0' whose length is + non-zero. + +n. Fixed a couple of problems with brace expansion where `${' was handled + incorrectly. + +o. Fixed off-by-one error when calculating the upper bound of `offset' when + processing the ${array[@]:offset:length} expansion. + +p. System-specific configuration changes for: FreeBSD 5.x, Interix, MacOS X + 10.4, Linux 2.4+ kernels, Linux 3.x kernels, Dragonfly BSD, QNX 6.x, + Cygwin + +q. Fixed a bug that caused the shell to ignore the status of the rightmost + command in a pipeline when the `pipefail' option was enabled. + +r. Fixed a completion bug that caused core dumps when expanding a directory + name. + +s. Fixed a bug that prevented `hash -d' from removing commands from the hash + table. + +t. Fixed word splitting to avoid really bad quadratic performance when + expanding long lists. + +u. Fixed a bug that caused negative offsets in substring expansion to use the + wrong values. + +v. Fixed a bug in printf that caused it to not return failure on write errors. + +w. Fixed a bug that caused commands in subshells to not be properly timed. + +x. The shell parser no longer attempts to parse a compound assignment specially + unless in a position where an assignment statement is acceptable or parsing + arguments to a builtin that accepts assignment statements. + +y. Fixed a problem that caused a `case' statement to be added to the history + incorrectly as a single command if the `case word' was on one line and the + `in' on another. + +z. Fixed a problem that caused internal shell quoting characters to be + incorrectly quoted with backslashes under some circumstances. + +aa. The shell now performs correct word splitting when IFS contains multibyte + characters. + +bb. The mail checking code now resets the cached file information if the size + drops to 0, even if the times don't change. + +cc. A completed command name that is found in $PATH as well as the name of a + directory in the current directory no longer has a slash appended in certain + circumstances: a single instance found in $PATH when `.' is not in $PATH, + and multiple instances found in $PATH, even when `.' is in $PATH. + +dd. Incorporated tilde expansion into the word expansion code rather than as a + separately-called function, fixing some cases where it was performed + inappropriately (e.g., after the second `=' in an assignment statement or + in a double-quoted parameter expansion). + +ee. Fixed several bugs encountered when parsing compound assignment statements, + so that compound assignments appearing as arguments to builtins are no + longer double-expanded. + +ff. Fixed a bug in the command execution code that caused asynchronous commands + containing command substitutions to not put the terminal in the wrong + process group. + +gg. Bash now handles the case where the WCONTINUED flag causes waitpid() to + return -1/EINVAL at runtime as well as configuration time. + +hh. Fixed parser to generate an error when the pipeline `argument' to `!' or + `time' is NULL. + +ii. The shell now takes a little more care when manipulating file descriptors + greater than 9 with the `exec' builtin. + +jj. Fixed a bug that caused variable assignments preceding the `command' builtin + preceding a special builtin to be preserved after the command completed in + POSIX mode. + +kk. Fixed a bug that allowed variables beginning with a digit to be created. + +ll. Fixed a bug that caused a \ to be removed when parsing a $'...' + construct. + +mm. A shell whose name begins with `-' will now be a restricted shell if the + remainder of the name indicates it should be restricted. + +nn. Fixed a bug that could cause a core dump if FUNCNAME were changed or unset + during a function's execution. + +oo. Fixed a bug that caused executing a `return' in a function to not execute + a RETURN trap. The RETURN trap is inherited by shell functions only if + function tracing is globally enabled or has been enabled for that function. + +pp. Fixed cases where var[@] was not handled exactly like var, when var is a + scalar variable. + +qq. Fixed a bug that caused the first character after a SIGINT to be discarded + under certain circumstances. + +rr. Fixed exit status code so that a suspended job returns 128+signal as its + exit status (preventing commands after it in `&&' lists from being + executed). + +ss. Fixed a bug that caused the shell parser state to be changed by executing + a shell function as a result of word completion. + +tt. Fixed a long-standing bug that caused '\177' characters in variable + values to be discarded when expanded in double-quoted strings. + +uu. Fixed a bug that caused $RANDOM to be re-seeded multiple times in a + subshell environment. + +vv. Extensive changes to the job management code to avoid the pid-reuse and + pid-aliasing problems caused by retaining the exit status of too many jobs, + but still retain as many background job statuses as POSIX requires. + +ww. Fixed a parser bug in processing \ that caused things like + + ((echo 5) \ + (echo 6)) + + to not work correctly. + +xx. `pwd -P' now sets $PWD to a directory name containing no symbolic links + when in posix mode, as POSIX requires. + +yy. In posix mode, bash no longer sets $PWD to a name containing no symbolic + links if a directory is chosen from $CDPATH. + +zz. The word splitting code now treats an IFS character that is not space, + tab, or newline and any adjacent IFS white space as a single delimiter, as + SUSv3/XPG6 require. + +aaa. The `read' builtin now checks whether or not the number of fields read is + exactly the same as the number of variables instead of just assigning the + rest of the line (minus any trailing IFS white space) to the last + variable. This is what POSIX/SUS/XPG all require. + +bbb. Fixed a bug that caused `read' to always check whether or not fd 0 was a + pipe, even when reading from another file descriptor. + +ccc. Fixed a bug that caused short-circuiting of execution even if the return + value was being inverted. + +ddd. Fixed a bug that caused a core dump while decoding \W escapes in PS1 if + PWD was unset. + +eee. Fixed a bug in `read' that counted internal quoting characters for the + purposes of `read -n'. + +fff. Fixed a bug so that a function definition in a pipeline causes a child + process to be forked at the right time. + +ggg. Bash will not attempt to link against a readline library that doesn't + have rl_gnu_readline_p == 1. + +hhh. Fixed a bug that caused `read' to consume one too many characters when + reading a fixed number of characters and the Nth character is a backslash. + +iii. Fixed a bug that caused `unset' on variables in the temporary environment + to leave them set when `unset' completed. + +jjj. Fixed a bug that caused bash to close fd 2 if an `exec' failed and the + shell didn't exit. + +kkk. The completion code is more careful to not turn `/' or `///' into `//', + for those systems on which `//' has special meaning. + +lll. Fixed a bug that caused command substitution in asynchronous commands to + close the wrong file descriptors. + +mmm. The shell no longer prints status messages about terminated background + processes unless job control is active. + +nnn. Fixed a bug that prevented multiple consecutive invocations of `history -s' + from adding all the commands to the history list. + +ooo. Added a couple of changes to make arithmetic expansion more consistent in + all its contexts (still not perfect). + +ppp. Fixed a bug that caused the parser to occasionally not find the right + terminating "`" in an old-style command substitution. + +qqq. Fixed a bug that caused core dumps when the shell was reading its non- + interactive input from fd 0 and fd 0 was duplicated and restored using a + combination of `exec' (to save) and redirection (to restore). + +rrr. Fixed a problem that caused loops in sourced scripts to not be cleaned + up properly when a `return' is executed. + +sss. Change internal command substitution completion function to append a slash + to directory names in the command. + +2. Changes to Readline + +a. Fixed a bug that caused multiliine prompts to be wrapped and displayed + incorrectly. + +b. Fixed a bug that caused ^P/^N in emacs mode to fail to display the current + line correctly. + +c. Fixed a problem in computing the number of invisible characters on the first + line of a prompt whose length exceeds the screen width. + +d. Fixed vi-mode searching so that failure preserves the current line rather + than the last line in the history list. + +e. Fixed the vi-mode `~' command (change-case) to have the correct behavior at + end-of-line when manipulating multibyte characters. + +f. Fixed the vi-mode `r' command (change-char) to have the correct behavior at + end-of-line when manipulating multibyte characters. + +g. Fixed multiple bugs in the redisplay of multibyte characters: displaying + prompts longer than the screen width containing multibyte characters, + +h. Fix the calculation of the number of physical characters in the prompt + string when it contains multibyte characters. + +i. A non-zero value for the `rl_complete_suppress_append' variable now causes + no `/' to be appended to a directory name. + +j. Fixed forward-word and backward-word to work when words contained + multibyte characters. + +k. Fixed a bug in finding the delimiter of a `?' substring when performing + history expansion in a locale that supports multibyte characters. + +l. Fixed a memory leak caused by not freeing the timestamp in a history entry. + +m. Fixed a bug that caused "\M-x" style key bindings to not obey the setting + of the `convert-meta' variable. + +n. Fixed saving and restoring primary prompt when prompting for incremental + and non-incremental searches; search prompts now display multibyte + characters correctly. + +o. Fixed a bug that caused keys originally bound to self-insert but shadowed + by a multi-character key sequence to not be inserted. + +p. Fixed code so rl_prep_term_function and rl_deprep_term_function aren't + dereferenced if NULL (matching the documentation). + +q. Extensive changes to readline to add enough state so that commands + requiring additional characters (searches, multi-key sequences, numeric + arguments, commands requiring an additional specifier character like + vi-mode change-char, etc.) work without synchronously waiting for + additional input. + +r. Lots of changes so readline builds and runs on MinGW. + +s. Readline no longer tries to modify the terminal settings when running in + callback mode. + +t. The Readline display code no longer sets the location of the last invisible + character in the prompt if the \[\] sequence is empty. + +3. New Features in Bash + +a. Bash now understands LC_TIME as a special variable so that time display + tracks the current locale. + +b. BASH_ARGC, BASH_ARGV, BASH_SOURCE, and BASH_LINENO are no longer created + as `invisible' variables and may not be unset. + +c. In POSIX mode, if `xpg_echo' option is enabled, the `echo' builtin doesn't + try to interpret any options at all, as POSIX requires. + +d. The `bg' builtin now accepts multiple arguments, as POSIX seems to specify. + +e. Fixed vi-mode word completion and glob expansion to perform tilde + expansion. + +f. The `**' mathematic exponentiation operator is now right-associative. + +g. The `ulimit' builtin has new options: -i (max number of pending signals), + -q (max size of POSIX message queues), and -x (max number of file locks). + +h. A bare `%' once again expands to the current job when used as a job + specifier. + +i. The `+=' assignment operator (append to the value of a string or array) is + now supported for assignment statements and arguments to builtin commands + that accept assignment statements. + +j. BASH_COMMAND now preserves its value when a DEBUG trap is executed. + +k. The `gnu_errfmt' option is enabled automatically if the shell is running + in an emacs terminal window. + +l. New configuration option: --single-help-strings. Causes long help text + to be written as a single string; intended to ease translation. + +m. The COMP_WORDBREAKS variable now causes the list of word break characters + to be emptied when the variable is unset. + +n. An unquoted expansion of $* when $IFS is empty now causes the positional + parameters to be concatenated if the expansion doesn't undergo word + splitting. + +o. Bash now inherits $_ from the environment if it appears there at startup. + +p. New shell option: nocasematch. If non-zero, shell pattern matching ignores + case when used by `case' and `[[' commands. + +q. The `printf' builtin takes a new option: -v var. That causes the output + to be placed into var instead of on stdout. + +r. By default, the shell no longer reports processes dying from SIGPIPE. + +s. Bash now sets the extern variable `environ' to the export environment it + creates, so C library functions that call getenv() (and can't use the + shell-provided replacement) get current values of environment variables. + +4. New Features in Readline + +a. The key sequence sent by the keypad `delete' key is now automatically + bound to delete-char. + +b. A negative argument to menu-complete now cycles backward through the + completion list. + +c. A new bindable readline variable: bind-tty-special-chars. If non-zero, + readline will bind the terminal special characters to their readline + equivalents when it's called (on by default). + +d. New bindable command: vi-rubout. Saves deleted text for possible + reinsertion, as with any vi-mode `text modification' command; `X' is bound + to this in vi command mode. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-3.0-release, +and the previous version, bash-3.0-rc1. + +1. Changes to Bash + +a. Fixed a boundary overrun that could cause segmentation faults when the + completion code hands an incomplete construct to the word expansion + functions. + +b. Changed posix mode behavior so that an error in a variable assignment + preceding a special builtin causes a non-interactive shell to exit. + +c. Change the directory expansion portion of the completion code to not + expand embedded command substitutions if the directory name appears in + the file system. + +d. Fixed a problem that caused `bash -r' to turn on restrictions before + reading the startup files. + +e. Fixed a problem with the default operation of the `umask' builtin. + +2. Changes to Readline + +a. Fixed a problem with readline saving the contents of the current line + before beginning a non-interactive search. + +b. Fixed a problem with EOF detection when using rl_event_hook. + +c. Fixed a problem with the vi mode `p' and `P' commands ignoring numeric + arguments. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-3.0-rc1, +and the previous version, bash-3.0-beta1. + +1. Changes to Bash + +a. Fixed a bug that caused incorrect behavior when referecing element 0 of + an array using $array, element 0 was unset, and `set -u' was enabled. + +b. System-specific changes for: SCO Unix 3.2, Tandem. + +c. Fixed a bug that caused inappropriate word splitting when a variable was + expanded within a double-quoted string that also included $@. + +d. Fixed a bug that caused `pwd' to not display anything in physical mode + when the file system had changed underneath the shell. + +e. Fixed a bug in the pre- and post- increment and decrement parsing in the + expression evaluator that caused errors when the operands and corresponding + operators were separated by whitespace. + +f. Fixed a bug that caused `history -p' to add an entry to the history list, + counter to the documentation. (Keeps the history expansions invoked by + emacs-mode command line editing from doing that as well.) + +g. Fixed a bug that could cause a core dump if `cd' is asked to print out a + pathname longer than PATH_MAX characters. + +h. Fixed a bug that caused jobs to be put into the wrong process group under + some circumstances after enabling job control with `set -m'. + +i. `unalias' now returns failure if no alias name arguments are supplied. + +j. Documented the characters not allowed to appear in an alias name. + +k. $* is no longer expanded as if in double quotes when it appears in the + body of a here document, as the SUS seems to require. + +l. The `bashbug' script now uses a directory in $TMPDIR for exclusive + access rather than trying to guess how the underlying OS provides for + secure temporary file creation. + +m. Fixed a few problems with `cd' and `pwd' when asked to operate on pathnames + longer than PATH_MAX characters. + +n. Fixed a memory leak caused when creating multiple local array variables + with identical names. + +o. Fixed a problem with calls to getcwd() so that bash now operates better + when the full pathname to the current directory is longer than PATH_MAX + bytes. + +p. The `trap' builtin now reports an error if a single non-signal argument + is specified. + +q. Fixed a bug that caused `umask' to not work correctly when presented + with a mask of all 0s. + +r. When `getopts' reaches the end of options, OPTARG is unset, as POSIX + appears to specify. + +s. Interactive mode now depends on whether or not stdin and stderr are + connected to a tty; formerly it was stdin and stdout. POSIX requires + this. + +t. Fixed vi-mode completion to work more as POSIX specifies (e.g., doing the + right kind of filename generation). + +2. Changes to Readline + +a. Fixed a problem that could cause readline to refer to freed memory when + moving between history lines while doing searches. + +b. Improvements to the code that expands and displays prompt strings + containing multibyte characters. + +c. Fixed a problem with vi-mode not correctly remembering the numeric argument + to the last `c'hange command for later use with `.'. + +d. Fixed a bug in vi-mode that caused multi-digit count arguments to work + incorrectly. + +e. Fixed a problem in vi-mode that caused the last text modification command + to not be remembered across different command lines. + +f. Fixed problems with changing characters and changing case at the end of + the line. + +3. New Features in Bash + +a. The `jobs', `kill', and `wait' builtins now accept job control notation + even if job control is not enabled. + +b. The historical behavior of `trap' that allows a missing `action' argument + to cause each specified signal's handling to be reset to its default is + now only supported when `trap' is given a single non-option argument. + +4. New Features in Readline + +a. When listing completions, directories have a `/' appended if the + `mark-directories' option has been enabled. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-3.0-beta1, +and the previous version, bash-3.0-alpha. + +1. Changes to Bash + +a. Fixes to build correctly when arrays are not compiled into the shell. + +b. Fixed command substitution to run any exit trap defined in the command + substitution before returning; the exit trap is not inherited from the + calling shell. + +c. Fixes to process group synchronization code so that every child process + attempts to set the terminal's process group; fixes some synchronization + problems on Linux kernels that schedule the child to always run before + the parent. + +d. Fixed processing of octal and hex constants in printf builtin for POSIX.2 + compliance. + +e. Fixed a couple of core dumps in the pattern removal code. + +f. Fixes to the array subrange extraction code to deal better with sparse + arrays. + +g. Parser errors and other errors that result in the shell exiting now cause + the exit trap to be run. + +h. Change the command substitution completion functions to not append any + closing quote, because it would be inserted a closing "`" or ")". + +i. Fix history initialization so assignments to $histchars made in startup + files are honored. + +j. If an exit trap does not contain a call to `exit', the shell now uses + the exit status of the last command executed before the trap as the exit + status of the shell. + +k. The parser now prompts with $PS2 if it reads a newline while parsing a + compound array assignment statement. + +l. When performing a compound array assignment, the parser doesn't treat + words of the form [index]=value as assignments if they're the result of + expansions. + +m. Fixed a bug that caused `return' executed in a trap command to make the + shell think it was still running the trap. + +n. Fixed the value of errno set by the pathname canonicalization functions. + +o. Changed the grammar so that `time' alone on a line times a null command + rather than being a syntax error. + +p. The pattern substitution code no longer performs quote removal on the + pattern before trying to match it, as the pattern removal functions do. + +q. Fixed a bug that could cause core dumps when checking whether a quoted + command name was being completed. + +r. Fixes to the pattern removal and pattern replacement expansions to deal + with multibyte characters better (and faster). + +s. Fix to the substring expansion (${param:off[:len]}) to deal with (possibly + multibyte) characters instead of raw bytes. + +t. Fixed a bug that caused some key bindings set in an inputrc to be ignored + at shell startup. + +u. Fixed a bug that caused unsetting a local variable within a function to + not work correctly. + +v. Fixed a bug that caused invalid variables to be created when using + `read -a'. + +w. Fixed a bug that caused "$@" to expand incorrectly when used as the right + hand side of a parameter expansion such as ${word:="$@"} if the first + character of $IFS was not a space. + +x. Fixed a slight cosmetic problem when printing commands containing a + `>&word' redirection. + +y. Fixed a problem that could cause here documents to not be created correctly + if the system temporary directory did not allow writing. + +2. Changes to Readline + +a. Change to history expansion functions to treat `^' as equivalent to word + one, as the documention states. + +b. Some changes to the display code to improve display and redisplay of + multibyte characters. + +c. Changes to speed up the multibyte character redisplay code. + +d. Fixed a bug in the vi-mode `E' command that caused it to skip over the + last character of a word if invoked while point was on the word's + next-to-last character. + +e. Fixed a bug that could cause incorrect filename quoting when + case-insensitive completion was enabled and the word being completed + contained backslashes quoting word break characters. + +f. Fixed a bug in redisplay triggered when the prompt string contains + invisible characters. + +g. Fixed some display (and other) bugs encountered in multibyte locales + when a non-ascii character was the last character on a line. + +h. Fixed some display bugs caused by multibyte characters in prompt strings. + +i. Fixed a problem with history expansion caused by non-whitespace characters + used as history word delimiters. + +3. New Features in Bash + +a. printf builtin understands two new escape sequences: \" and \?. + +b. `echo -e' understands two new escape sequences: \" and \?. + +c. The GNU `gettext' package and libintl have been integrated; the shell's + messages can be translated into different languages. + +d. The `\W' prompt expansion now abbreviates $HOME as `~', like `\w'. + +e. The error message printed when bash cannot open a shell script supplied + as argument 1 now includes the name of the shell, to better identify + the error as coming from bash. + +4. New Features in Readline + +a. New application variable, rl_completion_quote_character, set to any + quote character readline finds before it calls the application completion + function. + +b. New application variable, rl_completion_suppress_quote, settable by an + application completion function. If set to non-zero, readline does not + attempt to append a closing quote to a completed word. + +c. New application variable, rl_completion_found_quote, set to a non-zero + value if readline determines that the word to be completed is quoted. + Set before readline calls any application completion function. + +d. New function hook, rl_completion_word_break_hook, called when readline + needs to break a line into words when completion is attempted. Allows + the word break characters to vary based on position in the line. + +e. New bindable command: unix-filename-rubout. Does the same thing as + unix-word-rubout, but adds `/' to the set of word delimiters. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-3.0-alpha, +and the previous version, bash-2.05b-release. + +1. Changes to Bash + +a. Fixes so that the shell will compile without some of the default options + defined. + +b. Fixed an error message that did not pass enough arguments to printf. + +c. Fixed a bug that caused input redirection to a builtin inside a script + being read from standard input to result in the rest of the already- + read and buffered script to be discarded. + +d. Fixed a bug that caused subshell initialization to close the file + descriptor from which the shell was reading a script under certain + circumstances. + +e. Fixed a bug that caused the shell to not advance a string pointer over + a null wide character when doing string operations. + +f. Fixed the internal logout code so that shells that time out waiting for + input (using $TMOUT) run ~/.bash_logout. + +g. Portability and configuration changes for: cygwin, HP/UX, GNU/FreeBSD. + +h. The parser no longer adds implicit double quotes to ((...)) arithmetic + commands. + +i. The ((...)) arithmetic command evaluation code was fixed to not dump core + when the expanded string is null. + +j. The ((...)) arithmetic command evaluation code was fixed to not perform + variable assignments while expanding the expression. + +k. Fixed a bug that caused word splitting to be performed incorrectly when + IFS is set, but null. + +l. Fixed a bug in brace expansion that caused a quoted `$' preceding an + open brace to inhibit brace expansion. + +m. Fixed a bug that caused a leading `-' in the shell's name to cause it to + not be recognized as a restricted shell. + +n. Fixed a bug in the arithmetic evaluation code that could cause longjmps + to an invalid location and result in a core dump. + +o. Fixed a bug in the calculation of how many history lines are new in a + single shell session when reading new history lines from a file with + `history -n'. + +p. Fixed a bug in pathname canonicalization that caused the shell to dump + core when presented with a pathname longer than PATH_MAX. + +q. Fixed the parser so that it doesn't try to compare a char variable to + EOF, which fails when chars are unsigned. + +r. Fixed a bug in the simple command execution code that caused occasional + core dumps. + +s. The shell does a better job of saving any partial parsing state during + operations which cause a command to be executed while a line is being + entered and parsed. + +t. The completion code now splits words more like the expansion code when + $IFS is used to split. + +u. The locale code does a better job of recomputing the various locale + variable values when LC_ALL is unset. + +v. The programmable completion code does a better job of dequoting expanded + word lists before comparing them against the word to be matched. + +w. The shell no longer seg faults if the expanded value of $PS4 is null + and `set -x' is enabled. + +x. Fixed a bug that caused core dumps when a here string expanded to NULL. + +y. The mail checking code now makes sure the mailbox is bigger before + reporting the existence of new mail. + +z. The parser does not try to expand $'...' and $"..." when the appear + within double quotes unless the `extquote' option has been enabled with + `shopt'. For backwards compatibility, it is enabled by default. + +aa. Fixed a bug that caused `for x; do ...' and `select x; do ... to use + $@ instead of "$@" for the implicit list of arguments. + +bb. Fixed a bug that caused a subshell of a restricted shell (e.g., one + spawned to execute a pipeline) to not exit immediately if attempting + to use a command containing a slash. + +cc. Fixed a problem with empty replacements for a pattern that doesn't match + when performing ${param/word/} expansion. + +dd. Word expansions performed while expanding redirections no longer search + a command's temporary environment to expand variable values. + +ee. Improvements to the alias expansion code when expanding subsequent words + because an aliase's value ends with a space. + +ff. `cd -' now prints the current working directory after a successful chdir + even when the shell is not interactive, as the standard requires. + +gg. The shell does a better job of ensuring a child process dies of SIGINT + before resending SIGINT to itself. + +hh. The arithmetic expansion variable assignment code now does the right + thing when assigning to `special' variables like OPTIND. + +ii. When history expansion verification is enabled, the bash readline helper + functions that do history expansion on the current line don't print + the results. + +jj. Fixed bugs with multiple consecutive alias expansion when one of the + expansions ends with a space. + +kk. Fixed a problem in the programmable completion code that could cause core + dumps when trying to initialize a set of possible completions from a + list of variables. + +ll. The \[ and \] escape characters are now ignored when decoding the prompt + string if the shell is started with editing disabled. + +mm. Fixed a bug that could leave extra characters in a string when doing + quoted null character removal. + +nn. Command substitution and other subshell operations no longer reset the + line number (aids the bash debugger). + +oo. Better line number management when executing simple commands, conditional + commands, for commands, and select commands. + +pp. The globbing code now uses malloc, with its better failure properties, + rather than alloca(). + +qq. Fixed a bug that caused expansions like #{a[2]:=value} to create the + appropriate array element instead of a variable named `a[2]'. + +rr. Fixed a bug in the handling of a `?(...)' pattern immediately following + a `*' when extglob is enabled. + +ss. Fixed a bug that caused a `return' invoked in an exit trap when exit is + invoked in a function to misbehave. + +tt. Fixed a bug that caused CTLESC and CTLNUL characters to not be escaped + by the internal shell string quoting functions. + +uu. Fixed a bug that caused quoted null characters in an expanded word list + to be inappropriately assigned to an array variable when using `read -a'. + +vv. Fixed a bug that caused redirections accompanying a null command to persist + in the current shell. + +ww. Fixed a bug that caused the prompt to be printed when the shell was + expanding a multiline alias. + +xx. Fixed a bug that resulted in core dumps when the completion for a command + changed the compspec. + +yy. Fixed a bug that caused evaluation of programmable completions to print + notifications of completed jobs. + +zz. Bash now disables line editing when $EMACS == `t' and $TERM == `dumb' + (which is what emacs shell windows do). + +aaa. In posix mode, `kill -l' causes signal names to be displayed without + a leading `SIG'. + +bbb. Clear error flag on standard output so it doesn't persist across multiple + builtin commands. + +ccc. In posix mode, `alias' displays alias values without the leading `alias', + so the output cannot be used as subsequent input. + +ddd. In posix mode, the `trap' builtin doesn't check whether or not its + first argument is a signal specification and revert the signal handling + to its original disposition if it is. + +eee. Fixed several bugs in the handling of "$*" and "${array[*]}" by the + pattern substitution and removal expansions. + +fff. Fixed several problems with the handling of ${array[@]}, ${array[*]}, + $@, and $* by the indirect variable expansion code. + +ggg. Fixed a bug that did not allow `time' to be aliased. + +hhh. Improved the mail checking code so it won't check (and possibly cause an + NFS file system mount) until MAILPATH or MAIL is given a value -- there + is no default if DEFAULT_MAIL_DIRECTORY is not defined at compile time. + (It is computed by configure, but can be #undef'd in config-bot.h.) + +iii. If the `chkwinsize' option is enabled, the shell checks for window size + changes if a child process exits due to a signal. + +jjj. Removed the attempts to avoid adding a slash at the end of a completed + executable name if there was a directory with the same name in the + current directory. + +kkk. Fixed PATH lookup code so it treats the permission bits separately for + owner, group, and other, rather than checking them all. + +lll. Fixed the locale code to reset the parser's idea of the character class + , which controls how it splits tokens, when the locale changes. + +mmm. The shell now binds its special readline functions and key bindings only + if the user's inputrc file has not already bound them. + +nnn. The shell now reports on processes that dump core due to signals when + invoked as `-c command'. + +2. Changes to Readline + +a. Fixes to avoid core dumps because of null pointer references in the + multibyte character code. + +b. Fix to avoid infinite recursion caused by certain key combinations. + +c. Fixed a bug that caused the vi-mode `last command' to be set incorrectly. + +d. Readline no longer tries to read ahead more than one line of input, even + when more is available. + +e. Fixed the code that adjusts the point to not mishandle null wide + characters. + +f. Fixed a bug in the history expansion `g' modifier that caused it to skip + every other match. + +g. Fixed a bug that caused the prompt to overwrite previous output when the + output doesn't contain a newline and the locale supports multibyte + characters. This same change fixes the problem of readline redisplay + slowing down dramatically as the line gets longer in multibyte locales. + +h. History traversal with arrow keys in vi insertion mode causes the cursor + to be placed at the end of the new line, like in emacs mode. + +i. The locale initialization code does a better job of using the right + precedence and defaulting when checking the appropriate environment + variables. + +j. Fixed the history word tokenizer to handle <( and >( better when used as + part of bash. + +k. The overwrite mode code received several bug fixes to improve undo. + +l. Many speedups to the multibyte character redisplay code. + +m. The callback character reading interface should not hang waiting to read + keyboard input. + +n. Fixed a bug with redoing vi-mode `s' command. + +o. The code that initializes the terminal tracks changes made to the terminal + special characters with stty(1) (or equivalent), so that these changes + are reflected in the readline bindings. New application-callable function + to make it work: rl_tty_unset_default_bindings(). + +p. Fixed a bug that could cause garbage to be inserted in the buffer when + changing character case in vi mode when using a multibyte locale. + +q. Fixed a bug in the redisplay code that caused problems on systems + supporting multibyte characters when moving between history lines when the + new line has more glyphs but fewer bytes. + +r. Undo and redo now work better after exiting vi insertion mode. + +s. Make sure system calls are restarted after a SIGWINCH is received using + SA_RESTART. + +t. Improvements to the code that displays possible completions when using + multibyte characters. + +u. Fixed a problem when parsing nested if statements in inputrc files. + +v. The completer now takes multibyte characters into account when looking for + quoted substrings on which to perform completion. + +w. The history search functions now perform better bounds checking on the + history list. + +3. New Features in Bash + +a. ANSI string expansion now implements the \x{hexdigits} escape. + +b. There is a new loadable `strftime' builtin. + +c. New variable, COMP_WORDBREAKS, which controls the readline completer's + idea of word break characters. + +d. The `type' builtin no longer reports on aliases unless alias expansion + will actually be performed. + +e. HISTCONTROL is now a colon-separated list of values, which permits + more extensibility and backwards compatibility. + +f. HISTCONTROL may now include the `erasedups' option, which causes all lines + matching a line being added to be removed from the history list. + +g. `configure' has a new `--enable-multibyte' argument that permits multibyte + character support to be disabled even on systems that support it. + +h. New variables to support the bash debugger: BASH_ARGC, BASH_ARGV, + BASH_SOURCE, BASH_LINENO, BASH_SUBSHELL, BASH_EXECUTION_STRING, + BASH_COMMAND + +i. FUNCNAME has been changed to support the debugger: it's now an array + variable. + +j. for, case, select, arithmetic commands now keep line number information + for the debugger. + +k. There is a new `RETURN' trap executed when a function or sourced script + returns (not inherited child processes; inherited by command substitution + if function tracing is enabled and the debugger is active). + +l. New invocation option: --debugger. Enables debugging and turns on new + `extdebug' shell option. + +m. New `functrace' and `errtrace' options to `set -o' cause DEBUG and ERR + traps, respectively, to be inherited by shell functions. Equivalent to + `set -T' and `set -E' respectively. The `functrace' option also controls + whether or not the DEBUG trap is inherited by sourced scripts. + +n. The DEBUG trap is run before binding the variable and running the action + list in a `for' command, binding the selection variable and running the + query in a `select' command, and before attempting a match in a `case' + command. + +o. New `--enable-debugger' option to `configure' to compile in the debugger + support code. + +p. `declare -F' now prints out extra line number and source file information + if the `extdebug' option is set. + +q. If `extdebug' is enabled, a non-zero return value from a DEBUG trap causes + the next command to be skipped, and a return value of 2 while in a + function or sourced script forces a `return'. + +r. New `caller' builtin to provide a call stack for the bash debugger. + +s. The DEBUG trap is run just before the first command in a function body is + executed, for the debugger. + +t. `for', `select', and `case' command heads are printed when `set -x' is + enabled. + +u. There is a new {x..y} brace expansion, which is shorthand for {x.x+1, + x+2,...,y}. x and y can be integers or single characters; the sequence + may ascend or descend; the increment is always 1. + +v. New ksh93-like ${!array[@]} expansion, expands to all the keys (indices) + of array. + +w. New `force_fignore' shopt option; if enabled, suffixes specified by + FIGNORE cause words to be ignored when performing word completion even + if they're the only possibilities. + +x. New `gnu_errfmt' shopt option; if enabled, error messages follow the `gnu + style' (filename:lineno:message) format. + +y. New `-o bashdefault' option to complete and compgen; if set, causes the + whole set of bash completions to be performed if the compspec doesn't + result in a match. + +z. New `-o plusdirs' option to complete and compgen; if set, causes directory + name completion to be performed and the results added to the rest of the + possible completions. + +aa. `kill' is available as a builtin even when the shell is built without + job control. + +bb. New HISTTIMEFORMAT variable; value is a format string to pass to + strftime(3). If set and not null, the `history' builtin prints out + timestamp information according to the specified format when displaying + history entries. If set, bash tells the history library to write out + timestamp information when the history file is written. + +cc. The [[ ... ]] command has a new binary `=~' operator that performs + extended regular expression (egrep-like) matching. + +dd. `configure' has a new `--enable-cond-regexp' option (enabled by default) + to enable the =~ operator and regexp matching in [[ ... ]]. + +ee. Subexpressions matched by the =~ operator are placed in the new + BASH_REMATCH array variable. + +ff. New `failglob' option that causes an expansion error when pathname + expansion fails to produce a match. + +gg. New `set -o pipefail' option that causes a pipeline to return a failure + status if any of the processes in the pipeline fail, not just the last + one. + +4. New Features in Readline + +a. History expansion has a new `a' modifier equivalent to the `g' modifier + for compatibility with the BSD csh. + +b. History expansion has a new `G' modifier equivalent to the BSD csh `g' + modifier, which performs a substitution once per word. + +c. All non-incremental search operations may now undo the operation of + replacing the current line with the history line. + +d. The text inserted by an `a' command in vi mode can be reinserted with + `.'. + +e. New bindable variable, `show-all-if-unmodified'. If set, the readline + completer will list possible completions immediately if there is more + than one completion and partial completion cannot be performed. + +f. There is a new application-callable `free_history_entry()' function. + +g. History list entries now contain timestamp information; the history file + functions know how to read and write timestamp information associated + with each entry. + +h. Four new key binding functions have been added: + + rl_bind_key_if_unbound() + rl_bind_key_if_unbound_in_map() + rl_bind_keyseq_if_unbound() + rl_bind_keyseq_if_unbound_in_map() + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.05b-release, +and the previous version, bash-2.05b-beta2. + +1. Changes to Bash + +a. Fixed an off-by-one error in the function that translates job + specifications. + +b. Note that we're running under Emacs and disable line editing if + $EMACS == `t'. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.05b-beta2, +and the previous version, bash-2.05b-beta1. + +1. Changes to Bash + +a. Fixed the /= and %= arithmetic operators to catch division by zero. + +b. Added putenv, setenv, unsetenv to getenv replacement for completeness. + +c. Fixed a bug that could cause the -O expand_aliases invocation option + to not take effect. + +d. Fixed a problem with process substitution that resulted in incorrect + behavior when the number of process substitutions in an individual + command approached 64. + +2. Changes to Readline + +a. Fixed a problem with backward-char-search when on a system with support + for multibyte characters when running in a locale without any multibyte + characters. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.05b-beta1, +and the previous version, bash-2.05b-alpha1. + +1. Changes to Bash + +a. Fixed a problem when parsing a POSIX.2 character class name while + evaluating a bracket expression containing multibyte characters. + +b. Changed the help text for `bind' to make it clear that any command + that may be placed in ~/.inputrc is a valid argument to `bind'. + +c. Added `help' builtin entries for `((', `[[', and arithmetic for. + +d. malloc updated again: + o slightly better overflow and underflow detection by putting the + chunk size at the beginning and end of the chunk and making + sure they match in free/realloc + o partial page allocated to make things page-aligned no longer + completely wasted + o block coalescing now enabled by default + o splitting and coalescing enabled for 32-byte chunks, the most + common size requested + o fixed a problem that resulted in spurious underflow messages and + aborts + o bin sizes are precomputed and stored in an array rather than + being computed at run time + o malloc will return memory blocks back to the system if the block + being freed is at the top of the heap and of sufficient size to + make it worthwhile + o malloc/free/realloc now inline memset instead of calling the + libc function; uses Duff's device for good performance + +e. Check for getservent(); make the service name completion code dependent + on its presence. + +f. Changed the readline callback that executes a command bound to a key + sequence to not save the executed command on the history list and to + save and restore the parsing state. + +g. Changes to lib/sh/snprintf.c: fixed some bugs in the `g' and `G' + floating point format display; implemented the "'" flag character + that turns on thousands' grouping; fixed behavior on systems where + MB_CUR_MAX does not evaluate to a constant. + +h. The `unset' builtin no longer returns a failure status when asked to + unset a previously-unset variable or function. + +i. Changes to the build system to make it easier to cross-compile bash + for different systems. + +j. Added `,' to the characters that are backslash-escaped during filename + completion, to avoid problems with complete-into-braces and RCS filenames + containing commas. + +k. Some changes to the multibyte character support code to avoid many calls + to strlen(). + +l. Bash now correctly honors setting LANG to some value when LC_ALL does not + already have a value. + +m. Fixed a bug that could cause SIGSEGV when processing nested traps with + trap handlers. + +n. The `source/.' builtin now restores the positional parameters when it + returns unless they were changed using the `set' builtin during the file's + execution. + +o. Fixed a bug that caused a syntax error when a command was terminated by + EOF. + +2. New Features in Bash + +a. There is now support for placing the long help text into separate files + installed into ${datadir}/bash. Not enabled by default; can be turned + on with `--enable-separate-helpfiles' option to configure. + +b. All builtins that take operands accept a `--' pseudo-option, except + `echo'. + +c. The `echo' builtin now accepts \0xxx (zero to three octal digits following + the `0') in addition to \xxx (one to three octal digits) for SUSv3/XPG6/ + POSIX.1-2001 compliance. + +3. Changes to Readline + +a. Fixed a small problem in _rl_insert_char with multibyte characters. + +b. Fixes from IBM for line wrapping problems when using multibyte characters. + +c. Fixed a problem which caused the display to be messed up when the last + line of a multi-line prompt (possibly containing invisible characters) + was longer than the screen width. + +d. Fixed a problem with the vi-mode `r' command that ocurred on systems with + support for multibyte characters when running in a locale without any + multibyte characters. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.05b-alpha1, +and the previous version, bash-2.05a-release. + +1. Changes to Bash + +a. Some changes to work around inlining differences between compilers. + +b. Added more prototypes for internal shell typedefs, to catch argument + passing errors when using pointers to functions. + +c. The `cd' builtin now fails in posix mode when a valid directory cannot be + constructed from a relative pathname argument and the $PWD using pathname + canonicalization, and the -P option has not been supplied. Previously, + the shell would attempt to use what the user typed, leading to weird + values for $PWD and discrepancies between the value of $PWD and the + actual working directory. + +d. The `cd' builtin now resets $PWD when canonicalization fails but a chdir + to the pathname passed as an argument succeeds (when not in posix mode). + +e. The `fc' builtin has been fixed, as POSIX requires, to use the closest + history position in range when given an out-of-range argument. + +f. The history file loading code was changed to allow lines to be saved in + the history list from the shell startup files. + +g. `history -s args' now works better in compound commands. + +h. The tilde expansion code was fixed to better recognize when it's being + invoked in an assignment context, which enables expansion after `=' + and `:'. + +i. Fixed the command name completion code so a slash is no longer appended + to a single match if there happens to be a directory with that name in + $PWD. + +j. Fixed compound array assignment to no longer perform alias expansion, to + allow reserved words as array members, and to not produce extra output + when the `-v' option had been enabled. + +k. Fixed the programmable completion code to better handle newlines in lists + of possible completions (e.g., `complete -W'). + +l. Removed the reserved words from the `bash-builtins' manual page. + +m. Parser error reporting now attempts to do a better job of identifying the + token in error rather than doing straight textual analysis. + +n. Fixes for Inf/NaN, locales, wide/multibyte characters and zero-length + arguments in the library snprintf(3) replacement. + +o. `read -e' no longer does command name completion on the first word on + the line being read. + +p. `select' now returns failure if the read of the user's selection fails. + +q. Fixed a bug that could cause a core dump when setting $PIPESTATUS. + +r. Fixes to not allocate so many job slots when the shell is running a loop + with job control enabled in a subshell of an interactive shell. + +s. Fixed a bug in the trap code that caused traps to be inherited by + command substitutions in some cases. + +t. Fixed a bug that could cause alias expansion to inappropriately expand + the word following the alias. + +u. Fixed a bug in the `kill' builtin that mishandled negative pid arguments. + +v. The parser is less lenient when parsing assignment statements where the + characters before the `=' don't comprise a valid identifier. + +w. The arithmetic expression evaluation code now honors the setting of the + `-u' option when expanding variable names. + +x. Fixed the arithmetic evaluation code to allow array subscripts to be + assigned (`let b[7]=42') and auto-incremented and auto-decremented + (e.g., b[7]++). + +y. Reimplemented the existing prompt string date and time expansions using + strftime(3), which changed the output of \@ in some locales. + +z. Fixed a bug that could cause a core dump when a special shell variable + (like RANDOM) was converted to an array with a variable assignment. + +aa. Fixed a bug that would reset the handler for a signal the user had + trapped to a function that would exit the shell when setting the exit + trap in a non-interactive shell. + +bb. Changed the execve(2) wrapper code to check whether or not a failing + command is a directory before looking at whether a `#!' interpreter + failed for some reason. + +cc. Fixed a bug in the command printing code so it no longer inserts a `;' + after a newline, which produces a syntax error when reused as input. + +dd. The code that expands $PS4 no longer inherits the `-x' flag. + +ee. The bash-specific completion functions may now take advantage of the + double-TAB and M-? features of the standard readline completion + functions. + +ff. The mail checking code no longer prints a message if the checked file's + size has not increased, even if the access time is less than the modification time. + +gg. Rewrote the variable symbol table code: there is now a stack of + contexts, each possibly including a separate symbol table; there can + be more than one temporary environment supplied to nested invocations + of `./source'; the temporary environments no longer require so much + special-case code; shell functions now handle the temporary environment + and local variables more consistently; function scope exit is faster now + that the entire symbol table does not have to be traversed to dispose of + local variables; it is now easier to push vars from the temporary + environment to the shell's variable table in posix mode; some duplicated + code has been removed. + +hh. Regularized the error message printing code; builtin_error is now called + more consistently, and common error message strings are handled by small + functions. This should make eventual message translation easier. + +ii. Error messages now include the line number in a script when the shell + is not interactive. + +jj. Array subscript expansion now takes place even when the array variable is + unset, so side effects will take place. + +kk. Fixed a bug in the SICGHLD child-reaping code so that it won't find + jobs already marked as terminated if the OS reuses pids quickly enough. + +ll. Fixed a bug that could cause a signal to not interrupt the `wait' + builtin while it was waiting for a background process to terminate. + +mm. A couple of changes to make it easier for multiple shells to share history + files using `history -n', `history -r', and `history -w'. + +nn. The `getopts' builtin always increments OPTIND to point to the next + option to be handled when an option is returned, whether it's valid + or not, as POSIX 1003.x-2001 requires. + +oo. Changed some parts of the expansion code to avoid allocating and + immediately freeing memory without using the results for anything. + +pp. The shell now keeps track of $IFS internally, updating its internal map + each time the variable is assigned a new value (or at local scope exit). + This saves thousands of hash lookups for IFS, which, while individually + cheap, add up. + +qq. Rewrote the hash table code: searching and insertion are much faster now, + and it uses a better string hashing function; augmented the function + interface to simplify other parts of the code and remove duplicated code + +rr. The shell now uses a simple, generic `object cache' for allocating and + caching words and word lists, which were the major users of + malloc/free. + +ss. Fixed the assignment statement parsing code to allow whitespace and + newlines in subscripts when performing array element assignment. + +tt. The shell now issues many fewer calls to sigprocmask and other signal + masking system calls. + +uu. Fixed the `test' and conditional command file comparison operators to + work right when one file has a non-positive timestamp and the other + does not exist. + +vv. Fixed some cases where the special characters '\001' and '\177' in the + values of variables or positional parameters caused incorrect expansion + results. + +2. Changes to Readline + +a. Fixed output of comment-begin character when listing variable values. + +b. Added some default key bindings for common escape sequences produced by + HOME and END keys. + +c. Fixed the mark handling code to be more emacs-compatible. + +d. A bug was fixed in the code that prints possible completions to keep it + from printing empty strings in certain circumstances. + +e. Change the key sequence printing code to print ESC as M\- if ESC is a + meta-prefix character -- it's easier for users to understand than \e. + +f. Fixed unstifle_history() to return values that match the documentation. + +g. Fixed the event loop (rl_event_hook) to handle the case where the input + file descriptor is invalidated. + +h. Fixed the prompt display code to work better when the application has a + custom redisplay function. + +i. Changes to make reading and writing the history file a little faster, and + to cope with huge history files without calling abort(3) from xmalloc. + +j. The vi-mode `S' and `s' commands are now undone correctly. + +3. New Features in Bash + +a. If set, TMOUT is the default timeout for the `read' builtin. + +b. `type' has two new options: `-f' suppresses shell function lookup, and + `-P' forces a $PATH search. + +c. New code to handle multibyte characters. + +d. `select' was changed to be more ksh-compatible, in that the menu is + reprinted each time through the loop only if REPLY is set to NULL. + The previous behavior is available as a compile-time option. + +e. `complete -d' and `complete -o dirnames' now force a slash to be + appended to names which are symlinks to directories. + +f. There is now a bindable edit-and-execute-command readline command, + like the vi-mode `v' command, bound to C-xC-e in emacs mode. + +g. Added support for ksh93-like [:word:] character class in pattern matching. + +h. The $'...' quoting construct now expands \cX to Control-X. + +i. A new \D{...} prompt expansion; passes the `...' to strftime and inserts + the result into the expanded prompt. + +j. The shell now performs arithmetic in the largest integer size the + machine supports (intmax_t), instead of long. + +k. If a numeric argument is supplied to one of the bash globbing completion + functions, a `*' is appended to the word before expansion is attempted. + +l. The bash globbing completion functions now allow completions to be listed + with double tabs or if `show-all-if-ambiguous' is set. + +m. New `-o nospace' option for `complete' and `compgen' builtins; suppresses + readline's appending a space to the completed word. + +n. New `here-string' redirection operator: <<< word. + +o. When displaying variables, function attributes and definitions are shown + separately, allowing them to be re-used as input (attempting to re-use + the old output would result in syntax errors). + +p. There is a new configuration option `--enable-mem-scramble', controls + bash malloc behavior of writing garbage characters into memory at + allocation and free time. + +q. The `complete' and `compgen' builtins now have a new `-s/-A service' + option to complete on names from /etc/services. + +r. `read' has a new `-u fd' option to read from a specified file descriptor. + +s. Fix the completion code so that expansion errors in a directory name + don't cause a longjmp back to the command loop. + +t. Fixed word completion inside command substitution to work a little more + intuitively. + +u. The `printf' %q format specifier now uses $'...' quoting to print the + argument if it contains non-printing characters. + +v. The `declare' and `typeset' builtins have a new `-t' option. When applied + to functions, it causes the DEBUG trap to be inherited by the named + function. Currently has no effect on variables. + +w. The DEBUG trap is now run *before* simple commands, ((...)) commands, + [[...]] conditional commands, and for ((...)) loops. + +x. The expansion of $LINENO inside a shell function is only relative to the + function start if the shell is interactive -- if the shell is running a + script, $LINENO expands to the line number in the script. This is as + POSIX-2001 requires. + +y. The bash debugger in examples/bashdb has been modified to work with the + new DEBUG trap semantics, the command set has been made more gdb-like, + and the changes to $LINENO make debugging functions work better. Code + from Gary Vaughan. + +z. New [n]<&word- and [n]>&word- redirections from ksh93 -- move fds (dup + and close). + +aa. There is a new `-l' invocation option, equivalent to `--login'. + +bb. The `hash' builtin has a new `-l' option to list contents in a reusable + format, and a `-d' option to remove a name from the hash table. + +4. New Features in Readline + +a. Support for key `subsequences': allows, e.g., ESC and ESC-a to both + be bound to readline functions. Now the arrow keys may be used in vi + insert mode. + +b. When listing completions, and the number of lines displayed is more than + the screen length, readline uses an internal pager to display the results. + This is controlled by the `page-completions' variable (default on). + +c. New code to handle editing and displaying multibyte characters. + +d. The behavior introduced in bash-2.05a of deciding whether or not to + append a slash to a completed name that is a symlink to a directory has + been made optional, controlled by the `mark-symlinked-directories' + variable (default is the 2.05a behavior). + +e. The `insert-comment' command now acts as a toggle if given a numeric + argument: if the first characters on the line don't specify a + comment, insert one; if they do, delete the comment text + +f. New application-settable completion variable: + rl_completion_mark_symlink_dirs, allows an application's completion + function to temporarily override the user's preference for appending + slashes to names which are symlinks to directories. + +g. New function available to application completion functions: + rl_completion_mode, to tell how the completion function was invoked + and decide which argument to supply to rl_complete_internal (to list + completions, etc.). + +h. Readline now has an overwrite mode, toggled by the `overwrite-mode' + bindable command, which could be bound to `Insert'. + +i. New application-settable completion variable: + rl_completion_suppress_append, inhibits appending of + rl_completion_append_character to completed words. + +j. New key bindings when reading an incremental search string: ^W yanks + the currently-matched word out of the current line into the search + string; ^Y yanks the rest of the current line into the search string, + DEL or ^H deletes characters from the search string. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.05a-release, +and the previous version, bash-2.05a-rc1. + +1. Changes to Bash + +a. Fixed the `printf' builtin so that the variable name supplied as an + argument to a %n conversion must be a valid shell identifier. + +b. Improved the random number generator slightly. + +c. Changes to configuration to not put -I/usr/include into $CFLAGS, since + it messes up some includes. + +d. Corrected description of POSIXLY_CORRECT in man page and info manual. + +e. Fixed a couple of cases of incorrect function prototypes that sneaked + through and caused compilation problems. + +f. A few changes to avoid potential core dumps in the programmable completion + code. + +g. Fixed a configure problem that could cause a non-existent file to show + up in LIBOBJS. + +h. Fixed a configure problem that could cause siglist.o to not be built when + required. + +i. Changes to the strtoimax and strtoumax replacement functions to work + around buggy compilers. + +j. Fixed a problem with the snprintf replacement function that could + potentially cause a core dump. + +2. Changes to Readline + +a. Fixed a locale-specific problem in the vi-mode `goto mark' command. + +b. Fixed Makefile to not put -I/usr/include into CFLAGS, since it can cause + include file problems. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.05a-rc1, +and the previous version, bash-2.05a-beta1. + +1. Changes to Bash + +a. Fixed the snprintf replacement to correctly implement the `alternate form' + of the %g and %G conversions. + +b. Fixed snprintf to correctly handle the optional precision with the %g and + %G conversions. + +c. Fixed the arithmetic evaluation code to correct the values of `@' and `_' + when translating base-64 constants (they were backwards). + +d. New library functions for formatting long and long long ints. + +e. Fixed a few places where negative array subscripts could have occurred, + mostly as the result of systems using signed characters. + +f. Fixed a few places that assumed a pid_t was no wider than an int. + +g. Fixed the `maildir' mail checking code to work on systems where a + `struct stat' doesn't include an `st_blocks' member. + +h. Fixed snprintf to make `unsigned long long' conversion formats (%llu) + work better. + +i. Fixed snprintf to not print a sign when asked to do an unsigned conversion. + +j. Made configure changes to avoid compiling empty source files in lib/sh. + +k. New replacement functions (if necessary) for strtoull, strtoll, strtoimax, + strtoumax. + +l. The `printf' builtin now handles the `ll' and `j' length modifiers + directly, since they can affect the type and width of the argument + passed to printf(3). + +m. Renamed a number of the bash-specific autoconf macros in aclocal.m4 to + have more sytematic naming, with accompanying changes to configure.in. + +n. Fixed snprintf to handle long doubles and the %a/%A conversions by + falling back to sprintf, as long as sprintf supports them. + +o. Fixed return value from vsnprintf/snprintf to be the number of characters + that would have been printed, even if that number exceeds the buffer + size passed as an argument. + +p. Bash no longer attempts to define its own versions of some ctype macros + if they are implemented as functions in libc but not as macros in + . + +q. Changed the variable printing code (used by `set', `export', etc.) to + not use the $'...' syntax when in posix mode, since that caused + interoperability problems with other shells (most notably with autoconf). + When not in posix mode, it uses $'...' if the string to be printed + contains non-printing characters and regular single quotes otherwise. + +r. snprintf now recognizes the %F conversion. + +s. Fixed a bug that could cause the wrong status to be returned by a shell + function when the shell is compiled without job control and a null + command containing a command substutition was executed in the function. + +t. When in posix mode, the default value for MAILCHECK is 600. + +u. Bash only initializes FUNCNAME, GROUPS, and DIRSTACK as special variables + if they're not in the initial environment. + +v. If SECONDS appears in the initial environment with a valid integer value, + bash uses that as the starting value, as if an assignment had been + performed. + +w. Bash no longer auto-exports HOME, PATH, SHELL, or TERM, even though it + gives them default values if they don't appear in the initial environment. + +x. Bash no longer auto-exports HOSTNAME, HOSTTYPE, MACHTYPE, or OSTYPE, + even if it assigns them default values. + +y. Bash no longer removes the export attribute from SSH_CLIENT or SSH2_CLIENT + if they appear in the initial environment. + +z. Bash no longer attempts to discover if it's being run by sshd in order to + run the startup files. If the SSH_SOURCE_BASHRC is uncommented in + config-top.h it will attempt to do so as previously, but that's commented + out in the distributed version. + +aa. Fixed a typo in the code that tests for LC_NUMERIC. + +bb. The POSIXLY_CORRECT shell variable and its effects are now documented. + +cc. Some changes to several of the support shell scripts included in the + definitions to try to avoid race conditions and attacks. + +dd. Several changes to avoid warnings from `gcc -Wall'. + +ee. Fixed a problem with the `unset' builtin that could cause incorrect + results if asked to unset a variable and an array subscript in the + same command. + +ff. A few changes to the shell's temporary file creation code to avoid + potential file descriptor leaks and to prefer the system's idea of + the temporary directory to use. + +gg. Fixes to build with the C alloca in lib/malloc/alloca.c if the system + requires it but the shell has been configured --without-bash-malloc. + +hh. Updated the documentation to note that only interactive shells resend + SIGHUP to all jobs before exiting. + +ii. Fixes to only pass unquoted tilde words to tilde_expand, rather than + rely on tilde_expand or getpwnam(3) to handle the quotes (MacOS 10.x + will remove backslashes in any login name passed to getpwnam(3)). + +jj. Small change from Paul Eggert to make LINENO right in commands run with + `bash -c'. + +2. New Features in Bash + +a. The `printf' builtin now handles the %a and %A conversions if they're + implemented by printf(3). + +b. The `printf' builtin now handles the %F conversion (just about like %f). + +c. The `printf' builtin now handles the %n conversion like printf(3). The + corresponding argument is the name of a shell variable to which the + value is assigned. + +3. Changes to Readline + +a. Fixed a few places where negative array subscripts could have occurred. + +b. Fixed the vi-mode code to use a better method to determine the bounds of + the array used to hold the marks. + +c. Fixed the defines in chardefs.h to work better when chars are signed. + +d. Fixed configure.in to use the new names for bash autoconf macros. + +e. Readline no longer attempts to define its own versions of some ctype + macros if they are implemented as functions in libc but not as macros in + . + +f. Fixed a problem where rl_backward could possibly set point to before + the beginning of the line. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.05a-beta1, +and the previous version, bash-2.05a-alpha1. + +1. Changes to Bash + +a. Fixed a bug in the evalution of arithmetic `for' statements when the + expanded expression is NULL. + +b. Fixed an unassigned variable problem in the redirection printing code. + +c. Added more prototypes to extern function declarations in the header + files and to static function declarations in C source files. + +d. Make sure called functions have a prototype in scope, to get the arguments + and return values right instead of casting. Removed extern function + declarations from C source files that were already included in header + files. + +e. Changed some function arguments to use function typedefs in general.h so + the prototypes can be checked. The only use of Function and VFunction + now is for unwind-protects. + +f. More const changes to function arguments and appropriate variables. + +g. Changed the mail checking support to handle `maildir'-style mail + directories. + +h. Augmented the bash malloc to pass in the file and line number information + for each malloc, realloc, and free. This should result in better error + messages. + +i. The `old' gnu malloc is no longer a configuration option. + +j. Augmented the bash malloc with optional tracing and registering allocated + and freed memory. + +k. Prompt string decoding now saves and restores the value of $? when it + expands the prompt string, so command substitutions don't change $?. + +i. Array indices are now `long', since shell arithmetic is performed as long, + and the internal arrayind_t type is used consistently. + +j. Some more `unsigned char *' fixes from Paul Eggert. + +k. Fixed a bad call to builtin_error that could cause core dumps when making + local variables. + +l. `return' may no longer be used to terminate a `select' command, for + compatibility with ksh. + +m. Changed code that reads octal numbers to do a better job of detecting + overflows. + +n. The time formatting code no longer uses absolute indices into a buffer, + because the buffer size changes depending on the size of a `time_t'. + +o. `umask' now prints four digits when printing in octal mode, for + compatibility with other shells. + +p. Lots of changes to the `printf' builtin from Paul Eggert: it handles `L' + formats and long doubles better, and internal functions have been + simpified where appropriate. + +q. Some `time_t' fixes for machines were a time_t is bigger than a long. + +r. Replaced some bash-specific autoconf macros with standard equivalents. + +s. Improvmed the code that constructs temporary filenames to make the + generated names a bit more random. + +t. Added code that checks for ascii before calling any of the is* ctype + functions. + +u. Changed some places where a `char' was used as an array subscript to use + `unsigned char', since a `char' can be negative if it's signed by default. + +v. Lots of changes to the `ulimit' builtin from Paul Eggert to add support + for the new POSIX-200x RLIM_SAVED_CUR and RLIM_SAVED_MAX values and + simplify the code. + +w. `ulimit' now prints the description of a resource in any error message + relating to fetching or setting that resource's limits. + +x. The `snprintf' replacement now computes maximum values at compile + time rather than using huge constants for things like long long. + +y. Interactive shells now ignore `set -n'. + +z. Changed the malloc bookkeeping information so that it's now 8 bytes + instead of 12 on most 32-bit machines (saving 4 bytes per allocation), + restoring 8-byte alignment. + +aa. The malloc error reporting code now attempts to print the file and line + number of the call that caused the error. + +bb. Changed the redirection error reporting code to catch EBADF errors and + report the file descriptor number rather than the file being redirected + to or from (e.g., things like `exec 4242&word' redirection now works in POSIX mode as it does by default, + since POSIX.2 leaves it unspecified. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.05-beta2, +and the previous version, bash-2.05-beta1. + +1. Changes to Bash + +a. Fixed a bug in the arithmetic evaluation code so that a^=b is supported. + +b. Fixed startup so posixly_correct is retained across subshells begun to + execute scripts without a leading `#!'. + +c. Fixed a bug that caused $(< file) to not work in a (...) subshell. + +d. Added config support for Linux running on the IBM S390. + +e. Fixed a bug that caused bash to get its input pointer out of sync when + reading commands through a pipe and running a command with standard + input redirected from a file. + +f. Made a change so that command completion now makes about half as many + stat(2) calls when searching the $PATH. + +g. Fixed a bug that caused variable assignments preceding `return' to not + be propagated to the shell environment in POSIX mode. + +h. Fixed a bug with ${parameter[:]?word} -- tilde expansion was not performed + on `word'. + +i. In POSIX mode, `break' and `continue' do not complain and return success + if called when the shell is not executing a loop. + +j. Fixed `bash -o posix' to work the same as `bash --posix'. + +k. Fixed a bug where variable assignments preceding `eval' or `source/.' + would not show up in the environment exported to subshells run by the + commands. + +l. In POSIX mode, shells started to execute command substitutions inherit + the value of the `-e' option from their parent shell. + +m. In POSIX mode, aliases are expanded even in non-interactive shells. + +n. Changed some of the job control messages to display the text required by + POSIX.2 when the shell is in POSIX mode. + +o. Fixed a bug in `test' that caused it to occasionally return incorrect + results when non-numeric arguments were supplied to `-t'. + +2. Changes to Readline + +a. Some changes were made to avoid gcc warnings with -Wall. + +b. rl_get_keymap_by_name now finds keymaps case-insensitively, so + `set keymap EMACS' works. + +c. The history file writing and truncation functions now return a useful + status on error. + +d. Fixed a bug that could cause applications to dereference a NULL pointer + if a NULL second argument was passed to history_expand(). + +3. New Features in Bash + +a. doc/readline.3 has been moved to the readline distribution. + +4. New Features in Readline + +a. New function, rl_get_screen_size (int *rows, int *columns), returns + readline's idea of the screen dimensions. + +b. The timeout in rl_gather_tyi (readline keyboard input polling function) + is now settable via a function (rl_set_keyboard_input_timeout()). + +c. Renamed the max_input_history variable to history_max_entries; the old + variable is maintained for backwards compatibility. + +d. The list of characters that separate words for the history tokenizer is + now settable with a variable: history_word_delimiters. The default + value is as before. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.05-beta1, +and the previous version, bash-2.05-alpha1. + +1. Changes to Bash + +a. Changes to allow shared library and object building on the GNU Hurd. + +b. Fixes to the way exported functions are placed into the environment and + cached. + +c. The globbing library once again respects locales when processing ranges + in bracket expressions while doing pattern matching. + +d. System-specific configuration changes for: Tru 64, Interix + +e. Bashbug now uses /usr/bin/editor as one of the editing alternatives, and + will use mktemp(1) or tempfile(1), if present, for temporary file creation. + +f. Bash no longer performs a binary file check on a script argument that's + really a tty (like /dev/fd/0 or /dev/stdin). + +g. Fixed a bug in the execution of shell scripts that caused the effects of + $BASH_ENV to be undone in some cases. + +h. Fixed several bugs that made `bash [-i] /dev/stdin' not work correctly. + +i. Several changes to the job control code to avoid some signal state + manipulation. + +j. The Bash malloc no longer blocks signals as often, which should make it + faster. + +k. Fixed a parsing bug that did not allow backslash to escape a single quote + inside a $'...' construct. + +l. Fixed a bug that caused things like ${var:=$'value'} to be parsed + incorrectly. This showed up in newer versions of autoconf. + +m. Fixed a bug in the bash-specific readline initialization that caused + key bindings to bash-specific function names appearing in .inputrc to + not be honored. + +n. Bash now sets the file descriptor it uses to save the file descriptor + opened on a shell script to close on exec. + +o. Fixed a bug in the prompt string decoding that caused it to misbehave + when presented an octal sequence of fewer than three characters. + +p. Fixed the `test' builtin to return an error if `[' is supplied a single + argument that is not `]'. + +q. Fixed a bug that caused subshells started to run executable shell scripts + without a leading `#!' to incorrectly inherit an argument list preceding + a shell builtin (like such a script called from a script sourced with `.', + where there were variable assignments preceding the `.' command) + +r. Fixed a bug that caused changes to variables supplied in an assignment + statement preceding a shell builtin to not be honored (like a script + run with `.'). + +s. HOSTTYPE, OSTYPE, and MACHTYPE are set only if they do not have values + when the shell is started. + +t. Fixed a bug that caused SIGINT to kill shell scripts after the script + called `wait'. + +u. The `fc' builtin now tries to create its temporary files in the directory + named by $TMPDIR. + +v. Bash no longer calls any Readline functions or uses any Readline variables + not declared in readline.h. + +w. Fixed a bug that caused some substitutions involving $@ to not be split + correctly, especially expansions of the form ${paramterOPword}. + +x. SSH2_CLIENT is now treated like SSH_CLIENT and not auto-exported if it + appears in the initial environment. + +y. Fixed a couple of problems with shell scripts without a leading `#!' + being executed out of shell functions that could cause core dumps if + such a script attempted to execute `return'. + +z. Fixed a problem with the `-nt' and `-ot' binary operators for the + `test/[' builtin and the `[[' conditional command that caused wrong + return values if one of the file arguments did not exist. + +aa. Fixed a bug that caused non-interactive shells which had previously + executed `shopt -s expand_aliases' to fail to expand aliases in a + command like `(command) &'. + +2. Changes to Readline + +a. Changes to make most (but not yet all -- there is still crlf()) of the + exported readline functions declared in readline.h have an rl_ prefix. + +b. More `const' changes in function arguments, mostly for completion + functions. + +c. Fixed a bug in rl_forward that could cause the point to be set to before + the beginning of the line in vi mode. + +d. Fixed a bug in the callback read-char interface to make it work when a + readline function pushes some input onto the input stream with + rl_execute_next (like the incremental search functions). + +e. Fixed a file descriptor leak in the history file manipulation code that + was tripped when attempting to truncate a non-regular file (like + /dev/null). + +f. Some existing variables are now documented and part of the public + interface (declared in readline.h): rl_explict_arg, rl_numeric_arg, + rl_editing_mode, rl_last_func. + +g. Renamed rltty_set_default_bindings to rl_tty_set_default_bindings and + crlf to rl_crlf, so there are no public functions declared in readline.h + without an `rl_' prefix. The old functions still exist for backwards + compatibility. + +3. New Features in Bash + +a. A new loadable builtin, realpath, which canonicalizes and expands symlinks + in pathname arguments. + +b. When `set' is called without options, it prints function defintions in a + way that allows them to be reused as input. This affects `declare' and + `declare -p' as well. + +4. New Features in Readline + +a. New application-callable function rl_set_prompt(const char *prompt): + expands its prompt string argument and sets rl_prompt to the result. + +b. New application-callable function rl_set_screen_size(int rows, int cols): + public method for applications to set readline's idea of the screen + dimensions. + +c. The history example program (examples/histexamp.c) is now built as one + of the examples. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.05-alpha1, +and the previous version, bash-2.04-release. + +1. Changes to Bash + +a. A fix was made to allow newlines in compond array assignments. + +b. configure now checks for real-time signals with unusable values. + +c. Interactive shells no longer exit if a substitution fails because of an + unset variable within a sourced file. + +d. Fixed a problem with incorrect matching of extended glob patterns when + doing pattern substitution. + +e. `{' is now quoted by the completion code when it appears in a filename. + +f. Fixed an error in pattern matching that caused the matcher to not + correctly skip the rest of a bracket expression after a character + matched. + +g. Fixed a bug in the IFS word splitting code to make a non-whitespace IFS + character preceded by IFS whitespace part of the current delimiter rather + than generating a separate field. + +h. The {!prefix@} expansion now generates separate words, analogous to $@, + when double-quoted. + +i. Command substitution now ignores NUL bytes in the command output, and the + parser ignores them on input. + +j. A fix was made to the job control code to prevent hanging processes when + the shell thinks background processes are running but the kernel returns + -1/ECHILD from waitpid(). + +k. `pwd' now prints an error message if the write fails when displaying the + current directory. + +l. When in POSIX mode, the shell prints trap dispostions without a leading + `SIG' in the signal specification. + +m. Fixed a parser bug that caused the current command's line count to be + messed up by a compound array assignment. + +n. Fixed a bug in the unwind-protect code that caused bad behavior on machines + where ints and pointers are not the same size. + +o. System-specific configure changes for: MacOS X. + +p. Changes for Cygwin to translate \r\n and \r to \n and to set file + descriptors used for reading input to text mode in various places. + +q. Fixed a bug that caused `!' to occasionally not be honored when in + a (...) subshell. + +r. Bash no longer assumes that getcwd() will return any useful error message + in the buffer passed as an argument if the call fails. + +s. The `source', `.', and `fc' builtins no longer check whether a file is + binary before reading commands from it. + +t. Subshells no longer turn off job control when they exit, since that + sometimes resulted in the terminal being reset to the wrong process + group. + +u. The history code no longer tries to save the second and subsequent lines + of a multi-line command if the first line was not saved. + +v. The history saving code now does a better job of saving blank lines in a + multi-line command. + +w. Removed a `feature' that made `ulimit' silently translate `unlimited' to + the current hard limit, which obscured some kernel error returns. + +x. Fixed the grammar so that `}' is recognized as a reserved word after + another reserved word, rather than requiring a `;' or newline. This + means that constructs like + + { { echo a b c ; } } + + work as expected. + +y. Conditional commands ([[...]]) now perform tilde expansion on their + arguments. + +z. Noted in the documentation that `set -a' will cause functions to be + exported if they are defined after `set -a' is executed. + +aa. When an interactive login shell starts, if $PWD and $HOME refer to the + same directory but are not the same string, $PWD is set to $HOME. + +bb. Fixed `printf' to handle invalid floating point numbers better. + +cc. Temporary files are now created with random filenames, to improve security. + +dd. The readline initialization code now binds the custom bash functions and + key bindings after the readline defaults are set up. + +ee. Fixed the `source' builtin to no longer overwrite a shell function's + argument list, even if the sourced file changes the positional parameters. + +ff. A bug fix was made in the expansion of `$*' in contexts where it should + not be split, like assignment statements. + +gg. Fixed a bug in the parameter substring expansion to handle conditional + arithmetic expressions ( exp ? val1 : val2 ) without cutting the expression + off at the wrong `:'. + +hh. The `<>' redirection is no longer subject to the current setting of + `noclobber', as POSIX.2 specifies. + +ii. Fixed a bug in the conditional command parsing code that caused expressions + in parentheses to occasionally be parsed incorrectly. + +jj. Fixed a bug in the ((...)) arithmetic command to allow do...done or + {...} to follow the )) without an intervening list terminator. + +kk. `printf' now treats `\E' the same as `\e' when performing backslash escape + expansion for the `%b' format specifier. + +ll. When in POSIX mode, the shell no longer searches the current directory for + a file to be sourced with `.' or `source' if `.' is not in $PATH. + +mm. Interactive comments are no longer turned off when POSIX mode is disabled. + +nn. The UID, EUID, HOSTNAME variables are not set if they are in the shell's + environment when it starts up. + +oo. Fixed a bug in the `command' builtin so the effect of a command like + `command exec 4(...) + expansions to defer removal until after any current shell function has + finished executing. + +f. Fixed a bug in `select' which caused it to not handle the `continue' + builtin correctly. + +g. Autoconf tests added for cygwin32 and mingw32. + +2. New Features in Bash + +a. The `--with-bash-malloc' configure option replaces `--with-gnu-malloc' + (which is still there for backwards compatibility). + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.04-beta1, +and the previous version, bash-2.04-alpha1. + +1. Changes to Bash + +a. Fixed a bug in the programmable completion code that occurred when + trying to complete command lines containing a `;' or `@'. + +b. The file descriptor from which the shell is reading a script is now + moved to a file descriptor above the user-addressible range. + +c. Changes to `printf' so that it can handle integers beginning with 0 + or 0x as octal and hex, respectively. + +d. Fixes to the programmable completion code so it handles nonsense like + `compgen -C xyz' gracefully. + +e. The shell no longer modifies the signal handler for SIGPROF, allowing + profiling again on certain systems. + +f. The shell checks for a new window size, if the user has requested it, + after a process exits due to a signal. + +g. Fixed a bug with variables with null values in a program's temporary + environment and the bash getenv() replacement. + +h. `declare' and the other builtins that take variable assignments as + arguments now honor `set -a' and mark modified variables for export. + +i. Some changes were made for --dump-po-strings mode when writing strings + with embedded newlines. + +j. The code that caches export strings from the initial environment now + duplicates the string rather than just pointing into the environment. + +k. The filename completion quoting code now uses single quotes by default + if the filename being completed contains newlines, since \ + has a special meaning to the parser. + +l. Bash now uses typedefs bits32_t and u_bits32_t instead of int32_t and + u_int32_t, respectively to avoid conflicts on certain Unix versions. + +m. Configuration changes were made for: Rhapsody, Mac OS, FreeBSD-3.x. + +n. Fixed a problem with hostname-to-ip-address translation in the + /dev/(tcp|udp)/hostname/port redirection code. + +o. The texinfo manual has been reorganized slightly. + +p. Filename generation (globbing) range comparisons in bracket expressions + no longer use strcoll(3) even if it is available, since it has unwanted + effects in certain locales. + +q. Fixed a cosmetic problem in the source that caused the shell to not + compile if DPAREN_ARITHMETIC was not defined but ARITH_FOR_COMMAND was. + +r. Fixed a bug in the here-document code tripped when the file descriptor + opened to the file containing the text of the here document was the + same as a redirector specified by the user. + +s. Fixed a bug where the INVERT_RETURN flag was not being set for `pipeline' + in `time ! pipeline'. + +t. Fixed a bug with the `wait' builtin which manifested itself when an + interrupt was received while the shell was waiting for asynchronous + processes in a shell script. + +u. Fixed the DEBUG trap code so that it has the correct value of $?. + +v. Fixed a bug in the parameter pattern substitution code that could cause + the shell to attempt to free unallocated memory if the pattern started + with `/' and an expansion error occurs. + +w. Fixed a bug in the positional parameter substring code that could + cause the shell to loop freeing freed memory. + +x. Fixed a bug in the positional parameter pattern substitution code so + that it correctly handles null replacement strings with a pattern + string prefixed with `%' or `#'. + +y. The shell no longer attempts to import functions from the environment if + started with `-n'. + +z. Fixed a bug that caused `return' in a command substitution executed in + a shell function to return from the function in a subshell and continue + execution. + +aa. `hash -p /pathname/with/slashes name' is no longer allowed when the shell + is restricted. + +bb. The wait* job control functions now behave better if called when there + are no unwaited-for children. + +cc. Command substitution no longer unconditionally disables job control in + the subshell started to run the command. + +dd. A bug was fixed that occasionally caused traps to mess up the parser + state. + +ee. `bashbug' now honors user headers in the mail message it sends. + +ff. A bug was fixed that caused the `:p' history modifier to not print the + history expansion if the `histverify' option was set. + +2. Changes to Readline + +a. Fixed a bug in the redisplay code for lines with more than 256 line + breaks. + +b. A bug was fixed which caused invisible character markers to not be + stripped from the prompt string if the terminal was in no-echo mode. + +c. Readline no longer tries to get the variables it needs for redisplay + from the termcap entry if the calling application has specified its + own redisplay function. Readline treats the terminal as `dumb' in + this case. + +d. Fixes to the SIGWINCH code so that a multiple-line prompt with escape + sequences is redrawn correctly. + +3. New Features in Bash + +a. `bashbug' now accepts `--help' and `--version' options. + +b. There is a new `xpg_echo' option to `shopt' that controls the behavior + of echo with respect to backslash-escaped characters at runtime. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.04-alpha1, +and the previous version, bash-2.04-devel. + +1. Changes to Bash + +a. Fixed a bug that could cause core dumps when performing substring + expansion. + +b. Shared object configuration changes for: Solaris, OSF/1 + +c. The POSIX_GLOB_LIBRARY code that uses the POSIX.2 globbing facilities + for pathname expansion now understands GLOBIGNORE. + +d. The code that implements `eval' was changed to save the value of the + current prompt, so an eval in a shell function called by the programmable + completion code will not change the prompt to $PS2. + +e. Restored the undocumented NON_INTERACTIVE_LOGIN_SHELLS #define to + config-top.h. If this is defined, all login shells will read the + startup files, not just interactive and non-interactive started with + the `--login' option. + +f. Fixed a bug that caused the expansion code to occasionally dump core if + IFS contained characters > 128. + +g. Fixed a problem with the grammar so that a newline is not required + after the `))' in the new-style arithmetic for statement; a semicolon + may be used as expected. + +h. Variable indirection may now reference the shell's special variables. + +i. The $'...' and $"..." constructs are now added to the history correctly + if they contain newlines and command-oriented history is enabled. + +j. It is now an error to try to assign a value to a function-local copy + of a readonly shell variable (declared with the `local' builtin). + +2. Changes to Readline + +a. The history file code now uses O_BINARY mode when reading and writing + the history file on cygwin32. + +3. New Features in Bash + +a. A new programmable completion facility, with two new builtin commands: + complete and compgen. + +b. configure has a new option, `--enable-progcomp', to compile in the + programmable completion features (enabled by default). + +c. `shopt' has a new option, `progcomp', to enable and disable programmable + completion at runtime. + +d. Unsetting HOSTFILE now clears the list of hostnames used for completion. + +4. New Features in Readline + +a. A new variable, rl_gnu_readline_p, always 1. The intent is that an + application can verify whether or not it is linked with the `real' + readline library or some substitute. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.04-devel, +and the previous version, bash-2.03-release. + +1. Changes to Bash + +a. System-specific configuration and source changes for: Interix, Rhapsody + +b. Fixed a bug in execute_cmd.c that resulted in a compile-time error if + JOB_CONTROL was not defined. + +c. An obscure race condition in the trap code was fixed. + +d. The string resulting from $'...' is now requoted to avoid any further + expansion. + +e. The $'...' quoting syntax now allows backslash to escape a single quote, + for ksh-93 compatibility. + +f. The $"..." quoting syntax now escapes backslashes and double quotes in + the translated string when displaying them with the --dump-po-strings + option. + +g. `echo -e' no longer converts \' to '. + +h. Fixes were made to the extended globbing code to handle embedded (...) + patterns better. + +i. Some improvements were made to the code that unsets `nodelay' mode on + the file descriptor from which bash is reading input. + +j. Some changes were made to the replacement termcap library for better + operation on MS-DOS. + +k. Some changes were made to the tilde expansion code to handle backslash + as a pathname separator on MS-DOS. + +l. The source has been reorganized a little bit -- there is now an `include' + subdirectory, and lib/posixheaders has been removed. + +m. Improvements were made to the `read' builtin so that it makes many + fewer read(2) system calls. + +n. The expansion of $- will include `c' and `s' when those options are + supplied at shell invocation. + +o. Several improvments were made to the completion code: variable completion + now works better when there are unterminated expansions, command + completion understands quotes better, and completion now works in certain + unclosed $(... constructs. + +p. The arithmetic expansion code was fixed to not need the value of a + variable being assigned a value (fixes the "ss=09; let ss=10" bug). + +q. Some changes were made to make exported environment creation faster. + +r. The html documentation will be installed into $(htmldir) if that variable + has a value when `make install' is run. + +s. Fixed a bug that would cause the bashrc file to be sourced inappropriately + when bash is started by sshd. + +t. The SSH_CLIENT environment variable is no longer auto-exported. + +u. A bug that caused redirections with (...) subshells to be performed in + the wrong order was fixed. + +v. A bug that occasionally caused inappropriate expansion of assignment + statements in compound array assignments was fixed. + +w. The code that parses the words in a compound array assignment was + simplified considerably and should work better now. + +x. Fixes to the non-job-control code in nojobs.c to make it POSIX.2-compliant + when a user attempts to retrieve the status of a terminated background + process. + +y. Fixes to the `printf' builtin so that it doesn't try to expand all + backslash escape sequences in the format string before parsing it for + % format specifiers. + +2. Changes to Readline + +a. The history library tries to truncate the history file only if it is a + regular file. + +b. A bug that caused _rl_dispatch to address negative array indices on + systems with signed chars was fixed. + +c. rl-yank-nth-arg now leaves the history position the same as when it was + called. + +d. Changes to the completion code to handle MS-DOS drive-letter:pathname + filenames. + +e. Completion is now case-insensitive by default on MS-DOS. + +f. Fixes to the history file manipulation code for MS-DOS. + +g. Readline attempts to bind the arrow keys to appropriate defaults on MS-DOS. + +h. Some fixes were made to the redisplay code for better operation on MS-DOS. + +i. The quoted-insert code will now insert tty special chars like ^C. + +j. A bug was fixed that caused the display code to reference memory before + the start of the prompt string. + +k. More support for __EMX__ (OS/2). + +l. A bug was fixed in readline's signal handling that could cause infinite + recursion in signal handlers. + +m. A bug was fixed that caused the point to be less than zero when rl_forward + was given a very large numeric argument. + +n. The vi-mode code now gets characters via the application-settable value + of rl_getc_function rather than calling rl_getc directly. + +3. New Features in Bash + +a. The history builtin has a `-d offset' option to delete the history entry + at position `offset'. + +b. The prompt expansion code has two new escape sequences: \j, the number of + active jobs; and \l, the basename of the shell's tty device name. + +c. The `bind' builtin has a new `-x' option to bind key sequences to shell + commands. + +d. There is a new shell option, no_empty_command_completion, which, when + enabled, disables command completion when TAB is typed on an empty line. + +e. The `help' builtin has a `-s' option to just print a builtin's usage + synopsys. + +f. There are several new arithmetic operators: id++, id-- (variable + post-increment/decrement), ++id, --id (variabl pre-increment/decrement), + expr1 , expr2 (comma operator). + +g. There is a new ksh-93 style arithmetic for command: + for ((expr1 ; expr2; expr3 )); do list; done + +h. The `read' builtin has a number of new options: + -t timeout only wait timeout seconds for input + -n nchars only read nchars from input instead of a full line + -d delim read until delim rather than newline + -s don't echo input chars as they are read + +i. The redirection code now handles several filenames specially: + /dev/fd/N, /dev/stdin, /dev/stdout, and /dev/stderr, whether or + not they are present in the file system. + +j. The redirection code now recognizes pathnames of the form + /dev/tcp/host/port and /dev/udp/host/port, and tries to open a socket + of the appropriate type to the specified port on the specified host. + +k. The ksh-93 ${!prefix*} expansion, which expands to the names of all + shell variables whose names start with prefix, has been implemented. + +l. There is a new dynamic variable, FUNCNAME, which expands to the name of + a currently-executing function. Assignments to FUNCNAME have no effect. + +m. The GROUPS variable is no longer readonly; assignments to it are silently + discarded. This means it can be unset. + +4. New Features in Readline + +a. Parentheses matching is now always compiled into readline, and enabled + or disabled when the value of the `blink-matching-paren' variable is + changed. + +b. MS-DOS systems now use ~/_inputrc as the last-ditch inputrc filename. + +c. MS-DOS systems now use ~/_history as the default history file. + +d. history-search-{forward,backward} now leave the point at the end of the + line when the string to search for is empty, like + {reverse,forward}-search-history. + +e. history-search-{forward,backward} now leave the last history line found + in the readline buffer if the second or subsequent search fails. + +f. New function for use by applications: rl_on_new_line_with_prompt, used + when an application displays the prompt itself before calling readline(). + +g. New variable for use by applications: rl_already_prompted. An application + that displays the prompt itself before calling readline() must set this to + a non-zero value. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.03-release, +and the previous version, bash-2.03-beta2. + +1. Changes to Bash + +a. A file descriptor leak in the `fc' builtin was fixed. + +b. A bug was fixed in the `read' builtin that caused occasional spurious + failures when using `read -e'. + +c. The version code needed to use the value of the cpp variable + CONF_MACHTYPE rather than MACHTYPE. + +d. A new test was added to exercise the command printing and copying code. + +e. A bug was fixed that caused `time' to be recognized as a reserved word + if it was the first pattern in a `case' statement pattern list. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.03-beta2, +and the previous version, bash-2.03-beta1. + +1. Changes to Bash + +a. Slight additions to support/shobj-conf, mostly for the benefit of AIX 4.2. + +b. config.{guess,sub} support added for the NEC SX4. + +c. Changed some of the cross-compiling sections of the configure macros in + aclocal.m4 so that configure won't abort. + +d. Slight changes to how the HTML versions of the bash and readline manuals + are generated. + +e. Fixed conditional command printing to avoid interpreting printf `%'-escapes + in arguments to [[. + +f. Don't include the bash malloc on all variants of the alpha processor. + +g. Changes to configure to make --enable-profiling work on Solaris 2.x. + +h. Fixed a bug that manifested itself when shell functions were called + between calls to `getopts'. + +i. Fixed pattern substitution so that a bare `#'as a pattern causes the + replacement string to be prefixed to the search string, and a bare + `%' causes the replacement string to be appended to the search string. + +j. Fixed a bug in the command execution code that caused child processes + to occasionally have the wrong value for $!. + +2. Changes to Readline + +a. Added code to the history library to catch history substitutions using + `&' without a previous history substitution or search having been + performed. + +3. New Features in Bash + +4. New Features in Readline + +a. New bindable variable: `isearch-terminators'. + +b. New bindable function: `forward-backward-delete-char' (unbound by default). + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.03-beta1, +and the previous version, bash-2.03-alpha. + +1. Changes to Bash + +a. A change was made to the help text for `{...}' to make it clear that a + semicolon is required before the closing brace. + +b. A fix was made to the `test' builtin so that syntax errors cause test + to return an exit status > 1. + +c. Globbing is no longer performed on assignment statements that appear as + arguments to `assignment builtins' such as `export'. + +d. System-specific configuration changes were made for: Rhapsody, + AIX 4.2/gcc, BSD/OS 4.0. + +e. New loadable builtins: ln, unlink. + +f. Some fixes were made to the globbing code to handle extended glob patterns + which immediately follow a `*'. + +g. A fix was made to the command printing code to ensure that redirections + following compound commands have a space separating them from the rest + of the command. + +h. The pathname canonicalization code was changed to produce fewer leading + `//' sequences, since those are interpreted as network file system + pathnames on some systems. + +i. A fix was made so that loops containing `eval' commands in commands passed + to `bash -c' would not exit prematurely. + +j. Some changes were made to the job reaping code when the shell is not + interactive, so the shell will retain exit statuses longer for examination + by `wait'. + +k. A fix was made so that `jobs | command' works again. + +l. The erroneous compound array assignment var=((...)) is now a syntax error. + +m. A change was made to the dynamic loading code in `enable' to support + Tenon's MachTen. + +n. A fix was made to the globbing code so that extended globbing patterns + will correctly match `.' in a bracket expression. + +2. Changes to Readline + +a. A fix was made to the completion code in which a typo caused the wrong + value to be passed to the function that computed the longest common + prefix of the list of matches. + +b. The completion code now checks the value of rl_filename_completion_desired, + which is set by application-supplied completion functions to indicate + that filename completion is being performed, to decide whether or not to + call an application-supplied `ignore completions' function. + +3. New Features in Bash + +a. A change was made to the startup file code so that any shell begun with + the `--login' option, even non-interactive shells, will source the login + shell startup files. + +4. New Features in Readline + +a. A new variable, rl_erase_empty_line, which, if set by an application using + readline, will cause readline to erase, prompt and all, lines on which the + only thing typed was a newline. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.03-alpha, +and the previous version, bash-2.02.1-release. + +1. Changes to Bash + +a. System-specific configuration changes were made for: Irix 6.x, Unixware 7. + +b. The texi2dvi and texi2html scripts were updated to the latest versions + from the net. + +c. The configure tests that determine which native type is 32 bits were + changed to not require a compiled program. + +d. Fixed a bug in shell_execve that could cause memory to be freed twice + after a failed exec. + +e. The `printf' test uses `diff -a' if it's available to prevent confusion + due to the non-ascii output. + +f. Shared object configuration is now performed by a shell script, + support/shobj-conf, which generates values to be substituted into + makefiles by configure. + +g. Some changes were made to `ulimit' to avoid the use of RLIM_INVALID as a + return value. + +h. Changes were made to `ulimit' to work around HPUX 9.x's peculiar + handling of RLIMIT_FILESIZE. + +i. Some new loadable builtins were added: id, printenv, sync, whoami, push, + mkdir. `pushd', `popd', and `dirs' can now be built as regular or + loadable builtins from the same source file. + +j. Changes were made to `printf' to handle NUL bytes in the expanded format + string. + +k. The various `make clean' Makefile targets now descend into lib/sh. + +l. The `type' builtin was changed to use the internal `getopt' so that things + like `type -ap' work as expected. + +m. There is a new configuration option, --with-installed-readline, to link + bash with a locally-installed version of readline. Only readline version + 4.0 and later releases can support this. Shared and static libraries + are supported. The installed include files are used. + +n. There is a new autoconf macro used to find which basic type is 64 bits. + +o. Dynamic linking and loadable builtins should now work on SCO 3.2v5*, + AIX 4.2 with gcc, Unixware 7, and many other systems using gcc, where + the `-shared' options works correctly. + +p. A bug was fixed in the bash filename completion code that caused memory to + be freed twice if a directory name containing an unset variable was + completed and the -u option was set. + +q. The prompt expansion code now quotes the `$' in the `\$' expansion so it + is not processed by subsequent parameter expansion. + +r. Fixed a parsing bug that caused a single or double quote after a `$$' to + trigger ANSI C expansion or locale translation. + +s. Fixed a bug in the globbing code that caused quoted filenames containing + no globbing characters to sometimes be incorrectly expanded. + +t. Changes to the default prompt strings if prompt string decoding is not + compiled into the shell. + +u. Added `do', `then', `else', `{', and `(' to the list of keywords that may + precede the `time' reserved word. + +v. The shell may now be cross-built for BeOS as well as cygwin32. + +w. The conditional command execution code now treats `=' the same as `==' + for deciding when to perform pattern matching. + +x. The `-e' option no longer causes the shell to exit if a command exits + with a non-zero status while running the startup files. + +y. The `printf' builtin no longer dumps core if a modifier is supplied in + the format string without a conversion character (e.g. `%h'). + +z. Array assignments of the form a=(...) no longer show up in the history + list. + +aa. The parser was fixed to obey the POSIX.2 rules for finding the closing + `}' in a ${...} expression. + +bb. The history file is now opened with mode 0600 rather than 0666, so bash + no longer relies on the user's umask being set appropriately. + +cc. Setting LANG no longer causes LC_ALL to be assigned a value; bash now + relies on proper behavior from the C library. + +dd. Minor changes were made to allow quoted variable expansions using + ${...} to be completed correctly if there is no closing `"'. + +ee. Changes were made to builtins/Makefile.in so that configuring the shell + with `--enable-profiling' works right and builtins/mkbuiltins is + generated. + +2. Changes to Readline + +a. The version number is now 4.0. + +b. There is no longer any #ifdef SHELL code in the source files. + +c. Some changes were made to the key binding code to fix memory leaks and + better support Win32 systems. + +d. Fixed a silly typo in the paren matching code -- it's microseconds, not + milliseconds. + +e. The readline library should be compilable by C++ compilers. + +f. The readline.h public header file now includes function prototypes for + all readline functions, and some changes were made to fix errors in the + source files uncovered by the use of prototypes. + +g. The maximum numeric argument is now clamped at 1000000. + +h. Fixes to rl_yank_last_arg to make it behave better. + +i. Fixed a bug in the display code that caused core dumps if the prompt + string length exceeded 1024 characters. + +j. The menu completion code was fixed to properly insert a single completion + if there is only one match. + +k. A bug was fixed that caused the display code to improperly display tabs + after newlines. + +3. New Features in Bash + +a. New `shopt' option, `restricted_shell', indicating whether or not the + shell was started in restricted mode, for use in startup files. + +b. Filename generation is now performed on the words between ( and ) in + array assignments (which it probably should have done all along). + +c. OLDPWD is now auto-exported, as POSIX.2 seems to require. + +d. ENV and BASH_ENV are read-only variables in a restricted shell. + +4. New Features in Readline + +a. Many changes to the signal handling: + o Readline now catches SIGQUIT and cleans up the tty before returning; + o A new variable, rl_catch_signals, is available to application writers + to indicate to readline whether or not it should install its own + signal handlers for SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP, + SIGTTIN, and SIGTTOU; + o A new variable, rl_catch_sigwinch, is available to application + writers to indicate to readline whether or not it should install its + own signal handler for SIGWINCH, which will chain to the calling + applications's SIGWINCH handler, if one is installed; + o There is a new function, rl_free_line_state, for application signal + handlers to call to free up the state associated with the current + line after receiving a signal; + o There is a new function, rl_cleanup_after_signal, to clean up the + display and terminal state after receiving a signal; + o There is a new function, rl_reset_after_signal, to reinitialize the + terminal and display state after an application signal handler + returns and readline continues + +b. There is a new function, rl_resize_terminal, to reset readline's idea of + the screen size after a SIGWINCH. + +c. New public functions: rl_save_prompt and rl_restore_prompt. These were + previously private functions with a `_' prefix. + +d. New function hook: rl_pre_input_hook, called just before readline starts + reading input, after initialization. + +e. New function hook: rl_display_matches_hook, called when readline would + display the list of completion matches. The new function + rl_display_match_list is what readline uses internally, and is available + for use by application functions called via this hook. + +f. New bindable function, delete-char-or-list, like tcsh. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.02.1-release, +and the previous version, bash-2.02-release. + +1. Changes to Bash + +a. A bug that caused the bash readline support to not compile unless aliases + and csh-style history were configured into the shell was fixed. + +b. Fixed a bug that could cause a core dump when here documents contained + more than 1000 characters. + +c. Fixed a bug that caused a CDPATH entry of "" to not be treated the same + as the current directory when in POSIX mode. + +d. Fixed an alignment problem with the memory returned by the bash malloc, + so returned memory is now 64-bit aligned. + +e. Fixed a bug that caused command substitutions executed within pipelines + to put the terminal in the wrong process group. + +f. Fixes to support/config.sub for: alphas, SCO Open Server and Open Desktop, + Unixware 2, and Unixware 7. + +g. Fixes to the pattern matching code to make it work correctly for eight-bit + characters. + +h. Fixed a problem that occasionally caused the shell to display the wrong + value for the new working directory when changing to a directory found + in $CDPATH when in physical mode. + +i. Fixed a bug that caused core dumps when using conditional commands in + shell functions. + +j. Fixed a bug that caused the printf builtin to loop forever if the format + string did not consume any of the arguments. + +k. Fixed a bug in the parameter expansion code that caused "$@" to be + incorrectly split if $IFS did not contain a space character. + +l. Fixed a bug that could cause a core dump when completing hostnames if + the number of matching hostnames was an exact multiple of 16. + +m. Fixed a bug that caused the shell to fork too early when a command + such as `%2 &' was given. + +2. Changes to Readline + +a. Fixed a problem with redisplay that showed up when the prompt string was + longer than the screen width and the prompt contained invisible characters. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.02-release, +and the previous version, bash-2.02-beta2. + +1. Changes to Bash + +a. A bug was fixed that caused the terminal process group to be set + incorrectly when performing command substitution of builtins in a + pipeline. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.02-beta2, +and the previous version, bash-2.02-beta1. + +1. Changes to Bash + +a. Attempting to `wait' for stopped jobs now generates a warning message. + +b. Pipelines which exit due to SIGPIPE in non-interactive shells are now + not reported if the shell is compiled -DDONT_REPORT_SIGPIPE. + +c. Some changes were made to builtins/psize.sh and support/bashbug.sh to + attempt to avoid some /tmp file races and surreptitious file + substitutions. + +d. Fixed a bug that caused the shell not to compile if configured with + dparen arithmetic but without aliases. + +e. Fixed a bug that caused the input stream to be switched when assigning + empty arrays with `bash -c'. + +f. A bug was fixed in the readline expansion glue code that caused bash to + dump core when expanding lines with an unclosed single quote. + +g. A fix was made to the `cd' builtin so that using a non-empty directory + from $CDPATH results in an absolute pathname of the new current working + directory to be displayed after the current directory is changed. + +h. Fixed a bug in the variable assignment code that caused the shell to + dump core when referencing an unset variable with `set -u' enabled in + an assignment statement preceding a command. + +i. Fixed a bug in the exit trap code that caused reserved words to not be + recognized under certain circumstances. + +j. Fixed a bug in the parameter pattern substitution code so that quote + removal is performed. + +k. The shell should now configure correctly on Apple Rhapsody systems. + +l. The `kill' builtin now prints a usage message if it is not passed any + arguments. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.02-beta1, +and the previous version, bash-2.02-alpha1. + +1. Changes to Bash + +a. A few compilation bugs were fixed in the new extended globbing code. + +b. Executing arithmetic commands now sets the command name to `((' so + error messages look right. + +c. Fixed some build problems with various configuration options. + +d. The `printf' builtin now aborts immediately if an illegal format + character is encountered. + +e. The code that creates here-documents now behaves better if the file it's + trying to create already exists for some reason. + +f. Fixed a problem with the extended globbing code that made patterns like + `x+*' expand incorrectly. + +g. The prompt string expansion code no longer quotes tildes with backslashes. + +h. The bash getcwd() implementation in lib/sh/getcwd.c now behaves better in + the presence of lstat(2) failures. + +i. Fixed a bug with strsub() that caused core dumps when executing `fc -s'. + +j. The mail checking code now ensures that it has a valid default mailpath. + +k. A bug was fixed that caused local variables to be unset inappropriately + when sourcing a script from within another sourced script. + +l. A bug was fixed in the history saving code so that functions are saved + in the history list correctly if `cmdhist' is enabled, but `lithist' + is not. + +m. A bug was fixed that caused printf overflows when displaying error + messages. + +n. It should be easier to build the loadble builtins in examples/loadables, + though some manual editing of the generated Makefile is still required. + +o. The user's primary group is now always ${GROUPS[0]}. + +p. Some updates were made to support/config.guess from the GNU master copy. + +q. Some changes were made to the autoconf support for Solaris 2.6 large + files. + +r. The `command' builtins now does the right thing when confstr(3) cannot + find a value for _CS_PATH. + +s. Extended globbing expressions like `*.!(c)' are not history expanded if + `extglob' is enabled. + +t. Using the `-P' option to `cd' will force the value that is assigned to + PWD to not contain any symbolic links. + +2. Changes to Readline + +a. The code that prints completion listings now behaves better if one or + more of the filenames contains non-printable characters. + +b. The time delay when showing matching parentheses is now 0.5 seconds. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.02-alpha1, +and the previous version, bash-2.01.1-release. + +1. Changes to Bash + +a. OS-specific configuration changes for: BSD/OS 3.x, Minix 2.x, + Solaris 2.6, SINIX SVR4. + +b. Changes were made to the generated `info' files so that `install-info' + works correctly. + +c. PWD is now auto-exported. + +d. A fix was made to the pipeline code to make sure that the shell forks + to execute simple commands consisting solely of assignment statements. + +e. Changes to the test suite for systems with 14-character filenames. + +f. The default sizes of some internal hash tables have been made smaller + to reduce the shell's memory footprint. + +g. The `((...))' arithmetic command is now executed directly instead of + being translated into `let "..."'. + +h. Fixes were made to the expansion code so that "$*", "$@", "${array[@]}", + and "${array[@]}" expand correctly when IFS does not contain a space + character, is unset, or is set to NULL. + +i. The indirect expansion code (${!var}) was changed so that the only + valid values of `var' are variable names, positional parameters, `#', + `@', and `*'. + +j. An arithmetic expression error in a $((...)) expansion now causes a + non-interactive shell running in posix mode to exit. + +k. Compound array assignment now splits the words within the parentheses + on shell metacharacters like the parser would before expansing them + and performing the assignment. This is for compatibility with ksh-93. + +l. The internal shell backslash-quoting code (used in the output of `set' + and completion) now quotes tildes if they appear at the start of the + string or after a `=' or `:'. + +m. A couple of bugs with `shopt -o' were fixed. + +n. `bash +o' now displays the same output as `set +o' before starting an + interactive shell. + +o. A bug that caused command substitution and the `eval' builtin to + occasionally free memory twice when an error was encountered was fixed. + +p. The filename globbing code no longer requires read permission for a + directory when the filename to be matched does not contain any globbing + characters, as POSIX.2 specifies. + +q. A bug was fixed so that the job containing the last asynchronous + process is not removed from the job table until a `wait' is executed + for that process or another asynchronous process is started. This + satisfies a POSIX.2 requirement. + +r. A `select' bug was fixed so that a non-numeric user response is treated + the same as a numeric response that is out of range. + +s. The shell no longer parses the value of SHELLOPTS from the environment + if it is restricted, running setuid, or running in `privileged mode'. + +t. Fixes were made to enable large file support on systems such as + Solaris 2.6, where the size of a file may be larger than can be held + in an `int'. + +u. The filename hashing code was fixed to not add `./' to the beginning of + filenames which already begin with `./'. + +v. The configure script was changed so that the GNU termcap library is not + compiled in if `prefer-curses' has been specified. + +w. HISTCONTROL and HISTIGNORE are no longer applied to the second and + subsequent lines of a multi-line command. + +x. A fix was made to `disown' so that it does a better job of catching + out-of-range jobs. + +y. Non-interactive shells no longer report the status of processes terminated + due to SIGINT, even if the standard output is a terminal. + +z. A bug that caused the output of `jobs' to have extra carriage returns + was fixed. + +aa. A bug that caused PIPESTATUS to not be set when builtins or shell + functions were executed in the foreground was fixed. + +bb. Bash now attempts to detect when it is being run by sshd, and treats + that case identically to being run by rshd. + +cc. A bug that caused `set -a' to export SHELLOPTS when one of the shell + options was changed was fixed. + +dd. The `kill' builtin now disallows empty or missing process id arguments + instead of treating them as identical to `0', which means the current + process. + +ee. `var=value declare -x var' now behaves identically to + `var=value export var'. Similarly for `var=value declare -r var' and + `var=value readonly var'. + +ff. A few memory leaks were fixed. + +gg. `alias' and `unalias' now print error messages when passed an argument + that is not an alias for printing or deletion, even when the shell is + not interactive, as POSIX.2 specifies. + +hh. `alias' and `alias -p' now return a status of 0 when no aliases are + defined, as POSIX.2 specifes. + +ii. `cd -' now prints the pathname of the new working directory if the shell + is interactive. + +jj. A fix was made so that the code that binds $PWD now copes with getcwd() + returning NULL. + +kk. `unset' now checks whether or not a function name it's trying to unset + is a valid shell identifier only when the shell is running in posix mode. + +ll. A change was made to the code that generates filenames for here documents + to make them less prone to name collisions. + +mm. The parser was changed so that `time' is recognized as a reserved word + only at the beginning of a pipeline. + +nn. The pathname canonicalization code was changed so that `//' is converted + into `/', but all other pathnames beginning with `//' are left alone, as + POSIX.2 specifies. + +oo. The `logout' builtin will no longer exit a non-interactive non-login + shell. + +2. Changes to Readline + +a. Fixed a problem in the readline test program rltest.c that caused a core + dump. + +b. The code that handles parser directives in inputrc files now displays + more error messages. + +c. The history expansion code was fixed so that the appearance of the + history comment character at the beginning of a word inhibits history + expansion for that word and the rest of the input line. + +3. New Features in Bash + +a. A new version of malloc, based on the older GNU malloc, that has many + changes, is more page-based, is more conservative with memory usage, + and does not `orphan' large blocks when they are freed. + +b. A new version of gmalloc, based on the old GLIBC malloc, with many + changes and range checking included by default. + +c. A new implementation of fnmatch(3) that includes full POSIX.2 Basic + Regular Expression matching, including character classes, collating + symbols, equivalence classes, and support for case-insensitive pattern + matching. + +d. ksh-88 egrep-style extended pattern matching ([@+*?!](patlist)) has been + implemented, controlled by a new `shopt' option, `extglob'. + +e. There is a new ksh-like `[[' compound command, which implements + extended `test' functionality. + +f. There is a new `printf' builtin, implemented according to the POSIX.2 + specification. + +g. There is a new feature for command substitution: $(< filename) now expands + to the contents of `filename', with any trailing newlines removed + (equivalent to $(cat filename)). + +h. There are new tilde prefixes which expand to directories from the + directory stack. + +i. There is a new `**' arithmetic operator to do exponentiation. + +j. There are new configuration options to control how bash is linked: + `--enable-profiling', to allow bash to be profiled with gprof, and + `--enable-static-link', to allow bash to be linked statically. + +k. There is a new configuration option, `--enable-cond-command', which + controls whether or not the `[[' command is included. It is on by + default. + +l. There is a new configuration option, `--enable-extended-glob', which + controls whether or not the ksh extended globbing feature is included. + It is enabled by default. + +m. There is a new configuration #define in config.h.top that, when enabled, + will cause all login shells to source /etc/profile and one of the user- + specific login shell startup files, whether or not the shell is + interactive. + +n. There is a new invocation option, `--dump-po-strings', to dump + a shell script's translatable strings ($"...") in GNU `po' format. + +o. There is a new `shopt' option, `nocaseglob', to enable case-insensitive + pattern matching when globbing filenames and using the `case' construct. + +p. There is a new `shopt' option, `huponexit', which, when enabled, causes + the shell to send SIGHUP to all jobs when an interactive login shell + exits. + +q. `bind' has a new `-u' option, which takes a readline function name as an + argument and unbinds all key sequences bound to that function in a + specified keymap. + +r. `disown' now has `-a' and `-r' options, to limit operation to all jobs + and running jobs, respectively. + +s. The `shopt' `-p' option now causes output to be displayed in a reusable + format. + +t. `test' has a new `-N' option, which returns true if the filename argument + has been modified since it was last accessed. + +u. `umask' now has a `-p' option to print output in a reusable format. + +v. A new escape sequence, `\xNNN', has been added to the `echo -e' and $'...' + translation code. It expands to the character whose ascii code is NNN + in hexadecimal. + +w. The prompt string expansion code has a new `\r' escape sequence. + +x. The shell may now be cross-compiled for the CYGWIN32 environment on + a Unix machine. + +4. New Features in Readline + +a. There is now an option for `iterative' yank-last-arg handline, so a user + can keep entering `M-.', yanking the last argument of successive history + lines. + +b. New variable, `print-completions-horizontally', which causes completion + matches to be displayed across the screen (like `ls -x') rather than up + and down the screen (like `ls'). + +c. New variable, `completion-ignore-case', which causes filename completion + and matching to be performed case-insensitively. + +d. There is a new bindable command, `magic-space', which causes history + expansion to be performed on the current readline buffer and a space to + be inserted into the result. + +e. There is a new bindable command, `menu-complete', which enables tcsh-like + menu completion (successive executions of menu-complete insert a single + completion match, cycling through the list of possible completions). + +f. There is a new bindable command, `paste-from-clipboard', for use on Win32 + systems, to insert the text from the Win32 clipboard into the editing + buffer. + +g. The key sequence translation code now understands printf-style backslash + escape sequences, including \NNN octal escapes. These escape sequences + may be used in key sequence definitions or macro values. + +h. An `$include' inputrc file parser directive has been added. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.01.1-release, +and the previous version, bash-2.01-release. + +1. Changes to Bash + +a. The select command was fixed to check the validity of the user's + input more strenuously. + +b. A bug was fixed that prevented `time' from timing commands correctly + when supplied as an argument to `bash -c'. + +c. A fix was made to the mail checking code to keep from adding the same + mail file to the list of files to check multiple times when parsing + $MAILPATH. + +d. Fixed an off-by-one error in the tilde expansion library. + +e. When using the compound array assignment syntax, the old value of + the array is cleared before assigning the new value. + +f. Fixed a bug that could cause a core dump when a trap handler was reset + to the default in the trap command associated with that signal. + +g. Fixed a bug in the locale code that occurred when assigning a value + to LC_ALL. + +h. A change was made to the parser so that words of the form xxx=(...) + are not considered compound assignment statements unless there are + characters before the `='. + +i. A fix was made to the command tracing code to correctly quote each + word of output. + +j. Some changes were made to the bash-specific autoconf tests to make them + more portable. + +k. Completion of words with globbing characters now correctly quotes the + result. + +l. The directory /var/spool/mail is now preferred to /usr/spool/mail when + configure is deciding on the default mail directory. + +m. The brace completion code was fixed to not quote the `{' and `}'. + +n. Some fixes were made to make $RANDOM more random in subshells. + +o. System-specific changes were made to configure for: SVR4.2 + +p. Changes were made so that completion of words containing globbing chars + substitutes the result only if a single filename was matched. + +q. The window size is now recomputed after a job is stopped with SIGTSTP if + the user has set `checkwinsize' with `shopt'. + +r. When doing substring expansion, out-of-range substring specifiers now + cause nothing to be substituted rather than an expansion error. + +s. A fix was made so that you can no longer trap `SIGEXIT' or `SIGDEBUG' -- + only `EXIT' and `DEBUG' are accepted. + +t. The display of trapped signals now uses the signal number if signals + for which bash does not know the name are trapped. + +u. A fix was made so that `bash -r' does not turn on restricted mode until + after the startup files are executed. + +v. A bug was fixed that occasionally caused a core dump when a variable + found in the temporary environment of export/declare/readonly had a + null value. + +w. A bug that occasionally caused unallocated memory to be passed to free() + when doing arithmetic substitution was fixed. + +x. A bug that caused a buffer overrun when expanding a prompt string + containing `\w' and ${#PWD} exceeded PATH_MAX was fixed. + +y. A problem with the completion code that occasionally caused it to + refer to a character before the beginning of the readline line buffer + was fixed. + +z. A bug was fixed so that the `read' builtin restarts reads when + interrupted by signals other than SIGINT. + +aa. Fixed a bug that caused a command to be freed twice when there was + an evaluation error in the `eval' command. + +2. Changes to Readline + +a. Added a missing `extern' to a declaration in readline.h that kept + readline from compiling cleanly on some systems. + +b. The history file is now opened with mode 0600 when it is written for + better security. + +c. Changes were made to the SIGWINCH handling code so that prompt redisplay + is done better. + +d. ^G now interrupts incremental searches correctly. + +e. A bug that caused a core dump when the set of characters to be quoted + when completing words was empty was fixed. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.01-release, +and the previous version, bash-2.01-beta2. + +1. Changes to Bash + +a. The `distclean' target should remove the `printenv' executable if it + has been created. + +b. The test suite was changed slightly to ensure that the error messages + are printed in English. + +c. A bug that caused the shell to dump core when a filename containing a + `/' was passed to `hash' was fixed. + +d. Pathname canonicalization now leaves a leading `//' intact, as POSIX.1 + requires. + +e. A memory leak when completing commands was fixed. + +f. A memory leak that occurred when checking the hash table for commands + with relative paths was fixed. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.01-beta2, +and the previous version, bash-2.01-beta1. + +1. Changes to Bash + +a. The `ulimit' builtin translates RLIM_INFINITY to the hard limit only if + the current (soft) limit is less than or equal to the hard limit. + +b. Fixed a bug that caused the bash emulation of strcasecmp to produce + incorrect results. + +c. A bug that caused memory to be freed twice when a trap handler resets + the trap more than once was fixed. + +d. A bug that caused machines where sizeof (pointer) > sizeof (int) to + fail (and possibly dump core) when trying to unwind-protect a null + pointer was fixed. + +e. The startup files should not be run with job control enabled. This fix + allows SIGINT to once again interrupt startup file execution. + +f. Bash should not change the SIGPROF handler if it is set to something + other than SIG_DFL. + +g. The completion code that provides bash-specific completions for readline + now quotes characters that the readline code would treat as word break + characters if they appear in a file name. + +h. The completion code now correctly quotes filenames containing a `!', + even if the user attempted to use double quotes when attempting + completion. + +i. A bug that caused the shell to dump core when `disown' was called without + arguments and there was no current job was fixed. + +j. A construct like $((foo);bar) is now processed as a command substitution + rather than as a bad arithmetic substitution. + +k. A couple of bugs that caused `fc' to not obey the `cmdhist' and `lithist' + shell options when editing and re-executing a series of commands were + fixed. + +l. A fix was made to the grammar -- the list of commands between `do' and + `done' in the body of a `for' command should be treated the same as a + while loop. + +2. Changes to Readline + +a. A couple of bugs that caused the history search functions to attempt to + free a NULL pointer were fixed. + +b. If the C library provides setlocale(3), readline does not need to look + at various environment variables to decide whether or not to go into + eight-bit mode automatically -- just check whether the current locale + is not `C' or `POSIX'. + +c. If the filename completion function finds that a directory was not closed + by a previous (interrupted) completion, it closes the directory with + closedir(). + +3. New Features in Bash + +a. New bindable readline commands: history-and-alias-expand-line and + alias-expand-line. The code was always in there, there was just no + way to execute it. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.01-beta1, +and the previous version, bash-2.01-alpha1. + +1. Changes to Bash + +a. Fixed a problem that could cause file descriptors used for process + substitution to conflict with those used explicitly in redirections. + +b. Made it easier to regenerate configure if the user changes configure.in. + +c. ${GROUPS[0]} should always be the primary group, even on systems without + multiple groups. + +d. Spelling correction is no longer enabled by default. + +e. Fixes to quoting problems in `bashbug'. + +f. OS-specific configuration changes were made for: Irix 6. + +g. OS-specific code changes were made for: QNX. + +h. A more meaningful message is now printed when the file in /tmp for a + here document cannot be created. + +i. Many changes to the shell's variable initialization code to speed + non-interactive startup. + +j. Changes to the non-job-control code so that it does not try to open + /dev/tty. + +k. The output of `set' and `export' is once again sorted, as POSIX wants. + +l. Fixed a problem caused by a recursive call reparsing the value of + $SHELLOPTS. + +m. The tilde code no longer calls getenv() when it's compiled as part of + the shell, which should eliminate problems on systems that cannot + redefine getenv(), like the NeXT OS. + +n. Fixed a problem that caused `bash -o' or `bash +o' to not list all + the shell options. + +o. Fixed `ulimit' to convert RLIM_INFINITY to the appropriate hard limit + only if the hard limit is greater than the current (soft) limit. + +p. Fixed a problem that arose when building bash in a different directory + than the source and y.tab.[ch] were remade with something other than + bison. This came up most often on NetBSD. + +q. Fixed a problem with completion -- it thought that `pwd`/[TAB] indicated + an unfinished command completion (`/), which generated errors. + +r. The bash special tilde expansions (~-, ~+) are now attempted before + calling the standard tilde expansion code, which should eliminate the + problems people have been seeing with this on Solaris 2.5.1. + +s. Added support for to places where it was missing. + +t. Changed the code that reads the output of a command substitution to not + go through stdio. This reduces the memory requirements and is faster. + +u. A number of changes to speed up export environment creation were made. + +v. A number of memory leaks were fixed as the result of running the test + scripts through Purify. + +w. Fixed a bug that caused subshells forked to interpret executable + scripts without a leading `#!' to not reinitialize the values of + the shell options. + +2. Changes to Readline + +a. History library has less `#ifdef SHELL' code -- abstracted stuff out + into application-specific function hooks. + +b. Readline no longer calls getenv() if it's compiled as part of the shell, + which should eliminate problems on systems that cannot redefine getenv(), + like the NeXT OS. + +c. Fixed translation of ESC when `untranslating' macro values. + +d. The region kill operation now fixes the mark if it ends up beyond the + boundaries of the line after the region is deleted. + +3. New Features in Bash + +a. New argument for `configure': `--with-curses'. This can be used to + override the selection of the termcap library on systems where it is + deficient. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.01-alpha1, +and the previous version, bash-2.0-release. + +1. Changes to Bash + +a. System-specific configuration changes for: FreeBSD, SunOS4, Irix, + MachTen, QNX 4.2, Harris Night Hawk, SunOS5. + +b. System-specific code changes were made for: Linux, 4.4 BSD, QNX 4.2, + HP-UX, AIX 4.2. + +c. A bug that caused the exec builtin to fail because the full pathname of + the command could not be found was fixed. + +d. The code that performs output redirections is now more resistant to + race conditions and possible security exploits. + +e. A bug that caused the shell to dump core when performing pattern + substitutions on variable values was fixed. + +f. More hosts are now recognized by the auto-configuration mechanism + (OpenBSD, QNX, others). + +g. Assignments to read-only variables that attempt to convert them to + arrays are now errors. + +h. A bug that caused shell scripts using array assignments in POSIX mode + to exit after the assignment was performed was fixed. + +i. The substring expansion code is now more careful about running off the + ends of the expanded variable value. + +j. A bug that caused completion to fail if a backquoted command substitution + appeared anywhere on the line was fixed. + +k. The `source' builtin no longer turns off history if it has been enabled + in a non-interactive shell. + +l. A bug that caused the shell to crash when `disown' was given a pid + instead of a job number was fixed. + +m. The `cd' spelling correction code will not try to change to `.' if no + directory entries match a single-character argument. + +n. A bad variable name supplied to `declare', `export', or `readonly' no + longer causes a non-interactive shell in POSIX mode to exit. + +o. Some fixes were made to the test suite to handle peculiarities of + various Unix versions. + +p. The bash completion code now quotes characters that readline would + treat as word breaks for completion but are not shell metacharacters. + +q. Bad options supplied at invocation now cause a usage message to be + displayed. + +r. Fixes were made to the code that handles DEBUG traps so that the trap + string is not freed inappropriately. + +s. Some changes were made to the bash debugger in examples/bashdb -- it + should be closer to working now. + +t. A problem that caused the default filename used for mail checking to be + wrong was fixed. + +u. A fix was made to the `echo' builtin so that NUL characters printed with + `echo -e' do not cause the output to be truncated. + +v. A fix was made to the job control code so that the shell behaves better + when monitor mode is enabled in a non-interactive shell. + +w. Bash no longer catches all of the terminating signals in a non- + interactive shell until a trap is set on EXIT, which should result in + quicker startup. + +x. A fix was made to the command timing code so that `time' can be used in + a loop. + +y. A fix was made to the parser so that `((cmd); cmd2)' is now parsed as + a nested subshell rather than strictly as an (erroneous) arithmetic + command. + +z. A fix was made to the globbing code so that it correctly matches quoted + filenames beginning with a `.'. + +aa. A bug in `fc' that caused some multi-line commands to not be stored as + one command in the history when they were re-executed after editing + (with `fc -e') was fixed. + +bb. The `ulimit' builtin now attempts to catch some classes of integer + overflows. + +cc. The command-oriented-history code no longer attempts to add `;' + inappropriately when a newline appears while reading a $(...) command + substitution. + +dd. A bug that caused the shell to dump core when `help --' was executed + was fixed. + +ee. A bug that caused the shell to crash when an unset variable appeared + in the body of a here document after `set -u' had been executed was + fixed. + +ff. Implicit input redirections from /dev/null for asynchronous commands + are now handled better. + +gg. A bug that caused the shell to fail to compile when configured with + `--disable-readline' was fixed. + +hh. The globbing code should now be interruptible. + +ii. Bash now notices when the `kill' builtin is used to send SIGCONT to a + stopped job and adjusts the data structures accordingly, as if `bg' had + been executed instead. + +jj. A bug that caused the shell to crash when mixing calls to `getopts' + and `shift' on the same set of positional parameters was fixed. + +kk. The command printing code now preserves the `-p' flag to `time'. + +ll. The command printing code now handles here documents better when there + are other redirections associated with the command. + +mm. The special glibc environment variable (NNN_GNU_nonoption_argv_flags_) + is no longer placed into the environment of executed commands -- users + of glibc had too many problems with it. + +nn. Reorganized the code that generates signames.h. The signal_names list + is now more complete but may be slightly different (SIGABRT is favored + over SIGIOT, for example). The preferred signal names are those + listed in the POSIX.2 standard. + +oo. `bashbug' now uses a filename shorter than 14 characters for its + temporary file, and asks for confirmation before sending the bug + report. + +pp. A bug that caused TAB completion in vi editing mode to not be turned + off when `set -o posix' was executed or back on when `set +o posix' + was executed was fixed. + +qq. A bug in the brace expansion code that caused brace expansions appearing + in new-style $(...) command substitutions to be inappropriately expanded + was fixed. + +rr. A bug in the readline hook shell-expand-line that could cause memory to + be inappropriately freed was fixed. + +ss. A bug that caused some arithmetic expressions containing `&&' and `||' + to be parsed with the wrong precedence has been fixed. + +tt. References to unbound variables after `set -u' has been executed now + cause the shell to exit immediately, as they should. + +uu. A bug that caused the shell to exit inappropriately when `set -e' had + been executed and a command's return status was being inverted with the + `!' reserved word was fixed. + +vv. A bug that could occasionally cause the shell to crash with a + divide-by-zero error when timing a command was fixed. + +ww. A bug that caused parameter pattern substitution to leave stray + backslashes in the replacement string when the expression is in + double quotes was fixed. + +xx. The `break' and `continue' builtins now break out of all loops when an + invalid count argument is supplied. + +yy. Fixed a bug that caused PATH to be set to the empty string if + `command -p' is executed with PATH unset. + +zz. Fixed `kill -l signum' to print the signal name without the `SIG' prefix, + as POSIX specifies. + +aaa. Fixed a bug that caused the shell to crash while setting $SHELLOPTS + if there were no shell options set. + +bbb. Fixed `export -p' and `readonly -p' so that when the shell is in POSIX + mode, their output is as POSIX.2 specifies. + +ccc. Fixed a bug in `readonly' so that `readonly -a avar=(...)' actually + creates an array variable. + +ddd. Fixed a bug that prevented `time' from correctly timing background + pipelines. + +2. Changes to Readline + +a. A bug that caused an extra newline to be printed when the cursor was on + an otherwise empty line was fixed. + +b. An instance of memory being used after it was freed was corrected. + +c. The redisplay code now works when the prompt is longer than the screen + width. + +d. `dump-macros' is now a bindable name, as it should have been all along. + +e. Non-printable characters are now expanded when displaying macros and + their values. + +f. The `dump-variables' and `dump-macros' commands now output a leading + newline if they're called as the result of a key sequence, rather + than directly by an application. + +3. New Features in Bash + +a. There is a new builtin array variable: GROUPS, the set of groups to which + the user belongs. This is used by the test suite. + +4. New Features in Readline + +a. If a key sequence bound to `universal-argument' is read while reading a + numeric argument started with `universal-argument', it terminates the + argument but is otherwise ignored. This provides a way to insert multiple + instances of a digit string, and is how GNU emacs does it. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.0-release, +and the previous version, bash-2.0-beta3. + +1. Changes to Bash + +a. Fix to the `getopts' builtin so that it does the right thing when a + required option argument is not present. + +b. The completion code now updates the common prefix of matched names + after FIGNORE processing is done, since any names that were removed + may have changed the common prefix. + +c. Fixed a bug that made messages in MAILPATH entries not work correctly. + +d. Fixed a serious documentation error in the description of the new + ${parameter:offset[:length]} expansion. + +e. Fixes to make parameter substring expansion ({$param:offset[:length]}) + work when within double quotes. + +f. Fixes to make ^A (CTLESC) survive an unquoted expansion of positional + parameters. + +g. Corrected a misspelling of `unlimited' in the output of `ulimit'. + +h. Fixed a bug that caused executable scripts without a leading `#!' to + occasionally pick up the wrong set of positional parameters. + +i. Linux systems now have a working `ulimit -v', using RLIMIT_AS. + +j. Updated config.guess so that many more machine types are recognized. + +k. Fixed a bug with backslash-quoted slashes in the ${param/pat[/sub]} + expansion. + +l. If the shell is named `-su', and `-c command' is supplied, read and + execute the login shell startup files even though the shell is not + interactive. This is to support the `-' option to `su'. + +m. Fixed a bug that caused core dumps when the DEBUG trap was ignored + with `trap "" DEBUG' and a shell function was subsequently executed. + +n. Fixed a bug that caused core dumps in the read builtin when IFS was + set to the null string and the input had leading whitespace. + +2. Changes to Readline + +a. Fixed a bug that caused a numeric argument of 1024 to be ignored when + inserting text. + +b. Fixed the display code so that the numeric argument is displayed as it's + being entered. + +c. Fixed the numeric argument reading code so that `M-- command' is + equivalent to `M--1 command', as the prompt implies. + +3. New Features in Bash + +a. `ulimit' now sets both hard and soft limits and reports the soft limit + by default (when neither -H nor -S is specified). This is compatible + with versions of sh and ksh that implement `ulimit'. + +b. Integer constants have been extended to base 64. + +4. New Features in Readline + +a. The `home' and `end' keys are now bound to beginning-of-line and + end-of-line, respectively, if the corresponding termcap capabilities + are present. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.0-beta3, +and the previous version, bash-2.0-beta2. + +1. Changes to Bash + +a. System-specific changes for: AIX 4.2, SCO 3.2v[45], HP-UX. + +b. When in POSIX mode, variable assignments preceding a special builtin + persist in the shell environment after the builtin completes. + +c. Changed all calls to getwd() to getcwd(). Improved check for systems + where the libc getcwd() calls popen(), since that breaks on some + systems when job control is being used. + +d. Fixed a bug that caused seg faults when executing scripts with the + execute bit set but without a leading `#!'. + +e. The environment passed to executed commands is never sorted. + +f. A bug was fixed in the code that expands ${name[@]} to the number of + elements in an array variable. + +g. A bug was fixed in the array compound assignment code ( A=( ... ) ). + +h. Window size changes now correctly propagate down to readline if + the shopt `checkwinsize' option is enabled. + +i. A fix was made in the code that expands to the length of a variable + value (${#var}). + +j. A fix was made to the command builtin so that it did not turn on the + `no fork' flag inappropriately. + +k. A fix was made to make `set -n' work more reliably. + +l. A fix was made to the job control initialization code so that the + terminal process group is set to the shell's process group if the + shell changes its own process group. + +2. Changes to Readline + +a. System-specific changes for: SCO 3.2v[45]. + +b. The behavior of the vi-mode `.' when redoing an `i' command was changed + to insert the text previously inserted by the `i' command rather than + simply entering insert mode. + +3. New features in Bash + +a. There is a new version of the autoload function package, in + examples/functions/autoload.v2, that uses arrays and provides more + functionality. + +b. Support for LC_COLLATE and locale-specific sorting of the results of + pathname expansion if strcoll() is available. + +4. New Features in Readline + +a. Support for locale-specific sorting of completion possibilities if + strcoll() is available. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.0-beta2, +and the previous version, bash-2.0-beta1. + +1. Changes to Bash + +a. `pushd -' is once again equivalent to `pushd $OLDPWD'. + +b. OS-specific changes for: SCO 3.2v[45]. + +c. A change was made to the fix for the recently-reported security hole + when reading characters with octal value 255 to make it work better on + systems with restartable system calls when not using readline. + +d. Some changes were made to the test suite so that it works if you + configure bash with --enable-usg-echo-default. + +e. A fix was made to the parsing of conditional arithmetic expressions. + +f. Illegal arithmetic bases now cause an arithmetic evaluation error rather + than being silently reset. + +g. Multiple arithmetic bases now cause an arithmetic evaluation error + instead of being ignored. + +h. A fix was made to the evaluation of ${param?word} to conform to POSIX.2. + +i. A bug that sometimes caused array indices to be evaluated twice (which + would cause errors when they contained assignment statements) was fixed. + +j. `ulimit' was rewritten to avoid problems with getrlimit(2) returning + unsigned values and to simplify the code. + +k. A bug in the command-oriented-history code that caused it to sometimes + put semicolons after right parens inappropriately was fixed. + +l. The values inserted into the prompt by the \w and \W escape sequences + are now quoted to prevent further expansion. + +m. An interactive shell invoked as `sh' now reads and executes commands + from the file named by $ENV when it starts up. If it's a login shell, + it does this after reading /etc/profile and ~/.profile. + +n. The file named by $ENV is never read by non-interactive shells. + +2. Changes to Readline + +a. A few changes were made to hide some macros and functions that should not + be public. + +b. An off-by-one error that caused seg faults in the history expansion code + was fixed. + +3. New Features in Bash + +a. The ksh-style ((...)) arithmetic command was implemented. It is exactly + identical to let "...". This is controlled by a new option to configure, + `--enable-dparen-arithmetic', which is on by default. + +b. There is a new #define available in config.h.top: SYS_BASH_LOGOUT. If + defined to a filename, bash reads and executes commands from that file + when a login shell exits. It's commented out by default. + +c. `ulimit' has a `-l' option that reports the maximum amount of data that + may be locked into memory on 4.4BSD-based systems. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.0-beta1, +and the previous version, bash-2.0-alpha4. + +1. Changes to Bash + +a. A bug that sometimes caused traps to be ignored on signals the + shell treats specially was fixed. + +b. The internationalization code was changed to track the values of + LC_* variables and call setlocale() as appropriate. The TEXTDOMAIN + and TEXTDOMAINDIR variables are also tracked; changes cause calls + to textdomain() and bindtextdomain(), if available. + +c. A bug was fixed that sometimes caused double-quoted strings to be + parsed incorrectly. + +d. Changes were made so that the siglist code compiles correctly on + Solaris 2.5. + +e. Added `:' to the set of characters that cause word breaks for the + completion code so that pathnames in assignments to $PATH can be + completed. + +f. The `select' command was fixed to print $PS3 to stderr. + +g. Fixed an error in the manual page section describing the effect that + setting and unsetting GLOBIGNORE has on the setting of the `dotglob' + option. + +h. The time conversion code now uses CLK_TCK rather than CLOCKS_PER_SEC + on systems without gettimeofday() and resources. + +i. The getopt static variables are now initialized each time a subshell + is started, so subshells using `getopts' work right. + +j. A sign-extension bug that caused a possible security hole was fixed. + +k. The parser now reads characters between backquotes within a double- + quoted string as a single word, so double quotes in the backquoted + string don't terminate the enclosing double-quoted string. + +l. A bug that caused `^O' to work incorrectly when typed as the first + thing to an interactive shell was fixed. + +m. A rarely-exercised off-by-one error in the code that quotes variable + values was fixed. + +n. Some memory and file descriptor leaks encountered when running a + shell script that is executable but does not have a leading `#!' + were plugged. + +2. Changes to Readline + +a. A bug that sometimes caused incorrect results when trying to read + typeahead on systems without FIONREAD was fixed. + +3. New Features in Bash + +a. The command timing code now uses the value of the TIMEFORMAT variable + to format and display timing statistics. + +b. The `time' reserved word now accepts a `-p' option to force the + POSIX.2 output format. + +c. There are a couple of new and updated scripts to convert csh startup + files to bash format. + +d. There is a new builtin array variable: BASH_VERSINFO. The various + members hold the parts of the version information in BASH_VERSION, + plus the value of MACHTYPE. + +4. New Features in Readline + +a. Setting LANG to `en_US.ISO8859-1' now causes readline to enter + eight-bit mode. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.0-alpha4, +and the previous version, bash-2.0-alpha3. + +1. Changes to Bash + +a. There is better detection of rsh connections on Solaris 2. + +b. Assignments to read-only variables preceding a command name are now + variable assignment errors. Variable assignment errors cause + non-interactive shells running in posix mode to exit. + +c. The word tokenizer was rewritten to handle nested quotes and pairs + ('', "", ``, ${...}, $(...), $[...], $'...', $"...", <(...), >(...)) + correctly. Some of the parameter expansion code was updated as a + consequence. + +d. A fix was made to `test' when given three arguments so that a binary + operator is checked for first, before checking that the first argument + is `!'. + +e. 2''>/dev/null is no longer equivalent to 2>/dev/null. + +f. Parser error messages were regularized, and in most cases the name of + the shell script being read by a non-interactive shell is not printed + twice. + +g. A fix was made to the completion code so that it no longer removes the + text the user typed in some cases. + +h. The special glibc `getopt' environment variable is no longer put into + the environment on machines with small values of ARG_MAX. + +i. The expansion of ${...} now follows the POSIX.2 rules for finding the + closing `}'. + +j. The shell no longer displays spurious status messages for background + jobs in shell scripts that complete successfully when the script is + run from a terminal. + +k. `shopt -o' now correctly updates $SHELLOPTS. + +l. A bug that caused the $PATH searching code to return a non-executable + file even when an executable file with the same name appeared later in + $PATH was fixed. + +m. The shell now does tilde expansions on unquoted `:~' in assignment + statements when not in posix mode. + +n. Variable assignment errors when a command consists only of assignments + now cause non-interactive shells to exit when in posix mode. + +o. If the variable in a `for' or `select' command is read-only, or not a + legal shell identifier, a variable assignment error occurs. + +p. `test' now handles `-a' and `-o' as binary operators when three arguments + are supplied, and correctly parses `( word )' as equivalent to `word'. + +q. `test' was fixed so that file names of the form /dev/fd/NN mean the same + thing on all systems, even Linux. + +r. Fixed a bug in the globbing code that caused patterns with multiple + consecutive `*'s to not be matched correctly. + +s. Fixed a bug that caused $PS2 to not be printed when an interactive shell + not using readline is reading a here document. + +t. Fixed a bug that caused history expansion to be performed inappropriately + when a single-quoted string spanned more than one line. + +u. `getopts' now checks that the variable name passed by the user as the + second argument is a legal shell identifier and that the variable is + not read-only. + +v. Fixed `getopts' to obey POSIX.2 rules for setting $OPTIND when it + encounters an error. + +w. Fixed `set' to display variable values in a form that can be re-read. + +x. Fixed a bug in the code that keeps track of whether or not local variables + have been declared at the current level of function nesting. + +y. Non-interactive shells in posix mode now exit if the name in a function + declaration is not a legal identifier. + +z. The job control code now ignores stopped children when the shell is not + interactive. + +aa. The `cd' builtin no longer attempts spelling correction on the directory + name if the shell is not interactive, regardless of the setting of the + `cdspell' option. + +bb. Some OS-specific changes were made for SCO 3.2v[45] and AIX 4.2. + +cc. `time' now prints its output to stderr, as POSIX.2 specifies. + +2. Fixes to Readline + +a. After printing possible completions, all lines of a multi-line prompt + are redisplayed. + +b. Some changes were made to the terminal handling code in rltty.c to + work around AIX 4.2 bugs. + +3. New Features in Bash + +a. There is a new loadable builtin: sprintf, with calling syntax + sprintf var format [args] + This provides an easy way to simulate ksh left- and right-justified + variable values. + +b. The expansions of \h and \H in prompt strings were swapped. \h now + expands to the hostname up to the first `.', as in bash-1.14. + +4. New Features in Readline + +a. The bash-1.14 behavior when ^M is typed while doing an incremental + search was restored. ^J may now be used to terminate the search without + accepting the line. + +b. There is a new bindable variable: disable-completion. This inhibits + word completion and causes the completion character to be inserted as + if it had been bound to self-insert. + +------------------------------------------------------------------------------ +This document details the changes between this version, bash-2.0-alpha3, +and the previous version, bash-2.0-alpha2. + +There is now a file `COMPAT' included in the distribution that lists the +user-visible incompatibilities between 1.14 and 2.0. + +1. Changes to Bash + +a. Some work was done so that word splitting of the rhs of assignment + statements conforms more closely to historical practice. + +b. A couple of errant memory frees were fixed. + +c. A fix was made to the test builtin so it recognizes `<' and `>' as + binary operators. + +d. The GNU malloc in lib/malloc/malloc.c now scrambles memory as it's + allocated and freed. This is to catch callers that refer to freed + memory or assume something about newly-allocated memory. + +e. Fixed a problem with conversion to 12-hour time in the prompt + expansion code. + +f. Fixed a problem with configure's argument parsing order. Now you can + correctly turn on specific options after using --enable-minimal-config. + +g. The configure script now automatically disables the use of GNU malloc + on systems where it's appropriate (better than having people read the + NOTES file and do it manually). + +h. There are new prompt expansions (\v and \V) to insert version information + into the prompt strings. + +i. The default prompt string now includes the version number. + +j. Most of the builtins that take no options were changed to use the + internal getopt so they can produce proper error messages for -? + and incorrect options. + +k. Some system-specific changes were made for SVR4.2 and Solaris 2.5. + +l. Bash now uses PATH_MAX instead of MAXPATHLEN and NAME_MAX instead of + MAXNAMLEN. + +m. A couple of problems caused by uninitialized variables were fixed. + +n. There are a number of new loadable builtin examples: logname, basename, + dirname, tty, pathchk, tee, head, and rmdir. All of these conform to + POSIX.2. + +o. Bash now notices changes in TZ and calls tzset() if present, so + changing TZ will alter the time printed by prompt expansions. + +p. The source was reorganized a bit so I don't have to wait so long for + some files to compile, and to facilitate the creation of a `shell + library' at some future point. + +q. Bash no longer turns off job control if called as `sh', since the + POSIX.2 spec includes job control as a standard feature. + +r. `bash -o posix' now works as intended. + +s. Fixed a problem with the completion code: when completing a filename + that contained globbing characters, if show-all-if-ambiguous was set, + the completion code would remove the user's text. + +t. Fixed ulimit so that (hopefully) the full range of limits is available + on HPUX systems. + +u. A new `shopt' option (`hostcomplete') enables and disables hostname + completion. + +v. The shell no longer attempts to save the history on an abort(), + which is usually called by programming_error(). + +w. The `-s' option to `fc' was changed to echo the command to be executed + to stderr instead of stdout. + +x. If the editor invoked by `fc -e' exits with a non-zero status, no + commands are executed. + +y. Fixed a bug that made the shopt `histverify' option work incorrectly. + +z. There is a new variable `MACHTYPE' whose value is the GNU-style + `cpu-company-system' system description as set by configure. (The + values of MACHTYPE and HOSTTYPE should really be swapped.) + +aa. The `ulimit' builtin now allows the maximum virtual memory size to be + set via setrlimit(2) if RLIMIT_VMEM is defined. + +bb. `bash -nc 'command'' no longer runs `command'. + +2. Changes to Readline + +a. Fixed a typo in the code that checked for FIONREAD in input.c. + +b. Fixed a bug in the code that outputs keybindings, so things like C-\ + are quoted properly. + +c. Fixed a bug in the inputrc file parsing code to handle the problems + caused by inputrc files created from the output of `bind -p' in + previous versions of bash. The problem was due to the bug fixed + in item b above. + +d. Readline no longer turns off the terminal's meta key, and turns it on + once the first time it's called. + +------------------------------------------------------------------------------ +This file documents the changes between this version, bash-2.0-alpha2, +and the previous version, bash-2.0-alpha. + +1. Changes to Bash + +a. The shell no longer thinks directories are executable. + +b. `disown' has a new option, `h', which inhibits the resending of SIGHUP + but does not remove the job from the jobs table. + +c. The varargs functions in error.c now use ANSI-C `stdarg' if available. + +d. The build process now treats the `build version' in .build as local to + the build directory, so different versions built from the same source + tree have different `build versions'. + +e. Some problems with the grammar have been fixed. (It used `list' in a few + productions where `compound_list' was needed. A `list' must be terminated + with a newline or semicolon; a `compound_list' need not be.) + +f. A fix was made to keep `wait' from hanging when waiting for all background + jobs. + +g. `bash --help' now writes its output to stdout, like the GNU Coding Standards + specify, and includes the machine type (the value of MACHTYPE). + +h. `bash --version' now prints more information and exits successfully, like + the GNU Coding Standards specify. + +i. The output of `time' and `times' now prints fractional seconds with three + places after the decimal point. + +j. A bug that caused process substitutions to screw up the pipeline printed + by `jobs' was fixed. + +k. Fixes were made to the code that implements $'...' and $"..." so they + work as documented. + +l. The process substitution code now opens named pipes for reading with + O_NONBLOCK to avoid hanging. + +m. Fixes were made to the trap code so the shell cleans up correctly if the + trap command contains a `return' and we're executing a function or + sourcing a script with `.'. + +n. Fixes to doc/Makefile.in so that it doesn't try to remake all of the + documentation (ps, dvi, etc.) on a `make install'. + +o. Fixed an auto-increment error that caused bash -c args to sometimes dump + core. + +p. Fixed a bug that caused $HISTIGNORE to fail when the history line + contained globbing characters. + +2. Changes to Readline + +a. There is a new string variable, rl_library_version, available for use by + applications. The current value is "2.1". + +b. A bug encountered when expand-tilde was enabled and file completion was + attempted on a word beginning with `~/' was fixed. + +c. A slight change was made to the incremental search termination behavior. + ESC still terminates the search, but if input is pending or arrives + within 0.1 seconds (on systems with select(2)), it is used as a prefix + character. This is intented to allow users to terminate searches with + the arrow keys and get the behavior they expect. diff --git a/COMPAT b/COMPAT new file mode 100644 index 0000000..c9e768c --- /dev/null +++ b/COMPAT @@ -0,0 +1,425 @@ +Compatibility with previous versions +==================================== + +This document details the incompatibilities between this version of bash, +bash-4.3, and the previous widely-available versions, bash-3.x (which is +still the `standard' version for Mac OS X), 4.0/4.1 (which are still +standard on a few Linux distributions), and bash-4.2, the current +widely-available version. These were discovered by users of bash-2.x +through 4.x, so this list is not comprehensive. Some of these +incompatibilities occur between the current version and versions 2.0 and +above. + +1. Bash uses a new quoting syntax, $"...", to do locale-specific + string translation. Users who have relied on the (undocumented) + behavior of bash-1.14 will have to change their scripts. For + instance, if you are doing something like this to get the value of + a variable whose name is the value of a second variable: + + eval var2=$"$var1" + + you will have to change to a different syntax. + + This capability is directly supported by bash-2.0: + + var2=${!var1} + + This alternate syntax will work portably between bash-1.14 and bash-2.0: + + eval var2=\$${var1} + +2. One of the bugs fixed in the YACC grammar tightens up the rules + concerning group commands ( {...} ). The `list' that composes the + body of the group command must be terminated by a newline or + semicolon. That's because the braces are reserved words, and are + recognized as such only when a reserved word is legal. This means + that while bash-1.14 accepted shell function definitions like this: + + foo() { : } + + bash-2.0 requires this: + + foo() { :; } + + This is also an issue for commands like this: + + mkdir dir || { echo 'could not mkdir' ; exit 1; } + + The syntax required by bash-2.0 is also accepted by bash-1.14. + +3. The options to `bind' have changed to make them more consistent with + the rest of the bash builtins. If you are using `bind -d' to list + the readline key bindings in a form that can be re-read, use `bind -p' + instead. If you were using `bind -v' to list the key bindings, use + `bind -P' instead. + +4. The `long' invocation options must now be prefixed by `--' instead + of `-'. (The old form is still accepted, for the time being.) + +5. There was a bug in the version of readline distributed with bash-1.14 + that caused it to write badly-formatted key bindings when using + `bind -d'. The only key sequences that were affected are C-\ (which + should appear as \C-\\ in a key binding) and C-" (which should appear + as \C-\"). If these key sequences appear in your inputrc, as, for + example, + + "\C-\": self-insert + + they will need to be changed to something like the following: + + "\C-\\": self-insert + +6. A number of people complained about having to use ESC to terminate an + incremental search, and asked for an alternate mechanism. Bash-2.03 + uses the value of the settable readline variable `isearch-terminators' + to decide which characters should terminate an incremental search. If + that variable has not been set, ESC and Control-J will terminate a + search. + +7. Some variables have been removed: MAIL_WARNING, notify, history_control, + command_oriented_history, glob_dot_filenames, allow_null_glob_expansion, + nolinks, hostname_completion_file, noclobber, no_exit_on_failed_exec, and + cdable_vars. Most of them are now implemented with the new `shopt' + builtin; others were already implemented by `set'. Here is a list of + correspondences: + + MAIL_WARNING shopt mailwarn + notify set -o notify + history_control HISTCONTROL + command_oriented_history shopt cmdhist + glob_dot_filenames shopt dotglob + allow_null_glob_expansion shopt nullglob + nolinks set -o physical + hostname_completion_file HOSTFILE + noclobber set -o noclobber + no_exit_on_failed_exec shopt execfail + cdable_vars shopt cdable_vars + +8. `ulimit' now sets both hard and soft limits and reports the soft limit + by default (when neither -H nor -S is specified). This is compatible + with versions of sh and ksh that implement `ulimit'. The bash-1.14 + behavior of, for example, + + ulimit -c 0 + + can be obtained with + + ulimit -S -c 0 + + It may be useful to define an alias: + + alias ulimit="ulimit -S" + +9. Bash-2.01 uses a new quoting syntax, $'...' to do ANSI-C string + translation. Backslash-escaped characters in ... are expanded and + replaced as specified by the ANSI C standard. + +10. The sourcing of startup files has changed somewhat. This is explained + more completely in the INVOCATION section of the manual page. + + A non-interactive shell not named `sh' and not in posix mode reads + and executes commands from the file named by $BASH_ENV. A + non-interactive shell started by `su' and not in posix mode will read + startup files. No other non-interactive shells read any startup files. + + An interactive shell started in posix mode reads and executes commands + from the file named by $ENV. + +11. The <> redirection operator was changed to conform to the POSIX.2 spec. + In the absence of any file descriptor specification preceding the `<>', + file descriptor 0 is used. In bash-1.14, this was the behavior only + when in POSIX mode. The bash-1.14 behavior may be obtained with + + <>filename 1>&0 + +12. The `alias' builtin now checks for invalid options and takes a `-p' + option to display output in POSIX mode. If you have old aliases beginning + with `-' or `+', you will have to add the `--' to the alias command + that declares them: + + alias -x='chmod a-x' --> alias -- -x='chmod a-x' + +13. The behavior of range specificiers within bracket matching expressions + in the pattern matcher (e.g., [A-Z]) depends on the current locale, + specifically the value of the LC_COLLATE environment variable. Setting + this variable to C or POSIX will result in the traditional ASCII behavior + for range comparisons. If the locale is set to something else, e.g., + en_US (specified by the LANG or LC_ALL variables), collation order is + locale-dependent. For example, the en_US locale sorts the upper and + lower case letters like this: + + AaBb...Zz + + so a range specification like [A-Z] will match every letter except `z'. + Other locales collate like + + aAbBcC...zZ + + which means that [A-Z] matches every letter except `a'. + + The portable way to specify upper case letters is [:upper:] instead of + A-Z; lower case may be specified as [:lower:] instead of a-z. + + Look at the manual pages for setlocale(3), strcoll(3), and, if it is + present, locale(1). + + You can find your current locale information by running locale(1): + + caleb.ins.cwru.edu(2)$ locale + LANG=en_US + LC_CTYPE="en_US" + LC_NUMERIC="en_US" + LC_TIME="en_US" + LC_COLLATE="en_US" + LC_MONETARY="en_US" + LC_MESSAGES="en_US" + LC_ALL=en_US + + My advice is to put + + export LC_COLLATE=C + + into /etc/profile and inspect any shell scripts run from cron for + constructs like [A-Z]. This will prevent things like + + rm [A-Z]* + + from removing every file in the current directory except those beginning + with `z' and still allow individual users to change the collation order. + Users may put the above command into their own profiles as well, of course. + +14. Bash versions up to 1.14.7 included an undocumented `-l' operator to + the `test/[' builtin. It was a unary operator that expanded to the + length of its string argument. This let you do things like + + test -l $variable -lt 20 + + for example. + + This was included for backwards compatibility with old versions of the + Bourne shell, which did not provide an easy way to obtain the length of + the value of a shell variable. + + This operator is not part of the POSIX standard, because one can (and + should) use ${#variable} to get the length of a variable's value. + Bash-2.x does not support it. + +15. Bash no longer auto-exports the HOME, PATH, SHELL, TERM, HOSTNAME, + HOSTTYPE, MACHTYPE, or OSTYPE variables. If they appear in the initial + environment, the export attribute will be set, but if bash provides a + default value, they will remain local to the current shell. + +16. Bash no longer initializes the FUNCNAME, GROUPS, or DIRSTACK variables + to have special behavior if they appear in the initial environment. + +17. Bash no longer removes the export attribute from the SSH_CLIENT or + SSH2_CLIENT variables, and no longer attempts to discover whether or + not it has been invoked by sshd in order to run the startup files. + +18. Bash no longer requires that the body of a function be a group command; + any compound command is accepted. + +19. As of bash-3.0, the pattern substitution operators no longer perform + quote removal on the pattern before attempting the match. This is the + way the pattern removal functions behave, and is more consistent. + +20. After bash-3.0 was released, I reimplemented tilde expansion, incorporating + it into the mainline word expansion code. This fixes the bug that caused + the results of tilde expansion to be re-expanded. There is one + incompatibility: a ${paramOPword} expansion within double quotes will not + perform tilde expansion on WORD. This is consistent with the other + expansions, and what POSIX specifies. + +21. A number of variables have the integer attribute by default, so the += + assignment operator returns expected results: RANDOM, LINENO, MAILCHECK, + HISTCMD, OPTIND. + +22. Bash-3.x is much stricter about $LINENO correctly reflecting the line + number in a script; assignments to LINENO have little effect. + +23. By default, readline binds the terminal special characters to their + readline equivalents. As of bash-3.1/readline-5.1, this is optional and + controlled by the bind-tty-special-chars readline variable. + +24. The \W prompt string expansion abbreviates $HOME as `~'. The previous + behavior is available with ${PWD##/*/}. + +25. The arithmetic exponentiation operator is right-associative as of bash-3.1. + +26. The rules concerning valid alias names are stricter, as per POSIX.2. + +27. The Readline key binding functions now obey the convert-meta setting active + when the binding takes place, as the dispatch code does when characters + are read and processed. + +28. The historical behavior of `trap' reverting signal disposition to the + original handling in the absence of a valid first argument is implemented + only if the first argument is a valid signal number. + +29. In versions of bash after 3.1, the ${parameter//pattern/replacement} + expansion does not interpret `%' or `#' specially. Those anchors don't + have any real meaning when replacing every match. + +30. Beginning with bash-3.1, the combination of posix mode and enabling the + `xpg_echo' option causes echo to ignore all options, not looking for `-n' + +31. Beginning with bash-3.2, bash follows the Bourne-shell-style (and POSIX- + style) rules for parsing the contents of old-style backquoted command + substitutions. Previous versions of bash attempted to recursively parse + embedded quoted strings and shell constructs; bash-3.2 uses strict POSIX + rules to find the closing backquote and simply passes the contents of the + command substitution to a subshell for parsing and execution. + +32. Beginning with bash-3.2, bash uses access(2) when executing primaries for + the test builtin and the [[ compound command, rather than looking at the + file permission bits obtained with stat(2). This obeys restrictions of + the file system (e.g., read-only or noexec mounts) not available via stat. + +33. Bash-3.2 adopts the convention used by other string and pattern matching + operators for the `[[' compound command, and matches any quoted portion + of the right-hand-side argument to the =~ operator as a string rather + than a regular expression. + +34. Bash-4.0 allows the behavior in the previous item to be modified using + the notion of a shell `compatibility level'. If the compat31 shopt + option is set, quoting the pattern has no special effect. + +35. Bash-3.2 (patched) and Bash-4.0 fix a bug that leaves the shell in an + inconsistent internal state following an assignment error. One of the + changes means that compound commands or { ... } grouping commands are + aborted under some circumstances in which they previously were not. + This is what Posix specifies. + +36. Bash-4.0 now allows process substitution constructs to pass unchanged + through brace expansion, so any expansion of the contents will have to be + separately specified, and each process subsitution will have to be + separately entered. + +37. Bash-4.0 now allows SIGCHLD to interrupt the wait builtin, as Posix + specifies, so the SIGCHLD trap is no longer always invoked once per + exiting child if you are using `wait' to wait for all children. As + of bash-4.2, this is the status quo only when in posix mode. + +38. Since bash-4.0 now follows Posix rules for finding the closing delimiter + of a $() command substitution, it will not behave as previous versions + did, but will catch more syntax and parsing errors before spawning a + subshell to evaluate the command substitution. + +39. The programmable completion code uses the same set of delimiting characters + as readline when breaking the command line into words, rather than the + set of shell metacharacters, so programmable completion and readline + should be more consistent. + +40. When the read builtin times out, it attempts to assign any input read to + specified variables, which also causes variables to be set to the empty + string if there is not enough input. Previous versions discarded the + characters read. + +41. Beginning with bash-4.0, when one of the commands in a pipeline is killed + by a SIGINT while executing a command list, the shell acts as if it + received the interrupt. This can be disabled by setting the compat31 or + compat32 shell options. + +42. Bash-4.0 changes the handling of the set -e option so that the shell exits + if a pipeline fails (and not just if the last command in the failing + pipeline is a simple command). This is not as Posix specifies. There is + work underway to update this portion of the standard; the bash-4.0 + behavior attempts to capture the consensus at the time of release. + +43. Bash-4.0 fixes a Posix mode bug that caused the . (source) builtin to + search the current directory for its filename argument, even if "." is + not in $PATH. Posix says that the shell shouldn't look in $PWD in this + case. + +44. Bash-4.1 uses the current locale when comparing strings using the < and + > operators to the `[[' command. This can be reverted to the previous + behavior (ASCII collating and strcmp(3)) by setting one of the + `compatNN' shopt options, where NN is less than 41. + +45. Bash-4.1 conforms to the current Posix specification for `set -u': + expansions of $@ and $* when there are no positional parameters do not + cause the shell to exit. + +46. Bash-4.1 implements the current Posix specification for `set -e' and + exits when any command fails, not just a simple command or pipeline. + +47. Command substitutions now remove the caller's trap strings when trap is + run to set a new trap in the subshell. Previous to bash-4.2, the old + trap strings persisted even though the actual signal handlers were reset. + +48. When in Posix mode, a single quote is not treated specially in a + double-quoted ${...} expansion, unless the expansion operator is + # or % or the new `//', `^', or `,' expansions. In particular, it + does not define a new quoting context. This is from Posix interpretation + 221. + +49. Posix mode shells no longer exit if a variable assignment error occurs + with an assignment preceding a command that is not a special builtin. + +50. Bash-4.2 attempts to preserve what the user typed when performing word + completion, instead of, for instance, expanding shell variable + references to their value. + +51. When in Posix mode, bash-4.2 exits if the filename supplied as an argument + to `.' is not found and the shell is not interactive. + +52. When compiled for strict Posix compatibility, bash-4.3 does not enable + history expansion by default in interactive shells, since it results in + a non-conforming environment. + +53. Bash-4.3 runs the replacement string in the pattern substitution word + expansion through quote removal. The code already treats quote + characters in the replacement string as special; if it treats them as + special, then quote removal should remove them. + +Shell Compatibility Level +========================= + +Bash-4.0 introduced the concept of a `shell compatibility level', specified +as a set of options to the shopt builtin (compat31, compat32, compat40, +compat41, and compat42 at this writing). There is only one current +compatibility level -- each option is mutually exclusive. This list does not +mention behavior that is standard for a particular version (e.g., setting +compat32 means that quoting the rhs of the regexp matching operator quotes +special regexp characters in the word, which is default behavior in bash-3.2 +and above). + +Bash-4.3 introduces a new shell variable: BASH_COMPAT. The value assigned +to this variable (a decimal version number like 4.2, or an integer +corresponding to the compatNN option, like 42) determines the compatibility +level. + +compat31 set + - the < and > operators to the [[ command do not consider the current + locale when comparing strings; they use ASCII ordering + - quoting the rhs of the regexp matching operator (=~) has no + special effect + +compat32 set + - the < and > operators to the [[ command do not consider the current + locale when comparing strings; they use ASCII ordering + +compat40 set + - the < and > operators to the [[ command do not consider the current + locale when comparing strings; they use ASCII ordering + - interrupting a command list such as "a ; b ; c" causes the execution + of the entire list to be aborted (in versions before bash-4.0, + interrupting one command in a list caused the next to be executed) + +compat41 set + - interrupting a command list such as "a ; b ; c" causes the execution + of the entire list to be aborted (in versions before bash-4.1, + interrupting one command in a list caused the next to be executed) + - when in posix mode, single quotes in the `word' portion of a + double-quoted parameter expansion define a new quoting context and + are treated specially + +compat42 set + - the replacement string in double-quoted pattern substitution is not + run through quote removal, as in previous versions +------------------------------------------------------------------------------- + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without any warranty. diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/CWRU/PLATFORMS b/CWRU/PLATFORMS new file mode 100644 index 0000000..f05caff --- /dev/null +++ b/CWRU/PLATFORMS @@ -0,0 +1,31 @@ +The version of bash in this directory has been compiled on the +following systems: + +By chet: + +SunOS 4.1.4 +SunOS 5.5 +BSDI BSD/OS 2.1 +FreeBSD 2.2 +NetBSD 1.2 +AIX 4.2 +AIX 4.1.4 +HP/UX 9.05, 10.01, 10.10, 10.20 +Linux 2.0.29 (libc 5.3.12) +Linux 2.0.4 (libc 5.3.12) + +By other testers: + +SCO ODT 2.0 +SCO 3.2v5.0, 3.2v4.2 +SunOS 5.3 +SunOS 5.5 +BSD/OS 2.1 +FreeBSD 2.2 +SunOS 4.1.3 +Irix 5.3 +Irix 6.2 +Linux 2.0 (unknown distribution) +Digital OSF/1 3.2 +GNU Hurd 0.1 +SVR4.2 diff --git a/CWRU/README b/CWRU/README new file mode 100644 index 0000000..7d7ca1a --- /dev/null +++ b/CWRU/README @@ -0,0 +1,20 @@ +Contents of this directory: + +changelog - my change log since the last release + +POSIX.NOTES - list of what changes for `posix mode' + +README - this file + +misc - directory with some useful tools + +The following are distributed `as-is'. They will not apply without some +modification. + +sh-redir-hack - diff to parse.y to get redirections before + compound commands + +empty-for-wordlist - diff to parse.y to allow an empty wordlist after + the `in' keyword in a `for' statement + +mh-folder-comp - diffs that reportedly add MH folder completion diff --git a/CWRU/changelog b/CWRU/changelog new file mode 100644 index 0000000..354720a --- /dev/null +++ b/CWRU/changelog @@ -0,0 +1,5850 @@ + 2/14/2011 + --------- +[bash-4.2 released] + + 2/15 + ---- +lib/glob/gmisc.c + - fix wmatchlen and umatchlen to avoid going past the end of the + string on an incomplete bracket expression that ends with a + NUL. Partial fix for bug reported by Clark Wang + + 2/16 + ---- +subst.h + - new string extract flag value: SX_WORD. Used when calling + extract_dollar_brace_string to skip over the word in + ${param op word} from parameter_brace_expand + +subst.c + - change parameter_brace_expand to add SX_WORD to flags passed to + extract_dollar_brace_string + - change parameter_brace_expand to use SX_POSIXEXP for all non-posix + word expansion operators that treat single quotes as special, not + just % and # + - change extract_dollar_brace_string to initialize dolbrace_state to + DOLBRACE_WORD if SX_WORD flag supplied and we shouldn't use + DOLBRACE_QUOTE. Fixes bug reported by Juergen Daubert + +doc/{bash.1,bashref.texi} + - document the exact expansions here strings undergo + + 2/17 + ---- +lib/readline/vi_mode.c + - make sure that `dd', `cc', and `yy' call vidomove_dispatch from + rl_domove_read_callback. Fixes bug reported by Clark Wang + + +lib/readline/callback.c + - make sure _rl_internal_char_cleanup is called after the + vi-motion callbacks (rl_vi_domove_callback) in rl_callback_read_char. + Companion to above fix + +doc/{bash.1,bashref.texi} + - make sure that the text describing the rhs of the == and =~ + operators to [[ states that only the quoted portion of the pattern + is matched as a string + + 2/18 + ---- +lib/glob/gmisc.c + - better fix for umatchlen/wmatchlen: keep track of the number of + characters in a bracket expression as the value to increase + matchlen by if the bracket expression is not well-formed. Fixes + bug reported by Clark Wang + +subst.c + - change expand_string_for_rhs so that it sets the W_NOSPLIT2 flag + in the word flags. We will not perform word splitting or quote + removal on the result, so we do not want to add quoted nulls if + we see "" or ''. Fixes bug reported by Mike Frysinger + + + 2/19 + ---- +variables.c + - new function, int chkexport(name), checks whether variable NAME is + exported and remakes the export environment if necessary. Returns + 1 if NAME is exported and 0 if not + - call chkexport(name) to get tzset to look at the right variable in + the environment when modifying TZ in sv_tz. Don't call tzset if + chkexport doesn't indicate that the variable is exported + +variables.h + - new extern declaration for chkexport + + +{parse.y,builtins/printf.def} + - call sv_tz before calling localtime() when formatting time strings + in prompt strings or using printf. Fixes bug reported by + Dennis Williamson + +execute_cmd.c + - modify fix of 2/9 to add casts when those variables are passed to + functions; some compilers throw errors instead of warnings. Report + and fix from Joachim Schmitz + +support/shobj-conf + - add a stanza for nsk on the Tandem from Joachim Schmitz + + +{shell,lib/readline/shell}.c + - Tandem systems should use getpwnam (getlogin()); for some reason + they don't do well with using getuid(). Fix from Joachim Schmitz + + + 3/1 + --- +variables.c + - make sure that the return value from find_variable is non-null + before trying to use it in chkexport. Fixes bug reported by + Evangelos Foutras + + 3/3 + --- +parse.y + - when adding $$ to the current token buffer in read_token_word(), + don't xmalloc a buffer for two characters and then strcpy it, just + copy the characters directly into the token buffer. Fix from + Michael Whitten + +execute_cmd.c + - fix expand_word_unsplit to add the W_NOSPLIT2 flag to the word to + be expanded, so "" doesn't add CTLNUL. Similar to fix of 2/18 to + expand_string_for_rhs. Fixes bug reported by Nathanael D. Noblet + and Matthias Klose + +parse.y + - fix extended_glob case of read_token_word to allocate an extra + space in the buffer for the next character read after the extended + glob specification if it's a CTLESC or CTLNUL. Report and fix from + Michael Witten + - fix shell expansions case of read_token_word to allocate an extra + space in the buffer for the next character read after the shell + expansion if it's a CTLESC or CTLNUL. Report and fix from + Michael Witten + - TENTATIVE: fix read_token_word to reduce the amount of buffer space + required to hold the translated and double-quoted value of $"..." + strings. Report and fix from Michael Witten + - change code around got_character and got_escaped_character labels to + make sure that we call RESIZE_MALLOCED_BUFFER before adding the + CTLESC before a CTLESC or CTLNUL, and before adding the character if + we're not adding a CTLESC. Report and fix from + Michael Witten + +subst.c + - new param flags value, PF_ASSIGNRHS, mirrors W_ASSIGNRHS, noting that + parameter expansion is on rhs of assignment statement. That inhibits + word splitting + - change param_expand to call string_list_dollar_at with quoted == 1 + if PF_ASSIGNRHS is set, so it will quote IFS characters in the + positional parameter before separating them with the first char of + $IFS. This keeps the rhs from being split inappropriately. Fixes + bug reported by Andres Perera + + 3/4 + --- +lib/readline/bind.c + - add a missing free of `names' in rl_function_dumper. Bug report + and fix from Michael Snyder + + 3/5 + --- +lib/readline/rltty.c + - change rl_deprep_terminal so it uses fileno (stdin) for the tty fd + if rl_instream is not set, like rl_prep_terminal + + 3/6 + --- +lib/readline/display.c + - fix rl_message to use a dynamically-allocated buffer instead of a + fixed-size buffer of 128 chars for the `local message prompt'. Bug + report and fix from Micah Cowan + + 3/7 + --- +jobs.c + - add sentinel to wait_sigint_handler so it only sets wait_sigint_received + if waiting_for_child is non-zero; otherwise, it restores the old + SIGINT handler and sends itself the SIGINT + - set waiting_for_child around the calls to waitchld that use it to + synchronously wait for a process + - change logic that decides whether or not the child process blocked + or handled SIGINT based on whether or not waitpid returns -1/EINTR + and the shell receives a SIGINT and the child does not exit. If + the child later exits due to SIGINT, cancel the assumoption that it + was handled + - instead of testing whether or not the child exited due to SIGINT + when deciding whether the shell should act on a SIGINT it received + while waiting, test whether or not we think the child caught + SIGINT. If it did, we let it go (unless the shell has it trapped); + if it did not catch it, the shell acts on the SIGINT. Fix from + Linus Torvalds , bug report originally + from Oleg Nesterov + + 3/8 + --- +shell.c + - initialize no_line_editing to 1 if READLINE is not defined -- we + can't have line editing without readline + + 3/12 + ---- +lib/readline/signals.c + - add SIGHUP to the set of signals readline handles + +lib/readline/doc/rltech.texi + - document that SIGHUP is now part of the set of signals readline + handles + +lib/readline/input.c + - if _rl_caught_signal indicates that read() was interrupted by a + SIGHUP or SIGTERM, return READERR or EOF as appropriate + - call rl_event_hook, if it's set, if call to read in rl_getc + returns -1/EINTR. If rl_event_hook doesn't do anything, this + continues the loop as before. This handles the other fatal + signals + +execute_cmd.c + - add a couple of QUIT; calls to execute_disk_command and + execute_simple_command to improve responsiveness to interrupts + and fatal signals + +input.c + - rearrange getc_with_restart so that the return values from read() + are handled right + +parse.y + - don't need to set terminate_immediately in yy_stream_get, since + getc_with_restart checks for terminating signals itself + - since readline returns READERR on SIGHUP or SIGTERM, don't need + to set terminate_immediately. Still doesn't handle other + signals well -- will have to check that some more + +bashline.c + - new function, bash_event_hook, for rl_event_hook. Just checks for + terminating signals and acts on them using CHECK_TERMSIG. + - set rl_event_hook to bash_event_hook + +builtins/read.def + - take out setting terminate_immediately; add calls to CHECK_TERMSIG + after read calls + +doc/{bash.1,bashref.texi} + - move the text describing the effect of negative subscripts used to + reference indexed array elements to the paragraphs describing + ${parameter[subscript]}, since that's where they are implemented. + Pointed out by Christopher F. A. Johnson + +arrayfunc.[ch],subst.c + - array_expand_index now takes a new first argument: a SHELL_VAR * + of the array variable being subscripted. Can be used later to fully + implement negative subscripts + + 3/14 + ---- +lib/glob/glob.c + - fix mbskipname to not turn the directory entry name into a wide char + string if the conversion of the pattern to a wide char string fails + - fix mbskipname to call skipname if either the pattern or the filename + can't be converted into a wide-char string + +lib/glob/xmbsrtowcs.c + - fix xdupmbstowcs2 to handle return value of 0 from mbsnrtowcs and + short-circuit with failure in that case. Fixes bug reported by + Roman Rakus + + 3/15 + ---- +bashline.c + - new variable, bash_filename_quote_characters to store the value + assigned to rl_filename_quote_characters so it can be restored + if changed. + - change bashline_reset and attempt_shell_completion to restore + rl_filename_quote_characters if not set to default + + 3/22 + ---- +lib/glob/glob.c + - wdequote_pathname falls back to udequote_pathname if xdupmbstowcs + fails to convert the pathname to a wide-character string + +lib/glob/xmbsrtowcs.c + - xdupmbstowcs2: change to fix problem with leading '\\' (results in + nms == 0, which causes it to short-circuit with failure right + away). Fixes bug pointed out by Werner Fink + - xdupmbstowcs2: compensate for mbsnrtowcs returning 0 by taking the + next single-byte character and going on + - xdupmbstowcs2: change memory allocation to increase by WSBUF_INC + bytes; try to avoid calls to realloc (even if they don't actually + result in more memory being allocated) + + 3/24 + ---- +doc/{bash.1,bashref.texi} + - slightly modify BASH_SUBSHELL description based on complaint from + Sam Liddicott + + 3/25 + ---- +trap.c + - change free_trap_strings to not call free_trap_string for signals + that are being ignored, like reset_or_restore_signal_handlers. + Fixes bug reported by Satoshi Takahashi + + 3/26 + ---- +lib/readline/rltypedefs.h + - remove old Function/VFunction/CPFunction/CPPFunction typedefs as + suggested by Tom Tromey + +lib/readline/rlstdc.h + - move defines for USE_VARARGS/PREFER_STDARG/PREFER_VARARGS from + config.h.in to here because declaration of rl_message in + readline.h uses the defines. This makes it hard for another packages + to use after the header files are installed, since config.h is not + one of the installed files. Suggested by Tom Tromey + + + 3/27 + ---- +print_cmd.c + - change indirection_string from a static buffer to a dynamic one + managed by indirection_level_string(), so we don't end up truncating + PS4. Suggested by Dennis Williamson + +lib/readline/shell.c + - change sh_set_lines_and_columns to use static buffers instead of + allocating the buffers to pass to setenv/putenv + +lib/readline/terminal.c + - change _rl_get_screen_size to not call sh_set_lines_and_columns if + ignore_env == 0 + - _rl_sigwinch_resize_terminal: new function to just retrieve terminal + size, ignoring environment + +lib/readline/rlprivate.h + - new external declaration for _rl_sigwinch_resize_terminal() (currently + unused) + +lib/readline/signals.c + - rl_sigwinch_handler: set _rl_caught_signal to SIGWINCH + - rl_sigwinch_handler: don't immediately call rl_resize_terminal; just + leave _rl_caught_signal set for RL_CHECK_SIGNALS to handle + - _rl_signal_handler: call rl_resize_terminal if sig == SIGWINCH. + Should fix hang when sending multiple repeated SIGWINCH reported by + Henning Bekel + + 3/29 + ---- +lib/sh/snprintf.c + - include math.h for any defines for isinf/isnan + - use code from gnulib documentation to implement isinf/isnan if they + are not defined + +configure.in + - don't check for isinf or isnan; c99 says they're macros anyway + +config.h.in + - remove defines for ISINF_IN_LIBC and ISNAN_IN_LIBC, no longer used + by snprintf.c + + 4/2 + --- +braces.c + - brace_gobbler: fix to understand double-quoted command substitution, + since the shell understands unquoted comsubs. Fixes bug reported + by Michael Whitten + +lib/readline/display.c + - include on MDOS + - get and set screen size using DJGPP-specific calls on MSDOS + - move cursor up clear screen using DJGPP-specific calls + - don't call tputs on DJGPP; there is no good terminfo support + +lib/readline/terminal.c + - include on MDOS + - get and set screen size using DJGPP-specific calls on MSDOS + - use DJGPP-specific initialization on MSDOS, zeroing all the + _rl_term_* variables + - don't call tputs on DJGPP; there is no good terminfo support + DJGPP support from Eli Zaretskii + + 4/6 + --- + +config-top.h + - change DEFAULT_PATH_VALUE to something more useful and modern + + 4/8 + --- +tests/printf2.sub + - make sure LC_ALL and LC_CTYPE are set so LANG assignment takes effect. + Reported by Cedric Arbogast + + 4/11 + ---- +include/chartypes.h + - fix a couple of dicey defines (though ones that don't cause any + compiler warnings) in IN_CTYPE_DOMAIN + +doc/{bashref.texi,bash.1} + - add note referring to duplicating file descriptors in sections + describing redirecting stdout and stderr and appending to stdout + and stderr. Suggested by Matthew Dinger + +pcomplete.c + - it_init_helptopics: new function to support completing on help topics, + not just builtins + - it_helptopics: new programmable completion list of help topics + - build list of helptopic completions in gen_action_completions on + demand + +pcomplete.h + - new extern declaration for it_helptopics + +builtins/complete.def + - the `helptopic' action now maps to CA_HELPTOPIC intead of CA_BUILTIN, + since there are more help topics than just builtins. Suggested by + Clark Wang + + 4/12 + ---- +print_cmd.c + - fix print_arith_for_command to add a call to PRINT_DEFERRED_HEREDOCS + before ending the body of the command, so heredocs get attached to + the right command instead of to the loop. From gentoo bug 363371 + http://bugs.gentoo.org/show_bug.cgi?id=363371 + +execute_cmd.c + - change coproc_pidchk to unset the appropriate shell variables when + the (currently single) known coproc pid terminates + - cleanup and new functions to fully support multiple coprocesses when + and if I decide to go there + + 4/13 + ---- +print_cmd.c + - fix print_group_command to add a call to PRINT_DEFERRED_HEREDOCS + after call to make_command_string_internal before printing closing + `}' + - fix make_command_string_internal to add a call to + PRINT_DEFERRED_HEREDOCS after recursive call to + make_command_string_internal in case cm_subshell before printing + closing `)' + + 4/14 + ---- +print_cmd.c + - change overlapping strcpy in named_function_string to memmove + +sig.h + - UNBLOCK_SIGNAL: convenience define, same as UNBLOCK_CHILD, just + restores an old signal mask + +trap.c + - set_signal: instead of setting the signal handler to SIG_IGN while + installing the new trap handler, block the signal and unblock it + after the new handler is installed. Fixes bug reported by Roman + Rakus + + 4/15 + ---- +doc/{bash.1,bashref.texi} + - make it clear that enabling monitor mode means that all jobs run in + separate process groups + + 4/18 + ---- +builtins/fc.def + - update fix of 4/15/2010 to not take saved_command_line_count into + account when stepping down the history list to make sure that + last_hist indexes something that is valid. Fixes bug reported by + + + 4/19 + ---- +builtins/fc.def + - fc_gethnum: make sure the calculation to decide the last history + entry is exactly the same as fc_builtin. Fixes bug uncovered by + fix of 4/18 to stop seg fault + + 4/22 + ---- +lib/readline/terminal.c + - change _rl_enable_meta_key to set a flag indicating that it sent the + enable-meta sequence + - _rl_disable_meta_key: new function to turn off meta mode after we + turned it on with _rl_enable_meta_key + +lib/readline/rlprivate.h + - extern declaration for _rl_disable_meta_key + +configure.in + - if not cross-compiling, set CFLAGS_FOR_BUILD from any CFLAGS inherited + from the environment. Fixes HP/UX build problem reported by + "Daniel Richard G." + + 4/26 + ---- +config-top.h + - define MULTIPLE_COPROCS to 0 so the code is still disabled but easy + to enable via configure option or editing this file + + 4/29 + ---- +lib/sh/eaccess.c + - freebsd provides faccessat, with the same misfeature as their eaccess + and access implementations (X_OK returns true for uid==0 regardless + of the actual file permissions), so reorganize code to check the + file permissions as with eaccess. Report and fix from Johan Hattne + + + 5/2 + --- +doc/{bash.1,bashref.texi} + - add forward reference to `Pattern Matching' from `Pathname + Expansion', suggested by Greg Wooledge + + 5/5 + --- +pcomplib.c + - the bash_completion project now distributes over 200 completions + for various programs, with no end in sight, so increase the value + of COMPLETE_HASH_BUCKETS from 32 to 128 + +pathexp.c + - quote_string_for_globbing: make sure CTLESC quoting CTLESC is + translated into \ even if the flags include QGLOB_REGEXP. + We don't want to process the second CTLESC as a quote character. + Fixes bug reported by Shawn Bohrer + + 5/6 + --- +builtins/printf.def + - change PRETURN to not call fflush if ferror(stdout) is true + - if a call to one of the stdio functions or printstr leaves + ferror(stdout) true, and PRETURN is going to be called, let PRETURN + print the error message rather than doubling up the messages. Fixes + problem reported by Roman Rakus + + 5/9 + --- +doc/{bash.1,bashref.texi} + - add note to the effect that lists inside compound command can be + terminated by newlines as well as semicolons. Suggested by + Roman Byshko + + 5/10 + ---- +subst.c + - remove_quoted_nulls: fix problem that caused it to skip over the + character after a CTLNUL, which had the effect of skipping every + other of a series of CTLNULs. Fixes bug reported by + Marten Wikstrom + + 5/11 + ---- +subst.c + - extract_process_subst: add SX_COMMAND flag to call to + extract_delimited_string, since we're expanding the same sort of + command as command substitution. Fixes bug reported in Ubuntu + bug 779848 + + 5/12 + ---- +configure.in + - set the prefer_shared and prefer_static variables appropriately + depending on the value of $opt_static_link + +aclocal.m4 + - AC_LIB_LINKFLAGS_BODY: change to not prefer shared versions of the + libraries it's searching for if the prefer_shared variable is "no". + Fixes problem reported by Cedric Arbogast + + 5/13 + ---- +lib/readline/readline.c + - _rl_internal_teardown: add call to _rl_disable_meta_key to make the + meta key active only for the duration of the call to readline() + - _rl_internal_setup: move call to _rl_enable_meta_key here from + readline_initialize_everything so the meta key is active only for + the duration of the call to readline(). Suggestion from Miroslav + Lichvar + +builtins/help.def + - help_builtin: change strncmp to strcmp so that `help read' no longer + matches `readonly'. Suggested by Clark Wang + +config.h.in + - add define for GLIBC21, checked using jm_GLIBC21 as part of the tests + for libintl + +lib/malloc/malloc.c + - internal_free: don't use the cached value of memtop when deciding + whether or not to adjust the break and give memory back to the kernel + when using the GNU C library, since glibc uses sbrk for its own + internal purposes. From Debian bug 614815, reported by Samuel + Thibault + +aclocal.m4 + - BASH_STRUCT_WEXITSTATUS_OFFSET: change AC_RUN_IFELSE to AC_TRY_RUN + to avoid warning about not using AC_LANG_SOURCE + + 5/14 + ---- +bashline.[ch] + - two new functions, bashline_set_event_hook and bashline_reset_event_hook, + to set rl_event_hook to bash_event_hook and back to NULL, respectively + - don't set rl_event_hook unconditionally + +sig.c + - termsig_sighandler: if the shell is currently interactive and + readline is active, call bashline_set_event_hook to cause + termsig_handler to be called via bash_event_hook when the shell + returns from the signal handler + + 5/15 + ---- +lib/readline/display.c + - _rl_col_width: Mac OS X has a bug in wcwidth: it does not return 0 + for UTF-8 combining characters. Added workaround dependent on + MACOSX. Fixes problem pointed out by Thomas De Contes + + + 5/16 + ---- +lib/readline/rlmbutil.h + - WCWIDTH: wrapper for wcwidth that returns 0 for Unicode combining + characters on systems where wcwidth is broken (e.g., Mac OS X). + +lib/readline/{complete,display,mbutil}.c + - use WCWIDTH instead of wcwidth + + 5/17 + ---- +lib/readline/display.c + - update_line: after computing ofd and nfd, see whether the next + character in ofd is a zero-width combining character. If it is, + back ofd and nfd up one, so the base characters no longer compare + as equivalent. Fixes problem reported by Keith Winstein + + +lib/readline/nls.c + - _rl_utf8locale: new flag variable, set to non-zero if the current + locale is UTF-8 + - utf8locale(): new function, returns 1 if the passed lspec (or the + current locale) indicates that the locale is UTF-8. Called from + _rl_init_eightbit + +lib/readline/rlprivate.h + - extern declaration for _rl_utf8locale + +locale.c + - locale_utf8locale: new flag variable, set to non-zero if the current + locale is UTF-8 (currently unused) + - locale_isutf8(): new function, returns 1 if the passed lspec (or the + current locale) indicates that the locale is UTF-8. Should be called + whenever the locale or LC_CTYPE value is modified + +aclocal.m4 + - BASH_WCWIDTH_BROKEN: new test for whether or not wcwidth returns + zero-width characters like unicode combining characters as having + display length 1; define WCWIDTH_BROKEN in this case + +config.h.in + - WCWIDTH_BROKEN: new define + +lib/readline/rlmbutil.h + - change WCWIDTH macro to use _rl_utf8locale and the full range of + Unicode combining characters (U+0300-U+036F) + + 5/19 + ---- +lib/readline/rlprivate.h + - _rl_search_context: new member, prevc, will hold character read + prior to lastc + +lib/readline/isearch.c + - _rl_isearch_dispatch: if the character causes us to index into + another keymap, save that character in cxt->prevc + - _rl_isearch_dispatch: if we index into another keymap, but don't + find a function that's special to i-search, and the character that + caused us to index into that keymap would have terminated the + search, push back cxt->prevc and cxt->lastc to make it appear as + if `prevc' terminated the search, and execute lastc as a command. + We have to push prevc back so we index into the same keymap before + we read lastc. Fixes bug report from Davor Cubranic + + + 5/20 + ---- +expr.c + - expr_bind_variable: pay attention to the return value from + bind_variable and check whether or not we should error out due to + a readonly or noassign variable. Fixes bug reported by Eric + Blake + + 5/26 + ---- + +lib/readline/search.c + - include histlib.h for ANCHORED_SEARCH defines + - rl_history_search_flags: new variable, holds ANCHORED_SEARCH flag for + the duration of a history search + - rl_history_search_reinit: takes a new flags variable, defines whether + or not the search is anchored; assigned to rl_history_search_flags + - rl_history_serarch_reinit: if ANCHORED_SEARCH flag passed, add ^ to + beginning of search string; otherwise search string is unmodified + - rl_history_search_internal: set rl_point appropriately based on + whether or not rl_history_search_flags includes ANCHORED_SEARCH + - rl_history_substr_search_forward: new function, for non-anchored + substring search forward through history for string of characters + preceding rl_point + - rl_history_substr_search_backward: new function, for non-anchored + substring search backward through history for string of characters + preceding rl_point. Original code from Niraj Kulkarni + + +lib/readline/readline.h + - extern declarations for rl_history_substr_search_{for,back}ward + +lib/readline/funmap.c + - history-substring-search-forward: new bindable command, invokes + rl_history_substr_search_forward + - history-substring-search-backward: new bindable command, invokes + rl_history_substr_search_backward + +lib/readline/doc/{rluser.texi,readline.3} + - document history-substring-search-forward and + history-substring-search-backward + + 5/27 + ---- +{nojobs,jobs}.c + - add support for DONT_REPORT_SIGTERM so that the shell doesn't print + a message when a job exits due to SIGTERM since that's the default + signal sent by the kill builtin. Suggested by Marc Herbert + + +config-top.h + - DONT_REPORT_SIGTERM: new user-modifiable setting. Commented out + by default + + 5/28 + ---- +lib/readline/bind.c + - _rl_skip_to_delim: skip to a closing double quote or other delimiter, + allowing backslash to quote any character, including the delimiter + - rl_parse_and_bind: call _rl_skip_to_delim instead of using inline + code + - rl_parse_and_bind: allow quoted strings as the values of string + variables. Variable values without double quotes have trailing + whitespace removed (which still allows embedded whitespace, for + better or worse). Fixes problem with string variables not matching + in `set' command if values happen to have trailing spaces or tabs + (debian bash bug #602762), but introduces slight incompatibility. + + 5/29 + ---- +doc/{bash.1,bashref.texi} + - clarify unset description to specify that without options, a + variable, then a shell function if there is no variable by that + name, is unset. Fixes discrepancy reported by Mu Qiao + + + 6/4 + ---- +doc/{bash.1,bashref.texi} + - clarify description of LINES and COLUMNS (and checkwinsize shopt + option) to make it clear that only interactive shells set a + handler for SIGWINCH and update LINES and COLUMNS. Original + report submitted by Jonathan Nieder + +arrayfunc.c + - expand_compound_array_assignment: defer expansion of words between + parens when performing compound assignmnt to an associative array + variable + - assign_compound_array_list: perform the same expansions when doing + a compound array assignment to an associative array variable as + when doing a straight array index assignment. The idea is that + foo=( [ind1]=bar [ind2]=quux) + is the same as + foo[ind1]=bar ; foo[ind2]=quux + + This fixes problems with double-expansion and quote removal being + performed on the array indices + + 6/13 + ---- +doc/{bash.1,bashref.texi} + - Add a little text to make it clear that the locale determines how + range expressions in glob patterns are handled. + + + 6/21 + ---- +builtins/read.def + - display a message and return error status if -a is used with an + existing associative array. Fixes bug reported by Curtis Doty + + + 6/24 + ---- +{jobs,nojobs}.c + - non-interactive shells now react to the setting of checkwinsize + and set LINES and COLUMNS after a foreground job exits. From a + suggestion by Leslie Rhorer + +doc/{bash.1,bashref.texi} + - checkwinsize: remove language saying that only interactive shells + check the window size after each command + +lib/readline/histfile.c + - history_backupfile: new file, creates a backup history file name + given a filename (appending `-') + - history_do_write: when overwriting the history file, back it up + before writing. Restore backup file on a write error. Suggested + by chkno@chkno.net + +bashline.c + - find_cmd_name: two new arguments, return the start and end of the + actual text string used to find the command name, without taking + whitespace into account + - attempt_shell_completion: small changes to make sure that completion + attempted at the beginning of a non-empty line does not find a + programmable completion, even if the command name starts at point + - attempt_shell_completion: small change to make sure that completion + does not find a progcomp when in whitespace before the command + name + - attempt_shell_completion: small change to make sure that completion + does not find a progcomp when point is at the first character of a + command name, even when there is leading whitespace (similar to + above). Fixes problems noted by Ville Skytta + +subst.c + - brace_expand_word_list: since the individual strings in the strvec + returned by brace_expand are already allocated, don't copy them to + newly-allocated memory when building the WORD_LIST, just use them + intact + +locale.c + - locale_mb_cur_max: cache value of MB_CUR_MAX when we set or change + the locale to avoid a function call every time we need to read it + +shell.h + - new struct to save shell_input_line and associated variables: + shell_input_line_state_t + - add members of sh_parser_state_t to save and restore token and the + size of the token buffer + +parse.y + - {save,restore}_input_line_state: new functions to save and restore + shell_input_line and associated variables + - {save,restore}_parser_state: add code to save and restore the token + and token buffer size + - xparse_dolparen: call save_ and restore_input_line_state to avoid + problems with overwriting shell_input_line when we recursively + call the parser to parse a command substitution. Fixes bug + reported by Rui Santos + +include/shmbutil.h + - use locale_mb_cur_max instead of MB_CUR_MAX in ADVANCE_CHAR and + similar macros + +lib/glob/smatch.c + - rangecmp,rangecmp_wc: change to take an additional argument, which + forces the use of strcoll/wscoll when non-zero. If it's 0, a new + variable `glob_asciirange' controls whether or not we use strcoll/ + wscoll. If glob_asciirange is non-zero, we use straight + C-locale-like ordering. Suggested by Aharon Robbins + + + 6/30 + ---- +execute_cmd.c + - execute_pipeline: make sure the lastpipe code is protected by + #ifdef JOB_CONTROL. Fixes problem reported by Thomas Cort + + + 7/2 + --- +lib/readline/complete.c + - EXPERIMENTAL: remove setting of _rl_interrupt_immediately around + completion functions that touch the file system. Idea from Jan + Kratochvil and the GDB development + team + +lib/readline/signals.c + - rl_signal_handler: if we're in callback mode, don't interrupt + immediately on a SIGWINCH + + 7/3 + --- +bashline.c + - set_directory_hook: and its siblings are a new set of functions to + set, save, and restore the appropriate directory completion hook + - change callers to use {set,save,restore}_directory_hook instead of + manipulating rl_directory_rewrite_hook directly + - dircomplete_expand: new variable, defaults to 0, if non-zero causes + directory names to be word-expanded during word and filename + completion + - change {set,save,restore}_directory_hook to look at dircomplete_expand + and change rl_directory_completion_hook or rl_directory_rewrite_hook + appropriately + +bashline.h + - extern declaration for set_directory_hook so shopt code can use it + + 7/6 + --- +builtins/shopt.def + - globasciiranges: new settable shopt option, makes glob ranges act + as if in the C locale (so b no longer comes between A and B). + Suggested by Aharon Robbins + + 7/7 + --- +doc/{bash.1,bashref.texi} + - document new `globasciiranges' shopt option + + 7/8 + --- +builtins/shopt.def + - direxpand: new settable option, makes filename completion expand + variables in directory names like bash-4.1 did. + - shopt_set_complete_direxpand: new function, does the work for the + above by calling set_directory_hook + +doc/{bash.1,bashref.texi} + - document new `direxpand' shopt option + + 7/15 + ---- +lib/readline/isearch.c + - _rl_isearch_dispatch: when adding character to search string, use + cxt->lastc (which we use in the switch statement) instead of c, + since lastc can be modified earlier in the function + + 7/18 + ---- +lib/readline/rlprivate.h + - _rl_search_context: add another member to save previous value of + (multibyte) lastc: pmb is to mb as prevc is to lastc + +lib/readline/isearch.c: + - _rl_isearch_dispatch: if a key sequence indexes into a new keymap, + but doesn't find any bound function (k[ind].function == 0) or is + bound to self-insert (k[ind].function == rl_insert), back up and + insert the previous character (the one that caused the index into a + new keymap) and arrange things so the current character is the next + one read, so both of them end up in the search string. Fixes bug + reported by Clark Wang + - _rl_isearch_dispatch: a couple of efficiency improvements when adding + characters to the isearch string + + 7/24 + ---- +lib/readline/isearch.c + - _rl_isearch_dispatch: save and restore cxt->mb and cxt->pmb + appropriately when in a multibyte locale + +doc/{bash.1,bashref.texi} + - correct description of {x}>file (and other redirection operators + that allocate a file descriptor) to note the the fd range is + greater than or equal to 10. Fixes problem reported by + Christian Ullrich + +lib/readline/signals.c + - rl_signal_handler: don't interrupt immediately if in callback mode + +lib/readline/callback.c + - rl_callback_read_char: install signal handlers only when readline + has control in callback mode, so readline's signal handlers aren't + called when the application is active (e.g., between the calls to + rl_callback_handler_install and rl_callback_read_char). If the + readline signal handlers only set a flag, which the application + doesn't know about, the signals will effectively be ignored until + the next time the application calls into the readline callback + interface. Fixes problem of calling unsafe functions from signal + handlers when in callback mode reported by Jan Kratochvil + + +execute_cmd.c + - fix_assignment_words: when in Posix mode, the `command' builtin + doesn't change whether or not the command name it protects is an + assignment builtin. One or more instances of `command' + preceding `export', for instance, doesn't make `export' treat its + assignment statement arguments differently. Posix interpretation + #351 + +doc/{bash.1,bashref.texi} + - document new Posix-mode behavior of `command' when preceding builtins + that take assignment statements as arguments + +builtins/printf.def + - printstr: if fieldwidth or precision are < 0 or > INT_MAX when + supplied explicitly (since we take care of the `-' separately), + clamp at INT_MAX like when using getint(). Fixes issue reported + by Ralph Coredroy + + 7/25 + ---- +lib/readline/chardefs.h + - isxdigit: don't define if compiling with c++; declared as a c++ + template function. Fixes bug reported by Miroslav Lichvar + + +builtins/printf.def + - getint: if garglist == 0, return whatever getintmax returns (0). + Fixes bug reported by Ralph Coredroy + + 7/28 + ---- +doc/{bash.1,bashref.texi} + - minor changes to the descriptions of the cd and pushd builtins + +lib/sh/zread.c + - zsyncfd: change variable holding return value from lseek to + off_t. Bug report and fix from Gregory Margo + + 8/1 + --- +expr.c + - don't check for division by 0 when in a context where no evaluation + is taking place. Fixes bug reported by dnade.ext@orange-ftgroup.com + + 8/6 + --- +execute_cmd.c + - execute_command_internal: the parent branch of the subshell code + (where the child calls execute_in_subshell) should not close all + open FIFOs with unlink_fifo_list if it's part of a shell function + that's still executing. Fixes bug reported by Maarten Billemont + + + 8/9 + --- +builtins/common.c + - get_exitstat: return EX_BADUSAGE (2) on a non-numeric argument + +builtins/return.def + - return_builtin: just call get_exitstat to get the return status, + let it handle proper parsing and handling of arguments. Fixes + issue most recently raised by Linda Walsh . + Reverses change from 9/11/2008 (see above) + + 8/16 + ---- +doc/{bash.1,bashref.texi} + - clean up `set -e' language to make it clearer that any failure of + a compound command will cause the shell to exit, not just subshells + and brace commands + + 8/17 + ---- +configure.in + - make the various XXX_FOR_BUILD variables `precious' to autoconf to + avoid stale data + - change how CC_FOR_BUILD is initialized when cross-compiling and not, + but do not change behavior + - initialize CFLAGS_FOR_BUILD to -g when cross-compiling + - initialize LIBS_FOR_BUILD to $(LIBS) when not cross-compiling, empty + when cross-compiling + - create AUTO_CFLAGS variable to hold basic CFLAGS defaults; used when + CFLAGS not inherited from environment (like effect of old + auto_cflags variable) + - substitute LIBS_FOR_BUILD into output Makefiles + [changes inspired by bug report from Nathan Phillip Brink + -- gentoo bug 378941] + +builtins/Makefile.in + - substitute LIBS_FOR_BUILD from configure, not strictly initialized + to $(LIBS) + + 8/27 + ---- +doc/{bash.1,bashref.texi} + - minor changes to the here string description to clarify the + expansions performed on the word + +support/shobj-conf + - handle compilation on Lion (Mac OS X 10.7/darwin11) with changes + to darwin stanzas. Fixes readline bug reported by Vincent + Sheffer + +lib/sh/strtrans.c + - ansic_wshouldquote: check a string with multi-byte characters for + characters that needs to be backslash-octal escaped for $'...' + - ansic_shouldquote: if is_basic fails for one character, let + ansic_wshouldquote examine the rest of the string and return what + it returns. From a patch sent by Roman Rakus + + 8/30 + ---- +lib/sh/strtrans.c + - ansic_quote: changes to quote (or not) multibyte characters. New + code converts them to wide characters and uses iswprint to check + valid wide chars. From a patch sent by Roman Rakus + + + 9/7 + --- +lib/sh/shquote.c + - sh_backslash_quote: change to be table-driven so we can use a + different table if we want to + - sh_backslash_quote: takes a second char table[256] argument; + +externs.h + - sh_backslash_quote: add second argument to function prototype + +bashline.c,braces.c,parse.y,builtins/printf.def + - change callers of sh_backslash_quote to add second argument + +bashline.c + - filename_bstab: table of characters to pass to sh_backslash_quote; + characters with value 1 will be backslash-quoted + - set_filename_bstab: turn on characters in filename backslash-quote + table according to passed string argument + - call set_filename_bstab every time rl_filename_quote_characters is + assigned a value + - bash_quote_filename: call sh_backslash_quote with filename_bstab + as second argument. This allows other characters in filenames to + be quoted without quoting, for instance, a dollar sign in a shell + variable reference + + 9/8 + --- +bashline.c + - complete_fullquote: new variable, controls table passed to + sh_backslash_quote. If non-zero (the default), the standard set + of shell metacharacters -- as in bash versions up to and including + bash-4.2 -- gets backslash-quoted by the completion code. If zero, + sh_backslash_quote gets the table with the characters in the + variable reference removed, which means they are removed from the + set of characters to be quoted in filenames + + 9/10 + ---- +bashline.c + - bash_filename_stat_hook: new function, designed to expand variable + references in filenames before readline passes them to stat(2) + to determine whether or not they are a directory + + 9/15 + ---- +builtins/declare.def + - if assign_array_element fails due to a bad (or empty) subscript, mark + it as an assignment error and don't attempt any further processing + of that declaration. Fixes segfault bug reported by Diego Augusto + Molina + + 9/19 + ---- +expr.c + - exppower: replace the simple exponentiation algorithm with an + implementation of exponentiation by squaring. Inspired by report + from Nicolas ARGYROU + +bashline.c + - bash_quote_filename: check for rtext being non-null before + dereferencing it + - set_saved_history: operate_and_get_next assumes that the previous + line was added to the history, even when the history is stifled and + at the max number of entries. If it wasn't, make sure the history + number is incremented properly. Partial fix for bug reported by + gregrwm + +doc/{bash.1,bashref.texi},lib/readline/doc/{hsuser,rluser}.texi + - minor editorial changes inspired by suggestions from + Roger Zauner + + 9/20 + ---- +lib/intl/localealias.c + - read_alias_file: close resource leak (fp) when returning on error + + 9/22 + ---- +execute_command.c + - execute_intern_function: implement Posix interpretation 383 by making + it an error to define a function with the same name as a special + builtin when in Posix mode. + http://austingroupbugs.net/view.php?id=383#c692 + + 9/25 + ---- +doc/{bash.1,bashref.texi} + - formatting and some content changes from Benno Schulenberg + + - document new posix-mode behavior from interp 383 change of 9/22 + + 9/30 + ---- +execute_cmd.c + - shell_execve: add strerror to error message about executable file + that shell can't execute as a shell script. From suggestion by + daysleeper + + 10/1 + ---- +bashhist.c + - maybe_add_history: act as if literal_history is set when parser_state + includes PST_HEREDOC, so we save the bodies of here-documents just + as they were entered. Fixes bug reported by Jonathan Wakely + + - bash_add_history: make sure that the second and subsequent lines of + a here document don't have extra newlines or other delimiting + chars added, since they have the trailing newline preserved, when + `lithist' is set and history_delimiting_chars isn't called + +execute_cmd.c + - execute_command_internal: avoid fd exhaustion caused by using + process substitution in loops inside shell functions by using + copy_fifo_list and close_new_fifos (). Fixes debian bash bug + 642504 + +lib/readline/complete.c + - new variable, rl_filename_stat_hook, used by append_to_match. If + filename completion is desired, and rl_filename_stat_hook points + to a function, call that function to expand the filename in an + application-specific way before calling stat. + +bashline.c + - bash_default_completion: if variable completion returns a single + match, use bash_filename_stat_hook and file_isdir to determine + whether or not the variable name expands to a directory. If it + does, set the filename_append_character to `/'. This is not + perfect, so we will see how it works out. Adds functionality + requested by Peter Toft and Patrick Pfeifer + + - rl_filename_stat_hook: assigned bash_filename_stat_hook, so things + like $HOME/Downloads (after completion) have a slash appended. + In general, this causes the stat hook to be called whenever + filename completion is appended. Adds functionality requested by + Patrick Pfeifer + +lib/readline/readline.h + - new extern declaration for rl_filename_stat_hook + +lib/readline/doc/rltech.texi + - rl_directory_rewrite_hook: now documented + - rl_filename_stat_hook: document + +pcomplete.c + - gen_action_completions: in the CA_DIRECTORY case, turn off + rl_filename_completion_desired if it was off before we called + rl_filename_completion_function and we didn't get any matches. + Having it on causes readline to quote the matches as if they + were filenames. Adds functionality requested by many, + including Clark Wang + +assoc.[ch] + - assoc_replace: new function, takes the same arguments as + assoc_insert, but returns the old data instead of freeing it + - assoc_insert: if the object returned by hash_insert doesn't have + the same value for its key as the key passed as an argument, we + are overwriting an existing value. In this case, we can free the + key. Fixes bug reported by David Parks + + 10/5 + ---- +print_cmd.c + - indirection_level_string: small change to only re-enable `x' + option after calling decode_prompt_string if it was on before. In + normal mode, it will be, but John Reiser + has a novel use for that code in conjunction with a pre-loaded + shared library that traces system call usage in shell scripts + + 10/10 + ----- +Makefile.in + - Fix from Mike Frysinger to avoid trying to + build y.tab.c and y.tab.h with two separate runs of yacc if + parse.y changes. Problem with parallel makes + - Fix from Mike Frysinger to avoid subdirectory + builds each trying to make version.h (and all its dependencies) + +lib/sh/Makefile.in + - remove some dependencies on version.h where it doesn't make sense + +variables.c + - initialize_shell_variables: while reading the environment, a shell + running in posix mode now checks for SHELLOPTS being readonly (it + gets set early on in main()) before trying to assign to it. It + saves an error message and the variable gets parsed as it should. + Fixes bug reported by Len Giambrone + + 10/14 + ----- +doc/{bash.1,bashref.texi} + - add to the "duplicating file descriptors" description that >&word + doesn't redirect stdout and stderr if word expands to `-' + - add to the "appending standard output and standard error" + description a note that >&word, where word is a number or `-', + causes other redirection operators to apply for sh and Posix + compatibility reasons. Suggested by Greg Wooledge + + + 10/15 + ----- +pcomplete.c + - change pcomp_filename_completion_function to only run the filename + dequoting function in the cases (as best as it can figure) where + readline won't do it via rl_filename_completion_function. Based + on reports from + + 10/19 + ----- +bashline.c + - attempt_shell_completion: add call to set_directory_hook() to make + sure the rewrite functions are correct. It's cheap and doesn't + hurt + - command_word_completion_function: if completing a command name that + starts with `.' or `..', temporarily suppress the effects of the + `direxpand' option and restore the correct value after calling + rl_filename_completion_function. If it's enabled, the directory + name will be rewritten and no longer match `./' or `../'. Fixes + problem reported by Michael Kalisz + + 10/22 + ----- +builtins/history.def + - push_history: make sure remember_on_history is enabled before we + try to delete the last history entry -- the `history -s' command + might not have been saved. Fixes bug reported by + lester@vmw-les.eng.vmware.com + +lib/readline/complete.c + - rl_callback_read_char: add calls to a macro CALLBACK_READ_RETURN + instead of straight return; add same call at end of function. + Placeholder for future work in deinstalling signal handlers when + readline is not active + + 10/25 + ----- +expr.c + - exp2: catch arithmetic overflow when val1 == INTMAX_MIN and val2 == -1 + for DIV and MOD and avoid SIGFPE. Bug report and pointer to fix + from Jaak Ristioja + - expassign: same changes for arithmetic overflow for DIV and MOD + + 10/28 + ----- +subst.c + - parameter_brace_expand: allow pattern substitution when there is an + expansion of the form ${var/} as a no-op: replacing nothing with + nothing + - parameter_brace_patsub: don't need to check for PATSUB being NULL; + it never is + +flags.c + - if STRICT_POSIX is defined, initialize history_expansion to 0, since + history expansion (and its treatment of ! within double quotes) is + not a conforming posix environment. From austin-group issue 500 + +lib/readline/histexpand.c + - history_expand: when processing a string within double quotes + (DQUOTE == 1), make the closing double quote inhibit history + expansion, as if the word were outside double quotes. In effect, + we assume that the double quote is followed by a character in + history_no_expand_chars. tcsh and csh seem to do this. This + answers a persistent complaint about history expansion + + 10/29 + ----- +make_cmd.c + - make_arith_for_command: use skip_to_delim to find the next `;' + when breaking the string between the double parens into three + separate components instead of a simple character loop. Fixes + bug reported by Dan Douglas + + 11/2 + ---- +Makefile.in + - make libbuiltins.a depend on builtext.h to serialize its creation + and avoid conflict between multiple invocations of mkbuiltins. + Fix from Mike Frysinger + + 11/5 + ---- +findcmd.c + - user_command_matches: if stat(".", ...) returns -1, set st_dev + and st_ino fields in dotinfo to 0 to avoid same_file matches + - find_user_command_in_path: check stat(2) return the same way + +lib/glob/glob.c + - glob_vector: don't call strlen(pat) without checking pat == 0 + - glob_dir_to_array: make sure to free `result' and all allocated + members before returning error due to malloc failure + - glob_vector: make sure to free `nextname' and `npat' on errors + (mostly when setting lose = 1) + - glob_vector: if flags & GX_MATCHDIRS but not GX_ALLDIRS, make + sure we free `subdir' + - glob_filename: when expanding ** (GX_ALLDIRS), make sure we + free temp_results (return value from glob_vector) + +lib/glob/xmbsrtowcs.c + - xdupmbstowcs: fix call to realloc to use sizeof (char *) instead + of sizeof (char **) when assigning idxtmp + +execute_cmd.c + - print_index_and_element: return 0 right away if L == 0 + - is_dirname: fix memory leak by freeing `temp' + - time_command: don't try to deref NULL `command' when assigning + to `posix_time' + - shell_execve: null-terminate `sample' after READ_SAMPLE_BUF so it's + terminated for functions that expect that + +builtins/read.def + - read_builtin: don't call bind_read_variable with a potentially-null + string + +pcomplete.c + - gen_command_matches: don't call dispose_word_desc with a NULL arg + - gen_compspec_completions: fix memory leak by freeing `ret' before + calling gen_action_completions (tcs, ...). happens when + performing directory completion as default and no completions + have been generated + - gen_progcomp_completions: make sure to set foundp to 0 whenever + returning NULL + - it_init_aliases: fix memory leak by freeing alias_list before + returning + +bashline.c + - command_word_completion_function: don't call restore_tilde with a + NULL directory_part argument + - bash_directory_expansion: bugfix: don't throw away results of + rl_directory_rewrite_hook if it's set and returns non-zero + - bind_keyseq_to_unix_command: free `kseq' before returning error + +arrayfunc.c + - assign_array_element_internal: make sure `akey' is freed if non-null + before returning error + - assign_compound_array_list: free `akey' before returning error + - array_value_internal: free `akey' before returning error + - unbind_array_element: free `akey' before returning error + +subst.c + - array_length_reference: free `akey' before returning error in case + of expand_assignment_string_to_string error + - array_length_reference: free `akey' after call to assoc_reference + - skip_to_delim: if skipping process and command substitution, free + return value from extract_process_subst + - parameter_brace_substring: free `val' (vtype == VT_VARIABLE) before + returning if verify_substring_values fails + - parameter_brace_expand: remove two duplicate lines that allocate + ret in parameter_brace_substring case + - parameter_brace_expand: convert `free (name); name = xmalloc (...)' + to use `xrealloc (name, ...)' + - parameter_brace_expand: free `name' before returning when handling + ${!PREFIX*} expansion + - split_at_delims: fix memory leak by freeing `d2' before returning + +redir.c + - redirection_error: free `filename' if the redirection operator is + REDIR_VARASSIGN by assigning allocname + +eval.c + - send_pwd_to_eterm: fix memory leak by freeing value returned by + get_working_directory() + +builtins/cd.def + - change_to_directory: fix memory leak by freeing return value from + resetpwd() + - cd_builtin: fix memory leak by freeing value returned by dirspell() + - cd_builtin: fix memory leak by freeing `directory' if appropriate + before overwriting with return value from resetpwd() + +builtins/type.def + - describe_command: free `full_path' before overwriting it with return + value from sh_makepath + +builtins/complete.def + - compgen_builtin: fix memory leak by calling strlist_dispose (sl) + before overwriting sl with return value from completions_to_stringlist + +builtins/hash.def + - list_hashed_filename_targets: fix memory leak by freeing `target' + +make_cmd.c + - make_arith_for_command: free `init', `test', and `step' before + returning error on parse error + +jobs.c + - initialize_job_control: don't call move_to_high_fd if shell_tty == -1 + +general.c + - check_dev_tty: don't call close with an fd < 0 + - legal_number: deal with NULL `string' argument, return invalid + +lib/sh/fmtulong.c + - fmtulong: if the `base' argument is invalid, make sure we index + buf by `len-1' at maximum + +print_cmd.c + - print_deferred_heredocs: don't try to dereference a NULL `cstring' + - cprintf: make sure to call va_end (args) + +variables.c + - push_dollar_vars: fix call to xrealloc to use sizeof (WORD_LIST *) + instead of sizeof (WORD_LIST **) + +lib/sh/zmapfd.c + - zmapfd: if read returns error, free result and return -1 immediately + instead of trying to reallocate it + + 11/6 + ---- +execute_cmd.c + - cpl_reap: rewrote to avoid using pointer after freeing it; now builds + new coproc list on the fly while traversing the old one and sets the + right values for coproc_list when done + + 11/12 + ----- +builtins/set.def + - if neither -f nor -v supplied, don't allow a readonly function to + be implicitly unset. Fixes bug reported by Jens Schmidt + + +lib/readline/callback.c + - change CALLBACK_READ_RETURN to clear signal handlers before returning + from rl_callback_read_char so readline's signal handlers aren't + installed when readline doesn't have control. Idea from Jan + Kratochvil and the GDB development + team + +pcomplete.h + - COPT_NOQUOTE: new complete/compgen option value + +builtins/complete.def + - noquote: new complete/compgen option; will be used to disable + filename completion quoting + +pcomplete.c + - pcomp_set_readline_variables: pay attention to COPT_NOQUOTE; turns + of rl_filename_quoting_desired if set; turns it on if unset (value + is inverted, since default is on) + +doc/bash.1,lib/readline/doc/rluser.texi + - document new -o noquote option to complete/compgen/compopt + +pathexp.c + - quote_string_for_globbing: if QGLOB_REGEXP, make sure characters + between brackets in an ERE bracket expression are not inappropriately + quoted with backslashes. This is a pretty substantial change, + should be stressed when opening bash up for alpha and beta tests. + Fixes bug pointed out by Stephane Chazleas + + +doc/{bash.1,bashref.texi} + - document that regexp matches can be inconsistent when quoting + characters in bracket expressions, since usual quoting characters + lose their meaning within brackets + - note that regular expression matching when the pattern is stored + in a shell variable which is quoted for expansion causes string + matching + +redir.h + - RX_SAVEFD: new flag value; notes that a redirection denotes an + fd used to save another even if it's not >= SHELL_FD_BASE + +redir.c + - do_redirection_internal: when deciding whether or not to reset the + close-on-exec flag on a restored file descriptor, trust the value + of redirect->flags & RX_SAVCLEXEC even if the fd is < SHELL_FD_BASE + if the RX_SAVEFD flag is set + - add_undo_redirect: set the RX_SAVEFD flag if the file descriptor + limit is such that the shell can't duplicate to a file descriptor + >= 10. Fixes a limitation that tripped a coreutils test reported + by Paul Eggert + + 11/19 + ----- +doc/{bash.1,bashref.texi},lib/readline/doc/hsuser.texi + - make it clear that bash runs HISTFILESIZE=$HISTSIZE after reading + the startup files + - make it clear that bash runs HISTSIZE=500 after reading the + startup files + - make it clear that setting HISTSIZE=0 causes commands to not be + saved in the history list + - make it clear that setting HISTFILESIZE=0 causes the history file + to be truncated to zero size + +variables.c + - sv_histsize: change so setting HISTSIZE to a value less than 0 + causes the history to be `unstifled' + - sv_histsize: change so setting HISTFILESIZE to a value less than 0 + results in no file truncation + - make it clear that numeric values less than 0 for HISTFILESIZE or + HISTSIZE inhibit the usual functions + + 11/23 + ----- +parse.y + - save_input_line_state: add missing `return ls' at the end, since the + function is supposed to return its argument. Pointed out by + Andreas Schwab + +builtins/read.def + - skip over NUL bytes in input, as most modern shells seem to. Bug + report by Matthew Story + +lib/readline/vi_mode.c + - rl_vi_replace: set _rl_vi_last_key_before_insert to invoking key + + 11/25 + ----- +builtins/read.def + - read_builtin: if xrealloc returns same pointer as first argument, + don't bother with the remove_unwind_protect/add_unwind_protect pair + - read_builtin: set a flag (`reading') around calls to zread/zreadc + and readline() + - sigalrm: change to set flag (`sigalrm_seen') and only longjmp if + currently in read(2) (reading != 0) + - CHECK_ALRM: new macro, checks sigalrm_seen and longjmps if non-zero, + behavior of old SIGALRM catching function + - read_builtin: call CHECK_ALRM in appropriate places while reading + line of input. Fixes bug reported by Pierre Gaston + + +lib/readline/vi_mode.c + - rl_vi_replace: initialize characters before printing characters in + vi_replace_keymap to their default values in vi_insertion_keymap, + since we're supposed to be in insert mode replacing characters + - rl_vi_replace: call rl_vi_start_inserting to set last command to + `R' for undo + - rl_vi_replace: set _rl_vi_last_key_before_insert to `R' for future + use by _rl_vi_done_inserting + - vi_save_insert_buffer: new function, broke out code that copies text + into vi_insert_buffer from _rl_vi_save_insert + - _rl_vi_save_replace: new function, saves text modified by + rl_vi_replace (using current point and vi_replace_count to figure + it out) to vi_replace_buffer + - _rl_vi_save_insert: call vi_save_insert_buffer + - _rl_vi_done_inserting: if _rl_vi_last_key_before_insert == 'R', call + _rl_vi_save_replace to save text modified in replace mode (uses + vi_save_insert_buffer) + - _rl_vi_replace_insert: new function, replaces the number of chars + in vi_insert_buffer after rl_point with contents ov vi_insert_buffer + - rl_vi_redo: call _rl_vi_replace_insert if last command == 'R' and + there's something in vi_insert_buffer. Fixes bug with `.' not + redoing the most recent `R' command, reported by Geoff Clare + in readline area on savannah + + 11/26 + ----- +lib/readline/rlprivate.h + - RL_SIG_RECEIVED(): evaluate to non-zero if there is a pending signal + to be handled + - RL_SIGINT_RECEIVED(): evaluate to non-zero if there is a pending + SIGINT to be handled + +lib/readline/complete.c + - remove all mention of _rl_interrupt_immediately + - rl_completion_matches: check RL_SIG_RECEIVED after each call to + the entry function, call RL_CHECK_SIGNALS if true to handle the + signal + - rl_completion_matches: if RL_SIG_RECEIVED evaluates to true, free + and zero out the match_list this function allocated + - rl_completion_matches: if the completion entry function is + rl_filename_completion_function, free the contents of match_list, + because that function does not keep state and will not free the + entries; avoids possible memory leak pointed out by + Garrett Cooper + - gen_completion_matches: if RL_SIG_RECEIVED evalutes to true after + calling rl_attempted_completion_function, free the returned match + list and handle the signal with RL_CHECK_SIGNALS; avoids + possible memory leak pointed out by Garrett Cooper + + - gen_completion_matches: if RL_SIG_RECEIVED evaluates to true after + calling rl_completion_matches, free the returned match list and + handle the signal with RL_CHECK_SIGNALS + +lib/readline/util.c + - rl_settracefp: new utility function to set the tracing FILE * + +lib/readline/signals.c + - _rl_sigcleanup: pointer to a function that will be called with the + signal and a void * argument from _rl_handle_signal + - _rl_sigcleanarg: void * that the rest of the code can set to have + passed to the signal cleanup function + - _rl_handle_signal: if _rl_sigcleanup set, call as + (*_rl_sigcleanup) (sig, _rl_sigcleanarg) + +lib/readline/rlprivate.h + - extern declarations for _rl_sigcleanup and _rl_sigcleanarg + +lib/readline/complete.c + - _rl_complete_sigcleanup: signal cleanup function for completion code; + calls _rl_free_match_list on _rl_sigcleanarg if signal == SIGINT + - rl_complete_internal: before calling display_matches if what_to_do + == `?', set _rl_sigcleanup to _rl_complete_sigcleanup so the match + list gets freed on SIGINT; avoids possible memory leak pointed out + by Garrett Cooper + - rl_complete_internal: in default switch case, call _rl_free_match_list + before returning to avoid memory leak + +doc/bashref.texi + - start at a set of examples for the =~ regular expression matching + operator, touching on keeping the pattern in a shell variable and + quoting portions of the pattern to remove their special meaning + + 12/1 + ---- +lib/glob/gmisc.c + - extglob_pattern: new function, returns 1 if pattern passed as an + argument looks like an extended globbing pattern + +lib/glob/glob.c + - skipname: return 0 immediately if extglob_pattern returns non-zero, + let the extended globbing code do the right thing with skipping + names beginning with a `.' + - mbskipname: return 0 immediately if extglob_pattern returns non-zero, + let the extended globbing code do the right thing with skipping + names beginning with a `.'. Fixes bug reported by Yongzhi Pan + + + 12/2 + ---- +lib/glob/smatch.c + - patscan, patscan_wc: no longer static so other parts of the glob + library can use them, renamed to glob_patscan, glob_patscan_wc + +lib/glob/glob.c + - extern declarations for glob_patscan, glob_patscan_wc + - wchkname: new function, does skipname on wchar_t pattern and dname, + old body of mbskipname after converting to wide chars + - extglob_skipname: new function, checks all subpatterns in an extglob + pattern to determine whether or not a filename should be skipped. + Calls skipname for each subpattern. Dname is only skipped if all + subpatterns indicate it should be. Better fix for bug reported by + Yongzhi Pan + - wextglob_skipname: wide-char version of extglob_skipname, calls + wchkname instead of calling back into mbskipname for each + subpattern to avoid problems with char/wchar_t mismatch + - skipname: call extglob_skipname if extglob_pattern returns non-zero + - mbskipname: call wextglob_skipname if extglob_pattern returns non-zero + - mbskipname: short-circuit immediately if no multibyte chars in + pattern or filename + +execute_cmd.c + - execute_cond_node: added parens to patmatch assignment statement to + make intent clearer + + 12/3 + ---- +configure.in,config.h.in + - check for imaxdiv, define HAVE_IMAXDIV if present + +expr.c + - expassign, exp2: use imaxdiv if available. Doesn't help with checks + for overflow from 10/25 + + 12/6 + ---- +lib/readline/complete.c + - compute_lcd_of_matches: if we're ignoring case in the matches, only + use what the user typed as the lcd if it matches the first match + (after sorting) up to the length of what was typed (if what the + user typed is longer than the shortest of the possible matches, use + the shortest common length of the matches instead). If it doesn't + match, use the first of the list of matches, as if case were not + being ignored. Fixes bug reported by Clark Wang + + + 12/7 + ---- +builtins/cd.def + - cd_builtin: add code to return error in case cd has more than one + non-option argument, conditional on CD_COMPLAINS define (which is + not defined anywhere) + +doc/{bash.1,bashref.texi} + - note that additional arguments to cd following the directory name + are ignored. Suggested by Vaclav Hanzl + + 12/10 + ----- +lib/readline/input.c + - rl_read_key: don't need to increment key sequence length here; doing + it leads to an off-by-one error + +lib/readline/macro.c + - rl_end_kbd_macro: after off-by-one error with rl_key_sequence_length + fixed, can decrement current_macro_index by rl_key_sequence_length + (length of key sequence that closes keyboard macro) + +lib/readline/readline.c + - _rl_dispatch_subseq: fix extra increment of rl_key_sequence_length + when ESC maps to a new keymap and we're converting meta characters + to ESC+key + - _rl_dispatch_subseq: better increment of rl_key_sequence_length + before we dispatch to a function in the ISFUNC case (where the + second increment above should have happened) + - rl_executing_keyseq: the full key sequence that ended up executing + a readline command. Available to the calling application, maintained + by _rl_dispatch_subseq, indexed by rl_key_sequence_length + - rl_executing_key: the key that was bound to the currently-executing + readline command. Same as the `key' argument to the function + +lib/readline/readline.h + - rl_executing_keyseq: extern declaration + - rl_executing_key: extern declaration + - rl_key_sequence_length: declaration moved here from rlprivate.h, + now part of public interface + +lib/readline/rlprivate.h + - new extern declaration for _rl_executing_keyseq_size, buffer size + for rl_executing_keyseq + +lib/readline/doc/rltech.texi + - documented new variables: rl_executing_key, rl_executing_keyseq, + rl_key_sequence_length + + 12/13 + ----- +bashline.c + - bash_execute_unix_command: replace ad-hoc code that searches + cmd_xmap for correct command with call to rl_function_of_keyseq + using rl_executing_keyseq; now supports key sequences longer + than two characters. Fixes bug reported by Michael Kazior + + + 12/15 + ----- +make_cmd.c + - make_function_def: don't null out source_file before calling + make_command so it can be used later on when the function definition + is executed + +execute_cmd.c + - execute_intern_function: second argument is now FUNCTION_DEF * + instead of COMMAND * + - execute_command_internal: call execute_intern_function with the + new second argument (the entire FUNCTION_DEF instead of just the + command member) + - execute_intern_function: if DEBUGGER is defined, call + bind_function_def before calling bind_function, just like + make_function_def does (might be able to take out the call in + make_function_def depending on what the debugger does with it). + Fixes bug reported by + +expr.c + - more minor changes to cases of INTMAX_MIN % -1 and INTMAX_MIN / 1; + fix typos and logic errors + + 12/16 + ----- +bashline.c + - find_cmd_start: change flags to remove SD_NOSKIPCMD so it skips over + command substitutions and doesn't treat them as command separators + - attempt_shell_completion: instead of taking first return from + find_cmd_name as command name to use for programmable completion, + use loop to skip over assignment statements. Fixes problem reported + by Raphael Droz + - attempt_shell_completion: if we don't find a command name but the + command line is non-empty, assume the other words are all assignment + statements and flag that point is in a command position so we can + do command name completion + - attempt_shell_completion: if the word being completed is the first + word following a series of assignment statements, and the + command line is non-empty, flag that point is in a command position + so we can do command name completion + +lib/readline/history.c + - history_get_time: atol -> strtol + + 12/18 + ----- +parse.y + - parser_in_command_position: external interface to the + command_token_position macro for use by other parts of the shell, + like the completion mechanism + +externs.h + - extern declaration for parser_in_command_position + + 12/19 + ----- + +builtins/read.def + - read_builtin: make sure all calls to bind_read_variable are passed + a non-null string. Fixes bug reported by Dan Douglas + + +bashline.c + - attempt_shell_completion: mark that we're in a command position if + we're at the start of the line and the parser is ready to accept + a reserved word or command name. Feature most recently suggested + by Peng Yu + + 12/21 + ----- +lib/readline/bind.c + - _rl_escchar: return the character that would be backslash-escaped + to denote the control character passed as an argument ('\n' -> 'n') + - _rl_isescape: return 1 if character passed is one that has a + backslash escape + - _rl_untranslate_macro_value: new second argument: use_escapes, if + non-zero translate to backslash escapes where possible instead of + using straight \C-x for control character `x'. Change callers + - _rl_untranslate_macro_value: now global + +lib/readline/rlprivate.h + - _rl_untranslate_macro_value: extern declaration + +lib/readline/{macro.c,readline.h} + - rl_print_last_kbd_macro: new bindable function, inspired by patch + from Mitchel Humpherys + +lib/readline/funmap.c + - print-last-kbd-macro: new bindable command, bound to + rl_print_last_kbd_macro + +lib/readline/doc/{rluser.texi,readline.3},doc/bash.1 + - print-last-kbd-macro: document. + +lib/readline/text.c + - _rl_insert_next: if we're defining a macro, make sure the key gets + added to the macro text (should really audit calls to rl_read_key() + and make sure the right thing is happening for all of them) + +bashline.[ch] + - print_unix_command_map: new function, prints all bound commands in + cmd_xmap using rl_macro_dumper in a reusable format + +builtins/bind.def + - new -X option: print all keysequences bound to Unix commands using + print_unix_command_map. Feature suggested by Dennis Williamson + (2/2011) + +doc/{bash.1,bashref.texi} + - document new `bind -X' option + + 12/24 + ----- + +doc/{bash.1,bashref.texi} + - add a couple of sentences to the description of the case modification + operators making it clearer that each character of parameter is + tested against the pattern, and that the pattern should only attempt + to match a single character. Suggested by Bill Gradwohl + + + 12/28 + ----- +shell.c + - init_noninteractive: instead of calling set_job_control(0) to + unconditionally turn off job control, turn on job control if + forced_interactive or jobs_m_flag is set + - shell_initialize: call initialize_job_control with jobs_m_flag as + argument so `bash -m script' enables job control while running the + script + +jobs.c + - initialize_job_control: if the `force' argument is non-zero, turn on + job control even if the shell is not currently interactive + (interactive == 0) + + 12/29 + ----- + +flags.h + - new extern declaration for jobs_m_flag + +builtins/{cd,set}.def,doc/{bash.1,bashref.texi} + - added text clarifying the descriptions of cd -L and -P, suggested by + Padraig Brady + - slight change to the description of `set -P' about resolving symbolic + links + +lib/readline/doc/rluser.texi + - Added an example to the programmable completion section: _comp_cd, + a completion function for cd, with additional verbiage. Text + includes a reference to the bash_completion project + + 1/1/2012 + -------- +jobs.c + - set_job_status_and_cleanup: note that a job is stopped due to + SIGTSTP (any_tstped) if job_control is set; there's no need to + test interactive + + 1/5 + --- +quit.h + - LASTSIG(): new macro, expands to signal number of last terminating + signal received (terminating_signal or SIGINT) + +trap.c + - first_pending_trap: returns lowest signal number with a trap pending + - trapped_signal_received: set to the last trapped signal the shell + received in trap_handler(); reset to 0 in run_pending_traps + +builtins/read.def + - read_builtin: changes to posix-mode (posixly_correct != 0) to make + `read' interruptible by a trapped signal. After the trap runs, + read returns 128+sig and does not assign the partially-read line + to the named variable(s). From an austin-group discussion started + by David Korn + + 1/11 + ---- +doc/{bash.1,bashref.texi} + - slight changes to the descriptions of the compat32 and compat40 shell + options to clarify their meaning + + 1/12 + ---- +lib/readline/{colors.[ch],parse-colors.[ch]} + - new files, part of color infrastructure support + +Makefile.in,lib/readline/Makefile.in + - arrange to have colors.o and parse-colors.o added to readline + library + +{configure,config.h}.in + - check for stdbool.h, define HAVE_STDBOOL_H if found + + 1/14 + ---- +lib/readline/bind.c + - colored_stats: new bindable variable, enables using colors to + indicate file type when listing completions + +lib/readline/complete.c + - _rl_colored_stats: new variable, controlled by colored-stats bindable + variable + - colored_stat_start, colored_stat_end: new functions to set and reset + the terminal color appropriately depending on the type of the + filename to be printed + - print_filename: changes to print colors if `colored-stats' variable + set. Changes contributed by Raphael Droz + + +lib/readline/readline.c + - rl_initialize_everything: add call to _rl_parse_colors to parse + color values out of $LS_COLORS. May have to add to rl_initialize + to make more dynamic if LS_COLORS changes (which doesn't happen + very often, if at all) + +lib/readline/rlprivate.h + - _rl_colored_stats: new extern declaration + +lib/readline/doc/{readline.3,rluser.texi},doc/bash.1 + - colored-stats: document new bindable readline variable + +lib/readline/colors.c + - _rl_print_color_indicator: call rl_filename_stat_hook before calling + lstat/stat so we can get color indicators for stuff like + $HOME/Applications + +lib/readline/complete.c + - stat_char: call rl_filename_stat_hook before calling lstat/stat + +findcmd.[ch],execute_cmd.c + - search_for_command: now takes a second `flags' argument; changed + header function prototype and callers + - search_for_command: if (flags & 1), put the command found in $PATH + into the command hash table (previous default behavior) + +execute_cmd.c + - is_dirname: call search_for_command with flags argument of 0 so it + doesn't try to put something in the command hash table + +bashline.c + - bash_command_name_stat_hook: a hook function for readline's + filename_stat_hook that does $PATH searching the same way that + execute_cmd.c:execute_disk_command() does it, and rewrites the + passed filename if found. Does not put names into command hash + table. This allows command name completion to take advantage + of `visible-stats' and `colored-stats' settings. + - executable_completion: new function, calls the directory completion + hook to expand the filename before calling executable_file or + executable_or_directory; change command_word_completion_function to + call executable_completion. This allows $HOME/bin/[TAB] to do + command completion and display alternatives + + 1/17 + ---- +pcomplete.c + - gen_command_matches: now takes a new second argument: the command + name as deciphered by the programmable completion code and used + to look up the compspec; changed callers (gen_compspec_completions) + - gen_shell_function_matches: now takes a new second argument: the + command that originally caused the completion function to be + invoked; changed callers (gen_compspec_completions)) + - build_arg_list: now takes a new second argument: the command name + corresponding to the current compspec; changed callers + (gen_command_matches, gen_shell_function_matches) + - build_arg_list: now uses `cmd' argument to create $1 passed to + invoked command or shell function + - gen_compspec_completions: if we skipped a null command at the + beginning of the line (e.g., for completing `>'), add a new word for + it at the beginning of the word list and increment nw and cw + appropriately. This is all a partial fix for the shortcoming + pointed out by Sung Pae + + 1/18 + ---- + +{configure,config.h}.in + - new check: check for AUDIT_USER_TTY defined in , + define HAVE_DECL_AUDIT_USER_TTY if both are found + +lib/readline/rlconf.h + - ENABLE_TTY_AUDIT_SUPPORT: new define, allows use of the Linux kernel + tty auditing system if it's available and enabled + +lib/readline/util.c + - _rl_audit_tty: new function, send a string to the kernel tty audit + system + +lib/readline/rlprivate.h + - _rl_audit_tty: new extern declaration + +lib/readline/readline.c + - readline: call _rl_audit_tty with line to be returned before returning + it if the Linux tty audit system is available and it's been enabled + in rlconf.h Original patch from Miroslav Trmac; recent request + from Miroslav Lichvar + + 1/21 + ---- + +lib/readline/readline.c: + - _rl_dispatch_subseq: add an inter-character timeout for multi-char + key sequences. Suggested by . Still needs + work to make a user-settable variable + +parse.y + - shell_getc: make code that uses the pop_alias dependent on ALIAS + define + +variables.h + - sv_tz: extern define should only depend on HAVE_TZSET + +expr.c + - expr_streval: if ARRAY_VARS is not defined, set lvalue->ind to -1; + move assignment to `ind' inside define + - expr_bind_array_element: declaration and uses need to be #ifdef + ARRAY_VARS + +arrayfunc.h + - AV_ALLOWALL, AV_QUOTED, AV_USEIND: define to 0 if ARRAY_VARS not + defined; used in subst.c unconditionally + +sig.h + - make the signal blocking functions not dependent on JOB_CONTROL + +sig.c + - sigprocmask: make the replacement definition not dependent on + JOB_CONTROL + +trap.c + - use BLOCK_SIGNAL/UNBLOCK_SIGNAL instead of code dependent on + HAVE_POSIX_SIGNALS and BSD signals + + 1/24 + ---- + +print_cmd.c + - print_redirection_list: change the conditions under which + r_duplicating_output_word is mapped to r_err_and_out to more or + less match those used in redir.c. Fixes bug pointed out by + Dan Douglas + + + 1/29 + ---- +lib/readline/signals.c + - _rl_block_sigwinch,_rl_release_sigwinch: don't compile in bodies + unless SIGWINCH is defined. Fixes bug reported by Pierre Muller + + +doc/{bash.1,bashref.texi} + - small modifications to the introduction to the REDIRECTION section + to describe how redirections can modify file handles + - small modification to the section describing base#n to make it + clearer that n can be denoted using non-numerics. From a posting + by Linda Walsh + + 2/2 + --- +builtins/printf.def + - printf_builtin: make sure vbuf is intialized and non-null when -v + is supplied, since other parts of the code assume that it's not + null (e.g., bind_printf_variable()). Fixes bug reported by Jim + Avera + + 2/4 + --- +lib/readline/undo.c + - _rl_free_undo_list: new function, old body of rl_free_undo_list, + frees undo entries in UNDO_LIST * passed as argument + - rl_free_undo_list: call _rl_free_undo_list + +lib/readline/rlprivate.h + - _rl_free_undo_list: new extern declaration + - _rl_keyseq_timeout: new extern declaration (see below) + +lib/readline/misc.c + - rl_clear_history: new function. Clears the history list and frees + all associated data similar to history.c:clear_history(), but + takes rl_undo_list into account and frees and UNDO_LISTs saved as + `data' members of a history list entry + +lib/readline/doc/rltech.texi + - rl_clear_history: documented + +lib/readline/readline.c + - _rl_keyseq_timeout: new variable to hold intra-key timeout value + from 1/21 fix; specified in milliseconds. Default value is 500 + - _rl_dispatch_subseq: change to use _rl_keyseq_timeout as intra-key + timeout if it's greater than 0; no timeout if <= 0 + - _rl_dispatch_subseq: don't check for queued keyboard input if we have + pushed or pending input, or if we're reading input from a macro + +lib/readline/bind.c + - keyseq-timeout: new bindable variable, shadows _rl_keyseq_timeout + - string_varlist: add keyseq-timeout + - sv_seqtimeout: new function to modify value of _rl_keyseq_timeout; + clamps negative values at 0 for now + - _rl_get_string_variable_value: return value for keyseq-timeout + +doc/bash.1,lib/readline/doc/{rluser.texi,readline.3} + - keyseq-timeout: documented + +lib/readline/isearch.c + - _rl_isearch_dispatch: modification to fix from 7/18 to not use + cxt->keymap and cxt->okeymap, since by the time this code is + executed, they are equal. Use `f' to check for rl_insert or + unbound func + - _rl_isearch_dispatch: if we're switching keymaps, not in + callback mode, and don't have pending or pushed input, use + _rl_input_queued to resolve a potentially ambiguous key sequence. + Suggested by Roger Zauner + - _rl_isearch_dispatch: if we have changed keymaps and resolved to + an editing function (not self-insert), make sure we stuff the + right characters back onto the input after changing the keymap + back so the right editing function is executed after the search + is terminated. Rest of fix for bug reported by Roger Zauner + + + 2/5 + --- +builtins/gen-helpfiles.c + - new file: reads struct builtin and writes the long docs to files + in the `helpdirs' subdirectory. The filename is given in the + previously-unused `handle' member of the struct builtin. Links + with `tmpbuiltins.o', which is created by Makefile to have the + right long documentation. When not cross-compiling, gets the + right #defines based on configuration options from config.h instead + of trying to parse conditional parts of def files. Fixes + shortcoming pointed out by Andreas Schwab + +builtins/Makefile.in + - tmpbuiltins.c: new generated file, created to enable creation of + separate helpfiles based on correct #defines instead of trying to + parse conditional parts of def files + - gen-helpfiles: new program to generate helpfiles, links with + tmpbuiltins.o + - HELPFILES_TARGET: new target, substituted by configure to `helpdoc' + if separate helpfiles requested + - targets: new target, libbuiltins.a and $(HELPFILES_TARGET) + - CREATED_OBJECTS: new variable, holds created object files for + make clean; changed make clean to remove created objects + - helpdoc: changed to call gen-helpfiles instead of mkbuiltins + +Makefile.in + - when building libbuiltins.a, recursively call make with `targets' + argument to make sure separate helpfiles get built + +configure.in + - substitute `helpdoc' as value of HELPFILES_TARGET if + --enable-separate-helpfiles supplied as configure argument + +builtins/mkbuiltins.c + - `-nofunctions': new argument, causes mkbuiltins to not write value + for function implementing a particular builtin to struct builtin + and to write document file name to `handle' member of struct builtin + - no longer writes separate helpfiles; that is left to gen-helpfiles + + 2/8 + --- +subst.c + - make sure last_command_exit_value is set to a non-zero value before + any calls to report_error, since `-e' set will short-circuit + report_error. Fixes bug reported by Ewan Mellor + + +variables.c + - make_local_array_variable: added second argument; if non-zero, + function will return an existing local associative array variable + instead of insisting on an indexed array + +variable.h,subst.c + - make_local_array_variable: changed prototype and caller + +builtins/declare.def + - declare_internal: add second arg to call to make_local_array_variable; + making_array_special, which indicates we're processing an + assignment like declare a[b]=c. Fixes seg fault resulting from + a being an already-declared local associative array variable in a + function. Ubuntu bash bug 928900. + + 2/14 + ---- + +execute_cmd.c + - execute_command_internal: if redirections into or out of a loop fail, + don't try to free ofifo_list unless saved_fifo is non-zero. It's + only valid if saved_fifo is set + + 2/15 + ---- +{arrayfunc,braces,variables}.c + - last_command_exit_value: make sure it's set before any calls to + report_error, since -e will cause that to exit the shell + +builtins/common.c + - get_job_by_name: call internal_error instead of report_error so this + doesn't exit the shell + + 2/18 + ---- +builtins/evalstring.c + - parse_and_execute: make sure the file descriptor to be redirected to + is 1 before calling cat_file. One fix for bug reported by Dan Douglas + + +parse.y + - read_token_word: don't return NUMBER if a string of all digits + resolves to a number that overflows the bounds of an intmax_t. + Other fix for bug reported by Dan Douglas + + 2/19 + ---- +lib/sh/strtrans.c + - ansicstr: use 0x7f as the boundary for characters that translate + directly from ASCII to unicode (\u and \U escapes) instead of + UCHAR_MAX, since everything >= 0x80 requires more than one byte. + Bug and fix from John Kearney + +builtins/printf.def + - tescape: ditto for printf \u and \U escape sequences + + 2/20 + ---- +lib/sh/unicode.c + - u32toutf8: fix to handle encodings up to six bytes long correctly + (though technically UTF-8 only has characters up to 4 bytes long). + Report and fix from John Kearney + - u32toutf8: first argument is now an unsigned 32-bit quantity, + changed callers (u32cconv) to pass c instead of wc + - u32reset: new function, resets local static state to uninitialized + (locale information, currently) + +locale.c + - call u32reset whenever LC_CTYPE/LC_ALL/LANG is changed to reset the + cached locale information used by u32cconv. From a report from + John Kearney + + 2/21 + ---- +doc/{bash,builtins}.1 + - minor changes from Bjarni Ingi Gislason + +lib/sh/unicode.c + - u32cconv: only assume you can directly call wctomb on the passed + value if __STDC_ISO_10646__ is defined and the value is <= + 0x7fffffff + - stub_charset: return locale as default instead of "ASCII", let + rest of code decide what to do with it + +lib/readline/parens.c + - _rl_enable_paren_matching: make paren matching work in vi insert + mode. Bug report from + + 2/22 + ---- +lib/sh/shquote.c + - sh_backslash_quote: quote tilde in places where it would be + expanded. From a report from John Kearney + + 2/23 + ---- +execute_cmd.c + - execute_pipeline: wrap the discard_unwind_frame call in #ifdef + JOB_CONTROL, since the frame is only created if JOB_CONTROL is + defined. Bug and fix from Doug Kehn + + 2/25 + ---- +error.c + - report_error: make sure last_command_exit_value is non-zero before + we call exit_shell, since the exit trap may reference it. Call + exit_shell with last_command_exit_value to allow exit statuses + other than 1 + +unicode.c + - stub_charset: use local static buffer to hold charset, don't change + value returned by get_locale_var. Based on idea and code from + John Kearney + - u32toutf16: function to convert unsigned 32-bit value (unicode) to + UTF-16. From John Kearney + - u32cconv: call u32toutf16 if __STDC_ISO_10646__ defined and wchar_t + is two bytes, send result to wcstombs, return if not encoding error. + From John Kearney + - u32cconv: return UTF-8 conversion if iconv conversion to local + charset is unsupported + + 3/2 + --- +lib/readline/complete.c + - print_filename: if there is no directory hook, but there is a stat + hook, and we want to append a slash to directories, call the stat + hook before calling path_isdir on the expanded directory name. + Report and pointer to fix from Steve Rago + + 3/3 + --- +builtins/evalstring.c + - parse_and_execute: fix to change of 2/18: make sure the file + descriptor being redirected to is 0 before calling cat_file when + we see something like $(< file). Real fix for bug reported by + Dan Douglas + +subst.c + - parameter_brace_patsub: run the replacement string through quote + removal even if the expansion is within double quotes, because + the parser and string extract functions treat the quotes and + backslashes as special. If they're treated as special, quote + removal should remove them (this is the Posix position and + compatible with ksh93). THIS IS NOT BACKWARDS COMPATIBLE. + + 3/4 + --- +lib/readline/complete.c + - rl_menu_complete: fix to make show-all-if-ambiguous and + menu-complete-display-prefix work together if both are set. Fix + from Sami Pietila + + 3/5 + --- +bashline.c + - dircomplete_expand_relpath: new variable, if non-zero, means that + `shopt -s direxpand' should expand relative pathnames. Zero by + default, not user-settable yet + - bash_directory_completion_hook: if we have a relative pathname that + isn't changed by canonicalization or spell checking after being + appended to $PWD, then don't change what the user typed. Controlled + by dircomplete_expand_relpath + + 3/7 + --- +m4/timespec.m4 + - new macros, cribbed from gnulib and coreutils: find out whether we + have `struct timespec' and what file includes it + +m4/stat-time.m4 + - new macros, cribbed from gnulib and coreutils: find out whether the + mtime/atime/ctime/etctime fields of struct stat are of type + struct timespec, and what the name is + +include/stat-time.h + - new file, cribbed from gnulib, with additions from coreutils: include + the right file to get the struct timespec define, or provide our own + replacement. Provides a bunch of inline functions to turn the + appropriate members of struct stat into `struct timespec' values, + zeroing out the tv_nsec field if necessary + +test.c + - include "stat-time.h" for the nanosecond timestamp resolution stuff + - stat_mtime: new function, returns struct stat and the mod time + normalized into a `struct timespec' for the filename passed as the + first argument + - filecomp: call stat_mtime instead of sh_stat for each filename + argument to get the mtime as a struct timespec + - filecomp: call timespec_cmp instead of using a straight arithmetic + comparison for the -nt and -ot operators, using timespec returned by + stat_mtime. Added functionality requested by by Werner Fink + for systems that can support it + + 3/10 + ---- +include/posixdir.h + - REAL_DIR_ENTRY: remove dependency on _POSIX_SOURCE, only use feature + test macros to decide whether dirent.d_ino is present and usable; + define D_INO_AVAILABLE. Report and fix from Fabrizion Gennari + + - D_FILENO_AVAILABLE: define if we can use dirent.d_fileno + +lib/sh/getcwd.c + - use D_FILENO_AVAILABLE to decide whether or not to compile in + _path_checkino and whether or not to call it. Report and initial + fix from Fabrizion Gennari + +lib/readline/signals.c + - make sure all occurrences of SIGWINCH are protected by #ifdef + +sig.c + - make sure all occurrences of SIGCHLD are protected by #ifdef + +nojobs.c + - make sure SA_RESTART is defined to 0 if the OS doesn't define it + +version.c + - show_shell_version: don't use string literals in printf, use %s. + Has added benefit of removing newline from string to be translated + +trap.c + - queue_sigchld_trap: new function, increments the number of pending + SIGCHLD signals by the argument, which is by convention the number + of children reaped in a call to waitchld() + +trap.h + - queue_sigchld_trap: new extern declaration + +jobs.c + - waitchld: if called from the SIGCHLD signal handler (sigchld > 0), + then call queue_sigchld_trap to avoid running the trap in a signal + handler context. Report and original fix from Siddhesh Poyarekar + + +lib/sh/unicode.c + - u32tocesc: take an unsigned 32-bit quantity and encode it using + ISO C99 string notation (\u/\U) + - u32cconv: call u32tocesc as a fallback instead of u32cchar + - u32cconv: call u32tocesc if iconv cannot convert the character. + Maybe do the same thing if iconv_open fails + - u32reset: call iconv_close on localconv if u32init == 1 + + 3/11 + ---- +config-top.h + - CHECKWINSIZE_DEFAULT: new define, set to initial value of + check_window_size (shopt checkwinsize): 0 for off, 1 for on. + Default is 0 + +{jobs,nojobs}.c + - check_window_size: default initial value to CHECKWINSIZE_DEFAULT + + 3/13 + ---- +doc/bashref.texi + - change text referring to the copying restrictions to that + recommended by the FSF (no Front-Cover Texts and no Back-Cover + Texts) + +lib/readline/doc/{history,rlman,rluserman}.texi + - change text referring to the copying restrictions to that + recommended by the FSF (no Front-Cover Texts and no Back-Cover + Texts) + + 3/15 + ---- +array.c + - LASTREF_START: new macro to set the starting position for an array + traversal to `lastref' if that's valid, and to the start of the array + if not. Used in array_reference, array_insert, array_remove + - array_remove: try to be a little smarter with lastref instead of + unconditionally invalidating it + + 3/16 + ---- +array.c + - array_insert: fix memory leak by deleting element to be added in the + case of an error + + 3/18 + ---- +lib/sh/mbschr.c + - mbschr: don't call mbrlen unless is_basic is false; devolves to a + straight character-by-character run through the string + + 3/19 + ---- +stringlib.c + - substring: use memcpy instead of strncpy, since we know the length + and are going to add our own NUL terminator + + 3/20 + ---- +subst.c + - parameter_brace_expand_rhs: if expand_string_for_rhs returns a quoted + null string (a list with one element for which + QUOTED_NULL(list->word->word) returns true), return the quoted null + and set the flags in the returned word to indicate it. Fixes bug + reported by Mark Edgar + +lib/sh/tmpfile.c + - use random(3) instead of get_random_number to avoid perturbing the + random sequence you get using $RANDOM. Bug report and fix from + Jurij Mihelic + + 3/21 + ---- +config-top.h + - OPTIMIZE_SEQUENTIAL_ARRAY_ASSIGNMENT: define to 1 to optimize + sequential indexed array assignment patterns. Defined to 1 by + default + +array.c + - array_insert: if OPTIMIZE_SEQUENTIAL_ARRAY_ASSIGNMENT is defined, + start the search at lastref (see change from 3/15) + + 3/27 + ---- +print_cmd.c + - debug_print_word_list: new debugging function, prints a word list + preceded by an optional string and using a caller-specified + separator + + 4/1 + --- +command.h + - W_ASSNGLOBAL: new flag, set to indicate declare -g + +execute_cmd.c + - fix_assignment_words: note that we have a -g argument to an assignment + builtin and set the W_ASSNGLOBAL flag in the variable word + +subst.c + - dump_word_flags: print out W_ASSNGLOBAL if present + - do_assignment_internal: only set ASS_MKLOCAL if W_ASSIGNARG is set + and W_ASSNGLOBAL is not. Don't want to create a local variable even + if variable_context is non-zero if ASSNGLOBAL is set. Fixes bug + reported by Bill Gradwohl + + 4/7 + --- +lib/readline/readline.c + - _rl_dispatch_subseq: make the `keyseq-timeout' variable apply to + ESC processing when in vi mode. After hitting ESC, readline will + wait up to _rl_keyseq_timeout*1000 microseconds (if set) for + additional input before dispatching on the ESC and switching to + command/movement mode. Completes timeout work suggested by + ; this prompted by report from Barry Downes + + +lib/sh/shmbchar.c + - sh_mbsnlen: new function, returns the number of (possibly multibyte) + characters in a passed string with a passed length, examining at most + maxlen (third argument) bytes + +externs.h + - sh_mbsnlen: extern declaration for new function + +shell.c + - exit_shell: call maybe_save_shell_history if remember_on_history is + set, not just in interactive shells. That means the history is + saved if history is enabled, regardless of whether or not the shell + is interactive + +doc/{bash.1,bashref.texi} + - TMOUT: fix description to make it explicit that TMOUT is the timeout + period for a complete line of input, not just any input. Fixes + problem reported in Ubuntu bug 957303: + https://bugs.launchpad.net/ubuntu/+source/bash/+bug/957303 + - HISTFILE: document change to write history list to history file in + any shell with history enabled, not just interactive shells. This + seems to be more logical behavior. Suggested by Greg Wooledge + + + 4/12 + ---- +lib/readline/colors.h + - only include stdbool.h if HAVE_STDBOOL_H is defined + - if HAVE_STDBOOL_H is not defined, provide enough definition for the + library to use `bool', `true', and `false' + +lib/readline/parse-colors.[ch] + - don't try to include at all; rely on colors.h to do it + +lib/sh/snprintf.c + - vsnprintf_internal: only treat '0' as a flag to indicate zero padding + if `.' hasn't been encountered ((flags&PF_DOT) == 0); otherwise treat + it as the first digit of a precision specifier. Fixes bug reported + by Petr Sumbera + + 4/15 + ---- +lib/sh/snprintf.c + - vsnprintf_internal: if the '0' and '-' flags both occur, the '0' + flag is ignored -- Posix. Start of a series of fixes based on + tests and patches from Petr Sumbera + - PUT_PLUS: make sure PF_PLUS flag is specified before putting the `+' + - vsnprintf_internal: when '+' is read as a flag, don't set right- + justify flag if the LADJUST (`-') flag has already been supplied + - floating: make sure to output space padding before the `+', zero + padding after + - exponent: make sure to output space padding before the `+', zero + padding after + - exponent: only subtract one from the width for the decimal point + if we're really going to print one + - floating: use presence of PF_PLUS flag to decide whether to account + for the `+' in the padded field width. Ditto for exponent() + + 4/16 + ---- +lib/sh/snprintf.c + - vsnprint_internal: only reduce precision by 1 when processing the `g' + format if it's > 0. A precision of 0 should stay 0; otherwise it + gets set to -1 (NOT_FOUND) and converted to the default + - number, lnumber: if an explicit precision is supplied, turn off the + zero-padding flag and set the pad character back to space + - number, lnumber: only account for a `+' when performing the field + width calculation if the coversion is base 10; we don't add a `+' + for other bases + + 4/18 + ---- +tests/printf3.sub + - try using "perl -e 'print time'" to get the current time in seconds + since the epoch if "date +%s" is not available (solaris 8-10) + + 4/19 + ---- +tests/run-printf + - use cat -v instead of relying on diff -a being available to convert + control characters to ascii and avoid the dreaded "Binary files + /tmp/xx and printf.right differ" + + 4/20 + ---- +lib/sh/strftime.c + - incoporated new version from Aharon Robbins + + 4/22 + ---- +doc/{bash.1,bashref.texi} + - slight change to the description of /dev/tcp and /dev/udp + +subst.c + - match_wpattern: logic fix to the calculation of `simple' (was |=, + needs to be &=). Bug report from Mike Frysinger , + fix from Andreas Schwab + +bashline.c + - bash_filename_stat_hook: add code from bash_directory_completion_hook + that performs pathname canonicalization in the same way that cd and + other builtins will do + + 4/25 + ---- +execute_cmd.c + - execute_pipeline: change the call to move_to_high_fd to make it use + getdtablesize() and to not stomp on existing open file descriptors, + like the fd the shell is using to read a script. Bug report from + Greg Wooledge + + 5/6 + --- +subst.c + - expand_word_internal: case '$': after calling param_expand and + setting had_quoted_null, set TEMP to null. The code that builds the + returned string at the end of the function will take care of making + and returning a quoted null string if there's nothing else in + ISTRING. If there is, the quoted null should just go away. Part of + fix for bug reported by Ruediger Kuhlmann + - expand_word_internal: when processing ISTRING to build return value, + only set W_HASQUOTEDNULL in the returned word flags if the word is + a quoted null string AND had_quoted_null is set. Rest of fix + + 5/9 + --- +variables.c + - bind_variable_internal: if we get an array variable here (implicit + assignment to index 0), call make_array_variable_value, which + dummies up a fake SHELL_VAR * from array[0]. This matters when + we're appending and have to use the current value + - bind_variable_internal: after computing the new value, treat assoc + variables with higher precedence than simple array variables; it + might be that a variable has both attributes set + +arrayfunc.c + - bind_array_var_internal: break code out that handles creating the + new value to be assigned to an array variable index into a new + function, make_array_variable_value. This handles creating a + dummy SHELL_VAR * for implicit array[0] assignment. Fixes bug + reported by Dan Douglas + +arrayfunc.h + - make_array_variable_value: new extern declaration + + 5/19 + ---- +variables.c + - bind_int_variable: if an assignment statement like x=y comes in + from the expression evaluator, and x is an array, handle it like + x[0]=y. Fixes bug reported by Dan Douglas + + 5/24 + ---- + +braces.c + - mkseq: handle possible overflow and break the sequence generating + loop if it occurs. Fixes OpenSUSE bug 763591: + https://bugzilla.novell.com/show_bug.cgi?id=763591 + + 5/25 + ---- +Makefile.in + - LDFLAGS_FOR_BUILD: add to compilation recipes for build tools + buildversion, mksignames, mksyntax + - LDFLAGS_FOR_BUILD: add to compilation recipes for test tools + recho, zecho, printenv, xcase + +builtins/Makefile.in + - LDFLAGS_FOR_BUILD: add to compilation recipes for build tools + gen-helpfiles, psize.aux + +variables.c + - bind_int_variable: if LHS is a simple variable name without an array + reference, but resolves to an array variable, call + bind_array_variable with index 0 to make x=1 equivalent to x[0]=1. + Fixes bug reported by Dan Douglas + + 5/27 + ---- +subst.c + - expand_word_internal: make sure has_dollar_at doesn't get reset before + recursive calls to param_expand or expand_word_internal, since it has + to save state of what came before. Use temp variable and make sure + has_dollar_at is incremented if recursive call processes "$@". + Fixes bug reported by gregrwm and + supplemented by Dan Douglas + +doc/{bash.1,bashref.texi} + - changes to the description of substring expansion inspired by + suggestions from Bill Gradwohl + +doc/bashref.texi + - added substring expansion examples inspired by suggestions from + Bill Gradwohl + +variables.c + - find_shell_variable: search for a variable in the list of shell + contexts, ignore the temporary environment + - find_variable_tempenv: search for a variable in the list of shell + contexts, force search of the temporary environment + - find_variable_notempenv: search for a variable in the list of shell + contexts, don't force search of the temporary environment + +variables.h + - find_shell_variable: extern declaration + - find_variable_tempenv: extern declaration + - find_variable_notempenv: extern declaration + +arrayfunc.c + - bind_array_variable: call find_shell_variable instead of calling + var_lookup directly + +findcmd.c + - search_for_command: call find_variable_tempenv instead of + find_variable_internal directly + - _find_user_command_internal: call find_variable_tempenv instead of + find_variable_internal directly + +builtins/setattr.def + - set_var_attribute: call find_variable_notempenv instead of + find_variable_internal directly + - show_name_attributes: call find_variable_tempenv instead of + find_variable_internal directly + + 6/1 + --- +sig.c + - termsig_handler: don't try to save the shell history on a terminating + signal any more, since it just causes too many problems on Linux + systems using glibc and glibc malloc + +lib/readline/vi_mode.c + - rl_vi_change_to: change to correctly redo `cc', since `c' is not a vi + motion character. From Red Hat bug 813289 + - rl_vi_delete_to: change to correctly redo `dd', since `d' is not a vi + motion character + - rl_vi_yank_to: change to correctly redo `yy', since `y' is not a vi + motion character + + 6/4 + --- +lib/sh/mktime.c + - current versions of VMS do not need to include . Fix from + John E. Malmberg + + 6/5 + --- +lib/sh/eaccess.c + - sh_stat: instead of using a static buffer to do the DEV_FD_PREFIX + translation, use a dynamically-allocated buffer that we keep + resizing. Fixes potential security hole reported by David Leverton + + + 6/5 + --- +braces.c + - expand_seqterm: check errno == ERANGE after calling strtoimax for + rhs and incr. Part of a set of fixes from Scott McMillan + + - expand_seqterm: incr now of type `intmax_t', which changes + arguments to mkseq + - mkseq: a better fix for detecting overflow and underflow since it's + undefined in C and compilers `optimize' out overflow checks. Uses + ADDOVERFLOW and SUBOVERFLOW macros + - mkseq: use sh_imaxabs (new macro) instead of abs() for intmax_t + variables + - mkseq: don't allow incr to be converted to -INTMAX_MIN + - mkseq: make sure that strvec_create isn't called with a size argument + greater than INT_MAX, since it only takes an int + + 6/6 + --- +braces.c + - mkseq: try and be smarter about not overallocating elements in + the return array if the increment is not 1 or -1 + + 6/7 + --- +parse.y + - history_delimiting_chars: if the parser says we're in the middle of + a compound assignment (PST_COMPASSIGN), just return a space to avoid + adding a stray semicolon to the history entry. Fixes bug reported + by "Davide Brini" + + 6/8 + --- +bashline.c + - bash_directory_completion_hook: don't attempt spelling correction + on the directory name unless the direxpand option is set and we are + going to replace the directory name with the corrected one in the + readline line. Suggested by Linda Walsh + +lib/sh/shquote.c + - sh_backslash_quote: now takes a third argument: flags. If non-zero, + tildes are not backslash-escaped. Have to handle both printf %q, + where they should be escaped, and filename completion, where they + should not when used as usernames + +externs.h + - sh_backslash_quote: declaration now takes a third argument + +builtins/printf.def + - printf_builtin: call sh_backslash_quote with 1 as third argument + so tildes get escaped + +{bashline,bracecomp}.c + - call sh_backslash_quote with 0 as third argument so tildes are not + escaped in completed words + +doc/bash.1 + - add `coproc' to the list of reserved words. From a report by + Jens Schweikhardt + + 6/10 + ---- +execute_cmd.c + - line_number_for_err_trap: now global, so parse_and_execute can save + and restore it with unwind-protect + +builtins/evalstring.c + - parse_prologue: save and restore line_number_for_err_trap along + with line_number + - restore_lastcom: new function, unwind-protect to restore + the_printed_command_except_trap + - parse_prologue: use restore_lastcom to save and restore the value + of the_printed_command_except_trap around calls to parse_and_execute + (eval/source/.) + + 6/15 + ---- +lib/readline/complete.c + - complete_fncmp: change filename comparison code to understand + multibyte characters, even when doing case-sensitive or case-mapping + comparisons. Fixes problem reported by Nikolay Shirokovskiy + + + 6/20 + ---- +builtins/mapfile.def + - mapfile: move the line count increment and check for having read + the specified number of lines to the end of the loop to avoid + reading an additional line with zgetline. Fixes bug reported by + Dan Douglas + + 6/21 + ---- + +execute_cmd.c + - execute_pipeline: make sure `lastpipe_flag' is initialized to 0 on + all systems, since it's tested later in the function. Fixes bug + reported by John E. Malmberg + + 6/22 + ---- +mailcheck.c + - file_mod_date_changed: return 0 right away if mailstat() does not + return success. Fixes bug with using uninitialized values reported + by szymon.kalasz@uj.edu.pl + +builtins/set.def + - the `monitor' option is not available when the shell is compiled + without job control, since the underlying `m' flag is not available + +nojobs.c + - job_control: now declared as int variable, initialized to 0, never + modified + +jobs.h + - job_control: extern declaration no longer dependent on JOB_CONTROL + +execute_cmd.c + - execute_pipeline: made necessary changes so `lastpipe' shell option + is now available in all shells, even those compiled without + JOB_CONTROL defined + + 6/23 + ---- +lib/glob/glob.c + - glob_filename: check for interrupts before returning if glob_vector + returns NULL or an error. Bug reported by Serge van den Boom + , fix from Andreas Schwab + - call run_pending_traps after each call to QUIT or test of + interrupt_state, like we do in mainline shell code + - glob_vector: don't call QUIT; in `if (lose)' code block; just free + memory, return NULL, and let callers deal with interrupt_state or + other signals and traps + + 6/25 + ---- +lib/readline/input.c + - rl_read_key: restructure the loop that calls the event hook a little, + so that the hook is called only after rl_gather_tyi returns no input, + and any pending input is returned first. This results in better + efficiency for processing pending input without calling the hook + on every input character as bash-4.1 did. From a report from + Max Horn + + 6/26 + ---- +trap.c + - signal_is_pending: return TRUE if SIG argument has been received and + a trap is waiting to execute + +trap.h + - signal_is_pending: extern declaration + +lib/glob/glob.c + - glob_vector: check for pending SIGINT trap each time through the loop, + just like we check for interrupt_state or terminating_signal, and + set `lose = 1' so we clean up after ourselves and interrupt the + operation before running the trap. This may require a change later, + maybe call run_pending_traps and do that if run_pending_traps returns? + +variables.c + - sv_histtimefmt: set history_comment_character to default (`#') if + it's 0 when we're turning on history timestamps. The history code + uses the history comment character to prefix timestamps, and + leaving it at 0 effectively removes them from the history. From a + report to help-bash by Dennis Williamson + + 6/27 + ---- +lib/readline/signals.c + - rl_maybe_restore_sighandler: new function, sets handler for SIG to + HANDLER->sa_handler only if it's not SIG_IGN. Needs to be called + on same signals set using rl_maybe_set_sighandler, which does not + override an existing SIG_IGN handler (SIGALRM is ok since it does + the check inline; doesn't mess with SIGWINCH) + + 6/30 + ---- +variables.h + - additional defines for the new `nameref' variable attribute + (att_nameref): nameref_p, nameref_cell, var_setref + +variables.c + - find_variable_nameref: resolve SHELL_VAR V through chain of namerefs + - find_variable_last_nameref: resolve variable NAME until last in a + chain of possibly more than one nameref starting at shell_variables + - find_global_variable_last_nameref: resolve variable NAME until last + in a chain of possibly more than one nameref starting at + global_variables + - find_nameref_at_context: resolve SHELL_VAR V through chain of namerefs + in a specific variable context (usually a local variable hash table) + - find_variable_nameref_context: resolve SHELL_VAR V through chain of + namerefs following a chain of varible contexts + - find_variable_last_nameref_context: resolve SHELL_VAR V as in + find_variable_last_context, but return the final nameref instead of + what the final nameref resolves to + - find_variable_tempenv, find_variable_notempenv, find_global_variable, + find_shell_variable, find_variable: modified to follow namerefs + - find_global_variable_noref: look up a global variable without following + any namerefs + - find_variable_noref: look up a shell variable without following any + namerefs + - bind_variable_internal: modify to follow a chain of namerefs in the + global variables table; change to handle assignments to a nameref by + following nameref chain + - bind_variable: modify to follow chain of namerefs when binding to a + local variable + - unbind_variable: changes to unset nameref variables (unsets both + nameref and variable it resolves to) + +subst.c + - parameter_brace_expand_word: change to handle expanding nameref whose + value is x[n] + - parameter_brace_expand_indir: change to expand in ksh93-compatible + way if variable to be indirected is nameref and a simple (non-array) + expansion + - param_expand: change to expand $foo where foo is a nameref whose value + is x[n] + +execute_cmd.c + - execute_for_command: changes to implement ksh93 semantics when index + variable is a nameref + +builtins/setattr.def + - show_var_attributes: change to add `n' to flags list if att_nameref + is set + +builtins/set.def + - unset_builtin: changes to error messages to follow nameref variables + +builtins/declare.def + - document new -n option + - declare_internal: new `-n' and `+n' options + - declare_internal: handle declare -n var[=value] and + declare +n var[=value] for existing and non-existant variables. + Enforce restriction that nameref variables cannot be arrays. + Implement semi-peculiar ksh93 semantics for typeset +n ref=value + + 7/5 + --- +variables.c + - unbind_variable: unset whatever a nameref resolves to, leaving the + nameref variable itself alone + - unbind_nameref: new function, unsets a nameref variable, not the + variable it references + +variables.h + - unbind_nameref: extern declaration + +builtins/set.def + - unset_builtin: modify to add -n option, which calls unbind_nameref + leaving unbind_variable for the usual case. This required slight + changes and additions to the test suite + +doc/{bash.1,bashref.texi} + - document namerefs and typeset/declare/local/unset -n + + 7/13 + ---- +lib/sh/casemod.c + - include shmbchar.h for is_basic and supporting pieces + - sh_casemod: use _to_wupper and _to_wlower to convert wide character + case instead of TOUPPER and TOLOWER. Fixes bug reported by + Dennis Williamson , fix from + Andreas Schwab + - cval: short-circuit and return ascii value if is_basic tests true + - sh_casemod: short-circuit and use non-multibyte case modification + and toggling code if is_basic tests true + +lib/readline/signals.c + - _rl_{block,release}_sigint: remove the code that actually blocks and + releases the signals, since we defer signal handling until calls to + RL_CHECK_SIGNALS() + +lib/readline/{callback,readline,util}.c + - if HAVE_POSIX_SIGSETJMP is defined, use sigsetjmp/siglongjmp without + saving and restoring the signal mask instead of setjmp/longjmp + +lib/readline/rltty.c + - prepare_terminal_settings: don't mess with IXOFF setting if + USE_XON_XOFF defined + +doc/{bash.1,bashref.texi} + - add some text to the description of set -e clarifying its effect + on shell functions and shell function execution. Suggested by + Rainer Blome + +bashline.c + - edit_and_execute_command: increment current_command_line_count before + adding partial line to command history (for command-oriented-history + because of rl_newline at beginning of function), then reset it to 0 + before adding the dummy history entry to make sure the dummy entry + doesn't get added to previous incomplete command. Partial fix for + problem reported by Peng Yu + + 7/24 + ---- +configure.in + - interix: define RECYCLES_PIDS. Based on a report from Michael + Haubenwallner + + 7/26 + ---- +jobs.c + - make_child: call bgp_delete on the newly-created pid unconditionally. + Some systems reuse pids before cycling through an entire set of + CHILD_MAX/_SC_CHILD_MAX unique pids. This is no longer dependent + on RECYCLES_PIDS. Based on a report from Michael Haubenwallner + + +support/shobj-conf + - Mac OS X: drop MACOSX_DEPLOYMENT_TARGET=10.3 from the LDFLAGS. We + can finally kill Panther + + 7/28 + ---- +subst.c + - command_substitute: make sure last_made_pid gets reset if make_child + fails + +execute_cmd.c + - execute_command_internal: case cm_simple: decide whether or not to + wait_for a child if already_making_children is non-zero, indicates + that there is an unwaited-for child. More of fix for bug report + from Michael Haubenwallner + +jobs.c + - make_child: call delete_old_job (new_pid) unconditionally, don't + bother to check whether or not pid wrap occurred. Rest of fix for + bug report from Michael Haubenwallner + + + 7/29 + ---- +shell.c + - subshell_exit: new function, exits the shell (via call to sh_exit()) + after calling any defined exit trap + +externs.h + - subshell_exit: new extern declaration + +execute_cmd.c + - execute_command_internal: make sure to call subshell_exit for + {} group commands executed asynchronously (&). Part of fix for + EXIT trap bug reported by Maarten Billemont + +sig.c + - reset_terminating_signals: make sure to set termsigs_initialized back + to 0, so a subsequent call to initialize_terminating_signals works + right. Rest of fix for bug reported by Maarten Billemont + + +{execute_cmd,general,jobs,mailcheck,mksyntax,test}.c +builtins/{cd,fc,pushd,ulimit}.def +lib/malloc/getpagesize.h +lib/sh/{clktck,fpurge,inet_aton,mailstat,oslib,pathcanon,pathphys,spell,strerror}.c + - make inclusion of dependent on HAVE_SYS_PARAM_H + consistently + + 8/6 + --- +lib/readline/histexpand.c + - history_expand_internal: now takes an additional argument saying + whether the history expansion occurs within a quoted string, set to + the open quote character + - history_expand_internal: use new argument instead of checking prev + char and initializing quoted_search_delimiter, pass qc directly to + get_history_event, where it allows a matching quote to terminate a + string defining an event + - history_expand: change single-quote handling code so that if + history_quotes_inhibit_expansion is 0, single quotes are treated + like double quotes + - history_expand: change call to history_expand_internal to pass new + argument of `"' if double-quoted string, `'' if single-quoted string; + this lets history_expand decide what is a quoted string and what + is not + + 8/7 + --- +configure.in + - AC_CANONICAL_BUILD: invoke for later use + +lib/readline/macro.c + - _rl_prev_macro_key: new function, inverse of _rl_next_macro_key: + backs up the index into the current macro by 1 + +lib/readline/rlprivate.h + - _rl_prev_macro_key: extern declaration + + +lib/readline/readline.c + - _rl_dispatch_subseq, _rl_subseq_result: don't call _rl_unget_char + if we're currently reading from a macro; call _rl_prev_macro_key + instead. Fixes bug reported by Clark Wang + + 8/13 + ---- +builtins/evalstring.c + - evalstring(): new function, wrapper around parse_and_execute. + make sure we handle cases where parse_and_execute can call `return' + and short-circuit without cleaning up properly. We call + parse_and_execute_cleanup() then jump to the previous-saved return + location + +builtins/common.h + - extern declaration for evalstring() + +builtins/eval.def + - eval_builtin: make sure we handle `eval " ... return"' in contexts + where `return' is valid by calling evalstring(). Fixes bug with + `eval return' in sourced files reported by Clark Wang + + +trap.c + - run_pending_traps: call evalstring instead of parse_and_execute. + XXX - still needs to handle saving and restoring token state in the + presence of `return'; could use unwind_protects for that + +builtins/mapfile.def + - run_callback: call evalstring instead of parse_and_execute + + 8/15 + ---- +bashline.c + - bash_filename_stat_hook: make sure we don't free local_dirname + before using it to canonicalize any expanded filename. Make sure + it always points to *dirname and only free it if we're replacing + it. + +lib/readline/complete.c + - append_to_match: make sure we call rl_filename_stat_hook with + newly-allocated memory to avoid problems with freeing it twice + + 8/17 + ---- +variables.c,config-top.h + - if ARRAY_EXPORT is defined to 1 when variables.c is compiled, the + code that allows indexed arrays to be exported is enabled and + included + + 8/19 + ---- +shell.c + - call start_debugger from main() only if dollar_vars[1] != 0 (close + enough to a non-interactive shell, since we can be interactive with + -i while running a shell script). Fixes oddity reported by + Techlive Zheng + + 8/20 + ---- +arrayfunc.c + - quote_array_assignment_chars: don't bother quoting if the word has + not been marked as an assignment (W_ASSIGNMENT) + - quote_array_assignment_chars: turn on W_NOGLOB in the word flags + so assignment statements don't undergo globbing. Partial fix for + problems reported by Dan Douglas + + 8/21 + ---- +command.h + - W_NOBRACE: new word flag that means to inhibit brace expansion + +subst.c + - brace_expand_word_list: suppress brace expansion for words with + W_NOBRACE flag + + 8/22 + ---- +builtins/read.def + - read_builtin: don't call dequote_string on what we've read, even if + we saw an escape character, unless (input_string && *input_string). + We may have escaped an IFS whitespace character. Fixes seg fault + reported by + +execute_cmd.c + - execute_command_internal: set the_printed_command_except trap when + about to execute a ( ... ) user subshell. For now, set it only if + ERR is trapped; can relax that later. Fixes bug reported by + Mike Frysinger + + 8/23 + ---- +jobs.c + - remove references to first_pid and pid_wrap, since we're not using + them for anything anymore + + 8/24 + ---- +subst.c + - changes for W_NOBRACE everywhere appropriate: so it can be displayed + for debugging, and passed out of expand_word_internal + +doc/{bash.1,bashref.texi} + - small changes to make it clearer that the = and == operators are + equivalent, and will cause pattern matching when used with [[. + From a question from Michal Soltys + +doc/bashref.texi + - some small formatting changes from Karl Berry + + 8/27 + ---- +lib/readline/doc/{history,rlman,rluserman}.texi + - some small formatting changes from Karl Berry + +arrayfunc.c + - assign_array_element_internal, assign_compound_array_list, + unbind_array_element, array_value_internal: changes to make + assignment statements to negative indices (a[-1]=2) and unsetting + array elements using negative indices (unset 'a[-1]') work. + From suggestions by Dennis Williamson + and Chris F. A. Johnson + +subst.c + - array_length_reference: changes to make length references to array + elements using negative indices (${#a[-1]}) work + + 8/28 + ---- +doc/{bash.1,bashref.texi} + - document new treatment of negative indices to indexed arrays when + assigning, referencing, calculating length, and unsetting + + 8/29 + ---- +shell.c + - show_shell_usage: add -l to list of shell invocation options (short + for --login). From Red Hat bug 852469 + +configure.ac + - renamed from configure.in, as latest autoconf versions want. Patches + Stefano Lattarini + +MANIFEST,Makefile.in,doc/bashref.texi,support/mkconffiles + - configure.in -> configure.ac + + 9/1 + --- + +parse.y + - read_token_word: allow words like {array[ind]} to be valid redirection + words for constructs like {x} + +lib/readline/display.c + - update_line: if the first difference between the old and new lines + is completely before any invisible characters in the prompt, we + should not adjust _rl_last_c_pos, since it's before any invisible + characters. Fixed in two places + - prompt_modechar: return a character indicating the editing mode: + emacs (@), vi command (:), or vi insert (+) + - _rl_reset_prompt: new function, just calls rl_expand_prompt. Will be + inlined, placeholder for more changes + - expand_prompt: if show-mode-in-prompt is enabled, add a character to + the front of the prompt indicating the editing mode, adjusting the + various variables as appropriate to keep track of the number of + visible characters and number of screen positions + +lib/readline/bind.c + - show-mode-in-prompt: new bindable boolean variable, shadowed by + _rl_show_mode_in_prompt variable + - hack_special_boolean_var: call _rl_reset_prompt when toggling or + setting show-mode-in-prompt + +lib/readline/readline.c + - readline_internal_setup: make sure the correct vi mode keymap is set + before expanding the prompt string for the first time + +lib/readline/misc.c + - rl_emacs_editing_mode: make sure to call _rl_reset_prompt if we're + showing the editing mode in the prompt + +lib/readline/rlprivate.h + - _rl_reset_prompt, _rl_show_mode_in_prompt: extern declarations + +lib/readline/vi_mode.c + - rl_vi_insertion_mode: call _rl_reset_prompt + - rl_vi_movement_mode: call _rl_reset_prompt. Finishes changes for + showing mode in prompt string, originally requested by Miroslav + Koskar and most recently by Jordan Michael + Ziegler + +doc/bash.1,lib/readline/doc/{readline.3,rluser.texi} + - document new show-mode-in-prompt variable, off by default + + 9/3 + --- + +jobs.c + - set_childmax: new function, external mechanism for other parts of + the shell to set js.c_childmax, the number of saved exited child + statuses to remember +jobs.h + - set_childmax: extern declaration + +variables.c + - CHILD_MAX: new special variable, with sv_childmax function to + run when it changes. Setting CHILD_MAX to a value greater than + zero but less than some maximum (currently 8192) sets the number of + exited child statuses to remember. set_childmax (jobs.c) ensures + that the number does not drop below the posix-mandated minimum + (CHILD_MAX) + +doc/{bash.1,bashref.texi} + - CHILD_MAX: document new meaning and action when variable is set + + 9/5 + --- +redir.c + - redir_varassign: call stupidly_hack_special_variables after + assigning fd number to specified variable, so we can use constructs + like {BASH_XTRACEFD}>foo. Suggested by Pierre Gaston + + + 9/8 + --- +expr.c + - readtok: invalidate previous contents of `curlval' before freeing + and reallocating tokstr (which, chances are, will get the same + pointer as before and render curlval inconsistent). Fixes other + bug reported by Dan Douglas + + 9/9 + --- +lib/readline/complete.c + - rl_username_completion_function: protect call to setpwent() with + #ifdef (HAVE_GETPWENT)/#endif. Fixes bug reported by + Gerd Hofmann + +lib/readline/display.c + - rl_message: second and subsequent calls to rl_message can result in + local_prompt being overwritten with new values (e.g., from the + successive calls displaying the incremental search string). Need + to free before overwriting if it's not the same as the value saved + in saved_local_prompt. Fixes memory leak reported by + Wouter Vermaelen + +lib/readline/{terminal.c,rlprivate.h} + - move CUSTOM_REDISPLAY_FUNC and CUSTOM_INPUT_FUNC defines from + terminal.c to rlprivate.h so other files can use them + +expr.c + - expr_streval: if noeval is non-zero, just return 0 right away, + short-circuiting evaluation completely. readtok will leave curtok + set correctly without re-entering the evaluator at all. Rest of + fix for bug reported by Dan Douglas + + 9/11 + ---- + +parse.y + - parse_comsub: make sure the `reserved word ok in this context' flag + is preserved after we read `do' followed by whitespace. Fixes bug + reported by Benoit Vaugon + + 9/13 + ---- +configure.ac,config.h.in + - enable-direxpand-default: new configure option, turns the `direxpand' + shell option on by default + +bashline.c + - dircomplete_expand, dircomplete_expand_relpath: initialize to 1 if + DIRCOMPLETE_EXPAND_DEFAULT is defined and non-zero + +doc/bashref.texi + - enable-direxpand-default: document new configure option + + 9/14 + ---- +shell.c + - --protected: make option valid only when wordexp is compiled into + the shell. Fix from Roman Rakus + +configure.ac + - HP NonStop (*-nsk*): compile --without-bash-malloc. Change from + Joachim Schmitz + + 9/16 + ---- +subst.c,execute_cmd.c,lib/glob/sm_loop.c,lib/sh/shquote.c + - minor code cleanups from Joachim Schmitz + +lib/readline/colors.h + - workaround for HP NonStop compiler issue with from + Joachim Schmitz + + 9/17 + ---- +builtins/printf.def + - printf_builtin: handle localtime returning NULL, as can happen when + encountering overflow. Bug report and initial fix from + Eduardo A. Bustamante López + +doc/{bash.1,bashref.texi} + - emphasize that brace expansion using character ranges ({a..c}) acts + as if the C locale were in use. Prompted by message from + Marcel Giannelia + + 9/20 + ---- +lib/sh/wcsnwidth.c + - wcsnwidth: new function, variant of wcwidth, returns the number of + wide characters from a string that will be displayed to not exceed + a specified max column position + + 9/21 + ---- +builtins/help.def + - show_builtin_command_help: break code that displays the short-doc + for each builtin in two columns into a new function: dispcolumn + - wdispcolumn: multibyte-char version of dispcolumn; uses wide + chars and printf "%ls" format. Fixes problem reported by + Nguyá»n Thái Ngá»c Duy + + 9/22 + ---- +execute_cmd.c + - execute_disk_command: before running the command-not-found hook, + call kill_current_pipeline() to make sure we don't add processes + to an existing pipeline or wait for processes erroneously + + 9/23 + ---- +lib/readline/input.c + - rl_input_available_hook: new hook function, called from + _rl_input_available (or _rl_input_queued) to return whether or not + input is available wherever the input source is + +lib/readline/doc/rltech.texi + - rl_input_available_hook: document + + 9/27 + ---- +lib/glob/sm_loop.c: + - GMATCH: after one or more `*', an instance of ?(x) can match zero or + 1 times (unlike ?, which has to match one character). The old code + failed if it didn't match at least once. Fixes `a*?(x)' bug. + - GMATCH: if we hit the end of the search string, but not the end of + the pattern, and the rest of the pattern is something that can + match the NUL at the end of the search string, we should successfully + match. Fixes `a*!(x)' bug reported by + + 10/2 + ---- +command.h + - add c_lock member to coproc structure for future use to tell who is + manipulating it + +execute_cmd.c + - execute_coproc: block SIGCHLD while parent is forking coproc + process and adding pid to sh_coproc struct to avoid race condition + where child is reaped before the pid is assigned and the coproc is + never marked as having died. Fixes race condition identified by + Davide Baldini + - add assignments to c_lock member of struct coproc in various + functions that manipulate it; was used to identify race condition + - coproc_pidchk: don't call coproc_dispose to avoid using malloc and + other functions in a signal handler context + - coproc_dispose: call BLOCK_SIGNAL/UNBLOCK_SIGNAL for SIGCHLD while + manipulating the sh_coproc struct + + 10/6 + ---- +lib/readline/complete.c + - rl_display_match_list: if printing completions horizontally, don't + bother with spacing calculations if limit == 1, which means we are + printing one completion per line no matter what. Fixes bug + reported by David Kaasen + + 10/7 + ---- +builtins/declare.def + - declare_internal: add error checking for nameref attribute and + variable assignments: self-references, attempts to make an array + variable a nameref + +subst.c + - parameter_brace_expand: handle parameter_brace_expand_word returning + &expand_param_fatal or &expand_param_error and return the appropriate + error value + - parameter_brace_expand_word: if a nameref variable's value is not a + valid identifier, return an error + - param_expand: if a nameref variable's value is not a valid identifier, + return an error + +test.c + - unary_operator: add new -R variable, returns true if variable is set + and has the nameref attribute. From ksh93 + +builtins/test.def + - add -R to description of conditional commands for help test + +doc/{bash.1,bashref.texi} + - document new -R unary conditional operator + + 10/13 + ----- +trap.c + - check_signals_and_traps: new function, convenience function for the + rest of the shell to check for pending terminating and interrupt + signals, and to check for and process any pending traps + - any_signals_trapped: new function, returns non-zero if any signals + are trapped and -1 if not + +trap.h + - extern declaration for check_signals_and_traps + +bashline.c + - bashline_reset: make sure we reset the event hook + - bash_event_hook: call check_signals_and_traps instead of just + checking for terminating signals so we can run pending traps and + react to interrupts, and reset the event hook when we're done + + + 10/14 + ----- +trap.c + - trap_handler: if executing in a readline signal handler context, + call bashline_set_event_hook to install bash_event_hook to process + the signal (if bash cares about it) + +sig.c + - sigint_sighandler: call bashline_set_event_hook to set the event + hook if we're executing in a readline signal handler context + +lib/readline/input.c + - rl_getc: call RL_CHECK_SIGNALS if read returns -1/EINTR and the caught + signal is SIGINT or SIGQUIT rather than waiting until the next time + around the loop + - rl_getc: call rl_event_hook after calling RL_CHECK_SIGNALS to allow + an application signal handler to set the event hook in its own + signal handler (e.g., like bash trap_handler or sigint_sighandler) + + +parse.y + - yy_readline_get: don't set interrupt_immediately before we call + readline(). Inspired by report from lanshun zhou + + +input.c + - getc_with_restart: add call to run_pending_traps after call to + CHECK_TERMSIG + +lib/sh/zread.c + - zread: call check_signals_and_traps if read() returns -1/EINTR + instead of just ignoring the EINTR and deferring handling any + signal that generated it + +builtins/mapfile.def + - mapfile: don't set interrupt_immediately before calling zgetline() + (which uses zread internally) + +builtins/read.def + - read_builtin: don't set interrupt_immediately before calling zread + (moved code around so that it was only being set right around calls + to zread to avoid signal handler conflicts). Inspired by report + from lanshun zhou + - edit_line: don't set interrupt_immediately around call to readline() + - include shmbutil.h + - read_builtin: don't call read_mbchar unless is_basic(c) returns + false for the character we just read + + 10/15 + ----- +sig.c + - throw_to_top_level: if interrupt_state is non-zero, make sure that + last_command_exit_value reflects 128+SIGINT if it's not already + greater than 128 + + 10/20 + ----- +builtins/wait.def + - WAIT_RETURN: set wait_signal_received back to 0 for the potential + next call to wait + +quit.h + - CHECK_WAIT_INTR: macro to check whether trap_handler handled a + signal and set wait_signal_received; longjmp to wait_intr_buf in + that case + +jobs.c + - wait_for, waitchld: call CHECK_WAIT_INTR at the same places we call + CHECK_TERMSIG to check for terminating signals + - wait_sigint_handler: don't longjmp out of the wait builtin unless + interrupt_immediately is set; otherwise just SIGRETURN from the + handler + - wait_sigint_handler: if interrupt_immediately not set, but we are + executing in the wait builtin and SIGINT is not trapped, treat it + as a `normally received' SIGINT: restore the signal handler and + send SIGINT to ourselves + - waitchld: when in posix mode and running SIGCHLD traps, don't longjmp + to wait_intr_buf (and let wait be interrupted) if we're running from + a signal handler. Wait for CHECK_WAIT_INTR to do the longjmp. + run_pending_traps will run the SIGCHLD trap later + +nojobs.c + - reap_zombie_children, wait_for_single_pid, wait_for: call + CHECK_WAIT_INTR where we call CHECK_TERMSIG + - wait_sigint_handler: don't longjmp out of the wait builtin unless + interrupt_immediately is set; otherwise just SIGRETURN from the + handler + +trap.c + - trap_handler: make sure wait_signal_received is set if the wait + builtin is executing, and only longjmp if interrupt_immediately is + set. This whole set of fixes was prompted by report from + lanshun zhou + + 10/24 + ----- +lib/glob/glob.c + - glob_filename: only check directory_name for globbing chars if + it's of non-zero length + +lib/sh/strchrnul.c + - new simpler implementation + +subst.c + - command_substitute: call set_shellopts after turning off errexit + in subshells so it's reflected in $SHELLOPTS + + 11/7 + ---- +builtins/evalstring.c + - parse_and_execute: treat ERREXIT case like reader_loop does: set + variable_context to 0 before longjmping back to top_level. Don't + run the unwind-protect context to avoid side effects from popping + function contexts. Part of fix for problem reported by Nikolai + Kondrashov + +execute_cmd.c + - execute_simple_command: call unlink_fifo_list only if this is the + last element of a pipeline (or not in a pipeline), rather than for + every child. Fixes difference in behavior between /dev/fd and + FIFOs reported by Zev Weiss + - execute_null_command: do the same thing in the parent branch after + make_child + + 11/14 + ----- +subst.c + - parameter_brace_expand: a variable is null if it's special ($@, $*), + the expansion occurs within double quotes, and the expansion turns + into a quoted null. Fixes debian bug 692447 reported by + Matrosov Dmitriy + +jobs.c + - run_sigchld_trap: make sure `running_trap' sentinel is set + appropriately + - waitchld: only run the sigchld trap if we're not in a signal + handler, not running a trap, and executing the wait builtin. + Otherwise, queue for later handling. We still run one instance + of the trap handler per exited child. Bulk of fix for bug + reported by Elliott Forney + +trap.c + - queue_sigchld_trap: set catch_flag so run_pending_traps notices, + and set trapped_signal_received for completeness. Rest of fix + for bug reported by Elliott Forney + +lib/malloc/malloc.c + - block_signals: renamed to _malloc_block_signals, made public + - unblock_signals: renamed to _malloc_unblock_signals, made public + +lib/malloc/imalloc.h + - extern declarations for _malloc_{un,}block_signals + +lib/malloc/table.c + - mregister_alloc, mregister_free: block signals around table + manipulation + + 11/15 + ----- +trap.c + - run_pending_traps: set SIG_INPROGRESS flag around calls to + run_sigchld_handler so other parts of the shell know that the + SIGCHLD trap handler is executing + - run_pending_traps: if we get a situation where we are looking at + running a SIGCHLD trap but the trap string is IMPOSSIBLE_TRAP_HANDLER + and the SIG_INPROGRESS flag is set, just skip it. This is possible + if run_pending_traps is called from a SIGCHLD trap handler run by + run_sigchld_trap + +doc/bash.1,lib/readline/doc/{rluser.texi,readline.3} + - corrected description of the effect of `set history-size 0'. Report + from Vesa-Matti J Kari + +include/stdc.h + - CPP_STRING: new define, replaces __STRING + +lib/malloc/{malloc.c,imalloc.h} + - replace __STRING with CPP_STRING + + 11/16 + ----- +lib/readline/bind.c + - sv_histsize: if argument evaluates to a value < 0, unstifle the + history + + 11/22 + ----- +redir.c + - do_redirection_internal: if we have REDIR_VARASSIGN set in the + redirection flags and we set up `redirector' using fcntl or dup2, + don't add a redirect to make sure it stays open. Let the + script programmer manage the file handle. Fixes bug reported by + Sam Liddicott + + 11/24 + ----- +jobs.c + - wait_for_any_job: new function, waits for an unspecified background + job to exit and returns its exit status. Returns -1 on no background + jobs or no children or other errors. Calls wait_for with new + sentinel value ANY_PID + - wait_for: changes to handle argument of ANY_PID: don't look up or + try to modify the child struct, only go through the wait loop once. + Return -1 if waitpid returns no children + +jobs.h + - ANY_PID: new define + +builtins/wait.def + - new option: -n. Means to wait for the next job and return its exit + status. Returns 127 if there are no background jobs (or no + children). Feature most recently requested by Elliott Forney + + +doc/{bash.1,bashref.texi} + - document new `wait -n' option + +execute_cmd.c + - execute_command_internal: save make_command_string () result in a + temp variable before calling savestring() on it; avoids evaluating + make_command_string() result twice. Fix from John E. Malmberg + + + 11/28 + ----- + +builtins/declare.def + - declare_internal: if an array variable is declared using `declare -a' + or `declare -A', but not assigned a value, set the `invisible' + attribute so the variable does not show up as set. Fix for bug + about variable initialization reported by Tim Friske + +builtins/{mapfile,read}.def + - after calling find_or_make_array_variable, make sure the invisible + flag is turned off, in case the variable was declared previously + using `declare -a' or `declare -A'. Side effect of above change to + declare_internal + +subst.c + - shell_expand_word_list: handle the W_ASSNGLOBAL flag and put -g into + the list of options passed to make_internal_declare as appropriate. + Fix for bug reported by Tim Friske + + 11/30 + ----- +test.c + - unary_op: make sure -v and -n check that the variable is not marked + as invisible before calling var_isset. Fix for bug reported by Tim + Friske + + 12/2 + ---- +subst.c + - process_substitute: turn off the `expanding_redir' flag, which + controls whether or not variables.c:find_variable_internal uses the + temporary environment to find variables. We want to use the + temp environment, since we don't have to worry about order of + evaluation in a subshell. Fixes bug reported by Andrey Borzenkov + + + 12/4 + ---- +lib/glob/glob.c + - glob_filename: changes to avoid null filenames and multiple entries + returned for patterns like **/** (globstar enabled). Fixes bug + reported by Ulf Magnusson + + 12/10 + ----- +lib/glob/glob.c + - glob_filename: finish up a series of changes to make globstar-style + globbing more efficient, avoid more duplicate filenames, and be more + compatible with other shells that implement it + o collapse a sequence of **/**/** to one ** + o note when the directory name is all ** or ends in ** so we + can treat it specially when the filename is ** + All inspired by report from Andrey Borzenkov + +lib/sh/zread.c + - zreadn: new function, like zread, but takes an additional argument + saying how many bytes to read into the local buffer. Can be used to + implement `read -N' without so many one-byte calls to zreadc. Code + from Mike Frysinger + + 12/12 + ----- +lib/glob/sm_loop.c + - PATSCAN (glob_patscan): if passed string already points to end of + pattern, return NULL immediately. Fixes problem with + extglob_skipname reported by Raphaël Droz + + 12/13 + ----- +execute_cmd.c + - execute_coproc: handle the command's exit status being inverted + (an oversight). Fixes bug reported by DJ Mills + and Andreas Schwab + + 12/14 + ----- +lib/readline/readline.c + - bind_arrow_keys_internal: add MINGW key bindings for Home, End, + Delete, and Insert keys. Fix from Pierre Muller + + +builtins/printf.def + - printf_builtin: '%()T' conversion: if there is no argument supplied, + behave as if -1 had been supplied (current time). ksh93-like feature + suggested by Clark Wang + +doc/{bash.1,bashref.texi} + - document new printf %()T default argument behavior + + 12/15 + ----- +lib/readline/display.c + - displaying_prompt_first_line: new variable, indicates whether or + not the first line of output is displaying the prompt. Always true + in normal mode, sometimes false in horizontal scrolling mode + - rl_redisplay: set displaying_prompt_first_line to true unless we + are in horizontal mode; set to false in horizontal mode if the left + margin of the displayed line is greater than the end of the prompt + string + - rl_redisplay: when in horizontal scroll mode, don't adjust + _rl_last_c_pos by the wrap offset unless the line is displaying + a prompt containing invisible chars + - update line: don't adjust _rl_last_c_pos by the wrap offset unless + the line is displaying a prompt containing invisible chars + - update_line: if shrinking the line by reducing the number of + displayed characters, but we have already moved the cursor to the + beginning of the line where the first difference starts, don't + try to delete characters + +builtins/read.def + - unbuffered_read: set to 2 if invoked as `read -N' + - if unbuffered_read is set to 2, compute the number of chars we + need to read and read that many with zreadn. Posix mode still + uses zreadintr. Code from Mike Frysinger + +doc/{bash.1,bashref.texi} + - read: make it clear that if read times out, it saves any input + read to that point into the variable arguments. Report from + Fiedler Roman + +subst.c + - command_substitute: change direct assignment of exit_immediately_on_error + to use change_flag ('e', FLAG_OFF) instead + +flags.c + - use errexit_flag as the variable modified by changes to the -e + option, reflect those changes to exit_immediately_on_error + +execute_cmd.c + - execute_builtin: new global variable, builtin_ignoring_errexit, set + to 0 by default and set to 1 if eval/source/command executing in a + context where -e should be ignored + - execute_builtin: set exit_immediately_on_error to errextit_flag + after executing eval/source/command in a context where -e should + be ignored + +flags.c + - if builtin_ignoring_errexit is set, changes to errexit_flag are + not reflected in the setting of exit_immediately_on_error. Fixes + bug reported by Robert Schiele + + 12/23 + ----- +include/posixjmp.h + - setjmp_nosigs: new define, call setjmp in such a way that it will + not manipulate the signal mask + +{expr,test,trap}.c + - setjmp_nosigs: call instead of setjmp; don't need to manipulate + signal mask + +builtins/read.def + - read_builtin: setjmp_nosigs: call instead of setjmp; don't need + to manipulate signal mask + +builtins/evalstring.c: + - parse_and_execute: setjmp_nosigs: call instead of setjmp; don't need + to manipulate signal mask + - parse_string: setjmp_nosigs: call instead of setjmp; don't need + to manipulate signal mask + - parse_and_execute: save and restore the signal mask if we get a + longjmp that doesn't cause us to return or exit (case DISCARD) + + 12/24 + ----- +general.c + - bash_tilde_expand: only set interrupt_immediately if there are no + signals trapped; we want to jump to top level if interrupted but + not run any trap commands + + 12/25 + ----- +jobs.c + - run_sigchld_trap: no longer set interrupt_immediately before calling + parse_and_execute, even if this is no longer run in a signal handler + context + +input.c + - getc_with_restart: add call to QUIT instead of CHECK_TERMSIG + +parse.y + - yy_stream_get: now that getc_with_restart calls QUIT, don't need to + set interrupt_immediately (already had call to run_pending_traps) + +execute_cmd.c + - execute_subshell_builtin_or_function,execute_function,execute_in_subshell: + setjmp_nosigs: call instead of setjmp when saving return_catch; don't + need to manipulate signal mask + - execute_subshell_builtin_or_function,execute_in_subshell: + setjmp_nosigs: call instead of setjmp where appropriate when saving + top_level; don't need to manipulate signal mask if we're going to + exit right away + +subst.c + - command_substitute: setjmp_nosigs: call instead of setjmp when saving + return_catch; don't need to manipulate signal mask + - command_substitute: setjmp_nosigs: call instead of setjmp where + appropriate when saving top_level; don't need to manipulate signal + mask if we're going to exit right away + +trap.c + - run_exit_trap: setjmp_nosigs: call instead of setjmp when saving + return_catch; don't need to manipulate signal mask + - run_exit_trap: setjmp_nosigs: call instead of setjmp where + appropriate when saving top_level; don't need to manipulate signal + mask if we're going to exit right away + - _run_trap_internal: setjmp_nosigs: call instead of setjmp when saving + return_catch; don't need to manipulate signal mask + +builtins/evalfile.c + - _evalfile: setjmp_nosigs: call instead of setjmp when saving + return_catch; don't need to manipulate signal mask + +builtins/evalstring.c + - evalstring: setjmp_nosigs: call instead of setjmp when saving + return_catch; don't need to manipulate signal mask + +shell.c + - main: setjmp_nosigs: call instead of setjmp where appropriate when + saving top_level; don't need to manipulate signal mask if we're + going to exit right away + - run_one_command: setjmp_nosigs: call instead of setjmp where + appropriate when saving top_level; don't need to manipulate signal + mask if we're going to exit right away + - run_wordexp: setjmp_nosigs: call instead of setjmp where + appropriate when saving top_level; don't need to manipulate signal + mask if we're going to exit right away + +eval.c + - reader_loop: save and restore the signal mask if we get a longjmp + that doesn't cause us to return or exit (case DISCARD) + + 12/26 + ----- +parse.y + - shell_input_line_{index,size,len}: now of type size_t; in some cases + the unsigned property makes a difference + - STRING_SAVER: saved_line_{size,index} now of type size_t + - shell_getc: don't allow shell_input_line to grow larger than SIZE_MAX; + lines longer than that are truncated until read sees a newline; + addresses theoretical buffer overflow described by Paul Eggert + + - set_line_mbstate: size_t changes like shell_getc + - shell_getc: if shell_input_line is larger than 32K, free it and + start over to avoid large memory allocations sticking around + +variables.c + - bind_global_variable: new function, binds value to a variable in + the global shell_variables table + +variables.h + - bind_global_variable: new extern declaration + +builtins/declare.def + - declare_internal: if -g given with name=value, but variable is not + found in the global variable table, make sure to call + bind_global_variable so the variable is created and modified at + global scope. Fixes a bug where declare -g x=y could modify `x' + at a previous function scope + +command.h + - W_ASSIGNARRAY: new word flag, compound indexed array assignment + +subst.h + - ASS_MKGLOBAL: new assignment flag, forcing global assignment even in + a function context, used by declare -g + +execute_cmd.c + - fix_assignment_words: set W_ASSIGNARRAY flag if -a option given to + declaration builtin + +subst.c + - do_assignment_internal: explicitly handle case where we are + executing in a function and we want to create a global array or + assoc variable + - shell_expand_word_list: call make_internal_declare if -a option + given to declaration builtin (W_ASSIGNARRAY); handle -g option with + it (W_ASSNGLOBAL). Fixes inconsistency noticed by Vicente Couce + Diaz , where declare -ag foo=(bar) could modify + array variable foo at previous function scope, not global scope + + 12/27 + ----- +bashline.c + - Minix needs the third argument to tputs to be a void funtion taking + an int argument, not an int-returning function. Fix from + John E. Malmberg as part of VMS bash port + + 12/29 + ----- +configure.ac,version.c,patchlevel.h + - bash-4.3-devel: new version, new shell compatibility level (43) + +subst.c + - parameter_brace_patsub: put the bash-4.2 code back in from the + change of 3/3 that runs the replacement string through quote + removal, make it dependent on shell_compatibility_level <= 42 + +builtins/shopt.def + - compat42: new shopt option + - set_compatibility_level: change logic to set and unset various + compat variables and shell_compatibility_level + +COMPAT + - new documentation for bash-4.3 compatibility changes + +doc/{bash.1,bashref.texi} + - compat42: document new shopt option + +builtins/shopt.def + - set_compatibility_opts: new function, sets the various shopt + compat variables based on the value of shell_compatibility_level + +builtins/common.h + - set_compatibility_opts: new extern declaration + +variables.c + - BASH_COMPAT: new special variable; sets the shell compatibility + level. Accepts values in decimal (4.2) or integer (42) form; + Unsetting variable, setting it to empty string, or setting it to + out-of-range value sets the shell's compatibility level to the + default for the current version. Valid values are 3.1/31 through + the current version + - sv_shcompat: new function implementing logic for BASH_COMPAT + +variables.h + - sv_shcompat: new extern declaration + +doc/{bash.1,bashref.texi} + - BASH_COMPAT: description of new variable + +lib/readline/complete.c + - _rl_colored_stats: default back to 0 for 4.3 release branch + + 1/5/2013 + -------- +quit.h + - remove spurious call to itrace in CHECK_WAIT_INTR + +bashline.c + - bash_event_hook: if we're going to jump to top_level, make sure we + clean up after readline() by calling rl_cleanup_after_signal(). + Fixes bug reported against devel branch by Raphaël Droz + + - bash_event_hook: reset the event hook before checking for signals + or traps in case we longjmp + +doc/{bash.1,bashref.texi} + - small additions to the set -e section to make it more clear that + contexts where -e is ignored extend to compound commands as well + as shell functions + +lib/readline/readline.h + - rl_signal_event_hook: new extern declaration + +lib/readline/input.c + - rl_signal_event_hook: new variable, hook function to call when a + function (currently just read(2)) is interrupted by a signal and + not restarted + - rl_getc: call rl_signal_event_hook instead of rl_event_hook + +lib/readline/doc/rltech.texi + - rl_signal_event_hook: document new function + +bashline.c + - changes to set rl_signal_event_hook instead of rl_event_hook + +lib/readline/readline.h + - change readline version numbers to 6.3 + + 1/6 + --- +doc/{bash.1,bashref.texi} + - a couple of changes to the descriptions of the ERR trap and its + effects based on a message from Rob Nagler + + 1/9 + --- +expr.c + - expassign: invalidate curlval before freeing and NULLing tokstr to + avoid aliasing issues. Fixes bug reported by Eduardo A. Bustamante + López and Dan Douglas + +braces.c + - array_concat: don't be so aggressive in trying to short-circuit. We + can only short-circuit if we have a single-element array where the + element is an empty string (array[0] == "" array[1] = 0x0). Existing + practice requires us to replicate arrays and prefix or append empty + strings. Fixes bug reported by Eduardo A. Bustamante López + + + 1/11 + ---- +execute_cmd.c + - execute_builtin: since mapfile uses evalstring() to run its callbacks + internally, just like eval, so it needs to handle the case where the + temp environment given to mapfile persists throughout the entire + set of callback commands. This might be a problem with trap also, but + trap isn't run in the same way. Fixes bug reported by Dan Douglas + + + 1/13 + ---- +redir.c + - redirection_error: before expanding the redirection word (if + expandable_redirection_filename returns true), disable command + substitution during expansion. Fixes bug reported by Dan Douglas + + +subst.c + - expand_word_internal: case '\\': if the next character is an IFS + character, and the expansion occurs within double quotes, and the + character is not one for which backslash retains its meaning, add + the (escaped) '\' and the (escaped) character. Fixes bug reported + by Dan Douglas + + 1/15 + ---- +builtins/cd.def + - cd_builtin: make sure call to internal_getopt handles -e option. + Fixes bug reported by + + 1/17 + ---- +subst.c + - expand_word_list_internal: make sure tempenv_assign_error is + initialized to 0 + +execute_cmd.c + - execute_simple_command: make sure tempenv_assign_error is reset to 0 + after it's tested to see if an error should force the shell to exit. + Fixes problem where a the failure of a tempenv assignment preceding + a non-special builtin `sticks' and causes the next special builtin + to exit the shell. From a discussion on bug-bash started by + douxin + + 1/20 + ---- +subst.c + - parameter_brace_expand_rhs: call stupidly_hack_special_variables + after assigning with ${param[:]=word} even if IFS is changing. + Suggested by Dan Douglas [TENTATIVE, needs work + on IFS side effects] + +command.h + - W_GLOBEXP (which was unused) is now W_SPLITSPACE (which isn't used + yet) + +{execute_cmd,subst,variables}.c + - removed all code that mentioned W_GLOBEXP + - removed mention of gnu_argv_flags and code that set it + + 1/22 + ---- +subst.c + - param_expand: set W_SPLITSPACE if we expand (unquoted) $* and + IFS is unset or null so we can be sure to split this on spaces + no matter what happens with IFS later + - expand_word_internal: note that param_expand returns W_SPLITSPACE + in the returned word flags and keep track of that state with + `split_on_spaces' + + 1/23 + ---- +subst.c + - expand_word_internal: if split_on_spaces is non-zero, make sure + we split `istring' on spaces and return the resultant word. The + previous expansions should have quoted spaces in the positional + parameters where necessary. Suggested by Dan Douglas + + +execute_cmd.c + - execute_command_internal: make sure any subshell forked to run a + group command or user subshell at the end of a pipeline runs any + EXIT trap it sets. Fixes debian bash bug 698411 + http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=698411 + +subst.c + - shell_expand_word_list: fix code that creates args for and calls + make_internal_declare to avoid calling it twice (missing `else' + in 12/26 change) + - do_assignment_internal: fix code from 12/26 change to fix problem + where an existing assoc variable could be converted to an array + without checking `mkassoc' + + 1/24 + ---- +builtins/evalfile.c + - _evalfile: add missing `close (fd)' calls before returning to + avoid fd leaks. Bug and fix from Roman Rakus + + 1/25 + ---- +builtins/read.def + - read_builtin: don't try to play tricks with the top of the unwind- + protect stack after read gets a SIGALRM; save input_string to new + memory, run the stack, then restore input_string and assign the + variables. Part of fix for bug reported by konsolebox + ; the rest of the fix is with the changes in + trap and signal handling and doing away with interrupt_immediately + + 1/26 + ---- +redir.c + - redirection_expand, write_here_string, write_here_document: before + calling any of the word expansion functions, after setting + expanding_redir to 1 (which bypasses the temp environment in the + variable lookup functions), call sv_ifs to reset the cached IFS- + related variables set by subst.c:setifs(). This ensures that + redirections will not get any IFS values that are set in the + temporary environment, as Posix specifies. Then, after the word + expansions, after resetting expanding_redir to 0, call sv_ifs + again to make sure the cached IFS values are set from any + assignments in the temporary environment. We force executing_builtin + to 1 to `fool' the variable lookup functions into using any temp + environment, then reset it to its old value after sv_ifs returns. + This is what allows read() to use the (cached) IFS variables set + in the temp environment. Fixes inconsistency reported by Dan Douglas + + + 1/29 + ---- +lib/readline/display.c + - update_line: fix off-by-one error when updating vis_lbreaks array + in a multibyte locale that occurs when moving multibyte chars from + one line down to another. Bug report and fix from Egmont + Koblinger + + 1/30 + ---- +configure.ac + - changed version to 4.3-alpha + +redir.c + - redir_open: handle open returning -1/EINTR, which seems to happen + a lot with FIFOs and SIGCHLD, and call QUIT to handle other + signals that can interrupt open(2). Bug report and initial fix + from Mike Frysinger + + 1/31 + ---- +subst.c + - parameter_brace_expand: make sure to propagate the PF_ASSIGNRHS flag + to parameter_brace_expand_word + - parameter_brace_expand_word: make sure that if the PF_ASSIGNRHS flag + is set and we are expanding ${a[@]} or ${a[*]} we set quoted to + include Q_DOUBLE_QUOTES before calling array_value_internal, mirroring + what we do for $@ and $*. Fixes inconsistency reported by Dan + Douglas + +configure.ac + - use AC_CHECK_TOOL instead of AC_CHECK_PROG to check for ar, since it + will find $host-prefixed versions of utilities. Report and fix from + Mike Frysinger + +builtins/setattr.def + - set_var_attribute: check whether bind_variable (called when the + variable whose attributes are being modified is found in the temp + environment) just modified a read-only global variable, and don't + bother marking the temporary variable for propagation if so. The + propagation is superfluous and will result in a strange error + message + + 2/2 + --- +variables.c + - initialize_shell_variables: don't try to import function definitions + with invalid names from the environment if already in posix mode, + but create them as (invisible) exported variables so they pass + through the environment. Print an error message so user knows + what's wrong. Fixes bug reported by Tomas Trnka + + 2/9 + --- + +builtins/read.def + - sigalrm_seen, alrmbuf: now global so the rest of the shell (trap.c) + can use them + - sigalrm: just sets flag, no longer longjmps to alrmbuf; problem was + longjmp without manipulating signal mask, leaving SIGALRM blocked + +quit.h + - move CHECK_ALRM macro here from builtins/read.def so trap.c: + check_signals() can call it + +trap.c + - check_signals: add call to CHECK_ALRM before QUIT + - check_signals_and_traps: call check_signals() instead of including + CHECK_ALRM and QUIT inline. Integrating check for read builtin's + SIGALRM (where zread call to check_signals_and_traps can see it) + fixes problem reported by Mike Frysinger + + 2/12 + ---- +lib/glob/xmbsrtowcs.c + - xdupmbstowcs2: fixed but where end of string was not handled + correctly, causing loop to go past end of string in a bunch of cases. + Fixes bug reported by "Dashing" + + + 2/13 + ---- +builtins/pushd.def + - popd_builtin: treat any argument that isn't -n or of the form + [-+][[:digit:]]* as an error. Fixes problem reported by Bruce + Korb + + 2/14 + ---- +configure.ac + - add check for sig_atomic_t; already a placeholder for it in + config.h.in + + 2/15 + ---- +subst.c + - do_compound_assignment: don't call assign_compound_array_list with + a NULL variable in case make_local_xxx_variable returns NULL + (it will if you try to shadow a readonly or noassign variable). + Fixes bug reported by Richard Tollerton + + 2/16 + ---- +variables.c + - make_local_variable: print error messager if an attempt is made to + create a local variable shadowing a `noassign' variable. Previously + we just silently refused to do it + +trap.[ch] + - get_original_signal: now global so rest of the shell can use it + +sig.c + - initialize_shell_signals: install a signal handler for SIGTERM + that does nothing except set a sigterm_received flag instead of + ignoring it with SIG_IGN, as long as SIGTERM is not ignored when + the shell is started. Use get_original_signal early to get the + original handler, since we will do that later anyway + - set_signal_handler: if installing sigterm_sighandler as the SIGTERM + handler, make sure to add SA_RESTART flag to make it as close to + SIG_IGN as possible + +sig.h + - sigterm_sighandler: new extern declaration + +quit.h + - RESET_SIGTERM: set sigterm_receved to 0 + - CHECK_SIGTERM: check sigterm_received; if it's non-zero, treat it + as a fatal signal and call termsig_handler to exit the shell + +jobs.c + - make_child: call RESET_SIGTERM just before fork() so we can detect + if the child process received a SIGTERM before it's able to change + the signal handler back to what it was when the shell started + (presumably SIG_DFL). Only has effect if the shell installed + sigterm_sighandler for SIGTERM, interactive shells that were not + started with SIG_IGN as the SIGTERM handler + - make_child: call RESET_SIGTERM in the parent after fork() so the + rest of the shell won't react to it + +execute_cmd.c + - execute_simple_command: call CHECK_SIGTERM after make_child in child + to catch SIGTERM received after fork() and before restoring old + signal handlers + - execute_disk_command: call CHECK_SIGTERM after make_child in child + process after restoring old signal handlers and again just before + calling shell_execve. Fixes race condition observed by + Padraig Brady when testing with his `timeout' + program + +lib/readline/display.c + - open_some_spaces: new function, subset of insert_some_chars that just + opens up a specified number of spaces to be overwritten + - insert_some_spaces: now just calls to open_some_spaces followed by + _rl_output_some_chars + - update_line: use col_temp instead of recalculating it using + _rl_col_width in the case where we use more columns with fewer bytes + - update_line: use open_some_spaces and then output the right number + of chars instead of trying to print new characters then overwrite + existing characters in two separate calls. This includes removing + some dodgy code and making things simpler. Fix from Egmont + Koblinger + - use new variable `bytes_to_insert' instead of overloading temp in + some code blocks (nls - nfd, bytes that comprise the characters + different in the new line from the old) + + 2/18 + ---- +redir.c + - do_redirection_internal: add undoable redirection for the implicit + close performed by the <&n- and >&n- redirections. Fixes bug + reported by Stephane Chazelas + + 2/19 + ---- +sig.c + - termsig_handler: an interactive shell killed by SIGHUP and keeping + command history will try to save the shell history before exiting. + This is an attempt to preserve the save-history-when-the-terminal- + window-is-closed behavior + + 2/21 + ---- +braces.c + - brace_expand: if a sequence expansion fails (e.g. because the + integers overflow), treat that expansion as a simple string, including + the braces, and try to process any remainder of the string. The + remainder may include brace expansions. Derived from SuSE bug + 804551 example (https://bugzilla.novell.com/show_bug.cgi?id=804551) + + 2/23 + ---- +{quit,sig}.h,sig.c + - sigterm_received declaration now in sig.h; type is sig_atomic_t + - sigwinch_received type now sig_atomic_t + - sig.h includes bashtypes.h and if SIG_DFL not defined + (same logic as trap.h) to pick up sig_atomic_t + +unwind_prot.c + - include sig.h before quit.h (reverse order) + + 2/27 + ---- +builtins/shopt.def + - reset_shopt_options: make sure check_window_size is reset to the + default from config.h, not unconditionally to 0 + +jobs.[ch] + - last_made_pid, last_asynchronous_pid: now volatile. Change from SuSE + +jobs.c + - wait_for: if we're using sigaction to install a handler for SIGCHLD, + make sure we specify SA_RESTART + +lib/{tilde,readline}/shell.c + - get_home_dir: instead of looking in the password file every time, + look once and cache the result + +sig.[ch] + - sigwinch_received, sigterm_received: now `volatile' qualified + +sig.c,quit.h + - interrupt_state,terminating_signal: now sig_atomic_t + + 3/1 + --- +MANIFEST,examples/* + - removed around 120 files without FSF copyrights; requested by + Karl Berry in early January + + 3/2 + --- +lib/malloc/malloc.c + - morecore: only check whether SIGCHLD is trapped if SIGCHLD is defined + +doc/bashref.texi + - Fixed most of the examples in the GNU Parallel section to use better + shell idioms following complaints on bug-bash; added a couple of + examples and smoothed out the text + +quit.h + - include "sig.h" for sig_atomic_t + +lib/readline/display.c + - update_line: when inserting one or more characters at the end of + the display line in a non-multibyte environment, just write from the + first difference to the end of the line and return. We don't have + to adjust _rl_last_c_pos. This is needed to adjust from the old + two-part copy to a single call to _rl_output_some_chars (change of + 2/16) + + 3/4 + --- +Makefile.in,doc/Makefile.in + - PACKAGE_TARNAME, docdir: new variables substituted by autoconf + - OTHER_DOCS,OTHER_INSTALLED_DOCS: new variables with auxiliary + documentation files to be installed into $(docdir) + - install: add new rule to install $(OTHER_DOCS) + - uninstall: add new rule to uninstall $(docdir)/$(OTHER_INSTALLED_DOCS) + +doc/bash.1 + - add URL to `POSIX' file in `SEE ALSO' section; put pointer to that + section in --posix and set -o posix descriptions + +examples/ + - removed around 110 examples at the request of the FSF due to copyright + issues + + 3/5 + --- +builtins/setattr.def + - readonly: modified help text slightly to make it clearer that + functions aren't changed or displayed unless the -f option is given. + Report from + + 3/9 + --- +include/typemax.h + - SIZE_MAX: define to 65535 (Posix minimum maximum) if not defined + +parse.y + - include "typemax.h" for possible SIZE_MAX definition, make sure we + include it after shell.h + +{braces,expr}.c + - include "typemax.h" for possible INTMAX_MIN and INTMAX_MAX definitions + + 3/10 + ---- +bashline.c + - bash_default_completion: make sure completion type of `!' (same as + TAB but with show-all-if-ambiguous set) and glob-word-completion + sets rl_filename_completion_desired to 0 so extra backslashes don't + get inserted by `quoting' the completion. We can't kill all the + matches because show-all-if-ambiguous needs them. Bug report from + Marcel (Felix) Giannelia + +[bash-4.3-alpha frozen] + + 3/14 + ---- +general.c + - trim_pathname: use memmove instead of memcpy since the source and + destination pathnames may overlap. Report and fix from Matthew + Riley + + 3/18 + ---- +configure.ac + - socklen_t is defined as `unsigned int' if configure can't find it + + 3/20 + ---- +lib/readline/complete.c + - S_ISVTX: since it's not defined on all platforms (Minix), make sure + its use is protected with #ifdef + + 3/21 + ---- +doc/{bash.1,bashref.texi} + - Added mention of ${!name[@]} and ${!name[*]} expansions to get all + indices of an array. Suggested by Jonathan Leffler + + + 3/24 + ---- +subst.h + - SD_IGNOREQUOTE: new define for skip_to_delim; if set, means that + single quotes (for now) will be treated as ordinary characters + +subst.c + - skip_to_delim: handle SD_IGNOREQUOTE. no callers use it for now + + 3/25 + ---- +support/config.{guess,sub} + - updated to versions from autoconf-2.69 + + 3/31 + ---- +lib/sh/shquote.c + - sh_single_quote: short-circuit quoting a single "'" instead of + creating a long string with empty single-quoted strings + +parser.h + - DOLBRACE_QUOTE2: new define, like DOLBRACE_QUOTE, but need to single- + quote results of $'...' expansion because quote removal will be + done later. Right now this is only done for ${word/pat/rep} + +parse.y + - parse_matched_pair: set state to DOLBRACE_QUOTE2 for pattern + substitution word expansion so we don't treat single quote specially + in the pattern or replacement string + - parse_matched_pair: if we're parsing a dollar-brace word expansion + (${...}) and we're not treating single quote specially within + double quotes, single-quote the translation of $'...' ansi-c + escaped strings. Original report and fix from Eduardo A. + Bustamante López + +subst.c + - extract_dollar_brace_string: ${word/pat/rep} scanning now sets the + DOLBRACE_QUOTE2 flag instead of DOLBRACE_QUOTE so we don't treat + single quotes specially within a double-quoted string + +execute_cmd.c + - fix_assignment_words: skip over assignment statements preceding a + command word before trying to figure out whether or not assignment + statements following a possible declaration command should be + treated specially. Fixes bug reported by Dan Douglas + + + 4/4 + --- +lib/readline/readline.c + - _rl_dispatch_subseq: only call _rl_vi_set_last (and check whether + the key is a text modification command) if the key sequence length + is 1. That keeps the arrow keys from setting the last command + when called in vi command mode. Fixes bug reported by Ian A. + Watson + + 4/6 + --- +lib/readline/bind.c + - rl_parse_and_bind: when parsing a double-quoted string as the value + of a variable, make sure we skip past the leading double quote. + Fix from Andreas Schwab + +variables.c + - hash_lookup: set new local variable last_table_searched to the table + a successful lookup appears in; tested in make_local_variable to + solve the problem below + - make_local_variable: if we find a variable with the tempenv flag + set at the same `level' as variable_context', but not found in the + temporary_env (temp environment preceding the builtin), return it. + The temp environment preceding the function call has already been + merged (in execute_function) into the list of variable contexts the + function sees as shell_variables by the time this is called. Fixes + inconsistency pointed out by Dan Douglas + +subst.c + - expand_arith_string: expanded out contents of expand_string, + expand_string_internal, expand_string_if_necessary to create a + WORD_DESC and call call_expand_word_internal() on it directly. + We don't want process substitution to be performed ( 1<(2) ) should + mean something different in an arithmetic expression context. + It doesn't work to just turn on the DQUOTE flag, since that means + that things like ${x["expression"]} are not expanded correctly. + Fixes problem pointed out by Dan Douglas + + 4/13 + ---- +subst.c + - process_substitute: run the EXIT trap before exiting, as other + shells seem to. Fixes problem pointed out by Dan Douglas + + +lib/readline/readline.c + - readline_internal_setup: call rl_vi_insertion_mode to enter vi + mode instead of rl_vi_insert_mode to avoid resetting the saved last + command information. Posix says that `.' can repeat a command + that was entered on a previous line so we need to save the info. + Fixes bug reported by Ian A. Watson + + 4/14 + ---- +lib/readline/complete.c + - rl_completion_matches: make sure xrealloc returns something non-null + (can happen when interrupted by a signal) before trying to add + matches to match_list + +subst.c + - array_remove_pattern: return NULL right away if array_variable_part + returns an invisible variable + - array_length_reference: handle array_variable_part returning an + invisible variable + - get_var_and_type: handle array_variable_part returning an invisible + variable + + 4/15 + ---- +execute_cmd.c + - execute_command_internal: make sure to run the EXIT trap for group + commands anywhere in pipelines, not just at the end. From a point + raised by Andreas Schwab + +variables.c + - bind_int_variable: make sure invisible flag is unset. Fixes problems + like "declare -ai a; : $(( a[4]=4 ));" + +arrayfunc.c + - array_variable_part: return variable even if invisible flag set, + callers must handle invisible vars + + 4/18 + ---- +builtins/set.def + - unset_builtin: if -n flag given, call unset_nameref instead of + unset_variable + +variables.c + - find_variable_nameref: print warning message if nameref circular + reference detected, return NULL and let caller deal with it + +builtins/declare.def + - declare_builtin: only disallow global references at this point if + we are at the global scope + + 5/16 + ---- +configure.ac + - update release status to beta + + 5/23 + ---- +trap.c + - run_pending_traps: save and restore pipeline around calls to + evalstring() in case we get a trap while running a trap. Have to + figure out the recursive running traps issue elsewhere. Fixes + bug reported by Roman Rakus + - run_pending_traps: make sure to set running_trap to the appropriate + signal value when running a trap command + - run_pending_traps: short-circuit immediately if running_trap set + when invoked. Could change this later to only skip if it would + run the same trap as currently being run (running_trap == sig + 1) + +configure.ac + - add warning if bison not found + +lib/readline/doc/rltech.texi + - new section with an example program illustrating the callback + interface. Suggested by Peng Yu + +examples/loadables/Makefile.in + - remove references to `cut' and `getconf', which were removed in + early March + + 5/28 + ---- +lib/sh/pathphys.c + - sh_realpath: correct inverted two arguments to call to sh_makepath. + Report and fix from Julien Thomas + + 6/7 + --- +execute_cmd.c + - executing_line_number: the else clauses that are conditional on + various options being defined can simply be if clauses -- they are + mutually exclusive and all have `return' in the body. Fixes bug + reported by Flavio Medeiros + + 6/25 + ---- +lib/readline/readline.c + - readline_internal_setup: only sent the meta-key enable string to the + terminal if we've been told to use one and the terminal has been + successfully initialized (RL_ISSTATE (RL_STATE_TERMPREPPED) != 0). + Suggested by Dan Mick + +lib/readline/signals.c + - _rl_signal_handler: call any defined signal hook after calling + rl_resize_terminal when handling a SIGWINCH. We already have called + the original SIGWINCH handler but will not be resending the signal + to ourselves + + 6/27 + ---- +lib/readline/doc/history.3, doc/bash.1 + - fix description of the `$' modifier to note that it expands to the + last *word*, which is not always the last argument. Report from + ariyetz@gmail.com via gnu.org RT + + 6/29 + ---- +lib/glob/smatch.c + - glob_asciiranges: initialize to value of GLOBASCII_DEFAULT instead + of 0 (0 if not defined) + +configure.ac,config.h.in + - --enable-glob-asciiranges-default: new option, controls the value of + GLOBASCII_DEFAULT; use it to turn globasciiranges shopt option on + by default + +doc/bashref.texi + - document new --enable-glob-asciiranges-default configure option + +variables.c + - assign_in_env: implement += value appending semantics for assignments + preceding command names + + 7/4 + --- +expr.c + - set lasttok = NUM in all of the functions that result in a number, + even if it's a boolean, to avoid errors with constructs like + 1 * x = 1, which should be an asignment error. Fixes problem + pointed out by Dan Douglas + +parse.y + - decode_prompt_string: don't bother to call strcpy if + polite_directory_format returns its argument unchanged. It's not + necessary and Mac OS X 10.9 aborts because of a supposed overlapping + string copy. Bug and fix from simon@hitzemann.org + +subst.c + - parameter_brace_find_indir: new function, code from + parameter_brace_expand_indir that looks up the indirectly-referenced + variable, but does not expand it + - parameter_brace_expand_indir: call parameter_brace_find_indir to + look up indirected variable reference + - get_var_and_type: call parameter_brace_find_indir if it looks like we + are trying to manipulate an indirect variable reference like + ${!b%%foo}. This makes a difference if !b references an array + variable. Bug report from Dan Douglas + + 7/6 + --- +lib/sh/casemod.c + - sh_modcase: make sure argument passed to is_basic is <= UCHAR_MAX, + since cval can convert something to a wchar_t greater than UCHAR_MAX. + Fixes bug reported by Tomasz Tomasik + + 7/8 + --- +lib/readline/history.c + - add_history_time: if history_length == 0, referencing history_length + - 1 will result in an array bounds error, so make history_length be + at least 1 before going on. Fixes bug reported by Geng Sheng Liu + + +builtins/setattr.def + - show_func_attributes: display definition (if NODEFS argument is 0) and + attributes for a particular function; used by `declare -fp name' + +builtins/declare.def + - declare_internal: call show_func_attributes if -f supplied with -p. + Fixes inconsistency observed by Linda Walsh + +builtins/common.h + - new extern declaration for show_func_attributes + +builtins/read.def + - read_builtin: check the first supplied variable name for validity + before attempting to read any input, since we know we will have to + at least use that one. Don't check any other names yet. Suggested + by jidanni@jidanni.org + + 7/10 + ---- +redir.c + - do_redirection_internal: when closing a file descriptor with + r_close_this ([n]<&-) count close errors as redirection errors if + errno ends up as EIO or ENOSPC. Originally reported back in April + 2012 by Andrey Zaitsev + + 7/11 + ---- +redir.c + - do_redirection_internal: before calling check_bash_input, make sure + that we don't call check_bash_input for an asynchronous process that + is replacing stdin with something else. The seek backwards affects + the parent process as well, since parents and children share the + file pointer. Fixes problem originally reported in March 2013 by + Martin Jackson + + 7/13 + ---- +doc/{bash.1,bashref.texi} + - slight change to add a description of `shopt -o' suggested by Bruce + Korb + + 7/19 + ---- +lib/readline/histfile.c + - history_do_write: if close returns < 0, make sure we restore the + backup history file and return a non-zero value + - history_truncate_file: if write or close return < 0, make sure we + return a non-zero value + +[bash-4.3-beta frozen] + + 7/21 + ---- +lib/readline/isearch.c + - rl_display_search: now takes an entire search context flags word as + the second argument, instead of just reverse flag; changed callers + - rl_display_search: if the search has failed, add `failed ' to the + beginning of the search prompt + - _rl_isearch_dispatch: if the search has failed, display the entire + search string with an indication that the search failed but with the + last matching line. Suggested by jidanni@jidanni.org + +command.h + - W_ASSIGNINT: new word flag; used internally for make_internal_declare + and set by fix_assignment_words + +execute_cmd.c + - fix_assignment_words: set W_ASSIGNINT if compound assignment and -i + given as option. We don't do anything with the value yet + +subst.c + - shell_expand_word_list: rework the way the option list that is + passed to make_internal_declare is created + + 8/1 + --- +doc/{bash.1,bashref.texi} + - minor changes to description of $! based on a report from Chris + Down + +arrayfunc.c + - assign_array_element_internal: before trying to get an array's max + index to process a negative subscript, make sure the array exists. + Bug report from Geir Hauge + + 8/2 + --- +arrayfunc.c + - assign_array_element_internal: before using array_max_index() when + processing a negative subscript, make sure the variable is an array. + if it's not, use 0 as array_max_index assuming it's a string. + Fixes bug report from Geir Hauge + + 8/3 + --- +Makefile.in + - pcomplete.o: add dependency on $(DEFDIR)/builtext.h. Suggested by + Curtis Doty + + 8/5 + --- +lib/glob/sm_loop.c + - strcompare: short-circuit and return FNM_NOMATCH if the lengths of the + pattern and string (pe - p and se - s, respectively) are not equal + - strcompare: don't bother trying to set *pe or *se to '\0' if that's + what they already are. Fixes bug reported by Geir Hauge + + + 8/6 + --- +doc/{bash.1,bashref.texi},builtins/hash.def,lib/readline/doc/rluser.texi + - minor typo changes from Geir Hauge + +bultins/help.def + - show_longdoc: avoid trying to translate the empty string because it + often translates to some boilerplate about the project and + translation. Report and fix from Geir Hauge + + 8/8 + --- +builtins/help.def + - help_builtin: try two passes through the list of help topics for each + argument: one doing exact string matching and one, if the first pass + fails to find a match, doing string prefix matching like previous + versions. This prevents `help read' from matching both `read' and + `readonly', but allows `help r' to match everything beginning with + `r'. Inspired by report from Geir Hauge + + 8/13 + ---- +builtins/fc.def + - fc_builtin,fc_gethnum: calculate `real' end of the history list and + use it if -0 is specified as the beginning or end of the history + range to list. Doesn't work for fc -e or fc -s by design. Feature + requested by Mike Fied + + 8/16 + ---- +trap.c + - _run_trap_internal: use {save,restore}_parser_state instead of + {save,restore}_token_state. It's more comprehensive + + 8/23 + ---- +doc/bash.1 + - disown: remove repeated text. Report and fix from Thomas Hood + + + 8/25 + ---- +lib/readline/rltty.c + - set_special_char: fix prototype (last arg is rl_command_func_t *) + +sig.c + - set_signal_handler: return oact.sa_handler only if sigaction + succeeds; if it doesn't, return SIG_DFL (reasonable default). From + https://bugzilla.redhat.com/show_bug.cgi?id=911404 + +bashline.c + - attempt_shell_completion: fix to skip assignment statements preceding + command name even if there are no programmable completions defined. + From https://bugzilla.redhat.com/show_bug.cgi?id=994659 + - attempt_shell_completion: if still completing command word following + assignment statements, do command completion even if programmable + completion defined for partial command name entered so far + + 8/26 + ---- +pcomplete.c + - pcomp_filename_completion_function: make sure rl_filename_dequoting_function + is non-NULL before trying to call it. Bug and fix from + Andreas Schwab + +bashline.c + - bash_command_name_stat_hook: if *name is not something we're going + to look up in $PATH (absolute_program(*name) != 0), just call the + usual bash_filename_stat_hook and return those results. This makes + completions like $PWD/exam[TAB] add a trailing slash + + 9/2 + --- +builtins/read.def + - read_builtin: before comparing what we read to the delim, make sure + we are not supposed to be ignoring the delimiter (read -N). We + set the delim to -1, but it's possible to read a character whose + int value ends up being between -1 and -128. Fixes bug + reported by Stephane Chazelas + +doc/{bash.1,bashref.texi} + - word splitting: crib some language from Posix to make it clear that + characters in IFS are treated as field *terminators*, not field + *separators*. Addresses issue raised by DJ Mills + + +lib/readline/{util.c,rldefs.h} + - _rl_stricmp,_rl_strnicmp: now take const char * string arguments; + changed prototype declarations + + 9/5 + --- +doc/{bash.1,bashref.texi} + - [[: modify description of pattern matching to make it clear that the + match is performed as if the extglob option were enabled. From Red + Hat bug https://bugzilla.redhat.com/show_bug.cgi?id=1002078 + + 9/12 + ---- +lib/readline/isearch.c + - _rl_isearch_dispatch: if we read an ESC and it's supposed to + terminate the search, make sure we check for typeahead with + _rl_pushed_input_available, since installing a hook function causes + typeahead to be collected in `ibuffer' (input.c). If there is any, + make sure we still use the ESC as a prefix character. Bug and fix + from Mike Miller + + 9/16 + ---- +builtins/{caller,cd,kill,pushd,wait}.def + - builtin_usage(): make sure call to this sets return status to + EX_USAGE + + 9/18 + ---- +terminal.c + - rl_change_environment: new application-settable variable; if non- + zero (the default), readline will modify LINES and COLUMNS in the + environment when it handles SIGWINCH + - _rl_get_screen_size: if rl_change_environment is non-zero, use setenv + to modify LINES and COLUMNS environment variables + +readline.h + - rl_change_environment: new extern declaration for applications + + 9/22 + ---- +configure.ac + - relstatus: bumped version to bash-4.3-beta2 + + 9/24 + ---- + +lib/readline/readline.c + - bind_arrow_keys_internal: added more key bindings for the numeric key + pad arrow keys on mingw32. Patch from Pierre Muller + + + 10/19 + ----- + +bashline.c + - maybe_restore_tilde: version of restore_tilde that honors `direxpand'; + calls restore_tilde after saving directory expansion hook if + necessary. Report from Andreas Schwab + +builtins/cd.def + - -@: new option, allows cd to use `extended attributes' present in + NFSv4, ZFS; idea taken from ksh93. Attributes associated with a + file are presented as a directory containing the attributes as + individual files. Original patch contributed by Cedric Blancher + + + 10/20 + ----- +aclocal.m4 + - BASH_CHECK_MULTIBYTE: check for wcwidth being broken with unicode + combining characters needs a value to use when cross-compiling. + Bug report from Bert Sutherland + +doc/{bash.1,bashref.texi} + - document new -@ option to cd builtin + + 10/28 + ----- +lib/glob/{{gmisc,glob}.c,glob.h} + - extglob_pattern renamed to extglob_pattern_p, declared in glob.h + +subst.c + - expand_word_internal: typo fix: case to fix " $@\ " bug in bash-4.2 + had a typo (& isexp instead of &&) + + 10/29 + ----- +input.c + - getc_with_restart: make sure local_index and local_bufused are + reset to 0 before returning EOF, in case we are running an interactive + shell without line editing and ignoreeof is set. Report and fix + from Yong Zhang + +lib/readline/search.c + - _rl_nsearch_init: take out extra third argument to rl_message; it + only matches prototype (and maybe format) in cases where + PREFER_STDARG and USE_VARARGS are both undefined, which is rare + + 10/31 + ----- +subst.c + - process_substitute: when opening the named pipe in the child, open + without O_NONBLOCK to avoid race conditions. Happens often on AIX. + Bug report and fix from Michael Haubenwallner + + +builtins/ulimit.def + - RLIMIT_NTHR: if RLIMIT_PTHREAD is not defined, but RLIMIT_NTHR is, + use RLIMIT_NTHR (NetBSD) + + 11/5 + ---- +locale.c + - set_default_locale_vars,set_locale_var: if TEXTDOMAINDIR has been + set, and default_dir has a non-null value, call bindtextdomain(3) + when TEXTDOMAIN is assigned a value. Fixes problem reported by + Michael Arlt + + 11/6 + ---- +builtins/cd.def + - cdxattr: only create synthetic pathname in `buf' if NDIRP argument + is non-null + - change_to_directory: if we have specified -@ and cdxattr returns + failure, fail immediately. Fixes bug reported by Joshuah Hurst + + + 11/12 + ----- +redir.c + - print_redirection: change r_err_and_out (&>) and its append form, + r_append_err_and_out (&>>) cases to separate redirection operator + from filename by a space, in case we have a process substitution. + Fixes bug reported by admn ombres + + 11/15 + ----- +execute_cmd.c + - execute_simple_command: don't close process substitution fds until + we are finished executing any current shell function. Partial fix + for bug reported by John Dawson + +support/shobj-conf + - add support for Darwin 13 (Mac OS X 10.9, Mavericks). Based on a + report by Ludwig Schwardt + + 11/20 + ----- +[bash-4.3-rc1 frozen] + + 11/24 + ----- +builtins/printf.def + - bind_printf_variable: make sure that the variable assigned to is + no longer marked as invisible. Fixes bug reported by NBaH + + + 11/28 + ----- +jobs.c + - delete_old_job: fix off-by-one error in job index in call to + internal_warning. Bug report from Peter Cordes + + 11/30 + ----- +doc/bashref.texi + - add string to description of special parameters with name of + special parameter prefixed by a $, so you can search for $#, + for instance + + 12/2 + ---- +lib/readline/{histexpand.c + - get_history_event: account for current_history() possibly returning + NULL. Report and fix from Pankaj Sharma + + + 12/11 + ----- + +lib/readline/parse-colors.c + - get_funky_string: don't call abort if we see something we can't + parse; just return an error + - _rl_parse_colors: if we encounter an error while parsing $LS_COLORS + we need to leave _rl_color_ext_list as NULL after freeing its + elements, then turn off _rl_colored_stats. Report and fix from Martin + Wesdorp + + 12/13 + ----- + +lib/readline/parse-colors.c + - _rl_parse_colors: if we encounter an unrecognized prefix, throw an + error but try to recover and go on to the next specification + +variables.c + - make_local_variable: for new variables this function creates, set + the att_invisible attribute. All callers from declare_internal. + Indirectly, this is a fix for bug with `declare -n var; var=foo;' + reported by Pierre Gaston + - bind_variable: if assigning to nameref variable that doesn't have + a value yet (e.g., with `declare -n var; var=foo'), don't try to + use the unset name. Fixes a segfault reported by Pierre Gaston + + +execute_cmd.c + - execute_command_internal: make sure last_command_exit_value is set + to 0 after any command executed in the background. Fixes bug + reported by Martin Kealey + + 12/17 + ----- +support/config.{guess,sub} + - updated to latest versions from git + + 12/19 + ----- +parse.y + - struct STRING_SAVER: now has a new `flags' element, to identify the + caller: alias expansion, double-paren parsing, or parse_and_execute + - push_string: now sets flags to PSH_ALIAS if `ap' argument is non-NULL + - push_string: now doesn't attempt to call strlen on a NULL string to + set shell_input_line_size + - parser_expanding_alias, parser_save_alias, parser_restore_alias: new + functions to provide an external interface to push_string and + pop_string; parser_save_alias sets flags element to PSH_SOURCE (could + be renamed PSH_EXTERN someday) + - shell_getc: when yy_getc returns '\0', instead of just testing + whether the pushed_string_list is not-empty before popping it, don't + pop if if the saved string has flags PSH_SOURCE, indicating that + parse_and_execute set it before setting bash_input to the string. + We should continue reading to the end of that string before popping + back to a potential alias. Partial solution for the problem of aliases + with embedded newlines containing `.' commands being executed out of + order reported by Andrew Martin + - shell_getc: when yy_getc returns '\0' and there is a saved string of + type PSH_SOURCE, restart the read without popping the string stack + if we have not read to the end of bash_input.location.string. Rest + of fix for out-of-order execution problem + +externs.h + - parser_expanding_alias, parser_save_alias, parser_restore_alias: new + extern function declarations + +builtins/evalstring.c + - pe_prologue: if the parser is expanding an alias, make sure to add + an unwind-protect to restore the alias; undoes the work that will be + performed by parse_and_execute/parse_string + - parse_and_execute,parse_string: after calling push_stream to save + bash_input, check whether or not the parser is currently expanding + an alias (parser_expanding_alias() != 0). If it is, we want to save + that string in the pushed_string_list, which we do with + parser_save_alias. + + 12/23 + ----- +execute_cmd.c + - execute_for_command: make sure to set line_number before expanding + the word list, so expansion errors have the right line number. + From a report from Ben Okopnik + +expr.c + - exp2: save token pointer before calling readtok(), arrange to use + saved token pointer when printing error token on a division by 0 + error + + 12/27 + ----- +lib/readline/display.c + - rl_redisplay: when calculating effects of invisible characters in a + prompt that is split across physical screen lines to set the indices + of linebreaks, don't bother testing local_prompt_prefix (line 751). + That prefix doesn't matter when calculating prompt visible and + invisible characters. Fixes problem reported by Jinesh Choksi + + +Makefile.in + - install: make sure to use $(DESTDIR) when installing OTHER_DOCS. + Report and fix from Matthias Klose + +doc/texinfo.tex + - updated to version of 2013-09-11 + + 12/28 + ----- +lib/readline/undo.c + - rl_do_undo: if we are undoing from a history entry (rl_undo_list == + current_history()->data), make sure the change to rl_line_buffer is + reflected in the history entry. We use the guts of + rl_maybe_replace_line to do the work. Fixes problem reported by + gregrwm + + 12/30 + ----- +sig.c + - sigint_sighandler: if we get a SIGINT (and this signal handler is + installed) while the wait builtin is running, note that we received + it in the same way as jobs.c:wait_sigint_handler and return. The + various wait_for functions will look for that with CHECK_WAIT_INTR. + This fixes the wait builtin not being interruptible in an interactive + job control shell + + 12/31 + ----- +trap.c + - set_signal_hard_ignored: rename set_signal_ignored to this, since it + both sets original_signals[sig] and sets the HARD_IGNORE flag + - set_signal_ignored: new function, now just sets original_signals[sig] + +trap.h + - set_signal_hard_ignored: new external declaration + +sig.c + - initialize_terminating_signals: call set_signal_hard_ignored instead + of set_signal_ignored for signals with disposition SIG_IGN when the + shell starts + +execute_cmd.c + - setup_async_signals: make sure we get the original dispositions for + SIGINT and SIGQUIT before starting the subshell, and don't call + set_signal_ignored because that sets original_signals[sig]. If we + don't, subsequent attempts to reset handling using trap will fail + because it thinks the original dispositions were SIG_IGN. Posix + interpretation 751 (http://austingroupbugs.net/view.php?id=751) + + 1/2/2014 + -------- +lib/sh/stringvec.c + - strvec_mcreate, strvec_mresize: versions of create and resize that + use malloc and realloc, respectively, instead of xmalloc/xrealloc + +braces.c + - expand_amble,mkseq: use strvec_mcreate/strvec_mresize so we can + catch and handle memory allocation failures instead of aborting + with the xmalloc/xrealloc interface + +lib/sh/strdup.c + - strdup replacement function for ancient systems that don't have it + +lib/sh/itos.c + - mitos: new function, itos that uses strdup instead of savestring + +externs.h + - strvec_mcreate/strvec_mresize: new extern declarations + - mitos: new extern declaration + +configure.ac + - bash version moved to 4.3-rc2 + + 1/6 + --- +doc/bash.1,lib/readline/doc/{rluser.texi,readline.3} + - separate the description of what happens when readline reads the + tty EOF character from the description of delete-char, leaving a + note in the delete-char description about common binding for ^D. + From suggestion by Parke + +lib/readline/doc/{version.texi,history.3,*.texi} + - updated email addresses and copyright dates + + 1/7 + --- +variables.c + - delete_var: new function, just removes a variable from a hash table + and frees it, without doing anything else + - make_variable_value: if we are trying to assign to a nameref variable, + return NULL if the value is null or the empty string or not a valid + identifier + +variables.h + - delete_var: new extern declaration + +subst.h + - ASS_NAMEREF: new define for assignments, means assigning to a nameref + variable + +builtins/declare.def + - declare_internal: if we are creating and assigning to a nameref + variable, make sure the value is a valid variable name (checks done + by make_variable_value via bind_variable_value) and display an + error message, deleting the variable we just created, if it is not. + Fixes bug reported by Peggy Russell + + 1/9 + --- +builtins/declare.def + - declare_internal: turning on nameref attribute for an existing + variable turns off -i/-l/-u/-c attributes (essentially the ones + that cause evaluation at assignment time) for ksh93 compat + +builtins/setattr.def + - show_name_attributes: if asked to display attributes and values for + a nameref variable, don't follow the nameref chain to the end. More + ksh93 compat + + 1/10 + ---- +trap.c + - _run_trap_internal: use {save,restore}_parser_state instead of + {save,restore}_token_state, like in run_pending_traps(); don't + need to save and restore last_command_exit_value as a result + - _run_trap_internal: call {save,restore}_pipeline like in + run_pending_traps() + - run_pending_traps: since we no longer run traps in a signal handler + context, do not block and unblock the trapped signal while the + trap is executing + - run_pending_traps: allow recursive invocations (basically, running + traps from a trap handler) with only a warning if the shell is + compiled in debug mode. If a caller doesn't want this to happen, + it should test running_trap > 0. signal_in_progress (sig) only works + for the signals the shell handles specially + +bashline.c + - bash_event_hook: make sure we clean up readline if interrupt_state + is set, not only when SIGINT is not trapped. check_signals_and_traps + will call check_signals, which calls QUIT, which will longjmp back + to top_level, running the interrupt trap along the way. Fixes the + problem of signal handlers being reset out from under readline, and + not being set properly the next time readline is called, because + signals_set_flag is still set to 1. XXX - might need to do this + for other signals too? + + 1/11 + ---- +subst.h + - SD_GLOB: new define for skip_to_delim; means we are scanning a + glob pattern. + +subst.c + - skip_to_delim: if flags include SD_GLOB, assume we are scanning a + glob pattern. Currently only used to skip bracket expressions + which may contain one of the delimiters + + 1/12 + ---- +subst.c + - parameter_brace_expand: when expanding $@ as part of substring + expansion, pattern substitution, or case modification, don't turn + on the QUOTED_NULL flag. The code that constructs the word to be + returned from expand_word_internal expects a different code path + when $@ is being expanded. Fixes bug reported by Theodoros + V. Kalamatianos + + 1/19 + ---- +subst.c + - list_dequote_escapes: new function; analogue of list_quote_escapes + +pathexp.c + - quote_string_for_globbing: fix case where unescaped ^A is last char + in string; need to pass it through unaltered instead of turning it + into a bare backslash + - quote_string_for_globbing: when quoting for regexp matching in [[, + don't treat backslash as a quote character; quote the backslash as + any other character. Part of investigation into reports from + Eduardo A. Bustamante López + + 1/25 + ---- +builtins/gen-helpfiles.c + - write_helpfiles: add prototype + - make sure to #undef xmalloc/xfree/xrealloc/free if USING_BASH_MALLOC + is defined. the code does not use them, and we don't link against + xmalloc.o. Report from Linda Walsh + +Makefile.in + - variables.o: add dependency on builtins/builtext.h; helps with + parallel builds. Report from Linda Walsh + +support/shobj-conf + - darwin: combine the stanzas into one that will not require them to + be updated on each Mac OS X release. Report and fix from Max Horn + + + 1/27 + ---- +support/shobj-conf + - darwin: changed the install_name embedded into the shared library + to contain only the major version number, not the minor one. The + idea is that the minor versions should all be API/ABI compatible, + and it is better to link automatically with the latest one. Idea + from Max Horn + + 1/29 + ---- +[bash-4.3-rc2 released] + + 1/30 + ---- +lib/readline/readline.h + - rl_clear_history, rl_free_keymap: add extern declarations. Report + from Hiroo Hayashi + +general.c + - include trap.h for any_signals_trapped() prototype + +lib/sh/unicode.c + - include for sprintf prototype + + 1/31 + ---- +execute_cmd.c + - execute_simple_command: only posix-mode shells should exit on an + assignment failure in the temporary environment preceding a special + builtin. This is what the documentation and code comments have + always said + - execute_simple_command: make sure redirection errors, word expansion + errors, and assignment errors to Posix special builtins cause a + non-interactive posix mode shell to exit. Previously the shell + would not exit if the failed special builtin was on the LHS of || + or && + +pathexp.c + - quote_string_for_globbing: when quoting a regular expression + (QGLOB_REGEXP), allow an unquoted backslash to pass through + unaltered. Don't use it as a quote character or quote it. More + investigation from 1/24 and report by Mike Frysinger + + - quote_string_for_globbing: when quoting a regular expression + (QGLOB_REGEXP), turn CTLESC CTLESC into CTLESC without adding a + backslash to quote it. We should not have to quote it because it is + not a character special to EREs. More investigation from 1/24 + +lib/glob/glob.c + - glob_testdir: now takes a second flags argument (currently unused); + changed prototype and callers + + 2/1 + --- +lib/glob/glob.c + - glob_testdir: if flags argument includes GX_ALLDIRS (globstar), use + lstat so we skip symlinks when traversing the directory tree. + Originally reported by Chris Down + + 2/2 + --- +lib/readline/undo.c + - rl_do_undo: make sure CUR is non-zero before dereferencing it to + check cur->data against rl_undo_list. Report and fix from + Andreas Schwab + +doc/{bash.1,bashref.texi} + - added slight clarifying language to the description of $*, + describing what happens when the expansion is not within double + quotes + + 2/4 + --- +test.c + - unary_test: add code to -v case so that it interprets `bare' array + references (foo[1]) and returns true if that index has a value + + 2/5 + --- +trap.c + - restore_default_signal: fix SIGCHLD special case for SIG_TRAPPED flag + off but SIG_INPROGRESS mode set and handler IMPOSSIBLE_TRAP_HANDLER; + continue with resetting handler in this case. maybe_set_sigchld_trap + will check these things before resetting sigchld trap from + run_sigchld_trap. Fixes (apparently long-standing?) problem reported + by Alexandru Damian + + 2/6 + --- +lib/sh/strtrans.c + - ansic_quote: fixed a bug when copying a printable character that + consumes more than one byte; byte counter was not being incremented. + Bug report from jidanni@jidanni.org + + 2/7 + --- +input.c + - getc_with_restart: if read(2) returns -1/EINTR and interrupt_state or + terminating_signal is set (which means QUIT; will longjmp out of this + function), make sure the local buffer variables are zeroed out to + avoid reading past the end of the buffer on the next call. Bug report + from Dan Jacobson + + 2/9 + --- +bashline.c + - command_word_completion_function: if a directory in $PATH contains + quote characters, we need to quote them before passing the candidate + path to rl_filename_completion_function, which performs dequoting on + the pathname it's passed. Fixes bug reported by Ilyushkin Nikita + + + 2/11 + ---- +parse.y + - xparse_dolparen: save and restore shell_eof_token around call to + parse_string, intead of just leaving it set to ')' + - shell_getc: when -v is set, only print the command line when + shell_eof_token is 0, so we don't print it multiple times when + recursively entering the parser to parse $(...) commands. Fixes + bug reported by Greg Wooledge + +[changed release status to 4.3-release] + + 2/13 + ---- +lib/sh/strtrans.c + - ansic_quote: handle case where mbrtowc reports that the multibyte + sequence is incomplete or invalid. Fixes bug reported by + Eduardo A. Bustamante López + + 2/14 + ---- +variables.c + - find_variable_nameref_context: fix a problem that caused the loop + to go one context too close to the global context. In some cases, + simple variable assignment would set a variable in the global + context instead of a local context. Bug report from + Geir Hauge diff --git a/CWRU/misc/bison b/CWRU/misc/bison new file mode 100755 index 0000000..58aae79 --- /dev/null +++ b/CWRU/misc/bison @@ -0,0 +1,26 @@ +#! /bin/sh +# +# bison -- just call yacc +# + +# Copyright (C) 1996-2002 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +if [ "$1" = '-y' ]; then + shift +fi + +exec /usr/bin/yacc ${1+"$@"} diff --git a/CWRU/misc/errlist.c b/CWRU/misc/errlist.c new file mode 100644 index 0000000..53c368d --- /dev/null +++ b/CWRU/misc/errlist.c @@ -0,0 +1,57 @@ +/* + * If necessary, link with lib/sh/libsh.a + */ + +/* Copyright (C) 1998-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include +#include + +extern char *strerror(); + +extern int sys_nerr; + +int +main(c, v) +int c; +char **v; +{ + int i, n; + + if (c == 1) { + for (i = 1; i < sys_nerr; i++) + printf("%d --> %s\n", i, strerror(i)); + } else { + for (i = 1; i < c; i++) { + n = atoi(v[i]); + printf("%d --> %s\n", n, strerror(n)); + } + } + exit (0); +} + +programming_error(a, b) +char *a; +int b; +{ +} + +fatal_error() +{ +} diff --git a/CWRU/misc/hpux10-dlfcn.h b/CWRU/misc/hpux10-dlfcn.h new file mode 100644 index 0000000..49d4428 --- /dev/null +++ b/CWRU/misc/hpux10-dlfcn.h @@ -0,0 +1,63 @@ +/* + * HPUX 10.x stubs to implement dl* in terms of shl* + * + * Not needed for later versions; HPUX 11.x has dlopen() and friends. + * + * configure also needs to be faked out. You can create a dummy libdl.a + * with stub entries for dlopen, dlclose, dlsym, and dlerror: + * + * int dlopen() { return(0);} + * int dlclose() { return(0);} + * int dlsym() { return(0);} + * int dlerror() { return(0);} + * + * This has not been tested; I just read the manual page and coded this up. + * + * According to the ld manual page, you need to link bash with -dld and add + * the -E flag to LOCAL_LDFLAGS. + */ + +/* Copyright (C) 1998-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (__HPUX10_DLFCN_H__) + +#define __HPUX10_DLFCN_H__ + +#include +#include + +#ifndef errno +extern int errno; +#endif + +#define RTLD_LAZY BIND_DEFERRED +#define RTLD_NOW BIND_IMMEDIATE +#define RTLD_GLOBAL DYNAMIC_PATH + +char *bash_global_sym_addr; + +#define dlopen(file,mode) (void *)shl_load((file), (mode), 0L) + +#define dlclose(handle) shl_unload((shl_t)(handle)) + +#define dlsym(handle,name) (bash_global_sym_addr=0,shl_findsym((shl_t *)&(handle),name,TYPE_UNDEFINED,&bash_global_sym_addr), (void *)bash_global_sym_addr) + +#define dlerror() strerror(errno) + +#endif /* __HPUX10_DLFCN_H__ */ diff --git a/CWRU/misc/open-files.c b/CWRU/misc/open-files.c new file mode 100644 index 0000000..6a55577 --- /dev/null +++ b/CWRU/misc/open-files.c @@ -0,0 +1,39 @@ +/* open-files -- report files a process has open */ + +/* Copyright (C) 1989-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include +#include +#include + +#include +#include + +#include + +main() +{ + register int i; + + for (i = 0; i < getdtablesize(); i++) { + if (fcntl(i, F_GETFD, 0) != -1) + fprintf(stderr, "fd %d: open\n", i); + } + exit(0); +} diff --git a/CWRU/misc/sigs.c b/CWRU/misc/sigs.c new file mode 100644 index 0000000..bae93f8 --- /dev/null +++ b/CWRU/misc/sigs.c @@ -0,0 +1,47 @@ +/* sigs - print signal dispositions for a process */ + +/* Copyright (C) 1990-2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include +#include + +extern const char * const sys_siglist[]; + +typedef void sighandler(); + +main(argc, argv) +int argc; +char **argv; +{ + register int i; + sighandler *h; + + for (i = 1; i < NSIG; i++) { + h = signal(i, SIG_DFL); + if (h != SIG_DFL) { + if (h == SIG_IGN) + fprintf(stderr, "%d: ignored (%s)\n", i, sys_siglist[i]); + else + fprintf(stderr, "%d: caught (%s)\n", i, sys_siglist[i]); + } + } + exit(0); +} + + diff --git a/CWRU/misc/sigstat.c b/CWRU/misc/sigstat.c new file mode 100644 index 0000000..9135baa --- /dev/null +++ b/CWRU/misc/sigstat.c @@ -0,0 +1,226 @@ +/* + * sigstat - print out useful information about signal arguments + * + * Chet Ramey + * chet@po.cwru.edu + */ + +/* Copyright (C) 1991-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include +#include +#include + +extern char *strrchr(); +static char *signames[NSIG]; + +char *progname; + +void sigstat(); + +main(argc, argv) +int argc; +char **argv; +{ + register int i; + char *t; + + if (t = strrchr(argv[0], '/')) + progname = ++t; + else + progname = argv[0]; + init_signames(); + if (argc == 1) { + for (i = 1; i < NSIG; i++) + sigstat(i); + exit(0); + } + for (i = 1; i < argc; i++) + sigstat(atoi(argv[i])); + exit(0); +} + +void +sigstat(sig) +int sig; +{ + struct sigaction oact; + char *signame; + sigset_t set, oset; + int blocked; + + if (sig < 0 || sig >= NSIG) { + fprintf(stderr, "%s: %d: signal out of range\n", progname, sig); + return; + } + signame = signames[sig]; + sigemptyset(&oset); + sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &oset); + if (sigismember(&oset, sig)) + printf("%s: signal is blocked\n", signame); + sigaction(sig, (struct sigaction *)NULL, &oact); + if (oact.sa_handler == SIG_IGN) + printf("%s: signal is ignored\n", signame); + else if (oact.sa_handler == SIG_DFL) + printf("%s: signal is defaulted\n", signame); + else + printf("%s: signal is trapped (?)\n", signame); +} + +init_signames() +{ + register int i; + bzero(signames, sizeof(signames)); + +#if defined (SIGHUP) /* hangup */ + signames[SIGHUP] = "SIGHUP"; +#endif +#if defined (SIGINT) /* interrupt */ + signames[SIGINT] = "SIGINT"; +#endif +#if defined (SIGQUIT) /* quit */ + signames[SIGQUIT] = "SIGQUIT"; +#endif +#if defined (SIGILL) /* illegal instruction (not reset when caught) */ + signames[SIGILL] = "SIGILL"; +#endif +#if defined (SIGTRAP) /* trace trap (not reset when caught) */ + signames[SIGTRAP] = "SIGTRAP"; +#endif +#if defined (SIGABRT) /* */ + signames[SIGABRT] = "SIGABRT"; +#endif +#if defined (SIGIOT) /* IOT instruction */ + signames[SIGIOT] = "SIGIOT"; +#endif +#if defined (SIGEMT) /* EMT instruction */ + signames[SIGEMT] = "SIGEMT"; +#endif +#if defined (SIGFPE) /* floating point exception */ + signames[SIGFPE] = "SIGFPE"; +#endif +#if defined (SIGKILL) /* kill (cannot be caught or ignored) */ + signames[SIGKILL] = "SIGKILL"; +#endif +#if defined (SIGBUS) /* bus error */ + signames[SIGBUS] = "SIGBUS"; +#endif +#if defined (SIGSEGV) /* segmentation violation */ + signames[SIGSEGV] = "SIGSEGV"; +#endif +#if defined (SIGSYS) /* bad argument to system call */ + signames[SIGSYS] = "SIGSYS"; +#endif +#if defined (SIGPIPE) /* write on a pipe with no one to read it */ + signames[SIGPIPE] = "SIGPIPE"; +#endif +#if defined (SIGALRM) /* alarm clock */ + signames[SIGALRM] = "SIGALRM"; +#endif +#if defined (SIGTERM) /* software termination signal from kill */ + signames[SIGTERM] = "SIGTERM"; +#endif +#if defined (SIGCLD) /* Like SIGCHLD. */ + signames[SIGCLD] = "SIGCLD"; +#endif +#if defined (SIGPWR) /* Magic thing for some machines. */ + signames[SIGPWR] = "SIGPWR"; +#endif +#if defined (SIGPOLL) /* For keyboard input? */ + signames[SIGPOLL] = "SIGPOLL"; +#endif +#if defined (SIGURG) /* urgent condition on IO channel */ + signames[SIGURG] = "SIGURG"; +#endif +#if defined (SIGSTOP) /* sendable stop signal not from tty */ + signames[SIGSTOP] = "SIGSTOP"; +#endif +#if defined (SIGTSTP) /* stop signal from tty */ + signames[SIGTSTP] = "SIGTSTP"; +#endif +#if defined (SIGCONT) /* continue a stopped process */ + signames[SIGCONT] = "SIGCONT"; +#endif +#if defined (SIGCHLD) /* to parent on child stop or exit */ + signames[SIGCHLD] = "SIGCHLD"; +#endif +#if defined (SIGTTIN) /* to readers pgrp upon background tty read */ + signames[SIGTTIN] = "SIGTTIN"; +#endif +#if defined (SIGTTOU) /* like TTIN for output if (tp->t_local<OSTOP) */ + signames[SIGTTOU] = "SIGTTOU"; +#endif +#if defined (SIGIO) /* input/output possible signal */ + signames[SIGIO] = "SIGIO"; +#endif +#if defined (SIGXCPU) /* exceeded CPU time limit */ + signames[SIGXCPU] = "SIGXCPU"; +#endif +#if defined (SIGXFSZ) /* exceeded file size limit */ + signames[SIGXFSZ] = "SIGXFSZ"; +#endif +#if defined (SIGVTALRM) /* virtual time alarm */ + signames[SIGVTALRM] = "SIGVTALRM"; +#endif +#if defined (SIGPROF) /* profiling time alarm */ + signames[SIGPROF] = "SIGPROF"; +#endif +#if defined (SIGWINCH) /* window changed */ + signames[SIGWINCH] = "SIGWINCH"; +#endif +#if defined (SIGLOST) /* resource lost (eg, record-lock lost) */ + signames[SIGLOST] = "SIGLOST"; +#endif +#if defined (SIGUSR1) /* user defined signal 1 */ + signames[SIGUSR1] = "SIGUSR1"; +#endif +#if defined (SIGUSR2) /* user defined signal 2 */ + signames[SIGUSR2] = "SIGUSR2"; +#endif +#if defined (SIGMSG) /* HFT input data pending */ + signames[SIGMSG] = "SIGMSG"; +#endif +#if defined (SIGPWR) /* power failure imminent (save your data) */ + signames[SIGPWR] = "SIGPWR"; +#endif +#if defined (SIGDANGER) /* system crash imminent */ + signames[SIGDANGER] = "SIGDANGER"; +#endif +#if defined (SIGMIGRATE) /* migrate process to another CPU */ + signames[SIGMIGRATE] = "SIGMIGRATE"; +#endif +#if defined (SIGPRE) /* programming error */ + signames[SIGPRE] = "SIGPRE"; +#endif +#if defined (SIGGRANT) /* HFT monitor mode granted */ + signames[SIGGRANT] = "SIGGRANT"; +#endif +#if defined (SIGRETRACT) /* HFT monitor mode retracted */ + signames[SIGRETRACT] = "SIGRETRACT"; +#endif +#if defined (SIGSOUND) /* HFT sound sequence has completed */ + signames[SIGSOUND] = "SIGSOUND"; +#endif + + for (i = 0; i < NSIG; i++) + if (signames[i] == (char *)NULL) { + signames[i] = (char *)malloc (16);; + sprintf (signames[i], "signal %d", i); + } +} diff --git a/CWRU/sh-redir-hack b/CWRU/sh-redir-hack new file mode 100644 index 0000000..413b297 --- /dev/null +++ b/CWRU/sh-redir-hack @@ -0,0 +1,15 @@ +Add to `subshell' production in parse.y and recompile -DREDIRECTION_HACK to +get `< xx (command)' sh compatibility. + + | redirections '(' list ')' + { +#if defined (REDIRECTION_HACK) + /* XXX - C News sh compatibility hack - XXX */ + $3->redirects = $1; + $3->flags |= CMD_WANT_SUBSHELL; + $$ = $3; +#else + yyerror (); + YYABORT; +#endif + } diff --git a/ChangeLog b/ChangeLog new file mode 120000 index 0000000..12c9a28 --- /dev/null +++ b/ChangeLog @@ -0,0 +1 @@ +CWRU/changelog \ No newline at end of file diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..ebe7ea1 --- /dev/null +++ b/INSTALL @@ -0,0 +1,421 @@ +Basic Installation +================== + +These are installation instructions for Bash. + +The simplest way to compile Bash is: + + 1. `cd' to the directory containing the source code and type + `./configure' to configure Bash for your system. If you're using + `csh' on an old version of System V, you might need to type `sh + ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes some time. While running, it prints + messages telling which features it is checking for. + + 2. Type `make' to compile Bash and build the `bashbug' bug reporting + script. + + 3. Optionally, type `make tests' to run the Bash test suite. + + 4. Type `make install' to install `bash' and `bashbug'. This will + also install the manual pages and Info file. + +The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package +(the top directory, the `builtins', `doc', and `support' directories, +each directory under `lib', and several others). It also creates a +`config.h' file containing system-dependent definitions. Finally, it +creates a shell script named `config.status' that you can run in the +future to recreate the current configuration, a file `config.cache' +that saves the results of its tests to speed up reconfiguring, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). If at some point `config.cache' contains +results you don't want to keep, you may remove or edit it. + +To find out more about the options and arguments that the `configure' +script understands, type + + bash-2.04$ ./configure --help + +at the Bash prompt in your Bash source directory. + +If you need to do unusual things to compile Bash, please try to figure +out how `configure' could check whether or not to do them, and mail +diffs or instructions to so they can be +considered for the next release. + +The file `configure.ac' is used to create `configure' by a program +called Autoconf. You only need `configure.ac' if you want to change it +or regenerate `configure' using a newer version of Autoconf. If you do +this, make sure you are using Autoconf version 2.50 or newer. + +You can remove the program binaries and object files from the source +code directory by typing `make clean'. To also remove the files that +`configure' created (so you can compile Bash for a different kind of +computer), type `make distclean'. + +Compilers and Options +===================== + +Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +On systems that have the `env' program, you can do it like this: + + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +The configuration process uses GCC to build Bash if it is available. + +Compiling For Multiple Architectures +==================================== + +You can compile Bash for more than one kind of computer at the same +time, by placing the object files for each architecture in their own +directory. To do this, you must use a version of `make' that supports +the `VPATH' variable, such as GNU `make'. `cd' to the directory where +you want the object files and executables to go and run the `configure' +script from the source directory. You may need to supply the +`--srcdir=PATH' argument to tell `configure' where the source files +are. `configure' automatically checks for the source code in the +directory that `configure' is in and in `..'. + +If you have to use a `make' that does not supports the `VPATH' +variable, you can compile Bash for one architecture at a time in the +source code directory. After you have installed Bash for one +architecture, use `make distclean' before reconfiguring for another +architecture. + +Alternatively, if your system supports symbolic links, you can use the +`support/mkclone' script to create a build tree which has symbolic +links back to each file in the source directory. Here's an example +that creates a build directory in the current directory from a source +directory `/usr/gnu/src/bash-2.0': + + bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 . + +The `mkclone' script requires Bash, so you must have already built Bash +for at least one architecture before you can create build directories +for other architectures. + +Installation Names +================== + +By default, `make install' will install into `/usr/local/bin', +`/usr/local/man', etc. You can specify an installation prefix other +than `/usr/local' by giving `configure' the option `--prefix=PATH', or +by specifying a value for the `DESTDIR' `make' variable when running +`make install'. + +You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', `make install' will +use PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + +Specifying the System Type +========================== + +There may be some features `configure' can not figure out +automatically, but need to determine by the type of host Bash will run +on. Usually `configure' can figure that out, but if it prints a +message saying it can not guess the host type, give it the +`--host=TYPE' option. `TYPE' can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: +`CPU-COMPANY-SYSTEM' (e.g., `i386-unknown-freebsd4.2'). + +See the file `support/config.sub' for the possible values of each field. + +Sharing Defaults +================ + +If you want to set default values for `configure' scripts to share, you +can create a site shell script called `config.site' that gives default +values for variables like `CC', `cache_file', and `prefix'. `configure' +looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: the Bash `configure' looks for a site script, but not all +`configure' scripts do. + +Operation Controls +================== + +`configure' recognizes the following options to control how it operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. + +`--srcdir=DIR' + Look for the Bash source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely used, boilerplate +options. `configure --help' prints the complete list. + +Optional Features +================= + +The Bash `configure' has a number of `--enable-FEATURE' options, where +FEATURE indicates an optional part of Bash. There are also several +`--with-PACKAGE' options, where PACKAGE is something like `bash-malloc' +or `purify'. To turn off the default use of a package, use +`--without-PACKAGE'. To configure Bash without a feature that is +enabled by default, use `--disable-FEATURE'. + +Here is a complete list of the `--enable-' and `--with-' options that +the Bash `configure' recognizes. + +`--with-afs' + Define if you are using the Andrew File System from Transarc. + +`--with-bash-malloc' + Use the Bash version of `malloc' in the directory `lib/malloc'. + This is not the same `malloc' that appears in GNU libc, but an + older version originally derived from the 4.2 BSD `malloc'. This + `malloc' is very fast, but wastes some space on each allocation. + This option is enabled by default. The `NOTES' file contains a + list of systems for which this should be turned off, and + `configure' disables this option automatically for a number of + systems. + +`--with-curses' + Use the curses library instead of the termcap library. This should + be supplied if your system has an inadequate or incomplete termcap + database. + +`--with-gnu-malloc' + A synonym for `--with-bash-malloc'. + +`--with-installed-readline[=PREFIX]' + Define this to make Bash link with a locally-installed version of + Readline rather than the version in `lib/readline'. This works + only with Readline 5.0 and later versions. If PREFIX is `yes' or + not supplied, `configure' uses the values of the make variables + `includedir' and `libdir', which are subdirectories of `prefix' by + default, to find the installed version of Readline if it is not in + the standard system include and library directories. If PREFIX is + `no', Bash links with the version in `lib/readline'. If PREFIX is + set to any other value, `configure' treats it as a directory + pathname and looks for the installed version of Readline in + subdirectories of that directory (include files in + PREFIX/`include' and the library in PREFIX/`lib'). + +`--with-purify' + Define this to use the Purify memory allocation checker from + Rational Software. + +`--enable-minimal-config' + This produces a shell with minimal features, close to the + historical Bourne shell. + +There are several `--enable-' options that alter how Bash is compiled +and linked, rather than changing run-time features. + +`--enable-largefile' + Enable support for large files + (http://www.sas.com/standards/large_file/x_open.20Mar96.html) if + the operating system requires special compiler options to build + programs which can access large files. This is enabled by + default, if the operating system provides large file support. + +`--enable-profiling' + This builds a Bash binary that produces profiling information to be + processed by `gprof' each time it is executed. + +`--enable-static-link' + This causes Bash to be linked statically, if `gcc' is being used. + This could be used to build a version to use as root's shell. + +The `minimal-config' option can be used to disable all of the following +options, but it is processed first, so individual options may be +enabled using `enable-FEATURE'. + +All of the following options except for `disabled-builtins', +`directpand-default', and `xpg-echo-default' are enabled by default, +unless the operating system does not provide the necessary support. + +`--enable-alias' + Allow alias expansion and include the `alias' and `unalias' + builtins (*note Aliases::). + +`--enable-arith-for-command' + Include support for the alternate form of the `for' command that + behaves like the C language `for' statement (*note Looping + Constructs::). + +`--enable-array-variables' + Include support for one-dimensional array shell variables (*note + Arrays::). + +`--enable-bang-history' + Include support for `csh'-like history substitution (*note History + Interaction::). + +`--enable-brace-expansion' + Include `csh'-like brace expansion ( `b{a,b}c' ==> `bac bbc' ). + See *note Brace Expansion::, for a complete description. + +`--enable-casemod-attributes' + Include support for case-modifying attributes in the `declare' + builtin and assignment statements. Variables with the UPPERCASE + attribute, for example, will have their values converted to + uppercase upon assignment. + +`--enable-casemod-expansion' + Include support for case-modifying word expansions. + +`--enable-command-timing' + Include support for recognizing `time' as a reserved word and for + displaying timing statistics for the pipeline following `time' + (*note Pipelines::). This allows pipelines as well as shell + builtins and functions to be timed. + +`--enable-cond-command' + Include support for the `[[' conditional command. (*note + Conditional Constructs::). + +`--enable-cond-regexp' + Include support for matching POSIX regular expressions using the + `=~' binary operator in the `[[' conditional command. (*note + Conditional Constructs::). + +`--enable-coprocesses' + Include support for coprocesses and the `coproc' reserved word + (*note Pipelines::). + +`--enable-debugger' + Include support for the bash debugger (distributed separately). + +`--enable-direxpand-default' + Cause the `direxpand' shell option (*note The Shopt Builtin::) to + be enabled by default when the shell starts. It is normally + disabled by default. + +`--enable-directory-stack' + Include support for a `csh'-like directory stack and the `pushd', + `popd', and `dirs' builtins (*note The Directory Stack::). + +`--enable-disabled-builtins' + Allow builtin commands to be invoked via `builtin xxx' even after + `xxx' has been disabled using `enable -n xxx'. See *note Bash + Builtins::, for details of the `builtin' and `enable' builtin + commands. + +`--enable-dparen-arithmetic' + Include support for the `((...))' command (*note Conditional + Constructs::). + +`--enable-extended-glob' + Include support for the extended pattern matching features + described above under *note Pattern Matching::. + +`--enable-extended-glob-default' + Set the default value of the EXTGLOB shell option described above + under *note The Shopt Builtin:: to be enabled. + +`--enable-glob-asciirange-default' + Set the default value of the GLOBASCIIRANGES shell option described + above under *note The Shopt Builtin:: to be enabled. This + controls the behavior of character ranges when used in pattern + matching bracket expressions. + +`--enable-help-builtin' + Include the `help' builtin, which displays help on shell builtins + and variables (*note Bash Builtins::). + +`--enable-history' + Include command history and the `fc' and `history' builtin + commands (*note Bash History Facilities::). + +`--enable-job-control' + This enables the job control features (*note Job Control::), if + the operating system supports them. + +`--enable-multibyte' + This enables support for multibyte characters if the operating + system provides the necessary support. + +`--enable-net-redirections' + This enables the special handling of filenames of the form + `/dev/tcp/HOST/PORT' and `/dev/udp/HOST/PORT' when used in + redirections (*note Redirections::). + +`--enable-process-substitution' + This enables process substitution (*note Process Substitution::) if + the operating system provides the necessary support. + +`--enable-progcomp' + Enable the programmable completion facilities (*note Programmable + Completion::). If Readline is not enabled, this option has no + effect. + +`--enable-prompt-string-decoding' + Turn on the interpretation of a number of backslash-escaped + characters in the `$PS1', `$PS2', `$PS3', and `$PS4' prompt + strings. See *note Controlling the Prompt::, for a complete list + of prompt string escape sequences. + +`--enable-readline' + Include support for command-line editing and history with the Bash + version of the Readline library (*note Command Line Editing::). + +`--enable-restricted' + Include support for a "restricted shell". If this is enabled, + Bash, when called as `rbash', enters a restricted mode. See *note + The Restricted Shell::, for a description of restricted mode. + +`--enable-select' + Include the `select' compound command, which allows the generation + of simple menus (*note Conditional Constructs::). + +`--enable-separate-helpfiles' + Use external files for the documentation displayed by the `help' + builtin instead of storing the text internally. + +`--enable-single-help-strings' + Store the text displayed by the `help' builtin as a single string + for each help topic. This aids in translating the text to + different languages. You may need to disable this if your + compiler cannot handle very long string literals. + +`--enable-strict-posix-default' + Make Bash POSIX-conformant by default (*note Bash POSIX Mode::). + +`--enable-usg-echo-default' + A synonym for `--enable-xpg-echo-default'. + +`--enable-xpg-echo-default' + Make the `echo' builtin expand backslash-escaped characters by + default, without requiring the `-e' option. This sets the default + value of the `xpg_echo' shell option to `on', which makes the Bash + `echo' behave more like the version specified in the Single Unix + Specification, version 3. *Note Bash Builtins::, for a + description of the escape sequences that `echo' recognizes. + +The file `config-top.h' contains C Preprocessor `#define' statements +for options which are not settable from `configure'. Some of these are +not meant to be changed; beware of the consequences if you do. Read +the comments associated with each definition for more information about +its effect. diff --git a/MANIFEST b/MANIFEST new file mode 100644 index 0000000..55c8d1c --- /dev/null +++ b/MANIFEST @@ -0,0 +1,1287 @@ +# +# Master distribution manifest for bash +# +# +# Filename type +# +CWRU d +CWRU/misc d +builtins d +cross-build d +doc d +examples d +#examples/obashdb d +examples/complete d +examples/functions d +examples/scripts d +#examples/scripts.v2 d +#examples/scripts.noah d +examples/startup-files d +#examples/startup-files/apple d +examples/misc d +examples/loadables d +examples/loadables/perl d +include d +lib d +lib/glob d +lib/glob/doc d +lib/intl d +lib/malloc d +lib/readline d +lib/readline/doc d +lib/readline/examples d +lib/sh d +lib/termcap d +lib/tilde d +m4 d +po d +support d +tests d +tests/misc d +ABOUT-NLS f +ChangeLog s CWRU/changelog +CHANGES f +COMPAT f +COPYING f +INSTALL f +MANIFEST f +NEWS f +NOTES f +POSIX f +README f +RBASH f +AUTHORS f +Y2K f +configure.ac f +configure f 755 +Makefile.in f +config-top.h f +config-bot.h f +config.h.in f +aclocal.m4 f +array.c f +arrayfunc.c f +assoc.c f +eval.c f +print_cmd.c f +general.c f +list.c f +locale.c f +stringlib.c f +variables.c f +make_cmd.c f +copy_cmd.c f +unwind_prot.c f +dispose_cmd.c f +bashhist.c f +hashcmd.c f +hashlib.c f +parse.y f +pathexp.c f +subst.c f +shell.c f +trap.c f +sig.c f +siglist.c f +version.c f +flags.c f +jobs.c f +input.c f +mailcheck.c f +test.c f +expr.c f +alias.c f +execute_cmd.c f +findcmd.c f +redir.c f +bashline.c f +braces.c f +bracecomp.c f +nojobs.c f +error.c f +xmalloc.c f +pcomplete.c f +pcomplib.c f +mksyntax.c f +alias.h f +builtins.h f +bashhist.h f +bashline.h f +conftypes.h f +patchlevel.h f +variables.h f +array.h f +arrayfunc.h f +assoc.h f +jobs.h f +findcmd.h f +hashlib.h f +quit.h f +flags.h f +shell.h f +syntax.h f +pathexp.h f +parser.h f +pcomplete.h f +sig.h f +test.h f +trap.h f +general.h f +unwind_prot.h f +input.h f +error.h f +command.h f +externs.h f +siglist.h f +subst.h f +dispose_cmd.h f +hashcmd.h f +bashansi.h f +bashjmp.h f +bashintl.h f +make_cmd.h f +execute_cmd.h f +redir.h f +bashtypes.h f +mailcheck.h f +xmalloc.h f +y.tab.c f +y.tab.h f +parser-built f +pathnames.h.in f +builtins/Makefile.in f +builtins/alias.def f +builtins/bind.def f +builtins/break.def f +builtins/builtin.def f +builtins/caller.def f +builtins/cd.def f +builtins/colon.def f +builtins/command.def f +builtins/complete.def f +builtins/common.c f +builtins/declare.def f +builtins/echo.def f +builtins/enable.def f +builtins/eval.def f +builtins/evalfile.c f +builtins/evalstring.c f +builtins/exec.def f +builtins/exit.def f +builtins/fc.def f +builtins/fg_bg.def f +builtins/gen-helpfiles.c f +builtins/getopt.c f +builtins/getopt.h f +builtins/getopts.def f +builtins/hash.def f +builtins/help.def f +builtins/let.def f +builtins/history.def f +builtins/jobs.def f +builtins/kill.def f +builtins/mapfile.def f +builtins/mkbuiltins.c f +builtins/printf.def f +builtins/pushd.def f +builtins/read.def f +builtins/reserved.def f +builtins/return.def f +builtins/set.def f +builtins/setattr.def f +builtins/shift.def f +builtins/shopt.def f +builtins/source.def f +builtins/suspend.def f +builtins/test.def f +builtins/times.def f +builtins/trap.def f +builtins/type.def f +builtins/ulimit.def f +builtins/umask.def f +builtins/wait.def f +builtins/psize.c f +builtins/psize.sh f +builtins/inlib.def f +builtins/bashgetopt.c f +builtins/common.h f +builtins/bashgetopt.h f +cross-build/cygwin32.cache f +cross-build/x86-beos.cache f +cross-build/opennt.cache f +include/ansi_stdlib.h f +include/chartypes.h f +include/filecntl.h f +include/gettext.h f +include/maxpath.h f +include/memalloc.h f +include/ocache.h f +include/posixdir.h f +include/posixjmp.h f +include/posixselect.h f +include/posixstat.h f +include/posixtime.h f +include/posixwait.h f +include/shmbchar.h f +include/shmbutil.h f +include/shtty.h f +include/stat-time.h f +include/stdc.h f +include/systimes.h f +include/typemax.h f +include/unionwait.h f +lib/glob/Makefile.in f +lib/glob/sm_loop.c f +lib/glob/smatch.c f +lib/glob/strmatch.c f +lib/glob/strmatch.h f +lib/glob/glob.c f +lib/glob/glob.h f +lib/glob/glob_loop.c f +lib/glob/gmisc.c f +lib/glob/xmbsrtowcs.c f +lib/glob/collsyms.h f +lib/glob/doc/Makefile f +lib/glob/doc/glob.texi f +lib/glob/ndir.h f +lib/intl/ChangeLog f +lib/intl/Makefile.in f +lib/intl/VERSION f +lib/intl/bindtextdom.c f +lib/intl/config.charset f +lib/intl/dcgettext.c f +lib/intl/dcigettext.c f +lib/intl/dcngettext.c f +lib/intl/dgettext.c f +lib/intl/dngettext.c f +lib/intl/eval-plural.h f +lib/intl/explodename.c f +lib/intl/finddomain.c f +lib/intl/gettext.c f +lib/intl/gettextP.h f +lib/intl/gmo.h f +lib/intl/hash-string.h f +lib/intl/intl-compat.c f +lib/intl/l10nflist.c f +lib/intl/libgnuintl.h.in f +lib/intl/loadinfo.h f +lib/intl/loadmsgcat.c f +lib/intl/localcharset.c f +lib/intl/localcharset.h f +lib/intl/locale.alias f +lib/intl/localealias.c f +lib/intl/localename.c f +lib/intl/log.c f +lib/intl/ngettext.c f +lib/intl/os2compat.c f +lib/intl/os2compat.h f +lib/intl/osdep.c f +lib/intl/plural-exp.c f +lib/intl/plural-exp.h f +lib/intl/plural.c f +lib/intl/plural.y f +lib/intl/ref-add.sin f +lib/intl/ref-del.sin f +lib/intl/relocatable.c f +lib/intl/relocatable.h f +lib/intl/textdomain.c f +lib/malloc/Makefile.in f +lib/malloc/getpagesize.h f +lib/malloc/imalloc.h f +lib/malloc/mstats.h f +lib/malloc/shmalloc.h f +lib/malloc/table.h f +lib/malloc/watch.h f +lib/malloc/alloca.c f +lib/malloc/malloc.c f +lib/malloc/stats.c f +lib/malloc/table.c f +lib/malloc/trace.c f +lib/malloc/watch.c f +lib/malloc/xmalloc.c f +lib/malloc/xleaktrace f 755 +lib/malloc/stub.c f +lib/malloc/i386-alloca.s f +lib/malloc/x386-alloca.s f +lib/readline/COPYING f +lib/readline/Makefile.in f +lib/readline/ChangeLog f +lib/readline/README f +lib/readline/STANDALONE f +lib/readline/readline.c f +lib/readline/vi_mode.c f +lib/readline/emacs_keymap.c f +lib/readline/vi_keymap.c f +lib/readline/history.c f +lib/readline/histexpand.c f +lib/readline/histsearch.c f +lib/readline/histfile.c f +lib/readline/funmap.c f +lib/readline/keymaps.c f +lib/readline/util.c f +lib/readline/terminal.c f +lib/readline/xfree.c f +lib/readline/xmalloc.c f +lib/readline/search.c f +lib/readline/isearch.c f +lib/readline/parens.c f +lib/readline/rltty.c f +lib/readline/compat.c f +lib/readline/complete.c f +lib/readline/bind.c f +lib/readline/display.c f +lib/readline/signals.c f +lib/readline/kill.c f +lib/readline/text.c f +lib/readline/undo.c f +lib/readline/macro.c f +lib/readline/input.c f +lib/readline/callback.c f +lib/readline/mbutil.c f +lib/readline/misc.c f +lib/readline/nls.c f +lib/readline/shell.c f +lib/readline/colors.c f +lib/readline/parse-colors.c f +lib/readline/savestring.c f +lib/readline/tilde.c f +lib/readline/tilde.h f +lib/readline/rldefs.h f +lib/readline/rlconf.h f +lib/readline/rlmbutil.h f +lib/readline/rlshell.h f +lib/readline/rltty.h f +lib/readline/rltypedefs.h f +lib/readline/rlwinsize.h f +lib/readline/readline.h f +lib/readline/tcap.h f +lib/readline/keymaps.h f +lib/readline/history.h f +lib/readline/histlib.h f +lib/readline/chardefs.h f +lib/readline/posixdir.h f +lib/readline/posixjmp.h f +lib/readline/posixselect.h f +lib/readline/posixstat.h f +lib/readline/ansi_stdlib.h f +lib/readline/rlstdc.h f +lib/readline/rlprivate.h f +lib/readline/colors.h f +lib/readline/parse-colors.h f +lib/readline/xmalloc.h f +lib/readline/doc/Makefile f +lib/readline/doc/version.texi f +lib/readline/doc/rlman.texi f +lib/readline/doc/rltech.texi f +lib/readline/doc/rluser.texi f +lib/readline/doc/rluserman.texi f +lib/readline/doc/history.texi f +lib/readline/doc/hstech.texi f +lib/readline/doc/hsuser.texi f +lib/readline/doc/fdl.texi f +lib/readline/examples/Makefile f +lib/readline/examples/excallback.c f +lib/readline/examples/fileman.c f +lib/readline/examples/manexamp.c f +lib/readline/examples/histexamp.c f +lib/readline/examples/rltest.c f +lib/readline/examples/rl-callbacktest.c f +lib/readline/examples/rl.c f +lib/readline/examples/rlcat.c f +lib/readline/examples/Inputrc f +lib/sh/Makefile.in f +lib/sh/casemod.c f +lib/sh/clktck.c f +lib/sh/clock.c f +lib/sh/dprintf.c f +lib/sh/eaccess.c f +lib/sh/fmtullong.c f +lib/sh/fmtulong.c f +lib/sh/fmtumax.c f +lib/sh/fnxform.c f +lib/sh/fpurge.c f +lib/sh/getcwd.c f +lib/sh/getenv.c f +lib/sh/inet_aton.c f +lib/sh/input_avail.c f +lib/sh/itos.c f +lib/sh/mailstat.c f +lib/sh/makepath.c f +lib/sh/mbscasecmp.c f +lib/sh/mbschr.c f +lib/sh/mbscmp.c f +lib/sh/memset.c f +lib/sh/mktime.c f +lib/sh/netconn.c f +lib/sh/netopen.c f +lib/sh/oslib.c f +lib/sh/pathcanon.c f +lib/sh/pathphys.c f +lib/sh/rename.c f +lib/sh/setlinebuf.c f +lib/sh/shmatch.c f +lib/sh/shmbchar.c f +lib/sh/shquote.c f +lib/sh/shtty.c f +lib/sh/snprintf.c f +lib/sh/spell.c f +lib/sh/strcasecmp.c f +lib/sh/strcasestr.c f +lib/sh/strchrnul.c f +lib/sh/strdup.c f +lib/sh/strerror.c f +lib/sh/strftime.c f +lib/sh/stringlist.c f +lib/sh/stringvec.c f +lib/sh/strnlen.c f +lib/sh/strpbrk.c f +lib/sh/strstr.c f +lib/sh/strtod.c f +lib/sh/strtoimax.c f +lib/sh/strtol.c f +lib/sh/strtoll.c f +lib/sh/strtoul.c f +lib/sh/strtoull.c f +lib/sh/strtoumax.c f +lib/sh/strtrans.c f +lib/sh/times.c f +lib/sh/timeval.c f +lib/sh/tmpfile.c f +lib/sh/uconvert.c f +lib/sh/ufuncs.c f +lib/sh/unicode.c f +lib/sh/vprint.c f +lib/sh/wcsdup.c f +lib/sh/wcsnwidth.c f +lib/sh/wcswidth.c f +lib/sh/winsize.c f +lib/sh/zcatfd.c f +lib/sh/zgetline.c f +lib/sh/zmapfd.c f +lib/sh/zread.c f +lib/sh/zwrite.c f +lib/termcap/Makefile.in f +lib/termcap/ltcap.h f +lib/termcap/termcap.c f +lib/termcap/termcap.h f +lib/termcap/tparam.c f +lib/termcap/version.c f +lib/tilde/README f +lib/tilde/Makefile.in f +lib/tilde/tilde.c f +lib/tilde/tilde.h f +lib/tilde/shell.c f +m4/stat-time.m4 f +m4/timespec.m4 f +po/LINGUAS f +po/Makefile.in.in f +po/Makevars f +po/POTFILES.in f +po/README f +po/Rules-builtins f +po/Rules-quot f +po/bash.pot f +po/boldquot.sed f +po/en@boldquot.gmo f +po/en@boldquot.header f +po/en@boldquot.po f +po/en@quot.gmo f +po/en@quot.header f +po/en@quot.po f +po/af.gmo f +po/af.po f +po/bg.gmo f +po/bg.po f +po/ca.gmo f +po/ca.po f +po/cs.gmo f +po/cs.po f +po/da.gmo f +po/da.po f +po/de.gmo f +po/de.po f +po/el.gmo f +po/el.po f +po/eo.gmo f +po/eo.po f +po/es.gmo f +po/es.po f +po/et.gmo f +po/et.po f +po/fi.gmo f +po/fi.po f +po/fr.gmo f +po/fr.po f +po/ga.gmo f +po/ga.po f +po/gl.gmo f +po/gl.po f +po/hr.gmo f +po/hr.po f +po/hu.gmo f +po/hu.po f +po/id.gmo f +po/id.po f +po/it.gmo f +po/it.po f +po/ja.gmo f +po/ja.po f +po/lt.gmo f +po/lt.po f +po/nl.gmo f +po/nl.po f +po/pl.gmo f +po/pl.po f +po/pt_BR.gmo f +po/pt_BR.po f +po/ro.gmo f +po/ro.po f +po/ru.gmo f +po/ru.po f +po/sk.gmo f +po/sk.po f +po/sl.gmo f +po/sr.po f +po/sr.gmo f +po/sl.po f +po/sv.gmo f +po/sv.po f +po/tr.gmo f +po/tr.po f +po/uk.gmo f +po/uk.po f +po/vi.gmo f +po/vi.po f +po/zh_CN.gmo f +po/zh_CN.po f +po/zh_TW.gmo f +po/zh_TW.po f +po/insert-header.sin f +po/quot.sed f +po/remove-potcdate.sin f +CWRU/misc/open-files.c f +CWRU/misc/sigs.c f +CWRU/misc/sigstat.c f +CWRU/misc/bison f +CWRU/misc/errlist.c f +CWRU/misc/hpux10-dlfcn.h f +CWRU/PLATFORMS f +CWRU/README f +CWRU/changelog f +CWRU/sh-redir-hack f +doc/FAQ f +doc/Makefile.in f +doc/bash.1 f +doc/bashbug.1 f +doc/builtins.1 f +doc/rbash.1 f +doc/README f +doc/INTRO f +doc/texinfo.tex f +doc/bashref.texi f +doc/version.texi f +doc/bashref.info f +doc/article.ms f +doc/htmlpost.sh f 755 +doc/infopost.sh f 755 +doc/fdl.texi f +doc/fdl.txt f +# +doc/article.ps f +doc/rose94.ps f +doc/bash.ps f +doc/bashbug.ps f +doc/builtins.ps f +doc/rbash.ps f +doc/bashref.ps f +doc/bashref.dvi f +doc/bash.0 f +doc/bashbug.0 f +doc/builtins.0 f +doc/rbash.0 f +doc/article.txt f +doc/bash.html f +doc/bashref.html f +doc/article.pdf f +doc/bash.pdf f +doc/bashref.pdf f +doc/rose94.pdf f +doc/aosa-bash.pdf f +# +support/Makefile.in f +support/bashversion.c f +support/checkbashisms f 755 +support/config.guess f +support/config.rpath f 755 +support/config.sub f +support/printenv.sh f 755 +support/printenv.c f +support/bash.xbm f +support/missing f 755 +support/mkclone f 755 +support/mkconffiles f 755 +support/mkdirs f 755 +support/mkinstalldirs f 755 +support/mkversion.sh f 755 +support/mksignames.c f +support/signames.c f +support/bashbug.sh f +support/man2html.c f +support/recho.c f +support/zecho.c f +support/xcase.c f +support/SYMLINKS f +support/fixlinks f 755 +support/install.sh f 755 +support/texi2dvi f 755 +support/texi2html f 755 +support/xenix-link.sh f 755 +support/shobj-conf f 755 +support/rlvers.sh f 755 +examples/INDEX.txt f +examples/INDEX.html f +#examples/obashdb/PERMISSION f +#examples/obashdb/README f +#examples/obashdb/bashdb f +#examples/obashdb/bashdb.el f +examples/complete/bash_completion f +examples/complete/cdfunc f +examples/complete/complete-examples f +#examples/complete/complete.ianmac f +#examples/complete/complete2.ianmac f +#examples/complete/complete.freebsd f +#examples/complete/complete.gnu-longopt f +examples/complete/bashcc-1.0.1.tar.gz f +examples/loadables/README f +examples/loadables/template.c f +examples/loadables/Makefile.in f +examples/loadables/necho.c f +examples/loadables/hello.c f +examples/loadables/print.c f +examples/loadables/realpath.c f +examples/loadables/sleep.c f +examples/loadables/strftime.c f +examples/loadables/truefalse.c f +#examples/loadables/getconf.h f +#examples/loadables/getconf.c f +examples/loadables/finfo.c f +examples/loadables/cat.c f +#examples/loadables/cut.c f +examples/loadables/logname.c f +examples/loadables/basename.c f +examples/loadables/dirname.c f +examples/loadables/tty.c f +examples/loadables/pathchk.c f +examples/loadables/tee.c f +examples/loadables/rmdir.c f +examples/loadables/head.c f +examples/loadables/printenv.c f +examples/loadables/push.c f +examples/loadables/id.c f +examples/loadables/whoami.c f +examples/loadables/uname.c f +examples/loadables/sync.c f +examples/loadables/mkdir.c f +examples/loadables/ln.c f +examples/loadables/mypid.c f +examples/loadables/unlink.c f +examples/loadables/perl/Makefile.in f +examples/loadables/perl/README f +examples/loadables/perl/bperl.c f +examples/loadables/perl/iperl.c f +#examples/loadables/sprintf.c f +#examples/loadables/xtitle.c f +examples/functions/array-stuff f +examples/functions/array-to-string f +examples/functions/autoload f +examples/functions/autoload.v2 f +examples/functions/autoload.v3 f +examples/functions/basename f +#examples/functions/basename2 f +#examples/functions/coproc.bash f +#examples/functions/coshell.README f +#examples/functions/coshell.bash f +examples/functions/csh-compat f +#examples/functions/dirfuncs f +examples/functions/dirname f +#examples/functions/emptydir f +examples/functions/exitstat f +examples/functions/external f +examples/functions/fact f +examples/functions/fstty f +examples/functions/func f +#examples/functions/gethtml f +#examples/functions/getoptx.bash f +examples/functions/inetaddr f +examples/functions/inpath f +#examples/functions/isnum.bash f +examples/functions/isnum2 f +examples/functions/isvalidip f +#examples/functions/jdate.bash f +#examples/functions/jj.bash f +#examples/functions/keep f +examples/functions/ksh-cd f +examples/functions/ksh-compat-test f +examples/functions/kshenv f +examples/functions/login f +#examples/functions/lowercase f +#examples/functions/manpage f +#examples/functions/mhfold f +#examples/functions/newdirstack.bsh f +examples/functions/notify.bash f +#examples/functions/pathfuncs f +#examples/functions/recurse f +#examples/functions/repeat2 f +#examples/functions/repeat3 f +examples/functions/seq f +examples/functions/seq2 f +examples/functions/shcat f +examples/functions/shcat2 f +examples/functions/sort-pos-params f +#examples/functions/sqroot f +examples/functions/substr f +examples/functions/substr2 f +#examples/functions/term f +examples/functions/whatis f +examples/functions/whence f +examples/functions/which f +#examples/functions/xalias.bash f +#examples/functions/xfind.bash f +#examples/scripts/adventure.sh f +#examples/scripts/bash-hexdump.sh f +#examples/scripts/bcsh.sh f +examples/scripts/cat.sh f +examples/scripts/center f +#examples/scripts/dd-ex.sh f +#examples/scripts/fixfiles.bash f +#examples/scripts/hanoi.bash f +examples/scripts/inpath f +#examples/scripts/krand.bash f +#examples/scripts/line-input.bash f +#examples/scripts/nohup.bash f +#examples/scripts/precedence f +#examples/scripts/randomcard.bash f +#examples/scripts/scrollbar f +#examples/scripts/scrollbar2 f +#examples/scripts/self-repro f +#examples/scripts/showperm.bash f +examples/scripts/shprompt f +examples/scripts/spin.bash f +#examples/scripts/timeout f +#examples/scripts/timeout2 f +#examples/scripts/timeout3 f +#examples/scripts/vtree2 f +#examples/scripts/vtree3 f +#examples/scripts/vtree3a f +#examples/scripts/websrv.sh f +examples/scripts/xterm_title f +examples/scripts/zprintf f +examples/startup-files/README f +examples/startup-files/Bashrc.bfox f +examples/startup-files/Bash_aliases f +examples/startup-files/Bash_profile f +examples/startup-files/bash-profile f +examples/startup-files/bashrc f +#examples/startup-files/apple/README f +#examples/startup-files/apple/aliases f +#examples/startup-files/apple/bash.defaults f +#examples/startup-files/apple/environment f +#examples/startup-files/apple/login f +#examples/startup-files/apple/logout f +#examples/startup-files/apple/rc f +#examples/misc/suncmd.termcap f +examples/misc/aliasconv.sh f +examples/misc/aliasconv.bash f +examples/misc/cshtobash f +tests/README f +tests/COPYRIGHT f +tests/alias.tests f +tests/alias1.sub f +tests/alias.right f +tests/appendop.tests f +tests/appendop1.sub f +tests/appendop2.sub f +tests/appendop.right f +tests/arith-for.tests f +tests/arith-for.right f +tests/arith.tests f +tests/arith.right f +tests/arith1.sub f +tests/arith2.sub f +tests/arith3.sub f +tests/arith4.sub f +tests/arith5.sub f +tests/arith6.sub f +tests/array.tests f +tests/array.right f +tests/array1.sub f +tests/array2.sub f +tests/array3.sub f +tests/array4.sub f +tests/array5.sub f +tests/array6.sub f +tests/array7.sub f +tests/array8.sub f +tests/array9.sub f +tests/array10.sub f +tests/array11.sub f +tests/array12.sub f +tests/array13.sub f +tests/array14.sub f +tests/array15.sub f +tests/array16.sub f +tests/array-at-star f +tests/array2.right f +tests/assoc.tests f +tests/assoc.right f +tests/assoc1.sub f +tests/assoc2.sub f +tests/assoc3.sub f +tests/assoc4.sub f +tests/assoc5.sub f +tests/assoc6.sub f +tests/assoc7.sub f +tests/braces.tests f +tests/braces.right f +tests/builtins.tests f +tests/builtins.right f +tests/builtins1.sub f +tests/builtins2.sub f +tests/builtins3.sub f +tests/builtins4.sub f +tests/source1.sub f +tests/source2.sub f +tests/source3.sub f +tests/source4.sub f +tests/source5.sub f +tests/source6.sub f +tests/source7.sub f +tests/case.tests f +tests/case.right f +tests/case1.sub f +tests/casemod.tests f +tests/casemod.right f +tests/comsub.tests f +tests/comsub.right f +tests/comsub1.sub f +tests/comsub-eof.tests f +tests/comsub-eof0.sub f +tests/comsub-eof1.sub f +tests/comsub-eof2.sub f +tests/comsub-eof3.sub f +tests/comsub-eof4.sub f +tests/comsub-eof5.sub f +tests/comsub-eof.right f +tests/comsub-posix.tests f +tests/comsub-posix.right f +tests/comsub-posix1.sub f +tests/comsub-posix2.sub f +tests/comsub-posix3.sub f +tests/cond.tests f +tests/cond.right f +tests/cond-regexp1.sub f +tests/cond-regexp2.sub f +tests/cond-regexp3.sub f +tests/coproc.tests f +tests/coproc.right f +tests/cprint.tests f +tests/cprint.right f +tests/dbg-support.right f +tests/dbg-support.sub f +tests/dbg-support.tests f +tests/dbg-support2.right f +tests/dbg-support2.tests f +tests/dbg-support3.sub f +tests/dollar-at-star f +tests/dollar-at-star1.sub f +tests/dollar-at1.sub f +tests/dollar-at2.sub f +tests/dollar-at3.sub f +tests/dollar-at4.sub f +tests/dollar-at5.sub f +tests/dollar-at6.sub f +tests/dollar-star1.sub f +tests/dollar-star2.sub f +tests/dollar-star3.sub f +tests/dollar-star4.sub f +tests/dollar-star5.sub f +tests/dollar-star6.sub f +tests/dollar-star7.sub f +tests/dollar.right f +tests/dstack.tests f +tests/dstack.right f +tests/dstack2.tests f +tests/dstack2.right f +tests/errors.tests f +tests/errors.right f +tests/errors1.sub f +tests/errors2.sub f +tests/errors3.sub f +tests/execscript f +tests/exec.right f +tests/exec1.sub f 755 +tests/exec2.sub f +tests/exec3.sub f +tests/exec4.sub f +tests/exec5.sub f +tests/exec6.sub f +tests/exec7.sub f +tests/exec8.sub f +tests/exec9.sub f +tests/exp.tests f +tests/exp.right f +tests/exp1.sub f +tests/exp2.sub f +tests/exp3.sub f +tests/exp4.sub f +tests/exp5.sub f +tests/exp6.sub f +tests/extglob.tests f +tests/extglob.right f +tests/extglob1.sub f +tests/extglob1a.sub f +tests/extglob2.tests f +tests/extglob2.right f +tests/extglob3.tests f +tests/extglob3.right f +tests/func.tests f +tests/func.right f +tests/func1.sub f +tests/func2.sub f +tests/func3.sub f +tests/func4.sub f +tests/getopts.tests f +tests/getopts.right f +tests/getopts1.sub f +tests/getopts2.sub f +tests/getopts3.sub f +tests/getopts4.sub f +tests/getopts5.sub f +tests/getopts6.sub f +tests/getopts7.sub f +tests/glob.tests f +tests/glob1.sub f +tests/glob.right f +tests/globstar.tests f +tests/globstar.right f +tests/globstar1.sub f +tests/globstar2.sub f +tests/heredoc.tests f +tests/heredoc.right f +tests/heredoc1.sub f +tests/heredoc2.sub f +tests/heredoc3.sub f +tests/herestr.tests f +tests/herestr.right f +tests/histexp.tests f +tests/histexp.right f +tests/history.tests f +tests/history.right f +tests/history.list f 444 +tests/history1.sub f +tests/history2.sub f +tests/ifs.tests f +tests/ifs.right f +tests/ifs-posix.tests f +tests/ifs-posix.right f +tests/input-line.sh f +tests/input-line.sub f +tests/input.right f +tests/intl.tests f +tests/intl1.sub f +tests/intl2.sub f +tests/intl.right f +tests/iquote.tests f +tests/iquote.right f +tests/iquote1.sub f +tests/invert.tests f +tests/invert.right f +tests/jobs.tests f +tests/jobs1.sub f +tests/jobs2.sub f +tests/jobs3.sub f +tests/jobs4.sub f +tests/jobs5.sub f +tests/jobs.right f +tests/lastpipe.right f +tests/lastpipe.tests f +tests/lastpipe1.sub f +tests/mapfile.data f +tests/mapfile.right f +tests/mapfile.tests f +tests/mapfile1.sub f +tests/more-exp.tests f +tests/more-exp.right f +tests/nameref.tests f +tests/nameref1.sub f +tests/nameref2.sub f +tests/nameref3.sub f +tests/nameref4.sub f +tests/nameref5.sub f +tests/nameref6.sub f +tests/nameref7.sub f +tests/nameref8.sub f +tests/nameref.right f +tests/new-exp.tests f +tests/new-exp1.sub f +tests/new-exp2.sub f +tests/new-exp3.sub f +tests/new-exp4.sub f +tests/new-exp5.sub f +tests/new-exp6.sub f +tests/new-exp7.sub f +tests/new-exp8.sub f +tests/new-exp9.sub f +tests/new-exp.right f +tests/nquote.tests f +tests/nquote.right f +tests/nquote1.sub f +tests/nquote2.sub f +tests/nquote1.tests f +tests/nquote1.right f +tests/nquote2.tests f +tests/nquote2.right f +tests/nquote3.tests f +tests/nquote3.right f +tests/nquote4.tests f +tests/nquote4.right f +tests/nquote5.tests f +tests/nquote5.right f +tests/posix2.tests f +tests/posix2.right f +tests/posixexp.tests f +tests/posixexp.right f +tests/posixexp1.sub f +tests/posixexp2.sub f +tests/posixexp2.tests f +tests/posixexp2.right f +tests/posixpat.tests f +tests/posixpat.right f +tests/posixpipe.tests f +tests/posixpipe.right f +tests/prec.right f +tests/precedence f +tests/printf.tests f +tests/printf.right f +tests/printf1.sub f +tests/printf2.sub f +tests/printf3.sub f +tests/printf4.sub f +tests/quote.tests f +tests/quote.right f +tests/quote1.sub f +tests/read.tests f +tests/read.right f +tests/read1.sub f +tests/read2.sub f +tests/read3.sub f +tests/read4.sub f +tests/read5.sub f +tests/read6.sub f +tests/redir.tests f +tests/redir.right f +tests/redir1.sub f +tests/redir2.sub f +tests/redir3.sub f +tests/redir3.in1 f +tests/redir3.in2 f +tests/redir4.sub f +tests/redir4.in1 f +tests/redir5.sub f +tests/redir6.sub f +tests/redir7.sub f +tests/redir8.sub f +tests/redir9.sub f +tests/redir10.sub f +tests/rhs-exp.tests f +tests/rhs-exp.right f +tests/rhs-exp1.sub f +tests/rsh.tests f +tests/rsh.right f +tests/run-all f +tests/run-minimal f +tests/run-alias f +tests/run-appendop f +tests/run-arith-for f +tests/run-arith f +tests/run-array f +tests/run-array2 f +tests/run-assoc f +tests/run-braces f +tests/run-builtins f +tests/run-case f +tests/run-casemod f +tests/run-comsub f +tests/run-comsub-eof f +tests/run-comsub-posix f +tests/run-cond f +tests/run-coproc f +tests/run-cprint f +tests/run-dbg-support f +tests/run-dbg-support2 f +tests/run-dirstack f +tests/run-dollars f +tests/run-errors f +tests/run-execscript f +tests/run-exp-tests f +tests/run-extglob f +tests/run-extglob2 f +tests/run-extglob3 f +tests/run-func f +tests/run-getopts f +tests/run-glob-test f +tests/run-globstar f +tests/run-heredoc f +tests/run-herestr f +tests/run-histexpand f +tests/run-history f +tests/run-ifs f +tests/run-ifs-posix f +tests/run-input-test f +tests/run-intl f +tests/run-iquote f +tests/run-invert f +tests/run-jobs f +tests/run-lastpipe f +tests/run-mapfile f +tests/run-more-exp f +tests/run-nameref f +tests/run-new-exp f +tests/run-nquote f +tests/run-nquote1 f +tests/run-nquote2 f +tests/run-nquote3 f +tests/run-nquote4 f +tests/run-nquote5 f +tests/run-posix2 f +tests/run-posixexp f +tests/run-posixexp2 f +tests/run-posixpat f +tests/run-posixpipe f +tests/run-precedence f +tests/run-printf f +tests/run-quote f +tests/run-read f +tests/run-redir f +tests/run-rhs-exp f +tests/run-rsh f +tests/run-set-e f +tests/run-set-x f +tests/run-shopt f +tests/run-strip f +tests/run-test f +tests/run-tilde f +tests/run-tilde2 f +tests/run-trap f +tests/run-type f +tests/run-varenv f +tests/run-vredir f +tests/set-e.tests f +tests/set-e1.sub f +tests/set-e2.sub f +tests/set-e3.sub f +tests/set-e3a.sub f +tests/set-e.right f +tests/set-x.tests f +tests/set-x1.sub f +tests/set-x.right f +tests/shopt.tests f +tests/shopt.right f +tests/strip.tests f +tests/strip.right f +tests/test.tests f +tests/test.right f +tests/tilde.tests f +tests/tilde.right f +tests/tilde2.tests f +tests/tilde2.right f +tests/trap.tests f +tests/trap.right f +tests/trap1.sub f 755 +tests/trap2.sub f 755 +tests/trap2a.sub f 755 +tests/trap3.sub f +tests/trap4.sub f +tests/trap5.sub f +tests/type.tests f +tests/type.right f +tests/type1.sub f +tests/type2.sub f +tests/type3.sub f +tests/type4.sub f +tests/unicode1.sub f +tests/unicode2.sub f +tests/unicode3.sub f +tests/varenv.right f +tests/varenv.sh f +tests/varenv1.sub f +tests/varenv2.sub f +tests/varenv3.sub f +tests/varenv4.sub f +tests/varenv5.sub f +tests/varenv6.sub f +tests/version f +tests/version.mini f +tests/vredir.tests f +tests/vredir.right f +tests/vredir1.sub f +tests/vredir2.sub f +tests/vredir3.sub f +tests/vredir4.sub f +tests/vredir5.sub f +tests/vredir6.sub f +tests/misc/dev-tcp.tests f +tests/misc/perf-script f +tests/misc/perftest f +tests/misc/read-nchars.tests f +tests/misc/redir-t2.sh f +tests/misc/run-r2.sh f +tests/misc/sigint-1.sh f +tests/misc/sigint-2.sh f +tests/misc/sigint-3.sh f +tests/misc/sigint-4.sh f +tests/misc/test-minus-e.1 f +tests/misc/test-minus-e.2 f +tests/misc/wait-bg.tests f +#examples/scripts.v2/PERMISSION f +#examples/scripts.v2/README f +#examples/scripts.v2/arc2tarz f +#examples/scripts.v2/bashrand f +#examples/scripts.v2/cal2day.bash f +#examples/scripts.v2/cdhist.bash f +#examples/scripts.v2/corename f +#examples/scripts.v2/fman f +#examples/scripts.v2/frcp f +#examples/scripts.v2/lowercase f +#examples/scripts.v2/ncp f +#examples/scripts.v2/newext f +#examples/scripts.v2/nmv f +#examples/scripts.v2/pages f +#examples/scripts.v2/pf f +#examples/scripts.v2/ren f +#examples/scripts.v2/rename f +#examples/scripts.v2/repeat f +#examples/scripts.v2/untar f +#examples/scripts.v2/uudec f +#examples/scripts.v2/uuenc f +#examples/scripts.v2/vtree f +#examples/scripts.v2/where f +#examples/scripts.v2/pmtop f +#examples/scripts.v2/shprof f +#examples/scripts.noah/PERMISSION f +#examples/scripts.noah/README f +#examples/scripts.noah/aref.bash f +#examples/scripts.noah/bash.sub.bash f +#examples/scripts.noah/bash_version.bash f +#examples/scripts.noah/meta.bash f +#examples/scripts.noah/mktmp.bash f +#examples/scripts.noah/number.bash f +#examples/scripts.noah/prompt.bash f +#examples/scripts.noah/remap_keys.bash f +#examples/scripts.noah/require.bash f +#examples/scripts.noah/send_mail.bash f +#examples/scripts.noah/shcat.bash f +#examples/scripts.noah/source.bash f +#examples/scripts.noah/string.bash f +#examples/scripts.noah/stty.bash f +#examples/scripts.noah/y_or_n_p.bash f diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..cf77228 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,1554 @@ +# Makefile for bash-4.3, version 4.11 +# +# Copyright (C) 1996-2012 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Make sure the first target in the makefile is the right one +all: .made + +PACKAGE = @PACKAGE_NAME@ +VERSION = @PACKAGE_VERSION@ + +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_VERSION = @PACKAGE_VERSION@ + +PACKAGE_TARNAME = @PACKAGE_TARNAME@ + +# Include some boilerplate Gnu makefile definitions. +prefix = @prefix@ + +exec_prefix = @exec_prefix@ + +datarootdir = @datarootdir@ + +bindir = @bindir@ +libdir = @libdir@ +infodir = @infodir@ +includedir = @includedir@ +datadir = @datadir@ +localedir = @localedir@ + +docdir = @docdir@ + +mandir = @mandir@ +manpfx = man + +man1ext = .1 +man1dir = $(mandir)/$(manpfx)1 +man3ext = .3 +man3dir = $(mandir)/$(manpfx)3 + +htmldir = @htmldir@ + +# Support an alternate destination root directory for package building +DESTDIR = + +topdir = @top_srcdir@ +BUILD_DIR = @BUILD_DIR@ +top_builddir = @BUILD_DIR@ +srcdir = @srcdir@ +VPATH = .:@srcdir@ + +@SET_MAKE@ +CC = @CC@ +CC_FOR_BUILD = @CC_FOR_BUILD@ +YACC = @YACC@ +SHELL = @MAKE_SHELL@ +CP = cp +RM = rm -f +AR = @AR@ +ARFLAGS = @ARFLAGS@ +RANLIB = @RANLIB@ +SIZE = @SIZE@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALLMODE= -m 0755 +INSTALLMODE2 = -m 0555 + +TESTSCRIPT = @TESTSCRIPT@ + +DEBUGGER_START_FILE = @DEBUGGER_START_FILE@ + +#If you have purify, and want to use it, uncomment this definition or +# run the make as `make PURIFY=purify' +# or run configure with the --with-purify argument. +PURIFY = @PURIFY@ + +# Here is a rule for making .o files from .c files that does not +# force the type of the machine (like -M_MACHINE) into the flags. +.c.o: + $(RM) $@ + $(CC) $(CCFLAGS) -c $< + +EXEEXT = @EXEEXT@ +OBJEXT = @OBJEXT@ + +# The name of this program and some version information. +VERSPROG = bashversion$(EXEEXT) +VERSOBJ = bashversion.$(OBJEXT) + +Program = bash$(EXEEXT) +Version = @BASHVERS@ +PatchLevel = `$(BUILD_DIR)/$(VERSPROG) -p` +RELSTATUS = @RELSTATUS@ + +Machine = @host_cpu@ +OS = @host_os@ +VENDOR = @host_vendor@ +MACHTYPE = @host@ + +# comment out for release +DEBUG = @DEBUG@ +MALLOC_DEBUG = @MALLOC_DEBUG@ + +THIS_SH = $(BUILD_DIR)/$(Program) + +# PROFILE_FLAGS is either -pg, to generate profiling info for use +# with gprof, or nothing (the default). +PROFILE_FLAGS= @PROFILE_FLAGS@ + +CFLAGS = @CFLAGS@ +CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ @CROSS_COMPILE@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ +LOCAL_CFLAGS = @LOCAL_CFLAGS@ ${DEBUG} ${MALLOC_DEBUG} +DEFS = @DEFS@ +LOCAL_DEFS = @LOCAL_DEFS@ + +LOCALE_DEFS = -DLOCALEDIR='"$(localedir)"' -DPACKAGE='"$(PACKAGE)"' + +LOCAL_LIBS = @LOCAL_LIBS@ +LIBS = $(BUILTINS_LIB) $(LIBRARIES) @LIBS@ +LIBS_FOR_BUILD = + +STATIC_LD = @STATIC_LD@ +LOCAL_LDFLAGS = @LOCAL_LDFLAGS@ + +SYSTEM_FLAGS = -DPROGRAM='"$(Program)"' -DCONF_HOSTTYPE='"$(Machine)"' -DCONF_OSTYPE='"$(OS)"' -DCONF_MACHTYPE='"$(MACHTYPE)"' -DCONF_VENDOR='"$(VENDOR)"' $(LOCALE_DEFS) + +BASE_CCFLAGS = $(PROFILE_FLAGS) $(SYSTEM_FLAGS) $(LOCAL_DEFS) \ + $(DEFS) $(LOCAL_CFLAGS) $(INCLUDES) + +CCFLAGS = $(BASE_CCFLAGS) $(CPPFLAGS) $(CFLAGS) + +CCFLAGS_FOR_BUILD = $(BASE_CCFLAGS) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) + +LDFLAGS = @LDFLAGS@ $(STATIC_LD) $(LOCAL_LDFLAGS) $(PROFILE_FLAGS) $(CFLAGS) +LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ $(LOCAL_LDFLAGS) $(CFLAGS_FOR_BUILD) + +INCLUDES = -I. @RL_INCLUDE@ -I$(srcdir) -I$(BASHINCDIR) -I$(LIBSRC) $(INTL_INC) + +# Maybe add: -Wextra +GCC_LINT_FLAGS = -O -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wno-parentheses \ + -Wcast-align -Wstrict-prototypes -Wconversion -Wformat \ + -Wformat-nonliteral -Wmissing-braces -Wuninitialized \ + -Wmissing-declarations -Winline \ + -Wmissing-prototypes -Wtraditional -Wredundant-decls -pedantic + +GCC_LINT_CFLAGS = $(BASE_CCFLAGS) $(CPPFLAGS) $(GCC_LINT_FLAGS) + +# +# Support libraries +# + +dot = . + +LIBSUBDIR = lib +LIBSRC = $(srcdir)/$(LIBSUBDIR) + +LIBBUILD = ${BUILD_DIR}/${LIBSUBDIR} + +SUBDIR_INCLUDES = -I. @RL_INCLUDE@ -I$(topdir) -I$(topdir)/$(LIBSUBDIR) + +BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ + +# the bash library +# the library is a mix of functions that the C library does not provide on +# some platforms and general shell utility functions +SH_LIBSRC = $(LIBSRC)/sh +SH_LIBDIR = $(dot)/${LIBSUBDIR}/sh +SH_ABSSRC = ${topdir}/${SH_LIBSRC} + +SHLIB_SOURCE = ${SH_LIBSRC}/clktck.c ${SH_LIBSRC}/getcwd.c \ + ${SH_LIBSRC}/getenv.c ${SH_LIBSRC}/oslib.c \ + ${SH_LIBSRC}/setlinebuf.c ${SH_LIBSRC}/strchrnul.c \ + ${SH_LIBSRC}/strcasecmp.c ${SH_LIBSRC}/strdup.c \ + ${SH_LIBSRC}/strerror.c \ + ${SH_LIBSRC}/strtod.c ${SH_LIBSRC}/strtol.c \ + ${SH_LIBSRC}/strtoul.c ${SH_LIBSRC}/vprint.c \ + ${SH_LIBSRC}/itos.c ${SH_LIBSRC}/rename.c \ + ${SH_LIBSRC}/zread.c ${SH_LIBSRC}/zwrite.c \ + ${SH_LIBSRC}/shtty.c ${SH_LIBSRC}/inet_aton.c \ + ${SH_LIBSRC}/netopen.c ${SH_LIBSRC}/strpbrk.c \ + ${SH_LIBSRC}/timeval.c ${SH_LIBSRC}/clock.c \ + ${SH_LIBSRC}/makepath.c ${SH_LIBSRC}/pathcanon.c \ + ${SH_LIBSRC}/pathphys.c ${SH_LIBSRC}/stringlist.c \ + ${SH_LIBSRC}/stringvec.c ${SH_LIBSRC}/tmpfile.c \ + ${SH_LIBSRC}/spell.c ${SH_LIBSRC}/strtrans.c \ + ${SH_LIBSRC}/strcasestr.c ${SH_LIBSRC}/shquote.c \ + ${SH_LIBSRC}/snprintf.c ${SH_LIBSRC}/mailstat.c \ + ${SH_LIBSRC}/fmtulong.c ${SH_LIBSRC}/fmtullong.c \ + ${SH_LIBSRC}/strtoll.c ${SH_LIBSRC}/strtoull.c \ + ${SH_LIBSRC}/strtoimax.c ${SH_LIBSRC}/strtoumax.c \ + ${SH_LIBSRC}/fmtumax.c ${SH_LIBSRC}/netconn.c \ + ${SH_LIBSRC}/mktime.c ${SH_LIBSRC}/strftime.c \ + ${SH_LIBSRC}/memset.c ${SH_LIBSRC}/mbschr.c \ + ${SH_LIBSRC}/zcatfd.c ${SH_LIBSRC}/shmatch.c \ + ${SH_LIBSRC}/strnlen.c ${SH_LIBSRC}/winsize.c \ + ${SH_LIBSRC}/eaccess.c ${SH_LIBSRC}/wcsdup.c \ + ${SH_LIBSRC}/zmapfd.c ${SH_LIBSRC}/fpurge.c \ + ${SH_LIBSRC}/zgetline.c ${SH_LIBSRC}/mbscmp.c \ + ${SH_LIBSRC}/casemod.c ${SH_LIBSRC}/uconvert.c \ + ${SH_LIBSRC}/ufuncs.c ${SH_LIBSRC}/dprintf.c \ + ${SH_LIBSRC}/input_avail.c ${SH_LIBSRC}/mbscasecmp.c \ + ${SH_LIBSRC}/fnxform.c ${SH_LIBSRC}/unicode.c \ + ${SH_LIBSRC}/wcswidth.c ${SH_LIBSRC}/wcsnwidth.c \ + ${SH_LIBSRC}/shmbchar.c + +SHLIB_LIB = -lsh +SHLIB_LIBNAME = libsh.a +SHLIB_LIBRARY = ${SH_LIBDIR}/${SHLIB_LIBNAME} +SHLIB_LDFLAGS = -L${SH_LIBDIR} +SHLIB_DEP = ${SHLIB_LIBRARY} + +# we assume for now that readline source is being shipped with bash +RL_LIBSRC = $(LIBSRC)/readline +RL_LIBDOC = $(RL_LIBSRC)/doc +RL_LIBDIR = @RL_LIBDIR@ +RL_ABSSRC = ${topdir}/$(RL_LIBDIR) + +RL_INCLUDEDIR = @RL_INCLUDEDIR@ + +READLINE_LIB = @READLINE_LIB@ +READLINE_LIBRARY = $(RL_LIBDIR)/libreadline.a +READLINE_LDFLAGS = -L${RL_LIBDIR} +READLINE_DEP = @READLINE_DEP@ + +# The source, object and documentation of the GNU Readline library. +READLINE_SOURCE = $(RL_LIBSRC)/rldefs.h $(RL_LIBSRC)/rlconf.h \ + $(RL_LIBSRC)/readline.h $(RL_LIBSRC)/tcap.h \ + $(RL_LIBSRC)/chardefs.h $(RL_LIBSRC)/keymaps.h \ + $(RL_LIBSRC)/history.h $(RL_LIBSRC)/histlib.h \ + $(RL_LIBSRC)/posixstat.h $(RL_LIBSRC)/tilde.h \ + $(RL_LIBSRC)/rlstdc.h ${RL_LIBSRC}/xmalloc.h \ + $(RL_LIBSRC)/rlshell.h ${RL_LIBSRC}/rlprivate.h \ + $(RL_LIBSRC)/colors.h $(RL_LIBSRC)/parse-colors.h \ + $(RL_LIBSRC)/funmap.c $(RL_LIBSRC)/emacs_keymap.c \ + $(RL_LIBSRC)/search.c $(RL_LIBSRC)/vi_keymap.c \ + $(RL_LIBSRC)/keymaps.c $(RL_LIBSRC)/parens.c \ + $(RL_LIBSRC)/vi_mode.c $(RL_LIBSRC)/callback.c \ + $(RL_LIBSRC)/readline.c $(RL_LIBSRC)/tilde.c \ + $(RL_LIBSRC)/rltty.c $(RL_LIBSRC)/complete.c \ + $(RL_LIBSRC)/bind.c $(RL_LIBSRC)/isearch.c \ + $(RL_LIBSRC)/display.c $(RL_LIBSRC)/signals.c \ + $(RL_LIBSRC)/util.c $(RL_LIBSRC)/kill.c $(RL_LIBSRC)/text.c \ + $(RL_LIBSRC)/undo.c $(RL_LIBSRC)/macro.c \ + $(RL_LIBSRC)/terminal.c $(RL_LIBSRC)/nls.c \ + $(RL_LIBSRC)/input.c $(RL_LIBSRC)/xmalloc.c \ + $(RL_LIBSRC)/shell.c $(RL_LIBSRC)/savestring.c \ + $(RL_LIBSRC)/colors.c $(RL_LIBSRC)/parse-colors.c \ + $(RL_LIBSRC)/misc.c $(RL_LIBSRC)/mbutil.c $(RL_LIBSRC)/compat.c \ + $(RL_LIBSRC)/histexpand.c $(RL_LIBSRC)/history.c \ + $(RL_LIBSRC)/histsearch.c $(RL_LIBSRC)/histfile.c + +READLINE_OBJ = $(RL_LIBDIR)/readline.o $(RL_LIBDIR)/funmap.o \ + $(RL_LIBDIR)/parens.o $(RL_LIBDIR)/search.o \ + $(RL_LIBDIR)/keymaps.o $(RL_LIBDIR)/xmalloc.o \ + $(RL_LIBDIR)/rltty.o $(RL_LIBDIR)/complete.o \ + $(RL_LIBDIR)/bind.o $(RL_LIBDIR)/isearch.o \ + $(RL_LIBDIR)/display.o $(RL_LIBDIR)/signals.o \ + $(RL_LIBDIR)/tilde.o $(RL_LIBDIR)/util.o \ + $(RL_LIBDIR)/kill.o $(RL_LIBDIR)/undo.o $(RL_LIBDIR)/nls.o \ + $(RL_LIBDIR)/macro.o $(RL_LIBDIR)/input.o \ + $(RL_LIBDIR)/terminal.o $(RL_LIBDIR)/callback.o \ + $(RL_LIBDIR)/shell.o $(RL_LIBDIR)/savestring.o \ + $(RL_LIBDIR)/mbutil.o $(RL_LIBDIR)/compat.o \ + $(RL_LIBDIR)/history.o $(RL_LIBDIR)/histexpand.o \ + $(RL_LIBDIR)/histsearch.o $(RL_LIBDIR)/histfile.o \ + $(RL_LIBDIR)/colors.o $(RL_LIBDIR)/parse-colors.o + +HIST_LIBSRC = $(LIBSRC)/readline +HIST_LIBDIR = @HIST_LIBDIR@ +HIST_ABSSRC = ${topdir}/$(HIST_LIBDIR) + +HISTORY_LIB = @HISTORY_LIB@ +HISTORY_LIBRARY = $(HIST_LIBDIR)/libhistory.a +HISTORY_LDFLAGS = -L$(HIST_LIBDIR) +HISTORY_DEP = @HISTORY_DEP@ + +# The source, object and documentation of the history library. +HISTORY_SOURCE = $(HIST_LIBSRC)/history.c $(HIST_LIBSRC)/histexpand.c \ + $(HIST_LIBSRC)/histsearch.c $(HIST_LIBSRC)/histfile.c \ + $(HIST_LIBSRC)/shell.c \ + $(HIST_LIBSRC)/history.h $(HIST_LIBSRC)/histlib.h +HISTORY_OBJ = $(HIST_LIBDIR)/history.o $(HIST_LIBDIR)/histexpand.o \ + $(HIST_LIBDIR)/histsearch.o $(HIST_LIBDIR)/histfile.o \ + $(HIST_LIBDIR)/shell.o + +# You only need termcap (or curses) if you are linking with GNU Readline. +TERM_LIBSRC = $(LIBSRC)/termcap +TERM_LIBDIR = $(dot)/$(LIBSUBDIR)/termcap +TERM_ABSSRC = ${topdir}/$(TERM_LIBDIR) + +TERMCAP_LIB = @TERMCAP_LIB@ +TERMCAP_LIBRARY = $(TERM_LIBDIR)/libtermcap.a +TERMCAP_LDFLAGS = -L$(TERM_LIBDIR) +TERMCAP_DEP = @TERMCAP_DEP@ + +TERMCAP_SOURCE = $(TERM_LIBSRC)/termcap.c $(TERM_LIBSRC)/tparam.c +TERMCAP_OBJ = $(TERM_LIBDIR)/termcap.o $(TERM_LIBDIR)/tparam.o + +GLOB_LIBSRC = $(LIBSRC)/glob +GLOB_LIBDIR = $(dot)/$(LIBSUBDIR)/glob +GLOB_ABSSRC = ${topdir}/$(GLOB_LIBDIR) + +GLOB_LIB = -lglob +GLOB_LIBRARY = $(GLOB_LIBDIR)/libglob.a +GLOB_LDFLAGS = -L$(GLOB_LIBDIR) +GLOB_DEP = $(GLOB_LIBRARY) + +GLOB_SOURCE = $(GLOB_LIBSRC)/glob.c $(GLOB_LIBSRC)/strmatch.c \ + $(GLOB_LIBSRC)/smatch.c $(GLOB_LIBSRC)/xmbsrtowcs.c \ + $(GLOB_LIBSRC)/glob_loop.c $(GLOB_LIBSRC)/sm_loop.c \ + $(GLOB_LIBSRC)/gmisc.c \ + $(GLOB_LIBSRC)/glob.h $(GLOB_LIBSRC)/strmatch.h +GLOB_OBJ = $(GLOB_LIBDIR)/glob.o $(GLOB_LIBDIR)/strmatch.o \ + $(GLOB_LIBDIR)/smatch.o $(GLOB_LIBDIR)/xmbsrtowcs.o \ + $(GLOB_LIBDIR)/gmisc.o + +# The source, object and documentation for the GNU Tilde library. +TILDE_LIBSRC = $(LIBSRC)/tilde +TILDE_LIBDIR = $(dot)/$(LIBSUBDIR)/tilde +TILDE_ABSSRC = ${topdir}/$(TILDE_LIBDIR) + +TILDE_LIB = @TILDE_LIB@ +TILDE_LIBRARY = $(TILDE_LIBDIR)/libtilde.a +TILDE_LDFLAGS = -L$(TILDE_LIBDIR) +TILDE_DEP = $(TILDE_LIBRARY) + +TILDE_SOURCE = $(TILDE_LIBSRC)/tilde.c $(TILDE_LIBSRC)/tilde.h +TILDE_OBJ = $(TILDE_LIBDIR)/tilde.o + +# libintl +INTL_LIBSRC = $(LIBSRC)/intl +INTL_LIBDIR = $(dot)/$(LIBSUBDIR)/intl +INTL_ABSSRC = ${topdir}/$(INTL_LIB) +INTL_BUILDDIR = ${LIBBUILD}/intl + +INTL_LIB = @LIBINTL@ +INTL_LIBRARY = $(INTL_LIBDIR)/libintl.a +INTL_DEP = @INTL_DEP@ +INTL_INC = @INTL_INC@ + +LIBINTL_H = @LIBINTL_H@ + +# libiconv +LIBICONV = @LIBICONV@ + +# tests +LIBINTL = @LIBINTL@ +LTLIBINTL = @LTLIBINTL@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ + +# Our malloc. +MALLOC_TARGET = @MALLOC_TARGET@ + +# set to alloca.o if we are using the C alloca in lib/malloc +ALLOCA = @ALLOCA@ + +ALLOC_LIBSRC = $(LIBSRC)/malloc +ALLOC_LIBDIR = $(dot)/$(LIBSUBDIR)/malloc +ALLOC_ABSSRC = ${topdir}/$(ALLOC_LIBDIR) + +MALLOC_SRC = @MALLOC_SRC@ +MALLOC_OTHERSRC = ${ALLOC_LIBSRC}/trace.c ${ALLOC_LIBSRC}/stats.c \ + ${ALLOC_LIBSRC}/table.c ${ALLOC_LIBSRC}/watch.c +MALLOC_SOURCE = ${ALLOC_LIBSRC}/${MALLOC_SRC} ${MALLOC_OTHERSRC} +MALLOC_CFLAGS = -DRCHECK -Dbotch=programming_error ${MALLOC_DEBUG} + +MALLOC_LIB = @MALLOC_LIB@ +MALLOC_LIBRARY = @MALLOC_LIBRARY@ +MALLOC_LDFLAGS = @MALLOC_LDFLAGS@ +MALLOC_DEP = @MALLOC_DEP@ + +ALLOC_HEADERS = $(ALLOC_LIBSRC)/getpagesize.h $(ALLOC_LIBSRC)/shmalloc.h \ + $(ALLOC_LIBSRC)/imalloc.h $(ALLOC_LIBSRC)/mstats.h \ + $(ALLOC_LIBSRC)/table.h $(ALLOC_LIBSRC)/watch.h + +$(MALLOC_LIBRARY): ${MALLOC_SOURCE} ${ALLOC_HEADERS} config.h + @(cd $(ALLOC_LIBDIR) && \ + $(MAKE) $(MFLAGS) \ + MALLOC_CFLAGS="$(MALLOC_CFLAGS)" ${MALLOC_TARGET} ) || exit 1 + +BASHINCDIR = ${srcdir}/include +BASHINCFILES = $(BASHINCDIR)/posixstat.h $(BASHINCDIR)/ansi_stdlib.h \ + $(BASHINCDIR)/filecntl.h $(BASHINCDIR)/posixdir.h \ + $(BASHINCDIR)/memalloc.h $(BASHINCDIR)/stdc.h \ + $(BASHINCDIR)/posixjmp.h $(BASHINCDIR)/posixwait.h \ + $(BASHINCDIR)/posixtime.h $(BASHINCDIR)/systimes.h \ + $(BASHINCDIR)/unionwait.h $(BASHINCDIR)/maxpath.h \ + $(BASHINCDIR)/shtty.h $(BASHINCDIR)/typemax.h \ + $(BASHINCDIR)/ocache.h + +LIBRARIES = $(GLOB_LIB) $(SHLIB_LIB) $(READLINE_LIB) $(HISTORY_LIB) $(TERMCAP_LIB) \ + $(TILDE_LIB) $(MALLOC_LIB) $(INTL_LIB) $(LIBICONV) $(LOCAL_LIBS) + +LIBDEP = $(GLOB_DEP) $(SHLIB_DEP) $(INTL_DEP) $(READLINE_DEP) $(HISTORY_DEP) $(TERMCAP_DEP) \ + $(TILDE_DEP) $(MALLOC_DEP) + +LIBRARY_LDFLAGS = $(READLINE_LDFLAGS) $(HISTORY_LDFLAGS) $(GLOB_LDFLAGS) \ + $(TILDE_LDFLAGS) $(MALLOC_LDFLAGS) $(SHLIB_LDFLAGS) + +# +# The shell itself +# + +# The main source code for the Bourne Again SHell. +CSOURCES = shell.c eval.c parse.y general.c make_cmd.c print_cmd.c y.tab.c \ + dispose_cmd.c execute_cmd.c variables.c $(GLOBC) version.c \ + expr.c copy_cmd.c flags.c subst.c hashcmd.c hashlib.c mailcheck.c \ + test.c trap.c alias.c jobs.c nojobs.c $(ALLOC_FILES) braces.c \ + input.c bashhist.c array.c arrayfunc.c assoc.c sig.c pathexp.c \ + unwind_prot.c siglist.c bashline.c bracecomp.c error.c \ + list.c stringlib.c locale.c findcmd.c redir.c \ + pcomplete.c pcomplib.c syntax.c xmalloc.c + +HSOURCES = shell.h flags.h trap.h hashcmd.h hashlib.h jobs.h builtins.h \ + general.h variables.h config.h $(ALLOC_HEADERS) alias.h \ + quit.h unwind_prot.h syntax.h ${GRAM_H} \ + command.h input.h error.h bashansi.h dispose_cmd.h make_cmd.h \ + subst.h externs.h siglist.h bashhist.h bashline.h bashtypes.h \ + array.h arrayfunc.h sig.h mailcheck.h bashintl.h bashjmp.h \ + execute_cmd.h parser.h pathexp.h pathnames.h pcomplete.h assoc.h \ + $(BASHINCFILES) + +SOURCES = $(CSOURCES) $(HSOURCES) $(BUILTIN_DEFS) + +# header files chosen based on running of configure +SIGNAMES_H = @SIGNAMES_H@ + +# object files chosen based on running of configure +JOBS_O = @JOBS_O@ +SIGLIST_O = @SIGLIST_O@ +SIGNAMES_O = @SIGNAMES_O@ + +# Matching object files. +OBJECTS = shell.o eval.o y.tab.o general.o make_cmd.o print_cmd.o $(GLOBO) \ + dispose_cmd.o execute_cmd.o variables.o copy_cmd.o error.o \ + expr.o flags.o $(JOBS_O) subst.o hashcmd.o hashlib.o mailcheck.o \ + trap.o input.o unwind_prot.o pathexp.o sig.o test.o version.o \ + alias.o array.o arrayfunc.o assoc.o braces.o bracecomp.o bashhist.o \ + bashline.o $(SIGLIST_O) list.o stringlib.o locale.o findcmd.o redir.o \ + pcomplete.o pcomplib.o syntax.o xmalloc.o $(SIGNAMES_O) + +# Where the source code of the shell builtins resides. +BUILTIN_SRCDIR=$(srcdir)/builtins +DEFSRC=$(BUILTIN_SRCDIR) +BUILTIN_ABSSRC=${topdir}/builtins +DEFDIR = $(dot)/builtins +DEBUGGER_DIR = $(dot)/debugger + +BUILTIN_DEFS = $(DEFSRC)/alias.def $(DEFSRC)/bind.def $(DEFSRC)/break.def \ + $(DEFSRC)/builtin.def $(DEFSRC)/cd.def $(DEFSRC)/colon.def \ + $(DEFSRC)/command.def ${DEFSRC}/complete.def \ + $(DEFSRC)/caller.def $(DEFSRC)/declare.def \ + $(DEFSRC)/echo.def $(DEFSRC)/enable.def $(DEFSRC)/eval.def \ + $(DEFSRC)/exec.def $(DEFSRC)/exit.def $(DEFSRC)/fc.def \ + $(DEFSRC)/fg_bg.def $(DEFSRC)/hash.def $(DEFSRC)/help.def \ + $(DEFSRC)/history.def $(DEFSRC)/jobs.def $(DEFSRC)/kill.def \ + $(DEFSRC)/let.def $(DEFSRC)/read.def $(DEFSRC)/return.def \ + $(DEFSRC)/set.def $(DEFSRC)/setattr.def $(DEFSRC)/shift.def \ + $(DEFSRC)/source.def $(DEFSRC)/suspend.def $(DEFSRC)/test.def \ + $(DEFSRC)/times.def $(DEFSRC)/trap.def $(DEFSRC)/type.def \ + $(DEFSRC)/ulimit.def $(DEFSRC)/umask.def $(DEFSRC)/wait.def \ + $(DEFSRC)/getopts.def $(DEFSRC)/reserved.def \ + $(DEFSRC)/pushd.def $(DEFSRC)/shopt.def $(DEFSRC)/printf.def \ + $(DEFSRC)/mapfile.def +BUILTIN_C_SRC = $(DEFSRC)/mkbuiltins.c $(DEFSRC)/common.c \ + $(DEFSRC)/evalstring.c $(DEFSRC)/evalfile.c \ + $(DEFSRC)/bashgetopt.c $(GETOPT_SOURCE) +BUILTIN_C_OBJ = $(DEFDIR)/common.o $(DEFDIR)/evalstring.o \ + $(DEFDIR)/evalfile.o $(DEFDIR)/bashgetopt.o +BUILTIN_OBJS = $(DEFDIR)/alias.o $(DEFDIR)/bind.o $(DEFDIR)/break.o \ + $(DEFDIR)/builtin.o $(DEFDIR)/cd.o $(DEFDIR)/colon.o \ + $(DEFDIR)/command.o $(DEFDIR)/caller.o $(DEFDIR)/declare.o \ + $(DEFDIR)/echo.o $(DEFDIR)/enable.o $(DEFDIR)/eval.o \ + $(DEFDIR)/exec.o $(DEFDIR)/exit.o $(DEFDIR)/fc.o \ + $(DEFDIR)/fg_bg.o $(DEFDIR)/hash.o $(DEFDIR)/help.o \ + $(DEFDIR)/history.o $(DEFDIR)/jobs.o $(DEFDIR)/kill.o \ + $(DEFDIR)/let.o $(DEFDIR)/pushd.o $(DEFDIR)/read.o \ + $(DEFDIR)/return.o $(DEFDIR)/shopt.o $(DEFDIR)/printf.o \ + $(DEFDIR)/set.o $(DEFDIR)/setattr.o $(DEFDIR)/shift.o \ + $(DEFDIR)/source.o $(DEFDIR)/suspend.o $(DEFDIR)/test.o \ + $(DEFDIR)/times.o $(DEFDIR)/trap.o $(DEFDIR)/type.o \ + $(DEFDIR)/ulimit.o $(DEFDIR)/umask.o $(DEFDIR)/wait.o \ + $(DEFDIR)/getopts.o $(DEFDIR)/mapfile.o $(BUILTIN_C_OBJ) +GETOPT_SOURCE = $(DEFSRC)/getopt.c $(DEFSRC)/getopt.h +PSIZE_SOURCE = $(DEFSRC)/psize.sh $(DEFSRC)/psize.c + +BUILTINS_LIBRARY = $(DEFDIR)/libbuiltins.a +BUILTINS_LIB = -lbuiltins +BUILTINS_LDFLAGS = -L$(DEFDIR) +BUILTINS_DEP = $(BUILTINS_LIBRARY) + +# Documentation for the shell. +DOCSRC = $(srcdir)/doc +DOCDIR = $(dot)/doc + +# Translations and other i18n support files +PO_SRC = $(srcdir)/po/ +PO_DIR = $(dot)/po/ + +SIGNAMES_SUPPORT = $(SUPPORT_SRC)mksignames.c + +SUPPORT_SRC = $(srcdir)/support/ +SDIR = $(dot)/support/ + +TESTS_SUPPORT = recho$(EXEEXT) zecho$(EXEEXT) printenv$(EXEEXT) xcase$(EXEEXT) +CREATED_SUPPORT = signames.h recho$(EXEEXT) zecho$(EXEEXT) printenv$(EXEEXT) \ + tests/recho$(EXEEXT) tests/zecho$(EXEEXT) \ + tests/printenv$(EXEEXT) xcase$(EXEEXT) tests/xcase$(EXEEXT) \ + mksignames$(EXEEXT) lsignames.h \ + mksyntax${EXEEXT} syntax.c $(VERSPROG) $(VERSOBJ) \ + buildversion.o mksignames.o signames.o buildsignames.o +CREATED_CONFIGURE = config.h config.cache config.status config.log \ + stamp-h po/POTFILES config.status.lineno +CREATED_MAKEFILES = Makefile builtins/Makefile doc/Makefile \ + lib/readline/Makefile lib/glob/Makefile \ + lib/sh/Makefile lib/tilde/Makefile lib/malloc/Makefile \ + lib/termcap/Makefile examples/loadables/Makefile \ + examples/loadables/perl/Makefile support/Makefile \ + lib/intl/Makefile po/Makefile po/Makefile.in + +OTHER_DOCS = $(srcdir)/CHANGES $(srcdir)/COMPAT $(srcdir)/NEWS $(srcdir)/POSIX \ + $(srcdir)/RBASH $(srcdir)/README +OTHER_INSTALLED_DOCS = CHANGES COMPAT NEWS POSIX RBASH README + +# Keep GNU Make from exporting the entire environment for small machines. +.NOEXPORT: + +.made: $(Program) bashbug + @echo "$(Program) last made for a $(Machine) running $(OS)" >.made + +$(Program): .build $(OBJECTS) $(BUILTINS_DEP) $(LIBDEP) + $(RM) $@ + $(PURIFY) $(CC) $(BUILTINS_LDFLAGS) $(LIBRARY_LDFLAGS) $(LDFLAGS) -o $(Program) $(OBJECTS) $(LIBS) + ls -l $(Program) + -$(SIZE) $(Program) + +.build: $(SOURCES) config.h Makefile version.h $(VERSPROG) + @echo + @echo " ***********************************************************" + @echo " * *" + @echo " * `$(BUILD_DIR)/$(VERSPROG) -l`" + @echo " * *" + @echo " ***********************************************************" + @echo + +bashbug: $(SUPPORT_SRC)bashbug.sh config.h Makefile $(VERSPROG) + @sed -e "s%!MACHINE!%$(Machine)%" -e "s%!OS!%$(OS)%" \ + -e "s%!CFLAGS!%$(CCFLAGS)%" -e "s%!CC!%$(CC)%" \ + -e "s%!RELEASE!%$(Version)%" -e "s%!PATCHLEVEL!%$(PatchLevel)%" \ + -e "s%!MACHTYPE!%$(MACHTYPE)%" -e "s%!RELSTATUS!%$(RELSTATUS)%" \ + $(SUPPORT_SRC)bashbug.sh > $@ + @chmod a+rx bashbug + +strip: $(Program) .made + strip $(Program) + ls -l $(Program) + -$(SIZE) $(Program) + +lint: + ${MAKE} ${MFLAGS} CFLAGS='${GCC_LINT_FLAGS}' .made + +version.h: $(SOURCES) config.h Makefile patchlevel.h + $(SHELL) $(SUPPORT_SRC)mkversion.sh -b -S ${topdir} -s $(RELSTATUS) -d $(Version) -o newversion.h \ + && mv newversion.h version.h + +bashversion$(EXEEXT): patchlevel.h conftypes.h version.h buildversion.o $(SUPPORT_SRC)bashversion.c + $(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)bashversion.c buildversion.o ${LIBS_FOR_BUILD} + +buildversion.o: version.h conftypes.h patchlevel.h $(srcdir)/version.c + $(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -DBUILDTOOL -c -o $@ $(srcdir)/version.c + +# old rules +GRAM_H = parser-built +y.tab.o: y.tab.h y.tab.c ${GRAM_H} command.h ${BASHINCDIR}/stdc.h input.h +${GRAM_H}: y.tab.h + @-if test -f y.tab.h ; then \ + cmp -s $@ y.tab.h 2>/dev/null || cp -p y.tab.h $@; \ + fi + +y.tab.c: parse.y +# -if test -f y.tab.h; then mv -f y.tab.h old-y.tab.h; fi + $(YACC) -d $(srcdir)/parse.y + touch parser-built +# -if cmp -s old-y.tab.h y.tab.h; then mv old-y.tab.h y.tab.h; else cp -p y.tab.h ${GRAM_H}; fi + +y.tab.h: y.tab.c + @true + + +# Subdirs will often times want version.h, so they'll change back up to +# the top level and try to create it. This causes parallel build issues +# so just force top level sanity before we descend. +$(LIBDEP): .build +#$(LIBDEP): version.h + +$(READLINE_LIBRARY): config.h $(READLINE_SOURCE) + @echo making $@ in ${RL_LIBDIR} + @( { test "${RL_LIBDIR}" = "${libdir}" && exit 0; } || \ + cd ${RL_LIBDIR} && $(MAKE) $(MFLAGS) libreadline.a) || exit 1 + +$(HISTORY_LIBRARY): config.h $(HISTORY_SOURCE) $(READLINE_DEP) + @echo making $@ in ${HIST_LIBDIR} + @( { test "${HIST_LIBDIR}" = "${libdir}" && exit 0; } || \ + cd ${HIST_LIBDIR} && $(MAKE) $(MFLAGS) libhistory.a) || exit 1 + +$(GLOB_LIBRARY): config.h $(GLOB_SOURCE) + @echo making $@ in ${GLOB_LIBDIR} + @(cd ${GLOB_LIBDIR} && \ + $(MAKE) $(MFLAGS) DEBUG=${DEBUG} libglob.a) || exit 1 + +$(TILDE_LIBRARY): config.h $(TILDE_SOURCE) + @echo making $@ in ${TILDE_LIBDIR} + @(cd ${TILDE_LIBDIR} && \ + $(MAKE) $(MFLAGS) libtilde.a) || exit 1 + +$(TERMCAP_LIBRARY): config.h ${TERMCAP_SOURCE} + @echo making $@ in ${TERM_LIBDIR} + @(cd ${TERM_LIBDIR} && \ + $(MAKE) $(MFLAGS) libtermcap.a) || exit 1 + +$(SHLIB_LIBRARY): config.h ${SHLIB_SOURCE} + @echo making $@ in ${SH_LIBDIR} + @(cd ${SH_LIBDIR} && \ + $(MAKE) $(MFLAGS) DEBUG=${DEBUG} ${SHLIB_LIBNAME}) || exit 1 + +${INTL_LIBRARY}: config.h ${INTL_LIBDIR}/Makefile + @echo making $@ in ${INTL_LIBDIR} + @(cd ${INTL_LIBDIR} && \ + $(MAKE) $(MFLAGS) all) || exit 1 + +${LIBINTL_H}: ${INTL_DEP} + +signames.o: $(SUPPORT_SRC)signames.c + $(RM) $@ + $(CC) $(CCFLAGS) -c $(SUPPORT_SRC)signames.c + +buildsignames.o: $(SUPPORT_SRC)signames.c + $(RM) $@ + $(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -DBUILDTOOL -o $@ -c $(SUPPORT_SRC)signames.c + +mksignames.o: $(SUPPORT_SRC)mksignames.c + $(RM) $@ + $(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -DBUILDTOOL -c $(SUPPORT_SRC)mksignames.c + +mksignames$(EXEEXT): mksignames.o buildsignames.o + $(RM) $@ + $(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ mksignames.o buildsignames.o ${LIBS_FOR_BUILD} + +mksyntax$(EXEEXT): ${srcdir}/mksyntax.c config.h syntax.h ${BASHINCDIR}/chartypes.h + $(RM) $@ + ${CC_FOR_BUILD} ${CCFLAGS_FOR_BUILD} ${LDFLAGS_FOR_BUILD} -o $@ ${srcdir}/mksyntax.c ${LIBS_FOR_BUILD} + +# make a list of signals for the local system -- this is done when we're +# *not* cross-compiling +lsignames.h: mksignames$(EXEEXT) + $(RM) $@ + ./mksignames$(EXEEXT) $@ + +# copy the correct signames header file to signames.h +signames.h: $(SIGNAMES_H) + -if cmp -s $(SIGNAMES_H) $@ ; then :; else $(RM) $@ ; $(CP) $(SIGNAMES_H) $@ ; fi + +syntax.c: mksyntax${EXEEXT} $(srcdir)/syntax.h + $(RM) $@ + ./mksyntax$(EXEEXT) -o $@ + +$(BUILTINS_LIBRARY): $(BUILTIN_DEFS) $(BUILTIN_C_SRC) config.h ${BASHINCDIR}/memalloc.h $(DEFDIR)/builtext.h version.h + @(cd $(DEFDIR) && $(MAKE) $(MFLAGS) DEBUG=${DEBUG} targets ) || exit 1 + +# these require special rules to circumvent make builtin rules +${DEFDIR}/common.o: $(BUILTIN_SRCDIR)/common.c + @(cd $(DEFDIR) && $(MAKE) $(MFLAGS) DEBUG=${DEBUG} common.o) || exit 1 + +${DEFDIR}/bashgetopt.o: $(BUILTIN_SRCDIR)/bashgetopt.c + @(cd $(DEFDIR) && $(MAKE) $(MFLAGS) DEBUG=${DEBUG} bashgetopt.o) || exit 1 + +${DEFDIR}/builtext.h: $(BUILTIN_DEFS) + @(cd $(DEFDIR) && $(MAKE) $(MFLAGS) builtext.h ) || exit 1 + +# For the justification of the following Makefile rules, see node +# `Automatic Remaking' in GNU Autoconf documentation. + +Makefile makefile: config.status $(srcdir)/Makefile.in + CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status + +Makefiles makefiles: config.status $(srcdir)/Makefile.in + @for mf in $(CREATED_MAKEFILES); do \ + CONFIG_FILES=$$mf CONFIG_HEADERS= $(SHELL) ./config.status ; \ + done + +config.h: stamp-h + +stamp-h: config.status $(srcdir)/config.h.in $(srcdir)/config-top.h $(srcdir)/config-bot.h + CONFIG_FILES= CONFIG_HEADERS=config.h $(SHELL) ./config.status + +config.status: $(srcdir)/configure + $(SHELL) ./config.status --recheck + +pathnames.h: Makefile $(srcdir)/pathnames.h.in + @sed -e 's|@DEBUGGER_START_FILE\@|${DEBUGGER_START_FILE}|g' $(srcdir)/pathnames.h.in > pathnames.tmp + @if test -f $@; then \ + cmp -s pathnames.tmp $@ || mv pathnames.tmp $@; \ + else \ + mv pathnames.tmp $@; \ + fi + @${RM} pathnames.tmp + +# comment out for distribution +$(srcdir)/configure: $(srcdir)/configure.ac $(srcdir)/aclocal.m4 $(srcdir)/config.h.in + cd $(srcdir) && autoconf + +# for chet +reconfig: force + sh $(srcdir)/configure -C + +#newversion: mkversion +# $(RM) .build +# ./mkversion -dir $(srcdir) -dist +# mv -f newversion.h version.h +# $(MAKE) -f $(srcdir)/Makefile $(MFLAGS) srcdir=$(srcdir) + +doc documentation: force + @(cd $(DOCDIR) ; $(MAKE) $(MFLAGS) ) + +info dvi ps: force + @(cd $(DOCDIR) ; $(MAKE) $(MFLAGS) CFLAGS='$(CCFLAGS)' $@ ) + +force: + +# unused +TAGS: $(SOURCES) $(BUILTIN_C_SRC) $(LIBRARY_SOURCE) + etags $(SOURCES) $(BUILTIN_C_SRC) $(LIBRARY_SOURCE) + +tags: $(SOURCES) $(BUILTIN_C_SRC) $(LIBRARY_SOURCE) + ctags -x $(SOURCES) $(BUILTIN_C_SRC) $(LIBRARY_SOURCE) > $@ + +# Targets that actually do things not part of the build + +installdirs: + @${SHELL} $(SUPPORT_SRC)mkinstalldirs $(DESTDIR)$(bindir) + @${SHELL} $(SUPPORT_SRC)mkinstalldirs $(DESTDIR)$(man1dir) + @${SHELL} $(SUPPORT_SRC)mkinstalldirs $(DESTDIR)$(infodir) + @${SHELL} $(SUPPORT_SRC)mkinstalldirs $(DESTDIR)$(docdir) + -( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) + +install: .made installdirs + $(INSTALL_PROGRAM) $(INSTALLMODE) $(Program) $(DESTDIR)$(bindir)/$(Program) + $(INSTALL_SCRIPT) $(INSTALLMODE2) bashbug $(DESTDIR)$(bindir)/bashbug + $(INSTALL_DATA) $(OTHER_DOCS) $(DESTDIR)$(docdir) + -( cd $(DOCDIR) ; $(MAKE) $(MFLAGS) \ + man1dir=$(man1dir) man1ext=$(man1ext) \ + man3dir=$(man3dir) man3ext=$(man3ext) \ + infodir=$(infodir) htmldir=$(htmldir) DESTDIR=$(DESTDIR) $@ ) + -( cd $(DEFDIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) + -( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) + +install-strip: + $(MAKE) $(MFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \ + prefix=${prefix} exec_prefix=${exec_prefix} \ + DESTDIR=$(DESTDIR) install + +uninstall: .made + $(RM) $(DESTDIR)$(bindir)/$(Program) $(DESTDIR)$(bindir)/bashbug + -( cd $(DESTDIR)$(docdir) && ${RM} ${OTHER_INSTALLED_DOCS} ) + -( cd $(DOCDIR) ; $(MAKE) $(MFLAGS) \ + man1dir=$(man1dir) man1ext=$(man1ext) \ + man3dir=$(man3dir) man3ext=$(man3ext) \ + infodir=$(infodir) htmldir=$(htmldir) DESTDIR=$(DESTDIR) $@ ) + -( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) + +.PHONY: basic-clean clean realclean maintainer-clean distclean mostlyclean maybe-clean + +LIB_SUBDIRS = ${RL_LIBDIR} ${HIST_LIBDIR} ${TERM_LIBDIR} ${GLOB_LIBDIR} \ + ${INTL_LIBDIR} ${TILDE_LIBDIR} ${ALLOC_LIBDIR} ${SH_LIBDIR} + +basic-clean: + $(RM) $(OBJECTS) $(Program) bashbug + $(RM) .build .made version.h + +clean: basic-clean + ( cd $(DOCDIR) && $(MAKE) $(MFLAGS) $@ ) + ( cd builtins && $(MAKE) $(MFLAGS) $@ ) + -( cd $(SDIR) && $(MAKE) $(MFLAGS) $@ ) + -for libdir in ${LIB_SUBDIRS}; do \ + (cd $$libdir && test -f Makefile && $(MAKE) $(MFLAGS) $@) ;\ + done + -( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) + $(RM) $(CREATED_SUPPORT) + +mostlyclean: basic-clean + ( cd $(DOCDIR) && $(MAKE) $(MFLAGS) $@ ) + ( cd builtins && $(MAKE) $(MFLAGS) $@ ) + -( cd $(SDIR) && $(MAKE) $(MFLAGS) $@ ) + -for libdir in ${LIB_SUBDIRS}; do \ + (cd $$libdir && test -f Makefile && $(MAKE) $(MFLAGS) $@) ;\ + done + -( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) + +distclean: basic-clean maybe-clean + ( cd $(DOCDIR) && $(MAKE) $(MFLAGS) $@ ) + ( cd builtins && $(MAKE) $(MFLAGS) $@ ) + -( cd $(SDIR) && $(MAKE) $(MFLAGS) $@ ) + -for libdir in ${LIB_SUBDIRS}; do \ + (cd $$libdir && test -f Makefile && $(MAKE) $(MFLAGS) $@) ;\ + done + -( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) + $(RM) $(CREATED_CONFIGURE) tags TAGS + $(RM) $(CREATED_SUPPORT) Makefile $(CREATED_MAKEFILES) pathnames.h + +maintainer-clean: basic-clean + @echo This command is intended for maintainers to use. + @echo It deletes files that may require special tools to rebuild. + $(RM) y.tab.c y.tab.h parser-built tags TAGS + ( cd $(DOCDIR) && $(MAKE) $(MFLAGS) $@ ) + ( cd builtins && $(MAKE) $(MFLAGS) $@ ) + ( cd $(SDIR) && $(MAKE) $(MFLAGS) $@ ) + -for libdir in ${LIB_SUBDIRS}; do \ + (cd $$libdir && test -f Makefile && $(MAKE) $(MFLAGS) $@) ;\ + done + -( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) + $(RM) $(CREATED_CONFIGURE) $(CREATED_MAKEFILES) + $(RM) $(CREATED_SUPPORT) Makefile pathnames.h + +maybe-clean: + -if test "X$(topdir)" != "X$(BUILD_DIR)" ; then \ + $(RM) parser-built y.tab.c y.tab.h ; \ + fi + +recho$(EXEEXT): $(SUPPORT_SRC)recho.c + @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)recho.c ${LIBS_FOR_BUILD} + +zecho$(EXEEXT): $(SUPPORT_SRC)zecho.c + @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)zecho.c ${LIBS_FOR_BUILD} + +printenv$(EXEEXT): $(SUPPORT_SRC)printenv.c + @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)printenv.c ${LIBS_FOR_BUILD} + +xcase$(EXEEXT): $(SUPPORT_SRC)xcase.c + @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)xcase.c ${LIBS_FOR_BUILD} + +test tests check: force $(Program) $(TESTS_SUPPORT) + @-test -d tests || mkdir tests + @cp $(TESTS_SUPPORT) tests + @( cd $(srcdir)/tests && \ + PATH=$(BUILD_DIR)/tests:$$PATH THIS_SH=$(THIS_SH) $(SHELL) ${TESTSCRIPT} ) + +symlinks: + $(SHELL) $(SUPPORT_SRC)fixlinks -s $(srcdir) + +dist: force + @echo Bash distributions are created using $(srcdir)/support/mkdist. + @echo Here is a sample of the necessary commands: + @echo $(Program) $(srcdir)/support/mkdist -m $(srcdir)/MANIFEST -s $(srcdir) -r ${PACKAGE} $(PACKAGE_VERSION) + @echo tar cf $(PACKAGE)-${PACKAGE_VERSION}.tar ${PACKAGE}-$(PACKAGE_VERSION) + @echo gzip $(PACKAGE)-$(PACKAGE_VERSION).tar + +depend: depends + +depends: force + $(Program) $(SUPPORT_SRC)mkdep -c ${CC} -- ${CCFLAGS} ${CSOURCES} + +#### PRIVATE TARGETS #### +hashtest: hashlib.c + $(CC) -DTEST_HASHING $(CCFLAGS) -o $@ $(srcdir)/hashlib.c + +############################ DEPENDENCIES ############################### + +# Files that depend on the definitions in config-top.h, which are not meant +# to be changed +bashhist.o: config-top.h +shell.o: config-top.h +input.o: config-top.h +y.tab.o: config-top.h +jobs.o: config-top.h +nojobs.o: config-top.h +execute_cmd.o: config-top.h +variables.o: config-top.h +builtins/command.o: config-top.h +builtins/common.o: config-top.h +builtins/break.o: config-top.h +builtins/echo.o: config-top.h +builtins/evalstring.o: config-top.h +builtins/exit.o: config-top.h +builtins/kill.o: config-top.h + +# shell basics +copy_cmd.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +copy_cmd.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +copy_cmd.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +copy_cmd.o: make_cmd.h subst.h sig.h pathnames.h externs.h +dispose_cmd.o: bashansi.h ${BASHINCDIR}/ansi_stdlib.h +dispose_cmd.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h +dispose_cmd.o: error.h general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +dispose_cmd.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +dispose_cmd.o: make_cmd.h subst.h sig.h pathnames.h externs.h +dispose_cmd.o: ${BASHINCDIR}/ocache.h +error.o: config.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h flags.h ${BASHINCDIR}/stdc.h error.h +error.o: command.h general.h xmalloc.h externs.h input.h bashhist.h +error.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +error.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +error.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +error.o: make_cmd.h subst.h sig.h pathnames.h externs.h +error.o: input.h execute_cmd.h +eval.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h trap.h flags.h ${DEFSRC}/common.h +eval.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +eval.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +eval.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +eval.o: make_cmd.h subst.h sig.h pathnames.h externs.h +eval.o: input.h execute_cmd.h +execute_cmd.o: config.h bashtypes.h ${BASHINCDIR}/filecntl.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +execute_cmd.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +execute_cmd.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +execute_cmd.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +execute_cmd.o: make_cmd.h subst.h sig.h pathnames.h externs.h +execute_cmd.o: ${BASHINCDIR}/memalloc.h ${GRAM_H} flags.h builtins.h jobs.h quit.h siglist.h +execute_cmd.o: execute_cmd.h findcmd.h redir.h trap.h test.h pathexp.h +execute_cmd.o: $(DEFSRC)/common.h ${DEFDIR}/builtext.h ${GLOB_LIBSRC}/strmatch.h +execute_cmd.o: ${BASHINCDIR}/posixtime.h ${BASHINCDIR}/chartypes.h +expr.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +expr.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +expr.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +expr.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +expr.o: make_cmd.h subst.h sig.h pathnames.h externs.h +expr.o: ${BASHINCDIR}/chartypes.h +findcmd.o: config.h bashtypes.h ${BASHINCDIR}/filecntl.h ${BASHINCDIR}/posixstat.h bashansi.h +findcmd.o: ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/memalloc.h shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h +findcmd.o: ${BASHINCDIR}/stdc.h error.h general.h xmalloc.h variables.h arrayfunc.h conftypes.h quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h +findcmd.o: dispose_cmd.h make_cmd.h subst.h sig.h pathnames.h externs.h +findcmd.o: flags.h hashlib.h pathexp.h hashcmd.h +findcmd.o: ${BASHINCDIR}/chartypes.h +flags.o: config.h flags.h +flags.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +flags.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +flags.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +flags.o: make_cmd.h subst.h sig.h pathnames.h externs.h bashhist.h +general.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h ${BASHINCDIR}/filecntl.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +general.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +general.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +general.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +general.o: make_cmd.h subst.h sig.h pathnames.h externs.h +general.o: ${BASHINCDIR}/maxpath.h ${BASHINCDIR}/posixtime.h +general.o: ${BASHINCDIR}/chartypes.h +hashcmd.o: config.h ${BASHINCDIR}/posixstat.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +hashcmd.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +hashcmd.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashcmd.h +hashcmd.o: execute_cmd.h findcmd.h ${BASHINCDIR}/stdc.h pathnames.h hashlib.h +hashlib.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +hashlib.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +hashlib.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +hashlib.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +hashlib.o: make_cmd.h subst.h sig.h pathnames.h externs.h +input.o: config.h bashtypes.h ${BASHINCDIR}/filecntl.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +input.o: command.h ${BASHINCDIR}/stdc.h general.h xmalloc.h input.h error.h externs.h +input.o: quit.h +list.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +list.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +list.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +list.o: make_cmd.h subst.h sig.h pathnames.h externs.h +locale.o: config.h bashtypes.h bashintl.h ${LIBINTL_H} bashansi.h ${BASHINCDIR}/ansi_stdlib.h +locale.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +locale.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +locale.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +locale.o: make_cmd.h subst.h sig.h pathnames.h externs.h +locale.o: ${BASHINCDIR}/chartypes.h +mailcheck.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +mailcheck.o: ${BASHINCDIR}/posixtime.h +mailcheck.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +mailcheck.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +mailcheck.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +mailcheck.o: make_cmd.h subst.h sig.h pathnames.h externs.h +mailcheck.o: execute_cmd.h mailcheck.h +make_cmd.o: config.h bashtypes.h ${BASHINCDIR}/filecntl.h bashansi.h +make_cmd.o: command.h ${BASHINCDIR}/stdc.h general.h xmalloc.h error.h flags.h make_cmd.h +make_cmd.o: variables.h arrayfunc.h conftypes.h array.h hashlib.h subst.h input.h externs.h +make_cmd.o: jobs.h quit.h siglist.h syntax.h dispose_cmd.h parser.h +make_cmd.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h ${BASHINCDIR}/ocache.h +y.tab.o: config.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/memalloc.h +y.tab.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +y.tab.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +y.tab.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +y.tab.o: make_cmd.h subst.h sig.h pathnames.h externs.h test.h +y.tab.o: trap.h flags.h parser.h input.h mailcheck.h $(DEFSRC)/common.h +y.tab.o: $(DEFDIR)/builtext.h bashline.h bashhist.h jobs.h siglist.h alias.h +pathexp.o: config.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +pathexp.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +pathexp.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +pathexp.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +pathexp.o: make_cmd.h subst.h sig.h pathnames.h externs.h +pathexp.o: pathexp.h flags.h +pathexp.o: $(GLOB_LIBSRC)/glob.h $(GLOB_LIBSRC)/strmatch.h +pathexp.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h +print_cmd.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +print_cmd.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +print_cmd.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +print_cmd.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +print_cmd.o: make_cmd.h subst.h sig.h pathnames.h externs.h +print_cmd.o: ${GRAM_H} $(DEFSRC)/common.h +redir.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/filecntl.h +redir.o: ${BASHINCDIR}/memalloc.h shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +redir.o: general.h xmalloc.h variables.h arrayfunc.h conftypes.h array.h hashlib.h quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h +redir.o: dispose_cmd.h make_cmd.h subst.h sig.h pathnames.h externs.h +redir.o: flags.h execute_cmd.h redir.h input.h +shell.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/filecntl.h +shell.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +shell.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +shell.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +shell.o: make_cmd.h subst.h sig.h pathnames.h externs.h +shell.o: flags.h trap.h mailcheck.h builtins.h $(DEFSRC)/common.h +shell.o: jobs.h siglist.h input.h execute_cmd.h findcmd.h bashhist.h bashline.h +shell.o: ${GLOB_LIBSRC}/strmatch.h ${BASHINCDIR}/posixtime.h +sig.o: config.h bashtypes.h +sig.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +sig.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +sig.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +sig.o: make_cmd.h subst.h sig.h pathnames.h externs.h +sig.o: jobs.h siglist.h trap.h $(DEFSRC)/common.h bashline.h bashhist.h +sig.o: ${DEFDIR}/builtext.h +siglist.o: config.h bashtypes.h siglist.h trap.h +stringlib.o: bashtypes.h ${BASHINCDIR}/chartypes.h +stringlib.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +stringlib.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +stringlib.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +stringlib.o: make_cmd.h subst.h sig.h pathnames.h externs.h +stringlib.o: ${GLOB_LIBSRC}/glob.h ${GLOB_LIBSRC}/strmatch.h +subst.o: config.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/posixstat.h +subst.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +subst.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +subst.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +subst.o: make_cmd.h subst.h sig.h pathnames.h externs.h parser.h +subst.o: flags.h jobs.h siglist.h execute_cmd.h ${BASHINCDIR}/filecntl.h trap.h pathexp.h +subst.o: mailcheck.h input.h $(DEFSRC)/getopt.h $(DEFSRC)/common.h +subst.o: bashline.h bashhist.h ${GLOB_LIBSRC}/strmatch.h +subst.o: ${BASHINCDIR}/chartypes.h +subst.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h +subst.o: ${DEFDIR}/builtext.h +test.o: bashtypes.h ${BASHINCDIR}/posixstat.h ${BASHINCDIR}/filecntl.h +test.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +test.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +test.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +test.o: make_cmd.h subst.h sig.h pathnames.h externs.h test.h +test.o: ${DEFSRC}/common.h +trap.o: config.h bashtypes.h trap.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +trap.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +trap.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +trap.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +trap.o: make_cmd.h subst.h sig.h pathnames.h externs.h +trap.o: signames.h $(DEFSRC)/common.h +trap.o: ${DEFDIR}/builtext.h jobs.h +unwind_prot.o: config.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h command.h ${BASHINCDIR}/stdc.h +unwind_prot.o: general.h xmalloc.h unwind_prot.h quit.h sig.h +variables.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +variables.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +variables.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +variables.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +variables.o: make_cmd.h subst.h sig.h pathnames.h externs.h +variables.o: flags.h execute_cmd.h mailcheck.h input.h $(DEFSRC)/common.h +variables.o: findcmd.h bashhist.h hashcmd.h pathexp.h +variables.o: pcomplete.h ${BASHINCDIR}/chartypes.h +variables.o: ${BASHINCDIR}/posixtime.h assoc.h +variables.o: version.h $(DEFDIR)/builtext.h +version.o: conftypes.h patchlevel.h version.h +xmalloc.o: config.h bashtypes.h ${BASHINCDIR}/ansi_stdlib.h error.h + +# job control + +jobs.o: config.h bashtypes.h trap.h ${BASHINCDIR}/filecntl.h input.h ${BASHINCDIR}/shtty.h +jobs.o: bashansi.h ${BASHINCDIR}/ansi_stdlib.h +jobs.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +jobs.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +jobs.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +jobs.o: execute_cmd.h make_cmd.h subst.h sig.h pathnames.h externs.h +jobs.o: jobs.h flags.h $(DEFSRC)/common.h $(DEFDIR)/builtext.h +jobs.o: ${BASHINCDIR}/posixwait.h ${BASHINCDIR}/unionwait.h +jobs.o: ${BASHINCDIR}/posixtime.h +nojobs.o: config.h bashtypes.h ${BASHINCDIR}/filecntl.h bashjmp.h ${BASHINCDIR}/posixjmp.h +nojobs.o: command.h ${BASHINCDIR}/stdc.h general.h xmalloc.h jobs.h quit.h siglist.h externs.h +nojobs.o: sig.h error.h ${BASHINCDIR}/shtty.h input.h +nojobs.o: $(DEFDIR)/builtext.h + +# shell features that may be compiled in + +array.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +array.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +array.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +array.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +array.o: make_cmd.h subst.h sig.h pathnames.h externs.h +array.o: $(DEFSRC)/common.h +arrayfunc.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +arrayfunc.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +arrayfunc.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +arrayfunc.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +arrayfunc.o: make_cmd.h subst.h sig.h pathnames.h externs.h pathexp.h +arrayfunc.o: $(DEFSRC)/common.h +arrayfunc.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h +assoc.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +assoc.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h +assoc.o: command.h ${BASHINCDIR}/stdc.h error.h +assoc.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h +assoc.o: assoc.h hashlib.h +assoc.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +assoc.o: make_cmd.h subst.h sig.h pathnames.h externs.h +assoc.o: $(DEFSRC)/common.h +braces.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +braces.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +braces.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +braces.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +braces.o: make_cmd.h subst.h sig.h pathnames.h externs.h +braces.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h +alias.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h command.h ${BASHINCDIR}/stdc.h +alias.o: general.h xmalloc.h bashtypes.h externs.h alias.h +alias.o: pcomplete.h +alias.o: ${BASHINCDIR}/chartypes.h + +pcomplib.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h bashtypes.h +pcomplib.o: ${BASHINCDIR}/stdc.h hashlib.h pcomplete.h shell.h syntax.h +pcomplib.o: bashjmp.h command.h general.h xmalloc.h error.h variables.h arrayfunc.h conftypes.h quit.h +pcomplib.o: unwind_prot.h dispose_cmd.h make_cmd.h subst.h sig.h pathnames.h +pcomplib.o: externs.h ${BASHINCDIR}/maxpath.h + +pcomplete.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h bashtypes.h +pcomplete.o: ${BASHINCDIR}/stdc.h hashlib.h pcomplete.h shell.h syntax.h +pcomplete.o: bashjmp.h command.h general.h xmalloc.h error.h variables.h arrayfunc.h conftypes.h quit.h +pcomplete.o: unwind_prot.h dispose_cmd.h make_cmd.h subst.h sig.h pathnames.h +pcomplete.o: externs.h ${BASHINCDIR}/maxpath.h execute_cmd.h +pcomplete.o: ${DEFDIR}/builtext.h + +# library support files + +bashhist.o: config.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/posixstat.h +bashhist.o: ${BASHINCDIR}/filecntl.h +bashhist.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +bashhist.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +bashhist.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +bashhist.o: make_cmd.h subst.h sig.h pathnames.h externs.h +bashhist.o: flags.h input.h parser.h pathexp.h $(DEFSRC)/common.h bashline.h +bashhist.o: $(GLOB_LIBSRC)/strmatch.h +bashline.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +bashline.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h +bashline.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h +bashline.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +bashline.o: make_cmd.h subst.h sig.h pathnames.h externs.h +bashline.o: builtins.h bashhist.h bashline.h execute_cmd.h findcmd.h pathexp.h +bashline.o: $(DEFSRC)/common.h $(GLOB_LIBSRC)/glob.h alias.h +bashline.o: pcomplete.h ${BASHINCDIR}/chartypes.h input.h +bashline.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h +bracecomp.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +bracecomp.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h +bracecomp.o: command.h ${BASHINCDIR}/stdc.h error.h +bracecomp.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h +bracecomp.o: array.h hashlib.h alias.h builtins.h +bracecomp.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +bracecomp.o: make_cmd.h subst.h sig.h pathnames.h externs.h + +# library dependencies + +bashline.o: $(RL_LIBSRC)/rlconf.h +bashline.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/rlstdc.h +bashline.o: $(RL_LIBSRC)/chardefs.h $(RL_LIBSRC)/readline.h +bracecomp.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/chardefs.h +bracecomp.o: $(RL_LIBSRC)/readline.h $(RL_LIBSRC)/rlstdc.h +y.tab.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/chardefs.h +y.tab.o: $(RL_LIBSRC)/readline.h $(RL_LIBSRC)/rlstdc.h +subst.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/chardefs.h +subst.o: $(RL_LIBSRC)/readline.h $(RL_LIBSRC)/rlstdc.h + +shell.o: $(HIST_LIBSRC)/history.h $(HIST_LIBSRC)/rlstdc.h +subst.o: $(HIST_LIBSRC)/history.h $(HIST_LIBSRC)/rlstdc.h +bashline.o: $(HIST_LIBSRC)/history.h $(HIST_LIBSRC)/rlstdc.h +bashhist.o: $(HIST_LIBSRC)/history.h $(HIST_LIBSRC)/rlstdc.h +y.tab.o: $(HIST_LIBSRC)/history.h $(HIST_LIBSRC)/rlstdc.h + +execute_cmd.o: $(TILDE_LIBSRC)/tilde.h +general.o: $(TILDE_LIBSRC)/tilde.h +mailcheck.o: $(TILDE_LIBSRC)/tilde.h +shell.o: $(TILDE_LIBSRC)/tilde.h +subst.o: $(TILDE_LIBSRC)/tilde.h +variables.o: $(TILDE_LIBSRC)/tilde.h + +# libintl dependencies +arrayfunc.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +bashhist.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +bashline.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +braces.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +error.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +eval.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +execute_cmd.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +expr.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +general.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +input.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +jobs.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +mailcheck.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +make_cmd.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +nojobs.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +y.tab.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +pcomplete.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +pcomplib.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +print_cmd.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +redir.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +shell.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +sig.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +siglist.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +subst.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +test.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +trap.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +variables.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +version.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +xmalloc.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h + +signames.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h + +# XXX - dependencies checked through here + +# builtin c sources +builtins/bashgetopt.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +builtins/bashgetopt.o: shell.h syntax.h config.h bashjmp.h command.h general.h xmalloc.h error.h +builtins/bashgetopt.o: variables.h arrayfunc.h conftypes.h quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +builtins/bashgetopt.o: make_cmd.h subst.h sig.h pathnames.h externs.h +builtins/bashgetopt.o: $(DEFSRC)/common.h +builtins/bashgetopt.o: ${BASHINCDIR}/chartypes.h +builtins/common.o: bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +builtins/common.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h command.h +builtins/common.o: ${BASHINCDIR}/memalloc.h variables.h arrayfunc.h conftypes.h input.h siglist.h +builtins/common.o: quit.h unwind_prot.h ${BASHINCDIR}/maxpath.h jobs.h builtins.h +builtins/common.o: dispose_cmd.h make_cmd.h subst.h externs.h bashhist.h +builtins/common.o: execute_cmd.h ${BASHINCDIR}/stdc.h general.h xmalloc.h error.h pathnames.h +builtins/common.o: ${DEFDIR}/builtext.h +builtins/common.o: ${BASHINCDIR}/chartypes.h +builtins/evalfile.o: bashtypes.h ${BASHINCDIR}/posixstat.h ${BASHINCDIR}/filecntl.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +builtins/evalfile.o: shell.h syntax.h config.h bashjmp.h command.h general.h xmalloc.h error.h +builtins/evalfile.o: variables.h arrayfunc.h conftypes.h quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +builtins/evalfile.o: make_cmd.h subst.h sig.h pathnames.h externs.h +builtins/evalfile.o: jobs.h builtins.h flags.h input.h execute_cmd.h +builtins/evalfile.o: bashhist.h $(DEFSRC)/common.h +builtins/evalstring.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +builtins/evalstring.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h command.h siglist.h +builtins/evalstring.o: ${BASHINCDIR}/memalloc.h variables.h arrayfunc.h conftypes.h input.h +builtins/evalstring.o: quit.h unwind_prot.h ${BASHINCDIR}/maxpath.h jobs.h builtins.h +builtins/evalstring.o: dispose_cmd.h make_cmd.h subst.h externs.h +builtins/evalstring.o: jobs.h builtins.h flags.h input.h execute_cmd.h +builtins/evalstring.o: bashhist.h $(DEFSRC)/common.h pathnames.h +builtins/getopt.o: config.h ${BASHINCDIR}/memalloc.h +builtins/getopt.o: shell.h syntax.h bashjmp.h command.h general.h xmalloc.h error.h +builtins/getopt.o: variables.h arrayfunc.h conftypes.h quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h +builtins/getopt.o: make_cmd.h subst.h sig.h pathnames.h externs.h +builtins/getopt.o: $(DEFSRC)/getopt.h +builtins/mkbuiltins.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h ${BASHINCDIR}/filecntl.h +builtins/mkbuiltins.o: bashansi.h ${BASHINCDIR}/ansi_stdlib.h + +# builtin def files +builtins/alias.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/alias.o: quit.h $(DEFSRC)/common.h pathnames.h +builtins/alias.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h command.h ${BASHINCDIR}/stdc.h unwind_prot.h +builtins/alias.o: dispose_cmd.h make_cmd.h subst.h externs.h variables.h arrayfunc.h conftypes.h +builtins/bind.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/bind.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/bind.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h quit.h +builtins/bind.o: $(DEFSRC)/bashgetopt.h pathnames.h +builtins/break.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/break.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h quit.h +builtins/break.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/break.o: pathnames.h +builtins/builtin.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/builtin.o: quit.h $(DEFSRC)/common.h $(DEFSRC)/bashgetopt.h +builtins/builtin.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/builtin.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/builtin.o: pathnames.h +builtins/caller.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/caller.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/caller.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/caller.o: $(DEFSRC)/common.h quit.h +builtins/caller.o: ${BASHINCDIR}/chartypes.h bashtypes.h +builtins/caller.o: ${DEFDIR}/builtext.h pathnames.h +builtins/cd.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/cd.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/cd.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/cd.o: $(DEFSRC)/common.h quit.h pathnames.h +builtins/command.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/command.o: quit.h $(DEFSRC)/bashgetopt.h +builtins/command.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/command.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h pathnames.h +builtins/declare.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/declare.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h quit.h +builtins/declare.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/declare.o: $(DEFSRC)/bashgetopt.h pathnames.h +builtins/echo.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/echo.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h quit.h +builtins/echo.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/echo.o: pathnames.h +builtins/enable.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/enable.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h quit.h +builtins/enable.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/enable.o: pcomplete.h pathnames.h +builtins/eval.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/eval.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h quit.h +builtins/eval.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/eval.o: pathnames.h +builtins/exec.o: bashtypes.h pathnames.h +builtins/exec.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/exec.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/exec.o: dispose_cmd.h make_cmd.h subst.h externs.h execute_cmd.h +builtins/exec.o: findcmd.h flags.h quit.h $(DEFSRC)/common.h ${BASHINCDIR}/stdc.h +builtins/exec.o: pathnames.h +builtins/exit.o: bashtypes.h +builtins/exit.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/exit.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h quit.h +builtins/exit.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/exit.o: pathnames.h +builtins/fc.o: bashtypes.h ${BASHINCDIR}/posixstat.h +builtins/fc.o: bashansi.h ${BASHINCDIR}/ansi_stdlib.h builtins.h command.h ${BASHINCDIR}/stdc.h +builtins/fc.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/fc.o: flags.h unwind_prot.h variables.h arrayfunc.h conftypes.h shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h +builtins/fc.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h quit.h +builtins/fc.o: $(DEFSRC)/bashgetopt.h bashhist.h pathnames.h +builtins/fc.o: ${BASHINCDIR}/chartypes.h +builtins/fg_bg.o: bashtypes.h $(DEFSRC)/bashgetopt.h +builtins/fg_bg.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/fg_bg.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h quit.h +builtins/fg_bg.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/fg_bg.o: pathnames.h +builtins/getopts.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/getopts.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h quit.h +builtins/getopts.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/getopts.o: pathnames.h +builtins/hash.o: bashtypes.h +builtins/hash.o: builtins.h command.h findcmd.h ${BASHINCDIR}/stdc.h $(DEFSRC)/common.h +builtins/hash.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/hash.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h quit.h +builtins/hash.o: pathnames.h +builtins/help.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/help.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/help.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h quit.h +builtins/help.o: $(GLOB_LIBSRC)/glob.h pathnames.h +builtins/history.o: bashtypes.h pathnames.h +builtins/history.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/history.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/history.o: ${BASHINCDIR}/filecntl.h shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h +builtins/history.o: bashhist.h variables.h arrayfunc.h conftypes.h +builtins/inlib.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/inlib.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h quit.h +builtins/inlib.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/inlib.o: pathnames.h +builtins/jobs.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/jobs.o: quit.h $(DEFSRC)/bashgetopt.h +builtins/jobs.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/jobs.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/jobs.o: pathnames.h +builtins/kill.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/kill.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/kill.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h trap.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/kill.o: pathnames.h +builtins/let.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/let.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/let.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/let.o: pathnames.h +builtins/printf.o: config.h ${BASHINCDIR}/memalloc.h bashjmp.h command.h error.h +builtins/printf.o: general.h xmalloc.h quit.h dispose_cmd.h make_cmd.h subst.h +builtins/printf.o: externs.h sig.h pathnames.h shell.h syntax.h unwind_prot.h +builtins/printf.o: variables.h arrayfunc.h conftypes.h ${BASHINCDIR}/stdc.h $(DEFSRC)/bashgetopt.h +builtins/printf.o: ${BASHINCDIR}/chartypes.h +builtins/pushd.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/pushd.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/pushd.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/pushd.o: $(DEFSRC)/common.h pathnames.h +builtins/read.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/read.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/read.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/read.o: pathnames.h +builtins/return.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/return.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/return.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/return.o: pathnames.h +builtins/set.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/set.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/set.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h flags.h +builtins/set.o: pathnames.h +builtins/setattr.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/setattr.o: quit.h $(DEFSRC)/common.h $(DEFSRC)/bashgetopt.h +builtins/setattr.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/setattr.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/setattr.o: pathnames.h +builtins/shift.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/shift.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/shift.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/shift.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/shift.o: pathnames.h +builtins/shopt.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h +builtins/shopt.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h +builtins/shopt.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h unwind_prot.h variables.h arrayfunc.h conftypes.h ${BASHINCDIR}/maxpath.h +builtins/shopt.o: $(DEFSRC)/common.h $(DEFSRC)/bashgetopt.h pathnames.h +builtins/shopt.o: bashhist.h bashline.h +builtins/source.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/source.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/source.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/source.o: findcmd.h $(DEFSRC)/bashgetopt.h flags.h trap.h +builtins/source.o: pathnames.h +builtins/suspend.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/suspend.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/suspend.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/suspend.o: pathnames.h +builtins/test.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/test.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/test.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/test.o: test.h pathnames.h +builtins/times.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/times.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/times.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/times.o: pathnames.h +builtins/trap.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/trap.o: quit.h $(DEFSRC)/common.h +builtins/trap.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/trap.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/trap.o: pathnames.h +builtins/type.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/type.o: quit.h $(DEFSRC)/common.h findcmd.h +builtins/type.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/type.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/type.o: pathnames.h +builtins/ulimit.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/ulimit.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/ulimit.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/ulimit.o: pathnames.h +builtins/umask.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/umask.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/umask.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/umask.o: ${BASHINCDIR}/chartypes.h pathnames.h +builtins/wait.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/wait.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/wait.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/wait.o: ${BASHINCDIR}/chartypes.h pathnames.h + +builtins/complete.o: config.h shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h +builtins/complete.o: unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/complete.o: bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h +builtins/complete.o: builtins.h pathnames.h +builtins/complete.o: pcomplete.h +builtins/complete.o: ${DEFSRC}/common.h ${DEFSRC}/bashgetopt.h +builtins/mapfile.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h +builtins/mapfile.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h +builtins/mapfile.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h +builtins/mapfile.o: pathnames.h + +# libintl dependencies +builtins/bind.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/break.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/caller.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/cd.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/common.c: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/complete.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/declare.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/enable.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/evalfile.c: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/exec.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/exit.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/fc.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/fg_bg.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/getopt.c: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/hash.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/help.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/history.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/inlib.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/jobs.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/kill.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/let.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/mapfile.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/mkbuiltins.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/printf.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/pushd.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/read.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/return.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/set.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/setattr.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/shift.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/shopt.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/source.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/suspend.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/type.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/ulimit.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +builtins/umask.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h + +# builtin library dependencies +builtins/bind.o: $(RL_LIBSRC)/chardefs.h $(RL_LIBSRC)/readline.h +builtins/bind.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/rlstdc.h + +builtins/bind.o: $(HIST_LIBSRC)/history.h $(RL_LIBSRC)/rlstdc.h +builtins/fc.o: $(HIST_LIBSRC)/history.h $(RL_LIBSRC)/rlstdc.h +builtins/history.o: $(HIST_LIBSRC)/history.h $(RL_LIBSRC)/rlstdc.h + +builtins/common.o: $(TILDE_LIBSRC)/tilde.h +builtins/cd.o: $(TILDE_LIBSRC)/tilde.h + +builtins/alias.o: $(DEFSRC)/alias.def +builtins/bind.o: $(DEFSRC)/bind.def +builtins/break.o: $(DEFSRC)/break.def +builtins/builtin.o: $(DEFSRC)/builtin.def +builtins/caller.o: $(DEFSRC)/caller.def +builtins/cd.o: $(DEFSRC)/cd.def +builtins/colon.o: $(DEFSRC)/colon.def +builtins/command.o: $(DEFSRC)/command.def +builtins/complete.o: $(DEFSRC)/complete.def +builtins/declare.o: $(DEFSRC)/declare.def +builtins/echo.o: $(DEFSRC)/echo.def +builtins/enable.o: $(DEFSRC)/enable.def +builtins/eval.o: $(DEFSRC)/eval.def +builtins/exec.o: $(DEFSRC)/exec.def +builtins/exit.o: $(DEFSRC)/exit.def +builtins/fc.o: $(DEFSRC)/fc.def +builtins/fg_bg.o: $(DEFSRC)/fg_bg.def +builtins/getopts.o: $(DEFSRC)/getopts.def +builtins/hash.o: $(DEFSRC)/hash.def +builtins/help.o: $(DEFSRC)/help.def +builtins/history.o: $(DEFSRC)/history.def +builtins/inlib.o: $(DEFSRC)/inlib.def +builtins/jobs.o: $(DEFSRC)/jobs.def +builtins/kill.o: $(DEFSRC)/kill.def +builtins/let.o: $(DEFSRC)/let.def +builtins/mapfile.o: $(DEFSRC)/mapfile.def +builtins/pushd.o: $(DEFSRC)/pushd.def +builtins/read.o: $(DEFSRC)/read.def +builtins/reserved.o: $(DEFSRC)/reserved.def +builtins/return.o: $(DEFSRC)/return.def +builtins/set.o: $(DEFSRC)/set.def +builtins/setattr.o: $(DEFSRC)/setattr.def +builtins/shift.o: $(DEFSRC)/shift.def +builtins/shopt.o: $(DEFSRC)/shopt.def +builtins/source.o: $(DEFSRC)/source.def +builtins/suspend.o: $(DEFSRC)/suspend.def +builtins/test.o: $(DEFSRC)/test.def +builtins/times.o: $(DEFSRC)/times.def +builtins/trap.o: $(DEFSRC)/trap.def +builtins/type.o: $(DEFSRC)/type.def +builtins/ulimit.o: $(DEFSRC)/ulimit.def +builtins/umask.o: $(DEFSRC)/umask.def +builtins/wait.o: $(DEFSRC)/wait.def diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..0cc3c45 --- /dev/null +++ b/NEWS @@ -0,0 +1,1815 @@ +This is a terse description of the new features added to bash-4.3 since +the release of bash-4.2. As always, the manual page (doc/bash.1) is +the place to look for complete descriptions. + +1. New Features in Bash + +a. The `helptopic' completion action now maps to all the help topics, not just + the shell builtins. + +b. The `help' builtin no longer does prefix substring matching first, so + `help read' does not match `readonly', but will do it if exact string + matching fails. + +c. The shell can be compiled to not display a message about processes that + terminate due to SIGTERM. + +d. Non-interactive shells now react to the setting of checkwinsize and set + LINES and COLUMNS after a foreground job exits. + +e. There is a new shell option, `globasciiranges', which, when set to on, + forces globbing range comparisons to use character ordering as if they + were run in the C locale. + +f. There is a new shell option, `direxpand', which makes filename completion + expand variables in directory names in the way bash-4.1 did. + +g. In Posix mode, the `command' builtin does not change whether or not a + builtin it shadows is treated as an assignment builtin. + +h. The `return' and `exit' builtins accept negative exit status arguments. + +i. The word completion code checks whether or not a filename containing a + shell variable expands to a directory name and appends `/' to the word + as appropriate. The same code expands shell variables in command names + when performing command completion. + +j. In Posix mode, it is now an error to attempt to define a shell function + with the same name as a Posix special builtin. + +k. When compiled for strict Posix conformance, history expansion is disabled + by default. + +l. The history expansion character (!) does not cause history expansion when + followed by the closing quote in a double-quoted string. + +m. `complete' and its siblings compgen/compopt now takes a new `-o noquote' + option to inhibit quoting of the completions. + +n. Setting HISTSIZE to a value less than zero causes the history list to be + unlimited (setting it 0 zero disables the history list). + +o. Setting HISTFILESIZE to a value less than zero causes the history file size + to be unlimited (setting it to 0 causes the history file to be truncated + to zero size). + +p. The `read' builtin now skips NUL bytes in the input. + +q. There is a new `bind -X' option to print all key sequences bound to Unix + commands. + +r. When in Posix mode, `read' is interruptible by a trapped signal. After + running the trap handler, read returns 128+signal and throws away any + partially-read input. + +s. The command completion code skips whitespace and assignment statements + before looking for the command name word to be completed. + +t. The build process has a new mechanism for constructing separate help files + that better reflects the current set of compilation options. + +u. The -nt and -ot options to test now work with files with nanosecond + timestamp resolution. + +v. The shell saves the command history in any shell for which history is + enabled and HISTFILE is set, not just interactive shells. + +w. The shell has `nameref' variables and new -n(/+n) options to declare and + unset to use them, and a `test -R' option to test for them. + +x. The shell now allows assigning, referencing, and unsetting elements of + indexed arrays using negative subscripts (a[-1]=2, echo ${a[-1]}) which + count back from the last element of the array. + +y. The {x} operators to the [[ conditional command now do string + comparison according to the current locale if the compatibility level + is greater than 40. + +r. Programmable completion now uses the completion for `b' instead of `a' + when completion is attempted on a line like: a $(b c. + +s. Force extglob on temporarily when parsing the pattern argument to + the == and != operators to the [[ command, for compatibility. + +t. Changed the behavior of interrupting the wait builtin when a SIGCHLD is + received and a trap on SIGCHLD is set to be Posix-mode only. + +u. The read builtin has a new `-N nchars' option, which reads exactly NCHARS + characters, ignoring delimiters like newline. + +v. The mapfile/readarray builtin no longer stores the commands it invokes via + callbacks in the history list. + +w. There is a new `compat40' shopt option. + +2. New Features in Readline + +a. New bindable function: menu-complete-backward. + +b. In the vi insertion keymap, C-n is now bound to menu-complete by default, + and C-p to menu-complete-backward. + +c. When in vi command mode, repeatedly hitting ESC now does nothing, even + when ESC introduces a bound key sequence. This is closer to how + historical vi behaves. + +d. New bindable function: skip-csi-sequence. Can be used as a default to + consume key sequences generated by keys like Home and End without having + to bind all keys. + +e. New application-settable function: rl_filename_rewrite_hook. Can be used + to rewite or modify filenames read from the file system before they are + compared to the word to be completed. + +f. New bindable variable: skip-completed-text, active when completing in the + middle of a word. If enabled, it means that characters in the completion + that match characters in the remainder of the word are "skipped" rather + than inserted into the line. + +g. The pre-readline-6.0 version of menu completion is available as + "old-menu-complete" for users who do not like the readline-6.0 version. + +h. New bindable variable: echo-control-characters. If enabled, and the + tty ECHOCTL bit is set, controls the echoing of characters corresponding + to keyboard-generated signals. + +i. New bindable variable: enable-meta-key. Controls whether or not readline + sends the smm/rmm sequences if the terminal indicates it has a meta key + that enables eight-bit characters. + +------------------------------------------------------------------------------- +This is a terse description of the new features added to bash-4.0 since +the release of bash-3.2. As always, the manual page (doc/bash.1) is +the place to look for complete descriptions. + +1. New Features in Bash + +a. When using substring expansion on the positional parameters, a starting + index of 0 now causes $0 to be prefixed to the list. + +b. The `help' builtin now prints its columns with entries sorted vertically + rather than horizontally. + +c. There is a new variable, $BASHPID, which always returns the process id of + the current shell. + +d. There is a new `autocd' option that, when enabled, causes bash to attempt + to `cd' to a directory name that is supplied as the first word of a + simple command. + +e. There is a new `checkjobs' option that causes the shell to check for and + report any running or stopped jobs at exit. + +f. The programmable completion code exports a new COMP_TYPE variable, set to + a character describing the type of completion being attempted. + +g. The programmable completion code exports a new COMP_KEY variable, set to + the character that caused the completion to be invoked (e.g., TAB). + +h. If creation of a child process fails due to insufficient resources, bash + will try again several times before reporting failure. + +i. The programmable completion code now uses the same set of characters as + readline when breaking the command line into a list of words. + +j. The block multiplier for the ulimit -c and -f options is now 512 when in + Posix mode, as Posix specifies. + +k. Changed the behavior of the read builtin to save any partial input received + in the specified variable when the read builtin times out. This also + results in variables specified as arguments to read to be set to the empty + string when there is no input available. When the read builtin times out, + it returns an exit status greater than 128. + +l. The shell now has the notion of a `compatibility level', controlled by + new variables settable by `shopt'. Setting this variable currently + restores the bash-3.1 behavior when processing quoted strings on the rhs + of the `=~' operator to the `[[' command. + +m. The `ulimit' builtin now has new -b (socket buffer size) and -T (number + of threads) options. + +n. The -p option to `declare' now displays all variable values and attributes + (or function values and attributes if used with -f). + +o. There is a new `compopt' builtin that allows completion functions to modify + completion options for existing completions or the completion currently + being executed. + +p. The `read' builtin has a new -i option which inserts text into the reply + buffer when using readline. + +q. A new `-E' option to the complete builtin allows control of the default + behavior for completion on an empty line. + +r. There is now limited support for completing command name words containing + globbing characters. + +s. Changed format of internal help documentation for all builtins to roughly + follow man page format. + +t. The `help' builtin now has a new -d option, to display a short description, + and a -m option, to print help information in a man page-like format. + +u. There is a new `mapfile' builtin to populate an array with lines from a + given file. The name `readarray' is a synonym. + +v. If a command is not found, the shell attempts to execute a shell function + named `command_not_found_handle', supplying the command words as the + function arguments. + +w. There is a new shell option: `globstar'. When enabled, the globbing code + treats `**' specially -- it matches all directories (and files within + them, when appropriate) recursively. + +x. There is a new shell option: `dirspell'. When enabled, the filename + completion code performs spelling correction on directory names during + completion. + +y. The `-t' option to the `read' builtin now supports fractional timeout + values. + +z. Brace expansion now allows zero-padding of expanded numeric values and + will add the proper number of zeroes to make sure all values contain the + same number of digits. + +aa. There is a new bash-specific bindable readline function: `dabbrev-expand'. + It uses menu completion on a set of words taken from the history list. + +bb. The command assigned to a key sequence with `bind -x' now sets two new + variables in the environment of the executed command: READLINE_LINE_BUFFER + and READLINE_POINT. The command can change the current readline line + and cursor position by modifying READLINE_LINE_BUFFER and READLINE_POINT, + respectively. + +cc. There is a new &>> redirection operator, which appends the standard output + and standard error to the named file. + +dd. The parser now understands `|&' as a synonym for `2>&1 |', which redirects + the standard error for a command through a pipe. + +ee. The new `;&' case statement action list terminator causes execution to + continue with the action associated with the next pattern in the + statement rather than terminating the command. + +ff. The new `;;&' case statement action list terminator causes the shell to + test the next set of patterns after completing execution of the current + action, rather than terminating the command. + +gg. The shell understands a new variable: PROMPT_DIRTRIM. When set to an + integer value greater than zero, prompt expansion of \w and \W will + retain only that number of trailing pathname components and replace + the intervening characters with `...'. + +hh. There are new case-modifying word expansions: uppercase (^[^]) and + lowercase (,[,]). They can work on either the first character or + array element, or globally. They accept an optional shell pattern + that determines which characters to modify. There is an optionally- + configured feature to include capitalization operators. + +ii. The shell provides associative array variables, with the appropriate + support to create, delete, assign values to, and expand them. + +jj. The `declare' builtin now has new -l (convert value to lowercase upon + assignment) and -u (convert value to uppercase upon assignment) options. + There is an optionally-configurable -c option to capitalize a value at + assignment. + +kk. There is a new `coproc' reserved word that specifies a coprocess: an + asynchronous command run with two pipes connected to the creating shell. + Coprocs can be named. The input and output file descriptors and the + PID of the coprocess are available to the calling shell in variables + with coproc-specific names. + +ll. A value of 0 for the -t option to `read' now returns success if there is + input available to be read from the specified file descriptor. + +mm. CDPATH and GLOBIGNORE are ignored when the shell is running in privileged + mode. + +nn. New bindable readline functions shell-forward-word and shell-backward-word, + which move forward and backward words delimited by shell metacharacters + and honor shell quoting. + +oo. New bindable readline functions shell-backward-kill-word and shell-kill-word + which kill words backward and forward, but use the same word boundaries + as shell-forward-word and shell-backward-word. + +2. New Features in Readline + +a. A new variable, rl_sort_completion_matches; allows applications to inhibit + match list sorting (but beware: some things don't work right if + applications do this). + +b. A new variable, rl_completion_invoking_key; allows applications to discover + the key that invoked rl_complete or rl_menu_complete. + +c. The functions rl_block_sigint and rl_release_sigint are now public and + available to calling applications who want to protect critical sections + (like redisplay). + +d. The functions rl_save_state and rl_restore_state are now public and + available to calling applications; documented rest of readline's state + flag values. + +e. A new user-settable variable, `history-size', allows setting the maximum + number of entries in the history list. + +f. There is a new implementation of menu completion, with several improvements + over the old; the most notable improvement is a better `completions + browsing' mode. + +g. The menu completion code now uses the rl_menu_completion_entry_function + variable, allowing applications to provide their own menu completion + generators. + +h. There is support for replacing a prefix of a pathname with a `...' when + displaying possible completions. This is controllable by setting the + `completion-prefix-display-length' variable. Matches with a common prefix + longer than this value have the common prefix replaced with `...'. + +i. There is a new `revert-all-at-newline' variable. If enabled, readline will + undo all outstanding changes to all history lines when `accept-line' is + executed. + +j. If the kernel supports it, readline displays special characters + corresponding to a keyboard-generated signal when the signal is received. + +------------------------------------------------------------------------------- +This is a terse description of the new features added to bash-3.2 since +the release of bash-3.1. As always, the manual page (doc/bash.1) is +the place to look for complete descriptions. + +1. New Features in Bash + +a. Changed the parameter pattern replacement functions to not anchor the + pattern at the beginning of the string if doing global replacement - that + combination doesn't make any sense. + +b. When running in `word expansion only' mode (--wordexp option), inhibit + process substitution. + +c. Loadable builtins now work on MacOS X 10.[34]. + +d. Shells running in posix mode no longer set $HOME, as POSIX requires. + +e. The code that checks for binary files being executed as shell scripts now + checks only for NUL rather than any non-printing character. + +f. Quoting the string argument to the [[ command's =~ operator now forces + string matching, as with the other pattern-matching operators. + +2. New Features in Readline + +a. Calling applications can now set the keyboard timeout to 0, allowing + poll-like behavior. + +b. The value of SYS_INPUTRC (configurable at compilation time) is now used as + the default last-ditch startup file. + +c. The history file reading functions now allow windows-like \r\n line + terminators. + +------------------------------------------------------------------------------- +This is a terse description of the new features added to bash-3.1 since +the release of bash-3.0. As always, the manual page (doc/bash.1) is +the place to look for complete descriptions. + +1. New Features in Bash + +a. Bash now understands LC_TIME as a special variable so that time display + tracks the current locale. + +b. BASH_ARGC, BASH_ARGV, BASH_SOURCE, and BASH_LINENO are no longer created + as `invisible' variables and may not be unset. + +c. In POSIX mode, if `xpg_echo' option is enabled, the `echo' builtin doesn't + try to interpret any options at all, as POSIX requires. + +d. The `bg' builtin now accepts multiple arguments, as POSIX seems to specify. + +e. Fixed vi-mode word completion and glob expansion to perform tilde + expansion. + +f. The `**' mathematic exponentiation operator is now right-associative. + +g. The `ulimit' builtin has new options: -i (max number of pending signals), + -q (max size of POSIX message queues), and -x (max number of file locks). + +h. A bare `%' once again expands to the current job when used as a job + specifier. + +i. The `+=' assignment operator (append to the value of a string or array) is + now supported for assignment statements and arguments to builtin commands + that accept assignment statements. + +j. BASH_COMMAND now preserves its value when a DEBUG trap is executed. + +k. The `gnu_errfmt' option is enabled automatically if the shell is running + in an emacs terminal window. + +l. New configuration option: --single-help-strings. Causes long help text + to be written as a single string; intended to ease translation. + +m. The COMP_WORDBREAKS variable now causes the list of word break characters + to be emptied when the variable is unset. + +n. An unquoted expansion of $* when $IFS is empty now causes the positional + parameters to be concatenated if the expansion doesn't undergo word + splitting. + +o. Bash now inherits $_ from the environment if it appears there at startup. + +p. New shell option: nocasematch. If non-zero, shell pattern matching ignores + case when used by `case' and `[[' commands. + +q. The `printf' builtin takes a new option: -v var. That causes the output + to be placed into var instead of on stdout. + +r. By default, the shell no longer reports processes dying from SIGPIPE. + +s. Bash now sets the extern variable `environ' to the export environment it + creates, so C library functions that call getenv() (and can't use the + shell-provided replacement) get current values of environment variables. + +t. A new configuration option, `--enable-strict-posix-default', which will + build bash to be POSIX conforming by default. + +u. If compiled for strict POSIX conformance, LINES and COLUMNS may now + override the true terminal size. + +2. New Features in Readline + +a. The key sequence sent by the keypad `delete' key is now automatically + bound to delete-char. + +b. A negative argument to menu-complete now cycles backward through the + completion list. + +c. A new bindable readline variable: bind-tty-special-chars. If non-zero, + readline will bind the terminal special characters to their readline + equivalents when it's called (on by default). + +d. New bindable command: vi-rubout. Saves deleted text for possible + reinsertion, as with any vi-mode `text modification' command; `X' is bound + to this in vi command mode. + +e. A new external application-controllable variable that allows the LINES + and COLUMNS environment variables to set the window size regardless of + what the kernel returns: rl_prefer_env_winsize + +------------------------------------------------------------------------------- +This is a terse description of the new features added to bash-3.0 since +the release of bash-2.05b. As always, the manual page (doc/bash.1) is +the place to look for complete descriptions. + +1. New Features in Bash + +a. ANSI string expansion now implements the \x{hexdigits} escape. + +b. There is a new loadable `strftime' builtin. + +c. New variable, COMP_WORDBREAKS, which controls the readline completer's + idea of word break characters. + +d. The `type' builtin no longer reports on aliases unless alias expansion + will actually be performed. + +e. HISTCONTROL is now a colon-separated list of values, which permits + more extensibility and backwards compatibility. + +f. HISTCONTROL may now include the `erasedups' option, which causes all lines + matching a line being added to be removed from the history list. + +g. `configure' has a new `--enable-multibyte' argument that permits multibyte + character support to be disabled even on systems that support it. + +h. New variables to support the bash debugger: BASH_ARGC, BASH_ARGV, + BASH_SOURCE, BASH_LINENO, BASH_SUBSHELL, BASH_EXECUTION_STRING, + BASH_COMMAND + +i. FUNCNAME has been changed to support the debugger: it's now an array + variable. + +j. for, case, select, arithmetic commands now keep line number information + for the debugger. + +k. There is a new `RETURN' trap executed when a function or sourced script + returns (not inherited child processes; inherited by command substitution + if function tracing is enabled and the debugger is active). + +l. New invocation option: --debugger. Enables debugging and turns on new + `extdebug' shell option. + +m. New `functrace' and `errtrace' options to `set -o' cause DEBUG and ERR + traps, respectively, to be inherited by shell functions. Equivalent to + `set -T' and `set -E' respectively. The `functrace' option also controls + whether or not the DEBUG trap is inherited by sourced scripts. + +n. The DEBUG trap is run before binding the variable and running the action + list in a `for' command, binding the selection variable and running the + query in a `select' command, and before attempting a match in a `case' + command. + +o. New `--enable-debugger' option to `configure' to compile in the debugger + support code. + +p. `declare -F' now prints out extra line number and source file information + if the `extdebug' option is set. + +q. If `extdebug' is enabled, a non-zero return value from a DEBUG trap causes + the next command to be skipped, and a return value of 2 while in a + function or sourced script forces a `return'. + +r. New `caller' builtin to provide a call stack for the bash debugger. + +s. The DEBUG trap is run just before the first command in a function body is + executed, for the debugger. + +t. `for', `select', and `case' command heads are printed when `set -x' is + enabled. + +u. There is a new {x..y} brace expansion, which is shorthand for {x.x+1, + x+2,...,y}. x and y can be integers or single characters; the sequence + may ascend or descend; the increment is always 1. + +v. New ksh93-like ${!array[@]} expansion, expands to all the keys (indices) + of array. + +w. New `force_fignore' shopt option; if enabled, suffixes specified by + FIGNORE cause words to be ignored when performing word completion even + if they're the only possibilities. + +x. New `gnu_errfmt' shopt option; if enabled, error messages follow the `gnu + style' (filename:lineno:message) format. + +y. New `-o bashdefault' option to complete and compgen; if set, causes the + whole set of bash completions to be performed if the compspec doesn't + result in a match. + +z. New `-o plusdirs' option to complete and compgen; if set, causes directory + name completion to be performed and the results added to the rest of the + possible completions. + +aa. `kill' is available as a builtin even when the shell is built without + job control. + +bb. New HISTTIMEFORMAT variable; value is a format string to pass to + strftime(3). If set and not null, the `history' builtin prints out + timestamp information according to the specified format when displaying + history entries. If set, bash tells the history library to write out + timestamp information when the history file is written. + +cc. The [[ ... ]] command has a new binary `=~' operator that performs + extended regular expression (egrep-like) matching. + +dd. `configure' has a new `--enable-cond-regexp' option (enabled by default) + to enable the =~ operator and regexp matching in [[ ... ]]. + +ee. Subexpressions matched by the =~ operator are placed in the new + BASH_REMATCH array variable. + +ff. New `failglob' option that causes an expansion error when pathname + expansion fails to produce a match. + +gg. New `set -o pipefail' option that causes a pipeline to return a failure + status if any of the processes in the pipeline fail, not just the last + one. + +hh. printf builtin understands two new escape sequences: \" and \?. + +ii. `echo -e' understands two new escape sequences: \" and \?. + +jj. The GNU `gettext' package and libintl have been integrated; the shell's + messages can be translated into different languages. + +kk. The `\W' prompt expansion now abbreviates $HOME as `~', like `\w'. + +ll. The error message printed when bash cannot open a shell script supplied + as argument 1 now includes the name of the shell, to better identify + the error as coming from bash. + +mm. The parameter pattern removal and substitution expansions are now much + faster and more efficient when using multibyte characters. + +nn. The `jobs', `kill', and `wait' builtins now accept job control notation + even if job control is not enabled. + +oo. The historical behavior of `trap' that allows a missing `action' argument + to cause each specified signal's handling to be reset to its default is + now only supported when `trap' is given a single non-option argument. + +2. New Features in Readline + +a. History expansion has a new `a' modifier equivalent to the `g' modifier + for compatibility with the BSD csh. + +b. History expansion has a new `G' modifier equivalent to the BSD csh `g' + modifier, which performs a substitution once per word. + +c. All non-incremental search operations may now undo the operation of + replacing the current line with the history line. + +d. The text inserted by an `a' command in vi mode can be reinserted with + `.'. + +e. New bindable variable, `show-all-if-unmodified'. If set, the readline + completer will list possible completions immediately if there is more + than one completion and partial completion cannot be performed. + +f. There is a new application-callable `free_history_entry()' function. + +g. History list entries now contain timestamp information; the history file + functions know how to read and write timestamp information associated + with each entry. + +h. Four new key binding functions have been added: + + rl_bind_key_if_unbound() + rl_bind_key_if_unbound_in_map() + rl_bind_keyseq_if_unbound() + rl_bind_keyseq_if_unbound_in_map() + +i. New application variable, rl_completion_quote_character, set to any + quote character readline finds before it calls the application completion + function. + +j. New application variable, rl_completion_suppress_quote, settable by an + application completion function. If set to non-zero, readline does not + attempt to append a closing quote to a completed word. + +k. New application variable, rl_completion_found_quote, set to a non-zero + value if readline determines that the word to be completed is quoted. + Set before readline calls any application completion function. + +l. New function hook, rl_completion_word_break_hook, called when readline + needs to break a line into words when completion is attempted. Allows + the word break characters to vary based on position in the line. + +m. New bindable command: unix-filename-rubout. Does the same thing as + unix-word-rubout, but adds `/' to the set of word delimiters. + +n. When listing completions, directories have a `/' appended if the + `mark-directories' option has been enabled. + +------------------------------------------------------------------------------- +This is a terse description of the new features added to bash-2.05b since +the release of bash-2.05a. As always, the manual page (doc/bash.1) is +the place to look for complete descriptions. + +1. New Features in Bash + +a. If set, TMOUT is the default timeout for the `read' builtin. + +b. `type' has two new options: `-f' suppresses shell function lookup, and + `-P' forces a $PATH search. + +c. New code to handle multibyte characters. + +d. `select' was changed to be more ksh-compatible, in that the menu is + reprinted each time through the loop only if REPLY is set to NULL. + The previous behavior is available as a compile-time option. + +e. `complete -d' and `complete -o dirnames' now force a slash to be + appended to names which are symlinks to directories. + +f. There is now a bindable edit-and-execute-command readline command, + like the vi-mode `v' command, bound to C-xC-e in emacs mode. + +g. Added support for ksh93-like [:word:] character class in pattern matching. + +h. The $'...' quoting construct now expands \cX to Control-X. + +i. A new \D{...} prompt expansion; passes the `...' to strftime and inserts + the result into the expanded prompt. + +j. The shell now performs arithmetic in the largest integer size the + machine supports (intmax_t), instead of long. + +k. If a numeric argument is supplied to one of the bash globbing completion + functions, a `*' is appended to the word before expansion is attempted. + +l. The bash globbing completion functions now allow completions to be listed + with double tabs or if `show-all-if-ambiguous' is set. + +m. New `-o nospace' option for `complete' and `compgen' builtins; suppresses + readline's appending a space to the completed word. + +n. New `here-string' redirection operator: <<< word. + +o. When displaying variables, function attributes and definitions are shown + separately, allowing them to be re-used as input (attempting to re-use + the old output would result in syntax errors). + +p. There is a new configuration option `--enable-mem-scramble', controls + bash malloc behavior of writing garbage characters into memory at + allocation and free time. + +q. The `complete' and `compgen' builtins now have a new `-s/-A service' + option to complete on names from /etc/services. + +r. `read' has a new `-u fd' option to read from a specified file descriptor. + +s. Fix the completion code so that expansion errors in a directory name + don't cause a longjmp back to the command loop. + +t. Fixed word completion inside command substitution to work a little more + intuitively. + +u. The `printf' %q format specifier now uses $'...' quoting to print the + argument if it contains non-printing characters. + +v. The `declare' and `typeset' builtins have a new `-t' option. When applied + to functions, it causes the DEBUG trap to be inherited by the named + function. Currently has no effect on variables. + +w. The DEBUG trap is now run *before* simple commands, ((...)) commands, + [[...]] conditional commands, and for ((...)) loops. + +x. The expansion of $LINENO inside a shell function is only relative to the + function start if the shell is interactive -- if the shell is running a + script, $LINENO expands to the line number in the script. This is as + POSIX-2001 requires. + +y. The bash debugger in examples/bashdb has been modified to work with the + new DEBUG trap semantics, the command set has been made more gdb-like, + and the changes to $LINENO make debugging functions work better. Code + from Gary Vaughan. + +z. New [n]<&word- and [n]>&word- redirections from ksh93 -- move fds (dup + and close). + +aa. There is a new `-l' invocation option, equivalent to `--login'. + +bb. The `hash' builtin has a new `-l' option to list contents in a reusable + format, and a `-d' option to remove a name from the hash table. + +cc. There is now support for placing the long help text into separate files + installed into ${datadir}/bash. Not enabled by default; can be turned + on with `--enable-separate-helpfiles' option to configure. + +dd. All builtins that take operands accept a `--' pseudo-option, except + `echo'. + +ee. The `echo' builtin now accepts \0xxx (zero to three octal digits following + the `0') in addition to \xxx (one to three octal digits) for SUSv3/XPG6/ + POSIX.1-2001 compliance. + + +2. New Features in Readline + +a. Support for key `subsequences': allows, e.g., ESC and ESC-a to both + be bound to readline functions. Now the arrow keys may be used in vi + insert mode. + +b. When listing completions, and the number of lines displayed is more than + the screen length, readline uses an internal pager to display the results. + This is controlled by the `page-completions' variable (default on). + +c. New code to handle editing and displaying multibyte characters. + +d. The behavior introduced in bash-2.05a of deciding whether or not to + append a slash to a completed name that is a symlink to a directory has + been made optional, controlled by the `mark-symlinked-directories' + variable (default is the 2.05a behavior). + +e. The `insert-comment' command now acts as a toggle if given a numeric + argument: if the first characters on the line don't specify a + comment, insert one; if they do, delete the comment text + +f. New application-settable completion variable: + rl_completion_mark_symlink_dirs, allows an application's completion + function to temporarily override the user's preference for appending + slashes to names which are symlinks to directories. + +g. New function available to application completion functions: + rl_completion_mode, to tell how the completion function was invoked + and decide which argument to supply to rl_complete_internal (to list + completions, etc.). + +h. Readline now has an overwrite mode, toggled by the `overwrite-mode' + bindable command, which could be bound to `Insert'. + +i. New application-settable completion variable: + rl_completion_suppress_append, inhibits appending of + rl_completion_append_character to completed words. + +j. New key bindings when reading an incremental search string: ^W yanks + the currently-matched word out of the current line into the search + string; ^Y yanks the rest of the current line into the search string, + DEL or ^H deletes characters from the search string. + +------------------------------------------------------------------------------- +This is a terse description of the new features added to bash-2.05a since +the release of bash-2.05. As always, the manual page (doc/bash.1) is +the place to look for complete descriptions. + +1. New Features in Bash + +a. Added support for DESTDIR installation root prefix, so you can do a + `make install DESTDIR=bash-root' and do easier binary packaging. + +b. Added support for builtin printf "'" flag character as per latest POSIX + drafts. + +c. Support for POSIX.2 printf(1) length specifiers `j', `t', and `z' (from + ISO C99). + +d. New autoconf macro, RL_LIB_READLINE_VERSION, for use by other applications + (bash doesn't use very much of what it returns). + +e. `set [-+]o nolog' is recognized as required by the latest POSIX drafts, + but ignored. + +f. New read-only `shopt' option: login_shell. Set to non-zero value if the + shell is a login shell. + +g. New `\A' prompt string escape sequence; expands to time in 24 HH:MM format. + +h. New `-A group/-g' option to complete and compgen; does group name + completion. + +i. New `-t' option to `hash' to list hash values for each filename argument. + +j. New [-+]O invocation option to set and unset `shopt' options at startup. + +k. configure's `--with-installed-readline' option now takes an optional + `=PATH' suffix to set the root of the tree where readline is installed + to PATH. + +l. The ksh-like `ERR' trap has been added. The `ERR' trap will be run + whenever the shell would have exited if the -e option were enabled. + It is not inherited by shell functions. + +m. `readonly', `export', and `declare' now print variables which have been + given attributes but not set by assigning a value as just a command and + a variable name (like `export foo') when listing, as the latest POSIX + drafts require. + +n. `bashbug' now requires that the subject be changed from the default. + +o. configure has a new `--enable-largefile' option, like other GNU utilities. + +p. `for' loops now allow empty word lists after `in', like the latest POSIX + drafts require. + +q. The builtin `ulimit' now takes two new non-numeric arguments: `hard', + meaning the current hard limit, and `soft', meaning the current soft + limit, in addition to `unlimited' + +r. `ulimit' now prints the option letter associated with a particular + resource when printing more than one limit. + +s. `ulimit' prints `hard' or `soft' when a value is not `unlimited' but is + one of RLIM_SAVED_MAX or RLIM_SAVED_CUR, respectively. + +t. The `printf' builtin now handles the %a and %A conversions if they're + implemented by printf(3). + +u. The `printf' builtin now handles the %F conversion (just about like %f). + +v. The `printf' builtin now handles the %n conversion like printf(3). The + corresponding argument is the name of a shell variable to which the + value is assigned. + +2. New Features in Readline + +a. Added extern declaration for rl_get_termcap to readline.h, making it a + public function (it was always there, just not in readline.h). + +b. New #defines in readline.h: RL_READLINE_VERSION, currently 0x0402, + RL_VERSION_MAJOR, currently 4, and RL_VERSION_MINOR, currently 2. + +c. New readline variable: rl_readline_version, mirrors RL_READLINE_VERSION. + +d. New bindable boolean readline variable: match-hidden-files. Controls + completion of files beginning with a `.' (on Unix). Enabled by default. + +e. The history expansion code now allows any character to terminate a + `:first-' modifier, like csh. + +f. New bindable variable `history-preserve-point'. If set, the history + code attempts to place the user at the same location on each history + line retrived with previous-history or next-history. + +------------------------------------------------------------------------------- +This is a terse description of the new features added to bash-2.05 since +the release of bash-2.04. As always, the manual page (doc/bash.1) is +the place to look for complete descriptions. + +1. New Features in Bash + +a. Added a new `--init-file' invocation argument as a synonym for `--rcfile', + per the new GNU coding standards. + +b. The /dev/tcp and /dev/udp redirections now accept service names as well as + port numbers. + +c. `complete' and `compgen' now take a `-o value' option, which controls some + of the aspects of that compspec. Valid values are: + + default - perform bash default completion if programmable + completion produces no matches + dirnames - perform directory name completion if programmable + completion produces no matches + filenames - tell readline that the compspec produces filenames, + so it can do things like append slashes to + directory names and suppress trailing spaces + +d. A new loadable builtin, realpath, which canonicalizes and expands symlinks + in pathname arguments. + +e. When `set' is called without options, it prints function defintions in a + way that allows them to be reused as input. This affects `declare' and + `declare -p' as well. This only happens when the shell is not in POSIX + mode, since POSIX.2 forbids this behavior. + +f. Bash-2.05 once again honors the current locale setting when processing + ranges within pattern matching bracket expressions (e.g., [A-Z]). + +2. New Features in Readline + +a. The blink timeout for paren matching is now settable by applications, + via the rl_set_paren_blink_timeout() function. + +b. _rl_executing_macro has been renamed to rl_executing_macro, which means + it's now part of the public interface. + +c. Readline has a new variable, rl_readline_state, which is a bitmap that + encapsulates the current state of the library; intended for use by + callbacks and hook functions. + +d. New application-callable function rl_set_prompt(const char *prompt): + expands its prompt string argument and sets rl_prompt to the result. + +e. New application-callable function rl_set_screen_size(int rows, int cols): + public method for applications to set readline's idea of the screen + dimensions. + +f. New function, rl_get_screen_size (int *rows, int *columns), returns + readline's idea of the screen dimensions. + +g. The timeout in rl_gather_tyi (readline keyboard input polling function) + is now settable via a function (rl_set_keyboard_input_timeout()). + +h. Renamed the max_input_history variable to history_max_entries; the old + variable is maintained for backwards compatibility. + +i. The list of characters that separate words for the history tokenizer is + now settable with a variable: history_word_delimiters. The default + value is as before. + +------------------------------------------------------------------------------- +This is a terse description of the new features added to bash-2.04 since +the release of bash-2.03. As always, the manual page (doc/bash.1) is +the place to look for complete descriptions. + +1. New Features in Bash + +a. The history builtin has a `-d offset' option to delete the history entry + at position `offset'. + +b. The prompt expansion code has two new escape sequences: \j, the number of + active jobs; and \l, the basename of the shell's tty device name. + +c. The `bind' builtin has a new `-x' option to bind key sequences to shell + commands. + +d. There is a new shell option, no_empty_command_completion, which, when + enabled, disables command completion when TAB is typed on an empty line. + +e. The `help' builtin has a `-s' option to just print a builtin's usage + synopsis. + +f. There are several new arithmetic operators: id++, id-- (variable + post-increment/decrement), ++id, --id (variable pre-increment/decrement), + expr1 , expr2 (comma operator). + +g. There is a new ksh-93 style arithmetic for command: + for ((expr1 ; expr2; expr3 )); do list; done + +h. The `read' builtin has a number of new options: + -t timeout only wait timeout seconds for input + -n nchars only read nchars from input instead of a full line + -d delim read until delim rather than newline + -s don't echo input chars as they are read + +i. The redirection code now handles several filenames specially: + /dev/fd/N, /dev/stdin, /dev/stdout, and /dev/stderr, whether or + not they are present in the file system. + +j. The redirection code now recognizes pathnames of the form + /dev/tcp/host/port and /dev/udp/host/port, and tries to open a socket + of the appropriate type to the specified port on the specified host. + +k. The ksh-93 ${!prefix*} expansion, which expands to the names of all + shell variables with prefix PREFIX, has been implemented. + +l. There is a new dynamic variable, FUNCNAME, which expands to the name of + a currently-executing function. Assignments to FUNCNAME have no effect. + +m. The GROUPS variable is no longer readonly; assignments to it are silently + discarded. This means it can be unset. + +n. A new programmable completion facility, with two new builtin commands: + complete and compgen. + +o. configure has a new option, `--enable-progcomp', to compile in the + programmable completion features (enabled by default). + +p. `shopt' has a new option, `progcomp', to enable and disable programmable + completion at runtime. + +q. Unsetting HOSTFILE now clears the list of hostnames used for completion. + +r. configure has a new option, `--enable-bash-malloc', replacing the old + `--with-gnu-malloc' (which is still present for backwards compatibility). + +s. There is a new manual page describing rbash, the restricted shell. + +t. `bashbug' has new `--help' and `--version' options. + +u. `shopt' has a new `xpg_echo' option, which controls the behavior of + `echo' with respect to backslash-escaped characters at runtime. + +v. If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read the + startup files, even if they are not interactive. + +w. The LC_NUMERIC variable is now treated specially, and used to set the + LC_NUMERIC locale category for number formatting, e.g., when `printf' + displays floating-point numbers. + +2. New features in Readline + +a. Parentheses matching is now always compiled into readline, and enabled + or disabled when the value of the `blink-matching-paren' variable is + changed. + +b. MS-DOS systems now use ~/_inputrc as the last-ditch inputrc filename. + +c. MS-DOS systems now use ~/_history as the default history file. + +d. history-search-{forward,backward} now leave the point at the end of the + line when the string to search for is empty, like + {reverse,forward}-search-history. + +e. history-search-{forward,backward} now leave the last history line found + in the readline buffer if the second or subsequent search fails. + +f. New function for use by applications: rl_on_new_line_with_prompt, used + when an application displays the prompt itself before calling readline(). + +g. New variable for use by applications: rl_already_prompted. An application + that displays the prompt itself before calling readline() must set this to + a non-zero value. + +h. A new variable, rl_gnu_readline_p, always 1. The intent is that an + application can verify whether or not it is linked with the `real' + readline library or some substitute. + +------------------------------------------------------------------------------- +This is a terse description of the new features added to bash-2.03 since +the release of bash-2.02. As always, the manual page (doc/bash.1) is +the place to look for complete descriptions. + +1. New Features in Bash + +a. New `shopt' option, `restricted_shell', indicating whether or not the + shell was started in restricted mode, for use in startup files. + +b. Filename generation is now performed on the words between ( and ) in + array assignments (which it probably should have done all along). + +c. OLDPWD is now auto-exported, as POSIX.2 seems to require. + +d. ENV and BASH_ENV are read-only variables in a restricted shell. + +e. A change was made to the startup file code so that any shell begun with + the `--login' option, even non-interactive shells, will source the login + shell startup files. + +2. New Features in Readline + +a. Many changes to the signal handling: + o Readline now catches SIGQUIT and cleans up the tty before returning; + o A new variable, rl_catch_signals, is available to application writers + to indicate to readline whether or not it should install its own + signal handlers for SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP, + SIGTTIN, and SIGTTOU; + o A new variable, rl_catch_sigwinch, is available to application + writers to indicate to readline whether or not it should install its + own signal handler for SIGWINCH, which will chain to the calling + applications's SIGWINCH handler, if one is installed; + o There is a new function, rl_free_line_state, for application signal + handlers to call to free up the state associated with the current + line after receiving a signal; + o There is a new function, rl_cleanup_after_signal, to clean up the + display and terminal state after receiving a signal; + o There is a new function, rl_reset_after_signal, to reinitialize the + terminal and display state after an application signal handler + returns and readline continues + +b. There is a new function, rl_resize_terminal, to reset readline's idea of + the screen size after a SIGWINCH. + +c. New public functions: rl_save_prompt and rl_restore_prompt. These were + previously private functions with a `_' prefix. + +d. New function hook: rl_pre_input_hook, called just before readline starts + reading input, after initialization. + +e. New function hook: rl_display_matches_hook, called when readline would + display the list of completion matches. The new function + rl_display_match_list is what readline uses internally, and is available + for use by application functions called via this hook. + +f. New bindable function, delete-char-or-list, like tcsh. + +g. A new variable, rl_erase_empty_line, which, if set by an application using + readline, will cause readline to erase, prompt and all, lines on which the + only thing typed was a newline. + +h. New bindable variable: `isearch-terminators'. + +i. New bindable function: `forward-backward-delete-char' (unbound by default). + +------------------------------------------------------------------------------- +This is a terse description of the new features added to bash-2.02 since +the release of bash-2.01.1. As always, the manual page (doc/bash.1) is +the place to look for complete descriptions. + +1. New Features in Bash + +a. A new version of malloc, based on the older GNU malloc, that has many + changes, is more page-based, is more conservative with memory usage, + and does not `orphan' large blocks when they are freed. + +b. A new version of gmalloc, based on the old GLIBC malloc, with many + changes and range checking included by default. + +c. A new implementation of fnmatch(3) that includes full POSIX.2 Basic + Regular Expression matching, including character classes, collating + symbols, equivalence classes, and support for case-insensitive pattern + matching. + +d. ksh-88 egrep-style extended pattern matching ([@+*?!](patlist)) has been + implemented, controlled by a new `shopt' option, `extglob'. + +e. There is a new ksh-like `[[' compound command, which implements + extended `test' functionality. + +f. There is a new `printf' builtin, implemented according to the POSIX.2 + specification. + +g. There is a new feature for command substitution: $(< filename) now expands + to the contents of `filename', with any trailing newlines removed + (equivalent to $(cat filename)). + +h. There are new tilde prefixes which expand to directories from the + directory stack. + +i. There is a new `**' arithmetic operator to do exponentiation. + +j. There are new configuration options to control how bash is linked: + `--enable-profiling', to allow bash to be profiled with gprof, and + `--enable-static-link', to allow bash to be linked statically. + +k. There is a new configuration option, `--enable-cond-command', which + controls whether or not the `[[' command is included. It is on by + default. + +l. There is a new configuration option, `--enable-extended-glob', which + controls whether or not the ksh extended globbing feature is included. + It is enabled by default. + +m. There is a new configuration #define in config.h.top that, when enabled, + will cause all login shells to source /etc/profile and one of the user- + specific login shell startup files, whether or not the shell is + interactive. + +n. There is a new invocation option, `--dump-po-strings', to dump + a shell script's translatable strings ($"...") in GNU `po' format. + +o. There is a new `shopt' option, `nocaseglob', to enable case-insensitive + pattern matching when globbing filenames and using the `case' construct. + +p. There is a new `shopt' option, `huponexit', which, when enabled, causes + the shell to send SIGHUP to all jobs when an interactive login shell + exits. + +q. `bind' has a new `-u' option, which takes a readline function name as an + argument and unbinds all key sequences bound to that function in a + specified keymap. + +r. `disown' now has `-a' and `-r' options, to limit operation to all jobs + and running jobs, respectively. + +s. The `shopt' `-p' option now causes output to be displayed in a reusable + format. + +t. `test' has a new `-N' option, which returns true if the filename argument + has been modified since it was last accessed. + +u. `umask' now has a `-p' option to print output in a reusable format. + +v. A new escape sequence, `\xNNN', has been added to the `echo -e' and $'...' + translation code. It expands to the character whose ascii code is NNN + in hexadecimal. + +w. The prompt string expansion code has a new `\r' escape sequence. + +x. The shell may now be cross-compiled for the CYGWIN32 environment on + a Unix machine. + +2. New Features in Readline + +a. There is now an option for `iterative' yank-last-arg handline, so a user + can keep entering `M-.', yanking the last argument of successive history + lines. + +b. New variable, `print-completions-horizontally', which causes completion + matches to be displayed across the screen (like `ls -x') rather than up + and down the screen (like `ls'). + +c. New variable, `completion-ignore-case', which causes filename completion + and matching to be performed case-insensitively. + +d. There is a new bindable command, `magic-space', which causes history + expansion to be performed on the current readline buffer and a space to + be inserted into the result. + +e. There is a new bindable command, `menu-complete', which enables tcsh-like + menu completion (successive executions of menu-complete insert a single + completion match, cycling through the list of possible completions). + +f. There is a new bindable command, `paste-from-clipboard', for use on Win32 + systems, to insert the text from the Win32 clipboard into the editing + buffer. + +g. The key sequence translation code now understands printf-style backslash + escape sequences, including \NNN octal escapes. These escape sequences + may be used in key sequence definitions or macro values. + +h. An `$include' inputrc file parser directive has been added. + +------------------------------------------------------------------------------- +This is a terse description of the new features added to bash-2.01 since +the release of bash-2.0. As always, the manual page (doc/bash.1) is the +place to look for complete descriptions. + +1. New Features in Bash + +a. There is a new builtin array variable: GROUPS, the set of groups to which + the user belongs. This is used by the test suite. + +2. New Features in Readline + +a. If a key sequence bound to `universal-argument' is read while reading a + numeric argument started with `universal-argument', it terminates the + argument but is otherwise ignored. This provides a way to insert multiple + instances of a digit string, and is how GNU emacs does it. + +------------------------------------------------------------------------------- +This is a terse description of the new features added to bash-2.0 since +the release of bash-1.14.7. As always, the manual page (doc/bash.1) is +the place to look for complete descriptions. + +1. New Features in Bash + +a. There is a new invocation option, -D, that dumps translatable strings + in a script. + +b. The `long' invocation options must now be prefixed with `--'. + +c. New long invocation options: --dump-strings, --help, --verbose + +d. The `nolineediting' invocation option was renamed to `noediting'. + +e. The `nobraceexpansion' and `quiet' long invocation options were removed. + +f. The `--help' and `--version' long options now work as the GNU coding + standards specify. + +g. If invoked as `sh', bash now enters posix mode after reading the + startup files, and reads and executes commands from the file named + by $ENV if interactive (as POSIX.2 specifies). A login shell invoked + as `sh' reads $ENV after /etc/profile and ~/.profile. + +h. There is a new reserved word, `time', for timing pipelines, builtin + commands, and shell functions. It uses the value of the TIMEFORMAT + variable as a format string describing how to print the timing + statistics. + +i. The $'...' quoting syntax expands ANSI-C escapes in ... and leaves the + result single-quoted. + +j. The $"..." quoting syntax performs locale-specific translation of ... + and leaves the result double-quoted. + +k. LINENO now works correctly in functions. + +l. New variables: DIRSTACK, PIPESTATUS, BASH_VERSINFO, HOSTNAME, SHELLOPTS, + MACHTYPE. The first three are array variables. + +m. The BASH_VERSION and BASH_VERSINFO variables now include the shell's + `release status' (alpha[N], beta[N], release). + +n. Some variables have been removed: MAIL_WARNING, notify, history_control, + command_oriented_history, glob_dot_filenames, allow_null_glob_expansion, + nolinks, hostname_completion_file, noclobber, no_exit_on_failed_exec, and + cdable_vars. Most of them are now implemented with the new `shopt' + builtin; others were already implemented by `set'. + +o. Bash now uses some new variables: LC_ALL, LC_MESSAGES, LC_CTYPE, + LC_COLLATE, LANG, GLOBIGNORE, HISTIGNORE. + +p. The shell now supports integer-indexed arrays of unlimited length, + with a new compound assignment syntax and changes to the appropriate + builtin commands (declare/typeset, read, readonly, etc.). The array + index may be an arithmetic expression. + +q. ${!var}: indirect variable expansion, equivalent to eval \${$var}. + +r. ${paramter:offset[:length]}: variable substring extraction. + +s. ${parameter/pattern[/[/]string]}: variable pattern substitution. + +t. The $[...] arithmetic expansion syntax is no longer supported, in + favor of $((...)). + +u. Aliases can now be expanded in shell scripts with a shell option + (shopt expand_aliases). + +v. History and history expansion can now be used in scripts with + set -o history and set -H. + +w. All builtins now return an exit status of 2 for incorrect usage. + +x. Interactive shells resend SIGHUP to all running or stopped children + if (and only if) they exit due to a SIGHUP. + +y. New prompting expansions: \a, \e, \H, \T, \@, \v, \V. + +z. Variable expansion in prompt strings is now controllable via a shell + option (shopt promptvars). + +aa. Bash now defaults to using command-oriented history. + +bb. The history file ($HISTFILE) is now truncated to $HISTFILESIZE after + being written. + +cc. The POSIX.2 conditional arithmetic evaluation syntax (expr ? expr : expr) + has been implemented. + +dd. Each builtin now accepts `--' to signify the end of the options, except + as documented (echo, etc.). + +ee. All builtins use -p to display values in a re-readable format where + appropriate, except as documented (echo, type, etc.). + +ff. The `alias' builtin has a new -p option. + +gg. Changes to the `bind' builtin: + o has new options: -psPSVr. + o the `-d' option was renamed to `-p' + o the `-v' option now dumps variables; the old `-v' is now `-P' + +hh. The `bye' synonym for `exit' was removed. + +ii. The -L and -P options to `cd' and `pwd' have been documented. + +jj. The `cd' builtin now does spelling correction on the directory name + by default. This is settable with a shell option (shopt cdspell). + +kk. The `declare' builtin has new options: -a, -F, -p. + +ll. The `dirs' builtin has new options: -c, -p, -v. + +mm. The new `disown' builtin removes jobs from the shell's jobs table + or inhibits the resending of SIGHUP when the shell receives a + SIGHUP. + +nn. The `echo' builtin has a new escape character: \e. + +oo. The `enable' builtin can now load new builtins dynamically from shared + objects on systems with the dlopen/dlsym interface. There are a number + of examples in the examples/loadables directory. There are also + new options: -d, -f, -s, -p. + +pp. The `-all' option to `enable' was removed in favor of `-a'. + +qq. The `exec' builtin has new options: -l, -c, -a. + +rr. The `hash' builtin has a new option: -p. + +ss. The `history' builtin has new options: -c, -p, -s. + +tt. The `jobs' builtin has new options: -r, -s. + +uu. The `kill' builtin has new options: -n signum, -l signame. + +vv. The `pushd' and `popd' builtins have a new option: -n. + +ww. The `read' builtin has new options: -p prompt, -e, -a. + +xx. The `readonly' builtin has a new -a option, and the -n option was removed. + +yy. Changes to the `set' builtin: + o new options: -B, -o keyword, -o onecmd, -o history + o options removed: -l, -d, -o nohash + o options changed: +o, -h, -o hashall + o now displays variables in a format that can be re-read as input + +zz. The new `shopt' builtin controls shell optional behavior previously + done by setting and unsetting certain shell variables. + +aaa. The `test' builtin has new operators: -o option, s1 == s2, s1 < s2, + and s1 > s2, where s1 and s2 are strings. + +bbb. There is a new trap, DEBUG, executed after every simple command. + +ccc. The `trap' builtin has a new -p option. + +ddd. The `ulimit' builtin has a new -l option on 4.4BSD-based systems. + +eee. The PS1, PS2, PATH, and IFS variables may now be unset. + +fff. The restricted shell mode has been expanded and is now documented. + +ggg. Security improvements: + o functions are not imported from the environment if running setuid + or with -p + o no startup files are sourced if running setuid or with -p + +hhh. The documentation has been overhauled: the texinfo manual was + expanded, and HTML versions of the man page and texinfo manual + are included. + +iii. Changes to Posix mode: + o Command lookup now finds special builtins before shell functions. + o Failure of a special builtin causes a non-interactive shell to + exit. Failures are defined in the POSIX.2 specification. + o If the `cd' builtin finds a directory to change to using $CDPATH, + the value assigned to PWD when `cd' completes does not contain + any symbolic links. + o A non-interactive shell exits if a variable assignment error + occurs when no command name follows the assignment statements. + o A non-interactive shell exits if the interation variable in a + `for' statement or the selection variable in a `select' statement + is read-only or another variable assignment error occurs. + o The `<>' redirection operator now opens a file for both stdin and + stdout by default, not just when in posix mode. + o Assignment statements preceding special builtins now persist in + the shell's environment when the builtin completes. + + Posix mode is now completely POSIX.2-compliant (modulo bugs). When + invoked as sh, bash should be completely POSIX.2-compliant. + +jjj. The default value of PS1 is now "\s-\v\$ ". + +kkk. The ksh-like ((...)) arithmetic command syntax has been implemented. + This is exactly equivalent to `let "..."'. + +lll. Integer constants have been extended to base 64. + +mmm. The `ulimit' builtin now sets both hard and soft limits and reports the + soft limit by default. + +2. New Features in Readline + +a. New variables: enable-keypad, input-meta (new name for meta-flag), + mark-directories, visible-stats (now documented), disable-completion, + comment-begin. + +b. New bindable commands: kill-region, copy-region-as-kill, + copy-backward-word, copy-forward-word, set-mark, exchange-point-and-mark, + character-search, character-search-backward, insert-comment, + glob-expand-word, glob-list-expansions, dump-variables, dump-macros. + +c. New emacs keybindings: delete-horizontal-space (M-\), + insert-completions (M-*), possible-completions (M-=). + +d. The history-search-backward and history-search-forward commands were + modified to be the same as previous-line and next-line if point is at + the start of the line. + +e. More file types are available for the visible-stats mode. + +3. Changes of interest in the Bash implementation + +a. There is a new autoconf-based configuration mechanism. + +b. More things have been moved from Posix mode to standard shell behavior. + +c. The trace output (set -x) now inserts quotes where necessary so it can + be reused as input. + +d. There is a compile-time option for a system-wide interactive shell + startup file (disabled by default). + +e. The YACC grammar is smaller and tighter, and all 66 shift-reduce + conflicts are gone. Several parsing bugs have been fixed. + +f. Builtin option parsing has been regularized (using internal_getopt()), + with the exception of `echo', `type', and `set'. + +g. Builtins now return standard usage messages constructed from the + `short doc' used by the help builtin. + +h. Completion now quotes using backslashes by default, but honors + user-supplied quotes. + +i. The GNU libc malloc is available as a configure-time option. + +j. There are more internationalization features; bash uses gettext if + it is available. The $"..." translation syntax uses the current + locale and gettext. + +k. There is better reporting of job termination when the shell is not + interactive. + +l. The shell is somewhat more efficient: it uses a little less memory and + makes fewer system calls. + +4. Changes of interest in the Readline implementation + +a. There is now support for readline `callback' functions. + +b. There is now support for user-supplied input, redisplay, and terminal + preparation functions. + +c. Most of the shell-specific code in readline has been generalized or + removed. + +d. Most of the annoying redisplay bugs have been fixed, notably the problems + with incremental search and excessive redrawing when special characters + appear in the prompt string. + +e. There are new library functions and variables available to application + writers, most having to do with completion and quoting. + +f. The NEWLINE character (^J) is now treated as a search terminator by the + incremental search functions. +------------------------------------------------------------------------------- + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without any warranty. diff --git a/NOTES b/NOTES new file mode 100644 index 0000000..b6b06a4 --- /dev/null +++ b/NOTES @@ -0,0 +1,352 @@ +Platform-Specific Configuration and Operation Notes +=================================================== + +1. configure --without-gnu-malloc on: + + alpha running OSF/1, Linux, or NetBSD (malloc needs 8-byte alignment; + bash malloc has 8-byte alignment now, but I have no alphas to test on) + + next running NeXT/OS; machines running Openstep + + all machines running SunOS YP code: SunOS4, SunOS5, HP/UX, if you + have problems with username completion or tilde expansion for + usernames found via YP/NIS + + linux (optional, but don't do it if you're using Doug Lea's malloc) + + QNX 4.2 + other OSF/1 machines (KSR/1, HP, IBM AIX/ESA) + AIX + sparc SVR4, SVR4.2 (ICL reference port) + DG/UX + Cray + Haiku OS + + NetBSD/sparc (malloc needs 8-byte alignment; bash malloc has 8-byte + alignment now, but I have no NetBSD machines to test on) + + BSD/OS 2.1, 3.x if you want to use loadable builtins + + Motorola m68k machines running System V.3. There is a file descriptor + leak caused by using the bash malloc because closedir(3) needs to read + freed memory to find the file descriptor to close + +2. Configure using shlicc2 on BSD/OS 2.1 and BSD/OS 3.x to use loadable + builtins + +3. Bash cannot be built in a directory separate from the source directory + using configure --srcdir=... unless the version of `make' you're using + does $VPATH handling right. The script support/mkclone can be used to + create a `build tree' using symlinks to get around this. + +4. I've had reports that username completion (as well as tilde expansion + and \u prompt expansion) does not work on IRIX 5.3 when linking with + -lnsl. This is only a problem when you're running NIS, since + apparently -lnsl supports only /etc/passwd and not the NIS functions + for retrieving usernames and passwords. Editing the Makefile after + configure runs and removing the `-lnsl' from the assignment to `LIBS' + fixes the problem. + +5. There is a problem with the `makewhatis' script in older (pre-7.0) + versions of Red Hat Linux. Running `makewhatis' with bash-2.0 or + later versions results in error messages like this: + + /usr/sbin/makewhatis: cd: manpath: No such file or directory + /usr/sbin/makewhatis: manpath/whatis: No such file or directory + chmod: manpath/whatis: No such file or directory + /usr/sbin/makewhatis: cd: catpath: No such file or directory + /usr/sbin/makewhatis: catpath/whatis: No such file or directory + chmod: catpath/whatis: No such file or directory + + The problem is with `makewhatis'. Red Hat (and possibly other + Linux distributors) uses a construct like this in the code: + + eval path=$"$pages"path + + to do indirect variable expansion. This `happened to work' in + bash-1.14 and previous versions, but that was more an accident + of implementation than anything else -- it was never supported + and certainly is not portable. + + Bash-2.0 has a new feature that gives a new meaning to $"...". + This is explained more completely in item 1 in the COMPAT file. + + The three lines in the `makewhatis' script that need to be changed + look like this: + + eval $topath=$"$topath":$name + [...] + eval path=$"$pages"path + [...] + eval path=$"$pages"path + + The portable way to write this code is + + eval $topath="\$$topath":$name + eval path="\$$pages"path + eval path="\$$pages"path + + You could also experiment with another new bash feature: ${!var}. + This does indirect variable expansion, making the use of eval + unnecessary. + +6. There is a problem with syslogd on many Linux distributions (Red Hat + and Slackware are two that I have received reports about). syslogd + sends a SIGINT to its parent process, which is waiting for the daemon + to finish its initialization. The parent process then dies due to + the SIGINT, and bash reports it, causing unexpected console output + while the system is booting that looks something like + + starting daemons: syslogd/etc/rc.d/rc.M: line 29: 38 Interrupt ${NET}/syslogd + + Bash-2.0 reports events such as processes dying in scripts due to + signals when the standard output is a tty. Bash-1.14.x and previous + versions did not report such events. + + This should probably be reported as a bug to whatever Linux distributor + people see the problem on. In my opinion, syslogd should be changed to + use some other method of communication, or the wrapper function (which + appeared to be `daemon' when I looked at it some time ago) or script + (which appeared to be `syslog') should catch SIGINT, since it's an + expected event, and exit cleanly. + +7. Several people have reported that `dip' (a program for SLIP/PPP + on Linux) does not work with bash-2.0 installed as /bin/sh. + + I don't run any Linux boxes myself, and do not have the dip + code handy to look at, but the `problem' with bash-2.0, as + it has been related to me, is that bash requires the `-p' + option to be supplied at invocation if it is to run setuid + or setgid. + + This means, among other things, that setuid or setgid programs + which call system(3) (a horrendously bad practice in any case) + relinquish their setuid/setgid status in the child that's forked + to execute /bin/sh. + + The following is an *unofficial* patch to bash-2.0 that causes it + to not require `-p' to run setuid or setgid if invoked as `sh'. + It has been reported to work on Linux. It will make your system + vulnerable to bogus system(3) calls in setuid executables. + +--- ../bash-2.0.orig/shell.c Wed Dec 18 14:16:30 1996 ++++ shell.c Fri Mar 7 13:12:03 1997 +@@ -347,7 +347,7 @@ + if (posixly_correct) + posix_initialize (posixly_correct); + +- if (running_setuid && privileged_mode == 0) ++ if (running_setuid && privileged_mode == 0 && act_like_sh == 0) + disable_priv_mode (); + + /* Need to get the argument to a -c option processed in the + +8. Some people have asked about binding all of the keys in a PC-keyboard- + style numeric keypad to readline functions. Here's something I + received from the gnu-win32 list that may help. Insert the following + lines into ~/.inputrc: + +# home key +"\e[1~":beginning-of-line +# insert key +"\e[2~":kill-whole-line +# del key +"\e[3~":delete-char +# end key +"\e[4~":end-of-line +# pgup key +"\e[5~":history-search-forward +# pgdn key +"\e[6~":history-search-backward + +9. Hints for building under Minix 2.0 (Contributed by Terry R. McConnell, + ) + + The version of /bin/sh distributed with Minix is not up to the job of + running the configure script. The easiest solution is to swap /bin/sh + with /usr/bin/ash. Then use chmem(1) to increase the memory allocated + to /bin/sh. The following settings are known to work: + + text data bss stack memory + 63552 9440 3304 65536 141832 /bin/sh + + If you have problems with make or yacc it may be worthwhile first to + install the GNU versions of these utilities before attempting to build + bash. (As of this writing, all of these utilities are available for the + i386 as pre-built binaries via anonymous ftp at math.syr.edu in the + pub/mcconnell/minix directory. Note that the GNU version of yacc is called + bison.) + + Unless you want to see lots of warnings about old-style declarations, + do LOCAL_CFLAGS=-wo; export LOCAL_CFLAGS before running configure. + (These warnings are harmless, but annoying.) + + configure will insist that you supply a host type. For example, do + ./configure --host=i386-pc-minix. + + Minix does not support the system calls required for a proper + implementation of ulimit(). The `ulimit' builtin will not be available. + + Configure will fail to notice that many things like uid_t are indeed + typedef'd in , because it uses egrep for this purpose + and minix has no egrep. You could try making a link /usr/bin/egrep --> + /usr/bin/grep. Better is to install the GNU version of grep in + /usr/local/bin and make the link /usr/local/bin/egrep -->/usr/local/bin/grep. + (These must be hard links, of course, since Minix does not support + symbolic links.) + + You will see many warnings of the form: + warning: unknown s_type: 98 + I have no idea what this means, but it doesn't seem to matter. + +10. If you do not have /usr/ccs/bin in your PATH when building on SunOS 5.x + (Solaris 2), the configure script will be unable to find `ar' and + `ranlib' (of course, ranlib is unnecessary). Make sure your $PATH + includes /usr/ccs/bin on SunOS 5.x. This generally manifests itself + with libraries not being built and make reporting errors like + `cr: not found' when library construction is attempted. + +11. Building a statically-linked bash on Solaris 2.5.x, 2.6, 7, or 8 is + complicated. + + It's not possible to build a completely statically-linked binary, since + part of the C library depends on dynamic linking. The following recipe + assumes that you're using gcc and the Solaris ld (/usr/ccs/bin/ld) on + Solaris 2.5.x or 2.6: + + configure --enable-static-link + make STATIC_LD= LOCAL_LIBS='-Wl,-B,dynamic -ldl -Wl,-B,static' + + This should result in a bash binary that depends only on libdl.so: + + thor(2)$ ldd bash + libdl.so.1 => /usr/lib/libdl.so.1 + + If you're using the Sun C Compiler (Sun WorkShop C Compiler version + 4.2 was what I used), you should be able to get away with using + + configure --enable-static-link + make STATIC_LD= LOCAL_LIBS='-B dynamic -ldl -B static' + + If you want to completely remove any dependence on /usr, perhaps + to put a copy of bash in /sbin and have it available when /usr is + not mounted, force the build process to use the shared dl.so library + in /etc/lib. + + For gcc, this would be something like + + configure --enable-static-link + make STATIC_LD= LOCAL_LIBS='-Wl,-B,dynamic -Wl,-R/etc/lib -ldl -Wl,-B,static' + + For Sun's WS4.2 cc + + configure --enable-static-link + make STATIC_LD= LOCAL_LIBS='-B dynamic -R/etc/lib -ldl -B static' + + seems to work, at least on Solaris 2.5.1: + + thor(2)$ ldd bash + libdl.so.1 => /etc/lib/libdl.so.1 + + On Solaris 7 (Solaris 8, using the version of gcc on the free software + CD-ROM), the following recipe appears to work for gcc: + + configure --enable-static-link + make STATIC_LD='-Wl,-Bstatic' LOCAL_LIBS='-Wl,-Bdynamic -Wl,-R/etc/lib -ldl -Wl,-Bstatic' + + thor.ins.cwru.edu(2)$ ldd bash + libdl.so.1 => /etc/lib/libdl.so.1 + + Make the analogous changes if you are running Sun's C Compiler. + + I have received word that adding -L/etc/lib (or the equivalent + -Wl,-L/etc/lib) might also be necessary, in addition to the -R/etc/lib. + + On later versions of Solaris, it may be necessary to add -lnsl before + -ldl; statically-linked versions of bash using libnsl are not guaranteed + to work correctly on future versions of Solaris. + +12. Configuring bash to build it in a cross environment. Currently only + two native versions can be compiled this way, cygwin32 and x86 BeOS. + For BeOS, you would configure it like this: + + export RANLIB=i586-beos-ranlib + export AR=i586-beos-ar + export CC=i586-beos-gcc + configure i586-beos + + Similarly for cygwin32. + +13. Bash-2.05 has reverted to the bash-2.03 behavior of honoring the current + locale setting when processing ranges within pattern matching bracket + expressions ([A-Z]). This is what POSIX.2 and SUSv2 specify. + + The behavior of the matcher in bash-2.05 depends on the current LC_COLLATE + setting. Setting this variable to `C' or `POSIX' will result in the + traditional behavior ([A-Z] matches all uppercase ASCII characters). + Many other locales, including the en_US locale (the default on many US + versions of Linux) collate the upper and lower case letters like this: + + AaBb...Zz + + which means that [A-Z] matches every letter except `z'. + + The portable way to specify upper case letters is [:upper:] instead of + A-Z; lower case may be specified as [:lower:] instead of a-z. + + Look at the manual pages for setlocale(3), strcoll(3), and, if it is + present, locale(1). If you have locale(1), you can use it to find + your current locale information even if you do not have any of the + LC_ variables set. + + My advice is to put + + export LC_COLLATE=C + + into /etc/profile and inspect any shell scripts run from cron for + constructs like [A-Z]. This will prevent things like + + rm [A-Z]* + + from removing every file in the current directory except those beginning + with `z' and still allow individual users to change the collation order. + Users may put the above command into their own profiles as well, of course. + +14. Building on Interix (nee OpenNT), which Microsoft bought from Softway + Systems and has seemingly abandoned (thanks to Kevin Moore for this item). + + 1. cp cross-build/opennt.cache config.cache + + 2. If desired, edit pathnames.h to set the values of SYS_PROFILE and + DEFAULT_HOSTS_FILE appropriately. + + 3. export CONFIG_SHELL=$INTERIX_ROOT/bin/sh + + 4. ./configure --prefix=$INTERIX_ROOT/usr/local (or wherever you + want it). + + 5. make; make install; enjoy + +15. Configure with `CC=xlc' if you don't have gcc on AIX 4.2 and later + versions. `xlc' running in `cc' mode has trouble compiling error.c. + +16. Configure --disable-multibyte on NetBSD versions (1.4 through at least + 1.6.1) that include wctype.h but do not define wctype_t. + +17. Do NOT use bison-1.75. It builds a non-working parser. The most + obvious effect is that constructs like "for i; do echo $i; done" don't + loop over the positional parameters. + +18. I have received reports that using -O2 with the MIPSpro results in a + binary that fails in strange ways. Using -O1 seems to work. + +19. There is special handling to ensure the shell links against static + versions of the included readline and history libraries on Mac OS X; + Apple ships inadequate dynamic libreadline and libhistory "replacements" + as standard libraries. + +20. If you're on a system like SGI Irix, and you get an error about not + being able to refer to a dynamic symbol + (ld: non-dynamic relocations refer to dynamic symbol PC), add + -DNEED_EXTERN_PC to the LOCAL_CFLAGS variable in lib/readline/Makefile.in + and rebuild. diff --git a/POSIX b/POSIX new file mode 100644 index 0000000..fe830f0 --- /dev/null +++ b/POSIX @@ -0,0 +1,216 @@ +6.11 Bash POSIX Mode +==================== + +Starting Bash with the `--posix' command-line option or executing `set +-o posix' while Bash is running will cause Bash to conform more closely +to the POSIX standard by changing the behavior to match that specified +by POSIX in areas where the Bash default differs. + +When invoked as `sh', Bash enters POSIX mode after reading the startup +files. + +The following list is what's changed when `POSIX mode' is in effect: + + 1. When a command in the hash table no longer exists, Bash will + re-search `$PATH' to find the new location. This is also + available with `shopt -s checkhash'. + + 2. The message printed by the job control code and builtins when a job + exits with a non-zero status is `Done(status)'. + + 3. The message printed by the job control code and builtins when a job + is stopped is `Stopped(SIGNAME)', where SIGNAME is, for example, + `SIGTSTP'. + + 4. The `bg' builtin uses the required format to describe each job + placed in the background, which does not include an indication of + whether the job is the current or previous job. + + 5. Reserved words appearing in a context where reserved words are + recognized do not undergo alias expansion. + + 6. The POSIX `PS1' and `PS2' expansions of `!' to the history number + and `!!' to `!' are enabled, and parameter expansion is performed + on the values of `PS1' and `PS2' regardless of the setting of the + `promptvars' option. + + 7. The POSIX startup files are executed (`$ENV') rather than the + normal Bash files. + + 8. Tilde expansion is only performed on assignments preceding a + command name, rather than on all assignment statements on the line. + + 9. The `command' builtin does not prevent builtins that take + assignment statements as arguments from expanding them as + assignment statements; when not in POSIX mode, assignment builtins + lose their assignment statement expansion properties when preceded + by `command'. + + 10. The default history file is `~/.sh_history' (this is the default + value of `$HISTFILE'). + + 11. The output of `kill -l' prints all the signal names on a single + line, separated by spaces, without the `SIG' prefix. + + 12. The `kill' builtin does not accept signal names with a `SIG' + prefix. + + 13. Non-interactive shells exit if FILENAME in `.' FILENAME is not + found. + + 14. Non-interactive shells exit if a syntax error in an arithmetic + expansion results in an invalid expression. + + 15. Non-interactive shells exit if there is a syntax error in a script + read with the `.' or `source' builtins, or in a string processed by + the `eval' builtin. + + 16. Redirection operators do not perform filename expansion on the word + in the redirection unless the shell is interactive. + + 17. Redirection operators do not perform word splitting on the word in + the redirection. + + 18. Function names must be valid shell `name's. That is, they may not + contain characters other than letters, digits, and underscores, and + may not start with a digit. Declaring a function with an invalid + name causes a fatal syntax error in non-interactive shells. + + 19. Function names may not be the same as one of the POSIX special + builtins. + + 20. POSIX special builtins are found before shell functions during + command lookup. + + 21. The `time' reserved word may be used by itself as a command. When + used in this way, it displays timing statistics for the shell and + its completed children. The `TIMEFORMAT' variable controls the + format of the timing information. + + 22. When parsing and expanding a ${...} expansion that appears within + double quotes, single quotes are no longer special and cannot be + used to quote a closing brace or other special character, unless + the operator is one of those defined to perform pattern removal. + In this case, they do not have to appear as matched pairs. + + 23. The parser does not recognize `time' as a reserved word if the next + token begins with a `-'. + + 24. If a POSIX special builtin returns an error status, a + non-interactive shell exits. The fatal errors are those listed in + the POSIX standard, and include things like passing incorrect + options, redirection errors, variable assignment errors for + assignments preceding the command name, and so on. + + 25. A non-interactive shell exits with an error status if a variable + assignment error occurs when no command name follows the assignment + statements. A variable assignment error occurs, for example, when + trying to assign a value to a readonly variable. + + 26. A non-interactive shell exits with an error status if a variable + assignment error occurs in an assignment statement preceding a + special builtin, but not with any other simple command. + + 27. A non-interactive shell exits with an error status if the iteration + variable in a `for' statement or the selection variable in a + `select' statement is a readonly variable. + + 28. Process substitution is not available. + + 29. While variable indirection is available, it may not be applied to + the `#' and `?' special parameters. + + 30. Assignment statements preceding POSIX special builtins persist in + the shell environment after the builtin completes. + + 31. Assignment statements preceding shell function calls persist in the + shell environment after the function returns, as if a POSIX + special builtin command had been executed. + + 32. The `export' and `readonly' builtin commands display their output + in the format required by POSIX. + + 33. The `trap' builtin displays signal names without the leading `SIG'. + + 34. The `trap' builtin doesn't check the first argument for a possible + signal specification and revert the signal handling to the original + disposition if it is, unless that argument consists solely of + digits and is a valid signal number. If users want to reset the + handler for a given signal to the original disposition, they + should use `-' as the first argument. + + 35. The `.' and `source' builtins do not search the current directory + for the filename argument if it is not found by searching `PATH'. + + 36. Subshells spawned to execute command substitutions inherit the + value of the `-e' option from the parent shell. When not in POSIX + mode, Bash clears the `-e' option in such subshells. + + 37. Alias expansion is always enabled, even in non-interactive shells. + + 38. When the `alias' builtin displays alias definitions, it does not + display them with a leading `alias ' unless the `-p' option is + supplied. + + 39. When the `set' builtin is invoked without options, it does not + display shell function names and definitions. + + 40. When the `set' builtin is invoked without options, it displays + variable values without quotes, unless they contain shell + metacharacters, even if the result contains nonprinting characters. + + 41. When the `cd' builtin is invoked in LOGICAL mode, and the pathname + constructed from `$PWD' and the directory name supplied as an + argument does not refer to an existing directory, `cd' will fail + instead of falling back to PHYSICAL mode. + + 42. The `pwd' builtin verifies that the value it prints is the same as + the current directory, even if it is not asked to check the file + system with the `-P' option. + + 43. When listing the history, the `fc' builtin does not include an + indication of whether or not a history entry has been modified. + + 44. The default editor used by `fc' is `ed'. + + 45. The `type' and `command' builtins will not report a non-executable + file as having been found, though the shell will attempt to + execute such a file if it is the only so-named file found in + `$PATH'. + + 46. The `vi' editing mode will invoke the `vi' editor directly when + the `v' command is run, instead of checking `$VISUAL' and + `$EDITOR'. + + 47. When the `xpg_echo' option is enabled, Bash does not attempt to + interpret any arguments to `echo' as options. Each argument is + displayed, after escape characters are converted. + + 48. The `ulimit' builtin uses a block size of 512 bytes for the `-c' + and `-f' options. + + 49. The arrival of `SIGCHLD' when a trap is set on `SIGCHLD' does not + interrupt the `wait' builtin and cause it to return immediately. + The trap command is run once for each child that exits. + + 50. The `read' builtin may be interrupted by a signal for which a trap + has been set. If Bash receives a trapped signal while executing + `read', the trap handler executes and `read' returns an exit + status greater than 128. + + +There is other POSIX behavior that Bash does not implement by default +even when in POSIX mode. Specifically: + + 1. The `fc' builtin checks `$EDITOR' as a program to edit history + entries if `FCEDIT' is unset, rather than defaulting directly to + `ed'. `fc' uses `ed' if `EDITOR' is unset. + + 2. As noted above, Bash requires the `xpg_echo' option to be enabled + for the `echo' builtin to be fully conformant. + + +Bash can be configured to be POSIX-conformant by default, by specifying +the `--enable-strict-posix-default' to `configure' when building (*note +Optional Features::). + diff --git a/RBASH b/RBASH new file mode 100644 index 0000000..0e5c10b --- /dev/null +++ b/RBASH @@ -0,0 +1,49 @@ +6.10 The Restricted Shell +========================= + +If Bash is started with the name `rbash', or the `--restricted' or `-r' +option is supplied at invocation, the shell becomes restricted. A +restricted shell is used to set up an environment more controlled than +the standard shell. A restricted shell behaves identically to `bash' +with the exception that the following are disallowed or not performed: + + * Changing directories with the `cd' builtin. + + * Setting or unsetting the values of the `SHELL', `PATH', `ENV', or + `BASH_ENV' variables. + + * Specifying command names containing slashes. + + * Specifying a filename containing a slash as an argument to the `.' + builtin command. + + * Specifying a filename containing a slash as an argument to the `-p' + option to the `hash' builtin command. + + * Importing function definitions from the shell environment at + startup. + + * Parsing the value of `SHELLOPTS' from the shell environment at + startup. + + * Redirecting output using the `>', `>|', `<>', `>&', `&>', and `>>' + redirection operators. + + * Using the `exec' builtin to replace the shell with another command. + + * Adding or deleting builtin commands with the `-f' and `-d' options + to the `enable' builtin. + + * Using the `enable' builtin command to enable disabled shell + builtins. + + * Specifying the `-p' option to the `command' builtin. + + * Turning off restricted mode with `set +r' or `set +o restricted'. + +These restrictions are enforced after any startup files are read. + +When a command that is found to be a shell script is executed (*note +Shell Scripts::), `rbash' turns off any restrictions in the shell +spawned to execute the script. + diff --git a/README b/README new file mode 100644 index 0000000..db09777 --- /dev/null +++ b/README @@ -0,0 +1,99 @@ +Introduction +============ + +This is GNU Bash, version 4.3. Bash is the GNU Project's Bourne +Again SHell, a complete implementation of the POSIX shell spec, +but also with interactive command line editing, job control on +architectures that support it, csh-like features such as history +substitution and brace expansion, and a slew of other features. +For more information on the features of Bash that are new to this +type of shell, see the file `doc/bashref.texi'. There is also a +large Unix-style man page. The man page is the definitive description +of the shell's features. + +See the file POSIX for a discussion of how the Bash defaults differ +from the POSIX spec and a description of the Bash `posix mode'. + +There are some user-visible incompatibilities between this version +of Bash and previous widely-distributed versions, bash-4.1 and +bash-4.2. For details, see the file COMPAT. The NEWS file tersely +lists features that are new in this release. + +Bash is free software, distributed under the terms of the [GNU] General +Public License as published by the Free Software Foundation, +version 3 of the License (or any later version). For more information, +see the file COPYING. + +A number of frequently-asked questions are answered in the file +`doc/FAQ'. + +To compile Bash, type `./configure', then `make'. Bash auto-configures +the build process, so no further intervention should be necessary. Bash +builds with `gcc' by default if it is available. If you want to use `cc' +instead, type + + CC=cc ./configure + +if you are using a Bourne-style shell. If you are not, the following +may work: + + env CC=cc ./configure + +Read the file INSTALL in this directory for more information about how +to customize and control the build process. The file NOTES contains +platform-specific installation and configuration information. + +If you are a csh user and wish to convert your csh aliases to Bash +aliases, you may wish to use the script `examples/misc/alias-conv.sh' +as a starting point. The script `examples/misc/cshtobash' is a +more ambitious script that attempts to do a more complete job. + +Reporting Bugs +============== + +Bug reports for bash should be sent to: + + bug-bash@gnu.org + +using the `bashbug' program that is built and installed at the same +time as bash. + +The discussion list `bug-bash@gnu.org' often contains information +about new ports of Bash, or discussions of new features or behavior +changes that people would like. This mailing list is also available +as a usenet newsgroup: gnu.bash.bug. + +When you send a bug report, please use the `bashbug' program that is +built at the same time as bash. If bash fails to build, try building +bashbug directly with `make bashbug'. If you cannot build `bashbug', +please send mail to bug-bash@gnu.org with the following information: + + * the version number and release status of Bash (e.g., 2.05a-release) + * the machine and OS that it is running on (you may run + `bashversion -l' from the bash build directory for this information) + * a list of the compilation flags or the contents of `config.h', if + appropriate + * a description of the bug + * a recipe for recreating the bug reliably + * a fix for the bug if you have one! + +The `bashbug' program includes much of this automatically. + +Questions and requests for help with bash and bash programming may be +sent to the help-bash@gnu.org mailing list. + +If you would like to contact the Bash maintainers directly, send mail +to bash-maintainers@gnu.org. + +While the Bash maintainers do not promise to fix all bugs, we would +like this shell to be the best that we can make it. + +Enjoy! + +Chet Ramey +chet.ramey@case.edu + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without any warranty. diff --git a/Y2K b/Y2K new file mode 100644 index 0000000..d12e352 --- /dev/null +++ b/Y2K @@ -0,0 +1,4 @@ +Since Bash does not manipulate date strings, it is Y2K-safe. + +The only thing that Bash does with date strings is manipulate the string +returned by ctime(3) or strftime(3) in the prompt customization code. diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..a947272 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,4195 @@ +dnl +dnl Bash specific tests +dnl +dnl Some derived from PDKSH 5.1.3 autoconf tests +dnl + +AC_DEFUN(BASH_C_LONG_LONG, +[AC_CACHE_CHECK(for long long, ac_cv_c_long_long, +[if test "$GCC" = yes; then + ac_cv_c_long_long=yes +else +AC_TRY_RUN([ +int +main() +{ +long long foo = 0; +exit(sizeof(long long) < sizeof(long)); +} +], ac_cv_c_long_long=yes, ac_cv_c_long_long=no) +fi]) +if test $ac_cv_c_long_long = yes; then + AC_DEFINE(HAVE_LONG_LONG, 1, [Define if the `long long' type works.]) +fi +]) + +dnl +dnl This is very similar to AC_C_LONG_DOUBLE, with the fix for IRIX +dnl (< changed to <=) added. +dnl +AC_DEFUN(BASH_C_LONG_DOUBLE, +[AC_CACHE_CHECK(for long double, ac_cv_c_long_double, +[if test "$GCC" = yes; then + ac_cv_c_long_double=yes +else +AC_TRY_RUN([ +int +main() +{ + /* The Stardent Vistra knows sizeof(long double), but does not + support it. */ + long double foo = 0.0; + /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ + /* On IRIX 5.3, the compiler converts long double to double with a warning, + but compiles this successfully. */ + exit(sizeof(long double) <= sizeof(double)); +} +], ac_cv_c_long_double=yes, ac_cv_c_long_double=no) +fi]) +if test $ac_cv_c_long_double = yes; then + AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if the `long double' type works.]) +fi +]) + +dnl +dnl Check for . This is separated out so that it can be +dnl AC_REQUIREd. +dnl +dnl BASH_HEADER_INTTYPES +AC_DEFUN(BASH_HEADER_INTTYPES, +[ + AC_CHECK_HEADERS(inttypes.h) +]) + +dnl +dnl check for typedef'd symbols in header files, but allow the caller to +dnl specify the include files to be checked in addition to the default +dnl +dnl BASH_CHECK_TYPE(TYPE, HEADERS, DEFAULT[, VALUE-IF-FOUND]) +AC_DEFUN(BASH_CHECK_TYPE, +[ +AC_REQUIRE([AC_HEADER_STDC])dnl +AC_REQUIRE([BASH_HEADER_INTTYPES]) +AC_MSG_CHECKING(for $1) +AC_CACHE_VAL(bash_cv_type_$1, +[AC_EGREP_CPP($1, [#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_STDINT_H +#include +#endif +$2 +], bash_cv_type_$1=yes, bash_cv_type_$1=no)]) +AC_MSG_RESULT($bash_cv_type_$1) +ifelse($#, 4, [if test $bash_cv_type_$1 = yes; then + AC_DEFINE($4) + fi]) +if test $bash_cv_type_$1 = no; then + AC_DEFINE_UNQUOTED($1, $3) +fi +]) + +dnl +dnl BASH_CHECK_DECL(FUNC) +dnl +dnl Check for a declaration of FUNC in stdlib.h and inttypes.h like +dnl AC_CHECK_DECL +dnl +AC_DEFUN(BASH_CHECK_DECL, +[ +AC_REQUIRE([AC_HEADER_STDC]) +AC_REQUIRE([BASH_HEADER_INTTYPES]) +AC_CACHE_CHECK([for declaration of $1], bash_cv_decl_$1, +[AC_TRY_LINK( +[ +#if STDC_HEADERS +# include +#endif +#if HAVE_INTTYPES_H +# include +#endif +], +[return !$1;], +bash_cv_decl_$1=yes, bash_cv_decl_$1=no)]) +bash_tr_func=HAVE_DECL_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +if test $bash_cv_decl_$1 = yes; then + AC_DEFINE_UNQUOTED($bash_tr_func, 1) +else + AC_DEFINE_UNQUOTED($bash_tr_func, 0) +fi +]) + +AC_DEFUN(BASH_DECL_PRINTF, +[AC_MSG_CHECKING(for declaration of printf in ) +AC_CACHE_VAL(bash_cv_printf_declared, +[AC_TRY_RUN([ +#include +#ifdef __STDC__ +typedef int (*_bashfunc)(const char *, ...); +#else +typedef int (*_bashfunc)(); +#endif +main() +{ +_bashfunc pf; +pf = (_bashfunc) printf; +exit(pf == 0); +} +], bash_cv_printf_declared=yes, bash_cv_printf_declared=no, + [AC_MSG_WARN(cannot check printf declaration if cross compiling -- defaulting to yes) + bash_cv_printf_declared=yes] +)]) +AC_MSG_RESULT($bash_cv_printf_declared) +if test $bash_cv_printf_declared = yes; then +AC_DEFINE(PRINTF_DECLARED) +fi +]) + +AC_DEFUN(BASH_DECL_SBRK, +[AC_MSG_CHECKING(for declaration of sbrk in ) +AC_CACHE_VAL(bash_cv_sbrk_declared, +[AC_EGREP_HEADER(sbrk, unistd.h, + bash_cv_sbrk_declared=yes, bash_cv_sbrk_declared=no)]) +AC_MSG_RESULT($bash_cv_sbrk_declared) +if test $bash_cv_sbrk_declared = yes; then +AC_DEFINE(SBRK_DECLARED) +fi +]) + +dnl +dnl Check for sys_siglist[] or _sys_siglist[] +dnl +AC_DEFUN(BASH_DECL_UNDER_SYS_SIGLIST, +[AC_MSG_CHECKING([for _sys_siglist in signal.h or unistd.h]) +AC_CACHE_VAL(bash_cv_decl_under_sys_siglist, +[AC_TRY_COMPILE([ +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif], [ char *msg = _sys_siglist[2]; ], + bash_cv_decl_under_sys_siglist=yes, bash_cv_decl_under_sys_siglist=no, + [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)])])dnl +AC_MSG_RESULT($bash_cv_decl_under_sys_siglist) +if test $bash_cv_decl_under_sys_siglist = yes; then +AC_DEFINE(UNDER_SYS_SIGLIST_DECLARED) +fi +]) + +AC_DEFUN(BASH_UNDER_SYS_SIGLIST, +[AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST]) +AC_MSG_CHECKING([for _sys_siglist in system C library]) +AC_CACHE_VAL(bash_cv_under_sys_siglist, +[AC_TRY_RUN([ +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifndef UNDER_SYS_SIGLIST_DECLARED +extern char *_sys_siglist[]; +#endif +main() +{ +char *msg = (char *)_sys_siglist[2]; +exit(msg == 0); +}], + bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no, + [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no) + bash_cv_under_sys_siglist=no])]) +AC_MSG_RESULT($bash_cv_under_sys_siglist) +if test $bash_cv_under_sys_siglist = yes; then +AC_DEFINE(HAVE_UNDER_SYS_SIGLIST) +fi +]) + +AC_DEFUN(BASH_SYS_SIGLIST, +[AC_REQUIRE([AC_DECL_SYS_SIGLIST]) +AC_MSG_CHECKING([for sys_siglist in system C library]) +AC_CACHE_VAL(bash_cv_sys_siglist, +[AC_TRY_RUN([ +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#if !HAVE_DECL_SYS_SIGLIST +extern char *sys_siglist[]; +#endif +main() +{ +char *msg = sys_siglist[2]; +exit(msg == 0); +}], + bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no, + [AC_MSG_WARN(cannot check for sys_siglist if cross compiling -- defaulting to no) + bash_cv_sys_siglist=no])]) +AC_MSG_RESULT($bash_cv_sys_siglist) +if test $bash_cv_sys_siglist = yes; then +AC_DEFINE(HAVE_SYS_SIGLIST) +fi +]) + +dnl Check for the various permutations of sys_siglist and make sure we +dnl compile in siglist.o if they're not defined +AC_DEFUN(BASH_CHECK_SYS_SIGLIST, [ +AC_REQUIRE([BASH_SYS_SIGLIST]) +AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST]) +AC_REQUIRE([BASH_FUNC_STRSIGNAL]) +if test "$bash_cv_sys_siglist" = no && test "$bash_cv_under_sys_siglist" = no && test "$bash_cv_have_strsignal" = no; then + SIGLIST_O=siglist.o +else + SIGLIST_O= +fi +AC_SUBST([SIGLIST_O]) +]) + +dnl Check for sys_errlist[] and sys_nerr, check for declaration +AC_DEFUN(BASH_SYS_ERRLIST, +[AC_MSG_CHECKING([for sys_errlist and sys_nerr]) +AC_CACHE_VAL(bash_cv_sys_errlist, +[AC_TRY_LINK([#include ], +[extern char *sys_errlist[]; + extern int sys_nerr; + char *msg = sys_errlist[sys_nerr - 1];], + bash_cv_sys_errlist=yes, bash_cv_sys_errlist=no)])dnl +AC_MSG_RESULT($bash_cv_sys_errlist) +if test $bash_cv_sys_errlist = yes; then +AC_DEFINE(HAVE_SYS_ERRLIST) +fi +]) + +dnl +dnl Check if dup2() does not clear the close on exec flag +dnl +AC_DEFUN(BASH_FUNC_DUP2_CLOEXEC_CHECK, +[AC_MSG_CHECKING(if dup2 fails to clear the close-on-exec flag) +AC_CACHE_VAL(bash_cv_dup2_broken, +[AC_TRY_RUN([ +#include +#include +main() +{ + int fd1, fd2, fl; + fd1 = open("/dev/null", 2); + if (fcntl(fd1, 2, 1) < 0) + exit(1); + fd2 = dup2(fd1, 1); + if (fd2 < 0) + exit(2); + fl = fcntl(fd2, 1, 0); + /* fl will be 1 if dup2 did not reset the close-on-exec flag. */ + exit(fl != 1); +} +], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no, + [AC_MSG_WARN(cannot check dup2 if cross compiling -- defaulting to no) + bash_cv_dup2_broken=no]) +]) +AC_MSG_RESULT($bash_cv_dup2_broken) +if test $bash_cv_dup2_broken = yes; then +AC_DEFINE(DUP2_BROKEN) +fi +]) + +AC_DEFUN(BASH_FUNC_STRSIGNAL, +[AC_MSG_CHECKING([for the existence of strsignal]) +AC_CACHE_VAL(bash_cv_have_strsignal, +[AC_TRY_LINK([#include +#include ], +[char *s = (char *)strsignal(2);], + bash_cv_have_strsignal=yes, bash_cv_have_strsignal=no)]) +AC_MSG_RESULT($bash_cv_have_strsignal) +if test $bash_cv_have_strsignal = yes; then +AC_DEFINE(HAVE_STRSIGNAL) +fi +]) + +dnl Check to see if opendir will open non-directories (not a nice thing) +AC_DEFUN(BASH_FUNC_OPENDIR_CHECK, +[AC_REQUIRE([AC_HEADER_DIRENT])dnl +AC_MSG_CHECKING(if opendir() opens non-directories) +AC_CACHE_VAL(bash_cv_opendir_not_robust, +[AC_TRY_RUN([ +#include +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif /* HAVE_UNISTD_H */ +#if defined(HAVE_DIRENT_H) +# include +#else +# define dirent direct +# ifdef HAVE_SYS_NDIR_H +# include +# endif /* SYSNDIR */ +# ifdef HAVE_SYS_DIR_H +# include +# endif /* SYSDIR */ +# ifdef HAVE_NDIR_H +# include +# endif +#endif /* HAVE_DIRENT_H */ +main() +{ +DIR *dir; +int fd, err; +err = mkdir("bash-aclocal", 0700); +if (err < 0) { + perror("mkdir"); + exit(1); +} +unlink("bash-aclocal/not_a_directory"); +fd = open("bash-aclocal/not_a_directory", O_WRONLY|O_CREAT|O_EXCL, 0666); +write(fd, "\n", 1); +close(fd); +dir = opendir("bash-aclocal/not_a_directory"); +unlink("bash-aclocal/not_a_directory"); +rmdir("bash-aclocal"); +exit (dir == 0); +}], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no, + [AC_MSG_WARN(cannot check opendir if cross compiling -- defaulting to no) + bash_cv_opendir_not_robust=no] +)]) +AC_MSG_RESULT($bash_cv_opendir_not_robust) +if test $bash_cv_opendir_not_robust = yes; then +AC_DEFINE(OPENDIR_NOT_ROBUST) +fi +]) + +dnl +AC_DEFUN(BASH_TYPE_SIGHANDLER, +[AC_MSG_CHECKING([whether signal handlers are of type void]) +AC_CACHE_VAL(bash_cv_void_sighandler, +[AC_TRY_COMPILE([#include +#include +#ifdef signal +#undef signal +#endif +#ifdef __cplusplus +extern "C" +#endif +void (*signal ()) ();], +[int i;], bash_cv_void_sighandler=yes, bash_cv_void_sighandler=no)])dnl +AC_MSG_RESULT($bash_cv_void_sighandler) +if test $bash_cv_void_sighandler = yes; then +AC_DEFINE(VOID_SIGHANDLER) +fi +]) + +dnl +dnl A signed 16-bit integer quantity +dnl +AC_DEFUN(BASH_TYPE_BITS16_T, +[ +if test "$ac_cv_sizeof_short" = 2; then + AC_CHECK_TYPE(bits16_t, short) +elif test "$ac_cv_sizeof_char" = 2; then + AC_CHECK_TYPE(bits16_t, char) +else + AC_CHECK_TYPE(bits16_t, short) +fi +]) + +dnl +dnl An unsigned 16-bit integer quantity +dnl +AC_DEFUN(BASH_TYPE_U_BITS16_T, +[ +if test "$ac_cv_sizeof_short" = 2; then + AC_CHECK_TYPE(u_bits16_t, unsigned short) +elif test "$ac_cv_sizeof_char" = 2; then + AC_CHECK_TYPE(u_bits16_t, unsigned char) +else + AC_CHECK_TYPE(u_bits16_t, unsigned short) +fi +]) + +dnl +dnl A signed 32-bit integer quantity +dnl +AC_DEFUN(BASH_TYPE_BITS32_T, +[ +if test "$ac_cv_sizeof_int" = 4; then + AC_CHECK_TYPE(bits32_t, int) +elif test "$ac_cv_sizeof_long" = 4; then + AC_CHECK_TYPE(bits32_t, long) +else + AC_CHECK_TYPE(bits32_t, int) +fi +]) + +dnl +dnl An unsigned 32-bit integer quantity +dnl +AC_DEFUN(BASH_TYPE_U_BITS32_T, +[ +if test "$ac_cv_sizeof_int" = 4; then + AC_CHECK_TYPE(u_bits32_t, unsigned int) +elif test "$ac_cv_sizeof_long" = 4; then + AC_CHECK_TYPE(u_bits32_t, unsigned long) +else + AC_CHECK_TYPE(u_bits32_t, unsigned int) +fi +]) + +AC_DEFUN(BASH_TYPE_PTRDIFF_T, +[ +if test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_char_p"; then + AC_CHECK_TYPE(ptrdiff_t, int) +elif test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_char_p"; then + AC_CHECK_TYPE(ptrdiff_t, long) +elif test "$ac_cv_type_long_long" = yes && test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_char_p"; then + AC_CHECK_TYPE(ptrdiff_t, [long long]) +else + AC_CHECK_TYPE(ptrdiff_t, int) +fi +]) + +dnl +dnl A signed 64-bit quantity +dnl +AC_DEFUN(BASH_TYPE_BITS64_T, +[ +if test "$ac_cv_sizeof_char_p" = 8; then + AC_CHECK_TYPE(bits64_t, char *) +elif test "$ac_cv_sizeof_double" = 8; then + AC_CHECK_TYPE(bits64_t, double) +elif test -n "$ac_cv_type_long_long" && test "$ac_cv_sizeof_long_long" = 8; then + AC_CHECK_TYPE(bits64_t, [long long]) +elif test "$ac_cv_sizeof_long" = 8; then + AC_CHECK_TYPE(bits64_t, long) +else + AC_CHECK_TYPE(bits64_t, double) +fi +]) + +AC_DEFUN(BASH_TYPE_LONG_LONG, +[ +AC_CACHE_CHECK([for long long], bash_cv_type_long_long, +[AC_TRY_LINK([ +long long ll = 1; int i = 63;], +[ +long long llm = (long long) -1; +return ll << i | ll >> i | llm / ll | llm % ll; +], bash_cv_type_long_long='long long', bash_cv_type_long_long='long')]) +if test "$bash_cv_type_long_long" = 'long long'; then + AC_DEFINE(HAVE_LONG_LONG, 1) +fi +]) + +AC_DEFUN(BASH_TYPE_UNSIGNED_LONG_LONG, +[ +AC_CACHE_CHECK([for unsigned long long], bash_cv_type_unsigned_long_long, +[AC_TRY_LINK([ +unsigned long long ull = 1; int i = 63;], +[ +unsigned long long ullmax = (unsigned long long) -1; +return ull << i | ull >> i | ullmax / ull | ullmax % ull; +], bash_cv_type_unsigned_long_long='unsigned long long', + bash_cv_type_unsigned_long_long='unsigned long')]) +if test "$bash_cv_type_unsigned_long_long" = 'unsigned long long'; then + AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1) +fi +]) + +dnl +dnl Type of struct rlimit fields: some systems (OSF/1, NetBSD, RISC/os 5.0) +dnl have a rlim_t, others (4.4BSD based systems) use quad_t, others use +dnl long and still others use int (HP-UX 9.01, SunOS 4.1.3). To simplify +dnl matters, this just checks for rlim_t, quad_t, or long. +dnl +AC_DEFUN(BASH_TYPE_RLIMIT, +[AC_MSG_CHECKING(for size and type of struct rlimit fields) +AC_CACHE_VAL(bash_cv_type_rlimit, +[AC_TRY_COMPILE([#include +#include ], +[rlim_t xxx;], bash_cv_type_rlimit=rlim_t,[ +AC_TRY_RUN([ +#include +#include +#include +main() +{ +#ifdef HAVE_QUAD_T + struct rlimit rl; + if (sizeof(rl.rlim_cur) == sizeof(quad_t)) + exit(0); +#endif + exit(1); +}], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long, + [AC_MSG_WARN(cannot check quad_t if cross compiling -- defaulting to long) + bash_cv_type_rlimit=long])]) +]) +AC_MSG_RESULT($bash_cv_type_rlimit) +if test $bash_cv_type_rlimit = quad_t; then +AC_DEFINE(RLIMTYPE, quad_t) +elif test $bash_cv_type_rlimit = rlim_t; then +AC_DEFINE(RLIMTYPE, rlim_t) +fi +]) + +AC_DEFUN(BASH_TYPE_SIG_ATOMIC_T, +[AC_CACHE_CHECK([for sig_atomic_t in signal.h], ac_cv_have_sig_atomic_t, +[AC_TRY_LINK([ +#include +],[ sig_atomic_t x; ], +ac_cv_have_sig_atomic_t=yes, ac_cv_have_sig_atomic_t=no)]) +if test "$ac_cv_have_sig_atomic_t" = "no" +then + AC_CHECK_TYPE(sig_atomic_t,int) +fi +]) + +AC_DEFUN(BASH_FUNC_LSTAT, +[dnl Cannot use AC_CHECK_FUNCS(lstat) because Linux defines lstat() as an +dnl inline function in . +AC_CACHE_CHECK([for lstat], bash_cv_func_lstat, +[AC_TRY_LINK([ +#include +#include +],[ lstat(".",(struct stat *)0); ], +bash_cv_func_lstat=yes, bash_cv_func_lstat=no)]) +if test $bash_cv_func_lstat = yes; then + AC_DEFINE(HAVE_LSTAT) +fi +]) + +AC_DEFUN(BASH_FUNC_INET_ATON, +[ +AC_CACHE_CHECK([for inet_aton], bash_cv_func_inet_aton, +[AC_TRY_LINK([ +#include +#include +#include +struct in_addr ap;], [ inet_aton("127.0.0.1", &ap); ], +bash_cv_func_inet_aton=yes, bash_cv_func_inet_aton=no)]) +if test $bash_cv_func_inet_aton = yes; then + AC_DEFINE(HAVE_INET_ATON) +else + AC_LIBOBJ(inet_aton) +fi +]) + +AC_DEFUN(BASH_FUNC_GETENV, +[AC_MSG_CHECKING(to see if getenv can be redefined) +AC_CACHE_VAL(bash_cv_getenv_redef, +[AC_TRY_RUN([ +#ifdef HAVE_UNISTD_H +# include +#endif +#ifndef __STDC__ +# ifndef const +# define const +# endif +#endif +char * +getenv (name) +#if defined (__linux__) || defined (__bsdi__) || defined (convex) + const char *name; +#else + char const *name; +#endif /* !__linux__ && !__bsdi__ && !convex */ +{ +return "42"; +} +main() +{ +char *s; +/* The next allows this program to run, but does not allow bash to link + when it redefines getenv. I'm not really interested in figuring out + why not. */ +#if defined (NeXT) +exit(1); +#endif +s = getenv("ABCDE"); +exit(s == 0); /* force optimizer to leave getenv in */ +} +], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no, + [AC_MSG_WARN(cannot check getenv redefinition if cross compiling -- defaulting to yes) + bash_cv_getenv_redef=yes] +)]) +AC_MSG_RESULT($bash_cv_getenv_redef) +if test $bash_cv_getenv_redef = yes; then +AC_DEFINE(CAN_REDEFINE_GETENV) +fi +]) + +# We should check for putenv before calling this +AC_DEFUN(BASH_FUNC_STD_PUTENV, +[ +AC_REQUIRE([AC_HEADER_STDC]) +AC_REQUIRE([AC_C_PROTOTYPES]) +AC_CACHE_CHECK([for standard-conformant putenv declaration], bash_cv_std_putenv, +[AC_TRY_LINK([ +#if STDC_HEADERS +#include +#include +#endif +#ifndef __STDC__ +# ifndef const +# define const +# endif +#endif +#ifdef PROTOTYPES +extern int putenv (char *); +#else +extern int putenv (); +#endif +], +[return (putenv == 0);], +bash_cv_std_putenv=yes, bash_cv_std_putenv=no +)]) +if test $bash_cv_std_putenv = yes; then +AC_DEFINE(HAVE_STD_PUTENV) +fi +]) + +# We should check for unsetenv before calling this +AC_DEFUN(BASH_FUNC_STD_UNSETENV, +[ +AC_REQUIRE([AC_HEADER_STDC]) +AC_REQUIRE([AC_C_PROTOTYPES]) +AC_CACHE_CHECK([for standard-conformant unsetenv declaration], bash_cv_std_unsetenv, +[AC_TRY_LINK([ +#if STDC_HEADERS +#include +#include +#endif +#ifndef __STDC__ +# ifndef const +# define const +# endif +#endif +#ifdef PROTOTYPES +extern int unsetenv (const char *); +#else +extern int unsetenv (); +#endif +], +[return (unsetenv == 0);], +bash_cv_std_unsetenv=yes, bash_cv_std_unsetenv=no +)]) +if test $bash_cv_std_unsetenv = yes; then +AC_DEFINE(HAVE_STD_UNSETENV) +fi +]) + +AC_DEFUN(BASH_FUNC_ULIMIT_MAXFDS, +[AC_MSG_CHECKING(whether ulimit can substitute for getdtablesize) +AC_CACHE_VAL(bash_cv_ulimit_maxfds, +[AC_TRY_RUN([ +main() +{ +long maxfds = ulimit(4, 0L); +exit (maxfds == -1L); +} +], bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no, + [AC_MSG_WARN(cannot check ulimit if cross compiling -- defaulting to no) + bash_cv_ulimit_maxfds=no] +)]) +AC_MSG_RESULT($bash_cv_ulimit_maxfds) +if test $bash_cv_ulimit_maxfds = yes; then +AC_DEFINE(ULIMIT_MAXFDS) +fi +]) + +AC_DEFUN(BASH_FUNC_GETCWD, +[AC_MSG_CHECKING([if getcwd() will dynamically allocate memory with 0 size]) +AC_CACHE_VAL(bash_cv_getcwd_malloc, +[AC_TRY_RUN([ +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +main() +{ + char *xpwd; + xpwd = getcwd(0, 0); + exit (xpwd == 0); +} +], bash_cv_getcwd_malloc=yes, bash_cv_getcwd_malloc=no, + [AC_MSG_WARN(cannot check whether getcwd allocates memory when cross-compiling -- defaulting to no) + bash_cv_getcwd_malloc=no] +)]) +AC_MSG_RESULT($bash_cv_getcwd_malloc) +if test $bash_cv_getcwd_malloc = no; then +AC_DEFINE(GETCWD_BROKEN) +AC_LIBOBJ(getcwd) +fi +]) + +dnl +dnl This needs BASH_CHECK_SOCKLIB, but since that's not called on every +dnl system, we can't use AC_PREREQ +dnl +AC_DEFUN(BASH_FUNC_GETHOSTBYNAME, +[if test "X$bash_cv_have_gethostbyname" = "X"; then +_bash_needmsg=yes +else +AC_MSG_CHECKING(for gethostbyname in socket library) +_bash_needmsg= +fi +AC_CACHE_VAL(bash_cv_have_gethostbyname, +[AC_TRY_LINK([#include ], +[ struct hostent *hp; + hp = gethostbyname("localhost"); +], bash_cv_have_gethostbyname=yes, bash_cv_have_gethostbyname=no)] +) +if test "X$_bash_needmsg" = Xyes; then + AC_MSG_CHECKING(for gethostbyname in socket library) +fi +AC_MSG_RESULT($bash_cv_have_gethostbyname) +if test "$bash_cv_have_gethostbyname" = yes; then +AC_DEFINE(HAVE_GETHOSTBYNAME) +fi +]) + +AC_DEFUN(BASH_FUNC_FNMATCH_EXTMATCH, +[AC_MSG_CHECKING(if fnmatch does extended pattern matching with FNM_EXTMATCH) +AC_CACHE_VAL(bash_cv_fnm_extmatch, +[AC_TRY_RUN([ +#include + +main() +{ +#ifdef FNM_EXTMATCH + exit (0); +#else + exit (1); +#endif +} +], bash_cv_fnm_extmatch=yes, bash_cv_fnm_extmatch=no, + [AC_MSG_WARN(cannot check FNM_EXTMATCH if cross compiling -- defaulting to no) + bash_cv_fnm_extmatch=no]) +]) +AC_MSG_RESULT($bash_cv_fnm_extmatch) +if test $bash_cv_fnm_extmatch = yes; then +AC_DEFINE(HAVE_LIBC_FNM_EXTMATCH) +fi +]) + +AC_DEFUN(BASH_FUNC_POSIX_SETJMP, +[AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE]) +AC_MSG_CHECKING(for presence of POSIX-style sigsetjmp/siglongjmp) +AC_CACHE_VAL(bash_cv_func_sigsetjmp, +[AC_TRY_RUN([ +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#include +#include + +main() +{ +#if !defined (_POSIX_VERSION) || !defined (HAVE_POSIX_SIGNALS) +exit (1); +#else + +int code; +sigset_t set, oset; +sigjmp_buf xx; + +/* get the mask */ +sigemptyset(&set); +sigemptyset(&oset); +sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &set); +sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &oset); + +/* save it */ +code = sigsetjmp(xx, 1); +if (code) + exit(0); /* could get sigmask and compare to oset here. */ + +/* change it */ +sigaddset(&set, SIGINT); +sigprocmask(SIG_BLOCK, &set, (sigset_t *)NULL); + +/* and siglongjmp */ +siglongjmp(xx, 10); +exit(1); +#endif +}], bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing, + [AC_MSG_WARN(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing) + bash_cv_func_sigsetjmp=missing] +)]) +AC_MSG_RESULT($bash_cv_func_sigsetjmp) +if test $bash_cv_func_sigsetjmp = present; then +AC_DEFINE(HAVE_POSIX_SIGSETJMP) +fi +]) + +AC_DEFUN(BASH_FUNC_STRCOLL, +[ +AC_MSG_CHECKING(whether or not strcoll and strcmp differ) +AC_CACHE_VAL(bash_cv_func_strcoll_broken, +[AC_TRY_RUN([ +#include +#if defined (HAVE_LOCALE_H) +#include +#endif + +main(c, v) +int c; +char *v[]; +{ + int r1, r2; + char *deflocale, *defcoll; + +#ifdef HAVE_SETLOCALE + deflocale = setlocale(LC_ALL, ""); + defcoll = setlocale(LC_COLLATE, ""); +#endif + +#ifdef HAVE_STRCOLL + /* These two values are taken from tests/glob-test. */ + r1 = strcoll("abd", "aXd"); +#else + r1 = 0; +#endif + r2 = strcmp("abd", "aXd"); + + /* These two should both be greater than 0. It is permissible for + a system to return different values, as long as the sign is the + same. */ + + /* Exit with 1 (failure) if these two values are both > 0, since + this tests whether strcoll(3) is broken with respect to strcmp(3) + in the default locale. */ + exit (r1 > 0 && r2 > 0); +} +], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no, + [AC_MSG_WARN(cannot check strcoll if cross compiling -- defaulting to no) + bash_cv_func_strcoll_broken=no] +)]) +AC_MSG_RESULT($bash_cv_func_strcoll_broken) +if test $bash_cv_func_strcoll_broken = yes; then +AC_DEFINE(STRCOLL_BROKEN) +fi +]) + +AC_DEFUN(BASH_FUNC_PRINTF_A_FORMAT, +[AC_MSG_CHECKING([for printf floating point output in hex notation]) +AC_CACHE_VAL(bash_cv_printf_a_format, +[AC_TRY_RUN([ +#include +#include + +int +main() +{ + double y = 0.0; + char abuf[1024]; + + sprintf(abuf, "%A", y); + exit(strchr(abuf, 'P') == (char *)0); +} +], bash_cv_printf_a_format=yes, bash_cv_printf_a_format=no, + [AC_MSG_WARN(cannot check printf if cross compiling -- defaulting to no) + bash_cv_printf_a_format=no] +)]) +AC_MSG_RESULT($bash_cv_printf_a_format) +if test $bash_cv_printf_a_format = yes; then +AC_DEFINE(HAVE_PRINTF_A_FORMAT) +fi +]) + +AC_DEFUN(BASH_STRUCT_TERMIOS_LDISC, +[ +AC_CHECK_MEMBER(struct termios.c_line, AC_DEFINE(TERMIOS_LDISC), ,[ +#include +#include +]) +]) + +AC_DEFUN(BASH_STRUCT_TERMIO_LDISC, +[ +AC_CHECK_MEMBER(struct termio.c_line, AC_DEFINE(TERMIO_LDISC), ,[ +#include +#include +]) +]) + +dnl +dnl Like AC_STRUCT_ST_BLOCKS, but doesn't muck with LIBOBJS +dnl +dnl sets bash_cv_struct_stat_st_blocks +dnl +dnl unused for now; we'll see how AC_CHECK_MEMBERS works +dnl +AC_DEFUN(BASH_STRUCT_ST_BLOCKS, +[ +AC_MSG_CHECKING([for struct stat.st_blocks]) +AC_CACHE_VAL(bash_cv_struct_stat_st_blocks, +[AC_TRY_COMPILE( +[ +#include +#include +], +[ +main() +{ +static struct stat a; +if (a.st_blocks) return 0; +return 0; +} +], bash_cv_struct_stat_st_blocks=yes, bash_cv_struct_stat_st_blocks=no) +]) +AC_MSG_RESULT($bash_cv_struct_stat_st_blocks) +if test "$bash_cv_struct_stat_st_blocks" = "yes"; then +AC_DEFINE(HAVE_STRUCT_STAT_ST_BLOCKS) +fi +]) + +AC_DEFUN([BASH_CHECK_LIB_TERMCAP], +[ +if test "X$bash_cv_termcap_lib" = "X"; then +_bash_needmsg=yes +else +AC_MSG_CHECKING(which library has the termcap functions) +_bash_needmsg= +fi +AC_CACHE_VAL(bash_cv_termcap_lib, +[AC_CHECK_FUNC(tgetent, bash_cv_termcap_lib=libc, + [AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap, + [AC_CHECK_LIB(tinfo, tgetent, bash_cv_termcap_lib=libtinfo, + [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses, + [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses, + bash_cv_termcap_lib=gnutermcap)])])])])]) +if test "X$_bash_needmsg" = "Xyes"; then +AC_MSG_CHECKING(which library has the termcap functions) +fi +AC_MSG_RESULT(using $bash_cv_termcap_lib) +if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then +LDFLAGS="$LDFLAGS -L./lib/termcap" +TERMCAP_LIB="./lib/termcap/libtermcap.a" +TERMCAP_DEP="./lib/termcap/libtermcap.a" +elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then +TERMCAP_LIB=-ltermcap +TERMCAP_DEP= +elif test $bash_cv_termcap_lib = libtinfo; then +TERMCAP_LIB=-ltinfo +TERMCAP_DEP= +elif test $bash_cv_termcap_lib = libncurses; then +TERMCAP_LIB=-lncurses +TERMCAP_DEP= +elif test $bash_cv_termcap_lib = libc; then +TERMCAP_LIB= +TERMCAP_DEP= +else +TERMCAP_LIB=-lcurses +TERMCAP_DEP= +fi +]) + +dnl +dnl Check for the presence of getpeername in libsocket. +dnl If libsocket is present, check for libnsl and add it to LIBS if +dnl it's there, since most systems with libsocket require linking +dnl with libnsl as well. This should only be called if getpeername +dnl was not found in libc. +dnl +dnl NOTE: IF WE FIND GETPEERNAME, WE ASSUME THAT WE HAVE BIND/CONNECT +dnl AS WELL +dnl +AC_DEFUN(BASH_CHECK_LIB_SOCKET, +[ +if test "X$bash_cv_have_socklib" = "X"; then +_bash_needmsg= +else +AC_MSG_CHECKING(for socket library) +_bash_needmsg=yes +fi +AC_CACHE_VAL(bash_cv_have_socklib, +[AC_CHECK_LIB(socket, getpeername, + bash_cv_have_socklib=yes, bash_cv_have_socklib=no, -lnsl)]) +if test "X$_bash_needmsg" = Xyes; then + AC_MSG_RESULT($bash_cv_have_socklib) + _bash_needmsg= +fi +if test $bash_cv_have_socklib = yes; then + # check for libnsl, add it to LIBS if present + if test "X$bash_cv_have_libnsl" = "X"; then + _bash_needmsg= + else + AC_MSG_CHECKING(for libnsl) + _bash_needmsg=yes + fi + AC_CACHE_VAL(bash_cv_have_libnsl, + [AC_CHECK_LIB(nsl, t_open, + bash_cv_have_libnsl=yes, bash_cv_have_libnsl=no)]) + if test "X$_bash_needmsg" = Xyes; then + AC_MSG_RESULT($bash_cv_have_libnsl) + _bash_needmsg= + fi + if test $bash_cv_have_libnsl = yes; then + LIBS="-lsocket -lnsl $LIBS" + else + LIBS="-lsocket $LIBS" + fi + AC_DEFINE(HAVE_LIBSOCKET) + AC_DEFINE(HAVE_GETPEERNAME) +fi +]) + +AC_DEFUN(BASH_STRUCT_DIRENT_D_INO, +[AC_REQUIRE([AC_HEADER_DIRENT]) +AC_MSG_CHECKING(for struct dirent.d_ino) +AC_CACHE_VAL(bash_cv_dirent_has_dino, +[AC_TRY_COMPILE([ +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif /* HAVE_UNISTD_H */ +#if defined(HAVE_DIRENT_H) +# include +#else +# define dirent direct +# ifdef HAVE_SYS_NDIR_H +# include +# endif /* SYSNDIR */ +# ifdef HAVE_SYS_DIR_H +# include +# endif /* SYSDIR */ +# ifdef HAVE_NDIR_H +# include +# endif +#endif /* HAVE_DIRENT_H */ +],[ +struct dirent d; int z; z = d.d_ino; +], bash_cv_dirent_has_dino=yes, bash_cv_dirent_has_dino=no)]) +AC_MSG_RESULT($bash_cv_dirent_has_dino) +if test $bash_cv_dirent_has_dino = yes; then +AC_DEFINE(HAVE_STRUCT_DIRENT_D_INO) +fi +]) + +AC_DEFUN(BASH_STRUCT_DIRENT_D_FILENO, +[AC_REQUIRE([AC_HEADER_DIRENT]) +AC_MSG_CHECKING(for struct dirent.d_fileno) +AC_CACHE_VAL(bash_cv_dirent_has_d_fileno, +[AC_TRY_COMPILE([ +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif /* HAVE_UNISTD_H */ +#if defined(HAVE_DIRENT_H) +# include +#else +# define dirent direct +# ifdef HAVE_SYS_NDIR_H +# include +# endif /* SYSNDIR */ +# ifdef HAVE_SYS_DIR_H +# include +# endif /* SYSDIR */ +# ifdef HAVE_NDIR_H +# include +# endif +#endif /* HAVE_DIRENT_H */ +],[ +struct dirent d; int z; z = d.d_fileno; +], bash_cv_dirent_has_d_fileno=yes, bash_cv_dirent_has_d_fileno=no)]) +AC_MSG_RESULT($bash_cv_dirent_has_d_fileno) +if test $bash_cv_dirent_has_d_fileno = yes; then +AC_DEFINE(HAVE_STRUCT_DIRENT_D_FILENO) +fi +]) + +AC_DEFUN(BASH_STRUCT_DIRENT_D_NAMLEN, +[AC_REQUIRE([AC_HEADER_DIRENT]) +AC_MSG_CHECKING(for struct dirent.d_namlen) +AC_CACHE_VAL(bash_cv_dirent_has_d_namlen, +[AC_TRY_COMPILE([ +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif /* HAVE_UNISTD_H */ +#if defined(HAVE_DIRENT_H) +# include +#else +# define dirent direct +# ifdef HAVE_SYS_NDIR_H +# include +# endif /* SYSNDIR */ +# ifdef HAVE_SYS_DIR_H +# include +# endif /* SYSDIR */ +# ifdef HAVE_NDIR_H +# include +# endif +#endif /* HAVE_DIRENT_H */ +],[ +struct dirent d; int z; z = d.d_namlen; +], bash_cv_dirent_has_d_namlen=yes, bash_cv_dirent_has_d_namlen=no)]) +AC_MSG_RESULT($bash_cv_dirent_has_d_namlen) +if test $bash_cv_dirent_has_d_namlen = yes; then +AC_DEFINE(HAVE_STRUCT_DIRENT_D_NAMLEN) +fi +]) + +AC_DEFUN(BASH_STRUCT_TIMEVAL, +[AC_MSG_CHECKING(for struct timeval in sys/time.h and time.h) +AC_CACHE_VAL(bash_cv_struct_timeval, +[ +AC_EGREP_HEADER(struct timeval, sys/time.h, + bash_cv_struct_timeval=yes, + AC_EGREP_HEADER(struct timeval, time.h, + bash_cv_struct_timeval=yes, + bash_cv_struct_timeval=no)) +]) +AC_MSG_RESULT($bash_cv_struct_timeval) +if test $bash_cv_struct_timeval = yes; then + AC_DEFINE(HAVE_TIMEVAL) +fi +]) + +AC_DEFUN(BASH_STRUCT_TIMEZONE, +[AC_MSG_CHECKING(for struct timezone in sys/time.h and time.h) +AC_CACHE_VAL(bash_cv_struct_timezone, +[ +AC_EGREP_HEADER(struct timezone, sys/time.h, + bash_cv_struct_timezone=yes, + AC_EGREP_HEADER(struct timezone, time.h, + bash_cv_struct_timezone=yes, + bash_cv_struct_timezone=no)) +]) +AC_MSG_RESULT($bash_cv_struct_timezone) +if test $bash_cv_struct_timezone = yes; then + AC_DEFINE(HAVE_STRUCT_TIMEZONE) +fi +]) + +AC_DEFUN(BASH_STRUCT_WINSIZE, +[AC_MSG_CHECKING(for struct winsize in sys/ioctl.h and termios.h) +AC_CACHE_VAL(bash_cv_struct_winsize_header, +[AC_TRY_COMPILE([#include +#include ], [struct winsize x;], + bash_cv_struct_winsize_header=ioctl_h, + [AC_TRY_COMPILE([#include +#include ], [struct winsize x;], + bash_cv_struct_winsize_header=termios_h, bash_cv_struct_winsize_header=other) +])]) +if test $bash_cv_struct_winsize_header = ioctl_h; then + AC_MSG_RESULT(sys/ioctl.h) + AC_DEFINE(STRUCT_WINSIZE_IN_SYS_IOCTL) +elif test $bash_cv_struct_winsize_header = termios_h; then + AC_MSG_RESULT(termios.h) + AC_DEFINE(STRUCT_WINSIZE_IN_TERMIOS) +else + AC_MSG_RESULT(not found) +fi +]) + +dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7) +AC_DEFUN(BASH_SYS_SIGNAL_VINTAGE, +[AC_REQUIRE([AC_TYPE_SIGNAL]) +AC_MSG_CHECKING(for type of signal functions) +AC_CACHE_VAL(bash_cv_signal_vintage, +[ + AC_TRY_LINK([#include ],[ + sigset_t ss; + struct sigaction sa; + sigemptyset(&ss); sigsuspend(&ss); + sigaction(SIGINT, &sa, (struct sigaction *) 0); + sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0); + ], bash_cv_signal_vintage=posix, + [ + AC_TRY_LINK([#include ], [ + int mask = sigmask(SIGINT); + sigsetmask(mask); sigblock(mask); sigpause(mask); + ], bash_cv_signal_vintage=4.2bsd, + [ + AC_TRY_LINK([ + #include + RETSIGTYPE foo() { }], [ + int mask = sigmask(SIGINT); + sigset(SIGINT, foo); sigrelse(SIGINT); + sighold(SIGINT); sigpause(SIGINT); + ], bash_cv_signal_vintage=svr3, bash_cv_signal_vintage=v7 + )] + )] +) +]) +AC_MSG_RESULT($bash_cv_signal_vintage) +if test "$bash_cv_signal_vintage" = posix; then +AC_DEFINE(HAVE_POSIX_SIGNALS) +elif test "$bash_cv_signal_vintage" = "4.2bsd"; then +AC_DEFINE(HAVE_BSD_SIGNALS) +elif test "$bash_cv_signal_vintage" = svr3; then +AC_DEFINE(HAVE_USG_SIGHOLD) +fi +]) + +dnl Check if the pgrp of setpgrp() can't be the pid of a zombie process. +AC_DEFUN(BASH_SYS_PGRP_SYNC, +[AC_REQUIRE([AC_FUNC_GETPGRP]) +AC_MSG_CHECKING(whether pgrps need synchronization) +AC_CACHE_VAL(bash_cv_pgrp_pipe, +[AC_TRY_RUN([ +#ifdef HAVE_UNISTD_H +# include +#endif +main() +{ +# ifdef GETPGRP_VOID +# define getpgID() getpgrp() +# else +# define getpgID() getpgrp(0) +# define setpgid(x,y) setpgrp(x,y) +# endif + int pid1, pid2, fds[2]; + int status; + char ok; + + switch (pid1 = fork()) { + case -1: + exit(1); + case 0: + setpgid(0, getpid()); + exit(0); + } + setpgid(pid1, pid1); + + sleep(2); /* let first child die */ + + if (pipe(fds) < 0) + exit(2); + + switch (pid2 = fork()) { + case -1: + exit(3); + case 0: + setpgid(0, pid1); + ok = getpgID() == pid1; + write(fds[1], &ok, 1); + exit(0); + } + setpgid(pid2, pid1); + + close(fds[1]); + if (read(fds[0], &ok, 1) != 1) + exit(4); + wait(&status); + wait(&status); + exit(ok ? 0 : 5); +} +], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes, + [AC_MSG_WARN(cannot check pgrp synchronization if cross compiling -- defaulting to no) + bash_cv_pgrp_pipe=no]) +]) +AC_MSG_RESULT($bash_cv_pgrp_pipe) +if test $bash_cv_pgrp_pipe = yes; then +AC_DEFINE(PGRP_PIPE) +fi +]) + +AC_DEFUN(BASH_SYS_REINSTALL_SIGHANDLERS, +[AC_REQUIRE([AC_TYPE_SIGNAL]) +AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE]) +AC_MSG_CHECKING([if signal handlers must be reinstalled when invoked]) +AC_CACHE_VAL(bash_cv_must_reinstall_sighandlers, +[AC_TRY_RUN([ +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +typedef RETSIGTYPE sigfunc(); + +int nsigint; + +#ifdef HAVE_POSIX_SIGNALS +sigfunc * +set_signal_handler(sig, handler) + int sig; + sigfunc *handler; +{ + struct sigaction act, oact; + act.sa_handler = handler; + act.sa_flags = 0; + sigemptyset (&act.sa_mask); + sigemptyset (&oact.sa_mask); + sigaction (sig, &act, &oact); + return (oact.sa_handler); +} +#else +#define set_signal_handler(s, h) signal(s, h) +#endif + +RETSIGTYPE +sigint(s) +int s; +{ + nsigint++; +} + +main() +{ + nsigint = 0; + set_signal_handler(SIGINT, sigint); + kill((int)getpid(), SIGINT); + kill((int)getpid(), SIGINT); + exit(nsigint != 2); +} +], bash_cv_must_reinstall_sighandlers=no, bash_cv_must_reinstall_sighandlers=yes, + [AC_MSG_WARN(cannot check signal handling if cross compiling -- defaulting to no) + bash_cv_must_reinstall_sighandlers=no] +)]) +AC_MSG_RESULT($bash_cv_must_reinstall_sighandlers) +if test $bash_cv_must_reinstall_sighandlers = yes; then +AC_DEFINE(MUST_REINSTALL_SIGHANDLERS) +fi +]) + +dnl check that some necessary job control definitions are present +AC_DEFUN(BASH_SYS_JOB_CONTROL_MISSING, +[AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE]) +AC_MSG_CHECKING(for presence of necessary job control definitions) +AC_CACHE_VAL(bash_cv_job_control_missing, +[AC_TRY_RUN([ +#include +#ifdef HAVE_SYS_WAIT_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#include + +/* Add more tests in here as appropriate. */ +main() +{ +/* signal type */ +#if !defined (HAVE_POSIX_SIGNALS) && !defined (HAVE_BSD_SIGNALS) +exit(1); +#endif + +/* signals and tty control. */ +#if !defined (SIGTSTP) || !defined (SIGSTOP) || !defined (SIGCONT) +exit (1); +#endif + +/* process control */ +#if !defined (WNOHANG) || !defined (WUNTRACED) +exit(1); +#endif + +/* Posix systems have tcgetpgrp and waitpid. */ +#if defined (_POSIX_VERSION) && !defined (HAVE_TCGETPGRP) +exit(1); +#endif + +#if defined (_POSIX_VERSION) && !defined (HAVE_WAITPID) +exit(1); +#endif + +/* Other systems have TIOCSPGRP/TIOCGPRGP and wait3. */ +#if !defined (_POSIX_VERSION) && !defined (HAVE_WAIT3) +exit(1); +#endif + +exit(0); +}], bash_cv_job_control_missing=present, bash_cv_job_control_missing=missing, + [AC_MSG_WARN(cannot check job control if cross-compiling -- defaulting to missing) + bash_cv_job_control_missing=missing] +)]) +AC_MSG_RESULT($bash_cv_job_control_missing) +if test $bash_cv_job_control_missing = missing; then +AC_DEFINE(JOB_CONTROL_MISSING) +fi +]) + +dnl check whether named pipes are present +dnl this requires a previous check for mkfifo, but that is awkward to specify +AC_DEFUN(BASH_SYS_NAMED_PIPES, +[AC_MSG_CHECKING(for presence of named pipes) +AC_CACHE_VAL(bash_cv_sys_named_pipes, +[AC_TRY_RUN([ +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +/* Add more tests in here as appropriate. */ +main() +{ +int fd, err; + +#if defined (HAVE_MKFIFO) +exit (0); +#endif + +#if !defined (S_IFIFO) && (defined (_POSIX_VERSION) && !defined (S_ISFIFO)) +exit (1); +#endif + +#if defined (NeXT) +exit (1); +#endif +err = mkdir("bash-aclocal", 0700); +if (err < 0) { + perror ("mkdir"); + exit(1); +} +fd = mknod ("bash-aclocal/sh-np-autoconf", 0666 | S_IFIFO, 0); +if (fd == -1) { + rmdir ("bash-aclocal"); + exit (1); +} +close(fd); +unlink ("bash-aclocal/sh-np-autoconf"); +rmdir ("bash-aclocal"); +exit(0); +}], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing, + [AC_MSG_WARN(cannot check for named pipes if cross-compiling -- defaulting to missing) + bash_cv_sys_named_pipes=missing] +)]) +AC_MSG_RESULT($bash_cv_sys_named_pipes) +if test $bash_cv_sys_named_pipes = missing; then +AC_DEFINE(NAMED_PIPES_MISSING) +fi +]) + +AC_DEFUN(BASH_SYS_DEFAULT_MAIL_DIR, +[AC_MSG_CHECKING(for default mail directory) +AC_CACHE_VAL(bash_cv_mail_dir, +[if test -d /var/mail; then + bash_cv_mail_dir=/var/mail + elif test -d /var/spool/mail; then + bash_cv_mail_dir=/var/spool/mail + elif test -d /usr/mail; then + bash_cv_mail_dir=/usr/mail + elif test -d /usr/spool/mail; then + bash_cv_mail_dir=/usr/spool/mail + else + bash_cv_mail_dir=unknown + fi +]) +AC_MSG_RESULT($bash_cv_mail_dir) +AC_DEFINE_UNQUOTED(DEFAULT_MAIL_DIRECTORY, "$bash_cv_mail_dir") +]) + +AC_DEFUN(BASH_HAVE_TIOCGWINSZ, +[AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h) +AC_CACHE_VAL(bash_cv_tiocgwinsz_in_ioctl, +[AC_TRY_COMPILE([#include +#include ], [int x = TIOCGWINSZ;], + bash_cv_tiocgwinsz_in_ioctl=yes,bash_cv_tiocgwinsz_in_ioctl=no)]) +AC_MSG_RESULT($bash_cv_tiocgwinsz_in_ioctl) +if test $bash_cv_tiocgwinsz_in_ioctl = yes; then +AC_DEFINE(GWINSZ_IN_SYS_IOCTL) +fi +]) + +AC_DEFUN(BASH_HAVE_TIOCSTAT, +[AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h) +AC_CACHE_VAL(bash_cv_tiocstat_in_ioctl, +[AC_TRY_COMPILE([#include +#include ], [int x = TIOCSTAT;], + bash_cv_tiocstat_in_ioctl=yes,bash_cv_tiocstat_in_ioctl=no)]) +AC_MSG_RESULT($bash_cv_tiocstat_in_ioctl) +if test $bash_cv_tiocstat_in_ioctl = yes; then +AC_DEFINE(TIOCSTAT_IN_SYS_IOCTL) +fi +]) + +AC_DEFUN(BASH_HAVE_FIONREAD, +[AC_MSG_CHECKING(for FIONREAD in sys/ioctl.h) +AC_CACHE_VAL(bash_cv_fionread_in_ioctl, +[AC_TRY_COMPILE([#include +#include ], [int x = FIONREAD;], + bash_cv_fionread_in_ioctl=yes,bash_cv_fionread_in_ioctl=no)]) +AC_MSG_RESULT($bash_cv_fionread_in_ioctl) +if test $bash_cv_fionread_in_ioctl = yes; then +AC_DEFINE(FIONREAD_IN_SYS_IOCTL) +fi +]) + +dnl +dnl See if speed_t is declared in . Some versions of linux +dnl require a definition of speed_t each time is included, +dnl but you can only get speed_t if you include (on some +dnl versions) or (on others). +dnl +AC_DEFUN(BASH_CHECK_SPEED_T, +[AC_MSG_CHECKING(for speed_t in sys/types.h) +AC_CACHE_VAL(bash_cv_speed_t_in_sys_types, +[AC_TRY_COMPILE([#include ], [speed_t x;], + bash_cv_speed_t_in_sys_types=yes,bash_cv_speed_t_in_sys_types=no)]) +AC_MSG_RESULT($bash_cv_speed_t_in_sys_types) +if test $bash_cv_speed_t_in_sys_types = yes; then +AC_DEFINE(SPEED_T_IN_SYS_TYPES) +fi +]) + +AC_DEFUN(BASH_CHECK_GETPW_FUNCS, +[AC_MSG_CHECKING(whether getpw functions are declared in pwd.h) +AC_CACHE_VAL(bash_cv_getpw_declared, +[AC_EGREP_CPP(getpwuid, +[ +#include +#ifdef HAVE_UNISTD_H +# include +#endif +#include +], +bash_cv_getpw_declared=yes,bash_cv_getpw_declared=no)]) +AC_MSG_RESULT($bash_cv_getpw_declared) +if test $bash_cv_getpw_declared = yes; then +AC_DEFINE(HAVE_GETPW_DECLS) +fi +]) + +AC_DEFUN(BASH_CHECK_DEV_FD, +[AC_MSG_CHECKING(whether /dev/fd is available) +AC_CACHE_VAL(bash_cv_dev_fd, +[bash_cv_dev_fd="" +if test -d /dev/fd && (exec test -r /dev/fd/0 < /dev/null) ; then +# check for systems like FreeBSD 5 that only provide /dev/fd/[012] + if (exec test -r /dev/fd/3 3 +#include +], +[ + int f; + f = RLIMIT_DATA; +], bash_cv_kernel_rlimit=no, +[AC_TRY_COMPILE([ +#include +#define _KERNEL +#include +#undef _KERNEL +], +[ + int f; + f = RLIMIT_DATA; +], bash_cv_kernel_rlimit=yes, bash_cv_kernel_rlimit=no)] +)]) +AC_MSG_RESULT($bash_cv_kernel_rlimit) +if test $bash_cv_kernel_rlimit = yes; then +AC_DEFINE(RLIMIT_NEEDS_KERNEL) +fi +]) + +dnl +dnl Check for 64-bit off_t -- used for malloc alignment +dnl +dnl C does not allow duplicate case labels, so the compile will fail if +dnl sizeof(off_t) is > 4. +dnl +AC_DEFUN(BASH_CHECK_OFF_T_64, +[AC_CACHE_CHECK(for 64-bit off_t, bash_cv_off_t_64, +AC_TRY_COMPILE([ +#ifdef HAVE_UNISTD_H +#include +#endif +#include +],[ +switch (0) case 0: case (sizeof (off_t) <= 4):; +], bash_cv_off_t_64=no, bash_cv_off_t_64=yes)) +if test $bash_cv_off_t_64 = yes; then + AC_DEFINE(HAVE_OFF_T_64) +fi]) + +AC_DEFUN(BASH_CHECK_RTSIGS, +[AC_MSG_CHECKING(for unusable real-time signals due to large values) +AC_CACHE_VAL(bash_cv_unusable_rtsigs, +[AC_TRY_RUN([ +#include +#include + +#ifndef NSIG +# define NSIG 64 +#endif + +main () +{ + int n_sigs = 2 * NSIG; +#ifdef SIGRTMIN + int rtmin = SIGRTMIN; +#else + int rtmin = 0; +#endif + + exit(rtmin < n_sigs); +}], bash_cv_unusable_rtsigs=yes, bash_cv_unusable_rtsigs=no, + [AC_MSG_WARN(cannot check real-time signals if cross compiling -- defaulting to yes) + bash_cv_unusable_rtsigs=yes] +)]) +AC_MSG_RESULT($bash_cv_unusable_rtsigs) +if test $bash_cv_unusable_rtsigs = yes; then +AC_DEFINE(UNUSABLE_RT_SIGNALS) +fi +]) + +dnl +dnl check for availability of multibyte characters and functions +dnl +dnl geez, I wish I didn't have to check for all of this stuff separately +dnl +AC_DEFUN(BASH_CHECK_MULTIBYTE, +[ +AC_CHECK_HEADERS(wctype.h) +AC_CHECK_HEADERS(wchar.h) +AC_CHECK_HEADERS(langinfo.h) + +AC_CHECK_FUNC(mbrlen, AC_DEFINE(HAVE_MBRLEN)) +AC_CHECK_FUNC(mbscasecmp, AC_DEFINE(HAVE_MBSCMP)) +AC_CHECK_FUNC(mbscmp, AC_DEFINE(HAVE_MBSCMP)) +AC_CHECK_FUNC(mbsnrtowcs, AC_DEFINE(HAVE_MBSNRTOWCS)) +AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS)) + +AC_REPLACE_FUNCS(mbschr) + +AC_CHECK_FUNC(wcrtomb, AC_DEFINE(HAVE_WCRTOMB)) +AC_CHECK_FUNC(wcscoll, AC_DEFINE(HAVE_WCSCOLL)) +AC_CHECK_FUNC(wcsdup, AC_DEFINE(HAVE_WCSDUP)) +AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH)) +AC_CHECK_FUNC(wctype, AC_DEFINE(HAVE_WCTYPE)) + +AC_REPLACE_FUNCS(wcswidth) + +dnl checks for both mbrtowc and mbstate_t +AC_FUNC_MBRTOWC +if test $ac_cv_func_mbrtowc = yes; then + AC_DEFINE(HAVE_MBSTATE_T) +fi + +AC_CHECK_FUNCS(iswlower iswupper towlower towupper iswctype) + +AC_CACHE_CHECK([for nl_langinfo and CODESET], bash_cv_langinfo_codeset, +[AC_TRY_LINK( +[#include ], +[char* cs = nl_langinfo(CODESET);], +bash_cv_langinfo_codeset=yes, bash_cv_langinfo_codeset=no)]) +if test $bash_cv_langinfo_codeset = yes; then + AC_DEFINE(HAVE_LANGINFO_CODESET) +fi + +dnl check for wchar_t in +AC_CACHE_CHECK([for wchar_t in wchar.h], bash_cv_type_wchar_t, +[AC_TRY_COMPILE( +[#include +], +[ + wchar_t foo; + foo = 0; +], bash_cv_type_wchar_t=yes, bash_cv_type_wchar_t=no)]) +if test $bash_cv_type_wchar_t = yes; then + AC_DEFINE(HAVE_WCHAR_T, 1, [systems should define this type here]) +fi + +dnl check for wctype_t in +AC_CACHE_CHECK([for wctype_t in wctype.h], bash_cv_type_wctype_t, +[AC_TRY_COMPILE( +[#include ], +[ + wctype_t foo; + foo = 0; +], bash_cv_type_wctype_t=yes, bash_cv_type_wctype_t=no)]) +if test $bash_cv_type_wctype_t = yes; then + AC_DEFINE(HAVE_WCTYPE_T, 1, [systems should define this type here]) +fi + +dnl check for wint_t in +AC_CACHE_CHECK([for wint_t in wctype.h], bash_cv_type_wint_t, +[AC_TRY_COMPILE( +[#include ], +[ + wint_t foo; + foo = 0; +], bash_cv_type_wint_t=yes, bash_cv_type_wint_t=no)]) +if test $bash_cv_type_wint_t = yes; then + AC_DEFINE(HAVE_WINT_T, 1, [systems should define this type here]) +fi + +dnl check for broken wcwidth +AC_CACHE_CHECK([for wcwidth broken with unicode combining characters], +bash_cv_wcwidth_broken, +[AC_TRY_RUN([ +#include +#include +#include + +#include +#include + +main(c, v) +int c; +char **v; +{ + int w; + + setlocale(LC_ALL, "en_US.UTF-8"); + w = wcwidth (0x0301); + exit (w == 0); /* exit 0 if wcwidth broken */ +} +], +bash_cv_wcwidth_broken=yes, bash_cv_wcwdith_broken=no, bash_cv_wcwidth_broken=no)]) +if test "$bash_cv_wcwidth_broken" = yes; then + AC_DEFINE(WCWIDTH_BROKEN, 1, [wcwidth is usually not broken]) +fi + +if test "$am_cv_func_iconv" = yes; then + OLDLIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + AC_CHECK_FUNCS(locale_charset) + LIBS="$OLDLIBS" +fi + +]) + +dnl need: prefix exec_prefix libdir includedir CC TERMCAP_LIB +dnl require: +dnl AC_PROG_CC +dnl BASH_CHECK_LIB_TERMCAP + +AC_DEFUN([RL_LIB_READLINE_VERSION], +[ +AC_REQUIRE([BASH_CHECK_LIB_TERMCAP]) + +AC_MSG_CHECKING([version of installed readline library]) + +# What a pain in the ass this is. + +# save cpp and ld options +_save_CFLAGS="$CFLAGS" +_save_LDFLAGS="$LDFLAGS" +_save_LIBS="$LIBS" + +# Don't set ac_cv_rl_prefix if the caller has already assigned a value. This +# allows the caller to do something like $_rl_prefix=$withval if the user +# specifies --with-installed-readline=PREFIX as an argument to configure + +if test -z "$ac_cv_rl_prefix"; then +test "x$prefix" = xNONE && ac_cv_rl_prefix=$ac_default_prefix || ac_cv_rl_prefix=${prefix} +fi + +eval ac_cv_rl_includedir=${ac_cv_rl_prefix}/include +eval ac_cv_rl_libdir=${ac_cv_rl_prefix}/lib + +LIBS="$LIBS -lreadline ${TERMCAP_LIB}" +CFLAGS="$CFLAGS -I${ac_cv_rl_includedir}" +LDFLAGS="$LDFLAGS -L${ac_cv_rl_libdir}" + +AC_CACHE_VAL(ac_cv_rl_version, +[AC_TRY_RUN([ +#include +#include + +extern int rl_gnu_readline_p; + +main() +{ + FILE *fp; + fp = fopen("conftest.rlv", "w"); + if (fp == 0) + exit(1); + if (rl_gnu_readline_p != 1) + fprintf(fp, "0.0\n"); + else + fprintf(fp, "%s\n", rl_library_version ? rl_library_version : "0.0"); + fclose(fp); + exit(0); +} +], +ac_cv_rl_version=`cat conftest.rlv`, +ac_cv_rl_version='0.0', +ac_cv_rl_version='4.2')]) + +CFLAGS="$_save_CFLAGS" +LDFLAGS="$_save_LDFLAGS" +LIBS="$_save_LIBS" + +RL_MAJOR=0 +RL_MINOR=0 + +# ( +case "$ac_cv_rl_version" in +2*|3*|4*|5*|6*|7*|8*|9*) + RL_MAJOR=`echo $ac_cv_rl_version | sed 's:\..*$::'` + RL_MINOR=`echo $ac_cv_rl_version | sed -e 's:^.*\.::' -e 's:[[a-zA-Z]]*$::'` + ;; +esac + +# ((( +case $RL_MAJOR in +[[0-9][0-9]]) _RL_MAJOR=$RL_MAJOR ;; +[[0-9]]) _RL_MAJOR=0$RL_MAJOR ;; +*) _RL_MAJOR=00 ;; +esac + +# ((( +case $RL_MINOR in +[[0-9][0-9]]) _RL_MINOR=$RL_MINOR ;; +[[0-9]]) _RL_MINOR=0$RL_MINOR ;; +*) _RL_MINOR=00 ;; +esac + +RL_VERSION="0x${_RL_MAJOR}${_RL_MINOR}" + +# Readline versions greater than 4.2 have these defines in readline.h + +if test $ac_cv_rl_version = '0.0' ; then + AC_MSG_WARN([Could not test version of installed readline library.]) +elif test $RL_MAJOR -gt 4 || { test $RL_MAJOR = 4 && test $RL_MINOR -gt 2 ; } ; then + # set these for use by the caller + RL_PREFIX=$ac_cv_rl_prefix + RL_LIBDIR=$ac_cv_rl_libdir + RL_INCLUDEDIR=$ac_cv_rl_includedir + AC_MSG_RESULT($ac_cv_rl_version) +else + +AC_DEFINE_UNQUOTED(RL_READLINE_VERSION, $RL_VERSION, [encoded version of the installed readline library]) +AC_DEFINE_UNQUOTED(RL_VERSION_MAJOR, $RL_MAJOR, [major version of installed readline library]) +AC_DEFINE_UNQUOTED(RL_VERSION_MINOR, $RL_MINOR, [minor version of installed readline library]) + +AC_SUBST(RL_VERSION) +AC_SUBST(RL_MAJOR) +AC_SUBST(RL_MINOR) + +# set these for use by the caller +RL_PREFIX=$ac_cv_rl_prefix +RL_LIBDIR=$ac_cv_rl_libdir +RL_INCLUDEDIR=$ac_cv_rl_includedir + +AC_MSG_RESULT($ac_cv_rl_version) + +fi +]) + +AC_DEFUN(BASH_FUNC_CTYPE_NONASCII, +[ +AC_MSG_CHECKING(whether the ctype macros accept non-ascii characters) +AC_CACHE_VAL(bash_cv_func_ctype_nonascii, +[AC_TRY_RUN([ +#ifdef HAVE_LOCALE_H +#include +#endif +#include +#include + +main(c, v) +int c; +char *v[]; +{ + char *deflocale; + unsigned char x; + int r1, r2; + +#ifdef HAVE_SETLOCALE + /* We take a shot here. If that locale is not known, try the + system default. We try this one because '\342' (226) is + known to be a printable character in that locale. */ + deflocale = setlocale(LC_ALL, "en_US.ISO8859-1"); + if (deflocale == 0) + deflocale = setlocale(LC_ALL, ""); +#endif + + x = '\342'; + r1 = isprint(x); + x -= 128; + r2 = isprint(x); + exit (r1 == 0 || r2 == 0); +} +], bash_cv_func_ctype_nonascii=yes, bash_cv_func_ctype_nonascii=no, + [AC_MSG_WARN(cannot check ctype macros if cross compiling -- defaulting to no) + bash_cv_func_ctype_nonascii=no] +)]) +AC_MSG_RESULT($bash_cv_func_ctype_nonascii) +if test $bash_cv_func_ctype_nonascii = yes; then +AC_DEFINE(CTYPE_NON_ASCII) +fi +]) + +AC_DEFUN(BASH_CHECK_WCONTINUED, +[ +AC_MSG_CHECKING(whether WCONTINUED flag to waitpid is unavailable or available but broken) +AC_CACHE_VAL(bash_cv_wcontinued_broken, +[AC_TRY_RUN([ +#include +#include +#include +#include + +#ifndef errno +extern int errno; +#endif +main() +{ + int x; + + x = waitpid(-1, (int *)0, WNOHANG|WCONTINUED); + if (x == -1 && errno == EINVAL) + exit (1); + else + exit (0); +} +], bash_cv_wcontinued_broken=no,bash_cv_wcontinued_broken=yes, + [AC_MSG_WARN(cannot check WCONTINUED if cross compiling -- defaulting to no) + bash_cv_wcontinued_broken=no] +)]) +AC_MSG_RESULT($bash_cv_wcontinued_broken) +if test $bash_cv_wcontinued_broken = yes; then +AC_DEFINE(WCONTINUED_BROKEN) +fi +]) + +dnl +dnl tests added for bashdb +dnl + + +AC_DEFUN([AM_PATH_LISPDIR], + [AC_ARG_WITH(lispdir, AC_HELP_STRING([--with-lispdir], [override the default lisp directory]), + [ lispdir="$withval" + AC_MSG_CHECKING([where .elc files should go]) + AC_MSG_RESULT([$lispdir])], + [ + # If set to t, that means we are running in a shell under Emacs. + # If you have an Emacs named "t", then use the full path. + test x"$EMACS" = xt && EMACS= + AC_CHECK_PROGS(EMACS, emacs xemacs, no) + if test $EMACS != "no"; then + if test x${lispdir+set} != xset; then + AC_CACHE_CHECK([where .elc files should go], [am_cv_lispdir], [dnl + am_cv_lispdir=`$EMACS -batch -q -eval '(while load-path (princ (concat (car load-path) "\n")) (setq load-path (cdr load-path)))' | sed -n -e 's,/$,,' -e '/.*\/lib\/\(x\?emacs\/site-lisp\)$/{s,,${libdir}/\1,;p;q;}' -e '/.*\/share\/\(x\?emacs\/site-lisp\)$/{s,,${datadir}/\1,;p;q;}'` + if test -z "$am_cv_lispdir"; then + am_cv_lispdir='${datadir}/emacs/site-lisp' + fi + ]) + lispdir="$am_cv_lispdir" + fi + fi + ]) + AC_SUBST(lispdir) +]) + +dnl +dnl tests added for gettext +dnl +# codeset.m4 serial AM1 (gettext-0.10.40) +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +AC_DEFUN([AM_LANGINFO_CODESET], +[ + AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, + [AC_TRY_LINK([#include ], + [char* cs = nl_langinfo(CODESET);], + am_cv_langinfo_codeset=yes, + am_cv_langinfo_codeset=no) + ]) + if test $am_cv_langinfo_codeset = yes; then + AC_DEFINE(HAVE_LANGINFO_CODESET, 1, + [Define if you have and nl_langinfo(CODESET).]) + fi +]) +# gettext.m4 serial 20 (gettext-0.12) +dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995-2000. +dnl Bruno Haible , 2000-2003. + +dnl Macro to add for using GNU gettext. + +dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). +dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The +dnl default (if it is not specified or empty) is 'no-libtool'. +dnl INTLSYMBOL should be 'external' for packages with no intl directory, +dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. +dnl If INTLSYMBOL is 'use-libtool', then a libtool library +dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, +dnl depending on --{enable,disable}-{shared,static} and on the presence of +dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library +dnl $(top_builddir)/intl/libintl.a will be created. +dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext +dnl implementations (in libc or libintl) without the ngettext() function +dnl will be ignored. If NEEDSYMBOL is specified and is +dnl 'need-formatstring-macros', then GNU gettext implementations that don't +dnl support the ISO C 99 formatstring macros will be ignored. +dnl INTLDIR is used to find the intl libraries. If empty, +dnl the value `$(top_builddir)/intl/' is used. +dnl +dnl The result of the configuration is one of three cases: +dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled +dnl and used. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 2) GNU gettext has been found in the system's C library. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 3) No internationalization, always use English msgid. +dnl Catalog format: none +dnl Catalog extension: none +dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. +dnl The use of .gmo is historical (it was needed to avoid overwriting the +dnl GNU format catalogs when building on a platform with an X/Open gettext), +dnl but we keep it in order not to force irrelevant filename changes on the +dnl maintainers. +dnl +AC_DEFUN([AM_GNU_GETTEXT], +[ + dnl Argument checking. + ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , + [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT +])])])])]) + ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , + [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT +])])])]) + define(gt_included_intl, ifelse([$1], [external], [no], [yes])) + define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], [])) + + AC_REQUIRE([AM_PO_SUBDIRS])dnl + ifelse(gt_included_intl, yes, [ + AC_REQUIRE([AM_INTL_SUBDIR])dnl + ]) + + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Sometimes libintl requires libiconv, so first search for libiconv. + dnl Ideally we would do this search only after the + dnl if test "$USE_NLS" = "yes"; then + dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then + dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT + dnl the configure script would need to contain the same shell code + dnl again, outside any 'if'. There are two solutions: + dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. + dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. + dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not + dnl documented, we avoid it. + ifelse(gt_included_intl, yes, , [ + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + ]) + + dnl Set USE_NLS. + AM_NLS + + ifelse(gt_included_intl, yes, [ + BUILD_INCLUDED_LIBINTL=no + USE_INCLUDED_LIBINTL=no + ]) + LIBINTL= + LTLIBINTL= + POSUB= + + dnl If we use NLS figure out what method + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + ifelse(gt_included_intl, yes, [ + AC_MSG_CHECKING([whether included gettext is requested]) + AC_ARG_WITH(included-gettext, + [ --with-included-gettext use the GNU gettext library included here], + nls_cv_force_use_gnu_gettext=$withval, + nls_cv_force_use_gnu_gettext=no) + AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + ]) + dnl User does not insist on using GNU NLS library. Figure out what + dnl to use. If GNU gettext is available we use this. Else we have + dnl to fall back to GNU NLS library. + + dnl Add a version number to the cache macros. + define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1))) + define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) + define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) + + AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, + [AC_TRY_LINK([#include +]ifelse([$2], [need-formatstring-macros], +[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +changequote(,)dnl +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +changequote([,])dnl +], [])[extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings;], + [bindtextdomain ("", ""); +return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], + gt_cv_func_gnugettext_libc=yes, + gt_cv_func_gnugettext_libc=no)]) + + if test "$gt_cv_func_gnugettext_libc" != "yes"; then + dnl Sometimes libintl requires libiconv, so first search for libiconv. + ifelse(gt_included_intl, yes, , [ + AM_ICONV_LINK + ]) + dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL + dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) + dnl because that would add "-liconv" to LIBINTL and LTLIBINTL + dnl even if libiconv doesn't exist. + AC_LIB_LINKFLAGS_BODY([intl]) + AC_CACHE_CHECK([for GNU gettext in libintl], + gt_cv_func_gnugettext_libintl, + [gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + dnl Now see whether libintl exists and does not depend on libiconv. + AC_TRY_LINK([#include +]ifelse([$2], [need-formatstring-macros], +[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +changequote(,)dnl +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +changequote([,])dnl +], [])[extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias ();], + [bindtextdomain ("", ""); +return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], + gt_cv_func_gnugettext_libintl=yes, + gt_cv_func_gnugettext_libintl=no) + dnl Now see whether libintl exists and depends on libiconv. + if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + AC_TRY_LINK([#include +]ifelse([$2], [need-formatstring-macros], +[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +changequote(,)dnl +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +changequote([,])dnl +], [])[extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias ();], + [bindtextdomain ("", ""); +return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], + [LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + gt_cv_func_gnugettext_libintl=yes + ]) + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS"]) + fi + + dnl If an already present or preinstalled GNU gettext() is found, + dnl use it. But if this macro is used in GNU gettext, and GNU + dnl gettext is already preinstalled in libintl, we update this + dnl libintl. (Cf. the install rule in intl/Makefile.in.) + if test "$gt_cv_func_gnugettext_libc" = "yes" \ + || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + dnl Reset the values set by searching for libintl. + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + ifelse(gt_included_intl, yes, [ + if test "$gt_use_preinstalled_gnugettext" != "yes"; then + dnl GNU gettext is not found in the C library. + dnl Fall back on included GNU gettext library. + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions used to generate GNU NLS library. + BUILD_INCLUDED_LIBINTL=yes + USE_INCLUDED_LIBINTL=yes + LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" + LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" + LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions to use GNU gettext tools. + CATOBJEXT=.gmo + fi + ]) + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + AC_DEFINE(ENABLE_NLS, 1, + [Define to 1 if translation of program messages to the user's native language + is requested.]) + else + USE_NLS=no + fi + fi + + AC_MSG_CHECKING([whether to use NLS]) + AC_MSG_RESULT([$USE_NLS]) + if test "$USE_NLS" = "yes"; then + AC_MSG_CHECKING([where the gettext function comes from]) + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext_libintl" = "yes"; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + AC_MSG_RESULT([$gt_source]) + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext_libintl" = "yes"; then + AC_MSG_CHECKING([how to link with libintl]) + AC_MSG_RESULT([$LIBINTL]) + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) + fi + + dnl For backward compatibility. Some packages may be using this. + AC_DEFINE(HAVE_GETTEXT, 1, + [Define if the GNU gettext() function is already present or preinstalled.]) + AC_DEFINE(HAVE_DCGETTEXT, 1, + [Define if the GNU dcgettext() function is already present or preinstalled.]) + fi + + dnl We need to process the po/ directory. + POSUB=po + fi + + ifelse(gt_included_intl, yes, [ + dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL + dnl to 'yes' because some of the testsuite requires it. + if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then + BUILD_INCLUDED_LIBINTL=yes + fi + + dnl Make all variables we use known to autoconf. + AC_SUBST(BUILD_INCLUDED_LIBINTL) + AC_SUBST(USE_INCLUDED_LIBINTL) + AC_SUBST(CATOBJEXT) + + dnl For backward compatibility. Some configure.ins may be using this. + nls_cv_header_intl= + nls_cv_header_libgt= + + dnl For backward compatibility. Some Makefiles may be using this. + DATADIRNAME=share + AC_SUBST(DATADIRNAME) + + dnl For backward compatibility. Some Makefiles may be using this. + INSTOBJEXT=.mo + AC_SUBST(INSTOBJEXT) + + dnl For backward compatibility. Some Makefiles may be using this. + GENCAT=gencat + AC_SUBST(GENCAT) + + dnl For backward compatibility. Some Makefiles may be using this. + if test "$USE_INCLUDED_LIBINTL" = yes; then + INTLOBJS="\$(GETTOBJS)" + fi + AC_SUBST(INTLOBJS) + + dnl Enable libtool support if the surrounding package wishes it. + INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix + AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) + ]) + + dnl For backward compatibility. Some Makefiles may be using this. + INTLLIBS="$LIBINTL" + AC_SUBST(INTLLIBS) + + dnl Make all documented variables known to autoconf. + AC_SUBST(LIBINTL) + AC_SUBST(LTLIBINTL) + AC_SUBST(POSUB) +]) + + +dnl Checks for all prerequisites of the intl subdirectory, +dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, +dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. +AC_DEFUN([AM_INTL_SUBDIR], +[ + AC_REQUIRE([AC_PROG_INSTALL])dnl + AC_REQUIRE([AM_MKINSTALLDIRS])dnl + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl + AC_REQUIRE([AC_PROG_RANLIB])dnl + AC_REQUIRE([AC_ISC_POSIX])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + AC_REQUIRE([AC_C_CONST])dnl + AC_REQUIRE([AC_C_INLINE])dnl + AC_REQUIRE([AC_TYPE_OFF_T])dnl + AC_REQUIRE([AC_TYPE_SIZE_T])dnl + AC_REQUIRE([AC_FUNC_ALLOCA])dnl + AC_REQUIRE([AC_FUNC_MMAP])dnl + AC_REQUIRE([jm_GLIBC21])dnl + AC_REQUIRE([gt_INTDIV0])dnl + AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl + AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl + AC_REQUIRE([gt_INTTYPES_PRI])dnl + + AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ +stdlib.h string.h unistd.h sys/param.h]) + AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \ +geteuid getgid getuid mempcpy munmap putenv setenv setlocale localeconv stpcpy \ +strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next \ +__fsetlocking]) + + AM_ICONV + AM_LANGINFO_CODESET + if test $ac_cv_header_locale_h = yes; then + AM_LC_MESSAGES + fi + + dnl intl/plural.c is generated from intl/plural.y. It requires bison, + dnl because plural.y uses bison specific features. It requires at least + dnl bison-1.26 because earlier versions generate a plural.c that doesn't + dnl compile. + dnl bison is only needed for the maintainer (who touches plural.y). But in + dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put + dnl the rule in general Makefile. Now, some people carelessly touch the + dnl files or have a broken "make" program, hence the plural.c rule will + dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not + dnl present or too old. + AC_CHECK_PROGS([INTLBISON], [bison]) + if test -z "$INTLBISON"; then + ac_verc_fail=yes + else + dnl Found it, now check the version. + AC_MSG_CHECKING([version of bison]) +changequote(<<,>>)dnl + ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) +changequote([,])dnl + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + esac + AC_MSG_RESULT([$ac_prog_version]) + fi + if test $ac_verc_fail = yes; then + INTLBISON=: + fi +]) + + +dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) +AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) +# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40) +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +# Test for the GNU C Library, version 2.1 or newer. +# From Bruno Haible. + +AC_DEFUN([jm_GLIBC21], + [ + AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, + ac_cv_gnu_library_2_1, + [AC_EGREP_CPP([Lucky GNU user], + [ +#include +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif + ], + ac_cv_gnu_library_2_1=yes, + ac_cv_gnu_library_2_1=no) + ] + ) + AC_SUBST(GLIBC21) + GLIBC21="$ac_cv_gnu_library_2_1" + ] +) +# iconv.m4 serial AM4 (gettext-0.11.3) +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], +[ + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([iconv]) +]) + +AC_DEFUN([AM_ICONV_LINK], +[ + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and + dnl those with the standalone portable GNU libiconv installed). + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + + dnl Add $INCICONV to CPPFLAGS before performing the following checks, + dnl because if the user has installed libiconv and not disabled its use + dnl via --without-libiconv-prefix, he wants to use it. The first + dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. + am_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) + + AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + AC_TRY_LINK([#include +#include ], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_func_iconv=yes) + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + AC_TRY_LINK([#include +#include ], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_lib_iconv=yes + am_cv_func_iconv=yes) + LIBS="$am_save_LIBS" + fi + ]) + if test "$am_cv_func_iconv" = yes; then + AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) + fi + if test "$am_cv_lib_iconv" = yes; then + AC_MSG_CHECKING([how to link with libiconv]) + AC_MSG_RESULT([$LIBICONV]) + else + dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV + dnl either. + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + AC_SUBST(LIBICONV) + AC_SUBST(LTLIBICONV) +]) + +AC_DEFUN([AM_ICONV], +[ + AM_ICONV_LINK + if test "$am_cv_func_iconv" = yes; then + AC_MSG_CHECKING([for iconv declaration]) + AC_CACHE_VAL(am_cv_proto_iconv, [ + AC_TRY_COMPILE([ +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif +], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) + am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + AC_MSG_RESULT([$]{ac_t:- + }[$]am_cv_proto_iconv) + AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, + [Define as const if the declaration of iconv() needs const.]) + fi +]) +# intdiv0.m4 serial 1 (gettext-0.11.3) +dnl Copyright (C) 2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +AC_DEFUN([gt_INTDIV0], +[ + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl + + AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], + gt_cv_int_divbyzero_sigfpe, + [ + AC_TRY_RUN([ +#include +#include + +static void +#ifdef __cplusplus +sigfpe_handler (int sig) +#else +sigfpe_handler (sig) int sig; +#endif +{ + /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ + exit (sig != SIGFPE); +} + +int x = 1; +int y = 0; +int z; +int nan; + +int main () +{ + signal (SIGFPE, sigfpe_handler); +/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ +#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) + signal (SIGTRAP, sigfpe_handler); +#endif +/* Linux/SPARC yields signal SIGILL. */ +#if defined (__sparc__) && defined (__linux__) + signal (SIGILL, sigfpe_handler); +#endif + + z = x / y; + nan = y / y; + exit (1); +} +], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, + [ + # Guess based on the CPU. + case "$host_cpu" in + alpha* | i[34567]86 | m68k | s390*) + gt_cv_int_divbyzero_sigfpe="guessing yes";; + *) + gt_cv_int_divbyzero_sigfpe="guessing no";; + esac + ]) + ]) + case "$gt_cv_int_divbyzero_sigfpe" in + *yes) value=1;; + *) value=0;; + esac + AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, + [Define if integer division by zero raises signal SIGFPE.]) +]) +# inttypes.m4 serial 1 (gettext-0.11.4) +dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Paul Eggert. + +# Define HAVE_INTTYPES_H if exists and doesn't clash with +# . + +AC_DEFUN([gt_HEADER_INTTYPES_H], +[ + AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h, + [ + AC_TRY_COMPILE( + [#include +#include ], + [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no) + ]) + if test $gt_cv_header_inttypes_h = yes; then + AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, + [Define if exists and doesn't clash with .]) + fi +]) +# inttypes_h.m4 serial 5 (gettext-0.12) +dnl Copyright (C) 1997-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Paul Eggert. + +# Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, +# doesn't clash with , and declares uintmax_t. + +AC_DEFUN([jm_AC_HEADER_INTTYPES_H], +[ + AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h, + [AC_TRY_COMPILE( + [#include +#include ], + [uintmax_t i = (uintmax_t) -1;], + jm_ac_cv_header_inttypes_h=yes, + jm_ac_cv_header_inttypes_h=no)]) + if test $jm_ac_cv_header_inttypes_h = yes; then + AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, + [Define if exists, doesn't clash with , + and declares uintmax_t. ]) + fi +]) +# inttypes-pri.m4 serial 1 (gettext-0.11.4) +dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +# Define PRI_MACROS_BROKEN if exists and defines the PRI* +# macros to non-string values. This is the case on AIX 4.3.3. + +AC_DEFUN([gt_INTTYPES_PRI], +[ + AC_REQUIRE([gt_HEADER_INTTYPES_H]) + if test $gt_cv_header_inttypes_h = yes; then + AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], + gt_cv_inttypes_pri_broken, + [ + AC_TRY_COMPILE([#include +#ifdef PRId32 +char *p = PRId32; +#endif +], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) + ]) + fi + if test "$gt_cv_inttypes_pri_broken" = yes; then + AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, + [Define if exists and defines unusable PRI* macros.]) + fi +]) +# isc-posix.m4 serial 2 (gettext-0.11.2) +dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +# This file is not needed with autoconf-2.53 and newer. Remove it in 2005. + +# This test replaces the one in autoconf. +# Currently this macro should have the same name as the autoconf macro +# because gettext's gettext.m4 (distributed in the automake package) +# still uses it. Otherwise, the use in gettext.m4 makes autoheader +# give these diagnostics: +# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX +# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX + +undefine([AC_ISC_POSIX]) + +AC_DEFUN([AC_ISC_POSIX], + [ + dnl This test replaces the obsolescent AC_ISC_POSIX kludge. + AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) + ] +) +# lcmessage.m4 serial 3 (gettext-0.11.3) +dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995. + +# Check whether LC_MESSAGES is available in . + +AC_DEFUN([AM_LC_MESSAGES], +[ + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include ], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES, 1, + [Define if your file defines LC_MESSAGES.]) + fi +]) +# lib-ld.m4 serial 2 (gettext-0.12) +dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl Subroutines of libtool.m4, +dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision +dnl with libtool.m4. + +dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. +AC_DEFUN([AC_LIB_PROG_LD_GNU], +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 &5; then + acl_cv_prog_gnu_ld=yes +else + acl_cv_prog_gnu_ld=no +fi]) +with_gnu_ld=$acl_cv_prog_gnu_ld +]) + +dnl From libtool-1.4. Sets the variable LD. +AC_DEFUN([AC_LIB_PROG_LD], +[AC_ARG_WITH(gnu-ld, +[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], +test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by GCC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]* | [A-Za-z]:[\\/]*)] + [re_direlt='/[^/][^/]*/\.\./'] + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(acl_cv_path_LD, +[if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi]) +LD="$acl_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +AC_LIB_PROG_LD_GNU +]) +# lib-link.m4 serial 4 (gettext-0.12) +dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and +dnl augments the CPPFLAGS variable. +AC_DEFUN([AC_LIB_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + ac_cv_lib[]Name[]_libs="$LIB[]NAME" + ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" + ac_cv_lib[]Name[]_cppflags="$INC[]NAME" + ]) + LIB[]NAME="$ac_cv_lib[]Name[]_libs" + LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" + INC[]NAME="$ac_cv_lib[]Name[]_cppflags" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the + dnl results of this search when this library appears as a dependency. + HAVE_LIB[]NAME=yes + undefine([Name]) + undefine([NAME]) +]) + +dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) +dnl searches for libname and the libraries corresponding to explicit and +dnl implicit dependencies, together with the specified include files and +dnl the ability to compile and link the specified testcode. If found, it +dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and +dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and +dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs +dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. +AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + + dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + + dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, + dnl because if the user has installed lib[]Name and not disabled its use + dnl via --without-lib[]Name-prefix, he wants to use it. + ac_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + + AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIB[]NAME" + AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) + LIBS="$ac_save_LIBS" + ]) + if test "$ac_cv_lib[]Name" = yes; then + HAVE_LIB[]NAME=yes + AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) + AC_MSG_CHECKING([how to link with lib[]$1]) + AC_MSG_RESULT([$LIB[]NAME]) + else + HAVE_LIB[]NAME=no + dnl If $LIB[]NAME didn't lead to a usable library, we don't need + dnl $INC[]NAME either. + CPPFLAGS="$ac_save_CPPFLAGS" + LIB[]NAME= + LTLIB[]NAME= + fi + AC_SUBST([HAVE_LIB]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + undefine([Name]) + undefine([NAME]) +]) + +dnl Determine the platform dependent parameters needed to use rpath: +dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, +dnl hardcode_direct, hardcode_minus_L. +AC_DEFUN([AC_LIB_RPATH], +[ + AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS + AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld + AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host + AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir + AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + ]) + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + dnl Determine whether the user wants rpath handling at all. + AC_ARG_ENABLE(rpath, + [ --disable-rpath do not hardcode runtime library paths], + :, enable_rpath=yes) +]) + +dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. +AC_DEFUN([AC_LIB_LINKFLAGS_BODY], +[ + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib$1-prefix], +[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib + --without-lib$1-prefix don't search for lib$1 in includedir and libdir], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi +]) + dnl Search the library and its dependencies in $additional_libdir and + dnl $LDFLAGS. Using breadth-first-seach. + LIB[]NAME= + LTLIB[]NAME= + INC[]NAME= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='$1 $2' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + dnl See if it was already located by an earlier AC_LIB_LINKFLAGS + dnl or AC_LIB_HAVE_LINKFLAGS call. + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" + else + dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined + dnl that this library doesn't exist. So just drop it. + : + fi + else + dnl Search the library lib$name in $additional_libdir and $LDFLAGS + dnl and the already constructed $LIBNAME/$LTLIBNAME. + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test "X$prefer_shared" = "Xyes" && test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test "X$prefer_shared" = "Xyes" && test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + dnl Found the library. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + dnl Linking with a shared library. We attempt to hardcode its + dnl directory into the executable's runpath, unless it's the + dnl standard /usr/lib. + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + dnl No hardcoding is needed. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + dnl The hardcoding into $LIBNAME is system dependent. + if test "$hardcode_direct" = yes; then + dnl Using DIR/libNAME.so during linking hardcodes DIR into the + dnl resulting binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + dnl Rely on "-L$found_dir". + dnl But don't add it if it's already contained in the LDFLAGS + dnl or the already constructed $LIBNAME + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH + dnl here, because this doesn't fit in flags passed to the + dnl compiler. So give up. No hardcoding. This affects only + dnl very old systems. + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + dnl Linking with a static library. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" + else + dnl We shouldn't come here, but anyway it's good to have a + dnl fallback. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" + fi + fi + dnl Assume the include files are nearby. + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + dnl Potentially add $additional_includedir to $INCNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's /usr/local/include and we are using GCC on Linux, + dnl 3. if it's already present in $CPPFLAGS or the already + dnl constructed $INCNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INC[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $INCNAME. + INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + dnl Look for dependencies. + if test -n "$found_la"; then + dnl Read the .la file. It defines the variables + dnl dlname, library_names, old_library, dependency_libs, current, + dnl age, revision, installed, dlopen, dlpreopen, libdir. + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + dnl We use only dependency_libs. + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's /usr/local/lib and we are using GCC on Linux, + dnl 3. if it's already present in $LDFLAGS or the already + dnl constructed $LIBNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LIBNAME. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LTLIBNAME. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + dnl Handle this in the next round. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + dnl Handle this in the next round. Throw away the .la's + dnl directory; it is already contained in a preceding -L + dnl option. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + dnl Most likely an immediate library name. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" + ;; + esac + done + fi + else + dnl Didn't find the library; assume it is in the system directories + dnl known to the linker and runtime loader. (All the system + dnl directories known to the linker should also be known to the + dnl runtime loader, otherwise the system is severely misconfigured.) + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user must + dnl pass all path elements in one option. We can arrange that for a + dnl single library, but not when more than one $LIBNAMEs are used. + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + else + dnl The -rpath options are cumulative. + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + dnl When using libtool, the option that works for both libraries and + dnl executables is -R. The -R options are cumulative. + for found_dir in $ltrpathdirs; do + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" + done + fi +]) + +dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, +dnl unless already present in VAR. +dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes +dnl contains two or three consecutive elements that belong together. +AC_DEFUN([AC_LIB_APPENDTOVAR], +[ + for element in [$2]; do + haveit= + for x in $[$1]; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + [$1]="${[$1]}${[$1]:+ }$element" + fi + done +]) +# lib-prefix.m4 serial 2 (gettext-0.12) +dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and +dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't +dnl require excessive bracketing. +ifdef([AC_HELP_STRING], +[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], +[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) + +dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed +dnl to access previously installed libraries. The basic assumption is that +dnl a user will want packages to use other packages he previously installed +dnl with the same --prefix option. +dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate +dnl libraries, but is otherwise very convenient. +AC_DEFUN([AC_LIB_PREFIX], +[ + AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib-prefix], +[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib + --without-lib-prefix don't search for libraries in includedir and libdir], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi +]) + if test $use_additional = yes; then + dnl Potentially add $additional_includedir to $CPPFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's already present in $CPPFLAGS, + dnl 3. if it's /usr/local/include and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + for x in $CPPFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $CPPFLAGS. + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" + fi + fi + fi + fi + dnl Potentially add $additional_libdir to $LDFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's already present in $LDFLAGS, + dnl 3. if it's /usr/local/lib and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + for x in $LDFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LDFLAGS. + LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" + fi + fi + fi + fi + fi +]) + +dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, +dnl acl_final_exec_prefix, containing the values to which $prefix and +dnl $exec_prefix will expand at the end of the configure script. +AC_DEFUN([AC_LIB_PREPARE_PREFIX], +[ + dnl Unfortunately, prefix and exec_prefix get only finally determined + dnl at the end of configure. + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" +]) + +dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the +dnl variables prefix and exec_prefix bound to the values they will have +dnl at the end of the configure script. +AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], +[ + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + $1 + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" +]) +# nls.m4 serial 1 (gettext-0.12) +dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995-2000. +dnl Bruno Haible , 2000-2003. + +AC_DEFUN([AM_NLS], +[ + AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE(nls, + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT($USE_NLS) + AC_SUBST(USE_NLS) +]) + +AC_DEFUN([AM_MKINSTALLDIRS], +[ + dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly + dnl find the mkinstalldirs script in another subdir but $(top_srcdir). + dnl Try to locate it. + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + case "$ac_aux_dir" in + /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; + *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; + esac + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + AC_SUBST(MKINSTALLDIRS) +]) +# po.m4 serial 1 (gettext-0.12) +dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995-2000. +dnl Bruno Haible , 2000-2003. + +dnl Checks for all prerequisites of the po subdirectory. +AC_DEFUN([AM_PO_SUBDIRS], +[ + AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl + AC_REQUIRE([AM_MKINSTALLDIRS])dnl + AC_REQUIRE([AM_NLS])dnl + + dnl Perform the following tests also if --disable-nls has been given, + dnl because they are needed for "make dist" to work. + + dnl Search for GNU msgfmt in the PATH. + dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. + dnl The second test excludes FreeBSD msgfmt. + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + + dnl Search for GNU xgettext 0.12 or newer in the PATH. + dnl The first test excludes Solaris xgettext and early GNU xgettext versions. + dnl The second test excludes FreeBSD xgettext. + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + dnl Remove leftover from FreeBSD xgettext call. + rm -f messages.po + + dnl Search for GNU msgmerge 0.11 or newer in the PATH. + AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, + [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :) + + dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. + dnl Test whether we really found GNU msgfmt. + if test "$GMSGFMT" != ":"; then + dnl If it is no GNU msgfmt we define it as : so that the + dnl Makefiles still can work. + if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && + (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` + AC_MSG_RESULT( + [found $GMSGFMT program is not GNU msgfmt; ignore it]) + GMSGFMT=":" + fi + fi + + dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is no GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + AC_MSG_RESULT( + [found xgettext program is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + dnl Remove leftover from FreeBSD xgettext call. + rm -f messages.po + fi + + AC_OUTPUT_COMMANDS([ + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + GMOFILES= + UPDATEPOFILES= + DUMMYPOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done], + [# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it + # from automake. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + ]) +]) +# progtest.m4 serial 3 (gettext-0.12) +dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1996. + +# Search path for a program which passes the given test. + +dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN([AM_PATH_PROG_WITH_TEST], +[ +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + [[\\/]]* | ?:[[\\/]]*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in ifelse([$5], , $PATH, [$5]); do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) +# stdint_h.m4 serial 3 (gettext-0.12) +dnl Copyright (C) 1997-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Paul Eggert. + +# Define HAVE_STDINT_H_WITH_UINTMAX if exists, +# doesn't clash with , and declares uintmax_t. + +AC_DEFUN([jm_AC_HEADER_STDINT_H], +[ + AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h, + [AC_TRY_COMPILE( + [#include +#include ], + [uintmax_t i = (uintmax_t) -1;], + jm_ac_cv_header_stdint_h=yes, + jm_ac_cv_header_stdint_h=no)]) + if test $jm_ac_cv_header_stdint_h = yes; then + AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, + [Define if exists, doesn't clash with , + and declares uintmax_t. ]) + fi +]) +# uintmax_t.m4 serial 7 (gettext-0.12) +dnl Copyright (C) 1997-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Paul Eggert. + +AC_PREREQ(2.13) + +# Define uintmax_t to 'unsigned long' or 'unsigned long long' +# if it is not already defined in or . + +AC_DEFUN([jm_AC_TYPE_UINTMAX_T], +[ + AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) + AC_REQUIRE([jm_AC_HEADER_STDINT_H]) + if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then + AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) + test $ac_cv_type_unsigned_long_long = yes \ + && ac_type='unsigned long long' \ + || ac_type='unsigned long' + AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, + [Define to unsigned long or unsigned long long + if and don't define.]) + else + AC_DEFINE(HAVE_UINTMAX_T, 1, + [Define if you have the 'uintmax_t' type in or .]) + fi +]) +# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40) +dnl Copyright (C) 1999-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Paul Eggert. + +AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG], +[ + AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, + [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;], + [unsigned long long ullmax = (unsigned long long) -1; + return ull << i | ull >> i | ullmax / ull | ullmax % ull;], + ac_cv_type_unsigned_long_long=yes, + ac_cv_type_unsigned_long_long=no)]) + if test $ac_cv_type_unsigned_long_long = yes; then + AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, + [Define if you have the unsigned long long type.]) + fi +]) + +dnl From gnulib +AC_DEFUN([BASH_FUNC_FPURGE], +[ + AC_CHECK_FUNCS_ONCE([fpurge]) + AC_CHECK_FUNCS_ONCE([__fpurge]) + AC_CHECK_DECLS([fpurge], , , [#include ]) +]) + +AC_DEFUN([BASH_FUNC_SNPRINTF], +[ + AC_CHECK_FUNCS_ONCE([snprintf]) + if test X$ac_cv_func_snprintf = Xyes; then + AC_CACHE_CHECK([for standard-conformant snprintf], [bash_cv_func_snprintf], + [AC_TRY_RUN([ +#include + +main() +{ + int n; + n = snprintf (0, 0, "%s", "0123456"); + exit(n != 7); +} +], bash_cv_func_snprintf=yes, bash_cv_func_snprintf=no, + [AC_MSG_WARN([cannot check standard snprintf if cross-compiling]) + bash_cv_func_snprintf=yes] +)]) + if test $bash_cv_func_snprintf = no; then + ac_cv_func_snprintf=no + fi + fi + if test $ac_cv_func_snprintf = no; then + AC_DEFINE(HAVE_SNPRINTF, 0, + [Define if you have a standard-conformant snprintf function.]) + fi +]) + +AC_DEFUN([BASH_FUNC_VSNPRINTF], +[ + AC_CHECK_FUNCS_ONCE([vsnprintf]) + if test X$ac_cv_func_vsnprintf = Xyes; then + AC_CACHE_CHECK([for standard-conformant vsnprintf], [bash_cv_func_vsnprintf], + [AC_TRY_RUN([ +#if HAVE_STDARG_H +#include +#else +#include +#endif +#include +#include + +static int +#if HAVE_STDARG_H +foo(const char *fmt, ...) +#else +foo(format, va_alist) + const char *format; + va_dcl +#endif +{ + va_list args; + int n; + +#if HAVE_STDARG_H + va_start(args, fmt); +#else + va_start(args); +#endif + n = vsnprintf(0, 0, fmt, args); + va_end (args); + return n; +} + +main() +{ + int n; + n = foo("%s", "0123456"); + exit(n != 7); +} +], bash_cv_func_vsnprintf=yes, bash_cv_func_vsnprintf=no, + [AC_MSG_WARN([cannot check standard vsnprintf if cross-compiling]) + bash_cv_func_vsnprintf=yes] +)]) + if test $bash_cv_func_vsnprintf = no; then + ac_cv_func_vsnprintf=no + fi + fi + if test $ac_cv_func_vsnprintf = no; then + AC_DEFINE(HAVE_VSNPRINTF, 0, + [Define if you have a standard-conformant vsnprintf function.]) + fi +]) + +AC_DEFUN(BASH_STRUCT_WEXITSTATUS_OFFSET, +[AC_MSG_CHECKING(for offset of exit status in return status from wait) +AC_CACHE_VAL(bash_cv_wexitstatus_offset, +[AC_TRY_RUN([ +#include +#include + +#include + +main(c, v) + int c; + char **v; +{ + pid_t pid, p; + int s, i, n; + + s = 0; + pid = fork(); + if (pid == 0) + exit (42); + + /* wait for the process */ + p = wait(&s); + if (p != pid) + exit (255); + + /* crack s */ + for (i = 0; i < (sizeof(s) - 8); i++) + { + n = (s >> i) & 0xff; + if (n == 42) + exit (i); + } + + exit (254); +} +], bash_cv_wexitstatus_offset=0, bash_cv_wexitstatus_offset=$?, + [AC_MSG_WARN(cannot check WEXITSTATUS offset if cross compiling -- defaulting to 0) + bash_cv_wexitstatus_offset=0] +)]) +if test "$bash_cv_wexitstatus_offset" -gt 32 ; then + AC_MSG_WARN(bad exit status from test program -- defaulting to 0) + bash_cv_wexitstatus_offset=0 +fi +AC_MSG_RESULT($bash_cv_wexitstatus_offset) +AC_DEFINE_UNQUOTED([WEXITSTATUS_OFFSET], [$bash_cv_wexitstatus_offset], [Offset of exit status in wait status word]) +]) diff --git a/alias.c b/alias.c new file mode 100644 index 0000000..7839229 --- /dev/null +++ b/alias.c @@ -0,0 +1,580 @@ +/* alias.c -- Not a full alias, but just the kind that we use in the + shell. Csh style alias is somewhere else (`over there, in a box'). */ + +/* Copyright (C) 1987-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#if defined (ALIAS) + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include +#include "chartypes.h" +#include "bashansi.h" +#include "command.h" +#include "general.h" +#include "externs.h" +#include "alias.h" + +#if defined (PROGRAMMABLE_COMPLETION) +# include "pcomplete.h" +#endif + +#define ALIAS_HASH_BUCKETS 16 /* must be power of two */ + +typedef int sh_alias_map_func_t __P((alias_t *)); + +static void free_alias_data __P((PTR_T)); +static alias_t **map_over_aliases __P((sh_alias_map_func_t *)); +static void sort_aliases __P((alias_t **)); +static int qsort_alias_compare __P((alias_t **, alias_t **)); + +#if defined (READLINE) +static int skipquotes __P((char *, int)); +static int skipws __P((char *, int)); +static int rd_token __P((char *, int)); +#endif + +/* Non-zero means expand all words on the line. Otherwise, expand + after first expansion if the expansion ends in a space. */ +int alias_expand_all = 0; + +/* The list of aliases that we have. */ +HASH_TABLE *aliases = (HASH_TABLE *)NULL; + +void +initialize_aliases () +{ + if (aliases == 0) + aliases = hash_create (ALIAS_HASH_BUCKETS); +} + +/* Scan the list of aliases looking for one with NAME. Return NULL + if the alias doesn't exist, else a pointer to the alias_t. */ +alias_t * +find_alias (name) + char *name; +{ + BUCKET_CONTENTS *al; + + if (aliases == 0) + return ((alias_t *)NULL); + + al = hash_search (name, aliases, 0); + return (al ? (alias_t *)al->data : (alias_t *)NULL); +} + +/* Return the value of the alias for NAME, or NULL if there is none. */ +char * +get_alias_value (name) + char *name; +{ + alias_t *alias; + + if (aliases == 0) + return ((char *)NULL); + + alias = find_alias (name); + return (alias ? alias->value : (char *)NULL); +} + +/* Make a new alias from NAME and VALUE. If NAME can be found, + then replace its value. */ +void +add_alias (name, value) + char *name, *value; +{ + BUCKET_CONTENTS *elt; + alias_t *temp; + int n; + + if (aliases == 0) + { + initialize_aliases (); + temp = (alias_t *)NULL; + } + else + temp = find_alias (name); + + if (temp) + { + free (temp->value); + temp->value = savestring (value); + temp->flags &= ~AL_EXPANDNEXT; + n = value[strlen (value) - 1]; + if (n == ' ' || n == '\t') + temp->flags |= AL_EXPANDNEXT; + } + else + { + temp = (alias_t *)xmalloc (sizeof (alias_t)); + temp->name = savestring (name); + temp->value = savestring (value); + temp->flags = 0; + + n = value[strlen (value) - 1]; + if (n == ' ' || n == '\t') + temp->flags |= AL_EXPANDNEXT; + + elt = hash_insert (savestring (name), aliases, HASH_NOSRCH); + elt->data = temp; +#if defined (PROGRAMMABLE_COMPLETION) + set_itemlist_dirty (&it_aliases); +#endif + } +} + +/* Delete a single alias structure. */ +static void +free_alias_data (data) + PTR_T data; +{ + register alias_t *a; + + a = (alias_t *)data; + free (a->value); + free (a->name); + free (data); +} + +/* Remove the alias with name NAME from the alias table. Returns + the number of aliases left in the table, or -1 if the alias didn't + exist. */ +int +remove_alias (name) + char *name; +{ + BUCKET_CONTENTS *elt; + + if (aliases == 0) + return (-1); + + elt = hash_remove (name, aliases, 0); + if (elt) + { + free_alias_data (elt->data); + free (elt->key); /* alias name */ + free (elt); /* XXX */ +#if defined (PROGRAMMABLE_COMPLETION) + set_itemlist_dirty (&it_aliases); +#endif + return (aliases->nentries); + } + return (-1); +} + +/* Delete all aliases. */ +void +delete_all_aliases () +{ + if (aliases == 0) + return; + + hash_flush (aliases, free_alias_data); + hash_dispose (aliases); + aliases = (HASH_TABLE *)NULL; +#if defined (PROGRAMMABLE_COMPLETION) + set_itemlist_dirty (&it_aliases); +#endif +} + +/* Return an array of aliases that satisfy the conditions tested by FUNCTION. + If FUNCTION is NULL, return all aliases. */ +static alias_t ** +map_over_aliases (function) + sh_alias_map_func_t *function; +{ + register int i; + register BUCKET_CONTENTS *tlist; + alias_t *alias, **list; + int list_index; + + i = HASH_ENTRIES (aliases); + if (i == 0) + return ((alias_t **)NULL); + + list = (alias_t **)xmalloc ((i + 1) * sizeof (alias_t *)); + for (i = list_index = 0; i < aliases->nbuckets; i++) + { + for (tlist = hash_items (i, aliases); tlist; tlist = tlist->next) + { + alias = (alias_t *)tlist->data; + + if (!function || (*function) (alias)) + { + list[list_index++] = alias; + list[list_index] = (alias_t *)NULL; + } + } + } + return (list); +} + +static void +sort_aliases (array) + alias_t **array; +{ + qsort (array, strvec_len ((char **)array), sizeof (alias_t *), (QSFUNC *)qsort_alias_compare); +} + +static int +qsort_alias_compare (as1, as2) + alias_t **as1, **as2; +{ + int result; + + if ((result = (*as1)->name[0] - (*as2)->name[0]) == 0) + result = strcmp ((*as1)->name, (*as2)->name); + + return (result); +} + +/* Return a sorted list of all defined aliases */ +alias_t ** +all_aliases () +{ + alias_t **list; + + if (aliases == 0 || HASH_ENTRIES (aliases) == 0) + return ((alias_t **)NULL); + + list = map_over_aliases ((sh_alias_map_func_t *)NULL); + if (list) + sort_aliases (list); + return (list); +} + +char * +alias_expand_word (s) + char *s; +{ + alias_t *r; + + r = find_alias (s); + return (r ? savestring (r->value) : (char *)NULL); +} + +/* Readline support functions -- expand all aliases in a line. */ + +#if defined (READLINE) + +/* Return non-zero if CHARACTER is a member of the class of characters + that are self-delimiting in the shell (this really means that these + characters delimit tokens). */ +#define self_delimiting(character) (member ((character), " \t\n\r;|&()")) + +/* Return non-zero if CHARACTER is a member of the class of characters + that delimit commands in the shell. */ +#define command_separator(character) (member ((character), "\r\n;|&(")) + +/* If this is 1, we are checking the next token read for alias expansion + because it is the first word in a command. */ +static int command_word; + +/* This is for skipping quoted strings in alias expansions. */ +#define quote_char(c) (((c) == '\'') || ((c) == '"')) + +/* Consume a quoted string from STRING, starting at string[START] (so + string[START] is the opening quote character), and return the index + of the closing quote character matching the opening quote character. + This handles single matching pairs of unquoted quotes; it could afford + to be a little smarter... This skips words between balanced pairs of + quotes, words where the first character is quoted with a `\', and other + backslash-escaped characters. */ + +static int +skipquotes (string, start) + char *string; + int start; +{ + register int i; + int delimiter = string[start]; + + /* i starts at START + 1 because string[START] is the opening quote + character. */ + for (i = start + 1 ; string[i] ; i++) + { + if (string[i] == '\\') + { + i++; /* skip backslash-quoted quote characters, too */ + if (string[i] == 0) + break; + continue; + } + + if (string[i] == delimiter) + return i; + } + return (i); +} + +/* Skip the white space and any quoted characters in STRING, starting at + START. Return the new index into STRING, after zero or more characters + have been skipped. */ +static int +skipws (string, start) + char *string; + int start; +{ + register int i; + int pass_next, backslash_quoted_word; + unsigned char peekc; + + /* skip quoted strings, in ' or ", and words in which a character is quoted + with a `\'. */ + i = backslash_quoted_word = pass_next = 0; + + /* Skip leading whitespace (or separator characters), and quoted words. + But save it in the output. */ + + for (i = start; string[i]; i++) + { + if (pass_next) + { + pass_next = 0; + continue; + } + + if (whitespace (string[i])) + { + backslash_quoted_word = 0; /* we are no longer in a backslash-quoted word */ + continue; + } + + if (string[i] == '\\') + { + peekc = string[i+1]; + if (peekc == 0) + break; + if (ISLETTER (peekc)) + backslash_quoted_word++; /* this is a backslash-quoted word */ + else + pass_next++; + continue; + } + + /* This only handles single pairs of non-escaped quotes. This + overloads backslash_quoted_word to also mean that a word like + ""f is being scanned, so that the quotes will inhibit any expansion + of the word. */ + if (quote_char(string[i])) + { + i = skipquotes (string, i); + /* This could be a line that contains a single quote character, + in which case skipquotes () terminates with string[i] == '\0' + (the end of the string). Check for that here. */ + if (string[i] == '\0') + break; + + peekc = string[i + 1]; + if (ISLETTER (peekc)) + backslash_quoted_word++; + continue; + } + + /* If we're in the middle of some kind of quoted word, let it + pass through. */ + if (backslash_quoted_word) + continue; + + /* If this character is a shell command separator, then set a hint for + alias_expand that the next token is the first word in a command. */ + + if (command_separator (string[i])) + { + command_word++; + continue; + } + break; + } + return (i); +} + +/* Characters that may appear in a token. Basically, anything except white + space and a token separator. */ +#define token_char(c) (!((whitespace (string[i]) || self_delimiting (string[i])))) + +/* Read from START in STRING until the next separator character, and return + the index of that separator. Skip backslash-quoted characters. Call + skipquotes () for quoted strings in the middle or at the end of tokens, + so all characters show up (e.g. foo'' and foo""bar) */ +static int +rd_token (string, start) + char *string; + int start; +{ + register int i; + + /* From here to next separator character is a token. */ + for (i = start; string[i] && token_char (string[i]); i++) + { + if (string[i] == '\\') + { + i++; /* skip backslash-escaped character */ + if (string[i] == 0) + break; + continue; + } + + /* If this character is a quote character, we want to call skipquotes + to get the whole quoted portion as part of this word. That word + will not generally match an alias, even if te unquoted word would + have. The presence of the quotes in the token serves then to + inhibit expansion. */ + if (quote_char (string[i])) + { + i = skipquotes (string, i); + /* This could be a line that contains a single quote character, + in which case skipquotes () terminates with string[i] == '\0' + (the end of the string). Check for that here. */ + if (string[i] == '\0') + break; + + /* Now string[i] is the matching quote character, and the + quoted portion of the token has been scanned. */ + continue; + } + } + return (i); +} + +/* Return a new line, with any aliases substituted. */ +char * +alias_expand (string) + char *string; +{ + register int i, j, start; + char *line, *token; + int line_len, tl, real_start, expand_next, expand_this_token; + alias_t *alias; + + line_len = strlen (string) + 1; + line = (char *)xmalloc (line_len); + token = (char *)xmalloc (line_len); + + line[0] = i = 0; + expand_next = 0; + command_word = 1; /* initialized to expand the first word on the line */ + + /* Each time through the loop we find the next word in line. If it + has an alias, substitute the alias value. If the value ends in ` ', + then try again with the next word. Else, if there is no value, or if + the value does not end in space, we are done. */ + + for (;;) + { + + token[0] = 0; + start = i; + + /* Skip white space and quoted characters */ + i = skipws (string, start); + + if (start == i && string[i] == '\0') + { + free (token); + return (line); + } + + /* copy the just-skipped characters into the output string, + expanding it if there is not enough room. */ + j = strlen (line); + tl = i - start; /* number of characters just skipped */ + RESIZE_MALLOCED_BUFFER (line, j, (tl + 1), line_len, (tl + 50)); + strncpy (line + j, string + start, tl); + line[j + tl] = '\0'; + + real_start = i; + + command_word = command_word || (command_separator (string[i])); + expand_this_token = (command_word || expand_next); + expand_next = 0; + + /* Read the next token, and copy it into TOKEN. */ + start = i; + i = rd_token (string, start); + + tl = i - start; /* token length */ + + /* If tl == 0, but we're not at the end of the string, then we have a + single-character token, probably a delimiter */ + if (tl == 0 && string[i] != '\0') + { + tl = 1; + i++; /* move past it */ + } + + strncpy (token, string + start, tl); + token [tl] = '\0'; + + /* If there is a backslash-escaped character quoted in TOKEN, + then we don't do alias expansion. This should check for all + other quoting characters, too. */ + if (mbschr (token, '\\')) + expand_this_token = 0; + + /* If we should be expanding here, if we are expanding all words, or if + we are in a location in the string where an expansion is supposed to + take place, see if this word has a substitution. If it does, then do + the expansion. Note that we defer the alias value lookup until we + are sure we are expanding this token. */ + + if ((token[0]) && + (expand_this_token || alias_expand_all) && + (alias = find_alias (token))) + { + char *v; + int vlen, llen; + + v = alias->value; + vlen = strlen (v); + llen = strlen (line); + + /* +3 because we possibly add one more character below. */ + RESIZE_MALLOCED_BUFFER (line, llen, (vlen + 3), line_len, (vlen + 50)); + + strcpy (line + llen, v); + + if ((expand_this_token && vlen && whitespace (v[vlen - 1])) || + alias_expand_all) + expand_next = 1; + } + else + { + int llen, tlen; + + llen = strlen (line); + tlen = i - real_start; /* tlen == strlen(token) */ + + RESIZE_MALLOCED_BUFFER (line, llen, (tlen + 1), line_len, (llen + tlen + 50)); + + strncpy (line + llen, string + real_start, tlen); + line[llen + tlen] = '\0'; + } + command_word = 0; + } +} +#endif /* READLINE */ +#endif /* ALIAS */ diff --git a/alias.h b/alias.h new file mode 100644 index 0000000..4d0075f --- /dev/null +++ b/alias.h @@ -0,0 +1,70 @@ +/* alias.h -- structure definitions. */ + +/* Copyright (C) 1987-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_ALIAS_H_) +#define _ALIAS_H_ + +#include "stdc.h" + +#include "hashlib.h" + +typedef struct alias { + char *name; + char *value; + char flags; +} alias_t; + +/* Values for `flags' member of struct alias. */ +#define AL_EXPANDNEXT 0x1 +#define AL_BEINGEXPANDED 0x2 + +/* The list of known aliases. */ +extern HASH_TABLE *aliases; + +extern void initialize_aliases __P((void)); + +/* Scan the list of aliases looking for one with NAME. Return NULL + if the alias doesn't exist, else a pointer to the alias. */ +extern alias_t *find_alias __P((char *)); + +/* Return the value of the alias for NAME, or NULL if there is none. */ +extern char *get_alias_value __P((char *)); + +/* Make a new alias from NAME and VALUE. If NAME can be found, + then replace its value. */ +extern void add_alias __P((char *, char *)); + +/* Remove the alias with name NAME from the alias list. Returns + the index of the removed alias, or -1 if the alias didn't exist. */ +extern int remove_alias __P((char *)); + +/* Remove all aliases. */ +extern void delete_all_aliases __P((void)); + +/* Return an array of all defined aliases. */ +extern alias_t **all_aliases __P((void)); + +/* Expand a single word for aliases. */ +extern char *alias_expand_word __P((char *)); + +/* Return a new line, with any aliases expanded. */ +extern char *alias_expand __P((char *)); + +#endif /* _ALIAS_H_ */ diff --git a/array.c b/array.c new file mode 100644 index 0000000..4359a52 --- /dev/null +++ b/array.c @@ -0,0 +1,1148 @@ +/* + * array.c - functions to create, destroy, access, and manipulate arrays + * of strings. + * + * Arrays are sparse doubly-linked lists. An element's index is stored + * with it. + * + * Chet Ramey + * chet@ins.cwru.edu + */ + +/* Copyright (C) 1997-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#if defined (ARRAY_VARS) + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include +#include "bashansi.h" + +#include "shell.h" +#include "array.h" +#include "builtins/common.h" + +#define ADD_BEFORE(ae, new) \ + do { \ + ae->prev->next = new; \ + new->prev = ae->prev; \ + ae->prev = new; \ + new->next = ae; \ + } while(0) + +static char *array_to_string_internal __P((ARRAY_ELEMENT *, ARRAY_ELEMENT *, char *, int)); + +static ARRAY *lastarray = 0; +static ARRAY_ELEMENT *lastref = 0; + +#define IS_LASTREF(a) (lastarray && (a) == lastarray) + +#define LASTREF_START(a, i) \ + (IS_LASTREF(a) && i >= element_index(lastref)) ? lastref \ + : element_forw(a->head) + +#define INVALIDATE_LASTREF(a) \ +do { \ + if ((a) == lastarray) { \ + lastarray = 0; \ + lastref = 0; \ + } \ +} while (0) + +#define SET_LASTREF(a, e) \ +do { \ + lastarray = (a); \ + lastref = (e); \ +} while (0) + +#define UNSET_LASTREF() \ +do { \ + lastarray = 0; \ + lastref = 0; \ +} while (0) + +ARRAY * +array_create() +{ + ARRAY *r; + ARRAY_ELEMENT *head; + + r =(ARRAY *)xmalloc(sizeof(ARRAY)); + r->type = array_indexed; + r->max_index = -1; + r->num_elements = 0; + head = array_create_element(-1, (char *)NULL); /* dummy head */ + head->prev = head->next = head; + r->head = head; + return(r); +} + +void +array_flush (a) +ARRAY *a; +{ + register ARRAY_ELEMENT *r, *r1; + + if (a == 0) + return; + for (r = element_forw(a->head); r != a->head; ) { + r1 = element_forw(r); + array_dispose_element(r); + r = r1; + } + a->head->next = a->head->prev = a->head; + a->max_index = -1; + a->num_elements = 0; + INVALIDATE_LASTREF(a); +} + +void +array_dispose(a) +ARRAY *a; +{ + if (a == 0) + return; + array_flush (a); + array_dispose_element(a->head); + free(a); +} + +ARRAY * +array_copy(a) +ARRAY *a; +{ + ARRAY *a1; + ARRAY_ELEMENT *ae, *new; + + if (a == 0) + return((ARRAY *) NULL); + a1 = array_create(); + a1->type = a->type; + a1->max_index = a->max_index; + a1->num_elements = a->num_elements; + for (ae = element_forw(a->head); ae != a->head; ae = element_forw(ae)) { + new = array_create_element(element_index(ae), element_value(ae)); + ADD_BEFORE(a1->head, new); + } + return(a1); +} + +/* + * Make and return a new array composed of the elements in array A from + * S to E, inclusive. + */ +ARRAY * +array_slice(array, s, e) +ARRAY *array; +ARRAY_ELEMENT *s, *e; +{ + ARRAY *a; + ARRAY_ELEMENT *p, *n; + int i; + arrayind_t mi; + + a = array_create (); + a->type = array->type; + + for (mi = 0, p = s, i = 0; p != e; p = element_forw(p), i++) { + n = array_create_element (element_index(p), element_value(p)); + ADD_BEFORE(a->head, n); + mi = element_index(n); + } + a->num_elements = i; + a->max_index = mi; + return a; +} + +/* + * Walk the array, calling FUNC once for each element, with the array + * element as the argument. + */ +void +array_walk(a, func, udata) +ARRAY *a; +sh_ae_map_func_t *func; +void *udata; +{ + register ARRAY_ELEMENT *ae; + + if (a == 0 || array_empty(a)) + return; + for (ae = element_forw(a->head); ae != a->head; ae = element_forw(ae)) + if ((*func)(ae, udata) < 0) + return; +} + +/* + * Shift the array A N elements to the left. Delete the first N elements + * and subtract N from the indices of the remaining elements. If FLAGS + * does not include AS_DISPOSE, this returns a singly-linked null-terminated + * list of elements so the caller can dispose of the chain. If FLAGS + * includes AS_DISPOSE, this function disposes of the shifted-out elements + * and returns NULL. + */ +ARRAY_ELEMENT * +array_shift(a, n, flags) +ARRAY *a; +int n, flags; +{ + register ARRAY_ELEMENT *ae, *ret; + register int i; + + if (a == 0 || array_empty(a) || n <= 0) + return ((ARRAY_ELEMENT *)NULL); + + INVALIDATE_LASTREF(a); + for (i = 0, ret = ae = element_forw(a->head); ae != a->head && i < n; ae = element_forw(ae), i++) + ; + if (ae == a->head) { + /* Easy case; shifting out all of the elements */ + if (flags & AS_DISPOSE) { + array_flush (a); + return ((ARRAY_ELEMENT *)NULL); + } + for (ae = ret; element_forw(ae) != a->head; ae = element_forw(ae)) + ; + element_forw(ae) = (ARRAY_ELEMENT *)NULL; + a->head->next = a->head->prev = a->head; + a->max_index = -1; + a->num_elements = 0; + return ret; + } + /* + * ae now points to the list of elements we want to retain. + * ret points to the list we want to either destroy or return. + */ + ae->prev->next = (ARRAY_ELEMENT *)NULL; /* null-terminate RET */ + + a->head->next = ae; /* slice RET out of the array */ + ae->prev = a->head; + + for ( ; ae != a->head; ae = element_forw(ae)) + element_index(ae) -= n; /* renumber retained indices */ + + a->num_elements -= n; /* modify bookkeeping information */ + a->max_index = element_index(a->head->prev); + + if (flags & AS_DISPOSE) { + for (ae = ret; ae; ) { + ret = element_forw(ae); + array_dispose_element(ae); + ae = ret; + } + return ((ARRAY_ELEMENT *)NULL); + } + + return ret; +} + +/* + * Shift array A right N indices. If S is non-null, it becomes the value of + * the new element 0. Returns the number of elements in the array after the + * shift. + */ +int +array_rshift (a, n, s) +ARRAY *a; +int n; +char *s; +{ + register ARRAY_ELEMENT *ae, *new; + + if (a == 0 || (array_empty(a) && s == 0)) + return 0; + else if (n <= 0) + return (a->num_elements); + + ae = element_forw(a->head); + if (s) { + new = array_create_element(0, s); + ADD_BEFORE(ae, new); + a->num_elements++; + if (array_num_elements(a) == 1) { /* array was empty */ + a->max_index = 0; + return 1; + } + } + + /* + * Renumber all elements in the array except the one we just added. + */ + for ( ; ae != a->head; ae = element_forw(ae)) + element_index(ae) += n; + + a->max_index = element_index(a->head->prev); + + INVALIDATE_LASTREF(a); + return (a->num_elements); +} + +ARRAY_ELEMENT * +array_unshift_element(a) +ARRAY *a; +{ + return (array_shift (a, 1, 0)); +} + +int +array_shift_element(a, v) +ARRAY *a; +char *v; +{ + return (array_rshift (a, 1, v)); +} + +ARRAY * +array_quote(array) +ARRAY *array; +{ + ARRAY_ELEMENT *a; + char *t; + + if (array == 0 || array_head(array) == 0 || array_empty(array)) + return (ARRAY *)NULL; + for (a = element_forw(array->head); a != array->head; a = element_forw(a)) { + t = quote_string (a->value); + FREE(a->value); + a->value = t; + } + return array; +} + +ARRAY * +array_quote_escapes(array) +ARRAY *array; +{ + ARRAY_ELEMENT *a; + char *t; + + if (array == 0 || array_head(array) == 0 || array_empty(array)) + return (ARRAY *)NULL; + for (a = element_forw(array->head); a != array->head; a = element_forw(a)) { + t = quote_escapes (a->value); + FREE(a->value); + a->value = t; + } + return array; +} + +ARRAY * +array_dequote(array) +ARRAY *array; +{ + ARRAY_ELEMENT *a; + char *t; + + if (array == 0 || array_head(array) == 0 || array_empty(array)) + return (ARRAY *)NULL; + for (a = element_forw(array->head); a != array->head; a = element_forw(a)) { + t = dequote_string (a->value); + FREE(a->value); + a->value = t; + } + return array; +} + +ARRAY * +array_dequote_escapes(array) +ARRAY *array; +{ + ARRAY_ELEMENT *a; + char *t; + + if (array == 0 || array_head(array) == 0 || array_empty(array)) + return (ARRAY *)NULL; + for (a = element_forw(array->head); a != array->head; a = element_forw(a)) { + t = dequote_escapes (a->value); + FREE(a->value); + a->value = t; + } + return array; +} + +ARRAY * +array_remove_quoted_nulls(array) +ARRAY *array; +{ + ARRAY_ELEMENT *a; + char *t; + + if (array == 0 || array_head(array) == 0 || array_empty(array)) + return (ARRAY *)NULL; + for (a = element_forw(array->head); a != array->head; a = element_forw(a)) + a->value = remove_quoted_nulls (a->value); + return array; +} + +/* + * Return a string whose elements are the members of array A beginning at + * index START and spanning NELEM members. Null elements are counted. + * Since arrays are sparse, unset array elements are not counted. + */ +char * +array_subrange (a, start, nelem, starsub, quoted) +ARRAY *a; +arrayind_t start, nelem; +int starsub, quoted; +{ + ARRAY *a2; + ARRAY_ELEMENT *h, *p; + arrayind_t i; + char *ifs, *sifs, *t; + int slen; + + p = a ? array_head (a) : 0; + if (p == 0 || array_empty (a) || start > array_max_index(a)) + return ((char *)NULL); + + /* + * Find element with index START. If START corresponds to an unset + * element (arrays can be sparse), use the first element whose index + * is >= START. If START is < 0, we count START indices back from + * the end of A (not elements, even with sparse arrays -- START is an + * index). + */ + for (p = element_forw(p); p != array_head(a) && start > element_index(p); p = element_forw(p)) + ; + + if (p == a->head) + return ((char *)NULL); + + /* Starting at P, take NELEM elements, inclusive. */ + for (i = 0, h = p; p != a->head && i < nelem; i++, p = element_forw(p)) + ; + + a2 = array_slice(a, h, p); + + if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) + array_quote(a2); + else + array_quote_escapes(a2); + + if (starsub && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) { + /* ${array[*]} */ + array_remove_quoted_nulls (a2); + sifs = ifs_firstchar ((int *)NULL); + t = array_to_string (a2, sifs, 0); + free (sifs); + } else if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) { + /* ${array[@]} */ + sifs = ifs_firstchar (&slen); + ifs = getifs (); + if (ifs == 0 || *ifs == 0) { + if (slen < 2) + sifs = xrealloc(sifs, 2); + sifs[0] = ' '; + sifs[1] = '\0'; + } + t = array_to_string (a2, sifs, 0); + free (sifs); + } else + t = array_to_string (a2, " ", 0); + array_dispose(a2); + + return t; +} + +char * +array_patsub (a, pat, rep, mflags) +ARRAY *a; +char *pat, *rep; +int mflags; +{ + ARRAY *a2; + ARRAY_ELEMENT *e; + char *t, *sifs, *ifs; + int slen; + + if (a == 0 || array_head(a) == 0 || array_empty(a)) + return ((char *)NULL); + + a2 = array_copy(a); + for (e = element_forw(a2->head); e != a2->head; e = element_forw(e)) { + t = pat_subst(element_value(e), pat, rep, mflags); + FREE(element_value(e)); + e->value = t; + } + + if (mflags & MATCH_QUOTED) + array_quote(a2); + else + array_quote_escapes(a2); + + if (mflags & MATCH_STARSUB) { + array_remove_quoted_nulls (a2); + sifs = ifs_firstchar((int *)NULL); + t = array_to_string (a2, sifs, 0); + free(sifs); + } else if (mflags & MATCH_QUOTED) { + /* ${array[@]} */ + sifs = ifs_firstchar (&slen); + ifs = getifs (); + if (ifs == 0 || *ifs == 0) { + if (slen < 2) + sifs = xrealloc (sifs, 2); + sifs[0] = ' '; + sifs[1] = '\0'; + } + t = array_to_string (a2, sifs, 0); + free(sifs); + } else + t = array_to_string (a2, " ", 0); + array_dispose (a2); + + return t; +} + +char * +array_modcase (a, pat, modop, mflags) +ARRAY *a; +char *pat; +int modop; +int mflags; +{ + ARRAY *a2; + ARRAY_ELEMENT *e; + char *t, *sifs, *ifs; + int slen; + + if (a == 0 || array_head(a) == 0 || array_empty(a)) + return ((char *)NULL); + + a2 = array_copy(a); + for (e = element_forw(a2->head); e != a2->head; e = element_forw(e)) { + t = sh_modcase(element_value(e), pat, modop); + FREE(element_value(e)); + e->value = t; + } + + if (mflags & MATCH_QUOTED) + array_quote(a2); + else + array_quote_escapes(a2); + + if (mflags & MATCH_STARSUB) { + array_remove_quoted_nulls (a2); + sifs = ifs_firstchar((int *)NULL); + t = array_to_string (a2, sifs, 0); + free(sifs); + } else if (mflags & MATCH_QUOTED) { + /* ${array[@]} */ + sifs = ifs_firstchar (&slen); + ifs = getifs (); + if (ifs == 0 || *ifs == 0) { + if (slen < 2) + sifs = xrealloc (sifs, 2); + sifs[0] = ' '; + sifs[1] = '\0'; + } + t = array_to_string (a2, sifs, 0); + free(sifs); + } else + t = array_to_string (a2, " ", 0); + array_dispose (a2); + + return t; +} +/* + * Allocate and return a new array element with index INDEX and value + * VALUE. + */ +ARRAY_ELEMENT * +array_create_element(indx, value) +arrayind_t indx; +char *value; +{ + ARRAY_ELEMENT *r; + + r = (ARRAY_ELEMENT *)xmalloc(sizeof(ARRAY_ELEMENT)); + r->ind = indx; + r->value = value ? savestring(value) : (char *)NULL; + r->next = r->prev = (ARRAY_ELEMENT *) NULL; + return(r); +} + +#ifdef INCLUDE_UNUSED +ARRAY_ELEMENT * +array_copy_element(ae) +ARRAY_ELEMENT *ae; +{ + return(ae ? array_create_element(element_index(ae), element_value(ae)) + : (ARRAY_ELEMENT *) NULL); +} +#endif + +void +array_dispose_element(ae) +ARRAY_ELEMENT *ae; +{ + if (ae) { + FREE(ae->value); + free(ae); + } +} + +/* + * Add a new element with index I and value V to array A (a[i] = v). + */ +int +array_insert(a, i, v) +ARRAY *a; +arrayind_t i; +char *v; +{ + register ARRAY_ELEMENT *new, *ae, *start; + + if (a == 0) + return(-1); + new = array_create_element(i, v); + if (i > array_max_index(a)) { + /* + * Hook onto the end. This also works for an empty array. + * Fast path for the common case of allocating arrays + * sequentially. + */ + ADD_BEFORE(a->head, new); + a->max_index = i; + a->num_elements++; + SET_LASTREF(a, new); + return(0); + } +#if OPTIMIZE_SEQUENTIAL_ARRAY_ASSIGNMENT + /* + * Otherwise we search for the spot to insert it. The lastref + * handle optimizes the case of sequential or almost-sequential + * assignments that are not at the end of the array. + */ + start = LASTREF_START(a, i); +#else + start = element_forw(ae->head); +#endif + for (ae = start; ae != a->head; ae = element_forw(ae)) { + if (element_index(ae) == i) { + /* + * Replacing an existing element. + */ + array_dispose_element(new); + free(element_value(ae)); + ae->value = v ? savestring(v) : (char *)NULL; + SET_LASTREF(a, ae); + return(0); + } else if (element_index(ae) > i) { + ADD_BEFORE(ae, new); + a->num_elements++; + SET_LASTREF(a, new); + return(0); + } + } + array_dispose_element(new); + INVALIDATE_LASTREF(a); + return (-1); /* problem */ +} + +/* + * Delete the element with index I from array A and return it so the + * caller can dispose of it. + */ +ARRAY_ELEMENT * +array_remove(a, i) +ARRAY *a; +arrayind_t i; +{ + register ARRAY_ELEMENT *ae, *start; + + if (a == 0 || array_empty(a)) + return((ARRAY_ELEMENT *) NULL); + start = LASTREF_START(a, i); + for (ae = start; ae != a->head; ae = element_forw(ae)) + if (element_index(ae) == i) { + ae->next->prev = ae->prev; + ae->prev->next = ae->next; + a->num_elements--; + if (i == array_max_index(a)) + a->max_index = element_index(ae->prev); +#if 0 + INVALIDATE_LASTREF(a); +#else + if (ae->next != a->head) + SET_LASTREF(a, ae->next); + else if (ae->prev != a->head) + SET_LASTREF(a, ae->prev); + else + INVALIDATE_LASTREF(a); +#endif + return(ae); + } + return((ARRAY_ELEMENT *) NULL); +} + +/* + * Return the value of a[i]. + */ +char * +array_reference(a, i) +ARRAY *a; +arrayind_t i; +{ + register ARRAY_ELEMENT *ae, *start; + + if (a == 0 || array_empty(a)) + return((char *) NULL); + if (i > array_max_index(a)) + return((char *)NULL); /* Keep roving pointer into array to optimize sequential access */ + start = LASTREF_START(a, i); + for (ae = start; ae != a->head; ae = element_forw(ae)) + if (element_index(ae) == i) { + SET_LASTREF(a, ae); + return(element_value(ae)); + } + UNSET_LASTREF(); + return((char *) NULL); +} + +/* Convenience routines for the shell to translate to and from the form used + by the rest of the code. */ + +WORD_LIST * +array_to_word_list(a) +ARRAY *a; +{ + WORD_LIST *list; + ARRAY_ELEMENT *ae; + + if (a == 0 || array_empty(a)) + return((WORD_LIST *)NULL); + list = (WORD_LIST *)NULL; + for (ae = element_forw(a->head); ae != a->head; ae = element_forw(ae)) + list = make_word_list (make_bare_word(element_value(ae)), list); + return (REVERSE_LIST(list, WORD_LIST *)); +} + +ARRAY * +array_from_word_list (list) +WORD_LIST *list; +{ + ARRAY *a; + + if (list == 0) + return((ARRAY *)NULL); + a = array_create(); + return (array_assign_list (a, list)); +} + +WORD_LIST * +array_keys_to_word_list(a) +ARRAY *a; +{ + WORD_LIST *list; + ARRAY_ELEMENT *ae; + char *t; + + if (a == 0 || array_empty(a)) + return((WORD_LIST *)NULL); + list = (WORD_LIST *)NULL; + for (ae = element_forw(a->head); ae != a->head; ae = element_forw(ae)) { + t = itos(element_index(ae)); + list = make_word_list (make_bare_word(t), list); + free(t); + } + return (REVERSE_LIST(list, WORD_LIST *)); +} + +ARRAY * +array_assign_list (array, list) +ARRAY *array; +WORD_LIST *list; +{ + register WORD_LIST *l; + register arrayind_t i; + + for (l = list, i = 0; l; l = l->next, i++) + array_insert(array, i, l->word->word); + return array; +} + +char ** +array_to_argv (a) +ARRAY *a; +{ + char **ret, *t; + int i; + ARRAY_ELEMENT *ae; + + if (a == 0 || array_empty(a)) + return ((char **)NULL); + ret = strvec_create (array_num_elements (a) + 1); + i = 0; + for (ae = element_forw(a->head); ae != a->head; ae = element_forw(ae)) { + t = element_value (ae); + ret[i++] = t ? savestring (t) : (char *)NULL; + } + ret[i] = (char *)NULL; + return (ret); +} + +/* + * Return a string that is the concatenation of the elements in A from START + * to END, separated by SEP. + */ +static char * +array_to_string_internal (start, end, sep, quoted) +ARRAY_ELEMENT *start, *end; +char *sep; +int quoted; +{ + char *result, *t; + ARRAY_ELEMENT *ae; + int slen, rsize, rlen, reg; + + if (start == end) /* XXX - should not happen */ + return ((char *)NULL); + + slen = strlen(sep); + result = NULL; + for (rsize = rlen = 0, ae = start; ae != end; ae = element_forw(ae)) { + if (rsize == 0) + result = (char *)xmalloc (rsize = 64); + if (element_value(ae)) { + t = quoted ? quote_string(element_value(ae)) : element_value(ae); + reg = strlen(t); + RESIZE_MALLOCED_BUFFER (result, rlen, (reg + slen + 2), + rsize, rsize); + strcpy(result + rlen, t); + rlen += reg; + if (quoted && t) + free(t); + /* + * Add a separator only after non-null elements. + */ + if (element_forw(ae) != end) { + strcpy(result + rlen, sep); + rlen += slen; + } + } + } + if (result) + result[rlen] = '\0'; /* XXX */ + return(result); +} + +char * +array_to_assign (a, quoted) +ARRAY *a; +int quoted; +{ + char *result, *valstr, *is; + char indstr[INT_STRLEN_BOUND(intmax_t) + 1]; + ARRAY_ELEMENT *ae; + int rsize, rlen, elen; + + if (a == 0 || array_empty (a)) + return((char *)NULL); + + result = (char *)xmalloc (rsize = 128); + result[0] = '('; + rlen = 1; + + for (ae = element_forw(a->head); ae != a->head; ae = element_forw(ae)) { + is = inttostr (element_index(ae), indstr, sizeof(indstr)); + valstr = element_value (ae) ? sh_double_quote (element_value(ae)) + : (char *)NULL; + elen = STRLEN (is) + 8 + STRLEN (valstr); + RESIZE_MALLOCED_BUFFER (result, rlen, (elen + 1), rsize, rsize); + + result[rlen++] = '['; + strcpy (result + rlen, is); + rlen += STRLEN (is); + result[rlen++] = ']'; + result[rlen++] = '='; + if (valstr) { + strcpy (result + rlen, valstr); + rlen += STRLEN (valstr); + } + + if (element_forw(ae) != a->head) + result[rlen++] = ' '; + + FREE (valstr); + } + RESIZE_MALLOCED_BUFFER (result, rlen, 1, rsize, 8); + result[rlen++] = ')'; + result[rlen] = '\0'; + if (quoted) { + /* This is not as efficient as it could be... */ + valstr = sh_single_quote (result); + free (result); + result = valstr; + } + return(result); +} + +char * +array_to_string (a, sep, quoted) +ARRAY *a; +char *sep; +int quoted; +{ + if (a == 0) + return((char *)NULL); + if (array_empty(a)) + return(savestring("")); + return (array_to_string_internal (element_forw(a->head), a->head, sep, quoted)); +} + +#if defined (INCLUDE_UNUSED) || defined (TEST_ARRAY) +/* + * Return an array consisting of elements in S, separated by SEP + */ +ARRAY * +array_from_string(s, sep) +char *s, *sep; +{ + ARRAY *a; + WORD_LIST *w; + + if (s == 0) + return((ARRAY *)NULL); + w = list_string (s, sep, 0); + if (w == 0) + return((ARRAY *)NULL); + a = array_from_word_list (w); + return (a); +} +#endif + +#if defined (TEST_ARRAY) +/* + * To make a running version, compile -DTEST_ARRAY and link with: + * xmalloc.o syntax.o lib/malloc/libmalloc.a lib/sh/libsh.a + */ +int interrupt_immediately = 0; + +int +signal_is_trapped(s) +int s; +{ + return 0; +} + +void +fatal_error(const char *s, ...) +{ + fprintf(stderr, "array_test: fatal memory error\n"); + abort(); +} + +void +programming_error(const char *s, ...) +{ + fprintf(stderr, "array_test: fatal programming error\n"); + abort(); +} + +WORD_DESC * +make_bare_word (s) +const char *s; +{ + WORD_DESC *w; + + w = (WORD_DESC *)xmalloc(sizeof(WORD_DESC)); + w->word = s ? savestring(s) : savestring (""); + w->flags = 0; + return w; +} + +WORD_LIST * +make_word_list(x, l) +WORD_DESC *x; +WORD_LIST *l; +{ + WORD_LIST *w; + + w = (WORD_LIST *)xmalloc(sizeof(WORD_LIST)); + w->word = x; + w->next = l; + return w; +} + +WORD_LIST * +list_string(s, t, i) +char *s, *t; +int i; +{ + char *r, *a; + WORD_LIST *wl; + + if (s == 0) + return (WORD_LIST *)NULL; + r = savestring(s); + wl = (WORD_LIST *)NULL; + a = strtok(r, t); + while (a) { + wl = make_word_list (make_bare_word(a), wl); + a = strtok((char *)NULL, t); + } + return (REVERSE_LIST (wl, WORD_LIST *)); +} + +GENERIC_LIST * +list_reverse (list) +GENERIC_LIST *list; +{ + register GENERIC_LIST *next, *prev; + + for (prev = 0; list; ) { + next = list->next; + list->next = prev; + prev = list; + list = next; + } + return prev; +} + +char * +pat_subst(s, t, u, i) +char *s, *t, *u; +int i; +{ + return ((char *)NULL); +} + +char * +quote_string(s) +char *s; +{ + return savestring(s); +} + +print_element(ae) +ARRAY_ELEMENT *ae; +{ + char lbuf[INT_STRLEN_BOUND (intmax_t) + 1]; + + printf("array[%s] = %s\n", + inttostr (element_index(ae), lbuf, sizeof (lbuf)), + element_value(ae)); +} + +print_array(a) +ARRAY *a; +{ + printf("\n"); + array_walk(a, print_element, (void *)NULL); +} + +main() +{ + ARRAY *a, *new_a, *copy_of_a; + ARRAY_ELEMENT *ae, *aew; + char *s; + + a = array_create(); + array_insert(a, 1, "one"); + array_insert(a, 7, "seven"); + array_insert(a, 4, "four"); + array_insert(a, 1029, "one thousand twenty-nine"); + array_insert(a, 12, "twelve"); + array_insert(a, 42, "forty-two"); + print_array(a); + s = array_to_string (a, " ", 0); + printf("s = %s\n", s); + copy_of_a = array_from_string(s, " "); + printf("copy_of_a:"); + print_array(copy_of_a); + array_dispose(copy_of_a); + printf("\n"); + free(s); + ae = array_remove(a, 4); + array_dispose_element(ae); + ae = array_remove(a, 1029); + array_dispose_element(ae); + array_insert(a, 16, "sixteen"); + print_array(a); + s = array_to_string (a, " ", 0); + printf("s = %s\n", s); + copy_of_a = array_from_string(s, " "); + printf("copy_of_a:"); + print_array(copy_of_a); + array_dispose(copy_of_a); + printf("\n"); + free(s); + array_insert(a, 2, "two"); + array_insert(a, 1029, "new one thousand twenty-nine"); + array_insert(a, 0, "zero"); + array_insert(a, 134, ""); + print_array(a); + s = array_to_string (a, ":", 0); + printf("s = %s\n", s); + copy_of_a = array_from_string(s, ":"); + printf("copy_of_a:"); + print_array(copy_of_a); + array_dispose(copy_of_a); + printf("\n"); + free(s); + new_a = array_copy(a); + print_array(new_a); + s = array_to_string (new_a, ":", 0); + printf("s = %s\n", s); + copy_of_a = array_from_string(s, ":"); + free(s); + printf("copy_of_a:"); + print_array(copy_of_a); + array_shift(copy_of_a, 2, AS_DISPOSE); + printf("copy_of_a shifted by two:"); + print_array(copy_of_a); + ae = array_shift(copy_of_a, 2, 0); + printf("copy_of_a shifted by two:"); + print_array(copy_of_a); + for ( ; ae; ) { + aew = element_forw(ae); + array_dispose_element(ae); + ae = aew; + } + array_rshift(copy_of_a, 1, (char *)0); + printf("copy_of_a rshift by 1:"); + print_array(copy_of_a); + array_rshift(copy_of_a, 2, "new element zero"); + printf("copy_of_a rshift again by 2 with new element zero:"); + print_array(copy_of_a); + s = array_to_assign(copy_of_a, 0); + printf("copy_of_a=%s\n", s); + free(s); + ae = array_shift(copy_of_a, array_num_elements(copy_of_a), 0); + for ( ; ae; ) { + aew = element_forw(ae); + array_dispose_element(ae); + ae = aew; + } + array_dispose(copy_of_a); + printf("\n"); + array_dispose(a); + array_dispose(new_a); +} + +#endif /* TEST_ARRAY */ +#endif /* ARRAY_VARS */ diff --git a/array.h b/array.h new file mode 100644 index 0000000..fb4f789 --- /dev/null +++ b/array.h @@ -0,0 +1,119 @@ +/* array.h -- definitions for the interface exported by array.c that allows + the rest of the shell to manipulate array variables. */ + +/* Copyright (C) 1997-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + + +#ifndef _ARRAY_H_ +#define _ARRAY_H_ + +#include "stdc.h" + +typedef intmax_t arrayind_t; + +enum atype {array_indexed, array_assoc}; + +typedef struct array { + enum atype type; + arrayind_t max_index; + int num_elements; + struct array_element *head; +} ARRAY; + +typedef struct array_element { + arrayind_t ind; + char *value; + struct array_element *next, *prev; +} ARRAY_ELEMENT; + +typedef int sh_ae_map_func_t __P((ARRAY_ELEMENT *, void *)); + +/* Basic operations on entire arrays */ +extern ARRAY *array_create __P((void)); +extern void array_flush __P((ARRAY *)); +extern void array_dispose __P((ARRAY *)); +extern ARRAY *array_copy __P((ARRAY *)); +extern ARRAY *array_slice __P((ARRAY *, ARRAY_ELEMENT *, ARRAY_ELEMENT *)); +extern void array_walk __P((ARRAY *, sh_ae_map_func_t *, void *)); + +extern ARRAY_ELEMENT *array_shift __P((ARRAY *, int, int)); +extern int array_rshift __P((ARRAY *, int, char *)); +extern ARRAY_ELEMENT *array_unshift_element __P((ARRAY *)); +extern int array_shift_element __P((ARRAY *, char *)); + +extern ARRAY *array_quote __P((ARRAY *)); +extern ARRAY *array_quote_escapes __P((ARRAY *)); +extern ARRAY *array_dequote __P((ARRAY *)); +extern ARRAY *array_dequote_escapes __P((ARRAY *)); +extern ARRAY *array_remove_quoted_nulls __P((ARRAY *)); + +extern char *array_subrange __P((ARRAY *, arrayind_t, arrayind_t, int, int)); +extern char *array_patsub __P((ARRAY *, char *, char *, int)); +extern char *array_modcase __P((ARRAY *, char *, int, int)); + +/* Basic operations on array elements. */ +extern ARRAY_ELEMENT *array_create_element __P((arrayind_t, char *)); +extern ARRAY_ELEMENT *array_copy_element __P((ARRAY_ELEMENT *)); +extern void array_dispose_element __P((ARRAY_ELEMENT *)); + +extern int array_insert __P((ARRAY *, arrayind_t, char *)); +extern ARRAY_ELEMENT *array_remove __P((ARRAY *, arrayind_t)); +extern char *array_reference __P((ARRAY *, arrayind_t)); + +/* Converting to and from arrays */ +extern WORD_LIST *array_to_word_list __P((ARRAY *)); +extern ARRAY *array_from_word_list __P((WORD_LIST *)); +extern WORD_LIST *array_keys_to_word_list __P((ARRAY *)); + +extern ARRAY *array_assign_list __P((ARRAY *, WORD_LIST *)); + +extern char **array_to_argv __P((ARRAY *)); + +extern char *array_to_assign __P((ARRAY *, int)); +extern char *array_to_string __P((ARRAY *, char *, int)); +extern ARRAY *array_from_string __P((char *, char *)); + +/* Flags for array_shift */ +#define AS_DISPOSE 0x01 + +#define array_num_elements(a) ((a)->num_elements) +#define array_max_index(a) ((a)->max_index) +#define array_head(a) ((a)->head) +#define array_empty(a) ((a)->num_elements == 0) + +#define element_value(ae) ((ae)->value) +#define element_index(ae) ((ae)->ind) +#define element_forw(ae) ((ae)->next) +#define element_back(ae) ((ae)->prev) + +/* Convenience */ +#define array_push(a,v) \ + do { array_rshift ((a), 1, (v)); } while (0) +#define array_pop(a) \ + do { array_dispose_element (array_shift ((a), 1, 0)); } while (0) + +#define GET_ARRAY_FROM_VAR(n, v, a) \ + do { \ + (v) = find_variable (n); \ + (a) = ((v) && array_p ((v))) ? array_cell (v) : (ARRAY *)0; \ + } while (0) + +#define ALL_ELEMENT_SUB(c) ((c) == '@' || (c) == '*') + +#endif /* _ARRAY_H_ */ diff --git a/arrayfunc.c b/arrayfunc.c new file mode 100644 index 0000000..658b5aa --- /dev/null +++ b/arrayfunc.c @@ -0,0 +1,1147 @@ +/* arrayfunc.c -- High-level array functions used by other parts of the shell. */ + +/* Copyright (C) 2001-2011 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#if defined (ARRAY_VARS) + +#if defined (HAVE_UNISTD_H) +# include +#endif +#include + +#include "bashintl.h" + +#include "shell.h" +#include "pathexp.h" + +#include "shmbutil.h" + +#include "builtins/common.h" + +extern char *this_command_name; +extern int last_command_exit_value; +extern int array_needs_making; + +static SHELL_VAR *bind_array_var_internal __P((SHELL_VAR *, arrayind_t, char *, char *, int)); +static SHELL_VAR *assign_array_element_internal __P((SHELL_VAR *, char *, char *, char *, int, char *, int)); + +static char *quote_assign __P((const char *)); +static void quote_array_assignment_chars __P((WORD_LIST *)); +static char *array_value_internal __P((char *, int, int, int *, arrayind_t *)); + +/* Standard error message to use when encountering an invalid array subscript */ +const char * const bash_badsub_errmsg = N_("bad array subscript"); + +/* **************************************************************** */ +/* */ +/* Functions to manipulate array variables and perform assignments */ +/* */ +/* **************************************************************** */ + +/* Convert a shell variable to an array variable. The original value is + saved as array[0]. */ +SHELL_VAR * +convert_var_to_array (var) + SHELL_VAR *var; +{ + char *oldval; + ARRAY *array; + + oldval = value_cell (var); + array = array_create (); + if (oldval) + array_insert (array, 0, oldval); + + FREE (value_cell (var)); + var_setarray (var, array); + + /* these aren't valid anymore */ + var->dynamic_value = (sh_var_value_func_t *)NULL; + var->assign_func = (sh_var_assign_func_t *)NULL; + + INVALIDATE_EXPORTSTR (var); + if (exported_p (var)) + array_needs_making++; + + VSETATTR (var, att_array); + VUNSETATTR (var, att_invisible); + + return var; +} + +/* Convert a shell variable to an array variable. The original value is + saved as array[0]. */ +SHELL_VAR * +convert_var_to_assoc (var) + SHELL_VAR *var; +{ + char *oldval; + HASH_TABLE *hash; + + oldval = value_cell (var); + hash = assoc_create (0); + if (oldval) + assoc_insert (hash, savestring ("0"), oldval); + + FREE (value_cell (var)); + var_setassoc (var, hash); + + /* these aren't valid anymore */ + var->dynamic_value = (sh_var_value_func_t *)NULL; + var->assign_func = (sh_var_assign_func_t *)NULL; + + INVALIDATE_EXPORTSTR (var); + if (exported_p (var)) + array_needs_making++; + + VSETATTR (var, att_assoc); + VUNSETATTR (var, att_invisible); + + return var; +} + +char * +make_array_variable_value (entry, ind, key, value, flags) + SHELL_VAR *entry; + arrayind_t ind; + char *key; + char *value; + int flags; +{ + SHELL_VAR *dentry; + char *newval; + + /* If we're appending, we need the old value of the array reference, so + fake out make_variable_value with a dummy SHELL_VAR */ + if (flags & ASS_APPEND) + { + dentry = (SHELL_VAR *)xmalloc (sizeof (SHELL_VAR)); + dentry->name = savestring (entry->name); + if (assoc_p (entry)) + newval = assoc_reference (assoc_cell (entry), key); + else + newval = array_reference (array_cell (entry), ind); + if (newval) + dentry->value = savestring (newval); + else + { + dentry->value = (char *)xmalloc (1); + dentry->value[0] = '\0'; + } + dentry->exportstr = 0; + dentry->attributes = entry->attributes & ~(att_array|att_assoc|att_exported); + /* Leave the rest of the members uninitialized; the code doesn't look + at them. */ + newval = make_variable_value (dentry, value, flags); + dispose_variable (dentry); + } + else + newval = make_variable_value (entry, value, flags); + + return newval; +} + +static SHELL_VAR * +bind_array_var_internal (entry, ind, key, value, flags) + SHELL_VAR *entry; + arrayind_t ind; + char *key; + char *value; + int flags; +{ + char *newval; + + newval = make_array_variable_value (entry, ind, key, value, flags); + + if (entry->assign_func) + (*entry->assign_func) (entry, newval, ind, key); + else if (assoc_p (entry)) + assoc_insert (assoc_cell (entry), key, newval); + else + array_insert (array_cell (entry), ind, newval); + FREE (newval); + + VUNSETATTR (entry, att_invisible); /* no longer invisible */ + return (entry); +} + +/* Perform an array assignment name[ind]=value. If NAME already exists and + is not an array, and IND is 0, perform name=value instead. If NAME exists + and is not an array, and IND is not 0, convert it into an array with the + existing value as name[0]. + + If NAME does not exist, just create an array variable, no matter what + IND's value may be. */ +SHELL_VAR * +bind_array_variable (name, ind, value, flags) + char *name; + arrayind_t ind; + char *value; + int flags; +{ + SHELL_VAR *entry; + + entry = find_shell_variable (name); + + if (entry == (SHELL_VAR *) 0) + entry = make_new_array_variable (name); + else if (readonly_p (entry) || noassign_p (entry)) + { + if (readonly_p (entry)) + err_readonly (name); + return (entry); + } + else if (array_p (entry) == 0) + entry = convert_var_to_array (entry); + + /* ENTRY is an array variable, and ARRAY points to the value. */ + return (bind_array_var_internal (entry, ind, 0, value, flags)); +} + +SHELL_VAR * +bind_array_element (entry, ind, value, flags) + SHELL_VAR *entry; + arrayind_t ind; + char *value; + int flags; +{ + return (bind_array_var_internal (entry, ind, 0, value, flags)); +} + +SHELL_VAR * +bind_assoc_variable (entry, name, key, value, flags) + SHELL_VAR *entry; + char *name; + char *key; + char *value; + int flags; +{ + SHELL_VAR *dentry; + char *newval; + + if (readonly_p (entry) || noassign_p (entry)) + { + if (readonly_p (entry)) + err_readonly (name); + return (entry); + } + + return (bind_array_var_internal (entry, 0, key, value, flags)); +} + +/* Parse NAME, a lhs of an assignment statement of the form v[s], and + assign VALUE to that array element by calling bind_array_variable(). */ +SHELL_VAR * +assign_array_element (name, value, flags) + char *name, *value; + int flags; +{ + char *sub, *vname; + int sublen; + SHELL_VAR *entry; + + vname = array_variable_name (name, &sub, &sublen); + + if (vname == 0) + return ((SHELL_VAR *)NULL); + + if ((ALL_ELEMENT_SUB (sub[0]) && sub[1] == ']') || (sublen <= 1)) + { + free (vname); + err_badarraysub (name); + return ((SHELL_VAR *)NULL); + } + + entry = find_variable (vname); + entry = assign_array_element_internal (entry, name, vname, sub, sublen, value, flags); + + free (vname); + return entry; +} + +static SHELL_VAR * +assign_array_element_internal (entry, name, vname, sub, sublen, value, flags) + SHELL_VAR *entry; + char *name; /* only used for error messages */ + char *vname; + char *sub; + int sublen; + char *value; + int flags; +{ + char *akey; + arrayind_t ind; + + if (entry && assoc_p (entry)) + { + sub[sublen-1] = '\0'; + akey = expand_assignment_string_to_string (sub, 0); /* [ */ + sub[sublen-1] = ']'; + if (akey == 0 || *akey == 0) + { + err_badarraysub (name); + FREE (akey); + return ((SHELL_VAR *)NULL); + } + entry = bind_assoc_variable (entry, vname, akey, value, flags); + } + else + { + ind = array_expand_index (entry, sub, sublen); + /* negative subscripts to indexed arrays count back from end */ + if (entry && ind < 0) + ind = (array_p (entry) ? array_max_index (array_cell (entry)) : 0) + 1 + ind; + if (ind < 0) + { + err_badarraysub (name); + return ((SHELL_VAR *)NULL); + } + entry = bind_array_variable (vname, ind, value, flags); + } + + return (entry); +} + +/* Find the array variable corresponding to NAME. If there is no variable, + create a new array variable. If the variable exists but is not an array, + convert it to an indexed array. If FLAGS&1 is non-zero, an existing + variable is checked for the readonly or noassign attribute in preparation + for assignment (e.g., by the `read' builtin). If FLAGS&2 is non-zero, we + create an associative array. */ +SHELL_VAR * +find_or_make_array_variable (name, flags) + char *name; + int flags; +{ + SHELL_VAR *var; + + var = find_variable (name); + if (var == 0) + { + /* See if we have a nameref pointing to a variable that hasn't been + created yet. */ + var = find_variable_last_nameref (name); + if (var && nameref_p (var)) + var = (flags & 2) ? make_new_assoc_variable (nameref_cell (var)) : make_new_array_variable (nameref_cell (var)); + } + + if (var == 0) + var = (flags & 2) ? make_new_assoc_variable (name) : make_new_array_variable (name); + else if ((flags & 1) && (readonly_p (var) || noassign_p (var))) + { + if (readonly_p (var)) + err_readonly (name); + return ((SHELL_VAR *)NULL); + } + else if ((flags & 2) && array_p (var)) + { + last_command_exit_value = 1; + report_error (_("%s: cannot convert indexed to associative array"), name); + return ((SHELL_VAR *)NULL); + } + else if (array_p (var) == 0 && assoc_p (var) == 0) + var = convert_var_to_array (var); + + return (var); +} + +/* Perform a compound assignment statement for array NAME, where VALUE is + the text between the parens: NAME=( VALUE ) */ +SHELL_VAR * +assign_array_from_string (name, value, flags) + char *name, *value; + int flags; +{ + SHELL_VAR *var; + int vflags; + + vflags = 1; + if (flags & ASS_MKASSOC) + vflags |= 2; + + var = find_or_make_array_variable (name, vflags); + if (var == 0) + return ((SHELL_VAR *)NULL); + + return (assign_array_var_from_string (var, value, flags)); +} + +/* Sequentially assign the indices of indexed array variable VAR from the + words in LIST. */ +SHELL_VAR * +assign_array_var_from_word_list (var, list, flags) + SHELL_VAR *var; + WORD_LIST *list; + int flags; +{ + register arrayind_t i; + register WORD_LIST *l; + ARRAY *a; + + a = array_cell (var); + i = (flags & ASS_APPEND) ? array_max_index (a) + 1 : 0; + + for (l = list; l; l = l->next, i++) + if (var->assign_func) + (*var->assign_func) (var, l->word->word, i, 0); + else + array_insert (a, i, l->word->word); + return var; +} + +WORD_LIST * +expand_compound_array_assignment (var, value, flags) + SHELL_VAR *var; + char *value; + int flags; +{ + WORD_LIST *list, *nlist; + WORD_LIST *hd, *tl, *t, *n; + char *val; + int ni; + + /* This condition is true when invoked from the declare builtin with a + command like + declare -a d='([1]="" [2]="bdef" [5]="hello world" "test")' */ + if (*value == '(') /*)*/ + { + ni = 1; + val = extract_array_assignment_list (value, &ni); + if (val == 0) + return (WORD_LIST *)NULL; + } + else + val = value; + + /* Expand the value string into a list of words, performing all the + shell expansions including pathname generation and word splitting. */ + /* First we split the string on whitespace, using the shell parser + (ksh93 seems to do this). */ + list = parse_string_to_word_list (val, 1, "array assign"); + + if (var && assoc_p (var)) + { + if (val != value) + free (val); + return list; + } + + /* If we're using [subscript]=value, we need to quote each [ and ] to + prevent unwanted filename expansion. This doesn't need to be done + for associative array expansion, since that uses a different expansion + function (see assign_compound_array_list below). */ + if (list) + quote_array_assignment_chars (list); + + /* Now that we've split it, perform the shell expansions on each + word in the list. */ + nlist = list ? expand_words_no_vars (list) : (WORD_LIST *)NULL; + + dispose_words (list); + + if (val != value) + free (val); + + return nlist; +} + +/* Callers ensure that VAR is not NULL */ +void +assign_compound_array_list (var, nlist, flags) + SHELL_VAR *var; + WORD_LIST *nlist; + int flags; +{ + ARRAY *a; + HASH_TABLE *h; + WORD_LIST *list; + char *w, *val, *nval; + int len, iflags, free_val; + arrayind_t ind, last_ind; + char *akey; + + a = (var && array_p (var)) ? array_cell (var) : (ARRAY *)0; + h = (var && assoc_p (var)) ? assoc_cell (var) : (HASH_TABLE *)0; + + akey = (char *)0; + ind = 0; + + /* Now that we are ready to assign values to the array, kill the existing + value. */ + if ((flags & ASS_APPEND) == 0) + { + if (a && array_p (var)) + array_flush (a); + else if (h && assoc_p (var)) + assoc_flush (h); + } + + last_ind = (a && (flags & ASS_APPEND)) ? array_max_index (a) + 1 : 0; + + for (list = nlist; list; list = list->next) + { + iflags = flags; + w = list->word->word; + + /* We have a word of the form [ind]=value */ + if ((list->word->flags & W_ASSIGNMENT) && w[0] == '[') + { + /* Don't have to handle embedded quotes specially any more, since + associative array subscripts have not been expanded yet (see + above). */ + len = skipsubscript (w, 0, 0); + + /* XXX - changes for `+=' */ + if (w[len] != ']' || (w[len+1] != '=' && (w[len+1] != '+' || w[len+2] != '='))) + { + if (assoc_p (var)) + { + err_badarraysub (w); + continue; + } + nval = make_variable_value (var, w, flags); + if (var->assign_func) + (*var->assign_func) (var, nval, last_ind, 0); + else + array_insert (a, last_ind, nval); + FREE (nval); + last_ind++; + continue; + } + + if (len == 1) + { + err_badarraysub (w); + continue; + } + + if (ALL_ELEMENT_SUB (w[1]) && len == 2) + { + last_command_exit_value = 1; + if (assoc_p (var)) + report_error (_("%s: invalid associative array key"), w); + else + report_error (_("%s: cannot assign to non-numeric index"), w); + continue; + } + + if (array_p (var)) + { + ind = array_expand_index (var, w + 1, len); + /* negative subscripts to indexed arrays count back from end */ + if (ind < 0) + ind = array_max_index (array_cell (var)) + 1 + ind; + if (ind < 0) + { + err_badarraysub (w); + continue; + } + + last_ind = ind; + } + else if (assoc_p (var)) + { + /* This is not performed above, see expand_compound_array_assignment */ + w[len] = '\0'; /*[*/ + akey = expand_assignment_string_to_string (w+1, 0); + w[len] = ']'; + /* And we need to expand the value also, see below */ + if (akey == 0 || *akey == 0) + { + err_badarraysub (w); + FREE (akey); + continue; + } + } + + /* XXX - changes for `+=' -- just accept the syntax. ksh93 doesn't do this */ + if (w[len + 1] == '+' && w[len + 2] == '=') + { + iflags |= ASS_APPEND; + val = w + len + 3; + } + else + val = w + len + 2; + } + else if (assoc_p (var)) + { + last_command_exit_value = 1; + report_error (_("%s: %s: must use subscript when assigning associative array"), var->name, w); + continue; + } + else /* No [ind]=value, just a stray `=' */ + { + ind = last_ind; + val = w; + } + + free_val = 0; + /* See above; we need to expand the value here */ + if (assoc_p (var)) + { + val = expand_assignment_string_to_string (val, 0); + if (val == 0) + { + val = (char *)xmalloc (1); + val[0] = '\0'; /* like do_assignment_internal */ + } + free_val = 1; + } + + if (integer_p (var)) + this_command_name = (char *)NULL; /* no command name for errors */ + bind_array_var_internal (var, ind, akey, val, iflags); + last_ind++; + + if (free_val) + free (val); + } +} + +/* Perform a compound array assignment: VAR->name=( VALUE ). The + VALUE has already had the parentheses stripped. */ +SHELL_VAR * +assign_array_var_from_string (var, value, flags) + SHELL_VAR *var; + char *value; + int flags; +{ + WORD_LIST *nlist; + + if (value == 0) + return var; + + nlist = expand_compound_array_assignment (var, value, flags); + assign_compound_array_list (var, nlist, flags); + + if (nlist) + dispose_words (nlist); + return (var); +} + +/* Quote globbing chars and characters in $IFS before the `=' in an assignment + statement (usually a compound array assignment) to protect them from + unwanted filename expansion or word splitting. */ +static char * +quote_assign (string) + const char *string; +{ + size_t slen; + int saw_eq; + char *temp, *t, *subs; + const char *s, *send; + int ss, se; + DECLARE_MBSTATE; + + slen = strlen (string); + send = string + slen; + + t = temp = (char *)xmalloc (slen * 2 + 1); + saw_eq = 0; + for (s = string; *s; ) + { + if (*s == '=') + saw_eq = 1; + if (saw_eq == 0 && *s == '[') /* looks like a subscript */ + { + ss = s - string; + se = skipsubscript (string, ss, 0); + subs = substring (s, ss, se); + *t++ = '\\'; + strcpy (t, subs); + t += se - ss; + *t++ = '\\'; + *t++ = ']'; + s += se + 1; + free (subs); + continue; + } + if (saw_eq == 0 && (glob_char_p (s) || isifs (*s))) + *t++ = '\\'; + + COPY_CHAR_P (t, s, send); + } + *t = '\0'; + return temp; +} + +/* For each word in a compound array assignment, if the word looks like + [ind]=value, quote globbing chars and characters in $IFS before the `='. */ +static void +quote_array_assignment_chars (list) + WORD_LIST *list; +{ + char *nword; + WORD_LIST *l; + + for (l = list; l; l = l->next) + { + if (l->word == 0 || l->word->word == 0 || l->word->word[0] == '\0') + continue; /* should not happen, but just in case... */ + /* Don't bother if it hasn't been recognized as an assignment or + doesn't look like [ind]=value */ + if ((l->word->flags & W_ASSIGNMENT) == 0) + continue; + if (l->word->word[0] != '[' || mbschr (l->word->word, '=') == 0) /* ] */ + continue; + + nword = quote_assign (l->word->word); + free (l->word->word); + l->word->word = nword; + l->word->flags |= W_NOGLOB; /* XXX - W_NOSPLIT also? */ + } +} + +/* skipsubscript moved to subst.c to use private functions. 2009/02/24. */ + +/* This function is called with SUB pointing to just after the beginning + `[' of an array subscript and removes the array element to which SUB + expands from array VAR. A subscript of `*' or `@' unsets the array. */ +int +unbind_array_element (var, sub) + SHELL_VAR *var; + char *sub; +{ + int len; + arrayind_t ind; + char *akey; + ARRAY_ELEMENT *ae; + + len = skipsubscript (sub, 0, 0); + if (sub[len] != ']' || len == 0) + { + builtin_error ("%s[%s: %s", var->name, sub, _(bash_badsub_errmsg)); + return -1; + } + sub[len] = '\0'; + + if (ALL_ELEMENT_SUB (sub[0]) && sub[1] == 0) + { + unbind_variable (var->name); + return (0); + } + + if (assoc_p (var)) + { + akey = expand_assignment_string_to_string (sub, 0); /* [ */ + if (akey == 0 || *akey == 0) + { + builtin_error ("[%s]: %s", sub, _(bash_badsub_errmsg)); + FREE (akey); + return -1; + } + assoc_remove (assoc_cell (var), akey); + free (akey); + } + else + { + ind = array_expand_index (var, sub, len+1); + /* negative subscripts to indexed arrays count back from end */ + if (ind < 0) + ind = array_max_index (array_cell (var)) + 1 + ind; + if (ind < 0) + { + builtin_error ("[%s]: %s", sub, _(bash_badsub_errmsg)); + return -1; + } + ae = array_remove (array_cell (var), ind); + if (ae) + array_dispose_element (ae); + } + + return 0; +} + +/* Format and output an array assignment in compound form VAR=(VALUES), + suitable for re-use as input. */ +void +print_array_assignment (var, quoted) + SHELL_VAR *var; + int quoted; +{ + char *vstr; + + vstr = array_to_assign (array_cell (var), quoted); + + if (vstr == 0) + printf ("%s=%s\n", var->name, quoted ? "'()'" : "()"); + else + { + printf ("%s=%s\n", var->name, vstr); + free (vstr); + } +} + +/* Format and output an associative array assignment in compound form + VAR=(VALUES), suitable for re-use as input. */ +void +print_assoc_assignment (var, quoted) + SHELL_VAR *var; + int quoted; +{ + char *vstr; + + vstr = assoc_to_assign (assoc_cell (var), quoted); + + if (vstr == 0) + printf ("%s=%s\n", var->name, quoted ? "'()'" : "()"); + else + { + printf ("%s=%s\n", var->name, vstr); + free (vstr); + } +} + +/***********************************************************************/ +/* */ +/* Utility functions to manage arrays and their contents for expansion */ +/* */ +/***********************************************************************/ + +/* Return 1 if NAME is a properly-formed array reference v[sub]. */ +int +valid_array_reference (name) + char *name; +{ + char *t; + int r, len; + + t = mbschr (name, '['); /* ] */ + if (t) + { + *t = '\0'; + r = legal_identifier (name); + *t = '['; + if (r == 0) + return 0; + /* Check for a properly-terminated non-blank subscript. */ + len = skipsubscript (t, 0, 0); + if (t[len] != ']' || len == 1) + return 0; + for (r = 1; r < len; r++) + if (whitespace (t[r]) == 0) + return 1; + return 0; + } + return 0; +} + +/* Expand the array index beginning at S and extending LEN characters. */ +arrayind_t +array_expand_index (var, s, len) + SHELL_VAR *var; + char *s; + int len; +{ + char *exp, *t; + int expok; + arrayind_t val; + + exp = (char *)xmalloc (len); + strncpy (exp, s, len - 1); + exp[len - 1] = '\0'; + t = expand_arith_string (exp, 0); + this_command_name = (char *)NULL; + val = evalexp (t, &expok); + free (t); + free (exp); + if (expok == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + + top_level_cleanup (); + jump_to_top_level (DISCARD); + } + return val; +} + +/* Return the name of the variable specified by S without any subscript. + If SUBP is non-null, return a pointer to the start of the subscript + in *SUBP. If LENP is non-null, the length of the subscript is returned + in *LENP. This returns newly-allocated memory. */ +char * +array_variable_name (s, subp, lenp) + char *s, **subp; + int *lenp; +{ + char *t, *ret; + int ind, ni; + + t = mbschr (s, '['); + if (t == 0) + { + if (subp) + *subp = t; + if (lenp) + *lenp = 0; + return ((char *)NULL); + } + ind = t - s; + ni = skipsubscript (s, ind, 0); + if (ni <= ind + 1 || s[ni] != ']') + { + err_badarraysub (s); + if (subp) + *subp = t; + if (lenp) + *lenp = 0; + return ((char *)NULL); + } + + *t = '\0'; + ret = savestring (s); + *t++ = '['; /* ] */ + + if (subp) + *subp = t; + if (lenp) + *lenp = ni - ind; + + return ret; +} + +/* Return the variable specified by S without any subscript. If SUBP is + non-null, return a pointer to the start of the subscript in *SUBP. + If LENP is non-null, the length of the subscript is returned in *LENP. */ +SHELL_VAR * +array_variable_part (s, subp, lenp) + char *s, **subp; + int *lenp; +{ + char *t; + SHELL_VAR *var; + + t = array_variable_name (s, subp, lenp); + if (t == 0) + return ((SHELL_VAR *)NULL); + var = find_variable (t); + + free (t); +#if 0 + return (var == 0 || invisible_p (var)) ? (SHELL_VAR *)0 : var; +#else + return var; /* now return invisible variables; caller must handle */ +#endif +} + +#define INDEX_ERROR() \ + do \ + { \ + if (var) \ + err_badarraysub (var->name); \ + else \ + { \ + t[-1] = '\0'; \ + err_badarraysub (s); \ + t[-1] = '['; /* ] */\ + } \ + return ((char *)NULL); \ + } \ + while (0) + +/* Return a string containing the elements in the array and subscript + described by S. If the subscript is * or @, obeys quoting rules akin + to the expansion of $* and $@ including double quoting. If RTYPE + is non-null it gets 1 if the array reference is name[*], 2 if the + reference is name[@], and 0 otherwise. */ +static char * +array_value_internal (s, quoted, flags, rtype, indp) + char *s; + int quoted, flags, *rtype; + arrayind_t *indp; +{ + int len; + arrayind_t ind; + char *akey; + char *retval, *t, *temp; + WORD_LIST *l; + SHELL_VAR *var; + + var = array_variable_part (s, &t, &len); + + /* Expand the index, even if the variable doesn't exist, in case side + effects are needed, like ${w[i++]} where w is unset. */ +#if 0 + if (var == 0) + return (char *)NULL; +#endif + + if (len == 0) + return ((char *)NULL); /* error message already printed */ + + /* [ */ + akey = 0; + if (ALL_ELEMENT_SUB (t[0]) && t[1] == ']') + { + if (rtype) + *rtype = (t[0] == '*') ? 1 : 2; + if ((flags & AV_ALLOWALL) == 0) + { + err_badarraysub (s); + return ((char *)NULL); + } + else if (var == 0 || value_cell (var) == 0) /* XXX - check for invisible_p(var) ? */ + return ((char *)NULL); + else if (array_p (var) == 0 && assoc_p (var) == 0) + l = add_string_to_list (value_cell (var), (WORD_LIST *)NULL); + else if (assoc_p (var)) + { + l = assoc_to_word_list (assoc_cell (var)); + if (l == (WORD_LIST *)NULL) + return ((char *)NULL); + } + else + { + l = array_to_word_list (array_cell (var)); + if (l == (WORD_LIST *)NULL) + return ((char *) NULL); + } + + if (t[0] == '*' && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + { + temp = string_list_dollar_star (l); + retval = quote_string (temp); /* XXX - leak here */ + free (temp); + } + else /* ${name[@]} or unquoted ${name[*]} */ + retval = string_list_dollar_at (l, quoted); /* XXX - leak here */ + + dispose_words (l); + } + else + { + if (rtype) + *rtype = 0; + if (var == 0 || array_p (var) || assoc_p (var) == 0) + { + if ((flags & AV_USEIND) == 0 || indp == 0) + { + ind = array_expand_index (var, t, len); + if (ind < 0) + { + /* negative subscripts to indexed arrays count back from end */ + if (var && array_p (var)) + ind = array_max_index (array_cell (var)) + 1 + ind; + if (ind < 0) + INDEX_ERROR(); + } + if (indp) + *indp = ind; + } + else if (indp) + ind = *indp; + } + else if (assoc_p (var)) + { + t[len - 1] = '\0'; + akey = expand_assignment_string_to_string (t, 0); /* [ */ + t[len - 1] = ']'; + if (akey == 0 || *akey == 0) + { + FREE (akey); + INDEX_ERROR(); + } + } + + if (var == 0 || value_cell (var) == 0) /* XXX - check invisible_p(var) ? */ + { + FREE (akey); + return ((char *)NULL); + } + if (array_p (var) == 0 && assoc_p (var) == 0) + return (ind == 0 ? value_cell (var) : (char *)NULL); + else if (assoc_p (var)) + { + retval = assoc_reference (assoc_cell (var), akey); + free (akey); + } + else + retval = array_reference (array_cell (var), ind); + } + + return retval; +} + +/* Return a string containing the elements described by the array and + subscript contained in S, obeying quoting for subscripts * and @. */ +char * +array_value (s, quoted, flags, rtype, indp) + char *s; + int quoted, flags, *rtype; + arrayind_t *indp; +{ + return (array_value_internal (s, quoted, flags|AV_ALLOWALL, rtype, indp)); +} + +/* Return the value of the array indexing expression S as a single string. + If (FLAGS & AV_ALLOWALL) is 0, do not allow `@' and `*' subscripts. This + is used by other parts of the shell such as the arithmetic expression + evaluator in expr.c. */ +char * +get_array_value (s, flags, rtype, indp) + char *s; + int flags, *rtype; + arrayind_t *indp; +{ + return (array_value_internal (s, 0, flags, rtype, indp)); +} + +char * +array_keys (s, quoted) + char *s; + int quoted; +{ + int len; + char *retval, *t, *temp; + WORD_LIST *l; + SHELL_VAR *var; + + var = array_variable_part (s, &t, &len); + + /* [ */ + if (var == 0 || ALL_ELEMENT_SUB (t[0]) == 0 || t[1] != ']') + return (char *)NULL; + + if (var_isset (var) == 0 || invisible_p (var)) + return (char *)NULL; + + if (array_p (var) == 0 && assoc_p (var) == 0) + l = add_string_to_list ("0", (WORD_LIST *)NULL); + else if (assoc_p (var)) + l = assoc_keys_to_word_list (assoc_cell (var)); + else + l = array_keys_to_word_list (array_cell (var)); + if (l == (WORD_LIST *)NULL) + return ((char *) NULL); + + if (t[0] == '*' && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))) + { + temp = string_list_dollar_star (l); + retval = quote_string (temp); + free (temp); + } + else /* ${!name[@]} or unquoted ${!name[*]} */ + retval = string_list_dollar_at (l, quoted); + + dispose_words (l); + return retval; +} +#endif /* ARRAY_VARS */ diff --git a/arrayfunc.h b/arrayfunc.h new file mode 100644 index 0000000..26f4879 --- /dev/null +++ b/arrayfunc.h @@ -0,0 +1,77 @@ +/* arrayfunc.h -- declarations for miscellaneous array functions in arrayfunc.c */ + +/* Copyright (C) 2001-2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_ARRAYFUNC_H_) +#define _ARRAYFUNC_H_ + +/* Must include variables.h before including this file. */ + +#if defined (ARRAY_VARS) + +/* Flags for array_value_internal and callers array_value/get_array_value */ +#define AV_ALLOWALL 0x001 +#define AV_QUOTED 0x002 +#define AV_USEIND 0x004 + +extern SHELL_VAR *convert_var_to_array __P((SHELL_VAR *)); +extern SHELL_VAR *convert_var_to_assoc __P((SHELL_VAR *)); + +extern char *make_array_variable_value __P((SHELL_VAR *, arrayind_t, char *, char *, int)); + +extern SHELL_VAR *bind_array_variable __P((char *, arrayind_t, char *, int)); +extern SHELL_VAR *bind_array_element __P((SHELL_VAR *, arrayind_t, char *, int)); +extern SHELL_VAR *assign_array_element __P((char *, char *, int)); + +extern SHELL_VAR *bind_assoc_variable __P((SHELL_VAR *, char *, char *, char *, int)); + +extern SHELL_VAR *find_or_make_array_variable __P((char *, int)); + +extern SHELL_VAR *assign_array_from_string __P((char *, char *, int)); +extern SHELL_VAR *assign_array_var_from_word_list __P((SHELL_VAR *, WORD_LIST *, int)); + +extern WORD_LIST *expand_compound_array_assignment __P((SHELL_VAR *, char *, int)); +extern void assign_compound_array_list __P((SHELL_VAR *, WORD_LIST *, int)); +extern SHELL_VAR *assign_array_var_from_string __P((SHELL_VAR *, char *, int)); + +extern int unbind_array_element __P((SHELL_VAR *, char *)); +extern int skipsubscript __P((const char *, int, int)); + +extern void print_array_assignment __P((SHELL_VAR *, int)); +extern void print_assoc_assignment __P((SHELL_VAR *, int)); + +extern arrayind_t array_expand_index __P((SHELL_VAR *, char *, int)); +extern int valid_array_reference __P((char *)); +extern char *array_value __P((char *, int, int, int *, arrayind_t *)); +extern char *get_array_value __P((char *, int, int *, arrayind_t *)); + +extern char *array_keys __P((char *, int)); + +extern char *array_variable_name __P((char *, char **, int *)); +extern SHELL_VAR *array_variable_part __P((char *, char **, int *)); + +#else + +#define AV_ALLOWALL 0 +#define AV_QUOTED 0 +#define AV_USEIND 0 + +#endif + +#endif /* !_ARRAYFUNC_H_ */ diff --git a/assoc.c b/assoc.c new file mode 100644 index 0000000..f9ed881 --- /dev/null +++ b/assoc.c @@ -0,0 +1,559 @@ +/* + * assoc.c - functions to manipulate associative arrays + * + * Associative arrays are standard shell hash tables. + * + * Chet Ramey + * chet@ins.cwru.edu + */ + +/* Copyright (C) 2008,2009,2011 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#if defined (ARRAY_VARS) + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include +#include "bashansi.h" + +#include "shell.h" +#include "array.h" +#include "assoc.h" +#include "builtins/common.h" + +static WORD_LIST *assoc_to_word_list_internal __P((HASH_TABLE *, int)); + +/* assoc_create == hash_create */ + +void +assoc_dispose (hash) + HASH_TABLE *hash; +{ + if (hash) + { + hash_flush (hash, 0); + hash_dispose (hash); + } +} + +void +assoc_flush (hash) + HASH_TABLE *hash; +{ + hash_flush (hash, 0); +} + +int +assoc_insert (hash, key, value) + HASH_TABLE *hash; + char *key; + char *value; +{ + BUCKET_CONTENTS *b; + + b = hash_search (key, hash, HASH_CREATE); + if (b == 0) + return -1; + /* If we are overwriting an existing element's value, we're not going to + use the key. Nothing in the array assignment code path frees the key + string, so we can free it here to avoid a memory leak. */ + if (b->key != key) + free (key); + FREE (b->data); + b->data = value ? savestring (value) : (char *)0; + return (0); +} + +/* Like assoc_insert, but returns b->data instead of freeing it */ +PTR_T +assoc_replace (hash, key, value) + HASH_TABLE *hash; + char *key; + char *value; +{ + BUCKET_CONTENTS *b; + PTR_T t; + + b = hash_search (key, hash, HASH_CREATE); + if (b == 0) + return (PTR_T)0; + /* If we are overwriting an existing element's value, we're not going to + use the key. Nothing in the array assignment code path frees the key + string, so we can free it here to avoid a memory leak. */ + if (b->key != key) + free (key); + t = b->data; + b->data = value ? savestring (value) : (char *)0; + return t; +} + +void +assoc_remove (hash, string) + HASH_TABLE *hash; + char *string; +{ + BUCKET_CONTENTS *b; + + b = hash_remove (string, hash, 0); + if (b) + { + free ((char *)b->data); + free (b->key); + free (b); + } +} + +char * +assoc_reference (hash, string) + HASH_TABLE *hash; + char *string; +{ + BUCKET_CONTENTS *b; + + if (hash == 0) + return (char *)0; + + b = hash_search (string, hash, 0); + return (b ? (char *)b->data : 0); +} + +/* Quote the data associated with each element of the hash table ASSOC, + using quote_string */ +HASH_TABLE * +assoc_quote (h) + HASH_TABLE *h; +{ + int i; + BUCKET_CONTENTS *tlist; + char *t; + + if (h == 0 || assoc_empty (h)) + return ((HASH_TABLE *)NULL); + + for (i = 0; i < h->nbuckets; i++) + for (tlist = hash_items (i, h); tlist; tlist = tlist->next) + { + t = quote_string ((char *)tlist->data); + FREE (tlist->data); + tlist->data = t; + } + + return h; +} + +/* Quote escape characters in the data associated with each element + of the hash table ASSOC, using quote_escapes */ +HASH_TABLE * +assoc_quote_escapes (h) + HASH_TABLE *h; +{ + int i; + BUCKET_CONTENTS *tlist; + char *t; + + if (h == 0 || assoc_empty (h)) + return ((HASH_TABLE *)NULL); + + for (i = 0; i < h->nbuckets; i++) + for (tlist = hash_items (i, h); tlist; tlist = tlist->next) + { + t = quote_escapes ((char *)tlist->data); + FREE (tlist->data); + tlist->data = t; + } + + return h; +} + +HASH_TABLE * +assoc_dequote (h) + HASH_TABLE *h; +{ + int i; + BUCKET_CONTENTS *tlist; + char *t; + + if (h == 0 || assoc_empty (h)) + return ((HASH_TABLE *)NULL); + + for (i = 0; i < h->nbuckets; i++) + for (tlist = hash_items (i, h); tlist; tlist = tlist->next) + { + t = dequote_string ((char *)tlist->data); + FREE (tlist->data); + tlist->data = t; + } + + return h; +} + +HASH_TABLE * +assoc_dequote_escapes (h) + HASH_TABLE *h; +{ + int i; + BUCKET_CONTENTS *tlist; + char *t; + + if (h == 0 || assoc_empty (h)) + return ((HASH_TABLE *)NULL); + + for (i = 0; i < h->nbuckets; i++) + for (tlist = hash_items (i, h); tlist; tlist = tlist->next) + { + t = dequote_escapes ((char *)tlist->data); + FREE (tlist->data); + tlist->data = t; + } + + return h; +} + +HASH_TABLE * +assoc_remove_quoted_nulls (h) + HASH_TABLE *h; +{ + int i; + BUCKET_CONTENTS *tlist; + char *t; + + if (h == 0 || assoc_empty (h)) + return ((HASH_TABLE *)NULL); + + for (i = 0; i < h->nbuckets; i++) + for (tlist = hash_items (i, h); tlist; tlist = tlist->next) + { + t = remove_quoted_nulls ((char *)tlist->data); + tlist->data = t; + } + + return h; +} + +/* + * Return a string whose elements are the members of array H beginning at + * the STARTth element and spanning NELEM members. Null elements are counted. + */ +char * +assoc_subrange (hash, start, nelem, starsub, quoted) +HASH_TABLE *hash; +arrayind_t start, nelem; +int starsub, quoted; +{ + WORD_LIST *l, *save, *h, *t; + int i, j; + char *ret; + + if (assoc_empty (hash)) + return ((char *)NULL); + + save = l = assoc_to_word_list (hash); + if (save == 0) + return ((char *)NULL); + + for (i = 1; l && i < start; i++) + l = l->next; + if (l == 0) + return ((char *)NULL); + for (j = 0,h = t = l; l && j < nelem; j++) + { + t = l; + l = l->next; + } + + t->next = (WORD_LIST *)NULL; + + ret = string_list_pos_params (starsub ? '*' : '@', h, quoted); + + if (t != l) + t->next = l; + + dispose_words (save); + return (ret); + +} + +char * +assoc_patsub (h, pat, rep, mflags) + HASH_TABLE *h; + char *pat, *rep; + int mflags; +{ + BUCKET_CONTENTS *tlist; + int i, slen; + HASH_TABLE *h2; + char *t, *sifs, *ifs; + + if (h == 0 || assoc_empty (h)) + return ((char *)NULL); + + h2 = assoc_copy (h); + for (i = 0; i < h2->nbuckets; i++) + for (tlist = hash_items (i, h2); tlist; tlist = tlist->next) + { + t = pat_subst ((char *)tlist->data, pat, rep, mflags); + FREE (tlist->data); + tlist->data = t; + } + + if (mflags & MATCH_QUOTED) + assoc_quote (h2); + else + assoc_quote_escapes (h2); + + if (mflags & MATCH_STARSUB) + { + assoc_remove_quoted_nulls (h2); + sifs = ifs_firstchar ((int *)NULL); + t = assoc_to_string (h2, sifs, 0); + free (sifs); + } + else if (mflags & MATCH_QUOTED) + { + /* ${array[@]} */ + sifs = ifs_firstchar (&slen); + ifs = getifs (); + if (ifs == 0 || *ifs == 0) + { + if (slen < 2) + sifs = xrealloc (sifs, 2); + sifs[0] = ' '; + sifs[1] = '\0'; + } + t = assoc_to_string (h2, sifs, 0); + free(sifs); + } + else + t = assoc_to_string (h2, " ", 0); + + assoc_dispose (h2); + + return t; +} + +char * +assoc_modcase (h, pat, modop, mflags) + HASH_TABLE *h; + char *pat; + int modop; + int mflags; +{ + BUCKET_CONTENTS *tlist; + int i, slen; + HASH_TABLE *h2; + char *t, *sifs, *ifs; + + if (h == 0 || assoc_empty (h)) + return ((char *)NULL); + + h2 = assoc_copy (h); + for (i = 0; i < h2->nbuckets; i++) + for (tlist = hash_items (i, h2); tlist; tlist = tlist->next) + { + t = sh_modcase ((char *)tlist->data, pat, modop); + FREE (tlist->data); + tlist->data = t; + } + + if (mflags & MATCH_QUOTED) + assoc_quote (h2); + else + assoc_quote_escapes (h2); + + if (mflags & MATCH_STARSUB) + { + assoc_remove_quoted_nulls (h2); + sifs = ifs_firstchar ((int *)NULL); + t = assoc_to_string (h2, sifs, 0); + free (sifs); + } + else if (mflags & MATCH_QUOTED) + { + /* ${array[@]} */ + sifs = ifs_firstchar (&slen); + ifs = getifs (); + if (ifs == 0 || *ifs == 0) + { + if (slen < 2) + sifs = xrealloc (sifs, 2); + sifs[0] = ' '; + sifs[1] = '\0'; + } + t = assoc_to_string (h2, sifs, 0); + free(sifs); + } + else + t = assoc_to_string (h2, " ", 0); + + assoc_dispose (h2); + + return t; +} + +char * +assoc_to_assign (hash, quoted) + HASH_TABLE *hash; + int quoted; +{ + char *ret; + char *istr, *vstr; + int i, rsize, rlen, elen; + BUCKET_CONTENTS *tlist; + + if (hash == 0 || assoc_empty (hash)) + return (char *)0; + + ret = xmalloc (rsize = 128); + ret[0] = '('; + rlen = 1; + + for (i = 0; i < hash->nbuckets; i++) + for (tlist = hash_items (i, hash); tlist; tlist = tlist->next) + { +#if 1 + if (sh_contains_shell_metas (tlist->key)) + istr = sh_double_quote (tlist->key); + else + istr = tlist->key; +#else + istr = tlist->key; +#endif + vstr = tlist->data ? sh_double_quote ((char *)tlist->data) : (char *)0; + + elen = STRLEN (istr) + 8 + STRLEN (vstr); + RESIZE_MALLOCED_BUFFER (ret, rlen, (elen+1), rsize, rsize); + + ret[rlen++] = '['; + strcpy (ret+rlen, istr); + rlen += STRLEN (istr); + ret[rlen++] = ']'; + ret[rlen++] = '='; + if (vstr) + { + strcpy (ret + rlen, vstr); + rlen += STRLEN (vstr); + } + ret[rlen++] = ' '; + + + if (istr != tlist->key) + FREE (istr); + + FREE (vstr); + } + + RESIZE_MALLOCED_BUFFER (ret, rlen, 1, rsize, 8); + ret[rlen++] = ')'; + ret[rlen] = '\0'; + + if (quoted) + { + vstr = sh_single_quote (ret); + free (ret); + ret = vstr; + } + + return ret; +} + +static WORD_LIST * +assoc_to_word_list_internal (h, t) + HASH_TABLE *h; + int t; +{ + WORD_LIST *list; + int i; + BUCKET_CONTENTS *tlist; + char *w; + + if (h == 0 || assoc_empty (h)) + return((WORD_LIST *)NULL); + list = (WORD_LIST *)NULL; + + for (i = 0; i < h->nbuckets; i++) + for (tlist = hash_items (i, h); tlist; tlist = tlist->next) + { + w = (t == 0) ? (char *)tlist->data : (char *)tlist->key; + list = make_word_list (make_bare_word(w), list); + } + return (REVERSE_LIST(list, WORD_LIST *)); +} + +WORD_LIST * +assoc_to_word_list (h) + HASH_TABLE *h; +{ + return (assoc_to_word_list_internal (h, 0)); +} + +WORD_LIST * +assoc_keys_to_word_list (h) + HASH_TABLE *h; +{ + return (assoc_to_word_list_internal (h, 1)); +} + +char * +assoc_to_string (h, sep, quoted) + HASH_TABLE *h; + char *sep; + int quoted; +{ + BUCKET_CONTENTS *tlist; + int i; + char *result, *t, *w; + WORD_LIST *list, *l; + + if (h == 0) + return ((char *)NULL); + if (assoc_empty (h)) + return (savestring ("")); + + result = NULL; + l = list = NULL; + /* This might be better implemented directly, but it's simple to implement + by converting to a word list first, possibly quoting the data, then + using list_string */ + for (i = 0; i < h->nbuckets; i++) + for (tlist = hash_items (i, h); tlist; tlist = tlist->next) + { + w = (char *)tlist->data; + if (w == 0) + continue; + t = quoted ? quote_string (w) : savestring (w); + list = make_word_list (make_bare_word(t), list); + FREE (t); + } + + l = REVERSE_LIST(list, WORD_LIST *); + + result = l ? string_list_internal (l, sep) : savestring (""); + dispose_words (l); + + return result; +} + +#endif /* ARRAY_VARS */ diff --git a/assoc.h b/assoc.h new file mode 100644 index 0000000..db8383b --- /dev/null +++ b/assoc.h @@ -0,0 +1,62 @@ +/* assoc.h -- definitions for the interface exported by assoc.c that allows + the rest of the shell to manipulate associative array variables. */ + +/* Copyright (C) 2008,2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _ASSOC_H_ +#define _ASSOC_H_ + +#include "stdc.h" +#include "hashlib.h" + +#define assoc_empty(h) ((h)->nentries == 0) +#define assoc_num_elements(h) ((h)->nentries) + +#define assoc_create(n) (hash_create((n))) + +#define assoc_copy(h) (hash_copy((h), 0)) + +#define assoc_walk(h, f) (hash_walk((h), (f)) + +extern void assoc_dispose __P((HASH_TABLE *)); +extern void assoc_flush __P((HASH_TABLE *)); + +extern int assoc_insert __P((HASH_TABLE *, char *, char *)); +extern PTR_T assoc_replace __P((HASH_TABLE *, char *, char *)); +extern void assoc_remove __P((HASH_TABLE *, char *)); + +extern char *assoc_reference __P((HASH_TABLE *, char *)); + +extern char *assoc_subrange __P((HASH_TABLE *, arrayind_t, arrayind_t, int, int)); +extern char *assoc_patsub __P((HASH_TABLE *, char *, char *, int)); +extern char *assoc_modcase __P((HASH_TABLE *, char *, int, int)); + +extern HASH_TABLE *assoc_quote __P((HASH_TABLE *)); +extern HASH_TABLE *assoc_quote_escapes __P((HASH_TABLE *)); +extern HASH_TABLE *assoc_dequote __P((HASH_TABLE *)); +extern HASH_TABLE *assoc_dequote_escapes __P((HASH_TABLE *)); +extern HASH_TABLE *assoc_remove_quoted_nulls __P((HASH_TABLE *)); + +extern char *assoc_to_assign __P((HASH_TABLE *, int)); + +extern WORD_LIST *assoc_to_word_list __P((HASH_TABLE *)); +extern WORD_LIST *assoc_keys_to_word_list __P((HASH_TABLE *)); + +extern char *assoc_to_string __P((HASH_TABLE *, char *, int)); +#endif /* _ASSOC_H_ */ diff --git a/bashansi.h b/bashansi.h new file mode 100644 index 0000000..2c33937 --- /dev/null +++ b/bashansi.h @@ -0,0 +1,41 @@ +/* bashansi.h -- Typically included information required by picky compilers. */ + +/* Copyright (C) 1993-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_BASHANSI_H_) +#define _BASHANSI_H_ + +#if defined (HAVE_STRING_H) +# if ! defined (STDC_HEADERS) && defined (HAVE_MEMORY_H) +# include +# endif +# include +#endif /* !HAVE_STRING_H */ + +#if defined (HAVE_STRINGS_H) +# include +#endif /* !HAVE_STRINGS_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* !HAVE_STDLIB_H */ + +#endif /* !_BASHANSI_H_ */ diff --git a/bashhist.c b/bashhist.c new file mode 100644 index 0000000..d4c62e7 --- /dev/null +++ b/bashhist.c @@ -0,0 +1,923 @@ +/* bashhist.c -- bash interface to the GNU history library. */ + +/* Copyright (C) 1993-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#if defined (HISTORY) + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX + # include +# endif +# include +#endif + +#include "bashtypes.h" +#include +#include +#include "bashansi.h" +#include "posixstat.h" +#include "filecntl.h" + +#include "bashintl.h" + +#if defined (SYSLOG_HISTORY) +# include +#endif + +#include "shell.h" +#include "flags.h" +#include "input.h" +#include "parser.h" /* for the struct dstack stuff. */ +#include "pathexp.h" /* for the struct ignorevar stuff */ +#include "bashhist.h" /* matching prototypes and declarations */ +#include "builtins/common.h" + +#include +#include +#include + +#if defined (READLINE) +# include "bashline.h" +extern int rl_done, rl_dispatching; /* should really include readline.h */ +#endif + +#if !defined (errno) +extern int errno; +#endif + +static int histignore_item_func __P((struct ign *)); +static int check_history_control __P((char *)); +static void hc_erasedups __P((char *)); +static void really_add_history __P((char *)); + +static struct ignorevar histignore = +{ + "HISTIGNORE", + (struct ign *)0, + 0, + (char *)0, + (sh_iv_item_func_t *)histignore_item_func, +}; + +#define HIGN_EXPAND 0x01 + +/* Declarations of bash history variables. */ +/* Non-zero means to remember lines typed to the shell on the history + list. This is different than the user-controlled behaviour; this + becomes zero when we read lines from a file, for example. */ +int remember_on_history = 1; +int enable_history_list = 1; /* value for `set -o history' */ + +/* The number of lines that Bash has added to this history session. The + difference between the number of the top element in the history list + (offset from history_base) and the number of lines in the history file. + Appending this session's history to the history file resets this to 0. */ +int history_lines_this_session; + +/* The number of lines that Bash has read from the history file. */ +int history_lines_in_file; + +#if defined (BANG_HISTORY) +/* Non-zero means do no history expansion on this line, regardless + of what history_expansion says. */ +int history_expansion_inhibited; +#endif + +/* With the old default, every line was saved in the history individually. + I.e., if the user enters: + bash$ for i in a b c + > do + > echo $i + > done + Each line will be individually saved in the history. + bash$ history + 10 for i in a b c + 11 do + 12 echo $i + 13 done + 14 history + If the variable command_oriented_history is set, multiple lines + which form one command will be saved as one history entry. + bash$ for i in a b c + > do + > echo $i + > done + bash$ history + 10 for i in a b c + do + echo $i + done + 11 history + The user can then recall the whole command all at once instead + of just being able to recall one line at a time. + + This is now enabled by default. + */ +int command_oriented_history = 1; + +/* Set to 1 if the first line of a possibly-multi-line command was saved + in the history list. Managed by maybe_add_history(), but global so + the history-manipluating builtins can see it. */ +int current_command_first_line_saved = 0; + +/* Non-zero means to store newlines in the history list when using + command_oriented_history rather than trying to use semicolons. */ +int literal_history; + +/* Non-zero means to append the history to the history file at shell + exit, even if the history has been stifled. */ +int force_append_history; + +/* A nit for picking at history saving. Flags have the following values: + + Value == 0 means save all lines parsed by the shell on the history. + Value & HC_IGNSPACE means save all lines that do not start with a space. + Value & HC_IGNDUPS means save all lines that do not match the last + line saved. + Value & HC_ERASEDUPS means to remove all other matching lines from the + history list before saving the latest line. */ +int history_control; + +/* Set to 1 if the last command was added to the history list successfully + as a separate history entry; set to 0 if the line was ignored or added + to a previous entry as part of command-oriented-history processing. */ +int hist_last_line_added; + +/* Set to 1 if builtins/history.def:push_history added the last history + entry. */ +int hist_last_line_pushed; + +#if defined (READLINE) +/* If non-zero, and readline is being used, the user is offered the + chance to re-edit a failed history expansion. */ +int history_reediting; + +/* If non-zero, and readline is being used, don't directly execute a + line with history substitution. Reload it into the editing buffer + instead and let the user further edit and confirm with a newline. */ +int hist_verify; + +#endif /* READLINE */ + +/* Non-zero means to not save function definitions in the history list. */ +int dont_save_function_defs; + +/* Variables declared in other files used here. */ +extern int current_command_line_count; + +extern struct dstack dstack; +extern int parser_state; + +static int bash_history_inhibit_expansion __P((char *, int)); +#if defined (READLINE) +static void re_edit __P((char *)); +#endif +static int history_expansion_p __P((char *)); +static int shell_comment __P((char *)); +static int should_expand __P((char *)); +static HIST_ENTRY *last_history_entry __P((void)); +static char *expand_histignore_pattern __P((char *)); +static int history_should_ignore __P((char *)); + +/* Is the history expansion starting at string[i] one that should not + be expanded? */ +static int +bash_history_inhibit_expansion (string, i) + char *string; + int i; +{ + /* The shell uses ! as a pattern negation character in globbing [...] + expressions, so let those pass without expansion. */ + if (i > 0 && (string[i - 1] == '[') && member (']', string + i + 1)) + return (1); + /* The shell uses ! as the indirect expansion character, so let those + expansions pass as well. */ + else if (i > 1 && string[i - 1] == '{' && string[i - 2] == '$' && + member ('}', string + i + 1)) + return (1); + /* The shell uses $! as a defined parameter expansion. */ + else if (i > 1 && string[i - 1] == '$' && string[i] == '!') + return (1); +#if defined (EXTENDED_GLOB) + else if (extended_glob && i > 1 && string[i+1] == '(' && member (')', string + i + 2)) + return (1); +#endif + else + return (0); +} + +void +bash_initialize_history () +{ + history_quotes_inhibit_expansion = 1; + history_search_delimiter_chars = ";&()|<>"; + history_inhibit_expansion_function = bash_history_inhibit_expansion; +#if defined (BANG_HISTORY) + sv_histchars ("histchars"); +#endif +} + +void +bash_history_reinit (interact) + int interact; +{ +#if defined (BANG_HISTORY) + history_expansion = interact != 0; + history_expansion_inhibited = 1; +#endif + remember_on_history = enable_history_list = interact != 0; + history_inhibit_expansion_function = bash_history_inhibit_expansion; +} + +void +bash_history_disable () +{ + remember_on_history = 0; +#if defined (BANG_HISTORY) + history_expansion_inhibited = 1; +#endif +} + +void +bash_history_enable () +{ + remember_on_history = 1; +#if defined (BANG_HISTORY) + history_expansion_inhibited = 0; +#endif + history_inhibit_expansion_function = bash_history_inhibit_expansion; + sv_history_control ("HISTCONTROL"); + sv_histignore ("HISTIGNORE"); +} + +/* Load the history list from the history file. */ +void +load_history () +{ + char *hf; + + /* Truncate history file for interactive shells which desire it. + Note that the history file is automatically truncated to the + size of HISTSIZE if the user does not explicitly set the size + differently. */ + set_if_not ("HISTSIZE", "500"); + sv_histsize ("HISTSIZE"); + + set_if_not ("HISTFILESIZE", get_string_value ("HISTSIZE")); + sv_histsize ("HISTFILESIZE"); + + /* Read the history in HISTFILE into the history list. */ + hf = get_string_value ("HISTFILE"); + + if (hf && *hf && file_exists (hf)) + { + read_history (hf); + using_history (); + history_lines_in_file = where_history (); + } +} + +void +bash_clear_history () +{ + clear_history (); + history_lines_this_session = 0; +} + +/* Delete and free the history list entry at offset I. */ +int +bash_delete_histent (i) + int i; +{ + HIST_ENTRY *discard; + + discard = remove_history (i); + if (discard) + free_history_entry (discard); + history_lines_this_session--; + + return 1; +} + +int +bash_delete_last_history () +{ + register int i; + HIST_ENTRY **hlist, *histent; + int r; + + hlist = history_list (); + if (hlist == NULL) + return 0; + + for (i = 0; hlist[i]; i++) + ; + i--; + + /* History_get () takes a parameter that must be offset by history_base. */ + histent = history_get (history_base + i); /* Don't free this */ + if (histent == NULL) + return 0; + + r = bash_delete_histent (i); + + if (where_history () > history_length) + history_set_pos (history_length); + + return r; +} + +#ifdef INCLUDE_UNUSED +/* Write the existing history out to the history file. */ +void +save_history () +{ + char *hf; + int r; + + hf = get_string_value ("HISTFILE"); + if (hf && *hf && file_exists (hf)) + { + /* Append only the lines that occurred this session to + the history file. */ + using_history (); + + if (history_lines_this_session <= where_history () || force_append_history) + r = append_history (history_lines_this_session, hf); + else + r = write_history (hf); + sv_histsize ("HISTFILESIZE"); + } +} +#endif + +int +maybe_append_history (filename) + char *filename; +{ + int fd, result; + struct stat buf; + + result = EXECUTION_SUCCESS; + if (history_lines_this_session && (history_lines_this_session <= where_history ())) + { + /* If the filename was supplied, then create it if necessary. */ + if (stat (filename, &buf) == -1 && errno == ENOENT) + { + fd = open (filename, O_WRONLY|O_CREAT, 0600); + if (fd < 0) + { + builtin_error (_("%s: cannot create: %s"), filename, strerror (errno)); + return (EXECUTION_FAILURE); + } + close (fd); + } + result = append_history (history_lines_this_session, filename); + history_lines_in_file += history_lines_this_session; + history_lines_this_session = 0; + } + return (result); +} + +/* If this is an interactive shell, then append the lines executed + this session to the history file. */ +int +maybe_save_shell_history () +{ + int result; + char *hf; + + result = 0; + if (history_lines_this_session) + { + hf = get_string_value ("HISTFILE"); + + if (hf && *hf) + { + /* If the file doesn't exist, then create it. */ + if (file_exists (hf) == 0) + { + int file; + file = open (hf, O_CREAT | O_TRUNC | O_WRONLY, 0600); + if (file != -1) + close (file); + } + + /* Now actually append the lines if the history hasn't been + stifled. If the history has been stifled, rewrite the + history file. */ + using_history (); + if (history_lines_this_session <= where_history () || force_append_history) + { + result = append_history (history_lines_this_session, hf); + history_lines_in_file += history_lines_this_session; + } + else + { + result = write_history (hf); + history_lines_in_file = history_lines_this_session; + } + history_lines_this_session = 0; + + sv_histsize ("HISTFILESIZE"); + } + } + return (result); +} + +#if defined (READLINE) +/* Tell readline () that we have some text for it to edit. */ +static void +re_edit (text) + char *text; +{ + if (bash_input.type == st_stdin) + bash_re_edit (text); +} +#endif /* READLINE */ + +/* Return 1 if this line needs history expansion. */ +static int +history_expansion_p (line) + char *line; +{ + register char *s; + + for (s = line; *s; s++) + if (*s == history_expansion_char || *s == history_subst_char) + return 1; + return 0; +} + +/* Do pre-processing on LINE. If PRINT_CHANGES is non-zero, then + print the results of expanding the line if there were any changes. + If there is an error, return NULL, otherwise the expanded line is + returned. If ADDIT is non-zero the line is added to the history + list after history expansion. ADDIT is just a suggestion; + REMEMBER_ON_HISTORY can veto, and does. + Right now this does history expansion. */ +char * +pre_process_line (line, print_changes, addit) + char *line; + int print_changes, addit; +{ + char *history_value; + char *return_value; + int expanded; + + return_value = line; + expanded = 0; + +# if defined (BANG_HISTORY) + /* History expand the line. If this results in no errors, then + add that line to the history if ADDIT is non-zero. */ + if (!history_expansion_inhibited && history_expansion && history_expansion_p (line)) + { + expanded = history_expand (line, &history_value); + + if (expanded) + { + if (print_changes) + { + if (expanded < 0) + internal_error ("%s", history_value); +#if defined (READLINE) + else if (hist_verify == 0 || expanded == 2) +#else + else +#endif + fprintf (stderr, "%s\n", history_value); + } + + /* If there was an error, return NULL. */ + if (expanded < 0 || expanded == 2) /* 2 == print only */ + { +# if defined (READLINE) + if (expanded == 2 && rl_dispatching == 0 && *history_value) +# else + if (expanded == 2 && *history_value) +# endif /* !READLINE */ + maybe_add_history (history_value); + + free (history_value); + +# if defined (READLINE) + /* New hack. We can allow the user to edit the + failed history expansion. */ + if (history_reediting && expanded < 0 && rl_done) + re_edit (line); +# endif /* READLINE */ + return ((char *)NULL); + } + +# if defined (READLINE) + if (hist_verify && expanded == 1) + { + re_edit (history_value); + return ((char *)NULL); + } +# endif + } + + /* Let other expansions know that return_value can be free'ed, + and that a line has been added to the history list. Note + that we only add lines that have something in them. */ + expanded = 1; + return_value = history_value; + } +# endif /* BANG_HISTORY */ + + if (addit && remember_on_history && *return_value) + maybe_add_history (return_value); + +#if 0 + if (expanded == 0) + return_value = savestring (line); +#endif + + return (return_value); +} + +/* Return 1 if the first non-whitespace character in LINE is a `#', indicating + * that the line is a shell comment. */ +static int +shell_comment (line) + char *line; +{ + char *p; + + for (p = line; p && *p && whitespace (*p); p++) + ; + return (p && *p == '#'); +} + +#ifdef INCLUDE_UNUSED +/* Remove shell comments from LINE. A `#' and anything after it is a comment. + This isn't really useful yet, since it doesn't handle quoting. */ +static char * +filter_comments (line) + char *line; +{ + char *p; + + for (p = line; p && *p && *p != '#'; p++) + ; + if (p && *p == '#') + *p = '\0'; + return (line); +} +#endif + +/* Check LINE against what HISTCONTROL says to do. Returns 1 if the line + should be saved; 0 if it should be discarded. */ +static int +check_history_control (line) + char *line; +{ + HIST_ENTRY *temp; + int r; + + if (history_control == 0) + return 1; + + /* ignorespace or ignoreboth */ + if ((history_control & HC_IGNSPACE) && *line == ' ') + return 0; + + /* ignoredups or ignoreboth */ + if (history_control & HC_IGNDUPS) + { + using_history (); + temp = previous_history (); + + r = (temp == 0 || STREQ (temp->line, line) == 0); + + using_history (); + + if (r == 0) + return r; + } + + return 1; +} + +/* Remove all entries matching LINE from the history list. Triggered when + HISTCONTROL includes `erasedups'. */ +static void +hc_erasedups (line) + char *line; +{ + HIST_ENTRY *temp; + int r; + + using_history (); + while (temp = previous_history ()) + { + if (STREQ (temp->line, line)) + { + r = where_history (); + remove_history (r); + } + } + using_history (); +} + +/* Add LINE to the history list, handling possibly multi-line compound + commands. We note whether or not we save the first line of each command + (which is usually the entire command and history entry), and don't add + the second and subsequent lines of a multi-line compound command if we + didn't save the first line. We don't usually save shell comment lines in + compound commands in the history, because they could have the effect of + commenting out the rest of the command when the entire command is saved as + a single history entry (when COMMAND_ORIENTED_HISTORY is enabled). If + LITERAL_HISTORY is set, we're saving lines in the history with embedded + newlines, so it's OK to save comment lines. If we're collecting the body + of a here-document, we should act as if literal_history is enabled, because + we want to save the entire contents of the here-document as it was + entered. We also make sure to save multiple-line quoted strings or other + constructs. */ +void +maybe_add_history (line) + char *line; +{ + hist_last_line_added = 0; + + /* Don't use the value of history_control to affect the second + and subsequent lines of a multi-line command (old code did + this only when command_oriented_history is enabled). */ + if (current_command_line_count > 1) + { + if (current_command_first_line_saved && + ((parser_state & PST_HEREDOC) || literal_history || dstack.delimiter_depth != 0 || shell_comment (line) == 0)) + bash_add_history (line); + return; + } + + /* This is the first line of a (possible multi-line) command. Note whether + or not we should save the first line and remember it. */ + current_command_first_line_saved = check_add_history (line, 0); +} + +/* Just check LINE against HISTCONTROL and HISTIGNORE and add it to the + history if it's OK. Used by `history -s' as well as maybe_add_history(). + Returns 1 if the line was saved in the history, 0 otherwise. */ +int +check_add_history (line, force) + char *line; + int force; +{ + if (check_history_control (line) && history_should_ignore (line) == 0) + { + /* We're committed to saving the line. If the user has requested it, + remove other matching lines from the history. */ + if (history_control & HC_ERASEDUPS) + hc_erasedups (line); + + if (force) + { + really_add_history (line); + using_history (); + } + else + bash_add_history (line); + return 1; + } + return 0; +} + +#if defined (SYSLOG_HISTORY) +#define SYSLOG_MAXLEN 600 + +void +bash_syslog_history (line) + const char *line; +{ + char trunc[SYSLOG_MAXLEN]; + + if (strlen(line) < SYSLOG_MAXLEN) + syslog (SYSLOG_FACILITY|SYSLOG_LEVEL, "HISTORY: PID=%d UID=%d %s", getpid(), current_user.uid, line); + else + { + strncpy (trunc, line, SYSLOG_MAXLEN); + trunc[SYSLOG_MAXLEN - 1] = '\0'; + syslog (SYSLOG_FACILITY|SYSLOG_LEVEL, "HISTORY (TRUNCATED): PID=%d UID=%d %s", getpid(), current_user.uid, trunc); + } +} +#endif + +/* Add a line to the history list. + The variable COMMAND_ORIENTED_HISTORY controls the style of history + remembering; when non-zero, and LINE is not the first line of a + complete parser construct, append LINE to the last history line instead + of adding it as a new line. */ +void +bash_add_history (line) + char *line; +{ + int add_it, offset, curlen; + HIST_ENTRY *current, *old; + char *chars_to_add, *new_line; + + add_it = 1; + if (command_oriented_history && current_command_line_count > 1) + { + /* The second and subsequent lines of a here document have the trailing + newline preserved. We don't want to add extra newlines here, but we + do want to add one after the first line (which is the command that + contains the here-doc specifier). parse.y:history_delimiting_chars() + does the right thing to take care of this for us. We don't want to + add extra newlines if the user chooses to enable literal_history, + so we have to duplicate some of what that function does here. */ + if ((parser_state & PST_HEREDOC) && literal_history && current_command_line_count > 2 && line[strlen (line) - 1] == '\n') + chars_to_add = ""; + else + chars_to_add = literal_history ? "\n" : history_delimiting_chars (line); + + using_history (); + current = previous_history (); + + if (current) + { + /* If the previous line ended with an escaped newline (escaped + with backslash, but otherwise unquoted), then remove the quoted + newline, since that is what happens when the line is parsed. */ + curlen = strlen (current->line); + + if (dstack.delimiter_depth == 0 && current->line[curlen - 1] == '\\' && + current->line[curlen - 2] != '\\') + { + current->line[curlen - 1] = '\0'; + curlen--; + chars_to_add = ""; + } + + /* If we're not in some kind of quoted construct, the current history + entry ends with a newline, and we're going to add a semicolon, + don't. In some cases, it results in a syntax error (e.g., before + a close brace), and it should not be needed. */ + if (dstack.delimiter_depth == 0 && current->line[curlen - 1] == '\n' && *chars_to_add == ';') + chars_to_add++; + + new_line = (char *)xmalloc (1 + + curlen + + strlen (line) + + strlen (chars_to_add)); + sprintf (new_line, "%s%s%s", current->line, chars_to_add, line); + offset = where_history (); + old = replace_history_entry (offset, new_line, current->data); + free (new_line); + + if (old) + free_history_entry (old); + + add_it = 0; + } + } + + if (add_it) + really_add_history (line); + +#if defined (SYSLOG_HISTORY) + bash_syslog_history (line); +#endif + + using_history (); +} + +static void +really_add_history (line) + char *line; +{ + hist_last_line_added = 1; + hist_last_line_pushed = 0; + add_history (line); + history_lines_this_session++; +} + +int +history_number () +{ + using_history (); + return (remember_on_history ? history_base + where_history () : 1); +} + +static int +should_expand (s) + char *s; +{ + char *p; + + for (p = s; p && *p; p++) + { + if (*p == '\\') + p++; + else if (*p == '&') + return 1; + } + return 0; +} + +static int +histignore_item_func (ign) + struct ign *ign; +{ + if (should_expand (ign->val)) + ign->flags |= HIGN_EXPAND; + return (0); +} + +void +setup_history_ignore (varname) + char *varname; +{ + setup_ignore_patterns (&histignore); +} + +static HIST_ENTRY * +last_history_entry () +{ + HIST_ENTRY *he; + + using_history (); + he = previous_history (); + using_history (); + return he; +} + +char * +last_history_line () +{ + HIST_ENTRY *he; + + he = last_history_entry (); + if (he == 0) + return ((char *)NULL); + return he->line; +} + +static char * +expand_histignore_pattern (pat) + char *pat; +{ + HIST_ENTRY *phe; + char *ret; + + phe = last_history_entry (); + + if (phe == (HIST_ENTRY *)0) + return (savestring (pat)); + + ret = strcreplace (pat, '&', phe->line, 1); + + return ret; +} + +/* Return 1 if we should not put LINE into the history according to the + patterns in HISTIGNORE. */ +static int +history_should_ignore (line) + char *line; +{ + register int i, match; + char *npat; + + if (histignore.num_ignores == 0) + return 0; + + for (i = match = 0; i < histignore.num_ignores; i++) + { + if (histignore.ignores[i].flags & HIGN_EXPAND) + npat = expand_histignore_pattern (histignore.ignores[i].val); + else + npat = histignore.ignores[i].val; + + match = strmatch (npat, line, FNMATCH_EXTFLAG) != FNM_NOMATCH; + + if (histignore.ignores[i].flags & HIGN_EXPAND) + free (npat); + + if (match) + break; + } + + return match; +} +#endif /* HISTORY */ diff --git a/bashhist.h b/bashhist.h new file mode 100644 index 0000000..c44e7c6 --- /dev/null +++ b/bashhist.h @@ -0,0 +1,71 @@ +/* bashhist.h -- interface to the bash history functions in bashhist.c. */ + +/* Copyright (C) 1993-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_BASHHIST_H_) +#define _BASHHIST_H_ + +#include "stdc.h" + +/* Flag values for history_control */ +#define HC_IGNSPACE 0x01 +#define HC_IGNDUPS 0x02 +#define HC_ERASEDUPS 0x04 + +#define HC_IGNBOTH (HC_IGNSPACE|HC_IGNDUPS) + +extern int remember_on_history; +extern int enable_history_list; /* value for `set -o history' */ +extern int literal_history; /* controlled by `shopt lithist' */ +extern int force_append_history; +extern int history_lines_this_session; +extern int history_lines_in_file; +extern int history_expansion; +extern int history_control; +extern int command_oriented_history; +extern int current_command_first_line_saved; +extern int hist_last_line_added; +extern int hist_last_line_pushed; + +# if defined (BANG_HISTORY) +extern int history_expansion_inhibited; +# endif /* BANG_HISTORY */ + +extern void bash_initialize_history __P((void)); +extern void bash_history_reinit __P((int)); +extern void bash_history_disable __P((void)); +extern void bash_history_enable __P((void)); +extern void bash_clear_history __P((void)); +extern int bash_delete_histent __P((int)); +extern int bash_delete_last_history __P((void)); +extern void load_history __P((void)); +extern void save_history __P((void)); +extern int maybe_append_history __P((char *)); +extern int maybe_save_shell_history __P((void)); +extern char *pre_process_line __P((char *, int, int)); +extern void maybe_add_history __P((char *)); +extern void bash_add_history __P((char *)); +extern int check_add_history __P((char *, int)); +extern int history_number __P((void)); + +extern void setup_history_ignore __P((char *)); + +extern char *last_history_line __P((void)); + +#endif /* _BASHHIST_H_ */ diff --git a/bashintl.h b/bashintl.h new file mode 100644 index 0000000..7e6b83f --- /dev/null +++ b/bashintl.h @@ -0,0 +1,50 @@ +/* bashintl.h -- Internationalization functions and defines. */ + +/* Copyright (C) 1996-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_BASHINTL_H_) +#define _BASHINTL_H_ + +#if defined (BUILDTOOL) +# undef ENABLE_NLS +# define ENABLE_NLS 0 +#endif + +/* Include this *after* config.h */ +#include "gettext.h" + +#if defined (HAVE_LOCALE_H) +# include +#endif + +#define _(msgid) gettext(msgid) +#define N_(msgid) msgid +#define D_(d, msgid) dgettext(d, msgid) + +#define P_(m1, m2, n) ngettext(m1, m2, n) + +#if defined (HAVE_SETLOCALE) && !defined (LC_ALL) +# undef HAVE_SETLOCALE +#endif + +#if !defined (HAVE_SETLOCALE) +# define setlocale(cat, loc) +#endif + +#endif /* !_BASHINTL_H_ */ diff --git a/bashjmp.h b/bashjmp.h new file mode 100644 index 0000000..c26053d --- /dev/null +++ b/bashjmp.h @@ -0,0 +1,43 @@ +/* bashjmp.h -- wrapper for setjmp.h with necessary bash definitions. */ + +/* Copyright (C) 1987-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _BASHJMP_H_ +#define _BASHJMP_H_ + +#include "posixjmp.h" + +extern procenv_t top_level; +extern procenv_t subshell_top_level; +extern procenv_t return_catch; /* used by `return' builtin */ + +#define SHFUNC_RETURN() longjmp (return_catch, 1) + +#define COPY_PROCENV(old, save) \ + xbcopy ((char *)old, (char *)save, sizeof (procenv_t)); + +/* Values for the second argument to longjmp/siglongjmp. */ +#define NOT_JUMPED 0 /* Not returning from a longjmp. */ +#define FORCE_EOF 1 /* We want to stop parsing. */ +#define DISCARD 2 /* Discard current command. */ +#define EXITPROG 3 /* Unconditionally exit the program now. */ +#define ERREXIT 4 /* Exit due to error condition */ +#define SIGEXIT 5 /* Exit due to fatal terminating signal */ + +#endif /* _BASHJMP_H_ */ diff --git a/bashline.c b/bashline.c new file mode 100644 index 0000000..3ff47d5 --- /dev/null +++ b/bashline.c @@ -0,0 +1,4219 @@ +/* bashline.c -- Bash's interface to the readline library. */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#if defined (READLINE) + +#include "bashtypes.h" +#include "posixstat.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (HAVE_GRP_H) +# include +#endif + +#if defined (HAVE_NETDB_H) +# include +#endif + +#include + +#include +#include "chartypes.h" +#include "bashansi.h" +#include "bashintl.h" + +#include "shell.h" +#include "input.h" +#include "builtins.h" +#include "bashhist.h" +#include "bashline.h" +#include "execute_cmd.h" +#include "findcmd.h" +#include "pathexp.h" +#include "shmbutil.h" +#include "trap.h" + +#include "builtins/common.h" + +#include +#include +#include + +#include + +#if defined (ALIAS) +# include "alias.h" +#endif + +#if defined (PROGRAMMABLE_COMPLETION) +# include "pcomplete.h" +#endif + +/* These should agree with the defines for emacs_mode and vi_mode in + rldefs.h, even though that's not a public readline header file. */ +#ifndef EMACS_EDITING_MODE +# define NO_EDITING_MODE -1 +# define EMACS_EDITING_MODE 1 +# define VI_EDITING_MODE 0 +#endif + +#define RL_BOOLEAN_VARIABLE_VALUE(s) ((s)[0] == 'o' && (s)[1] == 'n' && (s)[2] == '\0') + +#if defined (BRACE_COMPLETION) +extern int bash_brace_completion __P((int, int)); +#endif /* BRACE_COMPLETION */ + +/* To avoid including curses.h/term.h/termcap.h and that whole mess. */ +#ifdef _MINIX +extern int tputs __P((const char *string, int nlines, void (*outx)(int))); +#else +extern int tputs __P((const char *string, int nlines, int (*outx)(int))); +#endif + +/* Forward declarations */ + +/* Functions bound to keys in Readline for Bash users. */ +static int shell_expand_line __P((int, int)); +static int display_shell_version __P((int, int)); +static int operate_and_get_next __P((int, int)); + +static int bash_ignore_filenames __P((char **)); +static int bash_ignore_everything __P((char **)); + +#if defined (BANG_HISTORY) +static char *history_expand_line_internal __P((char *)); +static int history_expand_line __P((int, int)); +static int tcsh_magic_space __P((int, int)); +#endif /* BANG_HISTORY */ +#ifdef ALIAS +static int alias_expand_line __P((int, int)); +#endif +#if defined (BANG_HISTORY) && defined (ALIAS) +static int history_and_alias_expand_line __P((int, int)); +#endif + +static int bash_forward_shellword __P((int, int)); +static int bash_backward_shellword __P((int, int)); +static int bash_kill_shellword __P((int, int)); +static int bash_backward_kill_shellword __P((int, int)); + +/* Helper functions for Readline. */ +static char *restore_tilde __P((char *, char *)); +static char *maybe_restore_tilde __P((char *, char *)); + +static char *bash_filename_rewrite_hook __P((char *, int)); + +static void bash_directory_expansion __P((char **)); +static int bash_filename_stat_hook __P((char **)); +static int bash_command_name_stat_hook __P((char **)); +static int bash_directory_completion_hook __P((char **)); +static int filename_completion_ignore __P((char **)); +static int bash_push_line __P((void)); + +static int executable_completion __P((const char *, int)); + +static rl_icppfunc_t *save_directory_hook __P((void)); +static void restore_directory_hook __P((rl_icppfunc_t)); + +static void cleanup_expansion_error __P((void)); +static void maybe_make_readline_line __P((char *)); +static void set_up_new_line __P((char *)); + +static int check_redir __P((int)); +static char **attempt_shell_completion __P((const char *, int, int)); +static char *variable_completion_function __P((const char *, int)); +static char *hostname_completion_function __P((const char *, int)); +static char *command_subst_completion_function __P((const char *, int)); + +static void build_history_completion_array __P((void)); +static char *history_completion_generator __P((const char *, int)); +static int dynamic_complete_history __P((int, int)); +static int bash_dabbrev_expand __P((int, int)); + +static void initialize_hostname_list __P((void)); +static void add_host_name __P((char *)); +static void snarf_hosts_from_file __P((char *)); +static char **hostnames_matching __P((char *)); + +static void _ignore_completion_names __P((char **, sh_ignore_func_t *)); +static int name_is_acceptable __P((const char *)); +static int test_for_directory __P((const char *)); +static int return_zero __P((const char *)); + +static char *bash_dequote_filename __P((char *, int)); +static char *quote_word_break_chars __P((char *)); +static void set_filename_bstab __P((const char *)); +static char *bash_quote_filename __P((char *, int, char *)); + +#ifdef _MINIX +static void putx __P((int)); +#else +static int putx __P((int)); +#endif +static int bash_execute_unix_command __P((int, int)); +static void init_unix_command_map __P((void)); +static int isolate_sequence __P((char *, int, int, int *)); + +static int set_saved_history __P((void)); + +#if defined (ALIAS) +static int posix_edit_macros __P((int, int)); +#endif + +static int bash_event_hook __P((void)); + +#if defined (PROGRAMMABLE_COMPLETION) +static int find_cmd_start __P((int)); +static int find_cmd_end __P((int)); +static char *find_cmd_name __P((int, int *, int *)); +static char *prog_complete_return __P((const char *, int)); + +static char **prog_complete_matches; +#endif + +/* Variables used here but defined in other files. */ +#if defined (BANG_HISTORY) +extern int hist_verify; +#endif + +extern int current_command_line_count, saved_command_line_count; +extern int last_command_exit_value; +extern int array_needs_making; +extern int posixly_correct, no_symbolic_links; +extern char *current_prompt_string, *ps1_prompt; +extern STRING_INT_ALIST word_token_alist[]; +extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin; + +/* SPECIFIC_COMPLETION_FUNCTIONS specifies that we have individual + completion functions which indicate what type of completion should be + done (at or before point) that can be bound to key sequences with + the readline library. */ +#define SPECIFIC_COMPLETION_FUNCTIONS + +#if defined (SPECIFIC_COMPLETION_FUNCTIONS) +static int bash_specific_completion __P((int, rl_compentry_func_t *)); + +static int bash_complete_filename_internal __P((int)); +static int bash_complete_username_internal __P((int)); +static int bash_complete_hostname_internal __P((int)); +static int bash_complete_variable_internal __P((int)); +static int bash_complete_command_internal __P((int)); + +static int bash_complete_filename __P((int, int)); +static int bash_possible_filename_completions __P((int, int)); +static int bash_complete_username __P((int, int)); +static int bash_possible_username_completions __P((int, int)); +static int bash_complete_hostname __P((int, int)); +static int bash_possible_hostname_completions __P((int, int)); +static int bash_complete_variable __P((int, int)); +static int bash_possible_variable_completions __P((int, int)); +static int bash_complete_command __P((int, int)); +static int bash_possible_command_completions __P((int, int)); + +static char *glob_complete_word __P((const char *, int)); +static int bash_glob_completion_internal __P((int)); +static int bash_glob_complete_word __P((int, int)); +static int bash_glob_expand_word __P((int, int)); +static int bash_glob_list_expansions __P((int, int)); + +#endif /* SPECIFIC_COMPLETION_FUNCTIONS */ + +static int edit_and_execute_command __P((int, int, int, char *)); +#if defined (VI_MODE) +static int vi_edit_and_execute_command __P((int, int)); +static int bash_vi_complete __P((int, int)); +#endif +static int emacs_edit_and_execute_command __P((int, int)); + +/* Non-zero once initalize_readline () has been called. */ +int bash_readline_initialized = 0; + +/* If non-zero, we do hostname completion, breaking words at `@' and + trying to complete the stuff after the `@' from our own internal + host list. */ +int perform_hostname_completion = 1; + +/* If non-zero, we don't do command completion on an empty line. */ +int no_empty_command_completion; + +/* Set FORCE_FIGNORE if you want to honor FIGNORE even if it ignores the + only possible matches. Set to 0 if you want to match filenames if they + are the only possible matches, even if FIGNORE says to. */ +int force_fignore = 1; + +/* Perform spelling correction on directory names during word completion */ +int dircomplete_spelling = 0; + +/* Expand directory names during word/filename completion. */ +#if DIRCOMPLETE_EXPAND_DEFAULT +int dircomplete_expand = 1; +int dircomplete_expand_relpath = 1; +#else +int dircomplete_expand = 0; +int dircomplete_expand_relpath = 0; +#endif + +/* When non-zero, perform `normal' shell quoting on completed filenames + even when the completed name contains a directory name with a shell + variable referene, so dollar signs in a filename get quoted appropriately. + Set to zero to remove dollar sign (and braces or parens as needed) from + the set of characters that will be quoted. */ +int complete_fullquote = 1; + +static char *bash_completer_word_break_characters = " \t\n\"'@><=;|&(:"; +static char *bash_nohostname_word_break_characters = " \t\n\"'><=;|&(:"; +/* )) */ + +static const char *default_filename_quote_characters = " \t\n\\\"'@<>=;|&()#$`?*[!:{~"; /*}*/ +static char *custom_filename_quote_characters = 0; +static char filename_bstab[256]; + +static rl_hook_func_t *old_rl_startup_hook = (rl_hook_func_t *)NULL; + +static int dot_in_path = 0; + +/* Set to non-zero when dabbrev-expand is running */ +static int dabbrev_expand_active = 0; + +/* What kind of quoting is performed by bash_quote_filename: + COMPLETE_DQUOTE = double-quoting the filename + COMPLETE_SQUOTE = single_quoting the filename + COMPLETE_BSQUOTE = backslash-quoting special chars in the filename +*/ +#define COMPLETE_DQUOTE 1 +#define COMPLETE_SQUOTE 2 +#define COMPLETE_BSQUOTE 3 +static int completion_quoting_style = COMPLETE_BSQUOTE; + +/* Flag values for the final argument to bash_default_completion */ +#define DEFCOMP_CMDPOS 1 + +/* Change the readline VI-mode keymaps into or out of Posix.2 compliance. + Called when the shell is put into or out of `posix' mode. */ +void +posix_readline_initialize (on_or_off) + int on_or_off; +{ + if (on_or_off) + rl_variable_bind ("comment-begin", "#"); +#if defined (VI_MODE) + rl_bind_key_in_map (CTRL ('I'), on_or_off ? rl_insert : rl_complete, vi_insertion_keymap); +#endif +} + +void +reset_completer_word_break_chars () +{ + rl_completer_word_break_characters = perform_hostname_completion ? savestring (bash_completer_word_break_characters) : savestring (bash_nohostname_word_break_characters); +} + +/* When this function returns, rl_completer_word_break_characters points to + dynamically allocated memory. */ +int +enable_hostname_completion (on_or_off) + int on_or_off; +{ + int old_value; + char *at, *nv, *nval; + + old_value = perform_hostname_completion; + + if (on_or_off) + { + perform_hostname_completion = 1; + rl_special_prefixes = "$@"; + } + else + { + perform_hostname_completion = 0; + rl_special_prefixes = "$"; + } + + /* Now we need to figure out how to appropriately modify and assign + rl_completer_word_break_characters depending on whether we want + hostname completion on or off. */ + + /* If this is the first time this has been called + (bash_readline_initialized == 0), use the sames values as before, but + allocate new memory for rl_completer_word_break_characters. */ + + if (bash_readline_initialized == 0 && + (rl_completer_word_break_characters == 0 || + rl_completer_word_break_characters == rl_basic_word_break_characters)) + { + if (on_or_off) + rl_completer_word_break_characters = savestring (bash_completer_word_break_characters); + else + rl_completer_word_break_characters = savestring (bash_nohostname_word_break_characters); + } + else + { + /* See if we have anything to do. */ + at = strchr (rl_completer_word_break_characters, '@'); + if ((at == 0 && on_or_off == 0) || (at != 0 && on_or_off != 0)) + return old_value; + + /* We have something to do. Do it. */ + nval = (char *)xmalloc (strlen (rl_completer_word_break_characters) + 1 + on_or_off); + + if (on_or_off == 0) + { + /* Turn it off -- just remove `@' from word break chars. We want + to remove all occurrences of `@' from the char list, so we loop + rather than just copy the rest of the list over AT. */ + for (nv = nval, at = rl_completer_word_break_characters; *at; ) + if (*at != '@') + *nv++ = *at++; + else + at++; + *nv = '\0'; + } + else + { + nval[0] = '@'; + strcpy (nval + 1, rl_completer_word_break_characters); + } + + free (rl_completer_word_break_characters); + rl_completer_word_break_characters = nval; + } + + return (old_value); +} + +/* Called once from parse.y if we are going to use readline. */ +void +initialize_readline () +{ + rl_command_func_t *func; + char kseq[2]; + + if (bash_readline_initialized) + return; + + rl_terminal_name = get_string_value ("TERM"); + rl_instream = stdin; + rl_outstream = stderr; + + /* Allow conditional parsing of the ~/.inputrc file. */ + rl_readline_name = "Bash"; + + /* Add bindable names before calling rl_initialize so they may be + referenced in the various inputrc files. */ + rl_add_defun ("shell-expand-line", shell_expand_line, -1); +#ifdef BANG_HISTORY + rl_add_defun ("history-expand-line", history_expand_line, -1); + rl_add_defun ("magic-space", tcsh_magic_space, -1); +#endif + + rl_add_defun ("shell-forward-word", bash_forward_shellword, -1); + rl_add_defun ("shell-backward-word", bash_backward_shellword, -1); + rl_add_defun ("shell-kill-word", bash_kill_shellword, -1); + rl_add_defun ("shell-backward-kill-word", bash_backward_kill_shellword, -1); + +#ifdef ALIAS + rl_add_defun ("alias-expand-line", alias_expand_line, -1); +# ifdef BANG_HISTORY + rl_add_defun ("history-and-alias-expand-line", history_and_alias_expand_line, -1); +# endif +#endif + + /* Backwards compatibility. */ + rl_add_defun ("insert-last-argument", rl_yank_last_arg, -1); + + rl_add_defun ("operate-and-get-next", operate_and_get_next, -1); + rl_add_defun ("display-shell-version", display_shell_version, -1); + rl_add_defun ("edit-and-execute-command", emacs_edit_and_execute_command, -1); + +#if defined (BRACE_COMPLETION) + rl_add_defun ("complete-into-braces", bash_brace_completion, -1); +#endif + +#if defined (SPECIFIC_COMPLETION_FUNCTIONS) + rl_add_defun ("complete-filename", bash_complete_filename, -1); + rl_add_defun ("possible-filename-completions", bash_possible_filename_completions, -1); + rl_add_defun ("complete-username", bash_complete_username, -1); + rl_add_defun ("possible-username-completions", bash_possible_username_completions, -1); + rl_add_defun ("complete-hostname", bash_complete_hostname, -1); + rl_add_defun ("possible-hostname-completions", bash_possible_hostname_completions, -1); + rl_add_defun ("complete-variable", bash_complete_variable, -1); + rl_add_defun ("possible-variable-completions", bash_possible_variable_completions, -1); + rl_add_defun ("complete-command", bash_complete_command, -1); + rl_add_defun ("possible-command-completions", bash_possible_command_completions, -1); + rl_add_defun ("glob-complete-word", bash_glob_complete_word, -1); + rl_add_defun ("glob-expand-word", bash_glob_expand_word, -1); + rl_add_defun ("glob-list-expansions", bash_glob_list_expansions, -1); +#endif + + rl_add_defun ("dynamic-complete-history", dynamic_complete_history, -1); + rl_add_defun ("dabbrev-expand", bash_dabbrev_expand, -1); + + /* Bind defaults before binding our custom shell keybindings. */ + if (RL_ISSTATE(RL_STATE_INITIALIZED) == 0) + rl_initialize (); + + /* Bind up our special shell functions. */ + rl_bind_key_if_unbound_in_map (CTRL('E'), shell_expand_line, emacs_meta_keymap); + +#ifdef BANG_HISTORY + rl_bind_key_if_unbound_in_map ('^', history_expand_line, emacs_meta_keymap); +#endif + + rl_bind_key_if_unbound_in_map (CTRL ('O'), operate_and_get_next, emacs_standard_keymap); + rl_bind_key_if_unbound_in_map (CTRL ('V'), display_shell_version, emacs_ctlx_keymap); + + /* In Bash, the user can switch editing modes with "set -o [vi emacs]", + so it is not necessary to allow C-M-j for context switching. Turn + off this occasionally confusing behaviour. */ + kseq[0] = CTRL('J'); + kseq[1] = '\0'; + func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL); + if (func == rl_vi_editing_mode) + rl_unbind_key_in_map (CTRL('J'), emacs_meta_keymap); + kseq[0] = CTRL('M'); + func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL); + if (func == rl_vi_editing_mode) + rl_unbind_key_in_map (CTRL('M'), emacs_meta_keymap); +#if defined (VI_MODE) + rl_unbind_key_in_map (CTRL('E'), vi_movement_keymap); +#endif + +#if defined (BRACE_COMPLETION) + rl_bind_key_if_unbound_in_map ('{', bash_brace_completion, emacs_meta_keymap); /*}*/ +#endif /* BRACE_COMPLETION */ + +#if defined (SPECIFIC_COMPLETION_FUNCTIONS) + rl_bind_key_if_unbound_in_map ('/', bash_complete_filename, emacs_meta_keymap); + rl_bind_key_if_unbound_in_map ('/', bash_possible_filename_completions, emacs_ctlx_keymap); + + /* Have to jump through hoops here because there is a default binding for + M-~ (rl_tilde_expand) */ + kseq[0] = '~'; + kseq[1] = '\0'; + func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL); + if (func == 0 || func == rl_tilde_expand) + rl_bind_keyseq_in_map (kseq, bash_complete_username, emacs_meta_keymap); + + rl_bind_key_if_unbound_in_map ('~', bash_possible_username_completions, emacs_ctlx_keymap); + + rl_bind_key_if_unbound_in_map ('@', bash_complete_hostname, emacs_meta_keymap); + rl_bind_key_if_unbound_in_map ('@', bash_possible_hostname_completions, emacs_ctlx_keymap); + + rl_bind_key_if_unbound_in_map ('$', bash_complete_variable, emacs_meta_keymap); + rl_bind_key_if_unbound_in_map ('$', bash_possible_variable_completions, emacs_ctlx_keymap); + + rl_bind_key_if_unbound_in_map ('!', bash_complete_command, emacs_meta_keymap); + rl_bind_key_if_unbound_in_map ('!', bash_possible_command_completions, emacs_ctlx_keymap); + + rl_bind_key_if_unbound_in_map ('g', bash_glob_complete_word, emacs_meta_keymap); + rl_bind_key_if_unbound_in_map ('*', bash_glob_expand_word, emacs_ctlx_keymap); + rl_bind_key_if_unbound_in_map ('g', bash_glob_list_expansions, emacs_ctlx_keymap); + +#endif /* SPECIFIC_COMPLETION_FUNCTIONS */ + + kseq[0] = TAB; + kseq[1] = '\0'; + func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL); + if (func == 0 || func == rl_tab_insert) + rl_bind_key_in_map (TAB, dynamic_complete_history, emacs_meta_keymap); + + /* Tell the completer that we want a crack first. */ + rl_attempted_completion_function = attempt_shell_completion; + + /* Tell the completer that we might want to follow symbolic links or + do other expansion on directory names. */ + set_directory_hook (); + + rl_filename_rewrite_hook = bash_filename_rewrite_hook; + + rl_filename_stat_hook = bash_filename_stat_hook; + + /* Tell the filename completer we want a chance to ignore some names. */ + rl_ignore_some_completions_function = filename_completion_ignore; + + /* Bind C-xC-e to invoke emacs and run result as commands. */ + rl_bind_key_if_unbound_in_map (CTRL ('E'), emacs_edit_and_execute_command, emacs_ctlx_keymap); +#if defined (VI_MODE) + rl_bind_key_if_unbound_in_map ('v', vi_edit_and_execute_command, vi_movement_keymap); +# if defined (ALIAS) + rl_bind_key_if_unbound_in_map ('@', posix_edit_macros, vi_movement_keymap); +# endif + + rl_bind_key_in_map ('\\', bash_vi_complete, vi_movement_keymap); + rl_bind_key_in_map ('*', bash_vi_complete, vi_movement_keymap); + rl_bind_key_in_map ('=', bash_vi_complete, vi_movement_keymap); +#endif + + rl_completer_quote_characters = "'\""; + + /* This sets rl_completer_word_break_characters and rl_special_prefixes + to the appropriate values, depending on whether or not hostname + completion is enabled. */ + enable_hostname_completion (perform_hostname_completion); + + /* characters that need to be quoted when appearing in filenames. */ + rl_filename_quote_characters = default_filename_quote_characters; + set_filename_bstab (rl_filename_quote_characters); + + rl_filename_quoting_function = bash_quote_filename; + rl_filename_dequoting_function = bash_dequote_filename; + rl_char_is_quoted_p = char_is_quoted; + +#if 0 + /* This is superfluous and makes it impossible to use tab completion in + vi mode even when explicitly binding it in ~/.inputrc. sv_strict_posix() + should already have called posix_readline_initialize() when + posixly_correct was set. */ + if (posixly_correct) + posix_readline_initialize (1); +#endif + + bash_readline_initialized = 1; +} + +void +bashline_reinitialize () +{ + bash_readline_initialized = 0; +} + +void +bashline_set_event_hook () +{ + rl_signal_event_hook = bash_event_hook; +} + +void +bashline_reset_event_hook () +{ + rl_signal_event_hook = 0; +} + +/* On Sun systems at least, rl_attempted_completion_function can end up + getting set to NULL, and rl_completion_entry_function set to do command + word completion if Bash is interrupted while trying to complete a command + word. This just resets all the completion functions to the right thing. + It's called from throw_to_top_level(). */ +void +bashline_reset () +{ + tilde_initialize (); + rl_attempted_completion_function = attempt_shell_completion; + rl_completion_entry_function = NULL; + rl_ignore_some_completions_function = filename_completion_ignore; + rl_filename_quote_characters = default_filename_quote_characters; + set_filename_bstab (rl_filename_quote_characters); + + set_directory_hook (); + rl_filename_stat_hook = bash_filename_stat_hook; + + bashline_reset_event_hook (); +} + +/* Contains the line to push into readline. */ +static char *push_to_readline = (char *)NULL; + +/* Push the contents of push_to_readline into the + readline buffer. */ +static int +bash_push_line () +{ + if (push_to_readline) + { + rl_insert_text (push_to_readline); + free (push_to_readline); + push_to_readline = (char *)NULL; + rl_startup_hook = old_rl_startup_hook; + } + return 0; +} + +/* Call this to set the initial text for the next line to read + from readline. */ +int +bash_re_edit (line) + char *line; +{ + FREE (push_to_readline); + + push_to_readline = savestring (line); + old_rl_startup_hook = rl_startup_hook; + rl_startup_hook = bash_push_line; + + return (0); +} + +static int +display_shell_version (count, c) + int count, c; +{ + rl_crlf (); + show_shell_version (0); + putc ('\r', rl_outstream); + fflush (rl_outstream); + rl_on_new_line (); + rl_redisplay (); + return 0; +} + +/* **************************************************************** */ +/* */ +/* Readline Stuff */ +/* */ +/* **************************************************************** */ + +/* If the user requests hostname completion, then simply build a list + of hosts, and complete from that forever more, or at least until + HOSTFILE is unset. */ + +/* THIS SHOULD BE A STRINGLIST. */ +/* The kept list of hostnames. */ +static char **hostname_list = (char **)NULL; + +/* The physical size of the above list. */ +static int hostname_list_size; + +/* The number of hostnames in the above list. */ +static int hostname_list_length; + +/* Whether or not HOSTNAME_LIST has been initialized. */ +int hostname_list_initialized = 0; + +/* Initialize the hostname completion table. */ +static void +initialize_hostname_list () +{ + char *temp; + + temp = get_string_value ("HOSTFILE"); + if (temp == 0) + temp = get_string_value ("hostname_completion_file"); + if (temp == 0) + temp = DEFAULT_HOSTS_FILE; + + snarf_hosts_from_file (temp); + + if (hostname_list) + hostname_list_initialized++; +} + +/* Add NAME to the list of hosts. */ +static void +add_host_name (name) + char *name; +{ + if (hostname_list_length + 2 > hostname_list_size) + { + hostname_list_size = (hostname_list_size + 32) - (hostname_list_size % 32); + hostname_list = strvec_resize (hostname_list, hostname_list_size); + } + + hostname_list[hostname_list_length++] = savestring (name); + hostname_list[hostname_list_length] = (char *)NULL; +} + +#define cr_whitespace(c) ((c) == '\r' || (c) == '\n' || whitespace(c)) + +static void +snarf_hosts_from_file (filename) + char *filename; +{ + FILE *file; + char *temp, buffer[256], name[256]; + register int i, start; + + file = fopen (filename, "r"); + if (file == 0) + return; + + while (temp = fgets (buffer, 255, file)) + { + /* Skip to first character. */ + for (i = 0; buffer[i] && cr_whitespace (buffer[i]); i++) + ; + + /* If comment or blank line, ignore. */ + if (buffer[i] == '\0' || buffer[i] == '#') + continue; + + /* If `preprocessor' directive, do the include. */ + if (strncmp (buffer + i, "$include ", 9) == 0) + { + char *incfile, *t; + + /* Find start of filename. */ + for (incfile = buffer + i + 9; *incfile && whitespace (*incfile); incfile++) + ; + + /* Find end of filename. */ + for (t = incfile; *t && cr_whitespace (*t) == 0; t++) + ; + + *t = '\0'; + + snarf_hosts_from_file (incfile); + continue; + } + + /* Skip internet address if present. */ + if (DIGIT (buffer[i])) + for (; buffer[i] && cr_whitespace (buffer[i]) == 0; i++); + + /* Gobble up names. Each name is separated with whitespace. */ + while (buffer[i]) + { + for (; cr_whitespace (buffer[i]); i++) + ; + if (buffer[i] == '\0' || buffer[i] == '#') + break; + + /* Isolate the current word. */ + for (start = i; buffer[i] && cr_whitespace (buffer[i]) == 0; i++) + ; + if (i == start) + continue; + strncpy (name, buffer + start, i - start); + name[i - start] = '\0'; + add_host_name (name); + } + } + fclose (file); +} + +/* Return the hostname list. */ +char ** +get_hostname_list () +{ + if (hostname_list_initialized == 0) + initialize_hostname_list (); + return (hostname_list); +} + +void +clear_hostname_list () +{ + register int i; + + if (hostname_list_initialized == 0) + return; + for (i = 0; i < hostname_list_length; i++) + free (hostname_list[i]); + hostname_list_length = hostname_list_initialized = 0; +} + +/* Return a NULL terminated list of hostnames which begin with TEXT. + Initialize the hostname list the first time if necessary. + The array is malloc ()'ed, but not the individual strings. */ +static char ** +hostnames_matching (text) + char *text; +{ + register int i, len, nmatch, rsize; + char **result; + + if (hostname_list_initialized == 0) + initialize_hostname_list (); + + if (hostname_list_initialized == 0) + return ((char **)NULL); + + /* Special case. If TEXT consists of nothing, then the whole list is + what is desired. */ + if (*text == '\0') + { + result = strvec_create (1 + hostname_list_length); + for (i = 0; i < hostname_list_length; i++) + result[i] = hostname_list[i]; + result[i] = (char *)NULL; + return (result); + } + + /* Scan until found, or failure. */ + len = strlen (text); + result = (char **)NULL; + for (i = nmatch = rsize = 0; i < hostname_list_length; i++) + { + if (STREQN (text, hostname_list[i], len) == 0) + continue; + + /* OK, it matches. Add it to the list. */ + if (nmatch >= (rsize - 1)) + { + rsize = (rsize + 16) - (rsize % 16); + result = strvec_resize (result, rsize); + } + + result[nmatch++] = hostname_list[i]; + } + if (nmatch) + result[nmatch] = (char *)NULL; + return (result); +} + +/* The equivalent of the Korn shell C-o operate-and-get-next-history-line + editing command. */ +static int saved_history_line_to_use = -1; +static int last_saved_history_line = -1; + +#define HISTORY_FULL() (history_is_stifled () && history_length >= history_max_entries) + +static int +set_saved_history () +{ + /* XXX - compensate for assumption that history was `shuffled' if it was + actually not. */ + if (HISTORY_FULL () && + hist_last_line_added == 0 && + saved_history_line_to_use < history_length - 1) + saved_history_line_to_use++; + + if (saved_history_line_to_use >= 0) + { + rl_get_previous_history (history_length - saved_history_line_to_use, 0); + last_saved_history_line = saved_history_line_to_use; + } + saved_history_line_to_use = -1; + rl_startup_hook = old_rl_startup_hook; + return (0); +} + +static int +operate_and_get_next (count, c) + int count, c; +{ + int where; + + /* Accept the current line. */ + rl_newline (1, c); + + /* Find the current line, and find the next line to use. */ + where = where_history (); + + if (HISTORY_FULL () || (where >= history_length - 1)) + saved_history_line_to_use = where; + else + saved_history_line_to_use = where + 1; + + old_rl_startup_hook = rl_startup_hook; + rl_startup_hook = set_saved_history; + + return 0; +} + +/* This vi mode command causes VI_EDIT_COMMAND to be run on the current + command being entered (if no explicit argument is given), otherwise on + a command from the history file. */ + +#define VI_EDIT_COMMAND "fc -e \"${VISUAL:-${EDITOR:-$(command -v editor || echo vi)}}\"" +#define EMACS_EDIT_COMMAND "fc -e \"${VISUAL:-${EDITOR:-$(command -v editor || echo emacs)}}\"" +#define POSIX_VI_EDIT_COMMAND "fc -e vi" + +static int +edit_and_execute_command (count, c, editing_mode, edit_command) + int count, c, editing_mode; + char *edit_command; +{ + char *command, *metaval; + int r, rrs, metaflag; + sh_parser_state_t ps; + + rrs = rl_readline_state; + saved_command_line_count = current_command_line_count; + + /* Accept the current line. */ + rl_newline (1, c); + + if (rl_explicit_arg) + { + command = (char *)xmalloc (strlen (edit_command) + 8); + sprintf (command, "%s %d", edit_command, count); + } + else + { + /* Take the command we were just editing, add it to the history file, + then call fc to operate on it. We have to add a dummy command to + the end of the history because fc ignores the last command (assumes + it's supposed to deal with the command before the `fc'). */ + /* This breaks down when using command-oriented history and are not + finished with the command, so we should not ignore the last command */ + using_history (); + current_command_line_count++; /* for rl_newline above */ + bash_add_history (rl_line_buffer); + current_command_line_count = 0; /* for dummy history entry */ + bash_add_history (""); + history_lines_this_session++; + using_history (); + command = savestring (edit_command); + } + + metaval = rl_variable_value ("input-meta"); + metaflag = RL_BOOLEAN_VARIABLE_VALUE (metaval); + + /* Now, POSIX.1-2001 and SUSv3 say that the commands executed from the + temporary file should be placed into the history. We don't do that + yet. */ + if (rl_deprep_term_function) + (*rl_deprep_term_function) (); + save_parser_state (&ps); + r = parse_and_execute (command, (editing_mode == VI_EDITING_MODE) ? "v" : "C-xC-e", SEVAL_NOHIST); + restore_parser_state (&ps); + if (rl_prep_term_function) + (*rl_prep_term_function) (metaflag); + + current_command_line_count = saved_command_line_count; + + /* Now erase the contents of the current line and undo the effects of the + rl_accept_line() above. We don't even want to make the text we just + executed available for undoing. */ + rl_line_buffer[0] = '\0'; /* XXX */ + rl_point = rl_end = 0; + rl_done = 0; + rl_readline_state = rrs; + + rl_forced_update_display (); + + return r; +} + +#if defined (VI_MODE) +static int +vi_edit_and_execute_command (count, c) + int count, c; +{ + if (posixly_correct) + return (edit_and_execute_command (count, c, VI_EDITING_MODE, POSIX_VI_EDIT_COMMAND)); + else + return (edit_and_execute_command (count, c, VI_EDITING_MODE, VI_EDIT_COMMAND)); +} +#endif /* VI_MODE */ + +static int +emacs_edit_and_execute_command (count, c) + int count, c; +{ + return (edit_and_execute_command (count, c, EMACS_EDITING_MODE, EMACS_EDIT_COMMAND)); +} + +#if defined (ALIAS) +static int +posix_edit_macros (count, key) + int count, key; +{ + int c; + char alias_name[3], *alias_value, *macro; + + c = rl_read_key (); + alias_name[0] = '_'; + alias_name[1] = c; + alias_name[2] = '\0'; + + alias_value = get_alias_value (alias_name); + if (alias_value && *alias_value) + { + macro = savestring (alias_value); + rl_push_macro_input (macro); + } + return 0; +} +#endif + +/* Bindable commands that move `shell-words': that is, sequences of + non-unquoted-metacharacters. */ + +#define WORDDELIM(c) (shellmeta(c) || shellblank(c)) + +static int +bash_forward_shellword (count, key) + int count, key; +{ + size_t slen; + int sindex, c, p; + DECLARE_MBSTATE; + + if (count < 0) + return (bash_backward_shellword (-count, key)); + + /* The tricky part of this is deciding whether or not the first character + we're on is an unquoted metacharacter. Not completely handled yet. */ + /* XXX - need to test this stuff with backslash-escaped shell + metacharacters and unclosed single- and double-quoted strings. */ + + p = rl_point; + slen = rl_end; + + while (count) + { + if (p == rl_end) + { + rl_point = rl_end; + return 0; + } + + /* Are we in a quoted string? If we are, move to the end of the quoted + string and continue the outer loop. We only want quoted strings, not + backslash-escaped characters, but char_is_quoted doesn't + differentiate. */ + if (char_is_quoted (rl_line_buffer, p) && p > 0 && rl_line_buffer[p-1] != '\\') + { + do + ADVANCE_CHAR (rl_line_buffer, slen, p); + while (p < rl_end && char_is_quoted (rl_line_buffer, p)); + count--; + continue; + } + + /* Rest of code assumes we are not in a quoted string. */ + /* Move forward until we hit a non-metacharacter. */ + while (p < rl_end && (c = rl_line_buffer[p]) && WORDDELIM (c)) + { + switch (c) + { + default: + ADVANCE_CHAR (rl_line_buffer, slen, p); + continue; /* straight back to loop, don't increment p */ + case '\\': + if (p < rl_end && rl_line_buffer[p]) + ADVANCE_CHAR (rl_line_buffer, slen, p); + break; + case '\'': + p = skip_to_delim (rl_line_buffer, ++p, "'", SD_NOJMP); + break; + case '"': + p = skip_to_delim (rl_line_buffer, ++p, "\"", SD_NOJMP); + break; + } + + if (p < rl_end) + p++; + } + + if (rl_line_buffer[p] == 0 || p == rl_end) + { + rl_point = rl_end; + rl_ding (); + return 0; + } + + /* Now move forward until we hit a non-quoted metacharacter or EOL */ + while (p < rl_end && (c = rl_line_buffer[p]) && WORDDELIM (c) == 0) + { + switch (c) + { + default: + ADVANCE_CHAR (rl_line_buffer, slen, p); + continue; /* straight back to loop, don't increment p */ + case '\\': + if (p < rl_end && rl_line_buffer[p]) + ADVANCE_CHAR (rl_line_buffer, slen, p); + break; + case '\'': + p = skip_to_delim (rl_line_buffer, ++p, "'", SD_NOJMP); + break; + case '"': + p = skip_to_delim (rl_line_buffer, ++p, "\"", SD_NOJMP); + break; + } + + if (p < rl_end) + p++; + } + + if (p == rl_end || rl_line_buffer[p] == 0) + { + rl_point = rl_end; + return (0); + } + + count--; + } + + rl_point = p; + return (0); +} + +static int +bash_backward_shellword (count, key) + int count, key; +{ + size_t slen; + int sindex, c, p; + DECLARE_MBSTATE; + + if (count < 0) + return (bash_forward_shellword (-count, key)); + + p = rl_point; + slen = rl_end; + + while (count) + { + if (p == 0) + { + rl_point = 0; + return 0; + } + + /* Move backward until we hit a non-metacharacter. */ + while (p > 0) + { + c = rl_line_buffer[p]; + if (WORDDELIM (c) && char_is_quoted (rl_line_buffer, p) == 0) + BACKUP_CHAR (rl_line_buffer, slen, p); + break; + } + + if (p == 0) + { + rl_point = 0; + return 0; + } + + /* Now move backward until we hit a metacharacter or BOL. */ + while (p > 0) + { + c = rl_line_buffer[p]; + if (WORDDELIM (c) && char_is_quoted (rl_line_buffer, p) == 0) + break; + BACKUP_CHAR (rl_line_buffer, slen, p); + } + + count--; + } + + rl_point = p; + return 0; +} + +static int +bash_kill_shellword (count, key) + int count, key; +{ + int p; + + if (count < 0) + return (bash_backward_kill_shellword (-count, key)); + + p = rl_point; + bash_forward_shellword (count, key); + + if (rl_point != p) + rl_kill_text (p, rl_point); + + rl_point = p; + if (rl_editing_mode == 1) /* 1 == emacs_mode */ + rl_mark = rl_point; + + return 0; +} + +static int +bash_backward_kill_shellword (count, key) + int count, key; +{ + int p; + + if (count < 0) + return (bash_kill_shellword (-count, key)); + + p = rl_point; + bash_backward_shellword (count, key); + + if (rl_point != p) + rl_kill_text (p, rl_point); + + if (rl_editing_mode == 1) /* 1 == emacs_mode */ + rl_mark = rl_point; + + return 0; +} + + +/* **************************************************************** */ +/* */ +/* How To Do Shell Completion */ +/* */ +/* **************************************************************** */ + +#define COMMAND_SEPARATORS ";|&{(`" +/* )} */ +#define COMMAND_SEPARATORS_PLUS_WS ";|&{(` \t" +/* )} */ + +/* check for redirections and other character combinations that are not + command separators */ +static int +check_redir (ti) + int ti; +{ + register int this_char, prev_char; + + /* Handle the two character tokens `>&', `<&', and `>|'. + We are not in a command position after one of these. */ + this_char = rl_line_buffer[ti]; + prev_char = rl_line_buffer[ti - 1]; + + if ((this_char == '&' && (prev_char == '<' || prev_char == '>')) || + (this_char == '|' && prev_char == '>')) + return (1); + else if (this_char == '{' && prev_char == '$') /*}*/ + return (1); +#if 0 /* Not yet */ + else if (this_char == '(' && prev_char == '$') /*)*/ + return (1); + else if (this_char == '(' && prev_char == '<') /*)*/ + return (1); +#if defined (EXTENDED_GLOB) + else if (extended_glob && this_char == '(' && prev_char == '!') /*)*/ + return (1); +#endif +#endif + else if (char_is_quoted (rl_line_buffer, ti)) + return (1); + return (0); +} + +#if defined (PROGRAMMABLE_COMPLETION) +/* + * XXX - because of the <= start test, and setting os = s+1, this can + * potentially return os > start. This is probably not what we want to + * happen, but fix later after 2.05a-release. + */ +static int +find_cmd_start (start) + int start; +{ + register int s, os; + + os = 0; + /* Flags == SD_NOJMP only because we want to skip over command substitutions + in assignment statements. Have to test whether this affects `standalone' + command substitutions as individual words. */ + while (((s = skip_to_delim (rl_line_buffer, os, COMMAND_SEPARATORS, SD_NOJMP/*|SD_NOSKIPCMD*/)) <= start) && + rl_line_buffer[s]) + os = s+1; + return os; +} + +static int +find_cmd_end (end) + int end; +{ + register int e; + + e = skip_to_delim (rl_line_buffer, end, COMMAND_SEPARATORS, SD_NOJMP); + return e; +} + +static char * +find_cmd_name (start, sp, ep) + int start; + int *sp, *ep; +{ + char *name; + register int s, e; + + for (s = start; whitespace (rl_line_buffer[s]); s++) + ; + + /* skip until a shell break character */ + e = skip_to_delim (rl_line_buffer, s, "()<>;&| \t\n", SD_NOJMP); + + name = substring (rl_line_buffer, s, e); + + if (sp) + *sp = s; + if (ep) + *ep = e; + + return (name); +} + +static char * +prog_complete_return (text, matchnum) + const char *text; + int matchnum; +{ + static int ind; + + if (matchnum == 0) + ind = 0; + + if (prog_complete_matches == 0 || prog_complete_matches[ind] == 0) + return (char *)NULL; + return (prog_complete_matches[ind++]); +} + +#endif /* PROGRAMMABLE_COMPLETION */ + +/* Do some completion on TEXT. The indices of TEXT in RL_LINE_BUFFER are + at START and END. Return an array of matches, or NULL if none. */ +static char ** +attempt_shell_completion (text, start, end) + const char *text; + int start, end; +{ + int in_command_position, ti, saveti, qc, dflags; + char **matches, *command_separator_chars; +#if defined (PROGRAMMABLE_COMPLETION) + int have_progcomps, was_assignment; +#endif + + command_separator_chars = COMMAND_SEPARATORS; + matches = (char **)NULL; + rl_ignore_some_completions_function = filename_completion_ignore; + + rl_filename_quote_characters = default_filename_quote_characters; + set_filename_bstab (rl_filename_quote_characters); + set_directory_hook (); + rl_filename_stat_hook = bash_filename_stat_hook; + + /* Determine if this could be a command word. It is if it appears at + the start of the line (ignoring preceding whitespace), or if it + appears after a character that separates commands. It cannot be a + command word if we aren't at the top-level prompt. */ + ti = start - 1; + saveti = qc = -1; + + while ((ti > -1) && (whitespace (rl_line_buffer[ti]))) + ti--; + +#if 1 + /* If this is an open quote, maybe we're trying to complete a quoted + command name. */ + if (ti >= 0 && (rl_line_buffer[ti] == '"' || rl_line_buffer[ti] == '\'')) + { + qc = rl_line_buffer[ti]; + saveti = ti--; + while (ti > -1 && (whitespace (rl_line_buffer[ti]))) + ti--; + } +#endif + + in_command_position = 0; + if (ti < 0) + { + /* Only do command completion at the start of a line when we + are prompting at the top level. */ + if (current_prompt_string == ps1_prompt) + in_command_position++; + else if (parser_in_command_position ()) + in_command_position++; + } + else if (member (rl_line_buffer[ti], command_separator_chars)) + { + in_command_position++; + + if (check_redir (ti) == 1) + in_command_position = 0; + } + else + { + /* This still could be in command position. It is possible + that all of the previous words on the line are variable + assignments. */ + } + + /* Check that we haven't incorrectly flagged a closed command substitution + as indicating we're in a command position. */ + if (in_command_position && ti >= 0 && rl_line_buffer[ti] == '`' && + *text != '`' && unclosed_pair (rl_line_buffer, end, "`") == 0) + in_command_position = 0; + + /* Special handling for command substitution. If *TEXT is a backquote, + it can be the start or end of an old-style command substitution, or + unmatched. If it's unmatched, both calls to unclosed_pair will + succeed. Don't bother if readline found a single quote and we are + completing on the substring. */ + if (*text == '`' && rl_completion_quote_character != '\'' && + (in_command_position || (unclosed_pair (rl_line_buffer, start, "`") && + unclosed_pair (rl_line_buffer, end, "`")))) + matches = rl_completion_matches (text, command_subst_completion_function); + +#if defined (PROGRAMMABLE_COMPLETION) + /* Attempt programmable completion. */ + have_progcomps = prog_completion_enabled && (progcomp_size () > 0); + if (matches == 0 && (in_command_position == 0 || text[0] == '\0') && + current_prompt_string == ps1_prompt) + { + int s, e, s1, e1, os, foundcs; + char *n; + + /* XXX - don't free the members */ + if (prog_complete_matches) + free (prog_complete_matches); + prog_complete_matches = (char **)NULL; + + os = start; + n = 0; + s = find_cmd_start (os); + e = find_cmd_end (end); + do + { + /* Skip over assignment statements preceding a command name. If we + don't find a command name at all, we can perform command name + completion. If we find a partial command name, we should perform + command name completion on it. */ + FREE (n); + n = find_cmd_name (s, &s1, &e1); + s = e1 + 1; + } + while (was_assignment = assignment (n, 0)); + s = s1; /* reset to index where name begins */ + + /* s == index of where command name begins (reset above) + e == end of current command, may be end of line + s1 = index of where command name begins + e1 == index of where command name ends + start == index of where word to be completed begins + end == index of where word to be completed ends + if (s == start) we are doing command word completion for sure + if (e1 == end) we are at the end of the command name and completing it */ + if (start == 0 && end == 0 && e != 0 && text[0] == '\0') /* beginning of non-empty line */ + foundcs = 0; + else if (start == end && start == s1 && e != 0 && e1 > end) /* beginning of command name, leading whitespace */ + foundcs = 0; + else if (e == 0 && e == s && text[0] == '\0' && have_progcomps) /* beginning of empty line */ + prog_complete_matches = programmable_completions ("_EmptycmD_", text, s, e, &foundcs); + else if (start == end && text[0] == '\0' && s1 > start && whitespace (rl_line_buffer[start])) + foundcs = 0; /* whitespace before command name */ + else if (e > s && was_assignment == 0 && e1 == end && rl_line_buffer[e] == 0 && whitespace (rl_line_buffer[e-1]) == 0) + { + /* not assignment statement, but still want to perform command + completion if we are composing command word. */ + foundcs = 0; + in_command_position = s == start && STREQ (n, text); /* XXX */ + } + else if (e > s && was_assignment == 0 && have_progcomps) + { + prog_complete_matches = programmable_completions (n, text, s, e, &foundcs); + /* command completion if programmable completion fails */ + in_command_position = s == start && STREQ (n, text); /* XXX */ + } + else if (s >= e && n[0] == '\0' && text[0] == '\0' && start > 0) + { + foundcs = 0; /* empty command name following assignments */ + in_command_position = was_assignment; + } + else if (s == start && e == end && STREQ (n, text) && start > 0) + { + foundcs = 0; /* partial command name following assignments */ + in_command_position = 1; + } + else + foundcs = 0; + FREE (n); + /* XXX - if we found a COMPSPEC for the command, just return whatever + the programmable completion code returns, and disable the default + filename completion that readline will do unless the COPT_DEFAULT + option has been set with the `-o default' option to complete or + compopt. */ + if (foundcs) + { + pcomp_set_readline_variables (foundcs, 1); + /* Turn what the programmable completion code returns into what + readline wants. I should have made compute_lcd_of_matches + external... */ + matches = rl_completion_matches (text, prog_complete_return); + if ((foundcs & COPT_DEFAULT) == 0) + rl_attempted_completion_over = 1; /* no default */ + if (matches || ((foundcs & COPT_BASHDEFAULT) == 0)) + return (matches); + } + } +#endif + + if (matches == 0) + { + dflags = 0; + if (in_command_position) + dflags |= DEFCOMP_CMDPOS; + matches = bash_default_completion (text, start, end, qc, dflags); + } + + return matches; +} + +char ** +bash_default_completion (text, start, end, qc, compflags) + const char *text; + int start, end, qc, compflags; +{ + char **matches, *t; + + matches = (char **)NULL; + + /* New posix-style command substitution or variable name? */ + if (!matches && *text == '$') + { + if (qc != '\'' && text[1] == '(') /* ) */ + matches = rl_completion_matches (text, command_subst_completion_function); + else + { + matches = rl_completion_matches (text, variable_completion_function); + if (matches && matches[0] && matches[1] == 0) + { + t = savestring (matches[0]); + bash_filename_stat_hook (&t); + /* doesn't use test_for_directory because that performs tilde + expansion */ + if (file_isdir (t)) + rl_completion_append_character = '/'; + free (t); + } + } + } + + /* If the word starts in `~', and there is no slash in the word, then + try completing this word as a username. */ + if (matches == 0 && *text == '~' && mbschr (text, '/') == 0) + matches = rl_completion_matches (text, rl_username_completion_function); + + /* Another one. Why not? If the word starts in '@', then look through + the world of known hostnames for completion first. */ + if (matches == 0 && perform_hostname_completion && *text == '@') + matches = rl_completion_matches (text, hostname_completion_function); + + /* And last, (but not least) if this word is in a command position, then + complete over possible command names, including aliases, functions, + and command names. */ + if (matches == 0 && (compflags & DEFCOMP_CMDPOS)) + { + /* If END == START and text[0] == 0, we are trying to complete an empty + command word. */ + if (no_empty_command_completion && end == start && text[0] == '\0') + { + matches = (char **)NULL; + rl_ignore_some_completions_function = bash_ignore_everything; + } + else + { +#define CMD_IS_DIR(x) (absolute_pathname(x) == 0 && absolute_program(x) == 0 && *(x) != '~' && test_for_directory (x)) + + dot_in_path = 0; + matches = rl_completion_matches (text, command_word_completion_function); + + /* If we are attempting command completion and nothing matches, we + do not want readline to perform filename completion for us. We + still want to be able to complete partial pathnames, so set the + completion ignore function to something which will remove + filenames and leave directories in the match list. */ + if (matches == (char **)NULL) + rl_ignore_some_completions_function = bash_ignore_filenames; + else if (matches[1] == 0 && CMD_IS_DIR(matches[0]) && dot_in_path == 0) + /* If we found a single match, without looking in the current + directory (because it's not in $PATH), but the found name is + also a command in the current directory, suppress appending any + terminating character, since it's ambiguous. */ + { + rl_completion_suppress_append = 1; + rl_filename_completion_desired = 0; + } + else if (matches[0] && matches[1] && STREQ (matches[0], matches[1]) && CMD_IS_DIR (matches[0])) + /* There are multiple instances of the same match (duplicate + completions haven't yet been removed). In this case, all of + the matches will be the same, and the duplicate removal code + will distill them all down to one. We turn on + rl_completion_suppress_append for the same reason as above. + Remember: we only care if there's eventually a single unique + completion. If there are multiple completions this won't + make a difference and the problem won't occur. */ + { + rl_completion_suppress_append = 1; + rl_filename_completion_desired = 0; + } + } + } + + /* This could be a globbing pattern, so try to expand it using pathname + expansion. */ + if (!matches && glob_pattern_p (text)) + { + matches = rl_completion_matches (text, glob_complete_word); + /* A glob expression that matches more than one filename is problematic. + If we match more than one filename, punt. */ + if (matches && matches[1] && rl_completion_type == TAB) + { + strvec_dispose (matches); + matches = (char **)0; + } + else if (matches && matches[1] && rl_completion_type == '!') + { + rl_completion_suppress_append = 1; + rl_filename_completion_desired = 0; + } + } + + return (matches); +} + +static int +bash_command_name_stat_hook (name) + char **name; +{ + char *cname, *result; + + /* If it's not something we're going to look up in $PATH, just call the + normal filename stat hook. */ + if (absolute_program (*name)) + return (bash_filename_stat_hook (name)); + + cname = *name; + /* XXX - we could do something here with converting aliases, builtins, + and functions into something that came out as executable, but we don't. */ + result = search_for_command (cname, 0); + if (result) + { + *name = result; + return 1; + } + return 0; +} + +static int +executable_completion (filename, searching_path) + const char *filename; + int searching_path; +{ + char *f; + int r; + + f = savestring (filename); + bash_directory_completion_hook (&f); + + r = searching_path ? executable_file (f) : executable_or_directory (f); + free (f); + return r; +} + +/* This is the function to call when the word to complete is in a position + where a command word can be found. It grovels $PATH, looking for commands + that match. It also scans aliases, function names, and the shell_builtin + table. */ +char * +command_word_completion_function (hint_text, state) + const char *hint_text; + int state; +{ + static char *hint = (char *)NULL; + static char *path = (char *)NULL; + static char *val = (char *)NULL; + static char *filename_hint = (char *)NULL; + static char *fnhint = (char *)NULL; + static char *dequoted_hint = (char *)NULL; + static char *directory_part = (char *)NULL; + static char **glob_matches = (char **)NULL; + static int path_index, hint_len, dequoted_len, istate, igncase; + static int mapping_over, local_index, searching_path, hint_is_dir; + static int old_glob_ignore_case, globpat; + static SHELL_VAR **varlist = (SHELL_VAR **)NULL; +#if defined (ALIAS) + static alias_t **alias_list = (alias_t **)NULL; +#endif /* ALIAS */ + char *temp, *cval; + + /* We have to map over the possibilities for command words. If we have + no state, then make one just for that purpose. */ + if (state == 0) + { + rl_filename_stat_hook = bash_command_name_stat_hook; + + if (dequoted_hint && dequoted_hint != hint) + free (dequoted_hint); + if (hint) + free (hint); + + mapping_over = searching_path = 0; + hint_is_dir = CMD_IS_DIR (hint_text); + val = (char *)NULL; + + temp = rl_variable_value ("completion-ignore-case"); + igncase = RL_BOOLEAN_VARIABLE_VALUE (temp); + + if (glob_matches) + { + free (glob_matches); + glob_matches = (char **)NULL; + } + + globpat = glob_pattern_p (hint_text); + + /* If this is an absolute program name, do not check it against + aliases, reserved words, functions or builtins. We must check + whether or not it is unique, and, if so, whether that filename + is executable. */ + if (globpat || absolute_program (hint_text)) + { + /* Perform tilde expansion on what's passed, so we don't end up + passing filenames with tildes directly to stat(). */ + if (*hint_text == '~') + { + hint = bash_tilde_expand (hint_text, 0); + directory_part = savestring (hint_text); + temp = strchr (directory_part, '/'); + if (temp) + *temp = 0; + else + { + free (directory_part); + directory_part = (char *)NULL; + } + } + else + hint = savestring (hint_text); + + dequoted_hint = hint; + /* If readline's completer found a quote character somewhere, but + didn't set the quote character, there must have been a quote + character embedded in the filename. It can't be at the start of + the filename, so we need to dequote the filename before we look + in the file system for it. */ + if (rl_completion_found_quote && rl_completion_quote_character == 0) + { + dequoted_hint = bash_dequote_filename (hint, 0); + free (hint); + hint = dequoted_hint; + } + dequoted_len = hint_len = strlen (hint); + + if (filename_hint) + free (filename_hint); + + fnhint = filename_hint = savestring (hint); + + istate = 0; + + if (globpat) + { + mapping_over = 5; + goto globword; + } + else + { + if (dircomplete_expand && path_dot_or_dotdot (filename_hint)) + { + dircomplete_expand = 0; + set_directory_hook (); + dircomplete_expand = 1; + } + mapping_over = 4; + goto inner; + } + } + + dequoted_hint = hint = savestring (hint_text); + dequoted_len = hint_len = strlen (hint); + + if (rl_completion_found_quote && rl_completion_quote_character == 0) + { + dequoted_hint = bash_dequote_filename (hint, 0); + dequoted_len = strlen (dequoted_hint); + } + + path = get_string_value ("PATH"); + path_index = dot_in_path = 0; + + /* Initialize the variables for each type of command word. */ + local_index = 0; + + if (varlist) + free (varlist); + + varlist = all_visible_functions (); + +#if defined (ALIAS) + if (alias_list) + free (alias_list); + + alias_list = all_aliases (); +#endif /* ALIAS */ + } + + /* mapping_over says what we are currently hacking. Note that every case + in this list must fall through when there are no more possibilities. */ + + switch (mapping_over) + { + case 0: /* Aliases come first. */ +#if defined (ALIAS) + while (alias_list && alias_list[local_index]) + { + register char *alias; + + alias = alias_list[local_index++]->name; + + if (STREQN (alias, hint, hint_len)) + return (savestring (alias)); + } +#endif /* ALIAS */ + local_index = 0; + mapping_over++; + + case 1: /* Then shell reserved words. */ + { + while (word_token_alist[local_index].word) + { + register char *reserved_word; + + reserved_word = word_token_alist[local_index++].word; + + if (STREQN (reserved_word, hint, hint_len)) + return (savestring (reserved_word)); + } + local_index = 0; + mapping_over++; + } + + case 2: /* Then function names. */ + while (varlist && varlist[local_index]) + { + register char *varname; + + varname = varlist[local_index++]->name; + + if (STREQN (varname, hint, hint_len)) + return (savestring (varname)); + } + local_index = 0; + mapping_over++; + + case 3: /* Then shell builtins. */ + for (; local_index < num_shell_builtins; local_index++) + { + /* Ignore it if it doesn't have a function pointer or if it + is not currently enabled. */ + if (!shell_builtins[local_index].function || + (shell_builtins[local_index].flags & BUILTIN_ENABLED) == 0) + continue; + + if (STREQN (shell_builtins[local_index].name, hint, hint_len)) + { + int i = local_index++; + + return (savestring (shell_builtins[i].name)); + } + } + local_index = 0; + mapping_over++; + } + +globword: + /* Limited support for completing command words with globbing chars. Only + a single match (multiple matches that end up reducing the number of + characters in the common prefix are bad) will ever be returned on + regular completion. */ + if (globpat) + { + if (state == 0) + { + glob_ignore_case = igncase; + glob_matches = shell_glob_filename (hint); + glob_ignore_case = old_glob_ignore_case; + + if (GLOB_FAILED (glob_matches) || glob_matches == 0) + { + glob_matches = (char **)NULL; + return ((char *)NULL); + } + + local_index = 0; + + if (glob_matches[1] && rl_completion_type == TAB) /* multiple matches are bad */ + return ((char *)NULL); + } + + while (val = glob_matches[local_index++]) + { + if (executable_or_directory (val)) + { + if (*hint_text == '~' && directory_part) + { + temp = maybe_restore_tilde (val, directory_part); + free (val); + val = temp; + } + return (val); + } + free (val); + } + + glob_ignore_case = old_glob_ignore_case; + return ((char *)NULL); + } + + /* If the text passed is a directory in the current directory, return it + as a possible match. Executables in directories in the current + directory can be specified using relative pathnames and successfully + executed even when `.' is not in $PATH. */ + if (hint_is_dir) + { + hint_is_dir = 0; /* only return the hint text once */ + return (savestring (hint_text)); + } + + /* Repeatedly call filename_completion_function while we have + members of PATH left. Question: should we stat each file? + Answer: we call executable_file () on each file. */ + outer: + + istate = (val != (char *)NULL); + + if (istate == 0) + { + char *current_path; + + /* Get the next directory from the path. If there is none, then we + are all done. */ + if (path == 0 || path[path_index] == 0 || + (current_path = extract_colon_unit (path, &path_index)) == 0) + return ((char *)NULL); + + searching_path = 1; + if (*current_path == 0) + { + free (current_path); + current_path = savestring ("."); + } + + if (*current_path == '~') + { + char *t; + + t = bash_tilde_expand (current_path, 0); + free (current_path); + current_path = t; + } + + if (current_path[0] == '.' && current_path[1] == '\0') + dot_in_path = 1; + + if (fnhint && fnhint != filename_hint) + free (fnhint); + if (filename_hint) + free (filename_hint); + + filename_hint = sh_makepath (current_path, hint, 0); + /* Need a quoted version (though it doesn't matter much in most + cases) because rl_filename_completion_function dequotes the + filename it gets, assuming that it's been quoted as part of + the input line buffer. */ + if (strpbrk (filename_hint, "\"'\\")) + fnhint = sh_backslash_quote (filename_hint, filename_bstab, 0); + else + fnhint = filename_hint; + free (current_path); /* XXX */ + } + + inner: + val = rl_filename_completion_function (fnhint, istate); + if (mapping_over == 4 && dircomplete_expand) + set_directory_hook (); + + istate = 1; + + if (val == 0) + { + /* If the hint text is an absolute program, then don't bother + searching through PATH. */ + if (absolute_program (hint)) + return ((char *)NULL); + + goto outer; + } + else + { + int match, freetemp; + + if (absolute_program (hint)) + { + if (igncase == 0) + match = strncmp (val, hint, hint_len) == 0; + else + match = strncasecmp (val, hint, hint_len) == 0; + + /* If we performed tilde expansion, restore the original + filename. */ + if (*hint_text == '~') + temp = maybe_restore_tilde (val, directory_part); + else + temp = savestring (val); + freetemp = 1; + } + else + { + temp = strrchr (val, '/'); + + if (temp) + { + temp++; + if (igncase == 0) + freetemp = match = strncmp (temp, hint, hint_len) == 0; + else + freetemp = match = strncasecmp (temp, hint, hint_len) == 0; + if (match) + temp = savestring (temp); + } + else + freetemp = match = 0; + } + + /* If we have found a match, and it is an executable file, return it. + We don't return directory names when searching $PATH, since the + bash execution code won't find executables in directories which + appear in directories in $PATH when they're specified using + relative pathnames. */ +#if 0 + /* If we're not searching $PATH and we have a relative pathname, we + need to re-canonicalize it before testing whether or not it's an + executable or a directory so the shell treats .. relative to $PWD + according to the physical/logical option. The shell already + canonicalizes the directory name in order to tell readline where + to look, so not doing it here will be inconsistent. */ + /* XXX -- currently not used -- will introduce more inconsistency, + since shell does not canonicalize ../foo before passing it to + shell_execve(). */ + if (match && searching_path == 0 && *val == '.') + { + char *t, *t1; + + t = get_working_directory ("command-word-completion"); + t1 = make_absolute (val, t); + free (t); + cval = sh_canonpath (t1, PATH_CHECKDOTDOT|PATH_CHECKEXISTS); + } + else +#endif + cval = val; + + if (match && executable_completion ((searching_path ? val : cval), searching_path)) + { + if (cval != val) + free (cval); + free (val); + val = ""; /* So it won't be NULL. */ + return (temp); + } + else + { + if (freetemp) + free (temp); + if (cval != val) + free (cval); + free (val); + goto inner; + } + } +} + +/* Completion inside an unterminated command substitution. */ +static char * +command_subst_completion_function (text, state) + const char *text; + int state; +{ + static char **matches = (char **)NULL; + static const char *orig_start; + static char *filename_text = (char *)NULL; + static int cmd_index, start_len; + char *value; + + if (state == 0) + { + if (filename_text) + free (filename_text); + orig_start = text; + if (*text == '`') + text++; + else if (*text == '$' && text[1] == '(') /* ) */ + text += 2; + /* If the text was quoted, suppress any quote character that the + readline completion code would insert. */ + rl_completion_suppress_quote = 1; + start_len = text - orig_start; + filename_text = savestring (text); + if (matches) + free (matches); + + /* + * At this point we can entertain the idea of re-parsing + * `filename_text' into a (possibly incomplete) command name and + * arguments, and doing completion based on that. This is + * currently very rudimentary, but it is a small improvement. + */ + for (value = filename_text + strlen (filename_text) - 1; value > filename_text; value--) + if (whitespace (*value) || member (*value, COMMAND_SEPARATORS)) + break; + if (value <= filename_text) + matches = rl_completion_matches (filename_text, command_word_completion_function); + else + { + value++; + start_len += value - filename_text; + if (whitespace (value[-1])) + matches = rl_completion_matches (value, rl_filename_completion_function); + else + matches = rl_completion_matches (value, command_word_completion_function); + } + + /* If there is more than one match, rl_completion_matches has already + put the lcd in matches[0]. Skip over it. */ + cmd_index = matches && matches[0] && matches[1]; + + /* If there's a single match and it's a directory, set the append char + to the expected `/'. Otherwise, don't append anything. */ + if (matches && matches[0] && matches[1] == 0 && test_for_directory (matches[0])) + rl_completion_append_character = '/'; + else + rl_completion_suppress_append = 1; + } + + if (matches == 0 || matches[cmd_index] == 0) + { + rl_filename_quoting_desired = 0; /* disable quoting */ + return ((char *)NULL); + } + else + { + value = (char *)xmalloc (1 + start_len + strlen (matches[cmd_index])); + + if (start_len == 1) + value[0] = *orig_start; + else + strncpy (value, orig_start, start_len); + + strcpy (value + start_len, matches[cmd_index]); + + cmd_index++; + return (value); + } +} + +/* Okay, now we write the entry_function for variable completion. */ +static char * +variable_completion_function (text, state) + const char *text; + int state; +{ + static char **varlist = (char **)NULL; + static int varlist_index; + static char *varname = (char *)NULL; + static int namelen; + static int first_char, first_char_loc; + + if (!state) + { + if (varname) + free (varname); + + first_char_loc = 0; + first_char = text[0]; + + if (first_char == '$') + first_char_loc++; + + if (text[first_char_loc] == '{') + first_char_loc++; + + varname = savestring (text + first_char_loc); + + namelen = strlen (varname); + if (varlist) + strvec_dispose (varlist); + + varlist = all_variables_matching_prefix (varname); + varlist_index = 0; + } + + if (!varlist || !varlist[varlist_index]) + { + return ((char *)NULL); + } + else + { + char *value; + + value = (char *)xmalloc (4 + strlen (varlist[varlist_index])); + + if (first_char_loc) + { + value[0] = first_char; + if (first_char_loc == 2) + value[1] = '{'; + } + + strcpy (value + first_char_loc, varlist[varlist_index]); + if (first_char_loc == 2) + strcat (value, "}"); + + varlist_index++; + return (value); + } +} + +/* How about a completion function for hostnames? */ +static char * +hostname_completion_function (text, state) + const char *text; + int state; +{ + static char **list = (char **)NULL; + static int list_index = 0; + static int first_char, first_char_loc; + + /* If we don't have any state, make some. */ + if (state == 0) + { + FREE (list); + + list = (char **)NULL; + + first_char_loc = 0; + first_char = *text; + + if (first_char == '@') + first_char_loc++; + + list = hostnames_matching ((char *)text+first_char_loc); + list_index = 0; + } + + if (list && list[list_index]) + { + char *t; + + t = (char *)xmalloc (2 + strlen (list[list_index])); + *t = first_char; + strcpy (t + first_char_loc, list[list_index]); + list_index++; + return (t); + } + + return ((char *)NULL); +} + +/* + * A completion function for service names from /etc/services (or wherever). + */ +char * +bash_servicename_completion_function (text, state) + const char *text; + int state; +{ +#if defined (__WIN32__) || defined (__OPENNT) || !defined (HAVE_GETSERVENT) + return ((char *)NULL); +#else + static char *sname = (char *)NULL; + static struct servent *srvent; + static int snamelen, firstc; + char *value; + char **alist, *aentry; + int afound; + + if (state == 0) + { + FREE (sname); + firstc = *text; + + sname = savestring (text); + snamelen = strlen (sname); + setservent (0); + } + + while (srvent = getservent ()) + { + afound = 0; + if (snamelen == 0 || (STREQN (sname, srvent->s_name, snamelen))) + break; + /* Not primary, check aliases */ + for (alist = srvent->s_aliases; *alist; alist++) + { + aentry = *alist; + if (STREQN (sname, aentry, snamelen)) + { + afound = 1; + break; + } + } + + if (afound) + break; + } + + if (srvent == 0) + { + endservent (); + return ((char *)NULL); + } + + value = afound ? savestring (aentry) : savestring (srvent->s_name); + return value; +#endif +} + +/* + * A completion function for group names from /etc/group (or wherever). + */ +char * +bash_groupname_completion_function (text, state) + const char *text; + int state; +{ +#if defined (__WIN32__) || defined (__OPENNT) || !defined (HAVE_GRP_H) + return ((char *)NULL); +#else + static char *gname = (char *)NULL; + static struct group *grent; + static int gnamelen; + char *value; + + if (state == 0) + { + FREE (gname); + gname = savestring (text); + gnamelen = strlen (gname); + + setgrent (); + } + + while (grent = getgrent ()) + { + if (gnamelen == 0 || (STREQN (gname, grent->gr_name, gnamelen))) + break; + } + + if (grent == 0) + { + endgrent (); + return ((char *)NULL); + } + + value = savestring (grent->gr_name); + return (value); +#endif +} + +/* Functions to perform history and alias expansions on the current line. */ + +#if defined (BANG_HISTORY) +/* Perform history expansion on the current line. If no history expansion + is done, pre_process_line() returns what it was passed, so we need to + allocate a new line here. */ +static char * +history_expand_line_internal (line) + char *line; +{ + char *new_line; + int old_verify; + + old_verify = hist_verify; + hist_verify = 0; + new_line = pre_process_line (line, 0, 0); + hist_verify = old_verify; + + return (new_line == line) ? savestring (line) : new_line; +} +#endif + +/* There was an error in expansion. Let the preprocessor print + the error here. */ +static void +cleanup_expansion_error () +{ + char *to_free; +#if defined (BANG_HISTORY) + int old_verify; + + old_verify = hist_verify; + hist_verify = 0; +#endif + + fprintf (rl_outstream, "\r\n"); + to_free = pre_process_line (rl_line_buffer, 1, 0); +#if defined (BANG_HISTORY) + hist_verify = old_verify; +#endif + if (to_free != rl_line_buffer) + FREE (to_free); + putc ('\r', rl_outstream); + rl_forced_update_display (); +} + +/* If NEW_LINE differs from what is in the readline line buffer, add an + undo record to get from the readline line buffer contents to the new + line and make NEW_LINE the current readline line. */ +static void +maybe_make_readline_line (new_line) + char *new_line; +{ + if (strcmp (new_line, rl_line_buffer) != 0) + { + rl_point = rl_end; + + rl_add_undo (UNDO_BEGIN, 0, 0, 0); + rl_delete_text (0, rl_point); + rl_point = rl_end = rl_mark = 0; + rl_insert_text (new_line); + rl_add_undo (UNDO_END, 0, 0, 0); + } +} + +/* Make NEW_LINE be the current readline line. This frees NEW_LINE. */ +static void +set_up_new_line (new_line) + char *new_line; +{ + int old_point, at_end; + + old_point = rl_point; + at_end = rl_point == rl_end; + + /* If the line was history and alias expanded, then make that + be one thing to undo. */ + maybe_make_readline_line (new_line); + free (new_line); + + /* Place rl_point where we think it should go. */ + if (at_end) + rl_point = rl_end; + else if (old_point < rl_end) + { + rl_point = old_point; + if (!whitespace (rl_line_buffer[rl_point])) + rl_forward_word (1, 0); + } +} + +#if defined (ALIAS) +/* Expand aliases in the current readline line. */ +static int +alias_expand_line (count, ignore) + int count, ignore; +{ + char *new_line; + + new_line = alias_expand (rl_line_buffer); + + if (new_line) + { + set_up_new_line (new_line); + return (0); + } + else + { + cleanup_expansion_error (); + return (1); + } +} +#endif + +#if defined (BANG_HISTORY) +/* History expand the line. */ +static int +history_expand_line (count, ignore) + int count, ignore; +{ + char *new_line; + + new_line = history_expand_line_internal (rl_line_buffer); + + if (new_line) + { + set_up_new_line (new_line); + return (0); + } + else + { + cleanup_expansion_error (); + return (1); + } +} + +/* Expand history substitutions in the current line and then insert a + space (hopefully close to where we were before). */ +static int +tcsh_magic_space (count, ignore) + int count, ignore; +{ + int dist_from_end, old_point; + + old_point = rl_point; + dist_from_end = rl_end - rl_point; + if (history_expand_line (count, ignore) == 0) + { + /* Try a simple heuristic from Stephen Gildea . + This works if all expansions were before rl_point or if no expansions + were performed. */ + rl_point = (old_point == 0) ? old_point : rl_end - dist_from_end; + rl_insert (1, ' '); + return (0); + } + else + return (1); +} +#endif /* BANG_HISTORY */ + +/* History and alias expand the line. */ +static int +history_and_alias_expand_line (count, ignore) + int count, ignore; +{ + char *new_line; + + new_line = 0; +#if defined (BANG_HISTORY) + new_line = history_expand_line_internal (rl_line_buffer); +#endif + +#if defined (ALIAS) + if (new_line) + { + char *alias_line; + + alias_line = alias_expand (new_line); + free (new_line); + new_line = alias_line; + } +#endif /* ALIAS */ + + if (new_line) + { + set_up_new_line (new_line); + return (0); + } + else + { + cleanup_expansion_error (); + return (1); + } +} + +/* History and alias expand the line, then perform the shell word + expansions by calling expand_string. This can't use set_up_new_line() + because we want the variable expansions as a separate undo'able + set of operations. */ +static int +shell_expand_line (count, ignore) + int count, ignore; +{ + char *new_line; + WORD_LIST *expanded_string; + + new_line = 0; +#if defined (BANG_HISTORY) + new_line = history_expand_line_internal (rl_line_buffer); +#endif + +#if defined (ALIAS) + if (new_line) + { + char *alias_line; + + alias_line = alias_expand (new_line); + free (new_line); + new_line = alias_line; + } +#endif /* ALIAS */ + + if (new_line) + { + int old_point = rl_point; + int at_end = rl_point == rl_end; + + /* If the line was history and alias expanded, then make that + be one thing to undo. */ + maybe_make_readline_line (new_line); + free (new_line); + + /* If there is variable expansion to perform, do that as a separate + operation to be undone. */ + new_line = savestring (rl_line_buffer); + expanded_string = expand_string (new_line, 0); + FREE (new_line); + if (expanded_string == 0) + { + new_line = (char *)xmalloc (1); + new_line[0] = '\0'; + } + else + { + new_line = string_list (expanded_string); + dispose_words (expanded_string); + } + + maybe_make_readline_line (new_line); + free (new_line); + + /* Place rl_point where we think it should go. */ + if (at_end) + rl_point = rl_end; + else if (old_point < rl_end) + { + rl_point = old_point; + if (!whitespace (rl_line_buffer[rl_point])) + rl_forward_word (1, 0); + } + return 0; + } + else + { + cleanup_expansion_error (); + return 1; + } +} + +/* If FIGNORE is set, then don't match files with the given suffixes when + completing filenames. If only one of the possibilities has an acceptable + suffix, delete the others, else just return and let the completer + signal an error. It is called by the completer when real + completions are done on filenames by the completer's internal + function, not for completion lists (M-?) and not on "other" + completion types, such as hostnames or commands. */ + +static struct ignorevar fignore = +{ + "FIGNORE", + (struct ign *)0, + 0, + (char *)0, + (sh_iv_item_func_t *) 0, +}; + +static void +_ignore_completion_names (names, name_func) + char **names; + sh_ignore_func_t *name_func; +{ + char **newnames; + int idx, nidx; + char **oldnames; + int oidx; + + /* If there is only one completion, see if it is acceptable. If it is + not, free it up. In any case, short-circuit and return. This is a + special case because names[0] is not the prefix of the list of names + if there is only one completion; it is the completion itself. */ + if (names[1] == (char *)0) + { + if (force_fignore) + if ((*name_func) (names[0]) == 0) + { + free (names[0]); + names[0] = (char *)NULL; + } + + return; + } + + /* Allocate space for array to hold list of pointers to matching + filenames. The pointers are copied back to NAMES when done. */ + for (nidx = 1; names[nidx]; nidx++) + ; + newnames = strvec_create (nidx + 1); + + if (force_fignore == 0) + { + oldnames = strvec_create (nidx - 1); + oidx = 0; + } + + newnames[0] = names[0]; + for (idx = nidx = 1; names[idx]; idx++) + { + if ((*name_func) (names[idx])) + newnames[nidx++] = names[idx]; + else if (force_fignore == 0) + oldnames[oidx++] = names[idx]; + else + free (names[idx]); + } + + newnames[nidx] = (char *)NULL; + + /* If none are acceptable then let the completer handle it. */ + if (nidx == 1) + { + if (force_fignore) + { + free (names[0]); + names[0] = (char *)NULL; + } + else + free (oldnames); + + free (newnames); + return; + } + + if (force_fignore == 0) + { + while (oidx) + free (oldnames[--oidx]); + free (oldnames); + } + + /* If only one is acceptable, copy it to names[0] and return. */ + if (nidx == 2) + { + free (names[0]); + names[0] = newnames[1]; + names[1] = (char *)NULL; + free (newnames); + return; + } + + /* Copy the acceptable names back to NAMES, set the new array end, + and return. */ + for (nidx = 1; newnames[nidx]; nidx++) + names[nidx] = newnames[nidx]; + names[nidx] = (char *)NULL; + free (newnames); +} + +static int +name_is_acceptable (name) + const char *name; +{ + struct ign *p; + int nlen; + + for (nlen = strlen (name), p = fignore.ignores; p->val; p++) + { + if (nlen > p->len && p->len > 0 && STREQ (p->val, &name[nlen - p->len])) + return (0); + } + + return (1); +} + +#if 0 +static int +ignore_dot_names (name) + char *name; +{ + return (name[0] != '.'); +} +#endif + +static int +filename_completion_ignore (names) + char **names; +{ +#if 0 + if (glob_dot_filenames == 0) + _ignore_completion_names (names, ignore_dot_names); +#endif + + setup_ignore_patterns (&fignore); + + if (fignore.num_ignores == 0) + return 0; + + _ignore_completion_names (names, name_is_acceptable); + + return 0; +} + +/* Return 1 if NAME is a directory. NAME undergoes tilde expansion. */ +static int +test_for_directory (name) + const char *name; +{ + char *fn; + int r; + + fn = bash_tilde_expand (name, 0); + r = file_isdir (fn); + free (fn); + + return (r); +} + +/* Remove files from NAMES, leaving directories. */ +static int +bash_ignore_filenames (names) + char **names; +{ + _ignore_completion_names (names, test_for_directory); + return 0; +} + +static int +return_zero (name) + const char *name; +{ + return 0; +} + +static int +bash_ignore_everything (names) + char **names; +{ + _ignore_completion_names (names, return_zero); + return 0; +} + +/* Replace a tilde-prefix in VAL with a `~', assuming the user typed it. VAL + is an expanded filename. DIRECTORY_PART is the tilde-prefix portion + of the un-tilde-expanded version of VAL (what the user typed). */ +static char * +restore_tilde (val, directory_part) + char *val, *directory_part; +{ + int l, vl, dl2, xl; + char *dh2, *expdir, *ret; + + vl = strlen (val); + + /* We need to duplicate the expansions readline performs on the directory + portion before passing it to our completion function. */ + dh2 = directory_part ? bash_dequote_filename (directory_part, 0) : 0; + bash_directory_expansion (&dh2); + dl2 = strlen (dh2); + + expdir = bash_tilde_expand (directory_part, 0); + xl = strlen (expdir); + free (expdir); + + /* + dh2 = unexpanded but dequoted tilde-prefix + dl2 = length of tilde-prefix + expdir = tilde-expanded tilde-prefix + xl = length of expanded tilde-prefix + l = length of remainder after tilde-prefix + */ + l = (vl - xl) + 1; + + ret = (char *)xmalloc (dl2 + 2 + l); + strcpy (ret, dh2); + strcpy (ret + dl2, val + xl); + + free (dh2); + return (ret); +} + +static char * +maybe_restore_tilde (val, directory_part) + char *val, *directory_part; +{ + rl_icppfunc_t *save; + char *ret; + + save = (dircomplete_expand == 0) ? save_directory_hook () : (rl_icppfunc_t *)0; + ret = restore_tilde (val, directory_part); + if (save) + restore_directory_hook (save); + return ret; +} + +/* Simulate the expansions that will be performed by + rl_filename_completion_function. This must be called with the address of + a pointer to malloc'd memory. */ +static void +bash_directory_expansion (dirname) + char **dirname; +{ + char *d, *nd; + + d = savestring (*dirname); + + if ((rl_directory_rewrite_hook) && (*rl_directory_rewrite_hook) (&d)) + { + free (*dirname); + *dirname = d; + } + else if (rl_directory_completion_hook && (*rl_directory_completion_hook) (&d)) + { + free (*dirname); + *dirname = d; + } + else if (rl_completion_found_quote) + { + nd = bash_dequote_filename (d, rl_completion_quote_character); + free (*dirname); + free (d); + *dirname = nd; + } +} + +/* If necessary, rewrite directory entry */ +static char * +bash_filename_rewrite_hook (fname, fnlen) + char *fname; + int fnlen; +{ + char *conv; + + conv = fnx_fromfs (fname, fnlen); + if (conv != fname) + conv = savestring (conv); + return conv; +} + +/* Functions to save and restore the appropriate directory hook */ +/* This is not static so the shopt code can call it */ +void +set_directory_hook () +{ + if (dircomplete_expand) + { + rl_directory_completion_hook = bash_directory_completion_hook; + rl_directory_rewrite_hook = (rl_icppfunc_t *)0; + } + else + { + rl_directory_rewrite_hook = bash_directory_completion_hook; + rl_directory_completion_hook = (rl_icppfunc_t *)0; + } +} + +static rl_icppfunc_t * +save_directory_hook () +{ + rl_icppfunc_t *ret; + + if (dircomplete_expand) + { + ret = rl_directory_completion_hook; + rl_directory_completion_hook = (rl_icppfunc_t *)NULL; + } + else + { + ret = rl_directory_rewrite_hook; + rl_directory_rewrite_hook = (rl_icppfunc_t *)NULL; + } + + return ret; +} + +static void +restore_directory_hook (hookf) + rl_icppfunc_t *hookf; +{ + if (dircomplete_expand) + rl_directory_completion_hook = hookf; + else + rl_directory_rewrite_hook = hookf; +} + +/* Expand a filename before the readline completion code passes it to stat(2). + The filename will already have had tilde expansion performed. */ +static int +bash_filename_stat_hook (dirname) + char **dirname; +{ + char *local_dirname, *new_dirname, *t; + int should_expand_dirname, return_value; + WORD_LIST *wl; + struct stat sb; + + local_dirname = *dirname; + should_expand_dirname = return_value = 0; + if (t = mbschr (local_dirname, '$')) + should_expand_dirname = '$'; + else if (t = mbschr (local_dirname, '`')) /* XXX */ + should_expand_dirname = '`'; + +#if defined (HAVE_LSTAT) + if (should_expand_dirname && lstat (local_dirname, &sb) == 0) +#else + if (should_expand_dirname && stat (local_dirname, &sb) == 0) +#endif + should_expand_dirname = 0; + + if (should_expand_dirname) + { + new_dirname = savestring (local_dirname); + wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB); /* does the right thing */ + if (wl) + { + free (new_dirname); + new_dirname = string_list (wl); + /* Tell the completer we actually expanded something and change + *dirname only if we expanded to something non-null -- stat + behaves unpredictably when passed null or empty strings */ + if (new_dirname && *new_dirname) + { + free (local_dirname); /* XXX */ + local_dirname = *dirname = new_dirname; + return_value = STREQ (local_dirname, *dirname) == 0; + } + else + free (new_dirname); + dispose_words (wl); + } + else + free (new_dirname); + } + + /* This is very similar to the code in bash_directory_completion_hook below, + but without spelling correction and not worrying about whether or not + we change relative pathnames. */ + if (no_symbolic_links == 0 && (local_dirname[0] != '.' || local_dirname[1])) + { + char *temp1, *temp2; + + t = get_working_directory ("symlink-hook"); + temp1 = make_absolute (local_dirname, t); + free (t); + temp2 = sh_canonpath (temp1, PATH_CHECKDOTDOT|PATH_CHECKEXISTS); + + /* If we can't canonicalize, bail. */ + if (temp2 == 0) + { + free (temp1); + return return_value; + } + + free (local_dirname); + *dirname = temp2; + free (temp1); + } + + return (return_value); +} + +/* Handle symbolic link references and other directory name + expansions while hacking completion. This should return 1 if it modifies + the DIRNAME argument, 0 otherwise. It should make sure not to modify + DIRNAME if it returns 0. */ +static int +bash_directory_completion_hook (dirname) + char **dirname; +{ + char *local_dirname, *new_dirname, *t; + int return_value, should_expand_dirname, nextch, closer; + WORD_LIST *wl; + struct stat sb; + + return_value = should_expand_dirname = nextch = closer = 0; + local_dirname = *dirname; + + if (t = mbschr (local_dirname, '$')) + { + should_expand_dirname = '$'; + nextch = t[1]; + /* Deliberately does not handle the deprecated $[...] arithmetic + expansion syntax */ + if (nextch == '(') + closer = ')'; + else if (nextch == '{') + closer = '}'; + else + nextch = 0; + } + else if (local_dirname[0] == '~') + should_expand_dirname = '~'; + else + { + t = mbschr (local_dirname, '`'); + if (t && unclosed_pair (local_dirname, strlen (local_dirname), "`") == 0) + should_expand_dirname = '`'; + } + +#if defined (HAVE_LSTAT) + if (should_expand_dirname && lstat (local_dirname, &sb) == 0) +#else + if (should_expand_dirname && stat (local_dirname, &sb) == 0) +#endif + should_expand_dirname = 0; + + if (should_expand_dirname) + { + new_dirname = savestring (local_dirname); + wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB); /* does the right thing */ + if (wl) + { + *dirname = string_list (wl); + /* Tell the completer to replace the directory name only if we + actually expanded something. */ + return_value = STREQ (local_dirname, *dirname) == 0; + free (local_dirname); + free (new_dirname); + dispose_words (wl); + local_dirname = *dirname; + /* XXX - change rl_filename_quote_characters here based on + should_expand_dirname/nextch/closer. This is the only place + custom_filename_quote_characters is modified. */ + if (rl_filename_quote_characters && *rl_filename_quote_characters) + { + int i, j, c; + i = strlen (default_filename_quote_characters); + custom_filename_quote_characters = xrealloc (custom_filename_quote_characters, i+1); + for (i = j = 0; c = default_filename_quote_characters[i]; i++) + { + if (c == should_expand_dirname || c == nextch || c == closer) + continue; + custom_filename_quote_characters[j++] = c; + } + custom_filename_quote_characters[j] = '\0'; + rl_filename_quote_characters = custom_filename_quote_characters; + set_filename_bstab (rl_filename_quote_characters); + } + } + else + { + free (new_dirname); + free (local_dirname); + *dirname = (char *)xmalloc (1); + **dirname = '\0'; + return 1; + } + } + else + { + /* Dequote the filename even if we don't expand it. */ + new_dirname = bash_dequote_filename (local_dirname, rl_completion_quote_character); + return_value = STREQ (local_dirname, new_dirname) == 0; + free (local_dirname); + local_dirname = *dirname = new_dirname; + } + + /* no_symbolic_links == 0 -> use (default) logical view of the file system. + local_dirname[0] == '.' && local_dirname[1] == '/' means files in the + current directory (./). + local_dirname[0] == '.' && local_dirname[1] == 0 means relative pathnames + in the current directory (e.g., lib/sh). + XXX - should we do spelling correction on these? */ + + /* This is test as it was in bash-4.2: skip relative pathnames in current + directory. Change test to + (local_dirname[0] != '.' || (local_dirname[1] && local_dirname[1] != '/')) + if we want to skip paths beginning with ./ also. */ + if (no_symbolic_links == 0 && (local_dirname[0] != '.' || local_dirname[1])) + { + char *temp1, *temp2; + int len1, len2; + + /* If we have a relative path + (local_dirname[0] != '/' && local_dirname[0] != '.') + that is canonical after appending it to the current directory, then + temp1 = temp2+'/' + That is, + strcmp (temp1, temp2) == 0 + after adding a slash to temp2 below. It should be safe to not + change those. + */ + t = get_working_directory ("symlink-hook"); + temp1 = make_absolute (local_dirname, t); + free (t); + temp2 = sh_canonpath (temp1, PATH_CHECKDOTDOT|PATH_CHECKEXISTS); + + /* Try spelling correction if initial canonicalization fails. Make + sure we are set to replace the directory name with the results so + subsequent directory checks don't fail. */ + if (temp2 == 0 && dircomplete_spelling && dircomplete_expand) + { + temp2 = dirspell (temp1); + if (temp2) + { + free (temp1); + temp1 = temp2; + temp2 = sh_canonpath (temp1, PATH_CHECKDOTDOT|PATH_CHECKEXISTS); + return_value |= temp2 != 0; + } + } + /* If we can't canonicalize, bail. */ + if (temp2 == 0) + { + free (temp1); + return return_value; + } + len1 = strlen (temp1); + if (temp1[len1 - 1] == '/') + { + len2 = strlen (temp2); + if (len2 > 2) /* don't append `/' to `/' or `//' */ + { + temp2 = (char *)xrealloc (temp2, len2 + 2); + temp2[len2] = '/'; + temp2[len2 + 1] = '\0'; + } + } + + /* dircomplete_expand_relpath == 0 means we want to leave relative + pathnames that are unchanged by canonicalization alone. + *local_dirname != '/' && *local_dirname != '.' == relative pathname + (consistent with general.c:absolute_pathname()) + temp1 == temp2 (after appending a slash to temp2) means the pathname + is not changed by canonicalization as described above. */ + if (dircomplete_expand_relpath || ((local_dirname[0] != '/' && local_dirname[0] != '.') && STREQ (temp1, temp2) == 0)) + return_value |= STREQ (local_dirname, temp2) == 0; + free (local_dirname); + *dirname = temp2; + free (temp1); + } + + return (return_value); +} + +static char **history_completion_array = (char **)NULL; +static int harry_size; +static int harry_len; + +static void +build_history_completion_array () +{ + register int i, j; + HIST_ENTRY **hlist; + char **tokens; + + /* First, clear out the current dynamic history completion list. */ + if (harry_size) + { + strvec_dispose (history_completion_array); + history_completion_array = (char **)NULL; + harry_size = 0; + harry_len = 0; + } + + /* Next, grovel each line of history, making each shell-sized token + a separate entry in the history_completion_array. */ + hlist = history_list (); + + if (hlist) + { + for (i = 0; hlist[i]; i++) + ; + for ( --i; i >= 0; i--) + { + /* Separate each token, and place into an array. */ + tokens = history_tokenize (hlist[i]->line); + + for (j = 0; tokens && tokens[j]; j++) + { + if (harry_len + 2 > harry_size) + history_completion_array = strvec_resize (history_completion_array, harry_size += 10); + + history_completion_array[harry_len++] = tokens[j]; + history_completion_array[harry_len] = (char *)NULL; + } + free (tokens); + } + + /* Sort the complete list of tokens. */ + if (dabbrev_expand_active == 0) + qsort (history_completion_array, harry_len, sizeof (char *), (QSFUNC *)strvec_strcmp); + } +} + +static char * +history_completion_generator (hint_text, state) + const char *hint_text; + int state; +{ + static int local_index, len; + static const char *text; + + /* If this is the first call to the generator, then initialize the + list of strings to complete over. */ + if (state == 0) + { + if (dabbrev_expand_active) /* This is kind of messy */ + rl_completion_suppress_append = 1; + local_index = 0; + build_history_completion_array (); + text = hint_text; + len = strlen (text); + } + + while (history_completion_array && history_completion_array[local_index]) + { + if (strncmp (text, history_completion_array[local_index++], len) == 0) + return (savestring (history_completion_array[local_index - 1])); + } + return ((char *)NULL); +} + +static int +dynamic_complete_history (count, key) + int count, key; +{ + int r; + rl_compentry_func_t *orig_func; + rl_completion_func_t *orig_attempt_func; + rl_compignore_func_t *orig_ignore_func; + + orig_func = rl_completion_entry_function; + orig_attempt_func = rl_attempted_completion_function; + orig_ignore_func = rl_ignore_some_completions_function; + + rl_completion_entry_function = history_completion_generator; + rl_attempted_completion_function = (rl_completion_func_t *)NULL; + rl_ignore_some_completions_function = filename_completion_ignore; + + /* XXX - use rl_completion_mode here? */ + if (rl_last_func == dynamic_complete_history) + r = rl_complete_internal ('?'); + else + r = rl_complete_internal (TAB); + + rl_completion_entry_function = orig_func; + rl_attempted_completion_function = orig_attempt_func; + rl_ignore_some_completions_function = orig_ignore_func; + + return r; +} + +static int +bash_dabbrev_expand (count, key) + int count, key; +{ + int r, orig_suppress, orig_sort; + rl_compentry_func_t *orig_func; + rl_completion_func_t *orig_attempt_func; + rl_compignore_func_t *orig_ignore_func; + + orig_func = rl_menu_completion_entry_function; + orig_attempt_func = rl_attempted_completion_function; + orig_ignore_func = rl_ignore_some_completions_function; + orig_suppress = rl_completion_suppress_append; + orig_sort = rl_sort_completion_matches; + + rl_menu_completion_entry_function = history_completion_generator; + rl_attempted_completion_function = (rl_completion_func_t *)NULL; + rl_ignore_some_completions_function = filename_completion_ignore; + rl_filename_completion_desired = 0; + rl_completion_suppress_append = 1; + rl_sort_completion_matches = 0; + + /* XXX - use rl_completion_mode here? */ + dabbrev_expand_active = 1; + if (rl_last_func == bash_dabbrev_expand) + rl_last_func = rl_menu_complete; + r = rl_menu_complete (count, key); + dabbrev_expand_active = 0; + + rl_last_func = bash_dabbrev_expand; + rl_menu_completion_entry_function = orig_func; + rl_attempted_completion_function = orig_attempt_func; + rl_ignore_some_completions_function = orig_ignore_func; + rl_completion_suppress_append = orig_suppress; + rl_sort_completion_matches = orig_sort; + + return r; +} + +#if defined (SPECIFIC_COMPLETION_FUNCTIONS) +static int +bash_complete_username (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_username_internal (rl_completion_mode (bash_complete_username)); +} + +static int +bash_possible_username_completions (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_username_internal ('?'); +} + +static int +bash_complete_username_internal (what_to_do) + int what_to_do; +{ + return bash_specific_completion (what_to_do, rl_username_completion_function); +} + +static int +bash_complete_filename (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_filename_internal (rl_completion_mode (bash_complete_filename)); +} + +static int +bash_possible_filename_completions (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_filename_internal ('?'); +} + +static int +bash_complete_filename_internal (what_to_do) + int what_to_do; +{ + rl_compentry_func_t *orig_func; + rl_completion_func_t *orig_attempt_func; + rl_icppfunc_t *orig_dir_func; + rl_compignore_func_t *orig_ignore_func; + /*const*/ char *orig_rl_completer_word_break_characters; + int r; + + orig_func = rl_completion_entry_function; + orig_attempt_func = rl_attempted_completion_function; + orig_ignore_func = rl_ignore_some_completions_function; + orig_rl_completer_word_break_characters = rl_completer_word_break_characters; + + orig_dir_func = save_directory_hook (); + + rl_completion_entry_function = rl_filename_completion_function; + rl_attempted_completion_function = (rl_completion_func_t *)NULL; + rl_ignore_some_completions_function = filename_completion_ignore; + rl_completer_word_break_characters = " \t\n\"\'"; + + r = rl_complete_internal (what_to_do); + + rl_completion_entry_function = orig_func; + rl_attempted_completion_function = orig_attempt_func; + rl_ignore_some_completions_function = orig_ignore_func; + rl_completer_word_break_characters = orig_rl_completer_word_break_characters; + + restore_directory_hook (orig_dir_func); + + return r; +} + +static int +bash_complete_hostname (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_hostname_internal (rl_completion_mode (bash_complete_hostname)); +} + +static int +bash_possible_hostname_completions (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_hostname_internal ('?'); +} + +static int +bash_complete_variable (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_variable_internal (rl_completion_mode (bash_complete_variable)); +} + +static int +bash_possible_variable_completions (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_variable_internal ('?'); +} + +static int +bash_complete_command (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_command_internal (rl_completion_mode (bash_complete_command)); +} + +static int +bash_possible_command_completions (ignore, ignore2) + int ignore, ignore2; +{ + return bash_complete_command_internal ('?'); +} + +static int +bash_complete_hostname_internal (what_to_do) + int what_to_do; +{ + return bash_specific_completion (what_to_do, hostname_completion_function); +} + +static int +bash_complete_variable_internal (what_to_do) + int what_to_do; +{ + return bash_specific_completion (what_to_do, variable_completion_function); +} + +static int +bash_complete_command_internal (what_to_do) + int what_to_do; +{ + return bash_specific_completion (what_to_do, command_word_completion_function); +} + +static char *globtext; +static char *globorig; + +static char * +glob_complete_word (text, state) + const char *text; + int state; +{ + static char **matches = (char **)NULL; + static int ind; + int glen; + char *ret, *ttext; + + if (state == 0) + { + rl_filename_completion_desired = 1; + FREE (matches); + if (globorig != globtext) + FREE (globorig); + FREE (globtext); + + ttext = bash_tilde_expand (text, 0); + + if (rl_explicit_arg) + { + globorig = savestring (ttext); + glen = strlen (ttext); + globtext = (char *)xmalloc (glen + 2); + strcpy (globtext, ttext); + globtext[glen] = '*'; + globtext[glen+1] = '\0'; + } + else + globtext = globorig = savestring (ttext); + + if (ttext != text) + free (ttext); + + matches = shell_glob_filename (globtext); + if (GLOB_FAILED (matches)) + matches = (char **)NULL; + ind = 0; + } + + ret = matches ? matches[ind] : (char *)NULL; + ind++; + return ret; +} + +static int +bash_glob_completion_internal (what_to_do) + int what_to_do; +{ + return bash_specific_completion (what_to_do, glob_complete_word); +} + +/* A special quoting function so we don't end up quoting globbing characters + in the word if there are no matches or multiple matches. */ +static char * +bash_glob_quote_filename (s, rtype, qcp) + char *s; + int rtype; + char *qcp; +{ + if (globorig && qcp && *qcp == '\0' && STREQ (s, globorig)) + return (savestring (s)); + else + return (bash_quote_filename (s, rtype, qcp)); +} + +static int +bash_glob_complete_word (count, key) + int count, key; +{ + int r; + rl_quote_func_t *orig_quoting_function; + + if (rl_editing_mode == EMACS_EDITING_MODE) + rl_explicit_arg = 1; /* force `*' append */ + orig_quoting_function = rl_filename_quoting_function; + rl_filename_quoting_function = bash_glob_quote_filename; + + r = bash_glob_completion_internal (rl_completion_mode (bash_glob_complete_word)); + + rl_filename_quoting_function = orig_quoting_function; + return r; +} + +static int +bash_glob_expand_word (count, key) + int count, key; +{ + return bash_glob_completion_internal ('*'); +} + +static int +bash_glob_list_expansions (count, key) + int count, key; +{ + return bash_glob_completion_internal ('?'); +} + +static int +bash_specific_completion (what_to_do, generator) + int what_to_do; + rl_compentry_func_t *generator; +{ + rl_compentry_func_t *orig_func; + rl_completion_func_t *orig_attempt_func; + rl_compignore_func_t *orig_ignore_func; + int r; + + orig_func = rl_completion_entry_function; + orig_attempt_func = rl_attempted_completion_function; + orig_ignore_func = rl_ignore_some_completions_function; + rl_completion_entry_function = generator; + rl_attempted_completion_function = NULL; + rl_ignore_some_completions_function = orig_ignore_func; + + r = rl_complete_internal (what_to_do); + + rl_completion_entry_function = orig_func; + rl_attempted_completion_function = orig_attempt_func; + rl_ignore_some_completions_function = orig_ignore_func; + + return r; +} + +#endif /* SPECIFIC_COMPLETION_FUNCTIONS */ + +#if defined (VI_MODE) +/* Completion, from vi mode's point of view. This is a modified version of + rl_vi_complete which uses the bash globbing code to implement what POSIX + specifies, which is to append a `*' and attempt filename generation (which + has the side effect of expanding any globbing characters in the word). */ +static int +bash_vi_complete (count, key) + int count, key; +{ +#if defined (SPECIFIC_COMPLETION_FUNCTIONS) + int p, r; + char *t; + + if ((rl_point < rl_end) && (!whitespace (rl_line_buffer[rl_point]))) + { + if (!whitespace (rl_line_buffer[rl_point + 1])) + rl_vi_end_word (1, 'E'); + rl_point++; + } + + /* Find boundaries of current word, according to vi definition of a + `bigword'. */ + t = 0; + if (rl_point > 0) + { + p = rl_point; + rl_vi_bWord (1, 'B'); + r = rl_point; + rl_point = p; + p = r; + + t = substring (rl_line_buffer, p, rl_point); + } + + if (t && glob_pattern_p (t) == 0) + rl_explicit_arg = 1; /* XXX - force glob_complete_word to append `*' */ + FREE (t); + + if (key == '*') /* Expansion and replacement. */ + r = bash_glob_expand_word (count, key); + else if (key == '=') /* List possible completions. */ + r = bash_glob_list_expansions (count, key); + else if (key == '\\') /* Standard completion */ + r = bash_glob_complete_word (count, key); + else + r = rl_complete (0, key); + + if (key == '*' || key == '\\') + rl_vi_start_inserting (key, 1, 1); + + return (r); +#else + return rl_vi_complete (count, key); +#endif /* !SPECIFIC_COMPLETION_FUNCTIONS */ +} +#endif /* VI_MODE */ + +/* Filename quoting for completion. */ +/* A function to strip unquoted quote characters (single quotes, double + quotes, and backslashes). It allows single quotes to appear + within double quotes, and vice versa. It should be smarter. */ +static char * +bash_dequote_filename (text, quote_char) + char *text; + int quote_char; +{ + char *ret, *p, *r; + int l, quoted; + + l = strlen (text); + ret = (char *)xmalloc (l + 1); + for (quoted = quote_char, p = text, r = ret; p && *p; p++) + { + /* Allow backslash-escaped characters to pass through unscathed. */ + if (*p == '\\') + { + /* Backslashes are preserved within single quotes. */ + if (quoted == '\'') + *r++ = *p; + /* Backslashes are preserved within double quotes unless the + character is one that is defined to be escaped */ + else if (quoted == '"' && ((sh_syntaxtab[p[1]] & CBSDQUOTE) == 0)) + *r++ = *p; + + *r++ = *++p; + if (*p == '\0') + return ret; /* XXX - was break; */ + continue; + } + /* Close quote. */ + if (quoted && *p == quoted) + { + quoted = 0; + continue; + } + /* Open quote. */ + if (quoted == 0 && (*p == '\'' || *p == '"')) + { + quoted = *p; + continue; + } + *r++ = *p; + } + *r = '\0'; + return ret; +} + +/* Quote characters that the readline completion code would treat as + word break characters with backslashes. Pass backslash-quoted + characters through without examination. */ +static char * +quote_word_break_chars (text) + char *text; +{ + char *ret, *r, *s; + int l; + + l = strlen (text); + ret = (char *)xmalloc ((2 * l) + 1); + for (s = text, r = ret; *s; s++) + { + /* Pass backslash-quoted characters through, including the backslash. */ + if (*s == '\\') + { + *r++ = '\\'; + *r++ = *++s; + if (*s == '\0') + break; + continue; + } + /* OK, we have an unquoted character. Check its presence in + rl_completer_word_break_characters. */ + if (mbschr (rl_completer_word_break_characters, *s)) + *r++ = '\\'; + /* XXX -- check for standalone tildes here and backslash-quote them */ + if (s == text && *s == '~' && file_exists (text)) + *r++ = '\\'; + *r++ = *s; + } + *r = '\0'; + return ret; +} + +/* Use characters in STRING to populate the table of characters that should + be backslash-quoted. The table will be used for sh_backslash_quote from + this file. */ +static void +set_filename_bstab (string) + const char *string; +{ + const char *s; + + memset (filename_bstab, 0, sizeof (filename_bstab)); + for (s = string; s && *s; s++) + filename_bstab[*s] = 1; +} + +/* Quote a filename using double quotes, single quotes, or backslashes + depending on the value of completion_quoting_style. If we're + completing using backslashes, we need to quote some additional + characters (those that readline treats as word breaks), so we call + quote_word_break_chars on the result. This returns newly-allocated + memory. */ +static char * +bash_quote_filename (s, rtype, qcp) + char *s; + int rtype; + char *qcp; +{ + char *rtext, *mtext, *ret; + int rlen, cs; + + rtext = (char *)NULL; + + /* If RTYPE == MULT_MATCH, it means that there is + more than one match. In this case, we do not add + the closing quote or attempt to perform tilde + expansion. If RTYPE == SINGLE_MATCH, we try + to perform tilde expansion, because single and double + quotes inhibit tilde expansion by the shell. */ + + cs = completion_quoting_style; + /* Might need to modify the default completion style based on *qcp, + since it's set to any user-provided opening quote. We also change + to single-quoting if there is no user-provided opening quote and + the word being completed contains newlines, since those are not + quoted correctly using backslashes (a backslash-newline pair is + special to the shell parser). */ + if (*qcp == '\0' && cs == COMPLETE_BSQUOTE && mbschr (s, '\n')) + cs = COMPLETE_SQUOTE; + else if (*qcp == '"') + cs = COMPLETE_DQUOTE; + else if (*qcp == '\'') + cs = COMPLETE_SQUOTE; +#if defined (BANG_HISTORY) + else if (*qcp == '\0' && history_expansion && cs == COMPLETE_DQUOTE && + history_expansion_inhibited == 0 && mbschr (s, '!')) + cs = COMPLETE_BSQUOTE; + + if (*qcp == '"' && history_expansion && cs == COMPLETE_DQUOTE && + history_expansion_inhibited == 0 && mbschr (s, '!')) + { + cs = COMPLETE_BSQUOTE; + *qcp = '\0'; + } +#endif + + /* Don't tilde-expand backslash-quoted filenames, since only single and + double quotes inhibit tilde expansion. */ + mtext = s; + if (mtext[0] == '~' && rtype == SINGLE_MATCH && cs != COMPLETE_BSQUOTE) + mtext = bash_tilde_expand (s, 0); + + switch (cs) + { + case COMPLETE_DQUOTE: + rtext = sh_double_quote (mtext); + break; + case COMPLETE_SQUOTE: + rtext = sh_single_quote (mtext); + break; + case COMPLETE_BSQUOTE: + rtext = sh_backslash_quote (mtext, complete_fullquote ? 0 : filename_bstab, 0); + break; + } + + if (mtext != s) + free (mtext); + + /* We may need to quote additional characters: those that readline treats + as word breaks that are not quoted by backslash_quote. */ + if (rtext && cs == COMPLETE_BSQUOTE) + { + mtext = quote_word_break_chars (rtext); + free (rtext); + rtext = mtext; + } + + /* Leave the opening quote intact. The readline completion code takes + care of avoiding doubled opening quotes. */ + if (rtext) + { + rlen = strlen (rtext); + ret = (char *)xmalloc (rlen + 1); + strcpy (ret, rtext); + } + else + { + ret = (char *)xmalloc (rlen = 1); + ret[0] = '\0'; + } + + /* If there are multiple matches, cut off the closing quote. */ + if (rtype == MULT_MATCH && cs != COMPLETE_BSQUOTE) + ret[rlen - 1] = '\0'; + free (rtext); + return ret; +} + +/* Support for binding readline key sequences to Unix commands. */ +static Keymap cmd_xmap; + +#ifdef _MINIX +static void +#else +static int +#endif +putx(c) + int c; +{ + int x; + x = putc (c, rl_outstream); +#ifndef _MINIX + return x; +#endif +} + +static int +bash_execute_unix_command (count, key) + int count; /* ignored */ + int key; +{ + Keymap ckmap; /* current keymap */ + Keymap xkmap; /* unix command executing keymap */ + rl_command_func_t *func; + int type; + register int i, r; + intmax_t mi; + sh_parser_state_t ps; + char *cmd, *value, *l, *l1, *ce; + SHELL_VAR *v; + char ibuf[INT_STRLEN_BOUND(int) + 1]; + + /* First, we need to find the right command to execute. This is tricky, + because we might have already indirected into another keymap, so we + have to walk cmd_xmap using the entire key sequence. */ + cmd = (char *)rl_function_of_keyseq (rl_executing_keyseq, cmd_xmap, &type); + + if (cmd == 0 || type != ISMACR) + { + rl_crlf (); + internal_error (_("bash_execute_unix_command: cannot find keymap for command")); + rl_forced_update_display (); + return 1; + } + + ce = rl_get_termcap ("ce"); + if (ce) /* clear current line */ + { + fprintf (rl_outstream, "\r"); + tputs (ce, 1, putx); + fflush (rl_outstream); + } + else + rl_crlf (); /* move to a new line */ + + v = bind_variable ("READLINE_LINE", rl_line_buffer, 0); + if (v) + VSETATTR (v, att_exported); + l = v ? value_cell (v) : 0; + value = inttostr (rl_point, ibuf, sizeof (ibuf)); + v = bind_int_variable ("READLINE_POINT", value); + if (v) + VSETATTR (v, att_exported); + array_needs_making = 1; + + save_parser_state (&ps); + r = parse_and_execute (cmd, "bash_execute_unix_command", SEVAL_NOHIST|SEVAL_NOFREE); + restore_parser_state (&ps); + + v = find_variable ("READLINE_LINE"); + l1 = v ? value_cell (v) : 0; + if (l1 != l) + maybe_make_readline_line (value_cell (v)); + v = find_variable ("READLINE_POINT"); + if (v && legal_number (value_cell (v), &mi)) + { + i = mi; + if (i != rl_point) + { + rl_point = i; + if (rl_point > rl_end) + rl_point = rl_end; + else if (rl_point < 0) + rl_point = 0; + } + } + + unbind_variable ("READLINE_LINE"); + unbind_variable ("READLINE_POINT"); + array_needs_making = 1; + + /* and restore the readline buffer and display after command execution. */ + rl_forced_update_display (); + return 0; +} + +int +print_unix_command_map () +{ + Keymap save; + + save = rl_get_keymap (); + rl_set_keymap (cmd_xmap); + rl_macro_dumper (1); + rl_set_keymap (save); + return 0; +} + +static void +init_unix_command_map () +{ + cmd_xmap = rl_make_bare_keymap (); +} + +static int +isolate_sequence (string, ind, need_dquote, startp) + char *string; + int ind, need_dquote, *startp; +{ + register int i; + int c, passc, delim; + + for (i = ind; string[i] && whitespace (string[i]); i++) + ; + /* NEED_DQUOTE means that the first non-white character *must* be `"'. */ + if (need_dquote && string[i] != '"') + { + builtin_error (_("%s: first non-whitespace character is not `\"'"), string); + return -1; + } + + /* We can have delimited strings even if NEED_DQUOTE == 0, like the command + string to bind the key sequence to. */ + delim = (string[i] == '"' || string[i] == '\'') ? string[i] : 0; + + if (startp) + *startp = delim ? ++i : i; + + for (passc = 0; c = string[i]; i++) + { + if (passc) + { + passc = 0; + continue; + } + if (c == '\\') + { + passc++; + continue; + } + if (c == delim) + break; + } + + if (delim && string[i] != delim) + { + builtin_error (_("no closing `%c' in %s"), delim, string); + return -1; + } + + return i; +} + +int +bind_keyseq_to_unix_command (line) + char *line; +{ + Keymap kmap; + char *kseq, *value; + int i, kstart; + + if (cmd_xmap == 0) + init_unix_command_map (); + + kmap = rl_get_keymap (); + + /* We duplicate some of the work done by rl_parse_and_bind here, but + this code only has to handle `"keyseq": ["]command["]' and can + generate an error for anything else. */ + i = isolate_sequence (line, 0, 1, &kstart); + if (i < 0) + return -1; + + /* Create the key sequence string to pass to rl_generic_bind */ + kseq = substring (line, kstart, i); + + for ( ; line[i] && line[i] != ':'; i++) + ; + if (line[i] != ':') + { + builtin_error (_("%s: missing colon separator"), line); + FREE (kseq); + return -1; + } + + i = isolate_sequence (line, i + 1, 0, &kstart); + if (i < 0) + { + FREE (kseq); + return -1; + } + + /* Create the value string containing the command to execute. */ + value = substring (line, kstart, i); + + /* Save the command to execute and the key sequence in the CMD_XMAP */ + rl_generic_bind (ISMACR, kseq, value, cmd_xmap); + + /* and bind the key sequence in the current keymap to a function that + understands how to execute from CMD_XMAP */ + rl_bind_keyseq_in_map (kseq, bash_execute_unix_command, kmap); + + free (kseq); + return 0; +} + +/* Used by the programmable completion code. Complete TEXT as a filename, + but return only directories as matches. Dequotes the filename before + attempting to find matches. */ +char ** +bash_directory_completion_matches (text) + const char *text; +{ + char **m1; + char *dfn; + int qc; + + qc = rl_dispatching ? rl_completion_quote_character : 0; + /* If rl_completion_found_quote != 0, rl_completion_matches will call the + filename dequoting function, causing the directory name to be dequoted + twice. */ + if (rl_dispatching && rl_completion_found_quote == 0) + dfn = bash_dequote_filename ((char *)text, qc); + else + dfn = (char *)text; + m1 = rl_completion_matches (dfn, rl_filename_completion_function); + if (dfn != text) + free (dfn); + + if (m1 == 0 || m1[0] == 0) + return m1; + /* We don't bother recomputing the lcd of the matches, because it will just + get thrown away by the programmable completion code and recomputed + later. */ + (void)bash_ignore_filenames (m1); + return m1; +} + +char * +bash_dequote_text (text) + const char *text; +{ + char *dtxt; + int qc; + + qc = (text[0] == '"' || text[0] == '\'') ? text[0] : 0; + dtxt = bash_dequote_filename ((char *)text, qc); + return (dtxt); +} + +/* This event hook is designed to be called after readline receives a signal + that interrupts read(2). It gives reasonable responsiveness to interrupts + and fatal signals without executing too much code in a signal handler + context. */ +static int +bash_event_hook () +{ + /* If we're going to longjmp to top_level, make sure we clean up readline. + check_signals will call QUIT, which will eventually longjmp to top_level, + calling run_interrupt_trap along the way. */ + if (interrupt_state) + rl_cleanup_after_signal (); + bashline_reset_event_hook (); + check_signals_and_traps (); /* XXX */ + return 0; +} + +#endif /* READLINE */ diff --git a/bashline.h b/bashline.h new file mode 100644 index 0000000..d52dfdf --- /dev/null +++ b/bashline.h @@ -0,0 +1,57 @@ +/* bashline.h -- interface to the bash readline functions in bashline.c. */ + +/* Copyright (C) 1993-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_BASHLINE_H_) +#define _BASHLINE_H_ + +#include "stdc.h" + +extern int bash_readline_initialized; + +extern void posix_readline_initialize __P((int)); +extern void reset_completer_word_break_chars __P((void)); +extern int enable_hostname_completion __P((int)); +extern void initialize_readline __P((void)); +extern void bashline_reset __P((void)); +extern void bashline_reinitialize __P((void)); +extern int bash_re_edit __P((char *)); + +extern void bashline_set_event_hook __P((void)); +extern void bashline_reset_event_hook __P((void)); + +extern int bind_keyseq_to_unix_command __P((char *)); +extern int print_unix_command_map __P((void)); + +extern char **bash_default_completion __P((const char *, int, int, int, int)); + +void set_directory_hook __P((void)); + +/* Used by programmable completion code. */ +extern char *command_word_completion_function __P((const char *, int)); +extern char *bash_groupname_completion_function __P((const char *, int)); +extern char *bash_servicename_completion_function __P((const char *, int)); + +extern char **get_hostname_list __P((void)); +extern void clear_hostname_list __P((void)); + +extern char **bash_directory_completion_matches __P((const char *)); +extern char *bash_dequote_text __P((const char *)); + +#endif /* _BASHLINE_H_ */ diff --git a/bashtypes.h b/bashtypes.h new file mode 100644 index 0000000..01afef4 --- /dev/null +++ b/bashtypes.h @@ -0,0 +1,42 @@ +/* bashtypes.h -- Bash system types. */ + +/* Copyright (C) 1993-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_BASHTYPES_H_) +# define _BASHTYPES_H_ + +#if defined (CRAY) +# define word __word +#endif + +#include + +#if defined (CRAY) +# undef word +#endif + +#if defined (HAVE_INTTYPES_H) +# include +#endif + +#if HAVE_STDINT_H +# include +#endif + +#endif /* _BASHTYPES_H_ */ diff --git a/bracecomp.c b/bracecomp.c new file mode 100644 index 0000000..4fbca85 --- /dev/null +++ b/bracecomp.c @@ -0,0 +1,221 @@ +/* bracecomp.c -- Complete a filename with the possible completions enclosed + in csh-style braces such that the list of completions is available to the + shell. */ + +/* Original version by tromey@cns.caltech.edu, Fri Feb 7 1992. */ + +/* Copyright (C) 1993-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#if defined (BRACE_EXPANSION) && defined (READLINE) + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "bashansi.h" +#include "shmbutil.h" + +#include "shell.h" +#include + +static int _strcompare __P((char **, char **)); + +/* Find greatest common prefix of two strings. */ +static int +string_gcd (s1, s2) + char *s1, *s2; +{ + register int i; + + if (s1 == NULL || s2 == NULL) + return (0); + + for (i = 0; *s1 && *s2; ++s1, ++s2, ++i) + { + if (*s1 != *s2) + break; + } + + return (i); +} + +static char * +really_munge_braces (array, real_start, real_end, gcd_zero) + char **array; + int real_start, real_end, gcd_zero; +{ + int start, end, gcd; + char *result, *subterm, *x; + int result_size, flag, tlen; + + flag = 0; + + if (real_start == real_end) + { + x = array[real_start] ? sh_backslash_quote (array[real_start] + gcd_zero, 0, 0) + : sh_backslash_quote (array[0], 0, 0); + return x; + } + + result = (char *)xmalloc (result_size = 16); + *result = '\0'; + + for (start = real_start; start < real_end; start = end + 1) + { + gcd = strlen (array[start]); + for (end = start + 1; end < real_end; end++) + { + int temp; + + temp = string_gcd (array[start], array[end]); + + if (temp <= gcd_zero) + break; + + gcd = temp; + } + end--; + + if (gcd_zero == 0 && start == real_start && end != (real_end - 1)) + { + /* In this case, add in a leading '{', because we are at + top level, and there isn't a consistent prefix. */ + result_size += 1; + result = (char *)xrealloc (result, result_size); + result[0] = '{'; result[1] = '\0'; + flag++; + } + + /* Make sure we backslash quote every substring we insert into the + resultant brace expression. This is so the default filename + quoting function won't inappropriately quote the braces. */ + if (start == end) + { + x = savestring (array[start] + gcd_zero); + subterm = sh_backslash_quote (x, 0, 0); + free (x); + } + else + { + /* If there is more than one element in the subarray, + insert the (quoted) prefix and an opening brace. */ + tlen = gcd - gcd_zero; + x = (char *)xmalloc (tlen + 1); + strncpy (x, array[start] + gcd_zero, tlen); + x[tlen] = '\0'; + subterm = sh_backslash_quote (x, 0, 0); + free (x); + result_size += strlen (subterm) + 1; + result = (char *)xrealloc (result, result_size); + strcat (result, subterm); + free (subterm); + strcat (result, "{"); + subterm = really_munge_braces (array, start, end + 1, gcd); + subterm[strlen (subterm) - 1] = '}'; + } + + result_size += strlen (subterm) + 1; + result = (char *)xrealloc (result, result_size); + strcat (result, subterm); + strcat (result, ","); + free (subterm); + } + + if (gcd_zero == 0) + result[strlen (result) - 1] = flag ? '}' : '\0'; + return (result); +} + +static int +_strcompare (s1, s2) + char **s1, **s2; +{ + int result; + + result = **s1 - **s2; + if (result == 0) + result = strcmp (*s1, *s2); + + return result; +} + +static int +hack_braces_completion (names) + char **names; +{ + register int i; + char *temp; + + i = strvec_len (names); + if (MB_CUR_MAX > 1 && i > 2) + qsort (names+1, i-1, sizeof (char *), (QSFUNC *)_strcompare); + + temp = really_munge_braces (names, 1, i, 0); + + for (i = 0; names[i]; ++i) + { + free (names[i]); + names[i] = NULL; + } + names[0] = temp; + return 0; +} + +/* We handle quoting ourselves within hack_braces_completion, so we turn off + rl_filename_quoting_desired and rl_filename_quoting_function. */ +int +bash_brace_completion (count, ignore) + int count, ignore; +{ + rl_compignore_func_t *orig_ignore_func; + rl_compentry_func_t *orig_entry_func; + rl_quote_func_t *orig_quoting_func; + rl_completion_func_t *orig_attempt_func; + int orig_quoting_desired, r; + + orig_ignore_func = rl_ignore_some_completions_function; + orig_attempt_func = rl_attempted_completion_function; + orig_entry_func = rl_completion_entry_function; + orig_quoting_func = rl_filename_quoting_function; + orig_quoting_desired = rl_filename_quoting_desired; + + rl_completion_entry_function = rl_filename_completion_function; + rl_attempted_completion_function = (rl_completion_func_t *)NULL; + rl_ignore_some_completions_function = hack_braces_completion; + rl_filename_quoting_function = (rl_quote_func_t *)NULL; + rl_filename_quoting_desired = 0; + + r = rl_complete_internal (TAB); + + rl_ignore_some_completions_function = orig_ignore_func; + rl_attempted_completion_function = orig_attempt_func; + rl_completion_entry_function = orig_entry_func; + rl_filename_quoting_function = orig_quoting_func; + rl_filename_quoting_desired = orig_quoting_desired; + + return r; +} +#endif /* BRACE_EXPANSION && READLINE */ diff --git a/braces.c b/braces.c new file mode 100644 index 0000000..61c1ab1 --- /dev/null +++ b/braces.c @@ -0,0 +1,835 @@ +/* braces.c -- code for doing word expansion in curly braces. */ + +/* Copyright (C) 1987-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Stuff in curly braces gets expanded before all other shell expansions. */ + +#include "config.h" + +#if defined (BRACE_EXPANSION) + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include + +#include "bashansi.h" +#include "bashintl.h" + +#if defined (SHELL) +# include "shell.h" +#endif /* SHELL */ + +#include "typemax.h" /* INTMAX_MIN, INTMAX_MAX */ +#include "general.h" +#include "shmbutil.h" +#include "chartypes.h" + +#ifndef errno +extern int errno; +#endif + +#define brace_whitespace(c) (!(c) || (c) == ' ' || (c) == '\t' || (c) == '\n') + +#define BRACE_SEQ_SPECIFIER ".." + +extern int asprintf __P((char **, const char *, ...)) __attribute__((__format__ (printf, 2, 3))); + +extern int last_command_exit_value; + +/* Basic idea: + + Segregate the text into 3 sections: preamble (stuff before an open brace), + postamble (stuff after the matching close brace) and amble (stuff after + preamble, and before postamble). Expand amble, and then tack on the + expansions to preamble. Expand postamble, and tack on the expansions to + the result so far. + */ + +/* The character which is used to separate arguments. */ +static const int brace_arg_separator = ','; + +#if defined (__P) +static int brace_gobbler __P((char *, size_t, int *, int)); +static char **expand_amble __P((char *, size_t, int)); +static char **expand_seqterm __P((char *, size_t)); +static char **mkseq __P((intmax_t, intmax_t, intmax_t, int, int)); +static char **array_concat __P((char **, char **)); +#else +static int brace_gobbler (); +static char **expand_amble (); +static char **expand_seqterm (); +static char **mkseq(); +static char **array_concat (); +#endif + +#if 0 +static void +dump_result (a) + char **a; +{ + int i; + + for (i = 0; a[i]; i++) + printf ("dump_result: a[%d] = -%s-\n", i, a[i]); +} +#endif + +/* Return an array of strings; the brace expansion of TEXT. */ +char ** +brace_expand (text) + char *text; +{ + register int start; + size_t tlen; + char *preamble, *postamble, *amble; + size_t alen; + char **tack, **result; + int i, j, c, c1; + + DECLARE_MBSTATE; + + /* Find the text of the preamble. */ + tlen = strlen (text); + i = 0; +#if defined (CSH_BRACE_COMPAT) + c = brace_gobbler (text, tlen, &i, '{'); /* } */ +#else + /* Make sure that when we exit this loop, c == 0 or text[i] begins a + valid brace expansion sequence. */ + do + { + c = brace_gobbler (text, tlen, &i, '{'); /* } */ + c1 = c; + /* Verify that c begins a valid brace expansion word. If it doesn't, we + go on. Loop stops when there are no more open braces in the word. */ + if (c) + { + start = j = i + 1; /* { */ + c = brace_gobbler (text, tlen, &j, '}'); + if (c == 0) /* it's not */ + { + i++; + c = c1; + continue; + } + else /* it is */ + { + c = c1; + break; + } + } + else + break; + } + while (c); +#endif /* !CSH_BRACE_COMPAT */ + + preamble = (char *)xmalloc (i + 1); + if (i > 0) + strncpy (preamble, text, i); + preamble[i] = '\0'; + + result = (char **)xmalloc (2 * sizeof (char *)); + result[0] = preamble; + result[1] = (char *)NULL; + + /* Special case. If we never found an exciting character, then + the preamble is all of the text, so just return that. */ + if (c != '{') + return (result); + + /* Find the amble. This is the stuff inside this set of braces. */ + start = ++i; + c = brace_gobbler (text, tlen, &i, '}'); + + /* What if there isn't a matching close brace? */ + if (c == 0) + { +#if defined (NOTDEF) + /* Well, if we found an unquoted BRACE_ARG_SEPARATOR between START + and I, then this should be an error. Otherwise, it isn't. */ + j = start; + while (j < i) + { + if (text[j] == '\\') + { + j++; + ADVANCE_CHAR (text, tlen, j); + continue; + } + + if (text[j] == brace_arg_separator) + { /* { */ + strvec_dispose (result); + last_command_exit_value = 1; + report_error ("no closing `%c' in %s", '}', text); + throw_to_top_level (); + } + ADVANCE_CHAR (text, tlen, j); + } +#endif + free (preamble); /* Same as result[0]; see initialization. */ + result[0] = savestring (text); + return (result); + } + +#if defined (SHELL) + amble = substring (text, start, i); + alen = i - start; +#else + amble = (char *)xmalloc (1 + (i - start)); + strncpy (amble, &text[start], (i - start)); + alen = i - start; + amble[alen] = '\0'; +#endif + +#if defined (SHELL) + INITIALIZE_MBSTATE; + + /* If the amble does not contain an unquoted BRACE_ARG_SEPARATOR, then + just return without doing any expansion. */ + j = 0; + while (amble[j]) + { + if (amble[j] == '\\') + { + j++; + ADVANCE_CHAR (amble, alen, j); + continue; + } + + if (amble[j] == brace_arg_separator) + break; + + ADVANCE_CHAR (amble, alen, j); + } + + if (amble[j] == 0) + { + tack = expand_seqterm (amble, alen); + if (tack) + goto add_tack; + else if (text[i + 1]) + { + /* If the sequence expansion fails (e.g., because the integers + overflow), but there is more in the string, try and process + the rest of the string, which may contain additional brace + expansions. Treat the unexpanded sequence term as a simple + string (including the braces). */ + tack = strvec_create (2); + tack[0] = savestring (text+start-1); + tack[0][i-start+2] = '\0'; + tack[1] = (char *)0; + goto add_tack; + } + else + { + free (amble); + free (preamble); + result[0] = savestring (text); + return (result); + } + } +#endif /* SHELL */ + + tack = expand_amble (amble, alen, 0); +add_tack: + result = array_concat (result, tack); + free (amble); + if (tack != result) + strvec_dispose (tack); + + postamble = text + i + 1; + + if (postamble && *postamble) + { + tack = brace_expand (postamble); + result = array_concat (result, tack); + if (tack != result) + strvec_dispose (tack); + } + + return (result); +} + +/* Expand the text found inside of braces. We simply try to split the + text at BRACE_ARG_SEPARATORs into separate strings. We then brace + expand each slot which needs it, until there are no more slots which + need it. */ +static char ** +expand_amble (text, tlen, flags) + char *text; + size_t tlen; + int flags; +{ + char **result, **partial, **tresult; + char *tem; + int start, i, c; + + DECLARE_MBSTATE; + + result = (char **)NULL; + + start = i = 0; + c = 1; + while (c) + { + c = brace_gobbler (text, tlen, &i, brace_arg_separator); +#if defined (SHELL) + tem = substring (text, start, i); +#else + tem = (char *)xmalloc (1 + (i - start)); + strncpy (tem, &text[start], (i - start)); + tem[i- start] = '\0'; +#endif + + partial = brace_expand (tem); + + if (!result) + result = partial; + else + { + register int lr, lp, j; + + lr = strvec_len (result); + lp = strvec_len (partial); + + tresult = strvec_mresize (result, lp + lr + 1); + if (tresult == 0) + { + internal_error (_("brace expansion: cannot allocate memory for %s"), tem); + strvec_dispose (result); + result = (char **)NULL; + return result; + } + else + result = tresult; + + for (j = 0; j < lp; j++) + result[lr + j] = partial[j]; + + result[lr + j] = (char *)NULL; + free (partial); + } + free (tem); + ADVANCE_CHAR (text, tlen, i); + start = i; + } + return (result); +} + +#define ST_BAD 0 +#define ST_INT 1 +#define ST_CHAR 2 +#define ST_ZINT 3 + +#ifndef sh_imaxabs +# define sh_imaxabs(x) (((x) >= 0) ? (x) : -(x)) +#endif + +/* Handle signed arithmetic overflow and underflow. Have to do it this way + to avoid compilers optimizing out simpler overflow checks. */ + +/* Make sure that a+b does not exceed MAXV or is smaller than MINV (if b < 0). + Assumes that b > 0 if a > 0 and b < 0 if a < 0 */ +#define ADDOVERFLOW(a,b,minv,maxv) \ + ((((a) > 0) && ((b) > ((maxv) - (a)))) || \ + (((a) < 0) && ((b) < ((minv) - (a))))) + +/* Make sure that a-b is not smaller than MINV or exceeds MAXV (if b < 0). + Assumes that b > 0 if a > 0 and b < 0 if a < 0 */ +#define SUBOVERFLOW(a,b,minv,maxv) \ + ((((b) > 0) && ((a) < ((minv) + (b)))) || \ + (((b) < 0) && ((a) > ((maxv) + (b))))) + +static char ** +mkseq (start, end, incr, type, width) + intmax_t start, end, incr; + int type, width; +{ + intmax_t n, prevn; + int i, j, nelem; + char **result, *t; + + if (incr == 0) + incr = 1; + + if (start > end && incr > 0) + incr = -incr; + else if (start < end && incr < 0) + { + if (incr == INTMAX_MIN) /* Don't use -INTMAX_MIN */ + return ((char **)NULL); + incr = -incr; + } + + /* Check that end-start will not overflow INTMAX_MIN, INTMAX_MAX. The +3 + and -2, not strictly necessary, are there because of the way the number + of elements and value passed to strvec_create() are calculated below. */ + if (SUBOVERFLOW (end, start, INTMAX_MIN+3, INTMAX_MAX-2)) + return ((char **)NULL); + + prevn = sh_imaxabs (end - start); + /* Need to check this way in case INT_MAX == INTMAX_MAX */ + if (INT_MAX == INTMAX_MAX && (ADDOVERFLOW (prevn, 2, INT_MIN, INT_MAX))) + return ((char **)NULL); + /* Make sure the assignment to nelem below doesn't end up <= 0 due to + intmax_t overflow */ + else if (ADDOVERFLOW ((prevn/sh_imaxabs(incr)), 1, INTMAX_MIN, INTMAX_MAX)) + return ((char **)NULL); + + /* XXX - TOFIX: potentially allocating a lot of extra memory if + imaxabs(incr) != 1 */ + /* Instead of a simple nelem = prevn + 1, something like: + nelem = (prevn / imaxabs(incr)) + 1; + would work */ + nelem = (prevn / sh_imaxabs(incr)) + 1; + if (nelem > INT_MAX - 2) /* Don't overflow int */ + return ((char **)NULL); + result = strvec_mcreate (nelem + 1); + if (result == 0) + { + internal_error (_("brace expansion: failed to allocate memory for %d elements"), nelem); + return ((char **)NULL); + } + + /* Make sure we go through the loop at least once, so {3..3} prints `3' */ + i = 0; + n = start; + do + { +#if defined (SHELL) + QUIT; /* XXX - memory leak here */ +#endif + if (type == ST_INT) + result[i++] = t = itos (n); + else if (type == ST_ZINT) + { + int len, arg; + arg = n; + len = asprintf (&t, "%0*d", width, arg); + result[i++] = t; + } + else + { + if (t = (char *)malloc (2)) + { + t[0] = n; + t[1] = '\0'; + } + result[i++] = t; + } + + /* We failed to allocate memory for this number, so we bail. */ + if (t == 0) + { + char *p, lbuf[INT_STRLEN_BOUND(intmax_t) + 1]; + + /* Easier to do this than mess around with various intmax_t printf + formats (%ld? %lld? %jd?) and PRIdMAX. */ + p = inttostr (n, lbuf, sizeof (lbuf)); + internal_error (_("brace expansion: failed to allocate memory for `%s'"), p); + strvec_dispose (result); + return ((char **)NULL); + } + + /* Handle overflow and underflow of n+incr */ + if (ADDOVERFLOW (n, incr, INTMAX_MIN, INTMAX_MAX)) + break; + + n += incr; + + if ((incr < 0 && n < end) || (incr > 0 && n > end)) + break; + } + while (1); + + result[i] = (char *)0; + return (result); +} + +static char ** +expand_seqterm (text, tlen) + char *text; + size_t tlen; +{ + char *t, *lhs, *rhs; + int i, lhs_t, rhs_t, lhs_l, rhs_l, width; + intmax_t lhs_v, rhs_v, incr; + intmax_t tl, tr; + char **result, *ep, *oep; + + t = strstr (text, BRACE_SEQ_SPECIFIER); + if (t == 0) + return ((char **)NULL); + + lhs_l = t - text; /* index of start of BRACE_SEQ_SPECIFIER */ + lhs = substring (text, 0, lhs_l); + rhs = substring (text, lhs_l + sizeof(BRACE_SEQ_SPECIFIER) - 1, tlen); + + if (lhs[0] == 0 || rhs[0] == 0) + { + free (lhs); + free (rhs); + return ((char **)NULL); + } + + /* Now figure out whether LHS and RHS are integers or letters. Both + sides have to match. */ + lhs_t = (legal_number (lhs, &tl)) ? ST_INT : + ((ISALPHA (lhs[0]) && lhs[1] == 0) ? ST_CHAR : ST_BAD); + + /* Decide on rhs and whether or not it looks like the user specified + an increment */ + ep = 0; + if (ISDIGIT (rhs[0]) || ((rhs[0] == '+' || rhs[0] == '-') && ISDIGIT (rhs[1]))) + { + rhs_t = ST_INT; + errno = 0; + tr = strtoimax (rhs, &ep, 10); + if (errno == ERANGE || (ep && *ep != 0 && *ep != '.')) + rhs_t = ST_BAD; /* invalid */ + } + else if (ISALPHA (rhs[0]) && (rhs[1] == 0 || rhs[1] == '.')) + { + rhs_t = ST_CHAR; + ep = rhs + 1; + } + else + { + rhs_t = ST_BAD; + ep = 0; + } + + incr = 1; + if (rhs_t != ST_BAD) + { + oep = ep; + errno = 0; + if (ep && *ep == '.' && ep[1] == '.' && ep[2]) + incr = strtoimax (ep + 2, &ep, 10); + if (*ep != 0 || errno == ERANGE) + rhs_t = ST_BAD; /* invalid incr or overflow */ + tlen -= ep - oep; + } + + if (lhs_t != rhs_t || lhs_t == ST_BAD || rhs_t == ST_BAD) + { + free (lhs); + free (rhs); + return ((char **)NULL); + } + + /* OK, we have something. It's either a sequence of integers, ascending + or descending, or a sequence or letters, ditto. Generate the sequence, + put it into a string vector, and return it. */ + + if (lhs_t == ST_CHAR) + { + lhs_v = (unsigned char)lhs[0]; + rhs_v = (unsigned char)rhs[0]; + width = 1; + } + else + { + lhs_v = tl; /* integer truncation */ + rhs_v = tr; + + /* Decide whether or not the terms need zero-padding */ + rhs_l = tlen - lhs_l - sizeof (BRACE_SEQ_SPECIFIER) + 1; + width = 0; + if (lhs_l > 1 && lhs[0] == '0') + width = lhs_l, lhs_t = ST_ZINT; + if (lhs_l > 2 && lhs[0] == '-' && lhs[1] == '0') + width = lhs_l, lhs_t = ST_ZINT; + if (rhs_l > 1 && rhs[0] == '0' && width < rhs_l) + width = rhs_l, lhs_t = ST_ZINT; + if (rhs_l > 2 && rhs[0] == '-' && rhs[1] == '0' && width < rhs_l) + width = rhs_l, lhs_t = ST_ZINT; + + if (width < lhs_l && lhs_t == ST_ZINT) + width = lhs_l; + if (width < rhs_l && lhs_t == ST_ZINT) + width = rhs_l; + } + + result = mkseq (lhs_v, rhs_v, incr, lhs_t, width); + + free (lhs); + free (rhs); + + return (result); +} + +/* Start at INDEX, and skip characters in TEXT. Set INDEX to the + index of the character matching SATISFY. This understands about + quoting. Return the character that caused us to stop searching; + this is either the same as SATISFY, or 0. */ +/* If SATISFY is `}', we are looking for a brace expression, so we + should enforce the rules that govern valid brace expansions: + 1) to count as an arg separator, a comma or `..' has to be outside + an inner set of braces. +*/ +static int +brace_gobbler (text, tlen, indx, satisfy) + char *text; + size_t tlen; + int *indx; + int satisfy; +{ + register int i, c, quoted, level, commas, pass_next; +#if defined (SHELL) + int si; + char *t; +#endif + DECLARE_MBSTATE; + + level = quoted = pass_next = 0; +#if defined (CSH_BRACE_COMPAT) + commas = 1; +#else + commas = (satisfy == '}') ? 0 : 1; +#endif + + i = *indx; + while (c = text[i]) + { + if (pass_next) + { + pass_next = 0; + ADVANCE_CHAR (text, tlen, i); + continue; + } + + /* A backslash escapes the next character. This allows backslash to + escape the quote character in a double-quoted string. */ + if (c == '\\' && (quoted == 0 || quoted == '"' || quoted == '`')) + { + pass_next = 1; + i++; + continue; + } + +#if defined (SHELL) + /* If compiling for the shell, treat ${...} like \{...} */ + if (c == '$' && text[i+1] == '{' && quoted != '\'') /* } */ + { + pass_next = 1; + i++; + if (quoted == 0) + level++; + continue; + } +#endif + + if (quoted) + { + if (c == quoted) + quoted = 0; +#if defined (SHELL) + /* The shell allows quoted command substitutions */ + if (quoted == '"' && c == '$' && text[i+1] == '(') /*)*/ + goto comsub; +#endif + ADVANCE_CHAR (text, tlen, i); + continue; + } + + if (c == '"' || c == '\'' || c == '`') + { + quoted = c; + i++; + continue; + } + +#if defined (SHELL) + /* Pass new-style command and process substitutions through unchanged. */ + if ((c == '$' || c == '<' || c == '>') && text[i+1] == '(') /* ) */ + { +comsub: + si = i + 2; + t = extract_command_subst (text, &si, 0); + i = si; + free (t); + i++; + continue; + } +#endif + + if (c == satisfy && level == 0 && quoted == 0 && commas > 0) + { + /* We ignore an open brace surrounded by whitespace, and also + an open brace followed immediately by a close brace preceded + by whitespace. */ + if (c == '{' && + ((!i || brace_whitespace (text[i - 1])) && + (brace_whitespace (text[i + 1]) || text[i + 1] == '}'))) + { + i++; + continue; + } + + break; + } + + if (c == '{') + level++; + else if (c == '}' && level) + level--; +#if !defined (CSH_BRACE_COMPAT) + else if (satisfy == '}' && c == brace_arg_separator && level == 0) + commas++; + else if (satisfy == '}' && STREQN (text+i, BRACE_SEQ_SPECIFIER, 2) && + text[i+2] != satisfy && level == 0) + commas++; +#endif + + ADVANCE_CHAR (text, tlen, i); + } + + *indx = i; + return (c); +} + +/* Return 1 if ARR has any non-empty-string members. Used to short-circuit + in array_concat() below. */ +static int +degenerate_array (arr) + char **arr; +{ + register int i; + + for (i = 0; arr[i]; i++) + if (arr[i][0] != '\0') + return 0; + return 1; +} + +/* Return a new array of strings which is the result of appending each + string in ARR2 to each string in ARR1. The resultant array is + len (arr1) * len (arr2) long. For convenience, ARR1 (and its contents) + are free ()'ed. ARR1 can be NULL, in that case, a new version of ARR2 + is returned. */ +static char ** +array_concat (arr1, arr2) + char **arr1, **arr2; +{ + register int i, j, len, len1, len2; + register char **result; + + if (arr1 == 0) + return (arr2); /* XXX - see if we can get away without copying? */ + + if (arr2 == 0) + return (arr1); /* XXX - caller expects us to free arr1 */ + + /* We can only short-circuit if the array consists of a single null element; + otherwise we need to replicate the contents of the other array and + prefix (or append, below) an empty element to each one. */ + if (arr1[0] && arr1[0][0] == 0 && arr1[1] == 0) + { + strvec_dispose (arr1); + return (arr2); /* XXX - use flags to see if we can avoid copying here */ + } + + if (arr2[0] && arr2[0][0] == 0 && arr2[1] == 0) + return (arr1); /* XXX - rather than copying and freeing it */ + + len1 = strvec_len (arr1); + len2 = strvec_len (arr2); + + result = (char **)xmalloc ((1 + (len1 * len2)) * sizeof (char *)); + + len = 0; + for (i = 0; i < len1; i++) + { + int strlen_1 = strlen (arr1[i]); + + for (j = 0; j < len2; j++) + { + result[len] = (char *)xmalloc (1 + strlen_1 + strlen (arr2[j])); + strcpy (result[len], arr1[i]); + strcpy (result[len] + strlen_1, arr2[j]); + len++; + } + free (arr1[i]); + } + free (arr1); + + result[len] = (char *)NULL; + return (result); +} + +#if defined (TEST) +#include + +fatal_error (format, arg1, arg2) + char *format, *arg1, *arg2; +{ + report_error (format, arg1, arg2); + exit (1); +} + +report_error (format, arg1, arg2) + char *format, *arg1, *arg2; +{ + fprintf (stderr, format, arg1, arg2); + fprintf (stderr, "\n"); +} + +main () +{ + char example[256]; + + for (;;) + { + char **result; + int i; + + fprintf (stderr, "brace_expand> "); + + if ((!fgets (example, 256, stdin)) || + (strncmp (example, "quit", 4) == 0)) + break; + + if (strlen (example)) + example[strlen (example) - 1] = '\0'; + + result = brace_expand (example); + + for (i = 0; result[i]; i++) + printf ("%s\n", result[i]); + + free_array (result); + } +} + +/* + * Local variables: + * compile-command: "gcc -g -Bstatic -DTEST -o brace_expand braces.c general.o" + * end: + */ + +#endif /* TEST */ +#endif /* BRACE_EXPANSION */ diff --git a/builtins.h b/builtins.h new file mode 100644 index 0000000..cc0c79c --- /dev/null +++ b/builtins.h @@ -0,0 +1,61 @@ +/* builtins.h -- What a builtin looks like, and where to find them. */ + +/* Copyright (C) 1987-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "command.h" +#include "general.h" + +#if defined (ALIAS) +#include "alias.h" +#endif + +/* Flags describing various things about a builtin. */ +#define BUILTIN_ENABLED 0x01 /* This builtin is enabled. */ +#define BUILTIN_DELETED 0x02 /* This has been deleted with enable -d. */ +#define STATIC_BUILTIN 0x04 /* This builtin is not dynamically loaded. */ +#define SPECIAL_BUILTIN 0x08 /* This is a Posix `special' builtin. */ +#define ASSIGNMENT_BUILTIN 0x10 /* This builtin takes assignment statements. */ +#define POSIX_BUILTIN 0x20 /* This builtins is special in the Posix command search order. */ + +#define BASE_INDENT 4 + +/* The thing that we build the array of builtins out of. */ +struct builtin { + char *name; /* The name that the user types. */ + sh_builtin_func_t *function; /* The address of the invoked function. */ + int flags; /* One of the #defines above. */ + char * const *long_doc; /* NULL terminated array of strings. */ + const char *short_doc; /* Short version of documentation. */ + char *handle; /* for future use */ +}; + +/* Found in builtins.c, created by builtins/mkbuiltins. */ +extern int num_shell_builtins; /* Number of shell builtins. */ +extern struct builtin static_shell_builtins[]; +extern struct builtin *shell_builtins; +extern struct builtin *current_builtin; diff --git a/builtins/Makefile.in b/builtins/Makefile.in new file mode 100644 index 0000000..a2e7911 --- /dev/null +++ b/builtins/Makefile.in @@ -0,0 +1,686 @@ +# This Makefile for building libbuiltins.a is in -*- text -*- for Emacs. +# +# Copyright (C) 1996-2009 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +PACKAGE = @PACKAGE_NAME@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_VERSION = @PACKAGE_VERSION@ + +# +SHELL = @MAKE_SHELL@ +RANLIB = @RANLIB@ +CC = @CC@ +CC_FOR_BUILD = @CC_FOR_BUILD@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +RM = rm -f +CP = cp + +EXEEXT = @EXEEXT@ + +prefix = @prefix@ + +srcdir = @srcdir@ +VPATH = .:@srcdir@ +topdir = @top_srcdir@ + +datarootdir = @datarootdir@ + +includedir = @includedir@ +datadir = @datadir@ +localedir = @localedir@ + +# Support an alternate destination root directory for package building +DESTDIR = + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +BUILD_DIR = @BUILD_DIR@ + +LIBBUILD = ${BUILD_DIR}/lib + +PROFILE_FLAGS = @PROFILE_FLAGS@ +CFLAGS = @CFLAGS@ +CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ @CROSS_COMPILE@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ +LOCAL_CFLAGS = @LOCAL_CFLAGS@ ${DEBUG} +DEFS = @DEFS@ +LOCAL_DEFS = @LOCAL_DEFS@ + +LIBS = @LIBS@ +LDFLAGS = @LDFLAGS@ $(LOCAL_LDFLAGS) $(CFLAGS) +LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ $(LOCAL_LDFLAGS) $(CFLAGS_FOR_BUILD) +LOCAL_LDFLAGS = @LOCAL_LDFLAGS@ +LIBS_FOR_BUILD = @LIBS_FOR_BUILD@ +#LIBS_FOR_BUILD = $(LIBS) + +BASHINCDIR = ${topdir}/include + +RL_INCLUDEDIR = @RL_INCLUDEDIR@ + +INTL_LIBSRC = ${topdir}/lib/intl +INTL_BUILDDIR = ${LIBBUILD}/intl +INTL_LIBDIR = ${INTL_BUILDDIR} +INTL_LIBRARY = ${INTL_BUILDDIR}/libintl.a +INTL_INC = @INTL_INC@ +INTL_DEP = @INTL_DEP@ +LIBINTL_H = @LIBINTL_H@ + +HELPDIR = @HELPDIR@ +MKDIRS = ${topdir}/support/mkdirs + +HELPFILES_TARGET = @HELPFILES_TARGET@ + +INCLUDES = -I. -I.. @RL_INCLUDE@ -I$(topdir) -I$(BASHINCDIR) -I$(topdir)/lib -I$(srcdir) ${INTL_INC} + +BASE_CCFLAGS = ${PROFILE_FLAGS} $(DEFS) $(LOCAL_DEFS) $(SYSTEM_FLAGS) \ + ${INCLUDES} $(LOCAL_CFLAGS) + +CCFLAGS = $(BASE_CCFLAGS) $(CPPFLAGS) $(CFLAGS) + +CCFLAGS_FOR_BUILD = $(BASE_CCFLAGS) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) + +GCC_LINT_FLAGS = -Wall -Wshadow -Wpointer-arith -Wcast-qual \ + -Wcast-align -Wstrict-prototypes -Wconversion \ + -Wmissing-prototypes -Wtraditional -Wredundant-decls -pedantic + +MKBUILTINS = mkbuiltins$(EXEEXT) +DIRECTDEFINE = -D $(srcdir) +HELPDIRDEFINE = @HELPDIRDEFINE@ +HELPSTRINGS = @HELPSTRINGS@ + +# xxx this is bad style +RL_LIBSRC = $(topdir)/lib/readline + +.SUFFIXES: +.SUFFIXES: .def .c .o +# How to make a .o file from a .def file. +.def.o: + $(RM) $@ + ./$(MKBUILTINS) $(DIRECTDEFINE) $< + $(CC) -c $(CCFLAGS) $*.c || ( $(RM) $*.c ; exit 1 ) + $(RM) $*.c + +# How to make a .c file from a .def file. +.def.c: + $(RM) $@ + ./$(MKBUILTINS) $(DIRECTDEFINE) $< + +# default rule for making a .o file from a .c file +.c.o: + $(RM) $@ + $(CC) -c $(CCFLAGS) $< + +DEFSRC = $(srcdir)/alias.def $(srcdir)/bind.def $(srcdir)/break.def \ + $(srcdir)/builtin.def $(srcdir)/caller.def \ + $(srcdir)/cd.def $(srcdir)/colon.def \ + $(srcdir)/command.def $(srcdir)/declare.def $(srcdir)/echo.def \ + $(srcdir)/enable.def $(srcdir)/eval.def $(srcdir)/getopts.def \ + $(srcdir)/exec.def $(srcdir)/exit.def $(srcdir)/fc.def \ + $(srcdir)/fg_bg.def $(srcdir)/hash.def $(srcdir)/help.def \ + $(srcdir)/history.def $(srcdir)/jobs.def $(srcdir)/kill.def \ + $(srcdir)/let.def $(srcdir)/read.def $(srcdir)/return.def \ + $(srcdir)/set.def $(srcdir)/setattr.def $(srcdir)/shift.def \ + $(srcdir)/source.def $(srcdir)/suspend.def $(srcdir)/test.def \ + $(srcdir)/times.def $(srcdir)/trap.def $(srcdir)/type.def \ + $(srcdir)/ulimit.def $(srcdir)/umask.def $(srcdir)/wait.def \ + $(srcdir)/reserved.def $(srcdir)/pushd.def $(srcdir)/shopt.def \ + $(srcdir)/printf.def $(srcdir)/complete.def $(srcdir)/mapfile.def + +STATIC_SOURCE = common.c evalstring.c evalfile.c getopt.c bashgetopt.c \ + getopt.h + +OFILES = builtins.o \ + alias.o bind.o break.o builtin.o caller.o cd.o colon.o command.o \ + common.o declare.o echo.o enable.o eval.o evalfile.o \ + evalstring.o exec.o exit.o fc.o fg_bg.o hash.o help.o history.o \ + jobs.o kill.o let.o mapfile.o \ + pushd.o read.o return.o set.o setattr.o shift.o source.o \ + suspend.o test.o times.o trap.o type.o ulimit.o umask.o \ + wait.o getopts.o shopt.o printf.o getopt.o bashgetopt.o complete.o + +CREATED_FILES = builtext.h builtins.c psize.aux pipesize.h tmpbuiltins.c \ + tmpbuiltins.h +CREATED_OBJECTS = tmpbuiltins.o gen-helpfiles.o mkbuiltins.o + +all: $(MKBUILTINS) libbuiltins.a $(HELPFILES_TARGET) +targets: libbuiltins.a $(HELPFILES_TARGET) + +libbuiltins.a: $(MKBUILTINS) $(OFILES) builtins.o + $(RM) $@ + $(AR) $(ARFLAGS) $@ $(OFILES) + -$(RANLIB) $@ + +tmpbuiltins.c: $(MKBUILTINS) $(DEFSRC) + ./$(MKBUILTINS) -externfile tmpbuiltins.h -structfile $@ \ + -noproduction -nofunctions \ + $(DIRECTDEFINE) $(HELPSTRINGS) $(DEFSRC) + +tmpbuiltins.h: tmpbuiltins.c + +gen-helpfiles.o: ../config.h +gen-helpfiles.o: gen-helpfiles.c + $(RM) $@ + $(CC_FOR_BUILD) -c $(CCFLAGS_FOR_BUILD) $< + +gen-helpfiles: tmpbuiltins.o gen-helpfiles.o + $(CC_FOR_BUILD) ${CCFLAGS_FOR_BUILD} $(LDFLAGS_FOR_BUILD) -o $@ gen-helpfiles.o tmpbuiltins.o $(LIBS_FOR_BUILD) + +builtext.h builtins.c: $(MKBUILTINS) $(DEFSRC) + @-if test -f builtins.c; then mv -f builtins.c old-builtins.c; fi + @-if test -f builtext.h; then mv -f builtext.h old-builtext.h; fi + ./$(MKBUILTINS) -externfile builtext.h -structfile builtins.c \ + -noproduction $(DIRECTDEFINE) $(HELPDIRDEFINE) $(HELPSTRINGS) $(DEFSRC) + @-if cmp -s old-builtext.h builtext.h 2>/dev/null; then \ + mv old-builtext.h builtext.h; \ + else \ + $(RM) old-builtext.h; \ + fi + @-if cmp -s old-builtins.c builtins.c 2>/dev/null; then \ + mv old-builtins.c builtins.c; \ + else \ + $(RM) old-builtins.c; \ + fi + +helpdoc: gen-helpfiles + ./gen-helpfiles ${HELPDIRDEFINE} + +install-help: + @-if test -n "${HELPDIR}" && test -d helpfiles ; then \ + test -d $(DESTDIR)${HELPDIR} || ${SHELL} ${MKDIRS} $(DESTDIR)$(HELPDIR) ;\ + ( for f in helpfiles/*; do \ + echo installing $$f; \ + ${INSTALL_DATA} $$f $(DESTDIR)$(HELPDIR); \ + done; ) ; \ + fi + +install: @HELPINSTALL@ + +mkbuiltins.o: ../config.h +mkbuiltins.o: mkbuiltins.c + $(RM) $@ + $(CC_FOR_BUILD) -c $(CCFLAGS_FOR_BUILD) $< + +mkbuiltins$(EXEEXT): mkbuiltins.o + $(CC_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $(MKBUILTINS) mkbuiltins.o $(LIBS_FOR_BUILD) + +# rules for deficient makes, like SunOS +mkbuiltins.o: mkbuiltins.c +builtins.o: builtins.c +common.o: common.c +bashgetopt.o: bashgetopt.c +getopt.o: getopt.c +evalstring.o: evalstring.c +evalfile.o: evalfile.c + +tmpbuiltins.o: tmpbuiltins.c +gen-helpfiles.o: gen-helpfiles.c + +ulimit.o: pipesize.h + +pipesize.h: psize.aux + $(SHELL) $(srcdir)/psize.sh > $@ + +# Technically this is wrong; the pipe size should be for the target system, +# not the build host. +psize.aux: psize.c + $(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(srcdir)/psize.c + +documentation: builtins.texi + +builtins.texi: $(MKBUILTINS) + ./$(MKBUILTINS) -documentonly $(DEFSRC) + +clean: + $(RM) $(OFILES) $(CREATED_FILES) libbuiltins.a + $(RM) $(MKBUILTINS) gen-helpfiles $(CREATED_OBJECTS) + -test -d helpfiles && $(RM) -r helpfiles + +mostlyclean: + $(RM) $(OFILES) libbuiltins.a + +distclean maintainer-clean: clean + $(RM) Makefile + +$(OFILES): $(MKBUILTINS) ../config.h + +../version.h: ../config.h ../Makefile Makefile + -( cd ${BUILD_DIR} && ${MAKE} ${MFLAGS} version.h ) + +# maintainer special - for now +po: builtins.c + xgettext -L C -o $(topdir)/po/builtins.pot --keyword='N_' builtins.c 2>/dev/null + +${LIBINTL_H}: + @echo making $@ in ${INTL_BUILDDIR} + @(cd ${INTL_BUILDDIR} && \ + $(MAKE) $(MFLAGS) libintl.h) || exit 1 + +# dependencies + +alias.o: alias.def +bind.o: bind.def +break.o: break.def +builtin.o: builtin.def +caller.o: caller.def +cd.o: cd.def +colon.o: colon.def +command.o: command.def +declare.o: declare.def +echo.o: echo.def +enable.o: enable.def +eval.o: eval.def +exec.o: exec.def +exit.o: exit.def +fc.o: fc.def +fg_bg.o: fg_bg.def +hash.o: hash.def +help.o: help.def +history.o: history.def +jobs.o: jobs.def +kill.o: kill.def +let.o: let.def +mapfile.o: mapfile.def +printf.o: printf.def +pushd.o: pushd.def +read.o: read.def +return.o: return.def +set.o: set.def +setattr.o: setattr.def +shift.o: shift.def +shopt.o: shopt.def +source.o: source.def +suspend.o: suspend.def +test.o: test.def +times.o: times.def +trap.o: trap.def +type.o: type.def +ulimit.o: ulimit.def +umask.o: umask.def +wait.o: wait.def +getopts.o: getopts.def +reserved.o: reserved.def +complete.o: complete.def + +# C files +bashgetopt.o: ../config.h $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h +bashgetopt.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/bashjmp.h +bashgetopt.o: $(topdir)/command.h $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/error.h +bashgetopt.o: $(topdir)/variables.h $(topdir)/conftypes.h $(topdir)/quit.h $(BASHINCDIR)/maxpath.h +bashgetopt.o: $(topdir)/unwind_prot.h $(topdir)/dispose_cmd.h +bashgetopt.o: $(topdir)/make_cmd.h $(topdir)/subst.h $(topdir)/sig.h +bashgetopt.o: ../pathnames.h $(topdir)/externs.h $(srcdir)/common.h +bashgetopt.o: $(BASHINCDIR)/chartypes.h +common.o: $(topdir)/bashtypes.h $(BASHINCDIR)/posixstat.h $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h +common.o: $(topdir)/shell.h $(topdir)/syntax.h ../config.h $(topdir)/bashjmp.h $(BASHINCDIR)/posixjmp.h +common.o: $(topdir)/sig.h $(topdir)/command.h +common.o: $(topdir)/general.h $(topdir)/xmalloc.h $(BASHINCDIR)/stdc.h $(BASHINCDIR)/memalloc.h +common.o: $(topdir)/variables.h $(topdir)/conftypes.h $(topdir)/input.h +common.o: $(topdir)/siglist.h $(topdir)/bashhist.h $(topdir)/quit.h +common.o: $(topdir)/unwind_prot.h $(BASHINCDIR)/maxpath.h $(topdir)/jobs.h +common.o: $(topdir)/builtins.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +common.o: $(topdir)/subst.h $(topdir)/execute_cmd.h $(topdir)/error.h +common.o: $(topdir)/externs.h ../pathnames.h ./builtext.h +common.o: $(BASHINCDIR)/chartypes.h +evalfile.o: $(topdir)/bashtypes.h $(BASHINCDIR)/posixstat.h ${BASHINCDIR}/filecntl.h +evalfile.o: $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h +evalfile.o: $(topdir)/shell.h $(topdir)/syntax.h ../config.h $(topdir)/bashjmp.h +evalfile.o: $(topdir)/command.h $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/error.h +evalfile.o: $(topdir)/variables.h $(topdir)/conftypes.h $(topdir)/quit.h $(BASHINCDIR)/maxpath.h +evalfile.o: $(topdir)/unwind_prot.h $(topdir)/dispose_cmd.h +evalfile.o: $(topdir)/make_cmd.h $(topdir)/subst.h $(topdir)/sig.h +evalfile.o: ../pathnames.h $(topdir)/externs.h +evalfile.o: $(topdir)/jobs.h $(topdir)/builtins.h $(topdir)/flags.h +evalfile.o: $(topdir)/input.h $(topdir)/execute_cmd.h +evalfile.o: $(topdir)/bashhist.h $(srcdir)/common.h +evalstring.o: ../config.h $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h +evalstring.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/bashjmp.h $(BASHINCDIR)/posixjmp.h +evalstring.o: $(topdir)/sig.h $(topdir)/command.h $(topdir)/siglist.h +evalstring.o: $(BASHINCDIR)/memalloc.h $(topdir)/variables.h $(topdir)/conftypes.h $(topdir)/input.h +evalstring.o: $(topdir)/quit.h $(topdir)/unwind_prot.h +evalstring.o: $(BASHINCDIR)/maxpath.h $(topdir)/jobs.h $(topdir)/builtins.h +evalstring.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h +evalstring.o: $(topdir)/externs.h $(topdir)/jobs.h $(topdir)/builtins.h +evalstring.o: $(topdir)/flags.h $(topdir)/input.h $(topdir)/execute_cmd.h +evalstring.o: $(topdir)/bashhist.h $(srcdir)/common.h +evalstring.o: $(topdir)/trap.h $(topdir)/redir.h ../pathnames.h +#evalstring.o: $(topdir)/y.tab.h +getopt.o: ../config.h $(BASHINCDIR)/memalloc.h +getopt.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/bashjmp.h $(topdir)/command.h +getopt.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/error.h $(topdir)/variables.h $(topdir)/conftypes.h +getopt.o: $(topdir)/quit.h $(BASHINCDIR)/maxpath.h $(topdir)/unwind_prot.h +getopt.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h +getopt.o: $(topdir)/sig.h ../pathnames.h $(topdir)/externs.h +getopt.o: $(srcdir)/getopt.h +mkbuiltins.o: ../config.h $(topdir)/bashtypes.h $(BASHINCDIR)/posixstat.h +mkbuiltins.o: ${BASHINCDIR}/filecntl.h +mkbuiltins.o: $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h + +# def files +alias.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +alias.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h $(BASHINCDIR)/maxpath.h +alias.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +alias.o: $(topdir)/subst.h $(topdir)/externs.h $(srcdir)/common.h +alias.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +alias.o: ../pathnames.h +bind.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h +bind.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +bind.o: $(topdir)/subst.h $(topdir)/externs.h $(srcdir)/bashgetopt.h +bind.o: $(topdir)/general.h $(topdir)/xmalloc.h $(BASHINCDIR)/maxpath.h $(topdir)/bashline.h +bind.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +bind.o: ../pathnames.h +break.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +break.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +break.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +break.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h +break.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +break.o: ../pathnames.h +builtin.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +builtin.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/externs.h +builtin.o: $(topdir)/quit.h $(srcdir)/common.h $(BASHINCDIR)/maxpath.h +builtin.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h +builtin.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +builtin.o: $(srcdir)/bashgetopt.h ../pathnames.h +caller.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h +caller.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/quit.h $(topdir)/dispose_cmd.h +caller.o: $(topdir)/make_cmd.h $(topdir)/subst.h $(topdir)/externs.h +caller.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +caller.o: $(srcdir)/common.h $(BASHINCDIR)/maxpath.h ./builtext.h +caller.o: ${BASHINCDIR}/chartypes.h $(topdir)/bashtypes.h ../pathnames.h +cd.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h +cd.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/quit.h $(topdir)/dispose_cmd.h +cd.o: $(topdir)/make_cmd.h $(topdir)/subst.h $(topdir)/externs.h +cd.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +cd.o: $(srcdir)/common.h $(BASHINCDIR)/maxpath.h ../pathnames.h +command.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +command.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/externs.h +command.o: $(topdir)/quit.h $(srcdir)/bashgetopt.h $(BASHINCDIR)/maxpath.h +command.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h +command.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +command.o: ../pathnames.h +declare.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +declare.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +declare.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +declare.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h +declare.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +declare.o: $(topdir)/arrayfunc.h $(srcdir)/bashgetopt.h +declare.o: ./builtext.h ../pathnames.h +echo.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h +echo.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/subst.h $(topdir)/externs.h +echo.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +echo.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +echo.o: $(BASHINCDIR)/maxpath.h ../pathnames.h +enable.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +enable.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +enable.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +enable.o: $(topdir)/subst.h $(topdir)/externs.h +enable.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +enable.o: $(BASHINCDIR)/maxpath.h ../pathnames.h +enable.o: $(topdir)/pcomplete.h +eval.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +eval.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +eval.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +eval.o: $(topdir)/subst.h $(topdir)/externs.h +eval.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +eval.o: $(BASHINCDIR)/maxpath.h ../pathnames.h +exec.o: $(topdir)/bashtypes.h +exec.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +exec.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +exec.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +exec.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/flags.h +exec.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +exec.o: $(srcdir)/common.h $(topdir)/execute_cmd.h $(BASHINCDIR)/maxpath.h +exec.o: $(topdir)/findcmd.h $(topdir)/jobs.h ../pathnames.h +exit.o: $(topdir)/bashtypes.h +exit.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +exit.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +exit.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +exit.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/jobs.h +exit.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +exit.o: $(BASHINCDIR)/maxpath.h ./builtext.h ../pathnames.h +fc.o: $(topdir)/bashtypes.h $(BASHINCDIR)/posixstat.h +fc.o: $(topdir)/builtins.h $(topdir)/command.h $(srcdir)/bashgetopt.h +fc.o: $(topdir)/bashhist.h +fc.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h +fc.o: $(topdir)/general.h $(topdir)/xmalloc.h $(BASHINCDIR)/maxpath.h +fc.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +fc.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/shell.h $(topdir)/syntax.h +fc.o: $(topdir)/flags.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +fc.o: $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h $(BASHINCDIR)/chartypes.h +fc.o: ../pathnames.h +fg_bg.o: $(topdir)/bashtypes.h $(srcdir)/bashgetopt.h +fg_bg.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +fg_bg.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +fg_bg.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +fg_bg.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h +fg_bg.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +fg_bg.o: $(topdir)/jobs.h ../pathnames.h +getopts.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +getopts.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +getopts.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +getopts.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h +getopts.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +getopts.o: ../pathnames.h +hash.o: $(topdir)/builtins.h $(topdir)/command.h $(topdir)/quit.h +hash.o: $(topdir)/findcmd.h $(topdir)/hashlib.h +hash.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +hash.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +hash.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +hash.o: $(srcdir)/common.h $(BASHINCDIR)/maxpath.h ../pathnames.h +help.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +help.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +help.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +help.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h +help.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +help.o: ${srcdir}/common.h ../pathnames.h +history.o: $(topdir)/bashtypes.h +history.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +history.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +history.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +history.o: $(topdir)/subst.h $(topdir)/externs.h +history.o: ${BASHINCDIR}/filecntl.h $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h +history.o: $(topdir)/variables.h $(topdir)/conftypes.h $(topdir)/bashhist.h $(BASHINCDIR)/maxpath.h +history.o: ../pathnames.h +inlib.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +inlib.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +inlib.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +inlib.o: $(BASHINCDIR)/maxpath.h $(topdir)/subst.h $(topdir)/externs.h +inlib.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h ../pathnames.h +jobs.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h +jobs.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/quit.h $(srcdir)/bashgetopt.h +jobs.o: $(BASHINCDIR)/maxpath.h $(topdir)/externs.h $(topdir)/jobs.h +jobs.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h +jobs.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +jobs.o: ../pathnames.h +kill.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h +kill.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/subst.h $(topdir)/externs.h +kill.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +kill.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/trap.h $(topdir)/unwind_prot.h +kill.o: $(topdir)/variables.h $(topdir)/conftypes.h $(BASHINCDIR)/maxpath.h +kill.o: $(topdir)/jobs.h ../pathnames.h +let.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +let.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +let.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +let.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h +let.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +let.o: ../pathnames.h +printf.o: ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/bashjmp.h +printf.o: $(topdir)/command.h $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +printf.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +printf.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/sig.h +printf.o: ../pathnames.h $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h +printf.o: $(topdir)/variables.h $(topdir)/conftypes.h $(BASHINCDIR)/stdc.h $(srcdir)/bashgetopt.h +printf.o: $(topdir)/bashtypes.h ${srcdir}/common.h $(BASHINCDIR)/chartypes.h +printf.o: ../pathnames.h +pushd.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +pushd.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +pushd.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +pushd.o: $(topdir)/subst.h $(topdir)/externs.h +pushd.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +pushd.o: $(BASHINCDIR)/maxpath.h $(srcdir)/common.h ./builtext.h +pushd.o: ../pathnames.h +read.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +read.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +read.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +read.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h +read.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +read.o: $(BASHINCDIR)/shtty.h +read.o: $(topdir)/arrayfunc.h ../pathnames.h +return.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +return.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +return.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +return.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h +return.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +return.o: ../pathnames.h +set.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +set.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/subst.h $(topdir)/externs.h +set.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +set.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +set.o: $(BASHINCDIR)/maxpath.h $(topdir)/error.h +set.o: $(topdir)/arrayfunc.h ../pathnames.h +setattr.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +setattr.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h $(BASHINCDIR)/maxpath.h +setattr.o: $(topdir)/quit.h $(srcdir)/common.h $(srcdir)/bashgetopt.h +setattr.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h +setattr.o: $(topdir)/externs.h +setattr.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +setattr.o: $(topdir)/arrayfunc.h ../pathnames.h +shift.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +shift.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +shift.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +shift.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h +shift.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +shift.o: ../pathnames.h +shopt.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +shopt.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +shopt.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +shopt.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h +shopt.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +shopt.o: $(srcdir)/common.h $(srcdir)/bashgetopt.h ../pathnames.h +shopt.o: $(topdir)/bashhist.h $(topdir)/bashline.h +source.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +source.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/findcmd.h +source.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +source.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h +source.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +source.o: $(srcdir)/bashgetopt.h $(topdir)/flags.h $(topdir)/trap.h +source.o: ../pathnames.h +suspend.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +suspend.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +suspend.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +suspend.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h +suspend.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +suspend.o: $(topdir)/jobs.h ../pathnames.h +test.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +test.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +test.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +test.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h +test.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +test.o: $(topdir)/test.h ../pathnames.h +times.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +times.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +times.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +times.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h +times.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +times.o: $(BASHINCDIR)/posixtime.h ../pathnames.h +trap.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +trap.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/externs.h +trap.o: $(topdir)/quit.h $(srcdir)/common.h $(BASHINCDIR)/maxpath.h +trap.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h +trap.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +trap.o: $(topdir)/findcmd.h ../pathnames.h +type.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +type.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +type.o: $(topdir)/quit.h $(srcdir)/common.h $(BASHINCDIR)/maxpath.h +type.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h +type.o: $(topdir)/externs.h $(topdir)/hashcmd.h ../pathnames.h +type.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +ulimit.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +ulimit.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +ulimit.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +ulimit.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h +ulimit.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +ulimit.o: ../pathnames.h +umask.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +umask.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +umask.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +umask.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h +umask.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +umask.o: $(BASHINCDIR)/chartypes.h ../pathnames.h +wait.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +wait.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +wait.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +wait.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h +wait.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h +wait.o: $(topdir)/jobs.h +wait.o: $(BASHINCDIR)/chartypes.h ../pathnames.h + +complete.o: ../config.h ../pathnames.h +complete.o: ${topdir}/shell.h $(topdir)/syntax.h ${topdir}/bashjmp.h ${BASHINCDIR}/posixjmp.h ${topdir}/sig.h +complete.o: ${topdir}/unwind_prot.h ${topdir}/variables.h +complete.o: ${topdir}/bashtypes.h ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h +complete.o: ${topdir}/builtins.h +complete.o: ${topdir}/pcomplete.h +complete.o: ${srcdir}/common.h ${srcdir}/bashgetopt.h +mapfile.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h +mapfile.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h +mapfile.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h +mapfile.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h +mapfile.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/variables.h $(topdir)/conftypes.h +mapfile.o: $(topdir)/arrayfunc.h ../pathnames.h + +#bind.o: $(RL_LIBSRC)chardefs.h $(RL_LIBSRC)readline.h $(RL_LIBSRC)keymaps.h + +# libintl dependencies +bind.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +break.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +caller.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +cd.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +common.c: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +complete.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +declare.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +enable.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +evalfile.c: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +exec.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +exit.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +fc.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +fg_bg.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +getopt.c: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +hash.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +help.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +history.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +inlib.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +jobs.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +kill.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +let.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +mapfile.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +mkbuiltins.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +printf.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +pushd.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +read.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +return.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +set.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +setattr.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +shift.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +shopt.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +source.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +suspend.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +type.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +ulimit.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +umask.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h diff --git a/builtins/alias.def b/builtins/alias.def new file mode 100644 index 0000000..d760ceb --- /dev/null +++ b/builtins/alias.def @@ -0,0 +1,241 @@ +This file is alias.def, from which is created alias.c +It implements the builtins "alias" and "unalias" in Bash. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$BUILTIN alias +$FUNCTION alias_builtin +$DEPENDS_ON ALIAS +$PRODUCES alias.c +$SHORT_DOC alias [-p] [name[=value] ... ] +Define or display aliases. + +Without arguments, `alias' prints the list of aliases in the reusable +form `alias NAME=VALUE' on standard output. + +Otherwise, an alias is defined for each NAME whose VALUE is given. +A trailing space in VALUE causes the next word to be checked for +alias substitution when the alias is expanded. + +Options: + -p Print all defined aliases in a reusable format + +Exit Status: +alias returns true unless a NAME is supplied for which no alias has been +defined. +$END + +#include + +#if defined (ALIAS) + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +# include "../bashansi.h" +# include "../bashintl.h" + +# include +# include "../shell.h" +# include "../alias.h" +# include "common.h" +# include "bashgetopt.h" + +/* Flags for print_alias */ +#define AL_REUSABLE 0x01 + +static void print_alias __P((alias_t *, int)); + +extern int posixly_correct; + +/* Hack the alias command in a Korn shell way. */ +int +alias_builtin (list) + WORD_LIST *list; +{ + int any_failed, offset, pflag, dflags; + alias_t **alias_list, *t; + char *name, *value; + + dflags = posixly_correct ? 0 : AL_REUSABLE; + pflag = 0; + reset_internal_getopt (); + while ((offset = internal_getopt (list, "p")) != -1) + { + switch (offset) + { + case 'p': + pflag = 1; + dflags |= AL_REUSABLE; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + + list = loptend; + + if (list == 0 || pflag) + { + if (aliases == 0) + return (EXECUTION_SUCCESS); + + alias_list = all_aliases (); + + if (alias_list == 0) + return (EXECUTION_SUCCESS); + + for (offset = 0; alias_list[offset]; offset++) + print_alias (alias_list[offset], dflags); + + free (alias_list); /* XXX - Do not free the strings. */ + + if (list == 0) + return (sh_chkwrite (EXECUTION_SUCCESS)); + } + + any_failed = 0; + while (list) + { + name = list->word->word; + + for (offset = 0; name[offset] && name[offset] != '='; offset++) + ; + + if (offset && name[offset] == '=') + { + name[offset] = '\0'; + value = name + offset + 1; + + if (legal_alias_name (name, 0) == 0) + { + builtin_error (_("`%s': invalid alias name"), name); + any_failed++; + } + else + add_alias (name, value); + } + else + { + t = find_alias (name); + if (t) + print_alias (t, dflags); + else + { + sh_notfound (name); + any_failed++; + } + } + list = list->next; + } + + return (any_failed ? EXECUTION_FAILURE : EXECUTION_SUCCESS); +} +#endif /* ALIAS */ + +$BUILTIN unalias +$FUNCTION unalias_builtin +$DEPENDS_ON ALIAS +$SHORT_DOC unalias [-a] name [name ...] +Remove each NAME from the list of defined aliases. + +Options: + -a remove all alias definitions. + +Return success unless a NAME is not an existing alias. +$END + +#if defined (ALIAS) +/* Remove aliases named in LIST from the aliases database. */ +int +unalias_builtin (list) + register WORD_LIST *list; +{ + register alias_t *alias; + int opt, aflag; + + aflag = 0; + reset_internal_getopt (); + while ((opt = internal_getopt (list, "a")) != -1) + { + switch (opt) + { + case 'a': + aflag = 1; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + + list = loptend; + + if (aflag) + { + delete_all_aliases (); + return (EXECUTION_SUCCESS); + } + + if (list == 0) + { + builtin_usage (); + return (EX_USAGE); + } + + aflag = 0; + while (list) + { + alias = find_alias (list->word->word); + + if (alias) + remove_alias (alias->name); + else + { + sh_notfound (list->word->word); + aflag++; + } + + list = list->next; + } + + return (aflag ? EXECUTION_FAILURE : EXECUTION_SUCCESS); +} + +/* Output ALIAS in such a way as to allow it to be read back in. */ +static void +print_alias (alias, flags) + alias_t *alias; + int flags; +{ + char *value; + + value = sh_single_quote (alias->value); + if (flags & AL_REUSABLE) + printf ("alias "); + printf ("%s=%s\n", alias->name, value); + free (value); + + fflush (stdout); +} +#endif /* ALIAS */ diff --git a/builtins/bashgetopt.c b/builtins/bashgetopt.c new file mode 100644 index 0000000..b1b7070 --- /dev/null +++ b/builtins/bashgetopt.c @@ -0,0 +1,175 @@ +/* bashgetopt.c -- `getopt' for use by the builtins. */ + +/* Copyright (C) 1992-2002 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "../bashansi.h" +#include +#include + +#include "../shell.h" +#include "common.h" + +#define ISOPT(s) (((*(s) == '-') || (plus && *(s) == '+')) && (s)[1]) +#define NOTOPT(s) (((*(s) != '-') && (!plus || *(s) != '+')) || (s)[1] == '\0') + +static int sp; + +char *list_optarg; +int list_optopt; +int list_opttype; + +static WORD_LIST *lhead = (WORD_LIST *)NULL; +WORD_LIST *lcurrent = (WORD_LIST *)NULL; +WORD_LIST *loptend; /* Points to the first non-option argument in the list */ + +int +internal_getopt(list, opts) +WORD_LIST *list; +char *opts; +{ + register int c; + register char *cp; + int plus; /* nonzero means to handle +option */ + static char errstr[3] = { '-', '\0', '\0' }; + + plus = *opts == '+'; + if (plus) + opts++; + + if (list == 0) { + list_optarg = (char *)NULL; + loptend = (WORD_LIST *)NULL; /* No non-option arguments */ + return -1; + } + + if (list != lhead || lhead == 0) { + /* Hmmm.... called with a different word list. Reset. */ + sp = 1; + lcurrent = lhead = list; + loptend = (WORD_LIST *)NULL; + } + + if (sp == 1) { + if (lcurrent == 0 || NOTOPT(lcurrent->word->word)) { + lhead = (WORD_LIST *)NULL; + loptend = lcurrent; + return(-1); + } else if (lcurrent->word->word[0] == '-' && + lcurrent->word->word[1] == '-' && + lcurrent->word->word[2] == 0) { + lhead = (WORD_LIST *)NULL; + loptend = lcurrent->next; + return(-1); + } + errstr[0] = list_opttype = lcurrent->word->word[0]; + } + + list_optopt = c = lcurrent->word->word[sp]; + + if (c == ':' || (cp = strchr(opts, c)) == NULL) { + errstr[1] = c; + sh_invalidopt (errstr); + if (lcurrent->word->word[++sp] == '\0') { + lcurrent = lcurrent->next; + sp = 1; + } + list_optarg = NULL; + if (lcurrent) + loptend = lcurrent->next; + return('?'); + } + + if (*++cp == ':' || *cp == ';') { + /* `:': Option requires an argument. */ + /* `;': option argument may be missing */ + /* We allow -l2 as equivalent to -l 2 */ + if (lcurrent->word->word[sp+1]) { + list_optarg = lcurrent->word->word + sp + 1; + lcurrent = lcurrent->next; + /* If the specifier is `;', don't set optarg if the next + argument looks like another option. */ +#if 0 + } else if (lcurrent->next && (*cp == ':' || lcurrent->next->word->word[0] != '-')) { +#else + } else if (lcurrent->next && (*cp == ':' || NOTOPT(lcurrent->next->word->word))) { +#endif + lcurrent = lcurrent->next; + list_optarg = lcurrent->word->word; + lcurrent = lcurrent->next; + } else if (*cp == ';') { + list_optarg = (char *)NULL; + lcurrent = lcurrent->next; + } else { /* lcurrent->next == NULL */ + errstr[1] = c; + sh_needarg (errstr); + sp = 1; + list_optarg = (char *)NULL; + return('?'); + } + sp = 1; + } else if (*cp == '#') { + /* option requires a numeric argument */ + if (lcurrent->word->word[sp+1]) { + if (DIGIT(lcurrent->word->word[sp+1])) { + list_optarg = lcurrent->word->word + sp + 1; + lcurrent = lcurrent->next; + } else + list_optarg = (char *)NULL; + } else { + if (lcurrent->next && legal_number(lcurrent->next->word->word, (intmax_t *)0)) { + lcurrent = lcurrent->next; + list_optarg = lcurrent->word->word; + lcurrent = lcurrent->next; + } else { + errstr[1] = c; + sh_neednumarg (errstr); + sp = 1; + list_optarg = (char *)NULL; + return ('?'); + } + } + + } else { + /* No argument, just return the option. */ + if (lcurrent->word->word[++sp] == '\0') { + sp = 1; + lcurrent = lcurrent->next; + } + list_optarg = (char *)NULL; + } + + return(c); +} + +/* + * reset_internal_getopt -- force the in[ft]ernal getopt to reset + */ + +void +reset_internal_getopt () +{ + lhead = lcurrent = loptend = (WORD_LIST *)NULL; + sp = 1; +} diff --git a/builtins/bashgetopt.h b/builtins/bashgetopt.h new file mode 100644 index 0000000..f2aea26 --- /dev/null +++ b/builtins/bashgetopt.h @@ -0,0 +1,39 @@ +/* bashgetopt.h -- extern declarations for stuff defined in bashgetopt.c. */ + +/* Copyright (C) 1993 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* See getopt.h for the explanation of these variables. */ + +#if !defined (__BASH_GETOPT_H) +# define __BASH_GETOPT_H + +#include + +extern char *list_optarg; + +extern int list_optopt; +extern int list_opttype; + +extern WORD_LIST *lcurrent; +extern WORD_LIST *loptend; + +extern int internal_getopt __P((WORD_LIST *, char *)); +extern void reset_internal_getopt __P((void)); + +#endif /* !__BASH_GETOPT_H */ diff --git a/builtins/bind.def b/builtins/bind.def new file mode 100644 index 0000000..3a7cc4e --- /dev/null +++ b/builtins/bind.def @@ -0,0 +1,341 @@ +This file is bind.def, from which is created bind.c. +It implements the builtin "bind" in Bash. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES bind.c + +#include + +$BUILTIN bind +$DEPENDS_ON READLINE +$FUNCTION bind_builtin +$SHORT_DOC bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-x keyseq:shell-command] [keyseq:readline-function or readline-command] +Set Readline key bindings and variables. + +Bind a key sequence to a Readline function or a macro, or set a +Readline variable. The non-option argument syntax is equivalent to +that found in ~/.inputrc, but must be passed as a single argument: +e.g., bind '"\C-x\C-r": re-read-init-file'. + +Options: + -m keymap Use KEYMAP as the keymap for the duration of this + command. Acceptable keymap names are emacs, + emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move, + vi-command, and vi-insert. + -l List names of functions. + -P List function names and bindings. + -p List functions and bindings in a form that can be + reused as input. + -S List key sequences that invoke macros and their values + -s List key sequences that invoke macros and their values + in a form that can be reused as input. + -V List variable names and values + -v List variable names and values in a form that can + be reused as input. + -q function-name Query about which keys invoke the named function. + -u function-name Unbind all keys which are bound to the named function. + -r keyseq Remove the binding for KEYSEQ. + -f filename Read key bindings from FILENAME. + -x keyseq:shell-command Cause SHELL-COMMAND to be executed when + KEYSEQ is entered. + -X List key sequences bound with -x and associated commands + in a form that can be reused as input. + +Exit Status: +bind returns 0 unless an unrecognized option is given or an error occurs. +$END + +#if defined (READLINE) + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include +#include +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +#include +#include + +#include "../bashintl.h" + +#include "../shell.h" +#include "../bashline.h" +#include "bashgetopt.h" +#include "common.h" + +static int query_bindings __P((char *)); +static int unbind_command __P((char *)); + +extern int no_line_editing; + +#define BIND_RETURN(x) do { return_code = x; goto bind_exit; } while (0) + +#define LFLAG 0x0001 +#define PFLAG 0x0002 +#define FFLAG 0x0004 +#define VFLAG 0x0008 +#define QFLAG 0x0010 +#define MFLAG 0x0020 +#define RFLAG 0x0040 +#define PPFLAG 0x0080 +#define VVFLAG 0x0100 +#define SFLAG 0x0200 +#define SSFLAG 0x0400 +#define UFLAG 0x0800 +#define XFLAG 0x1000 +#define XXFLAG 0x2000 + +int +bind_builtin (list) + WORD_LIST *list; +{ + int return_code; + Keymap kmap, saved_keymap; + int flags, opt; + char *initfile, *map_name, *fun_name, *unbind_name, *remove_seq, *cmd_seq; + + if (no_line_editing) + { +#if 0 + builtin_error (_("line editing not enabled")); + return (EXECUTION_FAILURE); +#else + builtin_warning (_("line editing not enabled")); +#endif + } + + kmap = saved_keymap = (Keymap) NULL; + flags = 0; + initfile = map_name = fun_name = unbind_name = remove_seq = (char *)NULL; + return_code = EXECUTION_SUCCESS; + + if (bash_readline_initialized == 0) + initialize_readline (); + + begin_unwind_frame ("bind_builtin"); + unwind_protect_var (rl_outstream); + + rl_outstream = stdout; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "lvpVPsSXf:q:u:m:r:x:")) != EOF) + { + switch (opt) + { + case 'l': + flags |= LFLAG; + break; + case 'v': + flags |= VFLAG; + break; + case 'p': + flags |= PFLAG; + break; + case 'f': + flags |= FFLAG; + initfile = list_optarg; + break; + case 'm': + flags |= MFLAG; + map_name = list_optarg; + break; + case 'q': + flags |= QFLAG; + fun_name = list_optarg; + break; + case 'u': + flags |= UFLAG; + unbind_name = list_optarg; + break; + case 'r': + flags |= RFLAG; + remove_seq = list_optarg; + break; + case 'V': + flags |= VVFLAG; + break; + case 'P': + flags |= PPFLAG; + break; + case 's': + flags |= SFLAG; + break; + case 'S': + flags |= SSFLAG; + break; + case 'x': + flags |= XFLAG; + cmd_seq = list_optarg; + break; + case 'X': + flags |= XXFLAG; + break; + default: + builtin_usage (); + BIND_RETURN (EX_USAGE); + } + } + + list = loptend; + + /* First, see if we need to install a special keymap for this + command. Then start on the arguments. */ + + if ((flags & MFLAG) && map_name) + { + kmap = rl_get_keymap_by_name (map_name); + if (kmap == 0) + { + builtin_error (_("`%s': invalid keymap name"), map_name); + BIND_RETURN (EXECUTION_FAILURE); + } + } + + if (kmap) + { + saved_keymap = rl_get_keymap (); + rl_set_keymap (kmap); + } + + /* XXX - we need to add exclusive use tests here. It doesn't make sense + to use some of these options together. */ + /* Now hack the option arguments */ + if (flags & LFLAG) + rl_list_funmap_names (); + + if (flags & PFLAG) + rl_function_dumper (1); + + if (flags & PPFLAG) + rl_function_dumper (0); + + if (flags & SFLAG) + rl_macro_dumper (1); + + if (flags & SSFLAG) + rl_macro_dumper (0); + + if (flags & VFLAG) + rl_variable_dumper (1); + + if (flags & VVFLAG) + rl_variable_dumper (0); + + if ((flags & FFLAG) && initfile) + { + if (rl_read_init_file (initfile) != 0) + { + builtin_error (_("%s: cannot read: %s"), initfile, strerror (errno)); + BIND_RETURN (EXECUTION_FAILURE); + } + } + + if ((flags & QFLAG) && fun_name) + return_code = query_bindings (fun_name); + + if ((flags & UFLAG) && unbind_name) + return_code = unbind_command (unbind_name); + + if ((flags & RFLAG) && remove_seq) + { + if (rl_bind_keyseq (remove_seq, (rl_command_func_t *)NULL) != 0) + { + builtin_error (_("`%s': cannot unbind"), remove_seq); + BIND_RETURN (EXECUTION_FAILURE); + } + } + + if (flags & XFLAG) + return_code = bind_keyseq_to_unix_command (cmd_seq); + + if (flags & XXFLAG) + return_code = print_unix_command_map (); + + /* Process the rest of the arguments as binding specifications. */ + while (list) + { + rl_parse_and_bind (list->word->word); + list = list->next; + } + + bind_exit: + if (saved_keymap) + rl_set_keymap (saved_keymap); + + run_unwind_frame ("bind_builtin"); + + return (sh_chkwrite (return_code)); +} + +static int +query_bindings (name) + char *name; +{ + rl_command_func_t *function; + char **keyseqs; + int j; + + function = rl_named_function (name); + if (function == 0) + { + builtin_error (_("`%s': unknown function name"), name); + return EXECUTION_FAILURE; + } + + keyseqs = rl_invoking_keyseqs (function); + + if (!keyseqs) + { + printf (_("%s is not bound to any keys.\n"), name); + return EXECUTION_FAILURE; + } + + printf (_("%s can be invoked via "), name); + for (j = 0; j < 5 && keyseqs[j]; j++) + printf ("\"%s\"%s", keyseqs[j], keyseqs[j + 1] ? ", " : ".\n"); + if (keyseqs[j]) + printf ("...\n"); + strvec_dispose (keyseqs); + return EXECUTION_SUCCESS; +} + +static int +unbind_command (name) + char *name; +{ + rl_command_func_t *function; + + function = rl_named_function (name); + if (function == 0) + { + builtin_error (_("`%s': unknown function name"), name); + return EXECUTION_FAILURE; + } + + rl_unbind_function_in_map (function, rl_get_keymap ()); + return EXECUTION_SUCCESS; +} +#endif /* READLINE */ diff --git a/builtins/break.def b/builtins/break.def new file mode 100644 index 0000000..232ac1a --- /dev/null +++ b/builtins/break.def @@ -0,0 +1,141 @@ +This file is break.def, from which is created break.c. +It implements the builtins "break" and "continue" in Bash. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES break.c + +$BUILTIN break +$FUNCTION break_builtin +$SHORT_DOC break [n] +Exit for, while, or until loops. + +Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing +loops. + +Exit Status: +The exit status is 0 unless N is not greater than or equal to 1. +$END +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "../bashintl.h" + +#include "../shell.h" +#include "common.h" + +extern char *this_command_name; +extern int posixly_correct; + +static int check_loop_level __P((void)); + +/* The depth of while's and until's. */ +int loop_level = 0; + +/* Non-zero when a "break" instruction is encountered. */ +int breaking = 0; + +/* Non-zero when we have encountered a continue instruction. */ +int continuing = 0; + +/* Set up to break x levels, where x defaults to 1, but can be specified + as the first argument. */ +int +break_builtin (list) + WORD_LIST *list; +{ + intmax_t newbreak; + + if (check_loop_level () == 0) + return (EXECUTION_SUCCESS); + + (void)get_numeric_arg (list, 1, &newbreak); + + if (newbreak <= 0) + { + sh_erange (list->word->word, _("loop count")); + breaking = loop_level; + return (EXECUTION_FAILURE); + } + + if (newbreak > loop_level) + newbreak = loop_level; + + breaking = newbreak; + + return (EXECUTION_SUCCESS); +} + +$BUILTIN continue +$FUNCTION continue_builtin +$SHORT_DOC continue [n] +Resume for, while, or until loops. + +Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop. +If N is specified, resumes the Nth enclosing loop. + +Exit Status: +The exit status is 0 unless N is not greater than or equal to 1. +$END + +/* Set up to continue x levels, where x defaults to 1, but can be specified + as the first argument. */ +int +continue_builtin (list) + WORD_LIST *list; +{ + intmax_t newcont; + + if (check_loop_level () == 0) + return (EXECUTION_SUCCESS); + + (void)get_numeric_arg (list, 1, &newcont); + + if (newcont <= 0) + { + sh_erange (list->word->word, _("loop count")); + breaking = loop_level; + return (EXECUTION_FAILURE); + } + + if (newcont > loop_level) + newcont = loop_level; + + continuing = newcont; + + return (EXECUTION_SUCCESS); +} + +/* Return non-zero if a break or continue command would be okay. + Print an error message if break or continue is meaningless here. */ +static int +check_loop_level () +{ +#if defined (BREAK_COMPLAINS) + if (loop_level == 0 && posixly_correct == 0) + builtin_error (_("only meaningful in a `for', `while', or `until' loop")); +#endif /* BREAK_COMPLAINS */ + + return (loop_level); +} diff --git a/builtins/builtin.def b/builtins/builtin.def new file mode 100644 index 0000000..3e765e4 --- /dev/null +++ b/builtins/builtin.def @@ -0,0 +1,85 @@ +This file is builtin.def, from which is created builtin.c. +It implements the builtin "builtin" in Bash. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES builtin.c + +$BUILTIN builtin +$FUNCTION builtin_builtin +$SHORT_DOC builtin [shell-builtin [arg ...]] +Execute shell builtins. + +Execute SHELL-BUILTIN with arguments ARGs without performing command +lookup. This is useful when you wish to reimplement a shell builtin +as a shell function, but need to execute the builtin within the function. + +Exit Status: +Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is +not a shell builtin.. +$END +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "../shell.h" +#include "common.h" +#include "bashgetopt.h" + +extern char *this_command_name; + +/* Run the command mentioned in list directly, without going through the + normal alias/function/builtin/filename lookup process. */ +int +builtin_builtin (list) + WORD_LIST *list; +{ + sh_builtin_func_t *function; + register char *command; + + if (no_options (list)) + return (EX_USAGE); + list = loptend; /* skip over possible `--' */ + + if (list == 0) + return (EXECUTION_SUCCESS); + + command = list->word->word; +#if defined (DISABLED_BUILTINS) + function = builtin_address (command); +#else /* !DISABLED_BUILTINS */ + function = find_shell_builtin (command); +#endif /* !DISABLED_BUILTINS */ + + if (!function) + { + sh_notbuiltin (command); + return (EXECUTION_FAILURE); + } + else + { + this_command_name = command; + list = list->next; + return ((*function) (list)); + } +} diff --git a/builtins/caller.def b/builtins/caller.def new file mode 100644 index 0000000..965676b --- /dev/null +++ b/builtins/caller.def @@ -0,0 +1,154 @@ +This file is caller.def, from which is created caller.c. It implements the +builtin "caller" in Bash. + +Copyright (C) 2002-2008 Rocky Bernstein for Free Software Foundation, Inc. +Copyright (C) 2008-2013 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES caller.c + +$BUILTIN caller +$FUNCTION caller_builtin +$DEPENDS_ON DEBUGGER +$SHORT_DOC caller [expr] +Return the context of the current subroutine call. + +Without EXPR, returns "$line $filename". With EXPR, returns +"$line $subroutine $filename"; this extra information can be used to +provide a stack trace. + +The value of EXPR indicates how many call frames to go back before the +current one; the top frame is frame 0. + +Exit Status: +Returns 0 unless the shell is not executing a shell function or EXPR +is invalid. +$END + +#include +#include +#include "chartypes.h" +#include "bashtypes.h" + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include + +#include "../bashintl.h" + +#include "../shell.h" +#include "common.h" +#include "builtext.h" +#include "bashgetopt.h" + +#ifdef LOADABLE_BUILTIN +# include "builtins.h" +#endif + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +int +caller_builtin (list) + WORD_LIST *list; +{ +#if !defined (ARRAY_VARS) + printf ("1 NULL\n"); + return (EXECUTION_FAILURE); +#else + SHELL_VAR *funcname_v, *bash_source_v, *bash_lineno_v; + ARRAY *funcname_a, *bash_source_a, *bash_lineno_a; + char *funcname_s, *source_s, *lineno_s; + intmax_t num; + + GET_ARRAY_FROM_VAR ("FUNCNAME", funcname_v, funcname_a); + GET_ARRAY_FROM_VAR ("BASH_SOURCE", bash_source_v, bash_source_a); + GET_ARRAY_FROM_VAR ("BASH_LINENO", bash_lineno_v, bash_lineno_a); + + if (bash_lineno_a == 0 || array_empty (bash_lineno_a)) + return (EXECUTION_FAILURE); + + if (bash_source_a == 0 || array_empty (bash_source_a)) + return (EXECUTION_FAILURE); + + if (no_options (list)) + return (EX_USAGE); + list = loptend; /* skip over possible `--' */ + + /* If there is no argument list, then give short form: line filename. */ + if (list == 0) + { + lineno_s = array_reference (bash_lineno_a, 0); + source_s = array_reference (bash_source_a, 1); + printf("%s %s\n", lineno_s ? lineno_s : "NULL", source_s ? source_s : "NULL"); + return (EXECUTION_SUCCESS); + } + + if (funcname_a == 0 || array_empty (funcname_a)) + return (EXECUTION_FAILURE); + + if (legal_number (list->word->word, &num)) + { + lineno_s = array_reference (bash_lineno_a, num); + source_s = array_reference (bash_source_a, num+1); + funcname_s = array_reference (funcname_a, num+1); + + if (lineno_s == NULL|| source_s == NULL || funcname_s == NULL) + return (EXECUTION_FAILURE); + + printf("%s %s %s\n", lineno_s, funcname_s, source_s); + } + else + { + sh_invalidnum (list->word->word); + builtin_usage (); + return (EX_USAGE); + } + + return (EXECUTION_SUCCESS); +#endif +} + +#ifdef LOADABLE_BUILTIN +static char *caller_doc[] = { +N_("Returns the context of the current subroutine call.\n\ + \n\ + Without EXPR, returns "$line $filename". With EXPR, returns\n\ + "$line $subroutine $filename"; this extra information can be used to\n\ + provide a stack trace.\n\ + \n\ + The value of EXPR indicates how many call frames to go back before the\n\ + current one; the top frame is frame 0."), + (char *)NULL +}; + +struct builtin caller_struct = { + "caller", + caller_builtin, + BUILTIN_ENABLED, + caller_doc, + "caller [EXPR]", + 0 +}; + +#endif /* LOADABLE_BUILTIN */ diff --git a/builtins/cd.def b/builtins/cd.def new file mode 100644 index 0000000..f66e68c --- /dev/null +++ b/builtins/cd.def @@ -0,0 +1,661 @@ +This file is cd.def, from which is created cd.c. It implements the +builtins "cd" and "pwd" in Bash. + +Copyright (C) 1987-2013 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES cd.c +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "../bashtypes.h" +#include "posixdir.h" +#include "posixstat.h" +#if defined (HAVE_SYS_PARAM_H) +#include +#endif +#include + +#include + +#include "../bashansi.h" +#include "../bashintl.h" + +#include +#include + +#include "../shell.h" +#include "../flags.h" +#include "maxpath.h" +#include "common.h" +#include "bashgetopt.h" + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +extern int posixly_correct; +extern int array_needs_making; +extern const char * const bash_getcwd_errstr; + +static int bindpwd __P((int)); +static int setpwd __P((char *)); +static char *resetpwd __P((char *)); +static int change_to_directory __P((char *, int, int)); + +static int cdxattr __P((char *, char **)); +static void resetxattr __P((void)); + +/* Change this to 1 to get cd spelling correction by default. */ +int cdspelling = 0; + +int cdable_vars; + +static int eflag; /* file scope so bindpwd() can see it */ +static int xattrflag; /* O_XATTR support for openat */ +static int xattrfd = -1; + +$BUILTIN cd +$FUNCTION cd_builtin +$SHORT_DOC cd [-L|[-P [-e]] [-@]] [dir] +Change the shell working directory. + +Change the current directory to DIR. The default DIR is the value of the +HOME shell variable. + +The variable CDPATH defines the search path for the directory containing +DIR. Alternative directory names in CDPATH are separated by a colon (:). +A null directory name is the same as the current directory. If DIR begins +with a slash (/), then CDPATH is not used. + +If the directory is not found, and the shell option `cdable_vars' is set, +the word is assumed to be a variable name. If that variable has a value, +its value is used for DIR. + +Options: + -L force symbolic links to be followed: resolve symbolic links in + DIR after processing instances of `..' + -P use the physical directory structure without following symbolic + links: resolve symbolic links in DIR before processing instances + of `..' + -e if the -P option is supplied, and the current working directory + cannot be determined successfully, exit with a non-zero status +#if defined (O_XATTR) + -@ on systems that support it, present a file with extended attributes + as a directory containing the file attributes +#endif + +The default is to follow symbolic links, as if `-L' were specified. +`..' is processed by removing the immediately previous pathname component +back to a slash or the beginning of DIR. + +Exit Status: +Returns 0 if the directory is changed, and if $PWD is set successfully when +-P is used; non-zero otherwise. +$END + +/* Just set $PWD, don't change OLDPWD. Used by `pwd -P' in posix mode. */ +static int +setpwd (dirname) + char *dirname; +{ + int old_anm; + SHELL_VAR *tvar; + + old_anm = array_needs_making; + tvar = bind_variable ("PWD", dirname ? dirname : "", 0); + if (tvar && readonly_p (tvar)) + return EXECUTION_FAILURE; + if (tvar && old_anm == 0 && array_needs_making && exported_p (tvar)) + { + update_export_env_inplace ("PWD=", 4, dirname ? dirname : ""); + array_needs_making = 0; + } + return EXECUTION_SUCCESS; +} + +static int +bindpwd (no_symlinks) + int no_symlinks; +{ + char *dirname, *pwdvar; + int old_anm, r; + SHELL_VAR *tvar; + + r = sh_chkwrite (EXECUTION_SUCCESS); + +#define tcwd the_current_working_directory + dirname = tcwd ? (no_symlinks ? sh_physpath (tcwd, 0) : tcwd) + : get_working_directory ("cd"); +#undef tcwd + + old_anm = array_needs_making; + pwdvar = get_string_value ("PWD"); + + tvar = bind_variable ("OLDPWD", pwdvar, 0); + if (tvar && readonly_p (tvar)) + r = EXECUTION_FAILURE; + + if (old_anm == 0 && array_needs_making && exported_p (tvar)) + { + update_export_env_inplace ("OLDPWD=", 7, pwdvar); + array_needs_making = 0; + } + + if (setpwd (dirname) == EXECUTION_FAILURE) + r = EXECUTION_FAILURE; + if (dirname == 0 && eflag) + r = EXECUTION_FAILURE; + + if (dirname && dirname != the_current_working_directory) + free (dirname); + + return (r); +} + +/* Call get_working_directory to reset the value of + the_current_working_directory () */ +static char * +resetpwd (caller) + char *caller; +{ + char *tdir; + + FREE (the_current_working_directory); + the_current_working_directory = (char *)NULL; + tdir = get_working_directory (caller); + return (tdir); +} + +static int +cdxattr (dir, ndirp) + char *dir; /* don't assume we can always free DIR */ + char **ndirp; /* return new constructed directory name */ +{ +#if defined (O_XATTR) + int apfd, fd, r, e; + char buf[11+40+40]; /* construct new `fake' path for pwd */ + + apfd = openat (AT_FDCWD, dir, O_RDONLY|O_NONBLOCK); + if (apfd < 0) + return -1; + fd = openat (apfd, ".", O_XATTR); + e = errno; + close (apfd); /* ignore close error for now */ + errno = e; + if (fd < 0) + return -1; + r = fchdir (fd); /* assume fchdir exists everywhere with O_XATTR */ + if (r < 0) + { + close (fd); + return -1; + } + /* NFSv4 and ZFS extended attribute directories do not have names which are + visible in the standard Unix directory tree structure. To ensure we have + a valid name for $PWD, we synthesize one under /proc, but to keep that + path valid, we need to keep the file descriptor open as long as we are in + this directory. This imposes a certain structure on /proc. */ + if (ndirp) + { + sprintf (buf, "/proc/%d/fd/%d", getpid(), fd); + *ndirp = savestring (buf); + } + + if (xattrfd >= 0) + close (xattrfd); + xattrfd = fd; + + return r; +#else + return -1; +#endif +} + +/* Clean up the O_XATTR baggage. Currently only closes xattrfd */ +static void +resetxattr () +{ +#if defined (O_XATTR) + if (xattrfd >= 0) + { + close (xattrfd); + xattrfd = -1; + } +#else + xattrfd = -1; /* not strictly necessary */ +#endif +} + +#define LCD_DOVARS 0x001 +#define LCD_DOSPELL 0x002 +#define LCD_PRINTPATH 0x004 +#define LCD_FREEDIRNAME 0x008 + +/* This builtin is ultimately the way that all user-visible commands should + change the current working directory. It is called by cd_to_string (), + so the programming interface is simple, and it handles errors and + restrictions properly. */ +int +cd_builtin (list) + WORD_LIST *list; +{ + char *dirname, *cdpath, *path, *temp; + int path_index, no_symlinks, opt, lflag; + +#if defined (RESTRICTED_SHELL) + if (restricted) + { + sh_restricted ((char *)NULL); + return (EXECUTION_FAILURE); + } +#endif /* RESTRICTED_SHELL */ + + eflag = 0; + no_symlinks = no_symbolic_links; + xattrflag = 0; + reset_internal_getopt (); +#if defined (O_XATTR) + while ((opt = internal_getopt (list, "eLP@")) != -1) +#else + while ((opt = internal_getopt (list, "eLP")) != -1) +#endif + { + switch (opt) + { + case 'P': + no_symlinks = 1; + break; + case 'L': + no_symlinks = 0; + break; + case 'e': + eflag = 1; + break; +#if defined (O_XATTR) + case '@': + xattrflag = 1; + break; +#endif + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + lflag = (cdable_vars ? LCD_DOVARS : 0) | + ((interactive && cdspelling) ? LCD_DOSPELL : 0); + if (eflag && no_symlinks == 0) + eflag = 0; + + if (list == 0) + { + /* `cd' without arguments is equivalent to `cd $HOME' */ + dirname = get_string_value ("HOME"); + + if (dirname == 0) + { + builtin_error (_("HOME not set")); + return (EXECUTION_FAILURE); + } + lflag = 0; + } +#if defined (CD_COMPLAINS) + else if (list->next) + { + builtin_error (_("too many arguments")); + return (EXECUTION_FAILURE); + } +#endif + else if (list->word->word[0] == '-' && list->word->word[1] == '\0') + { + /* This is `cd -', equivalent to `cd $OLDPWD' */ + dirname = get_string_value ("OLDPWD"); + + if (dirname == 0) + { + builtin_error (_("OLDPWD not set")); + return (EXECUTION_FAILURE); + } +#if 0 + lflag = interactive ? LCD_PRINTPATH : 0; +#else + lflag = LCD_PRINTPATH; /* According to SUSv3 */ +#endif + } + else if (absolute_pathname (list->word->word)) + dirname = list->word->word; + else if (privileged_mode == 0 && (cdpath = get_string_value ("CDPATH"))) + { + dirname = list->word->word; + + /* Find directory in $CDPATH. */ + path_index = 0; + while (path = extract_colon_unit (cdpath, &path_index)) + { + /* OPT is 1 if the path element is non-empty */ + opt = path[0] != '\0'; + temp = sh_makepath (path, dirname, MP_DOTILDE); + free (path); + + if (change_to_directory (temp, no_symlinks, xattrflag)) + { + /* POSIX.2 says that if a nonempty directory from CDPATH + is used to find the directory to change to, the new + directory name is echoed to stdout, whether or not + the shell is interactive. */ + if (opt && (path = no_symlinks ? temp : the_current_working_directory)) + printf ("%s\n", path); + + free (temp); +#if 0 + /* Posix.2 says that after using CDPATH, the resultant + value of $PWD will not contain `.' or `..'. */ + return (bindpwd (posixly_correct || no_symlinks)); +#else + return (bindpwd (no_symlinks)); +#endif + } + else + free (temp); + } + +#if 0 + /* changed for bash-4.2 Posix cd description steps 5-6 */ + /* POSIX.2 says that if `.' does not appear in $CDPATH, we don't + try the current directory, so we just punt now with an error + message if POSIXLY_CORRECT is non-zero. The check for cdpath[0] + is so we don't mistakenly treat a CDPATH value of "" as not + specifying the current directory. */ + if (posixly_correct && cdpath[0]) + { + builtin_error ("%s: %s", dirname, strerror (ENOENT)); + return (EXECUTION_FAILURE); + } +#endif + } + else + dirname = list->word->word; + + /* When we get here, DIRNAME is the directory to change to. If we + chdir successfully, just return. */ + if (change_to_directory (dirname, no_symlinks, xattrflag)) + { + if (lflag & LCD_PRINTPATH) + printf ("%s\n", dirname); + return (bindpwd (no_symlinks)); + } + + /* If the user requests it, then perhaps this is the name of + a shell variable, whose value contains the directory to + change to. */ + if (lflag & LCD_DOVARS) + { + temp = get_string_value (dirname); + if (temp && change_to_directory (temp, no_symlinks, xattrflag)) + { + printf ("%s\n", temp); + return (bindpwd (no_symlinks)); + } + } + + /* If the user requests it, try to find a directory name similar in + spelling to the one requested, in case the user made a simple + typo. This is similar to the UNIX 8th and 9th Edition shells. */ + if (lflag & LCD_DOSPELL) + { + temp = dirspell (dirname); + if (temp && change_to_directory (temp, no_symlinks, xattrflag)) + { + printf ("%s\n", temp); + free (temp); + return (bindpwd (no_symlinks)); + } + else + FREE (temp); + } + + builtin_error ("%s: %s", dirname, strerror (errno)); + return (EXECUTION_FAILURE); +} + +$BUILTIN pwd +$FUNCTION pwd_builtin +$SHORT_DOC pwd [-LP] +Print the name of the current working directory. + +Options: + -L print the value of $PWD if it names the current working + directory + -P print the physical directory, without any symbolic links + +By default, `pwd' behaves as if `-L' were specified. + +Exit Status: +Returns 0 unless an invalid option is given or the current directory +cannot be read. +$END + +/* Non-zero means that pwd always prints the physical directory, without + symbolic links. */ +static int verbatim_pwd; + +/* Print the name of the current working directory. */ +int +pwd_builtin (list) + WORD_LIST *list; +{ + char *directory; + int opt, pflag; + + verbatim_pwd = no_symbolic_links; + pflag = 0; + reset_internal_getopt (); + while ((opt = internal_getopt (list, "LP")) != -1) + { + switch (opt) + { + case 'P': + verbatim_pwd = pflag = 1; + break; + case 'L': + verbatim_pwd = 0; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + +#define tcwd the_current_working_directory + + directory = tcwd ? (verbatim_pwd ? sh_physpath (tcwd, 0) : tcwd) + : get_working_directory ("pwd"); + + /* Try again using getcwd() if canonicalization fails (for instance, if + the file system has changed state underneath bash). */ + if ((tcwd && directory == 0) || + (posixly_correct && same_file (".", tcwd, (struct stat *)0, (struct stat *)0) == 0)) + { + if (directory && directory != tcwd) + free (directory); + directory = resetpwd ("pwd"); + } + +#undef tcwd + + if (directory) + { + opt = EXECUTION_SUCCESS; + printf ("%s\n", directory); + /* This is dumb but posix-mandated. */ + if (posixly_correct && pflag) + opt = setpwd (directory); + if (directory != the_current_working_directory) + free (directory); + return (sh_chkwrite (opt)); + } + else + return (EXECUTION_FAILURE); +} + +/* Do the work of changing to the directory NEWDIR. Handle symbolic + link following, etc. This function *must* return with + the_current_working_directory either set to NULL (in which case + getcwd() will eventually be called), or set to a string corresponding + to the working directory. Return 1 on success, 0 on failure. */ + +static int +change_to_directory (newdir, nolinks, xattr) + char *newdir; + int nolinks, xattr; +{ + char *t, *tdir, *ndir; + int err, canon_failed, r, ndlen, dlen; + + tdir = (char *)NULL; + + if (the_current_working_directory == 0) + { + t = get_working_directory ("chdir"); + FREE (t); + } + + t = make_absolute (newdir, the_current_working_directory); + + /* TDIR is either the canonicalized absolute pathname of NEWDIR + (nolinks == 0) or the absolute physical pathname of NEWDIR + (nolinks != 0). */ + tdir = nolinks ? sh_physpath (t, 0) + : sh_canonpath (t, PATH_CHECKDOTDOT|PATH_CHECKEXISTS); + + ndlen = strlen (newdir); + dlen = strlen (t); + + /* Use the canonicalized version of NEWDIR, or, if canonicalization + failed, use the non-canonical form. */ + canon_failed = 0; + if (tdir && *tdir) + free (t); + else + { + FREE (tdir); + tdir = t; + canon_failed = 1; + } + + /* In POSIX mode, if we're resolving symlinks logically and sh_canonpath + returns NULL (because it checks the path, it will return NULL if the + resolved path doesn't exist), fail immediately. */ + if (posixly_correct && nolinks == 0 && canon_failed && (errno != ENAMETOOLONG || ndlen > PATH_MAX)) + { +#if defined ENAMETOOLONG + if (errno != ENOENT && errno != ENAMETOOLONG) +#else + if (errno != ENOENT) +#endif + errno = ENOTDIR; + free (tdir); + return (0); + } + +#if defined (O_XATTR) + if (xattrflag) + { + r = cdxattr (nolinks ? newdir : tdir, &ndir); + if (r >= 0) + { + canon_failed = 0; + free (tdir); + tdir = ndir; + } + else + { + err = errno; + free (tdir); + errno = err; + return (0); /* no xattr */ + } + } + else +#endif + { + r = chdir (nolinks ? newdir : tdir); + if (r >= 0) + resetxattr (); + } + + /* If the chdir succeeds, update the_current_working_directory. */ + if (r == 0) + { + /* If canonicalization failed, but the chdir succeeded, reset the + shell's idea of the_current_working_directory. */ + if (canon_failed) + { + t = resetpwd ("cd"); + if (t == 0) + set_working_directory (tdir); + else + free (t); + } + else + set_working_directory (tdir); + + free (tdir); + return (1); + } + + /* We failed to change to the appropriate directory name. If we tried + what the user passed (nolinks != 0), punt now. */ + if (nolinks) + { + free (tdir); + return (0); + } + + err = errno; + + /* We're not in physical mode (nolinks == 0), but we failed to change to + the canonicalized directory name (TDIR). Try what the user passed + verbatim. If we succeed, reinitialize the_current_working_directory. */ + if (chdir (newdir) == 0) + { + t = resetpwd ("cd"); + if (t == 0) + set_working_directory (tdir); + else + free (t); + + r = 1; + } + else + { + errno = err; + r = 0; + } + + free (tdir); + return r; +} diff --git a/builtins/colon.def b/builtins/colon.def new file mode 100644 index 0000000..4b78b30 --- /dev/null +++ b/builtins/colon.def @@ -0,0 +1,67 @@ +This file is colon.def, from which is created colon.c. +It implements the builtin ":" in Bash. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES colon.c + +$BUILTIN : +$DOCNAME colon +$FUNCTION colon_builtin +$SHORT_DOC : +Null command. + +No effect; the command does nothing. + +Exit Status: +Always succeeds. +$END + +$BUILTIN true +$FUNCTION colon_builtin +$SHORT_DOC true +Return a successful result. + +Exit Status: +Always succeeds. +$END + +$BUILTIN false +$FUNCTION false_builtin +$SHORT_DOC false +Return an unsuccessful result. + +Exit Status: +Always fails. +$END + +/* Return a successful result. */ +int +colon_builtin (ignore) + char *ignore; +{ + return (0); +} + +/* Return an unsuccessful result. */ +int +false_builtin (ignore) + char *ignore; +{ + return (1); +} diff --git a/builtins/command.def b/builtins/command.def new file mode 100644 index 0000000..1845279 --- /dev/null +++ b/builtins/command.def @@ -0,0 +1,219 @@ +This file is command.def, from which is created command.c. +It implements the builtin "command" in Bash. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES command.c + +$BUILTIN command +$FUNCTION command_builtin +$SHORT_DOC command [-pVv] command [arg ...] +Execute a simple command or display information about commands. + +Runs COMMAND with ARGS suppressing shell function lookup, or display +information about the specified COMMANDs. Can be used to invoke commands +on disk when a function with the same name exists. + +Options: + -p use a default value for PATH that is guaranteed to find all of + the standard utilities + -v print a description of COMMAND similar to the `type' builtin + -V print a more verbose description of each COMMAND + +Exit Status: +Returns exit status of COMMAND, or failure if COMMAND is not found. +$END + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "../bashansi.h" + +#include "../shell.h" +#include "../execute_cmd.h" +#include "../flags.h" +#include "bashgetopt.h" +#include "common.h" + +#if defined (_CS_PATH) && defined (HAVE_CONFSTR) && !HAVE_DECL_CONFSTR +extern size_t confstr __P((int, char *, size_t)); +#endif + +extern int subshell_environment; + +static void restore_path __P((char *)); +static char *get_standard_path __P((void)); + +/* Run the commands mentioned in LIST without paying attention to shell + functions. */ +int +command_builtin (list) + WORD_LIST *list; +{ + int result, verbose, use_standard_path, opt; + char *old_path, *standard_path; + COMMAND *command; + + verbose = use_standard_path = 0; + reset_internal_getopt (); + while ((opt = internal_getopt (list, "pvV")) != -1) + { + switch (opt) + { + case 'p': + use_standard_path = 1; + break; + case 'V': + verbose = CDESC_SHORTDESC|CDESC_ABSPATH; /* look in common.h for constants */ + break; + case 'v': + verbose = CDESC_REUSABLE; /* ditto */ + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + if (list == 0) + return (EXECUTION_SUCCESS); + +#if defined (RESTRICTED_SHELL) + if (use_standard_path && restricted) + { + sh_restricted ("-p"); + return (EXECUTION_FAILURE); + } +#endif + + begin_unwind_frame ("command_builtin"); + + if (use_standard_path) + { + old_path = get_string_value ("PATH"); + /* If old_path is NULL, $PATH is unset. If so, we want to make sure + it's unset after this command completes. */ + if (old_path) + old_path = savestring (old_path); + add_unwind_protect ((Function *)restore_path, old_path); + + standard_path = get_standard_path (); + bind_variable ("PATH", standard_path ? standard_path : "", 0); + stupidly_hack_special_variables ("PATH"); + FREE (standard_path); + } + + if (verbose) + { + int found, any_found; + + for (any_found = 0; list; list = list->next) + { + found = describe_command (list->word->word, verbose); + + if (found == 0 && verbose != CDESC_REUSABLE) + sh_notfound (list->word->word); + + any_found += found; + } + + run_unwind_frame ("command_builtin"); + return (any_found ? EXECUTION_SUCCESS : EXECUTION_FAILURE); + } + +#define COMMAND_BUILTIN_FLAGS (CMD_NO_FUNCTIONS | CMD_INHIBIT_EXPANSION | CMD_COMMAND_BUILTIN) + + /* We don't want this to be reparsed (consider command echo 'foo &'), so + just make a simple_command structure and call execute_command with it. */ + command = make_bare_simple_command (); + command->value.Simple->words = (WORD_LIST *)copy_word_list (list); + command->value.Simple->redirects = (REDIRECT *)NULL; + command->flags |= COMMAND_BUILTIN_FLAGS; + command->value.Simple->flags |= COMMAND_BUILTIN_FLAGS; +#if 0 + /* This breaks for things like ( cd /tmp ; command z ababa ; echo next ) + or $(command echo a ; command echo b;) or even + { command echo a; command echo b; } & */ + /* If we're in a subshell, see if we can get away without forking + again, since we've already forked to run this builtin. */ + if (subshell_environment) + { + command->flags |= CMD_NO_FORK; + command->value.Simple->flags |= CMD_NO_FORK; + } +#endif + add_unwind_protect ((char *)dispose_command, command); + result = execute_command (command); + + run_unwind_frame ("command_builtin"); + + return (result); +} + +/* Restore the value of the $PATH variable after replacing it when + executing `command -p'. */ +static void +restore_path (var) + char *var; +{ + if (var) + { + bind_variable ("PATH", var, 0); + free (var); + } + else + unbind_variable ("PATH"); + + stupidly_hack_special_variables ("PATH"); +} + +/* Return a value for PATH that is guaranteed to find all of the standard + utilities. This uses Posix.2 configuration variables, if present. It + uses a value defined in config.h as a last resort. */ +static char * +get_standard_path () +{ +#if defined (_CS_PATH) && defined (HAVE_CONFSTR) + char *p; + size_t len; + + len = (size_t)confstr (_CS_PATH, (char *)NULL, (size_t)0); + if (len > 0) + { + p = (char *)xmalloc (len + 2); + *p = '\0'; + confstr (_CS_PATH, p, len); + return (p); + } + else + return (savestring (STANDARD_UTILS_PATH)); +#else /* !_CS_PATH || !HAVE_CONFSTR */ +# if defined (CS_PATH) + return (savestring (CS_PATH)); +# else + return (savestring (STANDARD_UTILS_PATH)); +# endif /* !CS_PATH */ +#endif /* !_CS_PATH || !HAVE_CONFSTR */ +} diff --git a/builtins/common.c b/builtins/common.c new file mode 100644 index 0000000..fb2b38c --- /dev/null +++ b/builtins/common.c @@ -0,0 +1,890 @@ +/* common.c - utility functions for all builtins */ + +/* Copyright (C) 1987-2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include +#include +#include "../bashtypes.h" +#include "posixstat.h" +#include + +#include + +#if defined (PREFER_STDARG) +# include +#else +# include +#endif + +#include "../bashansi.h" +#include "../bashintl.h" + +#define NEED_FPURGE_DECL + +#include "../shell.h" +#include "maxpath.h" +#include "../flags.h" +#include "../jobs.h" +#include "../builtins.h" +#include "../input.h" +#include "../execute_cmd.h" +#include "../trap.h" +#include "bashgetopt.h" +#include "common.h" +#include "builtext.h" +#include + +#if defined (HISTORY) +# include "../bashhist.h" +#endif + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +extern int indirection_level, subshell_environment; +extern int line_number; +extern int last_command_exit_value; +extern int running_trap; +extern int posixly_correct; +extern char *this_command_name, *shell_name; +extern const char * const bash_getcwd_errstr; + +/* Used by some builtins and the mainline code. */ +sh_builtin_func_t *last_shell_builtin = (sh_builtin_func_t *)NULL; +sh_builtin_func_t *this_shell_builtin = (sh_builtin_func_t *)NULL; + +/* **************************************************************** */ +/* */ +/* Error reporting, usage, and option processing */ +/* */ +/* **************************************************************** */ + +/* This is a lot like report_error (), but it is for shell builtins + instead of shell control structures, and it won't ever exit the + shell. */ + +static void +builtin_error_prolog () +{ + char *name; + + name = get_name_for_error (); + fprintf (stderr, "%s: ", name); + + if (interactive_shell == 0) + fprintf (stderr, _("line %d: "), executing_line_number ()); + + if (this_command_name && *this_command_name) + fprintf (stderr, "%s: ", this_command_name); +} + +void +#if defined (PREFER_STDARG) +builtin_error (const char *format, ...) +#else +builtin_error (format, va_alist) + const char *format; + va_dcl +#endif +{ + va_list args; + + builtin_error_prolog (); + + SH_VA_START (args, format); + + vfprintf (stderr, format, args); + va_end (args); + fprintf (stderr, "\n"); +} + +void +#if defined (PREFER_STDARG) +builtin_warning (const char *format, ...) +#else +builtin_warning (format, va_alist) + const char *format; + va_dcl +#endif +{ + va_list args; + + builtin_error_prolog (); + fprintf (stderr, _("warning: ")); + + SH_VA_START (args, format); + + vfprintf (stderr, format, args); + va_end (args); + fprintf (stderr, "\n"); +} + +/* Print a usage summary for the currently-executing builtin command. */ +void +builtin_usage () +{ + if (this_command_name && *this_command_name) + fprintf (stderr, _("%s: usage: "), this_command_name); + fprintf (stderr, "%s\n", _(current_builtin->short_doc)); + fflush (stderr); +} + +/* Return if LIST is NULL else barf and jump to top_level. Used by some + builtins that do not accept arguments. */ +void +no_args (list) + WORD_LIST *list; +{ + if (list) + { + builtin_error (_("too many arguments")); + top_level_cleanup (); + jump_to_top_level (DISCARD); + } +} + +/* Check that no options were given to the currently-executing builtin, + and return 0 if there were options. */ +int +no_options (list) + WORD_LIST *list; +{ + reset_internal_getopt (); + if (internal_getopt (list, "") != -1) + { + builtin_usage (); + return (1); + } + return (0); +} + +void +sh_needarg (s) + char *s; +{ + builtin_error (_("%s: option requires an argument"), s); +} + +void +sh_neednumarg (s) + char *s; +{ + builtin_error (_("%s: numeric argument required"), s); +} + +void +sh_notfound (s) + char *s; +{ + builtin_error (_("%s: not found"), s); +} + +/* Function called when one of the builtin commands detects an invalid + option. */ +void +sh_invalidopt (s) + char *s; +{ + builtin_error (_("%s: invalid option"), s); +} + +void +sh_invalidoptname (s) + char *s; +{ + builtin_error (_("%s: invalid option name"), s); +} + +void +sh_invalidid (s) + char *s; +{ + builtin_error (_("`%s': not a valid identifier"), s); +} + +void +sh_invalidnum (s) + char *s; +{ + char *msg; + + if (*s == '0' && isdigit (s[1])) + msg = _("invalid octal number"); + else if (*s == '0' && s[1] == 'x') + msg = _("invalid hex number"); + else + msg = _("invalid number"); + builtin_error ("%s: %s", s, msg); +} + +void +sh_invalidsig (s) + char *s; +{ + builtin_error (_("%s: invalid signal specification"), s); +} + +void +sh_badpid (s) + char *s; +{ + builtin_error (_("`%s': not a pid or valid job spec"), s); +} + +void +sh_readonly (s) + const char *s; +{ + builtin_error (_("%s: readonly variable"), s); +} + +void +sh_erange (s, desc) + char *s, *desc; +{ + if (s) + builtin_error (_("%s: %s out of range"), s, desc ? desc : _("argument")); + else + builtin_error (_("%s out of range"), desc ? desc : _("argument")); +} + +#if defined (JOB_CONTROL) +void +sh_badjob (s) + char *s; +{ + builtin_error (_("%s: no such job"), s); +} + +void +sh_nojobs (s) + char *s; +{ + if (s) + builtin_error (_("%s: no job control"), s); + else + builtin_error (_("no job control")); +} +#endif + +#if defined (RESTRICTED_SHELL) +void +sh_restricted (s) + char *s; +{ + if (s) + builtin_error (_("%s: restricted"), s); + else + builtin_error (_("restricted")); +} +#endif + +void +sh_notbuiltin (s) + char *s; +{ + builtin_error (_("%s: not a shell builtin"), s); +} + +void +sh_wrerror () +{ +#if defined (DONT_REPORT_BROKEN_PIPE_WRITE_ERRORS) && defined (EPIPE) + if (errno != EPIPE) +#endif /* DONT_REPORT_BROKEN_PIPE_WRITE_ERRORS && EPIPE */ + builtin_error (_("write error: %s"), strerror (errno)); +} + +void +sh_ttyerror (set) + int set; +{ + if (set) + builtin_error (_("error setting terminal attributes: %s"), strerror (errno)); + else + builtin_error (_("error getting terminal attributes: %s"), strerror (errno)); +} + +int +sh_chkwrite (s) + int s; +{ + fflush (stdout); + if (ferror (stdout)) + { + sh_wrerror (); + fpurge (stdout); + clearerr (stdout); + return (EXECUTION_FAILURE); + } + return (s); +} + +/* **************************************************************** */ +/* */ +/* Shell positional parameter manipulation */ +/* */ +/* **************************************************************** */ + +/* Convert a WORD_LIST into a C-style argv. Return the number of elements + in the list in *IP, if IP is non-null. A convenience function for + loadable builtins; also used by `test'. */ +char ** +make_builtin_argv (list, ip) + WORD_LIST *list; + int *ip; +{ + char **argv; + + argv = strvec_from_word_list (list, 0, 1, ip); + argv[0] = this_command_name; + return argv; +} + +/* Remember LIST in $1 ... $9, and REST_OF_ARGS. If DESTRUCTIVE is + non-zero, then discard whatever the existing arguments are, else + only discard the ones that are to be replaced. */ +void +remember_args (list, destructive) + WORD_LIST *list; + int destructive; +{ + register int i; + + for (i = 1; i < 10; i++) + { + if ((destructive || list) && dollar_vars[i]) + { + free (dollar_vars[i]); + dollar_vars[i] = (char *)NULL; + } + + if (list) + { + dollar_vars[i] = savestring (list->word->word); + list = list->next; + } + } + + /* If arguments remain, assign them to REST_OF_ARGS. + Note that copy_word_list (NULL) returns NULL, and + that dispose_words (NULL) does nothing. */ + if (destructive || list) + { + dispose_words (rest_of_args); + rest_of_args = copy_word_list (list); + } + + if (destructive) + set_dollar_vars_changed (); +} + +static int changed_dollar_vars; + +/* Have the dollar variables been reset to new values since we last + checked? */ +int +dollar_vars_changed () +{ + return (changed_dollar_vars); +} + +void +set_dollar_vars_unchanged () +{ + changed_dollar_vars = 0; +} + +void +set_dollar_vars_changed () +{ + if (variable_context) + changed_dollar_vars |= ARGS_FUNC; + else if (this_shell_builtin == set_builtin) + changed_dollar_vars |= ARGS_SETBLTIN; + else + changed_dollar_vars |= ARGS_INVOC; +} + +/* **************************************************************** */ +/* */ +/* Validating numeric input and arguments */ +/* */ +/* **************************************************************** */ + +/* Read a numeric arg for this_command_name, the name of the shell builtin + that wants it. LIST is the word list that the arg is to come from. + Accept only the numeric argument; report an error if other arguments + follow. If FATAL is 1, call throw_to_top_level, which exits the + shell; if it's 2, call jump_to_top_level (DISCARD), which aborts the + current command; if FATAL is 0, return an indication of an invalid + number by setting *NUMOK == 0 and return -1. */ +int +get_numeric_arg (list, fatal, count) + WORD_LIST *list; + int fatal; + intmax_t *count; +{ + char *arg; + + if (count) + *count = 1; + + if (list && list->word && ISOPTION (list->word->word, '-')) + list = list->next; + + if (list) + { + arg = list->word->word; + if (arg == 0 || (legal_number (arg, count) == 0)) + { + sh_neednumarg (list->word->word ? list->word->word : "`'"); + if (fatal == 0) + return 0; + else if (fatal == 1) /* fatal == 1; abort */ + throw_to_top_level (); + else /* fatal == 2; discard current command */ + { + top_level_cleanup (); + jump_to_top_level (DISCARD); + } + } + no_args (list->next); + } + + return (1); +} + +/* Get an eight-bit status value from LIST */ +int +get_exitstat (list) + WORD_LIST *list; +{ + int status; + intmax_t sval; + char *arg; + + if (list && list->word && ISOPTION (list->word->word, '-')) + list = list->next; + + if (list == 0) + return (last_command_exit_value); + + arg = list->word->word; + if (arg == 0 || legal_number (arg, &sval) == 0) + { + sh_neednumarg (list->word->word ? list->word->word : "`'"); + return EX_BADUSAGE; + } + no_args (list->next); + + status = sval & 255; + return status; +} + +/* Return the octal number parsed from STRING, or -1 to indicate + that the string contained a bad number. */ +int +read_octal (string) + char *string; +{ + int result, digits; + + result = digits = 0; + while (*string && ISOCTAL (*string)) + { + digits++; + result = (result * 8) + (*string++ - '0'); + if (result > 0777) + return -1; + } + + if (digits == 0 || *string) + result = -1; + + return (result); +} + +/* **************************************************************** */ +/* */ +/* Manipulating the current working directory */ +/* */ +/* **************************************************************** */ + +/* Return a consed string which is the current working directory. + FOR_WHOM is the name of the caller for error printing. */ +char *the_current_working_directory = (char *)NULL; + +char * +get_working_directory (for_whom) + char *for_whom; +{ + if (no_symbolic_links) + { + FREE (the_current_working_directory); + the_current_working_directory = (char *)NULL; + } + + if (the_current_working_directory == 0) + { +#if defined (GETCWD_BROKEN) + the_current_working_directory = getcwd (0, PATH_MAX); +#else + the_current_working_directory = getcwd (0, 0); +#endif + if (the_current_working_directory == 0) + { + fprintf (stderr, _("%s: error retrieving current directory: %s: %s\n"), + (for_whom && *for_whom) ? for_whom : get_name_for_error (), + _(bash_getcwd_errstr), strerror (errno)); + return (char *)NULL; + } + } + + return (savestring (the_current_working_directory)); +} + +/* Make NAME our internal idea of the current working directory. */ +void +set_working_directory (name) + char *name; +{ + FREE (the_current_working_directory); + the_current_working_directory = savestring (name); +} + +/* **************************************************************** */ +/* */ +/* Job control support functions */ +/* */ +/* **************************************************************** */ + +#if defined (JOB_CONTROL) +int +get_job_by_name (name, flags) + const char *name; + int flags; +{ + register int i, wl, cl, match, job; + register PROCESS *p; + register JOB *j; + + job = NO_JOB; + wl = strlen (name); + for (i = js.j_jobslots - 1; i >= 0; i--) + { + j = get_job_by_jid (i); + if (j == 0 || ((flags & JM_STOPPED) && J_JOBSTATE(j) != JSTOPPED)) + continue; + + p = j->pipe; + do + { + if (flags & JM_EXACT) + { + cl = strlen (p->command); + match = STREQN (p->command, name, cl); + } + else if (flags & JM_SUBSTRING) + match = strcasestr (p->command, name) != (char *)0; + else + match = STREQN (p->command, name, wl); + + if (match == 0) + { + p = p->next; + continue; + } + else if (flags & JM_FIRSTMATCH) + return i; /* return first match */ + else if (job != NO_JOB) + { + if (this_shell_builtin) + builtin_error (_("%s: ambiguous job spec"), name); + else + internal_error (_("%s: ambiguous job spec"), name); + return (DUP_JOB); + } + else + job = i; + } + while (p != j->pipe); + } + + return (job); +} + +/* Return the job spec found in LIST. */ +int +get_job_spec (list) + WORD_LIST *list; +{ + register char *word; + int job, jflags; + + if (list == 0) + return (js.j_current); + + word = list->word->word; + + if (*word == '\0') + return (NO_JOB); + + if (*word == '%') + word++; + + if (DIGIT (*word) && all_digits (word)) + { + job = atoi (word); + return (job > js.j_jobslots ? NO_JOB : job - 1); + } + + jflags = 0; + switch (*word) + { + case 0: + case '%': + case '+': + return (js.j_current); + + case '-': + return (js.j_previous); + + case '?': /* Substring search requested. */ + jflags |= JM_SUBSTRING; + word++; + /* FALLTHROUGH */ + + default: + return get_job_by_name (word, jflags); + } +} +#endif /* JOB_CONTROL */ + +/* + * NOTE: `kill' calls this function with forcecols == 0 + */ +int +display_signal_list (list, forcecols) + WORD_LIST *list; + int forcecols; +{ + register int i, column; + char *name; + int result, signum, dflags; + intmax_t lsignum; + + result = EXECUTION_SUCCESS; + if (!list) + { + for (i = 1, column = 0; i < NSIG; i++) + { + name = signal_name (i); + if (STREQN (name, "SIGJUNK", 7) || STREQN (name, "Unknown", 7)) + continue; + + if (posixly_correct && !forcecols) + { + /* This is for the kill builtin. POSIX.2 says the signal names + are displayed without the `SIG' prefix. */ + if (STREQN (name, "SIG", 3)) + name += 3; + printf ("%s%s", name, (i == NSIG - 1) ? "" : " "); + } + else + { + printf ("%2d) %s", i, name); + + if (++column < 5) + printf ("\t"); + else + { + printf ("\n"); + column = 0; + } + } + } + + if ((posixly_correct && !forcecols) || column != 0) + printf ("\n"); + return result; + } + + /* List individual signal names or numbers. */ + while (list) + { + if (legal_number (list->word->word, &lsignum)) + { + /* This is specified by Posix.2 so that exit statuses can be + mapped into signal numbers. */ + if (lsignum > 128) + lsignum -= 128; + if (lsignum < 0 || lsignum >= NSIG) + { + sh_invalidsig (list->word->word); + result = EXECUTION_FAILURE; + list = list->next; + continue; + } + + signum = lsignum; + name = signal_name (signum); + if (STREQN (name, "SIGJUNK", 7) || STREQN (name, "Unknown", 7)) + { + list = list->next; + continue; + } +#if defined (JOB_CONTROL) + /* POSIX.2 says that `kill -l signum' prints the signal name without + the `SIG' prefix. */ + printf ("%s\n", (this_shell_builtin == kill_builtin) ? name + 3 : name); +#else + printf ("%s\n", name); +#endif + } + else + { + dflags = DSIG_NOCASE; + if (posixly_correct == 0 || this_shell_builtin != kill_builtin) + dflags |= DSIG_SIGPREFIX; + signum = decode_signal (list->word->word, dflags); + if (signum == NO_SIG) + { + sh_invalidsig (list->word->word); + result = EXECUTION_FAILURE; + list = list->next; + continue; + } + printf ("%d\n", signum); + } + list = list->next; + } + return (result); +} + +/* **************************************************************** */ +/* */ +/* Finding builtin commands and their functions */ +/* */ +/* **************************************************************** */ + +/* Perform a binary search and return the address of the builtin function + whose name is NAME. If the function couldn't be found, or the builtin + is disabled or has no function associated with it, return NULL. + Return the address of the builtin. + DISABLED_OKAY means find it even if the builtin is disabled. */ +struct builtin * +builtin_address_internal (name, disabled_okay) + char *name; + int disabled_okay; +{ + int hi, lo, mid, j; + + hi = num_shell_builtins - 1; + lo = 0; + + while (lo <= hi) + { + mid = (lo + hi) / 2; + + j = shell_builtins[mid].name[0] - name[0]; + + if (j == 0) + j = strcmp (shell_builtins[mid].name, name); + + if (j == 0) + { + /* It must have a function pointer. It must be enabled, or we + must have explicitly allowed disabled functions to be found, + and it must not have been deleted. */ + if (shell_builtins[mid].function && + ((shell_builtins[mid].flags & BUILTIN_DELETED) == 0) && + ((shell_builtins[mid].flags & BUILTIN_ENABLED) || disabled_okay)) + return (&shell_builtins[mid]); + else + return ((struct builtin *)NULL); + } + if (j > 0) + hi = mid - 1; + else + lo = mid + 1; + } + return ((struct builtin *)NULL); +} + +/* Return the pointer to the function implementing builtin command NAME. */ +sh_builtin_func_t * +find_shell_builtin (name) + char *name; +{ + current_builtin = builtin_address_internal (name, 0); + return (current_builtin ? current_builtin->function : (sh_builtin_func_t *)NULL); +} + +/* Return the address of builtin with NAME, whether it is enabled or not. */ +sh_builtin_func_t * +builtin_address (name) + char *name; +{ + current_builtin = builtin_address_internal (name, 1); + return (current_builtin ? current_builtin->function : (sh_builtin_func_t *)NULL); +} + +/* Return the function implementing the builtin NAME, but only if it is a + POSIX.2 special builtin. */ +sh_builtin_func_t * +find_special_builtin (name) + char *name; +{ + current_builtin = builtin_address_internal (name, 0); + return ((current_builtin && (current_builtin->flags & SPECIAL_BUILTIN)) ? + current_builtin->function : + (sh_builtin_func_t *)NULL); +} + +static int +shell_builtin_compare (sbp1, sbp2) + struct builtin *sbp1, *sbp2; +{ + int result; + + if ((result = sbp1->name[0] - sbp2->name[0]) == 0) + result = strcmp (sbp1->name, sbp2->name); + + return (result); +} + +/* Sort the table of shell builtins so that the binary search will work + in find_shell_builtin. */ +void +initialize_shell_builtins () +{ + qsort (shell_builtins, num_shell_builtins, sizeof (struct builtin), + (QSFUNC *)shell_builtin_compare); +} diff --git a/builtins/common.h b/builtins/common.h new file mode 100644 index 0000000..cae16b1 --- /dev/null +++ b/builtins/common.h @@ -0,0 +1,180 @@ +/* common.h -- extern declarations for functions defined in common.c. */ + +/* Copyright (C) 1993-2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (__COMMON_H) +# define __COMMON_H + +#include "stdc.h" + +#define ISOPTION(s, c) (s[0] == '-' && !s[2] && s[1] == c) + +/* Flag values for parse_and_execute () */ +#define SEVAL_NONINT 0x001 +#define SEVAL_INTERACT 0x002 +#define SEVAL_NOHIST 0x004 +#define SEVAL_NOFREE 0x008 +#define SEVAL_RESETLINE 0x010 +#define SEVAL_PARSEONLY 0x020 +#define SEVAL_NOLONGJMP 0x040 +#define SEVAL_FUNCDEF 0x080 /* only allow function definitions */ +#define SEVAL_ONECMD 0x100 /* only allow a single command */ + +/* Flags for describe_command, shared between type.def and command.def */ +#define CDESC_ALL 0x001 /* type -a */ +#define CDESC_SHORTDESC 0x002 /* command -V */ +#define CDESC_REUSABLE 0x004 /* command -v */ +#define CDESC_TYPE 0x008 /* type -t */ +#define CDESC_PATH_ONLY 0x010 /* type -p */ +#define CDESC_FORCE_PATH 0x020 /* type -ap or type -P */ +#define CDESC_NOFUNCS 0x040 /* type -f */ +#define CDESC_ABSPATH 0x080 /* convert to absolute path, no ./ */ + +/* Flags for get_job_by_name */ +#define JM_PREFIX 0x01 /* prefix of job name */ +#define JM_SUBSTRING 0x02 /* substring of job name */ +#define JM_EXACT 0x04 /* match job name exactly */ +#define JM_STOPPED 0x08 /* match stopped jobs only */ +#define JM_FIRSTMATCH 0x10 /* return first matching job */ + +/* Flags for remember_args and value of changed_dollar_vars */ +#define ARGS_NONE 0x0 +#define ARGS_INVOC 0x01 +#define ARGS_FUNC 0x02 +#define ARGS_SETBLTIN 0x04 + +/* Functions from common.c */ +extern void builtin_error __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2))); +extern void builtin_warning __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2))); +extern void builtin_usage __P((void)); +extern void no_args __P((WORD_LIST *)); +extern int no_options __P((WORD_LIST *)); + +/* common error message functions */ +extern void sh_needarg __P((char *)); +extern void sh_neednumarg __P((char *)); +extern void sh_notfound __P((char *)); +extern void sh_invalidopt __P((char *)); +extern void sh_invalidoptname __P((char *)); +extern void sh_invalidid __P((char *)); +extern void sh_invalidnum __P((char *)); +extern void sh_invalidsig __P((char *)); +extern void sh_erange __P((char *, char *)); +extern void sh_badpid __P((char *)); +extern void sh_badjob __P((char *)); +extern void sh_readonly __P((const char *)); +extern void sh_nojobs __P((char *)); +extern void sh_restricted __P((char *)); +extern void sh_notbuiltin __P((char *)); +extern void sh_wrerror __P((void)); +extern void sh_ttyerror __P((int)); +extern int sh_chkwrite __P((int)); + +extern char **make_builtin_argv __P((WORD_LIST *, int *)); +extern void remember_args __P((WORD_LIST *, int)); + +extern int dollar_vars_changed __P((void)); +extern void set_dollar_vars_unchanged __P((void)); +extern void set_dollar_vars_changed __P((void)); + +extern int get_numeric_arg __P((WORD_LIST *, int, intmax_t *)); +extern int get_exitstat __P((WORD_LIST *)); +extern int read_octal __P((char *)); + +/* Keeps track of the current working directory. */ +extern char *the_current_working_directory; +extern char *get_working_directory __P((char *)); +extern void set_working_directory __P((char *)); + +#if defined (JOB_CONTROL) +extern int get_job_by_name __P((const char *, int)); +extern int get_job_spec __P((WORD_LIST *)); +#endif +extern int display_signal_list __P((WORD_LIST *, int)); + +/* It's OK to declare a function as returning a Function * without + providing a definition of what a `Function' is. */ +extern struct builtin *builtin_address_internal __P((char *, int)); +extern sh_builtin_func_t *find_shell_builtin __P((char *)); +extern sh_builtin_func_t *builtin_address __P((char *)); +extern sh_builtin_func_t *find_special_builtin __P((char *)); +extern void initialize_shell_builtins __P((void)); + +/* Functions from exit.def */ +extern void bash_logout __P((void)); + +/* Functions from getopts.def */ +extern void getopts_reset __P((int)); + +/* Functions from set.def */ +extern int minus_o_option_value __P((char *)); +extern void list_minus_o_opts __P((int, int)); +extern char **get_minus_o_opts __P((void)); +extern int set_minus_o_option __P((int, char *)); + +extern void set_shellopts __P((void)); +extern void parse_shellopts __P((char *)); +extern void initialize_shell_options __P((int)); + +extern void reset_shell_options __P((void)); + +/* Functions from shopt.def */ +extern void reset_shopt_options __P((void)); +extern char **get_shopt_options __P((void)); + +extern int shopt_setopt __P((char *, int)); +extern int shopt_listopt __P((char *, int)); + +extern int set_login_shell __P((char *, int)); + +extern void set_bashopts __P((void)); +extern void parse_bashopts __P((char *)); +extern void initialize_bashopts __P((int)); + +extern void set_compatibility_opts __P((void)); + +/* Functions from type.def */ +extern int describe_command __P((char *, int)); + +/* Functions from setattr.def */ +extern int set_or_show_attributes __P((WORD_LIST *, int, int)); +extern int show_all_var_attributes __P((int, int)); +extern int show_var_attributes __P((SHELL_VAR *, int, int)); +extern int show_name_attributes __P((char *, int)); +extern int show_func_attributes __P((char *, int)); +extern void set_var_attribute __P((char *, int, int)); + +/* Functions from pushd.def */ +extern char *get_dirstack_from_string __P((char *)); +extern char *get_dirstack_element __P((intmax_t, int)); +extern void set_dirstack_element __P((intmax_t, int, char *)); +extern WORD_LIST *get_directory_stack __P((int)); + +/* Functions from evalstring.c */ +extern int parse_and_execute __P((char *, const char *, int)); +extern int evalstring __P((char *, const char *, int)); +extern void parse_and_execute_cleanup __P((void)); +extern int parse_string __P((char *, const char *, int, char **)); + +/* Functions from evalfile.c */ +extern int maybe_execute_file __P((const char *, int)); +extern int source_file __P((const char *, int)); +extern int fc_execute_file __P((const char *)); + +#endif /* !__COMMON_H */ diff --git a/builtins/complete.def b/builtins/complete.def new file mode 100644 index 0000000..8499b7a --- /dev/null +++ b/builtins/complete.def @@ -0,0 +1,871 @@ +This file is complete.def, from which is created complete.c. +It implements the builtins "complete", "compgen", and "compopt" in Bash. + +Copyright (C) 1999-2011 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES complete.c + +$BUILTIN complete +$DEPENDS_ON PROGRAMMABLE_COMPLETION +$FUNCTION complete_builtin +$SHORT_DOC complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [name ...] +Specify how arguments are to be completed by Readline. + +For each NAME, specify how arguments are to be completed. If no options +are supplied, existing completion specifications are printed in a way that +allows them to be reused as input. + +Options: + -p print existing completion specifications in a reusable format + -r remove a completion specification for each NAME, or, if no + NAMEs are supplied, all completion specifications + -D apply the completions and actions as the default for commands + without any specific completion defined + -E apply the completions and actions to "empty" commands -- + completion attempted on a blank line + +When completion is attempted, the actions are applied in the order the +uppercase-letter options are listed above. The -D option takes +precedence over -E. + +Exit Status: +Returns success unless an invalid option is supplied or an error occurs. +$END + +#include + +#include + +#include "../bashtypes.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "../bashansi.h" +#include "../bashintl.h" + +#include "../shell.h" +#include "../builtins.h" +#include "../pcomplete.h" +#include "../bashline.h" + +#include "common.h" +#include "bashgetopt.h" + +#include + +#define STRDUP(x) ((x) ? savestring (x) : (char *)NULL) + +/* Structure containing all the non-action (binary) options; filled in by + build_actions(). */ +struct _optflags { + int pflag; + int rflag; + int Dflag; + int Eflag; +}; + +static int find_compact __P((char *)); +static int find_compopt __P((char *)); + +static int build_actions __P((WORD_LIST *, struct _optflags *, unsigned long *, unsigned long *)); + +static int remove_cmd_completions __P((WORD_LIST *)); + +static int print_one_completion __P((char *, COMPSPEC *)); +static int print_compitem __P((BUCKET_CONTENTS *)); +static void print_compopts __P((const char *, COMPSPEC *, int)); +static void print_all_completions __P((void)); +static int print_cmd_completions __P((WORD_LIST *)); + +static char *Garg, *Warg, *Parg, *Sarg, *Xarg, *Farg, *Carg; + +static const struct _compacts { + const char * const actname; + int actflag; + int actopt; +} compacts[] = { + { "alias", CA_ALIAS, 'a' }, + { "arrayvar", CA_ARRAYVAR, 0 }, + { "binding", CA_BINDING, 0 }, + { "builtin", CA_BUILTIN, 'b' }, + { "command", CA_COMMAND, 'c' }, + { "directory", CA_DIRECTORY, 'd' }, + { "disabled", CA_DISABLED, 0 }, + { "enabled", CA_ENABLED, 0 }, + { "export", CA_EXPORT, 'e' }, + { "file", CA_FILE, 'f' }, + { "function", CA_FUNCTION, 0 }, + { "helptopic", CA_HELPTOPIC, 0 }, + { "hostname", CA_HOSTNAME, 0 }, + { "group", CA_GROUP, 'g' }, + { "job", CA_JOB, 'j' }, + { "keyword", CA_KEYWORD, 'k' }, + { "running", CA_RUNNING, 0 }, + { "service", CA_SERVICE, 's' }, + { "setopt", CA_SETOPT, 0 }, + { "shopt", CA_SHOPT, 0 }, + { "signal", CA_SIGNAL, 0 }, + { "stopped", CA_STOPPED, 0 }, + { "user", CA_USER, 'u' }, + { "variable", CA_VARIABLE, 'v' }, + { (char *)NULL, 0, 0 }, +}; + +/* This should be a STRING_INT_ALIST */ +static const struct _compopt { + const char * const optname; + int optflag; +} compopts[] = { + { "bashdefault", COPT_BASHDEFAULT }, + { "default", COPT_DEFAULT }, + { "dirnames", COPT_DIRNAMES }, + { "filenames",COPT_FILENAMES}, + { "noquote", COPT_NOQUOTE }, + { "nospace", COPT_NOSPACE }, + { "plusdirs", COPT_PLUSDIRS }, + { (char *)NULL, 0 }, +}; + +static int +find_compact (name) + char *name; +{ + register int i; + + for (i = 0; compacts[i].actname; i++) + if (STREQ (name, compacts[i].actname)) + return i; + return -1; +} + +static int +find_compopt (name) + char *name; +{ + register int i; + + for (i = 0; compopts[i].optname; i++) + if (STREQ (name, compopts[i].optname)) + return i; + return -1; +} + +/* Build the actions and compspec options from the options specified in LIST. + ACTP is a pointer to an unsigned long in which to place the bitmap of + actions. OPTP is a pointer to an unsigned long in which to place the + btmap of compspec options (arguments to `-o'). PP, if non-null, gets 1 + if -p is supplied; RP, if non-null, gets 1 if -r is supplied. + If either is null, the corresponding option generates an error. + This also sets variables corresponding to options that take arguments as + a side effect; the caller should ensure that those variables are set to + NULL before calling build_actions. Return value: + EX_USAGE = bad option + EXECUTION_SUCCESS = some options supplied + EXECUTION_FAILURE = no options supplied +*/ + +static int +build_actions (list, flagp, actp, optp) + WORD_LIST *list; + struct _optflags *flagp; + unsigned long *actp, *optp; +{ + int opt, ind, opt_given; + unsigned long acts, copts; + + acts = copts = (unsigned long)0L; + opt_given = 0; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "abcdefgjko:prsuvA:G:W:P:S:X:F:C:DE")) != -1) + { + opt_given = 1; + switch (opt) + { + case 'r': + if (flagp) + { + flagp->rflag = 1; + break; + } + else + { + sh_invalidopt ("-r"); + builtin_usage (); + return (EX_USAGE); + } + + case 'p': + if (flagp) + { + flagp->pflag = 1; + break; + } + else + { + sh_invalidopt ("-p"); + builtin_usage (); + return (EX_USAGE); + } + + case 'a': + acts |= CA_ALIAS; + break; + case 'b': + acts |= CA_BUILTIN; + break; + case 'c': + acts |= CA_COMMAND; + break; + case 'd': + acts |= CA_DIRECTORY; + break; + case 'e': + acts |= CA_EXPORT; + break; + case 'f': + acts |= CA_FILE; + break; + case 'g': + acts |= CA_GROUP; + break; + case 'j': + acts |= CA_JOB; + break; + case 'k': + acts |= CA_KEYWORD; + break; + case 's': + acts |= CA_SERVICE; + break; + case 'u': + acts |= CA_USER; + break; + case 'v': + acts |= CA_VARIABLE; + break; + case 'o': + ind = find_compopt (list_optarg); + if (ind < 0) + { + sh_invalidoptname (list_optarg); + return (EX_USAGE); + } + copts |= compopts[ind].optflag; + break; + case 'A': + ind = find_compact (list_optarg); + if (ind < 0) + { + builtin_error (_("%s: invalid action name"), list_optarg); + return (EX_USAGE); + } + acts |= compacts[ind].actflag; + break; + case 'C': + Carg = list_optarg; + break; + case 'D': + if (flagp) + { + flagp->Dflag = 1; + break; + } + else + { + sh_invalidopt ("-D"); + builtin_usage (); + return (EX_USAGE); + } + case 'E': + if (flagp) + { + flagp->Eflag = 1; + break; + } + else + { + sh_invalidopt ("-E"); + builtin_usage (); + return (EX_USAGE); + } + case 'F': + Farg = list_optarg; + break; + case 'G': + Garg = list_optarg; + break; + case 'P': + Parg = list_optarg; + break; + case 'S': + Sarg = list_optarg; + break; + case 'W': + Warg = list_optarg; + break; + case 'X': + Xarg = list_optarg; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + + *actp = acts; + *optp = copts; + + return (opt_given ? EXECUTION_SUCCESS : EXECUTION_FAILURE); +} + +/* Add, remove, and display completion specifiers. */ +int +complete_builtin (list) + WORD_LIST *list; +{ + int opt_given, rval; + unsigned long acts, copts; + COMPSPEC *cs; + struct _optflags oflags; + WORD_LIST *l, *wl; + + if (list == 0) + { + print_all_completions (); + return (EXECUTION_SUCCESS); + } + + opt_given = oflags.pflag = oflags.rflag = oflags.Dflag = oflags.Eflag = 0; + + acts = copts = (unsigned long)0L; + Garg = Warg = Parg = Sarg = Xarg = Farg = Carg = (char *)NULL; + cs = (COMPSPEC *)NULL; + + /* Build the actions from the arguments. Also sets the [A-Z]arg variables + as a side effect if they are supplied as options. */ + rval = build_actions (list, &oflags, &acts, &copts); + if (rval == EX_USAGE) + return (rval); + opt_given = rval != EXECUTION_FAILURE; + + list = loptend; + + wl = oflags.Dflag ? make_word_list (make_bare_word (DEFAULTCMD), (WORD_LIST *)NULL) + : (oflags.Eflag ? make_word_list (make_bare_word (EMPTYCMD), (WORD_LIST *)NULL) : 0); + + /* -p overrides everything else */ + if (oflags.pflag || (list == 0 && opt_given == 0)) + { + if (wl) + { + rval = print_cmd_completions (wl); + dispose_words (wl); + return rval; + } + else if (list == 0) + { + print_all_completions (); + return (EXECUTION_SUCCESS); + } + return (print_cmd_completions (list)); + } + + /* next, -r overrides everything else. */ + if (oflags.rflag) + { + if (wl) + { + rval = remove_cmd_completions (wl); + dispose_words (wl); + return rval; + } + else if (list == 0) + { + progcomp_flush (); + return (EXECUTION_SUCCESS); + } + return (remove_cmd_completions (list)); + } + + if (wl == 0 && list == 0 && opt_given) + { + builtin_usage (); + return (EX_USAGE); + } + + /* If we get here, we need to build a compspec and add it for each + remaining argument. */ + cs = compspec_create (); + cs->actions = acts; + cs->options = copts; + + cs->globpat = STRDUP (Garg); + cs->words = STRDUP (Warg); + cs->prefix = STRDUP (Parg); + cs->suffix = STRDUP (Sarg); + cs->funcname = STRDUP (Farg); + cs->command = STRDUP (Carg); + cs->filterpat = STRDUP (Xarg); + + for (rval = EXECUTION_SUCCESS, l = wl ? wl : list ; l; l = l->next) + { + /* Add CS as the compspec for the specified commands. */ + if (progcomp_insert (l->word->word, cs) == 0) + rval = EXECUTION_FAILURE; + } + + dispose_words (wl); + return (rval); +} + +static int +remove_cmd_completions (list) + WORD_LIST *list; +{ + WORD_LIST *l; + int ret; + + for (ret = EXECUTION_SUCCESS, l = list; l; l = l->next) + { + if (progcomp_remove (l->word->word) == 0) + { + builtin_error (_("%s: no completion specification"), l->word->word); + ret = EXECUTION_FAILURE; + } + } + return ret; +} + +#define SQPRINTARG(a, f) \ + do { \ + if (a) \ + { \ + x = sh_single_quote (a); \ + printf ("%s %s ", f, x); \ + free (x); \ + } \ + } while (0) + +#define PRINTARG(a, f) \ + do { \ + if (a) \ + printf ("%s %s ", f, a); \ + } while (0) + +#define PRINTOPT(a, f) \ + do { \ + if (acts & a) \ + printf ("%s ", f); \ + } while (0) + +#define PRINTACT(a, f) \ + do { \ + if (acts & a) \ + printf ("-A %s ", f); \ + } while (0) + +#define PRINTCOMPOPT(a, f) \ + do { \ + if (copts & a) \ + printf ("-o %s ", f); \ + } while (0) + +#define XPRINTCOMPOPT(a, f) \ + do { \ + if (copts & a) \ + printf ("-o %s ", f); \ + else \ + printf ("+o %s ", f); \ + } while (0) + +static int +print_one_completion (cmd, cs) + char *cmd; + COMPSPEC *cs; +{ + unsigned long acts, copts; + char *x; + + printf ("complete "); + + copts = cs->options; + + /* First, print the -o options. */ + PRINTCOMPOPT (COPT_BASHDEFAULT, "bashdefault"); + PRINTCOMPOPT (COPT_DEFAULT, "default"); + PRINTCOMPOPT (COPT_DIRNAMES, "dirnames"); + PRINTCOMPOPT (COPT_FILENAMES, "filenames"); + PRINTCOMPOPT (COPT_NOSPACE, "nospace"); + PRINTCOMPOPT (COPT_PLUSDIRS, "plusdirs"); + + acts = cs->actions; + + /* simple flags next */ + PRINTOPT (CA_ALIAS, "-a"); + PRINTOPT (CA_BUILTIN, "-b"); + PRINTOPT (CA_COMMAND, "-c"); + PRINTOPT (CA_DIRECTORY, "-d"); + PRINTOPT (CA_EXPORT, "-e"); + PRINTOPT (CA_FILE, "-f"); + PRINTOPT (CA_GROUP, "-g"); + PRINTOPT (CA_JOB, "-j"); + PRINTOPT (CA_KEYWORD, "-k"); + PRINTOPT (CA_SERVICE, "-s"); + PRINTOPT (CA_USER, "-u"); + PRINTOPT (CA_VARIABLE, "-v"); + + /* now the rest of the actions */ + PRINTACT (CA_ARRAYVAR, "arrayvar"); + PRINTACT (CA_BINDING, "binding"); + PRINTACT (CA_DISABLED, "disabled"); + PRINTACT (CA_ENABLED, "enabled"); + PRINTACT (CA_FUNCTION, "function"); + PRINTACT (CA_HELPTOPIC, "helptopic"); + PRINTACT (CA_HOSTNAME, "hostname"); + PRINTACT (CA_RUNNING, "running"); + PRINTACT (CA_SETOPT, "setopt"); + PRINTACT (CA_SHOPT, "shopt"); + PRINTACT (CA_SIGNAL, "signal"); + PRINTACT (CA_STOPPED, "stopped"); + + /* now the rest of the arguments */ + + /* arguments that require quoting */ + SQPRINTARG (cs->globpat, "-G"); + SQPRINTARG (cs->words, "-W"); + SQPRINTARG (cs->prefix, "-P"); + SQPRINTARG (cs->suffix, "-S"); + SQPRINTARG (cs->filterpat, "-X"); + + SQPRINTARG (cs->command, "-C"); + + /* simple arguments that don't require quoting */ + PRINTARG (cs->funcname, "-F"); + + if (STREQ (cmd, EMPTYCMD)) + printf ("-E\n"); + else if (STREQ (cmd, DEFAULTCMD)) + printf ("-D\n"); + else + printf ("%s\n", cmd); + + return (0); +} + +static void +print_compopts (cmd, cs, full) + const char *cmd; + COMPSPEC *cs; + int full; +{ + int copts; + + printf ("compopt "); + copts = cs->options; + + if (full) + { + XPRINTCOMPOPT (COPT_BASHDEFAULT, "bashdefault"); + XPRINTCOMPOPT (COPT_DEFAULT, "default"); + XPRINTCOMPOPT (COPT_DIRNAMES, "dirnames"); + XPRINTCOMPOPT (COPT_FILENAMES, "filenames"); + XPRINTCOMPOPT (COPT_NOSPACE, "nospace"); + XPRINTCOMPOPT (COPT_PLUSDIRS, "plusdirs"); + } + else + { + PRINTCOMPOPT (COPT_BASHDEFAULT, "bashdefault"); + PRINTCOMPOPT (COPT_DEFAULT, "default"); + PRINTCOMPOPT (COPT_DIRNAMES, "dirnames"); + PRINTCOMPOPT (COPT_FILENAMES, "filenames"); + PRINTCOMPOPT (COPT_NOSPACE, "nospace"); + PRINTCOMPOPT (COPT_PLUSDIRS, "plusdirs"); + } + + if (STREQ (cmd, EMPTYCMD)) + printf ("-E\n"); + else if (STREQ (cmd, DEFAULTCMD)) + printf ("-D\n"); + else + printf ("%s\n", cmd); +} + +static int +print_compitem (item) + BUCKET_CONTENTS *item; +{ + COMPSPEC *cs; + char *cmd; + + cmd = item->key; + cs = (COMPSPEC *)item->data; + + return (print_one_completion (cmd, cs)); +} + +static void +print_all_completions () +{ + progcomp_walk (print_compitem); +} + +static int +print_cmd_completions (list) + WORD_LIST *list; +{ + WORD_LIST *l; + COMPSPEC *cs; + int ret; + + for (ret = EXECUTION_SUCCESS, l = list; l; l = l->next) + { + cs = progcomp_search (l->word->word); + if (cs) + print_one_completion (l->word->word, cs); + else + { + builtin_error (_("%s: no completion specification"), l->word->word); + ret = EXECUTION_FAILURE; + } + } + + return (sh_chkwrite (ret)); +} + +$BUILTIN compgen +$DEPENDS_ON PROGRAMMABLE_COMPLETION +$FUNCTION compgen_builtin +$SHORT_DOC compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word] +Display possible completions depending on the options. + +Intended to be used from within a shell function generating possible +completions. If the optional WORD argument is supplied, matches against +WORD are generated. + +Exit Status: +Returns success unless an invalid option is supplied or an error occurs. +$END + +int +compgen_builtin (list) + WORD_LIST *list; +{ + int rval; + unsigned long acts, copts; + COMPSPEC *cs; + STRINGLIST *sl; + char *word, **matches; + + if (list == 0) + return (EXECUTION_SUCCESS); + + acts = copts = (unsigned long)0L; + Garg = Warg = Parg = Sarg = Xarg = Farg = Carg = (char *)NULL; + cs = (COMPSPEC *)NULL; + + /* Build the actions from the arguments. Also sets the [A-Z]arg variables + as a side effect if they are supplied as options. */ + rval = build_actions (list, (struct _optflags *)NULL, &acts, &copts); + if (rval == EX_USAGE) + return (rval); + if (rval == EXECUTION_FAILURE) + return (EXECUTION_SUCCESS); + + list = loptend; + + word = (list && list->word) ? list->word->word : ""; + + if (Farg) + builtin_error (_("warning: -F option may not work as you expect")); + if (Carg) + builtin_error (_("warning: -C option may not work as you expect")); + + /* If we get here, we need to build a compspec and evaluate it. */ + cs = compspec_create (); + cs->actions = acts; + cs->options = copts; + cs->refcount = 1; + + cs->globpat = STRDUP (Garg); + cs->words = STRDUP (Warg); + cs->prefix = STRDUP (Parg); + cs->suffix = STRDUP (Sarg); + cs->funcname = STRDUP (Farg); + cs->command = STRDUP (Carg); + cs->filterpat = STRDUP (Xarg); + + rval = EXECUTION_FAILURE; + sl = gen_compspec_completions (cs, "compgen", word, 0, 0, 0); + + /* If the compspec wants the bash default completions, temporarily + turn off programmable completion and call the bash completion code. */ + if ((sl == 0 || sl->list_len == 0) && (copts & COPT_BASHDEFAULT)) + { + matches = bash_default_completion (word, 0, 0, 0, 0); + sl = completions_to_stringlist (matches); + strvec_dispose (matches); + } + + /* This isn't perfect, but it's the best we can do, given what readline + exports from its set of completion utility functions. */ + if ((sl == 0 || sl->list_len == 0) && (copts & COPT_DEFAULT)) + { + matches = rl_completion_matches (word, rl_filename_completion_function); + strlist_dispose (sl); + sl = completions_to_stringlist (matches); + strvec_dispose (matches); + } + + if (sl) + { + if (sl->list && sl->list_len) + { + rval = EXECUTION_SUCCESS; + strlist_print (sl, (char *)NULL); + } + strlist_dispose (sl); + } + + compspec_dispose (cs); + return (rval); +} + +$BUILTIN compopt +$DEPENDS_ON PROGRAMMABLE_COMPLETION +$FUNCTION compopt_builtin +$SHORT_DOC compopt [-o|+o option] [-DE] [name ...] +Modify or display completion options. + +Modify the completion options for each NAME, or, if no NAMEs are supplied, +the completion currently being executed. If no OPTIONs are given, print +the completion options for each NAME or the current completion specification. + +Options: + -o option Set completion option OPTION for each NAME + -D Change options for the "default" command completion + -E Change options for the "empty" command completion + +Using `+o' instead of `-o' turns off the specified option. + +Arguments: + +Each NAME refers to a command for which a completion specification must +have previously been defined using the `complete' builtin. If no NAMEs +are supplied, compopt must be called by a function currently generating +completions, and the options for that currently-executing completion +generator are modified. + +Exit Status: +Returns success unless an invalid option is supplied or NAME does not +have a completion specification defined. +$END + +int +compopt_builtin (list) + WORD_LIST *list; +{ + int opts_on, opts_off, *opts, opt, oind, ret, Dflag, Eflag; + WORD_LIST *l, *wl; + COMPSPEC *cs; + + opts_on = opts_off = Eflag = Dflag = 0; + ret = EXECUTION_SUCCESS; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "+o:DE")) != EOF) + { + opts = (list_opttype == '-') ? &opts_on : &opts_off; + + switch (opt) + { + case 'o': + oind = find_compopt (list_optarg); + if (oind < 0) + { + sh_invalidoptname (list_optarg); + return (EX_USAGE); + } + *opts |= compopts[oind].optflag; + break; + case 'D': + Dflag = 1; + break; + case 'E': + Eflag = 1; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + wl = Dflag ? make_word_list (make_bare_word (DEFAULTCMD), (WORD_LIST *)NULL) + : (Eflag ? make_word_list (make_bare_word (EMPTYCMD), (WORD_LIST *)NULL) : 0); + + if (list == 0 && wl == 0) + { + if (RL_ISSTATE (RL_STATE_COMPLETING) == 0 || pcomp_curcs == 0) + { + builtin_error (_("not currently executing completion function")); + return (EXECUTION_FAILURE); + } + cs = pcomp_curcs; + + if (opts_on == 0 && opts_off == 0) + { + print_compopts (pcomp_curcmd, cs, 1); + return (sh_chkwrite (ret)); + } + + /* Set the compspec options */ + pcomp_set_compspec_options (cs, opts_on, 1); + pcomp_set_compspec_options (cs, opts_off, 0); + + /* And change the readline variables the options control */ + pcomp_set_readline_variables (opts_on, 1); + pcomp_set_readline_variables (opts_off, 0); + + return (ret); + } + + for (l = wl ? wl : list; l; l = l->next) + { + cs = progcomp_search (l->word->word); + if (cs == 0) + { + builtin_error (_("%s: no completion specification"), l->word->word); + ret = EXECUTION_FAILURE; + continue; + } + if (opts_on == 0 && opts_off == 0) + { + print_compopts (l->word->word, cs, 1); + continue; /* XXX -- fill in later */ + } + + /* Set the compspec options */ + pcomp_set_compspec_options (cs, opts_on, 1); + pcomp_set_compspec_options (cs, opts_off, 0); + } + + return (ret); +} diff --git a/builtins/declare.def b/builtins/declare.def new file mode 100644 index 0000000..a634e7c --- /dev/null +++ b/builtins/declare.def @@ -0,0 +1,696 @@ +This file is declare.def, from which is created declare.c. +It implements the builtins "declare" and "local" in Bash. + +Copyright (C) 1987-2012 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES declare.c + +$BUILTIN declare +$FUNCTION declare_builtin +$SHORT_DOC declare [-aAfFgilnrtux] [-p] [name[=value] ...] +Set variable values and attributes. + +Declare variables and give them attributes. If no NAMEs are given, +display the attributes and values of all variables. + +Options: + -f restrict action or display to function names and definitions + -F restrict display to function names only (plus line number and + source file when debugging) + -g create global variables when used in a shell function; otherwise + ignored + -p display the attributes and value of each NAME + +Options which set attributes: + -a to make NAMEs indexed arrays (if supported) + -A to make NAMEs associative arrays (if supported) + -i to make NAMEs have the `integer' attribute + -l to convert NAMEs to lower case on assignment + -n make NAME a reference to the variable named by its value + -r to make NAMEs readonly + -t to make NAMEs have the `trace' attribute + -u to convert NAMEs to upper case on assignment + -x to make NAMEs export + +Using `+' instead of `-' turns off the given attribute. + +Variables with the integer attribute have arithmetic evaluation (see +the `let' command) performed when the variable is assigned a value. + +When used in a function, `declare' makes NAMEs local, as with the `local' +command. The `-g' option suppresses this behavior. + +Exit Status: +Returns success unless an invalid option is supplied or a variable +assignment error occurs. +$END + +$BUILTIN typeset +$FUNCTION declare_builtin +$SHORT_DOC typeset [-aAfFgilrtux] [-p] name[=value] ... +Set variable values and attributes. + +Obsolete. See `help declare'. +$END + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include + +#include "../bashansi.h" +#include "../bashintl.h" + +#include "../shell.h" +#include "common.h" +#include "builtext.h" +#include "bashgetopt.h" + +extern int array_needs_making; +extern int posixly_correct; + +static int declare_internal __P((register WORD_LIST *, int)); + +/* Declare or change variable attributes. */ +int +declare_builtin (list) + register WORD_LIST *list; +{ + return (declare_internal (list, 0)); +} + +$BUILTIN local +$FUNCTION local_builtin +$SHORT_DOC local [option] name[=value] ... +Define local variables. + +Create a local variable called NAME, and give it VALUE. OPTION can +be any option accepted by `declare'. + +Local variables can only be used within a function; they are visible +only to the function where they are defined and its children. + +Exit Status: +Returns success unless an invalid option is supplied, a variable +assignment error occurs, or the shell is not executing a function. +$END +int +local_builtin (list) + register WORD_LIST *list; +{ + if (variable_context) + return (declare_internal (list, 1)); + else + { + builtin_error (_("can only be used in a function")); + return (EXECUTION_FAILURE); + } +} + +#if defined (ARRAY_VARS) +# define DECLARE_OPTS "+acfgilnprtuxAF" +#else +# define DECLARE_OPTS "+cfgilnprtuxF" +#endif + +/* The workhorse function. */ +static int +declare_internal (list, local_var) + register WORD_LIST *list; + int local_var; +{ + int flags_on, flags_off, *flags; + int any_failed, assign_error, pflag, nodefs, opt, mkglobal, onref, offref; + char *t, *subscript_start; + SHELL_VAR *var, *refvar, *v; + FUNCTION_DEF *shell_fn; + + flags_on = flags_off = any_failed = assign_error = pflag = nodefs = mkglobal = 0; + refvar = (SHELL_VAR *)NULL; + reset_internal_getopt (); + while ((opt = internal_getopt (list, DECLARE_OPTS)) != EOF) + { + flags = list_opttype == '+' ? &flags_off : &flags_on; + + switch (opt) + { + case 'a': +#if defined (ARRAY_VARS) + *flags |= att_array; + break; +#else + builtin_usage (); + return (EX_USAGE); +#endif + case 'A': +#if defined (ARRAY_VARS) + *flags |= att_assoc; + break; +#else + builtin_usage (); + return (EX_USAGE); +#endif + case 'p': + if (local_var == 0) + pflag++; + break; + case 'F': + nodefs++; + *flags |= att_function; + break; + case 'f': + *flags |= att_function; + break; + case 'g': + if (flags == &flags_on) + mkglobal = 1; + break; + case 'i': + *flags |= att_integer; + break; + case 'n': + *flags |= att_nameref; + break; + case 'r': + *flags |= att_readonly; + break; + case 't': + *flags |= att_trace; + break; + case 'x': + *flags |= att_exported; + array_needs_making = 1; + break; +#if defined (CASEMOD_ATTRS) +# if defined (CASEMOD_CAPCASE) + case 'c': + *flags |= att_capcase; + if (flags == &flags_on) + flags_off |= att_uppercase|att_lowercase; + break; +# endif + case 'l': + *flags |= att_lowercase; + if (flags == &flags_on) + flags_off |= att_capcase|att_uppercase; + break; + case 'u': + *flags |= att_uppercase; + if (flags == &flags_on) + flags_off |= att_capcase|att_lowercase; + break; +#endif /* CASEMOD_ATTRS */ + default: + builtin_usage (); + return (EX_USAGE); + } + } + + list = loptend; + + /* If there are no more arguments left, then we just want to show + some variables. */ + if (list == 0) /* declare -[aAfFirtx] */ + { + /* Show local variables defined at this context level if this is + the `local' builtin. */ + if (local_var) + { + register SHELL_VAR **vlist; + register int i; + + vlist = all_local_variables (); + + if (vlist) + { + for (i = 0; vlist[i]; i++) + print_assignment (vlist[i]); + + free (vlist); + } + } + else if (pflag && (flags_on == 0 || flags_on == att_function)) + show_all_var_attributes (flags_on == 0, nodefs); + else if (flags_on == 0) + return (set_builtin ((WORD_LIST *)NULL)); + else + set_or_show_attributes ((WORD_LIST *)NULL, flags_on, nodefs); + + return (sh_chkwrite (EXECUTION_SUCCESS)); + } + + if (pflag) /* declare -p [-aAfFirtx] name [name...] */ + { + for (any_failed = 0; list; list = list->next) + { + if (flags_on & att_function) + pflag = show_func_attributes (list->word->word, nodefs); + else + pflag = show_name_attributes (list->word->word, nodefs); + if (pflag) + { + sh_notfound (list->word->word); + any_failed++; + } + } + return (sh_chkwrite (any_failed ? EXECUTION_FAILURE : EXECUTION_SUCCESS)); + } + +#define NEXT_VARIABLE() free (name); list = list->next; continue + + /* There are arguments left, so we are making variables. */ + while (list) /* declare [-aAfFirx] name [name ...] */ + { + char *value, *name; + int offset, aflags; +#if defined (ARRAY_VARS) + int making_array_special, compound_array_assign, simple_array_assign; +#endif + + name = savestring (list->word->word); + offset = assignment (name, 0); + aflags = 0; + + if (offset) /* declare [-aAfFirx] name=value */ + { + name[offset] = '\0'; + value = name + offset + 1; + if (name[offset - 1] == '+') + { + aflags |= ASS_APPEND; + name[offset - 1] = '\0'; + } + } + else + value = ""; + + /* Do some lexical error checking on the LHS and RHS of the assignment + that is specific to nameref variables. */ + if (flags_on & att_nameref) + { +#if defined (ARRAY_VARIABLES) + if (valid_array_reference (name)) + { + builtin_error (_("%s: reference variable cannot be an array"), name); + assign_error++; + NEXT_VARIABLE (); + } + else +#endif + /* disallow self references at global scope */ + if (STREQ (name, value) && variable_context == 0) + { + builtin_error (_("%s: nameref variable self references not allowed"), name); + assign_error++; + NEXT_VARIABLE (); + } + } + +#if defined (ARRAY_VARS) + compound_array_assign = simple_array_assign = 0; + subscript_start = (char *)NULL; + if (t = strchr (name, '[')) /* ] */ + { + /* If offset != 0 we have already validated any array reference */ + if (offset == 0 && valid_array_reference (name) == 0) + { + sh_invalidid (name); + assign_error++; + NEXT_VARIABLE (); + } + subscript_start = t; + *t = '\0'; + making_array_special = 1; + } + else + making_array_special = 0; +#endif + + /* If we're in posix mode or not looking for a shell function (since + shell function names don't have to be valid identifiers when the + shell's not in posix mode), check whether or not the argument is a + valid, well-formed shell identifier. */ + if ((posixly_correct || (flags_on & att_function) == 0) && legal_identifier (name) == 0) + { + sh_invalidid (name); + assign_error++; + NEXT_VARIABLE (); + } + + /* If VARIABLE_CONTEXT has a non-zero value, then we are executing + inside of a function. This means we should make local variables, + not global ones. */ + + /* XXX - this has consequences when we're making a local copy of a + variable that was in the temporary environment. Watch out + for this. */ + refvar = (SHELL_VAR *)NULL; + if (variable_context && mkglobal == 0 && ((flags_on & att_function) == 0)) + { +#if defined (ARRAY_VARS) + if (flags_on & att_assoc) + var = make_local_assoc_variable (name); + else if ((flags_on & att_array) || making_array_special) + var = make_local_array_variable (name, making_array_special); + else +#endif + var = make_local_variable (name); /* sets att_invisible for new vars */ + if (var == 0) + { + any_failed++; + NEXT_VARIABLE (); + } + } + else + var = (SHELL_VAR *)NULL; + + /* If we are declaring a function, then complain about it in some way. + We don't let people make functions by saying `typeset -f foo=bar'. */ + + /* There should be a way, however, to let people look at a particular + function definition by saying `typeset -f foo'. */ + + if (flags_on & att_function) + { + if (offset) /* declare -f [-rix] foo=bar */ + { + builtin_error (_("cannot use `-f' to make functions")); + free (name); + return (EXECUTION_FAILURE); + } + else /* declare -f [-rx] name [name...] */ + { + var = find_function (name); + + if (var) + { + if (readonly_p (var) && (flags_off & att_readonly)) + { + builtin_error (_("%s: readonly function"), name); + any_failed++; + NEXT_VARIABLE (); + } + + /* declare -[Ff] name [name...] */ + if (flags_on == att_function && flags_off == 0) + { +#if defined (DEBUGGER) + if (nodefs && debugging_mode) + { + shell_fn = find_function_def (var->name); + if (shell_fn) + printf ("%s %d %s\n", var->name, shell_fn->line, shell_fn->source_file); + else + printf ("%s\n", var->name); + } + else +#endif /* DEBUGGER */ + { + t = nodefs ? var->name + : named_function_string (name, function_cell (var), FUNC_MULTILINE|FUNC_EXTERNAL); + printf ("%s\n", t); + any_failed = sh_chkwrite (any_failed); + } + } + else /* declare -[fF] -[rx] name [name...] */ + { + VSETATTR (var, flags_on); + VUNSETATTR (var, flags_off); + } + } + else + any_failed++; + NEXT_VARIABLE (); + } + } + else /* declare -[aAirx] name [name...] */ + { + /* Non-null if we just created or fetched a local variable. */ + /* Here's what ksh93 seems to do. If we are modifying an existing + nameref variable, we don't follow the nameref chain past the last + nameref, and we set the nameref variable's value so future + references to that variable will return the value of the variable + we're assigning right now. */ + if (var == 0 && (flags_on & att_nameref)) + { + /* See if we are trying to modify an existing nameref variable */ + var = mkglobal ? find_global_variable_last_nameref (name) : find_variable_last_nameref (name); + if (var && nameref_p (var) == 0) + var = 0; + } + /* However, if we're turning off the nameref attribute on an existing + nameref variable, we first follow the nameref chain to the end, + modify the value of the variable this nameref variable references, + *CHANGING ITS VALUE AS A SIDE EFFECT* then turn off the nameref + flag *LEAVING THE NAMEREF VARIABLE'S VALUE UNCHANGED* */ + else if (var == 0 && (flags_off & att_nameref)) + { + /* See if we are trying to modify an existing nameref variable */ + refvar = mkglobal ? find_global_variable_last_nameref (name) : find_variable_last_nameref (name); + if (refvar && nameref_p (refvar) == 0) + refvar = 0; + if (refvar) + var = mkglobal ? find_global_variable (nameref_cell (refvar)) : find_variable (nameref_cell (refvar)); + } + + if (var == 0) + var = mkglobal ? find_global_variable (name) : find_variable (name); + + if (var == 0) + { +#if defined (ARRAY_VARS) + if (flags_on & att_assoc) + { + var = make_new_assoc_variable (name); + if (offset == 0) + VSETATTR (var, att_invisible); + } + else if ((flags_on & att_array) || making_array_special) + { + var = make_new_array_variable (name); + if (offset == 0) + VSETATTR (var, att_invisible); + } + else +#endif + + if (offset) + var = mkglobal ? bind_global_variable (name, "", 0) : bind_variable (name, "", 0); + else + { + var = mkglobal ? bind_global_variable (name, (char *)NULL, 0) : bind_variable (name, (char *)NULL, 0); + VSETATTR (var, att_invisible); + } + } + /* Can't take an existing array variable and make it a nameref */ + else if ((array_p (var) || assoc_p (var)) && (flags_on & att_nameref)) + { + builtin_error (_("%s: reference variable cannot be an array"), name); + assign_error++; + NEXT_VARIABLE (); + } + else if (flags_on & att_nameref) + { + /* ksh93 compat: turning on nameref attribute turns off -ilu */ + VUNSETATTR (var, att_integer|att_uppercase|att_lowercase|att_capcase); + } + + /* Cannot use declare +r to turn off readonly attribute. */ + if (readonly_p (var) && (flags_off & att_readonly)) + { + sh_readonly (name); + any_failed++; + NEXT_VARIABLE (); + } + + /* Cannot use declare to assign value to readonly or noassign + variable. */ + if ((readonly_p (var) || noassign_p (var)) && offset) + { + if (readonly_p (var)) + sh_readonly (name); + assign_error++; + NEXT_VARIABLE (); + } + +#if defined (ARRAY_VARS) + if ((making_array_special || (flags_on & (att_array|att_assoc)) || array_p (var) || assoc_p (var)) && offset) + { + int vlen; + vlen = STRLEN (value); + + if (value[0] == '(' && value[vlen-1] == ')') + compound_array_assign = 1; + else + simple_array_assign = 1; + } + + /* Cannot use declare +a name or declare +A name to remove an + array variable. */ + if (((flags_off & att_array) && array_p (var)) || ((flags_off & att_assoc) && assoc_p (var))) + { + builtin_error (_("%s: cannot destroy array variables in this way"), name); + any_failed++; + NEXT_VARIABLE (); + } + + if ((flags_on & att_array) && assoc_p (var)) + { + builtin_error (_("%s: cannot convert associative to indexed array"), name); + any_failed++; + NEXT_VARIABLE (); + } + if ((flags_on & att_assoc) && array_p (var)) + { + builtin_error (_("%s: cannot convert indexed to associative array"), name); + any_failed++; + NEXT_VARIABLE (); + } + + /* declare -A name[[n]] makes name an associative array variable. */ + if (flags_on & att_assoc) + { + if (assoc_p (var) == 0) + var = convert_var_to_assoc (var); + } + /* declare -a name[[n]] or declare name[n] makes name an indexed + array variable. */ + else if ((making_array_special || (flags_on & att_array)) && array_p (var) == 0 && assoc_p (var) == 0) + var = convert_var_to_array (var); +#endif /* ARRAY_VARS */ + + /* XXX - we note that we are turning on nameref attribute and defer + setting it until the assignment has been made so we don't do an + inadvertent nameref lookup. Might have to do the same thing for + flags_off&att_nameref. */ + /* XXX - ksh93 makes it an error to set a readonly nameref variable + using a single typeset command. */ + onref = (flags_on & att_nameref); + flags_on &= ~att_nameref; +#if defined (ARRAY_VARS) + if (array_p (var) || assoc_p (var) + || (offset && compound_array_assign) + || simple_array_assign) + onref = 0; /* array variables may not be namerefs */ +#endif + + /* ksh93 seems to do this */ + offref = (flags_off & att_nameref); + flags_off &= ~att_nameref; + + VSETATTR (var, flags_on); + VUNSETATTR (var, flags_off); + +#if defined (ARRAY_VARS) + if (offset && compound_array_assign) + assign_array_var_from_string (var, value, aflags); + else if (simple_array_assign && subscript_start) + { + /* declare [-aA] name[N]=value */ + *subscript_start = '['; /* ] */ + var = assign_array_element (name, value, 0); /* XXX - not aflags */ + *subscript_start = '\0'; + if (var == 0) /* some kind of assignment error */ + { + assign_error++; + flags_on |= onref; + flags_off |= offref; + NEXT_VARIABLE (); + } + } + else if (simple_array_assign) + { + /* let bind_{array,assoc}_variable take care of this. */ + if (assoc_p (var)) + bind_assoc_variable (var, name, savestring ("0"), value, aflags); + else + bind_array_variable (name, 0, value, aflags); + } + else +#endif + /* bind_variable_value duplicates the essential internals of + bind_variable() */ + if (offset) + { + if (onref) + aflags |= ASS_NAMEREF; + v = bind_variable_value (var, value, aflags); + if (v == 0 && onref) + { + sh_invalidid (value); + assign_error++; + /* XXX - unset this variable? or leave it as normal var? */ + delete_var (var->name, mkglobal ? global_variables : shell_variables); + NEXT_VARIABLE (); + } + } + + /* If we found this variable in the temporary environment, as with + `var=value declare -x var', make sure it is treated identically + to `var=value export var'. Do the same for `declare -r' and + `readonly'. Preserve the attributes, except for att_tempvar. */ + /* XXX -- should this create a variable in the global scope, or + modify the local variable flags? ksh93 has it modify the + global scope. + Need to handle case like in set_var_attribute where a temporary + variable is in the same table as the function local vars. */ + if ((flags_on & (att_exported|att_readonly)) && tempvar_p (var)) + { + SHELL_VAR *tv; + char *tvalue; + + tv = find_tempenv_variable (var->name); + if (tv) + { + tvalue = var_isset (var) ? savestring (value_cell (var)) : savestring (""); + tv = bind_variable (var->name, tvalue, 0); + tv->attributes |= var->attributes & ~att_tempvar; + if (tv->context > 0) + VSETATTR (tv, att_propagate); + free (tvalue); + } + VSETATTR (var, att_propagate); + } + } + + /* Turn on nameref attribute we deferred above. */ + /* XXX - should we turn on the noassign attribute for consistency with + ksh93 when we turn on the nameref attribute? */ + VSETATTR (var, onref); + flags_on |= onref; + VUNSETATTR (var, offref); + flags_off |= offref; + /* Yuck. ksh93 compatibility */ + if (refvar) + VUNSETATTR (refvar, flags_off); + + stupidly_hack_special_variables (name); + + NEXT_VARIABLE (); + } + + return (assign_error ? EX_BADASSIGN + : ((any_failed == 0) ? EXECUTION_SUCCESS + : EXECUTION_FAILURE)); +} diff --git a/builtins/echo.def b/builtins/echo.def new file mode 100644 index 0000000..f473826 --- /dev/null +++ b/builtins/echo.def @@ -0,0 +1,200 @@ +This file is echo.def, from which is created echo.c. +It implements the builtin "echo" in Bash. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES echo.c +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "../bashansi.h" + +#include +#include "../shell.h" + +#include "common.h" + +$BUILTIN echo +$FUNCTION echo_builtin +$DEPENDS_ON V9_ECHO +$SHORT_DOC echo [-neE] [arg ...] +Write arguments to the standard output. + +Display the ARGs, separated by a single space character and followed by a +newline, on the standard output. + +Options: + -n do not append a newline + -e enable interpretation of the following backslash escapes + -E explicitly suppress interpretation of backslash escapes + +`echo' interprets the following backslash-escaped characters: + \a alert (bell) + \b backspace + \c suppress further output + \e escape character + \E escape character + \f form feed + \n new line + \r carriage return + \t horizontal tab + \v vertical tab + \\ backslash + \0nnn the character whose ASCII code is NNN (octal). NNN can be + 0 to 3 octal digits + \xHH the eight-bit character whose value is HH (hexadecimal). HH + can be one or two hex digits + +Exit Status: +Returns success unless a write error occurs. +$END + +$BUILTIN echo +$FUNCTION echo_builtin +$DEPENDS_ON !V9_ECHO +$SHORT_DOC echo [-n] [arg ...] +Write arguments to the standard output. + +Display the ARGs on the standard output followed by a newline. + +Options: + -n do not append a newline + +Exit Status: +Returns success unless a write error occurs. +$END + +#if defined (V9_ECHO) +# define VALID_ECHO_OPTIONS "neE" +#else /* !V9_ECHO */ +# define VALID_ECHO_OPTIONS "n" +#endif /* !V9_ECHO */ + +/* System V machines already have a /bin/sh with a v9 behaviour. We + give Bash the identical behaviour for these machines so that the + existing system shells won't barf. Regrettably, the SUS v2 has + standardized the Sys V echo behavior. This variable is external + so that we can have a `shopt' variable to control it at runtime. */ +#if defined (DEFAULT_ECHO_TO_XPG) || defined (STRICT_POSIX) +int xpg_echo = 1; +#else +int xpg_echo = 0; +#endif /* DEFAULT_ECHO_TO_XPG */ + +extern int posixly_correct; + +/* Print the words in LIST to standard output. If the first word is + `-n', then don't print a trailing newline. We also support the + echo syntax from Version 9 Unix systems. */ +int +echo_builtin (list) + WORD_LIST *list; +{ + int display_return, do_v9, i, len; + char *temp, *s; + + do_v9 = xpg_echo; + display_return = 1; + + if (posixly_correct && xpg_echo) + goto just_echo; + + for (; list && (temp = list->word->word) && *temp == '-'; list = list->next) + { + /* If it appears that we are handling options, then make sure that + all of the options specified are actually valid. Otherwise, the + string should just be echoed. */ + temp++; + + for (i = 0; temp[i]; i++) + { + if (strchr (VALID_ECHO_OPTIONS, temp[i]) == 0) + break; + } + + /* echo - and echo - both mean to just echo the arguments. */ + if (*temp == 0 || temp[i]) + break; + + /* All of the options in TEMP are valid options to ECHO. + Handle them. */ + while (i = *temp++) + { + switch (i) + { + case 'n': + display_return = 0; + break; +#if defined (V9_ECHO) + case 'e': + do_v9 = 1; + break; + case 'E': + do_v9 = 0; + break; +#endif /* V9_ECHO */ + default: + goto just_echo; /* XXX */ + } + } + } + +just_echo: + + clearerr (stdout); /* clear error before writing and testing success */ + + terminate_immediately++; + while (list) + { + i = len = 0; + temp = do_v9 ? ansicstr (list->word->word, STRLEN (list->word->word), 1, &i, &len) + : list->word->word; + if (temp) + { + if (do_v9) + { + for (s = temp; len > 0; len--) + putchar (*s++); + } + else + printf ("%s", temp); +#if defined (SunOS5) + fflush (stdout); /* Fix for bug in SunOS 5.5 printf(3) */ +#endif + } + if (do_v9 && temp) + free (temp); + list = list->next; + if (i) + { + display_return = 0; + break; + } + if (list) + putchar(' '); + } + + if (display_return) + putchar ('\n'); + + terminate_immediately--; + return (sh_chkwrite (EXECUTION_SUCCESS)); +} diff --git a/builtins/enable.def b/builtins/enable.def new file mode 100644 index 0000000..40cbb44 --- /dev/null +++ b/builtins/enable.def @@ -0,0 +1,483 @@ +This file is enable.def, from which is created enable.c. +It implements the builtin "enable" in Bash. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES enable.c + +$BUILTIN enable +$FUNCTION enable_builtin +$SHORT_DOC enable [-a] [-dnps] [-f filename] [name ...] +Enable and disable shell builtins. + +Enables and disables builtin shell commands. Disabling allows you to +execute a disk command which has the same name as a shell builtin +without using a full pathname. + +Options: + -a print a list of builtins showing whether or not each is enabled + -n disable each NAME or display a list of disabled builtins + -p print the list of builtins in a reusable format + -s print only the names of Posix `special' builtins + +Options controlling dynamic loading: + -f Load builtin NAME from shared object FILENAME + -d Remove a builtin loaded with -f + +Without options, each NAME is enabled. + +To use the `test' found in $PATH instead of the shell builtin +version, type `enable -n test'. + +Exit Status: +Returns success unless NAME is not a shell builtin or an error occurs. +$END + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include +#include "../bashansi.h" +#include "../bashintl.h" + +#include "../shell.h" +#include "../builtins.h" +#include "../flags.h" +#include "common.h" +#include "bashgetopt.h" + +#if defined (PROGRAMMABLE_COMPLETION) +# include "../pcomplete.h" +#endif + +#define ENABLED 1 +#define DISABLED 2 +#define SPECIAL 4 + +#define AFLAG 0x01 +#define DFLAG 0x02 +#define FFLAG 0x04 +#define NFLAG 0x08 +#define PFLAG 0x10 +#define SFLAG 0x20 + +#if defined (HAVE_DLOPEN) && defined (HAVE_DLSYM) +static int dyn_load_builtin __P((WORD_LIST *, int, char *)); +#endif + +#if defined (HAVE_DLCLOSE) +static int dyn_unload_builtin __P((char *)); +static void delete_builtin __P((struct builtin *)); +static int local_dlclose __P((void *)); +#endif + +static void list_some_builtins __P((int)); +static int enable_shell_command __P((char *, int)); + +/* Enable/disable shell commands present in LIST. If list is not specified, + then print out a list of shell commands showing which are enabled and + which are disabled. */ +int +enable_builtin (list) + WORD_LIST *list; +{ + int result, flags; + int opt, filter; +#if defined (HAVE_DLOPEN) && defined (HAVE_DLSYM) + char *filename; +#endif + + result = EXECUTION_SUCCESS; + flags = 0; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "adnpsf:")) != -1) + { + switch (opt) + { + case 'a': + flags |= AFLAG; + break; + case 'n': + flags |= NFLAG; + break; + case 'p': + flags |= PFLAG; + break; + case 's': + flags |= SFLAG; + break; + case 'f': +#if defined (HAVE_DLOPEN) && defined (HAVE_DLSYM) + flags |= FFLAG; + filename = list_optarg; + break; +#else + builtin_error (_("dynamic loading not available")); + return (EX_USAGE); +#endif +#if defined (HAVE_DLCLOSE) + case 'd': + flags |= DFLAG; + break; +#else + builtin_error (_("dynamic loading not available")); + return (EX_USAGE); +#endif /* HAVE_DLCLOSE */ + default: + builtin_usage (); + return (EX_USAGE); + } + } + + list = loptend; + +#if defined (RESTRICTED_SHELL) + /* Restricted shells cannot load new builtins. */ + if (restricted && (flags & (FFLAG|DFLAG))) + { + sh_restricted ((char *)NULL); + return (EXECUTION_FAILURE); + } +#endif + + if (list == 0 || (flags & PFLAG)) + { + filter = (flags & AFLAG) ? (ENABLED | DISABLED) + : (flags & NFLAG) ? DISABLED : ENABLED; + + if (flags & SFLAG) + filter |= SPECIAL; + + list_some_builtins (filter); + } +#if defined (HAVE_DLOPEN) && defined (HAVE_DLSYM) + else if (flags & FFLAG) + { + filter = (flags & NFLAG) ? DISABLED : ENABLED; + if (flags & SFLAG) + filter |= SPECIAL; + + result = dyn_load_builtin (list, filter, filename); +#if defined (PROGRAMMABLE_COMPLETION) + set_itemlist_dirty (&it_builtins); +#endif + } +#endif +#if defined (HAVE_DLCLOSE) + else if (flags & DFLAG) + { + while (list) + { + opt = dyn_unload_builtin (list->word->word); + if (opt == EXECUTION_FAILURE) + result = EXECUTION_FAILURE; + list = list->next; + } +#if defined (PROGRAMMABLE_COMPLETION) + set_itemlist_dirty (&it_builtins); +#endif + } +#endif + else + { + while (list) + { + opt = enable_shell_command (list->word->word, flags & NFLAG); + + if (opt == EXECUTION_FAILURE) + { + sh_notbuiltin (list->word->word); + result = EXECUTION_FAILURE; + } + list = list->next; + } + } + return (result); +} + +/* List some builtins. + FILTER is a mask with two slots: ENABLED and DISABLED. */ +static void +list_some_builtins (filter) + int filter; +{ + register int i; + + for (i = 0; i < num_shell_builtins; i++) + { + if (shell_builtins[i].function == 0 || (shell_builtins[i].flags & BUILTIN_DELETED)) + continue; + + if ((filter & SPECIAL) && + (shell_builtins[i].flags & SPECIAL_BUILTIN) == 0) + continue; + + if ((filter & ENABLED) && (shell_builtins[i].flags & BUILTIN_ENABLED)) + printf ("enable %s\n", shell_builtins[i].name); + else if ((filter & DISABLED) && + ((shell_builtins[i].flags & BUILTIN_ENABLED) == 0)) + printf ("enable -n %s\n", shell_builtins[i].name); + } +} + +/* Enable the shell command NAME. If DISABLE_P is non-zero, then + disable NAME instead. */ +static int +enable_shell_command (name, disable_p) + char *name; + int disable_p; +{ + struct builtin *b; + + b = builtin_address_internal (name, 1); + if (b == 0) + return (EXECUTION_FAILURE); + + if (disable_p) + b->flags &= ~BUILTIN_ENABLED; +#if defined (RESTRICTED_SHELL) + else if (restricted && ((b->flags & BUILTIN_ENABLED) == 0)) + { + sh_restricted ((char *)NULL); + return (EXECUTION_FAILURE); + } +#endif + else + b->flags |= BUILTIN_ENABLED; + +#if defined (PROGRAMMABLE_COMPLETION) + set_itemlist_dirty (&it_enabled); + set_itemlist_dirty (&it_disabled); +#endif + + return (EXECUTION_SUCCESS); +} + +#if defined (HAVE_DLOPEN) && defined (HAVE_DLSYM) + +#if defined (HAVE_DLFCN_H) +# include +#endif + +static int +dyn_load_builtin (list, flags, filename) + WORD_LIST *list; + int flags; + char *filename; +{ + WORD_LIST *l; + void *handle; + + int total, size, new, replaced; + char *struct_name, *name; + struct builtin **new_builtins, *b, *new_shell_builtins, *old_builtin; + + if (list == 0) + return (EXECUTION_FAILURE); + +#ifndef RTLD_LAZY +#define RTLD_LAZY 1 +#endif + +#if defined (_AIX) + handle = dlopen (filename, RTLD_NOW|RTLD_GLOBAL); +#else + handle = dlopen (filename, RTLD_LAZY); +#endif /* !_AIX */ + + if (handle == 0) + { + builtin_error (_("cannot open shared object %s: %s"), filename, dlerror ()); + return (EXECUTION_FAILURE); + } + + for (new = 0, l = list; l; l = l->next, new++) + ; + new_builtins = (struct builtin **)xmalloc (new * sizeof (struct builtin *)); + + /* For each new builtin in the shared object, find it and its describing + structure. If this is overwriting an existing builtin, do so, otherwise + save the loaded struct for creating the new list of builtins. */ + for (replaced = new = 0; list; list = list->next) + { + name = list->word->word; + + size = strlen (name); + struct_name = (char *)xmalloc (size + 8); + strcpy (struct_name, name); + strcpy (struct_name + size, "_struct"); + + b = (struct builtin *)dlsym (handle, struct_name); + if (b == 0) + { + builtin_error (_("cannot find %s in shared object %s: %s"), + struct_name, filename, dlerror ()); + free (struct_name); + continue; + } + + free (struct_name); + + b->flags &= ~STATIC_BUILTIN; + if (flags & SPECIAL) + b->flags |= SPECIAL_BUILTIN; + b->handle = handle; + + if (old_builtin = builtin_address_internal (name, 1)) + { + replaced++; + FASTCOPY ((char *)b, (char *)old_builtin, sizeof (struct builtin)); + } + else + new_builtins[new++] = b; + } + + if (replaced == 0 && new == 0) + { + free (new_builtins); + dlclose (handle); + return (EXECUTION_FAILURE); + } + + if (new) + { + total = num_shell_builtins + new; + size = (total + 1) * sizeof (struct builtin); + + new_shell_builtins = (struct builtin *)xmalloc (size); + FASTCOPY ((char *)shell_builtins, (char *)new_shell_builtins, + num_shell_builtins * sizeof (struct builtin)); + for (replaced = 0; replaced < new; replaced++) + FASTCOPY ((char *)new_builtins[replaced], + (char *)&new_shell_builtins[num_shell_builtins + replaced], + sizeof (struct builtin)); + + new_shell_builtins[total].name = (char *)0; + new_shell_builtins[total].function = (sh_builtin_func_t *)0; + new_shell_builtins[total].flags = 0; + + if (shell_builtins != static_shell_builtins) + free (shell_builtins); + + shell_builtins = new_shell_builtins; + num_shell_builtins = total; + initialize_shell_builtins (); + } + + free (new_builtins); + return (EXECUTION_SUCCESS); +} +#endif + +#if defined (HAVE_DLCLOSE) +static void +delete_builtin (b) + struct builtin *b; +{ + int ind, size; + struct builtin *new_shell_builtins; + + /* XXX - funky pointer arithmetic - XXX */ +#ifdef __STDC__ + ind = b - shell_builtins; +#else + ind = ((int)b - (int)shell_builtins) / sizeof (struct builtin); +#endif + size = num_shell_builtins * sizeof (struct builtin); + new_shell_builtins = (struct builtin *)xmalloc (size); + + /* Copy shell_builtins[0]...shell_builtins[ind - 1] to new_shell_builtins */ + if (ind) + FASTCOPY ((char *)shell_builtins, (char *)new_shell_builtins, + ind * sizeof (struct builtin)); + /* Copy shell_builtins[ind+1]...shell_builtins[num_shell_builtins to + new_shell_builtins, starting at ind. */ + FASTCOPY ((char *)(&shell_builtins[ind+1]), + (char *)(&new_shell_builtins[ind]), + (num_shell_builtins - ind) * sizeof (struct builtin)); + + if (shell_builtins != static_shell_builtins) + free (shell_builtins); + + /* The result is still sorted. */ + num_shell_builtins--; + shell_builtins = new_shell_builtins; +} + +/* Tenon's MachTen has a dlclose that doesn't return a value, so we + finesse it with a local wrapper. */ +static int +local_dlclose (handle) + void *handle; +{ +#if !defined (__MACHTEN__) + return (dlclose (handle)); +#else /* __MACHTEN__ */ + dlclose (handle); + return ((dlerror () != NULL) ? -1 : 0); +#endif /* __MACHTEN__ */ +} + +static int +dyn_unload_builtin (name) + char *name; +{ + struct builtin *b; + void *handle; + int ref, i; + + b = builtin_address_internal (name, 1); + if (b == 0) + { + sh_notbuiltin (name); + return (EXECUTION_FAILURE); + } + if (b->flags & STATIC_BUILTIN) + { + builtin_error (_("%s: not dynamically loaded"), name); + return (EXECUTION_FAILURE); + } + + handle = (void *)b->handle; + for (ref = i = 0; i < num_shell_builtins; i++) + { + if (shell_builtins[i].handle == b->handle) + ref++; + } + + /* Don't remove the shared object unless the reference count of builtins + using it drops to zero. */ + if (ref == 1 && local_dlclose (handle) != 0) + { + builtin_error (_("%s: cannot delete: %s"), name, dlerror ()); + return (EXECUTION_FAILURE); + } + + /* Now remove this entry from the builtin table and reinitialize. */ + delete_builtin (b); + + return (EXECUTION_SUCCESS); +} +#endif diff --git a/builtins/eval.def b/builtins/eval.def new file mode 100644 index 0000000..5e824c9 --- /dev/null +++ b/builtins/eval.def @@ -0,0 +1,57 @@ +This file is eval.def, from which is created eval.c. +It implements the builtin "eval" in Bash. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES eval.c + +$BUILTIN eval +$FUNCTION eval_builtin +$SHORT_DOC eval [arg ...] +Execute arguments as a shell command. + +Combine ARGs into a single string, use the result as input to the shell, +and execute the resulting commands. + +Exit Status: +Returns exit status of command or success if command is null. +$END + +#include +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "../shell.h" +#include "bashgetopt.h" +#include "common.h" + +/* Parse the string that these words make, and execute the command found. */ +int +eval_builtin (list) + WORD_LIST *list; +{ + if (no_options (list)) + return (EX_USAGE); + list = loptend; /* skip over possible `--' */ + + return (list ? evalstring (string_list (list), "eval", SEVAL_NOHIST) : EXECUTION_SUCCESS); +} diff --git a/builtins/evalfile.c b/builtins/evalfile.c new file mode 100644 index 0000000..058d99d --- /dev/null +++ b/builtins/evalfile.c @@ -0,0 +1,356 @@ +/* evalfile.c - read and evaluate commands from a file or file descriptor */ + +/* Copyright (C) 1996-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "../bashtypes.h" +#include "posixstat.h" +#include "filecntl.h" + +#include +#include +#include + +#include "../bashansi.h" +#include "../bashintl.h" + +#include "../shell.h" +#include "../jobs.h" +#include "../builtins.h" +#include "../flags.h" +#include "../input.h" +#include "../execute_cmd.h" +#include "../trap.h" + +#if defined (HISTORY) +# include "../bashhist.h" +#endif + +#include + +#include "common.h" + +#if !defined (errno) +extern int errno; +#endif + +/* Flags for _evalfile() */ +#define FEVAL_ENOENTOK 0x001 +#define FEVAL_BUILTIN 0x002 +#define FEVAL_UNWINDPROT 0x004 +#define FEVAL_NONINT 0x008 +#define FEVAL_LONGJMP 0x010 +#define FEVAL_HISTORY 0x020 +#define FEVAL_CHECKBINARY 0x040 +#define FEVAL_REGFILE 0x080 +#define FEVAL_NOPUSHARGS 0x100 + +extern int posixly_correct; +extern int indirection_level, subshell_environment; +extern int return_catch_flag, return_catch_value; +extern int last_command_exit_value; +extern int executing_command_builtin; + +/* How many `levels' of sourced files we have. */ +int sourcelevel = 0; + +static int +_evalfile (filename, flags) + const char *filename; + int flags; +{ + volatile int old_interactive; + procenv_t old_return_catch; + int return_val, fd, result, pflags, i, nnull; + ssize_t nr; /* return value from read(2) */ + char *string; + struct stat finfo; + size_t file_size; + sh_vmsg_func_t *errfunc; +#if defined (ARRAY_VARS) + SHELL_VAR *funcname_v, *nfv, *bash_source_v, *bash_lineno_v; + ARRAY *funcname_a, *bash_source_a, *bash_lineno_a; +# if defined (DEBUGGER) + SHELL_VAR *bash_argv_v, *bash_argc_v; + ARRAY *bash_argv_a, *bash_argc_a; +# endif + char *t, tt[2]; +#endif + + USE_VAR(pflags); + +#if defined (ARRAY_VARS) + GET_ARRAY_FROM_VAR ("FUNCNAME", funcname_v, funcname_a); + GET_ARRAY_FROM_VAR ("BASH_SOURCE", bash_source_v, bash_source_a); + GET_ARRAY_FROM_VAR ("BASH_LINENO", bash_lineno_v, bash_lineno_a); +# if defined (DEBUGGER) + GET_ARRAY_FROM_VAR ("BASH_ARGV", bash_argv_v, bash_argv_a); + GET_ARRAY_FROM_VAR ("BASH_ARGC", bash_argc_v, bash_argc_a); +# endif +#endif + + fd = open (filename, O_RDONLY); + + if (fd < 0 || (fstat (fd, &finfo) == -1)) + { + i = errno; + if (fd >= 0) + close (fd); + errno = i; + +file_error_and_exit: + if (((flags & FEVAL_ENOENTOK) == 0) || errno != ENOENT) + file_error (filename); + + if (flags & FEVAL_LONGJMP) + { + last_command_exit_value = 1; + jump_to_top_level (EXITPROG); + } + + return ((flags & FEVAL_BUILTIN) ? EXECUTION_FAILURE + : ((errno == ENOENT) ? 0 : -1)); + } + + errfunc = ((flags & FEVAL_BUILTIN) ? builtin_error : internal_error); + + if (S_ISDIR (finfo.st_mode)) + { + (*errfunc) (_("%s: is a directory"), filename); + close (fd); + return ((flags & FEVAL_BUILTIN) ? EXECUTION_FAILURE : -1); + } + else if ((flags & FEVAL_REGFILE) && S_ISREG (finfo.st_mode) == 0) + { + (*errfunc) (_("%s: not a regular file"), filename); + close (fd); + return ((flags & FEVAL_BUILTIN) ? EXECUTION_FAILURE : -1); + } + + file_size = (size_t)finfo.st_size; + /* Check for overflow with large files. */ + if (file_size != finfo.st_size || file_size + 1 < file_size) + { + (*errfunc) (_("%s: file is too large"), filename); + close (fd); + return ((flags & FEVAL_BUILTIN) ? EXECUTION_FAILURE : -1); + } + + if (S_ISREG (finfo.st_mode) && file_size <= SSIZE_MAX) + { + string = (char *)xmalloc (1 + file_size); + nr = read (fd, string, file_size); + if (nr >= 0) + string[nr] = '\0'; + } + else + nr = zmapfd (fd, &string, 0); + + return_val = errno; + close (fd); + errno = return_val; + + if (nr < 0) /* XXX was != file_size, not < 0 */ + { + free (string); + goto file_error_and_exit; + } + + if (nr == 0) + { + free (string); + return ((flags & FEVAL_BUILTIN) ? EXECUTION_SUCCESS : 1); + } + + if ((flags & FEVAL_CHECKBINARY) && + check_binary_file (string, (nr > 80) ? 80 : nr)) + { + free (string); + (*errfunc) (_("%s: cannot execute binary file"), filename); + return ((flags & FEVAL_BUILTIN) ? EX_BINARY_FILE : -1); + } + + i = strlen (string); + if (i < nr) + { + for (nnull = i = 0; i < nr; i++) + if (string[i] == '\0') + { + memmove (string+i, string+i+1, nr - i); + nr--; + /* Even if the `check binary' flag is not set, we want to avoid + sourcing files with more than 256 null characters -- that + probably indicates a binary file. */ + if ((flags & FEVAL_BUILTIN) && ++nnull > 256) + { + free (string); + (*errfunc) (_("%s: cannot execute binary file"), filename); + return ((flags & FEVAL_BUILTIN) ? EX_BINARY_FILE : -1); + } + } + } + + if (flags & FEVAL_UNWINDPROT) + { + begin_unwind_frame ("_evalfile"); + + unwind_protect_int (return_catch_flag); + unwind_protect_jmp_buf (return_catch); + if (flags & FEVAL_NONINT) + unwind_protect_int (interactive); + unwind_protect_int (sourcelevel); + } + else + { + COPY_PROCENV (return_catch, old_return_catch); + if (flags & FEVAL_NONINT) + old_interactive = interactive; + } + + if (flags & FEVAL_NONINT) + interactive = 0; + + return_catch_flag++; + sourcelevel++; + +#if defined (ARRAY_VARS) + array_push (bash_source_a, (char *)filename); + t = itos (executing_line_number ()); + array_push (bash_lineno_a, t); + free (t); + array_push (funcname_a, "source"); /* not exactly right */ +# if defined (DEBUGGER) + /* Have to figure out a better way to do this when `source' is supplied + arguments */ + if ((flags & FEVAL_NOPUSHARGS) == 0) + { + array_push (bash_argv_a, (char *)filename); + tt[0] = '1'; tt[1] = '\0'; + array_push (bash_argc_a, tt); + } +# endif +#endif + + /* set the flags to be passed to parse_and_execute */ + pflags = SEVAL_RESETLINE; + pflags |= (flags & FEVAL_HISTORY) ? 0 : SEVAL_NOHIST; + + if (flags & FEVAL_BUILTIN) + result = EXECUTION_SUCCESS; + + return_val = setjmp_nosigs (return_catch); + + /* If `return' was seen outside of a function, but in the script, then + force parse_and_execute () to clean up. */ + if (return_val) + { + parse_and_execute_cleanup (); + result = return_catch_value; + } + else + result = parse_and_execute (string, filename, pflags); + + if (flags & FEVAL_UNWINDPROT) + run_unwind_frame ("_evalfile"); + else + { + if (flags & FEVAL_NONINT) + interactive = old_interactive; + return_catch_flag--; + sourcelevel--; + COPY_PROCENV (old_return_catch, return_catch); + } + +#if defined (ARRAY_VARS) + /* These two variables cannot be unset, and cannot be affected by the + sourced file. */ + array_pop (bash_source_a); + array_pop (bash_lineno_a); + + /* FUNCNAME can be unset, and so can potentially be changed by the + sourced file. */ + GET_ARRAY_FROM_VAR ("FUNCNAME", nfv, funcname_a); + if (nfv == funcname_v) + array_pop (funcname_a); +# if defined (DEBUGGER) + if ((flags & FEVAL_NOPUSHARGS) == 0) + { + array_pop (bash_argc_a); + array_pop (bash_argv_a); + } +# endif +#endif + + return ((flags & FEVAL_BUILTIN) ? result : 1); +} + +int +maybe_execute_file (fname, force_noninteractive) + const char *fname; + int force_noninteractive; +{ + char *filename; + int result, flags; + + filename = bash_tilde_expand (fname, 0); + flags = FEVAL_ENOENTOK; + if (force_noninteractive) + flags |= FEVAL_NONINT; + result = _evalfile (filename, flags); + free (filename); + return result; +} + +#if defined (HISTORY) +int +fc_execute_file (filename) + const char *filename; +{ + int flags; + + /* We want these commands to show up in the history list if + remember_on_history is set. */ + flags = FEVAL_ENOENTOK|FEVAL_HISTORY|FEVAL_REGFILE; + return (_evalfile (filename, flags)); +} +#endif /* HISTORY */ + +int +source_file (filename, sflags) + const char *filename; + int sflags; +{ + int flags, rval; + + flags = FEVAL_BUILTIN|FEVAL_UNWINDPROT|FEVAL_NONINT; + if (sflags) + flags |= FEVAL_NOPUSHARGS; + /* POSIX shells exit if non-interactive and file error. */ + if (posixly_correct && interactive_shell == 0 && executing_command_builtin == 0) + flags |= FEVAL_LONGJMP; + rval = _evalfile (filename, flags); + + run_return_trap (); + return rval; +} diff --git a/builtins/evalstring.c b/builtins/evalstring.c new file mode 100644 index 0000000..21937ba --- /dev/null +++ b/builtins/evalstring.c @@ -0,0 +1,626 @@ +/* evalstring.c - evaluate a string as one or more shell commands. */ + +/* Copyright (C) 1996-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include +#include + +#include + +#include "filecntl.h" +#include "../bashansi.h" + +#include "../shell.h" +#include "../jobs.h" +#include "../builtins.h" +#include "../flags.h" +#include "../input.h" +#include "../execute_cmd.h" +#include "../redir.h" +#include "../trap.h" +#include "../bashintl.h" + +#include + +#if defined (HISTORY) +# include "../bashhist.h" +#endif + +#include "common.h" +#include "builtext.h" + +#if !defined (errno) +extern int errno; +#endif + +#define IS_BUILTIN(s) (builtin_address_internal(s, 0) != (struct builtin *)NULL) + +extern int indirection_level, subshell_environment; +extern int line_number, line_number_for_err_trap; +extern int current_token, shell_eof_token; +extern int last_command_exit_value; +extern int running_trap; +extern int loop_level; +extern int executing_list; +extern int comsub_ignore_return; +extern int posixly_correct; +extern int return_catch_flag, return_catch_value; +extern sh_builtin_func_t *this_shell_builtin; +extern char *the_printed_command_except_trap; + +int parse_and_execute_level = 0; + +static int cat_file __P((REDIRECT *)); + +#define PE_TAG "parse_and_execute top" +#define PS_TAG "parse_string top" + +#if defined (HISTORY) +static void +set_history_remembering () +{ + remember_on_history = enable_history_list; +} +#endif + +static void +restore_lastcom (x) + char *x; +{ + FREE (the_printed_command_except_trap); + the_printed_command_except_trap = x; +} + +/* How to force parse_and_execute () to clean up after itself. */ +void +parse_and_execute_cleanup () +{ + if (running_trap) + { + run_trap_cleanup (running_trap - 1); + unfreeze_jobs_list (); + } + + if (have_unwind_protects ()) + run_unwind_frame (PE_TAG); + else + parse_and_execute_level = 0; /* XXX */ +} + +static void +parse_prologue (string, flags, tag) + char *string; + int flags; + char *tag; +{ + char *orig_string, *lastcom; + int x; + + orig_string = string; + /* Unwind protect this invocation of parse_and_execute (). */ + begin_unwind_frame (tag); + unwind_protect_int (parse_and_execute_level); + unwind_protect_jmp_buf (top_level); + unwind_protect_int (indirection_level); + unwind_protect_int (line_number); + unwind_protect_int (line_number_for_err_trap); + unwind_protect_int (loop_level); + unwind_protect_int (executing_list); + unwind_protect_int (comsub_ignore_return); + if (flags & (SEVAL_NONINT|SEVAL_INTERACT)) + unwind_protect_int (interactive); + +#if defined (HISTORY) + if (parse_and_execute_level == 0) + add_unwind_protect (set_history_remembering, (char *)NULL); + else + unwind_protect_int (remember_on_history); /* can be used in scripts */ +# if defined (BANG_HISTORY) + if (interactive_shell) + unwind_protect_int (history_expansion_inhibited); +# endif /* BANG_HISTORY */ +#endif /* HISTORY */ + + if (interactive_shell) + { + x = get_current_prompt_level (); + add_unwind_protect (set_current_prompt_level, x); + } + + if (the_printed_command_except_trap) + { + lastcom = savestring (the_printed_command_except_trap); + add_unwind_protect (restore_lastcom, lastcom); + } + + add_unwind_protect (pop_stream, (char *)NULL); + if (parser_expanding_alias ()) + add_unwind_protect (parser_restore_alias, (char *)NULL); + + if (orig_string && ((flags & SEVAL_NOFREE) == 0)) + add_unwind_protect (xfree, orig_string); + end_unwind_frame (); + + if (flags & (SEVAL_NONINT|SEVAL_INTERACT)) + interactive = (flags & SEVAL_NONINT) ? 0 : 1; + +#if defined (HISTORY) + if (flags & SEVAL_NOHIST) + bash_history_disable (); +#endif /* HISTORY */ +} + +/* Parse and execute the commands in STRING. Returns whatever + execute_command () returns. This frees STRING. FLAGS is a + flags word; look in common.h for the possible values. Actions + are: + (flags & SEVAL_NONINT) -> interactive = 0; + (flags & SEVAL_INTERACT) -> interactive = 1; + (flags & SEVAL_NOHIST) -> call bash_history_disable () + (flags & SEVAL_NOFREE) -> don't free STRING when finished + (flags & SEVAL_RESETLINE) -> reset line_number to 1 +*/ + +int +parse_and_execute (string, from_file, flags) + char *string; + const char *from_file; + int flags; +{ + int code, lreset; + volatile int should_jump_to_top_level, last_result; + COMMAND *volatile command; + volatile sigset_t pe_sigmask; + + parse_prologue (string, flags, PE_TAG); + + parse_and_execute_level++; + + lreset = flags & SEVAL_RESETLINE; + +#if defined (HAVE_POSIX_SIGNALS) + /* If we longjmp and are going to go on, use this to restore signal mask */ + sigemptyset (&pe_sigmask); + sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &pe_sigmask); +#endif + + /* Reset the line number if the caller wants us to. If we don't reset the + line number, we have to subtract one, because we will add one just + before executing the next command (resetting the line number sets it to + 0; the first line number is 1). */ + push_stream (lreset); + if (parser_expanding_alias ()) + /* push current shell_input_line */ + parser_save_alias (); + + if (lreset == 0) + line_number--; + + indirection_level++; + + code = should_jump_to_top_level = 0; + last_result = EXECUTION_SUCCESS; + + with_input_from_string (string, from_file); + while (*(bash_input.location.string)) + { + command = (COMMAND *)NULL; + + if (interrupt_state) + { + last_result = EXECUTION_FAILURE; + break; + } + + /* Provide a location for functions which `longjmp (top_level)' to + jump to. This prevents errors in substitution from restarting + the reader loop directly, for example. */ + code = setjmp_nosigs (top_level); + + if (code) + { + should_jump_to_top_level = 0; + switch (code) + { + case ERREXIT: + /* variable_context -> 0 is what eval.c:reader_loop() does in + these circumstances. Don't bother with cleanup here because + we don't want to run the function execution cleanup stuff + that will cause pop_context and other functions to run. + XXX - change that if we want the function context to be + unwound. */ + if (exit_immediately_on_error && variable_context) + { + discard_unwind_frame ("pe_dispose"); + variable_context = 0; /* not in a function */ + } + should_jump_to_top_level = 1; + goto out; + case FORCE_EOF: + case EXITPROG: + if (command) + run_unwind_frame ("pe_dispose"); + /* Remember to call longjmp (top_level) after the old + value for it is restored. */ + should_jump_to_top_level = 1; + goto out; + + case DISCARD: + if (command) + run_unwind_frame ("pe_dispose"); + last_result = last_command_exit_value = EXECUTION_FAILURE; /* XXX */ + if (subshell_environment) + { + should_jump_to_top_level = 1; + goto out; + } + else + { +#if 0 + dispose_command (command); /* pe_dispose does this */ +#endif +#if defined (HAVE_POSIX_SIGNALS) + sigprocmask (SIG_SETMASK, &pe_sigmask, (sigset_t *)NULL); +#endif + continue; + } + + default: + command_error ("parse_and_execute", CMDERR_BADJUMP, code, 0); + break; + } + } + + if (parse_command () == 0) + { + if ((flags & SEVAL_PARSEONLY) || (interactive_shell == 0 && read_but_dont_execute)) + { + last_result = EXECUTION_SUCCESS; + dispose_command (global_command); + global_command = (COMMAND *)NULL; + } + else if (command = global_command) + { + struct fd_bitmap *bitmap; + + if ((flags & SEVAL_FUNCDEF) && command->type != cm_function_def) + { + internal_warning ("%s: ignoring function definition attempt", from_file); + should_jump_to_top_level = 0; + last_result = last_command_exit_value = EX_BADUSAGE; + break; + } + + bitmap = new_fd_bitmap (FD_BITMAP_SIZE); + begin_unwind_frame ("pe_dispose"); + add_unwind_protect (dispose_fd_bitmap, bitmap); + add_unwind_protect (dispose_command, command); /* XXX */ + + global_command = (COMMAND *)NULL; + + if ((subshell_environment & SUBSHELL_COMSUB) && comsub_ignore_return) + command->flags |= CMD_IGNORE_RETURN; + +#if defined (ONESHOT) + /* + * IF + * we were invoked as `bash -c' (startup_state == 2) AND + * parse_and_execute has not been called recursively AND + * we're not running a trap AND + * we have parsed the full command (string == '\0') AND + * we're not going to run the exit trap AND + * we have a simple command without redirections AND + * the command is not being timed AND + * the command's return status is not being inverted + * THEN + * tell the execution code that we don't need to fork + */ + if (startup_state == 2 && parse_and_execute_level == 1 && + running_trap == 0 && + *bash_input.location.string == '\0' && + command->type == cm_simple && + signal_is_trapped (EXIT_TRAP) == 0 && + command->redirects == 0 && command->value.Simple->redirects == 0 && + ((command->flags & CMD_TIME_PIPELINE) == 0) && + ((command->flags & CMD_INVERT_RETURN) == 0)) + { + command->flags |= CMD_NO_FORK; + command->value.Simple->flags |= CMD_NO_FORK; + } +#endif /* ONESHOT */ + + /* See if this is a candidate for $( type == cm_simple && !command->redirects && + (command->flags & CMD_TIME_PIPELINE) == 0 && + command->value.Simple->words == 0 && + command->value.Simple->redirects && + command->value.Simple->redirects->next == 0 && + command->value.Simple->redirects->instruction == r_input_direction && + command->value.Simple->redirects->redirector.dest == 0) + { + int r; + r = cat_file (command->value.Simple->redirects); + last_result = (r < 0) ? EXECUTION_FAILURE : EXECUTION_SUCCESS; + } + else + last_result = execute_command_internal + (command, 0, NO_PIPE, NO_PIPE, bitmap); + dispose_command (command); + dispose_fd_bitmap (bitmap); + discard_unwind_frame ("pe_dispose"); + + if (flags & SEVAL_ONECMD) + break; + } + } + else + { + last_result = EXECUTION_FAILURE; + + if (interactive_shell == 0 && this_shell_builtin && + (this_shell_builtin == source_builtin || this_shell_builtin == eval_builtin) && + last_command_exit_value == EX_BADSYNTAX && posixly_correct) + { + should_jump_to_top_level = 1; + code = ERREXIT; + last_command_exit_value = EX_BADUSAGE; + } + + /* Since we are shell compatible, syntax errors in a script + abort the execution of the script. Right? */ + break; + } + } + + out: + + run_unwind_frame (PE_TAG); + + if (interrupt_state && parse_and_execute_level == 0) + { + /* An interrupt during non-interactive execution in an + interactive shell (e.g. via $PROMPT_COMMAND) should + not cause the shell to exit. */ + interactive = interactive_shell; + throw_to_top_level (); + } + + if (should_jump_to_top_level) + jump_to_top_level (code); + + return (last_result); +} + +/* Parse a command contained in STRING according to FLAGS and return the + number of characters consumed from the string. If non-NULL, set *ENDP + to the position in the string where the parse ended. Used to validate + command substitutions during parsing to obey Posix rules about finding + the end of the command and balancing parens. */ +int +parse_string (string, from_file, flags, endp) + char *string; + const char *from_file; + int flags; + char **endp; +{ + int code, nc; + volatile int should_jump_to_top_level; + COMMAND *volatile command, *oglobal; + char *ostring; + volatile sigset_t ps_sigmask; + + parse_prologue (string, flags, PS_TAG); + +#if defined (HAVE_POSIX_SIGNALS) + /* If we longjmp and are going to go on, use this to restore signal mask */ + sigemptyset (&ps_sigmask); + sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &ps_sigmask); +#endif + +/* itrace("parse_string: `%s'", string); */ + /* Reset the line number if the caller wants us to. If we don't reset the + line number, we have to subtract one, because we will add one just + before executing the next command (resetting the line number sets it to + 0; the first line number is 1). */ + push_stream (0); + if (parser_expanding_alias ()) + /* push current shell_input_line */ + parser_save_alias (); + + code = should_jump_to_top_level = 0; + oglobal = global_command; + ostring = string; + + with_input_from_string (string, from_file); + while (*(bash_input.location.string)) + { + command = (COMMAND *)NULL; + +#if 0 + if (interrupt_state) + break; +#endif + + /* Provide a location for functions which `longjmp (top_level)' to + jump to. */ + code = setjmp_nosigs (top_level); + + if (code) + { +#if defined (DEBUG) +itrace("parse_string: longjmp executed: code = %d", code); +#endif + should_jump_to_top_level = 0; + switch (code) + { + case FORCE_EOF: + case ERREXIT: + case EXITPROG: + case DISCARD: /* XXX */ + if (command) + dispose_command (command); + /* Remember to call longjmp (top_level) after the old + value for it is restored. */ + should_jump_to_top_level = 1; + goto out; + + default: +#if defined (HAVE_POSIX_SIGNALS) + sigprocmask (SIG_SETMASK, &ps_sigmask, (sigset_t *)NULL); +#endif + command_error ("parse_string", CMDERR_BADJUMP, code, 0); + break; + } + } + + if (parse_command () == 0) + { + dispose_command (global_command); + global_command = (COMMAND *)NULL; + } + else + { + if ((flags & SEVAL_NOLONGJMP) == 0) + { + should_jump_to_top_level = 1; + code = DISCARD; + } + else + reset_parser (); /* XXX - sets token_to_read */ + break; + } + + if (current_token == yacc_EOF || current_token == shell_eof_token) + break; + } + + out: + + global_command = oglobal; + nc = bash_input.location.string - ostring; + if (endp) + *endp = bash_input.location.string; + + run_unwind_frame (PS_TAG); + + if (should_jump_to_top_level) + jump_to_top_level (code); + + return (nc); +} + +/* Handle a $( < file ) command substitution. This expands the filename, + returning errors as appropriate, then just cats the file to the standard + output. */ +static int +cat_file (r) + REDIRECT *r; +{ + char *fn; + int fd, rval; + + if (r->instruction != r_input_direction) + return -1; + + /* Get the filename. */ + if (posixly_correct && !interactive_shell) + disallow_filename_globbing++; + fn = redirection_expand (r->redirectee.filename); + if (posixly_correct && !interactive_shell) + disallow_filename_globbing--; + + if (fn == 0) + { + redirection_error (r, AMBIGUOUS_REDIRECT); + return -1; + } + + fd = open(fn, O_RDONLY); + if (fd < 0) + { + file_error (fn); + free (fn); + return -1; + } + + rval = zcatfd (fd, 1, fn); + + free (fn); + close (fd); + + return (rval); +} + +int +evalstring (string, from_file, flags) + char *string; + const char *from_file; + int flags; +{ + volatile int r, rflag, rcatch; + + rcatch = 0; + rflag = return_catch_flag; + /* If we are in a place where `return' is valid, we have to catch + `eval "... return"' and make sure parse_and_execute cleans up. Then + we can trampoline to the previous saved return_catch location. */ + if (rflag) + { + begin_unwind_frame ("evalstring"); + + unwind_protect_int (return_catch_flag); + unwind_protect_jmp_buf (return_catch); + + return_catch_flag++; /* increment so we have a counter */ + rcatch = setjmp_nosigs (return_catch); + } + + if (rcatch) + { + parse_and_execute_cleanup (); + r = return_catch_value; + } + else + /* Note that parse_and_execute () frees the string it is passed. */ + r = parse_and_execute (string, from_file, flags); + + if (rflag) + { + run_unwind_frame ("evalstring"); + if (rcatch && return_catch_flag) + { + return_catch_value = r; + longjmp (return_catch, 1); + } + } + + return (r); +} diff --git a/builtins/exec.def b/builtins/exec.def new file mode 100644 index 0000000..9cf76d5 --- /dev/null +++ b/builtins/exec.def @@ -0,0 +1,252 @@ +This file is exec.def, from which is created exec.c. +It implements the builtin "exec" in Bash. + +Copyright (C) 1987-2012 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES exec.c + +$BUILTIN exec +$FUNCTION exec_builtin +$SHORT_DOC exec [-cl] [-a name] [command [arguments ...]] [redirection ...] +Replace the shell with the given command. + +Execute COMMAND, replacing this shell with the specified program. +ARGUMENTS become the arguments to COMMAND. If COMMAND is not specified, +any redirections take effect in the current shell. + +Options: + -a name pass NAME as the zeroth argument to COMMAND + -c execute COMMAND with an empty environment + -l place a dash in the zeroth argument to COMMAND + +If the command cannot be executed, a non-interactive shell exits, unless +the shell option `execfail' is set. + +Exit Status: +Returns success unless COMMAND is not found or a redirection error occurs. +$END + +#include + +#include "../bashtypes.h" +#include "posixstat.h" +#include +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "../bashansi.h" +#include "../bashintl.h" + +#include "../shell.h" +#include "../execute_cmd.h" +#include "../findcmd.h" +#if defined (JOB_CONTROL) +# include "../jobs.h" +#endif +#include "../flags.h" +#include "../trap.h" +#if defined (HISTORY) +# include "../bashhist.h" +#endif +#include "common.h" +#include "bashgetopt.h" + +/* Not all systems declare ERRNO in errno.h... and some systems #define it! */ +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +extern int subshell_environment; +extern REDIRECT *redirection_undo_list; +extern char *exec_argv0; + +int no_exit_on_failed_exec; + +/* If the user wants this to look like a login shell, then + prepend a `-' onto NAME and return the new name. */ +static char * +mkdashname (name) + char *name; +{ + char *ret; + + ret = (char *)xmalloc (2 + strlen (name)); + ret[0] = '-'; + strcpy (ret + 1, name); + return ret; +} + +int +exec_builtin (list) + WORD_LIST *list; +{ + int exit_value = EXECUTION_FAILURE; + int cleanenv, login, opt; + char *argv0, *command, **args, **env, *newname, *com2; + + cleanenv = login = 0; + exec_argv0 = argv0 = (char *)NULL; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "cla:")) != -1) + { + switch (opt) + { + case 'c': + cleanenv = 1; + break; + case 'l': + login = 1; + break; + case 'a': + argv0 = list_optarg; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + /* First, let the redirections remain. */ + dispose_redirects (redirection_undo_list); + redirection_undo_list = (REDIRECT *)NULL; + + if (list == 0) + return (EXECUTION_SUCCESS); + +#if defined (RESTRICTED_SHELL) + if (restricted) + { + sh_restricted ((char *)NULL); + return (EXECUTION_FAILURE); + } +#endif /* RESTRICTED_SHELL */ + + args = strvec_from_word_list (list, 1, 0, (int *)NULL); + + /* A command with a slash anywhere in its name is not looked up in $PATH. */ + command = absolute_program (args[0]) ? args[0] : search_for_command (args[0], 1); + + if (command == 0) + { + if (file_isdir (args[0])) + { +#if defined (EISDIR) + builtin_error (_("%s: cannot execute: %s"), args[0], strerror (EISDIR)); +#else + builtin_error (_("%s: cannot execute: %s"), args[0], strerror (errno)); +#endif + exit_value = EX_NOEXEC; + } + else + { + sh_notfound (args[0]); + exit_value = EX_NOTFOUND; /* As per Posix.2, 3.14.6 */ + } + goto failed_exec; + } + + com2 = full_pathname (command); + if (com2) + { + if (command != args[0]) + free (command); + command = com2; + } + + if (argv0) + { + free (args[0]); + args[0] = login ? mkdashname (argv0) : savestring (argv0); + exec_argv0 = savestring (args[0]); + } + else if (login) + { + newname = mkdashname (args[0]); + free (args[0]); + args[0] = newname; + } + + /* Decrement SHLVL by 1 so a new shell started here has the same value, + preserving the appearance. After we do that, we need to change the + exported environment to include the new value. */ + if (cleanenv == 0) + adjust_shell_level (-1); + + if (cleanenv) + env = (char **)NULL; + else + { + maybe_make_export_env (); + env = export_env; + } + +#if defined (HISTORY) + if (interactive_shell && subshell_environment == 0) + maybe_save_shell_history (); +#endif /* HISTORY */ + + restore_original_signals (); + +#if defined (JOB_CONTROL) + if (subshell_environment == 0) + end_job_control (); +#endif /* JOB_CONTROL */ + + exit_value = shell_execve (command, args, env); + + /* We have to set this to NULL because shell_execve has called realloc() + to stuff more items at the front of the array, which may have caused + the memory to be freed by realloc(). We don't want to free it twice. */ + args = (char **)NULL; + if (cleanenv == 0) + adjust_shell_level (1); + + if (exit_value == EX_NOTFOUND) /* no duplicate error message */ + goto failed_exec; + else if (executable_file (command) == 0) + { + builtin_error (_("%s: cannot execute: %s"), command, strerror (errno)); + exit_value = EX_NOEXEC; /* As per Posix.2, 3.14.6 */ + } + else + file_error (command); + +failed_exec: + FREE (command); + + if (subshell_environment || (interactive == 0 && no_exit_on_failed_exec == 0)) + exit_shell (exit_value); + + if (args) + strvec_dispose (args); + + initialize_traps (); + initialize_signals (1); + +#if defined (JOB_CONTROL) + if (interactive_shell || job_control) + restart_job_control (); +#endif /* JOB_CONTROL */ + + return (exit_value); +} diff --git a/builtins/exit.def b/builtins/exit.def new file mode 100644 index 0000000..34728eb --- /dev/null +++ b/builtins/exit.def @@ -0,0 +1,168 @@ +This file is exit.def, from which is created exit.c. +It implements the builtins "exit", and "logout" in Bash. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES exit.c + +$BUILTIN exit +$FUNCTION exit_builtin +$SHORT_DOC exit [n] +Exit the shell. + +Exits the shell with a status of N. If N is omitted, the exit status +is that of the last command executed. +$END + +#include + +#include "../bashtypes.h" +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "../bashintl.h" + +#include "../shell.h" +#include "../jobs.h" + +#include "common.h" +#include "builtext.h" /* for jobs_builtin */ + +extern int check_jobs_at_exit; +extern int last_command_exit_value; +extern int running_trap, trap_saved_exit_value; +extern int subshell_environment; +extern sh_builtin_func_t *this_shell_builtin; +extern sh_builtin_func_t *last_shell_builtin; + +static int exit_or_logout __P((WORD_LIST *)); +static int sourced_logout; + +int +exit_builtin (list) + WORD_LIST *list; +{ + if (interactive) + { + fprintf (stderr, login_shell ? _("logout\n") : "exit\n"); + fflush (stderr); + } + + return (exit_or_logout (list)); +} + +$BUILTIN logout +$FUNCTION logout_builtin +$SHORT_DOC logout [n] +Exit a login shell. + +Exits a login shell with exit status N. Returns an error if not executed +in a login shell. +$END + +/* How to logout. */ +int +logout_builtin (list) + WORD_LIST *list; +{ + if (login_shell == 0 /* && interactive */) + { + builtin_error (_("not login shell: use `exit'")); + return (EXECUTION_FAILURE); + } + else + return (exit_or_logout (list)); +} + +static int +exit_or_logout (list) + WORD_LIST *list; +{ + int exit_value; + +#if defined (JOB_CONTROL) + int exit_immediate_okay, stopmsg; + + exit_immediate_okay = (interactive == 0 || + last_shell_builtin == exit_builtin || + last_shell_builtin == logout_builtin || + last_shell_builtin == jobs_builtin); + + /* Check for stopped jobs if the user wants to. */ + if (exit_immediate_okay == 0) + { + register int i; + for (i = stopmsg = 0; i < js.j_jobslots; i++) + if (jobs[i] && STOPPED (i)) + stopmsg = JSTOPPED; + else if (check_jobs_at_exit && stopmsg == 0 && jobs[i] && RUNNING (i)) + stopmsg = JRUNNING; + + if (stopmsg == JSTOPPED) + fprintf (stderr, _("There are stopped jobs.\n")); + else if (stopmsg == JRUNNING) + fprintf (stderr, _("There are running jobs.\n")); + + if (stopmsg && check_jobs_at_exit) + list_all_jobs (JLIST_STANDARD); + + if (stopmsg) + { + /* This is NOT superfluous because EOF can get here without + going through the command parser. Set both last and this + so that either `exit', `logout', or ^D will work to exit + immediately if nothing intervenes. */ + this_shell_builtin = last_shell_builtin = exit_builtin; + return (EXECUTION_FAILURE); + } + } +#endif /* JOB_CONTROL */ + + /* Get return value if present. This means that you can type + `logout 5' to a shell, and it returns 5. */ + + /* If we're running the exit trap (running_trap == 1, since running_trap + gets set to SIG+1), and we don't have a argument given to `exit' + (list == 0), use the exit status we saved before running the trap + commands (trap_saved_exit_value). */ + exit_value = (running_trap == 1 && list == 0) ? trap_saved_exit_value : get_exitstat (list); + + bash_logout (); + + last_command_exit_value = exit_value; + + /* Exit the program. */ + jump_to_top_level (EXITPROG); + /*NOTREACHED*/ +} + +void +bash_logout () +{ + /* Run our `~/.bash_logout' file if it exists, and this is a login shell. */ + if (login_shell && sourced_logout++ == 0 && subshell_environment == 0) + { + maybe_execute_file ("~/.bash_logout", 1); +#ifdef SYS_BASH_LOGOUT + maybe_execute_file (SYS_BASH_LOGOUT, 1); +#endif + } +} diff --git a/builtins/fc.def b/builtins/fc.def new file mode 100644 index 0000000..e68f2c2 --- /dev/null +++ b/builtins/fc.def @@ -0,0 +1,698 @@ +This file is fc.def, from which is created fc.c. +It implements the builtin "fc" in Bash. + +Copyright (C) 1987-2011 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES fc.c + +$BUILTIN fc +$FUNCTION fc_builtin +$DEPENDS_ON HISTORY +$SHORT_DOC fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command] +Display or execute commands from the history list. + +fc is used to list or edit and re-execute commands from the history list. +FIRST and LAST can be numbers specifying the range, or FIRST can be a +string, which means the most recent command beginning with that +string. + +Options: + -e ENAME select which editor to use. Default is FCEDIT, then EDITOR, + then vi + -l list lines instead of editing + -n omit line numbers when listing + -r reverse the order of the lines (newest listed first) + +With the `fc -s [pat=rep ...] [command]' format, COMMAND is +re-executed after the substitution OLD=NEW is performed. + +A useful alias to use with this is r='fc -s', so that typing `r cc' +runs the last command beginning with `cc' and typing `r' re-executes +the last command. + +Exit Status: +Returns success or status of executed command; non-zero if an error occurs. +$END + +#include + +#if defined (HISTORY) +#if defined (HAVE_SYS_PARAM_H) +# include +#endif +#include "../bashtypes.h" +#include "posixstat.h" +#if ! defined(_MINIX) && defined (HAVE_SYS_FILE_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include + +#include "../bashansi.h" +#include "../bashintl.h" +#include + +#include "../shell.h" +#include "../builtins.h" +#include "../flags.h" +#include "../bashhist.h" +#include "maxpath.h" +#include +#include "bashgetopt.h" +#include "common.h" + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +extern int current_command_line_count; +extern int literal_history; +extern int posixly_correct; +extern int subshell_environment, interactive_shell; + +extern int unlink __P((const char *)); + +extern FILE *sh_mktmpfp __P((char *, int, char **)); + +/* **************************************************************** */ +/* */ +/* The K*rn shell style fc command (Fix Command) */ +/* */ +/* **************************************************************** */ + +/* fc builtin command (fix command) for Bash for those who + like K*rn-style history better than csh-style. + + fc [-e ename] [-nlr] [first] [last] + + FIRST and LAST can be numbers specifying the range, or FIRST can be + a string, which means the most recent command beginning with that + string. + + -e ENAME selects which editor to use. Default is FCEDIT, then EDITOR, + then the editor which corresponds to the current readline editing + mode, then vi. + + -l means list lines instead of editing. + -n means no line numbers listed. + -r means reverse the order of the lines (making it newest listed first). + + fc -e - [pat=rep ...] [command] + fc -s [pat=rep ...] [command] + + Equivalent to !command:sg/pat/rep execpt there can be multiple PAT=REP's. +*/ + +/* Data structure describing a list of global replacements to perform. */ +typedef struct repl { + struct repl *next; + char *pat; + char *rep; +} REPL; + +/* Accessors for HIST_ENTRY lists that are called HLIST. */ +#define histline(i) (hlist[(i)]->line) +#define histdata(i) (hlist[(i)]->data) + +#define FREE_RLIST() \ + do { \ + for (rl = rlist; rl; ) { \ + REPL *r; \ + r = rl->next; \ + if (rl->pat) \ + free (rl->pat); \ + if (rl->rep) \ + free (rl->rep); \ + free (rl); \ + rl = r; \ + } \ + } while (0) + +static char *fc_dosubs __P((char *, REPL *)); +static char *fc_gethist __P((char *, HIST_ENTRY **)); +static int fc_gethnum __P((char *, HIST_ENTRY **)); +static int fc_number __P((WORD_LIST *)); +static void fc_replhist __P((char *)); +#ifdef INCLUDE_UNUSED +static char *fc_readline __P((FILE *)); +static void fc_addhist __P((char *)); +#endif + +/* String to execute on a file that we want to edit. */ +#define FC_EDIT_COMMAND "${FCEDIT:-${EDITOR:-$(command -v editor || echo vi)}}" +#if defined (STRICT_POSIX) +# define POSIX_FC_EDIT_COMMAND "${FCEDIT:-ed}" +#else +# define POSIX_FC_EDIT_COMMAND "${FCEDIT:-${EDITOR:-$(command -v editor || echo ed)}}" +#endif + +int +fc_builtin (list) + WORD_LIST *list; +{ + register int i; + register char *sep; + int numbering, reverse, listing, execute; + int histbeg, histend, last_hist, retval, opt, rh, real_last; + FILE *stream; + REPL *rlist, *rl; + char *ename, *command, *newcom, *fcedit; + HIST_ENTRY **hlist; + char *fn; + + numbering = 1; + reverse = listing = execute = 0; + ename = (char *)NULL; + + /* Parse out the options and set which of the two forms we're in. */ + reset_internal_getopt (); + lcurrent = list; /* XXX */ + while (fc_number (loptend = lcurrent) == 0 && + (opt = internal_getopt (list, ":e:lnrs")) != -1) + { + switch (opt) + { + case 'n': + numbering = 0; + break; + + case 'l': + listing = 1; + break; + + case 'r': + reverse = 1; + break; + + case 's': + execute = 1; + break; + + case 'e': + ename = list_optarg; + break; + + default: + builtin_usage (); + return (EX_USAGE); + } + } + + list = loptend; + + if (ename && (*ename == '-') && (ename[1] == '\0')) + execute = 1; + + /* The "execute" form of the command (re-run, with possible string + substitutions). */ + if (execute) + { + rlist = (REPL *)NULL; + while (list && ((sep = (char *)strchr (list->word->word, '=')) != NULL)) + { + *sep++ = '\0'; + rl = (REPL *)xmalloc (sizeof (REPL)); + rl->next = (REPL *)NULL; + rl->pat = savestring (list->word->word); + rl->rep = savestring (sep); + + if (rlist == NULL) + rlist = rl; + else + { + rl->next = rlist; + rlist = rl; + } + list = list->next; + } + + /* If we have a list of substitutions to do, then reverse it + to get the replacements in the proper order. */ + + rlist = REVERSE_LIST (rlist, REPL *); + + hlist = history_list (); + + /* If we still have something in list, it is a command spec. + Otherwise, we use the most recent command in time. */ + command = fc_gethist (list ? list->word->word : (char *)NULL, hlist); + + if (command == NULL) + { + builtin_error (_("no command found")); + if (rlist) + FREE_RLIST (); + + return (EXECUTION_FAILURE); + } + + if (rlist) + { + newcom = fc_dosubs (command, rlist); + free (command); + FREE_RLIST (); + command = newcom; + } + + fprintf (stderr, "%s\n", command); + fc_replhist (command); /* replace `fc -s' with command */ + /* Posix says that the re-executed commands should be entered into the + history. */ + return (parse_and_execute (command, "fc", SEVAL_NOHIST)); + } + + /* This is the second form of the command (the list-or-edit-and-rerun + form). */ + hlist = history_list (); + if (hlist == 0) + return (EXECUTION_SUCCESS); + for (i = 0; hlist[i]; i++); + + /* With the Bash implementation of history, the current command line + ("fc blah..." and so on) is already part of the history list by + the time we get to this point. This just skips over that command + and makes the last command that this deals with be the last command + the user entered before the fc. We need to check whether the + line was actually added (HISTIGNORE may have caused it to not be), + so we check hist_last_line_added. */ + + /* Even though command substitution through parse_and_execute turns off + remember_on_history, command substitution in a shell when set -o history + has been enabled (interactive or not) should use it in the last_hist + calculation as if it were on. */ + rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && enable_history_list); + last_hist = i - rh - hist_last_line_added; + + /* Make sure that real_last is calculated the same way here and in + fc_gethnum. The return value from fc_gethnum is treated specially if + it is == real_last and we are listing commands. */ + real_last = i; + /* back up from the end to the last non-null history entry */ + while (hlist[real_last] == 0 && real_last > 0) + real_last--; + + /* XXX */ + if (i == last_hist && hlist[last_hist] == 0) + while (last_hist >= 0 && hlist[last_hist] == 0) + last_hist--; + if (last_hist < 0) + { + sh_erange ((char *)NULL, _("history specification")); + return (EXECUTION_FAILURE); + } + + if (list) + { + histbeg = fc_gethnum (list->word->word, hlist); + list = list->next; + + if (list) + histend = fc_gethnum (list->word->word, hlist); + else if (histbeg == real_last) + histend = listing ? real_last : histbeg; + else + histend = listing ? last_hist : histbeg; + } + else + { + /* The default for listing is the last 16 history items. */ + if (listing) + { + histend = last_hist; + histbeg = histend - 16 + 1; /* +1 because loop below uses >= */ + if (histbeg < 0) + histbeg = 0; + } + else + /* For editing, it is the last history command. */ + histbeg = histend = last_hist; + } + + /* "When not listing, the fc command that caused the editing shall not be + entered into the history list." */ + if (listing == 0 && hist_last_line_added) + { + bash_delete_last_history (); + /* If we're editing a single command -- the last command in the + history -- and we just removed the dummy command added by + edit_and_execute_command (), we need to check whether or not we + just removed the last command in the history and need to back + the pointer up. remember_on_history is off because we're running + in parse_and_execute(). */ + if (histbeg == histend && histend == last_hist && hlist[last_hist] == 0) + last_hist = histbeg = --histend; + } + + /* We print error messages for line specifications out of range. */ + if ((histbeg < 0) || (histend < 0)) + { + sh_erange ((char *)NULL, _("history specification")); + return (EXECUTION_FAILURE); + } + + if (histend < histbeg) + { + i = histend; + histend = histbeg; + histbeg = i; + + reverse = 1; + } + + if (listing) + stream = stdout; + else + { + numbering = 0; + stream = sh_mktmpfp ("bash-fc", MT_USERANDOM|MT_USETMPDIR, &fn); + if (stream == 0) + { + builtin_error (_("%s: cannot open temp file: %s"), fn ? fn : "", strerror (errno)); + FREE (fn); + return (EXECUTION_FAILURE); + } + } + + for (i = reverse ? histend : histbeg; reverse ? i >= histbeg : i <= histend; reverse ? i-- : i++) + { + QUIT; + if (numbering) + fprintf (stream, "%d", i + history_base); + if (listing) + { + if (posixly_correct) + fputs ("\t", stream); + else + fprintf (stream, "\t%c", histdata (i) ? '*' : ' '); + } + fprintf (stream, "%s\n", histline (i)); + } + + if (listing) + return (sh_chkwrite (EXECUTION_SUCCESS)); + + fflush (stream); + if (ferror (stream)) + { + sh_wrerror (); + fclose (stream); + return (EXECUTION_FAILURE); + } + fclose (stream); + + /* Now edit the file of commands. */ + if (ename) + { + command = (char *)xmalloc (strlen (ename) + strlen (fn) + 2); + sprintf (command, "%s %s", ename, fn); + } + else + { + fcedit = posixly_correct ? POSIX_FC_EDIT_COMMAND : FC_EDIT_COMMAND; + command = (char *)xmalloc (3 + strlen (fcedit) + strlen (fn)); + sprintf (command, "%s %s", fcedit, fn); + } + retval = parse_and_execute (command, "fc", SEVAL_NOHIST); + if (retval != EXECUTION_SUCCESS) + { + unlink (fn); + free (fn); + return (EXECUTION_FAILURE); + } + + /* Make sure parse_and_execute doesn't turn this off, even though a + call to parse_and_execute farther up the function call stack (e.g., + if this is called by vi_edit_and_execute_command) may have already + called bash_history_disable. */ + remember_on_history = 1; + + /* Turn on the `v' flag while fc_execute_file runs so the commands + will be echoed as they are read by the parser. */ + begin_unwind_frame ("fc builtin"); + add_unwind_protect ((Function *)xfree, fn); + add_unwind_protect (unlink, fn); + unwind_protect_int (echo_input_at_read); + echo_input_at_read = 1; + + retval = fc_execute_file (fn); + + run_unwind_frame ("fc builtin"); + + return (retval); +} + +/* Return 1 if LIST->word->word is a legal number for fc's use. */ +static int +fc_number (list) + WORD_LIST *list; +{ + char *s; + + if (list == 0) + return 0; + s = list->word->word; + if (*s == '-') + s++; + return (legal_number (s, (intmax_t *)NULL)); +} + +/* Return an absolute index into HLIST which corresponds to COMMAND. If + COMMAND is a number, then it was specified in relative terms. If it + is a string, then it is the start of a command line present in HLIST. */ +static int +fc_gethnum (command, hlist) + char *command; + HIST_ENTRY **hlist; +{ + int sign, n, clen, rh; + register int i, j, last_hist, real_last; + register char *s; + + sign = 1; + /* Count history elements. */ + for (i = 0; hlist[i]; i++); + + /* With the Bash implementation of history, the current command line + ("fc blah..." and so on) is already part of the history list by + the time we get to this point. This just skips over that command + and makes the last command that this deals with be the last command + the user entered before the fc. We need to check whether the + line was actually added (HISTIGNORE may have caused it to not be), + so we check hist_last_line_added. This needs to agree with the + calculation of last_hist in fc_builtin above. */ + /* Even though command substitution through parse_and_execute turns off + remember_on_history, command substitution in a shell when set -o history + has been enabled (interactive or not) should use it in the last_hist + calculation as if it were on. */ + rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && enable_history_list); + last_hist = i - rh - hist_last_line_added; + + if (i == last_hist && hlist[last_hist] == 0) + while (last_hist >= 0 && hlist[last_hist] == 0) + last_hist--; + if (last_hist < 0) + return (-1); + + real_last = i; + i = last_hist; + + /* No specification defaults to most recent command. */ + if (command == NULL) + return (i); + + /* back up from the end to the last non-null history entry */ + while (hlist[real_last] == 0 && real_last > 0) + real_last--; + + /* Otherwise, there is a specification. It can be a number relative to + the current position, or an absolute history number. */ + s = command; + + /* Handle possible leading minus sign. */ + if (s && (*s == '-')) + { + sign = -1; + s++; + } + + if (s && DIGIT(*s)) + { + n = atoi (s); + n *= sign; + + /* If the value is negative or zero, then it is an offset from + the current history item. */ + if (n < 0) + { + n += i + 1; + return (n < 0 ? 0 : n); + } + else if (n == 0) + return ((sign == -1) ? real_last : i); + else + { + n -= history_base; + return (i < n ? i : n); + } + } + + clen = strlen (command); + for (j = i; j >= 0; j--) + { + if (STREQN (command, histline (j), clen)) + return (j); + } + return (-1); +} + +/* Locate the most recent history line which begins with + COMMAND in HLIST, and return a malloc()'ed copy of it. */ +static char * +fc_gethist (command, hlist) + char *command; + HIST_ENTRY **hlist; +{ + int i; + + if (hlist == 0) + return ((char *)NULL); + + i = fc_gethnum (command, hlist); + + if (i >= 0) + return (savestring (histline (i))); + else + return ((char *)NULL); +} + +#ifdef INCLUDE_UNUSED +/* Read the edited history lines from STREAM and return them + one at a time. This can read unlimited length lines. The + caller should free the storage. */ +static char * +fc_readline (stream) + FILE *stream; +{ + register int c; + int line_len = 0, lindex = 0; + char *line = (char *)NULL; + + while ((c = getc (stream)) != EOF) + { + if ((lindex + 2) >= line_len) + line = (char *)xrealloc (line, (line_len += 128)); + + if (c == '\n') + { + line[lindex++] = '\n'; + line[lindex++] = '\0'; + return (line); + } + else + line[lindex++] = c; + } + + if (!lindex) + { + if (line) + free (line); + + return ((char *)NULL); + } + + if (lindex + 2 >= line_len) + line = (char *)xrealloc (line, lindex + 3); + + line[lindex++] = '\n'; /* Finish with newline if none in file */ + line[lindex++] = '\0'; + return (line); +} +#endif + +/* Perform the SUBS on COMMAND. + SUBS is a list of substitutions, and COMMAND is a simple string. + Return a pointer to a malloc'ed string which contains the substituted + command. */ +static char * +fc_dosubs (command, subs) + char *command; + REPL *subs; +{ + register char *new, *t; + register REPL *r; + + for (new = savestring (command), r = subs; r; r = r->next) + { + t = strsub (new, r->pat, r->rep, 1); + free (new); + new = t; + } + return (new); +} + +/* Use `command' to replace the last entry in the history list, which, + by this time, is `fc blah...'. The intent is that the new command + become the history entry, and that `fc' should never appear in the + history list. This way you can do `r' to your heart's content. */ +static void +fc_replhist (command) + char *command; +{ + int n; + + if (command == 0 || *command == '\0') + return; + + n = strlen (command); + if (command[n - 1] == '\n') + command[n - 1] = '\0'; + + if (command && *command) + { + bash_delete_last_history (); + maybe_add_history (command); /* Obeys HISTCONTROL setting. */ + } +} + +#ifdef INCLUDE_UNUSED +/* Add LINE to the history, after removing a single trailing newline. */ +static void +fc_addhist (line) + char *line; +{ + register int n; + + if (line == 0 || *line == 0) + return; + + n = strlen (line); + + if (line[n - 1] == '\n') + line[n - 1] = '\0'; + + if (line && *line) + maybe_add_history (line); /* Obeys HISTCONTROL setting. */ +} +#endif + +#endif /* HISTORY */ diff --git a/builtins/fg_bg.def b/builtins/fg_bg.def new file mode 100644 index 0000000..ae7e904 --- /dev/null +++ b/builtins/fg_bg.def @@ -0,0 +1,186 @@ +This file is fg_bg.def, from which is created fg_bg.c. +It implements the builtins "bg" and "fg" in Bash. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES fg_bg.c + +$BUILTIN fg +$FUNCTION fg_builtin +$DEPENDS_ON JOB_CONTROL +$SHORT_DOC fg [job_spec] +Move job to the foreground. + +Place the job identified by JOB_SPEC in the foreground, making it the +current job. If JOB_SPEC is not present, the shell's notion of the +current job is used. + +Exit Status: +Status of command placed in foreground, or failure if an error occurs. +$END + +#include + +#include "../bashtypes.h" +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "../bashintl.h" + +#include "../shell.h" +#include "../jobs.h" +#include "common.h" +#include "bashgetopt.h" + +#if defined (JOB_CONTROL) +extern char *this_command_name; + +static int fg_bg __P((WORD_LIST *, int)); + +/* How to bring a job into the foreground. */ +int +fg_builtin (list) + WORD_LIST *list; +{ + int fg_bit; + register WORD_LIST *t; + + if (job_control == 0) + { + sh_nojobs ((char *)NULL); + return (EXECUTION_FAILURE); + } + + if (no_options (list)) + return (EX_USAGE); + list = loptend; + + /* If the last arg on the line is '&', then start this job in the + background. Else, fg the job. */ + for (t = list; t && t->next; t = t->next) + ; + fg_bit = (t && t->word->word[0] == '&' && t->word->word[1] == '\0') == 0; + + return (fg_bg (list, fg_bit)); +} +#endif /* JOB_CONTROL */ + +$BUILTIN bg +$FUNCTION bg_builtin +$DEPENDS_ON JOB_CONTROL +$SHORT_DOC bg [job_spec ...] +Move jobs to the background. + +Place the jobs identified by each JOB_SPEC in the background, as if they +had been started with `&'. If JOB_SPEC is not present, the shell's notion +of the current job is used. + +Exit Status: +Returns success unless job control is not enabled or an error occurs. +$END + +#if defined (JOB_CONTROL) +/* How to put a job into the background. */ +int +bg_builtin (list) + WORD_LIST *list; +{ + int r; + + if (job_control == 0) + { + sh_nojobs ((char *)NULL); + return (EXECUTION_FAILURE); + } + + if (no_options (list)) + return (EX_USAGE); + list = loptend; + + /* This relies on the fact that fg_bg() takes a WORD_LIST *, but only acts + on the first member (if any) of that list. */ + r = EXECUTION_SUCCESS; + do + { + if (fg_bg (list, 0) == EXECUTION_FAILURE) + r = EXECUTION_FAILURE; + if (list) + list = list->next; + } + while (list); + + return r; +} + +/* How to put a job into the foreground/background. */ +static int +fg_bg (list, foreground) + WORD_LIST *list; + int foreground; +{ + sigset_t set, oset; + int job, status, old_async_pid; + JOB *j; + + BLOCK_CHILD (set, oset); + job = get_job_spec (list); + + if (INVALID_JOB (job)) + { + if (job != DUP_JOB) + sh_badjob (list ? list->word->word : _("current")); + + goto failure; + } + + j = get_job_by_jid (job); + /* Or if j->pgrp == shell_pgrp. */ + if (IS_JOBCONTROL (job) == 0) + { + builtin_error (_("job %d started without job control"), job + 1); + goto failure; + } + + if (foreground == 0) + { + old_async_pid = last_asynchronous_pid; + last_asynchronous_pid = j->pgrp; /* As per Posix.2 5.4.2 */ + } + + status = start_job (job, foreground); + + if (status >= 0) + { + /* win: */ + UNBLOCK_CHILD (oset); + return (foreground ? status : EXECUTION_SUCCESS); + } + else + { + if (foreground == 0) + last_asynchronous_pid = old_async_pid; + + failure: + UNBLOCK_CHILD (oset); + return (EXECUTION_FAILURE); + } +} +#endif /* JOB_CONTROL */ diff --git a/builtins/gen-helpfiles.c b/builtins/gen-helpfiles.c new file mode 100644 index 0000000..fac34ed --- /dev/null +++ b/builtins/gen-helpfiles.c @@ -0,0 +1,197 @@ +/* gen-helpfiles - create files containing builtin help text */ + +/* Copyright (C) 2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* This links with a specially-generated version of builtins.c and takes + the long_doc members of each struct builtin element and writes those to + the file named by the `handle' member of the struct builtin element. */ + +#if !defined (CROSS_COMPILING) +# include +#else /* CROSS_COMPILING */ +/* A conservative set of defines based on POSIX/SUS3/XPG6 */ +# define HAVE_UNISTD_H +# define HAVE_STRING_H +# define HAVE_STDLIB_H + +# define HAVE_RENAME +#endif /* CROSS_COMPILING */ + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#ifndef _MINIX +# include "../bashtypes.h" +# if defined (HAVE_SYS_FILE_H) +# include +# endif +#endif + +#include "posixstat.h" +#include "filecntl.h" + +#include "../bashansi.h" +#include +#include + +#include "stdc.h" + +#include "../builtins.h" +#include "tmpbuiltins.h" + +#if defined (USING_BASH_MALLOC) +#undef xmalloc +#undef xrealloc +#undef xfree + +#undef free /* defined in xmalloc.h */ +#endif + +#ifndef errno +extern int errno; +#endif + +#if !defined (__STDC__) && !defined (strcpy) +extern char *strcpy (); +#endif /* !__STDC__ && !strcpy */ + +#define whitespace(c) (((c) == ' ') || ((c) == '\t')) + +/* Flag values that builtins can have. */ +#define BUILTIN_FLAG_SPECIAL 0x01 +#define BUILTIN_FLAG_ASSIGNMENT 0x02 +#define BUILTIN_FLAG_POSIX_BUILTIN 0x04 + +#define BASE_INDENT 4 + +/* Non-zero means to produce separate help files for each builtin, named by + the builtin name, in `./helpfiles'. */ +int separate_helpfiles = 0; + +/* Non-zero means to create single C strings for each `longdoc', with + embedded newlines, for ease of translation. */ +int single_longdoc_strings = 1; + +/* The name of a directory into which the separate external help files will + eventually be installed. */ +char *helpfile_directory; + +/* Forward declarations. */ + +int write_helpfiles __P((struct builtin *)); + +/* For each file mentioned on the command line, process it and + write the information to STRUCTFILE and EXTERNFILE, while + creating the production file if neccessary. */ +int +main (argc, argv) + int argc; + char **argv; +{ + int arg_index = 1; + + while (arg_index < argc && argv[arg_index][0] == '-') + { + char *arg = argv[arg_index++]; + + if (strcmp (arg, "-noproduction") == 0) + ; + else if (strcmp (arg, "-H") == 0) + helpfile_directory = argv[arg_index++]; + else if (strcmp (arg, "-S") == 0) + single_longdoc_strings = 0; + else + { + fprintf (stderr, "%s: Unknown flag %s.\n", argv[0], arg); + exit (2); + } + } + + write_helpfiles(shell_builtins); + + exit (0); +} + +/* Write DOCUMENTATION to STREAM, perhaps surrounding it with double-quotes + and quoting special characters in the string. Handle special things for + internationalization (gettext) and the single-string vs. multiple-strings + issues. */ +void +write_documentation (stream, documentation, indentation) + FILE *stream; + char *documentation; + int indentation; +{ + if (stream == 0) + return; + + if (documentation) + fprintf (stream, "%*s%s\n", indentation, " ", documentation); +} + +int +write_helpfiles (builtins) + struct builtin *builtins; +{ + char *helpfile, *bname, *fname; + FILE *helpfp; + int i, hdlen; + struct builtin b; + + i = mkdir ("helpfiles", 0777); + if (i < 0 && errno != EEXIST) + { + fprintf (stderr, "write_helpfiles: helpfiles: cannot create directory\n"); + return -1; + } + + hdlen = strlen ("helpfiles/"); + for (i = 0; i < num_shell_builtins; i++) + { + b = builtins[i]; + + fname = (char *)b.handle; + helpfile = (char *)malloc (hdlen + strlen (fname) + 1); + if (helpfile == 0) + { + fprintf (stderr, "gen-helpfiles: cannot allocate memory\n"); + exit (1); + } + sprintf (helpfile, "helpfiles/%s", fname); + + helpfp = fopen (helpfile, "w"); + if (helpfp == 0) + { + fprintf (stderr, "write_helpfiles: cannot open %s\n", helpfile); + free (helpfile); + continue; + } + + write_documentation (helpfp, b.long_doc[0], 4); + + fflush (helpfp); + fclose (helpfp); + free (helpfile); + } + return 0; +} diff --git a/builtins/getopt.c b/builtins/getopt.c new file mode 100644 index 0000000..feb18b5 --- /dev/null +++ b/builtins/getopt.c @@ -0,0 +1,309 @@ +/* getopt.c - getopt for Bash. Used by the getopt builtin. */ + +/* Copyright (C) 1993-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include +#include "memalloc.h" +#include "../bashintl.h" +#include "../shell.h" +#include "getopt.h" + +/* For communication from `sh_getopt' to the caller. + When `sh_getopt' finds an option that takes an argument, + the argument value is returned here. */ +char *sh_optarg = 0; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `sh_getopt'. + + On entry to `sh_getopt', zero means this is the first call; initialize. + + When `sh_getopt' returns EOF, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `sh_optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +/* XXX 1003.2 says this must be 1 before any call. */ +int sh_optind = 0; + +/* Index of the current argument. */ +static int sh_curopt; + +/* The next char to be scanned in the option-element + in which the last option character we returned was found. + This allows us to pick up the scan where we left off. + + If this is zero, or a null string, it means resume the scan + by advancing to the next ARGV-element. */ + +static char *nextchar; +static int sh_charindex; + +/* Callers store zero here to inhibit the error message + for unrecognized options. */ + +int sh_opterr = 1; + +/* Set to an option character which was unrecognized. + This must be initialized on some systems to avoid linking in the + system's own getopt implementation. */ + +int sh_optopt = '?'; + +/* Set to 1 when we see an invalid option; public so getopts can reset it. */ +int sh_badopt = 0; + +/* Scan elements of ARGV (whose length is ARGC) for option characters + given in OPTSTRING. + + If an element of ARGV starts with '-', and is not exactly "-" or "--", + then it is an option element. The characters of this element + (aside from the initial '-') are option characters. If `sh_getopt' + is called repeatedly, it returns successively each of the option characters + from each of the option elements. + + If `sh_getopt' finds another option character, it returns that character, + updating `sh_optind' and `nextchar' so that the next call to `sh_getopt' can + resume the scan with the following option character or ARGV-element. + + If there are no more option characters, `sh_getopt' returns `EOF'. + Then `sh_optind' is the index in ARGV of the first ARGV-element + that is not an option. + + OPTSTRING is a string containing the legitimate option characters. + If an option character is seen that is not listed in OPTSTRING, + return '?' after printing an error message. If you set `sh_opterr' to + zero, the error message is suppressed but we still return '?'. + + If a char in OPTSTRING is followed by a colon, that means it wants an arg, + so the following text in the same ARGV-element, or the text of the following + ARGV-element, is returned in `sh_optarg'. */ + +/* 1003.2 specifies the format of this message. */ +#define BADOPT(x) fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], x) +#define NEEDARG(x) fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], x) + +int +sh_getopt (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + char c, *temp; + + sh_optarg = 0; + + if (sh_optind >= argc || sh_optind < 0) /* XXX was sh_optind > argc */ + { + sh_optind = argc; + return (EOF); + } + + /* Initialize the internal data when the first call is made. + Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + + if (sh_optind == 0) + { + sh_optind = 1; + nextchar = (char *)NULL; + } + + if (nextchar == 0 || *nextchar == '\0') + { + /* If we have done all the ARGV-elements, stop the scan. */ + if (sh_optind >= argc) + return EOF; + + temp = argv[sh_optind]; + + /* Special ARGV-element `--' means premature end of options. + Skip it like a null option, and return EOF. */ + if (temp[0] == '-' && temp[1] == '-' && temp[2] == '\0') + { + sh_optind++; + return EOF; + } + + /* If we have come to a non-option, either stop the scan or describe + it to the caller and pass it by. This makes the pseudo-option + `-' mean the end of options, but does not skip over it. */ + if (temp[0] != '-' || temp[1] == '\0') + return EOF; + + /* We have found another option-ARGV-element. + Start decoding its characters. */ + nextchar = argv[sh_curopt = sh_optind] + 1; + sh_charindex = 1; + } + + /* Look at and handle the next option-character. */ + + c = *nextchar++; sh_charindex++; + temp = strchr (optstring, c); + + sh_optopt = c; + + /* Increment `sh_optind' when we start to process its last character. */ + if (nextchar == 0 || *nextchar == '\0') + { + sh_optind++; + nextchar = (char *)NULL; + } + + if (sh_badopt = (temp == NULL || c == ':')) + { + if (sh_opterr) + BADOPT (c); + + return '?'; + } + + if (temp[1] == ':') + { + if (nextchar && *nextchar) + { + /* This is an option that requires an argument. */ + sh_optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + sh_optind++; + } + else if (sh_optind == argc) + { + if (sh_opterr) + NEEDARG (c); + + sh_optopt = c; + sh_optarg = ""; /* Needed by getopts. */ + c = (optstring[0] == ':') ? ':' : '?'; + } + else + /* We already incremented `sh_optind' once; + increment it again when taking next ARGV-elt as argument. */ + sh_optarg = argv[sh_optind++]; + nextchar = (char *)NULL; + } + return c; +} + +void +sh_getopt_restore_state (argv) + char **argv; +{ + if (nextchar) + nextchar = argv[sh_curopt] + sh_charindex; +} + +#if 0 +void +sh_getopt_debug_restore_state (argv) + char **argv; +{ + if (nextchar && nextchar != argv[sh_curopt] + sh_charindex) + { + itrace("sh_getopt_debug_restore_state: resetting nextchar"); + nextchar = argv[sh_curopt] + sh_charindex; + } +} +#endif + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of `sh_getopt'. */ + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_sh_optind = 0; + + while (1) + { + int this_option_sh_optind = sh_optind ? sh_optind : 1; + + c = sh_getopt (argc, argv, "abc:d:0123456789"); + if (c == EOF) + break; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_sh_optind != 0 && digit_sh_optind != this_option_sh_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_sh_optind = this_option_sh_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", sh_optarg); + break; + + case '?': + break; + + default: + printf ("?? sh_getopt returned character code 0%o ??\n", c); + } + } + + if (sh_optind < argc) + { + printf ("non-option ARGV-elements: "); + while (sh_optind < argc) + printf ("%s ", argv[sh_optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/builtins/getopt.h b/builtins/getopt.h new file mode 100644 index 0000000..75fdec5 --- /dev/null +++ b/builtins/getopt.h @@ -0,0 +1,65 @@ +/* getopt.h - declarations for getopt. */ + +/* Copyright (C) 1989, 1990, 1991, 1992, 1993, 2008,2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* XXX THIS HAS BEEN MODIFIED FOR INCORPORATION INTO BASH XXX */ + +#ifndef _SH_GETOPT_H +#define _SH_GETOPT_H 1 + +#include "stdc.h" + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *sh_optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns EOF, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `sh_optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int sh_optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int sh_opterr; + +/* Set to an option character which was unrecognized. */ + +extern int sh_optopt; + +/* Set to 1 when an unrecognized option is encountered. */ +extern int sh_badopt; + +extern int sh_getopt __P((int, char *const *, const char *)); +extern void sh_getopt_restore_state __P((char **)); + +#endif /* _SH_GETOPT_H */ diff --git a/builtins/getopts.def b/builtins/getopts.def new file mode 100644 index 0000000..1d2a68a --- /dev/null +++ b/builtins/getopts.def @@ -0,0 +1,331 @@ +This file is getopts.def, from which is created getopts.c. +It implements the builtin "getopts" in Bash. + +Copyright (C) 1987-2004 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES getopts.c + +$BUILTIN getopts +$FUNCTION getopts_builtin +$SHORT_DOC getopts optstring name [arg] +Parse option arguments. + +Getopts is used by shell procedures to parse positional parameters +as options. + +OPTSTRING contains the option letters to be recognized; if a letter +is followed by a colon, the option is expected to have an argument, +which should be separated from it by white space. + +Each time it is invoked, getopts will place the next option in the +shell variable $name, initializing name if it does not exist, and +the index of the next argument to be processed into the shell +variable OPTIND. OPTIND is initialized to 1 each time the shell or +a shell script is invoked. When an option requires an argument, +getopts places that argument into the shell variable OPTARG. + +getopts reports errors in one of two ways. If the first character +of OPTSTRING is a colon, getopts uses silent error reporting. In +this mode, no error messages are printed. If an invalid option is +seen, getopts places the option character found into OPTARG. If a +required argument is not found, getopts places a ':' into NAME and +sets OPTARG to the option character found. If getopts is not in +silent mode, and an invalid option is seen, getopts places '?' into +NAME and unsets OPTARG. If a required argument is not found, a '?' +is placed in NAME, OPTARG is unset, and a diagnostic message is +printed. + +If the shell variable OPTERR has the value 0, getopts disables the +printing of error messages, even if the first character of +OPTSTRING is not a colon. OPTERR has the value 1 by default. + +Getopts normally parses the positional parameters ($0 - $9), but if +more arguments are given, they are parsed instead. + +Exit Status: +Returns success if an option is found; fails if the end of options is +encountered or an error occurs. +$END + +#include + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "../bashansi.h" + +#include "../shell.h" +#include "common.h" +#include "bashgetopt.h" +#include "getopt.h" + +#define G_EOF -1 +#define G_INVALID_OPT -2 +#define G_ARG_MISSING -3 + +extern char *this_command_name; + +static int getopts_bind_variable __P((char *, char *)); +static int dogetopts __P((int, char **)); + +/* getopts_reset is magic code for when OPTIND is reset. N is the + value that has just been assigned to OPTIND. */ +void +getopts_reset (newind) + int newind; +{ + sh_optind = newind; + sh_badopt = 0; +} + +static int +getopts_bind_variable (name, value) + char *name, *value; +{ + SHELL_VAR *v; + + if (legal_identifier (name)) + { + v = bind_variable (name, value, 0); + if (v && (readonly_p (v) || noassign_p (v))) + return (EX_MISCERROR); + return (v ? EXECUTION_SUCCESS : EXECUTION_FAILURE); + } + else + { + sh_invalidid (name); + return (EXECUTION_FAILURE); + } +} + +/* Error handling is now performed as specified by Posix.2, draft 11 + (identical to that of ksh-88). The special handling is enabled if + the first character of the option string is a colon; this handling + disables diagnostic messages concerning missing option arguments + and invalid option characters. The handling is as follows. + + INVALID OPTIONS: + name -> "?" + if (special_error) then + OPTARG = option character found + no error output + else + OPTARG unset + diagnostic message + fi + + MISSING OPTION ARGUMENT; + if (special_error) then + name -> ":" + OPTARG = option character found + else + name -> "?" + OPTARG unset + diagnostic message + fi + */ + +static int +dogetopts (argc, argv) + int argc; + char **argv; +{ + int ret, special_error, old_opterr, i, n; + char strval[2], numval[16]; + char *optstr; /* list of options */ + char *name; /* variable to get flag val */ + char *t; + + if (argc < 3) + { + builtin_usage (); + return (EX_USAGE); + } + + /* argv[0] is "getopts". */ + + optstr = argv[1]; + name = argv[2]; + argc -= 2; + argv += 2; + + special_error = optstr[0] == ':'; + + if (special_error) + { + old_opterr = sh_opterr; + optstr++; + sh_opterr = 0; /* suppress diagnostic messages */ + } + + if (argc > 1) + { + sh_getopt_restore_state (argv); + t = argv[0]; + argv[0] = dollar_vars[0]; + ret = sh_getopt (argc, argv, optstr); + argv[0] = t; + } + else if (rest_of_args == (WORD_LIST *)NULL) + { + for (i = 0; i < 10 && dollar_vars[i]; i++) + ; + + sh_getopt_restore_state (dollar_vars); + ret = sh_getopt (i, dollar_vars, optstr); + } + else + { + register WORD_LIST *words; + char **v; + + for (i = 0; i < 10 && dollar_vars[i]; i++) + ; + for (words = rest_of_args; words; words = words->next, i++) + ; + v = strvec_create (i + 1); + for (i = 0; i < 10 && dollar_vars[i]; i++) + v[i] = dollar_vars[i]; + for (words = rest_of_args; words; words = words->next, i++) + v[i] = words->word->word; + v[i] = (char *)NULL; + sh_getopt_restore_state (v); + ret = sh_getopt (i, v, optstr); + free (v); + } + + if (special_error) + sh_opterr = old_opterr; + + /* Set the OPTIND variable in any case, to handle "--" skipping. It's + highly unlikely that 14 digits will be too few. */ + if (sh_optind < 10) + { + numval[14] = sh_optind + '0'; + numval[15] = '\0'; + i = 14; + } + else + { + numval[i = 15] = '\0'; + n = sh_optind; + do + { + numval[--i] = (n % 10) + '0'; + } + while (n /= 10); + } + bind_variable ("OPTIND", numval + i, 0); + + /* If an error occurred, decide which one it is and set the return + code appropriately. In all cases, the option character in error + is in OPTOPT. If an invalid option was encountered, OPTARG is + NULL. If a required option argument was missing, OPTARG points + to a NULL string (that is, sh_optarg[0] == 0). */ + if (ret == '?') + { + if (sh_optarg == NULL) + ret = G_INVALID_OPT; + else if (sh_optarg[0] == '\0') + ret = G_ARG_MISSING; + } + + if (ret == G_EOF) + { + unbind_variable ("OPTARG"); + getopts_bind_variable (name, "?"); + return (EXECUTION_FAILURE); + } + + if (ret == G_INVALID_OPT) + { + /* Invalid option encountered. */ + ret = getopts_bind_variable (name, "?"); + + if (special_error) + { + strval[0] = (char)sh_optopt; + strval[1] = '\0'; + bind_variable ("OPTARG", strval, 0); + } + else + unbind_variable ("OPTARG"); + + return (ret); + } + + if (ret == G_ARG_MISSING) + { + /* Required argument missing. */ + if (special_error) + { + ret = getopts_bind_variable (name, ":"); + + strval[0] = (char)sh_optopt; + strval[1] = '\0'; + bind_variable ("OPTARG", strval, 0); + } + else + { + ret = getopts_bind_variable (name, "?"); + unbind_variable ("OPTARG"); + } + return (ret); + } + + bind_variable ("OPTARG", sh_optarg, 0); + + strval[0] = (char) ret; + strval[1] = '\0'; + return (getopts_bind_variable (name, strval)); +} + +/* The getopts builtin. Build an argv, and call dogetopts with it. */ +int +getopts_builtin (list) + WORD_LIST *list; +{ + char **av; + int ac, ret; + + if (list == 0) + { + builtin_usage (); + return EX_USAGE; + } + + reset_internal_getopt (); + if (internal_getopt (list, "") != -1) + { + builtin_usage (); + return (EX_USAGE); + } + list = loptend; + + av = make_builtin_argv (list, &ac); + ret = dogetopts (ac, av); + free ((char *)av); + + return (ret); +} diff --git a/builtins/hash.def b/builtins/hash.def new file mode 100644 index 0000000..85ef364 --- /dev/null +++ b/builtins/hash.def @@ -0,0 +1,283 @@ +This file is hash.def, from which is created hash.c. +It implements the builtin "hash" in Bash. + +Copyright (C) 1987-2013 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES hash.c + +$BUILTIN hash +$FUNCTION hash_builtin +$SHORT_DOC hash [-lr] [-p pathname] [-dt] [name ...] +Remember or display program locations. + +Determine and remember the full pathname of each command NAME. If +no arguments are given, information about remembered commands is displayed. + +Options: + -d forget the remembered location of each NAME + -l display in a format that may be reused as input + -p pathname use PATHNAME as the full pathname of NAME + -r forget all remembered locations + -t print the remembered location of each NAME, preceding + each location with the corresponding NAME if multiple + NAMEs are given +Arguments: + NAME Each NAME is searched for in $PATH and added to the list + of remembered commands. + +Exit Status: +Returns success unless NAME is not found or an invalid option is given. +$END + +#include + +#include + +#include "../bashtypes.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include + +#include "../bashansi.h" +#include "../bashintl.h" + +#include "../shell.h" +#include "../builtins.h" +#include "../flags.h" +#include "../findcmd.h" +#include "../hashcmd.h" +#include "common.h" +#include "bashgetopt.h" + +extern int posixly_correct; +extern int dot_found_in_search; +extern char *this_command_name; + +static int add_hashed_command __P((char *, int)); +static int print_hash_info __P((BUCKET_CONTENTS *)); +static int print_portable_hash_info __P((BUCKET_CONTENTS *)); +static int print_hashed_commands __P((int)); +static int list_hashed_filename_targets __P((WORD_LIST *, int)); + +/* Print statistics on the current state of hashed commands. If LIST is + not empty, then rehash (or hash in the first place) the specified + commands. */ +int +hash_builtin (list) + WORD_LIST *list; +{ + int expunge_hash_table, list_targets, list_portably, delete, opt; + char *w, *pathname; + + if (hashing_enabled == 0) + { + builtin_error (_("hashing disabled")); + return (EXECUTION_FAILURE); + } + + expunge_hash_table = list_targets = list_portably = delete = 0; + pathname = (char *)NULL; + reset_internal_getopt (); + while ((opt = internal_getopt (list, "dlp:rt")) != -1) + { + switch (opt) + { + case 'd': + delete = 1; + break; + case 'l': + list_portably = 1; + break; + case 'p': + pathname = list_optarg; + break; + case 'r': + expunge_hash_table = 1; + break; + case 't': + list_targets = 1; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + /* hash -t requires at least one argument. */ + if (list == 0 && list_targets) + { + sh_needarg ("-t"); + return (EXECUTION_FAILURE); + } + + /* We want hash -r to be silent, but hash -- to print hashing info, so + we test expunge_hash_table. */ + if (list == 0 && expunge_hash_table == 0) + { + opt = print_hashed_commands (list_portably); + if (opt == 0 && posixly_correct == 0) + printf (_("%s: hash table empty\n"), this_command_name); + + return (EXECUTION_SUCCESS); + } + + if (expunge_hash_table) + phash_flush (); + + /* If someone runs `hash -r -t xyz' he will be disappointed. */ + if (list_targets) + return (list_hashed_filename_targets (list, list_portably)); + +#if defined (RESTRICTED_SHELL) + if (restricted && pathname && strchr (pathname, '/')) + { + sh_restricted (pathname); + return (EXECUTION_FAILURE); + } +#endif + + for (opt = EXECUTION_SUCCESS; list; list = list->next) + { + /* Add, remove or rehash the specified commands. */ + w = list->word->word; + if (absolute_program (w)) + continue; + else if (pathname) + { + if (is_directory (pathname)) + { +#ifdef EISDIR + builtin_error ("%s: %s", pathname, strerror (EISDIR)); +#else + builtin_error (_("%s: is a directory"), pathname); +#endif + opt = EXECUTION_FAILURE; + } + else + phash_insert (w, pathname, 0, 0); + } + else if (delete) + { + if (phash_remove (w)) + { + sh_notfound (w); + opt = EXECUTION_FAILURE; + } + } + else if (add_hashed_command (w, 0)) + opt = EXECUTION_FAILURE; + } + + fflush (stdout); + return (opt); +} + +static int +add_hashed_command (w, quiet) + char *w; + int quiet; +{ + int rv; + char *full_path; + + rv = 0; + if (find_function (w) == 0 && find_shell_builtin (w) == 0) + { + phash_remove (w); + full_path = find_user_command (w); + if (full_path && executable_file (full_path)) + phash_insert (w, full_path, dot_found_in_search, 0); + else + { + if (quiet == 0) + sh_notfound (w); + rv++; + } + FREE (full_path); + } + return (rv); +} + +/* Print information about current hashed info. */ +static int +print_hash_info (item) + BUCKET_CONTENTS *item; +{ + printf ("%4d\t%s\n", item->times_found, pathdata(item)->path); + return 0; +} + +static int +print_portable_hash_info (item) + BUCKET_CONTENTS *item; +{ + printf ("builtin hash -p %s %s\n", pathdata(item)->path, item->key); + return 0; +} + +static int +print_hashed_commands (fmt) + int fmt; +{ + if (hashed_filenames == 0 || HASH_ENTRIES (hashed_filenames) == 0) + return (0); + + if (fmt == 0) + printf (_("hits\tcommand\n")); + hash_walk (hashed_filenames, fmt ? print_portable_hash_info : print_hash_info); + return (1); +} + +static int +list_hashed_filename_targets (list, fmt) + WORD_LIST *list; + int fmt; +{ + int all_found, multiple; + char *target; + WORD_LIST *l; + + all_found = 1; + multiple = list->next != 0; + + for (l = list; l; l = l->next) + { + target = phash_search (l->word->word); + if (target == 0) + { + all_found = 0; + sh_notfound (l->word->word); + continue; + } + if (fmt) + printf ("builtin hash -p %s %s\n", target, l->word->word); + else + { + if (multiple) + printf ("%s\t", l->word->word); + printf ("%s\n", target); + } + free (target); + } + + return (all_found ? EXECUTION_SUCCESS : EXECUTION_FAILURE); +} diff --git a/builtins/help.def b/builtins/help.def new file mode 100644 index 0000000..1894f17 --- /dev/null +++ b/builtins/help.def @@ -0,0 +1,517 @@ +This file is help.def, from which is created help.c. +It implements the builtin "help" in Bash. + +Copyright (C) 1987-2013 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES help.c + +$BUILTIN help +$FUNCTION help_builtin +$DEPENDS_ON HELP_BUILTIN +$SHORT_DOC help [-dms] [pattern ...] +Display information about builtin commands. + +Displays brief summaries of builtin commands. If PATTERN is +specified, gives detailed help on all commands matching PATTERN, +otherwise the list of help topics is printed. + +Options: + -d output short description for each topic + -m display usage in pseudo-manpage format + -s output only a short usage synopsis for each topic matching + PATTERN + +Arguments: + PATTERN Pattern specifiying a help topic + +Exit Status: +Returns success unless PATTERN is not found or an invalid option is given. +$END + +#include + +#if defined (HELP_BUILTIN) +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include + +#include + +#include "../bashintl.h" + +#include "../shell.h" +#include "../builtins.h" +#include "../pathexp.h" +#include "common.h" +#include "bashgetopt.h" + +#include +#include + +#ifndef errno +extern int errno; +#endif + +extern const char * const bash_copyright; +extern const char * const bash_license; + +static void show_builtin_command_help __P((void)); +static int open_helpfile __P((char *)); +static void show_desc __P((char *, int)); +static void show_manpage __P((char *, int)); +static void show_longdoc __P((int)); + +/* Print out a list of the known functions in the shell, and what they do. + If LIST is supplied, print out the list which matches for each pattern + specified. */ +int +help_builtin (list) + WORD_LIST *list; +{ + register int i; + char *pattern, *name; + int plen, match_found, sflag, dflag, mflag, m, pass, this_found; + + dflag = sflag = mflag = 0; + reset_internal_getopt (); + while ((i = internal_getopt (list, "dms")) != -1) + { + switch (i) + { + case 'd': + dflag = 1; + break; + case 'm': + mflag = 1; + break; + case 's': + sflag = 1; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + if (list == 0) + { + show_shell_version (0); + show_builtin_command_help (); + return (EXECUTION_SUCCESS); + } + + /* We should consider making `help bash' do something. */ + + if (glob_pattern_p (list->word->word)) + { + printf (ngettext ("Shell commands matching keyword `", "Shell commands matching keywords `", (list->next ? 2 : 1))); + print_word_list (list, ", "); + printf ("'\n\n"); + } + + for (match_found = 0, pattern = ""; list; list = list->next) + { + pattern = list->word->word; + plen = strlen (pattern); + + for (pass = 1, this_found = 0; pass < 3; pass++) + { + for (i = 0; name = shell_builtins[i].name; i++) + { + QUIT; + + /* First pass: look for exact string or pattern matches. + Second pass: look for prefix matches like bash-4.2 */ + if (pass == 1) + m = (strcmp (pattern, name) == 0) || + (strmatch (pattern, name, FNMATCH_EXTFLAG) != FNM_NOMATCH); + else + m = strncmp (pattern, name, plen) == 0; + + if (m) + { + this_found = 1; + match_found++; + if (dflag) + { + show_desc (name, i); + continue; + } + else if (mflag) + { + show_manpage (name, i); + continue; + } + + printf ("%s: %s\n", name, _(shell_builtins[i].short_doc)); + + if (sflag == 0) + show_longdoc (i); + } + } + if (pass == 1 && this_found == 1) + break; + } + } + + if (match_found == 0) + { + builtin_error (_("no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'."), pattern, pattern, pattern); + return (EXECUTION_FAILURE); + } + + fflush (stdout); + return (EXECUTION_SUCCESS); +} + +static int +open_helpfile (name) + char *name; +{ + int fd; + + fd = open (name, O_RDONLY); + if (fd == -1) + { + builtin_error (_("%s: cannot open: %s"), name, strerror (errno)); + return -1; + } + return fd; +} + +/* By convention, enforced by mkbuiltins.c, if separate help files are being + used, the long_doc array contains one string -- the full pathname of the + help file for this builtin. */ +static void +show_longdoc (i) + int i; +{ + register int j; + char * const *doc; + int fd; + + doc = shell_builtins[i].long_doc; + + if (doc && doc[0] && *doc[0] == '/' && doc[1] == (char *)NULL) + { + fd = open_helpfile (doc[0]); + if (fd < 0) + return; + zcatfd (fd, 1, doc[0]); + close (fd); + } + else if (doc) + for (j = 0; doc[j]; j++) + printf ("%*s%s\n", BASE_INDENT, " ", _(doc[j])); +} + +static void +show_desc (name, i) + char *name; + int i; +{ + register int j; + char **doc, *line; + int fd, usefile; + + doc = (char **)shell_builtins[i].long_doc; + + usefile = (doc && doc[0] && *doc[0] == '/' && doc[1] == (char *)NULL); + if (usefile) + { + fd = open_helpfile (doc[0]); + if (fd < 0) + return; + zmapfd (fd, &line, doc[0]); + close (fd); + } + else + line = doc ? doc[0] : (char *)NULL; + + printf ("%s - ", name); + for (j = 0; line && line[j]; j++) + { + putchar (line[j]); + if (line[j] == '\n') + break; + } + + fflush (stdout); + + if (usefile) + free (line); +} + +/* Print builtin help in pseudo-manpage format. */ +static void +show_manpage (name, i) + char *name; + int i; +{ + register int j; + char **doc, *line; + int fd, usefile; + + doc = (char **)shell_builtins[i].long_doc; + + usefile = (doc && doc[0] && *doc[0] == '/' && doc[1] == (char *)NULL); + if (usefile) + { + fd = open_helpfile (doc[0]); + if (fd < 0) + return; + zmapfd (fd, &line, doc[0]); + close (fd); + } + else + line = doc ? _(doc[0]) : (char *)NULL; + + /* NAME */ + printf ("NAME\n"); + printf ("%*s%s - ", BASE_INDENT, " ", name); + for (j = 0; line && line[j]; j++) + { + putchar (line[j]); + if (line[j] == '\n') + break; + } + printf ("\n"); + + /* SYNOPSIS */ + printf ("SYNOPSIS\n"); + printf ("%*s%s\n\n", BASE_INDENT, " ", _(shell_builtins[i].short_doc)); + + /* DESCRIPTION */ + printf ("DESCRIPTION\n"); + if (usefile == 0) + { + for (j = 0; doc[j]; j++) + printf ("%*s%s\n", BASE_INDENT, " ", _(doc[j])); + } + else + { + for (j = 0; line && line[j]; j++) + { + putchar (line[j]); + if (line[j] == '\n') + printf ("%*s", BASE_INDENT, " "); + } + } + putchar ('\n'); + + /* SEE ALSO */ + printf ("SEE ALSO\n"); + printf ("%*sbash(1)\n\n", BASE_INDENT, " "); + + /* IMPLEMENTATION */ + printf ("IMPLEMENTATION\n"); + printf ("%*s", BASE_INDENT, " "); + show_shell_version (0); + printf ("%*s", BASE_INDENT, " "); + printf ("%s\n", _(bash_copyright)); + printf ("%*s", BASE_INDENT, " "); + printf ("%s\n", _(bash_license)); + + fflush (stdout); + if (usefile) + free (line); +} + +static void +dispcolumn (i, buf, bufsize, width, height) + int i; + char *buf; + size_t bufsize; + int width, height; +{ + int j; + int displen; + char *helpdoc; + + /* first column */ + helpdoc = _(shell_builtins[i].short_doc); + + buf[0] = (shell_builtins[i].flags & BUILTIN_ENABLED) ? ' ' : '*'; + strncpy (buf + 1, helpdoc, width - 2); + buf[width - 2] = '>'; /* indicate truncation */ + buf[width - 1] = '\0'; + printf ("%s", buf); + if (((i << 1) >= num_shell_builtins) || (i+height >= num_shell_builtins)) + { + printf ("\n"); + return; + } + + displen = strlen (buf); + /* two spaces */ + for (j = displen; j < width; j++) + putc (' ', stdout); + + /* second column */ + helpdoc = _(shell_builtins[i+height].short_doc); + + buf[0] = (shell_builtins[i+height].flags & BUILTIN_ENABLED) ? ' ' : '*'; + strncpy (buf + 1, helpdoc, width - 3); + buf[width - 3] = '>'; /* indicate truncation */ + buf[width - 2] = '\0'; + + printf ("%s\n", buf); +} + +#if defined (HANDLE_MULTIBYTE) +static void +wdispcolumn (i, buf, bufsize, width, height) + int i; + char *buf; + size_t bufsize; + int width, height; +{ + int j; + int displen; + char *helpdoc; + wchar_t *wcstr; + size_t slen, n; + int wclen; + + /* first column */ + helpdoc = _(shell_builtins[i].short_doc); + + wcstr = 0; + slen = mbstowcs ((wchar_t *)0, helpdoc, 0); + if (slen == -1) + { + dispcolumn (i, buf, bufsize, width, height); + return; + } + + /* No bigger than the passed max width */ + if (slen >= width) + slen = width - 2; + wcstr = (wchar_t *)xmalloc (sizeof (wchar_t) * (width + 2)); + n = mbstowcs (wcstr+1, helpdoc, slen + 1); + wcstr[n+1] = L'\0'; + + /* Turn tabs and newlines into spaces for column display, since wcwidth + returns -1 for them */ + for (j = 1; j < n; j++) + if (wcstr[j] == L'\n' || wcstr[j] == L'\t') + wcstr[j] = L' '; + + displen = wcsnwidth (wcstr+1, slen, width - 2) + 1; /* +1 for ' ' or '*' */ + + wcstr[0] = (shell_builtins[i].flags & BUILTIN_ENABLED) ? L' ' : L'*'; + + /* This assumes each wide char takes up one column position when displayed */ + wcstr[width - 2] = L'>'; /* indicate truncation */ + wcstr[width - 1] = L'\0'; + + printf ("%ls", wcstr); + if (((i << 1) >= num_shell_builtins) || (i+height >= num_shell_builtins)) + { + printf ("\n"); + return; + } + + /* at least one space */ + for (j = displen; j < width; j++) + putc (' ', stdout); + + /* second column */ + helpdoc = _(shell_builtins[i+height].short_doc); + slen = mbstowcs ((wchar_t *)0, helpdoc, 0); + if (slen == -1) + { + /* for now */ + printf ("%c%s\n", (shell_builtins[i+height].flags & BUILTIN_ENABLED) ? ' ' : '*', helpdoc); + return; + } + + /* Reuse wcstr since it is already width wide chars long */ + if (slen >= width) + slen = width - 2; + n = mbstowcs (wcstr+1, helpdoc, slen + 1); + wcstr[n+1] = L'\0'; /* make sure null-terminated */ + + /* Turn tabs and newlines into spaces for column display */ + for (j = 1; j < n; j++) + if (wcstr[j] == L'\n' || wcstr[j] == L'\t') + wcstr[j] = L' '; + + displen = wcsnwidth (wcstr+1, slen, width - 2); + + wcstr[0] = (shell_builtins[i+height].flags & BUILTIN_ENABLED) ? L' ' : L'*'; + + /* This assumes each wide char takes up one column position when displayed */ + wcstr[width - 3] = L'>'; /* indicate truncation */ + wcstr[width - 2] = L'\0'; + + printf ("%ls\n", wcstr); + + free (wcstr); +} +#endif /* HANDLE_MULTIBYTE */ + +static void +show_builtin_command_help () +{ + int i, j; + int height, width; + char *t, blurb[128]; + + printf ( +_("These shell commands are defined internally. Type `help' to see this list.\n\ +Type `help name' to find out more about the function `name'.\n\ +Use `info bash' to find out more about the shell in general.\n\ +Use `man -k' or `info' to find out more about commands not in this list.\n\ +\n\ +A star (*) next to a name means that the command is disabled.\n\ +\n")); + + t = get_string_value ("COLUMNS"); + width = (t && *t) ? atoi (t) : 80; + if (width <= 0) + width = 80; + + width /= 2; + if (width > sizeof (blurb)) + width = sizeof (blurb); + if (width <= 3) + width = 40; + height = (num_shell_builtins + 1) / 2; /* number of rows */ + + for (i = 0; i < height; i++) + { + QUIT; + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1) + wdispcolumn (i, blurb, sizeof (blurb), width, height); + else +#endif + dispcolumn (i, blurb, sizeof (blurb), width, height); + } +} +#endif /* HELP_BUILTIN */ diff --git a/builtins/history.def b/builtins/history.def new file mode 100644 index 0000000..4cf7308 --- /dev/null +++ b/builtins/history.def @@ -0,0 +1,381 @@ +This file is history.def, from which is created history.c. +It implements the builtin "history" in Bash. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES history.c + +$BUILTIN history +$FUNCTION history_builtin +$DEPENDS_ON HISTORY +$SHORT_DOC history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...] +Display or manipulate the history list. + +Display the history list with line numbers, prefixing each modified +entry with a `*'. An argument of N lists only the last N entries. + +Options: + -c clear the history list by deleting all of the entries + -d offset delete the history entry at offset OFFSET. + + -a append history lines from this session to the history file + -n read all history lines not already read from the history file + -r read the history file and append the contents to the history + list + -w write the current history to the history file + and append them to the history list + + -p perform history expansion on each ARG and display the result + without storing it in the history list + -s append the ARGs to the history list as a single entry + +If FILENAME is given, it is used as the history file. Otherwise, +if $HISTFILE has a value, that is used, else ~/.bash_history. + +If the $HISTTIMEFORMAT variable is set and not null, its value is used +as a format string for strftime(3) to print the time stamp associated +with each displayed history entry. No time stamps are printed otherwise. + +Exit Status: +Returns success unless an invalid option is given or an error occurs. +$END + +#include + +#if defined (HISTORY) +#include "../bashtypes.h" +#if ! defined(_MINIX) && defined (HAVE_SYS_FILE_H) +# include +#endif +#include "posixstat.h" +#include "filecntl.h" +#include +#include +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "../bashansi.h" +#include "../bashintl.h" + +#include "../shell.h" +#include "../bashhist.h" +#include +#include "bashgetopt.h" +#include "common.h" + +#if !defined (errno) +extern int errno; +#endif + +extern int current_command_line_count; +extern int force_append_history; /* shopt -s histappend */ + +static char *histtime __P((HIST_ENTRY *, const char *)); +static int display_history __P((WORD_LIST *)); +static void push_history __P((WORD_LIST *)); +static int expand_and_print_history __P((WORD_LIST *)); + +#define AFLAG 0x01 +#define RFLAG 0x02 +#define WFLAG 0x04 +#define NFLAG 0x08 +#define SFLAG 0x10 +#define PFLAG 0x20 +#define CFLAG 0x40 +#define DFLAG 0x80 + +int +history_builtin (list) + WORD_LIST *list; +{ + int flags, opt, result, old_history_lines, obase; + char *filename, *delete_arg; + intmax_t delete_offset; + + flags = 0; + reset_internal_getopt (); + while ((opt = internal_getopt (list, "acd:npsrw")) != -1) + { + switch (opt) + { + case 'a': + flags |= AFLAG; + break; + case 'c': + flags |= CFLAG; + break; + case 'n': + flags |= NFLAG; + break; + case 'r': + flags |= RFLAG; + break; + case 'w': + flags |= WFLAG; + break; + case 's': + flags |= SFLAG; + break; + case 'd': + flags |= DFLAG; + delete_arg = list_optarg; + break; + case 'p': +#if defined (BANG_HISTORY) + flags |= PFLAG; +#endif + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + opt = flags & (AFLAG|RFLAG|WFLAG|NFLAG); + if (opt && opt != AFLAG && opt != RFLAG && opt != WFLAG && opt != NFLAG) + { + builtin_error (_("cannot use more than one of -anrw")); + return (EXECUTION_FAILURE); + } + + /* clear the history, but allow other arguments to add to it again. */ + if (flags & CFLAG) + { + bash_clear_history (); + if (list == 0) + return (EXECUTION_SUCCESS); + } + + if (flags & SFLAG) + { + if (list) + push_history (list); + return (EXECUTION_SUCCESS); + } +#if defined (BANG_HISTORY) + else if (flags & PFLAG) + { + if (list) + return (expand_and_print_history (list)); + return (sh_chkwrite (EXECUTION_SUCCESS)); + } +#endif + else if (flags & DFLAG) + { + if ((legal_number (delete_arg, &delete_offset) == 0) + || (delete_offset < history_base) + || (delete_offset > (history_base + history_length))) + { + sh_erange (delete_arg, _("history position")); + return (EXECUTION_FAILURE); + } + opt = delete_offset; + result = bash_delete_histent (opt - history_base); + /* Since remove_history changes history_length, this can happen if + we delete the last history entry. */ + if (where_history () > history_length) + history_set_pos (history_length); + return (result ? EXECUTION_SUCCESS : EXECUTION_FAILURE); + } + else if ((flags & (AFLAG|RFLAG|NFLAG|WFLAG|CFLAG)) == 0) + { + result = display_history (list); + return (sh_chkwrite (result)); + } + + filename = list ? list->word->word : get_string_value ("HISTFILE"); + result = EXECUTION_SUCCESS; + + if (flags & AFLAG) /* Append session's history to file. */ + result = maybe_append_history (filename); + else if (flags & WFLAG) /* Write entire history. */ + result = write_history (filename); + else if (flags & RFLAG) /* Read entire file. */ + result = read_history (filename); + else if (flags & NFLAG) /* Read `new' history from file. */ + { + /* Read all of the lines in the file that we haven't already read. */ + old_history_lines = history_lines_in_file; + obase = history_base; + + using_history (); + result = read_history_range (filename, history_lines_in_file, -1); + using_history (); + + history_lines_in_file = where_history (); + + /* If we're rewriting the history file at shell exit rather than just + appending the lines from this session to it, the question is whether + we reset history_lines_this_session to 0, losing any history entries + we had before we read the new entries from the history file, or + whether we count the new entries we just read from the file as + history lines added during this session. + Right now, we do the latter. This will cause these history entries + to be written to the history file along with any intermediate entries + we add when we do a `history -a', but the alternative is losing + them altogether. */ + if (force_append_history == 0) + history_lines_this_session += history_lines_in_file - old_history_lines + + history_base - obase; + } + + return (result ? EXECUTION_FAILURE : EXECUTION_SUCCESS); +} + +/* Accessors for HIST_ENTRY lists that are called HLIST. */ +#define histline(i) (hlist[(i)]->line) +#define histdata(i) (hlist[(i)]->data) + +static char * +histtime (hlist, histtimefmt) + HIST_ENTRY *hlist; + const char *histtimefmt; +{ + static char timestr[128]; + time_t t; + + t = history_get_time (hlist); + if (t) + strftime (timestr, sizeof (timestr), histtimefmt, localtime (&t)); + else + strcpy (timestr, "??"); + return timestr; +} + +static int +display_history (list) + WORD_LIST *list; +{ + register int i; + intmax_t limit; + HIST_ENTRY **hlist; + char *histtimefmt, *timestr; + + if (list) + { + if (get_numeric_arg (list, 0, &limit) == 0) + return (EXECUTION_FAILURE); + + if (limit < 0) + limit = -limit; + } + else + limit = -1; + + hlist = history_list (); + + if (hlist) + { + for (i = 0; hlist[i]; i++) + ; + + if (0 <= limit && limit < i) + i -= limit; + else + i = 0; + + histtimefmt = get_string_value ("HISTTIMEFORMAT"); + + while (hlist[i]) + { + QUIT; + + timestr = (histtimefmt && *histtimefmt) ? histtime (hlist[i], histtimefmt) : (char *)NULL; + printf ("%5d%c %s%s\n", i + history_base, + histdata(i) ? '*' : ' ', + ((timestr && *timestr) ? timestr : ""), + histline(i)); + i++; + } + } + + return (EXECUTION_SUCCESS); +} + +/* Remove the last entry in the history list and add each argument in + LIST to the history. */ +static void +push_history (list) + WORD_LIST *list; +{ + char *s; + + /* Delete the last history entry if it was a single entry added to the + history list (generally the `history -s' itself), or if `history -s' + is being used in a compound command and the compound command was + added to the history as a single element (command-oriented history). + If you don't want history -s to remove the compound command from the + history, change #if 0 to #if 1 below. */ +#if 0 + if (remember_on_history && hist_last_line_pushed == 0 && + hist_last_line_added && bash_delete_last_history () == 0) +#else + if (remember_on_history && hist_last_line_pushed == 0 && + (hist_last_line_added || + (current_command_line_count > 0 && current_command_first_line_saved && command_oriented_history)) + && bash_delete_last_history () == 0) +#endif + return; + + s = string_list (list); + /* Call check_add_history with FORCE set to 1 to skip the check against + current_command_line_count. If history -s is used in a compound + command, the above code will delete the compound command's history + entry and this call will add the line to the history as a separate + entry. Without FORCE=1, if current_command_line_count were > 1, the + line would be appended to the entry before the just-deleted entry. */ + check_add_history (s, 1); /* obeys HISTCONTROL, HISTIGNORE */ + + hist_last_line_pushed = 1; /* XXX */ + free (s); +} + +#if defined (BANG_HISTORY) +static int +expand_and_print_history (list) + WORD_LIST *list; +{ + char *s; + int r, result; + + if (hist_last_line_pushed == 0 && hist_last_line_added && bash_delete_last_history () == 0) + return EXECUTION_FAILURE; + result = EXECUTION_SUCCESS; + while (list) + { + r = history_expand (list->word->word, &s); + if (r < 0) + { + builtin_error (_("%s: history expansion failed"), list->word->word); + result = EXECUTION_FAILURE; + } + else + { + fputs (s, stdout); + putchar ('\n'); + } + FREE (s); + list = list->next; + } + fflush (stdout); + return result; +} +#endif /* BANG_HISTORY */ +#endif /* HISTORY */ diff --git a/builtins/inlib.def b/builtins/inlib.def new file mode 100644 index 0000000..c4faf0d --- /dev/null +++ b/builtins/inlib.def @@ -0,0 +1,80 @@ +This file is inlib.def, from which is created inlib.c. +It implements the Apollo-specific builtin "inlib" in Bash. + +Copyright (C) 1987-2002 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES inlib.c +#include + +#include +#include "../shell.h" + +$BUILTIN inlib +$FUNCTION inlib_builtin +$DEPENDS_ON apollo +$SHORT_DOC inlib pathname [pathname...] +Install user-supplied library. + +Install a user-supplied library specified by pathname in the current +shell process. The library is used to resolve external references +in programs and libraries loaded after its installation. Note +that the library is not loaded into the address space unless it is +needed to resolve an external reference. The list of inlibed +libraries is passed to all children of the current shell. + +Exit Status: +Returns success unless PATHNAME is not found or an error occurs. +$END + +#if defined (apollo) + +#include +#include + +inlib_builtin (list) + WORD_LIST *list; +{ + status_$t status; + int return_value; + short len; + + if (!list) + { + builtin_usage (); + return (EX_USAGE); + } + + return_value = EXECUTION_SUCCESS; + + while (list) + { + len = (short)strlen (list->word->word); + loader_$inlib (list->word->word, len, &status); + + if (status.all != status_$ok) + { + builtin_error (_("%s: inlib failed"), list->word->word); + return_value = EXECUTION_FAILURE; + } + + list = list->next; + } + + return (return_value); +} +#endif /* apollo */ diff --git a/builtins/jobs.def b/builtins/jobs.def new file mode 100644 index 0000000..47da58e --- /dev/null +++ b/builtins/jobs.def @@ -0,0 +1,298 @@ +This file is jobs.def, from which is created jobs.c. +It implements the builtins "jobs" and "disown" in Bash. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES jobs.c + +$BUILTIN jobs +$FUNCTION jobs_builtin +$DEPENDS_ON JOB_CONTROL +$SHORT_DOC jobs [-lnprs] [jobspec ...] or jobs -x command [args] +Display status of jobs. + +Lists the active jobs. JOBSPEC restricts output to that job. +Without options, the status of all active jobs is displayed. + +Options: + -l lists process IDs in addition to the normal information + -n lists only processes that have changed status since the last + notification + -p lists process IDs only + -r restrict output to running jobs + -s restrict output to stopped jobs + +If -x is supplied, COMMAND is run after all job specifications that +appear in ARGS have been replaced with the process ID of that job's +process group leader. + +Exit Status: +Returns success unless an invalid option is given or an error occurs. +If -x is used, returns the exit status of COMMAND. +$END + +#include + +#if defined (JOB_CONTROL) +#include "../bashtypes.h" +#include +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "../bashansi.h" +#include "../bashintl.h" + +#include "../shell.h" +#include "../jobs.h" +#include "../execute_cmd.h" +#include "bashgetopt.h" +#include "common.h" + +#define JSTATE_ANY 0x0 +#define JSTATE_RUNNING 0x1 +#define JSTATE_STOPPED 0x2 + +static int execute_list_with_replacements __P((WORD_LIST *)); + +/* The `jobs' command. Prints outs a list of active jobs. If the + argument `-l' is given, then the process id's are printed also. + If the argument `-p' is given, print the process group leader's + pid only. If `-n' is given, only processes that have changed + status since the last notification are printed. If -x is given, + replace all job specs with the pid of the appropriate process + group leader and execute the command. The -r and -s options mean + to print info about running and stopped jobs only, respectively. */ +int +jobs_builtin (list) + WORD_LIST *list; +{ + int form, execute, state, opt, any_failed, job; + sigset_t set, oset; + + execute = any_failed = 0; + form = JLIST_STANDARD; + state = JSTATE_ANY; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "lpnxrs")) != -1) + { + switch (opt) + { + case 'l': + form = JLIST_LONG; + break; + case 'p': + form = JLIST_PID_ONLY; + break; + case 'n': + form = JLIST_CHANGED_ONLY; + break; + case 'x': + if (form != JLIST_STANDARD) + { + builtin_error (_("no other options allowed with `-x'")); + return (EXECUTION_FAILURE); + } + execute++; + break; + case 'r': + state = JSTATE_RUNNING; + break; + case 's': + state = JSTATE_STOPPED; + break; + + default: + builtin_usage (); + return (EX_USAGE); + } + } + + list = loptend; + + if (execute) + return (execute_list_with_replacements (list)); + + if (!list) + { + switch (state) + { + case JSTATE_ANY: + list_all_jobs (form); + break; + case JSTATE_RUNNING: + list_running_jobs (form); + break; + case JSTATE_STOPPED: + list_stopped_jobs (form); + break; + } + return (EXECUTION_SUCCESS); + } + + while (list) + { + BLOCK_CHILD (set, oset); + job = get_job_spec (list); + + if ((job == NO_JOB) || jobs == 0 || get_job_by_jid (job) == 0) + { + sh_badjob (list->word->word); + any_failed++; + } + else if (job != DUP_JOB) + list_one_job ((JOB *)NULL, form, 0, job); + + UNBLOCK_CHILD (oset); + list = list->next; + } + return (any_failed ? EXECUTION_FAILURE : EXECUTION_SUCCESS); +} + +static int +execute_list_with_replacements (list) + WORD_LIST *list; +{ + register WORD_LIST *l; + int job, result; + COMMAND *command; + JOB *j; + + /* First do the replacement of job specifications with pids. */ + for (l = list; l; l = l->next) + { + if (l->word->word[0] == '%') /* we have a winner */ + { + job = get_job_spec (l); + + /* A bad job spec is not really a job spec! Pass it through. */ + if (INVALID_JOB (job)) + continue; + + j = get_job_by_jid (job); + free (l->word->word); + l->word->word = itos (j->pgrp); + } + } + + /* Next make a new simple command and execute it. */ + begin_unwind_frame ("jobs_builtin"); + + command = make_bare_simple_command (); + command->value.Simple->words = copy_word_list (list); + command->value.Simple->redirects = (REDIRECT *)NULL; + command->flags |= CMD_INHIBIT_EXPANSION; + command->value.Simple->flags |= CMD_INHIBIT_EXPANSION; + + add_unwind_protect (dispose_command, command); + result = execute_command (command); + dispose_command (command); + + discard_unwind_frame ("jobs_builtin"); + return (result); +} +#endif /* JOB_CONTROL */ + +$BUILTIN disown +$FUNCTION disown_builtin +$DEPENDS_ON JOB_CONTROL +$SHORT_DOC disown [-h] [-ar] [jobspec ...] +Remove jobs from current shell. + +Removes each JOBSPEC argument from the table of active jobs. Without +any JOBSPECs, the shell uses its notion of the current job. + +Options: + -a remove all jobs if JOBSPEC is not supplied + -h mark each JOBSPEC so that SIGHUP is not sent to the job if the + shell receives a SIGHUP + -r remove only running jobs + +Exit Status: +Returns success unless an invalid option or JOBSPEC is given. +$END + +#if defined (JOB_CONTROL) +int +disown_builtin (list) + WORD_LIST *list; +{ + int opt, job, retval, nohup_only, running_jobs, all_jobs; + sigset_t set, oset; + intmax_t pid_value; + + nohup_only = running_jobs = all_jobs = 0; + reset_internal_getopt (); + while ((opt = internal_getopt (list, "ahr")) != -1) + { + switch (opt) + { + case 'a': + all_jobs = 1; + break; + case 'h': + nohup_only = 1; + break; + case 'r': + running_jobs = 1; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + retval = EXECUTION_SUCCESS; + + /* `disown -a' or `disown -r' */ + if (list == 0 && (all_jobs || running_jobs)) + { + if (nohup_only) + nohup_all_jobs (running_jobs); + else + delete_all_jobs (running_jobs); + return (EXECUTION_SUCCESS); + } + + do + { + BLOCK_CHILD (set, oset); + job = (list && legal_number (list->word->word, &pid_value) && pid_value == (pid_t) pid_value) + ? get_job_by_pid ((pid_t) pid_value, 0) + : get_job_spec (list); + + if (job == NO_JOB || jobs == 0 || INVALID_JOB (job)) + { + sh_badjob (list ? list->word->word : _("current")); + retval = EXECUTION_FAILURE; + } + else if (nohup_only) + nohup_job (job); + else + delete_job (job, 1); + UNBLOCK_CHILD (oset); + + if (list) + list = list->next; + } + while (list); + + return (retval); +} +#endif /* JOB_CONTROL */ diff --git a/builtins/kill.def b/builtins/kill.def new file mode 100644 index 0000000..2e68f03 --- /dev/null +++ b/builtins/kill.def @@ -0,0 +1,265 @@ +This file is kill.def, from which is created kill.c. +It implements the builtin "kill" in Bash. + +Copyright (C) 1987-2010 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES kill.c + +$BUILTIN kill +$FUNCTION kill_builtin +$SHORT_DOC kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec] +Send a signal to a job. + +Send the processes identified by PID or JOBSPEC the signal named by +SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then +SIGTERM is assumed. + +Options: + -s sig SIG is a signal name + -n sig SIG is a signal number + -l list the signal names; if arguments follow `-l' they are + assumed to be signal numbers for which names should be listed + +Kill is a shell builtin for two reasons: it allows job IDs to be used +instead of process IDs, and allows processes to be killed if the limit +on processes that you can create is reached. + +Exit Status: +Returns success unless an invalid option is given or an error occurs. +$END + +#include + +#include +#include +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "../bashansi.h" +#include "../bashintl.h" + +#include + +#include "../shell.h" +#include "../trap.h" +#include "../jobs.h" +#include "common.h" + +/* Not all systems declare ERRNO in errno.h... and some systems #define it! */ +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +extern int posixly_correct; + +static void kill_error __P((pid_t, int)); + +#if !defined (CONTINUE_AFTER_KILL_ERROR) +# define CONTINUE_OR_FAIL return (EXECUTION_FAILURE) +#else +# define CONTINUE_OR_FAIL goto continue_killing +#endif /* CONTINUE_AFTER_KILL_ERROR */ + +/* Here is the kill builtin. We only have it so that people can type + kill -KILL %1? No, if you fill up the process table this way you + can still kill some. */ +int +kill_builtin (list) + WORD_LIST *list; +{ + int sig, any_succeeded, listing, saw_signal, dflags; + char *sigspec, *word; + pid_t pid; + intmax_t pid_value; + + if (list == 0) + { + builtin_usage (); + return (EX_USAGE); + } + + any_succeeded = listing = saw_signal = 0; + sig = SIGTERM; + sigspec = "TERM"; + + dflags = DSIG_NOCASE | ((posixly_correct == 0) ? DSIG_SIGPREFIX : 0); + /* Process options. */ + while (list) + { + word = list->word->word; + + if (ISOPTION (word, 'l')) + { + listing++; + list = list->next; + } + else if (ISOPTION (word, 's') || ISOPTION (word, 'n')) + { + list = list->next; + if (list) + { + sigspec = list->word->word; + if (sigspec[0] == '0' && sigspec[1] == '\0') + sig = 0; + else + sig = decode_signal (sigspec, dflags); + list = list->next; + saw_signal++; + } + else + { + sh_needarg (word); + return (EXECUTION_FAILURE); + } + } + else if (ISOPTION (word, '-')) + { + list = list->next; + break; + } + else if (ISOPTION (word, '?')) + { + builtin_usage (); + return (EX_USAGE); + } + /* If this is a signal specification then process it. We only process + the first one seen; other arguments may signify process groups (e.g, + -num == process group num). */ + else if (*word == '-' && saw_signal == 0) + { + sigspec = word + 1; + sig = decode_signal (sigspec, dflags); + saw_signal++; + list = list->next; + } + else + break; + } + + if (listing) + return (display_signal_list (list, 0)); + + /* OK, we are killing processes. */ + if (sig == NO_SIG) + { + sh_invalidsig (sigspec); + return (EXECUTION_FAILURE); + } + + if (list == 0) + { + builtin_usage (); + return (EX_USAGE); + } + + while (list) + { + word = list->word->word; + + if (*word == '-') + word++; + + /* Use the entire argument in case of minus sign presence. */ + if (*word && legal_number (list->word->word, &pid_value) && (pid_value == (pid_t)pid_value)) + { + pid = (pid_t) pid_value; + + if (kill_pid (pid, sig, pid < -1) < 0) + { + if (errno == EINVAL) + sh_invalidsig (sigspec); + else + kill_error (pid, errno); + CONTINUE_OR_FAIL; + } + else + any_succeeded++; + } +#if defined (JOB_CONTROL) + else if (*list->word->word && *list->word->word != '%') + { + builtin_error (_("%s: arguments must be process or job IDs"), list->word->word); + CONTINUE_OR_FAIL; + } + else if (*word) + /* Posix.2 says you can kill without job control active (4.32.4) */ + { /* Must be a job spec. Check it out. */ + int job; + sigset_t set, oset; + JOB *j; + + BLOCK_CHILD (set, oset); + job = get_job_spec (list); + + if (INVALID_JOB (job)) + { + if (job != DUP_JOB) + sh_badjob (list->word->word); + UNBLOCK_CHILD (oset); + CONTINUE_OR_FAIL; + } + + j = get_job_by_jid (job); + /* Job spec used. Kill the process group. If the job was started + without job control, then its pgrp == shell_pgrp, so we have + to be careful. We take the pid of the first job in the pipeline + in that case. */ + pid = IS_JOBCONTROL (job) ? j->pgrp : j->pipe->pid; + + UNBLOCK_CHILD (oset); + + if (kill_pid (pid, sig, 1) < 0) + { + if (errno == EINVAL) + sh_invalidsig (sigspec); + else + kill_error (pid, errno); + CONTINUE_OR_FAIL; + } + else + any_succeeded++; + } +#endif /* !JOB_CONTROL */ + else + { + sh_badpid (list->word->word); + CONTINUE_OR_FAIL; + } + continue_killing: + list = list->next; + } + + return (any_succeeded ? EXECUTION_SUCCESS : EXECUTION_FAILURE); +} + +static void +kill_error (pid, e) + pid_t pid; + int e; +{ + char *x; + + x = strerror (e); + if (x == 0) + x = _("Unknown error"); + builtin_error ("(%ld) - %s", (long)pid, x); +} diff --git a/builtins/let.def b/builtins/let.def new file mode 100644 index 0000000..811534e --- /dev/null +++ b/builtins/let.def @@ -0,0 +1,129 @@ +This file is let.def, from which is created let.c. +It implements the builtin "let" in Bash. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$BUILTIN let +$FUNCTION let_builtin +$PRODUCES let.c +$SHORT_DOC let arg [arg ...] +Evaluate arithmetic expressions. + +Evaluate each ARG as an arithmetic expression. Evaluation is done in +fixed-width integers with no check for overflow, though division by 0 +is trapped and flagged as an error. The following list of operators is +grouped into levels of equal-precedence operators. The levels are listed +in order of decreasing precedence. + + id++, id-- variable post-increment, post-decrement + ++id, --id variable pre-increment, pre-decrement + -, + unary minus, plus + !, ~ logical and bitwise negation + ** exponentiation + *, /, % multiplication, division, remainder + +, - addition, subtraction + <<, >> left and right bitwise shifts + <=, >=, <, > comparison + ==, != equality, inequality + & bitwise AND + ^ bitwise XOR + | bitwise OR + && logical AND + || logical OR + expr ? expr : expr + conditional operator + =, *=, /=, %=, + +=, -=, <<=, >>=, + &=, ^=, |= assignment + +Shell variables are allowed as operands. The name of the variable +is replaced by its value (coerced to a fixed-width integer) within +an expression. The variable need not have its integer attribute +turned on to be used in an expression. + +Operators are evaluated in order of precedence. Sub-expressions in +parentheses are evaluated first and may override the precedence +rules above. + +Exit Status: +If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise. +$END + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "../bashintl.h" + +#include "../shell.h" +#include "common.h" + +/* Arithmetic LET function. */ +int +let_builtin (list) + WORD_LIST *list; +{ + intmax_t ret; + int expok; + + /* Skip over leading `--' argument. */ + if (list && list->word && ISOPTION (list->word->word, '-')) + list = list->next; + + if (list == 0) + { + builtin_error (_("expression expected")); + return (EXECUTION_FAILURE); + } + + for (; list; list = list->next) + { + ret = evalexp (list->word->word, &expok); + if (expok == 0) + return (EXECUTION_FAILURE); + } + + return ((ret == 0) ? EXECUTION_FAILURE : EXECUTION_SUCCESS); +} + +#ifdef INCLUDE_UNUSED +int +exp_builtin (list) + WORD_LIST *list; +{ + char *exp; + intmax_t ret; + int expok; + + if (list == 0) + { + builtin_error (_("expression expected")); + return (EXECUTION_FAILURE); + } + + exp = string_list (list); + ret = evalexp (exp, &expok); + (void)free (exp); + return (((ret == 0) || (expok == 0)) ? EXECUTION_FAILURE : EXECUTION_SUCCESS); +} +#endif diff --git a/builtins/mapfile.def b/builtins/mapfile.def new file mode 100644 index 0000000..2e6a643 --- /dev/null +++ b/builtins/mapfile.def @@ -0,0 +1,361 @@ +This file is mapfile.def, from which is created mapfile.c. +It implements the builtin "mapfile" in Bash. + +Copyright (C) 2005-2006 Rocky Bernstein for Free Software Foundation, Inc. +Copyright (C) 2008-2012 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES mapfile.c + +$BUILTIN mapfile +$FUNCTION mapfile_builtin +$SHORT_DOC mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array] +Read lines from the standard input into an indexed array variable. + +Read lines from the standard input into the indexed array variable ARRAY, or +from file descriptor FD if the -u option is supplied. The variable MAPFILE +is the default ARRAY. + +Options: + -n count Copy at most COUNT lines. If COUNT is 0, all lines are copied. + -O origin Begin assigning to ARRAY at index ORIGIN. The default index is 0. + -s count Discard the first COUNT lines read. + -t Remove a trailing newline from each line read. + -u fd Read lines from file descriptor FD instead of the standard input. + -C callback Evaluate CALLBACK each time QUANTUM lines are read. + -c quantum Specify the number of lines read between each call to CALLBACK. + +Arguments: + ARRAY Array variable name to use for file data. + +If -C is supplied without -c, the default quantum is 5000. When +CALLBACK is evaluated, it is supplied the index of the next array +element to be assigned and the line to be assigned to that element +as additional arguments. + +If not supplied with an explicit origin, mapfile will clear ARRAY before +assigning to it. + +Exit Status: +Returns success unless an invalid option is given or ARRAY is readonly or +not an indexed array. +$END + +$BUILTIN readarray +$FUNCTION mapfile_builtin +$SHORT_DOC readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array] +Read lines from a file into an array variable. + +A synonym for `mapfile'. +$END + +#include + +#include "builtins.h" +#include "posixstat.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" +#include "bashintl.h" + +#include +#include + +#include "../bashintl.h" +#include "../shell.h" +#include "common.h" +#include "bashgetopt.h" + +#if !defined (errno) +extern int errno; +#endif + +#if defined (ARRAY_VARS) + +static int run_callback __P((const char *, unsigned int, const char *)); + +#define DEFAULT_ARRAY_NAME "MAPFILE" +#define DEFAULT_VARIABLE_NAME "MAPLINE" /* not used right now */ + +/* The value specifying how frequently `mapfile' calls the callback. */ +#define DEFAULT_QUANTUM 5000 + +/* Values for FLAGS */ +#define MAPF_CLEARARRAY 0x01 +#define MAPF_CHOP 0x02 + +static int +run_callback (callback, curindex, curline) + const char *callback; + unsigned int curindex; + const char *curline; +{ + unsigned int execlen; + char *execstr, *qline; + int flags; + + qline = sh_single_quote (curline); + execlen = strlen (callback) + strlen (qline) + 10; + /* 1 for each space between %s and %d, + another 1 for the last nul char for C string. */ + execlen += 3; + execstr = xmalloc (execlen); + + flags = SEVAL_NOHIST; +#if 0 + if (interactive) + flags |= SEVAL_INTERACT; +#endif + snprintf (execstr, execlen, "%s %d %s", callback, curindex, qline); + free (qline); + return evalstring (execstr, NULL, flags); +} + +static void +do_chop(line) + char * line; +{ + int length; + + length = strlen (line); + if (length && line[length-1] == '\n') + line[length-1] = '\0'; +} + +static int +mapfile (fd, line_count_goal, origin, nskip, callback_quantum, callback, array_name, flags) + int fd; + long line_count_goal, origin, nskip, callback_quantum; + char *callback, *array_name; + int flags; +{ + char *line; + size_t line_length; + unsigned int array_index, line_count; + SHELL_VAR *entry; + int unbuffered_read; + + line = NULL; + line_length = 0; + unbuffered_read = 0; + + /* The following check should be done before reading any lines. Doing it + here allows us to call bind_array_element instead of bind_array_variable + and skip the variable lookup on every call. */ + entry = find_or_make_array_variable (array_name, 1); + if (entry == 0 || readonly_p (entry) || noassign_p (entry)) + { + if (entry && readonly_p (entry)) + err_readonly (array_name); + + return (EXECUTION_FAILURE); + } + else if (array_p (entry) == 0) + { + builtin_error (_("%s: not an indexed array"), array_name); + return (EXECUTION_FAILURE); + } + else if (invisible_p (entry)) + VUNSETATTR (entry, att_invisible); /* no longer invisible */ + + if (flags & MAPF_CLEARARRAY) + array_flush (array_cell (entry)); + +#ifndef __CYGWIN__ + unbuffered_read = (lseek (fd, 0L, SEEK_CUR) < 0) && (errno == ESPIPE); +#else + unbuffered_read = 1; +#endif + + zreset (); + + /* Skip any lines at beginning of file? */ + for (line_count = 0; line_count < nskip; line_count++) + if (zgetline (fd, &line, &line_length, unbuffered_read) < 0) + break; + + line = 0; + line_length = 0; + + /* Reset the buffer for bash own stream */ + for (array_index = origin, line_count = 1; + zgetline (fd, &line, &line_length, unbuffered_read) != -1; + array_index++) + { + /* Remove trailing newlines? */ + if (flags & MAPF_CHOP) + do_chop (line); + + /* Has a callback been registered and if so is it time to call it? */ + if (callback && line_count && (line_count % callback_quantum) == 0) + { + run_callback (callback, array_index, line); + + /* Reset the buffer for bash own stream. */ + if (unbuffered_read == 0) + zsyncfd (fd); + } + + /* XXX - bad things can happen if the callback modifies ENTRY, e.g., + unsetting it or changing it to a non-indexed-array type. */ + bind_array_element (entry, array_index, line, 0); + + /* Have we exceeded # of lines to store? */ + line_count++; + if (line_count_goal != 0 && line_count > line_count_goal) + break; + } + + xfree (line); + + if (unbuffered_read == 0) + zsyncfd (fd); + + return EXECUTION_SUCCESS; +} + +int +mapfile_builtin (list) + WORD_LIST *list; +{ + int opt, code, fd, clear_array, flags; + intmax_t intval; + long lines, origin, nskip, callback_quantum; + char *array_name, *callback; + + clear_array = 1; + fd = 0; + lines = origin = nskip = 0; + flags = MAPF_CLEARARRAY; + callback_quantum = DEFAULT_QUANTUM; + callback = 0; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "u:n:O:tC:c:s:")) != -1) + { + switch (opt) + { + case 'u': + code = legal_number (list_optarg, &intval); + if (code == 0 || intval < 0 || intval != (int)intval) + { + builtin_error (_("%s: invalid file descriptor specification"), list_optarg); + return (EXECUTION_FAILURE); + } + else + fd = intval; + + if (sh_validfd (fd) == 0) + { + builtin_error (_("%d: invalid file descriptor: %s"), fd, strerror (errno)); + return (EXECUTION_FAILURE); + } + break; + + case 'n': + code = legal_number (list_optarg, &intval); + if (code == 0 || intval < 0 || intval != (unsigned)intval) + { + builtin_error (_("%s: invalid line count"), list_optarg); + return (EXECUTION_FAILURE); + } + else + lines = intval; + break; + + case 'O': + code = legal_number (list_optarg, &intval); + if (code == 0 || intval < 0 || intval != (unsigned)intval) + { + builtin_error (_("%s: invalid array origin"), list_optarg); + return (EXECUTION_FAILURE); + } + else + origin = intval; + flags &= ~MAPF_CLEARARRAY; + break; + case 't': + flags |= MAPF_CHOP; + break; + case 'C': + callback = list_optarg; + break; + case 'c': + code = legal_number (list_optarg, &intval); + if (code == 0 || intval <= 0 || intval != (unsigned)intval) + { + builtin_error (_("%s: invalid callback quantum"), list_optarg); + return (EXECUTION_FAILURE); + } + else + callback_quantum = intval; + break; + case 's': + code = legal_number (list_optarg, &intval); + if (code == 0 || intval < 0 || intval != (unsigned)intval) + { + builtin_error (_("%s: invalid line count"), list_optarg); + return (EXECUTION_FAILURE); + } + else + nskip = intval; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + if (list == 0) + array_name = DEFAULT_ARRAY_NAME; + else if (list->word == 0 || list->word->word == 0) + { + builtin_error ("internal error: getting variable name"); + return (EXECUTION_FAILURE); + } + else if (list->word->word[0] == '\0') + { + builtin_error (_("empty array variable name")); + return (EX_USAGE); + } + else + array_name = list->word->word; + + if (legal_identifier (array_name) == 0 && valid_array_reference (array_name) == 0) + { + sh_invalidid (array_name); + return (EXECUTION_FAILURE); + } + + return mapfile (fd, lines, origin, nskip, callback_quantum, callback, array_name, flags); +} + +#else + +int +mapfile_builtin (list) + WORD_LIST *list; +{ + builtin_error (_("array variable support required")); + return (EXECUTION_FAILURE); +} + +#endif /* ARRAY_VARS */ diff --git a/builtins/mkbuiltins.c b/builtins/mkbuiltins.c new file mode 100644 index 0000000..15bb80f --- /dev/null +++ b/builtins/mkbuiltins.c @@ -0,0 +1,1628 @@ +/* mkbuiltins.c - Create builtins.c, builtext.h, and builtdoc.c from + a single source file called builtins.def. */ + +/* Copyright (C) 1987-2011 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (CROSS_COMPILING) +# include +#else /* CROSS_COMPILING */ +/* A conservative set of defines based on POSIX/SUS3/XPG6 */ +# define HAVE_UNISTD_H +# define HAVE_STRING_H +# define HAVE_STDLIB_H + +# define HAVE_RENAME +#endif /* CROSS_COMPILING */ + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#ifndef _MINIX +# include "../bashtypes.h" +# if defined (HAVE_SYS_FILE_H) +# include +# endif +#endif + +#include "posixstat.h" +#include "filecntl.h" + +#include "../bashansi.h" +#include +#include + +#include "stdc.h" + +#define DOCFILE "builtins.texi" + +#ifndef errno +extern int errno; +#endif + +static char *xmalloc (), *xrealloc (); + +#if !defined (__STDC__) && !defined (strcpy) +extern char *strcpy (); +#endif /* !__STDC__ && !strcpy */ + +#define savestring(x) strcpy (xmalloc (1 + strlen (x)), (x)) +#define whitespace(c) (((c) == ' ') || ((c) == '\t')) + +/* Flag values that builtins can have. */ +#define BUILTIN_FLAG_SPECIAL 0x01 +#define BUILTIN_FLAG_ASSIGNMENT 0x02 +#define BUILTIN_FLAG_POSIX_BUILTIN 0x04 + +#define BASE_INDENT 4 + +/* If this stream descriptor is non-zero, then write + texinfo documentation to it. */ +FILE *documentation_file = (FILE *)NULL; + +/* Non-zero means to only produce documentation. */ +int only_documentation = 0; + +/* Non-zero means to not do any productions. */ +int inhibit_production = 0; + +/* Non-zero means to not add functions (xxx_builtin) to the members of the + produced `struct builtin []' */ +int inhibit_functions = 0; + +/* Non-zero means to produce separate help files for each builtin, named by + the builtin name, in `./helpfiles'. */ +int separate_helpfiles = 0; + +/* Non-zero means to create single C strings for each `longdoc', with + embedded newlines, for ease of translation. */ +int single_longdoc_strings = 1; + +/* The name of a directory into which the separate external help files will + eventually be installed. */ +char *helpfile_directory; + +/* The name of a directory to precede the filename when reporting + errors. */ +char *error_directory = (char *)NULL; + +/* The name of the structure file. */ +char *struct_filename = (char *)NULL; + +/* The name of the external declaration file. */ +char *extern_filename = (char *)NULL; + +/* Here is a structure for manipulating arrays of data. */ +typedef struct { + int size; /* Number of slots allocated to array. */ + int sindex; /* Current location in array. */ + int width; /* Size of each element. */ + int growth_rate; /* How fast to grow. */ + char **array; /* The array itself. */ +} ARRAY; + +/* Here is a structure defining a single BUILTIN. */ +typedef struct { + char *name; /* The name of this builtin. */ + char *function; /* The name of the function to call. */ + char *shortdoc; /* The short documentation for this builtin. */ + char *docname; /* Possible name for documentation string. */ + ARRAY *longdoc; /* The long documentation for this builtin. */ + ARRAY *dependencies; /* Null terminated array of #define names. */ + int flags; /* Flags for this builtin. */ +} BUILTIN_DESC; + +/* Here is a structure which defines a DEF file. */ +typedef struct { + char *filename; /* The name of the input def file. */ + ARRAY *lines; /* The contents of the file. */ + int line_number; /* The current line number. */ + char *production; /* The name of the production file. */ + FILE *output; /* Open file stream for PRODUCTION. */ + ARRAY *builtins; /* Null terminated array of BUILTIN_DESC *. */ +} DEF_FILE; + +/* The array of all builtins encountered during execution of this code. */ +ARRAY *saved_builtins = (ARRAY *)NULL; + +/* The Posix.2 so-called `special' builtins. */ +char *special_builtins[] = +{ + ":", ".", "source", "break", "continue", "eval", "exec", "exit", + "export", "readonly", "return", "set", "shift", "times", "trap", "unset", + (char *)NULL +}; + +/* The builtin commands that take assignment statements as arguments. */ +char *assignment_builtins[] = +{ + "alias", "declare", "export", "local", "readonly", "typeset", + (char *)NULL +}; + +/* The builtin commands that are special to the POSIX search order. */ +char *posix_builtins[] = +{ + "alias", "bg", "cd", "command", "false", "fc", "fg", "getopts", "jobs", + "kill", "newgrp", "pwd", "read", "true", "umask", "unalias", "wait", + (char *)NULL +}; + +/* Forward declarations. */ +static int is_special_builtin (); +static int is_assignment_builtin (); +static int is_posix_builtin (); + +#if !defined (HAVE_RENAME) +static int rename (); +#endif + +void extract_info (); + +void file_error (); +void line_error (); + +void write_file_headers (); +void write_file_footers (); +void write_ifdefs (); +void write_endifs (); +void write_documentation (); +void write_longdocs (); +void write_builtins (); + +int write_helpfiles (); + +void free_defs (); +void add_documentation (); + +void must_be_building (); +void remove_trailing_whitespace (); + +#define document_name(b) ((b)->docname ? (b)->docname : (b)->name) + + +/* For each file mentioned on the command line, process it and + write the information to STRUCTFILE and EXTERNFILE, while + creating the production file if necessary. */ +int +main (argc, argv) + int argc; + char **argv; +{ + int arg_index = 1; + FILE *structfile, *externfile; + char *documentation_filename, *temp_struct_filename; + + structfile = externfile = (FILE *)NULL; + documentation_filename = DOCFILE; + temp_struct_filename = (char *)NULL; + + while (arg_index < argc && argv[arg_index][0] == '-') + { + char *arg = argv[arg_index++]; + + if (strcmp (arg, "-externfile") == 0) + extern_filename = argv[arg_index++]; + else if (strcmp (arg, "-structfile") == 0) + struct_filename = argv[arg_index++]; + else if (strcmp (arg, "-noproduction") == 0) + inhibit_production = 1; + else if (strcmp (arg, "-nofunctions") == 0) + inhibit_functions = 1; + else if (strcmp (arg, "-document") == 0) + documentation_file = fopen (documentation_filename, "w"); + else if (strcmp (arg, "-D") == 0) + { + int len; + + if (error_directory) + free (error_directory); + + error_directory = xmalloc (2 + strlen (argv[arg_index])); + strcpy (error_directory, argv[arg_index]); + len = strlen (error_directory); + + if (len && error_directory[len - 1] != '/') + strcat (error_directory, "/"); + + arg_index++; + } + else if (strcmp (arg, "-documentonly") == 0) + { + only_documentation = 1; + documentation_file = fopen (documentation_filename, "w"); + } + else if (strcmp (arg, "-H") == 0) + { + separate_helpfiles = 1; + helpfile_directory = argv[arg_index++]; + } + else if (strcmp (arg, "-S") == 0) + single_longdoc_strings = 0; + else + { + fprintf (stderr, "%s: Unknown flag %s.\n", argv[0], arg); + exit (2); + } + } + + /* If there are no files to process, just quit now. */ + if (arg_index == argc) + exit (0); + + if (!only_documentation) + { + /* Open the files. */ + if (struct_filename) + { + temp_struct_filename = xmalloc (15); + sprintf (temp_struct_filename, "mk-%ld", (long) getpid ()); + structfile = fopen (temp_struct_filename, "w"); + + if (!structfile) + file_error (temp_struct_filename); + } + + if (extern_filename) + { + externfile = fopen (extern_filename, "w"); + + if (!externfile) + file_error (extern_filename); + } + + /* Write out the headers. */ + write_file_headers (structfile, externfile); + } + + if (documentation_file) + { + fprintf (documentation_file, "@c Table of builtins created with %s.\n", + argv[0]); + fprintf (documentation_file, "@ftable @asis\n"); + } + + /* Process the .def files. */ + while (arg_index < argc) + { + register char *arg; + + arg = argv[arg_index++]; + + extract_info (arg, structfile, externfile); + } + + /* Close the files. */ + if (!only_documentation) + { + /* Write the footers. */ + write_file_footers (structfile, externfile); + + if (structfile) + { + write_longdocs (structfile, saved_builtins); + fclose (structfile); + rename (temp_struct_filename, struct_filename); + } + + if (externfile) + fclose (externfile); + } + +#if 0 + /* This is now done by a different program */ + if (separate_helpfiles) + { + write_helpfiles (saved_builtins); + } +#endif + + if (documentation_file) + { + fprintf (documentation_file, "@end ftable\n"); + fclose (documentation_file); + } + + exit (0); +} + +/* **************************************************************** */ +/* */ +/* Array Functions and Manipulators */ +/* */ +/* **************************************************************** */ + +/* Make a new array, and return a pointer to it. The array will + contain elements of size WIDTH, and is initialized to no elements. */ +ARRAY * +array_create (width) + int width; +{ + ARRAY *array; + + array = (ARRAY *)xmalloc (sizeof (ARRAY)); + array->size = 0; + array->sindex = 0; + array->width = width; + + /* Default to increasing size in units of 20. */ + array->growth_rate = 20; + + array->array = (char **)NULL; + + return (array); +} + +/* Copy the array of strings in ARRAY. */ +ARRAY * +copy_string_array (array) + ARRAY *array; +{ + register int i; + ARRAY *copy; + + if (!array) + return (ARRAY *)NULL; + + copy = array_create (sizeof (char *)); + + copy->size = array->size; + copy->sindex = array->sindex; + copy->width = array->width; + + copy->array = (char **)xmalloc ((1 + array->sindex) * sizeof (char *)); + + for (i = 0; i < array->sindex; i++) + copy->array[i] = savestring (array->array[i]); + + copy->array[i] = (char *)NULL; + + return (copy); +} + +/* Add ELEMENT to ARRAY, growing the array if necessary. */ +void +array_add (element, array) + char *element; + ARRAY *array; +{ + if (array->sindex + 2 > array->size) + array->array = (char **)xrealloc + (array->array, (array->size += array->growth_rate) * array->width); + + array->array[array->sindex++] = element; + array->array[array->sindex] = (char *)NULL; +} + +/* Free an allocated array and data pointer. */ +void +array_free (array) + ARRAY *array; +{ + if (array->array) + free (array->array); + + free (array); +} + +/* **************************************************************** */ +/* */ +/* Processing a DEF File */ +/* */ +/* **************************************************************** */ + +/* The definition of a function. */ +typedef int Function (); +typedef int mk_handler_func_t __P((char *, DEF_FILE *, char *)); + +/* Structure handles processor directives. */ +typedef struct { + char *directive; + mk_handler_func_t *function; +} HANDLER_ENTRY; + +extern int builtin_handler __P((char *, DEF_FILE *, char *)); +extern int function_handler __P((char *, DEF_FILE *, char *)); +extern int short_doc_handler __P((char *, DEF_FILE *, char *)); +extern int comment_handler __P((char *, DEF_FILE *, char *)); +extern int depends_on_handler __P((char *, DEF_FILE *, char *)); +extern int produces_handler __P((char *, DEF_FILE *, char *)); +extern int end_handler __P((char *, DEF_FILE *, char *)); +extern int docname_handler __P((char *, DEF_FILE *, char *)); + +HANDLER_ENTRY handlers[] = { + { "BUILTIN", builtin_handler }, + { "DOCNAME", docname_handler }, + { "FUNCTION", function_handler }, + { "SHORT_DOC", short_doc_handler }, + { "$", comment_handler }, + { "COMMENT", comment_handler }, + { "DEPENDS_ON", depends_on_handler }, + { "PRODUCES", produces_handler }, + { "END", end_handler }, + { (char *)NULL, (mk_handler_func_t *)NULL } +}; + +/* Return the entry in the table of handlers for NAME. */ +HANDLER_ENTRY * +find_directive (directive) + char *directive; +{ + register int i; + + for (i = 0; handlers[i].directive; i++) + if (strcmp (handlers[i].directive, directive) == 0) + return (&handlers[i]); + + return ((HANDLER_ENTRY *)NULL); +} + +/* Non-zero indicates that a $BUILTIN has been seen, but not + the corresponding $END. */ +static int building_builtin = 0; + +/* Non-zero means to output cpp line and file information before + printing the current line to the production file. */ +int output_cpp_line_info = 0; + +/* The main function of this program. Read FILENAME and act on what is + found. Lines not starting with a dollar sign are copied to the + $PRODUCES target, if one is present. Lines starting with a dollar sign + are directives to this program, specifying the name of the builtin, the + function to call, the short documentation and the long documentation + strings. FILENAME can contain multiple $BUILTINs, but only one $PRODUCES + target. After the file has been processed, write out the names of + builtins found in each $BUILTIN. Plain text found before the $PRODUCES + is ignored, as is "$$ comment text". */ +void +extract_info (filename, structfile, externfile) + char *filename; + FILE *structfile, *externfile; +{ + register int i; + DEF_FILE *defs; + struct stat finfo; + size_t file_size; + char *buffer, *line; + int fd, nr; + + if (stat (filename, &finfo) == -1) + file_error (filename); + + fd = open (filename, O_RDONLY, 0666); + + if (fd == -1) + file_error (filename); + + file_size = (size_t)finfo.st_size; + buffer = xmalloc (1 + file_size); + + if ((nr = read (fd, buffer, file_size)) < 0) + file_error (filename); + + /* This is needed on WIN32, and does not hurt on Unix. */ + if (nr < file_size) + file_size = nr; + + close (fd); + + if (nr == 0) + { + fprintf (stderr, "mkbuiltins: %s: skipping zero-length file\n", filename); + free (buffer); + return; + } + + /* Create and fill in the initial structure describing this file. */ + defs = (DEF_FILE *)xmalloc (sizeof (DEF_FILE)); + defs->filename = filename; + defs->lines = array_create (sizeof (char *)); + defs->line_number = 0; + defs->production = (char *)NULL; + defs->output = (FILE *)NULL; + defs->builtins = (ARRAY *)NULL; + + /* Build the array of lines. */ + i = 0; + while (i < file_size) + { + array_add (&buffer[i], defs->lines); + + while (i < file_size && buffer[i] != '\n') + i++; + buffer[i++] = '\0'; + } + + /* Begin processing the input file. We don't write any output + until we have a file to write output to. */ + output_cpp_line_info = 1; + + /* Process each line in the array. */ + for (i = 0; line = defs->lines->array[i]; i++) + { + defs->line_number = i; + + if (*line == '$') + { + register int j; + char *directive; + HANDLER_ENTRY *handler; + + /* Isolate the directive. */ + for (j = 0; line[j] && !whitespace (line[j]); j++); + + directive = xmalloc (j); + strncpy (directive, line + 1, j - 1); + directive[j -1] = '\0'; + + /* Get the function handler and call it. */ + handler = find_directive (directive); + + if (!handler) + { + line_error (defs, "Unknown directive `%s'", directive); + free (directive); + continue; + } + else + { + /* Advance to the first non-whitespace character. */ + while (whitespace (line[j])) + j++; + + /* Call the directive handler with the FILE, and ARGS. */ + (*(handler->function)) (directive, defs, line + j); + } + free (directive); + } + else + { + if (building_builtin) + add_documentation (defs, line); + else if (defs->output) + { + if (output_cpp_line_info) + { + /* If we're handed an absolute pathname, don't prepend + the directory name. */ + if (defs->filename[0] == '/') + fprintf (defs->output, "#line %d \"%s\"\n", + defs->line_number + 1, defs->filename); + else + fprintf (defs->output, "#line %d \"%s%s\"\n", + defs->line_number + 1, + error_directory ? error_directory : "./", + defs->filename); + output_cpp_line_info = 0; + } + + fprintf (defs->output, "%s\n", line); + } + } + } + + /* Close the production file. */ + if (defs->output) + fclose (defs->output); + + /* The file has been processed. Write the accumulated builtins to + the builtins.c file, and write the extern definitions to the + builtext.h file. */ + write_builtins (defs, structfile, externfile); + + free (buffer); + free_defs (defs); +} + +#define free_safely(x) if (x) free (x) + +static void +free_builtin (builtin) + BUILTIN_DESC *builtin; +{ + register int i; + + free_safely (builtin->name); + free_safely (builtin->function); + free_safely (builtin->shortdoc); + free_safely (builtin->docname); + + if (builtin->longdoc) + array_free (builtin->longdoc); + + if (builtin->dependencies) + { + for (i = 0; builtin->dependencies->array[i]; i++) + free (builtin->dependencies->array[i]); + array_free (builtin->dependencies); + } +} + +/* Free all of the memory allocated to a DEF_FILE. */ +void +free_defs (defs) + DEF_FILE *defs; +{ + register int i; + register BUILTIN_DESC *builtin; + + if (defs->production) + free (defs->production); + + if (defs->lines) + array_free (defs->lines); + + if (defs->builtins) + { + for (i = 0; builtin = (BUILTIN_DESC *)defs->builtins->array[i]; i++) + { + free_builtin (builtin); + free (builtin); + } + array_free (defs->builtins); + } + free (defs); +} + +/* **************************************************************** */ +/* */ +/* The Handler Functions Themselves */ +/* */ +/* **************************************************************** */ + +/* Strip surrounding whitespace from STRING, and + return a pointer to the start of it. */ +char * +strip_whitespace (string) + char *string; +{ + while (whitespace (*string)) + string++; + + remove_trailing_whitespace (string); + return (string); +} + +/* Remove only the trailing whitespace from STRING. */ +void +remove_trailing_whitespace (string) + char *string; +{ + register int i; + + i = strlen (string) - 1; + + while (i > 0 && whitespace (string[i])) + i--; + + string[++i] = '\0'; +} + +/* Ensure that there is a argument in STRING and return it. + FOR_WHOM is the name of the directive which needs the argument. + DEFS is the DEF_FILE in which the directive is found. + If there is no argument, produce an error. */ +char * +get_arg (for_whom, defs, string) + char *for_whom, *string; + DEF_FILE *defs; +{ + char *new; + + new = strip_whitespace (string); + + if (!*new) + line_error (defs, "%s requires an argument", for_whom); + + return (savestring (new)); +} + +/* Error if not building a builtin. */ +void +must_be_building (directive, defs) + char *directive; + DEF_FILE *defs; +{ + if (!building_builtin) + line_error (defs, "%s must be inside of a $BUILTIN block", directive); +} + +/* Return the current builtin. */ +BUILTIN_DESC * +current_builtin (directive, defs) + char *directive; + DEF_FILE *defs; +{ + must_be_building (directive, defs); + if (defs->builtins) + return ((BUILTIN_DESC *)defs->builtins->array[defs->builtins->sindex - 1]); + else + return ((BUILTIN_DESC *)NULL); +} + +/* Add LINE to the long documentation for the current builtin. + Ignore blank lines until the first non-blank line has been seen. */ +void +add_documentation (defs, line) + DEF_FILE *defs; + char *line; +{ + register BUILTIN_DESC *builtin; + + builtin = current_builtin ("(implied LONGDOC)", defs); + + remove_trailing_whitespace (line); + + if (!*line && !builtin->longdoc) + return; + + if (!builtin->longdoc) + builtin->longdoc = array_create (sizeof (char *)); + + array_add (line, builtin->longdoc); +} + +/* How to handle the $BUILTIN directive. */ +int +builtin_handler (self, defs, arg) + char *self; + DEF_FILE *defs; + char *arg; +{ + BUILTIN_DESC *new; + char *name; + + /* If we are already building a builtin, we cannot start a new one. */ + if (building_builtin) + { + line_error (defs, "%s found before $END", self); + return (-1); + } + + output_cpp_line_info++; + + /* Get the name of this builtin, and stick it in the array. */ + name = get_arg (self, defs, arg); + + /* If this is the first builtin, create the array to hold them. */ + if (!defs->builtins) + defs->builtins = array_create (sizeof (BUILTIN_DESC *)); + + new = (BUILTIN_DESC *)xmalloc (sizeof (BUILTIN_DESC)); + new->name = name; + new->function = (char *)NULL; + new->shortdoc = (char *)NULL; + new->docname = (char *)NULL; + new->longdoc = (ARRAY *)NULL; + new->dependencies = (ARRAY *)NULL; + new->flags = 0; + + if (is_special_builtin (name)) + new->flags |= BUILTIN_FLAG_SPECIAL; + if (is_assignment_builtin (name)) + new->flags |= BUILTIN_FLAG_ASSIGNMENT; + if (is_posix_builtin (name)) + new->flags |= BUILTIN_FLAG_POSIX_BUILTIN; + + array_add ((char *)new, defs->builtins); + building_builtin = 1; + + return (0); +} + +/* How to handle the $FUNCTION directive. */ +int +function_handler (self, defs, arg) + char *self; + DEF_FILE *defs; + char *arg; +{ + register BUILTIN_DESC *builtin; + + builtin = current_builtin (self, defs); + + if (builtin == 0) + { + line_error (defs, "syntax error: no current builtin for $FUNCTION directive"); + exit (1); + } + if (builtin->function) + line_error (defs, "%s already has a function (%s)", + builtin->name, builtin->function); + else + builtin->function = get_arg (self, defs, arg); + + return (0); +} + +/* How to handle the $DOCNAME directive. */ +int +docname_handler (self, defs, arg) + char *self; + DEF_FILE *defs; + char *arg; +{ + register BUILTIN_DESC *builtin; + + builtin = current_builtin (self, defs); + + if (builtin->docname) + line_error (defs, "%s already had a docname (%s)", + builtin->name, builtin->docname); + else + builtin->docname = get_arg (self, defs, arg); + + return (0); +} + +/* How to handle the $SHORT_DOC directive. */ +int +short_doc_handler (self, defs, arg) + char *self; + DEF_FILE *defs; + char *arg; +{ + register BUILTIN_DESC *builtin; + + builtin = current_builtin (self, defs); + + if (builtin->shortdoc) + line_error (defs, "%s already has short documentation (%s)", + builtin->name, builtin->shortdoc); + else + builtin->shortdoc = get_arg (self, defs, arg); + + return (0); +} + +/* How to handle the $COMMENT directive. */ +int +comment_handler (self, defs, arg) + char *self; + DEF_FILE *defs; + char *arg; +{ + return (0); +} + +/* How to handle the $DEPENDS_ON directive. */ +int +depends_on_handler (self, defs, arg) + char *self; + DEF_FILE *defs; + char *arg; +{ + register BUILTIN_DESC *builtin; + char *dependent; + + builtin = current_builtin (self, defs); + dependent = get_arg (self, defs, arg); + + if (!builtin->dependencies) + builtin->dependencies = array_create (sizeof (char *)); + + array_add (dependent, builtin->dependencies); + + return (0); +} + +/* How to handle the $PRODUCES directive. */ +int +produces_handler (self, defs, arg) + char *self; + DEF_FILE *defs; + char *arg; +{ + /* If just hacking documentation, don't change any of the production + files. */ + if (only_documentation) + return (0); + + output_cpp_line_info++; + + if (defs->production) + line_error (defs, "%s already has a %s definition", defs->filename, self); + else + { + defs->production = get_arg (self, defs, arg); + + if (inhibit_production) + return (0); + + defs->output = fopen (defs->production, "w"); + + if (!defs->output) + file_error (defs->production); + + fprintf (defs->output, "/* %s, created from %s. */\n", + defs->production, defs->filename); + } + return (0); +} + +/* How to handle the $END directive. */ +int +end_handler (self, defs, arg) + char *self; + DEF_FILE *defs; + char *arg; +{ + must_be_building (self, defs); + building_builtin = 0; + return (0); +} + +/* **************************************************************** */ +/* */ +/* Error Handling Functions */ +/* */ +/* **************************************************************** */ + +/* Produce an error for DEFS with FORMAT and ARGS. */ +void +line_error (defs, format, arg1, arg2) + DEF_FILE *defs; + char *format, *arg1, *arg2; +{ + if (defs->filename[0] != '/') + fprintf (stderr, "%s", error_directory ? error_directory : "./"); + fprintf (stderr, "%s:%d:", defs->filename, defs->line_number + 1); + fprintf (stderr, format, arg1, arg2); + fprintf (stderr, "\n"); + fflush (stderr); +} + +/* Print error message for FILENAME. */ +void +file_error (filename) + char *filename; +{ + perror (filename); + exit (2); +} + +/* **************************************************************** */ +/* */ +/* xmalloc and xrealloc () */ +/* */ +/* **************************************************************** */ + +static void memory_error_and_abort (); + +static char * +xmalloc (bytes) + int bytes; +{ + char *temp = (char *)malloc (bytes); + + if (!temp) + memory_error_and_abort (); + return (temp); +} + +static char * +xrealloc (pointer, bytes) + char *pointer; + int bytes; +{ + char *temp; + + if (!pointer) + temp = (char *)malloc (bytes); + else + temp = (char *)realloc (pointer, bytes); + + if (!temp) + memory_error_and_abort (); + + return (temp); +} + +static void +memory_error_and_abort () +{ + fprintf (stderr, "mkbuiltins: out of virtual memory\n"); + abort (); +} + +/* **************************************************************** */ +/* */ +/* Creating the Struct and Extern Files */ +/* */ +/* **************************************************************** */ + +/* Return a pointer to a newly allocated builtin which is + an exact copy of BUILTIN. */ +BUILTIN_DESC * +copy_builtin (builtin) + BUILTIN_DESC *builtin; +{ + BUILTIN_DESC *new; + + new = (BUILTIN_DESC *)xmalloc (sizeof (BUILTIN_DESC)); + + new->name = savestring (builtin->name); + new->shortdoc = savestring (builtin->shortdoc); + new->longdoc = copy_string_array (builtin->longdoc); + new->dependencies = copy_string_array (builtin->dependencies); + + new->function = + builtin->function ? savestring (builtin->function) : (char *)NULL; + new->docname = + builtin->docname ? savestring (builtin->docname) : (char *)NULL; + + return (new); +} + +/* How to save away a builtin. */ +void +save_builtin (builtin) + BUILTIN_DESC *builtin; +{ + BUILTIN_DESC *newbuiltin; + + newbuiltin = copy_builtin (builtin); + + /* If this is the first builtin to be saved, create the array + to hold it. */ + if (!saved_builtins) + saved_builtins = array_create (sizeof (BUILTIN_DESC *)); + + array_add ((char *)newbuiltin, saved_builtins); +} + +/* Flags that mean something to write_documentation (). */ +#define STRING_ARRAY 0x01 +#define TEXINFO 0x02 +#define PLAINTEXT 0x04 +#define HELPFILE 0x08 + +char *structfile_header[] = { + "/* builtins.c -- the built in shell commands. */", + "", + "/* This file is manufactured by ./mkbuiltins, and should not be", + " edited by hand. See the source to mkbuiltins for details. */", + "", + "/* Copyright (C) 1987-2012 Free Software Foundation, Inc.", + "", + " This file is part of GNU Bash, the Bourne Again SHell.", + "", + " Bash is free software: you can redistribute it and/or modify", + " it under the terms of the GNU General Public License as published by", + " the Free Software Foundation, either version 3 of the License, or", + " (at your option) any later version.", + "", + " Bash is distributed in the hope that it will be useful,", + " but WITHOUT ANY WARRANTY; without even the implied warranty of", + " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the", + " GNU General Public License for more details.", + "", + " You should have received a copy of the GNU General Public License", + " along with Bash. If not, see .", + "*/", + "", + "/* The list of shell builtins. Each element is name, function, flags,", + " long-doc, short-doc. The long-doc field contains a pointer to an array", + " of help lines. The function takes a WORD_LIST *; the first word in the", + " list is the first arg to the command. The list has already had word", + " expansion performed.", + "", + " Functions which need to look at only the simple commands (e.g.", + " the enable_builtin ()), should ignore entries where", + " (array[i].function == (sh_builtin_func_t *)NULL). Such entries are for", + " the list of shell reserved control structures, like `if' and `while'.", + " The end of the list is denoted with a NULL name field. */", + "", + "#include \"../builtins.h\"", + (char *)NULL + }; + +char *structfile_footer[] = { + " { (char *)0x0, (sh_builtin_func_t *)0x0, 0, (char **)0x0, (char *)0x0, (char *)0x0 }", + "};", + "", + "struct builtin *shell_builtins = static_shell_builtins;", + "struct builtin *current_builtin;", + "", + "int num_shell_builtins =", + "\tsizeof (static_shell_builtins) / sizeof (struct builtin) - 1;", + (char *)NULL +}; + +/* Write out any necessary opening information for + STRUCTFILE and EXTERNFILE. */ +void +write_file_headers (structfile, externfile) + FILE *structfile, *externfile; +{ + register int i; + + if (structfile) + { + for (i = 0; structfile_header[i]; i++) + fprintf (structfile, "%s\n", structfile_header[i]); + + fprintf (structfile, "#include \"%s\"\n", + extern_filename ? extern_filename : "builtext.h"); + + fprintf (structfile, "#include \"bashintl.h\"\n"); + + fprintf (structfile, "\nstruct builtin static_shell_builtins[] = {\n"); + } + + if (externfile) + fprintf (externfile, + "/* %s - The list of builtins found in libbuiltins.a. */\n", + extern_filename ? extern_filename : "builtext.h"); +} + +/* Write out any necessary closing information for + STRUCTFILE and EXTERNFILE. */ +void +write_file_footers (structfile, externfile) + FILE *structfile, *externfile; +{ + register int i; + + /* Write out the footers. */ + if (structfile) + { + for (i = 0; structfile_footer[i]; i++) + fprintf (structfile, "%s\n", structfile_footer[i]); + } +} + +/* Write out the information accumulated in DEFS to + STRUCTFILE and EXTERNFILE. */ +void +write_builtins (defs, structfile, externfile) + DEF_FILE *defs; + FILE *structfile, *externfile; +{ + register int i; + + /* Write out the information. */ + if (defs->builtins) + { + register BUILTIN_DESC *builtin; + + for (i = 0; i < defs->builtins->sindex; i++) + { + builtin = (BUILTIN_DESC *)defs->builtins->array[i]; + + /* Write out any #ifdefs that may be there. */ + if (!only_documentation) + { + if (builtin->dependencies) + { + write_ifdefs (externfile, builtin->dependencies->array); + write_ifdefs (structfile, builtin->dependencies->array); + } + + /* Write the extern definition. */ + if (externfile) + { + if (builtin->function) + fprintf (externfile, "extern int %s __P((WORD_LIST *));\n", + builtin->function); + + fprintf (externfile, "extern char * const %s_doc[];\n", + document_name (builtin)); + } + + /* Write the structure definition. */ + if (structfile) + { + fprintf (structfile, " { \"%s\", ", builtin->name); + + if (builtin->function && inhibit_functions == 0) + fprintf (structfile, "%s, ", builtin->function); + else + fprintf (structfile, "(sh_builtin_func_t *)0x0, "); + + fprintf (structfile, "%s%s%s%s, %s_doc,\n", + "BUILTIN_ENABLED | STATIC_BUILTIN", + (builtin->flags & BUILTIN_FLAG_SPECIAL) ? " | SPECIAL_BUILTIN" : "", + (builtin->flags & BUILTIN_FLAG_ASSIGNMENT) ? " | ASSIGNMENT_BUILTIN" : "", + (builtin->flags & BUILTIN_FLAG_POSIX_BUILTIN) ? " | POSIX_BUILTIN" : "", + document_name (builtin)); + + if (inhibit_functions) + fprintf + (structfile, " N_(\"%s\"), \"%s\" },\n", + builtin->shortdoc ? builtin->shortdoc : builtin->name, + document_name (builtin)); + else + fprintf + (structfile, " N_(\"%s\"), (char *)NULL },\n", + builtin->shortdoc ? builtin->shortdoc : builtin->name); + + } + + if (structfile || separate_helpfiles) + /* Save away this builtin for later writing of the + long documentation strings. */ + save_builtin (builtin); + + /* Write out the matching #endif, if necessary. */ + if (builtin->dependencies) + { + if (externfile) + write_endifs (externfile, builtin->dependencies->array); + + if (structfile) + write_endifs (structfile, builtin->dependencies->array); + } + } + + if (documentation_file) + { + fprintf (documentation_file, "@item %s\n", builtin->name); + write_documentation + (documentation_file, builtin->longdoc->array, 0, TEXINFO); + } + } + } +} + +/* Write out the long documentation strings in BUILTINS to STREAM. */ +void +write_longdocs (stream, builtins) + FILE *stream; + ARRAY *builtins; +{ + register int i; + register BUILTIN_DESC *builtin; + char *dname; + char *sarray[2]; + + for (i = 0; i < builtins->sindex; i++) + { + builtin = (BUILTIN_DESC *)builtins->array[i]; + + if (builtin->dependencies) + write_ifdefs (stream, builtin->dependencies->array); + + /* Write the long documentation strings. */ + dname = document_name (builtin); + fprintf (stream, "char * const %s_doc[] =", dname); + + if (separate_helpfiles) + { + int l = strlen (helpfile_directory) + strlen (dname) + 1; + sarray[0] = (char *)xmalloc (l + 1); + sprintf (sarray[0], "%s/%s", helpfile_directory, dname); + sarray[1] = (char *)NULL; + write_documentation (stream, sarray, 0, STRING_ARRAY|HELPFILE); + free (sarray[0]); + } + else + write_documentation (stream, builtin->longdoc->array, 0, STRING_ARRAY); + + if (builtin->dependencies) + write_endifs (stream, builtin->dependencies->array); + + } +} + +void +write_dummy_declarations (stream, builtins) + FILE *stream; + ARRAY *builtins; +{ + register int i; + BUILTIN_DESC *builtin; + + for (i = 0; structfile_header[i]; i++) + fprintf (stream, "%s\n", structfile_header[i]); + + for (i = 0; i < builtins->sindex; i++) + { + builtin = (BUILTIN_DESC *)builtins->array[i]; + + /* How to guarantee that no builtin is written more than once? */ + fprintf (stream, "int %s () { return (0); }\n", builtin->function); + } +} + +/* Write an #ifdef string saying what needs to be defined (or not defined) + in order to allow compilation of the code that will follow. + STREAM is the stream to write the information to, + DEFINES is a null terminated array of define names. + If a define is preceded by an `!', then the sense of the test is + reversed. */ +void +write_ifdefs (stream, defines) + FILE *stream; + char **defines; +{ + register int i; + + if (!stream) + return; + + fprintf (stream, "#if "); + + for (i = 0; defines[i]; i++) + { + char *def = defines[i]; + + if (*def == '!') + fprintf (stream, "!defined (%s)", def + 1); + else + fprintf (stream, "defined (%s)", def); + + if (defines[i + 1]) + fprintf (stream, " && "); + } + fprintf (stream, "\n"); +} + +/* Write an #endif string saying what defines controlled the compilation + of the immediately preceding code. + STREAM is the stream to write the information to. + DEFINES is a null terminated array of define names. */ +void +write_endifs (stream, defines) + FILE *stream; + char **defines; +{ + register int i; + + if (!stream) + return; + + fprintf (stream, "#endif /* "); + + for (i = 0; defines[i]; i++) + { + fprintf (stream, "%s", defines[i]); + + if (defines[i + 1]) + fprintf (stream, " && "); + } + + fprintf (stream, " */\n"); +} + +/* Write DOCUMENTATION to STREAM, perhaps surrounding it with double-quotes + and quoting special characters in the string. Handle special things for + internationalization (gettext) and the single-string vs. multiple-strings + issues. */ +void +write_documentation (stream, documentation, indentation, flags) + FILE *stream; + char **documentation; + int indentation, flags; +{ + register int i, j; + register char *line; + int string_array, texinfo, base_indent, filename_p; + + if (stream == 0) + return; + + string_array = flags & STRING_ARRAY; + filename_p = flags & HELPFILE; + + if (string_array) + { + fprintf (stream, " {\n#if defined (HELP_BUILTIN)\n"); /* } */ + if (single_longdoc_strings) + { + if (filename_p == 0) + { + if (documentation && documentation[0] && documentation[0][0]) + fprintf (stream, "N_(\""); + else + fprintf (stream, "N_(\" "); /* the empty string translates specially. */ + } + else + fprintf (stream, "\""); + } + } + + base_indent = (string_array && single_longdoc_strings && filename_p == 0) ? BASE_INDENT : 0; + + for (i = 0, texinfo = (flags & TEXINFO); documentation && (line = documentation[i]); i++) + { + /* Allow #ifdef's to be written out verbatim, but don't put them into + separate help files. */ + if (*line == '#') + { + if (string_array && filename_p == 0 && single_longdoc_strings == 0) + fprintf (stream, "%s\n", line); + continue; + } + + /* prefix with N_( for gettext */ + if (string_array && single_longdoc_strings == 0) + { + if (filename_p == 0) + { + if (line[0]) + fprintf (stream, " N_(\""); + else + fprintf (stream, " N_(\" "); /* the empty string translates specially. */ + } + else + fprintf (stream, " \""); + } + + if (indentation) + for (j = 0; j < indentation; j++) + fprintf (stream, " "); + + /* Don't indent the first line, because of how the help builtin works. */ + if (i == 0) + indentation += base_indent; + + if (string_array) + { + for (j = 0; line[j]; j++) + { + switch (line[j]) + { + case '\\': + case '"': + fprintf (stream, "\\%c", line[j]); + break; + + default: + fprintf (stream, "%c", line[j]); + } + } + + /* closing right paren for gettext */ + if (single_longdoc_strings == 0) + { + if (filename_p == 0) + fprintf (stream, "\"),\n"); + else + fprintf (stream, "\",\n"); + } + else if (documentation[i+1]) + /* don't add extra newline after last line */ + fprintf (stream, "\\n\\\n"); + } + else if (texinfo) + { + for (j = 0; line[j]; j++) + { + switch (line[j]) + { + case '@': + case '{': + case '}': + fprintf (stream, "@%c", line[j]); + break; + + default: + fprintf (stream, "%c", line[j]); + } + } + fprintf (stream, "\n"); + } + else + fprintf (stream, "%s\n", line); + } + + /* closing right paren for gettext */ + if (string_array && single_longdoc_strings) + { + if (filename_p == 0) + fprintf (stream, "\"),\n"); + else + fprintf (stream, "\",\n"); + } + + if (string_array) + fprintf (stream, "#endif /* HELP_BUILTIN */\n (char *)NULL\n};\n"); +} + +int +write_helpfiles (builtins) + ARRAY *builtins; +{ + char *helpfile, *bname; + FILE *helpfp; + int i, hdlen; + BUILTIN_DESC *builtin; + + i = mkdir ("helpfiles", 0777); + if (i < 0 && errno != EEXIST) + { + fprintf (stderr, "write_helpfiles: helpfiles: cannot create directory\n"); + return -1; + } + + hdlen = strlen ("helpfiles/"); + for (i = 0; i < builtins->sindex; i++) + { + builtin = (BUILTIN_DESC *)builtins->array[i]; + + bname = document_name (builtin); + helpfile = (char *)xmalloc (hdlen + strlen (bname) + 1); + sprintf (helpfile, "helpfiles/%s", bname); + + helpfp = fopen (helpfile, "w"); + if (helpfp == 0) + { + fprintf (stderr, "write_helpfiles: cannot open %s\n", helpfile); + free (helpfile); + continue; + } + + write_documentation (helpfp, builtin->longdoc->array, 4, PLAINTEXT); + + fflush (helpfp); + fclose (helpfp); + free (helpfile); + } + return 0; +} + +static int +_find_in_table (name, name_table) + char *name, *name_table[]; +{ + register int i; + + for (i = 0; name_table[i]; i++) + if (strcmp (name, name_table[i]) == 0) + return 1; + return 0; +} + +static int +is_special_builtin (name) + char *name; +{ + return (_find_in_table (name, special_builtins)); +} + +static int +is_assignment_builtin (name) + char *name; +{ + return (_find_in_table (name, assignment_builtins)); +} + +static int +is_posix_builtin (name) + char *name; +{ + return (_find_in_table (name, posix_builtins)); +} + +#if !defined (HAVE_RENAME) +static int +rename (from, to) + char *from, *to; +{ + unlink (to); + if (link (from, to) < 0) + return (-1); + unlink (from); + return (0); +} +#endif /* !HAVE_RENAME */ diff --git a/builtins/printf.def b/builtins/printf.def new file mode 100644 index 0000000..7f29126 --- /dev/null +++ b/builtins/printf.def @@ -0,0 +1,1270 @@ +This file is printf.def, from which is created printf.c. +It implements the builtin "printf" in Bash. + +Copyright (C) 1997-2010 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES printf.c + +$BUILTIN printf +$FUNCTION printf_builtin +$SHORT_DOC printf [-v var] format [arguments] +Formats and prints ARGUMENTS under control of the FORMAT. + +Options: + -v var assign the output to shell variable VAR rather than + display it on the standard output + +FORMAT is a character string which contains three types of objects: plain +characters, which are simply copied to standard output; character escape +sequences, which are converted and copied to the standard output; and +format specifications, each of which causes printing of the next successive +argument. + +In addition to the standard format specifications described in printf(1), +printf interprets: + + %b expand backslash escape sequences in the corresponding argument + %q quote the argument in a way that can be reused as shell input + %(fmt)T output the date-time string resulting from using FMT as a format + string for strftime(3) + +The format is re-used as necessary to consume all of the arguments. If +there are fewer arguments than the format requires, extra format +specifications behave as if a zero value or null string, as appropriate, +had been supplied. + +Exit Status: +Returns success unless an invalid option is given or a write or assignment +error occurs. +$END + +#include + +#include "../bashtypes.h" + +#include +#if defined (HAVE_LIMITS_H) +# include +#else + /* Assume 32-bit ints. */ +# define INT_MAX 2147483647 +# define INT_MIN (-2147483647-1) +#endif + +#if defined (PREFER_STDARG) +# include +#else +# include +#endif + +#include +#include + +#ifdef HAVE_INTTYPES_H +# include +#endif + +#include "posixtime.h" +#include "../bashansi.h" +#include "../bashintl.h" + +#define NEED_STRFTIME_DECL + +#include "../shell.h" +#include "shmbutil.h" +#include "stdc.h" +#include "bashgetopt.h" +#include "common.h" + +#if defined (PRI_MACROS_BROKEN) +# undef PRIdMAX +#endif + +#if !defined (PRIdMAX) +# if HAVE_LONG_LONG +# define PRIdMAX "lld" +# else +# define PRIdMAX "ld" +# endif +#endif + +#if !defined (errno) +extern int errno; +#endif + +#define PC(c) \ + do { \ + char b[2]; \ + tw++; \ + b[0] = c; b[1] = '\0'; \ + if (vflag) \ + vbadd (b, 1); \ + else \ + putchar (c); \ + } while (0) + +#define PF(f, func) \ + do { \ + int nw; \ + clearerr (stdout); \ + if (have_fieldwidth && have_precision) \ + nw = vflag ? vbprintf (f, fieldwidth, precision, func) : printf (f, fieldwidth, precision, func); \ + else if (have_fieldwidth) \ + nw = vflag ? vbprintf (f, fieldwidth, func) : printf (f, fieldwidth, func); \ + else if (have_precision) \ + nw = vflag ? vbprintf (f, precision, func) : printf (f, precision, func); \ + else \ + nw = vflag ? vbprintf (f, func) : printf (f, func); \ + tw += nw; \ + if (ferror (stdout)) \ + { \ + sh_wrerror (); \ + clearerr (stdout); \ + return (EXECUTION_FAILURE); \ + } \ + } while (0) + +/* We free the buffer used by mklong() if it's `too big'. */ +#define PRETURN(value) \ + do \ + { \ + if (vflag) \ + { \ + bind_printf_variable (vname, vbuf, 0); \ + stupidly_hack_special_variables (vname); \ + } \ + if (conv_bufsize > 4096 ) \ + { \ + free (conv_buf); \ + conv_bufsize = 0; \ + conv_buf = 0; \ + } \ + if (vbsize > 4096) \ + { \ + free (vbuf); \ + vbsize = 0; \ + vbuf = 0; \ + } \ + else if (vbuf) \ + vbuf[0] = 0; \ + terminate_immediately--; \ + if (ferror (stdout) == 0) \ + fflush (stdout); \ + if (ferror (stdout)) \ + { \ + sh_wrerror (); \ + clearerr (stdout); \ + return (EXECUTION_FAILURE); \ + } \ + return (value); \ + } \ + while (0) + +#define SKIP1 "#'-+ 0" +#define LENMODS "hjlLtz" + +extern time_t shell_start_time; + +#if !HAVE_ASPRINTF +extern int asprintf __P((char **, const char *, ...)) __attribute__((__format__ (printf, 2, 3))); +#endif + +#if !HAVE_VSNPRINTF +extern int vsnprintf __P((char *, size_t, const char *, va_list)) __attribute__((__format__ (printf, 3, 0))); +#endif + +static void printf_erange __P((char *)); +static int printstr __P((char *, char *, int, int, int)); +static int tescape __P((char *, char *, int *, int *)); +static char *bexpand __P((char *, int, int *, int *)); +static char *vbadd __P((char *, int)); +static int vbprintf __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2))); +static char *mklong __P((char *, char *, size_t)); +static int getchr __P((void)); +static char *getstr __P((void)); +static int getint __P((void)); +static intmax_t getintmax __P((void)); +static uintmax_t getuintmax __P((void)); +static SHELL_VAR *bind_printf_variable __P((char *, char *, int)); + +#if defined (HAVE_LONG_DOUBLE) && HAVE_DECL_STRTOLD && !defined(STRTOLD_BROKEN) +typedef long double floatmax_t; +# define FLOATMAX_CONV "L" +# define strtofltmax strtold +#else +typedef double floatmax_t; +# define FLOATMAX_CONV "" +# define strtofltmax strtod +#endif +static floatmax_t getfloatmax __P((void)); + +static intmax_t asciicode __P((void)); + +static WORD_LIST *garglist; +static int retval; +static int conversion_error; + +/* printf -v var support */ +static int vflag = 0; +static char *vbuf, *vname; +static size_t vbsize; +static int vblen; + +static intmax_t tw; + +static char *conv_buf; +static size_t conv_bufsize; + +int +printf_builtin (list) + WORD_LIST *list; +{ + int ch, fieldwidth, precision; + int have_fieldwidth, have_precision; + char convch, thisch, nextch, *format, *modstart, *fmt, *start; +#if defined (HANDLE_MULTIBYTE) + char mbch[25]; /* 25 > MB_LEN_MAX, plus can handle 4-byte UTF-8 and large Unicode characters*/ + int mbind, mblen; +#endif + + conversion_error = 0; + retval = EXECUTION_SUCCESS; + + vflag = 0; + + reset_internal_getopt (); + while ((ch = internal_getopt (list, "v:")) != -1) + { + switch (ch) + { + case 'v': + vname = list_optarg; +#if defined (ARRAY_VARS) + if (legal_identifier (vname) || valid_array_reference (vname)) +#else + if (legal_identifier (vname)) +#endif + { + vflag = 1; + if (vbsize == 0) + vbuf = xmalloc (vbsize = 16); + vblen = 0; + if (vbuf) + vbuf[0] = 0; + } + else + { + sh_invalidid (vname); + return (EX_USAGE); + } + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; /* skip over possible `--' */ + + if (list == 0) + { + builtin_usage (); + return (EX_USAGE); + } + + if (list->word->word == 0 || list->word->word[0] == '\0') + return (EXECUTION_SUCCESS); + + format = list->word->word; + tw = 0; + + garglist = list->next; + + /* If the format string is empty after preprocessing, return immediately. */ + if (format == 0 || *format == 0) + return (EXECUTION_SUCCESS); + + terminate_immediately++; + + /* Basic algorithm is to scan the format string for conversion + specifications -- once one is found, find out if the field + width or precision is a '*'; if it is, gather up value. Note, + format strings are reused as necessary to use up the provided + arguments, arguments of zero/null string are provided to use + up the format string. */ + do + { + tw = 0; + /* find next format specification */ + for (fmt = format; *fmt; fmt++) + { + precision = fieldwidth = 0; + have_fieldwidth = have_precision = 0; + + if (*fmt == '\\') + { + fmt++; + /* A NULL third argument to tescape means to bypass the + special processing for arguments to %b. */ +#if defined (HANDLE_MULTIBYTE) + /* Accommodate possible use of \u or \U, which can result in + multibyte characters */ + memset (mbch, '\0', sizeof (mbch)); + fmt += tescape (fmt, mbch, &mblen, (int *)NULL); + for (mbind = 0; mbind < mblen; mbind++) + PC (mbch[mbind]); +#else + fmt += tescape (fmt, &nextch, (int *)NULL, (int *)NULL); + PC (nextch); +#endif + fmt--; /* for loop will increment it for us again */ + continue; + } + + if (*fmt != '%') + { + PC (*fmt); + continue; + } + + /* ASSERT(*fmt == '%') */ + start = fmt++; + + if (*fmt == '%') /* %% prints a % */ + { + PC ('%'); + continue; + } + + /* found format specification, skip to field width */ + for (; *fmt && strchr(SKIP1, *fmt); ++fmt) + ; + + /* Skip optional field width. */ + if (*fmt == '*') + { + fmt++; + have_fieldwidth = 1; + fieldwidth = getint (); + } + else + while (DIGIT (*fmt)) + fmt++; + + /* Skip optional '.' and precision */ + if (*fmt == '.') + { + ++fmt; + if (*fmt == '*') + { + fmt++; + have_precision = 1; + precision = getint (); + } + else + { + /* Negative precisions are allowed but treated as if the + precision were missing; I would like to allow a leading + `+' in the precision number as an extension, but lots + of asprintf/fprintf implementations get this wrong. */ +#if 0 + if (*fmt == '-' || *fmt == '+') +#else + if (*fmt == '-') +#endif + fmt++; + while (DIGIT (*fmt)) + fmt++; + } + } + + /* skip possible format modifiers */ + modstart = fmt; + while (*fmt && strchr (LENMODS, *fmt)) + fmt++; + + if (*fmt == 0) + { + builtin_error (_("`%s': missing format character"), start); + PRETURN (EXECUTION_FAILURE); + } + + convch = *fmt; + thisch = modstart[0]; + nextch = modstart[1]; + modstart[0] = convch; + modstart[1] = '\0'; + + switch(convch) + { + case 'c': + { + char p; + + p = getchr (); + PF(start, p); + break; + } + + case 's': + { + char *p; + + p = getstr (); + PF(start, p); + break; + } + + case '(': + { + char *timefmt, timebuf[128], *t; + int n; + intmax_t arg; + time_t secs; + struct tm *tm; + + modstart[1] = nextch; /* restore char after left paren */ + timefmt = xmalloc (strlen (fmt) + 3); + fmt++; /* skip over left paren */ + for (t = timefmt, n = 1; *fmt; ) + { + if (*fmt == '(') + n++; + else if (*fmt == ')') + n--; + if (n == 0) + break; + *t++ = *fmt++; + } + *t = '\0'; + if (*++fmt != 'T') + { + builtin_warning (_("`%c': invalid time format specification"), *fmt); + fmt = start; + free (timefmt); + PC (*fmt); + continue; + } + if (timefmt[0] == '\0') + { + timefmt[0] = '%'; + timefmt[1] = 'X'; /* locale-specific current time - should we use `+'? */ + timefmt[2] = '\0'; + } + /* argument is seconds since the epoch with special -1 and -2 */ + /* default argument is equivalent to -1; special case */ + arg = garglist ? getintmax () : -1; + if (arg == -1) + secs = NOW; /* roughly date +%s */ + else if (arg == -2) + secs = shell_start_time; /* roughly $SECONDS */ + else + secs = arg; +#if defined (HAVE_TZSET) + sv_tz ("TZ"); /* XXX -- just make sure */ +#endif + tm = localtime (&secs); + if (tm == 0) + { + secs = 0; + tm = localtime (&secs); + } + n = tm ? strftime (timebuf, sizeof (timebuf), timefmt, tm) : 0; + free (timefmt); + if (n == 0) + timebuf[0] = '\0'; + else + timebuf[sizeof(timebuf) - 1] = '\0'; + /* convert to %s format that preserves fieldwidth and precision */ + modstart[0] = 's'; + modstart[1] = '\0'; + n = printstr (start, timebuf, strlen (timebuf), fieldwidth, precision); /* XXX - %s for now */ + if (n < 0) + { + if (ferror (stdout) == 0) + { + sh_wrerror (); + clearerr (stdout); + } + PRETURN (EXECUTION_FAILURE); + } + break; + } + + case 'n': + { + char *var; + + var = getstr (); + if (var && *var) + { + if (legal_identifier (var)) + bind_var_to_int (var, tw); + else + { + sh_invalidid (var); + PRETURN (EXECUTION_FAILURE); + } + } + break; + } + + case 'b': /* expand escapes in argument */ + { + char *p, *xp; + int rlen, r; + + p = getstr (); + ch = rlen = r = 0; + xp = bexpand (p, strlen (p), &ch, &rlen); + + if (xp) + { + /* Have to use printstr because of possible NUL bytes + in XP -- printf does not handle that well. */ + r = printstr (start, xp, rlen, fieldwidth, precision); + if (r < 0) + { + if (ferror (stdout) == 0) + { + sh_wrerror (); + clearerr (stdout); + } + retval = EXECUTION_FAILURE; + } + free (xp); + } + + if (ch || r < 0) + PRETURN (retval); + break; + } + + case 'q': /* print with shell quoting */ + { + char *p, *xp; + int r; + + r = 0; + p = getstr (); + if (p && *p == 0) /* XXX - getstr never returns null */ + xp = savestring ("''"); + else if (ansic_shouldquote (p)) + xp = ansic_quote (p, 0, (int *)0); + else + xp = sh_backslash_quote (p, 0, 1); + if (xp) + { + /* Use printstr to get fieldwidth and precision right. */ + r = printstr (start, xp, strlen (xp), fieldwidth, precision); + if (r < 0) + { + sh_wrerror (); + clearerr (stdout); + } + free (xp); + } + + if (r < 0) + PRETURN (EXECUTION_FAILURE); + break; + } + + case 'd': + case 'i': + { + char *f; + long p; + intmax_t pp; + + p = pp = getintmax (); + if (p != pp) + { + f = mklong (start, PRIdMAX, sizeof (PRIdMAX) - 2); + PF (f, pp); + } + else + { + /* Optimize the common case where the integer fits + in "long". This also works around some long + long and/or intmax_t library bugs in the common + case, e.g. glibc 2.2 x86. */ + f = mklong (start, "l", 1); + PF (f, p); + } + break; + } + + case 'o': + case 'u': + case 'x': + case 'X': + { + char *f; + unsigned long p; + uintmax_t pp; + + p = pp = getuintmax (); + if (p != pp) + { + f = mklong (start, PRIdMAX, sizeof (PRIdMAX) - 2); + PF (f, pp); + } + else + { + f = mklong (start, "l", 1); + PF (f, p); + } + break; + } + + case 'e': + case 'E': + case 'f': + case 'F': + case 'g': + case 'G': +#if defined (HAVE_PRINTF_A_FORMAT) + case 'a': + case 'A': +#endif + { + char *f; + floatmax_t p; + + p = getfloatmax (); + f = mklong (start, FLOATMAX_CONV, sizeof(FLOATMAX_CONV) - 1); + PF (f, p); + break; + } + + /* We don't output unrecognized format characters; we print an + error message and return a failure exit status. */ + default: + builtin_error (_("`%c': invalid format character"), convch); + PRETURN (EXECUTION_FAILURE); + } + + modstart[0] = thisch; + modstart[1] = nextch; + } + + if (ferror (stdout)) + { + /* PRETURN will print error message. */ + PRETURN (EXECUTION_FAILURE); + } + } + while (garglist && garglist != list->next); + + if (conversion_error) + retval = EXECUTION_FAILURE; + + PRETURN (retval); +} + +static void +printf_erange (s) + char *s; +{ + builtin_error (_("warning: %s: %s"), s, strerror(ERANGE)); +} + +/* We duplicate a lot of what printf(3) does here. */ +static int +printstr (fmt, string, len, fieldwidth, precision) + char *fmt; /* format */ + char *string; /* expanded string argument */ + int len; /* length of expanded string */ + int fieldwidth; /* argument for width of `*' */ + int precision; /* argument for precision of `*' */ +{ +#if 0 + char *s; +#endif + int padlen, nc, ljust, i; + int fw, pr; /* fieldwidth and precision */ + intmax_t mfw, mpr; + + if (string == 0 || len == 0) + return 0; + +#if 0 + s = fmt; +#endif + if (*fmt == '%') + fmt++; + + ljust = fw = 0; + pr = -1; + mfw = 0; + mpr = -1; + + /* skip flags */ + while (strchr (SKIP1, *fmt)) + { + if (*fmt == '-') + ljust = 1; + fmt++; + } + + /* get fieldwidth, if present. rely on caller to clamp fieldwidth at INT_MAX */ + if (*fmt == '*') + { + fmt++; + fw = fieldwidth; + if (fw < 0) + { + fw = -fw; + ljust = 1; + } + } + else if (DIGIT (*fmt)) + { + mfw = *fmt++ - '0'; + while (DIGIT (*fmt)) + mfw = (mfw * 10) + (*fmt++ - '0'); + /* Error if fieldwidth > INT_MAX here? */ + fw = (mfw < 0 || mfw > INT_MAX) ? INT_MAX : mfw; + } + + /* get precision, if present */ + if (*fmt == '.') + { + fmt++; + if (*fmt == '*') + { + fmt++; + pr = precision; + } + else if (DIGIT (*fmt)) + { + mpr = *fmt++ - '0'; + while (DIGIT (*fmt)) + mpr = (mpr * 10) + (*fmt++ - '0'); + /* Error if precision > INT_MAX here? */ + pr = (mpr < 0 || mpr > INT_MAX) ? INT_MAX : mpr; + } + } + +#if 0 + /* If we remove this, get rid of `s'. */ + if (*fmt != 'b' && *fmt != 'q') + { + internal_error (_("format parsing problem: %s"), s); + fw = pr = 0; + } +#endif + + /* chars from string to print */ + nc = (pr >= 0 && pr <= len) ? pr : len; + + padlen = fw - nc; + if (padlen < 0) + padlen = 0; + if (ljust) + padlen = -padlen; + + /* leading pad characters */ + for (; padlen > 0; padlen--) + PC (' '); + + /* output NC characters from STRING */ + for (i = 0; i < nc; i++) + PC (string[i]); + + /* output any necessary trailing padding */ + for (; padlen < 0; padlen++) + PC (' '); + + return (ferror (stdout) ? -1 : 0); +} + +/* Convert STRING by expanding the escape sequences specified by the + POSIX standard for printf's `%b' format string. If SAWC is non-null, + perform the processing appropriate for %b arguments. In particular, + recognize `\c' and use that as a string terminator. If we see \c, set + *SAWC to 1 before returning. LEN is the length of STRING. */ + +/* Translate a single backslash-escape sequence starting at ESTART (the + character after the backslash) and return the number of characters + consumed by the sequence. CP is the place to return the translated + value. *SAWC is set to 1 if the escape sequence was \c, since that means + to short-circuit the rest of the processing. If SAWC is null, we don't + do the \c short-circuiting, and \c is treated as an unrecognized escape + sequence; we also bypass the other processing specific to %b arguments. */ +static int +tescape (estart, cp, lenp, sawc) + char *estart; + char *cp; + int *lenp, *sawc; +{ + register char *p; + int temp, c, evalue; + unsigned long uvalue; + + p = estart; + if (lenp) + *lenp = 1; + + switch (c = *p++) + { +#if defined (__STDC__) + case 'a': *cp = '\a'; break; +#else + case 'a': *cp = '\007'; break; +#endif + + case 'b': *cp = '\b'; break; + + case 'e': + case 'E': *cp = '\033'; break; /* ESC -- non-ANSI */ + + case 'f': *cp = '\f'; break; + + case 'n': *cp = '\n'; break; + + case 'r': *cp = '\r'; break; + + case 't': *cp = '\t'; break; + + case 'v': *cp = '\v'; break; + + /* The octal escape sequences are `\0' followed by up to three octal + digits (if SAWC), or `\' followed by up to three octal digits (if + !SAWC). As an extension, we allow the latter form even if SAWC. */ + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + evalue = OCTVALUE (c); + for (temp = 2 + (!evalue && !!sawc); ISOCTAL (*p) && temp--; p++) + evalue = (evalue * 8) + OCTVALUE (*p); + *cp = evalue & 0xFF; + break; + + /* And, as another extension, we allow \xNN, where each N is a + hex digit. */ + case 'x': + for (temp = 2, evalue = 0; ISXDIGIT ((unsigned char)*p) && temp--; p++) + evalue = (evalue * 16) + HEXVALUE (*p); + if (p == estart + 1) + { + builtin_error (_("missing hex digit for \\x")); + *cp = '\\'; + return 0; + } + *cp = evalue & 0xFF; + break; + +#if defined (HANDLE_MULTIBYTE) + case 'u': + case 'U': + temp = (c == 'u') ? 4 : 8; /* \uNNNN \UNNNNNNNN */ + for (uvalue = 0; ISXDIGIT ((unsigned char)*p) && temp--; p++) + uvalue = (uvalue * 16) + HEXVALUE (*p); + if (p == estart + 1) + { + builtin_error (_("missing unicode digit for \\%c"), c); + *cp = '\\'; + return 0; + } + if (uvalue <= 0x7f) /* <= 0x7f translates directly */ + *cp = uvalue; + else + { + temp = u32cconv (uvalue, cp); + cp[temp] = '\0'; + if (lenp) + *lenp = temp; + } + break; +#endif + + case '\\': /* \\ -> \ */ + *cp = c; + break; + + /* SAWC == 0 means that \', \", and \? are recognized as escape + sequences, though the only processing performed is backslash + removal. */ + case '\'': case '"': case '?': + if (!sawc) + *cp = c; + else + { + *cp = '\\'; + return 0; + } + break; + + case 'c': + if (sawc) + { + *sawc = 1; + break; + } + /* other backslash escapes are passed through unaltered */ + default: + *cp = '\\'; + return 0; + } + return (p - estart); +} + +static char * +bexpand (string, len, sawc, lenp) + char *string; + int len, *sawc, *lenp; +{ + int temp; + char *ret, *r, *s, c; +#if defined (HANDLE_MULTIBYTE) + char mbch[25]; + int mbind, mblen; +#endif + + if (string == 0 || len == 0) + { + if (sawc) + *sawc = 0; + if (lenp) + *lenp = 0; + return ((char *)NULL); + } + + ret = (char *)xmalloc (len + 1); + for (r = ret, s = string; s && *s; ) + { + c = *s++; + if (c != '\\' || *s == '\0') + { + *r++ = c; + continue; + } + temp = 0; +#if defined (HANDLE_MULTIBYTE) + memset (mbch, '\0', sizeof (mbch)); + s += tescape (s, mbch, &mblen, &temp); +#else + s += tescape (s, &c, (int *)NULL, &temp); +#endif + if (temp) + { + if (sawc) + *sawc = 1; + break; + } + +#if defined (HANDLE_MULTIBYTE) + for (mbind = 0; mbind < mblen; mbind++) + *r++ = mbch[mbind]; +#else + *r++ = c; +#endif + } + + *r = '\0'; + if (lenp) + *lenp = r - ret; + return ret; +} + +static char * +vbadd (buf, blen) + char *buf; + int blen; +{ + size_t nlen; + + nlen = vblen + blen + 1; + if (nlen >= vbsize) + { + vbsize = ((nlen + 63) >> 6) << 6; + vbuf = (char *)xrealloc (vbuf, vbsize); + } + + if (blen == 1) + vbuf[vblen++] = buf[0]; + else if (blen > 1) + { + FASTCOPY (buf, vbuf + vblen, blen); + vblen += blen; + } + vbuf[vblen] = '\0'; + +#ifdef DEBUG + if (strlen (vbuf) != vblen) + internal_error ("printf:vbadd: vblen (%d) != strlen (vbuf) (%d)", vblen, (int)strlen (vbuf)); +#endif + + return vbuf; +} + +static int +#if defined (PREFER_STDARG) +vbprintf (const char *format, ...) +#else +vbprintf (format, va_alist) + const char *format; + va_dcl +#endif +{ + va_list args; + size_t nlen; + int blen; + + SH_VA_START (args, format); + blen = vsnprintf (vbuf + vblen, vbsize - vblen, format, args); + va_end (args); + + nlen = vblen + blen + 1; + if (nlen >= vbsize) + { + vbsize = ((nlen + 63) >> 6) << 6; + vbuf = (char *)xrealloc (vbuf, vbsize); + SH_VA_START (args, format); + blen = vsnprintf (vbuf + vblen, vbsize - vblen, format, args); + va_end (args); + } + + vblen += blen; + vbuf[vblen] = '\0'; + +#ifdef DEBUG + if (strlen (vbuf) != vblen) + internal_error ("printf:vbadd: vblen (%d) != strlen (vbuf) (%d)", vblen, (int)strlen (vbuf)); +#endif + + return (blen); +} + +static char * +mklong (str, modifiers, mlen) + char *str; + char *modifiers; + size_t mlen; +{ + size_t len, slen; + + slen = strlen (str); + len = slen + mlen + 1; + + if (len > conv_bufsize) + { + conv_bufsize = (((len + 1023) >> 10) << 10); + conv_buf = (char *)xrealloc (conv_buf, conv_bufsize); + } + + FASTCOPY (str, conv_buf, slen - 1); + FASTCOPY (modifiers, conv_buf + slen - 1, mlen); + + conv_buf[len - 2] = str[slen - 1]; + conv_buf[len - 1] = '\0'; + return (conv_buf); +} + +static int +getchr () +{ + int ret; + + if (garglist == 0) + return ('\0'); + + ret = (int)garglist->word->word[0]; + garglist = garglist->next; + return ret; +} + +static char * +getstr () +{ + char *ret; + + if (garglist == 0) + return (""); + + ret = garglist->word->word; + garglist = garglist->next; + return ret; +} + +static int +getint () +{ + intmax_t ret; + + ret = getintmax (); + + if (garglist == 0) + return ret; + + if (ret > INT_MAX) + { + printf_erange (garglist->word->word); + ret = INT_MAX; + } + else if (ret < INT_MIN) + { + printf_erange (garglist->word->word); + ret = INT_MIN; + } + + return ((int)ret); +} + +static intmax_t +getintmax () +{ + intmax_t ret; + char *ep; + + if (garglist == 0) + return (0); + + if (garglist->word->word[0] == '\'' || garglist->word->word[0] == '"') + return asciicode (); + + errno = 0; + ret = strtoimax (garglist->word->word, &ep, 0); + + if (*ep) + { + sh_invalidnum (garglist->word->word); + /* POSIX.2 says ``...a diagnostic message shall be written to standard + error, and the utility shall not exit with a zero exit status, but + shall continue processing any remaining operands and shall write the + value accumulated at the time the error was detected to standard + output.'' Yecch. */ +#if 0 + ret = 0; /* return partially-converted value from strtoimax */ +#endif + conversion_error = 1; + } + else if (errno == ERANGE) + printf_erange (garglist->word->word); + + garglist = garglist->next; + return (ret); +} + +static uintmax_t +getuintmax () +{ + uintmax_t ret; + char *ep; + + if (garglist == 0) + return (0); + + if (garglist->word->word[0] == '\'' || garglist->word->word[0] == '"') + return asciicode (); + + errno = 0; + ret = strtoumax (garglist->word->word, &ep, 0); + + if (*ep) + { + sh_invalidnum (garglist->word->word); + /* Same POSIX.2 conversion error requirements as getintmax(). */ + ret = 0; + conversion_error = 1; + } + else if (errno == ERANGE) + printf_erange (garglist->word->word); + + garglist = garglist->next; + return (ret); +} + +static floatmax_t +getfloatmax () +{ + floatmax_t ret; + char *ep; + + if (garglist == 0) + return (0); + + if (garglist->word->word[0] == '\'' || garglist->word->word[0] == '"') + return asciicode (); + + errno = 0; + ret = strtofltmax (garglist->word->word, &ep); + + if (*ep) + { + sh_invalidnum (garglist->word->word); + /* Same thing about POSIX.2 conversion error requirements. */ + ret = 0; + conversion_error = 1; + } + else if (errno == ERANGE) + printf_erange (garglist->word->word); + + garglist = garglist->next; + return (ret); +} + +/* NO check is needed for garglist here. */ +static intmax_t +asciicode () +{ + register intmax_t ch; +#if defined (HANDLE_MULTIBYTE) + wchar_t wc; + size_t mblength, slen; +#endif + DECLARE_MBSTATE; + +#if defined (HANDLE_MULTIBYTE) + slen = strlen (garglist->word->word+1); + mblength = MBLEN (garglist->word->word+1, slen); + if (mblength > 1) + { + mblength = mbtowc (&wc, garglist->word->word+1, slen); + ch = wc; /* XXX */ + } + else +#endif + ch = (unsigned char)garglist->word->word[1]; + + garglist = garglist->next; + return (ch); +} + +static SHELL_VAR * +bind_printf_variable (name, value, flags) + char *name; + char *value; + int flags; +{ + SHELL_VAR *v; + +#if defined (ARRAY_VARS) + if (valid_array_reference (name) == 0) + v = bind_variable (name, value, flags); + else + v = assign_array_element (name, value, flags); +#else /* !ARRAY_VARS */ + v = bind_variable (name, value, flags); +#endif /* !ARRAY_VARS */ + + if (v && readonly_p (v) == 0 && noassign_p (v) == 0) + VUNSETATTR (v, att_invisible); + + return v; +} diff --git a/builtins/psize.c b/builtins/psize.c new file mode 100644 index 0000000..30881fb --- /dev/null +++ b/builtins/psize.c @@ -0,0 +1,79 @@ +/* psize.c - Find pipe size. */ + +/* Copyright (C) 1987, 1991 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Write output in 128-byte chunks until we get a sigpipe or write gets an + EPIPE. Then report how many bytes we wrote. We assume that this is the + pipe size. */ +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include +#ifndef _MINIX +#include "../bashtypes.h" +#endif +#include +#include + +#include "../command.h" +#include "../general.h" +#include "../sig.h" + +#ifndef errno +extern int errno; +#endif + +int nw; + +sighandler +sigpipe (sig) + int sig; +{ + fprintf (stderr, "%d\n", nw); + exit (0); +} + +int +main (argc, argv) + int argc; + char **argv; +{ + char buf[128]; + register int i; + + for (i = 0; i < 128; i++) + buf[i] = ' '; + + signal (SIGPIPE, sigpipe); + + nw = 0; + for (;;) + { + int n; + n = write (1, buf, 128); + nw += n; + } + return (0); +} diff --git a/builtins/psize.sh b/builtins/psize.sh new file mode 100644 index 0000000..29bc115 --- /dev/null +++ b/builtins/psize.sh @@ -0,0 +1,45 @@ +#! /bin/sh +# +# psize.sh -- determine this system's pipe size, and write a define to +# pipesize.h so ulimit.c can use it. + +: ${TMPDIR:=/tmp} +# try to use mktemp(1) if the system supports it +{ TMPFILE="`mktemp $TMPDIR/pipsize.XXXXXX 2>/dev/null`"; } 2>/dev/null +used_mktemp=true + +if [ -z "$TMPFILE" ]; then + TMPNAME=pipsize.$$ + TMPFILE=$TMPDIR/$TMPNAME + used_mktemp=false +fi + +trap 'rm -f "$TMPFILE" ; exit 1' 1 2 3 6 15 +trap 'rm -f "$TMPFILE"' 0 + +echo "/*" +echo " * pipesize.h" +echo " *" +echo " * This file is automatically generated by psize.sh" +echo " * Do not edit!" +echo " */" +echo "" + +# +# Try to avoid tempfile races. We can't really check for the file's +# existence before we run psize.aux, because `test -e' is not portable, +# `test -h' (test for symlinks) is not portable, and `test -f' only +# checks for regular files. If we used mktemp(1), we're ahead of the +# game. +# +$used_mktemp || rm -f "$TMPFILE" + +./psize.aux 2>"$TMPFILE" | sleep 3 + +if [ -s "$TMPFILE" ]; then + echo "#define PIPESIZE `cat "$TMPFILE"`" +else + echo "#define PIPESIZE 512" +fi + +exit 0 diff --git a/builtins/pushd.def b/builtins/pushd.def new file mode 100644 index 0000000..9c6548f --- /dev/null +++ b/builtins/pushd.def @@ -0,0 +1,784 @@ +This file is pushd.def, from which is created pushd.c. It implements the +builtins "pushd", "popd", and "dirs" in Bash. + +Copyright (C) 1987-2013 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES pushd.c + +$BUILTIN pushd +$FUNCTION pushd_builtin +$DEPENDS_ON PUSHD_AND_POPD +$SHORT_DOC pushd [-n] [+N | -N | dir] +Add directories to stack. + +Adds a directory to the top of the directory stack, or rotates +the stack, making the new top of the stack the current working +directory. With no arguments, exchanges the top two directories. + +Options: + -n Suppresses the normal change of directory when adding + directories to the stack, so only the stack is manipulated. + +Arguments: + +N Rotates the stack so that the Nth directory (counting + from the left of the list shown by `dirs', starting with + zero) is at the top. + + -N Rotates the stack so that the Nth directory (counting + from the right of the list shown by `dirs', starting with + zero) is at the top. + + dir Adds DIR to the directory stack at the top, making it the + new current working directory. + +The `dirs' builtin displays the directory stack. + +Exit Status: +Returns success unless an invalid argument is supplied or the directory +change fails. +$END + +$BUILTIN popd +$FUNCTION popd_builtin +$DEPENDS_ON PUSHD_AND_POPD +$SHORT_DOC popd [-n] [+N | -N] +Remove directories from stack. + +Removes entries from the directory stack. With no arguments, removes +the top directory from the stack, and changes to the new top directory. + +Options: + -n Suppresses the normal change of directory when removing + directories from the stack, so only the stack is manipulated. + +Arguments: + +N Removes the Nth entry counting from the left of the list + shown by `dirs', starting with zero. For example: `popd +0' + removes the first directory, `popd +1' the second. + + -N Removes the Nth entry counting from the right of the list + shown by `dirs', starting with zero. For example: `popd -0' + removes the last directory, `popd -1' the next to last. + +The `dirs' builtin displays the directory stack. + +Exit Status: +Returns success unless an invalid argument is supplied or the directory +change fails. +$END + +$BUILTIN dirs +$FUNCTION dirs_builtin +$DEPENDS_ON PUSHD_AND_POPD +$SHORT_DOC dirs [-clpv] [+N] [-N] +Display directory stack. + +Display the list of currently remembered directories. Directories +find their way onto the list with the `pushd' command; you can get +back up through the list with the `popd' command. + +Options: + -c clear the directory stack by deleting all of the elements + -l do not print tilde-prefixed versions of directories relative + to your home directory + -p print the directory stack with one entry per line + -v print the directory stack with one entry per line prefixed + with its position in the stack + +Arguments: + +N Displays the Nth entry counting from the left of the list shown by + dirs when invoked without options, starting with zero. + + -N Displays the Nth entry counting from the right of the list shown by + dirs when invoked without options, starting with zero. + +Exit Status: +Returns success unless an invalid option is supplied or an error occurs. +$END + +#include + +#if defined (PUSHD_AND_POPD) +#include +#if defined (HAVE_SYS_PARAM_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "../bashansi.h" +#include "../bashintl.h" + +#include + +#include + +#include "../shell.h" +#include "maxpath.h" +#include "common.h" +#include "builtext.h" + +#ifdef LOADABLE_BUILTIN +# include "builtins.h" +#endif + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +/* The list of remembered directories. */ +static char **pushd_directory_list = (char **)NULL; + +/* Number of existing slots in this list. */ +static int directory_list_size; + +/* Offset to the end of the list. */ +static int directory_list_offset; + +static void pushd_error __P((int, char *)); +static void clear_directory_stack __P((void)); +static int cd_to_string __P((char *)); +static int change_to_temp __P((char *)); +static void add_dirstack_element __P((char *)); +static int get_dirstack_index __P((intmax_t, int, int *)); + +#define NOCD 0x01 +#define ROTATE 0x02 +#define LONGFORM 0x04 +#define CLEARSTAK 0x08 + +int +pushd_builtin (list) + WORD_LIST *list; +{ + WORD_LIST *orig_list; + char *temp, *current_directory, *top; + int j, flags, skipopt; + intmax_t num; + char direction; + + orig_list = list; + if (list && list->word && ISOPTION (list->word->word, '-')) + { + list = list->next; + skipopt = 1; + } + else + skipopt = 0; + + /* If there is no argument list then switch current and + top of list. */ + if (list == 0) + { + if (directory_list_offset == 0) + { + builtin_error (_("no other directory")); + return (EXECUTION_FAILURE); + } + + current_directory = get_working_directory ("pushd"); + if (current_directory == 0) + return (EXECUTION_FAILURE); + + j = directory_list_offset - 1; + temp = pushd_directory_list[j]; + pushd_directory_list[j] = current_directory; + j = change_to_temp (temp); + free (temp); + return j; + } + + for (flags = 0; skipopt == 0 && list; list = list->next) + { + if (ISOPTION (list->word->word, 'n')) + { + flags |= NOCD; + } + else if (ISOPTION (list->word->word, '-')) + { + list = list->next; + break; + } + else if (list->word->word[0] == '-' && list->word->word[1] == '\0') + /* Let `pushd -' work like it used to. */ + break; + else if (((direction = list->word->word[0]) == '+') || direction == '-') + { + if (legal_number (list->word->word + 1, &num) == 0) + { + sh_invalidnum (list->word->word); + builtin_usage (); + return (EX_USAGE); + } + + if (direction == '-') + num = directory_list_offset - num; + + if (num > directory_list_offset || num < 0) + { + pushd_error (directory_list_offset, list->word->word); + return (EXECUTION_FAILURE); + } + flags |= ROTATE; + } + else if (*list->word->word == '-') + { + sh_invalidopt (list->word->word); + builtin_usage (); + return (EX_USAGE); + } + else + break; + } + + if (flags & ROTATE) + { + /* Rotate the stack num times. Remember, the current + directory acts like it is part of the stack. */ + temp = get_working_directory ("pushd"); + + if (num == 0) + { + j = ((flags & NOCD) == 0) ? change_to_temp (temp) : EXECUTION_SUCCESS; + free (temp); + return j; + } + + do + { + top = pushd_directory_list[directory_list_offset - 1]; + + for (j = directory_list_offset - 2; j > -1; j--) + pushd_directory_list[j + 1] = pushd_directory_list[j]; + + pushd_directory_list[j + 1] = temp; + + temp = top; + num--; + } + while (num); + + j = ((flags & NOCD) == 0) ? change_to_temp (temp) : EXECUTION_SUCCESS; + free (temp); + return j; + } + + if (list == 0) + return (EXECUTION_SUCCESS); + + /* Change to the directory in list->word->word. Save the current + directory on the top of the stack. */ + current_directory = get_working_directory ("pushd"); + if (current_directory == 0) + return (EXECUTION_FAILURE); + + j = ((flags & NOCD) == 0) ? cd_builtin (skipopt ? orig_list : list) : EXECUTION_SUCCESS; + if (j == EXECUTION_SUCCESS) + { + add_dirstack_element ((flags & NOCD) ? savestring (list->word->word) : current_directory); + dirs_builtin ((WORD_LIST *)NULL); + if (flags & NOCD) + free (current_directory); + return (EXECUTION_SUCCESS); + } + else + { + free (current_directory); + return (EXECUTION_FAILURE); + } +} + +/* Pop the directory stack, and then change to the new top of the stack. + If LIST is non-null it should consist of a word +N or -N, which says + what element to delete from the stack. The default is the top one. */ +int +popd_builtin (list) + WORD_LIST *list; +{ + register int i; + intmax_t which; + int flags; + char direction; + char *which_word; + + which_word = (char *)NULL; + for (flags = 0, which = 0, direction = '+'; list; list = list->next) + { + if (ISOPTION (list->word->word, 'n')) + { + flags |= NOCD; + } + else if (ISOPTION (list->word->word, '-')) + { + list = list->next; + break; + } + else if (((direction = list->word->word[0]) == '+') || direction == '-') + { + if (legal_number (list->word->word + 1, &which) == 0) + { + sh_invalidnum (list->word->word); + builtin_usage (); + return (EX_USAGE); + } + which_word = list->word->word; + } + else if (*list->word->word == '-') + { + sh_invalidopt (list->word->word); + builtin_usage (); + return (EX_USAGE); + } + else if (*list->word->word) + { + builtin_error (_("%s: invalid argument"), list->word->word); + builtin_usage (); + return (EX_USAGE); + } + else + break; + } + + if (which > directory_list_offset || (directory_list_offset == 0 && which == 0)) + { + pushd_error (directory_list_offset, which_word ? which_word : ""); + return (EXECUTION_FAILURE); + } + + /* Handle case of no specification, or top of stack specification. */ + if ((direction == '+' && which == 0) || + (direction == '-' && which == directory_list_offset)) + { + i = ((flags & NOCD) == 0) ? cd_to_string (pushd_directory_list[directory_list_offset - 1]) + : EXECUTION_SUCCESS; + if (i != EXECUTION_SUCCESS) + return (i); + free (pushd_directory_list[--directory_list_offset]); + } + else + { + /* Since an offset other than the top directory was specified, + remove that directory from the list and shift the remainder + of the list into place. */ + i = (direction == '+') ? directory_list_offset - which : which; + free (pushd_directory_list[i]); + directory_list_offset--; + + /* Shift the remainder of the list into place. */ + for (; i < directory_list_offset; i++) + pushd_directory_list[i] = pushd_directory_list[i + 1]; + } + + dirs_builtin ((WORD_LIST *)NULL); + return (EXECUTION_SUCCESS); +} + +/* Print the current list of directories on the directory stack. */ +int +dirs_builtin (list) + WORD_LIST *list; +{ + int flags, desired_index, index_flag, vflag; + intmax_t i; + char *temp, *w; + + for (flags = vflag = index_flag = 0, desired_index = -1, w = ""; list; list = list->next) + { + if (ISOPTION (list->word->word, 'l')) + { + flags |= LONGFORM; + } + else if (ISOPTION (list->word->word, 'c')) + { + flags |= CLEARSTAK; + } + else if (ISOPTION (list->word->word, 'v')) + { + vflag |= 2; + } + else if (ISOPTION (list->word->word, 'p')) + { + vflag |= 1; + } + else if (ISOPTION (list->word->word, '-')) + { + list = list->next; + break; + } + else if (*list->word->word == '+' || *list->word->word == '-') + { + int sign; + if (legal_number (w = list->word->word + 1, &i) == 0) + { + sh_invalidnum (list->word->word); + builtin_usage (); + return (EX_USAGE); + } + sign = (*list->word->word == '+') ? 1 : -1; + desired_index = get_dirstack_index (i, sign, &index_flag); + } + else + { + sh_invalidopt (list->word->word); + builtin_usage (); + return (EX_USAGE); + } + } + + if (flags & CLEARSTAK) + { + clear_directory_stack (); + return (EXECUTION_SUCCESS); + } + + if (index_flag && (desired_index < 0 || desired_index > directory_list_offset)) + { + pushd_error (directory_list_offset, w); + return (EXECUTION_FAILURE); + } + +#define DIRSTACK_FORMAT(temp) \ + (flags & LONGFORM) ? temp : polite_directory_format (temp) + + /* The first directory printed is always the current working directory. */ + if (index_flag == 0 || (index_flag == 1 && desired_index == 0)) + { + temp = get_working_directory ("dirs"); + if (temp == 0) + temp = savestring (_("")); + if (vflag & 2) + printf ("%2d %s", 0, DIRSTACK_FORMAT (temp)); + else + printf ("%s", DIRSTACK_FORMAT (temp)); + free (temp); + if (index_flag) + { + putchar ('\n'); + return (sh_chkwrite (EXECUTION_SUCCESS)); + } + } + +#define DIRSTACK_ENTRY(i) \ + (flags & LONGFORM) ? pushd_directory_list[i] \ + : polite_directory_format (pushd_directory_list[i]) + + /* Now print the requested directory stack entries. */ + if (index_flag) + { + if (vflag & 2) + printf ("%2d %s", directory_list_offset - desired_index, + DIRSTACK_ENTRY (desired_index)); + else + printf ("%s", DIRSTACK_ENTRY (desired_index)); + } + else + for (i = directory_list_offset - 1; i >= 0; i--) + if (vflag >= 2) + printf ("\n%2d %s", directory_list_offset - (int)i, DIRSTACK_ENTRY (i)); + else + printf ("%s%s", (vflag & 1) ? "\n" : " ", DIRSTACK_ENTRY (i)); + + putchar ('\n'); + + return (sh_chkwrite (EXECUTION_SUCCESS)); +} + +static void +pushd_error (offset, arg) + int offset; + char *arg; +{ + if (offset == 0) + builtin_error (_("directory stack empty")); + else + sh_erange (arg, _("directory stack index")); +} + +static void +clear_directory_stack () +{ + register int i; + + for (i = 0; i < directory_list_offset; i++) + free (pushd_directory_list[i]); + directory_list_offset = 0; +} + +/* Switch to the directory in NAME. This uses the cd_builtin to do the work, + so if the result is EXECUTION_FAILURE then an error message has already + been printed. */ +static int +cd_to_string (name) + char *name; +{ + WORD_LIST *tlist; + WORD_LIST *dir; + int result; + + dir = make_word_list (make_word (name), NULL); + tlist = make_word_list (make_word ("--"), dir); + result = cd_builtin (tlist); + dispose_words (tlist); + return (result); +} + +static int +change_to_temp (temp) + char *temp; +{ + int tt; + + tt = temp ? cd_to_string (temp) : EXECUTION_FAILURE; + + if (tt == EXECUTION_SUCCESS) + dirs_builtin ((WORD_LIST *)NULL); + + return (tt); +} + +static void +add_dirstack_element (dir) + char *dir; +{ + if (directory_list_offset == directory_list_size) + pushd_directory_list = strvec_resize (pushd_directory_list, directory_list_size += 10); + pushd_directory_list[directory_list_offset++] = dir; +} + +static int +get_dirstack_index (ind, sign, indexp) + intmax_t ind; + int sign, *indexp; +{ + if (indexp) + *indexp = sign > 0 ? 1 : 2; + + /* dirs +0 prints the current working directory. */ + /* dirs -0 prints last element in directory stack */ + if (ind == 0 && sign > 0) + return 0; + else if (ind == directory_list_offset) + { + if (indexp) + *indexp = sign > 0 ? 2 : 1; + return 0; + } + else if (ind >= 0 && ind <= directory_list_offset) + return (sign > 0 ? directory_list_offset - ind : ind); + else + return -1; +} + +/* Used by the tilde expansion code. */ +char * +get_dirstack_from_string (string) + char *string; +{ + int ind, sign, index_flag; + intmax_t i; + + sign = 1; + if (*string == '-' || *string == '+') + { + sign = (*string == '-') ? -1 : 1; + string++; + } + if (legal_number (string, &i) == 0) + return ((char *)NULL); + + index_flag = 0; + ind = get_dirstack_index (i, sign, &index_flag); + if (index_flag && (ind < 0 || ind > directory_list_offset)) + return ((char *)NULL); + if (index_flag == 0 || (index_flag == 1 && ind == 0)) + return (get_string_value ("PWD")); + else + return (pushd_directory_list[ind]); +} + +#ifdef INCLUDE_UNUSED +char * +get_dirstack_element (ind, sign) + intmax_t ind; + int sign; +{ + int i; + + i = get_dirstack_index (ind, sign, (int *)NULL); + return (i < 0 || i > directory_list_offset) ? (char *)NULL + : pushd_directory_list[i]; +} +#endif + +void +set_dirstack_element (ind, sign, value) + intmax_t ind; + int sign; + char *value; +{ + int i; + + i = get_dirstack_index (ind, sign, (int *)NULL); + if (ind == 0 || i < 0 || i > directory_list_offset) + return; + free (pushd_directory_list[i]); + pushd_directory_list[i] = savestring (value); +} + +WORD_LIST * +get_directory_stack (flags) + int flags; +{ + register int i; + WORD_LIST *ret; + char *d, *t; + + for (ret = (WORD_LIST *)NULL, i = 0; i < directory_list_offset; i++) + { + d = (flags&1) ? polite_directory_format (pushd_directory_list[i]) + : pushd_directory_list[i]; + ret = make_word_list (make_word (d), ret); + } + /* Now the current directory. */ + d = get_working_directory ("dirstack"); + i = 0; /* sentinel to decide whether or not to free d */ + if (d == 0) + d = "."; + else + { + t = polite_directory_format (d); + /* polite_directory_format sometimes returns its argument unchanged. + If it does not, we can free d right away. If it does, we need to + mark d to be deleted later. */ + if (t != d) + { + free (d); + d = t; + } + else /* t == d, so d is what we want */ + i = 1; + } + ret = make_word_list (make_word (d), ret); + if (i) + free (d); + return ret; /* was (REVERSE_LIST (ret, (WORD_LIST *)); */ +} + +#ifdef LOADABLE_BUILTIN +char * const dirs_doc[] = { +N_("Display the list of currently remembered directories. Directories\n\ + find their way onto the list with the `pushd' command; you can get\n\ + back up through the list with the `popd' command.\n\ + \n\ + Options:\n\ + -c clear the directory stack by deleting all of the elements\n\ + -l do not print tilde-prefixed versions of directories relative\n\ + to your home directory\n\ + -p print the directory stack with one entry per line\n\ + -v print the directory stack with one entry per line prefixed\n\ + with its position in the stack\n\ + \n\ + Arguments:\n\ + +N Displays the Nth entry counting from the left of the list shown by\n\ + dirs when invoked without options, starting with zero.\n\ + \n\ + -N Displays the Nth entry counting from the right of the list shown by\n\ + dirs when invoked without options, starting with zero."), + (char *)NULL +}; + +char * const pushd_doc[] = { +N_("Adds a directory to the top of the directory stack, or rotates\n\ + the stack, making the new top of the stack the current working\n\ + directory. With no arguments, exchanges the top two directories.\n\ + \n\ + Options:\n\ + -n Suppresses the normal change of directory when adding\n\ + directories to the stack, so only the stack is manipulated.\n\ + \n\ + Arguments:\n\ + +N Rotates the stack so that the Nth directory (counting\n\ + from the left of the list shown by `dirs', starting with\n\ + zero) is at the top.\n\ + \n\ + -N Rotates the stack so that the Nth directory (counting\n\ + from the right of the list shown by `dirs', starting with\n\ + zero) is at the top.\n\ + \n\ + dir Adds DIR to the directory stack at the top, making it the\n\ + new current working directory.\n\ + \n\ + The `dirs' builtin displays the directory stack."), + (char *)NULL +}; + +char * const popd_doc[] = { +N_("Removes entries from the directory stack. With no arguments, removes\n\ + the top directory from the stack, and changes to the new top directory.\n\ + \n\ + Options:\n\ + -n Suppresses the normal change of directory when removing\n\ + directories from the stack, so only the stack is manipulated.\n\ + \n\ + Arguments:\n\ + +N Removes the Nth entry counting from the left of the list\n\ + shown by `dirs', starting with zero. For example: `popd +0'\n\ + removes the first directory, `popd +1' the second.\n\ + \n\ + -N Removes the Nth entry counting from the right of the list\n\ + shown by `dirs', starting with zero. For example: `popd -0'\n\ + removes the last directory, `popd -1' the next to last.\n\ + \n\ + The `dirs' builtin displays the directory stack."), + (char *)NULL +}; + +struct builtin pushd_struct = { + "pushd", + pushd_builtin, + BUILTIN_ENABLED, + pushd_doc, + "pushd [+N | -N] [-n] [dir]", + 0 +}; + +struct builtin popd_struct = { + "popd", + popd_builtin, + BUILTIN_ENABLED, + popd_doc, + "popd [+N | -N] [-n]", + 0 +}; + +struct builtin dirs_struct = { + "dirs", + dirs_builtin, + BUILTIN_ENABLED, + dirs_doc, + "dirs [-clpv] [+N] [-N]", + 0 +}; +#endif /* LOADABLE_BUILTIN */ + +#endif /* PUSHD_AND_POPD */ diff --git a/builtins/read.def b/builtins/read.def new file mode 100644 index 0000000..4397154 --- /dev/null +++ b/builtins/read.def @@ -0,0 +1,1096 @@ +This file is read.def, from which is created read.c. +It implements the builtin "read" in Bash. + +Copyright (C) 1987-2012 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES read.c + +$BUILTIN read +$FUNCTION read_builtin +$SHORT_DOC read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...] +Read a line from the standard input and split it into fields. + +Reads a single line from the standard input, or from file descriptor FD +if the -u option is supplied. The line is split into fields as with word +splitting, and the first word is assigned to the first NAME, the second +word to the second NAME, and so on, with any leftover words assigned to +the last NAME. Only the characters found in $IFS are recognized as word +delimiters. + +If no NAMEs are supplied, the line read is stored in the REPLY variable. + +Options: + -a array assign the words read to sequential indices of the array + variable ARRAY, starting at zero + -d delim continue until the first character of DELIM is read, rather + than newline + -e use Readline to obtain the line in an interactive shell + -i text Use TEXT as the initial text for Readline + -n nchars return after reading NCHARS characters rather than waiting + for a newline, but honor a delimiter if fewer than NCHARS + characters are read before the delimiter + -N nchars return only after reading exactly NCHARS characters, unless + EOF is encountered or read times out, ignoring any delimiter + -p prompt output the string PROMPT without a trailing newline before + attempting to read + -r do not allow backslashes to escape any characters + -s do not echo input coming from a terminal + -t timeout time out and return failure if a complete line of input is + not read within TIMEOUT seconds. The value of the TMOUT + variable is the default timeout. TIMEOUT may be a + fractional number. If TIMEOUT is 0, read returns immediately, + without trying to read any data, returning success only if + input is available on the specified file descriptor. The + exit status is greater than 128 if the timeout is exceeded + -u fd read from file descriptor FD instead of the standard input + +Exit Status: +The return code is zero, unless end-of-file is encountered, read times out +(in which case it's greater than 128), a variable assignment error occurs, +or an invalid file descriptor is supplied as the argument to -u. +$END + +#include + +#include "bashtypes.h" +#include "posixstat.h" + +#include + +#include "bashansi.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include + +#ifdef __CYGWIN__ +# include +# include +#endif + +#include "../bashintl.h" + +#include "../shell.h" +#include "common.h" +#include "bashgetopt.h" + +#include + +#if defined (READLINE) +#include "../bashline.h" +#include +#endif + +#if defined (BUFFERED_INPUT) +# include "input.h" +#endif + +#include "shmbutil.h" + +#if !defined(errno) +extern int errno; +#endif + +extern void run_pending_traps __P((void)); + +extern int posixly_correct; +extern int trapped_signal_received; + +struct ttsave +{ + int fd; + TTYSTRUCT *attrs; +}; + +#if defined (READLINE) +static void reset_attempted_completion_function __P((char *)); +static int set_itext __P((void)); +static char *edit_line __P((char *, char *)); +static void set_eol_delim __P((int)); +static void reset_eol_delim __P((char *)); +#endif +static SHELL_VAR *bind_read_variable __P((char *, char *)); +#if defined (HANDLE_MULTIBYTE) +static int read_mbchar __P((int, char *, int, int, int)); +#endif +static void ttyrestore __P((struct ttsave *)); + +static sighandler sigalrm __P((int)); +static void reset_alarm __P((void)); + +/* Try this to see what the rest of the shell can do with the information. */ +procenv_t alrmbuf; +int sigalrm_seen; + +static int reading; +static SigHandler *old_alrm; +static unsigned char delim; + +/* In all cases, SIGALRM just sets a flag that we check periodically. This + avoids problems with the semi-tricky stuff we do with the xfree of + input_string at the top of the unwind-protect list (see below). */ + +/* Set a flag that CHECK_ALRM can check. This relies on zread calling + trap.c:check_signals_and_traps(), which knows about sigalrm_seen and + alrmbuf. */ +static sighandler +sigalrm (s) + int s; +{ + sigalrm_seen = 1; +} + +static void +reset_alarm () +{ + set_signal_handler (SIGALRM, old_alrm); + falarm (0, 0); +} + +/* Read the value of the shell variables whose names follow. + The reading is done from the current input stream, whatever + that may be. Successive words of the input line are assigned + to the variables mentioned in LIST. The last variable in LIST + gets the remainder of the words on the line. If no variables + are mentioned in LIST, then the default variable is $REPLY. */ +int +read_builtin (list) + WORD_LIST *list; +{ + register char *varname; + int size, i, nr, pass_next, saw_escape, eof, opt, retval, code, print_ps2; + int input_is_tty, input_is_pipe, unbuffered_read, skip_ctlesc, skip_ctlnul; + int raw, edit, nchars, silent, have_timeout, ignore_delim, fd, lastsig, t_errno; + unsigned int tmsec, tmusec; + long ival, uval; + intmax_t intval; + char c; + char *input_string, *orig_input_string, *ifs_chars, *prompt, *arrayname; + char *e, *t, *t1, *ps2, *tofree; + struct stat tsb; + SHELL_VAR *var; + TTYSTRUCT ttattrs, ttset; + struct ttsave termsave; +#if defined (ARRAY_VARS) + WORD_LIST *alist; +#endif +#if defined (READLINE) + char *rlbuf, *itext; + int rlind; +#endif + + USE_VAR(size); + USE_VAR(i); + USE_VAR(pass_next); + USE_VAR(print_ps2); + USE_VAR(saw_escape); + USE_VAR(input_is_pipe); +/* USE_VAR(raw); */ + USE_VAR(edit); + USE_VAR(tmsec); + USE_VAR(tmusec); + USE_VAR(nchars); + USE_VAR(silent); + USE_VAR(ifs_chars); + USE_VAR(prompt); + USE_VAR(arrayname); +#if defined (READLINE) + USE_VAR(rlbuf); + USE_VAR(rlind); + USE_VAR(itext); +#endif + USE_VAR(list); + USE_VAR(ps2); + USE_VAR(lastsig); + + sigalrm_seen = reading = 0; + + i = 0; /* Index into the string that we are reading. */ + raw = edit = 0; /* Not reading raw input by default. */ + silent = 0; + arrayname = prompt = (char *)NULL; + fd = 0; /* file descriptor to read from */ + +#if defined (READLINE) + rlbuf = itext = (char *)0; + rlind = 0; +#endif + + tmsec = tmusec = 0; /* no timeout */ + nr = nchars = input_is_tty = input_is_pipe = unbuffered_read = have_timeout = 0; + delim = '\n'; /* read until newline */ + ignore_delim = 0; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "ersa:d:i:n:p:t:u:N:")) != -1) + { + switch (opt) + { + case 'r': + raw = 1; + break; + case 'p': + prompt = list_optarg; + break; + case 's': + silent = 1; + break; + case 'e': +#if defined (READLINE) + edit = 1; +#endif + break; + case 'i': +#if defined (READLINE) + itext = list_optarg; +#endif + break; +#if defined (ARRAY_VARS) + case 'a': + arrayname = list_optarg; + break; +#endif + case 't': + code = uconvert (list_optarg, &ival, &uval); + if (code == 0 || ival < 0 || uval < 0) + { + builtin_error (_("%s: invalid timeout specification"), list_optarg); + return (EXECUTION_FAILURE); + } + else + { + have_timeout = 1; + tmsec = ival; + tmusec = uval; + } + break; + case 'N': + ignore_delim = 1; + delim = -1; + case 'n': + code = legal_number (list_optarg, &intval); + if (code == 0 || intval < 0 || intval != (int)intval) + { + sh_invalidnum (list_optarg); + return (EXECUTION_FAILURE); + } + else + nchars = intval; + break; + case 'u': + code = legal_number (list_optarg, &intval); + if (code == 0 || intval < 0 || intval != (int)intval) + { + builtin_error (_("%s: invalid file descriptor specification"), list_optarg); + return (EXECUTION_FAILURE); + } + else + fd = intval; + if (sh_validfd (fd) == 0) + { + builtin_error (_("%d: invalid file descriptor: %s"), fd, strerror (errno)); + return (EXECUTION_FAILURE); + } + break; + case 'd': + delim = *list_optarg; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + /* `read -t 0 var' tests whether input is available with select/FIONREAD, + and fails if those are unavailable */ + if (have_timeout && tmsec == 0 && tmusec == 0) +#if 0 + return (EXECUTION_FAILURE); +#else + return (input_avail (fd) ? EXECUTION_SUCCESS : EXECUTION_FAILURE); +#endif + + /* Convenience: check early whether or not the first of possibly several + variable names is a valid identifier, and bail early if so. */ +#if defined (ARRAY_VARS) + if (list && legal_identifier (list->word->word) == 0 && valid_array_reference (list->word->word) == 0) +#else + if (list && legal_identifier (list->word->word) == 0) +#endif + { + sh_invalidid (list->word->word); + return (EXECUTION_FAILURE); + } + + /* If we're asked to ignore the delimiter, make sure we do. */ + if (ignore_delim) + delim = -1; + + /* IF IFS is unset, we use the default of " \t\n". */ + ifs_chars = getifs (); + if (ifs_chars == 0) /* XXX - shouldn't happen */ + ifs_chars = ""; + /* If we want to read exactly NCHARS chars, don't split on IFS */ + if (ignore_delim) + ifs_chars = ""; + for (skip_ctlesc = skip_ctlnul = 0, e = ifs_chars; *e; e++) + skip_ctlesc |= *e == CTLESC, skip_ctlnul |= *e == CTLNUL; + + input_string = (char *)xmalloc (size = 112); /* XXX was 128 */ + input_string[0] = '\0'; + + /* $TMOUT, if set, is the default timeout for read. */ + if (have_timeout == 0 && (e = get_string_value ("TMOUT"))) + { + code = uconvert (e, &ival, &uval); + if (code == 0 || ival < 0 || uval < 0) + tmsec = tmusec = 0; + else + { + tmsec = ival; + tmusec = uval; + } + } + + begin_unwind_frame ("read_builtin"); + +#if defined (BUFFERED_INPUT) + if (interactive == 0 && default_buffered_input >= 0 && fd_is_bash_input (fd)) + sync_buffered_stream (default_buffered_input); +#endif + + input_is_tty = isatty (fd); + if (input_is_tty == 0) +#ifndef __CYGWIN__ + input_is_pipe = (lseek (fd, 0L, SEEK_CUR) < 0) && (errno == ESPIPE); +#else + input_is_pipe = 1; +#endif + + /* If the -p, -e or -s flags were given, but input is not coming from the + terminal, turn them off. */ + if ((prompt || edit || silent) && input_is_tty == 0) + { + prompt = (char *)NULL; +#if defined (READLINE) + itext = (char *)NULL; +#endif + edit = silent = 0; + } + +#if defined (READLINE) + if (edit) + add_unwind_protect (xfree, rlbuf); +#endif + + pass_next = 0; /* Non-zero signifies last char was backslash. */ + saw_escape = 0; /* Non-zero signifies that we saw an escape char */ + + if (tmsec > 0 || tmusec > 0) + { + /* Turn off the timeout if stdin is a regular file (e.g. from + input redirection). */ + if ((fstat (fd, &tsb) < 0) || S_ISREG (tsb.st_mode)) + tmsec = tmusec = 0; + } + + if (tmsec > 0 || tmusec > 0) + { + code = setjmp_nosigs (alrmbuf); + if (code) + { + sigalrm_seen = 0; + /* Tricky. The top of the unwind-protect stack is the free of + input_string. We want to run all the rest and use input_string, + so we have to save input_string temporarily, run the unwind- + protects, then restore input_string so we can use it later */ + orig_input_string = 0; + input_string[i] = '\0'; /* make sure it's terminated */ + if (i == 0) + { + t = (char *)xmalloc (1); + t[0] = 0; + } + else + t = savestring (input_string); + + run_unwind_frame ("read_builtin"); + input_string = t; + retval = 128+SIGALRM; + goto assign_vars; + } + old_alrm = set_signal_handler (SIGALRM, sigalrm); + add_unwind_protect (reset_alarm, (char *)NULL); +#if defined (READLINE) + if (edit) + { + add_unwind_protect (reset_attempted_completion_function, (char *)NULL); + add_unwind_protect (bashline_reset_event_hook, (char *)NULL); + } +#endif + falarm (tmsec, tmusec); + } + + /* If we've been asked to read only NCHARS chars, or we're using some + character other than newline to terminate the line, do the right + thing to readline or the tty. */ + if (nchars > 0 || delim != '\n') + { +#if defined (READLINE) + if (edit) + { + if (nchars > 0) + { + unwind_protect_int (rl_num_chars_to_read); + rl_num_chars_to_read = nchars; + } + if (delim != '\n') + { + set_eol_delim (delim); + add_unwind_protect (reset_eol_delim, (char *)NULL); + } + } + else +#endif + if (input_is_tty) + { + /* ttsave() */ + termsave.fd = fd; + ttgetattr (fd, &ttattrs); + termsave.attrs = &ttattrs; + + ttset = ttattrs; + i = silent ? ttfd_cbreak (fd, &ttset) : ttfd_onechar (fd, &ttset); + if (i < 0) + sh_ttyerror (1); + add_unwind_protect ((Function *)ttyrestore, (char *)&termsave); + } + } + else if (silent) /* turn off echo but leave term in canonical mode */ + { + /* ttsave (); */ + termsave.fd = fd; + ttgetattr (fd, &ttattrs); + termsave.attrs = &ttattrs; + + ttset = ttattrs; + i = ttfd_noecho (fd, &ttset); /* ttnoecho (); */ + if (i < 0) + sh_ttyerror (1); + + add_unwind_protect ((Function *)ttyrestore, (char *)&termsave); + } + + /* This *must* be the top unwind-protect on the stack, so the manipulation + of the unwind-protect stack after the realloc() works right. */ + add_unwind_protect (xfree, input_string); + + CHECK_ALRM; + if ((nchars > 0) && (input_is_tty == 0) && ignore_delim) /* read -N */ + unbuffered_read = 2; + else if ((nchars > 0) || (delim != '\n') || input_is_pipe) + unbuffered_read = 1; + + if (prompt && edit == 0) + { + fprintf (stderr, "%s", prompt); + fflush (stderr); + } + +#if defined (__CYGWIN__) && defined (O_TEXT) + setmode (0, O_TEXT); +#endif + + ps2 = 0; + for (print_ps2 = eof = retval = 0;;) + { + CHECK_ALRM; + +#if defined (READLINE) + if (edit) + { + if (rlbuf && rlbuf[rlind] == '\0') + { + xfree (rlbuf); + rlbuf = (char *)0; + } + if (rlbuf == 0) + { + reading = 1; + rlbuf = edit_line (prompt ? prompt : "", itext); + reading = 0; + rlind = 0; + } + if (rlbuf == 0) + { + eof = 1; + break; + } + c = rlbuf[rlind++]; + } + else + { +#endif + + if (print_ps2) + { + if (ps2 == 0) + ps2 = get_string_value ("PS2"); + fprintf (stderr, "%s", ps2 ? ps2 : ""); + fflush (stderr); + print_ps2 = 0; + } + +#if 0 + if (posixly_correct == 0) + interrupt_immediately++; +#endif + reading = 1; + if (unbuffered_read == 2) + retval = posixly_correct ? zreadintr (fd, &c, 1) : zreadn (fd, &c, nchars - nr); + else if (unbuffered_read) + retval = posixly_correct ? zreadintr (fd, &c, 1) : zread (fd, &c, 1); + else + retval = posixly_correct ? zreadcintr (fd, &c) : zreadc (fd, &c); + reading = 0; +#if 0 + if (posixly_correct == 0) + interrupt_immediately--; +#endif + + if (retval <= 0) + { + if (retval < 0 && errno == EINTR) + { + lastsig = LASTSIG(); + if (lastsig == 0) + lastsig = trapped_signal_received; + run_pending_traps (); /* because interrupt_immediately is not set */ + } + else + lastsig = 0; + CHECK_TERMSIG; + eof = 1; + break; + } + + CHECK_ALRM; + +#if defined (READLINE) + } +#endif + + CHECK_ALRM; + if (i + 4 >= size) /* XXX was i + 2; use i + 4 for multibyte/read_mbchar */ + { + char *t; + t = (char *)xrealloc (input_string, size += 128); + + /* Only need to change unwind-protect if input_string changes */ + if (t != input_string) + { + input_string = t; + remove_unwind_protect (); + add_unwind_protect (xfree, input_string); + } + } + + /* If the next character is to be accepted verbatim, a backslash + newline pair still disappears from the input. */ + if (pass_next) + { + pass_next = 0; + if (c == '\n') + { + i--; /* back up over the CTLESC */ + if (interactive && input_is_tty && raw == 0) + print_ps2 = 1; + } + else + goto add_char; + continue; + } + + /* This may cause problems if IFS contains CTLESC */ + if (c == '\\' && raw == 0) + { + pass_next++; + if (skip_ctlesc == 0) + { + saw_escape++; + input_string[i++] = CTLESC; + } + continue; + } + + if (ignore_delim == 0 && (unsigned char)c == delim) + break; + + if (c == '\0' && delim != '\0') + continue; /* skip NUL bytes in input */ + + if ((skip_ctlesc == 0 && c == CTLESC) || (skip_ctlnul == 0 && c == CTLNUL)) + { + saw_escape++; + input_string[i++] = CTLESC; + } + +add_char: + input_string[i++] = c; + CHECK_ALRM; + +#if defined (HANDLE_MULTIBYTE) + if (nchars > 0 && MB_CUR_MAX > 1 && is_basic (c) == 0) + { + input_string[i] = '\0'; /* for simplicity and debugging */ + i += read_mbchar (fd, input_string, i, c, unbuffered_read); + } +#endif + + nr++; + + if (nchars > 0 && nr >= nchars) + break; + } + input_string[i] = '\0'; + CHECK_ALRM; + + if (retval < 0) + { + t_errno = errno; + if (errno != EINTR) + builtin_error (_("read error: %d: %s"), fd, strerror (errno)); + run_unwind_frame ("read_builtin"); + return ((t_errno != EINTR) ? EXECUTION_FAILURE : 128+lastsig); + } + + if (tmsec > 0 || tmusec > 0) + reset_alarm (); + + if (nchars > 0 || delim != '\n') + { +#if defined (READLINE) + if (edit) + { + if (nchars > 0) + rl_num_chars_to_read = 0; + if (delim != '\n') + reset_eol_delim ((char *)NULL); + } + else +#endif + if (input_is_tty) + ttyrestore (&termsave); + } + else if (silent) + ttyrestore (&termsave); + + if (unbuffered_read == 0) + zsyncfd (fd); + + discard_unwind_frame ("read_builtin"); + + retval = eof ? EXECUTION_FAILURE : EXECUTION_SUCCESS; + +assign_vars: + +#if defined (ARRAY_VARS) + /* If -a was given, take the string read, break it into a list of words, + an assign them to `arrayname' in turn. */ + if (arrayname) + { + if (legal_identifier (arrayname) == 0) + { + sh_invalidid (arrayname); + xfree (input_string); + return (EXECUTION_FAILURE); + } + + var = find_or_make_array_variable (arrayname, 1); + if (var == 0) + { + xfree (input_string); + return EXECUTION_FAILURE; /* readonly or noassign */ + } + if (assoc_p (var)) + { + builtin_error (_("%s: cannot convert associative to indexed array"), arrayname); + xfree (input_string); + return EXECUTION_FAILURE; /* existing associative array */ + } + else if (invisible_p (var)) + VUNSETATTR (var, att_invisible); + array_flush (array_cell (var)); + + alist = list_string (input_string, ifs_chars, 0); + if (alist) + { + if (saw_escape) + dequote_list (alist); + else + word_list_remove_quoted_nulls (alist); + assign_array_var_from_word_list (var, alist, 0); + dispose_words (alist); + } + xfree (input_string); + return (retval); + } +#endif /* ARRAY_VARS */ + + /* If there are no variables, save the text of the line read to the + variable $REPLY. ksh93 strips leading and trailing IFS whitespace, + so that `read x ; echo "$x"' and `read ; echo "$REPLY"' behave the + same way, but I believe that the difference in behaviors is useful + enough to not do it. Without the bash behavior, there is no way + to read a line completely without interpretation or modification + unless you mess with $IFS (e.g., setting it to the empty string). + If you disagree, change the occurrences of `#if 0' to `#if 1' below. */ + if (list == 0) + { +#if 0 + orig_input_string = input_string; + for (t = input_string; ifs_chars && *ifs_chars && spctabnl(*t) && isifs(*t); t++) + ; + input_string = t; + input_string = strip_trailing_ifs_whitespace (input_string, ifs_chars, saw_escape); +#endif + + if (saw_escape) + { + t = dequote_string (input_string); + var = bind_variable ("REPLY", t, 0); + free (t); + } + else + var = bind_variable ("REPLY", input_string, 0); + VUNSETATTR (var, att_invisible); + + xfree (input_string); + return (retval); + } + + /* This code implements the Posix.2 spec for splitting the words + read and assigning them to variables. */ + orig_input_string = input_string; + + /* Remove IFS white space at the beginning of the input string. If + $IFS is null, no field splitting is performed. */ + for (t = input_string; ifs_chars && *ifs_chars && spctabnl(*t) && isifs(*t); t++) + ; + input_string = t; + for (; list->next; list = list->next) + { + varname = list->word->word; +#if defined (ARRAY_VARS) + if (legal_identifier (varname) == 0 && valid_array_reference (varname) == 0) +#else + if (legal_identifier (varname) == 0) +#endif + { + sh_invalidid (varname); + xfree (orig_input_string); + return (EXECUTION_FAILURE); + } + + /* If there are more variables than words read from the input, + the remaining variables are set to the empty string. */ + if (*input_string) + { + /* This call updates INPUT_STRING. */ + t = get_word_from_string (&input_string, ifs_chars, &e); + if (t) + *e = '\0'; + /* Don't bother to remove the CTLESC unless we added one + somewhere while reading the string. */ + if (t && saw_escape) + { + t1 = dequote_string (t); + var = bind_read_variable (varname, t1); + xfree (t1); + } + else + var = bind_read_variable (varname, t ? t : ""); + } + else + { + t = (char *)0; + var = bind_read_variable (varname, ""); + } + + FREE (t); + if (var == 0) + { + xfree (orig_input_string); + return (EXECUTION_FAILURE); + } + + stupidly_hack_special_variables (varname); + VUNSETATTR (var, att_invisible); + } + + /* Now assign the rest of the line to the last variable argument. */ +#if defined (ARRAY_VARS) + if (legal_identifier (list->word->word) == 0 && valid_array_reference (list->word->word) == 0) +#else + if (legal_identifier (list->word->word) == 0) +#endif + { + sh_invalidid (list->word->word); + xfree (orig_input_string); + return (EXECUTION_FAILURE); + } + +#if 0 + /* This has to be done this way rather than using string_list + and list_string because Posix.2 says that the last variable gets the + remaining words and their intervening separators. */ + input_string = strip_trailing_ifs_whitespace (input_string, ifs_chars, saw_escape); +#else + /* Check whether or not the number of fields is exactly the same as the + number of variables. */ + tofree = NULL; + if (*input_string) + { + t1 = input_string; + t = get_word_from_string (&input_string, ifs_chars, &e); + if (*input_string == 0) + tofree = input_string = t; + else + { + input_string = strip_trailing_ifs_whitespace (t1, ifs_chars, saw_escape); + tofree = t; + } + } +#endif + + if (saw_escape && input_string && *input_string) + { + t = dequote_string (input_string); + var = bind_read_variable (list->word->word, t); + xfree (t); + } + else + var = bind_read_variable (list->word->word, input_string ? input_string : ""); + + if (var) + { + stupidly_hack_special_variables (list->word->word); + VUNSETATTR (var, att_invisible); + } + else + retval = EXECUTION_FAILURE; + + FREE (tofree); + xfree (orig_input_string); + + return (retval); +} + +static SHELL_VAR * +bind_read_variable (name, value) + char *name, *value; +{ + SHELL_VAR *v; + +#if defined (ARRAY_VARS) + if (valid_array_reference (name) == 0) + v = bind_variable (name, value, 0); + else + v = assign_array_element (name, value, 0); +#else /* !ARRAY_VARS */ + v = bind_variable (name, value, 0); +#endif /* !ARRAY_VARS */ + return (v == 0 ? v + : ((readonly_p (v) || noassign_p (v)) ? (SHELL_VAR *)NULL : v)); +} + +#if defined (HANDLE_MULTIBYTE) +static int +read_mbchar (fd, string, ind, ch, unbuffered) + int fd; + char *string; + int ind, ch, unbuffered; +{ + char mbchar[MB_LEN_MAX + 1]; + int i, n, r; + char c; + size_t ret; + mbstate_t ps, ps_back; + wchar_t wc; + + memset (&ps, '\0', sizeof (mbstate_t)); + memset (&ps_back, '\0', sizeof (mbstate_t)); + + mbchar[0] = ch; + i = 1; + for (n = 0; n <= MB_LEN_MAX; n++) + { + ps_back = ps; + ret = mbrtowc (&wc, mbchar, i, &ps); + if (ret == (size_t)-2) + { + ps = ps_back; + /* We don't want to be interrupted during a multibyte char read */ + if (unbuffered) + r = zread (fd, &c, 1); + else + r = zreadc (fd, &c); + if (r < 0) + goto mbchar_return; + mbchar[i++] = c; + continue; + } + else if (ret == (size_t)-1 || ret == (size_t)0 || ret > (size_t)0) + break; + } + +mbchar_return: + if (i > 1) /* read a multibyte char */ + /* mbchar[0] is already string[ind-1] */ + for (r = 1; r < i; r++) + string[ind+r-1] = mbchar[r]; + return i - 1; +} +#endif + + +static void +ttyrestore (ttp) + struct ttsave *ttp; +{ + ttsetattr (ttp->fd, ttp->attrs); +} + +#if defined (READLINE) +static rl_completion_func_t *old_attempted_completion_function = 0; +static rl_hook_func_t *old_startup_hook; +static char *deftext; + +static void +reset_attempted_completion_function (cp) + char *cp; +{ + if (rl_attempted_completion_function == 0 && old_attempted_completion_function) + rl_attempted_completion_function = old_attempted_completion_function; +} + +static int +set_itext () +{ + int r1, r2; + + r1 = r2 = 0; + if (old_startup_hook) + r1 = (*old_startup_hook) (); + if (deftext) + { + r2 = rl_insert_text (deftext); + deftext = (char *)NULL; + rl_startup_hook = old_startup_hook; + old_startup_hook = (rl_hook_func_t *)NULL; + } + return (r1 || r2); +} + +static char * +edit_line (p, itext) + char *p; + char *itext; +{ + char *ret; + int len; + + if (bash_readline_initialized == 0) + initialize_readline (); + + old_attempted_completion_function = rl_attempted_completion_function; + rl_attempted_completion_function = (rl_completion_func_t *)NULL; + bashline_set_event_hook (); + if (itext) + { + old_startup_hook = rl_startup_hook; + rl_startup_hook = set_itext; + deftext = itext; + } + + ret = readline (p); + + rl_attempted_completion_function = old_attempted_completion_function; + old_attempted_completion_function = (rl_completion_func_t *)NULL; + bashline_reset_event_hook (); + + if (ret == 0) + return ret; + len = strlen (ret); + ret = (char *)xrealloc (ret, len + 2); + ret[len++] = delim; + ret[len] = '\0'; + return ret; +} + +static int old_delim_ctype; +static rl_command_func_t *old_delim_func; +static int old_newline_ctype; +static rl_command_func_t *old_newline_func; + +static unsigned char delim_char; + +static void +set_eol_delim (c) + int c; +{ + Keymap cmap; + + if (bash_readline_initialized == 0) + initialize_readline (); + cmap = rl_get_keymap (); + + /* Change newline to self-insert */ + old_newline_ctype = cmap[RETURN].type; + old_newline_func = cmap[RETURN].function; + cmap[RETURN].type = ISFUNC; + cmap[RETURN].function = rl_insert; + + /* Bind the delimiter character to accept-line. */ + old_delim_ctype = cmap[c].type; + old_delim_func = cmap[c].function; + cmap[c].type = ISFUNC; + cmap[c].function = rl_newline; + + delim_char = c; +} + +static void +reset_eol_delim (cp) + char *cp; +{ + Keymap cmap; + + cmap = rl_get_keymap (); + + cmap[RETURN].type = old_newline_ctype; + cmap[RETURN].function = old_newline_func; + + cmap[delim_char].type = old_delim_ctype; + cmap[delim_char].function = old_delim_func; +} +#endif diff --git a/builtins/reserved.def b/builtins/reserved.def new file mode 100644 index 0000000..2478f16 --- /dev/null +++ b/builtins/reserved.def @@ -0,0 +1,288 @@ +This file is reserved.def, in which the shell reserved words are defined. +It has no direct C file production, but defines builtins for the Bash +builtin help command. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$BUILTIN for +$SHORT_DOC for NAME [in WORDS ... ] ; do COMMANDS; done +Execute commands for each member in a list. + +The `for' loop executes a sequence of commands for each member in a +list of items. If `in WORDS ...;' is not present, then `in "$@"' is +assumed. For each element in WORDS, NAME is set to that element, and +the COMMANDS are executed. + +Exit Status: +Returns the status of the last command executed. +$END + +$BUILTIN for (( +$DOCNAME arith_for +$SHORT_DOC for (( exp1; exp2; exp3 )); do COMMANDS; done +Arithmetic for loop. + +Equivalent to + (( EXP1 )) + while (( EXP2 )); do + COMMANDS + (( EXP3 )) + done +EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is +omitted, it behaves as if it evaluates to 1. + +Exit Status: +Returns the status of the last command executed. +$END + +$BUILTIN select +$SHORT_DOC select NAME [in WORDS ... ;] do COMMANDS; done +Select words from a list and execute commands. + +The WORDS are expanded, generating a list of words. The +set of expanded words is printed on the standard error, each +preceded by a number. If `in WORDS' is not present, `in "$@"' +is assumed. The PS3 prompt is then displayed and a line read +from the standard input. If the line consists of the number +corresponding to one of the displayed words, then NAME is set +to that word. If the line is empty, WORDS and the prompt are +redisplayed. If EOF is read, the command completes. Any other +value read causes NAME to be set to null. The line read is saved +in the variable REPLY. COMMANDS are executed after each selection +until a break command is executed. + +Exit Status: +Returns the status of the last command executed. +$END + +$BUILTIN time +$SHORT_DOC time [-p] pipeline +Report time consumed by pipeline's execution. + +Execute PIPELINE and print a summary of the real time, user CPU time, +and system CPU time spent executing PIPELINE when it terminates. + +Options: + -p print the timing summary in the portable Posix format + +The value of the TIMEFORMAT variable is used as the output format. + +Exit Status: +The return status is the return status of PIPELINE. +$END + +$BUILTIN case +$SHORT_DOC case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac +Execute commands based on pattern matching. + +Selectively execute COMMANDS based upon WORD matching PATTERN. The +`|' is used to separate multiple patterns. + +Exit Status: +Returns the status of the last command executed. +$END + +$BUILTIN if +$SHORT_DOC if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else COMMANDS; ] fi +Execute commands based on conditional. + +The `if COMMANDS' list is executed. If its exit status is zero, then the +`then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list is +executed in turn, and if its exit status is zero, the corresponding +`then COMMANDS' list is executed and the if command completes. Otherwise, +the `else COMMANDS' list is executed, if present. The exit status of the +entire construct is the exit status of the last command executed, or zero +if no condition tested true. + +Exit Status: +Returns the status of the last command executed. +$END + +$BUILTIN while +$SHORT_DOC while COMMANDS; do COMMANDS; done +Execute commands as long as a test succeeds. + +Expand and execute COMMANDS as long as the final command in the +`while' COMMANDS has an exit status of zero. + +Exit Status: +Returns the status of the last command executed. +$END + +$BUILTIN until +$SHORT_DOC until COMMANDS; do COMMANDS; done +Execute commands as long as a test does not succeed. + +Expand and execute COMMANDS as long as the final command in the +`until' COMMANDS has an exit status which is not zero. + +Exit Status: +Returns the status of the last command executed. +$END + +$BUILTIN coproc +$SHORT_DOC coproc [NAME] command [redirections] +Create a coprocess named NAME. + +Execute COMMAND asynchronously, with the standard output and standard +input of the command connected via a pipe to file descriptors assigned +to indices 0 and 1 of an array variable NAME in the executing shell. +The default NAME is "COPROC". + +Exit Status: +Returns the exit status of COMMAND. +$END + +$BUILTIN function +$SHORT_DOC function name { COMMANDS ; } or name () { COMMANDS ; } +Define shell function. + +Create a shell function named NAME. When invoked as a simple command, +NAME runs COMMANDs in the calling shell's context. When NAME is invoked, +the arguments are passed to the function as $1...$n, and the function's +name is in $FUNCNAME. + +Exit Status: +Returns success unless NAME is readonly. +$END + +$BUILTIN { ... } +$DOCNAME grouping_braces +$SHORT_DOC { COMMANDS ; } +Group commands as a unit. + +Run a set of commands in a group. This is one way to redirect an +entire set of commands. + +Exit Status: +Returns the status of the last command executed. +$END + +$BUILTIN % +$DOCNAME fg_percent +$SHORT_DOC job_spec [&] +Resume job in foreground. + +Equivalent to the JOB_SPEC argument to the `fg' command. Resume a +stopped or background job. JOB_SPEC can specify either a job name +or a job number. Following JOB_SPEC with a `&' places the job in +the background, as if the job specification had been supplied as an +argument to `bg'. + +Exit Status: +Returns the status of the resumed job. +$END + +$BUILTIN (( ... )) +$DOCNAME arith +$SHORT_DOC (( expression )) +Evaluate arithmetic expression. + +The EXPRESSION is evaluated according to the rules for arithmetic +evaluation. Equivalent to "let EXPRESSION". + +Exit Status: +Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise. +$END + +$BUILTIN [[ ... ]] +$DOCNAME conditional +$SHORT_DOC [[ expression ]] +Execute conditional command. + +Returns a status of 0 or 1 depending on the evaluation of the conditional +expression EXPRESSION. Expressions are composed of the same primaries used +by the `test' builtin, and may be combined using the following operators: + + ( EXPRESSION ) Returns the value of EXPRESSION + ! EXPRESSION True if EXPRESSION is false; else false + EXPR1 && EXPR2 True if both EXPR1 and EXPR2 are true; else false + EXPR1 || EXPR2 True if either EXPR1 or EXPR2 is true; else false + +When the `==' and `!=' operators are used, the string to the right of +the operator is used as a pattern and pattern matching is performed. +When the `=~' operator is used, the string to the right of the operator +is matched as a regular expression. + +The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to +determine the expression's value. + +Exit Status: +0 or 1 depending on value of EXPRESSION. +$END + +$BUILTIN variables +$DOCNAME variable_help +$SHORT_DOC variables - Names and meanings of some shell variables +Common shell variable names and usage. + +BASH_VERSION Version information for this Bash. +CDPATH A colon-separated list of directories to search + for directories given as arguments to `cd'. +GLOBIGNORE A colon-separated list of patterns describing filenames to + be ignored by pathname expansion. +#if defined (HISTORY) +HISTFILE The name of the file where your command history is stored. +HISTFILESIZE The maximum number of lines this file can contain. +HISTSIZE The maximum number of history lines that a running + shell can access. +#endif /* HISTORY */ +HOME The complete pathname to your login directory. +HOSTNAME The name of the current host. +HOSTTYPE The type of CPU this version of Bash is running under. +IGNOREEOF Controls the action of the shell on receipt of an EOF + character as the sole input. If set, then the value + of it is the number of EOF characters that can be seen + in a row on an empty line before the shell will exit + (default 10). When unset, EOF signifies the end of input. +MACHTYPE A string describing the current system Bash is running on. +MAILCHECK How often, in seconds, Bash checks for new mail. +MAILPATH A colon-separated list of filenames which Bash checks + for new mail. +OSTYPE The version of Unix this version of Bash is running on. +PATH A colon-separated list of directories to search when + looking for commands. +PROMPT_COMMAND A command to be executed before the printing of each + primary prompt. +PS1 The primary prompt string. +PS2 The secondary prompt string. +PWD The full pathname of the current directory. +SHELLOPTS A colon-separated list of enabled shell options. +TERM The name of the current terminal type. +TIMEFORMAT The output format for timing statistics displayed by the + `time' reserved word. +auto_resume Non-null means a command word appearing on a line by + itself is first looked for in the list of currently + stopped jobs. If found there, that job is foregrounded. + A value of `exact' means that the command word must + exactly match a command in the list of stopped jobs. A + value of `substring' means that the command word must + match a substring of the job. Any other value means that + the command must be a prefix of a stopped job. +#if defined (HISTORY) +# if defined (BANG_HISTORY) +histchars Characters controlling history expansion and quick + substitution. The first character is the history + substitution character, usually `!'. The second is + the `quick substitution' character, usually `^'. The + third is the `history comment' character, usually `#'. +# endif /* BANG_HISTORY */ +HISTIGNORE A colon-separated list of patterns used to decide which + commands should be saved on the history list. +#endif /* HISTORY */ +$END diff --git a/builtins/return.def b/builtins/return.def new file mode 100644 index 0000000..e6674df --- /dev/null +++ b/builtins/return.def @@ -0,0 +1,78 @@ +This file is return.def, from which is created return.c. +It implements the builtin "return" in Bash. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES return.c + +$BUILTIN return + +$FUNCTION return_builtin +$SHORT_DOC return [n] +Return from a shell function. + +Causes a function or sourced script to exit with the return value +specified by N. If N is omitted, the return status is that of the +last command executed within the function or script. + +Exit Status: +Returns N, or failure if the shell is not executing a function or script. +$END + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "../bashintl.h" + +#include "../shell.h" +#include "common.h" +#include "bashgetopt.h" + +extern int last_command_exit_value; +extern int subshell_environment; +extern int return_catch_flag, return_catch_value; + +/* If we are executing a user-defined function then exit with the value + specified as an argument. if no argument is given, then the last + exit status is used. */ +int +return_builtin (list) + WORD_LIST *list; +{ +#if 0 + if (no_options (list)) + return (EX_USAGE); + list = loptend; /* skip over possible `--' */ +#endif + + return_catch_value = get_exitstat (list); + + if (return_catch_flag) + longjmp (return_catch, 1); + else + { + builtin_error (_("can only `return' from a function or sourced script")); + return (EXECUTION_FAILURE); + } +} diff --git a/builtins/set.def b/builtins/set.def new file mode 100644 index 0000000..c4a7001 --- /dev/null +++ b/builtins/set.def @@ -0,0 +1,885 @@ +This file is set.def, from which is created set.c. +It implements the "set" and "unset" builtins in Bash. + +Copyright (C) 1987-2012 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES set.c + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include + +#include "../bashansi.h" +#include "../bashintl.h" + +#include "../shell.h" +#include "../flags.h" +#include "common.h" +#include "bashgetopt.h" + +#if defined (READLINE) +# include "../input.h" +# include "../bashline.h" +# include +#endif + +#if defined (HISTORY) +# include "../bashhist.h" +#endif + +extern int posixly_correct, ignoreeof, eof_encountered_limit; +#if defined (HISTORY) +extern int dont_save_function_defs; +#endif +#if defined (READLINE) +extern int no_line_editing; +#endif /* READLINE */ + +$BUILTIN set +$FUNCTION set_builtin +$SHORT_DOC set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...] +Set or unset values of shell options and positional parameters. + +Change the value of shell attributes and positional parameters, or +display the names and values of shell variables. + +Options: + -a Mark variables which are modified or created for export. + -b Notify of job termination immediately. + -e Exit immediately if a command exits with a non-zero status. + -f Disable file name generation (globbing). + -h Remember the location of commands as they are looked up. + -k All assignment arguments are placed in the environment for a + command, not just those that precede the command name. + -m Job control is enabled. + -n Read commands but do not execute them. + -o option-name + Set the variable corresponding to option-name: + allexport same as -a + braceexpand same as -B +#if defined (READLINE) + emacs use an emacs-style line editing interface +#endif /* READLINE */ + errexit same as -e + errtrace same as -E + functrace same as -T + hashall same as -h +#if defined (BANG_HISTORY) + histexpand same as -H +#endif /* BANG_HISTORY */ +#if defined (HISTORY) + history enable command history +#endif + ignoreeof the shell will not exit upon reading EOF + interactive-comments + allow comments to appear in interactive commands + keyword same as -k +#if defined (JOB_CONTROL) + monitor same as -m +#endif + noclobber same as -C + noexec same as -n + noglob same as -f + nolog currently accepted but ignored +#if defined (JOB_CONTROL) + notify same as -b +#endif + nounset same as -u + onecmd same as -t + physical same as -P + pipefail the return value of a pipeline is the status of + the last command to exit with a non-zero status, + or zero if no command exited with a non-zero status + posix change the behavior of bash where the default + operation differs from the Posix standard to + match the standard + privileged same as -p + verbose same as -v +#if defined (READLINE) + vi use a vi-style line editing interface +#endif /* READLINE */ + xtrace same as -x + -p Turned on whenever the real and effective user ids do not match. + Disables processing of the $ENV file and importing of shell + functions. Turning this option off causes the effective uid and + gid to be set to the real uid and gid. + -t Exit after reading and executing one command. + -u Treat unset variables as an error when substituting. + -v Print shell input lines as they are read. + -x Print commands and their arguments as they are executed. +#if defined (BRACE_EXPANSION) + -B the shell will perform brace expansion +#endif /* BRACE_EXPANSION */ + -C If set, disallow existing regular files to be overwritten + by redirection of output. + -E If set, the ERR trap is inherited by shell functions. +#if defined (BANG_HISTORY) + -H Enable ! style history substitution. This flag is on + by default when the shell is interactive. +#endif /* BANG_HISTORY */ + -P If set, do not resolve symbolic links when executing commands + such as cd which change the current directory. + -T If set, the DEBUG trap is inherited by shell functions. + -- Assign any remaining arguments to the positional parameters. + If there are no remaining arguments, the positional parameters + are unset. + - Assign any remaining arguments to the positional parameters. + The -x and -v options are turned off. + +Using + rather than - causes these flags to be turned off. The +flags can also be used upon invocation of the shell. The current +set of flags may be found in $-. The remaining n ARGs are positional +parameters and are assigned, in order, to $1, $2, .. $n. If no +ARGs are given, all shell variables are printed. + +Exit Status: +Returns success unless an invalid option is given. +$END + +typedef int setopt_set_func_t __P((int, char *)); +typedef int setopt_get_func_t __P((char *)); + +static void print_minus_o_option __P((char *, int, int)); +static void print_all_shell_variables __P((void)); + +static int set_ignoreeof __P((int, char *)); +static int set_posix_mode __P((int, char *)); + +#if defined (READLINE) +static int set_edit_mode __P((int, char *)); +static int get_edit_mode __P((char *)); +#endif + +#if defined (HISTORY) +static int bash_set_history __P((int, char *)); +#endif + +static const char * const on = "on"; +static const char * const off = "off"; + +/* A struct used to match long options for set -o to the corresponding + option letter or internal variable. The functions can be called to + dynamically generate values. */ +const struct { + char *name; + int letter; + int *variable; + setopt_set_func_t *set_func; + setopt_get_func_t *get_func; +} o_options[] = { + { "allexport", 'a', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, +#if defined (BRACE_EXPANSION) + { "braceexpand",'B', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, +#endif +#if defined (READLINE) + { "emacs", '\0', (int *)NULL, set_edit_mode, get_edit_mode }, +#endif + { "errexit", 'e', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + { "errtrace", 'E', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + { "functrace", 'T', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + { "hashall", 'h', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, +#if defined (BANG_HISTORY) + { "histexpand", 'H', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, +#endif /* BANG_HISTORY */ +#if defined (HISTORY) + { "history", '\0', &enable_history_list, bash_set_history, (setopt_get_func_t *)NULL }, +#endif + { "ignoreeof", '\0', &ignoreeof, set_ignoreeof, (setopt_get_func_t *)NULL }, + { "interactive-comments", '\0', &interactive_comments, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + { "keyword", 'k', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, +#if defined (JOB_CONTROL) + { "monitor", 'm', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, +#endif + { "noclobber", 'C', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + { "noexec", 'n', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + { "noglob", 'f', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, +#if defined (HISTORY) + { "nolog", '\0', &dont_save_function_defs, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, +#endif +#if defined (JOB_CONTROL) + { "notify", 'b', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, +#endif /* JOB_CONTROL */ + { "nounset", 'u', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + { "onecmd", 't', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + { "physical", 'P', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + { "pipefail", '\0', &pipefail_opt, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + { "posix", '\0', &posixly_correct, set_posix_mode, (setopt_get_func_t *)NULL }, + { "privileged", 'p', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + { "verbose", 'v', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, +#if defined (READLINE) + { "vi", '\0', (int *)NULL, set_edit_mode, get_edit_mode }, +#endif + { "xtrace", 'x', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, + {(char *)NULL, 0 , (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }, +}; + +#define N_O_OPTIONS (sizeof (o_options) / sizeof (o_options[0])) + +#define GET_BINARY_O_OPTION_VALUE(i, name) \ + ((o_options[i].get_func) ? (*o_options[i].get_func) (name) \ + : (*o_options[i].variable)) + +#define SET_BINARY_O_OPTION_VALUE(i, onoff, name) \ + ((o_options[i].set_func) ? (*o_options[i].set_func) (onoff, name) \ + : (*o_options[i].variable = (onoff == FLAG_ON))) + +int +minus_o_option_value (name) + char *name; +{ + register int i; + int *on_or_off; + + for (i = 0; o_options[i].name; i++) + { + if (STREQ (name, o_options[i].name)) + { + if (o_options[i].letter) + { + on_or_off = find_flag (o_options[i].letter); + return ((on_or_off == FLAG_UNKNOWN) ? -1 : *on_or_off); + } + else + return (GET_BINARY_O_OPTION_VALUE (i, name)); + } + } + + return (-1); +} + +#define MINUS_O_FORMAT "%-15s\t%s\n" + +static void +print_minus_o_option (name, value, pflag) + char *name; + int value, pflag; +{ + if (pflag == 0) + printf (MINUS_O_FORMAT, name, value ? on : off); + else + printf ("set %co %s\n", value ? '-' : '+', name); +} + +void +list_minus_o_opts (mode, reusable) + int mode, reusable; +{ + register int i; + int *on_or_off, value; + + for (i = 0; o_options[i].name; i++) + { + if (o_options[i].letter) + { + value = 0; + on_or_off = find_flag (o_options[i].letter); + if (on_or_off == FLAG_UNKNOWN) + on_or_off = &value; + if (mode == -1 || mode == *on_or_off) + print_minus_o_option (o_options[i].name, *on_or_off, reusable); + } + else + { + value = GET_BINARY_O_OPTION_VALUE (i, o_options[i].name); + if (mode == -1 || mode == value) + print_minus_o_option (o_options[i].name, value, reusable); + } + } +} + +char ** +get_minus_o_opts () +{ + char **ret; + int i; + + ret = strvec_create (N_O_OPTIONS + 1); + for (i = 0; o_options[i].name; i++) + ret[i] = o_options[i].name; + ret[i] = (char *)NULL; + return ret; +} + +static int +set_ignoreeof (on_or_off, option_name) + int on_or_off; + char *option_name; +{ + ignoreeof = on_or_off == FLAG_ON; + unbind_variable ("ignoreeof"); + if (ignoreeof) + bind_variable ("IGNOREEOF", "10", 0); + else + unbind_variable ("IGNOREEOF"); + sv_ignoreeof ("IGNOREEOF"); + return 0; +} + +static int +set_posix_mode (on_or_off, option_name) + int on_or_off; + char *option_name; +{ + posixly_correct = on_or_off == FLAG_ON; + if (posixly_correct == 0) + unbind_variable ("POSIXLY_CORRECT"); + else + bind_variable ("POSIXLY_CORRECT", "y", 0); + sv_strict_posix ("POSIXLY_CORRECT"); + return (0); +} + +#if defined (READLINE) +/* Magic. This code `knows' how readline handles rl_editing_mode. */ +static int +set_edit_mode (on_or_off, option_name) + int on_or_off; + char *option_name; +{ + int isemacs; + + if (on_or_off == FLAG_ON) + { + rl_variable_bind ("editing-mode", option_name); + + if (interactive) + with_input_from_stdin (); + no_line_editing = 0; + } + else + { + isemacs = rl_editing_mode == 1; + if ((isemacs && *option_name == 'e') || (!isemacs && *option_name == 'v')) + { + if (interactive) + with_input_from_stream (stdin, "stdin"); + no_line_editing = 1; + } + } + return 1-no_line_editing; +} + +static int +get_edit_mode (name) + char *name; +{ + return (*name == 'e' ? no_line_editing == 0 && rl_editing_mode == 1 + : no_line_editing == 0 && rl_editing_mode == 0); +} +#endif /* READLINE */ + +#if defined (HISTORY) +static int +bash_set_history (on_or_off, option_name) + int on_or_off; + char *option_name; +{ + if (on_or_off == FLAG_ON) + { + enable_history_list = 1; + bash_history_enable (); + if (history_lines_this_session == 0) + load_history (); + } + else + { + enable_history_list = 0; + bash_history_disable (); + } + return (1 - enable_history_list); +} +#endif + +int +set_minus_o_option (on_or_off, option_name) + int on_or_off; + char *option_name; +{ + register int i; + + for (i = 0; o_options[i].name; i++) + { + if (STREQ (option_name, o_options[i].name)) + { + if (o_options[i].letter == 0) + { + SET_BINARY_O_OPTION_VALUE (i, on_or_off, option_name); + return (EXECUTION_SUCCESS); + } + else + { + if (change_flag (o_options[i].letter, on_or_off) == FLAG_ERROR) + { + sh_invalidoptname (option_name); + return (EXECUTION_FAILURE); + } + else + return (EXECUTION_SUCCESS); + } + + } + } + + sh_invalidoptname (option_name); + return (EX_USAGE); +} + +static void +print_all_shell_variables () +{ + SHELL_VAR **vars; + + vars = all_shell_variables (); + if (vars) + { + print_var_list (vars); + free (vars); + } + + /* POSIX.2 does not allow function names and definitions to be output when + `set' is invoked without options (PASC Interp #202). */ + if (posixly_correct == 0) + { + vars = all_shell_functions (); + if (vars) + { + print_func_list (vars); + free (vars); + } + } +} + +void +set_shellopts () +{ + char *value; + char tflag[N_O_OPTIONS]; + int vsize, i, vptr, *ip, exported; + SHELL_VAR *v; + + for (vsize = i = 0; o_options[i].name; i++) + { + tflag[i] = 0; + if (o_options[i].letter) + { + ip = find_flag (o_options[i].letter); + if (ip && *ip) + { + vsize += strlen (o_options[i].name) + 1; + tflag[i] = 1; + } + } + else if (GET_BINARY_O_OPTION_VALUE (i, o_options[i].name)) + { + vsize += strlen (o_options[i].name) + 1; + tflag[i] = 1; + } + } + + value = (char *)xmalloc (vsize + 1); + + for (i = vptr = 0; o_options[i].name; i++) + { + if (tflag[i]) + { + strcpy (value + vptr, o_options[i].name); + vptr += strlen (o_options[i].name); + value[vptr++] = ':'; + } + } + + if (vptr) + vptr--; /* cut off trailing colon */ + value[vptr] = '\0'; + + v = find_variable ("SHELLOPTS"); + + /* Turn off the read-only attribute so we can bind the new value, and + note whether or not the variable was exported. */ + if (v) + { + VUNSETATTR (v, att_readonly); + exported = exported_p (v); + } + else + exported = 0; + + v = bind_variable ("SHELLOPTS", value, 0); + + /* Turn the read-only attribute back on, and turn off the export attribute + if it was set implicitly by mark_modified_vars and SHELLOPTS was not + exported before we bound the new value. */ + VSETATTR (v, att_readonly); + if (mark_modified_vars && exported == 0 && exported_p (v)) + VUNSETATTR (v, att_exported); + + free (value); +} + +void +parse_shellopts (value) + char *value; +{ + char *vname; + int vptr; + + vptr = 0; + while (vname = extract_colon_unit (value, &vptr)) + { + set_minus_o_option (FLAG_ON, vname); + free (vname); + } +} + +void +initialize_shell_options (no_shellopts) + int no_shellopts; +{ + char *temp; + SHELL_VAR *var; + + if (no_shellopts == 0) + { + var = find_variable ("SHELLOPTS"); + /* set up any shell options we may have inherited. */ + if (var && imported_p (var)) + { + temp = (array_p (var) || assoc_p (var)) ? (char *)NULL : savestring (value_cell (var)); + if (temp) + { + parse_shellopts (temp); + free (temp); + } + } + } + + /* Set up the $SHELLOPTS variable. */ + set_shellopts (); +} + +/* Reset the values of the -o options that are not also shell flags. This is + called from execute_cmd.c:initialize_subshell() when setting up a subshell + to run an executable shell script without a leading `#!'. */ +void +reset_shell_options () +{ +#if defined (HISTORY) + remember_on_history = enable_history_list = 1; +#endif + ignoreeof = 0; +} + +/* Set some flags from the word values in the input list. If LIST is empty, + then print out the values of the variables instead. If LIST contains + non-flags, then set $1 - $9 to the successive words of LIST. */ +int +set_builtin (list) + WORD_LIST *list; +{ + int on_or_off, flag_name, force_assignment, opts_changed, rv, r; + register char *arg; + char s[3]; + + if (list == 0) + { + print_all_shell_variables (); + return (sh_chkwrite (EXECUTION_SUCCESS)); + } + + /* Check validity of flag arguments. */ + rv = EXECUTION_SUCCESS; + reset_internal_getopt (); + while ((flag_name = internal_getopt (list, optflags)) != -1) + { + switch (flag_name) + { + case '?': + builtin_usage (); + return (list_optopt == '?' ? EXECUTION_SUCCESS : EX_USAGE); + default: + break; + } + } + + /* Do the set command. While the list consists of words starting with + '-' or '+' treat them as flags, otherwise, start assigning them to + $1 ... $n. */ + for (force_assignment = opts_changed = 0; list; ) + { + arg = list->word->word; + + /* If the argument is `--' or `-' then signal the end of the list + and remember the remaining arguments. */ + if (arg[0] == '-' && (!arg[1] || (arg[1] == '-' && !arg[2]))) + { + list = list->next; + + /* `set --' unsets the positional parameters. */ + if (arg[1] == '-') + force_assignment = 1; + + /* Until told differently, the old shell behaviour of + `set - [arg ...]' being equivalent to `set +xv [arg ...]' + stands. Posix.2 says the behaviour is marked as obsolescent. */ + else + { + change_flag ('x', '+'); + change_flag ('v', '+'); + opts_changed = 1; + } + + break; + } + + if ((on_or_off = *arg) && (on_or_off == '-' || on_or_off == '+')) + { + while (flag_name = *++arg) + { + if (flag_name == '?') + { + builtin_usage (); + return (EXECUTION_SUCCESS); + } + else if (flag_name == 'o') /* -+o option-name */ + { + char *option_name; + WORD_LIST *opt; + + opt = list->next; + + if (opt == 0) + { + list_minus_o_opts (-1, (on_or_off == '+')); + rv = sh_chkwrite (rv); + continue; + } + + option_name = opt->word->word; + + if (option_name == 0 || *option_name == '\0' || + *option_name == '-' || *option_name == '+') + { + list_minus_o_opts (-1, (on_or_off == '+')); + continue; + } + list = list->next; /* Skip over option name. */ + + opts_changed = 1; + if ((r = set_minus_o_option (on_or_off, option_name)) != EXECUTION_SUCCESS) + { + set_shellopts (); + return (r); + } + } + else if (change_flag (flag_name, on_or_off) == FLAG_ERROR) + { + s[0] = on_or_off; + s[1] = flag_name; + s[2] = '\0'; + sh_invalidopt (s); + builtin_usage (); + set_shellopts (); + return (EXECUTION_FAILURE); + } + opts_changed = 1; + } + } + else + { + break; + } + list = list->next; + } + + /* Assigning $1 ... $n */ + if (list || force_assignment) + remember_args (list, 1); + /* Set up new value of $SHELLOPTS */ + if (opts_changed) + set_shellopts (); + return (rv); +} + +$BUILTIN unset +$FUNCTION unset_builtin +$SHORT_DOC unset [-f] [-v] [-n] [name ...] +Unset values and attributes of shell variables and functions. + +For each NAME, remove the corresponding variable or function. + +Options: + -f treat each NAME as a shell function + -v treat each NAME as a shell variable + -n treat each NAME as a name reference and unset the variable itself + rather than the variable it references + +Without options, unset first tries to unset a variable, and if that fails, +tries to unset a function. + +Some variables cannot be unset; also see `readonly'. + +Exit Status: +Returns success unless an invalid option is given or a NAME is read-only. +$END + +#define NEXT_VARIABLE() any_failed++; list = list->next; continue; + +int +unset_builtin (list) + WORD_LIST *list; +{ + int unset_function, unset_variable, unset_array, opt, nameref, any_failed; + char *name; + + unset_function = unset_variable = unset_array = nameref = any_failed = 0; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "fnv")) != -1) + { + switch (opt) + { + case 'f': + unset_function = 1; + break; + case 'v': + unset_variable = 1; + break; + case 'n': + nameref = 1; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + + list = loptend; + + if (unset_function && unset_variable) + { + builtin_error (_("cannot simultaneously unset a function and a variable")); + return (EXECUTION_FAILURE); + } + else if (unset_function && nameref) + nameref = 0; + + while (list) + { + SHELL_VAR *var; + int tem; +#if defined (ARRAY_VARS) + char *t; +#endif + + name = list->word->word; + +#if defined (ARRAY_VARS) + unset_array = 0; + if (!unset_function && valid_array_reference (name)) + { + t = strchr (name, '['); + *t++ = '\0'; + unset_array++; + } +#endif + /* Get error checking out of the way first. The low-level functions + just perform the unset, relying on the caller to verify. */ + + /* Bash allows functions with names which are not valid identifiers + to be created when not in posix mode, so check only when in posix + mode when unsetting a function. */ + if (((unset_function && posixly_correct) || !unset_function) && legal_identifier (name) == 0) + { + sh_invalidid (name); + NEXT_VARIABLE (); + } + + /* Only search for functions here if -f supplied. */ + var = unset_function ? find_function (name) + : (nameref ? find_variable_last_nameref (name) : find_variable (name)); + + /* Some variables (but not functions yet) cannot be unset, period. */ + if (var && unset_function == 0 && non_unsettable_p (var)) + { + builtin_error (_("%s: cannot unset"), name); + NEXT_VARIABLE (); + } + + /* Posix.2 says try variables first, then functions. If we would + find a function after unsuccessfully searching for a variable, + note that we're acting on a function now as if -f were + supplied. The readonly check below takes care of it. */ + if (var == 0 && unset_variable == 0 && unset_function == 0) + { + if (var = find_function (name)) + unset_function = 1; + } + + /* Posix.2 says that unsetting readonly variables is an error. */ + if (var && readonly_p (var)) + { + builtin_error (_("%s: cannot unset: readonly %s"), + var->name, unset_function ? "function" : "variable"); + NEXT_VARIABLE (); + } + + /* Unless the -f option is supplied, the name refers to a variable. */ +#if defined (ARRAY_VARS) + if (var && unset_array) + { + if (array_p (var) == 0 && assoc_p (var) == 0) + { + builtin_error (_("%s: not an array variable"), var->name); + NEXT_VARIABLE (); + } + else + { + tem = unbind_array_element (var, t); + if (tem == -1) + any_failed++; + } + } + else +#endif /* ARRAY_VARS */ + tem = unset_function ? unbind_func (name) : (nameref ? unbind_nameref (name) : unbind_variable (name)); + + /* This is what Posix.2 says: ``If neither -f nor -v + is specified, the name refers to a variable; if a variable by + that name does not exist, a function by that name, if any, + shall be unset.'' */ + if (tem == -1 && unset_function == 0 && unset_variable == 0) + tem = unbind_func (name); + + /* SUSv3, POSIX.1-2001 say: ``Unsetting a variable or function that + was not previously set shall not be considered an error.'' */ + + if (unset_function == 0) + stupidly_hack_special_variables (name); + + list = list->next; + } + + return (any_failed ? EXECUTION_FAILURE : EXECUTION_SUCCESS); +} diff --git a/builtins/setattr.def b/builtins/setattr.def new file mode 100644 index 0000000..3be3189 --- /dev/null +++ b/builtins/setattr.def @@ -0,0 +1,551 @@ +This file is setattr.def, from which is created setattr.c. +It implements the builtins "export" and "readonly", in Bash. + +Copyright (C) 1987-2012 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES setattr.c + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include +#include "../bashansi.h" +#include "../bashintl.h" + +#include "../shell.h" +#include "common.h" +#include "bashgetopt.h" + +extern int posixly_correct; +extern int array_needs_making; +extern char *this_command_name; +extern sh_builtin_func_t *this_shell_builtin; + +#ifdef ARRAY_VARS +extern int declare_builtin __P((WORD_LIST *)); +#endif + +#define READONLY_OR_EXPORT \ + (this_shell_builtin == readonly_builtin || this_shell_builtin == export_builtin) + +$BUILTIN export +$FUNCTION export_builtin +$SHORT_DOC export [-fn] [name[=value] ...] or export -p +Set export attribute for shell variables. + +Marks each NAME for automatic export to the environment of subsequently +executed commands. If VALUE is supplied, assign VALUE before exporting. + +Options: + -f refer to shell functions + -n remove the export property from each NAME + -p display a list of all exported variables and functions + +An argument of `--' disables further option processing. + +Exit Status: +Returns success unless an invalid option is given or NAME is invalid. +$END + +/* For each variable name in LIST, make that variable appear in the + environment passed to simple commands. If there is no LIST, then + print all such variables. An argument of `-n' says to remove the + exported attribute from variables named in LIST. An argument of + -f indicates that the names present in LIST refer to functions. */ +int +export_builtin (list) + register WORD_LIST *list; +{ + return (set_or_show_attributes (list, att_exported, 0)); +} + +$BUILTIN readonly +$FUNCTION readonly_builtin +$SHORT_DOC readonly [-aAf] [name[=value] ...] or readonly -p +Mark shell variables as unchangeable. + +Mark each NAME as read-only; the values of these NAMEs may not be +changed by subsequent assignment. If VALUE is supplied, assign VALUE +before marking as read-only. + +Options: + -a refer to indexed array variables + -A refer to associative array variables + -f refer to shell functions + -p display a list of all readonly variables or functions, depending on + whether or not the -f option is given + +An argument of `--' disables further option processing. + +Exit Status: +Returns success unless an invalid option is given or NAME is invalid. +$END + +/* For each variable name in LIST, make that variable readonly. Given an + empty LIST, print out all existing readonly variables. */ +int +readonly_builtin (list) + register WORD_LIST *list; +{ + return (set_or_show_attributes (list, att_readonly, 0)); +} + +#if defined (ARRAY_VARS) +# define ATTROPTS "aAfnp" +#else +# define ATTROPTS "fnp" +#endif + +/* For each variable name in LIST, make that variable have the specified + ATTRIBUTE. An arg of `-n' says to remove the attribute from the the + remaining names in LIST (doesn't work for readonly). */ +int +set_or_show_attributes (list, attribute, nodefs) + register WORD_LIST *list; + int attribute, nodefs; +{ + register SHELL_VAR *var; + int assign, undo, any_failed, assign_error, opt; + int functions_only, arrays_only, assoc_only; + int aflags; + char *name; +#if defined (ARRAY_VARS) + WORD_LIST *nlist, *tlist; + WORD_DESC *w; +#endif + + functions_only = arrays_only = assoc_only = 0; + undo = any_failed = assign_error = 0; + /* Read arguments from the front of the list. */ + reset_internal_getopt (); + while ((opt = internal_getopt (list, ATTROPTS)) != -1) + { + switch (opt) + { + case 'n': + undo = 1; + break; + case 'f': + functions_only = 1; + break; +#if defined (ARRAY_VARS) + case 'a': + arrays_only = 1; + break; + case 'A': + assoc_only = 1; + break; +#endif + case 'p': + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + if (list) + { + if (attribute & att_exported) + array_needs_making = 1; + + /* Cannot undo readonly status, silently disallowed. */ + if (undo && (attribute & att_readonly)) + attribute &= ~att_readonly; + + while (list) + { + name = list->word->word; + + if (functions_only) /* xxx -f name */ + { + var = find_function (name); + if (var == 0) + { + builtin_error (_("%s: not a function"), name); + any_failed++; + } + else + SETVARATTR (var, attribute, undo); + + list = list->next; + continue; + } + + /* xxx [-np] name[=value] */ + assign = assignment (name, 0); + + aflags = 0; + if (assign) + { + name[assign] = '\0'; + if (name[assign - 1] == '+') + { + aflags |= ASS_APPEND; + name[assign - 1] = '\0'; + } + } + + if (legal_identifier (name) == 0) + { + sh_invalidid (name); + if (assign) + assign_error++; + else + any_failed++; + list = list->next; + continue; + } + + if (assign) /* xxx [-np] name=value */ + { + name[assign] = '='; + if (aflags & ASS_APPEND) + name[assign - 1] = '+'; +#if defined (ARRAY_VARS) + /* Let's try something here. Turn readonly -a xxx=yyy into + declare -ra xxx=yyy and see what that gets us. */ + if (arrays_only || assoc_only) + { + tlist = list->next; + list->next = (WORD_LIST *)NULL; + w = arrays_only ? make_word ("-ra") : make_word ("-rA"); + nlist = make_word_list (w, list); + opt = declare_builtin (nlist); + if (opt != EXECUTION_SUCCESS) + assign_error++; + list->next = tlist; + dispose_word (w); + free (nlist); + } + else +#endif + /* This word has already been expanded once with command + and parameter expansion. Call do_assignment_no_expand (), + which does not do command or parameter substitution. If + the assignment is not performed correctly, flag an error. */ + if (do_assignment_no_expand (name) == 0) + assign_error++; + name[assign] = '\0'; + if (aflags & ASS_APPEND) + name[assign - 1] = '\0'; + } + + set_var_attribute (name, attribute, undo); + list = list->next; + } + } + else + { + SHELL_VAR **variable_list; + register int i; + + if ((attribute & att_function) || functions_only) + { + variable_list = all_shell_functions (); + if (attribute != att_function) + attribute &= ~att_function; /* so declare -xf works, for example */ + } + else + variable_list = all_shell_variables (); + +#if defined (ARRAY_VARS) + if (attribute & att_array) + { + arrays_only++; + if (attribute != att_array) + attribute &= ~att_array; + } + else if (attribute & att_assoc) + { + assoc_only++; + if (attribute != att_assoc) + attribute &= ~att_assoc; + } +#endif + + if (variable_list) + { + for (i = 0; var = variable_list[i]; i++) + { +#if defined (ARRAY_VARS) + if (arrays_only && array_p (var) == 0) + continue; + else if (assoc_only && assoc_p (var) == 0) + continue; +#endif + if ((var->attributes & attribute)) + { + show_var_attributes (var, READONLY_OR_EXPORT, nodefs); + if (any_failed = sh_chkwrite (any_failed)) + break; + } + } + free (variable_list); + } + } + + return (assign_error ? EX_BADASSIGN + : ((any_failed == 0) ? EXECUTION_SUCCESS + : EXECUTION_FAILURE)); +} + +/* Show all variable variables (v == 1) or functions (v == 0) with + attributes. */ +int +show_all_var_attributes (v, nodefs) + int v, nodefs; +{ + SHELL_VAR **variable_list, *var; + int any_failed; + register int i; + + variable_list = v ? all_shell_variables () : all_shell_functions (); + if (variable_list == 0) + return (EXECUTION_SUCCESS); + + for (i = any_failed = 0; var = variable_list[i]; i++) + { + show_var_attributes (var, READONLY_OR_EXPORT, nodefs); + if (any_failed = sh_chkwrite (any_failed)) + break; + } + free (variable_list); + return (any_failed == 0 ? EXECUTION_SUCCESS : EXECUTION_FAILURE); +} + +/* Show the attributes for shell variable VAR. If NODEFS is non-zero, + don't show function definitions along with the name. If PATTR is + non-zero, it indicates we're being called from `export' or `readonly'. + In POSIX mode, this prints the name of the calling builtin (`export' + or `readonly') instead of `declare', and doesn't print function defs + when called by `export' or `readonly'. */ +int +show_var_attributes (var, pattr, nodefs) + SHELL_VAR *var; + int pattr, nodefs; +{ + char flags[16], *x; + int i; + + i = 0; + + /* pattr == 0 means we are called from `declare'. */ + if (pattr == 0 || posixly_correct == 0) + { +#if defined (ARRAY_VARS) + if (array_p (var)) + flags[i++] = 'a'; + + if (assoc_p (var)) + flags[i++] = 'A'; +#endif + + if (function_p (var)) + flags[i++] = 'f'; + + if (integer_p (var)) + flags[i++] = 'i'; + + if (nameref_p (var)) + flags[i++] = 'n'; + + if (readonly_p (var)) + flags[i++] = 'r'; + + if (trace_p (var)) + flags[i++] = 't'; + + if (exported_p (var)) + flags[i++] = 'x'; + + if (capcase_p (var)) + flags[i++] = 'c'; + + if (lowercase_p (var)) + flags[i++] = 'l'; + + if (uppercase_p (var)) + flags[i++] = 'u'; + } + else + { +#if defined (ARRAY_VARS) + if (array_p (var)) + flags[i++] = 'a'; + + if (assoc_p (var)) + flags[i++] = 'A'; +#endif + + if (function_p (var)) + flags[i++] = 'f'; + } + + flags[i] = '\0'; + + /* If we're printing functions with definitions, print the function def + first, then the attributes, instead of printing output that can't be + reused as input to recreate the current state. */ + if (function_p (var) && nodefs == 0 && (pattr == 0 || posixly_correct == 0)) + { + printf ("%s\n", named_function_string (var->name, function_cell (var), FUNC_MULTILINE|FUNC_EXTERNAL)); + nodefs++; + if (pattr == 0 && i == 1 && flags[0] == 'f') + return 0; /* don't print `declare -f name' */ + } + + if (pattr == 0 || posixly_correct == 0) + printf ("declare -%s ", i ? flags : "-"); + else if (i) + printf ("%s -%s ", this_command_name, flags); + else + printf ("%s ", this_command_name); + +#if defined (ARRAY_VARS) + if (array_p (var)) + print_array_assignment (var, 1); + else if (assoc_p (var)) + print_assoc_assignment (var, 1); + else +#endif + /* force `readonly' and `export' to not print out function definitions + when in POSIX mode. */ + if (nodefs || (function_p (var) && pattr != 0 && posixly_correct)) + printf ("%s\n", var->name); + else if (function_p (var)) + printf ("%s\n", named_function_string (var->name, function_cell (var), FUNC_MULTILINE|FUNC_EXTERNAL)); + else if (invisible_p (var) || var_isset (var) == 0) + printf ("%s\n", var->name); + else + { + x = sh_double_quote (value_cell (var)); + printf ("%s=%s\n", var->name, x); + free (x); + } + return (0); +} + +int +show_name_attributes (name, nodefs) + char *name; + int nodefs; +{ + SHELL_VAR *var; + +#if 0 + var = find_variable_tempenv (name); +#else + var = find_variable_noref (name); +#endif + + if (var && invisible_p (var) == 0) + { + show_var_attributes (var, READONLY_OR_EXPORT, nodefs); + return (0); + } + else + return (1); +} + +int +show_func_attributes (name, nodefs) + char *name; + int nodefs; +{ + SHELL_VAR *var; + + var = find_function (name); + + if (var) + { + show_var_attributes (var, READONLY_OR_EXPORT, nodefs); + return (0); + } + else + return (1); +} + +void +set_var_attribute (name, attribute, undo) + char *name; + int attribute, undo; +{ + SHELL_VAR *var, *tv, *v; + char *tvalue; + + if (undo) + var = find_variable (name); + else + { + tv = find_tempenv_variable (name); + /* XXX -- need to handle case where tv is a temp variable in a + function-scope context, since function_env has been merged into + the local variables table. */ + if (tv && tempvar_p (tv)) + { + tvalue = var_isset (tv) ? savestring (value_cell (tv)) : savestring (""); + + var = bind_variable (tv->name, tvalue, 0); + var->attributes |= tv->attributes & ~att_tempvar; + /* This avoids an error message when propagating a read-only var + later on. */ + if (var->context == 0 && (attribute & att_readonly)) + { + /* Don't bother to set the `propagate to the global variables + table' flag if we've just bound the variable in that table */ + v = find_global_variable (tv->name); + if (v != var) + VSETATTR (tv, att_propagate); + } + else + VSETATTR (tv, att_propagate); + if (var->context != 0) + VSETATTR (var, att_propagate); + SETVARATTR (tv, attribute, undo); /* XXX */ + + stupidly_hack_special_variables (tv->name); + + free (tvalue); + } + else + { + var = find_variable_notempenv (name); + if (var == 0) + { + var = bind_variable (name, (char *)NULL, 0); + VSETATTR (var, att_invisible); + } + else if (var->context != 0) + VSETATTR (var, att_propagate); + } + } + + if (var) + SETVARATTR (var, attribute, undo); + + if (var && (exported_p (var) || (attribute & att_exported))) + array_needs_making++; /* XXX */ +} diff --git a/builtins/shift.def b/builtins/shift.def new file mode 100644 index 0000000..3213086 --- /dev/null +++ b/builtins/shift.def @@ -0,0 +1,101 @@ +This file is shift.def, from which is created shift.c. +It implements the builtin "shift" in Bash. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES shift.c + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "../bashansi.h" +#include "../bashintl.h" + +#include "../shell.h" +#include "common.h" + +$BUILTIN shift +$FUNCTION shift_builtin +$SHORT_DOC 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 $#. +$END + +int print_shift_error; + +/* Shift the arguments ``left''. Shift DOLLAR_VARS down then take one + off of REST_OF_ARGS and place it into DOLLAR_VARS[9]. If LIST has + anything in it, it is a number which says where to start the + shifting. Return > 0 if `times' > $#, otherwise 0. */ +int +shift_builtin (list) + WORD_LIST *list; +{ + intmax_t times; + register int count; + WORD_LIST *temp; + + if (get_numeric_arg (list, 0, ×) == 0) + return (EXECUTION_FAILURE); + + if (times == 0) + return (EXECUTION_SUCCESS); + else if (times < 0) + { + sh_erange (list ? list->word->word : NULL, _("shift count")); + return (EXECUTION_FAILURE); + } + else if (times > number_of_args ()) + { + if (print_shift_error) + sh_erange (list ? list->word->word : NULL, _("shift count")); + return (EXECUTION_FAILURE); + } + + while (times-- > 0) + { + if (dollar_vars[1]) + free (dollar_vars[1]); + + for (count = 1; count < 9; count++) + dollar_vars[count] = dollar_vars[count + 1]; + + if (rest_of_args) + { + temp = rest_of_args; + dollar_vars[9] = savestring (temp->word->word); + rest_of_args = rest_of_args->next; + temp->next = (WORD_LIST *)NULL; + dispose_words (temp); + } + else + dollar_vars[9] = (char *)NULL; + } + return (EXECUTION_SUCCESS); +} diff --git a/builtins/shopt.def b/builtins/shopt.def new file mode 100644 index 0000000..6050a14 --- /dev/null +++ b/builtins/shopt.def @@ -0,0 +1,777 @@ +This file is shopt.def, from which is created shopt.c. +It implements the Bash `shopt' builtin. + +Copyright (C) 1994-2012 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES shopt.c + +$BUILTIN shopt +$FUNCTION shopt_builtin +$SHORT_DOC shopt [-pqsu] [-o] [optname ...] +Set and unset shell options. + +Change the setting of each shell option OPTNAME. Without any option +arguments, list all shell options with an indication of whether or not each +is set. + +Options: + -o restrict OPTNAMEs to those defined for use with `set -o' + -p print each shell option with an indication of its status + -q suppress output + -s enable (set) each OPTNAME + -u disable (unset) each OPTNAME + +Exit Status: +Returns success if OPTNAME is enabled; fails if an invalid option is +given or OPTNAME is disabled. +$END + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include + +#include "version.h" + +#include "../bashintl.h" + +#include "../shell.h" +#include "../flags.h" +#include "common.h" +#include "bashgetopt.h" + +#if defined (READLINE) +# include "../bashline.h" +#endif + +#if defined (HISTORY) +# include "../bashhist.h" +#endif + +#define UNSETOPT 0 +#define SETOPT 1 + +#define OPTFMT "%-15s\t%s\n" + +extern int allow_null_glob_expansion, fail_glob_expansion, glob_dot_filenames; +extern int cdable_vars, mail_warning, source_uses_path; +extern int no_exit_on_failed_exec, print_shift_error; +extern int check_hashed_filenames, promptvars; +extern int cdspelling, expand_aliases; +extern int extended_quote; +extern int check_window_size; +extern int glob_ignore_case, match_ignore_case; +extern int hup_on_exit; +extern int xpg_echo; +extern int gnu_error_format; +extern int check_jobs_at_exit; +extern int autocd; +extern int glob_star; +extern int glob_asciirange; +extern int lastpipe_opt; + +#if defined (EXTENDED_GLOB) +extern int extended_glob; +#endif + +#if defined (READLINE) +extern int hist_verify, history_reediting, perform_hostname_completion; +extern int no_empty_command_completion; +extern int force_fignore; +extern int dircomplete_spelling, dircomplete_expand; +extern int complete_fullquote; + +extern int enable_hostname_completion __P((int)); +#endif + +#if defined (PROGRAMMABLE_COMPLETION) +extern int prog_completion_enabled; +#endif + +#if defined (RESTRICTED_SHELL) +extern char *shell_name; +#endif + +#if defined (DEBUGGER) +extern int debugging_mode; +#endif + +static void shopt_error __P((char *)); + +static int set_shellopts_after_change __P((char *, int)); +static int shopt_enable_hostname_completion __P((char *, int)); +static int set_compatibility_level __P((char *, int)); + +#if defined (RESTRICTED_SHELL) +static int set_restricted_shell __P((char *, int)); +#endif + +#if defined (READLINE) +static int shopt_set_complete_direxpand __P((char *, int)); +#endif + +static int shopt_login_shell; +static int shopt_compat31; +static int shopt_compat32; +static int shopt_compat40; +static int shopt_compat41; +static int shopt_compat42; + +typedef int shopt_set_func_t __P((char *, int)); + +static struct { + char *name; + int *value; + shopt_set_func_t *set_func; +} shopt_vars[] = { + { "autocd", &autocd, (shopt_set_func_t *)NULL }, + { "cdable_vars", &cdable_vars, (shopt_set_func_t *)NULL }, + { "cdspell", &cdspelling, (shopt_set_func_t *)NULL }, + { "checkhash", &check_hashed_filenames, (shopt_set_func_t *)NULL }, +#if defined (JOB_CONTROL) + { "checkjobs", &check_jobs_at_exit, (shopt_set_func_t *)NULL }, +#endif + { "checkwinsize", &check_window_size, (shopt_set_func_t *)NULL }, +#if defined (HISTORY) + { "cmdhist", &command_oriented_history, (shopt_set_func_t *)NULL }, +#endif + { "compat31", &shopt_compat31, set_compatibility_level }, + { "compat32", &shopt_compat32, set_compatibility_level }, + { "compat40", &shopt_compat40, set_compatibility_level }, + { "compat41", &shopt_compat41, set_compatibility_level }, + { "compat42", &shopt_compat41, set_compatibility_level }, +#if defined (READLINE) + { "complete_fullquote", &complete_fullquote, (shopt_set_func_t *)NULL}, + { "direxpand", &dircomplete_expand, shopt_set_complete_direxpand }, + { "dirspell", &dircomplete_spelling, (shopt_set_func_t *)NULL }, +#endif + { "dotglob", &glob_dot_filenames, (shopt_set_func_t *)NULL }, + { "execfail", &no_exit_on_failed_exec, (shopt_set_func_t *)NULL }, + { "expand_aliases", &expand_aliases, (shopt_set_func_t *)NULL }, +#if defined (DEBUGGER) + { "extdebug", &debugging_mode, (shopt_set_func_t *)NULL }, +#endif +#if defined (EXTENDED_GLOB) + { "extglob", &extended_glob, (shopt_set_func_t *)NULL }, +#endif + { "extquote", &extended_quote, (shopt_set_func_t *)NULL }, + { "failglob", &fail_glob_expansion, (shopt_set_func_t *)NULL }, +#if defined (READLINE) + { "force_fignore", &force_fignore, (shopt_set_func_t *)NULL }, +#endif + { "globstar", &glob_star, (shopt_set_func_t *)NULL }, + { "globasciiranges", &glob_asciirange, (shopt_set_func_t *)NULL }, + { "gnu_errfmt", &gnu_error_format, (shopt_set_func_t *)NULL }, +#if defined (HISTORY) + { "histappend", &force_append_history, (shopt_set_func_t *)NULL }, +#endif +#if defined (READLINE) + { "histreedit", &history_reediting, (shopt_set_func_t *)NULL }, + { "histverify", &hist_verify, (shopt_set_func_t *)NULL }, + { "hostcomplete", &perform_hostname_completion, shopt_enable_hostname_completion }, +#endif + { "huponexit", &hup_on_exit, (shopt_set_func_t *)NULL }, + { "interactive_comments", &interactive_comments, set_shellopts_after_change }, + { "lastpipe", &lastpipe_opt, (shopt_set_func_t *)NULL }, +#if defined (HISTORY) + { "lithist", &literal_history, (shopt_set_func_t *)NULL }, +#endif + { "login_shell", &shopt_login_shell, set_login_shell }, + { "mailwarn", &mail_warning, (shopt_set_func_t *)NULL }, +#if defined (READLINE) + { "no_empty_cmd_completion", &no_empty_command_completion, (shopt_set_func_t *)NULL }, +#endif + { "nocaseglob", &glob_ignore_case, (shopt_set_func_t *)NULL }, + { "nocasematch", &match_ignore_case, (shopt_set_func_t *)NULL }, + { "nullglob", &allow_null_glob_expansion, (shopt_set_func_t *)NULL }, +#if defined (PROGRAMMABLE_COMPLETION) + { "progcomp", &prog_completion_enabled, (shopt_set_func_t *)NULL }, +#endif + { "promptvars", &promptvars, (shopt_set_func_t *)NULL }, +#if defined (RESTRICTED_SHELL) + { "restricted_shell", &restricted_shell, set_restricted_shell }, +#endif + { "shift_verbose", &print_shift_error, (shopt_set_func_t *)NULL }, + { "sourcepath", &source_uses_path, (shopt_set_func_t *)NULL }, + { "xpg_echo", &xpg_echo, (shopt_set_func_t *)NULL }, + { (char *)0, (int *)0, (shopt_set_func_t *)NULL } +}; + +#define N_SHOPT_OPTIONS (sizeof (shopt_vars) / sizeof (shopt_vars[0])) + +#define GET_SHOPT_OPTION_VALUE(i) (*shopt_vars[i].value) + +static const char * const on = "on"; +static const char * const off = "off"; + +static int find_shopt __P((char *)); +static int toggle_shopts __P((int, WORD_LIST *, int)); +static void print_shopt __P((char *, int, int)); +static int list_shopts __P((WORD_LIST *, int)); +static int list_some_shopts __P((int, int)); +static int list_shopt_o_options __P((WORD_LIST *, int)); +static int list_some_o_options __P((int, int)); +static int set_shopt_o_options __P((int, WORD_LIST *, int)); + +#define SFLAG 0x01 +#define UFLAG 0x02 +#define QFLAG 0x04 +#define OFLAG 0x08 +#define PFLAG 0x10 + +int +shopt_builtin (list) + WORD_LIST *list; +{ + int opt, flags, rval; + + flags = 0; + reset_internal_getopt (); + while ((opt = internal_getopt (list, "psuoq")) != -1) + { + switch (opt) + { + case 's': + flags |= SFLAG; + break; + case 'u': + flags |= UFLAG; + break; + case 'q': + flags |= QFLAG; + break; + case 'o': + flags |= OFLAG; + break; + case 'p': + flags |= PFLAG; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + if ((flags & (SFLAG|UFLAG)) == (SFLAG|UFLAG)) + { + builtin_error (_("cannot set and unset shell options simultaneously")); + return (EXECUTION_FAILURE); + } + + rval = EXECUTION_SUCCESS; + if ((flags & OFLAG) && ((flags & (SFLAG|UFLAG)) == 0)) /* shopt -o */ + rval = list_shopt_o_options (list, flags); + else if (list && (flags & OFLAG)) /* shopt -so args */ + rval = set_shopt_o_options ((flags & SFLAG) ? FLAG_ON : FLAG_OFF, list, flags & QFLAG); + else if (flags & OFLAG) /* shopt -so */ + rval = list_some_o_options ((flags & SFLAG) ? 1 : 0, flags); + else if (list && (flags & (SFLAG|UFLAG))) /* shopt -su args */ + rval = toggle_shopts ((flags & SFLAG) ? SETOPT : UNSETOPT, list, flags & QFLAG); + else if ((flags & (SFLAG|UFLAG)) == 0) /* shopt [args] */ + rval = list_shopts (list, flags); + else /* shopt -su */ + rval = list_some_shopts ((flags & SFLAG) ? SETOPT : UNSETOPT, flags); + return (rval); +} + +/* Reset the options managed by `shopt' to the values they would have at + shell startup. */ +void +reset_shopt_options () +{ + allow_null_glob_expansion = glob_dot_filenames = 0; + cdable_vars = mail_warning = 0; + no_exit_on_failed_exec = print_shift_error = 0; + check_hashed_filenames = cdspelling = expand_aliases = 0; + + source_uses_path = promptvars = 1; + + check_window_size = CHECKWINSIZE_DEFAULT; + +#if defined (EXTENDED_GLOB) + extended_glob = 0; +#endif + +#if defined (HISTORY) + literal_history = force_append_history = 0; + command_oriented_history = 1; +#endif + +#if defined (READLINE) + hist_verify = history_reediting = 0; + perform_hostname_completion = 1; +#endif + + shopt_login_shell = login_shell; +} + +static int +find_shopt (name) + char *name; +{ + int i; + + for (i = 0; shopt_vars[i].name; i++) + if (STREQ (name, shopt_vars[i].name)) + return i; + return -1; +} + +static void +shopt_error (s) + char *s; +{ + builtin_error (_("%s: invalid shell option name"), s); +} + +static int +toggle_shopts (mode, list, quiet) + int mode; + WORD_LIST *list; + int quiet; +{ + WORD_LIST *l; + int ind, rval; + + for (l = list, rval = EXECUTION_SUCCESS; l; l = l->next) + { + ind = find_shopt (l->word->word); + if (ind < 0) + { + shopt_error (l->word->word); + rval = EXECUTION_FAILURE; + } + else + { + *shopt_vars[ind].value = mode; /* 1 for set, 0 for unset */ + if (shopt_vars[ind].set_func) + (*shopt_vars[ind].set_func) (shopt_vars[ind].name, mode); + } + } + + set_bashopts (); + return (rval); +} + +static void +print_shopt (name, val, flags) + char *name; + int val, flags; +{ + if (flags & PFLAG) + printf ("shopt %s %s\n", val ? "-s" : "-u", name); + else + printf (OPTFMT, name, val ? on : off); +} + +/* List the values of all or any of the `shopt' options. Returns 0 if + all were listed or all variables queried were on; 1 otherwise. */ +static int +list_shopts (list, flags) + WORD_LIST *list; + int flags; +{ + WORD_LIST *l; + int i, val, rval; + + if (list == 0) + { + for (i = 0; shopt_vars[i].name; i++) + { + val = *shopt_vars[i].value; + if ((flags & QFLAG) == 0) + print_shopt (shopt_vars[i].name, val, flags); + } + return (sh_chkwrite (EXECUTION_SUCCESS)); + } + + for (l = list, rval = EXECUTION_SUCCESS; l; l = l->next) + { + i = find_shopt (l->word->word); + if (i < 0) + { + shopt_error (l->word->word); + rval = EXECUTION_FAILURE; + continue; + } + val = *shopt_vars[i].value; + if (val == 0) + rval = EXECUTION_FAILURE; + if ((flags & QFLAG) == 0) + print_shopt (l->word->word, val, flags); + } + + return (sh_chkwrite (rval)); +} + +static int +list_some_shopts (mode, flags) + int mode, flags; +{ + int val, i; + + for (i = 0; shopt_vars[i].name; i++) + { + val = *shopt_vars[i].value; + if (((flags & QFLAG) == 0) && mode == val) + print_shopt (shopt_vars[i].name, val, flags); + } + return (sh_chkwrite (EXECUTION_SUCCESS)); +} + +static int +list_shopt_o_options (list, flags) + WORD_LIST *list; + int flags; +{ + WORD_LIST *l; + int val, rval; + + if (list == 0) + { + if ((flags & QFLAG) == 0) + list_minus_o_opts (-1, (flags & PFLAG)); + return (sh_chkwrite (EXECUTION_SUCCESS)); + } + + for (l = list, rval = EXECUTION_SUCCESS; l; l = l->next) + { + val = minus_o_option_value (l->word->word); + if (val == -1) + { + sh_invalidoptname (l->word->word); + rval = EXECUTION_FAILURE; + continue; + } + if (val == 0) + rval = EXECUTION_FAILURE; + if ((flags & QFLAG) == 0) + { + if (flags & PFLAG) + printf ("set %co %s\n", val ? '-' : '+', l->word->word); + else + printf (OPTFMT, l->word->word, val ? on : off); + } + } + return (sh_chkwrite (rval)); +} + +static int +list_some_o_options (mode, flags) + int mode, flags; +{ + if ((flags & QFLAG) == 0) + list_minus_o_opts (mode, (flags & PFLAG)); + return (sh_chkwrite (EXECUTION_SUCCESS)); +} + +static int +set_shopt_o_options (mode, list, quiet) + int mode; + WORD_LIST *list; + int quiet; +{ + WORD_LIST *l; + int rval; + + for (l = list, rval = EXECUTION_SUCCESS; l; l = l->next) + { + if (set_minus_o_option (mode, l->word->word) == EXECUTION_FAILURE) + rval = EXECUTION_FAILURE; + } + set_shellopts (); + return rval; +} + +/* If we set or unset interactive_comments with shopt, make sure the + change is reflected in $SHELLOPTS. */ +static int +set_shellopts_after_change (option_name, mode) + char *option_name; + int mode; +{ + set_shellopts (); + return (0); +} + +static int +shopt_enable_hostname_completion (option_name, mode) + char *option_name; + int mode; +{ + return (enable_hostname_completion (mode)); +} + +static int +set_compatibility_level (option_name, mode) + char *option_name; + int mode; +{ + int ind; + + /* If we're setting something, redo some of the work we did above in + toggle_shopt(). Unset everything and reset the appropriate option + based on OPTION_NAME. */ + if (mode) + { + shopt_compat31 = shopt_compat32 = 0; + shopt_compat40 = shopt_compat41 = shopt_compat42 = 0; + ind = find_shopt (option_name); + *shopt_vars[ind].value = mode; + } + + /* Then set shell_compatibility_level based on what remains */ + if (shopt_compat31) + shell_compatibility_level = 31; + else if (shopt_compat32) + shell_compatibility_level = 32; + else if (shopt_compat40) + shell_compatibility_level = 40; + else if (shopt_compat41) + shell_compatibility_level = 41; + else if (shopt_compat42) + shell_compatibility_level = 42; + else + shell_compatibility_level = DEFAULT_COMPAT_LEVEL; + + return 0; +} + +/* Set and unset the various compatibility options from the value of + shell_compatibility_level; used by sv_shcompat */ +void +set_compatibility_opts () +{ + shopt_compat31 = shopt_compat32 = shopt_compat40 = shopt_compat41 = shopt_compat42 = 0; + switch (shell_compatibility_level) + { + case DEFAULT_COMPAT_LEVEL: + break; + case 42: + shopt_compat42 = 1; break; + case 41: + shopt_compat41 = 1; break; + case 40: + shopt_compat40 = 1; break; + case 32: + shopt_compat32 = 1; break; + case 31: + shopt_compat31 = 1; break; + } +} + +#if defined (READLINE) +static int +shopt_set_complete_direxpand (option_name, mode) + char *option_name; + int mode; +{ + set_directory_hook (); + return 0; +} +#endif + +#if defined (RESTRICTED_SHELL) +/* Don't allow the value of restricted_shell to be modified. */ + +static int +set_restricted_shell (option_name, mode) + char *option_name; + int mode; +{ + static int save_restricted = -1; + + if (save_restricted == -1) + save_restricted = shell_is_restricted (shell_name); + + restricted_shell = save_restricted; + return (0); +} +#endif /* RESTRICTED_SHELL */ + +/* Not static so shell.c can call it to initialize shopt_login_shell */ +int +set_login_shell (option_name, mode) + char *option_name; + int mode; +{ + shopt_login_shell = login_shell != 0; + return (0); +} + +char ** +get_shopt_options () +{ + char **ret; + int n, i; + + n = sizeof (shopt_vars) / sizeof (shopt_vars[0]); + ret = strvec_create (n + 1); + for (i = 0; shopt_vars[i].name; i++) + ret[i] = savestring (shopt_vars[i].name); + ret[i] = (char *)NULL; + return ret; +} + +/* + * External interface for other parts of the shell. NAME is a string option; + * MODE is 0 if we want to unset an option; 1 if we want to set an option. + * REUSABLE is 1 if we want to print output in a form that may be reused. + */ +int +shopt_setopt (name, mode) + char *name; + int mode; +{ + WORD_LIST *wl; + int r; + + wl = add_string_to_list (name, (WORD_LIST *)NULL); + r = toggle_shopts (mode, wl, 0); + dispose_words (wl); + return r; +} + +int +shopt_listopt (name, reusable) + char *name; + int reusable; +{ + int i; + + if (name == 0) + return (list_shopts ((WORD_LIST *)NULL, reusable ? PFLAG : 0)); + + i = find_shopt (name); + if (i < 0) + { + shopt_error (name); + return (EXECUTION_FAILURE); + } + + print_shopt (name, *shopt_vars[i].value, reusable ? PFLAG : 0); + return (sh_chkwrite (EXECUTION_SUCCESS)); +} + +void +set_bashopts () +{ + char *value; + char tflag[N_SHOPT_OPTIONS]; + int vsize, i, vptr, *ip, exported; + SHELL_VAR *v; + + for (vsize = i = 0; shopt_vars[i].name; i++) + { + tflag[i] = 0; + if (GET_SHOPT_OPTION_VALUE (i)) + { + vsize += strlen (shopt_vars[i].name) + 1; + tflag[i] = 1; + } + } + + value = (char *)xmalloc (vsize + 1); + + for (i = vptr = 0; shopt_vars[i].name; i++) + { + if (tflag[i]) + { + strcpy (value + vptr, shopt_vars[i].name); + vptr += strlen (shopt_vars[i].name); + value[vptr++] = ':'; + } + } + + if (vptr) + vptr--; /* cut off trailing colon */ + value[vptr] = '\0'; + + v = find_variable ("BASHOPTS"); + + /* Turn off the read-only attribute so we can bind the new value, and + note whether or not the variable was exported. */ + if (v) + { + VUNSETATTR (v, att_readonly); + exported = exported_p (v); + } + else + exported = 0; + + v = bind_variable ("BASHOPTS", value, 0); + + /* Turn the read-only attribute back on, and turn off the export attribute + if it was set implicitly by mark_modified_vars and SHELLOPTS was not + exported before we bound the new value. */ + VSETATTR (v, att_readonly); + if (mark_modified_vars && exported == 0 && exported_p (v)) + VUNSETATTR (v, att_exported); + + free (value); +} + +void +parse_bashopts (value) + char *value; +{ + char *vname; + int vptr, ind; + + vptr = 0; + while (vname = extract_colon_unit (value, &vptr)) + { + ind = find_shopt (vname); + if (ind >= 0) + *shopt_vars[ind].value = 1; + free (vname); + } +} + +void +initialize_bashopts (no_bashopts) + int no_bashopts; +{ + char *temp; + SHELL_VAR *var; + + if (no_bashopts == 0) + { + var = find_variable ("BASHOPTS"); + /* set up any shell options we may have inherited. */ + if (var && imported_p (var)) + { + temp = (array_p (var) || assoc_p (var)) ? (char *)NULL : savestring (value_cell (var)); + if (temp) + { + parse_bashopts (temp); + free (temp); + } + } + } + + /* Set up the $BASHOPTS variable. */ + set_bashopts (); +} diff --git a/builtins/source.def b/builtins/source.def new file mode 100644 index 0000000..71908b8 --- /dev/null +++ b/builtins/source.def @@ -0,0 +1,197 @@ +This file is source.def, from which is created source.c. +It implements the builtins "." and "source" in Bash. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES source.c + +$BUILTIN source +$FUNCTION source_builtin +$SHORT_DOC source filename [arguments] +Execute commands from a file in the current shell. + +Read and execute commands from FILENAME in the current shell. The +entries in $PATH are used to find the directory containing FILENAME. +If any ARGUMENTS are supplied, they become the positional parameters +when FILENAME is executed. + +Exit Status: +Returns the status of the last command executed in FILENAME; fails if +FILENAME cannot be read. +$END + +$BUILTIN . +$DOCNAME dot +$FUNCTION source_builtin +$SHORT_DOC . filename [arguments] +Execute commands from a file in the current shell. + +Read and execute commands from FILENAME in the current shell. The +entries in $PATH are used to find the directory containing FILENAME. +If any ARGUMENTS are supplied, they become the positional parameters +when FILENAME is executed. + +Exit Status: +Returns the status of the last command executed in FILENAME; fails if +FILENAME cannot be read. +$END + +#include + +#include "../bashtypes.h" +#include "posixstat.h" +#include "filecntl.h" +#if ! defined(_MINIX) && defined (HAVE_SYS_FILE_H) +# include +#endif +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "../bashansi.h" +#include "../bashintl.h" + +#include "../shell.h" +#include "../flags.h" +#include "../findcmd.h" +#include "common.h" +#include "bashgetopt.h" +#include "../trap.h" + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +extern int posixly_correct; +extern int last_command_exit_value; +extern int executing_command_builtin; + +static void maybe_pop_dollar_vars __P((void)); + +/* If non-zero, `.' uses $PATH to look up the script to be sourced. */ +int source_uses_path = 1; + +/* If non-zero, `.' looks in the current directory if the filename argument + is not found in the $PATH. */ +int source_searches_cwd = 1; + +/* If this . script is supplied arguments, we save the dollar vars and + replace them with the script arguments for the duration of the script's + execution. If the script does not change the dollar vars, we restore + what we saved. If the dollar vars are changed in the script, and we are + not executing a shell function, we leave the new values alone and free + the saved values. */ +static void +maybe_pop_dollar_vars () +{ + if (variable_context == 0 && (dollar_vars_changed () & ARGS_SETBLTIN)) + dispose_saved_dollar_vars (); + else + pop_dollar_vars (); + if (debugging_mode) + pop_args (); /* restore BASH_ARGC and BASH_ARGV */ + set_dollar_vars_unchanged (); +} + +/* Read and execute commands from the file passed as argument. Guess what. + This cannot be done in a subshell, since things like variable assignments + take place in there. So, I open the file, place it into a large string, + close the file, and then execute the string. */ +int +source_builtin (list) + WORD_LIST *list; +{ + int result; + char *filename, *debug_trap; + + if (no_options (list)) + return (EX_USAGE); + list = loptend; + + if (list == 0) + { + builtin_error (_("filename argument required")); + builtin_usage (); + return (EX_USAGE); + } + +#if defined (RESTRICTED_SHELL) + if (restricted && strchr (list->word->word, '/')) + { + sh_restricted (list->word->word); + return (EXECUTION_FAILURE); + } +#endif + + filename = (char *)NULL; + /* XXX -- should this be absolute_pathname? */ + if (posixly_correct && strchr (list->word->word, '/')) + filename = savestring (list->word->word); + else if (absolute_pathname (list->word->word)) + filename = savestring (list->word->word); + else if (source_uses_path) + filename = find_path_file (list->word->word); + if (filename == 0) + { + if (source_searches_cwd == 0) + { + builtin_error (_("%s: file not found"), list->word->word); + if (posixly_correct && interactive_shell == 0 && executing_command_builtin == 0) + { + last_command_exit_value = 1; + jump_to_top_level (EXITPROG); + } + return (EXECUTION_FAILURE); + } + else + filename = savestring (list->word->word); + } + + begin_unwind_frame ("source"); + add_unwind_protect ((Function *)xfree, filename); + + if (list->next) + { + push_dollar_vars (); + add_unwind_protect ((Function *)maybe_pop_dollar_vars, (char *)NULL); + remember_args (list->next, 1); + if (debugging_mode) + push_args (list->next); /* Update BASH_ARGV and BASH_ARGC */ + } + set_dollar_vars_unchanged (); + + /* Don't inherit the DEBUG trap unless function_trace_mode (overloaded) + is set. XXX - should sourced files inherit the RETURN trap? Functions + don't. */ + debug_trap = TRAP_STRING (DEBUG_TRAP); + if (debug_trap && function_trace_mode == 0) + { + debug_trap = savestring (debug_trap); + add_unwind_protect (xfree, debug_trap); + add_unwind_protect (set_debug_trap, debug_trap); + restore_default_signal (DEBUG_TRAP); + } + + result = source_file (filename, (list && list->next)); + + run_unwind_frame ("source"); + + return (result); +} diff --git a/builtins/suspend.def b/builtins/suspend.def new file mode 100644 index 0000000..8711e68 --- /dev/null +++ b/builtins/suspend.def @@ -0,0 +1,127 @@ +This file is suspend.def, from which is created suspend.c. +It implements the builtin "suspend" in Bash. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES suspend.c + +$BUILTIN suspend +$DEPENDS_ON JOB_CONTROL +$FUNCTION suspend_builtin +$SHORT_DOC suspend [-f] +Suspend shell execution. + +Suspend the execution of this shell until it receives a SIGCONT signal. +Unless forced, login shells cannot be suspended. + +Options: + -f force the suspend, even if the shell is a login shell + +Exit Status: +Returns success unless job control is not enabled or an error occurs. +$END + +#include + +#if defined (JOB_CONTROL) +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "../bashtypes.h" +#include +#include "../bashintl.h" +#include "../shell.h" +#include "../jobs.h" +#include "common.h" +#include "bashgetopt.h" + +static sighandler suspend_continue __P((int)); + +static SigHandler *old_cont; +#if 0 +static SigHandler *old_stop; +#endif + +/* Continue handler. */ +static sighandler +suspend_continue (sig) + int sig; +{ + set_signal_handler (SIGCONT, old_cont); +#if 0 + set_signal_handler (SIGSTOP, old_stop); +#endif + SIGRETURN (0); +} + +/* Suspending the shell. If -f is the arg, then do the suspend + no matter what. Otherwise, complain if a login shell. */ +int +suspend_builtin (list) + WORD_LIST *list; +{ + int opt, force; + + reset_internal_getopt (); + force = 0; + while ((opt = internal_getopt (list, "f")) != -1) + switch (opt) + { + case 'f': + force++; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + + list = loptend; + + if (job_control == 0) + { + sh_nojobs (_("cannot suspend")); + return (EXECUTION_FAILURE); + } + + if (force == 0) + { + no_args (list); + + if (login_shell) + { + builtin_error (_("cannot suspend a login shell")); + return (EXECUTION_FAILURE); + } + } + + /* XXX - should we put ourselves back into the original pgrp now? If so, + call end_job_control() here and do the right thing in suspend_continue + (that is, call restart_job_control()). */ + old_cont = (SigHandler *)set_signal_handler (SIGCONT, suspend_continue); +#if 0 + old_stop = (SigHandler *)set_signal_handler (SIGSTOP, SIG_DFL); +#endif + killpg (shell_pgrp, SIGSTOP); + return (EXECUTION_SUCCESS); +} + +#endif /* JOB_CONTROL */ diff --git a/builtins/test.def b/builtins/test.def new file mode 100644 index 0000000..35e7847 --- /dev/null +++ b/builtins/test.def @@ -0,0 +1,165 @@ +This file is test.def, from which is created test.c. +It implements the builtin "test" in Bash. + +Copyright (C) 1987-2010 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES test.c + +$BUILTIN test +$FUNCTION test_builtin +$SHORT_DOC test [expr] +Evaluate conditional expression. + +Exits with a status of 0 (true) or 1 (false) depending on +the evaluation of EXPR. Expressions may be unary or binary. Unary +expressions are often used to examine the status of a file. There +are string operators and numeric comparison operators as well. + +The behavior of test depends on the number of arguments. Read the +bash manual page for the complete specification. + +File operators: + + -a FILE True if file exists. + -b FILE True if file is block special. + -c FILE True if file is character special. + -d FILE True if file is a directory. + -e FILE True if file exists. + -f FILE True if file exists and is a regular file. + -g FILE True if file is set-group-id. + -h FILE True if file is a symbolic link. + -L FILE True if file is a symbolic link. + -k FILE True if file has its `sticky' bit set. + -p FILE True if file is a named pipe. + -r FILE True if file is readable by you. + -s FILE True if file exists and is not empty. + -S FILE True if file is a socket. + -t FD True if FD is opened on a terminal. + -u FILE True if the file is set-user-id. + -w FILE True if the file is writable by you. + -x FILE True if the file is executable by you. + -O FILE True if the file is effectively owned by you. + -G FILE True if the file is effectively owned by your group. + -N FILE True if the file has been modified since it was last read. + + FILE1 -nt FILE2 True if file1 is newer than file2 (according to + modification date). + + FILE1 -ot FILE2 True if file1 is older than file2. + + FILE1 -ef FILE2 True if file1 is a hard link to file2. + +All file operators except -h and -L are acting on the target of a symbolic +link, not on the symlink itself, if FILE is a symbolic link. + +String operators: + + -z STRING True if string is empty. + + -n STRING + STRING True if string is not empty. + + STRING1 = STRING2 + True if the strings are equal. + STRING1 != STRING2 + True if the strings are not equal. + STRING1 < STRING2 + True if STRING1 sorts before STRING2 lexicographically. + STRING1 > STRING2 + True if STRING1 sorts after STRING2 lexicographically. + +Other operators: + + -o OPTION True if the shell option OPTION is enabled. + -v VAR True if the shell variable VAR is set + -R VAR True if the shell variable VAR is set and is a name reference. + ! EXPR True if expr is false. + EXPR1 -a EXPR2 True if both expr1 AND expr2 are true. + EXPR1 -o EXPR2 True if either expr1 OR expr2 is true. + + arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne, + -lt, -le, -gt, or -ge. + +Arithmetic binary operators return true if ARG1 is equal, not-equal, +less-than, less-than-or-equal, greater-than, or greater-than-or-equal +than ARG2. + +See the bash manual page bash(1) for the handling of parameters (i.e. +missing parameters). + +Exit Status: +Returns success if EXPR evaluates to true; fails if EXPR evaluates to +false or an invalid argument is given. +$END + +$BUILTIN [ +$DOCNAME test_bracket +$FUNCTION test_builtin +$SHORT_DOC [ arg... ] +Evaluate conditional expression. + +This is a synonym for the "test" builtin, but the last argument must +be a literal `]', to match the opening `['. +$END + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "../bashansi.h" +#include "../bashintl.h" + +#include "../shell.h" +#include "../test.h" +#include "common.h" + +extern char *this_command_name; + +/* TEST/[ builtin. */ +int +test_builtin (list) + WORD_LIST *list; +{ + char **argv; + int argc, result; + + /* We let Matthew Bradburn and Kevin Braunsdorf's code do the + actual test command. So turn the list of args into an array + of strings, since that is what their code wants. */ + if (list == 0) + { + if (this_command_name[0] == '[' && !this_command_name[1]) + { + builtin_error (_("missing `]'")); + return (EX_BADUSAGE); + } + + return (EXECUTION_FAILURE); + } + + argv = make_builtin_argv (list, &argc); + result = test_command (argc, argv); + free ((char *)argv); + + return (result); +} diff --git a/builtins/times.def b/builtins/times.def new file mode 100644 index 0000000..f31f433 --- /dev/null +++ b/builtins/times.def @@ -0,0 +1,119 @@ +This file is times.def, from which is created times.c. +It implements the builtin "times" in Bash. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES times.c + +$BUILTIN times +$FUNCTION times_builtin +$SHORT_DOC times +Display process times. + +Prints the accumulated user and system times for the shell and all of its +child processes. + +Exit Status: +Always succeeds. +$END + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include +#include "../bashtypes.h" +#include "../shell.h" + +#include + +#if defined (HAVE_SYS_TIMES_H) +# include +#endif /* HAVE_SYS_TIMES_H */ + +#if defined (HAVE_SYS_RESOURCE_H) && !defined (RLIMTYPE) +# include +#endif + +#include "common.h" + +/* Print the totals for system and user time used. */ +int +times_builtin (list) + WORD_LIST *list; +{ +#if defined (HAVE_GETRUSAGE) && defined (HAVE_TIMEVAL) && defined (RUSAGE_SELF) + struct rusage self, kids; + + USE_VAR(list); + + if (no_options (list)) + return (EX_USAGE); + + getrusage (RUSAGE_SELF, &self); + getrusage (RUSAGE_CHILDREN, &kids); /* terminated child processes */ + + print_timeval (stdout, &self.ru_utime); + putchar (' '); + print_timeval (stdout, &self.ru_stime); + putchar ('\n'); + print_timeval (stdout, &kids.ru_utime); + putchar (' '); + print_timeval (stdout, &kids.ru_stime); + putchar ('\n'); + +#else +# if defined (HAVE_TIMES) + /* This uses the POSIX.1/XPG5 times(2) interface, which fills in a + `struct tms' with values of type clock_t. */ + struct tms t; + + USE_VAR(list); + + if (no_options (list)) + return (EX_USAGE); + + times (&t); + + print_clock_t (stdout, t.tms_utime); + putchar (' '); + print_clock_t (stdout, t.tms_stime); + putchar ('\n'); + print_clock_t (stdout, t.tms_cutime); + putchar (' '); + print_clock_t (stdout, t.tms_cstime); + putchar ('\n'); + +# else /* !HAVE_TIMES */ + + USE_VAR(list); + + if (no_options (list)) + return (EX_USAGE); + printf ("0.00 0.00\n0.00 0.00\n"); + +# endif /* HAVE_TIMES */ +#endif /* !HAVE_TIMES */ + + return (sh_chkwrite (EXECUTION_SUCCESS)); +} diff --git a/builtins/trap.def b/builtins/trap.def new file mode 100644 index 0000000..2119f5b --- /dev/null +++ b/builtins/trap.def @@ -0,0 +1,304 @@ +This file is trap.def, from which is created trap.c. +It implements the builtin "trap" in Bash. + +Copyright (C) 1987-2010 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES trap.c + +$BUILTIN trap +$FUNCTION trap_builtin +$SHORT_DOC trap [-lp] [[arg] signal_spec ...] +Trap signals and other events. + +Defines and activates handlers to be run when the shell receives signals +or other conditions. + +ARG is a command to be read and executed when the shell receives the +signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC +is supplied) or `-', each specified signal is reset to its original +value. If ARG is the null string each SIGNAL_SPEC is ignored by the +shell and by the commands it invokes. + +If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. If +a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. If +a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or a +script run by the . or source builtins finishes executing. A SIGNAL_SPEC +of ERR means to execute ARG each time a command's failure would cause the +shell to exit when the -e option is enabled. + +If no arguments are supplied, trap prints the list of commands associated +with each signal. + +Options: + -l print a list of signal names and their corresponding numbers + -p display the trap commands associated with each SIGNAL_SPEC + +Each SIGNAL_SPEC is either a signal name in or a signal number. +Signal names are case insensitive and the SIG prefix is optional. A +signal may be sent to the shell with "kill -signal $$". + +Exit Status: +Returns success unless a SIGSPEC is invalid or an invalid option is given. +$END + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "../bashtypes.h" +#include +#include +#include "../bashansi.h" + +#include "../shell.h" +#include "../trap.h" +#include "common.h" +#include "bashgetopt.h" + +static void showtrap __P((int)); +static int display_traps __P((WORD_LIST *)); + +/* The trap command: + + trap + trap + trap -l + trap -p [sigspec ...] + trap [--] + + Set things up so that ARG is executed when SIGNAL(s) N is recieved. + If ARG is the empty string, then ignore the SIGNAL(s). If there is + no ARG, then set the trap for SIGNAL(s) to its original value. Just + plain "trap" means to print out the list of commands associated with + each signal number. Single arg of "-l" means list the signal names. */ + +/* Possible operations to perform on the list of signals.*/ +#define SET 0 /* Set this signal to first_arg. */ +#define REVERT 1 /* Revert to this signals original value. */ +#define IGNORE 2 /* Ignore this signal. */ + +extern int posixly_correct, subshell_environment; + +int +trap_builtin (list) + WORD_LIST *list; +{ + int list_signal_names, display, result, opt; + + list_signal_names = display = 0; + result = EXECUTION_SUCCESS; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "lp")) != -1) + { + switch (opt) + { + case 'l': + list_signal_names++; + break; + case 'p': + display++; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + opt = DSIG_NOCASE|DSIG_SIGPREFIX; /* flags for decode_signal */ + + if (list_signal_names) + return (sh_chkwrite (display_signal_list ((WORD_LIST *)NULL, 1))); + else if (display || list == 0) + { + initialize_terminating_signals (); + get_all_original_signals (); + return (sh_chkwrite (display_traps (list))); + } + else + { + char *first_arg; + int operation, sig, first_signal; + + operation = SET; + first_arg = list->word->word; + first_signal = first_arg && *first_arg && all_digits (first_arg) && signal_object_p (first_arg, opt); + + /* Backwards compatibility. XXX - question about whether or not we + should throw an error if an all-digit argument doesn't correspond + to a valid signal number (e.g., if it's `50' on a system with only + 32 signals). */ + if (first_signal) + operation = REVERT; + /* When in posix mode, the historical behavior of looking for a + missing first argument is disabled. To revert to the original + signal handling disposition, use `-' as the first argument. */ + else if (posixly_correct == 0 && first_arg && *first_arg && + (*first_arg != '-' || first_arg[1]) && + signal_object_p (first_arg, opt) && list->next == 0) + operation = REVERT; + else + { + list = list->next; + if (list == 0) + { + builtin_usage (); + return (EX_USAGE); + } + else if (*first_arg == '\0') + operation = IGNORE; + else if (first_arg[0] == '-' && !first_arg[1]) + operation = REVERT; + } + + /* If we're in a command substitution, we haven't freed the trap strings + (though we reset the signal handlers). If we're setting a trap to + handle a signal here, free the rest of the trap strings since they + don't apply any more. */ + if (subshell_environment & SUBSHELL_RESETTRAP) + { + free_trap_strings (); + subshell_environment &= ~SUBSHELL_RESETTRAP; + } + + while (list) + { + sig = decode_signal (list->word->word, opt); + + if (sig == NO_SIG) + { + sh_invalidsig (list->word->word); + result = EXECUTION_FAILURE; + } + else + { + switch (operation) + { + case SET: + set_signal (sig, first_arg); + break; + + case REVERT: + restore_default_signal (sig); + + /* Signals that the shell treats specially need special + handling. */ + switch (sig) + { + case SIGINT: + /* XXX - should we do this if original disposition + was SIG_IGN? */ + if (interactive) + set_signal_handler (SIGINT, sigint_sighandler); + else + set_signal_handler (SIGINT, termsig_sighandler); + break; + + case SIGQUIT: + /* Always ignore SIGQUIT. */ + set_signal_handler (SIGQUIT, SIG_IGN); + break; + case SIGTERM: +#if defined (JOB_CONTROL) + case SIGTTIN: + case SIGTTOU: + case SIGTSTP: +#endif /* JOB_CONTROL */ + if (interactive) + set_signal_handler (sig, SIG_IGN); + break; + } + break; + + case IGNORE: + ignore_signal (sig); + break; + } + } + list = list->next; + } + } + + return (result); +} + +static void +showtrap (i) + int i; +{ + char *t, *p, *sn; + + p = trap_list[i]; + if (p == (char *)DEFAULT_SIG && signal_is_hard_ignored (i) == 0) + return; + else if (signal_is_hard_ignored (i)) + t = (char *)NULL; + else + t = (p == (char *)IGNORE_SIG) ? (char *)NULL : sh_single_quote (p); + + sn = signal_name (i); + /* Make sure that signals whose names are unknown (for whatever reason) + are printed as signal numbers. */ + if (STREQN (sn, "SIGJUNK", 7) || STREQN (sn, "unknown", 7)) + printf ("trap -- %s %d\n", t ? t : "''", i); + else if (posixly_correct) + { + if (STREQN (sn, "SIG", 3)) + printf ("trap -- %s %s\n", t ? t : "''", sn+3); + else + printf ("trap -- %s %s\n", t ? t : "''", sn); + } + else + printf ("trap -- %s %s\n", t ? t : "''", sn); + + FREE (t); +} + +static int +display_traps (list) + WORD_LIST *list; +{ + int result, i; + + if (list == 0) + { + for (i = 0; i < BASH_NSIG; i++) + showtrap (i); + return (EXECUTION_SUCCESS); + } + + for (result = EXECUTION_SUCCESS; list; list = list->next) + { + i = decode_signal (list->word->word, DSIG_NOCASE|DSIG_SIGPREFIX); + if (i == NO_SIG) + { + sh_invalidsig (list->word->word); + result = EXECUTION_FAILURE; + } + else + showtrap (i); + } + + return (result); +} diff --git a/builtins/type.def b/builtins/type.def new file mode 100644 index 0000000..bd9ecfc --- /dev/null +++ b/builtins/type.def @@ -0,0 +1,405 @@ +This file is type.def, from which is created type.c. +It implements the builtin "type" in Bash. + +Copyright (C) 1987-2011 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES type.c + +$BUILTIN type +$FUNCTION type_builtin +$SHORT_DOC type [-afptP] name [name ...] +Display information about command type. + +For each NAME, indicate how it would be interpreted if used as a +command name. + +Options: + -a display all locations containing an executable named NAME; + includes aliases, builtins, and functions, if and only if + the `-p' option is not also used + -f suppress shell function lookup + -P force a PATH search for each NAME, even if it is an alias, + builtin, or function, and returns the name of the disk file + that would be executed + -p returns either the name of the disk file that would be executed, + or nothing if `type -t NAME' would not return `file'. + -t output a single word which is one of `alias', `keyword', + `function', `builtin', `file' or `', if NAME is an alias, shell + reserved word, shell function, shell builtin, disk file, or not + found, respectively + +Arguments: + NAME Command name to be interpreted. + +Exit Status: +Returns success if all of the NAMEs are found; fails if any are not found. +$END + +#include + +#include "../bashtypes.h" +#include "posixstat.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include "../bashansi.h" +#include "../bashintl.h" + +#include "../shell.h" +#include "../findcmd.h" +#include "../hashcmd.h" + +#if defined (ALIAS) +#include "../alias.h" +#endif /* ALIAS */ + +#include "common.h" +#include "bashgetopt.h" + +extern int find_reserved_word __P((char *)); + +extern char *this_command_name; +extern int expand_aliases, posixly_correct; + +/* For each word in LIST, find out what the shell is going to do with + it as a simple command. i.e., which file would this shell use to + execve, or if it is a builtin command, or an alias. Possible flag + arguments: + -t Returns the "type" of the object, one of + `alias', `keyword', `function', `builtin', + or `file'. + + -p Returns the pathname of the file if -type is + a file. + + -a Returns all occurrences of words, whether they + be a filename in the path, alias, function, + or builtin. + + -f Suppress shell function lookup, like `command'. + + -P Force a path search even in the presence of other + definitions. + + Order of evaluation: + alias + keyword + function + builtin + file + */ + +int +type_builtin (list) + WORD_LIST *list; +{ + int dflags, any_failed, opt; + WORD_LIST *this; + + if (list == 0) + return (EXECUTION_SUCCESS); + + dflags = CDESC_SHORTDESC; /* default */ + any_failed = 0; + + /* Handle the obsolescent `-type', `-path', and `-all' by prescanning + the arguments and converting those options to the form that + internal_getopt recognizes. Converts `--type', `--path', and `--all' + also. THIS SHOULD REALLY GO AWAY. */ + for (this = list; this && this->word->word[0] == '-'; this = this->next) + { + char *flag = &(this->word->word[1]); + + if (STREQ (flag, "type") || STREQ (flag, "-type")) + { + this->word->word[1] = 't'; + this->word->word[2] = '\0'; + } + else if (STREQ (flag, "path") || STREQ (flag, "-path")) + { + this->word->word[1] = 'p'; + this->word->word[2] = '\0'; + } + else if (STREQ (flag, "all") || STREQ (flag, "-all")) + { + this->word->word[1] = 'a'; + this->word->word[2] = '\0'; + } + } + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "afptP")) != -1) + { + switch (opt) + { + case 'a': + dflags |= CDESC_ALL; + break; + case 'f': + dflags |= CDESC_NOFUNCS; + break; + case 'p': + dflags |= CDESC_PATH_ONLY; + dflags &= ~(CDESC_TYPE|CDESC_SHORTDESC); + break; + case 't': + dflags |= CDESC_TYPE; + dflags &= ~(CDESC_PATH_ONLY|CDESC_SHORTDESC); + break; + case 'P': /* shorthand for type -ap */ + dflags |= (CDESC_PATH_ONLY|CDESC_FORCE_PATH); + dflags &= ~(CDESC_TYPE|CDESC_SHORTDESC); + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + while (list) + { + int found; + + found = describe_command (list->word->word, dflags); + + if (!found && (dflags & (CDESC_PATH_ONLY|CDESC_TYPE)) == 0) + sh_notfound (list->word->word); + + any_failed += found == 0; + list = list->next; + } + + opt = (any_failed == 0) ? EXECUTION_SUCCESS : EXECUTION_FAILURE; + return (sh_chkwrite (opt)); +} + +/* + * Describe COMMAND as required by the type and command builtins. + * + * Behavior is controlled by DFLAGS. Flag values are + * CDESC_ALL print all descriptions of a command + * CDESC_SHORTDESC print the description for type and command -V + * CDESC_REUSABLE print in a format that may be reused as input + * CDESC_TYPE print the type for type -t + * CDESC_PATH_ONLY print the path for type -p + * CDESC_FORCE_PATH force a path search for type -P + * CDESC_NOFUNCS skip function lookup for type -f + * CDESC_ABSPATH convert to absolute path, no ./ prefix + * + * CDESC_ALL says whether or not to look for all occurrences of COMMAND, or + * return after finding it once. + */ +int +describe_command (command, dflags) + char *command; + int dflags; +{ + int found, i, found_file, f, all; + char *full_path, *x; + SHELL_VAR *func; +#if defined (ALIAS) + alias_t *alias; +#endif + + all = (dflags & CDESC_ALL) != 0; + found = found_file = 0; + full_path = (char *)NULL; + +#if defined (ALIAS) + /* Command is an alias? */ + if (((dflags & CDESC_FORCE_PATH) == 0) && expand_aliases && (alias = find_alias (command))) + { + if (dflags & CDESC_TYPE) + puts ("alias"); + else if (dflags & CDESC_SHORTDESC) + printf (_("%s is aliased to `%s'\n"), command, alias->value); + else if (dflags & CDESC_REUSABLE) + { + x = sh_single_quote (alias->value); + printf ("alias %s=%s\n", command, x); + free (x); + } + + found = 1; + + if (all == 0) + return (1); + } +#endif /* ALIAS */ + + /* Command is a shell reserved word? */ + if (((dflags & CDESC_FORCE_PATH) == 0) && (i = find_reserved_word (command)) >= 0) + { + if (dflags & CDESC_TYPE) + puts ("keyword"); + else if (dflags & CDESC_SHORTDESC) + printf (_("%s is a shell keyword\n"), command); + else if (dflags & CDESC_REUSABLE) + printf ("%s\n", command); + + found = 1; + + if (all == 0) + return (1); + } + + /* Command is a function? */ + if (((dflags & (CDESC_FORCE_PATH|CDESC_NOFUNCS)) == 0) && (func = find_function (command))) + { + if (dflags & CDESC_TYPE) + puts ("function"); + else if (dflags & CDESC_SHORTDESC) + { + char *result; + + printf (_("%s is a function\n"), command); + + /* We're blowing away THE_PRINTED_COMMAND here... */ + + result = named_function_string (command, function_cell (func), FUNC_MULTILINE|FUNC_EXTERNAL); + printf ("%s\n", result); + } + else if (dflags & CDESC_REUSABLE) + printf ("%s\n", command); + + found = 1; + + if (all == 0) + return (1); + } + + /* Command is a builtin? */ + if (((dflags & CDESC_FORCE_PATH) == 0) && find_shell_builtin (command)) + { + if (dflags & CDESC_TYPE) + puts ("builtin"); + else if (dflags & CDESC_SHORTDESC) + printf (_("%s is a shell builtin\n"), command); + else if (dflags & CDESC_REUSABLE) + printf ("%s\n", command); + + found = 1; + + if (all == 0) + return (1); + } + + /* Command is a disk file? */ + /* If the command name given is already an absolute command, just + check to see if it is executable. */ + if (absolute_program (command)) + { + f = file_status (command); + if (f & FS_EXECABLE) + { + if (dflags & CDESC_TYPE) + puts ("file"); + else if (dflags & CDESC_SHORTDESC) + printf (_("%s is %s\n"), command, command); + else if (dflags & (CDESC_REUSABLE|CDESC_PATH_ONLY)) + printf ("%s\n", command); + + /* There's no use looking in the hash table or in $PATH, + because they're not consulted when an absolute program + name is supplied. */ + return (1); + } + } + + /* If the user isn't doing "-a", then we might care about + whether the file is present in our hash table. */ + if (all == 0 || (dflags & CDESC_FORCE_PATH)) + { + if (full_path = phash_search (command)) + { + if (dflags & CDESC_TYPE) + puts ("file"); + else if (dflags & CDESC_SHORTDESC) + printf (_("%s is hashed (%s)\n"), command, full_path); + else if (dflags & (CDESC_REUSABLE|CDESC_PATH_ONLY)) + printf ("%s\n", full_path); + + free (full_path); + return (1); + } + } + + /* Now search through $PATH. */ + while (1) + { + if (all == 0) + full_path = find_user_command (command); + else + full_path = + user_command_matches (command, FS_EXEC_ONLY, found_file); + /* XXX - should that be FS_EXEC_PREFERRED? */ + + if (full_path == 0) + break; + + /* If we found the command as itself by looking through $PATH, it + probably doesn't exist. Check whether or not the command is an + executable file. If it's not, don't report a match. This is + the default posix mode behavior */ + if (STREQ (full_path, command) || posixly_correct) + { + f = file_status (full_path); + if ((f & FS_EXECABLE) == 0) + { + free (full_path); + full_path = (char *)NULL; + if (all == 0) + break; + } + else if (ABSPATH (full_path)) + ; /* placeholder; don't need to do anything yet */ + else if (dflags & (CDESC_REUSABLE|CDESC_PATH_ONLY|CDESC_SHORTDESC)) + { + f = MP_DOCWD | ((dflags & CDESC_ABSPATH) ? MP_RMDOT : 0); + x = sh_makepath ((char *)NULL, full_path, f); + free (full_path); + full_path = x; + } + } + /* If we require a full path and don't have one, make one */ + else if ((dflags & CDESC_ABSPATH) && ABSPATH (full_path) == 0) + full_path = sh_makepath ((char *)NULL, full_path, MP_DOCWD|MP_RMDOT); + + found_file++; + found = 1; + + if (dflags & CDESC_TYPE) + puts ("file"); + else if (dflags & CDESC_SHORTDESC) + printf (_("%s is %s\n"), command, full_path); + else if (dflags & (CDESC_REUSABLE|CDESC_PATH_ONLY)) + printf ("%s\n", full_path); + + free (full_path); + full_path = (char *)NULL; + + if (all == 0) + break; + } + + return (found); +} diff --git a/builtins/ulimit.def b/builtins/ulimit.def new file mode 100644 index 0000000..e551cff --- /dev/null +++ b/builtins/ulimit.def @@ -0,0 +1,783 @@ +This file is ulimit.def, from which is created ulimit.c. +It implements the builtin "ulimit" in Bash. + +Copyright (C) 1987-2010 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES ulimit.c + +$BUILTIN ulimit +$FUNCTION ulimit_builtin +$DEPENDS_ON !_MINIX +$SHORT_DOC ulimit [-SHabcdefilmnpqrstuvxT] [limit] +Modify shell resource limits. + +Provides control over the resources available to the shell and processes +it creates, on systems that allow such control. + +Options: + -S use the `soft' resource limit + -H use the `hard' resource limit + -a all current limits are reported + -b the socket buffer size + -c the maximum size of core files created + -d the maximum size of a process's data segment + -e the maximum scheduling priority (`nice') + -f the maximum size of files written by the shell and its children + -i the maximum number of pending signals + -l the maximum size a process may lock into memory + -m the maximum resident set size + -n the maximum number of open file descriptors + -p the pipe buffer size + -q the maximum number of bytes in POSIX message queues + -r the maximum real-time scheduling priority + -s the maximum stack size + -t the maximum amount of cpu time in seconds + -u the maximum number of user processes + -v the size of virtual memory + -x the maximum number of file locks + -T the maximum number of threads + +Not all options are available on all platforms. + +If LIMIT is given, it is the new value of the specified resource; the +special LIMIT values `soft', `hard', and `unlimited' stand for the +current soft limit, the current hard limit, and no limit, respectively. +Otherwise, the current value of the specified resource is printed. If +no option is given, then -f is assumed. + +Values are in 1024-byte increments, except for -t, which is in seconds, +-p, which is in increments of 512 bytes, and -u, which is an unscaled +number of processes. + +Exit Status: +Returns success unless an invalid option is supplied or an error occurs. +$END + +#if !defined (_MINIX) + +#include + +#include "../bashtypes.h" +#if defined (HAVE_SYS_PARAM_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include + +#include "../bashintl.h" + +#include "../shell.h" +#include "common.h" +#include "bashgetopt.h" +#include "pipesize.h" + +#if !defined (errno) +extern int errno; +#endif + +/* For some reason, HPUX chose to make these definitions visible only if + _KERNEL is defined, so we define _KERNEL before including + and #undef it afterward. */ +#if defined (HAVE_RESOURCE) +# include +# if defined (HPUX) && defined (RLIMIT_NEEDS_KERNEL) +# define _KERNEL +# endif +# include +# if defined (HPUX) && defined (RLIMIT_NEEDS_KERNEL) +# undef _KERNEL +# endif +#elif defined (HAVE_SYS_TIMES_H) +# include +#endif + +#if defined (HAVE_LIMITS_H) +# include +#endif + +/* Check for the most basic symbols. If they aren't present, this + system's isn't very useful to us. */ +#if !defined (RLIMIT_FSIZE) || !defined (HAVE_GETRLIMIT) +# undef HAVE_RESOURCE +#endif + +#if !defined (HAVE_RESOURCE) && defined (HAVE_ULIMIT_H) +# include +#endif + +#if !defined (RLIMTYPE) +# define RLIMTYPE long +# define string_to_rlimtype(s) strtol(s, (char **)NULL, 10) +# define print_rlimtype(num, nl) printf ("%ld%s", num, nl ? "\n" : "") +#endif + +/* Some systems use RLIMIT_NOFILE, others use RLIMIT_OFILE */ +#if defined (HAVE_RESOURCE) && defined (RLIMIT_OFILE) && !defined (RLIMIT_NOFILE) +# define RLIMIT_NOFILE RLIMIT_OFILE +#endif /* HAVE_RESOURCE && RLIMIT_OFILE && !RLIMIT_NOFILE */ + +/* Some systems have these, some do not. */ +#ifdef RLIMIT_FSIZE +# define RLIMIT_FILESIZE RLIMIT_FSIZE +#else +# define RLIMIT_FILESIZE 256 +#endif + +#define RLIMIT_PIPESIZE 257 + +#ifdef RLIMIT_NOFILE +# define RLIMIT_OPENFILES RLIMIT_NOFILE +#else +# define RLIMIT_OPENFILES 258 +#endif + +#ifdef RLIMIT_VMEM +# define RLIMIT_VIRTMEM RLIMIT_VMEM +# define RLIMIT_VMBLKSZ 1024 +#else +# ifdef RLIMIT_AS +# define RLIMIT_VIRTMEM RLIMIT_AS +# define RLIMIT_VMBLKSZ 1024 +# else +# define RLIMIT_VIRTMEM 259 +# define RLIMIT_VMBLKSZ 1 +# endif +#endif + +#ifdef RLIMIT_NPROC +# define RLIMIT_MAXUPROC RLIMIT_NPROC +#else +# define RLIMIT_MAXUPROC 260 +#endif + +#if !defined (RLIMIT_PTHREAD) && defined (RLIMIT_NTHR) +# define RLIMIT_PTHREAD RLIMIT_NTHR +#endif + +#if !defined (RLIM_INFINITY) +# define RLIM_INFINITY 0x7fffffff +#endif + +#if !defined (RLIM_SAVED_CUR) +# define RLIM_SAVED_CUR RLIM_INFINITY +#endif + +#if !defined (RLIM_SAVED_MAX) +# define RLIM_SAVED_MAX RLIM_INFINITY +#endif + +#define LIMIT_HARD 0x01 +#define LIMIT_SOFT 0x02 + +/* "Blocks" are defined as 512 bytes when in Posix mode and 1024 bytes + otherwise. */ +#define POSIXBLK -2 + +#define BLOCKSIZE(x) (((x) == POSIXBLK) ? (posixly_correct ? 512 : 1024) : (x)) + +extern int posixly_correct; + +static int _findlim __P((int)); + +static int ulimit_internal __P((int, char *, int, int)); + +static int get_limit __P((int, RLIMTYPE *, RLIMTYPE *)); +static int set_limit __P((int, RLIMTYPE, int)); + +static void printone __P((int, RLIMTYPE, int)); +static void print_all_limits __P((int)); + +static int set_all_limits __P((int, RLIMTYPE)); + +static int filesize __P((RLIMTYPE *)); +static int pipesize __P((RLIMTYPE *)); +static int getmaxuprc __P((RLIMTYPE *)); +static int getmaxvm __P((RLIMTYPE *, RLIMTYPE *)); + +typedef struct { + int option; /* The ulimit option for this limit. */ + int parameter; /* Parameter to pass to get_limit (). */ + int block_factor; /* Blocking factor for specific limit. */ + const char * const description; /* Descriptive string to output. */ + const char * const units; /* scale */ +} RESOURCE_LIMITS; + +static RESOURCE_LIMITS limits[] = { +#ifdef RLIMIT_PTHREAD + { 'T', RLIMIT_PTHREAD, 1, "number of threads", (char *)NULL }, +#endif +#ifdef RLIMIT_SBSIZE + { 'b', RLIMIT_SBSIZE, 1, "socket buffer size", "bytes" }, +#endif +#ifdef RLIMIT_CORE + { 'c', RLIMIT_CORE, POSIXBLK, "core file size", "blocks" }, +#endif +#ifdef RLIMIT_DATA + { 'd', RLIMIT_DATA, 1024, "data seg size", "kbytes" }, +#endif +#ifdef RLIMIT_NICE + { 'e', RLIMIT_NICE, 1, "scheduling priority", (char *)NULL }, +#endif + { 'f', RLIMIT_FILESIZE, POSIXBLK, "file size", "blocks" }, +#ifdef RLIMIT_SIGPENDING + { 'i', RLIMIT_SIGPENDING, 1, "pending signals", (char *)NULL }, +#endif +#ifdef RLIMIT_MEMLOCK + { 'l', RLIMIT_MEMLOCK, 1024, "max locked memory", "kbytes" }, +#endif +#ifdef RLIMIT_RSS + { 'm', RLIMIT_RSS, 1024, "max memory size", "kbytes" }, +#endif /* RLIMIT_RSS */ + { 'n', RLIMIT_OPENFILES, 1, "open files", (char *)NULL}, + { 'p', RLIMIT_PIPESIZE, 512, "pipe size", "512 bytes" }, +#ifdef RLIMIT_MSGQUEUE + { 'q', RLIMIT_MSGQUEUE, 1, "POSIX message queues", "bytes" }, +#endif +#ifdef RLIMIT_RTPRIO + { 'r', RLIMIT_RTPRIO, 1, "real-time priority", (char *)NULL }, +#endif +#ifdef RLIMIT_STACK + { 's', RLIMIT_STACK, 1024, "stack size", "kbytes" }, +#endif +#ifdef RLIMIT_CPU + { 't', RLIMIT_CPU, 1, "cpu time", "seconds" }, +#endif /* RLIMIT_CPU */ + { 'u', RLIMIT_MAXUPROC, 1, "max user processes", (char *)NULL }, +#if defined (HAVE_RESOURCE) + { 'v', RLIMIT_VIRTMEM, RLIMIT_VMBLKSZ, "virtual memory", "kbytes" }, +#endif +#ifdef RLIMIT_SWAP + { 'w', RLIMIT_SWAP, 1024, "swap size", "kbytes" }, +#endif +#ifdef RLIMIT_LOCKS + { 'x', RLIMIT_LOCKS, 1, "file locks", (char *)NULL }, +#endif + { -1, -1, -1, (char *)NULL, (char *)NULL } +}; +#define NCMDS (sizeof(limits) / sizeof(limits[0])) + +typedef struct _cmd { + int cmd; + char *arg; +} ULCMD; + +static ULCMD *cmdlist; +static int ncmd; +static int cmdlistsz; + +#if !defined (HAVE_RESOURCE) && !defined (HAVE_ULIMIT) +long +ulimit (cmd, newlim) + int cmd; + long newlim; +{ + errno = EINVAL; + return -1; +} +#endif /* !HAVE_RESOURCE && !HAVE_ULIMIT */ + +static int +_findlim (opt) + int opt; +{ + register int i; + + for (i = 0; limits[i].option > 0; i++) + if (limits[i].option == opt) + return i; + return -1; +} + +static char optstring[4 + 2 * NCMDS]; + +/* Report or set limits associated with certain per-process resources. + See the help documentation in builtins.c for a full description. */ +int +ulimit_builtin (list) + register WORD_LIST *list; +{ + register char *s; + int c, limind, mode, opt, all_limits; + + mode = 0; + + all_limits = 0; + + /* Idea stolen from pdksh -- build option string the first time called. */ + if (optstring[0] == 0) + { + s = optstring; + *s++ = 'a'; *s++ = 'S'; *s++ = 'H'; + for (c = 0; limits[c].option > 0; c++) + { + *s++ = limits[c].option; + *s++ = ';'; + } + *s = '\0'; + } + + /* Initialize the command list. */ + if (cmdlistsz == 0) + cmdlist = (ULCMD *)xmalloc ((cmdlistsz = 16) * sizeof (ULCMD)); + ncmd = 0; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, optstring)) != -1) + { + switch (opt) + { + case 'a': + all_limits++; + break; + + /* -S and -H are modifiers, not real options. */ + case 'S': + mode |= LIMIT_SOFT; + break; + + case 'H': + mode |= LIMIT_HARD; + break; + + case '?': + builtin_usage (); + return (EX_USAGE); + + default: + if (ncmd >= cmdlistsz) + cmdlist = (ULCMD *)xrealloc (cmdlist, (cmdlistsz *= 2) * sizeof (ULCMD)); + cmdlist[ncmd].cmd = opt; + cmdlist[ncmd++].arg = list_optarg; + break; + } + } + list = loptend; + + if (all_limits) + { +#ifdef NOTYET + if (list) /* setting */ + { + if (STREQ (list->word->word, "unlimited") == 0) + { + builtin_error (_("%s: invalid limit argument"), list->word->word); + return (EXECUTION_FAILURE); + } + return (set_all_limits (mode == 0 ? LIMIT_SOFT|LIMIT_HARD : mode, RLIM_INFINITY)); + } +#endif + print_all_limits (mode == 0 ? LIMIT_SOFT : mode); + return (sh_chkwrite (EXECUTION_SUCCESS)); + } + + /* default is `ulimit -f' */ + if (ncmd == 0) + { + cmdlist[ncmd].cmd = 'f'; + /* `ulimit something' is same as `ulimit -f something' */ + cmdlist[ncmd++].arg = list ? list->word->word : (char *)NULL; + if (list) + list = list->next; + } + + /* verify each command in the list. */ + for (c = 0; c < ncmd; c++) + { + limind = _findlim (cmdlist[c].cmd); + if (limind == -1) + { + builtin_error (_("`%c': bad command"), cmdlist[c].cmd); + return (EX_USAGE); + } + } + + for (c = 0; c < ncmd; c++) + if (ulimit_internal (cmdlist[c].cmd, cmdlist[c].arg, mode, ncmd > 1) == EXECUTION_FAILURE) + return (EXECUTION_FAILURE); + + return (EXECUTION_SUCCESS); +} + +static int +ulimit_internal (cmd, cmdarg, mode, multiple) + int cmd; + char *cmdarg; + int mode, multiple; +{ + int opt, limind, setting; + int block_factor; + RLIMTYPE soft_limit, hard_limit, real_limit, limit; + + setting = cmdarg != 0; + limind = _findlim (cmd); + if (mode == 0) + mode = setting ? (LIMIT_HARD|LIMIT_SOFT) : LIMIT_SOFT; + opt = get_limit (limind, &soft_limit, &hard_limit); + if (opt < 0) + { + builtin_error (_("%s: cannot get limit: %s"), limits[limind].description, + strerror (errno)); + return (EXECUTION_FAILURE); + } + + if (setting == 0) /* print the value of the specified limit */ + { + printone (limind, (mode & LIMIT_SOFT) ? soft_limit : hard_limit, multiple); + return (EXECUTION_SUCCESS); + } + + /* Setting the limit. */ + if (STREQ (cmdarg, "hard")) + real_limit = hard_limit; + else if (STREQ (cmdarg, "soft")) + real_limit = soft_limit; + else if (STREQ (cmdarg, "unlimited")) + real_limit = RLIM_INFINITY; + else if (all_digits (cmdarg)) + { + limit = string_to_rlimtype (cmdarg); + block_factor = BLOCKSIZE(limits[limind].block_factor); + real_limit = limit * block_factor; + + if ((real_limit / block_factor) != limit) + { + sh_erange (cmdarg, _("limit")); + return (EXECUTION_FAILURE); + } + } + else + { + sh_invalidnum (cmdarg); + return (EXECUTION_FAILURE); + } + + if (set_limit (limind, real_limit, mode) < 0) + { + builtin_error (_("%s: cannot modify limit: %s"), limits[limind].description, + strerror (errno)); + return (EXECUTION_FAILURE); + } + + return (EXECUTION_SUCCESS); +} + +static int +get_limit (ind, softlim, hardlim) + int ind; + RLIMTYPE *softlim, *hardlim; +{ + RLIMTYPE value; +#if defined (HAVE_RESOURCE) + struct rlimit limit; +#endif + + if (limits[ind].parameter >= 256) + { + switch (limits[ind].parameter) + { + case RLIMIT_FILESIZE: + if (filesize (&value) < 0) + return -1; + break; + case RLIMIT_PIPESIZE: + if (pipesize (&value) < 0) + return -1; + break; + case RLIMIT_OPENFILES: + value = (RLIMTYPE)getdtablesize (); + break; + case RLIMIT_VIRTMEM: + return (getmaxvm (softlim, hardlim)); + case RLIMIT_MAXUPROC: + if (getmaxuprc (&value) < 0) + return -1; + break; + default: + errno = EINVAL; + return -1; + } + *softlim = *hardlim = value; + return (0); + } + else + { +#if defined (HAVE_RESOURCE) + if (getrlimit (limits[ind].parameter, &limit) < 0) + return -1; + *softlim = limit.rlim_cur; + *hardlim = limit.rlim_max; +# if defined (HPUX9) + if (limits[ind].parameter == RLIMIT_FILESIZE) + { + *softlim *= 512; + *hardlim *= 512; /* Ugh. */ + } + else +# endif /* HPUX9 */ + return 0; +#else + errno = EINVAL; + return -1; +#endif + } +} + +static int +set_limit (ind, newlim, mode) + int ind; + RLIMTYPE newlim; + int mode; +{ +#if defined (HAVE_RESOURCE) + struct rlimit limit; + RLIMTYPE val; +#endif + + if (limits[ind].parameter >= 256) + switch (limits[ind].parameter) + { + case RLIMIT_FILESIZE: +#if !defined (HAVE_RESOURCE) + return (ulimit (2, newlim / 512L)); +#else + errno = EINVAL; + return -1; +#endif + + case RLIMIT_OPENFILES: +#if defined (HAVE_SETDTABLESIZE) +# if defined (__CYGWIN__) + /* Grrr... Cygwin declares setdtablesize as void. */ + setdtablesize (newlim); + return 0; +# else + return (setdtablesize (newlim)); +# endif +#endif + case RLIMIT_PIPESIZE: + case RLIMIT_VIRTMEM: + case RLIMIT_MAXUPROC: + default: + errno = EINVAL; + return -1; + } + else + { +#if defined (HAVE_RESOURCE) + if (getrlimit (limits[ind].parameter, &limit) < 0) + return -1; +# if defined (HPUX9) + if (limits[ind].parameter == RLIMIT_FILESIZE) + newlim /= 512; /* Ugh. */ +# endif /* HPUX9 */ + val = (current_user.euid != 0 && newlim == RLIM_INFINITY && + (mode & LIMIT_HARD) == 0 && /* XXX -- test */ + (limit.rlim_cur <= limit.rlim_max)) + ? limit.rlim_max : newlim; + if (mode & LIMIT_SOFT) + limit.rlim_cur = val; + if (mode & LIMIT_HARD) + limit.rlim_max = val; + + return (setrlimit (limits[ind].parameter, &limit)); +#else + errno = EINVAL; + return -1; +#endif + } +} + +static int +getmaxvm (softlim, hardlim) + RLIMTYPE *softlim, *hardlim; +{ +#if defined (HAVE_RESOURCE) + struct rlimit datalim, stacklim; + + if (getrlimit (RLIMIT_DATA, &datalim) < 0) + return -1; + + if (getrlimit (RLIMIT_STACK, &stacklim) < 0) + return -1; + + /* Protect against overflow. */ + *softlim = (datalim.rlim_cur / 1024L) + (stacklim.rlim_cur / 1024L); + *hardlim = (datalim.rlim_max / 1024L) + (stacklim.rlim_max / 1024L); + return 0; +#else + errno = EINVAL; + return -1; +#endif /* HAVE_RESOURCE */ +} + +static int +filesize(valuep) + RLIMTYPE *valuep; +{ +#if !defined (HAVE_RESOURCE) + long result; + if ((result = ulimit (1, 0L)) < 0) + return -1; + else + *valuep = (RLIMTYPE) result * 512; + return 0; +#else + errno = EINVAL; + return -1; +#endif +} + +static int +pipesize (valuep) + RLIMTYPE *valuep; +{ +#if defined (PIPE_BUF) + /* This is defined on Posix systems. */ + *valuep = (RLIMTYPE) PIPE_BUF; + return 0; +#else +# if defined (_POSIX_PIPE_BUF) + *valuep = (RLIMTYPE) _POSIX_PIPE_BUF; + return 0; +# else +# if defined (PIPESIZE) + /* This is defined by running a program from the Makefile. */ + *valuep = (RLIMTYPE) PIPESIZE; + return 0; +# else + errno = EINVAL; + return -1; +# endif /* PIPESIZE */ +# endif /* _POSIX_PIPE_BUF */ +#endif /* PIPE_BUF */ +} + +static int +getmaxuprc (valuep) + RLIMTYPE *valuep; +{ + long maxchild; + + maxchild = getmaxchild (); + if (maxchild < 0) + { + errno = EINVAL; + return -1; + } + else + { + *valuep = (RLIMTYPE) maxchild; + return 0; + } +} + +static void +print_all_limits (mode) + int mode; +{ + register int i; + RLIMTYPE softlim, hardlim; + + if (mode == 0) + mode |= LIMIT_SOFT; + + for (i = 0; limits[i].option > 0; i++) + { + if (get_limit (i, &softlim, &hardlim) == 0) + printone (i, (mode & LIMIT_SOFT) ? softlim : hardlim, 1); + else if (errno != EINVAL) + builtin_error ("%s: cannot get limit: %s", limits[i].description, + strerror (errno)); + } +} + +static void +printone (limind, curlim, pdesc) + int limind; + RLIMTYPE curlim; + int pdesc; +{ + char unitstr[64]; + int factor; + + factor = BLOCKSIZE(limits[limind].block_factor); + if (pdesc) + { + if (limits[limind].units) + sprintf (unitstr, "(%s, -%c) ", limits[limind].units, limits[limind].option); + else + sprintf (unitstr, "(-%c) ", limits[limind].option); + + printf ("%-20s %16s", limits[limind].description, unitstr); + } + if (curlim == RLIM_INFINITY) + puts ("unlimited"); + else if (curlim == RLIM_SAVED_MAX) + puts ("hard"); + else if (curlim == RLIM_SAVED_CUR) + puts ("soft"); + else + print_rlimtype ((curlim / factor), 1); +} + +/* Set all limits to NEWLIM. NEWLIM currently must be RLIM_INFINITY, which + causes all limits to be set as high as possible depending on mode (like + csh `unlimit'). Returns -1 if NEWLIM is invalid, 0 if all limits + were set successfully, and 1 if at least one limit could not be set. + + To raise all soft limits to their corresponding hard limits, use + ulimit -S -a unlimited + To attempt to raise all hard limits to infinity (superuser-only), use + ulimit -H -a unlimited + To attempt to raise all soft and hard limits to infinity, use + ulimit -a unlimited +*/ + +static int +set_all_limits (mode, newlim) + int mode; + RLIMTYPE newlim; +{ + register int i; + int retval = 0; + + if (newlim != RLIM_INFINITY) + { + errno = EINVAL; + return -1; + } + + if (mode == 0) + mode = LIMIT_SOFT|LIMIT_HARD; + + for (retval = i = 0; limits[i].option > 0; i++) + if (set_limit (i, newlim, mode) < 0) + { + builtin_error (_("%s: cannot modify limit: %s"), limits[i].description, + strerror (errno)); + retval = 1; + } + return retval; +} + +#endif /* !_MINIX */ diff --git a/builtins/umask.def b/builtins/umask.def new file mode 100644 index 0000000..d9aa041 --- /dev/null +++ b/builtins/umask.def @@ -0,0 +1,312 @@ +This file is umask.def, from which is created umask.c. +It implements the builtin "umask" in Bash. + +Copyright (C) 1987-2009 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$PRODUCES umask.c + +$BUILTIN umask +$FUNCTION umask_builtin +$SHORT_DOC umask [-p] [-S] [mode] +Display or set file mode mask. + +Sets the user file-creation mask to MODE. If MODE is omitted, prints +the current value of the mask. + +If MODE begins with a digit, it is interpreted as an octal number; +otherwise it is a symbolic mode string like that accepted by chmod(1). + +Options: + -p if MODE is omitted, output in a form that may be reused as input + -S makes the output symbolic; otherwise an octal number is output + +Exit Status: +Returns success unless MODE is invalid or an invalid option is given. +$END + +#include + +#include "../bashtypes.h" +#include "filecntl.h" +#if ! defined(_MINIX) && defined (HAVE_SYS_FILE_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +#include +#endif + +#include +#include + +#include "../bashintl.h" + +#include "../shell.h" +#include "posixstat.h" +#include "common.h" +#include "bashgetopt.h" + +/* **************************************************************** */ +/* */ +/* UMASK Builtin and Helpers */ +/* */ +/* **************************************************************** */ + +static void print_symbolic_umask __P((mode_t)); +static int symbolic_umask __P((WORD_LIST *)); + +/* Set or display the mask used by the system when creating files. Flag + of -S means display the umask in a symbolic mode. */ +int +umask_builtin (list) + WORD_LIST *list; +{ + int print_symbolically, opt, umask_value, pflag; + mode_t umask_arg; + + print_symbolically = pflag = 0; + reset_internal_getopt (); + while ((opt = internal_getopt (list, "Sp")) != -1) + { + switch (opt) + { + case 'S': + print_symbolically++; + break; + case 'p': + pflag++; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + + list = loptend; + + if (list) + { + if (DIGIT (*list->word->word)) + { + umask_value = read_octal (list->word->word); + + /* Note that other shells just let you set the umask to zero + by specifying a number out of range. This is a problem + with those shells. We don't change the umask if the input + is lousy. */ + if (umask_value == -1) + { + sh_erange (list->word->word, _("octal number")); + return (EXECUTION_FAILURE); + } + } + else + { + umask_value = symbolic_umask (list); + if (umask_value == -1) + return (EXECUTION_FAILURE); + } + umask_arg = (mode_t)umask_value; + umask (umask_arg); + if (print_symbolically) + print_symbolic_umask (umask_arg); + } + else /* Display the UMASK for this user. */ + { + umask_arg = umask (022); + umask (umask_arg); + + if (pflag) + printf ("umask%s ", (print_symbolically ? " -S" : "")); + if (print_symbolically) + print_symbolic_umask (umask_arg); + else + printf ("%04lo\n", (unsigned long)umask_arg); + } + + return (sh_chkwrite (EXECUTION_SUCCESS)); +} + +/* Print the umask in a symbolic form. In the output, a letter is + printed if the corresponding bit is clear in the umask. */ +static void +print_symbolic_umask (um) + mode_t um; +{ + char ubits[4], gbits[4], obits[4]; /* u=rwx,g=rwx,o=rwx */ + int i; + + i = 0; + if ((um & S_IRUSR) == 0) + ubits[i++] = 'r'; + if ((um & S_IWUSR) == 0) + ubits[i++] = 'w'; + if ((um & S_IXUSR) == 0) + ubits[i++] = 'x'; + ubits[i] = '\0'; + + i = 0; + if ((um & S_IRGRP) == 0) + gbits[i++] = 'r'; + if ((um & S_IWGRP) == 0) + gbits[i++] = 'w'; + if ((um & S_IXGRP) == 0) + gbits[i++] = 'x'; + gbits[i] = '\0'; + + i = 0; + if ((um & S_IROTH) == 0) + obits[i++] = 'r'; + if ((um & S_IWOTH) == 0) + obits[i++] = 'w'; + if ((um & S_IXOTH) == 0) + obits[i++] = 'x'; + obits[i] = '\0'; + + printf ("u=%s,g=%s,o=%s\n", ubits, gbits, obits); +} + +int +parse_symbolic_mode (mode, initial_bits) + char *mode; + int initial_bits; +{ + int who, op, perm, bits, c; + char *s; + + for (s = mode, bits = initial_bits;;) + { + who = op = perm = 0; + + /* Parse the `who' portion of the symbolic mode clause. */ + while (member (*s, "agou")) + { + switch (c = *s++) + { + case 'u': + who |= S_IRWXU; + continue; + case 'g': + who |= S_IRWXG; + continue; + case 'o': + who |= S_IRWXO; + continue; + case 'a': + who |= S_IRWXU | S_IRWXG | S_IRWXO; + continue; + default: + break; + } + } + + /* The operation is now sitting in *s. */ + op = *s++; + switch (op) + { + case '+': + case '-': + case '=': + break; + default: + builtin_error (_("`%c': invalid symbolic mode operator"), op); + return (-1); + } + + /* Parse out the `perm' section of the symbolic mode clause. */ + while (member (*s, "rwx")) + { + c = *s++; + + switch (c) + { + case 'r': + perm |= S_IRUGO; + break; + case 'w': + perm |= S_IWUGO; + break; + case 'x': + perm |= S_IXUGO; + break; + } + } + + /* Now perform the operation or return an error for a + bad permission string. */ + if (!*s || *s == ',') + { + if (who) + perm &= who; + + switch (op) + { + case '+': + bits |= perm; + break; + case '-': + bits &= ~perm; + break; + case '=': + if (who == 0) + who = S_IRWXU | S_IRWXG | S_IRWXO; + bits &= ~who; + bits |= perm; + break; + + /* No other values are possible. */ + } + + if (*s == '\0') + break; + else + s++; /* skip past ',' */ + } + else + { + builtin_error (_("`%c': invalid symbolic mode character"), *s); + return (-1); + } + } + + return (bits); +} + +/* Set the umask from a symbolic mode string similar to that accepted + by chmod. If the -S argument is given, then print the umask in a + symbolic form. */ +static int +symbolic_umask (list) + WORD_LIST *list; +{ + int um, bits; + + /* Get the initial umask. Don't change it yet. */ + um = umask (022); + umask (um); + + /* All work is done with the complement of the umask -- it's + more intuitive and easier to deal with. It is complemented + again before being returned. */ + bits = parse_symbolic_mode (list->word->word, ~um & 0777); + if (bits == -1) + return (-1); + + um = ~bits & 0777; + return (um); +} diff --git a/builtins/wait.def b/builtins/wait.def new file mode 100644 index 0000000..fe6d53d --- /dev/null +++ b/builtins/wait.def @@ -0,0 +1,216 @@ +This file is wait.def, from which is created wait.c. +It implements the builtin "wait" in Bash. + +Copyright (C) 1987-2013 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + +$BUILTIN wait +$FUNCTION wait_builtin +$DEPENDS_ON JOB_CONTROL +$PRODUCES wait.c +$SHORT_DOC wait [-n] [id ...] +Wait for job completion and return exit status. + +Waits for each process identified by an ID, which may be a process ID or a +job specification, and reports its termination status. If ID is not +given, waits for all currently active child processes, and the return +status is zero. If ID is a a job specification, waits for all processes +in that job's pipeline. + +If the -n option is supplied, waits for the next job to terminate and +returns its exit status. + +Exit Status: +Returns the status of the last ID; fails if ID is invalid or an invalid +option is given. +$END + +$BUILTIN wait +$FUNCTION wait_builtin +$DEPENDS_ON !JOB_CONTROL +$SHORT_DOC wait [pid ...] +Wait for process completion and return exit status. + +Waits for each process specified by a PID and reports its termination status. +If PID is not given, waits for all currently active child processes, +and the return status is zero. PID must be a process ID. + +Exit Status: +Returns the status of the last PID; fails if PID is invalid or an invalid +option is given. +$END + +#include + +#include "../bashtypes.h" +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include + +#include "../bashansi.h" + +#include "../shell.h" +#include "../jobs.h" +#include "common.h" +#include "bashgetopt.h" + +extern int wait_signal_received; + +procenv_t wait_intr_buf; + +/* Wait for the pid in LIST to stop or die. If no arguments are given, then + wait for all of the active background processes of the shell and return + 0. If a list of pids or job specs are given, return the exit status of + the last one waited for. */ + +#define WAIT_RETURN(s) \ + do \ + { \ + interrupt_immediately = old_interrupt_immediately;\ + wait_signal_received = 0; \ + return (s);\ + } \ + while (0) + +int +wait_builtin (list) + WORD_LIST *list; +{ + int status, code, opt, nflag; + volatile int old_interrupt_immediately; + + USE_VAR(list); + + nflag = 0; + reset_internal_getopt (); + while ((opt = internal_getopt (list, "n")) != -1) + { + switch (opt) + { +#if defined (JOB_CONTROL) + case 'n': + nflag = 1; + break; +#endif + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + old_interrupt_immediately = interrupt_immediately; +#if 0 + interrupt_immediately++; +#endif + + /* POSIX.2 says: When the shell is waiting (by means of the wait utility) + for asynchronous commands to complete, the reception of a signal for + which a trap has been set shall cause the wait utility to return + immediately with an exit status greater than 128, after which the trap + associated with the signal shall be taken. + + We handle SIGINT here; it's the only one that needs to be treated + specially (I think), since it's handled specially in {no,}jobs.c. */ + code = setjmp (wait_intr_buf); + if (code) + { + status = 128 + wait_signal_received; + WAIT_RETURN (status); + } + + /* We support jobs or pids. + wait [pid-or-job ...] */ + +#if defined (JOB_CONTROL) + if (nflag) + { + status = wait_for_any_job (); + if (status < 0) + status = 127; + WAIT_RETURN (status); + } +#endif + + /* But wait without any arguments means to wait for all of the shell's + currently active background processes. */ + if (list == 0) + { + wait_for_background_pids (); + WAIT_RETURN (EXECUTION_SUCCESS); + } + + status = EXECUTION_SUCCESS; + while (list) + { + pid_t pid; + char *w; + intmax_t pid_value; + + w = list->word->word; + if (DIGIT (*w)) + { + if (legal_number (w, &pid_value) && pid_value == (pid_t)pid_value) + { + pid = (pid_t)pid_value; + status = wait_for_single_pid (pid); + } + else + { + sh_badpid (w); + WAIT_RETURN (EXECUTION_FAILURE); + } + } +#if defined (JOB_CONTROL) + else if (*w && *w == '%') + /* Must be a job spec. Check it out. */ + { + int job; + sigset_t set, oset; + + BLOCK_CHILD (set, oset); + job = get_job_spec (list); + + if (INVALID_JOB (job)) + { + if (job != DUP_JOB) + sh_badjob (list->word->word); + UNBLOCK_CHILD (oset); + status = 127; /* As per Posix.2, section 4.70.2 */ + list = list->next; + continue; + } + + /* Job spec used. Wait for the last pid in the pipeline. */ + UNBLOCK_CHILD (oset); + status = wait_for_job (job); + } +#endif /* JOB_CONTROL */ + else + { + sh_badpid (w); + status = EXECUTION_FAILURE; + } + list = list->next; + } + + WAIT_RETURN (status); +} diff --git a/command.h b/command.h new file mode 100644 index 0000000..6e9d1e4 --- /dev/null +++ b/command.h @@ -0,0 +1,392 @@ +/* command.h -- The structures used internally to represent commands, and + the extern declarations of the functions used to create them. */ + +/* Copyright (C) 1993-2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_COMMAND_H_) +#define _COMMAND_H_ + +#include "stdc.h" + +/* Instructions describing what kind of thing to do for a redirection. */ +enum r_instruction { + r_output_direction, r_input_direction, r_inputa_direction, + r_appending_to, r_reading_until, r_reading_string, + r_duplicating_input, r_duplicating_output, r_deblank_reading_until, + r_close_this, r_err_and_out, r_input_output, r_output_force, + r_duplicating_input_word, r_duplicating_output_word, + r_move_input, r_move_output, r_move_input_word, r_move_output_word, + r_append_err_and_out +}; + +/* Redirection flags; values for rflags */ +#define REDIR_VARASSIGN 0x01 + +/* Redirection errors. */ +#define AMBIGUOUS_REDIRECT -1 +#define NOCLOBBER_REDIRECT -2 +#define RESTRICTED_REDIRECT -3 /* can only happen in restricted shells. */ +#define HEREDOC_REDIRECT -4 /* here-doc temp file can't be created */ +#define BADVAR_REDIRECT -5 /* something wrong with {varname}redir */ + +#define CLOBBERING_REDIRECT(ri) \ + (ri == r_output_direction || ri == r_err_and_out) + +#define OUTPUT_REDIRECT(ri) \ + (ri == r_output_direction || ri == r_input_output || ri == r_err_and_out || ri == r_append_err_and_out) + +#define INPUT_REDIRECT(ri) \ + (ri == r_input_direction || ri == r_inputa_direction || ri == r_input_output) + +#define WRITE_REDIRECT(ri) \ + (ri == r_output_direction || \ + ri == r_input_output || \ + ri == r_err_and_out || \ + ri == r_appending_to || \ + ri == r_append_err_and_out || \ + ri == r_output_force) + +/* redirection needs translation */ +#define TRANSLATE_REDIRECT(ri) \ + (ri == r_duplicating_input_word || ri == r_duplicating_output_word || \ + ri == r_move_input_word || ri == r_move_output_word) + +/* Command Types: */ +enum command_type { cm_for, cm_case, cm_while, cm_if, cm_simple, cm_select, + cm_connection, cm_function_def, cm_until, cm_group, + cm_arith, cm_cond, cm_arith_for, cm_subshell, cm_coproc }; + +/* Possible values for the `flags' field of a WORD_DESC. */ +#define W_HASDOLLAR 0x000001 /* Dollar sign present. */ +#define W_QUOTED 0x000002 /* Some form of quote character is present. */ +#define W_ASSIGNMENT 0x000004 /* This word is a variable assignment. */ +#define W_SPLITSPACE 0x000008 /* Split this word on " " regardless of IFS */ +#define W_NOSPLIT 0x000010 /* Do not perform word splitting on this word because ifs is empty string. */ +#define W_NOGLOB 0x000020 /* Do not perform globbing on this word. */ +#define W_NOSPLIT2 0x000040 /* Don't split word except for $@ expansion (using spaces) because context does not allow it. */ +#define W_TILDEEXP 0x000080 /* Tilde expand this assignment word */ +#define W_DOLLARAT 0x000100 /* $@ and its special handling */ +#define W_DOLLARSTAR 0x000200 /* $* and its special handling */ +#define W_NOCOMSUB 0x000400 /* Don't perform command substitution on this word */ +#define W_ASSIGNRHS 0x000800 /* Word is rhs of an assignment statement */ +#define W_NOTILDE 0x001000 /* Don't perform tilde expansion on this word */ +#define W_ITILDE 0x002000 /* Internal flag for word expansion */ +#define W_NOEXPAND 0x004000 /* Don't expand at all -- do quote removal */ +#define W_COMPASSIGN 0x008000 /* Compound assignment */ +#define W_ASSNBLTIN 0x010000 /* word is a builtin command that takes assignments */ +#define W_ASSIGNARG 0x020000 /* word is assignment argument to command */ +#define W_HASQUOTEDNULL 0x040000 /* word contains a quoted null character */ +#define W_DQUOTE 0x080000 /* word should be treated as if double-quoted */ +#define W_NOPROCSUB 0x100000 /* don't perform process substitution */ +#define W_HASCTLESC 0x200000 /* word contains literal CTLESC characters */ +#define W_ASSIGNASSOC 0x400000 /* word looks like associative array assignment */ +#define W_ASSIGNARRAY 0x800000 /* word looks like a compound indexed array assignment */ +#define W_ARRAYIND 0x1000000 /* word is an array index being expanded */ +#define W_ASSNGLOBAL 0x2000000 /* word is a global assignment to declare (declare/typeset -g) */ +#define W_NOBRACE 0x4000000 /* Don't perform brace expansion */ +#define W_ASSIGNINT 0x8000000 /* word is an integer assignment to declare */ + +/* Possible values for subshell_environment */ +#define SUBSHELL_ASYNC 0x01 /* subshell caused by `command &' */ +#define SUBSHELL_PAREN 0x02 /* subshell caused by ( ... ) */ +#define SUBSHELL_COMSUB 0x04 /* subshell caused by `command` or $(command) */ +#define SUBSHELL_FORK 0x08 /* subshell caused by executing a disk command */ +#define SUBSHELL_PIPE 0x10 /* subshell from a pipeline element */ +#define SUBSHELL_PROCSUB 0x20 /* subshell caused by <(command) or >(command) */ +#define SUBSHELL_COPROC 0x40 /* subshell from a coproc pipeline */ +#define SUBSHELL_RESETTRAP 0x80 /* subshell needs to reset trap strings on first call to trap */ + +/* A structure which represents a word. */ +typedef struct word_desc { + char *word; /* Zero terminated string. */ + int flags; /* Flags associated with this word. */ +} WORD_DESC; + +/* A linked list of words. */ +typedef struct word_list { + struct word_list *next; + WORD_DESC *word; +} WORD_LIST; + + +/* **************************************************************** */ +/* */ +/* Shell Command Structs */ +/* */ +/* **************************************************************** */ + +/* What a redirection descriptor looks like. If the redirection instruction + is ri_duplicating_input or ri_duplicating_output, use DEST, otherwise + use the file in FILENAME. Out-of-range descriptors are identified by a + negative DEST. */ + +typedef union { + int dest; /* Place to redirect REDIRECTOR to, or ... */ + WORD_DESC *filename; /* filename to redirect to. */ +} REDIRECTEE; + +/* Structure describing a redirection. If REDIRECTOR is negative, the parser + (or translator in redir.c) encountered an out-of-range file descriptor. */ +typedef struct redirect { + struct redirect *next; /* Next element, or NULL. */ + REDIRECTEE redirector; /* Descriptor or varname to be redirected. */ + int rflags; /* Private flags for this redirection */ + int flags; /* Flag value for `open'. */ + enum r_instruction instruction; /* What to do with the information. */ + REDIRECTEE redirectee; /* File descriptor or filename */ + char *here_doc_eof; /* The word that appeared in <flags. */ +#define CMD_WANT_SUBSHELL 0x01 /* User wants a subshell: ( command ) */ +#define CMD_FORCE_SUBSHELL 0x02 /* Shell needs to force a subshell. */ +#define CMD_INVERT_RETURN 0x04 /* Invert the exit value. */ +#define CMD_IGNORE_RETURN 0x08 /* Ignore the exit value. For set -e. */ +#define CMD_NO_FUNCTIONS 0x10 /* Ignore functions during command lookup. */ +#define CMD_INHIBIT_EXPANSION 0x20 /* Do not expand the command words. */ +#define CMD_NO_FORK 0x40 /* Don't fork; just call execve */ +#define CMD_TIME_PIPELINE 0x80 /* Time a pipeline */ +#define CMD_TIME_POSIX 0x100 /* time -p; use POSIX.2 time output spec. */ +#define CMD_AMPERSAND 0x200 /* command & */ +#define CMD_STDIN_REDIR 0x400 /* async command needs implicit . +*/ + +/*********************************************************/ +/* Modify or set defines based on the configure results. */ +/*********************************************************/ + +#if !defined (HAVE_VPRINTF) && defined (HAVE_DOPRNT) +# define USE_VFPRINTF_EMULATION +# define HAVE_VPRINTF +#endif + +#if defined (HAVE_SYS_RESOURCE_H) && defined (HAVE_GETRLIMIT) +# define HAVE_RESOURCE +#endif + +#if !defined (GETPGRP_VOID) +# define HAVE_BSD_PGRP +#endif + +/* Try this without testing __STDC__ for the time being. */ +#if defined (HAVE_STDARG_H) +# define PREFER_STDARG +# define USE_VARARGS +#else +# if defined (HAVE_VARARGS_H) +# define PREFER_VARARGS +# define USE_VARARGS +# endif +#endif + +#if defined (HAVE_SYS_SOCKET_H) && defined (HAVE_GETPEERNAME) && defined (HAVE_NETINET_IN_H) +# define HAVE_NETWORK +#endif + +#if defined (HAVE_REGEX_H) && defined (HAVE_REGCOMP) && defined (HAVE_REGEXEC) +# define HAVE_POSIX_REGEXP +#endif + +/* backwards compatibility between different autoconf versions */ +#if HAVE_DECL_SYS_SIGLIST && !defined (SYS_SIGLIST_DECLARED) +# define SYS_SIGLIST_DECLARED +#endif + +/***********************************************************************/ +/* Unset defines based on what configure reports as missing or broken. */ +/***********************************************************************/ + +/* Ultrix botches type-ahead when switching from canonical to + non-canonical mode, at least through version 4.3 */ +#if !defined (HAVE_TERMIOS_H) || !defined (HAVE_TCGETATTR) || defined (ultrix) +# define TERMIOS_MISSING +#endif + +/* If we have a getcwd(3), but one that does not dynamically allocate memory, + #undef HAVE_GETCWD so the replacement in getcwd.c will be built. We do + not do this on Solaris, because their implementation of loopback mounts + breaks the traditional file system assumptions that getcwd uses. */ +#if defined (HAVE_GETCWD) && defined (GETCWD_BROKEN) && !defined (SOLARIS) +# undef HAVE_GETCWD +#endif + +#if !defined (HAVE_DEV_FD) && defined (NAMED_PIPES_MISSING) +# undef PROCESS_SUBSTITUTION +#endif + +#if defined (JOB_CONTROL_MISSING) +# undef JOB_CONTROL +#endif + +#if defined (STRCOLL_BROKEN) +# undef HAVE_STRCOLL +#endif + +#if !defined (HAVE_POSIX_REGEXP) +# undef COND_REGEXP +#endif + +/* If the shell is called by this name, it will become restricted. */ +#if defined (RESTRICTED_SHELL) +# define RESTRICTED_SHELL_NAME "rbash" +#endif + +/***********************************************************/ +/* Make sure feature defines have necessary prerequisites. */ +/***********************************************************/ + +/* BANG_HISTORY requires HISTORY. */ +#if defined (BANG_HISTORY) && !defined (HISTORY) +# define HISTORY +#endif /* BANG_HISTORY && !HISTORY */ + +#if defined (READLINE) && !defined (HISTORY) +# define HISTORY +#endif + +#if defined (PROGRAMMABLE_COMPLETION) && !defined (READLINE) +# undef PROGRAMMABLE_COMPLETION +#endif + +#if !defined (V9_ECHO) +# undef DEFAULT_ECHO_TO_XPG +#endif + +#if !defined (PROMPT_STRING_DECODE) +# undef PPROMPT +# define PPROMPT "$ " +#endif + +#if !defined (HAVE_SYSLOG) || !defined (HAVE_SYSLOG_H) +# undef SYSLOG_HISTORY +#endif + +/************************************************/ +/* check multibyte capability for I18N code */ +/************************************************/ + +/* For platforms which support the ISO C amendement 1 functionality we + support user defined character classes. */ +/* Solaris 2.5 has a bug: must be included before . */ +#if defined (HAVE_WCTYPE_H) && defined (HAVE_WCHAR_H) && defined (HAVE_LOCALE_H) +# include +# include +# if defined (HAVE_ISWCTYPE) && \ + defined (HAVE_ISWLOWER) && \ + defined (HAVE_ISWUPPER) && \ + defined (HAVE_MBSRTOWCS) && \ + defined (HAVE_MBRTOWC) && \ + defined (HAVE_MBRLEN) && \ + defined (HAVE_TOWLOWER) && \ + defined (HAVE_TOWUPPER) && \ + defined (HAVE_WCHAR_T) && \ + defined (HAVE_WCTYPE_T) && \ + defined (HAVE_WINT_T) && \ + defined (HAVE_WCWIDTH) && \ + defined (HAVE_WCTYPE) + /* system is supposed to support XPG5 */ +# define HANDLE_MULTIBYTE 1 +# endif +#endif + +/* If we don't want multibyte chars even on a system that supports them, let + the configuring user turn multibyte support off. */ +#if defined (NO_MULTIBYTE_SUPPORT) +# undef HANDLE_MULTIBYTE +#endif + +/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */ +#if HANDLE_MULTIBYTE && !defined (HAVE_MBSTATE_T) +# define wcsrtombs(dest, src, len, ps) (wcsrtombs) (dest, src, len, 0) +# define mbsrtowcs(dest, src, len, ps) (mbsrtowcs) (dest, src, len, 0) +# define wcrtomb(s, wc, ps) (wcrtomb) (s, wc, 0) +# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) +# define mbrlen(s, n, ps) (mbrlen) (s, n, 0) +# define mbstate_t int +#endif + +/* Make sure MB_LEN_MAX is at least 16 (some systems define + MB_LEN_MAX as 1) */ +#ifdef HANDLE_MULTIBYTE +# include +# if defined(MB_LEN_MAX) && (MB_LEN_MAX < 16) +# undef MB_LEN_MAX +# endif +# if !defined (MB_LEN_MAX) +# define MB_LEN_MAX 16 +# endif +#endif + +/************************************************/ +/* end of multibyte capability checks for I18N */ +/************************************************/ + +/******************************************************************/ +/* Placeholder for builders to #undef any unwanted features from */ +/* config-top.h or created by configure (such as the default mail */ +/* file for mail checking). */ +/******************************************************************/ + +/* If you don't want bash to provide a default mail file to check. */ +#undef DEFAULT_MAIL_DIRECTORY + +/* Bug #224543 */ +#define PGRP_PIPE 1 diff --git a/config-top.h b/config-top.h new file mode 100644 index 0000000..8015d00 --- /dev/null +++ b/config-top.h @@ -0,0 +1,134 @@ +/* config-top.h - various user-settable options not under the control of autoconf. */ + +/* Copyright (C) 2002-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Define CONTINUE_AFTER_KILL_ERROR if you want the kill command to + continue processing arguments after one of them fails. This is + what POSIX.2 specifies. */ +#define CONTINUE_AFTER_KILL_ERROR + +/* Define BREAK_COMPLAINS if you want the non-standard, but useful + error messages about `break' and `continue' out of context. */ +#define BREAK_COMPLAINS + +/* Define BUFFERED_INPUT if you want the shell to do its own input + buffering, rather than using stdio. Do not undefine this; it's + required to preserve semantics required by POSIX. */ +#define BUFFERED_INPUT + +/* Define ONESHOT if you want sh -c 'command' to avoid forking to execute + `command' whenever possible. This is a big efficiency improvement. */ +#define ONESHOT + +/* Define V9_ECHO if you want to give the echo builtin backslash-escape + interpretation using the -e option, in the style of the Bell Labs 9th + Edition version of echo. You cannot emulate the System V echo behavior + without this option. */ +#define V9_ECHO + +/* Define DONT_REPORT_SIGPIPE if you don't want to see `Broken pipe' messages + when a job like `cat jobs.c | exit 1' terminates due to a SIGPIPE. */ +#define DONT_REPORT_SIGPIPE + +/* Define DONT_REPORT_SIGTERM if you don't want to see `Terminates' message + when a job exits due to SIGTERM, since that's the default signal sent + by the kill builtin. */ +/* #define DONT_REPORT_SIGTERM */ + +/* Define DONT_REPORT_BROKEN_PIPE_WRITE_ERRORS if you don't want builtins + like `echo' and `printf' to report errors when output does not succeed + due to EPIPE. */ +/* #define DONT_REPORT_BROKEN_PIPE_WRITE_ERRORS */ + +/* The default value of the PATH variable. */ +#ifndef DEFAULT_PATH_VALUE +#define DEFAULT_PATH_VALUE \ + "/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:." +#endif + +/* The value for PATH when invoking `command -p'. This is only used when + the Posix.2 confstr () function, or CS_PATH define are not present. */ +#ifndef STANDARD_UTILS_PATH +#define STANDARD_UTILS_PATH \ + "/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc" +#endif + +/* Default primary and secondary prompt strings. */ +#define PPROMPT "\\s-\\v\\$ " +#define SPROMPT "> " + +/* Undefine this if you don't want the ksh-compatible behavior of reprinting + the select menu after a valid choice is made only if REPLY is set to NULL + in the body of the select command. The menu is always reprinted if the + reply to the select query is an empty line. */ +#define KSH_COMPATIBLE_SELECT + +/* System-wide .bashrc file for interactive shells. */ +#define SYS_BASHRC "/etc/bash.bashrc" + +/* System-wide .bash_logout for login shells. */ +#define SYS_BASH_LOGOUT "/etc/bash.bash_logout" + +/* Define this to make non-interactive shells begun with argv[0][0] == '-' + run the startup files when not in posix mode. */ +#define NON_INTERACTIVE_LOGIN_SHELLS + +/* Define this if you want bash to try to check whether it's being run by + sshd and source the .bashrc if so (like the rshd behavior). This checks + for the presence of SSH_CLIENT or SSH2_CLIENT in the initial environment, + which can be fooled under certain not-uncommon circumstances. */ +#define SSH_SOURCE_BASHRC + +/* Define if you want the case-capitalizing operators (~[~]) and the + `capcase' variable attribute (declare -c). */ +#define CASEMOD_CAPCASE + +/* This is used as the name of a shell function to call when a command + name is not found. If you want to name it something other than the + default ("command_not_found_handle"), change it here. */ +/* #define NOTFOUND_HOOK "command_not_found_handle" */ + +/* Define if you want each line saved to the history list in bashhist.c: + bash_add_history() to be sent to syslog(). */ +/* #define SYSLOG_HISTORY */ +#if defined (SYSLOG_HISTORY) +# define SYSLOG_FACILITY LOG_USER +# define SYSLOG_LEVEL LOG_INFO +#endif + +/* Define if you want to include code in shell.c to support wordexp(3) */ +/* #define WORDEXP_OPTION */ + +/* Define as 1 if you want to enable code that implements multiple coprocs */ +#ifndef MULTIPLE_COPROCS +# define MULTIPLE_COPROCS 0 +#endif + +/* Define to 0 if you want the checkwinsize option off by default, 1 if you + want it on. */ +#define CHECKWINSIZE_DEFAULT 0 + +/* Define to 1 if you want to optimize for sequential array assignment when + using indexed arrays, 0 if you want bash-4.2 behavior, which favors + random access but is O(N) for each array assignment. */ +#define OPTIMIZE_SEQUENTIAL_ARRAY_ASSIGNMENT 1 + +/* Define to 1 if you want to be able to export indexed arrays to processes + using the foo=([0]=one [1]=two) and so on */ +/* #define ARRAY_EXPORT 1 */ diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..08af2ba --- /dev/null +++ b/config.h.in @@ -0,0 +1,1154 @@ +/* config.h -- Configuration file for bash. */ + +/* Copyright (C) 1987-2009,2011-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _CONFIG_H_ +#define _CONFIG_H_ + +/* Configuration feature settings controllable by autoconf. */ + +/* Define JOB_CONTROL if your operating system supports + BSD-like job control. */ +#undef JOB_CONTROL + +/* Define ALIAS if you want the alias features. */ +#undef ALIAS + +/* Define PUSHD_AND_POPD if you want those commands to be compiled in. + (Also the `dirs' commands.) */ +#undef PUSHD_AND_POPD + +/* Define BRACE_EXPANSION if you want curly brace expansion a la Csh: + foo{a,b} -> fooa foob. Even if this is compiled in (the default) you + can turn it off at shell startup with `-nobraceexpansion', or during + shell execution with `set +o braceexpand'. */ +#undef BRACE_EXPANSION + +/* Define READLINE to get the nifty/glitzy editing features. + This is on by default. You can turn it off interactively + with the -nolineediting flag. */ +#undef READLINE + +/* Define BANG_HISTORY if you want to have Csh style "!" history expansion. + This is unrelated to READLINE. */ +#undef BANG_HISTORY + +/* Define HISTORY if you want to have access to previously typed commands. + + If both HISTORY and READLINE are defined, you can get at the commands + with line editing commands, and you can directly manipulate the history + from the command line. + + If only HISTORY is defined, the `fc' and `history' builtins are + available. */ +#undef HISTORY + +/* Define this if you want completion that puts all alternatives into + a brace expansion shell expression. */ +#if defined (BRACE_EXPANSION) && defined (READLINE) +# define BRACE_COMPLETION +#endif /* BRACE_EXPANSION */ + +/* Define DEFAULT_ECHO_TO_XPG if you want the echo builtin to interpret + the backslash-escape characters by default, like the XPG Single Unix + Specification V2 for echo. + This requires that V9_ECHO be defined. */ +#undef DEFAULT_ECHO_TO_XPG + +/* Define HELP_BUILTIN if you want the `help' shell builtin and the long + documentation strings compiled into the shell. */ +#undef HELP_BUILTIN + +/* Define RESTRICTED_SHELL if you want the generated shell to have the + ability to be a restricted one. The shell thus generated can become + restricted by being run with the name "rbash", or by setting the -r + flag. */ +#undef RESTRICTED_SHELL + +/* Define DISABLED_BUILTINS if you want "builtin foo" to always run the + shell builtin "foo", even if it has been disabled with "enable -n foo". */ +#undef DISABLED_BUILTINS + +/* Define PROCESS_SUBSTITUTION if you want the K*rn shell-like process + substitution features "<(file)". */ +/* Right now, you cannot do this on machines without fully operational + FIFO support. This currently include NeXT and Alliant. */ +#undef PROCESS_SUBSTITUTION + +/* Define PROMPT_STRING_DECODE if you want the backslash-escaped special + characters in PS1 and PS2 expanded. Variable expansion will still be + performed. */ +#undef PROMPT_STRING_DECODE + +/* Define SELECT_COMMAND if you want the Korn-shell style `select' command: + select word in word_list; do command_list; done */ +#undef SELECT_COMMAND + +/* Define COMMAND_TIMING of you want the ksh-style `time' reserved word and + the ability to time pipelines, functions, and builtins. */ +#undef COMMAND_TIMING + +/* Define ARRAY_VARS if you want ksh-style one-dimensional array variables. */ +#undef ARRAY_VARS + +/* Define DPAREN_ARITHMETIC if you want the ksh-style ((...)) arithmetic + evaluation command. */ +#undef DPAREN_ARITHMETIC + +/* Define EXTENDED_GLOB if you want the ksh-style [*+@?!](patlist) extended + pattern matching. */ +#undef EXTENDED_GLOB + +/* Define EXTGLOB_DEFAULT to the value you'd like the extglob shell option + to have by default */ +#undef EXTGLOB_DEFAULT + +/* Define COND_COMMAND if you want the ksh-style [[...]] conditional + command. */ +#undef COND_COMMAND + +/* Define COND_REGEXP if you want extended regular expression matching and the + =~ binary operator in the [[...]] conditional command. */ +#define COND_REGEXP + +/* Define COPROCESS_SUPPORT if you want support for ksh-like coprocesses and + the `coproc' reserved word */ +#define COPROCESS_SUPPORT + +/* Define ARITH_FOR_COMMAND if you want the ksh93-style + for (( init; test; step )) do list; done + arithmetic for command. */ +#undef ARITH_FOR_COMMAND + +/* Define NETWORK_REDIRECTIONS if you want /dev/(tcp|udp)/host/port to open + socket connections when used in redirections */ +#undef NETWORK_REDIRECTIONS + +/* Define PROGRAMMABLE_COMPLETION for the programmable completion features + and the complete builtin. */ +#undef PROGRAMMABLE_COMPLETION + +/* Define NO_MULTIBYTE_SUPPORT to not compile in support for multibyte + characters, even if the OS supports them. */ +#undef NO_MULTIBYTE_SUPPORT + +/* Define DEBUGGER if you want to compile in some features used only by the + bash debugger. */ +#undef DEBUGGER + +/* Define STRICT_POSIX if you want bash to be strictly posix.2 conformant by + default (except for echo; that is controlled separately). */ +#undef STRICT_POSIX + +/* Define MEMSCRAMBLE if you want the bash malloc and free to scramble + memory contents on malloc() and free(). */ +#undef MEMSCRAMBLE + +/* Define for case-modifying variable attributes; variables modified on + assignment */ +#undef CASEMOD_ATTRS + +/* Define for case-modifying word expansions */ +#undef CASEMOD_EXPANSIONS + +/* Define to make the `direxpand' shopt option enabled by default. */ +#undef DIRCOMPLETE_EXPAND_DEFAULT + +/* Define to make the `globasciiranges' shopt option enabled by default. */ +#undef GLOBASCII_DEFAULT + +/* Define AFS if you are using Transarc's AFS. */ +#undef AFS + +#undef ENABLE_NLS + +/* End of configuration settings controllable by autoconf. */ +/* Other settable options appear in config-top.h. */ + +#include "config-top.h" + +/* Beginning of autoconf additions. */ + +/* Characteristics of the C compiler */ +#undef const + +#undef inline + +#undef restrict + +#undef volatile + +/* Define if cpp supports the ANSI-C stringizing `#' operator */ +#undef HAVE_STRINGIZE + +/* Define if the compiler supports `long double' variables. */ +#undef HAVE_LONG_DOUBLE + +#undef PROTOTYPES + +#undef __CHAR_UNSIGNED__ + +/* Define if the compiler supports `long long' variables. */ +#undef HAVE_LONG_LONG + +#undef HAVE_UNSIGNED_LONG_LONG + +/* The number of bytes in a int. */ +#undef SIZEOF_INT + +/* The number of bytes in a long. */ +#undef SIZEOF_LONG + +/* The number of bytes in a pointer to char. */ +#undef SIZEOF_CHAR_P + +/* The number of bytes in a double (hopefully 8). */ +#undef SIZEOF_DOUBLE + +/* The number of bytes in an `intmax_t'. */ +#undef SIZEOF_INTMAX_T + +/* The number of bytes in a `long long', if we have one. */ +#undef SIZEOF_LONG_LONG + +/* System paths */ + +#define DEFAULT_MAIL_DIRECTORY "/usr/spool/mail" + +/* Characteristics of the system's header files and libraries that affect + the compilation environment. */ + +/* Define if the system does not provide POSIX.1 features except + with this defined. */ +#undef _POSIX_1_SOURCE + +/* Define if you need to in order for stat and other things to work. */ +#undef _POSIX_SOURCE + +/* Define to use GNU libc extensions */ +#undef _GNU_SOURCE + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Memory management functions. */ + +/* Define if using the bash version of malloc in lib/malloc/malloc.c */ +#undef USING_BASH_MALLOC + +#undef DISABLE_MALLOC_WRAPPERS + +/* Define if using alloca.c. */ +#undef C_ALLOCA + +/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. + This function is required for alloca.c support on those systems. */ +#undef CRAY_STACKSEG_END + +/* Define if you have alloca, as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define if you have and it should be used (not on Ultrix). */ +#undef HAVE_ALLOCA_H + + +/* SYSTEM TYPES */ + +/* Define to `long' if doesn't define. */ +#undef off_t + +/* Define to `int' if doesn't define. */ +#undef mode_t + +/* Define to `int' if doesn't define. */ +#undef sigset_t + +/* Define to `int' if doesn't define. */ +#undef pid_t + +/* Define to `short' if doesn't define. */ +#undef bits16_t + +/* Define to `unsigned short' if doesn't define. */ +#undef u_bits16_t + +/* Define to `int' if doesn't define. */ +#undef bits32_t + +/* Define to `unsigned int' if doesn't define. */ +#undef u_bits32_t + +/* Define to `double' if doesn't define. */ +#undef bits64_t + +/* Define to `unsigned int' if doesn't define. */ +#undef u_int + +/* Define to `unsigned long' if doesn't define. */ +#undef u_long + +/* Define to `int' if doesn't define. */ +#undef ptrdiff_t + +/* Define to `unsigned' if doesn't define. */ +#undef size_t + +/* Define to `int' if doesn't define. */ +#undef ssize_t + +/* Define to `long' if doesn't define. */ +#undef intmax_t + +/* Define to `unsigned long' if doesn't define. */ +#undef uintmax_t + +/* Define to `int' if doesn't define. */ +#undef uid_t + +/* Define to `long' if doesn't define. */ +#undef clock_t + +/* Define to `long' if doesn't define. */ +#undef time_t + +/* Define to `int' if doesn't define. */ +#undef gid_t + +/* Define to `unsigned int' if doesn't define. */ +#undef socklen_t + +/* Define to `int' if doesn't define. */ +#undef sig_atomic_t + +#undef HAVE_MBSTATE_T + +/* Define if you have quad_t in . */ +#undef HAVE_QUAD_T + +/* Define if you have wchar_t in . */ +#undef HAVE_WCHAR_T + +/* Define if you have wctype_t in . */ +#undef HAVE_WCTYPE_T + +/* Define if you have wint_t in . */ +#undef HAVE_WINT_T + +#undef RLIMTYPE + +/* Define to the type of elements in the array set by `getgroups'. + Usually this is either `int' or `gid_t'. */ +#undef GETGROUPS_T + +/* Characteristics of the machine archictecture. */ + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown + */ +#undef STACK_DIRECTION + +/* Define if the machine architecture is big-endian. */ +#undef WORDS_BIGENDIAN + +/* Check for the presence of certain non-function symbols in the system + libraries. */ + +/* Define if `sys_siglist' is declared by or . */ +#undef HAVE_DECL_SYS_SIGLIST +#undef SYS_SIGLIST_DECLARED + +/* Define if `_sys_siglist' is declared by or . */ +#undef UNDER_SYS_SIGLIST_DECLARED + +#undef HAVE_SYS_SIGLIST + +#undef HAVE_UNDER_SYS_SIGLIST + +#undef HAVE_SYS_ERRLIST + +#undef HAVE_TZNAME +#undef HAVE_DECL_TZNAME + +/* Characteristics of some of the system structures. */ + +#undef HAVE_STRUCT_DIRENT_D_INO + +#undef HAVE_STRUCT_DIRENT_D_FILENO + +#undef HAVE_STRUCT_DIRENT_D_NAMLEN + +#undef TIOCSTAT_IN_SYS_IOCTL + +#undef FIONREAD_IN_SYS_IOCTL + +#undef GWINSZ_IN_SYS_IOCTL + +#undef STRUCT_WINSIZE_IN_SYS_IOCTL + +#undef TM_IN_SYS_TIME + +#undef STRUCT_WINSIZE_IN_TERMIOS + +#undef SPEED_T_IN_SYS_TYPES + +#undef TERMIOS_LDISC + +#undef TERMIO_LDISC + +#undef HAVE_STRUCT_STAT_ST_BLOCKS + +#undef HAVE_STRUCT_TM_TM_ZONE +#undef HAVE_TM_ZONE + +#undef HAVE_TIMEVAL + +#undef HAVE_STRUCT_TIMEZONE + +#undef WEXITSTATUS_OFFSET + +#undef HAVE_STRUCT_TIMESPEC +#undef TIME_H_DEFINES_STRUCT_TIMESPEC +#undef SYS_TIME_H_DEFINES_STRUCT_TIMESPEC +#undef PTHREAD_H_DEFINES_STRUCT_TIMESPEC + +#undef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC +#undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC +#undef HAVE_STRUCT_STAT_ST_ATIMENSEC +#undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC + +/* Characteristics of definitions in the system header files. */ + +#undef HAVE_GETPW_DECLS + +#undef HAVE_RESOURCE + +#undef HAVE_LIBC_FNM_EXTMATCH + +/* Define if you have and it defines AUDIT_USER_TTY */ +#undef HAVE_DECL_AUDIT_USER_TTY + +#undef HAVE_DECL_CONFSTR + +#undef HAVE_DECL_PRINTF + +#undef HAVE_DECL_SBRK + +#undef HAVE_DECL_STRCPY + +#undef HAVE_DECL_STRSIGNAL + +#undef HAVE_DECL_STRTOLD + +#undef PRI_MACROS_BROKEN + +#undef STRTOLD_BROKEN + +/* Define if WCONTINUED is defined in system headers, but rejected by waitpid */ +#undef WCONTINUED_BROKEN + +/* These are checked with BASH_CHECK_DECL */ + +#undef HAVE_DECL_STRTOIMAX +#undef HAVE_DECL_STRTOL +#undef HAVE_DECL_STRTOLL +#undef HAVE_DECL_STRTOUL +#undef HAVE_DECL_STRTOULL +#undef HAVE_DECL_STRTOUMAX + +/* Characteristics of system calls and C library functions. */ + +/* Define if the `getpgrp' function takes no argument. */ +#undef GETPGRP_VOID + +#undef NAMED_PIPES_MISSING + +#undef OPENDIR_NOT_ROBUST + +#undef PGRP_PIPE + +/* Define if the setvbuf function takes the buffering type as its second + argument and the buffer pointer as the third, as on System V + before release 3. */ +#undef SETVBUF_REVERSED + +#undef STAT_MACROS_BROKEN + +#undef ULIMIT_MAXFDS + +#undef CAN_REDEFINE_GETENV + +#undef HAVE_STD_PUTENV + +#undef HAVE_STD_UNSETENV + +#undef HAVE_PRINTF_A_FORMAT + +#undef CTYPE_NON_ASCII + +/* Define if you have and nl_langinfo(CODESET). */ +#undef HAVE_LANGINFO_CODESET + +/* Characteristics of properties exported by the kernel. */ + +/* Define if the kernel can exec files beginning with #! */ +#undef HAVE_HASH_BANG_EXEC + +/* Define if you have the /dev/fd devices to map open files into the file system. */ +#undef HAVE_DEV_FD + +/* Defined to /dev/fd or /proc/self/fd (linux). */ +#undef DEV_FD_PREFIX + +/* Define if you have the /dev/stdin device. */ +#undef HAVE_DEV_STDIN + +/* The type of iconv's `inbuf' argument */ +#undef ICONV_CONST + +/* Type and behavior of signal handling functions. */ + +/* Define as the return type of signal handlers (int or void). */ +#undef RETSIGTYPE + +/* Define if return type of signal handlers is void */ +#undef VOID_SIGHANDLER + +#undef MUST_REINSTALL_SIGHANDLERS + +#undef HAVE_BSD_SIGNALS + +#undef HAVE_POSIX_SIGNALS + +#undef HAVE_USG_SIGHOLD + +#undef UNUSABLE_RT_SIGNALS + + +/* Presence of system and C library functions. */ + +/* Define if you have the asprintf function. */ +#undef HAVE_ASPRINTF + +/* Define if you have the bcopy function. */ +#undef HAVE_BCOPY + +/* Define if you have the bzero function. */ +#undef HAVE_BZERO + +/* Define if you have the confstr function. */ +#undef HAVE_CONFSTR + +/* Define if you have the dlclose function. */ +#undef HAVE_DLCLOSE + +/* Define if you have the dlopen function. */ +#undef HAVE_DLOPEN + +/* Define if you have the dlsym function. */ +#undef HAVE_DLSYM + +/* Define if you don't have vprintf but do have _doprnt. */ +#undef HAVE_DOPRNT + +/* Define if you have the dprintf function. */ +#undef HAVE_DPRINTF + +/* Define if you have the dup2 function. */ +#undef HAVE_DUP2 + +/* Define if you have the eaccess function. */ +#undef HAVE_EACCESS + +/* Define if you have the faccessat function. */ +#undef HAVE_FACCESSAT + +/* Define if you have the fcntl function. */ +#undef HAVE_FCNTL + +/* Define if you have the fpurge/__fpurge function. */ +#undef HAVE_FPURGE +#undef HAVE___FPURGE +#undef HAVE_DECL_FPURGE + +/* Define if you have the getaddrinfo function. */ +#undef HAVE_GETADDRINFO + +/* Define if you have the getcwd function. */ +#undef HAVE_GETCWD + +/* Define if you have the getdtablesize function. */ +#undef HAVE_GETDTABLESIZE + +/* Define if you have the getgroups function. */ +#undef HAVE_GETGROUPS + +/* Define if you have the gethostbyname function. */ +#undef HAVE_GETHOSTBYNAME + +/* Define if you have the gethostname function. */ +#undef HAVE_GETHOSTNAME + +/* Define if you have the getpagesize function. */ +#undef HAVE_GETPAGESIZE + +/* Define if you have the getpeername function. */ +#undef HAVE_GETPEERNAME + +/* Define if you have the getpwent function. */ +#undef HAVE_GETPWENT + +/* Define if you have the getpwnam function. */ +#undef HAVE_GETPWNAM + +/* Define if you have the getpwuid function. */ +#undef HAVE_GETPWUID + +/* Define if you have the getrlimit function. */ +#undef HAVE_GETRLIMIT + +/* Define if you have the getrusage function. */ +#undef HAVE_GETRUSAGE + +/* Define if you have the getservbyname function. */ +#undef HAVE_GETSERVBYNAME + +/* Define if you have the getservent function. */ +#undef HAVE_GETSERVENT + +/* Define if you have the gettimeofday function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define if you have the getwd function. */ +#undef HAVE_GETWD + +/* Define if you have the iconv function. */ +#undef HAVE_ICONV + +/* Define if you have the imaxdiv function. */ +#undef HAVE_IMAXDIV + +/* Define if you have the inet_aton function. */ +#undef HAVE_INET_ATON + +/* Define if you have the isascii function. */ +#undef HAVE_ISASCII + +/* Define if you have the isblank function. */ +#undef HAVE_ISBLANK + +/* Define if you have the isgraph function. */ +#undef HAVE_ISGRAPH + +/* Define if you have the isprint function. */ +#undef HAVE_ISPRINT + +/* Define if you have the isspace function. */ +#undef HAVE_ISSPACE + +/* Define if you have the iswctype function. */ +#undef HAVE_ISWCTYPE + +/* Define if you have the iswlower function. */ +#undef HAVE_ISWLOWER + +/* Define if you have the iswupper function. */ +#undef HAVE_ISWUPPER + +/* Define if you have the isxdigit function. */ +#undef HAVE_ISXDIGIT + +/* Define if you have the kill function. */ +#undef HAVE_KILL + +/* Define if you have the killpg function. */ +#undef HAVE_KILLPG + +/* Define if you have the lstat function. */ +#undef HAVE_LSTAT + +/* Define if you have the locale_charset function. */ +#undef HAVE_LOCALE_CHARSET + +/* Define if you have the mbrlen function. */ +#undef HAVE_MBRLEN + +/* Define if you have the mbrtowc function. */ +#undef HAVE_MBRTOWC + +/* Define if you have the mbscasecmp function. */ +#undef HAVE_MBSCASECMP + +/* Define if you have the mbschr function. */ +#undef HAVE_MBSCHR + +/* Define if you have the mbscmp function. */ +#undef HAVE_MBSCMP + +/* Define if you have the mbsnrtowcs function. */ +#undef HAVE_MBSNRTOWCS + +/* Define if you have the mbsrtowcs function. */ +#undef HAVE_MBSRTOWCS + +/* Define if you have the memmove function. */ +#undef HAVE_MEMMOVE + +/* Define if you have the memset function. */ +#undef HAVE_MEMSET + +/* Define if you have the mkfifo function. */ +#undef HAVE_MKFIFO + +/* Define if you have the pathconf function. */ +#undef HAVE_PATHCONF + +/* Define if you have the putenv function. */ +#undef HAVE_PUTENV + +/* Define if you have the raise function. */ +#undef HAVE_RAISE + +/* Define if you have the readlink function. */ +#undef HAVE_READLINK + +/* Define if you have the regcomp function. */ +#undef HAVE_REGCOMP + +/* Define if you have the regexec function. */ +#undef HAVE_REGEXEC + +/* Define if you have the rename function. */ +#undef HAVE_RENAME + +/* Define if you have the sbrk function. */ +#undef HAVE_SBRK + +/* Define if you have the select function. */ +#undef HAVE_SELECT + +/* Define if you have the setdtablesize function. */ +#undef HAVE_SETDTABLESIZE + +/* Define if you have the setenv function. */ +#undef HAVE_SETENV + +/* Define if you have the setitimer function. */ +#undef HAVE_SETITIMER + +/* Define if you have the setlinebuf function. */ +#undef HAVE_SETLINEBUF + +/* Define if you have the setlocale function. */ +#undef HAVE_SETLOCALE + +/* Define if you have the setostype function. */ +#undef HAVE_SETOSTYPE + +/* Define if you have the setregid function. */ +#undef HAVE_SETREGID +#undef HAVE_DECL_SETREGID + +/* Define if you have the setvbuf function. */ +#undef HAVE_SETVBUF + +/* Define if you have the siginterrupt function. */ +#undef HAVE_SIGINTERRUPT + +/* Define if you have the POSIX.1-style sigsetjmp function. */ +#undef HAVE_POSIX_SIGSETJMP + +/* Define if you have the snprintf function. */ +#undef HAVE_SNPRINTF + +/* Define if you have the strcasecmp function. */ +#undef HAVE_STRCASECMP + +/* Define if you have the strcasestr function. */ +#undef HAVE_STRCASESTR + +/* Define if you have the strchr function. */ +#undef HAVE_STRCHR + +/* Define if you have the strchrnul function. */ +#undef HAVE_STRCHRNUL + +/* Define if you have the strcoll function. */ +#undef HAVE_STRCOLL + +/* Define if you have the strerror function. */ +#undef HAVE_STRERROR + +/* Define if you have the strftime function. */ +#undef HAVE_STRFTIME + +/* Define if you have the strnlen function. */ +#undef HAVE_STRNLEN + +/* Define if you have the strpbrk function. */ +#undef HAVE_STRPBRK + +/* Define if you have the strstr function. */ +#undef HAVE_STRSTR + +/* Define if you have the strtod function. */ +#undef HAVE_STRTOD + +/* Define if you have the strtoimax function. */ +#undef HAVE_STRTOIMAX + +/* Define if you have the strtol function. */ +#undef HAVE_STRTOL + +/* Define if you have the strtoll function. */ +#undef HAVE_STRTOLL + +/* Define if you have the strtoul function. */ +#undef HAVE_STRTOUL + +/* Define if you have the strtoull function. */ +#undef HAVE_STRTOULL + +/* Define if you have the strtoumax function. */ +#undef HAVE_STRTOUMAX + +/* Define if you have the strsignal function or macro. */ +#undef HAVE_STRSIGNAL + +/* Define if you have the sysconf function. */ +#undef HAVE_SYSCONF + +/* Define if you have the syslog function. */ +#undef HAVE_SYSLOG + +/* Define if you have the tcgetattr function. */ +#undef HAVE_TCGETATTR + +/* Define if you have the tcgetpgrp function. */ +#undef HAVE_TCGETPGRP + +/* Define if you have the times function. */ +#undef HAVE_TIMES + +/* Define if you have the towlower function. */ +#undef HAVE_TOWLOWER + +/* Define if you have the towupper function. */ +#undef HAVE_TOWUPPER + +/* Define if you have the ttyname function. */ +#undef HAVE_TTYNAME + +/* Define if you have the tzset function. */ +#undef HAVE_TZSET + +/* Define if you have the ulimit function. */ +#undef HAVE_ULIMIT + +/* Define if you have the uname function. */ +#undef HAVE_UNAME + +/* Define if you have the unsetenv function. */ +#undef HAVE_UNSETENV + +/* Define if you have the vasprintf function. */ +#undef HAVE_VASPRINTF + +/* Define if you have the vprintf function. */ +#undef HAVE_VPRINTF + +/* Define if you have the vsnprintf function. */ +#undef HAVE_VSNPRINTF + +/* Define if you have the waitpid function. */ +#undef HAVE_WAITPID + +/* Define if you have the wait3 function. */ +#undef HAVE_WAIT3 + +/* Define if you have the wcrtomb function. */ +#undef HAVE_WCRTOMB + +/* Define if you have the wcscoll function. */ +#undef HAVE_WCSCOLL + +/* Define if you have the wcsdup function. */ +#undef HAVE_WCSDUP + +/* Define if you have the wctype function. */ +#undef HAVE_WCTYPE + +/* Define if you have the wcswidth function. */ +#undef HAVE_WCSWIDTH + +/* Define if you have the wcwidth function. */ +#undef HAVE_WCWIDTH + +/* and if it works */ +#undef WCWIDTH_BROKEN + +/* Presence of certain system include files. */ + +/* Define if you have the header file. */ +#undef HAVE_ARPA_INET_H + +/* Define if you have the header file. */ +#undef HAVE_DIRENT_H + +/* Define if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define if you have the header file. */ +#undef HAVE_GRP_H + +/* Define if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define if you have the header file. */ +#undef HAVE_LANGINFO_H + +/* Define if you have the header file. */ +#undef HAVE_LIBINTL_H + +/* Define if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define if you have the header file. */ +#undef HAVE_LOCALE_H + +/* Define if you have the header file. */ +#undef HAVE_NDIR_H + +/* Define if you have the header file. */ +#undef HAVE_NETDB_H + +/* Define if you have the header file. */ +#undef HAVE_NETINET_IN_H + +/* Define if you have the header file. */ +#undef HAVE_PWD_H + +/* Define if you have the header file. */ +#undef HAVE_REGEX_H + +/* Define if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define if you have the header file. */ +#undef HAVE_STDARG_H + +/* Define if you have the header file. */ +#undef HAVE_STRING_H + +/* Define if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define if you have the header file. */ +#undef HAVE_STDBOOL_H + +/* Define if you have the header file. */ +#undef HAVE_STDDEF_H + +/* Define if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define if you have the header file. */ +#undef HAVE_SYSLOG_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_DIR_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_FILE_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_NDIR_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_PTE_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_PTEM_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_RESOURCE_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_STREAM_H + +/* Define if you have */ +#undef HAVE_SYS_TIME_H + +#undef TIME_WITH_SYS_TIME + +/* Define if you have */ +#undef HAVE_SYS_TIMES_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define if you have that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H + +/* Define if you have the header file. */ +#undef HAVE_TERMCAP_H + +/* Define if you have the header file. */ +#undef HAVE_TERMIO_H + +/* Define if you have the header file. */ +#undef HAVE_TERMIOS_H + +/* Define if you have the header file. */ +#undef HAVE_ULIMIT_H + +/* Define if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have the header file. */ +#undef HAVE_VARARGS_H + +/* Define if you have the header file. */ +#undef HAVE_WCHAR_H + +/* Define if you have the header file. */ +#undef HAVE_WCTYPE_H + +/* Presence of certain system libraries. */ + +#undef HAVE_LIBDL + +#undef HAVE_LIBSUN + +#undef HAVE_LIBSOCKET + +/* Are we running the GNU C library, version 2.1 or later? */ +#undef GLIBC21 + +/* Define if on MINIX. */ +#undef _MINIX + +/* Are we running SVR5 (UnixWare 7)? */ +#undef SVR5 + +/* Are we running SVR4.2? */ +#undef SVR4_2 + +/* Are we running some version of SVR4? */ +#undef SVR4 + +/* Define if job control is unusable or unsupported. */ +#undef JOB_CONTROL_MISSING + +/* Do we need to define _KERNEL to get the RLIMIT_* defines from + ? */ +#undef RLIMIT_NEEDS_KERNEL + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define for large files on AIX-style hosts. */ +#undef _LARGE_FILES + +/* Do strcoll(3) and strcmp(3) give different results in the default locale? */ +#undef STRCOLL_BROKEN + +#undef DUP2_BROKEN + +#undef GETCWD_BROKEN + +/* Additional defines for configuring lib/intl, maintained by autoscan/autoheader */ + +/* Define if you have the header file. */ +#undef HAVE_ARGZ_H + +/* Define if you have the header file. */ +#undef HAVE_ERRNO_H + +/* Define if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define if you have the header file. */ +#undef HAVE_MALLOC_H + +/* Define if you have the header file. */ +#undef HAVE_STDIO_EXT_H + +/* Define if you have the `dcgettext' function. */ +#undef HAVE_DCGETTEXT + +/* Define if you have the `localeconv' function. */ +#undef HAVE_LOCALECONV + +/* Define if your system has a working `malloc' function. */ +/* #undef HAVE_MALLOC */ + +/* Define if you have the `mempcpy' function. */ +#undef HAVE_MEMPCPY + +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define if you have the `munmap' function. */ +#undef HAVE_MUNMAP + +/* Define if you have the `nl_langinfo' function. */ +#undef HAVE_NL_LANGINFO + +/* Define if you have the `stpcpy' function. */ +#undef HAVE_STPCPY + +/* Define if you have the `strcspn' function. */ +#undef HAVE_STRCSPN + +/* Define if you have the `strdup' function. */ +#undef HAVE_STRDUP + +/* Define if you have the `__argz_count' function. */ +#undef HAVE___ARGZ_COUNT + +/* Define if you have the `__argz_next' function. */ +#undef HAVE___ARGZ_NEXT + +/* Define if you have the `__argz_stringify' function. */ +#undef HAVE___ARGZ_STRINGIFY + +/* End additions for lib/intl */ + +#include "config-bot.h" + +#endif /* _CONFIG_H_ */ diff --git a/configure b/configure new file mode 100755 index 0000000..98bf890 --- /dev/null +++ b/configure @@ -0,0 +1,17467 @@ +#! /bin/sh +# From configure.ac for Bash 4.3, version 4.063. +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for bash 4.3-release. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and bug-bash@gnu.org +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='bash' +PACKAGE_TARNAME='bash' +PACKAGE_VERSION='4.3-release' +PACKAGE_STRING='bash 4.3-release' +PACKAGE_BUGREPORT='bug-bash@gnu.org' +PACKAGE_URL='' + +ac_unique_file="shell.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_list= +ac_func_list= +ac_subst_vars='LTLIBOBJS +LOCAL_DEFS +LOCAL_LDFLAGS +LOCAL_CFLAGS +LOCAL_LIBS +MALLOC_DEBUG +DEBUG +RELSTATUS +BASHVERS +ARFLAGS +BUILD_DIR +incdir +PROFILE_FLAGS +SHOBJ_STATUS +SHOBJ_LIBS +SHOBJ_XLDFLAGS +SHOBJ_LDFLAGS +SHOBJ_LD +SHOBJ_CFLAGS +SHOBJ_CC +JOBS_O +TERMCAP_DEP +TERMCAP_LIB +SIGLIST_O +PTHREAD_H_DEFINES_STRUCT_TIMESPEC +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC +TIME_H_DEFINES_STRUCT_TIMESPEC +LIBINTL_H +INTL_INC +INTL_DEP +LIBOBJS +POSUB +LTLIBINTL +LIBINTL +INTLLIBS +INTL_LIBTOOL_SUFFIX_PREFIX +INTLOBJS +GENCAT +INSTOBJEXT +DATADIRNAME +CATOBJEXT +USE_INCLUDED_LIBINTL +BUILD_INCLUDED_LIBINTL +INTLBISON +LTLIBICONV +LIBICONV +GLIBC21 +ALLOCA +MSGMERGE +XGETTEXT +GMSGFMT +MSGFMT +USE_NLS +MKINSTALLDIRS +SIZE +MAKE_SHELL +SET_MAKE +YFLAGS +YACC +RANLIB +AR +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +TILDE_LIB +HIST_LIBDIR +HISTORY_DEP +HISTORY_LIB +RL_INCLUDE +RL_INCLUDEDIR +RL_LIBDIR +READLINE_DEP +READLINE_LIB +RL_MINOR +RL_MAJOR +RL_VERSION +LIBS_FOR_BUILD +STATIC_LD +SIGNAMES_O +SIGNAMES_H +CROSS_COMPILE +EGREP +GREP +CPP +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +HELPSTRINGS +HELPFILES_TARGET +HELPINSTALL +HELPDIRDEFINE +HELPDIR +MALLOC_DEP +MALLOC_LDFLAGS +MALLOC_LIBRARY +MALLOC_LIB +MALLOC_SRC +MALLOC_TARGET +PURIFY +TESTSCRIPT +CPPFLAGS_FOR_BUILD +LDFLAGS_FOR_BUILD +CFLAGS_FOR_BUILD +CC_FOR_BUILD +DEBUGGER_START_FILE +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +with_afs +with_bash_malloc +with_curses +with_gnu_malloc +with_installed_readline +with_purecov +with_purify +enable_minimal_config +enable_alias +enable_arith_for_command +enable_array_variables +enable_bang_history +enable_brace_expansion +enable_casemod_attributes +enable_casemod_expansions +enable_command_timing +enable_cond_command +enable_cond_regexp +enable_coprocesses +enable_debugger +enable_direxpand_default +enable_directory_stack +enable_disabled_builtins +enable_dparen_arithmetic +enable_extended_glob +enable_extended_glob_default +enable_glob_asciiranges_default +enable_help_builtin +enable_history +enable_job_control +enable_multibyte +enable_net_redirections +enable_process_substitution +enable_progcomp +enable_prompt_string_decoding +enable_readline +enable_restricted +enable_select +enable_separate_helpfiles +enable_single_help_strings +enable_strict_posix_default +enable_usg_echo_default +enable_xpg_echo_default +enable_mem_scramble +enable_profiling +enable_static_link +enable_largefile +enable_nls +with_gnu_ld +enable_rpath +with_libiconv_prefix +with_included_gettext +with_libintl_prefix +' + ac_precious_vars='build_alias +host_alias +target_alias +DEBUGGER_START_FILE +CC_FOR_BUILD +CFLAGS_FOR_BUILD +LDFLAGS_FOR_BUILD +CPPFLAGS_FOR_BUILD +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +YACC +YFLAGS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures bash 4.3-release to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/bash] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of bash 4.3-release:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-minimal-config a minimal sh-like configuration + --enable-alias enable shell aliases + --enable-arith-for-command + enable arithmetic for command + --enable-array-variables + include shell array variables + --enable-bang-history turn on csh-style history substitution + --enable-brace-expansion + include brace expansion + --enable-casemod-attributes + include case-modifying variable attributes + --enable-casemod-expansions + include case-modifying word expansions + --enable-command-timing enable the time reserved word and command timing + --enable-cond-command enable the conditional command + --enable-cond-regexp enable extended regular expression matching in + conditional commands + --enable-coprocesses enable coprocess support and the coproc reserved + word + --enable-debugger enable support for bash debugger + --enable-direxpand-default + enable the direxpand shell option by default + --enable-directory-stack + enable builtins pushd/popd/dirs + --enable-disabled-builtins + allow disabled builtins to still be invoked + --enable-dparen-arithmetic + include ((...)) command + --enable-extended-glob include ksh-style extended pattern matching + --enable-extended-glob-default + force extended pattern matching to be enabled by + default + --enable-glob-asciiranges-default + force bracket range expressions in pattern matching + to use the C locale by default + --enable-help-builtin include the help builtin + --enable-history turn on command history + --enable-job-control enable job control features + --enable-multibyte enable multibyte characters if OS supports them + --enable-net-redirections + enable /dev/tcp/host/port redirection + --enable-process-substitution + enable process substitution + --enable-progcomp enable programmable completion and the complete + builtin + --enable-prompt-string-decoding + turn on escape character decoding in prompts + --enable-readline turn on command line editing + --enable-restricted enable a restricted shell + --enable-select include select command + --enable-separate-helpfiles + use external files for help builtin documentation + --enable-single-help-strings + store help documentation as a single string to ease + translation + --enable-strict-posix-default + configure bash to be posix-conformant by default + --enable-usg-echo-default + a synonym for --enable-xpg-echo-default + --enable-xpg-echo-default + make the echo builtin expand escape sequences by + default + --enable-mem-scramble scramble memory on calls to malloc and free + --enable-profiling allow profiling with gprof + --enable-static-link link bash statically, for use as a root shell + --disable-largefile omit support for large files + --disable-nls do not use Native Language Support + --disable-rpath do not hardcode runtime library paths + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-afs if you are running AFS + --with-bash-malloc use the Bash version of malloc + --with-curses use the curses library instead of the termcap + library + --with-gnu-malloc synonym for --with-bash-malloc + --with-installed-readline + use a version of the readline library that is + already installed + --with-purecov configure to postprocess with pure coverage + --with-purify configure to postprocess with purify + --with-gnu-ld assume the C compiler uses GNU ld default=no + --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib + --without-libiconv-prefix don't search for libiconv in includedir and libdir + --with-included-gettext use the GNU gettext library included here + --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib + --without-libintl-prefix don't search for libintl in includedir and libdir + +Some influential environment variables: + DEBUGGER_START_FILE + location of bash debugger initialization file + CC_FOR_BUILD + C compiler used when compiling binaries used only at build time + CFLAGS_FOR_BUILD + Compliation options (CFLAGS) used when compiling binaries used + only at build time + LDFLAGS_FOR_BUILD + Linker options (LDFLAGS) used when compiling binaries used only + at build time + CPPFLAGS_FOR_BUILD + C preprocessor options (CPPFLAGS) used when compiling binaries + used only at build time + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + YACC The `Yet Another Compiler Compiler' implementation to use. + Defaults to the first program found out of: `bison -y', `byacc', + `yacc'. + YFLAGS The list of arguments that will be passed by default to $YACC. + This script will default YFLAGS to the empty string to avoid a + default value of `-d' given by some make applications. + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +bash configure 4.3-release +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ------------------------------- ## +## Report this to bug-bash@gnu.org ## +## ------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. +ac_fn_c_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_decl + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 &5 +$as_echo_n "checking for $2.$3... " >&6; } +if eval \${$4+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_member +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by bash $as_me 4.3-release, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +as_fn_append ac_header_list " stdlib.h" +as_fn_append ac_header_list " unistd.h" +as_fn_append ac_header_list " sys/param.h" +as_fn_append ac_header_list " sys/time.h" +as_fn_append ac_func_list " alarm" +as_fn_append ac_func_list " fpurge" +as_fn_append ac_func_list " __fpurge" +as_fn_append ac_func_list " snprintf" +as_fn_append ac_func_list " vsnprintf" +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + +ac_aux_dir= +for ac_dir in ./support "$srcdir"/./support; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in ./support \"$srcdir\"/./support" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +ac_config_headers="$ac_config_headers config.h" + + +BASHVERS=4.3 +RELSTATUS=release + +case "$RELSTATUS" in +alp*|bet*|dev*|rc*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;; +*) DEBUG= MALLOC_DEBUG= ;; +esac + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + + +opt_bash_malloc=yes +opt_purify=no +opt_purecov=no +opt_afs=no +opt_curses=no +opt_with_installed_readline=no + +#htmldir= + +case "${host_cpu}-${host_os}" in +alpha*-*) opt_bash_malloc=no ;; # alpha running osf/1 or linux +*[Cc]ray*-*) opt_bash_malloc=no ;; # Crays +*-osf1*) opt_bash_malloc=no ;; # other osf/1 machines +sparc-svr4*) opt_bash_malloc=no ;; # sparc SVR4, SVR4.2 +sparc-netbsd*) opt_bash_malloc=no ;; # needs 8-byte alignment +mips-irix6*) opt_bash_malloc=no ;; # needs 8-byte alignment +m68k-sysv) opt_bash_malloc=no ;; # fixes file descriptor leak in closedir +sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF +#*-freebsd*-gnu) opt_bash_malloc=no ;; # there's some undetermined problem here +#*-freebsd*) opt_bash_malloc=no ;; # they claim it's better; I disagree +*-openbsd*) opt_bash_malloc=no ;; # they claim it needs eight-bit alignment +*-mirbsd*) opt_bash_malloc=no ;; # they claim it needs eight-bit alignment +*-aix*) opt_bash_malloc=no ;; # AIX machines +*-nextstep*) opt_bash_malloc=no ;; # NeXT machines running NeXTstep +*-openstep*) opt_bash_malloc=no ;; # i386/Sparc/HP machines running Openstep +*-macos*) opt_bash_malloc=no ;; # Apple MacOS X +*-rhapsody*) opt_bash_malloc=no ;; # Apple Rhapsody (MacOS X) +*-darwin*) opt_bash_malloc=no ;; # Apple Darwin (MacOS X) +*-dgux*) opt_bash_malloc=no ;; # DG/UX machines +*-qnx*) opt_bash_malloc=no ;; # QNX 4.2, QNX 6.x +*-machten4) opt_bash_malloc=no ;; # MachTen 4.x +*-bsdi2.1|*-bsdi3.?) opt_bash_malloc=no ; : ${CC:=shlicc2} ;; # for loadable builtins +*-beos*) opt_bash_malloc=no ;; # they say it's suitable +*-cygwin*) opt_bash_malloc=no ;; # Cygnus's CYGWIN environment +*-opennt*|*-interix*) opt_bash_malloc=no ;; # Interix, now owned by Microsoft +*-nsk*) opt_bash_malloc=no ;; # HP NonStop +*-haiku*) opt_bash_malloc=no ;; # Haiku OS +esac + +# memory scrambling on free() +case "${host_os}" in +sco3.2v5*|sco3.2v4*) opt_memscramble=no ;; +*) opt_memscramble=yes ;; +esac + + + + +# Check whether --with-afs was given. +if test "${with_afs+set}" = set; then : + withval=$with_afs; opt_afs=$withval +fi + + +# Check whether --with-bash-malloc was given. +if test "${with_bash_malloc+set}" = set; then : + withval=$with_bash_malloc; opt_bash_malloc=$withval +fi + + +# Check whether --with-curses was given. +if test "${with_curses+set}" = set; then : + withval=$with_curses; opt_curses=$withval +fi + + +# Check whether --with-gnu-malloc was given. +if test "${with_gnu_malloc+set}" = set; then : + withval=$with_gnu_malloc; opt_bash_malloc=$withval +fi + + +# Check whether --with-installed-readline was given. +if test "${with_installed_readline+set}" = set; then : + withval=$with_installed_readline; opt_with_installed_readline=$withval +fi + + +# Check whether --with-purecov was given. +if test "${with_purecov+set}" = set; then : + withval=$with_purecov; opt_purecov=$withval +fi + + +# Check whether --with-purify was given. +if test "${with_purify+set}" = set; then : + withval=$with_purify; opt_purify=$withval +fi + + +if test "$opt_bash_malloc" = yes; then + MALLOC_TARGET=malloc + MALLOC_SRC=malloc.c + + MALLOC_LIB='-lmalloc' + MALLOC_LIBRARY='$(ALLOC_LIBDIR)/libmalloc.a' + MALLOC_LDFLAGS='-L$(ALLOC_LIBDIR)' + MALLOC_DEP='$(MALLOC_LIBRARY)' + + $as_echo "#define USING_BASH_MALLOC 1" >>confdefs.h + +else + MALLOC_LIB= + MALLOC_LIBRARY= + MALLOC_LDFLAGS= + MALLOC_DEP= +fi + +if test "$opt_purify" = yes; then + PURIFY="purify " + $as_echo "#define DISABLE_MALLOC_WRAPPERS 1" >>confdefs.h + +else + PURIFY= +fi + +if test "$opt_purecov" = yes; then + PURIFY="${PURIFY}purecov" +fi + +if test "$opt_afs" = yes; then + $as_echo "#define AFS 1" >>confdefs.h + +fi + +if test "$opt_curses" = yes; then + prefer_curses=yes +fi + +if test -z "${DEBUGGER_START_FILE}"; then + DEBUGGER_START_FILE='${datadir}/bashdb/bashdb-main.inc' +fi + +opt_minimal_config=no + +opt_job_control=yes +opt_alias=yes +opt_readline=yes +opt_history=yes +opt_bang_history=yes +opt_dirstack=yes +opt_restricted=yes +opt_process_subst=yes +opt_prompt_decoding=yes +opt_select=yes +opt_help=yes +opt_array_variables=yes +opt_dparen_arith=yes +opt_extended_glob=yes +opt_brace_expansion=yes +opt_disabled_builtins=no +opt_command_timing=yes +opt_xpg_echo=no +opt_strict_posix=no +opt_cond_command=yes +opt_cond_regexp=yes +opt_coproc=yes +opt_arith_for_command=yes +opt_net_redirs=yes +opt_progcomp=yes +opt_separate_help=no +opt_multibyte=yes +opt_debugger=yes +opt_single_longdoc_strings=yes +opt_casemod_attrs=yes +opt_casemod_expansions=yes +opt_extglob_default=no +opt_dircomplete_expand_default=no +opt_globascii_default=no + +opt_static_link=no +opt_profiling=no + +# Check whether --enable-minimal-config was given. +if test "${enable_minimal_config+set}" = set; then : + enableval=$enable_minimal_config; opt_minimal_config=$enableval +fi + + +if test $opt_minimal_config = yes; then + opt_job_control=no opt_alias=no opt_readline=no + opt_history=no opt_bang_history=no opt_dirstack=no + opt_restricted=no opt_process_subst=no opt_prompt_decoding=no + opt_select=no opt_help=no opt_array_variables=no opt_dparen_arith=no + opt_brace_expansion=no opt_disabled_builtins=no opt_command_timing=no + opt_extended_glob=no opt_cond_command=no opt_arith_for_command=no + opt_net_redirs=no opt_progcomp=no opt_separate_help=no + opt_multibyte=yes opt_cond_regexp=no opt_coproc=no + opt_casemod_attrs=no opt_casemod_expansions=no opt_extglob_default=no + opt_globascii_default=no +fi + +# Check whether --enable-alias was given. +if test "${enable_alias+set}" = set; then : + enableval=$enable_alias; opt_alias=$enableval +fi + +# Check whether --enable-arith-for-command was given. +if test "${enable_arith_for_command+set}" = set; then : + enableval=$enable_arith_for_command; opt_arith_for_command=$enableval +fi + +# Check whether --enable-array-variables was given. +if test "${enable_array_variables+set}" = set; then : + enableval=$enable_array_variables; opt_array_variables=$enableval +fi + +# Check whether --enable-bang-history was given. +if test "${enable_bang_history+set}" = set; then : + enableval=$enable_bang_history; opt_bang_history=$enableval +fi + +# Check whether --enable-brace-expansion was given. +if test "${enable_brace_expansion+set}" = set; then : + enableval=$enable_brace_expansion; opt_brace_expansion=$enableval +fi + +# Check whether --enable-casemod-attributes was given. +if test "${enable_casemod_attributes+set}" = set; then : + enableval=$enable_casemod_attributes; opt_casemod_attrs=$enableval +fi + +# Check whether --enable-casemod-expansions was given. +if test "${enable_casemod_expansions+set}" = set; then : + enableval=$enable_casemod_expansions; opt_casemod_expansions=$enableval +fi + +# Check whether --enable-command-timing was given. +if test "${enable_command_timing+set}" = set; then : + enableval=$enable_command_timing; opt_command_timing=$enableval +fi + +# Check whether --enable-cond-command was given. +if test "${enable_cond_command+set}" = set; then : + enableval=$enable_cond_command; opt_cond_command=$enableval +fi + +# Check whether --enable-cond-regexp was given. +if test "${enable_cond_regexp+set}" = set; then : + enableval=$enable_cond_regexp; opt_cond_regexp=$enableval +fi + +# Check whether --enable-coprocesses was given. +if test "${enable_coprocesses+set}" = set; then : + enableval=$enable_coprocesses; opt_coproc=$enableval +fi + +# Check whether --enable-debugger was given. +if test "${enable_debugger+set}" = set; then : + enableval=$enable_debugger; opt_debugger=$enableval +fi + +# Check whether --enable-direxpand-default was given. +if test "${enable_direxpand_default+set}" = set; then : + enableval=$enable_direxpand_default; opt_dircomplete_expand_default=$enableval +fi + +# Check whether --enable-directory-stack was given. +if test "${enable_directory_stack+set}" = set; then : + enableval=$enable_directory_stack; opt_dirstack=$enableval +fi + +# Check whether --enable-disabled-builtins was given. +if test "${enable_disabled_builtins+set}" = set; then : + enableval=$enable_disabled_builtins; opt_disabled_builtins=$enableval +fi + +# Check whether --enable-dparen-arithmetic was given. +if test "${enable_dparen_arithmetic+set}" = set; then : + enableval=$enable_dparen_arithmetic; opt_dparen_arith=$enableval +fi + +# Check whether --enable-extended-glob was given. +if test "${enable_extended_glob+set}" = set; then : + enableval=$enable_extended_glob; opt_extended_glob=$enableval +fi + +# Check whether --enable-extended-glob-default was given. +if test "${enable_extended_glob_default+set}" = set; then : + enableval=$enable_extended_glob_default; opt_extglob_default=$enableval +fi + +# Check whether --enable-glob-asciiranges-default was given. +if test "${enable_glob_asciiranges_default+set}" = set; then : + enableval=$enable_glob_asciiranges_default; opt_globascii_default=$enableval +fi + +# Check whether --enable-help-builtin was given. +if test "${enable_help_builtin+set}" = set; then : + enableval=$enable_help_builtin; opt_help=$enableval +fi + +# Check whether --enable-history was given. +if test "${enable_history+set}" = set; then : + enableval=$enable_history; opt_history=$enableval +fi + +# Check whether --enable-job-control was given. +if test "${enable_job_control+set}" = set; then : + enableval=$enable_job_control; opt_job_control=$enableval +fi + +# Check whether --enable-multibyte was given. +if test "${enable_multibyte+set}" = set; then : + enableval=$enable_multibyte; opt_multibyte=$enableval +fi + +# Check whether --enable-net-redirections was given. +if test "${enable_net_redirections+set}" = set; then : + enableval=$enable_net_redirections; opt_net_redirs=$enableval +fi + +# Check whether --enable-process-substitution was given. +if test "${enable_process_substitution+set}" = set; then : + enableval=$enable_process_substitution; opt_process_subst=$enableval +fi + +# Check whether --enable-progcomp was given. +if test "${enable_progcomp+set}" = set; then : + enableval=$enable_progcomp; opt_progcomp=$enableval +fi + +# Check whether --enable-prompt-string-decoding was given. +if test "${enable_prompt_string_decoding+set}" = set; then : + enableval=$enable_prompt_string_decoding; opt_prompt_decoding=$enableval +fi + +# Check whether --enable-readline was given. +if test "${enable_readline+set}" = set; then : + enableval=$enable_readline; opt_readline=$enableval +fi + +# Check whether --enable-restricted was given. +if test "${enable_restricted+set}" = set; then : + enableval=$enable_restricted; opt_restricted=$enableval +fi + +# Check whether --enable-select was given. +if test "${enable_select+set}" = set; then : + enableval=$enable_select; opt_select=$enableval +fi + +# Check whether --enable-separate-helpfiles was given. +if test "${enable_separate_helpfiles+set}" = set; then : + enableval=$enable_separate_helpfiles; opt_separate_help=$enableval +fi + +# Check whether --enable-single-help-strings was given. +if test "${enable_single_help_strings+set}" = set; then : + enableval=$enable_single_help_strings; opt_single_longdoc_strings=$enableval +fi + +# Check whether --enable-strict-posix-default was given. +if test "${enable_strict_posix_default+set}" = set; then : + enableval=$enable_strict_posix_default; opt_strict_posix=$enableval +fi + +# Check whether --enable-usg-echo-default was given. +if test "${enable_usg_echo_default+set}" = set; then : + enableval=$enable_usg_echo_default; opt_xpg_echo=$enableval +fi + +# Check whether --enable-xpg-echo-default was given. +if test "${enable_xpg_echo_default+set}" = set; then : + enableval=$enable_xpg_echo_default; opt_xpg_echo=$enableval +fi + + +# Check whether --enable-mem-scramble was given. +if test "${enable_mem_scramble+set}" = set; then : + enableval=$enable_mem_scramble; opt_memscramble=$enableval +fi + +# Check whether --enable-profiling was given. +if test "${enable_profiling+set}" = set; then : + enableval=$enable_profiling; opt_profiling=$enableval +fi + +# Check whether --enable-static-link was given. +if test "${enable_static_link+set}" = set; then : + enableval=$enable_static_link; opt_static_link=$enableval +fi + + + + + + + + + +if test $opt_alias = yes; then +$as_echo "#define ALIAS 1" >>confdefs.h + +fi +if test $opt_dirstack = yes; then +$as_echo "#define PUSHD_AND_POPD 1" >>confdefs.h + +fi +if test $opt_restricted = yes; then +$as_echo "#define RESTRICTED_SHELL 1" >>confdefs.h + +fi +if test $opt_process_subst = yes; then +$as_echo "#define PROCESS_SUBSTITUTION 1" >>confdefs.h + +fi +if test $opt_prompt_decoding = yes; then +$as_echo "#define PROMPT_STRING_DECODE 1" >>confdefs.h + +fi +if test $opt_select = yes; then +$as_echo "#define SELECT_COMMAND 1" >>confdefs.h + +fi +if test $opt_help = yes; then +$as_echo "#define HELP_BUILTIN 1" >>confdefs.h + +fi +if test $opt_array_variables = yes; then +$as_echo "#define ARRAY_VARS 1" >>confdefs.h + +fi +if test $opt_dparen_arith = yes; then +$as_echo "#define DPAREN_ARITHMETIC 1" >>confdefs.h + +fi +if test $opt_brace_expansion = yes; then +$as_echo "#define BRACE_EXPANSION 1" >>confdefs.h + +fi +if test $opt_disabled_builtins = yes; then +$as_echo "#define DISABLED_BUILTINS 1" >>confdefs.h + +fi +if test $opt_command_timing = yes; then +$as_echo "#define COMMAND_TIMING 1" >>confdefs.h + +fi +if test $opt_xpg_echo = yes ; then +$as_echo "#define DEFAULT_ECHO_TO_XPG 1" >>confdefs.h + +fi +if test $opt_strict_posix = yes; then +$as_echo "#define STRICT_POSIX 1" >>confdefs.h + +fi +if test $opt_extended_glob = yes ; then +$as_echo "#define EXTENDED_GLOB 1" >>confdefs.h + +fi +if test $opt_extglob_default = yes; then +$as_echo "#define EXTGLOB_DEFAULT 1" >>confdefs.h + +else +$as_echo "#define EXTGLOB_DEFAULT 0" >>confdefs.h + +fi +if test $opt_cond_command = yes ; then +$as_echo "#define COND_COMMAND 1" >>confdefs.h + +fi +if test $opt_cond_regexp = yes ; then +$as_echo "#define COND_REGEXP 1" >>confdefs.h + +fi +if test $opt_coproc = yes; then +$as_echo "#define COPROCESS_SUPPORT 1" >>confdefs.h + +fi +if test $opt_arith_for_command = yes; then +$as_echo "#define ARITH_FOR_COMMAND 1" >>confdefs.h + +fi +if test $opt_net_redirs = yes; then +$as_echo "#define NETWORK_REDIRECTIONS 1" >>confdefs.h + +fi +if test $opt_progcomp = yes; then +$as_echo "#define PROGRAMMABLE_COMPLETION 1" >>confdefs.h + +fi +if test $opt_multibyte = no; then +$as_echo "#define NO_MULTIBYTE_SUPPORT 1" >>confdefs.h + +fi +if test $opt_debugger = yes; then +$as_echo "#define DEBUGGER 1" >>confdefs.h + +fi +if test $opt_casemod_attrs = yes; then +$as_echo "#define CASEMOD_ATTRS 1" >>confdefs.h + +fi +if test $opt_casemod_expansions = yes; then +$as_echo "#define CASEMOD_EXPANSIONS 1" >>confdefs.h + +fi +if test $opt_dircomplete_expand_default = yes; then +$as_echo "#define DIRCOMPLETE_EXPAND_DEFAULT 1" >>confdefs.h + +fi +if test $opt_globascii_default = yes; then +$as_echo "#define GLOBASCII_DEFAULT 1" >>confdefs.h + +else +$as_echo "#define GLOBASCII_DEFAULT 0" >>confdefs.h + +fi + +if test $opt_memscramble = yes; then +$as_echo "#define MEMSCRAMBLE 1" >>confdefs.h + +fi + +if test "$opt_minimal_config" = yes; then + TESTSCRIPT=run-minimal +else + TESTSCRIPT=run-all +fi + +HELPDIR= HELPDIRDEFINE= HELPINSTALL= HELPFILES_TARGET= +if test "$opt_separate_help" != no; then + if test "$opt_separate_help" = "yes" ; then + HELPDIR='${datadir}/bash' + else + HELPDIR=$opt_separate_help + fi + HELPDIRDEFINE='-H ${HELPDIR}' + HELPINSTALL='install-help' + HELPFILES_TARGET='helpdoc' +fi +HELPSTRINGS= +if test "$opt_single_longdoc_strings" != "yes"; then + HELPSTRINGS='-S' +fi + + + + + + + + + + + + + + + + + + + +echo "" +echo "Beginning configuration for bash-$BASHVERS-$RELSTATUS for ${host_cpu}-${host_vendor}-${host_os}" +echo "" + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror in -lcposix" >&5 +$as_echo_n "checking for strerror in -lcposix... " >&6; } +if ${ac_cv_lib_cposix_strerror+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcposix $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char strerror (); +int +main () +{ +return strerror (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_cposix_strerror=yes +else + ac_cv_lib_cposix_strerror=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cposix_strerror" >&5 +$as_echo "$ac_cv_lib_cposix_strerror" >&6; } +if test "x$ac_cv_lib_cposix_strerror" = xyes; then : + LIBS="$LIBS -lcposix" +fi + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes; then : + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h + + +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +$as_echo "#define _MINIX 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if ${ac_cv_safe_to_define___extensions__+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_safe_to_define___extensions__=yes +else + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h + + + + +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if ${ac_cv_sys_largefile_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO"; then : + break +fi +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if ${ac_cv_sys_file_offset_bits+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=64; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if ${ac_cv_sys_large_files+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=1; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -rf conftest* + fi + + +fi + + + +SIGNAMES_O= +SIGNAMES_H=lsignames.h + + + +CROSS_COMPILE= +if test "x$cross_compiling" = "xyes"; then + case "${host}" in + *-cygwin*) + cross_cache=${srcdir}/cross-build/cygwin32.cache + ;; + *-mingw*) + cross_cache=${srcdir}/cross-build/cygwin32.cache + ;; + i[3456]86-*-beos*) + cross_cache=${srcdir}/cross-build/x86-beos.cache + ;; + *) echo "configure: cross-compiling for $host is not supported" >&2 + ;; + esac + if test -n "${cross_cache}" && test -r "${cross_cache}"; then + echo "loading cross-build cache file ${cross_cache}" + . ${cross_cache} + fi + unset cross_cache + SIGNAMES_O='signames.o' + CROSS_COMPILE='-DCROSS_COMPILING' + +fi + + + + +if test -z "$CFLAGS"; then + AUTO_CFLAGS="-g ${GCC+-O2}" + AUTO_LDFLAGS="-g ${GCC+-O2}" +else + AUTO_CFLAGS= AUTO_LDFLAGS= +fi + +CFLAGS=${CFLAGS-"$AUTO_CFLAGS"} +# LDFLAGS=${LDFLAGS="$AUTO_LDFLAGS"} # XXX + +if test "$opt_profiling" = "yes"; then + PROFILE_FLAGS=-pg + case "$host_os" in + solaris2*) ;; + *) opt_static_link=yes ;; + esac + DEBUG= MALLOC_DEBUG= +fi + +prefer_shared=yes +prefer_static=no + +if test "$opt_static_link" = yes; then + prefer_static=yes + prefer_shared=no + # if we're using gcc, add `-static' to LDFLAGS, except on Solaris >= 2 + if test -n "$GCC" || test "$ac_cv_c_compiler_gnu" = "yes"; then + STATIC_LD="-static" + case "$host_os" in + solaris2*) ;; + *) LDFLAGS="$LDFLAGS -static" ;; # XXX experimental + esac + fi +fi + +# set the appropriate make variables for building the "build tools" +# modify defaults based on whether or not we are cross compiling, since the +# options for the target host may not be appropriate for the build host +if test "X$cross_compiling" = "Xno"; then + CC_FOR_BUILD=${CC_FOR_BUILD-'$(CC)'} + CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-"$CPPFLAGS"} # XXX - should it be '$(CPPFLAGS)' + LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-'$(LDFLAGS)'} + # CFLAGS set above to default value if not passed in environment + CFLAGS_FOR_BUILD=${CFLAGS-'$(CFLAGS)'} + LIBS_FOR_BUILD=${LIBS_FOR_BUILD-'$(LIBS)'} +else + CC_FOR_BUILD=${CC_FOR_BUILD-"gcc"} + CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-""} + LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-""} + CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD="-g"} + LIBS_FOR_BUILD=${LIBS_FOR_BUILD-""} +fi + + + + + + + + + + + + +if test $ac_cv_c_compiler_gnu = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 +$as_echo_n "checking whether $CC needs -traditional... " >&6; } +if ${ac_cv_prog_gcc_traditional+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_pattern="Autoconf.*'x'" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then : + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no +fi +rm -f conftest* + + + if test $ac_cv_prog_gcc_traditional = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then : + ac_cv_prog_gcc_traditional=yes +fi +rm -f conftest* + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 +$as_echo "$ac_cv_prog_gcc_traditional" >&6; } + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + + + +if test "$opt_readline" = yes && test "$opt_with_installed_readline" != "no" +then + # If the user specified --with-installed-readline=PREFIX and PREFIX + # is not `yes', set ac_cv_rl_prefix to PREFIX + test $opt_with_installed_readline != "yes" && ac_cv_rl_prefix=$opt_with_installed_readline + + +if test "X$bash_cv_termcap_lib" = "X"; then +_bash_needmsg=yes +else +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which library has the termcap functions" >&5 +$as_echo_n "checking which library has the termcap functions... " >&6; } +_bash_needmsg= +fi +if ${bash_cv_termcap_lib+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_fn_c_check_func "$LINENO" "tgetent" "ac_cv_func_tgetent" +if test "x$ac_cv_func_tgetent" = xyes; then : + bash_cv_termcap_lib=libc +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltermcap" >&5 +$as_echo_n "checking for tgetent in -ltermcap... " >&6; } +if ${ac_cv_lib_termcap_tgetent+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltermcap $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (); +int +main () +{ +return tgetent (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_termcap_tgetent=yes +else + ac_cv_lib_termcap_tgetent=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_termcap_tgetent" >&5 +$as_echo "$ac_cv_lib_termcap_tgetent" >&6; } +if test "x$ac_cv_lib_termcap_tgetent" = xyes; then : + bash_cv_termcap_lib=libtermcap +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltinfo" >&5 +$as_echo_n "checking for tgetent in -ltinfo... " >&6; } +if ${ac_cv_lib_tinfo_tgetent+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltinfo $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (); +int +main () +{ +return tgetent (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_tinfo_tgetent=yes +else + ac_cv_lib_tinfo_tgetent=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfo_tgetent" >&5 +$as_echo "$ac_cv_lib_tinfo_tgetent" >&6; } +if test "x$ac_cv_lib_tinfo_tgetent" = xyes; then : + bash_cv_termcap_lib=libtinfo +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lcurses" >&5 +$as_echo_n "checking for tgetent in -lcurses... " >&6; } +if ${ac_cv_lib_curses_tgetent+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcurses $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (); +int +main () +{ +return tgetent (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_curses_tgetent=yes +else + ac_cv_lib_curses_tgetent=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_tgetent" >&5 +$as_echo "$ac_cv_lib_curses_tgetent" >&6; } +if test "x$ac_cv_lib_curses_tgetent" = xyes; then : + bash_cv_termcap_lib=libcurses +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lncurses" >&5 +$as_echo_n "checking for tgetent in -lncurses... " >&6; } +if ${ac_cv_lib_ncurses_tgetent+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lncurses $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (); +int +main () +{ +return tgetent (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ncurses_tgetent=yes +else + ac_cv_lib_ncurses_tgetent=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_tgetent" >&5 +$as_echo "$ac_cv_lib_ncurses_tgetent" >&6; } +if test "x$ac_cv_lib_ncurses_tgetent" = xyes; then : + bash_cv_termcap_lib=libncurses +else + bash_cv_termcap_lib=gnutermcap +fi + +fi + +fi + +fi + +fi + +fi + +if test "X$_bash_needmsg" = "Xyes"; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which library has the termcap functions" >&5 +$as_echo_n "checking which library has the termcap functions... " >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using $bash_cv_termcap_lib" >&5 +$as_echo "using $bash_cv_termcap_lib" >&6; } +if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then +LDFLAGS="$LDFLAGS -L./lib/termcap" +TERMCAP_LIB="./lib/termcap/libtermcap.a" +TERMCAP_DEP="./lib/termcap/libtermcap.a" +elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then +TERMCAP_LIB=-ltermcap +TERMCAP_DEP= +elif test $bash_cv_termcap_lib = libtinfo; then +TERMCAP_LIB=-ltinfo +TERMCAP_DEP= +elif test $bash_cv_termcap_lib = libncurses; then +TERMCAP_LIB=-lncurses +TERMCAP_DEP= +elif test $bash_cv_termcap_lib = libc; then +TERMCAP_LIB= +TERMCAP_DEP= +else +TERMCAP_LIB=-lcurses +TERMCAP_DEP= +fi + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking version of installed readline library" >&5 +$as_echo_n "checking version of installed readline library... " >&6; } + +# What a pain in the ass this is. + +# save cpp and ld options +_save_CFLAGS="$CFLAGS" +_save_LDFLAGS="$LDFLAGS" +_save_LIBS="$LIBS" + +# Don't set ac_cv_rl_prefix if the caller has already assigned a value. This +# allows the caller to do something like $_rl_prefix=$withval if the user +# specifies --with-installed-readline=PREFIX as an argument to configure + +if test -z "$ac_cv_rl_prefix"; then +test "x$prefix" = xNONE && ac_cv_rl_prefix=$ac_default_prefix || ac_cv_rl_prefix=${prefix} +fi + +eval ac_cv_rl_includedir=${ac_cv_rl_prefix}/include +eval ac_cv_rl_libdir=${ac_cv_rl_prefix}/lib + +LIBS="$LIBS -lreadline ${TERMCAP_LIB}" +CFLAGS="$CFLAGS -I${ac_cv_rl_includedir}" +LDFLAGS="$LDFLAGS -L${ac_cv_rl_libdir}" + +if ${ac_cv_rl_version+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_rl_version='4.2' +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +extern int rl_gnu_readline_p; + +main() +{ + FILE *fp; + fp = fopen("conftest.rlv", "w"); + if (fp == 0) + exit(1); + if (rl_gnu_readline_p != 1) + fprintf(fp, "0.0\n"); + else + fprintf(fp, "%s\n", rl_library_version ? rl_library_version : "0.0"); + fclose(fp); + exit(0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_rl_version=`cat conftest.rlv` +else + ac_cv_rl_version='0.0' +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + + +CFLAGS="$_save_CFLAGS" +LDFLAGS="$_save_LDFLAGS" +LIBS="$_save_LIBS" + +RL_MAJOR=0 +RL_MINOR=0 + +# ( +case "$ac_cv_rl_version" in +2*|3*|4*|5*|6*|7*|8*|9*) + RL_MAJOR=`echo $ac_cv_rl_version | sed 's:\..*$::'` + RL_MINOR=`echo $ac_cv_rl_version | sed -e 's:^.*\.::' -e 's:[a-zA-Z]*$::'` + ;; +esac + +# ((( +case $RL_MAJOR in +[0-9][0-9]) _RL_MAJOR=$RL_MAJOR ;; +[0-9]) _RL_MAJOR=0$RL_MAJOR ;; +*) _RL_MAJOR=00 ;; +esac + +# ((( +case $RL_MINOR in +[0-9][0-9]) _RL_MINOR=$RL_MINOR ;; +[0-9]) _RL_MINOR=0$RL_MINOR ;; +*) _RL_MINOR=00 ;; +esac + +RL_VERSION="0x${_RL_MAJOR}${_RL_MINOR}" + +# Readline versions greater than 4.2 have these defines in readline.h + +if test $ac_cv_rl_version = '0.0' ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not test version of installed readline library." >&5 +$as_echo "$as_me: WARNING: Could not test version of installed readline library." >&2;} +elif test $RL_MAJOR -gt 4 || { test $RL_MAJOR = 4 && test $RL_MINOR -gt 2 ; } ; then + # set these for use by the caller + RL_PREFIX=$ac_cv_rl_prefix + RL_LIBDIR=$ac_cv_rl_libdir + RL_INCLUDEDIR=$ac_cv_rl_includedir + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_rl_version" >&5 +$as_echo "$ac_cv_rl_version" >&6; } +else + + +cat >>confdefs.h <<_ACEOF +#define RL_READLINE_VERSION $RL_VERSION +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define RL_VERSION_MAJOR $RL_MAJOR +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define RL_VERSION_MINOR $RL_MINOR +_ACEOF + + + + + + +# set these for use by the caller +RL_PREFIX=$ac_cv_rl_prefix +RL_LIBDIR=$ac_cv_rl_libdir +RL_INCLUDEDIR=$ac_cv_rl_includedir + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_rl_version" >&5 +$as_echo "$ac_cv_rl_version" >&6; } + +fi + + + case "$ac_cv_rl_version" in + 5*|6*|7*|8*|9*) ;; + *) opt_with_installed_readline=no + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: installed readline library is too old to be linked with bash" >&5 +$as_echo "$as_me: WARNING: installed readline library is too old to be linked with bash" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using private bash version" >&5 +$as_echo "$as_me: WARNING: using private bash version" >&2;} + ;; + esac +fi + +TILDE_LIB=-ltilde +if test $opt_readline = yes; then + $as_echo "#define READLINE 1" >>confdefs.h + + if test "$opt_with_installed_readline" != "no" ; then + case "$opt_with_installed_readline" in + yes) RL_INCLUDE= ;; + *) case "$RL_INCLUDEDIR" in + /usr/include) ;; + *) RL_INCLUDE='-I${RL_INCLUDEDIR}' ;; + esac + ;; + esac + READLINE_DEP= + READLINE_LIB=-lreadline + # section for OS versions that don't allow unresolved symbols + # to be compiled into dynamic libraries. + case "$host_os" in + cygwin*) TILDE_LIB= ;; + esac + else + RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' + READLINE_DEP='$(READLINE_LIBRARY)' + # section for OS versions that ship an older/broken version of + # readline as a standard dynamic library and don't allow a + # static version specified as -llibname to override the + # dynamic version + case "${host_os}" in + darwin[89]*|darwin10*) READLINE_LIB='${READLINE_LIBRARY}' ;; + *) READLINE_LIB=-lreadline ;; + esac + fi +else + RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' + READLINE_LIB= READLINE_DEP= +fi +if test $opt_history = yes || test $opt_bang_history = yes; then + if test $opt_history = yes; then + $as_echo "#define HISTORY 1" >>confdefs.h + + fi + if test $opt_bang_history = yes; then + $as_echo "#define BANG_HISTORY 1" >>confdefs.h + + fi + if test "$opt_with_installed_readline" != "no"; then + HIST_LIBDIR=$RL_LIBDIR + HISTORY_DEP= + HISTORY_LIB=-lhistory + case "$opt_with_installed_readline" in + yes) RL_INCLUDE= ;; + *) case "$RL_INCLUDEDIR" in + /usr/include) ;; + *) RL_INCLUDE='-I${RL_INCLUDEDIR}' ;; + esac + ;; + esac + else + HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' + HISTORY_DEP='$(HISTORY_LIBRARY)' + # section for OS versions that ship an older version of + # readline as a standard dynamic library and don't allow a + # static version specified as -llibname to override the + # dynamic version + case "${host_os}" in + darwin[89]*|darwin10*) HISTORY_LIB='${HISTORY_LIBRARY}' ;; + *) HISTORY_LIB=-lhistory ;; + esac + fi +else + HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' + HISTORY_LIB= HISTORY_DEP= +fi + + + + + + + + + + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +test -n "$ARFLAGS" || ARFLAGS="cr" +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +for ac_prog in 'bison -y' byacc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_YACC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_YACC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +YACC=$ac_cv_prog_YACC +if test -n "$YACC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 +$as_echo "$YACC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$YACC" && break +done +test -n "$YACC" || YACC="yacc" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + +case "$ac_cv_prog_YACC" in +*bison*) ;; +*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: bison not available; needed to process parse.y" >&5 +$as_echo "$as_me: WARNING: bison not available; needed to process parse.y" >&2;} ;; +esac + +case "$host_os" in +opennt*|interix*) MAKE_SHELL="$INTERIX_ROOT/bin/sh" ;; +*) MAKE_SHELL=/bin/sh ;; +esac + + +if test x$SIZE = x; then + if test x$ac_tool_prefix = x; then + SIZE=size + else + SIZE=${ac_tool_prefix}size + save_IFS=$IFS ; IFS=: + size_found=0 + for dir in $PATH; do + if test -x $dir/$SIZE ; then + size_found=1 + break + fi + done + if test $size_found -eq 0; then + SIZE=: + fi + IFS=$save_IFS + fi +fi + + +# Checks for stat-related time functions. + +# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2012 Free Software +# Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# st_atim.tv_nsec - Linux, Solaris, Cygwin +# st_atimespec.tv_nsec - FreeBSD, NetBSD, if ! defined _POSIX_SOURCE +# st_atimensec - FreeBSD, NetBSD, if defined _POSIX_SOURCE +# st_atim.st__tim.tv_nsec - UnixWare (at least 2.1.2 through 7.1) + +# st_birthtimespec - FreeBSD, NetBSD (hidden on OpenBSD 3.9, anyway) +# st_birthtim - Cygwin 1.7.0+ + + + +# Configure checks for struct timespec + +# Copyright (C) 2000-2001, 2003-2007, 2009-2011, 2012 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Original written by Paul Eggert and Jim Meyering. +# Modified by Chet Ramey for bash + + + + + +$as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for preprocessor stringizing operator" >&5 +$as_echo_n "checking for preprocessor stringizing operator... " >&6; } +if ${ac_cv_c_stringize+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define x(y) #y + +char *s = x(teststring); +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "#teststring" >/dev/null 2>&1; then : + ac_cv_c_stringize=no +else + ac_cv_c_stringize=yes +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stringize" >&5 +$as_echo "$ac_cv_c_stringize" >&6; } +if test $ac_cv_c_stringize = yes; then + +$as_echo "#define HAVE_STRINGIZE 1" >>confdefs.h + +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double with more range or precision than double" >&5 +$as_echo_n "checking for long double with more range or precision than double... " >&6; } +if ${ac_cv_type_long_double_wider+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + long double const a[] = + { + 0.0L, DBL_MIN, DBL_MAX, DBL_EPSILON, + LDBL_MIN, LDBL_MAX, LDBL_EPSILON + }; + long double + f (long double x) + { + return ((x + (unsigned long int) 10) * (-1 / x) + a[0] + + (x ? f (x) : 'c')); + } + +int +main () +{ +static int test_array [1 - 2 * !((0 < ((DBL_MAX_EXP < LDBL_MAX_EXP) + + (DBL_MANT_DIG < LDBL_MANT_DIG) + - (LDBL_MAX_EXP < DBL_MAX_EXP) + - (LDBL_MANT_DIG < DBL_MANT_DIG))) + && (int) LDBL_EPSILON == 0 + )]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_long_double_wider=yes +else + ac_cv_type_long_double_wider=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double_wider" >&5 +$as_echo "$ac_cv_type_long_double_wider" >&6; } + if test $ac_cv_type_long_double_wider = yes; then + +$as_echo "#define HAVE_LONG_DOUBLE_WIDER 1" >>confdefs.h + + fi + + ac_cv_c_long_double=$ac_cv_type_long_double_wider + if test $ac_cv_c_long_double = yes; then + +$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h + + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for function prototypes" >&5 +$as_echo_n "checking for function prototypes... " >&6; } +if test "$ac_cv_prog_cc_c89" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define PROTOTYPES 1" >>confdefs.h + + +$as_echo "#define __PROTOTYPES 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 +$as_echo_n "checking whether char is unsigned... " >&6; } +if ${ac_cv_c_char_unsigned+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((char) -1) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_char_unsigned=no +else + ac_cv_c_char_unsigned=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 +$as_echo "$ac_cv_c_char_unsigned" >&6; } +if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then + $as_echo "#define __CHAR_UNSIGNED__ 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 +$as_echo_n "checking for working volatile... " >&6; } +if ${ac_cv_c_volatile+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +volatile int x; +int * volatile y = (int *) 0; +return !x && !y; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_volatile=yes +else + ac_cv_c_volatile=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 +$as_echo "$ac_cv_c_volatile" >&6; } +if test $ac_cv_c_volatile = no; then + +$as_echo "#define volatile /**/" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 +$as_echo_n "checking for C/C++ restrict keyword... " >&6; } +if ${ac_cv_c_restrict+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_restrict=no + # The order here caters to the fact that C++ does not require restrict. + for ac_kw in __restrict __restrict__ _Restrict restrict; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +typedef int * int_ptr; + int foo (int_ptr $ac_kw ip) { + return ip[0]; + } +int +main () +{ +int s[1]; + int * $ac_kw t = s; + t[0] = 0; + return foo(t) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_restrict=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_restrict" != no && break + done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 +$as_echo "$ac_cv_c_restrict" >&6; } + + case $ac_cv_c_restrict in + restrict) ;; + no) $as_echo "#define restrict /**/" >>confdefs.h + ;; + *) cat >>confdefs.h <<_ACEOF +#define restrict $ac_cv_c_restrict +_ACEOF + ;; + esac + + + + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + case "$ac_aux_dir" in + /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; + *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; + esac + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +$as_echo_n "checking whether NLS is requested... " >&6; } + # Check whether --enable-nls was given. +if test "${enable_nls+set}" = set; then : + enableval=$enable_nls; USE_NLS=$enableval +else + USE_NLS=yes +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +$as_echo "$USE_NLS" >&6; } + + + + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_MSGFMT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case "$MSGFMT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != ":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +$as_echo "$MSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GMSGFMT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +$as_echo "$GMSGFMT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_XGETTEXT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case "$XGETTEXT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +$as_echo "$XGETTEXT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + rm -f messages.po + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_MSGMERGE+:} false; then : + $as_echo_n "(cached) " >&6 +else + case "$MSGMERGE" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" + ;; +esac +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 +$as_echo "$MSGMERGE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "$GMSGFMT" != ":"; then + if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && + (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 +$as_echo "found $GMSGFMT program is not GNU msgfmt; ignore it" >&6; } + GMSGFMT=":" + fi + fi + + if test "$XGETTEXT" != ":"; then + if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found xgettext program is not GNU xgettext; ignore it" >&5 +$as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; } + XGETTEXT=":" + fi + rm -f messages.po + fi + + ac_config_commands="$ac_config_commands default-1" + + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +$as_echo_n "checking for working alloca.h... " >&6; } +if ${ac_cv_working_alloca_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_working_alloca_h=yes +else + ac_cv_working_alloca_h=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +$as_echo "$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then + +$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +$as_echo_n "checking for alloca... " >&6; } +if ${ac_cv_func_alloca_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# ifdef HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +void *alloca (size_t); +# endif +# endif +# endif +# endif +#endif + +int +main () +{ +char *p = (char *) alloca (1); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_func_alloca_works=yes +else + ac_cv_func_alloca_works=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +$as_echo "$ac_cv_func_alloca_works" >&6; } + +if test $ac_cv_func_alloca_works = yes; then + +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h + +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext + +$as_echo "#define C_ALLOCA 1" >>confdefs.h + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 +$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } +if ${ac_cv_os_cray+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined CRAY && ! defined CRAY2 +webecray +#else +wenotbecray +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "webecray" >/dev/null 2>&1; then : + ac_cv_os_cray=yes +else + ac_cv_os_cray=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 +$as_echo "$ac_cv_os_cray" >&6; } +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + +cat >>confdefs.h <<_ACEOF +#define CRAY_STACKSEG_END $ac_func +_ACEOF + + break +fi + + done +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +$as_echo_n "checking stack direction for C alloca... " >&6; } +if ${ac_cv_c_stack_direction+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_c_stack_direction=0 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +find_stack_direction (int *addr, int depth) +{ + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; +} + +int +main (int argc, char **argv) +{ + return find_stack_direction (0, argc + !argv + 20) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_stack_direction=1 +else + ac_cv_c_stack_direction=-1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +$as_echo "$ac_cv_c_stack_direction" >&6; } +cat >>confdefs.h <<_ACEOF +#define STACK_DIRECTION $ac_cv_c_stack_direction +_ACEOF + + +fi + + + + + for ac_header in $ac_header_list +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + +for ac_func in getpagesize +do : + ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" +if test "x$ac_cv_func_getpagesize" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETPAGESIZE 1 +_ACEOF + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 +$as_echo_n "checking for working mmap... " >&6; } +if ${ac_cv_func_mmap_fixed_mapped+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_mmap_fixed_mapped=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +/* malloc might have been renamed as rpl_malloc. */ +#undef malloc + +/* Thanks to Mike Haertel and Jim Avera for this test. + Here is a matrix of mmap possibilities: + mmap private not fixed + mmap private fixed at somewhere currently unmapped + mmap private fixed at somewhere already mapped + mmap shared not fixed + mmap shared fixed at somewhere currently unmapped + mmap shared fixed at somewhere already mapped + For private mappings, we should verify that changes cannot be read() + back from the file, nor mmap's back from the file at a different + address. (There have been systems where private was not correctly + implemented like the infamous i386 svr4.0, and systems where the + VM page cache was not coherent with the file system buffer cache + like early versions of FreeBSD and possibly contemporary NetBSD.) + For shared mappings, we should conversely verify that changes get + propagated back to all the places they're supposed to be. + + Grep wants private fixed already mapped. + The main things grep needs to know about mmap are: + * does it exist and is it safe to write into the mmap'd area + * how to use it (BSD variants) */ + +#include +#include + +#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H +char *malloc (); +#endif + +/* This mess was copied from the GNU getpagesize.h. */ +#ifndef HAVE_GETPAGESIZE +# ifdef _SC_PAGESIZE +# define getpagesize() sysconf(_SC_PAGESIZE) +# else /* no _SC_PAGESIZE */ +# ifdef HAVE_SYS_PARAM_H +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else /* no EXEC_PAGESIZE */ +# ifdef NBPG +# define getpagesize() NBPG * CLSIZE +# ifndef CLSIZE +# define CLSIZE 1 +# endif /* no CLSIZE */ +# else /* no NBPG */ +# ifdef NBPC +# define getpagesize() NBPC +# else /* no NBPC */ +# ifdef PAGESIZE +# define getpagesize() PAGESIZE +# endif /* PAGESIZE */ +# endif /* no NBPC */ +# endif /* no NBPG */ +# endif /* no EXEC_PAGESIZE */ +# else /* no HAVE_SYS_PARAM_H */ +# define getpagesize() 8192 /* punt totally */ +# endif /* no HAVE_SYS_PARAM_H */ +# endif /* no _SC_PAGESIZE */ + +#endif /* no HAVE_GETPAGESIZE */ + +int +main () +{ + char *data, *data2, *data3; + const char *cdata2; + int i, pagesize; + int fd, fd2; + + pagesize = getpagesize (); + + /* First, make a file with some known garbage in it. */ + data = (char *) malloc (pagesize); + if (!data) + return 1; + for (i = 0; i < pagesize; ++i) + *(data + i) = rand (); + umask (0); + fd = creat ("conftest.mmap", 0600); + if (fd < 0) + return 2; + if (write (fd, data, pagesize) != pagesize) + return 3; + close (fd); + + /* Next, check that the tail of a page is zero-filled. File must have + non-zero length, otherwise we risk SIGBUS for entire page. */ + fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); + if (fd2 < 0) + return 4; + cdata2 = ""; + if (write (fd2, cdata2, 1) != 1) + return 5; + data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); + if (data2 == MAP_FAILED) + return 6; + for (i = 0; i < pagesize; ++i) + if (*(data2 + i)) + return 7; + close (fd2); + if (munmap (data2, pagesize)) + return 8; + + /* Next, try to mmap the file at a fixed address which already has + something else allocated at it. If we can, also make sure that + we see the same garbage. */ + fd = open ("conftest.mmap", O_RDWR); + if (fd < 0) + return 9; + if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + return 10; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + return 11; + + /* Finally, make sure that changes to the mapped area do not + percolate back to the file as seen by read(). (This is a bug on + some variants of i386 svr4.0.) */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = (char *) malloc (pagesize); + if (!data3) + return 12; + if (read (fd, data3, pagesize) != pagesize) + return 13; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + return 14; + close (fd); + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_mmap_fixed_mapped=yes +else + ac_cv_func_mmap_fixed_mapped=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 +$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } +if test $ac_cv_func_mmap_fixed_mapped = yes; then + +$as_echo "#define HAVE_MMAP 1" >>confdefs.h + +fi +rm -f conftest.mmap conftest.txt + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library 2.1 or newer" >&5 +$as_echo_n "checking whether we are using the GNU C Library 2.1 or newer... " >&6; } +if ${ac_cv_gnu_library_2_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Lucky GNU user" >/dev/null 2>&1; then : + ac_cv_gnu_library_2_1=yes +else + ac_cv_gnu_library_2_1=no +fi +rm -f conftest* + + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5 +$as_echo "$ac_cv_gnu_library_2_1" >&6; } + + GLIBC21="$ac_cv_gnu_library_2_1" + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether integer division by zero raises SIGFPE" >&5 +$as_echo_n "checking whether integer division by zero raises SIGFPE... " >&6; } +if ${gt_cv_int_divbyzero_sigfpe+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + # Guess based on the CPU. + case "$host_cpu" in + alpha* | i3456786 | m68k | s390*) + gt_cv_int_divbyzero_sigfpe="guessing yes";; + *) + gt_cv_int_divbyzero_sigfpe="guessing no";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +static void +#ifdef __cplusplus +sigfpe_handler (int sig) +#else +sigfpe_handler (sig) int sig; +#endif +{ + /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ + exit (sig != SIGFPE); +} + +int x = 1; +int y = 0; +int z; +int nan; + +int main () +{ + signal (SIGFPE, sigfpe_handler); +/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ +#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) + signal (SIGTRAP, sigfpe_handler); +#endif +/* Linux/SPARC yields signal SIGILL. */ +#if defined (__sparc__) && defined (__linux__) + signal (SIGILL, sigfpe_handler); +#endif + + z = x / y; + nan = y / y; + exit (1); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gt_cv_int_divbyzero_sigfpe=yes +else + gt_cv_int_divbyzero_sigfpe=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_int_divbyzero_sigfpe" >&5 +$as_echo "$gt_cv_int_divbyzero_sigfpe" >&6; } + case "$gt_cv_int_divbyzero_sigfpe" in + *yes) value=1;; + *) value=0;; + esac + +cat >>confdefs.h <<_ACEOF +#define INTDIV0_RAISES_SIGFPE $value +_ACEOF + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5 +$as_echo_n "checking for inttypes.h... " >&6; } +if ${jm_ac_cv_header_inttypes_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +uintmax_t i = (uintmax_t) -1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + jm_ac_cv_header_inttypes_h=yes +else + jm_ac_cv_header_inttypes_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $jm_ac_cv_header_inttypes_h" >&5 +$as_echo "$jm_ac_cv_header_inttypes_h" >&6; } + if test $jm_ac_cv_header_inttypes_h = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_INTTYPES_H_WITH_UINTMAX 1 +_ACEOF + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5 +$as_echo_n "checking for stdint.h... " >&6; } +if ${jm_ac_cv_header_stdint_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +uintmax_t i = (uintmax_t) -1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + jm_ac_cv_header_stdint_h=yes +else + jm_ac_cv_header_stdint_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $jm_ac_cv_header_stdint_h" >&5 +$as_echo "$jm_ac_cv_header_stdint_h" >&6; } + if test $jm_ac_cv_header_stdint_h = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STDINT_H_WITH_UINTMAX 1 +_ACEOF + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long" >&5 +$as_echo_n "checking for unsigned long long... " >&6; } +if ${ac_cv_type_unsigned_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +unsigned long long ull = 1; int i = 63; +int +main () +{ +unsigned long long ullmax = (unsigned long long) -1; + return ull << i | ull >> i | ullmax / ull | ullmax % ull; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_type_unsigned_long_long=yes +else + ac_cv_type_unsigned_long_long=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long" >&5 +$as_echo "$ac_cv_type_unsigned_long_long" >&6; } + if test $ac_cv_type_unsigned_long_long = yes; then + +$as_echo "#define HAVE_UNSIGNED_LONG_LONG 1" >>confdefs.h + + fi + + + + + if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then + + test $ac_cv_type_unsigned_long_long = yes \ + && ac_type='unsigned long long' \ + || ac_type='unsigned long' + +cat >>confdefs.h <<_ACEOF +#define uintmax_t $ac_type +_ACEOF + + else + +$as_echo "#define HAVE_UINTMAX_T 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5 +$as_echo_n "checking for inttypes.h... " >&6; } +if ${gt_cv_header_inttypes_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_header_inttypes_h=yes +else + gt_cv_header_inttypes_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_header_inttypes_h" >&5 +$as_echo "$gt_cv_header_inttypes_h" >&6; } + if test $gt_cv_header_inttypes_h = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_INTTYPES_H 1 +_ACEOF + + fi + + + + if test $gt_cv_header_inttypes_h = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5 +$as_echo_n "checking whether the inttypes.h PRIxNN macros are broken... " >&6; } +if ${gt_cv_inttypes_pri_broken+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#ifdef PRId32 +char *p = PRId32; +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_inttypes_pri_broken=no +else + gt_cv_inttypes_pri_broken=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5 +$as_echo "$gt_cv_inttypes_pri_broken" >&6; } + fi + if test "$gt_cv_inttypes_pri_broken" = yes; then + +cat >>confdefs.h <<_ACEOF +#define PRI_MACROS_BROKEN 1 +_ACEOF + + fi + + + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 +$as_echo_n "checking for ld used by GCC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${acl_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$acl_cv_path_LD" +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${acl_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 &5; then + acl_cv_prog_gnu_ld=yes +else + acl_cv_prog_gnu_ld=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5 +$as_echo "$acl_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 +$as_echo_n "checking for shared library run path origin... " >&6; } +if ${acl_cv_rpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 +$as_echo "$acl_cv_rpath" >&6; } + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath was given. +if test "${enable_rpath+set}" = set; then : + enableval=$enable_rpath; : +else + enable_rpath=yes +fi + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libiconv-prefix was given. +if test "${with_libiconv_prefix+set}" = set; then : + withval=$with_libiconv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + +fi + + LIBICONV= + LTLIBICONV= + INCICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test "X$prefer_shared" = "Xyes" && test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test "X$prefer_shared" = "Xyes" && test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done + fi + + + + + for ac_header in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ +stdlib.h string.h unistd.h sys/param.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + for ac_func in feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \ +geteuid getgid getuid mempcpy munmap putenv setenv setlocale localeconv stpcpy \ +strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next \ +__fsetlocking +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +$as_echo_n "checking for iconv... " >&6; } +if ${am_cv_func_iconv+:} false; then : + $as_echo_n "(cached) " >&6 +else + + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +$as_echo "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + +$as_echo "#define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +$as_echo_n "checking how to link with libiconv... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +$as_echo "$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + if test "$am_cv_func_iconv" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 +$as_echo_n "checking for iconv declaration... " >&6; } + if ${am_cv_proto_iconv+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + am_cv_proto_iconv_arg1="" +else + am_cv_proto_iconv_arg1="const" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" +fi + + am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_t:- + }$am_cv_proto_iconv" >&5 +$as_echo "${ac_t:- + }$am_cv_proto_iconv" >&6; } + +cat >>confdefs.h <<_ACEOF +#define ICONV_CONST $am_cv_proto_iconv_arg1 +_ACEOF + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 +$as_echo_n "checking for nl_langinfo and CODESET... " >&6; } +if ${am_cv_langinfo_codeset+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +char* cs = nl_langinfo(CODESET); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + am_cv_langinfo_codeset=yes +else + am_cv_langinfo_codeset=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 +$as_echo "$am_cv_langinfo_codeset" >&6; } + if test $am_cv_langinfo_codeset = yes; then + +$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h + + fi + + if test $ac_cv_header_locale_h = yes; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5 +$as_echo_n "checking for LC_MESSAGES... " >&6; } +if ${am_cv_val_LC_MESSAGES+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +return LC_MESSAGES + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + am_cv_val_LC_MESSAGES=yes +else + am_cv_val_LC_MESSAGES=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_val_LC_MESSAGES" >&5 +$as_echo "$am_cv_val_LC_MESSAGES" >&6; } + if test $am_cv_val_LC_MESSAGES = yes; then + +$as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h + + fi + + fi + + for ac_prog in bison +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_INTLBISON+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$INTLBISON"; then + ac_cv_prog_INTLBISON="$INTLBISON" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_INTLBISON="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +INTLBISON=$ac_cv_prog_INTLBISON +if test -n "$INTLBISON"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLBISON" >&5 +$as_echo "$INTLBISON" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$INTLBISON" && break +done + + if test -z "$INTLBISON"; then + ac_verc_fail=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of bison" >&5 +$as_echo_n "checking version of bison... " >&6; } + ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5 +$as_echo "$ac_prog_version" >&6; } + fi + if test $ac_verc_fail = yes; then + INTLBISON=: + fi + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +$as_echo_n "checking whether NLS is requested... " >&6; } + # Check whether --enable-nls was given. +if test "${enable_nls+set}" = set; then : + enableval=$enable_nls; USE_NLS=$enableval +else + USE_NLS=yes +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +$as_echo "$USE_NLS" >&6; } + + + + + BUILD_INCLUDED_LIBINTL=no + USE_INCLUDED_LIBINTL=no + + LIBINTL= + LTLIBINTL= + POSUB= + + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether included gettext is requested" >&5 +$as_echo_n "checking whether included gettext is requested... " >&6; } + +# Check whether --with-included-gettext was given. +if test "${with_included_gettext+set}" = set; then : + withval=$with_included_gettext; nls_cv_force_use_gnu_gettext=$withval +else + nls_cv_force_use_gnu_gettext=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $nls_cv_force_use_gnu_gettext" >&5 +$as_echo "$nls_cv_force_use_gnu_gettext" >&6; } + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 +$as_echo_n "checking for GNU gettext in libc... " >&6; } +if ${gt_cv_func_gnugettext2_libc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings; +int +main () +{ +bindtextdomain ("", ""); +return (int) gettext ("") + (int) ngettext ("", "", 0) + _nl_msg_cat_cntr + *_nl_domain_bindings + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_gnugettext2_libc=yes +else + gt_cv_func_gnugettext2_libc=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_gnugettext2_libc" >&5 +$as_echo "$gt_cv_func_gnugettext2_libc" >&6; } + + if test "$gt_cv_func_gnugettext2_libc" != "yes"; then + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libintl-prefix was given. +if test "${with_libintl_prefix+set}" = set; then : + withval=$with_libintl_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + +fi + + LIBINTL= + LTLIBINTL= + INCINTL= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='intl ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test "X$prefer_shared" = "Xyes" && test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test "X$prefer_shared" = "Xyes" && test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" + ;; + esac + done + fi + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" + done + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 +$as_echo_n "checking for GNU gettext in libintl... " >&6; } +if ${gt_cv_func_gnugettext2_libintl+:} false; then : + $as_echo_n "(cached) " >&6 +else + gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (); +int +main () +{ +bindtextdomain ("", ""); +return (int) gettext ("") + (int) ngettext ("", "", 0) + _nl_msg_cat_cntr + *_nl_expand_alias (0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_gnugettext2_libintl=yes +else + gt_cv_func_gnugettext2_libintl=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$gt_cv_func_gnugettext2_libintl" != yes && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (); +int +main () +{ +bindtextdomain ("", ""); +return (int) gettext ("") + (int) ngettext ("", "", 0) + _nl_msg_cat_cntr + *_nl_expand_alias (0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + gt_cv_func_gnugettext2_libintl=yes + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_gnugettext2_libintl" >&5 +$as_echo "$gt_cv_func_gnugettext2_libintl" >&6; } + fi + + if test "$gt_cv_func_gnugettext2_libc" = "yes" \ + || { test "$gt_cv_func_gnugettext2_libintl" = "yes" \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + + if test "$gt_use_preinstalled_gnugettext" != "yes"; then + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + BUILD_INCLUDED_LIBINTL=yes + USE_INCLUDED_LIBINTL=yes + LIBINTL="lib/intl/libintl.a $LIBICONV" + LTLIBINTL="lib/intl/libintl.a $LTLIBICONV" + LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + CATOBJEXT=.gmo + fi + + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + +$as_echo "#define ENABLE_NLS 1" >>confdefs.h + + else + USE_NLS=no + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 +$as_echo_n "checking whether to use NLS... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +$as_echo "$USE_NLS" >&6; } + if test "$USE_NLS" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 +$as_echo_n "checking where the gettext function comes from... " >&6; } + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext2_libintl" = "yes"; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 +$as_echo "$gt_source" >&6; } + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext2_libintl" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 +$as_echo_n "checking how to link with libintl... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 +$as_echo "$LIBINTL" >&6; } + + for element in $INCINTL; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + fi + + +$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h + + +$as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h + + fi + + POSUB=po + fi + + + if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then + BUILD_INCLUDED_LIBINTL=yes + fi + + + + + + nls_cv_header_intl= + nls_cv_header_libgt= + + DATADIRNAME=share + + + INSTOBJEXT=.mo + + + GENCAT=gencat + + + if test "$USE_INCLUDED_LIBINTL" = yes; then + INTLOBJS="\$(GETTOBJS)" + fi + + + INTL_LIBTOOL_SUFFIX_PREFIX= + + + + INTLLIBS="$LIBINTL" + + + + + + + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } +if eval \${$as_ac_Header+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_ac_Header=yes" +else + eval "$as_ac_Header=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_ac_Header + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if ${ac_cv_header_time+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_time=yes +else + ac_cv_header_time=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h + +fi + + + + for ac_header in inttypes.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_inttypes_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_INTTYPES_H 1 +_ACEOF + +fi + +done + + + +for ac_header in unistd.h stdlib.h stdarg.h varargs.h limits.h string.h \ + memory.h locale.h termcap.h termio.h termios.h dlfcn.h \ + stdbool.h stddef.h stdint.h netdb.h pwd.h grp.h strings.h \ + regex.h syslog.h ulimit.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +for ac_header in sys/pte.h sys/stream.h sys/select.h sys/file.h \ + sys/resource.h sys/param.h sys/socket.h sys/stat.h \ + sys/time.h sys/times.h sys/types.h sys/wait.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +for ac_header in netinet/in.h arpa/inet.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +ac_fn_c_check_header_compile "$LINENO" "sys/ptem.h" "ac_cv_header_sys_ptem_h" " +#if HAVE_SYS_STREAM_H +# include +#endif + +" +if test "x$ac_cv_header_sys_ptem_h" = xyes; then : + +fi + + + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +$as_echo_n "checking for working alloca.h... " >&6; } +if ${ac_cv_working_alloca_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_working_alloca_h=yes +else + ac_cv_working_alloca_h=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +$as_echo "$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then + +$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +$as_echo_n "checking for alloca... " >&6; } +if ${ac_cv_func_alloca_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# ifdef HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +void *alloca (size_t); +# endif +# endif +# endif +# endif +#endif + +int +main () +{ +char *p = (char *) alloca (1); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_func_alloca_works=yes +else + ac_cv_func_alloca_works=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +$as_echo "$ac_cv_func_alloca_works" >&6; } + +if test $ac_cv_func_alloca_works = yes; then + +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h + +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext + +$as_echo "#define C_ALLOCA 1" >>confdefs.h + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 +$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } +if ${ac_cv_os_cray+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined CRAY && ! defined CRAY2 +webecray +#else +wenotbecray +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "webecray" >/dev/null 2>&1; then : + ac_cv_os_cray=yes +else + ac_cv_os_cray=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 +$as_echo "$ac_cv_os_cray" >&6; } +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + +cat >>confdefs.h <<_ACEOF +#define CRAY_STACKSEG_END $ac_func +_ACEOF + + break +fi + + done +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +$as_echo_n "checking stack direction for C alloca... " >&6; } +if ${ac_cv_c_stack_direction+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_c_stack_direction=0 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +find_stack_direction (int *addr, int depth) +{ + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; +} + +int +main (int argc, char **argv) +{ + return find_stack_direction (0, argc + !argv + 20) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_stack_direction=1 +else + ac_cv_c_stack_direction=-1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +$as_echo "$ac_cv_c_stack_direction" >&6; } +cat >>confdefs.h <<_ACEOF +#define STACK_DIRECTION $ac_cv_c_stack_direction +_ACEOF + + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getpgrp requires zero arguments" >&5 +$as_echo_n "checking whether getpgrp requires zero arguments... " >&6; } +if ${ac_cv_func_getpgrp_void+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Use it with a single arg. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +getpgrp (0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_func_getpgrp_void=no +else + ac_cv_func_getpgrp_void=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_getpgrp_void" >&5 +$as_echo "$ac_cv_func_getpgrp_void" >&6; } +if test $ac_cv_func_getpgrp_void = yes; then + +$as_echo "#define GETPGRP_VOID 1" >>confdefs.h + +fi + +if ${ac_cv_func_setvbuf_reversed+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_func_setvbuf_reversed=no +fi + + +for ac_func in vprintf +do : + ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" +if test "x$ac_cv_func_vprintf" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VPRINTF 1 +_ACEOF + +ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" +if test "x$ac_cv_func__doprnt" = xyes; then : + +$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h + +fi + +fi +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strcoll" >&5 +$as_echo_n "checking for working strcoll... " >&6; } +if ${ac_cv_func_strcoll_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_strcoll_works=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +return (strcoll ("abc", "def") >= 0 || + strcoll ("ABC", "DEF") >= 0 || + strcoll ("123", "456") >= 0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_strcoll_works=yes +else + ac_cv_func_strcoll_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strcoll_works" >&5 +$as_echo "$ac_cv_func_strcoll_works" >&6; } +if test $ac_cv_func_strcoll_works = yes; then + +$as_echo "#define HAVE_STRCOLL 1" >>confdefs.h + +fi + + + +if test "$ac_cv_func_alloca_works" = "no" && test "$opt_bash_malloc" = "no"; then + MALLOC_TARGET=alloca + MALLOC_SRC=alloca.c + + MALLOC_LIB='-lmalloc' + MALLOC_LIBRARY='$(ALLOC_LIBDIR)/libmalloc.a' + MALLOC_LDFLAGS='-L$(ALLOC_LIBDIR)' + MALLOC_DEP='$(MALLOC_LIBRARY)' +fi + +if test "$ac_cv_func_vprintf" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for declaration of vprintf in stdio.h" >&5 +$as_echo_n "checking for declaration of vprintf in stdio.h... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "[int[ ]*vprintf[^a-zA-Z0-9]]" >/dev/null 2>&1; then : + ac_cv_func_vprintf=yes +fi +rm -f conftest* + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vprintf" >&5 +$as_echo "$ac_cv_func_vprintf" >&6; } + if test $ac_cv_func_vprintf = yes; then + $as_echo "#define HAVE_VPRINTF 1" >>confdefs.h + + fi +fi + +if test "$ac_cv_func_vprintf" = no && test "$ac_cv_func__doprnt" = "yes"; then + case " $LIBOBJS " in + *" vprint.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS vprint.$ac_objext" + ;; +esac + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 +$as_echo_n "checking return type of signal handlers... " >&6; } +if ${ac_cv_type_signal+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main () +{ +return *(signal (0, 0)) (0) == 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_signal=int +else + ac_cv_type_signal=void +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 +$as_echo "$ac_cv_type_signal" >&6; } + +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + + +ac_fn_c_check_func "$LINENO" "__setostype" "ac_cv_func___setostype" +if test "x$ac_cv_func___setostype" = xyes; then : + $as_echo "#define HAVE_SETOSTYPE 1" >>confdefs.h + +fi + +ac_fn_c_check_func "$LINENO" "wait3" "ac_cv_func_wait3" +if test "x$ac_cv_func_wait3" = xyes; then : + $as_echo "#define HAVE_WAIT3 1" >>confdefs.h + +fi + + +ac_fn_c_check_func "$LINENO" "mkfifo" "ac_cv_func_mkfifo" +if test "x$ac_cv_func_mkfifo" = xyes; then : + $as_echo "#define HAVE_MKFIFO 1" >>confdefs.h + +else + $as_echo "#define MKFIFO_MISSING 1" >>confdefs.h + +fi + + +for ac_func in dup2 eaccess fcntl getdtablesize getgroups gethostname \ + getpagesize getpeername getrlimit getrusage gettimeofday \ + kill killpg lstat readlink sbrk select setdtablesize \ + setitimer tcgetpgrp uname ulimit waitpid +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +ac_fn_c_check_func "$LINENO" "rename" "ac_cv_func_rename" +if test "x$ac_cv_func_rename" = xyes; then : + $as_echo "#define HAVE_RENAME 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" rename.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS rename.$ac_objext" + ;; +esac + +fi + + + +for ac_func in bcopy bzero confstr faccessat fnmatch \ + getaddrinfo gethostbyname getservbyname getservent inet_aton \ + imaxdiv memmove pathconf putenv raise regcomp regexec \ + setenv setlinebuf setlocale setvbuf siginterrupt strchr \ + sysconf syslog tcgetattr times ttyname tzset unsetenv +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in vasprintf asprintf +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in isascii isblank isgraph isprint isspace isxdigit +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in getpwent getpwnam getpwuid +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd" +if test "x$ac_cv_func_getcwd" = xyes; then : + $as_echo "#define HAVE_GETCWD 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" getcwd.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS getcwd.$ac_objext" + ;; +esac + +fi + +ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" +if test "x$ac_cv_func_memset" = xyes; then : + $as_echo "#define HAVE_MEMSET 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" memset.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS memset.$ac_objext" + ;; +esac + +fi + + +ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" +if test "x$ac_cv_func_strcasecmp" = xyes; then : + $as_echo "#define HAVE_STRCASECMP 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strcasecmp.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strcasecmp.$ac_objext" + ;; +esac + +fi + +ac_fn_c_check_func "$LINENO" "strcasestr" "ac_cv_func_strcasestr" +if test "x$ac_cv_func_strcasestr" = xyes; then : + $as_echo "#define HAVE_STRCASESTR 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strcasestr.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strcasestr.$ac_objext" + ;; +esac + +fi + +ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" +if test "x$ac_cv_func_strerror" = xyes; then : + $as_echo "#define HAVE_STRERROR 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strerror.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strerror.$ac_objext" + ;; +esac + +fi + +ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" +if test "x$ac_cv_func_strftime" = xyes; then : + $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strftime.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strftime.$ac_objext" + ;; +esac + +fi + +ac_fn_c_check_func "$LINENO" "strnlen" "ac_cv_func_strnlen" +if test "x$ac_cv_func_strnlen" = xyes; then : + $as_echo "#define HAVE_STRNLEN 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strnlen.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strnlen.$ac_objext" + ;; +esac + +fi + +ac_fn_c_check_func "$LINENO" "strpbrk" "ac_cv_func_strpbrk" +if test "x$ac_cv_func_strpbrk" = xyes; then : + $as_echo "#define HAVE_STRPBRK 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strpbrk.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strpbrk.$ac_objext" + ;; +esac + +fi + +ac_fn_c_check_func "$LINENO" "strstr" "ac_cv_func_strstr" +if test "x$ac_cv_func_strstr" = xyes; then : + $as_echo "#define HAVE_STRSTR 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strstr.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strstr.$ac_objext" + ;; +esac + +fi + + +ac_fn_c_check_func "$LINENO" "strtod" "ac_cv_func_strtod" +if test "x$ac_cv_func_strtod" = xyes; then : + $as_echo "#define HAVE_STRTOD 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strtod.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtod.$ac_objext" + ;; +esac + +fi + +ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol" +if test "x$ac_cv_func_strtol" = xyes; then : + $as_echo "#define HAVE_STRTOL 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strtol.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtol.$ac_objext" + ;; +esac + +fi + +ac_fn_c_check_func "$LINENO" "strtoul" "ac_cv_func_strtoul" +if test "x$ac_cv_func_strtoul" = xyes; then : + $as_echo "#define HAVE_STRTOUL 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strtoul.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtoul.$ac_objext" + ;; +esac + +fi + +ac_fn_c_check_func "$LINENO" "strtoll" "ac_cv_func_strtoll" +if test "x$ac_cv_func_strtoll" = xyes; then : + $as_echo "#define HAVE_STRTOLL 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strtoll.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtoll.$ac_objext" + ;; +esac + +fi + +ac_fn_c_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull" +if test "x$ac_cv_func_strtoull" = xyes; then : + $as_echo "#define HAVE_STRTOULL 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strtoull.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtoull.$ac_objext" + ;; +esac + +fi + +ac_fn_c_check_func "$LINENO" "strtoimax" "ac_cv_func_strtoimax" +if test "x$ac_cv_func_strtoimax" = xyes; then : + $as_echo "#define HAVE_STRTOIMAX 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strtoimax.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtoimax.$ac_objext" + ;; +esac + +fi + +ac_fn_c_check_func "$LINENO" "strtoumax" "ac_cv_func_strtoumax" +if test "x$ac_cv_func_strtoumax" = xyes; then : + $as_echo "#define HAVE_STRTOUMAX 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strtoumax.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtoumax.$ac_objext" + ;; +esac + +fi + + +ac_fn_c_check_func "$LINENO" "dprintf" "ac_cv_func_dprintf" +if test "x$ac_cv_func_dprintf" = xyes; then : + $as_echo "#define HAVE_DPRINTF 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" dprintf.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS dprintf.$ac_objext" + ;; +esac + +fi + + +ac_fn_c_check_func "$LINENO" "strchrnul" "ac_cv_func_strchrnul" +if test "x$ac_cv_func_strchrnul" = xyes; then : + $as_echo "#define HAVE_STRCHRNUL 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strchrnul.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strchrnul.$ac_objext" + ;; +esac + +fi + + +ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" +if test "x$ac_cv_func_strdup" = xyes; then : + $as_echo "#define HAVE_STRDUP 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strdup.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strdup.$ac_objext" + ;; +esac + +fi + + + +ac_fn_c_check_decl "$LINENO" "AUDIT_USER_TTY" "ac_cv_have_decl_AUDIT_USER_TTY" "#include +" +if test "x$ac_cv_have_decl_AUDIT_USER_TTY" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_AUDIT_USER_TTY $ac_have_decl +_ACEOF + + +ac_fn_c_check_decl "$LINENO" "confstr" "ac_cv_have_decl_confstr" "$ac_includes_default" +if test "x$ac_cv_have_decl_confstr" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CONFSTR $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "printf" "ac_cv_have_decl_printf" "$ac_includes_default" +if test "x$ac_cv_have_decl_printf" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PRINTF $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "sbrk" "ac_cv_have_decl_sbrk" "$ac_includes_default" +if test "x$ac_cv_have_decl_sbrk" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SBRK $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "setregid" "ac_cv_have_decl_setregid" "$ac_includes_default" +if test "x$ac_cv_have_decl_setregid" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SETREGID $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "strcpy" "ac_cv_have_decl_strcpy" "$ac_includes_default" +if test "x$ac_cv_have_decl_strcpy" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRCPY $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "strsignal" "ac_cv_have_decl_strsignal" "$ac_includes_default" +if test "x$ac_cv_have_decl_strsignal" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRSIGNAL $ac_have_decl +_ACEOF + + +ac_fn_c_check_decl "$LINENO" "strtold" "ac_cv_have_decl_strtold" "$ac_includes_default" +if test "x$ac_cv_have_decl_strtold" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRTOLD $ac_have_decl +_ACEOF +if test $ac_have_decl = 1; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken strtold" >&5 +$as_echo_n "checking for broken strtold... " >&6; } + if ${bash_cv_strtold_broken+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int main() { long double r; char *foo, bar; r = strtold(foo, &bar);} + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bash_cv_strtold_broken=no +else + bash_cv_strtold_broken=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_strtold_broken" >&5 +$as_echo "$bash_cv_strtold_broken" >&6; } + if test "$bash_cv_strtold_broken" = "yes" ; then + $as_echo "#define STRTOLD_BROKEN 1" >>confdefs.h + + fi + +fi + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for declaration of strtoimax" >&5 +$as_echo_n "checking for declaration of strtoimax... " >&6; } +if ${bash_cv_decl_strtoimax+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if STDC_HEADERS +# include +#endif +#if HAVE_INTTYPES_H +# include +#endif + +int +main () +{ +return !strtoimax; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + bash_cv_decl_strtoimax=yes +else + bash_cv_decl_strtoimax=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_decl_strtoimax" >&5 +$as_echo "$bash_cv_decl_strtoimax" >&6; } +bash_tr_func=HAVE_DECL_`echo strtoimax | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +if test $bash_cv_decl_strtoimax = yes; then + cat >>confdefs.h <<_ACEOF +#define $bash_tr_func 1 +_ACEOF + +else + cat >>confdefs.h <<_ACEOF +#define $bash_tr_func 0 +_ACEOF + +fi + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for declaration of strtol" >&5 +$as_echo_n "checking for declaration of strtol... " >&6; } +if ${bash_cv_decl_strtol+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if STDC_HEADERS +# include +#endif +#if HAVE_INTTYPES_H +# include +#endif + +int +main () +{ +return !strtol; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + bash_cv_decl_strtol=yes +else + bash_cv_decl_strtol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_decl_strtol" >&5 +$as_echo "$bash_cv_decl_strtol" >&6; } +bash_tr_func=HAVE_DECL_`echo strtol | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +if test $bash_cv_decl_strtol = yes; then + cat >>confdefs.h <<_ACEOF +#define $bash_tr_func 1 +_ACEOF + +else + cat >>confdefs.h <<_ACEOF +#define $bash_tr_func 0 +_ACEOF + +fi + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for declaration of strtoll" >&5 +$as_echo_n "checking for declaration of strtoll... " >&6; } +if ${bash_cv_decl_strtoll+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if STDC_HEADERS +# include +#endif +#if HAVE_INTTYPES_H +# include +#endif + +int +main () +{ +return !strtoll; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + bash_cv_decl_strtoll=yes +else + bash_cv_decl_strtoll=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_decl_strtoll" >&5 +$as_echo "$bash_cv_decl_strtoll" >&6; } +bash_tr_func=HAVE_DECL_`echo strtoll | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +if test $bash_cv_decl_strtoll = yes; then + cat >>confdefs.h <<_ACEOF +#define $bash_tr_func 1 +_ACEOF + +else + cat >>confdefs.h <<_ACEOF +#define $bash_tr_func 0 +_ACEOF + +fi + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for declaration of strtoul" >&5 +$as_echo_n "checking for declaration of strtoul... " >&6; } +if ${bash_cv_decl_strtoul+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if STDC_HEADERS +# include +#endif +#if HAVE_INTTYPES_H +# include +#endif + +int +main () +{ +return !strtoul; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + bash_cv_decl_strtoul=yes +else + bash_cv_decl_strtoul=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_decl_strtoul" >&5 +$as_echo "$bash_cv_decl_strtoul" >&6; } +bash_tr_func=HAVE_DECL_`echo strtoul | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +if test $bash_cv_decl_strtoul = yes; then + cat >>confdefs.h <<_ACEOF +#define $bash_tr_func 1 +_ACEOF + +else + cat >>confdefs.h <<_ACEOF +#define $bash_tr_func 0 +_ACEOF + +fi + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for declaration of strtoull" >&5 +$as_echo_n "checking for declaration of strtoull... " >&6; } +if ${bash_cv_decl_strtoull+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if STDC_HEADERS +# include +#endif +#if HAVE_INTTYPES_H +# include +#endif + +int +main () +{ +return !strtoull; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + bash_cv_decl_strtoull=yes +else + bash_cv_decl_strtoull=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_decl_strtoull" >&5 +$as_echo "$bash_cv_decl_strtoull" >&6; } +bash_tr_func=HAVE_DECL_`echo strtoull | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +if test $bash_cv_decl_strtoull = yes; then + cat >>confdefs.h <<_ACEOF +#define $bash_tr_func 1 +_ACEOF + +else + cat >>confdefs.h <<_ACEOF +#define $bash_tr_func 0 +_ACEOF + +fi + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for declaration of strtoumax" >&5 +$as_echo_n "checking for declaration of strtoumax... " >&6; } +if ${bash_cv_decl_strtoumax+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if STDC_HEADERS +# include +#endif +#if HAVE_INTTYPES_H +# include +#endif + +int +main () +{ +return !strtoumax; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + bash_cv_decl_strtoumax=yes +else + bash_cv_decl_strtoumax=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_decl_strtoumax" >&5 +$as_echo "$bash_cv_decl_strtoumax" >&6; } +bash_tr_func=HAVE_DECL_`echo strtoumax | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +if test $bash_cv_decl_strtoumax = yes; then + cat >>confdefs.h <<_ACEOF +#define $bash_tr_func 1 +_ACEOF + +else + cat >>confdefs.h <<_ACEOF +#define $bash_tr_func 0 +_ACEOF + +fi + + + + + + + + for ac_func in $ac_func_list +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5 +$as_echo_n "checking for working mktime... " >&6; } +if ${ac_cv_func_working_mktime+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_working_mktime=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Test program from Paul Eggert and Tony Leneis. */ +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else +# ifdef HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifndef HAVE_ALARM +# define alarm(X) /* empty */ +#endif + +/* Work around redefinition to rpl_putenv by other config tests. */ +#undef putenv + +static time_t time_t_max; +static time_t time_t_min; + +/* Values we'll use to set the TZ environment variable. */ +static const char *tz_strings[] = { + (const char *) 0, "TZ=GMT0", "TZ=JST-9", + "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" +}; +#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) + +/* Return 0 if mktime fails to convert a date in the spring-forward gap. + Based on a problem report from Andreas Jaeger. */ +static int +spring_forward_gap () +{ + /* glibc (up to about 1998-10-07) failed this test. */ + struct tm tm; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); + + tm.tm_year = 98; + tm.tm_mon = 3; + tm.tm_mday = 5; + tm.tm_hour = 2; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + return mktime (&tm) != (time_t) -1; +} + +static int +mktime_test1 (time_t now) +{ + struct tm *lt; + return ! (lt = localtime (&now)) || mktime (lt) == now; +} + +static int +mktime_test (time_t now) +{ + return (mktime_test1 (now) + && mktime_test1 ((time_t) (time_t_max - now)) + && mktime_test1 ((time_t) (time_t_min + now))); +} + +static int +irix_6_4_bug () +{ + /* Based on code from Ariel Faigon. */ + struct tm tm; + tm.tm_year = 96; + tm.tm_mon = 3; + tm.tm_mday = 0; + tm.tm_hour = 0; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + mktime (&tm); + return tm.tm_mon == 2 && tm.tm_mday == 31; +} + +static int +bigtime_test (int j) +{ + struct tm tm; + time_t now; + tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; + now = mktime (&tm); + if (now != (time_t) -1) + { + struct tm *lt = localtime (&now); + if (! (lt + && lt->tm_year == tm.tm_year + && lt->tm_mon == tm.tm_mon + && lt->tm_mday == tm.tm_mday + && lt->tm_hour == tm.tm_hour + && lt->tm_min == tm.tm_min + && lt->tm_sec == tm.tm_sec + && lt->tm_yday == tm.tm_yday + && lt->tm_wday == tm.tm_wday + && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) + == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) + return 0; + } + return 1; +} + +static int +year_2050_test () +{ + /* The correct answer for 2050-02-01 00:00:00 in Pacific time, + ignoring leap seconds. */ + unsigned long int answer = 2527315200UL; + + struct tm tm; + time_t t; + tm.tm_year = 2050 - 1900; + tm.tm_mon = 2 - 1; + tm.tm_mday = 1; + tm.tm_hour = tm.tm_min = tm.tm_sec = 0; + tm.tm_isdst = -1; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); + + t = mktime (&tm); + + /* Check that the result is either a failure, or close enough + to the correct answer that we can assume the discrepancy is + due to leap seconds. */ + return (t == (time_t) -1 + || (0 < t && answer - 120 <= t && t <= answer + 120)); +} + +int +main () +{ + time_t t, delta; + int i, j; + + /* This test makes some buggy mktime implementations loop. + Give up after 60 seconds; a mktime slower than that + isn't worth using anyway. */ + alarm (60); + + for (;;) + { + t = (time_t_max << 1) + 1; + if (t <= time_t_max) + break; + time_t_max = t; + } + time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - time_t_max; + + delta = time_t_max / 997; /* a suitable prime number */ + for (i = 0; i < N_STRINGS; i++) + { + if (tz_strings[i]) + putenv ((char*) tz_strings[i]); + + for (t = 0; t <= time_t_max - delta; t += delta) + if (! mktime_test (t)) + return 1; + if (! (mktime_test ((time_t) 1) + && mktime_test ((time_t) (60 * 60)) + && mktime_test ((time_t) (60 * 60 * 24)))) + return 1; + + for (j = 1; ; j <<= 1) + if (! bigtime_test (j)) + return 1; + else if (INT_MAX / 2 < j) + break; + if (! bigtime_test (INT_MAX)) + return 1; + } + return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ()); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_working_mktime=yes +else + ac_cv_func_working_mktime=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_working_mktime" >&5 +$as_echo "$ac_cv_func_working_mktime" >&6; } +if test $ac_cv_func_working_mktime = no; then + case " $LIBOBJS " in + *" mktime.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS mktime.$ac_objext" + ;; +esac + +fi + + + +for ac_header in argz.h errno.h fcntl.h malloc.h stdio_ext.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_func in getpagesize +do : + ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" +if test "x$ac_cv_func_getpagesize" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETPAGESIZE 1 +_ACEOF + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 +$as_echo_n "checking for working mmap... " >&6; } +if ${ac_cv_func_mmap_fixed_mapped+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_mmap_fixed_mapped=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +/* malloc might have been renamed as rpl_malloc. */ +#undef malloc + +/* Thanks to Mike Haertel and Jim Avera for this test. + Here is a matrix of mmap possibilities: + mmap private not fixed + mmap private fixed at somewhere currently unmapped + mmap private fixed at somewhere already mapped + mmap shared not fixed + mmap shared fixed at somewhere currently unmapped + mmap shared fixed at somewhere already mapped + For private mappings, we should verify that changes cannot be read() + back from the file, nor mmap's back from the file at a different + address. (There have been systems where private was not correctly + implemented like the infamous i386 svr4.0, and systems where the + VM page cache was not coherent with the file system buffer cache + like early versions of FreeBSD and possibly contemporary NetBSD.) + For shared mappings, we should conversely verify that changes get + propagated back to all the places they're supposed to be. + + Grep wants private fixed already mapped. + The main things grep needs to know about mmap are: + * does it exist and is it safe to write into the mmap'd area + * how to use it (BSD variants) */ + +#include +#include + +#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H +char *malloc (); +#endif + +/* This mess was copied from the GNU getpagesize.h. */ +#ifndef HAVE_GETPAGESIZE +# ifdef _SC_PAGESIZE +# define getpagesize() sysconf(_SC_PAGESIZE) +# else /* no _SC_PAGESIZE */ +# ifdef HAVE_SYS_PARAM_H +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else /* no EXEC_PAGESIZE */ +# ifdef NBPG +# define getpagesize() NBPG * CLSIZE +# ifndef CLSIZE +# define CLSIZE 1 +# endif /* no CLSIZE */ +# else /* no NBPG */ +# ifdef NBPC +# define getpagesize() NBPC +# else /* no NBPC */ +# ifdef PAGESIZE +# define getpagesize() PAGESIZE +# endif /* PAGESIZE */ +# endif /* no NBPC */ +# endif /* no NBPG */ +# endif /* no EXEC_PAGESIZE */ +# else /* no HAVE_SYS_PARAM_H */ +# define getpagesize() 8192 /* punt totally */ +# endif /* no HAVE_SYS_PARAM_H */ +# endif /* no _SC_PAGESIZE */ + +#endif /* no HAVE_GETPAGESIZE */ + +int +main () +{ + char *data, *data2, *data3; + const char *cdata2; + int i, pagesize; + int fd, fd2; + + pagesize = getpagesize (); + + /* First, make a file with some known garbage in it. */ + data = (char *) malloc (pagesize); + if (!data) + return 1; + for (i = 0; i < pagesize; ++i) + *(data + i) = rand (); + umask (0); + fd = creat ("conftest.mmap", 0600); + if (fd < 0) + return 2; + if (write (fd, data, pagesize) != pagesize) + return 3; + close (fd); + + /* Next, check that the tail of a page is zero-filled. File must have + non-zero length, otherwise we risk SIGBUS for entire page. */ + fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); + if (fd2 < 0) + return 4; + cdata2 = ""; + if (write (fd2, cdata2, 1) != 1) + return 5; + data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); + if (data2 == MAP_FAILED) + return 6; + for (i = 0; i < pagesize; ++i) + if (*(data2 + i)) + return 7; + close (fd2); + if (munmap (data2, pagesize)) + return 8; + + /* Next, try to mmap the file at a fixed address which already has + something else allocated at it. If we can, also make sure that + we see the same garbage. */ + fd = open ("conftest.mmap", O_RDWR); + if (fd < 0) + return 9; + if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + return 10; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + return 11; + + /* Finally, make sure that changes to the mapped area do not + percolate back to the file as seen by read(). (This is a bug on + some variants of i386 svr4.0.) */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = (char *) malloc (pagesize); + if (!data3) + return 12; + if (read (fd, data3, pagesize) != pagesize) + return 13; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + return 14; + close (fd); + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_mmap_fixed_mapped=yes +else + ac_cv_func_mmap_fixed_mapped=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 +$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } +if test $ac_cv_func_mmap_fixed_mapped = yes; then + +$as_echo "#define HAVE_MMAP 1" >>confdefs.h + +fi +rm -f conftest.mmap conftest.txt + +for ac_func in __argz_count __argz_next __argz_stringify dcgettext mempcpy \ + munmap stpcpy strcspn +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +INTL_DEP= INTL_INC= LIBINTL_H= +if test "x$USE_INCLUDED_LIBINTL" = "xyes"; then + INTL_DEP='${INTL_LIBDIR}/libintl.a' + INTL_INC='-I${INTL_LIBSRC} -I${INTL_BUILDDIR}' + LIBINTL_H='${INTL_BUILDDIR}/libintl.h' +fi + + + + + + +for ac_header in wctype.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "wctype.h" "ac_cv_header_wctype_h" "$ac_includes_default" +if test "x$ac_cv_header_wctype_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WCTYPE_H 1 +_ACEOF + +fi + +done + +for ac_header in wchar.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "wchar.h" "ac_cv_header_wchar_h" "$ac_includes_default" +if test "x$ac_cv_header_wchar_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WCHAR_H 1 +_ACEOF + +fi + +done + +for ac_header in langinfo.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "langinfo.h" "ac_cv_header_langinfo_h" "$ac_includes_default" +if test "x$ac_cv_header_langinfo_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LANGINFO_H 1 +_ACEOF + +fi + +done + + +ac_fn_c_check_func "$LINENO" "mbrlen" "ac_cv_func_mbrlen" +if test "x$ac_cv_func_mbrlen" = xyes; then : + $as_echo "#define HAVE_MBRLEN 1" >>confdefs.h + +fi + +ac_fn_c_check_func "$LINENO" "mbscasecmp" "ac_cv_func_mbscasecmp" +if test "x$ac_cv_func_mbscasecmp" = xyes; then : + $as_echo "#define HAVE_MBSCMP 1" >>confdefs.h + +fi + +ac_fn_c_check_func "$LINENO" "mbscmp" "ac_cv_func_mbscmp" +if test "x$ac_cv_func_mbscmp" = xyes; then : + $as_echo "#define HAVE_MBSCMP 1" >>confdefs.h + +fi + +ac_fn_c_check_func "$LINENO" "mbsnrtowcs" "ac_cv_func_mbsnrtowcs" +if test "x$ac_cv_func_mbsnrtowcs" = xyes; then : + $as_echo "#define HAVE_MBSNRTOWCS 1" >>confdefs.h + +fi + +ac_fn_c_check_func "$LINENO" "mbsrtowcs" "ac_cv_func_mbsrtowcs" +if test "x$ac_cv_func_mbsrtowcs" = xyes; then : + $as_echo "#define HAVE_MBSRTOWCS 1" >>confdefs.h + +fi + + +ac_fn_c_check_func "$LINENO" "mbschr" "ac_cv_func_mbschr" +if test "x$ac_cv_func_mbschr" = xyes; then : + $as_echo "#define HAVE_MBSCHR 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" mbschr.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS mbschr.$ac_objext" + ;; +esac + +fi + + + +ac_fn_c_check_func "$LINENO" "wcrtomb" "ac_cv_func_wcrtomb" +if test "x$ac_cv_func_wcrtomb" = xyes; then : + $as_echo "#define HAVE_WCRTOMB 1" >>confdefs.h + +fi + +ac_fn_c_check_func "$LINENO" "wcscoll" "ac_cv_func_wcscoll" +if test "x$ac_cv_func_wcscoll" = xyes; then : + $as_echo "#define HAVE_WCSCOLL 1" >>confdefs.h + +fi + +ac_fn_c_check_func "$LINENO" "wcsdup" "ac_cv_func_wcsdup" +if test "x$ac_cv_func_wcsdup" = xyes; then : + $as_echo "#define HAVE_WCSDUP 1" >>confdefs.h + +fi + +ac_fn_c_check_func "$LINENO" "wcwidth" "ac_cv_func_wcwidth" +if test "x$ac_cv_func_wcwidth" = xyes; then : + $as_echo "#define HAVE_WCWIDTH 1" >>confdefs.h + +fi + +ac_fn_c_check_func "$LINENO" "wctype" "ac_cv_func_wctype" +if test "x$ac_cv_func_wctype" = xyes; then : + $as_echo "#define HAVE_WCTYPE 1" >>confdefs.h + +fi + + +ac_fn_c_check_func "$LINENO" "wcswidth" "ac_cv_func_wcswidth" +if test "x$ac_cv_func_wcswidth" = xyes; then : + $as_echo "#define HAVE_WCSWIDTH 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" wcswidth.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS wcswidth.$ac_objext" + ;; +esac + +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc and mbstate_t are properly declared" >&5 +$as_echo_n "checking whether mbrtowc and mbstate_t are properly declared... " >&6; } +if ${ac_cv_func_mbrtowc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +wchar_t wc; + char const s[] = ""; + size_t n = 1; + mbstate_t state; + return ! (sizeof state && (mbrtowc) (&wc, s, n, &state)); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_func_mbrtowc=yes +else + ac_cv_func_mbrtowc=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mbrtowc" >&5 +$as_echo "$ac_cv_func_mbrtowc" >&6; } + if test $ac_cv_func_mbrtowc = yes; then + +$as_echo "#define HAVE_MBRTOWC 1" >>confdefs.h + + fi + +if test $ac_cv_func_mbrtowc = yes; then + $as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h + +fi + +for ac_func in iswlower iswupper towlower towupper iswctype +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 +$as_echo_n "checking for nl_langinfo and CODESET... " >&6; } +if ${bash_cv_langinfo_codeset+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +char* cs = nl_langinfo(CODESET); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + bash_cv_langinfo_codeset=yes +else + bash_cv_langinfo_codeset=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_langinfo_codeset" >&5 +$as_echo "$bash_cv_langinfo_codeset" >&6; } +if test $bash_cv_langinfo_codeset = yes; then + $as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t in wchar.h" >&5 +$as_echo_n "checking for wchar_t in wchar.h... " >&6; } +if ${bash_cv_type_wchar_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ + + wchar_t foo; + foo = 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bash_cv_type_wchar_t=yes +else + bash_cv_type_wchar_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_wchar_t" >&5 +$as_echo "$bash_cv_type_wchar_t" >&6; } +if test $bash_cv_type_wchar_t = yes; then + +$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t in wctype.h" >&5 +$as_echo_n "checking for wctype_t in wctype.h... " >&6; } +if ${bash_cv_type_wctype_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + wctype_t foo; + foo = 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bash_cv_type_wctype_t=yes +else + bash_cv_type_wctype_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_wctype_t" >&5 +$as_echo "$bash_cv_type_wctype_t" >&6; } +if test $bash_cv_type_wctype_t = yes; then + +$as_echo "#define HAVE_WCTYPE_T 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t in wctype.h" >&5 +$as_echo_n "checking for wint_t in wctype.h... " >&6; } +if ${bash_cv_type_wint_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + wint_t foo; + foo = 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bash_cv_type_wint_t=yes +else + bash_cv_type_wint_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_wint_t" >&5 +$as_echo "$bash_cv_type_wint_t" >&6; } +if test $bash_cv_type_wint_t = yes; then + +$as_echo "#define HAVE_WINT_T 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wcwidth broken with unicode combining characters" >&5 +$as_echo_n "checking for wcwidth broken with unicode combining characters... " >&6; } +if ${bash_cv_wcwidth_broken+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + bash_cv_wcwidth_broken=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include + +#include +#include + +main(c, v) +int c; +char **v; +{ + int w; + + setlocale(LC_ALL, "en_US.UTF-8"); + w = wcwidth (0x0301); + exit (w == 0); /* exit 0 if wcwidth broken */ +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_wcwidth_broken=yes +else + bash_cv_wcwdith_broken=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_wcwidth_broken" >&5 +$as_echo "$bash_cv_wcwidth_broken" >&6; } +if test "$bash_cv_wcwidth_broken" = yes; then + +$as_echo "#define WCWIDTH_BROKEN 1" >>confdefs.h + +fi + +if test "$am_cv_func_iconv" = yes; then + OLDLIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + for ac_func in locale_charset +do : + ac_fn_c_check_func "$LINENO" "locale_charset" "ac_cv_func_locale_charset" +if test "x$ac_cv_func_locale_charset" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LOCALE_CHARSET 1 +_ACEOF + +fi +done + + LIBS="$OLDLIBS" +fi + + + +if test "$opt_static_link" != yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDL 1 +_ACEOF + + LIBS="-ldl $LIBS" + +fi + +for ac_func in dlopen dlclose dlsym +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +fi + +ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include +/* NetBSD declares sys_siglist in unistd.h. */ +#ifdef HAVE_UNISTD_H +# include +#endif + +" +if test "x$ac_cv_have_decl_sys_siglist" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SYS_SIGLIST $ac_have_decl +_ACEOF + + + +if test "$ac_cv_func_inet_aton" != 'yes'; then + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton" >&5 +$as_echo_n "checking for inet_aton... " >&6; } +if ${bash_cv_func_inet_aton+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +struct in_addr ap; +int +main () +{ + inet_aton("127.0.0.1", &ap); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + bash_cv_func_inet_aton=yes +else + bash_cv_func_inet_aton=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_func_inet_aton" >&5 +$as_echo "$bash_cv_func_inet_aton" >&6; } +if test $bash_cv_func_inet_aton = yes; then + $as_echo "#define HAVE_INET_ATON 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" inet_aton.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS inet_aton.$ac_objext" + ;; +esac + +fi + +fi + +case "$host_os" in +irix4*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpwent in -lsun" >&5 +$as_echo_n "checking for getpwent in -lsun... " >&6; } +if ${ac_cv_lib_sun_getpwent+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsun $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char getpwent (); +int +main () +{ +return getpwent (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_sun_getpwent=yes +else + ac_cv_lib_sun_getpwent=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sun_getpwent" >&5 +$as_echo "$ac_cv_lib_sun_getpwent" >&6; } +if test "x$ac_cv_lib_sun_getpwent" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSUN 1 +_ACEOF + + LIBS="-lsun $LIBS" + +fi + ;; +esac + +if test "$ac_cv_func_getpeername" = no; then + +if test "X$bash_cv_have_socklib" = "X"; then +_bash_needmsg= +else +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket library" >&5 +$as_echo_n "checking for socket library... " >&6; } +_bash_needmsg=yes +fi +if ${bash_cv_have_socklib+:} false; then : + $as_echo_n "(cached) " >&6 +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpeername in -lsocket" >&5 +$as_echo_n "checking for getpeername in -lsocket... " >&6; } +if ${ac_cv_lib_socket_getpeername+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket -lnsl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char getpeername (); +int +main () +{ +return getpeername (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_socket_getpeername=yes +else + ac_cv_lib_socket_getpeername=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getpeername" >&5 +$as_echo "$ac_cv_lib_socket_getpeername" >&6; } +if test "x$ac_cv_lib_socket_getpeername" = xyes; then : + bash_cv_have_socklib=yes +else + bash_cv_have_socklib=no +fi + +fi + +if test "X$_bash_needmsg" = Xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_have_socklib" >&5 +$as_echo "$bash_cv_have_socklib" >&6; } + _bash_needmsg= +fi +if test $bash_cv_have_socklib = yes; then + # check for libnsl, add it to LIBS if present + if test "X$bash_cv_have_libnsl" = "X"; then + _bash_needmsg= + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libnsl" >&5 +$as_echo_n "checking for libnsl... " >&6; } + _bash_needmsg=yes + fi + if ${bash_cv_have_libnsl+:} false; then : + $as_echo_n "(cached) " >&6 +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for t_open in -lnsl" >&5 +$as_echo_n "checking for t_open in -lnsl... " >&6; } +if ${ac_cv_lib_nsl_t_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char t_open (); +int +main () +{ +return t_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nsl_t_open=yes +else + ac_cv_lib_nsl_t_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_t_open" >&5 +$as_echo "$ac_cv_lib_nsl_t_open" >&6; } +if test "x$ac_cv_lib_nsl_t_open" = xyes; then : + bash_cv_have_libnsl=yes +else + bash_cv_have_libnsl=no +fi + +fi + + if test "X$_bash_needmsg" = Xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_have_libnsl" >&5 +$as_echo "$bash_cv_have_libnsl" >&6; } + _bash_needmsg= + fi + if test $bash_cv_have_libnsl = yes; then + LIBS="-lsocket -lnsl $LIBS" + else + LIBS="-lsocket $LIBS" + fi + $as_echo "#define HAVE_LIBSOCKET 1" >>confdefs.h + + $as_echo "#define HAVE_GETPEERNAME 1" >>confdefs.h + +fi + +fi +if test "$ac_cv_func_gethostbyname" = no; then + if test "X$bash_cv_have_gethostbyname" = "X"; then +_bash_needmsg=yes +else +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in socket library" >&5 +$as_echo_n "checking for gethostbyname in socket library... " >&6; } +_bash_needmsg= +fi +if ${bash_cv_have_gethostbyname+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + struct hostent *hp; + hp = gethostbyname("localhost"); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + bash_cv_have_gethostbyname=yes +else + bash_cv_have_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi + +if test "X$_bash_needmsg" = Xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in socket library" >&5 +$as_echo_n "checking for gethostbyname in socket library... " >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_have_gethostbyname" >&5 +$as_echo "$bash_cv_have_gethostbyname" >&6; } +if test "$bash_cv_have_gethostbyname" = yes; then +$as_echo "#define HAVE_GETHOSTBYNAME 1" >>confdefs.h + +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } +if ${ac_cv_type_uid_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uid_t" >/dev/null 2>&1; then : + ac_cv_type_uid_t=yes +else + ac_cv_type_uid_t=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then + +$as_echo "#define uid_t int" >>confdefs.h + + +$as_echo "#define gid_t int" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking type of array argument to getgroups" >&5 +$as_echo_n "checking type of array argument to getgroups... " >&6; } +if ${ac_cv_type_getgroups+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_type_getgroups=cross +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Thanks to Mike Rendell for this test. */ +$ac_includes_default +#define NGID 256 +#undef MAX +#define MAX(x, y) ((x) > (y) ? (x) : (y)) + +int +main () +{ + gid_t gidset[NGID]; + int i, n; + union { gid_t gval; long int lval; } val; + + val.lval = -1; + for (i = 0; i < NGID; i++) + gidset[i] = val.gval; + n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1, + gidset); + /* Exit non-zero if getgroups seems to require an array of ints. This + happens when gid_t is short int but getgroups modifies an array + of ints. */ + return n > 0 && gidset[n] != val.gval; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_type_getgroups=gid_t +else + ac_cv_type_getgroups=int +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +if test $ac_cv_type_getgroups = cross; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "getgroups.*int.*gid_t" >/dev/null 2>&1; then : + ac_cv_type_getgroups=gid_t +else + ac_cv_type_getgroups=int +fi +rm -f conftest* + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_getgroups" >&5 +$as_echo "$ac_cv_type_getgroups" >&6; } + +cat >>confdefs.h <<_ACEOF +#define GETGROUPS_T $ac_cv_type_getgroups +_ACEOF + + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" +if test "x$ac_cv_type_mode_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define mode_t int +_ACEOF + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } +if ${ac_cv_type_uid_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uid_t" >/dev/null 2>&1; then : + ac_cv_type_uid_t=yes +else + ac_cv_type_uid_t=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then + +$as_echo "#define uid_t int" >>confdefs.h + + +$as_echo "#define gid_t int" >>confdefs.h + +fi + +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define pid_t int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" +if test "x$ac_cv_type_ssize_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define ssize_t int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "time_t" "ac_cv_type_time_t" "$ac_includes_default" +if test "x$ac_cv_type_time_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define time_t long +_ACEOF + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long" >&5 +$as_echo_n "checking for long long... " >&6; } +if ${bash_cv_type_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +long long ll = 1; int i = 63; +int +main () +{ + +long long llm = (long long) -1; +return ll << i | ll >> i | llm / ll | llm % ll; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + bash_cv_type_long_long='long long' +else + bash_cv_type_long_long='long' +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_long_long" >&5 +$as_echo "$bash_cv_type_long_long" >&6; } +if test "$bash_cv_type_long_long" = 'long long'; then + $as_echo "#define HAVE_LONG_LONG 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long" >&5 +$as_echo_n "checking for unsigned long long... " >&6; } +if ${bash_cv_type_unsigned_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +unsigned long long ull = 1; int i = 63; +int +main () +{ + +unsigned long long ullmax = (unsigned long long) -1; +return ull << i | ull >> i | ullmax / ull | ullmax % ull; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + bash_cv_type_unsigned_long_long='unsigned long long' +else + bash_cv_type_unsigned_long_long='unsigned long' +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_unsigned_long_long" >&5 +$as_echo "$bash_cv_type_unsigned_long_long" >&6; } +if test "$bash_cv_type_unsigned_long_long" = 'unsigned long long'; then + $as_echo "#define HAVE_UNSIGNED_LONG_LONG 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 +$as_echo_n "checking return type of signal handlers... " >&6; } +if ${ac_cv_type_signal+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main () +{ +return *(signal (0, 0)) (0) == 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_signal=int +else + ac_cv_type_signal=void +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 +$as_echo "$ac_cv_type_signal" >&6; } + +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sig_atomic_t in signal.h" >&5 +$as_echo_n "checking for sig_atomic_t in signal.h... " >&6; } +if ${ac_cv_have_sig_atomic_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +int +main () +{ + sig_atomic_t x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_have_sig_atomic_t=yes +else + ac_cv_have_sig_atomic_t=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_sig_atomic_t" >&5 +$as_echo "$ac_cv_have_sig_atomic_t" >&6; } +if test "$ac_cv_have_sig_atomic_t" = "no" +then + ac_fn_c_check_type "$LINENO" "sig_atomic_t" "ac_cv_type_sig_atomic_t" "$ac_includes_default" +if test "x$ac_cv_type_sig_atomic_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define sig_atomic_t int +_ACEOF + +fi + +fi + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5 +$as_echo_n "checking size of char... " >&6; } +if ${ac_cv_sizeof_char+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_char" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (char) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_char=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5 +$as_echo "$ac_cv_sizeof_char" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_CHAR $ac_cv_sizeof_char +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 +$as_echo_n "checking size of short... " >&6; } +if ${ac_cv_sizeof_short+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_short" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (short) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_short=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 +$as_echo "$ac_cv_sizeof_short" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SHORT $ac_cv_sizeof_short +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } +if ${ac_cv_sizeof_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_int" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (int) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_int=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char *" >&5 +$as_echo_n "checking size of char *... " >&6; } +if ${ac_cv_sizeof_char_p+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char *))" "ac_cv_sizeof_char_p" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_char_p" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (char *) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_char_p=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char_p" >&5 +$as_echo "$ac_cv_sizeof_char_p" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_CHAR_P $ac_cv_sizeof_char_p +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5 +$as_echo_n "checking size of double... " >&6; } +if ${ac_cv_sizeof_double+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_double" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (double) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_double=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double" >&5 +$as_echo "$ac_cv_sizeof_double" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_DOUBLE $ac_cv_sizeof_double +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } +if ${ac_cv_sizeof_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +_ACEOF + + + +ac_fn_c_check_type "$LINENO" "u_int" "ac_cv_type_u_int" "$ac_includes_default" +if test "x$ac_cv_type_u_int" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define u_int unsigned int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "u_long" "ac_cv_type_u_long" "$ac_includes_default" +if test "x$ac_cv_type_u_long" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define u_long unsigned long +_ACEOF + +fi + + + +if test "$ac_cv_sizeof_short" = 2; then + ac_fn_c_check_type "$LINENO" "bits16_t" "ac_cv_type_bits16_t" "$ac_includes_default" +if test "x$ac_cv_type_bits16_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define bits16_t short +_ACEOF + +fi + +elif test "$ac_cv_sizeof_char" = 2; then + ac_fn_c_check_type "$LINENO" "bits16_t" "ac_cv_type_bits16_t" "$ac_includes_default" +if test "x$ac_cv_type_bits16_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define bits16_t char +_ACEOF + +fi + +else + ac_fn_c_check_type "$LINENO" "bits16_t" "ac_cv_type_bits16_t" "$ac_includes_default" +if test "x$ac_cv_type_bits16_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define bits16_t short +_ACEOF + +fi + +fi + + +if test "$ac_cv_sizeof_short" = 2; then + ac_fn_c_check_type "$LINENO" "u_bits16_t" "ac_cv_type_u_bits16_t" "$ac_includes_default" +if test "x$ac_cv_type_u_bits16_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define u_bits16_t unsigned short +_ACEOF + +fi + +elif test "$ac_cv_sizeof_char" = 2; then + ac_fn_c_check_type "$LINENO" "u_bits16_t" "ac_cv_type_u_bits16_t" "$ac_includes_default" +if test "x$ac_cv_type_u_bits16_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define u_bits16_t unsigned char +_ACEOF + +fi + +else + ac_fn_c_check_type "$LINENO" "u_bits16_t" "ac_cv_type_u_bits16_t" "$ac_includes_default" +if test "x$ac_cv_type_u_bits16_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define u_bits16_t unsigned short +_ACEOF + +fi + +fi + + +if test "$ac_cv_sizeof_int" = 4; then + ac_fn_c_check_type "$LINENO" "bits32_t" "ac_cv_type_bits32_t" "$ac_includes_default" +if test "x$ac_cv_type_bits32_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define bits32_t int +_ACEOF + +fi + +elif test "$ac_cv_sizeof_long" = 4; then + ac_fn_c_check_type "$LINENO" "bits32_t" "ac_cv_type_bits32_t" "$ac_includes_default" +if test "x$ac_cv_type_bits32_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define bits32_t long +_ACEOF + +fi + +else + ac_fn_c_check_type "$LINENO" "bits32_t" "ac_cv_type_bits32_t" "$ac_includes_default" +if test "x$ac_cv_type_bits32_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define bits32_t int +_ACEOF + +fi + +fi + + +if test "$ac_cv_sizeof_int" = 4; then + ac_fn_c_check_type "$LINENO" "u_bits32_t" "ac_cv_type_u_bits32_t" "$ac_includes_default" +if test "x$ac_cv_type_u_bits32_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define u_bits32_t unsigned int +_ACEOF + +fi + +elif test "$ac_cv_sizeof_long" = 4; then + ac_fn_c_check_type "$LINENO" "u_bits32_t" "ac_cv_type_u_bits32_t" "$ac_includes_default" +if test "x$ac_cv_type_u_bits32_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define u_bits32_t unsigned long +_ACEOF + +fi + +else + ac_fn_c_check_type "$LINENO" "u_bits32_t" "ac_cv_type_u_bits32_t" "$ac_includes_default" +if test "x$ac_cv_type_u_bits32_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define u_bits32_t unsigned int +_ACEOF + +fi + +fi + + +if test "$ac_cv_sizeof_char_p" = 8; then + ac_fn_c_check_type "$LINENO" "bits64_t" "ac_cv_type_bits64_t" "$ac_includes_default" +if test "x$ac_cv_type_bits64_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define bits64_t char * +_ACEOF + +fi + +elif test "$ac_cv_sizeof_double" = 8; then + ac_fn_c_check_type "$LINENO" "bits64_t" "ac_cv_type_bits64_t" "$ac_includes_default" +if test "x$ac_cv_type_bits64_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define bits64_t double +_ACEOF + +fi + +elif test -n "$ac_cv_type_long_long" && test "$ac_cv_sizeof_long_long" = 8; then + ac_fn_c_check_type "$LINENO" "bits64_t" "ac_cv_type_bits64_t" "$ac_includes_default" +if test "x$ac_cv_type_bits64_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define bits64_t long long +_ACEOF + +fi + +elif test "$ac_cv_sizeof_long" = 8; then + ac_fn_c_check_type "$LINENO" "bits64_t" "ac_cv_type_bits64_t" "$ac_includes_default" +if test "x$ac_cv_type_bits64_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define bits64_t long +_ACEOF + +fi + +else + ac_fn_c_check_type "$LINENO" "bits64_t" "ac_cv_type_bits64_t" "$ac_includes_default" +if test "x$ac_cv_type_bits64_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define bits64_t double +_ACEOF + +fi + +fi + + + +if test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_char_p"; then + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define ptrdiff_t int +_ACEOF + +fi + +elif test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_char_p"; then + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define ptrdiff_t long +_ACEOF + +fi + +elif test "$ac_cv_type_long_long" = yes && test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_char_p"; then + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define ptrdiff_t long long +_ACEOF + +fi + +else + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define ptrdiff_t int +_ACEOF + +fi + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5 +$as_echo_n "checking whether stat file-mode macros are broken... " >&6; } +if ${ac_cv_header_stat_broken+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +#if defined S_ISBLK && defined S_IFDIR +extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1]; +#endif + +#if defined S_ISBLK && defined S_IFCHR +extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1]; +#endif + +#if defined S_ISLNK && defined S_IFREG +extern char c3[S_ISLNK (S_IFREG) ? -1 : 1]; +#endif + +#if defined S_ISSOCK && defined S_IFREG +extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stat_broken=no +else + ac_cv_header_stat_broken=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 +$as_echo "$ac_cv_header_stat_broken" >&6; } +if test $ac_cv_header_stat_broken = yes; then + +$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether #! works in shell scripts" >&5 +$as_echo_n "checking whether #! works in shell scripts... " >&6; } +if ${ac_cv_sys_interpreter+:} false; then : + $as_echo_n "(cached) " >&6 +else + echo '#! /bin/cat +exit 69 +' >conftest +chmod u+x conftest +(SHELL=/bin/sh; export SHELL; ./conftest >/dev/null 2>&1) +if test $? -ne 69; then + ac_cv_sys_interpreter=yes +else + ac_cv_sys_interpreter=no +fi +rm -f conftest +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_interpreter" >&5 +$as_echo "$ac_cv_sys_interpreter" >&6; } +interpval=$ac_cv_sys_interpreter + +if test $ac_cv_sys_interpreter = yes; then +$as_echo "#define HAVE_HASH_BANG_EXEC 1" >>confdefs.h + +fi + +if test "$ac_cv_func_lstat" = "no"; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lstat" >&5 +$as_echo_n "checking for lstat... " >&6; } +if ${bash_cv_func_lstat+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main () +{ + lstat(".",(struct stat *)0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + bash_cv_func_lstat=yes +else + bash_cv_func_lstat=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_func_lstat" >&5 +$as_echo "$bash_cv_func_lstat" >&6; } +if test $bash_cv_func_lstat = yes; then + $as_echo "#define HAVE_LSTAT 1" >>confdefs.h + +fi + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the ctype macros accept non-ascii characters" >&5 +$as_echo_n "checking whether the ctype macros accept non-ascii characters... " >&6; } +if ${bash_cv_func_ctype_nonascii+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check ctype macros if cross compiling -- defaulting to no" >&5 +$as_echo "$as_me: WARNING: cannot check ctype macros if cross compiling -- defaulting to no" >&2;} + bash_cv_func_ctype_nonascii=no + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_LOCALE_H +#include +#endif +#include +#include + +main(c, v) +int c; +char *v[]; +{ + char *deflocale; + unsigned char x; + int r1, r2; + +#ifdef HAVE_SETLOCALE + /* We take a shot here. If that locale is not known, try the + system default. We try this one because '\342' (226) is + known to be a printable character in that locale. */ + deflocale = setlocale(LC_ALL, "en_US.ISO8859-1"); + if (deflocale == 0) + deflocale = setlocale(LC_ALL, ""); +#endif + + x = '\342'; + r1 = isprint(x); + x -= 128; + r2 = isprint(x); + exit (r1 == 0 || r2 == 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_func_ctype_nonascii=yes +else + bash_cv_func_ctype_nonascii=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_func_ctype_nonascii" >&5 +$as_echo "$bash_cv_func_ctype_nonascii" >&6; } +if test $bash_cv_func_ctype_nonascii = yes; then +$as_echo "#define CTYPE_NON_ASCII 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if dup2 fails to clear the close-on-exec flag" >&5 +$as_echo_n "checking if dup2 fails to clear the close-on-exec flag... " >&6; } +if ${bash_cv_dup2_broken+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check dup2 if cross compiling -- defaulting to no" >&5 +$as_echo "$as_me: WARNING: cannot check dup2 if cross compiling -- defaulting to no" >&2;} + bash_cv_dup2_broken=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +main() +{ + int fd1, fd2, fl; + fd1 = open("/dev/null", 2); + if (fcntl(fd1, 2, 1) < 0) + exit(1); + fd2 = dup2(fd1, 1); + if (fd2 < 0) + exit(2); + fl = fcntl(fd2, 1, 0); + /* fl will be 1 if dup2 did not reset the close-on-exec flag. */ + exit(fl != 1); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_dup2_broken=yes +else + bash_cv_dup2_broken=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_dup2_broken" >&5 +$as_echo "$bash_cv_dup2_broken" >&6; } +if test $bash_cv_dup2_broken = yes; then +$as_echo "#define DUP2_BROKEN 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pgrps need synchronization" >&5 +$as_echo_n "checking whether pgrps need synchronization... " >&6; } +if ${bash_cv_pgrp_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check pgrp synchronization if cross compiling -- defaulting to no" >&5 +$as_echo "$as_me: WARNING: cannot check pgrp synchronization if cross compiling -- defaulting to no" >&2;} + bash_cv_pgrp_pipe=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_UNISTD_H +# include +#endif +main() +{ +# ifdef GETPGRP_VOID +# define getpgID() getpgrp() +# else +# define getpgID() getpgrp(0) +# define setpgid(x,y) setpgrp(x,y) +# endif + int pid1, pid2, fds[2]; + int status; + char ok; + + switch (pid1 = fork()) { + case -1: + exit(1); + case 0: + setpgid(0, getpid()); + exit(0); + } + setpgid(pid1, pid1); + + sleep(2); /* let first child die */ + + if (pipe(fds) < 0) + exit(2); + + switch (pid2 = fork()) { + case -1: + exit(3); + case 0: + setpgid(0, pid1); + ok = getpgID() == pid1; + write(fds[1], &ok, 1); + exit(0); + } + setpgid(pid2, pid1); + + close(fds[1]); + if (read(fds[0], &ok, 1) != 1) + exit(4); + wait(&status); + wait(&status); + exit(ok ? 0 : 5); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_pgrp_pipe=no +else + bash_cv_pgrp_pipe=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_pgrp_pipe" >&5 +$as_echo "$bash_cv_pgrp_pipe" >&6; } +if test $bash_cv_pgrp_pipe = yes; then +$as_echo "#define PGRP_PIPE 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for type of signal functions" >&5 +$as_echo_n "checking for type of signal functions... " >&6; } +if ${bash_cv_signal_vintage+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + sigset_t ss; + struct sigaction sa; + sigemptyset(&ss); sigsuspend(&ss); + sigaction(SIGINT, &sa, (struct sigaction *) 0); + sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + bash_cv_signal_vintage=posix +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + int mask = sigmask(SIGINT); + sigsetmask(mask); sigblock(mask); sigpause(mask); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + bash_cv_signal_vintage=4.2bsd +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + RETSIGTYPE foo() { } +int +main () +{ + + int mask = sigmask(SIGINT); + sigset(SIGINT, foo); sigrelse(SIGINT); + sighold(SIGINT); sigpause(SIGINT); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + bash_cv_signal_vintage=svr3 +else + bash_cv_signal_vintage=v7 + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_signal_vintage" >&5 +$as_echo "$bash_cv_signal_vintage" >&6; } +if test "$bash_cv_signal_vintage" = posix; then +$as_echo "#define HAVE_POSIX_SIGNALS 1" >>confdefs.h + +elif test "$bash_cv_signal_vintage" = "4.2bsd"; then +$as_echo "#define HAVE_BSD_SIGNALS 1" >>confdefs.h + +elif test "$bash_cv_signal_vintage" = svr3; then +$as_echo "#define HAVE_USG_SIGHOLD 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys_errlist and sys_nerr" >&5 +$as_echo_n "checking for sys_errlist and sys_nerr... " >&6; } +if ${bash_cv_sys_errlist+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +extern char *sys_errlist[]; + extern int sys_nerr; + char *msg = sys_errlist[sys_nerr - 1]; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + bash_cv_sys_errlist=yes +else + bash_cv_sys_errlist=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_sys_errlist" >&5 +$as_echo "$bash_cv_sys_errlist" >&6; } +if test $bash_cv_sys_errlist = yes; then +$as_echo "#define HAVE_SYS_ERRLIST 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys_siglist in system C library" >&5 +$as_echo_n "checking for sys_siglist in system C library... " >&6; } +if ${bash_cv_sys_siglist+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check for sys_siglist if cross compiling -- defaulting to no" >&5 +$as_echo "$as_me: WARNING: cannot check for sys_siglist if cross compiling -- defaulting to no" >&2;} + bash_cv_sys_siglist=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#if !HAVE_DECL_SYS_SIGLIST +extern char *sys_siglist[]; +#endif +main() +{ +char *msg = sys_siglist[2]; +exit(msg == 0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_sys_siglist=yes +else + bash_cv_sys_siglist=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_sys_siglist" >&5 +$as_echo "$bash_cv_sys_siglist" >&6; } +if test $bash_cv_sys_siglist = yes; then +$as_echo "#define HAVE_SYS_SIGLIST 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _sys_siglist in signal.h or unistd.h" >&5 +$as_echo_n "checking for _sys_siglist in signal.h or unistd.h... " >&6; } +if ${bash_cv_decl_under_sys_siglist+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +int +main () +{ + char *msg = _sys_siglist[2]; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bash_cv_decl_under_sys_siglist=yes +else + bash_cv_decl_under_sys_siglist=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_decl_under_sys_siglist" >&5 +$as_echo "$bash_cv_decl_under_sys_siglist" >&6; } +if test $bash_cv_decl_under_sys_siglist = yes; then +$as_echo "#define UNDER_SYS_SIGLIST_DECLARED 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _sys_siglist in system C library" >&5 +$as_echo_n "checking for _sys_siglist in system C library... " >&6; } +if ${bash_cv_under_sys_siglist+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check for _sys_siglist if cross compiling -- defaulting to no" >&5 +$as_echo "$as_me: WARNING: cannot check for _sys_siglist if cross compiling -- defaulting to no" >&2;} + bash_cv_under_sys_siglist=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifndef UNDER_SYS_SIGLIST_DECLARED +extern char *_sys_siglist[]; +#endif +main() +{ +char *msg = (char *)_sys_siglist[2]; +exit(msg == 0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_under_sys_siglist=yes +else + bash_cv_under_sys_siglist=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_under_sys_siglist" >&5 +$as_echo "$bash_cv_under_sys_siglist" >&6; } +if test $bash_cv_under_sys_siglist = yes; then +$as_echo "#define HAVE_UNDER_SYS_SIGLIST 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether signal handlers are of type void" >&5 +$as_echo_n "checking whether signal handlers are of type void... " >&6; } +if ${bash_cv_void_sighandler+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#ifdef signal +#undef signal +#endif +#ifdef __cplusplus +extern "C" +#endif +void (*signal ()) (); +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bash_cv_void_sighandler=yes +else + bash_cv_void_sighandler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_void_sighandler" >&5 +$as_echo "$bash_cv_void_sighandler" >&6; } +if test $bash_cv_void_sighandler = yes; then +$as_echo "#define VOID_SIGHANDLER 1" >>confdefs.h + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_t" >&5 +$as_echo_n "checking for clock_t... " >&6; } +if ${bash_cv_type_clock_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_STDINT_H +#include +#endif +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "clock_t" >/dev/null 2>&1; then : + bash_cv_type_clock_t=yes +else + bash_cv_type_clock_t=no +fi +rm -f conftest* + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_clock_t" >&5 +$as_echo "$bash_cv_type_clock_t" >&6; } + +if test $bash_cv_type_clock_t = no; then + cat >>confdefs.h <<_ACEOF +#define clock_t long +_ACEOF + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigset_t" >&5 +$as_echo_n "checking for sigset_t... " >&6; } +if ${bash_cv_type_sigset_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_STDINT_H +#include +#endif +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "sigset_t" >/dev/null 2>&1; then : + bash_cv_type_sigset_t=yes +else + bash_cv_type_sigset_t=no +fi +rm -f conftest* + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_sigset_t" >&5 +$as_echo "$bash_cv_type_sigset_t" >&6; } + +if test $bash_cv_type_sigset_t = no; then + cat >>confdefs.h <<_ACEOF +#define sigset_t int +_ACEOF + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sig_atomic_t" >&5 +$as_echo_n "checking for sig_atomic_t... " >&6; } +if ${bash_cv_type_sig_atomic_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_STDINT_H +#include +#endif +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "sig_atomic_t" >/dev/null 2>&1; then : + bash_cv_type_sig_atomic_t=yes +else + bash_cv_type_sig_atomic_t=no +fi +rm -f conftest* + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_sig_atomic_t" >&5 +$as_echo "$bash_cv_type_sig_atomic_t" >&6; } + +if test $bash_cv_type_sig_atomic_t = no; then + cat >>confdefs.h <<_ACEOF +#define sig_atomic_t int +_ACEOF + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for quad_t" >&5 +$as_echo_n "checking for quad_t... " >&6; } +if ${bash_cv_type_quad_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_STDINT_H +#include +#endif + + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "quad_t" >/dev/null 2>&1; then : + bash_cv_type_quad_t=yes +else + bash_cv_type_quad_t=no +fi +rm -f conftest* + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_quad_t" >&5 +$as_echo "$bash_cv_type_quad_t" >&6; } +if test $bash_cv_type_quad_t = yes; then + $as_echo "#define HAVE_QUAD_T 1" >>confdefs.h + + fi +if test $bash_cv_type_quad_t = no; then + cat >>confdefs.h <<_ACEOF +#define quad_t long +_ACEOF + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for intmax_t" >&5 +$as_echo_n "checking for intmax_t... " >&6; } +if ${bash_cv_type_intmax_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_STDINT_H +#include +#endif + + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "intmax_t" >/dev/null 2>&1; then : + bash_cv_type_intmax_t=yes +else + bash_cv_type_intmax_t=no +fi +rm -f conftest* + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_intmax_t" >&5 +$as_echo "$bash_cv_type_intmax_t" >&6; } + +if test $bash_cv_type_intmax_t = no; then + cat >>confdefs.h <<_ACEOF +#define intmax_t $bash_cv_type_long_long +_ACEOF + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uintmax_t" >&5 +$as_echo_n "checking for uintmax_t... " >&6; } +if ${bash_cv_type_uintmax_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_STDINT_H +#include +#endif + + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uintmax_t" >/dev/null 2>&1; then : + bash_cv_type_uintmax_t=yes +else + bash_cv_type_uintmax_t=no +fi +rm -f conftest* + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_uintmax_t" >&5 +$as_echo "$bash_cv_type_uintmax_t" >&6; } + +if test $bash_cv_type_uintmax_t = no; then + cat >>confdefs.h <<_ACEOF +#define uintmax_t $bash_cv_type_unsigned_long_long +_ACEOF + +fi + +if test "$ac_cv_header_sys_socket_h" = "yes"; then + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5 +$as_echo_n "checking for socklen_t... " >&6; } +if ${bash_cv_type_socklen_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#if STDC_HEADERS +#include +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_STDINT_H +#include +#endif +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "socklen_t" >/dev/null 2>&1; then : + bash_cv_type_socklen_t=yes +else + bash_cv_type_socklen_t=no +fi +rm -f conftest* + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_socklen_t" >&5 +$as_echo "$bash_cv_type_socklen_t" >&6; } +if test $bash_cv_type_socklen_t = yes; then + $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h + + fi +if test $bash_cv_type_socklen_t = no; then + cat >>confdefs.h <<_ACEOF +#define socklen_t unsigned int +_ACEOF + +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for size and type of struct rlimit fields" >&5 +$as_echo_n "checking for size and type of struct rlimit fields... " >&6; } +if ${bash_cv_type_rlimit+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +rlim_t xxx; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bash_cv_type_rlimit=rlim_t +else + +if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check quad_t if cross compiling -- defaulting to long" >&5 +$as_echo "$as_me: WARNING: cannot check quad_t if cross compiling -- defaulting to long" >&2;} + bash_cv_type_rlimit=long +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +main() +{ +#ifdef HAVE_QUAD_T + struct rlimit rl; + if (sizeof(rl.rlim_cur) == sizeof(quad_t)) + exit(0); +#endif + exit(1); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_type_rlimit=quad_t +else + bash_cv_type_rlimit=long +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_rlimit" >&5 +$as_echo "$bash_cv_type_rlimit" >&6; } +if test $bash_cv_type_rlimit = quad_t; then +$as_echo "#define RLIMTYPE quad_t" >>confdefs.h + +elif test $bash_cv_type_rlimit = rlim_t; then +$as_echo "#define RLIMTYPE rlim_t" >>confdefs.h + +fi + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of intmax_t" >&5 +$as_echo_n "checking size of intmax_t... " >&6; } +if ${ac_cv_sizeof_intmax_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (intmax_t))" "ac_cv_sizeof_intmax_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_intmax_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (intmax_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_intmax_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_intmax_t" >&5 +$as_echo "$ac_cv_sizeof_intmax_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INTMAX_T $ac_cv_sizeof_intmax_t +_ACEOF + + + + +ac_fn_c_check_member "$LINENO" "struct termios" "c_line" "ac_cv_member_struct_termios_c_line" " +#include +#include + +" +if test "x$ac_cv_member_struct_termios_c_line" = xyes; then : + $as_echo "#define TERMIOS_LDISC 1" >>confdefs.h + +fi + + + +ac_fn_c_check_member "$LINENO" "struct termio" "c_line" "ac_cv_member_struct_termio_c_line" " +#include +#include + +" +if test "x$ac_cv_member_struct_termio_c_line" = xyes; then : + $as_echo "#define TERMIO_LDISC 1" >>confdefs.h + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct dirent.d_ino" >&5 +$as_echo_n "checking for struct dirent.d_ino... " >&6; } +if ${bash_cv_dirent_has_dino+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif /* HAVE_UNISTD_H */ +#if defined(HAVE_DIRENT_H) +# include +#else +# define dirent direct +# ifdef HAVE_SYS_NDIR_H +# include +# endif /* SYSNDIR */ +# ifdef HAVE_SYS_DIR_H +# include +# endif /* SYSDIR */ +# ifdef HAVE_NDIR_H +# include +# endif +#endif /* HAVE_DIRENT_H */ + +int +main () +{ + +struct dirent d; int z; z = d.d_ino; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bash_cv_dirent_has_dino=yes +else + bash_cv_dirent_has_dino=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_dirent_has_dino" >&5 +$as_echo "$bash_cv_dirent_has_dino" >&6; } +if test $bash_cv_dirent_has_dino = yes; then +$as_echo "#define HAVE_STRUCT_DIRENT_D_INO 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct dirent.d_fileno" >&5 +$as_echo_n "checking for struct dirent.d_fileno... " >&6; } +if ${bash_cv_dirent_has_d_fileno+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif /* HAVE_UNISTD_H */ +#if defined(HAVE_DIRENT_H) +# include +#else +# define dirent direct +# ifdef HAVE_SYS_NDIR_H +# include +# endif /* SYSNDIR */ +# ifdef HAVE_SYS_DIR_H +# include +# endif /* SYSDIR */ +# ifdef HAVE_NDIR_H +# include +# endif +#endif /* HAVE_DIRENT_H */ + +int +main () +{ + +struct dirent d; int z; z = d.d_fileno; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bash_cv_dirent_has_d_fileno=yes +else + bash_cv_dirent_has_d_fileno=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_dirent_has_d_fileno" >&5 +$as_echo "$bash_cv_dirent_has_d_fileno" >&6; } +if test $bash_cv_dirent_has_d_fileno = yes; then +$as_echo "#define HAVE_STRUCT_DIRENT_D_FILENO 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct dirent.d_namlen" >&5 +$as_echo_n "checking for struct dirent.d_namlen... " >&6; } +if ${bash_cv_dirent_has_d_namlen+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif /* HAVE_UNISTD_H */ +#if defined(HAVE_DIRENT_H) +# include +#else +# define dirent direct +# ifdef HAVE_SYS_NDIR_H +# include +# endif /* SYSNDIR */ +# ifdef HAVE_SYS_DIR_H +# include +# endif /* SYSDIR */ +# ifdef HAVE_NDIR_H +# include +# endif +#endif /* HAVE_DIRENT_H */ + +int +main () +{ + +struct dirent d; int z; z = d.d_namlen; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bash_cv_dirent_has_d_namlen=yes +else + bash_cv_dirent_has_d_namlen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_dirent_has_d_namlen" >&5 +$as_echo "$bash_cv_dirent_has_d_namlen" >&6; } +if test $bash_cv_dirent_has_d_namlen = yes; then +$as_echo "#define HAVE_STRUCT_DIRENT_D_NAMLEN 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct winsize in sys/ioctl.h and termios.h" >&5 +$as_echo_n "checking for struct winsize in sys/ioctl.h and termios.h... " >&6; } +if ${bash_cv_struct_winsize_header+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +struct winsize x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bash_cv_struct_winsize_header=ioctl_h +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +struct winsize x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bash_cv_struct_winsize_header=termios_h +else + bash_cv_struct_winsize_header=other +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +if test $bash_cv_struct_winsize_header = ioctl_h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: sys/ioctl.h" >&5 +$as_echo "sys/ioctl.h" >&6; } + $as_echo "#define STRUCT_WINSIZE_IN_SYS_IOCTL 1" >>confdefs.h + +elif test $bash_cv_struct_winsize_header = termios_h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: termios.h" >&5 +$as_echo "termios.h" >&6; } + $as_echo "#define STRUCT_WINSIZE_IN_TERMIOS 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval in sys/time.h and time.h" >&5 +$as_echo_n "checking for struct timeval in sys/time.h and time.h... " >&6; } +if ${bash_cv_struct_timeval+:} false; then : + $as_echo_n "(cached) " >&6 +else + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "struct timeval" >/dev/null 2>&1; then : + bash_cv_struct_timeval=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "struct timeval" >/dev/null 2>&1; then : + bash_cv_struct_timeval=yes +else + bash_cv_struct_timeval=no +fi +rm -f conftest* + +fi +rm -f conftest* + + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_struct_timeval" >&5 +$as_echo "$bash_cv_struct_timeval" >&6; } +if test $bash_cv_struct_timeval = yes; then + $as_echo "#define HAVE_TIMEVAL 1" >>confdefs.h + +fi + +ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BLOCKS 1 +_ACEOF + + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if ${ac_cv_struct_tm+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main () +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_struct_tm=time.h +else + ac_cv_struct_tm=sys/time.h +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h + +fi + +ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include +#include <$ac_cv_struct_tm> + +" +if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_TM_TM_ZONE 1 +_ACEOF + + +fi + +if test "$ac_cv_member_struct_tm_tm_zone" = yes; then + +$as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h + +else + ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include +" +if test "x$ac_cv_have_decl_tzname" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_TZNAME $ac_have_decl +_ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 +$as_echo_n "checking for tzname... " >&6; } +if ${ac_cv_var_tzname+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#if !HAVE_DECL_TZNAME +extern char *tzname[]; +#endif + +int +main () +{ +return tzname[0][0]; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_var_tzname=yes +else + ac_cv_var_tzname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5 +$as_echo "$ac_cv_var_tzname" >&6; } + if test $ac_cv_var_tzname = yes; then + +$as_echo "#define HAVE_TZNAME 1" >>confdefs.h + + fi +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timezone in sys/time.h and time.h" >&5 +$as_echo_n "checking for struct timezone in sys/time.h and time.h... " >&6; } +if ${bash_cv_struct_timezone+:} false; then : + $as_echo_n "(cached) " >&6 +else + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "struct timezone" >/dev/null 2>&1; then : + bash_cv_struct_timezone=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "struct timezone" >/dev/null 2>&1; then : + bash_cv_struct_timezone=yes +else + bash_cv_struct_timezone=no +fi +rm -f conftest* + +fi +rm -f conftest* + + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_struct_timezone" >&5 +$as_echo "$bash_cv_struct_timezone" >&6; } +if test $bash_cv_struct_timezone = yes; then + $as_echo "#define HAVE_STRUCT_TIMEZONE 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for offset of exit status in return status from wait" >&5 +$as_echo_n "checking for offset of exit status in return status from wait... " >&6; } +if ${bash_cv_wexitstatus_offset+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check WEXITSTATUS offset if cross compiling -- defaulting to 0" >&5 +$as_echo "$as_me: WARNING: cannot check WEXITSTATUS offset if cross compiling -- defaulting to 0" >&2;} + bash_cv_wexitstatus_offset=0 + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +#include + +main(c, v) + int c; + char **v; +{ + pid_t pid, p; + int s, i, n; + + s = 0; + pid = fork(); + if (pid == 0) + exit (42); + + /* wait for the process */ + p = wait(&s); + if (p != pid) + exit (255); + + /* crack s */ + for (i = 0; i < (sizeof(s) - 8); i++) + { + n = (s >> i) & 0xff; + if (n == 42) + exit (i); + } + + exit (254); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_wexitstatus_offset=0 +else + bash_cv_wexitstatus_offset=$? +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +if test "$bash_cv_wexitstatus_offset" -gt 32 ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: bad exit status from test program -- defaulting to 0" >&5 +$as_echo "$as_me: WARNING: bad exit status from test program -- defaulting to 0" >&2;} + bash_cv_wexitstatus_offset=0 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_wexitstatus_offset" >&5 +$as_echo "$bash_cv_wexitstatus_offset" >&6; } + +cat >>confdefs.h <<_ACEOF +#define WEXITSTATUS_OFFSET $bash_cv_wexitstatus_offset +_ACEOF + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in " >&5 +$as_echo_n "checking for struct timespec in ... " >&6; } +if ${bash_cv_sys_struct_timespec_in_time_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bash_cv_sys_struct_timespec_in_time_h=yes +else + bash_cv_sys_struct_timespec_in_time_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_sys_struct_timespec_in_time_h" >&5 +$as_echo "$bash_cv_sys_struct_timespec_in_time_h" >&6; } + + HAVE_STRUCT_TIMESPEC=0 + TIME_H_DEFINES_STRUCT_TIMESPEC=0 + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 + PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0 + if test $bash_cv_sys_struct_timespec_in_time_h = yes; then + $as_echo "#define HAVE_STRUCT_TIMESPEC 1" >>confdefs.h + + $as_echo "#define TIME_H_DEFINES_STRUCT_TIMESPEC 1" >>confdefs.h + + TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in " >&5 +$as_echo_n "checking for struct timespec in ... " >&6; } +if ${bash_cv_sys_struct_timespec_in_sys_time_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bash_cv_sys_struct_timespec_in_sys_time_h=yes +else + bash_cv_sys_struct_timespec_in_sys_time_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_sys_struct_timespec_in_sys_time_h" >&5 +$as_echo "$bash_cv_sys_struct_timespec_in_sys_time_h" >&6; } + if test $bash_cv_sys_struct_timespec_in_sys_time_h = yes; then + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 + $as_echo "#define HAVE_STRUCT_TIMESPEC 1" >>confdefs.h + + $as_echo "#define SYS_TIME_H_DEFINES_STRUCT_TIMESPEC 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in " >&5 +$as_echo_n "checking for struct timespec in ... " >&6; } +if ${bash_cv_sys_struct_timespec_in_pthread_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +static struct timespec x; x.tv_sec = x.tv_nsec; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bash_cv_sys_struct_timespec_in_pthread_h=yes +else + bash_cv_sys_struct_timespec_in_pthread_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_sys_struct_timespec_in_pthread_h" >&5 +$as_echo "$bash_cv_sys_struct_timespec_in_pthread_h" >&6; } + if test $bash_cv_sys_struct_timespec_in_pthread_h = yes; then + PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1 + $as_echo "#define HAVE_STRUCT_TIMESPEC 1" >>confdefs.h + + $as_echo "#define PTHREAD_H_DEFINES_STRUCT_TIMESPEC 1" >>confdefs.h + + fi + fi + fi + + + + + + + + + + ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1 +_ACEOF + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5 +$as_echo_n "checking whether struct stat.st_atim is of type struct timespec... " >&6; } +if ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #if HAVE_SYS_TIME_H + # include + #endif + #include + struct timespec ts; + struct stat st; + +int +main () +{ + + st.st_atim = ts; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes +else + ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5 +$as_echo "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; } + if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then + +$as_echo "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h + + fi +else + ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1 +_ACEOF + + +else + ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1 +_ACEOF + + +else + ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.st__tim.tv_nsec" "ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" "#include + #include +" +if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1 +_ACEOF + + +fi + +fi + +fi + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the existence of strsignal" >&5 +$as_echo_n "checking for the existence of strsignal... " >&6; } +if ${bash_cv_have_strsignal+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +char *s = (char *)strsignal(2); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + bash_cv_have_strsignal=yes +else + bash_cv_have_strsignal=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_have_strsignal" >&5 +$as_echo "$bash_cv_have_strsignal" >&6; } +if test $bash_cv_have_strsignal = yes; then +$as_echo "#define HAVE_STRSIGNAL 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if opendir() opens non-directories" >&5 +$as_echo_n "checking if opendir() opens non-directories... " >&6; } +if ${bash_cv_opendir_not_robust+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check opendir if cross compiling -- defaulting to no" >&5 +$as_echo "$as_me: WARNING: cannot check opendir if cross compiling -- defaulting to no" >&2;} + bash_cv_opendir_not_robust=no + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif /* HAVE_UNISTD_H */ +#if defined(HAVE_DIRENT_H) +# include +#else +# define dirent direct +# ifdef HAVE_SYS_NDIR_H +# include +# endif /* SYSNDIR */ +# ifdef HAVE_SYS_DIR_H +# include +# endif /* SYSDIR */ +# ifdef HAVE_NDIR_H +# include +# endif +#endif /* HAVE_DIRENT_H */ +main() +{ +DIR *dir; +int fd, err; +err = mkdir("bash-aclocal", 0700); +if (err < 0) { + perror("mkdir"); + exit(1); +} +unlink("bash-aclocal/not_a_directory"); +fd = open("bash-aclocal/not_a_directory", O_WRONLY|O_CREAT|O_EXCL, 0666); +write(fd, "\n", 1); +close(fd); +dir = opendir("bash-aclocal/not_a_directory"); +unlink("bash-aclocal/not_a_directory"); +rmdir("bash-aclocal"); +exit (dir == 0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_opendir_not_robust=yes +else + bash_cv_opendir_not_robust=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_opendir_not_robust" >&5 +$as_echo "$bash_cv_opendir_not_robust" >&6; } +if test $bash_cv_opendir_not_robust = yes; then +$as_echo "#define OPENDIR_NOT_ROBUST 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ulimit can substitute for getdtablesize" >&5 +$as_echo_n "checking whether ulimit can substitute for getdtablesize... " >&6; } +if ${bash_cv_ulimit_maxfds+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check ulimit if cross compiling -- defaulting to no" >&5 +$as_echo "$as_me: WARNING: cannot check ulimit if cross compiling -- defaulting to no" >&2;} + bash_cv_ulimit_maxfds=no + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +main() +{ +long maxfds = ulimit(4, 0L); +exit (maxfds == -1L); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_ulimit_maxfds=yes +else + bash_cv_ulimit_maxfds=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_ulimit_maxfds" >&5 +$as_echo "$bash_cv_ulimit_maxfds" >&6; } +if test $bash_cv_ulimit_maxfds = yes; then +$as_echo "#define ULIMIT_MAXFDS 1" >>confdefs.h + +fi + + + + + + + + + ac_fn_c_check_decl "$LINENO" "fpurge" "ac_cv_have_decl_fpurge" "#include +" +if test "x$ac_cv_have_decl_fpurge" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPURGE $ac_have_decl +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if getenv can be redefined" >&5 +$as_echo_n "checking to see if getenv can be redefined... " >&6; } +if ${bash_cv_getenv_redef+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check getenv redefinition if cross compiling -- defaulting to yes" >&5 +$as_echo "$as_me: WARNING: cannot check getenv redefinition if cross compiling -- defaulting to yes" >&2;} + bash_cv_getenv_redef=yes + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_UNISTD_H +# include +#endif +#ifndef __STDC__ +# ifndef const +# define const +# endif +#endif +char * +getenv (name) +#if defined (__linux__) || defined (__bsdi__) || defined (convex) + const char *name; +#else + char const *name; +#endif /* !__linux__ && !__bsdi__ && !convex */ +{ +return "42"; +} +main() +{ +char *s; +/* The next allows this program to run, but does not allow bash to link + when it redefines getenv. I'm not really interested in figuring out + why not. */ +#if defined (NeXT) +exit(1); +#endif +s = getenv("ABCDE"); +exit(s == 0); /* force optimizer to leave getenv in */ +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_getenv_redef=yes +else + bash_cv_getenv_redef=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_getenv_redef" >&5 +$as_echo "$bash_cv_getenv_redef" >&6; } +if test $bash_cv_getenv_redef = yes; then +$as_echo "#define CAN_REDEFINE_GETENV 1" >>confdefs.h + +fi + +if test "$ac_cv_func_getcwd" = "yes"; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if getcwd() will dynamically allocate memory with 0 size" >&5 +$as_echo_n "checking if getcwd() will dynamically allocate memory with 0 size... " >&6; } +if ${bash_cv_getcwd_malloc+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check whether getcwd allocates memory when cross-compiling -- defaulting to no" >&5 +$as_echo "$as_me: WARNING: cannot check whether getcwd allocates memory when cross-compiling -- defaulting to no" >&2;} + bash_cv_getcwd_malloc=no + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +main() +{ + char *xpwd; + xpwd = getcwd(0, 0); + exit (xpwd == 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_getcwd_malloc=yes +else + bash_cv_getcwd_malloc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_getcwd_malloc" >&5 +$as_echo "$bash_cv_getcwd_malloc" >&6; } +if test $bash_cv_getcwd_malloc = no; then +$as_echo "#define GETCWD_BROKEN 1" >>confdefs.h + +case " $LIBOBJS " in + *" getcwd.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS getcwd.$ac_objext" + ;; +esac + +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5 +$as_echo_n "checking for presence of POSIX-style sigsetjmp/siglongjmp... " >&6; } +if ${bash_cv_func_sigsetjmp+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing" >&5 +$as_echo "$as_me: WARNING: cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing" >&2;} + bash_cv_func_sigsetjmp=missing + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#include +#include + +main() +{ +#if !defined (_POSIX_VERSION) || !defined (HAVE_POSIX_SIGNALS) +exit (1); +#else + +int code; +sigset_t set, oset; +sigjmp_buf xx; + +/* get the mask */ +sigemptyset(&set); +sigemptyset(&oset); +sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &set); +sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &oset); + +/* save it */ +code = sigsetjmp(xx, 1); +if (code) + exit(0); /* could get sigmask and compare to oset here. */ + +/* change it */ +sigaddset(&set, SIGINT); +sigprocmask(SIG_BLOCK, &set, (sigset_t *)NULL); + +/* and siglongjmp */ +siglongjmp(xx, 10); +exit(1); +#endif +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_func_sigsetjmp=present +else + bash_cv_func_sigsetjmp=missing +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_func_sigsetjmp" >&5 +$as_echo "$bash_cv_func_sigsetjmp" >&6; } +if test $bash_cv_func_sigsetjmp = present; then +$as_echo "#define HAVE_POSIX_SIGSETJMP 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether or not strcoll and strcmp differ" >&5 +$as_echo_n "checking whether or not strcoll and strcmp differ... " >&6; } +if ${bash_cv_func_strcoll_broken+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check strcoll if cross compiling -- defaulting to no" >&5 +$as_echo "$as_me: WARNING: cannot check strcoll if cross compiling -- defaulting to no" >&2;} + bash_cv_func_strcoll_broken=no + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if defined (HAVE_LOCALE_H) +#include +#endif + +main(c, v) +int c; +char *v[]; +{ + int r1, r2; + char *deflocale, *defcoll; + +#ifdef HAVE_SETLOCALE + deflocale = setlocale(LC_ALL, ""); + defcoll = setlocale(LC_COLLATE, ""); +#endif + +#ifdef HAVE_STRCOLL + /* These two values are taken from tests/glob-test. */ + r1 = strcoll("abd", "aXd"); +#else + r1 = 0; +#endif + r2 = strcmp("abd", "aXd"); + + /* These two should both be greater than 0. It is permissible for + a system to return different values, as long as the sign is the + same. */ + + /* Exit with 1 (failure) if these two values are both > 0, since + this tests whether strcoll(3) is broken with respect to strcmp(3) + in the default locale. */ + exit (r1 > 0 && r2 > 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_func_strcoll_broken=yes +else + bash_cv_func_strcoll_broken=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_func_strcoll_broken" >&5 +$as_echo "$bash_cv_func_strcoll_broken" >&6; } +if test $bash_cv_func_strcoll_broken = yes; then +$as_echo "#define STRCOLL_BROKEN 1" >>confdefs.h + +fi + + + + + + if test X$ac_cv_func_snprintf = Xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for standard-conformant snprintf" >&5 +$as_echo_n "checking for standard-conformant snprintf... " >&6; } +if ${bash_cv_func_snprintf+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check standard snprintf if cross-compiling" >&5 +$as_echo "$as_me: WARNING: cannot check standard snprintf if cross-compiling" >&2;} + bash_cv_func_snprintf=yes + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +main() +{ + int n; + n = snprintf (0, 0, "%s", "0123456"); + exit(n != 7); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_func_snprintf=yes +else + bash_cv_func_snprintf=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_func_snprintf" >&5 +$as_echo "$bash_cv_func_snprintf" >&6; } + if test $bash_cv_func_snprintf = no; then + ac_cv_func_snprintf=no + fi + fi + if test $ac_cv_func_snprintf = no; then + +$as_echo "#define HAVE_SNPRINTF 0" >>confdefs.h + + fi + + + + + + if test X$ac_cv_func_vsnprintf = Xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for standard-conformant vsnprintf" >&5 +$as_echo_n "checking for standard-conformant vsnprintf... " >&6; } +if ${bash_cv_func_vsnprintf+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check standard vsnprintf if cross-compiling" >&5 +$as_echo "$as_me: WARNING: cannot check standard vsnprintf if cross-compiling" >&2;} + bash_cv_func_vsnprintf=yes + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if HAVE_STDARG_H +#include +#else +#include +#endif +#include +#include + +static int +#if HAVE_STDARG_H +foo(const char *fmt, ...) +#else +foo(format, va_alist) + const char *format; + va_dcl +#endif +{ + va_list args; + int n; + +#if HAVE_STDARG_H + va_start(args, fmt); +#else + va_start(args); +#endif + n = vsnprintf(0, 0, fmt, args); + va_end (args); + return n; +} + +main() +{ + int n; + n = foo("%s", "0123456"); + exit(n != 7); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_func_vsnprintf=yes +else + bash_cv_func_vsnprintf=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_func_vsnprintf" >&5 +$as_echo "$bash_cv_func_vsnprintf" >&6; } + if test $bash_cv_func_vsnprintf = no; then + ac_cv_func_vsnprintf=no + fi + fi + if test $ac_cv_func_vsnprintf = no; then + +$as_echo "#define HAVE_VSNPRINTF 0" >>confdefs.h + + fi + + + +if test "$ac_cv_func_putenv" = "yes"; then + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for standard-conformant putenv declaration" >&5 +$as_echo_n "checking for standard-conformant putenv declaration... " >&6; } +if ${bash_cv_std_putenv+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if STDC_HEADERS +#include +#include +#endif +#ifndef __STDC__ +# ifndef const +# define const +# endif +#endif +#ifdef PROTOTYPES +extern int putenv (char *); +#else +extern int putenv (); +#endif + +int +main () +{ +return (putenv == 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + bash_cv_std_putenv=yes +else + bash_cv_std_putenv=no + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_std_putenv" >&5 +$as_echo "$bash_cv_std_putenv" >&6; } +if test $bash_cv_std_putenv = yes; then +$as_echo "#define HAVE_STD_PUTENV 1" >>confdefs.h + +fi + +else +$as_echo "#define HAVE_STD_PUTENV 1" >>confdefs.h + +fi +if test "$ac_cv_func_unsetenv" = "yes"; then + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for standard-conformant unsetenv declaration" >&5 +$as_echo_n "checking for standard-conformant unsetenv declaration... " >&6; } +if ${bash_cv_std_unsetenv+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if STDC_HEADERS +#include +#include +#endif +#ifndef __STDC__ +# ifndef const +# define const +# endif +#endif +#ifdef PROTOTYPES +extern int unsetenv (const char *); +#else +extern int unsetenv (); +#endif + +int +main () +{ +return (unsetenv == 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + bash_cv_std_unsetenv=yes +else + bash_cv_std_unsetenv=no + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_std_unsetenv" >&5 +$as_echo "$bash_cv_std_unsetenv" >&6; } +if test $bash_cv_std_unsetenv = yes; then +$as_echo "#define HAVE_STD_UNSETENV 1" >>confdefs.h + +fi + +else +$as_echo "#define HAVE_STD_UNSETENV 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for printf floating point output in hex notation" >&5 +$as_echo_n "checking for printf floating point output in hex notation... " >&6; } +if ${bash_cv_printf_a_format+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check printf if cross compiling -- defaulting to no" >&5 +$as_echo "$as_me: WARNING: cannot check printf if cross compiling -- defaulting to no" >&2;} + bash_cv_printf_a_format=no + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main() +{ + double y = 0.0; + char abuf[1024]; + + sprintf(abuf, "%A", y); + exit(strchr(abuf, 'P') == (char *)0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_printf_a_format=yes +else + bash_cv_printf_a_format=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_printf_a_format" >&5 +$as_echo "$bash_cv_printf_a_format" >&6; } +if test $bash_cv_printf_a_format = yes; then +$as_echo "#define HAVE_PRINTF_A_FORMAT 1" >>confdefs.h + +fi + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if signal handlers must be reinstalled when invoked" >&5 +$as_echo_n "checking if signal handlers must be reinstalled when invoked... " >&6; } +if ${bash_cv_must_reinstall_sighandlers+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check signal handling if cross compiling -- defaulting to no" >&5 +$as_echo "$as_me: WARNING: cannot check signal handling if cross compiling -- defaulting to no" >&2;} + bash_cv_must_reinstall_sighandlers=no + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +typedef RETSIGTYPE sigfunc(); + +int nsigint; + +#ifdef HAVE_POSIX_SIGNALS +sigfunc * +set_signal_handler(sig, handler) + int sig; + sigfunc *handler; +{ + struct sigaction act, oact; + act.sa_handler = handler; + act.sa_flags = 0; + sigemptyset (&act.sa_mask); + sigemptyset (&oact.sa_mask); + sigaction (sig, &act, &oact); + return (oact.sa_handler); +} +#else +#define set_signal_handler(s, h) signal(s, h) +#endif + +RETSIGTYPE +sigint(s) +int s; +{ + nsigint++; +} + +main() +{ + nsigint = 0; + set_signal_handler(SIGINT, sigint); + kill((int)getpid(), SIGINT); + kill((int)getpid(), SIGINT); + exit(nsigint != 2); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_must_reinstall_sighandlers=no +else + bash_cv_must_reinstall_sighandlers=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_must_reinstall_sighandlers" >&5 +$as_echo "$bash_cv_must_reinstall_sighandlers" >&6; } +if test $bash_cv_must_reinstall_sighandlers = yes; then +$as_echo "#define MUST_REINSTALL_SIGHANDLERS 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for presence of necessary job control definitions" >&5 +$as_echo_n "checking for presence of necessary job control definitions... " >&6; } +if ${bash_cv_job_control_missing+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check job control if cross-compiling -- defaulting to missing" >&5 +$as_echo "$as_me: WARNING: cannot check job control if cross-compiling -- defaulting to missing" >&2;} + bash_cv_job_control_missing=missing + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_SYS_WAIT_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#include + +/* Add more tests in here as appropriate. */ +main() +{ +/* signal type */ +#if !defined (HAVE_POSIX_SIGNALS) && !defined (HAVE_BSD_SIGNALS) +exit(1); +#endif + +/* signals and tty control. */ +#if !defined (SIGTSTP) || !defined (SIGSTOP) || !defined (SIGCONT) +exit (1); +#endif + +/* process control */ +#if !defined (WNOHANG) || !defined (WUNTRACED) +exit(1); +#endif + +/* Posix systems have tcgetpgrp and waitpid. */ +#if defined (_POSIX_VERSION) && !defined (HAVE_TCGETPGRP) +exit(1); +#endif + +#if defined (_POSIX_VERSION) && !defined (HAVE_WAITPID) +exit(1); +#endif + +/* Other systems have TIOCSPGRP/TIOCGPRGP and wait3. */ +#if !defined (_POSIX_VERSION) && !defined (HAVE_WAIT3) +exit(1); +#endif + +exit(0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_job_control_missing=present +else + bash_cv_job_control_missing=missing +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_job_control_missing" >&5 +$as_echo "$bash_cv_job_control_missing" >&6; } +if test $bash_cv_job_control_missing = missing; then +$as_echo "#define JOB_CONTROL_MISSING 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for presence of named pipes" >&5 +$as_echo_n "checking for presence of named pipes... " >&6; } +if ${bash_cv_sys_named_pipes+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check for named pipes if cross-compiling -- defaulting to missing" >&5 +$as_echo "$as_me: WARNING: cannot check for named pipes if cross-compiling -- defaulting to missing" >&2;} + bash_cv_sys_named_pipes=missing + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +/* Add more tests in here as appropriate. */ +main() +{ +int fd, err; + +#if defined (HAVE_MKFIFO) +exit (0); +#endif + +#if !defined (S_IFIFO) && (defined (_POSIX_VERSION) && !defined (S_ISFIFO)) +exit (1); +#endif + +#if defined (NeXT) +exit (1); +#endif +err = mkdir("bash-aclocal", 0700); +if (err < 0) { + perror ("mkdir"); + exit(1); +} +fd = mknod ("bash-aclocal/sh-np-autoconf", 0666 | S_IFIFO, 0); +if (fd == -1) { + rmdir ("bash-aclocal"); + exit (1); +} +close(fd); +unlink ("bash-aclocal/sh-np-autoconf"); +rmdir ("bash-aclocal"); +exit(0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_sys_named_pipes=present +else + bash_cv_sys_named_pipes=missing +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_sys_named_pipes" >&5 +$as_echo "$bash_cv_sys_named_pipes" >&6; } +if test $bash_cv_sys_named_pipes = missing; then +$as_echo "#define NAMED_PIPES_MISSING 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether termios.h defines TIOCGWINSZ" >&5 +$as_echo_n "checking whether termios.h defines TIOCGWINSZ... " >&6; } +if ${ac_cv_sys_tiocgwinsz_in_termios_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#ifdef TIOCGWINSZ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + ac_cv_sys_tiocgwinsz_in_termios_h=yes +else + ac_cv_sys_tiocgwinsz_in_termios_h=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_tiocgwinsz_in_termios_h" >&5 +$as_echo "$ac_cv_sys_tiocgwinsz_in_termios_h" >&6; } + +if test $ac_cv_sys_tiocgwinsz_in_termios_h != yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/ioctl.h defines TIOCGWINSZ" >&5 +$as_echo_n "checking whether sys/ioctl.h defines TIOCGWINSZ... " >&6; } +if ${ac_cv_sys_tiocgwinsz_in_sys_ioctl_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#ifdef TIOCGWINSZ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=yes +else + ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&5 +$as_echo "$ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&6; } + + if test $ac_cv_sys_tiocgwinsz_in_sys_ioctl_h = yes; then + +$as_echo "#define GWINSZ_IN_SYS_IOCTL 1" >>confdefs.h + + fi +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIOCSTAT in sys/ioctl.h" >&5 +$as_echo_n "checking for TIOCSTAT in sys/ioctl.h... " >&6; } +if ${bash_cv_tiocstat_in_ioctl+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +int x = TIOCSTAT; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bash_cv_tiocstat_in_ioctl=yes +else + bash_cv_tiocstat_in_ioctl=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_tiocstat_in_ioctl" >&5 +$as_echo "$bash_cv_tiocstat_in_ioctl" >&6; } +if test $bash_cv_tiocstat_in_ioctl = yes; then +$as_echo "#define TIOCSTAT_IN_SYS_IOCTL 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FIONREAD in sys/ioctl.h" >&5 +$as_echo_n "checking for FIONREAD in sys/ioctl.h... " >&6; } +if ${bash_cv_fionread_in_ioctl+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +int x = FIONREAD; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bash_cv_fionread_in_ioctl=yes +else + bash_cv_fionread_in_ioctl=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_fionread_in_ioctl" >&5 +$as_echo "$bash_cv_fionread_in_ioctl" >&6; } +if test $bash_cv_fionread_in_ioctl = yes; then +$as_echo "#define FIONREAD_IN_SYS_IOCTL 1" >>confdefs.h + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether WCONTINUED flag to waitpid is unavailable or available but broken" >&5 +$as_echo_n "checking whether WCONTINUED flag to waitpid is unavailable or available but broken... " >&6; } +if ${bash_cv_wcontinued_broken+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check WCONTINUED if cross compiling -- defaulting to no" >&5 +$as_echo "$as_me: WARNING: cannot check WCONTINUED if cross compiling -- defaulting to no" >&2;} + bash_cv_wcontinued_broken=no + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include + +#ifndef errno +extern int errno; +#endif +main() +{ + int x; + + x = waitpid(-1, (int *)0, WNOHANG|WCONTINUED); + if (x == -1 && errno == EINVAL) + exit (1); + else + exit (0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_wcontinued_broken=no +else + bash_cv_wcontinued_broken=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_wcontinued_broken" >&5 +$as_echo "$bash_cv_wcontinued_broken" >&6; } +if test $bash_cv_wcontinued_broken = yes; then +$as_echo "#define WCONTINUED_BROKEN 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for speed_t in sys/types.h" >&5 +$as_echo_n "checking for speed_t in sys/types.h... " >&6; } +if ${bash_cv_speed_t_in_sys_types+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +speed_t x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bash_cv_speed_t_in_sys_types=yes +else + bash_cv_speed_t_in_sys_types=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_speed_t_in_sys_types" >&5 +$as_echo "$bash_cv_speed_t_in_sys_types" >&6; } +if test $bash_cv_speed_t_in_sys_types = yes; then +$as_echo "#define SPEED_T_IN_SYS_TYPES 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getpw functions are declared in pwd.h" >&5 +$as_echo_n "checking whether getpw functions are declared in pwd.h... " >&6; } +if ${bash_cv_getpw_declared+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_UNISTD_H +# include +#endif +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "getpwuid" >/dev/null 2>&1; then : + bash_cv_getpw_declared=yes +else + bash_cv_getpw_declared=no +fi +rm -f conftest* + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_getpw_declared" >&5 +$as_echo "$bash_cv_getpw_declared" >&6; } +if test $bash_cv_getpw_declared = yes; then +$as_echo "#define HAVE_GETPW_DECLS 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for unusable real-time signals due to large values" >&5 +$as_echo_n "checking for unusable real-time signals due to large values... " >&6; } +if ${bash_cv_unusable_rtsigs+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check real-time signals if cross compiling -- defaulting to yes" >&5 +$as_echo "$as_me: WARNING: cannot check real-time signals if cross compiling -- defaulting to yes" >&2;} + bash_cv_unusable_rtsigs=yes + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +#ifndef NSIG +# define NSIG 64 +#endif + +main () +{ + int n_sigs = 2 * NSIG; +#ifdef SIGRTMIN + int rtmin = SIGRTMIN; +#else + int rtmin = 0; +#endif + + exit(rtmin < n_sigs); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_unusable_rtsigs=yes +else + bash_cv_unusable_rtsigs=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_unusable_rtsigs" >&5 +$as_echo "$bash_cv_unusable_rtsigs" >&6; } +if test $bash_cv_unusable_rtsigs = yes; then +$as_echo "#define UNUSABLE_RT_SIGNALS 1" >>confdefs.h + +fi + + + + + +if test "$bash_cv_sys_siglist" = no && test "$bash_cv_under_sys_siglist" = no && test "$bash_cv_have_strsignal" = no; then + SIGLIST_O=siglist.o +else + SIGLIST_O= +fi + + + +case "$host_os" in +hpux*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $host_os needs _KERNEL for RLIMIT defines" >&5 +$as_echo_n "checking whether $host_os needs _KERNEL for RLIMIT defines... " >&6; } +if ${bash_cv_kernel_rlimit+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main () +{ + + int f; + f = RLIMIT_DATA; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bash_cv_kernel_rlimit=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#define _KERNEL +#include +#undef _KERNEL + +int +main () +{ + + int f; + f = RLIMIT_DATA; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bash_cv_kernel_rlimit=yes +else + bash_cv_kernel_rlimit=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_kernel_rlimit" >&5 +$as_echo "$bash_cv_kernel_rlimit" >&6; } +if test $bash_cv_kernel_rlimit = yes; then +$as_echo "#define RLIMIT_NEEDS_KERNEL 1" >>confdefs.h + +fi + ;; +esac + +if test "$opt_readline" = yes; then +case "$host_os" in +aix*) prefer_curses=yes ;; +esac + +if test "X$bash_cv_termcap_lib" = "X"; then +_bash_needmsg=yes +else +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which library has the termcap functions" >&5 +$as_echo_n "checking which library has the termcap functions... " >&6; } +_bash_needmsg= +fi +if ${bash_cv_termcap_lib+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_fn_c_check_func "$LINENO" "tgetent" "ac_cv_func_tgetent" +if test "x$ac_cv_func_tgetent" = xyes; then : + bash_cv_termcap_lib=libc +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltermcap" >&5 +$as_echo_n "checking for tgetent in -ltermcap... " >&6; } +if ${ac_cv_lib_termcap_tgetent+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltermcap $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (); +int +main () +{ +return tgetent (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_termcap_tgetent=yes +else + ac_cv_lib_termcap_tgetent=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_termcap_tgetent" >&5 +$as_echo "$ac_cv_lib_termcap_tgetent" >&6; } +if test "x$ac_cv_lib_termcap_tgetent" = xyes; then : + bash_cv_termcap_lib=libtermcap +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltinfo" >&5 +$as_echo_n "checking for tgetent in -ltinfo... " >&6; } +if ${ac_cv_lib_tinfo_tgetent+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltinfo $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (); +int +main () +{ +return tgetent (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_tinfo_tgetent=yes +else + ac_cv_lib_tinfo_tgetent=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfo_tgetent" >&5 +$as_echo "$ac_cv_lib_tinfo_tgetent" >&6; } +if test "x$ac_cv_lib_tinfo_tgetent" = xyes; then : + bash_cv_termcap_lib=libtinfo +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lcurses" >&5 +$as_echo_n "checking for tgetent in -lcurses... " >&6; } +if ${ac_cv_lib_curses_tgetent+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcurses $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (); +int +main () +{ +return tgetent (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_curses_tgetent=yes +else + ac_cv_lib_curses_tgetent=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_tgetent" >&5 +$as_echo "$ac_cv_lib_curses_tgetent" >&6; } +if test "x$ac_cv_lib_curses_tgetent" = xyes; then : + bash_cv_termcap_lib=libcurses +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lncurses" >&5 +$as_echo_n "checking for tgetent in -lncurses... " >&6; } +if ${ac_cv_lib_ncurses_tgetent+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lncurses $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (); +int +main () +{ +return tgetent (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ncurses_tgetent=yes +else + ac_cv_lib_ncurses_tgetent=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_tgetent" >&5 +$as_echo "$ac_cv_lib_ncurses_tgetent" >&6; } +if test "x$ac_cv_lib_ncurses_tgetent" = xyes; then : + bash_cv_termcap_lib=libncurses +else + bash_cv_termcap_lib=gnutermcap +fi + +fi + +fi + +fi + +fi + +fi + +if test "X$_bash_needmsg" = "Xyes"; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which library has the termcap functions" >&5 +$as_echo_n "checking which library has the termcap functions... " >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using $bash_cv_termcap_lib" >&5 +$as_echo "using $bash_cv_termcap_lib" >&6; } +if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then +LDFLAGS="$LDFLAGS -L./lib/termcap" +TERMCAP_LIB="./lib/termcap/libtermcap.a" +TERMCAP_DEP="./lib/termcap/libtermcap.a" +elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then +TERMCAP_LIB=-ltermcap +TERMCAP_DEP= +elif test $bash_cv_termcap_lib = libtinfo; then +TERMCAP_LIB=-ltinfo +TERMCAP_DEP= +elif test $bash_cv_termcap_lib = libncurses; then +TERMCAP_LIB=-lncurses +TERMCAP_DEP= +elif test $bash_cv_termcap_lib = libc; then +TERMCAP_LIB= +TERMCAP_DEP= +else +TERMCAP_LIB=-lcurses +TERMCAP_DEP= +fi + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether /dev/fd is available" >&5 +$as_echo_n "checking whether /dev/fd is available... " >&6; } +if ${bash_cv_dev_fd+:} false; then : + $as_echo_n "(cached) " >&6 +else + bash_cv_dev_fd="" +if test -d /dev/fd && (exec test -r /dev/fd/0 < /dev/null) ; then +# check for systems like FreeBSD 5 that only provide /dev/fd/[012] + if (exec test -r /dev/fd/3 3&5 +$as_echo "$bash_cv_dev_fd" >&6; } +if test $bash_cv_dev_fd = "standard"; then + $as_echo "#define HAVE_DEV_FD 1" >>confdefs.h + + $as_echo "#define DEV_FD_PREFIX \"/dev/fd/\"" >>confdefs.h + +elif test $bash_cv_dev_fd = "whacky"; then + $as_echo "#define HAVE_DEV_FD 1" >>confdefs.h + + $as_echo "#define DEV_FD_PREFIX \"/proc/self/fd/\"" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether /dev/stdin stdout stderr are available" >&5 +$as_echo_n "checking whether /dev/stdin stdout stderr are available... " >&6; } +if ${bash_cv_dev_stdin+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -d /dev/fd && (exec test -r /dev/stdin < /dev/null) ; then + bash_cv_dev_stdin=present + elif test -d /proc/self/fd && (exec test -r /dev/stdin < /dev/null) ; then + bash_cv_dev_stdin=present + else + bash_cv_dev_stdin=absent + fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_dev_stdin" >&5 +$as_echo "$bash_cv_dev_stdin" >&6; } +if test $bash_cv_dev_stdin = "present"; then + $as_echo "#define HAVE_DEV_STDIN 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for default mail directory" >&5 +$as_echo_n "checking for default mail directory... " >&6; } +if ${bash_cv_mail_dir+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -d /var/mail; then + bash_cv_mail_dir=/var/mail + elif test -d /var/spool/mail; then + bash_cv_mail_dir=/var/spool/mail + elif test -d /usr/mail; then + bash_cv_mail_dir=/usr/mail + elif test -d /usr/spool/mail; then + bash_cv_mail_dir=/usr/spool/mail + else + bash_cv_mail_dir=unknown + fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_mail_dir" >&5 +$as_echo "$bash_cv_mail_dir" >&6; } +cat >>confdefs.h <<_ACEOF +#define DEFAULT_MAIL_DIRECTORY "$bash_cv_mail_dir" +_ACEOF + + + +if test "$bash_cv_job_control_missing" = missing; then + opt_job_control=no +fi + +if test "$opt_job_control" = yes; then +$as_echo "#define JOB_CONTROL 1" >>confdefs.h + +JOBS_O=jobs.o +else +JOBS_O=nojobs.o +fi + + + + +LOCAL_DEFS=-DSHELL + + +case "${host_os}" in +sysv4.2*) $as_echo "#define SVR4_2 1" >>confdefs.h + + $as_echo "#define SVR4 1" >>confdefs.h + ;; +sysv4*) $as_echo "#define SVR4 1" >>confdefs.h + ;; +sysv5*) $as_echo "#define SVR5 1" >>confdefs.h + ;; +hpux9*) LOCAL_CFLAGS="-DHPUX9 -DHPUX" ;; +hpux*) LOCAL_CFLAGS=-DHPUX ;; +dgux*) LOCAL_CFLAGS=-D_DGUX_SOURCE; LOCAL_LIBS=-ldgc ;; +isc*) LOCAL_CFLAGS=-Disc386 ;; +rhapsody*) LOCAL_CFLAGS=-DRHAPSODY ;; +darwin*) LOCAL_CFLAGS=-DMACOSX ;; +sco3.2v5*) LOCAL_CFLAGS="-b elf -DWAITPID_BROKEN -DPATH_MAX=1024" ;; +sco3.2v4*) LOCAL_CFLAGS="-DMUST_UNBLOCK_CHLD -DPATH_MAX=1024" ;; +sco3.2*) LOCAL_CFLAGS=-DMUST_UNBLOCK_CHLD ;; +sunos4*) LOCAL_CFLAGS=-DSunOS4 ;; +solaris2.5*) LOCAL_CFLAGS="-DSunOS5 -DSOLARIS" ;; +solaris2.8*) LOCAL_CFLAGS=-DSOLARIS ;; +solaris2.9*) LOCAL_CFLAGS=-DSOLARIS ;; +solaris2.10*) LOCAL_CFLAGS=-DSOLARIS ;; +solaris2*) LOCAL_CFLAGS=-DSOLARIS ;; +lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; +linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading + case "`uname -r`" in + 2.[456789]*|3*) $as_echo "#define PGRP_PIPE 1" >>confdefs.h + ;; + esac ;; +*qnx6*) LOCAL_CFLAGS="-Dqnx -Dqnx6" LOCAL_LIBS="-lncurses" ;; +*qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;; +powerux*) LOCAL_LIBS="-lgen" ;; +cygwin*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; +opennt*|interix*) LOCAL_CFLAGS="-DNO_MAIN_ENV_ARG -DBROKEN_DIRENT_D_INO -D_POSIX_SOURCE -D_ALL_SOURCE -DRECYCLES_PIDS" ;; +*openstep*) LOCAL_CFLAGS="-D__APPLE_CC__" ;; +esac + +case "${host_os}-${CC}" in +aix4.2*-*gcc*) LOCAL_LDFLAGS="-Xlinker -bexpall -Xlinker -brtl" ;; +aix4.2*) LOCAL_LDFLAGS="-bexpall -brtl" ;; +bsdi4*-*gcc*) LOCAL_LDFLAGS="-rdynamic" ;; # allow dynamic loading, like Linux +esac + +case "${host_os}" in +freebsd[3-9]*) + if test -x /usr/bin/objformat && test "`/usr/bin/objformat`" = "elf" ; then + LOCAL_LDFLAGS=-rdynamic # allow dynamic loading + fi ;; +freebsdelf*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading +dragonfly*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading +esac + +case "$host_cpu" in +*cray*) LOCAL_CFLAGS="-DCRAY" ;; # shell var so config.h can use it +esac + +case "$host_cpu-$host_os" in +ibmrt-*bsd4*) LOCAL_CFLAGS="-ma -U__STDC__" ;; +esac + +case "$host_cpu-$host_vendor-$host_os" in +m88k-motorola-sysv3) LOCAL_CFLAGS=-DWAITPID_BROKEN ;; +mips-pyramid-sysv4) LOCAL_CFLAGS=-Xa ;; +esac + +# +# Shared object configuration section. These values are generated by +# ${srcdir}/support/shobj-conf +# +if test "$ac_cv_func_dlopen" = "yes" && test -f ${srcdir}/support/shobj-conf +then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking shared object configuration for loadable builtins" >&5 +$as_echo_n "checking shared object configuration for loadable builtins... " >&6; } + eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c "${host_cpu}" -o "${host_os}" -v "${host_vendor}"` + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHOBJ_STATUS" >&5 +$as_echo "$SHOBJ_STATUS" >&6; } +fi + +# try to create a directory tree if the source is elsewhere +# this should be packaged into a script accessible via ${srcdir}/support +case "$srcdir" in +.) ;; +*) for d in doc tests support lib examples; do # dirs + test -d $d || mkdir $d + done + for ld in readline glob tilde malloc sh termcap; do # libdirs + test -d lib/$ld || mkdir lib/$ld + done + test -d examples/loadables || mkdir examples/loadables # loadable builtins + test -d examples/loadables/perl || mkdir examples/loadables/perl + ;; +esac + +BUILD_DIR=`pwd` +case "$BUILD_DIR" in +*\ *) BUILD_DIR=`echo "$BUILD_DIR" | sed 's: :\\\\ :g'` ;; +*) ;; +esac + +if test -z "$localedir"; then + localedir='${datarootdir}/locale' +fi +if test -z "$datarootdir"; then + datarootdir='${prefix}/share' +fi + + + + + + +# Some versions of autoconf don't substitute these automatically + + + + + + + + + + + + + + + + + + + + + +#AC_SUBST(ALLOCA_SOURCE) +#AC_SUBST(ALLOCA_OBJECT) + +ac_config_files="$ac_config_files Makefile builtins/Makefile lib/readline/Makefile lib/glob/Makefile lib/intl/Makefile lib/malloc/Makefile lib/sh/Makefile lib/termcap/Makefile lib/tilde/Makefile doc/Makefile support/Makefile po/Makefile.in examples/loadables/Makefile examples/loadables/perl/Makefile" + +ac_config_commands="$ac_config_commands default" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by bash $as_me 4.3-release, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +bash config.status 4.3-release +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it + # from automake. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "builtins/Makefile") CONFIG_FILES="$CONFIG_FILES builtins/Makefile" ;; + "lib/readline/Makefile") CONFIG_FILES="$CONFIG_FILES lib/readline/Makefile" ;; + "lib/glob/Makefile") CONFIG_FILES="$CONFIG_FILES lib/glob/Makefile" ;; + "lib/intl/Makefile") CONFIG_FILES="$CONFIG_FILES lib/intl/Makefile" ;; + "lib/malloc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/malloc/Makefile" ;; + "lib/sh/Makefile") CONFIG_FILES="$CONFIG_FILES lib/sh/Makefile" ;; + "lib/termcap/Makefile") CONFIG_FILES="$CONFIG_FILES lib/termcap/Makefile" ;; + "lib/tilde/Makefile") CONFIG_FILES="$CONFIG_FILES lib/tilde/Makefile" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "support/Makefile") CONFIG_FILES="$CONFIG_FILES support/Makefile" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + "examples/loadables/Makefile") CONFIG_FILES="$CONFIG_FILES examples/loadables/Makefile" ;; + "examples/loadables/perl/Makefile") CONFIG_FILES="$CONFIG_FILES examples/loadables/perl/Makefile" ;; + "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "default-1":C) + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + GMOFILES= + UPDATEPOFILES= + DUMMYPOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done ;; + "default":C) +# Makefile uses this timestamp file to record whether config.h is up to date. +echo timestamp > stamp-h + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..97e8e04 --- /dev/null +++ b/configure.ac @@ -0,0 +1,1212 @@ +dnl +dnl Configure script for bash-4.3 +dnl +dnl report bugs to chet@po.cwru.edu +dnl +dnl Process this file with autoconf to produce a configure script. + +# Copyright (C) 1987-2013 Free Software Foundation, Inc. + +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +AC_REVISION([for Bash 4.3, version 4.063])dnl + +define(bashvers, 4.3) +define(relstatus, release) + +AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org]) + +dnl make sure we are using a recent autoconf version +AC_PREREQ(2.61) + +AC_CONFIG_SRCDIR(shell.h) +dnl where to find install.sh, config.sub, and config.guess +AC_CONFIG_AUX_DIR(./support) +AC_CONFIG_HEADERS(config.h) + +dnl checks for version info +BASHVERS=bashvers +RELSTATUS=relstatus + +dnl defaults for debug settings +case "$RELSTATUS" in +alp*|bet*|dev*|rc*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;; +*) DEBUG= MALLOC_DEBUG= ;; +esac + +dnl canonicalize the host and os so we can do some tricky things before +dnl parsing options +AC_CANONICAL_HOST +AC_CANONICAL_BUILD + +dnl configure defaults +opt_bash_malloc=yes +opt_purify=no +opt_purecov=no +opt_afs=no +opt_curses=no +opt_with_installed_readline=no + +#htmldir= + +dnl some systems should be configured without the bash malloc by default +dnl and some need a special compiler or loader +dnl look in the NOTES file for more +case "${host_cpu}-${host_os}" in +alpha*-*) opt_bash_malloc=no ;; # alpha running osf/1 or linux +*[[Cc]]ray*-*) opt_bash_malloc=no ;; # Crays +*-osf1*) opt_bash_malloc=no ;; # other osf/1 machines +sparc-svr4*) opt_bash_malloc=no ;; # sparc SVR4, SVR4.2 +sparc-netbsd*) opt_bash_malloc=no ;; # needs 8-byte alignment +mips-irix6*) opt_bash_malloc=no ;; # needs 8-byte alignment +m68k-sysv) opt_bash_malloc=no ;; # fixes file descriptor leak in closedir +sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF +#*-freebsd*-gnu) opt_bash_malloc=no ;; # there's some undetermined problem here +#*-freebsd*) opt_bash_malloc=no ;; # they claim it's better; I disagree +*-openbsd*) opt_bash_malloc=no ;; # they claim it needs eight-bit alignment +*-mirbsd*) opt_bash_malloc=no ;; # they claim it needs eight-bit alignment +*-aix*) opt_bash_malloc=no ;; # AIX machines +*-nextstep*) opt_bash_malloc=no ;; # NeXT machines running NeXTstep +*-openstep*) opt_bash_malloc=no ;; # i386/Sparc/HP machines running Openstep +*-macos*) opt_bash_malloc=no ;; # Apple MacOS X +*-rhapsody*) opt_bash_malloc=no ;; # Apple Rhapsody (MacOS X) +*-darwin*) opt_bash_malloc=no ;; # Apple Darwin (MacOS X) +*-dgux*) opt_bash_malloc=no ;; # DG/UX machines +*-qnx*) opt_bash_malloc=no ;; # QNX 4.2, QNX 6.x +*-machten4) opt_bash_malloc=no ;; # MachTen 4.x +*-bsdi2.1|*-bsdi3.?) opt_bash_malloc=no ; : ${CC:=shlicc2} ;; # for loadable builtins +*-beos*) opt_bash_malloc=no ;; # they say it's suitable +*-cygwin*) opt_bash_malloc=no ;; # Cygnus's CYGWIN environment +*-opennt*|*-interix*) opt_bash_malloc=no ;; # Interix, now owned by Microsoft +*-nsk*) opt_bash_malloc=no ;; # HP NonStop +*-haiku*) opt_bash_malloc=no ;; # Haiku OS +esac + +# memory scrambling on free() +case "${host_os}" in +sco3.2v5*|sco3.2v4*) opt_memscramble=no ;; +*) opt_memscramble=yes ;; +esac + +dnl +dnl macros for the bash debugger +dnl +dnl AM_PATH_LISPDIR +AC_ARG_VAR(DEBUGGER_START_FILE, [location of bash debugger initialization file]) + +dnl arguments to configure +dnl packages +AC_ARG_WITH(afs, AC_HELP_STRING([--with-afs], [if you are running AFS]), opt_afs=$withval) +AC_ARG_WITH(bash-malloc, AC_HELP_STRING([--with-bash-malloc], [use the Bash version of malloc]), opt_bash_malloc=$withval) +AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval) +AC_ARG_WITH(gnu-malloc, AC_HELP_STRING([--with-gnu-malloc], [synonym for --with-bash-malloc]), opt_bash_malloc=$withval) +AC_ARG_WITH(installed-readline, AC_HELP_STRING([--with-installed-readline], [use a version of the readline library that is already installed]), opt_with_installed_readline=$withval) +AC_ARG_WITH(purecov, AC_HELP_STRING([--with-purecov], [configure to postprocess with pure coverage]), opt_purecov=$withval) +AC_ARG_WITH(purify, AC_HELP_STRING([--with-purify], [configure to postprocess with purify]), opt_purify=$withval) + +if test "$opt_bash_malloc" = yes; then + MALLOC_TARGET=malloc + MALLOC_SRC=malloc.c + + MALLOC_LIB='-lmalloc' + MALLOC_LIBRARY='$(ALLOC_LIBDIR)/libmalloc.a' + MALLOC_LDFLAGS='-L$(ALLOC_LIBDIR)' + MALLOC_DEP='$(MALLOC_LIBRARY)' + + AC_DEFINE(USING_BASH_MALLOC) +else + MALLOC_LIB= + MALLOC_LIBRARY= + MALLOC_LDFLAGS= + MALLOC_DEP= +fi + +if test "$opt_purify" = yes; then + PURIFY="purify " + AC_DEFINE(DISABLE_MALLOC_WRAPPERS) +else + PURIFY= +fi + +if test "$opt_purecov" = yes; then + PURIFY="${PURIFY}purecov" +fi + +if test "$opt_afs" = yes; then + AC_DEFINE(AFS) +fi + +if test "$opt_curses" = yes; then + prefer_curses=yes +fi + +if test -z "${DEBUGGER_START_FILE}"; then + DEBUGGER_START_FILE='${datadir}/bashdb/bashdb-main.inc' +fi + +dnl optional shell features in config.h.in +opt_minimal_config=no + +opt_job_control=yes +opt_alias=yes +opt_readline=yes +opt_history=yes +opt_bang_history=yes +opt_dirstack=yes +opt_restricted=yes +opt_process_subst=yes +opt_prompt_decoding=yes +opt_select=yes +opt_help=yes +opt_array_variables=yes +opt_dparen_arith=yes +opt_extended_glob=yes +opt_brace_expansion=yes +opt_disabled_builtins=no +opt_command_timing=yes +opt_xpg_echo=no +opt_strict_posix=no +opt_cond_command=yes +opt_cond_regexp=yes +opt_coproc=yes +opt_arith_for_command=yes +opt_net_redirs=yes +opt_progcomp=yes +opt_separate_help=no +opt_multibyte=yes +opt_debugger=yes +opt_single_longdoc_strings=yes +opt_casemod_attrs=yes +opt_casemod_expansions=yes +opt_extglob_default=no +opt_dircomplete_expand_default=no +opt_globascii_default=no + +dnl options that affect how bash is compiled and linked +opt_static_link=no +opt_profiling=no + +dnl argument parsing for optional features +AC_ARG_ENABLE(minimal-config, AC_HELP_STRING([--enable-minimal-config], [a minimal sh-like configuration]), opt_minimal_config=$enableval) + +dnl a minimal configuration turns everything off, but features can be +dnl added individually +if test $opt_minimal_config = yes; then + opt_job_control=no opt_alias=no opt_readline=no + opt_history=no opt_bang_history=no opt_dirstack=no + opt_restricted=no opt_process_subst=no opt_prompt_decoding=no + opt_select=no opt_help=no opt_array_variables=no opt_dparen_arith=no + opt_brace_expansion=no opt_disabled_builtins=no opt_command_timing=no + opt_extended_glob=no opt_cond_command=no opt_arith_for_command=no + opt_net_redirs=no opt_progcomp=no opt_separate_help=no + opt_multibyte=yes opt_cond_regexp=no opt_coproc=no + opt_casemod_attrs=no opt_casemod_expansions=no opt_extglob_default=no + opt_globascii_default=no +fi + +AC_ARG_ENABLE(alias, AC_HELP_STRING([--enable-alias], [enable shell aliases]), opt_alias=$enableval) +AC_ARG_ENABLE(arith-for-command, AC_HELP_STRING([--enable-arith-for-command], [enable arithmetic for command]), opt_arith_for_command=$enableval) +AC_ARG_ENABLE(array-variables, AC_HELP_STRING([--enable-array-variables], [include shell array variables]), opt_array_variables=$enableval) +AC_ARG_ENABLE(bang-history, AC_HELP_STRING([--enable-bang-history], [turn on csh-style history substitution]), opt_bang_history=$enableval) +AC_ARG_ENABLE(brace-expansion, AC_HELP_STRING([--enable-brace-expansion], [include brace expansion]), opt_brace_expansion=$enableval) +AC_ARG_ENABLE(casemod-attributes, AC_HELP_STRING([--enable-casemod-attributes], [include case-modifying variable attributes]), opt_casemod_attrs=$enableval) +AC_ARG_ENABLE(casemod-expansions, AC_HELP_STRING([--enable-casemod-expansions], [include case-modifying word expansions]), opt_casemod_expansions=$enableval) +AC_ARG_ENABLE(command-timing, AC_HELP_STRING([--enable-command-timing], [enable the time reserved word and command timing]), opt_command_timing=$enableval) +AC_ARG_ENABLE(cond-command, AC_HELP_STRING([--enable-cond-command], [enable the conditional command]), opt_cond_command=$enableval) +AC_ARG_ENABLE(cond-regexp, AC_HELP_STRING([--enable-cond-regexp], [enable extended regular expression matching in conditional commands]), opt_cond_regexp=$enableval) +AC_ARG_ENABLE(coprocesses, AC_HELP_STRING([--enable-coprocesses], [enable coprocess support and the coproc reserved word]), opt_coproc=$enableval) +AC_ARG_ENABLE(debugger, AC_HELP_STRING([--enable-debugger], [enable support for bash debugger]), opt_debugger=$enableval) +AC_ARG_ENABLE(direxpand-default, AC_HELP_STRING([--enable-direxpand-default], [enable the direxpand shell option by default]), opt_dircomplete_expand_default=$enableval) +AC_ARG_ENABLE(directory-stack, AC_HELP_STRING([--enable-directory-stack], [enable builtins pushd/popd/dirs]), opt_dirstack=$enableval) +AC_ARG_ENABLE(disabled-builtins, AC_HELP_STRING([--enable-disabled-builtins], [allow disabled builtins to still be invoked]), opt_disabled_builtins=$enableval) +AC_ARG_ENABLE(dparen-arithmetic, AC_HELP_STRING([--enable-dparen-arithmetic], [include ((...)) command]), opt_dparen_arith=$enableval) +AC_ARG_ENABLE(extended-glob, AC_HELP_STRING([--enable-extended-glob], [include ksh-style extended pattern matching]), opt_extended_glob=$enableval) +AC_ARG_ENABLE(extended-glob-default, AC_HELP_STRING([--enable-extended-glob-default], [force extended pattern matching to be enabled by default]), opt_extglob_default=$enableval) +AC_ARG_ENABLE(glob-asciiranges-default, AC_HELP_STRING([--enable-glob-asciiranges-default], [force bracket range expressions in pattern matching to use the C locale by default]), opt_globascii_default=$enableval) +AC_ARG_ENABLE(help-builtin, AC_HELP_STRING([--enable-help-builtin], [include the help builtin]), opt_help=$enableval) +AC_ARG_ENABLE(history, AC_HELP_STRING([--enable-history], [turn on command history]), opt_history=$enableval) +AC_ARG_ENABLE(job-control, AC_HELP_STRING([--enable-job-control], [enable job control features]), opt_job_control=$enableval) +AC_ARG_ENABLE(multibyte, AC_HELP_STRING([--enable-multibyte], [enable multibyte characters if OS supports them]), opt_multibyte=$enableval) +AC_ARG_ENABLE(net-redirections, AC_HELP_STRING([--enable-net-redirections], [enable /dev/tcp/host/port redirection]), opt_net_redirs=$enableval) +AC_ARG_ENABLE(process-substitution, AC_HELP_STRING([--enable-process-substitution], [enable process substitution]), opt_process_subst=$enableval) +AC_ARG_ENABLE(progcomp, AC_HELP_STRING([--enable-progcomp], [enable programmable completion and the complete builtin]), opt_progcomp=$enableval) +AC_ARG_ENABLE(prompt-string-decoding, AC_HELP_STRING([--enable-prompt-string-decoding], [turn on escape character decoding in prompts]), opt_prompt_decoding=$enableval) +AC_ARG_ENABLE(readline, AC_HELP_STRING([--enable-readline], [turn on command line editing]), opt_readline=$enableval) +AC_ARG_ENABLE(restricted, AC_HELP_STRING([--enable-restricted], [enable a restricted shell]), opt_restricted=$enableval) +AC_ARG_ENABLE(select, AC_HELP_STRING([--enable-select], [include select command]), opt_select=$enableval) +AC_ARG_ENABLE(separate-helpfiles, AC_HELP_STRING([--enable-separate-helpfiles], [use external files for help builtin documentation]), opt_separate_help=$enableval) +AC_ARG_ENABLE(single-help-strings, AC_HELP_STRING([--enable-single-help-strings], [store help documentation as a single string to ease translation]), opt_single_longdoc_strings=$enableval) +AC_ARG_ENABLE(strict-posix-default, AC_HELP_STRING([--enable-strict-posix-default], [configure bash to be posix-conformant by default]), opt_strict_posix=$enableval) +AC_ARG_ENABLE(usg-echo-default, AC_HELP_STRING([--enable-usg-echo-default], [a synonym for --enable-xpg-echo-default]), opt_xpg_echo=$enableval) +AC_ARG_ENABLE(xpg-echo-default, AC_HELP_STRING([--enable-xpg-echo-default], [make the echo builtin expand escape sequences by default]), opt_xpg_echo=$enableval) + +dnl options that alter how bash is compiled and linked +AC_ARG_ENABLE(mem-scramble, AC_HELP_STRING([--enable-mem-scramble], [scramble memory on calls to malloc and free]), opt_memscramble=$enableval) +AC_ARG_ENABLE(profiling, AC_HELP_STRING([--enable-profiling], [allow profiling with gprof]), opt_profiling=$enableval) +AC_ARG_ENABLE(static-link, AC_HELP_STRING([--enable-static-link], [link bash statically, for use as a root shell]), opt_static_link=$enableval) + +dnl So-called `precious' variables +AC_ARG_VAR([CC_FOR_BUILD], [C compiler used when compiling binaries used only at build time]) +AC_ARG_VAR([CFLAGS_FOR_BUILD], [Compliation options (CFLAGS) used when compiling binaries used only at build time]) +AC_ARG_VAR([LDFLAGS_FOR_BUILD], [Linker options (LDFLAGS) used when compiling binaries used only at build time]) +AC_ARG_VAR([CPPFLAGS_FOR_BUILD], [C preprocessor options (CPPFLAGS) used when compiling binaries used only at build time]) + +dnl opt_job_control is handled later, after BASH_JOB_CONTROL_MISSING runs + +dnl opt_readline and opt_history are handled later, because AC_PROG_CC needs +dnl to be run before we can check the version of an already-installed readline +dnl library + +if test $opt_alias = yes; then +AC_DEFINE(ALIAS) +fi +if test $opt_dirstack = yes; then +AC_DEFINE(PUSHD_AND_POPD) +fi +if test $opt_restricted = yes; then +AC_DEFINE(RESTRICTED_SHELL) +fi +if test $opt_process_subst = yes; then +AC_DEFINE(PROCESS_SUBSTITUTION) +fi +if test $opt_prompt_decoding = yes; then +AC_DEFINE(PROMPT_STRING_DECODE) +fi +if test $opt_select = yes; then +AC_DEFINE(SELECT_COMMAND) +fi +if test $opt_help = yes; then +AC_DEFINE(HELP_BUILTIN) +fi +if test $opt_array_variables = yes; then +AC_DEFINE(ARRAY_VARS) +fi +if test $opt_dparen_arith = yes; then +AC_DEFINE(DPAREN_ARITHMETIC) +fi +if test $opt_brace_expansion = yes; then +AC_DEFINE(BRACE_EXPANSION) +fi +if test $opt_disabled_builtins = yes; then +AC_DEFINE(DISABLED_BUILTINS) +fi +if test $opt_command_timing = yes; then +AC_DEFINE(COMMAND_TIMING) +fi +if test $opt_xpg_echo = yes ; then +AC_DEFINE(DEFAULT_ECHO_TO_XPG) +fi +if test $opt_strict_posix = yes; then +AC_DEFINE(STRICT_POSIX) +fi +if test $opt_extended_glob = yes ; then +AC_DEFINE(EXTENDED_GLOB) +fi +if test $opt_extglob_default = yes; then +AC_DEFINE(EXTGLOB_DEFAULT, 1) +else +AC_DEFINE(EXTGLOB_DEFAULT, 0) +fi +if test $opt_cond_command = yes ; then +AC_DEFINE(COND_COMMAND) +fi +if test $opt_cond_regexp = yes ; then +AC_DEFINE(COND_REGEXP) +fi +if test $opt_coproc = yes; then +AC_DEFINE(COPROCESS_SUPPORT) +fi +if test $opt_arith_for_command = yes; then +AC_DEFINE(ARITH_FOR_COMMAND) +fi +if test $opt_net_redirs = yes; then +AC_DEFINE(NETWORK_REDIRECTIONS) +fi +if test $opt_progcomp = yes; then +AC_DEFINE(PROGRAMMABLE_COMPLETION) +fi +if test $opt_multibyte = no; then +AC_DEFINE(NO_MULTIBYTE_SUPPORT) +fi +if test $opt_debugger = yes; then +AC_DEFINE(DEBUGGER) +fi +if test $opt_casemod_attrs = yes; then +AC_DEFINE(CASEMOD_ATTRS) +fi +if test $opt_casemod_expansions = yes; then +AC_DEFINE(CASEMOD_EXPANSIONS) +fi +if test $opt_dircomplete_expand_default = yes; then +AC_DEFINE(DIRCOMPLETE_EXPAND_DEFAULT) +fi +if test $opt_globascii_default = yes; then +AC_DEFINE(GLOBASCII_DEFAULT, 1) +else +AC_DEFINE(GLOBASCII_DEFAULT, 0) +fi + +if test $opt_memscramble = yes; then +AC_DEFINE(MEMSCRAMBLE) +fi + +if test "$opt_minimal_config" = yes; then + TESTSCRIPT=run-minimal +else + TESTSCRIPT=run-all +fi + +HELPDIR= HELPDIRDEFINE= HELPINSTALL= HELPFILES_TARGET= +if test "$opt_separate_help" != no; then + if test "$opt_separate_help" = "yes" ; then + HELPDIR='${datadir}/bash' + else + HELPDIR=$opt_separate_help + fi + HELPDIRDEFINE='-H ${HELPDIR}' + HELPINSTALL='install-help' + HELPFILES_TARGET='helpdoc' +fi +HELPSTRINGS= +if test "$opt_single_longdoc_strings" != "yes"; then + HELPSTRINGS='-S' +fi + +dnl now substitute in the values generated by arguments +AC_SUBST(TESTSCRIPT) +AC_SUBST(PURIFY) +AC_SUBST(MALLOC_TARGET) +AC_SUBST(MALLOC_SRC) + +AC_SUBST(MALLOC_LIB) +AC_SUBST(MALLOC_LIBRARY) +AC_SUBST(MALLOC_LDFLAGS) +AC_SUBST(MALLOC_DEP) + +AC_SUBST(htmldir) + +AC_SUBST(HELPDIR) +AC_SUBST(HELPDIRDEFINE) +AC_SUBST(HELPINSTALL) +AC_SUBST(HELPFILES_TARGET) +AC_SUBST(HELPSTRINGS) + +echo "" +echo "Beginning configuration for bash-$BASHVERS-$RELSTATUS for ${host_cpu}-${host_vendor}-${host_os}" +echo "" + +dnl compilation checks +dnl AC_PROG_CC sets $cross_compiling to `yes' if cross-compiling for a +dnl different environment +AC_PROG_CC + +dnl test for Unix variants +AC_ISC_POSIX +AC_MINIX + +AC_SYS_LARGEFILE + +dnl BEGIN changes for cross-building (currently cygwin, minGW, and +dnl (obsolete) BeOS) + +SIGNAMES_O= +SIGNAMES_H=lsignames.h + +dnl load up the cross-building cache file -- add more cases and cache +dnl files as necessary + +dnl Note that host and target machine are the same, and different than the +dnl build machine. +dnl Set SIGNAMES_H based on whether or not we're cross-compiling. + +CROSS_COMPILE= +if test "x$cross_compiling" = "xyes"; then + case "${host}" in + *-cygwin*) + cross_cache=${srcdir}/cross-build/cygwin32.cache + ;; + *-mingw*) + cross_cache=${srcdir}/cross-build/cygwin32.cache + ;; + i[[3456]]86-*-beos*) + cross_cache=${srcdir}/cross-build/x86-beos.cache + ;; + *) echo "configure: cross-compiling for $host is not supported" >&2 + ;; + esac + if test -n "${cross_cache}" && test -r "${cross_cache}"; then + echo "loading cross-build cache file ${cross_cache}" + . ${cross_cache} + fi + unset cross_cache + SIGNAMES_O='signames.o' + CROSS_COMPILE='-DCROSS_COMPILING' + AC_SUBST(CROSS_COMPILE) +fi +AC_SUBST(SIGNAMES_H) +AC_SUBST(SIGNAMES_O) + +dnl END changes for cross-building + +dnl We want these before the checks, so the checks can modify their values. +if test -z "$CFLAGS"; then + AUTO_CFLAGS="-g ${GCC+-O2}" + AUTO_LDFLAGS="-g ${GCC+-O2}" +else + AUTO_CFLAGS= AUTO_LDFLAGS= +fi + +dnl default values +CFLAGS=${CFLAGS-"$AUTO_CFLAGS"} +# LDFLAGS=${LDFLAGS="$AUTO_LDFLAGS"} # XXX + +dnl handle options that alter how bash is compiled and linked +dnl these must come after the test for cc/gcc +if test "$opt_profiling" = "yes"; then + PROFILE_FLAGS=-pg + case "$host_os" in + solaris2*) ;; + *) opt_static_link=yes ;; + esac + DEBUG= MALLOC_DEBUG= +fi + +prefer_shared=yes +prefer_static=no + +if test "$opt_static_link" = yes; then + prefer_static=yes + prefer_shared=no + # if we're using gcc, add `-static' to LDFLAGS, except on Solaris >= 2 + if test -n "$GCC" || test "$ac_cv_prog_gcc" = "yes"; then + STATIC_LD="-static" + case "$host_os" in + solaris2*) ;; + *) LDFLAGS="$LDFLAGS -static" ;; # XXX experimental + esac + fi +fi + +# set the appropriate make variables for building the "build tools" +# modify defaults based on whether or not we are cross compiling, since the +# options for the target host may not be appropriate for the build host +if test "X$cross_compiling" = "Xno"; then + CC_FOR_BUILD=${CC_FOR_BUILD-'$(CC)'} + CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-"$CPPFLAGS"} # XXX - should it be '$(CPPFLAGS)' + LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-'$(LDFLAGS)'} + # CFLAGS set above to default value if not passed in environment + CFLAGS_FOR_BUILD=${CFLAGS-'$(CFLAGS)'} + LIBS_FOR_BUILD=${LIBS_FOR_BUILD-'$(LIBS)'} +else + CC_FOR_BUILD=${CC_FOR_BUILD-"gcc"} + CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-""} + LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-""} + CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD="-g"} + LIBS_FOR_BUILD=${LIBS_FOR_BUILD-""} +fi + +AC_SUBST(CFLAGS) +AC_SUBST(CPPFLAGS) +AC_SUBST(LDFLAGS) +AC_SUBST(STATIC_LD) + +AC_SUBST(CC_FOR_BUILD) +AC_SUBST(CFLAGS_FOR_BUILD) +AC_SUBST(CPPFLAGS_FOR_BUILD) +AC_SUBST(LDFLAGS_FOR_BUILD) +AC_SUBST(LIBS_FOR_BUILD) + +AC_PROG_GCC_TRADITIONAL + +dnl BEGIN READLINE and HISTORY LIBRARY SECTION +dnl prepare to allow bash to be linked against an already-installed readline + +dnl first test that the readline version is new enough to link bash against +if test "$opt_readline" = yes && test "$opt_with_installed_readline" != "no" +then + # If the user specified --with-installed-readline=PREFIX and PREFIX + # is not `yes', set ac_cv_rl_prefix to PREFIX + test $opt_with_installed_readline != "yes" && ac_cv_rl_prefix=$opt_with_installed_readline + + RL_LIB_READLINE_VERSION + + case "$ac_cv_rl_version" in + 5*|6*|7*|8*|9*) ;; + *) opt_with_installed_readline=no + AC_MSG_WARN([installed readline library is too old to be linked with bash]) + AC_MSG_WARN([using private bash version]) + ;; + esac +fi + +TILDE_LIB=-ltilde +if test $opt_readline = yes; then + AC_DEFINE(READLINE) + if test "$opt_with_installed_readline" != "no" ; then + case "$opt_with_installed_readline" in + yes) RL_INCLUDE= ;; + *) case "$RL_INCLUDEDIR" in + /usr/include) ;; + *) RL_INCLUDE='-I${RL_INCLUDEDIR}' ;; + esac + ;; + esac + READLINE_DEP= + READLINE_LIB=-lreadline + # section for OS versions that don't allow unresolved symbols + # to be compiled into dynamic libraries. + case "$host_os" in + cygwin*) TILDE_LIB= ;; + esac + else + RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' + READLINE_DEP='$(READLINE_LIBRARY)' + # section for OS versions that ship an older/broken version of + # readline as a standard dynamic library and don't allow a + # static version specified as -llibname to override the + # dynamic version + case "${host_os}" in + darwin[[89]]*|darwin10*) READLINE_LIB='${READLINE_LIBRARY}' ;; + *) READLINE_LIB=-lreadline ;; + esac + fi +else + RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' + READLINE_LIB= READLINE_DEP= +fi +if test $opt_history = yes || test $opt_bang_history = yes; then + if test $opt_history = yes; then + AC_DEFINE(HISTORY) + fi + if test $opt_bang_history = yes; then + AC_DEFINE(BANG_HISTORY) + fi + if test "$opt_with_installed_readline" != "no"; then + HIST_LIBDIR=$RL_LIBDIR + HISTORY_DEP= + HISTORY_LIB=-lhistory + case "$opt_with_installed_readline" in + yes) RL_INCLUDE= ;; + *) case "$RL_INCLUDEDIR" in + /usr/include) ;; + *) RL_INCLUDE='-I${RL_INCLUDEDIR}' ;; + esac + ;; + esac + else + HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' + HISTORY_DEP='$(HISTORY_LIBRARY)' + # section for OS versions that ship an older version of + # readline as a standard dynamic library and don't allow a + # static version specified as -llibname to override the + # dynamic version + case "${host_os}" in + darwin[[89]]*|darwin10*) HISTORY_LIB='${HISTORY_LIBRARY}' ;; + *) HISTORY_LIB=-lhistory ;; + esac + fi +else + HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline' + HISTORY_LIB= HISTORY_DEP= +fi +AC_SUBST(READLINE_LIB) +AC_SUBST(READLINE_DEP) +AC_SUBST(RL_LIBDIR) +AC_SUBST(RL_INCLUDEDIR) +AC_SUBST(RL_INCLUDE) +AC_SUBST(HISTORY_LIB) +AC_SUBST(HISTORY_DEP) +AC_SUBST(HIST_LIBDIR) +AC_SUBST(TILDE_LIB) + +dnl END READLINE and HISTORY LIBRARY SECTION + +dnl programs needed by the build and install process +AC_PROG_INSTALL +AC_CHECK_TOOL(AR, ar) +dnl Set default for ARFLAGS, since autoconf does not have a macro for it. +dnl This allows people to set it when running configure or make +test -n "$ARFLAGS" || ARFLAGS="cr" +AC_PROG_RANLIB +AC_PROG_YACC +AC_PROG_MAKE_SET + +case "$ac_cv_prog_YACC" in +*bison*) ;; +*) AC_MSG_WARN([bison not available; needed to process parse.y]) ;; +esac + +case "$host_os" in +opennt*|interix*) MAKE_SHELL="$INTERIX_ROOT/bin/sh" ;; +*) MAKE_SHELL=/bin/sh ;; +esac +AC_SUBST(MAKE_SHELL) + +dnl this is similar to the expanded AC_PROG_RANLIB +if test x$SIZE = x; then + if test x$ac_tool_prefix = x; then + SIZE=size + else + SIZE=${ac_tool_prefix}size + save_IFS=$IFS ; IFS=: + size_found=0 + for dir in $PATH; do + if test -x $dir/$SIZE ; then + size_found=1 + break + fi + done + if test $size_found -eq 0; then + SIZE=: + fi + IFS=$save_IFS + fi +fi +AC_SUBST(SIZE) + +m4_include([m4/stat-time.m4]) +m4_include([m4/timespec.m4]) + +dnl Turn on any extensions available in the GNU C library. +AC_DEFINE(_GNU_SOURCE, 1) + +dnl C compiler characteristics +AC_C_CONST +AC_C_INLINE +AC_C_BIGENDIAN +AC_C_STRINGIZE +AC_C_LONG_DOUBLE +AC_C_PROTOTYPES +AC_C_CHAR_UNSIGNED +AC_C_VOLATILE +AC_C_RESTRICT + +dnl initialize GNU gettext +AM_GNU_GETTEXT([no-libtool], [need-ngettext], [lib/intl]) + +dnl header files +AC_HEADER_DIRENT +AC_HEADER_TIME + +BASH_HEADER_INTTYPES + +AC_CHECK_HEADERS(unistd.h stdlib.h stdarg.h varargs.h limits.h string.h \ + memory.h locale.h termcap.h termio.h termios.h dlfcn.h \ + stdbool.h stddef.h stdint.h netdb.h pwd.h grp.h strings.h \ + regex.h syslog.h ulimit.h) +AC_CHECK_HEADERS(sys/pte.h sys/stream.h sys/select.h sys/file.h \ + sys/resource.h sys/param.h sys/socket.h sys/stat.h \ + sys/time.h sys/times.h sys/types.h sys/wait.h) +AC_CHECK_HEADERS(netinet/in.h arpa/inet.h) + +dnl sys/ptem.h requires definitions from sys/stream.h on systems where it +dnl exists +AC_CHECK_HEADER(sys/ptem.h, , ,[[ +#if HAVE_SYS_STREAM_H +# include +#endif +]]) + +dnl special checks for libc functions +AC_FUNC_ALLOCA +AC_FUNC_GETPGRP +AC_FUNC_SETVBUF_REVERSED +AC_FUNC_VPRINTF +AC_FUNC_STRCOLL + +dnl if we're not using the bash malloc but require the C alloca, set things +dnl up to build a libmalloc.a containing only alloca.o + +if test "$ac_cv_func_alloca_works" = "no" && test "$opt_bash_malloc" = "no"; then + MALLOC_TARGET=alloca + MALLOC_SRC=alloca.c + + MALLOC_LIB='-lmalloc' + MALLOC_LIBRARY='$(ALLOC_LIBDIR)/libmalloc.a' + MALLOC_LDFLAGS='-L$(ALLOC_LIBDIR)' + MALLOC_DEP='$(MALLOC_LIBRARY)' +fi + +dnl if vprintf is not in libc, see if it's defined in stdio.h +if test "$ac_cv_func_vprintf" = no; then + AC_MSG_CHECKING(for declaration of vprintf in stdio.h) + AC_EGREP_HEADER([[int[ ]*vprintf[^a-zA-Z0-9]]],stdio.h,ac_cv_func_vprintf=yes) + AC_MSG_RESULT($ac_cv_func_vprintf) + if test $ac_cv_func_vprintf = yes; then + AC_DEFINE(HAVE_VPRINTF) + fi +fi + +if test "$ac_cv_func_vprintf" = no && test "$ac_cv_func__doprnt" = "yes"; then + AC_LIBOBJ(vprint) +fi + +dnl signal stuff +AC_TYPE_SIGNAL + +dnl checks for certain version-specific system calls and libc functions +AC_CHECK_FUNC(__setostype, AC_DEFINE(HAVE_SETOSTYPE)) +AC_CHECK_FUNC(wait3, AC_DEFINE(HAVE_WAIT3)) + +dnl checks for missing libc functions +AC_CHECK_FUNC(mkfifo,AC_DEFINE(HAVE_MKFIFO),AC_DEFINE(MKFIFO_MISSING)) + +dnl checks for system calls +AC_CHECK_FUNCS(dup2 eaccess fcntl getdtablesize getgroups gethostname \ + getpagesize getpeername getrlimit getrusage gettimeofday \ + kill killpg lstat readlink sbrk select setdtablesize \ + setitimer tcgetpgrp uname ulimit waitpid) +AC_REPLACE_FUNCS(rename) + +dnl checks for c library functions +AC_CHECK_FUNCS(bcopy bzero confstr faccessat fnmatch \ + getaddrinfo gethostbyname getservbyname getservent inet_aton \ + imaxdiv memmove pathconf putenv raise regcomp regexec \ + setenv setlinebuf setlocale setvbuf siginterrupt strchr \ + sysconf syslog tcgetattr times ttyname tzset unsetenv) + +AC_CHECK_FUNCS(vasprintf asprintf) +AC_CHECK_FUNCS(isascii isblank isgraph isprint isspace isxdigit) +AC_CHECK_FUNCS(getpwent getpwnam getpwuid) +AC_REPLACE_FUNCS(getcwd memset) +AC_REPLACE_FUNCS(strcasecmp strcasestr strerror strftime strnlen strpbrk strstr) +AC_REPLACE_FUNCS(strtod strtol strtoul strtoll strtoull strtoimax strtoumax) +AC_REPLACE_FUNCS(dprintf) +AC_REPLACE_FUNCS(strchrnul) +AC_REPLACE_FUNCS(strdup) + +AC_CHECK_DECLS([AUDIT_USER_TTY],,, [[#include ]]) + +AC_CHECK_DECLS([confstr]) +AC_CHECK_DECLS([printf]) +AC_CHECK_DECLS([sbrk]) +AC_CHECK_DECLS([setregid]) +AC_CHECK_DECLS([strcpy]) +AC_CHECK_DECLS([strsignal]) + +dnl Extra test to detect the horribly broken HP/UX 11.00 strtold(3) +AC_CHECK_DECLS([strtold], [ + AC_MSG_CHECKING([for broken strtold]) + AC_CACHE_VAL(bash_cv_strtold_broken, + [AC_TRY_COMPILE( + [#include ], + [int main() { long double r; char *foo, bar; r = strtold(foo, &bar);}], + bash_cv_strtold_broken=no, bash_cv_strtold_broken=yes, + [AC_MSG_WARN(cannot check for broken strtold if cross-compiling, defaulting to no)]) + ] + ) + AC_MSG_RESULT($bash_cv_strtold_broken) + if test "$bash_cv_strtold_broken" = "yes" ; then + AC_DEFINE(STRTOLD_BROKEN) + fi +]) + +BASH_CHECK_DECL(strtoimax) +BASH_CHECK_DECL(strtol) +BASH_CHECK_DECL(strtoll) +BASH_CHECK_DECL(strtoul) +BASH_CHECK_DECL(strtoull) +BASH_CHECK_DECL(strtoumax) + +AC_FUNC_MKTIME + +dnl +dnl Checks for lib/intl and related code (uses some of the output from +dnl AM_GNU_GETTEXT) +dnl + +AC_CHECK_HEADERS([argz.h errno.h fcntl.h malloc.h stdio_ext.h]) + +dnl AC_FUNC_MALLOC +AC_FUNC_MMAP +AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify dcgettext mempcpy \ + munmap stpcpy strcspn]) + +INTL_DEP= INTL_INC= LIBINTL_H= +if test "x$USE_INCLUDED_LIBINTL" = "xyes"; then + INTL_DEP='${INTL_LIBDIR}/libintl.a' + INTL_INC='-I${INTL_LIBSRC} -I${INTL_BUILDDIR}' + LIBINTL_H='${INTL_BUILDDIR}/libintl.h' +fi +AC_SUBST(INTL_DEP) +AC_SUBST(INTL_INC) +AC_SUBST(LIBINTL_H) + +dnl +dnl End of checks needed by files in lib/intl +dnl + +BASH_CHECK_MULTIBYTE + +dnl checks for the dynamic loading library functions in libc and libdl +if test "$opt_static_link" != yes; then +AC_CHECK_LIB(dl, dlopen) +AC_CHECK_FUNCS(dlopen dlclose dlsym) +fi + +dnl this defines HAVE_DECL_SYS_SIGLIST +AC_DECL_SYS_SIGLIST + +dnl network functions -- check for inet_aton again +if test "$ac_cv_func_inet_aton" != 'yes'; then +BASH_FUNC_INET_ATON +fi + +dnl libraries +dnl this is reportedly no longer necessary for irix[56].? +case "$host_os" in +irix4*) AC_CHECK_LIB(sun, getpwent) ;; +esac + +dnl check for getpeername in the socket library only if it's not in libc +if test "$ac_cv_func_getpeername" = no; then + BASH_CHECK_LIB_SOCKET +fi +dnl check for gethostbyname in socket libraries if it's not in libc +if test "$ac_cv_func_gethostbyname" = no; then + BASH_FUNC_GETHOSTBYNAME +fi + +dnl system types +AC_TYPE_GETGROUPS +AC_TYPE_OFF_T +AC_TYPE_MODE_T +AC_TYPE_UID_T +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_CHECK_TYPE(ssize_t, int) +AC_CHECK_TYPE(time_t, long) + +BASH_TYPE_LONG_LONG +BASH_TYPE_UNSIGNED_LONG_LONG + +AC_TYPE_SIGNAL +BASH_TYPE_SIG_ATOMIC_T + +AC_CHECK_SIZEOF(char, 1) +AC_CHECK_SIZEOF(short, 2) +AC_CHECK_SIZEOF(int, 4) +AC_CHECK_SIZEOF(long, 4) +AC_CHECK_SIZEOF(char *, 4) +AC_CHECK_SIZEOF(double, 8) +AC_CHECK_SIZEOF([long long], 8) + +AC_CHECK_TYPE(u_int, [unsigned int]) +AC_CHECK_TYPE(u_long, [unsigned long]) + +BASH_TYPE_BITS16_T +BASH_TYPE_U_BITS16_T +BASH_TYPE_BITS32_T +BASH_TYPE_U_BITS32_T +BASH_TYPE_BITS64_T + +BASH_TYPE_PTRDIFF_T + +dnl structures +AC_HEADER_STAT + +dnl system services +AC_SYS_INTERPRETER +if test $ac_cv_sys_interpreter = yes; then +AC_DEFINE(HAVE_HASH_BANG_EXEC) +fi + +dnl Miscellaneous Bash tests +if test "$ac_cv_func_lstat" = "no"; then +BASH_FUNC_LSTAT +fi + +dnl behavior of system calls and library functions +BASH_FUNC_CTYPE_NONASCII +BASH_FUNC_DUP2_CLOEXEC_CHECK +BASH_SYS_PGRP_SYNC +BASH_SYS_SIGNAL_VINTAGE + +dnl checking for the presence of certain library symbols +BASH_SYS_ERRLIST +BASH_SYS_SIGLIST +BASH_UNDER_SYS_SIGLIST + +dnl various system types +BASH_TYPE_SIGHANDLER +BASH_CHECK_TYPE(clock_t, [#include ], long) +BASH_CHECK_TYPE(sigset_t, [#include ], int) +BASH_CHECK_TYPE(sig_atomic_t, [#include ], int) +BASH_CHECK_TYPE(quad_t, , long, HAVE_QUAD_T) +BASH_CHECK_TYPE(intmax_t, , $bash_cv_type_long_long) +BASH_CHECK_TYPE(uintmax_t, , $bash_cv_type_unsigned_long_long) +if test "$ac_cv_header_sys_socket_h" = "yes"; then +BASH_CHECK_TYPE(socklen_t, [#include ], [unsigned int], HAVE_SOCKLEN_T) +fi +BASH_TYPE_RLIMIT + +AC_CHECK_SIZEOF(intmax_t, 8) + +dnl presence and contents of structures used by system calls +BASH_STRUCT_TERMIOS_LDISC +BASH_STRUCT_TERMIO_LDISC +BASH_STRUCT_DIRENT_D_INO +BASH_STRUCT_DIRENT_D_FILENO +BASH_STRUCT_DIRENT_D_NAMLEN +BASH_STRUCT_WINSIZE +BASH_STRUCT_TIMEVAL +AC_CHECK_MEMBERS([struct stat.st_blocks]) +AC_STRUCT_TM +AC_STRUCT_TIMEZONE +BASH_STRUCT_TIMEZONE + +BASH_STRUCT_WEXITSTATUS_OFFSET + +BASH_CHECK_TYPE_STRUCT_TIMESPEC +BASH_STAT_TIME + +dnl presence and behavior of C library functions +BASH_FUNC_STRSIGNAL +BASH_FUNC_OPENDIR_CHECK +BASH_FUNC_ULIMIT_MAXFDS +BASH_FUNC_FPURGE +BASH_FUNC_GETENV +if test "$ac_cv_func_getcwd" = "yes"; then +BASH_FUNC_GETCWD +fi +BASH_FUNC_POSIX_SETJMP +BASH_FUNC_STRCOLL +BASH_FUNC_SNPRINTF +BASH_FUNC_VSNPRINTF + +dnl If putenv or unsetenv is not present, set the right define so the +dnl prototype and declaration in lib/sh/getenv.c will be standard-conformant + +if test "$ac_cv_func_putenv" = "yes"; then +BASH_FUNC_STD_PUTENV +else +AC_DEFINE(HAVE_STD_PUTENV) +fi +if test "$ac_cv_func_unsetenv" = "yes"; then +BASH_FUNC_STD_UNSETENV +else +AC_DEFINE(HAVE_STD_UNSETENV) +fi + +BASH_FUNC_PRINTF_A_FORMAT + +dnl presence and behavior of OS functions +BASH_SYS_REINSTALL_SIGHANDLERS +BASH_SYS_JOB_CONTROL_MISSING +BASH_SYS_NAMED_PIPES + +dnl presence of certain CPP defines +AC_HEADER_TIOCGWINSZ +BASH_HAVE_TIOCSTAT +BASH_HAVE_FIONREAD + +BASH_CHECK_WCONTINUED + +dnl miscellaneous +BASH_CHECK_SPEED_T +BASH_CHECK_GETPW_FUNCS +BASH_CHECK_RTSIGS +BASH_CHECK_SYS_SIGLIST + +dnl special checks +case "$host_os" in +hpux*) BASH_CHECK_KERNEL_RLIMIT ;; +esac + +if test "$opt_readline" = yes; then +dnl yuck +case "$host_os" in +aix*) prefer_curses=yes ;; +esac +BASH_CHECK_LIB_TERMCAP +fi +AC_SUBST(TERMCAP_LIB) +AC_SUBST(TERMCAP_DEP) + +BASH_CHECK_DEV_FD +BASH_CHECK_DEV_STDIN +BASH_SYS_DEFAULT_MAIL_DIR + +if test "$bash_cv_job_control_missing" = missing; then + opt_job_control=no +fi + +if test "$opt_job_control" = yes; then +AC_DEFINE(JOB_CONTROL) +JOBS_O=jobs.o +else +JOBS_O=nojobs.o +fi + +AC_SUBST(JOBS_O) + +dnl Defines that we want to propagate to the Makefiles in subdirectories, +dnl like glob and readline + +LOCAL_DEFS=-DSHELL + +dnl use this section to possibly define more cpp variables, specify local +dnl libraries, and specify any additional local cc or ld flags +dnl +dnl this should really go away someday + +case "${host_os}" in +sysv4.2*) AC_DEFINE(SVR4_2) + AC_DEFINE(SVR4) ;; +sysv4*) AC_DEFINE(SVR4) ;; +sysv5*) AC_DEFINE(SVR5) ;; +hpux9*) LOCAL_CFLAGS="-DHPUX9 -DHPUX" ;; +hpux*) LOCAL_CFLAGS=-DHPUX ;; +dgux*) LOCAL_CFLAGS=-D_DGUX_SOURCE; LOCAL_LIBS=-ldgc ;; +isc*) LOCAL_CFLAGS=-Disc386 ;; +rhapsody*) LOCAL_CFLAGS=-DRHAPSODY ;; +darwin*) LOCAL_CFLAGS=-DMACOSX ;; +sco3.2v5*) LOCAL_CFLAGS="-b elf -DWAITPID_BROKEN -DPATH_MAX=1024" ;; +sco3.2v4*) LOCAL_CFLAGS="-DMUST_UNBLOCK_CHLD -DPATH_MAX=1024" ;; +sco3.2*) LOCAL_CFLAGS=-DMUST_UNBLOCK_CHLD ;; +sunos4*) LOCAL_CFLAGS=-DSunOS4 ;; +solaris2.5*) LOCAL_CFLAGS="-DSunOS5 -DSOLARIS" ;; +solaris2.8*) LOCAL_CFLAGS=-DSOLARIS ;; +solaris2.9*) LOCAL_CFLAGS=-DSOLARIS ;; +solaris2.10*) LOCAL_CFLAGS=-DSOLARIS ;; +solaris2*) LOCAL_CFLAGS=-DSOLARIS ;; +lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; +linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading + case "`uname -r`" in + 2.[[456789]]*|3*) AC_DEFINE(PGRP_PIPE) ;; + esac ;; +*qnx6*) LOCAL_CFLAGS="-Dqnx -Dqnx6" LOCAL_LIBS="-lncurses" ;; +*qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;; +powerux*) LOCAL_LIBS="-lgen" ;; +cygwin*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; +opennt*|interix*) LOCAL_CFLAGS="-DNO_MAIN_ENV_ARG -DBROKEN_DIRENT_D_INO -D_POSIX_SOURCE -D_ALL_SOURCE -DRECYCLES_PIDS" ;; +*openstep*) LOCAL_CFLAGS="-D__APPLE_CC__" ;; +esac + +dnl Stanza for OS/compiler pair-specific flags +case "${host_os}-${CC}" in +aix4.2*-*gcc*) LOCAL_LDFLAGS="-Xlinker -bexpall -Xlinker -brtl" ;; +aix4.2*) LOCAL_LDFLAGS="-bexpall -brtl" ;; +bsdi4*-*gcc*) LOCAL_LDFLAGS="-rdynamic" ;; # allow dynamic loading, like Linux +esac + +dnl FreeBSD-3.x can have either a.out or ELF +case "${host_os}" in +freebsd[[3-9]]*) + if test -x /usr/bin/objformat && test "`/usr/bin/objformat`" = "elf" ; then + LOCAL_LDFLAGS=-rdynamic # allow dynamic loading + fi ;; +freebsdelf*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading +dragonfly*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading +esac + +case "$host_cpu" in +*cray*) LOCAL_CFLAGS="-DCRAY" ;; # shell var so config.h can use it +esac + +case "$host_cpu-$host_os" in +ibmrt-*bsd4*) LOCAL_CFLAGS="-ma -U__STDC__" ;; +esac + +case "$host_cpu-$host_vendor-$host_os" in +m88k-motorola-sysv3) LOCAL_CFLAGS=-DWAITPID_BROKEN ;; +mips-pyramid-sysv4) LOCAL_CFLAGS=-Xa ;; +esac + +# +# Shared object configuration section. These values are generated by +# ${srcdir}/support/shobj-conf +# +if test "$ac_cv_func_dlopen" = "yes" && test -f ${srcdir}/support/shobj-conf +then + AC_MSG_CHECKING(shared object configuration for loadable builtins) + eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c "${host_cpu}" -o "${host_os}" -v "${host_vendor}"` + AC_SUBST(SHOBJ_CC) + AC_SUBST(SHOBJ_CFLAGS) + AC_SUBST(SHOBJ_LD) + AC_SUBST(SHOBJ_LDFLAGS) + AC_SUBST(SHOBJ_XLDFLAGS) + AC_SUBST(SHOBJ_LIBS) + AC_SUBST(SHOBJ_STATUS) + AC_MSG_RESULT($SHOBJ_STATUS) +fi + +# try to create a directory tree if the source is elsewhere +# this should be packaged into a script accessible via ${srcdir}/support +case "$srcdir" in +.) ;; +*) for d in doc tests support lib examples; do # dirs + test -d $d || mkdir $d + done + for ld in readline glob tilde malloc sh termcap; do # libdirs + test -d lib/$ld || mkdir lib/$ld + done + test -d examples/loadables || mkdir examples/loadables # loadable builtins + test -d examples/loadables/perl || mkdir examples/loadables/perl + ;; +esac + +BUILD_DIR=`pwd` +case "$BUILD_DIR" in +*\ *) BUILD_DIR=`echo "$BUILD_DIR" | sed 's: :\\\\ :g'` ;; +*) ;; +esac + +if test -z "$localedir"; then + localedir='${datarootdir}/locale' +fi +if test -z "$datarootdir"; then + datarootdir='${prefix}/share' +fi + +AC_SUBST(PROFILE_FLAGS) + +AC_SUBST(incdir) +AC_SUBST(BUILD_DIR) + +# Some versions of autoconf don't substitute these automatically +AC_SUBST(datarootdir) +AC_SUBST(localedir) + +AC_SUBST(YACC) +AC_SUBST(AR) +AC_SUBST(ARFLAGS) + +AC_SUBST(BASHVERS) +AC_SUBST(RELSTATUS) +AC_SUBST(DEBUG) +AC_SUBST(MALLOC_DEBUG) + +AC_SUBST(host_cpu) +AC_SUBST(host_vendor) +AC_SUBST(host_os) + +AC_SUBST(LOCAL_LIBS) +AC_SUBST(LOCAL_CFLAGS) +AC_SUBST(LOCAL_LDFLAGS) +AC_SUBST(LOCAL_DEFS) + +#AC_SUBST(ALLOCA_SOURCE) +#AC_SUBST(ALLOCA_OBJECT) + +AC_OUTPUT([Makefile builtins/Makefile lib/readline/Makefile lib/glob/Makefile \ + lib/intl/Makefile \ + lib/malloc/Makefile lib/sh/Makefile lib/termcap/Makefile \ + lib/tilde/Makefile doc/Makefile support/Makefile po/Makefile.in \ + examples/loadables/Makefile examples/loadables/perl/Makefile], +[ +# Makefile uses this timestamp file to record whether config.h is up to date. +echo timestamp > stamp-h +]) diff --git a/conftypes.h b/conftypes.h new file mode 100644 index 0000000..1c8c548 --- /dev/null +++ b/conftypes.h @@ -0,0 +1,58 @@ +/* conftypes.h -- defines for build and host system. */ + +/* Copyright (C) 2001, 2005, 2008,2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_CONFTYPES_H_) +#define _CONFTYPES_H_ + +/* Placeholder for future modifications if cross-compiling or building a + `fat' binary, e.g. on Apple Rhapsody. These values are used in multiple + files, so they appear here. */ +#if !defined (RHAPSODY) && !defined (MACOSX) +# define HOSTTYPE CONF_HOSTTYPE +# define OSTYPE CONF_OSTYPE +# define MACHTYPE CONF_MACHTYPE +#else /* RHAPSODY */ +# if defined(__powerpc__) || defined(__ppc__) +# define HOSTTYPE "powerpc" +# elif defined(__i386__) +# define HOSTTYPE "i386" +# else +# define HOSTTYPE CONF_HOSTTYPE +# endif + +# define OSTYPE CONF_OSTYPE +# define VENDOR CONF_VENDOR + +# define MACHTYPE HOSTTYPE "-" VENDOR "-" OSTYPE +#endif /* RHAPSODY */ + +#ifndef HOSTTYPE +# define HOSTTYPE "unknown" +#endif + +#ifndef OSTYPE +# define OSTYPE "unknown" +#endif + +#ifndef MACHTYPE +# define MACHTYPE "unknown" +#endif + +#endif /* _CONFTYPES_H_ */ diff --git a/copy_cmd.c b/copy_cmd.c new file mode 100644 index 0000000..911d34f --- /dev/null +++ b/copy_cmd.c @@ -0,0 +1,450 @@ +/* copy_command.c -- copy a COMMAND structure. This is needed + primarily for making function definitions, but I'm not sure + that anyone else will need it. */ + +/* Copyright (C) 1987-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include + +#include "shell.h" + +static PATTERN_LIST *copy_case_clause __P((PATTERN_LIST *)); +static PATTERN_LIST *copy_case_clauses __P((PATTERN_LIST *)); +static FOR_COM *copy_for_command __P((FOR_COM *)); +#if defined (ARITH_FOR_COMMAND) +static ARITH_FOR_COM *copy_arith_for_command __P((ARITH_FOR_COM *)); +#endif +static GROUP_COM *copy_group_command __P((GROUP_COM *)); +static SUBSHELL_COM *copy_subshell_command __P((SUBSHELL_COM *)); +static COPROC_COM *copy_coproc_command __P((COPROC_COM *)); +static CASE_COM *copy_case_command __P((CASE_COM *)); +static WHILE_COM *copy_while_command __P((WHILE_COM *)); +static IF_COM *copy_if_command __P((IF_COM *)); +#if defined (DPAREN_ARITHMETIC) +static ARITH_COM *copy_arith_command __P((ARITH_COM *)); +#endif +#if defined (COND_COMMAND) +static COND_COM *copy_cond_command __P((COND_COM *)); +#endif +static SIMPLE_COM *copy_simple_command __P((SIMPLE_COM *)); + +WORD_DESC * +copy_word (w) + WORD_DESC *w; +{ + WORD_DESC *new_word; + + new_word = make_bare_word (w->word); + new_word->flags = w->flags; + return (new_word); +} + +/* Copy the chain of words in LIST. Return a pointer to + the new chain. */ +WORD_LIST * +copy_word_list (list) + WORD_LIST *list; +{ + WORD_LIST *new_list; + + for (new_list = (WORD_LIST *)NULL; list; list = list->next) + new_list = make_word_list (copy_word (list->word), new_list); + + return (REVERSE_LIST (new_list, WORD_LIST *)); +} + +static PATTERN_LIST * +copy_case_clause (clause) + PATTERN_LIST *clause; +{ + PATTERN_LIST *new_clause; + + new_clause = (PATTERN_LIST *)xmalloc (sizeof (PATTERN_LIST)); + new_clause->patterns = copy_word_list (clause->patterns); + new_clause->action = copy_command (clause->action); + new_clause->flags = clause->flags; + return (new_clause); +} + +static PATTERN_LIST * +copy_case_clauses (clauses) + PATTERN_LIST *clauses; +{ + PATTERN_LIST *new_list, *new_clause; + + for (new_list = (PATTERN_LIST *)NULL; clauses; clauses = clauses->next) + { + new_clause = copy_case_clause (clauses); + new_clause->next = new_list; + new_list = new_clause; + } + return (REVERSE_LIST (new_list, PATTERN_LIST *)); +} + +/* Copy a single redirect. */ +REDIRECT * +copy_redirect (redirect) + REDIRECT *redirect; +{ + REDIRECT *new_redirect; + + new_redirect = (REDIRECT *)xmalloc (sizeof (REDIRECT)); +#if 0 + FASTCOPY ((char *)redirect, (char *)new_redirect, (sizeof (REDIRECT))); +#else + *new_redirect = *redirect; /* let the compiler do the fast structure copy */ +#endif + + if (redirect->rflags & REDIR_VARASSIGN) + new_redirect->redirector.filename = copy_word (redirect->redirector.filename); + + switch (redirect->instruction) + { + case r_reading_until: + case r_deblank_reading_until: + new_redirect->here_doc_eof = savestring (redirect->here_doc_eof); + /*FALLTHROUGH*/ + case r_reading_string: + case r_appending_to: + case r_output_direction: + case r_input_direction: + case r_inputa_direction: + case r_err_and_out: + case r_append_err_and_out: + case r_input_output: + case r_output_force: + case r_duplicating_input_word: + case r_duplicating_output_word: + case r_move_input_word: + case r_move_output_word: + new_redirect->redirectee.filename = copy_word (redirect->redirectee.filename); + break; + case r_duplicating_input: + case r_duplicating_output: + case r_move_input: + case r_move_output: + case r_close_this: + break; + } + return (new_redirect); +} + +REDIRECT * +copy_redirects (list) + REDIRECT *list; +{ + REDIRECT *new_list, *temp; + + for (new_list = (REDIRECT *)NULL; list; list = list->next) + { + temp = copy_redirect (list); + temp->next = new_list; + new_list = temp; + } + return (REVERSE_LIST (new_list, REDIRECT *)); +} + +static FOR_COM * +copy_for_command (com) + FOR_COM *com; +{ + FOR_COM *new_for; + + new_for = (FOR_COM *)xmalloc (sizeof (FOR_COM)); + new_for->flags = com->flags; + new_for->line = com->line; + new_for->name = copy_word (com->name); + new_for->map_list = copy_word_list (com->map_list); + new_for->action = copy_command (com->action); + return (new_for); +} + +#if defined (ARITH_FOR_COMMAND) +static ARITH_FOR_COM * +copy_arith_for_command (com) + ARITH_FOR_COM *com; +{ + ARITH_FOR_COM *new_arith_for; + + new_arith_for = (ARITH_FOR_COM *)xmalloc (sizeof (ARITH_FOR_COM)); + new_arith_for->flags = com->flags; + new_arith_for->line = com->line; + new_arith_for->init = copy_word_list (com->init); + new_arith_for->test = copy_word_list (com->test); + new_arith_for->step = copy_word_list (com->step); + new_arith_for->action = copy_command (com->action); + return (new_arith_for); +} +#endif /* ARITH_FOR_COMMAND */ + +static GROUP_COM * +copy_group_command (com) + GROUP_COM *com; +{ + GROUP_COM *new_group; + + new_group = (GROUP_COM *)xmalloc (sizeof (GROUP_COM)); + new_group->command = copy_command (com->command); + return (new_group); +} + +static SUBSHELL_COM * +copy_subshell_command (com) + SUBSHELL_COM *com; +{ + SUBSHELL_COM *new_subshell; + + new_subshell = (SUBSHELL_COM *)xmalloc (sizeof (SUBSHELL_COM)); + new_subshell->command = copy_command (com->command); + new_subshell->flags = com->flags; + return (new_subshell); +} + +static COPROC_COM * +copy_coproc_command (com) + COPROC_COM *com; +{ + COPROC_COM *new_coproc; + + new_coproc = (COPROC_COM *)xmalloc (sizeof (COPROC_COM)); + new_coproc->name = savestring (com->name); + new_coproc->command = copy_command (com->command); + new_coproc->flags = com->flags; + return (new_coproc); +} + +static CASE_COM * +copy_case_command (com) + CASE_COM *com; +{ + CASE_COM *new_case; + + new_case = (CASE_COM *)xmalloc (sizeof (CASE_COM)); + new_case->flags = com->flags; + new_case->line = com->line; + new_case->word = copy_word (com->word); + new_case->clauses = copy_case_clauses (com->clauses); + return (new_case); +} + +static WHILE_COM * +copy_while_command (com) + WHILE_COM *com; +{ + WHILE_COM *new_while; + + new_while = (WHILE_COM *)xmalloc (sizeof (WHILE_COM)); + new_while->flags = com->flags; + new_while->test = copy_command (com->test); + new_while->action = copy_command (com->action); + return (new_while); +} + +static IF_COM * +copy_if_command (com) + IF_COM *com; +{ + IF_COM *new_if; + + new_if = (IF_COM *)xmalloc (sizeof (IF_COM)); + new_if->flags = com->flags; + new_if->test = copy_command (com->test); + new_if->true_case = copy_command (com->true_case); + new_if->false_case = com->false_case ? copy_command (com->false_case) : com->false_case; + return (new_if); +} + +#if defined (DPAREN_ARITHMETIC) +static ARITH_COM * +copy_arith_command (com) + ARITH_COM *com; +{ + ARITH_COM *new_arith; + + new_arith = (ARITH_COM *)xmalloc (sizeof (ARITH_COM)); + new_arith->flags = com->flags; + new_arith->exp = copy_word_list (com->exp); + new_arith->line = com->line; + + return (new_arith); +} +#endif + +#if defined (COND_COMMAND) +static COND_COM * +copy_cond_command (com) + COND_COM *com; +{ + COND_COM *new_cond; + + new_cond = (COND_COM *)xmalloc (sizeof (COND_COM)); + new_cond->flags = com->flags; + new_cond->line = com->line; + new_cond->type = com->type; + new_cond->op = com->op ? copy_word (com->op) : com->op; + new_cond->left = com->left ? copy_cond_command (com->left) : (COND_COM *)NULL; + new_cond->right = com->right ? copy_cond_command (com->right) : (COND_COM *)NULL; + + return (new_cond); +} +#endif + +static SIMPLE_COM * +copy_simple_command (com) + SIMPLE_COM *com; +{ + SIMPLE_COM *new_simple; + + new_simple = (SIMPLE_COM *)xmalloc (sizeof (SIMPLE_COM)); + new_simple->flags = com->flags; + new_simple->words = copy_word_list (com->words); + new_simple->redirects = com->redirects ? copy_redirects (com->redirects) : (REDIRECT *)NULL; + new_simple->line = com->line; + return (new_simple); +} + +FUNCTION_DEF * +copy_function_def_contents (old, new_def) + FUNCTION_DEF *old, *new_def; +{ + new_def->name = copy_word (old->name); + new_def->command = old->command ? copy_command (old->command) : old->command; + new_def->flags = old->flags; + new_def->line = old->line; + new_def->source_file = old->source_file ? savestring (old->source_file) : old->source_file; + return (new_def); +} + +FUNCTION_DEF * +copy_function_def (com) + FUNCTION_DEF *com; +{ + FUNCTION_DEF *new_def; + + new_def = (FUNCTION_DEF *)xmalloc (sizeof (FUNCTION_DEF)); + new_def = copy_function_def_contents (com, new_def); + return (new_def); +} + +/* Copy the command structure in COMMAND. Return a pointer to the + copy. Don't you forget to dispose_command () on this pointer + later! */ +COMMAND * +copy_command (command) + COMMAND *command; +{ + COMMAND *new_command; + + if (command == NULL) + return (command); + + new_command = (COMMAND *)xmalloc (sizeof (COMMAND)); + FASTCOPY ((char *)command, (char *)new_command, sizeof (COMMAND)); + new_command->flags = command->flags; + new_command->line = command->line; + + if (command->redirects) + new_command->redirects = copy_redirects (command->redirects); + + switch (command->type) + { + case cm_for: + new_command->value.For = copy_for_command (command->value.For); + break; + +#if defined (ARITH_FOR_COMMAND) + case cm_arith_for: + new_command->value.ArithFor = copy_arith_for_command (command->value.ArithFor); + break; +#endif + +#if defined (SELECT_COMMAND) + case cm_select: + new_command->value.Select = + (SELECT_COM *)copy_for_command ((FOR_COM *)command->value.Select); + break; +#endif + + case cm_group: + new_command->value.Group = copy_group_command (command->value.Group); + break; + + case cm_subshell: + new_command->value.Subshell = copy_subshell_command (command->value.Subshell); + break; + + case cm_coproc: + new_command->value.Coproc = copy_coproc_command (command->value.Coproc); + break; + + case cm_case: + new_command->value.Case = copy_case_command (command->value.Case); + break; + + case cm_until: + case cm_while: + new_command->value.While = copy_while_command (command->value.While); + break; + + case cm_if: + new_command->value.If = copy_if_command (command->value.If); + break; + +#if defined (DPAREN_ARITHMETIC) + case cm_arith: + new_command->value.Arith = copy_arith_command (command->value.Arith); + break; +#endif + +#if defined (COND_COMMAND) + case cm_cond: + new_command->value.Cond = copy_cond_command (command->value.Cond); + break; +#endif + + case cm_simple: + new_command->value.Simple = copy_simple_command (command->value.Simple); + break; + + case cm_connection: + { + CONNECTION *new_connection; + + new_connection = (CONNECTION *)xmalloc (sizeof (CONNECTION)); + new_connection->connector = command->value.Connection->connector; + new_connection->first = copy_command (command->value.Connection->first); + new_connection->second = copy_command (command->value.Connection->second); + new_command->value.Connection = new_connection; + break; + } + + case cm_function_def: + new_command->value.Function_def = copy_function_def (command->value.Function_def); + break; + } + return (new_command); +} diff --git a/cross-build/cygwin32.cache b/cross-build/cygwin32.cache new file mode 100644 index 0000000..36948da --- /dev/null +++ b/cross-build/cygwin32.cache @@ -0,0 +1,251 @@ +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overriden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +ac_cv_build=${ac_cv_build='i686-pc-cygwin'} +ac_cv_build_alias=${ac_cv_build_alias='i686-pc-cygwin'} +ac_cv_c_bigendian=${ac_cv_c_bigendian='no'} +ac_cv_c_char_unsigned=${ac_cv_c_char_unsigned='no'} +ac_cv_c_compiler_gnu=${ac_cv_c_compiler_gnu='yes'} +ac_cv_c_const=${ac_cv_c_const='yes'} +ac_cv_c_inline=${ac_cv_c_inline='inline'} +ac_cv_c_long_double=${ac_cv_c_long_double='yes'} +ac_cv_c_stringize=${ac_cv_c_stringize='yes'} +ac_cv_decl_sys_siglist=${ac_cv_decl_sys_siglist='no'} +ac_cv_exeext=${ac_cv_exeext='.exe'} +ac_cv_func___setostype=${ac_cv_func___setostype='no'} +ac_cv_func__doprnt=${ac_cv_func__doprnt='no'} +ac_cv_func_alloca_works=${ac_cv_func_alloca_works='yes'} +ac_cv_func_asprintf=${ac_cv_func_asprintf='no'} +ac_cv_func_bcopy=${ac_cv_func_bcopy='yes'} +ac_cv_func_bindtextdomain=${ac_cv_func_bindtextdomain='no'} +ac_cv_func_bzero=${ac_cv_func_bzero='yes'} +ac_cv_func_confstr=${ac_cv_func_confstr='no'} +ac_cv_func_dlclose=${ac_cv_func_dlclose='yes'} +ac_cv_func_dlopen=${ac_cv_func_dlopen='yes'} +ac_cv_func_dlsym=${ac_cv_func_dlsym='yes'} +ac_cv_func_dup2=${ac_cv_func_dup2='yes'} +ac_cv_func_fnmatch=${ac_cv_func_fnmatch='no'} +ac_cv_func_getaddrinfo=${ac_cv_func_getaddrinfo='no'} +ac_cv_func_getcwd=${ac_cv_func_getcwd='yes'} +ac_cv_func_getdtablesize=${ac_cv_func_getdtablesize='yes'} +ac_cv_func_getgroups=${ac_cv_func_getgroups='yes'} +ac_cv_func_gethostbyname=${ac_cv_func_gethostbyname='yes'} +ac_cv_func_gethostname=${ac_cv_func_gethostname='yes'} +ac_cv_func_getpagesize=${ac_cv_func_getpagesize='yes'} +ac_cv_func_getpeername=${ac_cv_func_getpeername='yes'} +ac_cv_func_getpgrp_void=${ac_cv_func_getpgrp_void='yes'} +ac_cv_func_getrlimit=${ac_cv_func_getrlimit='yes'} +ac_cv_func_getrusage=${ac_cv_func_getrusage='yes'} +ac_cv_func_getservbyname=${ac_cv_func_getservbyname='yes'} +ac_cv_func_gettext=${ac_cv_func_gettext='no'} +ac_cv_func_gettimeofday=${ac_cv_func_gettimeofday='yes'} +ac_cv_func_inet_aton=${ac_cv_func_inet_aton='yes'} +ac_cv_func_isascii=${ac_cv_func_isascii='yes'} +ac_cv_func_isblank=${ac_cv_func_isblank='no'} +ac_cv_func_isgraph=${ac_cv_func_isgraph='yes'} +ac_cv_func_isprint=${ac_cv_func_isprint='yes'} +ac_cv_func_isspace=${ac_cv_func_isspace='yes'} +ac_cv_func_isxdigit=${ac_cv_func_isxdigit='yes'} +ac_cv_func_killpg=${ac_cv_func_killpg='yes'} +ac_cv_func_lstat=${ac_cv_func_lstat='yes'} +ac_cv_func_memmove=${ac_cv_func_memmove='yes'} +ac_cv_func_mkfifo=${ac_cv_func_mkfifo='yes'} +ac_cv_func_pathconf=${ac_cv_func_pathconf='yes'} +ac_cv_func_putenv=${ac_cv_func_putenv='yes'} +ac_cv_func_readlink=${ac_cv_func_readlink='yes'} +ac_cv_func_rename=${ac_cv_func_rename='yes'} +ac_cv_func_sbrk=${ac_cv_func_sbrk='yes'} +ac_cv_func_select=${ac_cv_func_select='yes'} +ac_cv_func_setdtablesize=${ac_cv_func_setdtablesize='yes'} +ac_cv_func_setenv=${ac_cv_func_setenv='yes'} +ac_cv_func_setlinebuf=${ac_cv_func_setlinebuf='no'} +ac_cv_func_setlocale=${ac_cv_func_setlocale='yes'} +ac_cv_func_setvbuf=${ac_cv_func_setvbuf='yes'} +ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed='no'} +ac_cv_func_siginterrupt=${ac_cv_func_siginterrupt='no'} +ac_cv_func_snprintf=${ac_cv_func_snprintf='yes'} +ac_cv_func_strcasecmp=${ac_cv_func_strcasecmp='yes'} +ac_cv_func_strchr=${ac_cv_func_strchr='yes'} +ac_cv_func_strcoll_works=${ac_cv_func_strcoll_works='yes'} +ac_cv_func_strerror=${ac_cv_func_strerror='yes'} +ac_cv_func_strpbrk=${ac_cv_func_strpbrk='yes'} +ac_cv_func_strtod=${ac_cv_func_strtod='yes'} +ac_cv_func_strtoimax=${ac_cv_func_strtoimax='no'} +ac_cv_func_strtol=${ac_cv_func_strtol='yes'} +ac_cv_func_strtoll=${ac_cv_func_strtoll='no'} +ac_cv_func_strtoul=${ac_cv_func_strtoul='yes'} +ac_cv_func_strtoull=${ac_cv_func_strtoull='no'} +ac_cv_func_strtoumax=${ac_cv_func_strtoumax='no'} +ac_cv_func_sysconf=${ac_cv_func_sysconf='yes'} +ac_cv_func_tcgetattr=${ac_cv_func_tcgetattr='yes'} +ac_cv_func_tcgetpgrp=${ac_cv_func_tcgetpgrp='yes'} +ac_cv_func_textdomain=${ac_cv_func_textdomain='no'} +ac_cv_func_times=${ac_cv_func_times='yes'} +ac_cv_func_ttyname=${ac_cv_func_ttyname='yes'} +ac_cv_func_tzset=${ac_cv_func_tzset='yes'} +ac_cv_func_ulimit=${ac_cv_func_ulimit='no'} +ac_cv_func_uname=${ac_cv_func_uname='yes'} +ac_cv_func_vasprintf=${ac_cv_func_vasprintf='no'} +ac_cv_func_vprintf=${ac_cv_func_vprintf='yes'} +ac_cv_func_vsnprintf=${ac_cv_func_vsnprintf='yes'} +ac_cv_func_wait3=${ac_cv_func_wait3='yes'} +ac_cv_func_waitpid=${ac_cv_func_waitpid='yes'} +ac_cv_have_decl_confstr=${ac_cv_have_decl_confstr='no'} +ac_cv_have_decl_printf=${ac_cv_have_decl_printf='yes'} +ac_cv_have_decl_sbrk=${ac_cv_have_decl_sbrk='yes'} +ac_cv_have_decl_strsignal=${ac_cv_have_decl_strsignal='yes'} +ac_cv_have_decl_strtold=${ac_cv_have_decl_strtold='no'} +ac_cv_header_arpa_inet_h=${ac_cv_header_arpa_inet_h='yes'} +ac_cv_header_dirent_dirent_h=${ac_cv_header_dirent_dirent_h='yes'} +ac_cv_header_dlfcn_h=${ac_cv_header_dlfcn_h='yes'} +ac_cv_header_grp_h=${ac_cv_header_grp_h='yes'} +ac_cv_header_inttypes_h=${ac_cv_header_inttypes_h='no'} +ac_cv_header_libintl_h=${ac_cv_header_libintl_h='yes'} +ac_cv_header_limits_h=${ac_cv_header_limits_h='yes'} +ac_cv_header_locale_h=${ac_cv_header_locale_h='yes'} +ac_cv_header_memory_h=${ac_cv_header_memory_h='yes'} +ac_cv_header_minix_config_h=${ac_cv_header_minix_config_h='no'} +ac_cv_header_netdb_h=${ac_cv_header_netdb_h='yes'} +ac_cv_header_netinet_in_h=${ac_cv_header_netinet_in_h='yes'} +ac_cv_header_stat_broken=${ac_cv_header_stat_broken='no'} +ac_cv_header_stdarg_h=${ac_cv_header_stdarg_h='yes'} +ac_cv_header_stdc=${ac_cv_header_stdc='yes'} +ac_cv_header_stddef_h=${ac_cv_header_stddef_h='yes'} +ac_cv_header_stdint_h=${ac_cv_header_stdint_h='no'} +ac_cv_header_stdlib_h=${ac_cv_header_stdlib_h='yes'} +ac_cv_header_string_h=${ac_cv_header_string_h='yes'} +ac_cv_header_strings_h=${ac_cv_header_strings_h='yes'} +ac_cv_header_sys_file_h=${ac_cv_header_sys_file_h='yes'} +ac_cv_header_sys_param_h=${ac_cv_header_sys_param_h='yes'} +ac_cv_header_sys_pte_h=${ac_cv_header_sys_pte_h='no'} +ac_cv_header_sys_ptem_h=${ac_cv_header_sys_ptem_h='no'} +ac_cv_header_sys_resource_h=${ac_cv_header_sys_resource_h='yes'} +ac_cv_header_sys_select_h=${ac_cv_header_sys_select_h='yes'} +ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h='yes'} +ac_cv_header_sys_stat_h=${ac_cv_header_sys_stat_h='yes'} +ac_cv_header_sys_stream_h=${ac_cv_header_sys_stream_h='no'} +ac_cv_header_sys_time_h=${ac_cv_header_sys_time_h='yes'} +ac_cv_header_sys_times_h=${ac_cv_header_sys_times_h='yes'} +ac_cv_header_sys_types_h=${ac_cv_header_sys_types_h='yes'} +ac_cv_header_sys_wait_h=${ac_cv_header_sys_wait_h='yes'} +ac_cv_header_termcap_h=${ac_cv_header_termcap_h='yes'} +ac_cv_header_termio_h=${ac_cv_header_termio_h='yes'} +ac_cv_header_termios_h=${ac_cv_header_termios_h='yes'} +ac_cv_header_time=${ac_cv_header_time='yes'} +ac_cv_header_unistd_h=${ac_cv_header_unistd_h='yes'} +ac_cv_header_varargs_h=${ac_cv_header_varargs_h='yes'} +ac_cv_host=${ac_cv_host='i686-pc-cygwin'} +ac_cv_host_alias=${ac_cv_host_alias='i686-pc-cygwin'} +ac_cv_lib_dir_opendir=${ac_cv_lib_dir_opendir='no'} +ac_cv_lib_dl_dlopen=${ac_cv_lib_dl_dlopen='no'} +ac_cv_lib_intl_bindtextdomain=${ac_cv_lib_intl_bindtextdomain='yes'} +ac_cv_lib_termcap_tgetent=${ac_cv_lib_termcap_tgetent='yes'} +ac_cv_member_struct_stat_st_blocks=${ac_cv_member_struct_stat_st_blocks='yes'} +ac_cv_member_struct_termio_c_line=${ac_cv_member_struct_termio_c_line='yes'} +ac_cv_member_struct_termios_c_line=${ac_cv_member_struct_termios_c_line='yes'} +ac_cv_objext=${ac_cv_objext='o'} +ac_cv_path_install=${ac_cv_path_install='/usr/bin/install -c'} +ac_cv_prog_AR=${ac_cv_prog_AR='ar'} +ac_cv_prog_CPP=${ac_cv_prog_CPP='gcc -E'} +ac_cv_prog_YACC=${ac_cv_prog_YACC='bison -y'} +ac_cv_prog_ac_ct_CC=${ac_cv_prog_ac_ct_CC='gcc'} +ac_cv_prog_ac_ct_RANLIB=${ac_cv_prog_ac_ct_RANLIB='ranlib'} +ac_cv_prog_cc_g=${ac_cv_prog_cc_g='yes'} +ac_cv_prog_cc_stdc=${ac_cv_prog_cc_stdc=''} +ac_cv_prog_gcc_traditional=${ac_cv_prog_gcc_traditional='no'} +ac_cv_prog_make_make_set=${ac_cv_prog_make_make_set='yes'} +ac_cv_sizeof_char=${ac_cv_sizeof_char='1'} +ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p='4'} +ac_cv_sizeof_double=${ac_cv_sizeof_double='8'} +ac_cv_sizeof_int=${ac_cv_sizeof_int='4'} +ac_cv_sizeof_long=${ac_cv_sizeof_long='4'} +ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long='8'} +ac_cv_sizeof_short=${ac_cv_sizeof_short='2'} +ac_cv_sys_file_offset_bits=${ac_cv_sys_file_offset_bits='no'} +ac_cv_sys_interpreter=${ac_cv_sys_interpreter='yes'} +ac_cv_sys_large_files=${ac_cv_sys_large_files='no'} +ac_cv_sys_largefile_CC=${ac_cv_sys_largefile_CC='no'} +ac_cv_sys_posix_termios=${ac_cv_sys_posix_termios='yes'} +ac_cv_sys_tiocgwinsz_in_termios_h=${ac_cv_sys_tiocgwinsz_in_termios_h='yes'} +ac_cv_type_bits16_t=${ac_cv_type_bits16_t='no'} +ac_cv_type_bits32_t=${ac_cv_type_bits32_t='no'} +ac_cv_type_bits64_t=${ac_cv_type_bits64_t='no'} +ac_cv_type_char=${ac_cv_type_char='yes'} +ac_cv_type_char_p=${ac_cv_type_char_p='yes'} +ac_cv_type_double=${ac_cv_type_double='yes'} +ac_cv_type_getgroups=${ac_cv_type_getgroups='gid_t'} +ac_cv_type_int=${ac_cv_type_int='yes'} +ac_cv_type_long=${ac_cv_type_long='yes'} +ac_cv_type_long_long=${ac_cv_type_long_long='yes'} +ac_cv_type_mode_t=${ac_cv_type_mode_t='yes'} +ac_cv_type_off_t=${ac_cv_type_off_t='yes'} +ac_cv_type_pid_t=${ac_cv_type_pid_t='yes'} +ac_cv_type_ptrdiff_t=${ac_cv_type_ptrdiff_t='yes'} +ac_cv_type_short=${ac_cv_type_short='yes'} +ac_cv_type_signal=${ac_cv_type_signal='void'} +ac_cv_type_size_t=${ac_cv_type_size_t='yes'} +ac_cv_type_ssize_t=${ac_cv_type_ssize_t='yes'} +ac_cv_type_time_t=${ac_cv_type_time_t='yes'} +ac_cv_type_u_bits16_t=${ac_cv_type_u_bits16_t='no'} +ac_cv_type_u_bits32_t=${ac_cv_type_u_bits32_t='no'} +ac_cv_type_u_int=${ac_cv_type_u_int='yes'} +ac_cv_type_u_long=${ac_cv_type_u_long='yes'} +ac_cv_type_uid_t=${ac_cv_type_uid_t='yes'} +ac_cv_working_alloca_h=${ac_cv_working_alloca_h='no'} + +bash_cv_decl_strtoimax=${bash_cv_decl_strtoimax='no'} +bash_cv_decl_strtol=${bash_cv_decl_strtol='yes'} +bash_cv_decl_strtoll=${bash_cv_decl_strtoll='no'} +bash_cv_decl_strtoul=${bash_cv_decl_strtoul='yes'} +bash_cv_decl_strtoull=${bash_cv_decl_strtoull='no'} +bash_cv_decl_strtoumax=${bash_cv_decl_strtoumax='no'} +bash_cv_decl_under_sys_siglist=${bash_cv_decl_under_sys_siglist='no'} +bash_cv_dev_fd=${bash_cv_dev_fd='absent'} +bash_cv_dev_stdin=${bash_cv_dev_stdin='absent'} +bash_cv_dirent_has_d_fileno=${bash_cv_dirent_has_d_fileno='no'} +bash_cv_dirent_has_dino=${bash_cv_dirent_has_dino='yes'} +bash_cv_dup2_broken=${bash_cv_dup2_broken='no'} +bash_cv_fionread_in_ioctl=${bash_cv_fionread_in_ioctl='no'} +bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp='present'} +bash_cv_func_strcoll_broken=${bash_cv_func_strcoll_broken='no'} +bash_cv_getenv_redef=${bash_cv_getenv_redef='yes'} +bash_cv_getpw_declared=${bash_cv_getpw_declared='yes'} +bash_cv_have_strsignal=${bash_cv_have_strsignal='yes'} +bash_cv_job_control_missing=${bash_cv_job_control_missing='present'} +bash_cv_mail_dir=${bash_cv_mail_dir='unknown'} +bash_cv_must_reinstall_sighandlers=${bash_cv_must_reinstall_sighandlers='no'} +bash_cv_opendir_not_robust=${bash_cv_opendir_not_robust='no'} +bash_cv_pgrp_pipe=${bash_cv_pgrp_pipe='no'} +bash_cv_printf_a_format=${bash_cv_printf_a_format='no'} +bash_cv_signal_vintage=${bash_cv_signal_vintage='posix'} +bash_cv_speed_t_in_sys_types=${bash_cv_speed_t_in_sys_types='no'} +bash_cv_struct_timeval=${bash_cv_struct_timeval='yes'} +bash_cv_struct_winsize_header=${bash_cv_struct_winsize_header='termios_h'} +bash_cv_sys_errlist=${bash_cv_sys_errlist='no'} +bash_cv_sys_named_pipes=${bash_cv_sys_named_pipes='present'} +bash_cv_sys_siglist=${bash_cv_sys_siglist='no'} +bash_cv_termcap_lib=${bash_cv_termcap_lib='libtermcap'} +bash_cv_tiocstat_in_ioctl=${bash_cv_tiocstat_in_ioctl='no'} +bash_cv_type_clock_t=${bash_cv_type_clock_t='yes'} +bash_cv_type_intmax_t=${bash_cv_type_intmax_t='no'} +bash_cv_type_long_long=${bash_cv_type_long_long='long long'} +bash_cv_type_quad_t=${bash_cv_type_quad_t='no'} +bash_cv_type_rlimit=${bash_cv_type_rlimit='rlim_t'} +bash_cv_type_sigset_t=${bash_cv_type_sigset_t='yes'} +bash_cv_type_socklen_t=${bash_cv_type_socklen_t='no'} +bash_cv_type_uintmax_t=${bash_cv_type_uintmax_t='no'} +bash_cv_type_unsigned_long_long=${bash_cv_type_unsigned_long_long='unsigned long long'} +bash_cv_ulimit_maxfds=${bash_cv_ulimit_maxfds='no'} +bash_cv_under_sys_siglist=${bash_cv_under_sys_siglist='no'} +bash_cv_unusable_rtsigs=${bash_cv_unusable_rtsigs='no'} +bash_cv_void_sighandler=${bash_cv_void_sighandler='yes'} diff --git a/cross-build/opennt.cache b/cross-build/opennt.cache new file mode 100644 index 0000000..ca5e7cd --- /dev/null +++ b/cross-build/opennt.cache @@ -0,0 +1,169 @@ +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +ac_cv_c_bigendian=${ac_cv_c_bigendian=no} +ac_cv_decl_sys_siglist=${ac_cv_decl_sys_siglist=no} +ac_cv_func___setostype=${ac_cv_func___setostype=no} +ac_cv_func_alloca_works=${ac_cv_func_alloca_works=yes} +ac_cv_func_bcopy=${ac_cv_func_bcopy=yes} +ac_cv_func_bindtextdomain=${ac_cv_func_bindtextdomain=no} +ac_cv_func_bzero=${ac_cv_func_bzero=yes} +ac_cv_func_confstr=${ac_cv_func_confstr=yes} +ac_cv_func_dlclose=${ac_cv_func_dlclose=no} +ac_cv_func_dlopen=${ac_cv_func_dlopen=no} +ac_cv_func_dlsym=${ac_cv_func_dlsym=no} +ac_cv_func_dup2=${ac_cv_func_dup2=yes} +ac_cv_func_getcwd=${ac_cv_func_getcwd=yes} +ac_cv_func_getdtablesize=${ac_cv_func_getdtablesize=no} +ac_cv_func_getgroups=${ac_cv_func_getgroups=yes} +ac_cv_func_gethostname=${ac_cv_func_gethostname=yes} +ac_cv_func_getpagesize=${ac_cv_func_getpagesize=yes} +ac_cv_func_getpeername=${ac_cv_func_getpeername=yes} +ac_cv_func_getpgrp_void=${ac_cv_func_getpgrp_void=yes} +ac_cv_func_getrlimit=${ac_cv_func_getrlimit=no} +ac_cv_func_getrusage=${ac_cv_func_getrusage=no} +ac_cv_func_gettext=${ac_cv_func_gettext=no} +ac_cv_func_gettimeofday=${ac_cv_func_gettimeofday=yes} +ac_cv_func_killpg=${ac_cv_func_killpg=yes} +ac_cv_func_lstat=${ac_cv_func_lstat=no} +ac_cv_func_memmove=${ac_cv_func_memmove=yes} +ac_cv_func_mkfifo=${ac_cv_func_mkfifo=yes} +ac_cv_func_putenv=${ac_cv_func_putenv=yes} +ac_cv_func_rename=${ac_cv_func_rename=yes} +ac_cv_func_sbrk=${ac_cv_func_sbrk=no} +ac_cv_func_select=${ac_cv_func_select=yes} +ac_cv_func_setdtablesize=${ac_cv_func_setdtablesize=no} +ac_cv_func_setenv=${ac_cv_func_setenv=yes} +ac_cv_func_setlinebuf=${ac_cv_func_setlinebuf=yes} +ac_cv_func_setlocale=${ac_cv_func_setlocale=yes} +ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no} +ac_cv_func_siginterrupt=${ac_cv_func_siginterrupt=no} +ac_cv_func_strcasecmp=${ac_cv_func_strcasecmp=yes} +ac_cv_func_strchr=${ac_cv_func_strchr=yes} +ac_cv_func_strcoll_works=${ac_cv_func_strcoll_works=yes} +ac_cv_func_strerror=${ac_cv_func_strerror=yes} +ac_cv_func_strtod=${ac_cv_func_strtod=yes} +ac_cv_func_strtol=${ac_cv_func_strtol=yes} +ac_cv_func_strtoul=${ac_cv_func_strtoul=yes} +ac_cv_func_sysconf=${ac_cv_func_sysconf=yes} +ac_cv_func_tcgetattr=${ac_cv_func_tcgetattr=yes} +ac_cv_func_tcgetpgrp=${ac_cv_func_tcgetpgrp=yes} +ac_cv_func_textdomain=${ac_cv_func_textdomain=no} +ac_cv_func_times=${ac_cv_func_times=yes} +ac_cv_func_tzset=${ac_cv_func_tzset=yes} +ac_cv_func_ulimit=${ac_cv_func_ulimit=no} +ac_cv_func_uname=${ac_cv_func_uname=yes} +ac_cv_func_vprintf=${ac_cv_func_vprintf=yes} +ac_cv_func_wait3=${ac_cv_func_wait3=no} +ac_cv_func_wait3_rusage=${ac_cv_func_wait3_rusage=no} +ac_cv_func_waitpid=${ac_cv_func_waitpid=yes} +ac_cv_header_alloca_h=${ac_cv_header_alloca_h=no} +ac_cv_header_dirent_dirent_h=${ac_cv_header_dirent_dirent_h=yes} +ac_cv_header_dlfcn_h=${ac_cv_header_dlfcn_h=no} +ac_cv_header_libintl_h=${ac_cv_header_libintl_h=no} +ac_cv_header_limits_h=${ac_cv_header_limits_h=yes} +ac_cv_header_locale_h=${ac_cv_header_locale_h=yes} +ac_cv_header_memory_h=${ac_cv_header_memory_h=yes} +ac_cv_header_minix_config_h=${ac_cv_header_minix_config_h=no} +ac_cv_header_stat_broken=${ac_cv_header_stat_broken=no} +ac_cv_header_stdarg_h=${ac_cv_header_stdarg_h=yes} +ac_cv_header_stdc=${ac_cv_header_stdc=yes} +ac_cv_header_stdlib_h=${ac_cv_header_stdlib_h=yes} +ac_cv_header_string_h=${ac_cv_header_string_h=yes} +ac_cv_header_sys_file_h=${ac_cv_header_sys_file_h=yes} +ac_cv_header_sys_param_h=${ac_cv_header_sys_param_h=yes} +ac_cv_header_sys_pte_h=${ac_cv_header_sys_pte_h=no} +ac_cv_header_sys_ptem_h=${ac_cv_header_sys_ptem_h=no} +ac_cv_header_sys_resource_h=${ac_cv_header_sys_resource_h=no} +ac_cv_header_sys_select_h=${ac_cv_header_sys_select_h=no} +ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=yes} +ac_cv_header_sys_stream_h=${ac_cv_header_sys_stream_h=no} +ac_cv_header_sys_time_h=${ac_cv_header_sys_time_h=yes} +ac_cv_header_sys_times_h=${ac_cv_header_sys_times_h=yes} +ac_cv_header_sys_wait_h=${ac_cv_header_sys_wait_h=yes} +ac_cv_header_termcap_h=${ac_cv_header_termcap_h=no} +ac_cv_header_termio_h=${ac_cv_header_termio_h=no} +ac_cv_header_termios_h=${ac_cv_header_termios_h=yes} +ac_cv_header_time=${ac_cv_header_time=yes} +ac_cv_header_unistd_h=${ac_cv_header_unistd_h=yes} +ac_cv_header_varargs_h=${ac_cv_header_varargs_h=no} +ac_cv_lib_dir_opendir=${ac_cv_lib_dir_opendir=no} +ac_cv_lib_dl_dlopen=${ac_cv_lib_dl_dlopen=no} +ac_cv_lib_intl_bindtextdomain=${ac_cv_lib_intl_bindtextdomain=no} +ac_cv_lib_termcap_tgetent=${ac_cv_lib_termcap_tgetent=yes} +ac_cv_path_install=${ac_cv_path_install='$INTERIX_ROOT/bin/install -c'} +ac_cv_prog_AR=${ac_cv_prog_AR=ar} +ac_cv_prog_CC=${ac_cv_prog_CC=gcc} +ac_cv_prog_CPP=${ac_cv_prog_CPP='cc -E'} +ac_cv_prog_RANLIB=${ac_cv_prog_RANLIB=:} +ac_cv_prog_cc_cross=${ac_cv_prog_cc_cross=no} +ac_cv_prog_cc_g=${ac_cv_prog_cc_g=yes} +ac_cv_prog_cc_works=${ac_cv_prog_cc_works=yes} +ac_cv_prog_gcc=${ac_cv_prog_gcc=yes} +ac_cv_prog_gcc_traditional=${ac_cv_prog_gcc_traditional=no} +ac_cv_prog_make_make_set=${ac_cv_prog_make_make_set=yes} +ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p=4} +ac_cv_sizeof_double=${ac_cv_sizeof_double=8} +ac_cv_sizeof_int=${ac_cv_sizeof_int=4} +ac_cv_sizeof_long=${ac_cv_sizeof_long=4} +ac_cv_sys_interpreter=${ac_cv_sys_interpreter=yes} +ac_cv_sys_restartable_syscalls=${ac_cv_sys_restartable_syscalls=no} +ac_cv_type_getgroups=${ac_cv_type_getgroups=gid_t} +ac_cv_type_mode_t=${ac_cv_type_mode_t=yes} +ac_cv_type_off_t=${ac_cv_type_off_t=yes} +ac_cv_type_pid_t=${ac_cv_type_pid_t=yes} +ac_cv_type_signal=${ac_cv_type_signal=void} +ac_cv_type_size_t=${ac_cv_type_size_t=yes} +ac_cv_type_time_t=${ac_cv_type_time_t=yes} +ac_cv_type_uid_t=${ac_cv_type_uid_t=yes} +bash_cv_can_redecl_getpw=${bash_cv_can_redecl_getpw=yes} +bash_cv_decl_under_sys_siglist=${bash_cv_decl_under_sys_siglist=no} +bash_cv_dev_fd=${bash_cv_dev_fd=absent} +bash_cv_dirent_has_d_fileno=${bash_cv_dirent_has_d_fileno=no} +bash_cv_dirent_has_dino=${bash_cv_dirent_has_dino=yes} +bash_cv_dup2_broken=${bash_cv_dup2_broken=no} +bash_cv_fionread_in_ioctl=${bash_cv_fionread_in_ioctl=yes} +bash_cv_func_lstat=${bash_cv_func_lstat=no} +bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present} +bash_cv_func_strcoll_broken=${bash_cv_func_strcoll_broken=no} +bash_cv_getcwd_calls_popen=${bash_cv_getcwd_calls_popen=no} +bash_cv_getenv_redef=${bash_cv_getenv_redef=yes} +bash_cv_have_strsignal=${bash_cv_have_strsignal=yes} +bash_cv_job_control_missing=${bash_cv_job_control_missing=present} +bash_cv_mail_dir=${bash_cv_mail_dir=/usr/spool/mail} +bash_cv_must_reinstall_sighandlers=${bash_cv_must_reinstall_sighandlers=no} +bash_cv_opendir_not_robust=${bash_cv_opendir_not_robust=no} +bash_cv_pgrp_pipe=${bash_cv_pgrp_pipe=no} +bash_cv_printf_declared=${bash_cv_printf_declared=yes} +bash_cv_sbrk_declared=${bash_cv_sbrk_declared=no} +bash_cv_signal_vintage=${bash_cv_signal_vintage=posix} +bash_cv_speed_t_in_sys_types=${bash_cv_speed_t_in_sys_types=no} +bash_cv_struct_timeval=${bash_cv_struct_timeval=yes} +bash_cv_struct_winsize_header=${bash_cv_struct_winsize_header=ioctl_h} +bash_cv_struct_winsize_in_ioctl=${bash_cv_struct_winsize_in_ioctl=yes} +bash_cv_sys_errlist=${bash_cv_sys_errlist=yes} +bash_cv_sys_named_pipes=${bash_cv_sys_named_pipes=present} +bash_cv_sys_siglist=${bash_cv_sys_siglist=yes} +bash_cv_termcap_lib=${bash_cv_termcap_lib=libtermcap} +bash_cv_termio_ldisc=${bash_cv_termio_ldisc=no} +bash_cv_termios_ldisc=${bash_cv_termios_ldisc=no} +bash_cv_tiocgwinsz_in_ioctl=${bash_cv_tiocgwinsz_in_ioctl=yes} +bash_cv_tiocstat_in_ioctl=${bash_cv_tiocstat_in_ioctl=no} +bash_cv_type_clock_t=${bash_cv_type_clock_t=yes} +bash_cv_type_quad_t=${bash_cv_type_quad_t=yes} +bash_cv_type_rlimit=${bash_cv_type_rlimit=long} +bash_cv_type_sigset_t=${bash_cv_type_sigset_t=yes} +bash_cv_ulimit_maxfds=${bash_cv_ulimit_maxfds=no} +bash_cv_under_sys_siglist=${bash_cv_under_sys_siglist=no} +bash_cv_void_sighandler=${bash_cv_void_sighandler=yes} diff --git a/cross-build/x86-beos.cache b/cross-build/x86-beos.cache new file mode 100644 index 0000000..351aa21 --- /dev/null +++ b/cross-build/x86-beos.cache @@ -0,0 +1,45 @@ +# This file is a shell script that caches the results of configure +# tests for x86 BeOS so they don't need to be done when cross-compiling. + +# AC_FUNC_GETPGRP should also define GETPGRP_VOID +ac_cv_func_getpgrp_void=${ac_cv_func_getpgrp_void='yes'} +# AC_FUNC_SETVBUF_REVERSED should not define anything else +ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed='no'} +# on BeOS, system calls do not restart +ac_cv_sys_restartable_syscalls=${ac_cv_sys_restartable_syscalls='no'} +bash_cv_sys_restartable_syscalls=${bash_cv_sys_restartable_syscalls='no'} + +ac_cv_func_tcgetattr=${ac_cv_func_tcgetattr='yes'} + +# x86 BeOS is little endian +ac_cv_c_bigendian=${ac_cv_c_bigendian='no'} +ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p='4'} +ac_cv_sizeof_int=${ac_cv_sizeof_int='4'} +ac_cv_sizeof_long=${ac_cv_sizeof_long='4'} +ac_cv_sizeof_double=${ac_cv_sizeof_double='8'} + +bash_cv_dev_fd=${bash_cv_dev_fd='absent'} +bash_cv_dup2_broken=${bash_cv_dup2_broken='no'} +bash_cv_pgrp_pipe=${bash_cv_pgrp_pipe='no'} +bash_cv_type_rlimit=${bash_cv_type_rlimit='long'} +bash_cv_decl_under_sys_siglist=${bash_cv_decl_under_sys_siglist='no'} +bash_cv_under_sys_siglist=${bash_cv_under_sys_siglist='no'} +bash_cv_sys_siglist=${bash_cv_sys_siglist='yes'} +bash_cv_opendir_not_robust=${bash_cv_opendir_not_robust='no'} +bash_cv_getenv_redef=${bash_cv_getenv_redef='yes'} +bash_cv_printf_declared=${bash_cv_printf_declared='yes'} +bash_cv_ulimit_maxfds=${bash_cv_ulimit_maxfds='no'} +bash_cv_getcwd_calls_popen=${bash_cv_getcwd_calls_popen='no'} +bash_cv_must_reinstall_sighandlers=${bash_cv_must_reinstall_sighandlers='no'} +bash_cv_job_control_missing=${bash_cv_job_control_missing='present'} +bash_cv_sys_named_pipes=${bash_cv_sys_named_pipes='present'} +bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp='missing'} +bash_cv_mail_dir=${bash_cv_mail_dir='unknown'} +bash_cv_func_strcoll_broken=${bash_cv_func_strcoll_broken='no'} + +bash_cv_type_int32_t=${bash_cv_type_int32_t='int'} +bash_cv_type_u_int32_t=${bash_cv_type_u_int32_t='int'} + +ac_cv_type_bits64_t=${ac_cv_type_bits64_t='no'} + +# end of cross-build/x86-beos.cache diff --git a/debian/FAQ b/debian/FAQ new file mode 100644 index 0000000..a866068 --- /dev/null +++ b/debian/FAQ @@ -0,0 +1,35 @@ +[ The original document has a license, which doesn't allow inclusion of the + FAQ in the main section of the Debian packages and therefore isn't + distributed in the Debian packages for bash. Pleae get it from the upstream + location. +] + +----------- +This is the Bash FAQ, version 3.20, for Bash version 2.05b. + +This document contains a set of frequently-asked questions concerning +Bash, the GNU Bourne-Again Shell. Bash is a freely-available command +interpreter with advanced features for both interactive use and shell +programming. + +Another good source of basic information about shells is the collection +of FAQ articles periodically posted to comp.unix.shell. + +Questions and comments concerning this document should be sent to +chet@po.cwru.edu. + +This document is available for anonymous FTP with the URL + +ftp://ftp.cwru.edu/pub/bash/FAQ + +The Bash home page is http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html + +The original document has the following license: +----------- +This document is Copyright 1995-2002 by Chester Ramey. + +Permission is hereby granted, without written agreement and +without license or royalty fees, to use, copy, and distribute +this document for any purpose, provided that the above copyright +notice appears in all copies of this document and that the +contents of this document remain unaltered. diff --git a/debian/README b/debian/README new file mode 100644 index 0000000..bb5e878 --- /dev/null +++ b/debian/README @@ -0,0 +1,122 @@ +Bash Configuration for Debian +----------------------------- + +A number of patches for the bash sources is applied for the Debian build +of bash. See the details at the end of the file. + +The bash package was built using the following configuration options: + + --with-curses \ + --enable-largefile \ + +bash-static additionally configured with --enable-static-link. + +The upstream ChangeLog can be found in the bash-doc package. + + +A kind of FAQ for bash on Debian GNU/{Linux,Hurd} +------------------------------------------------- + +1. symlinked directory completion behavior + + Starting with readline-4.2a, completion on symlinks that point + to directories does not append the slash. To restore the behaviour + found in readline-4.2, add to /etc/inputrc or ~/.inputrc: + + set mark-symlinked-directories on + +2. How can I make bash 8-bit clean so I can type hi-bit characters + directly? + + Remove the comments from the indicated lines in /etc/inputrc. + It doesn't ship this way because otherwise the Meta bindings will not work. + +3. How to get rid off annoying beeps for ambiguous completions? + + Put in /etc/inputrc (or in your ~/.inputrc): + + set show-all-if-ambiguous on + + Other people prefer: + + set bell-style none + +4. bash doesn't display prompts correctly. + + When using colors in prompts (or escape characters), then make sure + those characters are surrounded by \[ and \]. For more information + look at the man page bash(1) and search for PROMPTING. + +5. What is /etc/bash.bashrc? It doesn't seem to be documented. + + The Debian version of bash is compiled with a special option + (-DSYS_BASHRC) that makes bash read /etc/bash.bashrc before ~/.bashrc + for interactive non-login shells. So, on Debian systems, + /etc/bash.bashrc is to ~/.bashrc as /etc/profile is to + ~/.bash_profile. + +6. bash does not check $PATH if hash fails + + bash hashes the location of recently executed commands. When a command + is moved to a new location in the PATH, the command is still in the PATH + but the hash table still records the old location. + + For performance reasons bash does not remove the command from the hash + and relook it up in PATH. + + Use 'hash -r' manually or set a bash option: 'shopt -s checkhash'. + +7. Bourne-style shells have always accepted multiple directory name arguments + to cd. If the user doesn't like it, have him define a shell function: + + cd() + { + case $# in + 0|1) ;; + *) echo "cd: too many arguments ; return 2 ;; + esac + builtin cd "$@" + } + +8. key bindings for ESC + + Consider the following .inputrc: + + set editing-mode vi + + keymap vi + "\M-[D": backward-char + "\M-[C": forward-char + "\M-[A": previous-history + "\M-[B": next-history + + And, just to be certain, set -o reports that vi is on. + + However, ESC k does not send me to the previous line. + + I'm guessing that this is a conflict between bash's concept of a meta + keymap and its concept of vi's command-mode character -- which is to + say that its data structures don't properly reflect its implementation. + + Note that if I remove the meta prefix, leaving lines like: + "[A": previous-history + + That vi command mode keys work fine, and I can use the arrow keys in vi + mode, *provided I'm already in command mode already*. In other words, + bash is doing something wrong here such that it doesn't see the escape + character at the beginning of the key sequence even when in vi insert mode. + + Comment from the upstream author: "This guy destroyed the key binding for + ESC, which effectively disabled vi command mode. It's not as simple as he + paints it to be -- the binding for ESC in the vi insertion keymap *must* + be a function because of the other things needed when switching + from insert mode to command mode. + + If he wants to change something in vi's command mode, he needs + to use `set keymap vi-command' and enter key bindings without + the \M- prefix (as he discovered)." + + +Patches Applied to the Bash Sources +----------------------------------- + diff --git a/debian/README.abs-guide b/debian/README.abs-guide new file mode 100644 index 0000000..7a69558 --- /dev/null +++ b/debian/README.abs-guide @@ -0,0 +1,26 @@ +[ This is just a pointer to a document, which you might find helpful] + + Advanced Bash-Scripting Guide + + A complete guide to shell scripting, using Bash + + Mendel Cooper - Brindlesoft + + thegrendel@theriver.com + + +This tutorial assumes no previous knowledge of scripting or programming, but +progresses rapidly toward an intermediate/advanced level of instruction +(...all the while sneaking in little snippets of UNIX wisdom and lore). It +serves as a textbook, a manual for self-study, and a reference and source +of knowledge on shell scripting techniques. The exercises and heavily- +commented examples invite active reader participation, under the premise that +the only way to really learn scripting is to write scripts. + +The guide is availabe at http://tldp.org/LDP/abs/html/ + +The latest update of this document, as an archived "tarball" including both +the SGML source and rendered HTML, may be downloaded from the author's home +site (http://personal.riverusers.com/~thegrendel/abs-guide-2.1.tar.bz2). See +the change log for a revision history +(http://personal.riverusers.com/~thegrendel/Change.log). diff --git a/debian/README.bash_completion b/debian/README.bash_completion new file mode 100644 index 0000000..7be4235 --- /dev/null +++ b/debian/README.bash_completion @@ -0,0 +1,18 @@ + Programmable Completion + ======================= + +[BUG REPORTING: Please direct all enhancement requests directly to the + bash_completion maintainer, the completion script won't be changed for + Debian specific enhancements. If you find a real bug, report it the usual + way. The bash_completion author can be reached at + http://freshmeat.net/projects/bashcompletion/ + + If you find a newer version on freshmeat, you can replace it, if you did + not change the Debian version. +] + +To enable programmable completion for bash on Debian, uncomment the +bash_completion lines in /etc/bash.bashrc to source +/usr/share/bash-completion/bash_completion. +/usr/share/bash-completion/bash_completion sources ~/.bash_completion, if +it exists. diff --git a/debian/README.commands b/debian/README.commands new file mode 100644 index 0000000..8e2aaf6 --- /dev/null +++ b/debian/README.commands @@ -0,0 +1,189 @@ + This is a jumping-off reference point for new users who may be + completely unfamiliar with Linux commands. It does not contain all + the information you need about using the Linux console, but instead + just gives you enough information to get started finding the + information you need. + +Linux Commands + + To run a command, type the command at the prompt, followed by any + necessary options, and then press the Enter or Return key. + + Most commands operate silently unless they are specifically asked to + say what they are doing. If there is no error message, the command + should have worked. + + The operation of most commands can be changed by putting command + options immediately after the command name. There are several styles + of options used, and you have to check the documentation for each + command to know what options it can take, and what they do. + + Linux commands are case-sensitive, and almost always are all + lower-case. ls is a valid command; LS is not. + + In most cases you can use the tab key to ask the command shell to + auto-complete the command, directory or filename you have started + to type. If a unique completion exists, the shell will type it. If + not, you can press tab a second time to obtain a list of the + possible auto-completions. + +Commands for Reading Documentation + + In the following command examples, the [ ] characters are not + typed, they mean that whatever is enclosed is optional. For + example, you can also start `info' without any subject at all. + + When a given keyboard shortcut is preceded by ctrl- or alt- , that + means hold the control or alt key down, and type the given key + while holding it down (the same way you use the shift key). A + shorthand notation for ctrl- is ^ (^C means ctrl-C). + + man subject + man shows the manual page on the command (use q or ctrl-C to + get out of it if it doesn't terminate at the end of the + text). + + info [subject] + A lot of Debian Linux documentation is provided in info + format. This is similar to a hypertext format, in that you + can jump to other sections of the documentation by following + links embedded in the text. An info tutorial is available + within info, using ctrl-h followed by h. + + help [subject] + Use help for on-line help about the shell's built-in commands. + help by itself prints a list of subjects for which you can + ask for help. + + pager filename + pager displays a plain text file one screen at a time. + Additional screens can be displayed by pressing the space + bar, and previous screens can be displayed by pressing the b + key. When finished viewing the help, press q to return to + the prompt. + + Using -h --help with | pager + Most commands offer very brief built-in help by typing the + command followed by + + -h or --help + + If the help scrolls up beyond the top of the screen before + you can read it, add + + | pager + + to the end of the command. + + zmore document.gz + zmore is a document pager -- it displays the contents of + compressed documentation on your disk, one screenful at a + time. Compression is signified by filenames ending in .gz . + + lynx [document] or lynx [directory] or lynx [url] + lynx is a text-based web browser. It can display documents + (plain-text, compressed, or html), directory listings, and + urls such as www.google.com. It does not display images. + +Commands for Navigating Directories + + pwd + Displays your current working directory. The p stands for + print, which is a carryover from when unix was designed, + before the advent of computer screens. Interactive computer + responses were printed on paper by a connected electric + typewriter instead of being displayed electronically. + + cd [directory] + Change your current directory to the named directory. If you + don't specify directory, you will be returned to your home + directory. The `root' directory is signified by / at the + beginning of the directory path ( / also separates directory + and file names within the path). Thus paths beginning with / + are `absolute' paths; cd will take you to an absolute path + no matter what your current directory is. Paths not + beginning with / specify paths relative to your + current directory. cd .. means change to the parent + directory of your current working directory. + + ls [directory] + ls lists the contents of directory. If you don't specify a + directory name, the current working directory's list is + displayed. + + find directory -name filename + find tells you where filename is in the tree starting at + directory. This command has many other useful options. + +Documentation Indices + + The standard doc-linux-text package installs compressed text linux + HOWTOs in + + /usr/share/doc/HOWTO/en-txt/ + + Particularly helpful HOWTOs for new users are + + /usr/share/doc/HOWTO/en-txt/Unix-and-Internet-Fundamentals-HOWTO.gz + /usr/share/doc/HOWTO/en-txt/mini/INDEX.gz + /usr/share/doc/HOWTO/en-txt/Reading-List-HOWTO.gz + /usr/share/doc/HOWTO/en-txt/META-FAQ.gz + + Individual package documentation is installed in + + /usr/share/doc/ + + New user website references include + + http://www.debian.org/doc/FAQ + http://www.linuxdoc.org/LDP/gs/gs.html + +Recording User Sessions + + script filename + Use script to record everything that appears on the screen + (until the next exit) in filename. This is useful if you + need to record what's going on in order to include it in + your message when you ask for help. Use exit, logout or + ctrl-D to stop the recording session. + +Turning Echo On/Off + + To turn off echoing of characters to the screen, you can use + ctrl-S. ctrl-Q starts the echo again. If your terminal suddenly + seems to become unresponsive, try ctrl-Q; you may have accidentally + typed ctrl-S which activated echo-off. + +Virtual Consoles + + By default, six virtual consoles are provided. If you want to + execute another command without interrupting the operation of a + command you previously started, you can switch to another virtual + console (similar to a separate window). This is very handy for + displaying the documentation for a command in one console while + actually trying the command in another. Switch consoles 1 through 6 + by using alt-F1 through alt-F6. + +Logging Out + + exit or logout + + Use exit or logout to terminate your session and log + out. You should be returned to the log-in prompt. + +Turning Off the Computer + + Turning the computer on and off is really a system administration + subject, but I include it here because it is something that every + user who is his own administrator needs to know. + + halt or shutdown -t 0 -h now + This command shuts the computer down safely. You can also + use ctrl-alt-del if your system is set up for that. (If you + are in X, ctrl-alt-del will be intercepted by X. Get out of + X first by using ctrl-alt-backspace.) + + +To display this file one screen at a time, type + +pager /usr/share/doc/doc-linux-text/README.commands diff --git a/debian/bash-builtins.7 b/debian/bash-builtins.7 new file mode 100644 index 0000000..69220eb --- /dev/null +++ b/debian/bash-builtins.7 @@ -0,0 +1,18 @@ +.\" This is a hack to force bash builtins into the whatis database +.\" and to get the list of builtins to come up with the man command. +.TH BASH-BUILTINS 7 "2001 October 29" "GNU Bash-2.05a" +.SH NAME +bash-builtins \- bash built-in commands, see \fBbash\fR(1) +.SH SYNOPSIS +bash defines the following built-in commands: +:, ., [, alias, bg, bind, break, builtin, case, cd, command, compgen, complete, +continue, declare, dirs, disown, echo, enable, eval, exec, exit, +export, fc, fg, getopts, hash, help, history, if, jobs, kill, +let, local, logout, popd, printf, pushd, pwd, read, readonly, return, set, +shift, shopt, source, suspend, test, times, trap, type, typeset, +ulimit, umask, unalias, unset, until, wait, while. +.SH BASH BUILTIN COMMANDS +.nr zZ 1 +.so man1/bash.1 +.SH SEE ALSO +bash(1), sh(1) diff --git a/debian/bash-doc.doc-base.bash b/debian/bash-doc.doc-base.bash new file mode 100644 index 0000000..d37255a --- /dev/null +++ b/debian/bash-doc.doc-base.bash @@ -0,0 +1,14 @@ +Document: bash +Title: Bash Manual Page +Author: Chet Ramey +Abstract: Bash is an sh-compatible command language interpreter that executes + commands read from the standard input or from a file. Bash also + incorporates useful features from the Korn and C shells (ksh and csh). +Section: Shells + +Format: html +Index: /usr/share/doc/bash/bash.html +Files: /usr/share/doc/bash/bash.html + +Format: pdf +Files: /usr/share/doc/bash/bash.pdf diff --git a/debian/bash-doc.doc-base.bashref b/debian/bash-doc.doc-base.bashref new file mode 100644 index 0000000..8567b57 --- /dev/null +++ b/debian/bash-doc.doc-base.bashref @@ -0,0 +1,10 @@ +Document: bashref +Title: Bash Reference Manual +Author: Chet Ramey +Abstract: Bash is an sh-compatible command language interpreter that executes + commands read from the standard input or from a file. Bash also + incorporates useful features from the Korn and C shells (ksh and csh). +Section: Shells + +Format: pdf +Files: /usr/share/doc/bash/bashref.pdf diff --git a/debian/bash-static.overrides b/debian/bash-static.overrides new file mode 100644 index 0000000..141d67d --- /dev/null +++ b/debian/bash-static.overrides @@ -0,0 +1,5 @@ +# yes lintian, it's called -static +bash-static binary: embedded-library + +# no, used conditionally +bash-static binary: manpage-has-errors-from-man diff --git a/debian/bash-static.postinst b/debian/bash-static.postinst new file mode 100644 index 0000000..bb30da7 --- /dev/null +++ b/debian/bash-static.postinst @@ -0,0 +1,13 @@ +#! /bin/sh + +set -e + +if [ "$1" = configure ] && dpkg --compare-versions "$2" le 3.2-4 \ + && which add-shell >/dev/null +then + add-shell /bin/bash-static +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/bash-static.postrm b/debian/bash-static.postrm new file mode 100644 index 0000000..11c9ab4 --- /dev/null +++ b/debian/bash-static.postrm @@ -0,0 +1,21 @@ +#! /bin/sh + +set -e + +case "$1" in + upgrade|failed-upgrade|abort-install|abort-upgrade) + ;; + remove|purge|disappear) + if which remove-shell >/dev/null && [ -f /etc/shells ]; then + remove-shell /bin/bash-static + fi + ;; + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/bash.menu b/debian/bash.menu new file mode 100644 index 0000000..eb84b2d --- /dev/null +++ b/debian/bash.menu @@ -0,0 +1,2 @@ +?package(bash):needs="text" section="Applications/Shells" title="Bash" command="/bin/bash --login" +?package(bash):needs="text" section="Applications/Shells" title="Sh" command="/bin/sh --login" diff --git a/debian/bash.overrides b/debian/bash.overrides new file mode 100644 index 0000000..ddb81f7 --- /dev/null +++ b/debian/bash.overrides @@ -0,0 +1,5 @@ +# no, used conditionally +bash binary: manpage-has-errors-from-man + +# we have NEWS, CHANGES and changelog ... +bash binary: wrong-name-for-upstream-changelog diff --git a/debian/bash.postinst b/debian/bash.postinst new file mode 100644 index 0000000..b803c95 --- /dev/null +++ b/debian/bash.postinst @@ -0,0 +1,26 @@ +#! /bin/bash + +set -e + +# This should never happen. +if [ ! -e /bin/sh ]; then + ln -s bash /bin/sh +fi + +update-alternatives --install \ + /usr/share/man/man7/builtins.7.gz \ + builtins.7.gz \ + /usr/share/man/man7/bash-builtins.7.gz \ + 10 \ + || true + +if [ "$1" = configure ] && dpkg --compare-versions "$2" le 3.2-3 \ + && which add-shell >/dev/null +then + add-shell /bin/bash + add-shell /bin/rbash +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/bash.postrm b/debian/bash.postrm new file mode 100644 index 0000000..fcdbda8 --- /dev/null +++ b/debian/bash.postrm @@ -0,0 +1,22 @@ +#! /bin/sh + +set -e + +case "$1" in + upgrade|failed-upgrade|abort-install|abort-upgrade) + ;; + remove|purge|disappear) + if which remove-shell >/dev/null && [ -f /etc/shells ]; then + remove-shell /bin/bash + remove-shell /bin/rbash + fi + ;; + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/bash.preinst-lib.c b/debian/bash.preinst-lib.c new file mode 100644 index 0000000..87497b6 --- /dev/null +++ b/debian/bash.preinst-lib.c @@ -0,0 +1,131 @@ +/* + * This file is in the public domain. + * You may freely use, modify, distribute, and relicense it. + */ + +#include "bash.preinst.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern char **environ; + +__attribute__((format(printf, 1, 0))) +static void vreportf(const char *err, va_list params, int errnum) +{ + fprintf(stderr, "bash.preinst: "); + vfprintf(stderr, err, params); + if (errnum) + fprintf(stderr, ": %s", strerror(errnum)); + fprintf(stderr, "\n"); +} + +__attribute__((format(printf, 1, 2))) +NORETURN void die_errno(const char *fmt, ...) +{ + va_list params; + va_start(params, fmt); + vreportf(fmt, params, errno); + va_end(params); + exit(1); +} + +__attribute__((format(printf, 1, 2))) +NORETURN void die(const char *fmt, ...) +{ + va_list params; + va_start(params, fmt); + vreportf(fmt, params, 0); + va_end(params); + exit(1); +} + +int exists(const char *file) +{ + struct stat sb; + if (!lstat(file, &sb)) + return 1; + if (errno == ENOENT) + return 0; + die_errno("cannot get status of %s", file); +} + +void set_cloexec(int fd) +{ + int flags = fcntl(fd, F_GETFD); + if (flags < 0 || fcntl(fd, F_SETFD, flags | FD_CLOEXEC)) + die_errno("cannot set close-on-exec flag"); +} + +void xpipe(int pipefd[2]) +{ + if (pipe(pipefd)) + die_errno("cannot create pipe"); + set_cloexec(pipefd[0]); + set_cloexec(pipefd[1]); +} + +void wait_or_die(pid_t child, const char *name, int flags) +{ + int status; + if (waitpid(child, &status, 0) != child) + die_errno("cannot wait for %s", name); + if ((WIFEXITED(status) && WEXITSTATUS(status) == 0) || + ((flags & ERROR_OK) && WIFEXITED(status)) || + ((flags & SIGPIPE_OK) && + WIFSIGNALED(status) && WTERMSIG(status) == SIGPIPE)) + return; + + if (WIFEXITED(status)) + die("%s exited with status %d", name, WEXITSTATUS(status)); + if (WIFSIGNALED(status)) + die("%s killed by signal %d", name, WTERMSIG(status)); + if (WIFSTOPPED(status)) + die("%s stopped by signal %d", name, WSTOPSIG(status)); + die("waitpid is confused (status=%d)", status); +} + +pid_t spawn(const char * const cmd[], int out, int err) +{ + pid_t child; + posix_spawn_file_actions_t redir; + + if (posix_spawn_file_actions_init(&redir) || + (out >= 0 && posix_spawn_file_actions_adddup2(&redir, out, 1)) || + (err >= 0 && posix_spawn_file_actions_adddup2(&redir, err, 2)) || + posix_spawnp(&child, cmd[0], &redir, NULL, + (char **) cmd, environ) || + posix_spawn_file_actions_destroy(&redir)) + die_errno("cannot run %s", cmd[0]); + return child; +} + +void run(const char * const cmd[]) +{ + pid_t child = spawn(cmd, -1, -1); + wait_or_die(child, cmd[0], 0); +} + +FILE *spawn_pipe(pid_t *pid, const char * const cmd[], int errfd) +{ + int pipefd[2]; + FILE *f; + + xpipe(pipefd); + *pid = spawn(cmd, pipefd[1], errfd); + if (close(pipefd[1]) || (errfd != -1 && close(errfd))) + die_errno("cannot close unneeded fd"); + + f = fdopen(pipefd[0], "r"); + if (!f) + die_errno("cannot stream read end of pipe"); + return f; +} diff --git a/debian/bash.preinst.c b/debian/bash.preinst.c new file mode 100644 index 0000000..14baeab --- /dev/null +++ b/debian/bash.preinst.c @@ -0,0 +1,170 @@ +/* + * This file is in the public domain. + * You may freely use, modify, distribute, and relicense it. + */ + +#include "bash.preinst.h" +#include +#include +#include +#include +#include +#include +#include + +static void backup(const char *file, const char *dest) +{ + const char * const cmd[] = {"cp", "-dp", file, dest, NULL}; + if (exists(file)) + run(cmd); +} + +static void force_symlink(const char *target, const char *link, + const char *temp) +{ + /* + * Forcibly create a symlink to "target" from "link". + * This is performed in two stages with an + * intermediate temporary file because symlink(2) cannot + * atomically replace an existing file. + */ + if ((unlink(temp) && errno != ENOENT) || + symlink(target, temp) || + rename(temp, link)) + die_errno("cannot create symlink %s -> %s", link, target); +} + +static void reset_diversion(const char *package, const char *file, + const char *distrib) +{ + const char * const remove_old_diversion[] = + {"dpkg-divert", "--package", "bash", "--remove", file, NULL}; + const char * const new_diversion[] = + {"dpkg-divert", "--package", package, + "--divert", distrib, "--add", file, NULL}; + run(remove_old_diversion); + run(new_diversion); +} + +static int has_binsh_line(FILE *file) +{ + char item[sizeof("/bin/sh\n")]; + + while (fgets(item, sizeof(item), file)) { + int ch; + + if (!memcmp(item, "/bin/sh\n", strlen("/bin/sh\n") + 1)) + return 1; + if (strchr(item, '\n')) + continue; + + /* Finish the line. */ + for (ch = 0; ch != '\n' && ch != EOF; ch = fgetc(file)) + ; /* just reading */ + if (ch == EOF) + break; + } + if (ferror(file)) + die_errno("cannot read pipe"); + return 0; +} + +static int binsh_in_filelist(const char *package) +{ + const char * const cmd[] = {"dpkg-query", "-L", package, NULL}; + pid_t child; + int sink; + FILE *in; + int found; + + /* + * dpkg -L $package 2>/dev/null | ... + * + * Redirection of stderr is for quieter output + * when $package is not installed. If opening /dev/null + * fails, no problem; leave stderr alone in that case. + */ + sink = open("/dev/null", O_WRONLY); + if (sink >= 0) + set_cloexec(sink); + in = spawn_pipe(&child, cmd, sink); + + /* ... | grep "^/bin/sh\$" */ + found = has_binsh_line(in); + if (fclose(in)) + die_errno("cannot close read end of pipe"); + + /* + * dpkg -L will error out if $package is not already installed. + * + * We stopped reading early if we found a match, so + * tolerate SIGPIPE in that case. + */ + wait_or_die(child, "dpkg-query -L", ERROR_OK | + (found ? SIGPIPE_OK : 0)); + return found; +} + +static int undiverted(const char *path) +{ + const char * const cmd[] = + {"dpkg-divert", "--listpackage", path, NULL}; + pid_t child; + char packagename[sizeof("bash\n")]; + size_t len; + FILE *in = spawn_pipe(&child, cmd, -1); + int diverted = 1; + + /* Is $path diverted by someone other than bash? */ + + len = fread(packagename, 1, sizeof(packagename), in); + if (ferror(in)) + die_errno("cannot read from dpkg-divert"); + if (len == 0) + diverted = 0; /* No diversion. */ + if (len == strlen("bash\n") && !memcmp(packagename, "bash\n", len)) + diverted = 0; /* Diverted by bash. */ + + if (fclose(in)) + die_errno("cannot close read end of pipe"); + wait_or_die(child, "dpkg-divert", ERROR_OK | SIGPIPE_OK); + return !diverted; +} + +int main(int argc, char *argv[]) +{ + /* /bin/sh needs to point to a valid target. */ + + if (access("/bin/sh", X_OK)) { + backup("/bin/sh", "/bin/sh.distrib"); + backup("/usr/share/man/man1/sh.1.gz", + "/usr/share/man/man1/sh.distrib.1.gz"); + + force_symlink("bash", "/bin/sh", "/bin/sh.temp"); + force_symlink("bash.1.gz", "/usr/share/man/man1/sh.1.gz", + "/usr/share/man/man1/sh.1.gz.temp"); + } + if (!binsh_in_filelist("bash")) + /* Ready. */ + return 0; + + /* + * In bash (<= 4.1-3), the bash package included symlinks for + * /bin/sh and the sh(1) manpage in its data.tar. + * + * Unless we are careful, unpacking the new version of bash + * will remove them. So we tell dpkg that the files from bash + * to be removed are elsewhere, using a diversion on behalf of + * another package. + * + * Based on an idea by Michael Stone. + * “You're one sick individual.” -- Anthony Towns + * http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=85;bug=34717 + */ + if (undiverted("/bin/sh")) + reset_diversion("dash", "/bin/sh", "/bin/sh.distrib"); + if (undiverted("/usr/share/man/man1/sh.1.gz")) + reset_diversion("dash", "/usr/share/man/man1/sh.1.gz", + "/usr/share/man/man1/sh.distrib.1.gz"); + return 0; +} diff --git a/debian/bash.preinst.h b/debian/bash.preinst.h new file mode 100644 index 0000000..82faf49 --- /dev/null +++ b/debian/bash.preinst.h @@ -0,0 +1,37 @@ +#ifndef BASH_PREINST_H +#define BASH_PREINST_H + +/* + * This file is in the public domain. + * You may freely use, modify, distribute, and relicense it. + */ + +#define _XOPEN_SOURCE 700 +#include +#include +#include + +#if !defined(__GNUC__) && !defined(__attribute__) +# define __attribute__(x) +#endif +#define NORETURN __attribute__((__noreturn__)) +#define PRINTFLIKE __attribute__((format(printf, 1, 2))) + +enum wait_or_die_flags { + ERROR_OK = 1, + SIGPIPE_OK = 2 +}; + +extern NORETURN PRINTFLIKE void die_errno(const char *fmt, ...); +extern NORETURN PRINTFLIKE void die(const char *fmt, ...); + +extern int exists(const char *path); +extern void set_cloexec(int fd); +extern void xpipe(int pipefd[2]); + +extern void wait_or_die(pid_t child, const char *desc, int flags); +extern pid_t spawn(const char * const cmd[], int outfd, int errfd); +extern void run(const char * const cmd[]); /* spawn and wait */ +extern FILE *spawn_pipe(pid_t *pid, const char * const cmd[], int errfd); + +#endif diff --git a/debian/bash.prerm b/debian/bash.prerm new file mode 100644 index 0000000..52052a2 --- /dev/null +++ b/debian/bash.prerm @@ -0,0 +1,22 @@ +#! /bin/bash + +set -e + +case "$1" in + upgrade) + update-alternatives --remove builtins.7.gz \ + /usr/share/man/man7/bash-builtins.7.gz + ;; + + remove|deconfigure) + ;; + + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# diff --git a/debian/bashbug.1 b/debian/bashbug.1 new file mode 100644 index 0000000..d620e63 --- /dev/null +++ b/debian/bashbug.1 @@ -0,0 +1,68 @@ +.TH "BASHBUG" "1" "11 December 2007" "GNU Bash 3\.1" "bashbug" +.nh +.ad l +.SH "NAME" +bashbug - report a bug in bash +.SH "SYNOPSIS" +.HP 8 +\fBbashbug\fR [\fB\-\-help\fR] [\fB\-\-version\fR] [\fB\fIbug\-report\-email\-addresses\fR\fR] +.SH "DESCRIPTION" +.PP + +\fBbashbug\fR +is a utility for reporting bugs in Bash to the maintainers\. +.PP + +\fBbashbug\fR +will start up your preferred editor with a preformatted bug report template for you to fill in\. Save the file and quit the editor once you have completed the missing fields\. +\fBbashbug\fR +will notify you of any problems with the report and ask for confirmation before sending it\. By default the bug report is mailed to both the GNU developers and the Debian Bash maintainers\. The recipients can be changed by giving a comma separated list of +\fIbug\-report\-email\-addresses\fR\. +.PP +If you invoke +\fBbashbug\fR +by accident, just quit your editor\. You will always be asked for confirmation before a bug report is sent\. +.SH "OPTIONS" +.PP +.PP +\fB\-\-help\fR +.RS +Show a brief usage message and exit\. +.RE +.PP +\fB\-\-version\fR +.RS +Show the version of +\fBbashbug\fR +and exit\. +.RE +.PP +\fBbug\-report\-email\-addresses\fR +.RS +Comma separated list of recipients\' email addresses\. By default the report is mailed to both the GNU developers and the Debian Bash maintainers\. +.RE +.SH "ENVIRONMENT" +.PP +.PP +\fBDEFEDITOR\fR +.RS +Editor to use for editing the bug report\. +.RE +.PP +\fBEDITOR\fR +.RS +Editor to use for editing the bug report (overridden by +\fBDEFEDITOR\fR)\. +.RE +.SH "SEE ALSO" +.PP + +\fBbash\fR(1), +\fBreportbug\fR(1), +\fBupdate-alternatives\fR(8) +for preferred editor\. +.SH "AUTHOR" +.PP +This manual page was written by Christer Andersson + +for the Debian project (but may be used by others)\. diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..b8357ff --- /dev/null +++ b/debian/changelog @@ -0,0 +1,2293 @@ +bash (4.3-9.1) unstable; urgency=high + + * Non-maintainer upload by the security team + * Apply upstream patch bash43-025, fixing CVE-2014-6271. + + -- Florian Weimer Wed, 24 Sep 2014 20:29:30 +0200 + +bash (4.3-9) unstable; urgency=medium + + * Apply upstream patches 023 - 024, fixing the issues: + - bash does not correctly parse process substitution constructs that + contain unbalanced parentheses as part of the contained command. + - Indirect variable references do not work correctly if the reference + variable expands to an array reference using a subscript other than 0 + (e.g., foo='bar[1]' ; echo ${!foo}). + * debian/skel.bashrc: Add GCC_COLORS setting (disabled by default). + + -- Matthias Klose Thu, 21 Aug 2014 22:58:16 +0200 + +bash (4.3-8) unstable; urgency=medium + + * Apply upstream patches 012 - 022, fixing the issues: + - When a SIGCHLD trap runs a command containing a shell builtin while a + script is running `wait' to wait for all running children to complete, + the SIGCHLD trap will not be run once for each child that terminates. + - Using reverse-i-search when horizontal scrolling is enabled does not + redisplay the entire line containing the successful search results. + - Under certain circumstances, $@ is expanded incorrectly in contexts + where word splitting is not performed. + - When completing directory names, the directory name is dequoted twice. + This causes problems for directories with single and double quotes in + their names. + - An extended glob pattern containing a slash (`/') causes the globbing + code to misinterpret it as a directory separator. + - The code that creates local variables should not clear the `invisible' + attribute when returning an existing local variable. Let the code that + actually assigns a value clear it. + - When assigning an array variable using the compound assignment syntax, + but using `declare' with the rhs of the compound assignment quoted, the + shell did not mark the variable as visible after successfully performing + the assignment. + - The -t timeout option to `read' does not work when the -e option is used. + LP: #1317476. + - When PS2 contains a command substitution, here-documents entered in an + interactive shell can sometimes cause a segmentation fault. + - When the readline `revert-all-at-newline' option is set, pressing newline + when the current line is one retrieved from history results in a double + free and a segmentation fault. Closes: #747341. + - Using nested pipelines within loops with the `lastpipe' option set can + result in a segmentation fault. + * Fix typo in package description. Closes: #707810. + + -- Matthias Klose Sun, 03 Aug 2014 18:14:31 +0200 + +bash (4.3-7) unstable; urgency=medium + + * Apply upstream patches 009 - 011 (replacing local patches): + - Fix a problem with unsigned sign extension when attempting to reallocate + the input line when it is fewer than 3 characters long and there has been + a history expansion. The sign extension causes the shell to not + reallocate the line, which results in a segmentation fault when it writes + past the end. + - Change the behavior of programmable completion to compensate for two + assumptions made by the bash-completion package. + - The signal handling changes to bash and readline (to avoid running any + code in a signal handler context) cause the cursor to be placed on the + wrong line of a multi-line command after a ^C interrupts editing. + + -- Matthias Klose Wed, 16 Apr 2014 23:10:28 +0200 + +bash (4.3-6) unstable; urgency=medium + + * Apply upstream patches 001 - 008: + - A missing check for a valid option prevented `test -R' from working. + There is another problem that causes bash to look up the wrong variable + name when processing the argument to `test -R'. + - A change to save state while running the DEBUG trap caused pipelines to + hang on systems which need process group synchronization while building + pipelines. + - When in callback mode, some readline commands can cause readline + to segfault by passing invalid contexts to callback functions. + - The `.' command in vi mode cannot undo multi-key commands beginning with + `c', `d', and `y' (command plus motion specifier). + - When in Posix mode, bash did not correctly interpret the ANSI-C-style + $'...' quoting mechanism when performing pattern substitution word + expansions within double quotes. + - A shell that started with job control active but was not interactive left + the terminal in the wrong process group when exiting, causing its parent + shell to get a stop signal when it attempted to read from the terminal. + - Using compound assignments for associative arrays like + assoc=( [x]= [y]=bar ) + left the value corresponding to the key `x' NULL. This caused + subsequent lookups to interpret it as unset. + - Some extended glob patterns incorrectly matched filenames with a leading + dot, regardless of the setting of the `dotglob' option. + * Replace already applied patches by the upstream patch files. + + -- Matthias Klose Mon, 07 Apr 2014 22:20:10 +0200 + +bash (4.3-5) unstable; urgency=medium + + * Fix a display issue when a multiline command is aborted with ^C. + * Fix a crash after a failed history expansion. LP: #1294669. + + -- Matthias Klose Sat, 29 Mar 2014 19:10:21 +0100 + +bash (4.3-4) unstable; urgency=high + + * Fix an issue with an associative array expanding to the + empty string if the associated value is the empty string. + * Fix an issue, when invoked as sh, bash doesn't interpret C-style escapes + within double-quoted substitution expansions ("${var/$'what'/ever}"). + * Fix an issue with the extglob option to not expand hidden files. + * Update the pcomplete-dequote patch. + + -- Matthias Klose Fri, 21 Mar 2014 15:20:45 +0100 + +bash (4.3-3) unstable; urgency=medium + + * Fix an issue with with empty completions and bash-completion. + Closes: #741060 . LP: #1291586. + * Fix an issue with updating terminal titles using trap commands. + LP: #1294167. + * Fix an issue in vi-mode, not re-doing the latest "dw", "dl", "D", ... + commands. + * Fix segfault in _rl_dispatch_callback(). Closes: #741555. + + -- Matthias Klose Wed, 19 Mar 2014 18:54:13 +0100 + +bash (4.3-2) unstable; urgency=medium + + * Build-depend on texlive-fonts-recommended. + * Work around a build failure of bash static on ppc64el. + * Only include the documentation into the bash-doc package. Closes: + + -- Matthias Klose Wed, 05 Mar 2014 05:05:16 +0100 + +bash (4.3-1) unstable; urgency=medium + + * Bash 4.3 release. + * Update debian/copyright. + + -- Matthias Klose Mon, 03 Mar 2014 08:16:58 +0100 + +bash (4.3~rc2-1) experimental; urgency=medium + + * New upstream version 4.3 rc2. + + -- Matthias Klose Wed, 05 Feb 2014 15:20:17 +0100 + +bash (4.3~rc1-1) experimental; urgency=medium + + * New upstream version 4.3 rc1. + + -- Matthias Klose Fri, 27 Dec 2013 23:01:38 +0100 + +bash (4.3~beta2-1) experimental; urgency=low + + * New upstream version 4.3 beta2. + + -- Matthias Klose Wed, 23 Oct 2013 13:59:32 +0200 + +bash (4.2+dfsg-1) unstable; urgency=low + + * Apply upstream patches 038 - 045, fixes for + - If a backslash-newline (which is removed) with no other input is given as + input to `read', the shell tries to dereference a null pointer and + segfaults. + - Under certain circumstances, bash attempts to expand variables in + arithmetic expressions even when evaluation is being suppressed. + - Output redirection applied to builtin commands missed I/O errors if + they happened when the file descriptor was closed, rather than on write + (e.g., like with an out-of-space error on a remote NFS file system). + - Process substitution incorrectly inherited a flag that inhibited using the + (local) temporary environment for variable lookups if it was providing + the filename to a redirection. The intent the flag is to enforce the + Posix command expansion ordering rules. + - Compilation failed after specifying the `--enable-minimal-config' option + to configure (more specifically, specifying `--disable-alias'). + - When SIGCHLD is trapped, and a SIGCHLD trap handler runs when a pending + `read -t' invocation times out and generates SIGALRM, bash can crash with + a segmentation fault. + - When converting a multibyte string to a wide character string as part of + pattern matching, bash does not handle the end of the string correctly, + causing the search for the NUL to go beyond the end of the string and + reference random memory. Depending on the contents of that memory, bash + can produce errors or crash. + - The <&n- and >&n- redirections, which move one file descriptor to another, + leave the file descriptor closed when applied to builtins or compound + commands. + * Fix parallel build (Steven Chamberlain). Closes: #694659. + * Fix german translations. Closes: #688571. + * Fix typo in man page. Closes: #696706. + + -- Matthias Klose Sat, 30 Mar 2013 14:56:51 +0100 + +bash (4.2+dfsg-0.1) unstable; urgency=low + + * Non-maintainer upload. + * Remove unused and non DFSG-compliant bash-4.2/lib/readline/doc from + source. (Closes: #695709) + + -- David Prévot Sat, 29 Dec 2012 21:19:34 -0400 + +bash (4.2-5.1) unstable; urgency=low + + * Non-maintainer upload. + * debian/bash.preinst-lib.c: typo in fcntl argument (Closes: #679198). + + -- Nicolas Boulenguez Tue, 11 Dec 2012 22:02:44 +0100 + +bash (4.2-5) unstable; urgency=low + + * Apply upstream patch 037, fix for + - Attempting to redo (using `.') the vi editing mode `cc', `dd', or `yy' + commands leads to an infinite loop. + + -- Matthias Klose Fri, 03 Aug 2012 01:21:14 +0200 + +bash (4.2-4) unstable; urgency=high + + * Apply upstream patches 030 - 036, fixes for + - When attempting to glob strings in a multibyte locale, and those strings + contain invalid multibyte characters that cause mbsnrtowcs to return 0, + the globbing code loops infinitely. + - A change between bash-4.1 and bash-4.2 to prevent the readline input hook + from being called too frequently had the side effect of causing delays + when reading pasted input on systems such as Mac OS X. This patch fixes + those delays while retaining the bash-4.2 behavior. + - Bash-4.2 has problems with DEL characters in the expanded value of + variables used in the same quoted string as variables that expand + to nothing. + - Bash uses a static buffer when expanding the /dev/fd prefix for the test + and conditional commands, among other uses, when it should use a dynamic + buffer to avoid buffer overflow. + - In bash-4.2, the history code would inappropriately add a semicolon to + multi-line compound array assignments when adding them to the history. + - When given a number of lines to read, `mapfile -n lines' reads + one too many. + - Bash-4.2 produces incorrect word splitting results when expanding + double-quoted $@ in the same string as and adjacent to other variable + expansions. The $@ should be split, the other expansions should not. + + -- Matthias Klose Thu, 12 Jul 2012 23:58:51 +0200 + +bash (4.2-3) unstable; urgency=low + + * Apply upstream patches 025 - 029, fixes for + - When used in a shell function, `declare -g -a array=(compound assignment)' + creates a local variable instead of a global one. + - The `lastpipe' option does not behave correctly on machines where the + open file limit is less than 256. + - When the `extglob' shell option is enabled, pattern substitution does not + work correctly in the presence of multibyte characters. + - When using a word expansion for which the right hand side is evaluated, + certain expansions of quoted null strings include spurious ^? characters. + - Bash-4.2 tries to leave completed directory names as the user typed them, + without expanding them to a full pathname. One effect of this is that + shell variables used in pathnames being completed (e.g., $HOME) are left + unchanged, but the `$' is quoted by readline because it is a special + character to the shell. This patch introduces two things: + - A new shell option, `direxpand', which, if set, attempts to emulate the + bash-4.1 behavior of expanding words to full pathnames during + completion; + - A set of heuristics that reduce the number of times special characters + such as `$' are quoted when the directory name is not expanded. + * Mark bash and bash-static as Multi-Arch: foreign . Closes: #674120. + * Avoid warning for unset debian_chroot with -u (Marko Mäkelä). + Closes: #659940. + * Fix string expansion: \u and \U for code points U+0080 to U+00FF (Darran + Salt). Closes: #661386. + * Search $- for `i' for the interactivity test. Closes: #482194. + * Search for bash_completion in /usr/share/bash-completion too. + Closes: #655071, #655208. + + -- Matthias Klose Sun, 01 Jul 2012 13:45:35 +0200 + +bash (4.2-2) unstable; urgency=low + + * Fix command-not-found location. Closes: #529313. + * Print a replacement error message if command-not-found was removed + after bashrc was loaded. Closes: #631023. LP: #561155. + * skel.bashrc: Document and prepare enabling the globstar feature (Fabian + Greffrath). Closes: #627926. + * Apply upstream patches 021 - 024. + + -- Matthias Klose Fri, 30 Mar 2012 19:20:04 +0200 + +bash (4.2-1) unstable; urgency=low + + [ Matthias Klose ] + * New upstream version. + * Apply upstream patches 001 - 020. + * Fix parsing of double doublequotes. LP: #780441. + * /etc/bash.bashrc: + - Fix quoting issue calling command-not-found. LP: #754859. Closes: #587185. + * Don't cache the value of brk between sbrk calls (Samuel Thibault). + Closes: #614815. + * Remove the bashdb and bash-completion packaging rules and files. + * Just link with libtinfo instead of libncurses if available. + * Make lintian happy. + * Use quilt to apply patches. + * Fix build error with -Werror=format-security (Pierre Chifflier). + Closes: #641350. + * Fix build for the binary target, without calling the build target. + Closes: #602159. + * Fix cross builds (Steve McIntyre). Closes: #629929. + + [ Jonathan Nieder ] + * Update copyright file. Many files that were GPL-2+ were relicensed + under GPL-3+ in bash 4.0-rc1. Closes: #632177. + * debian/rules: Use "rm -rf" instead of rmdir to remove usr/share/info + directory in "with_gfdl = no" build. This prevents build failures when + using the unmodified upstream tarball. + * bash.preinst: Tidy up a little. + - Remove codepath that would rename .bash_profile → .profile if .profile + was unmodified from the gutsy → hardy transition. Closes: #602244 + - Remove commented experiment from bash-completion transition. + - Remove misleading "dpkg --assert-support-predepends" check. + Closes: #602456. + - Move utility functions to a separate bash.preinst-lib.c and corresponding + declarations to bash.preinst.h. + * Remove /bin/sh symlink and /usr/share/man/man1/sh.1.gz from bash package + contents. Closes: #602483. + - debian/rules: Do not install /bin/sh and sh.1.gz symlinks. + - bash.preinst: + - Make sure /bin/sh is present and points to an executable, forcibly + creating symlinks /bin/sh -> bash and /usr/share/man/man1/sh.1.gz -> + bash.1.gz if not. + - Divert /bin/sh and sh.1.gz on behalf of dash if we are upgrading from + a bash version with /bin/sh in the files list and bash's copy of + /bin/sh is not already diverted. This ensures unpacking bash will not + cause /bin/sh to go missing. + * bash.postinst: Simplify comment that contained an implementation detail + about how /bin/sh is provided. + * Use dpkg-buildflags to retrieve compiler options, including hardening flags. + Build-Depends: dpkg-dev (>= 1.16.1) (Steve Langasek). Closes: #629929. + * Pass --host to configure only when cross-compiling, --build always, as + recommended in autotools documentation (Steve Langasek). + + * Merge from Ubuntu (closes: #648578): + - /etc/skel/.bashrc: + - Don't set HISTCONTROL twice. Thanks to Kevin Knerr. LP: #465500. + - Set HISTFILESIZE to 2000 and HISTSIZE to 1000. LP: #544542. + - README.Debian: Remove obsolete entry "Why is bash configured + with --disable-net-redirections?" + + -- Matthias Klose Wed, 30 Nov 2011 07:29:05 +0100 + +bash (4.1-3) unstable; urgency=low + + * Apply upstream patches 003, 004, 005. + * Fix crash in declare builtin. + * /etc/skel/.bashrc: + - Enable sourcing of ~/.bash_aliases by default. Closes: #569798. + - Find command-not-found script. Closes: #529313. + * README.Debian: + - Remove references to --disable-net-redirections, bash-minimal. + - Mention that the upstream changelog can be found in the bash-doc + package. Closes: #551019. + + -- Matthias Klose Sat, 10 Apr 2010 10:35:29 +0200 + +bash (4.1-2) unstable; urgency=low + + * Apply upstream patches 001, 002. + + -- Matthias Klose Fri, 12 Mar 2010 02:08:45 +0100 + +bash (4.1-1) unstable; urgency=low + + * New upstream version 4.1. + * Stop building the bash-minimal package, not needed anymore with + dash being the default shell. + + -- Matthias Klose Sat, 02 Jan 2010 13:49:24 +0100 + +bash (4.1~rc1-1) unstable; urgency=low + + * New upstream version 4.1, release candidate 1. + + -- Matthias Klose Wed, 30 Dec 2009 15:41:40 +0100 + +bash (4.0-7) unstable; urgency=medium + + * Re-add the sh and sh(1) symlinks. Closes: #546516. + + -- Matthias Klose Mon, 14 Sep 2009 08:11:58 +0200 + +bash (4.0-6) unstable; urgency=medium + + * Pre-depend on dash, instead of just depending on it. + Closes: #546504, #546516, #546518. + * Update and set homepage attribute. Closes: #546377, #546381. + + -- Matthias Klose Sun, 13 Sep 2009 13:35:38 +0200 + +bash (4.0-5) unstable; urgency=low + + * Re-add dependency on dash, lost with the upload of 4.0. + * Don't configure with --disable-net-redirections. + * Fix name of system wide bash_logout in bash(1). Closes: #546200. + * Stop shipping the sh and sh(1) symlinks. Closes: #545103. + * Apply upstream patches 029 - 033. + + -- Matthias Klose Sun, 13 Sep 2009 12:55:54 +0200 + +bash (4.0-4) unstable; urgency=low + + * Apply upstream patches 024 - 028. + - patch 028 closes: #519165. bash-4.0 reverted to the historical + shell behavior of raising an error when $@ or $* was expanded + after `set -u' had been executed and there were no positional + parameters. The Posix working group has since clarified the + standard's position on the issue, and $@ and $* are now the only + variables, parameters, or special parameters that do not raise an + error when unset if set -u is enabled. + * Enable net redirections, now that bash isn't the default shell + anymore. + * Changes to the skeleton .bashrc: + - Fix example lines in /etc/bash.bashrc to enable bash completion. + Closes: #523706, #522857. + - Don't export HISTCONTROL in bashrc. Closes: #540371. + - Support user dircolors settings in ~/.dircolors. Closes: #506213. + + -- Matthias Klose Sun, 23 Aug 2009 16:09:36 +0200 + +bash (4.0-3) experimental; urgency=low + + * Apply upstream patches 011 - 024. + + -- Matthias Klose Sun, 17 May 2009 15:29:21 +0200 + +bash (4.0-2) experimental; urgency=low + + * Apply upstream patches 001 - 010. Closes: #518289. + * Fix insecure temp file handling in examples scripts. Closes: #509279. + * /etc/skel.bashrc: Only source bash_completion, if posix mode is turned + off. Closes: #498474. + + -- Matthias Klose Sat, 21 Mar 2009 15:06:46 +0100 + +bash (4.0-1) experimental; urgency=low + + * New upstream version 4.0. + + -- Matthias Klose Sun, 01 Mar 2009 10:56:15 +0100 + +bash (4.0-0ubuntu1) jaunty; urgency=low + + * New upstream version 4.0 beta. + + -- Matthias Klose Sat, 29 Nov 2008 18:20:35 +0100 + +bash (3.2-6) unstable; urgency=medium + + * bash. Depend on dash to install dash as a required package. + + -- Matthias Klose Mon, 20 Jul 2009 23:56:24 +0000 + +bash (3.2-5) unstable; urgency=low + + * Apply upstream fixes 040 - 048. + + -- Matthias Klose Sun, 01 Mar 2009 10:20:52 +0100 + +bash (3.2-4) unstable; urgency=low + + * bash-minimal, bash-static: Only call `add-shell' on new installations. + * Only call remove-shell on package removal or purge. + + -- Matthias Klose Mon, 12 May 2008 18:49:07 +0200 + +bash (3.2-3) unstable; urgency=low + + * /etc/skel/.bashrc: Overwrite SHELL for calling lesspipe. Closes: #385168. + * Only call `add-shell' on new installations. Closes: #477750. + * Apply upstream fixes 034 - 039. + * Add explicit copyright notice to clear_console(1). + + -- Matthias Klose Sun, 20 Apr 2008 13:31:10 +0200 + +bash (3.2-2) unstable; urgency=low + + * Add a shopt option compat31 to fall back to the behaviour of bash-3.1 + and earlier versions, in that quoting the string argument to the [[ + command's =~ +operator does not force string matching. + + * Merge from Ubuntu: + - Remove /etc/skel/.bash_profile, if it is unmodified; if modified and + /etc/skel/.profile is unmodifed, move .bash_profile to .profile. + - /etc/skel/.bashrc: Add an option to blurt a terminal window with a + colored prompt. + - /etc/skel/.bashrc: Add color support for grep and friends (commented + out by default). Closes: #420659. + - /etc/skel/.profile: Avoid the use of `~'. + - Don't run command-not-found from the shell scripts when it has been + removed in the meantime. + * /etc/skel/.bashrc: + - Comment out the lesspipe settings. Closes: #470453. + - Don't use PROMPT_COMMAND to set the title of an xterm. Closes: #420656. + - Don't second-guess terminal handling in dircolors. Closes: #473870. + - Don't overwrite GNU Midnight Commander's setting of HISTCONTROL to + `ignorespace'. Closes: #440102. + - Add a comment about setting HISTSIZE and HISTFILESIZE. Closes: #449587. + - Append to the history file, don't overwrite it. Closes: #452459. + - Use dir and vdir commands for dir vdir aliases. Closes: #420661. + * /etc/skel/.profile: + - Add comment about setting the umask for ssh logins. Closes: #314533. + + * Added code to defer the initialization of HISTSIZE until the history file + is loaded. Closes: #383762. + * Fix typos in README.Debian and preinst. Closes: #374452. + * Mention `exec' builtin in the section `redirection'. Closes: #378067. + * Add bashbug(1). Closes: #442477. + * Fix typos in bash(1). Closes: #390493, #426687. + * Fix bug in Bash_aliases example. Closes: #423488. + * Fix typo in help message for caller builtin. Closes: #452656. + + -- Matthias Klose Sun, 20 Apr 2008 11:20:08 +0200 + +bash (3.2-1) experimental; urgency=low + + * New upstream version (including upstream patches 01 - 33). Closes: #431620. + - Added write error reporting to printf builtin. Closes: #414285. + - Fixed a bug that caused `unset LANG' to not properly reset the locale. + Closes: #364861. + - Describe expansion of pattern in case statement. Closes: #342225. + - Improved handling of non-printable characters in prompt. Closes: #352234, + #362010, #397086, #418961, #471490. + - Fix typos in documentation. Closes: #382892. + + The syntax of regexes in Bash 3.2 was changed so that single quotes no + longer surround regexes. e.g, a regex of the form + if [[ "foo.tex" =~ '^(.*)\.tex$' ]] + becomes + if [[ "foo.tex" =~ ^(.*)\.tex$ ]] + + * Merge from Ubuntu: + - debian/skel.bashrc: Check for dircolors before using it. + - debian/skel.bashrc: Set HISTCONTROL to ignoreboth. + - Include correct bash.pot file. + - Move CWRU/changelog from the bash to the bash-doc package (we already + have the CHANGES files). + - debian/etc.bash.bashrc: Install command-not-found handler if available. + + -- Matthias Klose Sun, 10 Feb 2008 23:49:35 +0100 + +bash (3.1dfsg-9) unstable; urgency=low + + * Remove bash-completion from the source. + * Remove the conflict with bash-completion, recommend bash-completion. + * Fix quotes in man page. Closes: #402845. + * clear_console: Don't segv if stdin isn't a tty. Closes: #451819. + * clear_console(1): Fix synopsis. Closes: #441242. + * Clarify bash-doc package description: Closes: #394275. + + -- Matthias Klose Sat, 09 Feb 2008 10:14:22 +0100 + +bash (3.1dfsg-8) unstable; urgency=high + + * bash-doc: Install copyright file when building without the + gfdl'ed docs. Closes: #402471. + + -- Matthias Klose Mon, 11 Dec 2006 22:08:10 +0100 + +bash (3.1dfsg-7) unstable; urgency=medium + + * Restore the bash(1) manual page. Closes: #392989. + + -- Matthias Klose Sun, 22 Oct 2006 13:41:59 +0000 + +bash (3.1dfsg-6) unstable; urgency=low + + * Remove the texinfo documentation from the package. Closes: #357260. + * Remove the FAQ from the package. + + -- Matthias Klose Thu, 12 Oct 2006 22:35:46 +0200 + +bash (3.1-5) unstable; urgency=low + + * Work around the broken remove-shell, not checking for the existance + of /etc/shells (closes: #337097). + * Force rebuild of bashref.info (closes: #354303, #357258). + * Apply upstream patches 015, 016, 017, fixing + - a problem with the extended globbing code prevented dots from matching + filenames when used in some extended matching patterns. + - core dumps when attempting to perform globbing in directories with + very large numbers of files. + - Array expansion failure with an arithmetic syntax error when the + subscript appears within double quotes. Closes: #358831. + * Add copyrights for contributed files (Joost van Baal). Closes: #357607. + * bash_completion: + - Add apt-cache madison completion: Closes: #342073, #359021. + - Complete files with spaces for bzip2. Closes: #356218. + - Complete whatis and apropos like man. Closes: #352145. + - Ignore stderr in apt-cache completion. Closes: #367198. + - Add flv|FLV files completion for mplayer. Closes: #364509, #373904. + - Add dvi|DVI files completion for evince. Ubuntu #49880. + * Fix typos in man page. Closes: #360543. + + [ Ian Jackson ] + * Make bash die if it cannot read its input file. Closes: #320036. + (This is not an ideal fix because, for example, the exit status is + still wrong - it should be 127, not 2. Also, the filename is not + printed. Unfortunately the code is badly tangled making this small + fix the most appropriate approach.) + + -- Matthias Klose Wed, 5 Jul 2006 06:56:54 +0200 + +bash (3.1-4) unstable; urgency=low + + * Update upstream patch 010, apply upstream patches 012, 013, 014. + * bash-default-editor.dpatch: Fix typo (closes: #356308). + * clear_console: Add FreeBSD support (Aurelian Jarno). Closes: #355336. + * clear_console: Only get rid of any history in the scrollback, if + not running in a pseudo tty (closes: #355815). + * bash_completion: + - Fix error in minicom completion (closes: #357241). + + -- Matthias Klose Thu, 23 Mar 2006 01:16:22 +0100 + +bash (3.1-3) unstable; urgency=low + + * Apply upstream patches 006, 007, 008, 009, 010 and 011. + * Define PGRP_PIPE to avoid race condition; monitor mode causes emacs as + $EDITOR to hang on kernel 2.6 (Jim Paris). Closes: #224543. + * Fix read memleak when reading from non-blocking fd (Tim Waugh). + * Recognize 'exec -l /bin/bash' as login shell (Tim Waugh). + * Fix parameter expansion: Array member length expansion fails with nested + index expression (Jan C. Nordholz). Closes: #345861. + * Add swedish translation of message strings. Closes: #349677. + + Merge from Ubuntu: + * clear_console: New helper program to clear the console, including + the scrollback buffer. + * /etc/skel/.bash_logout: Install it again and use clear_console. + Ubuntu #29405. Closes: #331504. + * /etc/skel/.bashrc: Enable bash_completion. + Ubuntu #11414, #25096. + * bash_completion: + - Fix ssh completion to match lines starting with `Hostname' as well. + Closes: #343312. + * Add ulimit options -e and -r. + + * Update bash_completion to 20060301: + - Completion for minicom(1), mtr(8), sysctl(8), smartctl(8), vncviewer(1), + invoke-rc.d, update-rc.d and dpkg-source has been added. + Closes: #323824, #327414. + - gdb completion of second parameter was broken when first parameter + contained white space. + - gdb completion wasn't completing second parameter correctly when it was + a file, rather than a PID. + - Ruby ri completion has been broken for some time. This is now fixed. + - Various fixes to work around change in how POSIX quoting is handled in + bash 3.1. + - subversion completion has been reimplemented from scratch and integrated + into the main file. + - iconv(1) completion has been improved. + - yum(8) completion has been updated for current version of yum. + - ant completion will now make use of complete-ant-cmd.pl, if available. + - cvs(1) completion has been improved with 'update' and 'stat' completion. + - 'aptitude show' now works in the same way as 'apt-cache show'. + - make(1) now also completes on file names. + - MPlayer will now also complete on .flac, .mpc and .3gp files. + Closes: #340452. + - wine will now also complete on .exe.so files. + - unzip will now also complete on oowriter's .ott files. + - xine et al will now complete on .mng files. + - The list of programs completing on .dvi files has been expanded. + - The range of files on which timidity and evince complete has been + expanded. Closes: #351848. + - mkisofs completion now defaults to treating results as file names. + - $DEBUG has been renamed $BASH_COMPLETION_DEBUG to avoid namespace clashes + with other software. + - man(1) completion now works correctly on OpenBSD. + - svk and Mercurial completion have been added to contribs. Closes: #324169. + - Many other small optimisations and fixes. Closes: #325056. + + -- Matthias Klose Sat, 4 Mar 2006 01:54:25 +0100 + +bash (3.1-2) unstable; urgency=low + + * Apply upstream patches 002 - 005. + + -- Matthias Klose Tue, 10 Jan 2006 00:19:25 +0100 + +bash (3.1-0ubuntu3) dapper; urgency=low + + * Document supported ulimit options. + * Fix parsing problems with compound assignments + * Fix readline callback interface. + * Fix ssh command completion (closes: #343312). + + -- Matthias Klose Fri, 23 Dec 2005 11:31:36 +0100 + +bash (3.1-0ubuntu2) dapper; urgency=low + + * command-not-found handler: Print error message, when command not found. + Ubuntu #5120. + * fix ssh command completion. + + -- Matthias Klose Sun, 11 Dec 2005 16:14:14 +0100 + +bash (3.1-1) unstable; urgency=low + + * New upstream version (final 3.1 release). + - Fixed a small memory leak in the programmable completion code. + Closes: #338822. + * Generate the locales needed for the testsuite, build-depend on locales. + * Improve check for existance of /dev/stdin during build. Closes: #333935. + * Fix bash_completion, sudo completion does not protect empty arguments. + Closes: #329148. + * /etc/bash.bashrc: Don't change the xterm title by default, keep the + default for /etc/skel/.bashrc. Closes: #313617, #314614. + + -- Matthias Klose Sat, 10 Dec 2005 00:56:28 +0100 + +bash (3.0+3.1rc1-1) unstable; urgency=low + + * New upstream version (3.1-rc1). + * Remove patches applied upstream: rl-del-backspace-policy, bad-interp. + + -- Matthias Klose Fri, 11 Nov 2005 12:59:32 +0000 + +bash (3.0+3.1b1-1) unstable; urgency=low + + * New upstream version (3.1-beta1). + * Remove bash's dependency on passwd, add one to debianutils (>= 2.15). + + -- Matthias Klose Thu, 13 Oct 2005 15:49:49 +0200 + +bash (3.0+3.1a1-1) unstable; urgency=low + + * New upstream version (3.1-alpha1). + - Fix "cd -P" hanging (closes: #316407). + - Fixed exit status code so that a suspended job returns 128+signal as its + exit status (preventing commands after it in `&&' lists from being + executed). Closes: #288319. + - The globbing code now uses malloc, with its better failure properties, + rather than alloca(). Closes: #238226. + - In POSIX mode, if `xpg_echo' option is enabled, the `echo' builtin + doesn't try to interpret any options at all, as POSIX requires. + Closes: #303649. + - Some changes to the display code to improve display and redisplay of + multibyte characters. Closes: #309654. + - Fixed a bug that caused bash to close fd 2 if an `exec' failed and the + shell didn't exit. Closes: #310308. + - Fix segmentation fault if execve'd with NULL argv. Closes: #316206. + - Fix segfault, if free is called with already freed block argument. + Closes: #317324. + - Fix garbage in bash(1), section SIGNALS. Closes: #327035. + - Fixed vi-mode searching so that failure preserves the current line rather + than the last line in the history list. Closes: #297330. + - Fix segfault on variable assignment. Closes: #291840. + - Fixed parser to generate an error when the pipeline `argument' + to `!' or `time' is NULL. Closes: #273324, #342228. + - A bare `%' once again expands to the current job when used as a job + specifier, updated the help for `%'. Closes: #262095. + - Fix tilde expansion for some cases where it was performed + inappropriately. Closes: #263023. + - Replicate first character of $PS4, not only the first byte. + Closes: #288125. + - bashref.texi: Remove blank lines from contents. Closes: #307264. + * Remove patches applied upstream: + - bash30*, wcontinued, man-cdpath, update-multibyte-ifs, histtimeformat, + spelingm. + - rl-examples, rl-setenv, rl-display, rl-self-insert. + * Update patches: + - deb-bash-config, man-test, man-test2. + * bash(1): Fix /etc/bash.logout file name (closes: #289355). + * Document, that bash is configured using --disable-net-redirections. + Closes: #313538. + * Use `command -v editor`, as an editor, if available. Closes: #296603. + + -- Matthias Klose Fri, 9 Sep 2005 21:09:46 +0200 + +bash (3.0-17) unstable; urgency=low + + * Check that the device files /dev/std{in,out,err} are present at + build time. Closes: #327477. + * Remove html completion for w3m, users claim w3m to be a general viewer. + * /etc/bash.bashrc: Avoid stat on /etc/debian_chroot, if not necessary. + Closes: #303712. + * debian/patches/wcontinued.dpatch: Update, fixing hangs in + bash_completion (Junichi Uekawa). Closes: #318301. + * Build-depend on texinfo (>= 4.8). Closes: #316066. + + -- Matthias Klose Thu, 13 Oct 2005 11:24:21 +0000 + +bash (3.0-16ubuntu3) breezy; urgency=low + + * Don't install .bash_logout again, doesn't clear the buffer and + ps is not in required. + + -- Matthias Klose Wed, 5 Oct 2005 13:29:22 +0200 + +bash (3.0-16ubuntu2) breezy; urgency=low + + * Fix segmentation fault due to gcc optimization and longjmp. Patch + by Jim Paris. Debian #331381. + * Don't overwrite PROMPT_COMMAND in /etc/bash.bashrc. Ubuntu #15122. + Closes #330889. + * Install skeleton .bash_logout to clear the screen, when logging out + from the console. Ubuntu #10149. + + -- Matthias Klose Tue, 4 Oct 2005 18:01:26 +0200 + +bash (3.0-16ubuntu1) breezy; urgency=low + + * bash_completion changes: + - Add completion for evince. + - Fix completion for aptitude (Ubuntu 12549). + Closes: #293979, #325045, #327413. + - Add completion for *.flac files in mplayer (closes: #304778). + - Add completion for *.ott files for unzip and zipinfo (closes: #322481). + - Add html completion for w3m. + + -- Matthias Klose Fri, 9 Sep 2005 20:33:31 +0200 + +bash (3.0-16) unstable; urgency=low + + * Update to bash_completion 20050721 (v1.827). + - Fix function name in aptitude completion (closes: #304624, #320390). + * In PROMPT_COMMAND, use ~ instead of the complete path. + * Adjust for dpkg-dev (>= 1.13.9). Closes: #313546. + + -- Matthias Klose Mon, 5 Sep 2005 18:37:19 +0200 + +bash (3.0-15) unstable; urgency=low + + * glibc-2.3.5 defines WCONTINUED, which is available only since + Linux 2.6.10. On older kernels waitpid() returns -1 with errno + set to EINVAL if WCONTINUED is supplied in options. Retry without + WCONTINUED set in that case. + + -- Matthias Klose Wed, 25 May 2005 12:38:09 +0000 + +bash (3.0-14ubuntu1) breezy; urgency=low + + * Configure the static build --without-bash-malloc. + + -- Matthias Klose Sat, 21 May 2005 07:28:25 +0000 + +bash (3.0-15) unstable; urgency=low + + * Print out bad interpreter names with trailing ^M (DOS line endings). + Closes: #282762. + + -- Matthias Klose Sun, 23 Jan 2005 20:24:58 +0100 + +bash (3.0-14) unstable; urgency=low + + * Fix re-read-init-file (C-xC-r) not to read /etc/inputrc twice, + but /etc/inputrc and ~/.inputrc. Thanks to Vasco Pedro. + * Fix bug in readline's self-insert command (closes: #290103). + * Fix bash-builtins package description (closes: #290258). + * Add cross build support (closes: #283732). + * Update to bash_completion 20050121 (v1.786). + - Improve ssh2 known hosts completion. (closes: #282767). + - Pass over switches to metacommands like sudo, nice, exec, etc. + (closes: #289847) + - Trivial fix to allow python to be called with a path component without + bash displaying a bad subscript error. (closes: #290748) + - unzip should also work on .sxw files. (closes: #286738). + - Lots of commands that use _longopts() don't use filenames at all, so + these shouldn't be mapped with '-o filenames'. (closes: #283069, which + related only to wget). + - Make dd treat completions as filenames, which is bad for options, but + good for filename arguments to 'if' and 'of'. (closes: #287286). + - Fix lvresize errors when running as non-root (closes: #285604). + + -- Matthias Klose Sat, 22 Jan 2005 23:08:57 +0100 + +bash (3.0-13) unstable; urgency=low + + * Update to bash_completion 20050103 (v1.772). + * Fix segfault in the ``reverse-search-history'' feature of the readline + library, if the search string matches a previously entered command (ie + history) and must overflow the current screen width. Closes: #288940. + + -- Matthias Klose Wed, 12 Jan 2005 08:11:36 +0100 + +bash (3.0-12) unstable; urgency=low + + * debian/skel.bashrc: Quote dircolors invocation (closes: #285840). + + -- Matthias Klose Sun, 19 Dec 2004 17:48:17 +0100 + +bash (3.0-11) unstable; urgency=low + + * Adjustments to the skeleton files. + * Fix spelling errors in the docs (closes: #281842). + + -- Matthias Klose Wed, 17 Nov 2004 06:37:48 +0100 + +bash (3.0-10) unstable; urgency=low + + * Apply upstream patch 015-016. + + -- Matthias Klose Thu, 11 Nov 2004 07:15:34 +0100 + +bash (3.0-9) unstable; urgency=low + + * Apply upstream patch 001-014. + * Document handling of parameters of the test builtin (closes: #173273). + + -- Matthias Klose Fri, 29 Oct 2004 23:57:19 +0200 + +bash (3.0-8) unstable; urgency=low + + * Add a comment to /etc/bash.bashrc that the file is not read by + login shells (closes: #271413). + * Sync builtin CDPATH documentation with man page (closes: #259767). + * Document conditional file expressions acting on the target of + symbolic links as well (except -h, -L). Closes: #231267. + * Update to bash_completion 20041017 (v1.758). + - Unset `have' variable at end of sourcing (closes: #273809). + - Fix scp completion breakage when filenames contained an ampersand. + Closes: #262354. + + -- Matthias Klose Sun, 17 Oct 2004 09:31:03 +0200 + +bash (3.0-7) unstable; urgency=low + + * Apply upstream patches 001-013, remove patches collected from the net. + * Patch bash30-003 restores a measure of backwards compatibility for the + `trap signum' syntax (closes: #261948). + * Trim skeleton files. + + -- Matthias Klose Sun, 19 Sep 2004 09:06:36 +0200 + +bash (3.0-6) unstable; urgency=low + + * Fixed in bash-3.0: + - New option pipefail. If set, the return value of a pipeline is the + value of the last (rightmost) command to exit with a non-zero status, + or zero if all commands in the pipeline exit successfully. This option + is disabled by default. The two oldest outstanding bash reports are + gone (closes: #7047, #10494). + - "$( substitution strangeness (closes: #187983). + - timestamp support in history (closes: #161057). + * Various updates from the net: + - Fix a bug in array expansion. + - Fix a bug in brace expansion. + - Handle multibyte characters in IFS values. + - Fix a bug, when pipefail option is set. + - History saved-line handling (closes: #253766, #268922). + - Fix parameter expansion with UTF-8 and ${#var} or ${var: -1}. + * Apply patch to fix non POSIX function name and avoid use of global + variables (Stephen Gildea). Closes: #262105. + * Add command_not_found_handle in non POSIX interactive shells. + Closes: #243015. + * Check for /usr/sbin/remove-shell before using it (closes: #265982). + * bash-builtins: Install missing header files (closes: #265259). + * Clarify documentation about substring expansion (closes: #192831, #203767). + * Fix completion on ~/../``/ (closes: #261142). + * Clarify documentation about case-insensitive pathname expansion. + Closes: #141292. + * Apply patch to fix the display of UTF-8 characters. + Closes: #224916, #257540. + + -- Matthias Klose Sat, 4 Sep 2004 10:21:23 +0200 + +bash (3.0-5) unstable; urgency=medium + + * Fix segfault and wrong behaviour running the firehol script. + Closes: #262438, #262642. + * Add history scrolling patch patch (closes: #263064). + * Strip bash binary, leftover from debugging (closes: #263451). + * `cd -' printing the directory in non-interactive mode, non-POSIX mode + is new behaviour, not a bug (closes: #262619). + * Address build failure calling the 'binary' target directly instead of + dpkg-buildpackage (closes: #263797). + * Remove kfreebsd-gnu hack to disable bash malloc (closes: #263005). + + -- Matthias Klose Fri, 6 Aug 2004 07:10:24 +0200 + +bash (3.0-4) unstable; urgency=low + + * Revert substitution patch trying to fix completion on ~/../``/. + Reopens: #261142. Closes: #261955, #262338, #262602. + + -- Matthias Klose Sun, 1 Aug 2004 12:36:57 +0200 + +bash (3.0-3) unstable; urgency=high + + * Revert the following upstream change (until sarge is released): + The historical behavior of `trap' that allows a missing `action' argument + to cause each specified signal's handling to be reset to its default is + now only supported when `trap' is given a single non-option argument. + Addresses: #261948. + * Fix line wrapping (closes: #261957). + + -- Matthias Klose Fri, 30 Jul 2004 16:17:22 +0200 + +bash (3.0-2) unstable; urgency=medium + + * Fix typo in bash-minimal's postinst. Closes: #260506. + * Fixed in bash-3.0: + - pwd builtin exiting with write error. Closes: #243872. + + -- Matthias Klose Thu, 29 Jul 2004 07:13:13 +0200 + +bash (3.0-1) unstable; urgency=medium + + * New upstream release. + * Bugs fixed in this release (and the alpha/beta releases and release + candidates): + - Fixed a bug that caused the prompt to overwrite previous output when the + output doesn't contain a newline and the locale supports multibyte + characters. This same change fixes the problem of readline redisplay + slowing down dramatically as the line gets longer in multibyte locales. + Closed: #179883. + - The shell no longer seg faults if the expanded value of $PS4 is null + and `set -x' is enabled. Closes: #165533. + - Don't define a default DEFAULT_MAIL_DIRECTORY, because it can cause + a timeout on NFS mounts. Closes: #211426. + - Fixed a bad interaction between alias and completion. Closes: #186218. + - Fix initialization of local variables with "$@". Closes: #180290. + - Fixed segfault in "read -a foo <<< $(echo)". Closes: #167003. + - Fixed the history word tokenizer to handle <( and >( better when used as + part of bash. Closes: #165212. + - Fixed EINTR signal killing redirection. Closes: #164134. + - Fixed infinite loop with IFS="" and compgen -W. + Closes: #162952. + - Fixed the internal logout code so that shells that time out waiting for + input (using $TMOUT) run ~/.bash_logout. Closes: #152847. + - Speedups to the multibyte character redisplay code. Closes: #197965. + - Better error message on wrong kill arguments. Closes: #193570. + - Overwriting of prompt. Closes: #176968. + - The shell now reports on processes that dump core due to signals when + invoked as `-c command'. Closes: #211693. + - Fixed ferror beeing called w/o always first calling clearerr + results in spurious errors reported. Closes: #195116. + - Add missing trailing slash on directory completion. Closes: #178828. + - Fix different behaviour for builtin and external commands together + with arithmetic expansion. Closes: #173744. + - Fixed a bug that caused redirections accompanying a null command + to persist in the current shell. Closes: #173148. + - Fixed a bug that caused a leading `-' in the shell's name to cause it to + not be recognized as a restricted shell. Closes: #170298. + - Fix segfault in ill formed paramter expansion. Closes: #162773. + - Fixed a bug in brace expansion that caused a quoted `$' preceding an + open brace to inhibit brace expansion. Closes: #157954. + - Removed the attempts to avoid adding a slash at the end of a completed + executable name if there was a directory with the same name in the + current directory. Closes: #155134, #189006. + - Fix error message for circular alias expansions. Closes: #173588. + - Fixed a bug that caused some key bindings set in an inputrc to be ignored + at shell startup. Closes: #110969. + - Fix segfault on bad array subscripts. Closes: #232653. + - Fix "set completion-ignore-case on" breaking some tab completion. + Closes: #224303. + - Flag an error when a user uses "% DIGITS" instead of "%DIGITS", and + don't give him a different job instead. Closes: #173854. + - For 'cd filename' say 'not a directory', not 'no such file or directory' + when filename exists and is not a directory. Closes: #219958. + - Expansion results are the same for ${1:+"$@"} and "$@" if IFS is not + the default. + - The locale code does a better job of recomputing the various locale + variable values when LC_ALL is unset. Closes: #160932. + - Fix substitution error triggering an assertion. Closes: #251801. + * Documentation updated in this release (and the alpha/beta releases): + - Fix documentation about exit status of unset builtin. Closes: #183352. + - Clarify documentation for arguments of wait builtin. Closes: #174133. + - Document ${!prefix@} expansion. Closes: #168318. + - Fix documentation of GLOBIGNORE behaviour. Closes: #168267. + - Document the use of $EMACS. Closes: #174744. + - Improve documentation of the value of arithmetic expressions. + Closes: #168321. + - Make docs more explicit about variable indirection in shell parameter + expansion. Closes: #167002. + - Documentation for values of various assignments updated. Closes: #168331. + - In section "Shell Functions", add documentation for syntax, + which bash accepts. Closes: #172971. + - Fix documentation of the PATH variable. Closes: #155369. + - Document SHELL variable in section "Shell Variables". Closes: #249657. + - Remove reference to missing section in rbash(1). Closes: #249219. + * Fix another segfault in completion code. Closes: #261142. + + -- Matthias Klose Tue, 27 Jul 2004 21:23:42 +0200 + +bash (2.05b-2-22) unstable; urgency=low + + * Brown paperbag ... Fix typo in bash-minimal's postinst. + + -- Matthias Klose Tue, 20 Jul 2004 23:04:56 +0200 + +bash (2.05b-2-21) unstable; urgency=low + + * Remove the pre-dependency on passwd. + * Explicitely check for the existance of /usr/sbin/add-shell. + * Reassign #257744 to debootstrap to correctly handle the installation. + + -- Matthias Klose Mon, 19 Jul 2004 22:57:19 +0200 + +bash (2.05b-2-20) unstable; urgency=medium + + * Make passwd a pre-dependency (closes: #257744). + + -- Matthias Klose Sat, 17 Jul 2004 06:56:38 +0200 + +bash (2.05b-2-19) unstable; urgency=low + + * Build using gcc, not gcc-3.4 (closes: #259208). + + -- Matthias Klose Tue, 13 Jul 2004 21:25:28 +0200 + +bash (2.05b-2-18) unstable; urgency=low + + * Tighten dependency on passwd (closes: #257717). + * Update to bash_completion 20040711 (v1.737). + - Fix mutt folder completion (closes: #248635). + * Fix tab completion on relative path directories (closes: #189006). + * Modify lib/malloc/malloc.c to make it compile with gcc-3.4 (Andreas + Jochens). Closes: #258456. + + -- Matthias Klose Tue, 13 Jul 2004 06:15:46 +0200 + +bash (2.05b-2-17) unstable; urgency=low + + * Add dependencies on passwd (closes: #257630). + + -- Matthias Klose Sun, 4 Jul 2004 22:56:17 +0200 + +bash (2.05b-2-16) unstable; urgency=low + + * Handle shells using add-shell/remove-shell (closes: #254476). + * Update to bash_completion 20040704 (v1.731). + - Add autocompletion for dpkg -P, --purge (closes: #241042, #249934). + - Fix mutt folder completion (closes: #248635). + - Add autossh to ssh completions (closes: #252090). + - Emacs completion does not discard .tar* archives (closes: #252347). + - Add MS filename extensions to OpenOffice (closes: #252635). + - Add completion for tar.Z files (closes: #254896). + - Fix problems with sed-4.1 (closes: #256000). + - Fix dpkg completion with multiple arguments (closes: #257544). + * Fix formatting in bash(1). Closes: #248344. + + -- Matthias Klose Sun, 4 Jul 2004 16:07:24 +0200 + +bash (2.05b-2-15) unstable; urgency=low + + * Fix a bug that caused a leading `-' in the shell's name to cause it to + not be recognized as a restricted shell (closes: #170298). + * Fix option in menu file (closes: #162152). + * Backout patches/random patch (closes: #242111). + * Update to bash_completion 20040331 (v1.700). + * Update skeleton files and /etc/bash.bashrc to include the contents + of /etc/debian_chroot in the prompt, if the file exists. + * Add openoffice completions (closes: #244611). + * Remove ee (eeyes) completion (closes: #240668). eeyes isn't distributed + anymore. + * bash(1): Document ~/.bash_login and ~/.profile in FILES section. + Closes: #204766. + * Apply patch from http://www.savarese.org/posix/ to improve the mail + checking code so it won't check (and possibly cause an NFS file system + mount) until MAILPATH or MAIL is given a value. Closes: #211426. + * Add missing dependency in debian/rules (closes: #247413). + + -- Matthias Klose Sat, 8 May 2004 18:36:41 +0200 + +bash (2.05b-2-14) unstable; urgency=low + + * Add bash reference manual in PDF format (closes: #202849). + * Remove FAQ; the license doesn't allow modification (closes: #231157). + * debian/copyright: Name the copyright holders (closes: #233716). + * Update to bash_completion 20040214 (v1.690). + - Make xspec parsing immune to comments (closes: #226812). + - Another fix to sudo completion: "sudo completion is virtually + impossible to get right. It's just a question of choosing what + aspect of it is the least annoying to leave broken. :-(" + Closes: #223094. + - xine can also complete on .asx files (closes: #231356). + - Speedup dpkg completion (closes: #232585). + - Fix chsh completion (closes: #232214). + * Disable the GNU/kFreeBSD kludge (--without-bash-malloc). Closes: #234137. + + -- Matthias Klose Sun, 22 Feb 2004 13:31:03 +0100 + +bash (2.05b-2-13) unstable; urgency=medium + + * Apply patch to speedup display of characters under multibyte locales. + Thanks to Denis Barbier. Closes: #197965. + * Update to bash_completion 20040101 (v1.672). + - Closes: #215030, #224981. + - Include completion for sitecopy in contrib directory (closes: #223294). + * Fix typo in man page (closes: #224477). + * Don't build bashdb anymore. Not ready for use. Closes: #224573, #224566. + * Document /etc/bash.bashrc in bash man page (closes: #216403). + + -- Matthias Klose Sat, 24 Jan 2004 21:20:25 +0100 + +bash (2.05b-2-12) unstable; urgency=low + + * Update to bash_completion 20031022 (v1.644). + * Fix "suspend" segfaults in non-interactive shells (closes: #217188). + * Rename bashdb's gud.el to gud-bashdb.el (closes: #220002). + + -- Matthias Klose Mon, 10 Nov 2003 23:53:35 +0100 + +bash (2.05b-2-11) unstable; urgency=medium + + * Tighten automake build dependency (closes: #215350). + * Add dependency line for bashdb (closes: #215634). + * /etc/skel/.bashrc: set xterm's title as we do for PS1 (closes: #176734). + * Remove build dependency on readline (closes: #215165). + * Update to bash_completion 20031007 (v1.630). + + -- Matthias Klose Tue, 14 Oct 2003 20:37:23 +0200 + +bash (2.05b-2-10) unstable; urgency=low + + * Update to bash_completion 20030911 (v1.624). + + -- Matthias Klose Mon, 22 Sep 2003 11:43:39 +0200 + +bash (2.05b-2-9.1) unstable; urgency=low + + * Added build dependency on texi2html (closes: #211151). + * Create site-lisp directory in bashdb target. + + -- Herbert Xu Thu, 18 Sep 2003 18:39:51 +1000 + +bash (2.05b-2-9) unstable; urgency=low + + * Recompilation fixes segfaults in bash-static (closes: #205185). + * Build debugger enabled bash binary (bash-bashdb). Closes: #195877. + * Update to bash_completion 20030821 (v1.617). Closes: #203859, #205741. + * Adjust config.guess triplet for GNU/FreeBSD (closes: #194182). + * Fix package description (closes: #202344). + + -- Matthias Klose Mon, 8 Sep 2003 23:34:50 +0200 + +bash (2.05b-2-8.1) unstable; urgency=low + + * Fixed versioned dependency of bash-builtins (closes: #196421). + * Call dh_fixperms in bash-minimal. + + -- Herbert Xu Sat, 7 Jun 2003 12:44:18 +1000 + +bash (2.05b-2-8) unstable; urgency=low + + * Apply upstream patches 005, 006, 007. + 006 addresses the LSB 1.3 test suite failures (closes: #184888). + 007 addresses ~ command working with UTF-8 locales (closes: #179946). + * Build a minimal shell in package bash-minimal (closes: #176164). + Sort of fix for reports complaining that /bin/sh does have + additional features compiled in (closes: #183185). + * Build a static shell in package bash-static (closes: #138089). + * Update to bash_completion 20030527 (v1.571) (closes: #167852, #171523, + #184738, #185711, #189535, #192282). + * /etc/skel.profile: Export MANPATH (commented out). Closes: #180717. + * Add menu entry for bash (closes: #187596). + * + * Install info docs as bashref.info, symlink to bash.info (closes: #174674). + * Fix segfault with builtin shift, no arguments and "shopt -s shift_verbose". + Closes: #159996. + * Update config.{sub,guess} (closes: #179737). + * Fix apt-cache search completion (closes: #184144). + * Configure --without-bash-malloc on GNU/FreeBSD (closes: #194182). + + -- Matthias Klose Thu, 29 May 2003 17:00:53 +0200 + +bash (2.05b-7) unstable; urgency=medium + + * Fix rbash man page (closes: #181248). + * On m68k-linux, bash is miscompiled using gcc-3.2 and gcc-snapshot. + Revert back to gcc-2.95. + + -- Matthias Klose Fri, 28 Feb 2003 00:54:22 +0100 + +bash (2.05b-6) unstable; urgency=low + + * First upload compiled using gcc-3.2 as the default compiler. + * Update to bash_completion 20030126 (v1.520) (closes: #168478, #145481, + #150628, #158039, #168700, #169232, #169586, #171161, #171420, #171523, + #173096, #177654). + + -- Matthias Klose Mon, 27 Jan 2003 21:08:19 +0100 + +bash (2.05b-5) unstable; urgency=high + + * Build-depend on bison-1.35 (closes: #167635). + + -- Matthias Klose Mon, 4 Nov 2002 09:30:39 +0100 + +bash (2.05b-4) unstable; urgency=low + + * Ignore *~ and *.bak files in /etc/bash_completion.d/ (closes: #161027). + * debian/patches/rl-mbutil.dpatch: Fix segfault in mbutil.c. + * Update to bash_completion 20021026 (v1.462) (closes: #161671, #162161, + #163096, #163097, #164890, #165937). + * Apply fix for debian/bash.preinst.c (closes: #162424). + * Avoid warning in s390 build (closes: #160731). + * /etc/skel.bashrc: Add commented example to set the `checkwinsize' + option (maybe closes: #161984). + * Install builtins manpage as bash-builtins(7), add an alternative + builtins(7) with priority 10 (closes: #166082). + * Fix typo in documentation of deprecated arithmethic expansion. + Closes: #161386. + * rl-8bit-init.dpatch: Apply (closes: #164809). + * README.Debian: Removed invalid entry about ssh (closes: #159754). + + -- Matthias Klose Tue, 24 Sep 2002 12:40:35 +0200 + +bash (2.05b-3) unstable; urgency=low + + * Apply upstream patch 003 (Fix completing executable names). + Closes: #155134, #159466. + * Apply upstream patch 004. + * Fix completion by TAB in quoted sequence(`...`) with Multibyte Locale. + Patch from Satoshi Koike (closes: #155436). + * Update to bash_completion 20020909 (v1.410) (closes: #154595, #155211, + #155706). + * Don't set umask in /etc/skel/.bash_profile (closes: #155973). + * Drop suggestion of grep-dctrl (closes: #156351). + + -- Matthias Klose Fri, 9 Aug 2002 05:30:24 +0200 + +bash (2.05b-2) unstable; urgency=medium + + * Apply upstream patches: + - Fix a command completion problem (closes: #154273). + - Fix a segfault (closes: #154123). + - Fix for repeating an edit in vi mode. + * Fix typo in /etc/skel/.bashrc (closes: #153856). + * Update to bash_completion 20020727 (v1.390) (closes: #148873, #153045). + * Install info docs in "Shells" section (closes: #154618). + + -- Matthias Klose Fri, 2 Aug 2002 19:24:28 +0200 + +bash (2.05b-1) unstable; urgency=low + + * New upstream version: + - Fixed a problem with process substitution that resulted in incorrect + behavior when the number of process substitutions in an individual + command approached 64 (closes: #149229). + - Added putenv, setenv, unsetenv to getenv replacement (closes: #149262). + - Fixed bug, where bash incorrectly reports failure to execute a script. + Closes: #126620, #140819. + - Fixes an `out of memmory in pipe' error (closes: #134004). + - Fixed a bug that could cause the -O expand_aliases invocation option + to not take effect (closes: #122362). + - New code to handle multibyte characters (obsoletes and closes: #25131, + #118724). + - Fixed the /= and %= arithmetic operators to catch division by zero. + Closes: #148950. + - Fixed abort in completion of absolute filenames (closes: #136625). + - Fixed "declare -f"'s handling of here-documents (closes: #127452). + - Documentation for `==' adds hint for POSIX compliance (closes: #137741). + - Not reproducible anymore with new upstream version. Upstream regards + these as fixed (closes: #142906, #143811, #144375). + - Fix bug in `compgen -W' (closes: #143518). + - Fix memory corruption error printing error message (closes: #145229). + - Unreproducible with the new upstream version (closes: #135062). + - Fixed a bug that caused a syntax error when a command was terminated by + EOF (closes: #147258). + - Fixed a problem which caused the display to be messed up when the last + line of a multi-line prompt (possibly containing invisible characters) + was longer than the screen width (closes: #137268). + - The `home' and `end' keys are now bound to beginning-of-line and + end-of-line, respectively, if the corresponding termcap capabilities + are present (closes: #89026, #89034, #98029, #107453, #107897, #116943, + #119491, #128687, #130029). + - Fixed a bug that could cause the -O expand_aliases invocation option + to not take effect (closes: 148505). + - Bash now correctly honors setting LANG to some value when LC_ALL does not + already have a value (closes: #145597). + - The `unset' builtin no longer returns a failure status when asked to + unset a previously-unset variable or function (closes: #98743). + - Changes to make reading and writing the history file a little faster, and + to cope with huge history files without calling abort(3) from xmalloc. + Closes: #61006. + * Fixed in earlier versions of bash: + - Fixed a bug that caused SIGINT to kill shell scripts after the script + called `wait' (closes: #14658). + - Handling of ANSI sequences in PS1 (closes: #60914). + - ctrl+z when running while-loop puts bash in broken state (closes: #98521). + * Fix build error (closes: #151681). + * bash suggests bash-doc (closes: #152353). + * /etc/skel/.bashrc: Only enable color support for ls, when $TERM != dumb. + Closes: #143361. + * Report is missing any information. Bug submitter didn't respond. + Closes: #130051. + * Close a report for a sefault in bash-2.03, which cannot be reproduced + anymore in newer versions (2.05) (closes: #58404). + * Add the README.commands document to the doc directory. Reassign #106170 + to doc-linux-text. + * Update to bash_completion 20020716 (v1.383) (closes: #145938). + + -- Matthias Klose Fri, 19 Jul 2002 22:33:25 +0200 + +bash (2.05a-12) unstable; urgency=low + + * Update to bash_completion 20020528 (v1.335) (closes: #141970, #142015, + #142859, #144335, #146152, #146309, #146693). + Put the the contributed completion files into /usr/share/doc. + * Suggest grep-dctrl, which is called by the completion code. Added + note to README.bash_completion, that the completion code depends on it. + Closes: #146152. + * Mention bash_completion in the package description (closes: #146878). + * Fix brace expansion (Fix by Richard Kettlewell ). + Forwarded. Closes: #144983. + + -- Matthias Klose Thu, 30 May 2002 23:50:40 +0200 + +bash (2.05a-11) unstable; urgency=medium + + * Don't mishandle negative pid in `kill' builtin (closes: #133927, #137742). + * builtins(1) doesn't document `for' (closes: #118755). + * Add /usr/share/bash_completion directory to source package specific + completion files. + * Update to bash_completion 20020408 (v1.264). + Closes: #133109, #139375, #139675, #134713, #141134. + * Add completion to /etc/skel/.bashrc (commented out). Closes: #138921. + + -- Matthias Klose Mon, 8 Apr 2002 20:51:41 +0200 + +bash (2.05a-10) unstable; urgency=medium + + * Init seed of random generator in subshells (patch from Miha Tomsic). + * Update to bash_completion 20020330 (v1.237). + Closes: #138673, #138707, #139110 and #139675. + * Strip bash(1) again (closes: #138902). + + -- Matthias Klose Sun, 31 Mar 2002 08:08:26 +0200 + +bash (2.05a-9) unstable; urgency=low + + * Fix bug reading /etc/bash_completion.d files. + + -- Matthias Klose Sat, 16 Mar 2002 00:54:28 +0100 + +bash (2.05a-8) unstable; urgency=low + + * A last bash_completion bug fix upload (updated to v1.195, + see changelog.bash_completion.gz for details). + All files in /etc/bash_completion.d are read before ~/.bash_completion + is read. Files containing a dot are ignored. + Included completion extensions (closes: #129661, #137725, #137732). + + -- Matthias Klose Tue, 12 Mar 2002 23:25:21 +0100 + +bash (2.05a-7) unstable; urgency=low + + * A bash_completion bug fix upload (updated to v1.180, + see changelog.bash_completion.gz for details). Really closes: #133825. + + -- Matthias Klose Thu, 7 Mar 2002 00:06:14 +0100 + +bash (2.05a-6) unstable; urgency=medium + + * Configure --without-bash-malloc. At least on hppa, this fixes an error, + which shows up when building gcc or kernels: + malloc: /build/buildd/bash-2.05a/unwind_prot.c:284: assertion botched + free: called with unallocated block argument + * A bash_completion bug fix upload (updated to v1.163, + see changelog.bash_completion.gz for details). + Closes: #133111, #133112, #133116, #133825, #134296. + * Updated service completion patch (Ian Macdonald). + + -- Matthias Klose Sat, 2 Mar 2002 00:27:22 +0100 + +bash (2.05a-5) unstable; urgency=medium + + * A bash_completion bug fix upload (updated to v1.93, + see changelog.bash_completion.gz for details). + Closes: #129106, #130167, #129033, #129228, #129451, #129884, #132309, + #132529, #132552, #132553. + Ian even added completion for Quake! Horrible ... + * Include service completion patch. + * README.bash_completion: Fix reference to /etc/bash.bashrc (closes: #129816). + + -- Matthias Klose Wed, 6 Feb 2002 22:22:09 +0100 + +bash (2.05a-4) unstable; urgency=high + + * Fix for causing a segmentation fault when some special shell variables + are declared as array (therefore urgency high). + * Apply patch for function prototypes (closes: #124004, #124362). + * Capitalize `POSIX' in package description (closes: #124439). + * Add (commented) setting of MANPATH to /etc/skel/.bash_profile + (closes: #123792). + * Update builtins(1) (closes: #125673). + * Taken from the current upstream sources: Make the symlinked directory + completion behavior introduced in readline-4.2a a user-settable option. + If `mark-symlinked-directories' is set to `on', the symlinked directory + completion behavior is disabled, and symlinks that point to directories + have a slash appended. + * Add a script for programmable bash completion (version 1.53) from + http://www.caliban.org/bash/index.shtml#completion. Add commented + code into /etc/bash.bashrc and (closes: #127645). + * Install the changelog _and_ the CHANGES file to the doc dir. + * bash(1): mention quoting when assigning to FIGNORE (closes: #115290). + + -- Matthias Klose Sat, 12 Jan 2002 16:00:08 +0100 + +bash (2.05a-3) unstable; urgency=low + + * Include version.h in /usr/include/bash (closes: #120069). + * Link statically with readline and history to speed up link time + (and was done in bash-2.03). Closes: #107160. + * Add comment to set HISTCONTROL in /etc/skel/.bashrc (closes: #118132). + + -- Matthias Klose Sat, 8 Dec 2001 12:29:28 +0100 + +bash (2.05a-2) unstable; urgency=high + + * Update config.{sub,guess} from ftp://ftp.gnu.org/pub/gnu/config/. + + -- Matthias Klose Fri, 16 Nov 2001 19:07:06 +0100 + +bash (2.05a-1) unstable; urgency=medium + + * New upstream release. + * This is mainly a bugfix and code cleanup release (as you can see + from the version number as well). Fixes 64bit issues and index + overflow errors. Fixes the following Debian reports: + - Segmentation fault in script from report (closes: #119250). + - Extensions to the printf command (closes: #72320). + - Accept an empty list of items in a for loop (as ash does). + Closes: #91983. + - A bug that caused redirections with (...) subshells to be performed in + the wrong order was fixed (closes: #97551). + - Correctly handle errors from pipelines in andor lists (closes: #102196). + - Subshells of login shells no longer source ~/.bash_logout when they exit + (closes: #117701). + - Don't pass unset shell variable in the environment (closes: #117673). + * Upstream integrates the following Debian patches: + - debian/patches/mailcheck.dpatch: check for mail in the maildir format. + - debian/patches/gnu-source.dpatch: define GNU_SOURCE and include + strsignal prototype. + - Don't include -I/usr/include in CFLAGS. + - debian/patches/print-cmd.dpatch: Fixed an unassigned variable problem + in the redirection printing code. + - debian/patches/64bit.dpatch: 64-bit uncleanliness. + * Unable to reproduce behaviour with beta1, rc1 and final version from + report (closes: #110483, #110484). + * Point to the bash-doc package for example startup files (closes: #117642). + * The man page is precises: comments start with a word beginning with a `#'. + With '\ #', the doesn't start a word. Closes: #115118. + + -- Matthias Klose Wed, 14 Nov 2001 22:13:21 +0100 + +bash (2.05a-0rc1) unstable; urgency=low + + * New upstream (bugfix) release (release candidate). + * Add README.abs-guide, a pointer to the `Advanced Bash Scripting Guide'. + + -- Matthias Klose Fri, 2 Nov 2001 10:59:11 +0100 + +bash (2.05a-0beta1) unstable; urgency=low + + * New upstream (bugfix) release. + * Configured with --enable-largefile. + * Bugs fixed in this version. Closes: #72320, #91983, #97551, #102196, + #105231, #110483, #110484. + * Remove debian/patches/mailcheck.dpatch, included upstream. + * Closes: #61006. Logging history commands in the history cannot work. + * Not a bug (closes: #100743, #110604). + + -- Matthias Klose Thu, 11 Oct 2001 23:05:20 +0200 + +bash (2.05-10) unstable; urgency=medium + + * Rebuild with released libreadline library (closes: #113182). + + -- Matthias Klose Sun, 23 Sep 2001 01:16:48 +0200 + +bash (2.05-9) unstable; urgency=medium + + * Remove files left from test build (closes: #110307, #109807). + * Apply patches from reports (closes: #110275, #110276). + * Fix include of rbash man page (closes: #113111). + + -- Matthias Klose Sat, 22 Sep 2001 11:26:44 +0200 + +bash (2.05-8) unstable; urgency=low + + * Apply patch (Eric Gillespie) to define GNU_SOURCE and include + strsignal prototype (closes: #109807). + * Fix include of builtins man page (closes: #109917). + + -- Matthias Klose Sun, 26 Aug 2001 08:35:47 +0200 + +bash (2.05-7) unstable; urgency=high + + * Remove config.{cache,status} from source package (#107679). + (high urgency for hurd). + * /etc/skel/.bashrc: Fix dircolors invocation (closes: #107373). + Add commented code to set xterm's title to the prompt. + + -- Matthias Klose Mon, 6 Aug 2001 23:33:41 +0200 + +bash (2.05-6) unstable; urgency=low + + * Apply upstream patches p5, p6. + * Include missing header files in builtins package (closes: #105302). + * Don't list names of built-in commands in NAME section of builtins(1). + (closes: #99532). + * Document deprecated syntax of arithmetic evaluation (closes: #94266, + #95502). + * README.Debian: Document unsetting of SSH_CLIENT (closes: #88032). + + -- Matthias Klose Sat, 21 Jul 2001 18:41:10 +0200 + +bash (2.05-5) unstable; urgency=low + + * The behavior of range specificiers within bracket matching expressions + in the pattern matcher (e.g., [A-Z]) depends on the current locale, + specifically the value of the LC_COLLATE environment variable. + See /usr/share/doc/COMPAT.gz, 14. Closes #95285. + * Tagging reports as 'wontfix' and closing reports: + - exit status of pipes (#7047, #10494). + - completion behaviour on ':' (#78991). + - */text* completion (#21645). + * Documentation of command hashing is documented (#76135). + + -- Matthias Klose Thu, 26 Apr 2001 09:03:37 +0200 + +bash (2.05-4) unstable; urgency=low + + * Apply upstream patches p1-p4 (closes #92455). + * Fixed in bash-2.05-alpha1: closes #47588. + + -- Matthias Klose Wed, 25 Apr 2001 19:32:36 +0200 + +bash (2.05-3) unstable; urgency=low + + * Add 'Replaces: bash-doc (<= 2.05-1)' (closes: #93799). + + -- Matthias Klose Fri, 13 Apr 2001 01:15:19 +0200 + +bash (2.05-2) unstable; urgency=medium + + * Tighten build dependency (fixes #93509). Only an issue for upgrades + from bash-2.05-0, therefore urgency=medium. + * Remove changelog from bash package (also in bash-doc). Reported as + #93446, #93454, #93455. + * Fixed in bash-2.04, wrong example in report (#33822). + * Documented behaviour (ulimit, #72898). + * Use of redirection for #92324. + * sed, awk, ... builtins should be provided by the specific package. + there are other ways to make system scripts faster (ash, perl, + python, ...) (#61648). + * Unable to reproduce #34977 submitted for version 2.02.1, bug submitter + didn't respond to inquiries. Closing ... + * http://metalab.unc.edu/pub/Linux/docs/HOWTO/other-formats/html_single/Text-Terminal-HOWTO.html + as explanation for C-s behaviour (#68387, not sure why I missed this + for so long). + * Part one of the report is Posix.2 behaviour; part 2 (cd-ing relatively + from a subdirectory into a specified root-level directory) already + fixed in bash-2.04. #65316. + * Closing #13645. "The `-l' option should never have been documented, and it + was a mistake to include it in the first place -- it screws up the grammar. + Old Bourne shells and test commands had it because there was no other + way to find the length of a variable's value. Since bash has + ${#variable}, there's no need for it. POSIX.2 says, in the rationale, + that implementation is irregular and that the shell supports it directly + * Unable to reproduce #19211 submitted for version 2.01 in current + versions (2.04, 2.05). + * Close #2301, safe creation of temp files is documented in bash(1): + "If the redirection operator is >, and the noclobber option to the set + builtin has been enabled, the redirection will fail if the file whose + name results from the expansion of word exists and is a regular file. + If the redirection operator is >|, or the redirection operator is > and + the noclobber option to the set builtin command is not enabled, the + redirection is attempted even if the file named by word exists." + * Fixed upstream in 2.05: #84743. + * #76596: Bourne-style shells have always accepted multiple directory name + arguments to cd. If the user doesn't like it, have him define a shell + function (see README.Debian). + * bash already has enabled the system wide /etc/bash.bashrc (#82117). + * #88223: Starting bash with --posix, or -o posix, or as `sh', does make + the entire bash session posix-compliant (with the caveats noted in the + info manual). Posix-compliant does not mean `behaves exactly like + historical versions of sh', nor does it mean `does only what is in + the standard and nothing more'. + + Posix says nothing about brace expansion, so whether or not bash does + brace expansion in posix mode has no bearing on posix compliance. + + If you don't want brace expansion, use `set +o braceexpand' or + `set +B' or start bash with the `+B' option. + + * Lower temporarily severity of #92455, so that this version can move + to testing. This bug exists in 2.04 as well, so we don't make things + worse. + * Apply upstream patch 1. + + -- Matthias Klose Mon, 9 Apr 2001 23:29:24 +0200 + +bash (2.05-1) unstable; urgency=low + + * New upstream release. + * /etc/skel/.bashrc: fix alias (#92440). + + -- Matthias Klose Mon, 9 Apr 2001 18:24:10 +0200 + +bash (2.05-0beta2) unstable; urgency=low + + * New upstream release 2.05-beta2. + * Fixed upstream: #85234. + + -- Matthias Klose Thu, 29 Mar 2001 23:57:12 +0200 + +bash (2.05-0beta1) unstable; urgency=low + + * New upstream release 2.05-beta1. + * Fixed upstream: #66891, #67519, #68931, #72898, #75104, #75315, #75957, + #76603, #84906. + Reverted behaviour: #60375, #75540. + * /etc/skel/.bash_logout: Removed. Submitted bug report to util-linux. + Fixes #63025, #72327, #83609. + * Depend on makeinfo (fixes #87688). + + -- Matthias Klose Tue, 6 Feb 2001 18:46:40 +0100 + +bash (2.05-0alpha) unstable; urgency=low + + * New upstream release. + + -- Matthias Klose Sun, 26 Nov 2000 17:32:16 +0100 + +bash (2.04-9) unstable; urgency=low + + * Fix build bug. + + -- Matthias Klose Mon, 20 Nov 2000 23:35:03 +0100 + +bash (2.04-8) unstable; urgency=low + + * debian/control: Add bison to Build-Depends (fixes #73667). + * debian/rules: Add config.h to bash-builtins package (fixes #69802). + Strip bash binary (fixes #71252). + + -- Matthias Klose Sat, 18 Nov 2000 14:01:54 +0100 + +bash (2.04-7) unstable; urgency=low + + * debian/skel.bash_logout: Fix to clear all ttys (fixes #67772). + * debian/skel.bash_profile: Fix to include expanded ~/bin in path + (fixes #67714). + * Fix builtins.1 include (fixes #67094, #70007, #71848). + * debian/README.Debian: Document that bash is compiled with + -DSYS_BASHRC (fixes #66939). + * Fix hsuser doc (fixes #69392). + + -- Matthias Klose Mon, 2 Oct 2000 01:26:45 +0200 + +bash (2.04-6) unstable; urgency=low + + * debian/skel.bash_profile: Clarify where to look for for example files + (package bash-doc). Fixes #64311. + * debian/README.Debian: Explain, why bash is configured without + '--enable-net-redirections' (fixes #66352). + + -- Matthias Klose Wed, 28 Jun 2000 19:47:25 +0200 + +bash (2.04-5) unstable; urgency=low + + * debian/patches/alpha-unwind.dpatch: Patch from "Mikolaj J. Habryn" + . Should fix #62170, #62690, #65053. + * debian/rules: Configure with --disable-net-redirections (as suggested + in #65172). The patch submitted in the report can be found in + debian/patches/tcp-udp-service-names.dpatch. + * debian/patches/getcwd-error: Fix error message for two levels of + unreadable directories (#64659). + + -- Matthias Klose Mon, 5 Jun 2000 05:59:59 +0200 + +bash (2.04-4) unstable; urgency=low + + * debian/patches/p[5-7].dpatch: Upstream patches. + + -- Matthias Klose Wed, 3 May 2000 01:05:23 +0200 + +bash (2.04-3) unstable; urgency=low + + * debian/patches/p[1-4].dpatch: Upstream patches. + * debian/bash.preinst.c: s/MAX_PATH/PATH_MAX/g (fixes #62323). + + -- Matthias Klose Wed, 26 Apr 2000 19:53:16 +0200 + +bash (2.04-2) unstable; urgency=low + + * debian/patches/pattern-operator.dpatch: Fix pattern operator bug. + * debian/README.Debian: Add FAQ how to get rid off beeps for ambiguous + completions (fixes #59550). + + -- Matthias Klose Sat, 8 Apr 2000 22:06:34 +0200 + +bash (2.04-1) unstable; urgency=low + + * Final release. + * Don't strip bash (debugging #58404 ...). + + -- Matthias Klose Mon, 20 Mar 2000 19:37:44 +0100 + +bash (2.04-0beta5db1) unstable; urgency=low + + * New upstream version, beta 5, Debian build 1. + * Remove six dpatch files with patches now integrated upstream. + * Bugs fixed with this upstream version: #5703, #15165, #21363, #21901, + #33900, #36652, #38804, #41916, #47179, #47990, #50353, #56209, #57544. + * Compiled with NON_INTERACTIVE_LOGIN_SHELLS to run the startup files when + not in posix mode. Fixes #11938, #14287, #25245. + * Still in this version: #27090. + * The `-l' option to test is not included by intent (fixes #13645). + Comment from upstream: "The `-l' option should never have been documented, + and it was a mistake to include it in the first place -- it screws up the + grammar. Old Bourne shells and test commands had it because there was no + other way to find the length of a variable's value. Since bash has + ${#variable}, there's no need for it. POSIX.2 says, in the rationale, + that implementation is irregular and that the shell supports it directly. + * Report #26720: perl -e 'print ":;" x 100000' > foo; . ./foo dumps core. + Comment from upstream: This is not a bash bug; it is a process resource + problem. The default resource limit for stack size is 8M on my version of + Linux. The call tree created by the parser for the script (100000 calls + to `:') is 99999 nodes deep, and requires that many recursive calls to the + command execution routines. This overflows the stack, and bash segfaults. + I couldn't reproduce it anywhere but Linux, because the machines I tested + on all have reasonable default stack sizes. Raising the limit to 16M is + sufficient to cause the script to run successfully (I didn't try anything + between 8M and 16M). + * Report #30460: redirection is different from standard: bash --posix + $ mkdir foo; cd foo; echo anything goes > "this file" + $ for f in *; do tr ay \ o < $f | cat; done + sh: $f: ambiguous redirect + This is POSIX.2 behaviour. + * debian/bash.preinst.c: Check if /bin/sh points to something other than + bash and is not diverted and point to README.Debian how to divert + a file (fixes #34717, #45656). + * debian/patches/random.dpatch: Fix bug in patch (closes #38804). + * debian/README.Debian: Commented behaviour from report #50853. + + -- Matthias Klose Thu, 24 Feb 2000 19:34:10 +0100 + +bash (2.03-6) frozen unstable; urgency=medium + + * debian/bash.preinst.c: Evil kludge, deal with arbitrary name lengths + (fixes #54876). + * Apply NMU (fixes #55887). + * debian/rules: Install debian/bash.conffiles (fixes #57963, #58541). + + -- Matthias Klose Sun, 20 Feb 2000 19:50:48 +0100 + +bash (2.03-5.1) unstable; urgency=low + + * debian/patches/job-control-segfault.dpatch: Patch from Eric Weigel + . Closes: #55887 + + -- Adam Heath Sat, 22 Jan 2000 15:10:50 -0600 + +bash (2.03-5) unstable; urgency=low + + * Update rl.ctrl-char patch from Dan Jacobowitz. + Fixes #54805, #54639, #54612. + * Add autoconf to Build-Depends (finally, Roman ...) + + -- Matthias Klose Tue, 11 Jan 2000 20:50:31 +0100 + +bash (2.03-4) unstable; urgency=low + + * debian/control: Fix build dependencies (fixes #52777). + * debian/rules: Cleanup. + * debian/patches/rl-ctrl-char.dpatch: Don't assume char is signed by + default (fixes #53252). + * Build with libncurses5-dev (fixes #54165). + * Fix changelog symlink in bash-doc package (fixes #54240). + * debian/README.Debian: Add paragraph for writing prompts. + * debian/README.Debian: Add paragraph about hashing of moved commands + (and closing #36877). + * Install more verbose skeleton files (closes #39728). + * The `-l' option to test is not included by intent (fixes #13645). + Comment from upstream: "The `-l' option should never have been documented, + and it was a mistake to include it in the first place -- it screws up the + grammar. Old Bourne shells and test commands had it because there was no + other way to find the length of a variable's value. Since bash has + ${#variable}, there's no need for it. POSIX.2 says, in the rationale, + that implementation is irregular and that the shell supports it directly. + * Report #26720: perl -e 'print ":;" x 100000' > foo; . ./foo dumps core. + Comment from upstream: This is not a bash bug; it is a process resource + problem. The default resource limit for stack size is 8M on my version of + Linux. The call tree created by the parser for the script (100000 calls + to `:') is 99999 nodes deep, and requires that many recursive calls to the + command execution routines. This overflows the stack, and bash segfaults. + I couldn't reproduce it anywhere but Linux, because the machines I tested + on all have reasonable default stack sizes. Raising the limit to 16M is + sufficient to cause the script to run successfully (I didn't try anything + between 8M and 16M). + * Report #30460: redirection is different from standard: bash --posix + $ mkdir foo; cd foo; echo anything goes > "this file" + $ for f in *; do tr ay \ o < $f | cat; done + sh: $f: ambiguous redirect + This is POSIX.2 behaviour. + * debian/bash.preinst.c: Check if /bin/sh points to something other than + bash and is not diverted and point to README.Debian how to divert + a file (fixes #34717, #45656). + + -- Matthias Klose Fri, 7 Jan 2000 07:19:00 +0100 + +bash (2.03-3) unstable; urgency=low + + * Moved /etc/profile to base-files package (closes #52987). + * debian/skel.bash_profile: Use umask 022 as in debian/etc.profile + (closes #53020). + * debian/patches/secure-build.dpatch: Build bash without using guessable + file names in /tmp (closes #36027). + * debian/patches/bashbug-editor.dpatch: Use editor command, not emacs + (closes #32576, #32577). + * Fixed in 2.03 or before: #16013, #20455, #30803 (according to upstream + author, bug submitter does not respond). + * #44015 not a bug. Bash is more liberal than POSIX specifies, but function + names that are not identifiers is something that may go away in the future. + * #40242 not a bug: Non-interactive bash shells have always unset PS1, + so scripts and so on can test for it. + * Report #21645: */text* completion doesn't work anymore. According to the + upstream author, this feature was removed in bash-2.01.1. The TAB + completion only succeeds with globbing characters if there is a single + completion. It caused too many problems otherwise. + * Define DONT_REPORT_SIGPIPE: We don't want to see `Broken pipe' messages + when a job like `cat jobs.c | exit 1' is executed. Fixes part of #7047, + #10259, #10433 and #10494. Comment from the upstream author: "The default + bash behavior with respect to the exit status of a pipeline will not + change. Changing it as suggested in the discussion of #10494 would render + bash incompatible with every other shell out there.". Closed these reports. + * debian/etc.bash.bashrc: Set checkwinsize. + + -- Matthias Klose Sun, 19 Dec 1999 15:58:43 +0100 + +bash (2.03-2) unstable; urgency=low + + * Apply privmode patch (do not drop privileges, if called as /sh. + Closes #52586). + + -- Matthias Klose Mon, 13 Dec 1999 22:25:22 +0100 + +bash (2.03-1) unstable; urgency=low + + * New maintainer. + * New upstream version (closes: #34077, #35642, #46916). For a terse + description of new features and bug fixes see /usr/share/doc/bash/NEWS.gz. + * Fixed in upstream release (closes: #14229, #16856, #21363, #22498, #28849, + #29863, #37971, #38411, #40930, #49702). #37971 either here or in libc6. + #30803. + * Separate out documentation and examples to bash-doc package. + * Do not build shared readline libs from this source. According to the + upstream author: "It's not appropriate to build shared libraries from + the readline shipped with bash. That is designed to be linked directly + into bash." + * Link statically with included libreadline. It's intended, because + potato does not have a libreadline4 yet. Wait for bash-2.04 and + it's version of libreadline. + * debian/README.Debian: Sort of FAQ suggested by Guy Maor. + * debian/copyright: Updated URL. + * debian/rules: Introduced some variables for packages and directories. + * debian/control: Updated package names. Add Build-Depends. + * Point to /usr/doc/share in man pages (rbash.1, builtins.1). + * Make /usr/doc compatibility links (all but libreadline.postinst, which + is a C file). + * debian/patches/conf-update.dpatch: New config files from automake + (closes #33745). + * debian/patches/bashbug-editor.dpatch: Use EDITOR variable + (closes #32576, #32577). + * debian/etc.profile: Fixed comment that /etc/profile is used for Bourne + shell and Bourne compatible shells (closes: #3459). + * debian/patches/tempnam.dpatch: Applied patch from report #35975 + (closes: #35975). + * bash is not responsible for setting $USER in login shells (closes: #36103). + * Compile with -DSYS_BASHRC defined. /etc/bash.bashrc is empty by default + (closes #27055). + * Fixed with boot-floppies 2.1.3 (closes: #22517). + * debian/patches/mailcheck.dpatch: Add maildir support. Patch from + Miquel van Smoorenburg (closes #38794). + * Patches from NMU are applied (should close #43096). + * debian/control: Make builtins depend on source version of bash. + * Build for i386, not i486. + * Report #28811: "dpkg segfaults trying to install bash. Logging in then + produces segfault. Still having to run 2.00.0(1)". Not reproducable. + * Report #15165: "If the last command in the pipeline is killed by a signal, + bash does not report it even though $? contains the correct value". + Not reproducable. + * Report #21645: "If you type `rm */text*', previous versions would + complete text given that they're under the same directory. 2.01.1-1 + doesn't do that anymore.". Not documented anywhere. It seems, this was + a bug disguised as a feature ;-) + * Report #36027: "During compiling bash package, files with hardcoded names + are created in /tmp. In a malicious multi-user environment, this allows + attacks to the user's files and possibly allow creating trojan packages. + If the compiling user is root...". + Submitter cannot be reached. autoconf/automake issues? Reassign to general? + * Report #16700: "bash terminated when I asked it "mailq -v", while in an + xterm, with a sysload of approx 1"; not reproducable. Submitter offers + core file. + * Report #37637: Not reproduceable (should close #37637). + * Report #37275: A dpkg error? Or just another reason to completely link + bash statically? + * Report #34978, #42858: The prerm now is a binary pragram. + #34977 as well? #36016 (patch)? + * Report #43737: Non bug. Behaviour changed from 1.4 to 2.0 (closes: #43737). + * Report #36459: Non bug (closes #36459). + * Report #19211: Wanted behaviour? + * Report #11938: The included patch is applied upstream (closes: #11938). + * Report #10699, #45656: Todo: See #34717 ... + * Report #35127: Apply included patch. TODO: test and forward upstream. + * Report #41082: Obsoleted patches (closes: #35130, #41802). + * Reports tested and still in this version (should be forwarded ...): + #2301, #21901, #26619, #26720, #27090, #30460, #33900, #34833, + #36877 + #38804, #41916 (update docs?), + #46901, #47990. + * Report #47849: You *must* reset OPTIND to 1 before reusing getopts. + * Report #45841: This is a POSIX.2/XPG5 requirement. + * Report #35979, #45379: set -e works on simple commands only. + (command) is not a simple command. + * Report #38244: -x and -v and all of the rest of the options are documented + in the `set' builtin section. The OPTIONS section of the man page refers + to `set'. + * Report #37654: When in a pipeline, `tty' prints `not a tty'. This is why + grep is looking for `not' in file `a'. Try `w | echo $(tty)'. + * Report #33822: This is a locale problem. The de_DE locale gives lower case + and upper case letters the same collating weight. POSIX.2 warns that + range expressions are not portable across locales. + * Report #28789, #22291: resizing xterm bash doesn' t update window limits. + Use `shopt -s checkwinsize'. (closes: #28789, #22291). + * Report #39728: Suggestion to add something to /etc/skel files. A matter + of taste. Added comments where to find `fancy' startup files. + + * Work needed: #33822 (huh?), #42916 and #44015 (update docs, dashs in + identifiers). + + * Not tested: (#7047, #10259, #10433, #10494), #14287 (how to test?), + #14658 (how to test?), #16013, #16797, #20455 (alpha arch), #20821, + #22632, #26571, #29610, #35994 (powerpc arch), + #36652, #40242, #47179. + + -- Matthias Klose Sat, 4 Dec 1999 17:03:47 +0100 + +bash (2.02.1-1.8) unstable; urgency=low + + * Applied Anthonies patch and recompiled as the libc5 version did + not compile for him (closes: #34717, #43050, #43096, #10699). + * Bumped the version number of libreadline and recompiled, + hopefully in time before the dinstall run ;) + + -- Torsten Landschoff Sat, 18 Sep 1999 19:26:20 +0200 + +bash (2.02.1-1.7) unstable; urgency=low + + * Non-maintainer release. + * Make bash not Pre-Depend on itself. That is, make bash's preinst + something other than a /bin/sh script; in this case a reasonably + simple binary. + * Remove /bin/sh from the .deb, and reinstate it in the postinst if + it's not already present. Hence make the postinst a /bin/bash script + instead of a /bin/sh script. + + -- Anthony Towns Sat, 28 Aug 1999 01:09:08 +1000 + +bash (2.02.1-1.6) unstable; urgency=low + + * Non-maintainer release. + * Link bash statically with libreadline. Closes: #42858. + + -- Thomas Quinot Fri, 13 Aug 1999 21:47:35 +0200 + +bash (2.02.1-1.5) unstable; urgency=low + + * Non-maintainer release. + * Updated to standards version 3.0.0. + * Fixed dependency on libreadlineg2. Closes: #35130, #39280, #41802. + + -- Thomas Quinot Thu, 29 Jul 1999 13:05:26 +0200 + +bash (2.02.1-1.4) unstable; urgency=low + + * Non-maintainer release. + * Make libreadlineg2 conflict with bash (<< 2.02.1-1.2) + + -- Joel Klecker Thu, 25 Mar 1999 09:40:39 -0800 + +bash (2.02.1-1.3) unstable; urgency=low + + * Non-maintainer release. + * Recompile against ncurses 4.2-3.2 for versioned dependency. + * Add (>= 2.1-13.1) depend to readline shlibs. + + -- Joel Klecker Thu, 18 Mar 1999 12:33:28 -0800 + +bash (2.02.1-1.2) unstable; urgency=low + + * Non-maintainer release. + * Recompile against glibc 2.1 for libreadline. + + -- Joel Klecker Fri, 5 Mar 1999 09:36:54 -0800 + +bash (2.02.1-1.1) unstable; urgency=low + + * Non-maintainer upload. + * Replaced config.{sub,guess} with newer ones for ARM. + + -- Jim Pick Mon, 22 Feb 1999 23:57:53 -0800 + +bash (2.02.1-1) unstable; urgency=low + + * libreadline 2.1-13 + * Upstream upgrade, closes: #26582 + * Bugs fixed upstream: closes: #21511, #24004. + * Rules, control fixes for hurd, powerpc, alpha closes: #29123, #29395, + #24931, #31289. + * Included paren-matching feature in readline, closes: #27707. + * Removed convert-meta comment from etc/inputrc, closes: #23035. + * Use system random instead of lousy builtin one, closes: #22104. + + -- Guy Maor Mon, 15 Feb 1999 12:57:53 -0800 + +bash (2.01.1-4.1) unstable; urgency=low + + * Non-maintainer upload. + * libreadline 2.1-12 + * Rebuild with ncurses4.0 to avoid packages linked with libreadline + depending on two versions of ncurses; reported by Martin Mitchell + . [#27762] + * debian/rl.shlibs: bump versioned dependency to >= 2.1-12. + * debian/rules (build): add --with-curses to avoid ever linking with + termcap; reported by, ehm, Guy Maor . [#25118] + + -- James Troup Tue, 20 Oct 1998 03:24:03 +0100 + +bash (2.01.1-3.1) frozen unstable; urgency=low + + * Non-maintainer release. + * Build with ncurses3.0-altdev, so libreadline2 doesn't depend on libc6. + * Use -linux instead of -debian-linux. + + -- Joel Klecker Tue, 14 July 1998 16:26:43 -0700 + +bash (2.01.1-3) unstable frozen; urgency=medium + + * libreadline 2.1-10 + * Make libreadlineg2's postinst a c program, like libreadline2. + * Check return code from tempfile in bashbug, closes: #22349. + * glibc 2.1 patch, closes #22532. + * remove . from /etc/profile PATH, closes #22738. + + -- Guy Maor Mon, 25 May 1998 22:41:06 -0700 + +bash (2.01.1-2) unstable frozen; urgency=high + + * libreadline 2.1-9. + * Predepend on libreadlineg2 >= 2.1-8, closes: #20572. + + -- Guy Maor Wed, 8 Apr 1998 01:07:10 -0700 + +bash (2.01.1-1) frozen unstable; urgency=low + + * libreadline 2.1-8. + * Upstream upgrade, closes: #13762, #14446, #18296. + * Fixed /etc/inputrc, closes: #19745, #19075, #13643, #18004, #17256, + #15345, #14672, #15213, #15345, #15638, #18004, #16797, #15638, #19241. + * Applied patch to read End, Delete, closes: #20053. + * Don't build libc5 packages on alpha & powerpc, closes: #13761, #15538, + #15829. + * Add sh(1) - symlink to bash(1), close: #15659. + * Fix unsafe requests in rbash(1), builtins(1), closes: #19086. + * bashbug uses tempfile, closes: #19781. + * fixed fc -l segfault, closes: #13726. + + -- Guy Maor Sat, 28 Mar 1998 19:34:15 -0800 + +bash (2.01-5) unstable; urgency=low + + * libreadline 2.1-7 + * libreadline tries INPUTRC if it's set, else _both_ /etc/inputrc and + ~/.inputrc + * A better /etc/inputrc. + + -- Guy Maor Thu, 25 Sep 1997 11:38:41 -0500 + +bash (2.01-4) unstable; urgency=low + + * libreadline 2.1-6 + * bash-builtin examples moved to correct place. + * libreadline tries /etc/inputrc if ~/.inputrc doesn't exist. + * set -a; set +a problem seems to be fixed (8390) + + -- Guy Maor Wed, 24 Sep 1997 14:36:02 -0500 + +bash (2.01-3) unstable; urgency=low + + * libreadline 2.1-5 + * Bash depended on wrong version of libreadlineg2. (#12150, #12316) + * Put current version in libreadlineg2 shlibs file. + * Honor TMPDIR by using tempnam(3) (#9201). + + -- Guy Maor Sun, 24 Aug 1997 23:31:19 -0500 + +bash (2.01-2) unstable; urgency=low + + * libreadline 2.1-4 + * Make bash predepend on libreadlineg2 (>=2.01-1) so as not to break + systems which installed James's releases. + * Fix references to shell runtime code in libreadline.so and libhistory.so. + * Fix declare -p dumping core on empty temp variable (#12017). + * make_quoted_replacement() checks for empty rl_filename_quote_characters + (12051). + * readline/readline.h - rl_dispatching should be extern (#11049). + * Added libreadline2g-dbg. + + -- Guy Maor Sat, 16 Aug 1997 13:38:37 -0500 + +bash (2.01-1) unstable; urgency=low + + * libreadline 2.1-3 + * Maintainer release of 2.01. (2.01 fixes 3815, 4783, 7782, 8439, 10416, + 10598, 10604, 11806). + * Cleaned and corrected rules, Makefiles, control files. (7580, 11406). + * Reimplemented SHELL compile time as runtime check. Backward compatible + with old bash (10916). + * Added rbash man page (8645). + * ldconfig run in postinst, compiled as libc5 (10176) + * :( set -a;set +a problem still there, but acts differently. + + -- Guy Maor Thu, 14 Aug 1997 15:35:23 -0500 + +bash (2.01-0.1) unstable; urgency=high + + * libreadline 2.1-2.2 + * libreadline2 now has a preinst script which ensures that ld.so.1 + knows about /lib/libc5-compat and /usr/lib/libc5-compat. Before this + change, trying to install with a libc (< 5.4.23-4) broke bash. + * libreadlineg2 no longer has version dependant shlibs file [#10742]. + + -- James Troup Mon, 23 Jun 1997 22:00:18 +0100 + +bash (2.01-0) unstable; urgency=medium + + * libreadline 2.1-2.1 + * Non-maintainer release + * New upstream version [#10416, #10598, #10604, #8390] + * Rebuilt for glibc; now provides libreadline2g{,-dev} and + libreadline2{,-altdev}. + * Not all of Guy's changes are implemented, noticeably a security + improvement in execute-cmds.c and his alteration of libreadline's + compile time dependance on -DSHELL to run time dependance. + + -- James Troup Thur, 19 June 1997 19:13:34 +0100 + +bash (2.0-3) unstable; urgency=medium + + * libreadline 2.1-2 + * #include in general.h needed for alpha build (#7658) + * Don't drop suid/sgid bits if invoked as sh (#7796) + * Applied patch to fix time in for loop (#7436) + * Split off bash-builtins with examples & necessary headers + * Juggled libreadline2 documentation around (#7275) + + -- Guy Maor Mon, 10 Mar 1997 12:45:06 -0600 + +bash (2.0-2) unstable; urgency=low + + * Added NEWS, COMPAT to /usr/doc/bash + + -- Guy Maor Fri, 7 Feb 1997 17:35:21 -0600 + +bash (2.0-1) unstable; urgency=low + + * Upstream upgrade. + * .bash_history created 600 by default. + * Security improvements when creating files in /tmp + * Reimplemented SHELL run-time check with backward 2.0 compatibility + + -- Guy Maor Wed, 29 Jan 1997 03:31:47 -0600 + +bash (1.14.7-2) frozen unstable; urgency=low + + * libhistory.so had wrong soname (fixes bug 5381). + + -- Guy Maor Sat, 16 Nov 1996 11:07:08 -0600 + +bash (1.14.7-1) frozen unstable; urgency=low + + * New upstream version converted to new source format. + libreadline2, libreadline2-dev produced from bash source. + * Made libreadline SHELL define into a runtime check with rl_shell, + history_shell flags, 4 hooks. + * echo checks write errors (fixes 818). + * default unreadable .bash_history in /etc/skel (fixes 1549). + + -- Guy Maor Sat, 9 Nov 1996 05:07:31 -0600 diff --git a/debian/clear_console.1 b/debian/clear_console.1 new file mode 100644 index 0000000..dc189a6 --- /dev/null +++ b/debian/clear_console.1 @@ -0,0 +1,50 @@ +.\"*************************************************************************** +.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. * +.\" * +.\" Permission is hereby granted, free of charge, to any person obtaining a * +.\" copy of this software and associated documentation files (the * +.\" "Software"), to deal in the Software without restriction, including * +.\" without limitation the rights to use, copy, modify, merge, publish, * +.\" distribute, distribute with modifications, sublicense, and/or sell * +.\" copies of the Software, and to permit persons to whom the Software is * +.\" furnished to do so, subject to the following conditions: * +.\" * +.\" The above copyright notice and this permission notice shall be included * +.\" in all copies or substantial portions of the Software. * +.\" * +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +.\" * +.\" Except as contained in this notice, the name(s) of the above copyright * +.\" holders shall not be used in advertising or otherwise to promote the * +.\" sale, use or other dealings in this Software without prior written * +.\" authorization. * +.\"*************************************************************************** +.\" +.\" $Id: clear.1,v 1.3 2000/07/15 23:59:35 china Exp $ +.TH clear_console 1 "" +.ds n 5 +.SH NAME +\fBclear_console\fR - clear the console +.SH SYNOPSIS +\fBclear_console\fR +.br +.SH DESCRIPTION +\fBclear_console\fR clears your console if this is possible. It looks in the +environment for the terminal type and then in the \fBterminfo\fR database to +figure out how to clear the screen. To clear the buffer, it then changes the +foreground virtual terminal to another terminal and then back to the original +terminal. +.SH SEE ALSO +\fBclear\fR(1), \fBchvt\fR(1) +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: diff --git a/debian/clear_console.c b/debian/clear_console.c new file mode 100644 index 0000000..c6b3969 --- /dev/null +++ b/debian/clear_console.c @@ -0,0 +1,285 @@ +/* +Copyright (C) 2006-2008 Canonical Ltd. + +clear_console and it's man page are free software; you can redistribute it +and/or modify it under the terms of the GNU General Public License as +published by the Free Software Foundation; either version 2, or (at your +option) any later version. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(__linux) +#include +#include +#elif defined(__FreeBSD_kernel__) +#include +#include +#endif + +#include +#include + +#define VERSION "0.1" + +char* progname; +int quiet = 0; + +void usage() +{ + fprintf(stderr, "Usage: %s [option]\n", progname); + fprintf(stderr, "valid options are:\n"); + fprintf(stderr, "\t-q --quiet don't print error messages\n"); + fprintf(stderr, "\t-h --help display this help text and exit\n"); + fprintf(stderr, "\t-V --version display version information and exit\n"); +} + +const struct option opts[] = +{ + /* operations */ + {"help", no_argument, 0, 'h'}, + {"version", no_argument, 0, 'V'}, + {"quiet", no_argument, 0, 'q'}, + {0, 0, 0, 0} +}; + +static int putch(int c) +{ + return putchar(c); +} + + +/* taken from console-utils, lib/misc-console-utils.c */ + +int is_a_console(int fd) +{ +#if defined(__linux__) + char arg; +#elif defined(__FreeBSD_kernel__) + int arg; +#endif + + arg = 0; + return (ioctl(fd, KDGKBTYPE, &arg) == 0 + && ((arg == KB_OTHER) || (arg == KB_101) || (arg == KB_84))); +} + +static int open_a_console(char *fnam) +{ + int fd; + + /* try read-only */ + fd = open(fnam, O_RDWR); + + /* if failed, try read-only */ + if (fd < 0 && errno == EACCES) + fd = open(fnam, O_RDONLY); + + /* if failed, try write-only */ + if (fd < 0 && errno == EACCES) + fd = open(fnam, O_WRONLY); + + /* if failed, fail */ + if (fd < 0) + return -1; + + /* if not a console, fail */ + if (! is_a_console(fd)) + { + close(fd); + return -1; + } + + /* success */ + return fd; +} + +/* + * Get an fd for use with kbd/console ioctls. + * We try several things because opening /dev/console will fail + * if someone else used X (which does a chown on /dev/console). + * + * if tty_name is non-NULL, try this one instead. + */ + +int get_console_fd(char* tty_name) +{ + int fd; + + if (tty_name) + { + if (-1 == (fd = open_a_console(tty_name))) + return -1; + else + return fd; + } + + fd = open_a_console("/dev/tty"); + if (fd >= 0) + return fd; + + fd = open_a_console("/dev/tty0"); + if (fd >= 0) + return fd; + + fd = open_a_console("/dev/console"); + if (fd >= 0) + return fd; + + for (fd = 0; fd < 3; fd++) + if (is_a_console(fd)) + return fd; + +#if 0 + fprintf(stderr, + _("Couldnt get a file descriptor referring to the console\n")); +#endif + return -1; /* total failure */ +} + + +int is_pseudo_tty(int fd) +{ + char *tty = ttyname(fd); + + if (!tty) + { + if (!quiet) + perror("ttyname"); + return 0; + } + + if (strlen(tty) >= 9 && !strncmp(tty, "/dev/pts/", 9)) + return 1; + + if (strlen(tty) >= 8 && !strncmp(tty, "/dev/tty", 8) + && tty[8] >= 'a' && tty[8] <= 'z') + return 1; + + return 0; +} + +int clear_console(int fd) +{ + int num, tmp_num; +#if defined(__linux__) + struct vt_stat vtstat; +#endif + + /* clear screen */ + setupterm((char *) 0, 1, (int *) 0); + if (tputs(clear_screen, lines > 0 ? lines : 1, putch) == ERR) + { + exit(1); + } + + if (is_pseudo_tty(STDIN_FILENO)) + return 0; + + if (!strcmp(getenv("TERM"), "screen")) + return 0; + + /* get current vt */ +#if defined(__linux__) + if (ioctl(fd, VT_GETSTATE, &vtstat) < 0) +#elif defined(__FreeBSD_kernel__) + if (ioctl(fd, VT_ACTIVATE, &num) < 0) +#endif + { + if (!quiet) + fprintf(stderr, "%s: cannot get VTstate\n", progname); + exit(1); + } +#if defined(__linux__) + num = vtstat.v_active; +#endif + tmp_num = (num == 1 ? 2 : 1); + + /* switch vt to clear the scrollback buffer */ + if (ioctl(fd, VT_ACTIVATE, tmp_num)) + { + if (!quiet) + perror("chvt: VT_ACTIVATE"); + exit(1); + } + + if (ioctl(fd, VT_WAITACTIVE, tmp_num)) + { + if (!quiet) + perror("VT_WAITACTIVE"); + exit(1); + } + + /* switch back */ + if (ioctl(fd, VT_ACTIVATE, num)) + { + if (!quiet) + perror("chvt: VT_ACTIVATE"); + exit(1); + } + + if (ioctl(fd, VT_WAITACTIVE, num)) + { + if (!quiet) + perror("VT_WAITACTIVE"); + exit(1); + } + return 0; +} + +int main (int argc, char* argv[]) +{ + int fd; + int result; /* option handling */ + int an_option; + + if ((progname = strrchr(argv[0], '/')) == NULL) + progname = argv[0]; + else + progname++; + + while (1) + { + result = getopt_long(argc, argv, "Vhq", opts, &an_option); + + if (result == EOF) + break; + + switch (result) + { + case 'V': + fprintf(stdout, "%s: Version %s\n", progname, VERSION); + exit (0); + case 'h': + usage(); + exit (0); + + case 'q': + quiet = 1; + } + } + + if (optind < argc) + { + if (!quiet) + fprintf(stderr, "%s: no non-option arguments are valid", progname); + exit(1); + } + + if ((fd = get_console_fd(NULL)) == -1) + { + if (!quiet) + fprintf(stderr, "%s: terminal is not a console\n", progname); + exit(1); + } + + clear_console(fd); + + return 0; +} diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..c9a08ea --- /dev/null +++ b/debian/control @@ -0,0 +1,72 @@ +Source: bash +Section: base +Priority: required +Maintainer: Matthias Klose +Standards-Version: 3.9.5 +Build-Depends: autoconf, autotools-dev, bison, libncurses5-dev, + texinfo, texi2html, debhelper (>= 5), locales, gettext, sharutils, time, + xz-utils, dpkg-dev (>= 1.16.1) +Build-Depends-Indep: texlive-latex-base, ghostscript, texlive-fonts-recommended +Homepage: http://tiswww.case.edu/php/chet/bash/bashtop.html +Vcs-Browser: https://code.launchpad.net/~doko/+junk/pkg-bash-debian +Vcs-Bzr: http://bazaar.launchpad.net/~doko/+junk/pkg-bash-debian + +Package: bash +Architecture: any +Multi-Arch: foreign +Pre-Depends: dash (>= 0.5.5.1-2.2), ${shlibs:Pre-Depends}, ${misc:Depends} +Depends: base-files (>= 2.1.12), debianutils (>= 2.15) +Recommends: bash-completion (>= 20060301-0) +Conflicts: bash-completion (<< 20060301-0) +Replaces: bash-doc (<= 2.05-1), bash-completion (<< 20060301-0) +Suggests: bash-doc +Essential: yes +Section: shells +Priority: required +Description: GNU Bourne Again SHell + Bash is an sh-compatible command language interpreter that executes + commands read from the standard input or from a file. Bash also + incorporates useful features from the Korn and C shells (ksh and csh). + . + Bash is ultimately intended to be a conformant implementation of the + IEEE POSIX Shell and Tools specification (IEEE Working Group 1003.2). + . + The Programmable Completion Code, by Ian Macdonald, is now found in + the bash-completion package. + +Package: bash-static +Architecture: any +Multi-Arch: foreign +Depends: passwd (>= 1:4.0.3-10), ${misc:Depends} +Suggests: bash-doc +Section: shells +Priority: optional +Description: GNU Bourne Again SHell (static version) + Bash is an sh-compatible command language interpreter that executes + commands read from the standard input or from a file. Bash also + incorporates useful features from the Korn and C shells (ksh and csh). + . + Statically linked. + +Package: bash-builtins +Architecture: any +Depends: bash (= ${binary:Version}), ${misc:Depends} +Section: utils +Priority: optional +Description: Bash loadable builtins - headers & examples + Bash can dynamically load new builtin commands. Included are the + necessary headers to compile your own builtins and lots of examples. + +Package: bash-doc +Architecture: all +Depends: ${misc:Depends}, dpkg (>= 1.15.4) | install-info +Section: doc +Priority: optional +Replaces: bash (<< 4.3-2) +Description: Documentation and examples for the GNU Bourne Again SHell + Bash is an sh-compatible command language interpreter that executes + commands read from the standard input or from a file. Bash also + incorporates useful features from the Korn and C shells (ksh and csh). + . + This package contains the distributable documentation, all the + examples and the main changelog. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..b385e07 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,224 @@ +This is Debian GNU/Linux's prepackaged version of the FSF's GNU Bash, +the Bourne Again SHell. + +This package was put together by Matthias Klose , from +the following sources: + + bash: ftp.gnu.org:/pub/gnu/bash/bash-4.3.tar.gz + +Bash homepage: http://tiswww.case.edu/php/chet/bash/bashtop.html + +Copyright (C) 1987-2014 Free Software Foundation, Inc. + +Bash is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +Bash is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . +On Debian systems, the complete text of the GNU General Public License +can be found in `/usr/share/common-licenses/GPL-3'. + +The Free Software Foundation has exempted Bash from the requirement of +Paragraph 2c of the General Public License. This is to say, there is +no requirement for Bash to print a notice when it is started +interactively in the usual way. We made this exception because users +and standards expect shells not to print such messages. This +exception applies to any program that serves as a shell and that is +based primarily on Bash as opposed to other GNU software. + + +Files with other copyright statement than: Copyright FSF, License GPL +--------------------------------------------------------------------- + +doc/FAQ ("the Bash FAQ") + + This document is Copyright 1995-2005 by Chester Ramey. + + Permission is hereby granted, without written agreement and + without license or royalty fees, to use, copy, and distribute + this document for any purpose, provided that the above copyright + notice appears in all copies of this document and that the + contents of this document remain unaltered. + + +doc/bashref.texi ("Bash Reference Manual"): + + Copyright (c) 1988-2014 Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of + this manual provided the copyright notice and this permission notice + are preserved on all copies. + + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 or + any later version published by the Free Software Foundation; with no + Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + A copy of the license is included in the section entitled + ``GNU Free Documentation License''. + + +lib/readline/doc/rlman.texi (part of the GNU Readline Library manual) + + Copyright (c) 1988-2014 Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 or + any later version published by the Free Software Foundation; with no + Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + A copy of the license is included in the section entitled + ``GNU Free Documentation License''. + +lib/readline/doc/rltech.texi (part of the GNU Readline Library manual) + + Copyright (C) 1988-2014 Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of + this manual provided the copyright notice and this permission notice + pare preserved on all copies. + + Permission is granted to process this file through TeX and print the + results, provided the printed document carries copying permission + notice identical to this one except for the removal of this paragraph + (this paragraph not being relevant to the printed manual). + + Permission is granted to copy and distribute modified versions of this + manual under the conditions for verbatim copying, provided that the entire + resulting derived work is distributed under the terms of a permission + notice identical to this one. + + Permission is granted to copy and distribute translations of this manual + into another language, under the above conditions for modified versions, + except that this permission notice may be stated in a translation approved + by the Foundation. + + +lib/readline/doc/rluser.texi (part of the GNU Readline Library manual) + + Copyright (C) 1988-2014 Free Software Foundation, Inc. + + Authored by Brian Fox and Chet Ramey. + + Permission is granted to process this file through Tex and print the + results, provided the printed document carries copying permission notice + identical to this one except for the removal of this paragraph (this + paragraph not being relevant to the printed manual). + + Permission is granted to make and distribute verbatim copies of this manual + provided the copyright notice and this permission notice are preserved on + all copies. + + Permission is granted to copy and distribute modified versions of this + manual under the conditions for verbatim copying, provided also that the + GNU Copyright statement is available to the distributee, and provided that + the entire resulting derived work is distributed under the terms of a + permission notice identical to this one. + + Permission is granted to copy and distribute translations of this manual + into another language, under the above conditions for modified versions. + + +readline/doc/history.texi (GNU History Library Manual) + + Copyright (C) 1988-2014 Free Software Foundation, Inc. + Authored by Brian Fox and Chet Ramey. + + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 or + any later version published by the Free Software Foundation; with no + Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + A copy of the license is included in the section entitled + ``GNU Free Documentation License''. + +readline/doc/{hstech,hsuser}.texi (GNU History Library Manual) + + Copyright (C) 1988-2014 Free Software Foundation, Inc. + Authored by Brian Fox and Chet Ramey. + + Permission is granted to make and distribute verbatim copies of this manual + provided the copyright notice and this permission notice are preserved on + all copies. + + Permission is granted to process this file through Tex and print the + results, provided the printed document carries copying permission notice + identical to this one except for the removal of this paragraph (this + paragraph not being relevant to the printed manual). + + Permission is granted to copy and distribute modified versions of this + manual under the conditions for verbatim copying, provided also that the + GNU Copyright statement is available to the distributee, and provided that + the entire resulting derived work is distributed under the terms of a + permission notice identical to this one. + + Permission is granted to copy and distribute translations of this manual + into another language, under the above conditions for modified versions. + + +lib/sh/inet_aton.c: + + * Copyright (c) 1983, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * - + * Portions Copyright (c) 1993 by Digital Equipment Corporation. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies, and that + * the name of Digital Equipment Corporation not be used in advertising or + * publicity pertaining to distribution of the document or software without + * specific, written prior permission. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT + * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + + +support/man2html.c + + * This program was written by Richard Verhoeven (NL:5482ZX35) + * at the Eindhoven University of Technology. Email: rcb5@win.tue.nl + * + * Permission is granted to distribute, modify and use this program as long + * as this comment is not removed or changed. + * + * THIS IS A MODIFIED VERSION. IT WAS MODIFIED BY chet@po.cwru.edu FOR + * USE BY BASH. diff --git a/debian/etc.bash.bashrc b/debian/etc.bash.bashrc new file mode 100644 index 0000000..54687b1 --- /dev/null +++ b/debian/etc.bash.bashrc @@ -0,0 +1,55 @@ +# System-wide .bashrc file for interactive bash(1) shells. + +# To enable the settings / commands in this file for login shells as well, +# this file has to be sourced in /etc/profile. + +# If not running interactively, don't do anything +[ -z "$PS1" ] && return + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, overwrite the one in /etc/profile) +PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' + +# Commented out, don't overwrite xterm -T "title" -n "icontitle" by default. +# If this is an xterm set the title to user@host:dir +#case "$TERM" in +#xterm*|rxvt*) +# PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"' +# ;; +#*) +# ;; +#esac + +# enable bash completion in interactive shells +#if ! shopt -oq posix; then +# if [ -f /usr/share/bash-completion/bash_completion ]; then +# . /usr/share/bash-completion/bash_completion +# elif [ -f /etc/bash_completion ]; then +# . /etc/bash_completion +# fi +#fi + +# if the command-not-found package is installed, use it +if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then + function command_not_found_handle { + # check because c-n-f could've been removed in the meantime + if [ -x /usr/lib/command-not-found ]; then + /usr/lib/command-not-found -- "$1" + return $? + elif [ -x /usr/share/command-not-found/command-not-found ]; then + /usr/share/command-not-found/command-not-found -- "$1" + return $? + else + printf "%s: command not found\n" "$1" >&2 + return 127 + fi + } +fi diff --git a/debian/etc.inputrc b/debian/etc.inputrc new file mode 100644 index 0000000..2c993cb --- /dev/null +++ b/debian/etc.inputrc @@ -0,0 +1,17 @@ +# /etc/inputrc - global inputrc for libreadline +# See readline(3readline) and `info readline' for more information. + +# Be 8 bit clean. +set input-meta on +set output-meta on + +# To allow the use of german 8bit-characters like the german umlauts, comment +# out the two lines below. However this makes the meta key not work as a meta +# key, which is annoying to those which don't need to type in 8-bit characters. + +#set meta-flag on +#set convert-meta off + +# use a visible bell if one is available +#set bell-style none +#set bell-style visible diff --git a/debian/etc.profile b/debian/etc.profile new file mode 100644 index 0000000..b67da47 --- /dev/null +++ b/debian/etc.profile @@ -0,0 +1,27 @@ +# /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) +# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). + +PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games" + +if [ -f /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +if [ "$PS1" ]; then + if [ "$BASH" ]; then + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' + if [ -f /etc/bash.bashrc ]; then + . /etc/bash.bashrc + fi + else + if [ "`id -u`" -eq 0 ]; then + PS1='# ' + else + PS1='$ ' + fi + fi +fi + +export PATH + +umask 022 diff --git a/debian/inputrc.arrows b/debian/inputrc.arrows new file mode 100644 index 0000000..21aed08 --- /dev/null +++ b/debian/inputrc.arrows @@ -0,0 +1,30 @@ +# This file controls the behaviour of line input editing for +# programs that use the Gnu Readline library. +# +# Arrow keys in keypad mode +# +"\C-[OD" backward-char +"\C-[OC" forward-char +"\C-[OA" previous-history +"\C-[OB" next-history +# +# Arrow keys in ANSI mode +# +"\C-[[D" backward-char +"\C-[[C" forward-char +"\C-[[A" previous-history +"\C-[[B" next-history +# +# Arrow keys in 8 bit keypad mode +# +"\C-M-OD" backward-char +"\C-M-OC" forward-char +"\C-M-OA" previous-history +"\C-M-OB" next-history +# +# Arrow keys in 8 bit ANSI mode +# +"\C-M-[D" backward-char +"\C-M-[C" forward-char +"\C-M-[A" previous-history +"\C-M-[B" next-history diff --git a/debian/locale-gen b/debian/locale-gen new file mode 100644 index 0000000..091a50e --- /dev/null +++ b/debian/locale-gen @@ -0,0 +1,30 @@ +#!/bin/sh + +LOCPATH=`pwd`/locales +export LOCPATH + +[ -d $LOCPATH ] || mkdir -p $LOCPATH + +umask 022 + +echo "Generating locales..." +while read locale charset; do + case $locale in \#*) continue;; esac + [ -n "$locale" -a -n "$charset" ] || continue + echo -n " `echo $locale | sed 's/\([^.\@]*\).*/\1/'`" + echo -n ".$charset" + echo -n `echo $locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'` + echo -n '...' + if [ -f $LOCPATH/$locale ]; then + input=$locale + else + input=`echo $locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'` + fi + localedef -i $input -c -f $charset $LOCPATH/$locale #-A /etc/locale.alias + echo ' done'; \ +done <&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +# DP: Build fixes for minimal bash + +--- bash/parse.y~ 2009-11-02 23:34:15.000000000 +0100 ++++ bash/parse.y 2009-12-30 17:08:12.341085169 +0100 +@@ -2772,12 +2772,14 @@ + dstack.delimiter_depth = 0; /* No delimiters found so far. */ + open_brace_count = 0; + ++#if defined (EXTENDED_GLOB) + /* Reset to global value of extended glob */ + if (parser_state & PST_EXTPAT) + { + /*itrace("reset_parser: parser_state includes PST_EXTPAT");*/ + extended_glob = global_extglob; + } ++#endif + + parser_state = 0; + +--- bash/execute_cmd.c~ 2009-11-29 03:29:34.000000000 +0100 ++++ bash/execute_cmd.c 2009-12-30 17:13:36.041085541 +0100 +@@ -4196,7 +4196,9 @@ + if (variable_context == 0 || this_shell_function == 0) + { + make_funcname_visible (0); ++#if defined (PROCESS_SUBSTITUTION) + unlink_fifo_list (); ++#endif + } + + return (result); +--- bash/lib/glob/glob.c~ 2009-11-15 00:39:30.000000000 +0100 ++++ bash/lib/glob/glob.c 2009-12-30 17:34:56.802336552 +0100 +@@ -640,7 +640,11 @@ + continue; + } + ++#ifdef MACOS + convfn = fnx_fromfs (dp->d_name, D_NAMLEN (dp)); ++#else ++ convfn = dp->d_name; ++#endif + if (strmatch (pat, convfn, mflags) != FNM_NOMATCH) + { + if (nalloca < ALLOCA_MAX) diff --git a/debian/patches/bash-subst-param-length.diff b/debian/patches/bash-subst-param-length.diff new file mode 100644 index 0000000..1ba51b6 --- /dev/null +++ b/debian/patches/bash-subst-param-length.diff @@ -0,0 +1,13 @@ +Index: b/subst.c +=================================================================== +--- a/subst.c ++++ b/subst.c +@@ -7160,7 +7160,7 @@ + (sindex == t_index - 1 && string[sindex] == '!' && VALID_INDIR_PARAM (string[t_index]))) + { + t_index++; +- temp1 = string_extract (string, &t_index, "#%:-=?+/}", 0); ++ temp1 = string_extract (string, &t_index, "#%:-=?+/}", SX_VARNAME); + name = (char *)xrealloc (name, 3 + (strlen (temp1))); + *name = string[sindex]; + if (string[sindex] == '!') diff --git a/debian/patches/bash43-001.diff b/debian/patches/bash43-001.diff new file mode 100644 index 0000000..d4de04a --- /dev/null +++ b/debian/patches/bash43-001.diff @@ -0,0 +1,52 @@ +# DP: bash43-001 upstream patch + +Bash-Release: 4.3 +Patch-ID: bash43-001 + +Bug-Reported-by: NBaH +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-02/msg00092.html + +Bug-Description: + +A missing check for a valid option prevented `test -R' from working. There +is another problem that causes bash to look up the wrong variable name when +processing the argument to `test -R'. + +Patch (apply with `patch -p0'): + +Index: b/test.c +=================================================================== +--- a/test.c ++++ b/test.c +@@ -646,8 +646,8 @@ + return (v && invisible_p (v) == 0 && var_isset (v) ? TRUE : FALSE); + + case 'R': +- v = find_variable (arg); +- return (v && invisible_p (v) == 0 && var_isset (v) && nameref_p (v) ? TRUE : FALSE); ++ v = find_variable_noref (arg); ++ return ((v && invisible_p (v) == 0 && var_isset (v) && nameref_p (v)) ? TRUE : FALSE); + } + + /* We can't actually get here, but this shuts up gcc. */ +@@ -723,6 +723,7 @@ + case 'o': case 'p': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': case 'z': + case 'G': case 'L': case 'O': case 'S': case 'N': ++ case 'R': + return (1); + } + +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 0 ++#define PATCHLEVEL 1 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/debian/patches/bash43-002.diff b/debian/patches/bash43-002.diff new file mode 100644 index 0000000..093dd6d --- /dev/null +++ b/debian/patches/bash43-002.diff @@ -0,0 +1,52 @@ +# DP: bash43-002 upstream patch + +Bash-Release: 4.3 +Patch-ID: bash43-002 + +Bug-Reported-by: Moe Tunes +Bug-Reference-ID: <53103F49.3070100@gmail.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-02/msg00086.html + +Bug-Description: + +A change to save state while running the DEBUG trap caused pipelines to hang +on systems which need process group synchronization while building pipelines. + +Patch (apply with `patch -p0'): + +Index: b/trap.c +=================================================================== +--- a/trap.c ++++ b/trap.c +@@ -920,7 +920,8 @@ + subst_assign_varlist = 0; + + #if defined (JOB_CONTROL) +- save_pipeline (1); /* XXX only provides one save level */ ++ if (sig != DEBUG_TRAP) /* run_debug_trap does this */ ++ save_pipeline (1); /* XXX only provides one save level */ + #endif + + /* If we're in a function, make sure return longjmps come here, too. */ +@@ -940,7 +941,8 @@ + trap_exit_value = last_command_exit_value; + + #if defined (JOB_CONTROL) +- restore_pipeline (1); ++ if (sig != DEBUG_TRAP) /* run_debug_trap does this */ ++ restore_pipeline (1); + #endif + + subst_assign_varlist = save_subst_varlist; +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 1 ++#define PATCHLEVEL 2 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/debian/patches/bash43-003.diff b/debian/patches/bash43-003.diff new file mode 100644 index 0000000..8b9de8d --- /dev/null +++ b/debian/patches/bash43-003.diff @@ -0,0 +1,42 @@ +# DP: bash43-003 upstream patch + +Bash-Release: 4.3 +Patch-ID: bash43-003 + +Bug-Reported-by: Anatol Pomozov +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2014-03/msg00010.html + +Bug-Description: + +When in callback mode, some readline commands can cause readline to seg +fault by passing invalid contexts to callback functions. + +Patch (apply with `patch -p0'): + +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 2 ++#define PATCHLEVEL 3 + + #endif /* _PATCHLEVEL_H_ */ +Index: b/lib/readline/readline.c +=================================================================== +--- a/lib/readline/readline.c ++++ b/lib/readline/readline.c +@@ -744,7 +744,8 @@ + r = _rl_subseq_result (r, cxt->oldmap, cxt->okey, (cxt->flags & KSEQ_SUBSEQ)); + + RL_CHECK_SIGNALS (); +- if (r == 0) /* success! */ ++ /* We only treat values < 0 specially to simulate recursion. */ ++ if (r >= 0 || (r == -1 && (cxt->flags & KSEQ_SUBSEQ) == 0)) /* success! or failure! */ + { + _rl_keyseq_chain_dispose (); + RL_UNSETSTATE (RL_STATE_MULTIKEY); diff --git a/debian/patches/bash43-004.diff b/debian/patches/bash43-004.diff new file mode 100644 index 0000000..f971e7a --- /dev/null +++ b/debian/patches/bash43-004.diff @@ -0,0 +1,41 @@ +# DP: bash43-004 upstream patch + +Bash-Release: 4.3 +Patch-ID: bash43-004 + +Bug-Reported-by: Daan van Rossum +Bug-Reference-ID: <20140307072523.GA14250@flash.uchicago.edu> +Bug-Reference-URL: + +Bug-Description: + +The `.' command in vi mode cannot undo multi-key commands beginning with +`c', `d', and `y' (command plus motion specifier). + +Patch (apply with `patch -p0'): + +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 3 ++#define PATCHLEVEL 4 + + #endif /* _PATCHLEVEL_H_ */ +Index: b/lib/readline/readline.c +=================================================================== +--- a/lib/readline/readline.c ++++ b/lib/readline/readline.c +@@ -965,7 +965,7 @@ + #if defined (VI_MODE) + if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap && + key != ANYOTHERKEY && +- rl_key_sequence_length == 1 && /* XXX */ ++ _rl_dispatching_keymap == vi_movement_keymap && + _rl_vi_textmod_command (key)) + _rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign); + #endif diff --git a/debian/patches/bash43-005.diff b/debian/patches/bash43-005.diff new file mode 100644 index 0000000..c44060a --- /dev/null +++ b/debian/patches/bash43-005.diff @@ -0,0 +1,55 @@ +# DP: bash43-005 upstream patch + +Bash-Release: 4.3 +Patch-ID: bash43-005 + +Bug-Reported-by: David Sines +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00037.html + +Bug-Description: + +When in Posix mode, bash did not correctly interpret the ANSI-C-style +$'...' quoting mechanism when performing pattern substitution word +expansions within double quotes. + +Patch (apply with `patch -p0'): + +Index: b/parse.y +=================================================================== +--- a/parse.y ++++ b/parse.y +@@ -3398,7 +3398,7 @@ + within a double-quoted ${...} construct "an even number of + unescaped double-quotes or single-quotes, if any, shall occur." */ + /* This was changed in Austin Group Interp 221 */ +- if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'') ++ if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'') + continue; + + /* Could also check open == '`' if we want to parse grouping constructs +Index: b/y.tab.c +=================================================================== +--- a/y.tab.c ++++ b/y.tab.c +@@ -5710,7 +5710,7 @@ + within a double-quoted ${...} construct "an even number of + unescaped double-quotes or single-quotes, if any, shall occur." */ + /* This was changed in Austin Group Interp 221 */ +- if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'') ++ if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'') + continue; + + /* Could also check open == '`' if we want to parse grouping constructs +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 4 ++#define PATCHLEVEL 5 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/debian/patches/bash43-006.diff b/debian/patches/bash43-006.diff new file mode 100644 index 0000000..f52ccdc --- /dev/null +++ b/debian/patches/bash43-006.diff @@ -0,0 +1,42 @@ +# DP: bash43-006 upstream patch + +Bash-Release: 4.3 +Patch-ID: bash43-006 + +Bug-Reported-by: Eduardo A . Bustamante Lopez +Bug-Reference-ID: <20140228170013.GA16015@dualbus.me> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-02/msg00091.html + +Bug-Description: + +A shell that started with job control active but was not interactive left +the terminal in the wrong process group when exiting, causing its parent +shell to get a stop signal when it attempted to read from the terminal. + +Patch (apply with `patch -p0'): + +Index: b/jobs.c +=================================================================== +--- a/jobs.c ++++ b/jobs.c +@@ -4374,7 +4374,7 @@ + void + end_job_control () + { +- if (interactive_shell) /* XXX - should it be interactive? */ ++ if (interactive_shell || job_control) /* XXX - should it be just job_control? */ + { + terminate_stopped_jobs (); + +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 5 ++#define PATCHLEVEL 6 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/debian/patches/bash43-007.diff b/debian/patches/bash43-007.diff new file mode 100644 index 0000000..70b420b --- /dev/null +++ b/debian/patches/bash43-007.diff @@ -0,0 +1,48 @@ +# DP: bash43-007 upstream patch + +Bash-Release: 4.3 +Patch-ID: bash43-007 + +Bug-Reported-by: geir.hauge@gmail.com +Bug-Reference-ID: <20140318093650.B181C1C5B0B@gina.itea.ntnu.no> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00095.html + +Bug-Description: + +Using compound assignments for associative arrays like + +assoc=( [x]= [y]=bar ) + +left the value corresponding to the key `x' NULL. This caused subsequent +lookups to interpret it as unset. + +Patch (apply with `patch -p0'): + +Index: b/arrayfunc.c +=================================================================== +--- a/arrayfunc.c ++++ b/arrayfunc.c +@@ -597,6 +597,11 @@ + if (assoc_p (var)) + { + val = expand_assignment_string_to_string (val, 0); ++ if (val == 0) ++ { ++ val = (char *)xmalloc (1); ++ val[0] = '\0'; /* like do_assignment_internal */ ++ } + free_val = 1; + } + +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 6 ++#define PATCHLEVEL 7 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/debian/patches/bash43-008.diff b/debian/patches/bash43-008.diff new file mode 100644 index 0000000..d902c27 --- /dev/null +++ b/debian/patches/bash43-008.diff @@ -0,0 +1,153 @@ +# DP: bash43-008 upstream patch + +Bash-Release: 4.3 +Patch-ID: bash43-008 + +Bug-Reported-by: Stephane Chazelas +Bug-Reference-ID: <20140318135901.GB22158@chaz.gmail.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00098.html + +Bug-Description: + +Some extended glob patterns incorrectly matched filenames with a leading +dot, regardless of the setting of the `dotglob' option. + +Patch (apply with `patch -p0'): + +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 7 ++#define PATCHLEVEL 8 + + #endif /* _PATCHLEVEL_H_ */ +Index: b/lib/glob/glob.c +=================================================================== +--- a/lib/glob/glob.c ++++ b/lib/glob/glob.c +@@ -179,42 +179,50 @@ + char *pat, *dname; + int flags; + { +- char *pp, *pe, *t; +- int n, r; ++ char *pp, *pe, *t, *se; ++ int n, r, negate; + ++ negate = *pat == '!'; + pp = pat + 2; +- pe = pp + strlen (pp) - 1; /*(*/ +- if (*pe != ')') +- return 0; +- if ((t = strchr (pp, '|')) == 0) /* easy case first */ ++ se = pp + strlen (pp) - 1; /* end of string */ ++ pe = glob_patscan (pp, se, 0); /* end of extglob pattern (( */ ++ /* we should check for invalid extglob pattern here */ ++ /* if pe != se we have more of the pattern at the end of the extglob ++ pattern. Check the easy case first ( */ ++ if (pe == se && *pe == ')' && (t = strchr (pp, '|')) == 0) + { + *pe = '\0'; ++#if defined (HANDLE_MULTIBYTE) ++ r = mbskipname (pp, dname, flags); ++#else + r = skipname (pp, dname, flags); /*(*/ ++#endif + *pe = ')'; + return r; + } ++ ++ /* check every subpattern */ + while (t = glob_patscan (pp, pe, '|')) + { + n = t[-1]; + t[-1] = '\0'; ++#if defined (HANDLE_MULTIBYTE) ++ r = mbskipname (pp, dname, flags); ++#else + r = skipname (pp, dname, flags); ++#endif + t[-1] = n; + if (r == 0) /* if any pattern says not skip, we don't skip */ + return r; + pp = t; + } /*(*/ + +- if (pp == pe) /* glob_patscan might find end of pattern */ ++ /* glob_patscan might find end of pattern */ ++ if (pp == se) + return r; + +- *pe = '\0'; +-# if defined (HANDLE_MULTIBYTE) +- r = mbskipname (pp, dname, flags); /*(*/ +-# else +- r = skipname (pp, dname, flags); /*(*/ +-# endif +- *pe = ')'; +- return r; ++ /* but if it doesn't then we didn't match a leading dot */ ++ return 0; + } + #endif + +@@ -277,20 +285,23 @@ + int flags; + { + #if EXTENDED_GLOB +- wchar_t *pp, *pe, *t, n; +- int r; ++ wchar_t *pp, *pe, *t, n, *se; ++ int r, negate; + ++ negate = *pat == L'!'; + pp = pat + 2; +- pe = pp + wcslen (pp) - 1; /*(*/ +- if (*pe != L')') +- return 0; +- if ((t = wcschr (pp, L'|')) == 0) ++ se = pp + wcslen (pp) - 1; /*(*/ ++ pe = glob_patscan_wc (pp, se, 0); ++ ++ if (pe == se && *pe == ')' && (t = wcschr (pp, L'|')) == 0) + { + *pe = L'\0'; + r = wchkname (pp, dname); /*(*/ + *pe = L')'; + return r; + } ++ ++ /* check every subpattern */ + while (t = glob_patscan_wc (pp, pe, '|')) + { + n = t[-1]; +@@ -305,10 +316,8 @@ + if (pp == pe) /* glob_patscan_wc might find end of pattern */ + return r; + +- *pe = L'\0'; +- r = wchkname (pp, dname); /*(*/ +- *pe = L')'; +- return r; ++ /* but if it doesn't then we didn't match a leading dot */ ++ return 0; + #else + return (wchkname (pat, dname)); + #endif +Index: b/lib/glob/gmisc.c +=================================================================== +--- a/lib/glob/gmisc.c ++++ b/lib/glob/gmisc.c +@@ -210,6 +210,7 @@ + case '+': + case '!': + case '@': ++ case '?': + return (pat[1] == LPAREN); + default: + return 0; diff --git a/debian/patches/bash43-009.diff b/debian/patches/bash43-009.diff new file mode 100644 index 0000000..00477c0 --- /dev/null +++ b/debian/patches/bash43-009.diff @@ -0,0 +1,55 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-009 + +Bug-Reported-by: Matthias Klose +Bug-Reference-ID: <53346FC8.6090005@debian.org> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00171.html + +Bug-Description: + +There is a problem with unsigned sign extension when attempting to reallocate +the input line when it is fewer than 3 characters long and there has been a +history expansion. The sign extension causes the shell to not reallocate the +line, which results in a segmentation fault when it writes past the end. + +Index: b/parse.y +=================================================================== +--- a/parse.y ++++ b/parse.y +@@ -2424,7 +2424,7 @@ + not already end in an EOF character. */ + if (shell_input_line_terminator != EOF) + { +- if (shell_input_line_size < SIZE_MAX && shell_input_line_len > shell_input_line_size - 3) ++ if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size)) + shell_input_line = (char *)xrealloc (shell_input_line, + 1 + (shell_input_line_size += 2)); + +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 8 ++#define PATCHLEVEL 9 + + #endif /* _PATCHLEVEL_H_ */ +Index: b/y.tab.c +=================================================================== +--- a/y.tab.c ++++ b/y.tab.c +@@ -4736,7 +4736,7 @@ + not already end in an EOF character. */ + if (shell_input_line_terminator != EOF) + { +- if (shell_input_line_size < SIZE_MAX && shell_input_line_len > shell_input_line_size - 3) ++ if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size)) + shell_input_line = (char *)xrealloc (shell_input_line, + 1 + (shell_input_line_size += 2)); + diff --git a/debian/patches/bash43-010.diff b/debian/patches/bash43-010.diff new file mode 100644 index 0000000..67a5bbf --- /dev/null +++ b/debian/patches/bash43-010.diff @@ -0,0 +1,153 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-010 + +Bug-Reported-by: Albert Shih +Bug-Reference-ID: Wed, 5 Mar 2014 23:01:40 +0100 +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00028.html + +Bug-Description: + +Patch (apply with `patch -p0'): + +This patch changes the behavior of programmable completion to compensate +for two assumptions made by the bash-completion package. Bash-4.3 changed +to dequote the argument to programmable completion only under certain +circumstances, to make the behavior of compgen more consistent when run +from the command line -- closer to the behavior when run by a shell function +run as part of programmable completion. Bash-completion can pass quoted +arguments to compgen when the original word to be completed was not quoted, +expecting programmable completion to dequote the word before attempting +completion. + +This patch fixes two cases: + +1. An empty string that bash-completion passes to compgen as a quoted null + string (''). + +2. An unquoted word that bash-completion quotes using single quotes or + backslashes before passing it to compgen. + +In these cases, since readline did not detect a quote character in the original +word to be completed, bash-4.3 + +Index: b/externs.h +=================================================================== +--- a/externs.h ++++ b/externs.h +@@ -324,6 +324,7 @@ + extern char *sh_backslash_quote __P((char *, const char *, int)); + extern char *sh_backslash_quote_for_double_quotes __P((char *)); + extern int sh_contains_shell_metas __P((char *)); ++extern int sh_contains_quotes __P((char *)); + + /* declarations for functions defined in lib/sh/spell.c */ + extern int spname __P((char *, char *)); +Index: b/lib/sh/shquote.c +=================================================================== +--- a/lib/sh/shquote.c ++++ b/lib/sh/shquote.c +@@ -311,3 +311,17 @@ + + return (0); + } ++ ++int ++sh_contains_quotes (string) ++ char *string; ++{ ++ char *s; ++ ++ for (s = string; s && *s; s++) ++ { ++ if (*s == '\'' || *s == '"' || *s == '\\') ++ return 1; ++ } ++ return 0; ++} +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 9 ++#define PATCHLEVEL 10 + + #endif /* _PATCHLEVEL_H_ */ +Index: b/pcomplete.c +=================================================================== +--- a/pcomplete.c ++++ b/pcomplete.c +@@ -183,6 +183,7 @@ + + COMPSPEC *pcomp_curcs; + const char *pcomp_curcmd; ++const char *pcomp_curtxt; + + #ifdef DEBUG + /* Debugging code */ +@@ -753,6 +754,32 @@ + quoted strings. */ + dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character); + } ++ /* Intended to solve a mismatched assumption by bash-completion. If ++ the text to be completed is empty, but bash-completion turns it into ++ a quoted string ('') assuming that this code will dequote it before ++ calling readline, do the dequoting. */ ++ else if (iscompgen && iscompleting && ++ pcomp_curtxt && *pcomp_curtxt == 0 && ++ text && (*text == '\'' || *text == '"') && text[1] == text[0] && text[2] == 0 && ++ rl_filename_dequoting_function) ++ dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character); ++ /* Another mismatched assumption by bash-completion. If compgen is being ++ run as part of bash-completion, and the argument to compgen is not ++ the same as the word originally passed to the programmable completion ++ code, dequote the argument if it has quote characters. It's an ++ attempt to detect when bash-completion is quoting its filename ++ argument before calling compgen. */ ++ /* We could check whether gen_shell_function_matches is in the call ++ stack by checking whether the gen-shell-function-matches tag is in ++ the unwind-protect stack, but there's no function to do that yet. ++ We could simply check whether we're executing in a function by ++ checking variable_context, and may end up doing that. */ ++ else if (iscompgen && iscompleting && rl_filename_dequoting_function && ++ pcomp_curtxt && text && ++ STREQ (pcomp_curtxt, text) == 0 && ++ variable_context && ++ sh_contains_quotes (text)) /* guess */ ++ dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character); + else + dfn = savestring (text); + } +@@ -1522,7 +1549,7 @@ + COMPSPEC **lastcs; + { + COMPSPEC *cs, *oldcs; +- const char *oldcmd; ++ const char *oldcmd, *oldtxt; + STRINGLIST *ret; + + cs = progcomp_search (ocmd); +@@ -1545,14 +1572,17 @@ + + oldcs = pcomp_curcs; + oldcmd = pcomp_curcmd; ++ oldtxt = pcomp_curtxt; + + pcomp_curcs = cs; + pcomp_curcmd = cmd; ++ pcomp_curtxt = word; + + ret = gen_compspec_completions (cs, cmd, word, start, end, foundp); + + pcomp_curcs = oldcs; + pcomp_curcmd = oldcmd; ++ pcomp_curtxt = oldtxt; + + /* We need to conditionally handle setting *retryp here */ + if (retryp) diff --git a/debian/patches/bash43-011.diff b/debian/patches/bash43-011.diff new file mode 100644 index 0000000..cc61449 --- /dev/null +++ b/debian/patches/bash43-011.diff @@ -0,0 +1,42 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-011 + +Bug-Reported-by: Egmont Koblinger +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00153.html + +Bug-Description: + +The signal handling changes to bash and readline (to avoid running any code +in a signal handler context) cause the cursor to be placed on the wrong +line of a multi-line command after a ^C interrupts editing. + +Index: b/lib/readline/display.c +=================================================================== +--- a/lib/readline/display.c ++++ b/lib/readline/display.c +@@ -2677,7 +2677,8 @@ + { + if (_rl_echoing_p) + { +- _rl_move_vert (_rl_vis_botlin); ++ if (_rl_vis_botlin > 0) /* minor optimization plus bug fix */ ++ _rl_move_vert (_rl_vis_botlin); + _rl_vis_botlin = 0; + fflush (rl_outstream); + rl_restart_output (1, 0); +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 10 ++#define PATCHLEVEL 11 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/debian/patches/bash43-012.diff b/debian/patches/bash43-012.diff new file mode 100644 index 0000000..caaaf45 --- /dev/null +++ b/debian/patches/bash43-012.diff @@ -0,0 +1,44 @@ +# DP: bash43-012 upstream patch + + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-012 + +Bug-Reported-by: Eduardo A. Bustamante López +Bug-Reference-ID: <5346B54C.4070205@case.edu> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00051.html + +Bug-Description: + +When a SIGCHLD trap runs a command containing a shell builtin while +a script is running `wait' to wait for all running children to complete, +the SIGCHLD trap will not be run once for each child that terminates. + +Patch (apply with `patch -p0'): + +Index: b/jobs.c +=================================================================== +--- a/jobs.c ++++ b/jobs.c +@@ -3597,6 +3597,7 @@ run_sigchld_trap (nchild) + unwind_protect_int (jobs_list_frozen); + unwind_protect_pointer (the_pipeline); + unwind_protect_pointer (subst_assign_varlist); ++ unwind_protect_pointer (this_shell_builtin); + + /* We have to add the commands this way because they will be run + in reverse order of adding. We don't want maybe_set_sigchld_trap () +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 11 ++#define PATCHLEVEL 12 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/debian/patches/bash43-013.diff b/debian/patches/bash43-013.diff new file mode 100644 index 0000000..2d31e2e --- /dev/null +++ b/debian/patches/bash43-013.diff @@ -0,0 +1,58 @@ +# DP: bash43-013 upstream patch + + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-013 + +Bug-Reported-by: +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00069.html + +Bug-Description: + +Using reverse-i-search when horizontal scrolling is enabled does not redisplay +the entire line containing the successful search results. + +Patch (apply with `patch -p0'): +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 12 ++#define PATCHLEVEL 13 + + #endif /* _PATCHLEVEL_H_ */ +Index: b/lib/readline/display.c +=================================================================== +--- a/lib/readline/display.c ++++ b/lib/readline/display.c +@@ -1637,7 +1637,7 @@ update_line (old, new, current_line, oma + /* If we are changing the number of invisible characters in a line, and + the spot of first difference is before the end of the invisible chars, + lendiff needs to be adjusted. */ +- if (current_line == 0 && !_rl_horizontal_scroll_mode && ++ if (current_line == 0 && /* !_rl_horizontal_scroll_mode && */ + current_invis_chars != visible_wrap_offset) + { + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) +@@ -1825,8 +1825,13 @@ update_line (old, new, current_line, oma + else + _rl_last_c_pos += bytes_to_insert; + ++ /* XXX - we only want to do this if we are at the end of the line ++ so we move there with _rl_move_cursor_relative */ + if (_rl_horizontal_scroll_mode && ((oe-old) > (ne-new))) +- goto clear_rest_of_line; ++ { ++ _rl_move_cursor_relative (ne-new, new); ++ goto clear_rest_of_line; ++ } + } + } + /* Otherwise, print over the existing material. */ diff --git a/debian/patches/bash43-014.diff b/debian/patches/bash43-014.diff new file mode 100644 index 0000000..05b3e04 --- /dev/null +++ b/debian/patches/bash43-014.diff @@ -0,0 +1,101 @@ +# DP: bash43-014 upstream patch + + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-014 + +Bug-Reported-by: Greg Wooledge +Bug-Reference-ID: <20140418202123.GB7660@eeg.ccf.org> +Bug-Reference-URL: http://lists.gnu.org/archive/html/help-bash/2014-04/msg00004.html + +Bug-Description: + +Under certain circumstances, $@ is expanded incorrectly in contexts where +word splitting is not performed. + +Patch (apply with `patch -p0'): +Index: b/subst.c +=================================================================== +--- a/subst.c ++++ b/subst.c +@@ -3248,8 +3248,10 @@ cond_expand_word (w, special) + if (w->word == 0 || w->word[0] == '\0') + return ((char *)NULL); + ++ expand_no_split_dollar_star = 1; + w->flags |= W_NOSPLIT2; + l = call_expand_word_internal (w, 0, 0, (int *)0, (int *)0); ++ expand_no_split_dollar_star = 0; + if (l) + { + if (special == 0) /* LHS */ +@@ -7847,6 +7849,10 @@ param_expand (string, sindex, quoted, ex + We also want to make sure that splitting is done no matter what -- + according to POSIX.2, this expands to a list of the positional + parameters no matter what IFS is set to. */ ++ /* XXX - what to do when in a context where word splitting is not ++ performed? Even when IFS is not the default, posix seems to imply ++ that we behave like unquoted $* ? Maybe we should use PF_NOSPLIT2 ++ here. */ + temp = string_list_dollar_at (list, (pflags & PF_ASSIGNRHS) ? (quoted|Q_DOUBLE_QUOTES) : quoted); + + tflag |= W_DOLLARAT; +@@ -8816,6 +8822,7 @@ finished_with_string: + else + { + char *ifs_chars; ++ char *tstring; + + ifs_chars = (quoted_dollar_at || has_dollar_at) ? ifs_value : (char *)NULL; + +@@ -8830,11 +8837,36 @@ finished_with_string: + regardless of what else has happened to IFS since the expansion. */ + if (split_on_spaces) + list = list_string (istring, " ", 1); /* XXX quoted == 1? */ ++ /* If we have $@ (has_dollar_at != 0) and we are in a context where we ++ don't want to split the result (W_NOSPLIT2), and we are not quoted, ++ we have already separated the arguments with the first character of ++ $IFS. In this case, we want to return a list with a single word ++ with the separator possibly replaced with a space (it's what other ++ shells seem to do). ++ quoted_dollar_at is internal to this function and is set if we are ++ passed an argument that is unquoted (quoted == 0) but we encounter a ++ double-quoted $@ while expanding it. */ ++ else if (has_dollar_at && quoted_dollar_at == 0 && ifs_chars && quoted == 0 && (word->flags & W_NOSPLIT2)) ++ { ++ /* Only split and rejoin if we have to */ ++ if (*ifs_chars && *ifs_chars != ' ') ++ { ++ list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1); ++ tstring = string_list (list); ++ } ++ else ++ tstring = istring; ++ tword = make_bare_word (tstring); ++ if (tstring != istring) ++ free (tstring); ++ goto set_word_flags; ++ } + else if (has_dollar_at && ifs_chars) + list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1); + else + { + tword = make_bare_word (istring); ++set_word_flags: + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) || (quoted_state == WHOLLY_QUOTED)) + tword->flags |= W_QUOTED; + if (word->flags & W_ASSIGNMENT) +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 13 ++#define PATCHLEVEL 14 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/debian/patches/bash43-015.diff b/debian/patches/bash43-015.diff new file mode 100644 index 0000000..3995eb8 --- /dev/null +++ b/debian/patches/bash43-015.diff @@ -0,0 +1,54 @@ +# DP: bash43-015 upstream patch + + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-015 + +Bug-Reported-by: Clark Wang +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00095.html + +Bug-Description: + +When completing directory names, the directory name is dequoted twice. +This causes problems for directories with single and double quotes in +their names. + +Patch (apply with `patch -p0'): +Index: b/bashline.c +=================================================================== +--- a/bashline.c ++++ b/bashline.c +@@ -4167,9 +4167,16 @@ bash_directory_completion_matches (text) + int qc; + + qc = rl_dispatching ? rl_completion_quote_character : 0; +- dfn = bash_dequote_filename ((char *)text, qc); ++ /* If rl_completion_found_quote != 0, rl_completion_matches will call the ++ filename dequoting function, causing the directory name to be dequoted ++ twice. */ ++ if (rl_dispatching && rl_completion_found_quote == 0) ++ dfn = bash_dequote_filename ((char *)text, qc); ++ else ++ dfn = (char *)text; + m1 = rl_completion_matches (dfn, rl_filename_completion_function); +- free (dfn); ++ if (dfn != text) ++ free (dfn); + + if (m1 == 0 || m1[0] == 0) + return m1; +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 14 ++#define PATCHLEVEL 15 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/debian/patches/bash43-016.diff b/debian/patches/bash43-016.diff new file mode 100644 index 0000000..bcb7610 --- /dev/null +++ b/debian/patches/bash43-016.diff @@ -0,0 +1,129 @@ +# DP: bash43-016 upstream patch + + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-016 + +Bug-Reported-by: Pierre Gaston +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00100.html + +Bug-Description: + +An extended glob pattern containing a slash (`/') causes the globbing code +to misinterpret it as a directory separator. + +Patch (apply with `patch -p0'): +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 15 ++#define PATCHLEVEL 16 + + #endif /* _PATCHLEVEL_H_ */ +Index: b/lib/glob/glob.c +=================================================================== +--- a/lib/glob/glob.c ++++ b/lib/glob/glob.c +@@ -123,6 +123,8 @@ static char **glob_dir_to_array __P((cha + extern char *glob_patscan __P((char *, char *, int)); + extern wchar_t *glob_patscan_wc __P((wchar_t *, wchar_t *, int)); + ++extern char *glob_dirscan __P((char *, int)); ++ + /* Compile `glob_loop.c' for single-byte characters. */ + #define CHAR unsigned char + #define INT int +@@ -187,6 +189,9 @@ extglob_skipname (pat, dname, flags) + se = pp + strlen (pp) - 1; /* end of string */ + pe = glob_patscan (pp, se, 0); /* end of extglob pattern (( */ + /* we should check for invalid extglob pattern here */ ++ if (pe == 0) ++ return 0; ++ + /* if pe != se we have more of the pattern at the end of the extglob + pattern. Check the easy case first ( */ + if (pe == se && *pe == ')' && (t = strchr (pp, '|')) == 0) +@@ -1015,7 +1020,7 @@ glob_filename (pathname, flags) + { + char **result; + unsigned int result_size; +- char *directory_name, *filename, *dname; ++ char *directory_name, *filename, *dname, *fn; + unsigned int directory_len; + int free_dirname; /* flag */ + int dflags; +@@ -1031,6 +1036,18 @@ glob_filename (pathname, flags) + + /* Find the filename. */ + filename = strrchr (pathname, '/'); ++#if defined (EXTENDED_GLOB) ++ if (filename && extended_glob) ++ { ++ fn = glob_dirscan (pathname, '/'); ++#if DEBUG_MATCHING ++ if (fn != filename) ++ fprintf (stderr, "glob_filename: glob_dirscan: fn (%s) != filename (%s)\n", fn ? fn : "(null)", filename); ++#endif ++ filename = fn; ++ } ++#endif ++ + if (filename == NULL) + { + filename = pathname; +Index: b/lib/glob/gmisc.c +=================================================================== +--- a/lib/glob/gmisc.c ++++ b/lib/glob/gmisc.c +@@ -42,6 +42,8 @@ + #define WLPAREN L'(' + #define WRPAREN L')' + ++extern char *glob_patscan __P((char *, char *, int)); ++ + /* Return 1 of the first character of WSTRING could match the first + character of pattern WPAT. Wide character version. */ + int +@@ -375,3 +377,34 @@ bad_bracket: + + return matlen; + } ++ ++/* Skip characters in PAT and return the final occurrence of DIRSEP. This ++ is only called when extended_glob is set, so we have to skip over extglob ++ patterns x(...) */ ++char * ++glob_dirscan (pat, dirsep) ++ char *pat; ++ int dirsep; ++{ ++ char *p, *d, *pe, *se; ++ ++ d = pe = se = 0; ++ for (p = pat; p && *p; p++) ++ { ++ if (extglob_pattern_p (p)) ++ { ++ if (se == 0) ++ se = p + strlen (p) - 1; ++ pe = glob_patscan (p + 2, se, 0); ++ if (pe == 0) ++ continue; ++ else if (*pe == 0) ++ break; ++ p = pe - 1; /* will do increment above */ ++ continue; ++ } ++ if (*p == dirsep) ++ d = p; ++ } ++ return d; ++} diff --git a/debian/patches/bash43-017.diff b/debian/patches/bash43-017.diff new file mode 100644 index 0000000..7b17f9e --- /dev/null +++ b/debian/patches/bash43-017.diff @@ -0,0 +1,47 @@ +# DP: bash43-017 upstream patch + + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-017 + +Bug-Reported-by: Dan Douglas +Bug-Reference-ID: <7781746.RhfoTROLxF@smorgbox> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-05/msg00026.html + +Bug-Description: + +The code that creates local variables should not clear the `invisible' +attribute when returning an existing local variable. Let the code that +actually assigns a value clear it. + +Patch (apply with `patch -p0'): +Index: b/variables.c +=================================================================== +--- a/variables.c ++++ b/variables.c +@@ -2197,10 +2197,7 @@ make_local_variable (name) + /* local foo; local foo; is a no-op. */ + old_var = find_variable (name); + if (old_var && local_p (old_var) && old_var->context == variable_context) +- { +- VUNSETATTR (old_var, att_invisible); /* XXX */ +- return (old_var); +- } ++ return (old_var); + + was_tmpvar = old_var && tempvar_p (old_var); + /* If we're making a local variable in a shell function, the temporary env +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 16 ++#define PATCHLEVEL 17 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/debian/patches/bash43-018.diff b/debian/patches/bash43-018.diff new file mode 100644 index 0000000..b570f94 --- /dev/null +++ b/debian/patches/bash43-018.diff @@ -0,0 +1,44 @@ +# DP: bash43-018 upstream patch + + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-018 + +Bug-Reported-by: Geir Hauge +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-05/msg00040.html + +Bug-Description: + +When assigning an array variable using the compound assignment syntax, +but using `declare' with the rhs of the compound assignment quoted, the +shell did not mark the variable as visible after successfully performing +the assignment. + +Patch (apply with `patch -p0'): +Index: b/arrayfunc.c +=================================================================== +--- a/arrayfunc.c ++++ b/arrayfunc.c +@@ -179,6 +179,7 @@ bind_array_var_internal (entry, ind, key + array_insert (array_cell (entry), ind, newval); + FREE (newval); + ++ VUNSETATTR (entry, att_invisible); /* no longer invisible */ + return (entry); + } + +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 17 ++#define PATCHLEVEL 18 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/debian/patches/bash43-019.diff b/debian/patches/bash43-019.diff new file mode 100644 index 0000000..333a174 --- /dev/null +++ b/debian/patches/bash43-019.diff @@ -0,0 +1,83 @@ +# DP: bash43-019 upstream patch + + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-019 + +Bug-Reported-by: John Lenton +Bug-Reference-ID: +Bug-Reference-URL: https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1317476 + +Bug-Description: + +The -t timeout option to `read' does not work when the -e option is used. + +Patch (apply with `patch -p0'): + +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 18 ++#define PATCHLEVEL 19 + + #endif /* _PATCHLEVEL_H_ */ +Index: b/builtins/read.def +=================================================================== +--- a/builtins/read.def ++++ b/builtins/read.def +@@ -442,7 +442,10 @@ read_builtin (list) + add_unwind_protect (reset_alarm, (char *)NULL); + #if defined (READLINE) + if (edit) +- add_unwind_protect (reset_attempted_completion_function, (char *)NULL); ++ { ++ add_unwind_protect (reset_attempted_completion_function, (char *)NULL); ++ add_unwind_protect (bashline_reset_event_hook, (char *)NULL); ++ } + #endif + falarm (tmsec, tmusec); + } +@@ -1021,6 +1024,7 @@ edit_line (p, itext) + + old_attempted_completion_function = rl_attempted_completion_function; + rl_attempted_completion_function = (rl_completion_func_t *)NULL; ++ bashline_set_event_hook (); + if (itext) + { + old_startup_hook = rl_startup_hook; +@@ -1032,6 +1036,7 @@ edit_line (p, itext) + + rl_attempted_completion_function = old_attempted_completion_function; + old_attempted_completion_function = (rl_completion_func_t *)NULL; ++ bashline_reset_event_hook (); + + if (ret == 0) + return ret; +Index: b/lib/readline/input.c +=================================================================== +--- a/lib/readline/input.c ++++ b/lib/readline/input.c +@@ -534,8 +534,16 @@ rl_getc (stream) + return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF); + else if (_rl_caught_signal == SIGHUP || _rl_caught_signal == SIGTERM) + return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF); ++ /* keyboard-generated signals of interest */ + else if (_rl_caught_signal == SIGINT || _rl_caught_signal == SIGQUIT) + RL_CHECK_SIGNALS (); ++ /* non-keyboard-generated signals of interest */ ++ else if (_rl_caught_signal == SIGALRM ++#if defined (SIGVTALRM) ++ || _rl_caught_signal == SIGVTALRM ++#endif ++ ) ++ RL_CHECK_SIGNALS (); + + if (rl_signal_event_hook) + (*rl_signal_event_hook) (); diff --git a/debian/patches/bash43-020.diff b/debian/patches/bash43-020.diff new file mode 100644 index 0000000..4a298ea --- /dev/null +++ b/debian/patches/bash43-020.diff @@ -0,0 +1,103 @@ +# DP: bash43-020 upstream patch + + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-020 + +Bug-Reported-by: Jared Yanovich +Bug-Reference-ID: <20140417073654.GB26875@nightderanger.psc.edu> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00065.html + +Bug-Description: + +When PS2 contains a command substitution, here-documents entered in an +interactive shell can sometimes cause a segmentation fault. + +Patch (apply with `patch -p0'): + +Index: b/shell.h +=================================================================== +--- a/shell.h ++++ b/shell.h +@@ -168,7 +168,8 @@ typedef struct _sh_parser_state_t { + /* flags state affecting the parser */ + int expand_aliases; + int echo_input_at_read; +- ++ int need_here_doc; ++ + } sh_parser_state_t; + + typedef struct _sh_input_line_state_t { +Index: b/parse.y +=================================================================== +--- a/parse.y ++++ b/parse.y +@@ -2642,7 +2642,7 @@ gather_here_documents () + int r; + + r = 0; +- while (need_here_doc) ++ while (need_here_doc > 0) + { + parser_state |= PST_HEREDOC; + make_here_document (redir_stack[r++], line_number); +@@ -6075,6 +6075,7 @@ save_parser_state (ps) + + ps->expand_aliases = expand_aliases; + ps->echo_input_at_read = echo_input_at_read; ++ ps->need_here_doc = need_here_doc; + + ps->token = token; + ps->token_buffer_size = token_buffer_size; +@@ -6123,6 +6124,7 @@ restore_parser_state (ps) + + expand_aliases = ps->expand_aliases; + echo_input_at_read = ps->echo_input_at_read; ++ need_here_doc = ps->need_here_doc; + + FREE (token); + token = ps->token; +Index: b/y.tab.c +=================================================================== +--- a/y.tab.c ++++ b/y.tab.c +@@ -4954,7 +4954,7 @@ gather_here_documents () + int r; + + r = 0; +- while (need_here_doc) ++ while (need_here_doc > 0) + { + parser_state |= PST_HEREDOC; + make_here_document (redir_stack[r++], line_number); +@@ -8387,6 +8387,7 @@ save_parser_state (ps) + + ps->expand_aliases = expand_aliases; + ps->echo_input_at_read = echo_input_at_read; ++ ps->need_here_doc = need_here_doc; + + ps->token = token; + ps->token_buffer_size = token_buffer_size; +@@ -8435,6 +8436,7 @@ restore_parser_state (ps) + + expand_aliases = ps->expand_aliases; + echo_input_at_read = ps->echo_input_at_read; ++ need_here_doc = ps->need_here_doc; + + FREE (token); + token = ps->token; +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 19 ++#define PATCHLEVEL 20 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/debian/patches/bash43-021.diff b/debian/patches/bash43-021.diff new file mode 100644 index 0000000..8677b05 --- /dev/null +++ b/debian/patches/bash43-021.diff @@ -0,0 +1,52 @@ +# DP: bash43-021 upstream patch + + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-021 + +Bug-Reported-by: Jared Yanovich +Bug-Reference-ID: <20140625225019.GJ17044@nightderanger.psc.edu> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00070.html + +Bug-Description: + +When the readline `revert-all-at-newline' option is set, pressing newline +when the current line is one retrieved from history results in a double free +and a segmentation fault. + +Patch (apply with `patch -p0'): + +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 20 ++#define PATCHLEVEL 21 + + #endif /* _PATCHLEVEL_H_ */ +Index: b/lib/readline/misc.c +=================================================================== +--- a/lib/readline/misc.c ++++ b/lib/readline/misc.c +@@ -461,6 +461,7 @@ _rl_revert_all_lines () + saved_undo_list = 0; + /* Set up rl_line_buffer and other variables from history entry */ + rl_replace_from_history (entry, 0); /* entry->line is now current */ ++ entry->data = 0; /* entry->data is now current undo list */ + /* Undo all changes to this history entry */ + while (rl_undo_list) + rl_do_undo (); +@@ -468,7 +469,6 @@ _rl_revert_all_lines () + the timestamp. */ + FREE (entry->line); + entry->line = savestring (rl_line_buffer); +- entry->data = 0; + } + entry = previous_history (); + } diff --git a/debian/patches/bash43-022.diff b/debian/patches/bash43-022.diff new file mode 100644 index 0000000..f796c39 --- /dev/null +++ b/debian/patches/bash43-022.diff @@ -0,0 +1,53 @@ +# DP: bash43-022 upstream patch + + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-022 + +Bug-Reported-by: scorp.dev.null@gmail.com +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00061.html + +Bug-Description: + +Using nested pipelines within loops with the `lastpipe' option set can result +in a segmentation fault. + +Patch (apply with `patch -p0'): + +Index: b/execute_cmd.c +=================================================================== +--- a/execute_cmd.c ++++ b/execute_cmd.c +@@ -2409,7 +2409,16 @@ execute_pipeline (command, asynchronous, + #endif + lstdin = wait_for (lastpid); + #if defined (JOB_CONTROL) +- exec_result = job_exit_status (lastpipe_jid); ++ /* If wait_for removes the job from the jobs table, use result of last ++ command as pipeline's exit status as usual. The jobs list can get ++ frozen and unfrozen at inconvenient times if there are multiple pipelines ++ running simultaneously. */ ++ if (INVALID_JOB (lastpipe_jid) == 0) ++ exec_result = job_exit_status (lastpipe_jid); ++ else if (pipefail_opt) ++ exec_result = exec_result | lstdin; /* XXX */ ++ /* otherwise we use exec_result */ ++ + #endif + unfreeze_jobs_list (); + } +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 21 ++#define PATCHLEVEL 22 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/debian/patches/bash43-023.diff b/debian/patches/bash43-023.diff new file mode 100644 index 0000000..20a9999 --- /dev/null +++ b/debian/patches/bash43-023.diff @@ -0,0 +1,86 @@ +# DP: bash43-023 upstream patch + + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-023 + +Bug-Reported-by: Tim Friske +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00056.html + +Bug-Description: + +Bash does not correctly parse process substitution constructs that contain +unbalanced parentheses as part of the contained command. + +Patch (apply with `patch -p0'): + +Index: b/subst.h +=================================================================== +--- a/subst.h ++++ b/subst.h +@@ -82,7 +82,7 @@ extern char *extract_arithmetic_subst __ + /* Extract the <( or >( construct in STRING, and return a new string. + Start extracting at (SINDEX) as if we had just seen "<(". + Make (SINDEX) get the position just after the matching ")". */ +-extern char *extract_process_subst __P((char *, char *, int *)); ++extern char *extract_process_subst __P((char *, char *, int *, int)); + #endif /* PROCESS_SUBSTITUTION */ + + /* Extract the name of the variable to bind to from the assignment string. */ +Index: b/subst.c +=================================================================== +--- a/subst.c ++++ b/subst.c +@@ -1192,12 +1192,18 @@ extract_arithmetic_subst (string, sindex + Start extracting at (SINDEX) as if we had just seen "<(". + Make (SINDEX) get the position of the matching ")". */ /*))*/ + char * +-extract_process_subst (string, starter, sindex) ++extract_process_subst (string, starter, sindex, xflags) + char *string; + char *starter; + int *sindex; ++ int xflags; + { ++#if 0 + return (extract_delimited_string (string, sindex, starter, "(", ")", SX_COMMAND)); ++#else ++ xflags |= (no_longjmp_on_fatal_error ? SX_NOLONGJMP : 0); ++ return (xparse_dolparen (string, string+*sindex, sindex, xflags)); ++#endif + } + #endif /* PROCESS_SUBSTITUTION */ + +@@ -1785,7 +1791,7 @@ skip_to_delim (string, start, delims, fl + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); +- temp = extract_process_subst (string, (c == '<') ? "<(" : ">(", &si); ++ temp = extract_process_subst (string, (c == '<') ? "<(" : ">(", &si, 0); + free (temp); /* no SX_ALLOC here */ + i = si; + if (string[i] == '\0') +@@ -8249,7 +8255,7 @@ add_string: + else + t_index = sindex + 1; /* skip past both '<' and LPAREN */ + +- temp1 = extract_process_subst (string, (c == '<') ? "<(" : ">(", &t_index); /*))*/ ++ temp1 = extract_process_subst (string, (c == '<') ? "<(" : ">(", &t_index, 0); /*))*/ + sindex = t_index; + + /* If the process substitution specification is `<()', we want to +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 22 ++#define PATCHLEVEL 23 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/debian/patches/bash43-024.diff b/debian/patches/bash43-024.diff new file mode 100644 index 0000000..7e5ad00 --- /dev/null +++ b/debian/patches/bash43-024.diff @@ -0,0 +1,51 @@ +# DP: bash43-024 upstream patch + + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-024 + +Bug-Reported-by: Corentin Peuvrel +Bug-Reference-ID: <53CE9E5D.6050203@pom-monitoring.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-07/msg00021.html + +Bug-Description: + +Indirect variable references do not work correctly if the reference +variable expands to an array reference using a subscript other than 0 +(e.g., foo='bar[1]' ; echo ${!foo}). + +Patch (apply with `patch -p0'): + +Index: b/subst.c +=================================================================== +--- a/subst.c ++++ b/subst.c +@@ -7374,7 +7374,13 @@ parameter_brace_expand (string, indexp, + } + + if (want_indir) +- tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at); ++ { ++ tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at); ++ /* Turn off the W_ARRAYIND flag because there is no way for this function ++ to return the index we're supposed to be using. */ ++ if (tdesc && tdesc->flags) ++ tdesc->flags &= ~W_ARRAYIND; ++ } + else + tdesc = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND|(pflags&(PF_NOSPLIT2|PF_ASSIGNRHS)), &ind); + +Index: b/patchlevel.h +=================================================================== +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 23 ++#define PATCHLEVEL 24 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/debian/patches/bash43-025.diff b/debian/patches/bash43-025.diff new file mode 100644 index 0000000..6a6ff7b --- /dev/null +++ b/debian/patches/bash43-025.diff @@ -0,0 +1,119 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-025 + +Bug-Reported-by: Stephane Chazelas +Bug-Reference-ID: +Bug-Reference-URL: + +Bug-Description: + +Under certain circumstances, bash will execute user code while processing the +environment for exported function definitions. + + +Index: bash-4.3/builtins/common.h +=================================================================== +--- bash-4.3.orig/builtins/common.h 2013-07-08 22:54:47.000000000 +0200 ++++ bash-4.3/builtins/common.h 2014-09-24 20:37:05.016459862 +0200 +@@ -33,6 +33,8 @@ + #define SEVAL_RESETLINE 0x010 + #define SEVAL_PARSEONLY 0x020 + #define SEVAL_NOLONGJMP 0x040 ++#define SEVAL_FUNCDEF 0x080 /* only allow function definitions */ ++#define SEVAL_ONECMD 0x100 /* only allow a single command */ + + /* Flags for describe_command, shared between type.def and command.def */ + #define CDESC_ALL 0x001 /* type -a */ +Index: bash-4.3/builtins/evalstring.c +=================================================================== +--- bash-4.3.orig/builtins/evalstring.c 2014-02-11 15:42:10.000000000 +0100 ++++ bash-4.3/builtins/evalstring.c 2014-09-24 20:37:05.016459862 +0200 +@@ -308,6 +308,14 @@ + { + struct fd_bitmap *bitmap; + ++ if ((flags & SEVAL_FUNCDEF) && command->type != cm_function_def) ++ { ++ internal_warning ("%s: ignoring function definition attempt", from_file); ++ should_jump_to_top_level = 0; ++ last_result = last_command_exit_value = EX_BADUSAGE; ++ break; ++ } ++ + bitmap = new_fd_bitmap (FD_BITMAP_SIZE); + begin_unwind_frame ("pe_dispose"); + add_unwind_protect (dispose_fd_bitmap, bitmap); +@@ -368,6 +376,9 @@ + dispose_command (command); + dispose_fd_bitmap (bitmap); + discard_unwind_frame ("pe_dispose"); ++ ++ if (flags & SEVAL_ONECMD) ++ break; + } + } + else +Index: bash-4.3/patchlevel.h +=================================================================== +--- bash-4.3.orig/patchlevel.h 2014-09-24 20:28:46.000000000 +0200 ++++ bash-4.3/patchlevel.h 2014-09-24 20:37:05.020459944 +0200 +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 24 ++#define PATCHLEVEL 25 + + #endif /* _PATCHLEVEL_H_ */ +Index: bash-4.3/subst.c +=================================================================== +--- bash-4.3.orig/subst.c 2014-09-24 20:28:46.000000000 +0200 ++++ bash-4.3/subst.c 2014-09-24 20:37:05.020459944 +0200 +@@ -8047,7 +8047,9 @@ + + goto return0; + } +- else if (var = find_variable_last_nameref (temp1)) ++ else if (var && (invisible_p (var) || var_isset (var) == 0)) ++ temp = (char *)NULL; ++ else if ((var = find_variable_last_nameref (temp1)) && var_isset (var) && invisible_p (var) == 0) + { + temp = nameref_cell (var); + #if defined (ARRAY_VARS) +Index: bash-4.3/variables.c +=================================================================== +--- bash-4.3.orig/variables.c 2014-09-24 20:28:46.000000000 +0200 ++++ bash-4.3/variables.c 2014-09-24 20:37:05.016459862 +0200 +@@ -358,13 +358,11 @@ + temp_string[char_index] = ' '; + strcpy (temp_string + char_index + 1, string); + +- if (posixly_correct == 0 || legal_identifier (name)) +- parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST); +- +- /* Ancient backwards compatibility. Old versions of bash exported +- functions like name()=() {...} */ +- if (name[char_index - 1] == ')' && name[char_index - 2] == '(') +- name[char_index - 2] = '\0'; ++ /* Don't import function names that are invalid identifiers from the ++ environment, though we still allow them to be defined as shell ++ variables. */ ++ if (legal_identifier (name)) ++ parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD); + + if (temp_var = find_function (name)) + { +@@ -381,10 +379,6 @@ + last_command_exit_value = 1; + report_error (_("error importing function definition for `%s'"), name); + } +- +- /* ( */ +- if (name[char_index - 1] == ')' && name[char_index - 2] == '\0') +- name[char_index - 2] = '('; /* ) */ + } + #if defined (ARRAY_VARS) + # if ARRAY_EXPORT diff --git a/debian/patches/bashbug-editor.diff b/debian/patches/bashbug-editor.diff new file mode 100644 index 0000000..3b751b6 --- /dev/null +++ b/debian/patches/bashbug-editor.diff @@ -0,0 +1,12 @@ +# DP: send bug reports to Debian bash maintainer too. + +--- a/support/bashbug.sh ++++ b/support/bashbug.sh +@@ -117,6 +117,7 @@ + esac ;; + esac + ++BUGBASH="${BUGBASH},bash@packages.debian.org" + BUGADDR="${1-$BUGBASH}" + + if [ -z "$DEFEDITOR" ] && [ -z "$EDITOR" ]; then diff --git a/debian/patches/bzero.diff b/debian/patches/bzero.diff new file mode 100644 index 0000000..653ed3d --- /dev/null +++ b/debian/patches/bzero.diff @@ -0,0 +1,13 @@ +--- a/lib/sh/oslib.c ++++ b/lib/sh/oslib.c +@@ -180,8 +180,8 @@ + # endif + void + bzero (s, n) +- char *s; +- int n; ++ void *s; ++ size_t n; + { + register int i; + register char *r; diff --git a/debian/patches/deb-bash-config.diff b/debian/patches/deb-bash-config.diff new file mode 100644 index 0000000..327682e --- /dev/null +++ b/debian/patches/deb-bash-config.diff @@ -0,0 +1,52 @@ +# DP: Changed compile time configuration options: +# DP: +# DP: - Set the default path to comply with Debian policy +# DP: +# DP: - Enable System-wide .bashrc file for interactive shells. +# DP: +# DP: - Enable System-wide .bash.logout file for interactive shells. +# DP: +# DP: - make non-interactive shells begun with argv[0][0] == '-' +# DP: run the startup files when not in posix mode. +# DP: +# DP: - try to check whether bash is being run by sshd and source +# DP: the .bashrc if so (like the rshd behavior). +# DP: +# DP: - don't define a default DEFAULT_MAIL_DIRECTORY, because it +# DP: can cause a timeout on NFS mounts. + +--- a/config-bot.h ++++ b/config-bot.h +@@ -196,4 +196,4 @@ + /******************************************************************/ + + /* If you don't want bash to provide a default mail file to check. */ +-/* #undef DEFAULT_MAIL_DIRECTORY */ ++#undef DEFAULT_MAIL_DIRECTORY +--- a/config-top.h ++++ b/config-top.h +@@ -80,20 +80,20 @@ + #define KSH_COMPATIBLE_SELECT + + /* System-wide .bashrc file for interactive shells. */ +-/* #define SYS_BASHRC "/etc/bash.bashrc" */ ++#define SYS_BASHRC "/etc/bash.bashrc" + + /* System-wide .bash_logout for login shells. */ +-/* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */ ++#define SYS_BASH_LOGOUT "/etc/bash.bash_logout" + + /* Define this to make non-interactive shells begun with argv[0][0] == '-' + run the startup files when not in posix mode. */ +-/* #define NON_INTERACTIVE_LOGIN_SHELLS */ ++#define NON_INTERACTIVE_LOGIN_SHELLS + + /* Define this if you want bash to try to check whether it's being run by + sshd and source the .bashrc if so (like the rshd behavior). This checks + for the presence of SSH_CLIENT or SSH2_CLIENT in the initial environment, + which can be fooled under certain not-uncommon circumstances. */ +-/* #define SSH_SOURCE_BASHRC */ ++#define SSH_SOURCE_BASHRC + + /* Define if you want the case-capitalizing operators (~[~]) and the + `capcase' variable attribute (declare -c). */ diff --git a/debian/patches/deb-examples.diff b/debian/patches/deb-examples.diff new file mode 100644 index 0000000..4c001b8 --- /dev/null +++ b/debian/patches/deb-examples.diff @@ -0,0 +1,14 @@ +# DP: document readline header location on Debian systems + +--- a/examples/loadables/README ++++ b/examples/loadables/README +@@ -32,6 +32,9 @@ + guide'. The file template.c provides a template to use for creating + new loadable builtins. + ++On Debian GNU/Linux systems, the bash headers are in /usr/include/bash. ++The appropriate options are already set in the example Makefile. ++ + basename.c Return non-directory portion of pathname. + cat.c cat(1) replacement with no options - the way cat was intended. + cut.c cut(1) replacement. diff --git a/debian/patches/exec-redirections-doc.diff b/debian/patches/exec-redirections-doc.diff new file mode 100644 index 0000000..7e6529d --- /dev/null +++ b/debian/patches/exec-redirections-doc.diff @@ -0,0 +1,29 @@ +Index: b/doc/bash.1 +=================================================================== +--- a/doc/bash.1 ++++ b/doc/bash.1 +@@ -3633,6 +3633,10 @@ + Redirections using file descriptors greater than 9 should be used with + care, as they may conflict with file descriptors the shell uses + internally. ++.PP ++Note that the ++.B exec ++builtin command can make redirections take effect in the current shell. + .SS Redirecting Input + .PP + Redirection of input causes the file whose name results from +Index: b/doc/bashref.texi +=================================================================== +--- a/doc/bashref.texi ++++ b/doc/bashref.texi +@@ -2555,6 +2555,9 @@ + care, as they may conflict with file descriptors the shell uses + internally. + ++Note that the @code{exec} builtin command can make redirections take ++effect in the current shell. ++ + @subsection Redirecting Input + Redirection of input causes the file whose name results from + the expansion of @var{word} diff --git a/debian/patches/input-err.diff b/debian/patches/input-err.diff new file mode 100644 index 0000000..ee9ed55 --- /dev/null +++ b/debian/patches/input-err.diff @@ -0,0 +1,15 @@ +# DP: Define PGRP_PIPE to avoid race condition. + +Index: b/input.c +=================================================================== +--- a/input.c ++++ b/input.c +@@ -509,7 +509,7 @@ + if (nr == 0) + bp->b_flag |= B_EOF; + else +- bp->b_flag |= B_ERROR; ++ fatal_error("error reading input file: %s", strerror(errno)); + return (EOF); + } + diff --git a/debian/patches/man-arithmetic.diff b/debian/patches/man-arithmetic.diff new file mode 100644 index 0000000..3c150d5 --- /dev/null +++ b/debian/patches/man-arithmetic.diff @@ -0,0 +1,16 @@ +# DP: document deprecated syntax for arithmetic evaluation. + +Index: b/doc/bash.1 +=================================================================== +--- a/doc/bash.1 ++++ b/doc/bash.1 +@@ -3152,6 +3152,9 @@ + \fB$((\fP\fIexpression\fP\fB))\fP + .RE + .PP ++The old format \fB$[\fP\fIexpression\fP\fB]\fP is deprecated and will ++be removed in upcoming versions of bash. ++.PP + The + .I expression + is treated as if it were within double quotes, but a double quote diff --git a/debian/patches/man-bash.diff b/debian/patches/man-bash.diff new file mode 100644 index 0000000..30da443 --- /dev/null +++ b/debian/patches/man-bash.diff @@ -0,0 +1,11 @@ +--- a/bash/doc/bash.1 ++++ b/bash/doc/bash.1 +@@ -6420,7 +6420,7 @@ + .IR string . + .TP + .B !?\fIstring\fR\fB[?]\fR +-Refer to the most recent command preceding the current postition in the ++Refer to the most recent command preceding the current position in the + history list containing + .IR string . + The trailing \fB?\fP may be omitted if diff --git a/debian/patches/man-bashlogout.diff b/debian/patches/man-bashlogout.diff new file mode 100644 index 0000000..a7f57dc --- /dev/null +++ b/debian/patches/man-bashlogout.diff @@ -0,0 +1,16 @@ +# DP: document /etc/bash.bashrc in bash man page + +Index: b/doc/bash.1 +=================================================================== +--- a/doc/bash.1 ++++ b/doc/bash.1 +@@ -10253,6 +10253,9 @@ + .FN /etc/bash.bashrc + The systemwide per-interactive-shell startup file + .TP ++.FN /etc/bash.bash.logout ++The systemwide login shell cleanup file, executed when a login shell exits ++.TP + .FN ~/.bash_profile + The personal initialization file, executed for login shells + .TP diff --git a/debian/patches/man-bashrc.diff b/debian/patches/man-bashrc.diff new file mode 100644 index 0000000..b0ea9ed --- /dev/null +++ b/debian/patches/man-bashrc.diff @@ -0,0 +1,66 @@ +# DP: document /etc/bash.bashrc in bash man page + +Index: b/doc/bash.1 +=================================================================== +--- a/doc/bash.1 ++++ b/doc/bash.1 +@@ -182,7 +182,9 @@ + .PD + Execute commands from + .I file +-instead of the standard personal initialization file ++instead of the system wide initialization file ++.I /etc/bash.bashrc ++and the standard personal initialization file + .I ~/.bashrc + if the shell is interactive (see + .SM +@@ -213,7 +215,9 @@ + below). + .TP + .B \-\-norc +-Do not read and execute the personal initialization file ++Do not read and execute the system wide initialization file ++.I /etc/bash.bashrc ++and the personal initialization file + .I ~/.bashrc + if the shell is interactive. + This option is on by default if the shell is invoked as +@@ -326,13 +330,15 @@ + .PP + When an interactive shell that is not a login shell is started, + .B bash +-reads and executes commands from \fI~/.bashrc\fP, if that file exists. ++reads and executes commands from \fI/etc/bash.bashrc\fP and \fI~/.bashrc\fP, ++if these files exist. + This may be inhibited by using the + .B \-\-norc + option. + The \fB\-\-rcfile\fP \fIfile\fP option will force + .B bash +-to read and execute commands from \fIfile\fP instead of \fI~/.bashrc\fP. ++to read and execute commands from \fIfile\fP instead of ++\fI/etc/bash.bashrc\fP and \fI~/.bashrc\fP. + .PP + When + .B bash +@@ -418,7 +424,8 @@ + If + .B bash + determines it is being run in this fashion, it reads and executes +-commands from \fI~/.bashrc\fP, if that file exists and is readable. ++commands from \fI~/.bashrc\fP and \fI~/.bashrc\fP, if these files ++exist and are readable. + It will not do this if invoked as \fBsh\fP. + The + .B \-\-norc +@@ -10243,6 +10250,9 @@ + .FN /etc/profile + The systemwide initialization file, executed for login shells + .TP ++.FN /etc/bash.bashrc ++The systemwide per-interactive-shell startup file ++.TP + .FN ~/.bash_profile + The personal initialization file, executed for login shells + .TP diff --git a/debian/patches/man-builtin.dpatch b/debian/patches/man-builtin.dpatch new file mode 100644 index 0000000..6abaef8 --- /dev/null +++ b/debian/patches/man-builtin.dpatch @@ -0,0 +1,29 @@ +#! /bin/sh -e + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +# DP: fix man page include + +--- doc/builtins.1~ Mon Nov 29 22:30:13 1999 ++++ doc/builtins.1 Tue Aug 1 21:54:06 2000 +@@ -10,6 +10,6 @@ + ulimit, umask, unalias, unset, until, wait, while \- bash built-in commands, see \fBbash\fR(1) + .SH BASH BUILTIN COMMANDS + .nr zZ 1 +-.so bash.1 ++.so /usr/share/man/man1/bash.1 + .SH SEE ALSO + bash(1), sh(1) diff --git a/debian/patches/man-fignore.diff b/debian/patches/man-fignore.diff new file mode 100644 index 0000000..808963c --- /dev/null +++ b/debian/patches/man-fignore.diff @@ -0,0 +1,17 @@ +# DP: bash(1): mention quoting when assigning to FIGNORE + +Index: b/doc/bash.1 +=================================================================== +--- a/doc/bash.1 ++++ b/doc/bash.1 +@@ -1997,7 +1997,9 @@ + is excluded from the list of matched filenames. + A sample value is + .if t \f(CW".o:~"\fP. +-.if n ".o:~". ++.if n ".o:~" ++(Quoting is needed when assigning a value to this variable, ++which contains tildes). + .TP + .B FUNCNEST + If set to a numeric value greater than 0, defines a maximum function diff --git a/debian/patches/man-nocaseglob.diff b/debian/patches/man-nocaseglob.diff new file mode 100644 index 0000000..257e4ed --- /dev/null +++ b/debian/patches/man-nocaseglob.diff @@ -0,0 +1,17 @@ +# DP: Clarify documentation about case-insensitive pathname expansion + +Index: b/doc/bash.1 +=================================================================== +--- a/doc/bash.1 ++++ b/doc/bash.1 +@@ -3315,6 +3315,10 @@ + .B nocaseglob + is enabled, the match is performed without regard to the case + of alphabetic characters. ++Note that when using range expressions like ++[a-z] (see below), letters of the other case may be included, ++depending on the setting of ++.B LC_COLLATE. + When a pattern is used for pathname expansion, + the character + .B ``.'' diff --git a/debian/patches/man-test.diff b/debian/patches/man-test.diff new file mode 100644 index 0000000..ae9c8bd --- /dev/null +++ b/debian/patches/man-test.diff @@ -0,0 +1,15 @@ +# DP: document conditional file expressions acting on the target of +# DP: symbolic links as well (except -h, -L). + +--- a/builtins/test.def ++++ b/builtins/test.def +@@ -64,6 +64,9 @@ + + FILE1 -ef FILE2 True if file1 is a hard link to file2. + ++All file operators except -h and -L are acting on the target of a symbolic ++link, not on the symlink itself, if FILE is a symbolic link. ++ + String operators: + + -z STRING True if string is empty. diff --git a/debian/patches/man-test2.diff b/debian/patches/man-test2.diff new file mode 100644 index 0000000..285adcb --- /dev/null +++ b/debian/patches/man-test2.diff @@ -0,0 +1,46 @@ +# DP: Document handling of parameters of the test builtin. + +Index: b/builtins/test.def +=================================================================== +--- a/builtins/test.def ++++ b/builtins/test.def +@@ -99,6 +99,9 @@ + less-than, less-than-or-equal, greater-than, or greater-than-or-equal + than ARG2. + ++See the bash manual page bash(1) for the handling of parameters (i.e. ++missing parameters). ++ + Exit Status: + Returns success if EXPR evaluates to true; fails if EXPR evaluates to + false or an invalid argument is given. +Index: b/doc/bash.1 +=================================================================== +--- a/doc/bash.1 ++++ b/doc/bash.1 +@@ -712,6 +712,10 @@ + .if n .sp 1 + When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort + lexicographically using the current locale. ++.PP ++See the description of the \fItest\fP builtin command (section SHELL ++BUILTIN COMMANDS below) for the handling of parameters (i.e. ++missing parameters). + .if t .sp 0.5 + .if n .sp 1 + When the \fB==\fP and \fB!=\fP operators are used, the string to the +Index: b/doc/bashref.texi +=================================================================== +--- a/doc/bashref.texi ++++ b/doc/bashref.texi +@@ -6448,6 +6448,10 @@ + Unless otherwise specified, primaries that operate on files follow symbolic + links and operate on the target of the link, rather than the link itself. + ++See the description of the @code{test} builtin command (section ++@pxref{Bash Builtins} below) for the handling of parameters ++(i.e. missing parameters). ++ + @table @code + @item -a @var{file} + True if @var{file} exists. diff --git a/debian/patches/man-vx-opts.dpatch b/debian/patches/man-vx-opts.dpatch new file mode 100644 index 0000000..e85b350 --- /dev/null +++ b/debian/patches/man-vx-opts.dpatch @@ -0,0 +1,34 @@ +#! /bin/sh -e + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +# DP: document -v / -x options + +--- ./doc/bash.1~ Wed Jan 20 22:48:04 1999 ++++ ./doc/bash.1 Sun Nov 14 13:26:59 1999 +@@ -104,6 +104,12 @@ + This option allows the positional parameters to be set + when invoking an interactive shell. + .TP ++.B \-v ++Print shell input lines as they are read. ++.TP ++.B \-x ++Print commands and their arguments as they are executed. ++.TP + .B \-D + A list of all double-quoted strings preceded by \fB$\fP + is printed on the standard ouput. diff --git a/debian/patches/no-brk-caching.diff b/debian/patches/no-brk-caching.diff new file mode 100644 index 0000000..dc4ba85 --- /dev/null +++ b/debian/patches/no-brk-caching.diff @@ -0,0 +1,47 @@ +# DP: Don't cache the value of brk between sbrk calls. + +--- a/lib/malloc/malloc.c ++++ b/lib/malloc/malloc.c +@@ -227,8 +227,6 @@ + static int pagebucket; /* bucket for requests a page in size */ + static int maxbuck; /* highest bucket receiving allocation request. */ + +-static char *memtop; /* top of heap */ +- + static const unsigned long binsizes[NBUCKETS] = { + 8UL, 16UL, 32UL, 64UL, 128UL, 256UL, 512UL, 1024UL, 2048UL, 4096UL, + 8192UL, 16384UL, 32768UL, 65536UL, 131072UL, 262144UL, 524288UL, +@@ -538,7 +536,6 @@ + siz = binsize (nu); + /* Should check for errors here, I guess. */ + sbrk (-siz); +- memtop -= siz; + + #ifdef MALLOC_STATS + _mstats.nsbrk++; +@@ -633,8 +630,6 @@ + if ((long)mp == -1) + goto morecore_done; + +- memtop += sbrk_amt; +- + /* shouldn't happen, but just in case -- require 8-byte alignment */ + if ((long)mp & MALIGN_MASK) + { +@@ -684,7 +679,7 @@ + Some of this partial page will be wasted space, but we'll use as + much as we can. Once we figure out how much to advance the break + pointer, go ahead and do it. */ +- memtop = curbrk = sbrk (0); ++ curbrk = sbrk (0); + sbrk_needed = pagesz - ((long)curbrk & (pagesz - 1)); /* sbrk(0) % pagesz */ + if (sbrk_needed < 0) + sbrk_needed += pagesz; +@@ -699,7 +694,6 @@ + curbrk = sbrk (sbrk_needed); + if ((long)curbrk == -1) + return -1; +- memtop += sbrk_needed; + + /* Take the memory which would otherwise be wasted and populate the most + popular bin (2 == 32 bytes) with it. Add whatever we need to curbrk diff --git a/debian/patches/pgrp-pipe.diff b/debian/patches/pgrp-pipe.diff new file mode 100644 index 0000000..ccc9bb3 --- /dev/null +++ b/debian/patches/pgrp-pipe.diff @@ -0,0 +1,11 @@ +# DP: Define PGRP_PIPE to avoid race condition. + +--- a/config-bot.h ++++ b/config-bot.h +@@ -197,3 +197,6 @@ + + /* If you don't want bash to provide a default mail file to check. */ + #undef DEFAULT_MAIL_DIRECTORY ++ ++/* Bug #224543 */ ++#define PGRP_PIPE 1 diff --git a/debian/patches/privmode.diff b/debian/patches/privmode.diff new file mode 100644 index 0000000..d138669 --- /dev/null +++ b/debian/patches/privmode.diff @@ -0,0 +1,19 @@ +# DP: XXX missing description +# DP: +# DP: Comment from Chet Ramey : +# DP: +# DP: Nope. This will allow setuid scripts if not called as `sh' and not +# DP: called with the -p option. I won't install this. + + +--- a/shell.c ++++ b/shell.c +@@ -492,7 +492,7 @@ + if (dump_translatable_strings) + read_but_dont_execute = 1; + +- if (running_setuid && privileged_mode == 0) ++ if (running_setuid && privileged_mode == 0 && act_like_sh == 0) + disable_priv_mode (); + + /* Need to get the argument to a -c option processed in the diff --git a/debian/patches/random.dpatch b/debian/patches/random.dpatch new file mode 100644 index 0000000..6304468 --- /dev/null +++ b/debian/patches/random.dpatch @@ -0,0 +1,107 @@ +#! /bin/sh -e + +dir=. +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + dir=$3 +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p1 < $0 + echo '2.05' > $dir/_distribution + echo '0' > $dir/_patchlevel + cd $dir && autoconf + rm -f $dir/_distribution $dir/_patchlevel + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p1 < $0 + rm -f $dir/configure $dir/_distribution $dir/_patchlevel + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +# DP: use the system random functions + +diff -urb bash.orig/config.h.in bash/config.h.in +--- bash.orig/config.h.in 2003-09-22 14:42:35.000000000 +0200 ++++ bash/config.h.in 2003-09-28 00:27:15.000000000 +0200 +@@ -606,6 +606,9 @@ + /* Define if you have the putenv function. */ + #undef HAVE_PUTENV + ++/* Define if you have the random function. */ ++#undef HAVE_RANDOM ++ + /* Define if you have the readlink function. */ + #undef HAVE_READLINK + +@@ -696,6 +699,9 @@ + /* Define if you have the strsignal function or macro. */ + #undef HAVE_STRSIGNAL + ++/* Define if you have the srandom function. */ ++#undef HAVE_SRANDOM ++ + /* Define if you have the sysconf function. */ + #undef HAVE_SYSCONF + +diff -urb bash.orig/variables.c bash/variables.c +--- bash.orig/variables.c 2003-07-31 16:28:57.000000000 +0200 ++++ bash/variables.c 2003-09-28 00:27:15.000000000 +0200 +@@ -1098,16 +1098,22 @@ + static unsigned long rseed = 1; + static int last_random_value; + +-/* A linear congruential random number generator based on the example +- one in the ANSI C standard. This one isn't very good, but a more +- complicated one is overkill. */ ++/* Use the random number genrator provided by the standard C library, ++ else use a linear congruential random number generator based on the ++ ANSI C standard. This one isn't very good (the values are alternately ++ odd and even, for example), but a more complicated one is overkill. */ + + /* Returns a pseudo-random number between 0 and 32767. */ + static int + brand () + { ++#if defined(HAVE_RANDOM) ++ rseed = (unsigned int) (labs(random()) & 32767); ++ return rseed; ++#else + rseed = rseed * 1103515245 + 12345; + return ((unsigned int)((rseed >> 16) & 32767)); /* was % 32768 */ ++#endif + } + + /* Set the random number generator seed to SEED. */ +@@ -1115,8 +1121,12 @@ + sbrand (seed) + unsigned long seed; + { ++#if defined(HAVE_SRANDOM) ++ srandom(seed); ++#else + rseed = seed; + last_random_value = 0; ++#endif + } + + static SHELL_VAR * +--- bash/configure.in~ 2004-03-02 00:04:29.000000000 +0100 ++++ bash/configure.in 2004-03-02 00:05:48.000000000 +0100 +@@ -667,6 +667,9 @@ + + AC_FUNC_MKTIME + ++dnl checks for random functions ++AC_CHECK_FUNCS(random srandom) ++ + dnl + dnl Checks for lib/intl and related code (uses some of the output from + dnl AM_GNU_GETTEXT) diff --git a/debian/patches/rbash-manpage.diff b/debian/patches/rbash-manpage.diff new file mode 100644 index 0000000..0103e61 --- /dev/null +++ b/debian/patches/rbash-manpage.diff @@ -0,0 +1,12 @@ +# DP: doc/rbash.1: fix bash(1) reference + +--- a/doc/rbash.1 ++++ b/doc/rbash.1 +@@ -3,6 +3,6 @@ + rbash \- restricted bash, see \fBbash\fR(1) + .SH RESTRICTED SHELL + .nr zY 1 +-.so bash.1 ++.so man1/bash.1 + .SH SEE ALSO + bash(1) diff --git a/debian/patches/rl-del-backspace-policy.dpatch b/debian/patches/rl-del-backspace-policy.dpatch new file mode 100644 index 0000000..ec56b43 --- /dev/null +++ b/debian/patches/rl-del-backspace-policy.dpatch @@ -0,0 +1,48 @@ +#! /bin/sh -e + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +# DP: Handle Debian Backspace/Delete keyboard policy + +diff -urb bash.orig/lib/readline/terminal.c bash/lib/readline/terminal.c +--- bash.orig/lib/readline/terminal.c 2003-09-18 17:03:42.000000000 +0200 ++++ bash/lib/readline/terminal.c 2003-09-27 23:25:59.000000000 +0200 +@@ -148,6 +148,9 @@ + /* Insert key */ + static char *_rl_term_kI; + ++/* The key sequence sent by the Delete key, if any. */ ++static char *_rl_term_kD; ++ + /* Cursor control */ + static char *_rl_term_vs; /* very visible */ + static char *_rl_term_ve; /* normal */ +@@ -314,6 +317,7 @@ + { "ic", &_rl_term_ic }, + { "im", &_rl_term_im }, + { "kH", &_rl_term_kH }, /* home down ?? */ ++ { "kD", &_rl_term_kD }, /* delete */ + { "kI", &_rl_term_kI }, /* insert */ + { "kd", &_rl_term_kd }, + { "ke", &_rl_term_ke }, /* end keypad mode */ +@@ -492,6 +496,7 @@ + + rl_bind_keyseq_if_unbound (_rl_term_kh, rl_beg_of_line); /* Home */ + rl_bind_keyseq_if_unbound (_rl_term_at7, rl_end_of_line); /* End */ ++ rl_bind_keyseq_if_unbound (_rl_term_kD, rl_delete); /* Delete */ + + _rl_keymap = xkeymap; + } diff --git a/debian/patches/rl-examples-bdb.dpatch b/debian/patches/rl-examples-bdb.dpatch new file mode 100644 index 0000000..33cca15 --- /dev/null +++ b/debian/patches/rl-examples-bdb.dpatch @@ -0,0 +1,30 @@ +#! /bin/sh -e + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +# DP: Modified readline examples to properly build with Debian setup. + +--- ./lib/readline/examples/rl.c~ Mon Nov 8 22:22:03 1999 ++++ ./lib/readline/examples/rl.c Fri Dec 31 17:34:30 1999 +@@ -11,7 +11,7 @@ + + #include + #include +-#include "posixstat.h" ++#include + + #if defined (READLINE_LIBRARY) + # include "readline.h" diff --git a/debian/patches/rl-header.dpatch b/debian/patches/rl-header.dpatch new file mode 100644 index 0000000..d147813 --- /dev/null +++ b/debian/patches/rl-header.dpatch @@ -0,0 +1,28 @@ +#! /bin/sh -e + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +# DP: include stdio.h in readline.h +--- lib/readline/readline.h~ Thu Aug 5 14:10:59 1999 ++++ lib/readline/readline.h Mon Oct 9 20:32:56 2000 +@@ -32,6 +32,7 @@ + # include "keymaps.h" + # include "tilde.h" + #else ++# include + # include + # include + # include diff --git a/debian/patches/rl-setenv.dpatch b/debian/patches/rl-setenv.dpatch new file mode 100644 index 0000000..9ae1d08 --- /dev/null +++ b/debian/patches/rl-setenv.dpatch @@ -0,0 +1,30 @@ +#! /bin/sh -e + +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;; + -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +# DP: Prefer setenv over putenv + +--- lib/readline/shell.c~ 2004-10-17 13:07:37.000000000 +0200 ++++ lib/readline/shell.c 2004-10-17 13:06:48.000000000 +0200 +@@ -122,7 +122,7 @@ + { + char *b; + +-#if defined (HAVE_PUTENV) ++#if 0 + b = (char *)xmalloc (INT_STRLEN_BOUND (int) + sizeof ("LINES=") + 1); + sprintf (b, "LINES=%d", lines); + putenv (b); diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..f76c617 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,46 @@ +bash43-001.diff +bash43-002.diff +bash43-003.diff +bash43-004.diff +bash43-005.diff +bash43-006.diff +bash43-007.diff +bash43-008.diff +bash43-009.diff +bash43-010.diff +bash43-011.diff +bash43-012.diff +bash43-013.diff +bash43-014.diff +bash43-015.diff +bash43-016.diff +bash43-017.diff +bash43-018.diff +bash43-019.diff +bash43-020.diff +bash43-021.diff +bash43-022.diff +bash43-023.diff +bash43-024.diff +bash43-025.diff +bashbug-editor.diff +deb-bash-config.diff +deb-examples.diff +man-arithmetic.diff +man-fignore.diff +man-bashrc.diff +man-bashlogout.diff +man-nocaseglob.diff +man-test.diff +man-test2.diff +privmode.diff +rbash-manpage.diff +bash-default-editor.diff +bash-subst-param-length.diff +pgrp-pipe.diff +input-err.diff +exec-redirections-doc.diff +bash-aliases-repeat.diff +# no-brk-caching.diff +use-system-texi2html.diff +bzero.diff diff --git a/debian/patches/use-system-texi2html.diff b/debian/patches/use-system-texi2html.diff new file mode 100644 index 0000000..274d9e2 --- /dev/null +++ b/debian/patches/use-system-texi2html.diff @@ -0,0 +1,15 @@ +Index: b/doc/Makefile.in +=================================================================== +--- a/doc/Makefile.in ++++ b/doc/Makefile.in +@@ -70,8 +70,8 @@ + TEX = tex + + MAKEINFO = makeinfo +-TEXI2DVI = ${SUPPORT_SRCDIR}/texi2dvi +-TEXI2HTML = ${SUPPORT_SRCDIR}/texi2html ++TEXI2DVI = texi2dvi ++TEXI2HTML = texi2html + MAN2HTML = ${BUILD_DIR}/support/man2html + HTMLPOST = ${srcdir}/htmlpost.sh + INFOPOST = ${srcdir}/infopost.sh diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..860e557 --- /dev/null +++ b/debian/rules @@ -0,0 +1,450 @@ +#! /usr/bin/make -f +# -*- makefile -*- + +#export DH_VERBOSE=1 + +unexport LANG LC_ALL LC_CTYPE LC_COLLATE LC_TIME LC_NUMERIC LC_MESSAGES + +# architecture dependent variables +vafilt = $(subst $(2)=,,$(filter $(2)=%,$(1))) +DPKG_VARS := $(shell dpkg-architecture) +DEB_BUILD_GNU_TYPE ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_GNU_TYPE) +DEB_HOST_ARCH ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH) +DEB_HOST_ARCH_OS ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH_OS) +DEB_HOST_GNU_CPU ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_CPU) +DEB_HOST_GNU_SYSTEM ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_SYSTEM) +DEB_HOST_GNU_TYPE ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_TYPE) +DEB_HOST_MULTIARCH ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_MULTIARCH) + +VERSION := 4.2 +#PKGVERSION := $(shell dpkg-parsechangelog \ +# | sed -n '/Version:/s/\(.* \)\(.*\)-2\(.*\)/\2\3/p') +#PKGVERSION := 3.0 +#dpkg_ctrl_args := -v$(PKGVERSION) -VBinary-Version=$(PKGVERSION) + +with_gfdl = yes + +ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) + CC = $(DEB_HOST_GNU_TYPE)-gcc +else + CC = gcc +endif + +ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) + STRIP = $(DEB_HOST_GNU_TYPE)-strip + else + STRIP = strip + endif +endif + + +dpkg_buildflags = DEB_CFLAGS_MAINT_APPEND=-Wall dpkg-buildflags +CFLAGS := $(shell $(dpkg_buildflags) --get CFLAGS) +CPPFLAGS := $(shell $(dpkg_buildflags) --get CPPFLAGS) +LDFLAGS := $(shell $(dpkg_buildflags) --get LDFLAGS) + +SHELL = /bin/bash +YACC = bison -y + +IX = install -o 0 -g 0 +ID = install -o 0 -g 0 -m 644 + +# built with installed libreadline? +with_installed_rl = no + +debflags = + +p = bash +p_stat = bash-static +p_bins = bash-builtins +p_doc = bash-doc + +d = debian/$(p) +d_stat = debian/$(p_stat) +d_bins = debian/$(p_bins) +d_doc = debian/$(p_doc) + +termcap_lib := $(if $(wildcard /usr/lib/libtinfo.so /usr/lib/$(DEB_HOST_MULTIARCH)/libtinfo.so), \ + -ltinfo, \ + -lncurses) + +conf_args = \ + --with-curses \ + --enable-largefile \ + --prefix=/usr \ + --infodir=/usr/share/info \ + --mandir=/usr/share/man +ifeq ($(with_installed_rl),yes) + conf_args += --with-installed-readline +endif +ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) + conf_args += --build $(DEB_HOST_GNU_TYPE) +else + conf_args += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) +endif + +static_conf_args := $(conf_args) \ + --enable-static-link \ + --without-bash-malloc \ + +#build: bash-build static-build preinst-build check +build: before-build bash-build static-build preinst-build check +build-arch: build +build-indep: build + +before-build: + mkdir -p stamps + : # see #327477, needed to have HAVE_DEV_STDIN defined + (test -d /dev/fd && test -r /dev/stdin < /dev/null) \ + || (test -d /proc/self/fd && test -r /dev/stdin < /dev/null) +ifneq (,$(findstring $(DEB_HOST_ARCH_OS), linux freebsd)) + $(CC) $(CFLAGS) $(LDFLAGS) $(CPPFLAGS) -o clear_console \ + debian/clear_console.c $(termcap_lib) +endif + +# --------------------------------------------------------------------------- +# build standard bash + +bash-build: + $(MAKE) -f debian/rules do-build-bash \ + bash_src=. \ + build=bash \ + configure_args="$(conf_args)" +bash-configure: + $(MAKE) -f debian/rules do-configure-bash \ + bash_src=. \ + build=bash \ + configure_args="$(conf_args)" + +# --------------------------------------------------------------------------- +# build static bash + +static-build: + $(MAKE) -f debian/rules do-build-static \ + bash_src=. \ + build=static \ + configure_args="$(static_conf_args)" +static-configure: + $(MAKE) -f debian/rules do-configure-static \ + bash_src=. \ + build=static \ + configure_args="$(static_conf_args)" + +# --------------------------------------------------------------------------- + +bash-doc-build: stamps/stamp-build-bash-doc +stamps/stamp-build-bash-doc: + rm -f bash/doc/bashref.info + $(MAKE) -C build-bash/doc info html + $(MAKE) -C build-bash/doc bash.pdf bashref.pdf + touch stamps/stamp-build-bash-doc + +# --------------------------------------------------------------------------- + +check: stamps/stamp-check +stamps/stamp-check: bash-build + @echo BEGIN test +ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) + ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) + -sh debian/locale-gen + LOCPATH=$(CURDIR)/locales \ + time $(MAKE) -C build-bash test 2>&1 | tee build-bash/test-protocol + endif +else + @echo Suppress 'make' test, because this is cross build +endif + @echo END test + touch stamps/stamp-check + +# --------------------------------------------------------------------------- + +clean: + dh_testdir + dh_testroot + rm -rf stamps build-* + rm -f debian/bash.preinst debian/*.o + rm -f debian/README.Debian + rm -rf locales + rm -f clear_console + rm -rf .pc + dh_clean + +preinst-build: debian/bash.preinst + +PREINST_OBJECTS = debian/bash.preinst.o debian/bash.preinst-lib.o + +$(PREINST_OBJECTS): %.o: %.c debian/bash.preinst.h + $(CC) -c -o $@ $(CFLAGS) $(CPPFLAGS) $< + +debian/bash.preinst: $(PREINST_OBJECTS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(PREINST_OBJECTS) + $(STRIP) -R .comment -R .note debian/bash.preinst + +# --------------------------------------------------------------------------- + + +install: bash-install + +bash-install: bash-build stamps/stamp-install-bash +stamps/stamp-install-bash: before-build stamps/stamp-build-bash + dh_testdir + dh_testroot + dh_clean -k -p$(p) -p$(p_doc) -p$(p_bins) + dh_installdirs -p$(p) \ + bin \ + etc/skel \ + usr/share/doc/$(p) + dh_installdirs -p$(p_doc) \ + usr/share/doc/$(p) + dh_installdirs -p$(p_bins) \ + usr/share/doc/$(p)/examples/loadables \ + usr/include/bash/{builtins,lib/{glob,tilde}} + +ifeq ($(with_gfdl),yes) +# XXXXX +# cp -p build-bash/doc/*.info bash/doc/ +endif + + : # install it + $(MAKE) -C build-bash install \ + YACC="$(YACC)" \ + DESTDIR=$(CURDIR)/$(d) + mv $(d)/usr/bin/bash $(d)/bin/. + chmod 755 $(d)/usr/bin/bashbug + $(ID) debian/bashbug.1 $(d)/usr/share/man/man1/ +ifneq ($(with_gfdl),yes) + mkdir -p $(d)/usr/share/man/man1 + cp -p bash/doc/bash.1 $(d)/usr/share/man/man1/bash.1 +endif + rm -f $(d)/usr/share/doc/bash/*.html + rm -f $(d)/usr/share/info/*.info + rm -f $(d)/usr/share/info/dir* + + : # extra links + ln -sf bash $(d)/bin/rbash + + : # skeleton files + $(ID) debian/etc.bash.bashrc $(d)/etc/bash.bashrc + $(ID) debian/skel.bashrc $(d)/etc/skel/.bashrc + $(ID) debian/skel.profile $(d)/etc/skel/.profile + $(ID) debian/skel.bash_logout $(d)/etc/skel/.bash_logout + + : # clean_console +ifneq (,$(findstring $(DEB_HOST_ARCH_OS), linux freebsd)) + $(IX) clear_console $(d)/usr/bin/ + $(ID) debian/clear_console.1 $(d)/usr/share/man/man1/ +endif + + : # files for the bash-doc package + + dh_installexamples -p$(p_doc) examples/* + mv $(d_doc)/usr/share/doc/$(p_doc)/examples \ + $(d_doc)/usr/share/doc/$(p)/examples + rm -rf $(d_doc)/usr/share/doc/$(p)/examples/loadables + ln -sf ../$(p)/examples $(d_doc)/usr/share/doc/$(p_doc)/examples + + rm -rf $(d_doc)/usr/share/doc/$(p)/examples/obashdb + cd $(d_doc)/usr/share/doc/$(p)/examples && chmod 755 \ + misc/aliasconv.*sh misc/cshtobash + + cd $(d_doc)/usr/share/doc/$(p)/examples && chmod 644 \ + scripts/shprompt + + : # files for the bash-builtins package + $(ID) include/*.h *.h $(d_bins)/usr/include/bash/ + $(ID) build-bash/*.h $(d_bins)/usr/include/bash/ + rm -f $(d_bins)/usr/include/bash/y.tab.h + $(ID) builtins/*.h $(d_bins)/usr/include/bash/builtins/ + $(ID) lib/glob/*.h $(d_bins)/usr/include/bash/lib/glob/ + $(ID) lib/tilde/*.h $(d_bins)/usr/include/bash/lib/tilde/ + $(ID) examples/loadables/{README,*.c} \ + $(d_bins)/usr/share/doc/$(p)/examples/loadables + $(ID) build-bash/examples/loadables/Makefile \ + $(d_bins)/usr/share/doc/$(p)/examples/loadables + ln -sf bash $(d_bins)/usr/share/doc/$(p_bins) + +# cat debian/README stamps/stamp-patch > debian/README.Debian + cat debian/README > debian/README.Debian + + touch stamps/stamp-install-bash + +binary-doc: bash-install bash-doc-build + dh_testdir + dh_testroot + mkdir -p $(d_doc)/usr/share/doc/$(p) +ifeq ($(with_gfdl),yes) + dh_installdocs -p$(p_doc) + cp -p build-bash/doc/bashref.{html,pdf} $(d_doc)/usr/share/doc/$(p)/. + mkdir -p $(d_doc)/usr/share/info + cp -p build-bash/doc/bash.info $(d_doc)/usr/share/info/. + dh_link -p$(p_doc) \ + /usr/share/doc/$(p)/bashref.html /usr/share/doc/$(p_doc)/bashref.html \ + /usr/share/doc/$(p)/bashref.pdf /usr/share/doc/$(p_doc)/bashref.pdf +else + dh_installdocs -p$(p_doc) -X.doc-base + rm -f $(d_doc)/usr/share/doc-base/bashref +endif + rm -f $(d_doc)/usr/share/info/dir* + cp -p build-bash/doc/bash.html build-bash/doc/bash.pdf \ + $(d_doc)/usr/share/doc/$(p)/ + dh_link -p$(p_doc) \ + /usr/share/doc/$(p)/bash.html /usr/share/doc/$(p_doc)/bash.html \ + /usr/share/doc/$(p)/bash.pdf /usr/share/doc/$(p_doc)/bash.pdf + dh_installchangelogs -p$(p_doc) CWRU/changelog + dh_compress -p$(p_doc) -Xexamples -X.pdf + dh_fixperms -p$(p_doc) + dh_installdeb -p$(p_doc) + dh_gencontrol -p$(p_doc) + dh_md5sums -p$(p_doc) + dh_builddeb -p$(p_doc) + +binary-bash: bash-install debian/bash.preinst + dh_testdir + dh_testroot + dh_installchangelogs -p$(p) + dh_installdocs -p$(p) \ + CHANGES NEWS COMPAT doc/INTRO POSIX \ + debian/{README.Debian,README.abs-guide,README.commands} \ + debian/inputrc.arrows + install -D -m 644 debian/bash.overrides \ + debian/bash/usr/share/lintian/overrides/bash + dh_installman -p$(p) doc/rbash.1 debian/bash-builtins.7 + dh_installmenu -p$(p) + dh_strip -p$(p) + dh_compress -p$(p) + dh_fixperms -p$(p) + dh_shlibdeps -p$(p) -- -dPre-Depends $(d)/bin/bash debian/bash.preinst + dh_installdeb -p$(p) + dh_gencontrol -p$(p) + dh_md5sums -p$(p) + dh_builddeb -p$(p) + +# Even though it contains only headers and example files, +# bash-builtins is NOT arch-independent because the config.h* files +# differ on different archs. +binary-builtins: bash-install + dh_testdir + dh_testroot + dh_compress -p$(p_bins) -Xexamples + dh_fixperms -p$(p_bins) + dh_installdeb -p$(p_bins) + dh_gencontrol -p$(p_bins) + dh_md5sums -p$(p_bins) + dh_builddeb -p$(p_bins) + +binary-static: static-build + dh_testdir + dh_testroot + dh_clean -k -p$(p_stat) + dh_installdirs -p$(p_stat) \ + bin \ + usr/share/man/man1 + cp -p build-static/bash $(d_stat)/bin/bash-static + cp -p doc/bash.1 $(d_stat)/usr/share/man/man1/bash-static.1 + dh_installdocs -p$(p_stat) + dh_installchangelogs -p$(p_stat) + install -D -m 644 debian/bash-static.overrides \ + debian/bash-static/usr/share/lintian/overrides/bash-static + dh_strip -p$(p_stat) + dh_compress -p$(p_stat) + dh_fixperms -p$(p_stat) + dh_installdeb -p$(p_stat) + dh_gencontrol -p$(p_stat) + dh_md5sums -p$(p_stat) + dh_builddeb -p$(p_stat) + +binary-indep: binary-doc +binary-arch: binary-bash binary-builtins binary-static +binary: binary-indep binary-arch + +# --------------------------------------------------------------------------- +# common rules for all bash build variations + +do-build-$(build): stamps/stamp-build-$(build) +stamps/stamp-build-$(build): stamps/stamp-configure-$(build) + dh_testdir +ifneq (,$(profiled_build)) + $(MAKE) -C build-$(build) \ + CFLAGS='$(CFLAGS) -fprofile-generate' \ + YACC="$(YACC)" \ + TERMCAP_LIB="$(termcap_lib)" \ + deb_builddir=build-$(build)/ \ + $(debflags) + -sh debian/locale-gen + cp debian/run-my-gprof bash/tests/ + LOCPATH=$(CURDIR)/locales \ + time $(MAKE) -C build-$(build) TESTSCRIPT=run-my-gprof test 2>&1 \ + | tee build-bash/profile-protocol + $(MAKE) -C build-$(build) clean + rm -f build-$(build)/lib/malloc/malloc*.gc?? + $(MAKE) -C build-$(build) \ + CFLAGS='$(CFLAGS) -fprofile-use' \ + YACC="$(YACC)" \ + TERMCAP_LIB="$(termcap_lib)" \ + deb_builddir=build-$(build)/ \ + $(debflags) +else + $(MAKE) -C build-$(build) \ + YACC="$(YACC)" \ + TERMCAP_LIB="$(termcap_lib)" \ + deb_builddir=build-$(build)/ \ + $(debflags) +endif +ifeq ($(with_gfdl),yes) + $(MAKE) -C build-$(build)/doc \ + bash.info +endif + touch stamps/stamp-build-$(build) + +do-configure-$(build): stamps/stamp-configure-$(build) +stamps/stamp-configure-$(build): + dh_testdir + rm -rf build-$(build) + mkdir build-$(build) + cd build-$(build) && \ + CC="$(CC)" \ + CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ + YACC="$(YACC)" \ + ../$(bash_src)/configure $(configure_args) + if ! grep -q '#define HAVE_DEV_STDIN 1' build-$(build)/config.h; then \ + echo "HAVE_DEV_STDIN not defined, abortig build"; \ + exit 1; \ + fi + touch stamps/stamp-configure-$(build) + +update-patches: + export QUILT_PATCHES=$(patchdir); \ + export QUILT_REFRESH_ARGS="--no-timestamps --no-index -p ab"; \ + export QUILT_DIFF_ARGS="--no-timestamps --no-index -p ab"; \ + while quilt push; do quilt refresh; done + +#unpack-$(bash_src): stamps/stamp-unpack-$(bash_src) +#stamps/stamp-unpack-$(bash_src): +# mkdir -p stamps +# rm -rf bash-$(VERSION) $(bash_src) +# rm -f stamps/stamp-patch-$(bash_src){,-*} +# tar xf bash-$(VERSION)*.tar.xz +# mv bash-$(VERSION) $(bash_src) +# rm -f bash/y.tab.? +# cp -p /usr/share/misc/config.* $(bash_src)/. +# cp -p /usr/share/misc/config.* $(bash_src)/support/. +# touch stamps/stamp-unpack-$(bash_src) + +remove-non-dfsg-files: + rm -f doc/article.* + rm -f doc/FAQ + rm -f doc/aosa-bash.pdf + rm -f doc/rose94.* + +.NOTPARALLEL: build +.PHONY: unpack binary binary-arch binary-indep clean \ + build bash-build static-build preinst-build \ + check \ + bash-configure static-configure \ + binary-doc binary-bash binary-builtins binary-static \ + install bash-install + +# Local Variables: +# mode: makefile +# end: diff --git a/debian/run-my-gprof b/debian/run-my-gprof new file mode 100644 index 0000000..7a495ba --- /dev/null +++ b/debian/run-my-gprof @@ -0,0 +1,32 @@ +#! /bin/sh + +PATH=.:$PATH # just to get recho/zecho/printenv if not run via `make tests' +export PATH + +# unset BASH_ENV only if it is set +[ "${BASH_ENV+set}" = "set" ] && unset BASH_ENV +# ditto for SHELLOPTS +#[ "${SHELLOPTS+set}" = "set" ] && unset SHELLOPTS + +: ${THIS_SH:=../bash} +export THIS_SH + +${THIS_SH} ./version + +rm -f /tmp/xx + +echo Any output from any test, unless otherwise noted, indicates a possible anomaly + +echo Running tests as test load ... + +for x in run-* +do + case $x in + $0|run-minimal|run-gprof|run-all) ;; + run-jobs|run-gprof) echo SKIP $x ;; + *.orig|*~) ;; + *) echo $x ; sh $x ;; + esac +done + +exit 0 diff --git a/debian/skel.bash_logout b/debian/skel.bash_logout new file mode 100644 index 0000000..de4f5f7 --- /dev/null +++ b/debian/skel.bash_logout @@ -0,0 +1,7 @@ +# ~/.bash_logout: executed by bash(1) when login shell exits. + +# when leaving the console clear the screen to increase privacy + +if [ "$SHLVL" = 1 ]; then + [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q +fi diff --git a/debian/skel.bashrc b/debian/skel.bashrc new file mode 100644 index 0000000..9346dd0 --- /dev/null +++ b/debian/skel.bashrc @@ -0,0 +1,113 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +#shopt -s globstar + +# make less more friendly for non-text input files, see lesspipe(1) +#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +#force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + #alias dir='dir --color=auto' + #alias vdir='vdir --color=auto' + + #alias grep='grep --color=auto' + #alias fgrep='fgrep --color=auto' + #alias egrep='egrep --color=auto' +fi + +# colored GCC warnings and errors +#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' + +# some more ls aliases +#alias ll='ls -l' +#alias la='ls -A' +#alias l='ls -CF' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi diff --git a/debian/skel.profile b/debian/skel.profile new file mode 100644 index 0000000..c9db459 --- /dev/null +++ b/debian/skel.profile @@ -0,0 +1,22 @@ +# ~/.profile: executed by the command interpreter for login shells. +# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login +# exists. +# see /usr/share/doc/bash/examples/startup-files for examples. +# the files are located in the bash-doc package. + +# the default umask is set in /etc/profile; for setting the umask +# for ssh logins, install and configure the libpam-umask package. +#umask 022 + +# if running bash +if [ -n "$BASH_VERSION" ]; then + # include .bashrc if it exists + if [ -f "$HOME/.bashrc" ]; then + . "$HOME/.bashrc" + fi +fi + +# set PATH so it includes user's private bin if it exists +if [ -d "$HOME/bin" ] ; then + PATH="$HOME/bin:$PATH" +fi diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides new file mode 100644 index 0000000..1b45adf --- /dev/null +++ b/debian/source/lintian-overrides @@ -0,0 +1,2 @@ +# No texinfo file has a gfdl with an invariant or cover text +bash source: license-problem-gfdl-invariants diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..dd1998d --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=2 +ftp://ftp.gnu.org/gnu/bash/bash-([\d\.]*).tar.gz debian uupdate diff --git a/dispose_cmd.c b/dispose_cmd.c new file mode 100644 index 0000000..c624605 --- /dev/null +++ b/dispose_cmd.c @@ -0,0 +1,342 @@ +/* dispose_command.c -- dispose of a COMMAND structure. */ + +/* Copyright (C) 1987-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" +#include "shell.h" + +extern sh_obj_cache_t wdcache, wlcache; + +/* Dispose of the command structure passed. */ +void +dispose_command (command) + COMMAND *command; +{ + if (command == 0) + return; + + if (command->redirects) + dispose_redirects (command->redirects); + + switch (command->type) + { + case cm_for: +#if defined (SELECT_COMMAND) + case cm_select: +#endif + { + register FOR_COM *c; +#if defined (SELECT_COMMAND) + if (command->type == cm_select) + c = (FOR_COM *)command->value.Select; + else +#endif + c = command->value.For; + dispose_word (c->name); + dispose_words (c->map_list); + dispose_command (c->action); + free (c); + break; + } + +#if defined (ARITH_FOR_COMMAND) + case cm_arith_for: + { + register ARITH_FOR_COM *c; + + c = command->value.ArithFor; + dispose_words (c->init); + dispose_words (c->test); + dispose_words (c->step); + dispose_command (c->action); + free (c); + break; + } +#endif /* ARITH_FOR_COMMAND */ + + case cm_group: + { + dispose_command (command->value.Group->command); + free (command->value.Group); + break; + } + + case cm_subshell: + { + dispose_command (command->value.Subshell->command); + free (command->value.Subshell); + break; + } + + case cm_coproc: + { + free (command->value.Coproc->name); + dispose_command (command->value.Coproc->command); + free (command->value.Coproc); + break; + } + + case cm_case: + { + register CASE_COM *c; + PATTERN_LIST *t, *p; + + c = command->value.Case; + dispose_word (c->word); + + for (p = c->clauses; p; ) + { + dispose_words (p->patterns); + dispose_command (p->action); + t = p; + p = p->next; + free (t); + } + free (c); + break; + } + + case cm_until: + case cm_while: + { + register WHILE_COM *c; + + c = command->value.While; + dispose_command (c->test); + dispose_command (c->action); + free (c); + break; + } + + case cm_if: + { + register IF_COM *c; + + c = command->value.If; + dispose_command (c->test); + dispose_command (c->true_case); + dispose_command (c->false_case); + free (c); + break; + } + + case cm_simple: + { + register SIMPLE_COM *c; + + c = command->value.Simple; + dispose_words (c->words); + dispose_redirects (c->redirects); + free (c); + break; + } + + case cm_connection: + { + register CONNECTION *c; + + c = command->value.Connection; + dispose_command (c->first); + dispose_command (c->second); + free (c); + break; + } + +#if defined (DPAREN_ARITHMETIC) + case cm_arith: + { + register ARITH_COM *c; + + c = command->value.Arith; + dispose_words (c->exp); + free (c); + break; + } +#endif /* DPAREN_ARITHMETIC */ + +#if defined (COND_COMMAND) + case cm_cond: + { + register COND_COM *c; + + c = command->value.Cond; + dispose_cond_node (c); + break; + } +#endif /* COND_COMMAND */ + + case cm_function_def: + { + register FUNCTION_DEF *c; + + c = command->value.Function_def; + dispose_function_def (c); + break; + } + + default: + command_error ("dispose_command", CMDERR_BADTYPE, command->type, 0); + break; + } + free (command); +} + +#if defined (COND_COMMAND) +/* How to free a node in a conditional command. */ +void +dispose_cond_node (cond) + COND_COM *cond; +{ + if (cond) + { + if (cond->left) + dispose_cond_node (cond->left); + if (cond->right) + dispose_cond_node (cond->right); + if (cond->op) + dispose_word (cond->op); + free (cond); + } +} +#endif /* COND_COMMAND */ + +void +dispose_function_def_contents (c) + FUNCTION_DEF *c; +{ + dispose_word (c->name); + dispose_command (c->command); + FREE (c->source_file); +} + +void +dispose_function_def (c) + FUNCTION_DEF *c; +{ + dispose_function_def_contents (c); + free (c); +} + +/* How to free a WORD_DESC. */ +void +dispose_word (w) + WORD_DESC *w; +{ + FREE (w->word); + ocache_free (wdcache, WORD_DESC, w); +} + +/* Free a WORD_DESC, but not the word contained within. */ +void +dispose_word_desc (w) + WORD_DESC *w; +{ + w->word = 0; + ocache_free (wdcache, WORD_DESC, w); +} + +/* How to get rid of a linked list of words. A WORD_LIST. */ +void +dispose_words (list) + WORD_LIST *list; +{ + WORD_LIST *t; + + while (list) + { + t = list; + list = list->next; + dispose_word (t->word); +#if 0 + free (t); +#else + ocache_free (wlcache, WORD_LIST, t); +#endif + } +} + +#ifdef INCLUDE_UNUSED +/* How to dispose of an array of pointers to char. This is identical to + free_array in stringlib.c. */ +void +dispose_word_array (array) + char **array; +{ + register int count; + + if (array == 0) + return; + + for (count = 0; array[count]; count++) + free (array[count]); + + free (array); +} +#endif + +/* How to dispose of an list of redirections. A REDIRECT. */ +void +dispose_redirects (list) + REDIRECT *list; +{ + register REDIRECT *t; + + while (list) + { + t = list; + list = list->next; + + if (t->rflags & REDIR_VARASSIGN) + dispose_word (t->redirector.filename); + + switch (t->instruction) + { + case r_reading_until: + case r_deblank_reading_until: + free (t->here_doc_eof); + /*FALLTHROUGH*/ + case r_reading_string: + case r_output_direction: + case r_input_direction: + case r_inputa_direction: + case r_appending_to: + case r_err_and_out: + case r_append_err_and_out: + case r_input_output: + case r_output_force: + case r_duplicating_input_word: + case r_duplicating_output_word: + case r_move_input_word: + case r_move_output_word: + dispose_word (t->redirectee.filename); + /* FALLTHROUGH */ + default: + break; + } + free (t); + } +} diff --git a/dispose_cmd.h b/dispose_cmd.h new file mode 100644 index 0000000..0a3889c --- /dev/null +++ b/dispose_cmd.h @@ -0,0 +1,40 @@ +/* dispose_cmd.h -- Functions appearing in dispose_cmd.c. */ + +/* Copyright (C) 1993-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_DISPOSE_CMD_H_) +#define _DISPOSE_CMD_H_ + +#include "stdc.h" + +extern void dispose_command __P((COMMAND *)); +extern void dispose_word_desc __P((WORD_DESC *)); +extern void dispose_word __P((WORD_DESC *)); +extern void dispose_words __P((WORD_LIST *)); +extern void dispose_word_array __P((char **)); +extern void dispose_redirects __P((REDIRECT *)); + +#if defined (COND_COMMAND) +extern void dispose_cond_node __P((COND_COM *)); +#endif + +extern void dispose_function_def_contents __P((FUNCTION_DEF *)); +extern void dispose_function_def __P((FUNCTION_DEF *)); + +#endif /* !_DISPOSE_CMD_H_ */ diff --git a/doc/INTRO b/doc/INTRO new file mode 100644 index 0000000..29f208a --- /dev/null +++ b/doc/INTRO @@ -0,0 +1,187 @@ + BASH - The Bourne-Again Shell + +Bash is the shell, or command language interpreter, that will appear +in the GNU operating system. Bash is an sh-compatible shell that +incorporates useful features from the Korn shell (ksh) and C shell +(csh). It is intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 +Shell and Tools standard. It offers functional improvements over sh +for both programming and interactive use. In addition, most sh scripts +can be run by Bash without modification. + +Bash is quite portable. It uses a configuration system that discovers +characteristics of the compilation platform at build time, and may +therefore be built on nearly every version of UNIX. Ports to +UNIX-like systems such as QNX and Minix and to non-UNIX systems such +as OS/2, Windows 95, and Windows NT are available. + +Bash includes the following features: + +Editing and Completion + +Bash offers a command-line editing facility which permits users to +edit command lines using familiar emacs or vi-style editing commands. +Editing allows corrections to be made without having to erase back +to the point of error or start the command line anew. The editing +facilities include a feature that allows users to complete command and +file names. + +The Bash line editing library is fully customizable. Users may define +their own key bindings -- the action taken when a key is pressed. A +number of variables to fine-tune editing behavior are also available. + +History and Command Re-entry + +The Bash history feature remembers commands entered to the shell and +allows them to be recalled and re-executed. The history list may be +of unlimited size. Bash allows users to search for previous commands +and reuse portions of those commands when composing new ones. The +history list may be saved across shell sessions. + +Bash allows users to control which commands are saved on the history +list. + +Job Control + +On systems that support it, Bash provides an interface to the +operating system's job control facilities, which allow processes +to be suspended and restarted, and moved between the foreground +and background. Bash allows users to selectively `forget' about +background jobs. + +Shell Functions and Aliases + +These mechanisms are available to bind a user-selected identifier to a +list of commands that will be executed when the identifier is used as +a command name. Functions allow local variables and recursion, and +have access to the environment of the calling shell. Aliases may be +used to create a mnemonic for a command name, expand a single word to +a complex command, or ensure that a command is called with a basic set +of options. + +Arrays + +Bash-2.0 supports indexed arrays of unlimited size. The subscript for +an array is an arithmetic expression. Arrays may be assigned to with +a new compound assignment syntax, and several builtins have options to +operate on array variables. Bash includes a number of built-in array +variables. + +Arithmetic + +Bash allows users to perform integer arithmetic in any base from two +to sixty-four. Nearly all of the C language arithmetic operators are +available with the same syntax and precedence as in C. Arithmetic +expansion allows an arithmetic expression to be evaluated and the +result substituted into the command line. Shell variables can be used +as operands, and the value of an expression may be assigned to a +variable. + +An arithmetic expression may be used as a command; the exit status of +the command is the value of the expression. + +ANSI-C Quoting + +There is a new quoting syntax that allows backslash-escaped characters +in strings to be expanded according to the ANSI C standard. + +Tilde Expansion + +Users' home directories may be expanded using this feature. Words +beginning with a tilde may also be expanded to the current or previous +working directory. + +Brace Expansion + +Brace expansion is a convenient way to generate a list of strings that +share a common prefix or suffix. + +Substring Capabilities + +Bash allows new strings to be created by removing leading or trailing +substrings from existing variable values, or by specifying a starting +offset and length. Portions of variable values may be matched against +shell patterns and the matching portion removed or a new value +substituted. + +Indirect Variable Expansion + +Bash makes it easy to find the value of a shell variable whose name is +the value of another variable. + +Expanded I/O Capabilities + +Bash provides several input and output features not available in sh, +including the ability to: + + o specify a file or file descriptor for both input and output + o read from or write to asynchronous processes using named pipes + o read lines ending in backslash + o display a prompt on the terminal before a read + o format menus and interpret responses to them + o echo lines exactly as input without escape processing + +Control of Builtin Commands + +Bash implements several builtin commands to give users more control +over which commands are executed. The enable builtin allows other +builtin commands to be selectively enabled or disabled. The command +and builtin builtins change the order in which the shell searches for +commands. + +On systems that provide dynamic loading, new builtins may be loaded +into a running shell from a shared object file. These new builtins +have access to all of the shell facilities. + +Help + +Bash includes a built-in help facility. + +Shell Optional Behavior + +There is a great deal of customizable shell behavior. The shopt +builtin command provides a unified interface that allows users to +alter shell defaults. + +Prompt Customization + +Bash allows the primary and secondary prompts to be customized by +interpreting a number of backslash-escaped special characters. +Parameter and variable expansion is also performed on the values of +the primary and secondary prompt strings before they are displayed. + +Security + +Bash provides a restricted shell environment. It is also possible to +control the execution of setuid/setgid scripts. + +Directory Stack + +Bash provides a `directory stack', to which directories may be added +and removed. The current directory may be changed to any directory in +the stack. It is easy to toggle between two directories in the stack. +The directory stack may be saved and restored across different shell +invocations. + +POSIX Mode + +Bash is nearly completely conformant to POSIX.2. POSIX mode changes +those few areas where the Bash default behavior differs from the +standard to match the standard. In POSIX mode, Bash is POSIX.2 +compliant. + +Internationalization + +Bash provides a new quoting syntax that allows strings to be +translated according to the current locale. The locale in which the +shell itself runs may also be changed, so that the shell messages +themselves may be language-specific. + +The command-line editing facilities allow the input of eight-bit +characters, so most of the ISO-8859 family of character sets are +supported. + +Command Timing + +Bash allows external commands, shell builtin commands and shell functions +to be timed. The format used to display the timing information may be +changed by the user. diff --git a/doc/Makefile.in b/doc/Makefile.in new file mode 100644 index 0000000..db149c7 --- /dev/null +++ b/doc/Makefile.in @@ -0,0 +1,316 @@ +# This Makefile is for the Bash/documentation directory -*- text -*-. +# +# Copyright (C) 2003-2013 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +PACKAGE = @PACKAGE_NAME@ +VERSION = @PACKAGE_VERSION@ + +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_VERSION = @PACKAGE_VERSION@ + +PACKAGE_TARNAME = @PACKAGE_TARNAME@ + +# +SHELL = @MAKE_SHELL@ +RM = rm -f + +topdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = .:@srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +datarootdir = @datarootdir@ + +infodir = @infodir@ + +docdir = @docdir@ + +# set this to a directory name to have the HTML files installed +htmldir = @htmldir@ + +# Support an alternate destination root directory for package building +DESTDIR = + +mandir = @mandir@ +manpfx = man + +man1ext = .1 +man1dir = $(mandir)/$(manpfx)1 +man3ext = .3 +man3dir = $(mandir)/$(manpfx)3 + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +BUILD_DIR = @BUILD_DIR@ + +SUPPORT_SRCDIR = $(topdir)/support + +# bad style +RL_LIBDIR = $(topdir)/lib/readline + +# unused +TEXINDEX = texindex +TEX = tex + +MAKEINFO = makeinfo +TEXI2DVI = texi2dvi +TEXI2HTML = texi2html +MAN2HTML = ${BUILD_DIR}/support/man2html +HTMLPOST = ${srcdir}/htmlpost.sh +INFOPOST = ${srcdir}/infopost.sh +QUIETPS = #set this to -q to shut up dvips +PAPERSIZE = letter # change to a4 for A4-size paper +PSDPI = 600 # could be 300 if you like +DVIPS = dvips -D ${PSDPI} $(QUIETPS) -t ${PAPERSIZE} -o $@ # tricky + +TEXINPUTDIR = $(RL_LIBDIR)/doc +SET_TEXINPUTS = TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS + +# These tools might not be available; they're not required +DVIPDF = dvipdfm -o $@ -p ${PAPERSIZE} +PSPDF = gs -sPAPERSIZE=${PAPERSIZE} -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -sOutputFile=$@ + +MKDIRS = ${SUPPORT_SRCDIR}/mkdirs + +# This should be a program that converts troff to an ascii-readable format +NROFF = groff -Tascii + +# This should be a program that converts troff to postscript +GROFF = groff + +HSUSER = $(RL_LIBDIR)/doc/hsuser.texi +RLUSER = $(RL_LIBDIR)/doc/rluser.texi + +BASHREF_FILES = $(srcdir)/bashref.texi $(srcdir)/fdl.texi $(srcdir)/version.texi + +.SUFFIXES: .0 .1 .3 .ms .ps .txt .dvi .html .pdf + +.1.ps: + $(RM) $@ + -${GROFF} -man $< > $@ + +.1.0: + $(RM) $@ + -${NROFF} -man $< > $@ + +.1.html: + $(RM) $@ + -${MAN2HTML} $< | ${HTMLPOST} > $@ + +.ms.ps: + $(RM) $@ + -${GROFF} -ms $< > $@ + +.ms.txt: + $(RM) $@ + -${NROFF} -ms $< > $@ + +.3.ps: + $(RM) $@ + -${GROFF} -man $< > $@ + +.3.0: + $(RM) $@ + -${NROFF} -man $< > $@ + +.3.html: + $(RM) $@ + -${MAN2HTML} $< > $@ + +.ps.pdf: + $(RM) $@ + -${PSPDF} $< + +.dvi.pdf: + $(RM) $@ + -${DVIPDF} $< + +.dvi.ps: + ${RM} $@ + -${DVIPS} $< + +all: ps info dvi text html +nodvi: ps info text html +everything: all pdf + +PSFILES = bash.ps bashbug.ps article.ps builtins.ps rbash.ps +DVIFILES = bashref.dvi bashref.ps +INFOFILES = bashref.info +MAN0FILES = bash.0 bashbug.0 builtins.0 rbash.0 +HTMLFILES = bashref.html bash.html +PDFFILES = bash.pdf bashref.pdf article.pdf rose94.pdf + +ps: ${PSFILES} +dvi: ${DVIFILES} +info: ${INFOFILES} +text: ${MAN0FILES} +html: ${HTMLFILES} +pdf: ${PDFFILES} + +bashref.dvi: $(BASHREF_FILES) $(HSUSER) $(RLUSER) + ${SET_TEXINPUTS} $(TEXI2DVI) $(srcdir)/bashref.texi || { ${RM} $@ ; exit 1; } + +bashref.info: $(BASHREF_FILES) $(HSUSER) $(RLUSER) + $(MAKEINFO) --no-split -I$(TEXINPUTDIR) $(srcdir)/bashref.texi + +# can also use: +# $(MAKEINFO) --html --no-split -I$(TEXINPUTDIR) $(srcdir)/bashref.texi +bashref.html: $(BASHREF_FILES) $(HSUSER) $(RLUSER) + $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/bashref.texi + +bash.info: bashref.info + ${SHELL} ${INFOPOST} < $(srcdir)/bashref.info > $@ ; \ + +bash.txt: bash.1 +bash.ps: bash.1 +bash.html: bash.1 $(MAN2HTML) +bashbug.ps: bashbug.1 +builtins.ps: builtins.1 bash.1 +rbash.ps: rbash.1 bash.1 +bash.0: bash.1 +bashbug.0: bashbug.1 +builtins.0: builtins.1 bash.1 +rbash.0: rbash.1 bash.1 +article.ps: article.ms + +bashref.ps: bashref.dvi + +article.pdf: article.ps +bashref.pdf: bashref.dvi +bash.pdf: bash.ps +rose94.pdf: rose94.ps + +OTHER_DOCS = $(srcdir)/FAQ $(srcdir)/INTRO +OTHER_INSTALLED_DOCS = FAQ INTRO + +$(MAN2HTML): ${topdir}/support/man2html.c + -( cd ${BUILD_DIR}/support ; ${MAKE} ${MFLAGS} man2html) + +clean: + $(RM) *.aux *.bak *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps \ + *.pgs *.bt *.bts *.rw *.rws *.fns *.kys *.tps *.vrs *.o + ${RM} core *.core + +mostlyclean: clean + $(RM) Makefile + +distclean: clean maybe-clean + $(RM) Makefile + +maintainer-clean: clean + ${RM} ${PSFILES} ${DVIFILES} ${INFOFILES} ${MAN0FILES} ${HTMLFILES} + ${RM} ${CREATED_FAQ} + $(RM) Makefile + +maybe-clean: + -if test "X$(topdir)" != "X$(BUILD_DIR)"; then \ + $(RM) ${PSFILES} ${DVIFILES} ${INFOFILES} ${MAN0FILES} ${HTMLFILES}; \ + fi + +installdirs: + -$(SHELL) $(SUPPORT_SRCDIR)/mkinstalldirs $(DESTDIR)$(man1dir) + -$(SHELL) $(SUPPORT_SRCDIR)/mkinstalldirs $(DESTDIR)$(infodir) + -$(SHELL) $(SUPPORT_SRCDIR)/mkinstalldirs $(DESTDIR)$(docdir) + -if test -n "$(htmldir)" ; then \ + $(SHELL) $(SUPPORT_SRCDIR)/mkinstalldirs $(DESTDIR)$(htmldir) ; \ + fi + +install: info installdirs bash.info + -$(INSTALL_DATA) $(srcdir)/bash.1 $(DESTDIR)$(man1dir)/bash${man1ext} + -$(INSTALL_DATA) $(srcdir)/bashbug.1 $(DESTDIR)$(man1dir)/bashbug${man1ext} + -$(INSTALL_DATA) $(OTHER_DOCS) $(DESTDIR)$(docdir) +# uncomment the next lines to install the builtins man page +# sed 's:bash\.1:man1/&:' $(srcdir)/builtins.1 > $${TMPDIR:-/var/tmp}/builtins.1 +# -$(INSTALL_DATA) $${TMPDIR:-/var/tmp}/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext} +# -$(RM) $${TMPDIR:-/var/tmp}/builtins.1 + -if test -f bash.info; then d=.; else d=$(srcdir); fi; \ + $(INSTALL_DATA) $$d/bash.info $(DESTDIR)$(infodir)/bash.info +# run install-info if it is present to update the info directory + if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ + install-info --dir-file=$(DESTDIR)$(infodir)/dir $(DESTDIR)$(infodir)/bash.info; \ + else true; fi +# if htmldir is set, install the html files into that directory + -if test -n "${htmldir}" ; then \ + $(INSTALL_DATA) $(srcdir)/bash.html $(DESTDIR)$(htmldir) ; \ + $(INSTALL_DATA) $(srcdir)/bashref.html $(DESTDIR)$(htmldir) ; \ + fi + +install_builtins: installdirs + sed 's:bash\.1:man1/&:' $(srcdir)/builtins.1 > $${TMPDIR:-/var/tmp}/builtins.1 + -$(INSTALL_DATA) $${TMPDIR:-/var/tmp}/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext} + -$(RM) $${TMPDIR:-/var/tmp}/builtins.1 + +install_everything: install install_builtins + +uninstall: + -$(RM) $(DESTDIR)$(man1dir)/bash${man1ext} $(DESTDIR)$(man1dir)/bashbug${man1ext} + -$(RM) $(DESTDIR)$(man1dir)/bash_builtins${man1ext} + $(RM) $(DESTDIR)$(infodir)/bash.info + -( cd $(DESTDIR)$(docdir) && $(RM) $(OTHER_INSTALLED_DOCS) ) + -if test -n "$(htmldir)" ; then \ + $(RM) $(DESTDIR)$(htmldir)/bash.html ; \ + $(RM) $(DESTDIR)$(htmldir)/bashref.html ; \ + fi + +# for use by chet +CREATED_FAQ = faq.news faq.news2 faq.mail faq.version + +faq: ${CREATED_FAQ} + +faq.version: FAQ.version FAQ + sh mkfaqvers FAQ.version > $@ + +faq.headers.mail: FAQ.headers.mail FAQ + sh mkfaqvers FAQ.headers.mail > $@ + +faq.headers.news: FAQ.headers.news FAQ + sh mkfaqvers FAQ.headers.news > $@ + +faq.headers.news2: FAQ.headers.news2 FAQ + sh mkfaqvers FAQ.headers.news2 > $@ + +faq.news: FAQ faq.headers.news faq.version + $(RM) $@ + cat faq.headers.news faq.version FAQ > $@ + +faq.news2: FAQ faq.headers.news2 faq.version + $(RM) $@ + cat faq.headers.news2 faq.version FAQ > $@ + +faq.mail: FAQ faq.headers.mail faq.version + $(RM) $@ + cat faq.headers.mail faq.version FAQ > $@ + +inst: bashref.texi + $(SHELL) ./mkinstall + cmp -s INSTALL ../INSTALL || mv INSTALL ../INSTALL + $(RM) INSTALL + +posix: bashref.texi + $(SHELL) ./mkposix + cmp -s POSIX ../POSIX || mv POSIX ../POSIX + $(RM) POSIX + +rbash: bashref.texi + $(SH) ./mkrbash + cmp -s RBASH ../RBASH || mv RBASH ../RBASH + $(RM) RBASH + +xdist: pdf inst posix rbash diff --git a/doc/README b/doc/README new file mode 100644 index 0000000..e3a1d24 --- /dev/null +++ b/doc/README @@ -0,0 +1,36 @@ +This directory contains the bash documentation. + +FAQ - a set of frequently-asked questions about Bash with answers +INTRO - a short introduction to bash +article.ms - an article I wrote about bash for The Linux Journal +bash.1 - the bash man page +builtins.1 - a man page that documents the builtins, extracted from bash.1 +bashref.texi - the `bash reference manual' +bashref.info - the `bash reference manual' processed by `makeinfo' +readline.3 - the readline man page + +The `.ps' files are postscript versions of the above. The `.html' +files are HTML versions of the man page and reference manual. The +`.0' files are formatted manual pages. The `.txt' versions are +ascii -- the output of `groff -Tascii'. + +The rest of this file explains how to use the `builtins.1' man page. + +For each command in the list of builtins create a file in man/man1 called: + +${command}.1 + +eg. +for.1 +type.1 +alias.1 +etc. + +All these files are identical as follows: + +jaws@jaws(264)$ cat alias.1 +.so man1/builtins.1 +jaws@jaws(265)$ + +Make sure you adjust the .so line in builtins.1 to reflect where you +put it. diff --git a/doc/bash.0 b/doc/bash.0 new file mode 100644 index 0000000..c3b29b5 --- /dev/null +++ b/doc/bash.0 @@ -0,0 +1,5729 @@ +BASH(1) BASH(1) + + + +NNAAMMEE + bash - GNU Bourne-Again SHell + +SSYYNNOOPPSSIISS + bbaasshh [options] [command_string | file] + +CCOOPPYYRRIIGGHHTT + Bash is Copyright (C) 1989-2013 by the Free Software Foundation, Inc. + +DDEESSCCRRIIPPTTIIOONN + BBaasshh is an sshh-compatible command language interpreter that executes + commands read from the standard input or from a file. BBaasshh also incor- + porates useful features from the _K_o_r_n and _C shells (kksshh and ccsshh). + + BBaasshh is intended to be a conformant implementation of the Shell and + Utilities portion of the IEEE POSIX specification (IEEE Standard + 1003.1). BBaasshh can be configured to be POSIX-conformant by default. + +OOPPTTIIOONNSS + All of the single-character shell options documented in the descrip- + tion of the sseett builtin command can be used as options when the shell + is invoked. In addition, bbaasshh interprets the following options when it + is invoked: + + --cc If the --cc option is present, then commands are read from the + first non-option argument _c_o_m_m_a_n_d___s_t_r_i_n_g. If there are argu- + ments after the _c_o_m_m_a_n_d___s_t_r_i_n_g, they are assigned to the + positional parameters, starting with $$00. + --ii If the --ii option is present, the shell is _i_n_t_e_r_a_c_t_i_v_e. + --ll Make bbaasshh act as if it had been invoked as a login shell (see + IINNVVOOCCAATTIIOONN below). + --rr If the --rr option is present, the shell becomes _r_e_s_t_r_i_c_t_e_d + (see RREESSTTRRIICCTTEEDD SSHHEELLLL below). + --ss If the --ss option is present, or if no arguments remain after + option processing, then commands are read from the standard + input. This option allows the positional parameters to be + set when invoking an interactive shell. + --DD A list of all double-quoted strings preceded by $$ is printed + on the standard output. These are the strings that are sub- + ject to language translation when the current locale is not CC + or PPOOSSIIXX. This implies the --nn option; no commands will be + executed. + [[--++]]OO [[_s_h_o_p_t___o_p_t_i_o_n]] + _s_h_o_p_t___o_p_t_i_o_n is one of the shell options accepted by the + sshhoopptt builtin (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). If + _s_h_o_p_t___o_p_t_i_o_n is present, --OO sets the value of that option; ++OO + unsets it. If _s_h_o_p_t___o_p_t_i_o_n is not supplied, the names and + values of the shell options accepted by sshhoopptt are printed on + the standard output. If the invocation option is ++OO, the + output is displayed in a format that may be reused as input. + ---- A ---- signals the end of options and disables further option + processing. Any arguments after the ---- are treated as file- + names and arguments. An argument of -- is equivalent to ----. + + BBaasshh also interprets a number of multi-character options. These + options must appear on the command line before the single-character + options to be recognized. + + ----ddeebbuuggggeerr + Arrange for the debugger profile to be executed before the shell + starts. Turns on extended debugging mode (see the description + of the eexxttddeebbuugg option to the sshhoopptt builtin below). + ----dduummpp--ppoo--ssttrriinnggss + Equivalent to --DD, but the output is in the GNU _g_e_t_t_e_x_t ppoo (por- + table object) file format. + ----dduummpp--ssttrriinnggss + Equivalent to --DD. + ----hheellpp Display a usage message on standard output and exit success- + fully. + ----iinniitt--ffiillee _f_i_l_e + ----rrccffiillee _f_i_l_e + Execute commands from _f_i_l_e instead of the standard personal ini- + tialization file _~_/_._b_a_s_h_r_c if the shell is interactive (see + IINNVVOOCCAATTIIOONN below). + + ----llooggiinn + Equivalent to --ll. + + ----nnooeeddiittiinngg + Do not use the GNU rreeaaddlliinnee library to read command lines when + the shell is interactive. + + ----nnoopprrooffiillee + Do not read either the system-wide startup file _/_e_t_c_/_p_r_o_f_i_l_e or + any of the personal initialization files _~_/_._b_a_s_h___p_r_o_f_i_l_e, + _~_/_._b_a_s_h___l_o_g_i_n, or _~_/_._p_r_o_f_i_l_e. By default, bbaasshh reads these + files when it is invoked as a login shell (see IINNVVOOCCAATTIIOONN + below). + + ----nnoorrcc Do not read and execute the personal initialization file + _~_/_._b_a_s_h_r_c if the shell is interactive. This option is on by + default if the shell is invoked as sshh. + + ----ppoossiixx + Change the behavior of bbaasshh where the default operation differs + from the POSIX standard to match the standard (_p_o_s_i_x _m_o_d_e). See + SSEEEE AALLSSOO below for a reference to a document that details how + posix mode affects bash's behavior. + + ----rreessttrriicctteedd + The shell becomes restricted (see RREESSTTRRIICCTTEEDD SSHHEELLLL below). + + ----vveerrbboossee + Equivalent to --vv. + + ----vveerrssiioonn + Show version information for this instance of bbaasshh on the stan- + dard output and exit successfully. + +AARRGGUUMMEENNTTSS + If arguments remain after option processing, and neither the --cc nor the + --ss option has been supplied, the first argument is assumed to be the + name of a file containing shell commands. If bbaasshh is invoked in this + fashion, $$00 is set to the name of the file, and the positional parame- + ters are set to the remaining arguments. BBaasshh reads and executes com- + mands from this file, then exits. BBaasshh's exit status is the exit sta- + tus of the last command executed in the script. If no commands are + executed, the exit status is 0. An attempt is first made to open the + file in the current directory, and, if no file is found, then the shell + searches the directories in PPAATTHH for the script. + +IINNVVOOCCAATTIIOONN + A _l_o_g_i_n _s_h_e_l_l is one whose first character of argument zero is a --, or + one started with the ----llooggiinn option. + + An _i_n_t_e_r_a_c_t_i_v_e shell is one started without non-option arguments and + without the --cc option whose standard input and error are both connected + to terminals (as determined by _i_s_a_t_t_y(3)), or one started with the --ii + option. PPSS11 is set and $$-- includes ii if bbaasshh is interactive, allowing + a shell script or a startup file to test this state. + + The following paragraphs describe how bbaasshh executes its startup files. + If any of the files exist but cannot be read, bbaasshh reports an error. + Tildes are expanded in filenames as described below under TTiillddee EExxppaann-- + ssiioonn in the EEXXPPAANNSSIIOONN section. + + When bbaasshh is invoked as an interactive login shell, or as a non-inter- + active shell with the ----llooggiinn option, it first reads and executes com- + mands from the file _/_e_t_c_/_p_r_o_f_i_l_e, if that file exists. After reading + that file, it looks for _~_/_._b_a_s_h___p_r_o_f_i_l_e, _~_/_._b_a_s_h___l_o_g_i_n, and _~_/_._p_r_o_f_i_l_e, + in that order, and reads and executes commands from the first one that + exists and is readable. The ----nnoopprrooffiillee option may be used when the + shell is started to inhibit this behavior. + + When a login shell exits, bbaasshh reads and executes commands from the + file _~_/_._b_a_s_h___l_o_g_o_u_t, if it exists. + + When an interactive shell that is not a login shell is started, bbaasshh + reads and executes commands from _~_/_._b_a_s_h_r_c, if that file exists. This + may be inhibited by using the ----nnoorrcc option. The ----rrccffiillee _f_i_l_e option + will force bbaasshh to read and execute commands from _f_i_l_e instead of + _~_/_._b_a_s_h_r_c. + + When bbaasshh is started non-interactively, to run a shell script, for + example, it looks for the variable BBAASSHH__EENNVV in the environment, expands + its value if it appears there, and uses the expanded value as the name + of a file to read and execute. BBaasshh behaves as if the following com- + mand were executed: + if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi + but the value of the PPAATTHH variable is not used to search for the file- + name. + + If bbaasshh is invoked with the name sshh, it tries to mimic the startup + behavior of historical versions of sshh as closely as possible, while + conforming to the POSIX standard as well. When invoked as an interac- + tive login shell, or a non-interactive shell with the ----llooggiinn option, + it first attempts to read and execute commands from _/_e_t_c_/_p_r_o_f_i_l_e and + _~_/_._p_r_o_f_i_l_e, in that order. The ----nnoopprrooffiillee option may be used to + inhibit this behavior. When invoked as an interactive shell with the + name sshh, bbaasshh looks for the variable EENNVV, expands its value if it is + defined, and uses the expanded value as the name of a file to read and + execute. Since a shell invoked as sshh does not attempt to read and exe- + cute commands from any other startup files, the ----rrccffiillee option has no + effect. A non-interactive shell invoked with the name sshh does not + attempt to read any other startup files. When invoked as sshh, bbaasshh + enters _p_o_s_i_x mode after the startup files are read. + + When bbaasshh is started in _p_o_s_i_x mode, as with the ----ppoossiixx command line + option, it follows the POSIX standard for startup files. In this mode, + interactive shells expand the EENNVV variable and commands are read and + executed from the file whose name is the expanded value. No other + startup files are read. + + BBaasshh attempts to determine when it is being run with its standard input + connected to a network connection, as when executed by the remote shell + daemon, usually _r_s_h_d, or the secure shell daemon _s_s_h_d. If bbaasshh deter- + mines it is being run in this fashion, it reads and executes commands + from _~_/_._b_a_s_h_r_c, if that file exists and is readable. It will not do + this if invoked as sshh. The ----nnoorrcc option may be used to inhibit this + behavior, and the ----rrccffiillee option may be used to force another file to + be read, but neither _r_s_h_d nor _s_s_h_d generally invoke the shell with + those options or allow them to be specified. + + If the shell is started with the effective user (group) id not equal to + the real user (group) id, and the --pp option is not supplied, no startup + files are read, shell functions are not inherited from the environment, + the SSHHEELLLLOOPPTTSS, BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they + appear in the environment, are ignored, and the effective user id is + set to the real user id. If the --pp option is supplied at invocation, + the startup behavior is the same, but the effective user id is not + reset. + +DDEEFFIINNIITTIIOONNSS + The following definitions are used throughout the rest of this docu- + ment. + bbllaannkk A space or tab. + wwoorrdd A sequence of characters considered as a single unit by the + shell. Also known as a ttookkeenn. + nnaammee A _w_o_r_d consisting only of alphanumeric characters and under- + scores, and beginning with an alphabetic character or an under- + score. Also referred to as an iiddeennttiiffiieerr. + mmeettaacchhaarraacctteerr + A character that, when unquoted, separates words. One of the + following: + || && ;; (( )) << >> ssppaaccee ttaabb + ccoonnttrrooll ooppeerraattoorr + A _t_o_k_e_n that performs a control function. It is one of the fol- + lowing symbols: + |||| && &&&& ;; ;;;; (( )) || ||&& <> + +RREESSEERRVVEEDD WWOORRDDSS + _R_e_s_e_r_v_e_d _w_o_r_d_s are words that have a special meaning to the shell. The + following words are recognized as reserved when unquoted and either the + first word of a simple command (see SSHHEELLLL GGRRAAMMMMAARR below) or the third + word of a ccaassee or ffoorr command: + + !! ccaassee ccoopprroocc ddoo ddoonnee eelliiff eellssee eessaacc ffii ffoorr ffuunnccttiioonn iiff iinn sseelleecctt + tthheenn uunnttiill wwhhiillee {{ }} ttiimmee [[[[ ]]]] + +SSHHEELLLL GGRRAAMMMMAARR + SSiimmppllee CCoommmmaannddss + A _s_i_m_p_l_e _c_o_m_m_a_n_d is a sequence of optional variable assignments fol- + lowed by bbllaannkk-separated words and redirections, and terminated by a + _c_o_n_t_r_o_l _o_p_e_r_a_t_o_r. The first word specifies the command to be executed, + and is passed as argument zero. The remaining words are passed as + arguments to the invoked command. + + The return value of a _s_i_m_p_l_e _c_o_m_m_a_n_d is its exit status, or 128+_n if + the command is terminated by signal _n. + + PPiippeelliinneess + A _p_i_p_e_l_i_n_e is a sequence of one or more commands separated by one of + the control operators || or ||&&. The format for a pipeline is: + + [ttiimmee [--pp]] [ ! ] _c_o_m_m_a_n_d [ [|||||&&] _c_o_m_m_a_n_d_2 ... ] + + The standard output of _c_o_m_m_a_n_d is connected via a pipe to the standard + input of _c_o_m_m_a_n_d_2. This connection is performed before any redirec- + tions specified by the command (see RREEDDIIRREECCTTIIOONN below). If ||&& is used, + _c_o_m_m_a_n_d's standard error, in addition to its standard output, is con- + nected to _c_o_m_m_a_n_d_2's standard input through the pipe; it is shorthand + for 22>>&&11 ||. This implicit redirection of the standard error to the + standard output is performed after any redirections specified by the + command. + + The return status of a pipeline is the exit status of the last command, + unless the ppiippeeffaaiill option is enabled. If ppiippeeffaaiill is enabled, the + pipeline's return status is the value of the last (rightmost) command + to exit with a non-zero status, or zero if all commands exit success- + fully. If the reserved word !! precedes a pipeline, the exit status of + that pipeline is the logical negation of the exit status as described + above. The shell waits for all commands in the pipeline to terminate + before returning a value. + + If the ttiimmee reserved word precedes a pipeline, the elapsed as well as + user and system time consumed by its execution are reported when the + pipeline terminates. The --pp option changes the output format to that + specified by POSIX. When the shell is in _p_o_s_i_x _m_o_d_e, it does not rec- + ognize ttiimmee as a reserved word if the next token begins with a `-'. + The TTIIMMEEFFOORRMMAATT variable may be set to a format string that specifies + how the timing information should be displayed; see the description of + TTIIMMEEFFOORRMMAATT under SShheellll VVaarriiaabblleess below. + + When the shell is in _p_o_s_i_x _m_o_d_e, ttiimmee may be followed by a newline. In + this case, the shell displays the total user and system time consumed + by the shell and its children. The TTIIMMEEFFOORRMMAATT variable may be used to + specify the format of the time information. + + Each command in a pipeline is executed as a separate process (i.e., in + a subshell). + + LLiissttss + A _l_i_s_t is a sequence of one or more pipelines separated by one of the + operators ;;, &&, &&&&, or ||||, and optionally terminated by one of ;;, &&, or + <>. + + Of these list operators, &&&& and |||| have equal precedence, followed by ;; + and &&, which have equal precedence. + + A sequence of one or more newlines may appear in a _l_i_s_t instead of a + semicolon to delimit commands. + + If a command is terminated by the control operator &&, the shell exe- + cutes the command in the _b_a_c_k_g_r_o_u_n_d in a subshell. The shell does not + wait for the command to finish, and the return status is 0. Commands + separated by a ;; are executed sequentially; the shell waits for each + command to terminate in turn. The return status is the exit status of + the last command executed. + + AND and OR lists are sequences of one of more pipelines separated by + the &&&& and |||| control operators, respectively. AND and OR lists are + executed with left associativity. An AND list has the form + + _c_o_m_m_a_n_d_1 &&&& _c_o_m_m_a_n_d_2 + + _c_o_m_m_a_n_d_2 is executed if, and only if, _c_o_m_m_a_n_d_1 returns an exit status + of zero. + + An OR list has the form + + _c_o_m_m_a_n_d_1 |||| _c_o_m_m_a_n_d_2 + + + _c_o_m_m_a_n_d_2 is executed if and only if _c_o_m_m_a_n_d_1 returns a non-zero exit + status. The return status of AND and OR lists is the exit status of + the last command executed in the list. + + CCoommppoouunndd CCoommmmaannddss + A _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d is one of the following. In most cases a _l_i_s_t in a + command's description may be separated from the rest of the command by + one or more newlines, and may be followed by a newline in place of a + semicolon. + + (_l_i_s_t) _l_i_s_t is executed in a subshell environment (see CCOOMMMMAANNDD EEXXEECCUU-- + TTIIOONN EENNVVIIRROONNMMEENNTT below). Variable assignments and builtin com- + mands that affect the shell's environment do not remain in + effect after the command completes. The return status is the + exit status of _l_i_s_t. + + { _l_i_s_t; } + _l_i_s_t is simply executed in the current shell environment. _l_i_s_t + must be terminated with a newline or semicolon. This is known + as a _g_r_o_u_p _c_o_m_m_a_n_d. The return status is the exit status of + _l_i_s_t. Note that unlike the metacharacters (( and )), {{ and }} are + _r_e_s_e_r_v_e_d _w_o_r_d_s and must occur where a reserved word is permitted + to be recognized. Since they do not cause a word break, they + must be separated from _l_i_s_t by whitespace or another shell + metacharacter. + + ((_e_x_p_r_e_s_s_i_o_n)) + The _e_x_p_r_e_s_s_i_o_n is evaluated according to the rules described + below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. If the value of the expres- + sion is non-zero, the return status is 0; otherwise the return + status is 1. This is exactly equivalent to lleett ""_e_x_p_r_e_s_s_i_o_n"". + + [[[[ _e_x_p_r_e_s_s_i_o_n ]]]] + Return a status of 0 or 1 depending on the evaluation of the + conditional expression _e_x_p_r_e_s_s_i_o_n. Expressions are composed of + the primaries described below under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. + Word splitting and pathname expansion are not performed on the + words between the [[[[ and ]]]]; tilde expansion, parameter and + variable expansion, arithmetic expansion, command substitution, + process substitution, and quote removal are performed. Condi- + tional operators such as --ff must be unquoted to be recognized as + primaries. + + When used with [[[[, the << and >> operators sort lexicographically + using the current locale. + + When the ==== and !!== operators are used, the string to the right + of the operator is considered a pattern and matched according to + the rules described below under PPaatttteerrnn MMaattcchhiinngg, as if the eexxtt-- + gglloobb shell option were enabled. The == operator is equivalent to + ====. If the shell option nnooccaasseemmaattcchh is enabled, the match is + performed without regard to the case of alphabetic characters. + The return value is 0 if the string matches (====) or does not + match (!!==) the pattern, and 1 otherwise. Any part of the pat- + tern may be quoted to force the quoted portion to be matched as + a string. + + An additional binary operator, ==~~, is available, with the same + precedence as ==== and !!==. When it is used, the string to the + right of the operator is considered an extended regular expres- + sion and matched accordingly (as in _r_e_g_e_x(3)). The return value + is 0 if the string matches the pattern, and 1 otherwise. If the + regular expression is syntactically incorrect, the conditional + expression's return value is 2. If the shell option nnooccaasseemmaattcchh + is enabled, the match is performed without regard to the case of + alphabetic characters. Any part of the pattern may be quoted to + force the quoted portion to be matched as a string. Bracket + expressions in regular expressions must be treated carefully, + since normal quoting characters lose their meanings between + brackets. If the pattern is stored in a shell variable, quoting + the variable expansion forces the entire pattern to be matched + as a string. Substrings matched by parenthesized subexpressions + within the regular expression are saved in the array variable + BBAASSHH__RREEMMAATTCCHH. The element of BBAASSHH__RREEMMAATTCCHH with index 0 is the + portion of the string matching the entire regular expression. + The element of BBAASSHH__RREEMMAATTCCHH with index _n is the portion of the + string matching the _nth parenthesized subexpression. + + Expressions may be combined using the following operators, + listed in decreasing order of precedence: + + (( _e_x_p_r_e_s_s_i_o_n )) + Returns the value of _e_x_p_r_e_s_s_i_o_n. This may be used to + override the normal precedence of operators. + !! _e_x_p_r_e_s_s_i_o_n + True if _e_x_p_r_e_s_s_i_o_n is false. + _e_x_p_r_e_s_s_i_o_n_1 &&&& _e_x_p_r_e_s_s_i_o_n_2 + True if both _e_x_p_r_e_s_s_i_o_n_1 and _e_x_p_r_e_s_s_i_o_n_2 are true. + _e_x_p_r_e_s_s_i_o_n_1 |||| _e_x_p_r_e_s_s_i_o_n_2 + True if either _e_x_p_r_e_s_s_i_o_n_1 or _e_x_p_r_e_s_s_i_o_n_2 is true. + + The &&&& and |||| operators do not evaluate _e_x_p_r_e_s_s_i_o_n_2 if the value + of _e_x_p_r_e_s_s_i_o_n_1 is sufficient to determine the return value of + the entire conditional expression. + + ffoorr _n_a_m_e [ [ iinn [ _w_o_r_d _._._. ] ] ; ] ddoo _l_i_s_t ; ddoonnee + The list of words following iinn is expanded, generating a list of + items. The variable _n_a_m_e is set to each element of this list in + turn, and _l_i_s_t is executed each time. If the iinn _w_o_r_d is omit- + ted, the ffoorr command executes _l_i_s_t once for each positional + parameter that is set (see PPAARRAAMMEETTEERRSS below). The return status + is the exit status of the last command that executes. If the + expansion of the items following iinn results in an empty list, no + commands are executed, and the return status is 0. + + ffoorr (( _e_x_p_r_1 ; _e_x_p_r_2 ; _e_x_p_r_3 )) ; ddoo _l_i_s_t ; ddoonnee + First, the arithmetic expression _e_x_p_r_1 is evaluated according to + the rules described below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. The + arithmetic expression _e_x_p_r_2 is then evaluated repeatedly until + it evaluates to zero. Each time _e_x_p_r_2 evaluates to a non-zero + value, _l_i_s_t is executed and the arithmetic expression _e_x_p_r_3 is + evaluated. If any expression is omitted, it behaves as if it + evaluates to 1. The return value is the exit status of the last + command in _l_i_s_t that is executed, or false if any of the expres- + sions is invalid. + + sseelleecctt _n_a_m_e [ iinn _w_o_r_d ] ; ddoo _l_i_s_t ; ddoonnee + The list of words following iinn is expanded, generating a list of + items. The set of expanded words is printed on the standard + error, each preceded by a number. If the iinn _w_o_r_d is omitted, + the positional parameters are printed (see PPAARRAAMMEETTEERRSS below). + The PPSS33 prompt is then displayed and a line read from the stan- + dard input. If the line consists of a number corresponding to + one of the displayed words, then the value of _n_a_m_e is set to + that word. If the line is empty, the words and prompt are dis- + played again. If EOF is read, the command completes. Any other + value read causes _n_a_m_e to be set to null. The line read is + saved in the variable RREEPPLLYY. The _l_i_s_t is executed after each + selection until a bbrreeaakk command is executed. The exit status of + sseelleecctt is the exit status of the last command executed in _l_i_s_t, + or zero if no commands were executed. + + ccaassee _w_o_r_d iinn [ [(] _p_a_t_t_e_r_n [ || _p_a_t_t_e_r_n ] ... ) _l_i_s_t ;; ] ... eessaacc + A ccaassee command first expands _w_o_r_d, and tries to match it against + each _p_a_t_t_e_r_n in turn, using the same matching rules as for path- + name expansion (see PPaatthhnnaammee EExxppaannssiioonn below). The _w_o_r_d is + expanded using tilde expansion, parameter and variable expan- + sion, arithmetic substitution, command substitution, process + substitution and quote removal. Each _p_a_t_t_e_r_n examined is + expanded using tilde expansion, parameter and variable expan- + sion, arithmetic substitution, command substitution, and process + substitution. If the shell option nnooccaasseemmaattcchh is enabled, the + match is performed without regard to the case of alphabetic + characters. When a match is found, the corresponding _l_i_s_t is + executed. If the ;;;; operator is used, no subsequent matches are + attempted after the first pattern match. Using ;;&& in place of + ;;;; causes execution to continue with the _l_i_s_t associated with + the next set of patterns. Using ;;;;&& in place of ;;;; causes the + shell to test the next pattern list in the statement, if any, + and execute any associated _l_i_s_t on a successful match. The exit + status is zero if no pattern matches. Otherwise, it is the exit + status of the last command executed in _l_i_s_t. + + iiff _l_i_s_t; tthheenn _l_i_s_t; [ eelliiff _l_i_s_t; tthheenn _l_i_s_t; ] ... [ eellssee _l_i_s_t; ] ffii + The iiff _l_i_s_t is executed. If its exit status is zero, the tthheenn + _l_i_s_t is executed. Otherwise, each eelliiff _l_i_s_t is executed in + turn, and if its exit status is zero, the corresponding tthheenn + _l_i_s_t is executed and the command completes. Otherwise, the eellssee + _l_i_s_t is executed, if present. The exit status is the exit sta- + tus of the last command executed, or zero if no condition tested + true. + + wwhhiillee _l_i_s_t_-_1; ddoo _l_i_s_t_-_2; ddoonnee + uunnttiill _l_i_s_t_-_1; ddoo _l_i_s_t_-_2; ddoonnee + The wwhhiillee command continuously executes the list _l_i_s_t_-_2 as long + as the last command in the list _l_i_s_t_-_1 returns an exit status of + zero. The uunnttiill command is identical to the wwhhiillee command, + except that the test is negated; _l_i_s_t_-_2 is executed as long as + the last command in _l_i_s_t_-_1 returns a non-zero exit status. The + exit status of the wwhhiillee and uunnttiill commands is the exit status + of the last command executed in _l_i_s_t_-_2, or zero if none was exe- + cuted. + + CCoopprroocceesssseess + A _c_o_p_r_o_c_e_s_s is a shell command preceded by the ccoopprroocc reserved word. A + coprocess is executed asynchronously in a subshell, as if the command + had been terminated with the && control operator, with a two-way pipe + established between the executing shell and the coprocess. + + The format for a coprocess is: + + ccoopprroocc [_N_A_M_E] _c_o_m_m_a_n_d [_r_e_d_i_r_e_c_t_i_o_n_s] + + This creates a coprocess named _N_A_M_E. If _N_A_M_E is not supplied, the + default name is CCOOPPRROOCC. _N_A_M_E must not be supplied if _c_o_m_m_a_n_d is a _s_i_m_- + _p_l_e _c_o_m_m_a_n_d (see above); otherwise, it is interpreted as the first word + of the simple command. When the coprocess is executed, the shell cre- + ates an array variable (see AArrrraayyss below) named _N_A_M_E in the context of + the executing shell. The standard output of _c_o_m_m_a_n_d is connected via a + pipe to a file descriptor in the executing shell, and that file + descriptor is assigned to _N_A_M_E[0]. The standard input of _c_o_m_m_a_n_d is + connected via a pipe to a file descriptor in the executing shell, and + that file descriptor is assigned to _N_A_M_E[1]. This pipe is established + before any redirections specified by the command (see RREEDDIIRREECCTTIIOONN + below). The file descriptors can be utilized as arguments to shell + commands and redirections using standard word expansions. The file + descriptors are not available in subshells. The process ID of the + shell spawned to execute the coprocess is available as the value of the + variable _N_A_M_E_PID. The wwaaiitt builtin command may be used to wait for + the coprocess to terminate. + + Since the coprocess is created as an asynchronous command, the ccoopprroocc + command always returns success. The return status of a coprocess is + the exit status of _c_o_m_m_a_n_d. + + SShheellll FFuunnccttiioonn DDeeffiinniittiioonnss + A shell function is an object that is called like a simple command and + executes a compound command with a new set of positional parameters. + Shell functions are declared as follows: + + _n_a_m_e () _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d [_r_e_d_i_r_e_c_t_i_o_n] + ffuunnccttiioonn _n_a_m_e [()] _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d [_r_e_d_i_r_e_c_t_i_o_n] + This defines a function named _n_a_m_e. The reserved word ffuunnccttiioonn + is optional. If the ffuunnccttiioonn reserved word is supplied, the + parentheses are optional. The _b_o_d_y of the function is the com- + pound command _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d (see CCoommppoouunndd CCoommmmaannddss above). + That command is usually a _l_i_s_t of commands between { and }, but + may be any command listed under CCoommppoouunndd CCoommmmaannddss above. _c_o_m_- + _p_o_u_n_d_-_c_o_m_m_a_n_d is executed whenever _n_a_m_e is specified as the name + of a simple command. When in _p_o_s_i_x _m_o_d_e, _n_a_m_e may not be the + name of one of the POSIX _s_p_e_c_i_a_l _b_u_i_l_t_i_n_s. Any redirections + (see RREEDDIIRREECCTTIIOONN below) specified when a function is defined are + performed when the function is executed. The exit status of a + function definition is zero unless a syntax error occurs or a + readonly function with the same name already exists. When exe- + cuted, the exit status of a function is the exit status of the + last command executed in the body. (See FFUUNNCCTTIIOONNSS below.) + +CCOOMMMMEENNTTSS + In a non-interactive shell, or an interactive shell in which the iinntteerr-- + aaccttiivvee__ccoommmmeennttss option to the sshhoopptt builtin is enabled (see SSHHEELLLL + BBUUIILLTTIINN CCOOMMMMAANNDDSS below), a word beginning with ## causes that word and + all remaining characters on that line to be ignored. An interactive + shell without the iinntteerraaccttiivvee__ccoommmmeennttss option enabled does not allow + comments. The iinntteerraaccttiivvee__ccoommmmeennttss option is on by default in interac- + tive shells. + +QQUUOOTTIINNGG + _Q_u_o_t_i_n_g is used to remove the special meaning of certain characters or + words to the shell. Quoting can be used to disable special treatment + for special characters, to prevent reserved words from being recognized + as such, and to prevent parameter expansion. + + Each of the _m_e_t_a_c_h_a_r_a_c_t_e_r_s listed above under DDEEFFIINNIITTIIOONNSS has special + meaning to the shell and must be quoted if it is to represent itself. + + When the command history expansion facilities are being used (see HHIISS-- + TTOORRYY EEXXPPAANNSSIIOONN below), the _h_i_s_t_o_r_y _e_x_p_a_n_s_i_o_n character, usually !!, must + be quoted to prevent history expansion. + + There are three quoting mechanisms: the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r, single + quotes, and double quotes. + + A non-quoted backslash (\\) is the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r. It preserves the + literal value of the next character that follows, with the exception of + . If a \\ pair appears, and the backslash is not + itself quoted, the \\ is treated as a line continuation (that + is, it is removed from the input stream and effectively ignored). + + Enclosing characters in single quotes preserves the literal value of + each character within the quotes. A single quote may not occur between + single quotes, even when preceded by a backslash. + + Enclosing characters in double quotes preserves the literal value of + all characters within the quotes, with the exception of $$, ``, \\, and, + when history expansion is enabled, !!. The characters $$ and `` retain + their special meaning within double quotes. The backslash retains its + special meaning only when followed by one of the following characters: + $$, ``, "", \\, or <>. A double quote may be quoted within double + quotes by preceding it with a backslash. If enabled, history expansion + will be performed unless an !! appearing in double quotes is escaped + using a backslash. The backslash preceding the !! is not removed. + + The special parameters ** and @@ have special meaning when in double + quotes (see PPAARRAAMMEETTEERRSS below). + + Words of the form $$'_s_t_r_i_n_g' are treated specially. The word expands to + _s_t_r_i_n_g, with backslash-escaped characters replaced as specified by the + ANSI C standard. Backslash escape sequences, if present, are decoded + as follows: + \\aa alert (bell) + \\bb backspace + \\ee + \\EE an escape character + \\ff form feed + \\nn new line + \\rr carriage return + \\tt horizontal tab + \\vv vertical tab + \\\\ backslash + \\'' single quote + \\"" double quote + \\_n_n_n the eight-bit character whose value is the octal value + _n_n_n (one to three digits) + \\xx_H_H the eight-bit character whose value is the hexadecimal + value _H_H (one or two hex digits) + \\uu_H_H_H_H the Unicode (ISO/IEC 10646) character whose value is the + hexadecimal value _H_H_H_H (one to four hex digits) + \\UU_H_H_H_H_H_H_H_H + the Unicode (ISO/IEC 10646) character whose value is the + hexadecimal value _H_H_H_H_H_H_H_H (one to eight hex digits) + \\cc_x a control-_x character + + The expanded result is single-quoted, as if the dollar sign had not + been present. + + A double-quoted string preceded by a dollar sign ($$"_s_t_r_i_n_g") will cause + the string to be translated according to the current locale. If the + current locale is CC or PPOOSSIIXX, the dollar sign is ignored. If the + string is translated and replaced, the replacement is double-quoted. + +PPAARRAAMMEETTEERRSS + A _p_a_r_a_m_e_t_e_r is an entity that stores values. It can be a _n_a_m_e, a num- + ber, or one of the special characters listed below under SSppeecciiaall PPaarraamm-- + eetteerrss. A _v_a_r_i_a_b_l_e is a parameter denoted by a _n_a_m_e. A variable has a + _v_a_l_u_e and zero or more _a_t_t_r_i_b_u_t_e_s. Attributes are assigned using the + ddeeccllaarree builtin command (see ddeeccllaarree below in SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS). + + A parameter is set if it has been assigned a value. The null string is + a valid value. Once a variable is set, it may be unset only by using + the uunnsseett builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + + A _v_a_r_i_a_b_l_e may be assigned to by a statement of the form + + _n_a_m_e=[_v_a_l_u_e] + + If _v_a_l_u_e is not given, the variable is assigned the null string. All + _v_a_l_u_e_s undergo tilde expansion, parameter and variable expansion, com- + mand substitution, arithmetic expansion, and quote removal (see EEXXPPAANN-- + SSIIOONN below). If the variable has its iinntteeggeerr attribute set, then _v_a_l_u_e + is evaluated as an arithmetic expression even if the $((...)) expansion + is not used (see AArriitthhmmeettiicc EExxppaannssiioonn below). Word splitting is not + performed, with the exception of ""$$@@"" as explained below under SSppeecciiaall + PPaarraammeetteerrss. Pathname expansion is not performed. Assignment state- + ments may also appear as arguments to the aalliiaass, ddeeccllaarree, ttyyppeesseett, + eexxppoorrtt, rreeaaddoonnllyy, and llooccaall builtin commands. When in _p_o_s_i_x _m_o_d_e, + these builtins may appear in a command after one or more instances of + the ccoommmmaanndd builtin and retain these assignment statement properties. + + In the context where an assignment statement is assigning a value to a + shell variable or array index, the += operator can be used to append to + or add to the variable's previous value. When += is applied to a vari- + able for which the _i_n_t_e_g_e_r attribute has been set, _v_a_l_u_e is evaluated + as an arithmetic expression and added to the variable's current value, + which is also evaluated. When += is applied to an array variable using + compound assignment (see AArrrraayyss below), the variable's value is not + unset (as it is when using =), and new values are appended to the array + beginning at one greater than the array's maximum index (for indexed + arrays) or added as additional key-value pairs in an associative array. + When applied to a string-valued variable, _v_a_l_u_e is expanded and + appended to the variable's value. + + A variable can be assigned the _n_a_m_e_r_e_f attribute using the --nn option to + the ddeeccllaarree or llooccaall builtin commands (see the descriptions of ddeeccllaarree + and llooccaall below) to create a _n_a_m_e_r_e_f, or a reference to another vari- + able. This allows variables to be manipulated indirectly. Whenever + the nameref variable is referenced or assigned to, the operation is + actually performed on the variable specified by the nameref variable's + value. A nameref is commonly used within shell functions to refer to a + variable whose name is passed as an argument to the function. For + instance, if a variable name is passed to a shell function as its first + argument, running + declare -n ref=$1 + inside the function creates a nameref variable rreeff whose value is the + variable name passed as the first argument. References and assignments + to rreeff are treated as references and assignments to the variable whose + name was passed as $$11. If the control variable in a ffoorr loop has the + nameref attribute, the list of words can be a list of shell variables, + and a name reference will be established for each word in the list, in + turn, when the loop is executed. Array variables cannot be given the + --nn attribute. However, nameref variables can reference array variables + and subscripted array variables. Namerefs can be unset using the --nn + option to the uunnsseett builtin. Otherwise, if uunnsseett is executed with the + name of a nameref variable as an argument, the variable referenced by + the nameref variable will be unset. + + PPoossiittiioonnaall PPaarraammeetteerrss + A _p_o_s_i_t_i_o_n_a_l _p_a_r_a_m_e_t_e_r is a parameter denoted by one or more digits, + other than the single digit 0. Positional parameters are assigned from + the shell's arguments when it is invoked, and may be reassigned using + the sseett builtin command. Positional parameters may not be assigned to + with assignment statements. The positional parameters are temporarily + replaced when a shell function is executed (see FFUUNNCCTTIIOONNSS below). + + When a positional parameter consisting of more than a single digit is + expanded, it must be enclosed in braces (see EEXXPPAANNSSIIOONN below). + + SSppeecciiaall PPaarraammeetteerrss + The shell treats several parameters specially. These parameters may + only be referenced; assignment to them is not allowed. + ** Expands to the positional parameters, starting from one. When + the expansion is not within double quotes, each positional + parameter expands to a separate word. In contexts where it is + performed, those words are subject to further word splitting and + pathname expansion. When the expansion occurs within double + quotes, it expands to a single word with the value of each + parameter separated by the first character of the IIFFSS special + variable. That is, "$$**" is equivalent to "$$11_c$$22_c......", where _c + is the first character of the value of the IIFFSS variable. If IIFFSS + is unset, the parameters are separated by spaces. If IIFFSS is + null, the parameters are joined without intervening separators. + @@ Expands to the positional parameters, starting from one. When + the expansion occurs within double quotes, each parameter + expands to a separate word. That is, "$$@@" is equivalent to "$$11" + "$$22" ... If the double-quoted expansion occurs within a word, + the expansion of the first parameter is joined with the begin- + ning part of the original word, and the expansion of the last + parameter is joined with the last part of the original word. + When there are no positional parameters, "$$@@" and $$@@ expand to + nothing (i.e., they are removed). + ## Expands to the number of positional parameters in decimal. + ?? Expands to the exit status of the most recently executed fore- + ground pipeline. + -- Expands to the current option flags as specified upon invoca- + tion, by the sseett builtin command, or those set by the shell + itself (such as the --ii option). + $$ Expands to the process ID of the shell. In a () subshell, it + expands to the process ID of the current shell, not the sub- + shell. + !! Expands to the process ID of the job most recently placed into + the background, whether executed as an asynchronous command or + using the bbgg builtin (see JJOOBB CCOONNTTRROOLL below). + 00 Expands to the name of the shell or shell script. This is set + at shell initialization. If bbaasshh is invoked with a file of com- + mands, $$00 is set to the name of that file. If bbaasshh is started + with the --cc option, then $$00 is set to the first argument after + the string to be executed, if one is present. Otherwise, it is + set to the filename used to invoke bbaasshh, as given by argument + zero. + __ At shell startup, set to the absolute pathname used to invoke + the shell or shell script being executed as passed in the envi- + ronment or argument list. Subsequently, expands to the last + argument to the previous command, after expansion. Also set to + the full pathname used to invoke each command executed and + placed in the environment exported to that command. When check- + ing mail, this parameter holds the name of the mail file cur- + rently being checked. + + SShheellll VVaarriiaabblleess + The following variables are set by the shell: + + BBAASSHH Expands to the full filename used to invoke this instance of + bbaasshh. + BBAASSHHOOPPTTSS + A colon-separated list of enabled shell options. Each word in + the list is a valid argument for the --ss option to the sshhoopptt + builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). The options + appearing in BBAASSHHOOPPTTSS are those reported as _o_n by sshhoopptt. If + this variable is in the environment when bbaasshh starts up, each + shell option in the list will be enabled before reading any + startup files. This variable is read-only. + BBAASSHHPPIIDD + Expands to the process ID of the current bbaasshh process. This + differs from $$$$ under certain circumstances, such as subshells + that do not require bbaasshh to be re-initialized. + BBAASSHH__AALLIIAASSEESS + An associative array variable whose members correspond to the + internal list of aliases as maintained by the aalliiaass builtin. + Elements added to this array appear in the alias list; unsetting + array elements cause aliases to be removed from the alias list. + BBAASSHH__AARRGGCC + An array variable whose values are the number of parameters in + each frame of the current bbaasshh execution call stack. The number + of parameters to the current subroutine (shell function or + script executed with .. or ssoouurrccee) is at the top of the stack. + When a subroutine is executed, the number of parameters passed + is pushed onto BBAASSHH__AARRGGCC. The shell sets BBAASSHH__AARRGGCC only when in + extended debugging mode (see the description of the eexxttddeebbuugg + option to the sshhoopptt builtin below) + BBAASSHH__AARRGGVV + An array variable containing all of the parameters in the cur- + rent bbaasshh execution call stack. The final parameter of the last + subroutine call is at the top of the stack; the first parameter + of the initial call is at the bottom. When a subroutine is exe- + cuted, the parameters supplied are pushed onto BBAASSHH__AARRGGVV. The + shell sets BBAASSHH__AARRGGVV only when in extended debugging mode (see + the description of the eexxttddeebbuugg option to the sshhoopptt builtin + below) + BBAASSHH__CCMMDDSS + An associative array variable whose members correspond to the + internal hash table of commands as maintained by the hhaasshh + builtin. Elements added to this array appear in the hash table; + unsetting array elements cause commands to be removed from the + hash table. + BBAASSHH__CCOOMMMMAANNDD + The command currently being executed or about to be executed, + unless the shell is executing a command as the result of a trap, + in which case it is the command executing at the time of the + trap. + BBAASSHH__EEXXEECCUUTTIIOONN__SSTTRRIINNGG + The command argument to the --cc invocation option. + BBAASSHH__LLIINNEENNOO + An array variable whose members are the line numbers in source + files where each corresponding member of FFUUNNCCNNAAMMEE was invoked. + $${{BBAASSHH__LLIINNEENNOO[[_$_i]]}} is the line number in the source file + ($${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}}) where $${{FFUUNNCCNNAAMMEE[[_$_i]]}} was called (or + $${{BBAASSHH__LLIINNEENNOO[[_$_i_-_1]]}} if referenced within another shell func- + tion). Use LLIINNEENNOO to obtain the current line number. + BBAASSHH__RREEMMAATTCCHH + An array variable whose members are assigned by the ==~~ binary + operator to the [[[[ conditional command. The element with index + 0 is the portion of the string matching the entire regular + expression. The element with index _n is the portion of the + string matching the _nth parenthesized subexpression. This vari- + able is read-only. + BBAASSHH__SSOOUURRCCEE + An array variable whose members are the source filenames where + the corresponding shell function names in the FFUUNNCCNNAAMMEE array + variable are defined. The shell function $${{FFUUNNCCNNAAMMEE[[_$_i]]}} is + defined in the file $${{BBAASSHH__SSOOUURRCCEE[[_$_i]]}} and called from + $${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}}. + BBAASSHH__SSUUBBSSHHEELLLL + Incremented by one within each subshell or subshell environment + when the shell begins executing in that environment. The ini- + tial value is 0. + BBAASSHH__VVEERRSSIINNFFOO + A readonly array variable whose members hold version information + for this instance of bbaasshh. The values assigned to the array + members are as follows: + BBAASSHH__VVEERRSSIINNFFOO[[0]] The major version number (the _r_e_l_e_a_s_e). + BBAASSHH__VVEERRSSIINNFFOO[[1]] The minor version number (the _v_e_r_s_i_o_n). + BBAASSHH__VVEERRSSIINNFFOO[[2]] The patch level. + BBAASSHH__VVEERRSSIINNFFOO[[3]] The build version. + BBAASSHH__VVEERRSSIINNFFOO[[4]] The release status (e.g., _b_e_t_a_1). + BBAASSHH__VVEERRSSIINNFFOO[[5]] The value of MMAACCHHTTYYPPEE. + BBAASSHH__VVEERRSSIIOONN + Expands to a string describing the version of this instance of + bbaasshh. + CCOOMMPP__CCWWOORRDD + An index into $${{CCOOMMPP__WWOORRDDSS}} of the word containing the current + cursor position. This variable is available only in shell func- + tions invoked by the programmable completion facilities (see + PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). + CCOOMMPP__KKEEYY + The key (or final key of a key sequence) used to invoke the cur- + rent completion function. + CCOOMMPP__LLIINNEE + The current command line. This variable is available only in + shell functions and external commands invoked by the pro- + grammable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn + below). + CCOOMMPP__PPOOIINNTT + The index of the current cursor position relative to the begin- + ning of the current command. If the current cursor position is + at the end of the current command, the value of this variable is + equal to $${{##CCOOMMPP__LLIINNEE}}. This variable is available only in + shell functions and external commands invoked by the pro- + grammable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn + below). + CCOOMMPP__TTYYPPEE + Set to an integer value corresponding to the type of completion + attempted that caused a completion function to be called: _T_A_B, + for normal completion, _?, for listing completions after succes- + sive tabs, _!, for listing alternatives on partial word comple- + tion, _@, to list completions if the word is not unmodified, or + _%, for menu completion. This variable is available only in + shell functions and external commands invoked by the pro- + grammable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn + below). + CCOOMMPP__WWOORRDDBBRREEAAKKSS + The set of characters that the rreeaaddlliinnee library treats as word + separators when performing word completion. If CCOOMMPP__WWOORRDDBBRREEAAKKSS + is unset, it loses its special properties, even if it is subse- + quently reset. + CCOOMMPP__WWOORRDDSS + An array variable (see AArrrraayyss below) consisting of the individ- + ual words in the current command line. The line is split into + words as rreeaaddlliinnee would split it, using CCOOMMPP__WWOORRDDBBRREEAAKKSS as + described above. This variable is available only in shell func- + tions invoked by the programmable completion facilities (see + PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). + CCOOPPRROOCC An array variable (see AArrrraayyss below) created to hold the file + descriptors for output from and input to an unnamed coprocess + (see CCoopprroocceesssseess above). + DDIIRRSSTTAACCKK + An array variable (see AArrrraayyss below) containing the current con- + tents of the directory stack. Directories appear in the stack + in the order they are displayed by the ddiirrss builtin. Assigning + to members of this array variable may be used to modify directo- + ries already in the stack, but the ppuusshhdd and ppooppdd builtins must + be used to add and remove directories. Assignment to this vari- + able will not change the current directory. If DDIIRRSSTTAACCKK is + unset, it loses its special properties, even if it is subse- + quently reset. + EEUUIIDD Expands to the effective user ID of the current user, initial- + ized at shell startup. This variable is readonly. + FFUUNNCCNNAAMMEE + An array variable containing the names of all shell functions + currently in the execution call stack. The element with index 0 + is the name of any currently-executing shell function. The bot- + tom-most element (the one with the highest index) is "main". + This variable exists only when a shell function is executing. + Assignments to FFUUNNCCNNAAMMEE have no effect and return an error sta- + tus. If FFUUNNCCNNAAMMEE is unset, it loses its special properties, + even if it is subsequently reset. + + This variable can be used with BBAASSHH__LLIINNEENNOO and BBAASSHH__SSOOUURRCCEE. + Each element of FFUUNNCCNNAAMMEE has corresponding elements in + BBAASSHH__LLIINNEENNOO and BBAASSHH__SSOOUURRCCEE to describe the call stack. For + instance, $${{FFUUNNCCNNAAMMEE[[_$_i]]}} was called from the file + $${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}} at line number $${{BBAASSHH__LLIINNEENNOO[[_$_i]]}}. The + ccaalllleerr builtin displays the current call stack using this infor- + mation. + GGRROOUUPPSS An array variable containing the list of groups of which the + current user is a member. Assignments to GGRROOUUPPSS have no effect + and return an error status. If GGRROOUUPPSS is unset, it loses its + special properties, even if it is subsequently reset. + HHIISSTTCCMMDD + The history number, or index in the history list, of the current + command. If HHIISSTTCCMMDD is unset, it loses its special properties, + even if it is subsequently reset. + HHOOSSTTNNAAMMEE + Automatically set to the name of the current host. + HHOOSSTTTTYYPPEE + Automatically set to a string that uniquely describes the type + of machine on which bbaasshh is executing. The default is system- + dependent. + LLIINNEENNOO Each time this parameter is referenced, the shell substitutes a + decimal number representing the current sequential line number + (starting with 1) within a script or function. When not in a + script or function, the value substituted is not guaranteed to + be meaningful. If LLIINNEENNOO is unset, it loses its special proper- + ties, even if it is subsequently reset. + MMAACCHHTTYYPPEE + Automatically set to a string that fully describes the system + type on which bbaasshh is executing, in the standard GNU _c_p_u_-_c_o_m_- + _p_a_n_y_-_s_y_s_t_e_m format. The default is system-dependent. + MMAAPPFFIILLEE + An array variable (see AArrrraayyss below) created to hold the text + read by the mmaappffiillee builtin when no variable name is supplied. + OOLLDDPPWWDD The previous working directory as set by the ccdd command. + OOPPTTAARRGG The value of the last option argument processed by the ggeettooppttss + builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + OOPPTTIINNDD The index of the next argument to be processed by the ggeettooppttss + builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + OOSSTTYYPPEE Automatically set to a string that describes the operating sys- + tem on which bbaasshh is executing. The default is system-depen- + dent. + PPIIPPEESSTTAATTUUSS + An array variable (see AArrrraayyss below) containing a list of exit + status values from the processes in the most-recently-executed + foreground pipeline (which may contain only a single command). + PPPPIIDD The process ID of the shell's parent. This variable is read- + only. + PPWWDD The current working directory as set by the ccdd command. + RRAANNDDOOMM Each time this parameter is referenced, a random integer between + 0 and 32767 is generated. The sequence of random numbers may be + initialized by assigning a value to RRAANNDDOOMM. If RRAANNDDOOMM is unset, + it loses its special properties, even if it is subsequently + reset. + RREEAADDLLIINNEE__LLIINNEE + The contents of the rreeaaddlliinnee line buffer, for use with "bind -x" + (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + RREEAADDLLIINNEE__PPOOIINNTT + The position of the insertion point in the rreeaaddlliinnee line buffer, + for use with "bind -x" (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + RREEPPLLYY Set to the line of input read by the rreeaadd builtin command when + no arguments are supplied. + SSEECCOONNDDSS + Each time this parameter is referenced, the number of seconds + since shell invocation is returned. If a value is assigned to + SSEECCOONNDDSS, the value returned upon subsequent references is the + number of seconds since the assignment plus the value assigned. + If SSEECCOONNDDSS is unset, it loses its special properties, even if it + is subsequently reset. + SSHHEELLLLOOPPTTSS + A colon-separated list of enabled shell options. Each word in + the list is a valid argument for the --oo option to the sseett + builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). The options + appearing in SSHHEELLLLOOPPTTSS are those reported as _o_n by sseett --oo. If + this variable is in the environment when bbaasshh starts up, each + shell option in the list will be enabled before reading any + startup files. This variable is read-only. + SSHHLLVVLL Incremented by one each time an instance of bbaasshh is started. + UUIIDD Expands to the user ID of the current user, initialized at shell + startup. This variable is readonly. + + The following variables are used by the shell. In some cases, bbaasshh + assigns a default value to a variable; these cases are noted below. + + BBAASSHH__CCOOMMPPAATT + The value is used to set the shell's compatibility level. See + the description of the sshhoopptt builtin below under SSHHEELLLL BBUUIILLTTIINN + CCOOMMMMAANNDDSS for a description of the various compatibility levels + and their effects. The value may be a decimal number (e.g., + 4.2) or an integer (e.g., 42) corresponding to the desired com- + patibility level. If BBAASSHH__CCOOMMPPAATT is unset or set to the empty + string, the compatibility level is set to the default for the + current version. If BBAASSHH__CCOOMMPPAATT is set to a value that is not + one of the valid compatibility levels, the shell prints an error + message and sets the compatibility level to the default for the + current version. The valid compatibility levels correspond to + the compatibility options accepted by the sshhoopptt builtin + described below (for example, ccoommppaatt4422 means that 4.2 and 42 are + valid values). The current version is also a valid value. + BBAASSHH__EENNVV + If this parameter is set when bbaasshh is executing a shell script, + its value is interpreted as a filename containing commands to + initialize the shell, as in _~_/_._b_a_s_h_r_c. The value of BBAASSHH__EENNVV is + subjected to parameter expansion, command substitution, and + arithmetic expansion before being interpreted as a filename. + PPAATTHH is not used to search for the resultant filename. + BBAASSHH__XXTTRRAACCEEFFDD + If set to an integer corresponding to a valid file descriptor, + bbaasshh will write the trace output generated when _s_e_t _-_x is + enabled to that file descriptor. The file descriptor is closed + when BBAASSHH__XXTTRRAACCEEFFDD is unset or assigned a new value. Unsetting + BBAASSHH__XXTTRRAACCEEFFDD or assigning it the empty string causes the trace + output to be sent to the standard error. Note that setting + BBAASSHH__XXTTRRAACCEEFFDD to 2 (the standard error file descriptor) and then + unsetting it will result in the standard error being closed. + CCDDPPAATTHH The search path for the ccdd command. This is a colon-separated + list of directories in which the shell looks for destination + directories specified by the ccdd command. A sample value is + ".:~:/usr". + CCHHIILLDD__MMAAXX + Set the number of exited child status values for the shell to + remember. Bash will not allow this value to be decreased below + a POSIX-mandated minimum, and there is a maximum value (cur- + rently 8192) that this may not exceed. The minimum value is + system-dependent. + CCOOLLUUMMNNSS + Used by the sseelleecctt compound command to determine the terminal + width when printing selection lists. Automatically set if the + cchheecckkwwiinnssiizzee option is enabled or in an interactive shell upon + receipt of a SSIIGGWWIINNCCHH. + CCOOMMPPRREEPPLLYY + An array variable from which bbaasshh reads the possible completions + generated by a shell function invoked by the programmable com- + pletion facility (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). Each + array element contains one possible completion. + EEMMAACCSS If bbaasshh finds this variable in the environment when the shell + starts with value "t", it assumes that the shell is running in + an Emacs shell buffer and disables line editing. + EENNVV Similar to BBAASSHH__EENNVV; used when the shell is invoked in POSIX + mode. + FFCCEEDDIITT The default editor for the ffcc builtin command. + FFIIGGNNOORREE + A colon-separated list of suffixes to ignore when performing + filename completion (see RREEAADDLLIINNEE below). A filename whose suf- + fix matches one of the entries in FFIIGGNNOORREE is excluded from the + list of matched filenames. A sample value is ".o:~". + FFUUNNCCNNEESSTT + If set to a numeric value greater than 0, defines a maximum + function nesting level. Function invocations that exceed this + nesting level will cause the current command to abort. + GGLLOOBBIIGGNNOORREE + A colon-separated list of patterns defining the set of filenames + to be ignored by pathname expansion. If a filename matched by a + pathname expansion pattern also matches one of the patterns in + GGLLOOBBIIGGNNOORREE, it is removed from the list of matches. + HHIISSTTCCOONNTTRROOLL + A colon-separated list of values controlling how commands are + saved on the history list. If the list of values includes + _i_g_n_o_r_e_s_p_a_c_e, lines which begin with a ssppaaccee character are not + saved in the history list. A value of _i_g_n_o_r_e_d_u_p_s causes lines + matching the previous history entry to not be saved. A value of + _i_g_n_o_r_e_b_o_t_h is shorthand for _i_g_n_o_r_e_s_p_a_c_e and _i_g_n_o_r_e_d_u_p_s. A value + of _e_r_a_s_e_d_u_p_s causes all previous lines matching the current line + to be removed from the history list before that line is saved. + Any value not in the above list is ignored. If HHIISSTTCCOONNTTRROOLL is + unset, or does not include a valid value, all lines read by the + shell parser are saved on the history list, subject to the value + of HHIISSTTIIGGNNOORREE. The second and subsequent lines of a multi-line + compound command are not tested, and are added to the history + regardless of the value of HHIISSTTCCOONNTTRROOLL. + HHIISSTTFFIILLEE + The name of the file in which command history is saved (see HHIISS-- + TTOORRYY below). The default value is _~_/_._b_a_s_h___h_i_s_t_o_r_y. If unset, + the command history is not saved when a shell exits. + HHIISSTTFFIILLEESSIIZZEE + The maximum number of lines contained in the history file. When + this variable is assigned a value, the history file is trun- + cated, if necessary, to contain no more than that number of + lines by removing the oldest entries. The history file is also + truncated to this size after writing it when a shell exits. If + the value is 0, the history file is truncated to zero size. + Non-numeric values and numeric values less than zero inhibit + truncation. The shell sets the default value to the value of + HHIISSTTSSIIZZEE after reading any startup files. + HHIISSTTIIGGNNOORREE + A colon-separated list of patterns used to decide which command + lines should be saved on the history list. Each pattern is + anchored at the beginning of the line and must match the com- + plete line (no implicit `**' is appended). Each pattern is + tested against the line after the checks specified by HHIISSTTCCOONN-- + TTRROOLL are applied. In addition to the normal shell pattern + matching characters, `&&' matches the previous history line. `&&' + may be escaped using a backslash; the backslash is removed + before attempting a match. The second and subsequent lines of a + multi-line compound command are not tested, and are added to the + history regardless of the value of HHIISSTTIIGGNNOORREE. + HHIISSTTSSIIZZEE + The number of commands to remember in the command history (see + HHIISSTTOORRYY below). If the value is 0, commands are not saved in + the history list. Numeric values less than zero result in every + command being saved on the history list (there is no limit). + The shell sets the default value to 500 after reading any + startup files. + HHIISSTTTTIIMMEEFFOORRMMAATT + If this variable is set and not null, its value is used as a + format string for _s_t_r_f_t_i_m_e(3) to print the time stamp associated + with each history entry displayed by the hhiissttoorryy builtin. If + this variable is set, time stamps are written to the history + file so they may be preserved across shell sessions. This uses + the history comment character to distinguish timestamps from + other history lines. + HHOOMMEE The home directory of the current user; the default argument for + the ccdd builtin command. The value of this variable is also used + when performing tilde expansion. + HHOOSSTTFFIILLEE + Contains the name of a file in the same format as _/_e_t_c_/_h_o_s_t_s + that should be read when the shell needs to complete a hostname. + The list of possible hostname completions may be changed while + the shell is running; the next time hostname completion is + attempted after the value is changed, bbaasshh adds the contents of + the new file to the existing list. If HHOOSSTTFFIILLEE is set, but has + no value, or does not name a readable file, bbaasshh attempts to + read _/_e_t_c_/_h_o_s_t_s to obtain the list of possible hostname comple- + tions. When HHOOSSTTFFIILLEE is unset, the hostname list is cleared. + IIFFSS The _I_n_t_e_r_n_a_l _F_i_e_l_d _S_e_p_a_r_a_t_o_r that is used for word splitting + after expansion and to split lines into words with the rreeaadd + builtin command. The default value is ``''. + IIGGNNOORREEEEOOFF + Controls the action of an interactive shell on receipt of an EEOOFF + character as the sole input. If set, the value is the number of + consecutive EEOOFF characters which must be typed as the first + characters on an input line before bbaasshh exits. If the variable + exists but does not have a numeric value, or has no value, the + default value is 10. If it does not exist, EEOOFF signifies the + end of input to the shell. + IINNPPUUTTRRCC + The filename for the rreeaaddlliinnee startup file, overriding the + default of _~_/_._i_n_p_u_t_r_c (see RREEAADDLLIINNEE below). + LLAANNGG Used to determine the locale category for any category not + specifically selected with a variable starting with LLCC__. + LLCC__AALLLL This variable overrides the value of LLAANNGG and any other LLCC__ + variable specifying a locale category. + LLCC__CCOOLLLLAATTEE + This variable determines the collation order used when sorting + the results of pathname expansion, and determines the behavior + of range expressions, equivalence classes, and collating + sequences within pathname expansion and pattern matching. + LLCC__CCTTYYPPEE + This variable determines the interpretation of characters and + the behavior of character classes within pathname expansion and + pattern matching. + LLCC__MMEESSSSAAGGEESS + This variable determines the locale used to translate double- + quoted strings preceded by a $$. + LLCC__NNUUMMEERRIICC + This variable determines the locale category used for number + formatting. + LLIINNEESS Used by the sseelleecctt compound command to determine the column + length for printing selection lists. Automatically set if the + cchheecckkwwiinnssiizzee option is enabled or in an interactive shell upon + receipt of a SSIIGGWWIINNCCHH. + MMAAIILL If this parameter is set to a file or directory name and the + MMAAIILLPPAATTHH variable is not set, bbaasshh informs the user of the + arrival of mail in the specified file or Maildir-format direc- + tory. + MMAAIILLCCHHEECCKK + Specifies how often (in seconds) bbaasshh checks for mail. The + default is 60 seconds. When it is time to check for mail, the + shell does so before displaying the primary prompt. If this + variable is unset, or set to a value that is not a number + greater than or equal to zero, the shell disables mail checking. + MMAAIILLPPAATTHH + A colon-separated list of filenames to be checked for mail. The + message to be printed when mail arrives in a particular file may + be specified by separating the filename from the message with a + `?'. When used in the text of the message, $$__ expands to the + name of the current mailfile. Example: + MMAAIILLPPAATTHH='/var/mail/bfox?"You have mail":~/shell-mail?"$_ has + mail!"' + BBaasshh supplies a default value for this variable, but the loca- + tion of the user mail files that it uses is system dependent + (e.g., /var/mail/$$UUSSEERR). + OOPPTTEERRRR If set to the value 1, bbaasshh displays error messages generated by + the ggeettooppttss builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + OOPPTTEERRRR is initialized to 1 each time the shell is invoked or a + shell script is executed. + PPAATTHH The search path for commands. It is a colon-separated list of + directories in which the shell looks for commands (see CCOOMMMMAANNDD + EEXXEECCUUTTIIOONN below). A zero-length (null) directory name in the + value of PPAATTHH indicates the current directory. A null directory + name may appear as two adjacent colons, or as an initial or + trailing colon. The default path is system-dependent, and is + set by the administrator who installs bbaasshh. A common value is + ``/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin''. + PPOOSSIIXXLLYY__CCOORRRREECCTT + If this variable is in the environment when bbaasshh starts, the + shell enters _p_o_s_i_x _m_o_d_e before reading the startup files, as if + the ----ppoossiixx invocation option had been supplied. If it is set + while the shell is running, bbaasshh enables _p_o_s_i_x _m_o_d_e, as if the + command _s_e_t _-_o _p_o_s_i_x had been executed. + PPRROOMMPPTT__CCOOMMMMAANNDD + If set, the value is executed as a command prior to issuing each + primary prompt. + PPRROOMMPPTT__DDIIRRTTRRIIMM + If set to a number greater than zero, the value is used as the + number of trailing directory components to retain when expanding + the \\ww and \\WW prompt string escapes (see PPRROOMMPPTTIINNGG below). + Characters removed are replaced with an ellipsis. + PPSS11 The value of this parameter is expanded (see PPRROOMMPPTTIINNGG below) + and used as the primary prompt string. The default value is + ``\\ss--\\vv\\$$ ''. + PPSS22 The value of this parameter is expanded as with PPSS11 and used as + the secondary prompt string. The default is ``>> ''. + PPSS33 The value of this parameter is used as the prompt for the sseelleecctt + command (see SSHHEELLLL GGRRAAMMMMAARR above). + PPSS44 The value of this parameter is expanded as with PPSS11 and the + value is printed before each command bbaasshh displays during an + execution trace. The first character of PPSS44 is replicated mul- + tiple times, as necessary, to indicate multiple levels of indi- + rection. The default is ``++ ''. + SSHHEELLLL The full pathname to the shell is kept in this environment vari- + able. If it is not set when the shell starts, bbaasshh assigns to + it the full pathname of the current user's login shell. + TTIIMMEEFFOORRMMAATT + The value of this parameter is used as a format string specify- + ing how the timing information for pipelines prefixed with the + ttiimmee reserved word should be displayed. The %% character intro- + duces an escape sequence that is expanded to a time value or + other information. The escape sequences and their meanings are + as follows; the braces denote optional portions. + %%%% A literal %%. + %%[[_p]][[ll]]RR The elapsed time in seconds. + %%[[_p]][[ll]]UU The number of CPU seconds spent in user mode. + %%[[_p]][[ll]]SS The number of CPU seconds spent in system mode. + %%PP The CPU percentage, computed as (%U + %S) / %R. + + The optional _p is a digit specifying the _p_r_e_c_i_s_i_o_n, the number + of fractional digits after a decimal point. A value of 0 causes + no decimal point or fraction to be output. At most three places + after the decimal point may be specified; values of _p greater + than 3 are changed to 3. If _p is not specified, the value 3 is + used. + + The optional ll specifies a longer format, including minutes, of + the form _M_Mm_S_S._F_Fs. The value of _p determines whether or not + the fraction is included. + + If this variable is not set, bbaasshh acts as if it had the value + $$''\\nnrreeaall\\tt%%33llRR\\nnuusseerr\\tt%%33llUU\\nnssyyss\\tt%%33llSS''. If the value is null, + no timing information is displayed. A trailing newline is added + when the format string is displayed. + TTMMOOUUTT If set to a value greater than zero, TTMMOOUUTT is treated as the + default timeout for the rreeaadd builtin. The sseelleecctt command termi- + nates if input does not arrive after TTMMOOUUTT seconds when input is + coming from a terminal. In an interactive shell, the value is + interpreted as the number of seconds to wait for a line of input + after issuing the primary prompt. BBaasshh terminates after waiting + for that number of seconds if a complete line of input does not + arrive. + TTMMPPDDIIRR If set, bbaasshh uses its value as the name of a directory in which + bbaasshh creates temporary files for the shell's use. + aauuttoo__rreessuummee + This variable controls how the shell interacts with the user and + job control. If this variable is set, single word simple com- + mands without redirections are treated as candidates for resump- + tion of an existing stopped job. There is no ambiguity allowed; + if there is more than one job beginning with the string typed, + the job most recently accessed is selected. The _n_a_m_e of a + stopped job, in this context, is the command line used to start + it. If set to the value _e_x_a_c_t, the string supplied must match + the name of a stopped job exactly; if set to _s_u_b_s_t_r_i_n_g, the + string supplied needs to match a substring of the name of a + stopped job. The _s_u_b_s_t_r_i_n_g value provides functionality analo- + gous to the %%?? job identifier (see JJOOBB CCOONNTTRROOLL below). If set + to any other value, the supplied string must be a prefix of a + stopped job's name; this provides functionality analogous to the + %%_s_t_r_i_n_g job identifier. + hhiissttcchhaarrss + The two or three characters which control history expansion and + tokenization (see HHIISSTTOORRYY EEXXPPAANNSSIIOONN below). The first character + is the _h_i_s_t_o_r_y _e_x_p_a_n_s_i_o_n character, the character which signals + the start of a history expansion, normally `!!'. The second + character is the _q_u_i_c_k _s_u_b_s_t_i_t_u_t_i_o_n character, which is used as + shorthand for re-running the previous command entered, substi- + tuting one string for another in the command. The default is + `^^'. The optional third character is the character which indi- + cates that the remainder of the line is a comment when found as + the first character of a word, normally `##'. The history com- + ment character causes history substitution to be skipped for the + remaining words on the line. It does not necessarily cause the + shell parser to treat the rest of the line as a comment. + + AArrrraayyss + BBaasshh provides one-dimensional indexed and associative array variables. + Any variable may be used as an indexed array; the ddeeccllaarree builtin will + explicitly declare an array. There is no maximum limit on the size of + an array, nor any requirement that members be indexed or assigned con- + tiguously. Indexed arrays are referenced using integers (including + arithmetic expressions) and are zero-based; associative arrays are + referenced using arbitrary strings. Unless otherwise noted, indexed + array indices must be non-negative integers. + + An indexed array is created automatically if any variable is assigned + to using the syntax _n_a_m_e[_s_u_b_s_c_r_i_p_t]=_v_a_l_u_e. The _s_u_b_s_c_r_i_p_t is treated as + an arithmetic expression that must evaluate to a number. To explicitly + declare an indexed array, use ddeeccllaarree --aa _n_a_m_e (see SSHHEELLLL BBUUIILLTTIINN CCOOMM-- + MMAANNDDSS below). ddeeccllaarree --aa _n_a_m_e[[_s_u_b_s_c_r_i_p_t]] is also accepted; the _s_u_b_- + _s_c_r_i_p_t is ignored. + + Associative arrays are created using ddeeccllaarree --AA _n_a_m_e. + + Attributes may be specified for an array variable using the ddeeccllaarree and + rreeaaddoonnllyy builtins. Each attribute applies to all members of an array. + + Arrays are assigned to using compound assignments of the form + _n_a_m_e=((value_1 ... value_n)), where each _v_a_l_u_e is of the form [_s_u_b_- + _s_c_r_i_p_t]=_s_t_r_i_n_g. Indexed array assignments do not require anything but + _s_t_r_i_n_g. When assigning to indexed arrays, if the optional brackets and + subscript are supplied, that index is assigned to; otherwise the index + of the element assigned is the last index assigned to by the statement + plus one. Indexing starts at zero. + + When assigning to an associative array, the subscript is required. + + This syntax is also accepted by the ddeeccllaarree builtin. Individual array + elements may be assigned to using the _n_a_m_e[_s_u_b_s_c_r_i_p_t]=_v_a_l_u_e syntax + introduced above. When assigning to an indexed array, if _n_a_m_e is sub- + scripted by a negative number, that number is interpreted as relative + to one greater than the maximum index of _n_a_m_e, so negative indices + count back from the end of the array, and an index of -1 references the + last element. + + Any element of an array may be referenced using ${_n_a_m_e[_s_u_b_s_c_r_i_p_t]}. + The braces are required to avoid conflicts with pathname expansion. If + _s_u_b_s_c_r_i_p_t is @@ or **, the word expands to all members of _n_a_m_e. These + subscripts differ only when the word appears within double quotes. If + the word is double-quoted, ${_n_a_m_e[*]} expands to a single word with the + value of each array member separated by the first character of the IIFFSS + special variable, and ${_n_a_m_e[@]} expands each element of _n_a_m_e to a sep- + arate word. When there are no array members, ${_n_a_m_e[@]} expands to + nothing. If the double-quoted expansion occurs within a word, the + expansion of the first parameter is joined with the beginning part of + the original word, and the expansion of the last parameter is joined + with the last part of the original word. This is analogous to the + expansion of the special parameters ** and @@ (see SSppeecciiaall PPaarraammeetteerrss + above). ${#_n_a_m_e[_s_u_b_s_c_r_i_p_t]} expands to the length of ${_n_a_m_e[_s_u_b_- + _s_c_r_i_p_t]}. If _s_u_b_s_c_r_i_p_t is ** or @@, the expansion is the number of ele- + ments in the array. Referencing an array variable without a subscript + is equivalent to referencing the array with a subscript of 0. If the + _s_u_b_s_c_r_i_p_t used to reference an element of an indexed array evaluates to + a number less than zero, it is interpreted as relative to one greater + than the maximum index of the array, so negative indices count back + from the end of the array, and an index of -1 references the last ele- + ment. + + An array variable is considered set if a subscript has been assigned a + value. The null string is a valid value. + + It is possible to obtain the keys (indices) of an array as well as the + values. ${!!_n_a_m_e[_@]} and ${!!_n_a_m_e[_*]} expand to the indices assigned in + array variable _n_a_m_e. The treatment when in double quotes is similar to + the expansion of the special parameters _@ and _* within double quotes. + + The uunnsseett builtin is used to destroy arrays. uunnsseett _n_a_m_e[_s_u_b_s_c_r_i_p_t] + destroys the array element at index _s_u_b_s_c_r_i_p_t. Negative subscripts to + indexed arrays are interpreted as described above. Care must be taken + to avoid unwanted side effects caused by pathname expansion. uunnsseett + _n_a_m_e, where _n_a_m_e is an array, or uunnsseett _n_a_m_e[_s_u_b_s_c_r_i_p_t], where _s_u_b_s_c_r_i_p_t + is ** or @@, removes the entire array. + + The ddeeccllaarree, llooccaall, and rreeaaddoonnllyy builtins each accept a --aa option to + specify an indexed array and a --AA option to specify an associative + array. If both options are supplied, --AA takes precedence. The rreeaadd + builtin accepts a --aa option to assign a list of words read from the + standard input to an array. The sseett and ddeeccllaarree builtins display array + values in a way that allows them to be reused as assignments. + +EEXXPPAANNSSIIOONN + Expansion is performed on the command line after it has been split into + words. There are seven kinds of expansion performed: _b_r_a_c_e _e_x_p_a_n_s_i_o_n, + _t_i_l_d_e _e_x_p_a_n_s_i_o_n, _p_a_r_a_m_e_t_e_r _a_n_d _v_a_r_i_a_b_l_e _e_x_p_a_n_s_i_o_n, _c_o_m_m_a_n_d _s_u_b_s_t_i_t_u_- + _t_i_o_n, _a_r_i_t_h_m_e_t_i_c _e_x_p_a_n_s_i_o_n, _w_o_r_d _s_p_l_i_t_t_i_n_g, and _p_a_t_h_n_a_m_e _e_x_p_a_n_s_i_o_n. + + The order of expansions is: brace expansion; tilde expansion, parameter + and variable expansion, arithmetic expansion, and command substitution + (done in a left-to-right fashion); word splitting; and pathname expan- + sion. + + On systems that can support it, there is an additional expansion avail- + able: _p_r_o_c_e_s_s _s_u_b_s_t_i_t_u_t_i_o_n. This is performed at the same time as + tilde, parameter, variable, and arithmetic expansion and command sub- + stitution. + + Only brace expansion, word splitting, and pathname expansion can change + the number of words of the expansion; other expansions expand a single + word to a single word. The only exceptions to this are the expansions + of "$$@@" and "$${{_n_a_m_e[[@@]]}}" as explained above (see PPAARRAAMMEETTEERRSS). + + BBrraaccee EExxppaannssiioonn + _B_r_a_c_e _e_x_p_a_n_s_i_o_n is a mechanism by which arbitrary strings may be gener- + ated. This mechanism is similar to _p_a_t_h_n_a_m_e _e_x_p_a_n_s_i_o_n, but the file- + names generated need not exist. Patterns to be brace expanded take the + form of an optional _p_r_e_a_m_b_l_e, followed by either a series of comma-sep- + arated strings or a sequence expression between a pair of braces, fol- + lowed by an optional _p_o_s_t_s_c_r_i_p_t. The preamble is prefixed to each + string contained within the braces, and the postscript is then appended + to each resulting string, expanding left to right. + + Brace expansions may be nested. The results of each expanded string + are not sorted; left to right order is preserved. For example, + a{{d,c,b}}e expands into `ade ace abe'. + + A sequence expression takes the form {{_x...._y[[...._i_n_c_r]]}}, where _x and _y are + either integers or single characters, and _i_n_c_r, an optional increment, + is an integer. When integers are supplied, the expression expands to + each number between _x and _y, inclusive. Supplied integers may be pre- + fixed with _0 to force each term to have the same width. When either _x + or _y begins with a zero, the shell attempts to force all generated + terms to contain the same number of digits, zero-padding where neces- + sary. When characters are supplied, the expression expands to each + character lexicographically between _x and _y, inclusive, using the + default C locale. Note that both _x and _y must be of the same type. + When the increment is supplied, it is used as the difference between + each term. The default increment is 1 or -1 as appropriate. + + Brace expansion is performed before any other expansions, and any char- + acters special to other expansions are preserved in the result. It is + strictly textual. BBaasshh does not apply any syntactic interpretation to + the context of the expansion or the text between the braces. + + A correctly-formed brace expansion must contain unquoted opening and + closing braces, and at least one unquoted comma or a valid sequence + expression. Any incorrectly formed brace expansion is left unchanged. + A {{ or ,, may be quoted with a backslash to prevent its being considered + part of a brace expression. To avoid conflicts with parameter expan- + sion, the string $${{ is not considered eligible for brace expansion. + + This construct is typically used as shorthand when the common prefix of + the strings to be generated is longer than in the above example: + + mkdir /usr/local/src/bash/{old,new,dist,bugs} + or + chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} + + Brace expansion introduces a slight incompatibility with historical + versions of sshh. sshh does not treat opening or closing braces specially + when they appear as part of a word, and preserves them in the output. + BBaasshh removes braces from words as a consequence of brace expansion. + For example, a word entered to sshh as _f_i_l_e_{_1_,_2_} appears identically in + the output. The same word is output as _f_i_l_e_1 _f_i_l_e_2 after expansion by + bbaasshh. If strict compatibility with sshh is desired, start bbaasshh with the + ++BB option or disable brace expansion with the ++BB option to the sseett com- + mand (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + + TTiillddee EExxppaannssiioonn + If a word begins with an unquoted tilde character (`~~'), all of the + characters preceding the first unquoted slash (or all characters, if + there is no unquoted slash) are considered a _t_i_l_d_e_-_p_r_e_f_i_x. If none of + the characters in the tilde-prefix are quoted, the characters in the + tilde-prefix following the tilde are treated as a possible _l_o_g_i_n _n_a_m_e. + If this login name is the null string, the tilde is replaced with the + value of the shell parameter HHOOMMEE. If HHOOMMEE is unset, the home direc- + tory of the user executing the shell is substituted instead. Other- + wise, the tilde-prefix is replaced with the home directory associated + with the specified login name. + + If the tilde-prefix is a `~+', the value of the shell variable PPWWDD + replaces the tilde-prefix. If the tilde-prefix is a `~-', the value of + the shell variable OOLLDDPPWWDD, if it is set, is substituted. If the char- + acters following the tilde in the tilde-prefix consist of a number _N, + optionally prefixed by a `+' or a `-', the tilde-prefix is replaced + with the corresponding element from the directory stack, as it would be + displayed by the ddiirrss builtin invoked with the tilde-prefix as an argu- + ment. If the characters following the tilde in the tilde-prefix con- + sist of a number without a leading `+' or `-', `+' is assumed. + + If the login name is invalid, or the tilde expansion fails, the word is + unchanged. + + Each variable assignment is checked for unquoted tilde-prefixes immedi- + ately following a :: or the first ==. In these cases, tilde expansion is + also performed. Consequently, one may use filenames with tildes in + assignments to PPAATTHH, MMAAIILLPPAATTHH, and CCDDPPAATTHH, and the shell assigns the + expanded value. + + PPaarraammeetteerr EExxppaannssiioonn + The `$$' character introduces parameter expansion, command substitution, + or arithmetic expansion. The parameter name or symbol to be expanded + may be enclosed in braces, which are optional but serve to protect the + variable to be expanded from characters immediately following it which + could be interpreted as part of the name. + + When braces are used, the matching ending brace is the first `}}' not + escaped by a backslash or within a quoted string, and not within an + embedded arithmetic expansion, command substitution, or parameter + expansion. + + ${_p_a_r_a_m_e_t_e_r} + The value of _p_a_r_a_m_e_t_e_r is substituted. The braces are required + when _p_a_r_a_m_e_t_e_r is a positional parameter with more than one + digit, or when _p_a_r_a_m_e_t_e_r is followed by a character which is not + to be interpreted as part of its name. The _p_a_r_a_m_e_t_e_r is a shell + parameter as described above PPAARRAAMMEETTEERRSS) or an array reference + (AArrrraayyss). + + If the first character of _p_a_r_a_m_e_t_e_r is an exclamation point (!!), it + introduces a level of variable indirection. BBaasshh uses the value of the + variable formed from the rest of _p_a_r_a_m_e_t_e_r as the name of the variable; + this variable is then expanded and that value is used in the rest of + the substitution, rather than the value of _p_a_r_a_m_e_t_e_r itself. This is + known as _i_n_d_i_r_e_c_t _e_x_p_a_n_s_i_o_n. The exceptions to this are the expansions + of ${!!_p_r_e_f_i_x**} and ${!!_n_a_m_e[_@]} described below. The exclamation point + must immediately follow the left brace in order to introduce indirec- + tion. + + In each of the cases below, _w_o_r_d is subject to tilde expansion, parame- + ter expansion, command substitution, and arithmetic expansion. + + When not performing substring expansion, using the forms documented + below (e.g., ::--), bbaasshh tests for a parameter that is unset or null. + Omitting the colon results in a test only for a parameter that is + unset. + + ${_p_a_r_a_m_e_t_e_r::--_w_o_r_d} + UUssee DDeeffaauulltt VVaalluueess. If _p_a_r_a_m_e_t_e_r is unset or null, the expan- + sion of _w_o_r_d is substituted. Otherwise, the value of _p_a_r_a_m_e_t_e_r + is substituted. + ${_p_a_r_a_m_e_t_e_r::==_w_o_r_d} + AAssssiiggnn DDeeffaauulltt VVaalluueess. If _p_a_r_a_m_e_t_e_r is unset or null, the + expansion of _w_o_r_d is assigned to _p_a_r_a_m_e_t_e_r. The value of _p_a_r_a_m_- + _e_t_e_r is then substituted. Positional parameters and special + parameters may not be assigned to in this way. + ${_p_a_r_a_m_e_t_e_r::??_w_o_r_d} + DDiissppllaayy EErrrroorr iiff NNuullll oorr UUnnsseett. If _p_a_r_a_m_e_t_e_r is null or unset, + the expansion of _w_o_r_d (or a message to that effect if _w_o_r_d is + not present) is written to the standard error and the shell, if + it is not interactive, exits. Otherwise, the value of _p_a_r_a_m_e_t_e_r + is substituted. + ${_p_a_r_a_m_e_t_e_r::++_w_o_r_d} + UUssee AAlltteerrnnaattee VVaalluuee. If _p_a_r_a_m_e_t_e_r is null or unset, nothing is + substituted, otherwise the expansion of _w_o_r_d is substituted. + ${_p_a_r_a_m_e_t_e_r::_o_f_f_s_e_t} + ${_p_a_r_a_m_e_t_e_r::_o_f_f_s_e_t::_l_e_n_g_t_h} + SSuubbssttrriinngg EExxppaannssiioonn. Expands to up to _l_e_n_g_t_h characters of the + value of _p_a_r_a_m_e_t_e_r starting at the character specified by _o_f_f_- + _s_e_t. If _p_a_r_a_m_e_t_e_r is @@, an indexed array subscripted by @@ or **, + or an associative array name, the results differ as described + below. If _l_e_n_g_t_h is omitted, expands to the substring of the + value of _p_a_r_a_m_e_t_e_r starting at the character specified by _o_f_f_s_e_t + and extending to the end of the value. _l_e_n_g_t_h and _o_f_f_s_e_t are + arithmetic expressions (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN below). + + If _o_f_f_s_e_t evaluates to a number less than zero, the value is + used as an offset in characters from the end of the value of + _p_a_r_a_m_e_t_e_r. If _l_e_n_g_t_h evaluates to a number less than zero, it + is interpreted as an offset in characters from the end of the + value of _p_a_r_a_m_e_t_e_r rather than a number of characters, and the + expansion is the characters between _o_f_f_s_e_t and that result. + Note that a negative offset must be separated from the colon by + at least one space to avoid being confused with the ::-- expan- + sion. + + If _p_a_r_a_m_e_t_e_r is @@, the result is _l_e_n_g_t_h positional parameters + beginning at _o_f_f_s_e_t. A negative _o_f_f_s_e_t is taken relative to one + greater than the greatest positional parameter, so an offset of + -1 evaluates to the last positional parameter. It is an expan- + sion error if _l_e_n_g_t_h evaluates to a number less than zero. + + If _p_a_r_a_m_e_t_e_r is an indexed array name subscripted by @ or *, the + result is the _l_e_n_g_t_h members of the array beginning with + ${_p_a_r_a_m_e_t_e_r[_o_f_f_s_e_t]}. A negative _o_f_f_s_e_t is taken relative to + one greater than the maximum index of the specified array. It + is an expansion error if _l_e_n_g_t_h evaluates to a number less than + zero. + + Substring expansion applied to an associative array produces + undefined results. + + Substring indexing is zero-based unless the positional parame- + ters are used, in which case the indexing starts at 1 by + default. If _o_f_f_s_e_t is 0, and the positional parameters are + used, $$00 is prefixed to the list. + + ${!!_p_r_e_f_i_x**} + ${!!_p_r_e_f_i_x@@} + NNaammeess mmaattcchhiinngg pprreeffiixx. Expands to the names of variables whose + names begin with _p_r_e_f_i_x, separated by the first character of the + IIFFSS special variable. When _@ is used and the expansion appears + within double quotes, each variable name expands to a separate + word. + + ${!!_n_a_m_e[_@]} + ${!!_n_a_m_e[_*]} + LLiisstt ooff aarrrraayy kkeeyyss. If _n_a_m_e is an array variable, expands to + the list of array indices (keys) assigned in _n_a_m_e. If _n_a_m_e is + not an array, expands to 0 if _n_a_m_e is set and null otherwise. + When _@ is used and the expansion appears within double quotes, + each key expands to a separate word. + + ${##_p_a_r_a_m_e_t_e_r} + PPaarraammeetteerr lleennggtthh. The length in characters of the value of + _p_a_r_a_m_e_t_e_r is substituted. If _p_a_r_a_m_e_t_e_r is ** or @@, the value + substituted is the number of positional parameters. If _p_a_r_a_m_e_- + _t_e_r is an array name subscripted by ** or @@, the value substi- + tuted is the number of elements in the array. If _p_a_r_a_m_e_t_e_r is + an indexed array name subscripted by a negative number, that + number is interpreted as relative to one greater than the maxi- + mum index of _p_a_r_a_m_e_t_e_r, so negative indices count back from the + end of the array, and an index of -1 references the last ele- + ment. + + ${_p_a_r_a_m_e_t_e_r##_w_o_r_d} + ${_p_a_r_a_m_e_t_e_r####_w_o_r_d} + RReemmoovvee mmaattcchhiinngg pprreeffiixx ppaatttteerrnn. The _w_o_r_d is expanded to produce + a pattern just as in pathname expansion. If the pattern matches + the beginning of the value of _p_a_r_a_m_e_t_e_r, then the result of the + expansion is the expanded value of _p_a_r_a_m_e_t_e_r with the shortest + matching pattern (the ``##'' case) or the longest matching pat- + tern (the ``####'' case) deleted. If _p_a_r_a_m_e_t_e_r is @@ or **, the + pattern removal operation is applied to each positional parame- + ter in turn, and the expansion is the resultant list. If _p_a_r_a_m_- + _e_t_e_r is an array variable subscripted with @@ or **, the pattern + removal operation is applied to each member of the array in + turn, and the expansion is the resultant list. + + ${_p_a_r_a_m_e_t_e_r%%_w_o_r_d} + ${_p_a_r_a_m_e_t_e_r%%%%_w_o_r_d} + RReemmoovvee mmaattcchhiinngg ssuuffffiixx ppaatttteerrnn. The _w_o_r_d is expanded to produce + a pattern just as in pathname expansion. If the pattern matches + a trailing portion of the expanded value of _p_a_r_a_m_e_t_e_r, then the + result of the expansion is the expanded value of _p_a_r_a_m_e_t_e_r with + the shortest matching pattern (the ``%%'' case) or the longest + matching pattern (the ``%%%%'' case) deleted. If _p_a_r_a_m_e_t_e_r is @@ + or **, the pattern removal operation is applied to each posi- + tional parameter in turn, and the expansion is the resultant + list. If _p_a_r_a_m_e_t_e_r is an array variable subscripted with @@ or + **, the pattern removal operation is applied to each member of + the array in turn, and the expansion is the resultant list. + + ${_p_a_r_a_m_e_t_e_r//_p_a_t_t_e_r_n//_s_t_r_i_n_g} + PPaatttteerrnn ssuubbssttiittuuttiioonn. The _p_a_t_t_e_r_n is expanded to produce a pat- + tern just as in pathname expansion. _P_a_r_a_m_e_t_e_r is expanded and + the longest match of _p_a_t_t_e_r_n against its value is replaced with + _s_t_r_i_n_g. If _p_a_t_t_e_r_n begins with //, all matches of _p_a_t_t_e_r_n are + replaced with _s_t_r_i_n_g. Normally only the first match is + replaced. If _p_a_t_t_e_r_n begins with ##, it must match at the begin- + ning of the expanded value of _p_a_r_a_m_e_t_e_r. If _p_a_t_t_e_r_n begins with + %%, it must match at the end of the expanded value of _p_a_r_a_m_e_t_e_r. + If _s_t_r_i_n_g is null, matches of _p_a_t_t_e_r_n are deleted and the // fol- + lowing _p_a_t_t_e_r_n may be omitted. If _p_a_r_a_m_e_t_e_r is @@ or **, the sub- + stitution operation is applied to each positional parameter in + turn, and the expansion is the resultant list. If _p_a_r_a_m_e_t_e_r is + an array variable subscripted with @@ or **, the substitution + operation is applied to each member of the array in turn, and + the expansion is the resultant list. + + ${_p_a_r_a_m_e_t_e_r^^_p_a_t_t_e_r_n} + ${_p_a_r_a_m_e_t_e_r^^^^_p_a_t_t_e_r_n} + ${_p_a_r_a_m_e_t_e_r,,_p_a_t_t_e_r_n} + ${_p_a_r_a_m_e_t_e_r,,,,_p_a_t_t_e_r_n} + CCaassee mmooddiiffiiccaattiioonn. This expansion modifies the case of alpha- + betic characters in _p_a_r_a_m_e_t_e_r. The _p_a_t_t_e_r_n is expanded to pro- + duce a pattern just as in pathname expansion. Each character in + the expanded value of _p_a_r_a_m_e_t_e_r is tested against _p_a_t_t_e_r_n, and, + if it matches the pattern, its case is converted. The pattern + should not attempt to match more than one character. The ^^ + operator converts lowercase letters matching _p_a_t_t_e_r_n to upper- + case; the ,, operator converts matching uppercase letters to low- + ercase. The ^^^^ and ,,,, expansions convert each matched character + in the expanded value; the ^^ and ,, expansions match and convert + only the first character in the expanded value. If _p_a_t_t_e_r_n is + omitted, it is treated like a ??, which matches every character. + If _p_a_r_a_m_e_t_e_r is @@ or **, the case modification operation is + applied to each positional parameter in turn, and the expansion + is the resultant list. If _p_a_r_a_m_e_t_e_r is an array variable sub- + scripted with @@ or **, the case modification operation is applied + to each member of the array in turn, and the expansion is the + resultant list. + + CCoommmmaanndd SSuubbssttiittuuttiioonn + _C_o_m_m_a_n_d _s_u_b_s_t_i_t_u_t_i_o_n allows the output of a command to replace the com- + mand name. There are two forms: + + $$((_c_o_m_m_a_n_d)) + or + ``_c_o_m_m_a_n_d`` + + BBaasshh performs the expansion by executing _c_o_m_m_a_n_d and replacing the com- + mand substitution with the standard output of the command, with any + trailing newlines deleted. Embedded newlines are not deleted, but they + may be removed during word splitting. The command substitution $$((ccaatt + _f_i_l_e)) can be replaced by the equivalent but faster $$((<< _f_i_l_e)). + + When the old-style backquote form of substitution is used, backslash + retains its literal meaning except when followed by $$, ``, or \\. The + first backquote not preceded by a backslash terminates the command sub- + stitution. When using the $(_c_o_m_m_a_n_d) form, all characters between the + parentheses make up the command; none are treated specially. + + Command substitutions may be nested. To nest when using the backquoted + form, escape the inner backquotes with backslashes. + + If the substitution appears within double quotes, word splitting and + pathname expansion are not performed on the results. + + AArriitthhmmeettiicc EExxppaannssiioonn + Arithmetic expansion allows the evaluation of an arithmetic expression + and the substitution of the result. The format for arithmetic expan- + sion is: + + $$((((_e_x_p_r_e_s_s_i_o_n)))) + + The _e_x_p_r_e_s_s_i_o_n is treated as if it were within double quotes, but a + double quote inside the parentheses is not treated specially. All + tokens in the expression undergo parameter and variable expansion, com- + mand substitution, and quote removal. The result is treated as the + arithmetic expression to be evaluated. Arithmetic expansions may be + nested. + + The evaluation is performed according to the rules listed below under + AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. If _e_x_p_r_e_s_s_i_o_n is invalid, bbaasshh prints a message + indicating failure and no substitution occurs. + + PPrroocceessss SSuubbssttiittuuttiioonn + _P_r_o_c_e_s_s _s_u_b_s_t_i_t_u_t_i_o_n is supported on systems that support named pipes + (_F_I_F_O_s) or the //ddeevv//ffdd method of naming open files. It takes the form + of <<((_l_i_s_t)) or >>((_l_i_s_t)). The process _l_i_s_t is run with its input or out- + put connected to a _F_I_F_O or some file in //ddeevv//ffdd. The name of this file + is passed as an argument to the current command as the result of the + expansion. If the >>((_l_i_s_t)) form is used, writing to the file will pro- + vide input for _l_i_s_t. If the <<((_l_i_s_t)) form is used, the file passed as + an argument should be read to obtain the output of _l_i_s_t. + + When available, process substitution is performed simultaneously with + parameter and variable expansion, command substitution, and arithmetic + expansion. + + WWoorrdd SSpplliittttiinngg + The shell scans the results of parameter expansion, command substitu- + tion, and arithmetic expansion that did not occur within double quotes + for _w_o_r_d _s_p_l_i_t_t_i_n_g. + + The shell treats each character of IIFFSS as a delimiter, and splits the + results of the other expansions into words using these characters as + field terminators. If IIFFSS is unset, or its value is exactly + <><><>, the default, then sequences of <>, <>, + and <> at the beginning and end of the results of the previous + expansions are ignored, and any sequence of IIFFSS characters not at the + beginning or end serves to delimit words. If IIFFSS has a value other + than the default, then sequences of the whitespace characters ssppaaccee and + ttaabb are ignored at the beginning and end of the word, as long as the + whitespace character is in the value of IIFFSS (an IIFFSS whitespace charac- + ter). Any character in IIFFSS that is not IIFFSS whitespace, along with any + adjacent IIFFSS whitespace characters, delimits a field. A sequence of + IIFFSS whitespace characters is also treated as a delimiter. If the value + of IIFFSS is null, no word splitting occurs. + + Explicit null arguments ("""" or '''') are retained. Unquoted implicit + null arguments, resulting from the expansion of parameters that have no + values, are removed. If a parameter with no value is expanded within + double quotes, a null argument results and is retained. + + Note that if no expansion occurs, no splitting is performed. + + PPaatthhnnaammee EExxppaannssiioonn + After word splitting, unless the --ff option has been set, bbaasshh scans + each word for the characters **, ??, and [[. If one of these characters + appears, then the word is regarded as a _p_a_t_t_e_r_n, and replaced with an + alphabetically sorted list of filenames matching the pattern (see PPaatt-- + tteerrnn MMaattcchhiinngg below). If no matching filenames are found, and the + shell option nnuullllgglloobb is not enabled, the word is left unchanged. If + the nnuullllgglloobb option is set, and no matches are found, the word is + removed. If the ffaaiillgglloobb shell option is set, and no matches are + found, an error message is printed and the command is not executed. If + the shell option nnooccaasseegglloobb is enabled, the match is performed without + regard to the case of alphabetic characters. When a pattern is used + for pathname expansion, the character ````..'''' at the start of a name or + immediately following a slash must be matched explicitly, unless the + shell option ddoottgglloobb is set. When matching a pathname, the slash char- + acter must always be matched explicitly. In other cases, the ````..'''' + character is not treated specially. See the description of sshhoopptt below + under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS for a description of the nnooccaasseegglloobb, nnuullll-- + gglloobb, ffaaiillgglloobb, and ddoottgglloobb shell options. + + The GGLLOOBBIIGGNNOORREE shell variable may be used to restrict the set of file- + names matching a _p_a_t_t_e_r_n. If GGLLOOBBIIGGNNOORREE is set, each matching filename + that also matches one of the patterns in GGLLOOBBIIGGNNOORREE is removed from the + list of matches. The filenames ````..'''' and ````....'''' are always ignored + when GGLLOOBBIIGGNNOORREE is set and not null. However, setting GGLLOOBBIIGGNNOORREE to a + non-null value has the effect of enabling the ddoottgglloobb shell option, so + all other filenames beginning with a ````..'''' will match. To get the old + behavior of ignoring filenames beginning with a ````..'''', make ````..**'''' one + of the patterns in GGLLOOBBIIGGNNOORREE. The ddoottgglloobb option is disabled when + GGLLOOBBIIGGNNOORREE is unset. + + PPaatttteerrnn MMaattcchhiinngg + + Any character that appears in a pattern, other than the special pattern + characters described below, matches itself. The NUL character may not + occur in a pattern. A backslash escapes the following character; the + escaping backslash is discarded when matching. The special pattern + characters must be quoted if they are to be matched literally. + + The special pattern characters have the following meanings: + + ** Matches any string, including the null string. When the + gglloobbssttaarr shell option is enabled, and ** is used in a + pathname expansion context, two adjacent **s used as a + single pattern will match all files and zero or more + directories and subdirectories. If followed by a //, two + adjacent **s will match only directories and subdirecto- + ries. + ?? Matches any single character. + [[......]] Matches any one of the enclosed characters. A pair of + characters separated by a hyphen denotes a _r_a_n_g_e _e_x_p_r_e_s_- + _s_i_o_n; any character that falls between those two charac- + ters, inclusive, using the current locale's collating + sequence and character set, is matched. If the first + character following the [[ is a !! or a ^^ then any charac- + ter not enclosed is matched. The sorting order of char- + acters in range expressions is determined by the current + locale and the values of the LLCC__CCOOLLLLAATTEE or LLCC__AALLLL shell + variables, if set. To obtain the traditional interpreta- + tion of range expressions, where [[aa--dd]] is equivalent to + [[aabbccdd]], set value of the LLCC__AALLLL shell variable to CC, or + enable the gglloobbaasscciiiirraannggeess shell option. A -- may be + matched by including it as the first or last character in + the set. A ]] may be matched by including it as the first + character in the set. + + Within [[ and ]], _c_h_a_r_a_c_t_e_r _c_l_a_s_s_e_s can be specified using + the syntax [[::_c_l_a_s_s::]], where _c_l_a_s_s is one of the following + classes defined in the POSIX standard: + aallnnuumm aallpphhaa aasscciiii bbllaannkk ccnnttrrll ddiiggiitt ggrraapphh lloowweerr pprriinntt + ppuunncctt ssppaaccee uuppppeerr wwoorrdd xxddiiggiitt + A character class matches any character belonging to that + class. The wwoorrdd character class matches letters, digits, + and the character _. + + Within [[ and ]], an _e_q_u_i_v_a_l_e_n_c_e _c_l_a_s_s can be specified + using the syntax [[==_c==]], which matches all characters with + the same collation weight (as defined by the current + locale) as the character _c. + + Within [[ and ]], the syntax [[.._s_y_m_b_o_l..]] matches the collat- + ing symbol _s_y_m_b_o_l. + + If the eexxttgglloobb shell option is enabled using the sshhoopptt builtin, several + extended pattern matching operators are recognized. In the following + description, a _p_a_t_t_e_r_n_-_l_i_s_t is a list of one or more patterns separated + by a ||. Composite patterns may be formed using one or more of the fol- + lowing sub-patterns: + + ??((_p_a_t_t_e_r_n_-_l_i_s_t)) + Matches zero or one occurrence of the given patterns + **((_p_a_t_t_e_r_n_-_l_i_s_t)) + Matches zero or more occurrences of the given patterns + ++((_p_a_t_t_e_r_n_-_l_i_s_t)) + Matches one or more occurrences of the given patterns + @@((_p_a_t_t_e_r_n_-_l_i_s_t)) + Matches one of the given patterns + !!((_p_a_t_t_e_r_n_-_l_i_s_t)) + Matches anything except one of the given patterns + + QQuuoottee RReemmoovvaall + After the preceding expansions, all unquoted occurrences of the charac- + ters \\, '', and "" that did not result from one of the above expansions + are removed. + +RREEDDIIRREECCTTIIOONN + Before a command is executed, its input and output may be _r_e_d_i_r_e_c_t_e_d + using a special notation interpreted by the shell. Redirection allows + commands' file handles to be duplicated, opened, closed, made to refer + to different files, and can change the files the command reads from and + writes to. Redirection may also be used to modify file handles in the + current shell execution environment. The following redirection opera- + tors may precede or appear anywhere within a _s_i_m_p_l_e _c_o_m_m_a_n_d or may fol- + low a _c_o_m_m_a_n_d. Redirections are processed in the order they appear, + from left to right. + + Each redirection that may be preceded by a file descriptor number may + instead be preceded by a word of the form {_v_a_r_n_a_m_e}. In this case, for + each redirection operator except >&- and <&-, the shell will allocate a + file descriptor greater than or equal to 10 and assign it to _v_a_r_n_a_m_e. + If >&- or <&- is preceded by {_v_a_r_n_a_m_e}, the value of _v_a_r_n_a_m_e defines + the file descriptor to close. + + In the following descriptions, if the file descriptor number is omit- + ted, and the first character of the redirection operator is <<, the re- + direction refers to the standard input (file descriptor 0). If the + first character of the redirection operator is >>, the redirection + refers to the standard output (file descriptor 1). + + The word following the redirection operator in the following descrip- + tions, unless otherwise noted, is subjected to brace expansion, tilde + expansion, parameter and variable expansion, command substitution, + arithmetic expansion, quote removal, pathname expansion, and word + splitting. If it expands to more than one word, bbaasshh reports an error. + + Note that the order of redirections is significant. For example, the + command + + ls >> dirlist 2>>&&1 + + directs both standard output and standard error to the file _d_i_r_l_i_s_t, + while the command + + ls 2>>&&1 >> dirlist + + directs only the standard output to file _d_i_r_l_i_s_t, because the standard + error was duplicated from the standard output before the standard out- + put was redirected to _d_i_r_l_i_s_t. + + BBaasshh handles several filenames specially when they are used in redirec- + tions, as described in the following table: + + //ddeevv//ffdd//_f_d + If _f_d is a valid integer, file descriptor _f_d is dupli- + cated. + //ddeevv//ssttddiinn + File descriptor 0 is duplicated. + //ddeevv//ssttddoouutt + File descriptor 1 is duplicated. + //ddeevv//ssttddeerrrr + File descriptor 2 is duplicated. + //ddeevv//ttccpp//_h_o_s_t//_p_o_r_t + If _h_o_s_t is a valid hostname or Internet address, and _p_o_r_t + is an integer port number or service name, bbaasshh attempts + to open the corresponding TCP socket. + //ddeevv//uuddpp//_h_o_s_t//_p_o_r_t + If _h_o_s_t is a valid hostname or Internet address, and _p_o_r_t + is an integer port number or service name, bbaasshh attempts + to open the corresponding UDP socket. + + A failure to open or create a file causes the redirection to fail. + + Redirections using file descriptors greater than 9 should be used with + care, as they may conflict with file descriptors the shell uses inter- + nally. + + RReeddiirreeccttiinngg IInnppuutt + Redirection of input causes the file whose name results from the expan- + sion of _w_o_r_d to be opened for reading on file descriptor _n, or the + standard input (file descriptor 0) if _n is not specified. + + The general format for redirecting input is: + + [_n]<<_w_o_r_d + + RReeddiirreeccttiinngg OOuuttppuutt + Redirection of output causes the file whose name results from the + expansion of _w_o_r_d to be opened for writing on file descriptor _n, or the + standard output (file descriptor 1) if _n is not specified. If the file + does not exist it is created; if it does exist it is truncated to zero + size. + + The general format for redirecting output is: + + [_n]>>_w_o_r_d + + If the redirection operator is >>, and the nnoocclloobbbbeerr option to the sseett + builtin has been enabled, the redirection will fail if the file whose + name results from the expansion of _w_o_r_d exists and is a regular file. + If the redirection operator is >>||, or the redirection operator is >> and + the nnoocclloobbbbeerr option to the sseett builtin command is not enabled, the re- + direction is attempted even if the file named by _w_o_r_d exists. + + AAppppeennddiinngg RReeddiirreecctteedd OOuuttppuutt + Redirection of output in this fashion causes the file whose name + results from the expansion of _w_o_r_d to be opened for appending on file + descriptor _n, or the standard output (file descriptor 1) if _n is not + specified. If the file does not exist it is created. + + The general format for appending output is: + + [_n]>>>>_w_o_r_d + + + RReeddiirreeccttiinngg SSttaannddaarrdd OOuuttppuutt aanndd SSttaannddaarrdd EErrrroorr + This construct allows both the standard output (file descriptor 1) and + the standard error output (file descriptor 2) to be redirected to the + file whose name is the expansion of _w_o_r_d. + + There are two formats for redirecting standard output and standard + error: + + &&>>_w_o_r_d + and + >>&&_w_o_r_d + + Of the two forms, the first is preferred. This is semantically equiva- + lent to + + >>_w_o_r_d 2>>&&1 + + When using the second form, _w_o_r_d may not expand to a number or --. If + it does, other redirection operators apply (see DDuupplliiccaattiinngg FFiillee + DDeessccrriippttoorrss below) for compatibility reasons. + + AAppppeennddiinngg SSttaannddaarrdd OOuuttppuutt aanndd SSttaannddaarrdd EErrrroorr + This construct allows both the standard output (file descriptor 1) and + the standard error output (file descriptor 2) to be appended to the + file whose name is the expansion of _w_o_r_d. + + The format for appending standard output and standard error is: + + &&>>>>_w_o_r_d + + This is semantically equivalent to + + >>>>_w_o_r_d 2>>&&1 + + (see DDuupplliiccaattiinngg FFiillee DDeessccrriippttoorrss below). + + HHeerree DDooccuummeennttss + This type of redirection instructs the shell to read input from the + current source until a line containing only _d_e_l_i_m_i_t_e_r (with no trailing + blanks) is seen. All of the lines read up to that point are then used + as the standard input for a command. + + The format of here-documents is: + + <<<<[--]_w_o_r_d + _h_e_r_e_-_d_o_c_u_m_e_n_t + _d_e_l_i_m_i_t_e_r + + No parameter and variable expansion, command substitution, arithmetic + expansion, or pathname expansion is performed on _w_o_r_d. If any charac- + ters in _w_o_r_d are quoted, the _d_e_l_i_m_i_t_e_r is the result of quote removal + on _w_o_r_d, and the lines in the here-document are not expanded. If _w_o_r_d + is unquoted, all lines of the here-document are subjected to parameter + expansion, command substitution, and arithmetic expansion, the charac- + ter sequence \\<> is ignored, and \\ must be used to quote the + characters \\, $$, and ``. + + If the redirection operator is <<<<--, then all leading tab characters are + stripped from input lines and the line containing _d_e_l_i_m_i_t_e_r. This + allows here-documents within shell scripts to be indented in a natural + fashion. + + HHeerree SSttrriinnggss + A variant of here documents, the format is: + + <<<<<<_w_o_r_d + + The _w_o_r_d undergoes brace expansion, tilde expansion, parameter and + variable expansion, command substitution, arithmetic expansion, and + quote removal. Pathname expansion and word splitting are not per- + formed. The result is supplied as a single string to the command on + its standard input. + + DDuupplliiccaattiinngg FFiillee DDeessccrriippttoorrss + The redirection operator + + [_n]<<&&_w_o_r_d + + is used to duplicate input file descriptors. If _w_o_r_d expands to one or + more digits, the file descriptor denoted by _n is made to be a copy of + that file descriptor. If the digits in _w_o_r_d do not specify a file + descriptor open for input, a redirection error occurs. If _w_o_r_d evalu- + ates to --, file descriptor _n is closed. If _n is not specified, the + standard input (file descriptor 0) is used. + + The operator + + [_n]>>&&_w_o_r_d + + is used similarly to duplicate output file descriptors. If _n is not + specified, the standard output (file descriptor 1) is used. If the + digits in _w_o_r_d do not specify a file descriptor open for output, a re- + direction error occurs. If _w_o_r_d evaluates to --, file descriptor _n is + closed. As a special case, if _n is omitted, and _w_o_r_d does not expand + to one or more digits or --, the standard output and standard error are + redirected as described previously. + + MMoovviinngg FFiillee DDeessccrriippttoorrss + The redirection operator + + [_n]<<&&_d_i_g_i_t-- + + moves the file descriptor _d_i_g_i_t to file descriptor _n, or the standard + input (file descriptor 0) if _n is not specified. _d_i_g_i_t is closed after + being duplicated to _n. + + Similarly, the redirection operator + + [_n]>>&&_d_i_g_i_t-- + + moves the file descriptor _d_i_g_i_t to file descriptor _n, or the standard + output (file descriptor 1) if _n is not specified. + + OOppeenniinngg FFiillee DDeessccrriippttoorrss ffoorr RReeaaddiinngg aanndd WWrriittiinngg + The redirection operator + + [_n]<<>>_w_o_r_d + + causes the file whose name is the expansion of _w_o_r_d to be opened for + both reading and writing on file descriptor _n, or on file descriptor 0 + if _n is not specified. If the file does not exist, it is created. + +AALLIIAASSEESS + _A_l_i_a_s_e_s allow a string to be substituted for a word when it is used as + the first word of a simple command. The shell maintains a list of + aliases that may be set and unset with the aalliiaass and uunnaalliiaass builtin + commands (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). The first word of each + simple command, if unquoted, is checked to see if it has an alias. If + so, that word is replaced by the text of the alias. The characters //, + $$, ``, and == and any of the shell _m_e_t_a_c_h_a_r_a_c_t_e_r_s or quoting characters + listed above may not appear in an alias name. The replacement text may + contain any valid shell input, including shell metacharacters. The + first word of the replacement text is tested for aliases, but a word + that is identical to an alias being expanded is not expanded a second + time. This means that one may alias llss to llss --FF, for instance, and + bbaasshh does not try to recursively expand the replacement text. If the + last character of the alias value is a _b_l_a_n_k, then the next command + word following the alias is also checked for alias expansion. + + Aliases are created and listed with the aalliiaass command, and removed with + the uunnaalliiaass command. + + There is no mechanism for using arguments in the replacement text. If + arguments are needed, a shell function should be used (see FFUUNNCCTTIIOONNSS + below). + + Aliases are not expanded when the shell is not interactive, unless the + eexxppaanndd__aalliiaasseess shell option is set using sshhoopptt (see the description of + sshhoopptt under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + + The rules concerning the definition and use of aliases are somewhat + confusing. BBaasshh always reads at least one complete line of input + before executing any of the commands on that line. Aliases are + expanded when a command is read, not when it is executed. Therefore, + an alias definition appearing on the same line as another command does + not take effect until the next line of input is read. The commands + following the alias definition on that line are not affected by the new + alias. This behavior is also an issue when functions are executed. + Aliases are expanded when a function definition is read, not when the + function is executed, because a function definition is itself a com- + pound command. As a consequence, aliases defined in a function are not + available until after that function is executed. To be safe, always + put alias definitions on a separate line, and do not use aalliiaass in com- + pound commands. + + For almost every purpose, aliases are superseded by shell functions. + +FFUUNNCCTTIIOONNSS + A shell function, defined as described above under SSHHEELLLL GGRRAAMMMMAARR, + stores a series of commands for later execution. When the name of a + shell function is used as a simple command name, the list of commands + associated with that function name is executed. Functions are executed + in the context of the current shell; no new process is created to + interpret them (contrast this with the execution of a shell script). + When a function is executed, the arguments to the function become the + positional parameters during its execution. The special parameter ## is + updated to reflect the change. Special parameter 00 is unchanged. The + first element of the FFUUNNCCNNAAMMEE variable is set to the name of the func- + tion while the function is executing. + + All other aspects of the shell execution environment are identical + between a function and its caller with these exceptions: the DDEEBBUUGG and + RREETTUURRNN traps (see the description of the ttrraapp builtin under SSHHEELLLL + BBUUIILLTTIINN CCOOMMMMAANNDDSS below) are not inherited unless the function has been + given the ttrraaccee attribute (see the description of the ddeeccllaarree builtin + below) or the --oo ffuunnccttrraaccee shell option has been enabled with the sseett + builtin (in which case all functions inherit the DDEEBBUUGG and RREETTUURRNN + traps), and the EERRRR trap is not inherited unless the --oo eerrrrttrraaccee shell + option has been enabled. + + Variables local to the function may be declared with the llooccaall builtin + command. Ordinarily, variables and their values are shared between the + function and its caller. + + The FFUUNNCCNNEESSTT variable, if set to a numeric value greater than 0, + defines a maximum function nesting level. Function invocations that + exceed the limit cause the entire command to abort. + + If the builtin command rreettuurrnn is executed in a function, the function + completes and execution resumes with the next command after the func- + tion call. Any command associated with the RREETTUURRNN trap is executed + before execution resumes. When a function completes, the values of the + positional parameters and the special parameter ## are restored to the + values they had prior to the function's execution. + + Function names and definitions may be listed with the --ff option to the + ddeeccllaarree or ttyyppeesseett builtin commands. The --FF option to ddeeccllaarree or ttyyppee-- + sseett will list the function names only (and optionally the source file + and line number, if the eexxttddeebbuugg shell option is enabled). Functions + may be exported so that subshells automatically have them defined with + the --ff option to the eexxppoorrtt builtin. A function definition may be + deleted using the --ff option to the uunnsseett builtin. Note that shell + functions and variables with the same name may result in multiple iden- + tically-named entries in the environment passed to the shell's chil- + dren. Care should be taken in cases where this may cause a problem. + + Functions may be recursive. The FFUUNNCCNNEESSTT variable may be used to limit + the depth of the function call stack and restrict the number of func- + tion invocations. By default, no limit is imposed on the number of + recursive calls. + +AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN + The shell allows arithmetic expressions to be evaluated, under certain + circumstances (see the lleett and ddeeccllaarree builtin commands and AArriitthhmmeettiicc + EExxppaannssiioonn). Evaluation is done in fixed-width integers with no check + for overflow, though division by 0 is trapped and flagged as an error. + The operators and their precedence, associativity, and values are the + same as in the C language. The following list of operators is grouped + into levels of equal-precedence operators. The levels are listed in + order of decreasing precedence. + + _i_d++++ _i_d---- + variable post-increment and post-decrement + ++++_i_d ----_i_d + variable pre-increment and pre-decrement + -- ++ unary minus and plus + !! ~~ logical and bitwise negation + **** exponentiation + ** // %% multiplication, division, remainder + ++ -- addition, subtraction + <<<< >>>> left and right bitwise shifts + <<== >>== << >> + comparison + ==== !!== equality and inequality + && bitwise AND + ^^ bitwise exclusive OR + || bitwise OR + &&&& logical AND + |||| logical OR + _e_x_p_r??_e_x_p_r::_e_x_p_r + conditional operator + == **== //== %%== ++== --== <<<<== >>>>== &&== ^^== ||== + assignment + _e_x_p_r_1 ,, _e_x_p_r_2 + comma + + Shell variables are allowed as operands; parameter expansion is per- + formed before the expression is evaluated. Within an expression, shell + variables may also be referenced by name without using the parameter + expansion syntax. A shell variable that is null or unset evaluates to + 0 when referenced by name without using the parameter expansion syntax. + The value of a variable is evaluated as an arithmetic expression when + it is referenced, or when a variable which has been given the _i_n_t_e_g_e_r + attribute using ddeeccllaarree --ii is assigned a value. A null value evaluates + to 0. A shell variable need not have its _i_n_t_e_g_e_r attribute turned on + to be used in an expression. + + Constants with a leading 0 are interpreted as octal numbers. A leading + 0x or 0X denotes hexadecimal. Otherwise, numbers take the form + [_b_a_s_e_#]n, where the optional _b_a_s_e is a decimal number between 2 and 64 + representing the arithmetic base, and _n is a number in that base. If + _b_a_s_e_# is omitted, then base 10 is used. When specifying _n, the digits + greater< than 9 are represented by the lowercase letters, the uppercase + letters, @, and _, in that order. If _b_a_s_e is less than or equal to 36, + lowercase and uppercase letters may be used interchangeably to repre- + sent numbers between 10 and 35. + + Operators are evaluated in order of precedence. Sub-expressions in + parentheses are evaluated first and may override the precedence rules + above. + +CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS + Conditional expressions are used by the [[[[ compound command and the + tteesstt and [[ builtin commands to test file attributes and perform string + and arithmetic comparisons. Expressions are formed from the following + unary or binary primaries. If any _f_i_l_e argument to one of the pri- + maries is of the form _/_d_e_v_/_f_d_/_n, then file descriptor _n is checked. If + the _f_i_l_e argument to one of the primaries is one of _/_d_e_v_/_s_t_d_i_n, + _/_d_e_v_/_s_t_d_o_u_t, or _/_d_e_v_/_s_t_d_e_r_r, file descriptor 0, 1, or 2, respectively, + is checked. + + Unless otherwise specified, primaries that operate on files follow sym- + bolic links and operate on the target of the link, rather than the link + itself. + + When used with [[[[, the << and >> operators sort lexicographically using + the current locale. The tteesstt command sorts using ASCII ordering. + + --aa _f_i_l_e + True if _f_i_l_e exists. + --bb _f_i_l_e + True if _f_i_l_e exists and is a block special file. + --cc _f_i_l_e + True if _f_i_l_e exists and is a character special file. + --dd _f_i_l_e + True if _f_i_l_e exists and is a directory. + --ee _f_i_l_e + True if _f_i_l_e exists. + --ff _f_i_l_e + True if _f_i_l_e exists and is a regular file. + --gg _f_i_l_e + True if _f_i_l_e exists and is set-group-id. + --hh _f_i_l_e + True if _f_i_l_e exists and is a symbolic link. + --kk _f_i_l_e + True if _f_i_l_e exists and its ``sticky'' bit is set. + --pp _f_i_l_e + True if _f_i_l_e exists and is a named pipe (FIFO). + --rr _f_i_l_e + True if _f_i_l_e exists and is readable. + --ss _f_i_l_e + True if _f_i_l_e exists and has a size greater than zero. + --tt _f_d True if file descriptor _f_d is open and refers to a terminal. + --uu _f_i_l_e + True if _f_i_l_e exists and its set-user-id bit is set. + --ww _f_i_l_e + True if _f_i_l_e exists and is writable. + --xx _f_i_l_e + True if _f_i_l_e exists and is executable. + --GG _f_i_l_e + True if _f_i_l_e exists and is owned by the effective group id. + --LL _f_i_l_e + True if _f_i_l_e exists and is a symbolic link. + --NN _f_i_l_e + True if _f_i_l_e exists and has been modified since it was last + read. + --OO _f_i_l_e + True if _f_i_l_e exists and is owned by the effective user id. + --SS _f_i_l_e + True if _f_i_l_e exists and is a socket. + _f_i_l_e_1 --eeff _f_i_l_e_2 + True if _f_i_l_e_1 and _f_i_l_e_2 refer to the same device and inode num- + bers. + _f_i_l_e_1 -nntt _f_i_l_e_2 + True if _f_i_l_e_1 is newer (according to modification date) than + _f_i_l_e_2, or if _f_i_l_e_1 exists and _f_i_l_e_2 does not. + _f_i_l_e_1 -oott _f_i_l_e_2 + True if _f_i_l_e_1 is older than _f_i_l_e_2, or if _f_i_l_e_2 exists and _f_i_l_e_1 + does not. + --oo _o_p_t_n_a_m_e + True if the shell option _o_p_t_n_a_m_e is enabled. See the list of + options under the description of the --oo option to the sseett + builtin below. + --vv _v_a_r_n_a_m_e + True if the shell variable _v_a_r_n_a_m_e is set (has been assigned a + value). + --RR _v_a_r_n_a_m_e + True if the shell variable _v_a_r_n_a_m_e is set and is a name refer- + ence. + --zz _s_t_r_i_n_g + True if the length of _s_t_r_i_n_g is zero. + _s_t_r_i_n_g + --nn _s_t_r_i_n_g + True if the length of _s_t_r_i_n_g is non-zero. + + _s_t_r_i_n_g_1 ==== _s_t_r_i_n_g_2 + _s_t_r_i_n_g_1 == _s_t_r_i_n_g_2 + True if the strings are equal. == should be used with the tteesstt + command for POSIX conformance. When used with the [[[[ command, + this performs pattern matching as described above (CCoommppoouunndd CCoomm-- + mmaannddss). + + _s_t_r_i_n_g_1 !!== _s_t_r_i_n_g_2 + True if the strings are not equal. + + _s_t_r_i_n_g_1 << _s_t_r_i_n_g_2 + True if _s_t_r_i_n_g_1 sorts before _s_t_r_i_n_g_2 lexicographically. + + _s_t_r_i_n_g_1 >> _s_t_r_i_n_g_2 + True if _s_t_r_i_n_g_1 sorts after _s_t_r_i_n_g_2 lexicographically. + + _a_r_g_1 OOPP _a_r_g_2 + OOPP is one of --eeqq, --nnee, --lltt, --llee, --ggtt, or --ggee. These arithmetic + binary operators return true if _a_r_g_1 is equal to, not equal to, + less than, less than or equal to, greater than, or greater than + or equal to _a_r_g_2, respectively. _A_r_g_1 and _a_r_g_2 may be positive + or negative integers. + +SSIIMMPPLLEE CCOOMMMMAANNDD EEXXPPAANNSSIIOONN + When a simple command is executed, the shell performs the following + expansions, assignments, and redirections, from left to right. + + 1. The words that the parser has marked as variable assignments + (those preceding the command name) and redirections are saved + for later processing. + + 2. The words that are not variable assignments or redirections are + expanded. If any words remain after expansion, the first word + is taken to be the name of the command and the remaining words + are the arguments. + + 3. Redirections are performed as described above under RREEDDIIRREECCTTIIOONN. + + 4. The text after the == in each variable assignment undergoes tilde + expansion, parameter expansion, command substitution, arithmetic + expansion, and quote removal before being assigned to the vari- + able. + + If no command name results, the variable assignments affect the current + shell environment. Otherwise, the variables are added to the environ- + ment of the executed command and do not affect the current shell envi- + ronment. If any of the assignments attempts to assign a value to a + readonly variable, an error occurs, and the command exits with a non- + zero status. + + If no command name results, redirections are performed, but do not + affect the current shell environment. A redirection error causes the + command to exit with a non-zero status. + + If there is a command name left after expansion, execution proceeds as + described below. Otherwise, the command exits. If one of the expan- + sions contained a command substitution, the exit status of the command + is the exit status of the last command substitution performed. If + there were no command substitutions, the command exits with a status of + zero. + +CCOOMMMMAANNDD EEXXEECCUUTTIIOONN + After a command has been split into words, if it results in a simple + command and an optional list of arguments, the following actions are + taken. + + If the command name contains no slashes, the shell attempts to locate + it. If there exists a shell function by that name, that function is + invoked as described above in FFUUNNCCTTIIOONNSS. If the name does not match a + function, the shell searches for it in the list of shell builtins. If + a match is found, that builtin is invoked. + + If the name is neither a shell function nor a builtin, and contains no + slashes, bbaasshh searches each element of the PPAATTHH for a directory con- + taining an executable file by that name. BBaasshh uses a hash table to + remember the full pathnames of executable files (see hhaasshh under SSHHEELLLL + BBUUIILLTTIINN CCOOMMMMAANNDDSS below). A full search of the directories in PPAATTHH is + performed only if the command is not found in the hash table. If the + search is unsuccessful, the shell searches for a defined shell function + named ccoommmmaanndd__nnoott__ffoouunndd__hhaannddllee. If that function exists, it is invoked + with the original command and the original command's arguments as its + arguments, and the function's exit status becomes the exit status of + the shell. If that function is not defined, the shell prints an error + message and returns an exit status of 127. + + If the search is successful, or if the command name contains one or + more slashes, the shell executes the named program in a separate execu- + tion environment. Argument 0 is set to the name given, and the remain- + ing arguments to the command are set to the arguments given, if any. + + If this execution fails because the file is not in executable format, + and the file is not a directory, it is assumed to be a _s_h_e_l_l _s_c_r_i_p_t, a + file containing shell commands. A subshell is spawned to execute it. + This subshell reinitializes itself, so that the effect is as if a new + shell had been invoked to handle the script, with the exception that + the locations of commands remembered by the parent (see hhaasshh below + under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS) are retained by the child. + + If the program is a file beginning with ##!!, the remainder of the first + line specifies an interpreter for the program. The shell executes the + specified interpreter on operating systems that do not handle this exe- + cutable format themselves. The arguments to the interpreter consist of + a single optional argument following the interpreter name on the first + line of the program, followed by the name of the program, followed by + the command arguments, if any. + +CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONNMMEENNTT + The shell has an _e_x_e_c_u_t_i_o_n _e_n_v_i_r_o_n_m_e_n_t, which consists of the follow- + ing: + + +o open files inherited by the shell at invocation, as modified by + redirections supplied to the eexxeecc builtin + + +o the current working directory as set by ccdd, ppuusshhdd, or ppooppdd, or + inherited by the shell at invocation + + +o the file creation mode mask as set by uummaasskk or inherited from + the shell's parent + + +o current traps set by ttrraapp + + +o shell parameters that are set by variable assignment or with sseett + or inherited from the shell's parent in the environment + + +o shell functions defined during execution or inherited from the + shell's parent in the environment + + +o options enabled at invocation (either by default or with com- + mand-line arguments) or by sseett + + +o options enabled by sshhoopptt + + +o shell aliases defined with aalliiaass + + +o various process IDs, including those of background jobs, the + value of $$$$, and the value of PPPPIIDD + + When a simple command other than a builtin or shell function is to be + executed, it is invoked in a separate execution environment that con- + sists of the following. Unless otherwise noted, the values are inher- + ited from the shell. + + + +o the shell's open files, plus any modifications and additions + specified by redirections to the command + + +o the current working directory + + +o the file creation mode mask + + +o shell variables and functions marked for export, along with + variables exported for the command, passed in the environment + + +o traps caught by the shell are reset to the values inherited from + the shell's parent, and traps ignored by the shell are ignored + + A command invoked in this separate environment cannot affect the + shell's execution environment. + + Command substitution, commands grouped with parentheses, and asynchro- + nous commands are invoked in a subshell environment that is a duplicate + of the shell environment, except that traps caught by the shell are + reset to the values that the shell inherited from its parent at invoca- + tion. Builtin commands that are invoked as part of a pipeline are also + executed in a subshell environment. Changes made to the subshell envi- + ronment cannot affect the shell's execution environment. + + Subshells spawned to execute command substitutions inherit the value of + the --ee option from the parent shell. When not in _p_o_s_i_x mode, bbaasshh + clears the --ee option in such subshells. + + If a command is followed by a && and job control is not active, the + default standard input for the command is the empty file _/_d_e_v_/_n_u_l_l. + Otherwise, the invoked command inherits the file descriptors of the + calling shell as modified by redirections. + +EENNVVIIRROONNMMEENNTT + When a program is invoked it is given an array of strings called the + _e_n_v_i_r_o_n_m_e_n_t. This is a list of _n_a_m_e-_v_a_l_u_e pairs, of the form + _n_a_m_e=_v_a_l_u_e. + + The shell provides several ways to manipulate the environment. On + invocation, the shell scans its own environment and creates a parameter + for each name found, automatically marking it for _e_x_p_o_r_t to child pro- + cesses. Executed commands inherit the environment. The eexxppoorrtt and + ddeeccllaarree --xx commands allow parameters and functions to be added to and + deleted from the environment. If the value of a parameter in the envi- + ronment is modified, the new value becomes part of the environment, + replacing the old. The environment inherited by any executed command + consists of the shell's initial environment, whose values may be modi- + fied in the shell, less any pairs removed by the uunnsseett command, plus + any additions via the eexxppoorrtt and ddeeccllaarree --xx commands. + + The environment for any _s_i_m_p_l_e _c_o_m_m_a_n_d or function may be augmented + temporarily by prefixing it with parameter assignments, as described + above in PPAARRAAMMEETTEERRSS. These assignment statements affect only the envi- + ronment seen by that command. + + If the --kk option is set (see the sseett builtin command below), then _a_l_l + parameter assignments are placed in the environment for a command, not + just those that precede the command name. + + When bbaasshh invokes an external command, the variable __ is set to the + full filename of the command and passed to that command in its environ- + ment. + +EEXXIITT SSTTAATTUUSS + The exit status of an executed command is the value returned by the + _w_a_i_t_p_i_d system call or equivalent function. Exit statuses fall between + 0 and 255, though, as explained below, the shell may use values above + 125 specially. Exit statuses from shell builtins and compound commands + are also limited to this range. Under certain circumstances, the shell + will use special values to indicate specific failure modes. + + For the shell's purposes, a command which exits with a zero exit status + has succeeded. An exit status of zero indicates success. A non-zero + exit status indicates failure. When a command terminates on a fatal + signal _N, bbaasshh uses the value of 128+_N as the exit status. + + If a command is not found, the child process created to execute it + returns a status of 127. If a command is found but is not executable, + the return status is 126. + + If a command fails because of an error during expansion or redirection, + the exit status is greater than zero. + + Shell builtin commands return a status of 0 (_t_r_u_e) if successful, and + non-zero (_f_a_l_s_e) if an error occurs while they execute. All builtins + return an exit status of 2 to indicate incorrect usage. + + BBaasshh itself returns the exit status of the last command executed, + unless a syntax error occurs, in which case it exits with a non-zero + value. See also the eexxiitt builtin command below. + +SSIIGGNNAALLSS + When bbaasshh is interactive, in the absence of any traps, it ignores + SSIIGGTTEERRMM (so that kkiillll 00 does not kill an interactive shell), and SSIIGGIINNTT + is caught and handled (so that the wwaaiitt builtin is interruptible). In + all cases, bbaasshh ignores SSIIGGQQUUIITT. If job control is in effect, bbaasshh + ignores SSIIGGTTTTIINN, SSIIGGTTTTOOUU, and SSIIGGTTSSTTPP. + + Non-builtin commands run by bbaasshh have signal handlers set to the values + inherited by the shell from its parent. When job control is not in + effect, asynchronous commands ignore SSIIGGIINNTT and SSIIGGQQUUIITT in addition to + these inherited handlers. Commands run as a result of command substi- + tution ignore the keyboard-generated job control signals SSIIGGTTTTIINN, SSIIGGTT-- + TTOOUU, and SSIIGGTTSSTTPP. + + The shell exits by default upon receipt of a SSIIGGHHUUPP. Before exiting, + an interactive shell resends the SSIIGGHHUUPP to all jobs, running or + stopped. Stopped jobs are sent SSIIGGCCOONNTT to ensure that they receive the + SSIIGGHHUUPP. To prevent the shell from sending the signal to a particular + job, it should be removed from the jobs table with the ddiissoowwnn builtin + (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) or marked to not receive SSIIGGHHUUPP + using ddiissoowwnn --hh. + + If the hhuuppoonneexxiitt shell option has been set with sshhoopptt, bbaasshh sends a + SSIIGGHHUUPP to all jobs when an interactive login shell exits. + + If bbaasshh is waiting for a command to complete and receives a signal for + which a trap has been set, the trap will not be executed until the com- + mand completes. When bbaasshh is waiting for an asynchronous command via + the wwaaiitt builtin, the reception of a signal for which a trap has been + set will cause the wwaaiitt builtin to return immediately with an exit sta- + tus greater than 128, immediately after which the trap is executed. + +JJOOBB CCOONNTTRROOLL + _J_o_b _c_o_n_t_r_o_l refers to the ability to selectively stop (_s_u_s_p_e_n_d) the + execution of processes and continue (_r_e_s_u_m_e) their execution at a later + point. A user typically employs this facility via an interactive + interface supplied jointly by the operating system kernel's terminal + driver and bbaasshh. + + The shell associates a _j_o_b with each pipeline. It keeps a table of + currently executing jobs, which may be listed with the jjoobbss command. + When bbaasshh starts a job asynchronously (in the _b_a_c_k_g_r_o_u_n_d), it prints a + line that looks like: + + [1] 25647 + + indicating that this job is job number 1 and that the process ID of the + last process in the pipeline associated with this job is 25647. All of + the processes in a single pipeline are members of the same job. BBaasshh + uses the _j_o_b abstraction as the basis for job control. + + To facilitate the implementation of the user interface to job control, + the operating system maintains the notion of a _c_u_r_r_e_n_t _t_e_r_m_i_n_a_l _p_r_o_c_e_s_s + _g_r_o_u_p _I_D. Members of this process group (processes whose process group + ID is equal to the current terminal process group ID) receive keyboard- + generated signals such as SSIIGGIINNTT. These processes are said to be in + the _f_o_r_e_g_r_o_u_n_d. _B_a_c_k_g_r_o_u_n_d processes are those whose process group ID + differs from the terminal's; such processes are immune to keyboard-gen- + erated signals. Only foreground processes are allowed to read from or, + if the user so specifies with stty tostop, write to the terminal. + Background processes which attempt to read from (write to when stty + tostop is in effect) the terminal are sent a SSIIGGTTTTIINN ((SSIIGGTTTTOOUU)) signal + by the kernel's terminal driver, which, unless caught, suspends the + process. + + If the operating system on which bbaasshh is running supports job control, + bbaasshh contains facilities to use it. Typing the _s_u_s_p_e_n_d character (typ- + ically ^^ZZ, Control-Z) while a process is running causes that process to + be stopped and returns control to bbaasshh. Typing the _d_e_l_a_y_e_d _s_u_s_p_e_n_d + character (typically ^^YY, Control-Y) causes the process to be stopped + when it attempts to read input from the terminal, and control to be + returned to bbaasshh. The user may then manipulate the state of this job, + using the bbgg command to continue it in the background, the ffgg command + to continue it in the foreground, or the kkiillll command to kill it. A ^^ZZ + takes effect immediately, and has the additional side effect of causing + pending output and typeahead to be discarded. + + There are a number of ways to refer to a job in the shell. The charac- + ter %% introduces a job specification (_j_o_b_s_p_e_c). Job number _n may be + referred to as %%nn. A job may also be referred to using a prefix of the + name used to start it, or using a substring that appears in its command + line. For example, %%ccee refers to a stopped ccee job. If a prefix + matches more than one job, bbaasshh reports an error. Using %%??ccee, on the + other hand, refers to any job containing the string ccee in its command + line. If the substring matches more than one job, bbaasshh reports an + error. The symbols %%%% and %%++ refer to the shell's notion of the _c_u_r_- + _r_e_n_t _j_o_b, which is the last job stopped while it was in the foreground + or started in the background. The _p_r_e_v_i_o_u_s _j_o_b may be referenced using + %%--. If there is only a single job, %%++ and %%-- can both be used to refer + to that job. In output pertaining to jobs (e.g., the output of the + jjoobbss command), the current job is always flagged with a ++, and the pre- + vious job with a --. A single % (with no accompanying job specifica- + tion) also refers to the current job. + + Simply naming a job can be used to bring it into the foreground: %%11 is + a synonym for ````ffgg %%11'''', bringing job 1 from the background into the + foreground. Similarly, ````%%11 &&'''' resumes job 1 in the background, + equivalent to ````bbgg %%11''''. + + The shell learns immediately whenever a job changes state. Normally, + bbaasshh waits until it is about to print a prompt before reporting changes + in a job's status so as to not interrupt any other output. If the --bb + option to the sseett builtin command is enabled, bbaasshh reports such changes + immediately. Any trap on SSIIGGCCHHLLDD is executed for each child that + exits. + + If an attempt to exit bbaasshh is made while jobs are stopped (or, if the + cchheecckkjjoobbss shell option has been enabled using the sshhoopptt builtin, run- + ning), the shell prints a warning message, and, if the cchheecckkjjoobbss option + is enabled, lists the jobs and their statuses. The jjoobbss command may + then be used to inspect their status. If a second attempt to exit is + made without an intervening command, the shell does not print another + warning, and any stopped jobs are terminated. + +PPRROOMMPPTTIINNGG + When executing interactively, bbaasshh displays the primary prompt PPSS11 when + it is ready to read a command, and the secondary prompt PPSS22 when it + needs more input to complete a command. BBaasshh allows these prompt + strings to be customized by inserting a number of backslash-escaped + special characters that are decoded as follows: + \\aa an ASCII bell character (07) + \\dd the date in "Weekday Month Date" format (e.g., "Tue May + 26") + \\DD{{_f_o_r_m_a_t}} + the _f_o_r_m_a_t is passed to _s_t_r_f_t_i_m_e(3) and the result is + inserted into the prompt string; an empty _f_o_r_m_a_t results + in a locale-specific time representation. The braces are + required + \\ee an ASCII escape character (033) + \\hh the hostname up to the first `.' + \\HH the hostname + \\jj the number of jobs currently managed by the shell + \\ll the basename of the shell's terminal device name + \\nn newline + \\rr carriage return + \\ss the name of the shell, the basename of $$00 (the portion + following the final slash) + \\tt the current time in 24-hour HH:MM:SS format + \\TT the current time in 12-hour HH:MM:SS format + \\@@ the current time in 12-hour am/pm format + \\AA the current time in 24-hour HH:MM format + \\uu the username of the current user + \\vv the version of bbaasshh (e.g., 2.00) + \\VV the release of bbaasshh, version + patch level (e.g., 2.00.0) + \\ww the current working directory, with $$HHOOMMEE abbreviated + with a tilde (uses the value of the PPRROOMMPPTT__DDIIRRTTRRIIMM vari- + able) + \\WW the basename of the current working directory, with $$HHOOMMEE + abbreviated with a tilde + \\!! the history number of this command + \\## the command number of this command + \\$$ if the effective UID is 0, a ##, otherwise a $$ + \\_n_n_n the character corresponding to the octal number _n_n_n + \\\\ a backslash + \\[[ begin a sequence of non-printing characters, which could + be used to embed a terminal control sequence into the + prompt + \\]] end a sequence of non-printing characters + + The command number and the history number are usually different: the + history number of a command is its position in the history list, which + may include commands restored from the history file (see HHIISSTTOORRYY + below), while the command number is the position in the sequence of + commands executed during the current shell session. After the string + is decoded, it is expanded via parameter expansion, command substitu- + tion, arithmetic expansion, and quote removal, subject to the value of + the pprroommppttvvaarrss shell option (see the description of the sshhoopptt command + under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + +RREEAADDLLIINNEE + This is the library that handles reading input when using an interac- + tive shell, unless the ----nnooeeddiittiinngg option is given at shell invocation. + Line editing is also used when using the --ee option to the rreeaadd builtin. + By default, the line editing commands are similar to those of Emacs. A + vi-style line editing interface is also available. Line editing can be + enabled at any time using the --oo eemmaaccss or --oo vvii options to the sseett + builtin (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). To turn off line editing + after the shell is running, use the ++oo eemmaaccss or ++oo vvii options to the + sseett builtin. + + RReeaaddlliinnee NNoottaattiioonn + In this section, the Emacs-style notation is used to denote keystrokes. + Control keys are denoted by C-_k_e_y, e.g., C-n means Control-N. Simi- + larly, _m_e_t_a keys are denoted by M-_k_e_y, so M-x means Meta-X. (On key- + boards without a _m_e_t_a key, M-_x means ESC _x, i.e., press the Escape key + then the _x key. This makes ESC the _m_e_t_a _p_r_e_f_i_x. The combination M-C-_x + means ESC-Control-_x, or press the Escape key then hold the Control key + while pressing the _x key.) + + Readline commands may be given numeric _a_r_g_u_m_e_n_t_s, which normally act as + a repeat count. Sometimes, however, it is the sign of the argument + that is significant. Passing a negative argument to a command that + acts in the forward direction (e.g., kkiillll--lliinnee) causes that command to + act in a backward direction. Commands whose behavior with arguments + deviates from this are noted below. + + When a command is described as _k_i_l_l_i_n_g text, the text deleted is saved + for possible future retrieval (_y_a_n_k_i_n_g). The killed text is saved in a + _k_i_l_l _r_i_n_g. Consecutive kills cause the text to be accumulated into one + unit, which can be yanked all at once. Commands which do not kill text + separate the chunks of text on the kill ring. + + RReeaaddlliinnee IInniittiiaalliizzaattiioonn + Readline is customized by putting commands in an initialization file + (the _i_n_p_u_t_r_c file). The name of this file is taken from the value of + the IINNPPUUTTRRCC variable. If that variable is unset, the default is + _~_/_._i_n_p_u_t_r_c. When a program which uses the readline library starts up, + the initialization file is read, and the key bindings and variables are + set. There are only a few basic constructs allowed in the readline + initialization file. Blank lines are ignored. Lines beginning with a + ## are comments. Lines beginning with a $$ indicate conditional con- + structs. Other lines denote key bindings and variable settings. + + The default key-bindings may be changed with an _i_n_p_u_t_r_c file. Other + programs that use this library may add their own commands and bindings. + + For example, placing + + M-Control-u: universal-argument + or + C-Meta-u: universal-argument + into the _i_n_p_u_t_r_c would make M-C-u execute the readline command _u_n_i_v_e_r_- + _s_a_l_-_a_r_g_u_m_e_n_t. + + The following symbolic character names are recognized: _R_U_B_O_U_T, _D_E_L, + _E_S_C, _L_F_D, _N_E_W_L_I_N_E, _R_E_T, _R_E_T_U_R_N, _S_P_C, _S_P_A_C_E, and _T_A_B. + + In addition to command names, readline allows keys to be bound to a + string that is inserted when the key is pressed (a _m_a_c_r_o). + + RReeaaddlliinnee KKeeyy BBiinnddiinnggss + The syntax for controlling key bindings in the _i_n_p_u_t_r_c file is simple. + All that is required is the name of the command or the text of a macro + and a key sequence to which it should be bound. The name may be speci- + fied in one of two ways: as a symbolic key name, possibly with _M_e_t_a_- or + _C_o_n_t_r_o_l_- prefixes, or as a key sequence. + + When using the form kkeeyynnaammee:_f_u_n_c_t_i_o_n_-_n_a_m_e or _m_a_c_r_o, _k_e_y_n_a_m_e is the name + of a key spelled out in English. For example: + + Control-u: universal-argument + Meta-Rubout: backward-kill-word + Control-o: "> output" + + In the above example, _C_-_u is bound to the function uunniivveerrssaall--aarrgguummeenntt, + _M_-_D_E_L is bound to the function bbaacckkwwaarrdd--kkiillll--wwoorrdd, and _C_-_o is bound to + run the macro expressed on the right hand side (that is, to insert the + text ``> output'' into the line). + + In the second form, ""kkeeyysseeqq"":_f_u_n_c_t_i_o_n_-_n_a_m_e or _m_a_c_r_o, kkeeyysseeqq differs + from kkeeyynnaammee above in that strings denoting an entire key sequence may + be specified by placing the sequence within double quotes. Some GNU + Emacs style key escapes can be used, as in the following example, but + the symbolic character names are not recognized. + + "\C-u": universal-argument + "\C-x\C-r": re-read-init-file + "\e[11~": "Function Key 1" + + In this example, _C_-_u is again bound to the function uunniivveerrssaall--aarrgguummeenntt. + _C_-_x _C_-_r is bound to the function rree--rreeaadd--iinniitt--ffiillee, and _E_S_C _[ _1 _1 _~ is + bound to insert the text ``Function Key 1''. + + The full set of GNU Emacs style escape sequences is + \\CC-- control prefix + \\MM-- meta prefix + \\ee an escape character + \\\\ backslash + \\"" literal " + \\'' literal ' + + In addition to the GNU Emacs style escape sequences, a second set of + backslash escapes is available: + \\aa alert (bell) + \\bb backspace + \\dd delete + \\ff form feed + \\nn newline + \\rr carriage return + \\tt horizontal tab + \\vv vertical tab + \\_n_n_n the eight-bit character whose value is the octal value + _n_n_n (one to three digits) + \\xx_H_H the eight-bit character whose value is the hexadecimal + value _H_H (one or two hex digits) + + When entering the text of a macro, single or double quotes must be used + to indicate a macro definition. Unquoted text is assumed to be a func- + tion name. In the macro body, the backslash escapes described above + are expanded. Backslash will quote any other character in the macro + text, including " and '. + + BBaasshh allows the current readline key bindings to be displayed or modi- + fied with the bbiinndd builtin command. The editing mode may be switched + during interactive use by using the --oo option to the sseett builtin com- + mand (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + + RReeaaddlliinnee VVaarriiaabblleess + Readline has variables that can be used to further customize its behav- + ior. A variable may be set in the _i_n_p_u_t_r_c file with a statement of the + form + + sseett _v_a_r_i_a_b_l_e_-_n_a_m_e _v_a_l_u_e + + Except where noted, readline variables can take the values OOnn or OOffff + (without regard to case). Unrecognized variable names are ignored. + When a variable value is read, empty or null values, "on" (case-insen- + sitive), and "1" are equivalent to OOnn. All other values are equivalent + to OOffff. The variables and their default values are: + + bbeellll--ssttyyllee ((aauuddiibbllee)) + Controls what happens when readline wants to ring the terminal + bell. If set to nnoonnee, readline never rings the bell. If set to + vviissiibbllee, readline uses a visible bell if one is available. If + set to aauuddiibbllee, readline attempts to ring the terminal's bell. + bbiinndd--ttttyy--ssppeecciiaall--cchhaarrss ((OOnn)) + If set to OOnn, readline attempts to bind the control characters + treated specially by the kernel's terminal driver to their read- + line equivalents. + ccoolloorreedd--ssttaattss ((OOffff)) + If set to OOnn, readline displays possible completions using dif- + ferent colors to indicate their file type. The color defini- + tions are taken from the value of the LLSS__CCOOLLOORRSS environment + variable. + ccoommmmeenntt--bbeeggiinn ((````##'''')) + The string that is inserted when the readline iinnsseerrtt--ccoommmmeenntt + command is executed. This command is bound to MM--## in emacs mode + and to ## in vi command mode. + ccoommpplleettiioonn--iiggnnoorree--ccaassee ((OOffff)) + If set to OOnn, readline performs filename matching and completion + in a case-insensitive fashion. + ccoommpplleettiioonn--pprreeffiixx--ddiissppllaayy--lleennggtthh ((00)) + The length in characters of the common prefix of a list of pos- + sible completions that is displayed without modification. When + set to a value greater than zero, common prefixes longer than + this value are replaced with an ellipsis when displaying possi- + ble completions. + ccoommpplleettiioonn--qquueerryy--iitteemmss ((110000)) + This determines when the user is queried about viewing the num- + ber of possible completions generated by the ppoossssiibbllee--ccoommppllee-- + ttiioonnss command. It may be set to any integer value greater than + or equal to zero. If the number of possible completions is + greater than or equal to the value of this variable, the user is + asked whether or not he wishes to view them; otherwise they are + simply listed on the terminal. + ccoonnvveerrtt--mmeettaa ((OOnn)) + If set to OOnn, readline will convert characters with the eighth + bit set to an ASCII key sequence by stripping the eighth bit and + prefixing an escape character (in effect, using escape as the + _m_e_t_a _p_r_e_f_i_x). + ddiissaabbllee--ccoommpplleettiioonn ((OOffff)) + If set to OOnn, readline will inhibit word completion. Completion + characters will be inserted into the line as if they had been + mapped to sseellff--iinnsseerrtt. + eeddiittiinngg--mmooddee ((eemmaaccss)) + Controls whether readline begins with a set of key bindings sim- + ilar to _E_m_a_c_s or _v_i. eeddiittiinngg--mmooddee can be set to either eemmaaccss or + vvii. + eecchhoo--ccoonnttrrooll--cchhaarraacctteerrss ((OOnn)) + When set to OOnn, on operating systems that indicate they support + it, readline echoes a character corresponding to a signal gener- + ated from the keyboard. + eennaabbllee--kkeeyyppaadd ((OOffff)) + When set to OOnn, readline will try to enable the application key- + pad when it is called. Some systems need this to enable the + arrow keys. + eennaabbllee--mmeettaa--kkeeyy ((OOnn)) + When set to OOnn, readline will try to enable any meta modifier + key the terminal claims to support when it is called. On many + terminals, the meta key is used to send eight-bit characters. + eexxppaanndd--ttiillddee ((OOffff)) + If set to OOnn, tilde expansion is performed when readline + attempts word completion. + hhiissttoorryy--pprreesseerrvvee--ppooiinntt ((OOffff)) + If set to OOnn, the history code attempts to place point at the + same location on each history line retrieved with pprreevviioouuss--hhiiss-- + ttoorryy or nneexxtt--hhiissttoorryy. + hhiissttoorryy--ssiizzee ((00)) + Set the maximum number of history entries saved in the history + list. If set to zero, any existing history entries are deleted + and no new entries are saved. If set to a value less than zero, + the number of history entries is not limited. By default, the + number of history entries is not limited. + hhoorriizzoonnttaall--ssccrroollll--mmooddee ((OOffff)) + When set to OOnn, makes readline use a single line for display, + scrolling the input horizontally on a single screen line when it + becomes longer than the screen width rather than wrapping to a + new line. + iinnppuutt--mmeettaa ((OOffff)) + If set to OOnn, readline will enable eight-bit input (that is, it + will not strip the high bit from the characters it reads), + regardless of what the terminal claims it can support. The name + mmeettaa--ffllaagg is a synonym for this variable. + iisseeaarrcchh--tteerrmmiinnaattoorrss ((````CC--[[CC--JJ'''')) + The string of characters that should terminate an incremental + search without subsequently executing the character as a com- + mand. If this variable has not been given a value, the charac- + ters _E_S_C and _C_-_J will terminate an incremental search. + kkeeyymmaapp ((eemmaaccss)) + Set the current readline keymap. The set of valid keymap names + is _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_c_o_m_- + _m_a_n_d, and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d; _e_m_a_c_s is + equivalent to _e_m_a_c_s_-_s_t_a_n_d_a_r_d. The default value is _e_m_a_c_s; the + value of eeddiittiinngg--mmooddee also affects the default keymap. + kkeeyysseeqq--ttiimmeeoouutt ((550000)) + Specifies the duration _r_e_a_d_l_i_n_e will wait for a character when + reading an ambiguous key sequence (one that can form a complete + key sequence using the input read so far, or can take additional + input to complete a longer key sequence). If no input is + received within the timeout, _r_e_a_d_l_i_n_e will use the shorter but + complete key sequence. The value is specified in milliseconds, + so a value of 1000 means that _r_e_a_d_l_i_n_e will wait one second for + additional input. If this variable is set to a value less than + or equal to zero, or to a non-numeric value, _r_e_a_d_l_i_n_e will wait + until another key is pressed to decide which key sequence to + complete. + mmaarrkk--ddiirreeccttoorriieess ((OOnn)) + If set to OOnn, completed directory names have a slash appended. + mmaarrkk--mmooddiiffiieedd--lliinneess ((OOffff)) + If set to OOnn, history lines that have been modified are dis- + played with a preceding asterisk (**). + mmaarrkk--ssyymmlliinnkkeedd--ddiirreeccttoorriieess ((OOffff)) + If set to OOnn, completed names which are symbolic links to direc- + tories have a slash appended (subject to the value of + mmaarrkk--ddiirreeccttoorriieess). + mmaattcchh--hhiiddddeenn--ffiilleess ((OOnn)) + This variable, when set to OOnn, causes readline to match files + whose names begin with a `.' (hidden files) when performing + filename completion. If set to OOffff, the leading `.' must be + supplied by the user in the filename to be completed. + mmeennuu--ccoommpplleettee--ddiissppllaayy--pprreeffiixx ((OOffff)) + If set to OOnn, menu completion displays the common prefix of the + list of possible completions (which may be empty) before cycling + through the list. + oouuttppuutt--mmeettaa ((OOffff)) + If set to OOnn, readline will display characters with the eighth + bit set directly rather than as a meta-prefixed escape sequence. + ppaaggee--ccoommpplleettiioonnss ((OOnn)) + If set to OOnn, readline uses an internal _m_o_r_e-like pager to dis- + play a screenful of possible completions at a time. + pprriinntt--ccoommpplleettiioonnss--hhoorriizzoonnttaallllyy ((OOffff)) + If set to OOnn, readline will display completions with matches + sorted horizontally in alphabetical order, rather than down the + screen. + rreevveerrtt--aallll--aatt--nneewwlliinnee ((OOffff)) + If set to OOnn, readline will undo all changes to history lines + before returning when aacccceepptt--lliinnee is executed. By default, his- + tory lines may be modified and retain individual undo lists + across calls to rreeaaddlliinnee. + sshhooww--aallll--iiff--aammbbiigguuoouuss ((OOffff)) + This alters the default behavior of the completion functions. + If set to OOnn, words which have more than one possible completion + cause the matches to be listed immediately instead of ringing + the bell. + sshhooww--aallll--iiff--uunnmmooddiiffiieedd ((OOffff)) + This alters the default behavior of the completion functions in + a fashion similar to sshhooww--aallll--iiff--aammbbiigguuoouuss. If set to OOnn, words + which have more than one possible completion without any possi- + ble partial completion (the possible completions don't share a + common prefix) cause the matches to be listed immediately + instead of ringing the bell. + sshhooww--mmooddee--iinn--pprroommpptt ((OOffff)) + If set to OOnn, add a character to the beginning of the prompt + indicating the editing mode: emacs (@), vi command (:) or vi + insertion (+). + sskkiipp--ccoommpplleetteedd--tteexxtt ((OOffff)) + If set to OOnn, this alters the default completion behavior when + inserting a single match into the line. It's only active when + performing completion in the middle of a word. If enabled, + readline does not insert characters from the completion that + match characters after point in the word being completed, so + portions of the word following the cursor are not duplicated. + vviissiibbllee--ssttaattss ((OOffff)) + If set to OOnn, a character denoting a file's type as reported by + _s_t_a_t(2) is appended to the filename when listing possible com- + pletions. + + RReeaaddlliinnee CCoonnddiittiioonnaall CCoonnssttrruuccttss + Readline implements a facility similar in spirit to the conditional + compilation features of the C preprocessor which allows key bindings + and variable settings to be performed as the result of tests. There + are four parser directives used. + + $$iiff The $$iiff construct allows bindings to be made based on the edit- + ing mode, the terminal being used, or the application using + readline. The text of the test extends to the end of the line; + no characters are required to isolate it. + + mmooddee The mmooddee== form of the $$iiff directive is used to test + whether readline is in emacs or vi mode. This may be + used in conjunction with the sseett kkeeyymmaapp command, for + instance, to set bindings in the _e_m_a_c_s_-_s_t_a_n_d_a_r_d and + _e_m_a_c_s_-_c_t_l_x keymaps only if readline is starting out in + emacs mode. + + tteerrmm The tteerrmm== form may be used to include terminal-specific + key bindings, perhaps to bind the key sequences output by + the terminal's function keys. The word on the right side + of the == is tested against the both full name of the ter- + minal and the portion of the terminal name before the + first --. This allows _s_u_n to match both _s_u_n and _s_u_n_-_c_m_d, + for instance. + + aapppplliiccaattiioonn + The aapppplliiccaattiioonn construct is used to include application- + specific settings. Each program using the readline + library sets the _a_p_p_l_i_c_a_t_i_o_n _n_a_m_e, and an initialization + file can test for a particular value. This could be used + to bind key sequences to functions useful for a specific + program. For instance, the following command adds a key + sequence that quotes the current or previous word in + bbaasshh: + + $$iiff Bash + # Quote the current or previous word + "\C-xq": "\eb\"\ef\"" + $$eennddiiff + + $$eennddiiff This command, as seen in the previous example, terminates an $$iiff + command. + + $$eellssee Commands in this branch of the $$iiff directive are executed if the + test fails. + + $$iinncclluuddee + This directive takes a single filename as an argument and reads + commands and bindings from that file. For example, the follow- + ing directive would read _/_e_t_c_/_i_n_p_u_t_r_c: + + $$iinncclluuddee _/_e_t_c_/_i_n_p_u_t_r_c + + SSeeaarrcchhiinngg + Readline provides commands for searching through the command history + (see HHIISSTTOORRYY below) for lines containing a specified string. There are + two search modes: _i_n_c_r_e_m_e_n_t_a_l and _n_o_n_-_i_n_c_r_e_m_e_n_t_a_l. + + Incremental searches begin before the user has finished typing the + search string. As each character of the search string is typed, read- + line displays the next entry from the history matching the string typed + so far. An incremental search requires only as many characters as + needed to find the desired history entry. The characters present in + the value of the iisseeaarrcchh--tteerrmmiinnaattoorrss variable are used to terminate an + incremental search. If that variable has not been assigned a value the + Escape and Control-J characters will terminate an incremental search. + Control-G will abort an incremental search and restore the original + line. When the search is terminated, the history entry containing the + search string becomes the current line. + + To find other matching entries in the history list, type Control-S or + Control-R as appropriate. This will search backward or forward in the + history for the next entry matching the search string typed so far. + Any other key sequence bound to a readline command will terminate the + search and execute that command. For instance, a _n_e_w_l_i_n_e will termi- + nate the search and accept the line, thereby executing the command from + the history list. + + Readline remembers the last incremental search string. If two Control- + Rs are typed without any intervening characters defining a new search + string, any remembered search string is used. + + Non-incremental searches read the entire search string before starting + to search for matching history lines. The search string may be typed + by the user or be part of the contents of the current line. + + RReeaaddlliinnee CCoommmmaanndd NNaammeess + The following is a list of the names of the commands and the default + key sequences to which they are bound. Command names without an accom- + panying key sequence are unbound by default. In the following descrip- + tions, _p_o_i_n_t refers to the current cursor position, and _m_a_r_k refers to + a cursor position saved by the sseett--mmaarrkk command. The text between the + point and mark is referred to as the _r_e_g_i_o_n. + + CCoommmmaannddss ffoorr MMoovviinngg + bbeeggiinnnniinngg--ooff--lliinnee ((CC--aa)) + Move to the start of the current line. + eenndd--ooff--lliinnee ((CC--ee)) + Move to the end of the line. + ffoorrwwaarrdd--cchhaarr ((CC--ff)) + Move forward a character. + bbaacckkwwaarrdd--cchhaarr ((CC--bb)) + Move back a character. + ffoorrwwaarrdd--wwoorrdd ((MM--ff)) + Move forward to the end of the next word. Words are composed of + alphanumeric characters (letters and digits). + bbaacckkwwaarrdd--wwoorrdd ((MM--bb)) + Move back to the start of the current or previous word. Words + are composed of alphanumeric characters (letters and digits). + sshheellll--ffoorrwwaarrdd--wwoorrdd + Move forward to the end of the next word. Words are delimited + by non-quoted shell metacharacters. + sshheellll--bbaacckkwwaarrdd--wwoorrdd + Move back to the start of the current or previous word. Words + are delimited by non-quoted shell metacharacters. + cclleeaarr--ssccrreeeenn ((CC--ll)) + Clear the screen leaving the current line at the top of the + screen. With an argument, refresh the current line without + clearing the screen. + rreeddrraaww--ccuurrrreenntt--lliinnee + Refresh the current line. + + CCoommmmaannddss ffoorr MMaanniippuullaattiinngg tthhee HHiissttoorryy + aacccceepptt--lliinnee ((NNeewwlliinnee,, RReettuurrnn)) + Accept the line regardless of where the cursor is. If this line + is non-empty, add it to the history list according to the state + of the HHIISSTTCCOONNTTRROOLL variable. If the line is a modified history + line, then restore the history line to its original state. + pprreevviioouuss--hhiissttoorryy ((CC--pp)) + Fetch the previous command from the history list, moving back in + the list. + nneexxtt--hhiissttoorryy ((CC--nn)) + Fetch the next command from the history list, moving forward in + the list. + bbeeggiinnnniinngg--ooff--hhiissttoorryy ((MM--<<)) + Move to the first line in the history. + eenndd--ooff--hhiissttoorryy ((MM-->>)) + Move to the end of the input history, i.e., the line currently + being entered. + rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((CC--rr)) + Search backward starting at the current line and moving `up' + through the history as necessary. This is an incremental + search. + ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((CC--ss)) + Search forward starting at the current line and moving `down' + through the history as necessary. This is an incremental + search. + nnoonn--iinnccrreemmeennttaall--rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((MM--pp)) + Search backward through the history starting at the current line + using a non-incremental search for a string supplied by the + user. + nnoonn--iinnccrreemmeennttaall--ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((MM--nn)) + Search forward through the history using a non-incremental + search for a string supplied by the user. + hhiissttoorryy--sseeaarrcchh--ffoorrwwaarrdd + Search forward through the history for the string of characters + between the start of the current line and the point. This is a + non-incremental search. + hhiissttoorryy--sseeaarrcchh--bbaacckkwwaarrdd + Search backward through the history for the string of characters + between the start of the current line and the point. This is a + non-incremental search. + yyaannkk--nntthh--aarrgg ((MM--CC--yy)) + Insert the first argument to the previous command (usually the + second word on the previous line) at point. With an argument _n, + insert the _nth word from the previous command (the words in the + previous command begin with word 0). A negative argument + inserts the _nth word from the end of the previous command. Once + the argument _n is computed, the argument is extracted as if the + "!_n" history expansion had been specified. + yyaannkk--llaasstt--aarrgg ((MM--..,, MM--__)) + Insert the last argument to the previous command (the last word + of the previous history entry). With a numeric argument, behave + exactly like yyaannkk--nntthh--aarrgg. Successive calls to yyaannkk--llaasstt--aarrgg + move back through the history list, inserting the last word (or + the word specified by the argument to the first call) of each + line in turn. Any numeric argument supplied to these successive + calls determines the direction to move through the history. A + negative argument switches the direction through the history + (back or forward). The history expansion facilities are used to + extract the last word, as if the "!$" history expansion had been + specified. + sshheellll--eexxppaanndd--lliinnee ((MM--CC--ee)) + Expand the line as the shell does. This performs alias and his- + tory expansion as well as all of the shell word expansions. See + HHIISSTTOORRYY EEXXPPAANNSSIIOONN below for a description of history expansion. + hhiissttoorryy--eexxppaanndd--lliinnee ((MM--^^)) + Perform history expansion on the current line. See HHIISSTTOORRYY + EEXXPPAANNSSIIOONN below for a description of history expansion. + mmaaggiicc--ssppaaccee + Perform history expansion on the current line and insert a + space. See HHIISSTTOORRYY EEXXPPAANNSSIIOONN below for a description of history + expansion. + aalliiaass--eexxppaanndd--lliinnee + Perform alias expansion on the current line. See AALLIIAASSEESS above + for a description of alias expansion. + hhiissttoorryy--aanndd--aalliiaass--eexxppaanndd--lliinnee + Perform history and alias expansion on the current line. + iinnsseerrtt--llaasstt--aarrgguummeenntt ((MM--..,, MM--__)) + A synonym for yyaannkk--llaasstt--aarrgg. + ooppeerraattee--aanndd--ggeett--nneexxtt ((CC--oo)) + Accept the current line for execution and fetch the next line + relative to the current line from the history for editing. Any + argument is ignored. + eeddiitt--aanndd--eexxeeccuuttee--ccoommmmaanndd ((CC--xxCC--ee)) + Invoke an editor on the current command line, and execute the + result as shell commands. BBaasshh attempts to invoke $$VVIISSUUAALL, + $$EEDDIITTOORR, and _e_m_a_c_s as the editor, in that order. + + CCoommmmaannddss ffoorr CChhaannggiinngg TTeexxtt + _e_n_d_-_o_f_-_f_i_l_e ((uussuuaallllyy CC--dd)) + The character indicating end-of-file as set, for example, by + ``stty''. If this character is read when there are no charac- + ters on the line, and point is at the beginning of the line, + Readline interprets it as the end of input and returns EEOOFF. + ddeelleettee--cchhaarr ((CC--dd)) + Delete the character at point. If this function is bound to the + same character as the tty EEOOFF character, as CC--dd commonly is, see + above for the effects. + bbaacckkwwaarrdd--ddeelleettee--cchhaarr ((RRuubboouutt)) + Delete the character behind the cursor. When given a numeric + argument, save the deleted text on the kill ring. + ffoorrwwaarrdd--bbaacckkwwaarrdd--ddeelleettee--cchhaarr + Delete the character under the cursor, unless the cursor is at + the end of the line, in which case the character behind the cur- + sor is deleted. + qquuootteedd--iinnsseerrtt ((CC--qq,, CC--vv)) + Add the next character typed to the line verbatim. This is how + to insert characters like CC--qq, for example. + ttaabb--iinnsseerrtt ((CC--vv TTAABB)) + Insert a tab character. + sseellff--iinnsseerrtt ((aa,, bb,, AA,, 11,, !!,, ......)) + Insert the character typed. + ttrraannssppoossee--cchhaarrss ((CC--tt)) + Drag the character before point forward over the character at + point, moving point forward as well. If point is at the end of + the line, then this transposes the two characters before point. + Negative arguments have no effect. + ttrraannssppoossee--wwoorrddss ((MM--tt)) + Drag the word before point past the word after point, moving + point over that word as well. If point is at the end of the + line, this transposes the last two words on the line. + uuppccaassee--wwoorrdd ((MM--uu)) + Uppercase the current (or following) word. With a negative + argument, uppercase the previous word, but do not move point. + ddoowwnnccaassee--wwoorrdd ((MM--ll)) + Lowercase the current (or following) word. With a negative + argument, lowercase the previous word, but do not move point. + ccaappiittaalliizzee--wwoorrdd ((MM--cc)) + Capitalize the current (or following) word. With a negative + argument, capitalize the previous word, but do not move point. + oovveerrwwrriittee--mmooddee + Toggle overwrite mode. With an explicit positive numeric argu- + ment, switches to overwrite mode. With an explicit non-positive + numeric argument, switches to insert mode. This command affects + only eemmaaccss mode; vvii mode does overwrite differently. Each call + to _r_e_a_d_l_i_n_e_(_) starts in insert mode. In overwrite mode, charac- + ters bound to sseellff--iinnsseerrtt replace the text at point rather than + pushing the text to the right. Characters bound to bbaacckk-- + wwaarrdd--ddeelleettee--cchhaarr replace the character before point with a + space. By default, this command is unbound. + + KKiilllliinngg aanndd YYaannkkiinngg + kkiillll--lliinnee ((CC--kk)) + Kill the text from point to the end of the line. + bbaacckkwwaarrdd--kkiillll--lliinnee ((CC--xx RRuubboouutt)) + Kill backward to the beginning of the line. + uunniixx--lliinnee--ddiissccaarrdd ((CC--uu)) + Kill backward from point to the beginning of the line. The + killed text is saved on the kill-ring. + kkiillll--wwhhoollee--lliinnee + Kill all characters on the current line, no matter where point + is. + kkiillll--wwoorrdd ((MM--dd)) + Kill from point to the end of the current word, or if between + words, to the end of the next word. Word boundaries are the + same as those used by ffoorrwwaarrdd--wwoorrdd. + bbaacckkwwaarrdd--kkiillll--wwoorrdd ((MM--RRuubboouutt)) + Kill the word behind point. Word boundaries are the same as + those used by bbaacckkwwaarrdd--wwoorrdd. + sshheellll--kkiillll--wwoorrdd ((MM--dd)) + Kill from point to the end of the current word, or if between + words, to the end of the next word. Word boundaries are the + same as those used by sshheellll--ffoorrwwaarrdd--wwoorrdd. + sshheellll--bbaacckkwwaarrdd--kkiillll--wwoorrdd ((MM--RRuubboouutt)) + Kill the word behind point. Word boundaries are the same as + those used by sshheellll--bbaacckkwwaarrdd--wwoorrdd. + uunniixx--wwoorrdd--rruubboouutt ((CC--ww)) + Kill the word behind point, using white space as a word bound- + ary. The killed text is saved on the kill-ring. + uunniixx--ffiilleennaammee--rruubboouutt + Kill the word behind point, using white space and the slash + character as the word boundaries. The killed text is saved on + the kill-ring. + ddeelleettee--hhoorriizzoonnttaall--ssppaaccee ((MM--\\)) + Delete all spaces and tabs around point. + kkiillll--rreeggiioonn + Kill the text in the current region. + ccooppyy--rreeggiioonn--aass--kkiillll + Copy the text in the region to the kill buffer. + ccooppyy--bbaacckkwwaarrdd--wwoorrdd + Copy the word before point to the kill buffer. The word bound- + aries are the same as bbaacckkwwaarrdd--wwoorrdd. + ccooppyy--ffoorrwwaarrdd--wwoorrdd + Copy the word following point to the kill buffer. The word + boundaries are the same as ffoorrwwaarrdd--wwoorrdd. + yyaannkk ((CC--yy)) + Yank the top of the kill ring into the buffer at point. + yyaannkk--ppoopp ((MM--yy)) + Rotate the kill ring, and yank the new top. Only works follow- + ing yyaannkk or yyaannkk--ppoopp. + + NNuummeerriicc AArrgguummeennttss + ddiiggiitt--aarrgguummeenntt ((MM--00,, MM--11,, ......,, MM----)) + Add this digit to the argument already accumulating, or start a + new argument. M-- starts a negative argument. + uunniivveerrssaall--aarrgguummeenntt + This is another way to specify an argument. If this command is + followed by one or more digits, optionally with a leading minus + sign, those digits define the argument. If the command is fol- + lowed by digits, executing uunniivveerrssaall--aarrgguummeenntt again ends the + numeric argument, but is otherwise ignored. As a special case, + if this command is immediately followed by a character that is + neither a digit or minus sign, the argument count for the next + command is multiplied by four. The argument count is initially + one, so executing this function the first time makes the argu- + ment count four, a second time makes the argument count sixteen, + and so on. + + CCoommpplleettiinngg + ccoommpplleettee ((TTAABB)) + Attempt to perform completion on the text before point. BBaasshh + attempts completion treating the text as a variable (if the text + begins with $$), username (if the text begins with ~~), hostname + (if the text begins with @@), or command (including aliases and + functions) in turn. If none of these produces a match, filename + completion is attempted. + ppoossssiibbllee--ccoommpplleettiioonnss ((MM--??)) + List the possible completions of the text before point. + iinnsseerrtt--ccoommpplleettiioonnss ((MM--**)) + Insert all completions of the text before point that would have + been generated by ppoossssiibbllee--ccoommpplleettiioonnss. + mmeennuu--ccoommpplleettee + Similar to ccoommpplleettee, but replaces the word to be completed with + a single match from the list of possible completions. Repeated + execution of mmeennuu--ccoommpplleettee steps through the list of possible + completions, inserting each match in turn. At the end of the + list of completions, the bell is rung (subject to the setting of + bbeellll--ssttyyllee) and the original text is restored. An argument of _n + moves _n positions forward in the list of matches; a negative + argument may be used to move backward through the list. This + command is intended to be bound to TTAABB, but is unbound by + default. + mmeennuu--ccoommpplleettee--bbaacckkwwaarrdd + Identical to mmeennuu--ccoommpplleettee, but moves backward through the list + of possible completions, as if mmeennuu--ccoommpplleettee had been given a + negative argument. This command is unbound by default. + ddeelleettee--cchhaarr--oorr--lliisstt + Deletes the character under the cursor if not at the beginning + or end of the line (like ddeelleettee--cchhaarr). If at the end of the + line, behaves identically to ppoossssiibbllee--ccoommpplleettiioonnss. This command + is unbound by default. + ccoommpplleettee--ffiilleennaammee ((MM--//)) + Attempt filename completion on the text before point. + ppoossssiibbllee--ffiilleennaammee--ccoommpplleettiioonnss ((CC--xx //)) + List the possible completions of the text before point, treating + it as a filename. + ccoommpplleettee--uusseerrnnaammee ((MM--~~)) + Attempt completion on the text before point, treating it as a + username. + ppoossssiibbllee--uusseerrnnaammee--ccoommpplleettiioonnss ((CC--xx ~~)) + List the possible completions of the text before point, treating + it as a username. + ccoommpplleettee--vvaarriiaabbllee ((MM--$$)) + Attempt completion on the text before point, treating it as a + shell variable. + ppoossssiibbllee--vvaarriiaabbllee--ccoommpplleettiioonnss ((CC--xx $$)) + List the possible completions of the text before point, treating + it as a shell variable. + ccoommpplleettee--hhoossttnnaammee ((MM--@@)) + Attempt completion on the text before point, treating it as a + hostname. + ppoossssiibbllee--hhoossttnnaammee--ccoommpplleettiioonnss ((CC--xx @@)) + List the possible completions of the text before point, treating + it as a hostname. + ccoommpplleettee--ccoommmmaanndd ((MM--!!)) + Attempt completion on the text before point, treating it as a + command name. Command completion attempts to match the text + against aliases, reserved words, shell functions, shell + builtins, and finally executable filenames, in that order. + ppoossssiibbllee--ccoommmmaanndd--ccoommpplleettiioonnss ((CC--xx !!)) + List the possible completions of the text before point, treating + it as a command name. + ddyynnaammiicc--ccoommpplleettee--hhiissttoorryy ((MM--TTAABB)) + Attempt completion on the text before point, comparing the text + against lines from the history list for possible completion + matches. + ddaabbbbrreevv--eexxppaanndd + Attempt menu completion on the text before point, comparing the + text against lines from the history list for possible completion + matches. + ccoommpplleettee--iinnttoo--bbrraacceess ((MM--{{)) + Perform filename completion and insert the list of possible com- + pletions enclosed within braces so the list is available to the + shell (see BBrraaccee EExxppaannssiioonn above). + + KKeeyybbooaarrdd MMaaccrrooss + ssttaarrtt--kkbbdd--mmaaccrroo ((CC--xx (()) + Begin saving the characters typed into the current keyboard + macro. + eenndd--kkbbdd--mmaaccrroo ((CC--xx )))) + Stop saving the characters typed into the current keyboard macro + and store the definition. + ccaallll--llaasstt--kkbbdd--mmaaccrroo ((CC--xx ee)) + Re-execute the last keyboard macro defined, by making the char- + acters in the macro appear as if typed at the keyboard. + pprriinntt--llaasstt--kkbbdd--mmaaccrroo (()) + Print the last keyboard macro defined in a format suitable for + the _i_n_p_u_t_r_c file. + + MMiisscceellllaanneeoouuss + rree--rreeaadd--iinniitt--ffiillee ((CC--xx CC--rr)) + Read in the contents of the _i_n_p_u_t_r_c file, and incorporate any + bindings or variable assignments found there. + aabboorrtt ((CC--gg)) + Abort the current editing command and ring the terminal's bell + (subject to the setting of bbeellll--ssttyyllee). + ddoo--uuppppeerrccaassee--vveerrssiioonn ((MM--aa,, MM--bb,, MM--_x,, ......)) + If the metafied character _x is lowercase, run the command that + is bound to the corresponding uppercase character. + pprreeffiixx--mmeettaa ((EESSCC)) + Metafy the next character typed. EESSCC ff is equivalent to MMeettaa--ff. + uunnddoo ((CC--__,, CC--xx CC--uu)) + Incremental undo, separately remembered for each line. + rreevveerrtt--lliinnee ((MM--rr)) + Undo all changes made to this line. This is like executing the + uunnddoo command enough times to return the line to its initial + state. + ttiillddee--eexxppaanndd ((MM--&&)) + Perform tilde expansion on the current word. + sseett--mmaarrkk ((CC--@@,, MM--<>)) + Set the mark to the point. If a numeric argument is supplied, + the mark is set to that position. + eexxcchhaannggee--ppooiinntt--aanndd--mmaarrkk ((CC--xx CC--xx)) + Swap the point with the mark. The current cursor position is + set to the saved position, and the old cursor position is saved + as the mark. + cchhaarraacctteerr--sseeaarrcchh ((CC--]])) + A character is read and point is moved to the next occurrence of + that character. A negative count searches for previous occur- + rences. + cchhaarraacctteerr--sseeaarrcchh--bbaacckkwwaarrdd ((MM--CC--]])) + A character is read and point is moved to the previous occur- + rence of that character. A negative count searches for subse- + quent occurrences. + sskkiipp--ccssii--sseeqquueennccee + Read enough characters to consume a multi-key sequence such as + those defined for keys like Home and End. Such sequences begin + with a Control Sequence Indicator (CSI), usually ESC-[. If this + sequence is bound to "\[", keys producing such sequences will + have no effect unless explicitly bound to a readline command, + instead of inserting stray characters into the editing buffer. + This is unbound by default, but usually bound to ESC-[. + iinnsseerrtt--ccoommmmeenntt ((MM--##)) + Without a numeric argument, the value of the readline ccoomm-- + mmeenntt--bbeeggiinn variable is inserted at the beginning of the current + line. If a numeric argument is supplied, this command acts as a + toggle: if the characters at the beginning of the line do not + match the value of ccoommmmeenntt--bbeeggiinn, the value is inserted, other- + wise the characters in ccoommmmeenntt--bbeeggiinn are deleted from the begin- + ning of the line. In either case, the line is accepted as if a + newline had been typed. The default value of ccoommmmeenntt--bbeeggiinn + causes this command to make the current line a shell comment. + If a numeric argument causes the comment character to be + removed, the line will be executed by the shell. + gglloobb--ccoommpplleettee--wwoorrdd ((MM--gg)) + The word before point is treated as a pattern for pathname + expansion, with an asterisk implicitly appended. This pattern + is used to generate a list of matching filenames for possible + completions. + gglloobb--eexxppaanndd--wwoorrdd ((CC--xx **)) + The word before point is treated as a pattern for pathname + expansion, and the list of matching filenames is inserted, + replacing the word. If a numeric argument is supplied, an + asterisk is appended before pathname expansion. + gglloobb--lliisstt--eexxppaannssiioonnss ((CC--xx gg)) + The list of expansions that would have been generated by + gglloobb--eexxppaanndd--wwoorrdd is displayed, and the line is redrawn. If a + numeric argument is supplied, an asterisk is appended before + pathname expansion. + dduummpp--ffuunnccttiioonnss + Print all of the functions and their key bindings to the read- + line output stream. If a numeric argument is supplied, the out- + put is formatted in such a way that it can be made part of an + _i_n_p_u_t_r_c file. + dduummpp--vvaarriiaabblleess + Print all of the settable readline variables and their values to + the readline output stream. If a numeric argument is supplied, + the output is formatted in such a way that it can be made part + of an _i_n_p_u_t_r_c file. + dduummpp--mmaaccrrooss + Print all of the readline key sequences bound to macros and the + strings they output. If a numeric argument is supplied, the + output is formatted in such a way that it can be made part of an + _i_n_p_u_t_r_c file. + ddiissppllaayy--sshheellll--vveerrssiioonn ((CC--xx CC--vv)) + Display version information about the current instance of bbaasshh. + + PPrrooggrraammmmaabbllee CCoommpplleettiioonn + When word completion is attempted for an argument to a command for + which a completion specification (a _c_o_m_p_s_p_e_c) has been defined using + the ccoommpplleettee builtin (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below), the pro- + grammable completion facilities are invoked. + + First, the command name is identified. If the command word is the + empty string (completion attempted at the beginning of an empty line), + any compspec defined with the --EE option to ccoommpplleettee is used. If a + compspec has been defined for that command, the compspec is used to + generate the list of possible completions for the word. If the command + word is a full pathname, a compspec for the full pathname is searched + for first. If no compspec is found for the full pathname, an attempt + is made to find a compspec for the portion following the final slash. + If those searches do not result in a compspec, any compspec defined + with the --DD option to ccoommpplleettee is used as the default. + + Once a compspec has been found, it is used to generate the list of + matching words. If a compspec is not found, the default bbaasshh comple- + tion as described above under CCoommpplleettiinngg is performed. + + First, the actions specified by the compspec are used. Only matches + which are prefixed by the word being completed are returned. When the + --ff or --dd option is used for filename or directory name completion, the + shell variable FFIIGGNNOORREE is used to filter the matches. + + Any completions specified by a pathname expansion pattern to the --GG + option are generated next. The words generated by the pattern need not + match the word being completed. The GGLLOOBBIIGGNNOORREE shell variable is not + used to filter the matches, but the FFIIGGNNOORREE variable is used. + + Next, the string specified as the argument to the --WW option is consid- + ered. The string is first split using the characters in the IIFFSS spe- + cial variable as delimiters. Shell quoting is honored. Each word is + then expanded using brace expansion, tilde expansion, parameter and + variable expansion, command substitution, and arithmetic expansion, as + described above under EEXXPPAANNSSIIOONN. The results are split using the rules + described above under WWoorrdd SSpplliittttiinngg. The results of the expansion are + prefix-matched against the word being completed, and the matching words + become the possible completions. + + After these matches have been generated, any shell function or command + specified with the --FF and --CC options is invoked. When the command or + function is invoked, the CCOOMMPP__LLIINNEE, CCOOMMPP__PPOOIINNTT, CCOOMMPP__KKEEYY, and CCOOMMPP__TTYYPPEE + variables are assigned values as described above under SShheellll VVaarriiaabblleess. + If a shell function is being invoked, the CCOOMMPP__WWOORRDDSS and CCOOMMPP__CCWWOORRDD + variables are also set. When the function or command is invoked, the + first argument ($$11) is the name of the command whose arguments are + being completed, the second argument ($$22) is the word being completed, + and the third argument ($$33) is the word preceding the word being com- + pleted on the current command line. No filtering of the generated com- + pletions against the word being completed is performed; the function or + command has complete freedom in generating the matches. + + Any function specified with --FF is invoked first. The function may use + any of the shell facilities, including the ccoommppggeenn builtin described + below, to generate the matches. It must put the possible completions + in the CCOOMMPPRREEPPLLYY array variable, one per array element. + + Next, any command specified with the --CC option is invoked in an envi- + ronment equivalent to command substitution. It should print a list of + completions, one per line, to the standard output. Backslash may be + used to escape a newline, if necessary. + + After all of the possible completions are generated, any filter speci- + fied with the --XX option is applied to the list. The filter is a pat- + tern as used for pathname expansion; a && in the pattern is replaced + with the text of the word being completed. A literal && may be escaped + with a backslash; the backslash is removed before attempting a match. + Any completion that matches the pattern will be removed from the list. + A leading !! negates the pattern; in this case any completion not match- + ing the pattern will be removed. + + Finally, any prefix and suffix specified with the --PP and --SS options are + added to each member of the completion list, and the result is returned + to the readline completion code as the list of possible completions. + + If the previously-applied actions do not generate any matches, and the + --oo ddiirrnnaammeess option was supplied to ccoommpplleettee when the compspec was + defined, directory name completion is attempted. + + If the --oo pplluussddiirrss option was supplied to ccoommpplleettee when the compspec + was defined, directory name completion is attempted and any matches are + added to the results of the other actions. + + By default, if a compspec is found, whatever it generates is returned + to the completion code as the full set of possible completions. The + default bbaasshh completions are not attempted, and the readline default of + filename completion is disabled. If the --oo bbaasshhddeeffaauulltt option was sup- + plied to ccoommpplleettee when the compspec was defined, the bbaasshh default com- + pletions are attempted if the compspec generates no matches. If the --oo + ddeeffaauulltt option was supplied to ccoommpplleettee when the compspec was defined, + readline's default completion will be performed if the compspec (and, + if attempted, the default bbaasshh completions) generate no matches. + + When a compspec indicates that directory name completion is desired, + the programmable completion functions force readline to append a slash + to completed names which are symbolic links to directories, subject to + the value of the mmaarrkk--ddiirreeccttoorriieess readline variable, regardless of the + setting of the mmaarrkk--ssyymmlliinnkkeedd--ddiirreeccttoorriieess readline variable. + + There is some support for dynamically modifying completions. This is + most useful when used in combination with a default completion speci- + fied with ccoommpplleettee --DD. It's possible for shell functions executed as + completion handlers to indicate that completion should be retried by + returning an exit status of 124. If a shell function returns 124, and + changes the compspec associated with the command on which completion is + being attempted (supplied as the first argument when the function is + executed), programmable completion restarts from the beginning, with an + attempt to find a new compspec for that command. This allows a set of + completions to be built dynamically as completion is attempted, rather + than being loaded all at once. + + For instance, assuming that there is a library of compspecs, each kept + in a file corresponding to the name of the command, the following + default completion function would load completions dynamically: + + _completion_loader() + { + . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124 + } + complete -D -F _completion_loader -o bashdefault -o default + + +HHIISSTTOORRYY + When the --oo hhiissttoorryy option to the sseett builtin is enabled, the shell + provides access to the _c_o_m_m_a_n_d _h_i_s_t_o_r_y, the list of commands previously + typed. The value of the HHIISSTTSSIIZZEE variable is used as the number of + commands to save in a history list. The text of the last HHIISSTTSSIIZZEE com- + mands (default 500) is saved. The shell stores each command in the + history list prior to parameter and variable expansion (see EEXXPPAANNSSIIOONN + above) but after history expansion is performed, subject to the values + of the shell variables HHIISSTTIIGGNNOORREE and HHIISSTTCCOONNTTRROOLL. + + On startup, the history is initialized from the file named by the vari- + able HHIISSTTFFIILLEE (default _~_/_._b_a_s_h___h_i_s_t_o_r_y). The file named by the value + of HHIISSTTFFIILLEE is truncated, if necessary, to contain no more than the + number of lines specified by the value of HHIISSTTFFIILLEESSIIZZEE. If HHIISSTTFFIILLEE-- + SSIIZZEE is unset, or set to null, a non-numeric value, or a numeric value + less than zero, the history file is not truncated. When the history + file is read, lines beginning with the history comment character fol- + lowed immediately by a digit are interpreted as timestamps for the pre- + ceding history line. These timestamps are optionally displayed depend- + ing on the value of the HHIISSTTTTIIMMEEFFOORRMMAATT variable. When a shell with + history enabled exits, the last $$HHIISSTTSSIIZZEE lines are copied from the + history list to $$HHIISSTTFFIILLEE. If the hhiissttaappppeenndd shell option is enabled + (see the description of sshhoopptt under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below), the + lines are appended to the history file, otherwise the history file is + overwritten. If HHIISSTTFFIILLEE is unset, or if the history file is + unwritable, the history is not saved. If the HHIISSTTTTIIMMEEFFOORRMMAATT variable + is set, time stamps are written to the history file, marked with the + history comment character, so they may be preserved across shell ses- + sions. This uses the history comment character to distinguish time- + stamps from other history lines. After saving the history, the history + file is truncated to contain no more than HHIISSTTFFIILLEESSIIZZEE lines. If HHIISSTT-- + FFIILLEESSIIZZEE is unset, or set to null, a non-numeric value, or a numeric + value less than zero, the history file is not truncated. + + The builtin command ffcc (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) may be used + to list or edit and re-execute a portion of the history list. The hhiiss-- + ttoorryy builtin may be used to display or modify the history list and + manipulate the history file. When using command-line editing, search + commands are available in each editing mode that provide access to the + history list. + + The shell allows control over which commands are saved on the history + list. The HHIISSTTCCOONNTTRROOLL and HHIISSTTIIGGNNOORREE variables may be set to cause the + shell to save only a subset of the commands entered. The ccmmddhhiisstt shell + option, if enabled, causes the shell to attempt to save each line of a + multi-line command in the same history entry, adding semicolons where + necessary to preserve syntactic correctness. The lliitthhiisstt shell option + causes the shell to save the command with embedded newlines instead of + semicolons. See the description of the sshhoopptt builtin below under SSHHEELLLL + BBUUIILLTTIINN CCOOMMMMAANNDDSS for information on setting and unsetting shell + options. + +HHIISSTTOORRYY EEXXPPAANNSSIIOONN + The shell supports a history expansion feature that is similar to the + history expansion in ccsshh.. This section describes what syntax features + are available. This feature is enabled by default for interactive + shells, and can be disabled using the ++HH option to the sseett builtin com- + mand (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). Non-interactive shells do not + perform history expansion by default. + + History expansions introduce words from the history list into the input + stream, making it easy to repeat commands, insert the arguments to a + previous command into the current input line, or fix errors in previous + commands quickly. + + History expansion is performed immediately after a complete line is + read, before the shell breaks it into words. It takes place in two + parts. The first is to determine which line from the history list to + use during substitution. The second is to select portions of that line + for inclusion into the current one. The line selected from the history + is the _e_v_e_n_t, and the portions of that line that are acted upon are + _w_o_r_d_s. Various _m_o_d_i_f_i_e_r_s are available to manipulate the selected + words. The line is broken into words in the same fashion as when read- + ing input, so that several _m_e_t_a_c_h_a_r_a_c_t_e_r-separated words surrounded by + quotes are considered one word. History expansions are introduced by + the appearance of the history expansion character, which is !! by + default. Only backslash (\\) and single quotes can quote the history + expansion character. + + Several characters inhibit history expansion if found immediately fol- + lowing the history expansion character, even if it is unquoted: space, + tab, newline, carriage return, and ==. If the eexxttgglloobb shell option is + enabled, (( will also inhibit expansion. + + Several shell options settable with the sshhoopptt builtin may be used to + tailor the behavior of history expansion. If the hhiissttvveerriiffyy shell + option is enabled (see the description of the sshhoopptt builtin below), and + rreeaaddlliinnee is being used, history substitutions are not immediately + passed to the shell parser. Instead, the expanded line is reloaded + into the rreeaaddlliinnee editing buffer for further modification. If rreeaaddlliinnee + is being used, and the hhiissttrreeeeddiitt shell option is enabled, a failed + history substitution will be reloaded into the rreeaaddlliinnee editing buffer + for correction. The --pp option to the hhiissttoorryy builtin command may be + used to see what a history expansion will do before using it. The --ss + option to the hhiissttoorryy builtin may be used to add commands to the end of + the history list without actually executing them, so that they are + available for subsequent recall. + + The shell allows control of the various characters used by the history + expansion mechanism (see the description of hhiissttcchhaarrss above under SShheellll + VVaarriiaabblleess). The shell uses the history comment character to mark his- + tory timestamps when writing the history file. + + EEvveenntt DDeessiiggnnaattoorrss + An event designator is a reference to a command line entry in the his- + tory list. Unless the reference is absolute, events are relative to + the current position in the history list. + + !! Start a history substitution, except when followed by a bbllaannkk, + newline, carriage return, = or ( (when the eexxttgglloobb shell option + is enabled using the sshhoopptt builtin). + !!_n Refer to command line _n. + !!--_n Refer to the current command minus _n. + !!!! Refer to the previous command. This is a synonym for `!-1'. + !!_s_t_r_i_n_g + Refer to the most recent command preceding the current position + in the history list starting with _s_t_r_i_n_g. + !!??_s_t_r_i_n_g[[??]] + Refer to the most recent command preceding the current position + in the history list containing _s_t_r_i_n_g. The trailing ?? may be + omitted if _s_t_r_i_n_g is followed immediately by a newline. + ^^_s_t_r_i_n_g_1^^_s_t_r_i_n_g_2^^ + Quick substitution. Repeat the previous command, replacing + _s_t_r_i_n_g_1 with _s_t_r_i_n_g_2. Equivalent to ``!!:s/_s_t_r_i_n_g_1/_s_t_r_i_n_g_2/'' + (see MMooddiiffiieerrss below). + !!## The entire command line typed so far. + + WWoorrdd DDeessiiggnnaattoorrss + Word designators are used to select desired words from the event. A :: + separates the event specification from the word designator. It may be + omitted if the word designator begins with a ^^, $$, **, --, or %%. Words + are numbered from the beginning of the line, with the first word being + denoted by 0 (zero). Words are inserted into the current line sepa- + rated by single spaces. + + 00 ((zzeerroo)) + The zeroth word. For the shell, this is the command word. + _n The _nth word. + ^^ The first argument. That is, word 1. + $$ The last word. This is usually the last argument, but will + expand to the zeroth word if there is only one word in the line. + %% The word matched by the most recent `?_s_t_r_i_n_g?' search. + _x--_y A range of words; `-_y' abbreviates `0-_y'. + ** All of the words but the zeroth. This is a synonym for `_1_-_$'. + It is not an error to use ** if there is just one word in the + event; the empty string is returned in that case. + xx** Abbreviates _x_-_$. + xx-- Abbreviates _x_-_$ like xx**, but omits the last word. + + If a word designator is supplied without an event specification, the + previous command is used as the event. + + MMooddiiffiieerrss + After the optional word designator, there may appear a sequence of one + or more of the following modifiers, each preceded by a `:'. + + hh Remove a trailing filename component, leaving only the head. + tt Remove all leading filename components, leaving the tail. + rr Remove a trailing suffix of the form _._x_x_x, leaving the basename. + ee Remove all but the trailing suffix. + pp Print the new command but do not execute it. + qq Quote the substituted words, escaping further substitutions. + xx Quote the substituted words as with qq, but break into words at + bbllaannkkss and newlines. + ss//_o_l_d//_n_e_w// + Substitute _n_e_w for the first occurrence of _o_l_d in the event + line. Any delimiter can be used in place of /. The final + delimiter is optional if it is the last character of the event + line. The delimiter may be quoted in _o_l_d and _n_e_w with a single + backslash. If & appears in _n_e_w, it is replaced by _o_l_d. A sin- + gle backslash will quote the &. If _o_l_d is null, it is set to + the last _o_l_d substituted, or, if no previous history substitu- + tions took place, the last _s_t_r_i_n_g in a !!??_s_t_r_i_n_g[[??]] search. + && Repeat the previous substitution. + gg Cause changes to be applied over the entire event line. This is + used in conjunction with `::ss' (e.g., `::ggss//_o_l_d//_n_e_w//') or `::&&'. + If used with `::ss', any delimiter can be used in place of /, and + the final delimiter is optional if it is the last character of + the event line. An aa may be used as a synonym for gg. + GG Apply the following `ss' modifier once to each word in the event + line. + +SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS + Unless otherwise noted, each builtin command documented in this section + as accepting options preceded by -- accepts ---- to signify the end of the + options. The ::, ttrruuee, ffaallssee, and tteesstt builtins do not accept options + and do not treat ---- specially. The eexxiitt, llooggoouutt, bbrreeaakk, ccoonnttiinnuuee, lleett, + and sshhiifftt builtins accept and process arguments beginning with -- with- + out requiring ----. Other builtins that accept arguments but are not + specified as accepting options interpret arguments beginning with -- as + invalid options and require ---- to prevent this interpretation. + :: [_a_r_g_u_m_e_n_t_s] + No effect; the command does nothing beyond expanding _a_r_g_u_m_e_n_t_s + and performing any specified redirections. A zero exit code is + returned. + + .. _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] + ssoouurrccee _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] + Read and execute commands from _f_i_l_e_n_a_m_e in the current shell + environment and return the exit status of the last command exe- + cuted from _f_i_l_e_n_a_m_e. If _f_i_l_e_n_a_m_e does not contain a slash, + filenames in PPAATTHH are used to find the directory containing + _f_i_l_e_n_a_m_e. The file searched for in PPAATTHH need not be executable. + When bbaasshh is not in _p_o_s_i_x _m_o_d_e, the current directory is + searched if no file is found in PPAATTHH. If the ssoouurrcceeppaatthh option + to the sshhoopptt builtin command is turned off, the PPAATTHH is not + searched. If any _a_r_g_u_m_e_n_t_s are supplied, they become the posi- + tional parameters when _f_i_l_e_n_a_m_e is executed. Otherwise the + positional parameters are unchanged. The return status is the + status of the last command exited within the script (0 if no + commands are executed), and false if _f_i_l_e_n_a_m_e is not found or + cannot be read. + + aalliiaass [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] + AAlliiaass with no arguments or with the --pp option prints the list of + aliases in the form aalliiaass _n_a_m_e=_v_a_l_u_e on standard output. When + arguments are supplied, an alias is defined for each _n_a_m_e whose + _v_a_l_u_e is given. A trailing space in _v_a_l_u_e causes the next word + to be checked for alias substitution when the alias is expanded. + For each _n_a_m_e in the argument list for which no _v_a_l_u_e is sup- + plied, the name and value of the alias is printed. AAlliiaass + returns true unless a _n_a_m_e is given for which no alias has been + defined. + + bbgg [_j_o_b_s_p_e_c ...] + Resume each suspended job _j_o_b_s_p_e_c in the background, as if it + had been started with &&. If _j_o_b_s_p_e_c is not present, the shell's + notion of the _c_u_r_r_e_n_t _j_o_b is used. bbgg _j_o_b_s_p_e_c returns 0 unless + run when job control is disabled or, when run with job control + enabled, any specified _j_o_b_s_p_e_c was not found or was started + without job control. + + bbiinndd [--mm _k_e_y_m_a_p] [--llppssvvPPSSVVXX] + bbiinndd [--mm _k_e_y_m_a_p] [--qq _f_u_n_c_t_i_o_n] [--uu _f_u_n_c_t_i_o_n] [--rr _k_e_y_s_e_q] + bbiinndd [--mm _k_e_y_m_a_p] --ff _f_i_l_e_n_a_m_e + bbiinndd [--mm _k_e_y_m_a_p] --xx _k_e_y_s_e_q:_s_h_e_l_l_-_c_o_m_m_a_n_d + bbiinndd [--mm _k_e_y_m_a_p] _k_e_y_s_e_q:_f_u_n_c_t_i_o_n_-_n_a_m_e + bbiinndd _r_e_a_d_l_i_n_e_-_c_o_m_m_a_n_d + Display current rreeaaddlliinnee key and function bindings, bind a key + sequence to a rreeaaddlliinnee function or macro, or set a rreeaaddlliinnee + variable. Each non-option argument is a command as it would + appear in _._i_n_p_u_t_r_c, but each binding or command must be passed + as a separate argument; e.g., '"\C-x\C-r": re-read-init-file'. + Options, if supplied, have the following meanings: + --mm _k_e_y_m_a_p + Use _k_e_y_m_a_p as the keymap to be affected by the subsequent + bindings. Acceptable _k_e_y_m_a_p names are _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_- + _d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_m_o_v_e_, _v_i_-_c_o_m_m_a_n_d, + and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d; _e_m_a_c_s is + equivalent to _e_m_a_c_s_-_s_t_a_n_d_a_r_d. + --ll List the names of all rreeaaddlliinnee functions. + --pp Display rreeaaddlliinnee function names and bindings in such a + way that they can be re-read. + --PP List current rreeaaddlliinnee function names and bindings. + --ss Display rreeaaddlliinnee key sequences bound to macros and the + strings they output in such a way that they can be re- + read. + --SS Display rreeaaddlliinnee key sequences bound to macros and the + strings they output. + --vv Display rreeaaddlliinnee variable names and values in such a way + that they can be re-read. + --VV List current rreeaaddlliinnee variable names and values. + --ff _f_i_l_e_n_a_m_e + Read key bindings from _f_i_l_e_n_a_m_e. + --qq _f_u_n_c_t_i_o_n + Query about which keys invoke the named _f_u_n_c_t_i_o_n. + --uu _f_u_n_c_t_i_o_n + Unbind all keys bound to the named _f_u_n_c_t_i_o_n. + --rr _k_e_y_s_e_q + Remove any current binding for _k_e_y_s_e_q. + --xx _k_e_y_s_e_q::_s_h_e_l_l_-_c_o_m_m_a_n_d + Cause _s_h_e_l_l_-_c_o_m_m_a_n_d to be executed whenever _k_e_y_s_e_q is + entered. When _s_h_e_l_l_-_c_o_m_m_a_n_d is executed, the shell sets + the RREEAADDLLIINNEE__LLIINNEE variable to the contents of the rreeaadd-- + lliinnee line buffer and the RREEAADDLLIINNEE__PPOOIINNTT variable to the + current location of the insertion point. If the executed + command changes the value of RREEAADDLLIINNEE__LLIINNEE or RREEAADD-- + LLIINNEE__PPOOIINNTT, those new values will be reflected in the + editing state. + --XX List all key sequences bound to shell commands and the + associated commands in a format that can be reused as + input. + + The return value is 0 unless an unrecognized option is given or + an error occurred. + + bbrreeaakk [_n] + Exit from within a ffoorr, wwhhiillee, uunnttiill, or sseelleecctt loop. If _n is + specified, break _n levels. _n must be >= 1. If _n is greater + than the number of enclosing loops, all enclosing loops are + exited. The return value is 0 unless _n is not greater than or + equal to 1. + + bbuuiillttiinn _s_h_e_l_l_-_b_u_i_l_t_i_n [_a_r_g_u_m_e_n_t_s] + Execute the specified shell builtin, passing it _a_r_g_u_m_e_n_t_s, and + return its exit status. This is useful when defining a function + whose name is the same as a shell builtin, retaining the func- + tionality of the builtin within the function. The ccdd builtin is + commonly redefined this way. The return status is false if + _s_h_e_l_l_-_b_u_i_l_t_i_n is not a shell builtin command. + + ccaalllleerr [_e_x_p_r] + Returns the context of any active subroutine call (a shell func- + tion or a script executed with the .. or ssoouurrccee builtins). With- + out _e_x_p_r, ccaalllleerr displays the line number and source filename of + the current subroutine call. If a non-negative integer is sup- + plied as _e_x_p_r, ccaalllleerr displays the line number, subroutine name, + and source file corresponding to that position in the current + execution call stack. This extra information may be used, for + example, to print a stack trace. The current frame is frame 0. + The return value is 0 unless the shell is not executing a sub- + routine call or _e_x_p_r does not correspond to a valid position in + the call stack. + + ccdd [--LL|[--PP [--ee]] [-@]] [_d_i_r] + Change the current directory to _d_i_r. if _d_i_r is not supplied, + the value of the HHOOMMEE shell variable is the default. Any addi- + tional arguments following _d_i_r are ignored. The variable CCDDPPAATTHH + defines the search path for the directory containing _d_i_r: each + directory name in CCDDPPAATTHH is searched for _d_i_r. Alternative + directory names in CCDDPPAATTHH are separated by a colon (:). A null + directory name in CCDDPPAATTHH is the same as the current directory, + i.e., ``..''. If _d_i_r begins with a slash (/), then CCDDPPAATTHH is not + used. The --PP option causes ccdd to use the physical directory + structure by resolving symbolic links while traversing _d_i_r and + before processing instances of _._. in _d_i_r (see also the --PP option + to the sseett builtin command); the --LL option forces symbolic links + to be followed by resolving the link after processing instances + of _._. in _d_i_r. If _._. appears in _d_i_r, it is processed by removing + the immediately previous pathname component from _d_i_r, back to a + slash or the beginning of _d_i_r. If the --ee option is supplied + with --PP, and the current working directory cannot be success- + fully determined after a successful directory change, ccdd will + return an unsuccessful status. On systems that support it, the + --@@ option presents the extended attributes associated with a + file as a directory. An argument of -- is converted to $$OOLLDDPPWWDD + before the directory change is attempted. If a non-empty direc- + tory name from CCDDPPAATTHH is used, or if -- is the first argument, + and the directory change is successful, the absolute pathname of + the new working directory is written to the standard output. + The return value is true if the directory was successfully + changed; false otherwise. + + ccoommmmaanndd [--ppVVvv] _c_o_m_m_a_n_d [_a_r_g ...] + Run _c_o_m_m_a_n_d with _a_r_g_s suppressing the normal shell function + lookup. Only builtin commands or commands found in the PPAATTHH are + executed. If the --pp option is given, the search for _c_o_m_m_a_n_d is + performed using a default value for PPAATTHH that is guaranteed to + find all of the standard utilities. If either the --VV or --vv + option is supplied, a description of _c_o_m_m_a_n_d is printed. The --vv + option causes a single word indicating the command or filename + used to invoke _c_o_m_m_a_n_d to be displayed; the --VV option produces a + more verbose description. If the --VV or --vv option is supplied, + the exit status is 0 if _c_o_m_m_a_n_d was found, and 1 if not. If + neither option is supplied and an error occurred or _c_o_m_m_a_n_d can- + not be found, the exit status is 127. Otherwise, the exit sta- + tus of the ccoommmmaanndd builtin is the exit status of _c_o_m_m_a_n_d. + + ccoommppggeenn [_o_p_t_i_o_n] [_w_o_r_d] + Generate possible completion matches for _w_o_r_d according to the + _o_p_t_i_o_ns, which may be any option accepted by the ccoommpplleettee + builtin with the exception of --pp and --rr, and write the matches + to the standard output. When using the --FF or --CC options, the + various shell variables set by the programmable completion + facilities, while available, will not have useful values. + + The matches will be generated in the same way as if the pro- + grammable completion code had generated them directly from a + completion specification with the same flags. If _w_o_r_d is speci- + fied, only those completions matching _w_o_r_d will be displayed. + + The return value is true unless an invalid option is supplied, + or no matches were generated. + + ccoommpplleettee [--aabbccddeeffggjjkkssuuvv] [--oo _c_o_m_p_-_o_p_t_i_o_n] [--DDEE] [--AA _a_c_t_i_o_n] [--GG _g_l_o_b_- + _p_a_t] [--WW _w_o_r_d_l_i_s_t] [--FF _f_u_n_c_t_i_o_n] [--CC _c_o_m_m_a_n_d] + [--XX _f_i_l_t_e_r_p_a_t] [--PP _p_r_e_f_i_x] [--SS _s_u_f_f_i_x] _n_a_m_e [_n_a_m_e _._._.] + ccoommpplleettee --pprr [--DDEE] [_n_a_m_e ...] + Specify how arguments to each _n_a_m_e should be completed. If the + --pp option is supplied, or if no options are supplied, existing + completion specifications are printed in a way that allows them + to be reused as input. The --rr option removes a completion spec- + ification for each _n_a_m_e, or, if no _n_a_m_es are supplied, all com- + pletion specifications. The --DD option indicates that the + remaining options and actions should apply to the ``default'' + command completion; that is, completion attempted on a command + for which no completion has previously been defined. The --EE + option indicates that the remaining options and actions should + apply to ``empty'' command completion; that is, completion + attempted on a blank line. + + The process of applying these completion specifications when + word completion is attempted is described above under PPrroo-- + ggrraammmmaabbllee CCoommpplleettiioonn. + + Other options, if specified, have the following meanings. The + arguments to the --GG, --WW, and --XX options (and, if necessary, the + --PP and --SS options) should be quoted to protect them from expan- + sion before the ccoommpplleettee builtin is invoked. + --oo _c_o_m_p_-_o_p_t_i_o_n + The _c_o_m_p_-_o_p_t_i_o_n controls several aspects of the comp- + spec's behavior beyond the simple generation of comple- + tions. _c_o_m_p_-_o_p_t_i_o_n may be one of: + bbaasshhddeeffaauulltt + Perform the rest of the default bbaasshh completions + if the compspec generates no matches. + ddeeffaauulltt Use readline's default filename completion if + the compspec generates no matches. + ddiirrnnaammeess + Perform directory name completion if the comp- + spec generates no matches. + ffiilleennaammeess + Tell readline that the compspec generates file- + names, so it can perform any filename-specific + processing (like adding a slash to directory + names, quoting special characters, or suppress- + ing trailing spaces). Intended to be used with + shell functions. + nnooqquuoottee Tell readline not to quote the completed words + if they are filenames (quoting filenames is the + default). + nnoossppaaccee Tell readline not to append a space (the + default) to words completed at the end of the + line. + pplluussddiirrss + After any matches defined by the compspec are + generated, directory name completion is + attempted and any matches are added to the + results of the other actions. + --AA _a_c_t_i_o_n + The _a_c_t_i_o_n may be one of the following to generate a + list of possible completions: + aalliiaass Alias names. May also be specified as --aa. + aarrrraayyvvaarr + Array variable names. + bbiinnddiinngg RReeaaddlliinnee key binding names. + bbuuiillttiinn Names of shell builtin commands. May also be + specified as --bb. + ccoommmmaanndd Command names. May also be specified as --cc. + ddiirreeccttoorryy + Directory names. May also be specified as --dd. + ddiissaabblleedd + Names of disabled shell builtins. + eennaabblleedd Names of enabled shell builtins. + eexxppoorrtt Names of exported shell variables. May also be + specified as --ee. + ffiillee File names. May also be specified as --ff. + ffuunnccttiioonn + Names of shell functions. + ggrroouupp Group names. May also be specified as --gg. + hheellppttooppiicc + Help topics as accepted by the hheellpp builtin. + hhoossttnnaammee + Hostnames, as taken from the file specified by + the HHOOSSTTFFIILLEE shell variable. + jjoobb Job names, if job control is active. May also + be specified as --jj. + kkeeyywwoorrdd Shell reserved words. May also be specified as + --kk. + rruunnnniinngg Names of running jobs, if job control is active. + sseerrvviiccee Service names. May also be specified as --ss. + sseettoopptt Valid arguments for the --oo option to the sseett + builtin. + sshhoopptt Shell option names as accepted by the sshhoopptt + builtin. + ssiiggnnaall Signal names. + ssttooppppeedd Names of stopped jobs, if job control is active. + uusseerr User names. May also be specified as --uu. + vvaarriiaabbllee + Names of all shell variables. May also be spec- + ified as --vv. + --CC _c_o_m_m_a_n_d + _c_o_m_m_a_n_d is executed in a subshell environment, and its + output is used as the possible completions. + --FF _f_u_n_c_t_i_o_n + The shell function _f_u_n_c_t_i_o_n is executed in the current + shell environment. When the function is executed, the + first argument ($$11) is the name of the command whose + arguments are being completed, the second argument ($$22) + is the word being completed, and the third argument ($$33) + is the word preceding the word being completed on the + current command line. When it finishes, the possible + completions are retrieved from the value of the CCOOMMPPRREE-- + PPLLYY array variable. + --GG _g_l_o_b_p_a_t + The pathname expansion pattern _g_l_o_b_p_a_t is expanded to + generate the possible completions. + --PP _p_r_e_f_i_x + _p_r_e_f_i_x is added at the beginning of each possible com- + pletion after all other options have been applied. + --SS _s_u_f_f_i_x + _s_u_f_f_i_x is appended to each possible completion after all + other options have been applied. + --WW _w_o_r_d_l_i_s_t + The _w_o_r_d_l_i_s_t is split using the characters in the IIFFSS + special variable as delimiters, and each resultant word + is expanded. The possible completions are the members + of the resultant list which match the word being com- + pleted. + --XX _f_i_l_t_e_r_p_a_t + _f_i_l_t_e_r_p_a_t is a pattern as used for pathname expansion. + It is applied to the list of possible completions gener- + ated by the preceding options and arguments, and each + completion matching _f_i_l_t_e_r_p_a_t is removed from the list. + A leading !! in _f_i_l_t_e_r_p_a_t negates the pattern; in this + case, any completion not matching _f_i_l_t_e_r_p_a_t is removed. + + The return value is true unless an invalid option is supplied, + an option other than --pp or --rr is supplied without a _n_a_m_e argu- + ment, an attempt is made to remove a completion specification + for a _n_a_m_e for which no specification exists, or an error occurs + adding a completion specification. + + ccoommppoopptt [--oo _o_p_t_i_o_n] [--DDEE] [++oo _o_p_t_i_o_n] [_n_a_m_e] + Modify completion options for each _n_a_m_e according to the + _o_p_t_i_o_ns, or for the currently-executing completion if no _n_a_m_es + are supplied. If no _o_p_t_i_o_ns are given, display the completion + options for each _n_a_m_e or the current completion. The possible + values of _o_p_t_i_o_n are those valid for the ccoommpplleettee builtin + described above. The --DD option indicates that the remaining + options should apply to the ``default'' command completion; that + is, completion attempted on a command for which no completion + has previously been defined. The --EE option indicates that the + remaining options should apply to ``empty'' command completion; + that is, completion attempted on a blank line. + + The return value is true unless an invalid option is supplied, + an attempt is made to modify the options for a _n_a_m_e for which no + completion specification exists, or an output error occurs. + + ccoonnttiinnuuee [_n] + Resume the next iteration of the enclosing ffoorr, wwhhiillee, uunnttiill, or + sseelleecctt loop. If _n is specified, resume at the _nth enclosing + loop. _n must be >= 1. If _n is greater than the number of + enclosing loops, the last enclosing loop (the ``top-level'' + loop) is resumed. The return value is 0 unless _n is not greater + than or equal to 1. + + ddeeccllaarree [--aaAAffFFggiillnnrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] + ttyyppeesseett [--aaAAffFFggiillnnrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] + Declare variables and/or give them attributes. If no _n_a_m_es are + given then display the values of variables. The --pp option will + display the attributes and values of each _n_a_m_e. When --pp is used + with _n_a_m_e arguments, additional options, other than --ff and --FF, + are ignored. When --pp is supplied without _n_a_m_e arguments, it + will display the attributes and values of all variables having + the attributes specified by the additional options. If no other + options are supplied with --pp, ddeeccllaarree will display the + attributes and values of all shell variables. The --ff option + will restrict the display to shell functions. The --FF option + inhibits the display of function definitions; only the function + name and attributes are printed. If the eexxttddeebbuugg shell option + is enabled using sshhoopptt, the source file name and line number + where the function is defined are displayed as well. The --FF + option implies --ff. The --gg option forces variables to be created + or modified at the global scope, even when ddeeccllaarree is executed + in a shell function. It is ignored in all other cases. The + following options can be used to restrict output to variables + with the specified attribute or to give variables attributes: + --aa Each _n_a_m_e is an indexed array variable (see AArrrraayyss + above). + --AA Each _n_a_m_e is an associative array variable (see AArrrraayyss + above). + --ff Use function names only. + --ii The variable is treated as an integer; arithmetic evalua- + tion (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN above) is performed when + the variable is assigned a value. + --ll When the variable is assigned a value, all upper-case + characters are converted to lower-case. The upper-case + attribute is disabled. + --nn Give each _n_a_m_e the _n_a_m_e_r_e_f attribute, making it a name + reference to another variable. That other variable is + defined by the value of _n_a_m_e. All references and assign- + ments to _n_a_m_e, except for changing the --nn attribute + itself, are performed on the variable referenced by + _n_a_m_e's value. The --nn attribute cannot be applied to + array variables. + --rr Make _n_a_m_es readonly. These names cannot then be assigned + values by subsequent assignment statements or unset. + --tt Give each _n_a_m_e the _t_r_a_c_e attribute. Traced functions + inherit the DDEEBBUUGG and RREETTUURRNN traps from the calling + shell. The trace attribute has no special meaning for + variables. + --uu When the variable is assigned a value, all lower-case + characters are converted to upper-case. The lower-case + attribute is disabled. + --xx Mark _n_a_m_es for export to subsequent commands via the + environment. + + Using `+' instead of `-' turns off the attribute instead, with + the exceptions that ++aa may not be used to destroy an array vari- + able and ++rr will not remove the readonly attribute. When used + in a function, ddeeccllaarree and ttyyppeesseett make each _n_a_m_e local, as with + the llooccaall command, unless the --gg option is supplied. If a vari- + able name is followed by =_v_a_l_u_e, the value of the variable is + set to _v_a_l_u_e. When using --aa or --AA and the compound assignment + syntax to create array variables, additional attributes do not + take effect until subsequent assignments. The return value is 0 + unless an invalid option is encountered, an attempt is made to + define a function using ``-f foo=bar'', an attempt is made to + assign a value to a readonly variable, an attempt is made to + assign a value to an array variable without using the compound + assignment syntax (see AArrrraayyss above), one of the _n_a_m_e_s is not a + valid shell variable name, an attempt is made to turn off read- + only status for a readonly variable, an attempt is made to turn + off array status for an array variable, or an attempt is made to + display a non-existent function with --ff. + + ddiirrss [[--ccllppvv]] [[++_n]] [[--_n]] + Without options, displays the list of currently remembered + directories. The default display is on a single line with + directory names separated by spaces. Directories are added to + the list with the ppuusshhdd command; the ppooppdd command removes + entries from the list. + --cc Clears the directory stack by deleting all of the + entries. + --ll Produces a listing using full pathnames; the default + listing format uses a tilde to denote the home directory. + --pp Print the directory stack with one entry per line. + --vv Print the directory stack with one entry per line, pre- + fixing each entry with its index in the stack. + ++_n Displays the _nth entry counting from the left of the list + shown by ddiirrss when invoked without options, starting with + zero. + --_n Displays the _nth entry counting from the right of the + list shown by ddiirrss when invoked without options, starting + with zero. + + The return value is 0 unless an invalid option is supplied or _n + indexes beyond the end of the directory stack. + + ddiissoowwnn [--aarr] [--hh] [_j_o_b_s_p_e_c ...] + Without options, remove each _j_o_b_s_p_e_c from the table of active + jobs. If _j_o_b_s_p_e_c is not present, and neither the --aa nor the --rr + option is supplied, the _c_u_r_r_e_n_t _j_o_b is used. If the --hh option + is given, each _j_o_b_s_p_e_c is not removed from the table, but is + marked so that SSIIGGHHUUPP is not sent to the job if the shell + receives a SSIIGGHHUUPP. If no _j_o_b_s_p_e_c is supplied, the --aa option + means to remove or mark all jobs; the --rr option without a _j_o_b_- + _s_p_e_c argument restricts operation to running jobs. The return + value is 0 unless a _j_o_b_s_p_e_c does not specify a valid job. + + eecchhoo [--nneeEE] [_a_r_g ...] + Output the _a_r_gs, separated by spaces, followed by a newline. + The return status is 0 unless a write error occurs. If --nn is + specified, the trailing newline is suppressed. If the --ee option + is given, interpretation of the following backslash-escaped + characters is enabled. The --EE option disables the interpreta- + tion of these escape characters, even on systems where they are + interpreted by default. The xxppgg__eecchhoo shell option may be used + to dynamically determine whether or not eecchhoo expands these + escape characters by default. eecchhoo does not interpret ---- to + mean the end of options. eecchhoo interprets the following escape + sequences: + \\aa alert (bell) + \\bb backspace + \\cc suppress further output + \\ee + \\EE an escape character + \\ff form feed + \\nn new line + \\rr carriage return + \\tt horizontal tab + \\vv vertical tab + \\\\ backslash + \\00_n_n_n the eight-bit character whose value is the octal value + _n_n_n (zero to three octal digits) + \\xx_H_H the eight-bit character whose value is the hexadecimal + value _H_H (one or two hex digits) + \\uu_H_H_H_H the Unicode (ISO/IEC 10646) character whose value is the + hexadecimal value _H_H_H_H (one to four hex digits) + \\UU_H_H_H_H_H_H_H_H + the Unicode (ISO/IEC 10646) character whose value is the + hexadecimal value _H_H_H_H_H_H_H_H (one to eight hex digits) + + eennaabbllee [--aa] [--ddnnppss] [--ff _f_i_l_e_n_a_m_e] [_n_a_m_e ...] + Enable and disable builtin shell commands. Disabling a builtin + allows a disk command which has the same name as a shell builtin + to be executed without specifying a full pathname, even though + the shell normally searches for builtins before disk commands. + If --nn is used, each _n_a_m_e is disabled; otherwise, _n_a_m_e_s are + enabled. For example, to use the tteesstt binary found via the PPAATTHH + instead of the shell builtin version, run ``enable -n test''. + The --ff option means to load the new builtin command _n_a_m_e from + shared object _f_i_l_e_n_a_m_e, on systems that support dynamic loading. + The --dd option will delete a builtin previously loaded with --ff. + If no _n_a_m_e arguments are given, or if the --pp option is supplied, + a list of shell builtins is printed. With no other option argu- + ments, the list consists of all enabled shell builtins. If --nn + is supplied, only disabled builtins are printed. If --aa is sup- + plied, the list printed includes all builtins, with an indica- + tion of whether or not each is enabled. If --ss is supplied, the + output is restricted to the POSIX _s_p_e_c_i_a_l builtins. The return + value is 0 unless a _n_a_m_e is not a shell builtin or there is an + error loading a new builtin from a shared object. + + eevvaall [_a_r_g ...] + The _a_r_gs are read and concatenated together into a single com- + mand. This command is then read and executed by the shell, and + its exit status is returned as the value of eevvaall. If there are + no _a_r_g_s, or only null arguments, eevvaall returns 0. + + eexxeecc [--ccll] [--aa _n_a_m_e] [_c_o_m_m_a_n_d [_a_r_g_u_m_e_n_t_s]] + If _c_o_m_m_a_n_d is specified, it replaces the shell. No new process + is created. The _a_r_g_u_m_e_n_t_s become the arguments to _c_o_m_m_a_n_d. If + the --ll option is supplied, the shell places a dash at the begin- + ning of the zeroth argument passed to _c_o_m_m_a_n_d. This is what + _l_o_g_i_n(1) does. The --cc option causes _c_o_m_m_a_n_d to be executed with + an empty environment. If --aa is supplied, the shell passes _n_a_m_e + as the zeroth argument to the executed command. If _c_o_m_m_a_n_d can- + not be executed for some reason, a non-interactive shell exits, + unless the eexxeeccffaaiill shell option is enabled. In that case, it + returns failure. An interactive shell returns failure if the + file cannot be executed. If _c_o_m_m_a_n_d is not specified, any redi- + rections take effect in the current shell, and the return status + is 0. If there is a redirection error, the return status is 1. + + eexxiitt [_n] + Cause the shell to exit with a status of _n. If _n is omitted, + the exit status is that of the last command executed. A trap on + EEXXIITT is executed before the shell terminates. + + eexxppoorrtt [--ffnn] [_n_a_m_e[=_w_o_r_d]] ... + eexxppoorrtt --pp + The supplied _n_a_m_e_s are marked for automatic export to the envi- + ronment of subsequently executed commands. If the --ff option is + given, the _n_a_m_e_s refer to functions. If no _n_a_m_e_s are given, or + if the --pp option is supplied, a list of names of all exported + variables is printed. The --nn option causes the export property + to be removed from each _n_a_m_e. If a variable name is followed by + =_w_o_r_d, the value of the variable is set to _w_o_r_d. eexxppoorrtt returns + an exit status of 0 unless an invalid option is encountered, one + of the _n_a_m_e_s is not a valid shell variable name, or --ff is sup- + plied with a _n_a_m_e that is not a function. + + ffcc [--ee _e_n_a_m_e] [--llnnrr] [_f_i_r_s_t] [_l_a_s_t] + ffcc --ss [_p_a_t=_r_e_p] [_c_m_d] + The first form selects a range of commands from _f_i_r_s_t to _l_a_s_t + from the history list and displays or edits and re-executes + them. _F_i_r_s_t and _l_a_s_t may be specified as a string (to locate + the last command beginning with that string) or as a number (an + index into the history list, where a negative number is used as + an offset from the current command number). If _l_a_s_t is not + specified it is set to the current command for listing (so that + ``fc -l -10'' prints the last 10 commands) and to _f_i_r_s_t other- + wise. If _f_i_r_s_t is not specified it is set to the previous com- + mand for editing and -16 for listing. + + The --nn option suppresses the command numbers when listing. The + --rr option reverses the order of the commands. If the --ll option + is given, the commands are listed on standard output. Other- + wise, the editor given by _e_n_a_m_e is invoked on a file containing + those commands. If _e_n_a_m_e is not given, the value of the FFCCEEDDIITT + variable is used, and the value of EEDDIITTOORR if FFCCEEDDIITT is not set. + If neither variable is set, _v_i is used. When editing is com- + plete, the edited commands are echoed and executed. + + In the second form, _c_o_m_m_a_n_d is re-executed after each instance + of _p_a_t is replaced by _r_e_p. _C_o_m_m_a_n_d is intepreted the same as + _f_i_r_s_t above. A useful alias to use with this is ``r="fc -s"'', + so that typing ``r cc'' runs the last command beginning with + ``cc'' and typing ``r'' re-executes the last command. + + If the first form is used, the return value is 0 unless an + invalid option is encountered or _f_i_r_s_t or _l_a_s_t specify history + lines out of range. If the --ee option is supplied, the return + value is the value of the last command executed or failure if an + error occurs with the temporary file of commands. If the second + form is used, the return status is that of the command re-exe- + cuted, unless _c_m_d does not specify a valid history line, in + which case ffcc returns failure. + + ffgg [_j_o_b_s_p_e_c] + Resume _j_o_b_s_p_e_c in the foreground, and make it the current job. + If _j_o_b_s_p_e_c is not present, the shell's notion of the _c_u_r_r_e_n_t _j_o_b + is used. The return value is that of the command placed into + the foreground, or failure if run when job control is disabled + or, when run with job control enabled, if _j_o_b_s_p_e_c does not spec- + ify a valid job or _j_o_b_s_p_e_c specifies a job that was started + without job control. + + ggeettooppttss _o_p_t_s_t_r_i_n_g _n_a_m_e [_a_r_g_s] + ggeettooppttss is used by shell procedures to parse positional parame- + ters. _o_p_t_s_t_r_i_n_g contains the option characters to be recog- + nized; if a character is followed by a colon, the option is + expected to have an argument, which should be separated from it + by white space. The colon and question mark characters may not + be used as option characters. Each time it is invoked, ggeettooppttss + places the next option in the shell variable _n_a_m_e, initializing + _n_a_m_e if it does not exist, and the index of the next argument to + be processed into the variable OOPPTTIINNDD. OOPPTTIINNDD is initialized to + 1 each time the shell or a shell script is invoked. When an + option requires an argument, ggeettooppttss places that argument into + the variable OOPPTTAARRGG. The shell does not reset OOPPTTIINNDD automati- + cally; it must be manually reset between multiple calls to + ggeettooppttss within the same shell invocation if a new set of parame- + ters is to be used. + + When the end of options is encountered, ggeettooppttss exits with a + return value greater than zero. OOPPTTIINNDD is set to the index of + the first non-option argument, and _n_a_m_e is set to ?. + + ggeettooppttss normally parses the positional parameters, but if more + arguments are given in _a_r_g_s, ggeettooppttss parses those instead. + + ggeettooppttss can report errors in two ways. If the first character + of _o_p_t_s_t_r_i_n_g is a colon, _s_i_l_e_n_t error reporting is used. In + normal operation, diagnostic messages are printed when invalid + options or missing option arguments are encountered. If the + variable OOPPTTEERRRR is set to 0, no error messages will be dis- + played, even if the first character of _o_p_t_s_t_r_i_n_g is not a colon. + + If an invalid option is seen, ggeettooppttss places ? into _n_a_m_e and, if + not silent, prints an error message and unsets OOPPTTAARRGG. If + ggeettooppttss is silent, the option character found is placed in + OOPPTTAARRGG and no diagnostic message is printed. + + If a required argument is not found, and ggeettooppttss is not silent, + a question mark (??) is placed in _n_a_m_e, OOPPTTAARRGG is unset, and a + diagnostic message is printed. If ggeettooppttss is silent, then a + colon (::) is placed in _n_a_m_e and OOPPTTAARRGG is set to the option + character found. + + ggeettooppttss returns true if an option, specified or unspecified, is + found. It returns false if the end of options is encountered or + an error occurs. + + hhaasshh [--llrr] [--pp _f_i_l_e_n_a_m_e] [--ddtt] [_n_a_m_e] + Each time hhaasshh is invoked, the full pathname of the command _n_a_m_e + is determined by searching the directories in $$PPAATTHH and remem- + bered. Any previously-remembered pathname is discarded. If the + --pp option is supplied, no path search is performed, and _f_i_l_e_n_a_m_e + is used as the full filename of the command. The --rr option + causes the shell to forget all remembered locations. The --dd + option causes the shell to forget the remembered location of + each _n_a_m_e. If the --tt option is supplied, the full pathname to + which each _n_a_m_e corresponds is printed. If multiple _n_a_m_e argu- + ments are supplied with --tt, the _n_a_m_e is printed before the + hashed full pathname. The --ll option causes output to be dis- + played in a format that may be reused as input. If no arguments + are given, or if only --ll is supplied, information about remem- + bered commands is printed. The return status is true unless a + _n_a_m_e is not found or an invalid option is supplied. + + hheellpp [--ddmmss] [_p_a_t_t_e_r_n] + Display helpful information about builtin commands. If _p_a_t_t_e_r_n + is specified, hheellpp gives detailed help on all commands matching + _p_a_t_t_e_r_n; otherwise help for all the builtins and shell control + structures is printed. + --dd Display a short description of each _p_a_t_t_e_r_n + --mm Display the description of each _p_a_t_t_e_r_n in a manpage-like + format + --ss Display only a short usage synopsis for each _p_a_t_t_e_r_n + + The return status is 0 unless no command matches _p_a_t_t_e_r_n. + + hhiissttoorryy [[_n]] + hhiissttoorryy --cc + hhiissttoorryy --dd _o_f_f_s_e_t + hhiissttoorryy --aannrrww [_f_i_l_e_n_a_m_e] + hhiissttoorryy --pp _a_r_g [_a_r_g _._._.] + hhiissttoorryy --ss _a_r_g [_a_r_g _._._.] + With no options, display the command history list with line num- + bers. Lines listed with a ** have been modified. An argument of + _n lists only the last _n lines. If the shell variable HHIISSTTTTIIMMEE-- + FFOORRMMAATT is set and not null, it is used as a format string for + _s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis- + played history entry. No intervening blank is printed between + the formatted time stamp and the history line. If _f_i_l_e_n_a_m_e is + supplied, it is used as the name of the history file; if not, + the value of HHIISSTTFFIILLEE is used. Options, if supplied, have the + following meanings: + --cc Clear the history list by deleting all the entries. + --dd _o_f_f_s_e_t + Delete the history entry at position _o_f_f_s_e_t. + --aa Append the ``new'' history lines (history lines entered + since the beginning of the current bbaasshh session) to the + history file. + --nn Read the history lines not already read from the history + file into the current history list. These are lines + appended to the history file since the beginning of the + current bbaasshh session. + --rr Read the contents of the history file and append them to + the current history list. + --ww Write the current history list to the history file, over- + writing the history file's contents. + --pp Perform history substitution on the following _a_r_g_s and + display the result on the standard output. Does not + store the results in the history list. Each _a_r_g must be + quoted to disable normal history expansion. + --ss Store the _a_r_g_s in the history list as a single entry. + The last command in the history list is removed before + the _a_r_g_s are added. + + If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, the time stamp informa- + tion associated with each history entry is written to the his- + tory file, marked with the history comment character. When the + history file is read, lines beginning with the history comment + character followed immediately by a digit are interpreted as + timestamps for the previous history line. The return value is 0 + unless an invalid option is encountered, an error occurs while + reading or writing the history file, an invalid _o_f_f_s_e_t is sup- + plied as an argument to --dd, or the history expansion supplied as + an argument to --pp fails. + + jjoobbss [--llnnpprrss] [ _j_o_b_s_p_e_c ... ] + jjoobbss --xx _c_o_m_m_a_n_d [ _a_r_g_s ... ] + The first form lists the active jobs. The options have the fol- + lowing meanings: + --ll List process IDs in addition to the normal information. + --nn Display information only about jobs that have changed + status since the user was last notified of their status. + --pp List only the process ID of the job's process group + leader. + --rr Display only running jobs. + --ss Display only stopped jobs. + + If _j_o_b_s_p_e_c is given, output is restricted to information about + that job. The return status is 0 unless an invalid option is + encountered or an invalid _j_o_b_s_p_e_c is supplied. + + If the --xx option is supplied, jjoobbss replaces any _j_o_b_s_p_e_c found in + _c_o_m_m_a_n_d or _a_r_g_s with the corresponding process group ID, and + executes _c_o_m_m_a_n_d passing it _a_r_g_s, returning its exit status. + + kkiillll [--ss _s_i_g_s_p_e_c | --nn _s_i_g_n_u_m | --_s_i_g_s_p_e_c] [_p_i_d | _j_o_b_s_p_e_c] ... + kkiillll --ll [_s_i_g_s_p_e_c | _e_x_i_t___s_t_a_t_u_s] + Send the signal named by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes + named by _p_i_d or _j_o_b_s_p_e_c. _s_i_g_s_p_e_c is either a case-insensitive + signal name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or + a signal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not + present, then SSIIGGTTEERRMM is assumed. An argument of --ll lists the + signal names. If any arguments are supplied when --ll is given, + the names of the signals corresponding to the arguments are + listed, and the return status is 0. The _e_x_i_t___s_t_a_t_u_s argument to + --ll is a number specifying either a signal number or the exit + status of a process terminated by a signal. kkiillll returns true + if at least one signal was successfully sent, or false if an + error occurs or an invalid option is encountered. + + lleett _a_r_g [_a_r_g ...] + Each _a_r_g is an arithmetic expression to be evaluated (see AARRIITTHH-- + MMEETTIICC EEVVAALLUUAATTIIOONN above). If the last _a_r_g evaluates to 0, lleett + returns 1; 0 is returned otherwise. + + llooccaall [_o_p_t_i_o_n] [_n_a_m_e[=_v_a_l_u_e] ...] + For each argument, a local variable named _n_a_m_e is created, and + assigned _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted + by ddeeccllaarree. When llooccaall is used within a function, it causes the + variable _n_a_m_e to have a visible scope restricted to that func- + tion and its children. With no operands, llooccaall writes a list of + local variables to the standard output. It is an error to use + llooccaall when not within a function. The return status is 0 unless + llooccaall is used outside a function, an invalid _n_a_m_e is supplied, + or _n_a_m_e is a readonly variable. + + llooggoouutt Exit a login shell. + + mmaappffiillee [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k] + [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y] + rreeaaddaarrrraayy [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k] + [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y] + Read lines from the standard input into the indexed array vari- + able _a_r_r_a_y, or from file descriptor _f_d if the --uu option is sup- + plied. The variable MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if + supplied, have the following meanings: + --nn Copy at most _c_o_u_n_t lines. If _c_o_u_n_t is 0, all lines are + copied. + --OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default + index is 0. + --ss Discard the first _c_o_u_n_t lines read. + --tt Remove a trailing newline from each line read. + --uu Read lines from file descriptor _f_d instead of the stan- + dard input. + --CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The + --cc option specifies _q_u_a_n_t_u_m. + --cc Specify the number of lines read between each call to + _c_a_l_l_b_a_c_k. + + If --CC is specified without --cc, the default quantum is 5000. + When _c_a_l_l_b_a_c_k is evaluated, it is supplied the index of the next + array element to be assigned and the line to be assigned to that + element as additional arguments. _c_a_l_l_b_a_c_k is evaluated after + the line is read but before the array element is assigned. + + If not supplied with an explicit origin, mmaappffiillee will clear + _a_r_r_a_y before assigning to it. + + mmaappffiillee returns successfully unless an invalid option or option + argument is supplied, _a_r_r_a_y is invalid or unassignable, or if + _a_r_r_a_y is not an indexed array. + + ppooppdd [-nn] [+_n] [-_n] + Removes entries from the directory stack. With no arguments, + removes the top directory from the stack, and performs a ccdd to + the new top directory. Arguments, if supplied, have the follow- + ing meanings: + --nn Suppresses the normal change of directory when removing + directories from the stack, so that only the stack is + manipulated. + ++_n Removes the _nth entry counting from the left of the list + shown by ddiirrss, starting with zero. For example: ``popd + +0'' removes the first directory, ``popd +1'' the second. + --_n Removes the _nth entry counting from the right of the list + shown by ddiirrss, starting with zero. For example: ``popd + -0'' removes the last directory, ``popd -1'' the next to + last. + + If the ppooppdd command is successful, a ddiirrss is performed as well, + and the return status is 0. ppooppdd returns false if an invalid + option is encountered, the directory stack is empty, a non-exis- + tent directory stack entry is specified, or the directory change + fails. + + pprriinnttff [--vv _v_a_r] _f_o_r_m_a_t [_a_r_g_u_m_e_n_t_s] + Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the + control of the _f_o_r_m_a_t. The --vv option causes the output to be + assigned to the variable _v_a_r rather than being printed to the + standard output. + + The _f_o_r_m_a_t is a character string which contains three types of + objects: plain characters, which are simply copied to standard + output, character escape sequences, which are converted and + copied to the standard output, and format specifications, each + of which causes printing of the next successive _a_r_g_u_m_e_n_t. In + addition to the standard _p_r_i_n_t_f(1) format specifications, pprriinnttff + interprets the following extensions: + %%bb causes pprriinnttff to expand backslash escape sequences in the + corresponding _a_r_g_u_m_e_n_t (except that \\cc terminates output, + backslashes in \\'', \\"", and \\?? are not removed, and octal + escapes beginning with \\00 may contain up to four digits). + %%qq causes pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a + format that can be reused as shell input. + %%((_d_a_t_e_f_m_t))TT + causes pprriinnttff to output the date-time string resulting + from using _d_a_t_e_f_m_t as a format string for _s_t_r_f_t_i_m_e(3). + The corresponding _a_r_g_u_m_e_n_t is an integer representing the + number of seconds since the epoch. Two special argument + values may be used: -1 represents the current time, and + -2 represents the time the shell was invoked. If no + argument is specified, conversion behaves as if -1 had + been given. This is an exception to the usual pprriinnttff + behavior. + + Arguments to non-string format specifiers are treated as C con- + stants, except that a leading plus or minus sign is allowed, and + if the leading character is a single or double quote, the value + is the ASCII value of the following character. + + The _f_o_r_m_a_t is reused as necessary to consume all of the _a_r_g_u_- + _m_e_n_t_s. If the _f_o_r_m_a_t requires more _a_r_g_u_m_e_n_t_s than are supplied, + the extra format specifications behave as if a zero value or + null string, as appropriate, had been supplied. The return + value is zero on success, non-zero on failure. + + ppuusshhdd [--nn] [+_n] [-_n] + ppuusshhdd [--nn] [_d_i_r] + Adds a directory to the top of the directory stack, or rotates + the stack, making the new top of the stack the current working + directory. With no arguments, exchanges the top two directories + and returns 0, unless the directory stack is empty. Arguments, + if supplied, have the following meanings: + --nn Suppresses the normal change of directory when adding + directories to the stack, so that only the stack is + manipulated. + ++_n Rotates the stack so that the _nth directory (counting + from the left of the list shown by ddiirrss, starting with + zero) is at the top. + --_n Rotates the stack so that the _nth directory (counting + from the right of the list shown by ddiirrss, starting with + zero) is at the top. + _d_i_r Adds _d_i_r to the directory stack at the top, making it the + new current working directory as if it had been supplied + as the argument to the ccdd builtin. + + If the ppuusshhdd command is successful, a ddiirrss is performed as well. + If the first form is used, ppuusshhdd returns 0 unless the cd to _d_i_r + fails. With the second form, ppuusshhdd returns 0 unless the direc- + tory stack is empty, a non-existent directory stack element is + specified, or the directory change to the specified new current + directory fails. + + ppwwdd [--LLPP] + Print the absolute pathname of the current working directory. + The pathname printed contains no symbolic links if the --PP option + is supplied or the --oo pphhyyssiiccaall option to the sseett builtin command + is enabled. If the --LL option is used, the pathname printed may + contain symbolic links. The return status is 0 unless an error + occurs while reading the name of the current directory or an + invalid option is supplied. + + rreeaadd [--eerrss] [--aa _a_n_a_m_e] [--dd _d_e_l_i_m] [--ii _t_e_x_t] [--nn _n_c_h_a_r_s] [--NN _n_c_h_a_r_s] [--pp + _p_r_o_m_p_t] [--tt _t_i_m_e_o_u_t] [--uu _f_d] [_n_a_m_e ...] + One line is read from the standard input, or from the file + descriptor _f_d supplied as an argument to the --uu option, and the + first word is assigned to the first _n_a_m_e, the second word to the + second _n_a_m_e, and so on, with leftover words and their interven- + ing separators assigned to the last _n_a_m_e. If there are fewer + words read from the input stream than names, the remaining names + are assigned empty values. The characters in IIFFSS are used to + split the line into words using the same rules the shell uses + for expansion (described above under WWoorrdd SSpplliittttiinngg). The back- + slash character (\\) may be used to remove any special meaning + for the next character read and for line continuation. Options, + if supplied, have the following meanings: + --aa _a_n_a_m_e + The words are assigned to sequential indices of the array + variable _a_n_a_m_e, starting at 0. _a_n_a_m_e is unset before any + new values are assigned. Other _n_a_m_e arguments are + ignored. + --dd _d_e_l_i_m + The first character of _d_e_l_i_m is used to terminate the + input line, rather than newline. + --ee If the standard input is coming from a terminal, rreeaaddlliinnee + (see RREEAADDLLIINNEE above) is used to obtain the line. Read- + line uses the current (or default, if line editing was + not previously active) editing settings. + --ii _t_e_x_t + If rreeaaddlliinnee is being used to read the line, _t_e_x_t is + placed into the editing buffer before editing begins. + --nn _n_c_h_a_r_s + rreeaadd returns after reading _n_c_h_a_r_s characters rather than + waiting for a complete line of input, but honor a delim- + iter if fewer than _n_c_h_a_r_s characters are read before the + delimiter. + --NN _n_c_h_a_r_s + rreeaadd returns after reading exactly _n_c_h_a_r_s characters + rather than waiting for a complete line of input, unless + EOF is encountered or rreeaadd times out. Delimiter charac- + ters encountered in the input are not treated specially + and do not cause rreeaadd to return until _n_c_h_a_r_s characters + are read. + --pp _p_r_o_m_p_t + Display _p_r_o_m_p_t on standard error, without a trailing new- + line, before attempting to read any input. The prompt is + displayed only if input is coming from a terminal. + --rr Backslash does not act as an escape character. The back- + slash is considered to be part of the line. In particu- + lar, a backslash-newline pair may not be used as a line + continuation. + --ss Silent mode. If input is coming from a terminal, charac- + ters are not echoed. + --tt _t_i_m_e_o_u_t + Cause rreeaadd to time out and return failure if a complete + line of input (or a specified number of characters) is + not read within _t_i_m_e_o_u_t seconds. _t_i_m_e_o_u_t may be a deci- + mal number with a fractional portion following the deci- + mal point. This option is only effective if rreeaadd is + reading input from a terminal, pipe, or other special + file; it has no effect when reading from regular files. + If rreeaadd times out, rreeaadd saves any partial input read into + the specified variable _n_a_m_e. If _t_i_m_e_o_u_t is 0, rreeaadd + returns immediately, without trying to read any data. + The exit status is 0 if input is available on the speci- + fied file descriptor, non-zero otherwise. The exit sta- + tus is greater than 128 if the timeout is exceeded. + --uu _f_d Read input from file descriptor _f_d. + + If no _n_a_m_e_s are supplied, the line read is assigned to the vari- + able RREEPPLLYY. The return code is zero, unless end-of-file is + encountered, rreeaadd times out (in which case the return code is + greater than 128), a variable assignment error (such as assign- + ing to a readonly variable) occurs, or an invalid file descrip- + tor is supplied as the argument to --uu. + + rreeaaddoonnllyy [--aaAAff] [--pp] [_n_a_m_e[=_w_o_r_d] ...] + The given _n_a_m_e_s are marked readonly; the values of these _n_a_m_e_s + may not be changed by subsequent assignment. If the --ff option + is supplied, the functions corresponding to the _n_a_m_e_s are so + marked. The --aa option restricts the variables to indexed + arrays; the --AA option restricts the variables to associative + arrays. If both options are supplied, --AA takes precedence. If + no _n_a_m_e arguments are given, or if the --pp option is supplied, a + list of all readonly names is printed. The other options may be + used to restrict the output to a subset of the set of readonly + names. The --pp option causes output to be displayed in a format + that may be reused as input. If a variable name is followed by + =_w_o_r_d, the value of the variable is set to _w_o_r_d. The return + status is 0 unless an invalid option is encountered, one of the + _n_a_m_e_s is not a valid shell variable name, or --ff is supplied with + a _n_a_m_e that is not a function. + + rreettuurrnn [_n] + Causes a function to stop executing and return the value speci- + fied by _n to its caller. If _n is omitted, the return status is + that of the last command executed in the function body. If + rreettuurrnn is used outside a function, but during execution of a + script by the .. (ssoouurrccee) command, it causes the shell to stop + executing that script and return either _n or the exit status of + the last command executed within the script as the exit status + of the script. If _n is supplied, the return value is its least + significant 8 bits. The return status is non-zero if rreettuurrnn is + supplied a non-numeric argument, or is used outside a function + and not during execution of a script by .. or ssoouurrccee. Any com- + mand associated with the RREETTUURRNN trap is executed before execu- + tion resumes after the function or script. + + sseett [----aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [--oo _o_p_t_i_o_n_-_n_a_m_e] [_a_r_g ...] + sseett [++aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [++oo _o_p_t_i_o_n_-_n_a_m_e] [_a_r_g ...] + Without options, the name and value of each shell variable are + displayed in a format that can be reused as input for setting or + resetting the currently-set variables. Read-only variables can- + not be reset. In _p_o_s_i_x mode, only shell variables are listed. + The output is sorted according to the current locale. When + options are specified, they set or unset shell attributes. Any + arguments remaining after option processing are treated as val- + ues for the positional parameters and are assigned, in order, to + $$11, $$22, ...... $$_n. Options, if specified, have the following + meanings: + --aa Automatically mark variables and functions which are + modified or created for export to the environment of + subsequent commands. + --bb Report the status of terminated background jobs immedi- + ately, rather than before the next primary prompt. This + is effective only when job control is enabled. + --ee Exit immediately if a _p_i_p_e_l_i_n_e (which may consist of a + single _s_i_m_p_l_e _c_o_m_m_a_n_d), a _l_i_s_t, or a _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d + (see SSHHEELLLL GGRRAAMMMMAARR above), exits with a non-zero sta- + tus. The shell does not exit if the command that fails + is part of the command list immediately following a + wwhhiillee or uunnttiill keyword, part of the test following the + iiff or eelliiff reserved words, part of any command executed + in a &&&& or |||| list except the command following the + final &&&& or ||||, any command in a pipeline but the last, + or if the command's return value is being inverted with + !!. If a compound command other than a subshell returns + a non-zero status because a command failed while --ee was + being ignored, the shell does not exit. A trap on EERRRR, + if set, is executed before the shell exits. This option + applies to the shell environment and each subshell envi- + ronment separately (see CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONNMMEENNTT + above), and may cause subshells to exit before executing + all the commands in the subshell. + + If a compound command or shell function executes in a + context where --ee is being ignored, none of the commands + executed within the compound command or function body + will be affected by the --ee setting, even if --ee is set + and a command returns a failure status. If a compound + command or shell function sets --ee while executing in a + context where --ee is ignored, that setting will not have + any effect until the compound command or the command + containing the function call completes. + --ff Disable pathname expansion. + --hh Remember the location of commands as they are looked up + for execution. This is enabled by default. + --kk All arguments in the form of assignment statements are + placed in the environment for a command, not just those + that precede the command name. + --mm Monitor mode. Job control is enabled. This option is + on by default for interactive shells on systems that + support it (see JJOOBB CCOONNTTRROOLL above). All processes run + in a separate process group. When a background job com- + pletes, the shell prints a line containing its exit sta- + tus. + --nn Read commands but do not execute them. This may be used + to check a shell script for syntax errors. This is + ignored by interactive shells. + --oo _o_p_t_i_o_n_-_n_a_m_e + The _o_p_t_i_o_n_-_n_a_m_e can be one of the following: + aalllleexxppoorrtt + Same as --aa. + bbrraacceeeexxppaanndd + Same as --BB. + eemmaaccss Use an emacs-style command line editing inter- + face. This is enabled by default when the shell + is interactive, unless the shell is started with + the ----nnooeeddiittiinngg option. This also affects the + editing interface used for rreeaadd --ee. + eerrrreexxiitt Same as --ee. + eerrrrttrraaccee + Same as --EE. + ffuunnccttrraaccee + Same as --TT. + hhaasshhaallll Same as --hh. + hhiisstteexxppaanndd + Same as --HH. + hhiissttoorryy Enable command history, as described above under + HHIISSTTOORRYY. This option is on by default in inter- + active shells. + iiggnnoorreeeeooff + The effect is as if the shell command + ``IGNOREEOF=10'' had been executed (see SShheellll + VVaarriiaabblleess above). + kkeeyywwoorrdd Same as --kk. + mmoonniittoorr Same as --mm. + nnoocclloobbbbeerr + Same as --CC. + nnooeexxeecc Same as --nn. + nnoogglloobb Same as --ff. + nnoolloogg Currently ignored. + nnoottiiffyy Same as --bb. + nnoouunnsseett Same as --uu. + oonneeccmmdd Same as --tt. + pphhyyssiiccaall + Same as --PP. + ppiippeeffaaiill + If set, the return value of a pipeline is the + value of the last (rightmost) command to exit + with a non-zero status, or zero if all commands + in the pipeline exit successfully. This option + is disabled by default. + ppoossiixx Change the behavior of bbaasshh where the default + operation differs from the POSIX standard to + match the standard (_p_o_s_i_x _m_o_d_e). See SSEEEE AALLSSOO + below for a reference to a document that details + how posix mode affects bash's behavior. + pprriivviilleeggeedd + Same as --pp. + vveerrbboossee Same as --vv. + vvii Use a vi-style command line editing interface. + This also affects the editing interface used for + rreeaadd --ee. + xxttrraaccee Same as --xx. + If --oo is supplied with no _o_p_t_i_o_n_-_n_a_m_e, the values of the + current options are printed. If ++oo is supplied with no + _o_p_t_i_o_n_-_n_a_m_e, a series of sseett commands to recreate the + current option settings is displayed on the standard + output. + --pp Turn on _p_r_i_v_i_l_e_g_e_d mode. In this mode, the $$EENNVV and + $$BBAASSHH__EENNVV files are not processed, shell functions are + not inherited from the environment, and the SSHHEELLLLOOPPTTSS, + BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they + appear in the environment, are ignored. If the shell is + started with the effective user (group) id not equal to + the real user (group) id, and the --pp option is not sup- + plied, these actions are taken and the effective user id + is set to the real user id. If the --pp option is sup- + plied at startup, the effective user id is not reset. + Turning this option off causes the effective user and + group ids to be set to the real user and group ids. + --tt Exit after reading and executing one command. + --uu Treat unset variables and parameters other than the spe- + cial parameters "@" and "*" as an error when performing + parameter expansion. If expansion is attempted on an + unset variable or parameter, the shell prints an error + message, and, if not interactive, exits with a non-zero + status. + --vv Print shell input lines as they are read. + --xx After expanding each _s_i_m_p_l_e _c_o_m_m_a_n_d, ffoorr command, ccaassee + command, sseelleecctt command, or arithmetic ffoorr command, dis- + play the expanded value of PPSS44, followed by the command + and its expanded arguments or associated word list. + --BB The shell performs brace expansion (see BBrraaccee EExxppaannssiioonn + above). This is on by default. + --CC If set, bbaasshh does not overwrite an existing file with + the >>, >>&&, and <<>> redirection operators. This may be + overridden when creating output files by using the redi- + rection operator >>|| instead of >>. + --EE If set, any trap on EERRRR is inherited by shell functions, + command substitutions, and commands executed in a sub- + shell environment. The EERRRR trap is normally not inher- + ited in such cases. + --HH Enable !! style history substitution. This option is on + by default when the shell is interactive. + --PP If set, the shell does not resolve symbolic links when + executing commands such as ccdd that change the current + working directory. It uses the physical directory + structure instead. By default, bbaasshh follows the logical + chain of directories when performing commands which + change the current directory. + --TT If set, any traps on DDEEBBUUGG and RREETTUURRNN are inherited by + shell functions, command substitutions, and commands + executed in a subshell environment. The DDEEBBUUGG and + RREETTUURRNN traps are normally not inherited in such cases. + ---- If no arguments follow this option, then the positional + parameters are unset. Otherwise, the positional parame- + ters are set to the _a_r_gs, even if some of them begin + with a --. + -- Signal the end of options, cause all remaining _a_r_gs to + be assigned to the positional parameters. The --xx and --vv + options are turned off. If there are no _a_r_gs, the posi- + tional parameters remain unchanged. + + The options are off by default unless otherwise noted. Using + + rather than - causes these options to be turned off. The + options can also be specified as arguments to an invocation of + the shell. The current set of options may be found in $$--. The + return status is always true unless an invalid option is encoun- + tered. + + sshhiifftt [_n] + The positional parameters from _n+1 ... are renamed to $$11 ........ + Parameters represented by the numbers $$## down to $$##-_n+1 are + unset. _n must be a non-negative number less than or equal to + $$##. If _n is 0, no parameters are changed. If _n is not given, + it is assumed to be 1. If _n is greater than $$##, the positional + parameters are not changed. The return status is greater than + zero if _n is greater than $$## or less than zero; otherwise 0. + + sshhoopptt [--ppqqssuu] [--oo] [_o_p_t_n_a_m_e ...] + Toggle the values of settings controlling optional shell behav- + ior. The settings can be either those listed below, or, if the + --oo option is used, those available with the --oo option to the sseett + builtin command. With no options, or with the --pp option, a list + of all settable options is displayed, with an indication of + whether or not each is set. The --pp option causes output to be + displayed in a form that may be reused as input. Other options + have the following meanings: + --ss Enable (set) each _o_p_t_n_a_m_e. + --uu Disable (unset) each _o_p_t_n_a_m_e. + --qq Suppresses normal output (quiet mode); the return status + indicates whether the _o_p_t_n_a_m_e is set or unset. If multi- + ple _o_p_t_n_a_m_e arguments are given with --qq, the return sta- + tus is zero if all _o_p_t_n_a_m_e_s are enabled; non-zero other- + wise. + --oo Restricts the values of _o_p_t_n_a_m_e to be those defined for + the --oo option to the sseett builtin. + + If either --ss or --uu is used with no _o_p_t_n_a_m_e arguments, sshhoopptt + shows only those options which are set or unset, respectively. + Unless otherwise noted, the sshhoopptt options are disabled (unset) + by default. + + The return status when listing options is zero if all _o_p_t_n_a_m_e_s + are enabled, non-zero otherwise. When setting or unsetting + options, the return status is zero unless an _o_p_t_n_a_m_e is not a + valid shell option. + + The list of sshhoopptt options is: + + aauuttooccdd If set, a command name that is the name of a directory + is executed as if it were the argument to the ccdd com- + mand. This option is only used by interactive shells. + ccddaabbllee__vvaarrss + If set, an argument to the ccdd builtin command that is + not a directory is assumed to be the name of a variable + whose value is the directory to change to. + ccddssppeellll If set, minor errors in the spelling of a directory com- + ponent in a ccdd command will be corrected. The errors + checked for are transposed characters, a missing charac- + ter, and one character too many. If a correction is + found, the corrected filename is printed, and the com- + mand proceeds. This option is only used by interactive + shells. + cchheecckkhhaasshh + If set, bbaasshh checks that a command found in the hash ta- + ble exists before trying to execute it. If a hashed + command no longer exists, a normal path search is per- + formed. + cchheecckkjjoobbss + If set, bbaasshh lists the status of any stopped and running + jobs before exiting an interactive shell. If any jobs + are running, this causes the exit to be deferred until a + second exit is attempted without an intervening command + (see JJOOBB CCOONNTTRROOLL above). The shell always postpones + exiting if any jobs are stopped. + cchheecckkwwiinnssiizzee + If set, bbaasshh checks the window size after each command + and, if necessary, updates the values of LLIINNEESS and CCOOLL-- + UUMMNNSS. + ccmmddhhiisstt If set, bbaasshh attempts to save all lines of a multiple- + line command in the same history entry. This allows + easy re-editing of multi-line commands. + ccoommppaatt3311 + If set, bbaasshh changes its behavior to that of version 3.1 + with respect to quoted arguments to the [[[[ conditional + command's ==~~ operator and locale-specific string compar- + ison when using the [[[[ conditional command's << and >> + operators. Bash versions prior to bash-4.1 use ASCII + collation and _s_t_r_c_m_p(3); bash-4.1 and later use the cur- + rent locale's collation sequence and _s_t_r_c_o_l_l(3). + ccoommppaatt3322 + If set, bbaasshh changes its behavior to that of version 3.2 + with respect to locale-specific string comparison when + using the [[[[ conditional command's << and >> operators + (see previous item). + ccoommppaatt4400 + If set, bbaasshh changes its behavior to that of version 4.0 + with respect to locale-specific string comparison when + using the [[[[ conditional command's << and >> operators + (see description of ccoommppaatt3311) and the effect of inter- + rupting a command list. Bash versions 4.0 and later + interrupt the list as if the shell received the inter- + rupt; previous versions continue with the next command + in the list. + ccoommppaatt4411 + If set, bbaasshh, when in _p_o_s_i_x mode, treats a single quote + in a double-quoted parameter expansion as a special + character. The single quotes must match (an even num- + ber) and the characters between the single quotes are + considered quoted. This is the behavior of posix mode + through version 4.1. The default bash behavior remains + as in previous versions. + ccoommppaatt4422 + If set, bbaasshh does not process the replacement string in + the pattern substitution word expansion using quote + removal. + ccoommpplleettee__ffuullllqquuoottee + If set, bbaasshh quotes all shell metacharacters in file- + names and directory names when performing completion. + If not set, bbaasshh removes metacharacters such as the dol- + lar sign from the set of characters that will be quoted + in completed filenames when these metacharacters appear + in shell variable references in words to be completed. + This means that dollar signs in variable names that + expand to directories will not be quoted; however, any + dollar signs appearing in filenames will not be quoted, + either. This is active only when bash is using back- + slashes to quote completed filenames. This variable is + set by default, which is the default bash behavior in + versions through 4.2. + ddiirreexxppaanndd + If set, bbaasshh replaces directory names with the results + of word expansion when performing filename completion. + This changes the contents of the readline editing + buffer. If not set, bbaasshh attempts to preserve what the + user typed. + ddiirrssppeellll + If set, bbaasshh attempts spelling correction on directory + names during word completion if the directory name ini- + tially supplied does not exist. + ddoottgglloobb If set, bbaasshh includes filenames beginning with a `.' in + the results of pathname expansion. + eexxeeccffaaiill + If set, a non-interactive shell will not exit if it can- + not execute the file specified as an argument to the + eexxeecc builtin command. An interactive shell does not + exit if eexxeecc fails. + eexxppaanndd__aalliiaasseess + If set, aliases are expanded as described above under + AALLIIAASSEESS. This option is enabled by default for interac- + tive shells. + eexxttddeebbuugg + If set, behavior intended for use by debuggers is + enabled: + 11.. The --FF option to the ddeeccllaarree builtin displays the + source file name and line number corresponding to + each function name supplied as an argument. + 22.. If the command run by the DDEEBBUUGG trap returns a + non-zero value, the next command is skipped and + not executed. + 33.. If the command run by the DDEEBBUUGG trap returns a + value of 2, and the shell is executing in a sub- + routine (a shell function or a shell script exe- + cuted by the .. or ssoouurrccee builtins), a call to + rreettuurrnn is simulated. + 44.. BBAASSHH__AARRGGCC and BBAASSHH__AARRGGVV are updated as described + in their descriptions above. + 55.. Function tracing is enabled: command substitu- + tion, shell functions, and subshells invoked with + (( _c_o_m_m_a_n_d )) inherit the DDEEBBUUGG and RREETTUURRNN traps. + 66.. Error tracing is enabled: command substitution, + shell functions, and subshells invoked with (( + _c_o_m_m_a_n_d )) inherit the EERRRR trap. + eexxttgglloobb If set, the extended pattern matching features described + above under PPaatthhnnaammee EExxppaannssiioonn are enabled. + eexxttqquuoottee + If set, $$'_s_t_r_i_n_g' and $$"_s_t_r_i_n_g" quoting is performed + within $${{_p_a_r_a_m_e_t_e_r}} expansions enclosed in double + quotes. This option is enabled by default. + ffaaiillgglloobb + If set, patterns which fail to match filenames during + pathname expansion result in an expansion error. + ffoorrccee__ffiiggnnoorree + If set, the suffixes specified by the FFIIGGNNOORREE shell + variable cause words to be ignored when performing word + completion even if the ignored words are the only possi- + ble completions. See SSHHEELLLL VVAARRIIAABBLLEESS above for a + description of FFIIGGNNOORREE. This option is enabled by + default. + gglloobbaasscciiiirraannggeess + If set, range expressions used in pattern matching + bracket expressions (see PPaatttteerrnn MMaattcchhiinngg above) behave + as if in the traditional C locale when performing com- + parisons. That is, the current locale's collating + sequence is not taken into account, so bb will not col- + late between AA and BB, and upper-case and lower-case + ASCII characters will collate together. + gglloobbssttaarr + If set, the pattern **** used in a pathname expansion con- + text will match all files and zero or more directories + and subdirectories. If the pattern is followed by a //, + only directories and subdirectories match. + ggnnuu__eerrrrffmmtt + If set, shell error messages are written in the standard + GNU error message format. + hhiissttaappppeenndd + If set, the history list is appended to the file named + by the value of the HHIISSTTFFIILLEE variable when the shell + exits, rather than overwriting the file. + hhiissttrreeeeddiitt + If set, and rreeaaddlliinnee is being used, a user is given the + opportunity to re-edit a failed history substitution. + hhiissttvveerriiffyy + If set, and rreeaaddlliinnee is being used, the results of his- + tory substitution are not immediately passed to the + shell parser. Instead, the resulting line is loaded + into the rreeaaddlliinnee editing buffer, allowing further modi- + fication. + hhoossttccoommpplleettee + If set, and rreeaaddlliinnee is being used, bbaasshh will attempt to + perform hostname completion when a word containing a @@ + is being completed (see CCoommpplleettiinngg under RREEAADDLLIINNEE + above). This is enabled by default. + hhuuppoonneexxiitt + If set, bbaasshh will send SSIIGGHHUUPP to all jobs when an inter- + active login shell exits. + iinntteerraaccttiivvee__ccoommmmeennttss + If set, allow a word beginning with ## to cause that word + and all remaining characters on that line to be ignored + in an interactive shell (see CCOOMMMMEENNTTSS above). This + option is enabled by default. + llaassttppiippee + If set, and job control is not active, the shell runs + the last command of a pipeline not executed in the back- + ground in the current shell environment. + lliitthhiisstt If set, and the ccmmddhhiisstt option is enabled, multi-line + commands are saved to the history with embedded newlines + rather than using semicolon separators where possible. + llooggiinn__sshheellll + The shell sets this option if it is started as a login + shell (see IINNVVOOCCAATTIIOONN above). The value may not be + changed. + mmaaiillwwaarrnn + If set, and a file that bbaasshh is checking for mail has + been accessed since the last time it was checked, the + message ``The mail in _m_a_i_l_f_i_l_e has been read'' is dis- + played. + nnoo__eemmppttyy__ccmmdd__ccoommpplleettiioonn + If set, and rreeaaddlliinnee is being used, bbaasshh will not + attempt to search the PPAATTHH for possible completions when + completion is attempted on an empty line. + nnooccaasseegglloobb + If set, bbaasshh matches filenames in a case-insensitive + fashion when performing pathname expansion (see PPaatthhnnaammee + EExxppaannssiioonn above). + nnooccaasseemmaattcchh + If set, bbaasshh matches patterns in a case-insensitive + fashion when performing matching while executing ccaassee or + [[[[ conditional commands. + nnuullllgglloobb + If set, bbaasshh allows patterns which match no files (see + PPaatthhnnaammee EExxppaannssiioonn above) to expand to a null string, + rather than themselves. + pprrooggccoommpp + If set, the programmable completion facilities (see PPrroo-- + ggrraammmmaabbllee CCoommpplleettiioonn above) are enabled. This option is + enabled by default. + pprroommppttvvaarrss + If set, prompt strings undergo parameter expansion, com- + mand substitution, arithmetic expansion, and quote + removal after being expanded as described in PPRROOMMPPTTIINNGG + above. This option is enabled by default. + rreessttrriicctteedd__sshheellll + The shell sets this option if it is started in + restricted mode (see RREESSTTRRIICCTTEEDD SSHHEELLLL below). The value + may not be changed. This is not reset when the startup + files are executed, allowing the startup files to dis- + cover whether or not a shell is restricted. + sshhiifftt__vveerrbboossee + If set, the sshhiifftt builtin prints an error message when + the shift count exceeds the number of positional parame- + ters. + ssoouurrcceeppaatthh + If set, the ssoouurrccee (..) builtin uses the value of PPAATTHH to + find the directory containing the file supplied as an + argument. This option is enabled by default. + xxppgg__eecchhoo + If set, the eecchhoo builtin expands backslash-escape + sequences by default. + + ssuussppeenndd [--ff] + Suspend the execution of this shell until it receives a SSIIGGCCOONNTT + signal. A login shell cannot be suspended; the --ff option can be + used to override this and force the suspension. The return sta- + tus is 0 unless the shell is a login shell and --ff is not sup- + plied, or if job control is not enabled. + + tteesstt _e_x_p_r + [[ _e_x_p_r ]] + Return a status of 0 (true) or 1 (false) depending on the evalu- + ation of the conditional expression _e_x_p_r. Each operator and op- + erand must be a separate argument. Expressions are composed of + the primaries described above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. + tteesstt does not accept any options, nor does it accept and ignore + an argument of ---- as signifying the end of options. + + Expressions may be combined using the following operators, + listed in decreasing order of precedence. The evaluation + depends on the number of arguments; see below. Operator prece- + dence is used when there are five or more arguments. + !! _e_x_p_r True if _e_x_p_r is false. + (( _e_x_p_r )) + Returns the value of _e_x_p_r. This may be used to override + the normal precedence of operators. + _e_x_p_r_1 -aa _e_x_p_r_2 + True if both _e_x_p_r_1 and _e_x_p_r_2 are true. + _e_x_p_r_1 -oo _e_x_p_r_2 + True if either _e_x_p_r_1 or _e_x_p_r_2 is true. + + tteesstt and [[ evaluate conditional expressions using a set of rules + based on the number of arguments. + + 0 arguments + The expression is false. + 1 argument + The expression is true if and only if the argument is not + null. + 2 arguments + If the first argument is !!, the expression is true if and + only if the second argument is null. If the first argu- + ment is one of the unary conditional operators listed + above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the expression is + true if the unary test is true. If the first argument is + not a valid unary conditional operator, the expression is + false. + 3 arguments + The following conditions are applied in the order listed. + If the second argument is one of the binary conditional + operators listed above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the + result of the expression is the result of the binary test + using the first and third arguments as operands. The --aa + and --oo operators are considered binary operators when + there are three arguments. If the first argument is !!, + the value is the negation of the two-argument test using + the second and third arguments. If the first argument is + exactly (( and the third argument is exactly )), the result + is the one-argument test of the second argument. Other- + wise, the expression is false. + 4 arguments + If the first argument is !!, the result is the negation of + the three-argument expression composed of the remaining + arguments. Otherwise, the expression is parsed and eval- + uated according to precedence using the rules listed + above. + 5 or more arguments + The expression is parsed and evaluated according to + precedence using the rules listed above. + + When used with tteesstt or [[, the << and >> operators sort lexico- + graphically using ASCII ordering. + + ttiimmeess Print the accumulated user and system times for the shell and + for processes run from the shell. The return status is 0. + + ttrraapp [--llpp] [[_a_r_g] _s_i_g_s_p_e_c ...] + The command _a_r_g is to be read and executed when the shell + receives signal(s) _s_i_g_s_p_e_c. If _a_r_g is absent (and there is a + single _s_i_g_s_p_e_c) or --, each specified signal is reset to its + original disposition (the value it had upon entrance to the + shell). If _a_r_g is the null string the signal specified by each + _s_i_g_s_p_e_c is ignored by the shell and by the commands it invokes. + If _a_r_g is not present and --pp has been supplied, then the trap + commands associated with each _s_i_g_s_p_e_c are displayed. If no + arguments are supplied or if only --pp is given, ttrraapp prints the + list of commands associated with each signal. The --ll option + causes the shell to print a list of signal names and their cor- + responding numbers. Each _s_i_g_s_p_e_c is either a signal name + defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names are + case insensitive and the SSIIGG prefix is optional. + + If a _s_i_g_s_p_e_c is EEXXIITT (0) the command _a_r_g is executed on exit + from the shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_r_g is exe- + cuted before every _s_i_m_p_l_e _c_o_m_m_a_n_d, _f_o_r command, _c_a_s_e command, + _s_e_l_e_c_t command, every arithmetic _f_o_r command, and before the + first command executes in a shell function (see SSHHEELLLL GGRRAAMMMMAARR + above). Refer to the description of the eexxttddeebbuugg option to the + sshhoopptt builtin for details of its effect on the DDEEBBUUGG trap. If a + _s_i_g_s_p_e_c is RREETTUURRNN, the command _a_r_g is executed each time a shell + function or a script executed with the .. or ssoouurrccee builtins fin- + ishes executing. + + If a _s_i_g_s_p_e_c is EERRRR, the command _a_r_g is executed whenever a a + pipeline (which may consist of a single simple command), a list, + or a compound command returns a non-zero exit status, subject to + the following conditions. The EERRRR trap is not executed if the + failed command is part of the command list immediately following + a wwhhiillee or uunnttiill keyword, part of the test in an _i_f statement, + part of a command executed in a &&&& or |||| list except the command + following the final &&&& or ||||, any command in a pipeline but the + last, or if the command's return value is being inverted using + !!. These are the same conditions obeyed by the eerrrreexxiitt (--ee) + option. + + Signals ignored upon entry to the shell cannot be trapped or + reset. Trapped signals that are not being ignored are reset to + their original values in a subshell or subshell environment when + one is created. The return status is false if any _s_i_g_s_p_e_c is + invalid; otherwise ttrraapp returns true. + + ttyyppee [--aaffttppPP] _n_a_m_e [_n_a_m_e ...] + With no options, indicate how each _n_a_m_e would be interpreted if + used as a command name. If the --tt option is used, ttyyppee prints a + string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or + _f_i_l_e if _n_a_m_e is an alias, shell reserved word, function, + builtin, or disk file, respectively. If the _n_a_m_e is not found, + then nothing is printed, and an exit status of false is + returned. If the --pp option is used, ttyyppee either returns the + name of the disk file that would be executed if _n_a_m_e were speci- + fied as a command name, or nothing if ``type -t name'' would not + return _f_i_l_e. The --PP option forces a PPAATTHH search for each _n_a_m_e, + even if ``type -t name'' would not return _f_i_l_e. If a command is + hashed, --pp and --PP print the hashed value, which is not necessar- + ily the file that appears first in PPAATTHH. If the --aa option is + used, ttyyppee prints all of the places that contain an executable + named _n_a_m_e. This includes aliases and functions, if and only if + the --pp option is not also used. The table of hashed commands is + not consulted when using --aa. The --ff option suppresses shell + function lookup, as with the ccoommmmaanndd builtin. ttyyppee returns true + if all of the arguments are found, false if any are not found. + + uulliimmiitt [--HHSSTTaabbccddeeffiillmmnnppqqrrssttuuvvxx [_l_i_m_i_t]] + Provides control over the resources available to the shell and + to processes started by it, on systems that allow such control. + The --HH and --SS options specify that the hard or soft limit is set + for the given resource. A hard limit cannot be increased by a + non-root user once it is set; a soft limit may be increased up + to the value of the hard limit. If neither --HH nor --SS is speci- + fied, both the soft and hard limits are set. The value of _l_i_m_i_t + can be a number in the unit specified for the resource or one of + the special values hhaarrdd, ssoofftt, or uunnlliimmiitteedd, which stand for the + current hard limit, the current soft limit, and no limit, + respectively. If _l_i_m_i_t is omitted, the current value of the + soft limit of the resource is printed, unless the --HH option is + given. When more than one resource is specified, the limit name + and unit are printed before the value. Other options are inter- + preted as follows: + --aa All current limits are reported + --bb The maximum socket buffer size + --cc The maximum size of core files created + --dd The maximum size of a process's data segment + --ee The maximum scheduling priority ("nice") + --ff The maximum size of files written by the shell and its + children + --ii The maximum number of pending signals + --ll The maximum size that may be locked into memory + --mm The maximum resident set size (many systems do not honor + this limit) + --nn The maximum number of open file descriptors (most systems + do not allow this value to be set) + --pp The pipe size in 512-byte blocks (this may not be set) + --qq The maximum number of bytes in POSIX message queues + --rr The maximum real-time scheduling priority + --ss The maximum stack size + --tt The maximum amount of cpu time in seconds + --uu The maximum number of processes available to a single + user + --vv The maximum amount of virtual memory available to the + shell and, on some systems, to its children + --xx The maximum number of file locks + --TT The maximum number of threads + + If _l_i_m_i_t is given, and the --aa option is not used, _l_i_m_i_t is the + new value of the specified resource. If no option is given, + then --ff is assumed. Values are in 1024-byte increments, except + for --tt, which is in seconds; --pp, which is in units of 512-byte + blocks; and --TT, --bb, --nn, and --uu, which are unscaled values. The + return status is 0 unless an invalid option or argument is sup- + plied, or an error occurs while setting a new limit. + + uummaasskk [--pp] [--SS] [_m_o_d_e] + The user file-creation mask is set to _m_o_d_e. If _m_o_d_e begins with + a digit, it is interpreted as an octal number; otherwise it is + interpreted as a symbolic mode mask similar to that accepted by + _c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is + printed. The --SS option causes the mask to be printed in sym- + bolic form; the default output is an octal number. If the --pp + option is supplied, and _m_o_d_e is omitted, the output is in a form + that may be reused as input. The return status is 0 if the mode + was successfully changed or if no _m_o_d_e argument was supplied, + and false otherwise. + + uunnaalliiaass [-aa] [_n_a_m_e ...] + Remove each _n_a_m_e from the list of defined aliases. If --aa is + supplied, all alias definitions are removed. The return value + is true unless a supplied _n_a_m_e is not a defined alias. + + uunnsseett [-ffvv] [-nn] [_n_a_m_e ...] + For each _n_a_m_e, remove the corresponding variable or function. + If the --vv option is given, each _n_a_m_e refers to a shell variable, + and that variable is removed. Read-only variables may not be + unset. If --ff is specified, each _n_a_m_e refers to a shell func- + tion, and the function definition is removed. If the --nn option + is supplied, and _n_a_m_e is a variable with the _n_a_m_e_r_e_f attribute, + _n_a_m_e will be unset rather than the variable it references. --nn + has no effect if the --ff option is supplied. If no options are + supplied, each _n_a_m_e refers to a variable; if there is no vari- + able by that name, any function with that name is unset. Each + unset variable or function is removed from the environment + passed to subsequent commands. If any of CCOOMMPP__WWOORRDDBBRREEAAKKSS, RRAANN-- + DDOOMM, SSEECCOONNDDSS, LLIINNEENNOO, HHIISSTTCCMMDD, FFUUNNCCNNAAMMEE, GGRROOUUPPSS, or DDIIRRSSTTAACCKK are + unset, they lose their special properties, even if they are sub- + sequently reset. The exit status is true unless a _n_a_m_e is read- + only. + + wwaaiitt [--nn] [_n _._._.] + Wait for each specified child process and return its termination + status. Each _n may be a process ID or a job specification; if a + job spec is given, all processes in that job's pipeline are + waited for. If _n is not given, all currently active child pro- + cesses are waited for, and the return status is zero. If the --nn + option is supplied, wwaaiitt waits for any job to terminate and + returns its exit status. If _n specifies a non-existent process + or job, the return status is 127. Otherwise, the return status + is the exit status of the last process or job waited for. + +RREESSTTRRIICCTTEEDD SSHHEELLLL + If bbaasshh is started with the name rrbbaasshh, or the --rr option is supplied at + invocation, the shell becomes restricted. A restricted shell is used + to set up an environment more controlled than the standard shell. It + behaves identically to bbaasshh with the exception that the following are + disallowed or not performed: + + +o changing directories with ccdd + + +o setting or unsetting the values of SSHHEELLLL, PPAATTHH, EENNVV, or BBAASSHH__EENNVV + + +o specifying command names containing // + + +o specifying a filename containing a // as an argument to the .. + builtin command + + +o specifying a filename containing a slash as an argument to the + --pp option to the hhaasshh builtin command + + +o importing function definitions from the shell environment at + startup + + +o parsing the value of SSHHEELLLLOOPPTTSS from the shell environment at + startup + + +o redirecting output using the >, >|, <>, >&, &>, and >> redirect- + ion operators + + +o using the eexxeecc builtin command to replace the shell with another + command + + +o adding or deleting builtin commands with the --ff and --dd options + to the eennaabbllee builtin command + + +o using the eennaabbllee builtin command to enable disabled shell + builtins + + +o specifying the --pp option to the ccoommmmaanndd builtin command + + +o turning off restricted mode with sseett ++rr or sseett ++oo rreessttrriicctteedd. + + These restrictions are enforced after any startup files are read. + + When a command that is found to be a shell script is executed (see CCOOMM-- + MMAANNDD EEXXEECCUUTTIIOONN above), rrbbaasshh turns off any restrictions in the shell + spawned to execute the script. + +SSEEEE AALLSSOO + _B_a_s_h _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, Brian Fox and Chet Ramey + _T_h_e _G_n_u _R_e_a_d_l_i_n_e _L_i_b_r_a_r_y, Brian Fox and Chet Ramey + _T_h_e _G_n_u _H_i_s_t_o_r_y _L_i_b_r_a_r_y, Brian Fox and Chet Ramey + _P_o_r_t_a_b_l_e _O_p_e_r_a_t_i_n_g _S_y_s_t_e_m _I_n_t_e_r_f_a_c_e _(_P_O_S_I_X_) _P_a_r_t _2_: _S_h_e_l_l _a_n_d _U_t_i_l_i_- + _t_i_e_s, IEEE -- + http://pubs.opengroup.org/onlinepubs/9699919799/ + http://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode + _s_h(1), _k_s_h(1), _c_s_h(1) + _e_m_a_c_s(1), _v_i(1) + _r_e_a_d_l_i_n_e(3) + +FFIILLEESS + _/_b_i_n_/_b_a_s_h + The bbaasshh executable + _/_e_t_c_/_p_r_o_f_i_l_e + The systemwide initialization file, executed for login shells + _~_/_._b_a_s_h___p_r_o_f_i_l_e + The personal initialization file, executed for login shells + _~_/_._b_a_s_h_r_c + The individual per-interactive-shell startup file + _~_/_._b_a_s_h___l_o_g_o_u_t + The individual login shell cleanup file, executed when a login + shell exits + _~_/_._i_n_p_u_t_r_c + Individual _r_e_a_d_l_i_n_e initialization file + +AAUUTTHHOORRSS + Brian Fox, Free Software Foundation + bfox@gnu.org + + Chet Ramey, Case Western Reserve University + chet.ramey@case.edu + +BBUUGG RREEPPOORRTTSS + If you find a bug in bbaasshh,, you should report it. But first, you should + make sure that it really is a bug, and that it appears in the latest + version of bbaasshh. The latest version is always available from + _f_t_p_:_/_/_f_t_p_._g_n_u_._o_r_g_/_p_u_b_/_g_n_u_/_b_a_s_h_/. + + Once you have determined that a bug actually exists, use the _b_a_s_h_b_u_g + command to submit a bug report. If you have a fix, you are encouraged + to mail that as well! Suggestions and `philosophical' bug reports may + be mailed to _b_u_g_-_b_a_s_h_@_g_n_u_._o_r_g or posted to the Usenet newsgroup + ggnnuu..bbaasshh..bbuugg. + + ALL bug reports should include: + + The version number of bbaasshh + The hardware and operating system + The compiler used to compile + A description of the bug behaviour + A short script or `recipe' which exercises the bug + + _b_a_s_h_b_u_g inserts the first three items automatically into the template + it provides for filing a bug report. + + Comments and bug reports concerning this manual page should be directed + to _c_h_e_t_._r_a_m_e_y_@_c_a_s_e_._e_d_u. + +BBUUGGSS + It's too big and too slow. + + There are some subtle differences between bbaasshh and traditional versions + of sshh, mostly because of the PPOOSSIIXX specification. + + Aliases are confusing in some uses. + + Shell builtin commands and functions are not stoppable/restartable. + + Compound commands and command sequences of the form `a ; b ; c' are not + handled gracefully when process suspension is attempted. When a + process is stopped, the shell immediately executes the next command in + the sequence. It suffices to place the sequence of commands between + parentheses to force it into a subshell, which may be stopped as a + unit. + + Array variables may not (yet) be exported. + + There may be only one active coprocess at a time. + + + +GNU Bash 4.3 2014 February 2 BASH(1) diff --git a/doc/bash.1 b/doc/bash.1 new file mode 100644 index 0000000..2b1ca15 --- /dev/null +++ b/doc/bash.1 @@ -0,0 +1,10361 @@ +.\" +.\" MAN PAGE COMMENTS to +.\" +.\" Chet Ramey +.\" Case Western Reserve University +.\" chet.ramey@case.edu +.\" +.\" Last Change: Sun Feb 2 16:21:40 EST 2014 +.\" +.\" bash_builtins, strip all but Built-Ins section +.if \n(zZ=1 .ig zZ +.if \n(zY=1 .ig zY +.TH BASH 1 "2014 February 2" "GNU Bash 4.3" +.\" +.\" There's some problem with having a `@' +.\" in a tagged paragraph with the BSD man macros. +.\" It has to do with `@' appearing in the }1 macro. +.\" This is a problem on 4.3 BSD and Ultrix, but Sun +.\" appears to have fixed it. +.\" If you're seeing the characters +.\" `@u-3p' appearing before the lines reading +.\" `possible-hostname-completions +.\" and `complete-hostname' down in READLINE, +.\" then uncomment this redefinition. +.\" +.de }1 +.ds ]X \&\\*(]B\\ +.nr )E 0 +.if !"\\$1"" .nr )I \\$1n +.}f +.ll \\n(LLu +.in \\n()Ru+\\n(INu+\\n()Iu +.ti \\n(INu +.ie !\\n()Iu+\\n()Ru-\w\\*(]Xu-3p \{\\*(]X +.br\} +.el \\*(]X\h|\\n()Iu+\\n()Ru\c +.}f +.. +.\" +.\" File Name macro. This used to be `.PN', for Path Name, +.\" but Sun doesn't seem to like that very much. +.\" +.de FN +\fI\|\\$1\|\fP +.. +.SH NAME +bash \- GNU Bourne-Again SHell +.SH SYNOPSIS +.B bash +[options] +[command_string | file] +.SH COPYRIGHT +.if n Bash is Copyright (C) 1989-2013 by the Free Software Foundation, Inc. +.if t Bash is Copyright \(co 1989-2013 by the Free Software Foundation, Inc. +.SH DESCRIPTION +.B Bash +is an \fBsh\fR-compatible command language interpreter that +executes commands read from the standard input or from a file. +.B Bash +also incorporates useful features from the \fIKorn\fP and \fIC\fP +shells (\fBksh\fP and \fBcsh\fP). +.PP +.B Bash +is intended to be a conformant implementation of the +Shell and Utilities portion of the IEEE POSIX specification +(IEEE Standard 1003.1). +.B Bash +can be configured to be POSIX-conformant by default. +.SH OPTIONS +All of the single-character shell options documented in the +description of the \fBset\fR builtin command can be used as options +when the shell is invoked. +In addition, \fBbash\fR +interprets the following options when it is invoked: +.PP +.PD 0 +.TP 10 +.B \-c +If the +.B \-c +option is present, then commands are read from the first non-option argument +.IR command_string . +If there are arguments after the +.IR command_string , +they are assigned to the positional parameters, starting with +.BR $0 . +.TP +.B \-i +If the +.B \-i +option is present, the shell is +.IR interactive . +.TP +.B \-l +Make +.B bash +act as if it had been invoked as a login shell (see +.SM +.B INVOCATION +below). +.TP +.B \-r +If the +.B \-r +option is present, the shell becomes +.I restricted +(see +.SM +.B "RESTRICTED SHELL" +below). +.TP +.B \-s +If the +.B \-s +option is present, or if no arguments remain after option +processing, then commands are read from the standard input. +This option allows the positional parameters to be set +when invoking an interactive shell. +.TP +.B \-D +A list of all double-quoted strings preceded by \fB$\fP +is printed on the standard output. +These are the strings that +are subject to language translation when the current locale +is not \fBC\fP or \fBPOSIX\fP. +This implies the \fB\-n\fP option; no commands will be executed. +.TP +.B [\-+]O [\fIshopt_option\fP] +\fIshopt_option\fP is one of the shell options accepted by the +\fBshopt\fP builtin (see +.SM +.B SHELL BUILTIN COMMANDS +below). +If \fIshopt_option\fP is present, \fB\-O\fP sets the value of that option; +\fB+O\fP unsets it. +If \fIshopt_option\fP is not supplied, the names and values of the shell +options accepted by \fBshopt\fP are printed on the standard output. +If the invocation option is \fB+O\fP, the output is displayed in a format +that may be reused as input. +.TP +.B \-\- +A +.B \-\- +signals the end of options and disables further option processing. +Any arguments after the +.B \-\- +are treated as filenames and arguments. An argument of +.B \- +is equivalent to \fB\-\-\fP. +.PD +.PP +.B Bash +also interprets a number of multi-character options. +These options must appear on the command line before the +single-character options to be recognized. +.PP +.PD 0 +.TP +.B \-\-debugger +Arrange for the debugger profile to be executed before the shell +starts. +Turns on extended debugging mode (see the description of the +.B extdebug +option to the +.B shopt +builtin below). +.TP +.B \-\-dump\-po\-strings +Equivalent to \fB\-D\fP, but the output is in the GNU \fIgettext\fP +\fBpo\fP (portable object) file format. +.TP +.B \-\-dump\-strings +Equivalent to \fB\-D\fP. +.TP +.B \-\-help +Display a usage message on standard output and exit successfully. +.TP +\fB\-\-init\-file\fP \fIfile\fP +.PD 0 +.TP +\fB\-\-rcfile\fP \fIfile\fP +.PD +Execute commands from +.I file +instead of the system wide initialization file +.I /etc/bash.bashrc +and the standard personal initialization file +.I ~/.bashrc +if the shell is interactive (see +.SM +.B INVOCATION +below). +.TP +.B \-\-login +Equivalent to \fB\-l\fP. +.TP +.B \-\-noediting +Do not use the GNU +.B readline +library to read command lines when the shell is interactive. +.TP +.B \-\-noprofile +Do not read either the system-wide startup file +.FN /etc/profile +or any of the personal initialization files +.IR ~/.bash_profile , +.IR ~/.bash_login , +or +.IR ~/.profile . +By default, +.B bash +reads these files when it is invoked as a login shell (see +.SM +.B INVOCATION +below). +.TP +.B \-\-norc +Do not read and execute the system wide initialization file +.I /etc/bash.bashrc +and the personal initialization file +.I ~/.bashrc +if the shell is interactive. +This option is on by default if the shell is invoked as +.BR sh . +.TP +.B \-\-posix +Change the behavior of \fBbash\fP where the default operation differs +from the POSIX standard to match the standard (\fIposix mode\fP). +See +.SM +.B "SEE ALSO" +below for a reference to a document that details how posix mode affects +bash's behavior. +.TP +.B \-\-restricted +The shell becomes restricted (see +.SM +.B "RESTRICTED SHELL" +below). +.TP +.B \-\-verbose +Equivalent to \fB\-v\fP. +.TP +.B \-\-version +Show version information for this instance of +.B bash +on the standard output and exit successfully. +.PD +.SH ARGUMENTS +If arguments remain after option processing, and neither the +.B \-c +nor the +.B \-s +option has been supplied, the first argument is assumed to +be the name of a file containing shell commands. +If +.B bash +is invoked in this fashion, +.B $0 +is set to the name of the file, and the positional parameters +are set to the remaining arguments. +.B Bash +reads and executes commands from this file, then exits. +\fBBash\fP's exit status is the exit status of the last command +executed in the script. +If no commands are executed, the exit status is 0. +An attempt is first made to open the file in the current directory, and, +if no file is found, then the shell searches the directories in +.SM +.B PATH +for the script. +.SH INVOCATION +A \fIlogin shell\fP is one whose first character of argument zero is a +.BR \- , +or one started with the +.B \-\-login +option. +.PP +An \fIinteractive\fP shell is one started without non-option arguments +and without the +.B \-c +option +whose standard input and error are +both connected to terminals (as determined by +.IR isatty (3)), +or one started with the +.B \-i +option. +.SM +.B PS1 +is set and +.B $\- +includes +.B i +if +.B bash +is interactive, +allowing a shell script or a startup file to test this state. +.PP +The following paragraphs describe how +.B bash +executes its startup files. +If any of the files exist but cannot be read, +.B bash +reports an error. +Tildes are expanded in filenames as described below under +.B "Tilde Expansion" +in the +.SM +.B EXPANSION +section. +.PP +When +.B bash +is invoked as an interactive login shell, or as a non-interactive shell +with the \fB\-\-login\fP option, it first reads and +executes commands from the file \fI/etc/profile\fP, if that +file exists. +After reading that file, it looks for \fI~/.bash_profile\fP, +\fI~/.bash_login\fP, and \fI~/.profile\fP, in that order, and reads +and executes commands from the first one that exists and is readable. +The +.B \-\-noprofile +option may be used when the shell is started to inhibit this behavior. +.PP +When a login shell exits, +.B bash +reads and executes commands from the file \fI~/.bash_logout\fP, if it +exists. +.PP +When an interactive shell that is not a login shell is started, +.B bash +reads and executes commands from \fI/etc/bash.bashrc\fP and \fI~/.bashrc\fP, +if these files exist. +This may be inhibited by using the +.B \-\-norc +option. +The \fB\-\-rcfile\fP \fIfile\fP option will force +.B bash +to read and execute commands from \fIfile\fP instead of +\fI/etc/bash.bashrc\fP and \fI~/.bashrc\fP. +.PP +When +.B bash +is started non-interactively, to run a shell script, for example, it +looks for the variable +.SM +.B BASH_ENV +in the environment, expands its value if it appears there, and uses the +expanded value as the name of a file to read and execute. +.B Bash +behaves as if the following command were executed: +.sp .5 +.RS +.if t \f(CWif [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi\fP +.if n if [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi +.RE +.sp .5 +but the value of the +.SM +.B PATH +variable is not used to search for the filename. +.PP +If +.B bash +is invoked with the name +.BR sh , +it tries to mimic the startup behavior of historical versions of +.B sh +as closely as possible, +while conforming to the POSIX standard as well. +When invoked as an interactive login shell, or a non-interactive +shell with the \fB\-\-login\fP option, it first attempts to +read and execute commands from +.I /etc/profile +and +.IR ~/.profile , +in that order. +The +.B \-\-noprofile +option may be used to inhibit this behavior. +When invoked as an interactive shell with the name +.BR sh , +.B bash +looks for the variable +.SM +.BR ENV , +expands its value if it is defined, and uses the +expanded value as the name of a file to read and execute. +Since a shell invoked as +.B sh +does not attempt to read and execute commands from any other startup +files, the +.B \-\-rcfile +option has no effect. +A non-interactive shell invoked with the name +.B sh +does not attempt to read any other startup files. +When invoked as +.BR sh , +.B bash +enters +.I posix +mode after the startup files are read. +.PP +When +.B bash +is started in +.I posix +mode, as with the +.B \-\-posix +command line option, it follows the POSIX standard for startup files. +In this mode, interactive shells expand the +.SM +.B ENV +variable and commands are read and executed from the file +whose name is the expanded value. +No other startup files are read. +.PP +.B Bash +attempts to determine when it is being run with its standard input +connected to a network connection, as when executed by the remote shell +daemon, usually \fIrshd\fP, or the secure shell daemon \fIsshd\fP. +If +.B bash +determines it is being run in this fashion, it reads and executes +commands from \fI~/.bashrc\fP and \fI~/.bashrc\fP, if these files +exist and are readable. +It will not do this if invoked as \fBsh\fP. +The +.B \-\-norc +option may be used to inhibit this behavior, and the +.B \-\-rcfile +option may be used to force another file to be read, but neither +\fIrshd\fP nor \fIsshd\fP generally invoke the shell with those options +or allow them to be specified. +.PP +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the \fB\-p\fP option is not supplied, no startup +files are read, shell functions are not inherited from the environment, the +.SM +.BR SHELLOPTS , +.SM +.BR BASHOPTS , +.SM +.BR CDPATH , +and +.SM +.B GLOBIGNORE +variables, if they appear in the environment, are ignored, +and the effective user id is set to the real user id. +If the \fB\-p\fP option is supplied at invocation, the startup behavior is +the same, but the effective user id is not reset. +.SH DEFINITIONS +.PP +The following definitions are used throughout the rest of this +document. +.PD 0 +.TP +.B blank +A space or tab. +.TP +.B word +A sequence of characters considered as a single unit by the shell. +Also known as a +.BR token . +.TP +.B name +A +.I word +consisting only of alphanumeric characters and underscores, and +beginning with an alphabetic character or an underscore. Also +referred to as an +.BR identifier . +.TP +.B metacharacter +A character that, when unquoted, separates words. One of the following: +.br +.RS +.PP +.if t \fB| & ; ( ) < > space tab\fP +.if n \fB| & ; ( ) < > space tab\fP +.RE +.PP +.TP +.B control operator +A \fItoken\fP that performs a control function. It is one of the following +symbols: +.RS +.PP +.if t \fB|| & && ; ;; ( ) | |& \fP +.if n \fB|| & && ; ;; ( ) | |& \fP +.RE +.PD +.SH "RESERVED WORDS" +\fIReserved words\fP are words that have a special meaning to the shell. +The following words are recognized as reserved when unquoted and either +the first word of a simple command (see +.SM +.B SHELL GRAMMAR +below) or the third word of a +.B case +or +.B for +command: +.if t .RS +.PP +.B +.if n ! case coproc do done elif else esac fi for function if in select then until while { } time [[ ]] +.if t ! case coproc do done elif else esac fi for function if in select then until while { } time [[ ]] +.if t .RE +.SH "SHELL GRAMMAR" +.SS Simple Commands +.PP +A \fIsimple command\fP is a sequence of optional variable assignments +followed by \fBblank\fP-separated words and redirections, and +terminated by a \fIcontrol operator\fP. The first word +specifies the command to be executed, and is passed as argument zero. +The remaining words are passed as arguments to the invoked command. +.PP +The return value of a \fIsimple command\fP is its exit status, or +128+\fIn\^\fP if the command is terminated by signal +.IR n . +.SS Pipelines +.PP +A \fIpipeline\fP is a sequence of one or more commands separated by +one of the control operators +.B | +or \fB|&\fP. +The format for a pipeline is: +.RS +.PP +[\fBtime\fP [\fB\-p\fP]] [ ! ] \fIcommand\fP [ [\fB|\fP\(bv\fB|&\fP] \fIcommand2\fP ... ] +.RE +.PP +The standard output of +.I command +is connected via a pipe to the standard input of +.IR command2 . +This connection is performed before any redirections specified by the +command (see +.SM +.B REDIRECTION +below). +If \fB|&\fP is used, \fIcommand\fP's standard error, in addition to its +standard output, is connected to +\fIcommand2\fP's standard input through the pipe; +it is shorthand for \fB2>&1 |\fP. +This implicit redirection of the standard error to the standard output is +performed after any redirections specified by the command. +.PP +The return status of a pipeline is the exit status of the last +command, unless the \fBpipefail\fP option is enabled. +If \fBpipefail\fP is enabled, the pipeline's return status is the +value of the last (rightmost) command to exit with a non-zero status, +or zero if all commands exit successfully. +If the reserved word +.B ! +precedes a pipeline, the exit status of that pipeline is the logical +negation of the exit status as described above. +The shell waits for all commands in the pipeline to +terminate before returning a value. +.PP +If the +.B time +reserved word precedes a pipeline, the elapsed as well as user and +system time consumed by its execution are reported when the pipeline +terminates. +The \fB\-p\fP option changes the output format to that specified by POSIX. +When the shell is in \fIposix mode\fP, it does not recognize +\fBtime\fP as a reserved word if the next token begins with a `-'. +The +.SM +.B TIMEFORMAT +variable may be set to a format string that specifies how the timing +information should be displayed; see the description of +.SM +.B TIMEFORMAT +under +.B "Shell Variables" +below. +.PP +When the shell is in \fIposix mode\fP, \fBtime\fP +may be followed by a newline. In this case, the shell displays the +total user and system time consumed by the shell and its children. +The +.SM +.B TIMEFORMAT +variable may be used to specify the format of +the time information. +.PP +Each command in a pipeline is executed as a separate process (i.e., in a +subshell). +.SS Lists +.PP +A \fIlist\fP is a sequence of one or more pipelines separated by one +of the operators +.BR ; , +.BR & , +.BR && , +or +.BR || , +and optionally terminated by one of +.BR ; , +.BR & , +or +.BR . +.PP +Of these list operators, +.B && +and +.B || +have equal precedence, followed by +.B ; +and +.BR & , +which have equal precedence. +.PP +A sequence of one or more newlines may appear in a \fIlist\fP instead +of a semicolon to delimit commands. +.PP +If a command is terminated by the control operator +.BR & , +the shell executes the command in the \fIbackground\fP +in a subshell. The shell does not wait for the command to +finish, and the return status is 0. Commands separated by a +.B ; +are executed sequentially; the shell waits for each +command to terminate in turn. The return status is the +exit status of the last command executed. +.PP +AND and OR lists are sequences of one of more pipelines separated by the +\fB&&\fP and \fB||\fP control operators, respectively. +AND and OR lists are executed with left associativity. +An AND list has the form +.RS +.PP +\fIcommand1\fP \fB&&\fP \fIcommand2\fP +.RE +.PP +.I command2 +is executed if, and only if, +.I command1 +returns an exit status of zero. +.PP +An OR list has the form +.RS +.PP +\fIcommand1\fP \fB||\fP \fIcommand2\fP +.PP +.RE +.PP +.I command2 +is executed if and only if +.I command1 +returns a non-zero exit status. +The return status of +AND and OR lists is the exit status of the last command +executed in the list. +.SS Compound Commands +.PP +A \fIcompound command\fP is one of the following. +In most cases a \fIlist\fP in a command's description may be separated from +the rest of the command by one or more newlines, and may be followed by a +newline in place of a semicolon. +.TP +(\fIlist\fP) +\fIlist\fP is executed in a subshell environment (see +.SM +\fBCOMMAND EXECUTION ENVIRONMENT\fP +below). +Variable assignments and builtin +commands that affect the shell's environment do not remain in effect +after the command completes. The return status is the exit status of +\fIlist\fP. +.TP +{ \fIlist\fP; } +\fIlist\fP is simply executed in the current shell environment. +\fIlist\fP must be terminated with a newline or semicolon. +This is known as a \fIgroup command\fP. +The return status is the exit status of +\fIlist\fP. +Note that unlike the metacharacters \fB(\fP and \fB)\fP, \fB{\fP and +\fB}\fP are \fIreserved words\fP and must occur where a reserved +word is permitted to be recognized. Since they do not cause a word +break, they must be separated from \fIlist\fP by whitespace or another +shell metacharacter. +.TP +((\fIexpression\fP)) +The \fIexpression\fP is evaluated according to the rules described +below under +.SM +.BR "ARITHMETIC EVALUATION" . +If the value of the expression is non-zero, the return status is 0; +otherwise the return status is 1. This is exactly equivalent to +\fBlet "\fIexpression\fP"\fR. +.TP +\fB[[\fP \fIexpression\fP \fB]]\fP +Return a status of 0 or 1 depending on the evaluation of +the conditional expression \fIexpression\fP. +Expressions are composed of the primaries described below under +.SM +.BR "CONDITIONAL EXPRESSIONS" . +Word splitting and pathname expansion are not performed on the words +between the \fB[[\fP and \fB]]\fP; tilde expansion, +parameter and variable expansion, +arithmetic expansion, command substitution, process +substitution, and quote removal are performed. +Conditional operators such as \fB\-f\fP must be unquoted to be recognized +as primaries. +.if t .sp 0.5 +.if n .sp 1 +When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort +lexicographically using the current locale. +.PP +See the description of the \fItest\fP builtin command (section SHELL +BUILTIN COMMANDS below) for the handling of parameters (i.e. +missing parameters). +.if t .sp 0.5 +.if n .sp 1 +When the \fB==\fP and \fB!=\fP operators are used, the string to the +right of the operator is considered a pattern and matched according +to the rules described below under \fBPattern Matching\fP, +as if the \fBextglob\fP shell option were enabled. +The \fB=\fP operator is equivalent to \fB==\fP. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +The return value is 0 if the string matches (\fB==\fP) or does not match +(\fB!=\fP) the pattern, and 1 otherwise. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +.if t .sp 0.5 +.if n .sp 1 +An additional binary operator, \fB=~\fP, is available, with the same +precedence as \fB==\fP and \fB!=\fP. +When it is used, the string to the right of the operator is considered +an extended regular expression and matched accordingly (as in \fIregex\fP(3)). +The return value is 0 if the string matches +the pattern, and 1 otherwise. +If the regular expression is syntactically incorrect, the conditional +expression's return value is 2. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +Bracket expressions in regular expressions must be treated carefully, +since normal quoting characters lose their meanings between brackets. +If the pattern is stored in a shell variable, quoting the variable +expansion forces the entire pattern to be matched as a string. +Substrings matched by parenthesized subexpressions within the regular +expression are saved in the array variable +.SM +.BR BASH_REMATCH . +The element of +.SM +.B BASH_REMATCH +with index 0 is the portion of the string +matching the entire regular expression. +The element of +.SM +.B BASH_REMATCH +with index \fIn\fP is the portion of the +string matching the \fIn\fPth parenthesized subexpression. +.if t .sp 0.5 +.if n .sp 1 +Expressions may be combined using the following operators, listed +in decreasing order of precedence: +.if t .sp 0.5 +.if n .sp 1 +.RS +.PD 0 +.TP +.B ( \fIexpression\fP ) +Returns the value of \fIexpression\fP. +This may be used to override the normal precedence of operators. +.TP +.B ! \fIexpression\fP +True if +.I expression +is false. +.TP +\fIexpression1\fP \fB&&\fP \fIexpression2\fP +True if both +.I expression1 +and +.I expression2 +are true. +.TP +\fIexpression1\fP \fB||\fP \fIexpression2\fP +True if either +.I expression1 +or +.I expression2 +is true. +.PD +.LP +The \fB&&\fP and \fB||\fP +operators do not evaluate \fIexpression2\fP if the value of +\fIexpression1\fP is sufficient to determine the return value of +the entire conditional expression. +.RE +.TP +\fBfor\fP \fIname\fP [ [ \fBin\fP [ \fIword ...\fP ] ] ; ] \fBdo\fP \fIlist\fP ; \fBdone\fP +The list of words following \fBin\fP is expanded, generating a list +of items. +The variable \fIname\fP is set to each element of this list +in turn, and \fIlist\fP is executed each time. +If the \fBin\fP \fIword\fP is omitted, the \fBfor\fP command executes +\fIlist\fP once for each positional parameter that is set (see +.SM +.B PARAMETERS +below). +The return status is the exit status of the last command that executes. +If the expansion of the items following \fBin\fP results in an empty +list, no commands are executed, and the return status is 0. +.TP +\fBfor\fP (( \fIexpr1\fP ; \fIexpr2\fP ; \fIexpr3\fP )) ; \fBdo\fP \fIlist\fP ; \fBdone\fP +First, the arithmetic expression \fIexpr1\fP is evaluated according +to the rules described below under +.SM +.BR "ARITHMETIC EVALUATION" . +The arithmetic expression \fIexpr2\fP is then evaluated repeatedly +until it evaluates to zero. +Each time \fIexpr2\fP evaluates to a non-zero value, \fIlist\fP is +executed and the arithmetic expression \fIexpr3\fP is evaluated. +If any expression is omitted, it behaves as if it evaluates to 1. +The return value is the exit status of the last command in \fIlist\fP +that is executed, or false if any of the expressions is invalid. +.TP +\fBselect\fP \fIname\fP [ \fBin\fP \fIword\fP ] ; \fBdo\fP \fIlist\fP ; \fBdone\fP +The list of words following \fBin\fP is expanded, generating a list +of items. The set of expanded words is printed on the standard +error, each preceded by a number. If the \fBin\fP +\fIword\fP is omitted, the positional parameters are printed (see +.SM +.B PARAMETERS +below). The +.SM +.B PS3 +prompt is then displayed and a line read from the standard input. +If the line consists of a number corresponding to one of +the displayed words, then the value of +.I name +is set to that word. If the line is empty, the words and prompt +are displayed again. If EOF is read, the command completes. Any +other value read causes +.I name +to be set to null. The line read is saved in the variable +.SM +.BR REPLY . +The +.I list +is executed after each selection until a +.B break +command is executed. +The exit status of +.B select +is the exit status of the last command executed in +.IR list , +or zero if no commands were executed. +.TP +\fBcase\fP \fIword\fP \fBin\fP [ [(] \fIpattern\fP [ \fB|\fP \fIpattern\fP ] \ +... ) \fIlist\fP ;; ] ... \fBesac\fP +A \fBcase\fP command first expands \fIword\fP, and tries to match +it against each \fIpattern\fP in turn, using the same matching rules +as for pathname expansion (see +.B Pathname Expansion +below). +The \fIword\fP is expanded using tilde +expansion, parameter and variable expansion, arithmetic substitution, +command substitution, process substitution and quote removal. +Each \fIpattern\fP examined is expanded using tilde +expansion, parameter and variable expansion, arithmetic substitution, +command substitution, and process substitution. +If the shell option +.B nocasematch +is enabled, the match is performed without regard to the case +of alphabetic characters. +When a match is found, the corresponding \fIlist\fP is executed. +If the \fB;;\fP operator is used, no subsequent matches are attempted after +the first pattern match. +Using \fB;&\fP in place of \fB;;\fP causes execution to continue with +the \fIlist\fP associated with the next set of patterns. +Using \fB;;&\fP in place of \fB;;\fP causes the shell to test the next +pattern list in the statement, if any, and execute any associated \fIlist\fP +on a successful match. +The exit status is zero if no +pattern matches. Otherwise, it is the exit status of the +last command executed in \fIlist\fP. +.TP +\fBif\fP \fIlist\fP; \fBthen\fP \fIlist\fP; \ +[ \fBelif\fP \fIlist\fP; \fBthen\fP \fIlist\fP; ] ... \ +[ \fBelse\fP \fIlist\fP; ] \fBfi\fP +The +.B if +.I list +is executed. If its exit status is zero, the +\fBthen\fP \fIlist\fP is executed. Otherwise, each \fBelif\fP +\fIlist\fP is executed in turn, and if its exit status is zero, +the corresponding \fBthen\fP \fIlist\fP is executed and the +command completes. Otherwise, the \fBelse\fP \fIlist\fP is +executed, if present. The exit status is the exit status of the +last command executed, or zero if no condition tested true. +.TP +\fBwhile\fP \fIlist-1\fP; \fBdo\fP \fIlist-2\fP; \fBdone\fP +.PD 0 +.TP +\fBuntil\fP \fIlist-1\fP; \fBdo\fP \fIlist-2\fP; \fBdone\fP +.PD +The \fBwhile\fP command continuously executes the list +\fIlist-2\fP as long as the last command in the list \fIlist-1\fP returns +an exit status of zero. The \fBuntil\fP command is identical +to the \fBwhile\fP command, except that the test is negated; +.I list-2 +is executed as long as the last command in +.I list-1 +returns a non-zero exit status. +The exit status of the \fBwhile\fP and \fBuntil\fP commands +is the exit status +of the last command executed in \fIlist-2\fP, or zero if +none was executed. +.SS Coprocesses +.PP +A \fIcoprocess\fP is a shell command preceded by the \fBcoproc\fP reserved +word. +A coprocess is executed asynchronously in a subshell, as if the command +had been terminated with the \fB&\fP control operator, with a two-way pipe +established between the executing shell and the coprocess. +.PP +The format for a coprocess is: +.RS +.PP +\fBcoproc\fP [\fINAME\fP] \fIcommand\fP [\fIredirections\fP] +.RE +.PP +This creates a coprocess named \fINAME\fP. +If \fINAME\fP is not supplied, the default name is \fBCOPROC\fP. +\fINAME\fP must not be supplied if \fIcommand\fP is a \fIsimple +command\fP (see above); otherwise, it is interpreted as the first word +of the simple command. +When the coprocess is executed, the shell creates an array variable (see +.B Arrays +below) named \fINAME\fP in the context of the executing shell. +The standard output of +.I command +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to \fINAME\fP[0]. +The standard input of +.I command +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to \fINAME\fP[1]. +This pipe is established before any redirections specified by the +command (see +.SM +.B REDIRECTION +below). +The file descriptors can be utilized as arguments to shell commands +and redirections using standard word expansions. +The file descriptors are not available in subshells. +The process ID of the shell spawned to execute the coprocess is +available as the value of the variable \fINAME\fP_PID. +The \fBwait\fP +builtin command may be used to wait for the coprocess to terminate. +.PP +Since the coprocess is created as an asynchronous command, +the \fBcoproc\fP command always returns success. +The return status of a coprocess is the exit status of \fIcommand\fP. +.SS Shell Function Definitions +.PP +A shell function is an object that is called like a simple command and +executes a compound command with a new set of positional parameters. +Shell functions are declared as follows: +.TP +\fIname\fP () \fIcompound\-command\fP [\fIredirection\fP] +.PD 0 +.TP +\fBfunction\fP \fIname\fP [()] \fIcompound\-command\fP [\fIredirection\fP] +.PD +This defines a function named \fIname\fP. +The reserved word \fBfunction\fP is optional. +If the \fBfunction\fP reserved word is supplied, the parentheses are optional. +The \fIbody\fP of the function is the compound command +.I compound\-command +(see \fBCompound Commands\fP above). +That command is usually a \fIlist\fP of commands between { and }, but +may be any command listed under \fBCompound Commands\fP above. +\fIcompound\-command\fP is executed whenever \fIname\fP is specified as the +name of a simple command. +When in \fIposix mode\fP, \fIname\fP may not be the name of one of the +POSIX \fIspecial builtins\fP. +Any redirections (see +.SM +.B REDIRECTION +below) specified when a function is defined are performed +when the function is executed. +The exit status of a function definition is zero unless a syntax error +occurs or a readonly function with the same name already exists. +When executed, the exit status of a function is the exit status of the +last command executed in the body. (See +.SM +.B FUNCTIONS +below.) +.SH COMMENTS +In a non-interactive shell, or an interactive shell in which the +.B interactive_comments +option to the +.B shopt +builtin is enabled (see +.SM +.B "SHELL BUILTIN COMMANDS" +below), a word beginning with +.B # +causes that word and all remaining characters on that line to +be ignored. An interactive shell without the +.B interactive_comments +option enabled does not allow comments. The +.B interactive_comments +option is on by default in interactive shells. +.SH QUOTING +\fIQuoting\fP is used to remove the special meaning of certain +characters or words to the shell. Quoting can be used to +disable special treatment for special characters, to prevent +reserved words from being recognized as such, and to prevent +parameter expansion. +.PP +Each of the \fImetacharacters\fP listed above under +.SM +.B DEFINITIONS +has special meaning to the shell and must be quoted if it is to +represent itself. +.PP +When the command history expansion facilities are being used +(see +.SM +.B HISTORY EXPANSION +below), the +\fIhistory expansion\fP character, usually \fB!\fP, must be quoted +to prevent history expansion. +.PP +There are three quoting mechanisms: the +.IR "escape character" , +single quotes, and double quotes. +.PP +A non-quoted backslash (\fB\e\fP) is the +.IR "escape character" . +It preserves the literal value of the next character that follows, +with the exception of . If a \fB\e\fP pair +appears, and the backslash is not itself quoted, the \fB\e\fP +is treated as a line continuation (that is, it is removed from the +input stream and effectively ignored). +.PP +Enclosing characters in single quotes preserves the literal value +of each character within the quotes. A single quote may not occur +between single quotes, even when preceded by a backslash. +.PP +Enclosing characters in double quotes preserves the literal value +of all characters within the quotes, with the exception of +.BR $ , +.BR \` , +.BR \e , +and, when history expansion is enabled, +.BR ! . +The characters +.B $ +and +.B \` +retain their special meaning within double quotes. The backslash +retains its special meaning only when followed by one of the following +characters: +.BR $ , +.BR \` , +\^\fB"\fP\^, +.BR \e , +or +.BR . +A double quote may be quoted within double quotes by preceding it with +a backslash. +If enabled, history expansion will be performed unless an +.B ! +appearing in double quotes is escaped using a backslash. +The backslash preceding the +.B ! +is not removed. +.PP +The special parameters +.B * +and +.B @ +have special meaning when in double +quotes (see +.SM +.B PARAMETERS +below). +.PP +Words of the form \fB$\fP\(aq\fIstring\fP\(aq are treated specially. The +word expands to \fIstring\fP, with backslash-escaped characters replaced +as specified by the ANSI C standard. Backslash escape sequences, if +present, are decoded as follows: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ee +.TP +.B \eE +an escape character +.TP +.B \ef +form feed +.TP +.B \en +new line +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\e +backslash +.TP +.B \e\(aq +single quote +.TP +.B \e\(dq +double quote +.TP +.B \e\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(one to three digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.TP +.B \eu\fIHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHH\fP (one to four hex digits) +.TP +.B \eU\fIHHHHHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHHHHHH\fP (one to eight hex digits) +.TP +.B \ec\fIx\fP +a control-\fIx\fP character +.PD +.RE +.LP +The expanded result is single-quoted, as if the dollar sign had +not been present. +.PP +A double-quoted string preceded by a dollar sign (\fB$\fP\(dq\fIstring\fP\(dq) +will cause the string to be translated according to the current locale. +If the current locale is \fBC\fP or \fBPOSIX\fP, the dollar sign +is ignored. +If the string is translated and replaced, the replacement is +double-quoted. +.SH PARAMETERS +A +.I parameter +is an entity that stores values. +It can be a +.IR name , +a number, or one of the special characters listed below under +.BR "Special Parameters" . +A +.I variable +is a parameter denoted by a +.IR name . +A variable has a \fIvalue\fP and zero or more \fIattributes\fP. +Attributes are assigned using the +.B declare +builtin command (see +.B declare +below in +.SM +.BR "SHELL BUILTIN COMMANDS" ). +.PP +A parameter is set if it has been assigned a value. The null string is +a valid value. Once a variable is set, it may be unset only by using +the +.B unset +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.PP +A +.I variable +may be assigned to by a statement of the form +.RS +.PP +\fIname\fP=[\fIvalue\fP] +.RE +.PP +If +.I value +is not given, the variable is assigned the null string. All +.I values +undergo tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote +removal (see +.SM +.B EXPANSION +below). If the variable has its +.B integer +attribute set, then +.I value +is evaluated as an arithmetic expression even if the $((...)) expansion is +not used (see +.B "Arithmetic Expansion" +below). +Word splitting is not performed, with the exception +of \fB"$@"\fP as explained below under +.BR "Special Parameters" . +Pathname expansion is not performed. +Assignment statements may also appear as arguments to the +.BR alias , +.BR declare , +.BR typeset , +.BR export , +.BR readonly , +and +.B local +builtin commands. +When in \fIposix mode\fP, these builtins may appear in a command after +one or more instances of the \fBcommand\fP builtin and retain these +assignment statement properties. +.PP +In the context where an assignment statement is assigning a value +to a shell variable or array index, the += operator can be used to +append to or add to the variable's previous value. +When += is applied to a variable for which the \fIinteger\fP attribute has been +set, \fIvalue\fP is evaluated as an arithmetic expression and added to the +variable's current value, which is also evaluated. +When += is applied to an array variable using compound assignment (see +.B Arrays +below), the +variable's value is not unset (as it is when using =), and new values are +appended to the array beginning at one greater than the array's maximum index +(for indexed arrays) or added as additional key\-value pairs in an +associative array. +When applied to a string-valued variable, \fIvalue\fP is expanded and +appended to the variable's value. +.PP +A variable can be assigned the \fInameref\fP attribute using the +\fB\-n\fP option to the \fBdeclare\fP or \fBlocal\fP builtin commands +(see the descriptions of \fBdeclare\fP and \fBlocal\fP below) +to create a \fInameref\fP, or a reference to another variable. +This allows variables to be manipulated indirectly. +Whenever the nameref variable is referenced or assigned to, the operation +is actually performed on the variable specified by the nameref variable's +value. +A nameref is commonly used within shell functions to refer to a variable +whose name is passed as an argument to the function. +For instance, if a variable name is passed to a shell function as its first +argument, running +.sp .5 +.RS +.if t \f(CWdeclare -n ref=$1\fP +.if n declare -n ref=$1 +.RE +.sp .5 +inside the function creates a nameref variable \fBref\fP whose value is +the variable name passed as the first argument. +References and assignments to \fBref\fP are treated as references and +assignments to the variable whose name was passed as \fB$1\fP. +If the control variable in a \fBfor\fP loop has the nameref attribute, +the list of words can be a list of shell variables, and a name reference +will be established for each word in the list, in turn, when the loop is +executed. +Array variables cannot be given the \fB\-n\fP attribute. +However, nameref variables can reference array variables and subscripted +array variables. +Namerefs can be unset using the \fB\-n\fP option to the \fBunset\fP builtin. +Otherwise, if \fBunset\fP is executed with the name of a nameref variable +as an argument, the variable referenced by the nameref variable will be unset. +.SS Positional Parameters +.PP +A +.I positional parameter +is a parameter denoted by one or more +digits, other than the single digit 0. Positional parameters are +assigned from the shell's arguments when it is invoked, +and may be reassigned using the +.B set +builtin command. Positional parameters may not be assigned to +with assignment statements. The positional parameters are +temporarily replaced when a shell function is executed (see +.SM +.B FUNCTIONS +below). +.PP +When a positional parameter consisting of more than a single +digit is expanded, it must be enclosed in braces (see +.SM +.B EXPANSION +below). +.SS Special Parameters +.PP +The shell treats several parameters specially. These parameters may +only be referenced; assignment to them is not allowed. +.PD 0 +.TP +.B * +Expands to the positional parameters, starting from one. +When the expansion is not within double quotes, each positional parameter +expands to a separate word. +In contexts where it is performed, those words +are subject to further word splitting and pathname expansion. +When the expansion occurs within double quotes, it expands to a single word +with the value of each parameter separated by the first character +of the +.SM +.B IFS +special variable. That is, "\fB$*\fP" is equivalent +to "\fB$1\fP\fIc\fP\fB$2\fP\fIc\fP\fB...\fP", where +.I c +is the first character of the value of the +.SM +.B IFS +variable. If +.SM +.B IFS +is unset, the parameters are separated by spaces. +If +.SM +.B IFS +is null, the parameters are joined without intervening separators. +.TP +.B @ +Expands to the positional parameters, starting from one. When the +expansion occurs within double quotes, each parameter expands to a +separate word. That is, "\fB$@\fP" is equivalent to +"\fB$1\fP" "\fB$2\fP" ... +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +When there are no positional parameters, "\fB$@\fP" and +.B $@ +expand to nothing (i.e., they are removed). +.TP +.B # +Expands to the number of positional parameters in decimal. +.TP +.B ? +Expands to the exit status of the most recently executed foreground +pipeline. +.TP +.B \- +Expands to the current option flags as specified upon invocation, +by the +.B set +builtin command, or those set by the shell itself +(such as the +.B \-i +option). +.TP +.B $ +Expands to the process ID of the shell. In a () subshell, it +expands to the process ID of the current shell, not the +subshell. +.TP +.B ! +Expands to the process ID of the job most recently placed into the +background, whether executed as an asynchronous command or using +the \fBbg\fP builtin (see +.SM +.B "JOB CONTROL" +below). +.TP +.B 0 +Expands to the name of the shell or shell script. This is set at +shell initialization. If +.B bash +is invoked with a file of commands, +.B $0 +is set to the name of that file. If +.B bash +is started with the +.B \-c +option, then +.B $0 +is set to the first argument after the string to be +executed, if one is present. Otherwise, it is set +to the filename used to invoke +.BR bash , +as given by argument zero. +.TP +.B _ +At shell startup, set to the absolute pathname used to invoke the +shell or shell script being executed as passed in the environment +or argument list. +Subsequently, expands to the last argument to the previous command, +after expansion. +Also set to the full pathname used to invoke each command executed +and placed in the environment exported to that command. +When checking mail, this parameter holds the name of the mail file +currently being checked. +.PD +.SS Shell Variables +.PP +The following variables are set by the shell: +.PP +.PD 0 +.TP +.B BASH +Expands to the full filename used to invoke this instance of +.BR bash . +.TP +.B BASHOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +.B \-s +option to the +.B shopt +builtin command (see +.SM +.B "SHELL BUILTIN COMMANDS" +below). The options appearing in +.SM +.B BASHOPTS +are those reported as +.I on +by \fBshopt\fP. +If this variable is in the environment when +.B bash +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +.TP +.B BASHPID +Expands to the process ID of the current \fBbash\fP process. +This differs from \fB$$\fP under certain circumstances, such as subshells +that do not require \fBbash\fP to be re-initialized. +.TP +.B BASH_ALIASES +An associative array variable whose members correspond to the internal +list of aliases as maintained by the \fBalias\fP builtin. +Elements added to this array appear in the alias list; unsetting array +elements cause aliases to be removed from the alias list. +.TP +.B BASH_ARGC +An array variable whose values are the number of parameters in each +frame of the current \fBbash\fP execution call stack. +The number of +parameters to the current subroutine (shell function or script executed +with \fB.\fP or \fBsource\fP) is at the top of the stack. +When a subroutine is executed, the number of parameters passed is pushed onto +.SM +.BR BASH_ARGC . +The shell sets +.SM +.B BASH_ARGC +only when in extended debugging mode (see the description of the +.B extdebug +option to the +.B shopt +builtin below) +.TP +.B BASH_ARGV +An array variable containing all of the parameters in the current \fBbash\fP +execution call stack. The final parameter of the last subroutine call +is at the top of the stack; the first parameter of the initial call is +at the bottom. When a subroutine is executed, the parameters supplied +are pushed onto +.SM +.BR BASH_ARGV . +The shell sets +.SM +.B BASH_ARGV +only when in extended debugging mode +(see the description of the +.B extdebug +option to the +.B shopt +builtin below) +.TP +.B BASH_CMDS +An associative array variable whose members correspond to the internal +hash table of commands as maintained by the \fBhash\fP builtin. +Elements added to this array appear in the hash table; unsetting array +elements cause commands to be removed from the hash table. +.TP +.B BASH_COMMAND +The command currently being executed or about to be executed, unless the +shell is executing a command as the result of a trap, +in which case it is the command executing at the time of the trap. +.TP +.B BASH_EXECUTION_STRING +The command argument to the \fB\-c\fP invocation option. +.TP +.B BASH_LINENO +An array variable whose members are the line numbers in source files +where each corresponding member of +.SM +.B FUNCNAME +was invoked. +\fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP is the line number in the source +file (\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP) where +\fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP was called +(or \fB${BASH_LINENO[\fP\fI$i-1\fP\fB]}\fP if referenced within another +shell function). +Use +.SM +.B LINENO +to obtain the current line number. +.TP +.B BASH_REMATCH +An array variable whose members are assigned by the \fB=~\fP binary +operator to the \fB[[\fP conditional command. +The element with index 0 is the portion of the string +matching the entire regular expression. +The element with index \fIn\fP is the portion of the +string matching the \fIn\fPth parenthesized subexpression. +This variable is read-only. +.TP +.B BASH_SOURCE +An array variable whose members are the source filenames +where the corresponding shell function names in the +.SM +.B FUNCNAME +array variable are defined. +The shell function +\fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP is defined in the file +\fB${BASH_SOURCE[\fP\fI$i\fP\fB]}\fP and called from +\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP. +.TP +.B BASH_SUBSHELL +Incremented by one within each subshell or subshell environment when +the shell begins executing in that environment. +The initial value is 0. +.TP +.B BASH_VERSINFO +A readonly array variable whose members hold version information for +this instance of +.BR bash . +The values assigned to the array members are as follows: +.sp .5 +.RS +.TP 24 +.B BASH_VERSINFO[\fR0\fP] +The major version number (the \fIrelease\fP). +.TP +.B BASH_VERSINFO[\fR1\fP] +The minor version number (the \fIversion\fP). +.TP +.B BASH_VERSINFO[\fR2\fP] +The patch level. +.TP +.B BASH_VERSINFO[\fR3\fP] +The build version. +.TP +.B BASH_VERSINFO[\fR4\fP] +The release status (e.g., \fIbeta1\fP). +.TP +.B BASH_VERSINFO[\fR5\fP] +The value of +.SM +.BR MACHTYPE . +.RE +.TP +.B BASH_VERSION +Expands to a string describing the version of this instance of +.BR bash . +.TP +.B COMP_CWORD +An index into \fB${COMP_WORDS}\fP of the word containing the current +cursor position. +This variable is available only in shell functions invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_KEY +The key (or final key of a key sequence) used to invoke the current +completion function. +.TP +.B COMP_LINE +The current command line. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_POINT +The index of the current cursor position relative to the beginning of +the current command. +If the current cursor position is at the end of the current command, +the value of this variable is equal to \fB${#COMP_LINE}\fP. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_TYPE +Set to an integer value corresponding to the type of completion attempted +that caused a completion function to be called: +\fITAB\fP, for normal completion, +\fI?\fP, for listing completions after successive tabs, +\fI!\fP, for listing alternatives on partial word completion, +\fI@\fP, to list completions if the word is not unmodified, +or +\fI%\fP, for menu completion. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COMP_WORDBREAKS +The set of characters that the \fBreadline\fP library treats as word +separators when performing word completion. +If +.SM +.B COMP_WORDBREAKS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B COMP_WORDS +An array variable (see \fBArrays\fP below) consisting of the individual +words in the current command line. +The line is split into words as \fBreadline\fP would split it, using +.SM +.B COMP_WORDBREAKS +as described above. +This variable is available only in shell functions invoked by the +programmable completion facilities (see \fBProgrammable Completion\fP +below). +.TP +.B COPROC +An array variable (see \fBArrays\fP below) created to hold the file descriptors +for output from and input to an unnamed coprocess (see \fBCoprocesses\fP +above). +.TP +.B DIRSTACK +An array variable (see +.B Arrays +below) containing the current contents of the directory stack. +Directories appear in the stack in the order they are displayed by the +.B dirs +builtin. +Assigning to members of this array variable may be used to modify +directories already in the stack, but the +.B pushd +and +.B popd +builtins must be used to add and remove directories. +Assignment to this variable will not change the current directory. +If +.SM +.B DIRSTACK +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B EUID +Expands to the effective user ID of the current user, initialized at +shell startup. This variable is readonly. +.TP +.B FUNCNAME +An array variable containing the names of all shell functions +currently in the execution call stack. +The element with index 0 is the name of any currently-executing +shell function. +The bottom-most element (the one with the highest index) is +.if t \f(CW"main"\fP. +.if n "main". +This variable exists only when a shell function is executing. +Assignments to +.SM +.B FUNCNAME +have no effect and return an error status. +If +.SM +.B FUNCNAME +is unset, it loses its special properties, even if it is +subsequently reset. +.if t .sp 0.5 +.if n .sp 1 +This variable can be used with \fBBASH_LINENO\fP and \fBBASH_SOURCE\fP. +Each element of \fBFUNCNAME\fP has corresponding elements in +\fBBASH_LINENO\fP and \fBBASH_SOURCE\fP to describe the call stack. +For instance, \fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP was called from the file +\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP at line number +\fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP. +The \fBcaller\fP builtin displays the current call stack using this +information. +.TP +.B GROUPS +An array variable containing the list of groups of which the current +user is a member. +Assignments to +.SM +.B GROUPS +have no effect and return an error status. +If +.SM +.B GROUPS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B HISTCMD +The history number, or index in the history list, of the current +command. +If +.SM +.B HISTCMD +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B HOSTNAME +Automatically set to the name of the current host. +.TP +.B HOSTTYPE +Automatically set to a string that uniquely +describes the type of machine on which +.B bash +is executing. +The default is system-dependent. +.TP +.B LINENO +Each time this parameter is referenced, the shell substitutes +a decimal number representing the current sequential line number +(starting with 1) within a script or function. When not in a +script or function, the value substituted is not guaranteed to +be meaningful. +If +.SM +.B LINENO +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B MACHTYPE +Automatically set to a string that fully describes the system +type on which +.B bash +is executing, in the standard GNU \fIcpu-company-system\fP format. +The default is system-dependent. +.TP +.B MAPFILE +An array variable (see \fBArrays\fP below) created to hold the text +read by the \fBmapfile\fP builtin when no variable name is supplied. +.TP +.B OLDPWD +The previous working directory as set by the +.B cd +command. +.TP +.B OPTARG +The value of the last option argument processed by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.TP +.B OPTIND +The index of the next argument to be processed by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.TP +.B OSTYPE +Automatically set to a string that +describes the operating system on which +.B bash +is executing. +The default is system-dependent. +.TP +.B PIPESTATUS +An array variable (see +.B Arrays +below) containing a list of exit status values from the processes +in the most-recently-executed foreground pipeline (which may +contain only a single command). +.TP +.B PPID +The process ID of the shell's parent. This variable is readonly. +.TP +.B PWD +The current working directory as set by the +.B cd +command. +.TP +.B RANDOM +Each time this parameter is referenced, a random integer between +0 and 32767 is +generated. The sequence of random numbers may be initialized by assigning +a value to +.SM +.BR RANDOM . +If +.SM +.B RANDOM +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B READLINE_LINE +The contents of the +.B readline +line buffer, for use with +.if t \f(CWbind -x\fP +.if n "bind -x" +(see +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.TP +.B READLINE_POINT +The position of the insertion point in the +.B readline +line buffer, for use with +.if t \f(CWbind -x\fP +.if n "bind -x" +(see +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.TP +.B REPLY +Set to the line of input read by the +.B read +builtin command when no arguments are supplied. +.TP +.B SECONDS +Each time this parameter is +referenced, the number of seconds since shell invocation is returned. If a +value is assigned to +.SM +.BR SECONDS , +the value returned upon subsequent +references is +the number of seconds since the assignment plus the value assigned. +If +.SM +.B SECONDS +is unset, it loses its special properties, even if it is +subsequently reset. +.TP +.B SHELLOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +.B \-o +option to the +.B set +builtin command (see +.SM +.B "SHELL BUILTIN COMMANDS" +below). The options appearing in +.SM +.B SHELLOPTS +are those reported as +.I on +by \fBset \-o\fP. +If this variable is in the environment when +.B bash +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +.TP +.B SHLVL +Incremented by one each time an instance of +.B bash +is started. +.TP +.B UID +Expands to the user ID of the current user, initialized at shell startup. +This variable is readonly. +.PD +.PP +The following variables are used by the shell. In some cases, +.B bash +assigns a default value to a variable; these cases are noted +below. +.PP +.PD 0 +.TP +.B BASH_COMPAT +The value is used to set the shell's compatibility level. +See the description of the \fBshopt\fP builtin below under +\fBSHELL BUILTIN COMMANDS\fP +for a description of the various compatibility +levels and their effects. +The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42) +corresponding to the desired compatibility level. +If \fBBASH_COMPAT\fP is unset or set to the empty string, the compatibility +level is set to the default for the current version. +If \fBBASH_COMPAT\fP is set to a value that is not one of the valid +compatibility levels, the shell prints an error message and sets the +compatibility level to the default for the current version. +The valid compatibility levels correspond to the compatibility options +accepted by the \fBshopt\fP builtin described below (for example, +\fBcompat42\fP means that 4.2 and 42 are valid values). +The current version is also a valid value. +.TP +.B BASH_ENV +If this parameter is set when \fBbash\fP is executing a shell script, +its value is interpreted as a filename containing commands to +initialize the shell, as in +.IR ~/.bashrc . +The value of +.SM +.B BASH_ENV +is subjected to parameter expansion, command substitution, and arithmetic +expansion before being interpreted as a filename. +.SM +.B PATH +is not used to search for the resultant filename. +.TP +.B BASH_XTRACEFD +If set to an integer corresponding to a valid file descriptor, \fBbash\fP +will write the trace output generated when +.if t \f(CWset -x\fP +.if n \fIset -x\fP +is enabled to that file descriptor. +The file descriptor is closed when +.SM +.B BASH_XTRACEFD +is unset or assigned a new value. +Unsetting +.SM +.B BASH_XTRACEFD +or assigning it the empty string causes the +trace output to be sent to the standard error. +Note that setting +.SM +.B BASH_XTRACEFD +to 2 (the standard error file +descriptor) and then unsetting it will result in the standard error +being closed. +.TP +.B CDPATH +The search path for the +.B cd +command. +This is a colon-separated list of directories in which the shell looks +for destination directories specified by the +.B cd +command. +A sample value is +.if t \f(CW".:~:/usr"\fP. +.if n ".:~:/usr". +.TP +.B CHILD_MAX +Set the number of exited child status values for the shell to remember. +Bash will not allow this value to be decreased below a POSIX-mandated +minimum, and there is a maximum value (currently 8192) that this may +not exceed. +The minimum value is system-dependent. +.TP +.B COLUMNS +Used by the \fBselect\fP compound command to determine the terminal width +when printing selection lists. +Automatically set if the +.B checkwinsize +option is enabled or in an interactive shell upon receipt of a +.SM +.BR SIGWINCH . +.TP +.B COMPREPLY +An array variable from which \fBbash\fP reads the possible completions +generated by a shell function invoked by the programmable completion +facility (see \fBProgrammable Completion\fP below). +Each array element contains one possible completion. +.TP +.B EMACS +If \fBbash\fP finds this variable in the environment when the shell starts +with value +.if t \f(CWt\fP, +.if n "t", +it assumes that the shell is running in an Emacs shell buffer and disables +line editing. +.TP +.B ENV +Similar to +.SM +.BR BASH_ENV ; +used when the shell is invoked in POSIX mode. +.TP +.B FCEDIT +The default editor for the +.B fc +builtin command. +.TP +.B FIGNORE +A colon-separated list of suffixes to ignore when performing +filename completion (see +.SM +.B READLINE +below). +A filename whose suffix matches one of the entries in +.SM +.B FIGNORE +is excluded from the list of matched filenames. +A sample value is +.if t \f(CW".o:~"\fP. +.if n ".o:~" +(Quoting is needed when assigning a value to this variable, +which contains tildes). +.TP +.B FUNCNEST +If set to a numeric value greater than 0, defines a maximum function +nesting level. Function invocations that exceed this nesting level +will cause the current command to abort. +.TP +.B GLOBIGNORE +A colon-separated list of patterns defining the set of filenames to +be ignored by pathname expansion. +If a filename matched by a pathname expansion pattern also matches one +of the patterns in +.SM +.BR GLOBIGNORE , +it is removed from the list of matches. +.TP +.B HISTCONTROL +A colon-separated list of values controlling how commands are saved on +the history list. +If the list of values includes +.IR ignorespace , +lines which begin with a +.B space +character are not saved in the history list. +A value of +.I ignoredups +causes lines matching the previous history entry to not be saved. +A value of +.I ignoreboth +is shorthand for \fIignorespace\fP and \fIignoredups\fP. +A value of +.IR erasedups +causes all previous lines matching the current line to be removed from +the history list before that line is saved. +Any value not in the above list is ignored. +If +.SM +.B HISTCONTROL +is unset, or does not include a valid value, +all lines read by the shell parser are saved on the history list, +subject to the value of +.SM +.BR HISTIGNORE . +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +.SM +.BR HISTCONTROL . +.TP +.B HISTFILE +The name of the file in which command history is saved (see +.SM +.B HISTORY +below). The default value is \fI~/.bash_history\fP. If unset, the +command history is not saved when a shell exits. +.TP +.B HISTFILESIZE +The maximum number of lines contained in the history file. When this +variable is assigned a value, the history file is truncated, if +necessary, +to contain no more than that number of lines by removing the oldest entries. +The history file is also truncated to this size after +writing it when a shell exits. +If the value is 0, the history file is truncated to zero size. +Non-numeric values and numeric values less than zero inhibit truncation. +The shell sets the default value to the value of \fBHISTSIZE\fP +after reading any startup files. +.TP +.B HISTIGNORE +A colon-separated list of patterns used to decide which command lines +should be saved on the history list. Each pattern is anchored at the +beginning of the line and must match the complete line (no implicit +`\fB*\fP' is appended). Each pattern is tested against the line +after the checks specified by +.SM +.B HISTCONTROL +are applied. +In addition to the normal shell pattern matching characters, `\fB&\fP' +matches the previous history line. `\fB&\fP' may be escaped using a +backslash; the backslash is removed before attempting a match. +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +.SM +.BR HISTIGNORE . +.TP +.B HISTSIZE +The number of commands to remember in the command history (see +.SM +.B HISTORY +below). +If the value is 0, commands are not saved in the history list. +Numeric values less than zero result in every command being saved +on the history list (there is no limit). +The shell sets the default value to 500 after reading any startup files. +.TP +.B HISTTIMEFORMAT +If this variable is set and not null, its value is used as a format string +for \fIstrftime\fP(3) to print the time stamp associated with each history +entry displayed by the \fBhistory\fP builtin. +If this variable is set, time stamps are written to the history file so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +.TP +.B HOME +The home directory of the current user; the default argument for the +\fBcd\fP builtin command. +The value of this variable is also used when performing tilde expansion. +.TP +.B HOSTFILE +Contains the name of a file in the same format as +.FN /etc/hosts +that should be read when the shell needs to complete a +hostname. +The list of possible hostname completions may be changed while the +shell is running; +the next time hostname completion is attempted after the +value is changed, +.B bash +adds the contents of the new file to the existing list. +If +.SM +.B HOSTFILE +is set, but has no value, or does not name a readable file, +\fBbash\fP attempts to read +.FN /etc/hosts +to obtain the list of possible hostname completions. +When +.SM +.B HOSTFILE +is unset, the hostname list is cleared. +.TP +.B IFS +The +.I Internal Field Separator +that is used +for word splitting after expansion and to +split lines into words with the +.B read +builtin command. The default value is +``''. +.TP +.B IGNOREEOF +Controls the +action of an interactive shell on receipt of an +.SM +.B EOF +character as the sole input. If set, the value is the number of +consecutive +.SM +.B EOF +characters which must be +typed as the first characters on an input line before +.B bash +exits. If the variable exists but does not have a numeric value, or +has no value, the default value is 10. If it does not exist, +.SM +.B EOF +signifies the end of input to the shell. +.TP +.B INPUTRC +The filename for the +.B readline +startup file, overriding the default of +.FN ~/.inputrc +(see +.SM +.B READLINE +below). +.TP +.B LANG +Used to determine the locale category for any category not specifically +selected with a variable starting with \fBLC_\fP. +.TP +.B LC_ALL +This variable overrides the value of +.SM +.B LANG +and any other +\fBLC_\fP variable specifying a locale category. +.TP +.B LC_COLLATE +This variable determines the collation order used when sorting the +results of pathname expansion, and determines the behavior of range +expressions, equivalence classes, and collating sequences within +pathname expansion and pattern matching. +.TP +.B LC_CTYPE +This variable determines the interpretation of characters and the +behavior of character classes within pathname expansion and pattern +matching. +.TP +.B LC_MESSAGES +This variable determines the locale used to translate double-quoted +strings preceded by a \fB$\fP. +.TP +.B LC_NUMERIC +This variable determines the locale category used for number formatting. +.TP +.B LINES +Used by the \fBselect\fP compound command to determine the column length +for printing selection lists. +Automatically set if the +.B checkwinsize +option is enabled or in an interactive shell upon receipt of a +.SM +.BR SIGWINCH . +.TP +.B MAIL +If this parameter is set to a file or directory name and the +.SM +.B MAILPATH +variable is not set, +.B bash +informs the user of the arrival of mail in the specified file or +Maildir-format directory. +.TP +.B MAILCHECK +Specifies how +often (in seconds) +.B bash +checks for mail. The default is 60 seconds. When it is time to check +for mail, the shell does so before displaying the primary prompt. +If this variable is unset, or set to a value that is not a number +greater than or equal to zero, the shell disables mail checking. +.TP +.B MAILPATH +A colon-separated list of filenames to be checked for mail. +The message to be printed when mail arrives in a particular file +may be specified by separating the filename from the message with a `?'. +When used in the text of the message, \fB$_\fP expands to the name of +the current mailfile. +Example: +.RS +.PP +\fBMAILPATH\fP=\(aq/var/mail/bfox?"You have mail":~/shell\-mail?"$_ has mail!"\(aq +.PP +.B Bash +supplies a default value for this variable, but the location of the user +mail files that it uses is system dependent (e.g., /var/mail/\fB$USER\fP). +.RE +.TP +.B OPTERR +If set to the value 1, +.B bash +displays error messages generated by the +.B getopts +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SM +.B OPTERR +is initialized to 1 each time the shell is invoked or a shell +script is executed. +.TP +.B PATH +The search path for commands. It +is a colon-separated list of directories in which +the shell looks for commands (see +.SM +.B COMMAND EXECUTION +below). +A zero-length (null) directory name in the value of +.SM +.B PATH +indicates the current directory. +A null directory name may appear as two adjacent colons, or as an initial +or trailing colon. +The default path is system-dependent, +and is set by the administrator who installs +.BR bash . +A common value is +.if t \f(CW/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin\fP. +.if n ``/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin''. +.TP +.B POSIXLY_CORRECT +If this variable is in the environment when \fBbash\fP starts, the shell +enters \fIposix mode\fP before reading the startup files, as if the +.B \-\-posix +invocation option had been supplied. If it is set while the shell is +running, \fBbash\fP enables \fIposix mode\fP, as if the command +.if t \f(CWset -o posix\fP +.if n \fIset -o posix\fP +had been executed. +.TP +.B PROMPT_COMMAND +If set, the value is executed as a command prior to issuing each primary +prompt. +.TP +.B PROMPT_DIRTRIM +If set to a number greater than zero, the value is used as the number of +trailing directory components to retain when expanding the \fB\ew\fP and +\fB\eW\fP prompt string escapes (see +.SM +.B PROMPTING +below). Characters removed are replaced with an ellipsis. +.TP +.B PS1 +The value of this parameter is expanded (see +.SM +.B PROMPTING +below) and used as the primary prompt string. The default value is +``\fB\es\-\ev\e$ \fP''. +.TP +.B PS2 +The value of this parameter is expanded as with +.SM +.B PS1 +and used as the secondary prompt string. The default is +``\fB> \fP''. +.TP +.B PS3 +The value of this parameter is used as the prompt for the +.B select +command (see +.SM +.B SHELL GRAMMAR +above). +.TP +.B PS4 +The value of this parameter is expanded as with +.SM +.B PS1 +and the value is printed before each command +.B bash +displays during an execution trace. The first character of +.SM +.B PS4 +is replicated multiple times, as necessary, to indicate multiple +levels of indirection. The default is ``\fB+ \fP''. +.TP +.B SHELL +The full pathname to the shell is kept in this environment variable. +If it is not set when the shell starts, +.B bash +assigns to it the full pathname of the current user's login shell. +.TP +.B TIMEFORMAT +The value of this parameter is used as a format string specifying +how the timing information for pipelines prefixed with the +.B time +reserved word should be displayed. +The \fB%\fP character introduces an escape sequence that is +expanded to a time value or other information. +The escape sequences and their meanings are as follows; the +braces denote optional portions. +.sp .5 +.RS +.PD 0 +.TP 10 +.B %% +A literal \fB%\fP. +.TP +.B %[\fIp\fP][l]R +The elapsed time in seconds. +.TP +.B %[\fIp\fP][l]U +The number of CPU seconds spent in user mode. +.TP +.B %[\fIp\fP][l]S +The number of CPU seconds spent in system mode. +.TP +.B %P +The CPU percentage, computed as (%U + %S) / %R. +.PD +.RE +.IP +The optional \fIp\fP is a digit specifying the \fIprecision\fP, +the number of fractional digits after a decimal point. +A value of 0 causes no decimal point or fraction to be output. +At most three places after the decimal point may be specified; +values of \fIp\fP greater than 3 are changed to 3. +If \fIp\fP is not specified, the value 3 is used. +.IP +The optional \fBl\fP specifies a longer format, including +minutes, of the form \fIMM\fPm\fISS\fP.\fIFF\fPs. +The value of \fIp\fP determines whether or not the fraction is +included. +.IP +If this variable is not set, \fBbash\fP acts as if it had the +value \fB$\(aq\enreal\et%3lR\enuser\et%3lU\ensys\et%3lS\(aq\fP. +If the value is null, no timing information is displayed. +A trailing newline is added when the format string is displayed. +.PD 0 +.TP +.B TMOUT +If set to a value greater than zero, +.SM +.B TMOUT +is treated as the +default timeout for the \fBread\fP builtin. +The \fBselect\fP command terminates if input does not arrive +after +.SM +.B TMOUT +seconds when input is coming from a terminal. +In an interactive shell, the value is interpreted as the +number of seconds to wait for a line of input after issuing the +primary prompt. +.B Bash +terminates after waiting for that number of seconds if a complete +line of input does not arrive. +.TP +.B TMPDIR +If set, \fBbash\fP uses its value as the name of a directory in which +\fBbash\fP creates temporary files for the shell's use. +.TP +.B auto_resume +This variable controls how the shell interacts with the user and +job control. If this variable is set, single word simple +commands without redirections are treated as candidates for resumption +of an existing stopped job. There is no ambiguity allowed; if there is +more than one job beginning with the string typed, the job most recently +accessed is selected. The +.I name +of a stopped job, in this context, is the command line used to +start it. +If set to the value +.IR exact , +the string supplied must match the name of a stopped job exactly; +if set to +.IR substring , +the string supplied needs to match a substring of the name of a +stopped job. The +.I substring +value provides functionality analogous to the +.B %? +job identifier (see +.SM +.B JOB CONTROL +below). If set to any other value, the supplied string must +be a prefix of a stopped job's name; this provides functionality +analogous to the \fB%\fP\fIstring\fP job identifier. +.TP +.B histchars +The two or three characters which control history expansion +and tokenization (see +.SM +.B HISTORY EXPANSION +below). The first character is the \fIhistory expansion\fP character, +the character which signals the start of a history +expansion, normally `\fB!\fP'. +The second character is the \fIquick substitution\fP +character, which is used as shorthand for re-running the previous +command entered, substituting one string for another in the command. +The default is `\fB^\fP'. +The optional third character is the character +which indicates that the remainder of the line is a comment when found +as the first character of a word, normally `\fB#\fP'. The history +comment character causes history substitution to be skipped for the +remaining words on the line. It does not necessarily cause the shell +parser to treat the rest of the line as a comment. +.PD +.SS Arrays +.B Bash +provides one-dimensional indexed and associative array variables. +Any variable may be used as an indexed array; the +.B declare +builtin will explicitly declare an array. +There is no maximum +limit on the size of an array, nor any requirement that members +be indexed or assigned contiguously. +Indexed arrays are referenced using integers (including arithmetic +expressions) and are zero-based; associative arrays are referenced +using arbitrary strings. +Unless otherwise noted, indexed array indices must be non-negative integers. +.PP +An indexed array is created automatically if any variable is assigned to +using the syntax \fIname\fP[\fIsubscript\fP]=\fIvalue\fP. The +.I subscript +is treated as an arithmetic expression that must evaluate to a number. +To explicitly declare an indexed array, use +.B declare \-a \fIname\fP +(see +.SM +.B SHELL BUILTIN COMMANDS +below). +.B declare \-a \fIname\fP[\fIsubscript\fP] +is also accepted; the \fIsubscript\fP is ignored. +.PP +Associative arrays are created using +.BR "declare \-A \fIname\fP" . +.PP +Attributes may be +specified for an array variable using the +.B declare +and +.B readonly +builtins. Each attribute applies to all members of an array. +.PP +Arrays are assigned to using compound assignments of the form +\fIname\fP=\fB(\fPvalue\fI1\fP ... value\fIn\fP\fB)\fP, where each +\fIvalue\fP is of the form [\fIsubscript\fP]=\fIstring\fP. +Indexed array assignments do not require anything but \fIstring\fP. +When assigning to indexed arrays, if the optional brackets and subscript +are supplied, that index is assigned to; +otherwise the index of the element assigned is the last index assigned +to by the statement plus one. Indexing starts at zero. +.PP +When assigning to an associative array, the subscript is required. +.PP +This syntax is also accepted by the +.B declare +builtin. Individual array elements may be assigned to using the +\fIname\fP[\fIsubscript\fP]=\fIvalue\fP syntax introduced above. +When assigning to an indexed array, if +.I name +is subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +\fIname\fP, so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.PP +Any element of an array may be referenced using +${\fIname\fP[\fIsubscript\fP]}. The braces are required to avoid +conflicts with pathname expansion. If +\fIsubscript\fP is \fB@\fP or \fB*\fP, the word expands to +all members of \fIname\fP. These subscripts differ only when the +word appears within double quotes. If the word is double-quoted, +${\fIname\fP[*]} expands to a single +word with the value of each array member separated by the first +character of the +.SM +.B IFS +special variable, and ${\fIname\fP[@]} expands each element of +\fIname\fP to a separate word. When there are no array members, +${\fIname\fP[@]} expands to nothing. +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +This is analogous to the expansion +of the special parameters \fB*\fP and \fB@\fP (see +.B Special Parameters +above). ${#\fIname\fP[\fIsubscript\fP]} expands to the length of +${\fIname\fP[\fIsubscript\fP]}. If \fIsubscript\fP is \fB*\fP or +\fB@\fP, the expansion is the number of elements in the array. +Referencing an array variable without a subscript is equivalent to +referencing the array with a subscript of 0. +If the +.I subscript +used to reference an element of an indexed array +evaluates to a number less than zero, it is +interpreted as relative to one greater than the maximum index of the array, +so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.PP +An array variable is considered set if a subscript has been assigned a +value. The null string is a valid value. +.PP +It is possible to obtain the keys (indices) of an array as well as the values. +${\fB!\fP\fIname\fP[\fI@\fP]} and ${\fB!\fP\fIname\fP[\fI*\fP]} +expand to the indices assigned in array variable \fIname\fP. +The treatment when in double quotes is similar to the expansion of the +special parameters \fI@\fP and \fI*\fP within double quotes. +.PP +The +.B unset +builtin is used to destroy arrays. \fBunset\fP \fIname\fP[\fIsubscript\fP] +destroys the array element at index \fIsubscript\fP. +Negative subscripts to indexed arrays are interpreted as described above. +Care must be taken to avoid unwanted side effects caused by pathname +expansion. +\fBunset\fP \fIname\fP, where \fIname\fP is an array, or +\fBunset\fP \fIname\fP[\fIsubscript\fP], where +\fIsubscript\fP is \fB*\fP or \fB@\fP, removes the entire array. +.PP +The +.BR declare , +.BR local , +and +.B readonly +builtins each accept a +.B \-a +option to specify an indexed array and a +.B \-A +option to specify an associative array. +If both options are supplied, +.B \-A +takes precedence. +The +.B read +builtin accepts a +.B \-a +option to assign a list of words read from the standard input +to an array. The +.B set +and +.B declare +builtins display array values in a way that allows them to be +reused as assignments. +.SH EXPANSION +Expansion is performed on the command line after it has been split into +words. There are seven kinds of expansion performed: +.IR "brace expansion" , +.IR "tilde expansion" , +.IR "parameter and variable expansion" , +.IR "command substitution" , +.IR "arithmetic expansion" , +.IR "word splitting" , +and +.IR "pathname expansion" . +.PP +The order of expansions is: +brace expansion; +tilde expansion, parameter and variable expansion, arithmetic expansion, +and command substitution (done in a left-to-right fashion); +word splitting; +and pathname expansion. +.PP +On systems that can support it, there is an additional expansion +available: \fIprocess substitution\fP. +This is performed at the +same time as tilde, parameter, variable, and arithmetic expansion and +command substitution. +.PP +Only brace expansion, word splitting, and pathname expansion +can change the number of words of the expansion; other expansions +expand a single word to a single word. +The only exceptions to this are the expansions of +"\fB$@\fP" and "\fB${\fP\fIname\fP\fB[@]}\fP" +as explained above (see +.SM +.BR PARAMETERS ). +.SS Brace Expansion +.PP +.I "Brace expansion" +is a mechanism by which arbitrary strings +may be generated. This mechanism is similar to +\fIpathname expansion\fP, but the filenames generated +need not exist. Patterns to be brace expanded take +the form of an optional +.IR preamble , +followed by either a series of comma-separated strings or +a sequence expression between a pair of braces, followed by +an optional +.IR postscript . +The preamble is prefixed to each string contained +within the braces, and the postscript is then appended +to each resulting string, expanding left to right. +.PP +Brace expansions may be nested. The results of each expanded +string are not sorted; left to right order is preserved. +For example, a\fB{\fPd,c,b\fB}\fPe expands into `ade ace abe'. +.PP +A sequence expression takes the form +\fB{\fP\fIx\fP\fB..\fP\fIy\fP\fB[..\fP\fIincr\fP\fB]}\fP, +where \fIx\fP and \fIy\fP are either integers or single characters, +and \fIincr\fP, an optional increment, is an integer. +When integers are supplied, the expression expands to each number between +\fIx\fP and \fIy\fP, inclusive. +Supplied integers may be prefixed with \fI0\fP to force each term to have the +same width. +When either \fIx\fP or \fPy\fP begins with a zero, the shell +attempts to force all generated terms to contain the same number of digits, +zero-padding where necessary. +When characters are supplied, the expression expands to each character +lexicographically between \fIx\fP and \fIy\fP, inclusive, +using the default C locale. +Note that both \fIx\fP and \fIy\fP must be of the same type. +When the increment is supplied, it is used as the difference between +each term. The default increment is 1 or -1 as appropriate. +.PP +Brace expansion is performed before any other expansions, +and any characters special to other expansions are preserved +in the result. It is strictly textual. +.B Bash +does not apply any syntactic interpretation to the context of the +expansion or the text between the braces. +.PP +A correctly-formed brace expansion must contain unquoted opening +and closing braces, and at least one unquoted comma or a valid +sequence expression. +Any incorrectly formed brace expansion is left unchanged. +A \fB{\fP or \fB,\fP may be quoted with a backslash to prevent its +being considered part of a brace expression. +To avoid conflicts with parameter expansion, the string \fB${\fP +is not considered eligible for brace expansion. +.PP +This construct is typically used as shorthand when the common +prefix of the strings to be generated is longer than in the +above example: +.RS +.PP +mkdir /usr/local/src/bash/{old,new,dist,bugs} +.RE +or +.RS +chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} +.RE +.PP +Brace expansion introduces a slight incompatibility with +historical versions of +.BR sh . +.B sh +does not treat opening or closing braces specially when they +appear as part of a word, and preserves them in the output. +.B Bash +removes braces from words as a consequence of brace +expansion. For example, a word entered to +.B sh +as \fIfile{1,2}\fP +appears identically in the output. The same word is +output as +.I file1 file2 +after expansion by +.BR bash . +If strict compatibility with +.B sh +is desired, start +.B bash +with the +.B +B +option or disable brace expansion with the +.B +B +option to the +.B set +command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SS Tilde Expansion +.PP +If a word begins with an unquoted tilde character (`\fB~\fP'), all of +the characters preceding the first unquoted slash (or all characters, +if there is no unquoted slash) are considered a \fItilde-prefix\fP. +If none of the characters in the tilde-prefix are quoted, the +characters in the tilde-prefix following the tilde are treated as a +possible \fIlogin name\fP. +If this login name is the null string, the tilde is replaced with the +value of the shell parameter +.SM +.BR HOME . +If +.SM +.B HOME +is unset, the home directory of the user executing the shell is +substituted instead. +Otherwise, the tilde-prefix is replaced with the home directory +associated with the specified login name. +.PP +If the tilde-prefix is a `~+', the value of the shell variable +.SM +.B PWD +replaces the tilde-prefix. +If the tilde-prefix is a `~\-', the value of the shell variable +.SM +.BR OLDPWD , +if it is set, is substituted. +If the characters following the tilde in the tilde-prefix consist +of a number \fIN\fP, optionally prefixed +by a `+' or a `\-', the tilde-prefix is replaced with the corresponding +element from the directory stack, as it would be displayed by the +.B dirs +builtin invoked with the tilde-prefix as an argument. +If the characters following the tilde in the tilde-prefix consist of a +number without a leading `+' or `\-', `+' is assumed. +.PP +If the login name is invalid, or the tilde expansion fails, the word +is unchanged. +.PP +Each variable assignment is checked for unquoted tilde-prefixes immediately +following a +.B : +or the first +.BR = . +In these cases, tilde expansion is also performed. +Consequently, one may use filenames with tildes in assignments to +.SM +.BR PATH , +.SM +.BR MAILPATH , +and +.SM +.BR CDPATH , +and the shell assigns the expanded value. +.SS Parameter Expansion +.PP +The `\fB$\fP' character introduces parameter expansion, +command substitution, or arithmetic expansion. The parameter name +or symbol to be expanded may be enclosed in braces, which +are optional but serve to protect the variable to be expanded from +characters immediately following it which could be +interpreted as part of the name. +.PP +When braces are used, the matching ending brace is the first `\fB}\fP' +not escaped by a backslash or within a quoted string, and not within an +embedded arithmetic expansion, command substitution, or parameter +expansion. +.PP +.PD 0 +.TP +${\fIparameter\fP} +The value of \fIparameter\fP is substituted. The braces are required +when +.I parameter +is a positional parameter with more than one digit, +or when +.I parameter +is followed by a character which is not to be +interpreted as part of its name. +The \fIparameter\fP is a shell parameter as described above +\fBPARAMETERS\fP) or an array reference (\fBArrays\fP). +.PD +.PP +If the first character of \fIparameter\fP is an exclamation point (\fB!\fP), +it introduces a level of variable indirection. +\fBBash\fP uses the value of the variable formed from the rest of +\fIparameter\fP as the name of the variable; this variable is then +expanded and that value is used in the rest of the substitution, rather +than the value of \fIparameter\fP itself. +This is known as \fIindirect expansion\fP. +The exceptions to this are the expansions of ${\fB!\fP\fIprefix\fP\fB*\fP} and +${\fB!\fP\fIname\fP[\fI@\fP]} described below. +The exclamation point must immediately follow the left brace in order to +introduce indirection. +.PP +In each of the cases below, \fIword\fP is subject to tilde expansion, +parameter expansion, command substitution, and arithmetic expansion. +.PP +When not performing substring expansion, using the forms documented below +(e.g., \fB:-\fP), +\fBbash\fP tests for a parameter that is unset or null. Omitting the colon +results in a test only for a parameter that is unset. +.PP +.PD 0 +.TP +${\fIparameter\fP\fB:\-\fP\fIword\fP} +\fBUse Default Values\fP. If +.I parameter +is unset or null, the expansion of +.I word +is substituted. Otherwise, the value of +.I parameter +is substituted. +.TP +${\fIparameter\fP\fB:=\fP\fIword\fP} +\fBAssign Default Values\fP. +If +.I parameter +is unset or null, the expansion of +.I word +is assigned to +.IR parameter . +The value of +.I parameter +is then substituted. Positional parameters and special parameters may +not be assigned to in this way. +.TP +${\fIparameter\fP\fB:?\fP\fIword\fP} +\fBDisplay Error if Null or Unset\fP. +If +.I parameter +is null or unset, the expansion of \fIword\fP (or a message to that effect +if +.I word +is not present) is written to the standard error and the shell, if it +is not interactive, exits. Otherwise, the value of \fIparameter\fP is +substituted. +.TP +${\fIparameter\fP\fB:+\fP\fIword\fP} +\fBUse Alternate Value\fP. +If +.I parameter +is null or unset, nothing is substituted, otherwise the expansion of +.I word +is substituted. +.TP +${\fIparameter\fP\fB:\fP\fIoffset\fP} +.PD 0 +.TP +${\fIparameter\fP\fB:\fP\fIoffset\fP\fB:\fP\fIlength\fP} +.PD +\fBSubstring Expansion\fP. +Expands to up to \fIlength\fP characters of the value of \fIparameter\fP +starting at the character specified by \fIoffset\fP. +If \fIparameter\fP is \fB@\fP, an indexed array subscripted by +\fB@\fP or \fB*\fP, or an associative array name, the results differ as +described below. +If \fIlength\fP is omitted, expands to the substring of the value of +\fIparameter\fP starting at the character specified by \fIoffset\fP +and extending to the end of the value. +\fIlength\fP and \fIoffset\fP are arithmetic expressions (see +.SM +.B +ARITHMETIC EVALUATION +below). +.sp 1 +If \fIoffset\fP evaluates to a number less than zero, the value +is used as an offset in characters +from the end of the value of \fIparameter\fP. +If \fIlength\fP evaluates to a number less than zero, +it is interpreted as an offset in characters +from the end of the value of \fIparameter\fP rather than +a number of characters, and the expansion is the characters between +\fIoffset\fP and that result. +Note that a negative offset must be separated from the colon by at least +one space to avoid being confused with the \fB:-\fP expansion. +.sp 1 +If \fIparameter\fP is \fB@\fP, the result is \fIlength\fP positional +parameters beginning at \fIoffset\fP. +A negative \fIoffset\fP is taken relative to one greater than the greatest +positional parameter, so an offset of -1 evaluates to the last positional +parameter. +It is an expansion error if \fIlength\fP evaluates to a number less than +zero. +.sp 1 +If \fIparameter\fP is an indexed array name subscripted by @ or *, +the result is the \fIlength\fP +members of the array beginning with ${\fIparameter\fP[\fIoffset\fP]}. +A negative \fIoffset\fP is taken relative to one greater than the maximum +index of the specified array. +It is an expansion error if \fIlength\fP evaluates to a number less than +zero. +.sp 1 +Substring expansion applied to an associative array produces undefined +results. +.sp 1 +Substring indexing is zero-based unless the positional parameters +are used, in which case the indexing starts at 1 by default. +If \fIoffset\fP is 0, and the positional parameters are used, \fB$0\fP is +prefixed to the list. +.TP +${\fB!\fP\fIprefix\fP\fB*\fP} +.PD 0 +.TP +${\fB!\fP\fIprefix\fP\fB@\fP} +.PD +\fBNames matching prefix\fP. +Expands to the names of variables whose names begin with \fIprefix\fP, +separated by the first character of the +.SM +.B IFS +special variable. +When \fI@\fP is used and the expansion appears within double quotes, each +variable name expands to a separate word. +.TP +${\fB!\fP\fIname\fP[\fI@\fP]} +.PD 0 +.TP +${\fB!\fP\fIname\fP[\fI*\fP]} +.PD +\fBList of array keys\fP. +If \fIname\fP is an array variable, expands to the list of array indices +(keys) assigned in \fIname\fP. +If \fIname\fP is not an array, expands to 0 if \fIname\fP is set and null +otherwise. +When \fI@\fP is used and the expansion appears within double quotes, each +key expands to a separate word. +.TP +${\fB#\fP\fIparameter\fP} +\fBParameter length\fP. +The length in characters of the value of \fIparameter\fP is substituted. +If +.I parameter +is +.B * +or +.BR @ , +the value substituted is the number of positional parameters. +If +.I parameter +is an array name subscripted by +.B * +or +.BR @ , +the value substituted is the number of elements in the array. +If +.I parameter +is an indexed array name subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +\fIparameter\fP, so negative indices count back from the end of the +array, and an index of \-1 references the last element. +.TP +${\fIparameter\fP\fB#\fP\fIword\fP} +.PD 0 +.TP +${\fIparameter\fP\fB##\fP\fIword\fP} +.PD +\fBRemove matching prefix pattern\fP. +The +.I word +is expanded to produce a pattern just as in pathname +expansion. If the pattern matches the beginning of +the value of +.IR parameter , +then the result of the expansion is the expanded value of +.I parameter +with the shortest matching pattern (the ``\fB#\fP'' case) or the +longest matching pattern (the ``\fB##\fP'' case) deleted. +If +.I parameter +is +.B @ +or +.BR * , +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB%\fP\fIword\fP} +.PD 0 +.TP +${\fIparameter\fP\fB%%\fP\fIword\fP} +.PD +\fBRemove matching suffix pattern\fP. +The \fIword\fP is expanded to produce a pattern just as in +pathname expansion. +If the pattern matches a trailing portion of the expanded value of +.IR parameter , +then the result of the expansion is the expanded value of +.I parameter +with the shortest matching pattern (the ``\fB%\fP'' case) or the +longest matching pattern (the ``\fB%%\fP'' case) deleted. +If +.I parameter +is +.B @ +or +.BR * , +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB/\fP\fIpattern\fP\fB/\fP\fIstring\fP} +\fBPattern substitution\fP. +The \fIpattern\fP is expanded to produce a pattern just as in +pathname expansion. +\fIParameter\fP is expanded and the longest match of \fIpattern\fP +against its value is replaced with \fIstring\fP. +If \fIpattern\fP begins with \fB/\fP, all matches of \fIpattern\fP are +replaced with \fIstring\fP. Normally only the first match is replaced. +If \fIpattern\fP begins with \fB#\fP, it must match at the beginning +of the expanded value of \fIparameter\fP. +If \fIpattern\fP begins with \fB%\fP, it must match at the end +of the expanded value of \fIparameter\fP. +If \fIstring\fP is null, matches of \fIpattern\fP are deleted +and the \fB/\fP following \fIpattern\fP may be omitted. +If +.I parameter +is +.B @ +or +.BR * , +the substitution operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the substitution operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.TP +${\fIparameter\fP\fB^\fP\fIpattern\fP} +.PD 0 +.TP +${\fIparameter\fP\fB^^\fP\fIpattern\fP} +.TP +${\fIparameter\fP\fB,\fP\fIpattern\fP} +.TP +${\fIparameter\fP\fB,,\fP\fIpattern\fP} +.PD +\fBCase modification\fP. +This expansion modifies the case of alphabetic characters in \fIparameter\fP. +The \fIpattern\fP is expanded to produce a pattern just as in +pathname expansion. +Each character in the expanded value of \fIparameter\fP is tested against +\fIpattern\fP, and, if it matches the pattern, its case is converted. +The pattern should not attempt to match more than one character. +The \fB^\fP operator converts lowercase letters matching \fIpattern\fP +to uppercase; the \fB,\fP operator converts matching uppercase letters +to lowercase. +The \fB^^\fP and \fB,,\fP expansions convert each matched character in the +expanded value; the \fB^\fP and \fB,\fP expansions match and convert only +the first character in the expanded value. +If \fIpattern\fP is omitted, it is treated like a \fB?\fP, which matches +every character. +If +.I parameter +is +.B @ +or +.BR * , +the case modification operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +.I parameter +is an array variable subscripted with +.B @ +or +.BR * , +the case modification operation is applied to each member of the +array in turn, and the expansion is the resultant list. +.SS Command Substitution +.PP +\fICommand substitution\fP allows the output of a command to replace +the command name. There are two forms: +.RS +.PP +\fB$(\fP\fIcommand\fP\|\fB)\fP +.RE +or +.RS +\fB\`\fP\fIcommand\fP\fB\`\fP +.RE +.PP +.B Bash +performs the expansion by executing \fIcommand\fP and +replacing the command substitution with the standard output of the +command, with any trailing newlines deleted. +Embedded newlines are not deleted, but they may be removed during +word splitting. +The command substitution \fB$(cat \fIfile\fP)\fR can be replaced by +the equivalent but faster \fB$(< \fIfile\fP)\fR. +.PP +When the old-style backquote form of substitution is used, +backslash retains its literal meaning except when followed by +.BR $ , +.BR \` , +or +.BR \e . +The first backquote not preceded by a backslash terminates the +command substitution. +When using the $(\^\fIcommand\fP\|) form, all characters between the +parentheses make up the command; none are treated specially. +.PP +Command substitutions may be nested. To nest when using the backquoted form, +escape the inner backquotes with backslashes. +.PP +If the substitution appears within double quotes, word splitting and +pathname expansion are not performed on the results. +.SS Arithmetic Expansion +.PP +Arithmetic expansion allows the evaluation of an arithmetic expression +and the substitution of the result. The format for arithmetic expansion is: +.RS +.PP +\fB$((\fP\fIexpression\fP\fB))\fP +.RE +.PP +The old format \fB$[\fP\fIexpression\fP\fB]\fP is deprecated and will +be removed in upcoming versions of bash. +.PP +The +.I expression +is treated as if it were within double quotes, but a double quote +inside the parentheses is not treated specially. +All tokens in the expression undergo parameter and variable expansion, +command substitution, and quote removal. +The result is treated as the arithmetic expression to be evaluated. +Arithmetic expansions may be nested. +.PP +The evaluation is performed according to the rules listed below under +.SM +.BR "ARITHMETIC EVALUATION" . +If +.I expression +is invalid, +.B bash +prints a message indicating failure and no substitution occurs. +.SS Process Substitution +.PP +\fIProcess substitution\fP is supported on systems that support named +pipes (\fIFIFOs\fP) or the \fB/dev/fd\fP method of naming open files. +It takes the form of +\fB<(\fP\fIlist\^\fP\fB)\fP +or +\fB>(\fP\fIlist\^\fP\fB)\fP. +The process \fIlist\fP is run with its input or output connected to a +\fIFIFO\fP or some file in \fB/dev/fd\fP. The name of this file is +passed as an argument to the current command as the result of the +expansion. If the \fB>(\fP\fIlist\^\fP\fB)\fP form is used, writing to +the file will provide input for \fIlist\fP. If the +\fB<(\fP\fIlist\^\fP\fB)\fP form is used, the file passed as an +argument should be read to obtain the output of \fIlist\fP. +.PP +When available, process substitution is performed +simultaneously with parameter and variable expansion, +command substitution, +and arithmetic expansion. +.SS Word Splitting +.PP +The shell scans the results of +parameter expansion, +command substitution, +and +arithmetic expansion +that did not occur within double quotes for +.IR "word splitting" . +.PP +The shell treats each character of +.SM +.B IFS +as a delimiter, and splits the results of the other +expansions into words using these characters as field terminators. +If +.SM +.B IFS +is unset, or its +value is exactly +.BR , +the default, then +sequences of +.BR , +.BR , +and +.B +at the beginning and end of the results of the previous +expansions are ignored, and +any sequence of +.SM +.B IFS +characters not at the beginning or end serves to delimit words. +If +.SM +.B IFS +has a value other than the default, then sequences of +the whitespace characters +.B space +and +.B tab +are ignored at the beginning and end of the +word, as long as the whitespace character is in the +value of +.SM +.BR IFS +(an +.SM +.B IFS +whitespace character). +Any character in +.SM +.B IFS +that is not +.SM +.B IFS +whitespace, along with any adjacent +.SM +.B IFS +whitespace characters, delimits a field. +A sequence of +.SM +.B IFS +whitespace characters is also treated as a delimiter. +If the value of +.SM +.B IFS +is null, no word splitting occurs. +.PP +Explicit null arguments (\^\f3"\^"\fP or \^\f3\(aq\^\(aq\fP\^) are retained. +Unquoted implicit null arguments, resulting from the expansion of +parameters that have no values, are removed. +If a parameter with no value is expanded within double quotes, a +null argument results and is retained. +.PP +Note that if no expansion occurs, no splitting +is performed. +.SS Pathname Expansion +.PP +After word splitting, +unless the +.B \-f +option has been set, +.B bash +scans each word for the characters +.BR * , +.BR ? , +and +.BR [ . +If one of these characters appears, then the word is +regarded as a +.IR pattern , +and replaced with an alphabetically sorted list of +filenames matching the pattern +(see +.SM +.B "Pattern Matching" +below). +If no matching filenames are found, +and the shell option +.B nullglob +is not enabled, the word is left unchanged. +If the +.B nullglob +option is set, and no matches are found, +the word is removed. +If the +.B failglob +shell option is set, and no matches are found, an error message +is printed and the command is not executed. +If the shell option +.B nocaseglob +is enabled, the match is performed without regard to the case +of alphabetic characters. +Note that when using range expressions like +[a-z] (see below), letters of the other case may be included, +depending on the setting of +.B LC_COLLATE. +When a pattern is used for pathname expansion, +the character +.B ``.'' +at the start of a name or immediately following a slash +must be matched explicitly, unless the shell option +.B dotglob +is set. +When matching a pathname, the slash character must always be +matched explicitly. +In other cases, the +.B ``.'' +character is not treated specially. +See the description of +.B shopt +below under +.SM +.B SHELL BUILTIN COMMANDS +for a description of the +.BR nocaseglob , +.BR nullglob , +.BR failglob , +and +.B dotglob +shell options. +.PP +The +.SM +.B GLOBIGNORE +shell variable may be used to restrict the set of filenames matching a +.IR pattern . +If +.SM +.B GLOBIGNORE +is set, each matching filename that also matches one of the patterns in +.SM +.B GLOBIGNORE +is removed from the list of matches. +The filenames +.B ``.'' +and +.B ``..'' +are always ignored when +.SM +.B GLOBIGNORE +is set and not null. However, setting +.SM +.B GLOBIGNORE +to a non-null value has the effect of enabling the +.B dotglob +shell option, so all other filenames beginning with a +.B ``.'' +will match. +To get the old behavior of ignoring filenames beginning with a +.BR ``.'' , +make +.B ``.*'' +one of the patterns in +.SM +.BR GLOBIGNORE . +The +.B dotglob +option is disabled when +.SM +.B GLOBIGNORE +is unset. +.PP +\fBPattern Matching\fP +.PP +Any character that appears in a pattern, other than the special pattern +characters described below, matches itself. The NUL character may not +occur in a pattern. A backslash escapes the following character; the +escaping backslash is discarded when matching. +The special pattern characters must be quoted if +they are to be matched literally. +.PP +The special pattern characters have the following meanings: +.PP +.PD 0 +.RS +.TP +.B * +Matches any string, including the null string. +When the \fBglobstar\fP shell option is enabled, and \fB*\fP is used in +a pathname expansion context, two adjacent \fB*\fPs used as a single +pattern will match all files and zero or more directories and +subdirectories. +If followed by a \fB/\fP, two adjacent \fB*\fPs will match only directories +and subdirectories. +.TP +.B ? +Matches any single character. +.TP +.B [...] +Matches any one of the enclosed characters. A pair of characters +separated by a hyphen denotes a +\fIrange expression\fP; +any character that falls between those two characters, inclusive, +using the current locale's collating sequence and character set, +is matched. If the first character following the +.B [ +is a +.B ! +or a +.B ^ +then any character not enclosed is matched. +The sorting order of characters in range expressions is determined by +the current locale and the values of the +.SM +.B LC_COLLATE +or +.SM +.B LC_ALL +shell variables, if set. +To obtain the traditional interpretation of range expressions, where +.B [a\-d] +is equivalent to +.BR [abcd] , +set value of the +.B LC_ALL +shell variable to +.BR C , +or enable the +.B globasciiranges +shell option. +A +.B \- +may be matched by including it as the first or last character +in the set. +A +.B ] +may be matched by including it as the first character +in the set. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +\fIcharacter classes\fP can be specified using the syntax +\fB[:\fP\fIclass\fP\fB:]\fP, where \fIclass\fP is one of the +following classes defined in the POSIX standard: +.PP +.RS +.B +.if n alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit +.if t alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit +.br +A character class matches any character belonging to that class. +The \fBword\fP character class matches letters, digits, and the character _. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +an \fIequivalence class\fP can be specified using the syntax +\fB[=\fP\fIc\fP\fB=]\fP, which matches all characters with the +same collation weight (as defined by the current locale) as +the character \fIc\fP. +.br +.if t .sp 0.5 +.if n .sp 1 +Within +.B [ +and +.BR ] , +the syntax \fB[.\fP\fIsymbol\fP\fB.]\fP matches the collating symbol +\fIsymbol\fP. +.RE +.RE +.PD +.PP +If the \fBextglob\fP shell option is enabled using the \fBshopt\fP +builtin, several extended pattern matching operators are recognized. +In the following description, a \fIpattern-list\fP is a list of one +or more patterns separated by a \fB|\fP. +Composite patterns may be formed using one or more of the following +sub-patterns: +.sp 1 +.PD 0 +.RS +.TP +\fB?(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches zero or one occurrence of the given patterns +.TP +\fB*(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches zero or more occurrences of the given patterns +.TP +\fB+(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches one or more occurrences of the given patterns +.TP +\fB@(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches one of the given patterns +.TP +\fB!(\fP\^\fIpattern-list\^\fP\fB)\fP +Matches anything except one of the given patterns +.RE +.PD +.SS Quote Removal +.PP +After the preceding expansions, all unquoted occurrences of the +characters +.BR \e , +.BR \(aq , +and \^\f3"\fP\^ that did not result from one of the above +expansions are removed. +.SH REDIRECTION +Before a command is executed, its input and output +may be +.I redirected +using a special notation interpreted by the shell. +Redirection allows commands' file handles to be +duplicated, opened, closed, +made to refer to different files, +and can change the files the command reads from and writes to. +Redirection may also be used to modify file handles in the +current shell execution environment. +The following redirection +operators may precede or appear anywhere within a +.I simple command +or may follow a +.IR command . +Redirections are processed in the order they appear, from +left to right. +.PP +Each redirection that may be preceded by a file descriptor number +may instead be preceded by a word of the form {\fIvarname\fP}. +In this case, for each redirection operator except +>&- and <&-, the shell will allocate a file descriptor greater +than or equal to 10 and assign it to \fIvarname\fP. +If >&- or <&- is preceded +by {\fIvarname\fP}, the value of \fIvarname\fP defines the file +descriptor to close. +.PP +In the following descriptions, if the file descriptor number is +omitted, and the first character of the redirection operator is +.BR < , +the redirection refers to the standard input (file descriptor +0). If the first character of the redirection operator is +.BR > , +the redirection refers to the standard output (file descriptor +1). +.PP +The word following the redirection operator in the following +descriptions, unless otherwise noted, is subjected to +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, quote removal, +pathname expansion, and word splitting. +If it expands to more than one word, +.B bash +reports an error. +.PP +Note that the order of redirections is significant. For example, +the command +.RS +.PP +ls \fB>\fP dirlist 2\fB>&\fP1 +.RE +.PP +directs both standard output and standard error to the file +.IR dirlist , +while the command +.RS +.PP +ls 2\fB>&\fP1 \fB>\fP dirlist +.RE +.PP +directs only the standard output to file +.IR dirlist , +because the standard error was duplicated from the standard output +before the standard output was redirected to +.IR dirlist . +.PP +\fBBash\fP handles several filenames specially when they are used in +redirections, as described in the following table: +.RS +.PP +.PD 0 +.TP +.B /dev/fd/\fIfd\fP +If \fIfd\fP is a valid integer, file descriptor \fIfd\fP is duplicated. +.TP +.B /dev/stdin +File descriptor 0 is duplicated. +.TP +.B /dev/stdout +File descriptor 1 is duplicated. +.TP +.B /dev/stderr +File descriptor 2 is duplicated. +.TP +.B /dev/tcp/\fIhost\fP/\fIport\fP +If \fIhost\fP is a valid hostname or Internet address, and \fIport\fP +is an integer port number or service name, \fBbash\fP attempts to open +the corresponding TCP socket. +.TP +.B /dev/udp/\fIhost\fP/\fIport\fP +If \fIhost\fP is a valid hostname or Internet address, and \fIport\fP +is an integer port number or service name, \fBbash\fP attempts to open +the corresponding UDP socket. +.PD +.RE +.PP +A failure to open or create a file causes the redirection to fail. +.PP +Redirections using file descriptors greater than 9 should be used with +care, as they may conflict with file descriptors the shell uses +internally. +.PP +Note that the +.B exec +builtin command can make redirections take effect in the current shell. +.SS Redirecting Input +.PP +Redirection of input causes the file whose name results from +the expansion of +.I word +to be opened for reading on file descriptor +.IR n , +or the standard input (file descriptor 0) if +.I n +is not specified. +.PP +The general format for redirecting input is: +.RS +.PP +[\fIn\fP]\fB<\fP\fIword\fP +.RE +.SS Redirecting Output +.PP +Redirection of output causes the file whose name results from +the expansion of +.I word +to be opened for writing on file descriptor +.IR n , +or the standard output (file descriptor 1) if +.I n +is not specified. If the file does not exist it is created; +if it does exist it is truncated to zero size. +.PP +The general format for redirecting output is: +.RS +.PP +[\fIn\fP]\fB>\fP\fIword\fP +.RE +.PP +If the redirection operator is +.BR > , +and the +.B noclobber +option to the +.B set +builtin has been enabled, the redirection will fail if the file +whose name results from the expansion of \fIword\fP exists and is +a regular file. +If the redirection operator is +.BR >| , +or the redirection operator is +.B > +and the +.B noclobber +option to the +.B set +builtin command is not enabled, the redirection is attempted even +if the file named by \fIword\fP exists. +.SS Appending Redirected Output +.PP +Redirection of output in this fashion +causes the file whose name results from +the expansion of +.I word +to be opened for appending on file descriptor +.IR n , +or the standard output (file descriptor 1) if +.I n +is not specified. If the file does not exist it is created. +.PP +The general format for appending output is: +.RS +.PP +[\fIn\fP]\fB>>\fP\fIword\fP +.RE +.PP +.SS Redirecting Standard Output and Standard Error +.PP +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be redirected to the file whose name is the +expansion of +.IR word . +.PP +There are two formats for redirecting standard output and +standard error: +.RS +.PP +\fB&>\fP\fIword\fP +.RE +and +.RS +\fB>&\fP\fIword\fP +.RE +.PP +Of the two forms, the first is preferred. +This is semantically equivalent to +.RS +.PP +\fB>\fP\fIword\fP 2\fB>&\fP1 +.RE +.PP +When using the second form, \fIword\fP may not expand to a number or +\fB\-\fP. If it does, other redirection operators apply +(see \fBDuplicating File Descriptors\fP below) for compatibility +reasons. +.SS Appending Standard Output and Standard Error +.PP +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be appended to the file whose name is the +expansion of +.IR word . +.PP +The format for appending standard output and standard error is: +.RS +.PP +\fB&>>\fP\fIword\fP +.RE +.PP +This is semantically equivalent to +.RS +.PP +\fB>>\fP\fIword\fP 2\fB>&\fP1 +.RE +.PP +(see \fBDuplicating File Descriptors\fP below). +.SS Here Documents +.PP +This type of redirection instructs the shell to read input from the +current source until a line containing only +.I delimiter +(with no trailing blanks) +is seen. All of +the lines read up to that point are then used as the standard +input for a command. +.PP +The format of here-documents is: +.RS +.PP +.nf +\fB<<\fP[\fB\-\fP]\fIword\fP + \fIhere-document\fP +\fIdelimiter\fP +.fi +.RE +.PP +No parameter and variable expansion, command substitution, +arithmetic expansion, or pathname expansion is performed on +.IR word . +If any characters in +.I word +are quoted, the +.I delimiter +is the result of quote removal on +.IR word , +and the lines in the here-document are not expanded. +If \fIword\fP is unquoted, +all lines of the here-document are subjected to +parameter expansion, command substitution, and arithmetic expansion, +the character sequence +.B \e +is ignored, and +.B \e +must be used to quote the characters +.BR \e , +.BR $ , +and +.BR \` . +.PP +If the redirection operator is +.BR <<\- , +then all leading tab characters are stripped from input lines and the +line containing +.IR delimiter . +This allows +here-documents within shell scripts to be indented in a +natural fashion. +.SS "Here Strings" +A variant of here documents, the format is: +.RS +.PP +.nf +\fB<<<\fP\fIword\fP +.fi +.RE +.PP +The \fIword\fP undergoes +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote removal. +Pathname expansion and word splitting are not performed. +The result is supplied as a single string to the command on its +standard input. +.SS "Duplicating File Descriptors" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<&\fP\fIword\fP +.RE +.PP +is used to duplicate input file descriptors. +If +.I word +expands to one or more digits, the file descriptor denoted by +.I n +is made to be a copy of that file descriptor. +If the digits in +.I word +do not specify a file descriptor open for input, a redirection error occurs. +If +.I word +evaluates to +.BR \- , +file descriptor +.I n +is closed. If +.I n +is not specified, the standard input (file descriptor 0) is used. +.PP +The operator +.RS +.PP +[\fIn\fP]\fB>&\fP\fIword\fP +.RE +.PP +is used similarly to duplicate output file descriptors. If +.I n +is not specified, the standard output (file descriptor 1) is used. +If the digits in +.I word +do not specify a file descriptor open for output, a redirection error occurs. +If +.I word +evaluates to +.BR \- , +file descriptor +.I n +is closed. +As a special case, if \fIn\fP is omitted, and \fIword\fP does not +expand to one or more digits or \fB\-\fP, the standard output and standard +error are redirected as described previously. +.SS "Moving File Descriptors" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<&\fP\fIdigit\fP\fB\-\fP +.RE +.PP +moves the file descriptor \fIdigit\fP to file descriptor +.IR n , +or the standard input (file descriptor 0) if \fIn\fP is not specified. +\fIdigit\fP is closed after being duplicated to \fIn\fP. +.PP +Similarly, the redirection operator +.RS +.PP +[\fIn\fP]\fB>&\fP\fIdigit\fP\fB\-\fP +.RE +.PP +moves the file descriptor \fIdigit\fP to file descriptor +.IR n , +or the standard output (file descriptor 1) if \fIn\fP is not specified. +.SS "Opening File Descriptors for Reading and Writing" +.PP +The redirection operator +.RS +.PP +[\fIn\fP]\fB<>\fP\fIword\fP +.RE +.PP +causes the file whose name is the expansion of +.I word +to be opened for both reading and writing on file descriptor +.IR n , +or on file descriptor 0 if +.I n +is not specified. If the file does not exist, it is created. +.SH ALIASES +\fIAliases\fP allow a string to be substituted for a word when it is used +as the first word of a simple command. +The shell maintains a list of aliases that may be set and unset with the +.B alias +and +.B unalias +builtin commands (see +.SM +.B SHELL BUILTIN COMMANDS +below). +The first word of each simple command, if unquoted, +is checked to see if it has an +alias. If so, that word is replaced by the text of the alias. +The characters \fB/\fP, \fB$\fP, \fB\`\fP, and \fB=\fP and +any of the shell \fImetacharacters\fP or quoting characters +listed above may not appear in an alias name. +The replacement text may contain any valid shell input, +including shell metacharacters. +The first word of the replacement text is tested +for aliases, but a word that is identical to an alias being expanded +is not expanded a second time. +This means that one may alias +.B ls +to +.BR "ls \-F" , +for instance, and +.B bash +does not try to recursively expand the replacement text. +If the last character of the alias value is a +.IR blank , +then the next command +word following the alias is also checked for alias expansion. +.PP +Aliases are created and listed with the +.B alias +command, and removed with the +.B unalias +command. +.PP +There is no mechanism for using arguments in the replacement text. +If arguments are needed, a shell function should be used (see +.SM +.B FUNCTIONS +below). +.PP +Aliases are not expanded when the shell is not interactive, unless +the +.B expand_aliases +shell option is set using +.B shopt +(see the description of +.B shopt +under +.SM +\fBSHELL BUILTIN COMMANDS\fP +below). +.PP +The rules concerning the definition and use of aliases are +somewhat confusing. +.B Bash +always reads at least one complete line +of input before executing any +of the commands on that line. Aliases are expanded when a +command is read, not when it is executed. Therefore, an +alias definition appearing on the same line as another +command does not take effect until the next line of input is read. +The commands following the alias definition +on that line are not affected by the new alias. +This behavior is also an issue when functions are executed. +Aliases are expanded when a function definition is read, +not when the function is executed, because a function definition +is itself a compound command. As a consequence, aliases +defined in a function are not available until after that +function is executed. To be safe, always put +alias definitions on a separate line, and do not use +.B alias +in compound commands. +.PP +For almost every purpose, aliases are superseded by +shell functions. +.SH FUNCTIONS +A shell function, defined as described above under +.SM +.BR "SHELL GRAMMAR" , +stores a series of commands for later execution. +When the name of a shell function is used as a simple command name, +the list of commands associated with that function name is executed. +Functions are executed in the context of the +current shell; no new process is created to interpret +them (contrast this with the execution of a shell script). +When a function is executed, the arguments to the +function become the positional parameters +during its execution. +The special parameter +.B # +is updated to reflect the change. Special parameter \fB0\fP +is unchanged. +The first element of the +.SM +.B FUNCNAME +variable is set to the name of the function while the function +is executing. +.PP +All other aspects of the shell execution +environment are identical between a function and its caller +with these exceptions: the +.SM +.B DEBUG +and +.B RETURN +traps (see the description of the +.B trap +builtin under +.SM +.B SHELL BUILTIN COMMANDS +below) are not inherited unless the function has been given the +\fBtrace\fP attribute (see the description of the +.SM +.B declare +builtin below) or the +\fB\-o functrace\fP shell option has been enabled with +the \fBset\fP builtin +(in which case all functions inherit the \fBDEBUG\fP and \fBRETURN\fP traps), +and the +.SM +.B ERR +trap is not inherited unless the \fB\-o errtrace\fP shell option has +been enabled. +.PP +Variables local to the function may be declared with the +.B local +builtin command. Ordinarily, variables and their values +are shared between the function and its caller. +.PP +The \fBFUNCNEST\fP variable, if set to a numeric value greater +than 0, defines a maximum function nesting level. Function +invocations that exceed the limit cause the entire command to +abort. +.PP +If the builtin command +.B return +is executed in a function, the function completes and +execution resumes with the next command after the function +call. +Any command associated with the \fBRETURN\fP trap is executed +before execution resumes. +When a function completes, the values of the +positional parameters and the special parameter +.B # +are restored to the values they had prior to the function's +execution. +.PP +Function names and definitions may be listed with the +.B \-f +option to the +.B declare +or +.B typeset +builtin commands. The +.B \-F +option to +.B declare +or +.B typeset +will list the function names only +(and optionally the source file and line number, if the \fBextdebug\fP +shell option is enabled). +Functions may be exported so that subshells +automatically have them defined with the +.B \-f +option to the +.B export +builtin. +A function definition may be deleted using the \fB\-f\fP option to +the +.B unset +builtin. +Note that shell functions and variables with the same name may result +in multiple identically-named entries in the environment passed to the +shell's children. +Care should be taken in cases where this may cause a problem. +.PP +Functions may be recursive. +The \fBFUNCNEST\fP variable may be used to limit the depth of the +function call stack and restrict the number of function invocations. +By default, no limit is imposed on the number of recursive calls. +.SH "ARITHMETIC EVALUATION" +The shell allows arithmetic expressions to be evaluated, under +certain circumstances (see the \fBlet\fP and \fBdeclare\fP builtin +commands and \fBArithmetic Expansion\fP). +Evaluation is done in fixed-width integers with no check for overflow, +though division by 0 is trapped and flagged as an error. +The operators and their precedence, associativity, and values +are the same as in the C language. +The following list of operators is grouped into levels of +equal-precedence operators. +The levels are listed in order of decreasing precedence. +.PP +.PD 0 +.TP +.B \fIid\fP++ \fIid\fP\-\- +variable post-increment and post-decrement +.TP +.B ++\fIid\fP \-\-\fIid\fP +variable pre-increment and pre-decrement +.TP +.B \- + +unary minus and plus +.TP +.B ! ~ +logical and bitwise negation +.TP +.B ** +exponentiation +.TP +.B * / % +multiplication, division, remainder +.TP +.B + \- +addition, subtraction +.TP +.B << >> +left and right bitwise shifts +.TP +.B <= >= < > +comparison +.TP +.B == != +equality and inequality +.TP +.B & +bitwise AND +.TP +.B ^ +bitwise exclusive OR +.TP +.B | +bitwise OR +.TP +.B && +logical AND +.TP +.B || +logical OR +.TP +.B \fIexpr\fP?\fIexpr\fP:\fIexpr\fP +conditional operator +.TP +.B = *= /= %= += \-= <<= >>= &= ^= |= +assignment +.TP +.B \fIexpr1\fP , \fIexpr2\fP +comma +.PD +.PP +Shell variables are allowed as operands; parameter expansion is +performed before the expression is evaluated. +Within an expression, shell variables may also be referenced by name +without using the parameter expansion syntax. +A shell variable that is null or unset evaluates to 0 when referenced +by name without using the parameter expansion syntax. +The value of a variable is evaluated as an arithmetic expression +when it is referenced, or when a variable which has been given the +\fIinteger\fP attribute using \fBdeclare -i\fP is assigned a value. +A null value evaluates to 0. +A shell variable need not have its \fIinteger\fP attribute +turned on to be used in an expression. +.PP +Constants with a leading 0 are interpreted as octal numbers. +A leading 0x or 0X denotes hexadecimal. +Otherwise, numbers take the form [\fIbase#\fP]n, where the optional \fIbase\fP +is a decimal number between 2 and 64 representing the arithmetic +base, and \fIn\fP is a number in that base. +If \fIbase#\fP is omitted, then base 10 is used. +When specifying \fIn\fP, +the digits greater< than 9 are represented by the lowercase letters, +the uppercase letters, @, and _, in that order. +If \fIbase\fP is less than or equal to 36, lowercase and uppercase +letters may be used interchangeably to represent numbers between 10 +and 35. +.PP +Operators are evaluated in order of precedence. Sub-expressions in +parentheses are evaluated first and may override the precedence +rules above. +.SH "CONDITIONAL EXPRESSIONS" +Conditional expressions are used by the \fB[[\fP compound command and +the \fBtest\fP and \fB[\fP builtin commands to test file attributes +and perform string and arithmetic comparisons. +Expressions are formed from the following unary or binary primaries. +If any \fIfile\fP argument to one of the primaries is of the form +\fI/dev/fd/n\fP, then file descriptor \fIn\fP is checked. +If the \fIfile\fP argument to one of the primaries is one of +\fI/dev/stdin\fP, \fI/dev/stdout\fP, or \fI/dev/stderr\fP, file +descriptor 0, 1, or 2, respectively, is checked. +.PP +Unless otherwise specified, primaries that operate on files follow symbolic +links and operate on the target of the link, rather than the link itself. +.if t .sp 0.5 +.if n .sp 1 +When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort +lexicographically using the current locale. +The \fBtest\fP command sorts using ASCII ordering. +.sp 1 +.PD 0 +.TP +.B \-a \fIfile\fP +True if \fIfile\fP exists. +.TP +.B \-b \fIfile\fP +True if \fIfile\fP exists and is a block special file. +.TP +.B \-c \fIfile\fP +True if \fIfile\fP exists and is a character special file. +.TP +.B \-d \fIfile\fP +True if \fIfile\fP exists and is a directory. +.TP +.B \-e \fIfile\fP +True if \fIfile\fP exists. +.TP +.B \-f \fIfile\fP +True if \fIfile\fP exists and is a regular file. +.TP +.B \-g \fIfile\fP +True if \fIfile\fP exists and is set-group-id. +.TP +.B \-h \fIfile\fP +True if \fIfile\fP exists and is a symbolic link. +.TP +.B \-k \fIfile\fP +True if \fIfile\fP exists and its ``sticky'' bit is set. +.TP +.B \-p \fIfile\fP +True if \fIfile\fP exists and is a named pipe (FIFO). +.TP +.B \-r \fIfile\fP +True if \fIfile\fP exists and is readable. +.TP +.B \-s \fIfile\fP +True if \fIfile\fP exists and has a size greater than zero. +.TP +.B \-t \fIfd\fP +True if file descriptor +.I fd +is open and refers to a terminal. +.TP +.B \-u \fIfile\fP +True if \fIfile\fP exists and its set-user-id bit is set. +.TP +.B \-w \fIfile\fP +True if \fIfile\fP exists and is writable. +.TP +.B \-x \fIfile\fP +True if \fIfile\fP exists and is executable. +.TP +.B \-G \fIfile\fP +True if \fIfile\fP exists and is owned by the effective group id. +.TP +.B \-L \fIfile\fP +True if \fIfile\fP exists and is a symbolic link. +.TP +.B \-N \fIfile\fP +True if \fIfile\fP exists and has been modified since it was last read. +.TP +.B \-O \fIfile\fP +True if \fIfile\fP exists and is owned by the effective user id. +.TP +.B \-S \fIfile\fP +True if \fIfile\fP exists and is a socket. +.TP +\fIfile1\fP \fB\-ef\fP \fIfile2\fP +True if \fIfile1\fP and \fIfile2\fP refer to the same device and +inode numbers. +.TP +\fIfile1\fP \-\fBnt\fP \fIfile2\fP +True if \fIfile1\fP is newer (according to modification date) than \fIfile2\fP, +or if \fIfile1\fP exists and \fPfile2\fP does not. +.TP +\fIfile1\fP \-\fBot\fP \fIfile2\fP +True if \fIfile1\fP is older than \fIfile2\fP, or if \fIfile2\fP exists +and \fIfile1\fP does not. +.TP +.B \-o \fIoptname\fP +True if the shell option +.I optname +is enabled. +See the list of options under the description of the +.B \-o +option to the +.B set +builtin below. +.TP +.B \-v \fIvarname\fP +True if the shell variable +.I varname +is set (has been assigned a value). +.TP +.B \-R \fIvarname\fP +True if the shell variable +.I varname +is set and is a name reference. +.TP +.B \-z \fIstring\fP +True if the length of \fIstring\fP is zero. +.TP +\fIstring\fP +.PD 0 +.TP +.B \-n \fIstring\fP +.PD +True if the length of +.I string +is non-zero. +.TP +\fIstring1\fP \fB==\fP \fIstring2\fP +.PD 0 +.TP +\fIstring1\fP \fB=\fP \fIstring2\fP +.PD +True if the strings are equal. \fB=\fP should be used +with the \fBtest\fP command for POSIX conformance. +When used with the \fB[[\fP command, this performs pattern matching as +described above (\fBCompound Commands\fP). +.TP +\fIstring1\fP \fB!=\fP \fIstring2\fP +True if the strings are not equal. +.TP +\fIstring1\fP \fB<\fP \fIstring2\fP +True if \fIstring1\fP sorts before \fIstring2\fP lexicographically. +.TP +\fIstring1\fP \fB>\fP \fIstring2\fP +True if \fIstring1\fP sorts after \fIstring2\fP lexicographically. +.TP +.I \fIarg1\fP \fBOP\fP \fIarg2\fP +.SM +.B OP +is one of +.BR \-eq , +.BR \-ne , +.BR \-lt , +.BR \-le , +.BR \-gt , +or +.BR \-ge . +These arithmetic binary operators return true if \fIarg1\fP +is equal to, not equal to, less than, less than or equal to, +greater than, or greater than or equal to \fIarg2\fP, respectively. +.I Arg1 +and +.I arg2 +may be positive or negative integers. +.PD +.SH "SIMPLE COMMAND EXPANSION" +When a simple command is executed, the shell performs the following +expansions, assignments, and redirections, from left to right. +.IP 1. +The words that the parser has marked as variable assignments (those +preceding the command name) and redirections are saved for later +processing. +.IP 2. +The words that are not variable assignments or redirections are +expanded. If any words remain after expansion, the first word +is taken to be the name of the command and the remaining words are +the arguments. +.IP 3. +Redirections are performed as described above under +.SM +.BR REDIRECTION . +.IP 4. +The text after the \fB=\fP in each variable assignment undergoes tilde +expansion, parameter expansion, command substitution, arithmetic expansion, +and quote removal before being assigned to the variable. +.PP +If no command name results, the variable assignments affect the current +shell environment. Otherwise, the variables are added to the environment +of the executed command and do not affect the current shell environment. +If any of the assignments attempts to assign a value to a readonly variable, +an error occurs, and the command exits with a non-zero status. +.PP +If no command name results, redirections are performed, but do not +affect the current shell environment. A redirection error causes the +command to exit with a non-zero status. +.PP +If there is a command name left after expansion, execution proceeds as +described below. Otherwise, the command exits. If one of the expansions +contained a command substitution, the exit status of the command is +the exit status of the last command substitution performed. If there +were no command substitutions, the command exits with a status of zero. +.SH "COMMAND EXECUTION" +After a command has been split into words, if it results in a +simple command and an optional list of arguments, the following +actions are taken. +.PP +If the command name contains no slashes, the shell attempts to +locate it. If there exists a shell function by that name, that +function is invoked as described above in +.SM +.BR FUNCTIONS . +If the name does not match a function, the shell searches for +it in the list of shell builtins. If a match is found, that +builtin is invoked. +.PP +If the name is neither a shell function nor a builtin, +and contains no slashes, +.B bash +searches each element of the +.SM +.B PATH +for a directory containing an executable file by that name. +.B Bash +uses a hash table to remember the full pathnames of executable +files (see +.B hash +under +.SM +.B "SHELL BUILTIN COMMANDS" +below). +A full search of the directories in +.SM +.B PATH +is performed only if the command is not found in the hash table. +If the search is unsuccessful, the shell searches for a defined shell +function named \fBcommand_not_found_handle\fP. +If that function exists, it is invoked with the original command and +the original command's arguments as its arguments, and the function's +exit status becomes the exit status of the shell. +If that function is not defined, the shell prints an error +message and returns an exit status of 127. +.PP +If the search is successful, or if the command name contains +one or more slashes, the shell executes the named program in a +separate execution environment. +Argument 0 is set to the name given, and the remaining arguments +to the command are set to the arguments given, if any. +.PP +If this execution fails because the file is not in executable +format, and the file is not a directory, it is assumed to be +a \fIshell script\fP, a file +containing shell commands. A subshell is spawned to execute +it. This subshell reinitializes itself, so +that the effect is as if a new shell had been invoked +to handle the script, with the exception that the locations of +commands remembered by the parent (see +.B hash +below under +.SM +\fBSHELL BUILTIN COMMANDS\fP) +are retained by the child. +.PP +If the program is a file beginning with +.BR #! , +the remainder of the first line specifies an interpreter +for the program. The shell executes the +specified interpreter on operating systems that do not +handle this executable format themselves. The arguments to the +interpreter consist of a single optional argument following the +interpreter name on the first line of the program, followed +by the name of the program, followed by the command +arguments, if any. +.SH COMMAND EXECUTION ENVIRONMENT +The shell has an \fIexecution environment\fP, which consists of the +following: +.IP \(bu +open files inherited by the shell at invocation, as modified by +redirections supplied to the \fBexec\fP builtin +.IP \(bu +the current working directory as set by \fBcd\fP, \fBpushd\fP, or +\fBpopd\fP, or inherited by the shell at invocation +.IP \(bu +the file creation mode mask as set by \fBumask\fP or inherited from +the shell's parent +.IP \(bu +current traps set by \fBtrap\fP +.IP \(bu +shell parameters that are set by variable assignment or with \fBset\fP +or inherited from the shell's parent in the environment +.IP \(bu +shell functions defined during execution or inherited from the shell's +parent in the environment +.IP \(bu +options enabled at invocation (either by default or with command-line +arguments) or by \fBset\fP +.IP \(bu +options enabled by \fBshopt\fP +.IP \(bu +shell aliases defined with \fBalias\fP +.IP \(bu +various process IDs, including those of background jobs, the value +of \fB$$\fP, and the value of +.SM +.B PPID +.PP +When a simple command other than a builtin or shell function +is to be executed, it +is invoked in a separate execution environment that consists of +the following. Unless otherwise noted, the values are inherited +from the shell. +.if n .sp 1 +.IP \(bu +the shell's open files, plus any modifications and additions specified +by redirections to the command +.IP \(bu +the current working directory +.IP \(bu +the file creation mode mask +.IP \(bu +shell variables and functions marked for export, along with variables +exported for the command, passed in the environment +.IP \(bu +traps caught by the shell are reset to the values inherited from the +shell's parent, and traps ignored by the shell are ignored +.PP +A command invoked in this separate environment cannot affect the +shell's execution environment. +.PP +Command substitution, commands grouped with parentheses, +and asynchronous commands are invoked in a +subshell environment that is a duplicate of the shell environment, +except that traps caught by the shell are reset to the values +that the shell inherited from its parent at invocation. Builtin +commands that are invoked as part of a pipeline are also executed in a +subshell environment. Changes made to the subshell environment +cannot affect the shell's execution environment. +.PP +Subshells spawned to execute command substitutions inherit the value of +the \fB\-e\fP option from the parent shell. When not in \fIposix\fP mode, +\fBbash\fP clears the \fB\-e\fP option in such subshells. +.PP +If a command is followed by a \fB&\fP and job control is not active, the +default standard input for the command is the empty file \fI/dev/null\fP. +Otherwise, the invoked command inherits the file descriptors of the calling +shell as modified by redirections. +.SH ENVIRONMENT +When a program is invoked it is given an array of strings +called the +.IR environment . +This is a list of +\fIname\fP\-\fIvalue\fP pairs, of the form +.IR "name\fR=\fPvalue" . +.PP +The shell provides several ways to manipulate the environment. +On invocation, the shell scans its own environment and +creates a parameter for each name found, automatically marking +it for +.I export +to child processes. Executed commands inherit the environment. +The +.B export +and +.B declare \-x +commands allow parameters and functions to be added to and +deleted from the environment. If the value of a parameter +in the environment is modified, the new value becomes part +of the environment, replacing the old. The environment +inherited by any executed command consists of the shell's +initial environment, whose values may be modified in the shell, +less any pairs removed by the +.B unset +command, plus any additions via the +.B export +and +.B declare \-x +commands. +.PP +The environment for any +.I simple command +or function may be augmented temporarily by prefixing it with +parameter assignments, as described above in +.SM +.BR PARAMETERS . +These assignment statements affect only the environment seen +by that command. +.PP +If the +.B \-k +option is set (see the +.B set +builtin command below), then +.I all +parameter assignments are placed in the environment for a command, +not just those that precede the command name. +.PP +When +.B bash +invokes an external command, the variable +.B _ +is set to the full filename of the command and passed to that +command in its environment. +.SH "EXIT STATUS" +.PP +The exit status of an executed command is the value returned by the +\fIwaitpid\fP system call or equivalent function. Exit statuses +fall between 0 and 255, though, as explained below, the shell may +use values above 125 specially. Exit statuses from shell builtins and +compound commands are also limited to this range. Under certain +circumstances, the shell will use special values to indicate specific +failure modes. +.PP +For the shell's purposes, a command which exits with a +zero exit status has succeeded. An exit status of zero +indicates success. A non-zero exit status indicates failure. +When a command terminates on a fatal signal \fIN\fP, \fBbash\fP uses +the value of 128+\fIN\fP as the exit status. +.PP +If a command is not found, the child process created to +execute it returns a status of 127. If a command is found +but is not executable, the return status is 126. +.PP +If a command fails because of an error during expansion or redirection, +the exit status is greater than zero. +.PP +Shell builtin commands return a status of 0 (\fItrue\fP) if +successful, and non-zero (\fIfalse\fP) if an error occurs +while they execute. +All builtins return an exit status of 2 to indicate incorrect usage. +.PP +\fBBash\fP itself returns the exit status of the last command +executed, unless a syntax error occurs, in which case it exits +with a non-zero value. See also the \fBexit\fP builtin +command below. +.SH SIGNALS +When \fBbash\fP is interactive, in the absence of any traps, it ignores +.SM +.B SIGTERM +(so that \fBkill 0\fP does not kill an interactive shell), +and +.SM +.B SIGINT +is caught and handled (so that the \fBwait\fP builtin is interruptible). +In all cases, \fBbash\fP ignores +.SM +.BR SIGQUIT . +If job control is in effect, +.B bash +ignores +.SM +.BR SIGTTIN , +.SM +.BR SIGTTOU , +and +.SM +.BR SIGTSTP . +.PP +Non-builtin commands run by \fBbash\fP have signal handlers +set to the values inherited by the shell from its parent. +When job control is not in effect, asynchronous commands +ignore +.SM +.B SIGINT +and +.SM +.B SIGQUIT +in addition to these inherited handlers. +Commands run as a result of command substitution ignore the +keyboard-generated job control signals +.SM +.BR SIGTTIN , +.SM +.BR SIGTTOU , +and +.SM +.BR SIGTSTP . +.PP +The shell exits by default upon receipt of a +.SM +.BR SIGHUP . +Before exiting, an interactive shell resends the +.SM +.B SIGHUP +to all jobs, running or stopped. +Stopped jobs are sent +.SM +.B SIGCONT +to ensure that they receive the +.SM +.BR SIGHUP . +To prevent the shell from +sending the signal to a particular job, it should be removed from the +jobs table with the +.B disown +builtin (see +.SM +.B "SHELL BUILTIN COMMANDS" +below) or marked +to not receive +.SM +.B SIGHUP +using +.BR "disown \-h" . +.PP +If the +.B huponexit +shell option has been set with +.BR shopt , +.B bash +sends a +.SM +.B SIGHUP +to all jobs when an interactive login shell exits. +.PP +If \fBbash\fP is waiting for a command to complete and receives a signal +for which a trap has been set, the trap will not be executed until +the command completes. +When \fBbash\fP is waiting for an asynchronous command via the \fBwait\fP +builtin, the reception of a signal for which a trap has been set will +cause the \fBwait\fP builtin to return immediately with an exit status +greater than 128, immediately after which the trap is executed. +.SH "JOB CONTROL" +.I Job control +refers to the ability to selectively stop (\fIsuspend\fP) +the execution of processes and continue (\fIresume\fP) +their execution at a later point. A user typically employs +this facility via an interactive interface supplied jointly +by the operating system kernel's terminal driver and +.BR bash . +.PP +The shell associates a +.I job +with each pipeline. It keeps a table of currently executing +jobs, which may be listed with the +.B jobs +command. When +.B bash +starts a job asynchronously (in the +.IR background ), +it prints a line that looks like: +.RS +.PP +[1] 25647 +.RE +.PP +indicating that this job is job number 1 and that the process ID +of the last process in the pipeline associated with this job is 25647. +All of the processes in a single pipeline are members of the same job. +.B Bash +uses the +.I job +abstraction as the basis for job control. +.PP +To facilitate the implementation of the user interface to job +control, the operating system maintains the notion of a \fIcurrent terminal +process group ID\fP. Members of this process group (processes whose +process group ID is equal to the current terminal process group ID) +receive keyboard-generated signals such as +.SM +.BR SIGINT . +These processes are said to be in the +.IR foreground . +.I Background +processes are those whose process group ID differs from the terminal's; +such processes are immune to keyboard-generated signals. +Only foreground processes are allowed to read from or, if the +user so specifies with \f(CWstty tostop\fP, write to the +terminal. +Background processes which attempt to read from (write to when +\f(CWstty tostop\fP is in effect) the +terminal are sent a +.SM +.B SIGTTIN (SIGTTOU) +signal by the kernel's terminal driver, +which, unless caught, suspends the process. +.PP +If the operating system on which +.B bash +is running supports +job control, +.B bash +contains facilities to use it. +Typing the +.I suspend +character (typically +.BR ^Z , +Control-Z) while a process is running +causes that process to be stopped and returns control to +.BR bash . +Typing the +.I "delayed suspend" +character (typically +.BR ^Y , +Control-Y) causes the process to be stopped when it +attempts to read input from the terminal, and control to +be returned to +.BR bash . +The user may then manipulate the state of this job, using the +.B bg +command to continue it in the background, the +.B fg +command to continue it in the foreground, or +the +.B kill +command to kill it. A \fB^Z\fP takes effect immediately, +and has the additional side effect of causing pending output +and typeahead to be discarded. +.PP +There are a number of ways to refer to a job in the shell. +The character +.B % +introduces a job specification (\fIjobspec\fP). Job number +.I n +may be referred to as +.BR %n . +A job may also be referred to using a prefix of the name used to +start it, or using a substring that appears in its command line. +For example, +.B %ce +refers to a stopped +.B ce +job. If a prefix matches more than one job, +.B bash +reports an error. Using +.BR %?ce , +on the other hand, refers to any job containing the string +.B ce +in its command line. If the substring matches more than one job, +.B bash +reports an error. The symbols +.B %% +and +.B %+ +refer to the shell's notion of the +.IR "current job" , +which is the last job stopped while it was in +the foreground or started in the background. +The +.I "previous job" +may be referenced using +.BR %\- . +If there is only a single job, \fB%+\fP and \fB%\-\fP can both be used +to refer to that job. +In output pertaining to jobs (e.g., the output of the +.B jobs +command), the current job is always flagged with a +.BR + , +and the previous job with a +.BR \- . +A single % (with no accompanying job specification) also refers to the +current job. +.PP +Simply naming a job can be used to bring it into the +foreground: +.B %1 +is a synonym for +\fB``fg %1''\fP, +bringing job 1 from the background into the foreground. +Similarly, +.B ``%1 &'' +resumes job 1 in the background, equivalent to +\fB``bg %1''\fP. +.PP +The shell learns immediately whenever a job changes state. +Normally, +.B bash +waits until it is about to print a prompt before reporting +changes in a job's status so as to not interrupt +any other output. If the +.B \-b +option to the +.B set +builtin command +is enabled, +.B bash +reports such changes immediately. +Any trap on +.SM +.B SIGCHLD +is executed for each child that exits. +.PP +If an attempt to exit +.B bash +is made while jobs are stopped (or, if the \fBcheckjobs\fP shell option has +been enabled using the \fBshopt\fP builtin, running), the shell prints a +warning message, and, if the \fBcheckjobs\fP option is enabled, lists the +jobs and their statuses. +The +.B jobs +command may then be used to inspect their status. +If a second attempt to exit is made without an intervening command, +the shell does not print another warning, and any stopped +jobs are terminated. +.SH PROMPTING +When executing interactively, +.B bash +displays the primary prompt +.SM +.B PS1 +when it is ready to read a command, and the secondary prompt +.SM +.B PS2 +when it needs more input to complete a command. +.B Bash +allows these prompt strings to be customized by inserting a number of +backslash-escaped special characters that are decoded as follows: +.RS +.PD 0 +.TP +.B \ea +an ASCII bell character (07) +.TP +.B \ed +the date in "Weekday Month Date" format (e.g., "Tue May 26") +.TP +.B \eD{\fIformat\fP} +the \fIformat\fP is passed to \fIstrftime\fP(3) and the result is inserted +into the prompt string; an empty \fIformat\fP results in a locale-specific +time representation. The braces are required +.TP +.B \ee +an ASCII escape character (033) +.TP +.B \eh +the hostname up to the first `.' +.TP +.B \eH +the hostname +.TP +.B \ej +the number of jobs currently managed by the shell +.TP +.B \el +the basename of the shell's terminal device name +.TP +.B \en +newline +.TP +.B \er +carriage return +.TP +.B \es +the name of the shell, the basename of +.B $0 +(the portion following the final slash) +.TP +.B \et +the current time in 24-hour HH:MM:SS format +.TP +.B \eT +the current time in 12-hour HH:MM:SS format +.TP +.B \e@ +the current time in 12-hour am/pm format +.TP +.B \eA +the current time in 24-hour HH:MM format +.TP +.B \eu +the username of the current user +.TP +.B \ev +the version of \fBbash\fP (e.g., 2.00) +.TP +.B \eV +the release of \fBbash\fP, version + patch level (e.g., 2.00.0) +.TP +.B \ew +the current working directory, with +.SM +.B $HOME +abbreviated with a tilde +(uses the value of the +.SM +.B PROMPT_DIRTRIM +variable) +.TP +.B \eW +the basename of the current working directory, with +.SM +.B $HOME +abbreviated with a tilde +.TP +.B \e! +the history number of this command +.TP +.B \e# +the command number of this command +.TP +.B \e$ +if the effective UID is 0, a +.BR # , +otherwise a +.B $ +.TP +.B \e\fInnn\fP +the character corresponding to the octal number \fInnn\fP +.TP +.B \e\e +a backslash +.TP +.B \e[ +begin a sequence of non-printing characters, which could be used to +embed a terminal control sequence into the prompt +.TP +.B \e] +end a sequence of non-printing characters +.PD +.RE +.PP +The command number and the history number are usually different: +the history number of a command is its position in the history +list, which may include commands restored from the history file +(see +.SM +.B HISTORY +below), while the command number is the position in the sequence +of commands executed during the current shell session. +After the string is decoded, it is expanded via +parameter expansion, command substitution, arithmetic +expansion, and quote removal, subject to the value of the +.B promptvars +shell option (see the description of the +.B shopt +command under +.SM +.B "SHELL BUILTIN COMMANDS" +below). +.SH READLINE +This is the library that handles reading input when using an interactive +shell, unless the +.B \-\-noediting +option is given at shell invocation. +Line editing is also used when using the \fB\-e\fP option to the +\fBread\fP builtin. +By default, the line editing commands are similar to those of Emacs. +A vi-style line editing interface is also available. +Line editing can be enabled at any time using the +.B \-o emacs +or +.B \-o vi +options to the +.B set +builtin (see +.SM +.B SHELL BUILTIN COMMANDS +below). +To turn off line editing after the shell is running, use the +.B +o emacs +or +.B +o vi +options to the +.B set +builtin. +.SS "Readline Notation" +.PP +In this section, the Emacs-style notation is used to denote +keystrokes. Control keys are denoted by C\-\fIkey\fR, e.g., C\-n +means Control\-N. Similarly, +.I meta +keys are denoted by M\-\fIkey\fR, so M\-x means Meta\-X. (On keyboards +without a +.I meta +key, M\-\fIx\fP means ESC \fIx\fP, i.e., press the Escape key +then the +.I x +key. This makes ESC the \fImeta prefix\fP. +The combination M\-C\-\fIx\fP means ESC\-Control\-\fIx\fP, +or press the Escape key +then hold the Control key while pressing the +.I x +key.) +.PP +Readline commands may be given numeric +.IR arguments , +which normally act as a repeat count. +Sometimes, however, it is the sign of the argument that is significant. +Passing a negative argument to a command that acts in the forward +direction (e.g., \fBkill\-line\fP) causes that command to act in a +backward direction. +Commands whose behavior with arguments deviates from this are noted +below. +.PP +When a command is described as \fIkilling\fP text, the text +deleted is saved for possible future retrieval +(\fIyanking\fP). The killed text is saved in a +\fIkill ring\fP. Consecutive kills cause the text to be +accumulated into one unit, which can be yanked all at once. +Commands which do not kill text separate the chunks of text +on the kill ring. +.SS "Readline Initialization" +.PP +Readline is customized by putting commands in an initialization +file (the \fIinputrc\fP file). +The name of this file is taken from the value of the +.SM +.B INPUTRC +variable. If that variable is unset, the default is +.IR ~/.inputrc . +When a program which uses the readline library starts up, the +initialization file is read, and the key bindings and variables +are set. +There are only a few basic constructs allowed in the +readline initialization file. +Blank lines are ignored. +Lines beginning with a \fB#\fP are comments. +Lines beginning with a \fB$\fP indicate conditional constructs. +Other lines denote key bindings and variable settings. +.PP +The default key-bindings may be changed with an +.I inputrc +file. +Other programs that use this library may add their own commands +and bindings. +.PP +For example, placing +.RS +.PP +M\-Control\-u: universal\-argument +.RE +or +.RS +C\-Meta\-u: universal\-argument +.RE +into the +.I inputrc +would make M\-C\-u execute the readline command +.IR universal\-argument . +.PP +The following symbolic character names are recognized: +.IR RUBOUT , +.IR DEL , +.IR ESC , +.IR LFD , +.IR NEWLINE , +.IR RET , +.IR RETURN , +.IR SPC , +.IR SPACE , +and +.IR TAB . +.PP +In addition to command names, readline allows keys to be bound +to a string that is inserted when the key is pressed (a \fImacro\fP). +.SS "Readline Key Bindings" +.PP +The syntax for controlling key bindings in the +.I inputrc +file is simple. All that is required is the name of the +command or the text of a macro and a key sequence to which +it should be bound. The name may be specified in one of two ways: +as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP +prefixes, or as a key sequence. +.PP +When using the form \fBkeyname\fP:\^\fIfunction\-name\fP or \fImacro\fP, +.I keyname +is the name of a key spelled out in English. For example: +.sp +.RS +Control-u: universal\-argument +.br +Meta-Rubout: backward-kill-word +.br +Control-o: "> output" +.RE +.LP +In the above example, +.I C\-u +is bound to the function +.BR universal\-argument , +.I M\-DEL +is bound to the function +.BR backward\-kill\-word , +and +.I C\-o +is bound to run the macro +expressed on the right hand side (that is, to insert the text +.if t \f(CW> output\fP +.if n ``> output'' +into the line). +.PP +In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP, +.B keyseq +differs from +.B keyname +above in that strings denoting +an entire key sequence may be specified by placing the sequence +within double quotes. Some GNU Emacs style key escapes can be +used, as in the following example, but the symbolic character names +are not recognized. +.sp +.RS +"\eC\-u": universal\-argument +.br +"\eC\-x\eC\-r": re\-read\-init\-file +.br +"\ee[11~": "Function Key 1" +.RE +.PP +In this example, +.I C\-u +is again bound to the function +.BR universal\-argument . +.I "C\-x C\-r" +is bound to the function +.BR re\-read\-init\-file , +and +.I "ESC [ 1 1 ~" +is bound to insert the text +.if t \f(CWFunction Key 1\fP. +.if n ``Function Key 1''. +.PP +The full set of GNU Emacs style escape sequences is +.RS +.PD 0 +.TP +.B \eC\- +control prefix +.TP +.B \eM\- +meta prefix +.TP +.B \ee +an escape character +.TP +.B \e\e +backslash +.TP +.B \e" +literal " +.TP +.B \e\(aq +literal \(aq +.RE +.PD +.PP +In addition to the GNU Emacs style escape sequences, a second +set of backslash escapes is available: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ed +delete +.TP +.B \ef +form feed +.TP +.B \en +newline +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(one to three digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.RE +.PD +.PP +When entering the text of a macro, single or double quotes must +be used to indicate a macro definition. +Unquoted text is assumed to be a function name. +In the macro body, the backslash escapes described above are expanded. +Backslash will quote any other character in the macro text, +including " and \(aq. +.PP +.B Bash +allows the current readline key bindings to be displayed or modified +with the +.B bind +builtin command. The editing mode may be switched during interactive +use by using the +.B \-o +option to the +.B set +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). +.SS "Readline Variables" +.PP +Readline has variables that can be used to further customize its +behavior. A variable may be set in the +.I inputrc +file with a statement of the form +.RS +.PP +\fBset\fP \fIvariable\-name\fP \fIvalue\fP +.RE +.PP +Except where noted, readline variables can take the values +.B On +or +.B Off +(without regard to case). +Unrecognized variable names are ignored. +When a variable value is read, empty or null values, "on" (case-insensitive), +and "1" are equivalent to \fBOn\fP. All other values are equivalent to +\fBOff\fP. +The variables and their default values are: +.PP +.PD 0 +.TP +.B bell\-style (audible) +Controls what happens when readline wants to ring the terminal bell. +If set to \fBnone\fP, readline never rings the bell. If set to +\fBvisible\fP, readline uses a visible bell if one is available. +If set to \fBaudible\fP, readline attempts to ring the terminal's bell. +.TP +.B bind\-tty\-special\-chars (On) +If set to \fBOn\fP, readline attempts to bind the control characters +treated specially by the kernel's terminal driver to their readline +equivalents. +.TP +.B colored\-stats (Off) +If set to \fBOn\fP, readline displays possible completions using different +colors to indicate their file type. +The color definitions are taken from the value of the \fBLS_COLORS\fP +environment variable. +.TP +.B comment\-begin (``#'') +The string that is inserted when the readline +.B insert\-comment +command is executed. +This command is bound to +.B M\-# +in emacs mode and to +.B # +in vi command mode. +.TP +.B completion\-ignore\-case (Off) +If set to \fBOn\fP, readline performs filename matching and completion +in a case\-insensitive fashion. +.TP +.B completion\-prefix\-display\-length (0) +The length in characters of the common prefix of a list of possible +completions that is displayed without modification. When set to a +value greater than zero, common prefixes longer than this value are +replaced with an ellipsis when displaying possible completions. +.TP +.B completion\-query\-items (100) +This determines when the user is queried about viewing +the number of possible completions +generated by the \fBpossible\-completions\fP command. +It may be set to any integer value greater than or equal to +zero. If the number of possible completions is greater than +or equal to the value of this variable, the user is asked whether +or not he wishes to view them; otherwise they are simply listed +on the terminal. +.TP +.B convert\-meta (On) +If set to \fBOn\fP, readline will convert characters with the +eighth bit set to an ASCII key sequence +by stripping the eighth bit and prefixing an +escape character (in effect, using escape as the \fImeta prefix\fP). +.TP +.B disable\-completion (Off) +If set to \fBOn\fP, readline will inhibit word completion. Completion +characters will be inserted into the line as if they had been +mapped to \fBself-insert\fP. +.TP +.B editing\-mode (emacs) +Controls whether readline begins with a set of key bindings similar +to \fIEmacs\fP or \fIvi\fP. +.B editing\-mode +can be set to either +.B emacs +or +.BR vi . +.TP +.B echo\-control\-characters (On) +When set to \fBOn\fP, on operating systems that indicate they support it, +readline echoes a character corresponding to a signal generated from the +keyboard. +.TP +.B enable\-keypad (Off) +When set to \fBOn\fP, readline will try to enable the application +keypad when it is called. Some systems need this to enable the +arrow keys. +.TP +.B enable\-meta\-key (On) +When set to \fBOn\fP, readline will try to enable any meta modifier +key the terminal claims to support when it is called. On many terminals, +the meta key is used to send eight-bit characters. +.TP +.B expand\-tilde (Off) +If set to \fBOn\fP, tilde expansion is performed when readline +attempts word completion. +.TP +.B history\-preserve\-point (Off) +If set to \fBOn\fP, the history code attempts to place point at the +same location on each history line retrieved with \fBprevious-history\fP +or \fBnext-history\fP. +.TP +.B history\-size (0) +Set the maximum number of history entries saved in the history list. +If set to zero, any existing history entries are deleted and no new entries +are saved. +If set to a value less than zero, the number of history entries is not +limited. +By default, the number of history entries is not limited. +.TP +.B horizontal\-scroll\-mode (Off) +When set to \fBOn\fP, makes readline use a single line for display, +scrolling the input horizontally on a single screen line when it +becomes longer than the screen width rather than wrapping to a new line. +.TP +.B input\-meta (Off) +If set to \fBOn\fP, readline will enable eight-bit input (that is, +it will not strip the high bit from the characters it reads), +regardless of what the terminal claims it can support. The name +.B meta\-flag +is a synonym for this variable. +.TP +.B isearch\-terminators (``C\-[C\-J'') +The string of characters that should terminate an incremental +search without subsequently executing the character as a command. +If this variable has not been given a value, the characters +\fIESC\fP and \fIC\-J\fP will terminate an incremental search. +.TP +.B keymap (emacs) +Set the current readline keymap. The set of valid keymap names is +\fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi, +vi\-command\fP, and +.IR vi\-insert . +\fIvi\fP is equivalent to \fIvi\-command\fP; \fIemacs\fP is +equivalent to \fIemacs\-standard\fP. The default value is +.IR emacs ; +the value of +.B editing\-mode +also affects the default keymap. +.TP +.B keyseq\-timeout (500) +Specifies the duration \fIreadline\fP will wait for a character when reading an +ambiguous key sequence (one that can form a complete key sequence using +the input read so far, or can take additional input to complete a longer +key sequence). +If no input is received within the timeout, \fIreadline\fP will use the shorter +but complete key sequence. +The value is specified in milliseconds, so a value of 1000 means that +\fIreadline\fP will wait one second for additional input. +If this variable is set to a value less than or equal to zero, or to a +non-numeric value, \fIreadline\fP will wait until another key is pressed to +decide which key sequence to complete. +.TP +.B mark\-directories (On) +If set to \fBOn\fP, completed directory names have a slash +appended. +.TP +.B mark\-modified\-lines (Off) +If set to \fBOn\fP, history lines that have been modified are displayed +with a preceding asterisk (\fB*\fP). +.TP +.B mark\-symlinked\-directories (Off) +If set to \fBOn\fP, completed names which are symbolic links to directories +have a slash appended (subject to the value of +\fBmark\-directories\fP). +.TP +.B match\-hidden\-files (On) +This variable, when set to \fBOn\fP, causes readline to match files whose +names begin with a `.' (hidden files) when performing filename +completion. +If set to \fBOff\fP, the leading `.' must be +supplied by the user in the filename to be completed. +.TP +.B menu\-complete\-display\-prefix (Off) +If set to \fBOn\fP, menu completion displays the common prefix of the +list of possible completions (which may be empty) before cycling through +the list. +.TP +.B output\-meta (Off) +If set to \fBOn\fP, readline will display characters with the +eighth bit set directly rather than as a meta-prefixed escape +sequence. +.TP +.B page\-completions (On) +If set to \fBOn\fP, readline uses an internal \fImore\fP-like pager +to display a screenful of possible completions at a time. +.TP +.B print\-completions\-horizontally (Off) +If set to \fBOn\fP, readline will display completions with matches +sorted horizontally in alphabetical order, rather than down the screen. +.TP +.B revert\-all\-at\-newline (Off) +If set to \fBOn\fP, readline will undo all changes to history lines +before returning when \fBaccept\-line\fP is executed. By default, +history lines may be modified and retain individual undo lists across +calls to \fBreadline\fP. +.TP +.B show\-all\-if\-ambiguous (Off) +This alters the default behavior of the completion functions. If +set to +.BR On , +words which have more than one possible completion cause the +matches to be listed immediately instead of ringing the bell. +.TP +.B show\-all\-if\-unmodified (Off) +This alters the default behavior of the completion functions in +a fashion similar to \fBshow\-all\-if\-ambiguous\fP. +If set to +.BR On , +words which have more than one possible completion without any +possible partial completion (the possible completions don't share +a common prefix) cause the matches to be listed immediately instead +of ringing the bell. +.TP +.B show\-mode\-in\-prompt (Off) +If set to \fBOn\fP, add a character to the beginning of the prompt +indicating the editing mode: emacs (@), vi command (:) or vi +insertion (+). +.TP +.B skip\-completed\-text (Off) +If set to \fBOn\fP, this alters the default completion behavior when +inserting a single match into the line. It's only active when +performing completion in the middle of a word. If enabled, readline +does not insert characters from the completion that match characters +after point in the word being completed, so portions of the word +following the cursor are not duplicated. +.TP +.B visible\-stats (Off) +If set to \fBOn\fP, a character denoting a file's type as reported +by \fIstat\fP(2) is appended to the filename when listing possible +completions. +.PD +.SS "Readline Conditional Constructs" +.PP +Readline implements a facility similar in spirit to the conditional +compilation features of the C preprocessor which allows key +bindings and variable settings to be performed as the result +of tests. There are four parser directives used. +.IP \fB$if\fP +The +.B $if +construct allows bindings to be made based on the +editing mode, the terminal being used, or the application using +readline. The text of the test extends to the end of the line; +no characters are required to isolate it. +.RS +.IP \fBmode\fP +The \fBmode=\fP form of the \fB$if\fP directive is used to test +whether readline is in emacs or vi mode. +This may be used in conjunction +with the \fBset keymap\fP command, for instance, to set bindings in +the \fIemacs\-standard\fP and \fIemacs\-ctlx\fP keymaps only if +readline is starting out in emacs mode. +.IP \fBterm\fP +The \fBterm=\fP form may be used to include terminal-specific +key bindings, perhaps to bind the key sequences output by the +terminal's function keys. The word on the right side of the +.B = +is tested against the both full name of the terminal and the portion +of the terminal name before the first \fB\-\fP. This allows +.I sun +to match both +.I sun +and +.IR sun\-cmd , +for instance. +.IP \fBapplication\fP +The \fBapplication\fP construct is used to include +application-specific settings. Each program using the readline +library sets the \fIapplication name\fP, and an initialization +file can test for a particular value. +This could be used to bind key sequences to functions useful for +a specific program. For instance, the following command adds a +key sequence that quotes the current or previous word in \fBbash\fP: +.sp 1 +.RS +.nf +\fB$if\fP Bash +# Quote the current or previous word +"\eC\-xq": "\eeb\e"\eef\e"" +\fB$endif\fP +.fi +.RE +.RE +.IP \fB$endif\fP +This command, as seen in the previous example, terminates an +\fB$if\fP command. +.IP \fB$else\fP +Commands in this branch of the \fB$if\fP directive are executed if +the test fails. +.IP \fB$include\fP +This directive takes a single filename as an argument and reads commands +and bindings from that file. For example, the following directive +would read \fI/etc/inputrc\fP: +.sp 1 +.RS +.nf +\fB$include\fP \^ \fI/etc/inputrc\fP +.fi +.RE +.SS Searching +.PP +Readline provides commands for searching through the command history +(see +.SM +.B HISTORY +below) for lines containing a specified string. +There are two search modes: +.I incremental +and +.IR non-incremental . +.PP +Incremental searches begin before the user has finished typing the +search string. +As each character of the search string is typed, readline displays +the next entry from the history matching the string typed so far. +An incremental search requires only as many characters as needed to +find the desired history entry. +The characters present in the value of the \fBisearch-terminators\fP +variable are used to terminate an incremental search. +If that variable has not been assigned a value the Escape and +Control-J characters will terminate an incremental search. +Control-G will abort an incremental search and restore the original +line. +When the search is terminated, the history entry containing the +search string becomes the current line. +.PP +To find other matching entries in the history list, type Control-S or +Control-R as appropriate. +This will search backward or forward in the history for the next +entry matching the search string typed so far. +Any other key sequence bound to a readline command will terminate +the search and execute that command. +For instance, a \fInewline\fP will terminate the search and accept +the line, thereby executing the command from the history list. +.PP +Readline remembers the last incremental search string. If two +Control-Rs are typed without any intervening characters defining a +new search string, any remembered search string is used. +.PP +Non-incremental searches read the entire search string before starting +to search for matching history lines. The search string may be +typed by the user or be part of the contents of the current line. +.SS "Readline Command Names" +.PP +The following is a list of the names of the commands and the default +key sequences to which they are bound. +Command names without an accompanying key sequence are unbound by default. +In the following descriptions, \fIpoint\fP refers to the current cursor +position, and \fImark\fP refers to a cursor position saved by the +\fBset\-mark\fP command. +The text between the point and mark is referred to as the \fIregion\fP. +.SS Commands for Moving +.PP +.PD 0 +.TP +.B beginning\-of\-line (C\-a) +Move to the start of the current line. +.TP +.B end\-of\-line (C\-e) +Move to the end of the line. +.TP +.B forward\-char (C\-f) +Move forward a character. +.TP +.B backward\-char (C\-b) +Move back a character. +.TP +.B forward\-word (M\-f) +Move forward to the end of the next word. Words are composed of +alphanumeric characters (letters and digits). +.TP +.B backward\-word (M\-b) +Move back to the start of the current or previous word. +Words are composed of alphanumeric characters (letters and digits). +.TP +.B shell\-forward\-word +Move forward to the end of the next word. +Words are delimited by non-quoted shell metacharacters. +.TP +.B shell\-backward\-word +Move back to the start of the current or previous word. +Words are delimited by non-quoted shell metacharacters. +.TP +.B clear\-screen (C\-l) +Clear the screen leaving the current line at the top of the screen. +With an argument, refresh the current line without clearing the +screen. +.TP +.B redraw\-current\-line +Refresh the current line. +.PD +.SS Commands for Manipulating the History +.PP +.PD 0 +.TP +.B accept\-line (Newline, Return) +Accept the line regardless of where the cursor is. If this line is +non-empty, add it to the history list according to the state of the +.SM +.B HISTCONTROL +variable. If the line is a modified history +line, then restore the history line to its original state. +.TP +.B previous\-history (C\-p) +Fetch the previous command from the history list, moving back in +the list. +.TP +.B next\-history (C\-n) +Fetch the next command from the history list, moving forward in the +list. +.TP +.B beginning\-of\-history (M\-<) +Move to the first line in the history. +.TP +.B end\-of\-history (M\->) +Move to the end of the input history, i.e., the line currently being +entered. +.TP +.B reverse\-search\-history (C\-r) +Search backward starting at the current line and moving `up' through +the history as necessary. This is an incremental search. +.TP +.B forward\-search\-history (C\-s) +Search forward starting at the current line and moving `down' through +the history as necessary. This is an incremental search. +.TP +.B non\-incremental\-reverse\-search\-history (M\-p) +Search backward through the history starting at the current line +using a non-incremental search for a string supplied by the user. +.TP +.B non\-incremental\-forward\-search\-history (M\-n) +Search forward through the history using a non-incremental search for +a string supplied by the user. +.TP +.B history\-search\-forward +Search forward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +.TP +.B history\-search\-backward +Search backward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +.TP +.B yank\-nth\-arg (M\-C\-y) +Insert the first argument to the previous command (usually +the second word on the previous line) at point. +With an argument +.IR n , +insert the \fIn\fPth word from the previous command (the words +in the previous command begin with word 0). A negative argument +inserts the \fIn\fPth word from the end of the previous command. +Once the argument \fIn\fP is computed, the argument is extracted +as if the "!\fIn\fP" history expansion had been specified. +.TP +.B +yank\-last\-arg (M\-.\^, M\-_\^) +Insert the last argument to the previous command (the last word of +the previous history entry). +With a numeric argument, behave exactly like \fByank\-nth\-arg\fP. +Successive calls to \fByank\-last\-arg\fP move back through the history +list, inserting the last word (or the word specified by the argument to +the first call) of each line in turn. +Any numeric argument supplied to these successive calls determines +the direction to move through the history. A negative argument switches +the direction through the history (back or forward). +The history expansion facilities are used to extract the last word, +as if the "!$" history expansion had been specified. +.TP +.B shell\-expand\-line (M\-C\-e) +Expand the line as the shell does. This +performs alias and history expansion as well as all of the shell +word expansions. See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B history\-expand\-line (M\-^) +Perform history expansion on the current line. +See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B magic\-space +Perform history expansion on the current line and insert a space. +See +.SM +.B HISTORY EXPANSION +below for a description of history expansion. +.TP +.B alias\-expand\-line +Perform alias expansion on the current line. +See +.SM +.B ALIASES +above for a description of alias expansion. +.TP +.B history\-and\-alias\-expand\-line +Perform history and alias expansion on the current line. +.TP +.B insert\-last\-argument (M\-.\^, M\-_\^) +A synonym for \fByank\-last\-arg\fP. +.TP +.B operate\-and\-get\-next (C\-o) +Accept the current line for execution and fetch the next line +relative to the current line from the history for editing. Any +argument is ignored. +.TP +.B edit\-and\-execute\-command (C\-xC\-e) +Invoke an editor on the current command line, and execute the result as shell +commands. +\fBBash\fP attempts to invoke +.SM +.BR $VISUAL , +.SM +.BR $EDITOR , +and \fIemacs\fP as the editor, in that order. +.PD +.SS Commands for Changing Text +.PP +.PD 0 +.TP +.B \fIend\-of\-file\fP (usually C\-d) +The character indicating end-of-file as set, for example, by +.if t \f(CWstty\fP. +.if n ``stty''. +If this character is read when there are no characters +on the line, and point is at the beginning of the line, Readline +interprets it as the end of input and returns +.SM +.BR EOF . +.TP +.B delete\-char (C\-d) +Delete the character at point. +If this function is bound to the +same character as the tty \fBEOF\fP character, as \fBC\-d\fP +commonly is, see above for the effects. +.TP +.B backward\-delete\-char (Rubout) +Delete the character behind the cursor. When given a numeric argument, +save the deleted text on the kill ring. +.TP +.B forward\-backward\-delete\-char +Delete the character under the cursor, unless the cursor is at the +end of the line, in which case the character behind the cursor is +deleted. +.TP +.B quoted\-insert (C\-q, C\-v) +Add the next character typed to the line verbatim. This is +how to insert characters like \fBC\-q\fP, for example. +.TP +.B tab\-insert (C\-v TAB) +Insert a tab character. +.TP +.B self\-insert (a,\ b,\ A,\ 1,\ !,\ ...) +Insert the character typed. +.TP +.B transpose\-chars (C\-t) +Drag the character before point forward over the character at point, +moving point forward as well. +If point is at the end of the line, then this transposes +the two characters before point. +Negative arguments have no effect. +.TP +.B transpose\-words (M\-t) +Drag the word before point past the word after point, +moving point over that word as well. +If point is at the end of the line, this transposes +the last two words on the line. +.TP +.B upcase\-word (M\-u) +Uppercase the current (or following) word. With a negative argument, +uppercase the previous word, but do not move point. +.TP +.B downcase\-word (M\-l) +Lowercase the current (or following) word. With a negative argument, +lowercase the previous word, but do not move point. +.TP +.B capitalize\-word (M\-c) +Capitalize the current (or following) word. With a negative argument, +capitalize the previous word, but do not move point. +.TP +.B overwrite\-mode +Toggle overwrite mode. With an explicit positive numeric argument, +switches to overwrite mode. With an explicit non-positive numeric +argument, switches to insert mode. This command affects only +\fBemacs\fP mode; \fBvi\fP mode does overwrite differently. +Each call to \fIreadline()\fP starts in insert mode. +In overwrite mode, characters bound to \fBself\-insert\fP replace +the text at point rather than pushing the text to the right. +Characters bound to \fBbackward\-delete\-char\fP replace the character +before point with a space. By default, this command is unbound. +.PD +.SS Killing and Yanking +.PP +.PD 0 +.TP +.B kill\-line (C\-k) +Kill the text from point to the end of the line. +.TP +.B backward\-kill\-line (C\-x Rubout) +Kill backward to the beginning of the line. +.TP +.B unix\-line\-discard (C\-u) +Kill backward from point to the beginning of the line. +The killed text is saved on the kill-ring. +.\" There is no real difference between this and backward-kill-line +.TP +.B kill\-whole\-line +Kill all characters on the current line, no matter where point is. +.TP +.B kill\-word (M\-d) +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as those used by \fBforward\-word\fP. +.TP +.B backward\-kill\-word (M\-Rubout) +Kill the word behind point. +Word boundaries are the same as those used by \fBbackward\-word\fP. +.TP +.B shell\-kill\-word (M\-d) +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as those used by \fBshell\-forward\-word\fP. +.TP +.B shell\-backward\-kill\-word (M\-Rubout) +Kill the word behind point. +Word boundaries are the same as those used by \fBshell\-backward\-word\fP. +.TP +.B unix\-word\-rubout (C\-w) +Kill the word behind point, using white space as a word boundary. +The killed text is saved on the kill-ring. +.TP +.B unix\-filename\-rubout +Kill the word behind point, using white space and the slash character +as the word boundaries. +The killed text is saved on the kill-ring. +.TP +.B delete\-horizontal\-space (M\-\e) +Delete all spaces and tabs around point. +.TP +.B kill\-region +Kill the text in the current region. +.TP +.B copy\-region\-as\-kill +Copy the text in the region to the kill buffer. +.TP +.B copy\-backward\-word +Copy the word before point to the kill buffer. +The word boundaries are the same as \fBbackward\-word\fP. +.TP +.B copy\-forward\-word +Copy the word following point to the kill buffer. +The word boundaries are the same as \fBforward\-word\fP. +.TP +.B yank (C\-y) +Yank the top of the kill ring into the buffer at point. +.TP +.B yank\-pop (M\-y) +Rotate the kill ring, and yank the new top. Only works following +.B yank +or +.BR yank\-pop . +.PD +.SS Numeric Arguments +.PP +.PD 0 +.TP +.B digit\-argument (M\-0, M\-1, ..., M\-\-) +Add this digit to the argument already accumulating, or start a new +argument. M\-\- starts a negative argument. +.TP +.B universal\-argument +This is another way to specify an argument. +If this command is followed by one or more digits, optionally with a +leading minus sign, those digits define the argument. +If the command is followed by digits, executing +.B universal\-argument +again ends the numeric argument, but is otherwise ignored. +As a special case, if this command is immediately followed by a +character that is neither a digit or minus sign, the argument count +for the next command is multiplied by four. +The argument count is initially one, so executing this function the +first time makes the argument count four, a second time makes the +argument count sixteen, and so on. +.PD +.SS Completing +.PP +.PD 0 +.TP +.B complete (TAB) +Attempt to perform completion on the text before point. +.B Bash +attempts completion treating the text as a variable (if the +text begins with \fB$\fP), username (if the text begins with +\fB~\fP), hostname (if the text begins with \fB@\fP), or +command (including aliases and functions) in turn. If none +of these produces a match, filename completion is attempted. +.TP +.B possible\-completions (M\-?) +List the possible completions of the text before point. +.TP +.B insert\-completions (M\-*) +Insert all completions of the text before point +that would have been generated by +\fBpossible\-completions\fP. +.TP +.B menu\-complete +Similar to \fBcomplete\fP, but replaces the word to be completed +with a single match from the list of possible completions. +Repeated execution of \fBmenu\-complete\fP steps through the list +of possible completions, inserting each match in turn. +At the end of the list of completions, the bell is rung +(subject to the setting of \fBbell\-style\fP) +and the original text is restored. +An argument of \fIn\fP moves \fIn\fP positions forward in the list +of matches; a negative argument may be used to move backward +through the list. +This command is intended to be bound to \fBTAB\fP, but is unbound +by default. +.TP +.B menu\-complete\-backward +Identical to \fBmenu\-complete\fP, but moves backward through the list +of possible completions, as if \fBmenu\-complete\fP had been given a +negative argument. This command is unbound by default. +.TP +.B delete\-char\-or\-list +Deletes the character under the cursor if not at the beginning or +end of the line (like \fBdelete\-char\fP). +If at the end of the line, behaves identically to +\fBpossible\-completions\fP. +This command is unbound by default. +.TP +.B complete\-filename (M\-/) +Attempt filename completion on the text before point. +.TP +.B possible\-filename\-completions (C\-x /) +List the possible completions of the text before point, +treating it as a filename. +.TP +.B complete\-username (M\-~) +Attempt completion on the text before point, treating +it as a username. +.TP +.B possible\-username\-completions (C\-x ~) +List the possible completions of the text before point, +treating it as a username. +.TP +.B complete\-variable (M\-$) +Attempt completion on the text before point, treating +it as a shell variable. +.TP +.B possible\-variable\-completions (C\-x $) +List the possible completions of the text before point, +treating it as a shell variable. +.TP +.B complete\-hostname (M\-@) +Attempt completion on the text before point, treating +it as a hostname. +.TP +.B possible\-hostname\-completions (C\-x @) +List the possible completions of the text before point, +treating it as a hostname. +.TP +.B complete\-command (M\-!) +Attempt completion on the text before point, treating +it as a command name. Command completion attempts to +match the text against aliases, reserved words, shell +functions, shell builtins, and finally executable filenames, +in that order. +.TP +.B possible\-command\-completions (C\-x !) +List the possible completions of the text before point, +treating it as a command name. +.TP +.B dynamic\-complete\-history (M\-TAB) +Attempt completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +.TP +.B dabbrev\-expand +Attempt menu completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +.TP +.B complete\-into\-braces (M\-{) +Perform filename completion and insert the list of possible completions +enclosed within braces so the list is available to the shell (see +.B Brace Expansion +above). +.PD +.SS Keyboard Macros +.PP +.PD 0 +.TP +.B start\-kbd\-macro (C\-x (\^) +Begin saving the characters typed into the current keyboard macro. +.TP +.B end\-kbd\-macro (C\-x )\^) +Stop saving the characters typed into the current keyboard macro +and store the definition. +.TP +.B call\-last\-kbd\-macro (C\-x e) +Re-execute the last keyboard macro defined, by making the characters +in the macro appear as if typed at the keyboard. +.TP +.B print\-last\-kbd\-macro () +Print the last keyboard macro defined in a format suitable for the +\fIinputrc\fP file. +.PD +.SS Miscellaneous +.PP +.PD 0 +.TP +.B re\-read\-init\-file (C\-x C\-r) +Read in the contents of the \fIinputrc\fP file, and incorporate +any bindings or variable assignments found there. +.TP +.B abort (C\-g) +Abort the current editing command and +ring the terminal's bell (subject to the setting of +.BR bell\-style ). +.TP +.B do\-uppercase\-version (M\-a, M\-b, M\-\fIx\fP, ...) +If the metafied character \fIx\fP is lowercase, run the command +that is bound to the corresponding uppercase character. +.TP +.B prefix\-meta (ESC) +Metafy the next character typed. +.SM +.B ESC +.B f +is equivalent to +.BR Meta\-f . +.TP +.B undo (C\-_, C\-x C\-u) +Incremental undo, separately remembered for each line. +.TP +.B revert\-line (M\-r) +Undo all changes made to this line. This is like executing the +.B undo +command enough times to return the line to its initial state. +.TP +.B tilde\-expand (M\-&) +Perform tilde expansion on the current word. +.TP +.B set\-mark (C\-@, M\-) +Set the mark to the point. If a +numeric argument is supplied, the mark is set to that position. +.TP +.B exchange\-point\-and\-mark (C\-x C\-x) +Swap the point with the mark. The current cursor position is set to +the saved position, and the old cursor position is saved as the mark. +.TP +.B character\-search (C\-]) +A character is read and point is moved to the next occurrence of that +character. A negative count searches for previous occurrences. +.TP +.B character\-search\-backward (M\-C\-]) +A character is read and point is moved to the previous occurrence of that +character. A negative count searches for subsequent occurrences. +.TP +.B skip\-csi\-sequence +Read enough characters to consume a multi-key sequence such as those +defined for keys like Home and End. Such sequences begin with a +Control Sequence Indicator (CSI), usually ESC\-[. If this sequence is +bound to "\e[", keys producing such sequences will have no effect +unless explicitly bound to a readline command, instead of inserting +stray characters into the editing buffer. This is unbound by default, +but usually bound to ESC\-[. +.TP +.B insert\-comment (M\-#) +Without a numeric argument, the value of the readline +.B comment\-begin +variable is inserted at the beginning of the current line. +If a numeric argument is supplied, this command acts as a toggle: if +the characters at the beginning of the line do not match the value +of \fBcomment\-begin\fP, the value is inserted, otherwise +the characters in \fBcomment\-begin\fP are deleted from the beginning of +the line. +In either case, the line is accepted as if a newline had been typed. +The default value of +\fBcomment\-begin\fP causes this command to make the current line +a shell comment. +If a numeric argument causes the comment character to be removed, the line +will be executed by the shell. +.TP +.B glob\-complete\-word (M\-g) +The word before point is treated as a pattern for pathname expansion, +with an asterisk implicitly appended. This pattern is used to +generate a list of matching filenames for possible completions. +.TP +.B glob\-expand\-word (C\-x *) +The word before point is treated as a pattern for pathname expansion, +and the list of matching filenames is inserted, replacing the word. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +.TP +.B glob\-list\-expansions (C\-x g) +The list of expansions that would have been generated by +.B glob\-expand\-word +is displayed, and the line is redrawn. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +.TP +.B dump\-functions +Print all of the functions and their key bindings to the +readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B dump\-variables +Print all of the settable readline variables and their values to the +readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B dump\-macros +Print all of the readline key sequences bound to macros and the +strings they output. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an \fIinputrc\fP file. +.TP +.B display\-shell\-version (C\-x C\-v) +Display version information about the current instance of +.BR bash . +.PD +.SS Programmable Completion +.PP +When word completion is attempted for an argument to a command for +which a completion specification (a \fIcompspec\fP) has been defined +using the \fBcomplete\fP builtin (see +.SM +.B "SHELL BUILTIN COMMANDS" +below), the programmable completion facilities are invoked. +.PP +First, the command name is identified. +If the command word is the empty string (completion attempted at the +beginning of an empty line), any compspec defined with +the \fB\-E\fP option to \fBcomplete\fP is used. +If a compspec has been defined for that command, the +compspec is used to generate the list of possible completions for the word. +If the command word is a full pathname, a compspec for the full +pathname is searched for first. +If no compspec is found for the full pathname, an attempt is made to +find a compspec for the portion following the final slash. +If those searches do not result in a compspec, any compspec defined with +the \fB\-D\fP option to \fBcomplete\fP is used as the default. +.PP +Once a compspec has been found, it is used to generate the list of +matching words. +If a compspec is not found, the default \fBbash\fP completion as +described above under \fBCompleting\fP is performed. +.PP +First, the actions specified by the compspec are used. +Only matches which are prefixed by the word being completed are +returned. +When the +.B \-f +or +.B \-d +option is used for filename or directory name completion, the shell +variable +.SM +.B FIGNORE +is used to filter the matches. +.PP +Any completions specified by a pathname expansion pattern to the +\fB\-G\fP option are generated next. +The words generated by the pattern need not match the word +being completed. +The +.SM +.B GLOBIGNORE +shell variable is not used to filter the matches, but the +.SM +.B FIGNORE +variable is used. +.PP +Next, the string specified as the argument to the \fB\-W\fP option +is considered. +The string is first split using the characters in the +.SM +.B IFS +special variable as delimiters. +Shell quoting is honored. +Each word is then expanded using +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, and arithmetic expansion, +as described above under +.SM +.BR EXPANSION . +The results are split using the rules described above under +\fBWord Splitting\fP. +The results of the expansion are prefix-matched against the word being +completed, and the matching words become the possible completions. +.PP +After these matches have been generated, any shell function or command +specified with the \fB\-F\fP and \fB\-C\fP options is invoked. +When the command or function is invoked, the +.SM +.BR COMP_LINE , +.SM +.BR COMP_POINT , +.SM +.BR COMP_KEY , +and +.SM +.B COMP_TYPE +variables are assigned values as described above under +\fBShell Variables\fP. +If a shell function is being invoked, the +.SM +.B COMP_WORDS +and +.SM +.B COMP_CWORD +variables are also set. +When the function or command is invoked, +the first argument (\fB$1\fP) is the name of the command whose arguments are +being completed, +the second argument (\fB$2\fP) is the word being completed, +and the third argument (\fB$3\fP) is the word preceding the word being +completed on the current command line. +No filtering of the generated completions against the word being completed +is performed; the function or command has complete freedom in generating +the matches. +.PP +Any function specified with \fB\-F\fP is invoked first. +The function may use any of the shell facilities, including the +\fBcompgen\fP builtin described below, to generate the matches. +It must put the possible completions in the +.SM +.B COMPREPLY +array variable, one per array element. +.PP +Next, any command specified with the \fB\-C\fP option is invoked +in an environment equivalent to command substitution. +It should print a list of completions, one per line, to the +standard output. +Backslash may be used to escape a newline, if necessary. +.PP +After all of the possible completions are generated, any filter +specified with the \fB\-X\fP option is applied to the list. +The filter is a pattern as used for pathname expansion; a \fB&\fP +in the pattern is replaced with the text of the word being completed. +A literal \fB&\fP may be escaped with a backslash; the backslash +is removed before attempting a match. +Any completion that matches the pattern will be removed from the list. +A leading \fB!\fP negates the pattern; in this case any completion +not matching the pattern will be removed. +.PP +Finally, any prefix and suffix specified with the \fB\-P\fP and \fB\-S\fP +options are added to each member of the completion list, and the result is +returned to the readline completion code as the list of possible +completions. +.PP +If the previously-applied actions do not generate any matches, and the +\fB\-o dirnames\fP option was supplied to \fBcomplete\fP when the +compspec was defined, directory name completion is attempted. +.PP +If the \fB\-o plusdirs\fP option was supplied to \fBcomplete\fP when the +compspec was defined, directory name completion is attempted and any +matches are added to the results of the other actions. +.PP +By default, if a compspec is found, whatever it generates is returned +to the completion code as the full set of possible completions. +The default \fBbash\fP completions are not attempted, and the readline +default of filename completion is disabled. +If the \fB\-o bashdefault\fP option was supplied to \fBcomplete\fP when +the compspec was defined, the \fBbash\fP default completions are attempted +if the compspec generates no matches. +If the \fB\-o default\fP option was supplied to \fBcomplete\fP when the +compspec was defined, readline's default completion will be performed +if the compspec (and, if attempted, the default \fBbash\fP completions) +generate no matches. +.PP +When a compspec indicates that directory name completion is desired, +the programmable completion functions force readline to append a slash +to completed names which are symbolic links to directories, subject to +the value of the \fBmark\-directories\fP readline variable, regardless +of the setting of the \fBmark-symlinked\-directories\fP readline variable. +.PP +There is some support for dynamically modifying completions. This is +most useful when used in combination with a default completion specified +with \fBcomplete -D\fP. +It's possible for shell functions executed as completion +handlers to indicate that completion should be retried by returning an +exit status of 124. If a shell function returns 124, and changes +the compspec associated with the command on which completion is being +attempted (supplied as the first argument when the function is executed), +programmable completion restarts from the beginning, with an +attempt to find a new compspec for that command. This allows a set of +completions to be built dynamically as completion is attempted, rather than +being loaded all at once. +.PP +For instance, assuming that there is a library of compspecs, each kept in a +file corresponding to the name of the command, the following default +completion function would load completions dynamically: +.PP +\f(CW_completion_loader() +.br +{ +.br + . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124 +.br +} +.br +complete -D -F _completion_loader -o bashdefault -o default +.br +\fP +.SH HISTORY +When the +.B \-o history +option to the +.B set +builtin is enabled, the shell provides access to the +\fIcommand history\fP, +the list of commands previously typed. +The value of the +.SM +.B HISTSIZE +variable is used as the +number of commands to save in a history list. +The text of the last +.SM +.B HISTSIZE +commands (default 500) is saved. The shell +stores each command in the history list prior to parameter and +variable expansion (see +.SM +.B EXPANSION +above) but after history expansion is performed, subject to the +values of the shell variables +.SM +.B HISTIGNORE +and +.SM +.BR HISTCONTROL . +.PP +On startup, the history is initialized from the file named by +the variable +.SM +.B HISTFILE +(default \fI~/.bash_history\fP). +The file named by the value of +.SM +.B HISTFILE +is truncated, if necessary, to contain no more than +the number of lines specified by the value of +.SM +.BR HISTFILESIZE . +If \fBHISTFILESIZE\fP is unset, or set to null, a non-numeric value, +or a numeric value less than zero, the history file is not truncated. +When the history file is read, +lines beginning with the history comment character followed immediately +by a digit are interpreted as timestamps for the preceding history line. +These timestamps are optionally displayed depending on the value of the +.SM +.B HISTTIMEFORMAT +variable. +When a shell with history enabled exits, the last +.SM +.B $HISTSIZE +lines are copied from the history list to +.SM +.BR $HISTFILE . +If the +.B histappend +shell option is enabled +(see the description of +.B shopt +under +.SM +.B "SHELL BUILTIN COMMANDS" +below), the lines are appended to the history file, +otherwise the history file is overwritten. +If +.SM +.B HISTFILE +is unset, or if the history file is unwritable, the history is +not saved. +If the +.SM +.B HISTTIMEFORMAT +variable is set, time stamps are written to the history file, marked +with the history comment character, so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +After saving the history, the history file is truncated +to contain no more than +.SM +.B HISTFILESIZE +lines. If +.SM +.B HISTFILESIZE +is unset, or set to null, a non-numeric value, +or a numeric value less than zero, the history file is not truncated. +.PP +The builtin command +.B fc +(see +.SM +.B SHELL BUILTIN COMMANDS +below) may be used to list or edit and re-execute a portion of +the history list. +The +.B history +builtin may be used to display or modify the history list and +manipulate the history file. +When using command-line editing, search commands +are available in each editing mode that provide access to the +history list. +.PP +The shell allows control over which commands are saved on the history +list. The +.SM +.B HISTCONTROL +and +.SM +.B HISTIGNORE +variables may be set to cause the shell to save only a subset of the +commands entered. +The +.B cmdhist +shell option, if enabled, causes the shell to attempt to save each +line of a multi-line command in the same history entry, adding +semicolons where necessary to preserve syntactic correctness. +The +.B lithist +shell option causes the shell to save the command with embedded newlines +instead of semicolons. See the description of the +.B shopt +builtin below under +.SM +.B "SHELL BUILTIN COMMANDS" +for information on setting and unsetting shell options. +.SH "HISTORY EXPANSION" +.PP +The shell supports a history expansion feature that +is similar to the history expansion in +.BR csh. +This section describes what syntax features are available. This +feature is enabled by default for interactive shells, and can be +disabled using the +.B +H +option to the +.B set +builtin command (see +.SM +.B SHELL BUILTIN COMMANDS +below). Non-interactive shells do not perform history expansion +by default. +.PP +History expansions introduce words from the history list into +the input stream, making it easy to repeat commands, insert the +arguments to a previous command into the current input line, or +fix errors in previous commands quickly. +.PP +History expansion is performed immediately after a complete line +is read, before the shell breaks it into words. +It takes place in two parts. +The first is to determine which line from the history list +to use during substitution. +The second is to select portions of that line for inclusion into +the current one. +The line selected from the history is the \fIevent\fP, +and the portions of that line that are acted upon are \fIwords\fP. +Various \fImodifiers\fP are available to manipulate the selected words. +The line is broken into words in the same fashion as when reading input, +so that several \fImetacharacter\fP-separated words surrounded by +quotes are considered one word. +History expansions are introduced by the appearance of the +history expansion character, which is \^\fB!\fP\^ by default. +Only backslash (\^\fB\e\fP\^) and single quotes can quote +the history expansion character. +.PP +Several characters inhibit history expansion if found immediately +following the history expansion character, even if it is unquoted: +space, tab, newline, carriage return, and \fB=\fP. +If the \fBextglob\fP shell option is enabled, \fB(\fP will also +inhibit expansion. +.PP +Several shell options settable with the +.B shopt +builtin may be used to tailor the behavior of history expansion. +If the +.B histverify +shell option is enabled (see the description of the +.B shopt +builtin below), and +.B readline +is being used, history substitutions are not immediately passed to +the shell parser. +Instead, the expanded line is reloaded into the +.B readline +editing buffer for further modification. +If +.B readline +is being used, and the +.B histreedit +shell option is enabled, a failed history substitution will be reloaded +into the +.B readline +editing buffer for correction. +The +.B \-p +option to the +.B history +builtin command may be used to see what a history expansion will +do before using it. +The +.B \-s +option to the +.B history +builtin may be used to add commands to the end of the history list +without actually executing them, so that they are available for +subsequent recall. +.PP +The shell allows control of the various characters used by the +history expansion mechanism (see the description of +.B histchars +above under +.BR "Shell Variables" ). +The shell uses +the history comment character to mark history timestamps when +writing the history file. +.SS Event Designators +.PP +An event designator is a reference to a command line entry in the +history list. +Unless the reference is absolute, events are relative to the current +position in the history list. +.PP +.PD 0 +.TP +.B ! +Start a history substitution, except when followed by a +.BR blank , +newline, carriage return, = +or ( (when the \fBextglob\fP shell option is enabled using +the \fBshopt\fP builtin). +.TP +.B !\fIn\fR +Refer to command line +.IR n . +.TP +.B !\-\fIn\fR +Refer to the current command minus +.IR n . +.TP +.B !! +Refer to the previous command. This is a synonym for `!\-1'. +.TP +.B !\fIstring\fR +Refer to the most recent command preceding the current position in the +history list starting with +.IR string . +.TP +.B !?\fIstring\fR\fB[?]\fR +Refer to the most recent command preceding the current position in the +history list containing +.IR string . +The trailing \fB?\fP may be omitted if +.I string +is followed immediately by a newline. +.TP +.B \d\s+2^\s-2\u\fIstring1\fP\d\s+2^\s-2\u\fIstring2\fP\d\s+2^\s-2\u +Quick substitution. Repeat the previous command, replacing +.I string1 +with +.IR string2 . +Equivalent to +``!!:s/\fIstring1\fP/\fIstring2\fP/'' +(see \fBModifiers\fP below). +.TP +.B !# +The entire command line typed so far. +.PD +.SS Word Designators +.PP +Word designators are used to select desired words from the event. +A +.B : +separates the event specification from the word designator. +It may be omitted if the word designator begins with a +.BR ^ , +.BR $ , +.BR * , +.BR \- , +or +.BR % . +Words are numbered from the beginning of the line, +with the first word being denoted by 0 (zero). +Words are inserted into the current line separated by single spaces. +.PP +.PD 0 +.TP +.B 0 (zero) +The zeroth word. For the shell, this is the command +word. +.TP +.I n +The \fIn\fRth word. +.TP +.B ^ +The first argument. That is, word 1. +.TP +.B $ +The last word. This is usually the last argument, but will expand to the +zeroth word if there is only one word in the line. +.TP +.B % +The word matched by the most recent `?\fIstring\fR?' search. +.TP +.I x\fB\-\fPy +A range of words; `\-\fIy\fR' abbreviates `0\-\fIy\fR'. +.TP +.B * +All of the words but the zeroth. This is a synonym +for `\fI1\-$\fP'. It is not an error to use +.B * +if there is just one +word in the event; the empty string is returned in that case. +.TP +.B x* +Abbreviates \fIx\-$\fP. +.TP +.B x\- +Abbreviates \fIx\-$\fP like \fBx*\fP, but omits the last word. +.PD +.PP +If a word designator is supplied without an event specification, the +previous command is used as the event. +.SS Modifiers +.PP +After the optional word designator, there may appear a sequence of +one or more of the following modifiers, each preceded by a `:'. +.PP +.PD 0 +.PP +.TP +.B h +Remove a trailing filename component, leaving only the head. +.TP +.B t +Remove all leading filename components, leaving the tail. +.TP +.B r +Remove a trailing suffix of the form \fI.xxx\fP, leaving the +basename. +.TP +.B e +Remove all but the trailing suffix. +.TP +.B p +Print the new command but do not execute it. +.TP +.B q +Quote the substituted words, escaping further substitutions. +.TP +.B x +Quote the substituted words as with +.BR q , +but break into words at +.B blanks +and newlines. +.TP +.B s/\fIold\fP/\fInew\fP/ +Substitute +.I new +for the first occurrence of +.I old +in the event line. Any delimiter can be used in place of /. The +final delimiter is optional if it is the last character of the +event line. The delimiter may be quoted in +.I old +and +.I new +with a single backslash. If & appears in +.IR new , +it is replaced by +.IR old . +A single backslash will quote the &. If +.I old +is null, it is set to the last +.I old +substituted, or, if no previous history substitutions took place, +the last +.I string +in a +.B !?\fIstring\fR\fB[?]\fR +search. +.TP +.B & +Repeat the previous substitution. +.TP +.B g +Cause changes to be applied over the entire event line. This is +used in conjunction with `\fB:s\fP' (e.g., `\fB:gs/\fIold\fP/\fInew\fP/\fR') +or `\fB:&\fP'. If used with +`\fB:s\fP', any delimiter can be used +in place of /, and the final delimiter is optional +if it is the last character of the event line. +An \fBa\fP may be used as a synonym for \fBg\fP. +.TP +.B G +Apply the following `\fBs\fP' modifier once to each word in the event line. +.PD +.SH "SHELL BUILTIN COMMANDS" +.\" start of bash_builtins +.zZ +.PP +Unless otherwise noted, each builtin command documented in this +section as accepting options preceded by +.B \- +accepts +.B \-\- +to signify the end of the options. +The \fB:\fP, \fBtrue\fP, \fBfalse\fP, and \fBtest\fP builtins +do not accept options and do not treat \fB\-\-\fP specially. +The \fBexit\fP, \fBlogout\fP, \fBbreak\fP, \fBcontinue\fP, \fBlet\fP, +and \fBshift\fP builtins accept and process arguments beginning with +\fB\-\fP without requiring \fB\-\-\fP. +Other builtins that accept arguments but are not specified as accepting +options interpret arguments beginning with \fB\-\fP as invalid options and +require \fB\-\-\fP to prevent this interpretation. +.sp .5 +.PD 0 +.TP +\fB:\fP [\fIarguments\fP] +.PD +No effect; the command does nothing beyond expanding +.I arguments +and performing any specified +redirections. A zero exit code is returned. +.TP +\fB .\| \fP \fIfilename\fP [\fIarguments\fP] +.PD 0 +.TP +\fBsource\fP \fIfilename\fP [\fIarguments\fP] +.PD +Read and execute commands from +.I filename +in the current +shell environment and return the exit status of the last command +executed from +.IR filename . +If +.I filename +does not contain a slash, filenames in +.SM +.B PATH +are used to find the directory containing +.IR filename . +The file searched for in +.SM +.B PATH +need not be executable. +When \fBbash\fP is not in \fIposix mode\fP, the current directory is +searched if no file is found in +.SM +.BR PATH . +If the +.B sourcepath +option to the +.B shopt +builtin command is turned off, the +.SM +.B PATH +is not searched. +If any \fIarguments\fP are supplied, they become the positional +parameters when \fIfilename\fP is executed. Otherwise the positional +parameters are unchanged. +The return status is the status of the last command exited within +the script (0 if no commands are executed), and false if +.I filename +is not found or cannot be read. +.TP +\fBalias\fP [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +\fBAlias\fP with no arguments or with the +.B \-p +option prints the list of aliases in the form +\fBalias\fP \fIname\fP=\fIvalue\fP on standard output. +When arguments are supplied, an alias is defined for +each \fIname\fP whose \fIvalue\fP is given. +A trailing space in \fIvalue\fP causes the next word to be +checked for alias substitution when the alias is expanded. +For each \fIname\fP in the argument list for which no \fIvalue\fP +is supplied, the name and value of the alias is printed. +\fBAlias\fP returns true unless a \fIname\fP is given for which +no alias has been defined. +.TP +\fBbg\fP [\fIjobspec\fP ...] +Resume each suspended job \fIjobspec\fP in the background, as if it +had been started with +.BR & . +If +.I jobspec +is not present, the shell's notion of the \fIcurrent job\fP is used. +.B bg +.I jobspec +returns 0 unless run when job control is disabled or, when run with +job control enabled, any specified \fIjobspec\fP was not found +or was started without job control. +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] [\fB\-lpsvPSVX\fP] +.PD 0 +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] [\fB\-q\fP \fIfunction\fP] [\fB\-u\fP \fIfunction\fP] [\fB\-r\fP \fIkeyseq\fP] +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fB\-f\fP \fIfilename\fP +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fB\-x\fP \fIkeyseq\fP:\fIshell\-command\fP +.TP +\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fIkeyseq\fP:\fIfunction\-name\fP +.TP +\fBbind\fP \fIreadline\-command\fP +.PD +Display current +.B readline +key and function bindings, bind a key sequence to a +.B readline +function or macro, or set a +.B readline +variable. +Each non-option argument is a command as it would appear in +.IR .inputrc , +but each binding or command must be passed as a separate argument; +e.g., '"\eC\-x\eC\-r": re\-read\-init\-file'. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-m \fIkeymap\fP +Use +.I keymap +as the keymap to be affected by the subsequent bindings. +Acceptable +.I keymap +names are +\fIemacs, emacs\-standard, emacs\-meta, emacs\-ctlx, vi, +vi\-move, vi\-command\fP, and +.IR vi\-insert . +\fIvi\fP is equivalent to \fIvi\-command\fP; \fIemacs\fP is +equivalent to \fIemacs\-standard\fP. +.TP +.B \-l +List the names of all \fBreadline\fP functions. +.TP +.B \-p +Display \fBreadline\fP function names and bindings in such a way +that they can be re-read. +.TP +.B \-P +List current \fBreadline\fP function names and bindings. +.TP +.B \-s +Display \fBreadline\fP key sequences bound to macros and the strings +they output in such a way that they can be re-read. +.TP +.B \-S +Display \fBreadline\fP key sequences bound to macros and the strings +they output. +.TP +.B \-v +Display \fBreadline\fP variable names and values in such a way that they +can be re-read. +.TP +.B \-V +List current \fBreadline\fP variable names and values. +.TP +.B \-f \fIfilename\fP +Read key bindings from \fIfilename\fP. +.TP +.B \-q \fIfunction\fP +Query about which keys invoke the named \fIfunction\fP. +.TP +.B \-u \fIfunction\fP +Unbind all keys bound to the named \fIfunction\fP. +.TP +.B \-r \fIkeyseq\fP +Remove any current binding for \fIkeyseq\fP. +.TP +.B \-x \fIkeyseq\fP:\fIshell\-command\fP +Cause \fIshell\-command\fP to be executed whenever \fIkeyseq\fP is +entered. +When \fIshell\-command\fP is executed, the shell sets the +.SM +.B READLINE_LINE +variable to the contents of the \fBreadline\fP line buffer and the +.SM +.B READLINE_POINT +variable to the current location of the insertion point. +If the executed command changes the value of +.SM +.B READLINE_LINE +or +.SM +.BR READLINE_POINT , +those new values will be reflected in the editing state. +.TP +.B \-X +List all key sequences bound to shell commands and the associated commands +in a format that can be reused as input. +.PD +.PP +The return value is 0 unless an unrecognized option is given or an +error occurred. +.RE +.TP +\fBbreak\fP [\fIn\fP] +Exit from within a +.BR for , +.BR while , +.BR until , +or +.B select +loop. If \fIn\fP is specified, break \fIn\fP levels. +.I n +must be \(>= 1. If +.I n +is greater than the number of enclosing loops, all enclosing loops +are exited. +The return value is 0 unless \fIn\fP is not greater than or equal to 1. +.TP +\fBbuiltin\fP \fIshell\-builtin\fP [\fIarguments\fP] +Execute the specified shell builtin, passing it +.IR arguments , +and return its exit status. +This is useful when defining a +function whose name is the same as a shell builtin, +retaining the functionality of the builtin within the function. +The \fBcd\fP builtin is commonly redefined this way. +The return status is false if +.I shell\-builtin +is not a shell builtin command. +.TP +\fBcaller\fP [\fIexpr\fP] +Returns the context of any active subroutine call (a shell function or +a script executed with the \fB.\fP or \fBsource\fP builtins). +Without \fIexpr\fP, \fBcaller\fP displays the line number and source +filename of the current subroutine call. +If a non-negative integer is supplied as \fIexpr\fP, \fBcaller\fP +displays the line number, subroutine name, and source file corresponding +to that position in the current execution call stack. This extra +information may be used, for example, to print a stack trace. The +current frame is frame 0. +The return value is 0 unless the shell is not executing a subroutine +call or \fIexpr\fP does not correspond to a valid position in the +call stack. +.TP +\fBcd\fP [\fB\-L\fP|[\fB\-P\fP [\fB\-e\fP]] [\-@]] [\fIdir\fP] +Change the current directory to \fIdir\fP. +if \fIdir\fP is not supplied, the value of the +.SM +.B HOME +shell variable is the default. +Any additional arguments following \fIdir\fP are ignored. +The variable +.SM +.B CDPATH +defines the search path for the directory containing +.IR dir : +each directory name in +.SM +.B CDPATH +is searched for \fIdir\fP. +Alternative directory names in +.SM +.B CDPATH +are separated by a colon (:). A null directory name in +.SM +.B CDPATH +is the same as the current directory, i.e., ``\fB.\fP''. If +.I dir +begins with a slash (/), +then +.SM +.B CDPATH +is not used. The +.B \-P +option causes \fBcd\fP to use the physical directory structure +by resolving symbolic links while traversing \fIdir\fP and +before processing instances of \fI..\fP in \fIdir\fP (see also the +.B \-P +option to the +.B set +builtin command); the +.B \-L +option forces symbolic links to be followed by resolving the link +after processing instances of \fI..\fP in \fIdir\fP. +If \fI..\fP appears in \fIdir\fP, it is processed by removing the +immediately previous pathname component from \fIdir\fP, back to a slash +or the beginning of \fIdir\fP. +If the +.B \-e +option is supplied with +.BR \-P , +and the current working directory cannot be successfully determined +after a successful directory change, \fBcd\fP will return an unsuccessful +status. +On systems that support it, the \fB\-@\fP option presents the extended +attributes associated with a file as a directory. +An argument of +.B \- +is converted to +.SM +.B $OLDPWD +before the directory change is attempted. +If a non-empty directory name from +.SM +.B CDPATH +is used, or if +\fB\-\fP is the first argument, and the directory change is +successful, the absolute pathname of the new working directory is +written to the standard output. +The return value is true if the directory was successfully changed; +false otherwise. +.TP +\fBcommand\fP [\fB\-pVv\fP] \fIcommand\fP [\fIarg\fP ...] +Run +.I command +with +.I args +suppressing the normal shell function lookup. Only builtin +commands or commands found in the +.SM +.B PATH +are executed. If the +.B \-p +option is given, the search for +.I command +is performed using a default value for +.SM +.B PATH +that is guaranteed to find all of the standard utilities. +If either the +.B \-V +or +.B \-v +option is supplied, a description of +.I command +is printed. The +.B \-v +option causes a single word indicating the command or filename +used to invoke +.I command +to be displayed; the +.B \-V +option produces a more verbose description. +If the +.B \-V +or +.B \-v +option is supplied, the exit status is 0 if +.I command +was found, and 1 if not. If neither option is supplied and +an error occurred or +.I command +cannot be found, the exit status is 127. Otherwise, the exit status of the +.B command +builtin is the exit status of +.IR command . +.TP +\fBcompgen\fP [\fIoption\fP] [\fIword\fP] +Generate possible completion matches for \fIword\fP according to +the \fIoption\fPs, which may be any option accepted by the +.B complete +builtin with the exception of \fB\-p\fP and \fB\-r\fP, and write +the matches to the standard output. +When using the \fB\-F\fP or \fB\-C\fP options, the various shell variables +set by the programmable completion facilities, while available, will not +have useful values. +.sp 1 +The matches will be generated in the same way as if the programmable +completion code had generated them directly from a completion specification +with the same flags. +If \fIword\fP is specified, only those completions matching \fIword\fP +will be displayed. +.sp 1 +The return value is true unless an invalid option is supplied, or no +matches were generated. +.TP +\fBcomplete\fP [\fB\-abcdefgjksuv\fP] [\fB\-o\fP \fIcomp-option\fP] [\fB\-DE\fP] [\fB\-A\fP \fIaction\fP] [\fB\-G\fP \fIglobpat\fP] [\fB\-W\fP \fIwordlist\fP] [\fB\-F\fP \fIfunction\fP] [\fB\-C\fP \fIcommand\fP] +.br +[\fB\-X\fP \fIfilterpat\fP] [\fB\-P\fP \fIprefix\fP] [\fB\-S\fP \fIsuffix\fP] \fIname\fP [\fIname ...\fP] +.PD 0 +.TP +\fBcomplete\fP \fB\-pr\fP [\fB\-DE\fP] [\fIname\fP ...] +.PD +Specify how arguments to each \fIname\fP should be completed. +If the \fB\-p\fP option is supplied, or if no options are supplied, +existing completion specifications are printed in a way that allows +them to be reused as input. +The \fB\-r\fP option removes a completion specification for +each \fIname\fP, or, if no \fIname\fPs are supplied, all +completion specifications. +The \fB\-D\fP option indicates that the remaining options and actions should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The \fB\-E\fP option indicates that the remaining options and actions should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +.sp 1 +The process of applying these completion specifications when word completion +is attempted is described above under \fBProgrammable Completion\fP. +.sp 1 +Other options, if specified, have the following meanings. +The arguments to the \fB\-G\fP, \fB\-W\fP, and \fB\-X\fP options +(and, if necessary, the \fB\-P\fP and \fB\-S\fP options) +should be quoted to protect them from expansion before the +.B complete +builtin is invoked. +.RS +.PD 0 +.TP 8 +\fB\-o\fP \fIcomp-option\fP +The \fIcomp-option\fP controls several aspects of the compspec's behavior +beyond the simple generation of completions. +\fIcomp-option\fP may be one of: +.RS +.TP 8 +.B bashdefault +Perform the rest of the default \fBbash\fP completions if the compspec +generates no matches. +.TP 8 +.B default +Use readline's default filename completion if the compspec generates +no matches. +.TP 8 +.B dirnames +Perform directory name completion if the compspec generates no matches. +.TP 8 +.B filenames +Tell readline that the compspec generates filenames, so it can perform any +filename\-specific processing (like adding a slash to directory names, +quoting special characters, or suppressing trailing spaces). +Intended to be used with shell functions. +.TP 8 +.B noquote +Tell readline not to quote the completed words if they are filenames +(quoting filenames is the default). +.TP 8 +.B nospace +Tell readline not to append a space (the default) to words completed at +the end of the line. +.TP 8 +.B plusdirs +After any matches defined by the compspec are generated, +directory name completion is attempted and any +matches are added to the results of the other actions. +.RE +.TP 8 +\fB\-A\fP \fIaction\fP +The \fIaction\fP may be one of the following to generate a list of possible +completions: +.RS +.TP 8 +.B alias +Alias names. May also be specified as \fB\-a\fP. +.TP 8 +.B arrayvar +Array variable names. +.TP 8 +.B binding +\fBReadline\fP key binding names. +.TP 8 +.B builtin +Names of shell builtin commands. May also be specified as \fB\-b\fP. +.TP 8 +.B command +Command names. May also be specified as \fB\-c\fP. +.TP 8 +.B directory +Directory names. May also be specified as \fB\-d\fP. +.TP 8 +.B disabled +Names of disabled shell builtins. +.TP 8 +.B enabled +Names of enabled shell builtins. +.TP 8 +.B export +Names of exported shell variables. May also be specified as \fB\-e\fP. +.TP 8 +.B file +File names. May also be specified as \fB\-f\fP. +.TP 8 +.B function +Names of shell functions. +.TP 8 +.B group +Group names. May also be specified as \fB\-g\fP. +.TP 8 +.B helptopic +Help topics as accepted by the \fBhelp\fP builtin. +.TP 8 +.B hostname +Hostnames, as taken from the file specified by the +.SM +.B HOSTFILE +shell variable. +.TP 8 +.B job +Job names, if job control is active. May also be specified as \fB\-j\fP. +.TP 8 +.B keyword +Shell reserved words. May also be specified as \fB\-k\fP. +.TP 8 +.B running +Names of running jobs, if job control is active. +.TP 8 +.B service +Service names. May also be specified as \fB\-s\fP. +.TP 8 +.B setopt +Valid arguments for the \fB\-o\fP option to the \fBset\fP builtin. +.TP 8 +.B shopt +Shell option names as accepted by the \fBshopt\fP builtin. +.TP 8 +.B signal +Signal names. +.TP 8 +.B stopped +Names of stopped jobs, if job control is active. +.TP 8 +.B user +User names. May also be specified as \fB\-u\fP. +.TP 8 +.B variable +Names of all shell variables. May also be specified as \fB\-v\fP. +.RE +.TP 8 +\fB\-C\fP \fIcommand\fP +\fIcommand\fP is executed in a subshell environment, and its output is +used as the possible completions. +.TP 8 +\fB\-F\fP \fIfunction\fP +The shell function \fIfunction\fP is executed in the current shell +environment. +When the function is executed, +the first argument (\fB$1\fP) is the name of the command whose arguments are +being completed, +the second argument (\fB$2\fP) is the word being completed, +and the third argument (\fB$3\fP) is the word preceding the word being +completed on the current command line. +When it finishes, the possible completions are retrieved from the value +of the +.SM +.B COMPREPLY +array variable. +.TP 8 +\fB\-G\fP \fIglobpat\fP +The pathname expansion pattern \fIglobpat\fP is expanded to generate +the possible completions. +.TP 8 +\fB\-P\fP \fIprefix\fP +\fIprefix\fP is added at the beginning of each possible completion +after all other options have been applied. +.TP 8 +\fB\-S\fP \fIsuffix\fP +\fIsuffix\fP is appended to each possible completion +after all other options have been applied. +.TP 8 +\fB\-W\fP \fIwordlist\fP +The \fIwordlist\fP is split using the characters in the +.SM +.B IFS +special variable as delimiters, and each resultant word is expanded. +The possible completions are the members of the resultant list which +match the word being completed. +.TP 8 +\fB\-X\fP \fIfilterpat\fP +\fIfilterpat\fP is a pattern as used for pathname expansion. +It is applied to the list of possible completions generated by the +preceding options and arguments, and each completion matching +\fIfilterpat\fP is removed from the list. +A leading \fB!\fP in \fIfilterpat\fP negates the pattern; in this +case, any completion not matching \fIfilterpat\fP is removed. +.PD +.PP +The return value is true unless an invalid option is supplied, an option +other than \fB\-p\fP or \fB\-r\fP is supplied without a \fIname\fP +argument, an attempt is made to remove a completion specification for +a \fIname\fP for which no specification exists, or +an error occurs adding a completion specification. +.RE +.TP +\fBcompopt\fP [\fB\-o\fP \fIoption\fP] [\fB\-DE\fP] [\fB+o\fP \fIoption\fP] [\fIname\fP] +Modify completion options for each \fIname\fP according to the +\fIoption\fPs, or for the +currently-executing completion if no \fIname\fPs are supplied. +If no \fIoption\fPs are given, display the completion options for each +\fIname\fP or the current completion. +The possible values of \fIoption\fP are those valid for the \fBcomplete\fP +builtin described above. +The \fB\-D\fP option indicates that the remaining options should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The \fB\-E\fP option indicates that the remaining options should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +.sp 1 +The return value is true unless an invalid option is supplied, an attempt +is made to modify the options for a \fIname\fP for which no completion +specification exists, or an output error occurs. +.TP +\fBcontinue\fP [\fIn\fP] +Resume the next iteration of the enclosing +.BR for , +.BR while , +.BR until , +or +.B select +loop. +If +.I n +is specified, resume at the \fIn\fPth enclosing loop. +.I n +must be \(>= 1. If +.I n +is greater than the number of enclosing loops, the last enclosing loop +(the ``top-level'' loop) is resumed. +The return value is 0 unless \fIn\fP is not greater than or equal to 1. +.TP +\fBdeclare\fP [\fB\-aAfFgilnrtux\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +.PD 0 +.TP +\fBtypeset\fP [\fB\-aAfFgilnrtux\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +.PD +Declare variables and/or give them attributes. +If no \fIname\fPs are given then display the values of variables. +The +.B \-p +option will display the attributes and values of each +.IR name . +When +.B \-p +is used with \fIname\fP arguments, additional options, +other than \fB\-f\fP and \fB\-F\fP, are ignored. +When +.B \-p +is supplied without \fIname\fP arguments, it will display the attributes +and values of all variables having the attributes specified by the +additional options. +If no other options are supplied with \fB\-p\fP, \fBdeclare\fP will display +the attributes and values of all shell variables. The \fB\-f\fP option +will restrict the display to shell functions. +The +.B \-F +option inhibits the display of function definitions; only the +function name and attributes are printed. +If the \fBextdebug\fP shell option is enabled using \fBshopt\fP, +the source file name and line number where the function is defined +are displayed as well. The +.B \-F +option implies +.BR \-f . +The +.B \-g +option forces variables to be created or modified at the global scope, +even when \fBdeclare\fP is executed in a shell function. +It is ignored in all other cases. +The following options can +be used to restrict output to variables with the specified attribute or +to give variables attributes: +.RS +.PD 0 +.TP +.B \-a +Each \fIname\fP is an indexed array variable (see +.B Arrays +above). +.TP +.B \-A +Each \fIname\fP is an associative array variable (see +.B Arrays +above). +.TP +.B \-f +Use function names only. +.TP +.B \-i +The variable is treated as an integer; arithmetic evaluation (see +.SM +.B "ARITHMETIC EVALUATION" +above) is performed when the variable is assigned a value. +.TP +.B \-l +When the variable is assigned a value, all upper-case characters are +converted to lower-case. +The upper-case attribute is disabled. +.TP +.B \-n +Give each \fIname\fP the \fInameref\fP attribute, making +it a name reference to another variable. +That other variable is defined by the value of \fIname\fP. +All references and assignments to \fIname\fP, except for changing the +\fB\-n\fP attribute itself, are performed on the variable referenced by +\fIname\fP's value. +The \fB\-n\fP attribute cannot be applied to array variables. +.TP +.B \-r +Make \fIname\fPs readonly. These names cannot then be assigned values +by subsequent assignment statements or unset. +.TP +.B \-t +Give each \fIname\fP the \fItrace\fP attribute. +Traced functions inherit the \fBDEBUG\fP and \fBRETURN\fP traps from +the calling shell. +The trace attribute has no special meaning for variables. +.TP +.B \-u +When the variable is assigned a value, all lower-case characters are +converted to upper-case. +The lower-case attribute is disabled. +.TP +.B \-x +Mark \fIname\fPs for export to subsequent commands via the environment. +.PD +.PP +Using `+' instead of `\-' +turns off the attribute instead, +with the exceptions that \fB+a\fP +may not be used to destroy an array variable and \fB+r\fP will not +remove the readonly attribute. +When used in a function, +.B declare +and +.B typeset +make each +\fIname\fP local, as with the +.B local +command, +unless the \fB\-g\fP option is supplied. +If a variable name is followed by =\fIvalue\fP, the value of +the variable is set to \fIvalue\fP. +When using \fB\-a\fP or \fB\-A\fP and the compound assignment syntax to +create array variables, additional attributes do not take effect until +subsequent assignments. +The return value is 0 unless an invalid option is encountered, +an attempt is made to define a function using +.if n ``\-f foo=bar'', +.if t \f(CW\-f foo=bar\fP, +an attempt is made to assign a value to a readonly variable, +an attempt is made to assign a value to an array variable without +using the compound assignment syntax (see +.B Arrays +above), one of the \fInames\fP is not a valid shell variable name, +an attempt is made to turn off readonly status for a readonly variable, +an attempt is made to turn off array status for an array variable, +or an attempt is made to display a non-existent function with \fB\-f\fP. +.RE +.TP +.B dirs [\fB\-clpv\fP] [+\fIn\fP] [\-\fIn\fP] +Without options, displays the list of currently remembered directories. +The default display is on a single line with directory names separated +by spaces. +Directories are added to the list with the +.B pushd +command; the +.B popd +command removes entries from the list. +.RS +.PD 0 +.TP +.B \-c +Clears the directory stack by deleting all of the entries. +.TP +.B \-l +Produces a listing using full pathnames; +the default listing format uses a tilde to denote the home directory. +.TP +.B \-p +Print the directory stack with one entry per line. +.TP +.B \-v +Print the directory stack with one entry per line, +prefixing each entry with its index in the stack. +.TP +\fB+\fP\fIn\fP +Displays the \fIn\fPth entry counting from the left of the list +shown by +.B dirs +when invoked without options, starting with zero. +.TP +\fB\-\fP\fIn\fP +Displays the \fIn\fPth entry counting from the right of the list +shown by +.B dirs +when invoked without options, starting with zero. +.PD +.PP +The return value is 0 unless an +invalid option is supplied or \fIn\fP indexes beyond the end +of the directory stack. +.RE +.TP +\fBdisown\fP [\fB\-ar\fP] [\fB\-h\fP] [\fIjobspec\fP ...] +Without options, remove each +.I jobspec +from the table of active jobs. +If +.I jobspec +is not present, and neither the \fB\-a\fP nor the \fB\-r\fP option +is supplied, the \fIcurrent job\fP is used. +If the \fB\-h\fP option is given, each +.I jobspec +is not removed from the table, but is marked so that +.SM +.B SIGHUP +is not sent to the job if the shell receives a +.SM +.BR SIGHUP . +If no +.I jobspec +is supplied, the +.B \-a +option means to remove or mark all jobs; the +.B \-r +option without a +.I jobspec +argument restricts operation to running jobs. +The return value is 0 unless a +.I jobspec +does not specify a valid job. +.TP +\fBecho\fP [\fB\-neE\fP] [\fIarg\fP ...] +Output the \fIarg\fPs, separated by spaces, followed by a newline. +The return status is 0 unless a write error occurs. +If \fB\-n\fP is specified, the trailing newline is +suppressed. If the \fB\-e\fP option is given, interpretation of +the following backslash-escaped characters is enabled. The +.B \-E +option disables the interpretation of these escape characters, +even on systems where they are interpreted by default. +The \fBxpg_echo\fP shell option may be used to +dynamically determine whether or not \fBecho\fP expands these +escape characters by default. +.B echo +does not interpret \fB\-\-\fP to mean the end of options. +.B echo +interprets the following escape sequences: +.RS +.PD 0 +.TP +.B \ea +alert (bell) +.TP +.B \eb +backspace +.TP +.B \ec +suppress further output +.TP +.B \ee +.TP +.B \eE +an escape character +.TP +.B \ef +form feed +.TP +.B \en +new line +.TP +.B \er +carriage return +.TP +.B \et +horizontal tab +.TP +.B \ev +vertical tab +.TP +.B \e\e +backslash +.TP +.B \e0\fInnn\fP +the eight-bit character whose value is the octal value \fInnn\fP +(zero to three octal digits) +.TP +.B \ex\fIHH\fP +the eight-bit character whose value is the hexadecimal value \fIHH\fP +(one or two hex digits) +.TP +.B \eu\fIHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHH\fP (one to four hex digits) +.TP +.B \eU\fIHHHHHHHH\fP +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +\fIHHHHHHHH\fP (one to eight hex digits) +.PD +.RE +.TP +\fBenable\fP [\fB\-a\fP] [\fB\-dnps\fP] [\fB\-f\fP \fIfilename\fP] [\fIname\fP ...] +Enable and disable builtin shell commands. +Disabling a builtin allows a disk command which has the same name +as a shell builtin to be executed without specifying a full pathname, +even though the shell normally searches for builtins before disk commands. +If \fB\-n\fP is used, each \fIname\fP +is disabled; otherwise, +\fInames\fP are enabled. For example, to use the +.B test +binary found via the +.SM +.B PATH +instead of the shell builtin version, run +.if t \f(CWenable -n test\fP. +.if n ``enable -n test''. +The +.B \-f +option means to load the new builtin command +.I name +from shared object +.IR filename , +on systems that support dynamic loading. The +.B \-d +option will delete a builtin previously loaded with +.BR \-f . +If no \fIname\fP arguments are given, or if the +.B \-p +option is supplied, a list of shell builtins is printed. +With no other option arguments, the list consists of all enabled +shell builtins. +If \fB\-n\fP is supplied, only disabled builtins are printed. +If \fB\-a\fP is supplied, the list printed includes all builtins, with an +indication of whether or not each is enabled. +If \fB\-s\fP is supplied, the output is restricted to the POSIX +\fIspecial\fP builtins. +The return value is 0 unless a +.I name +is not a shell builtin or there is an error loading a new builtin +from a shared object. +.TP +\fBeval\fP [\fIarg\fP ...] +The \fIarg\fPs are read and concatenated together into a single +command. This command is then read and executed by the shell, and +its exit status is returned as the value of +.BR eval . +If there are no +.IR args , +or only null arguments, +.B eval +returns 0. +.TP +\fBexec\fP [\fB\-cl\fP] [\fB\-a\fP \fIname\fP] [\fIcommand\fP [\fIarguments\fP]] +If +.I command +is specified, it replaces the shell. +No new process is created. The +.I arguments +become the arguments to \fIcommand\fP. +If the +.B \-l +option is supplied, +the shell places a dash at the beginning of the zeroth argument passed to +.IR command . +This is what +.IR login (1) +does. The +.B \-c +option causes +.I command +to be executed with an empty environment. If +.B \-a +is supplied, the shell passes +.I name +as the zeroth argument to the executed command. +If +.I command +cannot be executed for some reason, a non-interactive shell exits, +unless the +.B execfail +shell option +is enabled. In that case, it returns failure. +An interactive shell returns failure if the file cannot be executed. +If +.I command +is not specified, any redirections take effect in the current shell, +and the return status is 0. If there is a redirection error, the +return status is 1. +.TP +\fBexit\fP [\fIn\fP] +Cause the shell to exit +with a status of \fIn\fP. If +.I n +is omitted, the exit status +is that of the last command executed. +A trap on +.SM +.B EXIT +is executed before the shell terminates. +.TP +\fBexport\fP [\fB\-fn\fP\^] [\fIname\fP[=\fIword\fP]] ... +.PD 0 +.TP +.B export \-p +.PD +The supplied +.I names +are marked for automatic export to the environment of +subsequently executed commands. If the +.B \-f +option is given, +the +.I names +refer to functions. +If no +.I names +are given, or if the +.B \-p +option is supplied, a list +of names of all exported variables is printed. +The +.B \-n +option causes the export property to be removed from each +\fIname\fP. +If a variable name is followed by =\fIword\fP, the value of +the variable is set to \fIword\fP. +.B export +returns an exit status of 0 unless an invalid option is +encountered, +one of the \fInames\fP is not a valid shell variable name, or +.B \-f +is supplied with a +.I name +that is not a function. +.TP +\fBfc\fP [\fB\-e\fP \fIename\fP] [\fB\-lnr\fP] [\fIfirst\fP] [\fIlast\fP] +.PD 0 +.TP +\fBfc\fP \fB\-s\fP [\fIpat\fP=\fIrep\fP] [\fIcmd\fP] +.PD +The first form selects a range of commands from +.I first +to +.I last +from the history list and displays or edits and re-executes them. +.I First +and +.I last +may be specified as a string (to locate the last command beginning +with that string) or as a number (an index into the history list, +where a negative number is used as an offset from the current +command number). If +.I last +is not specified it is set to +the current command for listing (so that +.if n ``fc \-l \-10'' +.if t \f(CWfc \-l \-10\fP +prints the last 10 commands) and to +.I first +otherwise. +If +.I first +is not specified it is set to the previous +command for editing and \-16 for listing. +.sp 1 +The +.B \-n +option suppresses +the command numbers when listing. The +.B \-r +option reverses the order of +the commands. If the +.B \-l +option is given, +the commands are listed on +standard output. Otherwise, the editor given by +.I ename +is invoked +on a file containing those commands. If +.I ename +is not given, the +value of the +.SM +.B FCEDIT +variable is used, and +the value of +.SM +.B EDITOR +if +.SM +.B FCEDIT +is not set. If neither variable is set, +.FN vi +is used. When editing is complete, the edited commands are +echoed and executed. +.sp 1 +In the second form, \fIcommand\fP is re-executed after each instance +of \fIpat\fP is replaced by \fIrep\fP. +\fICommand\fP is intepreted the same as \fIfirst\fP above. +A useful alias to use with this is +.if n ``r="fc -s"'', +.if t \f(CWr='fc \-s'\fP, +so that typing +.if n ``r cc'' +.if t \f(CWr cc\fP +runs the last command beginning with +.if n ``cc'' +.if t \f(CWcc\fP +and typing +.if n ``r'' +.if t \f(CWr\fP +re-executes the last command. +.sp 1 +If the first form is used, the return value is 0 unless an invalid +option is encountered or +.I first +or +.I last +specify history lines out of range. +If the +.B \-e +option is supplied, the return value is the value of the last +command executed or failure if an error occurs with the temporary +file of commands. If the second form is used, the return status +is that of the command re-executed, unless +.I cmd +does not specify a valid history line, in which case +.B fc +returns failure. +.TP +\fBfg\fP [\fIjobspec\fP] +Resume +.I jobspec +in the foreground, and make it the current job. +If +.I jobspec +is not present, the shell's notion of the \fIcurrent job\fP is used. +The return value is that of the command placed into the foreground, +or failure if run when job control is disabled or, when run with +job control enabled, if +.I jobspec +does not specify a valid job or +.I jobspec +specifies a job that was started without job control. +.TP +\fBgetopts\fP \fIoptstring\fP \fIname\fP [\fIargs\fP] +.B getopts +is used by shell procedures to parse positional parameters. +.I optstring +contains the option characters to be recognized; if a character +is followed by a colon, the option is expected to have an +argument, which should be separated from it by white space. +The colon and question mark characters may not be used as +option characters. +Each time it is invoked, +.B getopts +places the next option in the shell variable +.IR name , +initializing +.I name +if it does not exist, +and the index of the next argument to be processed into the +variable +.SM +.BR OPTIND . +.SM +.B OPTIND +is initialized to 1 each time the shell or a shell script +is invoked. When an option requires an argument, +.B getopts +places that argument into the variable +.SM +.BR OPTARG . +The shell does not reset +.SM +.B OPTIND +automatically; it must be manually reset between multiple +calls to +.B getopts +within the same shell invocation if a new set of parameters +is to be used. +.sp 1 +When the end of options is encountered, \fBgetopts\fP exits with a +return value greater than zero. +.SM +.B OPTIND +is set to the index of the first non-option argument, +and \fIname\fP is set to ?. +.sp 1 +.B getopts +normally parses the positional parameters, but if more arguments are +given in +.IR args , +.B getopts +parses those instead. +.sp 1 +.B getopts +can report errors in two ways. If the first character of +.I optstring +is a colon, +.I silent +error reporting is used. In normal operation, diagnostic messages +are printed when invalid options or missing option arguments are +encountered. +If the variable +.SM +.B OPTERR +is set to 0, no error messages will be displayed, even if the first +character of +.I optstring +is not a colon. +.sp 1 +If an invalid option is seen, +.B getopts +places ? into +.I name +and, if not silent, +prints an error message and unsets +.SM +.BR OPTARG . +If +.B getopts +is silent, +the option character found is placed in +.SM +.B OPTARG +and no diagnostic message is printed. +.sp 1 +If a required argument is not found, and +.B getopts +is not silent, +a question mark (\^\fB?\fP\^) is placed in +.IR name , +.SM +.B OPTARG +is unset, and a diagnostic message is printed. +If +.B getopts +is silent, then a colon (\^\fB:\fP\^) is placed in +.I name +and +.SM +.B OPTARG +is set to the option character found. +.sp 1 +.B getopts +returns true if an option, specified or unspecified, is found. +It returns false if the end of options is encountered or an +error occurs. +.TP +\fBhash\fP [\fB\-lr\fP] [\fB\-p\fP \fIfilename\fP] [\fB\-dt\fP] [\fIname\fP] +Each time \fBhash\fP is invoked, +the full pathname of the command +.I name +is determined by searching +the directories in +.B $PATH +and remembered. Any previously-remembered pathname is discarded. +If the +.B \-p +option is supplied, no path search is performed, and +.I filename +is used as the full filename of the command. +The +.B \-r +option causes the shell to forget all +remembered locations. +The +.B \-d +option causes the shell to forget the remembered location of each \fIname\fP. +If the +.B \-t +option is supplied, the full pathname to which each \fIname\fP corresponds +is printed. If multiple \fIname\fP arguments are supplied with \fB\-t\fP, +the \fIname\fP is printed before the hashed full pathname. +The +.B \-l +option causes output to be displayed in a format that may be reused as input. +If no arguments are given, or if only \fB\-l\fP is supplied, +information about remembered commands is printed. +The return status is true unless a +.I name +is not found or an invalid option is supplied. +.TP +\fBhelp\fP [\fB\-dms\fP] [\fIpattern\fP] +Display helpful information about builtin commands. If +.I pattern +is specified, +.B help +gives detailed help on all commands matching +.IR pattern ; +otherwise help for all the builtins and shell control structures +is printed. +.RS +.PD 0 +.TP +.B \-d +Display a short description of each \fIpattern\fP +.TP +.B \-m +Display the description of each \fIpattern\fP in a manpage-like format +.TP +.B \-s +Display only a short usage synopsis for each \fIpattern\fP +.PD +.PP +The return status is 0 unless no command matches +.IR pattern . +.RE +.TP +\fBhistory [\fIn\fP] +.PD 0 +.TP +\fBhistory\fP \fB\-c\fP +.TP +\fBhistory \-d\fP \fIoffset\fP +.TP +\fBhistory\fP \fB\-anrw\fP [\fIfilename\fP] +.TP +\fBhistory\fP \fB\-p\fP \fIarg\fP [\fIarg ...\fP] +.TP +\fBhistory\fP \fB\-s\fP \fIarg\fP [\fIarg ...\fP] +.PD +With no options, display the command +history list with line numbers. Lines listed +with a +.B * +have been modified. An argument of +.I n +lists only the last +.I n +lines. +If the shell variable +.SM +.B HISTTIMEFORMAT +is set and not null, +it is used as a format string for \fIstrftime\fP(3) to display +the time stamp associated with each displayed history entry. +No intervening blank is printed between the formatted time stamp +and the history line. +If \fIfilename\fP is supplied, it is used as the +name of the history file; if not, the value of +.SM +.B HISTFILE +is used. Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-c +Clear the history list by deleting all the entries. +.TP +\fB\-d\fP \fIoffset\fP +Delete the history entry at position \fIoffset\fP. +.TP +.B \-a +Append the ``new'' history lines (history lines entered since the +beginning of the current \fBbash\fP session) to the history file. +.TP +.B \-n +Read the history lines not already read from the history +file into the current history list. These are lines +appended to the history file since the beginning of the +current \fBbash\fP session. +.TP +.B \-r +Read the contents of the history file +and append them to the current history list. +.TP +.B \-w +Write the current history list to the history file, overwriting the +history file's contents. +.TP +.B \-p +Perform history substitution on the following \fIargs\fP and display +the result on the standard output. +Does not store the results in the history list. +Each \fIarg\fP must be quoted to disable normal history expansion. +.TP +.B \-s +Store the +.I args +in the history list as a single entry. The last command in the +history list is removed before the +.I args +are added. +.PD +.PP +If the +.SM +.B HISTTIMEFORMAT +variable is set, the time stamp information +associated with each history entry is written to the history file, +marked with the history comment character. +When the history file is read, lines beginning with the history +comment character followed immediately by a digit are interpreted +as timestamps for the previous history line. +The return value is 0 unless an invalid option is encountered, an +error occurs while reading or writing the history file, an invalid +\fIoffset\fP is supplied as an argument to \fB\-d\fP, or the +history expansion supplied as an argument to \fB\-p\fP fails. +.RE +.TP +\fBjobs\fP [\fB\-lnprs\fP] [ \fIjobspec\fP ... ] +.PD 0 +.TP +\fBjobs\fP \fB\-x\fP \fIcommand\fP [ \fIargs\fP ... ] +.PD +The first form lists the active jobs. The options have the following +meanings: +.RS +.PD 0 +.TP +.B \-l +List process IDs +in addition to the normal information. +.TP +.B \-n +Display information only about jobs that have changed status since +the user was last notified of their status. +.TP +.B \-p +List only the process ID of the job's process group +leader. +.TP +.B \-r +Display only running jobs. +.TP +.B \-s +Display only stopped jobs. +.PD +.PP +If +.I jobspec +is given, output is restricted to information about that job. +The return status is 0 unless an invalid option is encountered +or an invalid +.I jobspec +is supplied. +.PP +If the +.B \-x +option is supplied, +.B jobs +replaces any +.I jobspec +found in +.I command +or +.I args +with the corresponding process group ID, and executes +.I command +passing it +.IR args , +returning its exit status. +.RE +.TP +\fBkill\fP [\fB\-s\fP \fIsigspec\fP | \fB\-n\fP \fIsignum\fP | \fB\-\fP\fIsigspec\fP] [\fIpid\fP | \fIjobspec\fP] ... +.PD 0 +.TP +\fBkill\fP \fB\-l\fP [\fIsigspec\fP | \fIexit_status\fP] +.PD +Send the signal named by +.I sigspec +or +.I signum +to the processes named by +.I pid +or +.IR jobspec . +.I sigspec +is either a case-insensitive signal name such as +.SM +.B SIGKILL +(with or without the +.SM +.B SIG +prefix) or a signal number; +.I signum +is a signal number. +If +.I sigspec +is not present, then +.SM +.B SIGTERM +is assumed. +An argument of +.B \-l +lists the signal names. +If any arguments are supplied when +.B \-l +is given, the names of the signals corresponding to the arguments are +listed, and the return status is 0. +The \fIexit_status\fP argument to +.B \-l +is a number specifying either a signal number or the exit status of +a process terminated by a signal. +.B kill +returns true if at least one signal was successfully sent, or false +if an error occurs or an invalid option is encountered. +.TP +\fBlet\fP \fIarg\fP [\fIarg\fP ...] +Each +.I arg +is an arithmetic expression to be evaluated (see +.SM +.B "ARITHMETIC EVALUATION" +above). +If the last +.I arg +evaluates to 0, +.B let +returns 1; 0 is returned otherwise. +.TP +\fBlocal\fP [\fIoption\fP] [\fIname\fP[=\fIvalue\fP] ...] +For each argument, a local variable named +.I name +is created, and assigned +.IR value . +The \fIoption\fP can be any of the options accepted by \fBdeclare\fP. +When +.B local +is used within a function, it causes the variable +.I name +to have a visible scope restricted to that function and its children. +With no operands, +.B local +writes a list of local variables to the standard output. It is +an error to use +.B local +when not within a function. The return status is 0 unless +.B local +is used outside a function, an invalid +.I name +is supplied, or +\fIname\fP is a readonly variable. +.TP +.B logout +Exit a login shell. +.TP +\fBmapfile\fP [\fB\-n\fP \fIcount\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-s\fP \fIcount\fP] [\fB\-t\fP] [\fB\-u\fP \fIfd\fP] [\fB\-C\fP \fIcallback\fP] [\fB\-c\fP \fIquantum\fP] [\fIarray\fP] +.PD 0 +.TP +\fBreadarray\fP [\fB\-n\fP \fIcount\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-s\fP \fIcount\fP] [\fB\-t\fP] [\fB\-u\fP \fIfd\fP] [\fB\-C\fP \fIcallback\fP] [\fB\-c\fP \fIquantum\fP] [\fIarray\fP] +.PD +Read lines from the standard input into the indexed array variable +.IR array , +or from file descriptor +.IR fd +if the +.B \-u +option is supplied. +The variable +.SM +.B MAPFILE +is the default \fIarray\fP. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Copy at most +.I count +lines. If \fIcount\fP is 0, all lines are copied. +.TP +.B \-O +Begin assigning to +.I array +at index +.IR origin . +The default index is 0. +.TP +.B \-s +Discard the first \fIcount\fP lines read. +.TP +.B \-t +Remove a trailing newline from each line read. +.TP +.B \-u +Read lines from file descriptor \fIfd\fP instead of the standard input. +.TP +.B \-C +Evaluate +.I callback +each time \fIquantum\fP lines are read. The \fB\-c\fP option specifies +.IR quantum . +.TP +.B \-c +Specify the number of lines read between each call to +.IR callback . +.PD +.PP +If +.B \-C +is specified without +.BR \-c , +the default quantum is 5000. +When \fIcallback\fP is evaluated, it is supplied the index of the next +array element to be assigned and the line to be assigned to that element +as additional arguments. +\fIcallback\fP is evaluated after the line is read but before the +array element is assigned. +.PP +If not supplied with an explicit origin, \fBmapfile\fP will clear \fIarray\fP +before assigning to it. +.PP +\fBmapfile\fP returns successfully unless an invalid option or option +argument is supplied, \fIarray\fP is invalid or unassignable, or if +\fIarray\fP is not an indexed array. +.RE +.TP +\fBpopd\fP [\-\fBn\fP] [+\fIn\fP] [\-\fIn\fP] +Removes entries from the directory stack. With no arguments, +removes the top directory from the stack, and performs a +.B cd +to the new top directory. +Arguments, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Suppresses the normal change of directory when removing directories +from the stack, so that only the stack is manipulated. +.TP +\fB+\fP\fIn\fP +Removes the \fIn\fPth entry counting from the left of the list +shown by +.BR dirs , +starting with zero. For example: +.if n ``popd +0'' +.if t \f(CWpopd +0\fP +removes the first directory, +.if n ``popd +1'' +.if t \f(CWpopd +1\fP +the second. +.TP +\fB\-\fP\fIn\fP +Removes the \fIn\fPth entry counting from the right of the list +shown by +.BR dirs , +starting with zero. For example: +.if n ``popd -0'' +.if t \f(CWpopd -0\fP +removes the last directory, +.if n ``popd -1'' +.if t \f(CWpopd -1\fP +the next to last. +.PD +.PP +If the +.B popd +command is successful, a +.B dirs +is performed as well, and the return status is 0. +.B popd +returns false if an invalid option is encountered, the directory stack +is empty, a non-existent directory stack entry is specified, or the +directory change fails. +.RE +.TP +\fBprintf\fP [\fB\-v\fP \fIvar\fP] \fIformat\fP [\fIarguments\fP] +Write the formatted \fIarguments\fP to the standard output under the +control of the \fIformat\fP. +The \fB\-v\fP option causes the output to be assigned to the variable +\fIvar\fP rather than being printed to the standard output. +.sp 1 +The \fIformat\fP is a character string which contains three types of objects: +plain characters, which are simply copied to standard output, character +escape sequences, which are converted and copied to the standard output, and +format specifications, each of which causes printing of the next successive +\fIargument\fP. +In addition to the standard \fIprintf\fP(1) format specifications, +\fBprintf\fP interprets the following extensions: +.RS +.PD 0 +.TP +.B %b +causes +\fBprintf\fP to expand backslash escape sequences in the corresponding +\fIargument\fP (except that \fB\ec\fP terminates output, backslashes in +\fB\e\(aq\fP, \fB\e"\fP, and \fB\e?\fP are not removed, and octal escapes +beginning with \fB\e0\fP may contain up to four digits). +.TP +.B %q +causes \fBprintf\fP to output the corresponding +\fIargument\fP in a format that can be reused as shell input. +.TP +.B %(\fIdatefmt\fP)T +causes \fBprintf\fP to output the date-time string resulting from using +\fIdatefmt\fP as a format string for \fIstrftime\fP(3). +The corresponding \fIargument\fP is an integer representing the number of +seconds since the epoch. +Two special argument values may be used: -1 represents the current +time, and -2 represents the time the shell was invoked. +If no argument is specified, conversion behaves as if -1 had been given. +This is an exception to the usual \fBprintf\fP behavior. +.PD +.PP +Arguments to non-string format specifiers are treated as C constants, +except that a leading plus or minus sign is allowed, and if the leading +character is a single or double quote, the value is the ASCII value of +the following character. +.PP +The \fIformat\fP is reused as necessary to consume all of the \fIarguments\fP. +If the \fIformat\fP requires more \fIarguments\fP than are supplied, the +extra format specifications behave as if a zero value or null string, as +appropriate, had been supplied. +The return value is zero on success, non-zero on failure. +.RE +.TP +\fBpushd\fP [\fB\-n\fP] [+\fIn\fP] [\-\fIn\fP] +.PD 0 +.TP +\fBpushd\fP [\fB\-n\fP] [\fIdir\fP] +.PD +Adds a directory to the top of the directory stack, or rotates +the stack, making the new top of the stack the current working +directory. With no arguments, exchanges the top two directories +and returns 0, unless the directory stack is empty. +Arguments, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-n +Suppresses the normal change of directory when adding directories +to the stack, so that only the stack is manipulated. +.TP +\fB+\fP\fIn\fP +Rotates the stack so that the \fIn\fPth directory +(counting from the left of the list shown by +.BR dirs , +starting with zero) +is at the top. +.TP +\fB\-\fP\fIn\fP +Rotates the stack so that the \fIn\fPth directory +(counting from the right of the list shown by +.BR dirs , +starting with zero) is at the top. +.TP +.I dir +Adds +.I dir +to the directory stack at the top, making it the +new current working directory as if it had been supplied as the argument +to the \fBcd\fP builtin. +.PD +.PP +If the +.B pushd +command is successful, a +.B dirs +is performed as well. +If the first form is used, +.B pushd +returns 0 unless the cd to +.I dir +fails. With the second form, +.B pushd +returns 0 unless the directory stack is empty, +a non-existent directory stack element is specified, +or the directory change to the specified new current directory +fails. +.RE +.TP +\fBpwd\fP [\fB\-LP\fP] +Print the absolute pathname of the current working directory. +The pathname printed contains no symbolic links if the +.B \-P +option is supplied or the +.B \-o physical +option to the +.B set +builtin command is enabled. +If the +.B \-L +option is used, the pathname printed may contain symbolic links. +The return status is 0 unless an error occurs while +reading the name of the current directory or an +invalid option is supplied. +.TP +\fBread\fP [\fB\-ers\fP] [\fB\-a\fP \fIaname\fP] [\fB\-d\fP \fIdelim\fP] [\fB\-i\fP \fItext\fP] [\fB\-n\fP \fInchars\fP] [\fB\-N\fP \fInchars\fP] [\fB\-p\fP \fIprompt\fP] [\fB\-t\fP \fItimeout\fP] [\fB\-u\fP \fIfd\fP] [\fIname\fP ...] +One line is read from the standard input, or from the file descriptor +\fIfd\fP supplied as an argument to the \fB\-u\fP option, and the first word +is assigned to the first +.IR name , +the second word to the second +.IR name , +and so on, with leftover words and their intervening separators assigned +to the last +.IR name . +If there are fewer words read from the input stream than names, +the remaining names are assigned empty values. +The characters in +.SM +.B IFS +are used to split the line into words using the same rules the shell +uses for expansion (described above under \fBWord Splitting\fP). +The backslash character (\fB\e\fP) may be used to remove any special +meaning for the next character read and for line continuation. +Options, if supplied, have the following meanings: +.RS +.PD 0 +.TP +.B \-a \fIaname\fP +The words are assigned to sequential indices +of the array variable +.IR aname , +starting at 0. +.I aname +is unset before any new values are assigned. +Other \fIname\fP arguments are ignored. +.TP +.B \-d \fIdelim\fP +The first character of \fIdelim\fP is used to terminate the input line, +rather than newline. +.TP +.B \-e +If the standard input +is coming from a terminal, +.B readline +(see +.SM +.B READLINE +above) is used to obtain the line. +Readline uses the current (or default, if line editing was not previously +active) editing settings. +.TP +.B \-i \fItext\fP +If +.B readline +is being used to read the line, \fItext\fP is placed into the editing +buffer before editing begins. +.TP +.B \-n \fInchars\fP +\fBread\fP returns after reading \fInchars\fP characters rather than +waiting for a complete line of input, but honor a delimiter if fewer +than \fInchars\fP characters are read before the delimiter. +.TP +.B \-N \fInchars\fP +\fBread\fP returns after reading exactly \fInchars\fP characters rather +than waiting for a complete line of input, unless EOF is encountered or +\fBread\fP times out. +Delimiter characters encountered in the input are +not treated specially and do not cause \fBread\fP to return until +\fInchars\fP characters are read. +.TP +.B \-p \fIprompt\fP +Display \fIprompt\fP on standard error, without a +trailing newline, before attempting to read any input. The prompt +is displayed only if input is coming from a terminal. +.TP +.B \-r +Backslash does not act as an escape character. +The backslash is considered to be part of the line. +In particular, a backslash-newline pair may not be used as a line +continuation. +.TP +.B \-s +Silent mode. If input is coming from a terminal, characters are +not echoed. +.TP +.B \-t \fItimeout\fP +Cause \fBread\fP to time out and return failure if a complete line of +input (or a specified number of characters) +is not read within \fItimeout\fP seconds. +\fItimeout\fP may be a decimal number with a fractional portion following +the decimal point. +This option is only effective if \fBread\fP is reading input from a +terminal, pipe, or other special file; it has no effect when reading +from regular files. +If \fBread\fP times out, \fBread\fP saves any partial input read into +the specified variable \fIname\fP. +If \fItimeout\fP is 0, \fBread\fP returns immediately, without trying to +read any data. The exit status is 0 if input is available on +the specified file descriptor, non-zero otherwise. +The exit status is greater than 128 if the timeout is exceeded. +.TP +.B \-u \fIfd\fP +Read input from file descriptor \fIfd\fP. +.PD +.PP +If no +.I names +are supplied, the line read is assigned to the variable +.SM +.BR REPLY . +The return code is zero, unless end-of-file is encountered, \fBread\fP +times out (in which case the return code is greater than 128), +a variable assignment error (such as assigning to a readonly variable) occurs, +or an invalid file descriptor is supplied as the argument to \fB\-u\fP. +.RE +.TP +\fBreadonly\fP [\fB\-aAf\fP] [\fB\-p\fP] [\fIname\fP[=\fIword\fP] ...] +.PD +The given +\fInames\fP are marked readonly; the values of these +.I names +may not be changed by subsequent assignment. +If the +.B \-f +option is supplied, the functions corresponding to the +\fInames\fP are so +marked. +The +.B \-a +option restricts the variables to indexed arrays; the +.B \-A +option restricts the variables to associative arrays. +If both options are supplied, +.B \-A +takes precedence. +If no +.I name +arguments are given, or if the +.B \-p +option is supplied, a list of all readonly names is printed. +The other options may be used to restrict the output to a subset of +the set of readonly names. +The +.B \-p +option causes output to be displayed in a format that +may be reused as input. +If a variable name is followed by =\fIword\fP, the value of +the variable is set to \fIword\fP. +The return status is 0 unless an invalid option is encountered, +one of the +.I names +is not a valid shell variable name, or +.B \-f +is supplied with a +.I name +that is not a function. +.TP +\fBreturn\fP [\fIn\fP] +Causes a function to stop executing and return the value specified by +.I n +to its caller. +If +.I n +is omitted, the return status is that of the last command +executed in the function body. If +.B return +is used outside a function, +but during execution of a script by the +.B . +(\fBsource\fP) command, it causes the shell to stop executing +that script and return either +.I n +or the exit status of the last command executed within the +script as the exit status of the script. +If \fIn\fP is supplied, the return value is its least significant +8 bits. +The return status is non-zero if +.B return +is supplied a non-numeric argument, or +is used outside a +function and not during execution of a script by \fB.\fP\^ or \fBsource\fP. +Any command associated with the \fBRETURN\fP trap is executed +before execution resumes after the function or script. +.TP +\fBset\fP [\fB\-\-abefhkmnptuvxBCEHPT\fP] [\fB\-o\fP \fIoption\-name\fP] [\fIarg\fP ...] +.PD 0 +.TP +\fBset\fP [\fB+abefhkmnptuvxBCEHPT\fP] [\fB+o\fP \fIoption\-name\fP] [\fIarg\fP ...] +.PD +Without options, the name and value of each shell variable are displayed +in a format that can be reused as input +for setting or resetting the currently-set variables. +Read-only variables cannot be reset. +In \fIposix\fP mode, only shell variables are listed. +The output is sorted according to the current locale. +When options are specified, they set or unset shell attributes. +Any arguments remaining after option processing are treated +as values for the positional parameters and are assigned, in order, to +.BR $1 , +.BR $2 , +.B ... +.BR $\fIn\fP . +Options, if specified, have the following meanings: +.RS +.PD 0 +.TP 8 +.B \-a +Automatically mark variables and functions which are modified or +created for export to the environment of subsequent commands. +.TP 8 +.B \-b +Report the status of terminated background jobs +immediately, rather than before the next primary prompt. This is +effective only when job control is enabled. +.TP 8 +.B \-e +Exit immediately if a +\fIpipeline\fP (which may consist of a single \fIsimple command\fP), +a \fIlist\fP, +or a \fIcompound command\fP +(see +.SM +.B SHELL GRAMMAR +above), exits with a non-zero status. +The shell does not exit if the +command that fails is part of the command list immediately following a +.B while +or +.B until +keyword, +part of the test following the +.B if +or +.B elif +reserved words, part of any command executed in a +.B && +or +.B || +list except the command following the final \fB&&\fP or \fB||\fP, +any command in a pipeline but the last, +or if the command's return value is +being inverted with +.BR ! . +If a compound command other than a subshell +returns a non-zero status because a command failed +while \fB\-e\fP was being ignored, the shell does not exit. +A trap on \fBERR\fP, if set, is executed before the shell exits. +This option applies to the shell environment and each subshell environment +separately (see +.SM +.B "COMMAND EXECUTION ENVIRONMENT" +above), and may cause +subshells to exit before executing all the commands in the subshell. +.if t .sp 0.5 +.if n .sp 1 +If a compound command or shell function executes in a context +where \fB\-e\fP is being ignored, +none of the commands executed within the compound command or function body +will be affected by the \fB\-e\fP setting, even if \fB\-e\fP is set +and a command returns a failure status. +If a compound command or shell function sets \fB\-e\fP while executing in +a context where \fB\-e\fP is ignored, that setting will not have any +effect until the compound command or the command containing the function +call completes. +.TP 8 +.B \-f +Disable pathname expansion. +.TP 8 +.B \-h +Remember the location of commands as they are looked up for execution. +This is enabled by default. +.TP 8 +.B \-k +All arguments in the form of assignment statements +are placed in the environment for a command, not just +those that precede the command name. +.TP 8 +.B \-m +Monitor mode. Job control is enabled. This option is on +by default for interactive shells on systems that support +it (see +.SM +.B JOB CONTROL +above). +All processes run in a separate process group. +When a background job completes, the shell prints a line +containing its exit status. +.TP 8 +.B \-n +Read commands but do not execute them. This may be used to +check a shell script for syntax errors. This is ignored by +interactive shells. +.TP 8 +.B \-o \fIoption\-name\fP +The \fIoption\-name\fP can be one of the following: +.RS +.TP 8 +.B allexport +Same as +.BR \-a . +.TP 8 +.B braceexpand +Same as +.BR \-B . +.TP 8 +.B emacs +Use an emacs-style command line editing interface. This is enabled +by default when the shell is interactive, unless the shell is started +with the +.B \-\-noediting +option. +This also affects the editing interface used for \fBread \-e\fP. +.TP 8 +.B errexit +Same as +.BR \-e . +.TP 8 +.B errtrace +Same as +.BR \-E . +.TP 8 +.B functrace +Same as +.BR \-T . +.TP 8 +.B hashall +Same as +.BR \-h . +.TP 8 +.B histexpand +Same as +.BR \-H . +.TP 8 +.B history +Enable command history, as described above under +.SM +.BR HISTORY . +This option is on by default in interactive shells. +.TP 8 +.B ignoreeof +The effect is as if the shell command +.if t \f(CWIGNOREEOF=10\fP +.if n ``IGNOREEOF=10'' +had been executed +(see +.B Shell Variables +above). +.TP 8 +.B keyword +Same as +.BR \-k . +.TP 8 +.B monitor +Same as +.BR \-m . +.TP 8 +.B noclobber +Same as +.BR \-C . +.TP 8 +.B noexec +Same as +.BR \-n . +.TP 8 +.B noglob +Same as +.BR \-f . +.TP 8 +.B nolog +Currently ignored. +.TP 8 +.B notify +Same as +.BR \-b . +.TP 8 +.B nounset +Same as +.BR \-u . +.TP 8 +.B onecmd +Same as +.BR \-t . +.TP 8 +.B physical +Same as +.BR \-P . +.TP 8 +.B pipefail +If set, the return value of a pipeline is the value of the last +(rightmost) command to exit with a non-zero status, or zero if all +commands in the pipeline exit successfully. +This option is disabled by default. +.TP 8 +.B posix +Change the behavior of +.B bash +where the default operation differs +from the POSIX standard to match the standard (\fIposix mode\fP). +See +.SM +.B "SEE ALSO" +below for a reference to a document that details how posix mode affects +bash's behavior. +.TP 8 +.B privileged +Same as +.BR \-p . +.TP 8 +.B verbose +Same as +.BR \-v . +.TP 8 +.B vi +Use a vi-style command line editing interface. +This also affects the editing interface used for \fBread \-e\fP. +.TP 8 +.B xtrace +Same as +.BR \-x . +.sp .5 +.PP +If +.B \-o +is supplied with no \fIoption\-name\fP, the values of the current options are +printed. +If +.B +o +is supplied with no \fIoption\-name\fP, a series of +.B set +commands to recreate the current option settings is displayed on +the standard output. +.RE +.TP 8 +.B \-p +Turn on +.I privileged +mode. In this mode, the +.SM +.B $ENV +and +.SM +.B $BASH_ENV +files are not processed, shell functions are not inherited from the +environment, and the +.SM +.BR SHELLOPTS , +.SM +.BR BASHOPTS , +.SM +.BR CDPATH , +and +.SM +.B GLOBIGNORE +variables, if they appear in the environment, are ignored. +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the \fB\-p\fP option is not supplied, these actions +are taken and the effective user id is set to the real user id. +If the \fB\-p\fP option is supplied at startup, the effective user id is +not reset. +Turning this option off causes the effective user +and group ids to be set to the real user and group ids. +.TP 8 +.B \-t +Exit after reading and executing one command. +.TP 8 +.B \-u +Treat unset variables and parameters other than the special +parameters "@" and "*" as an error when performing +parameter expansion. If expansion is attempted on an +unset variable or parameter, the shell prints an error message, and, +if not interactive, exits with a non-zero status. +.TP 8 +.B \-v +Print shell input lines as they are read. +.TP 8 +.B \-x +After expanding each \fIsimple command\fP, +\fBfor\fP command, \fBcase\fP command, \fBselect\fP command, or +arithmetic \fBfor\fP command, display the expanded value of +.SM +.BR PS4 , +followed by the command and its expanded arguments +or associated word list. +.TP 8 +.B \-B +The shell performs brace expansion (see +.B Brace Expansion +above). This is on by default. +.TP 8 +.B \-C +If set, +.B bash +does not overwrite an existing file with the +.BR > , +.BR >& , +and +.B <> +redirection operators. This may be overridden when +creating output files by using the redirection operator +.B >| +instead of +.BR > . +.TP 8 +.B \-E +If set, any trap on \fBERR\fP is inherited by shell functions, command +substitutions, and commands executed in a subshell environment. +The \fBERR\fP trap is normally not inherited in such cases. +.TP 8 +.B \-H +Enable +.B ! +style history substitution. This option is on by +default when the shell is interactive. +.TP 8 +.B \-P +If set, the shell does not resolve symbolic links when executing +commands such as +.B cd +that change the current working directory. It uses the +physical directory structure instead. By default, +.B bash +follows the logical chain of directories when performing commands +which change the current directory. +.TP 8 +.B \-T +If set, any traps on \fBDEBUG\fP and \fBRETURN\fP are inherited by shell +functions, command substitutions, and commands executed in a +subshell environment. +The \fBDEBUG\fP and \fBRETURN\fP traps are normally not inherited +in such cases. +.TP 8 +.B \-\- +If no arguments follow this option, then the positional parameters are +unset. Otherwise, the positional parameters are set to the +\fIarg\fPs, even if some of them begin with a +.BR \- . +.TP 8 +.B \- +Signal the end of options, cause all remaining \fIarg\fPs to be +assigned to the positional parameters. The +.B \-x +and +.B \-v +options are turned off. +If there are no \fIarg\fPs, +the positional parameters remain unchanged. +.PD +.PP +The options are off by default unless otherwise noted. +Using + rather than \- causes these options to be turned off. +The options can also be specified as arguments to an invocation of +the shell. +The current set of options may be found in +.BR $\- . +The return status is always true unless an invalid option is encountered. +.RE +.TP +\fBshift\fP [\fIn\fP] +The positional parameters from \fIn\fP+1 ... are renamed to +.B $1 +.B .... +Parameters represented by the numbers \fB$#\fP +down to \fB$#\fP\-\fIn\fP+1 are unset. +.I n +must be a non-negative number less than or equal to \fB$#\fP. +If +.I n +is 0, no parameters are changed. +If +.I n +is not given, it is assumed to be 1. +If +.I n +is greater than \fB$#\fP, the positional parameters are not changed. +The return status is greater than zero if +.I n +is greater than +.B $# +or less than zero; otherwise 0. +.TP +\fBshopt\fP [\fB\-pqsu\fP] [\fB\-o\fP] [\fIoptname\fP ...] +Toggle the values of settings controlling optional shell behavior. +The settings can be either those listed below, or, if the +.B \-o +option is used, those available with the +.B \-o +option to the \fBset\fP builtin command. +With no options, or with the +.B \-p +option, a list of all settable options is displayed, with +an indication of whether or not each is set. +The \fB\-p\fP option causes output to be displayed in a form that +may be reused as input. +Other options have the following meanings: +.RS +.PD 0 +.TP +.B \-s +Enable (set) each \fIoptname\fP. +.TP +.B \-u +Disable (unset) each \fIoptname\fP. +.TP +.B \-q +Suppresses normal output (quiet mode); the return status indicates +whether the \fIoptname\fP is set or unset. +If multiple \fIoptname\fP arguments are given with +.BR \-q , +the return status is zero if all \fIoptnames\fP are enabled; non-zero +otherwise. +.TP +.B \-o +Restricts the values of \fIoptname\fP to be those defined for the +.B \-o +option to the +.B set +builtin. +.PD +.PP +If either +.B \-s +or +.B \-u +is used with no \fIoptname\fP arguments, +.B shopt +shows only those options which are set or unset, respectively. +Unless otherwise noted, the \fBshopt\fP options are disabled (unset) +by default. +.PP +The return status when listing options is zero if all \fIoptnames\fP +are enabled, non-zero otherwise. When setting or unsetting options, +the return status is zero unless an \fIoptname\fP is not a valid shell +option. +.PP +The list of \fBshopt\fP options is: +.if t .sp .5v +.if n .sp 1v +.PD 0 +.TP 8 +.B autocd +If set, a command name that is the name of a directory is executed as if +it were the argument to the \fBcd\fP command. +This option is only used by interactive shells. +.TP 8 +.B cdable_vars +If set, an argument to the +.B cd +builtin command that +is not a directory is assumed to be the name of a variable whose +value is the directory to change to. +.TP 8 +.B cdspell +If set, minor errors in the spelling of a directory component in a +.B cd +command will be corrected. +The errors checked for are transposed characters, +a missing character, and one character too many. +If a correction is found, the corrected filename is printed, +and the command proceeds. +This option is only used by interactive shells. +.TP 8 +.B checkhash +If set, \fBbash\fP checks that a command found in the hash +table exists before trying to execute it. If a hashed command no +longer exists, a normal path search is performed. +.TP 8 +.B checkjobs +If set, \fBbash\fP lists the status of any stopped and running jobs before +exiting an interactive shell. If any jobs are running, this causes +the exit to be deferred until a second exit is attempted without an +intervening command (see +.SM +.B "JOB CONTROL" +above). The shell always +postpones exiting if any jobs are stopped. +.TP 8 +.B checkwinsize +If set, \fBbash\fP checks the window size after each command +and, if necessary, updates the values of +.SM +.B LINES +and +.SM +.BR COLUMNS . +.TP 8 +.B cmdhist +If set, +.B bash +attempts to save all lines of a multiple-line +command in the same history entry. This allows +easy re-editing of multi-line commands. +.TP 8 +.B compat31 +If set, +.B bash +changes its behavior to that of version 3.1 with respect to quoted +arguments to the \fB[[\fP conditional command's \fB=~\fP operator +and locale-specific string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators. +Bash versions prior to bash-4.1 use ASCII collation and +.IR strcmp (3); +bash-4.1 and later use the current locale's collation sequence and +.IR strcoll (3). +.TP 8 +.B compat32 +If set, +.B bash +changes its behavior to that of version 3.2 with respect to +locale-specific string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators (see previous item). +.TP 8 +.B compat40 +If set, +.B bash +changes its behavior to that of version 4.0 with respect to locale-specific +string comparison when using the \fB[[\fP +conditional command's \fB<\fP and \fB>\fP operators (see description of +\fBcompat31\fP) +and the effect of interrupting a command list. +Bash versions 4.0 and later interrupt the list as if the shell received the +interrupt; previous versions continue with the next command in the list. +.TP 8 +.B compat41 +If set, +.BR bash , +when in \fIposix\fP mode, treats a single quote in a double-quoted +parameter expansion as a special character. The single quotes must match +(an even number) and the characters between the single quotes are considered +quoted. This is the behavior of posix mode through version 4.1. +The default bash behavior remains as in previous versions. +.TP 8 +.B compat42 +If set, +.B bash +does not process the replacement string in the pattern substitution word +expansion using quote removal. +.TP 8 +.B complete_fullquote +If set, +.B bash +quotes all shell metacharacters in filenames and directory names when +performing completion. +If not set, +.B bash +removes metacharacters such as the dollar sign from the set of +characters that will be quoted in completed filenames +when these metacharacters appear in shell variable references in words to be +completed. +This means that dollar signs in variable names that expand to directories +will not be quoted; +however, any dollar signs appearing in filenames will not be quoted, either. +This is active only when bash is using backslashes to quote completed +filenames. +This variable is set by default, which is the default bash behavior in +versions through 4.2. +.TP 8 +.B direxpand +If set, +.B bash +replaces directory names with the results of word expansion when performing +filename completion. This changes the contents of the readline editing +buffer. +If not set, +.B bash +attempts to preserve what the user typed. +.TP 8 +.B dirspell +If set, +.B bash +attempts spelling correction on directory names during word completion +if the directory name initially supplied does not exist. +.TP 8 +.B dotglob +If set, +.B bash +includes filenames beginning with a `.' in the results of pathname +expansion. +.TP 8 +.B execfail +If set, a non-interactive shell will not exit if +it cannot execute the file specified as an argument to the +.B exec +builtin command. An interactive shell does not exit if +.B exec +fails. +.TP 8 +.B expand_aliases +If set, aliases are expanded as described above under +.SM +.BR ALIASES . +This option is enabled by default for interactive shells. +.TP 8 +.B extdebug +If set, behavior intended for use by debuggers is enabled: +.RS +.TP +.B 1. +The \fB\-F\fP option to the \fBdeclare\fP builtin displays the source +file name and line number corresponding to each function name supplied +as an argument. +.TP +.B 2. +If the command run by the \fBDEBUG\fP trap returns a non-zero value, the +next command is skipped and not executed. +.TP +.B 3. +If the command run by the \fBDEBUG\fP trap returns a value of 2, and the +shell is executing in a subroutine (a shell function or a shell script +executed by the \fB.\fP or \fBsource\fP builtins), a call to +\fBreturn\fP is simulated. +.TP +.B 4. +.SM +.B BASH_ARGC +and +.SM +.B BASH_ARGV +are updated as described in their descriptions above. +.TP +.B 5. +Function tracing is enabled: command substitution, shell functions, and +subshells invoked with \fB(\fP \fIcommand\fP \fB)\fP inherit the +\fBDEBUG\fP and \fBRETURN\fP traps. +.TP +.B 6. +Error tracing is enabled: command substitution, shell functions, and +subshells invoked with \fB(\fP \fIcommand\fP \fB)\fP inherit the +\fBERR\fP trap. +.RE +.TP 8 +.B extglob +If set, the extended pattern matching features described above under +\fBPathname Expansion\fP are enabled. +.TP 8 +.B extquote +If set, \fB$\fP\(aq\fIstring\fP\(aq and \fB$\fP"\fIstring\fP" quoting is +performed within \fB${\fP\fIparameter\fP\fB}\fP expansions +enclosed in double quotes. This option is enabled by default. +.TP 8 +.B failglob +If set, patterns which fail to match filenames during pathname expansion +result in an expansion error. +.TP 8 +.B force_fignore +If set, the suffixes specified by the +.SM +.B FIGNORE +shell variable +cause words to be ignored when performing word completion even if +the ignored words are the only possible completions. +See +.SM +\fBSHELL VARIABLES\fP +above for a description of +.SM +.BR FIGNORE . +This option is enabled by default. +.TP 8 +.B globasciiranges +If set, range expressions used in pattern matching bracket expressions (see +.SM +.B Pattern Matching +above) behave as if in the traditional C locale when performing +comparisons. That is, the current locale's collating sequence +is not taken into account, so +.B b +will not collate between +.B A +and +.BR B , +and upper-case and lower-case ASCII characters will collate together. +.TP 8 +.B globstar +If set, the pattern \fB**\fP used in a pathname expansion context will +match all files and zero or more directories and subdirectories. +If the pattern is followed by a \fB/\fP, only directories and +subdirectories match. +.TP 8 +.B gnu_errfmt +If set, shell error messages are written in the standard GNU error +message format. +.TP 8 +.B histappend +If set, the history list is appended to the file named by the value +of the +.SM +.B HISTFILE +variable when the shell exits, rather than overwriting the file. +.TP 8 +.B histreedit +If set, and +.B readline +is being used, a user is given the opportunity to re-edit a +failed history substitution. +.TP 8 +.B histverify +If set, and +.B readline +is being used, the results of history substitution are not immediately +passed to the shell parser. Instead, the resulting line is loaded into +the \fBreadline\fP editing buffer, allowing further modification. +.TP 8 +.B hostcomplete +If set, and +.B readline +is being used, \fBbash\fP will attempt to perform hostname completion when a +word containing a \fB@\fP is being completed (see +.B Completing +under +.SM +.B READLINE +above). +This is enabled by default. +.TP 8 +.B huponexit +If set, \fBbash\fP will send +.SM +.B SIGHUP +to all jobs when an interactive login shell exits. +.TP 8 +.B interactive_comments +If set, allow a word beginning with +.B # +to cause that word and all remaining characters on that +line to be ignored in an interactive shell (see +.SM +.B COMMENTS +above). This option is enabled by default. +.TP 8 +.B lastpipe +If set, and job control is not active, the shell runs the last command of +a pipeline not executed in the background in the current shell environment. +.TP 8 +.B lithist +If set, and the +.B cmdhist +option is enabled, multi-line commands are saved to the history with +embedded newlines rather than using semicolon separators where possible. +.TP 8 +.B login_shell +The shell sets this option if it is started as a login shell (see +.SM +.B "INVOCATION" +above). +The value may not be changed. +.TP 8 +.B mailwarn +If set, and a file that \fBbash\fP is checking for mail has been +accessed since the last time it was checked, the message ``The mail in +\fImailfile\fP has been read'' is displayed. +.TP 8 +.B no_empty_cmd_completion +If set, and +.B readline +is being used, +.B bash +will not attempt to search the +.SM +.B PATH +for possible completions when +completion is attempted on an empty line. +.TP 8 +.B nocaseglob +If set, +.B bash +matches filenames in a case\-insensitive fashion when performing pathname +expansion (see +.B Pathname Expansion +above). +.TP 8 +.B nocasematch +If set, +.B bash +matches patterns in a case\-insensitive fashion when performing matching +while executing \fBcase\fP or \fB[[\fP conditional commands. +.TP 8 +.B nullglob +If set, +.B bash +allows patterns which match no +files (see +.B Pathname Expansion +above) +to expand to a null string, rather than themselves. +.TP 8 +.B progcomp +If set, the programmable completion facilities (see +\fBProgrammable Completion\fP above) are enabled. +This option is enabled by default. +.TP 8 +.B promptvars +If set, prompt strings undergo +parameter expansion, command substitution, arithmetic +expansion, and quote removal after being expanded as described in +.SM +.B PROMPTING +above. This option is enabled by default. +.TP 8 +.B restricted_shell +The shell sets this option if it is started in restricted mode (see +.SM +.B "RESTRICTED SHELL" +below). +The value may not be changed. +This is not reset when the startup files are executed, allowing +the startup files to discover whether or not a shell is restricted. +.TP 8 +.B shift_verbose +If set, the +.B shift +builtin prints an error message when the shift count exceeds the +number of positional parameters. +.TP 8 +.B sourcepath +If set, the +\fBsource\fP (\fB.\fP) builtin uses the value of +.SM +.B PATH +to find the directory containing the file supplied as an argument. +This option is enabled by default. +.TP 8 +.B xpg_echo +If set, the \fBecho\fP builtin expands backslash-escape sequences +by default. +.RE +.PD +.TP +\fBsuspend\fP [\fB\-f\fP] +Suspend the execution of this shell until it receives a +.SM +.B SIGCONT +signal. A login shell cannot be suspended; the +.B \-f +option can be used to override this and force the suspension. +The return status is 0 unless the shell is a login shell and +.B \-f +is not supplied, or if job control is not enabled. +.TP +\fBtest\fP \fIexpr\fP +.PD 0 +.TP +\fB[\fP \fIexpr\fP \fB]\fP +Return a status of 0 (true) or 1 (false) depending on +the evaluation of the conditional expression +.IR expr . +Each operator and operand must be a separate argument. +Expressions are composed of the primaries described above under +.SM +.BR "CONDITIONAL EXPRESSIONS" . +\fBtest\fP does not accept any options, nor does it accept and ignore +an argument of \fB\-\-\fP as signifying the end of options. +.if t .sp 0.5 +.if n .sp 1 +Expressions may be combined using the following operators, listed +in decreasing order of precedence. +The evaluation depends on the number of arguments; see below. +Operator precedence is used when there are five or more arguments. +.RS +.PD 0 +.TP +.B ! \fIexpr\fP +True if +.I expr +is false. +.TP +.B ( \fIexpr\fP ) +Returns the value of \fIexpr\fP. +This may be used to override the normal precedence of operators. +.TP +\fIexpr1\fP \-\fBa\fP \fIexpr2\fP +True if both +.I expr1 +and +.I expr2 +are true. +.TP +\fIexpr1\fP \-\fBo\fP \fIexpr2\fP +True if either +.I expr1 +or +.I expr2 +is true. +.PD +.PP +\fBtest\fP and \fB[\fP evaluate conditional +expressions using a set of rules based on the number of arguments. +.if t .sp 0.5 +.if n .sp 1 +.PD 0 +.TP +0 arguments +The expression is false. +.TP +1 argument +The expression is true if and only if the argument is not null. +.TP +2 arguments +If the first argument is \fB!\fP, the expression is true if and +only if the second argument is null. +If the first argument is one of the unary conditional operators listed above +under +.SM +.BR "CONDITIONAL EXPRESSIONS" , +the expression is true if the unary test is true. +If the first argument is not a valid unary conditional operator, the expression +is false. +.TP +3 arguments +The following conditions are applied in the order listed. +If the second argument is one of the binary conditional operators listed above +under +.SM +.BR "CONDITIONAL EXPRESSIONS" , +the result of the expression is the result of the binary test using +the first and third arguments as operands. +The \fB\-a\fP and \fB\-o\fP operators are considered binary operators +when there are three arguments. +If the first argument is \fB!\fP, the value is the negation of +the two-argument test using the second and third arguments. +If the first argument is exactly \fB(\fP and the third argument is +exactly \fB)\fP, the result is the one-argument test of the second +argument. +Otherwise, the expression is false. +.TP +4 arguments +If the first argument is \fB!\fP, the result is the negation of +the three-argument expression composed of the remaining arguments. +Otherwise, the expression is parsed and evaluated according to +precedence using the rules listed above. +.TP +5 or more arguments +The expression is parsed and evaluated according to precedence +using the rules listed above. +.if t .sp 0.5 +.if n .sp 1 +.LP +When used with \fBtest\fP or \fB[\fP, the \fB<\fP and \fB>\fP operators +sort lexicographically using ASCII ordering. +.RE +.PD +.TP +.B times +Print the accumulated user and system times for the shell and +for processes run from the shell. The return status is 0. +.TP +\fBtrap\fP [\fB\-lp\fP] [[\fIarg\fP] \fIsigspec\fP ...] +The command +.I arg +is to be read and executed when the shell receives +signal(s) +.IR sigspec . +If +.I arg +is absent (and there is a single \fIsigspec\fP) or +.BR \- , +each specified signal is +reset to its original disposition (the value it had +upon entrance to the shell). +If +.I arg +is the null string the signal specified by each +.I sigspec +is ignored by the shell and by the commands it invokes. +If +.I arg +is not present and +.B \-p +has been supplied, then the trap commands associated with each +.I sigspec +are displayed. +If no arguments are supplied or if only +.B \-p +is given, +.B trap +prints the list of commands associated with each signal. +The +.B \-l +option causes the shell to print a list of signal names and +their corresponding numbers. +Each +.I sigspec +is either +a signal name defined in <\fIsignal.h\fP>, or a signal number. +Signal names are case insensitive and the +.SM +.B SIG +prefix is optional. +.if t .sp 0.5 +.if n .sp 1 +If a +.I sigspec +is +.SM +.B EXIT +(0) the command +.I arg +is executed on exit from the shell. +If a +.I sigspec +is +.SM +.BR DEBUG , +the command +.I arg +is executed before every \fIsimple command\fP, \fIfor\fP command, +\fIcase\fP command, \fIselect\fP command, every arithmetic \fIfor\fP +command, and before the first command executes in a shell function (see +.SM +.B SHELL GRAMMAR +above). +Refer to the description of the \fBextdebug\fP option to the +\fBshopt\fP builtin for details of its effect on the \fBDEBUG\fP trap. +If a +.I sigspec +is +.SM +.BR RETURN , +the command +.I arg +is executed each time a shell function or a script executed with +the \fB.\fP or \fBsource\fP builtins finishes executing. +.if t .sp 0.5 +.if n .sp 1 +If a +.I sigspec +is +.SM +.BR ERR , +the command +.I arg +is executed whenever a +a pipeline (which may consist of a single simple +command), a list, or a compound command returns a +non\-zero exit status, +subject to the following conditions. +The +.SM +.B ERR +trap is not executed if the failed +command is part of the command list immediately following a +.B while +or +.B until +keyword, +part of the test in an +.I if +statement, part of a command executed in a +.B && +or +.B || +list except the command following the final \fB&&\fP or \fB||\fP, +any command in a pipeline but the last, +or if the command's return value is +being inverted using +.BR ! . +These are the same conditions obeyed by the \fBerrexit\fP (\fB\-e\fP) option. +.if t .sp 0.5 +.if n .sp 1 +Signals ignored upon entry to the shell cannot be trapped or reset. +Trapped signals that are not being ignored are reset to their original +values in a subshell or subshell environment when one is created. +The return status is false if any +.I sigspec +is invalid; otherwise +.B trap +returns true. +.TP +\fBtype\fP [\fB\-aftpP\fP] \fIname\fP [\fIname\fP ...] +With no options, +indicate how each +.I name +would be interpreted if used as a command name. +If the +.B \-t +option is used, +.B type +prints a string which is one of +.IR alias , +.IR keyword , +.IR function , +.IR builtin , +or +.I file +if +.I name +is an alias, shell reserved word, function, builtin, or disk file, +respectively. +If the +.I name +is not found, then nothing is printed, and an exit status of false +is returned. +If the +.B \-p +option is used, +.B type +either returns the name of the disk file +that would be executed if +.I name +were specified as a command name, +or nothing if +.if t \f(CWtype -t name\fP +.if n ``type -t name'' +would not return +.IR file . +The +.B \-P +option forces a +.SM +.B PATH +search for each \fIname\fP, even if +.if t \f(CWtype -t name\fP +.if n ``type -t name'' +would not return +.IR file . +If a command is hashed, +.B \-p +and +.B \-P +print the hashed value, which is not necessarily the file that appears +first in +.SM +.BR PATH . +If the +.B \-a +option is used, +.B type +prints all of the places that contain +an executable named +.IR name . +This includes aliases and functions, +if and only if the +.B \-p +option is not also used. +The table of hashed commands is not consulted +when using +.BR \-a . +The +.B \-f +option suppresses shell function lookup, as with the \fBcommand\fP builtin. +.B type +returns true if all of the arguments are found, false if +any are not found. +.TP +\fBulimit\fP [\fB\-HSTabcdefilmnpqrstuvx\fP [\fIlimit\fP]] +Provides control over the resources available to the shell and to +processes started by it, on systems that allow such control. +The \fB\-H\fP and \fB\-S\fP options specify that the hard or soft limit is +set for the given resource. +A hard limit cannot be increased by a non-root user once it is set; +a soft limit may be increased up to the value of the hard limit. +If neither \fB\-H\fP nor \fB\-S\fP is specified, both the soft and hard +limits are set. +The value of +.I limit +can be a number in the unit specified for the resource +or one of the special values +.BR hard , +.BR soft , +or +.BR unlimited , +which stand for the current hard limit, the current soft limit, and +no limit, respectively. +If +.I limit +is omitted, the current value of the soft limit of the resource is +printed, unless the \fB\-H\fP option is given. When more than one +resource is specified, the limit name and unit are printed before the value. +Other options are interpreted as follows: +.RS +.PD 0 +.TP +.B \-a +All current limits are reported +.TP +.B \-b +The maximum socket buffer size +.TP +.B \-c +The maximum size of core files created +.TP +.B \-d +The maximum size of a process's data segment +.TP +.B \-e +The maximum scheduling priority ("nice") +.TP +.B \-f +The maximum size of files written by the shell and its children +.TP +.B \-i +The maximum number of pending signals +.TP +.B \-l +The maximum size that may be locked into memory +.TP +.B \-m +The maximum resident set size (many systems do not honor this limit) +.TP +.B \-n +The maximum number of open file descriptors (most systems do not +allow this value to be set) +.TP +.B \-p +The pipe size in 512-byte blocks (this may not be set) +.TP +.B \-q +The maximum number of bytes in POSIX message queues +.TP +.B \-r +The maximum real-time scheduling priority +.TP +.B \-s +The maximum stack size +.TP +.B \-t +The maximum amount of cpu time in seconds +.TP +.B \-u +The maximum number of processes available to a single user +.TP +.B \-v +The maximum amount of virtual memory available to the shell and, on +some systems, to its children +.TP +.B \-x +The maximum number of file locks +.TP +.B \-T +The maximum number of threads +.PD +.PP +If +.I limit +is given, and the +.B \-a +option is not used, +\fIlimit\fP is the new value of the specified resource. +If no option is given, then +.B \-f +is assumed. Values are in 1024-byte increments, except for +.BR \-t , +which is in seconds; +.BR \-p , +which is in units of 512-byte blocks; +and +.BR \-T , +.BR \-b , +.BR \-n , +and +.BR \-u , +which are unscaled values. +The return status is 0 unless an invalid option or argument is supplied, +or an error occurs while setting a new limit. +.RE +.TP +\fBumask\fP [\fB\-p\fP] [\fB\-S\fP] [\fImode\fP] +The user file-creation mask is set to +.IR mode . +If +.I mode +begins with a digit, it +is interpreted as an octal number; otherwise +it is interpreted as a symbolic mode mask similar +to that accepted by +.IR chmod (1). +If +.I mode +is omitted, the current value of the mask is printed. +The +.B \-S +option causes the mask to be printed in symbolic form; the +default output is an octal number. +If the +.B \-p +option is supplied, and +.I mode +is omitted, the output is in a form that may be reused as input. +The return status is 0 if the mode was successfully changed or if +no \fImode\fP argument was supplied, and false otherwise. +.TP +\fBunalias\fP [\-\fBa\fP] [\fIname\fP ...] +Remove each \fIname\fP from the list of defined aliases. If +.B \-a +is supplied, all alias definitions are removed. The return +value is true unless a supplied +.I name +is not a defined alias. +.TP +\fBunset\fP [\-\fBfv\fP] [\-\fBn\fP] [\fIname\fP ...] +For each +.IR name , +remove the corresponding variable or function. +If the +.B \-v +option is given, each +.I name +refers to a shell variable, and that variable is removed. +Read-only variables may not be unset. +If +.B \-f +is specified, each +.I name +refers to a shell function, and the function definition +is removed. +If the +.B \-n +option is supplied, and \fIname\fP is a variable with the \fInameref\fP +attribute, \fIname\fP will be unset rather than the variable it +references. +\fB\-n\fP has no effect if the \fB\-f\fP option is supplied. +If no options are supplied, each \fIname\fP refers to a variable; if +there is no variable by that name, any function with that name is +unset. +Each unset variable or function is removed from the environment +passed to subsequent commands. +If any of +.SM +.BR COMP_WORDBREAKS , +.SM +.BR RANDOM , +.SM +.BR SECONDS , +.SM +.BR LINENO , +.SM +.BR HISTCMD , +.SM +.BR FUNCNAME , +.SM +.BR GROUPS , +or +.SM +.B DIRSTACK +are unset, they lose their special properties, even if they are +subsequently reset. The exit status is true unless a +.I name +is readonly. +.TP +\fBwait\fP [\fB\-n\fP] [\fIn ...\fP] +Wait for each specified child process and return its termination status. +Each +.I n +may be a process +ID or a job specification; if a job spec is given, all processes +in that job's pipeline are waited for. If +.I n +is not given, all currently active child processes +are waited for, and the return status is zero. +If the \fB\-n\fP option is supplied, \fBwait\fP waits for any job to +terminate and returns its exit status. +If +.I n +specifies a non-existent process or job, the return status is +127. Otherwise, the return status is the exit status of the last +process or job waited for. +.\" bash_builtins +.if \n(zZ=1 .ig zZ +.SH "RESTRICTED SHELL" +.\" rbash.1 +.zY +.PP +If +.B bash +is started with the name +.BR rbash , +or the +.B \-r +option is supplied at invocation, +the shell becomes restricted. +A restricted shell is used to +set up an environment more controlled than the standard shell. +It behaves identically to +.B bash +with the exception that the following are disallowed or not performed: +.IP \(bu +changing directories with \fBcd\fP +.IP \(bu +setting or unsetting the values of +.SM +.BR SHELL , +.SM +.BR PATH , +.SM +.BR ENV , +or +.SM +.B BASH_ENV +.IP \(bu +specifying command names containing +.B / +.IP \(bu +specifying a filename containing a +.B / +as an argument to the +.B . +builtin command +.IP \(bu +specifying a filename containing a slash as an argument to the +.B \-p +option to the +.B hash +builtin command +.IP \(bu +importing function definitions from the shell environment at startup +.IP \(bu +parsing the value of +.SM +.B SHELLOPTS +from the shell environment at startup +.IP \(bu +redirecting output using the >, >|, <>, >&, &>, and >> redirection operators +.IP \(bu +using the +.B exec +builtin command to replace the shell with another command +.IP \(bu +adding or deleting builtin commands with the +.B \-f +and +.B \-d +options to the +.B enable +builtin command +.IP \(bu +using the \fBenable\fP builtin command to enable disabled shell builtins +.IP \(bu +specifying the +.B \-p +option to the +.B command +builtin command +.IP \(bu +turning off restricted mode with +\fBset +r\fP or \fBset +o restricted\fP. +.PP +These restrictions are enforced after any startup files are read. +.PP +.ie \n(zY=1 When a command that is found to be a shell script is executed, +.el \{ When a command that is found to be a shell script is executed +(see +.SM +.B "COMMAND EXECUTION" +above), +\} +.B rbash +turns off any restrictions in the shell spawned to execute the +script. +.\" end of rbash.1 +.if \n(zY=1 .ig zY +.SH "SEE ALSO" +.PD 0 +.TP +\fIBash Reference Manual\fP, Brian Fox and Chet Ramey +.TP +\fIThe Gnu Readline Library\fP, Brian Fox and Chet Ramey +.TP +\fIThe Gnu History Library\fP, Brian Fox and Chet Ramey +.TP +\fIPortable Operating System Interface (POSIX) Part 2: Shell and Utilities\fP, IEEE -- +http://pubs.opengroup.org/onlinepubs/9699919799/ +.TP +http://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode +.TP +\fIsh\fP(1), \fIksh\fP(1), \fIcsh\fP(1) +.TP +\fIemacs\fP(1), \fIvi\fP(1) +.TP +\fIreadline\fP(3) +.PD +.SH FILES +.PD 0 +.TP +.FN /bin/bash +The \fBbash\fP executable +.TP +.FN /etc/profile +The systemwide initialization file, executed for login shells +.TP +.FN /etc/bash.bashrc +The systemwide per-interactive-shell startup file +.TP +.FN /etc/bash.bash.logout +The systemwide login shell cleanup file, executed when a login shell exits +.TP +.FN ~/.bash_profile +The personal initialization file, executed for login shells +.TP +.FN ~/.bashrc +The individual per-interactive-shell startup file +.TP +.FN ~/.bash_logout +The individual login shell cleanup file, executed when a login shell exits +.TP +.FN ~/.inputrc +Individual \fIreadline\fP initialization file +.PD +.SH AUTHORS +Brian Fox, Free Software Foundation +.br +bfox@gnu.org +.PP +Chet Ramey, Case Western Reserve University +.br +chet.ramey@case.edu +.SH BUG REPORTS +If you find a bug in +.B bash, +you should report it. But first, you should +make sure that it really is a bug, and that it appears in the latest +version of +.BR bash . +The latest version is always available from +\fIftp://ftp.gnu.org/pub/gnu/bash/\fP. +.PP +Once you have determined that a bug actually exists, use the +.I bashbug +command to submit a bug report. +If you have a fix, you are encouraged to mail that as well! +Suggestions and `philosophical' bug reports may be mailed +to \fIbug-bash@gnu.org\fP or posted to the Usenet +newsgroup +.BR gnu.bash.bug . +.PP +ALL bug reports should include: +.PP +.PD 0 +.TP 20 +The version number of \fBbash\fR +.TP +The hardware and operating system +.TP +The compiler used to compile +.TP +A description of the bug behaviour +.TP +A short script or `recipe' which exercises the bug +.PD +.PP +.I bashbug +inserts the first three items automatically into the template +it provides for filing a bug report. +.PP +Comments and bug reports concerning +this manual page should be directed to +.IR chet.ramey@case.edu . +.SH BUGS +.PP +It's too big and too slow. +.PP +There are some subtle differences between +.B bash +and traditional versions of +.BR sh , +mostly because of the +.SM +.B POSIX +specification. +.PP +Aliases are confusing in some uses. +.PP +Shell builtin commands and functions are not stoppable/restartable. +.PP +Compound commands and command sequences of the form `a ; b ; c' +are not handled gracefully when process suspension is attempted. +When a process is stopped, the shell immediately executes the next +command in the sequence. +It suffices to place the sequence of commands between +parentheses to force it into a subshell, which may be stopped as +a unit. +.PP +Array variables may not (yet) be exported. +.PP +There may be only one active coprocess at a time. +.zZ +.zY diff --git a/doc/bash.html b/doc/bash.html new file mode 100644 index 0000000..bba7db6 --- /dev/null +++ b/doc/bash.html @@ -0,0 +1,13275 @@ + +BASH(1) Manual Page + + + + +
BASH(1)2014 February 2BASH(1) +
+
Index +
+ + + + + + + + + + + + + + + + + + + +  +

NAME

+ +bash - GNU Bourne-Again SHell +  +

SYNOPSIS

+ +bash + +[options] +[command_string | file] +  +

COPYRIGHT

+ + +Bash is Copyright © 1989-2013 by the Free Software Foundation, Inc. +  +

DESCRIPTION

+ +Bash + +is an sh-compatible command language interpreter that +executes commands read from the standard input or from a file. +Bash + +also incorporates useful features from the Korn and C +shells (ksh and csh). +

+ +Bash + +is intended to be a conformant implementation of the +Shell and Utilities portion of the IEEE POSIX specification +(IEEE Standard 1003.1). +Bash + +can be configured to be POSIX-conformant by default. +  +

OPTIONS

+ +All of the single-character shell options documented in the +description of the set builtin command can be used as options +when the shell is invoked. +In addition, bash +interprets the following options when it is invoked: +

+ + +

+
-c + +
+If the +-c + +option is present, then commands are read from the first non-option argument +command_string. + +If there are arguments after the +command_string, + +they are assigned to the positional parameters, starting with +$0. + +
-i + +
+If the +-i + +option is present, the shell is +interactive. + +
-l + +
+Make +bash + +act as if it had been invoked as a login shell (see +INVOCATION + + +below). +
-r + +
+If the +-r + +option is present, the shell becomes +restricted + +(see +RESTRICTED SHELL + + +below). +
-s + +
+If the +-s + +option is present, or if no arguments remain after option +processing, then commands are read from the standard input. +This option allows the positional parameters to be set +when invoking an interactive shell. +
-D + +
+A list of all double-quoted strings preceded by $ +is printed on the standard output. +These are the strings that +are subject to language translation when the current locale +is not C or POSIX. +This implies the -n option; no commands will be executed. +
[-+]O [shopt_option] + +
+shopt_option is one of the shell options accepted by the +shopt builtin (see +SHELL BUILTIN COMMANDS + + +below). +If shopt_option is present, -O sets the value of that option; ++O unsets it. +If shopt_option is not supplied, the names and values of the shell +options accepted by shopt are printed on the standard output. +If the invocation option is +O, the output is displayed in a format +that may be reused as input. +
-- + +
+A +-- + +signals the end of options and disables further option processing. +Any arguments after the +-- + +are treated as filenames and arguments. An argument of +- + +is equivalent to --. + +
+

+ +Bash + +also interprets a number of multi-character options. +These options must appear on the command line before the +single-character options to be recognized. +

+ + +

+
--debugger + +
+Arrange for the debugger profile to be executed before the shell +starts. +Turns on extended debugging mode (see the description of the +extdebug + +option to the +shopt + +builtin below). +
--dump-po-strings + +
+Equivalent to -D, but the output is in the GNU gettext +po (portable object) file format. +
--dump-strings + +
+Equivalent to -D. +
--help + +
+Display a usage message on standard output and exit successfully. +
--init-file file
+ +
--rcfile file
+ +Execute commands from +file + +instead of the standard personal initialization file +~/.bashrc + +if the shell is interactive (see +INVOCATION + + +below). +
--login + +
+Equivalent to -l. +
--noediting + +
+Do not use the GNU +readline + +library to read command lines when the shell is interactive. +
--noprofile + +
+Do not read either the system-wide startup file + +/etc/profile + +or any of the personal initialization files +~/.bash_profile, + +~/.bash_login, + +or +~/.profile. + +By default, +bash + +reads these files when it is invoked as a login shell (see +INVOCATION + + +below). +
--norc + +
+Do not read and execute the personal initialization file +~/.bashrc + +if the shell is interactive. +This option is on by default if the shell is invoked as +sh. + +
--posix + +
+Change the behavior of bash where the default operation differs +from the POSIX standard to match the standard (posix mode). +See +SEE ALSO + + +below for a reference to a document that details how posix mode affects +bash's behavior. +
--restricted + +
+The shell becomes restricted (see +RESTRICTED SHELL + + +below). +
--verbose + +
+Equivalent to -v. +
--version + +
+Show version information for this instance of +bash + +on the standard output and exit successfully. + +
+  +

ARGUMENTS

+ +If arguments remain after option processing, and neither the +-c + +nor the +-s + +option has been supplied, the first argument is assumed to +be the name of a file containing shell commands. +If +bash + +is invoked in this fashion, +$0 + +is set to the name of the file, and the positional parameters +are set to the remaining arguments. +Bash + +reads and executes commands from this file, then exits. +Bash's exit status is the exit status of the last command +executed in the script. +If no commands are executed, the exit status is 0. +An attempt is first made to open the file in the current directory, and, +if no file is found, then the shell searches the directories in +PATH + + +for the script. +  +

INVOCATION

+ +A login shell is one whose first character of argument zero is a +-, + +or one started with the +--login + +option. +

+ +An interactive shell is one started without non-option arguments +and without the +-c + +option +whose standard input and error are +both connected to terminals (as determined by +isatty(3)), + +or one started with the +-i + +option. +PS1 + + +is set and +$- + +includes +i + +if +bash + +is interactive, +allowing a shell script or a startup file to test this state. +

+ +The following paragraphs describe how +bash + +executes its startup files. +If any of the files exist but cannot be read, +bash + +reports an error. +Tildes are expanded in filenames as described below under +Tilde Expansion + +in the +EXPANSION + + +section. +

+ +When +bash + +is invoked as an interactive login shell, or as a non-interactive shell +with the --login option, it first reads and +executes commands from the file /etc/profile, if that +file exists. +After reading that file, it looks for ~/.bash_profile, +~/.bash_login, and ~/.profile, in that order, and reads +and executes commands from the first one that exists and is readable. +The +--noprofile + +option may be used when the shell is started to inhibit this behavior. +

+ +When a login shell exits, +bash + +reads and executes commands from the file ~/.bash_logout, if it +exists. +

+ +When an interactive shell that is not a login shell is started, +bash + +reads and executes commands from ~/.bashrc, if that file exists. +This may be inhibited by using the +--norc + +option. +The --rcfile file option will force +bash + +to read and execute commands from file instead of ~/.bashrc. +

+ +When +bash + +is started non-interactively, to run a shell script, for example, it +looks for the variable +BASH_ENV + + +in the environment, expands its value if it appears there, and uses the +expanded value as the name of a file to read and execute. +Bash + +behaves as if the following command were executed: +

+

+if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi + +
+ +

+but the value of the +PATH + + +variable is not used to search for the filename. +

+ +If +bash + +is invoked with the name +sh, + +it tries to mimic the startup behavior of historical versions of +sh + +as closely as possible, +while conforming to the POSIX standard as well. +When invoked as an interactive login shell, or a non-interactive +shell with the --login option, it first attempts to +read and execute commands from +/etc/profile + +and +~/.profile, + +in that order. +The +--noprofile + +option may be used to inhibit this behavior. +When invoked as an interactive shell with the name +sh, + +bash + +looks for the variable +ENV, + + +expands its value if it is defined, and uses the +expanded value as the name of a file to read and execute. +Since a shell invoked as +sh + +does not attempt to read and execute commands from any other startup +files, the +--rcfile + +option has no effect. +A non-interactive shell invoked with the name +sh + +does not attempt to read any other startup files. +When invoked as +sh, + +bash + +enters +posix + +mode after the startup files are read. +

+ +When +bash + +is started in +posix + +mode, as with the +--posix + +command line option, it follows the POSIX standard for startup files. +In this mode, interactive shells expand the +ENV + + +variable and commands are read and executed from the file +whose name is the expanded value. +No other startup files are read. +

+ +Bash + +attempts to determine when it is being run with its standard input +connected to a network connection, as when executed by the remote shell +daemon, usually rshd, or the secure shell daemon sshd. +If +bash + +determines it is being run in this fashion, it reads and executes +commands from ~/.bashrc, if that file exists and is readable. +It will not do this if invoked as sh. +The +--norc + +option may be used to inhibit this behavior, and the +--rcfile + +option may be used to force another file to be read, but neither +rshd nor sshd generally invoke the shell with those options +or allow them to be specified. +

+ +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the -p option is not supplied, no startup +files are read, shell functions are not inherited from the environment, the +SHELLOPTS, + + +BASHOPTS, + + +CDPATH, + + +and +GLOBIGNORE + + +variables, if they appear in the environment, are ignored, +and the effective user id is set to the real user id. +If the -p option is supplied at invocation, the startup behavior is +the same, but the effective user id is not reset. +  +

DEFINITIONS

+ +

+ +The following definitions are used throughout the rest of this +document. + +

+
blank + +
+A space or tab. +
word + +
+A sequence of characters considered as a single unit by the shell. +Also known as a +token. + +
name + +
+A +word + +consisting only of alphanumeric characters and underscores, and +beginning with an alphabetic character or an underscore. Also +referred to as an +identifier. + +
metacharacter + +
+A character that, when unquoted, separates words. One of the following: +
+ +
+

+ +| & ; ( ) < > space tab + +

+ +
+

+ +

+
control operator + +
+A token that performs a control function. It is one of the following +symbols: +
+

+ +|| & && ; ;; ( ) | |& <newline> + +

+ + +
+  +

RESERVED WORDS

+ +Reserved words are words that have a special meaning to the shell. +The following words are recognized as reserved when unquoted and either +the first word of a simple command (see +SHELL GRAMMAR + + +below) or the third word of a +case + +or +for + +command: +
+ +

+ + + + +! case coproc do done elif else esac fi for function if in select then until while { } time [[ ]] +

+ + +  +

SHELL GRAMMAR

+ +  +

Simple Commands

+ +

+ +A simple command is a sequence of optional variable assignments +followed by blank-separated words and redirections, and +terminated by a control operator. The first word +specifies the command to be executed, and is passed as argument zero. +The remaining words are passed as arguments to the invoked command. +

+ +The return value of a simple command is its exit status, or +128+n if the command is terminated by signal +n. + +  +

Pipelines

+ +

+ +A pipeline is a sequence of one or more commands separated by +one of the control operators +| + +or |&. +The format for a pipeline is: +

+

+ +[time [-p]] [ ! ] command [ [|||&] command2 ... ] +

+ +

+ +The standard output of +command + +is connected via a pipe to the standard input of +command2. + +This connection is performed before any redirections specified by the +command (see +REDIRECTION + + +below). +If |& is used, command's standard error, in addition to its +standard output, is connected to +command2's standard input through the pipe; +it is shorthand for 2>&1 |. +This implicit redirection of the standard error to the standard output is +performed after any redirections specified by the command. +

+ +The return status of a pipeline is the exit status of the last +command, unless the pipefail option is enabled. +If pipefail is enabled, the pipeline's return status is the +value of the last (rightmost) command to exit with a non-zero status, +or zero if all commands exit successfully. +If the reserved word +! + +precedes a pipeline, the exit status of that pipeline is the logical +negation of the exit status as described above. +The shell waits for all commands in the pipeline to +terminate before returning a value. +

+ +If the +time + +reserved word precedes a pipeline, the elapsed as well as user and +system time consumed by its execution are reported when the pipeline +terminates. +The -p option changes the output format to that specified by POSIX. +When the shell is in posix mode, it does not recognize +time as a reserved word if the next token begins with a `-'. +The +TIMEFORMAT + + +variable may be set to a format string that specifies how the timing +information should be displayed; see the description of +TIMEFORMAT + + +under +Shell Variables + +below. +

+ +When the shell is in posix mode, time +may be followed by a newline. In this case, the shell displays the +total user and system time consumed by the shell and its children. +The +TIMEFORMAT + + +variable may be used to specify the format of +the time information. +

+ +Each command in a pipeline is executed as a separate process (i.e., in a +subshell). +  +

Lists

+ +

+ +A list is a sequence of one or more pipelines separated by one +of the operators +;, + +&, + +&&, + +or +||, + +and optionally terminated by one of +;, + +&, + +or +<newline>. + +

+ +Of these list operators, +&& + +and +|| + +have equal precedence, followed by +; + +and +&, + +which have equal precedence. +

+ +A sequence of one or more newlines may appear in a list instead +of a semicolon to delimit commands. +

+ +If a command is terminated by the control operator +&, + +the shell executes the command in the background +in a subshell. The shell does not wait for the command to +finish, and the return status is 0. Commands separated by a +; + +are executed sequentially; the shell waits for each +command to terminate in turn. The return status is the +exit status of the last command executed. +

+ +AND and OR lists are sequences of one of more pipelines separated by the +&& and || control operators, respectively. +AND and OR lists are executed with left associativity. +An AND list has the form +

+

+ +command1 && command2 +

+ +

+ +command2 + +is executed if, and only if, +command1 + +returns an exit status of zero. +

+ +An OR list has the form +

+

+ +command1 || command2 +

+ +

+ +

+ +command2 + +is executed if and only if +command1 + +returns a non-zero exit status. +The return status of +AND and OR lists is the exit status of the last command +executed in the list. +  +

Compound Commands

+ +

+ +A compound command is one of the following. +In most cases a list in a command's description may be separated from +the rest of the command by one or more newlines, and may be followed by a +newline in place of a semicolon. +

+
(list)
+list is executed in a subshell environment (see +COMMAND EXECUTION ENVIRONMENT +below). +Variable assignments and builtin +commands that affect the shell's environment do not remain in effect +after the command completes. The return status is the exit status of +list. +
{ list; }
+list is simply executed in the current shell environment. +list must be terminated with a newline or semicolon. +This is known as a group command. +The return status is the exit status of +list. +Note that unlike the metacharacters ( and ), { and +} are reserved words and must occur where a reserved +word is permitted to be recognized. Since they do not cause a word +break, they must be separated from list by whitespace or another +shell metacharacter. +
((expression))
+The expression is evaluated according to the rules described +below under +ARITHMETIC EVALUATION. + + +If the value of the expression is non-zero, the return status is 0; +otherwise the return status is 1. This is exactly equivalent to +let "expression". +
[[ expression ]]
+Return a status of 0 or 1 depending on the evaluation of +the conditional expression expression. +Expressions are composed of the primaries described below under +CONDITIONAL EXPRESSIONS. + + +Word splitting and pathname expansion are not performed on the words +between the [[ and ]]; tilde expansion, +parameter and variable expansion, +arithmetic expansion, command substitution, process +substitution, and quote removal are performed. +Conditional operators such as -f must be unquoted to be recognized +as primaries. +

+ + +When used with [[, the < and > operators sort +lexicographically using the current locale. +

+ + +When the == and != operators are used, the string to the +right of the operator is considered a pattern and matched according +to the rules described below under Pattern Matching, +as if the extglob shell option were enabled. +The = operator is equivalent to ==. +If the shell option +nocasematch + +is enabled, the match is performed without regard to the case +of alphabetic characters. +The return value is 0 if the string matches (==) or does not match +(!=) the pattern, and 1 otherwise. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +

+ + +An additional binary operator, =~, is available, with the same +precedence as == and !=. +When it is used, the string to the right of the operator is considered +an extended regular expression and matched accordingly (as in regex(3)). +The return value is 0 if the string matches +the pattern, and 1 otherwise. +If the regular expression is syntactically incorrect, the conditional +expression's return value is 2. +If the shell option +nocasematch + +is enabled, the match is performed without regard to the case +of alphabetic characters. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +Bracket expressions in regular expressions must be treated carefully, +since normal quoting characters lose their meanings between brackets. +If the pattern is stored in a shell variable, quoting the variable +expansion forces the entire pattern to be matched as a string. +Substrings matched by parenthesized subexpressions within the regular +expression are saved in the array variable +BASH_REMATCH. + + +The element of +BASH_REMATCH + + +with index 0 is the portion of the string +matching the entire regular expression. +The element of +BASH_REMATCH + + +with index n is the portion of the +string matching the nth parenthesized subexpression. +

+ + +Expressions may be combined using the following operators, listed +in decreasing order of precedence: +

+ + +

+ +
+
( expression ) + +
+Returns the value of expression. +This may be used to override the normal precedence of operators. +
! expression + +
+True if +expression + +is false. +
expression1 && expression2
+True if both +expression1 + +and +expression2 + +are true. +
expression1 || expression2
+True if either +expression1 + +or +expression2 + +is true. + +
+

+ +The && and || +operators do not evaluate expression2 if the value of +expression1 is sufficient to determine the return value of +the entire conditional expression. +

+ +
for name [ [ in [ word ... ] ] ; ] do list ; done
+The list of words following in is expanded, generating a list +of items. +The variable name is set to each element of this list +in turn, and list is executed each time. +If the in word is omitted, the for command executes +list once for each positional parameter that is set (see +PARAMETERS + + +below). +The return status is the exit status of the last command that executes. +If the expansion of the items following in results in an empty +list, no commands are executed, and the return status is 0. +
for (( expr1 ; expr2 ; expr3 )) ; do list ; done
+First, the arithmetic expression expr1 is evaluated according +to the rules described below under +ARITHMETIC EVALUATION. + + +The arithmetic expression expr2 is then evaluated repeatedly +until it evaluates to zero. +Each time expr2 evaluates to a non-zero value, list is +executed and the arithmetic expression expr3 is evaluated. +If any expression is omitted, it behaves as if it evaluates to 1. +The return value is the exit status of the last command in list +that is executed, or false if any of the expressions is invalid. +
select name [ in word ] ; do list ; done
+The list of words following in is expanded, generating a list +of items. The set of expanded words is printed on the standard +error, each preceded by a number. If the in +word is omitted, the positional parameters are printed (see +PARAMETERS + + +below). The +PS3 + + +prompt is then displayed and a line read from the standard input. +If the line consists of a number corresponding to one of +the displayed words, then the value of +name + +is set to that word. If the line is empty, the words and prompt +are displayed again. If EOF is read, the command completes. Any +other value read causes +name + +to be set to null. The line read is saved in the variable +REPLY. + + +The +list + +is executed after each selection until a +break + +command is executed. +The exit status of +select + +is the exit status of the last command executed in +list, + +or zero if no commands were executed. +
case word in [ [(] pattern [ | pattern ] +
+A case command first expands word, and tries to match +it against each pattern in turn, using the same matching rules +as for pathname expansion (see +Pathname Expansion + +below). +The word is expanded using tilde +expansion, parameter and variable expansion, arithmetic substitution, +command substitution, process substitution and quote removal. +Each pattern examined is expanded using tilde +expansion, parameter and variable expansion, arithmetic substitution, +command substitution, and process substitution. +If the shell option +nocasematch + +is enabled, the match is performed without regard to the case +of alphabetic characters. +When a match is found, the corresponding list is executed. +If the ;; operator is used, no subsequent matches are attempted after +the first pattern match. +Using ;& in place of ;; causes execution to continue with +the list associated with the next set of patterns. +Using ;;& in place of ;; causes the shell to test the next +pattern list in the statement, if any, and execute any associated list +on a successful match. +The exit status is zero if no +pattern matches. Otherwise, it is the exit status of the +last command executed in list. +
if list; then list; [ elif list; then list; ] ... [ else list; ] fi
+The +if + +list + +is executed. If its exit status is zero, the +then list is executed. Otherwise, each elif +list is executed in turn, and if its exit status is zero, +the corresponding then list is executed and the +command completes. Otherwise, the else list is +executed, if present. The exit status is the exit status of the +last command executed, or zero if no condition tested true. +
while list-1; do list-2; done
+ +
until list-1; do list-2; done
+ +The while command continuously executes the list +list-2 as long as the last command in the list list-1 returns +an exit status of zero. The until command is identical +to the while command, except that the test is negated; +list-2 + +is executed as long as the last command in +list-1 + +returns a non-zero exit status. +The exit status of the while and until commands +is the exit status +of the last command executed in list-2, or zero if +none was executed. +
+  +

Coprocesses

+ +

+ +A coprocess is a shell command preceded by the coproc reserved +word. +A coprocess is executed asynchronously in a subshell, as if the command +had been terminated with the & control operator, with a two-way pipe +established between the executing shell and the coprocess. +

+ +The format for a coprocess is: +

+

+ +coproc [NAME] command [redirections] +

+ +

+ +This creates a coprocess named NAME. +If NAME is not supplied, the default name is COPROC. +NAME must not be supplied if command is a simple +command (see above); otherwise, it is interpreted as the first word +of the simple command. +When the coprocess is executed, the shell creates an array variable (see +Arrays + +below) named NAME in the context of the executing shell. +The standard output of +command + +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to NAME[0]. +The standard input of +command + +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to NAME[1]. +This pipe is established before any redirections specified by the +command (see +REDIRECTION + + +below). +The file descriptors can be utilized as arguments to shell commands +and redirections using standard word expansions. +The file descriptors are not available in subshells. +The process ID of the shell spawned to execute the coprocess is +available as the value of the variable NAME_PID. +The wait +builtin command may be used to wait for the coprocess to terminate. +

+ +Since the coprocess is created as an asynchronous command, +the coproc command always returns success. +The return status of a coprocess is the exit status of command. +  +

Shell Function Definitions

+ +

+ +A shell function is an object that is called like a simple command and +executes a compound command with a new set of positional parameters. +Shell functions are declared as follows: +

+
name () compound-command [redirection]
+ +
function name [()] compound-command [redirection]
+ +This defines a function named name. +The reserved word function is optional. +If the function reserved word is supplied, the parentheses are optional. +The body of the function is the compound command +compound-command + +(see Compound Commands above). +That command is usually a list of commands between { and }, but +may be any command listed under Compound Commands above. +compound-command is executed whenever name is specified as the +name of a simple command. +When in posix mode, name may not be the name of one of the +POSIX special builtins. +Any redirections (see +REDIRECTION + + +below) specified when a function is defined are performed +when the function is executed. +The exit status of a function definition is zero unless a syntax error +occurs or a readonly function with the same name already exists. +When executed, the exit status of a function is the exit status of the +last command executed in the body. (See +FUNCTIONS + + +below.) +
+  +

COMMENTS

+ +In a non-interactive shell, or an interactive shell in which the +interactive_comments + +option to the +shopt + +builtin is enabled (see +SHELL BUILTIN COMMANDS + + +below), a word beginning with +# + +causes that word and all remaining characters on that line to +be ignored. An interactive shell without the +interactive_comments + +option enabled does not allow comments. The +interactive_comments + +option is on by default in interactive shells. +  +

QUOTING

+ +Quoting is used to remove the special meaning of certain +characters or words to the shell. Quoting can be used to +disable special treatment for special characters, to prevent +reserved words from being recognized as such, and to prevent +parameter expansion. +

+ +Each of the metacharacters listed above under +DEFINITIONS + + +has special meaning to the shell and must be quoted if it is to +represent itself. +

+ +When the command history expansion facilities are being used +(see +HISTORY EXPANSION + + +below), the +history expansion character, usually !, must be quoted +to prevent history expansion. +

+ +There are three quoting mechanisms: the +escape character, + +single quotes, and double quotes. +

+ +A non-quoted backslash (\) is the +escape character. + +It preserves the literal value of the next character that follows, +with the exception of <newline>. If a \<newline> pair +appears, and the backslash is not itself quoted, the \<newline> +is treated as a line continuation (that is, it is removed from the +input stream and effectively ignored). +

+ +Enclosing characters in single quotes preserves the literal value +of each character within the quotes. A single quote may not occur +between single quotes, even when preceded by a backslash. +

+ +Enclosing characters in double quotes preserves the literal value +of all characters within the quotes, with the exception of +$, + +`, + +\, + +and, when history expansion is enabled, +!. + +The characters +$ + +and +` + +retain their special meaning within double quotes. The backslash +retains its special meaning only when followed by one of the following +characters: +$, + +`, + +", +\, + +or +<newline>. + +A double quote may be quoted within double quotes by preceding it with +a backslash. +If enabled, history expansion will be performed unless an +! + +appearing in double quotes is escaped using a backslash. +The backslash preceding the +! + +is not removed. +

+ +The special parameters +* + +and +@ + +have special meaning when in double +quotes (see +PARAMETERS + + +below). +

+ +Words of the form $aqstringaq are treated specially. The +word expands to string, with backslash-escaped characters replaced +as specified by the ANSI C standard. Backslash escape sequences, if +present, are decoded as follows: +

+ +
+
\a + +
+alert (bell) +
\b + +
+backspace +
\e + +
+
\E + +
+an escape character +
\f + +
+form feed +
\n + +
+new line +
\r + +
+carriage return +
\t + +
+horizontal tab +
\v + +
+vertical tab +
\\ + +
+backslash +
\aq + +
+single quote +
\dq + +
+double quote +
\nnn + +
+the eight-bit character whose value is the octal value nnn +(one to three digits) +
\xHH + +
+the eight-bit character whose value is the hexadecimal value HH +(one or two hex digits) +
\uHHHH + +
+the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +HHHH (one to four hex digits) +
\UHHHHHHHH + +
+the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +HHHHHHHH (one to eight hex digits) +
\cx + +
+a control-x character + +
+ +

+ +The expanded result is single-quoted, as if the dollar sign had +not been present. +

+ +A double-quoted string preceded by a dollar sign ($dqstringdq) +will cause the string to be translated according to the current locale. +If the current locale is C or POSIX, the dollar sign +is ignored. +If the string is translated and replaced, the replacement is +double-quoted. +  +

PARAMETERS

+ +A +parameter + +is an entity that stores values. +It can be a +name, + +a number, or one of the special characters listed below under +Special Parameters. + +A +variable + +is a parameter denoted by a +name. + +A variable has a value and zero or more attributes. +Attributes are assigned using the +declare + +builtin command (see +declare + +below in +SHELL BUILTIN COMMANDS). + + +

+ +A parameter is set if it has been assigned a value. The null string is +a valid value. Once a variable is set, it may be unset only by using +the +unset + +builtin command (see +SHELL BUILTIN COMMANDS + + +below). +

+ +A +variable + +may be assigned to by a statement of the form +

+

+ +name=[value] +

+ +

+ +If +value + +is not given, the variable is assigned the null string. All +values + +undergo tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote +removal (see +EXPANSION + + +below). If the variable has its +integer + +attribute set, then +value + +is evaluated as an arithmetic expression even if the $((...)) expansion is +not used (see +Arithmetic Expansion + +below). +Word splitting is not performed, with the exception +of "$@" as explained below under +Special Parameters. + +Pathname expansion is not performed. +Assignment statements may also appear as arguments to the +alias, + +declare, + +typeset, + +export, + +readonly, + +and +local + +builtin commands. +When in posix mode, these builtins may appear in a command after +one or more instances of the command builtin and retain these +assignment statement properties. +

+ +In the context where an assignment statement is assigning a value +to a shell variable or array index, the += operator can be used to +append to or add to the variable's previous value. +When += is applied to a variable for which the integer attribute has been +set, value is evaluated as an arithmetic expression and added to the +variable's current value, which is also evaluated. +When += is applied to an array variable using compound assignment (see +Arrays + +below), the +variable's value is not unset (as it is when using =), and new values are +appended to the array beginning at one greater than the array's maximum index +(for indexed arrays) or added as additional key-value pairs in an +associative array. +When applied to a string-valued variable, value is expanded and +appended to the variable's value. +

+ +A variable can be assigned the nameref attribute using the +-n option to the declare or local builtin commands +(see the descriptions of declare and local below) +to create a nameref, or a reference to another variable. +This allows variables to be manipulated indirectly. +Whenever the nameref variable is referenced or assigned to, the operation +is actually performed on the variable specified by the nameref variable's +value. +A nameref is commonly used within shell functions to refer to a variable +whose name is passed as an argument to the function. +For instance, if a variable name is passed to a shell function as its first +argument, running +

+

+declare -n ref=$1 + +
+ +

+inside the function creates a nameref variable ref whose value is +the variable name passed as the first argument. +References and assignments to ref are treated as references and +assignments to the variable whose name was passed as $1. +If the control variable in a for loop has the nameref attribute, +the list of words can be a list of shell variables, and a name reference +will be established for each word in the list, in turn, when the loop is +executed. +Array variables cannot be given the -n attribute. +However, nameref variables can reference array variables and subscripted +array variables. +Namerefs can be unset using the -n option to the unset builtin. +Otherwise, if unset is executed with the name of a nameref variable +as an argument, the variable referenced by the nameref variable will be unset. +  +

Positional Parameters

+ +

+ +A +positional parameter + +is a parameter denoted by one or more +digits, other than the single digit 0. Positional parameters are +assigned from the shell's arguments when it is invoked, +and may be reassigned using the +set + +builtin command. Positional parameters may not be assigned to +with assignment statements. The positional parameters are +temporarily replaced when a shell function is executed (see +FUNCTIONS + + +below). +

+ +When a positional parameter consisting of more than a single +digit is expanded, it must be enclosed in braces (see +EXPANSION + + +below). +  +

Special Parameters

+ +

+ +The shell treats several parameters specially. These parameters may +only be referenced; assignment to them is not allowed. + +

+
* + +
+Expands to the positional parameters, starting from one. +When the expansion is not within double quotes, each positional parameter +expands to a separate word. +In contexts where it is performed, those words +are subject to further word splitting and pathname expansion. +When the expansion occurs within double quotes, it expands to a single word +with the value of each parameter separated by the first character +of the +IFS + + +special variable. That is, "$*" is equivalent +to "$1c$2c...", where +c + +is the first character of the value of the +IFS + + +variable. If +IFS + + +is unset, the parameters are separated by spaces. +If +IFS + + +is null, the parameters are joined without intervening separators. +
@ + +
+Expands to the positional parameters, starting from one. When the +expansion occurs within double quotes, each parameter expands to a +separate word. That is, "$@" is equivalent to +"$1" "$2" ... +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +When there are no positional parameters, "$@" and +$@ + +expand to nothing (i.e., they are removed). +
# + +
+Expands to the number of positional parameters in decimal. +
? + +
+Expands to the exit status of the most recently executed foreground +pipeline. +
- + +
+Expands to the current option flags as specified upon invocation, +by the +set + +builtin command, or those set by the shell itself +(such as the +-i + +option). +
$ + +
+Expands to the process ID of the shell. In a () subshell, it +expands to the process ID of the current shell, not the +subshell. +
! + +
+Expands to the process ID of the job most recently placed into the +background, whether executed as an asynchronous command or using +the bg builtin (see +JOB CONTROL + + +below). +
0 + +
+Expands to the name of the shell or shell script. This is set at +shell initialization. If +bash + +is invoked with a file of commands, +$0 + +is set to the name of that file. If +bash + +is started with the +-c + +option, then +$0 + +is set to the first argument after the string to be +executed, if one is present. Otherwise, it is set +to the filename used to invoke +bash, + +as given by argument zero. +
_ + +
+At shell startup, set to the absolute pathname used to invoke the +shell or shell script being executed as passed in the environment +or argument list. +Subsequently, expands to the last argument to the previous command, +after expansion. +Also set to the full pathname used to invoke each command executed +and placed in the environment exported to that command. +When checking mail, this parameter holds the name of the mail file +currently being checked. + +
+  +

Shell Variables

+ +

+ +The following variables are set by the shell: +

+ + +

+
BASH + +
+Expands to the full filename used to invoke this instance of +bash. + +
BASHOPTS + +
+A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +-s + +option to the +shopt + +builtin command (see +SHELL BUILTIN COMMANDS + + +below). The options appearing in +BASHOPTS + + +are those reported as +on + +by shopt. +If this variable is in the environment when +bash + +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +
BASHPID + +
+Expands to the process ID of the current bash process. +This differs from $$ under certain circumstances, such as subshells +that do not require bash to be re-initialized. +
BASH_ALIASES + +
+An associative array variable whose members correspond to the internal +list of aliases as maintained by the alias builtin. +Elements added to this array appear in the alias list; unsetting array +elements cause aliases to be removed from the alias list. +
BASH_ARGC + +
+An array variable whose values are the number of parameters in each +frame of the current bash execution call stack. +The number of +parameters to the current subroutine (shell function or script executed +with . or source) is at the top of the stack. +When a subroutine is executed, the number of parameters passed is pushed onto +BASH_ARGC. + + +The shell sets +BASH_ARGC + + +only when in extended debugging mode (see the description of the +extdebug + +option to the +shopt + +builtin below) +
BASH_ARGV + +
+An array variable containing all of the parameters in the current bash +execution call stack. The final parameter of the last subroutine call +is at the top of the stack; the first parameter of the initial call is +at the bottom. When a subroutine is executed, the parameters supplied +are pushed onto +BASH_ARGV. + + +The shell sets +BASH_ARGV + + +only when in extended debugging mode +(see the description of the +extdebug + +option to the +shopt + +builtin below) +
BASH_CMDS + +
+An associative array variable whose members correspond to the internal +hash table of commands as maintained by the hash builtin. +Elements added to this array appear in the hash table; unsetting array +elements cause commands to be removed from the hash table. +
BASH_COMMAND + +
+The command currently being executed or about to be executed, unless the +shell is executing a command as the result of a trap, +in which case it is the command executing at the time of the trap. +
BASH_EXECUTION_STRING + +
+The command argument to the -c invocation option. +
BASH_LINENO + +
+An array variable whose members are the line numbers in source files +where each corresponding member of +FUNCNAME + + +was invoked. +${BASH_LINENO[$i]} is the line number in the source +file (${BASH_SOURCE[$i+1]}) where +${FUNCNAME[$i]} was called +(or ${BASH_LINENO[$i-1]} if referenced within another +shell function). +Use +LINENO + + +to obtain the current line number. +
BASH_REMATCH + +
+An array variable whose members are assigned by the =~ binary +operator to the [[ conditional command. +The element with index 0 is the portion of the string +matching the entire regular expression. +The element with index n is the portion of the +string matching the nth parenthesized subexpression. +This variable is read-only. +
BASH_SOURCE + +
+An array variable whose members are the source filenames +where the corresponding shell function names in the +FUNCNAME + + +array variable are defined. +The shell function +${FUNCNAME[$i]} is defined in the file +${BASH_SOURCE[$i]} and called from +${BASH_SOURCE[$i+1]}. +
BASH_SUBSHELL + +
+Incremented by one within each subshell or subshell environment when +the shell begins executing in that environment. +The initial value is 0. +
BASH_VERSINFO + +
+A readonly array variable whose members hold version information for +this instance of +bash. + +The values assigned to the array members are as follows: +

+

+
+
BASH_VERSINFO[0] + +
+The major version number (the release). +
BASH_VERSINFO[1] + +
+The minor version number (the version). +
BASH_VERSINFO[2] + +
+The patch level. +
BASH_VERSINFO[3] + +
+The build version. +
BASH_VERSINFO[4] + +
+The release status (e.g., beta1). +
BASH_VERSINFO[5] + +
+The value of +MACHTYPE. + + +
+ +
BASH_VERSION + +
+Expands to a string describing the version of this instance of +bash. + +
COMP_CWORD + +
+An index into ${COMP_WORDS} of the word containing the current +cursor position. +This variable is available only in shell functions invoked by the +programmable completion facilities (see Programmable Completion +below). +
COMP_KEY + +
+The key (or final key of a key sequence) used to invoke the current +completion function. +
COMP_LINE + +
+The current command line. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see Programmable Completion +below). +
COMP_POINT + +
+The index of the current cursor position relative to the beginning of +the current command. +If the current cursor position is at the end of the current command, +the value of this variable is equal to ${#COMP_LINE}. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see Programmable Completion +below). +
COMP_TYPE + +
+Set to an integer value corresponding to the type of completion attempted +that caused a completion function to be called: +TAB, for normal completion, +?, for listing completions after successive tabs, +!, for listing alternatives on partial word completion, +@, to list completions if the word is not unmodified, +or +%, for menu completion. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see Programmable Completion +below). +
COMP_WORDBREAKS + +
+The set of characters that the readline library treats as word +separators when performing word completion. +If +COMP_WORDBREAKS + + +is unset, it loses its special properties, even if it is +subsequently reset. +
COMP_WORDS + +
+An array variable (see Arrays below) consisting of the individual +words in the current command line. +The line is split into words as readline would split it, using +COMP_WORDBREAKS + + +as described above. +This variable is available only in shell functions invoked by the +programmable completion facilities (see Programmable Completion +below). +
COPROC + +
+An array variable (see Arrays below) created to hold the file descriptors +for output from and input to an unnamed coprocess (see Coprocesses +above). +
DIRSTACK + +
+An array variable (see +Arrays + +below) containing the current contents of the directory stack. +Directories appear in the stack in the order they are displayed by the +dirs + +builtin. +Assigning to members of this array variable may be used to modify +directories already in the stack, but the +pushd + +and +popd + +builtins must be used to add and remove directories. +Assignment to this variable will not change the current directory. +If +DIRSTACK + + +is unset, it loses its special properties, even if it is +subsequently reset. +
EUID + +
+Expands to the effective user ID of the current user, initialized at +shell startup. This variable is readonly. +
FUNCNAME + +
+An array variable containing the names of all shell functions +currently in the execution call stack. +The element with index 0 is the name of any currently-executing +shell function. +The bottom-most element (the one with the highest index) is +"main". + +This variable exists only when a shell function is executing. +Assignments to +FUNCNAME + + +have no effect and return an error status. +If +FUNCNAME + + +is unset, it loses its special properties, even if it is +subsequently reset. +

+ + +This variable can be used with BASH_LINENO and BASH_SOURCE. +Each element of FUNCNAME has corresponding elements in +BASH_LINENO and BASH_SOURCE to describe the call stack. +For instance, ${FUNCNAME[$i]} was called from the file +${BASH_SOURCE[$i+1]} at line number +${BASH_LINENO[$i]}. +The caller builtin displays the current call stack using this +information. +

GROUPS + +
+An array variable containing the list of groups of which the current +user is a member. +Assignments to +GROUPS + + +have no effect and return an error status. +If +GROUPS + + +is unset, it loses its special properties, even if it is +subsequently reset. +
HISTCMD + +
+The history number, or index in the history list, of the current +command. +If +HISTCMD + + +is unset, it loses its special properties, even if it is +subsequently reset. +
HOSTNAME + +
+Automatically set to the name of the current host. +
HOSTTYPE + +
+Automatically set to a string that uniquely +describes the type of machine on which +bash + +is executing. +The default is system-dependent. +
LINENO + +
+Each time this parameter is referenced, the shell substitutes +a decimal number representing the current sequential line number +(starting with 1) within a script or function. When not in a +script or function, the value substituted is not guaranteed to +be meaningful. +If +LINENO + + +is unset, it loses its special properties, even if it is +subsequently reset. +
MACHTYPE + +
+Automatically set to a string that fully describes the system +type on which +bash + +is executing, in the standard GNU cpu-company-system format. +The default is system-dependent. +
MAPFILE + +
+An array variable (see Arrays below) created to hold the text +read by the mapfile builtin when no variable name is supplied. +
OLDPWD + +
+The previous working directory as set by the +cd + +command. +
OPTARG + +
+The value of the last option argument processed by the +getopts + +builtin command (see +SHELL BUILTIN COMMANDS + + +below). +
OPTIND + +
+The index of the next argument to be processed by the +getopts + +builtin command (see +SHELL BUILTIN COMMANDS + + +below). +
OSTYPE + +
+Automatically set to a string that +describes the operating system on which +bash + +is executing. +The default is system-dependent. +
PIPESTATUS + +
+An array variable (see +Arrays + +below) containing a list of exit status values from the processes +in the most-recently-executed foreground pipeline (which may +contain only a single command). +
PPID + +
+The process ID of the shell's parent. This variable is readonly. +
PWD + +
+The current working directory as set by the +cd + +command. +
RANDOM + +
+Each time this parameter is referenced, a random integer between +0 and 32767 is +generated. The sequence of random numbers may be initialized by assigning +a value to +RANDOM. + + +If +RANDOM + + +is unset, it loses its special properties, even if it is +subsequently reset. +
READLINE_LINE + +
+The contents of the +readline + +line buffer, for use with +bind -x + +(see +SHELL BUILTIN COMMANDS + + +below). +
READLINE_POINT + +
+The position of the insertion point in the +readline + +line buffer, for use with +bind -x + +(see +SHELL BUILTIN COMMANDS + + +below). +
REPLY + +
+Set to the line of input read by the +read + +builtin command when no arguments are supplied. +
SECONDS + +
+Each time this parameter is +referenced, the number of seconds since shell invocation is returned. If a +value is assigned to +SECONDS, + + +the value returned upon subsequent +references is +the number of seconds since the assignment plus the value assigned. +If +SECONDS + + +is unset, it loses its special properties, even if it is +subsequently reset. +
SHELLOPTS + +
+A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the +-o + +option to the +set + +builtin command (see +SHELL BUILTIN COMMANDS + + +below). The options appearing in +SHELLOPTS + + +are those reported as +on + +by set -o. +If this variable is in the environment when +bash + +starts up, each shell option in the list will be enabled before +reading any startup files. +This variable is read-only. +
SHLVL + +
+Incremented by one each time an instance of +bash + +is started. +
UID + +
+Expands to the user ID of the current user, initialized at shell startup. +This variable is readonly. + +
+

+ +The following variables are used by the shell. In some cases, +bash + +assigns a default value to a variable; these cases are noted +below. +

+ + +

+
BASH_COMPAT + +
+The value is used to set the shell's compatibility level. +See the description of the shopt builtin below under +SHELL BUILTIN COMMANDS +for a description of the various compatibility +levels and their effects. +The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42) +corresponding to the desired compatibility level. +If BASH_COMPAT is unset or set to the empty string, the compatibility +level is set to the default for the current version. +If BASH_COMPAT is set to a value that is not one of the valid +compatibility levels, the shell prints an error message and sets the +compatibility level to the default for the current version. +The valid compatibility levels correspond to the compatibility options +accepted by the shopt builtin described below (for example, +compat42 means that 4.2 and 42 are valid values). +The current version is also a valid value. +
BASH_ENV + +
+If this parameter is set when bash is executing a shell script, +its value is interpreted as a filename containing commands to +initialize the shell, as in +~/.bashrc. + +The value of +BASH_ENV + + +is subjected to parameter expansion, command substitution, and arithmetic +expansion before being interpreted as a filename. +PATH + + +is not used to search for the resultant filename. +
BASH_XTRACEFD + +
+If set to an integer corresponding to a valid file descriptor, bash +will write the trace output generated when +set -x + +is enabled to that file descriptor. +The file descriptor is closed when +BASH_XTRACEFD + + +is unset or assigned a new value. +Unsetting +BASH_XTRACEFD + + +or assigning it the empty string causes the +trace output to be sent to the standard error. +Note that setting +BASH_XTRACEFD + + +to 2 (the standard error file +descriptor) and then unsetting it will result in the standard error +being closed. +
CDPATH + +
+The search path for the +cd + +command. +This is a colon-separated list of directories in which the shell looks +for destination directories specified by the +cd + +command. +A sample value is +".:~:/usr". + +
CHILD_MAX + +
+Set the number of exited child status values for the shell to remember. +Bash will not allow this value to be decreased below a POSIX-mandated +minimum, and there is a maximum value (currently 8192) that this may +not exceed. +The minimum value is system-dependent. +
COLUMNS + +
+Used by the select compound command to determine the terminal width +when printing selection lists. +Automatically set if the +checkwinsize + +option is enabled or in an interactive shell upon receipt of a +SIGWINCH. + + +
COMPREPLY + +
+An array variable from which bash reads the possible completions +generated by a shell function invoked by the programmable completion +facility (see Programmable Completion below). +Each array element contains one possible completion. +
EMACS + +
+If bash finds this variable in the environment when the shell starts +with value +t, + +it assumes that the shell is running in an Emacs shell buffer and disables +line editing. +
ENV + +
+Similar to +BASH_ENV; + + +used when the shell is invoked in POSIX mode. +
FCEDIT + +
+The default editor for the +fc + +builtin command. +
FIGNORE + +
+A colon-separated list of suffixes to ignore when performing +filename completion (see +READLINE + + +below). +A filename whose suffix matches one of the entries in +FIGNORE + + +is excluded from the list of matched filenames. +A sample value is +".o:~". + +
FUNCNEST + +
+If set to a numeric value greater than 0, defines a maximum function +nesting level. Function invocations that exceed this nesting level +will cause the current command to abort. +
GLOBIGNORE + +
+A colon-separated list of patterns defining the set of filenames to +be ignored by pathname expansion. +If a filename matched by a pathname expansion pattern also matches one +of the patterns in +GLOBIGNORE, + + +it is removed from the list of matches. +
HISTCONTROL + +
+A colon-separated list of values controlling how commands are saved on +the history list. +If the list of values includes +ignorespace, + +lines which begin with a +space + +character are not saved in the history list. +A value of +ignoredups + +causes lines matching the previous history entry to not be saved. +A value of +ignoreboth + +is shorthand for ignorespace and ignoredups. +A value of +erasedups + +causes all previous lines matching the current line to be removed from +the history list before that line is saved. +Any value not in the above list is ignored. +If +HISTCONTROL + + +is unset, or does not include a valid value, +all lines read by the shell parser are saved on the history list, +subject to the value of +HISTIGNORE. + + +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +HISTCONTROL. + + +
HISTFILE + +
+The name of the file in which command history is saved (see +HISTORY + + +below). The default value is ~/.bash_history. If unset, the +command history is not saved when a shell exits. +
HISTFILESIZE + +
+The maximum number of lines contained in the history file. When this +variable is assigned a value, the history file is truncated, if +necessary, +to contain no more than that number of lines by removing the oldest entries. +The history file is also truncated to this size after +writing it when a shell exits. +If the value is 0, the history file is truncated to zero size. +Non-numeric values and numeric values less than zero inhibit truncation. +The shell sets the default value to the value of HISTSIZE +after reading any startup files. +
HISTIGNORE + +
+A colon-separated list of patterns used to decide which command lines +should be saved on the history list. Each pattern is anchored at the +beginning of the line and must match the complete line (no implicit +`*' is appended). Each pattern is tested against the line +after the checks specified by +HISTCONTROL + + +are applied. +In addition to the normal shell pattern matching characters, `&' +matches the previous history line. `&' may be escaped using a +backslash; the backslash is removed before attempting a match. +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +HISTIGNORE. + + +
HISTSIZE + +
+The number of commands to remember in the command history (see +HISTORY + + +below). +If the value is 0, commands are not saved in the history list. +Numeric values less than zero result in every command being saved +on the history list (there is no limit). +The shell sets the default value to 500 after reading any startup files. +
HISTTIMEFORMAT + +
+If this variable is set and not null, its value is used as a format string +for strftime(3) to print the time stamp associated with each history +entry displayed by the history builtin. +If this variable is set, time stamps are written to the history file so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +
HOME + +
+The home directory of the current user; the default argument for the +cd builtin command. +The value of this variable is also used when performing tilde expansion. +
HOSTFILE + +
+Contains the name of a file in the same format as + +/etc/hosts + +that should be read when the shell needs to complete a +hostname. +The list of possible hostname completions may be changed while the +shell is running; +the next time hostname completion is attempted after the +value is changed, +bash + +adds the contents of the new file to the existing list. +If +HOSTFILE + + +is set, but has no value, or does not name a readable file, +bash attempts to read + +/etc/hosts + +to obtain the list of possible hostname completions. +When +HOSTFILE + + +is unset, the hostname list is cleared. +
IFS + +
+The +Internal Field Separator + +that is used +for word splitting after expansion and to +split lines into words with the +read + +builtin command. The default value is +``<space><tab><newline>''. +
IGNOREEOF + +
+Controls the +action of an interactive shell on receipt of an +EOF + + +character as the sole input. If set, the value is the number of +consecutive +EOF + + +characters which must be +typed as the first characters on an input line before +bash + +exits. If the variable exists but does not have a numeric value, or +has no value, the default value is 10. If it does not exist, +EOF + + +signifies the end of input to the shell. +
INPUTRC + +
+The filename for the +readline + +startup file, overriding the default of + +~/.inputrc + +(see +READLINE + + +below). +
LANG + +
+Used to determine the locale category for any category not specifically +selected with a variable starting with LC_. +
LC_ALL + +
+This variable overrides the value of +LANG + + +and any other +LC_ variable specifying a locale category. +
LC_COLLATE + +
+This variable determines the collation order used when sorting the +results of pathname expansion, and determines the behavior of range +expressions, equivalence classes, and collating sequences within +pathname expansion and pattern matching. +
LC_CTYPE + +
+This variable determines the interpretation of characters and the +behavior of character classes within pathname expansion and pattern +matching. +
LC_MESSAGES + +
+This variable determines the locale used to translate double-quoted +strings preceded by a $. +
LC_NUMERIC + +
+This variable determines the locale category used for number formatting. +
LINES + +
+Used by the select compound command to determine the column length +for printing selection lists. +Automatically set if the +checkwinsize + +option is enabled or in an interactive shell upon receipt of a +SIGWINCH. + + +
MAIL + +
+If this parameter is set to a file or directory name and the +MAILPATH + + +variable is not set, +bash + +informs the user of the arrival of mail in the specified file or +Maildir-format directory. +
MAILCHECK + +
+Specifies how +often (in seconds) +bash + +checks for mail. The default is 60 seconds. When it is time to check +for mail, the shell does so before displaying the primary prompt. +If this variable is unset, or set to a value that is not a number +greater than or equal to zero, the shell disables mail checking. +
MAILPATH + +
+A colon-separated list of filenames to be checked for mail. +The message to be printed when mail arrives in a particular file +may be specified by separating the filename from the message with a `?'. +When used in the text of the message, $_ expands to the name of +the current mailfile. +Example: +
+

+ +MAILPATH=aq/var/mail/bfox?"You have mail":~/shell-mail?"$_ has mail!"aq +

+ +Bash + +supplies a default value for this variable, but the location of the user +mail files that it uses is system dependent (e.g., /var/mail/$USER). +

+ +
OPTERR + +
+If set to the value 1, +bash + +displays error messages generated by the +getopts + +builtin command (see +SHELL BUILTIN COMMANDS + + +below). +OPTERR + + +is initialized to 1 each time the shell is invoked or a shell +script is executed. +
PATH + +
+The search path for commands. It +is a colon-separated list of directories in which +the shell looks for commands (see +COMMAND EXECUTION + + +below). +A zero-length (null) directory name in the value of +PATH + + +indicates the current directory. +A null directory name may appear as two adjacent colons, or as an initial +or trailing colon. +The default path is system-dependent, +and is set by the administrator who installs +bash. + +A common value is +/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin. + +
POSIXLY_CORRECT + +
+If this variable is in the environment when bash starts, the shell +enters posix mode before reading the startup files, as if the +--posix + +invocation option had been supplied. If it is set while the shell is +running, bash enables posix mode, as if the command +set -o posix + +had been executed. +
PROMPT_COMMAND + +
+If set, the value is executed as a command prior to issuing each primary +prompt. +
PROMPT_DIRTRIM + +
+If set to a number greater than zero, the value is used as the number of +trailing directory components to retain when expanding the \w and +\W prompt string escapes (see +PROMPTING + + +below). Characters removed are replaced with an ellipsis. +
PS1 + +
+The value of this parameter is expanded (see +PROMPTING + + +below) and used as the primary prompt string. The default value is +``\s-\v\$ ''. +
PS2 + +
+The value of this parameter is expanded as with +PS1 + + +and used as the secondary prompt string. The default is +``> ''. +
PS3 + +
+The value of this parameter is used as the prompt for the +select + +command (see +SHELL GRAMMAR + + +above). +
PS4 + +
+The value of this parameter is expanded as with +PS1 + + +and the value is printed before each command +bash + +displays during an execution trace. The first character of +PS4 + + +is replicated multiple times, as necessary, to indicate multiple +levels of indirection. The default is ``+ ''. +
SHELL + +
+The full pathname to the shell is kept in this environment variable. +If it is not set when the shell starts, +bash + +assigns to it the full pathname of the current user's login shell. +
TIMEFORMAT + +
+The value of this parameter is used as a format string specifying +how the timing information for pipelines prefixed with the +time + +reserved word should be displayed. +The % character introduces an escape sequence that is +expanded to a time value or other information. +The escape sequences and their meanings are as follows; the +braces denote optional portions. +

+

+ +
+
%% + +
+A literal %. +
%[p][l]R + +
+The elapsed time in seconds. +
%[p][l]U + +
+The number of CPU seconds spent in user mode. +
%[p][l]S + +
+The number of CPU seconds spent in system mode. +
%P + +
+The CPU percentage, computed as (%U + %S) / %R. + +
+ +
+The optional p is a digit specifying the precision, +the number of fractional digits after a decimal point. +A value of 0 causes no decimal point or fraction to be output. +At most three places after the decimal point may be specified; +values of p greater than 3 are changed to 3. +If p is not specified, the value 3 is used. +
+The optional l specifies a longer format, including +minutes, of the form MMmSS.FFs. +The value of p determines whether or not the fraction is +included. +
+If this variable is not set, bash acts as if it had the +value $aq\nreal\t%3lR\nuser\t%3lU\nsys\t%3lSaq. +If the value is null, no timing information is displayed. +A trailing newline is added when the format string is displayed. + +
TMOUT + +
+If set to a value greater than zero, +TMOUT + + +is treated as the +default timeout for the read builtin. +The select command terminates if input does not arrive +after +TMOUT + + +seconds when input is coming from a terminal. +In an interactive shell, the value is interpreted as the +number of seconds to wait for a line of input after issuing the +primary prompt. +Bash + +terminates after waiting for that number of seconds if a complete +line of input does not arrive. +
TMPDIR + +
+If set, bash uses its value as the name of a directory in which +bash creates temporary files for the shell's use. +
auto_resume + +
+This variable controls how the shell interacts with the user and +job control. If this variable is set, single word simple +commands without redirections are treated as candidates for resumption +of an existing stopped job. There is no ambiguity allowed; if there is +more than one job beginning with the string typed, the job most recently +accessed is selected. The +name + +of a stopped job, in this context, is the command line used to +start it. +If set to the value +exact, + +the string supplied must match the name of a stopped job exactly; +if set to +substring, + +the string supplied needs to match a substring of the name of a +stopped job. The +substring + +value provides functionality analogous to the +%? + +job identifier (see +JOB CONTROL + + +below). If set to any other value, the supplied string must +be a prefix of a stopped job's name; this provides functionality +analogous to the %string job identifier. +
histchars + +
+The two or three characters which control history expansion +and tokenization (see +HISTORY EXPANSION + + +below). The first character is the history expansion character, +the character which signals the start of a history +expansion, normally `!'. +The second character is the quick substitution +character, which is used as shorthand for re-running the previous +command entered, substituting one string for another in the command. +The default is `^'. +The optional third character is the character +which indicates that the remainder of the line is a comment when found +as the first character of a word, normally `#'. The history +comment character causes history substitution to be skipped for the +remaining words on the line. It does not necessarily cause the shell +parser to treat the rest of the line as a comment. + +
+  +

Arrays

+ +Bash + +provides one-dimensional indexed and associative array variables. +Any variable may be used as an indexed array; the +declare + +builtin will explicitly declare an array. +There is no maximum +limit on the size of an array, nor any requirement that members +be indexed or assigned contiguously. +Indexed arrays are referenced using integers (including arithmetic +expressions) and are zero-based; associative arrays are referenced +using arbitrary strings. +Unless otherwise noted, indexed array indices must be non-negative integers. +

+ +An indexed array is created automatically if any variable is assigned to +using the syntax name[subscript]=value. The +subscript + +is treated as an arithmetic expression that must evaluate to a number. +To explicitly declare an indexed array, use +declare -a name + +(see +SHELL BUILTIN COMMANDS + + +below). +declare -a name[subscript] + +is also accepted; the subscript is ignored. +

+ +Associative arrays are created using +declare -A name. + +

+ +Attributes may be +specified for an array variable using the +declare + +and +readonly + +builtins. Each attribute applies to all members of an array. +

+ +Arrays are assigned to using compound assignments of the form +name=(value1 ... valuen), where each +value is of the form [subscript]=string. +Indexed array assignments do not require anything but string. +When assigning to indexed arrays, if the optional brackets and subscript +are supplied, that index is assigned to; +otherwise the index of the element assigned is the last index assigned +to by the statement plus one. Indexing starts at zero. +

+ +When assigning to an associative array, the subscript is required. +

+ +This syntax is also accepted by the +declare + +builtin. Individual array elements may be assigned to using the +name[subscript]=value syntax introduced above. +When assigning to an indexed array, if +name + +is subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +name, so negative indices count back from the end of the +array, and an index of -1 references the last element. +

+ +Any element of an array may be referenced using +${name[subscript]}. The braces are required to avoid +conflicts with pathname expansion. If +subscript is @ or *, the word expands to +all members of name. These subscripts differ only when the +word appears within double quotes. If the word is double-quoted, +${name[*]} expands to a single +word with the value of each array member separated by the first +character of the +IFS + + +special variable, and ${name[@]} expands each element of +name to a separate word. When there are no array members, +${name[@]} expands to nothing. +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +This is analogous to the expansion +of the special parameters * and @ (see +Special Parameters + +above). ${#name[subscript]} expands to the length of +${name[subscript]}. If subscript is * or +@, the expansion is the number of elements in the array. +Referencing an array variable without a subscript is equivalent to +referencing the array with a subscript of 0. +If the +subscript + +used to reference an element of an indexed array +evaluates to a number less than zero, it is +interpreted as relative to one greater than the maximum index of the array, +so negative indices count back from the end of the +array, and an index of -1 references the last element. +

+ +An array variable is considered set if a subscript has been assigned a +value. The null string is a valid value. +

+ +It is possible to obtain the keys (indices) of an array as well as the values. +${!name[@]} and ${!name[*]} +expand to the indices assigned in array variable name. +The treatment when in double quotes is similar to the expansion of the +special parameters @ and * within double quotes. +

+ +The +unset + +builtin is used to destroy arrays. unset name[subscript] +destroys the array element at index subscript. +Negative subscripts to indexed arrays are interpreted as described above. +Care must be taken to avoid unwanted side effects caused by pathname +expansion. +unset name, where name is an array, or +unset name[subscript], where +subscript is * or @, removes the entire array. +

+ +The +declare, + +local, + +and +readonly + +builtins each accept a +-a + +option to specify an indexed array and a +-A + +option to specify an associative array. +If both options are supplied, +-A + +takes precedence. +The +read + +builtin accepts a +-a + +option to assign a list of words read from the standard input +to an array. The +set + +and +declare + +builtins display array values in a way that allows them to be +reused as assignments. +  +

EXPANSION

+ +Expansion is performed on the command line after it has been split into +words. There are seven kinds of expansion performed: +brace expansion, + +tilde expansion, + +parameter and variable expansion, + +command substitution, + +arithmetic expansion, + +word splitting, + +and +pathname expansion. + +

+ +The order of expansions is: +brace expansion; +tilde expansion, parameter and variable expansion, arithmetic expansion, +and command substitution (done in a left-to-right fashion); +word splitting; +and pathname expansion. +

+ +On systems that can support it, there is an additional expansion +available: process substitution. +This is performed at the +same time as tilde, parameter, variable, and arithmetic expansion and +command substitution. +

+ +Only brace expansion, word splitting, and pathname expansion +can change the number of words of the expansion; other expansions +expand a single word to a single word. +The only exceptions to this are the expansions of +"$@" and "${name[@]}" +as explained above (see +PARAMETERS). + + +  +

Brace Expansion

+ +

+ +Brace expansion + +is a mechanism by which arbitrary strings +may be generated. This mechanism is similar to +pathname expansion, but the filenames generated +need not exist. Patterns to be brace expanded take +the form of an optional +preamble, + +followed by either a series of comma-separated strings or +a sequence expression between a pair of braces, followed by +an optional +postscript. + +The preamble is prefixed to each string contained +within the braces, and the postscript is then appended +to each resulting string, expanding left to right. +

+ +Brace expansions may be nested. The results of each expanded +string are not sorted; left to right order is preserved. +For example, a{d,c,b}e expands into `ade ace abe'. +

+ +A sequence expression takes the form +{x..y[..incr]}, +where x and y are either integers or single characters, +and incr, an optional increment, is an integer. +When integers are supplied, the expression expands to each number between +x and y, inclusive. +Supplied integers may be prefixed with 0 to force each term to have the +same width. +When either x or y begins with a zero, the shell +attempts to force all generated terms to contain the same number of digits, +zero-padding where necessary. +When characters are supplied, the expression expands to each character +lexicographically between x and y, inclusive, +using the default C locale. +Note that both x and y must be of the same type. +When the increment is supplied, it is used as the difference between +each term. The default increment is 1 or -1 as appropriate. +

+ +Brace expansion is performed before any other expansions, +and any characters special to other expansions are preserved +in the result. It is strictly textual. +Bash + +does not apply any syntactic interpretation to the context of the +expansion or the text between the braces. +

+ +A correctly-formed brace expansion must contain unquoted opening +and closing braces, and at least one unquoted comma or a valid +sequence expression. +Any incorrectly formed brace expansion is left unchanged. +A { or , may be quoted with a backslash to prevent its +being considered part of a brace expression. +To avoid conflicts with parameter expansion, the string ${ +is not considered eligible for brace expansion. +

+ +This construct is typically used as shorthand when the common +prefix of the strings to be generated is longer than in the +above example: +

+

+ +mkdir /usr/local/src/bash/{old,new,dist,bugs} +

+ +or +
+chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} +
+ +

+ +Brace expansion introduces a slight incompatibility with +historical versions of +sh. + +sh + +does not treat opening or closing braces specially when they +appear as part of a word, and preserves them in the output. +Bash + +removes braces from words as a consequence of brace +expansion. For example, a word entered to +sh + +as file{1,2} +appears identically in the output. The same word is +output as +file1 file2 + +after expansion by +bash. + +If strict compatibility with +sh + +is desired, start +bash + +with the ++B + +option or disable brace expansion with the ++B + +option to the +set + +command (see +SHELL BUILTIN COMMANDS + + +below). +  +

Tilde Expansion

+ +

+ +If a word begins with an unquoted tilde character (`~'), all of +the characters preceding the first unquoted slash (or all characters, +if there is no unquoted slash) are considered a tilde-prefix. +If none of the characters in the tilde-prefix are quoted, the +characters in the tilde-prefix following the tilde are treated as a +possible login name. +If this login name is the null string, the tilde is replaced with the +value of the shell parameter +HOME. + + +If +HOME + + +is unset, the home directory of the user executing the shell is +substituted instead. +Otherwise, the tilde-prefix is replaced with the home directory +associated with the specified login name. +

+ +If the tilde-prefix is a `~+', the value of the shell variable +PWD + + +replaces the tilde-prefix. +If the tilde-prefix is a `~-', the value of the shell variable +OLDPWD, + + +if it is set, is substituted. +If the characters following the tilde in the tilde-prefix consist +of a number N, optionally prefixed +by a `+' or a `-', the tilde-prefix is replaced with the corresponding +element from the directory stack, as it would be displayed by the +dirs + +builtin invoked with the tilde-prefix as an argument. +If the characters following the tilde in the tilde-prefix consist of a +number without a leading `+' or `-', `+' is assumed. +

+ +If the login name is invalid, or the tilde expansion fails, the word +is unchanged. +

+ +Each variable assignment is checked for unquoted tilde-prefixes immediately +following a +: + +or the first +=. + +In these cases, tilde expansion is also performed. +Consequently, one may use filenames with tildes in assignments to +PATH, + + +MAILPATH, + + +and +CDPATH, + + +and the shell assigns the expanded value. +  +

Parameter Expansion

+ +

+ +The `$' character introduces parameter expansion, +command substitution, or arithmetic expansion. The parameter name +or symbol to be expanded may be enclosed in braces, which +are optional but serve to protect the variable to be expanded from +characters immediately following it which could be +interpreted as part of the name. +

+ +When braces are used, the matching ending brace is the first `}' +not escaped by a backslash or within a quoted string, and not within an +embedded arithmetic expansion, command substitution, or parameter +expansion. +

+ + +

+
${parameter}
+The value of parameter is substituted. The braces are required +when +parameter + +is a positional parameter with more than one digit, +or when +parameter + +is followed by a character which is not to be +interpreted as part of its name. +The parameter is a shell parameter as described above +PARAMETERS) or an array reference (Arrays). + +
+

+ +If the first character of parameter is an exclamation point (!), +it introduces a level of variable indirection. +Bash uses the value of the variable formed from the rest of +parameter as the name of the variable; this variable is then +expanded and that value is used in the rest of the substitution, rather +than the value of parameter itself. +This is known as indirect expansion. +The exceptions to this are the expansions of ${!prefix*} and +${!name[@]} described below. +The exclamation point must immediately follow the left brace in order to +introduce indirection. +

+ +In each of the cases below, word is subject to tilde expansion, +parameter expansion, command substitution, and arithmetic expansion. +

+ +When not performing substring expansion, using the forms documented below +(e.g., :-), +bash tests for a parameter that is unset or null. Omitting the colon +results in a test only for a parameter that is unset. +

+ + +

+
${parameter:-word}
+Use Default Values. If +parameter + +is unset or null, the expansion of +word + +is substituted. Otherwise, the value of +parameter + +is substituted. +
${parameter:=word}
+Assign Default Values. +If +parameter + +is unset or null, the expansion of +word + +is assigned to +parameter. + +The value of +parameter + +is then substituted. Positional parameters and special parameters may +not be assigned to in this way. +
${parameter:?word}
+Display Error if Null or Unset. +If +parameter + +is null or unset, the expansion of word (or a message to that effect +if +word + +is not present) is written to the standard error and the shell, if it +is not interactive, exits. Otherwise, the value of parameter is +substituted. +
${parameter:+word}
+Use Alternate Value. +If +parameter + +is null or unset, nothing is substituted, otherwise the expansion of +word + +is substituted. +
${parameter:offset}
+ +
${parameter:offset:length}
+ +Substring Expansion. +Expands to up to length characters of the value of parameter +starting at the character specified by offset. +If parameter is @, an indexed array subscripted by +@ or *, or an associative array name, the results differ as +described below. +If length is omitted, expands to the substring of the value of +parameter starting at the character specified by offset +and extending to the end of the value. +length and offset are arithmetic expressions (see +ARITHMETIC EVALUATION + + +below). +

+If offset evaluates to a number less than zero, the value +is used as an offset in characters +from the end of the value of parameter. +If length evaluates to a number less than zero, +it is interpreted as an offset in characters +from the end of the value of parameter rather than +a number of characters, and the expansion is the characters between +offset and that result. +Note that a negative offset must be separated from the colon by at least +one space to avoid being confused with the :- expansion. +

+If parameter is @, the result is length positional +parameters beginning at offset. +A negative offset is taken relative to one greater than the greatest +positional parameter, so an offset of -1 evaluates to the last positional +parameter. +It is an expansion error if length evaluates to a number less than +zero. +

+If parameter is an indexed array name subscripted by @ or *, +the result is the length +members of the array beginning with ${parameter[offset]}. +A negative offset is taken relative to one greater than the maximum +index of the specified array. +It is an expansion error if length evaluates to a number less than +zero. +

+Substring expansion applied to an associative array produces undefined +results. +

+Substring indexing is zero-based unless the positional parameters +are used, in which case the indexing starts at 1 by default. +If offset is 0, and the positional parameters are used, $0 is +prefixed to the list. +

${!prefix*}
+ +
${!prefix@}
+ +Names matching prefix. +Expands to the names of variables whose names begin with prefix, +separated by the first character of the +IFS + + +special variable. +When @ is used and the expansion appears within double quotes, each +variable name expands to a separate word. +
${!name[@]}
+ +
${!name[*]}
+ +List of array keys. +If name is an array variable, expands to the list of array indices +(keys) assigned in name. +If name is not an array, expands to 0 if name is set and null +otherwise. +When @ is used and the expansion appears within double quotes, each +key expands to a separate word. +
${#parameter}
+Parameter length. +The length in characters of the value of parameter is substituted. +If +parameter + +is +* + +or +@, + +the value substituted is the number of positional parameters. +If +parameter + +is an array name subscripted by +* + +or +@, + +the value substituted is the number of elements in the array. +If +parameter + +is an indexed array name subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +parameter, so negative indices count back from the end of the +array, and an index of -1 references the last element. +
${parameter#word}
+ +
${parameter##word}
+ +Remove matching prefix pattern. +The +word + +is expanded to produce a pattern just as in pathname +expansion. If the pattern matches the beginning of +the value of +parameter, + +then the result of the expansion is the expanded value of +parameter + +with the shortest matching pattern (the ``#'' case) or the +longest matching pattern (the ``##'' case) deleted. +If +parameter + +is +@ + +or +*, + +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +parameter + +is an array variable subscripted with +@ + +or +*, + +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +
${parameter%word}
+ +
${parameter%%word}
+ +Remove matching suffix pattern. +The word is expanded to produce a pattern just as in +pathname expansion. +If the pattern matches a trailing portion of the expanded value of +parameter, + +then the result of the expansion is the expanded value of +parameter + +with the shortest matching pattern (the ``%'' case) or the +longest matching pattern (the ``%%'' case) deleted. +If +parameter + +is +@ + +or +*, + +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +parameter + +is an array variable subscripted with +@ + +or +*, + +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +
${parameter/pattern/string}
+Pattern substitution. +The pattern is expanded to produce a pattern just as in +pathname expansion. +Parameter is expanded and the longest match of pattern +against its value is replaced with string. +If pattern begins with /, all matches of pattern are +replaced with string. Normally only the first match is replaced. +If pattern begins with #, it must match at the beginning +of the expanded value of parameter. +If pattern begins with %, it must match at the end +of the expanded value of parameter. +If string is null, matches of pattern are deleted +and the / following pattern may be omitted. +If +parameter + +is +@ + +or +*, + +the substitution operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +parameter + +is an array variable subscripted with +@ + +or +*, + +the substitution operation is applied to each member of the +array in turn, and the expansion is the resultant list. +
${parameter^pattern}
+ +
${parameter^^pattern}
+
${parameter,pattern}
+
${parameter,,pattern}
+ +Case modification. +This expansion modifies the case of alphabetic characters in parameter. +The pattern is expanded to produce a pattern just as in +pathname expansion. +Each character in the expanded value of parameter is tested against +pattern, and, if it matches the pattern, its case is converted. +The pattern should not attempt to match more than one character. +The ^ operator converts lowercase letters matching pattern +to uppercase; the , operator converts matching uppercase letters +to lowercase. +The ^^ and ,, expansions convert each matched character in the +expanded value; the ^ and , expansions match and convert only +the first character in the expanded value. +If pattern is omitted, it is treated like a ?, which matches +every character. +If +parameter + +is +@ + +or +*, + +the case modification operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If +parameter + +is an array variable subscripted with +@ + +or +*, + +the case modification operation is applied to each member of the +array in turn, and the expansion is the resultant list. +
+  +

Command Substitution

+ +

+ +Command substitution allows the output of a command to replace +the command name. There are two forms: +

+

+ +$(command) +

+ +or +
+`command` +
+ +

+ +Bash + +performs the expansion by executing command and +replacing the command substitution with the standard output of the +command, with any trailing newlines deleted. +Embedded newlines are not deleted, but they may be removed during +word splitting. +The command substitution $(cat file) can be replaced by +the equivalent but faster $(< file). +

+ +When the old-style backquote form of substitution is used, +backslash retains its literal meaning except when followed by +$, + +`, + +or +\. + +The first backquote not preceded by a backslash terminates the +command substitution. +When using the $(command) form, all characters between the +parentheses make up the command; none are treated specially. +

+ +Command substitutions may be nested. To nest when using the backquoted form, +escape the inner backquotes with backslashes. +

+ +If the substitution appears within double quotes, word splitting and +pathname expansion are not performed on the results. +  +

Arithmetic Expansion

+ +

+ +Arithmetic expansion allows the evaluation of an arithmetic expression +and the substitution of the result. The format for arithmetic expansion is: +

+

+ +$((expression)) +

+ +

+ +The +expression + +is treated as if it were within double quotes, but a double quote +inside the parentheses is not treated specially. +All tokens in the expression undergo parameter and variable expansion, +command substitution, and quote removal. +The result is treated as the arithmetic expression to be evaluated. +Arithmetic expansions may be nested. +

+ +The evaluation is performed according to the rules listed below under +ARITHMETIC EVALUATION. + + +If +expression + +is invalid, +bash + +prints a message indicating failure and no substitution occurs. +  +

Process Substitution

+ +

+ +Process substitution is supported on systems that support named +pipes (FIFOs) or the /dev/fd method of naming open files. +It takes the form of +<(list) +or +>(list). +The process list is run with its input or output connected to a +FIFO or some file in /dev/fd. The name of this file is +passed as an argument to the current command as the result of the +expansion. If the >(list) form is used, writing to +the file will provide input for list. If the +<(list) form is used, the file passed as an +argument should be read to obtain the output of list. +

+ +When available, process substitution is performed +simultaneously with parameter and variable expansion, +command substitution, +and arithmetic expansion. +  +

Word Splitting

+ +

+ +The shell scans the results of +parameter expansion, +command substitution, +and +arithmetic expansion +that did not occur within double quotes for +word splitting. + +

+ +The shell treats each character of +IFS + + +as a delimiter, and splits the results of the other +expansions into words using these characters as field terminators. +If +IFS + + +is unset, or its +value is exactly +<space><tab><newline>, + +the default, then +sequences of +<space>, + +<tab>, + +and +<newline> + +at the beginning and end of the results of the previous +expansions are ignored, and +any sequence of +IFS + + +characters not at the beginning or end serves to delimit words. +If +IFS + + +has a value other than the default, then sequences of +the whitespace characters +space + +and +tab + +are ignored at the beginning and end of the +word, as long as the whitespace character is in the +value of +IFS + + +(an +IFS + + +whitespace character). +Any character in +IFS + + +that is not +IFS + + +whitespace, along with any adjacent +IFS + + +whitespace characters, delimits a field. +A sequence of +IFS + + +whitespace characters is also treated as a delimiter. +If the value of +IFS + + +is null, no word splitting occurs. +

+ +Explicit null arguments ("" or aqaq) are retained. +Unquoted implicit null arguments, resulting from the expansion of +parameters that have no values, are removed. +If a parameter with no value is expanded within double quotes, a +null argument results and is retained. +

+ +Note that if no expansion occurs, no splitting +is performed. +  +

Pathname Expansion

+ +

+ +After word splitting, +unless the +-f + +option has been set, +bash + +scans each word for the characters +*, + +?, + +and +[. + +If one of these characters appears, then the word is +regarded as a +pattern, + +and replaced with an alphabetically sorted list of +filenames matching the pattern +(see +Pattern Matching + + +below). +If no matching filenames are found, +and the shell option +nullglob + +is not enabled, the word is left unchanged. +If the +nullglob + +option is set, and no matches are found, +the word is removed. +If the +failglob + +shell option is set, and no matches are found, an error message +is printed and the command is not executed. +If the shell option +nocaseglob + +is enabled, the match is performed without regard to the case +of alphabetic characters. +When a pattern is used for pathname expansion, +the character +``.'' + +at the start of a name or immediately following a slash +must be matched explicitly, unless the shell option +dotglob + +is set. +When matching a pathname, the slash character must always be +matched explicitly. +In other cases, the +``.'' + +character is not treated specially. +See the description of +shopt + +below under +SHELL BUILTIN COMMANDS + + +for a description of the +nocaseglob, + +nullglob, + +failglob, + +and +dotglob + +shell options. +

+ +The +GLOBIGNORE + + +shell variable may be used to restrict the set of filenames matching a +pattern. + +If +GLOBIGNORE + + +is set, each matching filename that also matches one of the patterns in +GLOBIGNORE + + +is removed from the list of matches. +The filenames +``.'' + +and +``..'' + +are always ignored when +GLOBIGNORE + + +is set and not null. However, setting +GLOBIGNORE + + +to a non-null value has the effect of enabling the +dotglob + +shell option, so all other filenames beginning with a +``.'' + +will match. +To get the old behavior of ignoring filenames beginning with a +``.'', + +make +``.*'' + +one of the patterns in +GLOBIGNORE. + + +The +dotglob + +option is disabled when +GLOBIGNORE + + +is unset. +

+ +Pattern Matching +

+ +Any character that appears in a pattern, other than the special pattern +characters described below, matches itself. The NUL character may not +occur in a pattern. A backslash escapes the following character; the +escaping backslash is discarded when matching. +The special pattern characters must be quoted if +they are to be matched literally. +

+ +The special pattern characters have the following meanings: +

+ + +

+
+
* + +
+Matches any string, including the null string. +When the globstar shell option is enabled, and * is used in +a pathname expansion context, two adjacent *s used as a single +pattern will match all files and zero or more directories and +subdirectories. +If followed by a /, two adjacent *s will match only directories +and subdirectories. +
? + +
+Matches any single character. +
[...] + +
+Matches any one of the enclosed characters. A pair of characters +separated by a hyphen denotes a +range expression; +any character that falls between those two characters, inclusive, +using the current locale's collating sequence and character set, +is matched. If the first character following the +[ + +is a +! + +or a +^ + +then any character not enclosed is matched. +The sorting order of characters in range expressions is determined by +the current locale and the values of the +LC_COLLATE + + +or +LC_ALL + + +shell variables, if set. +To obtain the traditional interpretation of range expressions, where +[a-d] + +is equivalent to +[abcd], + +set value of the +LC_ALL + +shell variable to +C, + +or enable the +globasciiranges + +shell option. +A +- + +may be matched by including it as the first or last character +in the set. +A +] + +may be matched by including it as the first character +in the set. +
+ +

+ + +Within +[ + +and +], + +character classes can be specified using the syntax +[:class:], where class is one of the +following classes defined in the POSIX standard: +

+

+ +

+ + + +alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit +
+ +A character class matches any character belonging to that class. +The word character class matches letters, digits, and the character _. +
+ +

+ + +Within +[ + +and +], + +an equivalence class can be specified using the syntax +[=c=], which matches all characters with the +same collation weight (as defined by the current locale) as +the character c. +
+ +

+ + +Within +[ + +and +], + +the syntax [.symbol.] matches the collating symbol +symbol. +

+ +
+ + +

+ +If the extglob shell option is enabled using the shopt +builtin, several extended pattern matching operators are recognized. +In the following description, a pattern-list is a list of one +or more patterns separated by a |. +Composite patterns may be formed using one or more of the following +sub-patterns: +

+ +

+
+
?(pattern-list)
+Matches zero or one occurrence of the given patterns +
*(pattern-list)
+Matches zero or more occurrences of the given patterns +
+(pattern-list)
+Matches one or more occurrences of the given patterns +
@(pattern-list)
+Matches one of the given patterns +
!(pattern-list)
+Matches anything except one of the given patterns +
+ + +  +

Quote Removal

+ +

+ +After the preceding expansions, all unquoted occurrences of the +characters +\, + +aq, + +and " that did not result from one of the above +expansions are removed. +  +

REDIRECTION

+ +Before a command is executed, its input and output +may be +redirected + +using a special notation interpreted by the shell. +Redirection allows commands' file handles to be +duplicated, opened, closed, +made to refer to different files, +and can change the files the command reads from and writes to. +Redirection may also be used to modify file handles in the +current shell execution environment. +The following redirection +operators may precede or appear anywhere within a +simple command + +or may follow a +command. + +Redirections are processed in the order they appear, from +left to right. +

+ +Each redirection that may be preceded by a file descriptor number +may instead be preceded by a word of the form {varname}. +In this case, for each redirection operator except +>&- and <&-, the shell will allocate a file descriptor greater +than or equal to 10 and assign it to varname. +If >&- or <&- is preceded +by {varname}, the value of varname defines the file +descriptor to close. +

+ +In the following descriptions, if the file descriptor number is +omitted, and the first character of the redirection operator is +<, + +the redirection refers to the standard input (file descriptor +0). If the first character of the redirection operator is +>, + +the redirection refers to the standard output (file descriptor +1). +

+ +The word following the redirection operator in the following +descriptions, unless otherwise noted, is subjected to +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, quote removal, +pathname expansion, and word splitting. +If it expands to more than one word, +bash + +reports an error. +

+ +Note that the order of redirections is significant. For example, +the command +

+

+ +ls > dirlist 2>&1 +

+ +

+ +directs both standard output and standard error to the file +dirlist, + +while the command +

+

+ +ls 2>&1 > dirlist +

+ +

+ +directs only the standard output to file +dirlist, + +because the standard error was duplicated from the standard output +before the standard output was redirected to +dirlist. + +

+ +Bash handles several filenames specially when they are used in +redirections, as described in the following table: +

+

+ + +

+
/dev/fd/fd + +
+If fd is a valid integer, file descriptor fd is duplicated. +
/dev/stdin + +
+File descriptor 0 is duplicated. +
/dev/stdout + +
+File descriptor 1 is duplicated. +
/dev/stderr + +
+File descriptor 2 is duplicated. +
/dev/tcp/host/port + +
+If host is a valid hostname or Internet address, and port +is an integer port number or service name, bash attempts to open +the corresponding TCP socket. +
/dev/udp/host/port + +
+If host is a valid hostname or Internet address, and port +is an integer port number or service name, bash attempts to open +the corresponding UDP socket. + +
+ +

+ +A failure to open or create a file causes the redirection to fail. +

+ +Redirections using file descriptors greater than 9 should be used with +care, as they may conflict with file descriptors the shell uses +internally. +  +

Redirecting Input

+ +

+ +Redirection of input causes the file whose name results from +the expansion of +word + +to be opened for reading on file descriptor +n, + +or the standard input (file descriptor 0) if +n + +is not specified. +

+ +The general format for redirecting input is: +

+

+ +[n]<word +

+ +  +

Redirecting Output

+ +

+ +Redirection of output causes the file whose name results from +the expansion of +word + +to be opened for writing on file descriptor +n, + +or the standard output (file descriptor 1) if +n + +is not specified. If the file does not exist it is created; +if it does exist it is truncated to zero size. +

+ +The general format for redirecting output is: +

+

+ +[n]>word +

+ +

+ +If the redirection operator is +>, + +and the +noclobber + +option to the +set + +builtin has been enabled, the redirection will fail if the file +whose name results from the expansion of word exists and is +a regular file. +If the redirection operator is +>|, + +or the redirection operator is +> + +and the +noclobber + +option to the +set + +builtin command is not enabled, the redirection is attempted even +if the file named by word exists. +  +

Appending Redirected Output

+ +

+ +Redirection of output in this fashion +causes the file whose name results from +the expansion of +word + +to be opened for appending on file descriptor +n, + +or the standard output (file descriptor 1) if +n + +is not specified. If the file does not exist it is created. +

+ +The general format for appending output is: +

+

+ +[n]>>word +

+ +

+ +  +

Redirecting Standard Output and Standard Error

+ +

+ +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be redirected to the file whose name is the +expansion of +word. + +

+ +There are two formats for redirecting standard output and +standard error: +

+

+ +&>word +

+ +and +
+>&word +
+ +

+ +Of the two forms, the first is preferred. +This is semantically equivalent to +

+

+ +>word 2>&1 +

+ +

+ +When using the second form, word may not expand to a number or +-. If it does, other redirection operators apply +(see Duplicating File Descriptors below) for compatibility +reasons. +  +

Appending Standard Output and Standard Error

+ +

+ +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be appended to the file whose name is the +expansion of +word. + +

+ +The format for appending standard output and standard error is: +

+

+ +&>>word +

+ +

+ +This is semantically equivalent to +

+

+ +>>word 2>&1 +

+ +

+ +(see Duplicating File Descriptors below). +  +

Here Documents

+ +

+ +This type of redirection instructs the shell to read input from the +current source until a line containing only +delimiter + +(with no trailing blanks) +is seen. All of +the lines read up to that point are then used as the standard +input for a command. +

+ +The format of here-documents is: +

+

+ +

+<<[-]word
+        here-document
+delimiter
+
+ +
+ +

+ +No parameter and variable expansion, command substitution, +arithmetic expansion, or pathname expansion is performed on +word. + +If any characters in +word + +are quoted, the +delimiter + +is the result of quote removal on +word, + +and the lines in the here-document are not expanded. +If word is unquoted, +all lines of the here-document are subjected to +parameter expansion, command substitution, and arithmetic expansion, +the character sequence +\<newline> + +is ignored, and +\ + +must be used to quote the characters +\, + +$, + +and +`. + +

+ +If the redirection operator is +<<-, + +then all leading tab characters are stripped from input lines and the +line containing +delimiter. + +This allows +here-documents within shell scripts to be indented in a +natural fashion. +  +

Here Strings

+ +A variant of here documents, the format is: +
+

+ +

+<<<word
+
+ +
+ +

+ +The word undergoes +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote removal. +Pathname expansion and word splitting are not performed. +The result is supplied as a single string to the command on its +standard input. +  +

Duplicating File Descriptors

+ +

+ +The redirection operator +

+

+ +[n]<&word +

+ +

+ +is used to duplicate input file descriptors. +If +word + +expands to one or more digits, the file descriptor denoted by +n + +is made to be a copy of that file descriptor. +If the digits in +word + +do not specify a file descriptor open for input, a redirection error occurs. +If +word + +evaluates to +-, + +file descriptor +n + +is closed. If +n + +is not specified, the standard input (file descriptor 0) is used. +

+ +The operator +

+

+ +[n]>&word +

+ +

+ +is used similarly to duplicate output file descriptors. If +n + +is not specified, the standard output (file descriptor 1) is used. +If the digits in +word + +do not specify a file descriptor open for output, a redirection error occurs. +If +word + +evaluates to +-, + +file descriptor +n + +is closed. +As a special case, if n is omitted, and word does not +expand to one or more digits or -, the standard output and standard +error are redirected as described previously. +  +

Moving File Descriptors

+ +

+ +The redirection operator +

+

+ +[n]<&digit- +

+ +

+ +moves the file descriptor digit to file descriptor +n, + +or the standard input (file descriptor 0) if n is not specified. +digit is closed after being duplicated to n. +

+ +Similarly, the redirection operator +

+

+ +[n]>&digit- +

+ +

+ +moves the file descriptor digit to file descriptor +n, + +or the standard output (file descriptor 1) if n is not specified. +  +

Opening File Descriptors for Reading and Writing

+ +

+ +The redirection operator +

+

+ +[n]<>word +

+ +

+ +causes the file whose name is the expansion of +word + +to be opened for both reading and writing on file descriptor +n, + +or on file descriptor 0 if +n + +is not specified. If the file does not exist, it is created. +  +

ALIASES

+ +Aliases allow a string to be substituted for a word when it is used +as the first word of a simple command. +The shell maintains a list of aliases that may be set and unset with the +alias + +and +unalias + +builtin commands (see +SHELL BUILTIN COMMANDS + + +below). +The first word of each simple command, if unquoted, +is checked to see if it has an +alias. If so, that word is replaced by the text of the alias. +The characters /, $, `, and = and +any of the shell metacharacters or quoting characters +listed above may not appear in an alias name. +The replacement text may contain any valid shell input, +including shell metacharacters. +The first word of the replacement text is tested +for aliases, but a word that is identical to an alias being expanded +is not expanded a second time. +This means that one may alias +ls + +to +ls -F, + +for instance, and +bash + +does not try to recursively expand the replacement text. +If the last character of the alias value is a +blank, + +then the next command +word following the alias is also checked for alias expansion. +

+ +Aliases are created and listed with the +alias + +command, and removed with the +unalias + +command. +

+ +There is no mechanism for using arguments in the replacement text. +If arguments are needed, a shell function should be used (see +FUNCTIONS + + +below). +

+ +Aliases are not expanded when the shell is not interactive, unless +the +expand_aliases + +shell option is set using +shopt + +(see the description of +shopt + +under +SHELL BUILTIN COMMANDS +below). +

+ +The rules concerning the definition and use of aliases are +somewhat confusing. +Bash + +always reads at least one complete line +of input before executing any +of the commands on that line. Aliases are expanded when a +command is read, not when it is executed. Therefore, an +alias definition appearing on the same line as another +command does not take effect until the next line of input is read. +The commands following the alias definition +on that line are not affected by the new alias. +This behavior is also an issue when functions are executed. +Aliases are expanded when a function definition is read, +not when the function is executed, because a function definition +is itself a compound command. As a consequence, aliases +defined in a function are not available until after that +function is executed. To be safe, always put +alias definitions on a separate line, and do not use +alias + +in compound commands. +

+ +For almost every purpose, aliases are superseded by +shell functions. +  +

FUNCTIONS

+ +A shell function, defined as described above under +SHELL GRAMMAR, + + +stores a series of commands for later execution. +When the name of a shell function is used as a simple command name, +the list of commands associated with that function name is executed. +Functions are executed in the context of the +current shell; no new process is created to interpret +them (contrast this with the execution of a shell script). +When a function is executed, the arguments to the +function become the positional parameters +during its execution. +The special parameter +# + +is updated to reflect the change. Special parameter 0 +is unchanged. +The first element of the +FUNCNAME + + +variable is set to the name of the function while the function +is executing. +

+ +All other aspects of the shell execution +environment are identical between a function and its caller +with these exceptions: the +DEBUG + + +and +RETURN + +traps (see the description of the +trap + +builtin under +SHELL BUILTIN COMMANDS + + +below) are not inherited unless the function has been given the +trace attribute (see the description of the +declare + + +builtin below) or the +-o functrace shell option has been enabled with +the set builtin +(in which case all functions inherit the DEBUG and RETURN traps), +and the +ERR + + +trap is not inherited unless the -o errtrace shell option has +been enabled. +

+ +Variables local to the function may be declared with the +local + +builtin command. Ordinarily, variables and their values +are shared between the function and its caller. +

+ +The FUNCNEST variable, if set to a numeric value greater +than 0, defines a maximum function nesting level. Function +invocations that exceed the limit cause the entire command to +abort. +

+ +If the builtin command +return + +is executed in a function, the function completes and +execution resumes with the next command after the function +call. +Any command associated with the RETURN trap is executed +before execution resumes. +When a function completes, the values of the +positional parameters and the special parameter +# + +are restored to the values they had prior to the function's +execution. +

+ +Function names and definitions may be listed with the +-f + +option to the +declare + +or +typeset + +builtin commands. The +-F + +option to +declare + +or +typeset + +will list the function names only +(and optionally the source file and line number, if the extdebug +shell option is enabled). +Functions may be exported so that subshells +automatically have them defined with the +-f + +option to the +export + +builtin. +A function definition may be deleted using the -f option to +the +unset + +builtin. +Note that shell functions and variables with the same name may result +in multiple identically-named entries in the environment passed to the +shell's children. +Care should be taken in cases where this may cause a problem. +

+ +Functions may be recursive. +The FUNCNEST variable may be used to limit the depth of the +function call stack and restrict the number of function invocations. +By default, no limit is imposed on the number of recursive calls. +  +

ARITHMETIC EVALUATION

+ +The shell allows arithmetic expressions to be evaluated, under +certain circumstances (see the let and declare builtin +commands and Arithmetic Expansion). +Evaluation is done in fixed-width integers with no check for overflow, +though division by 0 is trapped and flagged as an error. +The operators and their precedence, associativity, and values +are the same as in the C language. +The following list of operators is grouped into levels of +equal-precedence operators. +The levels are listed in order of decreasing precedence. +

+ + +

+
id++ id-- + +
+variable post-increment and post-decrement +
++id --id + +
+variable pre-increment and pre-decrement +
- + + +
+unary minus and plus +
! ~ + +
+logical and bitwise negation +
** + +
+exponentiation +
* / % + +
+multiplication, division, remainder +
+ - + +
+addition, subtraction +
<< >> + +
+left and right bitwise shifts +
<= >= < > + +
+comparison +
== != + +
+equality and inequality +
& + +
+bitwise AND +
^ + +
+bitwise exclusive OR +
| + +
+bitwise OR +
&& + +
+logical AND +
|| + +
+logical OR +
expr?expr:expr + +
+conditional operator +
= *= /= %= += -= <<= >>= &= ^= |= + +
+assignment +
expr1 , expr2 + +
+comma + +
+

+ +Shell variables are allowed as operands; parameter expansion is +performed before the expression is evaluated. +Within an expression, shell variables may also be referenced by name +without using the parameter expansion syntax. +A shell variable that is null or unset evaluates to 0 when referenced +by name without using the parameter expansion syntax. +The value of a variable is evaluated as an arithmetic expression +when it is referenced, or when a variable which has been given the +integer attribute using declare -i is assigned a value. +A null value evaluates to 0. +A shell variable need not have its integer attribute +turned on to be used in an expression. +

+ +Constants with a leading 0 are interpreted as octal numbers. +A leading 0x or 0X denotes hexadecimal. +Otherwise, numbers take the form [base#]n, where the optional base +is a decimal number between 2 and 64 representing the arithmetic +base, and n is a number in that base. +If base# is omitted, then base 10 is used. +When specifying n, +the digits greater< than 9 are represented by the lowercase letters, +the uppercase letters, @, and _, in that order. +If base is less than or equal to 36, lowercase and uppercase +letters may be used interchangeably to represent numbers between 10 +and 35. +

+ +Operators are evaluated in order of precedence. Sub-expressions in +parentheses are evaluated first and may override the precedence +rules above. +  +

CONDITIONAL EXPRESSIONS

+ +Conditional expressions are used by the [[ compound command and +the test and [ builtin commands to test file attributes +and perform string and arithmetic comparisons. +Expressions are formed from the following unary or binary primaries. +If any file argument to one of the primaries is of the form +/dev/fd/n, then file descriptor n is checked. +If the file argument to one of the primaries is one of +/dev/stdin, /dev/stdout, or /dev/stderr, file +descriptor 0, 1, or 2, respectively, is checked. +

+ +Unless otherwise specified, primaries that operate on files follow symbolic +links and operate on the target of the link, rather than the link itself. +

+ + +When used with [[, the < and > operators sort +lexicographically using the current locale. +The test command sorts using ASCII ordering. +

+ +

+
-a file + +
+True if file exists. +
-b file + +
+True if file exists and is a block special file. +
-c file + +
+True if file exists and is a character special file. +
-d file + +
+True if file exists and is a directory. +
-e file + +
+True if file exists. +
-f file + +
+True if file exists and is a regular file. +
-g file + +
+True if file exists and is set-group-id. +
-h file + +
+True if file exists and is a symbolic link. +
-k file + +
+True if file exists and its ``sticky'' bit is set. +
-p file + +
+True if file exists and is a named pipe (FIFO). +
-r file + +
+True if file exists and is readable. +
-s file + +
+True if file exists and has a size greater than zero. +
-t fd + +
+True if file descriptor +fd + +is open and refers to a terminal. +
-u file + +
+True if file exists and its set-user-id bit is set. +
-w file + +
+True if file exists and is writable. +
-x file + +
+True if file exists and is executable. +
-G file + +
+True if file exists and is owned by the effective group id. +
-L file + +
+True if file exists and is a symbolic link. +
-N file + +
+True if file exists and has been modified since it was last read. +
-O file + +
+True if file exists and is owned by the effective user id. +
-S file + +
+True if file exists and is a socket. +
file1 -ef file2
+True if file1 and file2 refer to the same device and +inode numbers. +
file1 -nt file2
+True if file1 is newer (according to modification date) than file2, +or if file1 exists and file2 does not. +
file1 -ot file2
+True if file1 is older than file2, or if file2 exists +and file1 does not. +
-o optname + +
+True if the shell option +optname + +is enabled. +See the list of options under the description of the +-o + +option to the +set + +builtin below. +
-v varname + +
+True if the shell variable +varname + +is set (has been assigned a value). +
-R varname + +
+True if the shell variable +varname + +is set and is a name reference. +
-z string + +
+True if the length of string is zero. +
string
+ +
-n string + +
+ +True if the length of +string + +is non-zero. +
string1 == string2
+ +
string1 = string2
+ +True if the strings are equal. = should be used +with the test command for POSIX conformance. +When used with the [[ command, this performs pattern matching as +described above (Compound Commands). +
string1 != string2
+True if the strings are not equal. +
string1 < string2
+True if string1 sorts before string2 lexicographically. +
string1 > string2
+True if string1 sorts after string2 lexicographically. +
arg1 OP arg2 + +
+OP + + +is one of +-eq, + +-ne, + +-lt, + +-le, + +-gt, + +or +-ge. + +These arithmetic binary operators return true if arg1 +is equal to, not equal to, less than, less than or equal to, +greater than, or greater than or equal to arg2, respectively. +Arg1 + +and +arg2 + +may be positive or negative integers. + +
+  +

SIMPLE COMMAND EXPANSION

+ +When a simple command is executed, the shell performs the following +expansions, assignments, and redirections, from left to right. +
+
1.
+The words that the parser has marked as variable assignments (those +preceding the command name) and redirections are saved for later +processing. +
2.
+The words that are not variable assignments or redirections are +expanded. If any words remain after expansion, the first word +is taken to be the name of the command and the remaining words are +the arguments. +
3.
+Redirections are performed as described above under +REDIRECTION. + + +
4.
+The text after the = in each variable assignment undergoes tilde +expansion, parameter expansion, command substitution, arithmetic expansion, +and quote removal before being assigned to the variable. +
+

+ +If no command name results, the variable assignments affect the current +shell environment. Otherwise, the variables are added to the environment +of the executed command and do not affect the current shell environment. +If any of the assignments attempts to assign a value to a readonly variable, +an error occurs, and the command exits with a non-zero status. +

+ +If no command name results, redirections are performed, but do not +affect the current shell environment. A redirection error causes the +command to exit with a non-zero status. +

+ +If there is a command name left after expansion, execution proceeds as +described below. Otherwise, the command exits. If one of the expansions +contained a command substitution, the exit status of the command is +the exit status of the last command substitution performed. If there +were no command substitutions, the command exits with a status of zero. +  +

COMMAND EXECUTION

+ +After a command has been split into words, if it results in a +simple command and an optional list of arguments, the following +actions are taken. +

+ +If the command name contains no slashes, the shell attempts to +locate it. If there exists a shell function by that name, that +function is invoked as described above in +FUNCTIONS. + + +If the name does not match a function, the shell searches for +it in the list of shell builtins. If a match is found, that +builtin is invoked. +

+ +If the name is neither a shell function nor a builtin, +and contains no slashes, +bash + +searches each element of the +PATH + + +for a directory containing an executable file by that name. +Bash + +uses a hash table to remember the full pathnames of executable +files (see +hash + +under +SHELL BUILTIN COMMANDS + + +below). +A full search of the directories in +PATH + + +is performed only if the command is not found in the hash table. +If the search is unsuccessful, the shell searches for a defined shell +function named command_not_found_handle. +If that function exists, it is invoked with the original command and +the original command's arguments as its arguments, and the function's +exit status becomes the exit status of the shell. +If that function is not defined, the shell prints an error +message and returns an exit status of 127. +

+ +If the search is successful, or if the command name contains +one or more slashes, the shell executes the named program in a +separate execution environment. +Argument 0 is set to the name given, and the remaining arguments +to the command are set to the arguments given, if any. +

+ +If this execution fails because the file is not in executable +format, and the file is not a directory, it is assumed to be +a shell script, a file +containing shell commands. A subshell is spawned to execute +it. This subshell reinitializes itself, so +that the effect is as if a new shell had been invoked +to handle the script, with the exception that the locations of +commands remembered by the parent (see +hash + +below under +SHELL BUILTIN COMMANDS) +are retained by the child. +

+ +If the program is a file beginning with +#!, + +the remainder of the first line specifies an interpreter +for the program. The shell executes the +specified interpreter on operating systems that do not +handle this executable format themselves. The arguments to the +interpreter consist of a single optional argument following the +interpreter name on the first line of the program, followed +by the name of the program, followed by the command +arguments, if any. +  +

COMMAND EXECUTION ENVIRONMENT

+ +The shell has an execution environment, which consists of the +following: +
+
*
+open files inherited by the shell at invocation, as modified by +redirections supplied to the exec builtin +
*
+the current working directory as set by cd, pushd, or +popd, or inherited by the shell at invocation +
*
+the file creation mode mask as set by umask or inherited from +the shell's parent +
*
+current traps set by trap +
*
+shell parameters that are set by variable assignment or with set +or inherited from the shell's parent in the environment +
*
+shell functions defined during execution or inherited from the shell's +parent in the environment +
*
+options enabled at invocation (either by default or with command-line +arguments) or by set +
*
+options enabled by shopt +
*
+shell aliases defined with alias +
*
+various process IDs, including those of background jobs, the value +of $$, and the value of +PPID + + +
+

+ +When a simple command other than a builtin or shell function +is to be executed, it +is invoked in a separate execution environment that consists of +the following. Unless otherwise noted, the values are inherited +from the shell. + +

+
*
+the shell's open files, plus any modifications and additions specified +by redirections to the command +
*
+the current working directory +
*
+the file creation mode mask +
*
+shell variables and functions marked for export, along with variables +exported for the command, passed in the environment +
*
+traps caught by the shell are reset to the values inherited from the +shell's parent, and traps ignored by the shell are ignored +
+

+ +A command invoked in this separate environment cannot affect the +shell's execution environment. +

+ +Command substitution, commands grouped with parentheses, +and asynchronous commands are invoked in a +subshell environment that is a duplicate of the shell environment, +except that traps caught by the shell are reset to the values +that the shell inherited from its parent at invocation. Builtin +commands that are invoked as part of a pipeline are also executed in a +subshell environment. Changes made to the subshell environment +cannot affect the shell's execution environment. +

+ +Subshells spawned to execute command substitutions inherit the value of +the -e option from the parent shell. When not in posix mode, +bash clears the -e option in such subshells. +

+ +If a command is followed by a & and job control is not active, the +default standard input for the command is the empty file /dev/null. +Otherwise, the invoked command inherits the file descriptors of the calling +shell as modified by redirections. +  +

ENVIRONMENT

+ +When a program is invoked it is given an array of strings +called the +environment. + +This is a list of +name-value pairs, of the form +name=value. + +

+ +The shell provides several ways to manipulate the environment. +On invocation, the shell scans its own environment and +creates a parameter for each name found, automatically marking +it for +export + +to child processes. Executed commands inherit the environment. +The +export + +and +declare -x + +commands allow parameters and functions to be added to and +deleted from the environment. If the value of a parameter +in the environment is modified, the new value becomes part +of the environment, replacing the old. The environment +inherited by any executed command consists of the shell's +initial environment, whose values may be modified in the shell, +less any pairs removed by the +unset + +command, plus any additions via the +export + +and +declare -x + +commands. +

+ +The environment for any +simple command + +or function may be augmented temporarily by prefixing it with +parameter assignments, as described above in +PARAMETERS. + + +These assignment statements affect only the environment seen +by that command. +

+ +If the +-k + +option is set (see the +set + +builtin command below), then +all + +parameter assignments are placed in the environment for a command, +not just those that precede the command name. +

+ +When +bash + +invokes an external command, the variable +_ + +is set to the full filename of the command and passed to that +command in its environment. +  +

EXIT STATUS

+ +

+ +The exit status of an executed command is the value returned by the +waitpid system call or equivalent function. Exit statuses +fall between 0 and 255, though, as explained below, the shell may +use values above 125 specially. Exit statuses from shell builtins and +compound commands are also limited to this range. Under certain +circumstances, the shell will use special values to indicate specific +failure modes. +

+ +For the shell's purposes, a command which exits with a +zero exit status has succeeded. An exit status of zero +indicates success. A non-zero exit status indicates failure. +When a command terminates on a fatal signal N, bash uses +the value of 128+N as the exit status. +

+ +If a command is not found, the child process created to +execute it returns a status of 127. If a command is found +but is not executable, the return status is 126. +

+ +If a command fails because of an error during expansion or redirection, +the exit status is greater than zero. +

+ +Shell builtin commands return a status of 0 (true) if +successful, and non-zero (false) if an error occurs +while they execute. +All builtins return an exit status of 2 to indicate incorrect usage. +

+ +Bash itself returns the exit status of the last command +executed, unless a syntax error occurs, in which case it exits +with a non-zero value. See also the exit builtin +command below. +  +

SIGNALS

+ +When bash is interactive, in the absence of any traps, it ignores +SIGTERM + + +(so that kill 0 does not kill an interactive shell), +and +SIGINT + + +is caught and handled (so that the wait builtin is interruptible). +In all cases, bash ignores +SIGQUIT. + + +If job control is in effect, +bash + +ignores +SIGTTIN, + + +SIGTTOU, + + +and +SIGTSTP. + + +

+ +Non-builtin commands run by bash have signal handlers +set to the values inherited by the shell from its parent. +When job control is not in effect, asynchronous commands +ignore +SIGINT + + +and +SIGQUIT + + +in addition to these inherited handlers. +Commands run as a result of command substitution ignore the +keyboard-generated job control signals +SIGTTIN, + + +SIGTTOU, + + +and +SIGTSTP. + + +

+ +The shell exits by default upon receipt of a +SIGHUP. + + +Before exiting, an interactive shell resends the +SIGHUP + + +to all jobs, running or stopped. +Stopped jobs are sent +SIGCONT + + +to ensure that they receive the +SIGHUP. + + +To prevent the shell from +sending the signal to a particular job, it should be removed from the +jobs table with the +disown + +builtin (see +SHELL BUILTIN COMMANDS + + +below) or marked +to not receive +SIGHUP + + +using +disown -h. + +

+ +If the +huponexit + +shell option has been set with +shopt, + +bash + +sends a +SIGHUP + + +to all jobs when an interactive login shell exits. +

+ +If bash is waiting for a command to complete and receives a signal +for which a trap has been set, the trap will not be executed until +the command completes. +When bash is waiting for an asynchronous command via the wait +builtin, the reception of a signal for which a trap has been set will +cause the wait builtin to return immediately with an exit status +greater than 128, immediately after which the trap is executed. +  +

JOB CONTROL

+ +Job control + +refers to the ability to selectively stop (suspend) +the execution of processes and continue (resume) +their execution at a later point. A user typically employs +this facility via an interactive interface supplied jointly +by the operating system kernel's terminal driver and +bash. + +

+ +The shell associates a +job + +with each pipeline. It keeps a table of currently executing +jobs, which may be listed with the +jobs + +command. When +bash + +starts a job asynchronously (in the +background), + +it prints a line that looks like: +

+

+ +[1] 25647 +

+ +

+ +indicating that this job is job number 1 and that the process ID +of the last process in the pipeline associated with this job is 25647. +All of the processes in a single pipeline are members of the same job. +Bash + +uses the +job + +abstraction as the basis for job control. +

+ +To facilitate the implementation of the user interface to job +control, the operating system maintains the notion of a current terminal +process group ID. Members of this process group (processes whose +process group ID is equal to the current terminal process group ID) +receive keyboard-generated signals such as +SIGINT. + + +These processes are said to be in the +foreground. + +Background + +processes are those whose process group ID differs from the terminal's; +such processes are immune to keyboard-generated signals. +Only foreground processes are allowed to read from or, if the +user so specifies with stty tostop, write to the +terminal. +Background processes which attempt to read from (write to when +stty tostop is in effect) the +terminal are sent a +SIGTTIN (SIGTTOU) + + +signal by the kernel's terminal driver, +which, unless caught, suspends the process. +

+ +If the operating system on which +bash + +is running supports +job control, +bash + +contains facilities to use it. +Typing the +suspend + +character (typically +^Z, + +Control-Z) while a process is running +causes that process to be stopped and returns control to +bash. + +Typing the +delayed suspend + +character (typically +^Y, + +Control-Y) causes the process to be stopped when it +attempts to read input from the terminal, and control to +be returned to +bash. + +The user may then manipulate the state of this job, using the +bg + +command to continue it in the background, the +fg + +command to continue it in the foreground, or +the +kill + +command to kill it. A ^Z takes effect immediately, +and has the additional side effect of causing pending output +and typeahead to be discarded. +

+ +There are a number of ways to refer to a job in the shell. +The character +% + +introduces a job specification (jobspec). Job number +n + +may be referred to as +%n. + +A job may also be referred to using a prefix of the name used to +start it, or using a substring that appears in its command line. +For example, +%ce + +refers to a stopped +ce + +job. If a prefix matches more than one job, +bash + +reports an error. Using +%?ce, + +on the other hand, refers to any job containing the string +ce + +in its command line. If the substring matches more than one job, +bash + +reports an error. The symbols +%% + +and +%+ + +refer to the shell's notion of the +current job, + +which is the last job stopped while it was in +the foreground or started in the background. +The +previous job + +may be referenced using +%-. + +If there is only a single job, %+ and %- can both be used +to refer to that job. +In output pertaining to jobs (e.g., the output of the +jobs + +command), the current job is always flagged with a ++, + +and the previous job with a +-. + +A single % (with no accompanying job specification) also refers to the +current job. +

+ +Simply naming a job can be used to bring it into the +foreground: +%1 + +is a synonym for +``fg %1'', +bringing job 1 from the background into the foreground. +Similarly, +``%1 &'' + +resumes job 1 in the background, equivalent to +``bg %1''. +

+ +The shell learns immediately whenever a job changes state. +Normally, +bash + +waits until it is about to print a prompt before reporting +changes in a job's status so as to not interrupt +any other output. If the +-b + +option to the +set + +builtin command +is enabled, +bash + +reports such changes immediately. +Any trap on +SIGCHLD + + +is executed for each child that exits. +

+ +If an attempt to exit +bash + +is made while jobs are stopped (or, if the checkjobs shell option has +been enabled using the shopt builtin, running), the shell prints a +warning message, and, if the checkjobs option is enabled, lists the +jobs and their statuses. +The +jobs + +command may then be used to inspect their status. +If a second attempt to exit is made without an intervening command, +the shell does not print another warning, and any stopped +jobs are terminated. +  +

PROMPTING

+ +When executing interactively, +bash + +displays the primary prompt +PS1 + + +when it is ready to read a command, and the secondary prompt +PS2 + + +when it needs more input to complete a command. +Bash + +allows these prompt strings to be customized by inserting a number of +backslash-escaped special characters that are decoded as follows: +
+ +
+
\a + +
+an ASCII bell character (07) +
\d + +
+the date in "Weekday Month Date" format (e.g., "Tue May 26") +
\D{format} + +
+the format is passed to strftime(3) and the result is inserted +into the prompt string; an empty format results in a locale-specific +time representation. The braces are required +
\e + +
+an ASCII escape character (033) +
\h + +
+the hostname up to the first `.' +
\H + +
+the hostname +
\j + +
+the number of jobs currently managed by the shell +
\l + +
+the basename of the shell's terminal device name +
\n + +
+newline +
\r + +
+carriage return +
\s + +
+the name of the shell, the basename of +$0 + +(the portion following the final slash) +
\t + +
+the current time in 24-hour HH:MM:SS format +
\T + +
+the current time in 12-hour HH:MM:SS format +
\@ + +
+the current time in 12-hour am/pm format +
\A + +
+the current time in 24-hour HH:MM format +
\u + +
+the username of the current user +
\v + +
+the version of bash (e.g., 2.00) +
\V + +
+the release of bash, version + patch level (e.g., 2.00.0) +
\w + +
+the current working directory, with +$HOME + + +abbreviated with a tilde +(uses the value of the +PROMPT_DIRTRIM + + +variable) +
\W + +
+the basename of the current working directory, with +$HOME + + +abbreviated with a tilde +
\! + +
+the history number of this command +
\# + +
+the command number of this command +
\$ + +
+if the effective UID is 0, a +#, + +otherwise a +$ + +
\nnn + +
+the character corresponding to the octal number nnn +
\\ + +
+a backslash +
\[ + +
+begin a sequence of non-printing characters, which could be used to +embed a terminal control sequence into the prompt +
\] + +
+end a sequence of non-printing characters + +
+ +

+ +The command number and the history number are usually different: +the history number of a command is its position in the history +list, which may include commands restored from the history file +(see +HISTORY + + +below), while the command number is the position in the sequence +of commands executed during the current shell session. +After the string is decoded, it is expanded via +parameter expansion, command substitution, arithmetic +expansion, and quote removal, subject to the value of the +promptvars + +shell option (see the description of the +shopt + +command under +SHELL BUILTIN COMMANDS + + +below). +  +

READLINE

+ +This is the library that handles reading input when using an interactive +shell, unless the +--noediting + +option is given at shell invocation. +Line editing is also used when using the -e option to the +read builtin. +By default, the line editing commands are similar to those of Emacs. +A vi-style line editing interface is also available. +Line editing can be enabled at any time using the +-o emacs + +or +-o vi + +options to the +set + +builtin (see +SHELL BUILTIN COMMANDS + + +below). +To turn off line editing after the shell is running, use the ++o emacs + +or ++o vi + +options to the +set + +builtin. +  +

Readline Notation

+ +

+ +In this section, the Emacs-style notation is used to denote +keystrokes. Control keys are denoted by C-key, e.g., C-n +means Control-N. Similarly, +meta + +keys are denoted by M-key, so M-x means Meta-X. (On keyboards +without a +meta + +key, M-x means ESC x, i.e., press the Escape key +then the +x + +key. This makes ESC the meta prefix. +The combination M-C-x means ESC-Control-x, +or press the Escape key +then hold the Control key while pressing the +x + +key.) +

+ +Readline commands may be given numeric +arguments, + +which normally act as a repeat count. +Sometimes, however, it is the sign of the argument that is significant. +Passing a negative argument to a command that acts in the forward +direction (e.g., kill-line) causes that command to act in a +backward direction. +Commands whose behavior with arguments deviates from this are noted +below. +

+ +When a command is described as killing text, the text +deleted is saved for possible future retrieval +(yanking). The killed text is saved in a +kill ring. Consecutive kills cause the text to be +accumulated into one unit, which can be yanked all at once. +Commands which do not kill text separate the chunks of text +on the kill ring. +  +

Readline Initialization

+ +

+ +Readline is customized by putting commands in an initialization +file (the inputrc file). +The name of this file is taken from the value of the +INPUTRC + + +variable. If that variable is unset, the default is +~/.inputrc. + +When a program which uses the readline library starts up, the +initialization file is read, and the key bindings and variables +are set. +There are only a few basic constructs allowed in the +readline initialization file. +Blank lines are ignored. +Lines beginning with a # are comments. +Lines beginning with a $ indicate conditional constructs. +Other lines denote key bindings and variable settings. +

+ +The default key-bindings may be changed with an +inputrc + +file. +Other programs that use this library may add their own commands +and bindings. +

+ +For example, placing +

+

+ +M-Control-u: universal-argument +

+ +or +
+C-Meta-u: universal-argument +
+ +into the +inputrc + +would make M-C-u execute the readline command +universal-argument. + +

+ +The following symbolic character names are recognized: +RUBOUT, + +DEL, + +ESC, + +LFD, + +NEWLINE, + +RET, + +RETURN, + +SPC, + +SPACE, + +and +TAB. + +

+ +In addition to command names, readline allows keys to be bound +to a string that is inserted when the key is pressed (a macro). +  +

Readline Key Bindings

+ +

+ +The syntax for controlling key bindings in the +inputrc + +file is simple. All that is required is the name of the +command or the text of a macro and a key sequence to which +it should be bound. The name may be specified in one of two ways: +as a symbolic key name, possibly with Meta- or Control- +prefixes, or as a key sequence. +

+ +When using the form keyname:function-name or macro, +keyname + +is the name of a key spelled out in English. For example: +

+

+Control-u: universal-argument +
+ +Meta-Rubout: backward-kill-word +
+ +Control-o: "> output" +
+ +

+ +In the above example, +C-u + +is bound to the function +universal-argument, + +M-DEL + +is bound to the function +backward-kill-word, + +and +C-o + +is bound to run the macro +expressed on the right hand side (that is, to insert the text +> output + +into the line). +

+ +In the second form, "keyseq":function-name or macro, +keyseq + +differs from +keyname + +above in that strings denoting +an entire key sequence may be specified by placing the sequence +within double quotes. Some GNU Emacs style key escapes can be +used, as in the following example, but the symbolic character names +are not recognized. +

+

+"\C-u": universal-argument +
+ +"\C-x\C-r": re-read-init-file +
+ +"\e[11~": "Function Key 1" +
+ +

+ +In this example, +C-u + +is again bound to the function +universal-argument. + +C-x C-r + +is bound to the function +re-read-init-file, + +and +ESC [ 1 1 ~ + +is bound to insert the text +Function Key 1. + +

+ +The full set of GNU Emacs style escape sequences is +

+ +
+
\C- + +
+control prefix +
\M- + +
+meta prefix +
\e + +
+an escape character +
\\ + +
+backslash +
\ + +
+literal " +
\aq + +
+literal aq +
+ + +

+ +In addition to the GNU Emacs style escape sequences, a second +set of backslash escapes is available: +

+ +
+
\a + +
+alert (bell) +
\b + +
+backspace +
\d + +
+delete +
\f + +
+form feed +
\n + +
+newline +
\r + +
+carriage return +
\t + +
+horizontal tab +
\v + +
+vertical tab +
\nnn + +
+the eight-bit character whose value is the octal value nnn +(one to three digits) +
\xHH + +
+the eight-bit character whose value is the hexadecimal value HH +(one or two hex digits) +
+ + +

+ +When entering the text of a macro, single or double quotes must +be used to indicate a macro definition. +Unquoted text is assumed to be a function name. +In the macro body, the backslash escapes described above are expanded. +Backslash will quote any other character in the macro text, +including " and aq. +

+ +Bash + +allows the current readline key bindings to be displayed or modified +with the +bind + +builtin command. The editing mode may be switched during interactive +use by using the +-o + +option to the +set + +builtin command (see +SHELL BUILTIN COMMANDS + + +below). +  +

Readline Variables

+ +

+ +Readline has variables that can be used to further customize its +behavior. A variable may be set in the +inputrc + +file with a statement of the form +

+

+ +set variable-name value +

+ +

+ +Except where noted, readline variables can take the values +On + +or +Off + +(without regard to case). +Unrecognized variable names are ignored. +When a variable value is read, empty or null values, "on" (case-insensitive), +and "1" are equivalent to On. All other values are equivalent to +Off. +The variables and their default values are: +

+ + +

+
bell-style (audible) + +
+Controls what happens when readline wants to ring the terminal bell. +If set to none, readline never rings the bell. If set to +visible, readline uses a visible bell if one is available. +If set to audible, readline attempts to ring the terminal's bell. +
bind-tty-special-chars (On) + +
+If set to On, readline attempts to bind the control characters +treated specially by the kernel's terminal driver to their readline +equivalents. +
colored-stats (Off) + +
+If set to On, readline displays possible completions using different +colors to indicate their file type. +The color definitions are taken from the value of the LS_COLORS +environment variable. +
comment-begin (``#'') + +
+The string that is inserted when the readline +insert-comment + +command is executed. +This command is bound to +M-# + +in emacs mode and to +# + +in vi command mode. +
completion-ignore-case (Off) + +
+If set to On, readline performs filename matching and completion +in a case-insensitive fashion. +
completion-prefix-display-length (0) + +
+The length in characters of the common prefix of a list of possible +completions that is displayed without modification. When set to a +value greater than zero, common prefixes longer than this value are +replaced with an ellipsis when displaying possible completions. +
completion-query-items (100) + +
+This determines when the user is queried about viewing +the number of possible completions +generated by the possible-completions command. +It may be set to any integer value greater than or equal to +zero. If the number of possible completions is greater than +or equal to the value of this variable, the user is asked whether +or not he wishes to view them; otherwise they are simply listed +on the terminal. +
convert-meta (On) + +
+If set to On, readline will convert characters with the +eighth bit set to an ASCII key sequence +by stripping the eighth bit and prefixing an +escape character (in effect, using escape as the meta prefix). +
disable-completion (Off) + +
+If set to On, readline will inhibit word completion. Completion +characters will be inserted into the line as if they had been +mapped to self-insert. +
editing-mode (emacs) + +
+Controls whether readline begins with a set of key bindings similar +to Emacs or vi. +editing-mode + +can be set to either +emacs + +or +vi. + +
echo-control-characters (On) + +
+When set to On, on operating systems that indicate they support it, +readline echoes a character corresponding to a signal generated from the +keyboard. +
enable-keypad (Off) + +
+When set to On, readline will try to enable the application +keypad when it is called. Some systems need this to enable the +arrow keys. +
enable-meta-key (On) + +
+When set to On, readline will try to enable any meta modifier +key the terminal claims to support when it is called. On many terminals, +the meta key is used to send eight-bit characters. +
expand-tilde (Off) + +
+If set to On, tilde expansion is performed when readline +attempts word completion. +
history-preserve-point (Off) + +
+If set to On, the history code attempts to place point at the +same location on each history line retrieved with previous-history +or next-history. +
history-size (0) + +
+Set the maximum number of history entries saved in the history list. +If set to zero, any existing history entries are deleted and no new entries +are saved. +If set to a value less than zero, the number of history entries is not +limited. +By default, the number of history entries is not limited. +
horizontal-scroll-mode (Off) + +
+When set to On, makes readline use a single line for display, +scrolling the input horizontally on a single screen line when it +becomes longer than the screen width rather than wrapping to a new line. +
input-meta (Off) + +
+If set to On, readline will enable eight-bit input (that is, +it will not strip the high bit from the characters it reads), +regardless of what the terminal claims it can support. The name +meta-flag + +is a synonym for this variable. +
isearch-terminators (``C-[C-J'') + +
+The string of characters that should terminate an incremental +search without subsequently executing the character as a command. +If this variable has not been given a value, the characters +ESC and C-J will terminate an incremental search. +
keymap (emacs) + +
+Set the current readline keymap. The set of valid keymap names is +emacs, emacs-standard, emacs-meta, emacs-ctlx, vi, +vi-command, and +vi-insert. + +vi is equivalent to vi-command; emacs is +equivalent to emacs-standard. The default value is +emacs; + +the value of +editing-mode + +also affects the default keymap. +
keyseq-timeout (500) + +
+Specifies the duration readline will wait for a character when reading an +ambiguous key sequence (one that can form a complete key sequence using +the input read so far, or can take additional input to complete a longer +key sequence). +If no input is received within the timeout, readline will use the shorter +but complete key sequence. +The value is specified in milliseconds, so a value of 1000 means that +readline will wait one second for additional input. +If this variable is set to a value less than or equal to zero, or to a +non-numeric value, readline will wait until another key is pressed to +decide which key sequence to complete. +
mark-directories (On) + +
+If set to On, completed directory names have a slash +appended. +
mark-modified-lines (Off) + +
+If set to On, history lines that have been modified are displayed +with a preceding asterisk (*). +
mark-symlinked-directories (Off) + +
+If set to On, completed names which are symbolic links to directories +have a slash appended (subject to the value of +mark-directories). +
match-hidden-files (On) + +
+This variable, when set to On, causes readline to match files whose +names begin with a `.' (hidden files) when performing filename +completion. +If set to Off, the leading `.' must be +supplied by the user in the filename to be completed. +
menu-complete-display-prefix (Off) + +
+If set to On, menu completion displays the common prefix of the +list of possible completions (which may be empty) before cycling through +the list. +
output-meta (Off) + +
+If set to On, readline will display characters with the +eighth bit set directly rather than as a meta-prefixed escape +sequence. +
page-completions (On) + +
+If set to On, readline uses an internal more-like pager +to display a screenful of possible completions at a time. +
print-completions-horizontally (Off) + +
+If set to On, readline will display completions with matches +sorted horizontally in alphabetical order, rather than down the screen. +
revert-all-at-newline (Off) + +
+If set to On, readline will undo all changes to history lines +before returning when accept-line is executed. By default, +history lines may be modified and retain individual undo lists across +calls to readline. +
show-all-if-ambiguous (Off) + +
+This alters the default behavior of the completion functions. If +set to +On, + +words which have more than one possible completion cause the +matches to be listed immediately instead of ringing the bell. +
show-all-if-unmodified (Off) + +
+This alters the default behavior of the completion functions in +a fashion similar to show-all-if-ambiguous. +If set to +On, + +words which have more than one possible completion without any +possible partial completion (the possible completions don't share +a common prefix) cause the matches to be listed immediately instead +of ringing the bell. +
show-mode-in-prompt (Off) + +
+If set to On, add a character to the beginning of the prompt +indicating the editing mode: emacs (@), vi command (:) or vi +insertion (+). +
skip-completed-text (Off) + +
+If set to On, this alters the default completion behavior when +inserting a single match into the line. It's only active when +performing completion in the middle of a word. If enabled, readline +does not insert characters from the completion that match characters +after point in the word being completed, so portions of the word +following the cursor are not duplicated. +
visible-stats (Off) + +
+If set to On, a character denoting a file's type as reported +by stat(2) is appended to the filename when listing possible +completions. + +
+  +

Readline Conditional Constructs

+ +

+ +Readline implements a facility similar in spirit to the conditional +compilation features of the C preprocessor which allows key +bindings and variable settings to be performed as the result +of tests. There are four parser directives used. +

+
$if
+The +$if + +construct allows bindings to be made based on the +editing mode, the terminal being used, or the application using +readline. The text of the test extends to the end of the line; +no characters are required to isolate it. +
+
+
mode
+The mode= form of the $if directive is used to test +whether readline is in emacs or vi mode. +This may be used in conjunction +with the set keymap command, for instance, to set bindings in +the emacs-standard and emacs-ctlx keymaps only if +readline is starting out in emacs mode. +
term
+The term= form may be used to include terminal-specific +key bindings, perhaps to bind the key sequences output by the +terminal's function keys. The word on the right side of the += + +is tested against the both full name of the terminal and the portion +of the terminal name before the first -. This allows +sun + +to match both +sun + +and +sun-cmd, + +for instance. +
application
+The application construct is used to include +application-specific settings. Each program using the readline +library sets the application name, and an initialization +file can test for a particular value. +This could be used to bind key sequences to functions useful for +a specific program. For instance, the following command adds a +key sequence that quotes the current or previous word in bash: +

+

+
+$if Bash
+# Quote the current or previous word
+"\C-xq": "\eb\"\ef\""
+$endif
+
+ +
+ +
+ +
$endif
+This command, as seen in the previous example, terminates an +$if command. +
$else
+Commands in this branch of the $if directive are executed if +the test fails. +
$include
+This directive takes a single filename as an argument and reads commands +and bindings from that file. For example, the following directive +would read /etc/inputrc: +

+

+
+$include  /etc/inputrc
+
+ +
+ +
+  +

Searching

+ +

+ +Readline provides commands for searching through the command history +(see +HISTORY + + +below) for lines containing a specified string. +There are two search modes: +incremental + +and +non-incremental. + +

+ +Incremental searches begin before the user has finished typing the +search string. +As each character of the search string is typed, readline displays +the next entry from the history matching the string typed so far. +An incremental search requires only as many characters as needed to +find the desired history entry. +The characters present in the value of the isearch-terminators +variable are used to terminate an incremental search. +If that variable has not been assigned a value the Escape and +Control-J characters will terminate an incremental search. +Control-G will abort an incremental search and restore the original +line. +When the search is terminated, the history entry containing the +search string becomes the current line. +

+ +To find other matching entries in the history list, type Control-S or +Control-R as appropriate. +This will search backward or forward in the history for the next +entry matching the search string typed so far. +Any other key sequence bound to a readline command will terminate +the search and execute that command. +For instance, a newline will terminate the search and accept +the line, thereby executing the command from the history list. +

+ +Readline remembers the last incremental search string. If two +Control-Rs are typed without any intervening characters defining a +new search string, any remembered search string is used. +

+ +Non-incremental searches read the entire search string before starting +to search for matching history lines. The search string may be +typed by the user or be part of the contents of the current line. +  +

Readline Command Names

+ +

+ +The following is a list of the names of the commands and the default +key sequences to which they are bound. +Command names without an accompanying key sequence are unbound by default. +In the following descriptions, point refers to the current cursor +position, and mark refers to a cursor position saved by the +set-mark command. +The text between the point and mark is referred to as the region. +  +

Commands for Moving

+ +

+ + +

+
beginning-of-line (C-a) + +
+Move to the start of the current line. +
end-of-line (C-e) + +
+Move to the end of the line. +
forward-char (C-f) + +
+Move forward a character. +
backward-char (C-b) + +
+Move back a character. +
forward-word (M-f) + +
+Move forward to the end of the next word. Words are composed of +alphanumeric characters (letters and digits). +
backward-word (M-b) + +
+Move back to the start of the current or previous word. +Words are composed of alphanumeric characters (letters and digits). +
shell-forward-word + +
+Move forward to the end of the next word. +Words are delimited by non-quoted shell metacharacters. +
shell-backward-word + +
+Move back to the start of the current or previous word. +Words are delimited by non-quoted shell metacharacters. +
clear-screen (C-l) + +
+Clear the screen leaving the current line at the top of the screen. +With an argument, refresh the current line without clearing the +screen. +
redraw-current-line + +
+Refresh the current line. + +
+  +

Commands for Manipulating the History

+ +

+ + +

+
accept-line (Newline, Return) + +
+Accept the line regardless of where the cursor is. If this line is +non-empty, add it to the history list according to the state of the +HISTCONTROL + + +variable. If the line is a modified history +line, then restore the history line to its original state. +
previous-history (C-p) + +
+Fetch the previous command from the history list, moving back in +the list. +
next-history (C-n) + +
+Fetch the next command from the history list, moving forward in the +list. +
beginning-of-history (M-<) + +
+Move to the first line in the history. +
end-of-history (M->) + +
+Move to the end of the input history, i.e., the line currently being +entered. +
reverse-search-history (C-r) + +
+Search backward starting at the current line and moving `up' through +the history as necessary. This is an incremental search. +
forward-search-history (C-s) + +
+Search forward starting at the current line and moving `down' through +the history as necessary. This is an incremental search. +
non-incremental-reverse-search-history (M-p) + +
+Search backward through the history starting at the current line +using a non-incremental search for a string supplied by the user. +
non-incremental-forward-search-history (M-n) + +
+Search forward through the history using a non-incremental search for +a string supplied by the user. +
history-search-forward + +
+Search forward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +
history-search-backward + +
+Search backward through the history for the string of characters +between the start of the current line and the point. +This is a non-incremental search. +
yank-nth-arg (M-C-y) + +
+Insert the first argument to the previous command (usually +the second word on the previous line) at point. +With an argument +n, + +insert the nth word from the previous command (the words +in the previous command begin with word 0). A negative argument +inserts the nth word from the end of the previous command. +Once the argument n is computed, the argument is extracted +as if the "!n" history expansion had been specified. +
yank-last-arg (M-., M-_) + +
+Insert the last argument to the previous command (the last word of +the previous history entry). +With a numeric argument, behave exactly like yank-nth-arg. +Successive calls to yank-last-arg move back through the history +list, inserting the last word (or the word specified by the argument to +the first call) of each line in turn. +Any numeric argument supplied to these successive calls determines +the direction to move through the history. A negative argument switches +the direction through the history (back or forward). +The history expansion facilities are used to extract the last word, +as if the "!$" history expansion had been specified. +
shell-expand-line (M-C-e) + +
+Expand the line as the shell does. This +performs alias and history expansion as well as all of the shell +word expansions. See +HISTORY EXPANSION + + +below for a description of history expansion. +
history-expand-line (M-^) + +
+Perform history expansion on the current line. +See +HISTORY EXPANSION + + +below for a description of history expansion. +
magic-space + +
+Perform history expansion on the current line and insert a space. +See +HISTORY EXPANSION + + +below for a description of history expansion. +
alias-expand-line + +
+Perform alias expansion on the current line. +See +ALIASES + + +above for a description of alias expansion. +
history-and-alias-expand-line + +
+Perform history and alias expansion on the current line. +
insert-last-argument (M-., M-_) + +
+A synonym for yank-last-arg. +
operate-and-get-next (C-o) + +
+Accept the current line for execution and fetch the next line +relative to the current line from the history for editing. Any +argument is ignored. +
edit-and-execute-command (C-xC-e) + +
+Invoke an editor on the current command line, and execute the result as shell +commands. +Bash attempts to invoke +$VISUAL, + + +$EDITOR, + + +and emacs as the editor, in that order. + +
+  +

Commands for Changing Text

+ +

+ + +

+
end-of-file (usually C-d) + +
+The character indicating end-of-file as set, for example, by +stty. + +If this character is read when there are no characters +on the line, and point is at the beginning of the line, Readline +interprets it as the end of input and returns +EOF. + + +
delete-char (C-d) + +
+Delete the character at point. +If this function is bound to the +same character as the tty EOF character, as C-d +commonly is, see above for the effects. +
backward-delete-char (Rubout) + +
+Delete the character behind the cursor. When given a numeric argument, +save the deleted text on the kill ring. +
forward-backward-delete-char + +
+Delete the character under the cursor, unless the cursor is at the +end of the line, in which case the character behind the cursor is +deleted. +
quoted-insert (C-q, C-v) + +
+Add the next character typed to the line verbatim. This is +how to insert characters like C-q, for example. +
tab-insert (C-v TAB) + +
+Insert a tab character. +
self-insert (a, b, A, 1, !, ...) + +
+Insert the character typed. +
transpose-chars (C-t) + +
+Drag the character before point forward over the character at point, +moving point forward as well. +If point is at the end of the line, then this transposes +the two characters before point. +Negative arguments have no effect. +
transpose-words (M-t) + +
+Drag the word before point past the word after point, +moving point over that word as well. +If point is at the end of the line, this transposes +the last two words on the line. +
upcase-word (M-u) + +
+Uppercase the current (or following) word. With a negative argument, +uppercase the previous word, but do not move point. +
downcase-word (M-l) + +
+Lowercase the current (or following) word. With a negative argument, +lowercase the previous word, but do not move point. +
capitalize-word (M-c) + +
+Capitalize the current (or following) word. With a negative argument, +capitalize the previous word, but do not move point. +
overwrite-mode + +
+Toggle overwrite mode. With an explicit positive numeric argument, +switches to overwrite mode. With an explicit non-positive numeric +argument, switches to insert mode. This command affects only +emacs mode; vi mode does overwrite differently. +Each call to readline() starts in insert mode. +In overwrite mode, characters bound to self-insert replace +the text at point rather than pushing the text to the right. +Characters bound to backward-delete-char replace the character +before point with a space. By default, this command is unbound. + +
+  +

Killing and Yanking

+ +

+ + +

+
kill-line (C-k) + +
+Kill the text from point to the end of the line. +
backward-kill-line (C-x Rubout) + +
+Kill backward to the beginning of the line. +
unix-line-discard (C-u) + +
+Kill backward from point to the beginning of the line. +The killed text is saved on the kill-ring. + +
kill-whole-line + +
+Kill all characters on the current line, no matter where point is. +
kill-word (M-d) + +
+Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as those used by forward-word. +
backward-kill-word (M-Rubout) + +
+Kill the word behind point. +Word boundaries are the same as those used by backward-word. +
shell-kill-word (M-d) + +
+Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as those used by shell-forward-word. +
shell-backward-kill-word (M-Rubout) + +
+Kill the word behind point. +Word boundaries are the same as those used by shell-backward-word. +
unix-word-rubout (C-w) + +
+Kill the word behind point, using white space as a word boundary. +The killed text is saved on the kill-ring. +
unix-filename-rubout + +
+Kill the word behind point, using white space and the slash character +as the word boundaries. +The killed text is saved on the kill-ring. +
delete-horizontal-space (M-\) + +
+Delete all spaces and tabs around point. +
kill-region + +
+Kill the text in the current region. +
copy-region-as-kill + +
+Copy the text in the region to the kill buffer. +
copy-backward-word + +
+Copy the word before point to the kill buffer. +The word boundaries are the same as backward-word. +
copy-forward-word + +
+Copy the word following point to the kill buffer. +The word boundaries are the same as forward-word. +
yank (C-y) + +
+Yank the top of the kill ring into the buffer at point. +
yank-pop (M-y) + +
+Rotate the kill ring, and yank the new top. Only works following +yank + +or +yank-pop. + + +
+  +

Numeric Arguments

+ +

+ + +

+
digit-argument (M-0, M-1, ..., M--) + +
+Add this digit to the argument already accumulating, or start a new +argument. M-- starts a negative argument. +
universal-argument + +
+This is another way to specify an argument. +If this command is followed by one or more digits, optionally with a +leading minus sign, those digits define the argument. +If the command is followed by digits, executing +universal-argument + +again ends the numeric argument, but is otherwise ignored. +As a special case, if this command is immediately followed by a +character that is neither a digit or minus sign, the argument count +for the next command is multiplied by four. +The argument count is initially one, so executing this function the +first time makes the argument count four, a second time makes the +argument count sixteen, and so on. + +
+  +

Completing

+ +

+ + +

+
complete (TAB) + +
+Attempt to perform completion on the text before point. +Bash + +attempts completion treating the text as a variable (if the +text begins with $), username (if the text begins with +~), hostname (if the text begins with @), or +command (including aliases and functions) in turn. If none +of these produces a match, filename completion is attempted. +
possible-completions (M-?) + +
+List the possible completions of the text before point. +
insert-completions (M-*) + +
+Insert all completions of the text before point +that would have been generated by +possible-completions. +
menu-complete + +
+Similar to complete, but replaces the word to be completed +with a single match from the list of possible completions. +Repeated execution of menu-complete steps through the list +of possible completions, inserting each match in turn. +At the end of the list of completions, the bell is rung +(subject to the setting of bell-style) +and the original text is restored. +An argument of n moves n positions forward in the list +of matches; a negative argument may be used to move backward +through the list. +This command is intended to be bound to TAB, but is unbound +by default. +
menu-complete-backward + +
+Identical to menu-complete, but moves backward through the list +of possible completions, as if menu-complete had been given a +negative argument. This command is unbound by default. +
delete-char-or-list + +
+Deletes the character under the cursor if not at the beginning or +end of the line (like delete-char). +If at the end of the line, behaves identically to +possible-completions. +This command is unbound by default. +
complete-filename (M-/) + +
+Attempt filename completion on the text before point. +
possible-filename-completions (C-x /) + +
+List the possible completions of the text before point, +treating it as a filename. +
complete-username (M-~) + +
+Attempt completion on the text before point, treating +it as a username. +
possible-username-completions (C-x ~) + +
+List the possible completions of the text before point, +treating it as a username. +
complete-variable (M-$) + +
+Attempt completion on the text before point, treating +it as a shell variable. +
possible-variable-completions (C-x $) + +
+List the possible completions of the text before point, +treating it as a shell variable. +
complete-hostname (M-@) + +
+Attempt completion on the text before point, treating +it as a hostname. +
possible-hostname-completions (C-x @) + +
+List the possible completions of the text before point, +treating it as a hostname. +
complete-command (M-!) + +
+Attempt completion on the text before point, treating +it as a command name. Command completion attempts to +match the text against aliases, reserved words, shell +functions, shell builtins, and finally executable filenames, +in that order. +
possible-command-completions (C-x !) + +
+List the possible completions of the text before point, +treating it as a command name. +
dynamic-complete-history (M-TAB) + +
+Attempt completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +
dabbrev-expand + +
+Attempt menu completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +
complete-into-braces (M-{) + +
+Perform filename completion and insert the list of possible completions +enclosed within braces so the list is available to the shell (see +Brace Expansion + +above). + +
+  +

Keyboard Macros

+ +

+ + +

+
start-kbd-macro (C-x () + +
+Begin saving the characters typed into the current keyboard macro. +
end-kbd-macro (C-x )) + +
+Stop saving the characters typed into the current keyboard macro +and store the definition. +
call-last-kbd-macro (C-x e) + +
+Re-execute the last keyboard macro defined, by making the characters +in the macro appear as if typed at the keyboard. +
print-last-kbd-macro () + +
+Print the last keyboard macro defined in a format suitable for the +inputrc file. + +
+  +

Miscellaneous

+ +

+ + +

+
re-read-init-file (C-x C-r) + +
+Read in the contents of the inputrc file, and incorporate +any bindings or variable assignments found there. +
abort (C-g) + +
+Abort the current editing command and +ring the terminal's bell (subject to the setting of +bell-style). + +
do-uppercase-version (M-a, M-b, M-x, ...) + +
+If the metafied character x is lowercase, run the command +that is bound to the corresponding uppercase character. +
prefix-meta (ESC) + +
+Metafy the next character typed. +ESC + + +f + +is equivalent to +Meta-f. + +
undo (C-_, C-x C-u) + +
+Incremental undo, separately remembered for each line. +
revert-line (M-r) + +
+Undo all changes made to this line. This is like executing the +undo + +command enough times to return the line to its initial state. +
tilde-expand (M-&) + +
+Perform tilde expansion on the current word. +
set-mark (C-@, M-<space>) + +
+Set the mark to the point. If a +numeric argument is supplied, the mark is set to that position. +
exchange-point-and-mark (C-x C-x) + +
+Swap the point with the mark. The current cursor position is set to +the saved position, and the old cursor position is saved as the mark. +
character-search (C-]) + +
+A character is read and point is moved to the next occurrence of that +character. A negative count searches for previous occurrences. +
character-search-backward (M-C-]) + +
+A character is read and point is moved to the previous occurrence of that +character. A negative count searches for subsequent occurrences. +
skip-csi-sequence + +
+Read enough characters to consume a multi-key sequence such as those +defined for keys like Home and End. Such sequences begin with a +Control Sequence Indicator (CSI), usually ESC-[. If this sequence is +bound to "\[", keys producing such sequences will have no effect +unless explicitly bound to a readline command, instead of inserting +stray characters into the editing buffer. This is unbound by default, +but usually bound to ESC-[. +
insert-comment (M-#) + +
+Without a numeric argument, the value of the readline +comment-begin + +variable is inserted at the beginning of the current line. +If a numeric argument is supplied, this command acts as a toggle: if +the characters at the beginning of the line do not match the value +of comment-begin, the value is inserted, otherwise +the characters in comment-begin are deleted from the beginning of +the line. +In either case, the line is accepted as if a newline had been typed. +The default value of +comment-begin causes this command to make the current line +a shell comment. +If a numeric argument causes the comment character to be removed, the line +will be executed by the shell. +
glob-complete-word (M-g) + +
+The word before point is treated as a pattern for pathname expansion, +with an asterisk implicitly appended. This pattern is used to +generate a list of matching filenames for possible completions. +
glob-expand-word (C-x *) + +
+The word before point is treated as a pattern for pathname expansion, +and the list of matching filenames is inserted, replacing the word. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +
glob-list-expansions (C-x g) + +
+The list of expansions that would have been generated by +glob-expand-word + +is displayed, and the line is redrawn. +If a numeric argument is supplied, an asterisk is appended before +pathname expansion. +
dump-functions + +
+Print all of the functions and their key bindings to the +readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an inputrc file. +
dump-variables + +
+Print all of the settable readline variables and their values to the +readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an inputrc file. +
dump-macros + +
+Print all of the readline key sequences bound to macros and the +strings they output. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an inputrc file. +
display-shell-version (C-x C-v) + +
+Display version information about the current instance of +bash. + + +
+  +

Programmable Completion

+ +

+ +When word completion is attempted for an argument to a command for +which a completion specification (a compspec) has been defined +using the complete builtin (see +SHELL BUILTIN COMMANDS + + +below), the programmable completion facilities are invoked. +

+ +First, the command name is identified. +If the command word is the empty string (completion attempted at the +beginning of an empty line), any compspec defined with +the -E option to complete is used. +If a compspec has been defined for that command, the +compspec is used to generate the list of possible completions for the word. +If the command word is a full pathname, a compspec for the full +pathname is searched for first. +If no compspec is found for the full pathname, an attempt is made to +find a compspec for the portion following the final slash. +If those searches do not result in a compspec, any compspec defined with +the -D option to complete is used as the default. +

+ +Once a compspec has been found, it is used to generate the list of +matching words. +If a compspec is not found, the default bash completion as +described above under Completing is performed. +

+ +First, the actions specified by the compspec are used. +Only matches which are prefixed by the word being completed are +returned. +When the +-f + +or +-d + +option is used for filename or directory name completion, the shell +variable +FIGNORE + + +is used to filter the matches. +

+ +Any completions specified by a pathname expansion pattern to the +-G option are generated next. +The words generated by the pattern need not match the word +being completed. +The +GLOBIGNORE + + +shell variable is not used to filter the matches, but the +FIGNORE + + +variable is used. +

+ +Next, the string specified as the argument to the -W option +is considered. +The string is first split using the characters in the +IFS + + +special variable as delimiters. +Shell quoting is honored. +Each word is then expanded using +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, and arithmetic expansion, +as described above under +EXPANSION. + + +The results are split using the rules described above under +Word Splitting. +The results of the expansion are prefix-matched against the word being +completed, and the matching words become the possible completions. +

+ +After these matches have been generated, any shell function or command +specified with the -F and -C options is invoked. +When the command or function is invoked, the +COMP_LINE, + + +COMP_POINT, + + +COMP_KEY, + + +and +COMP_TYPE + + +variables are assigned values as described above under +Shell Variables. +If a shell function is being invoked, the +COMP_WORDS + + +and +COMP_CWORD + + +variables are also set. +When the function or command is invoked, +the first argument ($1) is the name of the command whose arguments are +being completed, +the second argument ($2) is the word being completed, +and the third argument ($3) is the word preceding the word being +completed on the current command line. +No filtering of the generated completions against the word being completed +is performed; the function or command has complete freedom in generating +the matches. +

+ +Any function specified with -F is invoked first. +The function may use any of the shell facilities, including the +compgen builtin described below, to generate the matches. +It must put the possible completions in the +COMPREPLY + + +array variable, one per array element. +

+ +Next, any command specified with the -C option is invoked +in an environment equivalent to command substitution. +It should print a list of completions, one per line, to the +standard output. +Backslash may be used to escape a newline, if necessary. +

+ +After all of the possible completions are generated, any filter +specified with the -X option is applied to the list. +The filter is a pattern as used for pathname expansion; a & +in the pattern is replaced with the text of the word being completed. +A literal & may be escaped with a backslash; the backslash +is removed before attempting a match. +Any completion that matches the pattern will be removed from the list. +A leading ! negates the pattern; in this case any completion +not matching the pattern will be removed. +

+ +Finally, any prefix and suffix specified with the -P and -S +options are added to each member of the completion list, and the result is +returned to the readline completion code as the list of possible +completions. +

+ +If the previously-applied actions do not generate any matches, and the +-o dirnames option was supplied to complete when the +compspec was defined, directory name completion is attempted. +

+ +If the -o plusdirs option was supplied to complete when the +compspec was defined, directory name completion is attempted and any +matches are added to the results of the other actions. +

+ +By default, if a compspec is found, whatever it generates is returned +to the completion code as the full set of possible completions. +The default bash completions are not attempted, and the readline +default of filename completion is disabled. +If the -o bashdefault option was supplied to complete when +the compspec was defined, the bash default completions are attempted +if the compspec generates no matches. +If the -o default option was supplied to complete when the +compspec was defined, readline's default completion will be performed +if the compspec (and, if attempted, the default bash completions) +generate no matches. +

+ +When a compspec indicates that directory name completion is desired, +the programmable completion functions force readline to append a slash +to completed names which are symbolic links to directories, subject to +the value of the mark-directories readline variable, regardless +of the setting of the mark-symlinked-directories readline variable. +

+ +There is some support for dynamically modifying completions. This is +most useful when used in combination with a default completion specified +with complete -D. +It's possible for shell functions executed as completion +handlers to indicate that completion should be retried by returning an +exit status of 124. If a shell function returns 124, and changes +the compspec associated with the command on which completion is being +attempted (supplied as the first argument when the function is executed), +programmable completion restarts from the beginning, with an +attempt to find a new compspec for that command. This allows a set of +completions to be built dynamically as completion is attempted, rather than +being loaded all at once. +

+ +For instance, assuming that there is a library of compspecs, each kept in a +file corresponding to the name of the command, the following default +completion function would load completions dynamically: +

+ +_completion_loader() +
+ +{ +
+ +       . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124
+
+ +} +
+ +complete -D -F _completion_loader -o bashdefault -o default +
+ +
+  +

HISTORY

+ +When the +-o history + +option to the +set + +builtin is enabled, the shell provides access to the +command history, +the list of commands previously typed. +The value of the +HISTSIZE + + +variable is used as the +number of commands to save in a history list. +The text of the last +HISTSIZE + + +commands (default 500) is saved. The shell +stores each command in the history list prior to parameter and +variable expansion (see +EXPANSION + + +above) but after history expansion is performed, subject to the +values of the shell variables +HISTIGNORE + + +and +HISTCONTROL. + + +

+ +On startup, the history is initialized from the file named by +the variable +HISTFILE + + +(default ~/.bash_history). +The file named by the value of +HISTFILE + + +is truncated, if necessary, to contain no more than +the number of lines specified by the value of +HISTFILESIZE. + + +If HISTFILESIZE is unset, or set to null, a non-numeric value, +or a numeric value less than zero, the history file is not truncated. +When the history file is read, +lines beginning with the history comment character followed immediately +by a digit are interpreted as timestamps for the preceding history line. +These timestamps are optionally displayed depending on the value of the +HISTTIMEFORMAT + + +variable. +When a shell with history enabled exits, the last +$HISTSIZE + + +lines are copied from the history list to +$HISTFILE. + + +If the +histappend + +shell option is enabled +(see the description of +shopt + +under +SHELL BUILTIN COMMANDS + + +below), the lines are appended to the history file, +otherwise the history file is overwritten. +If +HISTFILE + + +is unset, or if the history file is unwritable, the history is +not saved. +If the +HISTTIMEFORMAT + + +variable is set, time stamps are written to the history file, marked +with the history comment character, so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +After saving the history, the history file is truncated +to contain no more than +HISTFILESIZE + + +lines. If +HISTFILESIZE + + +is unset, or set to null, a non-numeric value, +or a numeric value less than zero, the history file is not truncated. +

+ +The builtin command +fc + +(see +SHELL BUILTIN COMMANDS + + +below) may be used to list or edit and re-execute a portion of +the history list. +The +history + +builtin may be used to display or modify the history list and +manipulate the history file. +When using command-line editing, search commands +are available in each editing mode that provide access to the +history list. +

+ +The shell allows control over which commands are saved on the history +list. The +HISTCONTROL + + +and +HISTIGNORE + + +variables may be set to cause the shell to save only a subset of the +commands entered. +The +cmdhist + +shell option, if enabled, causes the shell to attempt to save each +line of a multi-line command in the same history entry, adding +semicolons where necessary to preserve syntactic correctness. +The +lithist + +shell option causes the shell to save the command with embedded newlines +instead of semicolons. See the description of the +shopt + +builtin below under +SHELL BUILTIN COMMANDS + + +for information on setting and unsetting shell options. +  +

HISTORY EXPANSION

+ +

+ +The shell supports a history expansion feature that +is similar to the history expansion in +csh. + +This section describes what syntax features are available. This +feature is enabled by default for interactive shells, and can be +disabled using the ++H + +option to the +set + +builtin command (see +SHELL BUILTIN COMMANDS + + +below). Non-interactive shells do not perform history expansion +by default. +

+ +History expansions introduce words from the history list into +the input stream, making it easy to repeat commands, insert the +arguments to a previous command into the current input line, or +fix errors in previous commands quickly. +

+ +History expansion is performed immediately after a complete line +is read, before the shell breaks it into words. +It takes place in two parts. +The first is to determine which line from the history list +to use during substitution. +The second is to select portions of that line for inclusion into +the current one. +The line selected from the history is the event, +and the portions of that line that are acted upon are words. +Various modifiers are available to manipulate the selected words. +The line is broken into words in the same fashion as when reading input, +so that several metacharacter-separated words surrounded by +quotes are considered one word. +History expansions are introduced by the appearance of the +history expansion character, which is ! by default. +Only backslash (\) and single quotes can quote +the history expansion character. +

+ +Several characters inhibit history expansion if found immediately +following the history expansion character, even if it is unquoted: +space, tab, newline, carriage return, and =. +If the extglob shell option is enabled, ( will also +inhibit expansion. +

+ +Several shell options settable with the +shopt + +builtin may be used to tailor the behavior of history expansion. +If the +histverify + +shell option is enabled (see the description of the +shopt + +builtin below), and +readline + +is being used, history substitutions are not immediately passed to +the shell parser. +Instead, the expanded line is reloaded into the +readline + +editing buffer for further modification. +If +readline + +is being used, and the +histreedit + +shell option is enabled, a failed history substitution will be reloaded +into the +readline + +editing buffer for correction. +The +-p + +option to the +history + +builtin command may be used to see what a history expansion will +do before using it. +The +-s + +option to the +history + +builtin may be used to add commands to the end of the history list +without actually executing them, so that they are available for +subsequent recall. +

+ +The shell allows control of the various characters used by the +history expansion mechanism (see the description of +histchars + +above under +Shell Variables). + +The shell uses +the history comment character to mark history timestamps when +writing the history file. +  +

Event Designators

+ +

+ +An event designator is a reference to a command line entry in the +history list. +Unless the reference is absolute, events are relative to the current +position in the history list. +

+ + +

+
! + +
+Start a history substitution, except when followed by a +blank, + +newline, carriage return, = +or ( (when the extglob shell option is enabled using +the shopt builtin). +
!n + +
+Refer to command line +n. + +
!-n + +
+Refer to the current command minus +n. + +
!! + +
+Refer to the previous command. This is a synonym for `!-1'. +
!string + +
+Refer to the most recent command preceding the current position in the +history list starting with +string. + +
!?string[?] + +
+Refer to the most recent command preceding the current position in the +history list containing +string. + +The trailing ? may be omitted if +string + +is followed immediately by a newline. +
^string1^string2^ + +
+Quick substitution. Repeat the previous command, replacing +string1 + +with +string2. + +Equivalent to +``!!:s/string1/string2/'' +(see Modifiers below). +
!# + +
+The entire command line typed so far. + +
+  +

Word Designators

+ +

+ +Word designators are used to select desired words from the event. +A +: + +separates the event specification from the word designator. +It may be omitted if the word designator begins with a +^, + +$, + +*, + +-, + +or +%. + +Words are numbered from the beginning of the line, +with the first word being denoted by 0 (zero). +Words are inserted into the current line separated by single spaces. +

+ + +

+
0 (zero) + +
+The zeroth word. For the shell, this is the command +word. +
n + +
+The nth word. +
^ + +
+The first argument. That is, word 1. +
$ + +
+The last word. This is usually the last argument, but will expand to the +zeroth word if there is only one word in the line. +
% + +
+The word matched by the most recent `?string?' search. +
x-y + +
+A range of words; `-y' abbreviates `0-y'. +
* + +
+All of the words but the zeroth. This is a synonym +for `1-$'. It is not an error to use +* + +if there is just one +word in the event; the empty string is returned in that case. +
x* + +
+Abbreviates x-$. +
x- + +
+Abbreviates x-$ like x*, but omits the last word. + +
+

+ +If a word designator is supplied without an event specification, the +previous command is used as the event. +  +

Modifiers

+ +

+ +After the optional word designator, there may appear a sequence of +one or more of the following modifiers, each preceded by a `:'. +

+ + +

+ +

+
h + +
+Remove a trailing filename component, leaving only the head. +
t + +
+Remove all leading filename components, leaving the tail. +
r + +
+Remove a trailing suffix of the form .xxx, leaving the +basename. +
e + +
+Remove all but the trailing suffix. +
p + +
+Print the new command but do not execute it. +
q + +
+Quote the substituted words, escaping further substitutions. +
x + +
+Quote the substituted words as with +q, + +but break into words at +blanks + +and newlines. +
s/old/new/ + +
+Substitute +new + +for the first occurrence of +old + +in the event line. Any delimiter can be used in place of /. The +final delimiter is optional if it is the last character of the +event line. The delimiter may be quoted in +old + +and +new + +with a single backslash. If & appears in +new, + +it is replaced by +old. + +A single backslash will quote the &. If +old + +is null, it is set to the last +old + +substituted, or, if no previous history substitutions took place, +the last +string + +in a +!?string[?] + +search. +
& + +
+Repeat the previous substitution. +
g + +
+Cause changes to be applied over the entire event line. This is +used in conjunction with `:s' (e.g., `:gs/old/new/') +or `:&'. If used with +`:s', any delimiter can be used +in place of /, and the final delimiter is optional +if it is the last character of the event line. +An a may be used as a synonym for g. +
G + +
+Apply the following `s' modifier once to each word in the event line. + +
+  +

SHELL BUILTIN COMMANDS

+ + + +

+ +Unless otherwise noted, each builtin command documented in this +section as accepting options preceded by +- + +accepts +-- + +to signify the end of the options. +The :, true, false, and test builtins +do not accept options and do not treat -- specially. +The exit, logout, break, continue, let, +and shift builtins accept and process arguments beginning with +- without requiring --. +Other builtins that accept arguments but are not specified as accepting +options interpret arguments beginning with - as invalid options and +require -- to prevent this interpretation. +

+ +

+
: [arguments]
+ +No effect; the command does nothing beyond expanding +arguments + +and performing any specified +redirections. A zero exit code is returned. +
. filename [arguments]
+ +
source filename [arguments]
+ +Read and execute commands from +filename + +in the current +shell environment and return the exit status of the last command +executed from +filename. + +If +filename + +does not contain a slash, filenames in +PATH + + +are used to find the directory containing +filename. + +The file searched for in +PATH + + +need not be executable. +When bash is not in posix mode, the current directory is +searched if no file is found in +PATH. + + +If the +sourcepath + +option to the +shopt + +builtin command is turned off, the +PATH + + +is not searched. +If any arguments are supplied, they become the positional +parameters when filename is executed. Otherwise the positional +parameters are unchanged. +The return status is the status of the last command exited within +the script (0 if no commands are executed), and false if +filename + +is not found or cannot be read. +
alias [-p] [name[=value] ...]
+Alias with no arguments or with the +-p + +option prints the list of aliases in the form +alias name=value on standard output. +When arguments are supplied, an alias is defined for +each name whose value is given. +A trailing space in value causes the next word to be +checked for alias substitution when the alias is expanded. +For each name in the argument list for which no value +is supplied, the name and value of the alias is printed. +Alias returns true unless a name is given for which +no alias has been defined. +
bg [jobspec ...]
+Resume each suspended job jobspec in the background, as if it +had been started with +&. + +If +jobspec + +is not present, the shell's notion of the current job is used. +bg + +jobspec + +returns 0 unless run when job control is disabled or, when run with +job control enabled, any specified jobspec was not found +or was started without job control. +
bind [-m keymap] [-lpsvPSVX]
+ +
bind [-m keymap] [-q function] [-u function] [-r keyseq]
+
bind [-m keymap] -f filename
+
bind [-m keymap] -x keyseq:shell-command
+
bind [-m keymap] keyseq:function-name
+
bind readline-command
+ +Display current +readline + +key and function bindings, bind a key sequence to a +readline + +function or macro, or set a +readline + +variable. +Each non-option argument is a command as it would appear in +.inputrc, + +but each binding or command must be passed as a separate argument; +e.g., '"\C-x\C-r": re-read-init-file'. +Options, if supplied, have the following meanings: +
+ +
+
-m keymap + +
+Use +keymap + +as the keymap to be affected by the subsequent bindings. +Acceptable +keymap + +names are +emacs, emacs-standard, emacs-meta, emacs-ctlx, vi, +vi-move, vi-command, and +vi-insert. + +vi is equivalent to vi-command; emacs is +equivalent to emacs-standard. +
-l + +
+List the names of all readline functions. +
-p + +
+Display readline function names and bindings in such a way +that they can be re-read. +
-P + +
+List current readline function names and bindings. +
-s + +
+Display readline key sequences bound to macros and the strings +they output in such a way that they can be re-read. +
-S + +
+Display readline key sequences bound to macros and the strings +they output. +
-v + +
+Display readline variable names and values in such a way that they +can be re-read. +
-V + +
+List current readline variable names and values. +
-f filename + +
+Read key bindings from filename. +
-q function + +
+Query about which keys invoke the named function. +
-u function + +
+Unbind all keys bound to the named function. +
-r keyseq + +
+Remove any current binding for keyseq. +
-x keyseq:shell-command + +
+Cause shell-command to be executed whenever keyseq is +entered. +When shell-command is executed, the shell sets the +READLINE_LINE + + +variable to the contents of the readline line buffer and the +READLINE_POINT + + +variable to the current location of the insertion point. +If the executed command changes the value of +READLINE_LINE + + +or +READLINE_POINT, + + +those new values will be reflected in the editing state. +
-X + +
+List all key sequences bound to shell commands and the associated commands +in a format that can be reused as input. + +
+

+ +The return value is 0 unless an unrecognized option is given or an +error occurred. +

+ +
break [n]
+Exit from within a +for, + +while, + +until, + +or +select + +loop. If n is specified, break n levels. +n + +must be >= 1. If +n + +is greater than the number of enclosing loops, all enclosing loops +are exited. +The return value is 0 unless n is not greater than or equal to 1. +
builtin shell-builtin [arguments]
+Execute the specified shell builtin, passing it +arguments, + +and return its exit status. +This is useful when defining a +function whose name is the same as a shell builtin, +retaining the functionality of the builtin within the function. +The cd builtin is commonly redefined this way. +The return status is false if +shell-builtin + +is not a shell builtin command. +
caller [expr]
+Returns the context of any active subroutine call (a shell function or +a script executed with the . or source builtins). +Without expr, caller displays the line number and source +filename of the current subroutine call. +If a non-negative integer is supplied as expr, caller +displays the line number, subroutine name, and source file corresponding +to that position in the current execution call stack. This extra +information may be used, for example, to print a stack trace. The +current frame is frame 0. +The return value is 0 unless the shell is not executing a subroutine +call or expr does not correspond to a valid position in the +call stack. +
cd [-L|[-P [-e]] [-@]] [dir]
+Change the current directory to dir. +if dir is not supplied, the value of the +HOME + + +shell variable is the default. +Any additional arguments following dir are ignored. +The variable +CDPATH + + +defines the search path for the directory containing +dir: + +each directory name in +CDPATH + + +is searched for dir. +Alternative directory names in +CDPATH + + +are separated by a colon (:). A null directory name in +CDPATH + + +is the same as the current directory, i.e., ``.''. If +dir + +begins with a slash (/), +then +CDPATH + + +is not used. The +-P + +option causes cd to use the physical directory structure +by resolving symbolic links while traversing dir and +before processing instances of .. in dir (see also the +-P + +option to the +set + +builtin command); the +-L + +option forces symbolic links to be followed by resolving the link +after processing instances of .. in dir. +If .. appears in dir, it is processed by removing the +immediately previous pathname component from dir, back to a slash +or the beginning of dir. +If the +-e + +option is supplied with +-P, + +and the current working directory cannot be successfully determined +after a successful directory change, cd will return an unsuccessful +status. +On systems that support it, the -@ option presents the extended +attributes associated with a file as a directory. +An argument of +- + +is converted to +$OLDPWD + + +before the directory change is attempted. +If a non-empty directory name from +CDPATH + + +is used, or if +- is the first argument, and the directory change is +successful, the absolute pathname of the new working directory is +written to the standard output. +The return value is true if the directory was successfully changed; +false otherwise. +
command [-pVv] command [arg ...]
+Run +command + +with +args + +suppressing the normal shell function lookup. Only builtin +commands or commands found in the +PATH + + +are executed. If the +-p + +option is given, the search for +command + +is performed using a default value for +PATH + + +that is guaranteed to find all of the standard utilities. +If either the +-V + +or +-v + +option is supplied, a description of +command + +is printed. The +-v + +option causes a single word indicating the command or filename +used to invoke +command + +to be displayed; the +-V + +option produces a more verbose description. +If the +-V + +or +-v + +option is supplied, the exit status is 0 if +command + +was found, and 1 if not. If neither option is supplied and +an error occurred or +command + +cannot be found, the exit status is 127. Otherwise, the exit status of the +command + +builtin is the exit status of +command. + +
compgen [option] [word]
+Generate possible completion matches for word according to +the options, which may be any option accepted by the +complete + +builtin with the exception of -p and -r, and write +the matches to the standard output. +When using the -F or -C options, the various shell variables +set by the programmable completion facilities, while available, will not +have useful values. +

+The matches will be generated in the same way as if the programmable +completion code had generated them directly from a completion specification +with the same flags. +If word is specified, only those completions matching word +will be displayed. +

+The return value is true unless an invalid option is supplied, or no +matches were generated. +

complete [-abcdefgjksuv] [-o comp-option] [-DE] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command]
+
+ +[-X filterpat] [-P prefix] [-S suffix] name [name ...] + +
complete -pr [-DE] [name ...]
+ +Specify how arguments to each name should be completed. +If the -p option is supplied, or if no options are supplied, +existing completion specifications are printed in a way that allows +them to be reused as input. +The -r option removes a completion specification for +each name, or, if no names are supplied, all +completion specifications. +The -D option indicates that the remaining options and actions should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The -E option indicates that the remaining options and actions should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +

+The process of applying these completion specifications when word completion +is attempted is described above under Programmable Completion. +

+Other options, if specified, have the following meanings. +The arguments to the -G, -W, and -X options +(and, if necessary, the -P and -S options) +should be quoted to protect them from expansion before the +complete + +builtin is invoked. +

+ +
+
-o comp-option
+The comp-option controls several aspects of the compspec's behavior +beyond the simple generation of completions. +comp-option may be one of: +
+
+
bashdefault + +
+Perform the rest of the default bash completions if the compspec +generates no matches. +
default + +
+Use readline's default filename completion if the compspec generates +no matches. +
dirnames + +
+Perform directory name completion if the compspec generates no matches. +
filenames + +
+Tell readline that the compspec generates filenames, so it can perform any +filename-specific processing (like adding a slash to directory names, +quoting special characters, or suppressing trailing spaces). +Intended to be used with shell functions. +
noquote + +
+Tell readline not to quote the completed words if they are filenames +(quoting filenames is the default). +
nospace + +
+Tell readline not to append a space (the default) to words completed at +the end of the line. +
plusdirs + +
+After any matches defined by the compspec are generated, +directory name completion is attempted and any +matches are added to the results of the other actions. +
+ +
-A action
+The action may be one of the following to generate a list of possible +completions: +
+
+
alias + +
+Alias names. May also be specified as -a. +
arrayvar + +
+Array variable names. +
binding + +
+Readline key binding names. +
builtin + +
+Names of shell builtin commands. May also be specified as -b. +
command + +
+Command names. May also be specified as -c. +
directory + +
+Directory names. May also be specified as -d. +
disabled + +
+Names of disabled shell builtins. +
enabled + +
+Names of enabled shell builtins. +
export + +
+Names of exported shell variables. May also be specified as -e. +
file + +
+File names. May also be specified as -f. +
function + +
+Names of shell functions. +
group + +
+Group names. May also be specified as -g. +
helptopic + +
+Help topics as accepted by the help builtin. +
hostname + +
+Hostnames, as taken from the file specified by the +HOSTFILE + + +shell variable. +
job + +
+Job names, if job control is active. May also be specified as -j. +
keyword + +
+Shell reserved words. May also be specified as -k. +
running + +
+Names of running jobs, if job control is active. +
service + +
+Service names. May also be specified as -s. +
setopt + +
+Valid arguments for the -o option to the set builtin. +
shopt + +
+Shell option names as accepted by the shopt builtin. +
signal + +
+Signal names. +
stopped + +
+Names of stopped jobs, if job control is active. +
user + +
+User names. May also be specified as -u. +
variable + +
+Names of all shell variables. May also be specified as -v. +
+ +
-C command
+command is executed in a subshell environment, and its output is +used as the possible completions. +
-F function
+The shell function function is executed in the current shell +environment. +When the function is executed, +the first argument ($1) is the name of the command whose arguments are +being completed, +the second argument ($2) is the word being completed, +and the third argument ($3) is the word preceding the word being +completed on the current command line. +When it finishes, the possible completions are retrieved from the value +of the +COMPREPLY + + +array variable. +
-G globpat
+The pathname expansion pattern globpat is expanded to generate +the possible completions. +
-P prefix
+prefix is added at the beginning of each possible completion +after all other options have been applied. +
-S suffix
+suffix is appended to each possible completion +after all other options have been applied. +
-W wordlist
+The wordlist is split using the characters in the +IFS + + +special variable as delimiters, and each resultant word is expanded. +The possible completions are the members of the resultant list which +match the word being completed. +
-X filterpat
+filterpat is a pattern as used for pathname expansion. +It is applied to the list of possible completions generated by the +preceding options and arguments, and each completion matching +filterpat is removed from the list. +A leading ! in filterpat negates the pattern; in this +case, any completion not matching filterpat is removed. + +
+

+ +The return value is true unless an invalid option is supplied, an option +other than -p or -r is supplied without a name +argument, an attempt is made to remove a completion specification for +a name for which no specification exists, or +an error occurs adding a completion specification. +

+ +
compopt [-o option] [-DE] [+o option] [name]
+Modify completion options for each name according to the +options, or for the +currently-executing completion if no names are supplied. +If no options are given, display the completion options for each +name or the current completion. +The possible values of option are those valid for the complete +builtin described above. +The -D option indicates that the remaining options should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The -E option indicates that the remaining options should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. +

+The return value is true unless an invalid option is supplied, an attempt +is made to modify the options for a name for which no completion +specification exists, or an output error occurs. +

continue [n]
+Resume the next iteration of the enclosing +for, + +while, + +until, + +or +select + +loop. +If +n + +is specified, resume at the nth enclosing loop. +n + +must be >= 1. If +n + +is greater than the number of enclosing loops, the last enclosing loop +(the ``top-level'' loop) is resumed. +The return value is 0 unless n is not greater than or equal to 1. +
declare [-aAfFgilnrtux] [-p] [name[=value] ...]
+ +
typeset [-aAfFgilnrtux] [-p] [name[=value] ...]
+ +Declare variables and/or give them attributes. +If no names are given then display the values of variables. +The +-p + +option will display the attributes and values of each +name. + +When +-p + +is used with name arguments, additional options, +other than -f and -F, are ignored. +When +-p + +is supplied without name arguments, it will display the attributes +and values of all variables having the attributes specified by the +additional options. +If no other options are supplied with -p, declare will display +the attributes and values of all shell variables. The -f option +will restrict the display to shell functions. +The +-F + +option inhibits the display of function definitions; only the +function name and attributes are printed. +If the extdebug shell option is enabled using shopt, +the source file name and line number where the function is defined +are displayed as well. The +-F + +option implies +-f. + +The +-g + +option forces variables to be created or modified at the global scope, +even when declare is executed in a shell function. +It is ignored in all other cases. +The following options can +be used to restrict output to variables with the specified attribute or +to give variables attributes: +
+ +
+
-a + +
+Each name is an indexed array variable (see +Arrays + +above). +
-A + +
+Each name is an associative array variable (see +Arrays + +above). +
-f + +
+Use function names only. +
-i + +
+The variable is treated as an integer; arithmetic evaluation (see +ARITHMETIC EVALUATION + + +above) is performed when the variable is assigned a value. +
-l + +
+When the variable is assigned a value, all upper-case characters are +converted to lower-case. +The upper-case attribute is disabled. +
-n + +
+Give each name the nameref attribute, making +it a name reference to another variable. +That other variable is defined by the value of name. +All references and assignments to name, except for changing the +-n attribute itself, are performed on the variable referenced by +name's value. +The -n attribute cannot be applied to array variables. +
-r + +
+Make names readonly. These names cannot then be assigned values +by subsequent assignment statements or unset. +
-t + +
+Give each name the trace attribute. +Traced functions inherit the DEBUG and RETURN traps from +the calling shell. +The trace attribute has no special meaning for variables. +
-u + +
+When the variable is assigned a value, all lower-case characters are +converted to upper-case. +The lower-case attribute is disabled. +
-x + +
+Mark names for export to subsequent commands via the environment. + +
+

+ +Using `+' instead of `-' +turns off the attribute instead, +with the exceptions that +a +may not be used to destroy an array variable and +r will not +remove the readonly attribute. +When used in a function, +declare + +and +typeset + +make each +name local, as with the +local + +command, +unless the -g option is supplied. +If a variable name is followed by =value, the value of +the variable is set to value. +When using -a or -A and the compound assignment syntax to +create array variables, additional attributes do not take effect until +subsequent assignments. +The return value is 0 unless an invalid option is encountered, +an attempt is made to define a function using + +-f foo=bar, +an attempt is made to assign a value to a readonly variable, +an attempt is made to assign a value to an array variable without +using the compound assignment syntax (see +Arrays + +above), one of the names is not a valid shell variable name, +an attempt is made to turn off readonly status for a readonly variable, +an attempt is made to turn off array status for an array variable, +or an attempt is made to display a non-existent function with -f. +

+ +
dirs [-clpv] [+n] [-n] + +
+Without options, displays the list of currently remembered directories. +The default display is on a single line with directory names separated +by spaces. +Directories are added to the list with the +pushd + +command; the +popd + +command removes entries from the list. +
+ +
+
-c + +
+Clears the directory stack by deleting all of the entries. +
-l + +
+Produces a listing using full pathnames; +the default listing format uses a tilde to denote the home directory. +
-p + +
+Print the directory stack with one entry per line. +
-v + +
+Print the directory stack with one entry per line, +prefixing each entry with its index in the stack. +
+n
+Displays the nth entry counting from the left of the list +shown by +dirs + +when invoked without options, starting with zero. +
-n
+Displays the nth entry counting from the right of the list +shown by +dirs + +when invoked without options, starting with zero. + +
+

+ +The return value is 0 unless an +invalid option is supplied or n indexes beyond the end +of the directory stack. +

+ +
disown [-ar] [-h] [jobspec ...]
+Without options, remove each +jobspec + +from the table of active jobs. +If +jobspec + +is not present, and neither the -a nor the -r option +is supplied, the current job is used. +If the -h option is given, each +jobspec + +is not removed from the table, but is marked so that +SIGHUP + + +is not sent to the job if the shell receives a +SIGHUP. + + +If no +jobspec + +is supplied, the +-a + +option means to remove or mark all jobs; the +-r + +option without a +jobspec + +argument restricts operation to running jobs. +The return value is 0 unless a +jobspec + +does not specify a valid job. +
echo [-neE] [arg ...]
+Output the args, separated by spaces, followed by a newline. +The return status is 0 unless a write error occurs. +If -n is specified, the trailing newline is +suppressed. If the -e option is given, interpretation of +the following backslash-escaped characters is enabled. The +-E + +option disables the interpretation of these escape characters, +even on systems where they are interpreted by default. +The xpg_echo shell option may be used to +dynamically determine whether or not echo expands these +escape characters by default. +echo + +does not interpret -- to mean the end of options. +echo + +interprets the following escape sequences: +
+ +
+
\a + +
+alert (bell) +
\b + +
+backspace +
\c + +
+suppress further output +
\e + +
+
\E + +
+an escape character +
\f + +
+form feed +
\n + +
+new line +
\r + +
+carriage return +
\t + +
+horizontal tab +
\v + +
+vertical tab +
\\ + +
+backslash +
\0nnn + +
+the eight-bit character whose value is the octal value nnn +(zero to three octal digits) +
\xHH + +
+the eight-bit character whose value is the hexadecimal value HH +(one or two hex digits) +
\uHHHH + +
+the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +HHHH (one to four hex digits) +
\UHHHHHHHH + +
+the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +HHHHHHHH (one to eight hex digits) + +
+ +
enable [-a] [-dnps] [-f filename] [name ...]
+Enable and disable builtin shell commands. +Disabling a builtin allows a disk command which has the same name +as a shell builtin to be executed without specifying a full pathname, +even though the shell normally searches for builtins before disk commands. +If -n is used, each name +is disabled; otherwise, +names are enabled. For example, to use the +test + +binary found via the +PATH + + +instead of the shell builtin version, run +enable -n test. + +The +-f + +option means to load the new builtin command +name + +from shared object +filename, + +on systems that support dynamic loading. The +-d + +option will delete a builtin previously loaded with +-f. + +If no name arguments are given, or if the +-p + +option is supplied, a list of shell builtins is printed. +With no other option arguments, the list consists of all enabled +shell builtins. +If -n is supplied, only disabled builtins are printed. +If -a is supplied, the list printed includes all builtins, with an +indication of whether or not each is enabled. +If -s is supplied, the output is restricted to the POSIX +special builtins. +The return value is 0 unless a +name + +is not a shell builtin or there is an error loading a new builtin +from a shared object. +
eval [arg ...]
+The args are read and concatenated together into a single +command. This command is then read and executed by the shell, and +its exit status is returned as the value of +eval. + +If there are no +args, + +or only null arguments, +eval + +returns 0. +
exec [-cl] [-a name] [command [arguments]]
+If +command + +is specified, it replaces the shell. +No new process is created. The +arguments + +become the arguments to command. +If the +-l + +option is supplied, +the shell places a dash at the beginning of the zeroth argument passed to +command. + +This is what +login(1) + +does. The +-c + +option causes +command + +to be executed with an empty environment. If +-a + +is supplied, the shell passes +name + +as the zeroth argument to the executed command. +If +command + +cannot be executed for some reason, a non-interactive shell exits, +unless the +execfail + +shell option +is enabled. In that case, it returns failure. +An interactive shell returns failure if the file cannot be executed. +If +command + +is not specified, any redirections take effect in the current shell, +and the return status is 0. If there is a redirection error, the +return status is 1. +
exit [n]
+Cause the shell to exit +with a status of n. If +n + +is omitted, the exit status +is that of the last command executed. +A trap on +EXIT + + +is executed before the shell terminates. +
export [-fn] [name[=word]] ...
+ +
export -p + +
+ +The supplied +names + +are marked for automatic export to the environment of +subsequently executed commands. If the +-f + +option is given, +the +names + +refer to functions. +If no +names + +are given, or if the +-p + +option is supplied, a list +of names of all exported variables is printed. +The +-n + +option causes the export property to be removed from each +name. +If a variable name is followed by =word, the value of +the variable is set to word. +export + +returns an exit status of 0 unless an invalid option is +encountered, +one of the names is not a valid shell variable name, or +-f + +is supplied with a +name + +that is not a function. +
fc [-e ename] [-lnr] [first] [last]
+ +
fc -s [pat=rep] [cmd]
+ +The first form selects a range of commands from +first + +to +last + +from the history list and displays or edits and re-executes them. +First + +and +last + +may be specified as a string (to locate the last command beginning +with that string) or as a number (an index into the history list, +where a negative number is used as an offset from the current +command number). If +last + +is not specified it is set to +the current command for listing (so that + +fc -l -10 +prints the last 10 commands) and to +first + +otherwise. +If +first + +is not specified it is set to the previous +command for editing and -16 for listing. +

+The +-n + +option suppresses +the command numbers when listing. The +-r + +option reverses the order of +the commands. If the +-l + +option is given, +the commands are listed on +standard output. Otherwise, the editor given by +ename + +is invoked +on a file containing those commands. If +ename + +is not given, the +value of the +FCEDIT + + +variable is used, and +the value of +EDITOR + + +if +FCEDIT + + +is not set. If neither variable is set, + +vi + +is used. When editing is complete, the edited commands are +echoed and executed. +

+In the second form, command is re-executed after each instance +of pat is replaced by rep. +Command is intepreted the same as first above. +A useful alias to use with this is + +r='fc -s', +so that typing + +r cc +runs the last command beginning with + +cc +and typing + +r +re-executes the last command. +

+If the first form is used, the return value is 0 unless an invalid +option is encountered or +first + +or +last + +specify history lines out of range. +If the +-e + +option is supplied, the return value is the value of the last +command executed or failure if an error occurs with the temporary +file of commands. If the second form is used, the return status +is that of the command re-executed, unless +cmd + +does not specify a valid history line, in which case +fc + +returns failure. +

fg [jobspec]
+Resume +jobspec + +in the foreground, and make it the current job. +If +jobspec + +is not present, the shell's notion of the current job is used. +The return value is that of the command placed into the foreground, +or failure if run when job control is disabled or, when run with +job control enabled, if +jobspec + +does not specify a valid job or +jobspec + +specifies a job that was started without job control. +
getopts optstring name [args]
+getopts + +is used by shell procedures to parse positional parameters. +optstring + +contains the option characters to be recognized; if a character +is followed by a colon, the option is expected to have an +argument, which should be separated from it by white space. +The colon and question mark characters may not be used as +option characters. +Each time it is invoked, +getopts + +places the next option in the shell variable +name, + +initializing +name + +if it does not exist, +and the index of the next argument to be processed into the +variable +OPTIND. + + +OPTIND + + +is initialized to 1 each time the shell or a shell script +is invoked. When an option requires an argument, +getopts + +places that argument into the variable +OPTARG. + + +The shell does not reset +OPTIND + + +automatically; it must be manually reset between multiple +calls to +getopts + +within the same shell invocation if a new set of parameters +is to be used. +

+When the end of options is encountered, getopts exits with a +return value greater than zero. +OPTIND + + +is set to the index of the first non-option argument, +and name is set to ?. +

+getopts + +normally parses the positional parameters, but if more arguments are +given in +args, + +getopts + +parses those instead. +

+getopts + +can report errors in two ways. If the first character of +optstring + +is a colon, +silent + +error reporting is used. In normal operation, diagnostic messages +are printed when invalid options or missing option arguments are +encountered. +If the variable +OPTERR + + +is set to 0, no error messages will be displayed, even if the first +character of +optstring + +is not a colon. +

+If an invalid option is seen, +getopts + +places ? into +name + +and, if not silent, +prints an error message and unsets +OPTARG. + + +If +getopts + +is silent, +the option character found is placed in +OPTARG + + +and no diagnostic message is printed. +

+If a required argument is not found, and +getopts + +is not silent, +a question mark (?) is placed in +name, + +OPTARG + + +is unset, and a diagnostic message is printed. +If +getopts + +is silent, then a colon (:) is placed in +name + +and +OPTARG + + +is set to the option character found. +

+getopts + +returns true if an option, specified or unspecified, is found. +It returns false if the end of options is encountered or an +error occurs. +

hash [-lr] [-p filename] [-dt] [name]
+Each time hash is invoked, +the full pathname of the command +name + +is determined by searching +the directories in +$PATH + +and remembered. Any previously-remembered pathname is discarded. +If the +-p + +option is supplied, no path search is performed, and +filename + +is used as the full filename of the command. +The +-r + +option causes the shell to forget all +remembered locations. +The +-d + +option causes the shell to forget the remembered location of each name. +If the +-t + +option is supplied, the full pathname to which each name corresponds +is printed. If multiple name arguments are supplied with -t, +the name is printed before the hashed full pathname. +The +-l + +option causes output to be displayed in a format that may be reused as input. +If no arguments are given, or if only -l is supplied, +information about remembered commands is printed. +The return status is true unless a +name + +is not found or an invalid option is supplied. +
help [-dms] [pattern]
+Display helpful information about builtin commands. If +pattern + +is specified, +help + +gives detailed help on all commands matching +pattern; + +otherwise help for all the builtins and shell control structures +is printed. +
+ +
+
-d + +
+Display a short description of each pattern +
-m + +
+Display the description of each pattern in a manpage-like format +
-s + +
+Display only a short usage synopsis for each pattern + +
+

+ +The return status is 0 unless no command matches +pattern. + +

+ +
history [n]
+ +
history -c
+
history -d offset
+
history -anrw [filename]
+
history -p arg [arg ...]
+
history -s arg [arg ...]
+ +With no options, display the command +history list with line numbers. Lines listed +with a +* + +have been modified. An argument of +n + +lists only the last +n + +lines. +If the shell variable +HISTTIMEFORMAT + + +is set and not null, +it is used as a format string for strftime(3) to display +the time stamp associated with each displayed history entry. +No intervening blank is printed between the formatted time stamp +and the history line. +If filename is supplied, it is used as the +name of the history file; if not, the value of +HISTFILE + + +is used. Options, if supplied, have the following meanings: +
+ +
+
-c + +
+Clear the history list by deleting all the entries. +
-d offset
+Delete the history entry at position offset. +
-a + +
+Append the ``new'' history lines (history lines entered since the +beginning of the current bash session) to the history file. +
-n + +
+Read the history lines not already read from the history +file into the current history list. These are lines +appended to the history file since the beginning of the +current bash session. +
-r + +
+Read the contents of the history file +and append them to the current history list. +
-w + +
+Write the current history list to the history file, overwriting the +history file's contents. +
-p + +
+Perform history substitution on the following args and display +the result on the standard output. +Does not store the results in the history list. +Each arg must be quoted to disable normal history expansion. +
-s + +
+Store the +args + +in the history list as a single entry. The last command in the +history list is removed before the +args + +are added. + +
+

+ +If the +HISTTIMEFORMAT + + +variable is set, the time stamp information +associated with each history entry is written to the history file, +marked with the history comment character. +When the history file is read, lines beginning with the history +comment character followed immediately by a digit are interpreted +as timestamps for the previous history line. +The return value is 0 unless an invalid option is encountered, an +error occurs while reading or writing the history file, an invalid +offset is supplied as an argument to -d, or the +history expansion supplied as an argument to -p fails. +

+ +
jobs [-lnprs] [ jobspec ... ]
+ +
jobs -x command [ args ... ]
+ +The first form lists the active jobs. The options have the following +meanings: +
+ +
+
-l + +
+List process IDs +in addition to the normal information. +
-n + +
+Display information only about jobs that have changed status since +the user was last notified of their status. +
-p + +
+List only the process ID of the job's process group +leader. +
-r + +
+Display only running jobs. +
-s + +
+Display only stopped jobs. + +
+

+ +If +jobspec + +is given, output is restricted to information about that job. +The return status is 0 unless an invalid option is encountered +or an invalid +jobspec + +is supplied. +

+ +If the +-x + +option is supplied, +jobs + +replaces any +jobspec + +found in +command + +or +args + +with the corresponding process group ID, and executes +command + +passing it +args, + +returning its exit status. +

+ +
kill [-s sigspec | -n signum | -sigspec] [pid | jobspec] ...
+ +
kill -l [sigspec | exit_status]
+ +Send the signal named by +sigspec + +or +signum + +to the processes named by +pid + +or +jobspec. + +sigspec + +is either a case-insensitive signal name such as +SIGKILL + + +(with or without the +SIG + + +prefix) or a signal number; +signum + +is a signal number. +If +sigspec + +is not present, then +SIGTERM + + +is assumed. +An argument of +-l + +lists the signal names. +If any arguments are supplied when +-l + +is given, the names of the signals corresponding to the arguments are +listed, and the return status is 0. +The exit_status argument to +-l + +is a number specifying either a signal number or the exit status of +a process terminated by a signal. +kill + +returns true if at least one signal was successfully sent, or false +if an error occurs or an invalid option is encountered. +
let arg [arg ...]
+Each +arg + +is an arithmetic expression to be evaluated (see +ARITHMETIC EVALUATION + + +above). +If the last +arg + +evaluates to 0, +let + +returns 1; 0 is returned otherwise. +
local [option] [name[=value] ...]
+For each argument, a local variable named +name + +is created, and assigned +value. + +The option can be any of the options accepted by declare. +When +local + +is used within a function, it causes the variable +name + +to have a visible scope restricted to that function and its children. +With no operands, +local + +writes a list of local variables to the standard output. It is +an error to use +local + +when not within a function. The return status is 0 unless +local + +is used outside a function, an invalid +name + +is supplied, or +name is a readonly variable. +
logout + +
+Exit a login shell. +
mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]
+ +
readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]
+ +Read lines from the standard input into the indexed array variable +array, + +or from file descriptor +fd + +if the +-u + +option is supplied. +The variable +MAPFILE + + +is the default array. +Options, if supplied, have the following meanings: +
+ +
+
-n + +
+Copy at most +count + +lines. If count is 0, all lines are copied. +
-O + +
+Begin assigning to +array + +at index +origin. + +The default index is 0. +
-s + +
+Discard the first count lines read. +
-t + +
+Remove a trailing newline from each line read. +
-u + +
+Read lines from file descriptor fd instead of the standard input. +
-C + +
+Evaluate +callback + +each time quantum lines are read. The -c option specifies +quantum. + +
-c + +
+Specify the number of lines read between each call to +callback. + + +
+

+ +If +-C + +is specified without +-c, + +the default quantum is 5000. +When callback is evaluated, it is supplied the index of the next +array element to be assigned and the line to be assigned to that element +as additional arguments. +callback is evaluated after the line is read but before the +array element is assigned. +

+ +If not supplied with an explicit origin, mapfile will clear array +before assigning to it. +

+ +mapfile returns successfully unless an invalid option or option +argument is supplied, array is invalid or unassignable, or if +array is not an indexed array. +

+ +
popd [-n] [+n] [-n]
+Removes entries from the directory stack. With no arguments, +removes the top directory from the stack, and performs a +cd + +to the new top directory. +Arguments, if supplied, have the following meanings: +
+ +
+
-n + +
+Suppresses the normal change of directory when removing directories +from the stack, so that only the stack is manipulated. +
+n
+Removes the nth entry counting from the left of the list +shown by +dirs, + +starting with zero. For example: + +popd +0 +removes the first directory, + +popd +1 +the second. +
-n
+Removes the nth entry counting from the right of the list +shown by +dirs, + +starting with zero. For example: + +popd -0 +removes the last directory, + +popd -1 +the next to last. + +
+

+ +If the +popd + +command is successful, a +dirs + +is performed as well, and the return status is 0. +popd + +returns false if an invalid option is encountered, the directory stack +is empty, a non-existent directory stack entry is specified, or the +directory change fails. +

+ +
printf [-v var] format [arguments]
+Write the formatted arguments to the standard output under the +control of the format. +The -v option causes the output to be assigned to the variable +var rather than being printed to the standard output. +

+The format is a character string which contains three types of objects: +plain characters, which are simply copied to standard output, character +escape sequences, which are converted and copied to the standard output, and +format specifications, each of which causes printing of the next successive +argument. +In addition to the standard printf(1) format specifications, +printf interprets the following extensions: +

+ +
+
%b + +
+causes +printf to expand backslash escape sequences in the corresponding +argument (except that \c terminates output, backslashes in +\aq, \", and \? are not removed, and octal escapes +beginning with \0 may contain up to four digits). +
%q + +
+causes printf to output the corresponding +argument in a format that can be reused as shell input. +
%(datefmt)T + +
+causes printf to output the date-time string resulting from using +datefmt as a format string for strftime(3). +The corresponding argument is an integer representing the number of +seconds since the epoch. +Two special argument values may be used: -1 represents the current +time, and -2 represents the time the shell was invoked. +If no argument is specified, conversion behaves as if -1 had been given. +This is an exception to the usual printf behavior. + +
+

+ +Arguments to non-string format specifiers are treated as C constants, +except that a leading plus or minus sign is allowed, and if the leading +character is a single or double quote, the value is the ASCII value of +the following character. +

+ +The format is reused as necessary to consume all of the arguments. +If the format requires more arguments than are supplied, the +extra format specifications behave as if a zero value or null string, as +appropriate, had been supplied. +The return value is zero on success, non-zero on failure. +

+ +
pushd [-n] [+n] [-n]
+ +
pushd [-n] [dir]
+ +Adds a directory to the top of the directory stack, or rotates +the stack, making the new top of the stack the current working +directory. With no arguments, exchanges the top two directories +and returns 0, unless the directory stack is empty. +Arguments, if supplied, have the following meanings: +
+ +
+
-n + +
+Suppresses the normal change of directory when adding directories +to the stack, so that only the stack is manipulated. +
+n
+Rotates the stack so that the nth directory +(counting from the left of the list shown by +dirs, + +starting with zero) +is at the top. +
-n
+Rotates the stack so that the nth directory +(counting from the right of the list shown by +dirs, + +starting with zero) is at the top. +
dir + +
+Adds +dir + +to the directory stack at the top, making it the +new current working directory as if it had been supplied as the argument +to the cd builtin. + +
+

+ +If the +pushd + +command is successful, a +dirs + +is performed as well. +If the first form is used, +pushd + +returns 0 unless the cd to +dir + +fails. With the second form, +pushd + +returns 0 unless the directory stack is empty, +a non-existent directory stack element is specified, +or the directory change to the specified new current directory +fails. +

+ +
pwd [-LP]
+Print the absolute pathname of the current working directory. +The pathname printed contains no symbolic links if the +-P + +option is supplied or the +-o physical + +option to the +set + +builtin command is enabled. +If the +-L + +option is used, the pathname printed may contain symbolic links. +The return status is 0 unless an error occurs while +reading the name of the current directory or an +invalid option is supplied. +
read [-ers] [-a aname] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]
+One line is read from the standard input, or from the file descriptor +fd supplied as an argument to the -u option, and the first word +is assigned to the first +name, + +the second word to the second +name, + +and so on, with leftover words and their intervening separators assigned +to the last +name. + +If there are fewer words read from the input stream than names, +the remaining names are assigned empty values. +The characters in +IFS + + +are used to split the line into words using the same rules the shell +uses for expansion (described above under Word Splitting). +The backslash character (\) may be used to remove any special +meaning for the next character read and for line continuation. +Options, if supplied, have the following meanings: +
+ +
+
-a aname + +
+The words are assigned to sequential indices +of the array variable +aname, + +starting at 0. +aname + +is unset before any new values are assigned. +Other name arguments are ignored. +
-d delim + +
+The first character of delim is used to terminate the input line, +rather than newline. +
-e + +
+If the standard input +is coming from a terminal, +readline + +(see +READLINE + + +above) is used to obtain the line. +Readline uses the current (or default, if line editing was not previously +active) editing settings. +
-i text + +
+If +readline + +is being used to read the line, text is placed into the editing +buffer before editing begins. +
-n nchars + +
+read returns after reading nchars characters rather than +waiting for a complete line of input, but honor a delimiter if fewer +than nchars characters are read before the delimiter. +
-N nchars + +
+read returns after reading exactly nchars characters rather +than waiting for a complete line of input, unless EOF is encountered or +read times out. +Delimiter characters encountered in the input are +not treated specially and do not cause read to return until +nchars characters are read. +
-p prompt + +
+Display prompt on standard error, without a +trailing newline, before attempting to read any input. The prompt +is displayed only if input is coming from a terminal. +
-r + +
+Backslash does not act as an escape character. +The backslash is considered to be part of the line. +In particular, a backslash-newline pair may not be used as a line +continuation. +
-s + +
+Silent mode. If input is coming from a terminal, characters are +not echoed. +
-t timeout + +
+Cause read to time out and return failure if a complete line of +input (or a specified number of characters) +is not read within timeout seconds. +timeout may be a decimal number with a fractional portion following +the decimal point. +This option is only effective if read is reading input from a +terminal, pipe, or other special file; it has no effect when reading +from regular files. +If read times out, read saves any partial input read into +the specified variable name. +If timeout is 0, read returns immediately, without trying to +read any data. The exit status is 0 if input is available on +the specified file descriptor, non-zero otherwise. +The exit status is greater than 128 if the timeout is exceeded. +
-u fd + +
+Read input from file descriptor fd. + +
+

+ +If no +names + +are supplied, the line read is assigned to the variable +REPLY. + + +The return code is zero, unless end-of-file is encountered, read +times out (in which case the return code is greater than 128), +a variable assignment error (such as assigning to a readonly variable) occurs, +or an invalid file descriptor is supplied as the argument to -u. +

+ +
readonly [-aAf] [-p] [name[=word] ...]
+ +The given +names are marked readonly; the values of these +names + +may not be changed by subsequent assignment. +If the +-f + +option is supplied, the functions corresponding to the +names are so +marked. +The +-a + +option restricts the variables to indexed arrays; the +-A + +option restricts the variables to associative arrays. +If both options are supplied, +-A + +takes precedence. +If no +name + +arguments are given, or if the +-p + +option is supplied, a list of all readonly names is printed. +The other options may be used to restrict the output to a subset of +the set of readonly names. +The +-p + +option causes output to be displayed in a format that +may be reused as input. +If a variable name is followed by =word, the value of +the variable is set to word. +The return status is 0 unless an invalid option is encountered, +one of the +names + +is not a valid shell variable name, or +-f + +is supplied with a +name + +that is not a function. +
return [n]
+Causes a function to stop executing and return the value specified by +n + +to its caller. +If +n + +is omitted, the return status is that of the last command +executed in the function body. If +return + +is used outside a function, +but during execution of a script by the +. + +(source) command, it causes the shell to stop executing +that script and return either +n + +or the exit status of the last command executed within the +script as the exit status of the script. +If n is supplied, the return value is its least significant +8 bits. +The return status is non-zero if +return + +is supplied a non-numeric argument, or +is used outside a +function and not during execution of a script by . or source. +Any command associated with the RETURN trap is executed +before execution resumes after the function or script. +
set [--abefhkmnptuvxBCEHPT] [-o option-name] [arg ...]
+ +
set [+abefhkmnptuvxBCEHPT] [+o option-name] [arg ...]
+ +Without options, the name and value of each shell variable are displayed +in a format that can be reused as input +for setting or resetting the currently-set variables. +Read-only variables cannot be reset. +In posix mode, only shell variables are listed. +The output is sorted according to the current locale. +When options are specified, they set or unset shell attributes. +Any arguments remaining after option processing are treated +as values for the positional parameters and are assigned, in order, to +$1, + +$2, + +... + +$n. + +Options, if specified, have the following meanings: +
+ +
+
-a + +
+Automatically mark variables and functions which are modified or +created for export to the environment of subsequent commands. +
-b + +
+Report the status of terminated background jobs +immediately, rather than before the next primary prompt. This is +effective only when job control is enabled. +
-e + +
+Exit immediately if a +pipeline (which may consist of a single simple command), +a list, +or a compound command +(see +SHELL GRAMMAR + + +above), exits with a non-zero status. +The shell does not exit if the +command that fails is part of the command list immediately following a +while + +or +until + +keyword, +part of the test following the +if + +or +elif + +reserved words, part of any command executed in a +&& + +or +|| + +list except the command following the final && or ||, +any command in a pipeline but the last, +or if the command's return value is +being inverted with +!. + +If a compound command other than a subshell +returns a non-zero status because a command failed +while -e was being ignored, the shell does not exit. +A trap on ERR, if set, is executed before the shell exits. +This option applies to the shell environment and each subshell environment +separately (see +COMMAND EXECUTION ENVIRONMENT + + +above), and may cause +subshells to exit before executing all the commands in the subshell. +

+ + +If a compound command or shell function executes in a context +where -e is being ignored, +none of the commands executed within the compound command or function body +will be affected by the -e setting, even if -e is set +and a command returns a failure status. +If a compound command or shell function sets -e while executing in +a context where -e is ignored, that setting will not have any +effect until the compound command or the command containing the function +call completes. +

-f + +
+Disable pathname expansion. +
-h + +
+Remember the location of commands as they are looked up for execution. +This is enabled by default. +
-k + +
+All arguments in the form of assignment statements +are placed in the environment for a command, not just +those that precede the command name. +
-m + +
+Monitor mode. Job control is enabled. This option is on +by default for interactive shells on systems that support +it (see +JOB CONTROL + + +above). +All processes run in a separate process group. +When a background job completes, the shell prints a line +containing its exit status. +
-n + +
+Read commands but do not execute them. This may be used to +check a shell script for syntax errors. This is ignored by +interactive shells. +
-o option-name + +
+The option-name can be one of the following: +
+
+
allexport + +
+Same as +-a. + +
braceexpand + +
+Same as +-B. + +
emacs + +
+Use an emacs-style command line editing interface. This is enabled +by default when the shell is interactive, unless the shell is started +with the +--noediting + +option. +This also affects the editing interface used for read -e. +
errexit + +
+Same as +-e. + +
errtrace + +
+Same as +-E. + +
functrace + +
+Same as +-T. + +
hashall + +
+Same as +-h. + +
histexpand + +
+Same as +-H. + +
history + +
+Enable command history, as described above under +HISTORY. + + +This option is on by default in interactive shells. +
ignoreeof + +
+The effect is as if the shell command +IGNOREEOF=10 + +had been executed +(see +Shell Variables + +above). +
keyword + +
+Same as +-k. + +
monitor + +
+Same as +-m. + +
noclobber + +
+Same as +-C. + +
noexec + +
+Same as +-n. + +
noglob + +
+Same as +-f. + +
nolog + +
+Currently ignored. +
notify + +
+Same as +-b. + +
nounset + +
+Same as +-u. + +
onecmd + +
+Same as +-t. + +
physical + +
+Same as +-P. + +
pipefail + +
+If set, the return value of a pipeline is the value of the last +(rightmost) command to exit with a non-zero status, or zero if all +commands in the pipeline exit successfully. +This option is disabled by default. +
posix + +
+Change the behavior of +bash + +where the default operation differs +from the POSIX standard to match the standard (posix mode). +See +SEE ALSO + + +below for a reference to a document that details how posix mode affects +bash's behavior. +
privileged + +
+Same as +-p. + +
verbose + +
+Same as +-v. + +
vi + +
+Use a vi-style command line editing interface. +This also affects the editing interface used for read -e. +
xtrace + +
+Same as +-x. + +

+

+

+ +If +-o + +is supplied with no option-name, the values of the current options are +printed. +If ++o + +is supplied with no option-name, a series of +set + +commands to recreate the current option settings is displayed on +the standard output. +

+ +
-p + +
+Turn on +privileged + +mode. In this mode, the +$ENV + + +and +$BASH_ENV + + +files are not processed, shell functions are not inherited from the +environment, and the +SHELLOPTS, + + +BASHOPTS, + + +CDPATH, + + +and +GLOBIGNORE + + +variables, if they appear in the environment, are ignored. +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the -p option is not supplied, these actions +are taken and the effective user id is set to the real user id. +If the -p option is supplied at startup, the effective user id is +not reset. +Turning this option off causes the effective user +and group ids to be set to the real user and group ids. +
-t + +
+Exit after reading and executing one command. +
-u + +
+Treat unset variables and parameters other than the special +parameters "@" and "*" as an error when performing +parameter expansion. If expansion is attempted on an +unset variable or parameter, the shell prints an error message, and, +if not interactive, exits with a non-zero status. +
-v + +
+Print shell input lines as they are read. +
-x + +
+After expanding each simple command, +for command, case command, select command, or +arithmetic for command, display the expanded value of +PS4, + + +followed by the command and its expanded arguments +or associated word list. +
-B + +
+The shell performs brace expansion (see +Brace Expansion + +above). This is on by default. +
-C + +
+If set, +bash + +does not overwrite an existing file with the +>, + +>&, + +and +<> + +redirection operators. This may be overridden when +creating output files by using the redirection operator +>| + +instead of +>. + +
-E + +
+If set, any trap on ERR is inherited by shell functions, command +substitutions, and commands executed in a subshell environment. +The ERR trap is normally not inherited in such cases. +
-H + +
+Enable +! + +style history substitution. This option is on by +default when the shell is interactive. +
-P + +
+If set, the shell does not resolve symbolic links when executing +commands such as +cd + +that change the current working directory. It uses the +physical directory structure instead. By default, +bash + +follows the logical chain of directories when performing commands +which change the current directory. +
-T + +
+If set, any traps on DEBUG and RETURN are inherited by shell +functions, command substitutions, and commands executed in a +subshell environment. +The DEBUG and RETURN traps are normally not inherited +in such cases. +
-- + +
+If no arguments follow this option, then the positional parameters are +unset. Otherwise, the positional parameters are set to the +args, even if some of them begin with a +-. + +
- + +
+Signal the end of options, cause all remaining args to be +assigned to the positional parameters. The +-x + +and +-v + +options are turned off. +If there are no args, +the positional parameters remain unchanged. + +
+

+ +The options are off by default unless otherwise noted. +Using + rather than - causes these options to be turned off. +The options can also be specified as arguments to an invocation of +the shell. +The current set of options may be found in +$-. + +The return status is always true unless an invalid option is encountered. +

+ +
shift [n]
+The positional parameters from n+1 ... are renamed to +$1 + +.... + +Parameters represented by the numbers $# +down to $#-n+1 are unset. +n + +must be a non-negative number less than or equal to $#. +If +n + +is 0, no parameters are changed. +If +n + +is not given, it is assumed to be 1. +If +n + +is greater than $#, the positional parameters are not changed. +The return status is greater than zero if +n + +is greater than +$# + +or less than zero; otherwise 0. +
shopt [-pqsu] [-o] [optname ...]
+Toggle the values of settings controlling optional shell behavior. +The settings can be either those listed below, or, if the +-o + +option is used, those available with the +-o + +option to the set builtin command. +With no options, or with the +-p + +option, a list of all settable options is displayed, with +an indication of whether or not each is set. +The -p option causes output to be displayed in a form that +may be reused as input. +Other options have the following meanings: +
+ +
+
-s + +
+Enable (set) each optname. +
-u + +
+Disable (unset) each optname. +
-q + +
+Suppresses normal output (quiet mode); the return status indicates +whether the optname is set or unset. +If multiple optname arguments are given with +-q, + +the return status is zero if all optnames are enabled; non-zero +otherwise. +
-o + +
+Restricts the values of optname to be those defined for the +-o + +option to the +set + +builtin. + +
+

+ +If either +-s + +or +-u + +is used with no optname arguments, +shopt + +shows only those options which are set or unset, respectively. +Unless otherwise noted, the shopt options are disabled (unset) +by default. +

+ +The return status when listing options is zero if all optnames +are enabled, non-zero otherwise. When setting or unsetting options, +the return status is zero unless an optname is not a valid shell +option. +

+ +The list of shopt options is: +

+ + + +

+
autocd + +
+If set, a command name that is the name of a directory is executed as if +it were the argument to the cd command. +This option is only used by interactive shells. +
cdable_vars + +
+If set, an argument to the +cd + +builtin command that +is not a directory is assumed to be the name of a variable whose +value is the directory to change to. +
cdspell + +
+If set, minor errors in the spelling of a directory component in a +cd + +command will be corrected. +The errors checked for are transposed characters, +a missing character, and one character too many. +If a correction is found, the corrected filename is printed, +and the command proceeds. +This option is only used by interactive shells. +
checkhash + +
+If set, bash checks that a command found in the hash +table exists before trying to execute it. If a hashed command no +longer exists, a normal path search is performed. +
checkjobs + +
+If set, bash lists the status of any stopped and running jobs before +exiting an interactive shell. If any jobs are running, this causes +the exit to be deferred until a second exit is attempted without an +intervening command (see +JOB CONTROL + + +above). The shell always +postpones exiting if any jobs are stopped. +
checkwinsize + +
+If set, bash checks the window size after each command +and, if necessary, updates the values of +LINES + + +and +COLUMNS. + + +
cmdhist + +
+If set, +bash + +attempts to save all lines of a multiple-line +command in the same history entry. This allows +easy re-editing of multi-line commands. +
compat31 + +
+If set, +bash + +changes its behavior to that of version 3.1 with respect to quoted +arguments to the [[ conditional command's =~ operator +and locale-specific string comparison when using the [[ +conditional command's < and > operators. +Bash versions prior to bash-4.1 use ASCII collation and +strcmp(3); + +bash-4.1 and later use the current locale's collation sequence and +strcoll(3). + +
compat32 + +
+If set, +bash + +changes its behavior to that of version 3.2 with respect to +locale-specific string comparison when using the [[ +conditional command's < and > operators (see previous item). +
compat40 + +
+If set, +bash + +changes its behavior to that of version 4.0 with respect to locale-specific +string comparison when using the [[ +conditional command's < and > operators (see description of +compat31) +and the effect of interrupting a command list. +Bash versions 4.0 and later interrupt the list as if the shell received the +interrupt; previous versions continue with the next command in the list. +
compat41 + +
+If set, +bash, + +when in posix mode, treats a single quote in a double-quoted +parameter expansion as a special character. The single quotes must match +(an even number) and the characters between the single quotes are considered +quoted. This is the behavior of posix mode through version 4.1. +The default bash behavior remains as in previous versions. +
compat42 + +
+If set, +bash + +does not process the replacement string in the pattern substitution word +expansion using quote removal. +
complete_fullquote + +
+If set, +bash + +quotes all shell metacharacters in filenames and directory names when +performing completion. +If not set, +bash + +removes metacharacters such as the dollar sign from the set of +characters that will be quoted in completed filenames +when these metacharacters appear in shell variable references in words to be +completed. +This means that dollar signs in variable names that expand to directories +will not be quoted; +however, any dollar signs appearing in filenames will not be quoted, either. +This is active only when bash is using backslashes to quote completed +filenames. +This variable is set by default, which is the default bash behavior in +versions through 4.2. +
direxpand + +
+If set, +bash + +replaces directory names with the results of word expansion when performing +filename completion. This changes the contents of the readline editing +buffer. +If not set, +bash + +attempts to preserve what the user typed. +
dirspell + +
+If set, +bash + +attempts spelling correction on directory names during word completion +if the directory name initially supplied does not exist. +
dotglob + +
+If set, +bash + +includes filenames beginning with a `.' in the results of pathname +expansion. +
execfail + +
+If set, a non-interactive shell will not exit if +it cannot execute the file specified as an argument to the +exec + +builtin command. An interactive shell does not exit if +exec + +fails. +
expand_aliases + +
+If set, aliases are expanded as described above under +ALIASES. + + +This option is enabled by default for interactive shells. +
extdebug + +
+If set, behavior intended for use by debuggers is enabled: +
+
+
1. + +
+The -F option to the declare builtin displays the source +file name and line number corresponding to each function name supplied +as an argument. +
2. + +
+If the command run by the DEBUG trap returns a non-zero value, the +next command is skipped and not executed. +
3. + +
+If the command run by the DEBUG trap returns a value of 2, and the +shell is executing in a subroutine (a shell function or a shell script +executed by the . or source builtins), a call to +return is simulated. +
4. + +
+BASH_ARGC + + +and +BASH_ARGV + + +are updated as described in their descriptions above. +
5. + +
+Function tracing is enabled: command substitution, shell functions, and +subshells invoked with ( command ) inherit the +DEBUG and RETURN traps. +
6. + +
+Error tracing is enabled: command substitution, shell functions, and +subshells invoked with ( command ) inherit the +ERR trap. +
+ +
extglob + +
+If set, the extended pattern matching features described above under +Pathname Expansion are enabled. +
extquote + +
+If set, $aqstringaq and $"string" quoting is +performed within ${parameter} expansions +enclosed in double quotes. This option is enabled by default. +
failglob + +
+If set, patterns which fail to match filenames during pathname expansion +result in an expansion error. +
force_fignore + +
+If set, the suffixes specified by the +FIGNORE + + +shell variable +cause words to be ignored when performing word completion even if +the ignored words are the only possible completions. +See +SHELL VARIABLES +above for a description of +FIGNORE. + + +This option is enabled by default. +
globasciiranges + +
+If set, range expressions used in pattern matching bracket expressions (see +Pattern Matching + + +above) behave as if in the traditional C locale when performing +comparisons. That is, the current locale's collating sequence +is not taken into account, so +b + +will not collate between +A + +and +B, + +and upper-case and lower-case ASCII characters will collate together. +
globstar + +
+If set, the pattern ** used in a pathname expansion context will +match all files and zero or more directories and subdirectories. +If the pattern is followed by a /, only directories and +subdirectories match. +
gnu_errfmt + +
+If set, shell error messages are written in the standard GNU error +message format. +
histappend + +
+If set, the history list is appended to the file named by the value +of the +HISTFILE + + +variable when the shell exits, rather than overwriting the file. +
histreedit + +
+If set, and +readline + +is being used, a user is given the opportunity to re-edit a +failed history substitution. +
histverify + +
+If set, and +readline + +is being used, the results of history substitution are not immediately +passed to the shell parser. Instead, the resulting line is loaded into +the readline editing buffer, allowing further modification. +
hostcomplete + +
+If set, and +readline + +is being used, bash will attempt to perform hostname completion when a +word containing a @ is being completed (see +Completing + +under +READLINE + + +above). +This is enabled by default. +
huponexit + +
+If set, bash will send +SIGHUP + + +to all jobs when an interactive login shell exits. +
interactive_comments + +
+If set, allow a word beginning with +# + +to cause that word and all remaining characters on that +line to be ignored in an interactive shell (see +COMMENTS + + +above). This option is enabled by default. +
lastpipe + +
+If set, and job control is not active, the shell runs the last command of +a pipeline not executed in the background in the current shell environment. +
lithist + +
+If set, and the +cmdhist + +option is enabled, multi-line commands are saved to the history with +embedded newlines rather than using semicolon separators where possible. +
login_shell + +
+The shell sets this option if it is started as a login shell (see +INVOCATION + + +above). +The value may not be changed. +
mailwarn + +
+If set, and a file that bash is checking for mail has been +accessed since the last time it was checked, the message ``The mail in +mailfile has been read'' is displayed. +
no_empty_cmd_completion + +
+If set, and +readline + +is being used, +bash + +will not attempt to search the +PATH + + +for possible completions when +completion is attempted on an empty line. +
nocaseglob + +
+If set, +bash + +matches filenames in a case-insensitive fashion when performing pathname +expansion (see +Pathname Expansion + +above). +
nocasematch + +
+If set, +bash + +matches patterns in a case-insensitive fashion when performing matching +while executing case or [[ conditional commands. +
nullglob + +
+If set, +bash + +allows patterns which match no +files (see +Pathname Expansion + +above) +to expand to a null string, rather than themselves. +
progcomp + +
+If set, the programmable completion facilities (see +Programmable Completion above) are enabled. +This option is enabled by default. +
promptvars + +
+If set, prompt strings undergo +parameter expansion, command substitution, arithmetic +expansion, and quote removal after being expanded as described in +PROMPTING + + +above. This option is enabled by default. +
restricted_shell + +
+The shell sets this option if it is started in restricted mode (see +RESTRICTED SHELL + + +below). +The value may not be changed. +This is not reset when the startup files are executed, allowing +the startup files to discover whether or not a shell is restricted. +
shift_verbose + +
+If set, the +shift + +builtin prints an error message when the shift count exceeds the +number of positional parameters. +
sourcepath + +
+If set, the +source (.) builtin uses the value of +PATH + + +to find the directory containing the file supplied as an argument. +This option is enabled by default. +
xpg_echo + +
+If set, the echo builtin expands backslash-escape sequences +by default. +
+ + +
suspend [-f]
+Suspend the execution of this shell until it receives a +SIGCONT + + +signal. A login shell cannot be suspended; the +-f + +option can be used to override this and force the suspension. +The return status is 0 unless the shell is a login shell and +-f + +is not supplied, or if job control is not enabled. +
test expr
+ +
[ expr ]
+Return a status of 0 (true) or 1 (false) depending on +the evaluation of the conditional expression +expr. + +Each operator and operand must be a separate argument. +Expressions are composed of the primaries described above under +CONDITIONAL EXPRESSIONS. + + +test does not accept any options, nor does it accept and ignore +an argument of -- as signifying the end of options. +

+ + +Expressions may be combined using the following operators, listed +in decreasing order of precedence. +The evaluation depends on the number of arguments; see below. +Operator precedence is used when there are five or more arguments. +

+ +
+
! expr + +
+True if +expr + +is false. +
( expr ) + +
+Returns the value of expr. +This may be used to override the normal precedence of operators. +
expr1 -a expr2
+True if both +expr1 + +and +expr2 + +are true. +
expr1 -o expr2
+True if either +expr1 + +or +expr2 + +is true. + +
+

+ +test and [ evaluate conditional +expressions using a set of rules based on the number of arguments. +

+ + + +

+
0 arguments
+The expression is false. +
1 argument
+The expression is true if and only if the argument is not null. +
2 arguments
+If the first argument is !, the expression is true if and +only if the second argument is null. +If the first argument is one of the unary conditional operators listed above +under +CONDITIONAL EXPRESSIONS, + + +the expression is true if the unary test is true. +If the first argument is not a valid unary conditional operator, the expression +is false. +
3 arguments
+The following conditions are applied in the order listed. +If the second argument is one of the binary conditional operators listed above +under +CONDITIONAL EXPRESSIONS, + + +the result of the expression is the result of the binary test using +the first and third arguments as operands. +The -a and -o operators are considered binary operators +when there are three arguments. +If the first argument is !, the value is the negation of +the two-argument test using the second and third arguments. +If the first argument is exactly ( and the third argument is +exactly ), the result is the one-argument test of the second +argument. +Otherwise, the expression is false. +
4 arguments
+If the first argument is !, the result is the negation of +the three-argument expression composed of the remaining arguments. +Otherwise, the expression is parsed and evaluated according to +precedence using the rules listed above. +
5 or more arguments
+The expression is parsed and evaluated according to precedence +using the rules listed above. +

+ + +

+

+ +When used with test or [, the < and > operators +sort lexicographically using ASCII ordering. +

+ + +
times + +
+Print the accumulated user and system times for the shell and +for processes run from the shell. The return status is 0. +
trap [-lp] [[arg] sigspec ...]
+The command +arg + +is to be read and executed when the shell receives +signal(s) +sigspec. + +If +arg + +is absent (and there is a single sigspec) or +-, + +each specified signal is +reset to its original disposition (the value it had +upon entrance to the shell). +If +arg + +is the null string the signal specified by each +sigspec + +is ignored by the shell and by the commands it invokes. +If +arg + +is not present and +-p + +has been supplied, then the trap commands associated with each +sigspec + +are displayed. +If no arguments are supplied or if only +-p + +is given, +trap + +prints the list of commands associated with each signal. +The +-l + +option causes the shell to print a list of signal names and +their corresponding numbers. +Each +sigspec + +is either +a signal name defined in <signal.h>, or a signal number. +Signal names are case insensitive and the +SIG + + +prefix is optional. +

+ + +If a +sigspec + +is +EXIT + + +(0) the command +arg + +is executed on exit from the shell. +If a +sigspec + +is +DEBUG, + + +the command +arg + +is executed before every simple command, for command, +case command, select command, every arithmetic for +command, and before the first command executes in a shell function (see +SHELL GRAMMAR + + +above). +Refer to the description of the extdebug option to the +shopt builtin for details of its effect on the DEBUG trap. +If a +sigspec + +is +RETURN, + + +the command +arg + +is executed each time a shell function or a script executed with +the . or source builtins finishes executing. +

+ + +If a +sigspec + +is +ERR, + + +the command +arg + +is executed whenever a +a pipeline (which may consist of a single simple +command), a list, or a compound command returns a +non-zero exit status, +subject to the following conditions. +The +ERR + + +trap is not executed if the failed +command is part of the command list immediately following a +while + +or +until + +keyword, +part of the test in an +if + +statement, part of a command executed in a +&& + +or +|| + +list except the command following the final && or ||, +any command in a pipeline but the last, +or if the command's return value is +being inverted using +!. + +These are the same conditions obeyed by the errexit (-e) option. +

+ + +Signals ignored upon entry to the shell cannot be trapped or reset. +Trapped signals that are not being ignored are reset to their original +values in a subshell or subshell environment when one is created. +The return status is false if any +sigspec + +is invalid; otherwise +trap + +returns true. +

type [-aftpP] name [name ...]
+With no options, +indicate how each +name + +would be interpreted if used as a command name. +If the +-t + +option is used, +type + +prints a string which is one of +alias, + +keyword, + +function, + +builtin, + +or +file + +if +name + +is an alias, shell reserved word, function, builtin, or disk file, +respectively. +If the +name + +is not found, then nothing is printed, and an exit status of false +is returned. +If the +-p + +option is used, +type + +either returns the name of the disk file +that would be executed if +name + +were specified as a command name, +or nothing if +type -t name + +would not return +file. + +The +-P + +option forces a +PATH + + +search for each name, even if +type -t name + +would not return +file. + +If a command is hashed, +-p + +and +-P + +print the hashed value, which is not necessarily the file that appears +first in +PATH. + + +If the +-a + +option is used, +type + +prints all of the places that contain +an executable named +name. + +This includes aliases and functions, +if and only if the +-p + +option is not also used. +The table of hashed commands is not consulted +when using +-a. + +The +-f + +option suppresses shell function lookup, as with the command builtin. +type + +returns true if all of the arguments are found, false if +any are not found. +
ulimit [-HSTabcdefilmnpqrstuvx [limit]]
+Provides control over the resources available to the shell and to +processes started by it, on systems that allow such control. +The -H and -S options specify that the hard or soft limit is +set for the given resource. +A hard limit cannot be increased by a non-root user once it is set; +a soft limit may be increased up to the value of the hard limit. +If neither -H nor -S is specified, both the soft and hard +limits are set. +The value of +limit + +can be a number in the unit specified for the resource +or one of the special values +hard, + +soft, + +or +unlimited, + +which stand for the current hard limit, the current soft limit, and +no limit, respectively. +If +limit + +is omitted, the current value of the soft limit of the resource is +printed, unless the -H option is given. When more than one +resource is specified, the limit name and unit are printed before the value. +Other options are interpreted as follows: +
+ +
+
-a + +
+All current limits are reported +
-b + +
+The maximum socket buffer size +
-c + +
+The maximum size of core files created +
-d + +
+The maximum size of a process's data segment +
-e + +
+The maximum scheduling priority ("nice") +
-f + +
+The maximum size of files written by the shell and its children +
-i + +
+The maximum number of pending signals +
-l + +
+The maximum size that may be locked into memory +
-m + +
+The maximum resident set size (many systems do not honor this limit) +
-n + +
+The maximum number of open file descriptors (most systems do not +allow this value to be set) +
-p + +
+The pipe size in 512-byte blocks (this may not be set) +
-q + +
+The maximum number of bytes in POSIX message queues +
-r + +
+The maximum real-time scheduling priority +
-s + +
+The maximum stack size +
-t + +
+The maximum amount of cpu time in seconds +
-u + +
+The maximum number of processes available to a single user +
-v + +
+The maximum amount of virtual memory available to the shell and, on +some systems, to its children +
-x + +
+The maximum number of file locks +
-T + +
+The maximum number of threads + +
+

+ +If +limit + +is given, and the +-a + +option is not used, +limit is the new value of the specified resource. +If no option is given, then +-f + +is assumed. Values are in 1024-byte increments, except for +-t, + +which is in seconds; +-p, + +which is in units of 512-byte blocks; +and +-T, + +-b, + +-n, + +and +-u, + +which are unscaled values. +The return status is 0 unless an invalid option or argument is supplied, +or an error occurs while setting a new limit. +

+ +
umask [-p] [-S] [mode]
+The user file-creation mask is set to +mode. + +If +mode + +begins with a digit, it +is interpreted as an octal number; otherwise +it is interpreted as a symbolic mode mask similar +to that accepted by +chmod(1). + +If +mode + +is omitted, the current value of the mask is printed. +The +-S + +option causes the mask to be printed in symbolic form; the +default output is an octal number. +If the +-p + +option is supplied, and +mode + +is omitted, the output is in a form that may be reused as input. +The return status is 0 if the mode was successfully changed or if +no mode argument was supplied, and false otherwise. +
unalias [-a] [name ...]
+Remove each name from the list of defined aliases. If +-a + +is supplied, all alias definitions are removed. The return +value is true unless a supplied +name + +is not a defined alias. +
unset [-fv] [-n] [name ...]
+For each +name, + +remove the corresponding variable or function. +If the +-v + +option is given, each +name + +refers to a shell variable, and that variable is removed. +Read-only variables may not be unset. +If +-f + +is specified, each +name + +refers to a shell function, and the function definition +is removed. +If the +-n + +option is supplied, and name is a variable with the nameref +attribute, name will be unset rather than the variable it +references. +-n has no effect if the -f option is supplied. +If no options are supplied, each name refers to a variable; if +there is no variable by that name, any function with that name is +unset. +Each unset variable or function is removed from the environment +passed to subsequent commands. +If any of +COMP_WORDBREAKS, + + +RANDOM, + + +SECONDS, + + +LINENO, + + +HISTCMD, + + +FUNCNAME, + + +GROUPS, + + +or +DIRSTACK + + +are unset, they lose their special properties, even if they are +subsequently reset. The exit status is true unless a +name + +is readonly. +
wait [-n] [n ...]
+Wait for each specified child process and return its termination status. +Each +n + +may be a process +ID or a job specification; if a job spec is given, all processes +in that job's pipeline are waited for. If +n + +is not given, all currently active child processes +are waited for, and the return status is zero. +If the -n option is supplied, wait waits for any job to +terminate and returns its exit status. +If +n + +specifies a non-existent process or job, the return status is +127. Otherwise, the return status is the exit status of the last +process or job waited for. + + +
+  +

RESTRICTED SHELL

+ + + +

+ +If +bash + +is started with the name +rbash, + +or the +-r + +option is supplied at invocation, +the shell becomes restricted. +A restricted shell is used to +set up an environment more controlled than the standard shell. +It behaves identically to +bash + +with the exception that the following are disallowed or not performed: +

+
*
+changing directories with cd +
*
+setting or unsetting the values of +SHELL, + + +PATH, + + +ENV, + + +or +BASH_ENV + + +
*
+specifying command names containing +/ + +
*
+specifying a filename containing a +/ + +as an argument to the +. + +builtin command +
*
+specifying a filename containing a slash as an argument to the +-p + +option to the +hash + +builtin command +
*
+importing function definitions from the shell environment at startup +
*
+parsing the value of +SHELLOPTS + + +from the shell environment at startup +
*
+redirecting output using the >, >|, <>, >&, &>, and >> redirection operators +
*
+using the +exec + +builtin command to replace the shell with another command +
*
+adding or deleting builtin commands with the +-f + +and +-d + +options to the +enable + +builtin command +
*
+using the enable builtin command to enable disabled shell builtins +
*
+specifying the +-p + +option to the +command + +builtin command +
*
+turning off restricted mode with +set +r or set +o restricted. +
+

+ +These restrictions are enforced after any startup files are read. +

+ + + When a command that is found to be a shell script is executed +(see +COMMAND EXECUTION + + + +above), + +rbash + +turns off any restrictions in the shell spawned to execute the +script. + + +  +

SEE ALSO

+ + +
+
Bash Reference Manual, Brian Fox and Chet Ramey
+
The Gnu Readline Library, Brian Fox and Chet Ramey
+
The Gnu History Library, Brian Fox and Chet Ramey
+
Portable Operating System Interface (POSIX) Part 2: Shell and Utilities, IEEE --
+http://pubs.opengroup.org/onlinepubs/9699919799/ +
http://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode
+
sh(1), ksh(1), csh(1)
+
emacs(1), vi(1)
+
readline(3)
+ +
+  +

FILES

+ + +
+
+/bin/bash + +
+The bash executable +
+/etc/profile + +
+The systemwide initialization file, executed for login shells +
+~/.bash_profile + +
+The personal initialization file, executed for login shells +
+~/.bashrc + +
+The individual per-interactive-shell startup file +
+~/.bash_logout + +
+The individual login shell cleanup file, executed when a login shell exits +
+~/.inputrc + +
+Individual readline initialization file + +
+  +

AUTHORS

+ +Brian Fox, Free Software Foundation +
+ +bfox@gnu.org +

+ +Chet Ramey, Case Western Reserve University +
+ +chet.ramey@case.edu +  +

BUG REPORTS

+ +If you find a bug in +bash, + +you should report it. But first, you should +make sure that it really is a bug, and that it appears in the latest +version of +bash. + +The latest version is always available from +ftp://ftp.gnu.org/pub/gnu/bash/. +

+ +Once you have determined that a bug actually exists, use the +bashbug + +command to submit a bug report. +If you have a fix, you are encouraged to mail that as well! +Suggestions and `philosophical' bug reports may be mailed +to bug-bash@gnu.org or posted to the Usenet +newsgroup +gnu.bash.bug. + +

+ +ALL bug reports should include: +

+ + +

+
The version number of bash
+
The hardware and operating system
+
The compiler used to compile
+
A description of the bug behaviour
+
A short script or `recipe' which exercises the bug
+ +
+

+ +bashbug + +inserts the first three items automatically into the template +it provides for filing a bug report. +

+ +Comments and bug reports concerning +this manual page should be directed to +chet.ramey@case.edu. + +  +

BUGS

+ +

+ +It's too big and too slow. +

+ +There are some subtle differences between +bash + +and traditional versions of +sh, + +mostly because of the +POSIX + + +specification. +

+ +Aliases are confusing in some uses. +

+ +Shell builtin commands and functions are not stoppable/restartable. +

+ +Compound commands and command sequences of the form `a ; b ; c' +are not handled gracefully when process suspension is attempted. +When a process is stopped, the shell immediately executes the next +command in the sequence. +It suffices to place the sequence of commands between +parentheses to force it into a subshell, which may be stopped as +a unit. +

+ +Array variables may not (yet) be exported. +

+ +There may be only one active coprocess at a time. + + + +


+ + + +
GNU Bash 4.32014 February 2BASH(1) +
+
+ 

Index

+
+
NAME
+
SYNOPSIS
+
COPYRIGHT
+
DESCRIPTION
+
OPTIONS
+
ARGUMENTS
+
INVOCATION
+
DEFINITIONS
+
RESERVED WORDS
+
SHELL GRAMMAR
+
+
Simple Commands
+
Pipelines
+
Lists
+
Compound Commands
+
Coprocesses
+
Shell Function Definitions
+
+
COMMENTS
+
QUOTING
+
PARAMETERS
+
+
Positional Parameters
+
Special Parameters
+
Shell Variables
+
Arrays
+
+
EXPANSION
+
+
Brace Expansion
+
Tilde Expansion
+
Parameter Expansion
+
Command Substitution
+
Arithmetic Expansion
+
Process Substitution
+
Word Splitting
+
Pathname Expansion
+
Quote Removal
+
+
REDIRECTION
+
+
Redirecting Input
+
Redirecting Output
+
Appending Redirected Output
+
Redirecting Standard Output and Standard Error
+
Appending Standard Output and Standard Error
+
Here Documents
+
Here Strings
+
Duplicating File Descriptors
+
Moving File Descriptors
+
Opening File Descriptors for Reading and Writing
+
+
ALIASES
+
FUNCTIONS
+
ARITHMETIC EVALUATION
+
CONDITIONAL EXPRESSIONS
+
SIMPLE COMMAND EXPANSION
+
COMMAND EXECUTION
+
COMMAND EXECUTION ENVIRONMENT
+
ENVIRONMENT
+
EXIT STATUS
+
SIGNALS
+
JOB CONTROL
+
PROMPTING
+
READLINE
+
+
Readline Notation
+
Readline Initialization
+
Readline Key Bindings
+
Readline Variables
+
Readline Conditional Constructs
+
Searching
+
Readline Command Names
+
Commands for Moving
+
Commands for Manipulating the History
+
Commands for Changing Text
+
Killing and Yanking
+
Numeric Arguments
+
Completing
+
Keyboard Macros
+
Miscellaneous
+
Programmable Completion
+
+
HISTORY
+
HISTORY EXPANSION
+
+
Event Designators
+
Word Designators
+
Modifiers
+
+
SHELL BUILTIN COMMANDS
+
RESTRICTED SHELL
+
SEE ALSO
+
FILES
+
AUTHORS
+
BUG REPORTS
+
BUGS
+
+
+This document was created by man2html from bash.1.
+Time: 24 February 2014 08:28:34 EST + + diff --git a/doc/bash.pdf b/doc/bash.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fbc1fde7ac49b5a18dbaa8a5272fbf725b47e592 GIT binary patch literal 312770 zcma&NQ;;UWwr=~EZFP0A%eGxzwr$(CZQHhO+qP}H>h{`k&Usl6cSk;C#(d708Dq>Z ziDd^DY{yjD~u2Y7tdP$Dol6G+vT-P2a%4d%)$<*KP; zLCGumeTRqYo8{kte?)O#W6rWE=?V=~D3!{nYbJn=i%V!vGObSu?=;1^K4reU*0a7I zSx7dXCkbiyW}Yt(Fpp>v-&V{;vS((BvoAsnyZu{GJQ;Q}!{ErmFv9|TCtXaYA0Ea& zT~@)i3%ar1&46ttS4_O)+y8Xh`y6k6+F#6WK)FTRfJe67qn&8-^yLhgMHcV3qDDI` zAj)Kddmp|7rM)BR*fX=yI1VhPXmoWC=3q&roq%gg7ANi*AY7@kO;mOfLfqe< zczVXx>F;rkY@k!OmA;^?ju+^ib1@A)R}=pHVUn6Be<+nnMkwr<7@LvGPRMXy*czCS zUhb74QG6XP`!LVS8=D!eRBzL9n2ngoh-hhGeOP;1D&TSVzAOOrW6JIkuChJ5-S>jk zn|H!JXwkwdoJo1)EW-VLGljn13fP-qAe~<*oGiD>v2u`C)Y`tx!2U*nALWRjU@GJ~ z>tnSRT$0Xl$Z{^5h-ZR23{cuRs#@RV zD54YrEPe#*X}Zp%L% zi)d|H3w_K$ddqLY1L8W)CA$HB7JgKbAvNson_S@5h=>&UU)Y+&nG9*cNMMN(ndrHV zlO+`$m1D}P+guf)f?D;}D%>16u;8O2F4YgtOQ;`yArLJ03FL}h({r5)fkt%(yTire z$zK2lMQ1c42onk_Wcb63H@}-<4u4teuw7}gUFI=$tIsbj8cTGSeJGa3U~pd_MVyy1 z7DUkx_pe_0a{BRvjZY@HV$eMxFF# zLM1J!qxH(YI1n)OLGumj88?_TFFc%LZ9kM^0!%{iAXHOQ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 --- /dev/null +++ b/doc/bash.ps @@ -0,0 +1,8914 @@ +%!PS-Adobe-3.0 +%%Creator: groff version 1.19.2 +%%CreationDate: Tue Feb 11 10:59:21 2014 +%%DocumentNeededResources: font Times-Roman +%%+ font Times-Bold +%%+ font Times-Italic +%%+ font Courier +%%+ font Symbol +%%DocumentSuppliedResources: procset grops 1.19 2 +%%Pages: 75 +%%PageOrder: Ascend +%%DocumentMedia: Default 612 792 0 () () +%%Orientation: Portrait +%%EndComments +%%BeginDefaults +%%PageMedia: Default +%%EndDefaults +%%BeginProlog +%%BeginResource: procset grops 1.19 2 +%!PS-Adobe-3.0 Resource-ProcSet +/setpacking where{ +pop +currentpacking +true setpacking +}if +/grops 120 dict dup begin +/SC 32 def +/A/show load def +/B{0 SC 3 -1 roll widthshow}bind def +/C{0 exch ashow}bind def +/D{0 exch 0 SC 5 2 roll awidthshow}bind def +/E{0 rmoveto show}bind def +/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def +/G{0 rmoveto 0 exch ashow}bind def +/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/I{0 exch rmoveto show}bind def +/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def +/K{0 exch rmoveto 0 exch ashow}bind def +/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/M{rmoveto show}bind def +/N{rmoveto 0 SC 3 -1 roll widthshow}bind def +/O{rmoveto 0 exch ashow}bind def +/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/Q{moveto show}bind def +/R{moveto 0 SC 3 -1 roll widthshow}bind def +/S{moveto 0 exch ashow}bind def +/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/SF{ +findfont exch +[exch dup 0 exch 0 exch neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/MF{ +findfont +[5 2 roll +0 3 1 roll +neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/level0 0 def +/RES 0 def +/PL 0 def +/LS 0 def +/MANUAL{ +statusdict begin/manualfeed true store end +}bind def +/PLG{ +gsave newpath clippath pathbbox grestore +exch pop add exch pop +}bind def +/BP{ +/level0 save def +1 setlinecap +1 setlinejoin +72 RES div dup scale +LS{ +90 rotate +}{ +0 PL translate +}ifelse +1 -1 scale +}bind def +/EP{ +level0 restore +showpage +}def +/DA{ +newpath arcn stroke +}bind def +/SN{ +transform +.25 sub exch .25 sub exch +round .25 add exch round .25 add exch +itransform +}bind def +/DL{ +SN +moveto +SN +lineto stroke +}bind def +/DC{ +newpath 0 360 arc closepath +}bind def +/TM matrix def +/DE{ +TM currentmatrix pop +translate scale newpath 0 0 .5 0 360 arc closepath +TM setmatrix +}bind def +/RC/rcurveto load def +/RL/rlineto load def +/ST/stroke load def +/MT/moveto load def +/CL/closepath load def +/Fr{ +setrgbcolor fill +}bind def +/setcmykcolor where{ +pop +/Fk{ +setcmykcolor fill +}bind def +}if +/Fg{ +setgray fill +}bind def +/FL/fill load def +/LW/setlinewidth load def +/Cr/setrgbcolor load def +/setcmykcolor where{ +pop +/Ck/setcmykcolor load def +}if +/Cg/setgray load def +/RE{ +findfont +dup maxlength 1 index/FontName known not{1 add}if dict begin +{ +1 index/FID ne{def}{pop pop}ifelse +}forall +/Encoding exch def +dup/FontName exch def +currentdict end definefont pop +}bind def +/DEFS 0 def +/EBEGIN{ +moveto +DEFS begin +}bind def +/EEND/end load def +/CNT 0 def +/level1 0 def +/PBEGIN{ +/level1 save def +translate +div 3 1 roll div exch scale +neg exch neg exch translate +0 setgray +0 setlinecap +1 setlinewidth +0 setlinejoin +10 setmiterlimit +[]0 setdash +/setstrokeadjust where{ +pop +false setstrokeadjust +}if +/setoverprint where{ +pop +false setoverprint +}if +newpath +/CNT countdictstack def +userdict begin +/showpage{}def +/setpagedevice{}def +}bind def +/PEND{ +countdictstack CNT sub{end}repeat +level1 restore +}bind def +end def +/setpacking where{ +pop +setpacking +}if +%%EndResource +%%EndProlog +%%BeginSetup +%%BeginFeature: *PageSize Default +<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice +%%EndFeature +%%IncludeResource: font Times-Roman +%%IncludeResource: font Times-Bold +%%IncludeResource: font Times-Italic +%%IncludeResource: font Courier +%%IncludeResource: font Symbol +grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 +def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron +/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent +/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen +/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon +/semicolon/less/equal/greater/question/at/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/bracketleft/backslash/bracketright/circumflex +/underscore/quoteleft/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/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft +/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl +/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut +/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash +/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen +/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft +/logicalnot/minus/registered/macron/degree/plusminus/twosuperior +/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior +/ordmasculine/guilsinglright/onequarter/onehalf/threequarters +/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE +/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex +/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis +/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn +/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla +/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis +/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash +/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def +/Courier@0 ENC0/Courier RE/Times-Italic@0 ENC0/Times-Italic RE +/Times-Bold@0 ENC0/Times-Bold RE/Times-Roman@0 ENC0/Times-Roman RE +%%EndSetup +%%Page: 1 1 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10.95/Times-Bold@0 SF -.219(NA)72 84 S(ME).219 E F0 +(bash \255 GNU Bourne-Ag)108 96 Q(ain SHell)-.05 E F1(SYNOPSIS)72 112.8 +Q/F2 10/Times-Bold@0 SF(bash)108 124.8 Q F0 +([options] [command_string | \214le])2.5 E F1(COPYRIGHT)72 141.6 Q F0 +(Bash is Cop)108 153.6 Q(yright \251 1989-2013 by the Free Softw)-.1 E +(are F)-.1 E(oundation, Inc.)-.15 E F1(DESCRIPTION)72 170.4 Q F2(Bash) +108 182.4 Q F0 .973(is an)3.474 F F2(sh)3.473 E F0 .973 +(-compatible command language interpreter that e)B -.15(xe)-.15 G .973 +(cutes commands read from the standard).15 F(input or from a \214le.)108 +194.4 Q F2(Bash)5 E F0(also incorporates useful features from the)2.5 E +/F3 10/Times-Italic@0 SF -.4(Ko)2.5 G(rn).4 E F0(and)2.5 E F3(C)2.5 E F0 +(shells \()2.5 E F2(ksh)A F0(and)2.5 E F2(csh)2.5 E F0(\).)A F2(Bash)108 +211.2 Q F0 .527(is intended to be a conformant implementation of the Sh\ +ell and Utilities portion of the IEEE POSIX)3.027 F +(speci\214cation \(IEEE Standard 1003.1\).)108 223.2 Q F2(Bash)5 E F0 +(can be con\214gured to be POSIX-conformant by def)2.5 E(ault.)-.1 E F1 +(OPTIONS)72 240 Q F0 .61(All of the)108 252 R .61 +(single-character shell options documented in the description of the) +5.61 F F2(set)3.11 E F0 -.2(bu)3.11 G .61(iltin command can be).2 F +1.284(used as options when the shell is in)108 264 R -.2(vo)-.4 G -.1 +(ke).2 G 3.785(d. In).1 F(addition,)3.785 E F2(bash)3.785 E F0 1.285 +(interprets the follo)3.785 F 1.285(wing options when it is)-.25 F(in) +108 276 Q -.2(vo)-.4 G -.1(ke).2 G(d:).1 E F2108 292.8 Q F0 .881 +(If the)39.86 F F23.381 E F0 .881(option is present, then command\ +s are read from the \214rst non-option ar)3.381 F(gument)-.18 E F3(com-) +3.38 E(mand_string)158 304.8 Q F0 5.706(.I).22 G 3.206(ft)-5.706 G .706 +(here are ar)-3.206 F .706(guments after the)-.18 F F3(command_string) +3.206 E F0 3.206(,t).22 G(he)-3.206 E 3.206(ya)-.15 G .706 +(re assigned to the posi-)-3.206 F(tional parameters, starting with)158 +316.8 Q F2($0)2.5 E F0(.)A F2108 328.8 Q F0(If the)41.52 E F2 +2.5 E F0(option is present, the shell is)2.5 E F3(inter)2.5 E +(active)-.15 E F0(.).18 E F2108 340.8 Q F0(Mak)41.52 E(e)-.1 E F2 +(bash)2.5 E F0(act as if it had been in)2.5 E -.2(vo)-.4 G -.1(ke).2 G +2.5(da).1 G 2.5(sal)-2.5 G(ogin shell \(see)-2.5 E/F4 9/Times-Bold@0 SF +(INV)2.5 E(OCA)-.405 E(TION)-.855 E F0(belo)2.25 E(w\).)-.25 E F2 +108 352.8 Q F0(If the)39.86 E F22.5 E F0 +(option is present, the shell becomes)2.5 E F3 -.37(re)2.5 G(stricted) +.37 E F0(\(see)3.27 E F4(RESTRICTED SHELL)2.5 E F0(belo)2.25 E(w\).)-.25 +E F2108 364.8 Q F0 .602(If the)40.41 F F23.102 E F0 .602 +(option is present, or if no ar)3.102 F .602 +(guments remain after option processing, then commands)-.18 F .616 +(are read from the standard input.)158 376.8 R .617(This option allo) +5.617 F .617(ws the positional parameters to be set when)-.25 F(in)158 +388.8 Q -.2(vo)-.4 G(king an interacti).2 E .3 -.15(ve s)-.25 H(hell.) +.15 E F2108 400.8 Q F0 3.184(Al)37.08 G .684 +(ist of all double-quoted strings preceded by)-3.184 F F2($)3.184 E F0 +.684(is printed on the standard output.)3.184 F .683(These are)5.683 F +.458(the strings that are subject to language translation when the curr\ +ent locale is not)158 412.8 R F2(C)2.958 E F0(or)2.959 E F2(POSIX)2.959 +E F0(.)A(This implies the)158 424.8 Q F22.5 E F0 +(option; no commands will be e)2.5 E -.15(xe)-.15 G(cuted.).15 E F2 +([\255+]O [)108 436.8 Q F3(shopt_option)A F2(])A F3(shopt_option)158 +448.8 Q F0 1.097(is one of the shell options accepted by the)3.597 F F2 +(shopt)3.597 E F0 -.2(bu)3.597 G 1.097(iltin \(see).2 F F4 1.096 +(SHELL B)3.596 F(UIL)-.09 E(TIN)-.828 E(COMMANDS)158 460.8 Q F0(belo) +3.002 E 3.252(w\). If)-.25 F F3(shopt_option)3.253 E F0 .753 +(is present,)3.253 F F23.253 E F0 .753(sets the v)3.253 F .753 +(alue of that option;)-.25 F F2(+O)3.253 E F0(unsets)3.253 E 2.625 +(it. If)158 472.8 R F3(shopt_option)2.625 E F0 .125 +(is not supplied, the names and v)2.625 F .124 +(alues of the shell options accepted by)-.25 F F2(shopt)2.624 E F0 .505 +(are printed on the standard output.)158 484.8 R .505(If the in)5.505 F +-.2(vo)-.4 G .505(cation option is).2 F F2(+O)3.005 E F0 3.005(,t)C .506 +(he output is displayed in a)-3.005 F +(format that may be reused as input.)158 496.8 Q F2108 508.8 Q F0 +(A)38.6 E F23.364 E F0 .864 +(signals the end of options and disables further option processing.) +3.364 F(An)5.863 E 3.363(ya)-.15 G -.18(rg)-3.363 G .863(uments after) +.18 F(the)158 520.8 Q F22.5 E F0 +(are treated as \214lenames and ar)2.5 E 2.5(guments. An)-.18 F(ar)2.5 E +(gument of)-.18 E F22.5 E F0(is equi)2.5 E -.25(va)-.25 G(lent to) +.25 E F22.5 E F0(.)A F2(Bash)108 537.6 Q F0 .303 +(also interprets a number of multi-character options.)2.803 F .304 +(These options must appear on the command line)5.303 F +(before the single-character options to be recognized.)108 549.6 Q F2 +108 566.4 Q(ugger)-.2 E F0 .475(Arrange for the deb)144 +578.4 R .475(ugger pro\214le to be e)-.2 F -.15(xe)-.15 G .475 +(cuted before the shell starts.).15 F -.45(Tu)5.474 G .474(rns on e).45 +F .474(xtended deb)-.15 F(ug-)-.2 E +(ging mode \(see the description of the)144 590.4 Q F2(extdeb)2.5 E(ug) +-.2 E F0(option to the)2.5 E F2(shopt)2.5 E F0 -.2(bu)2.5 G(iltin belo) +.2 E(w\).)-.25 E F2(\255\255dump\255po\255strings)108 602.4 Q F0(Equi) +144 614.4 Q -.25(va)-.25 G(lent to).25 E F22.5 E F0 2.5(,b)C +(ut the output is in the GNU)-2.7 E F3 -.1(ge)2.5 G(tte).1 E(xt)-.2 E F2 +(po)2.5 E F0(\(portable object\) \214le format.)2.5 E F2 +(\255\255dump\255strings)108 626.4 Q F0(Equi)144 638.4 Q -.25(va)-.25 G +(lent to).25 E F22.5 E F0(.)A F2(\255\255help)108 650.4 Q F0 +(Display a usage message on standard output and e)6.26 E +(xit successfully)-.15 E(.)-.65 E F2108 662.4 Q F3 +(\214le)2.5 E F2108 674.4 Q(c\214le)-.18 E F3(\214le)2.5 E F0 +(Ex)144 686.4 Q 1.598(ecute commands from)-.15 F F3(\214le)6.008 E F0 +1.598(instead of the standard personal initialization \214le)4.278 F F3 +(~/.bashr)3.599 E(c)-.37 E F0 1.599(if the)4.409 F(shell is interacti) +144 698.4 Q .3 -.15(ve \()-.25 H(see).15 E F4(INV)2.5 E(OCA)-.405 E +(TION)-.855 E F0(belo)2.25 E(w\).)-.25 E(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(1)195.95 E 0 Cg EP +%%Page: 2 2 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(\255\255login)108 84 Q F0(Equi)144 96 Q +-.25(va)-.25 G(lent to).25 E F12.5 E F0(.)A F1(\255\255noediting) +108 112.8 Q F0(Do not use the GNU)144 124.8 Q F1 -.18(re)2.5 G(adline) +.18 E F0(library to read command lines when the shell is interacti)2.5 E +-.15(ve)-.25 G(.).15 E F1(\255\255nopr)108 141.6 Q(o\214le)-.18 E F0 +.017(Do not read either the system-wide startup \214le)144 153.6 R/F2 10 +/Times-Italic@0 SF(/etc/pr)4.183 E(o\214le)-.45 E F0 .017(or an)4.183 F +2.517(yo)-.15 G 2.517(ft)-2.517 G .017 +(he personal initialization \214les)-2.517 F F2(~/.bash_pr)144 165.6 Q +(o\214le)-.45 E F0(,).18 E F2(~/.bash_lo)2.697 E(gin)-.1 E F0 2.697(,o) +.24 G(r)-2.697 E F2(~/.pr)2.698 E(o\214le)-.45 E F0 5.198(.B).18 G 2.698 +(yd)-5.198 G(ef)-2.698 E(ault,)-.1 E F1(bash)2.698 E F0 .198 +(reads these \214les when it is in)2.698 F -.2(vo)-.4 G -.1(ke).2 G +2.698(da).1 G(s)-2.698 E 2.5(al)144 177.6 S(ogin shell \(see)-2.5 E/F3 9 +/Times-Bold@0 SF(INV)2.5 E(OCA)-.405 E(TION)-.855 E F0(belo)2.25 E(w\).) +-.25 E F1108 194.4 Q(c)-.18 E F0 1.228(Do not read and e) +5.34 F -.15(xe)-.15 G 1.228(cute the personal initialization \214le).15 +F F2(~/.bashr)3.228 E(c)-.37 E F0 1.228(if the shell is interacti)4.038 +F -.15(ve)-.25 G 6.228(.T).15 G(his)-6.228 E(option is on by def)144 +206.4 Q(ault if the shell is in)-.1 E -.2(vo)-.4 G -.1(ke).2 G 2.5(da).1 +G(s)-2.5 E F1(sh)2.5 E F0(.)A F1(\255\255posix)108 223.2 Q F0 1.782 +(Change the beha)144 235.2 R 1.782(vior of)-.2 F F1(bash)4.282 E F0 +1.782(where the def)4.282 F 1.782(ault operation dif)-.1 F 1.782 +(fers from the POSIX standard to)-.25 F .333(match the standard \()144 +247.2 R F2 .333(posix mode)B F0 2.833(\). See)B F3 .333(SEE ALSO)2.833 F +F0(belo)2.583 E 2.833(wf)-.25 G .332 +(or a reference to a document that details)-2.833 F(ho)144 259.2 Q 2.5 +(wp)-.25 G(osix mode af)-2.5 E(fects bash')-.25 E 2.5(sb)-.55 G(eha)-2.5 +E(vior)-.2 E(.)-.55 E F1108 276 Q(estricted)-.18 E F0 +(The shell becomes restricted \(see)144 288 Q F3(RESTRICTED SHELL)2.5 E +F0(belo)2.25 E(w\).)-.25 E F1108 304.8 Q(erbose)-.1 E F0(Equi) +144 316.8 Q -.25(va)-.25 G(lent to).25 E F15 E F0(.)A F1 +108 333.6 Q(ersion)-.1 E F0(Sho)144 345.6 Q 2.5(wv)-.25 G +(ersion information for this instance of)-2.65 E F1(bash)2.5 E F0 +(on the standard output and e)2.5 E(xit successfully)-.15 E(.)-.65 E/F4 +10.95/Times-Bold@0 SF(ARGUMENTS)72 362.4 Q F0 .016(If ar)108 374.4 R +.016(guments remain after option processing, and neither the)-.18 F F1 +2.516 E F0 .016(nor the)2.516 F F12.516 E F0 .016 +(option has been supplied, the \214rst)2.516 F(ar)108 386.4 Q .041(gume\ +nt is assumed to be the name of a \214le containing shell commands.)-.18 +F(If)5.041 E F1(bash)2.541 E F0 .041(is in)2.541 F -.2(vo)-.4 G -.1(ke) +.2 G 2.541(di).1 G 2.541(nt)-2.541 G .041(his f)-2.541 F(ashion,)-.1 E +F1($0)108 398.4 Q F0 .936(is set to the name of the \214le, and the pos\ +itional parameters are set to the remaining ar)3.435 F(guments.)-.18 E +F1(Bash)5.936 E F0 .234(reads and e)108 410.4 R -.15(xe)-.15 G .234 +(cutes commands from this \214le, then e).15 F(xits.)-.15 E F1(Bash) +5.234 E F0 1.334 -.55('s e)D .234(xit status is the e).4 F .233 +(xit status of the last com-)-.15 F .348(mand e)108 422.4 R -.15(xe)-.15 +G .348(cuted in the script.).15 F .348(If no commands are e)5.348 F -.15 +(xe)-.15 G .348(cuted, the e).15 F .349(xit status is 0.)-.15 F .349 +(An attempt is \214rst made to)5.349 F .254 +(open the \214le in the current directory)108 434.4 R 2.754(,a)-.65 G +.253 +(nd, if no \214le is found, then the shell searches the directories in) +-2.754 F F3 -.666(PA)2.753 G(TH)-.189 E F0(for the script.)108 446.4 Q +F4(INV)72 463.2 Q(OCA)-.493 E(TION)-1.04 E F0(A)108 475.2 Q F2(lo)2.5 E +(gin shell)-.1 E F0(is one whose \214rst character of ar)2.5 E +(gument zero is a)-.18 E F12.5 E F0 2.5(,o)C 2.5(ro)-2.5 G +(ne started with the)-2.5 E F1(\255\255login)2.5 E F0(option.)2.5 E(An) +108 492 Q F2(inter)2.814 E(active)-.15 E F0 .314 +(shell is one started without non-option ar)2.814 F .315 +(guments and without the)-.18 F F12.815 E F0 .315 +(option whose standard)2.815 F 1.5 +(input and error are both connected to terminals \(as determined by)108 +504 R F2(isatty)4 E F0 1.5(\(3\)\), or one started with the).32 F F1 +4 E F0(option.)108 516 Q F3(PS1)5.289 E F0 .289(is set and)2.539 F +F1<24ad>2.789 E F0(includes)2.789 E F1(i)2.789 E F0(if)2.789 E F1(bash) +2.789 E F0 .289(is interacti)2.789 F -.15(ve)-.25 G 2.789(,a).15 G(llo) +-2.789 E .29(wing a shell script or a startup \214le to test this)-.25 F +(state.)108 528 Q .033(The follo)108 544.8 R .033 +(wing paragraphs describe ho)-.25 F(w)-.25 E F1(bash)2.532 E F0 -.15 +(exe)2.532 G .032(cutes its startup \214les.).15 F .032(If an)5.032 F +2.532(yo)-.15 G 2.532(ft)-2.532 G .032(he \214les e)-2.532 F .032 +(xist b)-.15 F .032(ut cannot be)-.2 F(read,)108 556.8 Q F1(bash)2.599 E +F0 .099(reports an error)2.599 F 5.099(.T)-.55 G .099(ildes are e)-5.449 +F .099(xpanded in \214lenames as described belo)-.15 F 2.6(wu)-.25 G +(nder)-2.6 E F1 -.18(Ti)2.6 G .1(lde Expansion).18 F F0(in)2.6 E(the)108 +568.8 Q F3(EXP)2.5 E(ANSION)-.666 E F0(section.)2.25 E(When)108 585.6 Q +F1(bash)2.896 E F0 .396(is in)2.896 F -.2(vo)-.4 G -.1(ke).2 G 2.896(da) +.1 G 2.896(sa)-2.896 G 2.896(ni)-2.896 G(nteracti)-2.896 E .696 -.15 +(ve l)-.25 H .396(ogin shell, or as a non-interacti).15 F .695 -.15 +(ve s)-.25 H .395(hell with the).15 F F1(\255\255login)2.895 E F0 .395 +(option, it)2.895 F 1.333(\214rst reads and e)108 597.6 R -.15(xe)-.15 G +1.333(cutes commands from the \214le).15 F F2(/etc/pr)3.833 E(o\214le) +-.45 E F0 3.834(,i)C 3.834(ft)-3.834 G 1.334(hat \214le e)-3.834 F 3.834 +(xists. After)-.15 F 1.334(reading that \214le, it)3.834 F .249 +(looks for)108 609.6 R F2(~/.bash_pr)2.749 E(o\214le)-.45 E F0(,)A F2 +(~/.bash_lo)2.749 E(gin)-.1 E F0 2.749(,a)C(nd)-2.749 E F2(~/.pr)2.749 E +(o\214le)-.45 E F0 2.749(,i)C 2.749(nt)-2.749 G .249(hat order)-2.749 F +2.748(,a)-.4 G .248(nd reads and e)-2.748 F -.15(xe)-.15 G .248 +(cutes commands from).15 F .796(the \214rst one that e)108 621.6 R .796 +(xists and is readable.)-.15 F(The)5.796 E F1(\255\255nopr)3.296 E +(o\214le)-.18 E F0 .797(option may be used when the shell is started to) +3.296 F(inhibit this beha)108 633.6 Q(vior)-.2 E(.)-.55 E +(When a login shell e)108 650.4 Q(xits,)-.15 E F1(bash)2.5 E F0 +(reads and e)2.5 E -.15(xe)-.15 G(cutes commands from the \214le).15 E +F2(~/.bash_lo)2.5 E(gout)-.1 E F0 2.5(,i)C 2.5(fi)-2.5 G 2.5(te)-2.5 G +(xists.)-2.65 E 1.698(When an interacti)108 667.2 R 1.998 -.15(ve s)-.25 +H 1.698(hell that is not a login shell is started,).15 F F1(bash)4.197 E +F0 1.697(reads and e)4.197 F -.15(xe)-.15 G 1.697(cutes commands from) +.15 F F2(~/.bashr)108 679.2 Q(c)-.37 E F0 2.535(,i)C 2.535(ft)-2.535 G +.035(hat \214le e)-2.535 F 2.535(xists. This)-.15 F .036 +(may be inhibited by using the)2.535 F F12.536 E(c)-.18 E F0 +2.536(option. The)2.536 F F12.536 E(c\214le)-.18 E F2(\214le) +2.536 E F0 .036(option will)2.536 F(force)108 691.2 Q F1(bash)2.5 E F0 +(to read and e)2.5 E -.15(xe)-.15 G(cute commands from).15 E F2(\214le) +2.5 E F0(instead of)2.5 E F2(~/.bashr)2.5 E(c)-.37 E F0(.)A(When)108 708 +Q F1(bash)5.306 E F0 2.806(is started non-interacti)5.306 F -.15(ve)-.25 +G(ly).15 E 5.306(,t)-.65 G 5.306(or)-5.306 G 2.806 +(un a shell script, for e)-5.306 F 2.805(xample, it looks for the v)-.15 +F(ariable)-.25 E F3 -.27(BA)108 720 S(SH_ENV).27 E F0 1.01(in the en) +3.26 F 1.01(vironment, e)-.4 F 1.01(xpands its v)-.15 F 1.01 +(alue if it appears there, and uses the e)-.25 F 1.011(xpanded v)-.15 F +1.011(alue as the)-.25 F(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E +(2)195.95 E 0 Cg EP +%%Page: 3 3 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(name of a \214le to read and e)108 84 Q -.15(xe)-.15 G(cute.).15 +E/F1 10/Times-Bold@0 SF(Bash)5 E F0(beha)2.5 E -.15(ve)-.2 G 2.5(sa).15 +G 2.5(si)-2.5 G 2.5(ft)-2.5 G(he follo)-2.5 E(wing command were e)-.25 E +-.15(xe)-.15 G(cuted:).15 E/F2 10/Courier@0 SF +(if [ \255n "$BASH_ENV" ]; then . "$BASH_ENV"; fi)144 102 Q F0 -.2(bu) +108 120 S 2.5(tt).2 G(he v)-2.5 E(alue of the)-.25 E/F3 9/Times-Bold@0 +SF -.666(PA)2.5 G(TH)-.189 E F0 -.25(va)2.25 G +(riable is not used to search for the \214lename.).25 E(If)108 136.8 Q +F1(bash)3.417 E F0 .917(is in)3.417 F -.2(vo)-.4 G -.1(ke).2 G 3.417(dw) +.1 G .917(ith the name)-3.417 F F1(sh)3.417 E F0 3.417(,i)C 3.417(tt) +-3.417 G .917(ries to mimic the startup beha)-3.417 F .917 +(vior of historical v)-.2 F .917(ersions of)-.15 F F1(sh)3.417 E F0(as) +3.417 E .145 +(closely as possible, while conforming to the POSIX standard as well.) +108 148.8 R .145(When in)5.145 F -.2(vo)-.4 G -.1(ke).2 G 2.645(da).1 G +2.645(sa)-2.645 G 2.645(ni)-2.645 G(nteracti)-2.645 E .445 -.15(ve l) +-.25 H(ogin).15 E 1.264(shell, or a non-interacti)108 160.8 R 1.564 -.15 +(ve s)-.25 H 1.264(hell with the).15 F F1(\255\255login)3.764 E F0 1.264 +(option, it \214rst attempts to read and e)3.764 F -.15(xe)-.15 G 1.263 +(cute commands).15 F(from)108 172.8 Q/F4 10/Times-Italic@0 SF(/etc/pr) +4.142 E(o\214le)-.45 E F0(and)3.172 E F4(~/.pr)2.992 E(o\214le)-.45 E F0 +2.992(,i).18 G 2.992(nt)-2.992 G .492(hat order)-2.992 F 5.492(.T)-.55 G +(he)-5.492 E F1(\255\255nopr)2.992 E(o\214le)-.18 E F0 .493 +(option may be used to inhibit this beha)2.993 F(vior)-.2 E(.)-.55 E +.418(When in)108 184.8 R -.2(vo)-.4 G -.1(ke).2 G 2.918(da).1 G 2.918 +(sa)-2.918 G 2.918(ni)-2.918 G(nteracti)-2.918 E .718 -.15(ve s)-.25 H +.418(hell with the name).15 F F1(sh)2.918 E F0(,)A F1(bash)2.918 E F0 +.418(looks for the v)2.918 F(ariable)-.25 E F3(ENV)2.918 E/F5 9 +/Times-Roman@0 SF(,)A F0 -.15(ex)2.667 G .417(pands its v).15 F(alue) +-.25 E .171(if it is de\214ned, and uses the e)108 196.8 R .171 +(xpanded v)-.15 F .171(alue as the name of a \214le to read and e)-.25 F +-.15(xe)-.15 G 2.671(cute. Since).15 F 2.671(as)2.671 G .171(hell in) +-2.671 F -.2(vo)-.4 G -.1(ke).2 G(d).1 E(as)108 208.8 Q F1(sh)3.081 E F0 +.581(does not attempt to read and e)3.081 F -.15(xe)-.15 G .581 +(cute commands from an).15 F 3.08(yo)-.15 G .58 +(ther startup \214les, the)-3.08 F F13.08 E(c\214le)-.18 E F0 +.58(option has)3.08 F .182(no ef)108 220.8 R 2.682(fect. A)-.25 F +(non-interacti)2.682 E .482 -.15(ve s)-.25 H .182(hell in).15 F -.2(vo) +-.4 G -.1(ke).2 G 2.682(dw).1 G .182(ith the name)-2.682 F F1(sh)2.682 E +F0 .182(does not attempt to read an)2.682 F 2.683(yo)-.15 G .183 +(ther startup \214les.)-2.683 F(When in)108 232.8 Q -.2(vo)-.4 G -.1(ke) +.2 G 2.5(da).1 G(s)-2.5 E F1(sh)2.5 E F0(,)A F1(bash)2.5 E F0(enters)2.5 +E F4(posix)3.75 E F0(mode after the startup \214les are read.)3.03 E +(When)108 249.6 Q F1(bash)2.727 E F0 .226(is started in)2.727 F F4 +(posix)3.976 E F0 .226(mode, as with the)3.256 F F1(\255\255posix)2.726 +E F0 .226(command line option, it follo)2.726 F .226(ws the POSIX stan-) +-.25 F .341(dard for startup \214les.)108 261.6 R .341 +(In this mode, interacti)5.341 F .641 -.15(ve s)-.25 H .341(hells e).15 +F .341(xpand the)-.15 F F3(ENV)2.841 E F0 -.25(va)2.591 G .342 +(riable and commands are read and).25 F -.15(exe)108 273.6 S +(cuted from the \214le whose name is the e).15 E(xpanded v)-.15 E 2.5 +(alue. No)-.25 F(other startup \214les are read.)2.5 E F1(Bash)108 290.4 +Q F0 .224(attempts to determine when it is being run with its standard \ +input connected to a netw)2.724 F .223(ork connection,)-.1 F .025 +(as when e)108 302.4 R -.15(xe)-.15 G .025 +(cuted by the remote shell daemon, usually).15 F F4 -.1(rs)2.525 G(hd).1 +E F0 2.525(,o)C 2.525(rt)-2.525 G .025(he secure shell daemon)-2.525 F +F4(sshd)2.525 E F0 5.025(.I)C(f)-5.025 E F1(bash)2.525 E F0(deter)2.525 +E(-)-.2 E .134(mines it is being run in this f)108 314.4 R .134 +(ashion, it reads and e)-.1 F -.15(xe)-.15 G .133(cutes commands from) +.15 F F4(~/.bashr)2.633 E(c)-.37 E F0 2.633(,i)C 2.633(ft)-2.633 G .133 +(hat \214le e)-2.633 F .133(xists and is)-.15 F 2.869(readable. It)108 +326.4 R .369(will not do this if in)2.869 F -.2(vo)-.4 G -.1(ke).2 G +2.869(da).1 G(s)-2.869 E F1(sh)2.869 E F0 5.369(.T)C(he)-5.369 E F1 +2.869 E(c)-.18 E F0 .369 +(option may be used to inhibit this beha)2.869 F(vior)-.2 E 2.869(,a)-.4 +G(nd)-2.869 E(the)108 338.4 Q F12.919 E(c\214le)-.18 E F0 .419 +(option may be used to force another \214le to be read, b)2.919 F .419 +(ut neither)-.2 F F4 -.1(rs)2.919 G(hd).1 E F0(nor)2.919 E F4(sshd)2.919 +E F0 .418(generally in)2.919 F -.2(vo)-.4 G -.1(ke).2 G +(the shell with those options or allo)108 350.4 Q 2.5(wt)-.25 G +(hem to be speci\214ed.)-2.5 E 1.207 +(If the shell is started with the ef)108 367.2 R(fecti)-.25 E 1.507 -.15 +(ve u)-.25 H 1.208 +(ser \(group\) id not equal to the real user \(group\) id, and the).15 F +F13.708 E F0 .536(option is not supplied, no startup \214les are \ +read, shell functions are not inherited from the en)108 379.2 R .535 +(vironment, the)-.4 F F3(SHELLOPTS)108 391.2 Q F5(,)A F3 -.27(BA)2.959 G +(SHOPTS).27 E F5(,)A F3(CDP)2.959 E -.855(AT)-.666 G(H).855 E F5(,)A F0 +(and)2.959 E F3(GLOBIGNORE)3.209 E F0 -.25(va)2.959 G .709 +(riables, if the).25 F 3.209(ya)-.15 G .71(ppear in the en)-3.209 F .71 +(vironment, are)-.4 F .905(ignored, and the ef)108 403.2 R(fecti)-.25 E +1.205 -.15(ve u)-.25 H .904(ser id is set to the real user id.).15 F +.904(If the)5.904 F F13.404 E F0 .904(option is supplied at in) +3.404 F -.2(vo)-.4 G .904(cation, the).2 F(startup beha)108 415.2 Q +(vior is the same, b)-.2 E(ut the ef)-.2 E(fecti)-.25 E .3 -.15(ve u) +-.25 H(ser id is not reset.).15 E/F6 10.95/Times-Bold@0 SF(DEFINITIONS) +72 432 Q F0(The follo)108 444 Q +(wing de\214nitions are used throughout the rest of this document.)-.25 +E F1(blank)108 456 Q F0 2.5(As)11.54 G(pace or tab)-2.5 E(.)-.4 E F1 -.1 +(wo)108 468 S(rd).1 E F0 2.5(As)13.88 G +(equence of characters considered as a single unit by the shell.)-2.5 E +(Also kno)5 E(wn as a)-.25 E F1(tok)2.5 E(en)-.1 E F0(.)A F1(name)108 +480 Q F0(A)12.67 E F4(wor)3.005 E(d)-.37 E F0 .165 +(consisting only of alphanumeric characters and underscores, and be) +3.435 F .166(ginning with an alpha-)-.15 F +(betic character or an underscore.)144 492 Q(Also referred to as an)5 E +F1(identi\214er)2.5 E F0(.)A F1(metacharacter)108 504 Q F0 2.5(Ac)144 +516 S(haracter that, when unquoted, separates w)-2.5 E 2.5(ords. One)-.1 +F(of the follo)2.5 E(wing:)-.25 E F1 5(|&;\(\)<>s)144 528 S 2.5 +(pace tab)-5 F(contr)108 540 Q(ol operator)-.18 E F0(A)144 552 Q F4(tok) +2.5 E(en)-.1 E F0(that performs a control function.)2.5 E +(It is one of the follo)5 E(wing symbols:)-.25 E F1 2.5 +(|| & && ; ;; \( \) | |&)144 564 R()10 E F6(RESER)72 580.8 Q +(VED W)-.602 E(ORDS)-.11 E F4 .307(Reserved wor)108 592.8 R(ds)-.37 E F0 +.307(are w)2.807 F .307(ords that ha)-.1 F .607 -.15(ve a s)-.2 H .306 +(pecial meaning to the shell.).15 F .306(The follo)5.306 F .306(wing w) +-.25 F .306(ords are recognized as)-.1 F(reserv)108 604.8 Q .227 +(ed when unquoted and either the \214rst w)-.15 F .227 +(ord of a simple command \(see)-.1 F F3 .227(SHELL GRAMMAR)2.727 F F0 +(belo)2.477 E .227(w\) or)-.25 F(the third w)108 616.8 Q(ord of a)-.1 E +F1(case)2.5 E F0(or)2.5 E F1 -.25(fo)2.5 G(r).25 E F0(command:)2.5 E F1 +11.295(!c)144 633.6 S 8.795(ase copr)-11.295 F 8.795 +(oc do done elif else esac \214 f)-.18 F 8.795 +(or function if in select then)-.25 F 7.5(until while { } time [[ ]])144 +645.6 R F6(SHELL GRAMMAR)72 662.4 Q F1(Simple Commands)87 674.4 Q F0(A) +108 686.4 Q F4 .388(simple command)2.888 F F0 .388 +(is a sequence of optional v)2.888 F .389(ariable assignments follo)-.25 +F .389(wed by)-.25 F F1(blank)2.889 E F0 .389(-separated w)B .389 +(ords and)-.1 F .816(redirections, and terminated by a)108 698.4 R F4 +(contr)3.316 E .815(ol oper)-.45 F(ator)-.15 E F0 5.815(.T)C .815 +(he \214rst w)-5.815 F .815(ord speci\214es the command to be e)-.1 F +-.15(xe)-.15 G(cuted,).15 E(and is passed as ar)108 710.4 Q +(gument zero.)-.18 E(The remaining w)5 E(ords are passed as ar)-.1 E +(guments to the in)-.18 E -.2(vo)-.4 G -.1(ke).2 G 2.5(dc).1 G(ommand.) +-2.5 E .175(The return v)108 727.2 R .175(alue of a)-.25 F F4 .175 +(simple command)2.675 F F0 .175(is its e)2.675 F .175 +(xit status, or 128+)-.15 F F4(n)A F0 .176 +(if the command is terminated by signal)3.508 F F4(n)2.676 E F0(.).24 E +(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(3)195.95 E 0 Cg EP +%%Page: 4 4 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(Pipelines)87 84 Q F0(A)108 96 Q/F2 10 +/Times-Italic@0 SF(pipeline)2.996 E F0 .496(is a sequence of one or mor\ +e commands separated by one of the control operators)2.996 F F1(|)2.996 +E F0(or)2.996 E F1(|&)2.996 E F0 5.496(.T)C(he)-5.496 E +(format for a pipeline is:)108 108 Q([)144 124.8 Q F1(time)A F0([)2.5 E +F1A F0(]] [ ! ])A F2(command)2.5 E F0 2.5([[)2.5 G F1(|)-2.5 E/F3 +10/Symbol SFA F1(|&)A F0(])A F2(command2)2.5 E F0(... ])2.5 E .243 +(The standard output of)108 141.6 R F2(command)2.943 E F0 .244 +(is connected via a pipe to the standard input of)3.513 F F2(command2) +2.744 E F0 5.244(.T).02 G .244(his connec-)-5.244 F .643 +(tion is performed before an)108 153.6 R 3.143(yr)-.15 G .642 +(edirections speci\214ed by the command \(see)-3.143 F/F4 9/Times-Bold@0 +SF(REDIRECTION)3.142 E F0(belo)2.892 E 3.142(w\). If)-.25 F F1(|&)3.142 +E F0(is)3.142 E(used,)108 165.6 Q F2(command)3.647 E F0 2.247 -.55('s s) +D 1.147(tandard error).55 F 3.647(,i)-.4 G 3.647(na)-3.647 G 1.147 +(ddition to its standard output, is connected to)-3.647 F F2(command2) +3.648 E F0 2.248 -.55('s s)D(tandard).55 E .028 +(input through the pipe; it is shorthand for)108 177.6 R F1 .028(2>&1 |) +2.528 F F0 5.028(.T)C .028 +(his implicit redirection of the standard error to the stan-)-5.028 F +(dard output is performed after an)108 189.6 Q 2.5(yr)-.15 G +(edirections speci\214ed by the command.)-2.5 E .48 +(The return status of a pipeline is the e)108 206.4 R .48 +(xit status of the last command, unless the)-.15 F F1(pipefail)2.98 E F0 +.48(option is enabled.)2.98 F(If)108 218.4 Q F1(pipefail)2.687 E F0 .187 +(is enabled, the pipeline')2.687 F 2.687(sr)-.55 G .186 +(eturn status is the v)-2.687 F .186 +(alue of the last \(rightmost\) command to e)-.25 F .186(xit with a)-.15 +F .61(non-zero status, or zero if all commands e)108 230.4 R .611 +(xit successfully)-.15 F 5.611(.I)-.65 G 3.111(ft)-5.611 G .611 +(he reserv)-3.111 F .611(ed w)-.15 F(ord)-.1 E F1(!)3.111 E F0 .611 +(precedes a pipeline, the)5.611 F -.15(ex)108 242.4 S .55 +(it status of that pipeline is the logical ne).15 F -.05(ga)-.15 G .55 +(tion of the e).05 F .55(xit status as described abo)-.15 F -.15(ve)-.15 +G 5.55(.T).15 G .55(he shell w)-5.55 F .55(aits for)-.1 F +(all commands in the pipeline to terminate before returning a v)108 +254.4 Q(alue.)-.25 E .298(If the)108 271.2 R F1(time)2.799 E F0(reserv) +2.799 E .299(ed w)-.15 F .299(ord precedes a pipeline, the elapsed as w\ +ell as user and system time consumed by its)-.1 F -.15(exe)108 283.2 S +.14(cution are reported when the pipeline terminates.).15 F(The)5.139 E +F12.639 E F0 .139(option changes the output format to that spec-) +2.639 F .302(i\214ed by POSIX.)108 295.2 R .303(When the shell is in) +5.302 F F2 .303(posix mode)2.803 F F0 2.803(,i)C 2.803(td)-2.803 G .303 +(oes not recognize)-2.803 F F1(time)2.803 E F0 .303(as a reserv)2.803 F +.303(ed w)-.15 F .303(ord if the ne)-.1 F(xt)-.15 E(tok)108 307.2 Q .736 +(en be)-.1 F .736(gins with a `-'.)-.15 F(The)5.736 E F4(TIMEFORMA)3.236 +E(T)-.855 E F0 -.25(va)2.986 G .736 +(riable may be set to a format string that speci\214es ho).25 F 3.235 +(wt)-.25 G(he)-3.235 E 2.225 +(timing information should be displayed; see the description of)108 +319.2 R F4(TIMEFORMA)4.726 E(T)-.855 E F0(under)4.476 E F1 2.226 +(Shell V)4.726 F(ariables)-.92 E F0(belo)108 331.2 Q -.65(w.)-.25 G .85 +(When the shell is in)108 348 R F2 .85(posix mode)3.35 F F0(,)A F1(time) +3.35 E F0 .85(may be follo)3.35 F .85(wed by a ne)-.25 F 3.35(wline. In) +-.25 F .85(this case, the shell displays the)3.35 F 1.073 +(total user and system time consumed by the shell and its children.)108 +360 R(The)6.074 E F4(TIMEFORMA)3.574 E(T)-.855 E F0 -.25(va)3.324 G +1.074(riable may be).25 F +(used to specify the format of the time information.)108 372 Q +(Each command in a pipeline is e)108 388.8 Q -.15(xe)-.15 G +(cuted as a separate process \(i.e., in a subshell\).).15 E F1(Lists)87 +405.6 Q F0(A)108 417.6 Q F2(list)2.85 E F0 .35(is a sequence of one or \ +more pipelines separated by one of the operators)2.85 F F1(;)2.849 E F0 +(,)A F1(&)2.849 E F0(,)A F1(&&)2.849 E F0 2.849(,o)C(r)-2.849 E F1(||) +2.849 E F0 2.849(,a)C .349(nd option-)-2.849 F +(ally terminated by one of)108 429.6 Q F1(;)2.5 E F0(,)A F1(&)2.5 E F0 +2.5(,o)C(r)-2.5 E F1()2.5 E F0(.)A .96 +(Of these list operators,)108 446.4 R F1(&&)3.46 E F0(and)3.46 E F1(||) +3.46 E F0(ha)3.46 E 1.26 -.15(ve e)-.2 H .961(qual precedence, follo).15 +F .961(wed by)-.25 F F1(;)3.461 E F0(and)3.461 E F1(&)3.461 E F0 3.461 +(,w)C .961(hich ha)-3.461 F 1.261 -.15(ve e)-.2 H .961(qual prece-).15 F +(dence.)108 458.4 Q 2.5(As)108 475.2 S(equence of one or more ne)-2.5 E +(wlines may appear in a)-.25 E F2(list)2.5 E F0 +(instead of a semicolon to delimit commands.)2.5 E .029 +(If a command is terminated by the control operator)108 492 R F1(&)2.529 +E F0 2.529(,t)C .029(he shell e)-2.529 F -.15(xe)-.15 G .029 +(cutes the command in the).15 F F2(bac)2.528 E(kgr)-.2 E(ound)-.45 E F0 +(in)2.528 E 2.875(as)108 504 S 2.875(ubshell. The)-2.875 F .375 +(shell does not w)2.875 F .375 +(ait for the command to \214nish, and the return status is 0.)-.1 F .376 +(Commands sepa-)5.376 F .849(rated by a)108 516 R F1(;)3.349 E F0 .849 +(are e)3.349 F -.15(xe)-.15 G .848(cuted sequentially; the shell w).15 F +.848(aits for each command to terminate in turn.)-.1 F .848(The return) +5.848 F(status is the e)108 528 Q(xit status of the last command e)-.15 +E -.15(xe)-.15 G(cuted.).15 E .937(AND and OR lists are sequences of on\ +e of more pipelines separated by the)108 544.8 R F1(&&)3.437 E F0(and) +3.437 E F1(||)3.437 E F0 .937(control operators,)3.437 F(respecti)108 +556.8 Q -.15(ve)-.25 G(ly).15 E 5(.A)-.65 G(ND and OR lists are e)-5 E +-.15(xe)-.15 G(cuted with left associati).15 E(vity)-.25 E 5(.A)-.65 G +2.5(nA)-5 G(ND list has the form)-2.5 E F2(command1)144 573.6 Q F1(&&) +2.5 E F2(command2)2.5 E(command2)108.2 590.4 Q F0(is e)2.52 E -.15(xe) +-.15 G(cuted if, and only if,).15 E F2(command1)2.7 E F0(returns an e) +2.5 E(xit status of zero.)-.15 E(An OR list has the form)108 607.2 Q F2 +(command1)144 624 Q F1(||)2.5 E F2(command2)2.5 E(command2)108.2 645.6 Q +F0 .729(is e)3.249 F -.15(xe)-.15 G .729(cuted if and only if).15 F F2 +(command1)3.429 E F0 .729(returns a non-zero e)3.229 F .729(xit status.) +-.15 F .728(The return status of AND)5.729 F(and OR lists is the e)108 +657.6 Q(xit status of the last command e)-.15 E -.15(xe)-.15 G +(cuted in the list.).15 E F1(Compound Commands)87 674.4 Q F0(A)108 686.4 +Q F2 1.053(compound command)3.553 F F0 1.053(is one of the follo)3.553 F +3.553(wing. In)-.25 F 1.053(most cases a)3.553 F F2(list)3.553 E F0 +1.054(in a command')3.554 F 3.554(sd)-.55 G 1.054(escription may be) +-3.554 F 1.027(separated from the rest of the command by one or more ne) +108 698.4 R 1.026(wlines, and may be follo)-.25 F 1.026(wed by a ne)-.25 +F 1.026(wline in)-.25 F(place of a semicolon.)108 710.4 Q(GNU Bash 4.3) +72 768 Q(2014 February 2)141.79 E(4)195.95 E 0 Cg EP +%%Page: 5 5 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(\()108 84 Q/F1 10/Times-Italic@0 SF(list)A F0(\))A F1(list)17.11 +E F0 .011(is e)2.511 F -.15(xe)-.15 G .011(cuted in a subshell en).15 F +.011(vironment \(see)-.4 F/F2 9/Times-Bold@0 SF .011 +(COMMAND EXECUTION ENVIR)2.511 F(ONMENT)-.27 E F0(belo)2.262 E(w\).)-.25 +E -1.11(Va)144 96 S 1.064(riable assignments and b)1.11 F 1.064 +(uiltin commands that af)-.2 F 1.064(fect the shell')-.25 F 3.564(se) +-.55 G -.4(nv)-3.564 G 1.064(ironment do not remain in).4 F(ef)144 108 Q +(fect after the command completes.)-.25 E(The return status is the e)5 E +(xit status of)-.15 E F1(list)2.5 E F0(.)A({)108 124.8 Q F1(list)2.5 E +F0 2.5(;})C F1(list)3.89 E F0 .401(is simply e)2.901 F -.15(xe)-.15 G +.401(cuted in the current shell en).15 F(vironment.)-.4 E F1(list)5.401 +E F0 .402(must be terminated with a ne)2.901 F .402(wline or)-.25 F +3.215(semicolon. This)144 136.8 R .715(is kno)3.215 F .715(wn as a)-.25 +F F1(gr)3.215 E .715(oup command)-.45 F F0 5.715(.T)C .715 +(he return status is the e)-5.715 F .714(xit status of)-.15 F F1(list) +3.214 E F0 5.714(.N)C(ote)-5.714 E .219(that unlik)144 148.8 R 2.719(et) +-.1 G .219(he metacharacters)-2.719 F/F3 10/Times-Bold@0 SF(\()2.719 E +F0(and)2.719 E F3(\))2.719 E F0(,)A F3({)2.719 E F0(and)2.719 E F3(}) +2.719 E F0(are)2.719 E F1 -.37(re)2.72 G .22(served wor).37 F(ds)-.37 E +F0 .22(and must occur where a reserv)2.72 F(ed)-.15 E -.1(wo)144 160.8 S +.257(rd is permitted to be recognized.).1 F .257(Since the)5.257 F 2.757 +(yd)-.15 G 2.756(on)-2.757 G .256(ot cause a w)-2.756 F .256 +(ord break, the)-.1 F 2.756(ym)-.15 G .256(ust be separated)-2.756 F +(from)144 172.8 Q F1(list)2.5 E F0 +(by whitespace or another shell metacharacter)2.5 E(.)-.55 E(\(\()108 +189.6 Q F1 -.2(ex)C(pr).2 E(ession)-.37 E F0(\)\))A(The)144 201.6 Q F1 +-.2(ex)2.551 G(pr).2 E(ession)-.37 E F0 .051(is e)2.551 F -.25(va)-.25 G +.051(luated according to the rules described belo).25 F 2.552(wu)-.25 G +(nder)-2.552 E F2 .052(ARITHMETIC EV)2.552 F(ALU)-1.215 E(A-)-.54 E +(TION)144 213.6 Q/F4 9/Times-Roman@0 SF(.)A F0 .411(If the v)4.911 F +.411(alue of the e)-.25 F .411(xpression is non-zero, the return status\ + is 0; otherwise the return status)-.15 F(is 1.)144 225.6 Q(This is e)5 +E(xactly equi)-.15 E -.25(va)-.25 G(lent to).25 E F3(let ")2.5 E F1 -.2 +(ex)C(pr).2 E(ession)-.37 E F3(")A F0(.)A F3([[)108 242.4 Q F1 -.2(ex) +2.5 G(pr).2 E(ession)-.37 E F3(]])2.5 E F0 1.299 +(Return a status of 0 or 1 depending on the e)144 254.4 R -.25(va)-.25 G +1.3(luation of the conditional e).25 F(xpression)-.15 E F1 -.2(ex)3.8 G +(pr).2 E(ession)-.37 E F0(.)A 2.274 +(Expressions are composed of the primaries described belo)144 266.4 R +4.773(wu)-.25 G(nder)-4.773 E F2(CONDITION)4.773 E 2.273(AL EXPRES-)-.18 +F(SIONS)144 278.4 Q F4(.)A F0 -.8(Wo)5.632 G 1.133 +(rd splitting and pathname e).8 F 1.133 +(xpansion are not performed on the w)-.15 F 1.133(ords between the)-.1 F +F3([[)3.633 E F0(and)144 290.4 Q F3(]])2.964 E F0 2.964(;t)C .464 +(ilde e)-2.964 F .464(xpansion, parameter and v)-.15 F .464(ariable e) +-.25 F .463(xpansion, arithmetic e)-.15 F .463 +(xpansion, command substi-)-.15 F 1.081 +(tution, process substitution, and quote remo)144 302.4 R -.25(va)-.15 G +3.581(la).25 G 1.081(re performed.)-3.581 F 1.081 +(Conditional operators such as)6.081 F F33.581 E F0 +(must be unquoted to be recognized as primaries.)144 314.4 Q +(When used with)144 332.4 Q F3([[)2.5 E F0 2.5(,t)C(he)-2.5 E F3(<)2.5 E +F0(and)2.5 E F3(>)2.5 E F0(operators sort le)2.5 E +(xicographically using the current locale.)-.15 E .503(When the)144 +350.4 R F3(==)3.003 E F0(and)3.002 E F3(!=)3.002 E F0 .502(operators ar\ +e used, the string to the right of the operator is considered a pat-) +3.002 F .81(tern and matched according to the rules described belo)144 +362.4 R 3.31(wu)-.25 G(nder)-3.31 E F3 -.1(Pa)3.31 G(tter).1 E 3.31(nM) +-.15 G(atching)-3.31 E F0 3.31(,a)C 3.31(si)-3.31 G 3.31(ft)-3.31 G(he) +-3.31 E F3(ext-)3.31 E(glob)144 374.4 Q F0 1.007 +(shell option were enabled.)3.507 F(The)6.007 E F3(=)3.507 E F0 1.007 +(operator is equi)3.507 F -.25(va)-.25 G 1.007(lent to).25 F F3(==)3.507 +E F0 6.007(.I)C 3.507(ft)-6.007 G 1.007(he shell option)-3.507 F F3 +(nocase-)3.506 E(match)144 386.4 Q F0 .198 +(is enabled, the match is performed without re)2.698 F -.05(ga)-.15 G +.198(rd to the case of alphabetic characters.).05 F(The)5.198 E 1.068 +(return v)144 398.4 R 1.068(alue is 0 if the string matches \()-.25 F F3 +(==)A F0 3.568(\)o)C 3.568(rd)-3.568 G 1.068(oes not match \()-3.568 F +F3(!=)A F0 3.568(\)t)C 1.067(he pattern, and 1 otherwise.)-3.568 F(An) +144 410.4 Q 2.5(yp)-.15 G(art of the pattern may be quoted to force the\ + quoted portion to be matched as a string.)-2.5 E .243 +(An additional binary operator)144 428.4 R(,)-.4 E F3(=~)2.743 E F0 +2.743(,i)C 2.743(sa)-2.743 G -.25(va)-2.943 G .243 +(ilable, with the same precedence as).25 F F3(==)2.743 E F0(and)2.743 E +F3(!=)2.743 E F0 5.243(.W)C .243(hen it is)-5.243 F 1.953 +(used, the string to the right of the operator is considered an e)144 +440.4 R 1.953(xtended re)-.15 F 1.953(gular e)-.15 F 1.953 +(xpression and)-.15 F .207(matched accordingly \(as in)144 452.4 R F1 +-.37(re)2.707 G -.1(ge)-.03 G(x)-.1 E F0 2.707(\(3\)\). The)B .207 +(return v)2.707 F .207 +(alue is 0 if the string matches the pattern, and 1)-.25 F 3.346 +(otherwise. If)144 464.4 R .846(the re)3.346 F .846(gular e)-.15 F .845 +(xpression is syntactically incorrect, the conditional e)-.15 F +(xpression')-.15 E 3.345(sr)-.55 G(eturn)-3.345 E -.25(va)144 476.4 S +.666(lue is 2.).25 F .667(If the shell option)5.667 F F3(nocasematch) +3.167 E F0 .667(is enabled, the match is performed without re)3.167 F +-.05(ga)-.15 G .667(rd to).05 F .593(the case of alphabetic characters.) +144 488.4 R(An)5.593 E 3.093(yp)-.15 G .592 +(art of the pattern may be quoted to force the quoted por)-3.093 F(-)-.2 +E 1.016(tion to be matched as a string.)144 500.4 R(Brack)6.016 E 1.016 +(et e)-.1 F 1.016(xpressions in re)-.15 F 1.016(gular e)-.15 F 1.016 +(xpressions must be treated care-)-.15 F(fully)144 512.4 Q 4.436(,s)-.65 +G 1.936 +(ince normal quoting characters lose their meanings between brack)-4.436 +F 4.435(ets. If)-.1 F 1.935(the pattern is)4.435 F .264 +(stored in a shell v)144 524.4 R .264(ariable, quoting the v)-.25 F .264 +(ariable e)-.25 F .265 +(xpansion forces the entire pattern to be matched as)-.15 F 3.774(as)144 +536.4 S 3.774(tring. Substrings)-3.774 F 1.274 +(matched by parenthesized sube)3.774 F 1.273(xpressions within the re) +-.15 F 1.273(gular e)-.15 F 1.273(xpression are)-.15 F(sa)144 548.4 Q +-.15(ve)-.2 G 3.096(di).15 G 3.097(nt)-3.096 G .597(he array v)-3.097 F +(ariable)-.25 E F2 -.27(BA)3.097 G(SH_REMA).27 E(TCH)-.855 E F4(.)A F0 +.597(The element of)5.097 F F2 -.27(BA)3.097 G(SH_REMA).27 E(TCH)-.855 E +F0 .597(with inde)2.847 F 3.097(x0i)-.15 G(s)-3.097 E .049 +(the portion of the string matching the entire re)144 560.4 R .049 +(gular e)-.15 F 2.549(xpression. The)-.15 F .049(element of)2.549 F F2 +-.27(BA)2.549 G(SH_REMA).27 E(TCH)-.855 E F0(with inde)144 572.4 Q(x) +-.15 E F1(n)2.5 E F0(is the portion of the string matching the)2.5 E F1 +(n)2.5 E F0(th parenthesized sube)A(xpression.)-.15 E .785 +(Expressions may be combined using the follo)144 590.4 R .786 +(wing operators, listed in decreasing order of prece-)-.25 F(dence:)144 +602.4 Q F3(\()144 620.4 Q F1 -.2(ex)2.5 G(pr).2 E(ession)-.37 E F3(\)) +2.5 E F0 .523(Returns the v)180 632.4 R .522(alue of)-.25 F F1 -.2(ex) +3.022 G(pr).2 E(ession)-.37 E F0 5.522(.T)C .522(his may be used to o) +-5.522 F -.15(ve)-.15 G .522(rride the normal precedence of).15 F +(operators.)180 644.4 Q F3(!)144 656.4 Q F1 -.2(ex)2.5 G(pr).2 E(ession) +-.37 E F0 -.35(Tr)180 668.4 S(ue if).35 E F1 -.2(ex)2.5 G(pr).2 E +(ession)-.37 E F0(is f)2.74 E(alse.)-.1 E F1 -.2(ex)144 680.4 S(pr).2 E +(ession1)-.37 E F3(&&)2.5 E F1 -.2(ex)2.5 G(pr).2 E(ession2)-.37 E F0 +-.35(Tr)180 692.4 S(ue if both).35 E F1 -.2(ex)2.5 G(pr).2 E(ession1) +-.37 E F0(and)2.5 E F1 -.2(ex)2.5 G(pr).2 E(ession2)-.37 E F0(are true.) +2.52 E F1 -.2(ex)144 704.4 S(pr).2 E(ession1)-.37 E F3(||)2.5 E F1 -.2 +(ex)2.5 G(pr).2 E(ession2)-.37 E F0 -.35(Tr)180 716.4 S(ue if either).35 +E F1 -.2(ex)2.5 G(pr).2 E(ession1)-.37 E F0(or)2.5 E F1 -.2(ex)2.5 G(pr) +.2 E(ession2)-.37 E F0(is true.)2.52 E(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(5)195.95 E 0 Cg EP +%%Page: 6 6 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(The)144 84 Q/F1 10/Times-Bold@0 SF(&&)3.64 E F0(and)3.64 E F1(||) +3.64 E F0 1.14(operators do not e)3.64 F -.25(va)-.25 G(luate).25 E/F2 +10/Times-Italic@0 SF -.2(ex)3.641 G(pr).2 E(ession2)-.37 E F0 1.141 +(if the v)3.641 F 1.141(alue of)-.25 F F2 -.2(ex)3.641 G(pr).2 E +(ession1)-.37 E F0 1.141(is suf)3.641 F 1.141(\214cient to)-.25 F +(determine the return v)144 96 Q(alue of the entire conditional e)-.25 E +(xpression.)-.15 E F1 -.25(fo)108 112.8 S(r).25 E F2(name)2.5 E F0 2.5 +([[)2.5 G F1(in)A F0([)2.5 E F2(wor)2.5 E 2.5(d.)-.37 G(..)-2.5 E F0 2.5 +(]];])2.5 G F1(do)A F2(list)2.5 E F0(;)2.5 E F1(done)2.5 E F0 .424 +(The list of w)144 124.8 R .424(ords follo)-.1 F(wing)-.25 E F1(in)2.924 +E F0 .423(is e)2.924 F .423(xpanded, generating a list of items.)-.15 F +.423(The v)5.423 F(ariable)-.25 E F2(name)2.923 E F0 .423(is set to) +2.923 F .653(each element of this list in turn, and)144 136.8 R F2(list) +3.153 E F0 .653(is e)3.153 F -.15(xe)-.15 G .653(cuted each time.).15 F +.653(If the)5.653 F F1(in)3.153 E F2(wor)3.153 E(d)-.37 E F0 .653 +(is omitted, the)3.153 F F1 -.25(fo)3.153 G(r).25 E F0 .649(command e) +144 148.8 R -.15(xe)-.15 G(cutes).15 E F2(list)3.149 E F0 .648 +(once for each positional parameter that is set \(see)3.148 F/F3 9 +/Times-Bold@0 SF -.666(PA)3.148 G(RAMETERS).666 E F0(belo)2.898 E(w\).) +-.25 E .153(The return status is the e)144 160.8 R .153 +(xit status of the last command that e)-.15 F -.15(xe)-.15 G 2.654 +(cutes. If).15 F .154(the e)2.654 F .154(xpansion of the items)-.15 F +(follo)144 172.8 Q(wing)-.25 E F1(in)2.5 E F0 +(results in an empty list, no commands are e)2.5 E -.15(xe)-.15 G +(cuted, and the return status is 0.).15 E F1 -.25(fo)108 189.6 S(r).25 E +F0(\(\()2.5 E F2 -.2(ex)2.5 G(pr1).2 E F0(;)2.5 E F2 -.2(ex)2.5 G(pr2).2 +E F0(;)2.5 E F2 -.2(ex)2.5 G(pr3).2 E F0(\)\) ;)2.5 E F1(do)2.5 E F2 +(list)2.5 E F0(;)2.5 E F1(done)2.5 E F0 1.236(First, the arithmetic e) +144 201.6 R(xpression)-.15 E F2 -.2(ex)3.736 G(pr1).2 E F0 1.235(is e) +3.736 F -.25(va)-.25 G 1.235 +(luated according to the rules described belo).25 F 3.735(wu)-.25 G +(nder)-3.735 E F3 .561(ARITHMETIC EV)144 213.6 R(ALU)-1.215 E -.855(AT) +-.54 G(ION).855 E/F4 9/Times-Roman@0 SF(.)A F0 .561(The arithmetic e) +5.061 F(xpression)-.15 E F2 -.2(ex)3.061 G(pr2).2 E F0 .562(is then e) +3.062 F -.25(va)-.25 G .562(luated repeatedly until).25 F .592(it e)144 +225.6 R -.25(va)-.25 G .592(luates to zero.).25 F .592(Each time)5.592 F +F2 -.2(ex)3.092 G(pr2).2 E F0 -.25(eva)3.092 G .592 +(luates to a non-zero v).25 F(alue,)-.25 E F2(list)3.092 E F0 .591(is e) +3.092 F -.15(xe)-.15 G .591(cuted and the arith-).15 F .228(metic e)144 +237.6 R(xpression)-.15 E F2 -.2(ex)2.728 G(pr3).2 E F0 .229(is e)2.728 F +-.25(va)-.25 G 2.729(luated. If).25 F(an)2.729 E 2.729(ye)-.15 G .229 +(xpression is omitted, it beha)-2.879 F -.15(ve)-.2 G 2.729(sa).15 G +2.729(si)-2.729 G 2.729(fi)-2.729 G 2.729(te)-2.729 G -.25(va)-2.979 G +.229(luates to 1.).25 F .228(The return v)144 249.6 R .228 +(alue is the e)-.25 F .228(xit status of the last command in)-.15 F F2 +(list)2.728 E F0 .227(that is e)2.728 F -.15(xe)-.15 G .227(cuted, or f) +.15 F .227(alse if an)-.1 F 2.727(yo)-.15 G 2.727(ft)-2.727 G(he)-2.727 +E -.15(ex)144 261.6 S(pressions is in).15 E -.25(va)-.4 G(lid.).25 E F1 +(select)108 278.4 Q F2(name)2.5 E F0([)2.5 E F1(in)2.5 E F2(wor)2.5 E(d) +-.37 E F0 2.5(];)2.5 G F1(do)A F2(list)2.5 E F0(;)2.5 E F1(done)2.5 E F0 +.432(The list of w)144 290.4 R .432(ords follo)-.1 F(wing)-.25 E F1(in) +2.932 E F0 .432(is e)2.932 F .432(xpanded, generating a list of items.) +-.15 F .433(The set of e)5.433 F .433(xpanded w)-.15 F(ords)-.1 E .843 +(is printed on the standard error)144 302.4 R 3.342(,e)-.4 G .842 +(ach preceded by a number)-3.342 F 5.842(.I)-.55 G 3.342(ft)-5.842 G(he) +-3.342 E F1(in)3.342 E F2(wor)3.342 E(d)-.37 E F0 .842 +(is omitted, the posi-)3.342 F .201(tional parameters are printed \(see) +144 314.4 R F3 -.666(PA)2.701 G(RAMETERS).666 E F0(belo)2.451 E 2.701 +(w\). The)-.25 F F3(PS3)2.701 E F0 .201(prompt is then displayed and a) +2.451 F .214(line read from the standard input.)144 326.4 R .213 +(If the line consists of a number corresponding to one of the dis-)5.214 +F 1.537(played w)144 338.4 R 1.537(ords, then the v)-.1 F 1.537(alue of) +-.25 F F2(name)4.397 E F0 1.537(is set to that w)4.217 F 4.037(ord. If) +-.1 F 1.538(the line is empty)4.038 F 4.038(,t)-.65 G 1.538(he w)-4.038 +F 1.538(ords and)-.1 F .066(prompt are displayed ag)144 350.4 R 2.566 +(ain. If)-.05 F .065(EOF is read, the command completes.)2.566 F(An) +5.065 E 2.565(yo)-.15 G .065(ther v)-2.565 F .065(alue read causes)-.25 +F F2(name)144 362.4 Q F0 .972(to be set to null.)3.652 F .972 +(The line read is sa)5.972 F -.15(ve)-.2 G 3.473(di).15 G 3.473(nt) +-3.473 G .973(he v)-3.473 F(ariable)-.25 E F3(REPL)3.473 E(Y)-.828 E F4 +(.)A F0(The)5.473 E F2(list)3.563 E F0 .973(is e)4.153 F -.15(xe)-.15 G +.973(cuted after).15 F .072(each selection until a)144 374.4 R F1(br) +2.571 E(eak)-.18 E F0 .071(command is e)2.571 F -.15(xe)-.15 G 2.571 +(cuted. The).15 F -.15(ex)2.571 G .071(it status of).15 F F1(select) +2.571 E F0 .071(is the e)2.571 F .071(xit status of the)-.15 F +(last command e)144 386.4 Q -.15(xe)-.15 G(cuted in).15 E F2(list)2.5 E +F0 2.5(,o).68 G 2.5(rz)-2.5 G(ero if no commands were e)-2.5 E -.15(xe) +-.15 G(cuted.).15 E F1(case)108 403.2 Q F2(wor)2.5 E(d)-.37 E F1(in)2.5 +E F0 2.5([[)2.5 G(\(])-2.5 E F2(pattern)2.5 E F0([)2.5 E F1(|)2.5 E F2 +(pattern)2.5 E F0 2.5(].)2.5 G(.. \))-2.5 E F2(list)2.5 E F0(;; ] ...) +2.5 E F1(esac)2.5 E F0(A)144 415.2 Q F1(case)3.264 E F0 .764 +(command \214rst e)3.264 F(xpands)-.15 E F2(wor)3.264 E(d)-.37 E F0 +3.264(,a)C .764(nd tries to match it ag)-3.264 F .764(ainst each)-.05 F +F2(pattern)3.264 E F0 .765(in turn, using the)3.264 F .596 +(same matching rules as for pathname e)144 427.2 R .595(xpansion \(see) +-.15 F F1 -.1(Pa)3.095 G .595(thname Expansion).1 F F0(belo)3.095 E +3.095(w\). The)-.25 F F2(wor)3.095 E(d)-.37 E F0(is)3.095 E -.15(ex)144 +439.2 S 1.092(panded using tilde e).15 F 1.092 +(xpansion, parameter and v)-.15 F 1.092(ariable e)-.25 F 1.092 +(xpansion, arithmetic substitution, com-)-.15 F 1.268 +(mand substitution, process substitution and quote remo)144 451.2 R -.25 +(va)-.15 G 3.768(l. Each).25 F F2(pattern)3.768 E F0 -.15(ex)3.768 G +1.268(amined is e).15 F(xpanded)-.15 E .353(using tilde e)144 463.2 R +.353(xpansion, parameter and v)-.15 F .353(ariable e)-.25 F .353 +(xpansion, arithmetic substitution, command substi-)-.15 F 1.517 +(tution, and process substitution.)144 475.2 R 1.517 +(If the shell option)6.517 F F1(nocasematch)4.016 E F0 1.516 +(is enabled, the match is per)4.016 F(-)-.2 E 1.346(formed without re) +144 487.2 R -.05(ga)-.15 G 1.346 +(rd to the case of alphabetic characters.).05 F 1.347 +(When a match is found, the corre-)6.347 F(sponding)144 499.2 Q F2(list) +2.777 E F0 .277(is e)2.777 F -.15(xe)-.15 G 2.777(cuted. If).15 F(the) +2.777 E F1(;;)2.777 E F0 .277 +(operator is used, no subsequent matches are attempted after the)2.777 F +.848(\214rst pattern match.)144 511.2 R(Using)5.848 E F1(;&)3.348 E F0 +.849(in place of)3.349 F F1(;;)3.349 E F0 .849(causes e)3.349 F -.15(xe) +-.15 G .849(cution to continue with the).15 F F2(list)3.349 E F0 +(associated)3.349 E .078(with the ne)144 523.2 R .078 +(xt set of patterns.)-.15 F(Using)5.078 E F1(;;&)2.578 E F0 .078 +(in place of)2.578 F F1(;;)2.578 E F0 .077 +(causes the shell to test the ne)2.578 F .077(xt pattern list in)-.15 F +.227(the statement, if an)144 535.2 R 1.527 -.65(y, a)-.15 H .227(nd e) +.65 F -.15(xe)-.15 G .227(cute an).15 F 2.727(ya)-.15 G(ssociated)-2.727 +E F2(list)2.727 E F0 .227(on a successful match.)2.727 F .227(The e) +5.227 F .227(xit status is zero)-.15 F(if no pattern matches.)144 547.2 +Q(Otherwise, it is the e)5 E(xit status of the last command e)-.15 E +-.15(xe)-.15 G(cuted in).15 E F2(list)2.5 E F0(.)A F1(if)108 564 Q F2 +(list)2.5 E F0(;)A F1(then)2.5 E F2(list)2.5 E F0 2.5(;[)C F1(elif)A F2 +(list)2.5 E F0(;)A F1(then)2.5 E F2(list)2.5 E F0 2.5(;].)C(.. [)-2.5 E +F1(else)2.5 E F2(list)2.5 E F0 2.5(;])C F1<8c>A F0(The)144 576 Q F1(if) +2.978 E F2(list)3.068 E F0 .478(is e)3.658 F -.15(xe)-.15 G 2.978 +(cuted. If).15 F .478(its e)2.978 F .478(xit status is zero, the)-.15 F +F1(then)2.978 E F2(list)2.978 E F0 .478(is e)2.978 F -.15(xe)-.15 G +2.978(cuted. Otherwise,).15 F(each)2.978 E F1(elif)2.977 E F2(list)2.977 +E F0 1.087(is e)144 588 R -.15(xe)-.15 G 1.087 +(cuted in turn, and if its e).15 F 1.087 +(xit status is zero, the corresponding)-.15 F F1(then)3.587 E F2(list) +3.587 E F0 1.088(is e)3.588 F -.15(xe)-.15 G 1.088(cuted and the).15 F +.104(command completes.)144 600 R .103(Otherwise, the)5.104 F F1(else) +2.603 E F2(list)2.603 E F0 .103(is e)2.603 F -.15(xe)-.15 G .103 +(cuted, if present.).15 F .103(The e)5.103 F .103(xit status is the e) +-.15 F .103(xit sta-)-.15 F(tus of the last command e)144 612 Q -.15(xe) +-.15 G(cuted, or zero if no condition tested true.).15 E F1(while)108 +628.8 Q F2(list-1)2.5 E F0(;)A F1(do)2.5 E F2(list-2)2.5 E F0(;)A F1 +(done)2.5 E(until)108 640.8 Q F2(list-1)2.5 E F0(;)A F1(do)2.5 E F2 +(list-2)2.5 E F0(;)A F1(done)2.5 E F0(The)144 652.8 Q F1(while)3.45 E F0 +.95(command continuously e)3.45 F -.15(xe)-.15 G .95(cutes the list).15 +F F2(list-2)3.45 E F0 .95(as long as the last command in the list)3.45 F +F2(list-1)144 664.8 Q F0 .205(returns an e)2.705 F .205 +(xit status of zero.)-.15 F(The)5.205 E F1(until)2.705 E F0 .205 +(command is identical to the)2.705 F F1(while)2.705 E F0 .205 +(command, e)2.705 F(xcept)-.15 E .599(that the test is ne)144 676.8 R +-.05(ga)-.15 G(ted;).05 E F2(list-2)3.189 E F0 .599(is e)3.119 F -.15 +(xe)-.15 G .6(cuted as long as the last command in).15 F F2(list-1)3.19 +E F0 .6(returns a non-zero)3.1 F -.15(ex)144 688.8 S .205(it status.).15 +F .205(The e)5.205 F .205(xit status of the)-.15 F F1(while)2.705 E F0 +(and)2.705 E F1(until)2.704 E F0 .204(commands is the e)2.704 F .204 +(xit status of the last command)-.15 F -.15(exe)144 700.8 S(cuted in).15 +E F2(list-2)2.5 E F0 2.5(,o)C 2.5(rz)-2.5 G(ero if none w)-2.5 E(as e) +-.1 E -.15(xe)-.15 G(cuted.).15 E(GNU Bash 4.3)72 768 Q(2014 February 2) +141.79 E(6)195.95 E 0 Cg EP +%%Page: 7 7 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(Copr)87 84 Q(ocesses)-.18 E F0(A)108 96 Q +/F2 10/Times-Italic@0 SF(copr)3.712 E(ocess)-.45 E F0 1.212 +(is a shell command preceded by the)3.712 F F1(copr)3.713 E(oc)-.18 E F0 +(reserv)3.713 E 1.213(ed w)-.15 F 3.713(ord. A)-.1 F 1.213 +(coprocess is e)3.713 F -.15(xe)-.15 G 1.213(cuted asyn-).15 F .575(chr\ +onously in a subshell, as if the command had been terminated with the) +108 108 R F1(&)3.074 E F0 .574(control operator)3.074 F 3.074(,w)-.4 G +.574(ith a tw)-3.074 F(o-)-.1 E -.1(wa)108 120 S 2.5(yp).1 G +(ipe established between the e)-2.5 E -.15(xe)-.15 G +(cuting shell and the coprocess.).15 E(The format for a coprocess is:) +108 136.8 Q F1(copr)144 153.6 Q(oc)-.18 E F0([)2.5 E F2 -.27(NA)C(ME).27 +E F0(])A F2(command)2.5 E F0([)2.5 E F2 -.37(re)C(dir).37 E(ections)-.37 +E F0(])A .708(This creates a coprocess named)108 170.4 R F2 -.27(NA) +3.208 G(ME).27 E F0 5.708(.I)C(f)-5.708 E F2 -.27(NA)3.208 G(ME).27 E F0 +.708(is not supplied, the def)3.208 F .708(ault name is)-.1 F F1(COPR) +3.209 E(OC)-.3 E F0(.)A F2 -.27(NA)5.709 G(ME).27 E F0 .64 +(must not be supplied if)108 182.4 R F2(command)3.14 E F0 .64(is a)3.14 +F F2 .64(simple command)3.14 F F0 .64(\(see abo)3.14 F -.15(ve)-.15 G +.64(\); otherwise, it is interpreted as the \214rst).15 F -.1(wo)108 +194.4 S 1.44(rd of the simple command.).1 F 1.44 +(When the coprocess is e)6.44 F -.15(xe)-.15 G 1.44 +(cuted, the shell creates an array v).15 F 1.44(ariable \(see)-.25 F F1 +(Arrays)108 206.4 Q F0(belo)3.671 E 1.171(w\) named)-.25 F F2 -.27(NA) +3.671 G(ME).27 E F0 1.171(in the conte)3.671 F 1.171(xt of the e)-.15 F +-.15(xe)-.15 G 1.171(cuting shell.).15 F 1.17(The standard output of) +6.17 F F2(command)3.87 E F0(is)4.44 E 2.029 +(connected via a pipe to a \214le descriptor in the e)108 218.4 R -.15 +(xe)-.15 G 2.029 +(cuting shell, and that \214le descriptor is assigned to).15 F F2 -.27 +(NA)108 230.4 S(ME).27 E F0 3.857([0]. The)B 1.357(standard input of) +3.857 F F2(command)4.057 E F0 1.356 +(is connected via a pipe to a \214le descriptor in the e)4.627 F -.15 +(xe)-.15 G(cuting).15 E .103 +(shell, and that \214le descriptor is assigned to)108 242.4 R F2 -.27 +(NA)2.603 G(ME).27 E F0 2.603([1]. This)B .103 +(pipe is established before an)2.603 F 2.604(yr)-.15 G .104 +(edirections spec-)-2.604 F 1.272(i\214ed by the command \(see)108 254.4 +R/F3 9/Times-Bold@0 SF(REDIRECTION)3.771 E F0(belo)3.521 E 3.771 +(w\). The)-.25 F 1.271(\214le descriptors can be utilized as ar)3.771 F +1.271(guments to)-.18 F .515 +(shell commands and redirections using standard w)108 266.4 R .515 +(ord e)-.1 F 3.015(xpansions. The)-.15 F .515 +(\214le descriptors are not a)3.015 F -.25(va)-.2 G .515(ilable in).25 F +3.637(subshells. The)108 278.4 R 1.137(process ID of the shell spa)3.637 +F 1.137(wned to e)-.15 F -.15(xe)-.15 G 1.137(cute the coprocess is a) +.15 F -.25(va)-.2 G 1.136(ilable as the v).25 F 1.136(alue of the)-.25 F +-.25(va)108 290.4 S(riable).25 E F2 -.27(NA)2.5 G(ME).27 E F0 2.5 +(_PID. The)B F1(wait)2.5 E F0 -.2(bu)2.5 G +(iltin command may be used to w).2 E +(ait for the coprocess to terminate.)-.1 E .336 +(Since the coprocess is created as an asynchronous command, the)108 +307.2 R F1(copr)2.836 E(oc)-.18 E F0 .336(command al)2.836 F -.1(wa)-.1 +G .336(ys returns success.).1 F +(The return status of a coprocess is the e)108 319.2 Q(xit status of) +-.15 E F2(command)2.5 E F0(.)A F1(Shell Function De\214nitions)87 336 Q +F0 2.698(As)108 348 S .198 +(hell function is an object that is called lik)-2.698 F 2.698(eas)-.1 G +.198(imple command and e)-2.698 F -.15(xe)-.15 G .197 +(cutes a compound command with).15 F 2.5(an)108 360 S .5 -.25(ew s)-2.5 +H(et of positional parameters.).25 E +(Shell functions are declared as follo)5 E(ws:)-.25 E F2(name)108 376.8 +Q F0(\(\))2.5 E F2(compound\255command)2.5 E F0([)2.5 E F2 -.37(re)C +(dir).37 E(ection)-.37 E F0(])A F1(function)108 388.8 Q F2(name)2.5 E F0 +([\(\)])2.5 E F2(compound\255command)2.5 E F0([)2.5 E F2 -.37(re)C(dir) +.37 E(ection)-.37 E F0(])A 1.402(This de\214nes a function named)144 +400.8 R F2(name)3.902 E F0 6.402(.T)C 1.402(he reserv)-6.402 F 1.402 +(ed w)-.15 F(ord)-.1 E F1(function)3.902 E F0 1.402(is optional.)3.902 F +1.403(If the)6.402 F F1(function)3.903 E F0(reserv)144 412.8 Q .162 +(ed w)-.15 F .162(ord is supplied, the parentheses are optional.)-.1 F +(The)5.162 E F2(body)2.662 E F0 .162(of the function is the compound) +2.662 F(command)144 424.8 Q F2(compound\255command)2.784 E F0(\(see) +3.354 E F1 .084(Compound Commands)2.584 F F0(abo)2.584 E -.15(ve)-.15 G +2.584(\). That).15 F .084(command is usually a)2.584 F F2(list)144 436.8 +Q F0 .044(of commands between { and }, b)2.544 F .044(ut may be an)-.2 F +2.544(yc)-.15 G .044(ommand listed under)-2.544 F F1 .044 +(Compound Commands)2.544 F F0(abo)144 448.8 Q -.15(ve)-.15 G(.).15 E F2 +(compound\255command)6.67 E F0 1.67(is e)4.17 F -.15(xe)-.15 G 1.671 +(cuted whene).15 F -.15(ve)-.25 G(r).15 E F2(name)4.171 E F0 1.671 +(is speci\214ed as the name of a simple)4.171 F 2.753(command. When)144 +460.8 R(in)2.753 E F2 .253(posix mode)2.753 F F0(,)A F2(name)2.753 E F0 +.253(may not be the name of one of the POSIX)2.753 F F2 .252(special b) +2.753 F(uiltins)-.2 E F0(.)A(An)144 472.8 Q 3.241(yr)-.15 G .741 +(edirections \(see)-3.241 F F3(REDIRECTION)3.241 E F0(belo)2.991 E .742 +(w\) speci\214ed when a function is de\214ned are performed)-.25 F .171 +(when the function is e)144 484.8 R -.15(xe)-.15 G 2.671(cuted. The).15 +F -.15(ex)2.671 G .17 +(it status of a function de\214nition is zero unless a syntax error).15 +F .704(occurs or a readonly function with the same name already e)144 +496.8 R 3.205(xists. When)-.15 F -.15(exe)3.205 G .705(cuted, the e).15 +F .705(xit status)-.15 F 1.822(of a function is the e)144 508.8 R 1.821 +(xit status of the last command e)-.15 F -.15(xe)-.15 G 1.821 +(cuted in the body).15 F 6.821(.\()-.65 G(See)-6.821 E F3(FUNCTIONS) +4.321 E F0(belo)144 520.8 Q -.65(w.)-.25 G(\)).65 E/F4 10.95 +/Times-Bold@0 SF(COMMENTS)72 537.6 Q F0 .982(In a non-interacti)108 +549.6 R 1.282 -.15(ve s)-.25 H .982(hell, or an interacti).15 F 1.282 +-.15(ve s)-.25 H .982(hell in which the).15 F F1(interacti)3.482 E -.1 +(ve)-.1 G(_comments).1 E F0 .982(option to the)3.482 F F1(shopt)3.482 E +F0 -.2(bu)108 561.6 S .952(iltin is enabled \(see).2 F F3 .952(SHELL B) +3.452 F(UIL)-.09 E .952(TIN COMMANDS)-.828 F F0(belo)3.202 E .952 +(w\), a w)-.25 F .952(ord be)-.1 F .952(ginning with)-.15 F F1(#)3.451 E +F0 .951(causes that w)3.451 F(ord)-.1 E .604 +(and all remaining characters on that line to be ignored.)108 573.6 R +.605(An interacti)5.605 F .905 -.15(ve s)-.25 H .605(hell without the) +.15 F F1(interacti)3.105 E -.1(ve)-.1 G(_com-).1 E(ments)108 585.6 Q F0 +1.337(option enabled does not allo)3.837 F 3.837(wc)-.25 G 3.836 +(omments. The)-3.837 F F1(interacti)3.836 E -.1(ve)-.1 G(_comments).1 E +F0 1.336(option is on by def)3.836 F 1.336(ault in)-.1 F(interacti)108 +597.6 Q .3 -.15(ve s)-.25 H(hells.).15 E F4 -.11(QU)72 614.4 S -.438(OT) +.11 G(ING).438 E F2(Quoting)108 626.4 Q F0 .477(is used to remo)2.977 F +.777 -.15(ve t)-.15 H .477 +(he special meaning of certain characters or w).15 F .477 +(ords to the shell.)-.1 F .478(Quoting can be)5.478 F .185 +(used to disable special treatment for special characters, to pre)108 +638.4 R -.15(ve)-.25 G .185(nt reserv).15 F .184(ed w)-.15 F .184 +(ords from being recognized as)-.1 F(such, and to pre)108 650.4 Q -.15 +(ve)-.25 G(nt parameter e).15 E(xpansion.)-.15 E .288(Each of the)108 +667.2 R F2(metac)2.788 E(har)-.15 E(acter)-.15 E(s)-.1 E F0 .288 +(listed abo)2.788 F .588 -.15(ve u)-.15 H(nder).15 E F3(DEFINITIONS) +2.788 E F0 .288(has special meaning to the shell and must be)2.538 F +(quoted if it is to represent itself.)108 679.2 Q 1.345 +(When the command history e)108 696 R 1.344(xpansion f)-.15 F 1.344 +(acilities are being used \(see)-.1 F F3(HIST)3.844 E(OR)-.162 E 3.594 +(YE)-.315 G(XP)-3.594 E(ANSION)-.666 E F0(belo)3.594 E 1.344(w\), the) +-.25 F F2(history e)108 708 Q(xpansion)-.2 E F0(character)2.5 E 2.5(,u) +-.4 G(sually)-2.5 E F1(!)2.5 E F0 2.5(,m)C(ust be quoted to pre)-2.5 E +-.15(ve)-.25 G(nt history e).15 E(xpansion.)-.15 E +(There are three quoting mechanisms: the)108 724.8 Q F2(escape c)2.5 E +(har)-.15 E(acter)-.15 E F0 2.5(,s).73 G +(ingle quotes, and double quotes.)-2.5 E(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(7)195.95 E 0 Cg EP +%%Page: 8 8 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E 2.974(An)108 84 S .474(on-quoted backslash \()-2.974 F/F1 10 +/Times-Bold@0 SF(\\)A F0 2.974(\)i)C 2.974(st)-2.974 G(he)-2.974 E/F2 10 +/Times-Italic@0 SF .474(escape c)2.974 F(har)-.15 E(acter)-.15 E F0 +5.474(.I).73 G 2.974(tp)-5.474 G(reserv)-2.974 E .474(es the literal v) +-.15 F .474(alue of the ne)-.25 F .475(xt character that)-.15 F(follo) +108 96 Q 1.554(ws, with the e)-.25 F 1.553(xception of . If)-.25 F(a)4.053 E F1(\\)4.053 E F0( pair appears, and the backslash is not itself)-.25 F 1.122 +(quoted, the)108 108 R F1(\\)3.622 E F0( is treated as a line continuation \(that is, it is remo)-.25 F +-.15(ve)-.15 G 3.622(df).15 G 1.123(rom the input stream and)-3.622 F +(ef)108 120 Q(fecti)-.25 E -.15(ve)-.25 G(ly ignored\).).15 E .295 +(Enclosing characters in single quotes preserv)108 136.8 R .295 +(es the literal v)-.15 F .295(alue of each character within the quotes.) +-.25 F 2.795(As)5.295 G(in-)-2.795 E +(gle quote may not occur between single quotes, e)108 148.8 Q -.15(ve) +-.25 G 2.5(nw).15 G(hen preceded by a backslash.)-2.5 E .033 +(Enclosing characters in double quotes preserv)108 165.6 R .034 +(es the literal v)-.15 F .034 +(alue of all characters within the quotes, with the)-.25 F -.15(ex)108 +177.6 S .828(ception of).15 F F1($)3.328 E F0(,)A F1<92>3.328 E F0(,)A +F1(\\)3.328 E F0 3.328(,a)C .828(nd, when history e)-3.328 F .828 +(xpansion is enabled,)-.15 F F1(!)3.328 E F0 5.828(.T)C .828 +(he characters)-5.828 F F1($)3.328 E F0(and)3.328 E F1<92>3.328 E F0 +.827(retain their special)3.328 F .074(meaning within double quotes.)108 +189.6 R .074(The backslash retains its special meaning only when follo) +5.074 F .075(wed by one of the)-.25 F(follo)108 201.6 Q .205 +(wing characters:)-.25 F F1($)2.705 E F0(,)A F1<92>2.705 E F0(,)A F1(") +3.538 E F0(,).833 E F1(\\)2.705 E F0 2.705(,o)C(r)-2.705 E F1() +2.705 E F0 5.205(.A)C .204 +(double quote may be quoted within double quotes by pre-)-2.5 F .081 +(ceding it with a backslash.)108 213.6 R .082(If enabled, history e) +5.082 F .082(xpansion will be performed unless an)-.15 F F1(!)2.582 E F0 +.082(appearing in double)5.082 F(quotes is escaped using a backslash.) +108 225.6 Q(The backslash preceding the)5 E F1(!)2.5 E F0(is not remo)5 +E -.15(ve)-.15 G(d.).15 E(The special parameters)108 242.4 Q F1(*)2.5 E +F0(and)2.5 E F1(@)2.5 E F0(ha)2.5 E .3 -.15(ve s)-.2 H +(pecial meaning when in double quotes \(see).15 E/F3 9/Times-Bold@0 SF +-.666(PA)2.5 G(RAMETERS).666 E F0(belo)2.25 E(w\).)-.25 E -.8(Wo)108 +259.2 S .212(rds of the form).8 F F1($)2.712 E F0<08>A F2(string)A F0 +2.712<0861>C .211(re treated specially)-2.712 F 5.211(.T)-.65 G .211 +(he w)-5.211 F .211(ord e)-.1 F .211(xpands to)-.15 F F2(string)2.711 E +F0 2.711(,w)C .211(ith backslash-escaped char)-2.711 F(-)-.2 E .604 +(acters replaced as speci\214ed by the ANSI C standard.)108 271.2 R .605 +(Backslash escape sequences, if present, are decoded)5.605 F(as follo) +108 283.2 Q(ws:)-.25 E F1(\\a)144 295.2 Q F0(alert \(bell\))28.22 E F1 +(\\b)144 307.2 Q F0(backspace)27.66 E F1(\\e)144 319.2 Q(\\E)144 331.2 Q +F0(an escape character)26.55 E F1(\\f)144 343.2 Q F0(form feed)29.89 E +F1(\\n)144 355.2 Q F0(ne)27.66 E 2.5(wl)-.25 G(ine)-2.5 E F1(\\r)144 +367.2 Q F0(carriage return)28.78 E F1(\\t)144 379.2 Q F0(horizontal tab) +29.89 E F1(\\v)144 391.2 Q F0 -.15(ve)28.22 G(rtical tab).15 E F1(\\\\) +144 403.2 Q F0(backslash)30.44 E F1<5c08>144 415.2 Q F0(single quote) +30.44 E F1(\\")144 427.2 Q F0(double quote)27.67 E F1(\\)144 439.2 Q F2 +(nnn)A F0(the eight-bit character whose v)18.22 E(alue is the octal v) +-.25 E(alue)-.25 E F2(nnn)2.5 E F0(\(one to three digits\))2.5 E F1(\\x) +144 451.2 Q F2(HH)A F0(the eight-bit character whose v)13.78 E +(alue is the he)-.25 E(xadecimal v)-.15 E(alue)-.25 E F2(HH)2.5 E F0 +(\(one or tw)2.5 E 2.5(oh)-.1 G .3 -.15(ex d)-2.5 H(igits\)).15 E F1 +(\\u)144 463.2 Q F2(HHHH)A F0 1.507 +(the Unicode \(ISO/IEC 10646\) character whose v)180 475.2 R 1.506 +(alue is the he)-.25 F 1.506(xadecimal v)-.15 F(alue)-.25 E F2(HHHH) +4.006 E F0(\(one to four he)180 487.2 Q 2.5(xd)-.15 G(igits\))-2.5 E F1 +(\\U)144 499.2 Q F2(HHHHHHHH)A F0 .547 +(the Unicode \(ISO/IEC 10646\) character whose v)180 511.2 R .547 +(alue is the he)-.25 F .548(xadecimal v)-.15 F(alue)-.25 E F2(HHHHH-) +3.048 E(HHH)180 523.2 Q F0(\(one to eight he)2.5 E 2.5(xd)-.15 G +(igits\))-2.5 E F1(\\c)144 535.2 Q F2(x)A F0 2.5(ac)24.34 G(ontrol-)-2.5 +E F2(x)A F0(character)2.5 E(The e)108 552 Q(xpanded result is single-qu\ +oted, as if the dollar sign had not been present.)-.15 E 2.64(Ad)108 +568.8 S .14(ouble-quoted string preceded by a dollar sign \()-2.64 F F1 +($)A F0(")A F2(string)A F0 .14 +("\) will cause the string to be translated according)B .495 +(to the current locale.)108 580.8 R .495(If the current locale is)5.495 +F F1(C)2.995 E F0(or)2.995 E F1(POSIX)2.995 E F0 2.995(,t)C .495 +(he dollar sign is ignored.)-2.995 F .496(If the string is trans-)5.496 +F(lated and replaced, the replacement is double-quoted.)108 592.8 Q/F4 +10.95/Times-Bold@0 SF -.81(PA)72 609.6 S(RAMETERS).81 E F0(A)108 621.6 Q +F2(par)4.593 E(ameter)-.15 E F0 .843(is an entity that stores v)4.073 F +3.343(alues. It)-.25 F .843(can be a)3.343 F F2(name)3.342 E F0 3.342 +(,an).18 G(umber)-3.342 E 3.342(,o)-.4 G 3.342(ro)-3.342 G .842 +(ne of the special characters)-3.342 F .822(listed belo)108 633.6 R +3.323(wu)-.25 G(nder)-3.323 E F1 .823(Special P)3.323 F(arameters)-.1 E +F0 5.823(.A)C F2(variable)-2.21 E F0 .823(is a parameter denoted by a) +3.503 F F2(name)3.323 E F0 5.823(.A).18 G -.25(va)-2.5 G .823 +(riable has a).25 F F2(value)108 645.6 Q F0 .369(and zero or more)2.869 +F F2(attrib)2.869 E(utes)-.2 E F0 5.369(.A)C(ttrib)-5.369 E .369 +(utes are assigned using the)-.2 F F1(declar)2.868 E(e)-.18 E F0 -.2(bu) +2.868 G .368(iltin command \(see).2 F F1(declar)2.868 E(e)-.18 E F0 +(belo)108 657.6 Q 2.5(wi)-.25 G(n)-2.5 E F3(SHELL B)2.5 E(UIL)-.09 E +(TIN COMMANDS)-.828 E/F5 9/Times-Roman@0 SF(\).)A F0 2.754(Ap)108 674.4 +S .254(arameter is set if it has been assigned a v)-2.754 F 2.754 +(alue. The)-.25 F .254(null string is a v)2.754 F .255(alid v)-.25 F +2.755(alue. Once)-.25 F 2.755(av)2.755 G .255(ariable is set, it)-3.005 +F(may be unset only by using the)108 686.4 Q F1(unset)2.5 E F0 -.2(bu) +2.5 G(iltin command \(see).2 E F3(SHELL B)2.5 E(UIL)-.09 E(TIN COMMANDS) +-.828 E F0(belo)2.25 E(w\).)-.25 E(A)108 703.2 Q F2(variable)2.79 E F0 +(may be assigned to by a statement of the form)2.68 E F2(name)144 720 Q +F0(=[)A F2(value)A F0(])A(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E +(8)195.95 E 0 Cg EP +%%Page: 9 9 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(If)108 84 Q/F1 10/Times-Italic@0 SF(value)3.023 E F0 .233 +(is not gi)2.913 F -.15(ve)-.25 G .233(n, the v).15 F .232 +(ariable is assigned the null string.)-.25 F(All)5.232 E F1(values)3.022 +E F0(under)3.002 E .232(go tilde e)-.18 F .232(xpansion, parameter)-.15 +F .515(and v)108 96 R .515(ariable e)-.25 F .515 +(xpansion, command substitution, arithmetic e)-.15 F .515 +(xpansion, and quote remo)-.15 F -.25(va)-.15 G 3.015(l\().25 G(see) +-3.015 E/F2 9/Times-Bold@0 SF(EXP)3.015 E(ANSION)-.666 E F0(belo)108 108 +Q 2.699(w\). If)-.25 F .199(the v)2.699 F .199(ariable has its)-.25 F/F3 +10/Times-Bold@0 SF(integer)2.698 E F0(attrib)2.698 E .198(ute set, then) +-.2 F F1(value)2.988 E F0 .198(is e)2.878 F -.25(va)-.25 G .198 +(luated as an arithmetic e).25 F .198(xpression e)-.15 F -.15(ve)-.25 G +(n).15 E .901(if the $\(\(...\)\) e)108 120 R .901 +(xpansion is not used \(see)-.15 F F3 .901(Arithmetic Expansion)3.401 F +F0(belo)3.401 E 3.402(w\). W)-.25 F .902 +(ord splitting is not performed,)-.8 F 1.179(with the e)108 132 R 1.179 +(xception of)-.15 F F3("$@")3.679 E F0 1.179(as e)3.679 F 1.179 +(xplained belo)-.15 F 3.679(wu)-.25 G(nder)-3.679 E F3 1.178(Special P) +3.678 F(arameters)-.1 E F0 6.178(.P)C 1.178(athname e)-6.328 F 1.178 +(xpansion is not)-.15 F 3.648(performed. Assignment)108 144 R 1.148 +(statements may also appear as ar)3.648 F 1.149(guments to the)-.18 F F3 +(alias)3.649 E F0(,)A F3(declar)3.649 E(e)-.18 E F0(,)A F3(typeset)3.649 +E F0(,)A F3(export)3.649 E F0(,)A F3 -.18(re)108 156 S(adonly).18 E F0 +2.63(,a)C(nd)-2.63 E F3(local)2.63 E F0 -.2(bu)2.63 G .13 +(iltin commands.).2 F .13(When in)5.13 F F1 .129(posix mode)2.629 F F0 +2.629(,t)C .129(hese b)-2.629 F .129 +(uiltins may appear in a command after)-.2 F +(one or more instances of the)108 168 Q F3(command)2.5 E F0 -.2(bu)2.5 G +(iltin and retain these assignment statement properties.).2 E .376 +(In the conte)108 184.8 R .376 +(xt where an assignment statement is assigning a v)-.15 F .376 +(alue to a shell v)-.25 F .377(ariable or array inde)-.25 F .377 +(x, the +=)-.15 F .257 +(operator can be used to append to or add to the v)108 196.8 R(ariable') +-.25 E 2.757(sp)-.55 G(re)-2.757 E .257(vious v)-.25 F 2.757(alue. When) +-.25 F .257(+= is applied to a v)2.757 F(ariable)-.25 E .36 +(for which the)108 208.8 R F1(inte)2.86 E -.1(ge)-.4 G(r).1 E F0(attrib) +2.86 E .36(ute has been set,)-.2 F F1(value)2.86 E F0 .361(is e)2.861 F +-.25(va)-.25 G .361(luated as an arithmetic e).25 F .361 +(xpression and added to the)-.15 F -.25(va)108 220.8 S(riable').25 E +2.889(sc)-.55 G .389(urrent v)-2.889 F .389(alue, which is also e)-.25 F +-.25(va)-.25 G 2.889(luated. When).25 F .389 +(+= is applied to an array v)2.889 F .388(ariable using compound)-.25 F +.185(assignment \(see)108 232.8 R F3(Arrays)2.685 E F0(belo)2.685 E .185 +(w\), the v)-.25 F(ariable')-.25 E 2.685(sv)-.55 G .185 +(alue is not unset \(as it is when using =\), and ne)-2.935 F 2.686(wv) +-.25 G .186(alues are)-2.936 F 1.385(appended to the array be)108 244.8 +R 1.384(ginning at one greater than the array')-.15 F 3.884(sm)-.55 G +1.384(aximum inde)-3.884 F 3.884(x\()-.15 G 1.384(for inde)-3.884 F -.15 +(xe)-.15 G 3.884(da).15 G 1.384(rrays\) or)-3.884 F .122 +(added as additional k)108 256.8 R -.15(ey)-.1 G.15 E .122 +(alue pairs in an associati)-.25 F .423 -.15(ve a)-.25 H(rray).15 E +5.123(.W)-.65 G .123(hen applied to a string-v)-5.123 F .123(alued v) +-.25 F(ariable,)-.25 E F1(value)2.623 E F0(is e)108 268.8 Q +(xpanded and appended to the v)-.15 E(ariable')-.25 E 2.5(sv)-.55 G +(alue.)-2.75 E 3.383(Av)108 285.6 S .883(ariable can be assigned the) +-3.633 F F1(namer)3.382 E(ef)-.37 E F0(attrib)3.382 E .882 +(ute using the)-.2 F F33.382 E F0 .882(option to the)3.382 F F3 +(declar)3.382 E(e)-.18 E F0(or)3.382 E F3(local)3.382 E F0 -.2(bu)3.382 +G .882(iltin com-).2 F .315(mands \(see the descriptions of)108 297.6 R +F3(declar)2.815 E(e)-.18 E F0(and)2.815 E F3(local)2.815 E F0(belo)2.815 +E .316(w\) to create a)-.25 F F1(namer)2.816 E(ef)-.37 E F0 2.816(,o)C +2.816(rar)-2.816 G .316(eference to another v)-2.816 F(ari-)-.25 E 3.335 +(able. This)108 309.6 R(allo)3.335 E .835(ws v)-.25 F .835 +(ariables to be manipulated indirectly)-.25 F 5.835(.W)-.65 G(hene) +-5.835 E -.15(ve)-.25 G 3.335(rt).15 G .835(he nameref v)-3.335 F .835 +(ariable is referenced or)-.25 F .021 +(assigned to, the operation is actually performed on the v)108 321.6 R +.021(ariable speci\214ed by the nameref v)-.25 F(ariable')-.25 E 2.522 +(sv)-.55 G 2.522(alue. A)-2.772 F .819 +(nameref is commonly used within shell functions to refer to a v)108 +333.6 R .818(ariable whose name is passed as an ar)-.25 F(gu-)-.18 E +.131(ment to the function.)108 345.6 R -.15(Fo)5.131 G 2.631(ri).15 G +.131(nstance, if a v)-2.631 F .132 +(ariable name is passed to a shell function as its \214rst ar)-.25 F +.132(gument, run-)-.18 F(ning)108 357.6 Q/F4 10/Courier@0 SF +(declare -n ref=$1)144 375.6 Q F0 .303 +(inside the function creates a nameref v)108 393.6 R(ariable)-.25 E F3 +-.18(re)2.803 G(f).18 E F0 .303(whose v)2.803 F .303(alue is the v)-.25 +F .302(ariable name passed as the \214rst ar)-.25 F(gu-)-.18 E 3.318 +(ment. References)108 405.6 R .818(and assignments to)3.318 F F3 -.18 +(re)3.318 G(f).18 E F0 .818 +(are treated as references and assignments to the v)3.318 F .818 +(ariable whose)-.25 F .275(name w)108 417.6 R .275(as passed as)-.1 F F3 +($1)2.775 E F0 5.275(.I)C 2.775(ft)-5.275 G .275(he control v)-2.775 F +.275(ariable in a)-.25 F F3 -.25(fo)2.775 G(r).25 E F0 .275 +(loop has the nameref attrib)2.775 F .274(ute, the list of w)-.2 F .274 +(ords can)-.1 F .354(be a list of shell v)108 429.6 R .354 +(ariables, and a name reference will be established for each w)-.25 F +.355(ord in the list, in turn, when)-.1 F .086(the loop is e)108 441.6 R +-.15(xe)-.15 G 2.586(cuted. Array).15 F -.25(va)2.586 G .086 +(riables cannot be gi).25 F -.15(ve)-.25 G 2.586(nt).15 G(he)-2.586 E F3 +2.586 E F0(attrib)2.585 E 2.585(ute. Ho)-.2 F(we)-.25 E -.15(ve) +-.25 G .885 -.4(r, n).15 H .085(ameref v).4 F .085(ariables can ref-) +-.25 F .883(erence array v)108 453.6 R .883 +(ariables and subscripted array v)-.25 F 3.383(ariables. Namerefs)-.25 F +.883(can be unset using the)3.383 F F33.383 E F0 .884 +(option to the)3.383 F F3(unset)108 465.6 Q F0 -.2(bu)2.558 G 2.558 +(iltin. Otherwise,).2 F(if)2.558 E F3(unset)2.558 E F0 .058(is e)2.558 F +-.15(xe)-.15 G .058(cuted with the name of a nameref v).15 F .057 +(ariable as an ar)-.25 F .057(gument, the v)-.18 F(ari-)-.25 E +(able referenced by the nameref v)108 477.6 Q(ariable will be unset.) +-.25 E F3 -.2(Po)87 494.4 S(sitional P).2 E(arameters)-.1 E F0(A)108 +506.4 Q F1 .705(positional par)4.455 F(ameter)-.15 E F0 .706(is a param\ +eter denoted by one or more digits, other than the single digit 0.)3.935 +F(Posi-)5.706 E .445(tional parameters are assigned from the shell')108 +518.4 R 2.944(sa)-.55 G -.18(rg)-2.944 G .444(uments when it is in).18 F +-.2(vo)-.4 G -.1(ke).2 G .444(d, and may be reassigned using).1 F(the) +108 530.4 Q F3(set)3.333 E F0 -.2(bu)3.333 G .833(iltin command.).2 F +.834(Positional parameters may not be assigned to with assignment state\ +ments.)5.833 F(The)5.834 E .334(positional parameters are temporarily r\ +eplaced when a shell function is e)108 542.4 R -.15(xe)-.15 G .333 +(cuted \(see).15 F F2(FUNCTIONS)2.833 E F0(belo)2.583 E(w\).)-.25 E +1.403(When a positional parameter consisting of more than a single digi\ +t is e)108 559.2 R 1.404(xpanded, it must be enclosed in)-.15 F +(braces \(see)108 571.2 Q F2(EXP)2.5 E(ANSION)-.666 E F0(belo)2.25 E +(w\).)-.25 E F3(Special P)87 588 Q(arameters)-.1 E F0 1.675 +(The shell treats se)108 600 R -.15(ve)-.25 G 1.675 +(ral parameters specially).15 F 6.675(.T)-.65 G 1.674 +(hese parameters may only be referenced; assignment to)-6.675 F +(them is not allo)108 612 Q(wed.)-.25 E F3(*)108 624 Q F0 .223 +(Expands to the positional parameters, starting from one.)31 F .224 +(When the e)5.224 F .224(xpansion is not within double)-.15 F .663 +(quotes, each positional parameter e)144 636 R .662 +(xpands to a separate w)-.15 F 3.162(ord. In)-.1 F(conte)3.162 E .662 +(xts where it is performed,)-.15 F 1.081(those w)144 648 R 1.081 +(ords are subject to further w)-.1 F 1.082(ord splitting and pathname e) +-.1 F 3.582(xpansion. When)-.15 F 1.082(the e)3.582 F(xpansion)-.15 E +.915(occurs within double quotes, it e)144 660 R .914 +(xpands to a single w)-.15 F .914(ord with the v)-.1 F .914 +(alue of each parameter sepa-)-.25 F .89 +(rated by the \214rst character of the)144 672 R F2(IFS)3.39 E F0 .89 +(special v)3.14 F 3.39(ariable. That)-.25 F .891(is, ")3.391 F F3($*)A +F0 3.391("i)C 3.391(se)-3.391 G(qui)-3.391 E -.25(va)-.25 G .891 +(lent to ").25 F F3($1)A F1(c)A F3($2)A F1(c)A F3(...)A F0(",)A(where) +144 684 Q F1(c)3.533 E F0 .832(is the \214rst character of the v)3.643 F +.832(alue of the)-.25 F F2(IFS)3.332 E F0 -.25(va)3.082 G 3.332 +(riable. If).25 F F2(IFS)3.332 E F0 .832(is unset, the parameters are) +3.082 F(separated by spaces.)144 696 Q(If)5 E F2(IFS)2.5 E F0 +(is null, the parameters are joined without interv)2.25 E +(ening separators.)-.15 E F3(@)108 708 Q F0 .605 +(Expands to the positional parameters, starting from one.)26.7 F .606 +(When the e)5.605 F .606(xpansion occurs within dou-)-.15 F .114 +(ble quotes, each parameter e)144 720 R .114(xpands to a separate w)-.15 +F 2.614(ord. That)-.1 F .113(is, ")2.613 F F3($@)A F0 2.613("i)C 2.613 +(se)-2.613 G(qui)-2.613 E -.25(va)-.25 G .113(lent to ").25 F F3($1)A F0 +2.613("")C F3($2)-2.613 E F0 2.613(".)C(..)-2.613 E(GNU Bash 4.3)72 768 +Q(2014 February 2)141.79 E(9)195.95 E 0 Cg EP +%%Page: 10 10 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .134(If the double-quoted e)144 84 R .134 +(xpansion occurs within a w)-.15 F .135(ord, the e)-.1 F .135 +(xpansion of the \214rst parameter is joined)-.15 F .151(with the be)144 +96 R .151(ginning part of the original w)-.15 F .151(ord, and the e)-.1 +F .15(xpansion of the last parameter is joined with)-.15 F .337 +(the last part of the original w)144 108 R 2.837(ord. When)-.1 F .338 +(there are no positional parameters, ")2.837 F/F1 10/Times-Bold@0 SF($@) +A F0 2.838("a)C(nd)-2.838 E F1($@)2.838 E F0 -.15(ex)2.838 G(pand).15 E +(to nothing \(i.e., the)144 120 Q 2.5(ya)-.15 G(re remo)-2.5 E -.15(ve) +-.15 G(d\).).15 E F1(#)108 132 Q F0 +(Expands to the number of positional parameters in decimal.)31 E F1(?) +108 144 Q F0(Expands to the e)31 E(xit status of the most recently e) +-.15 E -.15(xe)-.15 G(cuted fore).15 E(ground pipeline.)-.15 E F1108 +156 Q F0 .882 +(Expands to the current option \215ags as speci\214ed upon in)30.3 F -.2 +(vo)-.4 G .881(cation, by the).2 F F1(set)3.381 E F0 -.2(bu)3.381 G .881 +(iltin command, or).2 F(those set by the shell itself \(such as the)144 +168 Q F12.5 E F0(option\).)2.5 E F1($)108 180 Q F0 .214 +(Expands to the process ID of the shell.)31 F .214 +(In a \(\) subshell, it e)5.214 F .214 +(xpands to the process ID of the current)-.15 F +(shell, not the subshell.)144 192 Q F1(!)108 204 Q F0 .499(Expands to t\ +he process ID of the job most recently placed into the background, whet\ +her e)32.67 F -.15(xe)-.15 G(cuted).15 E +(as an asynchronous command or using the)144 216 Q F1(bg)2.5 E F0 -.2 +(bu)2.5 G(iltin \(see).2 E/F2 9/Times-Bold@0 SF(JOB CONTR)2.5 E(OL)-.27 +E F0(belo)2.25 E(w\).)-.25 E F1(0)108 228 Q F0 1.691 +(Expands to the name of the shell or shell script.)31 F 1.692 +(This is set at shell initialization.)6.692 F(If)6.692 E F1(bash)4.192 E +F0(is)4.192 E(in)144 240 Q -.2(vo)-.4 G -.1(ke).2 G 3.078(dw).1 G .578 +(ith a \214le of commands,)-3.078 F F1($0)3.078 E F0 .578 +(is set to the name of that \214le.)3.078 F(If)5.577 E F1(bash)3.077 E +F0 .577(is started with the)3.077 F F13.077 E F0 .368 +(option, then)144 252 R F1($0)2.869 E F0 .369(is set to the \214rst ar) +2.869 F .369(gument after the string to be e)-.18 F -.15(xe)-.15 G .369 +(cuted, if one is present.).15 F(Other)5.369 E(-)-.2 E +(wise, it is set to the \214lename used to in)144 264 Q -.2(vo)-.4 G -.1 +(ke).2 G F1(bash)2.6 E F0 2.5(,a)C 2.5(sg)-2.5 G -2.15 -.25(iv e)-2.5 H +2.5(nb).25 G 2.5(ya)-2.5 G -.18(rg)-2.5 G(ument zero.).18 E F1(_)108 276 +Q F0 .055(At shell startup, set to the absolute pathname used to in)31 F +-.2(vo)-.4 G .255 -.1(ke t).2 H .054(he shell or shell script being e).1 +F -.15(xe)-.15 G(cuted).15 E .691(as passed in the en)144 288 R .691 +(vironment or ar)-.4 F .691(gument list.)-.18 F(Subsequently)5.691 E +3.191(,e)-.65 G .692(xpands to the last ar)-3.341 F .692(gument to the) +-.18 F(pre)144 300 Q .571(vious command, after e)-.25 F 3.071 +(xpansion. Also)-.15 F .571(set to the full pathname used to in)3.071 F +-.2(vo)-.4 G .77 -.1(ke e).2 H .57(ach command).1 F -.15(exe)144 312 S +1.6(cuted and placed in the en).15 F 1.6(vironment e)-.4 F 1.6 +(xported to that command.)-.15 F 1.6(When checking mail, this)6.6 F +(parameter holds the name of the mail \214le currently being check)144 +324 Q(ed.)-.1 E F1(Shell V)87 340.8 Q(ariables)-.92 E F0(The follo)108 +352.8 Q(wing v)-.25 E(ariables are set by the shell:)-.25 E F1 -.3(BA) +108 369.6 S(SH).3 E F0(Expands to the full \214lename used to in)9.07 E +-.2(vo)-.4 G .2 -.1(ke t).2 H(his instance of).1 E F1(bash)2.5 E F0(.)A +F1 -.3(BA)108 381.6 S(SHOPTS).3 E F0 2.549(Ac)144 393.6 S .049 +(olon-separated list of enabled shell options.)-2.549 F .049(Each w) +5.049 F .049(ord in the list is a v)-.1 F .049(alid ar)-.25 F .049 +(gument for the)-.18 F F12.548 E F0 1.398(option to the)144 405.6 +R F1(shopt)3.898 E F0 -.2(bu)3.898 G 1.398(iltin command \(see).2 F F2 +1.398(SHELL B)3.898 F(UIL)-.09 E 1.398(TIN COMMANDS)-.828 F F0(belo) +3.648 E 3.898(w\). The)-.25 F(options)3.898 E .477(appearing in)144 +417.6 R F2 -.27(BA)2.977 G(SHOPTS).27 E F0 .477(are those reported as) +2.727 F/F3 10/Times-Italic@0 SF(on)3.207 E F0(by)3.217 E F1(shopt)2.977 +E F0 5.476(.I)C 2.976(ft)-5.476 G .476(his v)-2.976 F .476 +(ariable is in the en)-.25 F(vironment)-.4 E(when)144 429.6 Q F1(bash) +3.141 E F0 .642(starts up, each shell option in the list will be enable\ +d before reading an)3.141 F 3.142(ys)-.15 G .642(tartup \214les.)-3.142 +F(This v)144 441.6 Q(ariable is read-only)-.25 E(.)-.65 E F1 -.3(BA)108 +453.6 S(SHPID).3 E F0 .188(Expands to the process ID of the current)144 +465.6 R F1(bash)2.688 E F0 2.687(process. This)2.687 F(dif)2.687 E .187 +(fers from)-.25 F F1($$)2.687 E F0 .187(under certain circum-)2.687 F +(stances, such as subshells that do not require)144 477.6 Q F1(bash)2.5 +E F0(to be re-initialized.)2.5 E F1 -.3(BA)108 489.6 S(SH_ALIASES).3 E +F0 1.195(An associati)144 501.6 R 1.495 -.15(ve a)-.25 H 1.195(rray v) +.15 F 1.195(ariable whose members correspond to the internal list of al\ +iases as main-)-.25 F .025(tained by the)144 513.6 R F1(alias)2.524 E F0 +-.2(bu)2.524 G 2.524(iltin. Elements).2 F .024 +(added to this array appear in the alias list; unsetting array ele-) +2.524 F(ments cause aliases to be remo)144 525.6 Q -.15(ve)-.15 G 2.5 +(df).15 G(rom the alias list.)-2.5 E F1 -.3(BA)108 537.6 S(SH_ARGC).3 E +F0 .934(An array v)144 549.6 R .934(ariable whose v)-.25 F .934 +(alues are the number of parameters in each frame of the current)-.25 F +F1(bash)3.435 E F0 -.15(exe)144 561.6 S .535(cution call stack.).15 F +.535(The number of parameters to the current subroutine \(shell functio\ +n or script)5.535 F -.15(exe)144 573.6 S .141(cuted with).15 F F1(.) +2.641 E F0(or)2.641 E F1(sour)2.641 E(ce)-.18 E F0 2.641(\)i)C 2.641(sa) +-2.641 G 2.641(tt)-2.641 G .142(he top of the stack.)-2.641 F .142 +(When a subroutine is e)5.142 F -.15(xe)-.15 G .142 +(cuted, the number of).15 F 2.631(parameters passed is pushed onto)144 +585.6 R F2 -.27(BA)5.13 G(SH_ARGC).27 E/F4 9/Times-Roman@0 SF(.)A F0 +2.63(The shell sets)7.13 F F2 -.27(BA)5.13 G(SH_ARGC).27 E F0 2.63 +(only when in)4.88 F -.15(ex)144 597.6 S(tended deb).15 E +(ugging mode \(see the description of the)-.2 E F1(extdeb)2.5 E(ug)-.2 E +F0(option to the)2.5 E F1(shopt)2.5 E F0 -.2(bu)2.5 G(iltin belo).2 E +(w\))-.25 E F1 -.3(BA)108 609.6 S(SH_ARGV).3 E F0 .979(An array v)144 +621.6 R .979(ariable containing all of the parameters in the current) +-.25 F F1(bash)3.48 E F0 -.15(exe)3.48 G .98(cution call stack.).15 F +(The)5.98 E .275(\214nal parameter of the last subroutine call is at th\ +e top of the stack; the \214rst parameter of the initial)144 633.6 R +1.424(call is at the bottom.)144 645.6 R 1.424(When a subroutine is e) +6.424 F -.15(xe)-.15 G 1.424 +(cuted, the parameters supplied are pushed onto).15 F F2 -.27(BA)144 +657.6 S(SH_ARGV).27 E F4(.)A F0 2.197(The shell sets)6.697 F F2 -.27(BA) +4.697 G(SH_ARGV).27 E F0 2.197(only when in e)4.447 F 2.197(xtended deb) +-.15 F 2.197(ugging mode \(see the)-.2 F(description of the)144 669.6 Q +F1(extdeb)2.5 E(ug)-.2 E F0(option to the)2.5 E F1(shopt)2.5 E F0 -.2 +(bu)2.5 G(iltin belo).2 E(w\))-.25 E F1 -.3(BA)108 681.6 S(SH_CMDS).3 E +F0 .667(An associati)144 693.6 R .967 -.15(ve a)-.25 H .667(rray v).15 F +.668(ariable whose members correspond to the internal hash table of com\ +mands)-.25 F .147(as maintained by the)144 705.6 R F1(hash)2.647 E F0 +-.2(bu)2.646 G 2.646(iltin. Elements).2 F .146 +(added to this array appear in the hash table; unsetting)2.646 F +(array elements cause commands to be remo)144 717.6 Q -.15(ve)-.15 G 2.5 +(df).15 G(rom the hash table.)-2.5 E(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(10)190.95 E 0 Cg EP +%%Page: 11 11 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF -.3(BA)108 84 S(SH_COMMAND).3 E F0 1.242 +(The command currently being e)144 96 R -.15(xe)-.15 G 1.243 +(cuted or about to be e).15 F -.15(xe)-.15 G 1.243 +(cuted, unless the shell is e).15 F -.15(xe)-.15 G 1.243(cuting a).15 F +(command as the result of a trap, in which case it is the command e)144 +108 Q -.15(xe)-.15 G(cuting at the time of the trap.).15 E F1 -.3(BA)108 +120 S(SH_EXECUTION_STRING).3 E F0(The command ar)144 132 Q +(gument to the)-.18 E F12.5 E F0(in)2.5 E -.2(vo)-.4 G +(cation option.).2 E F1 -.3(BA)108 144 S(SH_LINENO).3 E F0 .693 +(An array v)144 156 R .692(ariable whose members are the line numbers i\ +n source \214les where each corresponding)-.25 F .969(member of)144 168 +R/F2 9/Times-Bold@0 SF(FUNCN)3.469 E(AME)-.18 E F0 -.1(wa)3.219 G 3.469 +(si).1 G -1.9 -.4(nv o)-3.469 H -.1(ke).4 G(d.).1 E F1(${B)5.969 E +(ASH_LINENO[)-.3 E/F3 10/Times-Italic@0 SF($i)A F1(]})A F0 .97 +(is the line number in the source)3.469 F 14.672(\214le \()144 180 R F1 +(${B)A(ASH_SOURCE[)-.3 E F3($i+1)A F1(]})A F0 17.172(\)w)C(here)-17.172 +E F1(${FUNCN)17.172 E(AME[)-.2 E F3($i)A F1(]})A F0 -.1(wa)17.172 G +17.171(sc).1 G 14.671(alled \(or)-17.171 F F1(${B)144 192 Q(ASH_LINENO[) +-.3 E F3($i-1)A F1(]})A F0 .115 +(if referenced within another shell function\).)2.615 F(Use)5.115 E F2 +(LINENO)2.615 E F0 .115(to obtain the)2.365 F(current line number)144 +204 Q(.)-.55 E F1 -.3(BA)108 216 S(SH_REMA).3 E(TCH)-.95 E F0 .006 +(An array v)144 228 R .006(ariable whose members are assigned by the) +-.25 F F1(=~)2.506 E F0 .005(binary operator to the)2.506 F F1([[)2.505 +E F0 .005(conditional com-)2.505 F 2.506(mand. The)144 240 R .007 +(element with inde)2.506 F 2.507(x0i)-.15 G 2.507(st)-2.507 G .007 +(he portion of the string matching the entire re)-2.507 F .007(gular e) +-.15 F(xpression.)-.15 E .998(The element with inde)144 252 R(x)-.15 E +F3(n)3.498 E F0 .997(is the portion of the string matching the)3.498 F +F3(n)3.497 E F0 .997(th parenthesized sube)B(xpres-)-.15 E 2.5 +(sion. This)144 264 R -.25(va)2.5 G(riable is read-only).25 E(.)-.65 E +F1 -.3(BA)108 276 S(SH_SOURCE).3 E F0 .125(An array v)144 288 R .125(ar\ +iable whose members are the source \214lenames where the corresponding \ +shell function)-.25 F .781(names in the)144 300 R F2(FUNCN)3.28 E(AME) +-.18 E F0 .78(array v)3.03 F .78(ariable are de\214ned.)-.25 F .78 +(The shell function)5.78 F F1(${FUNCN)3.28 E(AME[)-.2 E F3($i)A F1(]})A +F0(is)3.28 E(de\214ned in the \214le)144 312 Q F1(${B)2.5 E(ASH_SOURCE[) +-.3 E F3($i)A F1(]})A F0(and called from)2.5 E F1(${B)2.5 E(ASH_SOURCE[) +-.3 E F3($i+1)A F1(]})A F0(.)A F1 -.3(BA)108 324 S(SH_SUBSHELL).3 E F0 +.296(Incremented by one within each subshell or subshell en)144 336 R +.296(vironment when the shell be)-.4 F .297(gins e)-.15 F -.15(xe)-.15 G +(cuting).15 E(in that en)144 348 Q 2.5(vironment. The)-.4 F(initial v) +2.5 E(alue is 0.)-.25 E F1 -.3(BA)108 360 S(SH_VERSINFO).3 E F0 2.645 +(Ar)144 372 S .145(eadonly array v)-2.645 F .144 +(ariable whose members hold v)-.25 F .144 +(ersion information for this instance of)-.15 F F1(bash)2.644 E F0 5.144 +(.T)C(he)-5.144 E -.25(va)144 384 S +(lues assigned to the array members are as follo).25 E(ws:)-.25 E F1 -.3 +(BA)144 402 S(SH_VERSINFO[).3 E F0(0)A F1(])A F0(The major v)24.74 E +(ersion number \(the)-.15 E F3 -.37(re)2.5 G(lease).37 E F0(\).)A F1 -.3 +(BA)144 414 S(SH_VERSINFO[).3 E F0(1)A F1(])A F0(The minor v)24.74 E +(ersion number \(the)-.15 E F3(ver)2.5 E(sion)-.1 E F0(\).)A F1 -.3(BA) +144 426 S(SH_VERSINFO[).3 E F0(2)A F1(])A F0(The patch le)24.74 E -.15 +(ve)-.25 G(l.).15 E F1 -.3(BA)144 438 S(SH_VERSINFO[).3 E F0(3)A F1(])A +F0(The b)24.74 E(uild v)-.2 E(ersion.)-.15 E F1 -.3(BA)144 450 S +(SH_VERSINFO[).3 E F0(4)A F1(])A F0(The release status \(e.g.,)24.74 E +F3(beta1)2.5 E F0(\).)A F1 -.3(BA)144 462 S(SH_VERSINFO[).3 E F0(5)A F1 +(])A F0(The v)24.74 E(alue of)-.25 E F2(MA)2.5 E(CHTYPE)-.495 E/F4 9 +/Times-Roman@0 SF(.)A F1 -.3(BA)108 474 S(SH_VERSION).3 E F0 +(Expands to a string describing the v)144 486 Q +(ersion of this instance of)-.15 E F1(bash)2.5 E F0(.)A F1(COMP_CW)108 +498 Q(ORD)-.1 E F0 .396(An inde)144 510 R 2.896(xi)-.15 G(nto)-2.896 E +F1(${COMP_W)2.896 E(ORDS})-.1 E F0 .396(of the w)2.896 F .396 +(ord containing the current cursor position.)-.1 F .397(This v)5.397 F +(ari-)-.25 E 1.181(able is a)144 522 R -.25(va)-.2 G 1.181 +(ilable only in shell functions in).25 F -.2(vo)-.4 G -.1(ke).2 G 3.681 +(db).1 G 3.681(yt)-3.681 G 1.18(he programmable completion f)-3.681 F +1.18(acilities \(see)-.1 F F1(Pr)144 534 Q(ogrammable Completion)-.18 E +F0(belo)2.5 E(w\).)-.25 E F1(COMP_KEY)108 546 Q F0(The k)144 558 Q .3 +-.15(ey \()-.1 H(or \214nal k).15 E .3 -.15(ey o)-.1 H 2.5(fak).15 G .3 +-.15(ey s)-2.6 H(equence\) used to in).15 E -.2(vo)-.4 G .2 -.1(ke t).2 +H(he current completion function.).1 E F1(COMP_LINE)108 570 Q F0 1.207 +(The current command line.)144 582 R 1.208(This v)6.208 F 1.208 +(ariable is a)-.25 F -.25(va)-.2 G 1.208 +(ilable only in shell functions and e).25 F 1.208(xternal com-)-.15 F +2.849(mands in)144 594 R -.2(vo)-.4 G -.1(ke).2 G 5.349(db).1 G 5.349 +(yt)-5.349 G 2.849(he programmable completion f)-5.349 F 2.849 +(acilities \(see)-.1 F F1(Pr)5.349 E 2.848(ogrammable Completion)-.18 F +F0(belo)144 606 Q(w\).)-.25 E F1(COMP_POINT)108 618 Q F0 .666(The inde) +144 630 R 3.166(xo)-.15 G 3.166(ft)-3.166 G .666 +(he current cursor position relati)-3.166 F .966 -.15(ve t)-.25 H 3.166 +(ot).15 G .666(he be)-3.166 F .666(ginning of the current command.)-.15 +F .667(If the)5.667 F .535 +(current cursor position is at the end of the current command, the v)144 +642 R .534(alue of this v)-.25 F .534(ariable is equal to)-.25 F F1 +(${#COMP_LINE})144 654 Q F0 7.005(.T)C 2.005(his v)-7.005 F 2.005 +(ariable is a)-.25 F -.25(va)-.2 G 2.006 +(ilable only in shell functions and e).25 F 2.006(xternal commands)-.15 +F(in)144 666 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(db).1 G 2.5(yt)-2.5 G +(he programmable completion f)-2.5 E(acilities \(see)-.1 E F1(Pr)2.5 E +(ogrammable Completion)-.18 E F0(belo)2.5 E(w\).)-.25 E F1(COMP_TYPE)108 +678 Q F0 .042(Set to an inte)144 690 R .042(ger v)-.15 F .041(alue corr\ +esponding to the type of completion attempted that caused a completion) +-.25 F .337(function to be called:)144 702 R F3 -.5(TA)2.837 G(B).5 E F0 +2.837(,f)C .337(or normal completion,)-2.837 F F3(?)2.837 E F0 2.837(,f) +C .337(or listing completions after successi)-2.837 F .638 -.15(ve t) +-.25 H(abs,).15 E F3(!)144 714 Q F0 4.092(,f)C 1.592 +(or listing alternati)-4.092 F -.15(ve)-.25 G 4.092(so).15 G 4.092(np) +-4.092 G 1.592(artial w)-4.092 F 1.592(ord completion,)-.1 F F3(@)4.092 +E F0 4.092(,t)C 4.092(ol)-4.092 G 1.592(ist completions if the w)-4.092 +F 1.591(ord is not)-.1 F 1.552(unmodi\214ed, or)144 726 R F3(%)4.052 E +F0 4.052(,f)C 1.552(or menu completion.)-4.052 F 1.552(This v)6.552 F +1.552(ariable is a)-.25 F -.25(va)-.2 G 1.552 +(ilable only in shell functions and).25 F(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(11)190.95 E 0 Cg EP +%%Page: 12 12 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E -.15(ex)144 84 S 2.929(ternal commands in).15 F -.2(vo)-.4 G -.1 +(ke).2 G 5.429(db).1 G 5.429(yt)-5.429 G 2.929 +(he programmable completion f)-5.429 F 2.929(acilities \(see)-.1 F/F1 10 +/Times-Bold@0 SF(Pr)5.428 E(ogrammable)-.18 E(Completion)144 96 Q F0 +(belo)2.5 E(w\).)-.25 E F1(COMP_W)108 108 Q(ORDBREAKS)-.1 E F0 1.335 +(The set of characters that the)144 120 R F1 -.18(re)3.836 G(adline).18 +E F0 1.336(library treats as w)3.836 F 1.336 +(ord separators when performing w)-.1 F(ord)-.1 E 3.126(completion. If) +144 132 R/F2 9/Times-Bold@0 SF(COMP_W)3.126 E(ORDBREAKS)-.09 E F0 .626 +(is unset, it loses its special properties, e)2.876 F -.15(ve)-.25 G +3.125(ni).15 G 3.125(fi)-3.125 G 3.125(ti)-3.125 G 3.125(ss)-3.125 G +(ubse-)-3.125 E(quently reset.)144 144 Q F1(COMP_W)108 156 Q(ORDS)-.1 E +F0 .653(An array v)144 168 R .653(ariable \(see)-.25 F F1(Arrays)3.153 E +F0(belo)3.153 E .654(w\) consisting of the indi)-.25 F .654(vidual w) +-.25 F .654(ords in the current command)-.1 F 4.333(line. The)144 180 R +1.832(line is split into w)4.332 F 1.832(ords as)-.1 F F1 -.18(re)4.332 +G(adline).18 E F0 -.1(wo)4.332 G 1.832(uld split it, using).1 F F2 +(COMP_W)4.332 E(ORDBREAKS)-.09 E F0(as)4.082 E .831(described abo)144 +192 R -.15(ve)-.15 G 5.831(.T).15 G .831(his v)-5.831 F .831 +(ariable is a)-.25 F -.25(va)-.2 G .832 +(ilable only in shell functions in).25 F -.2(vo)-.4 G -.1(ke).2 G 3.332 +(db).1 G 3.332(yt)-3.332 G .832(he programmable)-3.332 F(completion f) +144 204 Q(acilities \(see)-.1 E F1(Pr)2.5 E(ogrammable Completion)-.18 E +F0(belo)2.5 E(w\).)-.25 E F1(COPR)108 216 Q(OC)-.3 E F0 .169(An array v) +144 228 R .169(ariable \(see)-.25 F F1(Arrays)2.669 E F0(belo)2.669 E +.169 +(w\) created to hold the \214le descriptors for output from and input) +-.25 F(to an unnamed coprocess \(see)144 240 Q F1(Copr)2.5 E(ocesses) +-.18 E F0(abo)2.5 E -.15(ve)-.15 G(\).).15 E F1(DIRST)108 252 Q -.55(AC) +-.9 G(K).55 E F0 2.26(An array v)144 264 R 2.26(ariable \(see)-.25 F F1 +(Arrays)4.76 E F0(belo)4.76 E 2.26 +(w\) containing the current contents of the directory stack.)-.25 F +1.095(Directories appear in the stack in the order the)144 276 R 3.594 +(ya)-.15 G 1.094(re displayed by the)-3.594 F F1(dirs)3.594 E F0 -.2(bu) +3.594 G 3.594(iltin. Assigning).2 F(to)3.594 E 1.431 +(members of this array v)144 288 R 1.432 +(ariable may be used to modify directories already in the stack, b)-.25 +F 1.432(ut the)-.2 F F1(pushd)144 300 Q F0(and)2.746 E F1(popd)2.746 E +F0 -.2(bu)2.746 G .246(iltins must be used to add and remo).2 F .546 +-.15(ve d)-.15 H 2.746(irectories. Assignment).15 F .246(to this v)2.746 +F(ariable)-.25 E .35(will not change the current directory)144 312 R +5.35(.I)-.65 G(f)-5.35 E F2(DIRST)2.85 E -.495(AC)-.81 G(K).495 E F0 .35 +(is unset, it loses its special properties, e)2.6 F -.15(ve)-.25 G 2.851 +(ni).15 G(f)-2.851 E(it is subsequently reset.)144 324 Q F1(EUID)108 336 +Q F0 1.104(Expands to the ef)11 F(fecti)-.25 E 1.403 -.15(ve u)-.25 H +1.103(ser ID of the current user).15 F 3.603(,i)-.4 G 1.103 +(nitialized at shell startup.)-3.603 F 1.103(This v)6.103 F 1.103 +(ariable is)-.25 F(readonly)144 348 Q(.)-.65 E F1(FUNCN)108 360 Q(AME) +-.2 E F0 .478(An array v)144 372 R .479 +(ariable containing the names of all shell functions currently in the e) +-.25 F -.15(xe)-.15 G .479(cution call stack.).15 F .277 +(The element with inde)144 384 R 2.777(x0i)-.15 G 2.777(st)-2.777 G .276 +(he name of an)-2.777 F 2.776(yc)-.15 G(urrently-e)-2.776 E -.15(xe)-.15 +G .276(cuting shell function.).15 F .276(The bottom-most)5.276 F .384 +(element \(the one with the highest inde)144 396 R .384(x\) is)-.15 F/F3 +10/Courier@0 SF("main")2.884 E F0 5.384(.T)C .384(his v)-5.384 F .385 +(ariable e)-.25 F .385(xists only when a shell func-)-.15 F .035 +(tion is e)144 408 R -.15(xe)-.15 G 2.535(cuting. Assignments).15 F(to) +2.535 E F2(FUNCN)2.535 E(AME)-.18 E F0(ha)2.285 E .335 -.15(ve n)-.2 H +2.535(oe).15 G -.25(ff)-2.535 G .035(ect and return an error status.).25 +F(If)5.034 E F2(FUNC-)2.534 E -.18(NA)144 420 S(ME).18 E F0 +(is unset, it loses its special properties, e)2.25 E -.15(ve)-.25 G 2.5 +(ni).15 G 2.5(fi)-2.5 G 2.5(ti)-2.5 G 2.5(ss)-2.5 G(ubsequently reset.) +-2.5 E .11(This v)144 438 R .111(ariable can be used with)-.25 F F1 -.3 +(BA)2.611 G(SH_LINENO).3 E F0(and)2.611 E F1 -.3(BA)2.611 G(SH_SOURCE).3 +E F0 5.111(.E)C .111(ach element of)-5.111 F F1(FUNC-)2.611 E -.2(NA)144 +450 S(ME).2 E F0 1.404(has corresponding elements in)3.904 F F1 -.3(BA) +3.904 G(SH_LINENO).3 E F0(and)3.904 E F1 -.3(BA)3.904 G(SH_SOURCE).3 E +F0 1.404(to describe the)3.904 F .012(call stack.)144 462 R -.15(Fo) +5.012 G 2.512(ri).15 G(nstance,)-2.512 E F1(${FUNCN)2.512 E(AME[)-.2 E +/F4 10/Times-Italic@0 SF($i)A F1(]})A F0 -.1(wa)2.512 G 2.512(sc).1 G +.012(alled from the \214le)-2.512 F F1(${B)2.512 E(ASH_SOURCE[)-.3 E F4 +($i+1)A F1(]})A F0 1.184(at line number)144 474 R F1(${B)3.684 E +(ASH_LINENO[)-.3 E F4($i)A F1(]})A F0 6.184(.T)C(he)-6.184 E F1(caller) +3.683 E F0 -.2(bu)3.683 G 1.183 +(iltin displays the current call stack using).2 F(this information.)144 +486 Q F1(GR)108 498 Q(OUPS)-.3 E F0 1.228(An array v)144 510 R 1.228(ar\ +iable containing the list of groups of which the current user is a memb\ +er)-.25 F 6.229(.A)-.55 G(ssign-)-6.229 E .597(ments to)144 522 R F2(GR) +3.097 E(OUPS)-.27 E F0(ha)2.847 E .897 -.15(ve n)-.2 H 3.097(oe).15 G +-.25(ff)-3.097 G .597(ect and return an error status.).25 F(If)5.597 E +F2(GR)3.097 E(OUPS)-.27 E F0 .597(is unset, it loses its spe-)2.847 F +(cial properties, e)144 534 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(fi)-2.5 G +2.5(ti)-2.5 G 2.5(ss)-2.5 G(ubsequently reset.)-2.5 E F1(HISTCMD)108 546 +Q F0 .355(The history number)144 558 R 2.855(,o)-.4 G 2.855(ri)-2.855 G +(nde)-2.855 E 2.856(xi)-.15 G 2.856(nt)-2.856 G .356 +(he history list, of the current command.)-2.856 F(If)5.356 E F2 +(HISTCMD)2.856 E F0 .356(is unset, it)2.606 F +(loses its special properties, e)144 570 Q -.15(ve)-.25 G 2.5(ni).15 G +2.5(fi)-2.5 G 2.5(ti)-2.5 G 2.5(ss)-2.5 G(ubsequently reset.)-2.5 E F1 +(HOSTN)108 582 Q(AME)-.2 E F0 +(Automatically set to the name of the current host.)144 594 Q F1 +(HOSTTYPE)108 606 Q F0 .223(Automatically set to a string that uniquely\ + describes the type of machine on which)144 618 R F1(bash)2.722 E F0 +.222(is e)2.722 F -.15(xe)-.15 G(cut-).15 E 2.5(ing. The)144 630 R(def) +2.5 E(ault is system-dependent.)-.1 E F1(LINENO)108 642 Q F0 1.408(Each\ + time this parameter is referenced, the shell substitutes a decimal num\ +ber representing the)144 654 R .078(current sequential line number \(st\ +arting with 1\) within a script or function.)144 666 R .078 +(When not in a script or)5.078 F .306(function, the v)144 678 R .306 +(alue substituted is not guaranteed to be meaningful.)-.25 F(If)5.307 E +F2(LINENO)2.807 E F0 .307(is unset, it loses its)2.557 F +(special properties, e)144 690 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(fi)-2.5 +G 2.5(ti)-2.5 G 2.5(ss)-2.5 G(ubsequently reset.)-2.5 E F1(MA)108 702 Q +(CHTYPE)-.55 E F0 .898(Automatically set to a string that fully describ\ +es the system type on which)144 714 R F1(bash)3.398 E F0 .898(is e)3.398 +F -.15(xe)-.15 G .898(cuting, in).15 F(the standard GNU)144 726 Q F4 +(cpu-company-system)2.5 E F0 2.5(format. The)2.5 F(def)2.5 E +(ault is system-dependent.)-.1 E(GNU Bash 4.3)72 768 Q(2014 February 2) +141.79 E(12)190.95 E 0 Cg EP +%%Page: 13 13 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(MAPFILE)108 84 Q F0 .293(An array v)144 96 +R .293(ariable \(see)-.25 F F1(Arrays)2.793 E F0(belo)2.793 E .293 +(w\) created to hold the te)-.25 F .294(xt read by the)-.15 F F1 +(map\214le)2.794 E F0 -.2(bu)2.794 G .294(iltin when no).2 F -.25(va)144 +108 S(riable name is supplied.).25 E F1(OLDPWD)108 120 Q F0(The pre)144 +132 Q(vious w)-.25 E(orking directory as set by the)-.1 E F1(cd)2.5 E F0 +(command.)2.5 E F1(OPT)108 144 Q(ARG)-.9 E F0 1.627(The v)144 156 R +1.627(alue of the last option ar)-.25 F 1.627(gument processed by the) +-.18 F F1(getopts)4.127 E F0 -.2(bu)4.127 G 1.626(iltin command \(see).2 +F/F2 9/Times-Bold@0 SF(SHELL)4.126 E -.09(BU)144 168 S(IL).09 E +(TIN COMMANDS)-.828 E F0(belo)2.25 E(w\).)-.25 E F1(OPTIND)108 180 Q F0 +1.651(The inde)144 192 R 4.151(xo)-.15 G 4.151(ft)-4.151 G 1.651(he ne) +-4.151 F 1.651(xt ar)-.15 F 1.652(gument to be processed by the)-.18 F +F1(getopts)4.152 E F0 -.2(bu)4.152 G 1.652(iltin command \(see).2 F F2 +(SHELL)4.152 E -.09(BU)144 204 S(IL).09 E(TIN COMMANDS)-.828 E F0(belo) +2.25 E(w\).)-.25 E F1(OSTYPE)108 216 Q F0 .329(Automatically set to a s\ +tring that describes the operating system on which)144 228 R F1(bash) +2.829 E F0 .329(is e)2.829 F -.15(xe)-.15 G 2.829(cuting. The).15 F(def) +144 240 Q(ault is system-dependent.)-.1 E F1(PIPEST)108 252 Q -.95(AT) +-.9 G(US).95 E F0 .61(An array v)144 264 R .61(ariable \(see)-.25 F F1 +(Arrays)3.11 E F0(belo)3.11 E .61(w\) containing a list of e)-.25 F .61 +(xit status v)-.15 F .61(alues from the processes in)-.25 F +(the most-recently-e)144 276 Q -.15(xe)-.15 G(cuted fore).15 E +(ground pipeline \(which may contain only a single command\).)-.15 E F1 +(PPID)108 288 Q F0(The process ID of the shell')12.67 E 2.5(sp)-.55 G +2.5(arent. This)-2.5 F -.25(va)2.5 G(riable is readonly).25 E(.)-.65 E +F1(PWD)108 300 Q F0(The current w)12.67 E +(orking directory as set by the)-.1 E F1(cd)2.5 E F0(command.)2.5 E F1 +(RANDOM)108 312 Q F0 .566 +(Each time this parameter is referenced, a random inte)144 324 R .565 +(ger between 0 and 32767 is generated.)-.15 F(The)5.565 E .01 +(sequence of random numbers may be initialized by assigning a v)144 336 +R .01(alue to)-.25 F F2(RANDOM)2.51 E/F3 9/Times-Roman@0 SF(.)A F0(If) +4.51 E F2(RANDOM)2.51 E F0(is)2.26 E +(unset, it loses its special properties, e)144 348 Q -.15(ve)-.25 G 2.5 +(ni).15 G 2.5(fi)-2.5 G 2.5(ti)-2.5 G 2.5(ss)-2.5 G(ubsequently reset.) +-2.5 E F1(READLINE_LINE)108 360 Q F0 1.547(The contents of the)144 372 R +F1 -.18(re)4.047 G(adline).18 E F0 1.547(line b)4.047 F(uf)-.2 E(fer) +-.25 E 4.047(,f)-.4 G 1.547(or use with)-4.047 F/F4 10/Courier@0 SF +1.547(bind -x)4.047 F F0(\(see)4.047 E F2 1.546(SHELL B)4.047 F(UIL)-.09 +E 1.546(TIN COM-)-.828 F(MANDS)144 384 Q F0(belo)2.25 E(w\).)-.25 E F1 +(READLINE_POINT)108 396 Q F0 .313 +(The position of the insertion point in the)144 408 R F1 -.18(re)2.813 G +(adline).18 E F0 .313(line b)2.813 F(uf)-.2 E(fer)-.25 E 2.813(,f)-.4 G +.313(or use with)-2.813 F F4 .314(bind -x)2.814 F F0(\(see)2.814 E F2 +(SHELL)2.814 E -.09(BU)144 420 S(IL).09 E(TIN COMMANDS)-.828 E F0(belo) +2.25 E(w\).)-.25 E F1(REPL)108 432 Q(Y)-.92 E F0 +(Set to the line of input read by the)144 444 Q F1 -.18(re)2.5 G(ad).18 +E F0 -.2(bu)2.5 G(iltin command when no ar).2 E(guments are supplied.) +-.18 E F1(SECONDS)108 456 Q F0 .795(Each time this parameter is referen\ +ced, the number of seconds since shell in)144 468 R -.2(vo)-.4 G .795 +(cation is returned.).2 F .712(If a v)144 480 R .712 +(alue is assigned to)-.25 F F2(SECONDS)3.212 E F3(,)A F0 .712(the v) +2.962 F .712(alue returned upon subsequent references is the number)-.25 +F .408(of seconds since the assignment plus the v)144 492 R .408 +(alue assigned.)-.25 F(If)5.408 E F2(SECONDS)2.908 E F0 .407 +(is unset, it loses its special)2.658 F(properties, e)144 504 Q -.15(ve) +-.25 G 2.5(ni).15 G 2.5(fi)-2.5 G 2.5(ti)-2.5 G 2.5(ss)-2.5 G +(ubsequently reset.)-2.5 E F1(SHELLOPTS)108 516 Q F0 3.262(Ac)144 528 S +.763(olon-separated list of enabled shell options.)-3.262 F .763(Each w) +5.763 F .763(ord in the list is a v)-.1 F .763(alid ar)-.25 F .763 +(gument for the)-.18 F F1144 540 Q F0 1.174(option to the)3.674 F +F1(set)3.674 E F0 -.2(bu)3.674 G 1.174(iltin command \(see).2 F F2 1.173 +(SHELL B)3.673 F(UIL)-.09 E 1.173(TIN COMMANDS)-.828 F F0(belo)3.423 E +3.673(w\). The)-.25 F(options)3.673 E .019(appearing in)144 552 R F2 +(SHELLOPTS)2.519 E F0 .019(are those reported as)2.269 F/F5 10 +/Times-Italic@0 SF(on)2.749 E F0(by)2.759 E F1 .019(set \255o)2.519 F F0 +5.019(.I)C 2.519(ft)-5.019 G .019(his v)-2.519 F .02 +(ariable is in the en)-.25 F(vironment)-.4 E(when)144 564 Q F1(bash) +3.142 E F0 .642(starts up, each shell option in the list will be enable\ +d before reading an)3.142 F 3.141(ys)-.15 G .641(tartup \214les.)-3.141 +F(This v)144 576 Q(ariable is read-only)-.25 E(.)-.65 E F1(SHL)108 588 Q +(VL)-.92 E F0(Incremented by one each time an instance of)144 600 Q F1 +(bash)2.5 E F0(is started.)2.5 E F1(UID)108 612 Q F0 +(Expands to the user ID of the current user)17.67 E 2.5(,i)-.4 G +(nitialized at shell startup.)-2.5 E(This v)5 E(ariable is readonly)-.25 +E(.)-.65 E .993(The follo)108 628.8 R .993(wing v)-.25 F .994 +(ariables are used by the shell.)-.25 F .994(In some cases,)5.994 F F1 +(bash)3.494 E F0 .994(assigns a def)3.494 F .994(ault v)-.1 F .994 +(alue to a v)-.25 F(ariable;)-.25 E(these cases are noted belo)108 640.8 +Q -.65(w.)-.25 G F1 -.3(BA)108 657.6 S(SH_COMP).3 E -.95(AT)-.74 G F0 +1.193(The v)144 669.6 R 1.193(alue is used to set the shell')-.25 F +3.693(sc)-.55 G 1.192(ompatibility le)-3.693 F -.15(ve)-.25 G 3.692 +(l. See).15 F 1.192(the description of the)3.692 F F1(shopt)3.692 E F0 +-.2(bu)3.692 G(iltin).2 E(belo)144 681.6 Q 2.871(wu)-.25 G(nder)-2.871 E +F1 .371(SHELL B)2.871 F(UIL)-.1 E .371(TIN COMMANDS)-.92 F F0 .372 +(for a description of the v)2.872 F .372(arious compatibility le)-.25 F +(v-)-.25 E .361(els and their ef)144 693.6 R 2.861(fects. The)-.25 F +-.25(va)2.861 G .361 +(lue may be a decimal number \(e.g., 4.2\) or an inte).25 F .36 +(ger \(e.g., 42\) corre-)-.15 F 1.75 +(sponding to the desired compatibility le)144 705.6 R -.15(ve)-.25 G +4.251(l. If).15 F F1 -.3(BA)4.251 G(SH_COMP).3 E -.95(AT)-.74 G F0 1.751 +(is unset or set to the empty)5.201 F .578(string, the compatibility le) +144 717.6 R -.15(ve)-.25 G 3.078(li).15 G 3.078(ss)-3.078 G .578 +(et to the def)-3.078 F .578(ault for the current v)-.1 F 3.078 +(ersion. If)-.15 F F1 -.3(BA)3.078 G(SH_COMP).3 E -.95(AT)-.74 G F0(is) +4.028 E .248(set to a v)144 729.6 R .248(alue that is not one of the v) +-.25 F .248(alid compatibility le)-.25 F -.15(ve)-.25 G .249 +(ls, the shell prints an error message and).15 F(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(13)190.95 E 0 Cg EP +%%Page: 14 14 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E 1.12(sets the compatibility le)144 84 R -.15(ve)-.25 G 3.62(lt) +.15 G 3.619(ot)-3.62 G 1.119(he def)-3.619 F 1.119 +(ault for the current v)-.1 F 3.619(ersion. The)-.15 F -.25(va)3.619 G +1.119(lid compatibility le).25 F -.15(ve)-.25 G(ls).15 E .575 +(correspond to the compatibility options accepted by the)144 96 R/F1 10 +/Times-Bold@0 SF(shopt)3.075 E F0 -.2(bu)3.076 G .576 +(iltin described belo).2 F 3.076(w\()-.25 G .576(for e)-3.076 F(xam-) +-.15 E(ple,)144 108 Q F1(compat42)2.5 E F0(means that 4.2 and 42 are v) +2.5 E(alid v)-.25 E 2.5(alues\). The)-.25 F(current v)2.5 E +(ersion is also a v)-.15 E(alid v)-.25 E(alue.)-.25 E F1 -.3(BA)108 120 +S(SH_ENV).3 E F0 .506(If this parameter is set when)144 132 R F1(bash) +3.006 E F0 .506(is e)3.006 F -.15(xe)-.15 G .505 +(cuting a shell script, its v).15 F .505 +(alue is interpreted as a \214lename)-.25 F .354 +(containing commands to initialize the shell, as in)144 144 R/F2 10 +/Times-Italic@0 SF(~/.bashr)2.855 E(c)-.37 E F0 5.355(.T).31 G .355 +(he v)-5.355 F .355(alue of)-.25 F/F3 9/Times-Bold@0 SF -.27(BA)2.855 G +(SH_ENV).27 E F0 .355(is subjected)2.605 F .525(to parameter e)144 156 R +.525(xpansion, command substitution, and arithmetic e)-.15 F .525 +(xpansion before being interpreted)-.15 F(as a \214lename.)144 168 Q F3 +-.666(PA)5 G(TH)-.189 E F0 +(is not used to search for the resultant \214lename.)2.25 E F1 -.3(BA) +108 180 S(SH_XTRA).3 E(CEFD)-.55 E F0 .48(If set to an inte)144 192 R +.48(ger corresponding to a v)-.15 F .481(alid \214le descriptor)-.25 F +(,)-.4 E F1(bash)2.981 E F0 .481(will write the trace output gener)2.981 +F(-)-.2 E 3.114(ated when)144 204 R/F4 10/Courier@0 SF 3.114(set -x) +5.614 F F0 3.114(is enabled to that \214le descriptor)5.614 F 8.114(.T) +-.55 G 3.114(he \214le descriptor is closed when)-8.114 F F3 -.27(BA)144 +216 S(SH_XTRA).27 E(CEFD)-.495 E F0 .138(is unset or assigned a ne)2.388 +F 2.638(wv)-.25 G 2.638(alue. Unsetting)-2.888 F F3 -.27(BA)2.638 G +(SH_XTRA).27 E(CEFD)-.495 E F0 .138(or assigning it)2.388 F 2.531(the e\ +mpty string causes the trace output to be sent to the standard error)144 +228 R 7.53(.N)-.55 G 2.53(ote that setting)-7.53 F F3 -.27(BA)144 240 S +(SH_XTRA).27 E(CEFD)-.495 E F0 .74(to 2 \(the standard error \214le des\ +criptor\) and then unsetting it will result in the)2.99 F +(standard error being closed.)144 252 Q F1(CDP)108 264 Q -.95(AT)-.74 G +(H).95 E F0 1.248(The search path for the)144 276 R F1(cd)3.748 E F0 +3.748(command. This)3.748 F 1.247 +(is a colon-separated list of directories in which the)3.748 F 3.795 +(shell looks for destination directories speci\214ed by the)144 288 R F1 +(cd)6.295 E F0 6.296(command. A)6.296 F 3.796(sample v)6.296 F 3.796 +(alue is)-.25 F F4(".:~:/usr")144 300 Q F0(.)A F1(CHILD_MAX)108 312 Q F0 +.997(Set the number of e)144 324 R .997(xited child status v)-.15 F .997 +(alues for the shell to remember)-.25 F 5.997(.B)-.55 G .997 +(ash will not allo)-5.997 F 3.497(wt)-.25 G(his)-3.497 E -.25(va)144 336 +S 1.077(lue to be decreased belo).25 F 3.577(waP)-.25 G 1.077 +(OSIX-mandated minimum, and there is a maximum v)-3.577 F 1.078 +(alue \(cur)-.25 F(-)-.2 E(rently 8192\) that this may not e)144 348 Q +2.5(xceed. The)-.15 F(minimum v)2.5 E(alue is system-dependent.)-.25 E +F1(COLUMNS)108 360 Q F0 .829(Used by the)144 372 R F1(select)3.329 E F0 +.828(compound command to determine the terminal width when printing sel\ +ection)3.329 F 4.506(lists. Automatically)144 384 R 2.006(set if the) +4.506 F F1(checkwinsize)4.506 E F0 2.007 +(option is enabled or in an interacti)4.506 F 2.307 -.15(ve s)-.25 H +2.007(hell upon).15 F(receipt of a)144 396 Q F3(SIGWINCH)2.5 E/F5 9 +/Times-Roman@0 SF(.)A F1(COMPREPL)108 408 Q(Y)-.92 E F0 .848(An array v) +144 420 R .848(ariable from which)-.25 F F1(bash)3.348 E F0 .848 +(reads the possible completions generated by a shell function)3.348 F +(in)144 432 Q -.2(vo)-.4 G -.1(ke).2 G 2.785(db).1 G 2.785(yt)-2.785 G +.285(he programmable completion f)-2.785 F .285(acility \(see)-.1 F F1 +(Pr)2.785 E .285(ogrammable Completion)-.18 F F0(belo)2.785 E 2.785 +(w\). Each)-.25 F(array element contains one possible completion.)144 +444 Q F1(EMA)108 456 Q(CS)-.55 E F0(If)144 468 Q F1(bash)2.536 E F0 .036 +(\214nds this v)2.536 F .036(ariable in the en)-.25 F .036 +(vironment when the shell starts with v)-.4 F(alue)-.25 E F4(t)2.535 E +F0 2.535(,i)C 2.535(ta)-2.535 G .035(ssumes that the)-2.535 F +(shell is running in an Emacs shell b)144 480 Q(uf)-.2 E +(fer and disables line editing.)-.25 E F1(ENV)108 492 Q F0(Similar to) +14.89 E F3 -.27(BA)2.5 G(SH_ENV).27 E F5(;)A F0 +(used when the shell is in)2.25 E -.2(vo)-.4 G -.1(ke).2 G 2.5(di).1 G +2.5(nP)-2.5 G(OSIX mode.)-2.5 E F1(FCEDIT)108 504 Q F0(The def)144 516 Q +(ault editor for the)-.1 E F1(fc)2.5 E F0 -.2(bu)2.5 G(iltin command.).2 +E F1(FIGNORE)108 528 Q F0 2.598(Ac)144 540 S .098 +(olon-separated list of suf)-2.598 F<8c78>-.25 E .098 +(es to ignore when performing \214lename completion \(see)-.15 F F3 +(READLINE)2.599 E F0(belo)144 552 Q 2.705(w\). A)-.25 F .205 +(\214lename whose suf)2.705 F .205(\214x matches one of the entries in) +-.25 F F3(FIGNORE)2.705 E F0 .205(is e)2.455 F .204 +(xcluded from the list)-.15 F(of matched \214lenames.)144 564 Q 2.5(As)5 +G(ample v)-2.5 E(alue is)-.25 E F4(".o:~")2.5 E F0(.)A F1(FUNCNEST)108 +576 Q F0 1.78(If set to a numeric v)144 588 R 1.78 +(alue greater than 0, de\214nes a maximum function nesting le)-.25 F +-.15(ve)-.25 G 4.28(l. Function).15 F(in)144 600 Q -.2(vo)-.4 G +(cations that e).2 E(xceed this nesting le)-.15 E -.15(ve)-.25 G 2.5(lw) +.15 G(ill cause the current command to abort.)-2.5 E F1(GLOBIGNORE)108 +612 Q F0 3.118(Ac)144 624 S .618(olon-separated list of patterns de\214\ +ning the set of \214lenames to be ignored by pathname e)-3.118 F(xpan-) +-.15 E 3.131(sion. If)144 636 R 3.132<618c>3.131 G .632 +(lename matched by a pathname e)-3.132 F .632 +(xpansion pattern also matches one of the patterns in)-.15 F F3 +(GLOBIGNORE)144 648 Q F5(,)A F0(it is remo)2.25 E -.15(ve)-.15 G 2.5(df) +.15 G(rom the list of matches.)-2.5 E F1(HISTCONTR)108 660 Q(OL)-.3 E F0 +2.654(Ac)144 672 S .153(olon-separated list of v)-2.654 F .153 +(alues controlling ho)-.25 F 2.653(wc)-.25 G .153(ommands are sa)-2.653 +F -.15(ve)-.2 G 2.653(do).15 G 2.653(nt)-2.653 G .153(he history list.) +-2.653 F .153(If the list)5.153 F .49(of v)144 684 R .49(alues includes) +-.25 F F2(ignor)2.99 E(espace)-.37 E F0 2.99(,l).18 G .49(ines which be) +-2.99 F .491(gin with a)-.15 F F1(space)2.991 E F0 .491 +(character are not sa)2.991 F -.15(ve)-.2 G 2.991(di).15 G 2.991(nt) +-2.991 G .491(he his-)-2.991 F .558(tory list.)144 696 R 3.058(Av)5.558 +G .558(alue of)-3.308 F F2(ignor)3.068 E(edups)-.37 E F0 .558 +(causes lines matching the pre)3.328 F .557 +(vious history entry to not be sa)-.25 F -.15(ve)-.2 G(d.).15 E 2.958 +(Av)144 708 S .458(alue of)-3.208 F F2(ignor)2.968 E(eboth)-.37 E F0 +.458(is shorthand for)3.238 F F2(ignor)2.959 E(espace)-.37 E F0(and) +2.959 E F2(ignor)2.959 E(edups)-.37 E F0 5.459(.A)C -.25(va)-2.5 G .459 +(lue of).25 F F2(er)2.959 E(asedups)-.15 E F0(causes)2.959 E .699 +(all pre)144 720 R .698 +(vious lines matching the current line to be remo)-.25 F -.15(ve)-.15 G +3.198(df).15 G .698(rom the history list before that line is)-3.198 F +(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(14)190.95 E 0 Cg EP +%%Page: 15 15 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(sa)144 84 Q -.15(ve)-.2 G 2.763(d. An).15 F 2.763(yv)-.15 G .263 +(alue not in the abo)-3.013 F .563 -.15(ve l)-.15 H .263 +(ist is ignored.).15 F(If)5.263 E/F1 9/Times-Bold@0 SF(HISTCONTR)2.763 E +(OL)-.27 E F0 .264(is unset, or does not include)2.513 F 2.942(av)144 96 +S .442(alid v)-3.192 F .442 +(alue, all lines read by the shell parser are sa)-.25 F -.15(ve)-.2 G +2.941(do).15 G 2.941(nt)-2.941 G .441(he history list, subject to the v) +-2.941 F .441(alue of)-.25 F F1(HISTIGNORE)144 108 Q/F2 9/Times-Roman@0 +SF(.)A F0 1.981(The second and subsequent lines of a multi-line compoun\ +d command are not)6.481 F(tested, and are added to the history re)144 +120 Q -.05(ga)-.15 G(rdless of the v).05 E(alue of)-.25 E F1(HISTCONTR) +2.5 E(OL)-.27 E F2(.)A/F3 10/Times-Bold@0 SF(HISTFILE)108 132 Q F0 .181 +(The name of the \214le in which command history is sa)144 144 R -.15 +(ve)-.2 G 2.681(d\().15 G(see)-2.681 E F1(HIST)2.681 E(OR)-.162 E(Y) +-.315 E F0(belo)2.431 E 2.681(w\). The)-.25 F(def)2.681 E .181(ault v) +-.1 F(alue)-.25 E(is)144 156 Q/F4 10/Times-Italic@0 SF(~/.bash_history) +2.5 E F0 5(.I)C 2.5(fu)-5 G(nset, the command history is not sa)-2.5 E +-.15(ve)-.2 G 2.5(dw).15 G(hen a shell e)-2.5 E(xits.)-.15 E F3 +(HISTFILESIZE)108 168 Q F0 1.622 +(The maximum number of lines contained in the history \214le.)144 180 R +1.623(When this v)6.623 F 1.623(ariable is assigned a)-.25 F -.25(va)144 +192 S .932(lue, the history \214le is truncated, if necessary).25 F +3.432(,t)-.65 G 3.432(oc)-3.432 G .932 +(ontain no more than that number of lines by)-3.432 F(remo)144 204 Q .87 +(ving the oldest entries.)-.15 F .871(The history \214le is also trunca\ +ted to this size after writing it when a)5.87 F 1.245(shell e)144 216 R +3.745(xits. If)-.15 F 1.244(the v)3.744 F 1.244 +(alue is 0, the history \214le is truncated to zero size.)-.25 F 1.244 +(Non-numeric v)6.244 F 1.244(alues and)-.25 F 1.021(numeric v)144 228 R +1.022(alues less than zero inhibit truncation.)-.25 F 1.022 +(The shell sets the def)6.022 F 1.022(ault v)-.1 F 1.022(alue to the v) +-.25 F 1.022(alue of)-.25 F F3(HISTSIZE)144 240 Q F0(after reading an) +2.5 E 2.5(ys)-.15 G(tartup \214les.)-2.5 E F3(HISTIGNORE)108 252 Q F0 +2.658(Ac)144 264 S .158(olon-separated list of patterns used to decide \ +which command lines should be sa)-2.658 F -.15(ve)-.2 G 2.657(do).15 G +2.657(nt)-2.657 G .157(he his-)-2.657 F .707(tory list.)144 276 R .707 +(Each pattern is anchored at the be)5.707 F .708 +(ginning of the line and must match the complete line)-.15 F .626 +(\(no implicit `)144 288 R F3(*)A F0 3.126('i)C 3.126(sa)-3.126 G 3.126 +(ppended\). Each)-3.126 F .626(pattern is tested ag)3.126 F .625 +(ainst the line after the checks speci\214ed by)-.05 F F1(HISTCONTR)144 +300 Q(OL)-.27 E F0 1.793(are applied.)4.043 F 1.793 +(In addition to the normal shell pattern matching characters, `)6.793 F +F3(&)A F0(')A 2.515(matches the pre)144 312 R 2.515(vious history line.) +-.25 F(`)7.514 E F3(&)A F0 5.014('m)C 2.514 +(ay be escaped using a backslash; the backslash is)-5.014 F(remo)144 324 +Q -.15(ve)-.15 G 3.352(db).15 G .852(efore attempting a match.)-3.352 F +.852(The second and subsequent lines of a multi-line compound)5.852 F +(command are not tested, and are added to the history re)144 336 Q -.05 +(ga)-.15 G(rdless of the v).05 E(alue of)-.25 E F1(HISTIGNORE)2.5 E F2 +(.)A F3(HISTSIZE)108 348 Q F0 1.387 +(The number of commands to remember in the command history \(see)144 360 +R F1(HIST)3.887 E(OR)-.162 E(Y)-.315 E F0(belo)3.637 E 3.887(w\). If) +-.25 F(the)3.887 E -.25(va)144 372 S 1.32(lue is 0, commands are not sa) +.25 F -.15(ve)-.2 G 3.82(di).15 G 3.821(nt)-3.82 G 1.321 +(he history list.)-3.821 F 1.321(Numeric v)6.321 F 1.321 +(alues less than zero result in)-.25 F -2.15 -.25(ev e)144 384 T .437 +(ry command being sa).25 F -.15(ve)-.2 G 2.937(do).15 G 2.937(nt)-2.937 +G .437(he history list \(there is no limit\).)-2.937 F .436 +(The shell sets the def)5.436 F .436(ault v)-.1 F(alue)-.25 E +(to 500 after reading an)144 396 Q 2.5(ys)-.15 G(tartup \214les.)-2.5 E +F3(HISTTIMEFORMA)108 408 Q(T)-.95 E F0 .951(If this v)144 420 R .951 +(ariable is set and not null, its v)-.25 F .952 +(alue is used as a format string for)-.25 F F4(strftime)3.452 E F0 .952 +(\(3\) to print the)B .673 +(time stamp associated with each history entry displayed by the)144 432 +R F3(history)3.173 E F0 -.2(bu)3.172 G 3.172(iltin. If).2 F .672(this v) +3.172 F .672(ariable is)-.25 F .144 +(set, time stamps are written to the history \214le so the)144 444 R +2.644(ym)-.15 G .144(ay be preserv)-2.644 F .144 +(ed across shell sessions.)-.15 F(This)5.145 E(uses the history comment\ + character to distinguish timestamps from other history lines.)144 456 Q +F3(HOME)108 468 Q F0 1.27 +(The home directory of the current user; the def)144 480 R 1.27(ault ar) +-.1 F 1.27(gument for the)-.18 F F3(cd)3.77 E F0 -.2(bu)3.77 G 1.27 +(iltin command.).2 F(The)6.27 E -.25(va)144 492 S(lue of this v).25 E +(ariable is also used when performing tilde e)-.25 E(xpansion.)-.15 E F3 +(HOSTFILE)108 504 Q F0 1.015 +(Contains the name of a \214le in the same format as)144 516 R F4 +(/etc/hosts)5.181 E F0 1.015(that should be read when the shell)5.181 F +.551(needs to complete a hostname.)144 528 R .551 +(The list of possible hostname completions may be changed while)5.551 F +1.058(the shell is running; the ne)144 540 R 1.059 +(xt time hostname completion is attempted after the v)-.15 F 1.059 +(alue is changed,)-.25 F F3(bash)144 552 Q F0 .138 +(adds the contents of the ne)2.639 F 2.638<778c>-.25 G .138(le to the e) +-2.638 F .138(xisting list.)-.15 F(If)5.138 E F1(HOSTFILE)2.638 E F0 +.138(is set, b)2.388 F .138(ut has no v)-.2 F .138(alue, or)-.25 F .517 +(does not name a readable \214le,)144 564 R F3(bash)3.017 E F0 .517 +(attempts to read)3.017 F F4(/etc/hosts)4.684 E F0 .518 +(to obtain the list of possible host-)4.684 F(name completions.)144 576 +Q(When)5 E F1(HOSTFILE)2.5 E F0(is unset, the hostname list is cleared.) +2.25 E F3(IFS)108 588 Q F0(The)20.44 E F4 .556(Internal F)3.636 F .556 +(ield Separ)-.45 F(ator)-.15 E F0 .556(that is used for w)3.786 F .556 +(ord splitting after e)-.1 F .555(xpansion and to split lines into)-.15 +F -.1(wo)144 600 S(rds with the).1 E F3 -.18(re)2.5 G(ad).18 E F0 -.2 +(bu)2.5 G(iltin command.).2 E(The def)5 E(ault v)-.1 E(alue is `)-.25 E +(`')-.25 E('.)-.74 E F3(IGNOREEOF)108 612 Q +F0 .503(Controls the action of an interacti)144 624 R .803 -.15(ve s) +-.25 H .503(hell on receipt of an).15 F F1(EOF)3.003 E F0 .503 +(character as the sole input.)2.753 F .504(If set,)5.504 F .426(the v) +144 636 R .426(alue is the number of consecuti)-.25 F -.15(ve)-.25 G F1 +(EOF)3.076 E F0 .426 +(characters which must be typed as the \214rst characters)2.676 F .302 +(on an input line before)144 648 R F3(bash)2.802 E F0 -.15(ex)2.802 G +2.802(its. If).15 F .302(the v)2.802 F .302(ariable e)-.25 F .302 +(xists b)-.15 F .302(ut does not ha)-.2 F .602 -.15(ve a n)-.2 H .302 +(umeric v).15 F .303(alue, or has)-.25 F(no v)144 660 Q(alue, the def) +-.25 E(ault v)-.1 E(alue is 10.)-.25 E(If it does not e)5 E(xist,)-.15 E +F1(EOF)2.5 E F0(signi\214es the end of input to the shell.)2.25 E F3 +(INPUTRC)108 672 Q F0 1.436(The \214lename for the)144 684 R F3 -.18(re) +3.936 G(adline).18 E F0 1.436(startup \214le, o)3.936 F -.15(ve)-.15 G +1.436(rriding the def).15 F 1.436(ault of)-.1 F F4(~/.inputr)5.602 E(c) +-.37 E F0(\(see)5.601 E F1(READLINE)3.935 E F0(belo)144 696 Q(w\).)-.25 +E F3(LANG)108 708 Q F0 1.239(Used to determine the locale cate)7.11 F +1.239(gory for an)-.15 F 3.739(yc)-.15 G(ate)-3.739 E 1.24 +(gory not speci\214cally selected with a v)-.15 F(ariable)-.25 E +(starting with)144 720 Q F3(LC_)2.5 E F0(.)A(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(15)190.95 E 0 Cg EP +%%Page: 16 16 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(LC_ALL)108 84 Q F0 .974(This v)144 96 R +.974(ariable o)-.25 F -.15(ve)-.15 G .974(rrides the v).15 F .973 +(alue of)-.25 F/F2 9/Times-Bold@0 SF(LANG)3.473 E F0 .973(and an)3.223 F +3.473(yo)-.15 G(ther)-3.473 E F1(LC_)3.473 E F0 -.25(va)3.473 G .973 +(riable specifying a locale cate-).25 F(gory)144 108 Q(.)-.65 E F1 +(LC_COLLA)108 120 Q(TE)-.95 E F0 .411(This v)144 132 R .412(ariable det\ +ermines the collation order used when sorting the results of pathname e) +-.25 F(xpansion,)-.15 E 1.465(and determines the beha)144 144 R 1.465 +(vior of range e)-.2 F 1.464(xpressions, equi)-.15 F -.25(va)-.25 G +1.464(lence classes, and collating sequences).25 F(within pathname e)144 +156 Q(xpansion and pattern matching.)-.15 E F1(LC_CTYPE)108 168 Q F0 +1.935(This v)144 180 R 1.936 +(ariable determines the interpretation of characters and the beha)-.25 F +1.936(vior of character classes)-.2 F(within pathname e)144 192 Q +(xpansion and pattern matching.)-.15 E F1(LC_MESSA)108 204 Q(GES)-.55 E +F0(This v)144 216 Q(ariable determines the locale used to translate dou\ +ble-quoted strings preceded by a)-.25 E F1($)2.5 E F0(.)A F1(LC_NUMERIC) +108 228 Q F0(This v)144 240 Q(ariable determines the locale cate)-.25 E +(gory used for number formatting.)-.15 E F1(LINES)108 252 Q F0 .055 +(Used by the)5.99 F F1(select)2.555 E F0 .054(compound command to deter\ +mine the column length for printing selection lists.)2.555 F .264 +(Automatically set if the)144 264 R F1(checkwinsize)2.764 E F0 .264 +(option is enabled or in an interacti)2.764 F .565 -.15(ve s)-.25 H .265 +(hell upon receipt of a).15 F F2(SIGWINCH)144 276 Q/F3 9/Times-Roman@0 +SF(.)A F1(MAIL)108 288 Q F0 1.201 +(If this parameter is set to a \214le or directory name and the)8.78 F +F2(MAILP)3.701 E -.855(AT)-.666 G(H).855 E F0 -.25(va)3.451 G 1.201 +(riable is not set,).25 F F1(bash)3.701 E F0 +(informs the user of the arri)144 300 Q -.25(va)-.25 G 2.5(lo).25 G 2.5 +(fm)-2.5 G(ail in the speci\214ed \214le or Maildir)-2.5 E +(-format directory)-.2 E(.)-.65 E F1(MAILCHECK)108 312 Q F0 .098 +(Speci\214es ho)144 324 R 2.598(wo)-.25 G .098(ften \(in seconds\)) +-2.598 F F1(bash)2.598 E F0 .098(checks for mail.)2.598 F .098(The def) +5.098 F .098(ault is 60 seconds.)-.1 F .099(When it is time)5.099 F .224 +(to check for mail, the shell does so before displaying the primary pro\ +mpt.)144 336 R .223(If this v)5.223 F .223(ariable is unset,)-.25 F .066 +(or set to a v)144 348 R .066(alue that is not a number greater than or\ + equal to zero, the shell disables mail checking.)-.25 F F1(MAILP)108 +360 Q -.95(AT)-.74 G(H).95 E F0 2.99(Ac)144 372 S .49 +(olon-separated list of \214lenames to be check)-2.99 F .49 +(ed for mail.)-.1 F .49(The message to be printed when mail)5.49 F(arri) +144 384 Q -.15(ve)-.25 G 2.62(si).15 G 2.62(nap)-2.62 G .12(articular \ +\214le may be speci\214ed by separating the \214lename from the message\ + with a `?'.)-2.62 F(When used in the te)144 396 Q(xt of the message,) +-.15 E F1($_)2.5 E F0 -.15(ex)2.5 G +(pands to the name of the current mail\214le.).15 E(Example:)5 E F1 +(MAILP)144 408 Q -.95(AT)-.74 G(H).95 E F0(=\010/v)A(ar/mail/bfox?"Y) +-.25 E(ou ha)-1.1 E .3 -.15(ve m)-.2 H +(ail":~/shell\255mail?"$_ has mail!"\010).15 E F1(Bash)144 420 Q F0 .389 +(supplies a def)2.889 F .389(ault v)-.1 F .389(alue for this v)-.25 F +.389(ariable, b)-.25 F .388 +(ut the location of the user mail \214les that it uses is)-.2 F +(system dependent \(e.g., /v)144 432 Q(ar/mail/)-.25 E F1($USER)A F0 +(\).)A F1(OPTERR)108 444 Q F0 .389(If set to the v)144 456 R .389 +(alue 1,)-.25 F F1(bash)2.889 E F0 .389 +(displays error messages generated by the)2.889 F F1(getopts)2.89 E F0 +-.2(bu)2.89 G .39(iltin command \(see).2 F F2 .36(SHELL B)144 468 R(UIL) +-.09 E .36(TIN COMMANDS)-.828 F F0(belo)2.61 E(w\).)-.25 E F2(OPTERR) +5.36 E F0 .359(is initialized to 1 each time the shell is in)2.61 F -.2 +(vo)-.4 G -.1(ke).2 G(d).1 E(or a shell script is e)144 480 Q -.15(xe) +-.15 G(cuted.).15 E F1 -.74(PA)108 492 S(TH)-.21 E F0 .587 +(The search path for commands.)9.91 F .588 +(It is a colon-separated list of directories in which the shell looks) +5.587 F .472(for commands \(see)144 504 R F2 .472(COMMAND EXECUTION) +2.972 F F0(belo)2.722 E 2.972(w\). A)-.25 F .471 +(zero-length \(null\) directory name in the)2.972 F -.25(va)144 516 S +.535(lue of).25 F F2 -.666(PA)3.035 G(TH)-.189 E F0 .535 +(indicates the current directory)2.785 F 5.535(.A)-.65 G .535 +(null directory name may appear as tw)-2.5 F 3.036(oa)-.1 G(djacent) +-3.036 E .868(colons, or as an initial or trailing colon.)144 528 R .868 +(The def)5.868 F .867(ault path is system-dependent, and is set by the) +-.1 F 26.328(administrator who installs)144 540 R F1(bash)28.828 E F0 +31.329(.A)C 26.329(common v)-2.5 F 26.329(alue is)-.25 F/F4 10/Courier@0 +SF(/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin)144 552 +Q F0(.)A F1(POSIXL)108 564 Q(Y_CORRECT)-.92 E F0 .472(If this v)144 576 +R .472(ariable is in the en)-.25 F .471(vironment when)-.4 F F1(bash) +2.971 E F0 .471(starts, the shell enters)2.971 F/F5 10/Times-Italic@0 SF +.471(posix mode)2.971 F F0 .471(before reading)2.971 F .011 +(the startup \214les, as if the)144 588 R F1(\255\255posix)2.511 E F0 +(in)2.511 E -.2(vo)-.4 G .011(cation option had been supplied.).2 F .011 +(If it is set while the shell is)5.011 F(running,)144 600 Q F1(bash)2.5 +E F0(enables)2.5 E F5(posix mode)2.5 E F0 2.5(,a)C 2.5(si)-2.5 G 2.5(ft) +-2.5 G(he command)-2.5 E F4(set -o posix)2.5 E F0(had been e)2.5 E -.15 +(xe)-.15 G(cuted.).15 E F1(PR)108 612 Q(OMPT_COMMAND)-.3 E F0 +(If set, the v)144 624 Q(alue is e)-.25 E -.15(xe)-.15 G +(cuted as a command prior to issuing each primary prompt.).15 E F1(PR) +108 636 Q(OMPT_DIR)-.3 E(TRIM)-.4 E F0 .676 +(If set to a number greater than zero, the v)144 648 R .676 +(alue is used as the number of trailing directory compo-)-.25 F .923 +(nents to retain when e)144 660 R .923(xpanding the)-.15 F F1(\\w)3.423 +E F0(and)3.423 E F1(\\W)3.423 E F0 .923(prompt string escapes \(see) +3.423 F F2(PR)3.423 E(OMPTING)-.27 E F0(belo)3.173 E(w\).)-.25 E +(Characters remo)144 672 Q -.15(ve)-.15 G 2.5(da).15 G +(re replaced with an ellipsis.)-2.5 E F1(PS1)108 684 Q F0 .065(The v) +19.33 F .065(alue of this parameter is e)-.25 F .065(xpanded \(see)-.15 +F F2(PR)2.565 E(OMPTING)-.27 E F0(belo)2.315 E .065 +(w\) and used as the primary prompt)-.25 F 2.5(string. The)144 696 R +(def)2.5 E(ault v)-.1 E(alue is `)-.25 E(`)-.74 E F1(\\s\255\\v\\$)A F0 +-.74('')2.5 G(.).74 E F1(PS2)108 708 Q F0 .117(The v)19.33 F .117 +(alue of this parameter is e)-.25 F .117(xpanded as with)-.15 F F2(PS1) +2.617 E F0 .118(and used as the secondary prompt string.)2.368 F(The) +5.118 E(def)144 720 Q(ault is `)-.1 E(`)-.74 E F1(>)A F0 -.74('')2.5 G +(.).74 E(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(16)190.95 E 0 Cg +EP +%%Page: 17 17 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(PS3)108 84 Q F0 1.116(The v)19.33 F 1.115 +(alue of this parameter is used as the prompt for the)-.25 F F1(select) +3.615 E F0 1.115(command \(see)3.615 F/F2 9/Times-Bold@0 SF 1.115 +(SHELL GRAM-)3.615 F(MAR)144 96 Q F0(abo)2.25 E -.15(ve)-.15 G(\).).15 E +F1(PS4)108 108 Q F0 .1(The v)19.33 F .1(alue of this parameter is e)-.25 +F .1(xpanded as with)-.15 F F2(PS1)2.6 E F0 .101(and the v)2.35 F .101 +(alue is printed before each command)-.25 F F1(bash)144 120 Q F0 .292 +(displays during an e)2.792 F -.15(xe)-.15 G .292(cution trace.).15 F +.292(The \214rst character of)5.292 F F2(PS4)2.792 E F0 .291 +(is replicated multiple times, as)2.542 F(necessary)144 132 Q 2.5(,t) +-.65 G 2.5(oi)-2.5 G(ndicate multiple le)-2.5 E -.15(ve)-.25 G +(ls of indirection.).15 E(The def)5 E(ault is `)-.1 E(`)-.74 E F1(+)A F0 +-.74('')2.5 G(.).74 E F1(SHELL)108 144 Q F0 .663 +(The full pathname to the shell is k)144 156 R .664(ept in this en)-.1 F +.664(vironment v)-.4 F 3.164(ariable. If)-.25 F .664 +(it is not set when the shell)3.164 F(starts,)144 168 Q F1(bash)2.5 E F0 +(assigns to it the full pathname of the current user')2.5 E 2.5(sl)-.55 +G(ogin shell.)-2.5 E F1(TIMEFORMA)108 180 Q(T)-.95 E F0 .827(The v)144 +192 R .826 +(alue of this parameter is used as a format string specifying ho)-.25 F +3.326(wt)-.25 G .826(he timing information for)-3.326 F .648 +(pipelines pre\214x)144 204 R .648(ed with the)-.15 F F1(time)3.148 E F0 +(reserv)3.148 E .648(ed w)-.15 F .649(ord should be displayed.)-.1 F +(The)5.649 E F1(%)3.149 E F0 .649(character introduces)3.149 F .712 +(an escape sequence that is e)144 216 R .711(xpanded to a time v)-.15 F +.711(alue or other information.)-.25 F .711(The escape sequences)5.711 F +(and their meanings are as follo)144 228 Q +(ws; the braces denote optional portions.)-.25 E F1(%%)144 246 Q F0 2.5 +(Al)30 G(iteral)-2.5 E F1(%)2.5 E F0(.)A F1(%[)144 258 Q/F3 10 +/Times-Italic@0 SF(p)A F1(][l]R)A F0(The elapsed time in seconds.)11.68 +E F1(%[)144 270 Q F3(p)A F1(][l]U)A F0 +(The number of CPU seconds spent in user mode.)11.68 E F1(%[)144 282 Q +F3(p)A F1(][l]S)A F0(The number of CPU seconds spent in system mode.) +13.34 E F1(%P)144 294 Q F0 +(The CPU percentage, computed as \(%U + %S\) / %R.)33.89 E .87 +(The optional)144 310.8 R F3(p)3.37 E F0 .87(is a digit specifying the) +3.37 F F3(pr)3.37 E(ecision)-.37 E F0 3.37(,t)C .87 +(he number of fractional digits after a decimal)-3.37 F 2.526(point. A) +144 322.8 R -.25(va)2.526 G .025 +(lue of 0 causes no decimal point or fraction to be output.).25 F .025 +(At most three places after the)5.025 F .537 +(decimal point may be speci\214ed; v)144 334.8 R .537(alues of)-.25 F F3 +(p)3.037 E F0 .537(greater than 3 are changed to 3.)3.037 F(If)5.538 E +F3(p)3.038 E F0 .538(is not speci\214ed,)3.038 F(the v)144 346.8 Q +(alue 3 is used.)-.25 E .668(The optional)144 363.6 R F1(l)3.168 E F0 +.668(speci\214es a longer format, including minutes, of the form)3.168 F +F3(MM)3.168 E F0(m)A F3(SS)A F0(.)A F3(FF)A F0 3.167(s. The)B -.25(va) +3.167 G(lue).25 E(of)144 375.6 Q F3(p)2.5 E F0 +(determines whether or not the fraction is included.)2.5 E 13.364 +(If this v)144 392.4 R 13.364(ariable is not set,)-.25 F F1(bash)15.865 +E F0 13.365(acts as if it had the v)15.865 F(alue)-.25 E F1($\010\\nr) +144 404.4 Q(eal\\t%3lR\\nuser\\t%3lU\\nsys\\t%3lS\010)-.18 E F0 7.113 +(.I)C 4.613(ft)-7.113 G 2.113(he v)-4.613 F 2.113 +(alue is null, no timing information is dis-)-.25 F 2.5(played. A)144 +416.4 R(trailing ne)2.5 E +(wline is added when the format string is displayed.)-.25 E F1(TMOUT)108 +428.4 Q F0 .941(If set to a v)144 440.4 R .941(alue greater than zero,) +-.25 F F2(TMOUT)3.441 E F0 .941(is treated as the def)3.191 F .941 +(ault timeout for the)-.1 F F1 -.18(re)3.441 G(ad).18 E F0 -.2(bu)3.441 +G(iltin.).2 E(The)144 452.4 Q F1(select)2.811 E F0 .311 +(command terminates if input does not arri)2.811 F .61 -.15(ve a)-.25 H +(fter).15 E F2(TMOUT)2.81 E F0 .31(seconds when input is com-)2.56 F +.885(ing from a terminal.)144 464.4 R .885(In an interacti)5.885 F 1.185 +-.15(ve s)-.25 H .885(hell, the v).15 F .886 +(alue is interpreted as the number of seconds to)-.25 F -.1(wa)144 476.4 +S 1.05(it for a line of input after issuing the primary prompt.).1 F F1 +(Bash)6.05 E F0 1.05(terminates after w)3.55 F 1.05(aiting for that)-.1 +F(number of seconds if a complete line of input does not arri)144 488.4 +Q -.15(ve)-.25 G(.).15 E F1(TMPDIR)108 500.4 Q F0 .39(If set,)144 512.4 +R F1(bash)2.89 E F0 .39(uses its v)2.89 F .39 +(alue as the name of a directory in which)-.25 F F1(bash)2.891 E F0 .391 +(creates temporary \214les for the)2.891 F(shell')144 524.4 Q 2.5(su) +-.55 G(se.)-2.5 E F1(auto_r)108 536.4 Q(esume)-.18 E F0 .531(This v)144 +548.4 R .531(ariable controls ho)-.25 F 3.031(wt)-.25 G .531 +(he shell interacts with the user and job control.)-3.031 F .53 +(If this v)5.53 F .53(ariable is set,)-.25 F .538(single w)144 560.4 R +.538(ord simple commands without redirections are treated as candidates\ + for resumption of an)-.1 F -.15(ex)144 572.4 S .367(isting stopped job) +.15 F 5.367(.T)-.4 G .366(here is no ambiguity allo)-5.367 F .366 +(wed; if there is more than one job be)-.25 F .366(ginning with)-.15 F +1.124(the string typed, the job most recently accessed is selected.)144 +584.4 R(The)6.125 E F3(name)3.985 E F0 1.125(of a stopped job, in this) +3.805 F(conte)144 596.4 Q 1.133 +(xt, is the command line used to start it.)-.15 F 1.133(If set to the v) +6.133 F(alue)-.25 E F3 -.2(ex)3.633 G(act).2 E F0 3.632(,t).68 G 1.132 +(he string supplied must)-3.632 F .624 +(match the name of a stopped job e)144 608.4 R .624(xactly; if set to) +-.15 F F3(substring)3.125 E F0 3.125(,t).22 G .625 +(he string supplied needs to match a)-3.125 F .885 +(substring of the name of a stopped job)144 620.4 R 5.884(.T)-.4 G(he) +-5.884 E F3(substring)3.724 E F0 -.25(va)3.604 G .884(lue pro).25 F .884 +(vides functionality analogous to)-.15 F(the)144 632.4 Q F1(%?)3.333 E +F0 .833(job identi\214er \(see)5.833 F F2 .834(JOB CONTR)3.334 F(OL)-.27 +E F0(belo)3.084 E 3.334(w\). If)-.25 F .834(set to an)3.334 F 3.334(yo) +-.15 G .834(ther v)-3.334 F .834(alue, the supplied string)-.25 F .316 +(must be a pre\214x of a stopped job')144 644.4 R 2.816(sn)-.55 G .316 +(ame; this pro)-2.816 F .315(vides functionality analogous to the)-.15 F +F1(%)2.815 E F3(string)A F0(job)2.815 E(identi\214er)144 656.4 Q(.)-.55 +E F1(histchars)108 668.4 Q F0 2.069(The tw)144 680.4 R 4.57(oo)-.1 G +4.57(rt)-4.57 G 2.07(hree characters which control history e)-4.57 F +2.07(xpansion and tok)-.15 F 2.07(enization \(see)-.1 F F2(HIST)4.57 E +(OR)-.162 E(Y)-.315 E(EXP)144 692.4 Q(ANSION)-.666 E F0(belo)3.466 E +3.716(w\). The)-.25 F 1.216(\214rst character is the)3.716 F F3 1.215 +(history e)3.715 F(xpansion)-.2 E F0(character)3.715 E 3.715(,t)-.4 G +1.215(he character which)-3.715 F .798(signals the start of a history e) +144 704.4 R .798(xpansion, normally `)-.15 F F1(!)A F0 3.298('. The)B +.798(second character is the)3.298 F F3(quic)3.298 E 3.298(ks)-.2 G +(ubstitu-)-3.298 E(tion)144 716.4 Q F0(character)2.74 E 2.74(,w)-.4 G +.239(hich is used as shorthand for re-running the pre)-2.74 F .239 +(vious command entered, substitut-)-.25 F .575 +(ing one string for another in the command.)144 728.4 R .575(The def) +5.575 F .575(ault is `)-.1 F F1(^)A F0 3.075('. The)B .576 +(optional third character is the)3.076 F(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(17)190.95 E 0 Cg EP +%%Page: 18 18 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .223(character which indicates that the remainder of the line is\ + a comment when found as the \214rst char)144 84 R(-)-.2 E 1.293 +(acter of a w)144 96 R 1.293(ord, normally `)-.1 F/F1 10/Times-Bold@0 SF +(#)A F0 3.793('. The)B 1.294 +(history comment character causes history substitution to be)3.794 F .38 +(skipped for the remaining w)144 108 R .38(ords on the line.)-.1 F .379 +(It does not necessarily cause the shell parser to treat)5.379 F +(the rest of the line as a comment.)144 120 Q F1(Arrays)87 136.8 Q(Bash) +108 148.8 Q F0(pro)3.39 E .89(vides one-dimensional inde)-.15 F -.15(xe) +-.15 G 3.39(da).15 G .891(nd associati)-3.39 F 1.191 -.15(ve a)-.25 H +.891(rray v).15 F 3.391(ariables. An)-.25 F 3.391(yv)-.15 G .891 +(ariable may be used as an)-3.641 F(inde)108 160.8 Q -.15(xe)-.15 G +2.574(da).15 G .074(rray; the)-2.574 F F1(declar)2.574 E(e)-.18 E F0 -.2 +(bu)2.574 G .074(iltin will e).2 F .073(xplicitly declare an array)-.15 +F 5.073(.T)-.65 G .073(here is no maximum limit on the size of)-5.073 F +.328(an array)108 172.8 R 2.828(,n)-.65 G .328(or an)-2.828 F 2.828(yr) +-.15 G .329(equirement that members be inde)-2.828 F -.15(xe)-.15 G +2.829(do).15 G 2.829(ra)-2.829 G .329(ssigned contiguously)-2.829 F +5.329(.I)-.65 G(nde)-5.329 E -.15(xe)-.15 G 2.829(da).15 G .329 +(rrays are refer)-2.829 F(-)-.2 E 1.387(enced using inte)108 184.8 R +1.387(gers \(including arithmetic e)-.15 F 3.887(xpressions\) and)-.15 F +1.387(are zero-based; associati)3.887 F 1.686 -.15(ve a)-.25 H 1.386 +(rrays are refer).15 F(-)-.2 E .219(enced using arbitrary strings.)108 +196.8 R .219(Unless otherwise noted, inde)5.219 F -.15(xe)-.15 G 2.719 +(da).15 G .219(rray indices must be non-ne)-2.719 F -.05(ga)-.15 G(ti) +.05 E .52 -.15(ve i)-.25 H(nte).15 E(gers.)-.15 E 2.463(An inde)108 +213.6 R -.15(xe)-.15 G 4.963(da).15 G 2.463 +(rray is created automatically if an)-4.963 F 4.963(yv)-.15 G 2.462 +(ariable is assigned to using the syntax)-5.213 F/F2 10/Times-Italic@0 +SF(name)4.962 E F0([)A F2(sub-)A(script)108 225.6 Q F0(]=)A F2(value)A +F0 6.548(.T)C(he)-6.548 E F2(subscript)4.388 E F0 1.549 +(is treated as an arithmetic e)4.728 F 1.549(xpression that must e)-.15 +F -.25(va)-.25 G 1.549(luate to a number).25 F 6.549(.T)-.55 G(o)-7.349 +E -.15(ex)108 237.6 S 1.98(plicitly declare an inde).15 F -.15(xe)-.15 G +4.48(da).15 G(rray)-4.48 E 4.48(,u)-.65 G(se)-4.48 E F1(declar)4.48 E +4.48<65ad>-.18 G(a)-4.48 E F2(name)4.48 E F0(\(see)4.48 E/F3 9 +/Times-Bold@0 SF 1.979(SHELL B)4.479 F(UIL)-.09 E 1.979(TIN COMMANDS) +-.828 F F0(belo)4.229 E(w\).)-.25 E F1(declar)108 249.6 Q 2.5<65ad>-.18 +G(a)-2.5 E F2(name)2.5 E F1([)A F2(subscript)A F1(])A F0 +(is also accepted; the)2.5 E F2(subscript)2.5 E F0(is ignored.)2.5 E +(Associati)108 266.4 Q .3 -.15(ve a)-.25 H(rrays are created using).15 E +F1(declar)2.5 E 2.5<65ad>-.18 G(A)-2.5 E F2(name)2.5 E F0(.)A(Attrib)108 +283.2 Q .94(utes may be speci\214ed for an array v)-.2 F .941 +(ariable using the)-.25 F F1(declar)3.441 E(e)-.18 E F0(and)3.441 E F1 +-.18(re)3.441 G(adonly).18 E F0 -.2(bu)3.441 G 3.441(iltins. Each).2 F +(attrib)3.441 E(ute)-.2 E(applies to all members of an array)108 295.2 Q +(.)-.65 E 1.647 +(Arrays are assigned to using compound assignments of the form)108 312 R +F2(name)4.147 E F0(=)A F1(\()A F0 -.25(va)C(lue).25 E F2(1)A F0 1.647 +(... v)4.147 F(alue)-.25 E F2(n)A F1(\))A F0 4.147(,w)C 1.647(here each) +-4.147 F F2(value)108 324 Q F0 1.833(is of the form [)4.332 F F2 +(subscript)A F0(]=)A F2(string)A F0 6.833(.I)C(nde)-6.833 E -.15(xe)-.15 +G 4.333(da).15 G 1.833(rray assignments do not require an)-4.333 F 1.833 +(ything b)-.15 F(ut)-.2 E F2(string)4.333 E F0(.)A .164 +(When assigning to inde)108 336 R -.15(xe)-.15 G 2.663(da).15 G .163 +(rrays, if the optional brack)-2.663 F .163 +(ets and subscript are supplied, that inde)-.1 F 2.663(xi)-.15 G 2.663 +(sa)-2.663 G(ssigned)-2.663 E 1.41(to; otherwise the inde)108 348 R 3.91 +(xo)-.15 G 3.91(ft)-3.91 G 1.41(he element assigned is the last inde) +-3.91 F 3.911(xa)-.15 G 1.411(ssigned to by the statement plus one.) +-3.911 F(Inde)108 360 Q(xing starts at zero.)-.15 E +(When assigning to an associati)108 376.8 Q .3 -.15(ve a)-.25 H(rray).15 +E 2.5(,t)-.65 G(he subscript is required.)-2.5 E .24 +(This syntax is also accepted by the)108 393.6 R F1(declar)2.74 E(e)-.18 +E F0 -.2(bu)2.739 G 2.739(iltin. Indi).2 F .239 +(vidual array elements may be assigned to using the)-.25 F F2(name)108 +405.6 Q F0([)A F2(subscript)A F0(]=)A F2(value)A F0 1.917 +(syntax introduced abo)4.416 F -.15(ve)-.15 G 6.917(.W).15 G 1.917 +(hen assigning to an inde)-6.917 F -.15(xe)-.15 G 4.417(da).15 G(rray) +-4.417 E 4.417(,i)-.65 G(f)-4.417 E F2(name)4.777 E F0 1.917(is sub-) +4.597 F .116(scripted by a ne)108 417.6 R -.05(ga)-.15 G(ti).05 E .416 +-.15(ve n)-.25 H(umber).15 E 2.616(,t)-.4 G .115 +(hat number is interpreted as relati)-2.616 F .415 -.15(ve t)-.25 H +2.615(oo).15 G .115(ne greater than the maximum inde)-2.615 F(x)-.15 E +(of)108 429.6 Q F2(name)3.338 E F0 3.338(,s)C 3.338(on)-3.338 G -2.25 +-.15(eg a)-3.338 H(ti).15 E 1.138 -.15(ve i)-.25 H .838 +(ndices count back from the end of the array).15 F 3.338(,a)-.65 G .838 +(nd an inde)-3.338 F 3.338(xo)-.15 G 3.338<66ad>-3.338 G 3.338(1r)-3.338 +G .838(eferences the last)-3.338 F(element.)108 441.6 Q(An)108 458.4 Q +3.576(ye)-.15 G 1.076(lement of an array may be referenced using ${) +-3.576 F F2(name)A F0([)A F2(subscript)A F0 3.575(]}. The)B 1.075 +(braces are required to a)3.575 F -.2(vo)-.2 G(id).2 E 1.541 +(con\215icts with pathname e)108 470.4 R 4.041(xpansion. If)-.15 F F2 +(subscript)4.041 E F0(is)4.041 E F1(@)4.041 E F0(or)4.041 E F1(*)4.041 E +F0 4.041(,t)C 1.541(he w)-4.041 F 1.541(ord e)-.1 F 1.541 +(xpands to all members of)-.15 F F2(name)4.042 E F0(.)A 1.057 +(These subscripts dif)108 482.4 R 1.057(fer only when the w)-.25 F 1.057 +(ord appears within double quotes.)-.1 F 1.056(If the w)6.056 F 1.056 +(ord is double-quoted,)-.1 F(${)108 494.4 Q F2(name)A F0 .52([*]} e)B +.52(xpands to a single w)-.15 F .52(ord with the v)-.1 F .521 +(alue of each array member separated by the \214rst character)-.25 F +1.375(of the)108 506.4 R F3(IFS)3.875 E F0 1.375(special v)3.625 F 1.375 +(ariable, and ${)-.25 F F2(name)A F0 1.375([@]} e)B 1.375 +(xpands each element of)-.15 F F2(name)3.875 E F0 1.374(to a separate w) +3.875 F 3.874(ord. When)-.1 F 2.027(there are no array members, ${)108 +518.4 R F2(name)A F0 2.028([@]} e)B 2.028(xpands to nothing.)-.15 F +2.028(If the double-quoted e)7.028 F 2.028(xpansion occurs)-.15 F .759 +(within a w)108 530.4 R .759(ord, the e)-.1 F .759 +(xpansion of the \214rst parameter is joined with the be)-.15 F .759 +(ginning part of the original w)-.15 F(ord,)-.1 E .515(and the e)108 +542.4 R .516(xpansion of the last parameter is joined with the last par\ +t of the original w)-.15 F 3.016(ord. This)-.1 F .516(is analogous)3.016 +F .228(to the e)108 554.4 R .228(xpansion of the special parameters)-.15 +F F1(*)2.728 E F0(and)2.728 E F1(@)2.728 E F0(\(see)2.728 E F1 .228 +(Special P)2.728 F(arameters)-.1 E F0(abo)2.727 E -.15(ve)-.15 G 2.727 +(\). ${#).15 F F2(name)A F0([)A F2(subscript)A F0(]})A -.15(ex)108 566.4 +S .886(pands to the length of ${).15 F F2(name)A F0([)A F2(subscript)A +F0 3.386(]}. If)B F2(subscript)3.386 E F0(is)3.386 E F1(*)3.386 E F0(or) +3.386 E F1(@)3.386 E F0 3.386(,t)C .886(he e)-3.386 F .886 +(xpansion is the number of ele-)-.15 F .463(ments in the array)108 578.4 +R 5.463(.R)-.65 G .463(eferencing an array v)-5.463 F .462 +(ariable without a subscript is equi)-.25 F -.25(va)-.25 G .462 +(lent to referencing the array).25 F .233(with a subscript of 0.)108 +590.4 R .233(If the)5.233 F F2(subscript)3.073 E F0 .233 +(used to reference an element of an inde)3.413 F -.15(xe)-.15 G 2.733 +(da).15 G .233(rray e)-2.733 F -.25(va)-.25 G .233(luates to a num-).25 +F .617(ber less than zero, it is interpreted as relati)108 602.4 R .917 +-.15(ve t)-.25 H 3.117(oo).15 G .616(ne greater than the maximum inde) +-3.117 F 3.116(xo)-.15 G 3.116(ft)-3.116 G .616(he array)-3.116 F 3.116 +(,s)-.65 G 3.116(on)-3.116 G -.15(eg)-3.116 G(-).15 E(ati)108 614.4 Q .3 +-.15(ve i)-.25 H(ndices count back from the end of the array).15 E 2.5 +(,a)-.65 G(nd an inde)-2.5 E 2.5(xo)-.15 G 2.5<66ad>-2.5 G 2.5(1r)-2.5 G +(eferences the last element.)-2.5 E .168(An array v)108 631.2 R .168 +(ariable is considered set if a subscript has been assigned a v)-.25 F +2.668(alue. The)-.25 F .168(null string is a v)2.668 F .168(alid v)-.25 +F(alue.)-.25 E .418(It is possible to obtain the k)108 648 R -.15(ey)-.1 +G 2.918(s\().15 G .418(indices\) of an array as well as the v)-2.918 F +2.917(alues. ${)-.25 F F1(!)A F2(name)A F0([)A F2(@)A F0 .417(]} and ${) +B F1(!)A F2(name)A F0([)A F2(*)A F0(]})A -.15(ex)108 660 S .749 +(pand to the indices assigned in array v).15 F(ariable)-.25 E F2(name) +3.249 E F0 5.749(.T)C .75 +(he treatment when in double quotes is similar to)-5.749 F(the e)108 672 +Q(xpansion of the special parameters)-.15 E F2(@)2.5 E F0(and)2.5 E F2 +(*)2.5 E F0(within double quotes.)2.5 E(The)108 688.8 Q F1(unset)2.767 E +F0 -.2(bu)2.767 G .267(iltin is used to destro).2 F 2.767(ya)-.1 G +(rrays.)-2.767 E F1(unset)5.267 E F2(name)2.767 E F0([)A F2(subscript)A +F0 2.767(]d)C(estro)-2.767 E .267(ys the array element at inde)-.1 F(x) +-.15 E F2(sub-)2.766 E(script)108 700.8 Q F0 6.318(.N)C -2.25 -.15(eg a) +-6.318 H(ti).15 E 1.618 -.15(ve s)-.25 H 1.318(ubscripts to inde).15 F +-.15(xe)-.15 G 3.818(da).15 G 1.319 +(rrays are interpreted as described abo)-3.818 F -.15(ve)-.15 G 6.319 +(.C).15 G 1.319(are must be tak)-6.319 F 1.319(en to)-.1 F -.2(avo)108 +712.8 S .298(id unw).2 F .298(anted side ef)-.1 F .298 +(fects caused by pathname e)-.25 F(xpansion.)-.15 E F1(unset)5.298 E F2 +(name)2.797 E F0 2.797(,w)C(here)-2.797 E F2(name)2.797 E F0 .297 +(is an array)2.797 F 2.797(,o)-.65 G(r)-2.797 E F1(unset)2.797 E F2 +(name)108 724.8 Q F0([)A F2(subscript)A F0(], where)A F2(subscript)2.5 E +F0(is)2.5 E F1(*)2.5 E F0(or)2.5 E F1(@)2.5 E F0 2.5(,r)C(emo)-2.5 E +-.15(ve)-.15 G 2.5(st).15 G(he entire array)-2.5 E(.)-.65 E +(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(18)190.95 E 0 Cg EP +%%Page: 19 19 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(The)108 84 Q/F1 10/Times-Bold@0 SF(declar)3.573 E(e)-.18 E F0(,)A +F1(local)3.573 E F0 3.573(,a)C(nd)-3.573 E F1 -.18(re)3.573 G(adonly).18 +E F0 -.2(bu)3.573 G 1.073(iltins each accept a).2 F F13.573 E F0 +1.073(option to specify an inde)3.573 F -.15(xe)-.15 G 3.574(da).15 G +1.074(rray and a)-3.574 F F13.574 E F0 .339 +(option to specify an associati)108 96 R .638 -.15(ve a)-.25 H(rray).15 +E 5.338(.I)-.65 G 2.838(fb)-5.338 G .338(oth options are supplied,) +-2.838 F F12.838 E F0(tak)2.838 E .338(es precedence.)-.1 F(The) +5.338 E F1 -.18(re)2.838 G(ad).18 E F0 -.2(bu)2.838 G(iltin).2 E .44 +(accepts a)108 108 R F12.941 E F0 .441 +(option to assign a list of w)2.941 F .441 +(ords read from the standard input to an array)-.1 F 5.441(.T)-.65 G(he) +-5.441 E F1(set)2.941 E F0(and)2.941 E F1(declar)2.941 E(e)-.18 E F0 -.2 +(bu)108 120 S(iltins display array v).2 E(alues in a w)-.25 E +(ay that allo)-.1 E(ws them to be reused as assignments.)-.25 E/F2 10.95 +/Times-Bold@0 SF(EXP)72 136.8 Q(ANSION)-.81 E F0 .76(Expansion is perfo\ +rmed on the command line after it has been split into w)108 148.8 R 3.26 +(ords. There)-.1 F .76(are se)3.26 F -.15(ve)-.25 G 3.26(nk).15 G .76 +(inds of)-3.26 F -.15(ex)108 160.8 S .369(pansion performed:).15 F/F3 10 +/Times-Italic@0 SF(br)2.869 E .369(ace e)-.15 F(xpansion)-.2 E F0(,).24 +E F3 .369(tilde e)2.869 F(xpansion)-.2 E F0(,).24 E F3(par)2.869 E .369 +(ameter and variable e)-.15 F(xpansion)-.2 E F0(,).24 E F3 .37 +(command sub-)2.869 F(stitution)108 172.8 Q F0(,).24 E F3(arithmetic e) +2.5 E(xpansion)-.2 E F0(,).24 E F3(wor)2.5 E 2.5(ds)-.37 G(plitting)-2.5 +E F0 2.5(,a).22 G(nd)-2.5 E F3(pathname e)2.5 E(xpansion)-.2 E F0(.).24 +E .419(The order of e)108 189.6 R .419(xpansions is: brace e)-.15 F .418 +(xpansion; tilde e)-.15 F .418(xpansion, parameter and v)-.15 F .418 +(ariable e)-.25 F .418(xpansion, arithmetic)-.15 F -.15(ex)108 201.6 S +.195(pansion, and command substitution \(done in a left-to-right f).15 F +.196(ashion\); w)-.1 F .196(ord splitting; and pathname e)-.1 F(xpan-) +-.15 E(sion.)108 213.6 Q .257 +(On systems that can support it, there is an additional e)108 230.4 R +.257(xpansion a)-.15 F -.25(va)-.2 G(ilable:).25 E F3(pr)2.757 E .257 +(ocess substitution)-.45 F F0 5.257(.T)C .256(his is per)-5.257 F(-)-.2 +E(formed at the same time as tilde, parameter)108 242.4 Q 2.5(,v)-.4 G +(ariable, and arithmetic e)-2.75 E(xpansion and command substitution.) +-.15 E 1.486(Only brace e)108 259.2 R 1.486(xpansion, w)-.15 F 1.486 +(ord splitting, and pathname e)-.1 F 1.487 +(xpansion can change the number of w)-.15 F 1.487(ords of the)-.1 F -.15 +(ex)108 271.2 S 1.165(pansion; other e).15 F 1.165(xpansions e)-.15 F +1.165(xpand a single w)-.15 F 1.165(ord to a single w)-.1 F 3.665 +(ord. The)-.1 F 1.164(only e)3.665 F 1.164(xceptions to this are the) +-.15 F -.15(ex)108 283.2 S(pansions of ").15 E F1($@)A F0 2.5("a)C(nd ") +-2.5 E F1(${)A F3(name)A F1([@]})A F0 2.5("a)C 2.5(se)-2.5 G +(xplained abo)-2.65 E .3 -.15(ve \()-.15 H(see).15 E/F4 9/Times-Bold@0 +SF -.666(PA)2.5 G(RAMETERS).666 E/F5 9/Times-Roman@0 SF(\).)A F1 +(Brace Expansion)87 300 Q F3(Br)108.58 312 Q .606(ace e)-.15 F(xpansion) +-.2 E F0 .606 +(is a mechanism by which arbitrary strings may be generated.)3.346 F +.606(This mechanism is similar)5.606 F(to)108 324 Q F3 .415(pathname e) +2.915 F(xpansion)-.2 E F0 2.915(,b)C .415 +(ut the \214lenames generated need not e)-3.115 F 2.915(xist. P)-.15 F +.415(atterns to be brace e)-.15 F .415(xpanded tak)-.15 F 2.915(et)-.1 G +(he)-2.915 E .151(form of an optional)108 336 R F3(pr)2.651 E(eamble) +-.37 E F0 2.651(,f).18 G(ollo)-2.651 E .151 +(wed by either a series of comma-separated strings or a sequence e)-.25 +F(xpres-)-.15 E .563(sion between a pair of braces, follo)108 348 R .563 +(wed by an optional)-.25 F F3(postscript)3.063 E F0 5.563(.T).68 G .563 +(he preamble is pre\214x)-5.563 F .563(ed to each string)-.15 F .659(co\ +ntained within the braces, and the postscript is then appended to each \ +resulting string, e)108 360 R .659(xpanding left to)-.15 F(right.)108 +372 Q .719(Brace e)108 388.8 R .719(xpansions may be nested.)-.15 F .719 +(The results of each e)5.719 F .719 +(xpanded string are not sorted; left to right order is)-.15 F(preserv) +108 400.8 Q 2.5(ed. F)-.15 F(or e)-.15 E(xample, a)-.15 E F1({)A F0 +(d,c,b)A F1(})A F0 2.5(ee)C(xpands into `ade ace abe'.)-2.65 E 3.242(As) +108 417.6 S .742(equence e)-3.242 F .742(xpression tak)-.15 F .742 +(es the form)-.1 F F1({)3.242 E F3(x)A F1(..)A F3(y)A F1([..)A F3(incr)A +F1(]})A F0 3.242(,w)C(here)-3.242 E F3(x)3.242 E F0(and)3.243 E F3(y) +3.243 E F0 .743(are either inte)3.243 F .743(gers or single characters,) +-.15 F(and)108 429.6 Q F3(incr)3.032 E F0 3.032(,a)C 3.032(no)-3.032 G +.532(ptional increment, is an inte)-3.032 F(ger)-.15 E 5.532(.W)-.55 G +.532(hen inte)-5.532 F .532(gers are supplied, the e)-.15 F .532 +(xpression e)-.15 F .531(xpands to each)-.15 F .077(number between)108 +441.6 R F3(x)2.577 E F0(and)2.577 E F3(y)2.577 E F0 2.577(,i)C(nclusi) +-2.577 E -.15(ve)-.25 G 5.077(.S).15 G .077(upplied inte)-5.077 F .077 +(gers may be pre\214x)-.15 F .077(ed with)-.15 F F3(0)2.577 E F0 .078 +(to force each term to ha)2.578 F .378 -.15(ve t)-.2 H(he).15 E .015 +(same width.)108 453.6 R .015(When either)5.015 F F3(x)2.515 E F0(or) +2.515 E F3(y)2.515 E F0(be)2.515 E .014(gins with a zero, the shell att\ +empts to force all generated terms to contain)-.15 F 1.143 +(the same number of digits, zero-padding where necessary)108 465.6 R +6.143(.W)-.65 G 1.143(hen characters are supplied, the e)-6.143 F +(xpression)-.15 E -.15(ex)108 477.6 S 1.064(pands to each character le) +.15 F 1.064(xicographically between)-.15 F F3(x)3.564 E F0(and)3.564 E +F3(y)3.564 E F0 3.564(,i)C(nclusi)-3.564 E -.15(ve)-.25 G 3.564(,u).15 G +1.064(sing the def)-3.564 F 1.064(ault C locale.)-.1 F(Note)6.064 E .983 +(that both)108 489.6 R F3(x)3.483 E F0(and)3.483 E F3(y)3.483 E F0 .983 +(must be of the same type.)3.483 F .984 +(When the increment is supplied, it is used as the dif)5.983 F(ference) +-.25 E(between each term.)108 501.6 Q(The def)5 E +(ault increment is 1 or -1 as appropriate.)-.1 E .582(Brace e)108 518.4 +R .582(xpansion is performed before an)-.15 F 3.082(yo)-.15 G .581 +(ther e)-3.082 F .581(xpansions, and an)-.15 F 3.081(yc)-.15 G .581 +(haracters special to other e)-3.081 F(xpansions)-.15 E .015 +(are preserv)108 530.4 R .015(ed in the result.)-.15 F .015 +(It is strictly te)5.015 F(xtual.)-.15 E F1(Bash)5.016 E F0 .016 +(does not apply an)2.516 F 2.516(ys)-.15 G .016 +(yntactic interpretation to the con-)-2.516 F(te)108 542.4 Q +(xt of the e)-.15 E(xpansion or the te)-.15 E(xt between the braces.) +-.15 E 3.633(Ac)108 559.2 S 1.133(orrectly-formed brace e)-3.633 F 1.132 +(xpansion must contain unquoted opening and closing braces, and at leas\ +t one)-.15 F 3.44(unquoted comma or a v)108 571.2 R 3.441 +(alid sequence e)-.25 F 5.941(xpression. An)-.15 F 5.941(yi)-.15 G 3.441 +(ncorrectly formed brace e)-5.941 F 3.441(xpansion is left)-.15 F 2.755 +(unchanged. A)108 583.2 R F1({)2.755 E F0(or)2.755 E F1(,)2.755 E F0 +.255(may be quoted with a backslash to pre)2.755 F -.15(ve)-.25 G .255 +(nt its being considered part of a brace e).15 F(xpres-)-.15 E 2.91 +(sion. T)108 595.2 R 2.91(oa)-.8 G -.2(vo)-3.11 G .41 +(id con\215icts with parameter e).2 F .411(xpansion, the string)-.15 F +F1(${)2.911 E F0 .411(is not considered eligible for brace e)2.911 F +(xpan-)-.15 E(sion.)108 607.2 Q 1.476(This construct is typically used \ +as shorthand when the common pre\214x of the strings to be generated is) +108 624 R(longer than in the abo)108 636 Q .3 -.15(ve ex)-.15 H(ample:) +.15 E(mkdir /usr/local/src/bash/{old,ne)144 652.8 Q -.65(w,)-.25 G +(dist,b).65 E(ugs})-.2 E(or)108 664.8 Q(cho)144 676.8 Q +(wn root /usr/{ucb/{e)-.25 E(x,edit},lib/{e)-.15 E(x?.?*,ho)-.15 E(w_e) +-.25 E(x}})-.15 E .618(Brace e)108 693.6 R .618 +(xpansion introduces a slight incompatibility with historical v)-.15 F +.618(ersions of)-.15 F F1(sh)3.118 E F0(.)A F1(sh)5.618 E F0 .618 +(does not treat open-)3.118 F .248 +(ing or closing braces specially when the)108 705.6 R 2.748(ya)-.15 G +.247(ppear as part of a w)-2.748 F .247(ord, and preserv)-.1 F .247 +(es them in the output.)-.15 F F1(Bash)5.247 E F0(remo)108 717.6 Q -.15 +(ve)-.15 G 3.53(sb).15 G 1.03(races from w)-3.53 F 1.03 +(ords as a consequence of brace e)-.1 F 3.53(xpansion. F)-.15 F 1.03 +(or e)-.15 F 1.03(xample, a w)-.15 F 1.03(ord entered to)-.1 F F1(sh) +3.53 E F0(as)3.53 E F3(\214le{1,2})108 729.6 Q F0 .515 +(appears identically in the output.)3.015 F .515(The same w)5.515 F .515 +(ord is output as)-.1 F F3 .514(\214le1 \214le2)4.925 F F0 .514(after e) +3.034 F .514(xpansion by)-.15 F F1(bash)3.014 E F0(.)A(GNU Bash 4.3)72 +768 Q(2014 February 2)141.79 E(19)190.95 E 0 Cg EP +%%Page: 20 20 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .436(If strict compatibility with)108 84 R/F1 10/Times-Bold@0 SF +(sh)2.936 E F0 .436(is desired, start)2.936 F F1(bash)2.936 E F0 .436 +(with the)2.936 F F1(+B)2.936 E F0 .436(option or disable brace e)2.936 +F .437(xpansion with the)-.15 F F1(+B)108 96 Q F0(option to the)2.5 E F1 +(set)2.5 E F0(command \(see)2.5 E/F2 9/Times-Bold@0 SF(SHELL B)2.5 E +(UIL)-.09 E(TIN COMMANDS)-.828 E F0(belo)2.25 E(w\).)-.25 E F1 -.18(Ti) +87 112.8 S(lde Expansion).18 E F0 1.087(If a w)108 124.8 R 1.087(ord be) +-.1 F 1.087(gins with an unquoted tilde character \(`)-.15 F F1(~)A F0 +1.086('\), all of the characters preceding the \214rst unquoted)B .185(\ +slash \(or all characters, if there is no unquoted slash\) are consider\ +ed a)108 136.8 R/F3 10/Times-Italic@0 SF(tilde-pr)2.685 E(e\214x)-.37 E +F0 5.185(.I)C 2.685(fn)-5.185 G .185(one of the characters)-2.685 F .726 +(in the tilde-pre\214x are quoted, the characters in the tilde-pre\214x\ + follo)108 148.8 R .725(wing the tilde are treated as a possible)-.25 F +F3(lo)108 160.8 Q .522(gin name)-.1 F F0 5.522(.I)C 3.022(ft)-5.522 G +.522 +(his login name is the null string, the tilde is replaced with the v) +-3.022 F .523(alue of the shell parameter)-.25 F F2(HOME)108 172.8 Q/F4 +9/Times-Roman@0 SF(.)A F0(If)4.787 E F2(HOME)2.787 E F0 .287 +(is unset, the home directory of the user e)2.537 F -.15(xe)-.15 G .286 +(cuting the shell is substituted instead.).15 F(Other)5.286 E(-)-.2 E(w\ +ise, the tilde-pre\214x is replaced with the home directory associated \ +with the speci\214ed login name.)108 184.8 Q .092 +(If the tilde-pre\214x is a `~+', the v)108 201.6 R .092 +(alue of the shell v)-.25 F(ariable)-.25 E F2(PWD)2.592 E F0 .092 +(replaces the tilde-pre\214x.)2.342 F .093(If the tilde-pre\214x is) +5.093 F 3.404(a`)108 213.6 S .904(~\255', the v)-3.404 F .904 +(alue of the shell v)-.25 F(ariable)-.25 E F2(OLDPWD)3.404 E F4(,)A F0 +.904(if it is set, is substituted.)3.154 F .903(If the characters follo) +5.903 F .903(wing the)-.25 F 1.641 +(tilde in the tilde-pre\214x consist of a number)108 225.6 R F3(N)4.141 +E F0 4.142(,o)C 1.642(ptionally pre\214x)-4.142 F 1.642 +(ed by a `+' or a `\255', the tilde-pre\214x is)-.15 F 1.438(replaced w\ +ith the corresponding element from the directory stack, as it w)108 +237.6 R 1.437(ould be displayed by the)-.1 F F1(dirs)3.937 E F0 -.2(bu) +108 249.6 S .454(iltin in).2 F -.2(vo)-.4 G -.1(ke).2 G 2.954(dw).1 G +.454(ith the tilde-pre\214x as an ar)-2.954 F 2.954(gument. If)-.18 F +.454(the characters follo)2.954 F .455 +(wing the tilde in the tilde-pre\214x)-.25 F +(consist of a number without a leading `+' or `\255', `+' is assumed.) +108 261.6 Q(If the login name is in)108 278.4 Q -.25(va)-.4 G +(lid, or the tilde e).25 E(xpansion f)-.15 E(ails, the w)-.1 E +(ord is unchanged.)-.1 E .167(Each v)108 295.2 R .167 +(ariable assignment is check)-.25 F .167(ed for unquoted tilde-pre\214x) +-.1 F .167(es immediately follo)-.15 F .167(wing a)-.25 F F1(:)2.667 E +F0 .167(or the \214rst)2.667 F F1(=)2.666 E F0 5.166(.I)C(n)-5.166 E +.467(these cases, tilde e)108 307.2 R .467(xpansion is also performed.) +-.15 F(Consequently)5.467 E 2.967(,o)-.65 G .468 +(ne may use \214lenames with tildes in assign-)-2.967 F(ments to)108 +319.2 Q F2 -.666(PA)2.5 G(TH)-.189 E F4(,)A F2(MAILP)2.25 E -.855(AT) +-.666 G(H).855 E F4(,)A F0(and)2.25 E F2(CDP)2.5 E -.855(AT)-.666 G(H) +.855 E F4(,)A F0(and the shell assigns the e)2.25 E(xpanded v)-.15 E +(alue.)-.25 E F1 -.1(Pa)87 336 S(rameter Expansion).1 E F0 1.606(The `) +108 348 R F1($)A F0 4.106('c)C 1.606(haracter introduces parameter e) +-4.106 F 1.605(xpansion, command substitution, or arithmetic e)-.15 F +4.105(xpansion. The)-.15 F .406(parameter name or symbol to be e)108 360 +R .407(xpanded may be enclosed in braces, which are optional b)-.15 F +.407(ut serv)-.2 F 2.907(et)-.15 G 2.907(op)-2.907 G(ro-)-2.907 E .033 +(tect the v)108 372 R .033(ariable to be e)-.25 F .033 +(xpanded from characters immediately follo)-.15 F .032 +(wing it which could be interpreted as part)-.25 F(of the name.)108 384 +Q 1.189 +(When braces are used, the matching ending brace is the \214rst `)108 +400.8 R F1(})A F0 3.69('n)C 1.19(ot escaped by a backslash or within a) +-3.69 F 2.15(quoted string, and not within an embedded arithmetic e)108 +412.8 R 2.15(xpansion, command substitution, or parameter)-.15 F -.15 +(ex)108 424.8 S(pansion.).15 E(${)108 441.6 Q F3(par)A(ameter)-.15 E F0 +(})A 1.204(The v)144 453.6 R 1.204(alue of)-.25 F F3(par)3.704 E(ameter) +-.15 E F0 1.204(is substituted.)3.704 F 1.204 +(The braces are required when)6.204 F F3(par)4.955 E(ameter)-.15 E F0 +1.205(is a positional)4.435 F .264 +(parameter with more than one digit, or when)144 465.6 R F3(par)4.014 E +(ameter)-.15 E F0 .264(is follo)3.494 F .264 +(wed by a character which is not to)-.25 F 2.676 +(be interpreted as part of its name.)144 477.6 R(The)7.677 E F3(par) +5.177 E(ameter)-.15 E F0 2.677(is a shell parameter as described abo) +5.177 F -.15(ve)-.15 G F1 -.74(PA)144 489.6 S(RAMETERS).74 E F0 2.5(\)o) +C 2.5(ra)-2.5 G 2.5(na)-2.5 G(rray reference \()-2.5 E F1(Arrays)A F0 +(\).)A .816(If the \214rst character of)108 506.4 R F3(par)3.316 E +(ameter)-.15 E F0 .816(is an e)3.316 F .816(xclamation point \()-.15 F +F1(!)A F0 .816(\), it introduces a le)B -.15(ve)-.25 G 3.316(lo).15 G +3.315(fv)-3.316 G .815(ariable indirection.)-3.565 F F1(Bash)108 518.4 Q +F0 .106(uses the v)2.606 F .106(alue of the v)-.25 F .106 +(ariable formed from the rest of)-.25 F F3(par)2.606 E(ameter)-.15 E F0 +.106(as the name of the v)2.606 F .106(ariable; this v)-.25 F(ari-)-.25 +E .352(able is then e)108 530.4 R .352(xpanded and that v)-.15 F .351 +(alue is used in the rest of the substitution, rather than the v)-.25 F +.351(alue of)-.25 F F3(par)2.851 E(ame-)-.15 E(ter)108 542.4 Q F0 2.519 +(itself. This)2.519 F .019(is kno)2.519 F .019(wn as)-.25 F F3(indir) +2.519 E .019(ect e)-.37 F(xpansion)-.2 E F0 5.019(.T)C .019(he e)-5.019 +F .02(xceptions to this are the e)-.15 F .02(xpansions of ${)-.15 F F1 +(!)A F3(pr)A(e\214x)-.37 E F1(*)A F0 2.52(}a)C(nd)-2.52 E(${)108 554.4 Q +F1(!)A F3(name)A F0([)A F3(@)A F0 .763(]} described belo)B 4.563 -.65 +(w. T)-.25 H .763(he e).65 F .763 +(xclamation point must immediately follo)-.15 F 3.263(wt)-.25 G .763 +(he left brace in order to)-3.263 F(introduce indirection.)108 566.4 Q +.334(In each of the cases belo)108 583.2 R -.65(w,)-.25 G F3(wor)3.484 E +(d)-.37 E F0 .334(is subject to tilde e)2.834 F .334 +(xpansion, parameter e)-.15 F .334(xpansion, command substitution,)-.15 +F(and arithmetic e)108 595.2 Q(xpansion.)-.15 E 1.09 +(When not performing substring e)108 612 R 1.089 +(xpansion, using the forms documented belo)-.15 F 3.589(w\()-.25 G +(e.g.,)-3.589 E F1(:-)3.589 E F0(\),)A F1(bash)3.589 E F0 1.089 +(tests for a)3.589 F(parameter that is unset or null.)108 624 Q(Omittin\ +g the colon results in a test only for a parameter that is unset.)5 E +(${)108 640.8 Q F3(par)A(ameter)-.15 E F1<3aad>A F3(wor)A(d)-.37 E F0(}) +A F1 .722(Use Default V)144 652.8 R(alues)-.92 E F0 5.722(.I)C(f)-5.722 +E F3(par)4.472 E(ameter)-.15 E F0 .723(is unset or null, the e)3.952 F +.723(xpansion of)-.15 F F3(wor)3.563 E(d)-.37 E F0 .723(is substituted.) +3.993 F(Other)5.723 E(-)-.2 E(wise, the v)144 664.8 Q(alue of)-.25 E F3 +(par)3.75 E(ameter)-.15 E F0(is substituted.)3.23 E(${)108 676.8 Q F3 +(par)A(ameter)-.15 E F1(:=)A F3(wor)A(d)-.37 E F0(})A F1 2.005 +(Assign Default V)144 688.8 R(alues)-.92 E F0 7.005(.I)C(f)-7.005 E F3 +(par)5.755 E(ameter)-.15 E F0 2.005(is unset or null, the e)5.235 F +2.004(xpansion of)-.15 F F3(wor)4.844 E(d)-.37 E F0 2.004 +(is assigned to)5.274 F F3(par)144 700.8 Q(ameter)-.15 E F0 5.278(.T).73 +G .278(he v)-5.278 F .278(alue of)-.25 F F3(par)4.028 E(ameter)-.15 E F0 +.278(is then substituted.)3.508 F .279 +(Positional parameters and special param-)5.278 F +(eters may not be assigned to in this w)144 712.8 Q(ay)-.1 E(.)-.65 E +(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(20)190.95 E 0 Cg EP +%%Page: 21 21 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(${)108 84 Q/F1 10/Times-Italic@0 SF(par)A(ameter)-.15 E/F2 10 +/Times-Bold@0 SF(:?)A F1(wor)A(d)-.37 E F0(})A F2 .535(Display Err)144 +96 R .535(or if Null or Unset)-.18 F F0 5.535(.I)C(f)-5.535 E F1(par) +4.285 E(ameter)-.15 E F0 .535(is null or unset, the e)3.765 F .535 +(xpansion of)-.15 F F1(wor)3.035 E(d)-.37 E F0 .535(\(or a mes-)3.035 F +.661(sage to that ef)144 108 R .661(fect if)-.25 F F1(wor)3.501 E(d)-.37 +E F0 .662(is not present\) is written to the standard error and the she\ +ll, if it is not)3.931 F(interacti)144 120 Q -.15(ve)-.25 G 2.5(,e).15 G +2.5(xits. Otherwise,)-2.65 F(the v)2.5 E(alue of)-.25 E F1(par)2.5 E +(ameter)-.15 E F0(is substituted.)2.5 E(${)108 132 Q F1(par)A(ameter) +-.15 E F2(:+)A F1(wor)A(d)-.37 E F0(})A F2 .745(Use Alter)144 144 R .745 +(nate V)-.15 F(alue)-.92 E F0 5.745(.I)C(f)-5.745 E F1(par)4.495 E +(ameter)-.15 E F0 .745 +(is null or unset, nothing is substituted, otherwise the e)3.975 F +(xpan-)-.15 E(sion of)144 156 Q F1(wor)2.84 E(d)-.37 E F0 +(is substituted.)3.27 E(${)108 168 Q F1(par)A(ameter)-.15 E F2(:)A F1 +(of)A(fset)-.18 E F0(})A(${)108 180 Q F1(par)A(ameter)-.15 E F2(:)A F1 +(of)A(fset)-.18 E F2(:)A F1(length)A F0(})A F2 .002(Substring Expansion) +144 192 R F0 5.002(.E)C .002(xpands to up to)-5.002 F F1(length)2.502 E +F0 .002(characters of the v)2.502 F .002(alue of)-.25 F F1(par)2.502 E +(ameter)-.15 E F0 .002(starting at the)2.502 F 1.082 +(character speci\214ed by)144 204 R F1(of)3.582 E(fset)-.18 E F0 6.082 +(.I)C(f)-6.082 E F1(par)3.582 E(ameter)-.15 E F0(is)3.582 E F2(@)3.582 E +F0 3.582(,a)C 3.582(ni)-3.582 G(nde)-3.582 E -.15(xe)-.15 G 3.582(da).15 +G 1.082(rray subscripted by)-3.582 F F2(@)3.582 E F0(or)3.581 E F2(*) +3.581 E F0 3.581(,o)C 3.581(ra)-3.581 G(n)-3.581 E(associati)144 216 Q +1.022 -.15(ve a)-.25 H .722(rray name, the results dif).15 F .722 +(fer as described belo)-.25 F 4.522 -.65(w. I)-.25 H(f).65 E F1(length) +3.222 E F0 .722(is omitted, e)3.222 F .722(xpands to the)-.15 F .043 +(substring of the v)144 228 R .043(alue of)-.25 F F1(par)2.543 E(ameter) +-.15 E F0 .042(starting at the character speci\214ed by)2.543 F F1(of) +2.542 E(fset)-.18 E F0 .042(and e)2.542 F .042(xtending to the)-.15 F +.846(end of the v)144 240 R(alue.)-.25 E F1(length)5.846 E F0(and)3.346 +E F1(of)3.346 E(fset)-.18 E F0 .846(are arithmetic e)3.346 F .847 +(xpressions \(see)-.15 F/F3 9/Times-Bold@0 SF .847(ARITHMETIC EV)3.347 F +(ALU)-1.215 E -.855(AT)-.54 G(ION).855 E F0(belo)144 252 Q(w\).)-.25 E +(If)144 276 Q F1(of)3.029 E(fset)-.18 E F0 -.25(eva)3.029 G .529 +(luates to a number less than zero, the v).25 F .529 +(alue is used as an of)-.25 F .529(fset in characters from the)-.25 F +.045(end of the v)144 288 R .045(alue of)-.25 F F1(par)2.546 E(ameter) +-.15 E F0 5.046(.I)C(f)-5.046 E F1(length)2.546 E F0 -.25(eva)2.546 G +.046(luates to a number less than zero, it is interpreted as an).25 F +(of)144 300 Q .203(fset in characters from the end of the v)-.25 F .202 +(alue of)-.25 F F1(par)2.702 E(ameter)-.15 E F0 .202 +(rather than a number of characters, and)2.702 F .557(the e)144 312 R +.557(xpansion is the characters between)-.15 F F1(of)3.057 E(fset)-.18 E +F0 .557(and that result.)3.057 F .558(Note that a ne)5.558 F -.05(ga) +-.15 G(ti).05 E .858 -.15(ve o)-.25 H -.25(ff).15 G .558(set must be).25 +F(separated from the colon by at least one space to a)144 324 Q -.2(vo) +-.2 G(id being confused with the).2 E F2(:-)2.5 E F0 -.15(ex)2.5 G +(pansion.).15 E(If)144 348 Q F1(par)2.959 E(ameter)-.15 E F0(is)2.959 E +F2(@)2.959 E F0 2.959(,t)C .459(he result is)-2.959 F F1(length)2.959 E +F0 .459(positional parameters be)2.959 F .458(ginning at)-.15 F F1(of) +2.958 E(fset)-.18 E F0 5.458(.A)C(ne)-2.5 E -.05(ga)-.15 G(ti).05 E -.15 +(ve)-.25 G F1(of)3.108 E(fset)-.18 E F0 .095(is tak)144 360 R .095 +(en relati)-.1 F .396 -.15(ve t)-.25 H 2.596(oo).15 G .096 +(ne greater than the greatest positional parameter)-2.596 F 2.596(,s)-.4 +G 2.596(oa)-2.596 G 2.596(no)-2.596 G -.25(ff)-2.596 G .096(set of -1 e) +.25 F -.25(va)-.25 G .096(luates to).25 F 1.322 +(the last positional parameter)144 372 R 6.322(.I)-.55 G 3.822(ti)-6.322 +G 3.822(sa)-3.822 G 3.822(ne)-3.822 G 1.322(xpansion error if)-3.972 F +F1(length)3.822 E F0 -.25(eva)3.822 G 1.322 +(luates to a number less than).25 F(zero.)144 384 Q(If)144 408 Q F1(par) +3.013 E(ameter)-.15 E F0 .514(is an inde)3.013 F -.15(xe)-.15 G 3.014 +(da).15 G .514(rray name subscripted by @ or *, the result is the)-3.014 +F F1(length)3.014 E F0 .514(members of)3.014 F 1.082(the array be)144 +420 R 1.082(ginning with ${)-.15 F F1(par)A(ameter)-.15 E F0([)A F1(of)A +(fset)-.18 E F0 3.582(]}. A)B(ne)3.582 E -.05(ga)-.15 G(ti).05 E -.15 +(ve)-.25 G F1(of)3.732 E(fset)-.18 E F0 1.081(is tak)3.581 F 1.081 +(en relati)-.1 F 1.381 -.15(ve t)-.25 H 3.581(oo).15 G 1.081(ne greater) +-3.581 F 1.079(than the maximum inde)144 432 R 3.579(xo)-.15 G 3.579(ft) +-3.579 G 1.079(he speci\214ed array)-3.579 F 6.079(.I)-.65 G 3.579(ti) +-6.079 G 3.579(sa)-3.579 G 3.58(ne)-3.579 G 1.08(xpansion error if)-3.73 +F F1(length)3.58 E F0 -.25(eva)3.58 G 1.08(luates to a).25 F +(number less than zero.)144 444 Q(Substring e)144 468 Q +(xpansion applied to an associati)-.15 E .3 -.15(ve a)-.25 H +(rray produces unde\214ned results.).15 E 1.931(Substring inde)144 492 R +1.931(xing is zero-based unless the positional parameters are used, in \ +which case the)-.15 F(inde)144 504 Q .306(xing starts at 1 by def)-.15 F +2.806(ault. If)-.1 F F1(of)2.807 E(fset)-.18 E F0 .307 +(is 0, and the positional parameters are used,)2.807 F F2($0)2.807 E F0 +.307(is pre\214x)2.807 F(ed)-.15 E(to the list.)144 516 Q(${)108 532.8 Q +F2(!)A F1(pr)A(e\214x)-.37 E F2(*)A F0(})A(${)108 544.8 Q F2(!)A F1(pr)A +(e\214x)-.37 E F2(@)A F0(})A F2 .085(Names matching pr)144 556.8 R +(e\214x)-.18 E F0 5.085(.E)C .084(xpands to the names of v)-5.085 F .084 +(ariables whose names be)-.25 F .084(gin with)-.15 F F1(pr)2.584 E +(e\214x)-.37 E F0 2.584(,s)C(epa-)-2.584 E .257 +(rated by the \214rst character of the)144 568.8 R F3(IFS)2.757 E F0 +.257(special v)2.507 F 2.757(ariable. When)-.25 F F1(@)2.758 E F0 .258 +(is used and the e)2.758 F .258(xpansion appears)-.15 F +(within double quotes, each v)144 580.8 Q(ariable name e)-.25 E +(xpands to a separate w)-.15 E(ord.)-.1 E(${)108 597.6 Q F2(!)A F1(name) +A F0([)A F1(@)A F0(]})A(${)108 609.6 Q F2(!)A F1(name)A F0([)A F1(*)A F0 +(]})A F2 2.036(List of array k)144 621.6 R(eys)-.1 E F0 7.036(.I)C(f) +-7.036 E F1(name)4.536 E F0 2.036(is an array v)4.536 F 2.036 +(ariable, e)-.25 F 2.036(xpands to the list of array indices \(k)-.15 F +-.15(ey)-.1 G(s\)).15 E .595(assigned in)144 633.6 R F1(name)3.095 E F0 +5.595(.I)C(f)-5.595 E F1(name)3.095 E F0 .595(is not an array)3.095 F +3.095(,e)-.65 G .595(xpands to 0 if)-3.245 F F1(name)3.095 E F0 .596 +(is set and null otherwise.)3.095 F(When)5.596 E F1(@)144 645.6 Q F0 +(is used and the e)2.5 E(xpansion appears within double quotes, each k) +-.15 E .3 -.15(ey ex)-.1 H(pands to a separate w).15 E(ord.)-.1 E(${)108 +662.4 Q F2(#)A F1(par)A(ameter)-.15 E F0(})A F2 -.1(Pa)144 674.4 S .471 +(rameter length).1 F F0 5.471(.T)C .471 +(he length in characters of the v)-5.471 F .471(alue of)-.25 F F1(par) +2.971 E(ameter)-.15 E F0 .47(is substituted.)2.97 F(If)5.47 E F1(par) +4.22 E(ame-)-.15 E(ter)144 686.4 Q F0(is)4.438 E F2(*)3.708 E F0(or) +3.708 E F2(@)3.708 E F0 3.708(,t)C 1.208(he v)-3.708 F 1.208 +(alue substituted is the number of positional parameters.)-.25 F(If) +6.209 E F1(par)4.959 E(ameter)-.15 E F0 1.209(is an)4.439 F .349 +(array name subscripted by)144 698.4 R F2(*)2.849 E F0(or)2.849 E F2(@) +2.849 E F0 2.849(,t)C .349(he v)-2.849 F .349 +(alue substituted is the number of elements in the array)-.25 F 5.348 +(.I)-.65 G(f)-5.348 E F1(par)145.25 710.4 Q(ameter)-.15 E F0 .455 +(is an inde)3.685 F -.15(xe)-.15 G 2.955(da).15 G .456 +(rray name subscripted by a ne)-2.955 F -.05(ga)-.15 G(ti).05 E .756 +-.15(ve n)-.25 H(umber).15 E 2.956(,t)-.4 G .456 +(hat number is interpreted)-2.956 F .973(as relati)144 722.4 R 1.273 +-.15(ve t)-.25 H 3.473(oo).15 G .973(ne greater than the maximum inde) +-3.473 F 3.473(xo)-.15 G(f)-3.473 E F1(par)3.473 E(ameter)-.15 E F0 +3.472(,s)C 3.472(on)-3.472 G -2.25 -.15(eg a)-3.472 H(ti).15 E 1.272 +-.15(ve i)-.25 H .972(ndices count back).15 F(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(21)190.95 E 0 Cg EP +%%Page: 22 22 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(from the end of the array)144 84 Q 2.5(,a)-.65 G(nd an inde)-2.5 +E 2.5(xo)-.15 G 2.5<66ad>-2.5 G 2.5(1r)-2.5 G +(eferences the last element.)-2.5 E(${)108 100.8 Q/F1 10/Times-Italic@0 +SF(par)A(ameter)-.15 E/F2 10/Times-Bold@0 SF(#)A F1(wor)A(d)-.37 E F0(}) +A(${)108 112.8 Q F1(par)A(ameter)-.15 E F2(##)A F1(wor)A(d)-.37 E F0(})A +F2(Remo)144 124.8 Q 1.396 -.1(ve m)-.1 H 1.196(atching pr).1 F 1.196 +(e\214x patter)-.18 F(n)-.15 E F0 6.196(.T)C(he)-6.196 E F1(wor)4.036 E +(d)-.37 E F0 1.196(is e)4.466 F 1.196 +(xpanded to produce a pattern just as in path-)-.15 F .152(name e)144 +136.8 R 2.652(xpansion. If)-.15 F .152(the pattern matches the be)2.652 +F .152(ginning of the v)-.15 F .152(alue of)-.25 F F1(par)2.652 E +(ameter)-.15 E F0 2.652(,t).73 G .151(hen the result of)-2.652 F 1.4 +(the e)144 148.8 R 1.4(xpansion is the e)-.15 F 1.4(xpanded v)-.15 F 1.4 +(alue of)-.25 F F1(par)5.15 E(ameter)-.15 E F0 1.4 +(with the shortest matching pattern \(the `)4.63 F(`)-.74 E F2(#)A F0 +-.74('')C .281(case\) or the longest matching pattern \(the `)144 160.8 +R(`)-.74 E F2(##)A F0 1.761 -.74('' c)D .281(ase\) deleted.).74 F(If) +5.281 E F1(par)4.031 E(ameter)-.15 E F0(is)3.511 E F2(@)2.781 E F0(or) +2.781 E F2(*)2.781 E F0 2.781(,t)C .281(he pattern)-2.781 F(remo)144 +172.8 Q -.25(va)-.15 G 3.274(lo).25 G .774 +(peration is applied to each positional parameter in turn, and the e) +-3.274 F .774(xpansion is the resul-)-.15 F .402(tant list.)144 184.8 R +(If)5.402 E F1(par)4.152 E(ameter)-.15 E F0 .401(is an array v)3.632 F +.401(ariable subscripted with)-.25 F F2(@)2.901 E F0(or)2.901 E F2(*) +2.901 E F0 2.901(,t)C .401(he pattern remo)-2.901 F -.25(va)-.15 G 2.901 +(lo).25 G(peration)-2.901 E +(is applied to each member of the array in turn, and the e)144 196.8 Q +(xpansion is the resultant list.)-.15 E(${)108 213.6 Q F1(par)A(ameter) +-.15 E F2(%)A F1(wor)A(d)-.37 E F0(})A(${)108 225.6 Q F1(par)A(ameter) +-.15 E F2(%%)A F1(wor)A(d)-.37 E F0(})A F2(Remo)144 237.6 Q .346 -.1 +(ve m)-.1 H .146(atching suf\214x patter).1 F(n)-.15 E F0 5.146(.T)C(he) +-5.146 E F1(wor)2.646 E(d)-.37 E F0 .147(is e)2.647 F .147 +(xpanded to produce a pattern just as in pathname)-.15 F -.15(ex)144 +249.6 S 3.088(pansion. If).15 F .588 +(the pattern matches a trailing portion of the e)3.088 F .588(xpanded v) +-.15 F .588(alue of)-.25 F F1(par)3.088 E(ameter)-.15 E F0 3.088(,t).73 +G .588(hen the)-3.088 F .226(result of the e)144 261.6 R .226 +(xpansion is the e)-.15 F .226(xpanded v)-.15 F .226(alue of)-.25 F F1 +(par)3.976 E(ameter)-.15 E F0 .226 +(with the shortest matching pattern \(the)3.456 F -.74(``)144 273.6 S F2 +(%).74 E F0 1.522 -.74('' c)D .042 +(ase\) or the longest matching pattern \(the `).74 F(`)-.74 E F2(%%)A F0 +1.522 -.74('' c)D .042(ase\) deleted.).74 F(If)5.042 E F1(par)3.792 E +(ameter)-.15 E F0(is)3.272 E F2(@)2.541 E F0(or)2.541 E F2(*)2.541 E F0 +2.541(,t)C(he)-2.541 E .44(pattern remo)144 285.6 R -.25(va)-.15 G 2.94 +(lo).25 G .441 +(peration is applied to each positional parameter in turn, and the e) +-2.94 F .441(xpansion is the)-.15 F .241(resultant list.)144 297.6 R(If) +5.241 E F1(par)3.991 E(ameter)-.15 E F0 .241(is an array v)3.471 F .241 +(ariable subscripted with)-.25 F F2(@)2.741 E F0(or)2.74 E F2(*)2.74 E +F0 2.74(,t)C .24(he pattern remo)-2.74 F -.25(va)-.15 G 2.74(lo).25 G +(per)-2.74 E(-)-.2 E +(ation is applied to each member of the array in turn, and the e)144 +309.6 Q(xpansion is the resultant list.)-.15 E(${)108 326.4 Q F1(par)A +(ameter)-.15 E F2(/)A F1(pattern)A F2(/)A F1(string)A F0(})A F2 -.1(Pa) +144 338.4 S(tter).1 E 3.606(ns)-.15 G(ubstitution)-3.606 E F0 6.106(.T)C +(he)-6.106 E F1(pattern)3.606 E F0 1.106(is e)3.606 F 1.107 +(xpanded to produce a pattern just as in pathname e)-.15 F(xpan-)-.15 E +(sion.)144 350.4 Q F1 -.8(Pa)6.034 G -.15(ra).8 G(meter).15 E F0 1.034 +(is e)3.534 F 1.033(xpanded and the longest match of)-.15 F F1(pattern) +3.533 E F0(ag)3.533 E 1.033(ainst its v)-.05 F 1.033 +(alue is replaced with)-.25 F F1(string)144 362.4 Q F0 5.16(.I)C(f)-5.16 +E F1(pattern)2.66 E F0(be)2.66 E .16(gins with)-.15 F F2(/)2.66 E F0 +2.66(,a)C .161(ll matches of)-2.66 F F1(pattern)2.661 E F0 .161 +(are replaced with)2.661 F F1(string)2.661 E F0 5.161(.N)C .161 +(ormally only the)-5.161 F .807(\214rst match is replaced.)144 374.4 R +(If)5.807 E F1(pattern)3.307 E F0(be)3.307 E .807(gins with)-.15 F F2(#) +3.307 E F0 3.306(,i)C 3.306(tm)-3.306 G .806(ust match at the be)-3.306 +F .806(ginning of the e)-.15 F(xpanded)-.15 E -.25(va)144 386.4 S .62 +(lue of).25 F F1(par)3.12 E(ameter)-.15 E F0 5.62(.I)C(f)-5.62 E F1 +(pattern)3.12 E F0(be)3.12 E .62(gins with)-.15 F F2(%)3.12 E F0 3.12 +(,i)C 3.121(tm)-3.12 G .621(ust match at the end of the e)-3.121 F .621 +(xpanded v)-.15 F .621(alue of)-.25 F F1(par)144 398.4 Q(ameter)-.15 E +F0 6.254(.I)C(f)-6.254 E F1(string)3.754 E F0 1.253(is null, matches of) +3.753 F F1(pattern)3.753 E F0 1.253(are deleted and the)3.753 F F2(/) +3.753 E F0(follo)3.753 E(wing)-.25 E F1(pattern)3.753 E F0 1.253(may be) +3.753 F 2.678(omitted. If)144 410.4 R F1(par)3.928 E(ameter)-.15 E F0 +(is)3.408 E F2(@)2.678 E F0(or)2.678 E F2(*)2.679 E F0 2.679(,t)C .179 +(he substitution operation is applied to each positional parameter) +-2.679 F .619(in turn, and the e)144 422.4 R .619 +(xpansion is the resultant list.)-.15 F(If)5.619 E F1(par)4.369 E +(ameter)-.15 E F0 .618(is an array v)3.849 F .618 +(ariable subscripted with)-.25 F F2(@)144 434.4 Q F0(or)3.223 E F2(*) +3.223 E F0 3.223(,t)C .723(he substitution operation is applied to each\ + member of the array in turn, and the e)-3.223 F(xpan-)-.15 E +(sion is the resultant list.)144 446.4 Q(${)108 463.2 Q F1(par)A(ameter) +-.15 E F2(^)A F1(pattern)A F0(})A(${)108 475.2 Q F1(par)A(ameter)-.15 E +F2(^^)A F1(pattern)A F0(})A(${)108 487.2 Q F1(par)A(ameter)-.15 E F2(,)A +F1(pattern)A F0(})A(${)108 499.2 Q F1(par)A(ameter)-.15 E F2(,,)A F1 +(pattern)A F0(})A F2 .438(Case modi\214cation)144 511.2 R F0 5.438(.T)C +.438(his e)-5.438 F .437 +(xpansion modi\214es the case of alphabetic characters in)-.15 F F1(par) +2.937 E(ameter)-.15 E F0 5.437(.T)C(he)-5.437 E F1(pattern)144 523.2 Q +F0 1.406(is e)3.906 F 1.407 +(xpanded to produce a pattern just as in pathname e)-.15 F 3.907 +(xpansion. Each)-.15 F 1.407(character in the)3.907 F -.15(ex)144 535.2 +S 1.232(panded v).15 F 1.232(alue of)-.25 F F1(par)3.732 E(ameter)-.15 E +F0 1.232(is tested ag)3.732 F(ainst)-.05 E F1(pattern)3.732 E F0 3.732 +(,a)C 1.232(nd, if it matches the pattern, its case is)-3.732 F(con)144 +547.2 Q -.15(ve)-.4 G 2.924(rted. The).15 F .424 +(pattern should not attempt to match more than one character)2.924 F +5.424(.T)-.55 G(he)-5.424 E F2(^)2.924 E F0 .424(operator con-)2.924 F +-.15(ve)144 559.2 S .61(rts lo).15 F .61(wercase letters matching)-.25 F +F1(pattern)3.11 E F0 .61(to uppercase; the)3.11 F F2(,)3.11 E F0 .61 +(operator con)3.11 F -.15(ve)-.4 G .61(rts matching uppercase).15 F +1.547(letters to lo)144 571.2 R 4.047(wercase. The)-.25 F F2(^^)4.047 E +F0(and)4.047 E F2(,,)4.047 E F0 -.15(ex)4.047 G 1.547(pansions con).15 F +-.15(ve)-.4 G 1.547(rt each matched character in the e).15 F(xpanded) +-.15 E -.25(va)144 583.2 S .634(lue; the).25 F F2(^)3.134 E F0(and)3.134 +E F2(,)3.134 E F0 -.15(ex)3.134 G .634(pansions match and con).15 F -.15 +(ve)-.4 G .633(rt only the \214rst character in the e).15 F .633 +(xpanded v)-.15 F 3.133(alue. If)-.25 F F1(pattern)144 595.2 Q F0 .78 +(is omitted, it is treated lik)3.28 F 3.28(ea)-.1 G F2(?)A F0 3.28(,w)C +.78(hich matches e)-3.28 F -.15(ve)-.25 G .78(ry character).15 F 5.78 +(.I)-.55 G(f)-5.78 E F1(par)4.53 E(ameter)-.15 E F0(is)4.01 E F2(@)3.28 +E F0(or)3.28 E F2(*)3.28 E F0(,)A .582(the case modi\214cation operatio\ +n is applied to each positional parameter in turn, and the e)144 607.2 R +(xpansion)-.15 E .468(is the resultant list.)144 619.2 R(If)5.468 E F1 +(par)4.218 E(ameter)-.15 E F0 .468(is an array v)3.698 F .468 +(ariable subscripted with)-.25 F F2(@)2.968 E F0(or)2.968 E F2(*)2.969 E +F0 2.969(,t)C .469(he case modi\214ca-)-2.969 F .005(tion operation is \ +applied to each member of the array in turn, and the e)144 631.2 R .005 +(xpansion is the resultant list.)-.15 F F2(Command Substitution)87 648 Q +F1 1.697(Command substitution)108 660 R F0(allo)4.197 E 1.697 +(ws the output of a command to replace the command name.)-.25 F 1.698 +(There are tw)6.698 F(o)-.1 E(forms:)108 672 Q F2($\()144 688.8 Q F1 +(command)A F2(\))1.666 E F0(or)108 700.8 Q F2<92>144 712.8 Q F1(command) +A F2<92>A(Bash)108 729.6 Q F0 1.709(performs the e)4.209 F 1.709 +(xpansion by e)-.15 F -.15(xe)-.15 G(cuting).15 E F1(command)4.209 E F0 +1.708(and replacing the command substitution with the)4.208 F +(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(22)190.95 E 0 Cg EP +%%Page: 23 23 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .749(standard output of the command, with an)108 84 R 3.249(yt) +-.15 G .749(railing ne)-3.249 F .749(wlines deleted.)-.25 F .75 +(Embedded ne)5.749 F .75(wlines are not deleted,)-.25 F -.2(bu)108 96 S +3.197(tt).2 G(he)-3.197 E 3.197(ym)-.15 G .697(ay be remo)-3.197 F -.15 +(ve)-.15 G 3.196(dd).15 G .696(uring w)-3.196 F .696(ord splitting.)-.1 +F .696(The command substitution)5.696 F/F1 10/Times-Bold@0 SF($\(cat) +3.196 E/F2 10/Times-Italic@0 SF(\214le)3.196 E F1(\))A F0 .696 +(can be replaced by)3.196 F(the equi)108 108 Q -.25(va)-.25 G(lent b).25 +E(ut f)-.2 E(aster)-.1 E F1($\(<)2.5 E F2(\214le)2.5 E F1(\))A F0(.)A +1.724(When the old-style backquote form of substitution is used, backsl\ +ash retains its literal meaning e)108 124.8 R(xcept)-.15 E .315 +(when follo)108 136.8 R .315(wed by)-.25 F F1($)2.815 E F0(,)A F1<92> +2.815 E F0 2.815(,o)C(r)-2.815 E F1(\\)2.815 E F0 5.315(.T)C .314(he \ +\214rst backquote not preceded by a backslash terminates the command su\ +b-)-5.315 F 3.886(stitution. When)108 148.8 R 1.386(using the $\()3.886 +F F2(command).833 E F0 3.886(\)f)1.666 G 1.387 +(orm, all characters between the parentheses mak)-3.886 F 3.887(eu)-.1 G +3.887(pt)-3.887 G 1.387(he com-)-3.887 F +(mand; none are treated specially)108 160.8 Q(.)-.65 E .894 +(Command substitutions may be nested.)108 177.6 R 2.494 -.8(To n)5.894 H +.894(est when using the backquoted form, escape the inner back-).8 F +(quotes with backslashes.)108 189.6 Q .422 +(If the substitution appears within double quotes, w)108 206.4 R .422 +(ord splitting and pathname e)-.1 F .423(xpansion are not performed)-.15 +F(on the results.)108 218.4 Q F1(Arithmetic Expansion)87 235.2 Q F0 +1.035(Arithmetic e)108 247.2 R 1.035(xpansion allo)-.15 F 1.035 +(ws the e)-.25 F -.25(va)-.25 G 1.034(luation of an arithmetic e).25 F +1.034(xpression and the substitution of the result.)-.15 F +(The format for arithmetic e)108 259.2 Q(xpansion is:)-.15 E F1($\(\() +144 276 Q F2 -.2(ex)C(pr).2 E(ession)-.37 E F1(\)\))A F0(The)108 292.8 Q +F2 -.2(ex)2.665 G(pr).2 E(ession)-.37 E F0 .165 +(is treated as if it were within double quotes, b)2.905 F .166 +(ut a double quote inside the parentheses is not)-.2 F .231 +(treated specially)108 304.8 R 5.231(.A)-.65 G .231(ll tok)-5.231 F .231 +(ens in the e)-.1 F .231(xpression under)-.15 F .231(go parameter and v) +-.18 F .23(ariable e)-.25 F .23(xpansion, command substi-)-.15 F 1.059 +(tution, and quote remo)108 316.8 R -.25(va)-.15 G 3.559(l. The).25 F +1.059(result is treated as the arithmetic e)3.559 F 1.06 +(xpression to be e)-.15 F -.25(va)-.25 G 3.56(luated. Arithmetic).25 F +-.15(ex)108 328.8 S(pansions may be nested.).15 E 1.379(The e)108 345.6 +R -.25(va)-.25 G 1.378 +(luation is performed according to the rules listed belo).25 F 3.878(wu) +-.25 G(nder)-3.878 E/F3 9/Times-Bold@0 SF 1.378(ARITHMETIC EV)3.878 F +(ALU)-1.215 E -.855(AT)-.54 G(ION).855 E/F4 9/Times-Roman@0 SF(.)A F0 +(If)5.878 E F2 -.2(ex)108 357.6 S(pr).2 E(ession)-.37 E F0(is in)2.74 E +-.25(va)-.4 G(lid,).25 E F1(bash)2.5 E F0(prints a message indicating f) +2.5 E(ailure and no substitution occurs.)-.1 E F1(Pr)87 374.4 Q +(ocess Substitution)-.18 E F2(Pr)108 386.4 Q .97(ocess substitution)-.45 +F F0 .971(is supported on systems that support named pipes \()3.47 F F2 +(FIFOs)A F0 3.471(\)o)C 3.471(rt)-3.471 G(he)-3.471 E F1(/de)3.471 E +(v/fd)-.15 E F0 .971(method of)3.471 F .022(naming open \214les.)108 +398.4 R .021(It tak)5.022 F .021(es the form of)-.1 F F1(<\()2.521 E F2 +(list)A F1(\)).833 E F0(or)2.521 E F1(>\()2.521 E F2(list)A F1(\)).833 E +F0 5.021(.T)C .021(he process)-5.021 F F2(list)2.521 E F0 .021 +(is run with its input or output con-)2.521 F .058(nected to a)108 410.4 +R F2(FIFO)2.558 E F0 .058(or some \214le in)2.558 F F1(/de)2.558 E(v/fd) +-.15 E F0 5.058(.T)C .058(he name of this \214le is passed as an ar) +-5.058 F .059(gument to the current com-)-.18 F .131 +(mand as the result of the e)108 422.4 R 2.631(xpansion. If)-.15 F(the) +2.63 E F1(>\()2.63 E F2(list)A F1(\)).833 E F0 .13 +(form is used, writing to the \214le will pro)2.63 F .13(vide input for) +-.15 F F2(list)2.63 E F0(.)A(If the)108 434.4 Q F1(<\()2.5 E F2(list)A +F1(\)).833 E F0(form is used, the \214le passed as an ar)2.5 E +(gument should be read to obtain the output of)-.18 E F2(list)2.5 E F0 +(.)A .896(When a)108 451.2 R -.25(va)-.2 G .896(ilable, process substit\ +ution is performed simultaneously with parameter and v).25 F .897 +(ariable e)-.25 F(xpansion,)-.15 E +(command substitution, and arithmetic e)108 463.2 Q(xpansion.)-.15 E F1 +-.75(Wo)87 480 S(rd Splitting).75 E F0 1.143 +(The shell scans the results of parameter e)108 492 R 1.142 +(xpansion, command substitution, and arithmetic e)-.15 F 1.142 +(xpansion that)-.15 F(did not occur within double quotes for)108 504 Q +F2(wor)2.5 E 2.5(ds)-.37 G(plitting)-2.5 E F0(.).22 E .063 +(The shell treats each character of)108 520.8 R F3(IFS)2.563 E F0 .063 +(as a delimiter)2.313 F 2.563(,a)-.4 G .063 +(nd splits the results of the other e)-2.563 F .063(xpansions into w) +-.15 F(ords)-.1 E .207(using these characters as \214eld terminators.) +108 532.8 R(If)5.207 E F3(IFS)2.707 E F0 .207(is unset, or its v)2.457 F +.207(alue is e)-.25 F(xactly)-.15 E F1()2.707 E F0 +(,)A .836(the def)108 544.8 R .836(ault, then sequences of)-.1 F F1 +()3.336 E F0(,)A F1()3.336 E F0 3.336(,a)C(nd)-3.336 E F1 +()3.336 E F0 .837(at the be)3.336 F .837 +(ginning and end of the results of)-.15 F .346(the pre)108 556.8 R .345 +(vious e)-.25 F .345(xpansions are ignored, and an)-.15 F 2.845(ys)-.15 +G .345(equence of)-2.845 F F3(IFS)2.845 E F0 .345 +(characters not at the be)2.595 F .345(ginning or end serv)-.15 F(es) +-.15 E 1.236(to delimit w)108 568.8 R 3.736(ords. If)-.1 F F3(IFS)3.736 +E F0 1.236(has a v)3.486 F 1.236(alue other than the def)-.25 F 1.237 +(ault, then sequences of the whitespace characters)-.1 F F1(space)108 +580.8 Q F0(and)3.187 E F1(tab)3.187 E F0 .687(are ignored at the be) +3.187 F .687(ginning and end of the w)-.15 F .686 +(ord, as long as the whitespace character is in)-.1 F .276(the v)108 +592.8 R .276(alue of)-.25 F F3(IFS)2.777 E F0(\(an)2.527 E F3(IFS)2.777 +E F0 .277(whitespace character\).)2.527 F(An)5.277 E 2.777(yc)-.15 G +.277(haracter in)-2.777 F F3(IFS)2.777 E F0 .277(that is not)2.527 F F3 +(IFS)2.777 E F0 .277(whitespace, along with)2.527 F(an)108 604.8 Q 3.336 +(ya)-.15 G(djacent)-3.336 E F3(IFS)3.336 E F0 .836 +(whitespace characters, delimits a \214eld.)3.086 F 3.335(As)5.835 G +.835(equence of)-3.335 F F3(IFS)3.335 E F0 .835 +(whitespace characters is also)3.085 F(treated as a delimiter)108 616.8 +Q 5(.I)-.55 G 2.5(ft)-5 G(he v)-2.5 E(alue of)-.25 E F3(IFS)2.5 E F0 +(is null, no w)2.25 E(ord splitting occurs.)-.1 E 1.878 +(Explicit null ar)108 633.6 R 1.878(guments \()-.18 F F1 .833("").833 G +F0(or)3.545 E F1 .833<0808>5.211 G F0 4.378(\)a)C 1.878(re retained.) +-4.378 F 1.878(Unquoted implicit null ar)6.878 F 1.879 +(guments, resulting from the)-.18 F -.15(ex)108 645.6 S .177 +(pansion of parameters that ha).15 F .477 -.15(ve n)-.2 H 2.677(ov).15 G +.177(alues, are remo)-2.927 F -.15(ve)-.15 G 2.676(d. If).15 F 2.676(ap) +2.676 G .176(arameter with no v)-2.676 F .176(alue is e)-.25 F .176 +(xpanded within)-.15 F(double quotes, a null ar)108 657.6 Q +(gument results and is retained.)-.18 E(Note that if no e)108 674.4 Q +(xpansion occurs, no splitting is performed.)-.15 E F1 -.1(Pa)87 691.2 S +(thname Expansion).1 E F0 .37(After w)108 703.2 R .37 +(ord splitting, unless the)-.1 F F12.87 E F0 .37 +(option has been set,)2.87 F F1(bash)2.87 E F0 .371(scans each w)2.871 F +.371(ord for the characters)-.1 F F1(*)2.871 E F0(,)A F1(?)2.871 E F0 +2.871(,a)C(nd)-2.871 E F1([)2.871 E F0(.)A .678 +(If one of these characters appears, then the w)108 715.2 R .677 +(ord is re)-.1 F -.05(ga)-.15 G .677(rded as a).05 F F2(pattern)3.177 E +F0 3.177(,a).24 G .677(nd replaced with an alphabeti-)-3.177 F .562 +(cally sorted list of \214lenames matching the pattern \(see)108 727.2 R +F3 -.09(Pa)3.062 G(tter).09 E 2.812(nM)-.135 G(atching)-2.812 E F0(belo) +2.812 E 3.062(w\). If)-.25 F .562(no matching \214lenames)3.062 F +(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(23)190.95 E 0 Cg EP +%%Page: 24 24 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .009(are found, and the shell option)108 84 R/F1 10/Times-Bold@0 +SF(nullglob)2.509 E F0 .008(is not enabled, the w)2.509 F .008 +(ord is left unchanged.)-.1 F .008(If the)5.008 F F1(nullglob)2.508 E F0 +.008(option is)2.508 F .442(set, and no matches are found, the w)108 96 +R .442(ord is remo)-.1 F -.15(ve)-.15 G 2.942(d. If).15 F(the)2.943 E F1 +(failglob)2.943 E F0 .443(shell option is set, and no matches are)2.943 +F 1.38(found, an error message is printed and the command is not e)108 +108 R -.15(xe)-.15 G 3.88(cuted. If).15 F 1.38(the shell option)3.88 F +F1(nocaseglob)3.88 E F0(is)3.88 E .103 +(enabled, the match is performed without re)108 120 R -.05(ga)-.15 G +.104(rd to the case of alphabetic characters.).05 F .104 +(When a pattern is used)5.104 F .378(for pathname e)108 132 R .378 +(xpansion, the character)-.15 F F1 -.63(``)2.878 G -.55(.').63 G(')-.08 +E F0 .378(at the start of a name or immediately follo)5.378 F .377 +(wing a slash must be)-.25 F .578(matched e)108 144 R(xplicitly)-.15 E +3.078(,u)-.65 G .578(nless the shell option)-3.078 F F1(dotglob)3.079 E +F0 .579(is set.)3.079 F .579 +(When matching a pathname, the slash character)5.579 F 1.789(must al)108 +156 R -.1(wa)-.1 G 1.788(ys be matched e).1 F(xplicitly)-.15 E 6.788(.I) +-.65 G 4.288(no)-6.788 G 1.788(ther cases, the)-4.288 F F1 -.63(``)4.288 +G -.55(.').63 G(')-.08 E F0 1.788(character is not treated specially) +6.788 F 6.788(.S)-.65 G 1.788(ee the)-6.788 F .165(description of)108 +168 R F1(shopt)2.665 E F0(belo)2.665 E 2.665(wu)-.25 G(nder)-2.665 E/F2 +9/Times-Bold@0 SF .165(SHELL B)2.665 F(UIL)-.09 E .165(TIN COMMANDS) +-.828 F F0 .166(for a description of the)2.415 F F1(nocaseglob)2.666 E +F0(,)A F1(null-)2.666 E(glob)108 180 Q F0(,)A F1(failglob)2.5 E F0 2.5 +(,a)C(nd)-2.5 E F1(dotglob)2.5 E F0(shell options.)2.5 E(The)108 196.8 Q +F2(GLOBIGNORE)2.786 E F0 .286(shell v)2.536 F .285 +(ariable may be used to restrict the set of \214lenames matching a)-.25 +F/F3 10/Times-Italic@0 SF(pattern)2.785 E F0 5.285(.I).24 G(f)-5.285 E +F2(GLO-)2.785 E(BIGNORE)108 208.8 Q F0 2.316(is set, each matching \214\ +lename that also matches one of the patterns in)4.565 F F2(GLOBIGNORE) +4.816 E F0(is)4.566 E(remo)108 220.8 Q -.15(ve)-.15 G 2.66(df).15 G .16 +(rom the list of matches.)-2.66 F .16(The \214lenames)5.16 F F1 -.63(``) +2.66 G -.55(.').63 G(')-.08 E F0(and)5.16 E F1 -.63(``)2.66 G(..).63 E +-.63('')-.55 G F0 .16(are al)5.79 F -.1(wa)-.1 G .159(ys ignored when).1 +F F2(GLOBIGNORE)2.659 E F0(is)2.409 E .045(set and not null.)108 232.8 R +(Ho)5.045 E(we)-.25 E -.15(ve)-.25 G .845 -.4(r, s).15 H(etting).4 E F2 +(GLOBIGNORE)2.545 E F0 .046(to a non-null v)2.296 F .046 +(alue has the ef)-.25 F .046(fect of enabling the)-.25 F F1(dotglob) +2.546 E F0 .787(shell option, so all other \214lenames be)108 244.8 R +.787(ginning with a)-.15 F F1 -.63(``)3.287 G -.55(.').63 G(')-.08 E F0 +.787(will match.)5.787 F 2.386 -.8(To g)5.787 H .786(et the old beha).8 +F .786(vior of ignoring)-.2 F .641(\214lenames be)108 256.8 R .641 +(ginning with a)-.15 F F1 -.63(``)3.141 G -.55(.').63 G(')-.08 E F0 +3.141(,m)C(ak)-3.141 E(e)-.1 E F1 -.63(``)3.141 G(.*').63 E(')-.63 E F0 +.642(one of the patterns in)5.642 F F2(GLOBIGNORE)3.142 E/F4 9 +/Times-Roman@0 SF(.)A F0(The)5.142 E F1(dotglob)3.142 E F0 .642 +(option is)3.142 F(disabled when)108 268.8 Q F2(GLOBIGNORE)2.5 E F0 +(is unset.)2.25 E F1 -.1(Pa)108 285.6 S(tter).1 E 2.5(nM)-.15 G(atching) +-2.5 E F0(An)108 302.4 Q 3.138(yc)-.15 G .638(haracter that appears in \ +a pattern, other than the special pattern characters described belo) +-3.138 F 1.938 -.65(w, m)-.25 H(atches).65 E 3.62(itself. The)108 314.4 +R 1.12(NUL character may not occur in a pattern.)3.62 F 3.62(Ab)6.12 G +1.12(ackslash escapes the follo)-3.62 F 1.12(wing character; the)-.25 F +.576(escaping backslash is discarded when matching.)108 326.4 R .576 +(The special pattern characters must be quoted if the)5.576 F 3.076(ya) +-.15 G(re)-3.076 E(to be matched literally)108 338.4 Q(.)-.65 E +(The special pattern characters ha)108 355.2 Q .3 -.15(ve t)-.2 H +(he follo).15 E(wing meanings:)-.25 E F1(*)144 372 Q F0 .376(Matches an) +31 F 2.876(ys)-.15 G .376(tring, including the null string.)-2.876 F +.376(When the)5.376 F F1(globstar)2.876 E F0 .377 +(shell option is enabled,)2.876 F(and)180 384 Q F1(*)3.275 E F0 .775 +(is used in a pathname e)3.275 F .775(xpansion conte)-.15 F .775(xt, tw) +-.15 F 3.275(oa)-.1 G(djacent)-3.275 E F1(*)3.275 E F0 3.275(su)C .775 +(sed as a single pattern)-3.275 F 1.058(will match all \214les and zero\ + or more directories and subdirectories.)180 396 R 1.058(If follo)6.058 +F 1.058(wed by a)-.25 F F1(/)3.558 E F0(,)A(tw)180 408 Q 2.5(oa)-.1 G +(djacent)-2.5 E F1(*)2.5 E F0 2.5(sw)C +(ill match only directories and subdirectories.)-2.5 E F1(?)144 420 Q F0 +(Matches an)31 E 2.5(ys)-.15 G(ingle character)-2.5 E(.)-.55 E F1([...]) +144 432 Q F0 .579(Matches an)21.84 F 3.079(yo)-.15 G .579 +(ne of the enclosed characters.)-3.079 F 3.079(Ap)5.579 G .578 +(air of characters separated by a h)-3.079 F(yphen)-.05 E .684 +(denotes a)180 444 R F3 -.15(ra)3.184 G(ng).15 E 3.184(ee)-.1 G(xpr) +-3.384 E(ession)-.37 E F0 3.184(;a)C .984 -.15(ny c)-3.184 H .684 +(haracter that f).15 F .684(alls between those tw)-.1 F 3.185(oc)-.1 G +.685(haracters, inclu-)-3.185 F(si)180 456 Q -.15(ve)-.25 G 3.713(,u).15 +G 1.213(sing the current locale')-3.713 F 3.712(sc)-.55 G 1.212 +(ollating sequence and character set, is matched.)-3.712 F 1.212(If the) +6.212 F 1.123(\214rst character follo)180 468 R 1.123(wing the)-.25 F F1 +([)3.623 E F0 1.123(is a)3.623 F F1(!)3.623 E F0 1.124(or a)6.123 F F1 +(^)3.624 E F0 1.124(then an)3.624 F 3.624(yc)-.15 G 1.124 +(haracter not enclosed is matched.)-3.624 F .895 +(The sorting order of characters in range e)180 480 R .894 +(xpressions is determined by the current locale)-.15 F .375(and the v) +180 492 R .375(alues of the)-.25 F F2(LC_COLLA)2.875 E(TE)-.855 E F0(or) +2.625 E F2(LC_ALL)2.875 E F0 .375(shell v)2.625 F .375 +(ariables, if set.)-.25 F 1.976 -.8(To o)5.376 H .376(btain the tra-).8 +F .068(ditional interpretation of range e)180 504 R .068 +(xpressions, where)-.15 F F1([a\255d])2.568 E F0 .067(is equi)2.567 F +-.25(va)-.25 G .067(lent to).25 F F1([abcd])2.567 E F0 2.567(,s)C .067 +(et v)-2.567 F(alue)-.25 E .156(of the)180 516 R F1(LC_ALL)2.656 E F0 +.156(shell v)2.656 F .156(ariable to)-.25 F F1(C)2.657 E F0 2.657(,o)C +2.657(re)-2.657 G .157(nable the)-2.657 F F1(globasciiranges)2.657 E F0 +.157(shell option.)2.657 F(A)5.157 E F12.657 E F0(may)2.657 E .193(\ +be matched by including it as the \214rst or last character in the set.) +180 528 R(A)5.193 E F1(])2.693 E F0 .193(may be matched by)2.693 F +(including it as the \214rst character in the set.)180 540 Q -.4(Wi)180 +558 S(thin).4 E F1([)3.07 E F0(and)3.07 E F1(])3.07 E F0(,)A F3 -.15(ch) +3.07 G(ar).15 E .571(acter classes)-.15 F F0 .571 +(can be speci\214ed using the syntax)3.071 F F1([:)3.071 E F3(class)A F1 +(:])A F0 3.071(,w)C(here)-3.071 E F3(class)3.071 E F0 +(is one of the follo)180 570 Q +(wing classes de\214ned in the POSIX standard:)-.25 E F1 8.173 +(alnum alpha ascii blank cntrl digit graph lo)180 582 R 8.173 +(wer print punct space)-.1 F 5(upper w)180 594 R 5(ord xdigit)-.1 F F0 +4.289(Ac)180 606 S 1.789(haracter class matches an)-4.289 F 4.289(yc) +-.15 G 1.789(haracter belonging to that class.)-4.289 F(The)6.789 E F1 +-.1(wo)4.29 G(rd).1 E F0(character)4.29 E +(class matches letters, digits, and the character _.)180 618 Q -.4(Wi) +180 636 S(thin).4 E F1([)4.537 E F0(and)4.537 E F1(])4.537 E F0 4.537 +(,a)C(n)-4.537 E F3 2.037(equivalence class)4.537 F F0 2.036 +(can be speci\214ed using the syntax)4.536 F F1([=)4.536 E F3(c)A F1(=]) +A F0 4.536(,w)C(hich)-4.536 E .125(matches all characters with the same\ + collation weight \(as de\214ned by the current locale\) as)180 648 R +(the character)180 660 Q F3(c)2.5 E F0(.)A -.4(Wi)180 678 S(thin).4 E F1 +([)2.5 E F0(and)2.5 E F1(])2.5 E F0 2.5(,t)C(he syntax)-2.5 E F1([.)2.5 +E F3(symbol)A F1(.])A F0(matches the collating symbol)2.5 E F3(symbol) +2.5 E F0(.)A .705(If the)108 694.8 R F1(extglob)3.205 E F0 .705 +(shell option is enabled using the)3.205 F F1(shopt)3.205 E F0 -.2(bu) +3.205 G .704(iltin, se).2 F -.15(ve)-.25 G .704(ral e).15 F .704 +(xtended pattern matching operators)-.15 F .255(are recognized.)108 +706.8 R .255(In the follo)5.255 F .255(wing description, a)-.25 F F3 +(pattern-list)2.755 E F0 .255 +(is a list of one or more patterns separated by a)2.755 F F1(|)2.756 E +F0(.)A(Composite patterns may be formed using one or more of the follo) +108 718.8 Q(wing sub-patterns:)-.25 E(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(24)190.95 E 0 Cg EP +%%Page: 25 25 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(?\()144 84 Q/F2 10/Times-Italic@0 SF +(pattern-list).833 E F1(\)).833 E F0 +(Matches zero or one occurrence of the gi)180 96 Q -.15(ve)-.25 G 2.5 +(np).15 G(atterns)-2.5 E F1(*\()144 108 Q F2(pattern-list).833 E F1(\)) +.833 E F0(Matches zero or more occurrences of the gi)180 120 Q -.15(ve) +-.25 G 2.5(np).15 G(atterns)-2.5 E F1(+\()144 132 Q F2(pattern-list).833 +E F1(\)).833 E F0(Matches one or more occurrences of the gi)180 144 Q +-.15(ve)-.25 G 2.5(np).15 G(atterns)-2.5 E F1(@\()144 156 Q F2 +(pattern-list).833 E F1(\)).833 E F0(Matches one of the gi)180 168 Q +-.15(ve)-.25 G 2.5(np).15 G(atterns)-2.5 E F1(!\()144 180 Q F2 +(pattern-list).833 E F1(\)).833 E F0(Matches an)180 192 Q(ything e)-.15 +E(xcept one of the gi)-.15 E -.15(ve)-.25 G 2.5(np).15 G(atterns)-2.5 E +F1(Quote Remo)87 208.8 Q -.1(va)-.1 G(l).1 E F0 1.113 +(After the preceding e)108 220.8 R 1.113 +(xpansions, all unquoted occurrences of the characters)-.15 F F1(\\) +3.613 E F0(,)A F1<08>3.612 E F0 3.612(,a)C(nd)-3.612 E F1(")4.445 E F0 +1.112(that did not result)4.445 F(from one of the abo)108 232.8 Q .3 +-.15(ve ex)-.15 H(pansions are remo).15 E -.15(ve)-.15 G(d.).15 E/F3 +10.95/Times-Bold@0 SF(REDIRECTION)72 249.6 Q F0 .545 +(Before a command is e)108 261.6 R -.15(xe)-.15 G .545 +(cuted, its input and output may be).15 F F2 -.37(re)3.045 G(dir).37 E +(ected)-.37 E F0 .545(using a special notation interpreted)3.815 F .405 +(by the shell.)108 273.6 R .405(Redirection allo)5.405 F .405(ws comman\ +ds' \214le handles to be duplicated, opened, closed, made to refer to) +-.25 F(dif)108 285.6 Q 1.019(ferent \214les, and can change the \214les\ + the command reads from and writes to.)-.25 F 1.02 +(Redirection may also be)6.02 F .215 +(used to modify \214le handles in the current shell e)108 297.6 R -.15 +(xe)-.15 G .215(cution en).15 F 2.715(vironment. The)-.4 F(follo)2.715 E +.215(wing redirection operators)-.25 F .875(may precede or appear an)108 +309.6 R .875(ywhere within a)-.15 F F2 .875(simple command)3.715 F F0 +.875(or may follo)4.145 F 3.376(wa)-.25 G F2(command)A F0 5.876(.R).77 G +.876(edirections are)-5.876 F(processed in the order the)108 321.6 Q 2.5 +(ya)-.15 G(ppear)-2.5 E 2.5(,f)-.4 G(rom left to right.)-2.5 E .771(Eac\ +h redirection that may be preceded by a \214le descriptor number may in\ +stead be preceded by a w)108 338.4 R .771(ord of)-.1 F .292(the form {) +108 350.4 R F2(varname)A F0 2.793(}. In)B .293 +(this case, for each redirection operator e)2.793 F .293 +(xcept >&- and <&-, the shell will allocate)-.15 F 3.18<618c>108 362.4 S +.679(le descriptor greater than or equal to 10 and assign it to)-3.18 F +F2(varname)3.179 E F0 5.679(.I)C 3.179(f>)-5.679 G .679 +(&- or <&- is preceded by {)-3.179 F F2(var)A(-)-.2 E(name)108 374.4 Q +F0(}, the v)A(alue of)-.25 E F2(varname)2.5 E F0 +(de\214nes the \214le descriptor to close.)2.5 E .283(In the follo)108 +391.2 R .284(wing descriptions, if the \214le descriptor number is omit\ +ted, and the \214rst character of the redirect-)-.25 F .513 +(ion operator is)108 403.2 R F1(<)3.012 E F0 3.012(,t)C .512 +(he redirection refers to the standard input \(\214le descriptor 0\).) +-3.012 F .512(If the \214rst character of the)5.512 F +(redirection operator is)108 415.2 Q F1(>)2.5 E F0 2.5(,t)C +(he redirection refers to the standard output \(\214le descriptor 1\).) +-2.5 E .824(The w)108 432 R .824(ord follo)-.1 F .824 +(wing the redirection operator in the follo)-.25 F .825 +(wing descriptions, unless otherwise noted, is sub-)-.25 F .463 +(jected to brace e)108 444 R .463(xpansion, tilde e)-.15 F .462 +(xpansion, parameter and v)-.15 F .462(ariable e)-.25 F .462 +(xpansion, command substitution, arith-)-.15 F .866(metic e)108 456 R +.866(xpansion, quote remo)-.15 F -.25(va)-.15 G .866(l, pathname e).25 F +.867(xpansion, and w)-.15 F .867(ord splitting.)-.1 F .867(If it e)5.867 +F .867(xpands to more than one)-.15 F -.1(wo)108 468 S(rd,).1 E F1(bash) +2.5 E F0(reports an error)2.5 E(.)-.55 E +(Note that the order of redirections is signi\214cant.)108 484.8 Q -.15 +(Fo)5 G 2.5(re).15 G(xample, the command)-2.65 E(ls)144 501.6 Q F1(>)2.5 +E F0(dirlist 2)2.5 E F1(>&)A F0(1)A +(directs both standard output and standard error to the \214le)108 518.4 +Q F2(dirlist)2.5 E F0 2.5(,w).68 G(hile the command)-2.5 E(ls 2)144 +535.2 Q F1(>&)A F0(1)A F1(>)2.5 E F0(dirlist)2.5 E .527 +(directs only the standard output to \214le)108 552 R F2(dirlist)3.027 E +F0 3.027(,b).68 G .527(ecause the standard error w)-3.027 F .527 +(as duplicated from the standard)-.1 F +(output before the standard output w)108 564 Q(as redirected to)-.1 E F2 +(dirlist)2.5 E F0(.).68 E F1(Bash)108 580.8 Q F0 .598(handles se)3.098 F +-.15(ve)-.25 G .598(ral \214lenames specially when the).15 F 3.099(ya) +-.15 G .599(re used in redirections, as described in the follo)-3.099 F +(wing)-.25 E(table:)108 592.8 Q F1(/de)144 609.6 Q(v/fd/)-.15 E F2(fd)A +F0(If)180 621.6 Q F2(fd)2.5 E F0(is a v)2.5 E(alid inte)-.25 E(ger)-.15 +E 2.5<2c8c>-.4 G(le descriptor)-2.5 E F2(fd)2.5 E F0(is duplicated.)2.5 +E F1(/de)144 633.6 Q(v/stdin)-.15 E F0(File descriptor 0 is duplicated.) +180 645.6 Q F1(/de)144 657.6 Q(v/stdout)-.15 E F0 +(File descriptor 1 is duplicated.)180 669.6 Q F1(/de)144 681.6 Q +(v/stderr)-.15 E F0(File descriptor 2 is duplicated.)180 693.6 Q F1(/de) +144 705.6 Q(v/tcp/)-.15 E F2(host)A F1(/)A F2(port)A F0(If)180 717.6 Q +F2(host)2.997 E F0 .497(is a v)2.997 F .497 +(alid hostname or Internet address, and)-.25 F F2(port)2.996 E F0 .496 +(is an inte)2.996 F .496(ger port number or ser)-.15 F(-)-.2 E +(vice name,)180 729.6 Q F1(bash)2.5 E F0 +(attempts to open the corresponding TCP sock)2.5 E(et.)-.1 E +(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(25)190.95 E 0 Cg EP +%%Page: 26 26 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(/de)144 84 Q(v/udp/)-.15 E/F2 10 +/Times-Italic@0 SF(host)A F1(/)A F2(port)A F0(If)180 96 Q F2(host)2.996 +E F0 .496(is a v)2.996 F .496(alid hostname or Internet address, and) +-.25 F F2(port)2.997 E F0 .497(is an inte)2.997 F .497 +(ger port number or ser)-.15 F(-)-.2 E(vice name,)180 108 Q F1(bash)2.5 +E F0(attempts to open the corresponding UDP sock)2.5 E(et.)-.1 E 2.5(Af) +108 124.8 S +(ailure to open or create a \214le causes the redirection to f)-2.6 E +(ail.)-.1 E .947(Redirections using \214le descriptors greater than 9 s\ +hould be used with care, as the)108 141.6 R 3.446(ym)-.15 G .946 +(ay con\215ict with \214le)-3.446 F +(descriptors the shell uses internally)108 153.6 Q(.)-.65 E F1(Redir)87 +170.4 Q(ecting Input)-.18 E F0 .391 +(Redirection of input causes the \214le whose name results from the e) +108 182.4 R .391(xpansion of)-.15 F F2(wor)3.231 E(d)-.37 E F0 .391 +(to be opened for read-)3.661 F(ing on \214le descriptor)108 194.4 Q F2 +(n)2.5 E F0 2.5(,o).24 G 2.5(rt)-2.5 G +(he standard input \(\214le descriptor 0\) if)-2.5 E F2(n)2.86 E F0 +(is not speci\214ed.)2.74 E +(The general format for redirecting input is:)108 211.2 Q([)144 228 Q F2 +(n)A F0(])A F1(<)A F2(wor)A(d)-.37 E F1(Redir)87 244.8 Q(ecting Output) +-.18 E F0 .175 +(Redirection of output causes the \214le whose name results from the e) +108 256.8 R .174(xpansion of)-.15 F F2(wor)3.014 E(d)-.37 E F0 .174 +(to be opened for writ-)3.444 F .824(ing on \214le descriptor)108 268.8 +R F2(n)3.324 E F0 3.324(,o).24 G 3.324(rt)-3.324 G .824 +(he standard output \(\214le descriptor 1\) if)-3.324 F F2(n)3.684 E F0 +.824(is not speci\214ed.)3.564 F .825(If the \214le does not)5.825 F +-.15(ex)108 280.8 S(ist it is created; if it does e).15 E +(xist it is truncated to zero size.)-.15 E +(The general format for redirecting output is:)108 297.6 Q([)144 314.4 Q +F2(n)A F0(])A F1(>)A F2(wor)A(d)-.37 E F0 .155 +(If the redirection operator is)108 331.2 R F1(>)2.655 E F0 2.655(,a)C +.155(nd the)-2.655 F F1(noclob)2.655 E(ber)-.1 E F0 .154(option to the) +2.654 F F1(set)2.654 E F0 -.2(bu)2.654 G .154 +(iltin has been enabled, the redirection).2 F .657(will f)108 343.2 R +.657(ail if the \214le whose name results from the e)-.1 F .658 +(xpansion of)-.15 F F2(wor)3.158 E(d)-.37 E F0 -.15(ex)3.158 G .658 +(ists and is a re).15 F .658(gular \214le.)-.15 F .658(If the redi-) +5.658 F .409(rection operator is)108 355.2 R F1(>|)2.909 E F0 2.909(,o)C +2.909(rt)-2.909 G .409(he redirection operator is)-2.909 F F1(>)2.909 E +F0 .409(and the)2.909 F F1(noclob)2.909 E(ber)-.1 E F0 .409 +(option to the)2.909 F F1(set)2.909 E F0 -.2(bu)2.908 G .408 +(iltin command).2 F(is not enabled, the redirection is attempted e)108 +367.2 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(ft)-2.5 G(he \214le named by) +-2.5 E F2(wor)2.5 E(d)-.37 E F0 -.15(ex)2.5 G(ists.).15 E F1 -.25(Ap)87 +384 S(pending Redir).25 E(ected Output)-.18 E F0 .641 +(Redirection of output in this f)108 396 R .642 +(ashion causes the \214le whose name results from the e)-.1 F .642 +(xpansion of)-.15 F F2(wor)3.482 E(d)-.37 E F0 .642(to be)3.912 F .474 +(opened for appending on \214le descriptor)108 408 R F2(n)2.974 E F0 +2.974(,o).24 G 2.974(rt)-2.974 G .474 +(he standard output \(\214le descriptor 1\) if)-2.974 F F2(n)3.333 E F0 +.473(is not speci\214ed.)3.213 F(If)5.473 E(the \214le does not e)108 +420 Q(xist it is created.)-.15 E +(The general format for appending output is:)108 436.8 Q([)144 453.6 Q +F2(n)A F0(])A F1(>>)A F2(wor)A(d)-.37 E F1(Redir)87 475.2 Q +(ecting Standard Output and Standard Err)-.18 E(or)-.18 E F0 .248 +(This construct allo)108 487.2 R .249(ws both the standard output \(\ +\214le descriptor 1\) and the standard error output \(\214le descrip-) +-.25 F(tor 2\) to be redirected to the \214le whose name is the e)108 +499.2 Q(xpansion of)-.15 E F2(wor)2.5 E(d)-.37 E F0(.).77 E +(There are tw)108 516 Q 2.5(of)-.1 G +(ormats for redirecting standard output and standard error:)-2.5 E F1 +(&>)144 532.8 Q F2(wor)A(d)-.37 E F0(and)108 544.8 Q F1(>&)144 556.8 Q +F2(wor)A(d)-.37 E F0(Of the tw)108 573.6 Q 2.5(of)-.1 G +(orms, the \214rst is preferred.)-2.5 E(This is semantically equi)5 E +-.25(va)-.25 G(lent to).25 E F1(>)144 590.4 Q F2(wor)A(d)-.37 E F0(2)2.5 +E F1(>&)A F0(1)A .115(When using the second form,)108 607.2 R F2(wor) +2.614 E(d)-.37 E F0 .114(may not e)2.614 F .114(xpand to a number or) +-.15 F F12.614 E F0 5.114(.I)C 2.614(fi)-5.114 G 2.614(td)-2.614 G +.114(oes, other redirection operators)-2.614 F(apply \(see)108 619.2 Q +F1(Duplicating File Descriptors)2.5 E F0(belo)2.5 E +(w\) for compatibility reasons.)-.25 E F1 -.25(Ap)87 636 S +(pending Standard Output and Standard Err).25 E(or)-.18 E F0 .248 +(This construct allo)108 648 R .249(ws both the standard output \(\214l\ +e descriptor 1\) and the standard error output \(\214le descrip-)-.25 F +(tor 2\) to be appended to the \214le whose name is the e)108 660 Q +(xpansion of)-.15 E F2(wor)2.5 E(d)-.37 E F0(.).77 E +(The format for appending standard output and standard error is:)108 +676.8 Q F1(&>>)144 693.6 Q F2(wor)A(d)-.37 E F0 +(This is semantically equi)108 710.4 Q -.25(va)-.25 G(lent to).25 E F1 +(>>)144 727.2 Q F2(wor)A(d)-.37 E F0(2)2.5 E F1(>&)A F0(1)A +(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(26)190.95 E 0 Cg EP +%%Page: 27 27 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(\(see)108 84 Q/F1 10/Times-Bold@0 SF +(Duplicating File Descriptors)2.5 E F0(belo)2.5 E(w\).)-.25 E F1(Her)87 +100.8 Q 2.5(eD)-.18 G(ocuments)-2.5 E F0 .33(This type of redirection i\ +nstructs the shell to read input from the current source until a line c\ +ontaining only)108 112.8 R/F2 10/Times-Italic@0 SF(delimiter)108.35 +124.8 Q F0 .614(\(with no trailing blanks\) is seen.)3.844 F .615 +(All of the lines read up to that point are then used as the stan-)5.615 +F(dard input for a command.)108 136.8 Q +(The format of here-documents is:)108 153.6 Q F1(<<)144 170.4 Q F0([)A +F1A F0(])A F2(wor)A(d)-.37 E(her)164 182.4 Q(e-document)-.37 E +(delimiter)144 194.4 Q F0 .302(No parameter and v)108 211.2 R .302 +(ariable e)-.25 F .302(xpansion, command substitution, arithmetic e)-.15 +F .301(xpansion, or pathname e)-.15 F(xpansion)-.15 E .225 +(is performed on)108 223.2 R F2(wor)2.725 E(d)-.37 E F0 5.225(.I).77 G +2.726(fa)-5.225 G .526 -.15(ny c)-2.726 H .226(haracters in).15 F F2 +(wor)3.066 E(d)-.37 E F0 .226(are quoted, the)3.496 F F2(delimiter)3.076 +E F0 .226(is the result of quote remo)3.456 F -.25(va)-.15 G 2.726(lo) +.25 G(n)-2.726 E F2(wor)108 235.2 Q(d)-.37 E F0 2.715(,a).77 G .215 +(nd the lines in the here-document are not e)-2.715 F 2.714(xpanded. If) +-.15 F F2(wor)2.714 E(d)-.37 E F0 .214 +(is unquoted, all lines of the here-docu-)2.714 F .499 +(ment are subjected to parameter e)108 247.2 R .499 +(xpansion, command substitution, and arithmetic e)-.15 F .5 +(xpansion, the character)-.15 F(sequence)108 259.2 Q F1(\\)2.5 +E F0(is ignored, and)2.5 E F1(\\)2.5 E F0 +(must be used to quote the characters)2.5 E F1(\\)2.5 E F0(,)A F1($)2.5 +E F0 2.5(,a)C(nd)-2.5 E F1<92>2.5 E F0(.)A .602 +(If the redirection operator is)108 276 R F1(<<\255)3.101 E F0 3.101(,t) +C .601(hen all leading tab characters are stripped from input lines and\ + the line)-3.101 F(containing)108 288 Q F2(delimiter)2.5 E F0 5(.T).73 G +(his allo)-5 E +(ws here-documents within shell scripts to be indented in a natural f) +-.25 E(ashion.)-.1 E F1(Her)87 304.8 Q 2.5(eS)-.18 G(trings)-2.5 E F0 +2.5(Av)108 316.8 S(ariant of here documents, the format is:)-2.75 E F1 +(<<<)144 333.6 Q F2(wor)A(d)-.37 E F0(The)108 350.4 Q F2(wor)2.893 E(d) +-.37 E F0(under)2.893 E .393(goes brace e)-.18 F .393(xpansion, tilde e) +-.15 F .393(xpansion, parameter and v)-.15 F .394(ariable e)-.25 F .394 +(xpansion, command substi-)-.15 F 2.148(tution, arithmetic e)108 362.4 R +2.148(xpansion, and quote remo)-.15 F -.25(va)-.15 G 4.648(l. P).25 F +2.148(athname e)-.15 F 2.148(xpansion and w)-.15 F 2.147 +(ord splitting are not per)-.1 F(-)-.2 E 2.5(formed. The)108 374.4 R(re\ +sult is supplied as a single string to the command on its standard inpu\ +t.)2.5 E F1(Duplicating File Descriptors)87 391.2 Q F0 +(The redirection operator)108 403.2 Q([)144 420 Q F2(n)A F0(])A F1(<&)A +F2(wor)A(d)-.37 E F0 .126 +(is used to duplicate input \214le descriptors.)108 436.8 R(If)5.127 E +F2(wor)2.967 E(d)-.37 E F0 -.15(ex)3.397 G .127 +(pands to one or more digits, the \214le descriptor denoted).15 F(by)108 +448.8 Q F2(n)3.318 E F0 .458(is made to be a cop)3.198 F 2.958(yo)-.1 G +2.958(ft)-2.958 G .457(hat \214le descriptor)-2.958 F 5.457(.I)-.55 G +2.957(ft)-5.457 G .457(he digits in)-2.957 F F2(wor)3.297 E(d)-.37 E F0 +.457(do not specify a \214le descriptor open)3.727 F .149 +(for input, a redirection error occurs.)108 460.8 R(If)5.149 E F2(wor) +2.989 E(d)-.37 E F0 -.25(eva)3.419 G .149(luates to).25 F F12.649 E +F0 2.65<2c8c>C .15(le descriptor)-2.65 F F2(n)3.01 E F0 .15(is closed.) +2.89 F(If)5.15 E F2(n)3.01 E F0 .15(is not speci\214ed,)2.89 F +(the standard input \(\214le descriptor 0\) is used.)108 472.8 Q +(The operator)108 489.6 Q([)144 506.4 Q F2(n)A F0(])A F1(>&)A F2(wor)A +(d)-.37 E F0 .444 +(is used similarly to duplicate output \214le descriptors.)108 523.2 R +(If)5.444 E F2(n)3.304 E F0 .443 +(is not speci\214ed, the standard output \(\214le descrip-)3.183 F 1.357 +(tor 1\) is used.)108 535.2 R 1.357(If the digits in)6.357 F F2(wor) +4.197 E(d)-.37 E F0 1.358(do not specify a \214le descriptor open for o\ +utput, a redirection error)4.627 F 2.754(occurs. If)108 547.2 R F2(wor) +3.094 E(d)-.37 E F0 -.25(eva)3.524 G .254(luates to).25 F F12.754 E +F0 2.754<2c8c>C .254(le descriptor)-2.754 F F2(n)3.114 E F0 .254 +(is closed.)2.994 F .254(As a special case, if)5.254 F F2(n)2.754 E F0 +.253(is omitted, and)2.754 F F2(wor)2.753 E(d)-.37 E F0(does)2.753 E +.965(not e)108 559.2 R .965(xpand to one or more digits or)-.15 F F1 +3.465 E F0 3.466(,t)C .966 +(he standard output and standard error are redirected as described) +-3.466 F(pre)108 571.2 Q(viously)-.25 E(.)-.65 E F1(Mo)87 588 Q +(ving File Descriptors)-.1 E F0(The redirection operator)108 600 Q([)144 +616.8 Q F2(n)A F0(])A F1(<&)A F2(digit)A F1A F0(mo)108 633.6 Q -.15 +(ve)-.15 G 3.036(st).15 G .536(he \214le descriptor)-3.036 F F2(digit) +3.036 E F0 .536(to \214le descriptor)3.036 F F2(n)3.036 E F0 3.036(,o) +.24 G 3.036(rt)-3.036 G .535 +(he standard input \(\214le descriptor 0\) if)-3.036 F F2(n)3.035 E F0 +.535(is not speci-)3.035 F(\214ed.)108 645.6 Q F2(digit)5 E F0 +(is closed after being duplicated to)2.5 E F2(n)2.5 E F0(.)A(Similarly) +108 662.4 Q 2.5(,t)-.65 G(he redirection operator)-2.5 E([)144 679.2 Q +F2(n)A F0(])A F1(>&)A F2(digit)A F1A F0(mo)108 696 Q -.15(ve)-.15 G +2.785(st).15 G .285(he \214le descriptor)-2.785 F F2(digit)2.785 E F0 +.285(to \214le descriptor)2.785 F F2(n)2.785 E F0 2.785(,o).24 G 2.785 +(rt)-2.785 G .286(he standard output \(\214le descriptor 1\) if)-2.785 F +F2(n)2.786 E F0 .286(is not speci-)2.786 F(\214ed.)108 708 Q +(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(27)190.95 E 0 Cg EP +%%Page: 28 28 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(Opening File Descriptors f)87 84 Q +(or Reading and Writing)-.25 E F0(The redirection operator)108 96 Q([) +144 112.8 Q/F2 10/Times-Italic@0 SF(n)A F0(])A F1(<>)A F2(wor)A(d)-.37 E +F0 1.349(causes the \214le whose name is the e)108 129.6 R 1.349 +(xpansion of)-.15 F F2(wor)4.189 E(d)-.37 E F0 1.349 +(to be opened for both reading and writing on \214le)4.619 F(descriptor) +108 141.6 Q F2(n)2.5 E F0 2.5(,o).24 G 2.5(ro)-2.5 G 2.5<6e8c>-2.5 G +(le descriptor 0 if)-2.5 E F2(n)2.86 E F0(is not speci\214ed.)2.74 E +(If the \214le does not e)5 E(xist, it is created.)-.15 E/F3 10.95 +/Times-Bold@0 SF(ALIASES)72 158.4 Q F2(Aliases)108 170.4 Q F0(allo)3.173 +E 3.173(was)-.25 G .674(tring to be substituted for a w)-3.173 F .674 +(ord when it is used as the \214rst w)-.1 F .674 +(ord of a simple command.)-.1 F .394(The shell maintains a list of alia\ +ses that may be set and unset with the)108 182.4 R F1(alias)2.893 E F0 +(and)2.893 E F1(unalias)2.893 E F0 -.2(bu)2.893 G .393(iltin commands).2 +F(\(see)108 194.4 Q/F4 9/Times-Bold@0 SF 1.979(SHELL B)4.479 F(UIL)-.09 +E 1.979(TIN COMMANDS)-.828 F F0(belo)4.229 E 4.48(w\). The)-.25 F 1.98 +(\214rst w)4.48 F 1.98(ord of each simple command, if unquoted, is)-.1 F +(check)108 206.4 Q .473(ed to see if it has an alias.)-.1 F .473 +(If so, that w)5.473 F .472(ord is replaced by the te)-.1 F .472 +(xt of the alias.)-.15 F .472(The characters)5.472 F F1(/)2.972 E F0(,)A +F1($)2.972 E F0(,)A F1<92>2.972 E F0(,)A(and)108 218.4 Q F1(=)3.611 E F0 +1.111(and an)3.611 F 3.611(yo)-.15 G 3.611(ft)-3.611 G 1.111(he shell) +-3.611 F F2(metac)3.612 E(har)-.15 E(acter)-.15 E(s)-.1 E F0 1.112 +(or quoting characters listed abo)3.612 F 1.412 -.15(ve m)-.15 H 1.112 +(ay not appear in an alias).15 F 3.62(name. The)108 230.4 R 1.12 +(replacement te)3.62 F 1.119(xt may contain an)-.15 F 3.619(yv)-.15 G +1.119(alid shell input, including shell metacharacters.)-3.869 F 1.119 +(The \214rst)6.119 F -.1(wo)108 242.4 S .513(rd of the replacement te).1 +F .513(xt is tested for aliases, b)-.15 F .513(ut a w)-.2 F .514 +(ord that is identical to an alias being e)-.1 F .514(xpanded is)-.15 F +.296(not e)108 254.4 R .296(xpanded a second time.)-.15 F .296 +(This means that one may alias)5.296 F F1(ls)2.796 E F0(to)2.796 E F1 +.296(ls \255F)2.796 F F0 2.796(,f)C .295(or instance, and)-2.796 F F1 +(bash)2.795 E F0 .295(does not try)2.795 F .542(to recursi)108 266.4 R +-.15(ve)-.25 G .542(ly e).15 F .542(xpand the replacement te)-.15 F +3.042(xt. If)-.15 F .543(the last character of the alias v)3.042 F .543 +(alue is a)-.25 F F2(blank)3.043 E F0 3.043(,t).67 G .543(hen the ne) +-3.043 F(xt)-.15 E(command w)108 278.4 Q(ord follo)-.1 E +(wing the alias is also check)-.25 E(ed for alias e)-.1 E(xpansion.)-.15 +E(Aliases are created and listed with the)108 295.2 Q F1(alias)2.5 E F0 +(command, and remo)2.5 E -.15(ve)-.15 G 2.5(dw).15 G(ith the)-2.5 E F1 +(unalias)2.5 E F0(command.)2.5 E .284 +(There is no mechanism for using ar)108 312 R .284 +(guments in the replacement te)-.18 F 2.784(xt. If)-.15 F(ar)2.784 E +.284(guments are needed, a shell func-)-.18 F(tion should be used \(see) +108 324 Q F4(FUNCTIONS)2.5 E F0(belo)2.25 E(w\).)-.25 E 1.22 +(Aliases are not e)108 340.8 R 1.22 +(xpanded when the shell is not interacti)-.15 F -.15(ve)-.25 G 3.72(,u) +.15 G 1.22(nless the)-3.72 F F1(expand_aliases)3.72 E F0 1.22 +(shell option is set)3.72 F(using)108 352.8 Q F1(shopt)2.5 E F0 +(\(see the description of)2.5 E F1(shopt)2.5 E F0(under)2.5 E F4 +(SHELL B)2.5 E(UIL)-.09 E(TIN COMMANDS)-.828 E F0(belo)2.25 E(w\).)-.25 +E .436 +(The rules concerning the de\214nition and use of aliases are some)108 +369.6 R .435(what confusing.)-.25 F F1(Bash)5.435 E F0(al)2.935 E -.1 +(wa)-.1 G .435(ys reads at least).1 F .337 +(one complete line of input before e)108 381.6 R -.15(xe)-.15 G .338 +(cuting an).15 F 2.838(yo)-.15 G 2.838(ft)-2.838 G .338 +(he commands on that line.)-2.838 F .338(Aliases are e)5.338 F .338 +(xpanded when)-.15 F 3.404(ac)108 393.6 S .904 +(ommand is read, not when it is e)-3.404 F -.15(xe)-.15 G 3.404 +(cuted. Therefore,).15 F .904 +(an alias de\214nition appearing on the same line as)3.404 F 1.161 +(another command does not tak)108 405.6 R 3.662(ee)-.1 G -.25(ff)-3.662 +G 1.162(ect until the ne).25 F 1.162(xt line of input is read.)-.15 F +1.162(The commands follo)6.162 F 1.162(wing the)-.25 F .277 +(alias de\214nition on that line are not af)108 417.6 R .277 +(fected by the ne)-.25 F 2.777(wa)-.25 G 2.777(lias. This)-2.777 F(beha) +2.777 E .277(vior is also an issue when functions)-.2 F .698(are e)108 +429.6 R -.15(xe)-.15 G 3.198(cuted. Aliases).15 F .698(are e)3.198 F +.699(xpanded when a function de\214nition is read, not when the functio\ +n is e)-.15 F -.15(xe)-.15 G(cuted,).15 E .495 +(because a function de\214nition is itself a compound command.)108 441.6 +R .494(As a consequence, aliases de\214ned in a func-)5.494 F .084 +(tion are not a)108 453.6 R -.25(va)-.2 G .084 +(ilable until after that function is e).25 F -.15(xe)-.15 G 2.584 +(cuted. T).15 F 2.584(ob)-.8 G 2.584(es)-2.584 G .084(afe, al)-2.584 F +-.1(wa)-.1 G .085(ys put alias de\214nitions on a sepa-).1 F +(rate line, and do not use)108 465.6 Q F1(alias)2.5 E F0 +(in compound commands.)2.5 E -.15(Fo)108 482.4 S 2.5(ra).15 G(lmost e) +-2.5 E -.15(ve)-.25 G +(ry purpose, aliases are superseded by shell functions.).15 E F3 +(FUNCTIONS)72 499.2 Q F0 3.468(As)108 511.2 S .968 +(hell function, de\214ned as described abo)-3.468 F 1.267 -.15(ve u)-.15 +H(nder).15 E F4 .967(SHELL GRAMMAR)3.467 F/F5 9/Times-Roman@0 SF(,)A F0 +.967(stores a series of commands for)3.217 F 1.001(later e)108 523.2 R +-.15(xe)-.15 G 3.501(cution. When).15 F 1.002(the name of a shell funct\ +ion is used as a simple command name, the list of com-)3.501 F .316 +(mands associated with that function name is e)108 535.2 R -.15(xe)-.15 +G 2.816(cuted. Functions).15 F .316(are e)2.816 F -.15(xe)-.15 G .315 +(cuted in the conte).15 F .315(xt of the current)-.15 F .035 +(shell; no ne)108 547.2 R 2.535(wp)-.25 G .036 +(rocess is created to interpret them \(contrast this with the e)-2.535 F +-.15(xe)-.15 G .036(cution of a shell script\).).15 F .036(When a)5.036 +F .64(function is e)108 559.2 R -.15(xe)-.15 G .64(cuted, the ar).15 F +.639 +(guments to the function become the positional parameters during its e) +-.18 F -.15(xe)-.15 G(cution.).15 E .532(The special parameter)108 571.2 +R F1(#)3.032 E F0 .532(is updated to re\215ect the change.)3.032 F .532 +(Special parameter)5.532 F F1(0)3.033 E F0 .533(is unchanged.)3.033 F +.533(The \214rst ele-)5.533 F(ment of the)108 583.2 Q F4(FUNCN)2.5 E +(AME)-.18 E F0 -.25(va)2.25 G +(riable is set to the name of the function while the function is e).25 E +-.15(xe)-.15 G(cuting.).15 E 1.25(All other aspects of the shell e)108 +600 R -.15(xe)-.15 G 1.25(cution en).15 F 1.25 +(vironment are identical between a function and its caller with)-.4 F +1.048(these e)108 612 R 3.548(xceptions: the)-.15 F F4(DEB)3.548 E(UG) +-.09 E F0(and)3.298 E F1(RETURN)3.548 E F0 1.048 +(traps \(see the description of the)3.548 F F1(trap)3.548 E F0 -.2(bu) +3.548 G 1.048(iltin under).2 F F4(SHELL)3.549 E -.09(BU)108 624 S(IL).09 +E .479(TIN COMMANDS)-.828 F F0(belo)2.729 E .479 +(w\) are not inherited unless the function has been gi)-.25 F -.15(ve) +-.25 G 2.978(nt).15 G(he)-2.978 E F1(trace)2.978 E F0(attrib)2.978 E +.478(ute \(see)-.2 F .42(the description of the)108 636 R F4(declar)2.92 +E(e)-.162 E F0 -.2(bu)2.67 G .42(iltin belo).2 F .42(w\) or the)-.25 F +F1 .42(\255o functrace)2.92 F F0 .42 +(shell option has been enabled with the)2.92 F F1(set)2.921 E F0 -.2(bu) +108 648 S .072(iltin \(in which case all functions inherit the).2 F F1 +(DEB)2.572 E(UG)-.1 E F0(and)2.572 E F1(RETURN)2.572 E F0 .072 +(traps\), and the)2.572 F F4(ERR)2.571 E F0 .071(trap is not inher)2.321 +F(-)-.2 E(ited unless the)108 660 Q F1(\255o errtrace)2.5 E F0 +(shell option has been enabled.)2.5 E -1.11(Va)108 676.8 S .655 +(riables local to the function may be declared with the)1.11 F F1(local) +3.155 E F0 -.2(bu)3.156 G .656(iltin command.).2 F(Ordinarily)5.656 E +3.156(,v)-.65 G .656(ariables and)-3.406 F(their v)108 688.8 Q +(alues are shared between the function and its caller)-.25 E(.)-.55 E +(The)108 705.6 Q F1(FUNCNEST)3.529 E F0 -.25(va)3.529 G 1.028 +(riable, if set to a numeric v).25 F 1.028 +(alue greater than 0, de\214nes a maximum function nesting)-.25 F(le)108 +717.6 Q -.15(ve)-.25 G 2.5(l. Function).15 F(in)2.5 E -.2(vo)-.4 G +(cations that e).2 E(xceed the limit cause the entire command to abort.) +-.15 E(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(28)190.95 E 0 Cg +EP +%%Page: 29 29 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .043(If the b)108 84 R .043(uiltin command)-.2 F/F1 10 +/Times-Bold@0 SF -.18(re)2.543 G(tur).18 E(n)-.15 E F0 .043(is e)2.543 F +-.15(xe)-.15 G .043(cuted in a function, the function completes and e) +.15 F -.15(xe)-.15 G .044(cution resumes with).15 F 1.012(the ne)108 96 +R 1.012(xt command after the function call.)-.15 F(An)6.011 E 3.511(yc) +-.15 G 1.011(ommand associated with the)-3.511 F F1(RETURN)3.511 E F0 +1.011(trap is e)3.511 F -.15(xe)-.15 G(cuted).15 E .213(before e)108 108 +R -.15(xe)-.15 G .213(cution resumes.).15 F .213 +(When a function completes, the v)5.213 F .214 +(alues of the positional parameters and the spe-)-.25 F(cial parameter) +108 120 Q F1(#)2.5 E F0(are restored to the v)2.5 E(alues the)-.25 E 2.5 +(yh)-.15 G(ad prior to the function')-2.5 E 2.5(se)-.55 G -.15(xe)-2.65 +G(cution.).15 E 1.359 +(Function names and de\214nitions may be listed with the)108 136.8 R F1 +3.858 E F0 1.358(option to the)3.858 F F1(declar)3.858 E(e)-.18 E +F0(or)3.858 E F1(typeset)3.858 E F0 -.2(bu)3.858 G 1.358(iltin com-).2 F +3.39(mands. The)108 148.8 R F13.39 E F0 .89(option to)3.39 F F1 +(declar)3.39 E(e)-.18 E F0(or)3.39 E F1(typeset)3.39 E F0 .89 +(will list the function names only \(and optionally the source)3.39 F +.327(\214le and line number)108 160.8 R 2.827(,i)-.4 G 2.827(ft)-2.827 G +(he)-2.827 E F1(extdeb)2.827 E(ug)-.2 E F0 .326 +(shell option is enabled\).)2.827 F .326(Functions may be e)5.326 F .326 +(xported so that subshells)-.15 F 1.297(automatically ha)108 172.8 R +1.597 -.15(ve t)-.2 H 1.297(hem de\214ned with the).15 F F13.797 E +F0 1.297(option to the)3.797 F F1(export)3.798 E F0 -.2(bu)3.798 G 3.798 +(iltin. A).2 F 1.298(function de\214nition may be)3.798 F .161 +(deleted using the)108 184.8 R F12.661 E F0 .161(option to the) +2.661 F F1(unset)2.661 E F0 -.2(bu)2.661 G 2.661(iltin. Note).2 F .16 +(that shell functions and v)2.661 F .16(ariables with the same name)-.25 +F 1.325(may result in multiple identically-named entries in the en)108 +196.8 R 1.325(vironment passed to the shell')-.4 F 3.825(sc)-.55 G 3.825 +(hildren. Care)-3.825 F(should be tak)108 208.8 Q +(en in cases where this may cause a problem.)-.1 E .372 +(Functions may be recursi)108 225.6 R -.15(ve)-.25 G 5.371(.T).15 G(he) +-5.371 E F1(FUNCNEST)2.871 E F0 -.25(va)2.871 G .371 +(riable may be used to limit the depth of the function call).25 F 1.141 +(stack and restrict the number of function in)108 237.6 R -.2(vo)-.4 G +3.641(cations. By).2 F(def)3.641 E 1.141 +(ault, no limit is imposed on the number of)-.1 F(recursi)108 249.6 Q .3 +-.15(ve c)-.25 H(alls.).15 E/F2 10.95/Times-Bold@0 SF(ARITHMETIC EV)72 +266.4 Q(ALU)-1.478 E -1.04(AT)-.657 G(ION)1.04 E F0 2.298 +(The shell allo)108 278.4 R 2.297(ws arithmetic e)-.25 F 2.297 +(xpressions to be e)-.15 F -.25(va)-.25 G 2.297 +(luated, under certain circumstances \(see the).25 F F1(let)4.797 E F0 +(and)4.797 E F1(declar)108 290.4 Q(e)-.18 E F0 -.2(bu)2.705 G .205 +(iltin commands and).2 F F1 .205(Arithmetic Expansion)2.705 F F0 2.705 +(\). Ev)B .205(aluation is done in \214x)-.25 F .206(ed-width inte)-.15 +F .206(gers with no)-.15 F .429(check for o)108 302.4 R -.15(ve)-.15 G +(r\215o).15 E 1.729 -.65(w, t)-.25 H .429(hough di).65 F .428 +(vision by 0 is trapped and \215agged as an error)-.25 F 5.428(.T)-.55 G +.428(he operators and their prece-)-5.428 F 1.919(dence, associati)108 +314.4 R(vity)-.25 E 4.419(,a)-.65 G 1.919(nd v)-4.419 F 1.919 +(alues are the same as in the C language.)-.25 F 1.92(The follo)6.92 F +1.92(wing list of operators is)-.25 F(grouped into le)108 326.4 Q -.15 +(ve)-.25 G(ls of equal-precedence operators.).15 E(The le)5 E -.15(ve) +-.25 G(ls are listed in order of decreasing precedence.).15 E/F3 10 +/Times-Italic@0 SF(id)108 343.2 Q F1(++)A F3(id)2.5 E F1A F0 -.25 +(va)144 355.2 S(riable post-increment and post-decrement).25 E F1(++)108 +367.2 Q F3(id)A F12.5 E F3(id)A F0 -.25(va)144 379.2 S +(riable pre-increment and pre-decrement).25 E F1 2.5108 391.2 S F0 +(unary minus and plus)19.6 E F1 2.5(!~)108 403.2 S F0 +(logical and bitwise ne)24.34 E -.05(ga)-.15 G(tion).05 E F1(**)108 +415.2 Q F0 -.15(ex)26 G(ponentiation).15 E F1 2.5(*/%)108 427.2 S F0 +(multiplication, di)10.72 E(vision, remainder)-.25 E F1 2.5<2bad>108 +439.2 S F0(addition, subtraction)19.6 E F1(<< >>)108 451.2 Q F0 +(left and right bitwise shifts)10.7 E F1(<= >= < >)108 463.2 Q F0 +(comparison)144 475.2 Q F1(== !=)108 487.2 Q F0(equality and inequality) +13.07 E F1(&)108 499.2 Q F0(bitwise AND)27.67 E F1(^)108 511.2 Q F0 +(bitwise e)32.67 E(xclusi)-.15 E .3 -.15(ve O)-.25 H(R).15 E F1(|)108 +523.2 Q F0(bitwise OR)33.8 E F1(&&)108 535.2 Q F0(logical AND)19.34 E F1 +(||)108 547.2 Q F0(logical OR)31.6 E F3 -.2(ex)108 559.2 S(pr).2 E F1(?) +A F3 -.2(ex)C(pr).2 E F1(:)A F3 -.2(ex)C(pr).2 E F0 +(conditional operator)144 571.2 Q F1 2.5(=*)108 583.2 S 2.5(=/)-2.5 G +2.5(=%)-2.5 G 2.5(=+)-2.5 G 2.5<3dad>-2.5 G 2.5(=<)-2.5 G +(<= >>= &= ^= |=)-2.5 E F0(assignment)144 595.2 Q F3 -.2(ex)108 607.2 S +(pr1).2 E F1(,)2.5 E F3 -.2(ex)2.5 G(pr2).2 E F0(comma)144 619.2 Q .68 +(Shell v)108 636 R .68(ariables are allo)-.25 F .68 +(wed as operands; parameter e)-.25 F .68 +(xpansion is performed before the e)-.15 F .68(xpression is e)-.15 F +-.25(va)-.25 G(lu-).25 E 3.507(ated. W)108 648 R 1.007(ithin an e)-.4 F +1.007(xpression, shell v)-.15 F 1.007 +(ariables may also be referenced by name without using the parameter) +-.25 F -.15(ex)108 660 S 1.041(pansion syntax.).15 F 3.541(As)6.041 G +1.041(hell v)-3.541 F 1.041(ariable that is null or unset e)-.25 F -.25 +(va)-.25 G 1.04(luates to 0 when referenced by name without).25 F 1.466 +(using the parameter e)108 672 R 1.466(xpansion syntax.)-.15 F 1.467 +(The v)6.466 F 1.467(alue of a v)-.25 F 1.467(ariable is e)-.25 F -.25 +(va)-.25 G 1.467(luated as an arithmetic e).25 F(xpression)-.15 E 1.39 +(when it is referenced, or when a v)108 684 R 1.389 +(ariable which has been gi)-.25 F -.15(ve)-.25 G 3.889(nt).15 G(he) +-3.889 E F3(inte)3.889 E -.1(ge)-.4 G(r).1 E F0(attrib)3.889 E 1.389 +(ute using)-.2 F F1(declar)3.889 E 3.889(e-)-.18 G(i)-3.889 E F0(is) +3.889 E .332(assigned a v)108 696 R 2.832(alue. A)-.25 F .332(null v) +2.832 F .332(alue e)-.25 F -.25(va)-.25 G .332(luates to 0.).25 F 2.832 +(As)5.332 G .332(hell v)-2.832 F .332(ariable need not ha)-.25 F .632 +-.15(ve i)-.2 H(ts).15 E F3(inte)2.832 E -.1(ge)-.4 G(r).1 E F0(attrib) +2.832 E .333(ute turned on)-.2 F(to be used in an e)108 708 Q +(xpression.)-.15 E 1.406 +(Constants with a leading 0 are interpreted as octal numbers.)108 724.8 +R 3.906(Al)6.406 G 1.406(eading 0x or 0X denotes he)-3.906 F(xadecimal.) +-.15 E(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(29)190.95 E 0 Cg +EP +%%Page: 30 30 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .112(Otherwise, numbers tak)108 84 R 2.612(et)-.1 G .112 +(he form [)-2.612 F/F1 10/Times-Italic@0 SF(base#)A F0 .112 +(]n, where the optional)B F1(base)2.612 E F0 .113 +(is a decimal number between 2 and 64)2.612 F .534 +(representing the arithmetic base, and)108 96 R F1(n)3.034 E F0 .534 +(is a number in that base.)3.034 F(If)5.533 E F1(base#)3.033 E F0 .533 +(is omitted, then base 10 is used.)3.033 F .16(When specifying)108 108 R +F1(n)2.66 E F0 2.66(,t)C .16 +(he digits greater< than 9 are represented by the lo)-2.66 F .16 +(wercase letters, the uppercase letters,)-.25 F .943 +(@, and _, in that order)108 120 R 5.943(.I)-.55 G(f)-5.943 E F1(base) +3.443 E F0 .942(is less than or equal to 36, lo)3.443 F .942 +(wercase and uppercase letters may be used)-.25 F +(interchangeably to represent numbers between 10 and 35.)108 132 Q .234 +(Operators are e)108 148.8 R -.25(va)-.25 G .234 +(luated in order of precedence.).25 F(Sub-e)5.234 E .234 +(xpressions in parentheses are e)-.15 F -.25(va)-.25 G .235 +(luated \214rst and may).25 F -.15(ove)108 160.8 S +(rride the precedence rules abo).15 E -.15(ve)-.15 G(.).15 E/F2 10.95 +/Times-Bold@0 SF(CONDITION)72 177.6 Q(AL EXPRESSIONS)-.219 E F0 .256 +(Conditional e)108 189.6 R .256(xpressions are used by the)-.15 F/F3 10 +/Times-Bold@0 SF([[)2.755 E F0 .255(compound command and the)2.755 F F3 +(test)2.755 E F0(and)2.755 E F3([)2.755 E F0 -.2(bu)2.755 G .255 +(iltin commands to test).2 F .77(\214le attrib)108 201.6 R .77 +(utes and perform string and arithmetic comparisons.)-.2 F .77 +(Expressions are formed from the follo)5.77 F(wing)-.25 E 1.041 +(unary or binary primaries.)108 213.6 R 1.041(If an)6.041 F(y)-.15 E F1 +(\214le)3.541 E F0(ar)3.541 E 1.04 +(gument to one of the primaries is of the form)-.18 F F1(/de)3.54 E +(v/fd/n)-.15 E F0 3.54(,t)C 1.04(hen \214le)-3.54 F(descriptor)108 225.6 +Q F1(n)3.788 E F0 1.289(is check)3.788 F 3.789(ed. If)-.1 F(the)3.789 E +F1(\214le)3.789 E F0(ar)3.789 E 1.289 +(gument to one of the primaries is one of)-.18 F F1(/de)3.789 E(v/stdin) +-.15 E F0(,)A F1(/de)3.789 E(v/stdout)-.15 E F0 3.789(,o)C(r)-3.789 E F1 +(/de)108 237.6 Q(v/stderr)-.15 E F0 2.5<2c8c>C +(le descriptor 0, 1, or 2, respecti)-2.5 E -.15(ve)-.25 G(ly).15 E 2.5 +(,i)-.65 G 2.5(sc)-2.5 G(heck)-2.5 E(ed.)-.1 E .722 +(Unless otherwise speci\214ed, primaries that operate on \214les follo) +108 254.4 R 3.221(ws)-.25 G .721(ymbolic links and operate on the tar) +-3.221 F(get)-.18 E(of the link, rather than the link itself.)108 266.4 +Q 1.095(When used with)108 284.4 R F3([[)3.595 E F0 3.595(,t)C(he)-3.595 +E F3(<)3.595 E F0(and)3.595 E F3(>)3.595 E F0 1.095(operators sort le) +3.595 F 1.095(xicographically using the current locale.)-.15 F(The)6.096 +E F3(test)3.596 E F0(com-)3.596 E(mand sorts using ASCII ordering.)108 +296.4 Q F3108 320.4 Q F1(\214le)2.5 E F0 -.35(Tr)10.58 G(ue if).35 +E F1(\214le)2.5 E F0 -.15(ex)2.5 G(ists.).15 E F3108 332.4 Q F1 +(\214le)2.5 E F0 -.35(Tr)10.02 G(ue if).35 E F1(\214le)2.5 E F0 -.15(ex) +2.5 G(ists and is a block special \214le.).15 E F3108 344.4 Q F1 +(\214le)2.5 E F0 -.35(Tr)11.14 G(ue if).35 E F1(\214le)2.5 E F0 -.15(ex) +2.5 G(ists and is a character special \214le.).15 E F3108 356.4 Q +F1(\214le)2.5 E F0 -.35(Tr)10.02 G(ue if).35 E F1(\214le)2.5 E F0 -.15 +(ex)2.5 G(ists and is a directory).15 E(.)-.65 E F3108 368.4 Q F1 +(\214le)2.5 E F0 -.35(Tr)11.14 G(ue if).35 E F1(\214le)2.5 E F0 -.15(ex) +2.5 G(ists.).15 E F3108 380.4 Q F1(\214le)2.5 E F0 -.35(Tr)12.25 G +(ue if).35 E F1(\214le)2.5 E F0 -.15(ex)2.5 G(ists and is a re).15 E +(gular \214le.)-.15 E F3108 392.4 Q F1(\214le)2.5 E F0 -.35(Tr) +10.58 G(ue if).35 E F1(\214le)2.5 E F0 -.15(ex)2.5 G +(ists and is set-group-id.).15 E F3108 404.4 Q F1(\214le)2.5 E F0 +-.35(Tr)10.02 G(ue if).35 E F1(\214le)2.5 E F0 -.15(ex)2.5 G +(ists and is a symbolic link.).15 E F3108 416.4 Q F1(\214le)2.5 E +F0 -.35(Tr)10.02 G(ue if).35 E F1(\214le)2.5 E F0 -.15(ex)2.5 G +(ists and its `).15 E(`stick)-.74 E(y')-.15 E 2.5('b)-.74 G(it is set.) +-2.5 E F3108 428.4 Q F1(\214le)2.5 E F0 -.35(Tr)10.02 G(ue if).35 +E F1(\214le)2.5 E F0 -.15(ex)2.5 G(ists and is a named pipe \(FIFO\).) +.15 E F3108 440.4 Q F1(\214le)2.5 E F0 -.35(Tr)11.14 G(ue if).35 E +F1(\214le)2.5 E F0 -.15(ex)2.5 G(ists and is readable.).15 E F3108 +452.4 Q F1(\214le)2.5 E F0 -.35(Tr)11.69 G(ue if).35 E F1(\214le)2.5 E +F0 -.15(ex)2.5 G(ists and has a size greater than zero.).15 E F3 +108 464.4 Q F1(fd)2.5 E F0 -.35(Tr)16.69 G(ue if \214le descriptor).35 E +F1(fd)4.47 E F0(is open and refers to a terminal.)3.27 E F3108 +476.4 Q F1(\214le)2.5 E F0 -.35(Tr)10.02 G(ue if).35 E F1(\214le)2.5 E +F0 -.15(ex)2.5 G(ists and its set-user).15 E(-id bit is set.)-.2 E F3 +108 488.4 Q F1(\214le)2.5 E F0 -.35(Tr)8.36 G(ue if).35 E F1 +(\214le)2.5 E F0 -.15(ex)2.5 G(ists and is writable.).15 E F3108 +500.4 Q F1(\214le)2.5 E F0 -.35(Tr)10.58 G(ue if).35 E F1(\214le)2.5 E +F0 -.15(ex)2.5 G(ists and is e).15 E -.15(xe)-.15 G(cutable.).15 E F3 +108 512.4 Q F1(\214le)2.5 E F0 -.35(Tr)7.8 G(ue if).35 E F1 +(\214le)2.5 E F0 -.15(ex)2.5 G(ists and is o).15 E(wned by the ef)-.25 E +(fecti)-.25 E .3 -.15(ve g)-.25 H(roup id.).15 E F3108 524.4 Q F1 +(\214le)2.5 E F0 -.35(Tr)8.91 G(ue if).35 E F1(\214le)2.5 E F0 -.15(ex) +2.5 G(ists and is a symbolic link.).15 E F3108 536.4 Q F1(\214le) +2.5 E F0 -.35(Tr)8.36 G(ue if).35 E F1(\214le)2.5 E F0 -.15(ex)2.5 G +(ists and has been modi\214ed since it w).15 E(as last read.)-.1 E F3 +108 548.4 Q F1(\214le)2.5 E F0 -.35(Tr)7.8 G(ue if).35 E F1 +(\214le)2.5 E F0 -.15(ex)2.5 G(ists and is o).15 E(wned by the ef)-.25 E +(fecti)-.25 E .3 -.15(ve u)-.25 H(ser id.).15 E F3108 560.4 Q F1 +(\214le)2.5 E F0 -.35(Tr)10.02 G(ue if).35 E F1(\214le)2.5 E F0 -.15(ex) +2.5 G(ists and is a sock).15 E(et.)-.1 E F1(\214le1)108 572.4 Q F3 +(\255ef)2.5 E F1(\214le2)2.5 E F0 -.35(Tr)144 584.4 S(ue if).35 E F1 +(\214le1)2.5 E F0(and)2.5 E F1(\214le2)2.5 E F0(refer to the same de)2.5 +E(vice and inode numbers.)-.25 E F1(\214le1)108 596.4 Q F02.5 E F3 +(nt)A F1(\214le2)2.5 E F0 -.35(Tr)144 608.4 S .039(ue if).35 F F1 +(\214le1)2.539 E F0 .039(is ne)2.539 F .039 +(wer \(according to modi\214cation date\) than)-.25 F F1(\214le2)2.539 E +F0 2.539(,o)C 2.539(ri)-2.539 G(f)-2.539 E F1(\214le1)2.539 E F0 -.15 +(ex)2.539 G .039(ists and).15 F F1(\214le2)2.539 E F0 .038(does not.) +2.538 F F1(\214le1)108 620.4 Q F02.5 E F3(ot)A F1(\214le2)2.5 E F0 +-.35(Tr)144 632.4 S(ue if).35 E F1(\214le1)2.5 E F0(is older than)2.5 E +F1(\214le2)2.5 E F0 2.5(,o)C 2.5(ri)-2.5 G(f)-2.5 E F1(\214le2)2.5 E F0 +-.15(ex)2.5 G(ists and).15 E F1(\214le1)2.5 E F0(does not.)2.5 E F3 +108 644.4 Q F1(optname)2.5 E F0 -.35(Tr)144 656.4 S .262 +(ue if the shell option).35 F F1(optname)2.992 E F0 .262(is enabled.) +2.942 F .262(See the list of options under the description of the)5.262 +F F32.763 E F0(option to the)144 668.4 Q F3(set)2.5 E F0 -.2(bu) +2.5 G(iltin belo).2 E -.65(w.)-.25 G F3108 680.4 Q F1(varname)2.5 +E F0 -.35(Tr)144 692.4 S(ue if the shell v).35 E(ariable)-.25 E F1 +(varname)2.79 E F0(is set \(has been assigned a v)2.68 E(alue\).)-.25 E +F3108 704.4 Q F1(varname)2.5 E F0 -.35(Tr)144 716.4 S +(ue if the shell v).35 E(ariable)-.25 E F1(varname)2.79 E F0 +(is set and is a name reference.)2.68 E(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(30)190.95 E 0 Cg EP +%%Page: 31 31 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF108 84 Q/F2 10/Times-Italic@0 SF +(string)2.5 E F0 -.35(Tr)144 96 S(ue if the length of).35 E F2(string) +2.5 E F0(is zero.)2.5 E F2(string)108 108 Q F1108 120 Q F2(string) +2.5 E F0 -.35(Tr)144 132 S(ue if the length of).35 E F2(string)2.84 E F0 +(is non-zero.)2.72 E F2(string1)108 148.8 Q F1(==)2.5 E F2(string2)2.5 E +(string1)108 160.8 Q F1(=)2.5 E F2(string2)2.5 E F0 -.35(Tr)144 172.8 S +.862(ue if the strings are equal.).35 F F1(=)5.861 E F0 .861 +(should be used with the)3.361 F F1(test)3.361 E F0 .861 +(command for POSIX conformance.)3.361 F .446(When used with the)144 +184.8 R F1([[)2.946 E F0 .446 +(command, this performs pattern matching as described abo)2.946 F .747 +-.15(ve \()-.15 H F1(Compound).15 E(Commands)144 196.8 Q F0(\).)A F2 +(string1)108 213.6 Q F1(!=)2.5 E F2(string2)2.5 E F0 -.35(Tr)144 225.6 S +(ue if the strings are not equal.).35 E F2(string1)108 242.4 Q F1(<)2.5 +E F2(string2)2.5 E F0 -.35(Tr)144 254.4 S(ue if).35 E F2(string1)2.5 E +F0(sorts before)2.5 E F2(string2)2.5 E F0(le)2.5 E(xicographically)-.15 +E(.)-.65 E F2(string1)108 271.2 Q F1(>)2.5 E F2(string2)2.5 E F0 -.35 +(Tr)144 283.2 S(ue if).35 E F2(string1)2.5 E F0(sorts after)2.5 E F2 +(string2)2.5 E F0(le)2.5 E(xicographically)-.15 E(.)-.65 E F2(ar)108.33 +300 Q(g1)-.37 E F1(OP)2.5 E F2(ar)2.5 E(g2)-.37 E/F3 9/Times-Bold@0 SF +(OP)144 312 Q F0 .385(is one of)2.635 F F1(\255eq)2.885 E F0(,)A F1 +(\255ne)2.885 E F0(,)A F1(\255lt)2.885 E F0(,)A F1(\255le)2.885 E F0(,)A +F1(\255gt)2.885 E F0 2.885(,o)C(r)-2.885 E F1(\255ge)2.885 E F0 5.385 +(.T)C .385(hese arithmetic binary operators return true if)-5.385 F F2 +(ar)2.884 E(g1)-.37 E F0 .845(is equal to, not equal to, less than, les\ +s than or equal to, greater than, or greater than or equal to)144 324 R +F2(ar)144 336 Q(g2)-.37 E F0 2.5(,r)C(especti)-2.5 E -.15(ve)-.25 G(ly) +.15 E(.)-.65 E F2(Ar)6.01 E(g1)-.37 E F0(and)2.5 E F2(ar)2.83 E(g2)-.37 +E F0(may be positi)2.52 E .3 -.15(ve o)-.25 H 2.5(rn).15 G -2.25 -.15 +(eg a)-2.5 H(ti).15 E .3 -.15(ve i)-.25 H(nte).15 E(gers.)-.15 E/F4 +10.95/Times-Bold@0 SF(SIMPLE COMMAND EXP)72 352.8 Q(ANSION)-.81 E F0 +.614(When a simple command is e)108 364.8 R -.15(xe)-.15 G .614 +(cuted, the shell performs the follo).15 F .613(wing e)-.25 F .613 +(xpansions, assignments, and redi-)-.15 F(rections, from left to right.) +108 376.8 Q 26(1. The)108 393.6 R -.1(wo)4.348 G 1.848 +(rds that the parser has mark).1 F 1.848(ed as v)-.1 F 1.849 +(ariable assignments \(those preceding the command)-.25 F +(name\) and redirections are sa)144 405.6 Q -.15(ve)-.2 G 2.5(df).15 G +(or later processing.)-2.5 E 26(2. The)108 422.4 R -.1(wo)3.664 G 1.164 +(rds that are not v).1 F 1.164 +(ariable assignments or redirections are e)-.25 F 3.663(xpanded. If)-.15 +F(an)3.663 E 3.663(yw)-.15 G 1.163(ords remain)-3.763 F .775(after e)144 +434.4 R .775(xpansion, the \214rst w)-.15 F .775(ord is tak)-.1 F .775 +(en to be the name of the command and the remaining w)-.1 F(ords)-.1 E +(are the ar)144 446.4 Q(guments.)-.18 E 26(3. Redirections)108 463.2 R +(are performed as described abo)2.5 E .3 -.15(ve u)-.15 H(nder).15 E F3 +(REDIRECTION)2.5 E/F5 9/Times-Roman@0 SF(.)A F0 26(4. The)108 480 R(te) +3.217 E .717(xt after the)-.15 F F1(=)3.217 E F0 .717(in each v)3.217 F +.717(ariable assignment under)-.25 F .717(goes tilde e)-.18 F .717 +(xpansion, parameter e)-.15 F(xpansion,)-.15 E .339 +(command substitution, arithmetic e)144 492 R .339 +(xpansion, and quote remo)-.15 F -.25(va)-.15 G 2.839(lb).25 G .339 +(efore being assigned to the v)-2.839 F(ari-)-.25 E(able.)144 504 Q .332 +(If no command name results, the v)108 520.8 R .332 +(ariable assignments af)-.25 F .332(fect the current shell en)-.25 F +2.832(vironment. Otherwise,)-.4 F(the)2.832 E -.25(va)108 532.8 S .757 +(riables are added to the en).25 F .757(vironment of the e)-.4 F -.15 +(xe)-.15 G .757(cuted command and do not af).15 F .757 +(fect the current shell en)-.25 F(vi-)-.4 E 3.177(ronment. If)108 544.8 +R(an)3.177 E 3.177(yo)-.15 G 3.177(ft)-3.177 G .677 +(he assignments attempts to assign a v)-3.177 F .677 +(alue to a readonly v)-.25 F .676(ariable, an error occurs, and)-.25 F +(the command e)108 556.8 Q(xits with a non-zero status.)-.15 E .149 +(If no command name results, redirections are performed, b)108 573.6 R +.149(ut do not af)-.2 F .15(fect the current shell en)-.25 F 2.65 +(vironment. A)-.4 F(redirection error causes the command to e)108 585.6 +Q(xit with a non-zero status.)-.15 E 1.064 +(If there is a command name left after e)108 602.4 R 1.064(xpansion, e) +-.15 F -.15(xe)-.15 G 1.064(cution proceeds as described belo).15 F +4.864 -.65(w. O)-.25 H 1.064(therwise, the).65 F .068(command e)108 +614.4 R 2.568(xits. If)-.15 F .069(one of the e)2.568 F .069 +(xpansions contained a command substitution, the e)-.15 F .069 +(xit status of the command)-.15 F .467(is the e)108 626.4 R .466 +(xit status of the last command substitution performed.)-.15 F .466 +(If there were no command substitutions, the)5.466 F(command e)108 638.4 +Q(xits with a status of zero.)-.15 E F4(COMMAND EXECUTION)72 655.2 Q F0 +.546(After a command has been split into w)108 667.2 R .547 +(ords, if it results in a simple command and an optional list of ar)-.1 +F(gu-)-.18 E(ments, the follo)108 679.2 Q(wing actions are tak)-.25 E +(en.)-.1 E .379(If the command name contains no slashes, the shell atte\ +mpts to locate it.)108 696 R .379(If there e)5.379 F .379 +(xists a shell function by)-.15 F .246(that name, that function is in) +108 708 R -.2(vo)-.4 G -.1(ke).2 G 2.746(da).1 G 2.746(sd)-2.746 G .246 +(escribed abo)-2.746 F .546 -.15(ve i)-.15 H(n).15 E F3(FUNCTIONS)2.746 +E F5(.)A F0 .246(If the name does not match a func-)4.746 F +(tion, the shell searches for it in the list of shell b)108 720 Q 2.5 +(uiltins. If)-.2 F 2.5(am)2.5 G(atch is found, that b)-2.5 E +(uiltin is in)-.2 E -.2(vo)-.4 G -.1(ke).2 G(d.).1 E(GNU Bash 4.3)72 768 +Q(2014 February 2)141.79 E(31)190.95 E 0 Cg EP +%%Page: 32 32 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .31(If the name is neither a shell function nor a b)108 84 R .309 +(uiltin, and contains no slashes,)-.2 F/F1 10/Times-Bold@0 SF(bash)2.809 +E F0 .309(searches each element of)2.809 F(the)108 96 Q/F2 9 +/Times-Bold@0 SF -.666(PA)3.162 G(TH)-.189 E F0 .662 +(for a directory containing an e)2.912 F -.15(xe)-.15 G .662 +(cutable \214le by that name.).15 F F1(Bash)5.662 E F0 .663 +(uses a hash table to remember)3.162 F 1.915(the full pathnames of e)108 +108 R -.15(xe)-.15 G 1.915(cutable \214les \(see).15 F F1(hash)4.415 E +F0(under)4.415 E F2 1.915(SHELL B)4.415 F(UIL)-.09 E 1.914(TIN COMMANDS) +-.828 F F0(belo)4.164 E 4.414(w\). A)-.25 F(full)4.414 E .719 +(search of the directories in)108 120 R F2 -.666(PA)3.219 G(TH)-.189 E +F0 .72(is performed only if the command is not found in the hash table.) +2.969 F .72(If the)5.72 F .956(search is unsuccessful, the shell search\ +es for a de\214ned shell function named)108 132 R F1(command_not_f)3.455 +E(ound_han-)-.25 E(dle)108 144 Q F0 5.277(.I)C 2.777(ft)-5.277 G .277 +(hat function e)-2.777 F .277(xists, it is in)-.15 F -.2(vo)-.4 G -.1 +(ke).2 G 2.777(dw).1 G .278 +(ith the original command and the original command')-2.777 F 2.778(sa) +-.55 G -.18(rg)-2.778 G(uments).18 E .776(as its ar)108 156 R .776 +(guments, and the function')-.18 F 3.275(se)-.55 G .775 +(xit status becomes the e)-3.425 F .775(xit status of the shell.)-.15 F +.775(If that function is not)5.775 F +(de\214ned, the shell prints an error message and returns an e)108 168 Q +(xit status of 127.)-.15 E 1.089(If the search is successful, or if the\ + command name contains one or more slashes, the shell e)108 184.8 R -.15 +(xe)-.15 G 1.09(cutes the).15 F .198(named program in a separate e)108 +196.8 R -.15(xe)-.15 G .198(cution en).15 F 2.698(vironment. Ar)-.4 F +.198(gument 0 is set to the name gi)-.18 F -.15(ve)-.25 G .197 +(n, and the remain-).15 F(ing ar)108 208.8 Q +(guments to the command are set to the ar)-.18 E(guments gi)-.18 E -.15 +(ve)-.25 G(n, if an).15 E -.65(y.)-.15 G 1.809(If this e)108 225.6 R +-.15(xe)-.15 G 1.809(cution f).15 F 1.809 +(ails because the \214le is not in e)-.1 F -.15(xe)-.15 G 1.809 +(cutable format, and the \214le is not a directory).15 F 4.309(,i)-.65 G +4.309(ti)-4.309 G(s)-4.309 E .678(assumed to be a)108 237.6 R/F3 10 +/Times-Italic@0 SF .678(shell script)3.178 F F0 3.178(,a\214)C .678 +(le containing shell commands.)-3.178 F 3.178(As)5.678 G .678 +(ubshell is spa)-3.178 F .677(wned to e)-.15 F -.15(xe)-.15 G .677 +(cute it.).15 F(This)5.677 E .329 +(subshell reinitializes itself, so that the ef)108 249.6 R .329 +(fect is as if a ne)-.25 F 2.83(ws)-.25 G .33(hell had been in)-2.83 F +-.2(vo)-.4 G -.1(ke).2 G 2.83(dt).1 G 2.83(oh)-2.83 G .33 +(andle the script, with)-2.83 F 1.219(the e)108 261.6 R 1.219 +(xception that the locations of commands remembered by the parent \(see) +-.15 F F1(hash)3.719 E F0(belo)3.719 E 3.719(wu)-.25 G(nder)-3.719 E F2 +(SHELL)3.719 E -.09(BU)108 273.6 S(IL).09 E(TIN COMMANDS)-.828 E/F4 9 +/Times-Roman@0 SF(\))A F0(are retained by the child.)2.25 E .347 +(If the program is a \214le be)108 290.4 R .347(ginning with)-.15 F F1 +(#!)2.847 E F0 2.847(,t)C .348(he remainder of the \214rst line speci\ +\214es an interpreter for the pro-)-2.847 F 3.178(gram. The)108 302.4 R +.678(shell e)3.178 F -.15(xe)-.15 G .678(cutes the speci\214ed interpre\ +ter on operating systems that do not handle this e).15 F -.15(xe)-.15 G +(cutable).15 E 1.192(format themselv)108 314.4 R 3.692(es. The)-.15 F +(ar)3.693 E 1.193 +(guments to the interpreter consist of a single optional ar)-.18 F 1.193 +(gument follo)-.18 F 1.193(wing the)-.25 F 1.131 +(interpreter name on the \214rst line of the program, follo)108 326.4 R +1.13(wed by the name of the program, follo)-.25 F 1.13(wed by the)-.25 F +(command ar)108 338.4 Q(guments, if an)-.18 E -.65(y.)-.15 G/F5 10.95 +/Times-Bold@0 SF(COMMAND EXECUTION ENVIR)72 355.2 Q(ONMENT)-.329 E F0 +(The shell has an)108 367.2 Q F3 -.2(ex)2.5 G(ecution en).2 E(vir)-.4 E +(onment)-.45 E F0 2.5(,w)C(hich consists of the follo)-2.5 E(wing:)-.25 +E 32.5<836f>108 384 S 1.405(pen \214les inherited by the shell at in) +-32.5 F -.2(vo)-.4 G 1.406 +(cation, as modi\214ed by redirections supplied to the).2 F F1(exec) +3.906 E F0 -.2(bu)144 396 S(iltin).2 E 32.5<8374>108 412.8 S +(he current w)-32.5 E(orking directory as set by)-.1 E F1(cd)2.5 E F0(,) +A F1(pushd)2.5 E F0 2.5(,o)C(r)-2.5 E F1(popd)2.5 E F0 2.5(,o)C 2.5(ri) +-2.5 G(nherited by the shell at in)-2.5 E -.2(vo)-.4 G(cation).2 E 32.5 +<8374>108 429.6 S(he \214le creation mode mask as set by)-32.5 E F1 +(umask)2.5 E F0(or inherited from the shell')2.5 E 2.5(sp)-.55 G(arent) +-2.5 E 32.5<8363>108 446.4 S(urrent traps set by)-32.5 E F1(trap)2.5 E +F0 32.5<8373>108 463.2 S .257(hell parameters that are set by v)-32.5 F +.256(ariable assignment or with)-.25 F F1(set)2.756 E F0 .256 +(or inherited from the shell')2.756 F 2.756(sp)-.55 G(arent)-2.756 E +(in the en)144 475.2 Q(vironment)-.4 E 32.5<8373>108 492 S +(hell functions de\214ned during e)-32.5 E -.15(xe)-.15 G +(cution or inherited from the shell').15 E 2.5(sp)-.55 G +(arent in the en)-2.5 E(vironment)-.4 E 32.5<836f>108 508.8 S +(ptions enabled at in)-32.5 E -.2(vo)-.4 G(cation \(either by def).2 E +(ault or with command-line ar)-.1 E(guments\) or by)-.18 E F1(set)2.5 E +F0 32.5<836f>108 525.6 S(ptions enabled by)-32.5 E F1(shopt)2.5 E F0 +32.5<8373>108 542.4 S(hell aliases de\214ned with)-32.5 E F1(alias)2.5 E +F0 32.5<8376>108 559.2 S +(arious process IDs, including those of background jobs, the v)-32.75 E +(alue of)-.25 E F1($$)2.5 E F0 2.5(,a)C(nd the v)-2.5 E(alue of)-.25 E +F2(PPID)2.5 E F0 .426(When a simple command other than a b)108 576 R +.427(uiltin or shell function is to be e)-.2 F -.15(xe)-.15 G .427 +(cuted, it is in).15 F -.2(vo)-.4 G -.1(ke).2 G 2.927(di).1 G 2.927(nas) +-2.927 G(eparate)-2.927 E -.15(exe)108 588 S .134(cution en).15 F .134 +(vironment that consists of the follo)-.4 F 2.634(wing. Unless)-.25 F +.133(otherwise noted, the v)2.634 F .133(alues are inherited from)-.25 F +(the shell.)108 600 Q 32.5<8374>108 616.8 S 1.055(he shell')-32.5 F +3.555(so)-.55 G 1.055(pen \214les, plus an)-3.555 F 3.556(ym)-.15 G +1.056 +(odi\214cations and additions speci\214ed by redirections to the com-) +-3.556 F(mand)144 628.8 Q 32.5<8374>108 645.6 S(he current w)-32.5 E +(orking directory)-.1 E 32.5<8374>108 662.4 S +(he \214le creation mode mask)-32.5 E 32.5<8373>108 679.2 S .857(hell v) +-32.5 F .857(ariables and functions mark)-.25 F .857(ed for e)-.1 F .857 +(xport, along with v)-.15 F .857(ariables e)-.25 F .857 +(xported for the command,)-.15 F(passed in the en)144 691.2 Q(vironment) +-.4 E 32.5<8374>108 708 S .306 +(raps caught by the shell are reset to the v)-32.5 F .307 +(alues inherited from the shell')-.25 F 2.807(sp)-.55 G .307 +(arent, and traps ignored)-2.807 F(by the shell are ignored)144 720 Q +(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(32)190.95 E 0 Cg EP +%%Page: 33 33 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E 2.5(Ac)108 84 S(ommand in)-2.5 E -.2(vo)-.4 G -.1(ke).2 G 2.5(di) +.1 G 2.5(nt)-2.5 G(his separate en)-2.5 E(vironment cannot af)-.4 E +(fect the shell')-.25 E 2.5(se)-.55 G -.15(xe)-2.65 G(cution en).15 E +(vironment.)-.4 E .577(Command substitution, commands grouped with pare\ +ntheses, and asynchronous commands are in)108 100.8 R -.2(vo)-.4 G -.1 +(ke).2 G 3.077(di).1 G(n)-3.077 E 2.744(as)108 112.8 S .244(ubshell en) +-2.744 F .244(vironment that is a duplicate of the shell en)-.4 F .245 +(vironment, e)-.4 F .245(xcept that traps caught by the shell are)-.15 F +.359(reset to the v)108 124.8 R .358 +(alues that the shell inherited from its parent at in)-.25 F -.2(vo)-.4 +G 2.858(cation. Builtin).2 F .358(commands that are in)2.858 F -.2(vo) +-.4 G -.1(ke).2 G(d).1 E .856(as part of a pipeline are also e)108 136.8 +R -.15(xe)-.15 G .856(cuted in a subshell en).15 F 3.357 +(vironment. Changes)-.4 F .857(made to the subshell en)3.357 F(viron-) +-.4 E(ment cannot af)108 148.8 Q(fect the shell')-.25 E 2.5(se)-.55 G +-.15(xe)-2.65 G(cution en).15 E(vironment.)-.4 E 1.377(Subshells spa)108 +165.6 R 1.377(wned to e)-.15 F -.15(xe)-.15 G 1.377 +(cute command substitutions inherit the v).15 F 1.377(alue of the)-.25 F +/F1 10/Times-Bold@0 SF3.876 E F0 1.376(option from the parent) +3.876 F 2.5(shell. When)108 177.6 R(not in)2.5 E/F2 10/Times-Italic@0 SF +(posix)2.5 E F0(mode,)2.5 E F1(bash)2.5 E F0(clears the)2.5 E F1 +2.5 E F0(option in such subshells.)2.5 E .404(If a command is follo)108 +194.4 R .404(wed by a)-.25 F F1(&)2.904 E F0 .405 +(and job control is not acti)2.904 F -.15(ve)-.25 G 2.905(,t).15 G .405 +(he def)-2.905 F .405(ault standard input for the command)-.1 F .198 +(is the empty \214le)108 206.4 R F2(/de)2.698 E(v/null)-.15 E F0 5.198 +(.O)C .198(therwise, the in)-5.198 F -.2(vo)-.4 G -.1(ke).2 G 2.698(dc) +.1 G .197(ommand inherits the \214le descriptors of the calling shell) +-2.698 F(as modi\214ed by redirections.)108 218.4 Q/F3 10.95 +/Times-Bold@0 SF(ENVIR)72 235.2 Q(ONMENT)-.329 E F0 2.353 +(When a program is in)108 247.2 R -.2(vo)-.4 G -.1(ke).2 G 4.853(di).1 G +4.853(ti)-4.853 G 4.853(sg)-4.853 G -2.15 -.25(iv e)-4.853 H 4.853(na) +.25 G 4.853(na)-4.853 G 2.353(rray of strings called the)-4.853 F F2(en) +4.853 E(vir)-.4 E(onment)-.45 E F0 7.353(.T).68 G 2.354 +(his is a list of)-7.353 F F2(name)108 259.2 Q F0A F2(value)A F0 +(pairs, of the form)2.5 E F2(name)2.5 E F0(=)A F2(value)A F0(.).18 E +1.486(The shell pro)108 276 R 1.486(vides se)-.15 F -.15(ve)-.25 G 1.486 +(ral w).15 F 1.485(ays to manipulate the en)-.1 F 3.985(vironment. On) +-.4 F(in)3.985 E -.2(vo)-.4 G 1.485(cation, the shell scans its o).2 F +(wn)-.25 E(en)108 288 Q .144(vironment and creates a parameter for each\ + name found, automatically marking it for)-.4 F F2 -.2(ex)2.644 G(port) +.2 E F0 .144(to child pro-)3.324 F 2.704(cesses. Ex)108 300 R .203 +(ecuted commands inherit the en)-.15 F 2.703(vironment. The)-.4 F F1 +(export)2.703 E F0(and)2.703 E F1(declar)2.703 E 2.703<65ad>-.18 G(x) +-2.703 E F0 .203(commands allo)2.703 F 2.703(wp)-.25 G(aram-)-2.703 E +1.153(eters and functions to be added to and deleted from the en)108 312 +R 3.653(vironment. If)-.4 F 1.153(the v)3.653 F 1.154 +(alue of a parameter in the)-.25 F(en)108 324 Q .64 +(vironment is modi\214ed, the ne)-.4 F 3.14(wv)-.25 G .64 +(alue becomes part of the en)-3.39 F .64(vironment, replacing the old.) +-.4 F .64(The en)5.64 F(viron-)-.4 E .58(ment inherited by an)108 336 R +3.08(ye)-.15 G -.15(xe)-3.23 G .58(cuted command consists of the shell') +.15 F 3.08(si)-.55 G .58(nitial en)-3.08 F .58(vironment, whose v)-.4 F +.58(alues may be)-.25 F .301(modi\214ed in the shell, less an)108 348 R +2.801(yp)-.15 G .301(airs remo)-2.801 F -.15(ve)-.15 G 2.801(db).15 G +2.801(yt)-2.801 G(he)-2.801 E F1(unset)2.801 E F0 .3(command, plus an) +2.8 F 2.8(ya)-.15 G .3(dditions via the)-2.8 F F1(export)2.8 E F0(and) +2.8 E F1(declar)108 360 Q 2.5<65ad>-.18 G(x)-2.5 E F0(commands.)2.5 E +.562(The en)108 376.8 R .562(vironment for an)-.4 F(y)-.15 E F2 .562 +(simple command)3.402 F F0 .563 +(or function may be augmented temporarily by pre\214xing it with)3.833 F +.203(parameter assignments, as described abo)108 388.8 R .502 -.15(ve i) +-.15 H(n).15 E/F4 9/Times-Bold@0 SF -.666(PA)2.702 G(RAMETERS).666 E/F5 +9/Times-Roman@0 SF(.)A F0 .202(These assignment statements af)4.702 F +.202(fect only the)-.25 F(en)108 400.8 Q +(vironment seen by that command.)-.4 E .81(If the)108 417.6 R F1 +3.31 E F0 .81(option is set \(see the)3.31 F F1(set)3.31 E F0 -.2(bu) +3.31 G .81(iltin command belo).2 F .81(w\), then)-.25 F F2(all)3.64 E F0 +.81(parameter assignments are placed in)3.82 F(the en)108 429.6 Q +(vironment for a command, not just those that precede the command name.) +-.4 E(When)108 446.4 Q F1(bash)3.586 E F0(in)3.586 E -.2(vo)-.4 G -.1 +(ke).2 G 3.586(sa).1 G 3.586(ne)-3.586 G 1.086(xternal command, the v) +-3.736 F(ariable)-.25 E F1(_)3.586 E F0 1.085 +(is set to the full \214lename of the command and)3.586 F +(passed to that command in its en)108 458.4 Q(vironment.)-.4 E F3 +(EXIT ST)72 475.2 Q -1.04(AT)-.986 G(US)1.04 E F0 .15(The e)108 487.2 R +.15(xit status of an e)-.15 F -.15(xe)-.15 G .15(cuted command is the v) +.15 F .151(alue returned by the)-.25 F F2(waitpid)2.651 E F0 .151 +(system call or equi)2.651 F -.25(va)-.25 G .151(lent func-).25 F 2.848 +(tion. Exit)108 499.2 R .348(statuses f)2.848 F .347 +(all between 0 and 255, though, as e)-.1 F .347(xplained belo)-.15 F +1.647 -.65(w, t)-.25 H .347(he shell may use v).65 F .347(alues abo)-.25 +F .647 -.15(ve 1)-.15 H(25).15 E(specially)108 511.2 Q 5.673(.E)-.65 G +.673(xit statuses from shell b)-5.673 F .673 +(uiltins and compound commands are also limited to this range. Under)-.2 +F(certain circumstances, the shell will use special v)108 523.2 Q +(alues to indicate speci\214c f)-.25 E(ailure modes.)-.1 E -.15(Fo)108 +540 S 3.373(rt).15 G .873(he shell')-3.373 F 3.373(sp)-.55 G .873 +(urposes, a command which e)-3.373 F .873(xits with a zero e)-.15 F .873 +(xit status has succeeded.)-.15 F .872(An e)5.872 F .872(xit status of) +-.15 F .048(zero indicates success.)108 552 R 2.548(An)5.048 G .049 +(on-zero e)-2.548 F .049(xit status indicates f)-.15 F 2.549 +(ailure. When)-.1 F 2.549(ac)2.549 G .049(ommand terminates on a f) +-2.549 F .049(atal sig-)-.1 F(nal)108 564 Q F2(N)2.5 E F0(,)A F1(bash) +2.5 E F0(uses the v)2.5 E(alue of 128+)-.25 E F2(N)A F0(as the e)2.5 E +(xit status.)-.15 E .405 +(If a command is not found, the child process created to e)108 580.8 R +-.15(xe)-.15 G .404(cute it returns a status of 127.).15 F .404 +(If a command is)5.404 F(found b)108 592.8 Q(ut is not e)-.2 E -.15(xe) +-.15 G(cutable, the return status is 126.).15 E(If a command f)108 609.6 +Q(ails because of an error during e)-.1 E +(xpansion or redirection, the e)-.15 E(xit status is greater than zero.) +-.15 E .08(Shell b)108 626.4 R .08 +(uiltin commands return a status of 0 \()-.2 F F2(true)A F0 2.581(\)i)C +2.581(fs)-2.581 G .081(uccessful, and non-zero \()-2.581 F F2(false)A F0 +2.581(\)i)C 2.581(fa)-2.581 G 2.581(ne)-2.581 G .081(rror occurs while) +-2.581 F(the)108 638.4 Q 2.5(ye)-.15 G -.15(xe)-2.65 G 2.5(cute. All).15 +F -.2(bu)2.5 G(iltins return an e).2 E +(xit status of 2 to indicate incorrect usage.)-.15 E F1(Bash)108 655.2 Q +F0 .202(itself returns the e)2.702 F .202 +(xit status of the last command e)-.15 F -.15(xe)-.15 G .201 +(cuted, unless a syntax error occurs, in which case).15 F(it e)108 667.2 +Q(xits with a non-zero v)-.15 E 2.5(alue. See)-.25 F(also the)2.5 E F1 +(exit)2.5 E F0 -.2(bu)2.5 G(iltin command belo).2 E -.65(w.)-.25 G F3 +(SIGN)72 684 Q(ALS)-.219 E F0(When)108 696 Q F1(bash)3.182 E F0 .682 +(is interacti)3.182 F -.15(ve)-.25 G 3.182(,i).15 G 3.182(nt)-3.182 G +.682(he absence of an)-3.182 F 3.183(yt)-.15 G .683(raps, it ignores) +-3.183 F F4(SIGTERM)3.183 E F0 .683(\(so that)2.933 F F1 .683(kill 0) +3.183 F F0 .683(does not kill an)3.183 F(interacti)108 708 Q .758 -.15 +(ve s)-.25 H .458(hell\), and).15 F F4(SIGINT)2.958 E F0 .458 +(is caught and handled \(so that the)2.708 F F1(wait)2.958 E F0 -.2(bu) +2.958 G .457(iltin is interruptible\).).2 F .457(In all cases,)5.457 F +F1(bash)108 720 Q F0(ignores)2.5 E F4(SIGQ)2.5 E(UIT)-.09 E F5(.)A F0 +(If job control is in ef)4.5 E(fect,)-.25 E F1(bash)2.5 E F0(ignores)2.5 +E F4(SIGTTIN)2.5 E F5(,)A F4(SIGTT)2.25 E(OU)-.162 E F5(,)A F0(and)2.25 +E F4(SIGTSTP)2.5 E F5(.)A F0(GNU Bash 4.3)72 768 Q(2014 February 2) +141.79 E(33)190.95 E 0 Cg EP +%%Page: 34 34 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(Non-b)108 84 Q 1.064(uiltin commands run by)-.2 F/F1 10 +/Times-Bold@0 SF(bash)3.564 E F0(ha)3.564 E 1.365 -.15(ve s)-.2 H 1.065 +(ignal handlers set to the v).15 F 1.065 +(alues inherited by the shell from its)-.25 F 3.248(parent. When)108 96 +R .748(job control is not in ef)3.248 F .747 +(fect, asynchronous commands ignore)-.25 F/F2 9/Times-Bold@0 SF(SIGINT) +3.247 E F0(and)2.997 E F2(SIGQ)3.247 E(UIT)-.09 E F0 .747(in addi-)2.997 +F .652(tion to these inherited handlers.)108 108 R .653 +(Commands run as a result of command substitution ignore the k)5.652 F +-.15(ey)-.1 G(board-).15 E(generated job control signals)108 120 Q F2 +(SIGTTIN)2.5 E/F3 9/Times-Roman@0 SF(,)A F2(SIGTT)2.25 E(OU)-.162 E F3 +(,)A F0(and)2.25 E F2(SIGTSTP)2.5 E F3(.)A F0 2.046(The shell e)108 +136.8 R 2.046(xits by def)-.15 F 2.045(ault upon receipt of a)-.1 F F2 +(SIGHUP)4.545 E F3(.)A F0 2.045(Before e)6.545 F 2.045 +(xiting, an interacti)-.15 F 2.345 -.15(ve s)-.25 H 2.045 +(hell resends the).15 F F2(SIGHUP)108 148.8 Q F0 1.004 +(to all jobs, running or stopped.)3.254 F 1.004(Stopped jobs are sent) +6.004 F F2(SIGCONT)3.505 E F0 1.005(to ensure that the)3.255 F 3.505(yr) +-.15 G(ecei)-3.505 E 1.305 -.15(ve t)-.25 H(he).15 E F2(SIGHUP)108 160.8 +Q F3(.)A F0 2.53 -.8(To p)5.43 H(re).8 E -.15(ve)-.25 G .93(nt the shel\ +l from sending the signal to a particular job, it should be remo).15 F +-.15(ve)-.15 G 3.429(df).15 G .929(rom the)-3.429 F 1.356 +(jobs table with the)108 172.8 R F1(diso)3.856 E(wn)-.1 E F0 -.2(bu) +3.856 G 1.356(iltin \(see).2 F F2 1.356(SHELL B)3.856 F(UIL)-.09 E 1.356 +(TIN COMMANDS)-.828 F F0(belo)3.607 E 1.357(w\) or mark)-.25 F 1.357 +(ed to not recei)-.1 F -.15(ve)-.25 G F2(SIGHUP)108 184.8 Q F0(using) +2.25 E F1(diso)2.5 E(wn \255h)-.1 E F0(.)A .166(If the)108 201.6 R F1 +(huponexit)2.666 E F0 .166(shell option has been set with)2.666 F F1 +(shopt)2.666 E F0(,)A F1(bash)2.666 E F0 .166(sends a)2.666 F F2(SIGHUP) +2.666 E F0 .166(to all jobs when an interacti)2.416 F -.15(ve)-.25 G +(login shell e)108 213.6 Q(xits.)-.15 E(If)108 230.4 Q F1(bash)3.046 E +F0 .546(is w)3.046 F .546(aiting for a command to complete and recei)-.1 +F -.15(ve)-.25 G 3.046(sas).15 G .546 +(ignal for which a trap has been set, the trap)-3.046 F .663 +(will not be e)108 242.4 R -.15(xe)-.15 G .663 +(cuted until the command completes.).15 F(When)5.663 E F1(bash)3.163 E +F0 .662(is w)3.163 F .662(aiting for an asynchronous command)-.1 F .99 +(via the)108 254.4 R F1(wait)3.49 E F0 -.2(bu)3.49 G .99(iltin, the rec\ +eption of a signal for which a trap has been set will cause the).2 F F1 +(wait)3.49 E F0 -.2(bu)3.49 G .99(iltin to).2 F +(return immediately with an e)108 266.4 Q +(xit status greater than 128, immediately after which the trap is e)-.15 +E -.15(xe)-.15 G(cuted.).15 E/F4 10.95/Times-Bold@0 SF(JOB CONTR)72 +283.2 Q(OL)-.329 E/F5 10/Times-Italic@0 SF -.25(Jo)108 295.2 S 4.568(bc) +.25 G(ontr)-4.568 E(ol)-.45 E F0 2.068(refers to the ability to selecti) +5.078 F -.15(ve)-.25 G 2.067(ly stop \().15 F F5(suspend)A F0 4.567(\)t) +C 2.067(he e)-4.567 F -.15(xe)-.15 G 2.067 +(cution of processes and continue).15 F(\()108 307.2 Q F5 -.37(re)C +(sume).37 E F0 3.201(\)t)C .701(heir e)-3.201 F -.15(xe)-.15 G .702 +(cution at a later point.).15 F 3.202(Au)5.702 G .702 +(ser typically emplo)-3.202 F .702(ys this f)-.1 F .702 +(acility via an interacti)-.1 F 1.002 -.15(ve i)-.25 H(nterf).15 E(ace) +-.1 E(supplied jointly by the operating system k)108 319.2 Q(ernel')-.1 +E 2.5(st)-.55 G(erminal dri)-2.5 E -.15(ve)-.25 G 2.5(ra).15 G(nd)-2.5 E +F1(bash)2.5 E F0(.)A .785(The shell associates a)108 336 R F5(job)5.025 +E F0 .785(with each pipeline.)3.515 F .784(It k)5.785 F .784 +(eeps a table of currently e)-.1 F -.15(xe)-.15 G .784 +(cuting jobs, which may be).15 F .34(listed with the)108 348 R F1(jobs) +2.84 E F0 2.84(command. When)2.84 F F1(bash)2.84 E F0 .341 +(starts a job asynchronously \(in the)2.84 F F5(bac)2.841 E(kgr)-.2 E +(ound)-.45 E F0 .341(\), it prints a line).77 F(that looks lik)108 360 Q +(e:)-.1 E([1] 25647)144 376.8 Q .241(indicating that this job is job nu\ +mber 1 and that the process ID of the last process in the pipeline asso\ +ciated)108 393.6 R .732(with this job is 25647.)108 405.6 R .733 +(All of the processes in a single pipeline are members of the same job) +5.732 F(.)-.4 E F1(Bash)5.733 E F0(uses)3.233 E(the)108 417.6 Q F5(job) +4.24 E F0(abstraction as the basis for job control.)2.73 E 3.063 -.8 +(To f)108 434.4 T 1.463(acilitate the implementation of the user interf) +.7 F 1.462(ace to job control, the operating system maintains the)-.1 F +.87(notion of a)108 446.4 R F5(curr)3.37 E .87(ent terminal pr)-.37 F +.871(ocess gr)-.45 F .871(oup ID)-.45 F F0 5.871(.M)C .871 +(embers of this process group \(processes whose process)-5.871 F .023 +(group ID is equal to the current terminal process group ID\) recei)108 +458.4 R .323 -.15(ve k)-.25 H -.15(ey).05 G .023 +(board-generated signals such as).15 F F2(SIG-)2.522 E(INT)108 470.4 Q +F3(.)A F0 1.346(These processes are said to be in the)5.846 F F5(for) +3.847 E -.4(eg)-.37 G -.45(ro).4 G(und).45 E F0(.).77 E F5(Bac)6.927 E +(kgr)-.2 E(ound)-.45 E F0 1.347(processes are those whose process)4.617 +F .146(group ID dif)108 482.4 R .146(fers from the terminal')-.25 F .146 +(s; such processes are immune to k)-.55 F -.15(ey)-.1 G .145 +(board-generated signals.).15 F .145(Only fore-)5.145 F .16 +(ground processes are allo)108 494.4 R .16(wed to read from or)-.25 F +2.66(,i)-.4 G 2.66(ft)-2.66 G .16(he user so speci\214es with)-2.66 F/F6 +10/Courier@0 SF .16(stty tostop)2.66 F F0 2.66(,w)C .16(rite to the ter) +-2.66 F(-)-.2 E 3.052(minal. Background)108 506.4 R .551 +(processes which attempt to read from \(write to when)3.052 F F6 .551 +(stty tostop)3.051 F F0 .551(is in ef)3.051 F .551(fect\) the)-.25 F +.717(terminal are sent a)108 518.4 R F2 .717(SIGTTIN \(SIGTT)3.217 F +(OU\))-.162 E F0 .718(signal by the k)2.967 F(ernel')-.1 E 3.218(st)-.55 +G .718(erminal dri)-3.218 F -.15(ve)-.25 G 1.518 -.4(r, w).15 H .718 +(hich, unless caught, sus-).4 F(pends the process.)108 530.4 Q 1.088 +(If the operating system on which)108 547.2 R F1(bash)3.588 E F0 1.088 +(is running supports job control,)3.588 F F1(bash)3.587 E F0 1.087 +(contains f)3.587 F 1.087(acilities to use it.)-.1 F -.8(Ty)108 559.2 S +.301(ping the).8 F F5(suspend)3.141 E F0 .301(character \(typically) +3.571 F F1(^Z)2.801 E F0 2.801(,C)C .301 +(ontrol-Z\) while a process is running causes that process to be)-2.801 +F 2.143(stopped and returns control to)108 571.2 R F1(bash)4.642 E F0 +7.142(.T)C 2.142(yping the)-7.942 F F5 2.142(delayed suspend)4.992 F F0 +2.142(character \(typically)5.412 F F1(^Y)4.642 E F0 4.642(,C)C +(ontrol-Y\))-4.642 E .021(causes the process to be stopped when it atte\ +mpts to read input from the terminal, and control to be returned)108 +583.2 R(to)108 595.2 Q F1(bash)3.392 E F0 5.892(.T)C .892 +(he user may then manipulate the state of this job, using the)-5.892 F +F1(bg)3.392 E F0 .892(command to continue it in the)3.392 F .894 +(background, the)108 607.2 R F1(fg)3.394 E F0 .895 +(command to continue it in the fore)3.394 F .895(ground, or the)-.15 F +F1(kill)3.395 E F0 .895(command to kill it.)3.395 F(A)5.895 E F1(^Z) +3.395 E F0(tak)3.395 E(es)-.1 E(ef)108 619.2 Q .949(fect immediately) +-.25 F 3.449(,a)-.65 G .948(nd has the additional side ef)-3.449 F .948 +(fect of causing pending output and typeahead to be dis-)-.25 F(carded.) +108 631.2 Q .777(There are a number of w)108 648 R .777 +(ays to refer to a job in the shell.)-.1 F .777(The character)5.777 F F1 +(%)3.277 E F0 .777(introduces a job speci\214cation)3.277 F(\()108 660 Q +F5(jobspec)A F0 3.458(\). Job)B(number)3.458 E F5(n)3.818 E F0 .957 +(may be referred to as)3.697 F F1(%n)3.457 E F0 5.957(.A)C .957 +(job may also be referred to using a pre\214x of the)-2.5 F .59(name us\ +ed to start it, or using a substring that appears in its command line.) +108 672 R -.15(Fo)5.59 G 3.09(re).15 G(xample,)-3.24 E F1(%ce)3.09 E F0 +.59(refers to a)3.09 F(stopped)108 684 Q F1(ce)3.464 E F0(job)3.464 E +5.964(.I)-.4 G 3.463(fap)-5.964 G .963 +(re\214x matches more than one job,)-3.463 F F1(bash)3.463 E F0 .963 +(reports an error)3.463 F 5.963(.U)-.55 G(sing)-5.963 E F1(%?ce)3.463 E +F0 3.463(,o)C 3.463(nt)-3.463 G .963(he other)-3.463 F .086 +(hand, refers to an)108 696 R 2.587(yj)-.15 G .087 +(ob containing the string)-2.587 F F1(ce)2.587 E F0 .087 +(in its command line.)2.587 F .087 +(If the substring matches more than one)5.087 F(job,)108 708 Q F1(bash) +2.518 E F0 .018(reports an error)2.518 F 5.018(.T)-.55 G .018 +(he symbols)-5.018 F F1(%%)2.518 E F0(and)2.518 E F1(%+)2.518 E F0 .018 +(refer to the shell')2.518 F 2.518(sn)-.55 G .018(otion of the)-2.518 F +F5(curr)2.518 E .018(ent job)-.37 F F0 2.518(,w).23 G .018(hich is) +-2.518 F .494(the last job stopped while it w)108 720 R .495 +(as in the fore)-.1 F .495(ground or started in the background.)-.15 F +(The)5.495 E F5(pr)4.245 E -.15(ev)-.37 G .495(ious job).15 F F0 .495 +(may be)3.225 F(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(34)190.95 +E 0 Cg EP +%%Page: 35 35 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .788(referenced using)108 84 R/F1 10/Times-Bold@0 SF<25ad>3.288 E +F0 5.788(.I)C 3.288(ft)-5.788 G .787(here is only a single job,)-3.288 F +F1(%+)3.287 E F0(and)3.287 E F1<25ad>3.287 E F0 .787 +(can both be used to refer to that job)3.287 F 5.787(.I)-.4 G(n)-5.787 E +.256(output pertaining to jobs \(e.g., the output of the)108 96 R F1 +(jobs)2.756 E F0 .256(command\), the current job is al)2.756 F -.1(wa) +-.1 G .257(ys \215agged with a).1 F F1(+)2.757 E F0(,)A .411 +(and the pre)108 108 R .411(vious job with a)-.25 F F12.911 E F0 +5.411(.A)C .411(single % \(with no accompan)-2.5 F .41 +(ying job speci\214cation\) also refers to the cur)-.15 F(-)-.2 E +(rent job)108 120 Q(.)-.4 E .443 +(Simply naming a job can be used to bring it into the fore)108 136.8 R +(ground:)-.15 E F1(%1)2.944 E F0 .444(is a synon)2.944 F .444(ym for) +-.15 F F1 -.63(``)2.944 G .444(fg %1').63 F(')-.63 E F0 2.944(,b)C +(ringing)-2.944 E 1.473(job 1 from the background into the fore)108 +148.8 R 3.973(ground. Similarly)-.15 F(,)-.65 E F1 -.63(``)3.972 G 1.472 +(%1 &').63 F(')-.63 E F0 1.472(resumes job 1 in the background,)3.972 F +(equi)108 160.8 Q -.25(va)-.25 G(lent to).25 E F1 -.63(``)2.5 G(bg %1') +.63 E(')-.63 E F0(.)A .13(The shell learns immediately whene)108 177.6 R +-.15(ve)-.25 G 2.63(raj).15 G .13(ob changes state.)-2.63 F(Normally) +5.131 E(,)-.65 E F1(bash)2.631 E F0 -.1(wa)2.631 G .131 +(its until it is about to print a).1 F .158 +(prompt before reporting changes in a job')108 189.6 R 2.658(ss)-.55 G +.158(tatus so as to not interrupt an)-2.658 F 2.657(yo)-.15 G .157 +(ther output.)-2.657 F .157(If the)5.157 F F12.657 E F0 .157 +(option to)2.657 F(the)108 201.6 Q F1(set)3.951 E F0 -.2(bu)3.951 G +1.451(iltin command is enabled,).2 F F1(bash)3.951 E F0 1.452 +(reports such changes immediately)3.951 F 6.452(.A)-.65 G 1.752 -.15 +(ny t)-6.452 H 1.452(rap on).15 F/F2 9/Times-Bold@0 SF(SIGCHLD)3.952 E +F0(is)3.702 E -.15(exe)108 213.6 S(cuted for each child that e).15 E +(xits.)-.15 E .033(If an attempt to e)108 230.4 R(xit)-.15 E F1(bash) +2.533 E F0 .033(is made while jobs are stopped \(or)2.533 F 2.532(,i)-.4 +G 2.532(ft)-2.532 G(he)-2.532 E F1(checkjobs)2.532 E F0 .032 +(shell option has been enabled)2.532 F 2.019(using the)108 242.4 R F1 +(shopt)4.519 E F0 -.2(bu)4.519 G 2.019 +(iltin, running\), the shell prints a w).2 F 2.02 +(arning message, and, if the)-.1 F F1(checkjobs)4.52 E F0 2.02 +(option is)4.52 F .459(enabled, lists the jobs and their statuses.)108 +254.4 R(The)5.459 E F1(jobs)2.959 E F0 .458 +(command may then be used to inspect their status.)2.958 F .458(If a) +5.458 F .603(second attempt to e)108 266.4 R .604 +(xit is made without an interv)-.15 F .604 +(ening command, the shell does not print another w)-.15 F(arning,)-.1 E +(and an)108 278.4 Q 2.5(ys)-.15 G(topped jobs are terminated.)-2.5 E/F3 +10.95/Times-Bold@0 SF(PR)72 295.2 Q(OMPTING)-.329 E F0 .645(When e)108 +307.2 R -.15(xe)-.15 G .645(cuting interacti).15 F -.15(ve)-.25 G(ly).15 +E(,)-.65 E F1(bash)3.145 E F0 .645(displays the primary prompt)3.145 F +F2(PS1)3.145 E F0 .645(when it is ready to read a command,)2.895 F 1.825 +(and the secondary prompt)108 319.2 R F2(PS2)4.325 E F0 1.825 +(when it needs more input to complete a command.)4.075 F F1(Bash)6.826 E +F0(allo)4.326 E 1.826(ws these)-.25 F 1.499(prompt strings to be custom\ +ized by inserting a number of backslash-escaped special characters that\ + are)108 331.2 R(decoded as follo)108 343.2 Q(ws:)-.25 E F1(\\a)144 +355.2 Q F0(an ASCII bell character \(07\))28.22 E F1(\\d)144 367.2 Q F0 +(the date in "W)27.66 E(eekday Month Date" format \(e.g., "T)-.8 E +(ue May 26"\))-.45 E F1(\\D{)144 379.2 Q/F4 10/Times-Italic@0 SF(format) +A F1(})A F0(the)180 391.2 Q F4(format)3.926 E F0 1.426(is passed to) +3.926 F F4(strftime)3.926 E F0 1.427 +(\(3\) and the result is inserted into the prompt string; an)B(empty)180 +403.2 Q F4(format)2.5 E F0 +(results in a locale-speci\214c time representation.)2.5 E +(The braces are required)5 E F1(\\e)144 415.2 Q F0 +(an ASCII escape character \(033\))28.78 E F1(\\h)144 427.2 Q F0 +(the hostname up to the \214rst `.)27.66 E(')-.7 E F1(\\H)144 439.2 Q F0 +(the hostname)25.44 E F1(\\j)144 451.2 Q F0 +(the number of jobs currently managed by the shell)29.89 E F1(\\l)144 +463.2 Q F0(the basename of the shell')30.44 E 2.5(st)-.55 G(erminal de) +-2.5 E(vice name)-.25 E F1(\\n)144 475.2 Q F0(ne)27.66 E(wline)-.25 E F1 +(\\r)144 487.2 Q F0(carriage return)28.78 E F1(\\s)144 499.2 Q F0 +(the name of the shell, the basename of)29.33 E F1($0)2.5 E F0 +(\(the portion follo)2.5 E(wing the \214nal slash\))-.25 E F1(\\t)144 +511.2 Q F0(the current time in 24-hour HH:MM:SS format)29.89 E F1(\\T) +144 523.2 Q F0(the current time in 12-hour HH:MM:SS format)26.55 E F1 +(\\@)144 535.2 Q F0(the current time in 12-hour am/pm format)23.92 E F1 +(\\A)144 547.2 Q F0(the current time in 24-hour HH:MM format)26 E F1 +(\\u)144 559.2 Q F0(the username of the current user)27.66 E F1(\\v)144 +571.2 Q F0(the v)28.22 E(ersion of)-.15 E F1(bash)2.5 E F0 +(\(e.g., 2.00\))2.5 E F1(\\V)144 583.2 Q F0(the release of)26 E F1(bash) +2.5 E F0 2.5(,v)C(ersion + patch le)-2.65 E -.15(ve)-.25 G 2.5(l\().15 G +(e.g., 2.00.0\))-2.5 E F1(\\w)144 595.2 Q F0 .116(the current w)26 F +.116(orking directory)-.1 F 2.616(,w)-.65 G(ith)-2.616 E F2($HOME)2.616 +E F0(abbre)2.366 E .115(viated with a tilde \(uses the v)-.25 F .115 +(alue of the)-.25 F F2(PR)180 607.2 Q(OMPT_DIR)-.27 E(TRIM)-.36 E F0 +-.25(va)2.25 G(riable\)).25 E F1(\\W)144 619.2 Q F0 +(the basename of the current w)23.22 E(orking directory)-.1 E 2.5(,w) +-.65 G(ith)-2.5 E F2($HOME)2.5 E F0(abbre)2.25 E(viated with a tilde) +-.25 E F1(\\!)144 631.2 Q F0(the history number of this command)29.89 E +F1(\\#)144 643.2 Q F0(the command number of this command)28.22 E F1(\\$) +144 655.2 Q F0(if the ef)28.22 E(fecti)-.25 E .3 -.15(ve U)-.25 H +(ID is 0, a).15 E F1(#)2.5 E F0 2.5(,o)C(therwise a)-2.5 E F1($)2.5 E +(\\)144 667.2 Q F4(nnn)A F0 +(the character corresponding to the octal number)18.22 E F4(nnn)2.5 E F1 +(\\\\)144 679.2 Q F0 2.5(ab)30.44 G(ackslash)-2.5 E F1(\\[)144 691.2 Q +F0(be)29.89 E 1.257(gin a sequence of non-printing characters, which co\ +uld be used to embed a terminal)-.15 F(control sequence into the prompt) +180 703.2 Q F1(\\])144 715.2 Q F0 +(end a sequence of non-printing characters)29.89 E(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(35)190.95 E 0 Cg EP +%%Page: 36 36 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .12(The command number and the history number are usually dif)108 +84 R .119(ferent: the history number of a command is its)-.25 F 1.585(p\ +osition in the history list, which may include commands restored from t\ +he history \214le \(see)108 96 R/F1 9/Times-Bold@0 SF(HIST)4.085 E(OR) +-.162 E(Y)-.315 E F0(belo)108 108 Q .541(w\), while the command number \ +is the position in the sequence of commands e)-.25 F -.15(xe)-.15 G .54 +(cuted during the cur).15 F(-)-.2 E .546(rent shell session.)108 120 R +.546(After the string is decoded, it is e)5.546 F .546 +(xpanded via parameter e)-.15 F .546(xpansion, command substitu-)-.15 F +.352(tion, arithmetic e)108 132 R .352(xpansion, and quote remo)-.15 F +-.25(va)-.15 G .352(l, subject to the v).25 F .352(alue of the)-.25 F/F2 +10/Times-Bold@0 SF(pr)2.852 E(omptv)-.18 E(ars)-.1 E F0 .351 +(shell option \(see the)2.852 F(description of the)108 144 Q F2(shopt) +2.5 E F0(command under)2.5 E F1(SHELL B)2.5 E(UIL)-.09 E(TIN COMMANDS) +-.828 E F0(belo)2.25 E(w\).)-.25 E/F3 10.95/Times-Bold@0 SF(READLINE)72 +160.8 Q F0 .15 +(This is the library that handles reading input when using an interacti) +108 172.8 R .451 -.15(ve s)-.25 H .151(hell, unless the).15 F F2 +(\255\255noediting)2.651 E F0(option)2.651 E 1.209(is gi)108 184.8 R +-.15(ve)-.25 G 3.709(na).15 G 3.709(ts)-3.709 G 1.209(hell in)-3.709 F +-.2(vo)-.4 G 3.709(cation. Line).2 F 1.208 +(editing is also used when using the)3.709 F F23.708 E F0 1.208 +(option to the)3.708 F F2 -.18(re)3.708 G(ad).18 E F0 -.2(bu)3.708 G +3.708(iltin. By).2 F(def)108 196.8 Q .851 +(ault, the line editing commands are similar to those of Emacs.)-.1 F +3.351(Av)5.851 G .851(i-style line editing interf)-3.351 F .852 +(ace is also)-.1 F -.2(av)108 208.8 S 3.35(ailable. Line)-.05 F .85 +(editing can be enabled at an)3.35 F 3.35(yt)-.15 G .85(ime using the) +-3.35 F F2 .85(\255o emacs)3.35 F F0(or)3.35 E F2 .85(\255o vi)3.35 F F0 +.85(options to the)3.35 F F2(set)3.35 E F0 -.2(bu)3.35 G(iltin).2 E +(\(see)108 220.8 Q F1 .762(SHELL B)3.262 F(UIL)-.09 E .762(TIN COMMANDS) +-.828 F F0(belo)3.012 E 3.262(w\). T)-.25 F 3.263(ot)-.8 G .763(urn of) +-3.263 F 3.263(fl)-.25 G .763 +(ine editing after the shell is running, use the)-3.263 F F2(+o)3.263 E +(emacs)108 232.8 Q F0(or)2.5 E F2(+o vi)2.5 E F0(options to the)2.5 E F2 +(set)2.5 E F0 -.2(bu)2.5 G(iltin.).2 E F2(Readline Notation)87 249.6 Q +F0 .463(In this section, the Emacs-style notation is used to denote k) +108 261.6 R -.15(ey)-.1 G(strok).15 E 2.963(es. Control)-.1 F -.1(ke) +2.963 G .463(ys are denoted by C\255)-.05 F/F4 10/Times-Italic@0 SF -.1 +(ke)C(y)-.2 E F0(,)A 1.152(e.g., C\255n means Control\255N.)108 273.6 R +(Similarly)6.152 E(,)-.65 E F4(meta)4.032 E F0 -.1(ke)3.913 G 1.153 +(ys are denoted by M\255)-.05 F F4 -.1(ke)C(y)-.2 E F0 3.653(,s)C 3.653 +(oM)-3.653 G 1.153(\255x means Meta\255X.)-3.653 F(\(On)6.153 E -.1(ke) +108 285.6 S .831(yboards without a)-.05 F F4(meta)3.711 E F0 -.1(ke) +3.591 G 2.131 -.65(y, M)-.05 H.65 E F4(x)A F0 .831(means ESC)3.331 F +F4(x)3.331 E F0 3.331(,i)C .83(.e., press the Escape k)-3.331 F 1.13 +-.15(ey t)-.1 H .83(hen the).15 F F4(x)4.1 E F0 -.1(ke)3.86 G 4.63 -.65 +(y. T)-.05 H .83(his mak).65 F(es)-.1 E .599(ESC the)108 297.6 R F4 .599 +(meta pr)3.099 F(e\214x)-.37 E F0 5.599(.T)C .599 +(he combination M\255C\255)-5.599 F F4(x)A F0 .599 +(means ESC\255Control\255)3.099 F F4(x)A F0 3.099(,o)C 3.099(rp)-3.099 G +.6(ress the Escape k)-3.099 F .9 -.15(ey t)-.1 H .6(hen hold).15 F +(the Control k)108 309.6 Q .3 -.15(ey w)-.1 H(hile pressing the).15 E F4 +(x)3.27 E F0 -.1(ke)3.03 G -.65(y.)-.05 G(\)).65 E .62 +(Readline commands may be gi)108 326.4 R -.15(ve)-.25 G 3.119(nn).15 G +(umeric)-3.119 E F4(ar)3.119 E(guments)-.37 E F0 3.119(,w).27 G .619 +(hich normally act as a repeat count.)-3.119 F(Sometimes,)5.619 E(ho)108 +338.4 Q(we)-.25 E -.15(ve)-.25 G 1.418 -.4(r, i).15 H 3.118(ti).4 G +3.119(st)-3.118 G .619(he sign of the ar)-3.119 F .619 +(gument that is signi\214cant.)-.18 F -.15(Pa)5.619 G .619(ssing a ne) +.15 F -.05(ga)-.15 G(ti).05 E .919 -.15(ve a)-.25 H -.18(rg).15 G .619 +(ument to a command that).18 F 1.019(acts in the forw)108 350.4 R 1.018 +(ard direction \(e.g.,)-.1 F F2(kill\255line)3.518 E F0 3.518(\)c)C +1.018(auses that command to act in a backw)-3.518 F 1.018 +(ard direction.)-.1 F(Com-)6.018 E(mands whose beha)108 362.4 Q +(vior with ar)-.2 E(guments de)-.18 E(viates from this are noted belo) +-.25 E -.65(w.)-.25 G .811(When a command is described as)108 379.2 R F4 +(killing)3.311 E F0(te)3.311 E .811(xt, the te)-.15 F .811 +(xt deleted is sa)-.15 F -.15(ve)-.2 G 3.311(df).15 G .812 +(or possible future retrie)-3.311 F -.25(va)-.25 G 3.312(l\().25 G F4 +(yank-)-3.312 E(ing)108 391.2 Q F0 2.529(\). The)B .029(killed te)2.529 +F .029(xt is sa)-.15 F -.15(ve)-.2 G 2.529(di).15 G 2.529(na)-2.529 G F4 +.029(kill ring)B F0 5.029(.C)C(onsecuti)-5.029 E .329 -.15(ve k)-.25 H +.029(ills cause the te).15 F .029(xt to be accumulated into one unit,) +-.15 F .567(which can be yank)108 403.2 R .567(ed all at once.)-.1 F +.567(Commands which do not kill te)5.567 F .567 +(xt separate the chunks of te)-.15 F .567(xt on the kill)-.15 F(ring.) +108 415.2 Q F2(Readline Initialization)87 432 Q F0 .091(Readline is cus\ +tomized by putting commands in an initialization \214le \(the)108 444 R +F4(inputr)2.591 E(c)-.37 E F0 2.591(\214le\). The)2.591 F .091 +(name of this \214le)2.591 F .196(is tak)108 456 R .196(en from the v) +-.1 F .196(alue of the)-.25 F F1(INPUTRC)2.696 E F0 -.25(va)2.446 G +2.696(riable. If).25 F .196(that v)2.696 F .196 +(ariable is unset, the def)-.25 F .196(ault is)-.1 F F4(~/.inputr)2.696 +E(c)-.37 E F0 5.196(.W).31 G .197(hen a)-5.196 F 1.034(program which us\ +es the readline library starts up, the initialization \214le is read, a\ +nd the k)108 468 R 1.334 -.15(ey b)-.1 H 1.034(indings and).15 F -.25 +(va)108 480 S 1.149(riables are set.).25 F 1.149(There are only a fe) +6.149 F 3.649(wb)-.25 G 1.149(asic constructs allo)-3.649 F 1.15 +(wed in the readline initialization \214le.)-.25 F(Blank)6.15 E .737 +(lines are ignored.)108 492 R .737(Lines be)5.737 F .737(ginning with a) +-.15 F F2(#)3.237 E F0 .737(are comments.)3.237 F .737(Lines be)5.737 F +.737(ginning with a)-.15 F F2($)3.237 E F0 .736(indicate conditional) +3.236 F 2.5(constructs. Other)108 504 R(lines denote k)2.5 E .3 -.15 +(ey b)-.1 H(indings and v).15 E(ariable settings.)-.25 E .986(The def) +108 520.8 R .986(ault k)-.1 F -.15(ey)-.1 G .987 +(-bindings may be changed with an).15 F F4(inputr)3.497 E(c)-.37 E F0 +3.487(\214le. Other)3.797 F .987(programs that use this library may) +3.487 F(add their o)108 532.8 Q(wn commands and bindings.)-.25 E -.15 +(Fo)108 549.6 S 2.5(re).15 G(xample, placing)-2.65 E +(M\255Control\255u: uni)144 566.4 Q -.15(ve)-.25 G(rsal\255ar).15 E +(gument)-.18 E(or)108 578.4 Q(C\255Meta\255u: uni)144 590.4 Q -.15(ve) +-.25 G(rsal\255ar).15 E(gument)-.18 E(into the)108 602.4 Q F4(inputr) +2.51 E(c)-.37 E F0 -.1(wo)2.81 G(uld mak).1 E 2.5(eM)-.1 G(\255C\255u e) +-2.5 E -.15(xe)-.15 G(cute the readline command).15 E F4(univer)2.5 E +(sal\255ar)-.1 E(gument)-.37 E F0(.).68 E 1.261(The follo)108 619.2 R +1.261(wing symbolic character names are recognized:)-.25 F F4 -.4(RU) +3.761 G(BOUT).4 E F0(,)1.27 E F4(DEL)3.761 E F0(,).53 E F4(ESC)3.761 E +F0(,).72 E F4(LFD)3.761 E F0(,).28 E F4(NEWLINE)3.76 E F0(,).73 E F4 +(RET)3.76 E F0(,)1.27 E F4(RETURN)108 631.2 Q F0(,)1.1 E F4(SPC)2.5 E F0 +(,).72 E F4(SP)2.5 E -.3(AC)-.9 G(E).3 E F0 2.5(,a).73 G(nd)-2.5 E F4 +-.5(TA)2.5 G(B).5 E F0(.).27 E .209 +(In addition to command names, readline allo)108 648 R .209(ws k)-.25 F +-.15(ey)-.1 G 2.709(st).15 G 2.709(ob)-2.709 G 2.709(eb)-2.709 G .209 +(ound to a string that is inserted when the k)-2.709 F .509 -.15(ey i) +-.1 H(s).15 E(pressed \(a)108 660 Q F4(macr)2.5 E(o)-.45 E F0(\).)A F2 +(Readline K)87 676.8 Q(ey Bindings)-.25 E F0 .366 +(The syntax for controlling k)108 688.8 R .666 -.15(ey b)-.1 H .366 +(indings in the).15 F F4(inputr)2.876 E(c)-.37 E F0 .366 +(\214le is simple.)3.176 F .366(All that is required is the name of the) +5.366 F .382(command or the te)108 700.8 R .383(xt of a macro and a k) +-.15 F .683 -.15(ey s)-.1 H .383 +(equence to which it should be bound. The name may be speci-).15 F .853 +(\214ed in one of tw)108 712.8 R 3.353(ow)-.1 G .853 +(ays: as a symbolic k)-3.453 F 1.153 -.15(ey n)-.1 H .853 +(ame, possibly with).15 F F4(Meta\255)3.353 E F0(or)3.353 E F4(Contr) +3.353 E(ol\255)-.45 E F0(pre\214x)3.353 E .853(es, or as a k)-.15 F -.15 +(ey)-.1 G(sequence.)108 724.8 Q(GNU Bash 4.3)72 768 Q(2014 February 2) +141.79 E(36)190.95 E 0 Cg EP +%%Page: 37 37 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E 1.541(When using the form)108 84 R/F1 10/Times-Bold@0 SF -.1(ke) +4.041 G(yname).1 E F0(:)A/F2 10/Times-Italic@0 SF(function\255name).833 +E F0(or)4.041 E F2(macr)4.042 E(o)-.45 E F0(,)A F2 -.1(ke)4.042 G(yname) +-.2 E F0 1.542(is the name of a k)4.222 F 1.842 -.15(ey s)-.1 H 1.542 +(pelled out in).15 F 2.5(English. F)108 96 R(or e)-.15 E(xample:)-.15 E +(Control-u: uni)144 120 Q -.15(ve)-.25 G(rsal\255ar).15 E(gument)-.18 E +(Meta-Rubout: backw)144 132 Q(ard-kill-w)-.1 E(ord)-.1 E +(Control-o: "> output")144 144 Q .699(In the abo)108 160.8 R .998 -.15 +(ve ex)-.15 H(ample,).15 E F2(C\255u)3.038 E F0 .698 +(is bound to the function)3.448 F F1(uni)3.198 E -.1(ve)-.1 G +(rsal\255ar).1 E(gument)-.1 E F0(,)A F2(M\255DEL)3.878 E F0 .698 +(is bound to the func-)3.728 F(tion)108 172.8 Q F1 +(backward\255kill\255w)2.758 E(ord)-.1 E F0 2.758(,a)C(nd)-2.758 E F2 +(C\255o)2.598 E F0 .258(is bound to run the macro e)2.938 F .259 +(xpressed on the right hand side \(that is, to)-.15 F(insert the te)108 +184.8 Q(xt)-.15 E/F3 10/Courier@0 SF 6(>o)2.5 G(utput)-6 E F0 +(into the line\).)2.5 E .056(In the second form,)108 201.6 R F1("k)2.556 +E(eyseq")-.1 E F0(:)A F2(function\255name).833 E F0(or)2.556 E F2(macr) +2.556 E(o)-.45 E F0(,)A F1 -.1(ke)2.556 G(yseq).1 E F0(dif)2.555 E .055 +(fers from)-.25 F F1 -.1(ke)2.555 G(yname).1 E F0(abo)2.555 E .355 -.15 +(ve i)-.15 H 2.555(nt).15 G .055(hat strings)-2.555 F 1.284 +(denoting an entire k)108 213.6 R 1.584 -.15(ey s)-.1 H 1.284(equence m\ +ay be speci\214ed by placing the sequence within double quotes.).15 F +(Some)6.284 E .386(GNU Emacs style k)108 225.6 R .686 -.15(ey e)-.1 H +.385(scapes can be used, as in the follo).15 F .385(wing e)-.25 F .385 +(xample, b)-.15 F .385(ut the symbolic character names)-.2 F +(are not recognized.)108 237.6 Q("\\C\255u": uni)144 261.6 Q -.15(ve) +-.25 G(rsal\255ar).15 E(gument)-.18 E +("\\C\255x\\C\255r": re\255read\255init\255\214le)144 273.6 Q +("\\e[11~": "Function K)144 285.6 Q .3 -.15(ey 1)-.25 H(").15 E .314 +(In this e)108 302.4 R(xample,)-.15 E F2(C\255u)2.654 E F0 .314(is ag) +3.064 F .315(ain bound to the function)-.05 F F1(uni)2.815 E -.1(ve)-.1 +G(rsal\255ar).1 E(gument)-.1 E F0(.)A F2 .315(C\255x C\255r)5.155 F F0 +.315(is bound to the func-)3.545 F(tion)108 314.4 Q F1 -.18(re)2.5 G +.18 E(ead\255init\255\214le)-.18 E F0 2.5(,a)C(nd)-2.5 E F2 +(ESC [ 1 1 ~)3.01 E F0(is bound to insert the te)3.94 E(xt)-.15 E F3 +(Function Key 1)2.5 E F0(.)A +(The full set of GNU Emacs style escape sequences is)108 331.2 Q F1 +<5c43ad>144 343.2 Q F0(control pre\214x)20.3 E F1<5c4dad>144 355.2 Q F0 +(meta pre\214x)18.08 E F1(\\e)144 367.2 Q F0(an escape character)28.78 E +F1(\\\\)144 379.2 Q F0(backslash)30.44 E F1(\\")144 391.2 Q F0 +(literal ")27.67 E F1<5c08>144 403.2 Q F0(literal \010)30.44 E(In addit\ +ion to the GNU Emacs style escape sequences, a second set of backslash \ +escapes is a)108 420 Q -.25(va)-.2 G(ilable:).25 E F1(\\a)144 432 Q F0 +(alert \(bell\))28.22 E F1(\\b)144 444 Q F0(backspace)27.66 E F1(\\d)144 +456 Q F0(delete)27.66 E F1(\\f)144 468 Q F0(form feed)29.89 E F1(\\n)144 +480 Q F0(ne)27.66 E(wline)-.25 E F1(\\r)144 492 Q F0(carriage return) +28.78 E F1(\\t)144 504 Q F0(horizontal tab)29.89 E F1(\\v)144 516 Q F0 +-.15(ve)28.22 G(rtical tab).15 E F1(\\)144 528 Q F2(nnn)A F0 +(the eight-bit character whose v)18.22 E(alue is the octal v)-.25 E +(alue)-.25 E F2(nnn)2.5 E F0(\(one to three digits\))2.5 E F1(\\x)144 +540 Q F2(HH)A F0(the eight-bit character whose v)13.78 E(alue is the he) +-.25 E(xadecimal v)-.15 E(alue)-.25 E F2(HH)2.5 E F0(\(one or tw)2.5 E +2.5(oh)-.1 G .3 -.15(ex d)-2.5 H(igits\)).15 E 1.142 +(When entering the te)108 556.8 R 1.141(xt of a macro, single or double\ + quotes must be used to indicate a macro de\214nition.)-.15 F .089 +(Unquoted te)108 568.8 R .089(xt is assumed to be a function name.)-.15 +F .09(In the macro body)5.089 F 2.59(,t)-.65 G .09 +(he backslash escapes described abo)-2.59 F -.15(ve)-.15 G(are e)108 +580.8 Q 2.5(xpanded. Backslash)-.15 F(will quote an)2.5 E 2.5(yo)-.15 G +(ther character in the macro te)-2.5 E(xt, including " and \010.)-.15 E +F1(Bash)108 597.6 Q F0(allo)2.93 E .43(ws the current readline k)-.25 F +.73 -.15(ey b)-.1 H .429(indings to be displayed or modi\214ed with the) +.15 F F1(bind)2.929 E F0 -.2(bu)2.929 G .429(iltin command.).2 F .045 +(The editing mode may be switched during interacti)108 609.6 R .345 -.15 +(ve u)-.25 H .046(se by using the).15 F F12.546 E F0 .046 +(option to the)2.546 F F1(set)2.546 E F0 -.2(bu)2.546 G .046 +(iltin command).2 F(\(see)108 621.6 Q/F4 9/Times-Bold@0 SF(SHELL B)2.5 E +(UIL)-.09 E(TIN COMMANDS)-.828 E F0(belo)2.25 E(w\).)-.25 E F1 +(Readline V)87 638.4 Q(ariables)-.92 E F0 .044(Readline has v)108 650.4 +R .043(ariables that can be used to further customize its beha)-.25 F +(vior)-.2 E 5.043(.A)-.55 G -.25(va)-2.5 G .043 +(riable may be set in the).25 F F2(inpu-)2.553 E(tr)108 662.4 Q(c)-.37 E +F0(\214le with a statement of the form)2.81 E F1(set)144 679.2 Q F2 +(variable\255name value)2.5 E F0 .79(Except where noted, readline v)108 +696 R .79(ariables can tak)-.25 F 3.29(et)-.1 G .79(he v)-3.29 F(alues) +-.25 E F1(On)3.29 E F0(or)3.29 E F1(Off)3.29 E F0 .79(\(without re)3.29 +F -.05(ga)-.15 G .79(rd to case\).).05 F(Unrecog-)5.79 E .449(nized v) +108 708 R .448(ariable names are ignored.)-.25 F .448(When a v)5.448 F +.448(ariable v)-.25 F .448(alue is read, empty or null v)-.25 F .448 +(alues, "on" \(case-insensi-)-.25 F(ti)108 720 Q -.15(ve)-.25 G .467 +(\), and "1" are equi).15 F -.25(va)-.25 G .468(lent to).25 F F1(On) +2.968 E F0 5.468(.A)C .468(ll other v)-5.468 F .468(alues are equi)-.25 +F -.25(va)-.25 G .468(lent to).25 F F1(Off)2.968 E F0 5.468(.T)C .468 +(he v)-5.468 F .468(ariables and their def)-.25 F(ault)-.1 E +(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(37)190.95 E 0 Cg EP +%%Page: 38 38 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E -.25(va)108 84 S(lues are:).25 E/F1 10/Times-Bold@0 SF +(bell\255style \(audible\))108 100.8 Q F0 .011 +(Controls what happens when readline w)144 112.8 R .011 +(ants to ring the terminal bell.)-.1 F .01(If set to)5.01 F F1(none)2.51 +E F0 2.51(,r)C .01(eadline ne)-2.51 F -.15(ve)-.25 G(r).15 E .94 +(rings the bell.)144 124.8 R .94(If set to)5.94 F F1(visible)3.44 E F0 +3.44(,r)C .94(eadline uses a visible bell if one is a)-3.44 F -.25(va) +-.2 G 3.44(ilable. If).25 F .94(set to)3.44 F F1(audible)3.44 E F0(,)A +(readline attempts to ring the terminal')144 136.8 Q 2.5(sb)-.55 G(ell.) +-2.5 E F1(bind\255tty\255special\255chars \(On\))108 148.8 Q F0 .056 +(If set to)144 160.8 R F1(On)2.556 E F0 2.556(,r)C .056(eadline attempt\ +s to bind the control characters treated specially by the k)-2.556 F +(ernel')-.1 E 2.555(st)-.55 G(ermi-)-2.555 E(nal dri)144 172.8 Q -.15 +(ve)-.25 G 2.5(rt).15 G 2.5(ot)-2.5 G(heir readline equi)-2.5 E -.25(va) +-.25 G(lents.).25 E F1(color)108 184.8 Q(ed\255stats \(Off\))-.18 E F0 +1.579(If set to)144 196.8 R F1(On)4.079 E F0 4.079(,r)C 1.579 +(eadline displays possible completions using dif)-4.079 F 1.58 +(ferent colors to indicate their \214le)-.25 F 2.5(type. The)144 208.8 R +(color de\214nitions are tak)2.5 E(en from the v)-.1 E(alue of the)-.25 +E F1(LS_COLORS)2.5 E F0(en)2.5 E(vironment v)-.4 E(ariable.)-.25 E F1 +(comment\255begin \(`)108 220.8 Q(`#')-.63 E('\))-.63 E F0 .885 +(The string that is inserted when the readline)144 232.8 R F1 +(insert\255comment)3.385 E F0 .884(command is e)3.384 F -.15(xe)-.15 G +3.384(cuted. This).15 F(com-)3.384 E(mand is bound to)144 244.8 Q F1 +(M\255#)2.5 E F0(in emacs mode and to)2.5 E F1(#)2.5 E F0 +(in vi command mode.)2.5 E F1(completion\255ignor)108 256.8 Q +(e\255case \(Off\))-.18 E F0(If set to)144 268.8 Q F1(On)2.5 E F0 2.5 +(,r)C(eadline performs \214lename matching and completion in a case\255\ +insensiti)-2.5 E .3 -.15(ve f)-.25 H(ashion.).05 E F1(completion\255pr) +108 280.8 Q(e\214x\255display\255length \(0\))-.18 E F0 .829(The length\ + in characters of the common pre\214x of a list of possible completions\ + that is displayed)144 292.8 R 1.275(without modi\214cation.)144 304.8 R +1.275(When set to a v)6.275 F 1.274 +(alue greater than zero, common pre\214x)-.25 F 1.274 +(es longer than this)-.15 F -.25(va)144 316.8 S(lue are replaced with a\ +n ellipsis when displaying possible completions.).25 E F1 +(completion\255query\255items \(100\))108 328.8 Q F0 .529 +(This determines when the user is queried about vie)144 340.8 R .53 +(wing the number of possible completions gen-)-.25 F .561(erated by the) +144 352.8 R F1(possible\255completions)3.061 E F0 3.061(command. It) +3.061 F .561(may be set to an)3.061 F 3.06(yi)-.15 G(nte)-3.06 E .56 +(ger v)-.15 F .56(alue greater than or)-.25 F .782(equal to zero.)144 +364.8 R .783(If the number of possible completions is greater than or e\ +qual to the v)5.782 F .783(alue of this)-.25 F -.25(va)144 376.8 S .237 +(riable, the user is ask).25 F .237(ed whether or not he wishes to vie) +-.1 F 2.737(wt)-.25 G .237(hem; otherwise the)-2.737 F 2.737(ya)-.15 G +.237(re simply listed)-2.737 F(on the terminal.)144 388.8 Q F1(con)108 +400.8 Q -.1(ve)-.4 G(rt\255meta \(On\)).1 E F0 .612(If set to)144 412.8 +R F1(On)3.112 E F0 3.112(,r)C .613(eadline will con)-3.112 F -.15(ve)-.4 +G .613(rt characters with the eighth bit set to an ASCII k).15 F .913 +-.15(ey s)-.1 H .613(equence by).15 F .541 +(stripping the eighth bit and pre\214xing an escape character \(in ef) +144 424.8 R .541(fect, using escape as the)-.25 F/F2 10/Times-Italic@0 +SF .541(meta pr)3.041 F(e-)-.37 E<8c78>144 436.8 Q F0(\).)A F1 +(disable\255completion \(Off\))108 448.8 Q F0 .038(If set to)144 460.8 R +F1(On)2.538 E F0 2.538(,r)C .038(eadline will inhibit w)-2.538 F .038 +(ord completion.)-.1 F .038 +(Completion characters will be inserted into the)5.038 F(line as if the) +144 472.8 Q 2.5(yh)-.15 G(ad been mapped to)-2.5 E F1(self-insert)2.5 E +F0(.)A F1(editing\255mode \(emacs\))108 484.8 Q F0 .142 +(Controls whether readline be)144 496.8 R .141(gins with a set of k)-.15 +F .441 -.15(ey b)-.1 H .141(indings similar to).15 F F2(Emacs)2.641 E F0 +(or)2.641 E F2(vi)2.641 E F0(.)A F1(editing\255mode)5.141 E F0 +(can be set to either)144 508.8 Q F1(emacs)2.5 E F0(or)2.5 E F1(vi)2.5 E +F0(.)A F1(echo\255contr)108 520.8 Q(ol\255characters \(On\))-.18 E F0 +1.21(When set to)144 532.8 R F1(On)3.71 E F0 3.71(,o)C 3.71(no)-3.71 G +1.211(perating systems that indicate the)-3.71 F 3.711(ys)-.15 G 1.211 +(upport it, readline echoes a character)-3.711 F +(corresponding to a signal generated from the k)144 544.8 Q -.15(ey)-.1 +G(board.).15 E F1(enable\255k)108 556.8 Q(eypad \(Off\))-.1 E F0 .893 +(When set to)144 568.8 R F1(On)3.393 E F0 3.393(,r)C .893 +(eadline will try to enable the application k)-3.393 F -.15(ey)-.1 G +.893(pad when it is called.).15 F .892(Some sys-)5.893 F +(tems need this to enable the arro)144 580.8 Q 2.5(wk)-.25 G -.15(ey) +-2.6 G(s.).15 E F1(enable\255meta\255k)108 592.8 Q(ey \(On\))-.1 E F0 +.64(When set to)144 604.8 R F1(On)3.14 E F0 3.14(,r)C .64 +(eadline will try to enable an)-3.14 F 3.14(ym)-.15 G .64 +(eta modi\214er k)-3.14 F .94 -.15(ey t)-.1 H .64 +(he terminal claims to support).15 F(when it is called.)144 616.8 Q +(On man)5 E 2.5(yt)-.15 G(erminals, the meta k)-2.5 E .3 -.15(ey i)-.1 H +2.5(su).15 G(sed to send eight-bit characters.)-2.5 E F1 +(expand\255tilde \(Off\))108 628.8 Q F0(If set to)144 640.8 Q F1(On)2.5 +E F0 2.5(,t)C(ilde e)-2.5 E +(xpansion is performed when readline attempts w)-.15 E(ord completion.) +-.1 E F1(history\255pr)108 652.8 Q(eser)-.18 E -.1(ve)-.1 G +(\255point \(Off\)).1 E F0 1.339(If set to)144 664.8 R F1(On)3.839 E F0 +3.839(,t)C 1.338(he history code attempts to place point at the same lo\ +cation on each history line)-3.839 F(retrie)144 676.8 Q -.15(ve)-.25 G +2.5(dw).15 G(ith)-2.5 E F1(pr)2.5 E -.15(ev)-.18 G(ious-history).15 E F0 +(or)2.5 E F1(next-history)2.5 E F0(.)A F1(history\255size \(0\))108 +688.8 Q F0 .948(Set the maximum number of history entries sa)144 700.8 R +-.15(ve)-.2 G 3.448(di).15 G 3.448(nt)-3.448 G .948(he history list.) +-3.448 F .949(If set to zero, an)5.948 F 3.449(ye)-.15 G(xisting)-3.599 +E .483(history entries are deleted and no ne)144 712.8 R 2.983(we)-.25 G +.483(ntries are sa)-2.983 F -.15(ve)-.2 G 2.983(d. If).15 F .482 +(set to a v)2.983 F .482(alue less than zero, the num-)-.25 F +(ber of history entries is not limited.)144 724.8 Q(By def)5 E +(ault, the number of history entries is not limited.)-.1 E(GNU Bash 4.3) +72 768 Q(2014 February 2)141.79 E(38)190.95 E 0 Cg EP +%%Page: 39 39 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(horizontal\255scr)108 84 Q +(oll\255mode \(Off\))-.18 E F0 .448(When set to)144 96 R F1(On)2.948 E +F0 2.948(,m)C(ak)-2.948 E .448 +(es readline use a single line for display)-.1 F 2.948(,s)-.65 G .449 +(crolling the input horizontally on a)-2.948 F 1.194(single screen line\ + when it becomes longer than the screen width rather than wrapping to a\ + ne)144 108 R(w)-.25 E(line.)144 120 Q F1(input\255meta \(Off\))108 132 +Q F0 .227(If set to)144 144 R F1(On)2.727 E F0 2.727(,r)C .228(eadline \ +will enable eight-bit input \(that is, it will not strip the high bit f\ +rom the char)-2.727 F(-)-.2 E .957(acters it reads\), re)144 156 R -.05 +(ga)-.15 G .956(rdless of what the terminal claims it can support.).05 F +.956(The name)5.956 F F1(meta\255\215ag)3.456 E F0 .956(is a)3.456 F +(synon)144 168 Q(ym for this v)-.15 E(ariable.)-.25 E F1(isear)108 180 Q +(ch\255terminators \(`)-.18 E(`C\255[C\255J')-.63 E('\))-.63 E F0 .439(\ +The string of characters that should terminate an incremental search wi\ +thout subsequently e)144 192 R -.15(xe)-.15 G(cut-).15 E .935 +(ing the character as a command.)144 204 R .935(If this v)5.935 F .935 +(ariable has not been gi)-.25 F -.15(ve)-.25 G 3.434(nav).15 G .934 +(alue, the characters)-3.684 F/F2 10/Times-Italic@0 SF(ESC)3.434 E F0 +(and)144 216 Q F2(C\255J)2.5 E F0(will terminate an incremental search.) +2.5 E F1 -.1(ke)108 228 S(ymap \(emacs\)).1 E F0 2.02 +(Set the current readline k)144 240 R -.15(ey)-.1 G 4.521(map. The).15 F +2.021(set of v)4.521 F 2.021(alid k)-.25 F -.15(ey)-.1 G 2.021 +(map names is).15 F F2 2.021(emacs, emacs\255standar)4.521 F(d,)-.37 E +.069(emacs\255meta, emacs\255ctlx, vi, vi\255command)144 252 R F0 2.568 +(,a)C(nd)-2.568 E F2(vi\255insert)2.568 E F0(.).68 E F2(vi)5.068 E F0 +.068(is equi)2.568 F -.25(va)-.25 G .068(lent to).25 F F2(vi\255command) +2.568 E F0(;)A F2(emacs)2.568 E F0 1.543(is equi)144 264 R -.25(va)-.25 +G 1.543(lent to).25 F F2(emacs\255standar)4.044 E(d)-.37 E F0 6.544(.T)C +1.544(he def)-6.544 F 1.544(ault v)-.1 F 1.544(alue is)-.25 F F2(emacs) +4.044 E F0 4.044(;t).27 G 1.544(he v)-4.044 F 1.544(alue of)-.25 F F1 +(editing\255mode)4.044 E F0(also)4.044 E(af)144 276 Q(fects the def)-.25 +E(ault k)-.1 E -.15(ey)-.1 G(map.).15 E F1 -.1(ke)108 288 S +(yseq\255timeout \(500\)).1 E F0 .368(Speci\214es the duration)144 300 R +F2 -.37(re)2.867 G(adline).37 E F0 .367(will w)2.867 F .367 +(ait for a character when reading an ambiguous k)-.1 F .667 -.15(ey s) +-.1 H(equence).15 E 1.356(\(one that can form a complete k)144 312 R +1.656 -.15(ey s)-.1 H 1.356(equence using the input read so f).15 F(ar) +-.1 E 3.856(,o)-.4 G 3.856(rc)-3.856 G 1.356(an tak)-3.856 F 3.856(ea) +-.1 G(dditional)-3.856 E .32(input to complete a longer k)144 324 R .62 +-.15(ey s)-.1 H 2.82(equence\). If).15 F .32(no input is recei)2.82 F +-.15(ve)-.25 G 2.82(dw).15 G .32(ithin the timeout,)-2.82 F F2 -.37(re) +2.82 G(adline).37 E F0(will)2.82 E .906(use the shorter b)144 336 R .907 +(ut complete k)-.2 F 1.207 -.15(ey s)-.1 H 3.407(equence. The).15 F -.25 +(va)3.407 G .907(lue is speci\214ed in milliseconds, so a v).25 F .907 +(alue of)-.25 F .05(1000 means that)144 348 R F2 -.37(re)2.55 G(adline) +.37 E F0 .05(will w)2.55 F .05(ait one second for additional input.)-.1 +F .05(If this v)5.05 F .05(ariable is set to a v)-.25 F(alue)-.25 E .051 +(less than or equal to zero, or to a non-numeric v)144 360 R(alue,)-.25 +E F2 -.37(re)2.551 G(adline).37 E F0 .051(will w)2.551 F .051 +(ait until another k)-.1 F .352 -.15(ey i)-.1 H 2.552(sp).15 G(ressed) +-2.552 E(to decide which k)144 372 Q .3 -.15(ey s)-.1 H +(equence to complete.).15 E F1(mark\255dir)108 384 Q(ectories \(On\)) +-.18 E F0(If set to)144 396 Q F1(On)2.5 E F0 2.5(,c)C +(ompleted directory names ha)-2.5 E .3 -.15(ve a s)-.2 H(lash appended.) +.15 E F1(mark\255modi\214ed\255lines \(Off\))108 408 Q F0(If set to)144 +420 Q F1(On)2.5 E F0 2.5(,h)C(istory lines that ha)-2.5 E .3 -.15(ve b) +-.2 H(een modi\214ed are displayed with a preceding asterisk \().15 E F1 +(*)A F0(\).)A F1(mark\255symlink)108 432 Q(ed\255dir)-.1 E +(ectories \(Off\))-.18 E F0 .175(If set to)144 444 R F1(On)2.675 E F0 +2.675(,c)C .175 +(ompleted names which are symbolic links to directories ha)-2.675 F .475 +-.15(ve a s)-.2 H .175(lash appended \(sub-).15 F(ject to the v)144 456 +Q(alue of)-.25 E F1(mark\255dir)2.5 E(ectories)-.18 E F0(\).)A F1 +(match\255hidden\255\214les \(On\))108 468 Q F0 .192(This v)144 480 R +.192(ariable, when set to)-.25 F F1(On)2.692 E F0 2.692(,c)C .192 +(auses readline to match \214les whose names be)-2.692 F .193 +(gin with a `.)-.15 F 2.693('\()-.7 G(hidden)-2.693 E .457 +(\214les\) when performing \214lename completion.)144 492 R .456 +(If set to)5.456 F F1(Off)2.956 E F0 2.956(,t)C .456(he leading `.) +-2.956 F 2.956('m)-.7 G .456(ust be supplied by the)-2.956 F +(user in the \214lename to be completed.)144 504 Q F1 +(menu\255complete\255display\255pr)108 516 Q(e\214x \(Off\))-.18 E F0 +1.585(If set to)144 528 R F1(On)4.085 E F0 4.085(,m)C 1.585(enu complet\ +ion displays the common pre\214x of the list of possible completions) +-4.085 F(\(which may be empty\) before c)144 540 Q +(ycling through the list.)-.15 E F1(output\255meta \(Off\))108 552 Q F0 +.507(If set to)144 564 R F1(On)3.007 E F0 3.007(,r)C .507(eadline will \ +display characters with the eighth bit set directly rather than as a me\ +ta-)-3.007 F(pre\214x)144 576 Q(ed escape sequence.)-.15 E F1 +(page\255completions \(On\))108 588 Q F0 .808(If set to)144 600 R F1(On) +3.308 E F0 3.308(,r)C .808(eadline uses an internal)-3.308 F F2(mor) +3.308 E(e)-.37 E F0(-lik)A 3.308(ep)-.1 G .808 +(ager to display a screenful of possible comple-)-3.308 F +(tions at a time.)144 612 Q F1 +(print\255completions\255horizontally \(Off\))108 624 Q F0 1.319 +(If set to)144 636 R F1(On)3.819 E F0 3.819(,r)C 1.318(eadline will dis\ +play completions with matches sorted horizontally in alphabetical)-3.819 +F(order)144 648 Q 2.5(,r)-.4 G(ather than do)-2.5 E(wn the screen.)-.25 +E F1 -2.29 -.18(re v)108 660 T(ert\255all\255at\255newline \(Off\)).08 E +F0 .698(If set to)144 672 R F1(On)3.198 E F0 3.198(,r)C .699 +(eadline will undo all changes to history lines before returning when) +-3.198 F F1(accept\255line)3.199 E F0(is)3.199 E -.15(exe)144 684 S +2.686(cuted. By).15 F(def)2.686 E .186 +(ault, history lines may be modi\214ed and retain indi)-.1 F .186 +(vidual undo lists across calls to)-.25 F F1 -.18(re)144 696 S(adline) +.18 E F0(.)A(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(39)190.95 E +0 Cg EP +%%Page: 40 40 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(sho)108 84 Q +(w\255all\255if\255ambiguous \(Off\))-.1 E F0 .303(This alters the def) +144 96 R .303(ault beha)-.1 F .304(vior of the completion functions.)-.2 +F .304(If set to)5.304 F F1(On)2.804 E F0 2.804(,w)C .304(ords which ha) +-2.904 F .604 -.15(ve m)-.2 H(ore).15 E 1.264(than one possible complet\ +ion cause the matches to be listed immediately instead of ringing the) +144 108 R(bell.)144 120 Q F1(sho)108 132 Q +(w\255all\255if\255unmodi\214ed \(Off\))-.1 E F0 5.345 +(This alters the def)144 144 R 5.345(ault beha)-.1 F 5.345 +(vior of the completion functions in a f)-.2 F 5.346(ashion similar to) +-.1 F F1(sho)144 156 Q(w\255all\255if\255ambiguous)-.1 E F0 6.691(.I)C +4.191(fs)-6.691 G 1.691(et to)-4.191 F F1(On)4.191 E F0 4.191(,w)C 1.691 +(ords which ha)-4.291 F 1.991 -.15(ve m)-.2 H 1.691 +(ore than one possible completion).15 F 1.039(without an)144 168 R 3.539 +(yp)-.15 G 1.039 +(ossible partial completion \(the possible completions don')-3.539 F +3.539(ts)-.18 G 1.04(hare a common pre\214x\))-3.539 F(cause the matche\ +s to be listed immediately instead of ringing the bell.)144 180 Q F1 +(sho)108 192 Q(w\255mode\255in\255pr)-.1 E(ompt \(Off\))-.18 E F0 1.019 +(If set to)144 204 R F1(On)3.519 E F0 3.519(,a)C 1.018 +(dd a character to the be)-3.519 F 1.018 +(ginning of the prompt indicating the editing mode: emacs)-.15 F +(\(@\), vi command \(:\) or vi insertion \(+\).)144 216 Q F1 +(skip\255completed\255text \(Off\))108 228 Q F0 .094(If set to)144 240 R +F1(On)2.594 E F0 2.594(,t)C .095(his alters the def)-2.594 F .095 +(ault completion beha)-.1 F .095 +(vior when inserting a single match into the line.)-.2 F(It')144 252 Q +2.546(so)-.55 G .046(nly acti)-2.546 F .346 -.15(ve w)-.25 H .046 +(hen performing completion in the middle of a w).15 F 2.545(ord. If)-.1 +F .045(enabled, readline does not)2.545 F 1.394(insert characters from \ +the completion that match characters after point in the w)144 264 R +1.395(ord being com-)-.1 F(pleted, so portions of the w)144 276 Q +(ord follo)-.1 E(wing the cursor are not duplicated.)-.25 E F1 +(visible\255stats \(Off\))108 288 Q F0 .847(If set to)144 300 R F1(On) +3.346 E F0 3.346(,ac)C .846(haracter denoting a \214le')-3.346 F 3.346 +(st)-.55 G .846(ype as reported by)-3.346 F/F2 10/Times-Italic@0 SF +(stat)3.346 E F0 .846(\(2\) is appended to the \214lename)B +(when listing possible completions.)144 312 Q F1 +(Readline Conditional Constructs)87 328.8 Q F0 .05 +(Readline implements a f)108 340.8 R .05(acility similar in spirit to t\ +he conditional compilation features of the C preprocessor)-.1 F .097 +(which allo)108 352.8 R .097(ws k)-.25 F .396 -.15(ey b)-.1 H .096 +(indings and v).15 F .096 +(ariable settings to be performed as the result of tests.)-.25 F .096 +(There are four parser)5.096 F(directi)108 364.8 Q -.15(ve)-.25 G 2.5 +(su).15 G(sed.)-2.5 E F1($if)108 381.6 Q F0(The)24.89 E F1($if)2.962 E +F0 .462(construct allo)2.962 F .463(ws bindings to be made based on the\ + editing mode, the terminal being used,)-.25 F .478 +(or the application using readline.)144 393.6 R .477(The te)5.477 F .477 +(xt of the test e)-.15 F .477 +(xtends to the end of the line; no characters)-.15 F +(are required to isolate it.)144 405.6 Q F1(mode)144 422.4 Q F0(The) +12.67 E F1(mode=)3.711 E F0 1.211(form of the)3.711 F F1($if)3.711 E F0 +(directi)3.711 E 1.511 -.15(ve i)-.25 H 3.711(su).15 G 1.211 +(sed to test whether readline is in emacs or vi)-3.711 F 3.065 +(mode. This)180 434.4 R .565(may be used in conjunction with the)3.065 F +F1 .565(set k)3.065 F(eymap)-.1 E F0 .565(command, for instance, to) +3.065 F .735(set bindings in the)180 446.4 R F2(emacs\255standar)3.235 E +(d)-.37 E F0(and)3.235 E F2(emacs\255ctlx)3.235 E F0 -.1(ke)3.235 G .735 +(ymaps only if readline is starting)-.05 F(out in emacs mode.)180 458.4 +Q F1(term)144 475.2 Q F0(The)15.46 E F1(term=)3.197 E F0 .696 +(form may be used to include terminal-speci\214c k)3.197 F .996 -.15 +(ey b)-.1 H .696(indings, perhaps to bind).15 F .654(the k)180 487.2 R +.954 -.15(ey s)-.1 H .654(equences output by the terminal').15 F 3.154 +(sf)-.55 G .654(unction k)-3.154 F -.15(ey)-.1 G 3.154(s. The).15 F -.1 +(wo)3.154 G .654(rd on the right side of).1 F(the)180 499.2 Q F1(=)3.232 +E F0 .732(is tested ag)3.232 F .732(ainst the both full name of the ter\ +minal and the portion of the terminal)-.05 F(name before the \214rst)180 +511.2 Q F12.5 E F0 5(.T)C(his allo)-5 E(ws)-.25 E F2(sun)2.84 E F0 +(to match both)2.74 E F2(sun)2.84 E F0(and)2.74 E F2(sun\255cmd)2.5 E F0 +2.5(,f).77 G(or instance.)-2.5 E F1(application)144 528 Q F0(The)180 540 +Q F1(application)3.003 E F0 .503 +(construct is used to include application-speci\214c settings.)3.003 F +.503(Each program)5.503 F .114(using the readline library sets the)180 +552 R F2 .114(application name)2.614 F F0 2.614(,a)C .114 +(nd an initialization \214le can test for a)-2.614 F .5(particular v)180 +564 R 3(alue. This)-.25 F .501(could be used to bind k)3 F .801 -.15 +(ey s)-.1 H .501(equences to functions useful for a spe-).15 F .397 +(ci\214c program.)180 576 R -.15(Fo)5.397 G 2.896(ri).15 G .396 +(nstance, the follo)-2.896 F .396(wing command adds a k)-.25 F .696 -.15 +(ey s)-.1 H .396(equence that quotes the).15 F(current or pre)180 588 Q +(vious w)-.25 E(ord in)-.1 E F1(bash)2.5 E F0(:)A F1($if)180 612 Q F0 +(Bash)2.5 E 2.5(#Q)180 624 S(uote the current or pre)-2.5 E(vious w)-.25 +E(ord)-.1 E("\\C\255xq": "\\eb\\"\\ef\\"")180 636 Q F1($endif)180 648 Q +($endif)108 664.8 Q F0(This command, as seen in the pre)9.33 E(vious e) +-.25 E(xample, terminates an)-.15 E F1($if)2.5 E F0(command.)2.5 E F1 +($else)108 681.6 Q F0(Commands in this branch of the)15.45 E F1($if)2.5 +E F0(directi)2.5 E .3 -.15(ve a)-.25 H(re e).15 E -.15(xe)-.15 G +(cuted if the test f).15 E(ails.)-.1 E F1($include)108 698.4 Q F0 .356 +(This directi)144 710.4 R .656 -.15(ve t)-.25 H(ak).15 E .356 +(es a single \214lename as an ar)-.1 F .357 +(gument and reads commands and bindings from that)-.18 F 2.5(\214le. F) +144 722.4 R(or e)-.15 E(xample, the follo)-.15 E(wing directi)-.25 E .3 +-.15(ve w)-.25 H(ould read).05 E F2(/etc/inputr)2.5 E(c)-.37 E F0(:)A +(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(40)190.95 E 0 Cg EP +%%Page: 41 41 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF($include)144 84 Q/F2 10/Times-Italic@0 SF +(/etc/inputr)5.833 E(c)-.37 E F1(Sear)87 100.8 Q(ching)-.18 E F0 .835 +(Readline pro)108 112.8 R .835 +(vides commands for searching through the command history \(see)-.15 F +/F3 9/Times-Bold@0 SF(HIST)3.334 E(OR)-.162 E(Y)-.315 E F0(belo)3.084 E +.834(w\) for lines)-.25 F(containing a speci\214ed string.)108 124.8 Q +(There are tw)5 E 2.5(os)-.1 G(earch modes:)-2.5 E F2(incr)2.51 E +(emental)-.37 E F0(and)3.01 E F2(non-incr)2.5 E(emental)-.37 E F0(.).51 +E .697(Incremental searches be)108 141.6 R .697 +(gin before the user has \214nished typing the search string.)-.15 F +.698(As each character of the)5.698 F .113 +(search string is typed, readline displays the ne)108 153.6 R .112 +(xt entry from the history matching the string typed so f)-.15 F(ar)-.1 +E 5.112(.A)-.55 G(n)-5.112 E .542 +(incremental search requires only as man)108 165.6 R 3.042(yc)-.15 G +.542(haracters as needed to \214nd the desired history entry)-3.042 F +5.542(.T)-.65 G .542(he char)-5.542 F(-)-.2 E .224 +(acters present in the v)108 177.6 R .224(alue of the)-.25 F F1(isear) +2.724 E(ch-terminators)-.18 E F0 -.25(va)2.724 G .224 +(riable are used to terminate an incremental search.).25 F .66 +(If that v)108 189.6 R .66(ariable has not been assigned a v)-.25 F .66 +(alue the Escape and Control-J characters will terminate an incre-)-.25 +F .097(mental search.)108 201.6 R .096(Control-G will abort an incremen\ +tal search and restore the original line.)5.097 F .096 +(When the search is)5.096 F(terminated, the history entry containing th\ +e search string becomes the current line.)108 213.6 Q 2.938 -.8(To \214) +108 230.4 T 1.339(nd other matching entries in the history list, type C\ +ontrol-S or Control-R as appropriate.).8 F 1.339(This will)6.339 F .675 +(search backw)108 242.4 R .675(ard or forw)-.1 F .675 +(ard in the history for the ne)-.1 F .674 +(xt entry matching the search string typed so f)-.15 F(ar)-.1 E 5.674 +(.A)-.55 G -.15(ny)-5.674 G .174(other k)108 254.4 R .474 -.15(ey s)-.1 +H .174 +(equence bound to a readline command will terminate the search and e).15 +F -.15(xe)-.15 G .175(cute that command.).15 F -.15(Fo)5.175 G(r).15 E +.541(instance, a)108 266.4 R F2(ne)3.041 E(wline)-.15 E F0 .541 +(will terminate the search and accept the line, thereby e)3.041 F -.15 +(xe)-.15 G .54(cuting the command from the).15 F(history list.)108 278.4 +Q .653(Readline remembers the last incremental search string.)108 295.2 +R .653(If tw)5.653 F 3.153(oC)-.1 G .653(ontrol-Rs are typed without an) +-3.153 F 3.153(yi)-.15 G(nterv)-3.153 E(en-)-.15 E +(ing characters de\214ning a ne)108 307.2 Q 2.5(ws)-.25 G +(earch string, an)-2.5 E 2.5(yr)-.15 G(emembered search string is used.) +-2.5 E .567(Non-incremental searches read the entire search string befo\ +re starting to search for matching history lines.)108 324 R(The search \ +string may be typed by the user or be part of the contents of the curre\ +nt line.)108 336 Q F1(Readline Command Names)87 352.8 Q F0 1.391 +(The follo)108 364.8 R 1.391 +(wing is a list of the names of the commands and the def)-.25 F 1.391 +(ault k)-.1 F 1.691 -.15(ey s)-.1 H 1.391(equences to which the).15 F +3.892(ya)-.15 G(re)-3.892 E 2.622(bound. Command)108 376.8 R .122 +(names without an accompan)2.622 F .122(ying k)-.15 F .421 -.15(ey s)-.1 +H .121(equence are unbound by def).15 F 2.621(ault. In)-.1 F .121 +(the follo)2.621 F(wing)-.25 E(descriptions,)108 388.8 Q F2(point)3.41 E +F0 .91(refers to the current cursor position, and)3.41 F F2(mark)3.411 E +F0 .911(refers to a cursor position sa)3.411 F -.15(ve)-.2 G 3.411(db) +.15 G 3.411(yt)-3.411 G(he)-3.411 E F1(set\255mark)108 400.8 Q F0 2.5 +(command. The)2.5 F(te)2.5 E +(xt between the point and mark is referred to as the)-.15 E F2 -.37(re) +2.5 G(gion)-.03 E F0(.)A F1(Commands f)87 417.6 Q(or Mo)-.25 E(ving)-.1 +E(beginning\255of\255line \(C\255a\))108 429.6 Q F0(Mo)144 441.6 Q .3 +-.15(ve t)-.15 H 2.5(ot).15 G(he start of the current line.)-2.5 E F1 +(end\255of\255line \(C\255e\))108 453.6 Q F0(Mo)144 465.6 Q .3 -.15 +(ve t)-.15 H 2.5(ot).15 G(he end of the line.)-2.5 E F1 -.25(fo)108 +477.6 S(rward\255char \(C\255f\)).25 E F0(Mo)144 489.6 Q .3 -.15(ve f) +-.15 H(orw).15 E(ard a character)-.1 E(.)-.55 E F1 +(backward\255char \(C\255b\))108 501.6 Q F0(Mo)144 513.6 Q .3 -.15(ve b) +-.15 H(ack a character).15 E(.)-.55 E F1 -.25(fo)108 525.6 S(rward\255w) +.25 E(ord \(M\255f\))-.1 E F0(Mo)144 537.6 Q .823 -.15(ve f)-.15 H(orw) +.15 E .523(ard to the end of the ne)-.1 F .523(xt w)-.15 F 3.023(ord. W) +-.1 F .522(ords are composed of alphanumeric characters \(let-)-.8 F +(ters and digits\).)144 549.6 Q F1(backward\255w)108 561.6 Q +(ord \(M\255b\))-.1 E F0(Mo)144 573.6 Q 1.71 -.15(ve b)-.15 H 1.41 +(ack to the start of the current or pre).15 F 1.41(vious w)-.25 F 3.91 +(ord. W)-.1 F 1.41(ords are composed of alphanumeric)-.8 F +(characters \(letters and digits\).)144 585.6 Q F1(shell\255f)108 597.6 +Q(orward\255w)-.25 E(ord)-.1 E F0(Mo)144 609.6 Q .784 -.15(ve f)-.15 H +(orw).15 E .484(ard to the end of the ne)-.1 F .484(xt w)-.15 F 2.984 +(ord. W)-.1 F .484(ords are delimited by non-quoted shell metacharac-) +-.8 F(ters.)144 621.6 Q F1(shell\255backward\255w)108 633.6 Q(ord)-.1 E +F0(Mo)144 645.6 Q .908 -.15(ve b)-.15 H .609 +(ack to the start of the current or pre).15 F .609(vious w)-.25 F 3.109 +(ord. W)-.1 F .609(ords are delimited by non-quoted shell)-.8 F +(metacharacters.)144 657.6 Q F1(clear\255scr)108 669.6 Q(een \(C\255l\)) +-.18 E F0 .993(Clear the screen lea)144 681.6 R .993 +(ving the current line at the top of the screen.)-.2 F -.4(Wi)5.993 G +.993(th an ar).4 F .993(gument, refresh the)-.18 F +(current line without clearing the screen.)144 693.6 Q F1 -.18(re)108 +705.6 S(draw\255curr).18 E(ent\255line)-.18 E F0 +(Refresh the current line.)144 717.6 Q(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(41)190.95 E 0 Cg EP +%%Page: 42 42 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(Commands f)87 84 Q +(or Manipulating the History)-.25 E(accept\255line \(Newline, Retur)108 +96 Q(n\))-.15 E F0 .158(Accept the line re)144 108 R -.05(ga)-.15 G .158 +(rdless of where the cursor is.).05 F .158(If this line is non-empty) +5.158 F 2.659(,a)-.65 G .159(dd it to the history list)-2.659 F .699 +(according to the state of the)144 120 R/F2 9/Times-Bold@0 SF(HISTCONTR) +3.199 E(OL)-.27 E F0 -.25(va)2.949 G 3.199(riable. If).25 F .699 +(the line is a modi\214ed history line, then)3.199 F +(restore the history line to its original state.)144 132 Q F1(pr)108 144 +Q -.15(ev)-.18 G(ious\255history \(C\255p\)).15 E F0(Fetch the pre)144 +156 Q(vious command from the history list, mo)-.25 E +(ving back in the list.)-.15 E F1(next\255history \(C\255n\))108 168 Q +F0(Fetch the ne)144 180 Q(xt command from the history list, mo)-.15 E +(ving forw)-.15 E(ard in the list.)-.1 E F1 +(beginning\255of\255history \(M\255<\))108 192 Q F0(Mo)144 204 Q .3 -.15 +(ve t)-.15 H 2.5(ot).15 G(he \214rst line in the history)-2.5 E(.)-.65 E +F1(end\255of\255history \(M\255>\))108 216 Q F0(Mo)144 228 Q .3 -.15 +(ve t)-.15 H 2.5(ot).15 G(he end of the input history)-2.5 E 2.5(,i)-.65 +G(.e., the line currently being entered.)-2.5 E F1 -2.29 -.18(re v)108 +240 T(erse\255sear).08 E(ch\255history \(C\255r\))-.18 E F0 1.47 +(Search backw)144 252 R 1.471(ard starting at the current line and mo) +-.1 F 1.471(ving `up' through the history as necessary)-.15 F(.)-.65 E +(This is an incremental search.)144 264 Q F1 -.25(fo)108 276 S +(rward\255sear).25 E(ch\255history \(C\255s\))-.18 E F0 1.132 +(Search forw)144 288 R 1.132(ard starting at the current line and mo)-.1 +F 1.131(ving `do)-.15 F 1.131(wn' through the history as necessary)-.25 +F(.)-.65 E(This is an incremental search.)144 300 Q F1(non\255incr)108 +312 Q(emental\255r)-.18 E -2.3 -.15(ev e)-.18 H(rse\255sear).15 E +(ch\255history \(M\255p\))-.18 E F0 .164(Search backw)144 324 R .164(ar\ +d through the history starting at the current line using a non-incremen\ +tal search for)-.1 F 2.5(as)144 336 S(tring supplied by the user)-2.5 E +(.)-.55 E F1(non\255incr)108 348 Q(emental\255f)-.18 E(orward\255sear) +-.25 E(ch\255history \(M\255n\))-.18 E F0 1.354(Search forw)144 360 R +1.354(ard through the history using a non-incremental search for a stri\ +ng supplied by the)-.1 F(user)144 372 Q(.)-.55 E F1(history\255sear)108 +384 Q(ch\255f)-.18 E(orward)-.25 E F0 .248(Search forw)144 396 R .249(a\ +rd through the history for the string of characters between the start o\ +f the current line)-.1 F(and the point.)144 408 Q +(This is a non-incremental search.)5 E F1(history\255sear)108 420 Q +(ch\255backward)-.18 E F0 .951(Search backw)144 432 R .951(ard through \ +the history for the string of characters between the start of the curre\ +nt)-.1 F(line and the point.)144 444 Q +(This is a non-incremental search.)5 E F1(yank\255nth\255ar)108 456 Q +2.5(g\()-.1 G<4dad43ad7929>-2.5 E F0 .622(Insert the \214rst ar)144 468 +R .622(gument to the pre)-.18 F .622 +(vious command \(usually the second w)-.25 F .622(ord on the pre)-.1 F +.622(vious line\))-.25 F .795(at point.)144 480 R -.4(Wi)5.795 G .794 +(th an ar).4 F(gument)-.18 E/F3 10/Times-Italic@0 SF(n)3.294 E F0 3.294 +(,i).24 G .794(nsert the)-3.294 F F3(n)3.294 E F0 .794(th w)B .794 +(ord from the pre)-.1 F .794(vious command \(the w)-.25 F .794 +(ords in the)-.1 F(pre)144 492 Q .291(vious command be)-.25 F .291 +(gin with w)-.15 F .291(ord 0\).)-.1 F 2.791(An)5.291 G -2.25 -.15(eg a) +-2.791 H(ti).15 E .591 -.15(ve a)-.25 H -.18(rg).15 G .291 +(ument inserts the).18 F F3(n)2.791 E F0 .291(th w)B .292 +(ord from the end of)-.1 F .282(the pre)144 504 R .282(vious command.) +-.25 F .282(Once the ar)5.282 F(gument)-.18 E F3(n)2.781 E F0 .281 +(is computed, the ar)2.781 F .281(gument is e)-.18 F .281 +(xtracted as if the "!)-.15 F F3(n)A F0(")A(history e)144 516 Q +(xpansion had been speci\214ed.)-.15 E F1(yank\255last\255ar)108 528 Q +2.5(g\()-.1 G -1.667(M\255. ,)-2.5 F -1.667(M\255_ \))2.5 F F0 1.307 +(Insert the last ar)144 540 R 1.307(gument to the pre)-.18 F 1.307 +(vious command \(the last w)-.25 F 1.308(ord of the pre)-.1 F 1.308 +(vious history entry\).)-.25 F -.4(Wi)144 552 S .204(th a numeric ar).4 +F .204(gument, beha)-.18 F .504 -.15(ve ex)-.2 H .204(actly lik).15 F(e) +-.1 E F1(yank\255nth\255ar)2.704 E(g)-.1 E F0 5.203(.S)C(uccessi)-5.203 +E .503 -.15(ve c)-.25 H .203(alls to).15 F F1(yank\255last\255ar)2.703 E +(g)-.1 E F0(mo)144 564 Q .806 -.15(ve b)-.15 H .507 +(ack through the history list, inserting the last w).15 F .507 +(ord \(or the w)-.1 F .507(ord speci\214ed by the ar)-.1 F(gument)-.18 E +1.397(to the \214rst call\) of each line in turn.)144 576 R(An)6.396 E +3.896(yn)-.15 G 1.396(umeric ar)-3.896 F 1.396 +(gument supplied to these successi)-.18 F 1.696 -.15(ve c)-.25 H(alls) +.15 E .491(determines the direction to mo)144 588 R .791 -.15(ve t)-.15 +H .491(hrough the history).15 F 5.492(.A)-.65 G(ne)-2.5 E -.05(ga)-.15 G +(ti).05 E .792 -.15(ve a)-.25 H -.18(rg).15 G .492 +(ument switches the direction).18 F .494 +(through the history \(back or forw)144 600 R 2.994(ard\). The)-.1 F +.494(history e)2.994 F .494(xpansion f)-.15 F .494 +(acilities are used to e)-.1 F .494(xtract the last)-.15 F -.1(wo)144 +612 S(rd, as if the "!$" history e).1 E(xpansion had been speci\214ed.) +-.15 E F1(shell\255expand\255line \(M\255C\255e\))108 624 Q F0 .622 +(Expand the line as the shell does.)144 636 R .622 +(This performs alias and history e)5.622 F .623 +(xpansion as well as all of the)-.15 F(shell w)144 648 Q(ord e)-.1 E 2.5 +(xpansions. See)-.15 F F2(HIST)2.5 E(OR)-.162 E 2.25(YE)-.315 G(XP)-2.25 +E(ANSION)-.666 E F0(belo)2.25 E 2.5(wf)-.25 G +(or a description of history e)-2.5 E(xpansion.)-.15 E F1 +(history\255expand\255line \(M\255^\))108 660 Q F0 .939 +(Perform history e)144 672 R .939(xpansion on the current line.)-.15 F +(See)5.939 E F2(HIST)3.439 E(OR)-.162 E 3.189(YE)-.315 G(XP)-3.189 E +(ANSION)-.666 E F0(belo)3.189 E 3.438(wf)-.25 G .938(or a descrip-) +-3.438 F(tion of history e)144 684 Q(xpansion.)-.15 E F1(magic\255space) +108 696 Q F0 1.626(Perform history e)144 708 R 1.626 +(xpansion on the current line and insert a space.)-.15 F(See)6.627 E F2 +(HIST)4.127 E(OR)-.162 E 3.877(YE)-.315 G(XP)-3.877 E(ANSION)-.666 E F0 +(belo)144 720 Q 2.5(wf)-.25 G(or a description of history e)-2.5 E +(xpansion.)-.15 E(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(42) +190.95 E 0 Cg EP +%%Page: 43 43 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(alias\255expand\255line)108 84 Q F0 .395 +(Perform alias e)144 96 R .395(xpansion on the current line.)-.15 F(See) +5.395 E/F2 9/Times-Bold@0 SF(ALIASES)2.895 E F0(abo)2.645 E .694 -.15 +(ve f)-.15 H .394(or a description of alias e).15 F(xpan-)-.15 E(sion.) +144 108 Q F1(history\255and\255alias\255expand\255line)108 120 Q F0 +(Perform history and alias e)144 132 Q(xpansion on the current line.) +-.15 E F1(insert\255last\255ar)108 144 Q(gument \(M\255.)-.1 E 2.5(,M) +.833 G -1.667(\255_ \))-2.5 F F0 2.5(As)144 156 S(ynon)-2.5 E(ym for) +-.15 E F1(yank\255last\255ar)2.5 E(g)-.1 E F0(.)A F1 +(operate\255and\255get\255next \(C\255o\))108 168 Q F0 .947 +(Accept the current line for e)144 180 R -.15(xe)-.15 G .948 +(cution and fetch the ne).15 F .948(xt line relati)-.15 F 1.248 -.15 +(ve t)-.25 H 3.448(ot).15 G .948(he current line from the)-3.448 F +(history for editing.)144 192 Q(An)5 E 2.5(ya)-.15 G -.18(rg)-2.5 G +(ument is ignored.).18 E F1 +(edit\255and\255execute\255command \(C\255xC\255e\))108 204 Q F0(In)144 +216 Q -.2(vo)-.4 G 1.226 -.1(ke a).2 H 3.526(ne).1 G 1.026 +(ditor on the current command line, and e)-3.526 F -.15(xe)-.15 G 1.026 +(cute the result as shell commands.).15 F F1(Bash)6.026 E F0 +(attempts to in)144 228 Q -.2(vo)-.4 G -.1(ke).2 G F2($VISU)2.6 E(AL) +-.54 E/F3 9/Times-Roman@0 SF(,)A F2($EDIT)2.25 E(OR)-.162 E F3(,)A F0 +(and)2.25 E/F4 10/Times-Italic@0 SF(emacs)2.5 E F0(as the editor)2.5 E +2.5(,i)-.4 G 2.5(nt)-2.5 G(hat order)-2.5 E(.)-.55 E F1(Commands f)87 +244.8 Q(or Changing T)-.25 E(ext)-.92 E F4(end\255of\255\214le)108 256.8 +Q F1(\(usually C\255d\))2.5 E F0 .798 +(The character indicating end-of-\214le as set, for e)144 268.8 R .799 +(xample, by)-.15 F/F5 10/Courier@0 SF(stty)3.299 E F0 5.799(.I)C 3.299 +(ft)-5.799 G .799(his character is read when)-3.299 F .592 +(there are no characters on the line, and point is at the be)144 280.8 R +.592(ginning of the line, Readline interprets it)-.15 F +(as the end of input and returns)144 292.8 Q F2(EOF)2.5 E F3(.)A F1 +(delete\255char \(C\255d\))108 304.8 Q F0 .441 +(Delete the character at point.)144 316.8 R .442 +(If this function is bound to the same character as the tty)5.441 F F1 +(EOF)2.942 E F0(char)2.942 E(-)-.2 E(acter)144 328.8 Q 2.5(,a)-.4 G(s) +-2.5 E F1(C\255d)2.5 E F0(commonly is, see abo)2.5 E .3 -.15(ve f)-.15 H +(or the ef).15 E(fects.)-.25 E F1(backward\255delete\255char \(Rubout\)) +108 340.8 Q F0 .553(Delete the character behind the cursor)144 352.8 R +5.553(.W)-.55 G .553(hen gi)-5.553 F -.15(ve)-.25 G 3.053(nan).15 G .553 +(umeric ar)-3.053 F .552(gument, sa)-.18 F .852 -.15(ve t)-.2 H .552 +(he deleted te).15 F .552(xt on)-.15 F(the kill ring.)144 364.8 Q F1 +-.25(fo)108 376.8 S(rward\255backward\255delete\255char).25 E F0 .473 +(Delete the character under the cursor)144 388.8 R 2.973(,u)-.4 G .474 +(nless the cursor is at the end of the line, in which case the)-2.973 F +(character behind the cursor is deleted.)144 400.8 Q F1 +(quoted\255insert \(C\255q, C\255v\))108 412.8 Q F0 .779(Add the ne)144 +424.8 R .779(xt character typed to the line v)-.15 F 3.279 +(erbatim. This)-.15 F .779(is ho)3.279 F 3.279(wt)-.25 G 3.279(oi)-3.279 +G .779(nsert characters lik)-3.279 F(e)-.1 E F1(C\255q)3.278 E F0 3.278 +(,f)C(or)-3.278 E -.15(ex)144 436.8 S(ample.).15 E F1 +(tab\255insert \(C\255v T)108 448.8 Q(AB\))-.9 E F0 +(Insert a tab character)144 460.8 Q(.)-.55 E F1 +(self\255insert \(a, b, A, 1, !, ...\))108 472.8 Q F0 +(Insert the character typed.)144 484.8 Q F1 +(transpose\255chars \(C\255t\))108 496.8 Q F0 .321 +(Drag the character before point forw)144 508.8 R .321(ard o)-.1 F -.15 +(ve)-.15 G 2.821(rt).15 G .321(he character at point, mo)-2.821 F .322 +(ving point forw)-.15 F .322(ard as well.)-.1 F 1.182 +(If point is at the end of the line, then this transposes the tw)144 +520.8 R 3.682(oc)-.1 G 1.182(haracters before point.)-3.682 F(Ne)6.182 E +-.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G(ar)144 532.8 Q(guments ha)-.18 E +.3 -.15(ve n)-.2 H 2.5(oe).15 G -.25(ff)-2.5 G(ect.).25 E F1 +(transpose\255w)108 544.8 Q(ords \(M\255t\))-.1 E F0 .023(Drag the w)144 +556.8 R .023(ord before point past the w)-.1 F .023(ord after point, mo) +-.1 F .023(ving point o)-.15 F -.15(ve)-.15 G 2.524(rt).15 G .024(hat w) +-2.524 F .024(ord as well.)-.1 F .024(If point)5.024 F +(is at the end of the line, this transposes the last tw)144 568.8 Q 2.5 +(ow)-.1 G(ords on the line.)-2.6 E F1(upcase\255w)108 580.8 Q +(ord \(M\255u\))-.1 E F0 1.699(Uppercase the current \(or follo)144 +592.8 R 1.698(wing\) w)-.25 F 4.198(ord. W)-.1 F 1.698(ith a ne)-.4 F +-.05(ga)-.15 G(ti).05 E 1.998 -.15(ve a)-.25 H -.18(rg).15 G 1.698 +(ument, uppercase the pre).18 F(vious)-.25 E -.1(wo)144 604.8 S(rd, b).1 +E(ut do not mo)-.2 E .3 -.15(ve p)-.15 H(oint.).15 E F1(do)108 616.8 Q +(wncase\255w)-.1 E(ord \(M\255l\))-.1 E F0(Lo)144 628.8 Q 1.647 +(wercase the current \(or follo)-.25 F 1.647(wing\) w)-.25 F 4.147 +(ord. W)-.1 F 1.648(ith a ne)-.4 F -.05(ga)-.15 G(ti).05 E 1.948 -.15 +(ve a)-.25 H -.18(rg).15 G 1.648(ument, lo).18 F 1.648(wercase the pre) +-.25 F(vious)-.25 E -.1(wo)144 640.8 S(rd, b).1 E(ut do not mo)-.2 E .3 +-.15(ve p)-.15 H(oint.).15 E F1(capitalize\255w)108 652.8 Q +(ord \(M\255c\))-.1 E F0 1.975(Capitalize the current \(or follo)144 +664.8 R 1.974(wing\) w)-.25 F 4.474(ord. W)-.1 F 1.974(ith a ne)-.4 F +-.05(ga)-.15 G(ti).05 E 2.274 -.15(ve a)-.25 H -.18(rg).15 G 1.974 +(ument, capitalize the pre).18 F(vious)-.25 E -.1(wo)144 676.8 S(rd, b) +.1 E(ut do not mo)-.2 E .3 -.15(ve p)-.15 H(oint.).15 E F1 -.1(ove)108 +688.8 S(rwrite\255mode).1 E F0 -.8(To)144 700.8 S .437(ggle o).8 F -.15 +(ve)-.15 G .437(rwrite mode.).15 F -.4(Wi)5.437 G .437(th an e).4 F .437 +(xplicit positi)-.15 F .738 -.15(ve n)-.25 H .438(umeric ar).15 F .438 +(gument, switches to o)-.18 F -.15(ve)-.15 G .438(rwrite mode.).15 F -.4 +(Wi)144 712.8 S .781(th an e).4 F .781(xplicit non-positi)-.15 F 1.081 +-.15(ve n)-.25 H .781(umeric ar).15 F .781 +(gument, switches to insert mode.)-.18 F .78(This command af)5.781 F +(fects)-.25 E(only)144 724.8 Q F1(emacs)4.394 E F0(mode;)4.394 E F1(vi) +4.394 E F0 1.894(mode does o)4.394 F -.15(ve)-.15 G 1.894(rwrite dif).15 +F(ferently)-.25 E 6.894(.E)-.65 G 1.894(ach call to)-6.894 F F4 -.37(re) +4.395 G(adline\(\)).37 E F0 1.895(starts in insert)4.395 F(GNU Bash 4.3) +72 768 Q(2014 February 2)141.79 E(43)190.95 E 0 Cg EP +%%Page: 44 44 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E 3.969(mode. In)144 84 R -.15(ove)3.969 G 1.469 +(rwrite mode, characters bound to).15 F/F1 10/Times-Bold@0 SF +(self\255insert)3.969 E F0 1.468(replace the te)3.969 F 1.468 +(xt at point rather than)-.15 F .957(pushing the te)144 96 R .957 +(xt to the right.)-.15 F .958(Characters bound to)5.957 F F1 +(backward\255delete\255char)3.458 E F0 .958(replace the character)3.458 +F(before point with a space.)144 108 Q(By def)5 E +(ault, this command is unbound.)-.1 E F1(Killing and Y)87 124.8 Q +(anking)-.85 E(kill\255line \(C\255k\))108 136.8 Q F0(Kill the te)144 +148.8 Q(xt from point to the end of the line.)-.15 E F1 +(backward\255kill\255line \(C\255x Rubout\))108 160.8 Q F0(Kill backw) +144 172.8 Q(ard to the be)-.1 E(ginning of the line.)-.15 E F1 +(unix\255line\255discard \(C\255u\))108 184.8 Q F0(Kill backw)144 196.8 +Q(ard from point to the be)-.1 E(ginning of the line.)-.15 E +(The killed te)5 E(xt is sa)-.15 E -.15(ve)-.2 G 2.5(do).15 G 2.5(nt) +-2.5 G(he kill-ring.)-2.5 E F1(kill\255whole\255line)108 208.8 Q F0 +(Kill all characters on the current line, no matter where point is.)144 +220.8 Q F1(kill\255w)108 232.8 Q(ord \(M\255d\))-.1 E F0 .729 +(Kill from point to the end of the current w)144 244.8 R .728 +(ord, or if between w)-.1 F .728(ords, to the end of the ne)-.1 F .728 +(xt w)-.15 F(ord.)-.1 E -.8(Wo)144 256.8 S +(rd boundaries are the same as those used by).8 E F1 -.25(fo)2.5 G +(rward\255w).25 E(ord)-.1 E F0(.)A F1(backward\255kill\255w)108 268.8 Q +(ord \(M\255Rubout\))-.1 E F0(Kill the w)144 280.8 Q(ord behind point.) +-.1 E -.8(Wo)5 G(rd boundaries are the same as those used by).8 E F1 +(backward\255w)2.5 E(ord)-.1 E F0(.)A F1(shell\255kill\255w)108 292.8 Q +(ord \(M\255d\))-.1 E F0 .728 +(Kill from point to the end of the current w)144 304.8 R .729 +(ord, or if between w)-.1 F .729(ords, to the end of the ne)-.1 F .729 +(xt w)-.15 F(ord.)-.1 E -.8(Wo)144 316.8 S +(rd boundaries are the same as those used by).8 E F1(shell\255f)2.5 E +(orward\255w)-.25 E(ord)-.1 E F0(.)A F1(shell\255backward\255kill\255w) +108 328.8 Q(ord \(M\255Rubout\))-.1 E F0 3.025(Kill the w)144 340.8 R +3.025(ord behind point.)-.1 F -.8(Wo)8.025 G 3.025 +(rd boundaries are the same as those used by).8 F F1(shell\255back-) +5.525 E(ward\255w)144 352.8 Q(ord)-.1 E F0(.)A F1(unix\255w)108 364.8 Q +(ord\255rubout \(C\255w\))-.1 E F0 .364(Kill the w)144 376.8 R .364 +(ord behind point, using white space as a w)-.1 F .365(ord boundary)-.1 +F 5.365(.T)-.65 G .365(he killed te)-5.365 F .365(xt is sa)-.15 F -.15 +(ve)-.2 G 2.865(do).15 G 2.865(nt)-2.865 G(he)-2.865 E(kill-ring.)144 +388.8 Q F1(unix\255\214lename\255rubout)108 400.8 Q F0 .167(Kill the w) +144 412.8 R .166 +(ord behind point, using white space and the slash character as the w) +-.1 F .166(ord boundaries.)-.1 F(The)5.166 E(killed te)144 424.8 Q +(xt is sa)-.15 E -.15(ve)-.2 G 2.5(do).15 G 2.5(nt)-2.5 G(he kill-ring.) +-2.5 E F1(delete\255horizontal\255space \(M\255\\\))108 436.8 Q F0 +(Delete all spaces and tabs around point.)144 448.8 Q F1(kill\255r)108 +460.8 Q(egion)-.18 E F0(Kill the te)144 472.8 Q(xt in the current re) +-.15 E(gion.)-.15 E F1(copy\255r)108 484.8 Q(egion\255as\255kill)-.18 E +F0(Cop)144 496.8 Q 2.5(yt)-.1 G(he te)-2.5 E(xt in the re)-.15 E +(gion to the kill b)-.15 E(uf)-.2 E(fer)-.25 E(.)-.55 E F1 +(copy\255backward\255w)108 508.8 Q(ord)-.1 E F0(Cop)144 520.8 Q 4.8(yt) +-.1 G 2.3(he w)-4.8 F 2.3(ord before point to the kill b)-.1 F(uf)-.2 E +(fer)-.25 E 7.301(.T)-.55 G 2.301(he w)-7.301 F 2.301 +(ord boundaries are the same as)-.1 F F1(back-)4.801 E(ward\255w)144 +532.8 Q(ord)-.1 E F0(.)A F1(copy\255f)108 544.8 Q(orward\255w)-.25 E +(ord)-.1 E F0(Cop)144 556.8 Q 4.508(yt)-.1 G 2.008(he w)-4.508 F 2.008 +(ord follo)-.1 F 2.008(wing point to the kill b)-.25 F(uf)-.2 E(fer)-.25 +E 7.007(.T)-.55 G 2.007(he w)-7.007 F 2.007 +(ord boundaries are the same as)-.1 F F1 -.25(fo)4.507 G -.37(r-).25 G +(ward\255w)144 568.8 Q(ord)-.1 E F0(.)A F1(yank \(C\255y\))108 580.8 Q +F0 -1(Ya)144 592.8 S(nk the top of the kill ring into the b)1 E(uf)-.2 E +(fer at point.)-.25 E F1(yank\255pop \(M\255y\))108 604.8 Q F0 +(Rotate the kill ring, and yank the ne)144 616.8 Q 2.5(wt)-.25 G 2.5 +(op. Only)-2.5 F -.1(wo)2.5 G(rks follo).1 E(wing)-.25 E F1(yank)2.5 E +F0(or)2.5 E F1(yank\255pop)2.5 E F0(.)A F1(Numeric Ar)87 633.6 Q +(guments)-.1 E(digit\255ar)108 645.6 Q +(gument \(M\2550, M\2551, ..., M\255\255\))-.1 E F0 .641 +(Add this digit to the ar)144 657.6 R .641 +(gument already accumulating, or start a ne)-.18 F 3.141(wa)-.25 G -.18 +(rg)-3.141 G 3.142(ument. M\255\255).18 F .642(starts a ne)3.142 F(g-) +-.15 E(ati)144 669.6 Q .3 -.15(ve a)-.25 H -.18(rg).15 G(ument.).18 E F1 +(uni)108 681.6 Q -.1(ve)-.1 G(rsal\255ar).1 E(gument)-.1 E F0 .779 +(This is another w)144 693.6 R .779(ay to specify an ar)-.1 F 3.279 +(gument. If)-.18 F .779(this command is follo)3.279 F .778 +(wed by one or more digits,)-.25 F 1.376 +(optionally with a leading minus sign, those digits de\214ne the ar)144 +705.6 R 3.876(gument. If)-.18 F 1.376(the command is fol-)3.876 F(lo)144 +717.6 Q 1.17(wed by digits, e)-.25 F -.15(xe)-.15 G(cuting).15 E F1(uni) +3.67 E -.1(ve)-.1 G(rsal\255ar).1 E(gument)-.1 E F0(ag)3.67 E 1.17 +(ain ends the numeric ar)-.05 F 1.17(gument, b)-.18 F 1.17(ut is other) +-.2 F(-)-.2 E .898(wise ignored.)144 729.6 R .898 +(As a special case, if this command is immediately follo)5.898 F .898 +(wed by a character that is)-.25 F(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(44)190.95 E 0 Cg EP +%%Page: 45 45 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .243(neither a digit or minus sign, the ar)144 84 R .243 +(gument count for the ne)-.18 F .243(xt command is multiplied by four) +-.15 F 5.242(.T)-.55 G(he)-5.242 E(ar)144 96 Q .378 +(gument count is initially one, so e)-.18 F -.15(xe)-.15 G .378 +(cuting this function the \214rst time mak).15 F .378(es the ar)-.1 F +.378(gument count)-.18 F(four)144 108 Q 2.5(,as)-.4 G(econd time mak) +-2.5 E(es the ar)-.1 E(gument count sixteen, and so on.)-.18 E/F1 10 +/Times-Bold@0 SF(Completing)87 124.8 Q(complete \(T)108 136.8 Q(AB\))-.9 +E F0 1.137(Attempt to perform completion on the te)144 148.8 R 1.137 +(xt before point.)-.15 F F1(Bash)6.137 E F0 1.137 +(attempts completion treating the)3.637 F(te)144 160.8 Q .532(xt as a v) +-.15 F .532(ariable \(if the te)-.25 F .532(xt be)-.15 F .533(gins with) +-.15 F F1($)3.033 E F0 .533(\), username \(if the te)B .533(xt be)-.15 F +.533(gins with)-.15 F F1(~)3.033 E F0 .533(\), hostname \(if the)B(te) +144 172.8 Q .702(xt be)-.15 F .702(gins with)-.15 F F1(@)3.202 E F0 .701 +(\), or command \(including aliases and functions\) in turn.)B .701 +(If none of these pro-)5.701 F +(duces a match, \214lename completion is attempted.)144 184.8 Q F1 +(possible\255completions \(M\255?\))108 196.8 Q F0 +(List the possible completions of the te)144 208.8 Q(xt before point.) +-.15 E F1(insert\255completions \(M\255*\))108 220.8 Q F0 .783 +(Insert all completions of the te)144 232.8 R .783 +(xt before point that w)-.15 F .783(ould ha)-.1 F 1.083 -.15(ve b)-.2 H +.783(een generated by).15 F F1(possible\255com-)3.283 E(pletions)144 +244.8 Q F0(.)A F1(menu\255complete)108 256.8 Q F0 .929(Similar to)144 +268.8 R F1(complete)3.429 E F0 3.429(,b)C .929(ut replaces the w)-3.629 +F .929(ord to be completed with a single match from the list of)-.1 F +1.193(possible completions.)144 280.8 R 1.193(Repeated e)6.193 F -.15 +(xe)-.15 G 1.193(cution of).15 F F1(menu\255complete)3.694 E F0 1.194 +(steps through the list of possible)3.694 F .829 +(completions, inserting each match in turn.)144 292.8 R .828 +(At the end of the list of completions, the bell is rung)5.828 F .727 +(\(subject to the setting of)144 304.8 R F1(bell\255style)3.227 E F0 +3.227(\)a)C .727(nd the original te)-3.227 F .727(xt is restored.)-.15 F +.727(An ar)5.727 F .727(gument of)-.18 F/F2 10/Times-Italic@0 SF(n)3.227 +E F0(mo)3.227 E -.15(ve)-.15 G(s).15 E F2(n)3.228 E F0 1.73 +(positions forw)144 316.8 R 1.73(ard in the list of matches; a ne)-.1 F +-.05(ga)-.15 G(ti).05 E 2.03 -.15(ve a)-.25 H -.18(rg).15 G 1.73 +(ument may be used to mo).18 F 2.03 -.15(ve b)-.15 H(ackw).15 E(ard)-.1 +E(through the list.)144 328.8 Q(This command is intended to be bound to) +5 E F1 -.9(TA)2.5 G(B).9 E F0 2.5(,b)C(ut is unbound by def)-2.7 E +(ault.)-.1 E F1(menu\255complete\255backward)108 340.8 Q F0 .82 +(Identical to)144 352.8 R F1(menu\255complete)3.32 E F0 3.32(,b)C .82 +(ut mo)-3.52 F -.15(ve)-.15 G 3.32(sb).15 G(ackw)-3.32 E .82 +(ard through the list of possible completions, as if)-.1 F F1 +(menu\255complete)144 364.8 Q F0(had been gi)2.5 E -.15(ve)-.25 G 2.5 +(nan).15 G -2.25 -.15(eg a)-2.5 H(ti).15 E .3 -.15(ve a)-.25 H -.18(rg) +.15 G 2.5(ument. This).18 F(command is unbound by def)2.5 E(ault.)-.1 E +F1(delete\255char\255or\255list)108 376.8 Q F0 .234 +(Deletes the character under the cursor if not at the be)144 388.8 R +.234(ginning or end of the line \(lik)-.15 F(e)-.1 E F1(delete\255char) +2.734 E F0(\).)A .425(If at the end of the line, beha)144 400.8 R -.15 +(ve)-.2 G 2.925(si).15 G .425(dentically to)-2.925 F F1 +(possible\255completions)2.925 E F0 5.425(.T)C .425 +(his command is unbound)-5.425 F(by def)144 412.8 Q(ault.)-.1 E F1 +(complete\255\214lename \(M\255/\))108 424.8 Q F0 +(Attempt \214lename completion on the te)144 436.8 Q(xt before point.) +-.15 E F1(possible\255\214lename\255completions \(C\255x /\))108 448.8 Q +F0(List the possible completions of the te)144 460.8 Q +(xt before point, treating it as a \214lename.)-.15 E F1 +(complete\255user)108 472.8 Q(name \(M\255~\))-.15 E F0 +(Attempt completion on the te)144 484.8 Q +(xt before point, treating it as a username.)-.15 E F1(possible\255user) +108 496.8 Q(name\255completions \(C\255x ~\))-.15 E F0 +(List the possible completions of the te)144 508.8 Q +(xt before point, treating it as a username.)-.15 E F1(complete\255v)108 +520.8 Q(ariable \(M\255$\))-.1 E F0(Attempt completion on the te)144 +532.8 Q(xt before point, treating it as a shell v)-.15 E(ariable.)-.25 E +F1(possible\255v)108 544.8 Q(ariable\255completions \(C\255x $\))-.1 E +F0(List the possible completions of the te)144 556.8 Q +(xt before point, treating it as a shell v)-.15 E(ariable.)-.25 E F1 +(complete\255hostname \(M\255@\))108 568.8 Q F0 +(Attempt completion on the te)144 580.8 Q +(xt before point, treating it as a hostname.)-.15 E F1 +(possible\255hostname\255completions \(C\255x @\))108 592.8 Q F0 +(List the possible completions of the te)144 604.8 Q +(xt before point, treating it as a hostname.)-.15 E F1 +(complete\255command \(M\255!\))108 616.8 Q F0 .581 +(Attempt completion on the te)144 628.8 R .581 +(xt before point, treating it as a command name.)-.15 F .58 +(Command comple-)5.58 F .715(tion attempts to match the te)144 640.8 R +.715(xt ag)-.15 F .715(ainst aliases, reserv)-.05 F .715(ed w)-.15 F +.715(ords, shell functions, shell b)-.1 F .715(uiltins, and)-.2 F +(\214nally e)144 652.8 Q -.15(xe)-.15 G +(cutable \214lenames, in that order).15 E(.)-.55 E F1 +(possible\255command\255completions \(C\255x !\))108 664.8 Q F0 +(List the possible completions of the te)144 676.8 Q +(xt before point, treating it as a command name.)-.15 E F1 +(dynamic\255complete\255history \(M\255T)108 688.8 Q(AB\))-.9 E F0 .425 +(Attempt completion on the te)144 700.8 R .425 +(xt before point, comparing the te)-.15 F .425(xt ag)-.15 F .424 +(ainst lines from the history list)-.05 F +(for possible completion matches.)144 712.8 Q(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(45)190.95 E 0 Cg EP +%%Page: 46 46 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(dab)108 84 Q(br)-.1 E -.15(ev)-.18 G +(\255expand).15 E F0 .61(Attempt menu completion on the te)144 96 R .611 +(xt before point, comparing the te)-.15 F .611(xt ag)-.15 F .611 +(ainst lines from the his-)-.05 F +(tory list for possible completion matches.)144 108 Q F1 +(complete\255into\255braces \(M\255{\))108 120 Q F0 .4(Perform \214lena\ +me completion and insert the list of possible completions enclosed with\ +in braces so)144 132 R(the list is a)144 144 Q -.25(va)-.2 G +(ilable to the shell \(see).25 E F1(Brace Expansion)2.5 E F0(abo)2.5 E +-.15(ve)-.15 G(\).).15 E F1 -.25(Ke)87 160.8 S(yboard Macr).25 E(os)-.18 +E(start\255kbd\255macr)108 172.8 Q 2.5(o\()-.18 G(C\255x \()-2.5 E(\)) +.833 E F0(Be)144 184.8 Q(gin sa)-.15 E +(ving the characters typed into the current k)-.2 E -.15(ey)-.1 G +(board macro.).15 E F1(end\255kbd\255macr)108 196.8 Q 2.5(o\()-.18 G +(C\255x \))-2.5 E(\)).833 E F0(Stop sa)144 208.8 Q +(ving the characters typed into the current k)-.2 E -.15(ey)-.1 G +(board macro and store the de\214nition.).15 E F1 +(call\255last\255kbd\255macr)108 220.8 Q 2.5(o\()-.18 G(C\255x e\))-2.5 +E F0(Re-e)144 232.8 Q -.15(xe)-.15 G .999(cute the last k).15 F -.15(ey) +-.1 G .999(board macro de\214ned, by making the characters in the macro\ + appear as if).15 F(typed at the k)144 244.8 Q -.15(ey)-.1 G(board.).15 +E F1(print\255last\255kbd\255macr)108 256.8 Q 2.5(o\()-.18 G(\))-2.5 E +F0(Print the last k)144 268.8 Q -.15(ey)-.1 G +(board macro de\214ned in a format suitable for the).15 E/F2 10 +/Times-Italic@0 SF(inputr)2.5 E(c)-.37 E F0(\214le.)2.5 E F1 +(Miscellaneous)87 285.6 Q -.18(re)108 297.6 S.18 E +(ead\255init\255\214le \(C\255x C\255r\))-.18 E F0 1.777 +(Read in the contents of the)144 309.6 R F2(inputr)4.277 E(c)-.37 E F0 +1.776(\214le, and incorporate an)4.276 F 4.276(yb)-.15 G 1.776 +(indings or v)-4.276 F 1.776(ariable assignments)-.25 F(found there.)144 +321.6 Q F1(abort \(C\255g\))108 333.6 Q F0 3.248 +(Abort the current editing command and ring the terminal')144 345.6 R +5.749(sb)-.55 G 3.249(ell \(subject to the setting of)-5.749 F F1 +(bell\255style)144 357.6 Q F0(\).)A F1(do\255upper)108 369.6 Q +(case\255v)-.18 E(ersion \(M\255a, M\255b, M\255)-.1 E F2(x)A F1 2.5(,.) +C(..\))-2.5 E F0 1.756(If the meta\214ed character)144 381.6 R F2(x) +4.256 E F0 1.755(is lo)4.256 F 1.755 +(wercase, run the command that is bound to the corresponding)-.25 F +(uppercase character)144 393.6 Q(.)-.55 E F1(pr)108 405.6 Q +(e\214x\255meta \(ESC\))-.18 E F0(Metafy the ne)144 417.6 Q +(xt character typed.)-.15 E/F3 9/Times-Bold@0 SF(ESC)5 E F1(f)2.25 E F0 +(is equi)2.5 E -.25(va)-.25 G(lent to).25 E F1(Meta\255f)2.5 E F0(.)A F1 +(undo \(C\255_, C\255x C\255u\))108 429.6 Q F0 +(Incremental undo, separately remembered for each line.)144 441.6 Q F1 +-2.29 -.18(re v)108 453.6 T(ert\255line \(M\255r\)).08 E F0 1.095 +(Undo all changes made to this line.)144 465.6 R 1.095(This is lik)6.095 +F 3.595(ee)-.1 G -.15(xe)-3.745 G 1.095(cuting the).15 F F1(undo)3.595 E +F0 1.095(command enough times to)3.595 F +(return the line to its initial state.)144 477.6 Q F1 +(tilde\255expand \(M\255&\))108 489.6 Q F0(Perform tilde e)144 501.6 Q +(xpansion on the current w)-.15 E(ord.)-.1 E F1 +(set\255mark \(C\255@, M\255\))108 513.6 Q F0 +(Set the mark to the point.)144 525.6 Q(If a numeric ar)5 E +(gument is supplied, the mark is set to that position.)-.18 E F1 +(exchange\255point\255and\255mark \(C\255x C\255x\))108 537.6 Q F0(Sw) +144 549.6 Q .283(ap the point with the mark.)-.1 F .283 +(The current cursor position is set to the sa)5.283 F -.15(ve)-.2 G +2.782(dp).15 G .282(osition, and the old)-2.782 F(cursor position is sa) +144 561.6 Q -.15(ve)-.2 G 2.5(da).15 G 2.5(st)-2.5 G(he mark.)-2.5 E F1 +(character\255sear)108 573.6 Q(ch \(C\255]\))-.18 E F0 3.035(Ac)144 +585.6 S .535(haracter is read and point is mo)-3.035 F -.15(ve)-.15 G +3.035(dt).15 G 3.035(ot)-3.035 G .535(he ne)-3.035 F .535 +(xt occurrence of that character)-.15 F 5.536(.A)-.55 G(ne)-2.5 E -.05 +(ga)-.15 G(ti).05 E .836 -.15(ve c)-.25 H(ount).15 E(searches for pre) +144 597.6 Q(vious occurrences.)-.25 E F1(character\255sear)108 609.6 Q +(ch\255backward \(M\255C\255]\))-.18 E F0 3.544(Ac)144 621.6 S 1.044 +(haracter is read and point is mo)-3.544 F -.15(ve)-.15 G 3.544(dt).15 G +3.544(ot)-3.544 G 1.044(he pre)-3.544 F 1.044 +(vious occurrence of that character)-.25 F 6.043(.A)-.55 G(ne)-2.5 E +-.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G +(count searches for subsequent occurrences.)144 633.6 Q F1 +(skip\255csi\255sequence)108 645.6 Q F0 1.826 +(Read enough characters to consume a multi-k)144 657.6 R 2.126 -.15 +(ey s)-.1 H 1.827(equence such as those de\214ned for k).15 F -.15(ey) +-.1 G 4.327(sl).15 G(ik)-4.327 E(e)-.1 E .791(Home and End.)144 669.6 R +.791(Such sequences be)5.791 F .791 +(gin with a Control Sequence Indicator \(CSI\), usually ESC\255[.)-.15 F +.331(If this sequence is bound to "\\[", k)144 681.6 R -.15(ey)-.1 G +2.831(sp).15 G .331(roducing such sequences will ha)-2.831 F .632 -.15 +(ve n)-.2 H 2.832(oe).15 G -.25(ff)-2.832 G .332(ect unless e).25 F +(xplic-)-.15 E .026(itly bound to a readline command, instead of insert\ +ing stray characters into the editing b)144 693.6 R(uf)-.2 E(fer)-.25 E +5.026(.T)-.55 G(his)-5.026 E(is unbound by def)144 705.6 Q(ault, b)-.1 E +(ut usually bound to ESC\255[.)-.2 E(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(46)190.95 E 0 Cg EP +%%Page: 47 47 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(insert\255comment \(M\255#\))108 84 Q F0 +-.4(Wi)144 96 S .48(thout a numeric ar).4 F .48(gument, the v)-.18 F +.481(alue of the readline)-.25 F F1(comment\255begin)2.981 E F0 -.25(va) +2.981 G .481(riable is inserted at the).25 F(be)144 108 Q .098 +(ginning of the current line.)-.15 F .098(If a numeric ar)5.098 F .097 +(gument is supplied, this command acts as a toggle:)-.18 F(if)5.097 E +.321(the characters at the be)144 120 R .321 +(ginning of the line do not match the v)-.15 F .321(alue of)-.25 F F1 +(comment\255begin)2.821 E F0 2.822(,t)C .322(he v)-2.822 F .322(alue is) +-.25 F .832(inserted, otherwise the characters in)144 132 R F1 +(comment\255begin)3.332 E F0 .831(are deleted from the be)3.332 F .831 +(ginning of the line.)-.15 F 1.468 +(In either case, the line is accepted as if a ne)144 144 R 1.468 +(wline had been typed.)-.25 F 1.469(The def)6.469 F 1.469(ault v)-.1 F +1.469(alue of)-.25 F F1(com-)3.969 E(ment\255begin)144 156 Q F0 .84 +(causes this command to mak)3.34 F 3.339(et)-.1 G .839 +(he current line a shell comment.)-3.339 F .839(If a numeric ar)5.839 F +(gu-)-.18 E(ment causes the comment character to be remo)144 168 Q -.15 +(ve)-.15 G(d, the line will be e).15 E -.15(xe)-.15 G +(cuted by the shell.).15 E F1(glob\255complete\255w)108 180 Q +(ord \(M\255g\))-.1 E F0 .791(The w)144 192 R .791 +(ord before point is treated as a pattern for pathname e)-.1 F .792 +(xpansion, with an asterisk implicitly)-.15 F 2.5(appended. This)144 204 +R(pattern is used to generate a list of matching \214lenames for possib\ +le completions.)2.5 E F1(glob\255expand\255w)108 216 Q(ord \(C\255x *\)) +-.1 E F0 .176(The w)144 228 R .176 +(ord before point is treated as a pattern for pathname e)-.1 F .176 +(xpansion, and the list of matching \214le-)-.15 F .516 +(names is inserted, replacing the w)144 240 R 3.016(ord. If)-.1 F 3.016 +(an)3.016 G .516(umeric ar)-3.016 F .516 +(gument is supplied, an asterisk is appended)-.18 F(before pathname e) +144 252 Q(xpansion.)-.15 E F1(glob\255list\255expansions \(C\255x g\)) +108 264 Q F0 .923(The list of e)144 276 R .923(xpansions that w)-.15 F +.923(ould ha)-.1 F 1.223 -.15(ve b)-.2 H .923(een generated by).15 F F1 +(glob\255expand\255w)3.423 E(ord)-.1 E F0 .923(is displayed, and)3.423 F +.872(the line is redra)144 288 R 3.372(wn. If)-.15 F 3.372(an)3.372 G +.872(umeric ar)-3.372 F .872 +(gument is supplied, an asterisk is appended before pathname)-.18 F -.15 +(ex)144 300 S(pansion.).15 E F1(dump\255functions)108 312 Q F0 .627 +(Print all of the functions and their k)144 324 R .927 -.15(ey b)-.1 H +.626(indings to the readline output stream.).15 F .626(If a numeric ar) +5.626 F(gu-)-.18 E +(ment is supplied, the output is formatted in such a w)144 336 Q +(ay that it can be made part of an)-.1 E/F2 10/Times-Italic@0 SF(inputr) +2.5 E(c)-.37 E F0(\214le.)2.5 E F1(dump\255v)108 348 Q(ariables)-.1 E F0 +1.799(Print all of the settable readline v)144 360 R 1.799 +(ariables and their v)-.25 F 1.8(alues to the readline output stream.) +-.25 F 1.8(If a)6.8 F .305(numeric ar)144 372 R .304 +(gument is supplied, the output is formatted in such a w)-.18 F .304 +(ay that it can be made part of an)-.1 F F2(inputr)144 384 Q(c)-.37 E F0 +(\214le.)2.5 E F1(dump\255macr)108 396 Q(os)-.18 E F0 .592 +(Print all of the readline k)144 408 R .892 -.15(ey s)-.1 H .592 +(equences bound to macros and the strings the).15 F 3.093(yo)-.15 G +3.093(utput. If)-3.093 F 3.093(an)3.093 G(umeric)-3.093 E(ar)144 420 Q +.528(gument is supplied, the output is formatted in such a w)-.18 F .528 +(ay that it can be made part of an)-.1 F F2(inputr)3.027 E(c)-.37 E F0 +(\214le.)144 432 Q F1(display\255shell\255v)108 444 Q +(ersion \(C\255x C\255v\))-.1 E F0(Display v)144 456 Q +(ersion information about the current instance of)-.15 E F1(bash)2.5 E +F0(.)A F1(Pr)87 472.8 Q(ogrammable Completion)-.18 E F0 .146(When w)108 +484.8 R .147(ord completion is attempted for an ar)-.1 F .147 +(gument to a command for which a completion speci\214cation \(a)-.18 F +F2(compspec)108 496.8 Q F0 3.829(\)h)C 1.329 +(as been de\214ned using the)-3.829 F F1(complete)3.829 E F0 -.2(bu) +3.829 G 1.329(iltin \(see).2 F/F3 9/Times-Bold@0 SF 1.329(SHELL B)3.829 +F(UIL)-.09 E 1.329(TIN COMMANDS)-.828 F F0(belo)3.579 E 1.328(w\), the) +-.25 F(programmable completion f)108 508.8 Q(acilities are in)-.1 E -.2 +(vo)-.4 G -.1(ke).2 G(d.).1 E .497 +(First, the command name is identi\214ed.)108 525.6 R .497 +(If the command w)5.497 F .498 +(ord is the empty string \(completion attempted at)-.1 F .234(the be)108 +537.6 R .233(ginning of an empty line\), an)-.15 F 2.733(yc)-.15 G .233 +(ompspec de\214ned with the)-2.733 F F12.733 E F0 .233(option to) +2.733 F F1(complete)2.733 E F0 .233(is used.)2.733 F .233(If a comp-) +5.233 F .481(spec has been de\214ned for that command, the compspec is \ +used to generate the list of possible completions)108 549.6 R .823 +(for the w)108 561.6 R 3.323(ord. If)-.1 F .823(the command w)3.323 F +.822(ord is a full pathname, a compspec for the full pathname is search\ +ed for)-.1 F 2.866(\214rst. If)108 573.6 R .367(no compspec is found fo\ +r the full pathname, an attempt is made to \214nd a compspec for the po\ +rtion)2.866 F(follo)108 585.6 Q .299(wing the \214nal slash.)-.25 F .298 +(If those searches do not result in a compspec, an)5.299 F 2.798(yc)-.15 +G .298(ompspec de\214ned with the)-2.798 F F12.798 E F0(option to) +108 597.6 Q F1(complete)2.5 E F0(is used as the def)2.5 E(ault.)-.1 E +.817(Once a compspec has been found, it is used to generate the list of\ + matching w)108 614.4 R 3.317(ords. If)-.1 F 3.317(ac)3.317 G .817 +(ompspec is not)-3.317 F(found, the def)108 626.4 Q(ault)-.1 E F1(bash) +2.5 E F0(completion as described abo)2.5 E .3 -.15(ve u)-.15 H(nder).15 +E F1(Completing)2.5 E F0(is performed.)2.5 E .464 +(First, the actions speci\214ed by the compspec are used.)108 643.2 R +.463(Only matches which are pre\214x)5.464 F .463(ed by the w)-.15 F +.463(ord being)-.1 F .595(completed are returned.)108 655.2 R .595 +(When the)5.595 F F13.095 E F0(or)3.095 E F13.095 E F0 .596 +(option is used for \214lename or directory name completion, the)3.095 F +(shell v)108 667.2 Q(ariable)-.25 E F3(FIGNORE)2.5 E F0 +(is used to \214lter the matches.)2.25 E(An)108 684 Q 4.084(yc)-.15 G +1.584(ompletions speci\214ed by a pathname e)-4.084 F 1.584 +(xpansion pattern to the)-.15 F F14.084 E F0 1.584 +(option are generated ne)4.084 F 4.084(xt. The)-.15 F -.1(wo)108 696 S +.554(rds generated by the pattern need not match the w).1 F .555 +(ord being completed.)-.1 F(The)5.555 E F3(GLOBIGNORE)3.055 E F0 .555 +(shell v)2.805 F(ari-)-.25 E +(able is not used to \214lter the matches, b)108 708 Q(ut the)-.2 E F3 +(FIGNORE)2.5 E F0 -.25(va)2.25 G(riable is used.).25 E(Ne)108 724.8 Q +.321(xt, the string speci\214ed as the ar)-.15 F .321(gument to the)-.18 +F F12.821 E F0 .32(option is considered.)2.821 F .32 +(The string is \214rst split using the)5.32 F(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(47)190.95 E 0 Cg EP +%%Page: 48 48 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .412(characters in the)108 84 R/F1 9/Times-Bold@0 SF(IFS)2.912 E +F0 .412(special v)2.662 F .412(ariable as delimiters.)-.25 F .412 +(Shell quoting is honored.)5.412 F .413(Each w)5.412 F .413 +(ord is then e)-.1 F(xpanded)-.15 E .092(using brace e)108 96 R .092 +(xpansion, tilde e)-.15 F .092(xpansion, parameter and v)-.15 F .092 +(ariable e)-.25 F .091(xpansion, command substitution, and arith-)-.15 F +1.396(metic e)108 108 R 1.396(xpansion, as described abo)-.15 F 1.696 +-.15(ve u)-.15 H(nder).15 E F1(EXP)3.896 E(ANSION)-.666 E/F2 9 +/Times-Roman@0 SF(.)A F0 1.396 +(The results are split using the rules described)5.896 F(abo)108 120 Q +.51 -.15(ve u)-.15 H(nder).15 E/F3 10/Times-Bold@0 SF -.75(Wo)2.71 G .21 +(rd Splitting).75 F F0 5.21(.T)C .209(he results of the e)-5.21 F .209 +(xpansion are pre\214x-matched ag)-.15 F .209(ainst the w)-.05 F .209 +(ord being com-)-.1 F(pleted, and the matching w)108 132 Q +(ords become the possible completions.)-.1 E 1.237 +(After these matches ha)108 148.8 R 1.537 -.15(ve b)-.2 H 1.237 +(een generated, an).15 F 3.737(ys)-.15 G 1.238 +(hell function or command speci\214ed with the)-3.737 F F33.738 E +F0(and)3.738 E F33.738 E F0 3.376(options is in)108 160.8 R -.2 +(vo)-.4 G -.1(ke).2 G 5.875(d. When).1 F 3.375 +(the command or function is in)5.875 F -.2(vo)-.4 G -.1(ke).2 G 3.375 +(d, the).1 F F1(COMP_LINE)5.875 E F2(,)A F1(COMP_POINT)5.625 E F2(,)A F1 +(COMP_KEY)108 172.8 Q F2(,)A F0(and)2.407 E F1(COMP_TYPE)2.657 E F0 -.25 +(va)2.407 G .157(riables are assigned v).25 F .157 +(alues as described abo)-.25 F .457 -.15(ve u)-.15 H(nder).15 E F3 .158 +(Shell V)2.658 F(ariables)-.92 E F0 5.158(.I)C(f)-5.158 E 3.486(as)108 +184.8 S .986(hell function is being in)-3.486 F -.2(vo)-.4 G -.1(ke).2 G +.986(d, the).1 F F1(COMP_W)3.486 E(ORDS)-.09 E F0(and)3.236 E F1 +(COMP_CW)3.486 E(ORD)-.09 E F0 -.25(va)3.236 G .986 +(riables are also set.).25 F(When)5.985 E .346 +(the function or command is in)108 196.8 R -.2(vo)-.4 G -.1(ke).2 G .346 +(d, the \214rst ar).1 F .346(gument \()-.18 F F3($1)A F0 2.847(\)i)C +2.847(st)-2.847 G .347(he name of the command whose ar)-2.847 F(guments) +-.18 E .264(are being completed, the second ar)108 208.8 R .264 +(gument \()-.18 F F3($2)A F0 2.764(\)i)C 2.764(st)-2.764 G .264(he w) +-2.764 F .263(ord being completed, and the third ar)-.1 F .263 +(gument \()-.18 F F3($3)A F0 2.763(\)i)C(s)-2.763 E .628(the w)108 220.8 +R .628(ord preceding the w)-.1 F .629 +(ord being completed on the current command line.)-.1 F .629 +(No \214ltering of the generated)5.629 F .715(completions ag)108 232.8 R +.715(ainst the w)-.05 F .714(ord being completed is performed; the func\ +tion or command has complete free-)-.1 F(dom in generating the matches.) +108 244.8 Q(An)108 261.6 Q 2.937(yf)-.15 G .437 +(unction speci\214ed with)-2.937 F F32.937 E F0 .437(is in)2.937 F +-.2(vo)-.4 G -.1(ke).2 G 2.937<648c>.1 G 2.937(rst. The)-2.937 F .437 +(function may use an)2.937 F 2.937(yo)-.15 G 2.937(ft)-2.937 G .437 +(he shell f)-2.937 F .438(acilities, including)-.1 F(the)108 273.6 Q F3 +(compgen)2.957 E F0 -.2(bu)2.957 G .457(iltin described belo).2 F 1.756 +-.65(w, t)-.25 H 2.956(og).65 G .456(enerate the matches.)-2.956 F .456 +(It must put the possible completions in the)5.456 F F1(COMPREPL)108 +285.6 Q(Y)-.828 E F0(array v)2.25 E(ariable, one per array element.)-.25 +E(Ne)108 302.4 Q .08(xt, an)-.15 F 2.58(yc)-.15 G .08 +(ommand speci\214ed with the)-2.58 F F32.58 E F0 .081 +(option is in)2.581 F -.2(vo)-.4 G -.1(ke).2 G 2.581(di).1 G 2.581(na) +-2.581 G 2.581(ne)-2.581 G -.4(nv)-2.581 G .081(ironment equi).4 F -.25 +(va)-.25 G .081(lent to command sub-).25 F 2.859(stitution. It)108 314.4 +R .359(should print a list of completions, one per line, to the standar\ +d output.)2.859 F .358(Backslash may be used)5.359 F(to escape a ne)108 +326.4 Q(wline, if necessary)-.25 E(.)-.65 E .376 +(After all of the possible completions are generated, an)108 343.2 R +2.877<798c>-.15 G .377(lter speci\214ed with the)-2.877 F F32.877 +E F0 .377(option is applied to the)2.877 F 3.182(list. The)108 355.2 R +.682(\214lter is a pattern as used for pathname e)3.182 F .681 +(xpansion; a)-.15 F F3(&)3.181 E F0 .681 +(in the pattern is replaced with the te)3.181 F .681(xt of)-.15 F .522 +(the w)108 367.2 R .522(ord being completed.)-.1 F 3.022(Al)5.522 G +(iteral)-3.022 E F3(&)3.022 E F0 .523 +(may be escaped with a backslash; the backslash is remo)3.022 F -.15(ve) +-.15 G 3.023(db).15 G(efore)-3.023 E .85(attempting a match.)108 379.2 R +(An)5.85 E 3.35(yc)-.15 G .849 +(ompletion that matches the pattern will be remo)-3.35 F -.15(ve)-.15 G +3.349(df).15 G .849(rom the list.)-3.349 F 3.349(Al)5.849 G(eading) +-3.349 E F3(!)3.349 E F0(ne)108 391.2 Q -.05(ga)-.15 G +(tes the pattern; in this case an).05 E 2.5(yc)-.15 G +(ompletion not matching the pattern will be remo)-2.5 E -.15(ve)-.15 G +(d.).15 E(Finally)108 408 Q 3.086(,a)-.65 G .886 -.15(ny p)-3.086 H .586 +(re\214x and suf).15 F .587(\214x speci\214ed with the)-.25 F F3 +3.087 E F0(and)3.087 E F33.087 E F0 .587 +(options are added to each member of the com-)3.087 F(pletion list, and\ + the result is returned to the readline completion code as the list of \ +possible completions.)108 420 Q .247(If the pre)108 436.8 R .247 +(viously-applied actions do not generate an)-.25 F 2.747(ym)-.15 G .247 +(atches, and the)-2.747 F F3 .247(\255o dir)2.747 F(names)-.15 E F0 .247 +(option w)2.747 F .246(as supplied to)-.1 F F3(complete)108 448.8 Q F0 +(when the compspec w)2.5 E +(as de\214ned, directory name completion is attempted.)-.1 E .461 +(If the)108 465.6 R F3 .462(\255o plusdirs)2.961 F F0 .462(option w) +2.962 F .462(as supplied to)-.1 F F3(complete)2.962 E F0 .462 +(when the compspec w)2.962 F .462(as de\214ned, directory name com-)-.1 +F(pletion is attempted and an)108 477.6 Q 2.5(ym)-.15 G +(atches are added to the results of the other actions.)-2.5 E .56 +(By def)108 494.4 R .56(ault, if a compspec is found, whate)-.1 F -.15 +(ve)-.25 G 3.06(ri).15 G 3.06(tg)-3.06 G .559 +(enerates is returned to the completion code as the full set)-3.06 F +.631(of possible completions.)108 506.4 R .631(The def)5.631 F(ault)-.1 +E F3(bash)3.131 E F0 .631 +(completions are not attempted, and the readline def)3.131 F .632 +(ault of \214le-)-.1 F .559(name completion is disabled.)108 518.4 R +.559(If the)5.559 F F3 .559(\255o bashdefault)3.059 F F0 .559(option w) +3.059 F .559(as supplied to)-.1 F F3(complete)3.058 E F0 .558 +(when the compspec)3.058 F -.1(wa)108 530.4 S 3.171(sd).1 G .671 +(e\214ned, the)-3.171 F F3(bash)3.171 E F0(def)3.171 E .671 +(ault completions are attempted if the compspec generates no matches.) +-.1 F .672(If the)5.672 F F33.172 E(default)108 542.4 Q F0 1.207 +(option w)3.707 F 1.207(as supplied to)-.1 F F3(complete)3.707 E F0 +1.207(when the compspec w)3.707 F 1.207(as de\214ned, readline')-.1 F +3.707(sd)-.55 G(ef)-3.707 E 1.206(ault completion)-.1 F +(will be performed if the compspec \(and, if attempted, the def)108 +554.4 Q(ault)-.1 E F3(bash)2.5 E F0(completions\) generate no matches.) +2.5 E .245(When a compspec indicates that directory name completion is \ +desired, the programmable completion func-)108 571.2 R .633(tions force\ + readline to append a slash to completed names which are symbolic links\ + to directories, subject)108 583.2 R 2.761(to the v)108 595.2 R 2.761 +(alue of the)-.25 F F3(mark\255dir)5.261 E(ectories)-.18 E F0 2.761 +(readline v)5.261 F 2.761(ariable, re)-.25 F -.05(ga)-.15 G 2.762 +(rdless of the setting of the).05 F F3(mark-sym-)5.262 E(link)108 607.2 +Q(ed\255dir)-.1 E(ectories)-.18 E F0(readline v)2.5 E(ariable.)-.25 E +.191(There is some support for dynamically modifying completions.)108 +624 R .19(This is most useful when used in combina-)5.191 F 1.33 +(tion with a def)108 636 R 1.33(ault completion speci\214ed with)-.1 F +F3 1.33(complete -D)3.83 F F0 6.33(.I)C(t')-6.33 E 3.83(sp)-.55 G 1.33 +(ossible for shell functions e)-3.83 F -.15(xe)-.15 G 1.33(cuted as).15 +F .93(completion handlers to indicate that completion should be retried\ + by returning an e)108 648 R .93(xit status of 124.)-.15 F .93(If a)5.93 +F .1(shell function returns 124, and changes the compspec associated wi\ +th the command on which completion is)108 660 R .666 +(being attempted \(supplied as the \214rst ar)108 672 R .665 +(gument when the function is e)-.18 F -.15(xe)-.15 G .665 +(cuted\), programmable completion).15 F .083(restarts from the be)108 +684 R .084(ginning, with an attempt to \214nd a ne)-.15 F 2.584(wc)-.25 +G .084(ompspec for that command.)-2.584 F .084(This allo)5.084 F .084 +(ws a set of)-.25 F(completions to be b)108 696 Q(uilt dynamically as c\ +ompletion is attempted, rather than being loaded all at once.)-.2 E -.15 +(Fo)108 712.8 S 2.637(ri).15 G .137 +(nstance, assuming that there is a library of compspecs, each k)-2.637 F +.137(ept in a \214le corresponding to the name of)-.1 F +(the command, the follo)108 724.8 Q(wing def)-.25 E +(ault completion function w)-.1 E(ould load completions dynamically:)-.1 +E(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(48)190.95 E 0 Cg EP +%%Page: 49 49 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Courier@0 SF(_completion_loader\(\))108 84 Q({)108 96 Q 6 +(.")144 108 S +(/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124)-6 E(})108 +120 Q(complete -D -F _completion_loader -o bashdefault -o default)108 +132 Q/F2 10.95/Times-Bold@0 SF(HIST)72 160.8 Q(OR)-.197 E(Y)-.383 E F0 +.371(When the)108 172.8 R/F3 10/Times-Bold@0 SF .371(\255o history)2.871 +F F0 .371(option to the)2.871 F F3(set)2.872 E F0 -.2(bu)2.872 G .372 +(iltin is enabled, the shell pro).2 F .372(vides access to the)-.15 F/F4 +10/Times-Italic@0 SF .372(command history)2.872 F F0(,)A .305 +(the list of commands pre)108 184.8 R .305(viously typed.)-.25 F .305 +(The v)5.305 F .304(alue of the)-.25 F/F5 9/Times-Bold@0 SF(HISTSIZE) +2.804 E F0 -.25(va)2.554 G .304(riable is used as the number of com-).25 +F .429(mands to sa)108 196.8 R .729 -.15(ve i)-.2 H 2.929(nah).15 G .429 +(istory list.)-2.929 F .429(The te)5.429 F .429(xt of the last)-.15 F F5 +(HISTSIZE)2.93 E F0 .43(commands \(def)2.68 F .43(ault 500\) is sa)-.1 F +-.15(ve)-.2 G 2.93(d. The).15 F(shell)2.93 E .287 +(stores each command in the history list prior to parameter and v)108 +208.8 R .287(ariable e)-.25 F .287(xpansion \(see)-.15 F F5(EXP)2.787 E +(ANSION)-.666 E F0(abo)2.537 E -.15(ve)-.15 G(\)).15 E -.2(bu)108 220.8 +S 4.065(ta).2 G 1.565(fter history e)-4.065 F 1.565 +(xpansion is performed, subject to the v)-.15 F 1.565 +(alues of the shell v)-.25 F(ariables)-.25 E F5(HISTIGNORE)4.065 E F0 +(and)3.816 E F5(HISTCONTR)108 232.8 Q(OL)-.27 E/F6 9/Times-Roman@0 SF(.) +A F0 .082 +(On startup, the history is initialized from the \214le named by the v) +108 249.6 R(ariable)-.25 E F5(HISTFILE)2.582 E F0(\(def)2.332 E(ault)-.1 +E F4(~/.bash_history)2.582 E F0(\).)A .315(The \214le named by the v)108 +261.6 R .315(alue of)-.25 F F5(HISTFILE)2.815 E F0 .315 +(is truncated, if necessary)2.565 F 2.815(,t)-.65 G 2.815(oc)-2.815 G +.315(ontain no more than the number of)-2.815 F .659 +(lines speci\214ed by the v)108 273.6 R .659(alue of)-.25 F F5 +(HISTFILESIZE)3.158 E F6(.)A F0(If)5.158 E F3(HISTFILESIZE)3.158 E F0 +.658(is unset, or set to null, a non-numeric)3.158 F -.25(va)108 285.6 S +.142(lue, or a numeric v).25 F .142 +(alue less than zero, the history \214le is not truncated.)-.25 F .142 +(When the history \214le is read, lines)5.142 F(be)108 297.6 Q 1.605 +(ginning with the history comment character follo)-.15 F 1.604 +(wed immediately by a digit are interpreted as time-)-.25 F .098 +(stamps for the preceding history line.)108 309.6 R .098 +(These timestamps are optionally displayed depending on the v)5.098 F +.098(alue of)-.25 F(the)108 321.6 Q F5(HISTTIMEFORMA)3.559 E(T)-.855 E +F0 -.25(va)3.309 G 3.559(riable. When).25 F 3.559(as)3.559 G 1.059 +(hell with history enabled e)-3.559 F 1.059(xits, the last)-.15 F F5 +($HISTSIZE)3.559 E F0 1.058(lines are)3.309 F .158 +(copied from the history list to)108 333.6 R F5($HISTFILE)2.658 E F6(.)A +F0 .158(If the)4.658 F F3(histappend)2.658 E F0 .159 +(shell option is enabled \(see the description of)2.659 F F3(shopt)108 +345.6 Q F0(under)2.582 E F5 .082(SHELL B)2.582 F(UIL)-.09 E .082 +(TIN COMMANDS)-.828 F F0(belo)2.332 E .082 +(w\), the lines are appended to the history \214le, otherwise the)-.25 F +.196(history \214le is o)108 357.6 R -.15(ve)-.15 G 2.696(rwritten. If) +.15 F F5(HISTFILE)2.696 E F0 .197(is unset, or if the history \214le is\ + unwritable, the history is not sa)2.446 F -.15(ve)-.2 G(d.).15 E .584 +(If the)108 369.6 R F5(HISTTIMEFORMA)3.084 E(T)-.855 E F0 -.25(va)2.834 +G .584 +(riable is set, time stamps are written to the history \214le, mark).25 +F .583(ed with the his-)-.1 F 1.147(tory comment character)108 381.6 R +3.647(,s)-.4 G 3.647(ot)-3.647 G(he)-3.647 E 3.647(ym)-.15 G 1.147 +(ay be preserv)-3.647 F 1.147(ed across shell sessions.)-.15 F 1.148 +(This uses the history comment)6.148 F 1.377 +(character to distinguish timestamps from other history lines.)108 393.6 +R 1.377(After sa)6.377 F 1.377(ving the history)-.2 F 3.876(,t)-.65 G +1.376(he history \214le is)-3.876 F .756 +(truncated to contain no more than)108 405.6 R F5(HISTFILESIZE)3.257 E +F0 3.257(lines. If)3.007 F F5(HISTFILESIZE)3.257 E F0 .757 +(is unset, or set to null, a non-)3.007 F(numeric v)108 417.6 Q +(alue, or a numeric v)-.25 E +(alue less than zero, the history \214le is not truncated.)-.25 E 1.294 +(The b)108 434.4 R 1.294(uiltin command)-.2 F F3(fc)3.794 E F0(\(see) +3.794 E F5 1.293(SHELL B)3.794 F(UIL)-.09 E 1.293(TIN COMMANDS)-.828 F +F0(belo)3.543 E 1.293(w\) may be used to list or edit and re-)-.25 F +-.15(exe)108 446.4 S .673(cute a portion of the history list.).15 F(The) +5.673 E F3(history)3.173 E F0 -.2(bu)3.173 G .673 +(iltin may be used to display or modify the history list).2 F .28 +(and manipulate the history \214le.)108 458.4 R .279 +(When using command-line editing, search commands are a)5.279 F -.25(va) +-.2 G .279(ilable in each).25 F(editing mode that pro)108 470.4 Q +(vide access to the history list.)-.15 E 1.485(The shell allo)108 487.2 +R 1.485(ws control o)-.25 F -.15(ve)-.15 G 3.986(rw).15 G 1.486 +(hich commands are sa)-3.986 F -.15(ve)-.2 G 3.986(do).15 G 3.986(nt) +-3.986 G 1.486(he history list.)-3.986 F(The)6.486 E F5(HISTCONTR)3.986 +E(OL)-.27 E F0(and)3.736 E F5(HISTIGNORE)108 499.2 Q F0 -.25(va)2.708 G +.458(riables may be set to cause the shell to sa).25 F .757 -.15(ve o) +-.2 H .457(nly a subset of the commands entered.).15 F(The)5.457 E F3 +(cmdhist)108 511.2 Q F0 .75 +(shell option, if enabled, causes the shell to attempt to sa)3.25 F 1.05 +-.15(ve e)-.2 H .75(ach line of a multi-line command in).15 F 1.077 +(the same history entry)108 523.2 R 3.577(,a)-.65 G 1.077 +(dding semicolons where necessary to preserv)-3.577 F 3.577(es)-.15 G +1.077(yntactic correctness.)-3.577 F(The)6.077 E F3(lithist)3.576 E F0 +.373(shell option causes the shell to sa)108 535.2 R .674 -.15(ve t)-.2 +H .374(he command with embedded ne).15 F .374 +(wlines instead of semicolons.)-.25 F .374(See the)5.374 F .319 +(description of the)108 547.2 R F3(shopt)2.819 E F0 -.2(bu)2.819 G .318 +(iltin belo).2 F 2.818(wu)-.25 G(nder)-2.818 E F5 .318(SHELL B)2.818 F +(UIL)-.09 E .318(TIN COMMANDS)-.828 F F0 .318 +(for information on setting and)2.568 F(unsetting shell options.)108 +559.2 Q F2(HIST)72 576 Q(OR)-.197 E 2.738(YE)-.383 G(XP)-2.738 E(ANSION) +-.81 E F0 .61(The shell supports a history e)108 588 R .611 +(xpansion feature that is similar to the history e)-.15 F .611 +(xpansion in)-.15 F F3(csh.)3.111 E F0 .611(This section)5.611 F .871 +(describes what syntax features are a)108 600 R -.25(va)-.2 G 3.371 +(ilable. This).25 F .871(feature is enabled by def)3.371 F .87 +(ault for interacti)-.1 F 1.17 -.15(ve s)-.25 H .87(hells, and).15 F +2.013(can be disabled using the)108 612 R F3(+H)4.514 E F0 2.014 +(option to the)4.514 F F3(set)4.514 E F0 -.2(bu)4.514 G 2.014 +(iltin command \(see).2 F F5 2.014(SHELL B)4.514 F(UIL)-.09 E 2.014 +(TIN COMMANDS)-.828 F F0(belo)108 624 Q 2.5(w\). Non-interacti)-.25 F .3 +-.15(ve s)-.25 H(hells do not perform history e).15 E(xpansion by def) +-.15 E(ault.)-.1 E 1.306(History e)108 640.8 R 1.306 +(xpansions introduce w)-.15 F 1.306(ords from the history list into the\ + input stream, making it easy to repeat)-.1 F .209 +(commands, insert the ar)108 652.8 R .209(guments to a pre)-.18 F .21 +(vious command into the current input line, or \214x errors in pre)-.25 +F(vious)-.25 E(commands quickly)108 664.8 Q(.)-.65 E 1.164(History e)108 +681.6 R 1.163(xpansion is performed immediately after a complete line i\ +s read, before the shell breaks it into)-.15 F -.1(wo)108 693.6 S 3.2 +(rds. It).1 F(tak)3.2 E .7(es place in tw)-.1 F 3.2(op)-.1 G 3.2 +(arts. The)-3.2 F .7 +(\214rst is to determine which line from the history list to use during) +3.2 F 4.368(substitution. The)108 705.6 R 1.868(second is to select por\ +tions of that line for inclusion into the current one.)4.368 F 1.867 +(The line)6.867 F .662(selected from the history is the)108 717.6 R F4 +-.15(ev)3.162 G(ent).15 E F0 3.162(,a)C .663 +(nd the portions of that line that are acted upon are)-3.162 F F4(wor) +3.163 E(ds)-.37 E F0 5.663(.V)C(arious)-6.773 E F4(modi\214er)108 729.6 +Q(s)-.1 E F0 .227(are a)2.727 F -.25(va)-.2 G .227 +(ilable to manipulate the selected w).25 F 2.727(ords. The)-.1 F .226 +(line is brok)2.726 F .226(en into w)-.1 F .226(ords in the same f)-.1 F +(ashion)-.1 E(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(49)190.95 E +0 Cg EP +%%Page: 50 50 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .351(as when reading input, so that se)108 84 R -.15(ve)-.25 G +(ral).15 E/F1 10/Times-Italic@0 SF(metac)2.852 E(har)-.15 E(acter)-.15 E +F0 .352(-separated w)B .352(ords surrounded by quotes are considered)-.1 +F .625(one w)108 96 R 3.125(ord. History)-.1 F -.15(ex)3.125 G .624 +(pansions are introduced by the appearance of the history e).15 F .624 +(xpansion character)-.15 F 3.124(,w)-.4 G(hich)-3.124 E(is)108 108 Q/F2 +10/Times-Bold@0 SF(!)3.333 E F0(by def)3.333 E 2.5(ault. Only)-.1 F +(backslash \()2.5 E F2(\\).833 E F0 2.5(\)a).833 G +(nd single quotes can quote the history e)-2.5 E(xpansion character)-.15 +E(.)-.55 E(Se)108 124.8 Q -.15(ve)-.25 G .03 +(ral characters inhibit history e).15 F .03 +(xpansion if found immediately follo)-.15 F .03(wing the history e)-.25 +F .03(xpansion character)-.15 F(,)-.4 E -2.15 -.25(ev e)108 136.8 T +3.163(ni).25 G 3.163(fi)-3.163 G 3.162(ti)-3.163 G 3.162(su)-3.162 G +.662(nquoted: space, tab, ne)-3.162 F .662(wline, carriage return, and) +-.25 F F2(=)3.162 E F0 5.662(.I)C 3.162(ft)-5.662 G(he)-3.162 E F2 +(extglob)3.162 E F0 .662(shell option is enabled,)3.162 F F2(\()3.162 E +F0(will also inhibit e)108 148.8 Q(xpansion.)-.15 E(Se)108 165.6 Q -.15 +(ve)-.25 G .109(ral shell options settable with the).15 F F2(shopt)2.609 +E F0 -.2(bu)2.609 G .11(iltin may be used to tailor the beha).2 F .11 +(vior of history e)-.2 F(xpansion.)-.15 E 1.143(If the)108 177.6 R F2 +(histv)3.643 E(erify)-.1 E F0 1.143 +(shell option is enabled \(see the description of the)3.643 F F2(shopt) +3.643 E F0 -.2(bu)3.643 G 1.143(iltin belo).2 F 1.143(w\), and)-.25 F F2 +-.18(re)3.643 G(adline).18 E F0(is)3.642 E .461(being used, history sub\ +stitutions are not immediately passed to the shell parser)108 189.6 R +5.461(.I)-.55 G .461(nstead, the e)-5.461 F .461(xpanded line)-.15 F +1.516(is reloaded into the)108 201.6 R F2 -.18(re)4.016 G(adline).18 E +F0 1.516(editing b)4.016 F(uf)-.2 E 1.516 +(fer for further modi\214cation.)-.25 F(If)6.516 E F2 -.18(re)4.015 G +(adline).18 E F0 1.515(is being used, and the)4.015 F F2(histr)108 213.6 +Q(eedit)-.18 E F0 1.202(shell option is enabled, a f)3.702 F 1.202 +(ailed history substitution will be reloaded into the)-.1 F F2 -.18(re) +3.702 G(adline).18 E F0(editing)3.702 E -.2(bu)108 225.6 S -.25(ff).2 G +1.161(er for correction.).25 F(The)6.161 E F23.661 E F0 1.161 +(option to the)3.661 F F2(history)3.661 E F0 -.2(bu)3.661 G 1.16 +(iltin command may be used to see what a history).2 F -.15(ex)108 237.6 +S .055(pansion will do before using it.).15 F(The)5.055 E F22.555 +E F0 .055(option to the)2.555 F F2(history)2.556 E F0 -.2(bu)2.556 G +.056(iltin may be used to add commands to the).2 F +(end of the history list without actually e)108 249.6 Q -.15(xe)-.15 G +(cuting them, so that the).15 E 2.5(ya)-.15 G(re a)-2.5 E -.25(va)-.2 G +(ilable for subsequent recall.).25 E 2.2(The shell allo)108 266.4 R 2.2 +(ws control of the v)-.25 F 2.2(arious characters used by the history e) +-.25 F 2.2(xpansion mechanism \(see the)-.15 F 1.146(description of)108 +278.4 R F2(histchars)3.646 E F0(abo)3.646 E 1.446 -.15(ve u)-.15 H(nder) +.15 E F2 1.146(Shell V)3.646 F(ariables)-.92 E F0 3.646(\). The)B 1.147 +(shell uses the history comment character to)3.646 F +(mark history timestamps when writing the history \214le.)108 290.4 Q F2 +(Ev)87 307.2 Q(ent Designators)-.1 E F0 .205(An e)108 319.2 R -.15(ve) +-.25 G .204(nt designator is a reference to a command line entry in the\ + history list.).15 F .204(Unless the reference is abso-)5.204 F(lute, e) +108 331.2 Q -.15(ve)-.25 G(nts are relati).15 E .3 -.15(ve t)-.25 H 2.5 +(ot).15 G(he current position in the history list.)-2.5 E F2(!)108 348 Q +F0 1.607(Start a history substitution, e)32.67 F 1.607(xcept when follo) +-.15 F 1.607(wed by a)-.25 F F2(blank)4.107 E F0 4.107(,n)C -.25(ew) +-4.107 G 1.608(line, carriage return, = or \().25 F(\(when the)144 360 Q +F2(extglob)2.5 E F0(shell option is enabled using the)2.5 E F2(shopt)2.5 +E F0 -.2(bu)2.5 G(iltin\).).2 E F2(!)108 372 Q F1(n)A F0 +(Refer to command line)27.67 E F1(n)2.5 E F0(.).24 E F2<21ad>108 384 Q +F1(n)A F0(Refer to the current command minus)21.97 E F1(n)2.5 E F0(.).24 +E F2(!!)108 396 Q F0(Refer to the pre)29.34 E(vious command.)-.25 E +(This is a synon)5 E(ym for `!\2551'.)-.15 E F2(!)108 408 Q F1(string)A +F0 .865(Refer to the most recent command preceding the current position\ + in the history list starting with)9.33 F F1(string)144 420 Q F0(.).22 E +F2(!?)108 432 Q F1(string)A F2([?])A F0 1.503(Refer to the most recent \ +command preceding the current position in the history list containing) +144 444 R F1(string)144 456 Q F0 5(.T).22 G(he trailing)-5 E F2(?)2.5 E +F0(may be omitted if)2.5 E F1(string)2.84 E F0(is follo)2.72 E +(wed immediately by a ne)-.25 E(wline.)-.25 E/F3 12/Times-Bold@0 SF(^) +108 473 Q F1(string1)-5 I F3(^)5 I F1(string2)-5 I F3(^)5 I F0 .784 +(Quick substitution.)144 480 R .784(Repeat the pre)5.784 F .784 +(vious command, replacing)-.25 F F1(string1)3.624 E F0(with)3.283 E F1 +(string2)3.283 E F0 5.783(.E).02 G(qui)-5.783 E -.25(va)-.25 G .783 +(lent to).25 F -.74(``)144 492 S(!!:s/).74 E F1(string1)A F0(/)A F1 +(string2)A F0(/')A 2.5('\()-.74 G(see)-2.5 E F2(Modi\214ers)2.5 E F0 +(belo)2.5 E(w\).)-.25 E F2(!#)108 504 Q F0 +(The entire command line typed so f)27.67 E(ar)-.1 E(.)-.55 E F2 -.75 +(Wo)87 520.8 S(rd Designators).75 E F0 -.8(Wo)108 532.8 S 1.313 +(rd designators are used to select desired w).8 F 1.314(ords from the e) +-.1 F -.15(ve)-.25 G 3.814(nt. A).15 F F2(:)3.814 E F0 1.314 +(separates the e)3.814 F -.15(ve)-.25 G 1.314(nt speci\214cation).15 F +.53(from the w)108 544.8 R .529(ord designator)-.1 F 5.529(.I)-.55 G +3.029(tm)-5.529 G .529(ay be omitted if the w)-3.029 F .529 +(ord designator be)-.1 F .529(gins with a)-.15 F F2(^)3.029 E F0(,)A F2 +($)3.029 E F0(,)A F2(*)3.029 E F0(,)A F23.029 E F0 3.029(,o)C(r) +-3.029 E F2(%)3.029 E F0 5.529(.W)C(ords)-6.329 E 1.3 +(are numbered from the be)108 556.8 R 1.3 +(ginning of the line, with the \214rst w)-.15 F 1.301 +(ord being denoted by 0 \(zero\).)-.1 F -.8(Wo)6.301 G 1.301(rds are).8 +F(inserted into the current line separated by single spaces.)108 568.8 Q +F2 2.5(0\()108 585.6 S(zer)-2.5 E(o\))-.18 E F0(The zeroth w)144 597.6 Q +2.5(ord. F)-.1 F(or the shell, this is the command w)-.15 E(ord.)-.1 E +F1(n)108.36 609.6 Q F0(The)30.64 E F1(n)2.5 E F0(th w)A(ord.)-.1 E F2(^) +108 621.6 Q F0(The \214rst ar)32.67 E 2.5(gument. That)-.18 F(is, w)2.5 +E(ord 1.)-.1 E F2($)108 633.6 Q F0 .064(The last w)31 F 2.564(ord. This) +-.1 F .064(is usually the last ar)2.564 F .064(gument, b)-.18 F .064 +(ut will e)-.2 F .064(xpand to the zeroth w)-.15 F .063 +(ord if there is only)-.1 F(one w)144 645.6 Q(ord in the line.)-.1 E F2 +(%)108 657.6 Q F0(The w)26 E(ord matched by the most recent `?)-.1 E F1 +(string)A F0(?' search.)A F1(x)108.77 669.6 Q F2A F1(y)A F0 2.5(Ar) +20.65 G(ange of w)-2.5 E(ords; `\255)-.1 E F1(y)A F0 2.5('a)C(bbre)-2.5 +E(viates `0\255)-.25 E F1(y)A F0('.)A F2(*)108 681.6 Q F0 .315 +(All of the w)31 F .315(ords b)-.1 F .315(ut the zeroth.)-.2 F .315 +(This is a synon)5.315 F .315(ym for `)-.15 F F1(1\255$)A F0 2.815 +('. It)B .315(is not an error to use)2.815 F F2(*)2.816 E F0 .316 +(if there is)2.816 F(just one w)144 693.6 Q(ord in the e)-.1 E -.15(ve) +-.25 G(nt; the empty string is returned in that case.).15 E F2(x*)108 +705.6 Q F0(Abbre)26 E(viates)-.25 E F1(x\255$)2.5 E F0(.)A F2<78ad>108 +717.6 Q F0(Abbre)25.3 E(viates)-.25 E F1(x\255$)2.5 E F0(lik)2.5 E(e)-.1 +E F2(x*)2.5 E F0 2.5(,b)C(ut omits the last w)-2.7 E(ord.)-.1 E +(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(50)190.95 E 0 Cg EP +%%Page: 51 51 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(If a w)108 84 Q(ord designator is supplied without an e)-.1 E +-.15(ve)-.25 G(nt speci\214cation, the pre).15 E +(vious command is used as the e)-.25 E -.15(ve)-.25 G(nt.).15 E/F1 10 +/Times-Bold@0 SF(Modi\214ers)87 100.8 Q F0 .184(After the optional w)108 +112.8 R .184(ord designator)-.1 F 2.684(,t)-.4 G .183 +(here may appear a sequence of one or more of the follo)-2.684 F .183 +(wing modi\214ers,)-.25 F(each preceded by a `:'.)108 124.8 Q F1(h)108 +141.6 Q F0(Remo)30.44 E .3 -.15(ve a t)-.15 H +(railing \214lename component, lea).15 E(ving only the head.)-.2 E F1(t) +108 153.6 Q F0(Remo)32.67 E .3 -.15(ve a)-.15 H +(ll leading \214lename components, lea).15 E(ving the tail.)-.2 E F1(r) +108 165.6 Q F0(Remo)31.56 E .3 -.15(ve a t)-.15 H(railing suf).15 E +(\214x of the form)-.25 E/F2 10/Times-Italic@0 SF(.xxx)2.5 E F0 2.5(,l)C +(ea)-2.5 E(ving the basename.)-.2 E F1(e)108 177.6 Q F0(Remo)31.56 E .3 +-.15(ve a)-.15 H(ll b).15 E(ut the trailing suf)-.2 E(\214x.)-.25 E F1 +(p)108 189.6 Q F0(Print the ne)30.44 E 2.5(wc)-.25 G(ommand b)-2.5 E +(ut do not e)-.2 E -.15(xe)-.15 G(cute it.).15 E F1(q)108 201.6 Q F0 +(Quote the substituted w)30.44 E(ords, escaping further substitutions.) +-.1 E F1(x)108 213.6 Q F0(Quote the substituted w)31 E(ords as with)-.1 +E F1(q)2.5 E F0 2.5(,b)C(ut break into w)-2.7 E(ords at)-.1 E F1(blanks) +2.5 E F0(and ne)2.5 E(wlines.)-.25 E F1(s/)108 225.6 Q F2(old)A F1(/)A +F2(ne)A(w)-.15 E F1(/)A F0(Substitute)144 237.6 Q F2(ne)3.081 E(w)-.15 E +F0 .221(for the \214rst occurrence of)3.031 F F2(old)2.951 E F0 .221 +(in the e)3.491 F -.15(ve)-.25 G .221(nt line.).15 F(An)5.221 E 2.721 +(yd)-.15 G .221(elimiter can be used in place)-2.721 F .617(of /.)144 +249.6 R .617 +(The \214nal delimiter is optional if it is the last character of the e) +5.617 F -.15(ve)-.25 G .617(nt line.).15 F .616(The delimiter may)5.616 +F .666(be quoted in)144 261.6 R F2(old)3.396 E F0(and)3.936 E F2(ne) +3.526 E(w)-.15 E F0 .666(with a single backslash.)3.476 F .666 +(If & appears in)5.666 F F2(ne)3.166 E(w)-.15 E F0 3.166(,i).31 G 3.166 +(ti)-3.166 G 3.166(sr)-3.166 G .666(eplaced by)-3.166 F F2(old)3.166 E +F0 5.666(.A).77 G .275(single backslash will quote the &.)144 273.6 R +(If)5.275 E F2(old)3.004 E F0 .274(is null, it is set to the last)3.544 +F F2(old)3.004 E F0 .274(substituted, or)3.544 F 2.774(,i)-.4 G 2.774 +(fn)-2.774 G 2.774(op)-2.774 G(re)-2.774 E(vi-)-.25 E +(ous history substitutions took place, the last)144 285.6 Q F2(string) +2.84 E F0(in a)2.72 E F1(!?)2.5 E F2(string)A F1([?])A F0(search.)5 E F1 +(&)108 297.6 Q F0(Repeat the pre)27.67 E(vious substitution.)-.25 E F1 +(g)108 309.6 Q F0 .397(Cause changes to be applied o)31 F -.15(ve)-.15 G +2.897(rt).15 G .398(he entire e)-2.897 F -.15(ve)-.25 G .398(nt line.) +.15 F .398(This is used in conjunction with `)5.398 F F1(:s)A F0 2.898 +('\()C(e.g.,)-2.898 E(`)144 321.6 Q F1(:gs/)A F2(old)A F1(/)A F2(ne)A(w) +-.15 E F1(/)A F0 1.219('\) or `)B F1(:&)A F0 3.719('. If)B 1.219 +(used with `)3.719 F F1(:s)A F0 1.218(', an)B 3.718(yd)-.15 G 1.218 +(elimiter can be used in place of /, and the \214nal)-3.718 F .089 +(delimiter is optional if it is the last character of the e)144 333.6 R +-.15(ve)-.25 G .09(nt line.).15 F(An)5.09 E F1(a)2.59 E F0 .09 +(may be used as a synon)2.59 F .09(ym for)-.15 F F1(g)144 345.6 Q F0(.)A +F1(G)108 357.6 Q F0(Apply the follo)28.22 E(wing `)-.25 E F1(s)A F0 2.5 +('m)C(odi\214er once to each w)-2.5 E(ord in the e)-.1 E -.15(ve)-.25 G +(nt line.).15 E/F3 10.95/Times-Bold@0 SF(SHELL B)72 374.4 Q(UIL)-.11 E +(TIN COMMANDS)-1.007 E F0 .063(Unless otherwise noted, each b)108 386.4 +R .062(uiltin command documented in this section as accepting options p\ +receded by)-.2 F F1108 398.4 Q F0(accepts)2.533 E F12.533 E F0 +.034(to signify the end of the options.)2.533 F(The)5.034 E F1(:)2.534 E +F0(,)A F1(true)2.534 E F0(,)A F1(false)2.534 E F0 2.534(,a)C(nd)-2.534 E +F1(test)2.534 E F0 -.2(bu)2.534 G .034(iltins do not accept options and) +.2 F .078(do not treat)108 410.4 R F12.577 E F0(specially)2.577 E +5.077(.T)-.65 G(he)-5.077 E F1(exit)2.577 E F0(,)A F1(logout)2.577 E F0 +(,)A F1(br)2.577 E(eak)-.18 E F0(,)A F1(continue)2.577 E F0(,)A F1(let) +2.577 E F0 2.577(,a)C(nd)-2.577 E F1(shift)2.577 E F0 -.2(bu)2.577 G +.077(iltins accept and process ar).2 F(gu-)-.18 E .319(ments be)108 +422.4 R .319(ginning with)-.15 F F12.819 E F0 .319 +(without requiring)2.819 F F12.819 E F0 5.319(.O)C .319(ther b) +-5.319 F .319(uiltins that accept ar)-.2 F .32(guments b)-.18 F .32 +(ut are not speci\214ed as)-.2 F 1.144(accepting options interpret ar) +108 434.4 R 1.144(guments be)-.18 F 1.144(ginning with)-.15 F F1 +3.643 E F0 1.143(as in)3.643 F -.25(va)-.4 G 1.143 +(lid options and require).25 F F13.643 E F0 1.143(to pre)3.643 F +-.15(ve)-.25 G 1.143(nt this).15 F(interpretation.)108 446.4 Q F1(:)108 +464.4 Q F0([)2.5 E F2(ar)A(guments)-.37 E F0(])A .451(No ef)144 476.4 R +.451(fect; the command does nothing be)-.25 F .452(yond e)-.15 F +(xpanding)-.15 E F2(ar)3.282 E(guments)-.37 E F0 .452(and performing an) +3.222 F 2.952(ys)-.15 G(peci\214ed)-2.952 E 2.5(redirections. A)144 +488.4 R(zero e)2.5 E(xit code is returned.)-.15 E F1(.)110.5 505.2 Q F2 +(\214lename)6.666 E F0([)2.5 E F2(ar)A(guments)-.37 E F0(])A F1(sour)108 +517.2 Q(ce)-.18 E F2(\214lename)2.5 E F0([)2.5 E F2(ar)A(guments)-.37 E +F0(])A 1.02(Read and e)144 529.2 R -.15(xe)-.15 G 1.02 +(cute commands from).15 F F2(\214lename)5.43 E F0 1.02 +(in the current shell en)3.7 F 1.02(vironment and return the e)-.4 F +(xit)-.15 E 1.458(status of the last command e)144 541.2 R -.15(xe)-.15 +G 1.458(cuted from).15 F F2(\214lename)3.958 E F0 6.458(.I).18 G(f) +-6.458 E F2(\214lename)5.868 E F0 1.458 +(does not contain a slash, \214le-)4.138 F .608(names in)144 553.2 R/F4 +9/Times-Bold@0 SF -.666(PA)3.108 G(TH)-.189 E F0 .608 +(are used to \214nd the directory containing)2.858 F F2(\214lename)3.108 +E F0 5.608(.T).18 G .608(he \214le searched for in)-5.608 F F4 -.666(PA) +3.108 G(TH)-.189 E F0 .832(need not be e)144 565.2 R -.15(xe)-.15 G +3.332(cutable. When).15 F F1(bash)3.332 E F0 .832(is not in)3.332 F F2 +.832(posix mode)3.332 F F0 3.332(,t)C .833 +(he current directory is searched if no)-3.332 F .982 +(\214le is found in)144 577.2 R F4 -.666(PA)3.481 G(TH)-.189 E/F5 9 +/Times-Roman@0 SF(.)A F0 .981(If the)5.481 F F1(sour)3.481 E(cepath)-.18 +E F0 .981(option to the)3.481 F F1(shopt)3.481 E F0 -.2(bu)3.481 G .981 +(iltin command is turned of).2 F .981(f, the)-.25 F F4 -.666(PA)144 +589.2 S(TH)-.189 E F0 .112(is not searched.)2.362 F .112(If an)5.112 F +(y)-.15 E F2(ar)2.612 E(guments)-.37 E F0 .112(are supplied, the)2.612 F +2.612(yb)-.15 G .112(ecome the positional parameters when)-2.612 F F2 +(\214lename)144 601.2 Q F0 .342(is e)2.842 F -.15(xe)-.15 G 2.842 +(cuted. Otherwise).15 F .342(the positional parameters are unchanged.) +2.842 F .341(The return status is the)5.341 F .716 +(status of the last command e)144 613.2 R .716 +(xited within the script \(0 if no commands are e)-.15 F -.15(xe)-.15 G +.716(cuted\), and f).15 F .716(alse if)-.1 F F2(\214lename)145.91 625.2 +Q F0(is not found or cannot be read.)2.68 E F1(alias)108 642 Q F0([)2.5 +E F1A F0 2.5(][)C F2(name)-2.5 E F0([=)A F2(value)A F0 2.5(].)C +(..])-2.5 E F1(Alias)144 654 Q F0 2.725(with no ar)5.225 F 2.724 +(guments or with the)-.18 F F15.224 E F0 2.724 +(option prints the list of aliases in the form)5.224 F F1(alias)5.224 E +F2(name)144 666 Q F0(=)A F2(value)A F0 .58(on standard output.)3.08 F +.58(When ar)5.58 F .58 +(guments are supplied, an alias is de\214ned for each)-.18 F F2(name) +3.08 E F0(whose)144 678 Q F2(value)2.895 E F0 .395(is gi)2.895 F -.15 +(ve)-.25 G 2.895(n. A).15 F .395(trailing space in)2.895 F F2(value) +5.395 E F0 .395(causes the ne)2.895 F .395(xt w)-.15 F .395 +(ord to be check)-.1 F .395(ed for alias sub-)-.1 F .054 +(stitution when the alias is e)144 690 R 2.554(xpanded. F)-.15 F .054 +(or each)-.15 F F2(name)2.554 E F0 .054(in the ar)2.554 F .054 +(gument list for which no)-.18 F F2(value)2.554 E F0 .054(is sup-)2.554 +F 1.314(plied, the name and v)144 702 R 1.314 +(alue of the alias is printed.)-.25 F F1(Alias)6.314 E F0 1.314 +(returns true unless a)3.814 F F2(name)3.814 E F0 1.313(is gi)3.814 F +-.15(ve)-.25 G 3.813(nf).15 G(or)-3.813 E +(which no alias has been de\214ned.)144 714 Q(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(51)190.95 E 0 Cg EP +%%Page: 52 52 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(bg)108 84 Q F0([)2.5 E/F2 10/Times-Italic@0 +SF(jobspec)A F0(...])2.5 E .744(Resume each suspended job)144 96 R F2 +(jobspec)3.244 E F0 .745 +(in the background, as if it had been started with)3.244 F F1(&)3.245 E +F0 5.745(.I)C(f)-5.745 E F2(job-)4.985 E(spec)144 108 Q F0 .672 +(is not present, the shell')3.482 F 3.172(sn)-.55 G .672(otion of the) +-3.172 F F2(curr)3.172 E .672(ent job)-.37 F F0 .672(is used.)3.172 F F1 +(bg)5.671 E F2(jobspec)4.911 E F0 .671(returns 0 unless run)3.481 F .418 +(when job control is disabled or)144 120 R 2.919(,w)-.4 G .419 +(hen run with job control enabled, an)-2.919 F 2.919(ys)-.15 G +(peci\214ed)-2.919 E F2(jobspec)2.919 E F0 -.1(wa)2.919 G 2.919(sn).1 G +(ot)-2.919 E(found or w)144 132 Q(as started without job control.)-.1 E +F1(bind)108 148.8 Q F0([)2.5 E F1A F2 -.1(ke)2.5 G(ymap)-.2 E F0 +2.5(][)C F1(\255lpsvPSVX)-2.5 E F0(])A F1(bind)108 160.8 Q F0([)2.5 E F1 +A F2 -.1(ke)2.5 G(ymap)-.2 E F0 2.5(][)C F1-2.5 E F2 +(function)2.5 E F0 2.5(][)C F1-2.5 E F2(function)2.5 E F0 2.5(][)C +F1-2.5 E F2 -.1(ke)2.5 G(yseq)-.2 E F0(])A F1(bind)108 172.8 Q F0 +([)2.5 E F1A F2 -.1(ke)2.5 G(ymap)-.2 E F0(])A F12.5 E F2 +(\214lename)2.5 E F1(bind)108 184.8 Q F0([)2.5 E F1A F2 -.1(ke)2.5 +G(ymap)-.2 E F0(])A F12.5 E F2 -.1(ke)2.5 G(yseq)-.2 E F0(:)A F2 +(shell\255command)A F1(bind)108 196.8 Q F0([)2.5 E F1A F2 -.1(ke) +2.5 G(ymap)-.2 E F0(])A F2 -.1(ke)2.5 G(yseq)-.2 E F0(:)A F2 +(function\255name)A F1(bind)108 208.8 Q F2 -.37(re)2.5 G +(adline\255command).37 E F0 .239(Display current)144 220.8 R F1 -.18(re) +2.739 G(adline).18 E F0 -.1(ke)2.739 G 2.739(ya)-.05 G .239 +(nd function bindings, bind a k)-2.739 F .539 -.15(ey s)-.1 H .238 +(equence to a).15 F F1 -.18(re)2.738 G(adline).18 E F0 .238(function or) +2.738 F .475(macro, or set a)144 232.8 R F1 -.18(re)2.975 G(adline).18 E +F0 -.25(va)2.975 G 2.975(riable. Each).25 F .476(non-option ar)2.976 F +.476(gument is a command as it w)-.18 F .476(ould appear in)-.1 F F2 +(.inputr)144 244.8 Q(c)-.37 E F0 2.984(,b).31 G .484 +(ut each binding or command must be passed as a separate ar)-3.184 F +.483(gument; e.g., '"\\C\255x\\C\255r":)-.18 F 2.5 +(re\255read\255init\255\214le'. Options,)144 256.8 R(if supplied, ha)2.5 +E .3 -.15(ve t)-.2 H(he follo).15 E(wing meanings:)-.25 E F1144 +268.8 Q F2 -.1(ke)2.5 G(ymap)-.2 E F0(Use)180 280.8 Q F2 -.1(ke)5.158 G +(ymap)-.2 E F0 2.658(as the k)5.348 F -.15(ey)-.1 G 2.658(map to be af) +.15 F 2.659(fected by the subsequent bindings.)-.25 F(Acceptable)7.659 E +F2 -.1(ke)180 292.8 S(ymap)-.2 E F0 3.193(names are)5.883 F F2 3.193 +(emacs, emacs\255standar)5.693 F 3.192 +(d, emacs\255meta, emacs\255ctlx, vi, vi\255mo)-.37 F(ve)-.1 E(,)-.1 E +(vi\255command)180 304.8 Q F0 4.429(,a)C(nd)-4.429 E F2(vi\255insert) +4.429 E F0(.).68 E F2(vi)6.929 E F0 1.929(is equi)4.429 F -.25(va)-.25 G +1.929(lent to).25 F F2(vi\255command)4.429 E F0(;)A F2(emacs)4.429 E F0 +1.929(is equi)4.429 F -.25(va)-.25 G 1.93(lent to).25 F F2 +(emacs\255standar)180 316.8 Q(d)-.37 E F0(.)A F1144 328.8 Q F0 +(List the names of all)27.52 E F1 -.18(re)2.5 G(adline).18 E F0 +(functions.)2.5 E F1144 340.8 Q F0(Display)24.74 E F1 -.18(re)2.5 +G(adline).18 E F0(function names and bindings in such a w)2.5 E +(ay that the)-.1 E 2.5(yc)-.15 G(an be re-read.)-2.5 E F1144 352.8 +Q F0(List current)24.19 E F1 -.18(re)2.5 G(adline).18 E F0 +(function names and bindings.)2.5 E F1144 364.8 Q F0(Display)26.41 +E F1 -.18(re)3.655 G(adline).18 E F0 -.1(ke)3.655 G 3.655(ys)-.05 G +1.155(equences bound to macros and the strings the)-3.655 F 3.655(yo) +-.15 G 1.155(utput in such a)-3.655 F -.1(wa)180 376.8 S 2.5(yt).1 G +(hat the)-2.5 E 2.5(yc)-.15 G(an be re-read.)-2.5 E F1144 388.8 Q +F0(Display)24.74 E F1 -.18(re)2.5 G(adline).18 E F0 -.1(ke)2.5 G 2.5(ys) +-.05 G(equences bound to macros and the strings the)-2.5 E 2.5(yo)-.15 G +(utput.)-2.5 E F1144 400.8 Q F0(Display)25.3 E F1 -.18(re)2.5 G +(adline).18 E F0 -.25(va)2.5 G(riable names and v).25 E +(alues in such a w)-.25 E(ay that the)-.1 E 2.5(yc)-.15 G +(an be re-read.)-2.5 E F1144 412.8 Q F0(List current)23.08 E F1 +-.18(re)2.5 G(adline).18 E F0 -.25(va)2.5 G(riable names and v).25 E +(alues.)-.25 E F1144 424.8 Q F2(\214lename)2.5 E F0(Read k)180 +436.8 Q .3 -.15(ey b)-.1 H(indings from).15 E F2(\214lename)2.5 E F0(.)A +F1144 448.8 Q F2(function)2.5 E F0(Query about which k)180 460.8 Q +-.15(ey)-.1 G 2.5(si).15 G -1.9 -.4(nv o)-2.5 H .2 -.1(ke t).4 H +(he named).1 E F2(function)2.5 E F0(.)A F1144 472.8 Q F2(function) +2.5 E F0(Unbind all k)180 484.8 Q -.15(ey)-.1 G 2.5(sb).15 G +(ound to the named)-2.5 E F2(function)2.5 E F0(.)A F1144 496.8 Q +F2 -.1(ke)2.5 G(yseq)-.2 E F0(Remo)180 508.8 Q .3 -.15(ve a)-.15 H .3 +-.15(ny c).15 H(urrent binding for).15 E F2 -.1(ke)2.5 G(yseq)-.2 E F0 +(.)A F1144 520.8 Q F2 -.1(ke)2.5 G(yseq)-.2 E F1(:)A F2 +(shell\255command)A F0(Cause)180 532.8 Q F2(shell\255command)4.325 E F0 +1.825(to be e)4.325 F -.15(xe)-.15 G 1.825(cuted whene).15 F -.15(ve) +-.25 G(r).15 E F2 -.1(ke)4.325 G(yseq)-.2 E F0 1.825(is entered.)4.325 F +(When)6.825 E F2(shell\255com-)4.325 E(mand)180 544.8 Q F0 1.765(is e) +4.265 F -.15(xe)-.15 G 1.765(cuted, the shell sets the).15 F/F3 9 +/Times-Bold@0 SF(READLINE_LINE)4.265 E F0 -.25(va)4.015 G 1.765 +(riable to the contents of the).25 F F1 -.18(re)180 556.8 S(adline).18 E +F0 1.353(line b)3.852 F(uf)-.2 E 1.353(fer and the)-.25 F F3 +(READLINE_POINT)3.853 E F0 -.25(va)3.603 G 1.353 +(riable to the current location of the).25 F 2.012(insertion point.)180 +568.8 R 2.011(If the e)7.012 F -.15(xe)-.15 G 2.011 +(cuted command changes the v).15 F 2.011(alue of)-.25 F F3 +(READLINE_LINE)4.511 E F0(or)4.261 E F3(READLINE_POINT)180 580.8 Q/F4 9 +/Times-Roman@0 SF(,)A F0(those ne)2.25 E 2.5(wv)-.25 G +(alues will be re\215ected in the editing state.)-2.75 E F1144 +592.8 Q F0 .829(List all k)23.08 F 1.129 -.15(ey s)-.1 H .829 +(equences bound to shell commands and the associated commands in a for) +.15 F(-)-.2 E(mat that can be reused as input.)180 604.8 Q(The return v) +144 621.6 Q(alue is 0 unless an unrecognized option is gi)-.25 E -.15 +(ve)-.25 G 2.5(no).15 G 2.5(ra)-2.5 G 2.5(ne)-2.5 G(rror occurred.)-2.5 +E F1(br)108 638.4 Q(eak)-.18 E F0([)2.5 E F2(n)A F0(])A .055 +(Exit from within a)144 650.4 R F1 -.25(fo)2.555 G(r).25 E F0(,)A F1 +(while)2.555 E F0(,)A F1(until)2.555 E F0 2.555(,o)C(r)-2.555 E F1 +(select)2.555 E F0 2.555(loop. If)2.555 F F2(n)2.555 E F0 .055 +(is speci\214ed, break)2.555 F F2(n)2.555 E F0(le)2.555 E -.15(ve)-.25 G +(ls.).15 E F2(n)5.414 E F0 .054(must be)2.794 F/F5 10/Symbol SF2.554 +E F0(1.)2.554 E(If)144 662.4 Q F2(n)3.074 E F0 .215(is greater than the\ + number of enclosing loops, all enclosing loops are e)2.954 F 2.715 +(xited. The)-.15 F .215(return v)2.715 F(alue)-.25 E(is 0 unless)144 +674.4 Q F2(n)2.5 E F0(is not greater than or equal to 1.)2.5 E F1 -.2 +(bu)108 691.2 S(iltin).2 E F2(shell\255b)2.5 E(uiltin)-.2 E F0([)2.5 E +F2(ar)A(guments)-.37 E F0(])A(Ex)144 703.2 Q .793 +(ecute the speci\214ed shell b)-.15 F .793(uiltin, passing it)-.2 F F2 +(ar)3.293 E(guments)-.37 E F0 3.293(,a).27 G .793(nd return its e)-3.293 +F .792(xit status.)-.15 F .792(This is useful)5.792 F .615 +(when de\214ning a function whose name is the same as a shell b)144 +715.2 R .616(uiltin, retaining the functionality of)-.2 F .57(the b)144 +727.2 R .57(uiltin within the function.)-.2 F(The)5.57 E F1(cd)3.07 E F0 +-.2(bu)3.07 G .57(iltin is commonly rede\214ned this w).2 F(ay)-.1 E +5.57(.T)-.65 G .57(he return status)-5.57 F(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(52)190.95 E 0 Cg EP +%%Page: 53 53 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(is f)144 84 Q(alse if)-.1 E/F1 10/Times-Italic@0 SF(shell\255b) +2.84 E(uiltin)-.2 E F0(is not a shell b)2.74 E(uiltin command.)-.2 E/F2 +10/Times-Bold@0 SF(caller)108 100.8 Q F0([)2.5 E F1 -.2(ex)C(pr).2 E F0 +(])A .253(Returns the conte)144 112.8 R .254(xt of an)-.15 F 2.754(ya) +-.15 G(cti)-2.754 E .554 -.15(ve s)-.25 H .254 +(ubroutine call \(a shell function or a script e).15 F -.15(xe)-.15 G +.254(cuted with the).15 F F2(.)2.754 E F0(or)2.754 E F2(sour)144 124.8 Q +(ce)-.18 E F0 -.2(bu)2.825 G 2.825(iltins\). W).2 F(ithout)-.4 E F1 -.2 +(ex)2.825 G(pr).2 E F0(,)A F2(caller)2.825 E F0 .324 +(displays the line number and source \214lename of the current)2.824 F +.253(subroutine call.)144 136.8 R .253(If a non-ne)5.253 F -.05(ga)-.15 +G(ti).05 E .553 -.15(ve i)-.25 H(nte).15 E .253(ger is supplied as)-.15 +F F1 -.2(ex)2.753 G(pr).2 E F0(,)A F2(caller)2.753 E F0 .254 +(displays the line number)2.754 F 2.754(,s)-.4 G(ub-)-2.754 E 1.327(rou\ +tine name, and source \214le corresponding to that position in the curr\ +ent e)144 148.8 R -.15(xe)-.15 G 1.327(cution call stack.).15 F(This e) +144 160.8 Q(xtra information may be used, for e)-.15 E .001 +(xample, to print a stack trace.)-.15 F .001(The current frame is frame) +5.001 F 3.02(0. The)144 172.8 R .52(return v)3.02 F .52 +(alue is 0 unless the shell is not e)-.25 F -.15(xe)-.15 G .519 +(cuting a subroutine call or).15 F F1 -.2(ex)3.019 G(pr).2 E F0 .519 +(does not corre-)3.019 F(spond to a v)144 184.8 Q +(alid position in the call stack.)-.25 E F2(cd)108 201.6 Q F0([)2.5 E F2 +A F0(|[)A F2A F0([)2.5 E F2A F0(]] [\255@]] [)A F1 +(dir)A F0(])A .321(Change the current directory to)144 213.6 R F1(dir) +2.821 E F0 5.321(.i)C(f)-5.321 E F1(dir)2.821 E F0 .322 +(is not supplied, the v)2.821 F .322(alue of the)-.25 F/F3 9 +/Times-Bold@0 SF(HOME)2.822 E F0 .322(shell v)2.572 F .322(ariable is) +-.25 F 1.036(the def)144 225.6 R 3.536(ault. An)-.1 F 3.536(ya)-.15 G +1.035(dditional ar)-3.536 F 1.035(guments follo)-.18 F(wing)-.25 E F1 +(dir)3.535 E F0 1.035(are ignored.)3.535 F 1.035(The v)6.035 F(ariable) +-.25 E F3(CDP)3.535 E -.855(AT)-.666 G(H).855 E F0(de\214nes)3.285 E +.849(the search path for the directory containing)144 237.6 R F1(dir) +3.349 E F0 3.35(:e).73 G .85(ach directory name in)-3.35 F F3(CDP)3.35 E +-.855(AT)-.666 G(H).855 E F0 .85(is searched for)3.1 F F1(dir)144 249.6 +Q F0 5.665(.A)C(lternati)-5.665 E .965 -.15(ve d)-.25 H .665 +(irectory names in).15 F F3(CDP)3.165 E -.855(AT)-.666 G(H).855 E F0 +.665(are separated by a colon \(:\).)2.915 F 3.165(An)5.665 G .664 +(ull directory name)-3.165 F(in)144 261.6 Q F3(CDP)4.162 E -.855(AT) +-.666 G(H).855 E F0 1.662(is the same as the current directory)3.912 F +4.162(,i)-.65 G 1.662(.e., `)-4.162 F(`)-.74 E F2(.)A F0 -.74('')C 6.662 +(.I).74 G(f)-6.662 E F1(dir)4.513 E F0(be)4.893 E 1.663 +(gins with a slash \(/\), then)-.15 F F3(CDP)144 273.6 Q -.855(AT)-.666 +G(H).855 E F0 .347(is not used. The)2.598 F F22.847 E F0 .347 +(option causes)2.847 F F2(cd)2.847 E F0 .347(to use the ph)2.847 F .347 +(ysical directory structure by resolving)-.05 F 1.12 +(symbolic links while tra)144 285.6 R -.15(ve)-.2 G(rsing).15 E F1(dir) +3.62 E F0 1.12(and before processing instances of)3.62 F F1(..)3.62 E F0 +(in)3.62 E F1(dir)3.62 E F0 1.12(\(see also the)3.62 F F23.62 E F0 +.395(option to the)144 297.6 R F2(set)2.895 E F0 -.2(bu)2.895 G .395 +(iltin command\); the).2 F F22.895 E F0 .395 +(option forces symbolic links to be follo)2.895 F .395(wed by resolv-) +-.25 F .443(ing the link after processing instances of)144 309.6 R F1 +(..)2.943 E F0(in)2.943 E F1(dir)2.943 E F0 5.443(.I)C(f)-5.443 E F1(..) +2.943 E F0 .443(appears in)2.943 F F1(dir)2.943 E F0 2.943(,i)C 2.943 +(ti)-2.943 G 2.944(sp)-2.943 G .444(rocessed by remo)-2.944 F(ving)-.15 +E .744(the immediately pre)144 321.6 R .744 +(vious pathname component from)-.25 F F1(dir)3.244 E F0 3.244(,b)C .744 +(ack to a slash or the be)-3.244 F .744(ginning of)-.15 F F1(dir)3.244 E +F0(.)A 1.465(If the)144 333.6 R F23.965 E F0 1.465 +(option is supplied with)3.965 F F23.965 E F0 3.965(,a)C 1.465 +(nd the current w)-3.965 F 1.466 +(orking directory cannot be successfully)-.1 F .468 +(determined after a successful directory change,)144 345.6 R F2(cd)2.968 +E F0 .468(will return an unsuccessful status.)2.968 F .467(On systems) +5.467 F .336(that support it, the)144 357.6 R F22.836 E F0 .336 +(option presents the e)2.836 F .336(xtended attrib)-.15 F .337 +(utes associated with a \214le as a directory)-.2 F(.)-.65 E .71(An ar) +144 369.6 R .71(gument of)-.18 F F23.21 E F0 .71(is con)3.21 F -.15 +(ve)-.4 G .71(rted to).15 F F3($OLDPWD)3.21 E F0 .71 +(before the directory change is attempted.)2.96 F .71(If a non-)5.71 F +.106(empty directory name from)144 381.6 R F3(CDP)2.606 E -.855(AT)-.666 +G(H).855 E F0 .107(is used, or if)2.356 F F22.607 E F0 .107 +(is the \214rst ar)2.607 F .107(gument, and the directory change)-.18 F +.038(is successful, the absolute pathname of the ne)144 393.6 R 2.538 +(ww)-.25 G .038(orking directory is written to the standard output.) +-2.638 F(The return v)144 405.6 Q(alue is true if the directory w)-.25 E +(as successfully changed; f)-.1 E(alse otherwise.)-.1 E F2(command)108 +422.4 Q F0([)2.5 E F2(\255pVv)A F0(])A F1(command)2.5 E F0([)2.5 E F1 +(ar)A(g)-.37 E F0(...])2.5 E(Run)144 434.4 Q F1(command)2.956 E F0(with) +3.527 E F1(ar)3.087 E(gs)-.37 E F0 .257 +(suppressing the normal shell function lookup. Only b)3.027 F .257 +(uiltin commands or)-.2 F .502(commands found in the)144 446.4 R F3 +-.666(PA)3.002 G(TH)-.189 E F0 .502(are e)2.752 F -.15(xe)-.15 G 3.002 +(cuted. If).15 F(the)3.002 E F23.002 E F0 .502(option is gi)3.002 +F -.15(ve)-.25 G .501(n, the search for).15 F F1(command)3.201 E F0(is) +3.771 E .399(performed using a def)144 458.4 R .399(ault v)-.1 F .399 +(alue for)-.25 F F3 -.666(PA)2.899 G(TH)-.189 E F0 .4 +(that is guaranteed to \214nd all of the standard utilities.)2.649 F(If) +5.4 E .175(either the)144 470.4 R F22.675 E F0(or)2.675 E F2 +2.675 E F0 .175(option is supplied, a description of)2.675 F F1(command) +2.875 E F0 .174(is printed.)3.445 F(The)5.174 E F22.674 E F0 .174 +(option causes)2.674 F 3.317(as)144 482.4 S .817(ingle w)-3.317 F .817 +(ord indicating the command or \214lename used to in)-.1 F -.2(vo)-.4 G +-.1(ke).2 G F1(command)3.618 E F0 .818(to be displayed; the)4.088 F F2 +144 494.4 Q F0 .25(option produces a more v)2.75 F .25 +(erbose description.)-.15 F .249(If the)5.25 F F22.749 E F0(or) +2.749 E F22.749 E F0 .249(option is supplied, the e)2.749 F .249 +(xit status)-.15 F 1.004(is 0 if)144 506.4 R F1(command)3.704 E F0 -.1 +(wa)4.274 G 3.504(sf).1 G 1.005(ound, and 1 if not.)-3.504 F 1.005 +(If neither option is supplied and an error occurred or)6.005 F F1 +(command)144.2 518.4 Q F0 1.599(cannot be found, the e)4.869 F 1.599 +(xit status is 127.)-.15 F 1.599(Otherwise, the e)6.599 F 1.598 +(xit status of the)-.15 F F2(command)4.098 E F0 -.2(bu)144 530.4 S +(iltin is the e).2 E(xit status of)-.15 E F1(command)2.5 E F0(.).77 E F2 +(compgen)108 547.2 Q F0([)2.5 E F1(option)A F0 2.5(][)C F1(wor)-2.5 E(d) +-.37 E F0(])A .012(Generate possible completion matches for)144 559.2 R +F1(wor)2.513 E(d)-.37 E F0 .013(according to the)2.513 F F1(option)2.513 +E F0 .013(s, which may be an)B 2.513(yo)-.15 G(ption)-2.513 E .982 +(accepted by the)144 571.2 R F2(complete)3.482 E F0 -.2(bu)3.481 G .981 +(iltin with the e).2 F .981(xception of)-.15 F F23.481 E F0(and) +3.481 E F23.481 E F0 3.481(,a)C .981(nd write the matches to the) +-3.481 F 1.415(standard output.)144 583.2 R 1.415(When using the)6.415 F +F23.915 E F0(or)3.915 E F23.915 E F0 1.415(options, the v) +3.915 F 1.415(arious shell v)-.25 F 1.415(ariables set by the pro-)-.25 +F(grammable completion f)144 595.2 Q(acilities, while a)-.1 E -.25(va) +-.2 G(ilable, will not ha).25 E .3 -.15(ve u)-.2 H(seful v).15 E(alues.) +-.25 E .352(The matches will be generated in the same w)144 619.2 R .352 +(ay as if the programmable completion code had gen-)-.1 F .02(erated th\ +em directly from a completion speci\214cation with the same \215ags.)144 +631.2 R(If)5.02 E F1(wor)2.52 E(d)-.37 E F0 .02(is speci\214ed, only) +2.52 F(those completions matching)144 643.2 Q F1(wor)2.5 E(d)-.37 E F0 +(will be displayed.)2.5 E(The return v)144 667.2 Q +(alue is true unless an in)-.25 E -.25(va)-.4 G +(lid option is supplied, or no matches were generated.).25 E F2 +(complete)108 684 Q F0([)3.729 E F2(\255abcdefgjksuv)A F0 3.729(][)C F2 +-3.729 E F1(comp-option)3.729 E F0 3.729(][)C F2(\255DE)-3.729 E +F0 3.728(][)C F2-3.728 E F1(action)3.728 E F0 3.728(][)C F2 +-3.728 E F1(globpat)3.728 E F0 3.728(][)C F2-3.728 E F1(wor)3.728 +E(dlist)-.37 E F0 3.728(][)C F2-3.728 E F1(func-)3.728 E(tion)108 +696 Q F0 2.5(][)C F2-2.5 E F1(command)2.5 E F0(])A([)144 708 Q F2 +A F1(\214lterpat)2.5 E F0 2.5(][)C F2-2.5 E F1(pr)2.5 E +(e\214x)-.37 E F0 2.5(][)C F2-2.5 E F1(suf)2.5 E<8c78>-.18 E F0(]) +A F1(name)2.5 E F0([)2.5 E F1(name ...)A F0(])A(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(53)190.95 E 0 Cg EP +%%Page: 54 54 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(complete \255pr)108 84 Q F0([)2.5 E F1 +(\255DE)A F0 2.5(][)C/F2 10/Times-Italic@0 SF(name)-2.5 E F0(...])2.5 E +.634(Specify ho)144 96 R 3.134(wa)-.25 G -.18(rg)-3.134 G .634 +(uments to each).18 F F2(name)3.134 E F0 .634(should be completed.)3.134 +F .633(If the)5.634 F F13.133 E F0 .633 +(option is supplied, or if no)3.133 F .139(options are supplied, e)144 +108 R .139(xisting completion speci\214cations are printed in a w)-.15 F +.14(ay that allo)-.1 F .14(ws them to be)-.25 F .31(reused as input.)144 +120 R(The)5.31 E F12.81 E F0 .31(option remo)2.81 F -.15(ve)-.15 G +2.81(sac).15 G .31(ompletion speci\214cation for each)-2.81 F F2(name) +2.81 E F0 2.81(,o)C 1.11 -.4(r, i)-2.81 H 2.81(fn).4 G(o)-2.81 E F2 +(name)2.81 E F0(s)A 1.346 +(are supplied, all completion speci\214cations.)144 132 R(The)6.347 E F1 +3.847 E F0 1.347(option indicates that the remaining options)3.847 +F .5(and actions should apply to the `)144 144 R(`def)-.74 E(ault')-.1 E +3('c)-.74 G .5(ommand completion; that is, completion attempted on)-3 F +3.455(ac)144 156 S .955(ommand for which no completion has pre)-3.455 F +.955(viously been de\214ned.)-.25 F(The)5.955 E F13.455 E F0 .955 +(option indicates that)3.455 F .065 +(the remaining options and actions should apply to `)144 168 R(`empty') +-.74 E 2.564('c)-.74 G .064(ommand completion; that is, comple-)-2.564 F +(tion attempted on a blank line.)144 180 Q 1.437 +(The process of applying these completion speci\214cations when w)144 +204 R 1.438(ord completion is attempted is)-.1 F(described abo)144 216 Q +.3 -.15(ve u)-.15 H(nder).15 E F1(Pr)2.5 E(ogrammable Completion)-.18 E +F0(.)A .556(Other options, if speci\214ed, ha)144 240 R .856 -.15(ve t) +-.2 H .555(he follo).15 F .555(wing meanings.)-.25 F .555(The ar)5.555 F +.555(guments to the)-.18 F F13.055 E F0(,)A F13.055 E F0 +3.055(,a)C(nd)-3.055 E F13.055 E F0 .722 +(options \(and, if necessary)144 252 R 3.222(,t)-.65 G(he)-3.222 E F1 +3.222 E F0(and)3.222 E F13.222 E F0 .723 +(options\) should be quoted to protect them from e)3.222 F(xpan-)-.15 E +(sion before the)144 264 Q F1(complete)2.5 E F0 -.2(bu)2.5 G +(iltin is in).2 E -.2(vo)-.4 G -.1(ke).2 G(d.).1 E F1144 276 Q F2 +(comp-option)2.5 E F0(The)184 288 Q F2(comp-option)2.791 E F0 .291 +(controls se)2.791 F -.15(ve)-.25 G .291(ral aspects of the compspec') +.15 F 2.791(sb)-.55 G(eha)-2.791 E .291(vior be)-.2 F .291 +(yond the simple)-.15 F(generation of completions.)184 300 Q F2 +(comp-option)5 E F0(may be one of:)2.5 E F1(bashdefault)184 312 Q F0 +.281(Perform the rest of the def)224 324 R(ault)-.1 E F1(bash)2.781 E F0 +.281(completions if the compspec generates no)2.781 F(matches.)224 336 Q +F1(default)184 348 Q F0 2.876(Use readline')10 F 5.376(sd)-.55 G(ef) +-5.376 E 2.875(ault \214lename completion if the compspec generates no) +-.1 F(matches.)224 360 Q F1(dir)184 372 Q(names)-.15 E F0(Perform direc\ +tory name completion if the compspec generates no matches.)224 384 Q F1 +(\214lenames)184 396 Q F0 -.7(Te)224 408 S .137(ll readline that the co\ +mpspec generates \214lenames, so it can perform an).7 F 2.637<798c>-.15 +G(le-)-2.637 E .134(name\255speci\214c processing \(lik)224 420 R 2.634 +(ea)-.1 G .134(dding a slash to directory names, quoting spe-)-2.634 F +.45(cial characters, or suppressing trailing spaces\).)224 432 R .45 +(Intended to be used with shell)5.45 F(functions.)224 444 Q F1(noquote) +184 456 Q F0 -.7(Te)5.55 G .814 +(ll readline not to quote the completed w).7 F .814(ords if the)-.1 F +3.314(ya)-.15 G .814(re \214lenames \(quoting)-3.314 F +(\214lenames is the def)224 468 Q(ault\).)-.1 E F1(nospace)184 480 Q F0 +-.7(Te)6.11 G .22(ll readline not to append a space \(the def).7 F .22 +(ault\) to w)-.1 F .22(ords completed at the end)-.1 F(of the line.)224 +492 Q F1(plusdirs)184 504 Q F0 1.985(After an)5.54 F 4.485(ym)-.15 G +1.985(atches de\214ned by the compspec are generated, directory name) +-4.485 F .583(completion is attempted and an)224 516 R 3.084(ym)-.15 G +.584(atches are added to the results of the other)-3.084 F(actions.)224 +528 Q F1144 540 Q F2(action)2.5 E F0(The)184 552 Q F2(action)2.5 E +F0(may be one of the follo)2.5 E +(wing to generate a list of possible completions:)-.25 E F1(alias)184 +564 Q F0(Alias names.)20.55 E(May also be speci\214ed as)5 E F12.5 +E F0(.)A F1(arrayv)184 576 Q(ar)-.1 E F0(Array v)224 588 Q +(ariable names.)-.25 E F1 4.7(binding Readline)184 600 R F0 -.1(ke)2.5 G +2.5(yb)-.05 G(inding names.)-2.5 E F1 -.2(bu)184 612 S(iltin).2 E F0 +(Names of shell b)11.85 E(uiltin commands.)-.2 E +(May also be speci\214ed as)5 E F12.5 E F0(.)A F1(command)184 624 +Q F0(Command names.)224 636 Q(May also be speci\214ed as)5 E F12.5 +E F0(.)A F1(dir)184 648 Q(ectory)-.18 E F0(Directory names.)224 660 Q +(May also be speci\214ed as)5 E F12.5 E F0(.)A F1(disabled)184 672 +Q F0(Names of disabled shell b)224 684 Q(uiltins.)-.2 E F1(enabled)184 +696 Q F0(Names of enabled shell b)6.66 E(uiltins.)-.2 E F1(export)184 +708 Q F0(Names of e)12.23 E(xported shell v)-.15 E 2.5(ariables. May) +-.25 F(also be speci\214ed as)2.5 E F12.5 E F0(.)A(GNU Bash 4.3)72 +768 Q(2014 February 2)141.79 E(54)190.95 E 0 Cg EP +%%Page: 55 55 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(\214le)184 84 Q F0(File names.)27.22 E +(May also be speci\214ed as)5 E F12.5 E F0(.)A F1(function)184 96 +Q F0(Names of shell functions.)224 108 Q F1(gr)184 120 Q(oup)-.18 E F0 +(Group names.)14.62 E(May also be speci\214ed as)5 E F12.5 E F0(.) +A F1(helptopic)184 132 Q F0(Help topics as accepted by the)224 144 Q F1 +(help)2.5 E F0 -.2(bu)2.5 G(iltin.).2 E F1(hostname)184 156 Q F0 +(Hostnames, as tak)224 168 Q(en from the \214le speci\214ed by the)-.1 E +/F2 9/Times-Bold@0 SF(HOSTFILE)2.5 E F0(shell v)2.25 E(ariable.)-.25 E +F1(job)184 180 Q F0(Job names, if job control is acti)26.11 E -.15(ve) +-.25 G 5(.M).15 G(ay also be speci\214ed as)-5 E F12.5 E F0(.)A F1 +-.1(ke)184 192 S(yw).1 E(ord)-.1 E F0(Shell reserv)224 204 Q(ed w)-.15 E +2.5(ords. May)-.1 F(also be speci\214ed as)2.5 E F12.5 E F0(.)A F1 +(running)184 216 Q F0(Names of running jobs, if job control is acti)5.54 +E -.15(ve)-.25 G(.).15 E F1(ser)184 228 Q(vice)-.1 E F0(Service names.) +10.67 E(May also be speci\214ed as)5 E F12.5 E F0(.)A F1(setopt) +184 240 Q F0 -1.11(Va)14.45 G(lid ar)1.11 E(guments for the)-.18 E F1 +2.5 E F0(option to the)2.5 E F1(set)2.5 E F0 -.2(bu)2.5 G(iltin.) +.2 E F1(shopt)184 252 Q F0(Shell option names as accepted by the)16.66 E +F1(shopt)2.5 E F0 -.2(bu)2.5 G(iltin.).2 E F1(signal)184 264 Q F0 +(Signal names.)14.99 E F1(stopped)184 276 Q F0 +(Names of stopped jobs, if job control is acti)6.66 E -.15(ve)-.25 G(.) +.15 E F1(user)184 288 Q F0(User names.)21.67 E +(May also be speci\214ed as)5 E F12.5 E F0(.)A F1 -.1(va)184 300 S +(riable).1 E F0(Names of all shell v)5.1 E 2.5(ariables. May)-.25 F +(also be speci\214ed as)2.5 E F12.5 E F0(.)A F1144 312 Q/F3 +10/Times-Italic@0 SF(command)2.5 E(command)184 324 Q F0 1.056(is e)3.556 +F -.15(xe)-.15 G 1.056(cuted in a subshell en).15 F 1.056 +(vironment, and its output is used as the possible)-.4 F(completions.) +184 336 Q F1144 348 Q F3(function)2.5 E F0 .113 +(The shell function)184 360 R F3(function)2.614 E F0 .114(is e)2.614 F +-.15(xe)-.15 G .114(cuted in the current shell en).15 F 2.614 +(vironment. When)-.4 F .114(the func-)2.614 F .817(tion is e)184 372 R +-.15(xe)-.15 G .817(cuted, the \214rst ar).15 F .817(gument \()-.18 F F1 +($1)A F0 3.316(\)i)C 3.316(st)-3.316 G .816 +(he name of the command whose ar)-3.316 F(guments)-.18 E 1.407 +(are being completed, the second ar)184 384 R 1.407(gument \()-.18 F F1 +($2)A F0 3.907(\)i)C 3.907(st)-3.907 G 1.407(he w)-3.907 F 1.407 +(ord being completed, and the)-.1 F .104(third ar)184 396 R .104 +(gument \()-.18 F F1($3)A F0 2.604(\)i)C 2.604(st)-2.604 G .104(he w) +-2.604 F .104(ord preceding the w)-.1 F .103 +(ord being completed on the current com-)-.1 F .101(mand line.)184 408 R +.101(When it \214nishes, the possible completions are retrie)5.101 F +-.15(ve)-.25 G 2.602(df).15 G .102(rom the v)-2.602 F .102(alue of the) +-.25 F F2(COMPREPL)184 420 Q(Y)-.828 E F0(array v)2.25 E(ariable.)-.25 E +F1144 432 Q F3(globpat)2.5 E F0 1.008(The pathname e)184 444 R +1.008(xpansion pattern)-.15 F F3(globpat)3.507 E F0 1.007(is e)3.507 F +1.007(xpanded to generate the possible comple-)-.15 F(tions.)184 456 Q +F1144 468 Q F3(pr)2.5 E(e\214x)-.37 E(pr)184 480 Q(e\214x)-.37 E +F0 .534(is added at the be)3.034 F .534 +(ginning of each possible completion after all other options ha)-.15 F +-.15(ve)-.2 G(been applied.)184 492 Q F1144 504 Q F3(suf)2.5 E +2.81(\214x suf)-.18 F<8c78>-.18 E F0 +(is appended to each possible completion after all other options ha)2.5 +E .3 -.15(ve b)-.2 H(een applied.).15 E F1144 516 Q F3(wor)2.5 E +(dlist)-.37 E F0(The)184 528 Q F3(wor)3.64 E(dlist)-.37 E F0 1.14 +(is split using the characters in the)3.64 F F2(IFS)3.64 E F0 1.139 +(special v)3.39 F 1.139(ariable as delimiters, and)-.25 F 2.007 +(each resultant w)184 540 R 2.007(ord is e)-.1 F 4.507(xpanded. The)-.15 +F 2.008(possible completions are the members of the)4.507 F +(resultant list which match the w)184 552 Q(ord being completed.)-.1 E +F1144 564 Q F3(\214lterpat)2.5 E(\214lterpat)184 576 Q F0 .456 +(is a pattern as used for pathname e)2.956 F 2.956(xpansion. It)-.15 F +.455(is applied to the list of possible)2.956 F 1.596 +(completions generated by the preceding options and ar)184 588 R 1.596 +(guments, and each completion)-.18 F(matching)184 600 Q F3(\214lterpat) +3.205 E F0 .705(is remo)3.205 F -.15(ve)-.15 G 3.205(df).15 G .704 +(rom the list.)-3.205 F 3.204(Al)5.704 G(eading)-3.204 E F1(!)3.204 E F0 +(in)3.204 E F3(\214lterpat)3.204 E F0(ne)3.204 E -.05(ga)-.15 G .704 +(tes the pattern;).05 F(in this case, an)184 612 Q 2.5(yc)-.15 G +(ompletion not matching)-2.5 E F3(\214lterpat)2.5 E F0(is remo)2.5 E +-.15(ve)-.15 G(d.).15 E .466(The return v)144 628.8 R .466 +(alue is true unless an in)-.25 F -.25(va)-.4 G .466 +(lid option is supplied, an option other than).25 F F12.967 E F0 +(or)2.967 E F12.967 E F0 .467(is sup-)2.967 F 1.362 +(plied without a)144 640.8 R F3(name)3.862 E F0(ar)3.862 E 1.361 +(gument, an attempt is made to remo)-.18 F 1.661 -.15(ve a c)-.15 H +1.361(ompletion speci\214cation for a).15 F F3(name)144 652.8 Q F0 +(for which no speci\214cation e)2.5 E +(xists, or an error occurs adding a completion speci\214cation.)-.15 E +F1(compopt)108 669.6 Q F0([)2.5 E F1A F3(option)2.5 E F0 2.5(][)C +F1(\255DE)-2.5 E F0 2.5(][)C F1(+o)-2.5 E F3(option)2.5 E F0 2.5(][)C F3 +(name)-2.5 E F0(])A .447(Modify completion options for each)144 681.6 R +F3(name)2.947 E F0 .447(according to the)2.947 F F3(option)2.947 E F0 +.447(s, or for the currently-e)B -.15(xe)-.15 G(cuting).15 E .726 +(completion if no)144 693.6 R F3(name)3.226 E F0 3.226(sa)C .726 +(re supplied.)-3.226 F .725(If no)5.725 F F3(option)3.225 E F0 3.225(sa) +C .725(re gi)-3.225 F -.15(ve)-.25 G .725 +(n, display the completion options for).15 F(each)144 705.6 Q F3(name) +3.223 E F0 .723(or the current completion.)3.223 F .724(The possible v) +5.724 F .724(alues of)-.25 F F3(option)3.224 E F0 .724(are those v)3.224 +F .724(alid for the)-.25 F F1(com-)3.224 E(plete)144 717.6 Q F0 -.2(bu) +2.798 G .298(iltin described abo).2 F -.15(ve)-.15 G 5.297(.T).15 G(he) +-5.297 E F12.797 E F0 .297 +(option indicates that the remaining options should apply to)2.797 F +1.227(the `)144 729.6 R(`def)-.74 E(ault')-.1 E 3.727('c)-.74 G 1.228(o\ +mmand completion; that is, completion attempted on a command for which \ +no)-3.727 F(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(55)190.95 E 0 +Cg EP +%%Page: 56 56 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E 2.178(completion has pre)144 84 R 2.178(viously been de\214ned.) +-.25 F(The)7.178 E/F1 10/Times-Bold@0 SF4.678 E F0 2.177 +(option indicates that the remaining options)4.677 F(should apply to `) +144 96 Q(`empty')-.74 E 2.5('c)-.74 G +(ommand completion; that is, completion attempted on a blank line.)-2.5 +E 1.387(The return v)144 120 R 1.387(alue is true unless an in)-.25 F +-.25(va)-.4 G 1.388 +(lid option is supplied, an attempt is made to modify the).25 F +(options for a)144 132 Q/F2 10/Times-Italic@0 SF(name)2.5 E F0 +(for which no completion speci\214cation e)2.5 E +(xists, or an output error occurs.)-.15 E F1(continue)108 148.8 Q F0([) +2.5 E F2(n)A F0(])A 1.754(Resume the ne)144 160.8 R 1.754 +(xt iteration of the enclosing)-.15 F F1 -.25(fo)4.254 G(r).25 E F0(,)A +F1(while)4.254 E F0(,)A F1(until)4.254 E F0 4.254(,o)C(r)-4.254 E F1 +(select)4.254 E F0 4.253(loop. If)4.254 F F2(n)4.613 E F0 1.753 +(is speci\214ed,)4.493 F 1.208(resume at the)144 172.8 R F2(n)3.709 E F0 +1.209(th enclosing loop.)B F2(n)6.569 E F0 1.209(must be)3.949 F/F3 10 +/Symbol SF3.709 E F0 3.709(1. If)3.709 F F2(n)4.069 E F0 1.209 +(is greater than the number of enclosing)3.949 F .514 +(loops, the last enclosing loop \(the `)144 184.8 R(`top-le)-.74 E -.15 +(ve)-.25 G(l').15 E 3.014('l)-.74 G .514(oop\) is resumed.)-3.014 F .513 +(The return v)5.513 F .513(alue is 0 unless)-.25 F F2(n)3.013 E F0(is) +3.013 E(not greater than or equal to 1.)144 196.8 Q F1(declar)108 213.6 +Q(e)-.18 E F0([)2.5 E F1(\255aAfFgilnrtux)A F0 2.5(][)C F1-2.5 E +F0 2.5(][)C F2(name)-2.5 E F0([=)A F2(value)A F0 2.5(].)C(..])-2.5 E F1 +(typeset)108 225.6 Q F0([)2.5 E F1(\255aAfFgilnrtux)A F0 2.5(][)C F1 +-2.5 E F0 2.5(][)C F2(name)-2.5 E F0([=)A F2(value)A F0 2.5(].)C +(..])-2.5 E 1.264(Declare v)144 237.6 R 1.264(ariables and/or gi)-.25 F +1.564 -.15(ve t)-.25 H 1.264(hem attrib).15 F 3.765(utes. If)-.2 F(no) +3.765 E F2(name)3.765 E F0 3.765(sa)C 1.265(re gi)-3.765 F -.15(ve)-.25 +G 3.765(nt).15 G 1.265(hen display the v)-3.765 F 1.265(alues of)-.25 F +-.25(va)144 249.6 S 3.483(riables. The).25 F F13.483 E F0 .983 +(option will display the attrib)3.483 F .983(utes and v)-.2 F .982 +(alues of each)-.25 F F2(name)3.482 E F0 5.982(.W).18 G(hen)-5.982 E F1 +3.482 E F0 .982(is used)3.482 F(with)144 261.6 Q F2(name)2.774 E +F0(ar)2.774 E .274(guments, additional options, other than)-.18 F F1 +2.775 E F0(and)2.775 E F12.775 E F0 2.775(,a)C .275 +(re ignored.)-2.775 F(When)5.275 E F12.775 E F0 .275(is supplied) +2.775 F(without)144 273.6 Q F2(name)4.814 E F0(ar)4.814 E 2.314 +(guments, it will display the attrib)-.18 F 2.314(utes and v)-.2 F 2.313 +(alues of all v)-.25 F 2.313(ariables ha)-.25 F 2.313(ving the)-.2 F +(attrib)144 285.6 Q 1.181(utes speci\214ed by the additional options.) +-.2 F 1.182(If no other options are supplied with)6.181 F F13.682 +E F0(,)A F1(declar)3.682 E(e)-.18 E F0 .62(will display the attrib)144 +297.6 R .62(utes and v)-.2 F .62(alues of all shell v)-.25 F 3.12 +(ariables. The)-.25 F F13.12 E F0 .62 +(option will restrict the display)3.12 F 1.29(to shell functions.)144 +309.6 R(The)6.29 E F13.79 E F0 1.291(option inhibits the display \ +of function de\214nitions; only the function)3.791 F .948 +(name and attrib)144 321.6 R .948(utes are printed.)-.2 F .948(If the) +5.948 F F1(extdeb)3.448 E(ug)-.2 E F0 .948 +(shell option is enabled using)3.448 F F1(shopt)3.448 E F0 3.448(,t)C +.948(he source)-3.448 F 1.342(\214le name and line number where the fun\ +ction is de\214ned are displayed as well.)144 333.6 R(The)6.342 E F1 +3.842 E F0(option)3.842 E(implies)144 345.6 Q F13.892 E F0 +6.392(.T)C(he)-6.392 E F13.892 E F0 1.391(option forces v)3.892 F +1.391(ariables to be created or modi\214ed at the global scope, e)-.25 F +-.15(ve)-.25 G(n).15 E(when)144 357.6 Q F1(declar)4.382 E(e)-.18 E F0 +1.882(is e)4.382 F -.15(xe)-.15 G 1.882(cuted in a shell function.).15 F +1.883(It is ignored in all other cases.)6.882 F 1.883(The follo)6.883 F +(wing)-.25 E .794(options can be used to restrict output to v)144 369.6 +R .794(ariables with the speci\214ed attrib)-.25 F .793(ute or to gi)-.2 +F 1.093 -.15(ve v)-.25 H(ariables)-.1 E(attrib)144 381.6 Q(utes:)-.2 E +F1144 393.6 Q F0(Each)25.3 E F2(name)2.5 E F0(is an inde)2.5 E +-.15(xe)-.15 G 2.5(da).15 G(rray v)-2.5 E(ariable \(see)-.25 E F1 +(Arrays)2.5 E F0(abo)2.5 E -.15(ve)-.15 G(\).).15 E F1144 405.6 Q +F0(Each)23.08 E F2(name)2.5 E F0(is an associati)2.5 E .3 -.15(ve a)-.25 +H(rray v).15 E(ariable \(see)-.25 E F1(Arrays)2.5 E F0(abo)2.5 E -.15 +(ve)-.15 G(\).).15 E F1144 417.6 Q F0(Use function names only) +26.97 E(.)-.65 E F1144 429.6 Q F0 .557(The v)27.52 F .558 +(ariable is treated as an inte)-.25 F .558(ger; arithmetic e)-.15 F -.25 +(va)-.25 G .558(luation \(see).25 F/F4 9/Times-Bold@0 SF .558 +(ARITHMETIC EV)3.058 F(ALU)-1.215 E(A-)-.54 E(TION)180 441.6 Q F0(abo) +2.25 E -.15(ve)-.15 G 2.5(\)i).15 G 2.5(sp)-2.5 G(erformed when the v) +-2.5 E(ariable is assigned a v)-.25 E(alue.)-.25 E F1144 453.6 Q +F0 .91(When the v)27.52 F .909(ariable is assigned a v)-.25 F .909 +(alue, all upper)-.25 F .909(-case characters are con)-.2 F -.15(ve)-.4 +G .909(rted to lo).15 F(wer)-.25 E(-)-.2 E 2.5(case. The)180 465.6 R +(upper)2.5 E(-case attrib)-.2 E(ute is disabled.)-.2 E F1144 477.6 +Q F0(Gi)24.74 E 1.619 -.15(ve e)-.25 H(ach).15 E F2(name)3.819 E F0(the) +3.819 E F2(namer)3.819 E(ef)-.37 E F0(attrib)3.819 E 1.319 +(ute, making it a name reference to another v)-.2 F(ariable.)-.25 E +1.033(That other v)180 489.6 R 1.033(ariable is de\214ned by the v)-.25 +F 1.033(alue of)-.25 F F2(name)3.533 E F0 6.033(.A)C 1.033 +(ll references and assignments to)-6.033 F F2(name)180 501.6 Q F0 4.032 +(,e)C 1.532(xcept for changing the)-4.182 F F14.032 E F0(attrib) +4.032 E 1.532(ute itself, are performed on the v)-.2 F 1.533 +(ariable refer)-.25 F(-)-.2 E(enced by)180 513.6 Q F2(name)2.5 E F0 1.1 +-.55('s v)D 2.5(alue. The).3 F F12.5 E F0(attrib)2.5 E +(ute cannot be applied to array v)-.2 E(ariables.)-.25 E F1144 +525.6 Q F0(Mak)25.86 E(e)-.1 E F2(name)5.047 E F0 5.047(sr)C(eadonly) +-5.047 E 7.547(.T)-.65 G 2.546(hese names cannot then be assigned v) +-7.547 F 2.546(alues by subsequent)-.25 F +(assignment statements or unset.)180 537.6 Q F1144 549.6 Q F0(Gi) +26.97 E .729 -.15(ve e)-.25 H(ach).15 E F2(name)2.929 E F0(the)2.929 E +F2(tr)2.929 E(ace)-.15 E F0(attrib)2.929 E 2.929(ute. T)-.2 F .429 +(raced functions inherit the)-.35 F F1(DEB)2.929 E(UG)-.1 E F0(and)2.93 +E F1(RETURN)2.93 E F0(traps from the calling shell.)180 561.6 Q +(The trace attrib)5 E(ute has no special meaning for v)-.2 E(ariables.) +-.25 E F1144 573.6 Q F0 .91(When the v)24.74 F .909 +(ariable is assigned a v)-.25 F .909(alue, all lo)-.25 F(wer)-.25 E .909 +(-case characters are con)-.2 F -.15(ve)-.4 G .909(rted to upper).15 F +(-)-.2 E 2.5(case. The)180 585.6 R(lo)2.5 E(wer)-.25 E(-case attrib)-.2 +E(ute is disabled.)-.2 E F1144 597.6 Q F0(Mark)25.3 E F2(name)2.5 +E F0 2.5(sf)C(or e)-2.5 E(xport to subsequent commands via the en)-.15 E +(vironment.)-.4 E .12(Using `+' instead of `\255' turns of)144 614.4 R +2.62(ft)-.25 G .12(he attrib)-2.62 F .121(ute instead, with the e)-.2 F +.121(xceptions that)-.15 F F1(+a)2.621 E F0 .121(may not be used)2.621 F +.645(to destro)144 626.4 R 3.145(ya)-.1 G 3.145(na)-3.145 G .645(rray v) +-3.145 F .645(ariable and)-.25 F F1(+r)3.145 E F0 .645(will not remo) +3.145 F .945 -.15(ve t)-.15 H .645(he readonly attrib).15 F 3.144 +(ute. When)-.2 F .644(used in a func-)3.144 F(tion,)144 638.4 Q F1 +(declar)2.835 E(e)-.18 E F0(and)2.835 E F1(typeset)2.835 E F0(mak)2.835 +E 2.835(ee)-.1 G(ach)-2.835 E F2(name)2.835 E F0 .335 +(local, as with the)2.835 F F1(local)2.835 E F0 .335 +(command, unless the)2.835 F F12.835 E F0(option)2.835 E 1.283 +(is supplied.)144 650.4 R 1.283(If a v)6.283 F 1.283 +(ariable name is follo)-.25 F 1.283(wed by =)-.25 F F2(value)A F0 3.783 +(,t)C 1.283(he v)-3.783 F 1.283(alue of the v)-.25 F 1.282 +(ariable is set to)-.25 F F2(value)3.782 E F0(.)A .926(When using)144 +662.4 R F13.426 E F0(or)3.426 E F13.426 E F0 .927 +(and the compound assignment syntax to create array v)3.426 F .927 +(ariables, additional)-.25 F(attrib)144 674.4 Q .592(utes do not tak)-.2 +F 3.092(ee)-.1 G -.25(ff)-3.092 G .592 +(ect until subsequent assignments.).25 F .592(The return v)5.592 F .592 +(alue is 0 unless an in)-.25 F -.25(va)-.4 G(lid).25 E .429 +(option is encountered, an attempt is made to de\214ne a function using) +144 686.4 R/F5 10/Courier@0 SF .429(\255f foo=bar)2.929 F F0 2.929(,a)C +2.929(na)-2.929 G .429(ttempt is)-2.929 F .063(made to assign a v)144 +698.4 R .063(alue to a readonly v)-.25 F .062 +(ariable, an attempt is made to assign a v)-.25 F .062 +(alue to an array v)-.25 F(ari-)-.25 E .102 +(able without using the compound assignment syntax \(see)144 710.4 R F1 +(Arrays)2.602 E F0(abo)2.602 E -.15(ve)-.15 G .102(\), one of the).15 F +F2(names)2.602 E F0 .102(is not a)2.602 F -.25(va)144 722.4 S .172 +(lid shell v).25 F .171(ariable name, an attempt is made to turn of)-.25 +F 2.671(fr)-.25 G .171(eadonly status for a readonly v)-2.671 F .171 +(ariable, an)-.25 F(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(56) +190.95 E 0 Cg EP +%%Page: 57 57 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .96(attempt is made to turn of)144 84 R 3.46(fa)-.25 G .96 +(rray status for an array v)-3.46 F .96 +(ariable, or an attempt is made to display a)-.25 F(non-e)144 96 Q +(xistent function with)-.15 E/F1 10/Times-Bold@0 SF2.5 E F0(.)A F1 +(dirs [\255clpv] [+)108 112.8 Q/F2 10/Times-Italic@0 SF(n)A F1 2.5(][)C +-2.5 E F2(n)A F1(])A F0 -.4(Wi)144 124.8 S .329 +(thout options, displays the list of currently remembered directories.) +.4 F .328(The def)5.328 F .328(ault display is on a)-.1 F 1.238 +(single line with directory names separated by spaces.)144 136.8 R 1.238 +(Directories are added to the list with the)6.238 F F1(pushd)144 148.8 Q +F0(command; the)2.5 E F1(popd)2.5 E F0(command remo)2.5 E -.15(ve)-.15 G +2.5(se).15 G(ntries from the list.)-2.5 E F1144 160.8 Q F0 +(Clears the directory stack by deleting all of the entries.)25.86 E F1 +144 172.8 Q F0 .882 +(Produces a listing using full pathnames; the def)27.52 F .881 +(ault listing format uses a tilde to denote)-.1 F(the home directory)180 +184.8 Q(.)-.65 E F1144 196.8 Q F0 +(Print the directory stack with one entry per line.)24.74 E F1144 +208.8 Q F0 .272(Print the directory stack with one entry per line, pre\ +\214xing each entry with its inde)25.3 F 2.773(xi)-.15 G 2.773(nt)-2.773 +G(he)-2.773 E(stack.)180 220.8 Q F1(+)144 232.8 Q F2(n)A F0 1.565 +(Displays the)25.3 F F2(n)4.065 E F0 1.565 +(th entry counting from the left of the list sho)B 1.564(wn by)-.25 F F1 +(dirs)4.064 E F0 1.564(when in)4.064 F -.2(vo)-.4 G -.1(ke).2 G(d).1 E +(without options, starting with zero.)180 244.8 Q F1144 256.8 Q F2 +(n)A F0 1.194(Displays the)25.3 F F2(n)3.694 E F0 1.194 +(th entry counting from the right of the list sho)B 1.194(wn by)-.25 F +F1(dirs)3.694 E F0 1.194(when in)3.694 F -.2(vo)-.4 G -.1(ke).2 G(d).1 E +(without options, starting with zero.)180 268.8 Q .258(The return v)144 +285.6 R .258(alue is 0 unless an in)-.25 F -.25(va)-.4 G .258 +(lid option is supplied or).25 F F2(n)2.758 E F0(inde)2.758 E -.15(xe) +-.15 G 2.758(sb).15 G -.15(ey)-2.758 G .258(ond the end of the direc-) +.15 F(tory stack.)144 297.6 Q F1(diso)108 314.4 Q(wn)-.1 E F0([)2.5 E F1 +(\255ar)A F0 2.5(][)C F1-2.5 E F0 2.5(][)C F2(jobspec)-2.5 E F0 +(...])2.5 E -.4(Wi)144 326.4 S .121(thout options, remo).4 F .422 -.15 +(ve e)-.15 H(ach).15 E F2(jobspec)4.362 E F0 .122 +(from the table of acti)2.932 F .422 -.15(ve j)-.25 H 2.622(obs. If).15 +F F2(jobspec)4.362 E F0 .122(is not present, and)2.932 F .096 +(neither the)144 338.4 R F12.596 E F0 .096(nor the)2.596 F F1 +2.596 E F0 .096(option is supplied, the)2.596 F F2(curr)2.596 E +.096(ent job)-.37 F F0 .096(is used.)2.596 F .096(If the)5.096 F F1 +2.596 E F0 .096(option is gi)2.596 F -.15(ve)-.25 G .096(n, each) +.15 F F2(jobspec)144 350.4 Q F0 .672(is not remo)3.482 F -.15(ve)-.15 G +3.172(df).15 G .672(rom the table, b)-3.172 F .672(ut is mark)-.2 F .672 +(ed so that)-.1 F/F3 9/Times-Bold@0 SF(SIGHUP)3.172 E F0 .673 +(is not sent to the job if the)2.922 F .962(shell recei)144 362.4 R -.15 +(ve)-.25 G 3.462(sa).15 G F3(SIGHUP)A/F4 9/Times-Roman@0 SF(.)A F0 .962 +(If no)5.462 F F2(jobspec)5.202 E F0 .962(is supplied, the)3.772 F F1 +3.462 E F0 .962(option means to remo)3.462 F 1.262 -.15(ve o)-.15 +H 3.462(rm).15 G .962(ark all)-3.462 F 1.358(jobs; the)144 374.4 R F1 +3.858 E F0 1.358(option without a)3.858 F F2(jobspec)5.598 E F0 +(ar)4.169 E 1.359(gument restricts operation to running jobs.)-.18 F +1.359(The return)6.359 F -.25(va)144 386.4 S(lue is 0 unless a).25 E F2 +(jobspec)4.24 E F0(does not specify a v)2.81 E(alid job)-.25 E(.)-.4 E +F1(echo)108 403.2 Q F0([)2.5 E F1(\255neE)A F0 2.5(][)C F2(ar)-2.5 E(g) +-.37 E F0(...])2.5 E .425(Output the)144 415.2 R F2(ar)2.925 E(g)-.37 E +F0 .424(s, separated by spaces, follo)B .424(wed by a ne)-.25 F 2.924 +(wline. The)-.25 F .424(return status is 0 unless a write)2.924 F .307 +(error occurs.)144 427.2 R(If)5.307 E F12.807 E F0 .307 +(is speci\214ed, the trailing ne)2.807 F .308(wline is suppressed.)-.25 +F .308(If the)5.308 F F12.808 E F0 .308(option is gi)2.808 F -.15 +(ve)-.25 G .308(n, inter).15 F(-)-.2 E 1.349(pretation of the follo)144 +439.2 R 1.348(wing backslash-escaped characters is enabled.)-.25 F(The) +6.348 E F13.848 E F0 1.348(option disables the)3.848 F 1.054 +(interpretation of these escape characters, e)144 451.2 R -.15(ve)-.25 G +3.555(no).15 G 3.555(ns)-3.555 G 1.055(ystems where the)-3.555 F 3.555 +(ya)-.15 G 1.055(re interpreted by def)-3.555 F(ault.)-.1 E(The)144 +463.2 Q F1(xpg_echo)3.459 E F0 .959 +(shell option may be used to dynamically determine whether or not)3.459 +F F1(echo)3.458 E F0 -.15(ex)3.458 G(pands).15 E .715 +(these escape characters by def)144 475.2 R(ault.)-.1 E F1(echo)5.715 E +F0 .716(does not interpret)3.215 F F13.216 E F0 .716 +(to mean the end of options.)3.216 F F1(echo)5.716 E F0 +(interprets the follo)144 487.2 Q(wing escape sequences:)-.25 E F1(\\a) +144 499.2 Q F0(alert \(bell\))28.22 E F1(\\b)144 511.2 Q F0(backspace) +27.66 E F1(\\c)144 523.2 Q F0(suppress further output)28.78 E F1(\\e)144 +535.2 Q(\\E)144 547.2 Q F0(an escape character)26.55 E F1(\\f)144 559.2 +Q F0(form feed)29.89 E F1(\\n)144 571.2 Q F0(ne)27.66 E 2.5(wl)-.25 G +(ine)-2.5 E F1(\\r)144 583.2 Q F0(carriage return)28.78 E F1(\\t)144 +595.2 Q F0(horizontal tab)29.89 E F1(\\v)144 607.2 Q F0 -.15(ve)28.22 G +(rtical tab).15 E F1(\\\\)144 619.2 Q F0(backslash)30.44 E F1(\\0)144 +631.2 Q F2(nnn)A F0(the eight-bit character whose v)13.22 E +(alue is the octal v)-.25 E(alue)-.25 E F2(nnn)2.5 E F0 +(\(zero to three octal digits\))2.5 E F1(\\x)144 643.2 Q F2(HH)A F0 +(the eight-bit character whose v)13.78 E(alue is the he)-.25 E +(xadecimal v)-.15 E(alue)-.25 E F2(HH)2.5 E F0(\(one or tw)2.5 E 2.5(oh) +-.1 G .3 -.15(ex d)-2.5 H(igits\)).15 E F1(\\u)144 655.2 Q F2(HHHH)A F0 +1.507(the Unicode \(ISO/IEC 10646\) character whose v)180 667.2 R 1.506 +(alue is the he)-.25 F 1.506(xadecimal v)-.15 F(alue)-.25 E F2(HHHH) +4.006 E F0(\(one to four he)180 679.2 Q 2.5(xd)-.15 G(igits\))-2.5 E F1 +(\\U)144 691.2 Q F2(HHHHHHHH)A F0 .547 +(the Unicode \(ISO/IEC 10646\) character whose v)180 703.2 R .547 +(alue is the he)-.25 F .548(xadecimal v)-.15 F(alue)-.25 E F2(HHHHH-) +3.048 E(HHH)180 715.2 Q F0(\(one to eight he)2.5 E 2.5(xd)-.15 G +(igits\))-2.5 E(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(57)190.95 +E 0 Cg EP +%%Page: 58 58 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(enable)108 84 Q F0([)2.5 E F1A F0 2.5 +(][)C F1(\255dnps)-2.5 E F0 2.5(][)C F1-2.5 E/F2 10/Times-Italic@0 +SF(\214lename)2.5 E F0 2.5(][)C F2(name)-2.5 E F0(...])2.5 E .278 +(Enable and disable b)144 96 R .278(uiltin shell commands.)-.2 F .278 +(Disabling a b)5.278 F .278(uiltin allo)-.2 F .278 +(ws a disk command which has)-.25 F .833(the same name as a shell b)144 +108 R .834(uiltin to be e)-.2 F -.15(xe)-.15 G .834 +(cuted without specifying a full pathname, e).15 F -.15(ve)-.25 G 3.334 +(nt).15 G(hough)-3.334 E .99(the shell normally searches for b)144 120 R +.989(uiltins before disk commands.)-.2 F(If)5.989 E F13.489 E F0 +.989(is used, each)3.489 F F2(name)3.489 E F0 .989(is dis-)3.489 F 1.581 +(abled; otherwise,)144 132 R F2(names)4.082 E F0 1.582(are enabled.) +4.082 F -.15(Fo)6.582 G 4.082(re).15 G 1.582(xample, to use the)-4.232 F +F1(test)4.082 E F0 1.582(binary found via the)4.082 F/F3 9/Times-Bold@0 +SF -.666(PA)4.082 G(TH)-.189 E F0 .081(instead of the shell b)144 144 R +.081(uiltin v)-.2 F .081(ersion, run)-.15 F/F4 10/Courier@0 SF .081 +(enable -n test)2.581 F F0 5.081(.T)C(he)-5.081 E F12.58 E F0 .08 +(option means to load the ne)2.58 F(w)-.25 E -.2(bu)144 156 S 1.524 +(iltin command).2 F F2(name)4.384 E F0 1.524(from shared object)4.204 F +F2(\214lename)4.024 E F0 4.024(,o).18 G 4.024(ns)-4.024 G 1.524 +(ystems that support dynamic loading.)-4.024 F(The)144 168 Q F1 +2.867 E F0 .367(option will delete a b)2.867 F .367(uiltin pre)-.2 F +.367(viously loaded with)-.25 F F12.866 E F0 5.366(.I)C 2.866(fn) +-5.366 G(o)-2.866 E F2(name)2.866 E F0(ar)2.866 E .366(guments are gi) +-.18 F -.15(ve)-.25 G .366(n, or).15 F .398(if the)144 180 R F1 +2.898 E F0 .399(option is supplied, a list of shell b)2.899 F .399 +(uiltins is printed.)-.2 F -.4(Wi)5.399 G .399(th no other option ar).4 +F .399(guments, the)-.18 F .099(list consists of all enabled shell b)144 +192 R 2.598(uiltins. If)-.2 F F12.598 E F0 .098 +(is supplied, only disabled b)2.598 F .098(uiltins are printed.)-.2 F +(If)5.098 E F12.598 E F0 1.916 +(is supplied, the list printed includes all b)144 204 R 1.916 +(uiltins, with an indication of whether or not each is)-.2 F 2.879 +(enabled. If)144 216 R F12.879 E F0 .379 +(is supplied, the output is restricted to the POSIX)2.879 F F2(special) +2.879 E F0 -.2(bu)2.878 G 2.878(iltins. The).2 F .378(return v)2.878 F +(alue)-.25 E .994(is 0 unless a)144 228 R F2(name)3.854 E F0 .994 +(is not a shell b)3.674 F .994(uiltin or there is an error loading a ne) +-.2 F 3.495(wb)-.25 G .995(uiltin from a shared)-3.695 F(object.)144 240 +Q F1 -2.3 -.15(ev a)108 256.8 T(l).15 E F0([)2.5 E F2(ar)A(g)-.37 E F0 +(...])2.5 E(The)144 268.8 Q F2(ar)3.171 E(g)-.37 E F0 3.171(sa)C .671 +(re read and concatenated together into a single command.)-3.171 F .67 +(This command is then read)5.67 F .495(and e)144 280.8 R -.15(xe)-.15 G +.495(cuted by the shell, and its e).15 F .495 +(xit status is returned as the v)-.15 F .495(alue of)-.25 F F1 -2.3 -.15 +(ev a)2.995 H(l).15 E F0 5.495(.I)C 2.995(ft)-5.495 G .495(here are no) +-2.995 F F2(ar)2.995 E(gs)-.37 E F0(,).27 E(or only null ar)144 292.8 Q +(guments,)-.18 E F1 -2.3 -.15(ev a)2.5 H(l).15 E F0(returns 0.)2.5 E F1 +(exec)108 309.6 Q F0([)2.5 E F1(\255cl)A F0 2.5(][)C F1-2.5 E F2 +(name)2.5 E F0 2.5(][)C F2(command)-2.5 E F0([)2.5 E F2(ar)A(guments) +-.37 E F0(]])A(If)144 321.6 Q F2(command)3.006 E F0 .306 +(is speci\214ed, it replaces the shell.)3.576 F .305(No ne)5.305 F 2.805 +(wp)-.25 G .305(rocess is created.)-2.805 F(The)5.305 E F2(ar)3.135 E +(guments)-.37 E F0(become)3.075 E .176(the ar)144 333.6 R .176 +(guments to)-.18 F F2(command)2.676 E F0 5.176(.I)C 2.676(ft)-5.176 G +(he)-2.676 E F12.676 E F0 .176 +(option is supplied, the shell places a dash at the be)2.676 F .177 +(ginning of)-.15 F .5(the zeroth ar)144 345.6 R .5(gument passed to)-.18 +F F2(command)3 E F0 5.499(.T).77 G .499(his is what)-5.499 F F2(lo)2.999 +E(gin)-.1 E F0 .499(\(1\) does.).24 F(The)5.499 E F12.999 E F0 +.499(option causes)2.999 F F2(com-)3.199 E(mand)144 357.6 Q F0 .638 +(to be e)3.908 F -.15(xe)-.15 G .638(cuted with an empty en).15 F 3.138 +(vironment. If)-.4 F F13.138 E F0 .638 +(is supplied, the shell passes)3.138 F F2(name)3.499 E F0 .639(as the) +3.319 F 1.078(zeroth ar)144 369.6 R 1.077(gument to the e)-.18 F -.15 +(xe)-.15 G 1.077(cuted command.).15 F(If)6.077 E F2(command)3.777 E F0 +1.077(cannot be e)4.347 F -.15(xe)-.15 G 1.077(cuted for some reason, a) +.15 F(non-interacti)144 381.6 Q .876 -.15(ve s)-.25 H .576(hell e).15 F +.576(xits, unless the)-.15 F F1(execfail)3.076 E F0 .577 +(shell option is enabled.)3.077 F .577(In that case, it returns f)5.577 +F(ail-)-.1 E 2.505(ure. An)144 393.6 R(interacti)2.505 E .305 -.15(ve s) +-.25 H .005(hell returns f).15 F .005(ailure if the \214le cannot be e) +-.1 F -.15(xe)-.15 G 2.505(cuted. If).15 F F2(command)2.705 E F0 .005 +(is not speci\214ed,)3.275 F(an)144 405.6 Q 3.036(yr)-.15 G .536 +(edirections tak)-3.036 F 3.036(ee)-.1 G -.25(ff)-3.036 G .536 +(ect in the current shell, and the return status is 0.).25 F .536 +(If there is a redirection)5.536 F(error)144 417.6 Q 2.5(,t)-.4 G +(he return status is 1.)-2.5 E F1(exit)108 434.4 Q F0([)2.5 E F2(n)A F0 +6.29(]C)C .096(ause the shell to e)-6.29 F .096(xit with a status of) +-.15 F F2(n)2.596 E F0 5.096(.I)C(f)-5.096 E F2(n)2.955 E F0 .095 +(is omitted, the e)2.835 F .095(xit status is that of the last command) +-.15 F -.15(exe)144 446.4 S 2.5(cuted. A).15 F(trap on)2.5 E F3(EXIT)2.5 +E F0(is e)2.25 E -.15(xe)-.15 G(cuted before the shell terminates.).15 E +F1(export)108 463.2 Q F0([)2.5 E F1(\255fn)A F0 2.5(][).833 G F2(name) +-2.5 E F0([=)A F2(wor)A(d)-.37 E F0(]] ...)A F1(export \255p)108 475.2 Q +F0 .256(The supplied)144 487.2 R F2(names)3.117 E F0 .257(are mark)3.027 +F .257(ed for automatic e)-.1 F .257(xport to the en)-.15 F .257 +(vironment of subsequently e)-.4 F -.15(xe)-.15 G(cuted).15 E 2.627 +(commands. If)144 499.2 R(the)2.627 E F12.627 E F0 .127 +(option is gi)2.627 F -.15(ve)-.25 G .127(n, the).15 F F2(names)2.987 E +F0 .127(refer to functions.)2.897 F .127(If no)5.127 F F2(names)2.987 E +F0 .127(are gi)2.897 F -.15(ve)-.25 G .126(n, or if the).15 F F1 +144 511.2 Q F0 .048(option is supplied, a list of names of all e)2.547 F +.048(xported v)-.15 F .048(ariables is printed.)-.25 F(The)5.048 E F1 +2.548 E F0 .048(option causes the)2.548 F -.15(ex)144 523.2 S +1.447(port property to be remo).15 F -.15(ve)-.15 G 3.947(df).15 G 1.447 +(rom each)-3.947 F F2(name)3.947 E F0 6.447(.I)C 3.947(fav)-6.447 G +1.447(ariable name is follo)-4.197 F 1.447(wed by =)-.25 F F2(wor)A(d) +-.37 E F0 3.946(,t)C(he)-3.946 E -.25(va)144 535.2 S .741(lue of the v) +.25 F .741(ariable is set to)-.25 F F2(wor)3.241 E(d)-.37 E F0(.)A F1 +(export)5.741 E F0 .742(returns an e)3.242 F .742 +(xit status of 0 unless an in)-.15 F -.25(va)-.4 G .742(lid option is) +.25 F .032(encountered, one of the)144 547.2 R F2(names)2.532 E F0 .032 +(is not a v)2.532 F .032(alid shell v)-.25 F .032(ariable name, or)-.25 +F F12.531 E F0 .031(is supplied with a)2.531 F F2(name)2.891 E F0 +(that)2.711 E(is not a function.)144 559.2 Q F1(fc)108 576 Q F0([)2.5 E +F1A F2(ename)2.5 E F0 2.5(][)C F1(\255lnr)-2.5 E F0 2.5(][)C F2 +<8c72>-2.5 E(st)-.1 E F0 2.5(][)C F2(last)-2.5 E F0(])A F1(fc \255s)108 +588 Q F0([)2.5 E F2(pat)A F0(=)A F2 -.37(re)C(p).37 E F0 2.5(][)C F2 +(cmd)-2.5 E F0(])A .431 +(The \214rst form selects a range of commands from)144 600 R F2<8c72> +4.842 E(st)-.1 E F0(to)3.612 E F2(last)3.022 E F0 .432 +(from the history list and displays or)3.612 F .142(edits and re-e)144 +612 R -.15(xe)-.15 G .142(cutes them.).15 F F2 -.45(Fi)5.141 G -.1(rs) +.45 G(t).1 E F0(and)3.321 E F2(last)2.731 E F0 .141 +(may be speci\214ed as a string \(to locate the last command)3.321 F(be) +144 624 Q .31(ginning with that string\) or as a number \(an inde)-.15 F +2.811(xi)-.15 G .311(nto the history list, where a ne)-2.811 F -.05(ga) +-.15 G(ti).05 E .611 -.15(ve n)-.25 H(umber).15 E .315(is used as an of) +144 636 R .315(fset from the current command number\).)-.25 F(If)5.315 E +F2(last)2.904 E F0 .314(is not speci\214ed it is set to the cur)3.494 F +(-)-.2 E .948(rent command for listing \(so that)144 648 R F4 .948 +(fc \255l \25510)3.448 F F0 .948(prints the last 10 commands\) and to) +3.448 F F2<8c72>5.359 E(st)-.1 E F0(other)4.129 E(-)-.2 E 2.5(wise. If) +144 660 R F2<8c72>4.41 E(st)-.1 E F0 +(is not speci\214ed it is set to the pre)3.18 E +(vious command for editing and \25516 for listing.)-.25 E(The)144 684 Q +F12.522 E F0 .022 +(option suppresses the command numbers when listing.)2.522 F(The)5.022 E +F12.522 E F0 .022(option re)2.522 F -.15(ve)-.25 G .022 +(rses the order of).15 F .438(the commands.)144 696 R .438(If the)5.438 +F F12.938 E F0 .438(option is gi)2.938 F -.15(ve)-.25 G .438 +(n, the commands are listed on standard output.).15 F(Otherwise,)5.438 E +.335(the editor gi)144 708 R -.15(ve)-.25 G 2.835(nb).15 G(y)-2.835 E F2 +(ename)3.025 E F0 .335(is in)3.015 F -.2(vo)-.4 G -.1(ke).2 G 2.835(do) +.1 G 2.835(na\214)-2.835 G .335(le containing those commands.)-2.835 F +(If)5.334 E F2(ename)3.024 E F0 .334(is not gi)3.014 F -.15(ve)-.25 G +(n,).15 E 1.668(the v)144 720 R 1.668(alue of the)-.25 F F3(FCEDIT)4.168 +E F0 -.25(va)3.918 G 1.668(riable is used, and the v).25 F 1.669 +(alue of)-.25 F F3(EDIT)4.169 E(OR)-.162 E F0(if)3.919 E F3(FCEDIT)4.169 +E F0 1.669(is not set.)3.919 F(If)6.669 E(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(58)190.95 E 0 Cg EP +%%Page: 59 59 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .187(neither v)144 84 R .187(ariable is set,)-.25 F/F1 10 +/Times-Italic@0 SF(vi)4.353 E F0 .187(is used.)4.353 F .187 +(When editing is complete, the edited commands are echoed and)5.187 F +-.15(exe)144 96 S(cuted.).15 E .788(In the second form,)144 120 R F1 +(command)3.288 E F0 .788(is re-e)3.288 F -.15(xe)-.15 G .788 +(cuted after each instance of).15 F F1(pat)3.288 E F0 .788 +(is replaced by)3.288 F F1 -.37(re)3.289 G(p).37 E F0(.)A F1(Com-)5.789 +E(mand)144 132 Q F0 .347(is intepreted the same as)2.847 F F1<8c72>2.847 +E(st)-.1 E F0(abo)2.847 E -.15(ve)-.15 G 5.347(.A).15 G .347 +(useful alias to use with this is)-2.5 F/F2 10/Courier@0 SF .346 +(r='fc \255s')2.847 F F0 2.846(,s)C 2.846(ot)-2.846 G(hat)-2.846 E +(typing)144 144 Q F2 7.165(rc)3.665 G(c)-7.165 E F0 1.165 +(runs the last command be)3.665 F 1.166(ginning with)-.15 F F2(cc)3.666 +E F0 1.166(and typing)3.666 F F2(r)3.666 E F0(re-e)3.666 E -.15(xe)-.15 +G 1.166(cutes the last com-).15 F(mand.)144 156 Q .142 +(If the \214rst form is used, the return v)144 180 R .142 +(alue is 0 unless an in)-.25 F -.25(va)-.4 G .142 +(lid option is encountered or).25 F F1<8c72>4.552 E(st)-.1 E F0(or)3.322 +E F1(last)2.732 E F0 .454(specify history lines out of range.)144 192 R +.454(If the)5.454 F/F3 10/Times-Bold@0 SF2.954 E F0 .454 +(option is supplied, the return v)2.954 F .455(alue is the v)-.25 F .455 +(alue of the)-.25 F .788(last command e)144 204 R -.15(xe)-.15 G .788 +(cuted or f).15 F .787 +(ailure if an error occurs with the temporary \214le of commands.)-.1 F +.787(If the)5.787 F 1.135 +(second form is used, the return status is that of the command re-e)144 +216 R -.15(xe)-.15 G 1.136(cuted, unless).15 F F1(cmd)3.836 E F0 1.136 +(does not)4.406 F(specify a v)144 228 Q +(alid history line, in which case)-.25 E F3(fc)2.5 E F0(returns f)2.5 E +(ailure.)-.1 E F3(fg)108 244.8 Q F0([)2.5 E F1(jobspec)A F0(])A(Resume) +144 256.8 Q F1(jobspec)5.654 E F0 1.413(in the fore)4.224 F 1.413 +(ground, and mak)-.15 F 3.913(ei)-.1 G 3.913(tt)-3.913 G 1.413 +(he current job)-3.913 F 6.413(.I)-.4 G(f)-6.413 E F1(jobspec)5.653 E F0 +1.413(is not present, the)4.223 F(shell')144 268.8 Q 3.116(sn)-.55 G +.616(otion of the)-3.116 F F1(curr)3.116 E .616(ent job)-.37 F F0 .617 +(is used.)3.116 F .617(The return v)5.617 F .617 +(alue is that of the command placed into the)-.25 F(fore)144 280.8 Q +.363(ground, or f)-.15 F .363 +(ailure if run when job control is disabled or)-.1 F 2.862(,w)-.4 G .362 +(hen run with job control enabled, if)-2.862 F F1(jobspec)145.74 292.8 Q +F0 .004(does not specify a v)2.814 F .004(alid job or)-.25 F F1(jobspec) +4.244 E F0 .004(speci\214es a job that w)2.814 F .004 +(as started without job control.)-.1 F F3(getopts)108 309.6 Q F1 +(optstring name)2.5 E F0([)2.5 E F1(ar)A(gs)-.37 E F0(])A F3(getopts)144 +321.6 Q F0 .793 +(is used by shell procedures to parse positional parameters.)3.294 F F1 +(optstring)6.023 E F0 .793(contains the option)3.513 F .149 +(characters to be recognized; if a character is follo)144 333.6 R .15 +(wed by a colon, the option is e)-.25 F .15(xpected to ha)-.15 F .45 +-.15(ve a)-.2 H(n).15 E(ar)144 345.6 Q .579 +(gument, which should be separated from it by white space.)-.18 F .578 +(The colon and question mark char)5.579 F(-)-.2 E 1.665 +(acters may not be used as option characters.)144 357.6 R 1.665 +(Each time it is in)6.665 F -.2(vo)-.4 G -.1(ke).2 G(d,).1 E F3(getopts) +4.165 E F0 1.665(places the ne)4.165 F(xt)-.15 E .797 +(option in the shell v)144 369.6 R(ariable)-.25 E F1(name)3.297 E F0 +3.297(,i).18 G(nitializing)-3.297 E F1(name)3.657 E F0 .797 +(if it does not e)3.477 F .796(xist, and the inde)-.15 F 3.296(xo)-.15 G +3.296(ft)-3.296 G .796(he ne)-3.296 F(xt)-.15 E(ar)144 381.6 Q .085 +(gument to be processed into the v)-.18 F(ariable)-.25 E/F4 9 +/Times-Bold@0 SF(OPTIND)2.585 E/F5 9/Times-Roman@0 SF(.)A F4(OPTIND) +4.585 E F0 .085(is initialized to 1 each time the shell)2.335 F .846 +(or a shell script is in)144 393.6 R -.2(vo)-.4 G -.1(ke).2 G 3.345 +(d. When).1 F .845(an option requires an ar)3.345 F(gument,)-.18 E F3 +(getopts)3.345 E F0 .845(places that ar)3.345 F(gument)-.18 E .803 +(into the v)144 405.6 R(ariable)-.25 E F4(OPT)3.303 E(ARG)-.81 E F5(.)A +F0 .803(The shell does not reset)5.303 F F4(OPTIND)3.303 E F0 .804 +(automatically; it must be manually)3.054 F .294 +(reset between multiple calls to)144 417.6 R F3(getopts)2.793 E F0 .293 +(within the same shell in)2.793 F -.2(vo)-.4 G .293(cation if a ne).2 F +2.793(ws)-.25 G .293(et of parameters)-2.793 F(is to be used.)144 429.6 +Q 2.043(When the end of options is encountered,)144 453.6 R F3(getopts) +4.543 E F0 -.15(ex)4.543 G 2.043(its with a return v).15 F 2.044 +(alue greater than zero.)-.25 F F4(OPTIND)144 465.6 Q F0 +(is set to the inde)2.25 E 2.5(xo)-.15 G 2.5(ft)-2.5 G +(he \214rst non-option ar)-2.5 E(gument, and)-.18 E F1(name)2.5 E F0 +(is set to ?.)2.5 E F3(getopts)144 489.6 Q F0 2.393 +(normally parses the positional parameters, b)4.893 F 2.392 +(ut if more ar)-.2 F 2.392(guments are gi)-.18 F -.15(ve)-.25 G 4.892 +(ni).15 G(n)-4.892 E F1(ar)4.892 E(gs)-.37 E F0(,).27 E F3(getopts)144 +501.6 Q F0(parses those instead.)2.5 E F3(getopts)144 525.6 Q F0 1.165 +(can report errors in tw)3.665 F 3.665(ow)-.1 G 3.665(ays. If)-3.765 F +1.165(the \214rst character of)3.665 F F1(optstring)3.895 E F0 1.166 +(is a colon,)3.886 F F1(silent)4.006 E F0(error)4.346 E 1.071 +(reporting is used.)144 537.6 R 1.071 +(In normal operation, diagnostic messages are printed when in)6.071 F +-.25(va)-.4 G 1.07(lid options or).25 F .393(missing option ar)144 549.6 +R .393(guments are encountered.)-.18 F .394(If the v)5.394 F(ariable) +-.25 E F4(OPTERR)2.894 E F0 .394(is set to 0, no error messages)2.644 F +(will be displayed, e)144 561.6 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(ft) +-2.5 G(he \214rst character of)-2.5 E F1(optstring)2.73 E F0 +(is not a colon.)2.72 E .667(If an in)144 585.6 R -.25(va)-.4 G .667 +(lid option is seen,).25 F F3(getopts)3.167 E F0 .667(places ? into) +3.167 F F1(name)3.527 E F0 .666 +(and, if not silent, prints an error message)3.347 F .399(and unsets)144 +597.6 R F4(OPT)2.899 E(ARG)-.81 E F5(.)A F0(If)4.899 E F3(getopts)2.899 +E F0 .399(is silent, the option character found is placed in)2.899 F F4 +(OPT)2.899 E(ARG)-.81 E F0 .4(and no)2.65 F +(diagnostic message is printed.)144 609.6 Q 1.242(If a required ar)144 +633.6 R 1.242(gument is not found, and)-.18 F F3(getopts)3.741 E F0 +1.241(is not silent, a question mark \()3.741 F F3(?).833 E F0 3.741 +(\)i).833 G 3.741(sp)-3.741 G 1.241(laced in)-3.741 F F1(name)144 645.6 +Q F0(,).18 E F4(OPT)2.734 E(ARG)-.81 E F0 .234 +(is unset, and a diagnostic message is printed.)2.484 F(If)5.234 E F3 +(getopts)2.734 E F0 .235(is silent, then a colon \()2.734 F F3(:).833 E +F0(\)).833 E(is placed in)144 657.6 Q F1(name)2.86 E F0(and)2.68 E F4 +(OPT)2.5 E(ARG)-.81 E F0(is set to the option character found.)2.25 E F3 +(getopts)144 681.6 Q F0 .902 +(returns true if an option, speci\214ed or unspeci\214ed, is found.) +3.402 F .902(It returns f)5.902 F .901(alse if the end of)-.1 F +(options is encountered or an error occurs.)144 693.6 Q(GNU Bash 4.3)72 +768 Q(2014 February 2)141.79 E(59)190.95 E 0 Cg EP +%%Page: 60 60 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(hash)108 84 Q F0([)2.5 E F1(\255lr)A F0 2.5 +(][)C F1-2.5 E/F2 10/Times-Italic@0 SF(\214lename)2.5 E F0 2.5(][) +C F1(\255dt)-2.5 E F0 2.5(][)C F2(name)-2.5 E F0(])A .858(Each time)144 +96 R F1(hash)3.358 E F0 .858(is in)3.358 F -.2(vo)-.4 G -.1(ke).2 G .858 +(d, the full pathname of the command).1 F F2(name)3.718 E F0 .858 +(is determined by searching)3.538 F .956(the directories in)144 108 R F1 +($P)3.456 E -.95(AT)-.74 G(H).95 E F0 .956(and remembered.)3.456 F(An) +5.956 E 3.456(yp)-.15 G(re)-3.456 E .956 +(viously-remembered pathname is discarded.)-.25 F .242(If the)144 120 R +F12.742 E F0 .243 +(option is supplied, no path search is performed, and)2.742 F F2 +(\214lename)4.653 E F0 .243(is used as the full \214lename)2.923 F 1.712 +(of the command.)144 132 R(The)6.712 E F14.212 E F0 1.711 +(option causes the shell to for)4.212 F 1.711 +(get all remembered locations.)-.18 F(The)6.711 E F14.211 E F0 +.833(option causes the shell to for)144 144 R .833 +(get the remembered location of each)-.18 F F2(name)3.333 E F0 5.833(.I) +C 3.333(ft)-5.833 G(he)-3.333 E F13.333 E F0 .833(option is sup-) +3.333 F .704(plied, the full pathname to which each)144 156 R F2(name) +3.204 E F0 .703(corresponds is printed.)3.204 F .703(If multiple)5.703 F +F2(name)3.203 E F0(ar)3.203 E(guments)-.18 E .795(are supplied with)144 +168 R F13.295 E F0 3.295(,t)C(he)-3.295 E F2(name)3.295 E F0 .795 +(is printed before the hashed full pathname.)3.295 F(The)5.795 E F1 +3.295 E F0 .795(option causes)3.295 F .934 +(output to be displayed in a format that may be reused as input.)144 180 +R .934(If no ar)5.934 F .934(guments are gi)-.18 F -.15(ve)-.25 G .934 +(n, or if).15 F(only)144 192 Q F12.821 E F0 .321 +(is supplied, information about remembered commands is printed.)2.821 F +.322(The return status is true)5.322 F(unless a)144 204 Q F2(name)2.86 E +F0(is not found or an in)2.68 E -.25(va)-.4 G(lid option is supplied.) +.25 E F1(help)108 220.8 Q F0([)2.5 E F1(\255dms)A F0 2.5(][)C F2 +(pattern)-2.5 E F0(])A .867(Display helpful information about b)144 +232.8 R .867(uiltin commands.)-.2 F(If)5.867 E F2(pattern)4.617 E F0 +.866(is speci\214ed,)3.607 F F1(help)3.366 E F0(gi)3.366 E -.15(ve)-.25 +G 3.366(sd).15 G(etailed)-3.366 E .306(help on all commands matching)144 +244.8 R F2(pattern)2.806 E F0 2.807(;o).24 G .307 +(therwise help for all the b)-2.807 F .307 +(uiltins and shell control struc-)-.2 F(tures is printed.)144 256.8 Q F1 +144 268.8 Q F0(Display a short description of each)24.74 E F2 +(pattern)2.5 E F1144 280.8 Q F0(Display the description of each) +21.97 E F2(pattern)2.5 E F0(in a manpage-lik)2.5 E 2.5(ef)-.1 G(ormat) +-2.5 E F1144 292.8 Q F0 +(Display only a short usage synopsis for each)26.41 E F2(pattern)2.5 E +F0(The return status is 0 unless no command matches)144 309.6 Q F2 +(pattern)2.5 E F0(.).24 E F1(history [)108 326.4 Q F2(n)A F1(])A +(history \255c)108 338.4 Q(history \255d)108 350.4 Q F2(of)2.5 E(fset) +-.18 E F1(history \255anrw)108 362.4 Q F0([)2.5 E F2(\214lename)A F0(])A +F1(history \255p)108 374.4 Q F2(ar)2.5 E(g)-.37 E F0([)2.5 E F2(ar)A 2.5 +(g.)-.37 G(..)-2.5 E F0(])A F1(history \255s)108 386.4 Q F2(ar)2.5 E(g) +-.37 E F0([)2.5 E F2(ar)A 2.5(g.)-.37 G(..)-2.5 E F0(])A -.4(Wi)144 +398.4 S .752 +(th no options, display the command history list with line numbers.).4 F +.752(Lines listed with a)5.752 F F1(*)3.251 E F0(ha)3.251 E -.15(ve)-.2 +G .38(been modi\214ed.)144 410.4 R .38(An ar)5.38 F .38(gument of)-.18 F +F2(n)3.24 E F0 .38(lists only the last)3.12 F F2(n)3.24 E F0 2.88 +(lines. If)3.12 F .38(the shell v)2.88 F(ariable)-.25 E/F3 9 +/Times-Bold@0 SF(HISTTIMEFOR-)2.881 E(MA)144 422.4 Q(T)-.855 E F0 .265 +(is set and not null, it is used as a format string for)2.515 F F2 +(strftime)2.764 E F0 .264(\(3\) to display the time stamp asso-)B 1.019 +(ciated with each displayed history entry)144 434.4 R 6.019(.N)-.65 G +3.519(oi)-6.019 G(nterv)-3.519 E 1.019 +(ening blank is printed between the formatted)-.15 F .176 +(time stamp and the history line.)144 446.4 R(If)5.176 E F2(\214lename) +2.676 E F0 .176 +(is supplied, it is used as the name of the history \214le; if)2.676 F +(not, the v)144 458.4 Q(alue of)-.25 E F3(HISTFILE)2.5 E F0(is used.) +2.25 E(Options, if supplied, ha)5 E .3 -.15(ve t)-.2 H(he follo).15 E +(wing meanings:)-.25 E F1144 470.4 Q F0 +(Clear the history list by deleting all the entries.)25.86 E F1144 +482.4 Q F2(of)2.5 E(fset)-.18 E F0(Delete the history entry at position) +180 494.4 Q F2(of)2.5 E(fset)-.18 E F0(.)A F1144 506.4 Q F0 .598 +(Append the `)25.3 F(`ne)-.74 E(w')-.25 E 3.098('h)-.74 G .598 +(istory lines \(history lines entered since the be)-3.098 F .599 +(ginning of the current)-.15 F F1(bash)180 518.4 Q F0 +(session\) to the history \214le.)2.5 E F1144 530.4 Q F0 .854(Rea\ +d the history lines not already read from the history \214le into the c\ +urrent history list.)24.74 F .772 +(These are lines appended to the history \214le since the be)180 542.4 R +.773(ginning of the current)-.15 F F1(bash)3.273 E F0(ses-)3.273 E +(sion.)180 554.4 Q F1144 566.4 Q F0(Read the contents of the hist\ +ory \214le and append them to the current history list.)25.86 E F1 +144 578.4 Q F0(Write the current history list to the history \214le, o) +23.08 E -.15(ve)-.15 G(rwriting the history \214le').15 E 2.5(sc)-.55 G +(ontents.)-2.5 E F1144 590.4 Q F0 .626 +(Perform history substitution on the follo)24.74 F(wing)-.25 E F2(ar) +3.125 E(gs)-.37 E F0 .625(and display the result on the standard)3.125 F +2.975(output. Does)180 602.4 R .475 +(not store the results in the history list.)2.975 F(Each)5.475 E F2(ar) +2.975 E(g)-.37 E F0 .475(must be quoted to disable)2.975 F +(normal history e)180 614.4 Q(xpansion.)-.15 E F1144 626.4 Q F0 +.363(Store the)26.41 F F2(ar)3.193 E(gs)-.37 E F0 .363 +(in the history list as a single entry)3.133 F 5.363(.T)-.65 G .362 +(he last command in the history list is)-5.363 F(remo)180 638.4 Q -.15 +(ve)-.15 G 2.5(db).15 G(efore the)-2.5 E F2(ar)2.83 E(gs)-.37 E F0 +(are added.)2.77 E .145(If the)144 655.2 R F3(HISTTIMEFORMA)2.645 E(T) +-.855 E F0 -.25(va)2.395 G .145 +(riable is set, the time stamp information associated with each history) +.25 F .669(entry is written to the history \214le, mark)144 667.2 R .669 +(ed with the history comment character)-.1 F 5.668(.W)-.55 G .668 +(hen the history)-5.668 F .955(\214le is read, lines be)144 679.2 R .956 +(ginning with the history comment character follo)-.15 F .956 +(wed immediately by a digit)-.25 F .416 +(are interpreted as timestamps for the pre)144 691.2 R .416 +(vious history line.)-.25 F .416(The return v)5.416 F .415 +(alue is 0 unless an in)-.25 F -.25(va)-.4 G(lid).25 E .499(option is e\ +ncountered, an error occurs while reading or writing the history \214le\ +, an in)144 703.2 R -.25(va)-.4 G(lid).25 E F2(of)3 E(fset)-.18 E F0(is) +3 E(supplied as an ar)144 715.2 Q(gument to)-.18 E F12.5 E F0 2.5 +(,o)C 2.5(rt)-2.5 G(he history e)-2.5 E(xpansion supplied as an ar)-.15 +E(gument to)-.18 E F12.5 E F0 -.1(fa)2.5 G(ils.).1 E(GNU Bash 4.3) +72 768 Q(2014 February 2)141.79 E(60)190.95 E 0 Cg EP +%%Page: 61 61 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(jobs)108 84 Q F0([)2.5 E F1(\255lnprs)A F0 +2.5(][)C/F2 10/Times-Italic@0 SF(jobspec)A F0(... ])2.5 E F1(jobs \255x) +108 96 Q F2(command)2.5 E F0([)2.5 E F2(ar)2.5 E(gs)-.37 E F0(... ])2.5 +E(The \214rst form lists the acti)144 108 Q .3 -.15(ve j)-.25 H 2.5 +(obs. The).15 F(options ha)2.5 E .3 -.15(ve t)-.2 H(he follo).15 E +(wing meanings:)-.25 E F1144 120 Q F0 +(List process IDs in addition to the normal information.)27.52 E F1 +144 132 Q F0 .194(Display information only about jobs that ha) +24.74 F .494 -.15(ve c)-.2 H .193(hanged status since the user w).15 F +.193(as last noti-)-.1 F(\214ed of their status.)180 144 Q F1144 +156 Q F0(List only the process ID of the job')24.74 E 2.5(sp)-.55 G +(rocess group leader)-2.5 E(.)-.55 E F1144 168 Q F0 +(Display only running jobs.)25.86 E F1144 180 Q F0 +(Display only stopped jobs.)26.41 E(If)144 196.8 Q F2(jobspec)4.553 E F0 +.313(is gi)3.123 F -.15(ve)-.25 G .313 +(n, output is restricted to information about that job).15 F 5.314(.T) +-.4 G .314(he return status is 0 unless)-5.314 F(an in)144 208.8 Q -.25 +(va)-.4 G(lid option is encountered or an in).25 E -.25(va)-.4 G(lid).25 +E F2(jobspec)4.24 E F0(is supplied.)2.81 E .395(If the)144 225.6 R F1 +2.895 E F0 .394(option is supplied,)2.894 F F1(jobs)2.894 E F0 +.394(replaces an)2.894 F(y)-.15 E F2(jobspec)4.634 E F0 .394(found in) +3.204 F F2(command)3.094 E F0(or)3.664 E F2(ar)3.224 E(gs)-.37 E F0 .394 +(with the corre-)3.164 F(sponding process group ID, and e)144 237.6 Q +-.15(xe)-.15 G(cutes).15 E F2(command)2.7 E F0(passing it)3.27 E F2(ar) +2.5 E(gs)-.37 E F0 2.5(,r).27 G(eturning its e)-2.5 E(xit status.)-.15 E +F1(kill)108 254.4 Q F0([)2.5 E F1A F2(sigspec)2.5 E F0(|)2.5 E F1 +2.5 E F2(signum)2.5 E F0(|)2.5 E F12.5 E F2(sigspec)A F0 2.5 +(][)C F2(pid)-2.5 E F0(|)2.5 E F2(jobspec)2.5 E F0 2.5(].)C(..)-2.5 E F1 +(kill \255l)108 266.4 Q F0([)2.5 E F2(sigspec)A F0(|)2.5 E F2 -.2(ex)2.5 +G(it_status).2 E F0(])A .119(Send the signal named by)144 278.4 R F2 +(sigspec)2.959 E F0(or)2.929 E F2(signum)2.959 E F0 .119 +(to the processes named by)2.939 F F2(pid)3.87 E F0(or)3.39 E F2 +(jobspec)2.62 E F0(.).31 E F2(sigspec)5.46 E F0(is)2.93 E .319 +(either a case-insensiti)144 290.4 R .619 -.15(ve s)-.25 H .319 +(ignal name such as).15 F/F3 9/Times-Bold@0 SF(SIGKILL)2.819 E F0 .318 +(\(with or without the)2.569 F F3(SIG)2.818 E F0 .318 +(pre\214x\) or a signal)2.568 F(number;)144 302.4 Q F2(signum)4.188 E F0 +1.349(is a signal number)4.168 F 6.349(.I)-.55 G(f)-6.349 E F2(sigspec) +4.189 E F0 1.349(is not present, then)4.159 F F3(SIGTERM)3.849 E F0 +1.349(is assumed.)3.599 F(An)6.349 E(ar)144 314.4 Q .523(gument of)-.18 +F F13.023 E F0 .523(lists the signal names.)3.023 F .523(If an) +5.523 F 3.023(ya)-.15 G -.18(rg)-3.023 G .523(uments are supplied when) +.18 F F13.023 E F0 .523(is gi)3.023 F -.15(ve)-.25 G .523 +(n, the names).15 F .28(of the signals corresponding to the ar)144 326.4 +R .28(guments are listed, and the return status is 0.)-.18 F(The)5.28 E +F2 -.2(ex)2.78 G(it_status).2 E F0(ar)144 338.4 Q .378(gument to)-.18 F +F12.878 E F0 .378 +(is a number specifying either a signal number or the e)2.878 F .377 +(xit status of a process termi-)-.15 F .593(nated by a signal.)144 350.4 +R F1(kill)5.593 E F0 .593(returns true if at least one signal w)3.093 F +.593(as successfully sent, or f)-.1 F .594(alse if an error)-.1 F +(occurs or an in)144 362.4 Q -.25(va)-.4 G(lid option is encountered.) +.25 E F1(let)108 379.2 Q F2(ar)2.5 E(g)-.37 E F0([)2.5 E F2(ar)A(g)-.37 +E F0(...])2.5 E(Each)144 391.2 Q F2(ar)3.027 E(g)-.37 E F0 .197 +(is an arithmetic e)2.917 F .197(xpression to be e)-.15 F -.25(va)-.25 G +.196(luated \(see).25 F F3 .196(ARITHMETIC EV)2.696 F(ALU)-1.215 E -.855 +(AT)-.54 G(ION).855 E F0(abo)2.446 E -.15(ve)-.15 G 2.696(\). If).15 F +(the last)144 403.2 Q F2(ar)2.83 E(g)-.37 E F0 -.25(eva)2.72 G +(luates to 0,).25 E F1(let)2.5 E F0(returns 1; 0 is returned otherwise.) +2.5 E F1(local)108 420 Q F0([)2.5 E F2(option)A F0 2.5(][)C F2(name)-2.5 +E F0([=)A F2(value)A F0 2.5(].)C(..])-2.5 E -.15(Fo)144 432 S 2.56(re) +.15 G .06(ach ar)-2.56 F .06(gument, a local v)-.18 F .06(ariable named) +-.25 F F2(name)2.92 E F0 .06(is created, and assigned)2.74 F F2(value) +2.56 E F0 5.06(.T).18 G(he)-5.06 E F2(option)2.56 E F0 .06(can be)2.56 F +(an)144 444 Q 3.153(yo)-.15 G 3.153(ft)-3.153 G .653 +(he options accepted by)-3.153 F F1(declar)3.153 E(e)-.18 E F0 5.652(.W) +C(hen)-5.652 E F1(local)3.152 E F0 .652 +(is used within a function, it causes the v)3.152 F(ari-)-.25 E(able)144 +456 Q F2(name)3.72 E F0 .86(to ha)3.54 F 1.16 -.15(ve a v)-.2 H .861 +(isible scope restricted to that function and its children.).15 F -.4 +(Wi)5.861 G .861(th no operands,).4 F F1(local)144 468 Q F0 1.165 +(writes a list of local v)3.665 F 1.165 +(ariables to the standard output.)-.25 F 1.165(It is an error to use) +6.165 F F1(local)3.664 E F0 1.164(when not)3.664 F .232 +(within a function.)144 480 R .233(The return status is 0 unless)5.232 F +F1(local)2.733 E F0 .233(is used outside a function, an in)2.733 F -.25 +(va)-.4 G(lid).25 E F2(name)3.093 E F0(is)2.913 E(supplied, or)144 492 Q +F2(name)2.5 E F0(is a readonly v)2.5 E(ariable.)-.25 E F1(logout)108 +508.8 Q F0(Exit a login shell.)9.33 E F1(map\214le)108 525.6 Q F0([)2.5 +E F1A F2(count)2.5 E F0 2.5(][)C F1-2.5 E F2(origin)2.5 E F0 +2.5(][)C F1-2.5 E F2(count)2.5 E F0 2.5(][)C F1-2.5 E F0 2.5 +(][)C F1-2.5 E F2(fd)2.5 E F0 2.5(][)C F1-2.5 E F2(callbac) +2.5 E(k)-.2 E F0 2.5(][)C F1-2.5 E F2(quantum)2.5 E F0 2.5(][)C F2 +(arr)-2.5 E(ay)-.15 E F0(])A F1 -.18(re)108 537.6 S(adarray).18 E F0([) +2.5 E F1A F2(count)2.5 E F0 2.5(][)C F1-2.5 E F2(origin)2.5 +E F0 2.5(][)C F1-2.5 E F2(count)2.5 E F0 2.5(][)C F1-2.5 E +F0 2.5(][)C F1-2.5 E F2(fd)2.5 E F0 2.5(][)C F1-2.5 E F2 +(callbac)2.5 E(k)-.2 E F0 2.5(][)C F1-2.5 E F2(quantum)2.5 E F0 +2.5(][)C F2(arr)-2.5 E(ay)-.15 E F0(])A .351 +(Read lines from the standard input into the inde)144 549.6 R -.15(xe) +-.15 G 2.851(da).15 G .351(rray v)-2.851 F(ariable)-.25 E F2(arr)2.85 E +(ay)-.15 E F0 2.85(,o).32 G 2.85(rf)-2.85 G .35(rom \214le descriptor) +-2.85 F F2(fd)2.85 E F0 1.248(if the)144 561.6 R F13.748 E F0 +1.248(option is supplied.)3.748 F 1.249(The v)6.249 F(ariable)-.25 E F3 +(MAPFILE)3.749 E F0 1.249(is the def)3.499 F(ault)-.1 E F2(arr)3.749 E +(ay)-.15 E F0 6.249(.O)C 1.249(ptions, if supplied,)-6.249 F(ha)144 +573.6 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing meanings:)-.25 E F1 +144 585.6 Q F0(Cop)24.74 E 2.5(ya)-.1 G 2.5(tm)-2.5 G(ost)-2.5 E F2 +(count)2.7 E F0 2.5(lines. If)3.18 F F2(count)2.5 E F0 +(is 0, all lines are copied.)2.5 E F1144 597.6 Q F0(Be)22.52 E +(gin assigning to)-.15 E F2(arr)2.83 E(ay)-.15 E F0(at inde)2.82 E(x) +-.15 E F2(origin)2.5 E F0 5(.T).24 G(he def)-5 E(ault inde)-.1 E 2.5(xi) +-.15 G 2.5(s0)-2.5 G(.)-2.5 E F1144 609.6 Q F0 +(Discard the \214rst)26.41 E F2(count)2.5 E F0(lines read.)2.5 E F1 +144 621.6 Q F0(Remo)26.97 E .3 -.15(ve a t)-.15 H(railing ne).15 E +(wline from each line read.)-.25 E F1144 633.6 Q F0 +(Read lines from \214le descriptor)24.74 E F2(fd)2.5 E F0 +(instead of the standard input.)2.5 E F1144 645.6 Q F0(Ev)23.08 E +(aluate)-.25 E F2(callbac)2.7 E(k)-.2 E F0(each time)3.17 E F2(quantum) +2.5 E F0(lines are read.)2.5 E(The)5 E F12.5 E F0 +(option speci\214es)2.5 E F2(quantum)2.5 E F0(.).32 E F1144 657.6 +Q F0(Specify the number of lines read between each call to)25.86 E F2 +(callbac)2.5 E(k)-.2 E F0(.).67 E(If)144 674.4 Q F12.968 E F0 .467 +(is speci\214ed without)2.967 F F12.967 E F0 2.967(,t)C .467 +(he def)-2.967 F .467(ault quantum is 5000.)-.1 F(When)5.467 E F2 +(callbac)2.967 E(k)-.2 E F0 .467(is e)2.967 F -.25(va)-.25 G .467 +(luated, it is sup-).25 F .261(plied the inde)144 686.4 R 2.761(xo)-.15 +G 2.761(ft)-2.761 G .261(he ne)-2.761 F .262(xt array element to be ass\ +igned and the line to be assigned to that element)-.15 F .275 +(as additional ar)144 698.4 R(guments.)-.18 E F2(callbac)5.275 E(k)-.2 E +F0 .275(is e)2.775 F -.25(va)-.25 G .274 +(luated after the line is read b).25 F .274 +(ut before the array element is)-.2 F(assigned.)144 710.4 Q +(If not supplied with an e)144 727.2 Q(xplicit origin,)-.15 E F1 +(map\214le)2.5 E F0(will clear)2.5 E F2(arr)2.5 E(ay)-.15 E F0 +(before assigning to it.)2.5 E(GNU Bash 4.3)72 768 Q(2014 February 2) +141.79 E(61)190.95 E 0 Cg EP +%%Page: 62 62 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(map\214le)144 84 Q F0 1.905 +(returns successfully unless an in)4.405 F -.25(va)-.4 G 1.905 +(lid option or option ar).25 F 1.906(gument is supplied,)-.18 F/F2 10 +/Times-Italic@0 SF(arr)4.406 E(ay)-.15 E F0(is)4.406 E(in)144 96 Q -.25 +(va)-.4 G(lid or unassignable, or if).25 E F2(arr)2.5 E(ay)-.15 E F0 +(is not an inde)2.5 E -.15(xe)-.15 G 2.5(da).15 G(rray)-2.5 E(.)-.65 E +F1(popd)108 112.8 Q F0<5bad>2.5 E F1(n)A F0 2.5(][)C(+)-2.5 E F2(n)A F0 +2.5(][)C-2.5 E F2(n)A F0(])A(Remo)144 124.8 Q -.15(ve)-.15 G 2.8(se) +.15 G .3(ntries from the directory stack.)-2.8 F -.4(Wi)5.299 G .299 +(th no ar).4 F .299(guments, remo)-.18 F -.15(ve)-.15 G 2.799(st).15 G +.299(he top directory from the)-2.799 F 1.478(stack, and performs a)144 +136.8 R F1(cd)3.978 E F0 1.479(to the ne)3.978 F 3.979(wt)-.25 G 1.479 +(op directory)-3.979 F 6.479(.A)-.65 G -.18(rg)-6.479 G 1.479 +(uments, if supplied, ha).18 F 1.779 -.15(ve t)-.2 H 1.479(he follo).15 +F(wing)-.25 E(meanings:)144 148.8 Q F1144 160.8 Q F0 .551 +(Suppresses the normal change of directory when remo)24.74 F .551 +(ving directories from the stack, so)-.15 F +(that only the stack is manipulated.)180 172.8 Q F1(+)144 184.8 Q F2(n)A +F0(Remo)25.3 E -.15(ve)-.15 G 2.64(st).15 G(he)-2.64 E F2(n)2.64 E F0 +.14(th entry counting from the left of the list sho)B .14(wn by)-.25 F +F1(dirs)2.64 E F0 2.64(,s)C .14(tarting with zero.)-2.64 F -.15(Fo)180 +196.8 S 2.5(re).15 G(xample:)-2.65 E/F3 10/Courier@0 SF(popd +0)2.5 E F0 +(remo)2.5 E -.15(ve)-.15 G 2.5(st).15 G(he \214rst directory)-2.5 E(,) +-.65 E F3(popd +1)2.5 E F0(the second.)2.5 E F1144 208.8 Q F2(n)A F0 +(Remo)25.3 E -.15(ve)-.15 G 3.76(st).15 G(he)-3.76 E F2(n)3.76 E F0 +1.259(th entry counting from the right of the list sho)B 1.259(wn by) +-.25 F F1(dirs)3.759 E F0 3.759(,s)C 1.259(tarting with)-3.759 F 2.5 +(zero. F)180 220.8 R(or e)-.15 E(xample:)-.15 E F3(popd -0)2.5 E F0 +(remo)2.5 E -.15(ve)-.15 G 2.5(st).15 G(he last directory)-2.5 E(,)-.65 +E F3(popd -1)2.5 E F0(the ne)2.5 E(xt to last.)-.15 E .643(If the)144 +237.6 R F1(popd)3.143 E F0 .643(command is successful, a)3.143 F F1 +(dirs)3.143 E F0 .644(is performed as well, and the return status is 0.) +3.143 F F1(popd)5.644 E F0 .416(returns f)144 249.6 R .416 +(alse if an in)-.1 F -.25(va)-.4 G .415 +(lid option is encountered, the directory stack is empty).25 F 2.915 +(,an)-.65 G(on-e)-2.915 E .415(xistent direc-)-.15 F +(tory stack entry is speci\214ed, or the directory change f)144 261.6 Q +(ails.)-.1 E F1(printf)108 278.4 Q F0([)2.5 E F1A F2(var)2.5 E F0 +(])A F2(format)2.5 E F0([)2.5 E F2(ar)A(guments)-.37 E F0(])A 1.436 +(Write the formatted)144 290.4 R F2(ar)3.936 E(guments)-.37 E F0 1.437 +(to the standard output under the control of the)3.936 F F2(format)3.937 +E F0 6.437(.T)C(he)-6.437 E F13.937 E F0 .126 +(option causes the output to be assigned to the v)144 302.4 R(ariable) +-.25 E F2(var)2.626 E F0 .126(rather than being printed to the standard) +2.626 F(output.)144 314.4 Q(The)144 338.4 Q F2(format)3.017 E F0 .517(i\ +s a character string which contains three types of objects: plain chara\ +cters, which are)3.017 F .704(simply copied to standard output, charact\ +er escape sequences, which are con)144 350.4 R -.15(ve)-.4 G .703 +(rted and copied to).15 F .036(the standard output, and format speci\ +\214cations, each of which causes printing of the ne)144 362.4 R .037 +(xt successi)-.15 F -.15(ve)-.25 G F2(ar)144 374.4 Q(gument)-.37 E F0 +5.532(.I)C 3.032(na)-5.532 G .532(ddition to the standard)-3.032 F F2 +(printf)3.032 E F0 .532(\(1\) format speci\214cations,)B F1(printf)3.031 +E F0 .531(interprets the follo)3.031 F(w-)-.25 E(ing e)144 386.4 Q +(xtensions:)-.15 E F1(%b)144 398.4 Q F0(causes)20.44 E F1(printf)5.115 E +F0 2.615(to e)5.115 F 2.615 +(xpand backslash escape sequences in the corresponding)-.15 F F2(ar) +5.115 E(gument)-.37 E F0(\(e)180 410.4 Q .608(xcept that)-.15 F F1(\\c) +3.108 E F0 .608(terminates output, backslashes in)3.108 F F1<5c08>3.108 +E F0(,)A F1(\\")3.108 E F0 3.108(,a)C(nd)-3.108 E F1(\\?)3.108 E F0 .608 +(are not remo)3.108 F -.15(ve)-.15 G .608(d, and octal).15 F(escapes be) +180 422.4 Q(ginning with)-.15 E F1(\\0)2.5 E F0 +(may contain up to four digits\).)2.5 E F1(%q)144 434.4 Q F0(causes) +20.44 E F1(printf)2.51 E F0 .01(to output the corresponding)2.51 F F2 +(ar)2.51 E(gument)-.37 E F0 .01(in a format that can be reused as shell) +2.51 F(input.)180 446.4 Q F1(%\()144 458.4 Q F2(datefmt)A F1(\)T)A F0 +(causes)180 470.4 Q F1(printf)4.404 E F0 1.904 +(to output the date-time string resulting from using)4.404 F F2(datefmt) +4.404 E F0 1.903(as a format)4.404 F .38(string for)180 482.4 R F2 +(strftime)2.881 E F0 2.881(\(3\). The)B(corresponding)2.881 E F2(ar) +2.881 E(gument)-.37 E F0 .381(is an inte)2.881 F .381 +(ger representing the number)-.15 F .458(of seconds since the epoch.)180 +494.4 R -1 -.8(Tw o)5.458 H .458(special ar)3.758 F .458(gument v)-.18 F +.458(alues may be used: -1 represents the)-.25 F .847 +(current time, and -2 represents the time the shell w)180 506.4 R .847 +(as in)-.1 F -.2(vo)-.4 G -.1(ke).2 G 3.348(d. If).1 F .848(no ar)3.348 +F .848(gument is speci-)-.18 F .355(\214ed, con)180 518.4 R -.15(ve)-.4 +G .355(rsion beha).15 F -.15(ve)-.2 G 2.855(sa).15 G 2.855(si)-2.855 G +2.855(f-)-2.855 G 2.855(1h)-2.855 G .354(ad been gi)-2.855 F -.15(ve) +-.25 G 2.854(n. This).15 F .354(is an e)2.854 F .354 +(xception to the usual)-.15 F F1(printf)2.854 E F0(beha)180 530.4 Q +(vior)-.2 E(.)-.55 E(Ar)144 547.2 Q .463(guments to non-string format s\ +peci\214ers are treated as C constants, e)-.18 F .464 +(xcept that a leading plus or)-.15 F 1.259(minus sign is allo)144 559.2 +R 1.259 +(wed, and if the leading character is a single or double quote, the v) +-.25 F 1.258(alue is the)-.25 F(ASCII v)144 571.2 Q(alue of the follo) +-.25 E(wing character)-.25 E(.)-.55 E(The)144 588 Q F2(format)3.423 E F0 +.923(is reused as necessary to consume all of the)3.423 F F2(ar)3.423 E +(guments)-.37 E F0 5.923(.I)C 3.423(ft)-5.923 G(he)-3.423 E F2(format) +3.423 E F0 .924(requires more)3.424 F F2(ar)144 600 Q(guments)-.37 E F0 +.033(than are supplied, the e)2.534 F .033 +(xtra format speci\214cations beha)-.15 F .333 -.15(ve a)-.2 H 2.533(si) +.15 G 2.533(faz)-2.533 G .033(ero v)-2.533 F .033(alue or null string,) +-.25 F(as appropriate, had been supplied.)144 612 Q(The return v)5 E +(alue is zero on success, non-zero on f)-.25 E(ailure.)-.1 E F1(pushd) +108 628.8 Q F0([)2.5 E F1A F0 2.5(][)C(+)-2.5 E F2(n)A F0 2.5(][)C +-2.5 E F2(n)A F0(])A F1(pushd)108 640.8 Q F0([)2.5 E F1A F0 +2.5(][)C F2(dir)-2.5 E F0(])A .639(Adds a directory to the top of the d\ +irectory stack, or rotates the stack, making the ne)144 652.8 R 3.14(wt) +-.25 G .64(op of the)-3.14 F 1.316(stack the current w)144 664.8 R 1.316 +(orking directory)-.1 F 6.316(.W)-.65 G 1.315(ith no ar)-6.716 F 1.315 +(guments, e)-.18 F 1.315(xchanges the top tw)-.15 F 3.815(od)-.1 G 1.315 +(irectories and)-3.815 F .871 +(returns 0, unless the directory stack is empty)144 676.8 R 5.871(.A) +-.65 G -.18(rg)-5.871 G .872(uments, if supplied, ha).18 F 1.172 -.15 +(ve t)-.2 H .872(he follo).15 F .872(wing mean-)-.25 F(ings:)144 688.8 Q +F1144 700.8 Q F0 .902(Suppresses the normal change of directory w\ +hen adding directories to the stack, so that)24.74 F +(only the stack is manipulated.)180 712.8 Q(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(62)190.95 E 0 Cg EP +%%Page: 63 63 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(+)144 84 Q/F2 10/Times-Italic@0 SF(n)A F0 +1.267(Rotates the stack so that the)25.3 F F2(n)3.767 E F0 1.268 +(th directory \(counting from the left of the list sho)B 1.268(wn by) +-.25 F F1(dirs)180 96 Q F0 2.5(,s)C(tarting with zero\) is at the top.) +-2.5 E F1144 108 Q F2(n)A F0 .92(Rotates the stack so that the)25.3 +F F2(n)3.42 E F0 .92 +(th directory \(counting from the right of the list sho)B .92(wn by)-.25 +F F1(dirs)180 120 Q F0 2.5(,s)C(tarting with zero\) is at the top.)-2.5 +E F2(dir)144.35 132 Q F0(Adds)23.98 E F2(dir)3.137 E F0 .287 +(to the directory stack at the top, making it the ne)3.517 F 2.788(wc) +-.25 G .288(urrent w)-2.788 F .288(orking directory as)-.1 F +(if it had been supplied as the ar)180 144 Q(gument to the)-.18 E F1(cd) +2.5 E F0 -.2(bu)2.5 G(iltin.).2 E .489(If the)144 160.8 R F1(pushd)2.989 +E F0 .489(command is successful, a)2.989 F F1(dirs)2.988 E F0 .488 +(is performed as well.)2.988 F .488(If the \214rst form is used,)5.488 F +F1(pushd)2.988 E F0 1.039(returns 0 unless the cd to)144 172.8 R F2(dir) +3.889 E F0 -.1(fa)4.269 G 3.539(ils. W).1 F 1.039(ith the second form,) +-.4 F F1(pushd)3.54 E F0 1.04(returns 0 unless the directory)3.54 F .847 +(stack is empty)144 184.8 R 3.347(,an)-.65 G(on-e)-3.347 E .847(xistent\ + directory stack element is speci\214ed, or the directory change to the) +-.15 F(speci\214ed ne)144 196.8 Q 2.5(wc)-.25 G(urrent directory f)-2.5 +E(ails.)-.1 E F1(pwd)108 213.6 Q F0([)2.5 E F1(\255LP)A F0(])A .844 +(Print the absolute pathname of the current w)144 225.6 R .845 +(orking directory)-.1 F 5.845(.T)-.65 G .845 +(he pathname printed contains no)-5.845 F .182(symbolic links if the)144 +237.6 R F12.681 E F0 .181(option is supplied or the)2.681 F F1 +.181(\255o ph)2.681 F(ysical)-.15 E F0 .181(option to the)2.681 F F1 +(set)2.681 E F0 -.2(bu)2.681 G .181(iltin command is).2 F 3.263 +(enabled. If)144 249.6 R(the)3.263 E F13.263 E F0 .763 +(option is used, the pathname printed may contain symbolic links.)3.263 +F .764(The return)5.764 F 1.36(status is 0 unless an error occurs while\ + reading the name of the current directory or an in)144 261.6 R -.25(va) +-.4 G(lid).25 E(option is supplied.)144 273.6 Q F1 -.18(re)108 290.4 S +(ad).18 E F0([)3.816 E F1(\255ers)A F0 3.816(][)C F1-3.816 E F2 +(aname)3.816 E F0 3.816(][)C F1-3.816 E F2(delim)3.816 E F0 3.816 +(][)C F1-3.816 E F2(te)3.816 E(xt)-.2 E F0 3.816(][)C F1 +-3.816 E F2(nc)3.816 E(har)-.15 E(s)-.1 E F0 3.817(][)C F1-3.817 E +F2(nc)3.817 E(har)-.15 E(s)-.1 E F0 3.817(][)C F1-3.817 E F2(pr) +3.817 E(ompt)-.45 E F0 3.817(][)C F1-3.817 E F2(timeout)3.817 E F0 +3.817(][)C F1-3.817 E F2(fd)3.817 E F0(])A([)108 302.4 Q F2(name)A +F0(...])2.5 E .516(One line is read from the standard input, or from th\ +e \214le descriptor)144 314.4 R F2(fd)3.016 E F0 .516(supplied as an ar) +3.016 F .517(gument to)-.18 F(the)144 326.4 Q F12.539 E F0 .039 +(option, and the \214rst w)2.539 F .038(ord is assigned to the \214rst) +-.1 F F2(name)2.538 E F0 2.538(,t).18 G .038(he second w)-2.538 F .038 +(ord to the second)-.1 F F2(name)2.538 E F0(,).18 E .42 +(and so on, with lefto)144 338.4 R -.15(ve)-.15 G 2.92(rw).15 G .42 +(ords and their interv)-3.02 F .42 +(ening separators assigned to the last)-.15 F F2(name)2.92 E F0 5.42(.I) +.18 G 2.92(ft)-5.42 G(here)-2.92 E .541(are fe)144 350.4 R .541(wer w) +-.25 F .541(ords read from the input stream than names, the remaining n\ +ames are assigned empty)-.1 F -.25(va)144 362.4 S 3.357(lues. The).25 F +.857(characters in)3.357 F/F3 9/Times-Bold@0 SF(IFS)3.357 E F0 .857 +(are used to split the line into w)3.107 F .857 +(ords using the same rules the shell)-.1 F .754(uses for e)144 374.4 R +.753(xpansion \(described abo)-.15 F 1.053 -.15(ve u)-.15 H(nder).15 E +F1 -.75(Wo)3.253 G .753(rd Splitting).75 F F0 3.253(\). The)B .753 +(backslash character \()3.253 F F1(\\)A F0 3.253(\)m)C .753(ay be)-3.253 +F .075(used to remo)144 386.4 R .375 -.15(ve a)-.15 H .375 -.15(ny s).15 +H .075(pecial meaning for the ne).15 F .076 +(xt character read and for line continuation.)-.15 F(Options,)5.076 E +(if supplied, ha)144 398.4 Q .3 -.15(ve t)-.2 H(he follo).15 E +(wing meanings:)-.25 E F1144 410.4 Q F2(aname)2.5 E F0 1.05(The w) +180 422.4 R 1.049 +(ords are assigned to sequential indices of the array v)-.1 F(ariable) +-.25 E F2(aname)3.549 E F0 3.549(,s).18 G 1.049(tarting at 0.)-3.549 F +F2(aname)180.33 434.4 Q F0(is unset before an)2.68 E 2.5(yn)-.15 G .5 +-.25(ew va)-2.5 H(lues are assigned.).25 E(Other)5 E F2(name)2.5 E F0 +(ar)2.5 E(guments are ignored.)-.18 E F1144 446.4 Q F2(delim)2.5 E +F0(The \214rst character of)180 458.4 Q F2(delim)2.5 E F0 +(is used to terminate the input line, rather than ne)2.5 E(wline.)-.25 E +F1144 470.4 Q F0 .372 +(If the standard input is coming from a terminal,)25.86 F F1 -.18(re) +2.873 G(adline).18 E F0(\(see)2.873 E F3(READLINE)2.873 E F0(abo)2.623 E +-.15(ve)-.15 G 2.873(\)i).15 G 2.873(su)-2.873 G(sed)-2.873 E .218 +(to obtain the line.)180 482.4 R .218 +(Readline uses the current \(or def)5.218 F .218 +(ault, if line editing w)-.1 F .218(as not pre)-.1 F(viously)-.25 E +(acti)180 494.4 Q -.15(ve)-.25 G 2.5(\)e).15 G(diting settings.)-2.5 E +F1144 506.4 Q F2(te)2.5 E(xt)-.2 E F0(If)10.78 E F1 -.18(re)2.715 +G(adline).18 E F0 .216(is being used to read the line,)2.715 F F2(te) +2.716 E(xt)-.2 E F0 .216(is placed into the editing b)2.716 F(uf)-.2 E +.216(fer before edit-)-.25 F(ing be)180 518.4 Q(gins.)-.15 E F1144 +530.4 Q F2(nc)2.5 E(har)-.15 E(s)-.1 E F1 -.18(re)180 542.4 S(ad).18 E +F0 1.395(returns after reading)3.895 F F2(nc)3.895 E(har)-.15 E(s)-.1 E +F0 1.395(characters rather than w)3.895 F 1.394 +(aiting for a complete line of)-.1 F(input, b)180 554.4 Q +(ut honor a delimiter if fe)-.2 E(wer than)-.25 E F2(nc)2.5 E(har)-.15 E +(s)-.1 E F0(characters are read before the delimiter)2.5 E(.)-.55 E F1 +144 566.4 Q F2(nc)2.5 E(har)-.15 E(s)-.1 E F1 -.18(re)180 578.4 S +(ad).18 E F0 1.269(returns after reading e)3.769 F(xactly)-.15 E F2(nc) +3.769 E(har)-.15 E(s)-.1 E F0 1.269(characters rather than w)3.769 F +1.27(aiting for a complete)-.1 F .275 +(line of input, unless EOF is encountered or)180 590.4 R F1 -.18(re) +2.775 G(ad).18 E F0 .274(times out.)2.774 F .274 +(Delimiter characters encoun-)5.274 F 1.002 +(tered in the input are not treated specially and do not cause)180 602.4 +R F1 -.18(re)3.503 G(ad).18 E F0 1.003(to return until)3.503 F F2(nc) +3.503 E(har)-.15 E(s)-.1 E F0(characters are read.)180 614.4 Q F1 +144 626.4 Q F2(pr)2.5 E(ompt)-.45 E F0(Display)180 638.4 Q F2(pr)3.661 E +(ompt)-.45 E F0 1.161(on standard error)3.661 F 3.661(,w)-.4 G 1.161 +(ithout a trailing ne)-3.661 F 1.161(wline, before attempting to read) +-.25 F(an)180 650.4 Q 2.5(yi)-.15 G 2.5(nput. The)-2.5 F +(prompt is displayed only if input is coming from a terminal.)2.5 E F1 +144 662.4 Q F0 .543(Backslash does not act as an escape character) +25.86 F 5.543(.T)-.55 G .544(he backslash is considered to be part of) +-5.543 F(the line.)180 674.4 Q(In particular)5 E 2.5(,ab)-.4 G +(ackslash-ne)-2.5 E(wline pair may not be used as a line continuation.) +-.25 E F1144 686.4 Q F0(Silent mode.)26.41 E +(If input is coming from a terminal, characters are not echoed.)5 E F1 +144 698.4 Q F2(timeout)2.5 E F0(Cause)180 710.4 Q F1 -.18(re)2.929 +G(ad).18 E F0 .428(to time out and return f)2.929 F .428 +(ailure if a complete line of input \(or a speci\214ed num-)-.1 F .56 +(ber of characters\) is not read within)180 722.4 R F2(timeout)3.061 E +F0(seconds.)3.061 E F2(timeout)5.561 E F0 .561(may be a decimal number) +3.061 F(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(63)190.95 E 0 Cg +EP +%%Page: 64 64 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E(with a fractional portion follo)180 84 Q(wing the decimal point.) +-.25 E(This option is only ef)5 E(fecti)-.25 E .3 -.15(ve i)-.25 H(f).15 +E/F1 10/Times-Bold@0 SF -.18(re)2.5 G(ad).18 E F0 .506(is reading input\ + from a terminal, pipe, or other special \214le; it has no ef)180 96 R +.506(fect when reading)-.25 F .59(from re)180 108 R .59(gular \214les.) +-.15 F(If)5.59 E F1 -.18(re)3.09 G(ad).18 E F0 .589(times out,)3.09 F F1 +-.18(re)3.089 G(ad).18 E F0(sa)3.089 E -.15(ve)-.2 G 3.089(sa).15 G .889 +-.15(ny p)-3.089 H .589(artial input read into the speci\214ed).15 F +-.25(va)180 120 S(riable).25 E/F2 10/Times-Italic@0 SF(name)2.77 E F0 +5.27(.I)C(f)-5.27 E F2(timeout)2.77 E F0 .27(is 0,)2.77 F F1 -.18(re) +2.77 G(ad).18 E F0 .27(returns immediately)2.77 F 2.77(,w)-.65 G .27 +(ithout trying to read an)-2.77 F 2.77(yd)-.15 G(ata.)-2.77 E 1.12 +(The e)180 132 R 1.12(xit status is 0 if input is a)-.15 F -.25(va)-.2 G +1.12(ilable on the speci\214ed \214le descriptor).25 F 3.62(,n)-.4 G +1.12(on-zero other)-3.62 F(-)-.2 E 2.5(wise. The)180 144 R -.15(ex)2.5 G +(it status is greater than 128 if the timeout is e).15 E(xceeded.)-.15 E +F1144 156 Q F2(fd)2.5 E F0(Read input from \214le descriptor)14.46 +E F2(fd)2.5 E F0(.)A .191(If no)144 172.8 R F2(names)3.051 E F0 .191 +(are supplied, the line read is assigned to the v)2.961 F(ariable)-.25 E +/F3 9/Times-Bold@0 SF(REPL)2.692 E(Y)-.828 E/F4 9/Times-Roman@0 SF(.)A +F0 .192(The return code is zero,)4.692 F 1.344 +(unless end-of-\214le is encountered,)144 184.8 R F1 -.18(re)3.844 G(ad) +.18 E F0 1.343 +(times out \(in which case the return code is greater than)3.844 F .871 +(128\), a v)144 196.8 R .871 +(ariable assignment error \(such as assigning to a readonly v)-.25 F +.872(ariable\) occurs, or an in)-.25 F -.25(va)-.4 G(lid).25 E +(\214le descriptor is supplied as the ar)144 208.8 Q(gument to)-.18 E F1 +2.5 E F0(.)A F1 -.18(re)108 225.6 S(adonly).18 E F0([)2.5 E F1 +(\255aAf)A F0 2.5(][)C F1-2.5 E F0 2.5(][)C F2(name)-2.5 E F0([=)A +F2(wor)A(d)-.37 E F0 2.5(].)C(..])-2.5 E .77(The gi)144 237.6 R -.15(ve) +-.25 G(n).15 E F2(names)3.27 E F0 .77(are mark)3.27 F .77 +(ed readonly; the v)-.1 F .77(alues of these)-.25 F F2(names)3.63 E F0 +.77(may not be changed by subse-)3.54 F 1.096(quent assignment.)144 +249.6 R 1.096(If the)6.096 F F13.596 E F0 1.097 +(option is supplied, the functions corresponding to the)3.596 F F2 +(names)3.597 E F0 1.097(are so)3.597 F(mark)144 261.6 Q 3.334(ed. The) +-.1 F F13.334 E F0 .834(option restricts the v)3.334 F .834 +(ariables to inde)-.25 F -.15(xe)-.15 G 3.334(da).15 G .834(rrays; the) +-3.334 F F13.334 E F0 .834(option restricts the v)3.334 F(ari-) +-.25 E .776(ables to associati)144 273.6 R 1.076 -.15(ve a)-.25 H 3.276 +(rrays. If).15 F .777(both options are supplied,)3.276 F F13.277 E +F0(tak)3.277 E .777(es precedence.)-.1 F .777(If no)5.777 F F2(name) +3.637 E F0(ar)3.457 E(gu-)-.18 E .522(ments are gi)144 285.6 R -.15(ve) +-.25 G .521(n, or if the).15 F F13.021 E F0 .521 +(option is supplied, a list of all readonly names is printed.)3.021 F +.521(The other)5.521 F .295(options may be used to restrict the output \ +to a subset of the set of readonly names.)144 297.6 R(The)5.296 E F1 +2.796 E F0(option)2.796 E .786 +(causes output to be displayed in a format that may be reused as input.) +144 309.6 R .786(If a v)5.786 F .785(ariable name is fol-)-.25 F(lo)144 +321.6 Q .717(wed by =)-.25 F F2(wor)A(d)-.37 E F0 3.218(,t)C .718(he v) +-3.218 F .718(alue of the v)-.25 F .718(ariable is set to)-.25 F F2(wor) +3.218 E(d)-.37 E F0 5.718(.T)C .718(he return status is 0 unless an in) +-5.718 F -.25(va)-.4 G(lid).25 E .26(option is encountered, one of the) +144 333.6 R F2(names)3.12 E F0 .26(is not a v)3.03 F .26(alid shell v) +-.25 F .26(ariable name, or)-.25 F F12.76 E F0 .26 +(is supplied with a)2.76 F F2(name)144.36 345.6 Q F0 +(that is not a function.)2.68 E F1 -.18(re)108 362.4 S(tur).18 E(n)-.15 +E F0([)2.5 E F2(n)A F0(])A .02(Causes a function to stop e)144 374.4 R +-.15(xe)-.15 G .02(cuting and return the v).15 F .021 +(alue speci\214ed by)-.25 F F2(n)2.881 E F0 .021(to its caller)2.761 F +5.021(.I)-.55 G(f)-5.021 E F2(n)2.881 E F0 .021(is omitted,)2.761 F .469 +(the return status is that of the last command e)144 386.4 R -.15(xe) +-.15 G .469(cuted in the function body).15 F 5.469(.I)-.65 G(f)-5.469 E +F1 -.18(re)2.969 G(tur).18 E(n)-.15 E F0 .468(is used out-)2.969 F .466 +(side a function, b)144 398.4 R .466(ut during e)-.2 F -.15(xe)-.15 G +.467(cution of a script by the).15 F F1(.)2.967 E F0(\()5.467 E F1(sour) +A(ce)-.18 E F0 2.967(\)c)C .467(ommand, it causes the shell to)-2.967 F +.088(stop e)144 410.4 R -.15(xe)-.15 G .087 +(cuting that script and return either).15 F F2(n)2.947 E F0 .087 +(or the e)2.827 F .087(xit status of the last command e)-.15 F -.15(xe) +-.15 G .087(cuted within).15 F .613(the script as the e)144 422.4 R .613 +(xit status of the script.)-.15 F(If)5.613 E F2(n)3.113 E F0 .613 +(is supplied, the return v)3.113 F .613 +(alue is its least signi\214cant 8)-.25 F 2.511(bits. The)144 434.4 R +.011(return status is non-zero if)2.511 F F1 -.18(re)2.511 G(tur).18 E +(n)-.15 E F0 .011(is supplied a non-numeric ar)2.511 F .01 +(gument, or is used outside)-.18 F 2.909(af)144 446.4 S .409 +(unction and not during e)-2.909 F -.15(xe)-.15 G .41 +(cution of a script by).15 F F1(.)2.91 E F0(or)3.743 E F1(sour)2.91 E +(ce)-.18 E F0 5.41(.A)C .71 -.15(ny c)-5.41 H .41 +(ommand associated with the).15 F F1(RETURN)144 458.4 Q F0(trap is e)2.5 +E -.15(xe)-.15 G(cuted before e).15 E -.15(xe)-.15 G +(cution resumes after the function or script.).15 E F1(set)108 475.2 Q +F0([)2.5 E F1(\255\255abefhkmnptuvxBCEHPT)A F0 2.5(][)C F1-2.5 E +F2(option\255name)2.5 E F0 2.5(][)C F2(ar)-2.5 E(g)-.37 E F0(...])2.5 E +F1(set)108 487.2 Q F0([)2.5 E F1(+abefhkmnptuvxBCEHPT)A F0 2.5(][)C F1 +(+o)-2.5 E F2(option\255name)2.5 E F0 2.5(][)C F2(ar)-2.5 E(g)-.37 E F0 +(...])2.5 E -.4(Wi)144 499.2 S .836(thout options, the name and v).4 F +.835(alue of each shell v)-.25 F .835 +(ariable are displayed in a format that can be)-.25 F .784 +(reused as input for setting or resetting the currently-set v)144 511.2 +R 3.284(ariables. Read-only)-.25 F -.25(va)3.284 G .784 +(riables cannot be).25 F 2.912(reset. In)144 523.2 R F2(posix)2.912 E F0 +.412(mode, only shell v)2.912 F .412(ariables are listed.)-.25 F .412 +(The output is sorted according to the current)5.412 F 3.53 +(locale. When)144 535.2 R 1.031(options are speci\214ed, the)3.53 F +3.531(ys)-.15 G 1.031(et or unset shell attrib)-3.531 F 3.531(utes. An) +-.2 F 3.531(ya)-.15 G -.18(rg)-3.531 G 1.031(uments remaining).18 F +1.624(after option processing are treated as v)144 547.2 R 1.623 +(alues for the positional parameters and are assigned, in)-.25 F(order) +144 559.2 Q 2.5(,t)-.4 G(o)-2.5 E F1($1)2.5 E F0(,)A F1($2)2.5 E F0(,)A +F1 2.5(... $)2.5 F F2(n)A F0 5(.O)C(ptions, if speci\214ed, ha)-5 E .3 +-.15(ve t)-.2 H(he follo).15 E(wing meanings:)-.25 E F1144 571.2 Q +F0 .539(Automatically mark v)29.3 F .539 +(ariables and functions which are modi\214ed or created for e)-.25 F .54 +(xport to)-.15 F(the en)184 583.2 Q(vironment of subsequent commands.) +-.4 E F1144 595.2 Q F0 .132 +(Report the status of terminated background jobs immediately)28.74 F +2.632(,r)-.65 G .131(ather than before the ne)-2.632 F(xt)-.15 E +(primary prompt.)184 607.2 Q(This is ef)5 E(fecti)-.25 E .3 -.15(ve o) +-.25 H(nly when job control is enabled.).15 E F1144 619.2 Q F0 +.087(Exit immediately if a)29.86 F F2(pipeline)2.587 E F0 .087 +(\(which may consist of a single)2.587 F F2 .088(simple command)2.588 F +F0 .088(\), a)B F2(list)2.588 E F0 2.588(,o)C(r)-2.588 E(a)184 631.2 Q +F2 1.294(compound command)3.794 F F0(\(see)3.794 E F3 1.294 +(SHELL GRAMMAR)3.794 F F0(abo)3.544 E -.15(ve)-.15 G 3.793(\), e).15 F +1.293(xits with a non-zero status.)-.15 F .079(The shell does not e)184 +643.2 R .079(xit if the command that f)-.15 F .08 +(ails is part of the command list immediately)-.1 F(follo)184 655.2 Q +1.655(wing a)-.25 F F1(while)4.155 E F0(or)4.155 E F1(until)4.155 E F0 +-.1(ke)4.155 G(yw)-.05 E 1.655(ord, part of the test follo)-.1 F 1.654 +(wing the)-.25 F F1(if)4.154 E F0(or)4.154 E F1(elif)4.154 E F0(reserv) +4.154 E(ed)-.15 E -.1(wo)184 667.2 S .581(rds, part of an).1 F 3.081(yc) +-.15 G .581(ommand e)-3.081 F -.15(xe)-.15 G .581(cuted in a).15 F F1 +(&&)3.081 E F0(or)3.081 E F1(||)3.081 E F0 .582(list e)3.082 F .582 +(xcept the command follo)-.15 F(wing)-.25 E .918(the \214nal)184 679.2 R +F1(&&)3.418 E F0(or)3.418 E F1(||)3.418 E F0 3.418(,a)C 1.218 -.15(ny c) +-3.418 H .918(ommand in a pipeline b).15 F .917 +(ut the last, or if the command')-.2 F 3.417(sr)-.55 G(eturn)-3.417 E +-.25(va)184 691.2 S .66(lue is being in).25 F -.15(ve)-.4 G .66 +(rted with).15 F F1(!)3.16 E F0 5.661(.I)C 3.161(fac)-5.661 G .661 +(ompound command other than a subshell returns a)-3.161 F 1.113 +(non-zero status because a command f)184 703.2 R 1.112(ailed while)-.1 F +F13.612 E F0 -.1(wa)3.612 G 3.612(sb).1 G 1.112 +(eing ignored, the shell does)-3.612 F .177(not e)184 715.2 R 2.677 +(xit. A)-.15 F .177(trap on)2.677 F F1(ERR)2.677 E F0 2.677(,i)C 2.678 +(fs)-2.677 G .178(et, is e)-2.678 F -.15(xe)-.15 G .178 +(cuted before the shell e).15 F 2.678(xits. This)-.15 F .178 +(option applies to)2.678 F 3.325(the shell en)184 727.2 R 3.325 +(vironment and each subshell en)-.4 F 3.325(vironment separately \(see) +-.4 F F3(COMMAND)5.824 E F0(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 +E(64)190.95 E 0 Cg EP +%%Page: 65 65 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 9/Times-Bold@0 SF .106(EXECUTION ENVIR)184 84 R(ONMENT)-.27 E +F0(abo)2.356 E -.15(ve)-.15 G .107(\), and may cause subshells to e).15 +F .107(xit before e)-.15 F -.15(xe)-.15 G(cuting).15 E +(all the commands in the subshell.)184 96 Q 2.042 +(If a compound command or shell function e)184 114 R -.15(xe)-.15 G +2.042(cutes in a conte).15 F 2.042(xt where)-.15 F/F2 10/Times-Bold@0 SF +4.542 E F0 2.042(is being)4.542 F 1.435 +(ignored, none of the commands e)184 126 R -.15(xe)-.15 G 1.436 +(cuted within the compound command or function).15 F .194 +(body will be af)184 138 R .194(fected by the)-.25 F F22.694 E F0 +.193(setting, e)2.693 F -.15(ve)-.25 G 2.693(ni).15 G(f)-2.693 E F2 +2.693 E F0 .193(is set and a command returns a f)2.693 F(ailure) +-.1 E 3.39(status. If)184 150 R 3.39(ac)3.39 G .89 +(ompound command or shell function sets)-3.39 F F23.39 E F0 .89 +(while e)3.39 F -.15(xe)-.15 G .89(cuting in a conte).15 F(xt)-.15 E +(where)184 162 Q F23.154 E F0 .654 +(is ignored, that setting will not ha)3.154 F .953 -.15(ve a)-.2 H .953 +-.15(ny e).15 H -.25(ff).15 G .653(ect until the compound command).25 F +(or the command containing the function call completes.)184 174 Q F2 +144 186 Q F0(Disable pathname e)30.97 E(xpansion.)-.15 E F2 +144 198 Q F0 2.238(Remember the location of commands as the)28.74 F +4.738(ya)-.15 G 2.239(re look)-4.738 F 2.239(ed up for e)-.1 F -.15(xe) +-.15 G 4.739(cution. This).15 F(is)4.739 E(enabled by def)184 210 Q +(ault.)-.1 E F2144 222 Q F0 .514(All ar)28.74 F .514 +(guments in the form of assignment statements are placed in the en)-.18 +F .513(vironment for a)-.4 F +(command, not just those that precede the command name.)184 234 Q F2 +144 246 Q F0 .148(Monitor mode.)25.97 F .148 +(Job control is enabled.)5.148 F .149(This option is on by def)5.148 F +.149(ault for interacti)-.1 F .449 -.15(ve s)-.25 H(hells).15 E .651 +(on systems that support it \(see)184 258 R F1 .651(JOB CONTR)3.151 F +(OL)-.27 E F0(abo)2.901 E -.15(ve)-.15 G 3.151(\). All).15 F .65 +(processes run in a separate)3.151 F .678(process group.)184 270 R .679 +(When a background job completes, the shell prints a line containing it\ +s)5.678 F -.15(ex)184 282 S(it status.).15 E F2144 294 Q F0 .653 +(Read commands b)28.74 F .653(ut do not e)-.2 F -.15(xe)-.15 G .653 +(cute them.).15 F .652(This may be used to check a shell script for) +5.653 F(syntax errors.)184 306 Q(This is ignored by interacti)5 E .3 +-.15(ve s)-.25 H(hells.).15 E F2144 318 Q/F3 10/Times-Italic@0 SF +(option\255name)2.5 E F0(The)184 330 Q F3(option\255name)2.5 E F0 +(can be one of the follo)2.5 E(wing:)-.25 E F2(allexport)184 342 Q F0 +(Same as)224 354 Q F22.5 E F0(.)A F2(braceexpand)184 366 Q F0 +(Same as)224 378 Q F22.5 E F0(.)A F2(emacs)184 390 Q F0 .089 +(Use an emacs-style command line editing interf)13.9 F 2.589(ace. This) +-.1 F .089(is enabled by def)2.589 F(ault)-.1 E .95 +(when the shell is interacti)224 402 R -.15(ve)-.25 G 3.45(,u).15 G .95 +(nless the shell is started with the)-3.45 F F2(\255\255noediting)3.45 E +F0 2.5(option. This)224 414 R(also af)2.5 E(fects the editing interf) +-.25 E(ace used for)-.1 E F2 -.18(re)2.5 G(ad \255e).18 E F0(.)A F2(err) +184 426 Q(exit)-.18 E F0(Same as)11.31 E F22.5 E F0(.)A F2 +(errtrace)184 438 Q F0(Same as)5.03 E F22.5 E F0(.)A F2(functrace) +184 450 Q F0(Same as)224 462 Q F22.5 E F0(.)A F2(hashall)184 474 Q +F0(Same as)9.43 E F22.5 E F0(.)A F2(histexpand)184 486 Q F0 +(Same as)224 498 Q F22.5 E F0(.)A F2(history)184 510 Q F0 .586 +(Enable command history)10 F 3.087(,a)-.65 G 3.087(sd)-3.087 G .587 +(escribed abo)-3.087 F .887 -.15(ve u)-.15 H(nder).15 E F1(HIST)3.087 E +(OR)-.162 E(Y)-.315 E/F4 9/Times-Roman@0 SF(.)A F0 .587(This option is) +5.087 F(on by def)224 522 Q(ault in interacti)-.1 E .3 -.15(ve s)-.25 H +(hells.).15 E F2(ignor)184 534 Q(eeof)-.18 E F0 1.657(The ef)224 546 R +1.657(fect is as if the shell command)-.25 F/F5 10/Courier@0 SF +(IGNOREEOF=10)4.156 E F0 1.656(had been e)4.156 F -.15(xe)-.15 G(cuted) +.15 E(\(see)224 558 Q F2(Shell V)2.5 E(ariables)-.92 E F0(abo)2.5 E -.15 +(ve)-.15 G(\).).15 E F2 -.1(ke)184 570 S(yw).1 E(ord)-.1 E F0(Same as) +224 582 Q F22.5 E F0(.)A F2(monitor)184 594 Q F0(Same as)5.56 E F2 +2.5 E F0(.)A F2(noclob)184 606 Q(ber)-.1 E F0(Same as)224 618 Q F2 +2.5 E F0(.)A F2(noexec)184 630 Q F0(Same as)11.12 E F22.5 E +F0(.)A F2(noglob)184 642 Q F0(Same as)11.1 E F22.5 E F0(.)A F2 +(nolog)184 654 Q F0(Currently ignored.)16.66 E F2(notify)184 666 Q F0 +(Same as)15 E F22.5 E F0(.)A F2(nounset)184 678 Q F0(Same as)6.66 +E F22.5 E F0(.)A F2(onecmd)184 690 Q F0(Same as)6.67 E F22.5 +E F0(.)A F2(ph)184 702 Q(ysical)-.15 E F0(Same as)5.14 E F22.5 E +F0(.)A F2(pipefail)184 714 Q F0 1.029(If set, the return v)7.77 F 1.029 +(alue of a pipeline is the v)-.25 F 1.03 +(alue of the last \(rightmost\) com-)-.25 F 1.137(mand to e)224 726 R +1.136 +(xit with a non-zero status, or zero if all commands in the pipeline) +-.15 F(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(65)190.95 E 0 Cg +EP +%%Page: 66 66 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E -.15(ex)224 84 S(it successfully).15 E 5(.T)-.65 G +(his option is disabled by def)-5 E(ault.)-.1 E/F1 10/Times-Bold@0 SF +(posix)184 96 Q F0 2.09(Change the beha)17.77 F 2.091(vior of)-.2 F F1 +(bash)4.591 E F0 2.091(where the def)4.591 F 2.091(ault operation dif) +-.1 F 2.091(fers from the)-.25 F 1.212 +(POSIX standard to match the standard \()224 108 R/F2 10/Times-Italic@0 +SF 1.212(posix mode)B F0 3.712(\). See)B/F3 9/Times-Bold@0 SF 1.212 +(SEE ALSO)3.712 F F0(belo)3.462 E(w)-.25 E 2.306 +(for a reference to a document that details ho)224 120 R 4.807(wp)-.25 G +2.307(osix mode af)-4.807 F 2.307(fects bash')-.25 F(s)-.55 E(beha)224 +132 Q(vior)-.2 E(.)-.55 E F1(pri)184 144 Q(vileged)-.1 E F0(Same as)224 +156 Q F12.5 E F0(.)A F1 -.1(ve)184 168 S(rbose).1 E F0(Same as) +7.33 E F12.5 E F0(.)A F1(vi)184 180 Q F0 1.466 +(Use a vi-style command line editing interf)32.22 F 3.965(ace. This)-.1 +F 1.465(also af)3.965 F 1.465(fects the editing)-.25 F(interf)224 192 Q +(ace used for)-.1 E F1 -.18(re)2.5 G(ad \255e).18 E F0(.)A F1(xtrace)184 +204 Q F0(Same as)13.35 E F12.5 E F0(.)A(If)184 222 Q F13.052 +E F0 .552(is supplied with no)3.052 F F2(option\255name)3.053 E F0 3.053 +(,t)C .553(he v)-3.053 F .553(alues of the current options are printed.) +-.25 F(If)5.553 E F1(+o)184 234 Q F0 1.072(is supplied with no)3.572 F +F2(option\255name)3.572 E F0 3.572(,a)C 1.071(series of)-.001 F F1(set) +3.571 E F0 1.071(commands to recreate the current)3.571 F +(option settings is displayed on the standard output.)184 246 Q F1 +144 258 Q F0 -.45(Tu)28.74 G 1.071(rn on).45 F F2(privile)4.821 E -.1 +(ge)-.4 G(d).1 E F0 3.572(mode. In)4.341 F 1.072(this mode, the)3.572 F +F3($ENV)3.572 E F0(and)3.322 E F3($B)3.572 E(ASH_ENV)-.27 E F0 1.072 +(\214les are not pro-)3.322 F 1.501 +(cessed, shell functions are not inherited from the en)184 270 R 1.5 +(vironment, and the)-.4 F F3(SHELLOPTS)4 E/F4 9/Times-Roman@0 SF(,)A F3 +-.27(BA)184 282 S(SHOPTS).27 E F4(,)A F3(CDP)2.774 E -.855(AT)-.666 G(H) +.855 E F4(,)A F0(and)2.774 E F3(GLOBIGNORE)3.024 E F0 -.25(va)2.774 G +.524(riables, if the).25 F 3.025(ya)-.15 G .525(ppear in the en)-3.025 F +(vironment,)-.4 E .38(are ignored.)184 294 R .38 +(If the shell is started with the ef)5.38 F(fecti)-.25 E .679 -.15(ve u) +-.25 H .379(ser \(group\) id not equal to the real).15 F .461 +(user \(group\) id, and the)184 306 R F12.961 E F0 .461 +(option is not supplied, these actions are tak)2.961 F .462 +(en and the ef)-.1 F(fec-)-.25 E(ti)184 318 Q .695 -.15(ve u)-.25 H .395 +(ser id is set to the real user id.).15 F .395(If the)5.395 F F1 +2.895 E F0 .394(option is supplied at startup, the ef)2.895 F(fecti)-.25 +E -.15(ve)-.25 G .386(user id is not reset.)184 330 R -.45(Tu)5.386 G +.386(rning this option of).45 F 2.886(fc)-.25 G .387(auses the ef)-2.886 +F(fecti)-.25 E .687 -.15(ve u)-.25 H .387(ser and group ids to be).15 F +(set to the real user and group ids.)184 342 Q F1144 354 Q F0 +(Exit after reading and e)30.97 E -.15(xe)-.15 G(cuting one command.).15 +E F1144 366 Q F0 -.35(Tr)28.74 G .044(eat unset v).35 F .044(aria\ +bles and parameters other than the special parameters "@" and "*" as an) +-.25 F .182(error when performing parameter e)184 378 R 2.682 +(xpansion. If)-.15 F -.15(ex)2.682 G .183 +(pansion is attempted on an unset v).15 F(ari-)-.25 E .746 +(able or parameter)184 390 R 3.246(,t)-.4 G .746 +(he shell prints an error message, and, if not interacti)-3.246 F -.15 +(ve)-.25 G 3.246(,e).15 G .746(xits with a)-3.396 F(non-zero status.)184 +402 Q F1144 414 Q F0(Print shell input lines as the)29.3 E 2.5(ya) +-.15 G(re read.)-2.5 E F1144 426 Q F0 .315(After e)29.3 F .315 +(xpanding each)-.15 F F2 .315(simple command)2.815 F F0(,)A F1 -.25(fo) +2.815 G(r).25 E F0(command,)2.815 E F1(case)2.815 E F0(command,)2.815 E +F1(select)2.815 E F0(command,)2.815 E 1.236(or arithmetic)184 438 R F1 +-.25(fo)3.736 G(r).25 E F0 1.236(command, display the e)3.736 F 1.236 +(xpanded v)-.15 F 1.236(alue of)-.25 F F3(PS4)3.736 E F4(,)A F0(follo) +3.486 E 1.236(wed by the com-)-.25 F(mand and its e)184 450 Q +(xpanded ar)-.15 E(guments or associated w)-.18 E(ord list.)-.1 E F1 +144 462 Q F0 2.578(The shell performs brace e)27.63 F 2.578 +(xpansion \(see)-.15 F F1 2.578(Brace Expansion)5.078 F F0(abo)5.078 E +-.15(ve)-.15 G 5.079(\). This).15 F 2.579(is on by)5.079 F(def)184 474 Q +(ault.)-.1 E F1144 486 Q F0 .214(If set,)27.08 F F1(bash)2.714 E +F0 .214(does not o)2.714 F -.15(ve)-.15 G .214(rwrite an e).15 F .214 +(xisting \214le with the)-.15 F F1(>)2.714 E F0(,)A F1(>&)2.714 E F0 +2.713(,a)C(nd)-2.713 E F1(<>)2.713 E F0 .213(redirection opera-)2.713 F +3.053(tors. This)184 498 R .553(may be o)3.053 F -.15(ve)-.15 G .553 +(rridden when creating output \214les by using the redirection opera-) +.15 F(tor)184 510 Q F1(>|)2.5 E F0(instead of)2.5 E F1(>)2.5 E F0(.)A F1 +144 522 Q F0 .104(If set, an)27.63 F 2.604(yt)-.15 G .104(rap on) +-2.604 F F1(ERR)2.604 E F0 .103 +(is inherited by shell functions, command substitutions, and com-)2.604 +F .838(mands e)184 534 R -.15(xe)-.15 G .838(cuted in a subshell en).15 +F 3.338(vironment. The)-.4 F F1(ERR)3.338 E F0 .839 +(trap is normally not inherited in)3.339 F(such cases.)184 546 Q F1 +144 558 Q F0(Enable)26.52 E F1(!)3.032 E F0 .532 +(style history substitution.)5.532 F .531(This option is on by def)5.532 +F .531(ault when the shell is inter)-.1 F(-)-.2 E(acti)184 570 Q -.15 +(ve)-.25 G(.).15 E F1144 582 Q F0 .959 +(If set, the shell does not resolv)28.19 F 3.459(es)-.15 G .959 +(ymbolic links when e)-3.459 F -.15(xe)-.15 G .96 +(cuting commands such as).15 F F1(cd)3.46 E F0 2.822 +(that change the current w)184 594 R 2.822(orking directory)-.1 F 7.822 +(.I)-.65 G 5.322(tu)-7.822 G 2.822(ses the ph)-5.322 F 2.821 +(ysical directory structure)-.05 F 2.685(instead. By)184 606 R(def)2.685 +E(ault,)-.1 E F1(bash)2.686 E F0(follo)2.686 E .186 +(ws the logical chain of directories when performing com-)-.25 F +(mands which change the current directory)184 618 Q(.)-.65 E F1144 +630 Q F0 .89(If set, an)27.63 F 3.39(yt)-.15 G .89(raps on)-3.39 F F1 +(DEB)3.39 E(UG)-.1 E F0(and)3.39 E F1(RETURN)3.39 E F0 .89 +(are inherited by shell functions, command)3.39 F 1.932 +(substitutions, and commands e)184 642 R -.15(xe)-.15 G 1.932 +(cuted in a subshell en).15 F 4.432(vironment. The)-.4 F F1(DEB)4.432 E +(UG)-.1 E F0(and)4.432 E F1(RETURN)184 654 Q F0 +(traps are normally not inherited in such cases.)2.5 E F1144 666 Q +F0 .401(If no ar)28.6 F .401(guments follo)-.18 F 2.901(wt)-.25 G .401 +(his option, then the positional parameters are unset.)-2.901 F +(Otherwise,)5.4 E(the positional parameters are set to the)184 678 Q F2 +(ar)2.5 E(g)-.37 E F0(s, e)A -.15(ve)-.25 G 2.5(ni).15 G 2.5(fs)-2.5 G +(ome of them be)-2.5 E(gin with a)-.15 E F12.5 E F0(.)A F1144 +690 Q F0 1.944(Signal the end of options, cause all remaining)34.3 F F2 +(ar)4.444 E(g)-.37 E F0 4.444(st)C 4.444(ob)-4.444 G 4.445(ea)-4.444 G +1.945(ssigned to the positional)-4.445 F 3.446(parameters. The)184 702 R +F13.446 E F0(and)3.446 E F13.446 E F0 .945 +(options are turned of)3.446 F 3.445(f. If)-.25 F .945(there are no) +3.445 F F2(ar)3.445 E(g)-.37 E F0 .945(s, the positional)B +(parameters remain unchanged.)184 714 Q .425(The options are of)144 +730.8 R 2.925(fb)-.25 G 2.925(yd)-2.925 G(ef)-2.925 E .425 +(ault unless otherwise noted.)-.1 F .425 +(Using + rather than \255 causes these options)5.425 F(GNU Bash 4.3)72 +768 Q(2014 February 2)141.79 E(66)190.95 E 0 Cg EP +%%Page: 67 67 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .178(to be turned of)144 84 R 2.678(f. The)-.25 F .178 +(options can also be speci\214ed as ar)2.678 F .178(guments to an in) +-.18 F -.2(vo)-.4 G .177(cation of the shell.).2 F(The)5.177 E .066 +(current set of options may be found in)144 96 R/F1 10/Times-Bold@0 SF +<24ad>2.566 E F0 5.066(.T)C .066(he return status is al)-5.066 F -.1(wa) +-.1 G .066(ys true unless an in).1 F -.25(va)-.4 G .067(lid option).25 F +(is encountered.)144 108 Q F1(shift)108 124.8 Q F0([)2.5 E/F2 10 +/Times-Italic@0 SF(n)A F0(])A .429(The positional parameters from)144 +136.8 R F2(n)2.929 E F0 .429(+1 ... are renamed to)B F1 .429($1 ....) +2.929 F F0 -.15(Pa)5.428 G .428(rameters represented by the num-).15 F +(bers)144 148.8 Q F1($#)2.582 E F0(do)2.582 E .082(wn to)-.25 F F1($#) +2.582 E F0A F2(n)A F0 .082(+1 are unset.)B F2(n)5.442 E F0 .082 +(must be a non-ne)2.822 F -.05(ga)-.15 G(ti).05 E .383 -.15(ve n)-.25 H +.083(umber less than or equal to).15 F F1($#)2.583 E F0 5.083(.I)C(f) +-5.083 E F2(n)2.943 E F0 .06(is 0, no parameters are changed.)144 160.8 +R(If)5.06 E F2(n)2.92 E F0 .06(is not gi)2.8 F -.15(ve)-.25 G .06 +(n, it is assumed to be 1.).15 F(If)5.06 E F2(n)2.92 E F0 .06 +(is greater than)2.8 F F1($#)2.56 E F0 2.56(,t)C(he)-2.56 E .143 +(positional parameters are not changed.)144 172.8 R .144 +(The return status is greater than zero if)5.143 F F2(n)3.004 E F0 .144 +(is greater than)2.884 F F1($#)2.644 E F0 +(or less than zero; otherwise 0.)144 184.8 Q F1(shopt)108 201.6 Q F0([) +2.5 E F1(\255pqsu)A F0 2.5(][)C F1-2.5 E F0 2.5(][)C F2(optname) +-2.5 E F0(...])2.5 E -.8(To)144 213.6 S .64(ggle the v).8 F .639 +(alues of settings controlling optional shell beha)-.25 F(vior)-.2 E +5.639(.T)-.55 G .639(he settings can be either those)-5.639 F .374 +(listed belo)144 225.6 R 1.674 -.65(w, o)-.25 H 1.174 -.4(r, i).65 H +2.874(ft).4 G(he)-2.874 E F12.874 E F0 .375 +(option is used, those a)2.875 F -.25(va)-.2 G .375(ilable with the).25 +F F12.875 E F0 .375(option to the)2.875 F F1(set)2.875 E F0 -.2 +(bu)2.875 G .375(iltin com-).2 F 3.326(mand. W)144 237.6 R .826 +(ith no options, or with the)-.4 F F13.326 E F0 .825 +(option, a list of all settable options is displayed, with an)3.326 F +.945(indication of whether or not each is set.)144 249.6 R(The)5.945 E +F13.445 E F0 .945(option causes output to be displayed in a form) +3.445 F(that may be reused as input.)144 261.6 Q(Other options ha)5 E .3 +-.15(ve t)-.2 H(he follo).15 E(wing meanings:)-.25 E F1144 273.6 Q +F0(Enable \(set\) each)26.41 E F2(optname)2.5 E F0(.)A F1144 285.6 +Q F0(Disable \(unset\) each)24.74 E F2(optname)2.5 E F0(.)A F1144 +297.6 Q F0 .003(Suppresses normal output \(quiet mode\); the return sta\ +tus indicates whether the)24.74 F F2(optname)2.503 E F0(is)2.503 E .255 +(set or unset.)180 309.6 R .255(If multiple)5.255 F F2(optname)2.755 E +F0(ar)2.755 E .256(guments are gi)-.18 F -.15(ve)-.25 G 2.756(nw).15 G +(ith)-2.756 E F12.756 E F0 2.756(,t)C .256 +(he return status is zero if)-2.756 F(all)180 321.6 Q F2(optnames)2.5 E +F0(are enabled; non-zero otherwise.)2.5 E F1144 333.6 Q F0 +(Restricts the v)25.3 E(alues of)-.25 E F2(optname)2.5 E F0 +(to be those de\214ned for the)2.5 E F12.5 E F0(option to the)2.5 +E F1(set)2.5 E F0 -.2(bu)2.5 G(iltin.).2 E .625(If either)144 350.4 R F1 +3.125 E F0(or)3.124 E F13.124 E F0 .624(is used with no) +3.124 F F2(optname)3.124 E F0(ar)3.124 E(guments,)-.18 E F1(shopt)3.124 +E F0(sho)3.124 E .624(ws only those options which are)-.25 F 2.233 +(set or unset, respecti)144 362.4 R -.15(ve)-.25 G(ly).15 E 7.234(.U) +-.65 G 2.234(nless otherwise noted, the)-7.234 F F1(shopt)4.734 E F0 +2.234(options are disabled \(unset\) by)4.734 F(def)144 374.4 Q(ault.) +-.1 E 1.544(The return status when listing options is zero if all)144 +391.2 R F2(optnames)4.044 E F0 1.544(are enabled, non-zero otherwise.) +4.044 F .696 +(When setting or unsetting options, the return status is zero unless an) +144 403.2 R F2(optname)3.196 E F0 .696(is not a v)3.196 F .696 +(alid shell)-.25 F(option.)144 415.2 Q(The list of)144 432 Q F1(shopt) +2.5 E F0(options is:)2.5 E F1(autocd)144 450 Q F0 .2 +(If set, a command name that is the name of a directory is e)11.11 F +-.15(xe)-.15 G .199(cuted as if it were the ar).15 F(gu-)-.18 E +(ment to the)184 462 Q F1(cd)2.5 E F0 2.5(command. This)2.5 F +(option is only used by interacti)2.5 E .3 -.15(ve s)-.25 H(hells.).15 E +F1(cdable_v)144 474 Q(ars)-.1 E F0 .155(If set, an ar)184 486 R .155 +(gument to the)-.18 F F1(cd)2.655 E F0 -.2(bu)2.655 G .156 +(iltin command that is not a directory is assumed to be the).2 F +(name of a v)184 498 Q(ariable whose v)-.25 E +(alue is the directory to change to.)-.25 E F1(cdspell)144 510 Q F0 +1.055 +(If set, minor errors in the spelling of a directory component in a) +10.55 F F1(cd)3.555 E F0 1.055(command will be)3.555 F 3.987 +(corrected. The)184 522 R 1.487(errors check)3.987 F 1.487 +(ed for are transposed characters, a missing character)-.1 F 3.988(,a) +-.4 G(nd)-3.988 E .77(one character too man)184 534 R 4.57 -.65(y. I) +-.15 H 3.27(fac).65 G .77 +(orrection is found, the corrected \214lename is printed, and)-3.27 F +(the command proceeds.)184 546 Q(This option is only used by interacti)5 +E .3 -.15(ve s)-.25 H(hells.).15 E F1(checkhash)144 558 Q F0 2.079 +(If set,)184 570 R F1(bash)4.579 E F0 2.079 +(checks that a command found in the hash table e)4.579 F 2.08 +(xists before trying to)-.15 F -.15(exe)184 582 S(cute it.).15 E +(If a hashed command no longer e)5 E +(xists, a normal path search is performed.)-.15 E F1(checkjobs)144 594 Q +F0 .449(If set,)184 606 R F1(bash)2.949 E F0 .449 +(lists the status of an)2.949 F 2.949(ys)-.15 G .448 +(topped and running jobs before e)-2.949 F .448(xiting an interacti)-.15 +F -.15(ve)-.25 G 3.438(shell. If)184 618 R(an)3.438 E 3.438(yj)-.15 G +.938(obs are running, this causes the e)-3.438 F .938 +(xit to be deferred until a second e)-.15 F .939(xit is)-.15 F 2.203 +(attempted without an interv)184 630 R 2.203(ening command \(see)-.15 F +/F3 9/Times-Bold@0 SF 2.203(JOB CONTR)4.703 F(OL)-.27 E F0(abo)4.453 E +-.15(ve)-.15 G 4.703(\). The).15 F(shell)4.703 E(al)184 642 Q -.1(wa)-.1 +G(ys postpones e).1 E(xiting if an)-.15 E 2.5(yj)-.15 G +(obs are stopped.)-2.5 E F1(checkwinsize)144 654 Q F0 .796(If set,)184 +666 R F1(bash)3.296 E F0 .796(checks the windo)3.296 F 3.296(ws)-.25 G +.797(ize after each command and, if necessary)-3.296 F 3.297(,u)-.65 G +.797(pdates the)-3.297 F -.25(va)184 678 S(lues of).25 E F3(LINES)2.5 E +F0(and)2.25 E F3(COLUMNS)2.5 E/F4 9/Times-Roman@0 SF(.)A F1(cmdhist)144 +690 Q F0 1.202(If set,)6.11 F F1(bash)3.702 E F0 1.202(attempts to sa) +3.702 F 1.502 -.15(ve a)-.2 H 1.202 +(ll lines of a multiple-line command in the same history).15 F(entry)184 +702 Q 5(.T)-.65 G(his allo)-5 E +(ws easy re-editing of multi-line commands.)-.25 E(GNU Bash 4.3)72 768 Q +(2014 February 2)141.79 E(67)190.95 E 0 Cg EP +%%Page: 68 68 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(compat31)144 84 Q F0 .419(If set,)184 96 R +F1(bash)2.919 E F0 .419(changes its beha)2.919 F .419(vior to that of v) +-.2 F .42(ersion 3.1 with respect to quoted ar)-.15 F(guments)-.18 E +.462(to the)184 108 R F1([[)2.962 E F0 .462(conditional command')2.962 F +(s)-.55 E F1(=~)2.962 E F0 .462 +(operator and locale-speci\214c string comparison when)2.962 F .71 +(using the)184 120 R F1([[)3.21 E F0 .71(conditional command')3.21 F(s) +-.55 E F1(<)3.21 E F0(and)3.21 E F1(>)3.21 E F0 3.21(operators. Bash) +3.21 F -.15(ve)3.21 G .71(rsions prior to bash-4.1).15 F .821 +(use ASCII collation and)184 132 R/F2 10/Times-Italic@0 SF(str)3.321 E +(cmp)-.37 E F0 .821(\(3\); bash-4.1 and later use the current locale') +.19 F 3.32(sc)-.55 G(ollation)-3.32 E(sequence and)184 144 Q F2(str)2.5 +E(coll)-.37 E F0(\(3\).).51 E F1(compat32)144 156 Q F0 1.409(If set,)184 +168 R F1(bash)3.909 E F0 1.409(changes its beha)3.909 F 1.409 +(vior to that of v)-.2 F 1.41 +(ersion 3.2 with respect to locale-speci\214c)-.15 F .423 +(string comparison when using the)184 180 R F1([[)2.922 E F0 .422 +(conditional command')2.922 F(s)-.55 E F1(<)2.922 E F0(and)2.922 E F1(>) +2.922 E F0 .422(operators \(see pre-)2.922 F(vious item\).)184 192 Q F1 +(compat40)144 204 Q F0 1.409(If set,)184 216 R F1(bash)3.909 E F0 1.409 +(changes its beha)3.909 F 1.409(vior to that of v)-.2 F 1.41 +(ersion 4.0 with respect to locale-speci\214c)-.15 F 2.008 +(string comparison when using the)184 228 R F1([[)4.508 E F0 2.007 +(conditional command')4.508 F(s)-.55 E F1(<)4.507 E F0(and)4.507 E F1(>) +4.507 E F0 2.007(operators \(see)4.507 F .769(description of)184 240 R +F1(compat31)3.269 E F0 3.269(\)a)C .769(nd the ef)-3.269 F .769 +(fect of interrupting a command list.)-.25 F .77(Bash v)5.77 F(ersions) +-.15 E .087(4.0 and later interrupt the list as if the shell recei)184 +252 R -.15(ve)-.25 G 2.586(dt).15 G .086(he interrupt; pre)-2.586 F .086 +(vious v)-.25 F .086(ersions con-)-.15 F(tinue with the ne)184 264 Q +(xt command in the list.)-.15 E F1(compat41)144 276 Q F0 1.483(If set,) +184 288 R F1(bash)3.983 E F0 3.983(,w)C 1.483(hen in)-3.983 F F2(posix) +3.983 E F0 1.484 +(mode, treats a single quote in a double-quoted parameter)3.983 F -.15 +(ex)184 300 S .959(pansion as a special character).15 F 5.959(.T)-.55 G +.958(he single quotes must match \(an e)-5.959 F -.15(ve)-.25 G 3.458 +(nn).15 G .958(umber\) and)-3.458 F .59 +(the characters between the single quotes are considered quoted.)184 312 +R .59(This is the beha)5.59 F .59(vior of)-.2 F .59 +(posix mode through v)184 324 R .589(ersion 4.1.)-.15 F .589(The def) +5.589 F .589(ault bash beha)-.1 F .589(vior remains as in pre)-.2 F .589 +(vious v)-.25 F(er)-.15 E(-)-.2 E(sions.)184 336 Q F1(compat42)144 348 Q +F0 1.796(If set,)184 360 R F1(bash)4.296 E F0 1.796 +(does not process the replacement string in the pattern substitution w) +4.296 F(ord)-.1 E -.15(ex)184 372 S(pansion using quote remo).15 E -.25 +(va)-.15 G(l.).25 E F1(complete_fullquote)144 384 Q F0 .654(If set,)184 +396 R F1(bash)3.153 E F0 .653(quotes all shell metacharacters in \214le\ +names and directory names when per)3.153 F(-)-.2 E 1.524 +(forming completion.)184 408 R 1.524(If not set,)6.524 F F1(bash)4.024 E +F0(remo)4.024 E -.15(ve)-.15 G 4.024(sm).15 G 1.524 +(etacharacters such as the dollar sign)-4.024 F 2.667(from the set of c\ +haracters that will be quoted in completed \214lenames when these)184 +420 R .028(metacharacters appear in shell v)184 432 R .028 +(ariable references in w)-.25 F .029(ords to be completed.)-.1 F .029 +(This means)5.029 F 1.073(that dollar signs in v)184 444 R 1.073 +(ariable names that e)-.25 F 1.073 +(xpand to directories will not be quoted; ho)-.15 F(w-)-.25 E -2.15 -.25 +(ev e)184 456 T 1.922 -.4(r, a).25 H 1.422 -.15(ny d).4 H 1.123 +(ollar signs appearing in \214lenames will not be quoted, either).15 F +6.123(.T)-.55 G 1.123(his is acti)-6.123 F -.15(ve)-.25 G .59 +(only when bash is using backslashes to quote completed \214lenames.)184 +468 R .59(This v)5.59 F .59(ariable is set)-.25 F(by def)184 480 Q +(ault, which is the def)-.1 E(ault bash beha)-.1 E(vior in v)-.2 E +(ersions through 4.2.)-.15 E F1(dir)144 492 Q(expand)-.18 E F0 .486 +(If set,)184 504 R F1(bash)2.986 E F0 .486 +(replaces directory names with the results of w)2.986 F .486(ord e)-.1 F +.487(xpansion when perform-)-.15 F .18(ing \214lename completion.)184 +516 R .179(This changes the contents of the readline editing b)5.18 F +(uf)-.2 E(fer)-.25 E 5.179(.I)-.55 G 2.679(fn)-5.179 G(ot)-2.679 E(set,) +184 528 Q F1(bash)2.5 E F0(attempts to preserv)2.5 E 2.5(ew)-.15 G +(hat the user typed.)-2.5 E F1(dirspell)144 540 Q F0 .858(If set,)7.77 F +F1(bash)3.358 E F0 .858 +(attempts spelling correction on directory names during w)3.358 F .859 +(ord completion if)-.1 F +(the directory name initially supplied does not e)184 552 Q(xist.)-.15 E +F1(dotglob)144 564 Q F0 .165(If set,)7.77 F F1(bash)2.665 E F0 .165 +(includes \214lenames be)2.665 F .165(ginning with a `.)-.15 F 2.665('i) +-.7 G 2.665(nt)-2.665 G .165(he results of pathname e)-2.665 F +(xpansion.)-.15 E F1(execfail)144 576 Q F0 1.386 +(If set, a non-interacti)7.79 F 1.686 -.15(ve s)-.25 H 1.386 +(hell will not e).15 F 1.386(xit if it cannot e)-.15 F -.15(xe)-.15 G +1.387(cute the \214le speci\214ed as an).15 F(ar)184 588 Q +(gument to the)-.18 E F1(exec)2.5 E F0 -.2(bu)2.5 G(iltin command.).2 E +(An interacti)5 E .3 -.15(ve s)-.25 H(hell does not e).15 E(xit if)-.15 +E F1(exec)2.5 E F0 -.1(fa)2.5 G(ils.).1 E F1(expand_aliases)144 600 Q F0 +.717(If set, aliases are e)184 612 R .717(xpanded as described abo)-.15 +F 1.017 -.15(ve u)-.15 H(nder).15 E/F3 9/Times-Bold@0 SF(ALIASES)3.217 E +/F4 9/Times-Roman@0 SF(.)A F0 .716(This option is enabled)5.217 F +(by def)184 624 Q(ault for interacti)-.1 E .3 -.15(ve s)-.25 H(hells.) +.15 E F1(extdeb)144 636 Q(ug)-.2 E F0(If set, beha)184 648 Q +(vior intended for use by deb)-.2 E(uggers is enabled:)-.2 E F1(1.)184 +660 Q F0(The)28.5 E F14.25 E F0 1.75(option to the)4.25 F F1 +(declar)4.251 E(e)-.18 E F0 -.2(bu)4.251 G 1.751 +(iltin displays the source \214le name and line).2 F +(number corresponding to each function name supplied as an ar)220 672 Q +(gument.)-.18 E F1(2.)184 684 Q F0 1.667(If the command run by the)28.5 +F F1(DEB)4.167 E(UG)-.1 E F0 1.667(trap returns a non-zero v)4.167 F +1.667(alue, the ne)-.25 F(xt)-.15 E(command is skipped and not e)220 696 +Q -.15(xe)-.15 G(cuted.).15 E F1(3.)184 708 Q F0 .84 +(If the command run by the)28.5 F F1(DEB)3.34 E(UG)-.1 E F0 .841 +(trap returns a v)3.341 F .841(alue of 2, and the shell is)-.25 F -.15 +(exe)220 720 S .488 +(cuting in a subroutine \(a shell function or a shell script e).15 F +-.15(xe)-.15 G .488(cuted by the).15 F F1(.)2.988 E F0(or)2.988 E +(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(68)190.95 E 0 Cg EP +%%Page: 69 69 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(sour)220 84 Q(ce)-.18 E F0 -.2(bu)2.5 G +(iltins\), a call to).2 E F1 -.18(re)2.5 G(tur).18 E(n)-.15 E F0 +(is simulated.)2.5 E F1(4.)184 96 Q/F2 9/Times-Bold@0 SF -.27(BA)28.5 G +(SH_ARGC).27 E F0(and)3.153 E F2 -.27(BA)3.403 G(SH_ARGV).27 E F0 .904 +(are updated as described in their descriptions)3.154 F(abo)220 108 Q +-.15(ve)-.15 G(.).15 E F1(5.)184 120 Q F0 1.359 +(Function tracing is enabled:)28.5 F 1.359 +(command substitution, shell functions, and sub-)6.359 F(shells in)220 +132 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(dw).1 G(ith)-2.5 E F1(\()2.5 E/F3 10 +/Times-Italic@0 SF(command)2.5 E F1(\))2.5 E F0(inherit the)2.5 E F1 +(DEB)2.5 E(UG)-.1 E F0(and)2.5 E F1(RETURN)2.5 E F0(traps.)2.5 E F1(6.) +184 144 Q F0 .804(Error tracing is enabled:)28.5 F .805 +(command substitution, shell functions, and subshells)5.804 F(in)220 156 +Q -.2(vo)-.4 G -.1(ke).2 G 2.5(dw).1 G(ith)-2.5 E F1(\()2.5 E F3 +(command)2.5 E F1(\))2.5 E F0(inherit the)2.5 E F1(ERR)2.5 E F0(trap.) +2.5 E F1(extglob)144 168 Q F0 .4(If set, the e)8.89 F .4 +(xtended pattern matching features described abo)-.15 F .7 -.15(ve u) +-.15 H(nder).15 E F1 -.1(Pa)2.9 G .4(thname Expan-).1 F(sion)184 180 Q +F0(are enabled.)2.5 E F1(extquote)144 192 Q F0 2.473(If set,)184 204 R +F1($)4.973 E F0<08>A F3(string)A F0 4.973<0861>C(nd)-4.973 E F1($)4.973 +E F0(")A F3(string)A F0 4.973("q)C 2.473(uoting is performed within) +-4.973 F F1(${)4.973 E F3(par)A(ameter)-.15 E F1(})A F0 -.15(ex)4.973 G +(pansions).15 E(enclosed in double quotes.)184 216 Q +(This option is enabled by def)5 E(ault.)-.1 E F1(failglob)144 228 Q F0 +1.425(If set, patterns which f)7.77 F 1.425 +(ail to match \214lenames during pathname e)-.1 F 1.424 +(xpansion result in an)-.15 F -.15(ex)184 240 S(pansion error).15 E(.) +-.55 E F1 -.25(fo)144 252 S -.18(rc).25 G(e_\214gnor).18 E(e)-.18 E F0 +.936(If set, the suf)184 264 R<8c78>-.25 E .936(es speci\214ed by the) +-.15 F F2(FIGNORE)3.436 E F0 .936(shell v)3.186 F .936(ariable cause w) +-.25 F .937(ords to be ignored)-.1 F .32(when performing w)184 276 R .32 +(ord completion e)-.1 F -.15(ve)-.25 G 2.82(ni).15 G 2.82(ft)-2.82 G .32 +(he ignored w)-2.82 F .32(ords are the only possible com-)-.1 F 2.947 +(pletions. See)184 288 R F2 .447(SHELL V)2.947 F(ARIABLES)-1.215 E F0 +(abo)2.697 E .747 -.15(ve f)-.15 H .448(or a description of).15 F F2 +(FIGNORE)2.948 E/F4 9/Times-Roman@0 SF(.)A F0 .448(This option is)4.948 +F(enabled by def)184 300 Q(ault.)-.1 E F1(globasciiranges)144 312 Q F0 +2.519(If set, range e)184 324 R 2.519 +(xpressions used in pattern matching brack)-.15 F 2.518(et e)-.1 F 2.518 +(xpressions \(see)-.15 F F2 -.09(Pa)5.018 G(tter).09 E(n)-.135 E +(Matching)184 336 Q F0(abo)2.964 E -.15(ve)-.15 G 3.214(\)b).15 G(eha) +-3.214 E 1.014 -.15(ve a)-.2 H 3.214(si).15 G 3.214(fi)-3.214 G 3.214 +(nt)-3.214 G .714(he traditional C locale when performing comparisons.) +-3.214 F 1.02(That is, the current locale')184 348 R 3.52(sc)-.55 G 1.02 +(ollating sequence is not tak)-3.52 F 1.02(en into account, so)-.1 F F1 +(b)3.52 E F0 1.02(will not)3.52 F .956(collate between)184 360 R F1(A) +3.456 E F0(and)3.456 E F1(B)3.456 E F0 3.457(,a)C .957(nd upper)-3.457 F +.957(-case and lo)-.2 F(wer)-.25 E .957 +(-case ASCII characters will collate)-.2 F(together)184 372 Q(.)-.55 E +F1(globstar)144 384 Q F0 .519(If set, the pattern)5 F F1(**)3.019 E F0 +.519(used in a pathname e)3.019 F .519(xpansion conte)-.15 F .518 +(xt will match all \214les and zero)-.15 F .431 +(or more directories and subdirectories.)184 396 R .431 +(If the pattern is follo)5.431 F .432(wed by a)-.25 F F1(/)2.932 E F0 +2.932(,o)C .432(nly directories)-2.932 F(and subdirectories match.)184 +408 Q F1(gnu_errfmt)144 420 Q F0(If set, shell error messages are writt\ +en in the standard GNU error message format.)184 432 Q F1(histappend)144 +444 Q F0 .676 +(If set, the history list is appended to the \214le named by the v)184 +456 R .676(alue of the)-.25 F F2(HISTFILE)3.176 E F0 -.25(va)2.926 G +(ri-).25 E(able when the shell e)184 468 Q(xits, rather than o)-.15 E +-.15(ve)-.15 G(rwriting the \214le.).15 E F1(histr)144 480 Q(eedit)-.18 +E F0 .575(If set, and)184 492 R F1 -.18(re)3.075 G(adline).18 E F0 .575 +(is being used, a user is gi)3.075 F -.15(ve)-.25 G 3.075(nt).15 G .576 +(he opportunity to re-edit a f)-3.075 F .576(ailed his-)-.1 F +(tory substitution.)184 504 Q F1(histv)144 516 Q(erify)-.1 E F0 .403 +(If set, and)184 528 R F1 -.18(re)2.903 G(adline).18 E F0 .403 +(is being used, the results of history substitution are not immediately) +2.903 F .661(passed to the shell parser)184 540 R 5.661(.I)-.55 G .662 +(nstead, the resulting line is loaded into the)-5.661 F F1 -.18(re)3.162 +G(adline).18 E F0(editing)3.162 E -.2(bu)184 552 S -.25(ff).2 G(er).25 E +2.5(,a)-.4 G(llo)-2.5 E(wing further modi\214cation.)-.25 E F1 +(hostcomplete)144 564 Q F0 1.182(If set, and)184 576 R F1 -.18(re)3.682 +G(adline).18 E F0 1.182(is being used,)3.682 F F1(bash)3.682 E F0 1.181 +(will attempt to perform hostname completion)3.681 F 1.38(when a w)184 +588 R 1.38(ord containing a)-.1 F F1(@)3.881 E F0 1.381 +(is being completed \(see)3.881 F F1(Completing)3.881 E F0(under)3.881 E +F2(READLINE)3.881 E F0(abo)184 600 Q -.15(ve)-.15 G 2.5(\). This).15 F +(is enabled by def)2.5 E(ault.)-.1 E F1(huponexit)144 612 Q F0(If set,) +184 624 Q F1(bash)2.5 E F0(will send)2.5 E F2(SIGHUP)2.5 E F0 +(to all jobs when an interacti)2.25 E .3 -.15(ve l)-.25 H(ogin shell e) +.15 E(xits.)-.15 E F1(interacti)144 636 Q -.1(ve)-.1 G(_comments).1 E F0 +.33(If set, allo)184 648 R 2.83(waw)-.25 G .33(ord be)-2.93 F .33 +(ginning with)-.15 F F1(#)2.83 E F0 .33(to cause that w)2.83 F .33 +(ord and all remaining characters on)-.1 F .967 +(that line to be ignored in an interacti)184 660 R 1.267 -.15(ve s)-.25 +H .967(hell \(see).15 F F2(COMMENTS)3.467 E F0(abo)3.217 E -.15(ve)-.15 +G 3.467(\). This).15 F .968(option is)3.468 F(enabled by def)184 672 Q +(ault.)-.1 E F1(lastpipe)144 684 Q F0 1.212 +(If set, and job control is not acti)6.66 F -.15(ve)-.25 G 3.712(,t).15 +G 1.212(he shell runs the last command of a pipeline not)-3.712 F -.15 +(exe)184 696 S(cuted in the background in the current shell en).15 E +(vironment.)-.4 E F1(lithist)144 708 Q F0 .654(If set, and the)15.55 F +F1(cmdhist)3.154 E F0 .654 +(option is enabled, multi-line commands are sa)3.154 F -.15(ve)-.2 G +3.155(dt).15 G 3.155(ot)-3.155 G .655(he history)-3.155 F +(with embedded ne)184 720 Q +(wlines rather than using semicolon separators where possible.)-.25 E +(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(69)190.95 E 0 Cg EP +%%Page: 70 70 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF(login_shell)144 84 Q F0 .486 +(The shell sets this option if it is started as a login shell \(see)184 +96 R/F2 9/Times-Bold@0 SF(INV)2.986 E(OCA)-.405 E(TION)-.855 E F0(abo) +2.736 E -.15(ve)-.15 G 2.986(\). The).15 F -.25(va)184 108 S +(lue may not be changed.).25 E F1(mailwar)144 120 Q(n)-.15 E F0 .814 +(If set, and a \214le that)184 132 R F1(bash)3.314 E F0 .815 +(is checking for mail has been accessed since the last time it)3.314 F +-.1(wa)184 144 S 2.5(sc).1 G(heck)-2.5 E(ed, the message `)-.1 E +(`The mail in)-.74 E/F3 10/Times-Italic@0 SF(mail\214le)2.5 E F0 +(has been read')2.5 E 2.5('i)-.74 G 2.5(sd)-2.5 G(isplayed.)-2.5 E F1 +(no_empty_cmd_completion)144 156 Q F0 .325(If set, and)184 168 R F1 -.18 +(re)2.825 G(adline).18 E F0 .325(is being used,)2.825 F F1(bash)2.824 E +F0 .324(will not attempt to search the)2.824 F F2 -.666(PA)2.824 G(TH) +-.189 E F0 .324(for possible)2.574 F +(completions when completion is attempted on an empty line.)184 180 Q F1 +(nocaseglob)144 192 Q F0 .436(If set,)184 204 R F1(bash)2.936 E F0 .436 +(matches \214lenames in a case\255insensiti)2.936 F .737 -.15(ve f)-.25 +H .437(ashion when performing pathname).05 F -.15(ex)184 216 S +(pansion \(see).15 E F1 -.1(Pa)2.5 G(thname Expansion).1 E F0(abo)2.5 E +-.15(ve)-.15 G(\).).15 E F1(nocasematch)144 228 Q F0 1.194(If set,)184 +240 R F1(bash)3.694 E F0 1.194(matches patterns in a case\255insensiti) +3.694 F 1.493 -.15(ve f)-.25 H 1.193(ashion when performing matching).05 +F(while e)184 252 Q -.15(xe)-.15 G(cuting).15 E F1(case)2.5 E F0(or)2.5 +E F1([[)2.5 E F0(conditional commands.)2.5 E F1(nullglob)144 264 Q F0 +.854(If set,)184 276 R F1(bash)3.354 E F0(allo)3.354 E .855 +(ws patterns which match no \214les \(see)-.25 F F1 -.1(Pa)3.355 G .855 +(thname Expansion).1 F F0(abo)3.355 E -.15(ve)-.15 G 3.355(\)t).15 G(o) +-3.355 E -.15(ex)184 288 S(pand to a null string, rather than themselv) +.15 E(es.)-.15 E F1(pr)144 300 Q(ogcomp)-.18 E F0 .677 +(If set, the programmable completion f)184 312 R .677(acilities \(see) +-.1 F F1(Pr)3.176 E .676(ogrammable Completion)-.18 F F0(abo)3.176 E +-.15(ve)-.15 G(\)).15 E(are enabled.)184 324 Q +(This option is enabled by def)5 E(ault.)-.1 E F1(pr)144 336 Q(omptv) +-.18 E(ars)-.1 E F0 1.447(If set, prompt strings under)184 348 R 1.448 +(go parameter e)-.18 F 1.448(xpansion, command substitution, arithmetic) +-.15 F -.15(ex)184 360 S .171(pansion, and quote remo).15 F -.25(va)-.15 +G 2.67(la).25 G .17(fter being e)-2.67 F .17(xpanded as described in) +-.15 F F2(PR)2.67 E(OMPTING)-.27 E F0(abo)2.42 E -.15(ve)-.15 G(.).15 E +(This option is enabled by def)184 372 Q(ault.)-.1 E F1 -.18(re)144 384 +S(stricted_shell).18 E F0 1.069 +(The shell sets this option if it is started in restricted mode \(see) +184 396 R F2 1.069(RESTRICTED SHELL)3.569 F F0(belo)184 408 Q 4.178 +(w\). The)-.25 F -.25(va)4.178 G 1.678(lue may not be changed.).25 F +1.678(This is not reset when the startup \214les are)6.678 F -.15(exe) +184 420 S(cuted, allo).15 E(wing the startup \214les to disco)-.25 E +-.15(ve)-.15 G 2.5(rw).15 G(hether or not a shell is restricted.)-2.5 E +F1(shift_v)144 432 Q(erbose)-.1 E F0 .501(If set, the)184 444 R F1 +(shift)3.001 E F0 -.2(bu)3.001 G .501 +(iltin prints an error message when the shift count e).2 F .502 +(xceeds the number)-.15 F(of positional parameters.)184 456 Q F1(sour) +144 468 Q(cepath)-.18 E F0 .771(If set, the)184 480 R F1(sour)3.271 E +(ce)-.18 E F0(\()3.271 E F1(.)A F0 3.271(\)b)C .771(uiltin uses the v) +-3.471 F .771(alue of)-.25 F F2 -.666(PA)3.27 G(TH)-.189 E F0 .77 +(to \214nd the directory containing the)3.02 F(\214le supplied as an ar) +184 492 Q 2.5(gument. This)-.18 F(option is enabled by def)2.5 E(ault.) +-.1 E F1(xpg_echo)144 504 Q F0(If set, the)184 516 Q F1(echo)2.5 E F0 +-.2(bu)2.5 G(iltin e).2 E(xpands backslash-escape sequences by def)-.15 +E(ault.)-.1 E F1(suspend)108 532.8 Q F0([)2.5 E F1A F0(])A 1.001 +(Suspend the e)144 544.8 R -.15(xe)-.15 G 1.001 +(cution of this shell until it recei).15 F -.15(ve)-.25 G 3.501(sa).15 G +F2(SIGCONT)A F0 3.502(signal. A)3.252 F 1.002(login shell cannot be) +3.502 F .023(suspended; the)144 556.8 R F12.523 E F0 .023 +(option can be used to o)2.523 F -.15(ve)-.15 G .022 +(rride this and force the suspension.).15 F .022(The return status is) +5.022 F 2.5(0u)144 568.8 S(nless the shell is a login shell and)-2.5 E +F12.5 E F0(is not supplied, or if job control is not enabled.)2.5 +E F1(test)108 585.6 Q F3 -.2(ex)2.5 G(pr).2 E F1([)108 597.6 Q F3 -.2 +(ex)2.5 G(pr).2 E F1(])2.5 E F0 .877 +(Return a status of 0 \(true\) or 1 \(f)6.77 F .878 +(alse\) depending on the e)-.1 F -.25(va)-.25 G .878 +(luation of the conditional e).25 F(xpression)-.15 E F3 -.2(ex)144 609.6 +S(pr).2 E F0 5.53(.E).73 G .53 +(ach operator and operand must be a separate ar)-5.53 F 3.03 +(gument. Expressions)-.18 F .53(are composed of the)3.03 F 3.079 +(primaries described abo)144 621.6 R 3.379 -.15(ve u)-.15 H(nder).15 E +F2(CONDITION)5.579 E 3.079(AL EXPRESSIONS)-.18 F/F4 9/Times-Roman@0 SF +(.)A F1(test)7.579 E F0 3.08(does not accept an)5.58 F(y)-.15 E +(options, nor does it accept and ignore an ar)144 633.6 Q(gument of)-.18 +E F12.5 E F0(as signifying the end of options.)2.5 E .786 +(Expressions may be combined using the follo)144 651.6 R .785 +(wing operators, listed in decreasing order of prece-)-.25 F 3.411 +(dence. The)144 663.6 R -.25(eva)3.411 G .911 +(luation depends on the number of ar).25 F .912(guments; see belo)-.18 F +4.712 -.65(w. O)-.25 H .912(perator precedence is).65 F +(used when there are \214v)144 675.6 Q 2.5(eo)-.15 G 2.5(rm)-2.5 G +(ore ar)-2.5 E(guments.)-.18 E F1(!)144 687.6 Q F3 -.2(ex)2.5 G(pr).2 E +F0 -.35(Tr)12.6 G(ue if).35 E F3 -.2(ex)2.5 G(pr).2 E F0(is f)3.23 E +(alse.)-.1 E F1(\()144 699.6 Q F3 -.2(ex)2.5 G(pr).2 E F1(\))2.5 E F0 +.26(Returns the v)6.77 F .26(alue of)-.25 F F3 -.2(ex)2.76 G(pr).2 E F0 +5.26(.T)C .26(his may be used to o)-5.26 F -.15(ve)-.15 G .26 +(rride the normal precedence of opera-).15 F(tors.)180 711.6 Q +(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(70)190.95 E 0 Cg EP +%%Page: 71 71 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Italic@0 SF -.2(ex)144 84 S(pr1).2 E F02.5 E/F2 +10/Times-Bold@0 SF(a)A F1 -.2(ex)2.5 G(pr2).2 E F0 -.35(Tr)180 96 S +(ue if both).35 E F1 -.2(ex)2.5 G(pr1).2 E F0(and)2.5 E F1 -.2(ex)2.5 G +(pr2).2 E F0(are true.)2.52 E F1 -.2(ex)144 108 S(pr1).2 E F02.5 E +F2(o)A F1 -.2(ex)2.5 G(pr2).2 E F0 -.35(Tr)180 120 S(ue if either).35 E +F1 -.2(ex)2.5 G(pr1).2 E F0(or)2.5 E F1 -.2(ex)2.5 G(pr2).2 E F0 +(is true.)2.52 E F2(test)144 136.8 Q F0(and)2.5 E F2([)2.5 E F0 -.25 +(eva)2.5 G(luate conditional e).25 E +(xpressions using a set of rules based on the number of ar)-.15 E +(guments.)-.18 E 2.5(0a)144 154.8 S -.18(rg)-2.5 G(uments).18 E(The e) +180 166.8 Q(xpression is f)-.15 E(alse.)-.1 E 2.5(1a)144 178.8 S -.18 +(rg)-2.5 G(ument).18 E(The e)180 190.8 Q +(xpression is true if and only if the ar)-.15 E(gument is not null.)-.18 +E 2.5(2a)144 202.8 S -.18(rg)-2.5 G(uments).18 E .37(If the \214rst ar) +180 214.8 R .37(gument is)-.18 F F2(!)2.87 E F0 2.87(,t)C .37(he e)-2.87 +F .37(xpression is true if and only if the second ar)-.15 F .37 +(gument is null.)-.18 F .38(If the \214rst ar)180 226.8 R .38 +(gument is one of the unary conditional operators listed abo)-.18 F .679 +-.15(ve u)-.15 H(nder).15 E/F3 9/Times-Bold@0 SF(CONDI-)2.879 E(TION)180 +238.8 Q .552(AL EXPRESSIONS)-.18 F/F4 9/Times-Roman@0 SF(,)A F0 .552 +(the e)2.802 F .552(xpression is true if the unary test is true.)-.15 F +.552(If the \214rst ar)5.552 F(gu-)-.18 E(ment is not a v)180 250.8 Q +(alid unary conditional operator)-.25 E 2.5(,t)-.4 G(he e)-2.5 E +(xpression is f)-.15 E(alse.)-.1 E 2.5(3a)144 262.8 S -.18(rg)-2.5 G +(uments).18 E .236(The follo)180 274.8 R .236 +(wing conditions are applied in the order listed.)-.25 F .236 +(If the second ar)5.236 F .236(gument is one of)-.18 F .855 +(the binary conditional operators listed abo)180 286.8 R 1.155 -.15 +(ve u)-.15 H(nder).15 E F3(CONDITION)3.355 E .855(AL EXPRESSIONS)-.18 F +F4(,)A F0(the)3.105 E .579(result of the e)180 298.8 R .578(xpression i\ +s the result of the binary test using the \214rst and third ar)-.15 F +(guments)-.18 E 1.332(as operands.)180 310.8 R(The)6.332 E F23.832 +E F0(and)3.832 E F23.832 E F0 1.333 +(operators are considered binary operators when there are)3.832 F .558 +(three ar)180 322.8 R 3.058(guments. If)-.18 F .558(the \214rst ar)3.058 +F .558(gument is)-.18 F F2(!)3.058 E F0 3.058(,t)C .558(he v)-3.058 F +.558(alue is the ne)-.25 F -.05(ga)-.15 G .558(tion of the tw).05 F +(o-ar)-.1 E(gument)-.18 E .52(test using the second and third ar)180 +334.8 R 3.021(guments. If)-.18 F .521(the \214rst ar)3.021 F .521 +(gument is e)-.18 F(xactly)-.15 E F2(\()3.021 E F0 .521(and the third) +3.021 F(ar)180 346.8 Q .485(gument is e)-.18 F(xactly)-.15 E F2(\))2.985 +E F0 2.985(,t)C .485(he result is the one-ar)-2.985 F .485 +(gument test of the second ar)-.18 F 2.985(gument. Other)-.18 F(-)-.2 E +(wise, the e)180 358.8 Q(xpression is f)-.15 E(alse.)-.1 E 2.5(4a)144 +370.8 S -.18(rg)-2.5 G(uments).18 E .384(If the \214rst ar)180 382.8 R +.384(gument is)-.18 F F2(!)2.884 E F0 2.885(,t)C .385 +(he result is the ne)-2.885 F -.05(ga)-.15 G .385(tion of the three-ar) +.05 F .385(gument e)-.18 F .385(xpression com-)-.15 F 1.648 +(posed of the remaining ar)180 394.8 R 4.147(guments. Otherwise,)-.18 F +1.647(the e)4.147 F 1.647(xpression is parsed and e)-.15 F -.25(va)-.25 +G(luated).25 E(according to precedence using the rules listed abo)180 +406.8 Q -.15(ve)-.15 G(.).15 E 2.5(5o)144 418.8 S 2.5(rm)-2.5 G(ore ar) +-2.5 E(guments)-.18 E 1.635(The e)180 430.8 R 1.635 +(xpression is parsed and e)-.15 F -.25(va)-.25 G 1.635 +(luated according to precedence using the rules listed).25 F(abo)180 +442.8 Q -.15(ve)-.15 G(.).15 E(When used with)144 460.8 Q F2(test)2.5 E +F0(or)2.5 E F2([)2.5 E F0 2.5(,t)C(he)-2.5 E F2(<)2.5 E F0(and)2.5 E F2 +(>)2.5 E F0(operators sort le)2.5 E +(xicographically using ASCII ordering.)-.15 E F2(times)108 477.6 Q F0 +1.229(Print the accumulated user and system times for the shell and for\ + processes run from the shell.)13.23 F(The return status is 0.)144 489.6 +Q F2(trap)108 506.4 Q F0([)2.5 E F2(\255lp)A F0 2.5(][)C([)-2.5 E F1(ar) +A(g)-.37 E F0(])A F1(sigspec)2.5 E F0(...])2.5 E .702(The command)144 +518.4 R F1(ar)3.532 E(g)-.37 E F0 .702(is to be read and e)3.422 F -.15 +(xe)-.15 G .702(cuted when the shell recei).15 F -.15(ve)-.25 G 3.203 +(ss).15 G(ignal\(s\))-3.203 E F1(sigspec)3.203 E F0 5.703(.I).31 G(f) +-5.703 E F1(ar)3.533 E(g)-.37 E F0(is)3.423 E .609 +(absent \(and there is a single)144 530.4 R F1(sigspec)3.108 E F0 3.108 +(\)o)C(r)-3.108 E F23.108 E F0 3.108(,e)C .608 +(ach speci\214ed signal is reset to its original disposition)-3.108 F +.658(\(the v)144 542.4 R .658(alue it had upon entrance to the shell\).) +-.25 F(If)5.658 E F1(ar)3.488 E(g)-.37 E F0 .659 +(is the null string the signal speci\214ed by each)3.378 F F1(sigspec) +144.34 554.4 Q F0 .581 +(is ignored by the shell and by the commands it in)3.391 F -.2(vo)-.4 G +-.1(ke).2 G 3.08(s. If).1 F F1(ar)3.41 E(g)-.37 E F0 .58 +(is not present and)3.3 F F23.08 E F0(has)3.08 E 1.214 +(been supplied, then the trap commands associated with each)144 566.4 R +F1(sigspec)4.054 E F0 1.215(are displayed.)4.024 F 1.215(If no ar)6.215 +F(gu-)-.18 E .86(ments are supplied or if only)144 578.4 R F23.36 +E F0 .86(is gi)3.36 F -.15(ve)-.25 G(n,).15 E F2(trap)3.36 E F0 .86 +(prints the list of commands associated with each)3.36 F 2.83 +(signal. The)144 590.4 R F22.83 E F0 .33(option causes the shell \ +to print a list of signal names and their corresponding num-)2.83 F +4.311(bers. Each)144 602.4 R F1(sigspec)4.651 E F0 1.811 +(is either a signal name de\214ned in <)4.621 F F1(signal.h)A F0 1.81 +(>, or a signal number)B 6.81(.S)-.55 G(ignal)-6.81 E +(names are case insensiti)144 614.4 Q .3 -.15(ve a)-.25 H(nd the).15 E +F3(SIG)2.5 E F0(pre\214x is optional.)2.25 E 1.648(If a)144 632.4 R F1 +(sigspec)4.488 E F0(is)4.458 E F3(EXIT)4.148 E F0 1.648 +(\(0\) the command)3.898 F F1(ar)4.479 E(g)-.37 E F0 1.649(is e)4.369 F +-.15(xe)-.15 G 1.649(cuted on e).15 F 1.649(xit from the shell.)-.15 F +1.649(If a)6.649 F F1(sigspec)4.489 E F0(is)4.459 E F3(DEB)144 644.4 Q +(UG)-.09 E F4(,)A F0 1.168(the command)3.418 F F1(ar)3.998 E(g)-.37 E F0 +1.168(is e)3.888 F -.15(xe)-.15 G 1.167(cuted before e).15 F -.15(ve) +-.25 G(ry).15 E F1 1.167(simple command)3.667 F F0(,)A F1(for)3.667 E F0 +(command,)3.667 E F1(case)3.667 E F0(com-)3.667 E(mand,)144 656.4 Q F1 +(select)2.646 E F0 .146(command, e)2.646 F -.15(ve)-.25 G .146 +(ry arithmetic).15 F F1(for)2.646 E F0 .147 +(command, and before the \214rst command e)2.646 F -.15(xe)-.15 G .147 +(cutes in a).15 F .146(shell function \(see)144 668.4 R F3 .146 +(SHELL GRAMMAR)2.646 F F0(abo)2.396 E -.15(ve)-.15 G 2.646(\). Refer).15 +F .146(to the description of the)2.646 F F2(extdeb)2.645 E(ug)-.2 E F0 +.145(option to)2.645 F(the)144 680.4 Q F2(shopt)3.2 E F0 -.2(bu)3.2 G .7 +(iltin for details of its ef).2 F .7(fect on the)-.25 F F2(DEB)3.2 E(UG) +-.1 E F0 3.2(trap. If)3.2 F(a)3.2 E F1(sigspec)3.54 E F0(is)3.51 E F3 +(RETURN)3.2 E F4(,)A F0 .701(the com-)2.951 F(mand)144 692.4 Q F1(ar) +3.474 E(g)-.37 E F0 .644(is e)3.364 F -.15(xe)-.15 G .643 +(cuted each time a shell function or a script e).15 F -.15(xe)-.15 G +.643(cuted with the).15 F F2(.)3.143 E F0(or)3.143 E F2(sour)3.143 E(ce) +-.18 E F0 -.2(bu)3.143 G(iltins).2 E(\214nishes e)144 704.4 Q -.15(xe) +-.15 G(cuting.).15 E .521(If a)144 722.4 R F1(sigspec)3.361 E F0(is) +3.331 E F3(ERR)3.021 E F4(,)A F0 .522(the command)2.771 F F1(ar)3.352 E +(g)-.37 E F0 .522(is e)3.242 F -.15(xe)-.15 G .522(cuted whene).15 F +-.15(ve)-.25 G 3.022(raap).15 G .522(ipeline \(which may consist of a) +-3.022 F(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(71)190.95 E 0 Cg +EP +%%Page: 72 72 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E .185(single simple command\), a list, or a compound command retu\ +rns a non\255zero e)144 84 R .184(xit status, subject to)-.15 F .451 +(the follo)144 96 R .451(wing conditions.)-.25 F(The)5.451 E/F1 9 +/Times-Bold@0 SF(ERR)2.951 E F0 .451(trap is not e)2.701 F -.15(xe)-.15 +G .451(cuted if the f).15 F .452(ailed command is part of the com-)-.1 F +.388(mand list immediately follo)144 108 R .388(wing a)-.25 F/F2 10 +/Times-Bold@0 SF(while)2.888 E F0(or)2.888 E F2(until)2.888 E F0 -.1(ke) +2.888 G(yw)-.05 E .388(ord, part of the test in an)-.1 F/F3 10 +/Times-Italic@0 SF(if)2.897 E F0 .387(statement, part)4.847 F .777 +(of a command e)144 120 R -.15(xe)-.15 G .778(cuted in a).15 F F2(&&) +3.278 E F0(or)3.278 E F2(||)3.278 E F0 .778(list e)3.278 F .778 +(xcept the command follo)-.15 F .778(wing the \214nal)-.25 F F2(&&)3.278 +E F0(or)3.278 E F2(||)3.278 E F0 3.278(,a)C -.15(ny)-3.278 G 1.28 +(command in a pipeline b)144 132 R 1.28(ut the last, or if the command') +-.2 F 3.78(sr)-.55 G 1.28(eturn v)-3.78 F 1.28(alue is being in)-.25 F +-.15(ve)-.4 G 1.28(rted using).15 F F2(!)3.78 E F0(.)A +(These are the same conditions obe)144 144 Q(yed by the)-.15 E F2(err) +2.5 E(exit)-.18 E F0(\()2.5 E F2A F0 2.5(\)o)C(ption.)-2.5 E 1.095 +(Signals ignored upon entry to the shell cannot be trapped or reset.)144 +162 R -.35(Tr)6.095 G 1.095(apped signals that are not).35 F .662 +(being ignored are reset to their original v)144 174 R .662 +(alues in a subshell or subshell en)-.25 F .661(vironment when one is) +-.4 F 2.5(created. The)144 186 R(return status is f)2.5 E(alse if an)-.1 +E(y)-.15 E F3(sigspec)2.84 E F0(is in)2.81 E -.25(va)-.4 G +(lid; otherwise).25 E F2(trap)2.5 E F0(returns true.)2.5 E F2(type)108 +202.8 Q F0([)2.5 E F2(\255aftpP)A F0(])A F3(name)2.5 E F0([)2.5 E F3 +(name)A F0(...])2.5 E -.4(Wi)144 214.8 S .173 +(th no options, indicate ho).4 F 2.673(we)-.25 G(ach)-2.673 E F3(name) +3.033 E F0 -.1(wo)2.853 G .174 +(uld be interpreted if used as a command name.).1 F .174(If the)5.174 F +F2144 226.8 Q F0 .843(option is used,)3.343 F F2(type)3.343 E F0 +.843(prints a string which is one of)3.343 F F3(alias)3.343 E F0(,).27 E +F3 -.1(ke)3.343 G(ywor)-.2 E(d)-.37 E F0(,).77 E F3(function)3.343 E F0 +(,).24 E F3 -.2(bu)3.342 G(iltin).2 E F0 3.342(,o).24 G(r)-3.342 E F3 +(\214le)5.252 E F0(if)3.522 E F3(name)144.36 238.8 Q F0 .086 +(is an alias, shell reserv)2.766 F .086(ed w)-.15 F .086 +(ord, function, b)-.1 F .087(uiltin, or disk \214le, respecti)-.2 F -.15 +(ve)-.25 G(ly).15 E 5.087(.I)-.65 G 2.587(ft)-5.087 G(he)-2.587 E F3 +(name)2.947 E F0 .087(is not)2.767 F .119 +(found, then nothing is printed, and an e)144 250.8 R .118 +(xit status of f)-.15 F .118(alse is returned.)-.1 F .118(If the)5.118 F +F22.618 E F0 .118(option is used,)2.618 F F2(type)2.618 E F0 .855 +(either returns the name of the disk \214le that w)144 262.8 R .855 +(ould be e)-.1 F -.15(xe)-.15 G .855(cuted if).15 F F3(name)3.715 E F0 +.855(were speci\214ed as a com-)3.535 F .641(mand name, or nothing if) +144 274.8 R/F4 10/Courier@0 SF .641(type -t name)3.141 F F0 -.1(wo)3.141 +G .641(uld not return).1 F F3(\214le)3.14 E F0 5.64(.T).18 G(he)-5.64 E +F23.14 E F0 .64(option forces a)3.14 F F1 -.666(PA)3.14 G(TH)-.189 +E F0 .112(search for each)144 286.8 R F3(name)2.612 E F0 2.612(,e)C -.15 +(ve)-2.862 G 2.613(ni).15 G(f)-2.613 E F4 .113(type -t name)2.613 F F0 +-.1(wo)2.613 G .113(uld not return).1 F F3(\214le)2.613 E F0 5.113(.I) +.18 G 2.613(fac)-5.113 G .113(ommand is hashed,)-2.613 F F22.613 E +F0(and)144 298.8 Q F23.231 E F0 .731(print the hashed v)3.231 F +.73(alue, which is not necessarily the \214le that appears \214rst in) +-.25 F F1 -.666(PA)3.23 G(TH)-.189 E/F5 9/Times-Roman@0 SF(.)A F0 .73 +(If the)5.23 F F2144 310.8 Q F0 1.748(option is used,)4.248 F F2 +(type)4.248 E F0 1.748(prints all of the places that contain an e)4.248 +F -.15(xe)-.15 G 1.748(cutable named).15 F F3(name)4.249 E F0 6.749(.T) +.18 G(his)-6.749 E .744 +(includes aliases and functions, if and only if the)144 322.8 R F2 +3.244 E F0 .744(option is not also used.)3.244 F .743 +(The table of hashed)5.744 F 1.223(commands is not consulted when using) +144 334.8 R F23.723 E F0 6.223(.T)C(he)-6.223 E F23.723 E F0 +1.223(option suppresses shell function lookup, as)3.723 F .326(with the) +144 346.8 R F2(command)2.826 E F0 -.2(bu)2.826 G(iltin.).2 E F2(type) +5.326 E F0 .326(returns true if all of the ar)2.826 F .325 +(guments are found, f)-.18 F .325(alse if an)-.1 F 2.825(ya)-.15 G .325 +(re not)-2.825 F(found.)144 358.8 Q F2(ulimit)108 375.6 Q F0([)2.5 E F2 +(\255HST)A(abcde\214lmnpqrstuvx)-.92 E F0([)2.5 E F3(limit)A F0(]])A +(Pro)144 387.6 Q .243(vides control o)-.15 F -.15(ve)-.15 G 2.743(rt).15 +G .243(he resources a)-2.743 F -.25(va)-.2 G .244 +(ilable to the shell and to processes started by it, on systems).25 F +.944(that allo)144 399.6 R 3.444(ws)-.25 G .944(uch control.)-3.444 F +(The)5.944 E F23.444 E F0(and)3.444 E F23.444 E F0 .943 +(options specify that the hard or soft limit is set for the)3.444 F(gi) +144 411.6 Q -.15(ve)-.25 G 2.708(nr).15 G 2.708(esource. A)-2.708 F .208 +(hard limit cannot be increased by a non-root user once it is set; a so\ +ft limit may)2.708 F .426(be increased up to the v)144 423.6 R .426 +(alue of the hard limit.)-.25 F .425(If neither)5.426 F F22.925 E +F0(nor)2.925 E F22.925 E F0 .425 +(is speci\214ed, both the soft and)2.925 F .139(hard limits are set.)144 +435.6 R .139(The v)5.139 F .139(alue of)-.25 F F3(limit)2.729 E F0 .139 +(can be a number in the unit speci\214ed for the resource or one)3.319 F +.742(of the special v)144 447.6 R(alues)-.25 E F2(hard)3.242 E F0(,)A F2 +(soft)3.241 E F0 3.241(,o)C(r)-3.241 E F2(unlimited)3.241 E F0 3.241(,w) +C .741(hich stand for the current hard limit, the current)-3.241 F .78 +(soft limit, and no limit, respecti)144 459.6 R -.15(ve)-.25 G(ly).15 E +5.78(.I)-.65 G(f)-5.78 E F3(limit)3.37 E F0 .78 +(is omitted, the current v)3.96 F .78(alue of the soft limit of the)-.25 +F .499(resource is printed, unless the)144 471.6 R F22.999 E F0 +.499(option is gi)2.999 F -.15(ve)-.25 G 2.999(n. When).15 F .498 +(more than one resource is speci\214ed, the)2.999 F +(limit name and unit are printed before the v)144 483.6 Q 2.5 +(alue. Other)-.25 F(options are interpreted as follo)2.5 E(ws:)-.25 E F2 +144 495.6 Q F0(All current limits are reported)25.3 E F2144 +507.6 Q F0(The maximum sock)24.74 E(et b)-.1 E(uf)-.2 E(fer size)-.25 E +F2144 519.6 Q F0(The maximum size of core \214les created)25.86 E +F2144 531.6 Q F0(The maximum size of a process')24.74 E 2.5(sd) +-.55 G(ata se)-2.5 E(gment)-.15 E F2144 543.6 Q F0 +(The maximum scheduling priority \("nice"\))25.86 E F2144 555.6 Q +F0(The maximum size of \214les written by the shell and its children) +26.97 E F2144 567.6 Q F0(The maximum number of pending signals) +27.52 E F2144 579.6 Q F0(The maximum size that may be lock)27.52 E +(ed into memory)-.1 E F2144 591.6 Q F0 +(The maximum resident set size \(man)21.97 E 2.5(ys)-.15 G +(ystems do not honor this limit\))-2.5 E F2144 603.6 Q F0 .791(Th\ +e maximum number of open \214le descriptors \(most systems do not allo) +24.74 F 3.291(wt)-.25 G .791(his v)-3.291 F .791(alue to)-.25 F +(be set\))180 615.6 Q F2144 627.6 Q F0 +(The pipe size in 512-byte blocks \(this may not be set\))24.74 E F2 +144 639.6 Q F0 +(The maximum number of bytes in POSIX message queues)24.74 E F2144 +651.6 Q F0(The maximum real-time scheduling priority)25.86 E F2144 +663.6 Q F0(The maximum stack size)26.41 E F2144 675.6 Q F0 +(The maximum amount of cpu time in seconds)26.97 E F2144 687.6 Q +F0(The maximum number of processes a)24.74 E -.25(va)-.2 G +(ilable to a single user).25 E F2144 699.6 Q F0 .47 +(The maximum amount of virtual memory a)25.3 F -.25(va)-.2 G .47 +(ilable to the shell and, on some systems, to).25 F(its children)180 +711.6 Q(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(72)190.95 E 0 Cg +EP +%%Page: 73 73 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E/F1 10/Times-Bold@0 SF144 84 Q F0 +(The maximum number of \214le locks)25.3 E F1144 96 Q F0 +(The maximum number of threads)23.63 E(If)144 112.8 Q/F2 10 +/Times-Italic@0 SF(limit)3.058 E F0 .468(is gi)3.648 F -.15(ve)-.25 G +.468(n, and the).15 F F12.968 E F0 .468(option is not used,)2.968 +F F2(limit)2.968 E F0 .468(is the ne)2.968 F 2.968(wv)-.25 G .468 +(alue of the speci\214ed resource.)-3.218 F(If)5.468 E .045 +(no option is gi)144 124.8 R -.15(ve)-.25 G .045(n, then).15 F F1 +2.545 E F0 .045(is assumed.)2.545 F -1.11(Va)5.045 G .045 +(lues are in 1024-byte increments, e)1.11 F .044(xcept for)-.15 F F1 +2.544 E F0 2.544(,w)C .044(hich is)-2.544 F .402(in seconds;)144 +136.8 R F12.902 E F0 2.902(,w)C .402 +(hich is in units of 512-byte blocks; and)-2.902 F F12.902 E F0(,) +A F12.902 E F0(,)A F12.902 E F0 2.902(,a)C(nd)-2.902 E F1 +2.903 E F0 2.903(,w)C .403(hich are unscaled)-2.903 F -.25(va)144 +148.8 S 3.083(lues. The).25 F .583(return status is 0 unless an in)3.083 +F -.25(va)-.4 G .583(lid option or ar).25 F .583 +(gument is supplied, or an error occurs)-.18 F(while setting a ne)144 +160.8 Q 2.5(wl)-.25 G(imit.)-2.5 E F1(umask)108 177.6 Q F0([)2.5 E F1 +A F0 2.5(][)C F1-2.5 E F0 2.5(][)C F2(mode)-2.5 E F0(])A .2 +(The user \214le-creation mask is set to)144 189.6 R F2(mode)2.7 E F0 +5.2(.I).18 G(f)-5.2 E F2(mode)3.08 E F0(be)2.88 E .2 +(gins with a digit, it is interpreted as an octal)-.15 F .066(number; o\ +therwise it is interpreted as a symbolic mode mask similar to that acce\ +pted by)144 201.6 R F2 -.15(ch)2.566 G(mod).15 E F0(\(1\).).77 E(If)144 +213.6 Q F2(mode)3.262 E F0 .382(is omitted, the current v)3.062 F .382 +(alue of the mask is printed.)-.25 F(The)5.382 E F12.882 E F0 .382 +(option causes the mask to be)2.882 F .547 +(printed in symbolic form; the def)144 225.6 R .547 +(ault output is an octal number)-.1 F 5.547(.I)-.55 G 3.047(ft)-5.547 G +(he)-3.047 E F13.047 E F0 .547(option is supplied, and)3.047 F F2 +(mode)144.38 237.6 Q F0 .551 +(is omitted, the output is in a form that may be reused as input.)3.231 +F .552(The return status is 0 if the)5.552 F(mode w)144 249.6 Q +(as successfully changed or if no)-.1 E F2(mode)2.5 E F0(ar)2.5 E +(gument w)-.18 E(as supplied, and f)-.1 E(alse otherwise.)-.1 E F1 +(unalias)108 266.4 Q F0<5bad>2.5 E F1(a)A F0 2.5(][)C F2(name)-2.5 E F0 +(...])2.5 E(Remo)144 278.4 Q 1.955 -.15(ve e)-.15 H(ach).15 E F2(name) +4.155 E F0 1.655(from the list of de\214ned aliases.)4.155 F(If)6.655 E +F14.155 E F0 1.655(is supplied, all alias de\214nitions are)4.155 +F(remo)144 290.4 Q -.15(ve)-.15 G 2.5(d. The).15 F(return v)2.5 E +(alue is true unless a supplied)-.25 E F2(name)2.86 E F0 +(is not a de\214ned alias.)2.68 E F1(unset)108 307.2 Q F0<5bad>2.5 E F1 +(fv)A F0 2.5(][)C-2.5 E F1(n)A F0 2.5(][)C F2(name)-2.5 E F0(...]) +2.5 E -.15(Fo)144 319.2 S 3.827(re).15 G(ach)-3.827 E F2(name)3.827 E F0 +3.827(,r).18 G(emo)-3.827 E 1.627 -.15(ve t)-.15 H 1.327 +(he corresponding v).15 F 1.327(ariable or function.)-.25 F 1.327 +(If the)6.327 F F13.828 E F0 1.328(option is gi)3.828 F -.15(ve) +-.25 G 1.328(n, each).15 F F2(name)144.36 331.2 Q F0 1.551 +(refers to a shell v)4.231 F 1.551(ariable, and that v)-.25 F 1.551 +(ariable is remo)-.25 F -.15(ve)-.15 G 4.05(d. Read-only).15 F -.25(va) +4.05 G 1.55(riables may not be).25 F 4.641(unset. If)144 343.2 R F1 +4.641 E F0 2.141(is speci\214ed, each)4.641 F F2(name)5.001 E F0 +2.141(refers to a shell function, and the function de\214nition is)4.821 +F(remo)144 355.2 Q -.15(ve)-.15 G 2.538(d. If).15 F(the)2.537 E F1 +2.537 E F0 .037(option is supplied, and)2.537 F F2(name)2.537 E F0 .037 +(is a v)2.537 F .037(ariable with the)-.25 F F2(namer)2.537 E(ef)-.37 E +F0(attrib)2.537 E(ute,)-.2 E F2(name)2.537 E F0(will)2.537 E .492 +(be unset rather than the v)144 367.2 R .492(ariable it references.)-.25 +F F15.492 E F0 .492(has no ef)2.992 F .492(fect if the)-.25 F F1 +2.992 E F0 .492(option is supplied.)2.992 F .493(If no)5.493 F +.221(options are supplied, each)144 379.2 R F2(name)2.721 E F0 .221 +(refers to a v)2.721 F .22(ariable; if there is no v)-.25 F .22 +(ariable by that name, an)-.25 F 2.72(yf)-.15 G(unc-)-2.72 E 1.188 +(tion with that name is unset.)144 391.2 R 1.189(Each unset v)6.189 F +1.189(ariable or function is remo)-.25 F -.15(ve)-.15 G 3.689(df).15 G +1.189(rom the en)-3.689 F(vironment)-.4 E 3.206 +(passed to subsequent commands.)144 403.2 R 3.206(If an)8.206 F 5.706 +(yo)-.15 G(f)-5.706 E/F3 9/Times-Bold@0 SF(COMP_W)5.706 E(ORDBREAKS)-.09 +E/F4 9/Times-Roman@0 SF(,)A F3(RANDOM)5.455 E F4(,)A F3(SECONDS)5.455 E +F4(,)A F3(LINENO)144 415.2 Q F4(,)A F3(HISTCMD)4.347 E F4(,)A F3(FUNCN) +4.347 E(AME)-.18 E F4(,)A F3(GR)4.347 E(OUPS)-.27 E F4(,)A F0(or)4.348 E +F3(DIRST)4.598 E -.495(AC)-.81 G(K).495 E F0 2.098(are unset, the)4.348 +F 4.598(yl)-.15 G 2.098(ose their special)-4.598 F(properties, e)144 +427.2 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(ft)-2.5 G(he)-2.5 E 2.5(ya)-.15 +G(re subsequently reset.)-2.5 E(The e)5 E(xit status is true unless a) +-.15 E F2(name)2.86 E F0(is readonly)2.68 E(.)-.65 E F1(wait)108 444 Q +F0([)2.5 E F1A F0 2.5(][)C F2 2.5(n.)-2.5 G(..)-2.5 E F0(])A -.8 +(Wa)144 456 S .027(it for each speci\214ed child process and return its\ + termination status.).8 F(Each)5.026 E F2(n)2.886 E F0 .026 +(may be a process ID)2.766 F .256 +(or a job speci\214cation; if a job spec is gi)144 468 R -.15(ve)-.25 G +.256(n, all processes in that job').15 F 2.756(sp)-.55 G .256 +(ipeline are w)-2.756 F .256(aited for)-.1 F 5.256(.I)-.55 G(f)-5.256 E +F2(n)3.116 E F0 .318(is not gi)144 480 R -.15(ve)-.25 G .318 +(n, all currently acti).15 F .618 -.15(ve c)-.25 H .318 +(hild processes are w).15 F .318(aited for)-.1 F 2.818(,a)-.4 G .318 +(nd the return status is zero.)-2.818 F .317(If the)5.317 F F1144 +492 Q F0 .361(option is supplied,)2.861 F F1(wait)2.861 E F0 -.1(wa) +2.861 G .361(its for an).1 F 2.862(yj)-.15 G .362 +(ob to terminate and returns its e)-2.862 F .362(xit status.)-.15 F(If) +5.362 E F2(n)3.222 E F0(speci\214es)3.102 E 2.596(an)144 504 S(on-e) +-2.596 E .096(xistent process or job, the return status is 127.)-.15 F +.095(Otherwise, the return status is the e)5.095 F .095(xit status)-.15 +F(of the last process or job w)144 516 Q(aited for)-.1 E(.)-.55 E/F5 +10.95/Times-Bold@0 SF(RESTRICTED SHELL)72 532.8 Q F0(If)108 544.8 Q F1 +(bash)4.396 E F0 1.896(is started with the name)4.396 F F1(rbash)4.397 E +F0 4.397(,o)C 4.397(rt)-4.397 G(he)-4.397 E F14.397 E F0 1.897 +(option is supplied at in)4.397 F -.2(vo)-.4 G 1.897 +(cation, the shell becomes).2 F 3.446(restricted. A)108 556.8 R .945 +(restricted shell is used to set up an en)3.446 F .945 +(vironment more controlled than the standard shell.)-.4 F(It)5.945 E +(beha)108 568.8 Q -.15(ve)-.2 G 2.5(si).15 G(dentically to)-2.5 E F1 +(bash)2.5 E F0(with the e)2.5 E(xception that the follo)-.15 E +(wing are disallo)-.25 E(wed or not performed:)-.25 E 32.5<8363>108 +585.6 S(hanging directories with)-32.5 E F1(cd)2.5 E F0 32.5<8373>108 +602.4 S(etting or unsetting the v)-32.5 E(alues of)-.25 E F3(SHELL)2.5 E +F4(,)A F3 -.666(PA)2.25 G(TH)-.189 E F4(,)A F3(ENV)2.25 E F4(,)A F0(or) +2.25 E F3 -.27(BA)2.5 G(SH_ENV).27 E F0 32.5<8373>108 619.2 S +(pecifying command names containing)-32.5 E F1(/)2.5 E F0 32.5<8373>108 +636 S(pecifying a \214lename containing a)-32.5 E F1(/)2.5 E F0 +(as an ar)2.5 E(gument to the)-.18 E F1(.)2.5 E F0 -.2(bu)5 G +(iltin command).2 E 32.5<8373>108 652.8 S .449 +(pecifying a \214lename containing a slash as an ar)-32.5 F .449 +(gument to the)-.18 F F12.95 E F0 .45(option to the)2.95 F F1 +(hash)2.95 E F0 -.2(bu)2.95 G .45(iltin com-).2 F(mand)144 664.8 Q 32.5 +<8369>108 681.6 S(mporting function de\214nitions from the shell en) +-32.5 E(vironment at startup)-.4 E 32.5<8370>108 698.4 S(arsing the v) +-32.5 E(alue of)-.25 E F3(SHELLOPTS)2.5 E F0(from the shell en)2.25 E +(vironment at startup)-.4 E 32.5<8372>108 715.2 S(edirecting output usi\ +ng the >, >|, <>, >&, &>, and >> redirection operators)-32.5 E +(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(73)190.95 E 0 Cg EP +%%Page: 74 74 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E 32.5<8375>108 84 S(sing the)-32.5 E/F1 10/Times-Bold@0 SF(exec) +2.5 E F0 -.2(bu)2.5 G +(iltin command to replace the shell with another command).2 E 32.5<8361> +108 100.8 S(dding or deleting b)-32.5 E(uiltin commands with the)-.2 E +F12.5 E F0(and)2.5 E F12.5 E F0(options to the)2.5 E F1 +(enable)2.5 E F0 -.2(bu)2.5 G(iltin command).2 E 32.5<8375>108 117.6 S +(sing the)-32.5 E F1(enable)2.5 E F0 -.2(bu)2.5 G +(iltin command to enable disabled shell b).2 E(uiltins)-.2 E 32.5<8373> +108 134.4 S(pecifying the)-32.5 E F12.5 E F0(option to the)2.5 E +F1(command)2.5 E F0 -.2(bu)2.5 G(iltin command).2 E 32.5<8374>108 151.2 +S(urning of)-32.5 E 2.5(fr)-.25 G(estricted mode with)-2.5 E F1(set +r) +2.5 E F0(or)2.5 E F1(set +o r)2.5 E(estricted)-.18 E F0(.)A +(These restrictions are enforced after an)108 168 Q 2.5(ys)-.15 G +(tartup \214les are read.)-2.5 E 1.566 +(When a command that is found to be a shell script is e)108 184.8 R -.15 +(xe)-.15 G 1.566(cuted \(see).15 F/F2 9/Times-Bold@0 SF 1.566 +(COMMAND EXECUTION)4.066 F F0(abo)3.816 E -.15(ve)-.15 G(\),).15 E F1 +(rbash)108 196.8 Q F0(turns of)2.5 E 2.5(fa)-.25 G .3 -.15(ny r)-2.5 H +(estrictions in the shell spa).15 E(wned to e)-.15 E -.15(xe)-.15 G +(cute the script.).15 E/F3 10.95/Times-Bold@0 SF(SEE ALSO)72 213.6 Q/F4 +10/Times-Italic@0 SF(Bash Refer)108 225.6 Q(ence Manual)-.37 E F0 2.5 +(,B)C(rian F)-2.5 E(ox and Chet Rame)-.15 E(y)-.15 E F4 +(The Gnu Readline Libr)108 237.6 Q(ary)-.15 E F0 2.5(,B)C(rian F)-2.5 E +(ox and Chet Rame)-.15 E(y)-.15 E F4(The Gnu History Libr)108 249.6 Q +(ary)-.15 E F0 2.5(,B)C(rian F)-2.5 E(ox and Chet Rame)-.15 E(y)-.15 E +F4 -.8(Po)108 261.6 S(rtable Oper).8 E +(ating System Interface \(POSIX\) P)-.15 E(art 2: Shell and Utilities) +-.8 E F0 2.5(,I)C(EEE --)-2.5 E(http://pubs.opengroup.or)144 273.6 Q +(g/onlinepubs/9699919799/)-.18 E(http://tiswww)108 285.6 Q +(.case.edu/~chet/bash/POSIX -- a description of posix mode)-.65 E F4(sh) +108 297.6 Q F0(\(1\),)A F4(ksh)2.5 E F0(\(1\),)A F4(csh)2.5 E F0(\(1\))A +F4(emacs)108 309.6 Q F0(\(1\),)A F4(vi)2.5 E F0(\(1\))A F4 -.37(re)108 +321.6 S(adline).37 E F0(\(3\))A F3(FILES)72 338.4 Q F4(/bin/bash)109.666 +350.4 Q F0(The)144 362.4 Q F1(bash)2.5 E F0 -.15(exe)2.5 G(cutable).15 E +F4(/etc/pr)109.666 374.4 Q(o\214le)-.45 E F0 +(The systemwide initialization \214le, e)144 386.4 Q -.15(xe)-.15 G +(cuted for login shells).15 E F4(~/.bash_pr)109.666 398.4 Q(o\214le)-.45 +E F0(The personal initialization \214le, e)144 410.4 Q -.15(xe)-.15 G +(cuted for login shells).15 E F4(~/.bashr)109.666 422.4 Q(c)-.37 E F0 +(The indi)144 434.4 Q(vidual per)-.25 E(-interacti)-.2 E -.15(ve)-.25 G +(-shell startup \214le).15 E F4(~/.bash_lo)109.666 446.4 Q(gout)-.1 E F0 +(The indi)144 458.4 Q(vidual login shell cleanup \214le, e)-.25 E -.15 +(xe)-.15 G(cuted when a login shell e).15 E(xits)-.15 E F4(~/.inputr) +109.666 470.4 Q(c)-.37 E F0(Indi)144 482.4 Q(vidual)-.25 E F4 -.37(re) +2.5 G(adline).37 E F0(initialization \214le)2.5 E F3 -.548(AU)72 499.2 S +(THORS).548 E F0(Brian F)108 511.2 Q(ox, Free Softw)-.15 E(are F)-.1 E +(oundation)-.15 E(bfox@gnu.or)108 523.2 Q(g)-.18 E(Chet Rame)108 540 Q +1.3 -.65(y, C)-.15 H(ase W).65 E(estern Reserv)-.8 E 2.5(eU)-.15 G(ni) +-2.5 E -.15(ve)-.25 G(rsity).15 E(chet.rame)108 552 Q(y@case.edu)-.15 E +F3 -.11(BU)72 568.8 S 2.738(GR).11 G(EPOR)-2.738 E(TS)-.438 E F0 .567 +(If you \214nd a b)108 580.8 R .568(ug in)-.2 F F1(bash,)3.068 E F0 .568 +(you should report it.)3.068 F .568(But \214rst, you should mak)5.568 F +3.068(es)-.1 G .568(ure that it really is a b)-3.068 F .568(ug, and)-.2 +F 5.626(that it appears in the latest v)108 592.8 R 5.625(ersion of)-.15 +F F1(bash)8.125 E F0 10.625(.T)C 5.625(he latest v)-10.625 F 5.625 +(ersion is al)-.15 F -.1(wa)-.1 G 5.625(ys a).1 F -.25(va)-.2 G 5.625 +(ilable from).25 F F4(ftp://ftp.gnu.or)108 604.8 Q(g/pub/gnu/bash/)-.37 +E F0(.)A .41(Once you ha)108 621.6 R .71 -.15(ve d)-.2 H .41 +(etermined that a b).15 F .41(ug actually e)-.2 F .411(xists, use the) +-.15 F F4(bashb)3.181 E(ug)-.2 E F0 .411(command to submit a b)3.131 F +.411(ug report.)-.2 F(If)5.411 E .595(you ha)108 633.6 R .895 -.15 +(ve a \214)-.2 H .595(x, you are encouraged to mail that as well!).15 F +.594(Suggestions and `philosophical' b)5.595 F .594(ug reports may)-.2 F +(be mailed to)108 645.6 Q F4 -.2(bu)2.5 G(g-bash@gnu.or).2 E(g)-.37 E F0 +(or posted to the Usenet ne)2.5 E(wsgroup)-.25 E F1(gnu.bash.b)2.5 E(ug) +-.2 E F0(.)A(ALL b)108 662.4 Q(ug reports should include:)-.2 E(The v) +108 679.2 Q(ersion number of)-.15 E F1(bash)2.5 E F0(The hardw)108 691.2 +Q(are and operating system)-.1 E(The compiler used to compile)108 703.2 +Q(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 E(74)190.95 E 0 Cg EP +%%Page: 75 75 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\)) +-.35 E 2.5(Ad)108 84 S(escription of the b)-2.5 E(ug beha)-.2 E(viour) +-.2 E 2.5(As)108 96 S(hort script or `recipe' which e)-2.5 E -.15(xe) +-.15 G(rcises the b).15 E(ug)-.2 E/F1 10/Times-Italic@0 SF(bashb)108.27 +112.8 Q(ug)-.2 E F0 +(inserts the \214rst three items automatically into the template it pro) +2.72 E(vides for \214ling a b)-.15 E(ug report.)-.2 E(Comments and b)108 +129.6 Q(ug reports concerning this manual page should be directed to)-.2 +E F1 -.15(ch)2.5 G(et.r).15 E(ame)-.15 E(y@case)-.3 E(.edu)-.15 E F0(.) +.25 E/F2 10.95/Times-Bold@0 SF -.11(BU)72 146.4 S(GS).11 E F0(It')108 +158.4 Q 2.5(st)-.55 G(oo big and too slo)-2.5 E -.65(w.)-.25 G 1.868 +(There are some subtle dif)108 175.2 R 1.868(ferences between)-.25 F/F3 +10/Times-Bold@0 SF(bash)4.369 E F0 1.869(and traditional v)4.369 F 1.869 +(ersions of)-.15 F F3(sh)4.369 E F0 4.369(,m)C 1.869 +(ostly because of the)-4.369 F/F4 9/Times-Bold@0 SF(POSIX)108 187.2 Q F0 +(speci\214cation.)2.25 E(Aliases are confusing in some uses.)108 204 Q +(Shell b)108 220.8 Q +(uiltin commands and functions are not stoppable/restartable.)-.2 E +1.315(Compound commands and command sequences of the form `a ; b ; c' a\ +re not handled gracefully when)108 237.6 R .389 +(process suspension is attempted.)108 249.6 R .389 +(When a process is stopped, the shell immediately e)5.389 F -.15(xe)-.15 +G .39(cutes the ne).15 F .39(xt com-)-.15 F .193(mand in the sequence.) +108 261.6 R .192(It suf)5.193 F .192(\214ces to place the sequence of c\ +ommands between parentheses to force it into a)-.25 F +(subshell, which may be stopped as a unit.)108 273.6 Q(Array v)108 290.4 +Q(ariables may not \(yet\) be e)-.25 E(xported.)-.15 E +(There may be only one acti)108 307.2 Q .3 -.15(ve c)-.25 H +(oprocess at a time.).15 E(GNU Bash 4.3)72 768 Q(2014 February 2)141.79 +E(75)190.95 E 0 Cg EP +%%Trailer +end +%%EOF diff --git a/doc/bashbug.0 b/doc/bashbug.0 new file mode 100644 index 0000000..41fc1ed --- /dev/null +++ b/doc/bashbug.0 @@ -0,0 +1,50 @@ +BASHBUG(1) BASHBUG(1) + + + +NNAAMMEE + bashbug - report a bug in bash + +SSYYNNOOPPSSIISS + bbaasshhbbuugg [_-_-_v_e_r_s_i_o_n] [_-_-_h_e_l_p] [_e_m_a_i_l_-_a_d_d_r_e_s_s] + +DDEESSCCRRIIPPTTIIOONN + bbaasshhbbuugg is a shell script to help the user compose and mail bug reports + concerning bash in a standard format. bbaasshhbbuugg invokes the editor spec- + ified by the environment variable EEDDIITTOORR on a temporary copy of the bug + report format outline. The user must fill in the appropriate fields and + exit the editor. bbaasshhbbuugg then mails the completed report to _b_u_g_- + _b_a_s_h_@_g_n_u_._o_r_g, or _e_m_a_i_l_-_a_d_d_r_e_s_s. If the report cannot be mailed, it is + saved in the file _d_e_a_d_._b_a_s_h_b_u_g in the invoking user's home directory. + + The bug report format outline consists of several sections. The first + section provides information about the machine, operating system, the + bash version, and the compilation environment. The second section + should be filled in with a description of the bug. The third section + should be a description of how to reproduce the bug. The optional + fourth section is for a proposed fix. Fixes are encouraged. + +EENNVVIIRROONNMMEENNTT + bbaasshhbbuugg will utilize the following environment variables if they exist: + + EEDDIITTOORR Specifies the preferred editor. If EEDDIITTOORR is not set, bbaasshhbbuugg + defaults to eemmaaccss. + + HHOOMMEE Directory in which the failed bug report is saved if the mail + fails. + + TTMMPPDDIIRR Directory in which to create temporary files and directories. + +SSEEEE AALLSSOO + _b_a_s_h(1) + +AAUUTTHHOORRSS + Brian Fox, Free Software Foundation + bfox@gnu.org + + Chet Ramey, Case Western Reserve University + chet@po.cwru.edu + + + +GNU Bash-4.0 1998 July 30 BASHBUG(1) diff --git a/doc/bashbug.1 b/doc/bashbug.1 new file mode 100644 index 0000000..962cb9c --- /dev/null +++ b/doc/bashbug.1 @@ -0,0 +1,64 @@ +.\" +.\" MAN PAGE COMMENTS to +.\" +.\" Chet Ramey +.\" Case Western Reserve University +.\" chet@po.cwru.edu +.\" +.\" Last Change: Tue Apr 3 15:46:30 EDT 2007 +.\" +.TH BASHBUG 1 "1998 July 30" "GNU Bash-4.0" +.SH NAME +bashbug \- report a bug in bash +.SH SYNOPSIS +\fBbashbug\fP [\fI--version\fP] [\fI--help\fP] [\fIemail-address\fP] +.SH DESCRIPTION +.B bashbug +is a shell script to help the user compose and mail bug reports +concerning bash in a standard format. +.B bashbug +invokes the editor specified by the environment variable +.SM +.B EDITOR +on a temporary copy of the bug report format outline. The user must +fill in the appropriate fields and exit the editor. +.B bashbug +then mails the completed report to \fIbug-bash@gnu.org\fP, or +\fIemail-address\fP. If the report cannot be mailed, it is saved in the +file \fIdead.bashbug\fP in the invoking user's home directory. +.PP +The bug report format outline consists of several sections. The first +section provides information about the machine, operating system, the +bash version, and the compilation environment. The second section +should be filled in with a description of the bug. The third section +should be a description of how to reproduce the bug. The optional +fourth section is for a proposed fix. Fixes are encouraged. +.SH ENVIRONMENT +.B bashbug +will utilize the following environment variables if they exist: +.TP +.B EDITOR +Specifies the preferred editor. If +.SM +.B EDITOR +is not set, +.B bashbug +defaults to +.BR emacs . +.TP +.B HOME +Directory in which the failed bug report is saved if the mail fails. +.TP +.B TMPDIR +Directory in which to create temporary files and directories. +.SH "SEE ALSO" +.TP +\fIbash\fP(1) +.SH AUTHORS +Brian Fox, Free Software Foundation +.br +bfox@gnu.org +.PP +Chet Ramey, Case Western Reserve University +.br +chet@po.cwru.edu diff --git a/doc/bashbug.ps b/doc/bashbug.ps new file mode 100644 index 0000000..efbcdda --- /dev/null +++ b/doc/bashbug.ps @@ -0,0 +1,284 @@ +%!PS-Adobe-3.0 +%%Creator: groff version 1.19.2 +%%CreationDate: Mon Nov 17 17:38:06 2008 +%%DocumentNeededResources: font Times-Roman +%%+ font Times-Bold +%%+ font Times-Italic +%%DocumentSuppliedResources: procset grops 1.19 2 +%%Pages: 1 +%%PageOrder: Ascend +%%DocumentMedia: Default 595 842 0 () () +%%Orientation: Portrait +%%EndComments +%%BeginDefaults +%%PageMedia: Default +%%EndDefaults +%%BeginProlog +%%BeginResource: procset grops 1.19 2 +%!PS-Adobe-3.0 Resource-ProcSet +/setpacking where{ +pop +currentpacking +true setpacking +}if +/grops 120 dict dup begin +/SC 32 def +/A/show load def +/B{0 SC 3 -1 roll widthshow}bind def +/C{0 exch ashow}bind def +/D{0 exch 0 SC 5 2 roll awidthshow}bind def +/E{0 rmoveto show}bind def +/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def +/G{0 rmoveto 0 exch ashow}bind def +/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/I{0 exch rmoveto show}bind def +/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def +/K{0 exch rmoveto 0 exch ashow}bind def +/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/M{rmoveto show}bind def +/N{rmoveto 0 SC 3 -1 roll widthshow}bind def +/O{rmoveto 0 exch ashow}bind def +/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/Q{moveto show}bind def +/R{moveto 0 SC 3 -1 roll widthshow}bind def +/S{moveto 0 exch ashow}bind def +/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/SF{ +findfont exch +[exch dup 0 exch 0 exch neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/MF{ +findfont +[5 2 roll +0 3 1 roll +neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/level0 0 def +/RES 0 def +/PL 0 def +/LS 0 def +/MANUAL{ +statusdict begin/manualfeed true store end +}bind def +/PLG{ +gsave newpath clippath pathbbox grestore +exch pop add exch pop +}bind def +/BP{ +/level0 save def +1 setlinecap +1 setlinejoin +72 RES div dup scale +LS{ +90 rotate +}{ +0 PL translate +}ifelse +1 -1 scale +}bind def +/EP{ +level0 restore +showpage +}def +/DA{ +newpath arcn stroke +}bind def +/SN{ +transform +.25 sub exch .25 sub exch +round .25 add exch round .25 add exch +itransform +}bind def +/DL{ +SN +moveto +SN +lineto stroke +}bind def +/DC{ +newpath 0 360 arc closepath +}bind def +/TM matrix def +/DE{ +TM currentmatrix pop +translate scale newpath 0 0 .5 0 360 arc closepath +TM setmatrix +}bind def +/RC/rcurveto load def +/RL/rlineto load def +/ST/stroke load def +/MT/moveto load def +/CL/closepath load def +/Fr{ +setrgbcolor fill +}bind def +/setcmykcolor where{ +pop +/Fk{ +setcmykcolor fill +}bind def +}if +/Fg{ +setgray fill +}bind def +/FL/fill load def +/LW/setlinewidth load def +/Cr/setrgbcolor load def +/setcmykcolor where{ +pop +/Ck/setcmykcolor load def +}if +/Cg/setgray load def +/RE{ +findfont +dup maxlength 1 index/FontName known not{1 add}if dict begin +{ +1 index/FID ne{def}{pop pop}ifelse +}forall +/Encoding exch def +dup/FontName exch def +currentdict end definefont pop +}bind def +/DEFS 0 def +/EBEGIN{ +moveto +DEFS begin +}bind def +/EEND/end load def +/CNT 0 def +/level1 0 def +/PBEGIN{ +/level1 save def +translate +div 3 1 roll div exch scale +neg exch neg exch translate +0 setgray +0 setlinecap +1 setlinewidth +0 setlinejoin +10 setmiterlimit +[]0 setdash +/setstrokeadjust where{ +pop +false setstrokeadjust +}if +/setoverprint where{ +pop +false setoverprint +}if +newpath +/CNT countdictstack def +userdict begin +/showpage{}def +/setpagedevice{}def +}bind def +/PEND{ +countdictstack CNT sub{end}repeat +level1 restore +}bind def +end def +/setpacking where{ +pop +setpacking +}if +%%EndResource +%%EndProlog +%%BeginSetup +%%BeginFeature: *PageSize Default +<< /PageSize [ 595 842 ] /ImagingBBox null >> setpagedevice +%%EndFeature +%%IncludeResource: font Times-Roman +%%IncludeResource: font Times-Bold +%%IncludeResource: font Times-Italic +grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 +def/PL 841.89 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron +/Zcaron/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent +/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen +/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon +/semicolon/less/equal/greater/question/at/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/bracketleft/backslash/bracketright/circumflex +/underscore/quoteleft/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/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft +/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl +/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut +/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash +/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen +/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft +/logicalnot/minus/registered/macron/degree/plusminus/twosuperior +/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior +/ordmasculine/guilsinglright/onequarter/onehalf/threequarters +/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE +/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex +/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis +/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn +/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla +/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis +/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash +/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def +/Times-Italic@0 ENC0/Times-Italic RE/Times-Bold@0 ENC0/Times-Bold RE +/Times-Roman@0 ENC0/Times-Roman RE +%%EndSetup +%%Page: 1 1 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SHB).35 E 347.52(UG\(1\) B)-.1 F +(ASHB)-.35 E(UG\(1\))-.1 E/F1 10.95/Times-Bold@0 SF -.219(NA)72 84 S(ME) +.219 E F0(bashb)108 96 Q(ug \255 report a b)-.2 E(ug in bash)-.2 E F1 +(SYNOPSIS)72 112.8 Q/F2 10/Times-Bold@0 SF(bashb)108 124.8 Q(ug)-.2 E F0 +([)2.5 E/F3 10/Times-Italic@0 SF(--ver)A(sion)-.1 E F0 2.5(][)C F3 +(--help)-2.5 E F0 2.5(][)C F3(email-addr)-2.5 E(ess)-.37 E F0(])A F1 +(DESCRIPTION)72 141.6 Q F2(bashb)108 153.6 Q(ug)-.2 E F0 .446 +(is a shell script to help the user compose and mail b)2.947 F .446 +(ug reports concerning bash in a standard for)-.2 F(-)-.2 E(mat.)108 +165.6 Q F2(bashb)5.961 E(ug)-.2 E F0(in)3.461 E -.2(vo)-.4 G -.1(ke).2 G +3.461(st).1 G .962(he editor speci\214ed by the en)-3.461 F .962 +(vironment v)-.4 F(ariable)-.25 E/F4 9/Times-Bold@0 SF(EDIT)3.462 E(OR) +-.162 E F0 .962(on a temporary cop)3.212 F 3.462(yo)-.1 G(f)-3.462 E +.374(the b)108 177.6 R .374(ug report format outline. The user must \ +\214ll in the appropriate \214elds and e)-.2 F .374(xit the editor)-.15 +F(.)-.55 E F2(bashb)5.373 E(ug)-.2 E F0(then)2.873 E 1.141 +(mails the completed report to)108 189.6 R F3 -.2(bu)3.641 G +(g-bash@gnu.or).2 E(g)-.37 E F0 3.641(,o)C(r)-3.641 E F3(email-addr) +3.641 E(ess)-.37 E F0 6.141(.I)C 3.641(ft)-6.141 G 1.142 +(he report cannot be mailed, it is)-3.641 F(sa)108 201.6 Q -.15(ve)-.2 G +2.5(di).15 G 2.5(nt)-2.5 G(he \214le)-2.5 E F3(dead.bashb)2.5 E(ug)-.2 E +F0(in the in)2.5 E -.2(vo)-.4 G(king user').2 E 2.5(sh)-.55 G +(ome directory)-2.5 E(.)-.65 E .354(The b)108 218.4 R .354 +(ug report format outline consists of se)-.2 F -.15(ve)-.25 G .353 +(ral sections.).15 F .353(The \214rst section pro)5.353 F .353 +(vides information about the)-.15 F .37 +(machine, operating system, the bash v)108 230.4 R .371 +(ersion, and the compilation en)-.15 F 2.871(vironment. The)-.4 F .371 +(second section should)2.871 F .209 +(be \214lled in with a description of the b)108 242.4 R 2.709(ug. The) +-.2 F .208(third section should be a description of ho)2.709 F 2.708(wt) +-.25 G 2.708(or)-2.708 G .208(eproduce the)-2.708 F -.2(bu)108 254.4 S +2.5(g. The).2 F(optional fourth section is for a proposed \214x.)2.5 E +(Fix)5 E(es are encouraged.)-.15 E F1(ENVIR)72 271.2 Q(ONMENT)-.329 E F2 +(bashb)108 283.2 Q(ug)-.2 E F0(will utilize the follo)2.5 E(wing en)-.25 +E(vironment v)-.4 E(ariables if the)-.25 E 2.5(ye)-.15 G(xist:)-2.65 E +F2(EDIT)108 300 Q(OR)-.18 E F0(Speci\214es the preferred editor)144 312 +Q 2.5(.I)-.55 G(f)-2.5 E F4(EDIT)2.5 E(OR)-.162 E F0(is not set,)2.25 E +F2(bashb)2.5 E(ug)-.2 E F0(def)2.5 E(aults to)-.1 E F2(emacs)2.5 E F0(.) +A F2(HOME)108 328.8 Q F0(Directory in which the f)144 340.8 Q(ailed b) +-.1 E(ug report is sa)-.2 E -.15(ve)-.2 G 2.5(di).15 G 2.5(ft)-2.5 G +(he mail f)-2.5 E(ails.)-.1 E F2(TMPDIR)108 357.6 Q F0 +(Directory in which to create temporary \214les and directories.)144 +369.6 Q F1(SEE ALSO)72 386.4 Q F3(bash)108 398.4 Q F0(\(1\))A F1 -.548 +(AU)72 415.2 S(THORS).548 E F0(Brian F)108 427.2 Q(ox, Free Softw)-.15 E +(are F)-.1 E(oundation)-.15 E(bfox@gnu.or)108 439.2 Q(g)-.18 E +(Chet Rame)108 456 Q 1.3 -.65(y, C)-.15 H(ase W).65 E(estern Reserv)-.8 +E 2.5(eU)-.15 G(ni)-2.5 E -.15(ve)-.25 G(rsity).15 E(chet@po.cwru.edu) +108 468 Q(GNU Bash-4.0)72 768 Q(1998 July 30)148.175 E(1)203.165 E 0 Cg +EP +%%Trailer +end +%%EOF diff --git a/doc/bashref.dvi b/doc/bashref.dvi new file mode 100644 index 0000000000000000000000000000000000000000..f56627f8eb9e0b3e0c5b2c11d3b7dae87180a7b0 GIT binary patch literal 721984 zcmeEv34B~ty?-+Irfou7pdj)<5Gr=THZ)0B3PLw%fI?|fP}^cB$xSkJG81QM6D+78 z0zMjgxiDTjXv-qVDuO&0R1gH-^A9TG1Leswg9RQuo=ef^0_Fex{?0jf?o86xvOcBh z=L7A`+Q?mt*~}r0(;BANPiw4ioPOlA z*^RUR8BbL6v7P;S9e*}#{zFyOz?R5)O-&oNY(H?*GaELz7<-QyW=g1CfwIQ@quhKJ}|&HH;<~Sx~R&= z629@3Z*SgX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K__f9w`jmKnbqT#ta;($wj$_29~CuvwL)Z zh%oS~r7>^;<=B&RlZ%rL4L)bwZ`&Hez^iSrAvcYG2MJ1hCV9$ZXfi5nt1d7^mFG#XO76rP^;Il2*3{XIznqdPD z4461PFsusJ8F(QZQk(-c#PTnLx)ri$3CL)36r&*lXYkp~`(r{STrF#IZV^za-2Ekf z3}Bytd;=6LDY5*_Zu)bc60%@!rsZeG{4L$b;esqc?UtVzAVxyN0b=A&25u$;ruz^8 E0M*IFX8-^I literal 0 HcmV?d00001 diff --git a/doc/bashref.html b/doc/bashref.html new file mode 100644 index 0000000..6f92707 --- /dev/null +++ b/doc/bashref.html @@ -0,0 +1,17481 @@ + + + + + +Bash Reference Manual: + + + + + + + + + + + + + + + + + +
    [Top][Contents][Index][ ? ]
    +

    Bash Reference Manual

    + +This text is a brief description of the features that are present in +the Bash shell (version 4.3, 2 February 2014). +The Bash home page is http://www.gnu.org/software/bash/. +

    + +This is Edition 4.3, last updated 2 February 2014, +of The GNU Bash Reference Manual, +for Bash, Version 4.3. +

    + +Bash contains features that appear in other popular shells, and some +features that only appear in Bash. Some of the shells that Bash has +borrowed concepts from are the Bourne Shell (`sh'), the Korn Shell +(`ksh'), and the C-shell (`csh' and its successor, +`tcsh'). The following menu breaks the features up into +categories, noting which features were inspired by other shells and +which are specific to Bash. +

    + +This manual is meant as a brief introduction to features found in +Bash. The Bash manual page should be used as the definitive +reference on shell behavior. +

    + +

    + + + + + + + + + + + + + + +
    1. Introduction  An introduction to the shell.
    2. Definitions  Some definitions used in the rest of this + manual.
    3. Basic Shell Features  The shell "building blocks".
    4. Shell Builtin Commands  Commands that are a part of the shell.
    5. Shell Variables  Variables used or set by Bash.
    6. Bash Features  Features found only in Bash.
    7. Job Control  What job control is and how Bash allows you + to use it.
    8. Command Line Editing  Chapter describing the command line + editing features.
    9. Using History Interactively  Command History Expansion
    10. Installing Bash  How to build and install Bash on your system.
    A. Reporting Bugs  How to report bugs in Bash.
    B. Major Differences From The Bourne Shell  A terse list of the differences + between Bash and historical + versions of /bin/sh.
    C. GNU Free Documentation License  Copying and sharing this documentation.
    D. Indexes  Various indexes for this manual.
    +

    + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    + +

    1. Introduction

    + +
    + + +
    1.1 What is Bash?  A short description of Bash.
    1.2 What is a shell?  A brief introduction to shells.
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    1.1 What is Bash?

    + +

    + +Bash is the shell, or command language interpreter, +for the GNU operating system. +The name is an acronym for the `Bourne-Again SHell', +a pun on Stephen Bourne, the author of the direct ancestor of +the current Unix shell sh, +which appeared in the Seventh Edition Bell Labs Research version +of Unix. +

    + +Bash is largely compatible with sh and incorporates useful +features from the Korn shell ksh and the C shell csh. +It is intended to be a conformant implementation of the IEEE +POSIX Shell and Tools portion of the IEEE POSIX +specification (IEEE Standard 1003.1). +It offers functional improvements over sh for both interactive and +programming use. +

    + +While the GNU operating system provides other shells, including +a version of csh, Bash is the default shell. +Like other GNU software, Bash is quite portable. It currently runs +on nearly every version of Unix and a few other operating systems - +independently-supported ports exist for MS-DOS, OS/2, +and Windows platforms. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    1.2 What is a shell?

    + +

    + +At its base, a shell is simply a macro processor that executes +commands. The term macro processor means functionality where text +and symbols are expanded to create larger expressions. +

    + +A Unix shell is both a command interpreter and a programming +language. As a command interpreter, the shell provides the user +interface to the rich set of GNU utilities. The programming +language features allow these utilities to be combined. +Files containing commands can be created, and become +commands themselves. These new commands have the same status as +system commands in directories such as `/bin', allowing users +or groups to establish custom environments to automate their common +tasks. +

    + +Shells may be used interactively or non-interactively. In +interactive mode, they accept input typed from the keyboard. +When executing non-interactively, shells execute commands read +from a file. +

    + +A shell allows execution of GNU commands, both synchronously and +asynchronously. +The shell waits for synchronous commands to complete before accepting +more input; asynchronous commands continue to execute in parallel +with the shell while it reads and executes additional commands. +The redirection constructs permit +fine-grained control of the input and output of those commands. +Moreover, the shell allows control over the contents of commands' +environments. +

    + +Shells also provide a small set of built-in +commands (builtins) implementing functionality impossible +or inconvenient to obtain via separate utilities. +For example, cd, break, continue, and +exec cannot be implemented outside of the shell because +they directly manipulate the shell itself. +The history, getopts, kill, or pwd +builtins, among others, could be implemented in separate utilities, +but they are more convenient to use as builtin commands. +All of the shell builtins are described in +subsequent sections. +

    + +While executing commands is essential, most of the power (and +complexity) of shells is due to their embedded programming +languages. Like any high-level language, the shell provides +variables, flow control constructs, quoting, and functions. +

    + +Shells offer features geared specifically for +interactive use rather than to augment the programming language. +These interactive features include job control, command line +editing, command history and aliases. Each of these features is +described in this manual. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    2. Definitions

    + +These definitions are used throughout the remainder of this manual. +

    + +

    + +
    POSIX +
    +A family of open system standards based on Unix. Bash +is primarily concerned with the Shell and Utilities portion of the +POSIX 1003.1 standard. +

    + +

    blank +
    A space or tab character. +

    + +

    builtin +
    +A command that is implemented internally by the shell itself, rather +than by an executable program somewhere in the file system. +

    + +

    control operator +
    +A token that performs a control function. It is a newline +or one of the following: +`||', `&&', `&', `;', `;;', +`|', `|&', `(', or `)'. +

    + +

    exit status +
    +The value returned by a command to its caller. The value is restricted +to eight bits, so the maximum value is 255. +

    + +

    field +
    +A unit of text that is the result of one of the shell expansions. After +expansion, when executing a command, the resulting fields are used as +the command name and arguments. +

    + +

    filename +
    +A string of characters used to identify a file. +

    + +

    job +
    +A set of processes comprising a pipeline, and any processes descended +from it, that are all in the same process group. +

    + +

    job control +
    +A mechanism by which users can selectively stop (suspend) and restart +(resume) execution of processes. +

    + +

    metacharacter +
    +A character that, when unquoted, separates words. A metacharacter is +a blank or one of the following characters: +`|', `&', `;', `(', `)', `<', or +`>'. +

    + +

    name +
    + +A word consisting solely of letters, numbers, and underscores, +and beginning with a letter or underscore. Names are used as +shell variable and function names. +Also referred to as an identifier. +

    + +

    operator +
    +A control operator or a redirection operator. +See section 3.6 Redirections, for a list of redirection operators. +Operators contain at least one unquoted metacharacter. +

    + +

    process group +
    +A collection of related processes each having the same process +group ID. +

    + +

    process group ID +
    +A unique identifier that represents a process group +during its lifetime. +

    + +

    reserved word +
    +A word that has a special meaning to the shell. Most reserved +words introduce shell flow control constructs, such as for and +while. +

    + +

    return status +
    +A synonym for exit status. +

    + +

    signal +
    +A mechanism by which a process may be notified by the kernel +of an event occurring in the system. +

    + +

    special builtin +
    +A shell builtin command that has been classified as special by the +POSIX standard. +

    + +

    token +
    +A sequence of characters considered a single unit by the shell. +It is either a word or an operator. +

    + +

    word +
    +A sequence of characters treated as a unit by the shell. +Words may not include unquoted metacharacters. +
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3. Basic Shell Features

    + +

    + +Bash is an acronym for `Bourne-Again SHell'. +The Bourne shell is +the traditional Unix shell originally written by Stephen Bourne. +All of the Bourne shell builtin commands are available in Bash, +The rules for evaluation and quoting are taken from the POSIX +specification for the `standard' Unix shell. +

    + +This chapter briefly summarizes the shell's `building blocks': +commands, control structures, shell functions, shell parameters, +shell expansions, +redirections, which are a way to direct input and output from +and to named files, and how the shell executes commands. +

    + +

    + + + + + + + + +
    3.1 Shell Syntax  What your input means to the shell.
    3.2 Shell Commands  The types of commands you can use.
    3.3 Shell Functions  Grouping commands by name.
    3.4 Shell Parameters  How the shell stores values.
    3.5 Shell Expansions  How Bash expands parameters and the various + expansions available.
    3.6 Redirections  A way to control where input and output go.
    3.7 Executing Commands  What happens when you run a command.
    3.8 Shell Scripts  Executing files of shell commands.
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.1 Shell Syntax

    + +
    + + + +
    3.1.1 Shell Operation  The basic operation of the shell.
    3.1.2 Quoting  How to remove the special meaning from characters.
    3.1.3 Comments  How to specify comments.
    +

    + +When the shell reads input, it proceeds through a +sequence of operations. If the input indicates the beginning of a +comment, the shell ignores the comment symbol (`#'), and the rest +of that line. + +Otherwise, roughly speaking, the shell reads its input and +divides the input into words and operators, employing the quoting rules +to select which meanings to assign various words and characters. +

    + +The shell then parses these tokens into commands and other constructs, +removes the special meaning of certain words or characters, expands +others, redirects input and output as needed, executes the specified +command, waits for the command's exit status, and makes that exit status +available for further inspection or processing. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.1.1 Shell Operation

    + +

    + +The following is a brief description of the shell's operation when it +reads and executes a command. Basically, the shell does the +following: +

    + +

      +
    1. +Reads its input from a file (see section 3.8 Shell Scripts), from a string +supplied as an argument to the `-c' invocation option +(see section 6.1 Invoking Bash), or from the user's terminal. +

      + +

    2. +Breaks the input into words and operators, obeying the quoting rules +described in 3.1.2 Quoting. These tokens are separated by +metacharacters. Alias expansion is performed by this step +(see section 6.6 Aliases). +

      + +

    3. +Parses the tokens into simple and compound commands +(see section 3.2 Shell Commands). +

      + +

    4. +Performs the various shell expansions (see section 3.5 Shell Expansions), breaking +the expanded tokens into lists of filenames (see section 3.5.8 Filename Expansion) +and commands and arguments. +

      + +

    5. +Performs any necessary redirections (see section 3.6 Redirections) and removes +the redirection operators and their operands from the argument list. +

      + +

    6. +Executes the command (see section 3.7 Executing Commands). +

      + +

    7. +Optionally waits for the command to complete and collects its exit +status (see section 3.7.5 Exit Status). +

      + +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.1.2 Quoting

    + +
    + + + + + +
    3.1.2.1 Escape Character  How to remove the special meaning from a single + character.
    3.1.2.2 Single Quotes  How to inhibit all interpretation of a sequence + of characters.
    3.1.2.3 Double Quotes  How to suppress most of the interpretation of a + sequence of characters.
    3.1.2.4 ANSI-C Quoting  How to expand ANSI-C sequences in quoted strings.
    3.1.2.5 Locale-Specific Translation  How to translate strings into different languages.
    +

    + +Quoting is used to remove the special meaning of certain +characters or words to the shell. Quoting can be used to +disable special treatment for special characters, to prevent +reserved words from being recognized as such, and to prevent +parameter expansion. +

    + +Each of the shell metacharacters (see section 2. Definitions) +has special meaning to the shell and must be quoted if it is to +represent itself. +When the command history expansion facilities are being used +(see section 9.3 History Expansion), the +history expansion character, usually `!', must be quoted +to prevent history expansion. See section 9.1 Bash History Facilities, for +more details concerning history expansion. +

    + +There are three quoting mechanisms: the +escape character, single quotes, and double quotes. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.1.2.1 Escape Character

    + +A non-quoted backslash `\' is the Bash escape character. +It preserves the literal value of the next character that follows, +with the exception of newline. If a \newline pair +appears, and the backslash itself is not quoted, the \newline +is treated as a line continuation (that is, it is removed from +the input stream and effectively ignored). +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.1.2.2 Single Quotes

    + +

    + +Enclosing characters in single quotes (`'') preserves the literal value +of each character within the quotes. A single quote may not occur +between single quotes, even when preceded by a backslash. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.1.2.3 Double Quotes

    + +

    + +Enclosing characters in double quotes (`"') preserves the literal value +of all characters within the quotes, with the exception of +`$', ``', `\', +and, when history expansion is enabled, `!'. +The characters `$' and ``' +retain their special meaning within double quotes (see section 3.5 Shell Expansions). +The backslash retains its special meaning only when followed by one of +the following characters: +`$', ``', `"', `\', or newline. +Within double quotes, backslashes that are followed by one of these +characters are removed. Backslashes preceding characters without a +special meaning are left unmodified. +A double quote may be quoted within double quotes by preceding it with +a backslash. +If enabled, history expansion will be performed unless an `!' +appearing in double quotes is escaped using a backslash. +The backslash preceding the `!' is not removed. +

    + +The special parameters `*' and `@' have special meaning +when in double quotes (see section 3.5.3 Shell Parameter Expansion). +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.1.2.4 ANSI-C Quoting

    + +

    + +Words of the form $'string' are treated specially. The +word expands to string, with backslash-escaped characters replaced +as specified by the ANSI C standard. Backslash escape sequences, if +present, are decoded as follows: +

    + +

    +
    \a +
    alert (bell) +
    \b +
    backspace +
    \e +
    \E +
    an escape character (not ANSI C) +
    \f +
    form feed +
    \n +
    newline +
    \r +
    carriage return +
    \t +
    horizontal tab +
    \v +
    vertical tab +
    \\ +
    backslash +
    \' +
    single quote +
    \" +
    double quote +
    \nnn +
    the eight-bit character whose value is the octal value nnn +(one to three digits) +
    \xHH +
    the eight-bit character whose value is the hexadecimal value HH +(one or two hex digits) +
    \uHHHH +
    the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +HHHH (one to four hex digits) +
    \UHHHHHHHH +
    the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +HHHHHHHH (one to eight hex digits) +
    \cx +
    a control-x character +
    +

    + +The expanded result is single-quoted, as if the dollar sign had not +been present. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.1.2.5 Locale-Specific Translation

    + +

    + +A double-quoted string preceded by a dollar sign (`$') will cause +the string to be translated according to the current locale. +If the current locale is C or POSIX, the dollar sign +is ignored. +If the string is translated and replaced, the replacement is +double-quoted. +

    + + + + +Some systems use the message catalog selected by the LC_MESSAGES +shell variable. Others create the name of the message catalog from the +value of the TEXTDOMAIN shell variable, possibly adding a +suffix of `.mo'. If you use the TEXTDOMAIN variable, you +may need to set the TEXTDOMAINDIR variable to the location of +the message catalog files. Still others use both variables in this +fashion: +TEXTDOMAINDIR/LC_MESSAGES/LC_MESSAGES/TEXTDOMAIN.mo. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.1.3 Comments

    + +

    + +In a non-interactive shell, or an interactive shell in which the +interactive_comments option to the shopt +builtin is enabled (see section 4.3.2 The Shopt Builtin), +a word beginning with `#' +causes that word and all remaining characters on that line to +be ignored. An interactive shell without the interactive_comments +option enabled does not allow comments. The interactive_comments +option is on by default in interactive shells. +See section 6.3 Interactive Shells, for a description of what makes +a shell interactive. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.2 Shell Commands

    + +

    + +A simple shell command such as echo a b c consists of the command +itself followed by arguments, separated by spaces. +

    + +More complex shell commands are composed of simple commands arranged together +in a variety of ways: in a pipeline in which the output of one command +becomes the input of a second, in a loop or conditional construct, or in +some other grouping. +

    + +

    + + + + + + +
    3.2.1 Simple Commands  The most common type of command.
    3.2.2 Pipelines  Connecting the input and output of several + commands.
    3.2.3 Lists of Commands  How to execute commands sequentially.
    3.2.4 Compound Commands  Shell commands for control flow.
    3.2.5 Coprocesses  Two-way communication between commands.
    3.2.6 GNU Parallel  Running commands in parallel.
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.2.1 Simple Commands

    + +

    + +A simple command is the kind of command encountered most often. +It's just a sequence of words separated by blanks, terminated +by one of the shell's control operators (see section 2. Definitions). The +first word generally specifies a command to be executed, with the +rest of the words being that command's arguments. +

    + +The return status (see section 3.7.5 Exit Status) of a simple command is +its exit status as provided +by the POSIX 1003.1 waitpid function, or 128+n if +the command was terminated by signal n. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.2.2 Pipelines

    + +

    + +A pipeline is a sequence of simple commands separated by one of +the control operators `|' or `|&'. +

    + + + + +The format for a pipeline is +
     
    [time [-p]] [!] command1 [ | or |& command2 ] ...
    +

    + +The output of each command in the pipeline is connected via a pipe +to the input of the next command. +That is, each command reads the previous command's output. This +connection is performed before any redirections specified by the +command. +

    + +If `|&' is used, command1's standard error, in addition to +its standard output, is connected to +command2's standard input through the pipe; +it is shorthand for 2>&1 |. +This implicit redirection of the standard error to the standard output is +performed after any redirections specified by the command. +

    + +The reserved word time causes timing statistics +to be printed for the pipeline once it finishes. +The statistics currently consist of elapsed (wall-clock) time and +user and system time consumed by the command's execution. +The `-p' option changes the output format to that specified +by POSIX. +When the shell is in POSIX mode (see section 6.11 Bash POSIX Mode), +it does not recognize time as a reserved word if the next +token begins with a `-'. +The TIMEFORMAT variable may be set to a format string that +specifies how the timing information should be displayed. +See section 5.2 Bash Variables, for a description of the available formats. +The use of time as a reserved word permits the timing of +shell builtins, shell functions, and pipelines. An external +time command cannot time these easily. +

    + +When the shell is in POSIX mode (see section 6.11 Bash POSIX Mode), time +may be followed by a newline. In this case, the shell displays the +total user and system time consumed by the shell and its children. +The TIMEFORMAT variable may be used to specify the format of +the time information. +

    + +If the pipeline is not executed asynchronously (see section 3.2.3 Lists of Commands), the +shell waits for all commands in the pipeline to complete. +

    + +Each command in a pipeline is executed in its own subshell +(see section 3.7.3 Command Execution Environment). The exit +status of a pipeline is the exit status of the last command in the +pipeline, unless the pipefail option is enabled +(see section 4.3.1 The Set Builtin). +If pipefail is enabled, the pipeline's return status is the +value of the last (rightmost) command to exit with a non-zero status, +or zero if all commands exit successfully. +If the reserved word `!' precedes the pipeline, the +exit status is the logical negation of the exit status as described +above. +The shell waits for all commands in the pipeline to terminate before +returning a value. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.2.3 Lists of Commands

    + +

    + +A list is a sequence of one or more pipelines separated by one +of the operators `;', `&', `&&', or `||', +and optionally terminated by one of `;', `&', or a +newline. +

    + +Of these list operators, `&&' and `||' +have equal precedence, followed by `;' and `&', +which have equal precedence. +

    + +A sequence of one or more newlines may appear in a list +to delimit commands, equivalent to a semicolon. +

    + +If a command is terminated by the control operator `&', +the shell executes the command asynchronously in a subshell. +This is known as executing the command in the background. +The shell does not wait for the command to finish, and the return +status is 0 (true). +When job control is not active (see section 7. Job Control), +the standard input for asynchronous commands, in the absence of any +explicit redirections, is redirected from /dev/null. +

    + +Commands separated by a `;' are executed sequentially; the shell +waits for each command to terminate in turn. The return status is the +exit status of the last command executed. +

    + +AND and OR lists are sequences of one or more pipelines +separated by the control operators `&&' and `||', +respectively. AND and OR lists are executed with left +associativity. +

    + +An AND list has the form +
     
    command1 && command2
    +

    + +command2 is executed if, and only if, command1 +returns an exit status of zero. +

    + +An OR list has the form +
     
    command1 || command2
    +

    + +command2 is executed if, and only if, command1 +returns a non-zero exit status. +

    + +The return status of +AND and OR lists is the exit status of the last command +executed in the list. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.2.4 Compound Commands

    + +

    + +

    + + + +
    3.2.4.1 Looping Constructs  Shell commands for iterative action.
    3.2.4.2 Conditional Constructs  Shell commands for conditional execution.
    3.2.4.3 Grouping Commands  Ways to group commands.
    +

    + +Compound commands are the shell programming constructs. +Each construct begins with a reserved word or control operator and is +terminated by a corresponding reserved word or operator. +Any redirections (see section 3.6 Redirections) associated with a compound command +apply to all commands within that compound command unless explicitly overridden. +

    + +In most cases a list of commands in a compound command's description may be +separated from the rest of the command by one or more newlines, and may be +followed by a newline in place of a semicolon. +

    + +Bash provides looping constructs, conditional commands, and mechanisms +to group commands and execute them as a unit. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.2.4.1 Looping Constructs

    + +

    + +Bash supports the following looping constructs. +

    + +Note that wherever a `;' appears in the description of a +command's syntax, it may be replaced with one or more newlines. +

    + +

    +
    until +
    + + +The syntax of the until command is: +

    + +
     
    until test-commands; do consequent-commands; done
    +

    + +Execute consequent-commands as long as +test-commands has an exit status which is not zero. +The return status is the exit status of the last command executed +in consequent-commands, or zero if none was executed. +

    + +

    while +
    +The syntax of the while command is: +

    + +
     
    while test-commands; do consequent-commands; done
    +

    + +Execute consequent-commands as long as +test-commands has an exit status of zero. +The return status is the exit status of the last command executed +in consequent-commands, or zero if none was executed. +

    + +

    for +
    +The syntax of the for command is: +

    + +
     
    for name [ [in [words ...] ] ; ] do commands; done
    +

    + +Expand words, and execute commands once for each member +in the resultant list, with name bound to the current member. +If `in words' is not present, the for command +executes the commands once for each positional parameter that is +set, as if `in "$@"' had been specified +(see section 3.4.2 Special Parameters). +The return status is the exit status of the last command that executes. +If there are no items in the expansion of words, no commands are +executed, and the return status is zero. +

    + +An alternate form of the for command is also supported: +

    + +
     
    for (( expr1 ; expr2 ; expr3 )) ; do commands ; done
    +

    + +First, the arithmetic expression expr1 is evaluated according +to the rules described below (see section 6.5 Shell Arithmetic). +The arithmetic expression expr2 is then evaluated repeatedly +until it evaluates to zero. +Each time expr2 evaluates to a non-zero value, commands are +executed and the arithmetic expression expr3 is evaluated. +If any expression is omitted, it behaves as if it evaluates to 1. +The return value is the exit status of the last command in commands +that is executed, or false if any of the expressions is invalid. +

    +

    + +The break and continue builtins (see section 4.1 Bourne Shell Builtins) +may be used to control loop execution. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.2.4.2 Conditional Constructs

    + +

    + +

    +
    if +
    + + + + +The syntax of the if command is: +

    + +
     
    if test-commands; then
    +  consequent-commands;
    +[elif more-test-commands; then
    +  more-consequents;]
    +[else alternate-consequents;]
    +fi
    +

    + +The test-commands list is executed, and if its return status is zero, +the consequent-commands list is executed. +If test-commands returns a non-zero status, each elif list +is executed in turn, and if its exit status is zero, +the corresponding more-consequents is executed and the +command completes. +If `else alternate-consequents' is present, and +the final command in the final if or elif clause +has a non-zero exit status, then alternate-consequents is executed. +The return status is the exit status of the last command executed, or +zero if no condition tested true. +

    + +

    case +
    + + +The syntax of the case command is: +

    + +
     
    case word in [ [(] pattern [| pattern]...) command-list ;;]... esac
    +

    + +case will selectively execute the command-list corresponding to +the first pattern that matches word. +If the shell option nocasematch +(see the description of shopt in 4.3.2 The Shopt Builtin) +is enabled, the match is performed without regard to the case +of alphabetic characters. +The `|' is used to separate multiple patterns, and the `)' +operator terminates a pattern list. +A list of patterns and an associated command-list is known +as a clause. +

    + +Each clause must be terminated with `;;', `;&', or `;;&'. +The word undergoes tilde expansion, parameter expansion, command +substitution, arithmetic expansion, and quote removal before matching is +attempted. Each pattern undergoes tilde expansion, parameter +expansion, command substitution, and arithmetic expansion. +

    + +There may be an arbitrary number of case clauses, each terminated +by a `;;', `;&', or `;;&'. +The first pattern that matches determines the +command-list that is executed. +It's a common idiom to use `*' as the final pattern to define the +default case, since that pattern will always match. +

    + +Here is an example using case in a script that could be used to +describe one interesting feature of an animal: +

    + +
     
    echo -n "Enter the name of an animal: "
    +read ANIMAL
    +echo -n "The $ANIMAL has "
    +case $ANIMAL in
    +  horse | dog | cat) echo -n "four";;
    +  man | kangaroo ) echo -n "two";;
    +  *) echo -n "an unknown number of";;
    +esac
    +echo " legs."
    +

    + +

    + +If the `;;' operator is used, no subsequent matches are attempted after +the first pattern match. +Using `;&' in place of `;;' causes execution to continue with +the command-list associated with the next clause, if any. +Using `;;&' in place of `;;' causes the shell to test the patterns +in the next clause, if any, and execute any associated command-list +on a successful match. +

    + +The return status is zero if no pattern is matched. Otherwise, the +return status is the exit status of the command-list executed. +

    + +

    select +
    +

    + +The select construct allows the easy generation of menus. +It has almost the same syntax as the for command: +

    + +
     
    select name [in words ...]; do commands; done
    +

    + +The list of words following in is expanded, generating a list +of items. The set of expanded words is printed on the standard +error output stream, each preceded by a number. If the +`in words' is omitted, the positional parameters are printed, +as if `in "$@"' had been specified. +The PS3 prompt is then displayed and a line is read from the +standard input. +If the line consists of a number corresponding to one of the displayed +words, then the value of name is set to that word. +If the line is empty, the words and prompt are displayed again. +If EOF is read, the select command completes. +Any other value read causes name to be set to null. +The line read is saved in the variable REPLY. +

    + +The commands are executed after each selection until a +break command is executed, at which +point the select command completes. +

    + +Here is an example that allows the user to pick a filename from the +current directory, and displays the name and index of the file +selected. +

    + +
     
    select fname in *;
    +do
    +	echo you picked $fname \($REPLY\)
    +	break;
    +done
    +

    + +

    ((...)) +
     
    (( expression ))
    +

    + +The arithmetic expression is evaluated according to the rules +described below (see section 6.5 Shell Arithmetic). +If the value of the expression is non-zero, the return status is 0; +otherwise the return status is 1. This is exactly equivalent to +
     
    let "expression"
    +
    See section 4.2 Bash Builtin Commands, for a full description of the let builtin. +

    + +

    [[...]] +
    + +
     
    [[ expression ]]
    +

    + +Return a status of 0 or 1 depending on the evaluation of +the conditional expression expression. +Expressions are composed of the primaries described below in +6.4 Bash Conditional Expressions. +Word splitting and filename expansion are not performed on the words +between the [[ and ]]; tilde expansion, parameter and +variable expansion, arithmetic expansion, command substitution, process +substitution, and quote removal are performed. +Conditional operators such as `-f' must be unquoted to be recognized +as primaries. +

    + +When used with [[, the `<' and `>' operators sort +lexicographically using the current locale. +

    + +When the `==' and `!=' operators are used, the string to the +right of the operator is considered a pattern and matched according +to the rules described below in 3.5.8.1 Pattern Matching, +as if the extglob shell option were enabled. +The `=' operator is identical to `=='. +If the shell option nocasematch +(see the description of shopt in 4.3.2 The Shopt Builtin) +is enabled, the match is performed without regard to the case +of alphabetic characters. +The return value is 0 if the string matches (`==') or does not +match (`!=')the pattern, and 1 otherwise. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +

    + +An additional binary operator, `=~', is available, with the same +precedence as `==' and `!='. +When it is used, the string to the right of the operator is considered +an extended regular expression and matched accordingly (as in regex3)). +The return value is 0 if the string matches +the pattern, and 1 otherwise. +If the regular expression is syntactically incorrect, the conditional +expression's return value is 2. +If the shell option nocasematch +(see the description of shopt in 4.3.2 The Shopt Builtin) +is enabled, the match is performed without regard to the case +of alphabetic characters. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +Bracket expressions in regular expressions must be treated carefully, +since normal quoting characters lose their meanings between brackets. +If the pattern is stored in a shell variable, quoting the variable +expansion forces the entire pattern to be matched as a string. +Substrings matched by parenthesized subexpressions within the regular +expression are saved in the array variable BASH_REMATCH. +The element of BASH_REMATCH with index 0 is the portion of the string +matching the entire regular expression. +The element of BASH_REMATCH with index n is the portion of the +string matching the nth parenthesized subexpression. +

    + +For example, the following will match a line +(stored in the shell variable line) +if there is a sequence of characters in the value consisting of +any number, including zero, of +space characters, zero or one instances of `a', then a `b': +
     
    [[ $line =~ [[:space:]]*(a)?b ]]
    +

    + +That means values like `aab' and ` aaaaaab' will match, as +will a line containing a `b' anywhere in its value. +

    + +Storing the regular expression in a shell variable is often a useful +way to avoid problems with quoting characters that are special to the +shell. +It is sometimes difficult to specify a regular expression literally +without using quotes, or to keep track of the quoting used by regular +expressions while paying attention to the shell's quote removal. +Using a shell variable to store the pattern decreases these problems. +For example, the following is equivalent to the above: +
     
    pattern='[[:space:]]*(a)?b'
    +[[ $line =~ $pattern ]]
    +

    + +If you want to match a character that's special to the regular expression +grammar, it has to be quoted to remove its special meaning. +This means that in the pattern `xxx.txt', the `.' matches any +character in the string (its usual regular expression meaning), but in the +pattern `"xxx.txt"' it can only match a literal `.'. +Shell programmers should take special care with backslashes, since backslashes +are used both by the shell and regular expressions to remove the special +meaning from the following character. +The following two sets of commands are not equivalent: +
     
    pattern='\.'
    +
    +[[ . =~ $pattern ]]
    +[[ . =~ \. ]]
    +
    +[[ . =~ "$pattern" ]]
    +[[ . =~ '\.' ]]
    +

    + +The first two matches will succeed, but the second two will not, because +in the second two the backslash will be part of the pattern to be matched. +In the first two examples, the backslash removes the special meaning from +`.', so the literal `.' matches. +If the string in the first examples were anything other than `.', say +`a', the pattern would not match, because the quoted `.' in the +pattern loses its special meaning of matching any single character. +

    + +Expressions may be combined using the following operators, listed +in decreasing order of precedence: +

    + +

    +
    ( expression ) +
    Returns the value of expression. +This may be used to override the normal precedence of operators. +

    + +

    ! expression +
    True if expression is false. +

    + +

    expression1 && expression2 +
    True if both expression1 and expression2 are true. +

    + +

    expression1 || expression2 +
    True if either expression1 or expression2 is true. +
    +

    + +The && and || operators do not evaluate expression2 if the +value of expression1 is sufficient to determine the return +value of the entire conditional expression. +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.2.4.3 Grouping Commands

    + +

    + +Bash provides two ways to group a list of commands to be executed +as a unit. When commands are grouped, redirections may be applied +to the entire command list. For example, the output of all the +commands in the list may be redirected to a single stream. +

    + +

    +
    () +
     
    ( list )
    +

    + +Placing a list of commands between parentheses causes a subshell +environment to be created (see section 3.7.3 Command Execution Environment), and each +of the commands in list to be executed in that subshell. Since the +list is executed in a subshell, variable assignments do not remain in +effect after the subshell completes. +

    + +

    {} +
    + +
     
    { list; }
    +

    + +Placing a list of commands between curly braces causes the list to +be executed in the current shell context. No subshell is created. +The semicolon (or newline) following list is required. +

    +

    + +In addition to the creation of a subshell, there is a subtle difference +between these two constructs due to historical reasons. The braces +are reserved words, so they must be separated from the list +by blanks or other shell metacharacters. +The parentheses are operators, and are +recognized as separate tokens by the shell even if they are not separated +from the list by whitespace. +

    + +The exit status of both of these constructs is the exit status of +list. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.2.5 Coprocesses

    + +

    + +A coprocess is a shell command preceded by the coproc +reserved word. +A coprocess is executed asynchronously in a subshell, as if the command +had been terminated with the `&' control operator, with a two-way pipe +established between the executing shell and the coprocess. +

    + +The format for a coprocess is: +
     
    coproc [NAME] command [redirections]
    +

    + +This creates a coprocess named NAME. +If NAME is not supplied, the default name is COPROC. +NAME must not be supplied if command is a simple +command (see section 3.2.1 Simple Commands); otherwise, it is interpreted as +the first word of the simple command. +

    + +When the coprocess is executed, the shell creates an array variable +(see section 6.7 Arrays) +named NAME in the context of the executing shell. +The standard output of command +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to NAME[0]. +The standard input of command +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to NAME[1]. +This pipe is established before any redirections specified by the +command (see section 3.6 Redirections). +The file descriptors can be utilized as arguments to shell commands +and redirections using standard word expansions. +The file descriptors are not available in subshells. +

    + +The process ID of the shell spawned to execute the coprocess is +available as the value of the variable NAME_PID. +The wait +builtin command may be used to wait for the coprocess to terminate. +

    + +Since the coprocess is created as an asynchronous command, +the coproc command always returns success. +The return status of a coprocess is the exit status of command. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.2.6 GNU Parallel

    + +

    + +There are ways to run commands in parallel that are not built into Bash. +GNU Parallel is a tool to do just that. +

    + +GNU Parallel, as its name suggests, can be used to build and run commands +in parallel. You may run the same command with different arguments, whether +they are filenames, usernames, hostnames, or lines read from files. GNU +Parallel provides shorthand references to many of the most common operations +(input lines, various portions of the input line, different ways to specify +the input source, and so on). Parallel can replace xargs or feed +commands from its input sources to several different instances of Bash. +

    + +For a complete description, refer to the GNU Parallel documentation. A few +examples should provide a brief introduction to its use. +

    + +For example, it is easy to replace xargs to gzip all html files in the +current directory and its subdirectories: +
     
    find . -type f -name '*.html' -print | parallel gzip
    +
    If you need to protect special characters such as newlines in file names, +use find's `-print0' option and parallel's `-0' option. +

    + +You can use Parallel to move files from the current directory when the +number of files is too large to process with one mv invocation: +
     
    ls | parallel mv {} destdir
    +

    + +As you can see, the {} is replaced with each line read from standard input. +While using ls will work in most instances, it is not sufficient to +deal with all filenames. +If you need to accommodate special characters in filenames, you can use +

    + +
     
    find . -depth 1 \! -name '.*' -print0 | parallel -0 mv {} destdir
    +

    + +as alluded to above. +

    + +This will run as many mv commands as there are files in the current +directory. +You can emulate a parallel xargs by adding the `-X' option: +
     
    find . -depth 1 \! -name '.*' -print0 | parallel -0 -X mv {} destdir
    +

    + +GNU Parallel can replace certain common idioms that operate on lines read +from a file (in this case, filenames listed one per line): +
     
    	while IFS= read -r x; do
    +		do-something1 "$x" "config-$x"
    +		do-something2 < "$x"
    +	done < file | process-output
    +

    + +with a more compact syntax reminiscent of lambdas: +
     
    cat list | parallel "do-something1 {} config-{} ; do-something2 < {}" | process-output
    +

    + +Parallel provides a built-in mechanism to remove filename extensions, which +lends itself to batch file transformations or renaming: +
     
    ls *.gz | parallel -j+0 "zcat {} | bzip2 >{.}.bz2 && rm {}"
    +
    This will recompress all files in the current directory with names ending +in .gz using bzip2, running one job per CPU (-j+0) in parallel. +(We use ls for brevity here; using find as above is more +robust in the face of filenames containing unexpected characters.) +Parallel can take arguments from the command line; the above can also be +written as +

    + +
     
    parallel "zcat {} | bzip2 >{.}.bz2 && rm {}" ::: *.gz
    +

    + +If a command generates output, you may want to preserve the input order in +the output. For instance, the following command +
     
    { echo foss.org.my ; echo debian.org; echo freenetproject.org; } | parallel traceroute
    +
    will display as output the traceroute invocation that finishes first. +Adding the `-k' option +
     
    { echo foss.org.my ; echo debian.org; echo freenetproject.org; } | parallel -k traceroute
    +
    will ensure that the output of traceroute foss.org.my is displayed first. +

    + +Finally, Parallel can be used to run a sequence of shell commands in parallel, +similar to `cat file | bash'. +It is not uncommon to take a list of filenames, create a series of shell +commands to operate on them, and feed that list of commnds to a shell. +Parallel can speed this up. Assuming that `file' contains a list of +shell commands, one per line, +

    + +
     
    parallel -j 10 < file
    +

    + +will evaluate the commands using the shell (since no explicit command is +supplied as an argument), in blocks of ten shell jobs at a time. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.3 Shell Functions

    + +

    + +Shell functions are a way to group commands for later execution +using a single name for the group. They are executed just like +a "regular" command. +When the name of a shell function is used as a simple command name, +the list of commands associated with that function name is executed. +Shell functions are executed in the current +shell context; no new process is created to interpret them. +

    + +Functions are declared using this syntax: + +
     
    name () compound-command [ redirections ]
    +

    + +or +

    + +
     
    function name [()] compound-command [ redirections ]
    +

    + +This defines a shell function named name. The reserved +word function is optional. +If the function reserved +word is supplied, the parentheses are optional. +The body of the function is the compound command +compound-command (see section 3.2.4 Compound Commands). +That command is usually a list enclosed between { and }, but +may be any compound command listed above. +compound-command is executed whenever name is specified as the +name of a command. +When the shell is in POSIX mode (see section 6.11 Bash POSIX Mode), +name may not be the same as one of the special builtins +(see section 4.4 Special Builtins). +Any redirections (see section 3.6 Redirections) associated with the shell function +are performed when the function is executed. +

    + +A function definition may be deleted using the `-f' option to the +unset builtin (see section 4.1 Bourne Shell Builtins). +

    + +The exit status of a function definition is zero unless a syntax error +occurs or a readonly function with the same name already exists. +When executed, the exit status of a function is the exit status of the +last command executed in the body. +

    + +Note that for historical reasons, in the most common usage the curly braces +that surround the body of the function must be separated from the body by +blanks or newlines. +This is because the braces are reserved words and are only recognized +as such when they are separated from the command list +by whitespace or another shell metacharacter. +Also, when using the braces, the list must be terminated by a semicolon, +a `&', or a newline. +

    + +When a function is executed, the arguments to the +function become the positional parameters +during its execution (see section 3.4.1 Positional Parameters). +The special parameter `#' that expands to the number of +positional parameters is updated to reflect the change. +Special parameter 0 is unchanged. +The first element of the FUNCNAME variable is set to the +name of the function while the function is executing. +

    + +All other aspects of the shell execution +environment are identical between a function and its caller +with these exceptions: +the DEBUG and RETURN traps +are not inherited unless the function has been given the +trace attribute using the declare builtin or +the -o functrace option has been enabled with +the set builtin, +(in which case all functions inherit the DEBUG and RETURN traps), +and the ERR trap is not inherited unless the -o errtrace +shell option has been enabled. +See section 4.1 Bourne Shell Builtins, for the description of the +trap builtin. +

    + +The FUNCNEST variable, if set to a numeric value greater +than 0, defines a maximum function nesting level. Function +invocations that exceed the limit cause the entire command to +abort. +

    + +If the builtin command return +is executed in a function, the function completes and +execution resumes with the next command after the function +call. +Any command associated with the RETURN trap is executed +before execution resumes. +When a function completes, the values of the +positional parameters and the special parameter `#' +are restored to the values they had prior to the function's +execution. If a numeric argument is given to return, +that is the function's return status; otherwise the function's +return status is the exit status of the last command executed +before the return. +

    + +Variables local to the function may be declared with the +local builtin. These variables are visible only to +the function and the commands it invokes. +

    + +Function names and definitions may be listed with the +`-f' option to the declare (typeset) +builtin command (see section 4.2 Bash Builtin Commands). +The `-F' option to declare or typeset +will list the function names only +(and optionally the source file and line number, if the extdebug +shell option is enabled). +Functions may be exported so that subshells +automatically have them defined with the +`-f' option to the export builtin +(see section 4.1 Bourne Shell Builtins). +Note that shell functions and variables with the same name may result +in multiple identically-named entries in the environment passed to the +shell's children. +Care should be taken in cases where this may cause a problem. +

    + +Functions may be recursive. +The FUNCNEST variable may be used to limit the depth of the +function call stack and restrict the number of function invocations. +By default, no limit is placed on the number of recursive calls. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.4 Shell Parameters

    + +

    + +

    + + +
    3.4.1 Positional Parameters  The shell's command-line arguments.
    3.4.2 Special Parameters  Parameters denoted by special characters.
    +

    + +A parameter is an entity that stores values. +It can be a name, a number, or one of the special characters +listed below. +A variable is a parameter denoted by a name. +A variable has a value and zero or more attributes. +Attributes are assigned using the declare builtin command +(see the description of the declare builtin in 4.2 Bash Builtin Commands). +

    + +A parameter is set if it has been assigned a value. The null string is +a valid value. Once a variable is set, it may be unset only by using +the unset builtin command. +

    + +A variable may be assigned to by a statement of the form +
     
    name=[value]
    +
    If value +is not given, the variable is assigned the null string. All +values undergo tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote +removal (detailed below). If the variable has its integer +attribute set, then value +is evaluated as an arithmetic expression even if the $((...)) +expansion is not used (see section 3.5.5 Arithmetic Expansion). +Word splitting is not performed, with the exception +of "$@" as explained below. +Filename expansion is not performed. +Assignment statements may also appear as arguments to the +alias, +declare, typeset, export, readonly, +and local builtin commands. +When in POSIX mode (see section 6.11 Bash POSIX Mode), these builtins may appear +in a command after one or more instances of the command builtin +and retain these assignment statement properties. +

    + +In the context where an assignment statement is assigning a value +to a shell variable or array index (see section 6.7 Arrays), the `+=' +operator can be used to +append to or add to the variable's previous value. +When `+=' is applied to a variable for which the integer attribute +has been set, value is evaluated as an arithmetic expression and +added to the variable's current value, which is also evaluated. +When `+=' is applied to an array variable using compound assignment +(see section 6.7 Arrays), the +variable's value is not unset (as it is when using `='), and new +values are appended to the array beginning at one greater than the array's +maximum index (for indexed arrays), or added as additional key-value pairs +in an associative array. +When applied to a string-valued variable, value is expanded and +appended to the variable's value. +

    + +A variable can be assigned the nameref attribute using the +`-n' option to the \fBdeclare\fP or \fBlocal\fP builtin commands +(see section 4.2 Bash Builtin Commands) +to create a nameref, or a reference to another variable. +This allows variables to be manipulated indirectly. +Whenever the nameref variable is referenced or assigned to, the operation +is actually performed on the variable specified by the nameref variable's +value. +A nameref is commonly used within shell functions to refer to a variable +whose name is passed as an argument to the function. +For instance, if a variable name is passed to a shell function as its first +argument, running +
     
    declare -n ref=$1
    +
    inside the function creates a nameref variable ref whose value is +the variable name passed as the first argument. +References and assignments to ref are treated as references and +assignments to the variable whose name was passed as $1. +

    + +If the control variable in a for loop has the nameref attribute, +the list of words can be a list of shell variables, and a name reference +will be established for each word in the list, in turn, when the loop is +executed. +Array variables cannot be given the `-n' attribute. +However, nameref variables can reference array variables and subscripted +array variables. +Namerefs can be unset using the `-n' option to the unset builtin +(see section 4.1 Bourne Shell Builtins). +Otherwise, if unset is executed with the name of a nameref variable +as an argument, the variable referenced by the nameref variable will be unset. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.4.1 Positional Parameters

    + +

    + +A positional parameter is a parameter denoted by one or more +digits, other than the single digit 0. Positional parameters are +assigned from the shell's arguments when it is invoked, +and may be reassigned using the set builtin command. +Positional parameter N may be referenced as ${N}, or +as $N when N consists of a single digit. +Positional parameters may not be assigned to with assignment statements. +The set and shift builtins are used to set and +unset them (see section 4. Shell Builtin Commands). +The positional parameters are +temporarily replaced when a shell function is executed +(see section 3.3 Shell Functions). +

    + +When a positional parameter consisting of more than a single +digit is expanded, it must be enclosed in braces. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.4.2 Special Parameters

    + +

    + +The shell treats several parameters specially. These parameters may +only be referenced; assignment to them is not allowed. +

    + +

    + + +
    * +
    + +($*) Expands to the positional parameters, starting from one. +When the expansion is not within double quotes, each positional parameter +expands to a separate word. +In contexts where it is performed, those words +are subject to further word splitting and pathname expansion. +When the expansion occurs within double quotes, it expands to a single word +with the value of each parameter separated by the first character +of the IFS +special variable. That is, "$*" is equivalent +to "$1c$2c...", where c +is the first character of the value of the IFS +variable. +If IFS is unset, the parameters are separated by spaces. +If IFS is null, the parameters are joined without intervening +separators. +

    + + +

    @ +
    + +($@) Expands to the positional parameters, starting from one. When the +expansion occurs within double quotes, each parameter expands to a +separate word. That is, "$@" is equivalent to +"$1" "$2" .... +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +When there are no positional parameters, "$@" and +$@ +expand to nothing (i.e., they are removed). +

    + + +

    # +
    + +($#) Expands to the number of positional parameters in decimal. +

    + + +

    ? +
    + +($?) Expands to the exit status of the most recently executed foreground +pipeline. +

    + + +

    - +
    + +($-, a hyphen.) Expands to the current option flags as specified upon +invocation, by the set +builtin command, or those set by the shell itself +(such as the `-i' option). +

    + + +

    $ +
    + +($$) Expands to the process ID of the shell. In a () subshell, it +expands to the process ID of the invoking shell, not the subshell. +

    + + +

    ! +
    + +($!) Expands to the process ID of the job most recently placed into the +background, whether executed as an asynchronous command or using +the bg builtin (see section 7.2 Job Control Builtins). +

    + + +

    0 +
    + +($0) Expands to the name of the shell or shell script. This is set at +shell initialization. If Bash is invoked with a file of commands +(see section 3.8 Shell Scripts), $0 is set to the name of that file. +If Bash is started with the `-c' option (see section 6.1 Invoking Bash), +then $0 is set to the first argument after the string to be +executed, if one is present. Otherwise, it is set +to the filename used to invoke Bash, as given by argument zero. +

    + + +

    _ +
    + +($_, an underscore.) +At shell startup, set to the absolute pathname used to invoke the +shell or shell script being executed as passed in the environment +or argument list. +Subsequently, expands to the last argument to the previous command, +after expansion. +Also set to the full pathname used to invoke each command executed +and placed in the environment exported to that command. +When checking mail, this parameter holds the name of the mail file. +
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.5 Shell Expansions

    + +

    + +Expansion is performed on the command line after it has been split into +tokens. There are seven kinds of expansion performed: +

    + +

      +
    • brace expansion +
    • tilde expansion +
    • parameter and variable expansion +
    • command substitution +
    • arithmetic expansion +
    • word splitting +
    • filename expansion +
    +

    + +

    + + + + + + + + + +
    3.5.1 Brace Expansion  Expansion of expressions within braces.
    3.5.2 Tilde Expansion  Expansion of the ~ character.
    3.5.3 Shell Parameter Expansion  How Bash expands variables to their values.
    3.5.4 Command Substitution  Using the output of a command as an argument.
    3.5.5 Arithmetic Expansion  How to use arithmetic in shell expansions.
    3.5.6 Process Substitution  A way to write and read to and from a + command.
    3.5.7 Word Splitting  How the results of expansion are split into separate + arguments.
    3.5.8 Filename Expansion  A shorthand for specifying filenames matching patterns.
    3.5.9 Quote Removal  How and when quote characters are removed from + words.
    +

    + +The order of expansions is: +brace expansion; +tilde expansion, parameter and variable expansion, arithmetic expansion, +and command substitution (done in a left-to-right fashion); +word splitting; +and filename expansion. +

    + +On systems that can support it, there is an additional expansion +available: process substitution. +This is performed at the +same time as tilde, parameter, variable, and arithmetic expansion and +command substitution. +

    + +Only brace expansion, word splitting, and filename expansion +can change the number of words of the expansion; other expansions +expand a single word to a single word. +The only exceptions to this are the expansions of +"$@" (see section 3.4.2 Special Parameters) and "${name[@]}" +(see section 6.7 Arrays). +

    + +After all expansions, quote removal (see section 3.5.9 Quote Removal) +is performed. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.5.1 Brace Expansion

    + +

    + +Brace expansion is a mechanism by which arbitrary strings may be generated. +This mechanism is similar to +filename expansion (see section 3.5.8 Filename Expansion), +but the filenames generated need not exist. +Patterns to be brace expanded take the form of an optional preamble, +followed by either a series of comma-separated strings or a sequence expression +between a pair of braces, +followed by an optional postscript. +The preamble is prefixed to each string contained within the braces, and +the postscript is then appended to each resulting string, expanding left +to right. +

    + +Brace expansions may be nested. +The results of each expanded string are not sorted; left to right order +is preserved. +For example, +
     
    bash$ echo a{d,c,b}e
    +ade ace abe
    +

    + +A sequence expression takes the form {x..y[..incr]}, +where x and y are either integers or single characters, +and incr, an optional increment, is an integer. +When integers are supplied, the expression expands to each number between +x and y, inclusive. +Supplied integers may be prefixed with `0' to force each term to have the +same width. +When either x or y begins with a zero, the shell +attempts to force all generated terms to contain the same number of digits, +zero-padding where necessary. +When characters are supplied, the expression expands to each character +lexicographically between x and y, inclusive, +using the default C locale. +Note that both x and y must be of the same type. +When the increment is supplied, it is used as the difference between +each term. The default increment is 1 or -1 as appropriate. +

    + +Brace expansion is performed before any other expansions, +and any characters special to other expansions are preserved +in the result. It is strictly textual. Bash +does not apply any syntactic interpretation to the context of the +expansion or the text between the braces. +To avoid conflicts with parameter expansion, the string `${' +is not considered eligible for brace expansion. +

    + +A correctly-formed brace expansion must contain unquoted opening +and closing braces, and at least one unquoted comma or a valid +sequence expression. +Any incorrectly formed brace expansion is left unchanged. +

    + +A { or `,' may be quoted with a backslash to prevent its +being considered part of a brace expression. +To avoid conflicts with parameter expansion, the string `${' +is not considered eligible for brace expansion. +

    + +This construct is typically used as shorthand when the common +prefix of the strings to be generated is longer than in the +above example: +
     
    mkdir /usr/local/src/bash/{old,new,dist,bugs}
    +
    or +
     
    chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.5.2 Tilde Expansion

    + +

    + +If a word begins with an unquoted tilde character (`~'), all of the +characters up to the first unquoted slash (or all characters, +if there is no unquoted slash) are considered a tilde-prefix. +If none of the characters in the tilde-prefix are quoted, the +characters in the tilde-prefix following the tilde are treated as a +possible login name. +If this login name is the null string, the tilde is replaced with the +value of the HOME shell variable. +If HOME is unset, the home directory of the user executing the +shell is substituted instead. +Otherwise, the tilde-prefix is replaced with the home directory +associated with the specified login name. +

    + +If the tilde-prefix is `~+', the value of +the shell variable PWD replaces the tilde-prefix. +If the tilde-prefix is `~-', the value of the shell variable +OLDPWD, if it is set, is substituted. +

    + +If the characters following the tilde in the tilde-prefix consist of a +number N, optionally prefixed by a `+' or a `-', +the tilde-prefix is replaced with the +corresponding element from the directory stack, as it would be displayed +by the dirs builtin invoked with the characters following tilde +in the tilde-prefix as an argument (see section 6.8 The Directory Stack). +If the tilde-prefix, sans the tilde, consists of a number without a +leading `+' or `-', `+' is assumed. +

    + +If the login name is invalid, or the tilde expansion fails, the word is +left unchanged. +

    + +Each variable assignment is checked for unquoted tilde-prefixes immediately +following a `:' or the first `='. +In these cases, tilde expansion is also performed. +Consequently, one may use filenames with tildes in assignments to +PATH, MAILPATH, and CDPATH, +and the shell assigns the expanded value. +

    + +The following table shows how Bash treats unquoted tilde-prefixes: +

    + +

    +
    ~ +
    The value of $HOME +
    ~/foo +
    `$HOME/foo' +

    + +

    ~fred/foo +
    The subdirectory foo of the home directory of the user +fred +

    + +

    ~+/foo +
    `$PWD/foo' +

    + +

    ~-/foo +
    `${OLDPWD-'~-'}/foo' +

    + +

    ~N +
    The string that would be displayed by `dirs +N' +

    + +

    ~+N +
    The string that would be displayed by `dirs +N' +

    + +

    ~-N +
    The string that would be displayed by `dirs -N' +
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.5.3 Shell Parameter Expansion

    + +

    + +The `$' character introduces parameter expansion, +command substitution, or arithmetic expansion. The parameter name +or symbol to be expanded may be enclosed in braces, which +are optional but serve to protect the variable to be expanded from +characters immediately following it which could be +interpreted as part of the name. +

    + +When braces are used, the matching ending brace is the first `}' +not escaped by a backslash or within a quoted string, and not within an +embedded arithmetic expansion, command substitution, or parameter +expansion. +

    + +The basic form of parameter expansion is ${parameter}. +The value of parameter is substituted. +The parameter is a shell parameter as described above +(see section 3.4 Shell Parameters) or an array reference (see section 6.7 Arrays). +The braces are required when parameter +is a positional parameter with more than one digit, +or when parameter is followed by a character that is not to be +interpreted as part of its name. +

    + +If the first character of parameter is an exclamation point (!), +it introduces a level of variable indirection. +Bash uses the value of the variable formed from the rest of +parameter as the name of the variable; this variable is then +expanded and that value is used in the rest of the substitution, rather +than the value of parameter itself. +This is known as indirect expansion. +The exceptions to this are the expansions of ${!prefix*} +and ${!name[@]} +described below. +The exclamation point must immediately follow the left brace in order to +introduce indirection. +

    + +In each of the cases below, word is subject to tilde expansion, +parameter expansion, command substitution, and arithmetic expansion. +

    + +When not performing substring expansion, using the form described +below (e.g., `:-'), Bash tests for a parameter that is unset or null. +Omitting the colon results in a test only for a parameter that is unset. +Put another way, if the colon is included, +the operator tests for both parameter's existence and that its value +is not null; if the colon is omitted, the operator tests only for existence. +

    + +

    + +
    ${parameter:-word} +
    If parameter is unset or null, the expansion of +word is substituted. Otherwise, the value of +parameter is substituted. +

    + +

    ${parameter:=word} +
    If parameter +is unset or null, the expansion of word +is assigned to parameter. +The value of parameter is then substituted. +Positional parameters and special parameters may not be assigned to +in this way. +

    + +

    ${parameter:?word} +
    If parameter +is null or unset, the expansion of word (or a message +to that effect if word +is not present) is written to the standard error and the shell, if it +is not interactive, exits. Otherwise, the value of parameter is +substituted. +

    + +

    ${parameter:+word} +
    If parameter +is null or unset, nothing is substituted, otherwise the expansion of +word is substituted. +

    + +

    ${parameter:offset} +
    ${parameter:offset:length} +
    This is referred to as Substring Expansion. +It expands to up to length characters of the value of parameter +starting at the character specified by offset. +If parameter is `@', an indexed array subscripted by +`@' or `*', or an associative array name, the results differ as +described below. +If length is omitted, it expands to the substring of the value of +parameter starting at the character specified by offset +and extending to the end of the value. +length and offset are arithmetic expressions +(see section 6.5 Shell Arithmetic). +

    + +If offset evaluates to a number less than zero, the value +is used as an offset in characters +from the end of the value of parameter. +If length evaluates to a number less than zero, +it is interpreted as an offset in characters +from the end of the value of parameter rather than +a number of characters, and the expansion is the characters between +offset and that result. +Note that a negative offset must be separated from the colon by at least +one space to avoid being confused with the `:-' expansion. +

    + +Here are some examples illustrating substring expansion on parameters and +subscripted arrays: +

    + +@verbatim +$ string=01234567890abcdefgh +$ echo ${string:7} +7890abcdefgh +$ echo ${string:7:0} +

    + +$ echo ${string:7:2} +78 +$ echo ${string:7:-2} +7890abcdef +$ echo ${string: -7} +bcdefgh +$ echo ${string: -7:0} +

    + +$ echo ${string: -7:2} +bc +$ echo ${string: -7:-2} +bcdef +$ set -- 01234567890abcdefgh +$ echo ${1:7} +7890abcdefgh +$ echo ${1:7:0} +

    + +$ echo ${1:7:2} +78 +$ echo ${1:7:-2} +7890abcdef +$ echo ${1: -7} +bcdefgh +$ echo ${1: -7:0} +

    + +$ echo ${1: -7:2} +bc +$ echo ${1: -7:-2} +bcdef +$ array[0]=01234567890abcdefgh +$ echo ${array[0]:7} +7890abcdefgh +$ echo ${array[0]:7:0} +

    + +$ echo ${array[0]:7:2} +78 +$ echo ${array[0]:7:-2} +7890abcdef +$ echo ${array[0]: -7} +bcdefgh +$ echo ${array[0]: -7:0} +

    + +$ echo ${array[0]: -7:2} +bc +$ echo ${array[0]: -7:-2} +bcdef +

    + +If parameter is `@', the result is length positional +parameters beginning at offset. +A negative offset is taken relative to one greater than the greatest +positional parameter, so an offset of -1 evaluates to the last positional +parameter. +It is an expansion error if length evaluates to a number less than zero. +

    + +The following examples illustrate substring expansion using positional +parameters: +

    + +@verbatim +$ set -- 1 2 3 4 5 6 7 8 9 0 a b c d e f g h +$ echo ${7} +7 8 9 0 a b c d e f g h +$ echo ${7:0} +

    + +$ echo ${7:2} +7 8 +$ echo ${7:-2} +bash: -2: substring expression < 0 +$ echo ${ -7:2} +b c +$ echo ${0} +./bash 1 2 3 4 5 6 7 8 9 0 a b c d e f g h +$ echo ${0:2} +./bash 1 +$ echo ${ -7:0} +

    + +If parameter is an indexed array name subscripted +by `@' or `*', the result is the length +members of the array beginning with ${parameter[offset]}. +A negative offset is taken relative to one greater than the maximum +index of the specified array. +It is an expansion error if length evaluates to a number less than zero. +

    + +These examples show how you can use substring expansion with indexed +arrays: +

    + +@verbatim +$ array=(0 1 2 3 4 5 6 7 8 9 0 a b c d e f g h) +$ echo ${array[@]:7} +7 8 9 0 a b c d e f g h +$ echo ${array[@]:7:2} +7 8 +$ echo ${array[@]: -7:2} +b c +$ echo ${array[@]: -7:-2} +bash: -2: substring expression < 0 +$ echo ${array[@]:0} +0 1 2 3 4 5 6 7 8 9 0 a b c d e f g h +$ echo ${array[@]:0:2} +0 1 +$ echo ${array[@]: -7:0} +

    + +Substring expansion applied to an associative array produces undefined +results. +

    + +Substring indexing is zero-based unless the positional parameters +are used, in which case the indexing starts at 1 by default. +If offset is 0, and the positional parameters are used, $@ is +prefixed to the list. +

    + +

    ${!prefix*} +
    ${!prefix@} +
    Expands to the names of variables whose names begin with prefix, +separated by the first character of the IFS special variable. +When `@' is used and the expansion appears within double quotes, each +variable name expands to a separate word. +

    + +

    ${!name[@]} +
    ${!name[*]} +
    If name is an array variable, expands to the list of array indices +(keys) assigned in name. +If name is not an array, expands to 0 if name is set and null +otherwise. +When `@' is used and the expansion appears within double quotes, each +key expands to a separate word. +

    + +

    ${#parameter} +
    The length in characters of the expanded value of parameter is +substituted. +If parameter is `*' or `@', the value substituted +is the number of positional parameters. +If parameter is an array name subscripted by `*' or `@', +the value substituted is the number of elements in the array. +If parameter +is an indexed array name subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +parameter, so negative indices count back from the end of the +array, and an index of -1 references the last element. +

    + +

    ${parameter#word} +
    ${parameter##word} +
    The word +is expanded to produce a pattern just as in filename +expansion (see section 3.5.8 Filename Expansion). If the pattern matches +the beginning of the expanded value of parameter, +then the result of the expansion is the expanded value of parameter +with the shortest matching pattern (the `#' case) or the +longest matching pattern (the `##' case) deleted. +If parameter is `@' or `*', +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If parameter is an array variable subscripted with +`@' or `*', +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +

    + +

    ${parameter%word} +
    ${parameter%%word} +
    The word is expanded to produce a pattern just as in +filename expansion. +If the pattern matches a trailing portion of the expanded value of +parameter, then the result of the expansion is the value of +parameter with the shortest matching pattern (the `%' case) +or the longest matching pattern (the `%%' case) deleted. +If parameter is `@' or `*', +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If parameter +is an array variable subscripted with `@' or `*', +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. +

    + +

    ${parameter/pattern/string} +

    + +The pattern is expanded to produce a pattern just as in +filename expansion. +Parameter is expanded and the longest match of pattern +against its value is replaced with string. +If pattern begins with `/', all matches of pattern are +replaced with string. Normally only the first match is replaced. +If pattern begins with `#', it must match at the beginning +of the expanded value of parameter. +If pattern begins with `%', it must match at the end +of the expanded value of parameter. +If string is null, matches of pattern are deleted +and the / following pattern may be omitted. +If parameter is `@' or `*', +the substitution operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If parameter +is an array variable subscripted with `@' or `*', +the substitution operation is applied to each member of the +array in turn, and the expansion is the resultant list. +

    + +

    ${parameter^pattern} +
    ${parameter^^pattern} +
    ${parameter,pattern} +
    ${parameter,,pattern} +
    This expansion modifies the case of alphabetic characters in parameter. +The pattern is expanded to produce a pattern just as in +filename expansion. +Each character in the expanded value of parameter is tested against +pattern, and, if it matches the pattern, its case is converted. +The pattern should not attempt to match more than one character. +The `^' operator converts lowercase letters matching pattern +to uppercase; the `,' operator converts matching uppercase letters +to lowercase. +The `^^' and `,,' expansions convert each matched character in the +expanded value; the `^' and `,' expansions match and convert only +the first character in the expanded value. +If pattern is omitted, it is treated like a `?', which matches +every character. +If parameter is `@' or `*', +the case modification operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If parameter +is an array variable subscripted with `@' or `*', +the case modification operation is applied to each member of the +array in turn, and the expansion is the resultant list. +
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.5.4 Command Substitution

    + +

    + +Command substitution allows the output of a command to replace +the command itself. +Command substitution occurs when a command is enclosed as follows: +
     
    $(command)
    +
    or +
     
    `command`
    +

    + +Bash performs the expansion by executing command and +replacing the command substitution with the standard output of the +command, with any trailing newlines deleted. +Embedded newlines are not deleted, but they may be removed during +word splitting. +The command substitution $(cat file) can be +replaced by the equivalent but faster $(< file). +

    + +When the old-style backquote form of substitution is used, +backslash retains its literal meaning except when followed by +`$', ``', or `\'. +The first backquote not preceded by a backslash terminates the +command substitution. +When using the $(command) form, all characters between +the parentheses make up the command; none are treated specially. +

    + +Command substitutions may be nested. To nest when using the backquoted +form, escape the inner backquotes with backslashes. +

    + +If the substitution appears within double quotes, word splitting and +filename expansion are not performed on the results. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.5.5 Arithmetic Expansion

    + +

    + +Arithmetic expansion allows the evaluation of an arithmetic expression +and the substitution of the result. The format for arithmetic expansion is: +

    + +
     
    $(( expression ))
    +

    + +The expression is treated as if it were within double quotes, but +a double quote inside the parentheses is not treated specially. +All tokens in the expression undergo parameter and variable expansion, +command substitution, and quote removal. +The result is treated as the arithmetic expression to be evaluated. +Arithmetic expansions may be nested. +

    + +The evaluation is performed according to the rules listed below +(see section 6.5 Shell Arithmetic). +If the expression is invalid, Bash prints a message indicating +failure to the standard error and no substitution occurs. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.5.6 Process Substitution

    + +

    + +Process substitution is supported on systems that support named +pipes (FIFOs) or the `/dev/fd' method of naming open files. +It takes the form of +
     
    <(list)
    +
    or +
     
    >(list)
    +
    The process list is run with its input or output connected to a +FIFO or some file in `/dev/fd'. The name of this file is +passed as an argument to the current command as the result of the +expansion. If the >(list) form is used, writing to +the file will provide input for list. If the +<(list) form is used, the file passed as an +argument should be read to obtain the output of list. +Note that no space may appear between the < or > +and the left parenthesis, otherwise the construct would be interpreted +as a redirection. +

    + +When available, process substitution is performed simultaneously with +parameter and variable expansion, command substitution, and arithmetic +expansion. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.5.7 Word Splitting

    + +

    + +The shell scans the results of parameter expansion, command substitution, +and arithmetic expansion that did not occur within double quotes for +word splitting. +

    + +The shell treats each character of $IFS as a delimiter, and splits +the results of the other expansions into words using these characters +as field terminators. +If IFS is unset, or its value is exactly <space><tab><newline>, +the default, then sequences of + <space>, <tab>, and <newline> +at the beginning and end of the results of the previous +expansions are ignored, and any sequence of IFS +characters not at the beginning or end serves to delimit words. +If IFS has a value other than the default, then sequences of +the whitespace characters space and tab +are ignored at the beginning and end of the +word, as long as the whitespace character is in the +value of IFS (an IFS whitespace character). +Any character in IFS that is not IFS +whitespace, along with any adjacent IFS +whitespace characters, delimits a field. A sequence of IFS +whitespace characters is also treated as a delimiter. +If the value of IFS is null, no word splitting occurs. +

    + +Explicit null arguments ("" or ") are retained. +Unquoted implicit null arguments, resulting from the expansion of +parameters that have no values, are removed. +If a parameter with no value is expanded within double quotes, a +null argument results and is retained. +

    + +Note that if no expansion occurs, no splitting +is performed. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.5.8 Filename Expansion

    + +
    + +
    3.5.8.1 Pattern Matching  How the shell matches patterns.
    + + + + +

    + +After word splitting, unless the `-f' option has been set +(see section 4.3.1 The Set Builtin), Bash scans each word for the characters +`*', `?', and `['. +If one of these characters appears, then the word is +regarded as a pattern, +and replaced with an alphabetically sorted list of +filenames matching the pattern (see section 3.5.8.1 Pattern Matching). +If no matching filenames are found, +and the shell option nullglob is disabled, the word is left +unchanged. +If the nullglob option is set, and no matches are found, the word +is removed. +If the failglob shell option is set, and no matches are found, +an error message is printed and the command is not executed. +If the shell option nocaseglob is enabled, the match is performed +without regard to the case of alphabetic characters. +

    + +When a pattern is used for filename expansion, the character `.' +at the start of a filename or immediately following a slash +must be matched explicitly, unless the shell option dotglob is set. +When matching a filename, the slash character must always be +matched explicitly. +In other cases, the `.' character is not treated specially. +

    + +See the description of shopt in 4.3.2 The Shopt Builtin, +for a description of the nocaseglob, nullglob, +failglob, and dotglob options. +

    + +The GLOBIGNORE +shell variable may be used to restrict the set of filenames matching a +pattern. If GLOBIGNORE +is set, each matching filename that also matches one of the patterns in +GLOBIGNORE is removed from the list of matches. The filenames +`.' and `..' +are always ignored when GLOBIGNORE +is set and not null. +However, setting GLOBIGNORE to a non-null value has the effect of +enabling the dotglob +shell option, so all other filenames beginning with a +`.' will match. +To get the old behavior of ignoring filenames beginning with a +`.', make `.*' one of the patterns in GLOBIGNORE. +The dotglob option is disabled when GLOBIGNORE +is unset. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.5.8.1 Pattern Matching

    + +

    + +Any character that appears in a pattern, other than the special pattern +characters described below, matches itself. +The NUL character may not occur in a pattern. +A backslash escapes the following character; the +escaping backslash is discarded when matching. +The special pattern characters must be quoted if they are to be matched +literally. +

    + +The special pattern characters have the following meanings: +

    +
    * +
    Matches any string, including the null string. +When the globstar shell option is enabled, and `*' is used in +a filename expansion context, two adjacent `*'s used as a single +pattern will match all files and zero or more directories and +subdirectories. +If followed by a `/', two adjacent `*'s will match only +directories and subdirectories. +
    ? +
    Matches any single character. +
    [...] +
    Matches any one of the enclosed characters. A pair of characters +separated by a hyphen denotes a range expression; +any character that falls between those two characters, inclusive, +using the current locale's collating sequence and character set, +is matched. If the first character following the +`[' is a `!' or a `^' +then any character not enclosed is matched. A `-' +may be matched by including it as the first or last character +in the set. A `]' may be matched by including it as the first +character in the set. +The sorting order of characters in range expressions is determined by +the current locale and the values of the +LC_COLLATE and LC_ALL shell variables, if set. +

    + +For example, in the default C locale, `[a-dx-z]' is equivalent to +`[abcdxyz]'. Many locales sort characters in dictionary order, and in +these locales `[a-dx-z]' is typically not equivalent to `[abcdxyz]'; +it might be equivalent to `[aBbCcDdxXyYz]', for example. To obtain +the traditional interpretation of ranges in bracket expressions, you can +force the use of the C locale by setting the LC_COLLATE or +LC_ALL environment variable to the value `C', or enable the +globasciiranges shell option. +

    + +Within `[' and `]', character classes can be specified +using the syntax +[:class:], where class is one of the +following classes defined in the POSIX standard: +
     
    alnum   alpha   ascii   blank   cntrl   digit   graph   lower
    +print   punct   space   upper   word    xdigit
    +
    A character class matches any character belonging to that class. +The word character class matches letters, digits, and the character +`_'. +

    + +Within `[' and `]', an equivalence class can be +specified using the syntax [=c=], which +matches all characters with the same collation weight (as defined +by the current locale) as the character c. +

    + +Within `[' and `]', the syntax [.symbol.] +matches the collating symbol symbol. +

    +

    + +If the extglob shell option is enabled using the shopt +builtin, several extended pattern matching operators are recognized. +In the following description, a pattern-list is a list of one +or more patterns separated by a `|'. +Composite patterns may be formed using one or more of the following +sub-patterns: +

    + +

    +
    ?(pattern-list) +
    Matches zero or one occurrence of the given patterns. +

    + +

    *(pattern-list) +
    Matches zero or more occurrences of the given patterns. +

    + +

    +(pattern-list) +
    Matches one or more occurrences of the given patterns. +

    + +

    @(pattern-list) +
    Matches one of the given patterns. +

    + +

    !(pattern-list) +
    Matches anything except one of the given patterns. +
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.5.9 Quote Removal

    + +

    + +After the preceding expansions, all unquoted occurrences of the +characters `\', `'', and `"' that did not +result from one of the above expansions are removed. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.6 Redirections

    + +

    + +Before a command is executed, its input and output +may be redirected +using a special notation interpreted by the shell. +Redirection allows commands' file handles to be +duplicated, opened, closed, +made to refer to different files, +and can change the files the command reads from and writes to. +Redirection may also be used to modify file handles in the +current shell execution environment. The following redirection +operators may precede or appear anywhere within a +simple command or may follow a command. +Redirections are processed in the order they appear, from +left to right. +

    + +Each redirection that may be preceded by a file descriptor number +may instead be preceded by a word of the form {varname}. +In this case, for each redirection operator except +>&- and <&-, the shell will allocate a file descriptor greater +than 10 and assign it to {varname}. If >&- or <&- is preceded +by {varname}, the value of varname defines the file +descriptor to close. +

    + +In the following descriptions, if the file descriptor number is +omitted, and the first character of the redirection operator is +`<', the redirection refers to the standard input (file +descriptor 0). If the first character of the redirection operator +is `>', the redirection refers to the standard output (file +descriptor 1). +

    + +The word following the redirection operator in the following +descriptions, unless otherwise noted, is subjected to brace expansion, +tilde expansion, parameter expansion, command substitution, arithmetic +expansion, quote removal, filename expansion, and word splitting. +If it expands to more than one word, Bash reports an error. +

    + +Note that the order of redirections is significant. For example, +the command +
     
    ls > dirlist 2>&1
    +
    directs both standard output (file descriptor 1) and standard error +(file descriptor 2) to the file dirlist, while the command +
     
    ls 2>&1 > dirlist
    +
    directs only the standard output to file dirlist, +because the standard error was made a copy of the standard output +before the standard output was redirected to dirlist. +

    + +Bash handles several filenames specially when they are used in +redirections, as described in the following table: +

    + +

    +
    /dev/fd/fd +
    If fd is a valid integer, file descriptor fd is duplicated. +

    + +

    /dev/stdin +
    File descriptor 0 is duplicated. +

    + +

    /dev/stdout +
    File descriptor 1 is duplicated. +

    + +

    /dev/stderr +
    File descriptor 2 is duplicated. +

    + +

    /dev/tcp/host/port +
    If host is a valid hostname or Internet address, and port +is an integer port number or service name, Bash attempts to open +the corresponding TCP socket. +

    + +

    /dev/udp/host/port +
    If host is a valid hostname or Internet address, and port +is an integer port number or service name, Bash attempts to open +the corresponding UDP socket. +
    +

    + +A failure to open or create a file causes the redirection to fail. +

    + +Redirections using file descriptors greater than 9 should be used with +care, as they may conflict with file descriptors the shell uses +internally. +

    + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.6.1 Redirecting Input

    + +Redirection of input causes the file whose name results from +the expansion of word +to be opened for reading on file descriptor n, +or the standard input (file descriptor 0) if n +is not specified. +

    + +The general format for redirecting input is: +
     
    [n]<word
    +

    + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.6.2 Redirecting Output

    + +Redirection of output causes the file whose name results from +the expansion of word +to be opened for writing on file descriptor n, +or the standard output (file descriptor 1) if n +is not specified. If the file does not exist it is created; +if it does exist it is truncated to zero size. +

    + +The general format for redirecting output is: +
     
    [n]>[|]word
    +

    + +If the redirection operator is `>', and the noclobber +option to the set builtin has been enabled, the redirection +will fail if the file whose name results from the expansion of +word exists and is a regular file. +If the redirection operator is `>|', or the redirection operator is +`>' and the noclobber option is not enabled, the redirection +is attempted even if the file named by word exists. +

    + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.6.3 Appending Redirected Output

    + +Redirection of output in this fashion +causes the file whose name results from +the expansion of word +to be opened for appending on file descriptor n, +or the standard output (file descriptor 1) if n +is not specified. If the file does not exist it is created. +

    + +The general format for appending output is: +
     
    [n]>>word
    +

    + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.6.4 Redirecting Standard Output and Standard Error

    + +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be redirected to the file whose name is the +expansion of word. +

    + +There are two formats for redirecting standard output and +standard error: +
     
    &>word
    +
    and +
     
    >&word
    +
    Of the two forms, the first is preferred. +This is semantically equivalent to +
     
    >word 2>&1
    +
    When using the second form, word may not expand to a number or +`-'. If it does, other redirection operators apply +(see Duplicating File Descriptors below) for compatibility reasons. +

    + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.6.5 Appending Standard Output and Standard Error

    + +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be appended to the file whose name is the +expansion of word. +

    + +The format for appending standard output and standard error is: +
     
    &>>word
    +
    This is semantically equivalent to +
     
    >>word 2>&1
    +
    (see Duplicating File Descriptors below). +

    + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.6.6 Here Documents

    + +This type of redirection instructs the shell to read input from the +current source until a line containing only word +(with no trailing blanks) is seen. All of +the lines read up to that point are then used as the standard +input for a command. +

    + +The format of here-documents is: +
     
    <<[-]word
    +        here-document
    +delimiter
    +

    + +No parameter and variable expansion, command substitution, +arithmetic expansion, or filename expansion is performed on +word. If any characters in word are quoted, the +delimiter is the result of quote removal on word, +and the lines in the here-document are not expanded. +If word is unquoted, +all lines of the here-document are subjected to +parameter expansion, command substitution, and arithmetic expansion, +the character sequence \newline is ignored, and `\' +must be used to quote the characters +`\', `$', and ``'. +

    + +If the redirection operator is `<<-', +then all leading tab characters are stripped from input lines and the +line containing delimiter. +This allows here-documents within shell scripts to be indented in a +natural fashion. +

    + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.6.7 Here Strings

    + +A variant of here documents, the format is: +
     
    <<< word
    +

    + +The word undergoes +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote removal. +Pathname expansion and word splitting are not performed. +The result is supplied as a single string to the command on its +standard input. +

    + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.6.8 Duplicating File Descriptors

    + +The redirection operator +
     
    [n]<&word
    +
    is used to duplicate input file descriptors. +If word +expands to one or more digits, the file descriptor denoted by n +is made to be a copy of that file descriptor. +If the digits in word do not specify a file descriptor open for +input, a redirection error occurs. +If word +evaluates to `-', file descriptor n is closed. +If n is not specified, the standard input (file descriptor 0) is used. +

    + +The operator +
     
    [n]>&word
    +
    is used similarly to duplicate output file descriptors. If +n is not specified, the standard output (file descriptor 1) is used. +If the digits in word do not specify a file descriptor open for +output, a redirection error occurs. +If word +evaluates to `-', file descriptor n is closed. +As a special case, if n is omitted, and word does not +expand to one or more digits or `-', the standard output and standard +error are redirected as described previously. +

    + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.6.9 Moving File Descriptors

    + +The redirection operator +
     
    [n]<&digit-
    +
    moves the file descriptor digit to file descriptor n, +or the standard input (file descriptor 0) if n is not specified. +digit is closed after being duplicated to n. +

    + +Similarly, the redirection operator +
     
    [n]>&digit-
    +
    moves the file descriptor digit to file descriptor n, +or the standard output (file descriptor 1) if n is not specified. +

    + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.6.10 Opening File Descriptors for Reading and Writing

    + +The redirection operator +
     
    [n]<>word
    +
    causes the file whose name is the expansion of word +to be opened for both reading and writing on file descriptor +n, or on file descriptor 0 if n +is not specified. If the file does not exist, it is created. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.7 Executing Commands

    + +

    + +

    + + + + + + +
    3.7.1 Simple Command Expansion  How Bash expands simple commands before + executing them.
    3.7.2 Command Search and Execution  How Bash finds commands and runs them.
    3.7.3 Command Execution Environment  The environment in which Bash + executes commands that are not + shell builtins.
    3.7.4 Environment  The environment given to a command.
    3.7.5 Exit Status  The status returned by commands and how Bash + interprets it.
    3.7.6 Signals  What happens when Bash or a command it runs + receives a signal.
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.7.1 Simple Command Expansion

    + +

    + +When a simple command is executed, the shell performs the following +expansions, assignments, and redirections, from left to right. +

    + +

      +
    1. +The words that the parser has marked as variable assignments (those +preceding the command name) and redirections are saved for later +processing. +

      + +

    2. +The words that are not variable assignments or redirections are +expanded (see section 3.5 Shell Expansions). +If any words remain after expansion, the first word +is taken to be the name of the command and the remaining words are +the arguments. +

      + +

    3. +Redirections are performed as described above (see section 3.6 Redirections). +

      + +

    4. +The text after the `=' in each variable assignment undergoes tilde +expansion, parameter expansion, command substitution, arithmetic expansion, +and quote removal before being assigned to the variable. +
    +

    + +If no command name results, the variable assignments affect the current +shell environment. Otherwise, the variables are added to the environment +of the executed command and do not affect the current shell environment. +If any of the assignments attempts to assign a value to a readonly variable, +an error occurs, and the command exits with a non-zero status. +

    + +If no command name results, redirections are performed, but do not +affect the current shell environment. A redirection error causes the +command to exit with a non-zero status. +

    + +If there is a command name left after expansion, execution proceeds as +described below. Otherwise, the command exits. If one of the expansions +contained a command substitution, the exit status of the command is +the exit status of the last command substitution performed. If there +were no command substitutions, the command exits with a status of zero. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.7.2 Command Search and Execution

    + +

    + +After a command has been split into words, if it results in a +simple command and an optional list of arguments, the following +actions are taken. +

    + +

      +
    1. +If the command name contains no slashes, the shell attempts to +locate it. If there exists a shell function by that name, that +function is invoked as described in 3.3 Shell Functions. +

      + +

    2. +If the name does not match a function, the shell searches for +it in the list of shell builtins. If a match is found, that +builtin is invoked. +

      + +

    3. +If the name is neither a shell function nor a builtin, +and contains no slashes, Bash searches each element of +$PATH for a directory containing an executable file +by that name. Bash uses a hash table to remember the full +pathnames of executable files to avoid multiple PATH searches +(see the description of hash in 4.1 Bourne Shell Builtins). +A full search of the directories in $PATH +is performed only if the command is not found in the hash table. +If the search is unsuccessful, the shell searches for a defined shell +function named command_not_found_handle. +If that function exists, it is invoked with the original command and +the original command's arguments as its arguments, and the function's +exit status becomes the exit status of the shell. +If that function is not defined, the shell prints an error +message and returns an exit status of 127. +

      + +

    4. +If the search is successful, or if the command name contains +one or more slashes, the shell executes the named program in +a separate execution environment. +Argument 0 is set to the name given, and the remaining arguments +to the command are set to the arguments supplied, if any. +

      + +

    5. +If this execution fails because the file is not in executable +format, and the file is not a directory, it is assumed to be a +shell script and the shell executes it as described in +3.8 Shell Scripts. +

      + +

    6. +If the command was not begun asynchronously, the shell waits for +the command to complete and collects its exit status. +

      + +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.7.3 Command Execution Environment

    + +

    + +The shell has an execution environment, which consists of the +following: +

    + +

      +
    • +open files inherited by the shell at invocation, as modified by +redirections supplied to the exec builtin +

      + +

    • +the current working directory as set by cd, pushd, or +popd, or inherited by the shell at invocation +

      + +

    • +the file creation mode mask as set by umask or inherited from +the shell's parent +

      + +

    • +current traps set by trap +

      + +

    • +shell parameters that are set by variable assignment or with set +or inherited from the shell's parent in the environment +

      + +

    • +shell functions defined during execution or inherited from the shell's +parent in the environment +

      + +

    • +options enabled at invocation (either by default or with command-line +arguments) or by set +

      + +

    • +options enabled by shopt (see section 4.3.2 The Shopt Builtin) +

      + +

    • +shell aliases defined with alias (see section 6.6 Aliases) +

      + +

    • +various process IDs, including those of background jobs +(see section 3.2.3 Lists of Commands), the value of $$, and the value of +$PPID +

      + +

    +

    + +When a simple command other than a builtin or shell function +is to be executed, it +is invoked in a separate execution environment that consists of +the following. Unless otherwise noted, the values are inherited +from the shell. +

    + +

      +
    • +the shell's open files, plus any modifications and additions specified +by redirections to the command +

      + +

    • +the current working directory +

      + +

    • +the file creation mode mask +

      + +

    • +shell variables and functions marked for export, along with variables +exported for the command, passed in the environment (see section 3.7.4 Environment) +

      + +

    • +traps caught by the shell are reset to the values inherited from the +shell's parent, and traps ignored by the shell are ignored +

      + +

    +

    + +A command invoked in this separate environment cannot affect the +shell's execution environment. +

    + +Command substitution, commands grouped with parentheses, +and asynchronous commands are invoked in a +subshell environment that is a duplicate of the shell environment, +except that traps caught by the shell are reset to the values +that the shell inherited from its parent at invocation. Builtin +commands that are invoked as part of a pipeline are also executed +in a subshell environment. Changes made to the subshell environment +cannot affect the shell's execution environment. +

    + +Subshells spawned to execute command substitutions inherit the value of +the `-e' option from the parent shell. When not in POSIX mode, +Bash clears the `-e' option in such subshells. +

    + +If a command is followed by a `&' and job control is not active, the +default standard input for the command is the empty file `/dev/null'. +Otherwise, the invoked command inherits the file descriptors of the calling +shell as modified by redirections. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.7.4 Environment

    + +

    + +When a program is invoked it is given an array of strings +called the environment. +This is a list of name-value pairs, of the form name=value. +

    + +Bash provides several ways to manipulate the environment. +On invocation, the shell scans its own environment and +creates a parameter for each name found, automatically marking +it for export +to child processes. Executed commands inherit the environment. +The export and `declare -x' +commands allow parameters and functions to be added to and +deleted from the environment. If the value of a parameter +in the environment is modified, the new value becomes part +of the environment, replacing the old. The environment +inherited by any executed command consists of the shell's +initial environment, whose values may be modified in the shell, +less any pairs removed by the unset and `export -n' +commands, plus any additions via the export and +`declare -x' commands. +

    + +The environment for any simple command +or function may be augmented temporarily by prefixing it with +parameter assignments, as described in 3.4 Shell Parameters. +These assignment statements affect only the environment seen +by that command. +

    + +If the `-k' option is set (see section 4.3.1 The Set Builtin), then all +parameter assignments are placed in the environment for a command, +not just those that precede the command name. +

    + +When Bash invokes an external command, the variable `$_' +is set to the full pathname of the command and passed to that +command in its environment. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.7.5 Exit Status

    + +

    + +The exit status of an executed command is the value returned by the +waitpid system call or equivalent function. Exit statuses +fall between 0 and 255, though, as explained below, the shell may +use values above 125 specially. Exit statuses from shell builtins and +compound commands are also limited to this range. Under certain +circumstances, the shell will use special values to indicate specific +failure modes. +

    + +For the shell's purposes, a command which exits with a +zero exit status has succeeded. +A non-zero exit status indicates failure. +This seemingly counter-intuitive scheme is used so there +is one well-defined way to indicate success and a variety of +ways to indicate various failure modes. +When a command terminates on a fatal signal whose number is N, +Bash uses the value 128+N as the exit status. +

    + +If a command is not found, the child process created to +execute it returns a status of 127. If a command is found +but is not executable, the return status is 126. +

    + +If a command fails because of an error during expansion or redirection, +the exit status is greater than zero. +

    + +The exit status is used by the Bash conditional commands +(see section 3.2.4.2 Conditional Constructs) and some of the list +constructs (see section 3.2.3 Lists of Commands). +

    + +All of the Bash builtins return an exit status of zero if they succeed +and a non-zero status on failure, so they may be used by the +conditional and list constructs. +All builtins return an exit status of 2 to indicate incorrect usage. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.7.6 Signals

    + +

    + +When Bash is interactive, in the absence of any traps, it ignores +SIGTERM (so that `kill 0' does not kill an interactive shell), +and SIGINT +is caught and handled (so that the wait builtin is interruptible). +When Bash receives a SIGINT, it breaks out of any executing loops. +In all cases, Bash ignores SIGQUIT. +If job control is in effect (see section 7. Job Control), Bash +ignores SIGTTIN, SIGTTOU, and SIGTSTP. +

    + +Non-builtin commands started by Bash have signal handlers set to the +values inherited by the shell from its parent. +When job control is not in effect, asynchronous commands +ignore SIGINT and SIGQUIT in addition to these inherited +handlers. +Commands run as a result of +command substitution ignore the keyboard-generated job control signals +SIGTTIN, SIGTTOU, and SIGTSTP. +

    + +The shell exits by default upon receipt of a SIGHUP. +Before exiting, an interactive shell resends the SIGHUP to +all jobs, running or stopped. +Stopped jobs are sent SIGCONT to ensure that they receive +the SIGHUP. +To prevent the shell from sending the SIGHUP signal to a +particular job, it should be removed +from the jobs table with the disown +builtin (see section 7.2 Job Control Builtins) or marked +to not receive SIGHUP using disown -h. +

    + +If the huponexit shell option has been set with shopt +(see section 4.3.2 The Shopt Builtin), Bash sends a SIGHUP to all jobs when +an interactive login shell exits. +

    + +If Bash is waiting for a command to complete and receives a signal +for which a trap has been set, the trap will not be executed until +the command completes. +When Bash is waiting for an asynchronous +command via the wait builtin, the reception of a signal for +which a trap has been set will cause the wait builtin to return +immediately with an exit status greater than 128, immediately after +which the trap is executed. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    3.8 Shell Scripts

    + +

    + +A shell script is a text file containing shell commands. When such +a file is used as the first non-option argument when invoking Bash, +and neither the `-c' nor `-s' option is supplied +(see section 6.1 Invoking Bash), +Bash reads and executes commands from the file, then exits. This +mode of operation creates a non-interactive shell. The shell first +searches for the file in the current directory, and looks in the +directories in $PATH if not found there. +

    + +When Bash runs +a shell script, it sets the special parameter 0 to the name +of the file, rather than the name of the shell, and the positional +parameters are set to the remaining arguments, if any are given. +If no additional arguments are supplied, the positional parameters +are unset. +

    + +A shell script may be made executable by using the chmod command +to turn on the execute bit. When Bash finds such a file while +searching the $PATH for a command, it spawns a subshell to +execute it. In other words, executing +
     
    filename arguments
    +
    is equivalent to executing +
     
    bash filename arguments
    +

    + +if filename is an executable shell script. +This subshell reinitializes itself, so that the effect is as if a +new shell had been invoked to interpret the script, with the +exception that the locations of commands remembered by the parent +(see the description of hash in 4.1 Bourne Shell Builtins) +are retained by the child. +

    + +Most versions of Unix make this a part of the operating system's command +execution mechanism. If the first line of a script begins with +the two characters `#!', the remainder of the line specifies +an interpreter for the program. +Thus, you can specify Bash, awk, Perl, or some other +interpreter and write the rest of the script file in that language. +

    + +The arguments to the interpreter +consist of a single optional argument following the interpreter +name on the first line of the script file, followed by the name of +the script file, followed by the rest of the arguments. Bash +will perform this action on operating systems that do not handle it +themselves. Note that some older versions of Unix limit the interpreter +name and argument to a maximum of 32 characters. +

    + +Bash scripts often begin with #! /bin/bash (assuming that +Bash has been installed in `/bin'), since this ensures that +Bash will be used to interpret the script, even if it is executed +under another shell. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    4. Shell Builtin Commands

    + +

    + +

    + + + + +
    4.1 Bourne Shell Builtins  Builtin commands inherited from the Bourne + Shell.
    4.2 Bash Builtin Commands  Table of builtins specific to Bash.
    4.3 Modifying Shell Behavior  Builtins to modify shell attributes and + optional behavior.
    4.4 Special Builtins  Builtin commands classified specially by + POSIX.
    +

    + +Builtin commands are contained within the shell itself. +When the name of a builtin command is used as the first word of +a simple command (see section 3.2.1 Simple Commands), the shell executes +the command directly, without invoking another program. +Builtin commands are necessary to implement functionality impossible +or inconvenient to obtain with separate utilities. +

    + +This section briefly describes the builtins which Bash inherits from +the Bourne Shell, as well as the builtin commands which are unique +to or have been extended in Bash. +

    + +Several builtin commands are described in other chapters: builtin +commands which provide the Bash interface to the job control +facilities (see section 7.2 Job Control Builtins), the directory stack +(see section 6.8.1 Directory Stack Builtins), the command history +(see section 9.2 Bash History Builtins), and the programmable completion +facilities (see section 8.7 Programmable Completion Builtins). +

    + +Many of the builtins have been extended by POSIX or Bash. +

    + +Unless otherwise noted, each builtin command documented as accepting +options preceded by `-' accepts `--' +to signify the end of the options. +The :, true, false, and test +builtins do not accept options and do not treat `--' specially. +The exit, logout, break, continue, let, +and shift builtins accept and process arguments beginning +with `-' without requiring `--'. +Other builtins that accept arguments but are not specified as accepting +options interpret arguments beginning with `-' as invalid options and +require `--' to prevent this interpretation. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    4.1 Bourne Shell Builtins

    + +

    + +The following shell builtin commands are inherited from the Bourne Shell. +These commands are implemented as specified by the POSIX standard. +

    + +

    +
    : (a colon) +
    +
     
    : [arguments]
    +

    + +Do nothing beyond expanding arguments and performing redirections. +The return status is zero. +

    + +

    . (a period) +
    +
     
    . filename [arguments]
    +

    + +Read and execute commands from the filename argument in the +current shell context. If filename does not contain a slash, +the PATH variable is used to find filename. +When Bash is not in POSIX mode, the current directory is searched +if filename is not found in $PATH. +If any arguments are supplied, they become the positional +parameters when filename is executed. Otherwise the positional +parameters are unchanged. +The return status is the exit status of the last command executed, or +zero if no commands are executed. If filename is not found, or +cannot be read, the return status is non-zero. +This builtin is equivalent to source. +

    + +

    break +
    +
     
    break [n]
    +

    + +Exit from a for, while, until, or select loop. +If n is supplied, the nth enclosing loop is exited. +n must be greater than or equal to 1. +The return status is zero unless n is not greater than or equal to 1. +

    + +

    cd +
    +
     
    cd [-L|[-P [-e]] [-@] [directory]
    +

    + +Change the current working directory to directory. +If directory is not supplied, the value of the HOME +shell variable is used. +Any additional arguments following directory are ignored. +If the shell variable +CDPATH exists, it is used as a search path: +each directory name in CDPATH is searched for +directory, with alternative directory names in CDPATH +separated by a colon (`:'). +If directory begins with a slash, CDPATH is not used. +

    + +The `-P' option means to not follow symbolic links: symbolic links +are resolved while cd is traversing directory and before +processing an instance of `..' in directory. +

    + +By default, or when the `-L' option is supplied, symbolic links +in directory are resolved after cd processes an instance +of `..' in directory. +

    + +If `..' appears in directory, it is processed by removing the +immediately preceding pathname component, back to a slash or the beginning +of directory. +

    + +If the `-e' option is supplied with `-P' +and the current working directory cannot be successfully determined +after a successful directory change, cd will return an unsuccessful +status. +

    + +On systems that support it, the `-@' option presents the extended +attributes associated with a file as a directory. +

    + +If directory is `-', it is converted to $OLDPWD +before the directory change is attempted. +

    + +If a non-empty directory name from CDPATH is used, or if +`-' is the first argument, and the directory change is +successful, the absolute pathname of the new working directory is +written to the standard output. +

    + +The return status is zero if the directory is successfully changed, +non-zero otherwise. +

    + +

    continue +
    +
     
    continue [n]
    +

    + +Resume the next iteration of an enclosing for, while, +until, or select loop. +If n is supplied, the execution of the nth enclosing loop +is resumed. +n must be greater than or equal to 1. +The return status is zero unless n is not greater than or equal to 1. +

    + +

    eval +
    +
     
    eval [arguments]
    +

    + +The arguments are concatenated together into a single command, which is +then read and executed, and its exit status returned as the exit status +of eval. +If there are no arguments or only empty arguments, the return status is +zero. +

    + +

    exec +
    +
     
    exec [-cl] [-a name] [command [arguments]]
    +

    + +If command +is supplied, it replaces the shell without creating a new process. +If the `-l' option is supplied, the shell places a dash at the +beginning of the zeroth argument passed to command. +This is what the login program does. +The `-c' option causes command to be executed with an empty +environment. +If `-a' is supplied, the shell passes name as the zeroth +argument to command. +If command +cannot be executed for some reason, a non-interactive shell exits, +unless the execfail shell option +is enabled. In that case, it returns failure. +An interactive shell returns failure if the file cannot be executed. +If no command is specified, redirections may be used to affect +the current shell environment. If there are no redirection errors, the +return status is zero; otherwise the return status is non-zero. +

    + +

    exit +
    +
     
    exit [n]
    +

    + +Exit the shell, returning a status of n to the shell's parent. +If n is omitted, the exit status is that of the last command executed. +Any trap on EXIT is executed before the shell terminates. +

    + +

    export +
    +
     
    export [-fn] [-p] [name[=value]]
    +

    + +Mark each name to be passed to child processes +in the environment. If the `-f' option is supplied, the names +refer to shell functions; otherwise the names refer to shell variables. +The `-n' option means to no longer mark each name for export. +If no names are supplied, or if the `-p' option is given, a +list of names of all exported variables is displayed. +The `-p' option displays output in a form that may be reused as input. +If a variable name is followed by =value, the value of +the variable is set to value. +

    + +The return status is zero unless an invalid option is supplied, one of +the names is not a valid shell variable name, or `-f' is supplied +with a name that is not a shell function. +

    + +

    getopts +
    +
     
    getopts optstring name [args]
    +

    + +getopts is used by shell scripts to parse positional parameters. +optstring contains the option characters to be recognized; if a +character is followed by a colon, the option is expected to have an +argument, which should be separated from it by whitespace. +The colon (`:') and question mark (`?') may not be +used as option characters. +Each time it is invoked, getopts +places the next option in the shell variable name, initializing +name if it does not exist, +and the index of the next argument to be processed into the +variable OPTIND. +OPTIND is initialized to 1 each time the shell or a shell script +is invoked. +When an option requires an argument, +getopts places that argument into the variable OPTARG. +The shell does not reset OPTIND automatically; it must be manually +reset between multiple calls to getopts within the same shell +invocation if a new set of parameters is to be used. +

    + +When the end of options is encountered, getopts exits with a +return value greater than zero. +OPTIND is set to the index of the first non-option argument, +and name is set to `?'. +

    + +getopts +normally parses the positional parameters, but if more arguments are +given in args, getopts parses those instead. +

    + +getopts can report errors in two ways. If the first character of +optstring is a colon, silent +error reporting is used. In normal operation, diagnostic messages +are printed when invalid options or missing option arguments are +encountered. +If the variable OPTERR +is set to 0, no error messages will be displayed, even if the first +character of optstring is not a colon. +

    + +If an invalid option is seen, +getopts places `?' into name and, if not silent, +prints an error message and unsets OPTARG. +If getopts is silent, the option character found is placed in +OPTARG and no diagnostic message is printed. +

    + +If a required argument is not found, and getopts +is not silent, a question mark (`?') is placed in name, +OPTARG is unset, and a diagnostic message is printed. +If getopts is silent, then a colon (`:') is placed in +name and OPTARG is set to the option character found. +

    + +

    hash +
    +
     
    hash [-r] [-p filename] [-dt] [name]
    +

    + +Each time hash is invoked, it remembers the full pathnames of the +commands specified as name arguments, +so they need not be searched for on subsequent invocations. +The commands are found by searching through the directories listed in +$PATH. +Any previously-remembered pathname is discarded. +The `-p' option inhibits the path search, and filename is +used as the location of name. +The `-r' option causes the shell to forget all remembered locations. +The `-d' option causes the shell to forget the remembered location +of each name. +If the `-t' option is supplied, the full pathname to which each +name corresponds is printed. If multiple name arguments are +supplied with `-t' the name is printed before the hashed +full pathname. +The `-l' option causes output to be displayed in a format +that may be reused as input. +If no arguments are given, or if only `-l' is supplied, +information about remembered commands is printed. +The return status is zero unless a name is not found or an invalid +option is supplied. +

    + +

    pwd +
    +
     
    pwd [-LP]
    +

    + +Print the absolute pathname of the current working directory. +If the `-P' option is supplied, the pathname printed will not +contain symbolic links. +If the `-L' option is supplied, the pathname printed may contain +symbolic links. +The return status is zero unless an error is encountered while +determining the name of the current directory or an invalid option +is supplied. +

    + +

    readonly +
    +
     
    readonly [-aAf] [-p] [name[=value]] ...
    +

    + +Mark each name as readonly. +The values of these names may not be changed by subsequent assignment. +If the `-f' option is supplied, each name refers to a shell +function. +The `-a' option means each name refers to an indexed +array variable; the `-A' option means each name refers +to an associative array variable. +If both options are supplied, `-A' takes precedence. +If no name arguments are given, or if the `-p' +option is supplied, a list of all readonly names is printed. +The other options may be used to restrict the output to a subset of +the set of readonly names. +The `-p' option causes output to be displayed in a format that +may be reused as input. +If a variable name is followed by =value, the value of +the variable is set to value. +The return status is zero unless an invalid option is supplied, one of +the name arguments is not a valid shell variable or function name, +or the `-f' option is supplied with a name that is not a shell function. +

    + +

    return +
    +
     
    return [n]
    +

    + +Cause a shell function to stop executing and return the value n +to its caller. +If n is not supplied, the return value is the exit status of the +last command executed in the function. +return may also be used to terminate execution of a script +being executed with the . (source) builtin, +returning either n or +the exit status of the last command executed within the script as the exit +status of the script. +If n is supplied, the return value is its least significant +8 bits. +Any command associated with the RETURN trap is executed +before execution resumes after the function or script. +The return status is non-zero if return is supplied a non-numeric +argument or is used outside a function +and not during the execution of a script by . or source. +

    + +

    shift +
    +
     
    shift [n]
    +

    + +Shift the positional parameters to the left by n. +The positional parameters from n+1 ... $# are +renamed to $1 ... $#-n. +Parameters represented by the numbers $# to $#-n+1 +are unset. +n must be a non-negative number less than or equal to $#. +If n is zero or greater than $#, the positional parameters +are not changed. +If n is not supplied, it is assumed to be 1. +The return status is zero unless n is greater than $# or +less than zero, non-zero otherwise. +

    + +

    test +
    [ +
    + +
     
    test expr
    +

    + +Evaluate a conditional express +ion expr and return a status of 0 +(true) or 1 (false). +Each operator and operand must be a separate argument. +Expressions are composed of the primaries described below in +6.4 Bash Conditional Expressions. +test does not accept any options, nor does it accept and ignore +an argument of `--' as signifying the end of options. +

    + +When the [ form is used, the last argument to the command must +be a ]. +

    + +Expressions may be combined using the following operators, listed in +decreasing order of precedence. +The evaluation depends on the number of arguments; see below. +Operator precedence is used when there are five or more arguments. +

    + +

    +
    ! expr +
    True if expr is false. +

    + +

    ( expr ) +
    Returns the value of expr. +This may be used to override the normal precedence of operators. +

    + +

    expr1 -a expr2 +
    True if both expr1 and expr2 are true. +

    + +

    expr1 -o expr2 +
    True if either expr1 or expr2 is true. +
    +

    + +The test and [ builtins evaluate conditional +expressions using a set of rules based on the number of arguments. +

    + +

    +
    0 arguments +
    The expression is false. +

    + +

    1 argument +
    The expression is true if and only if the argument is not null. +

    + +

    2 arguments +
    If the first argument is `!', the expression is true if and +only if the second argument is null. +If the first argument is one of the unary conditional operators +(see section 6.4 Bash Conditional Expressions), the expression +is true if the unary test is true. +If the first argument is not a valid unary operator, the expression is +false. +

    + +

    3 arguments +
    The following conditions are applied in the order listed. +If the second argument is one of the binary conditional +operators (see section 6.4 Bash Conditional Expressions), the +result of the expression is the result of the binary test using the +first and third arguments as operands. +The `-a' and `-o' operators are considered binary operators +when there are three arguments. +If the first argument is `!', the value is the negation of +the two-argument test using the second and third arguments. +If the first argument is exactly `(' and the third argument is +exactly `)', the result is the one-argument test of the second +argument. +Otherwise, the expression is false. +

    + +

    4 arguments +
    If the first argument is `!', the result is the negation of +the three-argument expression composed of the remaining arguments. +Otherwise, the expression is parsed and evaluated according to +precedence using the rules listed above. +

    + +

    5 or more arguments +
    The expression is parsed and evaluated according to precedence +using the rules listed above. +
    +

    + +When used with test or `[', the `<' and `>' +operators sort lexicographically using ASCII ordering. +

    + +

    times +
    +
     
    times
    +

    + +Print out the user and system times used by the shell and its children. +The return status is zero. +

    + +

    trap +
    +
     
    trap [-lp] [arg] [sigspec ...]
    +

    + +The commands in arg are to be read and executed when the +shell receives signal sigspec. If arg is absent (and +there is a single sigspec) or +equal to `-', each specified signal's disposition is reset +to the value it had when the shell was started. +If arg is the null string, then the signal specified by +each sigspec is ignored by the shell and commands it invokes. +If arg is not present and `-p' has been supplied, +the shell displays the trap commands associated with each sigspec. +If no arguments are supplied, or +only `-p' is given, trap prints the list of commands +associated with each signal number in a form that may be reused as +shell input. +The `-l' option causes the shell to print a list of signal names +and their corresponding numbers. +Each sigspec is either a signal name or a signal number. +Signal names are case insensitive and the SIG prefix is optional. +

    + +If a sigspec +is 0 or EXIT, arg is executed when the shell exits. +If a sigspec is DEBUG, the command arg is executed +before every simple command, for command, case command, +select command, every arithmetic for command, and before +the first command executes in a shell function. +Refer to the description of the extdebug option to the +shopt builtin (see section 4.3.2 The Shopt Builtin) for details of its +effect on the DEBUG trap. +If a sigspec is RETURN, the command arg is executed +each time a shell function or a script executed with the . or +source builtins finishes executing. +

    + +If a sigspec is ERR, the command arg +is executed whenever +a pipeline (which may consist of a single simple +command), a list, or a compound command returns a +non-zero exit status, +subject to the following conditions. +The ERR trap is not executed if the failed command is part of the +command list immediately following an until or while keyword, +part of the test following the if or elif reserved words, +part of a command executed in a && or || list +except the command following the final && or ||, +any command in a pipeline but the last, +or if the command's return +status is being inverted using !. +These are the same conditions obeyed by the errexit (`-e') +option. +

    + +Signals ignored upon entry to the shell cannot be trapped or reset. +Trapped signals that are not being ignored are reset to their original +values in a subshell or subshell environment when one is created. +

    + +The return status is zero unless a sigspec does not specify a +valid signal. +

    + +

    umask +
    +
     
    umask [-p] [-S] [mode]
    +

    + +Set the shell process's file creation mask to mode. If +mode begins with a digit, it is interpreted as an octal number; +if not, it is interpreted as a symbolic mode mask similar +to that accepted by the chmod command. If mode is +omitted, the current value of the mask is printed. If the `-S' +option is supplied without a mode argument, the mask is printed +in a symbolic format. +If the `-p' option is supplied, and mode +is omitted, the output is in a form that may be reused as input. +The return status is zero if the mode is successfully changed or if +no mode argument is supplied, and non-zero otherwise. +

    + +Note that when the mode is interpreted as an octal number, each number +of the umask is subtracted from 7. Thus, a umask of 022 +results in permissions of 755. +

    + +

    unset +
    +
     
    unset [-fnv] [name]
    +

    + +Remove each variable or function name. +If the `-v' option is given, each +name refers to a shell variable and that variable is remvoved. +If the `-f' option is given, the names refer to shell +functions, and the function definition is removed. +If the `-n' option is supplied, and name is a variable with +the nameref attribute, name will be unset rather than the +variable it references. +`-n' has no effect if the `-f' option is supplied. +If no options are supplied, each name refers to a variable; if +there is no variable by that name, any function with that name is +unset. +Readonly variables and functions may not be unset. +The return status is zero unless a name is readonly. +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    4.2 Bash Builtin Commands

    + +

    + +This section describes builtin commands which are unique to +or have been extended in Bash. +Some of these commands are specified in the POSIX standard. +

    + +

    + +
    alias +
    +
     
    alias [-p] [name[=value] ...]
    +

    + +Without arguments or with the `-p' option, alias prints +the list of aliases on the standard output in a form that allows +them to be reused as input. +If arguments are supplied, an alias is defined for each name +whose value is given. If no value is given, the name +and value of the alias is printed. +Aliases are described in 6.6 Aliases. +

    + +

    bind +
    +
     
    bind [-m keymap] [-lpsvPSVX]
    +bind [-m keymap] [-q function] [-u function] [-r keyseq]
    +bind [-m keymap] -f filename
    +bind [-m keymap] -x keyseq:shell-command
    +bind [-m keymap] keyseq:function-name
    +bind readline-command
    +

    + +Display current Readline (see section 8. Command Line Editing) +key and function bindings, +bind a key sequence to a Readline function or macro, +or set a Readline variable. +Each non-option argument is a command as it would appear in a +Readline initialization file (see section 8.3 Readline Init File), +but each binding or command must be passed as a separate argument; e.g., +`"\C-x\C-r":re-read-init-file'. +

    + +Options, if supplied, have the following meanings: +

    + +

    +
    -m keymap +
    Use keymap as the keymap to be affected by +the subsequent bindings. Acceptable keymap +names are +emacs, +emacs-standard, +emacs-meta, +emacs-ctlx, +vi, +vi-move, +vi-command, and +vi-insert. +vi is equivalent to vi-command; +emacs is equivalent to emacs-standard. +

    + +

    -l +
    List the names of all Readline functions. +

    + +

    -p +
    Display Readline function names and bindings in such a way that they +can be used as input or in a Readline initialization file. +

    + +

    -P +
    List current Readline function names and bindings. +

    + +

    -v +
    Display Readline variable names and values in such a way that they +can be used as input or in a Readline initialization file. +

    + +

    -V +
    List current Readline variable names and values. +

    + +

    -s +
    Display Readline key sequences bound to macros and the strings they output +in such a way that they can be used as input or in a Readline +initialization file. +

    + +

    -S +
    Display Readline key sequences bound to macros and the strings they output. +

    + +

    -f filename +
    Read key bindings from filename. +

    + +

    -q function +
    Query about which keys invoke the named function. +

    + +

    -u function +
    Unbind all keys bound to the named function. +

    + +

    -r keyseq +
    Remove any current binding for keyseq. +

    + +

    -x keyseq:shell-command +
    Cause shell-command to be executed whenever keyseq is +entered. +When shell-command is executed, the shell sets the +READLINE_LINE variable to the contents of the Readline line +buffer and the READLINE_POINT variable to the current location +of the insertion point. +If the executed command changes the value of READLINE_LINE or +READLINE_POINT, those new values will be reflected in the +editing state. +

    + +

    -X +
    List all key sequences bound to shell commands and the associated commands +in a format that can be reused as input. +
    +

    + +The return status is zero unless an invalid option is supplied or an +error occurs. +

    + +

    builtin +
    +
     
    builtin [shell-builtin [args]]
    +

    + +Run a shell builtin, passing it args, and return its exit status. +This is useful when defining a shell function with the same +name as a shell builtin, retaining the functionality of the builtin within +the function. +The return status is non-zero if shell-builtin is not a shell +builtin command. +

    + +

    caller +
    +
     
    caller [expr]
    +

    + +Returns the context of any active subroutine call (a shell function or +a script executed with the . or source builtins). +

    + +Without expr, caller displays the line number and source +filename of the current subroutine call. +If a non-negative integer is supplied as expr, caller +displays the line number, subroutine name, and source file corresponding +to that position in the current execution call stack. This extra +information may be used, for example, to print a stack trace. The +current frame is frame 0. +

    + +The return value is 0 unless the shell is not executing a subroutine +call or expr does not correspond to a valid position in the +call stack. +

    + +

    command +
    +
     
    command [-pVv] command [arguments ...]
    +

    + +Runs command with arguments ignoring any shell function +named command. +Only shell builtin commands or commands found by searching the +PATH are executed. +If there is a shell function named ls, running `command ls' +within the function will execute the external command ls +instead of calling the function recursively. +The `-p' option means to use a default value for PATH +that is guaranteed to find all of the standard utilities. +The return status in this case is 127 if command cannot be +found or an error occurred, and the exit status of command +otherwise. +

    + +If either the `-V' or `-v' option is supplied, a +description of command is printed. The `-v' option +causes a single word indicating the command or file name used to +invoke command to be displayed; the `-V' option produces +a more verbose description. In this case, the return status is +zero if command is found, and non-zero if not. +

    + +

    declare +
    +
     
    declare [-aAfFgilnrtux] [-p] [name[=value] ...]
    +

    + +Declare variables and give them attributes. If no names +are given, then display the values of variables instead. +

    + +The `-p' option will display the attributes and values of each +name. +When `-p' is used with name arguments, additional options, +other than `-f' and `-F', are ignored. +

    + +When `-p' is supplied without name arguments, declare +will display the attributes and values of all variables having the +attributes specified by the additional options. +If no other options are supplied with `-p', declare will +display the attributes and values of all shell variables. The `-f' +option will restrict the display to shell functions. +

    + +The `-F' option inhibits the display of function definitions; +only the function name and attributes are printed. +If the extdebug shell option is enabled using shopt +(see section 4.3.2 The Shopt Builtin), the source file name and line number where +the function is defined are displayed as well. +`-F' implies `-f'. +

    + +The `-g' option forces variables to be created or modified at +the global scope, even when declare is executed in a shell function. +It is ignored in all other cases. +

    + +The following options can be used to restrict output to variables with +the specified attributes or to give variables attributes: +

    + +

    +
    -a +
    Each name is an indexed array variable (see section 6.7 Arrays). +

    + +

    -A +
    Each name is an associative array variable (see section 6.7 Arrays). +

    + +

    -f +
    Use function names only. +

    + +

    -i +
    The variable is to be treated as +an integer; arithmetic evaluation (see section 6.5 Shell Arithmetic) is +performed when the variable is assigned a value. +

    + +

    -l +
    When the variable is assigned a value, all upper-case characters are +converted to lower-case. +The upper-case attribute is disabled. +

    + +

    -n +
    Give each name the nameref attribute, making +it a name reference to another variable. +That other variable is defined by the value of name. +All references and assignments to name, except for changing the +`-n' attribute itself, are performed on the variable referenced by +name's value. +The `-n' attribute cannot be applied to array variables. +

    + +

    -r +
    Make names readonly. These names cannot then be assigned values +by subsequent assignment statements or unset. +

    + +

    -t +
    Give each name the trace attribute. +Traced functions inherit the DEBUG and RETURN traps from +the calling shell. +The trace attribute has no special meaning for variables. +

    + +

    -u +
    When the variable is assigned a value, all lower-case characters are +converted to upper-case. +The lower-case attribute is disabled. +

    + +

    -x +
    Mark each name for export to subsequent commands via +the environment. +
    +

    + +Using `+' instead of `-' turns off the attribute instead, +with the exceptions that `+a' +may not be used to destroy an array variable and `+r' will not +remove the readonly attribute. +When used in a function, declare makes each name local, +as with the local command, unless the `-g' option is used. +If a variable name is followed by =value, the value of the variable +is set to value. +

    + +When using `-a' or `-A' and the compound assignment syntax to +create array variables, additional attributes do not take effect until +subsequent assignments. +

    + +The return status is zero unless an invalid option is encountered, +an attempt is made to define a function using `-f foo=bar', +an attempt is made to assign a value to a readonly variable, +an attempt is made to assign a value to an array variable without +using the compound assignment syntax (see section 6.7 Arrays), +one of the names is not a valid shell variable name, +an attempt is made to turn off readonly status for a readonly variable, +an attempt is made to turn off array status for an array variable, +or an attempt is made to display a non-existent function with `-f'. +

    + +

    echo +
    +
     
    echo [-neE] [arg ...]
    +

    + +Output the args, separated by spaces, terminated with a +newline. +The return status is 0 unless a write error occurs. +If `-n' is specified, the trailing newline is suppressed. +If the `-e' option is given, interpretation of the following +backslash-escaped characters is enabled. +The `-E' option disables the interpretation of these escape characters, +even on systems where they are interpreted by default. +The xpg_echo shell option may be used to +dynamically determine whether or not echo expands these +escape characters by default. +echo does not interpret `--' to mean the end of options. +

    + +echo interprets the following escape sequences: +

    +
    \a +
    alert (bell) +
    \b +
    backspace +
    \c +
    suppress further output +
    \e +
    \E +
    escape +
    \f +
    form feed +
    \n +
    new line +
    \r +
    carriage return +
    \t +
    horizontal tab +
    \v +
    vertical tab +
    \\ +
    backslash +
    \0nnn +
    the eight-bit character whose value is the octal value nnn +(zero to three octal digits) +
    \xHH +
    the eight-bit character whose value is the hexadecimal value HH +(one or two hex digits) +
    \uHHHH +
    the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +HHHH (one to four hex digits) +
    \UHHHHHHHH +
    the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +HHHHHHHH (one to eight hex digits) +
    +

    + +

    enable +
    +
     
    enable [-a] [-dnps] [-f filename] [name ...]
    +

    + +Enable and disable builtin shell commands. +Disabling a builtin allows a disk command which has the same name +as a shell builtin to be executed without specifying a full pathname, +even though the shell normally searches for builtins before disk commands. +If `-n' is used, the names become disabled. Otherwise +names are enabled. For example, to use the test binary +found via $PATH instead of the shell builtin version, type +`enable -n test'. +

    + +If the `-p' option is supplied, or no name arguments appear, +a list of shell builtins is printed. With no other arguments, the list +consists of all enabled shell builtins. +The `-a' option means to list +each builtin with an indication of whether or not it is enabled. +

    + +The `-f' option means to load the new builtin command name +from shared object filename, on systems that support dynamic loading. +The `-d' option will delete a builtin loaded with `-f'. +

    + +If there are no options, a list of the shell builtins is displayed. +The `-s' option restricts enable to the POSIX special +builtins. If `-s' is used with `-f', the new builtin becomes +a special builtin (see section 4.4 Special Builtins). +

    + +The return status is zero unless a name is not a shell builtin +or there is an error loading a new builtin from a shared object. +

    + +

    help +
    +
     
    help [-dms] [pattern]
    +

    + +Display helpful information about builtin commands. +If pattern is specified, help gives detailed help +on all commands matching pattern, otherwise a list of +the builtins is printed. +

    + +Options, if supplied, have the following meanings: +

    + +

    +
    -d +
    Display a short description of each pattern +
    -m +
    Display the description of each pattern in a manpage-like format +
    -s +
    Display only a short usage synopsis for each pattern +
    +

    + +The return status is zero unless no command matches pattern. +

    + +

    let +
    +
     
    let expression [expression ...]
    +

    + +The let builtin allows arithmetic to be performed on shell +variables. Each expression is evaluated according to the +rules given below in 6.5 Shell Arithmetic. If the +last expression evaluates to 0, let returns 1; +otherwise 0 is returned. +

    + +

    local +
    +
     
    local [option] name[=value] ...
    +

    + +For each argument, a local variable named name is created, +and assigned value. +The option can be any of the options accepted by declare. +local can only be used within a function; it makes the variable +name have a visible scope restricted to that function and its +children. The return status is zero unless local is used outside +a function, an invalid name is supplied, or name is a +readonly variable. +

    + +

    logout +
    +
     
    logout [n]
    +

    + +Exit a login shell, returning a status of n to the shell's +parent. +

    + +

    mapfile +
    +
     
    mapfile [-n count] [-O origin] [-s count] [-t] [-u fd]
    +    [-C callback] [-c quantum] [array]
    +

    + +Read lines from the standard input into the indexed array variable array, +or from file descriptor fd +if the `-u' option is supplied. +The variable MAPFILE is the default array. +Options, if supplied, have the following meanings: +

    + +

    + +
    -n +
    Copy at most count lines. If count is 0, all lines are copied. +
    -O +
    Begin assigning to array at index origin. +The default index is 0. +
    -s +
    Discard the first count lines read. +
    -t +
    Remove a trailing newline from each line read. +
    -u +
    Read lines from file descriptor fd instead of the standard input. +
    -C +
    Evaluate callback each time quantumP lines are read. +The `-c' option specifies quantum. +
    -c +
    Specify the number of lines read between each call to callback. +
    +

    + +If `-C' is specified without `-c', +the default quantum is 5000. +When callback is evaluated, it is supplied the index of the next +array element to be assigned and the line to be assigned to that element +as additional arguments. +callback is evaluated after the line is read but before the +array element is assigned. +

    + +If not supplied with an explicit origin, mapfile will clear array +before assigning to it. +

    + +mapfile returns successfully unless an invalid option or option +argument is supplied, array is invalid or unassignable, or array +is not an indexed array. +

    + +

    printf +
    +
     
    printf [-v var] format [arguments]
    +

    + +Write the formatted arguments to the standard output under the +control of the format. +The `-v' option causes the output to be assigned to the variable +var rather than being printed to the standard output. +

    + +The format is a character string which contains three types of objects: +plain characters, which are simply copied to standard output, character +escape sequences, which are converted and copied to the standard output, and +format specifications, each of which causes printing of the next successive +argument. +In addition to the standard printf(1) formats, printf +interprets the following extensions: +

    + +

    +
    %b +
    Causes printf to expand backslash escape sequences in the +corresponding argument, +except that `\c' terminates output, backslashes in +`\'', `\"', and `\?' are not removed, and octal escapes +beginning with `\0' may contain up to four digits. +
    %q +
    Causes printf to output the +corresponding argument in a format that can be reused as shell input. +
    %(datefmt)T +
    Causes printf to output the date-time string resulting from using +datefmt as a format string for strftime(3). +The corresponding argument is an integer representing the number of +seconds since the epoch. +Two special argument values may be used: -1 represents the current +time, and -2 represents the time the shell was invoked. +If no argument is specified, conversion behaves as if -1 had been given. +This is an exception to the usual printf behavior. +
    +

    + +Arguments to non-string format specifiers are treated as C language constants, +except that a leading plus or minus sign is allowed, and if the leading +character is a single or double quote, the value is the ASCII value of +the following character. +

    + +The format is reused as necessary to consume all of the arguments. +If the format requires more arguments than are supplied, the +extra format specifications behave as if a zero value or null string, as +appropriate, had been supplied. The return value is zero on success, +non-zero on failure. +

    + +

    read +
    +
     
    read [-ers] [-a aname] [-d delim] [-i text] [-n nchars]
    +    [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]
    +

    + +One line is read from the standard input, or from the file descriptor +fd supplied as an argument to the `-u' option, and the first word +is assigned to the first name, the second word to the second name, +and so on, with leftover words and their intervening separators assigned +to the last name. +If there are fewer words read from the input stream than names, +the remaining names are assigned empty values. +The characters in the value of the IFS variable +are used to split the line into words using the same rules the shell +uses for expansion (described above in 3.5.7 Word Splitting). +The backslash character `\' may be used to remove any special +meaning for the next character read and for line continuation. +If no names are supplied, the line read is assigned to the +variable REPLY. +The return code is zero, unless end-of-file is encountered, read +times out (in which case the return code is greater than 128), +a variable assignment error (such as assigning to a readonly variable) occurs, +or an invalid file descriptor is supplied as the argument to `-u'. +

    + +Options, if supplied, have the following meanings: +

    + +

    +
    -a aname +
    The words are assigned to sequential indices of the array variable +aname, starting at 0. +All elements are removed from aname before the assignment. +Other name arguments are ignored. +

    + +

    -d delim +
    The first character of delim is used to terminate the input line, +rather than newline. +

    + +

    -e +
    Readline (see section 8. Command Line Editing) is used to obtain the line. +Readline uses the current (or default, if line editing was not previously +active) editing settings. +

    + +

    -i text +
    If Readline is being used to read the line, text is placed into +the editing buffer before editing begins. +

    + +

    -n nchars +
    read returns after reading nchars characters rather than +waiting for a complete line of input, but honor a delimiter if fewer +than nchars characters are read before the delimiter. +

    + +

    -N nchars +
    read returns after reading exactly nchars characters rather +than waiting for a complete line of input, unless EOF is encountered or +read times out. +Delimiter characters encountered in the input are +not treated specially and do not cause read to return until +nchars characters are read. +

    + +

    -p prompt +
    Display prompt, without a trailing newline, before attempting +to read any input. +The prompt is displayed only if input is coming from a terminal. +

    + +

    -r +
    If this option is given, backslash does not act as an escape character. +The backslash is considered to be part of the line. +In particular, a backslash-newline pair may not be used as a line +continuation. +

    + +

    -s +
    Silent mode. If input is coming from a terminal, characters are +not echoed. +

    + +

    -t timeout +
    Cause read to time out and return failure if a complete line of +input (or a specified number of characters) +is not read within timeout seconds. +timeout may be a decimal number with a fractional portion following +the decimal point. +This option is only effective if read is reading input from a +terminal, pipe, or other special file; it has no effect when reading +from regular files. +If read times out, read saves any partial input read into +the specified variable name. +If timeout is 0, read returns immediately, without trying to +read and data. The exit status is 0 if input is available on +the specified file descriptor, non-zero otherwise. +The exit status is greater than 128 if the timeout is exceeded. +

    + +

    -u fd +
    Read input from file descriptor fd. +
    +

    + +

    readarray +
    +
     
    readarray [-n count] [-O origin] [-s count] [-t] [-u fd]
    +    [-C callback] [-c quantum] [array]
    +

    + +Read lines from the standard input into the indexed array variable array, +or from file descriptor fd +if the `-u' option is supplied. +

    + +A synonym for mapfile. +

    + +

    source +
    +
     
    source filename
    +

    + +A synonym for . (see section 4.1 Bourne Shell Builtins). +

    + +

    type +
    +
     
    type [-afptP] [name ...]
    +

    + +For each name, indicate how it would be interpreted if used as a +command name. +

    + +If the `-t' option is used, type prints a single word +which is one of `alias', `function', `builtin', +`file' or `keyword', +if name is an alias, shell function, shell builtin, +disk file, or shell reserved word, respectively. +If the name is not found, then nothing is printed, and +type returns a failure status. +

    + +If the `-p' option is used, type either returns the name +of the disk file that would be executed, or nothing if `-t' +would not return `file'. +

    + +The `-P' option forces a path search for each name, even if +`-t' would not return `file'. +

    + +If a command is hashed, `-p' and `-P' print the hashed value, +which is not necessarily the file that appears first in $PATH. +

    + +If the `-a' option is used, type returns all of the places +that contain an executable named file. +This includes aliases and functions, if and only if the `-p' option +is not also used. +

    + +If the `-f' option is used, type does not attempt to find +shell functions, as with the command builtin. +

    + +The return status is zero if all of the names are found, non-zero +if any are not found. +

    + +

    typeset +
    +
     
    typeset [-afFgrxilnrtux] [-p] [name[=value] ...]
    +

    + +The typeset command is supplied for compatibility with the Korn +shell. +It is a synonym for the declare builtin command. +

    + +

    ulimit +
    +
     
    ulimit [-abcdefilmnpqrstuvxHST] [limit]
    +

    + +ulimit provides control over the resources available to processes +started by the shell, on systems that allow such control. If an +option is given, it is interpreted as follows: +

    + +

    +
    -S +
    Change and report the soft limit associated with a resource. +

    + +

    -H +
    Change and report the hard limit associated with a resource. +

    + +

    -a +
    All current limits are reported. +

    + +

    -b +
    The maximum socket buffer size. +

    + +

    -c +
    The maximum size of core files created. +

    + +

    -d +
    The maximum size of a process's data segment. +

    + +

    -e +
    The maximum scheduling priority ("nice"). +

    + +

    -f +
    The maximum size of files written by the shell and its children. +

    + +

    -i +
    The maximum number of pending signals. +

    + +

    -l +
    The maximum size that may be locked into memory. +

    + +

    -m +
    The maximum resident set size (many systems do not honor this limit). +

    + +

    -n +
    The maximum number of open file descriptors (most systems do not +allow this value to be set). +

    + +

    -p +
    The pipe buffer size. +

    + +

    -q +
    The maximum number of bytes in POSIX message queues. +

    + +

    -r +
    The maximum real-time scheduling priority. +

    + +

    -s +
    The maximum stack size. +

    + +

    -t +
    The maximum amount of cpu time in seconds. +

    + +

    -u +
    The maximum number of processes available to a single user. +

    + +

    -v +
    The maximum amount of virtual memory available to the shell, and, on +some systems, to its children. +

    + +

    -x +
    The maximum number of file locks. +

    + +

    -T +
    The maximum number of threads. +
    +

    + +If limit is given, and the `-a' option is not used, +limit is the new value of the specified resource. +The special limit values hard, soft, and +unlimited stand for the current hard limit, the current soft limit, +and no limit, respectively. +A hard limit cannot be increased by a non-root user once it is set; +a soft limit may be increased up to the value of the hard limit. +Otherwise, the current value of the soft limit for the specified resource +is printed, unless the `-H' option is supplied. +When setting new limits, if neither `-H' nor `-S' is supplied, +both the hard and soft limits are set. +If no option is given, then `-f' is assumed. Values are in 1024-byte +increments, except for `-t', which is in seconds; `-p', +which is in units of 512-byte blocks; and `-T', `-b', +`-n' and `-u', which are unscaled values. +

    + +The return status is zero unless an invalid option or argument is supplied, +or an error occurs while setting a new limit. +

    + +

    unalias +
    +
     
    unalias [-a] [name ... ]
    +

    + +Remove each name from the list of aliases. If `-a' is +supplied, all aliases are removed. +Aliases are described in 6.6 Aliases. +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    4.3 Modifying Shell Behavior

    + + +
    + + +
    4.3.1 The Set Builtin  Change the values of shell attributes and + positional parameters.
    4.3.2 The Shopt Builtin  Modify shell optional behavior.
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    4.3.1 The Set Builtin

    + +

    + +This builtin is so complicated that it deserves its own section. set +allows you to change the values of shell options and set the positional +parameters, or to display the names and values of shell variables. +

    + +

    +
    set +
    +
     
    set [--abefhkmnptuvxBCEHPT] [-o option-name] [argument ...]
    +set [+abefhkmnptuvxBCEHPT] [+o option-name] [argument ...]
    +

    + +If no options or arguments are supplied, set displays the names +and values of all shell variables and functions, sorted according to the +current locale, in a format that may be reused as input +for setting or resetting the currently-set variables. +Read-only variables cannot be reset. +In POSIX mode, only shell variables are listed. +

    + +When options are supplied, they set or unset shell attributes. +Options, if specified, have the following meanings: +

    + +

    +
    -a +
    Mark variables and function which are modified or created for export +to the environment of subsequent commands. +

    + +

    -b +
    Cause the status of terminated background jobs to be reported +immediately, rather than before printing the next primary prompt. +

    + +

    -e +
    Exit immediately if +a pipeline (see section 3.2.2 Pipelines), which may consist of a single simple command +(see section 3.2.1 Simple Commands), +a list (see section 3.2.3 Lists of Commands), +or a compound command (see section 3.2.4 Compound Commands) +returns a non-zero status. +The shell does not exit if the command that fails is part of the +command list immediately following a while or until keyword, +part of the test in an if statement, +part of any command executed in a && or || list except +the command following the final && or ||, +any command in a pipeline but the last, +or if the command's return status is being inverted with !. +If a compound command other than a subshell +returns a non-zero status because a command failed +while `-e' was being ignored, the shell does not exit. +A trap on ERR, if set, is executed before the shell exits. +

    + +This option applies to the shell environment and each subshell environment +separately (see section 3.7.3 Command Execution Environment), and may cause +subshells to exit before executing all the commands in the subshell. +

    + +If a compound command or shell function executes in a context where +`-e' is being ignored, +none of the commands executed within the compound command or function body +will be affected by the `-e' setting, even if `-e' is set +and a command returns a failure status. +If a compound command or shell function sets `-e' while executing in +a context where `-e' is ignored, that setting will not have any +effect until the compound command or the command containing the function +call completes. +

    + +

    -f +
    Disable filename expansion (globbing). +

    + +

    -h +
    Locate and remember (hash) commands as they are looked up for execution. +This option is enabled by default. +

    + +

    -k +
    All arguments in the form of assignment statements are placed +in the environment for a command, not just those that precede +the command name. +

    + +

    -m +
    Job control is enabled (see section 7. Job Control). +All processes run in a separate process group. +When a background job completes, the shell prints a line +containing its exit status. +

    + +

    -n +
    Read commands but do not execute them; this may be used to check a +script for syntax errors. +This option is ignored by interactive shells. +

    + +

    -o option-name +

    + +Set the option corresponding to option-name: +

    + +

    +
    allexport +
    Same as -a. +

    + +

    braceexpand +
    Same as -B. +

    + +

    emacs +
    Use an emacs-style line editing interface (see section 8. Command Line Editing). +This also affects the editing interface used for read -e. +

    + +

    errexit +
    Same as -e. +

    + +

    errtrace +
    Same as -E. +

    + +

    functrace +
    Same as -T. +

    + +

    hashall +
    Same as -h. +

    + +

    histexpand +
    Same as -H. +

    + +

    history +
    Enable command history, as described in 9.1 Bash History Facilities. +This option is on by default in interactive shells. +

    + +

    ignoreeof +
    An interactive shell will not exit upon reading EOF. +

    + +

    keyword +
    Same as -k. +

    + +

    monitor +
    Same as -m. +

    + +

    noclobber +
    Same as -C. +

    + +

    noexec +
    Same as -n. +

    + +

    noglob +
    Same as -f. +

    + +

    nolog +
    Currently ignored. +

    + +

    notify +
    Same as -b. +

    + +

    nounset +
    Same as -u. +

    + +

    onecmd +
    Same as -t. +

    + +

    physical +
    Same as -P. +

    + +

    pipefail +
    If set, the return value of a pipeline is the value of the last +(rightmost) command to exit with a non-zero status, or zero if all +commands in the pipeline exit successfully. +This option is disabled by default. +

    + +

    posix +
    Change the behavior of Bash where the default operation differs +from the POSIX standard to match the standard +(see section 6.11 Bash POSIX Mode). +This is intended to make Bash behave as a strict superset of that +standard. +

    + +

    privileged +
    Same as -p. +

    + +

    verbose +
    Same as -v. +

    + +

    vi +
    Use a vi-style line editing interface. +This also affects the editing interface used for read -e. +

    + +

    xtrace +
    Same as -x. +
    +

    + +

    -p +
    Turn on privileged mode. +In this mode, the $BASH_ENV and $ENV files are not +processed, shell functions are not inherited from the environment, +and the SHELLOPTS, BASHOPTS, CDPATH and GLOBIGNORE +variables, if they appear in the environment, are ignored. +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the `-p' option is not supplied, these actions +are taken and the effective user id is set to the real user id. +If the `-p' option is supplied at startup, the effective user id is +not reset. +Turning this option off causes the effective user +and group ids to be set to the real user and group ids. +

    + +

    -t +
    Exit after reading and executing one command. +

    + +

    -u +
    Treat unset variables and parameters other than the special parameters +`@' or `*' as an error when performing parameter expansion. +An error message will be written to the standard error, and a non-interactive +shell will exit. +

    + +

    -v +
    Print shell input lines as they are read. +

    + +

    -x +
    Print a trace of simple commands, for commands, case +commands, select commands, and arithmetic for commands +and their arguments or associated word lists after they are +expanded and before they are executed. The value of the PS4 +variable is expanded and the resultant value is printed before +the command and its expanded arguments. +

    + +

    -B +
    The shell will perform brace expansion (see section 3.5.1 Brace Expansion). +This option is on by default. +

    + +

    -C +
    Prevent output redirection using `>', `>&', and `<>' +from overwriting existing files. +

    + +

    -E +
    If set, any trap on ERR is inherited by shell functions, command +substitutions, and commands executed in a subshell environment. +The ERR trap is normally not inherited in such cases. +

    + +

    -H +
    Enable `!' style history substitution (see section 9.3 History Expansion). +This option is on by default for interactive shells. +

    + +

    -P +
    If set, do not resolve symbolic links when performing commands such as +cd which change the current directory. The physical directory +is used instead. By default, Bash follows +the logical chain of directories when performing commands +which change the current directory. +

    + +For example, if `/usr/sys' is a symbolic link to `/usr/local/sys' +then: +
     
    $ cd /usr/sys; echo $PWD
    +/usr/sys
    +$ cd ..; pwd
    +/usr
    +

    + +If set -P is on, then: +
     
    $ cd /usr/sys; echo $PWD
    +/usr/local/sys
    +$ cd ..; pwd
    +/usr/local
    +

    + +

    -T +
    If set, any trap on DEBUG and RETURN are inherited by +shell functions, command substitutions, and commands executed +in a subshell environment. +The DEBUG and RETURN traps are normally not inherited +in such cases. +

    + +

    -- +
    If no arguments follow this option, then the positional parameters are +unset. Otherwise, the positional parameters are set to the +arguments, even if some of them begin with a `-'. +

    + +

    - +
    Signal the end of options, cause all remaining arguments +to be assigned to the positional parameters. The `-x' +and `-v' options are turned off. +If there are no arguments, the positional parameters remain unchanged. +
    +

    + +Using `+' rather than `-' causes these options to be +turned off. The options can also be used upon invocation of the +shell. The current set of options may be found in $-. +

    + +The remaining N arguments are positional parameters and are +assigned, in order, to $1, $2, ... $N. +The special parameter # is set to N. +

    + +The return status is always zero unless an invalid option is supplied. +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    4.3.2 The Shopt Builtin

    + +

    + +This builtin allows you to change additional shell optional behavior. +

    + +

    + +
    shopt +
    +
     
    shopt [-pqsu] [-o] [optname ...]
    +

    + +Toggle the values of settings controlling optional shell behavior. +The settings can be either those listed below, or, if the +`-o' option is used, those available with the `-o' +option to the set builtin command (see section 4.3.1 The Set Builtin). +With no options, or with the `-p' option, a list of all settable +options is displayed, with an indication of whether or not each is set. +The `-p' option causes output to be displayed in a form that +may be reused as input. +Other options have the following meanings: +

    + +

    +
    -s +
    Enable (set) each optname. +

    + +

    -u +
    Disable (unset) each optname. +

    + +

    -q +
    Suppresses normal output; the return status +indicates whether the optname is set or unset. +If multiple optname arguments are given with `-q', +the return status is zero if all optnames are enabled; +non-zero otherwise. +

    + +

    -o +
    Restricts the values of +optname to be those defined for the `-o' option to the +set builtin (see section 4.3.1 The Set Builtin). +
    +

    + +If either `-s' or `-u' +is used with no optname arguments, shopt shows only +those options which are set or unset, respectively. +

    + +Unless otherwise noted, the shopt options are disabled (off) +by default. +

    + +The return status when listing options is zero if all optnames +are enabled, non-zero otherwise. When setting or unsetting options, +the return status is zero unless an optname is not a valid shell +option. +

    + +The list of shopt options is: +

    + +
    autocd +
    If set, a command name that is the name of a directory is executed as if +it were the argument to the cd command. +This option is only used by interactive shells. +

    + +

    cdable_vars +
    If this is set, an argument to the cd builtin command that +is not a directory is assumed to be the name of a variable whose +value is the directory to change to. +

    + +

    cdspell +
    If set, minor errors in the spelling of a directory component in a +cd command will be corrected. +The errors checked for are transposed characters, +a missing character, and a character too many. +If a correction is found, the corrected path is printed, +and the command proceeds. +This option is only used by interactive shells. +

    + +

    checkhash +
    If this is set, Bash checks that a command found in the hash +table exists before trying to execute it. If a hashed command no +longer exists, a normal path search is performed. +

    + +

    checkjobs +
    If set, Bash lists the status of any stopped and running jobs before +exiting an interactive shell. If any jobs are running, this causes +the exit to be deferred until a second exit is attempted without an +intervening command (see section 7. Job Control). +The shell always postpones exiting if any jobs are stopped. +

    + +

    checkwinsize +
    If set, Bash checks the window size after each command + and, if necessary, updates the values of +LINES and COLUMNS. +

    + +

    cmdhist +
    If set, Bash +attempts to save all lines of a multiple-line +command in the same history entry. This allows +easy re-editing of multi-line commands. +

    + +

    compat31 +
    If set, Bash +changes its behavior to that of version 3.1 with respect to quoted +arguments to the conditional command's `=~' operator +and with respect to locale-specific +string comparison when using the [[ +conditional command's `<' and `>' operators. +Bash versions prior to bash-4.1 use ASCII collation and strcmp(3); +bash-4.1 and later use the current locale's collation sequence and strcoll(3). +

    + +

    compat32 +
    If set, Bash +changes its behavior to that of version 3.2 with respect to locale-specific +string comparison when using the [[ +conditional command's `<' and `>' operators (see previous item). +

    + +

    compat40 +
    If set, Bash +changes its behavior to that of version 4.0 with respect to locale-specific +string comparison when using the [[ +conditional command's `<' and `>' operators (see description +of compat31) +and the effect of interrupting a command list. +Bash versions 4.0 and later interrupt the list as if the shell received the +interrupt; previous versions continue with the next command in the list. +

    + +

    compat41 +
    If set, Bash, when in POSIX mode, treats a single quote in a double-quoted +parameter expansion as a special character. The single quotes must match +(an even number) and the characters between the single quotes are considered +quoted. This is the behavior of POSIX mode through version 4.1. +The default Bash behavior remains as in previous versions. +

    + +

    compat42 +
    If set, Bash +does not process the replacement string in the pattern substitution word +expansion using quote removal. +

    + +

    complete_fullquote +
    If set, Bash +quotes all shell metacharacters in filenames and directory names when +performing completion. +If not set, Bash +removes metacharacters such as the dollar sign from the set of +characters that will be quoted in completed filenames +when these metacharacters appear in shell variable references in words to be +completed. +This means that dollar signs in variable names that expand to directories +will not be quoted; +however, any dollar signs appearing in filenames will not be quoted, either. +This is active only when bash is using backslashes to quote completed +filenames. +This variable is set by default, which is the default Bash behavior in +versions through 4.2. +

    + +

    direxpand +
    If set, Bash +replaces directory names with the results of word expansion when performing +filename completion. This changes the contents of the readline editing +buffer. +If not set, Bash attempts to preserve what the user typed. +

    + +

    dirspell +
    If set, Bash +attempts spelling correction on directory names during word completion +if the directory name initially supplied does not exist. +

    + +

    dotglob +
    If set, Bash includes filenames beginning with a `.' in +the results of filename expansion. +

    + +

    execfail +
    If this is set, a non-interactive shell will not exit if +it cannot execute the file specified as an argument to the exec +builtin command. An interactive shell does not exit if exec +fails. +

    + +

    expand_aliases +
    If set, aliases are expanded as described below under Aliases, +6.6 Aliases. +This option is enabled by default for interactive shells. +

    + +

    extdebug +
    If set, behavior intended for use by debuggers is enabled: +

    + +

      +
    1. +The `-F' option to the declare builtin (see section 4.2 Bash Builtin Commands) +displays the source file name and line number corresponding to each function +name supplied as an argument. +

      + +

    2. +If the command run by the DEBUG trap returns a non-zero value, the +next command is skipped and not executed. +

      + +

    3. +If the command run by the DEBUG trap returns a value of 2, and the +shell is executing in a subroutine (a shell function or a shell script +executed by the . or source builtins), a call to +return is simulated. +

      + +

    4. +BASH_ARGC and BASH_ARGV are updated as described in their +descriptions (see section 5.2 Bash Variables). +

      + +

    5. +Function tracing is enabled: command substitution, shell functions, and +subshells invoked with ( command ) inherit the +DEBUG and RETURN traps. +

      + +

    6. +Error tracing is enabled: command substitution, shell functions, and +subshells invoked with ( command ) inherit the +ERR trap. +
    +

    + +

    extglob +
    If set, the extended pattern matching features described above +(see section 3.5.8.1 Pattern Matching) are enabled. +

    + +

    extquote +
    If set, $'string' and $"string" quoting is +performed within ${parameter} expansions +enclosed in double quotes. This option is enabled by default. +

    + +

    failglob +
    If set, patterns which fail to match filenames during filename expansion +result in an expansion error. +

    + +

    force_fignore +
    If set, the suffixes specified by the FIGNORE shell variable +cause words to be ignored when performing word completion even if +the ignored words are the only possible completions. +See section 5.2 Bash Variables, for a description of FIGNORE. +This option is enabled by default. +

    + +

    globasciiranges +
    If set, range expressions used in pattern matching bracket expressions +(see section 3.5.8.1 Pattern Matching) +behave as if in the traditional C locale when performing +comparisons. That is, the current locale's collating sequence +is not taken into account, so +`b' will not collate between `A' and `B', +and upper-case and lower-case ASCII characters will collate together. +

    + +

    globstar +
    If set, the pattern `**' used in a filename expansion context will +match all files and zero or more directories and subdirectories. +If the pattern is followed by a `/', only directories and +subdirectories match. +

    + +

    gnu_errfmt +
    If set, shell error messages are written in the standard GNU error +message format. +

    + +

    histappend +
    If set, the history list is appended to the file named by the value +of the HISTFILE +variable when the shell exits, rather than overwriting the file. +

    + +

    histreedit +
    If set, and Readline +is being used, a user is given the opportunity to re-edit a +failed history substitution. +

    + +

    histverify +
    If set, and Readline +is being used, the results of history substitution are not immediately +passed to the shell parser. Instead, the resulting line is loaded into +the Readline editing buffer, allowing further modification. +

    + +

    hostcomplete +
    If set, and Readline is being used, Bash will attempt to perform +hostname completion when a word containing a `@' is being +completed (see section 8.4.6 Letting Readline Type For You). This option is enabled +by default. +

    + +

    huponexit +
    If set, Bash will send SIGHUP to all jobs when an interactive +login shell exits (see section 3.7.6 Signals). +

    + +

    interactive_comments +
    Allow a word beginning with `#' +to cause that word and all remaining characters on that +line to be ignored in an interactive shell. +This option is enabled by default. +

    + +

    lastpipe +
    If set, and job control is not active, the shell runs the last command of +a pipeline not executed in the background in the current shell environment. +

    + +

    lithist +
    If enabled, and the cmdhist +option is enabled, multi-line commands are saved to the history with +embedded newlines rather than using semicolon separators where possible. +

    + +

    login_shell +
    The shell sets this option if it is started as a login shell +(see section 6.1 Invoking Bash). +The value may not be changed. +

    + +

    mailwarn +
    If set, and a file that Bash is checking for mail has been +accessed since the last time it was checked, the message +"The mail in mailfile has been read" is displayed. +

    + +

    no_empty_cmd_completion +
    If set, and Readline is being used, Bash will not attempt to search +the PATH for possible completions when completion is attempted +on an empty line. +

    + +

    nocaseglob +
    If set, Bash matches filenames in a case-insensitive fashion when +performing filename expansion. +

    + +

    nocasematch +
    If set, Bash matches patterns in a case-insensitive fashion when +performing matching while executing case or [[ +conditional commands. +

    + +

    nullglob +
    If set, Bash allows filename patterns which match no +files to expand to a null string, rather than themselves. +

    + +

    progcomp +
    If set, the programmable completion facilities +(see section 8.6 Programmable Completion) are enabled. +This option is enabled by default. +

    + +

    promptvars +
    If set, prompt strings undergo +parameter expansion, command substitution, arithmetic +expansion, and quote removal after being expanded +as described below (see section 6.9 Controlling the Prompt). +This option is enabled by default. +

    + +

    restricted_shell +
    The shell sets this option if it is started in restricted mode +(see section 6.10 The Restricted Shell). +The value may not be changed. +This is not reset when the startup files are executed, allowing +the startup files to discover whether or not a shell is restricted. +

    + +

    shift_verbose +
    If this is set, the shift +builtin prints an error message when the shift count exceeds the +number of positional parameters. +

    + +

    sourcepath +
    If set, the source builtin uses the value of PATH +to find the directory containing the file supplied as an argument. +This option is enabled by default. +

    + +

    xpg_echo +
    If set, the echo builtin expands backslash-escape sequences +by default. +

    + +

    +

    + +The return status when listing options is zero if all optnames +are enabled, non-zero otherwise. +When setting or unsetting options, the return status is zero unless an +optname is not a valid shell option. +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    4.4 Special Builtins

    + +

    + +For historical reasons, the POSIX standard has classified +several builtin commands as special. +When Bash is executing in POSIX mode, the special builtins +differ from other builtin commands in three respects: +

    + +

      +
    1. +Special builtins are found before shell functions during command lookup. +

      + +

    2. +If a special builtin returns an error status, a non-interactive shell exits. +

      + +

    3. +Assignment statements preceding the command stay in effect in the shell +environment after the command completes. +
    +

    + +When Bash is not executing in POSIX mode, these builtins behave no +differently than the rest of the Bash builtin commands. +The Bash POSIX mode is described in 6.11 Bash POSIX Mode. +

    + +These are the POSIX special builtins: +
     
    break : . continue eval exec exit export readonly return set
    +shift trap unset
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    5. Shell Variables

    + +

    + +

    + + +
    5.1 Bourne Shell Variables  Variables which Bash uses in the same way + as the Bourne Shell.
    5.2 Bash Variables  List of variables that exist in Bash.
    +

    + +This chapter describes the shell variables that Bash uses. +Bash automatically assigns default values to a number of variables. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    5.1 Bourne Shell Variables

    + +

    + +Bash uses certain shell variables in the same way as the Bourne shell. +In some cases, Bash assigns a default value to the variable. +

    + +

    + + +
    CDPATH +
    +A colon-separated list of directories used as a search path for +the cd builtin command. +

    + + +

    HOME +
    +The current user's home directory; the default for the cd builtin +command. +The value of this variable is also used by tilde expansion +(see section 3.5.2 Tilde Expansion). +

    + + +

    IFS +
    +A list of characters that separate fields; used when the shell splits +words as part of expansion. +

    + + +

    MAIL +
    +If this parameter is set to a filename or directory name +and the MAILPATH variable +is not set, Bash informs the user of the arrival of mail in +the specified file or Maildir-format directory. +

    + + +

    MAILPATH +
    +A colon-separated list of filenames which the shell periodically checks +for new mail. +Each list entry can specify the message that is printed when new mail +arrives in the mail file by separating the filename from the message with +a `?'. +When used in the text of the message, $_ expands to the name of +the current mail file. +

    + + +

    OPTARG +
    +The value of the last option argument processed by the getopts builtin. +

    + + +

    OPTIND +
    +The index of the last option argument processed by the getopts builtin. +

    + + +

    PATH +
    +A colon-separated list of directories in which the shell looks for +commands. +A zero-length (null) directory name in the value of PATH indicates the +current directory. +A null directory name may appear as two adjacent colons, or as an initial +or trailing colon. +

    + + +

    PS1 +
    +The primary prompt string. The default value is `\s-\v\$ '. +See section 6.9 Controlling the Prompt, for the complete list of escape +sequences that are expanded before PS1 is displayed. +

    + + +

    PS2 +
    +The secondary prompt string. The default value is `> '. +

    + +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    5.2 Bash Variables

    + +

    + +These variables are set or used by Bash, but other shells +do not normally treat them specially. +

    + +A few variables used by Bash are described in different chapters: +variables for controlling the job control facilities +(see section 7.3 Job Control Variables). +

    + +

    + + +
    BASH +
    +The full pathname used to execute the current instance of Bash. +

    + + +

    BASHOPTS +
    +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the `-s' option to the +shopt builtin command (see section 4.3.2 The Shopt Builtin). +The options appearing in BASHOPTS are those reported +as `on' by `shopt'. +If this variable is in the environment when Bash +starts up, each shell option in the list will be enabled before +reading any startup files. This variable is readonly. +

    + + +

    BASHPID +
    +Expands to the process ID of the current Bash process. +This differs from $$ under certain circumstances, such as subshells +that do not require Bash to be re-initialized. +

    + + +

    BASH_ALIASES +
    +An associative array variable whose members correspond to the internal +list of aliases as maintained by the alias builtin. +(see section 4.1 Bourne Shell Builtins). +Elements added to this array appear in the alias list; unsetting array +elements cause aliases to be removed from the alias list. +

    + + +

    BASH_ARGC +
    +An array variable whose values are the number of parameters in each +frame of the current bash execution call stack. The number of +parameters to the current subroutine (shell function or script executed +with . or source) is at the top of the stack. When a +subroutine is executed, the number of parameters passed is pushed onto +BASH_ARGC. +The shell sets BASH_ARGC only when in extended debugging mode +(see 4.3.2 The Shopt Builtin +for a description of the extdebug option to the shopt +builtin). +

    + + +

    BASH_ARGV +
    +An array variable containing all of the parameters in the current bash +execution call stack. The final parameter of the last subroutine call +is at the top of the stack; the first parameter of the initial call is +at the bottom. When a subroutine is executed, the parameters supplied +are pushed onto BASH_ARGV. +The shell sets BASH_ARGV only when in extended debugging mode +(see 4.3.2 The Shopt Builtin +for a description of the extdebug option to the shopt +builtin). +

    + + +

    BASH_CMDS +
    +An associative array variable whose members correspond to the internal +hash table of commands as maintained by the hash builtin +(see section 4.1 Bourne Shell Builtins). +Elements added to this array appear in the hash table; unsetting array +elements cause commands to be removed from the hash table. +

    + + +

    BASH_COMMAND +
    +The command currently being executed or about to be executed, unless the +shell is executing a command as the result of a trap, +in which case it is the command executing at the time of the trap. +

    + + +

    BASH_COMPAT +
    +The value is used to set the shell's compatibility level. +See section 4.3.2 The Shopt Builtin, for a description of the various compatibility +levels and their effects. +The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42) +corresponding to the desired compatibility level. +If BASH_COMPAT is unset or set to the empty string, the compatibility +level is set to the default for the current version. +If BASH_COMPAT is set to a value that is not one of the valid +compatibility levels, the shell prints an error message and sets the +compatibility level to the default for the current version. +The valid compatibility levels correspond to the compatibility options +accepted by the shopt builtin described above (for example, +compat42 means that 4.2 and 42 are valid values). +The current version is also a valid value. +

    + + +

    BASH_ENV +
    +If this variable is set when Bash is invoked to execute a shell +script, its value is expanded and used as the name of a startup file +to read before executing the script. See section 6.2 Bash Startup Files. +

    + + +

    BASH_EXECUTION_STRING +
    +The command argument to the `-c' invocation option. +

    + + +

    BASH_LINENO +
    +An array variable whose members are the line numbers in source files +where each corresponding member of FUNCNAME was invoked. +${BASH_LINENO[$i]} is the line number in the source file +(${BASH_SOURCE[$i+1]}) where +${FUNCNAME[$i]} was called (or ${BASH_LINENO[$i-1]} if +referenced within another shell function). +Use LINENO to obtain the current line number. +

    + + +

    BASH_REMATCH +
    +An array variable whose members are assigned by the `=~' binary +operator to the [[ conditional command +(see section 3.2.4.2 Conditional Constructs). +The element with index 0 is the portion of the string +matching the entire regular expression. +The element with index n is the portion of the +string matching the nth parenthesized subexpression. +This variable is read-only. +

    + + +

    BASH_SOURCE +
    +An array variable whose members are the source filenames where the +corresponding shell function names in the FUNCNAME array +variable are defined. +The shell function ${FUNCNAME[$i]} is defined in the file +${BASH_SOURCE[$i]} and called from ${BASH_SOURCE[$i+1]} +

    + + +

    BASH_SUBSHELL +
    +Incremented by one within each subshell or subshell environment when +the shell begins executing in that environment. +The initial value is 0. +

    + + +

    BASH_VERSINFO +
    +A readonly array variable (see section 6.7 Arrays) +whose members hold version information for this instance of Bash. +The values assigned to the array members are as follows: +

    + +

    + +
    BASH_VERSINFO[0] +
    The major version number (the release). +

    + +

    BASH_VERSINFO[1] +
    The minor version number (the version). +

    + +

    BASH_VERSINFO[2] +
    The patch level. +

    + +

    BASH_VERSINFO[3] +
    The build version. +

    + +

    BASH_VERSINFO[4] +
    The release status (e.g., beta1). +

    + +

    BASH_VERSINFO[5] +
    The value of MACHTYPE. +
    +

    + + +

    BASH_VERSION +
    +The version number of the current instance of Bash. +

    + + +

    BASH_XTRACEFD +
    +If set to an integer corresponding to a valid file descriptor, Bash +will write the trace output generated when `set -x' +is enabled to that file descriptor. +This allows tracing output to be separated from diagnostic and error +messages. +The file descriptor is closed when BASH_XTRACEFD is unset or assigned +a new value. +Unsetting BASH_XTRACEFD or assigning it the empty string causes the +trace output to be sent to the standard error. +Note that setting BASH_XTRACEFD to 2 (the standard error file +descriptor) and then unsetting it will result in the standard error +being closed. +

    + + +

    CHILD_MAX +
    +Set the number of exited child status values for the shell to remember. +Bash will not allow this value to be decreased below a POSIX-mandated +minimum, and there is a maximum value (currently 8192) that this may +not exceed. +The minimum value is system-dependent. +

    + + +

    COLUMNS +
    +Used by the select command to determine the terminal width +when printing selection lists. +Automatically set if the checkwinsize option is enabled +(see section 4.3.2 The Shopt Builtin), or in an interactive shell upon receipt of a +SIGWINCH. +

    + + +

    COMP_CWORD +
    +An index into ${COMP_WORDS} of the word containing the current +cursor position. +This variable is available only in shell functions invoked by the +programmable completion facilities (see section 8.6 Programmable Completion). +

    + + +

    COMP_LINE +
    +The current command line. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see section 8.6 Programmable Completion). +

    + + +

    COMP_POINT +
    +The index of the current cursor position relative to the beginning of +the current command. +If the current cursor position is at the end of the current command, +the value of this variable is equal to ${#COMP_LINE}. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see section 8.6 Programmable Completion). +

    + + +

    COMP_TYPE +
    +Set to an integer value corresponding to the type of completion attempted +that caused a completion function to be called: +TAB, for normal completion, +`?', for listing completions after successive tabs, +`!', for listing alternatives on partial word completion, +`@', to list completions if the word is not unmodified, +or +`%', for menu completion. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (see section 8.6 Programmable Completion). +

    + + +

    COMP_KEY +
    +The key (or final key of a key sequence) used to invoke the current +completion function. +

    + + +

    COMP_WORDBREAKS +
    +The set of characters that the Readline library treats as word +separators when performing word completion. +If COMP_WORDBREAKS is unset, it loses its special properties, +even if it is subsequently reset. +

    + + +

    COMP_WORDS +
    +An array variable consisting of the individual +words in the current command line. +The line is split into words as Readline would split it, using +COMP_WORDBREAKS as described above. +This variable is available only in shell functions invoked by the +programmable completion facilities (see section 8.6 Programmable Completion). +

    + + +

    COMPREPLY +
    +An array variable from which Bash reads the possible completions +generated by a shell function invoked by the programmable completion +facility (see section 8.6 Programmable Completion). +Each array element contains one possible completion. +

    + + +

    COPROC +
    +An array variable created to hold the file descriptors +for output from and input to an unnamed coprocess (see section 3.2.5 Coprocesses). +

    + + +

    DIRSTACK +
    +An array variable containing the current contents of the directory stack. +Directories appear in the stack in the order they are displayed by the +dirs builtin. +Assigning to members of this array variable may be used to modify +directories already in the stack, but the pushd and popd +builtins must be used to add and remove directories. +Assignment to this variable will not change the current directory. +If DIRSTACK is unset, it loses its special properties, even if +it is subsequently reset. +

    + + +

    EMACS +
    +If Bash finds this variable in the environment when the shell +starts with value `t', it assumes that the shell is running in an +Emacs shell buffer and disables line editing. +

    + + +

    ENV +
    +Similar to BASH_ENV; used when the shell is invoked in +POSIX Mode (see section 6.11 Bash POSIX Mode). +

    + + +

    EUID +
    +The numeric effective user id of the current user. This variable +is readonly. +

    + + +

    FCEDIT +
    +The editor used as a default by the `-e' option to the fc +builtin command. +

    + + +

    FIGNORE +
    +A colon-separated list of suffixes to ignore when performing +filename completion. +A filename whose suffix matches one of the entries in +FIGNORE +is excluded from the list of matched filenames. A sample +value is `.o:~' +

    + + +

    FUNCNAME +
    +An array variable containing the names of all shell functions +currently in the execution call stack. +The element with index 0 is the name of any currently-executing +shell function. +The bottom-most element (the one with the highest index) +is "main". +This variable exists only when a shell function is executing. +Assignments to FUNCNAME have no effect and return an error status. +If FUNCNAME is unset, it loses its special properties, even if +it is subsequently reset. +

    + +This variable can be used with BASH_LINENO and BASH_SOURCE. +Each element of FUNCNAME has corresponding elements in +BASH_LINENO and BASH_SOURCE to describe the call stack. +For instance, ${FUNCNAME[$i]} was called from the file +${BASH_SOURCE[$i+1]} at line number ${BASH_LINENO[$i]}. +The caller builtin displays the current call stack using this +information. +

    + + +

    FUNCNEST +
    +If set to a numeric value greater than 0, defines a maximum function +nesting level. Function invocations that exceed this nesting level +will cause the current command to abort. +

    + + +

    GLOBIGNORE +
    +A colon-separated list of patterns defining the set of filenames to +be ignored by filename expansion. +If a filename matched by a filename expansion pattern also matches one +of the patterns in GLOBIGNORE, it is removed from the list +of matches. +

    + + +

    GROUPS +
    +An array variable containing the list of groups of which the current +user is a member. +Assignments to GROUPS have no effect and return an error status. +If GROUPS is unset, it loses its special properties, even if it is +subsequently reset. +

    + + +

    histchars +
    +Up to three characters which control history expansion, quick +substitution, and tokenization (see section 9.3 History Expansion). +The first character is the +history expansion character, that is, the character which signifies the +start of a history expansion, normally `!'. The second character is the +character which signifies `quick substitution' when seen as the first +character on a line, normally `^'. The optional third character is the +character which indicates that the remainder of the line is a comment when +found as the first character of a word, usually `#'. The history +comment character causes history substitution to be skipped for the +remaining words on the line. It does not necessarily cause the shell +parser to treat the rest of the line as a comment. +

    + + +

    HISTCMD +
    +The history number, or index in the history list, of the current +command. If HISTCMD is unset, it loses its special properties, +even if it is subsequently reset. +

    + + +

    HISTCONTROL +
    +A colon-separated list of values controlling how commands are saved on +the history list. +If the list of values includes `ignorespace', lines which begin +with a space character are not saved in the history list. +A value of `ignoredups' causes lines which match the previous +history entry to not be saved. +A value of `ignoreboth' is shorthand for +`ignorespace' and `ignoredups'. +A value of `erasedups' causes all previous lines matching the +current line to be removed from the history list before that line +is saved. +Any value not in the above list is ignored. +If HISTCONTROL is unset, or does not include a valid value, +all lines read by the shell parser are saved on the history list, +subject to the value of HISTIGNORE. +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +HISTCONTROL. +

    + + +

    HISTFILE +
    +The name of the file to which the command history is saved. The +default value is `~/.bash_history'. +

    + + +

    HISTFILESIZE +
    +The maximum number of lines contained in the history file. +When this variable is assigned a value, the history file is truncated, +if necessary, to contain no more than that number of lines +by removing the oldest entries. +The history file is also truncated to this size after +writing it when a shell exits. +If the value is 0, the history file is truncated to zero size. +Non-numeric values and numeric values less than zero inhibit truncation. +The shell sets the default value to the value of HISTSIZE +after reading any startup files. +

    + + +

    HISTIGNORE +
    +A colon-separated list of patterns used to decide which command +lines should be saved on the history list. Each pattern is +anchored at the beginning of the line and must match the complete +line (no implicit `*' is appended). Each pattern is tested +against the line after the checks specified by HISTCONTROL +are applied. In addition to the normal shell pattern matching +characters, `&' matches the previous history line. `&' +may be escaped using a backslash; the backslash is removed +before attempting a match. +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +HISTIGNORE. +

    + +HISTIGNORE subsumes the function of HISTCONTROL. A +pattern of `&' is identical to ignoredups, and a +pattern of `[ ]*' is identical to ignorespace. +Combining these two patterns, separating them with a colon, +provides the functionality of ignoreboth. +

    + + +

    HISTSIZE +
    +The maximum number of commands to remember on the history list. +If the value is 0, commands are not saved in the history list. +Numeric values less than zero result in every command being saved +on the history list (there is no limit). +The shell sets the default value to 500 after reading any startup files. +

    + + +

    HISTTIMEFORMAT +
    +If this variable is set and not null, its value is used as a format string +for strftime to print the time stamp associated with each history +entry displayed by the history builtin. +If this variable is set, time stamps are written to the history file so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. +

    + + +

    HOSTFILE +
    +Contains the name of a file in the same format as `/etc/hosts' that +should be read when the shell needs to complete a hostname. +The list of possible hostname completions may be changed while the shell +is running; +the next time hostname completion is attempted after the +value is changed, Bash adds the contents of the new file to the +existing list. +If HOSTFILE is set, but has no value, or does not name a readable file, +Bash attempts to read +`/etc/hosts' to obtain the list of possible hostname completions. +When HOSTFILE is unset, the hostname list is cleared. +

    + + +

    HOSTNAME +
    +The name of the current host. +

    + + +

    HOSTTYPE +
    +A string describing the machine Bash is running on. +

    + + +

    IGNOREEOF +
    +Controls the action of the shell on receipt of an EOF character +as the sole input. If set, the value denotes the number +of consecutive EOF characters that can be read as the +first character on an input line +before the shell will exit. If the variable exists but does not +have a numeric value (or has no value) then the default is 10. +If the variable does not exist, then EOF signifies the end of +input to the shell. This is only in effect for interactive shells. +

    + + +

    INPUTRC +
    +The name of the Readline initialization file, overriding the default +of `~/.inputrc'. +

    + + +

    LANG +
    +Used to determine the locale category for any category not specifically +selected with a variable starting with LC_. +

    + + +

    LC_ALL +
    +This variable overrides the value of LANG and any other +LC_ variable specifying a locale category. +

    + + +

    LC_COLLATE +
    +This variable determines the collation order used when sorting the +results of filename expansion, and +determines the behavior of range expressions, equivalence classes, +and collating sequences within filename expansion and pattern matching +(see section 3.5.8 Filename Expansion). +

    + + +

    LC_CTYPE +
    +This variable determines the interpretation of characters and the +behavior of character classes within filename expansion and pattern +matching (see section 3.5.8 Filename Expansion). +

    + + +

    LC_MESSAGES +
    +This variable determines the locale used to translate double-quoted +strings preceded by a `$' (see section 3.1.2.5 Locale-Specific Translation). +

    + + +

    LC_NUMERIC +
    +This variable determines the locale category used for number formatting. +

    + + +

    LINENO +
    +The line number in the script or shell function currently executing. +

    + + +

    LINES +
    +Used by the select command to determine the column length +for printing selection lists. +Automatically set if the checkwinsize option is enabled +(see section 4.3.2 The Shopt Builtin), or in an interactive shell upon receipt of a +SIGWINCH. +

    + + +

    MACHTYPE +
    +A string that fully describes the system type on which Bash +is executing, in the standard GNU cpu-company-system format. +

    + + +

    MAILCHECK +
    +How often (in seconds) that the shell should check for mail in the +files specified in the MAILPATH or MAIL variables. +The default is 60 seconds. When it is time to check +for mail, the shell does so before displaying the primary prompt. +If this variable is unset, or set to a value that is not a number +greater than or equal to zero, the shell disables mail checking. +

    + + +

    MAPFILE +
    +An array variable created to hold the text read by the +mapfile builtin when no variable name is supplied. +

    + + +

    OLDPWD +
    +The previous working directory as set by the cd builtin. +

    + + +

    OPTERR +
    +If set to the value 1, Bash displays error messages +generated by the getopts builtin command. +

    + + +

    OSTYPE +
    +A string describing the operating system Bash is running on. +

    + + +

    PIPESTATUS +
    +An array variable (see section 6.7 Arrays) +containing a list of exit status values from the processes +in the most-recently-executed foreground pipeline (which may +contain only a single command). +

    + + +

    POSIXLY_CORRECT +
    +If this variable is in the environment when Bash starts, the shell +enters POSIX mode (see section 6.11 Bash POSIX Mode) before reading the +startup files, as if the `--posix' invocation option had been supplied. +If it is set while the shell is running, Bash enables POSIX mode, +as if the command +
     
    set -o posix
    +
    had been executed. +

    + + +

    PPID +
    +The process ID of the shell's parent process. This variable +is readonly. +

    + + +

    PROMPT_COMMAND +
    +If set, the value is interpreted as a command to execute +before the printing of each primary prompt ($PS1). +

    + + +

    PROMPT_DIRTRIM +
    +If set to a number greater than zero, the value is used as the number of +trailing directory components to retain when expanding the \w and +\W prompt string escapes (see section 6.9 Controlling the Prompt). +Characters removed are replaced with an ellipsis. +

    + + +

    PS3 +
    +The value of this variable is used as the prompt for the +select command. If this variable is not set, the +select command prompts with `#? ' +

    + + +

    PS4 +
    +The value is the prompt printed before the command line is echoed +when the `-x' option is set (see section 4.3.1 The Set Builtin). +The first character of PS4 is replicated multiple times, as +necessary, to indicate multiple levels of indirection. +The default is `+ '. +

    + + +

    PWD +
    +The current working directory as set by the cd builtin. +

    + + +

    RANDOM +
    +Each time this parameter is referenced, a random integer +between 0 and 32767 is generated. Assigning a value to this +variable seeds the random number generator. +

    + + +

    READLINE_LINE +
    +The contents of the Readline line buffer, for use +with `bind -x' (see section 4.2 Bash Builtin Commands). +

    + + +

    READLINE_POINT +
    +The position of the insertion point in the Readline line buffer, for use +with `bind -x' (see section 4.2 Bash Builtin Commands). +

    + + +

    REPLY +
    +The default variable for the read builtin. +

    + + +

    SECONDS +
    +This variable expands to the number of seconds since the +shell was started. Assignment to this variable resets +the count to the value assigned, and the expanded value +becomes the value assigned plus the number of seconds +since the assignment. +

    + + +

    SHELL +
    +The full pathname to the shell is kept in this environment variable. +If it is not set when the shell starts, +Bash assigns to it the full pathname of the current user's login shell. +

    + + +

    SHELLOPTS +
    +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the `-o' option to the +set builtin command (see section 4.3.1 The Set Builtin). +The options appearing in SHELLOPTS are those reported +as `on' by `set -o'. +If this variable is in the environment when Bash +starts up, each shell option in the list will be enabled before +reading any startup files. This variable is readonly. +

    + + +

    SHLVL +
    +Incremented by one each time a new instance of Bash is started. This is +intended to be a count of how deeply your Bash shells are nested. +

    + + +

    TIMEFORMAT +
    +The value of this parameter is used as a format string specifying +how the timing information for pipelines prefixed with the time +reserved word should be displayed. +The `%' character introduces an +escape sequence that is expanded to a time value or other +information. +The escape sequences and their meanings are as +follows; the braces denote optional portions. +

    + +

    + +
    %% +
    A literal `%'. +

    + +

    %[p][l]R +
    The elapsed time in seconds. +

    + +

    %[p][l]U +
    The number of CPU seconds spent in user mode. +

    + +

    %[p][l]S +
    The number of CPU seconds spent in system mode. +

    + +

    %P +
    The CPU percentage, computed as (%U + %S) / %R. +
    +

    + +The optional p is a digit specifying the precision, the number of +fractional digits after a decimal point. +A value of 0 causes no decimal point or fraction to be output. +At most three places after the decimal point may be specified; values +of p greater than 3 are changed to 3. +If p is not specified, the value 3 is used. +

    + +The optional l specifies a longer format, including minutes, of +the form MMmSS.FFs. +The value of p determines whether or not the fraction is included. +

    + +If this variable is not set, Bash acts as if it had the value +
     
    $'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'
    +
    If the value is null, no timing information is displayed. +A trailing newline is added when the format string is displayed. +

    + + +

    TMOUT +
    +If set to a value greater than zero, TMOUT is treated as the +default timeout for the read builtin (see section 4.2 Bash Builtin Commands). +The select command (see section 3.2.4.2 Conditional Constructs) terminates +if input does not arrive after TMOUT seconds when input is coming +from a terminal. +

    + +In an interactive shell, the value is interpreted as +the number of seconds to wait for a line of input after issuing +the primary prompt. +Bash +terminates after waiting for that number of seconds if a complete +line of input does not arrive. +

    + + +

    TMPDIR +
    +If set, Bash uses its value as the name of a directory in which +Bash creates temporary files for the shell's use. +

    + + +

    UID +
    +The numeric real user id of the current user. This variable is readonly. +

    + +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    6. Bash Features

    + +

    + +This chapter describes features unique to Bash. +

    + +

    + + + + + + + + + + + +
    6.1 Invoking Bash  Command line options that you can give + to Bash.
    6.2 Bash Startup Files  When and how Bash executes scripts.
    6.3 Interactive Shells  What an interactive shell is.
    6.4 Bash Conditional Expressions  Primitives used in composing expressions for + the test builtin.
    6.5 Shell Arithmetic  Arithmetic on shell variables.
    6.6 Aliases  Substituting one command for another.
    6.7 Arrays  Array Variables.
    6.8 The Directory Stack  History of visited directories.
    6.9 Controlling the Prompt  Customizing the various prompt strings.
    6.10 The Restricted Shell  A more controlled mode of shell execution.
    6.11 Bash POSIX Mode  Making Bash behave more closely to what + the POSIX standard specifies.
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    6.1 Invoking Bash

    + +

    + +
     
    bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o option] [-O shopt_option] [argument ...]
    +bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o option] [-O shopt_option] -c string [argument ...]
    +bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o option] [-O shopt_option] [argument ...]
    +

    + +All of the single-character options used with the set builtin +(see section 4.3.1 The Set Builtin) can be used as options when the shell is invoked. +In addition, there are several multi-character +options that you can use. These options must appear on the command +line before the single-character options to be recognized. +

    + +

    +
    --debugger +
    Arrange for the debugger profile to be executed before the shell +starts. Turns on extended debugging mode (see 4.3.2 The Shopt Builtin +for a description of the extdebug option to the shopt +builtin). +

    + +

    --dump-po-strings +
    A list of all double-quoted strings preceded by `$' +is printed on the standard output +in the GNU gettext PO (portable object) file format. +Equivalent to `-D' except for the output format. +

    + +

    --dump-strings +
    Equivalent to `-D'. +

    + +

    --help +
    Display a usage message on standard output and exit successfully. +

    + +

    --init-file filename +
    --rcfile filename +
    Execute commands from filename (instead of `~/.bashrc') +in an interactive shell. +

    + +

    --login +
    Equivalent to `-l'. +

    + +

    --noediting +
    Do not use the GNU Readline library (see section 8. Command Line Editing) +to read command lines when the shell is interactive. +

    + +

    --noprofile +
    Don't load the system-wide startup file `/etc/profile' +or any of the personal initialization files +`~/.bash_profile', `~/.bash_login', or `~/.profile' +when Bash is invoked as a login shell. +

    + +

    --norc +
    Don't read the `~/.bashrc' initialization file in an +interactive shell. This is on by default if the shell is +invoked as sh. +

    + +

    --posix +
    Change the behavior of Bash where the default operation differs +from the POSIX standard to match the standard. This +is intended to make Bash behave as a strict superset of that +standard. See section 6.11 Bash POSIX Mode, for a description of the Bash +POSIX mode. +

    + +

    --restricted +
    Make the shell a restricted shell (see section 6.10 The Restricted Shell). +

    + +

    --verbose +
    Equivalent to `-v'. Print shell input lines as they're read. +

    + +

    --version +
    Show version information for this instance of +Bash on the standard output and exit successfully. +
    +

    + +There are several single-character options that may be supplied at +invocation which are not available with the set builtin. +

    + +

    +
    -c +
    Read and execute commands from the first non-option argument +after processing the options, then exit. +Any remaining arguments are assigned to the +positional parameters, starting with $0. +

    + +

    -i +
    Force the shell to run interactively. Interactive shells are +described in 6.3 Interactive Shells. +

    + +

    -l +
    Make this shell act as if it had been directly invoked by login. +When the shell is interactive, this is equivalent to starting a +login shell with `exec -l bash'. +When the shell is not interactive, the login shell startup files will +be executed. +`exec bash -l' or `exec bash --login' +will replace the current shell with a Bash login shell. +See section 6.2 Bash Startup Files, for a description of the special behavior +of a login shell. +

    + +

    -r +
    Make the shell a restricted shell (see section 6.10 The Restricted Shell). +

    + +

    -s +
    If this option is present, or if no arguments remain after option +processing, then commands are read from the standard input. +This option allows the positional parameters to be set +when invoking an interactive shell. +

    + +

    -D +
    A list of all double-quoted strings preceded by `$' +is printed on the standard output. +These are the strings that +are subject to language translation when the current locale +is not C or POSIX (see section 3.1.2.5 Locale-Specific Translation). +This implies the `-n' option; no commands will be executed. +

    + +

    [-+]O [shopt_option] +
    shopt_option is one of the shell options accepted by the +shopt builtin (see section 4.3.2 The Shopt Builtin). +If shopt_option is present, `-O' sets the value of that option; +`+O' unsets it. +If shopt_option is not supplied, the names and values of the shell +options accepted by shopt are printed on the standard output. +If the invocation option is `+O', the output is displayed in a format +that may be reused as input. +

    + +

    -- +
    A -- signals the end of options and disables further option +processing. +Any arguments after the -- are treated as filenames and arguments. +
    +

    + + +A login shell is one whose first character of argument zero is +`-', or one invoked with the `--login' option. +

    + + +An interactive shell is one started without non-option arguments, +unless `-s' is specified, +without specifying the `-c' option, and whose input and output are both +connected to terminals (as determined by isatty(3)), or one +started with the `-i' option. See section 6.3 Interactive Shells, for more +information. +

    + +If arguments remain after option processing, and neither the +`-c' nor the `-s' +option has been supplied, the first argument is assumed to +be the name of a file containing shell commands (see section 3.8 Shell Scripts). +When Bash is invoked in this fashion, $0 +is set to the name of the file, and the positional parameters +are set to the remaining arguments. +Bash reads and executes commands from this file, then exits. +Bash's exit status is the exit status of the last command executed +in the script. If no commands are executed, the exit status is 0. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    6.2 Bash Startup Files

    + +

    + +This section describes how Bash executes its startup files. +If any of the files exist but cannot be read, Bash reports an error. +Tildes are expanded in filenames as described above under +Tilde Expansion (see section 3.5.2 Tilde Expansion). +

    + +Interactive shells are described in 6.3 Interactive Shells. +

    + + +

    Invoked as an interactive login shell, or with `--login'

    + +

    + +When Bash is invoked as an interactive login shell, or as a +non-interactive shell with the `--login' option, it first reads and +executes commands from the file `/etc/profile', if that file exists. +After reading that file, it looks for `~/.bash_profile', +`~/.bash_login', and `~/.profile', in that order, and reads +and executes commands from the first one that exists and is readable. +The `--noprofile' option may be used when the shell is started to +inhibit this behavior. +

    + +When a login shell exits, Bash reads and executes commands from +the file `~/.bash_logout', if it exists. +

    + + +

    Invoked as an interactive non-login shell

    + +

    + +When an interactive shell that is not a login shell is started, Bash +reads and executes commands from `~/.bashrc', if that file exists. +This may be inhibited by using the `--norc' option. +The `--rcfile file' option will force Bash to read and +execute commands from file instead of `~/.bashrc'. +

    + +So, typically, your `~/.bash_profile' contains the line +
     
    if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
    +
    after (or before) any login-specific initializations. +

    + + +

    Invoked non-interactively

    + +

    + +When Bash is started non-interactively, to run a shell script, +for example, it looks for the variable BASH_ENV in the environment, +expands its value if it appears there, and uses the expanded value as +the name of a file to read and execute. Bash behaves as if the +following command were executed: +
     
    if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi
    +
    but the value of the PATH variable is not used to search for the +filename. +

    + +As noted above, if a non-interactive shell is invoked with the +`--login' option, Bash attempts to read and execute commands from the +login shell startup files. +

    + + +

    Invoked with name sh

    + +

    + +If Bash is invoked with the name sh, it tries to mimic the +startup behavior of historical versions of sh as closely as +possible, while conforming to the POSIX standard as well. +

    + +When invoked as an interactive login shell, or as a non-interactive +shell with the `--login' option, it first attempts to read +and execute commands from `/etc/profile' and `~/.profile', in +that order. +The `--noprofile' option may be used to inhibit this behavior. +When invoked as an interactive shell with the name sh, Bash +looks for the variable ENV, expands its value if it is defined, +and uses the expanded value as the name of a file to read and execute. +Since a shell invoked as sh does not attempt to read and execute +commands from any other startup files, the `--rcfile' option has +no effect. +A non-interactive shell invoked with the name sh does not attempt +to read any other startup files. +

    + +When invoked as sh, Bash enters POSIX mode after +the startup files are read. +

    + + +

    Invoked in POSIX mode

    + +

    + +When Bash is started in POSIX mode, as with the +`--posix' command line option, it follows the POSIX standard +for startup files. +In this mode, interactive shells expand the ENV variable +and commands are read and executed from the file whose name is the +expanded value. +No other startup files are read. +

    + + +

    Invoked by remote shell daemon

    + +

    + +Bash attempts to determine when it is being run with its standard input +connected to a network connection, as when executed by the remote shell +daemon, usually rshd, or the secure shell daemon sshd. +If Bash determines it is being run in +this fashion, it reads and executes commands from `~/.bashrc', if that +file exists and is readable. +It will not do this if invoked as sh. +The `--norc' option may be used to inhibit this behavior, and the +`--rcfile' option may be used to force another file to be read, but +neither rshd nor sshd generally invoke the shell with those +options or allow them to be specified. +

    + + +

    Invoked with unequal effective and real UID/GIDs

    + +

    + +If Bash is started with the effective user (group) id not equal to the +real user (group) id, and the `-p' option is not supplied, no startup +files are read, shell functions are not inherited from the environment, +the SHELLOPTS, BASHOPTS, CDPATH, and GLOBIGNORE +variables, if they appear in the environment, are ignored, and the effective +user id is set to the real user id. +If the `-p' option is supplied at invocation, the startup behavior is +the same, but the effective user id is not reset. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    6.3 Interactive Shells

    + +

    + +

    + + + +
    6.3.1 What is an Interactive Shell?  What determines whether a shell is Interactive.
    6.3.2 Is this Shell Interactive?  How to tell if a shell is interactive.
    6.3.3 Interactive Shell Behavior  What changes in a interactive shell?
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    6.3.1 What is an Interactive Shell?

    + +

    + +An interactive shell +is one started without non-option arguments, unless `-s' is +specified, without specifying the `-c' option, and +whose input and error output are both +connected to terminals (as determined by isatty(3)), +or one started with the `-i' option. +

    + +An interactive shell generally reads from and writes to a user's +terminal. +

    + +The `-s' invocation option may be used to set the positional parameters +when an interactive shell is started. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    6.3.2 Is this Shell Interactive?

    + +

    + +To determine within a startup script whether or not Bash is +running interactively, +test the value of the `-' special parameter. +It contains i when the shell is interactive. For example: +

    + +
     
    case "$-" in
    +*i*)	echo This shell is interactive ;;
    +*)	echo This shell is not interactive ;;
    +esac
    +

    + +Alternatively, startup scripts may examine the variable +PS1; it is unset in non-interactive shells, and set in +interactive shells. Thus: +

    + +
     
    if [ -z "$PS1" ]; then
    +        echo This shell is not interactive
    +else
    +        echo This shell is interactive
    +fi
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    6.3.3 Interactive Shell Behavior

    + +

    + +When the shell is running interactively, it changes its behavior in +several ways. +

    + +

      +
    1. +Startup files are read and executed as described in 6.2 Bash Startup Files. +

      + +

    2. +Job Control (see section 7. Job Control) is enabled by default. When job +control is in effect, Bash ignores the keyboard-generated job control +signals SIGTTIN, SIGTTOU, and SIGTSTP. +

      + +

    3. +Bash expands and displays PS1 before reading the first line +of a command, and expands and displays PS2 before reading the +second and subsequent lines of a multi-line command. +

      + +

    4. +Bash executes the value of the PROMPT_COMMAND variable as a command +before printing the primary prompt, $PS1 +(see section 5.2 Bash Variables). +

      + +

    5. +Readline (see section 8. Command Line Editing) is used to read commands from +the user's terminal. +

      + +

    6. +Bash inspects the value of the ignoreeof option to set -o +instead of exiting immediately when it receives an EOF on its +standard input when reading a command (see section 4.3.1 The Set Builtin). +

      + +

    7. +Command history (see section 9.1 Bash History Facilities) +and history expansion (see section 9.3 History Expansion) +are enabled by default. +Bash will save the command history to the file named by $HISTFILE +when a shell with history enabled exits. +

      + +

    8. +Alias expansion (see section 6.6 Aliases) is performed by default. +

      + +

    9. +In the absence of any traps, Bash ignores SIGTERM +(see section 3.7.6 Signals). +

      + +

    10. +In the absence of any traps, SIGINT is caught and handled +((see section 3.7.6 Signals). +SIGINT will interrupt some shell builtins. +

      + +

    11. +An interactive login shell sends a SIGHUP to all jobs on exit +if the huponexit shell option has been enabled (see section 3.7.6 Signals). +

      + +

    12. +The `-n' invocation option is ignored, and `set -n' has +no effect (see section 4.3.1 The Set Builtin). +

      + +

    13. +Bash will check for mail periodically, depending on the values of the +MAIL, MAILPATH, and MAILCHECK shell variables +(see section 5.2 Bash Variables). +

      + +

    14. +Expansion errors due to references to unbound shell variables after +`set -u' has been enabled will not cause the shell to exit +(see section 4.3.1 The Set Builtin). +

      + +

    15. +The shell will not exit on expansion errors caused by var being unset +or null in ${var:?word} expansions +(see section 3.5.3 Shell Parameter Expansion). +

      + +

    16. +Redirection errors encountered by shell builtins will not cause the +shell to exit. +

      + +

    17. +When running in POSIX mode, a special builtin returning an error +status will not cause the shell to exit (see section 6.11 Bash POSIX Mode). +

      + +

    18. +A failed exec will not cause the shell to exit +(see section 4.1 Bourne Shell Builtins). +

      + +

    19. +Parser syntax errors will not cause the shell to exit. +

      + +

    20. +Simple spelling correction for directory arguments to the cd +builtin is enabled by default (see the description of the cdspell +option to the shopt builtin in 4.3.2 The Shopt Builtin). +

      + +

    21. +The shell will check the value of the TMOUT variable and exit +if a command is not read within the specified number of seconds after +printing $PS1 (see section 5.2 Bash Variables). +

      + +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    6.4 Bash Conditional Expressions

    + +

    + +Conditional expressions are used by the [[ compound command +and the test and [ builtin commands. +

    + +Expressions may be unary or binary. +Unary expressions are often used to examine the status of a file. +There are string operators and numeric comparison operators as well. +If the file argument to one of the primaries is of the form +`/dev/fd/N', then file descriptor N is checked. +If the file argument to one of the primaries is one of +`/dev/stdin', `/dev/stdout', or `/dev/stderr', file +descriptor 0, 1, or 2, respectively, is checked. +

    + +When used with [[, the `<' and `>' operators sort +lexicographically using the current locale. +The test command uses ASCII ordering. +

    + +Unless otherwise specified, primaries that operate on files follow symbolic +links and operate on the target of the link, rather than the link itself. +

    + +

    +
    -a file +
    True if file exists. +

    + +

    -b file +
    True if file exists and is a block special file. +

    + +

    -c file +
    True if file exists and is a character special file. +

    + +

    -d file +
    True if file exists and is a directory. +

    + +

    -e file +
    True if file exists. +

    + +

    -f file +
    True if file exists and is a regular file. +

    + +

    -g file +
    True if file exists and its set-group-id bit is set. +

    + +

    -h file +
    True if file exists and is a symbolic link. +

    + +

    -k file +
    True if file exists and its "sticky" bit is set. +

    + +

    -p file +
    True if file exists and is a named pipe (FIFO). +

    + +

    -r file +
    True if file exists and is readable. +

    + +

    -s file +
    True if file exists and has a size greater than zero. +

    + +

    -t fd +
    True if file descriptor fd is open and refers to a terminal. +

    + +

    -u file +
    True if file exists and its set-user-id bit is set. +

    + +

    -w file +
    True if file exists and is writable. +

    + +

    -x file +
    True if file exists and is executable. +

    + +

    -G file +
    True if file exists and is owned by the effective group id. +

    + +

    -L file +
    True if file exists and is a symbolic link. +

    + +

    -N file +
    True if file exists and has been modified since it was last read. +

    + +

    -O file +
    True if file exists and is owned by the effective user id. +

    + +

    -S file +
    True if file exists and is a socket. +

    + +

    file1 -ef file2 +
    True if file1 and file2 refer to the same device and +inode numbers. +

    + +

    file1 -nt file2 +
    True if file1 is newer (according to modification date) +than file2, or if file1 exists and file2 does not. +

    + +

    file1 -ot file2 +
    True if file1 is older than file2, +or if file2 exists and file1 does not. +

    + +

    -o optname +
    True if the shell option optname is enabled. +The list of options appears in the description of the `-o' +option to the set builtin (see section 4.3.1 The Set Builtin). +

    + +

    -v varname +
    True if the shell variable varname is set (has been assigned a value). +

    + +

    -R varname +
    True if the shell variable varname is set and is a name reference. +

    + +

    -z string +
    True if the length of string is zero. +

    + +

    -n string +
    string +
    True if the length of string is non-zero. +

    + +

    string1 == string2 +
    string1 = string2 +
    True if the strings are equal. +When used with the [[ command, this performs pattern matching as +described above (see section 3.2.4.2 Conditional Constructs). +

    + +`=' should be used with the test command for POSIX conformance. +

    + +

    string1 != string2 +
    True if the strings are not equal. +

    + +

    string1 < string2 +
    True if string1 sorts before string2 lexicographically. +

    + +

    string1 > string2 +
    True if string1 sorts after string2 lexicographically. +

    + +

    arg1 OP arg2 +
    OP is one of +`-eq', `-ne', `-lt', `-le', `-gt', or `-ge'. +These arithmetic binary operators return true if arg1 +is equal to, not equal to, less than, less than or equal to, +greater than, or greater than or equal to arg2, +respectively. Arg1 and arg2 +may be positive or negative integers. +
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    6.5 Shell Arithmetic

    + +

    + +The shell allows arithmetic expressions to be evaluated, as one of +the shell expansions or by the let and the `-i' option +to the declare builtins. +

    + +Evaluation is done in fixed-width integers with no check for overflow, +though division by 0 is trapped and flagged as an error. +The operators and their precedence, associativity, and values +are the same as in the C language. +The following list of operators is grouped into levels of +equal-precedence operators. +The levels are listed in order of decreasing precedence. +

    + +

    + +
    id++ id-- +
    variable post-increment and post-decrement +

    + +

    ++id --id +
    variable pre-increment and pre-decrement +

    + +

    - + +
    unary minus and plus +

    + +

    ! ~ +
    logical and bitwise negation +

    + +

    ** +
    exponentiation +

    + +

    * / % +
    multiplication, division, remainder +

    + +

    + - +
    addition, subtraction +

    + +

    << >> +
    left and right bitwise shifts +

    + +

    <= >= < > +
    comparison +

    + +

    == != +
    equality and inequality +

    + +

    & +
    bitwise AND +

    + +

    ^ +
    bitwise exclusive OR +

    + +

    | +
    bitwise OR +

    + +

    && +
    logical AND +

    + +

    || +
    logical OR +

    + +

    expr ? expr : expr +
    conditional operator +

    + +

    = *= /= %= += -= <<= >>= &= ^= |= +
    assignment +

    + +

    expr1 , expr2 +
    comma +
    +

    + +Shell variables are allowed as operands; parameter expansion is +performed before the expression is evaluated. +Within an expression, shell variables may also be referenced by name +without using the parameter expansion syntax. +A shell variable that is null or unset evaluates to 0 when referenced +by name without using the parameter expansion syntax. +The value of a variable is evaluated as an arithmetic expression +when it is referenced, or when a variable which has been given the +integer attribute using `declare -i' is assigned a value. +A null value evaluates to 0. +A shell variable need not have its integer attribute turned on +to be used in an expression. +

    + +Constants with a leading 0 are interpreted as octal numbers. +A leading `0x' or `0X' denotes hexadecimal. Otherwise, +numbers take the form [base#]n, where the optional base +is a decimal number between 2 and 64 representing the arithmetic +base, and n is a number in that base. +If base# is omitted, then base 10 is used. +When specifying n, +he digits greater than 9 are represented by the lowercase letters, +the uppercase letters, `@', and `_', in that order. +If base is less than or equal to 36, lowercase and uppercase +letters may be used interchangeably to represent numbers between 10 +and 35. +

    + +Operators are evaluated in order of precedence. Sub-expressions in +parentheses are evaluated first and may override the precedence +rules above. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    6.6 Aliases

    + +

    + +Aliases allow a string to be substituted for a word when it is used +as the first word of a simple command. +The shell maintains a list of aliases that may be set and unset with +the alias and unalias builtin commands. +

    + +The first word of each simple command, if unquoted, is checked to see +if it has an alias. +If so, that word is replaced by the text of the alias. +The characters `/', `$', ``', `=' and any of the +shell metacharacters or quoting characters listed above may not appear +in an alias name. +The replacement text may contain any valid +shell input, including shell metacharacters. +The first word of the replacement text is tested for +aliases, but a word that is identical to an alias being expanded +is not expanded a second time. +This means that one may alias ls to "ls -F", +for instance, and Bash does not try to recursively expand the +replacement text. +If the last character of the alias value is a +blank, then the next command word following the +alias is also checked for alias expansion. +

    + +Aliases are created and listed with the alias +command, and removed with the unalias command. +

    + +There is no mechanism for using arguments in the replacement text, +as in csh. +If arguments are needed, a shell function should be used +(see section 3.3 Shell Functions). +

    + +Aliases are not expanded when the shell is not interactive, +unless the expand_aliases shell option is set using +shopt (see section 4.3.2 The Shopt Builtin). +

    + +The rules concerning the definition and use of aliases are +somewhat confusing. Bash +always reads at least one complete line +of input before executing any +of the commands on that line. Aliases are expanded when a +command is read, not when it is executed. Therefore, an +alias definition appearing on the same line as another +command does not take effect until the next line of input is read. +The commands following the alias definition +on that line are not affected by the new alias. +This behavior is also an issue when functions are executed. +Aliases are expanded when a function definition is read, +not when the function is executed, because a function definition +is itself a compound command. As a consequence, aliases +defined in a function are not available until after that +function is executed. To be safe, always put +alias definitions on a separate line, and do not use alias +in compound commands. +

    + +For almost every purpose, shell functions are preferred over aliases. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    6.7 Arrays

    + +

    + +Bash provides one-dimensional indexed and associative array variables. +Any variable may be used as an indexed array; +the declare builtin will explicitly declare an array. +There is no maximum +limit on the size of an array, nor any requirement that members +be indexed or assigned contiguously. +Indexed arrays are referenced using integers (including arithmetic +expressions (see section 6.5 Shell Arithmetic)) and are zero-based; +associative arrays use arbitrary strings. +Unless otherwise noted, indexed array indices must be non-negative integers. +

    + +An indexed array is created automatically if any variable is assigned to +using the syntax +
     
    name[subscript]=value
    +

    + +The subscript +is treated as an arithmetic expression that must evaluate to a number. +To explicitly declare an array, use +
     
    declare -a name
    +
    The syntax +
     
    declare -a name[subscript]
    +
    is also accepted; the subscript is ignored. +

    + +Associative arrays are created using +
     
    declare -A name.
    +

    + +Attributes may be +specified for an array variable using the declare and +readonly builtins. Each attribute applies to all members of +an array. +

    + +Arrays are assigned to using compound assignments of the form +
     
    name=(value1 value2 ... )
    +
    where each +value is of the form [subscript]=string. +Indexed array assignments do not require anything but string. +When assigning to indexed arrays, if +the optional subscript is supplied, that index is assigned to; +otherwise the index of the element assigned is the last index assigned +to by the statement plus one. Indexing starts at zero. +

    + +When assigning to an associative array, the subscript is required. +

    + +This syntax is also accepted by the declare +builtin. Individual array elements may be assigned to using the +name[subscript]=value syntax introduced above. +

    + +When assigning to an indexed array, if name +is subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +name, so negative indices count back from the end of the +array, and an index of -1 references the last element. +

    + +Any element of an array may be referenced using +${name[subscript]}. +The braces are required to avoid +conflicts with the shell's filename expansion operators. If the +subscript is `@' or `*', the word expands to all members +of the array name. These subscripts differ only when the word +appears within double quotes. +If the word is double-quoted, +${name[*]} expands to a single word with +the value of each array member separated by the first character of the +IFS variable, and ${name[@]} expands each element of +name to a separate word. When there are no array members, +${name[@]} expands to nothing. +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +This is analogous to the +expansion of the special parameters `@' and `*'. +${#name[subscript]} expands to the length of +${name[subscript]}. +If subscript is `@' or +`*', the expansion is the number of elements in the array. +Referencing an array variable without a subscript is equivalent to +referencing with a subscript of 0. +If the subscript +used to reference an element of an indexed array +evaluates to a number less than zero, it is +interpreted as relative to one greater than the maximum index of the array, +so negative indices count back from the end of the array, +and an index of -1 refers to the last element. +

    + +An array variable is considered set if a subscript has been assigned a +value. The null string is a valid value. +

    + +It is possible to obtain the keys (indices) of an array as well as the values. +${!name[@]} and ${!name[*]} expand to the indices +assigned in array variable name. +The treatment when in double quotes is similar to the expansion of the +special parameters `@' and `*' within double quotes. +

    + +The unset builtin is used to destroy arrays. +unset name[subscript] +destroys the array element at index subscript. +Negative subscripts to indexed arrays are interpreted as described above. +Care must be taken to avoid unwanted side effects caused by filename +expansion. +unset name, where name is an array, removes the +entire array. A subscript of `*' or `@' also removes the +entire array. +

    + +The declare, local, and readonly +builtins each accept a `-a' option to specify an indexed +array and a `-A' option to specify an associative array. +If both options are supplied, `-A' takes precedence. +The read builtin accepts a `-a' +option to assign a list of words read from the standard input +to an array, and can read values from the standard input into +individual array elements. The set and declare +builtins display array values in a way that allows them to be +reused as input. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    6.8 The Directory Stack

    + +

    + +

    + +
    6.8.1 Directory Stack Builtins  Bash builtin commands to manipulate + the directory stack.
    +

    + +The directory stack is a list of recently-visited directories. The +pushd builtin adds directories to the stack as it changes +the current directory, and the popd builtin removes specified +directories from the stack and changes the current directory to +the directory removed. The dirs builtin displays the contents +of the directory stack. +

    + +The contents of the directory stack are also visible +as the value of the DIRSTACK shell variable. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    6.8.1 Directory Stack Builtins

    + +

    + +

    + +
    dirs +
    +
     
    dirs [-clpv] [+N | -N]
    +

    + +Display the list of currently remembered directories. Directories +are added to the list with the pushd command; the +popd command removes directories from the list. +

    + +

    +
    -c +
    Clears the directory stack by deleting all of the elements. +
    -l +
    Produces a listing using full pathnames; +the default listing format uses a tilde to denote the home directory. +
    -p +
    Causes dirs to print the directory stack with one entry per +line. +
    -v +
    Causes dirs to print the directory stack with one entry per +line, prefixing each entry with its index in the stack. +
    +N +
    Displays the Nth directory (counting from the left of the +list printed by dirs when invoked without options), starting +with zero. +
    -N +
    Displays the Nth directory (counting from the right of the +list printed by dirs when invoked without options), starting +with zero. +
    +

    + +

    popd +
    +
     
    popd [-n] [+N | -N]
    +

    + +Remove the top entry from the directory stack, and cd +to the new top directory. +When no arguments are given, popd +removes the top directory from the stack and +performs a cd to the new top directory. The +elements are numbered from 0 starting at the first directory listed with +dirs; that is, popd is equivalent to popd +0. +

    + +

    +
    -n +
    Suppresses the normal change of directory when removing directories +from the stack, so that only the stack is manipulated. +
    +N +
    Removes the Nth directory (counting from the left of the +list printed by dirs), starting with zero. +
    -N +
    Removes the Nth directory (counting from the right of the +list printed by dirs), starting with zero. +
    +

    + + +

    pushd +
     
    pushd [-n] [+N | -N | dir]
    +

    + +Save the current directory on the top of the directory stack +and then cd to dir. +With no arguments, pushd exchanges the top two directories. +

    + +

    +
    -n +
    Suppresses the normal change of directory when adding directories +to the stack, so that only the stack is manipulated. +
    +N +
    Brings the Nth directory (counting from the left of the +list printed by dirs, starting with zero) to the top of +the list by rotating the stack. +
    -N +
    Brings the Nth directory (counting from the right of the +list printed by dirs, starting with zero) to the top of +the list by rotating the stack. +
    dir +
    Makes the current working directory be the top of the stack, making +it the new current directory as if it had been supplied as an argument +to the cd builtin. +
    +
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    6.9 Controlling the Prompt

    + +

    + +The value of the variable PROMPT_COMMAND is examined just before +Bash prints each primary prompt. If PROMPT_COMMAND is set and +has a non-null value, then the +value is executed just as if it had been typed on the command line. +

    + +In addition, the following table describes the special characters which +can appear in the prompt variables PS1 to PS4: +

    + +

    +
    \a +
    A bell character. +
    \d +
    The date, in "Weekday Month Date" format (e.g., "Tue May 26"). +
    \D{format} +
    The format is passed to strftime(3) and the result is inserted +into the prompt string; an empty format results in a locale-specific +time representation. The braces are required. +
    \e +
    An escape character. +
    \h +
    The hostname, up to the first `.'. +
    \H +
    The hostname. +
    \j +
    The number of jobs currently managed by the shell. +
    \l +
    The basename of the shell's terminal device name. +
    \n +
    A newline. +
    \r +
    A carriage return. +
    \s +
    The name of the shell, the basename of $0 (the portion +following the final slash). +
    \t +
    The time, in 24-hour HH:MM:SS format. +
    \T +
    The time, in 12-hour HH:MM:SS format. +
    \@ +
    The time, in 12-hour am/pm format. +
    \A +
    The time, in 24-hour HH:MM format. +
    \u +
    The username of the current user. +
    \v +
    The version of Bash (e.g., 2.00) +
    \V +
    The release of Bash, version + patchlevel (e.g., 2.00.0) +
    \w +
    The current working directory, with $HOME abbreviated with a tilde +(uses the $PROMPT_DIRTRIM variable). +
    \W +
    The basename of $PWD, with $HOME abbreviated with a tilde. +
    \! +
    The history number of this command. +
    \# +
    The command number of this command. +
    \$ +
    If the effective uid is 0, #, otherwise $. +
    \nnn +
    The character whose ASCII code is the octal value nnn. +
    \\ +
    A backslash. +
    \[ +
    Begin a sequence of non-printing characters. This could be used to +embed a terminal control sequence into the prompt. +
    \] +
    End a sequence of non-printing characters. +
    +

    + +The command number and the history number are usually different: +the history number of a command is its position in the history +list, which may include commands restored from the history file +(see section 9.1 Bash History Facilities), while the command number is +the position in the sequence of commands executed during the current +shell session. +

    + +After the string is decoded, it is expanded via +parameter expansion, command substitution, arithmetic +expansion, and quote removal, subject to the value of the +promptvars shell option (see section 4.2 Bash Builtin Commands). +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    6.10 The Restricted Shell

    + +

    + +If Bash is started with the name rbash, or the +`--restricted' +or +`-r' +option is supplied at invocation, the shell becomes restricted. +A restricted shell is used to +set up an environment more controlled than the standard shell. +A restricted shell behaves identically to bash +with the exception that the following are disallowed or not performed: +

    + +

      +
    • +Changing directories with the cd builtin. +
    • +Setting or unsetting the values of the SHELL, PATH, +ENV, or BASH_ENV variables. +
    • +Specifying command names containing slashes. +
    • +Specifying a filename containing a slash as an argument to the . +builtin command. +
    • +Specifying a filename containing a slash as an argument to the `-p' +option to the hash builtin command. +
    • +Importing function definitions from the shell environment at startup. +
    • +Parsing the value of SHELLOPTS from the shell environment at startup. +
    • +Redirecting output using the `>', `>|', `<>', `>&', +`&>', and `>>' redirection operators. +
    • +Using the exec builtin to replace the shell with another command. +
    • +Adding or deleting builtin commands with the +`-f' and `-d' options to the enable builtin. +
    • +Using the enable builtin command to enable disabled shell builtins. +
    • +Specifying the `-p' option to the command builtin. +
    • +Turning off restricted mode with `set +r' or `set +o restricted'. +
    +

    + +These restrictions are enforced after any startup files are read. +

    + +When a command that is found to be a shell script is executed +(see section 3.8 Shell Scripts), rbash turns off any restrictions in +the shell spawned to execute the script. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    6.11 Bash POSIX Mode

    + +

    + +Starting Bash with the `--posix' command-line option or executing +`set -o posix' while Bash is running will cause Bash to conform more +closely to the POSIX standard by changing the behavior to +match that specified by POSIX in areas where the Bash default differs. +

    + +When invoked as sh, Bash enters POSIX mode after reading the +startup files. +

    + +The following list is what's changed when `POSIX mode' is in effect: +

    + +

      +
    1. +When a command in the hash table no longer exists, Bash will re-search +$PATH to find the new location. This is also available with +`shopt -s checkhash'. +

      + +

    2. +The message printed by the job control code and builtins when a job +exits with a non-zero status is `Done(status)'. +

      + +

    3. +The message printed by the job control code and builtins when a job +is stopped is `Stopped(signame)', where signame is, for +example, SIGTSTP. +

      + +

    4. +The bg builtin uses the required format to describe each job placed +in the background, which does not include an indication of whether the job +is the current or previous job. +

      + +

    5. +Reserved words appearing in a context where reserved words are recognized +do not undergo alias expansion. +

      + +

    6. +The POSIX PS1 and PS2 expansions of `!' to +the history number and `!!' to `!' are enabled, +and parameter expansion is performed on the values of PS1 and +PS2 regardless of the setting of the promptvars option. +

      + +

    7. +The POSIX startup files are executed ($ENV) rather than +the normal Bash files. +

      + +

    8. +Tilde expansion is only performed on assignments preceding a command +name, rather than on all assignment statements on the line. +

      + +

    9. +The command builtin does not prevent builtins that take assignment +statements as arguments from expanding them as assignment statements; +when not in POSIX mode, assignment builtins lose their assignment +statement expansion properties when preceded by command. +

      + +

    10. +The default history file is `~/.sh_history' (this is the +default value of $HISTFILE). +

      + +

    11. +The output of `kill -l' prints all the signal names on a single line, +separated by spaces, without the `SIG' prefix. +

      + +

    12. +The kill builtin does not accept signal names with a `SIG' +prefix. +

      + +

    13. +Non-interactive shells exit if filename in . filename +is not found. +

      + +

    14. +Non-interactive shells exit if a syntax error in an arithmetic expansion +results in an invalid expression. +

      + +

    15. +Non-interactive shells exit if there is a syntax error in a script read +with the . or source builtins, or in a string processed by +the eval builtin. +

      + +

    16. +Redirection operators do not perform filename expansion on the word +in the redirection unless the shell is interactive. +

      + +

    17. +Redirection operators do not perform word splitting on the word in the +redirection. +

      + +

    18. +Function names must be valid shell names. That is, they may not +contain characters other than letters, digits, and underscores, and +may not start with a digit. Declaring a function with an invalid name +causes a fatal syntax error in non-interactive shells. +

      + +

    19. +Function names may not be the same as one of the POSIX special +builtins. +

      + +

    20. +POSIX special builtins are found before shell functions +during command lookup. +

      + +

    21. +The time reserved word may be used by itself as a command. When +used in this way, it displays timing statistics for the shell and its +completed children. The TIMEFORMAT variable controls the format +of the timing information. +

      + +

    22. +When parsing and expanding a ${...} expansion that appears within +double quotes, single quotes are no longer special and cannot be used to +quote a closing brace or other special character, unless the operator is +one of those defined to perform pattern removal. In this case, they do +not have to appear as matched pairs. +

      + +

    23. +The parser does not recognize time as a reserved word if the next +token begins with a `-'. +

      + +

    24. +If a POSIX special builtin returns an error status, a +non-interactive shell exits. The fatal errors are those listed in +the POSIX standard, and include things like passing incorrect options, +redirection errors, variable assignment errors for assignments preceding +the command name, and so on. +

      + +

    25. +A non-interactive shell exits with an error status if a variable +assignment error occurs when no command name follows the assignment +statements. +A variable assignment error occurs, for example, when trying to assign +a value to a readonly variable. +

      + +

    26. +A non-interactive shell exits with an error status if a variable +assignment error occurs in an assignment statement preceding a special +builtin, but not with any other simple command. +

      + +

    27. +A non-interactive shell exits with an error status if the iteration +variable in a for statement or the selection variable in a +select statement is a readonly variable. +

      + +

    28. +Process substitution is not available. +

      + +

    29. +While variable indirection is available, it may not be applied to the +`#' and `?' special parameters. +

      + +

    30. +Assignment statements preceding POSIX special builtins +persist in the shell environment after the builtin completes. +

      + +

    31. +Assignment statements preceding shell function calls persist in the +shell environment after the function returns, as if a POSIX +special builtin command had been executed. +

      + +

    32. +The export and readonly builtin commands display their +output in the format required by POSIX. +

      + +

    33. +The trap builtin displays signal names without the leading +SIG. +

      + +

    34. +The trap builtin doesn't check the first argument for a possible +signal specification and revert the signal handling to the original +disposition if it is, unless that argument consists solely of digits and +is a valid signal number. If users want to reset the handler for a given +signal to the original disposition, they should use `-' as the +first argument. +

      + +

    35. +The . and source builtins do not search the current directory +for the filename argument if it is not found by searching PATH. +

      + +

    36. +Subshells spawned to execute command substitutions inherit the value of +the `-e' option from the parent shell. When not in POSIX mode, +Bash clears the `-e' option in such subshells. +

      + +

    37. +Alias expansion is always enabled, even in non-interactive shells. +

      + +

    38. +When the alias builtin displays alias definitions, it does not +display them with a leading `alias ' unless the `-p' option +is supplied. +

      + +

    39. +When the set builtin is invoked without options, it does not display +shell function names and definitions. +

      + +

    40. +When the set builtin is invoked without options, it displays +variable values without quotes, unless they contain shell metacharacters, +even if the result contains nonprinting characters. +

      + +

    41. +When the cd builtin is invoked in logical mode, and the pathname +constructed from $PWD and the directory name supplied as an argument +does not refer to an existing directory, cd will fail instead of +falling back to physical mode. +

      + +

    42. +The pwd builtin verifies that the value it prints is the same as the +current directory, even if it is not asked to check the file system with the +`-P' option. +

      + +

    43. +When listing the history, the fc builtin does not include an +indication of whether or not a history entry has been modified. +

      + +

    44. +The default editor used by fc is ed. +

      + +

    45. +The type and command builtins will not report a non-executable +file as having been found, though the shell will attempt to execute such a +file if it is the only so-named file found in $PATH. +

      + +

    46. +The vi editing mode will invoke the vi editor directly when +the `v' command is run, instead of checking $VISUAL and +$EDITOR. +

      + +

    47. +When the xpg_echo option is enabled, Bash does not attempt to interpret +any arguments to echo as options. Each argument is displayed, after +escape characters are converted. +

      + +

    48. +The ulimit builtin uses a block size of 512 bytes for the `-c' +and `-f' options. +

      + +

    49. +The arrival of SIGCHLD when a trap is set on SIGCHLD does +not interrupt the wait builtin and cause it to return immediately. +The trap command is run once for each child that exits. +

      + +

    50. +The read builtin may be interrupted by a signal for which a trap +has been set. +If Bash receives a trapped signal while executing read, the trap +handler executes and read returns an exit status greater than 128. +

      + +

    +

    + +There is other POSIX behavior that Bash does not implement by +default even when in POSIX mode. +Specifically: +

    + +

      + +
    1. +The fc builtin checks $EDITOR as a program to edit history +entries if FCEDIT is unset, rather than defaulting directly to +ed. fc uses ed if EDITOR is unset. +

      + +

    2. +As noted above, Bash requires the xpg_echo option to be enabled for +the echo builtin to be fully conformant. +

      + +

    +

    + +Bash can be configured to be POSIX-conformant by default, by specifying +the `--enable-strict-posix-default' to configure when building +(see section 10.8 Optional Features). +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    7. Job Control

    + +

    + +This chapter discusses what job control is, how it works, and how +Bash allows you to access its facilities. +

    + +

    + + + +
    7.1 Job Control Basics  How job control works.
    7.2 Job Control Builtins  Bash builtin commands used to interact + with job control.
    7.3 Job Control Variables  Variables Bash uses to customize job + control.
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    7.1 Job Control Basics

    + +

    + +Job control +refers to the ability to selectively stop (suspend) +the execution of processes and continue (resume) +their execution at a later point. A user typically employs +this facility via an interactive interface supplied jointly +by the operating system kernel's terminal driver and Bash. +

    + +The shell associates a job with each pipeline. It keeps a +table of currently executing jobs, which may be listed with the +jobs command. When Bash starts a job +asynchronously, it prints a line that looks +like: +
     
    [1] 25647
    +
    indicating that this job is job number 1 and that the process ID +of the last process in the pipeline associated with this job is +25647. All of the processes in a single pipeline are members of +the same job. Bash uses the job abstraction as the +basis for job control. +

    + +To facilitate the implementation of the user interface to job +control, the operating system maintains the notion of a current terminal +process group ID. Members of this process group (processes whose +process group ID is equal to the current terminal process group +ID) receive keyboard-generated signals such as SIGINT. +These processes are said to be in the foreground. Background +processes are those whose process group ID differs from the +terminal's; such processes are immune to keyboard-generated +signals. Only foreground processes are allowed to read from or, if +the user so specifies with stty tostop, write to the terminal. +Background processes which attempt to +read from (write to when stty tostop is in effect) the +terminal are sent a SIGTTIN (SIGTTOU) +signal by the kernel's terminal driver, +which, unless caught, suspends the process. +

    + +If the operating system on which Bash is running supports +job control, Bash contains facilities to use it. Typing the +suspend character (typically `^Z', Control-Z) while a +process is running causes that process to be stopped and returns +control to Bash. Typing the delayed suspend character +(typically `^Y', Control-Y) causes the process to be stopped +when it attempts to read input from the terminal, and control to +be returned to Bash. The user then manipulates the state of +this job, using the bg command to continue it in the +background, the fg command to continue it in the +foreground, or the kill command to kill it. A `^Z' +takes effect immediately, and has the additional side effect of +causing pending output and typeahead to be discarded. +

    + +There are a number of ways to refer to a job in the shell. The +character `%' introduces a job specification (jobspec). +

    + +Job number n may be referred to as `%n'. +The symbols `%%' and `%+' refer to the shell's notion of the +current job, which is the last job stopped while it was in the foreground +or started in the background. +A single `%' (with no accompanying job specification) also refers +to the current job. +The previous job may be referenced using `%-'. +If there is only a single job, `%+' and `%-' can both be used +to refer to that job. +In output pertaining to jobs (e.g., the output of the jobs +command), the current job is always flagged with a `+', and the +previous job with a `-'. +

    + +A job may also be referred to +using a prefix of the name used to start it, or using a substring +that appears in its command line. For example, `%ce' refers +to a stopped ce job. Using `%?ce', on the +other hand, refers to any job containing the string `ce' in +its command line. If the prefix or substring matches more than one job, +Bash reports an error. +

    + +Simply naming a job can be used to bring it into the foreground: +`%1' is a synonym for `fg %1', bringing job 1 from the +background into the foreground. Similarly, `%1 &' resumes +job 1 in the background, equivalent to `bg %1' +

    + +The shell learns immediately whenever a job changes state. +Normally, Bash waits until it is about to print a prompt +before reporting changes in a job's status so as to not interrupt +any other output. +If the `-b' option to the set builtin is enabled, +Bash reports such changes immediately (see section 4.3.1 The Set Builtin). +Any trap on SIGCHLD is executed for each child process +that exits. +

    + +If an attempt to exit Bash is made while jobs are stopped, (or running, if +the checkjobs option is enabled -- see 4.3.2 The Shopt Builtin), the +shell prints a warning message, and if the checkjobs option is +enabled, lists the jobs and their statuses. +The jobs command may then be used to inspect their status. +If a second attempt to exit is made without an intervening command, +Bash does not print another warning, and any stopped jobs are terminated. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    7.2 Job Control Builtins

    + +

    + +

    + +
    bg +
    +
     
    bg [jobspec ...]
    +

    + +Resume each suspended job jobspec in the background, as if it +had been started with `&'. +If jobspec is not supplied, the current job is used. +The return status is zero unless it is run when job control is not +enabled, or, when run with job control enabled, any +jobspec was not found or specifies a job +that was started without job control. +

    + +

    fg +
    +
     
    fg [jobspec]
    +

    + +Resume the job jobspec in the foreground and make it the current job. +If jobspec is not supplied, the current job is used. +The return status is that of the command placed into the foreground, +or non-zero if run when job control is disabled or, when run with +job control enabled, jobspec does not specify a valid job or +jobspec specifies a job that was started without job control. +

    + +

    jobs +
    +
     
    jobs [-lnprs] [jobspec]
    +jobs -x command [arguments]
    +

    + +The first form lists the active jobs. The options have the +following meanings: +

    + +

    +
    -l +
    List process IDs in addition to the normal information. +

    + +

    -n +
    Display information only about jobs that have changed status since +the user was last notified of their status. +

    + +

    -p +
    List only the process ID of the job's process group leader. +

    + +

    -r +
    Display only running jobs. +

    + +

    -s +
    Display only stopped jobs. +
    +

    + +If jobspec is given, +output is restricted to information about that job. +If jobspec is not supplied, the status of all jobs is +listed. +

    + +If the `-x' option is supplied, jobs replaces any +jobspec found in command or arguments with the +corresponding process group ID, and executes command, +passing it arguments, returning its exit status. +

    + +

    kill +
    +
     
    kill [-s sigspec] [-n signum] [-sigspec] jobspec or pid
    +kill -l [exit_status]
    +

    + +Send a signal specified by sigspec or signum to the process +named by job specification jobspec or process ID pid. +sigspec is either a case-insensitive signal name such as +SIGINT (with or without the SIG prefix) +or a signal number; signum is a signal number. +If sigspec and signum are not present, SIGTERM is used. +The `-l' option lists the signal names. +If any arguments are supplied when `-l' is given, the names of the +signals corresponding to the arguments are listed, and the return status +is zero. +exit_status is a number specifying a signal number or the exit +status of a process terminated by a signal. +The return status is zero if at least one signal was successfully sent, +or non-zero if an error occurs or an invalid option is encountered. +

    + +

    wait +
    +
     
    wait [-n] [jobspec or pid ...]
    +

    + +Wait until the child process specified by each process ID pid +or job specification jobspec exits and return the exit status of the +last command waited for. +If a job spec is given, all processes in the job are waited for. +If no arguments are given, all currently active child processes are +waited for, and the return status is zero. +If the `-n' option is supplied, wait waits for any job to +terminate and returns its exit status. +If neither jobspec nor pid specifies an active child process +of the shell, the return status is 127. +

    + +

    disown +
    +
     
    disown [-ar] [-h] [jobspec ...]
    +

    + +Without options, remove each jobspec from the table of +active jobs. +If the `-h' option is given, the job is not removed from the table, +but is marked so that SIGHUP is not sent to the job if the shell +receives a SIGHUP. +If jobspec is not present, and neither the `-a' nor the +`-r' option is supplied, the current job is used. +If no jobspec is supplied, the `-a' option means to remove or +mark all jobs; the `-r' option without a jobspec +argument restricts operation to running jobs. +

    + +

    suspend +
    +
     
    suspend [-f]
    +

    + +Suspend the execution of this shell until it receives a +SIGCONT signal. +A login shell cannot be suspended; the `-f' +option can be used to override this and force the suspension. +

    +

    + +When job control is not active, the kill and wait +builtins do not accept jobspec arguments. They must be +supplied process IDs. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    7.3 Job Control Variables

    + +

    + +

    + + +
    auto_resume +
    +This variable controls how the shell interacts with the user and +job control. If this variable exists then single word simple +commands without redirections are treated as candidates for resumption +of an existing job. There is no ambiguity allowed; if there is +more than one job beginning with the string typed, then +the most recently accessed job will be selected. +The name of a stopped job, in this context, is the command line +used to start it. If this variable is set to the value `exact', +the string supplied must match the name of a stopped job exactly; +if set to `substring', +the string supplied needs to match a substring of the name of a +stopped job. The `substring' value provides functionality +analogous to the `%?' job ID (see section 7.1 Job Control Basics). +If set to any other value, the supplied string must +be a prefix of a stopped job's name; this provides functionality +analogous to the `%' job ID. +

    + +

    +

    + + +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8. Command Line Editing

    + +

    + +This chapter describes the basic features of the GNU +command line editing interface. +Command line editing is provided by the Readline library, which is +used by several different programs, including Bash. +Command line editing is enabled by default when using an interactive shell, +unless the `--noediting' option is supplied at shell invocation. +Line editing is also used when using the `-e' option to the +read builtin command (see section 4.2 Bash Builtin Commands). +By default, the line editing commands are similar to those of Emacs. +A vi-style line editing interface is also available. +Line editing can be enabled at any time using the `-o emacs' or +`-o vi' options to the set builtin command +(see section 4.3.1 The Set Builtin), or disabled using the `+o emacs' or +`+o vi' options to set. +

    + +

    + + + + + + + + +
    8.1 Introduction to Line Editing  Notation used in this text.
    8.2 Readline Interaction  The minimum set of commands for editing a line.
    8.3 Readline Init File  Customizing Readline from a user's view.
    8.4 Bindable Readline Commands  A description of most of the Readline commands + available for binding
    8.5 Readline vi Mode  A short description of how to make Readline + behave like the vi editor.
    8.6 Programmable Completion  How to specify the possible completions for + a specific command.
    8.7 Programmable Completion Builtins  Builtin commands to specify how to + complete arguments for a particular command.
    8.8 A Programmable Completion Example  An example shell function for + generating possible completions.
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.1 Introduction to Line Editing

    + +

    + +The following paragraphs describe the notation used to represent +keystrokes. +

    + +The text C-k is read as `Control-K' and describes the character +produced when the k key is pressed while the Control key +is depressed. +

    + +The text M-k is read as `Meta-K' and describes the character +produced when the Meta key (if you have one) is depressed, and the k +key is pressed. +The Meta key is labeled ALT on many keyboards. +On keyboards with two keys labeled ALT (usually to either side of +the space bar), the ALT on the left side is generally set to +work as a Meta key. +The ALT key on the right may also be configured to work as a +Meta key or may be configured as some other modifier, such as a +Compose key for typing accented characters. +

    + +If you do not have a Meta or ALT key, or another key working as +a Meta key, the identical keystroke can be generated by typing ESC +first, and then typing k. +Either process is known as metafying the k key. +

    + +The text M-C-k is read as `Meta-Control-k' and describes the +character produced by metafying C-k. +

    + +In addition, several keys have their own names. Specifically, +DEL, ESC, LFD, SPC, RET, and TAB all +stand for themselves when seen in this text, or in an init file +(see section 8.3 Readline Init File). +If your keyboard lacks a LFD key, typing C-j will +produce the desired character. +The RET key may be labeled Return or Enter on +some keyboards. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.2 Readline Interaction

    + +

    + +Often during an interactive session you type in a long line of text, +only to notice that the first word on the line is misspelled. The +Readline library gives you a set of commands for manipulating the text +as you type it in, allowing you to just fix your typo, and not forcing +you to retype the majority of the line. Using these editing commands, +you move the cursor to the place that needs correction, and delete or +insert the text of the corrections. Then, when you are satisfied with +the line, you simply press RET. You do not have to be at the +end of the line to press RET; the entire line is accepted +regardless of the location of the cursor within the line. +

    + +

    + + + + + +
    8.2.1 Readline Bare Essentials  The least you need to know about Readline.
    8.2.2 Readline Movement Commands  Moving about the input line.
    8.2.3 Readline Killing Commands  How to delete text, and how to get it back!
    8.2.4 Readline Arguments  Giving numeric arguments to commands.
    8.2.5 Searching for Commands in the History  Searching through previous lines.
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.2.1 Readline Bare Essentials

    + +

    + +In order to enter characters into the line, simply type them. The typed +character appears where the cursor was, and then the cursor moves one +space to the right. If you mistype a character, you can use your +erase character to back up and delete the mistyped character. +

    + +Sometimes you may mistype a character, and +not notice the error until you have typed several other characters. In +that case, you can type C-b to move the cursor to the left, and then +correct your mistake. Afterwards, you can move the cursor to the right +with C-f. +

    + +When you add text in the middle of a line, you will notice that characters +to the right of the cursor are `pushed over' to make room for the text +that you have inserted. Likewise, when you delete text behind the cursor, +characters to the right of the cursor are `pulled back' to fill in the +blank space created by the removal of the text. A list of the bare +essentials for editing the text of an input line follows. +

    + +

    +
    C-b +
    Move back one character. +
    C-f +
    Move forward one character. +
    DEL or Backspace +
    Delete the character to the left of the cursor. +
    C-d +
    Delete the character underneath the cursor. +
    Printing characters +
    Insert the character into the line at the cursor. +
    C-_ or C-x C-u +
    Undo the last editing command. You can undo all the way back to an +empty line. +
    +

    + +(Depending on your configuration, the Backspace key be set to +delete the character to the left of the cursor and the DEL key set +to delete the character underneath the cursor, like C-d, rather +than the character to the left of the cursor.) +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.2.2 Readline Movement Commands

    + +

    + +The above table describes the most basic keystrokes that you need +in order to do editing of the input line. For your convenience, many +other commands have been added in addition to C-b, C-f, +C-d, and DEL. Here are some commands for moving more rapidly +about the line. +

    + +

    +
    C-a +
    Move to the start of the line. +
    C-e +
    Move to the end of the line. +
    M-f +
    Move forward a word, where a word is composed of letters and digits. +
    M-b +
    Move backward a word. +
    C-l +
    Clear the screen, reprinting the current line at the top. +
    +

    + +Notice how C-f moves forward a character, while M-f moves +forward a word. It is a loose convention that control keystrokes +operate on characters while meta keystrokes operate on words. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.2.3 Readline Killing Commands

    + +

    + + + +

    + +Killing text means to delete the text from the line, but to save +it away for later use, usually by yanking (re-inserting) +it back into the line. +(`Cut' and `paste' are more recent jargon for `kill' and `yank'.) +

    + +If the description for a command says that it `kills' text, then you can +be sure that you can get the text back in a different (or the same) +place later. +

    + +When you use a kill command, the text is saved in a kill-ring. +Any number of consecutive kills save all of the killed text together, so +that when you yank it back, you get it all. The kill +ring is not line specific; the text that you killed on a previously +typed line is available to be yanked back later, when you are typing +another line. + +

    + +Here is the list of commands for killing text. +

    + +

    +
    C-k +
    Kill the text from the current cursor position to the end of the line. +

    + +

    M-d +
    Kill from the cursor to the end of the current word, or, if between +words, to the end of the next word. +Word boundaries are the same as those used by M-f. +

    + +

    M-DEL +
    Kill from the cursor the start of the current word, or, if between +words, to the start of the previous word. +Word boundaries are the same as those used by M-b. +

    + +

    C-w +
    Kill from the cursor to the previous whitespace. This is different than +M-DEL because the word boundaries differ. +

    + +

    +

    + +Here is how to yank the text back into the line. Yanking +means to copy the most-recently-killed text from the kill buffer. +

    + +

    +
    C-y +
    Yank the most recently killed text back into the buffer at the cursor. +

    + +

    M-y +
    Rotate the kill-ring, and yank the new top. You can only do this if +the prior command is C-y or M-y. +
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.2.4 Readline Arguments

    + +

    + +You can pass numeric arguments to Readline commands. Sometimes the +argument acts as a repeat count, other times it is the sign of the +argument that is significant. If you pass a negative argument to a +command which normally acts in a forward direction, that command will +act in a backward direction. For example, to kill text back to the +start of the line, you might type `M-- C-k'. +

    + +The general way to pass numeric arguments to a command is to type meta +digits before the command. If the first `digit' typed is a minus +sign (`-'), then the sign of the argument will be negative. Once +you have typed one meta digit to get the argument started, you can type +the remainder of the digits, and then the command. For example, to give +the C-d command an argument of 10, you could type `M-1 0 C-d', +which will delete the next ten characters on the input line. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.2.5 Searching for Commands in the History

    + +

    + +Readline provides commands for searching through the command history +(see section 9.1 Bash History Facilities) +for lines containing a specified string. +There are two search modes: incremental and non-incremental. +

    + +Incremental searches begin before the user has finished typing the +search string. +As each character of the search string is typed, Readline displays +the next entry from the history matching the string typed so far. +An incremental search requires only as many characters as needed to +find the desired history entry. +To search backward in the history for a particular string, type +C-r. Typing C-s searches forward through the history. +The characters present in the value of the isearch-terminators variable +are used to terminate an incremental search. +If that variable has not been assigned a value, the ESC and +C-J characters will terminate an incremental search. +C-g will abort an incremental search and restore the original line. +When the search is terminated, the history entry containing the +search string becomes the current line. +

    + +To find other matching entries in the history list, type C-r or +C-s as appropriate. +This will search backward or forward in the history for the next +entry matching the search string typed so far. +Any other key sequence bound to a Readline command will terminate +the search and execute that command. +For instance, a RET will terminate the search and accept +the line, thereby executing the command from the history list. +A movement command will terminate the search, make the last line found +the current line, and begin editing. +

    + +Readline remembers the last incremental search string. If two +C-rs are typed without any intervening characters defining a new +search string, any remembered search string is used. +

    + +Non-incremental searches read the entire search string before starting +to search for matching history lines. The search string may be +typed by the user or be part of the contents of the current line. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.3 Readline Init File

    + +

    + +Although the Readline library comes with a set of Emacs-like +keybindings installed by default, it is possible to use a different set +of keybindings. +Any user can customize programs that use Readline by putting +commands in an inputrc file, conventionally in his home directory. +The name of this +file is taken from the value of the shell variable INPUTRC. If +that variable is unset, the default is `~/.inputrc'. If that +file does not exist or cannot be read, the ultimate default is +`/etc/inputrc'. +

    + +When a program which uses the Readline library starts up, the +init file is read, and the key bindings are set. +

    + +In addition, the C-x C-r command re-reads this init file, thus +incorporating any changes that you might have made to it. +

    + +

    + +
    8.3.1 Readline Init File Syntax  Syntax for the commands in the inputrc file.
    + +
    + + +
    8.3.2 Conditional Init Constructs  Conditional key bindings in the inputrc file.
    + +
    + + +
    8.3.3 Sample Init File  An example inputrc file.
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.3.1 Readline Init File Syntax

    + +

    + +There are only a few basic constructs allowed in the +Readline init file. Blank lines are ignored. +Lines beginning with a `#' are comments. +Lines beginning with a `$' indicate conditional +constructs (see section 8.3.2 Conditional Init Constructs). Other lines +denote variable settings and key bindings. +

    + +

    +
    Variable Settings +
    You can modify the run-time behavior of Readline by +altering the values of variables in Readline +using the set command within the init file. +The syntax is simple: +

    + +
     
    set variable value
    +

    + +Here, for example, is how to +change from the default Emacs-like key binding to use +vi line editing commands: +

    + +
     
    set editing-mode vi
    +

    + +Variable names and values, where appropriate, are recognized without regard +to case. Unrecognized variable names are ignored. +

    + +Boolean variables (those that can be set to on or off) are set to on if +the value is null or empty, on (case-insensitive), or 1. Any other +value results in the variable being set to off. +

    + +The bind -V command lists the current Readline variable names +and values. See section 4.2 Bash Builtin Commands. +

    + +A great deal of run-time behavior is changeable with the following +variables. +

    + + +

    + +
    bell-style +
    +Controls what happens when Readline wants to ring the terminal bell. +If set to `none', Readline never rings the bell. If set to +`visible', Readline uses a visible bell if one is available. +If set to `audible' (the default), Readline attempts to ring +the terminal's bell. +

    + +

    bind-tty-special-chars +
    +If set to `on', Readline attempts to bind the control characters +treated specially by the kernel's terminal driver to their Readline +equivalents. +

    + +

    colored-stats +
    +If set to `on', Readline displays possible completions using different +colors to indicate their file type. +The color definitions are taken from the value of the LS_COLORS +environment variable. +The default is `off'. +

    + +

    comment-begin +
    +The string to insert at the beginning of the line when the +insert-comment command is executed. The default value +is "#". +

    + +

    completion-display-width +
    +The number of screen columns used to display possible matches +when performing completion. +The value is ignored if it is less than 0 or greater than the terminal +screen width. +A value of 0 will cause matches to be displayed one per line. +The default value is -1. +

    + +

    completion-ignore-case +
    +If set to `on', Readline performs filename matching and completion +in a case-insensitive fashion. +The default value is `off'. +

    + +

    completion-map-case +
    +If set to `on', and completion-ignore-case is enabled, Readline +treats hyphens (`-') and underscores (`_') as equivalent when +performing case-insensitive filename matching and completion. +

    + +

    completion-prefix-display-length +
    +The length in characters of the common prefix of a list of possible +completions that is displayed without modification. When set to a +value greater than zero, common prefixes longer than this value are +replaced with an ellipsis when displaying possible completions. +

    + +

    completion-query-items +
    +The number of possible completions that determines when the user is +asked whether the list of possibilities should be displayed. +If the number of possible completions is greater than this value, +Readline will ask the user whether or not he wishes to view +them; otherwise, they are simply listed. +This variable must be set to an integer value greater than or equal to 0. +A negative value means Readline should never ask. +The default limit is 100. +

    + +

    convert-meta +
    +If set to `on', Readline will convert characters with the +eighth bit set to an ASCII key sequence by stripping the eighth +bit and prefixing an ESC character, converting them to a +meta-prefixed key sequence. The default value is `on'. +

    + +

    disable-completion +
    +If set to `On', Readline will inhibit word completion. +Completion characters will be inserted into the line as if they had +been mapped to self-insert. The default is `off'. +

    + +

    editing-mode +
    +The editing-mode variable controls which default set of +key bindings is used. By default, Readline starts up in Emacs editing +mode, where the keystrokes are most similar to Emacs. This variable can be +set to either `emacs' or `vi'. +

    + +

    echo-control-characters +
    When set to `on', on operating systems that indicate they support it, +readline echoes a character corresponding to a signal generated from the +keyboard. The default is `on'. +

    + +

    enable-keypad +
    +When set to `on', Readline will try to enable the application +keypad when it is called. Some systems need this to enable the +arrow keys. The default is `off'. +

    + +

    enable-meta-key +
    When set to `on', Readline will try to enable any meta modifier +key the terminal claims to support when it is called. On many terminals, +the meta key is used to send eight-bit characters. +The default is `on'. +

    + +

    expand-tilde +
    +If set to `on', tilde expansion is performed when Readline +attempts word completion. The default is `off'. +

    + +

    history-preserve-point +
    +If set to `on', the history code attempts to place the point (the +current cursor position) at the +same location on each history line retrieved with previous-history +or next-history. The default is `off'. +

    + +

    history-size +
    +Set the maximum number of history entries saved in the history list. +If set to zero, any existing history entries are deleted and no new entries +are saved. +If set to a value less than zero, the number of history entries is not +limited. +By default, the number of history entries is not limited. +

    + +

    horizontal-scroll-mode +
    +This variable can be set to either `on' or `off'. Setting it +to `on' means that the text of the lines being edited will scroll +horizontally on a single screen line when they are longer than the width +of the screen, instead of wrapping onto a new screen line. By default, +this variable is set to `off'. +

    + +

    input-meta +
    + +If set to `on', Readline will enable eight-bit input (it +will not clear the eighth bit in the characters it reads), +regardless of what the terminal claims it can support. The +default value is `off'. The name meta-flag is a +synonym for this variable. +

    + +

    isearch-terminators +
    +The string of characters that should terminate an incremental search without +subsequently executing the character as a command (see section 8.2.5 Searching for Commands in the History). +If this variable has not been given a value, the characters ESC and +C-J will terminate an incremental search. +

    + +

    keymap +
    +Sets Readline's idea of the current keymap for key binding commands. +Acceptable keymap names are +emacs, +emacs-standard, +emacs-meta, +emacs-ctlx, +vi, +vi-move, +vi-command, and +vi-insert. +vi is equivalent to vi-command; emacs is +equivalent to emacs-standard. The default value is emacs. +The value of the editing-mode variable also affects the +default keymap. +

    + +

    keyseq-timeout +
    Specifies the duration Readline will wait for a character when reading an +ambiguous key sequence (one that can form a complete key sequence using +the input read so far, or can take additional input to complete a longer +key sequence). +If no input is received within the timeout, Readline will use the shorter +but complete key sequence. +Readline uses this value to determine whether or not input is +available on the current input source (rl_instream by default). +The value is specified in milliseconds, so a value of 1000 means that +Readline will wait one second for additional input. +If this variable is set to a value less than or equal to zero, or to a +non-numeric value, Readline will wait until another key is pressed to +decide which key sequence to complete. +The default value is 500. +

    + +

    mark-directories +
    If set to `on', completed directory names have a slash +appended. The default is `on'. +

    + +

    mark-modified-lines +
    +This variable, when set to `on', causes Readline to display an +asterisk (`*') at the start of history lines which have been modified. +This variable is `off' by default. +

    + +

    mark-symlinked-directories +
    +If set to `on', completed names which are symbolic links +to directories have a slash appended (subject to the value of +mark-directories). +The default is `off'. +

    + +

    match-hidden-files +
    +This variable, when set to `on', causes Readline to match files whose +names begin with a `.' (hidden files) when performing filename +completion. +If set to `off', the leading `.' must be +supplied by the user in the filename to be completed. +This variable is `on' by default. +

    + +

    menu-complete-display-prefix +
    +If set to `on', menu completion displays the common prefix of the +list of possible completions (which may be empty) before cycling through +the list. The default is `off'. +

    + +

    output-meta +
    +If set to `on', Readline will display characters with the +eighth bit set directly rather than as a meta-prefixed escape +sequence. The default is `off'. +

    + +

    page-completions +
    +If set to `on', Readline uses an internal more-like pager +to display a screenful of possible completions at a time. +This variable is `on' by default. +

    + +

    print-completions-horizontally +
    If set to `on', Readline will display completions with matches +sorted horizontally in alphabetical order, rather than down the screen. +The default is `off'. +

    + +

    revert-all-at-newline +
    +If set to `on', Readline will undo all changes to history lines +before returning when accept-line is executed. By default, +history lines may be modified and retain individual undo lists across +calls to readline. The default is `off'. +

    + +

    show-all-if-ambiguous +
    +This alters the default behavior of the completion functions. If +set to `on', +words which have more than one possible completion cause the +matches to be listed immediately instead of ringing the bell. +The default value is `off'. +

    + +

    show-all-if-unmodified +
    +This alters the default behavior of the completion functions in +a fashion similar to show-all-if-ambiguous. +If set to `on', +words which have more than one possible completion without any +possible partial completion (the possible completions don't share +a common prefix) cause the matches to be listed immediately instead +of ringing the bell. +The default value is `off'. +

    + +

    show-mode-in-prompt +
    +If set to `on', add a character to the beginning of the prompt +indicating the editing mode: emacs (`@'), vi command (`:'), +or vi insertion (`+'). +The default value is `off'. +

    + +

    skip-completed-text +
    +If set to `on', this alters the default completion behavior when +inserting a single match into the line. It's only active when +performing completion in the middle of a word. If enabled, readline +does not insert characters from the completion that match characters +after point in the word being completed, so portions of the word +following the cursor are not duplicated. +For instance, if this is enabled, attempting completion when the cursor +is after the `e' in `Makefile' will result in `Makefile' +rather than `Makefilefile', assuming there is a single possible +completion. +The default value is `off'. +

    + +

    visible-stats +
    +If set to `on', a character denoting a file's type +is appended to the filename when listing possible +completions. The default is `off'. +

    + +

    +

    + +

    Key Bindings +
    The syntax for controlling key bindings in the init file is +simple. First you need to find the name of the command that you +want to change. The following sections contain tables of the command +name, the default keybinding, if any, and a short description of what +the command does. +

    + +Once you know the name of the command, simply place on a line +in the init file the name of the key +you wish to bind the command to, a colon, and then the name of the +command. +There can be no space between the key name and the colon -- that will be +interpreted as part of the key name. +The name of the key can be expressed in different ways, depending on +what you find most comfortable. +

    + +In addition to command names, readline allows keys to be bound +to a string that is inserted when the key is pressed (a macro). +

    + +The bind -p command displays Readline function names and +bindings in a format that can put directly into an initialization file. +See section 4.2 Bash Builtin Commands. +

    + +

    +
    keyname: function-name or macro +
    keyname is the name of a key spelled out in English. For example: +
     
    Control-u: universal-argument
    +Meta-Rubout: backward-kill-word
    +Control-o: "> output"
    +

    + +In the above example, C-u is bound to the function +universal-argument, +M-DEL is bound to the function backward-kill-word, and +C-o is bound to run the macro +expressed on the right hand side (that is, to insert the text +`> output' into the line). +

    + +A number of symbolic character names are recognized while +processing this key binding syntax: +DEL, +ESC, +ESCAPE, +LFD, +NEWLINE, +RET, +RETURN, +RUBOUT, +SPACE, +SPC, +and +TAB. +

    + +

    "keyseq": function-name or macro +
    keyseq differs from keyname above in that strings +denoting an entire key sequence can be specified, by placing +the key sequence in double quotes. Some GNU Emacs style key +escapes can be used, as in the following example, but the +special character names are not recognized. +

    + +
     
    "\C-u": universal-argument
    +"\C-x\C-r": re-read-init-file
    +"\e[11~": "Function Key 1"
    +

    + +In the above example, C-u is again bound to the function +universal-argument (just as it was in the first example), +`C-x C-r' is bound to the function re-read-init-file, +and `ESC [ 1 1 ~' is bound to insert +the text `Function Key 1'. +

    + +

    +

    + +The following GNU Emacs style escape sequences are available when +specifying key sequences: +

    + +

    +
    \C- +
    control prefix +
    \M- +
    meta prefix +
    \e +
    an escape character +
    \\ +
    backslash +
    \" +
    ", a double quotation mark +
    \' +
    ', a single quote or apostrophe +
    +

    + +In addition to the GNU Emacs style escape sequences, a second +set of backslash escapes is available: +

    + +

    +
    \a +
    alert (bell) +
    \b +
    backspace +
    \d +
    delete +
    \f +
    form feed +
    \n +
    newline +
    \r +
    carriage return +
    \t +
    horizontal tab +
    \v +
    vertical tab +
    \nnn +
    the eight-bit character whose value is the octal value nnn +(one to three digits) +
    \xHH +
    the eight-bit character whose value is the hexadecimal value HH +(one or two hex digits) +
    +

    + +When entering the text of a macro, single or double quotes must +be used to indicate a macro definition. +Unquoted text is assumed to be a function name. +In the macro body, the backslash escapes described above are expanded. +Backslash will quote any other character in the macro text, +including `"' and `''. +For example, the following binding will make `C-x \' +insert a single `\' into the line: +
     
    "\C-x\\": "\\"
    +

    + +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.3.2 Conditional Init Constructs

    + +

    + +Readline implements a facility similar in spirit to the conditional +compilation features of the C preprocessor which allows key +bindings and variable settings to be performed as the result +of tests. There are four parser directives used. +

    + +

    +
    $if +
    The $if construct allows bindings to be made based on the +editing mode, the terminal being used, or the application using +Readline. The text of the test extends to the end of the line; +no characters are required to isolate it. +

    + +

    +
    mode +
    The mode= form of the $if directive is used to test +whether Readline is in emacs or vi mode. +This may be used in conjunction +with the `set keymap' command, for instance, to set bindings in +the emacs-standard and emacs-ctlx keymaps only if +Readline is starting out in emacs mode. +

    + +

    term +
    The term= form may be used to include terminal-specific +key bindings, perhaps to bind the key sequences output by the +terminal's function keys. The word on the right side of the +`=' is tested against both the full name of the terminal and +the portion of the terminal name before the first `-'. This +allows sun to match both sun and sun-cmd, +for instance. +

    + +

    application +
    The application construct is used to include +application-specific settings. Each program using the Readline +library sets the application name, and you can test for +a particular value. +This could be used to bind key sequences to functions useful for +a specific program. For instance, the following command adds a +key sequence that quotes the current or previous word in Bash: +
     
    $if Bash
    +# Quote the current or previous word
    +"\C-xq": "\eb\"\ef\""
    +$endif
    +
    +

    + +

    $endif +
    This command, as seen in the previous example, terminates an +$if command. +

    + +

    $else +
    Commands in this branch of the $if directive are executed if +the test fails. +

    + +

    $include +
    This directive takes a single filename as an argument and reads commands +and bindings from that file. +For example, the following directive reads from `/etc/inputrc': +
     
    $include /etc/inputrc
    +
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.3.3 Sample Init File

    + +

    + +Here is an example of an inputrc file. This illustrates key +binding, variable assignment, and conditional syntax. +

    + +
     
    # This file controls the behaviour of line input editing for
    +# programs that use the GNU Readline library.  Existing
    +# programs include FTP, Bash, and GDB.
    +#
    +# You can re-read the inputrc file with C-x C-r.
    +# Lines beginning with '#' are comments.
    +#
    +# First, include any system-wide bindings and variable
    +# assignments from /etc/Inputrc
    +$include /etc/Inputrc
    +
    +#
    +# Set various bindings for emacs mode.
    +
    +set editing-mode emacs 
    +
    +$if mode=emacs
    +
    +Meta-Control-h:	backward-kill-word	Text after the function name is ignored
    +
    +#
    +# Arrow keys in keypad mode
    +#
    +#"\M-OD":        backward-char
    +#"\M-OC":        forward-char
    +#"\M-OA":        previous-history
    +#"\M-OB":        next-history
    +#
    +# Arrow keys in ANSI mode
    +#
    +"\M-[D":        backward-char
    +"\M-[C":        forward-char
    +"\M-[A":        previous-history
    +"\M-[B":        next-history
    +#
    +# Arrow keys in 8 bit keypad mode
    +#
    +#"\M-\C-OD":       backward-char
    +#"\M-\C-OC":       forward-char
    +#"\M-\C-OA":       previous-history
    +#"\M-\C-OB":       next-history
    +#
    +# Arrow keys in 8 bit ANSI mode
    +#
    +#"\M-\C-[D":       backward-char
    +#"\M-\C-[C":       forward-char
    +#"\M-\C-[A":       previous-history
    +#"\M-\C-[B":       next-history
    +
    +C-q: quoted-insert
    +
    +$endif
    +
    +# An old-style binding.  This happens to be the default.
    +TAB: complete
    +
    +# Macros that are convenient for shell interaction
    +$if Bash
    +# edit the path
    +"\C-xp": "PATH=${PATH}\e\C-e\C-a\ef\C-f"
    +# prepare to type a quoted word --
    +# insert open and close double quotes
    +# and move to just after the open quote
    +"\C-x\"": "\"\"\C-b"
    +# insert a backslash (testing backslash escapes
    +# in sequences and macros)
    +"\C-x\\": "\\"
    +# Quote the current or previous word
    +"\C-xq": "\eb\"\ef\""
    +# Add a binding to refresh the line, which is unbound
    +"\C-xr": redraw-current-line
    +# Edit variable on current line.
    +"\M-\C-v": "\C-a\C-k$\C-y\M-\C-e\C-a\C-y="
    +$endif
    +
    +# use a visible bell if one is available
    +set bell-style visible
    +
    +# don't strip characters to 7 bits when reading
    +set input-meta on
    +
    +# allow iso-latin1 characters to be inserted rather
    +# than converted to prefix-meta sequences
    +set convert-meta off
    +
    +# display characters with the eighth bit set directly
    +# rather than as meta-prefixed characters
    +set output-meta on
    +
    +# if there are more than 150 possible completions for
    +# a word, ask the user if he wants to see all of them
    +set completion-query-items 150
    +
    +# For FTP
    +$if Ftp
    +"\C-xg": "get \M-?"
    +"\C-xt": "put \M-?"
    +"\M-.": yank-last-arg
    +$endif
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.4 Bindable Readline Commands

    + +

    + +

    + + + + + + + + +
    8.4.1 Commands For Moving  Moving about the line.
    8.4.2 Commands For Manipulating The History  Getting at previous lines.
    8.4.3 Commands For Changing Text  Commands for changing text.
    8.4.4 Killing And Yanking  Commands for killing and yanking.
    8.4.5 Specifying Numeric Arguments  Specifying numeric arguments, repeat counts.
    8.4.6 Letting Readline Type For You  Getting Readline to do the typing for you.
    8.4.7 Keyboard Macros  Saving and re-executing typed characters
    8.4.8 Some Miscellaneous Commands  Other miscellaneous commands.
    +

    + +This section describes Readline commands that may be bound to key +sequences. +You can list your key bindings by executing +bind -P or, for a more terse format, suitable for an +inputrc file, bind -p. (See section 4.2 Bash Builtin Commands.) +Command names without an accompanying key sequence are unbound by default. +

    + +In the following descriptions, point refers to the current cursor +position, and mark refers to a cursor position saved by the +set-mark command. +The text between the point and mark is referred to as the region. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.4.1 Commands For Moving

    + +
    + +
    beginning-of-line (C-a) +
    +Move to the start of the current line. +

    + + +

    end-of-line (C-e) +
    +Move to the end of the line. +

    + + +

    forward-char (C-f) +
    +Move forward a character. +

    + + +

    backward-char (C-b) +
    +Move back a character. +

    + + +

    forward-word (M-f) +
    +Move forward to the end of the next word. +Words are composed of letters and digits. +

    + + +

    backward-word (M-b) +
    +Move back to the start of the current or previous word. +Words are composed of letters and digits. +

    + + +

    shell-forward-word () +
    +Move forward to the end of the next word. +Words are delimited by non-quoted shell metacharacters. +

    + + +

    shell-backward-word () +
    +Move back to the start of the current or previous word. +Words are delimited by non-quoted shell metacharacters. +

    + + +

    clear-screen (C-l) +
    +Clear the screen and redraw the current line, +leaving the current line at the top of the screen. +

    + + +

    redraw-current-line () +
    +Refresh the current line. By default, this is unbound. +

    + +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.4.2 Commands For Manipulating The History

    + +

    + +

    + +
    accept-line (Newline or Return) +
    +Accept the line regardless of where the cursor is. +If this line is +non-empty, add it to the history list according to the setting of +the HISTCONTROL and HISTIGNORE variables. +If this line is a modified history line, then restore the history line +to its original state. +

    + + +

    previous-history (C-p) +
    +Move `back' through the history list, fetching the previous command. +

    + + +

    next-history (C-n) +
    +Move `forward' through the history list, fetching the next command. +

    + + +

    beginning-of-history (M-<) +
    +Move to the first line in the history. +

    + + +

    end-of-history (M->) +
    +Move to the end of the input history, i.e., the line currently +being entered. +

    + + +

    reverse-search-history (C-r) +
    +Search backward starting at the current line and moving `up' through +the history as necessary. This is an incremental search. +

    + + +

    forward-search-history (C-s) +
    +Search forward starting at the current line and moving `down' through +the the history as necessary. This is an incremental search. +

    + + +

    non-incremental-reverse-search-history (M-p) +
    +Search backward starting at the current line and moving `up' +through the history as necessary using a non-incremental search +for a string supplied by the user. +

    + + +

    non-incremental-forward-search-history (M-n) +
    +Search forward starting at the current line and moving `down' +through the the history as necessary using a non-incremental search +for a string supplied by the user. +

    + + +

    history-search-forward () +
    +Search forward through the history for the string of characters +between the start of the current line and the point. +The search string must match at the beginning of a history line. +This is a non-incremental search. +By default, this command is unbound. +

    + + +

    history-search-backward () +
    +Search backward through the history for the string of characters +between the start of the current line and the point. +The search string must match at the beginning of a history line. +This is a non-incremental search. +By default, this command is unbound. +

    + + +

    history-substr-search-forward () +
    +Search forward through the history for the string of characters +between the start of the current line and the point. +The search string may match anywhere in a history line. +This is a non-incremental search. +By default, this command is unbound. +

    + + +

    history-substr-search-backward () +
    +Search backward through the history for the string of characters +between the start of the current line and the point. +The search string may match anywhere in a history line. +This is a non-incremental search. +By default, this command is unbound. +

    + + +

    yank-nth-arg (M-C-y) +
    +Insert the first argument to the previous command (usually +the second word on the previous line) at point. +With an argument n, +insert the nth word from the previous command (the words +in the previous command begin with word 0). A negative argument +inserts the nth word from the end of the previous command. +Once the argument n is computed, the argument is extracted +as if the `!n' history expansion had been specified. +

    + + +

    yank-last-arg (M-. or M-_) +
    +Insert last argument to the previous command (the last word of the +previous history entry). +With a numeric argument, behave exactly like yank-nth-arg. +Successive calls to yank-last-arg move back through the history +list, inserting the last word (or the word specified by the argument to +the first call) of each line in turn. +Any numeric argument supplied to these successive calls determines +the direction to move through the history. A negative argument switches +the direction through the history (back or forward). +The history expansion facilities are used to extract the last argument, +as if the `!$' history expansion had been specified. +

    + +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.4.3 Commands For Changing Text

    + +

    + +

    + + +
    end-of-file (usually C-d) +
    +The character indicating end-of-file as set, for example, by +stty. If this character is read when there are no characters +on the line, and point is at the beginning of the line, Readline +interprets it as the end of input and returns EOF. +

    + + +

    delete-char (C-d) +
    +Delete the character at point. If this function is bound to the +same character as the tty EOF character, as C-d +commonly is, see above for the effects. +

    + + +

    backward-delete-char (Rubout) +
    +Delete the character behind the cursor. A numeric argument means +to kill the characters instead of deleting them. +

    + + +

    forward-backward-delete-char () +
    +Delete the character under the cursor, unless the cursor is at the +end of the line, in which case the character behind the cursor is +deleted. By default, this is not bound to a key. +

    + + +

    quoted-insert (C-q or C-v) +
    +Add the next character typed to the line verbatim. This is +how to insert key sequences like C-q, for example. +

    + + +

    self-insert (a, b, A, 1, !, ...) +
    +Insert yourself. +

    + + +

    transpose-chars (C-t) +
    +Drag the character before the cursor forward over +the character at the cursor, moving the +cursor forward as well. If the insertion point +is at the end of the line, then this +transposes the last two characters of the line. +Negative arguments have no effect. +

    + + +

    transpose-words (M-t) +
    +Drag the word before point past the word after point, +moving point past that word as well. +If the insertion point is at the end of the line, this transposes +the last two words on the line. +

    + + +

    upcase-word (M-u) +
    +Uppercase the current (or following) word. With a negative argument, +uppercase the previous word, but do not move the cursor. +

    + + +

    downcase-word (M-l) +
    +Lowercase the current (or following) word. With a negative argument, +lowercase the previous word, but do not move the cursor. +

    + + +

    capitalize-word (M-c) +
    +Capitalize the current (or following) word. With a negative argument, +capitalize the previous word, but do not move the cursor. +

    + + +

    overwrite-mode () +
    +Toggle overwrite mode. With an explicit positive numeric argument, +switches to overwrite mode. With an explicit non-positive numeric +argument, switches to insert mode. This command affects only +emacs mode; vi mode does overwrite differently. +Each call to readline() starts in insert mode. +

    + +In overwrite mode, characters bound to self-insert replace +the text at point rather than pushing the text to the right. +Characters bound to backward-delete-char replace the character +before point with a space. +

    + +By default, this command is unbound. +

    + +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.4.4 Killing And Yanking

    + +

    + +

    + + +
    kill-line (C-k) +
    +Kill the text from point to the end of the line. +

    + + +

    backward-kill-line (C-x Rubout) +
    +Kill backward to the beginning of the line. +

    + + +

    unix-line-discard (C-u) +
    +Kill backward from the cursor to the beginning of the current line. +

    + + +

    kill-whole-line () +
    +Kill all characters on the current line, no matter where point is. +By default, this is unbound. +

    + + +

    kill-word (M-d) +
    +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as forward-word. +

    + + +

    backward-kill-word (M-DEL) +
    +Kill the word behind point. +Word boundaries are the same as backward-word. +

    + + +

    shell-kill-word () +
    +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as shell-forward-word. +

    + + +

    shell-backward-kill-word () +
    +Kill the word behind point. +Word boundaries are the same as shell-backward-word. +

    + + +

    unix-word-rubout (C-w) +
    +Kill the word behind point, using white space as a word boundary. +The killed text is saved on the kill-ring. +

    + + +

    unix-filename-rubout () +
    +Kill the word behind point, using white space and the slash character +as the word boundaries. +The killed text is saved on the kill-ring. +

    + + +

    delete-horizontal-space () +
    +Delete all spaces and tabs around point. By default, this is unbound. +

    + + +

    kill-region () +
    +Kill the text in the current region. +By default, this command is unbound. +

    + + +

    copy-region-as-kill () +
    +Copy the text in the region to the kill buffer, so it can be yanked +right away. By default, this command is unbound. +

    + + +

    copy-backward-word () +
    +Copy the word before point to the kill buffer. +The word boundaries are the same as backward-word. +By default, this command is unbound. +

    + + +

    copy-forward-word () +
    +Copy the word following point to the kill buffer. +The word boundaries are the same as forward-word. +By default, this command is unbound. +

    + + +

    yank (C-y) +
    +Yank the top of the kill ring into the buffer at point. +

    + + +

    yank-pop (M-y) +
    +Rotate the kill-ring, and yank the new top. You can only do this if +the prior command is yank or yank-pop. +
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.4.5 Specifying Numeric Arguments

    + +
    + + +
    digit-argument (M-0, M-1, ... M--) +
    +Add this digit to the argument already accumulating, or start a new +argument. M-- starts a negative argument. +

    + + +

    universal-argument () +
    +This is another way to specify an argument. +If this command is followed by one or more digits, optionally with a +leading minus sign, those digits define the argument. +If the command is followed by digits, executing universal-argument +again ends the numeric argument, but is otherwise ignored. +As a special case, if this command is immediately followed by a +character that is neither a digit or minus sign, the argument count +for the next command is multiplied by four. +The argument count is initially one, so executing this function the +first time makes the argument count four, a second time makes the +argument count sixteen, and so on. +By default, this is not bound to a key. +
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.4.6 Letting Readline Type For You

    + +

    + +

    + +
    complete (TAB) +
    +Attempt to perform completion on the text before point. +The actual completion performed is application-specific. +Bash attempts completion treating the text as a variable (if the +text begins with `$'), username (if the text begins with +`~'), hostname (if the text begins with `@'), or +command (including aliases and functions) in turn. If none +of these produces a match, filename completion is attempted. +

    + + +

    possible-completions (M-?) +
    +List the possible completions of the text before point. +When displaying completions, Readline sets the number of columns used +for display to the value of completion-display-width, the value of +the environment variable COLUMNS, or the screen width, in that order. +

    + + +

    insert-completions (M-*) +
    +Insert all completions of the text before point that would have +been generated by possible-completions. +

    + + +

    menu-complete () +
    +Similar to complete, but replaces the word to be completed +with a single match from the list of possible completions. +Repeated execution of menu-complete steps through the list +of possible completions, inserting each match in turn. +At the end of the list of completions, the bell is rung +(subject to the setting of bell-style) +and the original text is restored. +An argument of n moves n positions forward in the list +of matches; a negative argument may be used to move backward +through the list. +This command is intended to be bound to TAB, but is unbound +by default. +

    + + +

    menu-complete-backward () +
    +Identical to menu-complete, but moves backward through the list +of possible completions, as if menu-complete had been given a +negative argument. +

    + + +

    delete-char-or-list () +
    +Deletes the character under the cursor if not at the beginning or +end of the line (like delete-char). +If at the end of the line, behaves identically to +possible-completions. +This command is unbound by default. +

    + + +

    complete-filename (M-/) +
    +Attempt filename completion on the text before point. +

    + + +

    possible-filename-completions (C-x /) +
    +List the possible completions of the text before point, +treating it as a filename. +

    + + +

    complete-username (M-~) +
    +Attempt completion on the text before point, treating +it as a username. +

    + + +

    possible-username-completions (C-x ~) +
    +List the possible completions of the text before point, +treating it as a username. +

    + + +

    complete-variable (M-$) +
    +Attempt completion on the text before point, treating +it as a shell variable. +

    + + +

    possible-variable-completions (C-x $) +
    +List the possible completions of the text before point, +treating it as a shell variable. +

    + + +

    complete-hostname (M-@) +
    +Attempt completion on the text before point, treating +it as a hostname. +

    + + +

    possible-hostname-completions (C-x @) +
    +List the possible completions of the text before point, +treating it as a hostname. +

    + + +

    complete-command (M-!) +
    +Attempt completion on the text before point, treating +it as a command name. Command completion attempts to +match the text against aliases, reserved words, shell +functions, shell builtins, and finally executable filenames, +in that order. +

    + + +

    possible-command-completions (C-x !) +
    +List the possible completions of the text before point, +treating it as a command name. +

    + + +

    dynamic-complete-history (M-TAB) +
    +Attempt completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +

    + + +

    dabbrev-expand () +
    +Attempt menu completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. +

    + + +

    complete-into-braces (M-{) +
    +Perform filename completion and insert the list of possible completions +enclosed within braces so the list is available to the shell +(see section 3.5.1 Brace Expansion). +

    + +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.4.7 Keyboard Macros

    + +
    + + +
    start-kbd-macro (C-x () +
    +Begin saving the characters typed into the current keyboard macro. +

    + + +

    end-kbd-macro (C-x )) +
    +Stop saving the characters typed into the current keyboard macro +and save the definition. +

    + + +

    call-last-kbd-macro (C-x e) +
    +Re-execute the last keyboard macro defined, by making the characters +in the macro appear as if typed at the keyboard. +

    + + +

    print-last-kbd-macro () +
    +Print the last keboard macro defined in a format suitable for the +inputrc file. +

    + +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.4.8 Some Miscellaneous Commands

    + +
    + + +
    re-read-init-file (C-x C-r) +
    +Read in the contents of the inputrc file, and incorporate +any bindings or variable assignments found there. +

    + + +

    abort (C-g) +
    +Abort the current editing command and +ring the terminal's bell (subject to the setting of +bell-style). +

    + + +

    do-uppercase-version (M-a, M-b, M-x, ...) +
    +If the metafied character x is lowercase, run the command +that is bound to the corresponding uppercase character. +

    + + +

    prefix-meta (ESC) +
    +Metafy the next character typed. This is for keyboards +without a meta key. Typing `ESC f' is equivalent to typing +M-f. +

    + + +

    undo (C-_ or C-x C-u) +
    +Incremental undo, separately remembered for each line. +

    + + +

    revert-line (M-r) +
    +Undo all changes made to this line. This is like executing the undo +command enough times to get back to the beginning. +

    + + +

    tilde-expand (M-&) +
    +Perform tilde expansion on the current word. +

    + + +

    set-mark (C-@) +
    +Set the mark to the point. If a +numeric argument is supplied, the mark is set to that position. +

    + + +

    exchange-point-and-mark (C-x C-x) +
    +Swap the point with the mark. The current cursor position is set to +the saved position, and the old cursor position is saved as the mark. +

    + + +

    character-search (C-]) +
    +A character is read and point is moved to the next occurrence of that +character. A negative count searches for previous occurrences. +

    + + +

    character-search-backward (M-C-]) +
    +A character is read and point is moved to the previous occurrence +of that character. A negative count searches for subsequent +occurrences. +

    + + +

    skip-csi-sequence () +
    +Read enough characters to consume a multi-key sequence such as those +defined for keys like Home and End. Such sequences begin with a +Control Sequence Indicator (CSI), usually ESC-[. If this sequence is +bound to "\e[", keys producing such sequences will have no effect +unless explicitly bound to a readline command, instead of inserting +stray characters into the editing buffer. This is unbound by default, +but usually bound to ESC-[. +

    + + +

    insert-comment (M-#) +
    +Without a numeric argument, the value of the comment-begin +variable is inserted at the beginning of the current line. +If a numeric argument is supplied, this command acts as a toggle: if +the characters at the beginning of the line do not match the value +of comment-begin, the value is inserted, otherwise +the characters in comment-begin are deleted from the beginning of +the line. +In either case, the line is accepted as if a newline had been typed. +The default value of comment-begin causes this command +to make the current line a shell comment. +If a numeric argument causes the comment character to be removed, the line +will be executed by the shell. +

    + + +

    dump-functions () +
    +Print all of the functions and their key bindings to the +Readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an inputrc file. This command is unbound by default. +

    + + +

    dump-variables () +
    +Print all of the settable variables and their values to the +Readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an inputrc file. This command is unbound by default. +

    + + +

    dump-macros () +
    +Print all of the Readline key sequences bound to macros and the +strings they output. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an inputrc file. This command is unbound by default. +

    + + +

    glob-complete-word (M-g) +
    +The word before point is treated as a pattern for pathname expansion, +with an asterisk implicitly appended. This pattern is used to +generate a list of matching file names for possible completions. +

    + + +

    glob-expand-word (C-x *) +
    +The word before point is treated as a pattern for pathname expansion, +and the list of matching file names is inserted, replacing the word. +If a numeric argument is supplied, a `*' is appended before +pathname expansion. +

    + + +

    glob-list-expansions (C-x g) +
    +The list of expansions that would have been generated by +glob-expand-word is displayed, and the line is redrawn. +If a numeric argument is supplied, a `*' is appended before +pathname expansion. +

    + + +

    display-shell-version (C-x C-v) +
    +Display version information about the current instance of Bash. +

    + + +

    shell-expand-line (M-C-e) +
    +Expand the line as the shell does. +This performs alias and history expansion as well as all of the shell +word expansions (see section 3.5 Shell Expansions). +

    + + +

    history-expand-line (M-^) +
    +Perform history expansion on the current line. +

    + + +

    magic-space () +
    +Perform history expansion on the current line and insert a space +(see section 9.3 History Expansion). +

    + + +

    alias-expand-line () +
    +Perform alias expansion on the current line (see section 6.6 Aliases). +

    + + +

    history-and-alias-expand-line () +
    +Perform history and alias expansion on the current line. +

    + + +

    insert-last-argument (M-. or M-_) +
    +A synonym for yank-last-arg. +

    + + +

    operate-and-get-next (C-o) +
    +Accept the current line for execution and fetch the next line +relative to the current line from the history for editing. Any +argument is ignored. +

    + + +

    edit-and-execute-command (C-xC-e) +
    +Invoke an editor on the current command line, and execute the result as shell +commands. +Bash attempts to invoke +$VISUAL, $EDITOR, and emacs +as the editor, in that order. +

    + +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.5 Readline vi Mode

    + +

    + +While the Readline library does not have a full set of vi +editing functions, it does contain enough to allow simple editing +of the line. The Readline vi mode behaves as specified in +the POSIX standard. +

    + +In order to switch interactively between emacs and vi +editing modes, use the `set -o emacs' and `set -o vi' +commands (see section 4.3.1 The Set Builtin). +The Readline default is emacs mode. +

    + +When you enter a line in vi mode, you are already placed in +`insertion' mode, as if you had typed an `i'. Pressing ESC +switches you into `command' mode, where you can edit the text of the +line with the standard vi movement keys, move to previous +history lines with `k' and subsequent lines with `j', and +so forth. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.6 Programmable Completion

    + +

    + +When word completion is attempted for an argument to a command for +which a completion specification (a compspec) has been defined +using the complete builtin (see section 8.7 Programmable Completion Builtins), +the programmable completion facilities are invoked. +

    + +First, the command name is identified. +If a compspec has been defined for that command, the +compspec is used to generate the list of possible completions for the word. +If the command word is the empty string (completion attempted at the +beginning of an empty line), any compspec defined with +the `-E' option to complete is used. +If the command word is a full pathname, a compspec for the full +pathname is searched for first. +If no compspec is found for the full pathname, an attempt is made to +find a compspec for the portion following the final slash. +If those searches do not result in a compspec, any compspec defined with +the `-D' option to complete is used as the default. +

    + +Once a compspec has been found, it is used to generate the list of +matching words. +If a compspec is not found, the default Bash completion +described above (see section 8.4.6 Letting Readline Type For You) is performed. +

    + +First, the actions specified by the compspec are used. +Only matches which are prefixed by the word being completed are +returned. +When the `-f' or `-d' option is used for filename or +directory name completion, the shell variable FIGNORE is +used to filter the matches. +See section 5.2 Bash Variables, for a description of FIGNORE. +

    + +Any completions specified by a filename expansion pattern to the +`-G' option are generated next. +The words generated by the pattern need not match the word being completed. +The GLOBIGNORE shell variable is not used to filter the matches, +but the FIGNORE shell variable is used. +

    + +Next, the string specified as the argument to the `-W' option +is considered. +The string is first split using the characters in the IFS +special variable as delimiters. +Shell quoting is honored. +Each word is then expanded using +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, and arithmetic expansion, +as described above (see section 3.5 Shell Expansions). +The results are split using the rules described above +(see section 3.5.7 Word Splitting). +The results of the expansion are prefix-matched against the word being +completed, and the matching words become the possible completions. +

    + +After these matches have been generated, any shell function or command +specified with the `-F' and `-C' options is invoked. +When the command or function is invoked, the COMP_LINE, +COMP_POINT, COMP_KEY, and COMP_TYPE variables are +assigned values as described above (see section 5.2 Bash Variables). +If a shell function is being invoked, the COMP_WORDS and +COMP_CWORD variables are also set. +When the function or command is invoked, the first argument ($1) is the +name of the command whose arguments are being completed, the +second argument ($2) is the word being completed, and the third argument +($3) is the word preceding the word being completed on the current command +line. +No filtering of the generated completions against the word being completed +is performed; the function or command has complete freedom in generating +the matches. +

    + +Any function specified with `-F' is invoked first. +The function may use any of the shell facilities, including the +compgen and compopt builtins described below +(see section 8.7 Programmable Completion Builtins), to generate the matches. +It must put the possible completions in the COMPREPLY array +variable, one per array element. +

    + +Next, any command specified with the `-C' option is invoked +in an environment equivalent to command substitution. +It should print a list of completions, one per line, to +the standard output. +Backslash may be used to escape a newline, if necessary. +

    + +After all of the possible completions are generated, any filter +specified with the `-X' option is applied to the list. +The filter is a pattern as used for pathname expansion; a `&' +in the pattern is replaced with the text of the word being completed. +A literal `&' may be escaped with a backslash; the backslash +is removed before attempting a match. +Any completion that matches the pattern will be removed from the list. +A leading `!' negates the pattern; in this case any completion +not matching the pattern will be removed. +

    + +Finally, any prefix and suffix specified with the `-P' and `-S' +options are added to each member of the completion list, and the result is +returned to the Readline completion code as the list of possible +completions. +

    + +If the previously-applied actions do not generate any matches, and the +`-o dirnames' option was supplied to complete when the +compspec was defined, directory name completion is attempted. +

    + +If the `-o plusdirs' option was supplied to complete when +the compspec was defined, directory name completion is attempted and any +matches are added to the results of the other actions. +

    + +By default, if a compspec is found, whatever it generates is returned to +the completion code as the full set of possible completions. +The default Bash completions are not attempted, and the Readline default +of filename completion is disabled. +If the `-o bashdefault' option was supplied to complete when +the compspec was defined, the default Bash completions are attempted +if the compspec generates no matches. +If the `-o default' option was supplied to complete when the +compspec was defined, Readline's default completion will be performed +if the compspec (and, if attempted, the default Bash completions) +generate no matches. +

    + +When a compspec indicates that directory name completion is desired, +the programmable completion functions force Readline to append a slash +to completed names which are symbolic links to directories, subject to +the value of the mark-directories Readline variable, regardless +of the setting of the mark-symlinked-directories Readline variable. +

    + +There is some support for dynamically modifying completions. This is +most useful when used in combination with a default completion specified +with `-D'. It's possible for shell functions executed as completion +handlers to indicate that completion should be retried by returning an +exit status of 124. If a shell function returns 124, and changes +the compspec associated with the command on which completion is being +attempted (supplied as the first argument when the function is executed), +programmable completion restarts from the beginning, with an +attempt to find a new compspec for that command. This allows a set of +completions to be built dynamically as completion is attempted, rather than +being loaded all at once. +

    + +For instance, assuming that there is a library of compspecs, each kept in a +file corresponding to the name of the command, the following default +completion function would load completions dynamically: +

    + +
     
    _completion_loader()
    +{
    +    . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124
    +}
    +complete -D -F _completion_loader -o bashdefault -o default
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.7 Programmable Completion Builtins

    + +

    + +Three builtin commands are available to manipulate the programmable completion +facilities: one to specify how the arguments to a particular command are to +be completed, and two to modify the completion as it is happening. +

    + +

    +
    compgen +
    +
     
    compgen [option] [word]
    +

    + +Generate possible completion matches for word according to +the options, which may be any option accepted by the +complete +builtin with the exception of `-p' and `-r', and write +the matches to the standard output. +When using the `-F' or `-C' options, the various shell variables +set by the programmable completion facilities, while available, will not +have useful values. +

    + +The matches will be generated in the same way as if the programmable +completion code had generated them directly from a completion specification +with the same flags. +If word is specified, only those completions matching word +will be displayed. +

    + +The return value is true unless an invalid option is supplied, or no +matches were generated. +

    + +

    complete +
    +
     
    complete [-abcdefgjksuv] [-o comp-option] [-DE] [-A action] [-G globpat] [-W wordlist]
    +[-F function] [-C command] [-X filterpat]
    +[-P prefix] [-S suffix] name [name ...]
    +complete -pr [-DE] [name ...]
    +

    + +Specify how arguments to each name should be completed. +If the `-p' option is supplied, or if no options are supplied, existing +completion specifications are printed in a way that allows them to be +reused as input. +The `-r' option removes a completion specification for +each name, or, if no names are supplied, all +completion specifications. +The `-D' option indicates that the remaining options and actions should +apply to the "default" command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The `-E' option indicates that the remaining options and actions should +apply to "empty" command completion; that is, completion attempted on a +blank line. +

    + +The process of applying these completion specifications when word completion +is attempted is described above (see section 8.6 Programmable Completion). The +`-D' option takes precedence over `-E'. +

    + +Other options, if specified, have the following meanings. +The arguments to the `-G', `-W', and `-X' options +(and, if necessary, the `-P' and `-S' options) +should be quoted to protect them from expansion before the +complete builtin is invoked. +

    + +

    +
    -o comp-option +
    The comp-option controls several aspects of the compspec's behavior +beyond the simple generation of completions. +comp-option may be one of: +

    + +

    + +
    bashdefault +
    Perform the rest of the default Bash completions if the compspec +generates no matches. +

    + +

    default +
    Use Readline's default filename completion if the compspec generates +no matches. +

    + +

    dirnames +
    Perform directory name completion if the compspec generates no matches. +

    + +

    filenames +
    Tell Readline that the compspec generates filenames, so it can perform any +filename-specific processing (like adding a slash to directory names +quoting special characters, or suppressing trailing spaces). +This option is intended to be used with shell functions specified +with `-F'. +

    + +

    noquote +
    Tell Readline not to quote the completed words if they are filenames +(quoting filenames is the default). +

    + +

    nospace +
    Tell Readline not to append a space (the default) to words completed at +the end of the line. +

    + +

    plusdirs +
    After any matches defined by the compspec are generated, +directory name completion is attempted and any +matches are added to the results of the other actions. +

    + +

    +

    + +

    -A action +
    The action may be one of the following to generate a list of possible +completions: +

    + +

    +
    alias +
    Alias names. May also be specified as `-a'. +

    + +

    arrayvar +
    Array variable names. +

    + +

    binding +
    Readline key binding names (see section 8.4 Bindable Readline Commands). +

    + +

    builtin +
    Names of shell builtin commands. May also be specified as `-b'. +

    + +

    command +
    Command names. May also be specified as `-c'. +

    + +

    directory +
    Directory names. May also be specified as `-d'. +

    + +

    disabled +
    Names of disabled shell builtins. +

    + +

    enabled +
    Names of enabled shell builtins. +

    + +

    export +
    Names of exported shell variables. May also be specified as `-e'. +

    + +

    file +
    File names. May also be specified as `-f'. +

    + +

    function +
    Names of shell functions. +

    + +

    group +
    Group names. May also be specified as `-g'. +

    + +

    helptopic +
    Help topics as accepted by the help builtin (see section 4.2 Bash Builtin Commands). +

    + +

    hostname +
    Hostnames, as taken from the file specified by the +HOSTFILE shell variable (see section 5.2 Bash Variables). +

    + +

    job +
    Job names, if job control is active. May also be specified as `-j'. +

    + +

    keyword +
    Shell reserved words. May also be specified as `-k'. +

    + +

    running +
    Names of running jobs, if job control is active. +

    + +

    service +
    Service names. May also be specified as `-s'. +

    + +

    setopt +
    Valid arguments for the `-o' option to the set builtin +(see section 4.3.1 The Set Builtin). +

    + +

    shopt +
    Shell option names as accepted by the shopt builtin +(see section 4.2 Bash Builtin Commands). +

    + +

    signal +
    Signal names. +

    + +

    stopped +
    Names of stopped jobs, if job control is active. +

    + +

    user +
    User names. May also be specified as `-u'. +

    + +

    variable +
    Names of all shell variables. May also be specified as `-v'. +
    +

    + +

    -C command +
    command is executed in a subshell environment, and its output is +used as the possible completions. +

    + +

    -F function +
    The shell function function is executed in the current shell +environment. +When it is executed, $1 is the name of the command whose arguments are +being completed, $2 is the word being completed, and $3 is the word +preceding the word being completed, as described above +(see section 8.6 Programmable Completion). +When it finishes, the possible completions are retrieved from the value +of the COMPREPLY array variable. +

    + +

    -G globpat +
    The filename expansion pattern globpat is expanded to generate +the possible completions. +

    + +

    -P prefix +
    prefix is added at the beginning of each possible completion +after all other options have been applied. +

    + +

    -S suffix +
    suffix is appended to each possible completion +after all other options have been applied. +

    + +

    -W wordlist +
    The wordlist is split using the characters in the +IFS special variable as delimiters, and each resultant word +is expanded. +The possible completions are the members of the resultant list which +match the word being completed. +

    + +

    -X filterpat +
    filterpat is a pattern as used for filename expansion. +It is applied to the list of possible completions generated by the +preceding options and arguments, and each completion matching +filterpat is removed from the list. +A leading `!' in filterpat negates the pattern; in this +case, any completion not matching filterpat is removed. +
    +

    + +The return value is true unless an invalid option is supplied, an option +other than `-p' or `-r' is supplied without a name +argument, an attempt is made to remove a completion specification for +a name for which no specification exists, or +an error occurs adding a completion specification. +

    + +

    compopt +
    +
     
    compopt [-o option] [-DE] [+o option] [name]
    +
    Modify completion options for each name according to the +options, or for the currently-executing completion if no names +are supplied. +If no options are given, display the completion options for each +name or the current completion. +The possible values of option are those valid for the complete +builtin described above. +The `-D' option indicates that the remaining options should +apply to the "default" command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The `-E' option indicates that the remaining options should +apply to "empty" command completion; that is, completion attempted on a +blank line. +

    + +The `-D' option takes precedence over `-E'. +

    + +The return value is true unless an invalid option is supplied, an attempt +is made to modify the options for a name for which no completion +specification exists, or an output error occurs. +

    + +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    8.8 A Programmable Completion Example

    + +

    + +The most common way to obtain additional completion functionality beyond +the default actions complete and compgen provide is to use +a shell function and bind it to a particular command using complete -F. +

    + +The following function provides completions for the cd builtin. +It is a reasonably good example of what shell functions must do when +used for completion. This function uses the word passsed as $2 +to determine the directory name to complete. You can also use the +COMP_WORDS array variable; the current word is indexed by the +COMP_CWORD variable. +

    + +The function relies on the complete and compgen builtins +to do much of the work, adding only the things that the Bash cd +does beyond accepting basic directory names: +tilde expansion (see section 3.5.2 Tilde Expansion), +searching directories in $CDPATH, which is described above +(see section 4.1 Bourne Shell Builtins), +and basic support for the cdable_vars shell option +(see section 4.3.2 The Shopt Builtin). +_comp_cd modifies the value of IFS so that it contains only +a newline to accommodate file names containing spaces and tabs -- +compgen prints the possible completions it generates one per line. +

    + +Possible completions go into the COMPREPLY array variable, one +completion per array element. The programmable completion system retrieves +the completions from there when the function returns. +

    + +
     
    # A completion function for the cd builtin
    +# based on the cd completion function from the bash_completion package
    +_comp_cd()
    +{
    +    local IFS=$' \t\n'    # normalize IFS
    +    local cur _skipdot _cdpath
    +    local i j k
    +
    +    # Tilde expansion, with side effect of expanding tilde to full pathname
    +    case "$2" in
    +    \~*)    eval cur="$2" ;;
    +    *)      cur=$2 ;;
    +    esac
    +
    +    # no cdpath or absolute pathname -- straight directory completion
    +    if [[ -z "${CDPATH:-}" ]] || [[ "$cur" == @(./*|../*|/*) ]]; then
    +        # compgen prints paths one per line; could also use while loop
    +        IFS=$'\n'
    +        COMPREPLY=( $(compgen -d -- "$cur") )
    +        IFS=$' \t\n'
    +    # CDPATH+directories in the current directory if not in CDPATH
    +    else
    +        IFS=$'\n'
    +        _skipdot=false
    +        # preprocess CDPATH to convert null directory names to .
    +        _cdpath=${CDPATH/#:/.:}
    +        _cdpath=${_cdpath//::/:.:}
    +        _cdpath=${_cdpath/%:/:.}
    +        for i in ${_cdpath//:/$'\n'}; do
    +            if [[ $i -ef . ]]; then _skipdot=true; fi
    +            k="${#COMPREPLY[@]}"
    +            for j in $( compgen -d -- "$i/$cur" ); do
    +                COMPREPLY[k++]=${j#$i/}        # cut off directory
    +            done
    +        done
    +        $_skipdot || COMPREPLY+=( $(compgen -d -- "$cur") )
    +        IFS=$' \t\n'
    +    fi
    +
    +    # variable names if appropriate shell option set and no completions
    +    if shopt -q cdable_vars && [[ ${#COMPREPLY[@]} -eq 0 ]]; then
    +        COMPREPLY=( $(compgen -v -- "$cur") )
    +    fi
    +
    +    return 0
    +}
    +

    + +We install the completion function using the `-F' option to +complete: +

    + +
     
    # Tell readline to quote appropriate and append slashes to directories;
    +# use the bash default completion for other arguments
    +complete -o filenames -o nospace -o bashdefault -F _comp_cd cd
    +

    + +Since we'd like Bash and Readline to take care of some +of the other details for us, we use several other options to tell Bash +and Readline what to do. The `-o filenames' option tells Readline +that the possible completions should be treated as filenames, and quoted +appropriately. That option will also cause Readline to append a slash to +filenames it can determine are directories (which is why we might want to +extend _comp_cd to append a slash if we're using directories found +via CDPATH: Readline can't tell those completions are directories). +The `-o nospace' option tells Readline to not append a space +character to the directory name, in case we want to append to it. +The `-o bashdefault' option brings in the rest of the "Bash default" +completions -- possible completion that Bash adds to the default Readline +set. These include things like command name completion, variable completion +for words beginning with `{', completions containing pathname +expansion patterns (see section 3.5.8 Filename Expansion), and so on. +

    + +Once installed using complete, _comp_cd will be called every +time we attempt word completion for a cd command. +

    + +Many more examples -- an extensive collection of completions for most of +the common GNU, Unix, and Linux commands -- are available as part of the +bash_completion project. This is installed by default on many GNU/Linux +distributions. Originally written by Ian Macdonald, the project now lives +at http://bash-completion.alioth.debian.org/. There are ports for +other systems such as Solaris and Mac OS X. +

    + +An older version of the bash_completion package is distributed with bash +in the `examples/complete' subdirectory. +

    + + +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    9. Using History Interactively

    + +

    + +This chapter describes how to use the GNU History Library +interactively, from a user's standpoint. +It should be considered a user's guide. +For information on using the GNU History Library in other programs, +see the GNU Readline Library Manual. +

    + +

    + + + +
    9.1 Bash History Facilities  How Bash lets you manipulate your command + history.
    9.2 Bash History Builtins  The Bash builtin commands that manipulate + the command history.
    9.3 History Expansion  What it feels like using History as a user.
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    9.1 Bash History Facilities

    + +

    + +When the `-o history' option to the set builtin +is enabled (see section 4.3.1 The Set Builtin), +the shell provides access to the command history, +the list of commands previously typed. +The value of the HISTSIZE shell variable is used as the +number of commands to save in a history list. +The text of the last $HISTSIZE +commands (default 500) is saved. +The shell stores each command in the history list prior to +parameter and variable expansion +but after history expansion is performed, subject to the +values of the shell variables +HISTIGNORE and HISTCONTROL. +

    + +When the shell starts up, the history is initialized from the +file named by the HISTFILE variable (default `~/.bash_history'). +The file named by the value of HISTFILE is truncated, if +necessary, to contain no more than the number of lines specified by +the value of the HISTFILESIZE variable. +When a shell with history enabled exits, the last +$HISTSIZE lines are copied from the history list to the file +named by $HISTFILE. +If the histappend shell option is set (see section 4.2 Bash Builtin Commands), +the lines are appended to the history file, +otherwise the history file is overwritten. +If HISTFILE +is unset, or if the history file is unwritable, the history is not saved. +After saving the history, the history file is truncated +to contain no more than $HISTFILESIZE lines. +If HISTFILESIZE is unset, or set to null, a non-numeric value, or +a numeric value less than zero, the history file is not truncated. +

    + +If the HISTTIMEFORMAT is set, the time stamp information +associated with each history entry is written to the history file, +marked with the history comment character. +When the history file is read, lines beginning with the history +comment character followed immediately by a digit are interpreted +as timestamps for the previous history line. +

    + +The builtin command fc may be used to list or edit and re-execute +a portion of the history list. +The history builtin may be used to display or modify the history +list and manipulate the history file. +When using command-line editing, search commands +are available in each editing mode that provide access to the +history list (see section 8.4.2 Commands For Manipulating The History). +

    + +The shell allows control over which commands are saved on the history +list. The HISTCONTROL and HISTIGNORE +variables may be set to cause the shell to save only a subset of the +commands entered. +The cmdhist +shell option, if enabled, causes the shell to attempt to save each +line of a multi-line command in the same history entry, adding +semicolons where necessary to preserve syntactic correctness. +The lithist +shell option causes the shell to save the command with embedded newlines +instead of semicolons. +The shopt builtin is used to set these options. +See section 4.2 Bash Builtin Commands, for a description of shopt. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    9.2 Bash History Builtins

    + +

    + +Bash provides two builtin commands which manipulate the +history list and history file. +

    + +

    + +
    fc +
    +
     
    fc [-e ename] [-lnr] [first] [last]
    +fc -s [pat=rep] [command]
    +

    + +The first form selects a range of commands from first to +last from the history list and displays or edits and re-executes +them. +Both first and +last may be specified as a string (to locate the most recent +command beginning with that string) or as a number (an index into the +history list, where a negative number is used as an offset from the +current command number). If last is not specified it is set to +first. If first is not specified it is set to the previous +command for editing and -16 for listing. If the `-l' flag is +given, the commands are listed on standard output. The `-n' flag +suppresses the command numbers when listing. The `-r' flag +reverses the order of the listing. Otherwise, the editor given by +ename is invoked on a file containing those commands. If +ename is not given, the value of the following variable expansion +is used: ${FCEDIT:-${EDITOR:-vi}}. This says to use the +value of the FCEDIT variable if set, or the value of the +EDITOR variable if that is set, or vi if neither is set. +When editing is complete, the edited commands are echoed and executed. +

    + +In the second form, command is re-executed after each instance +of pat in the selected command is replaced by rep. +command is intepreted the same as first above. +

    + +A useful alias to use with the fc command is r='fc -s', so +that typing `r cc' runs the last command beginning with cc +and typing `r' re-executes the last command (see section 6.6 Aliases). +

    + +

    history +
    +
     
    history [n]
    +history -c
    +history -d offset
    +history [-anrw] [filename]
    +history -ps arg
    +

    + +With no options, display the history list with line numbers. +Lines prefixed with a `*' have been modified. +An argument of n lists only the last n lines. +If the shell variable HISTTIMEFORMAT is set and not null, +it is used as a format string for strftime to display +the time stamp associated with each displayed history entry. +No intervening blank is printed between the formatted time stamp +and the history line. +

    + +Options, if supplied, have the following meanings: +

    + +

    +
    -c +
    Clear the history list. This may be combined +with the other options to replace the history list completely. +

    + +

    -d offset +
    Delete the history entry at position offset. +offset should be specified as it appears when the history is +displayed. +

    + +

    -a +
    Append the new +history lines (history lines entered since the beginning of the +current Bash session) to the history file. +

    + +

    -n +
    Append the history lines not already read from the history file +to the current history list. These are lines appended to the history +file since the beginning of the current Bash session. +

    + +

    -r +
    Read the history file and append its contents to +the history list. +

    + +

    -w +
    Write out the current history list to the history file. +

    + +

    -p +
    Perform history substitution on the args and display the result +on the standard output, without storing the results in the history list. +

    + +

    -s +
    The args are added to the end of +the history list as a single entry. +

    + +

    +

    + +When any of the `-w', `-r', `-a', or `-n' options is +used, if filename +is given, then it is used as the history file. If not, then +the value of the HISTFILE variable is used. +

    + +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    9.3 History Expansion

    + +

    + +The History library provides a history expansion feature that is similar +to the history expansion provided by csh. This section +describes the syntax used to manipulate the history information. +

    + +History expansions introduce words from the history list into +the input stream, making it easy to repeat commands, insert the +arguments to a previous command into the current input line, or +fix errors in previous commands quickly. +

    + +History expansion takes place in two parts. The first is to determine +which line from the history list should be used during substitution. +The second is to select portions of that line for inclusion into the +current one. The line selected from the history is called the +event, and the portions of that line that are acted upon are +called words. Various modifiers are available to manipulate +the selected words. The line is broken into words in the same fashion +that Bash does, so that several words +surrounded by quotes are considered one word. +History expansions are introduced by the appearance of the +history expansion character, which is `!' by default. +Only `\' and `'' may be used to escape the history expansion +character. +

    + +Several shell options settable with the shopt +builtin (see section 4.2 Bash Builtin Commands) may be used to tailor +the behavior of history expansion. If the +histverify shell option is enabled, and Readline +is being used, history substitutions are not immediately passed to +the shell parser. +Instead, the expanded line is reloaded into the Readline +editing buffer for further modification. +If Readline is being used, and the histreedit +shell option is enabled, a failed history expansion will be +reloaded into the Readline editing buffer for correction. +The `-p' option to the history builtin command +may be used to see what a history expansion will do before using it. +The `-s' option to the history builtin may be used to +add commands to the end of the history list without actually executing +them, so that they are available for subsequent recall. +This is most useful in conjunction with Readline. +

    + +The shell allows control of the various characters used by the +history expansion mechanism with the histchars variable, +as explained above (see section 5.2 Bash Variables). The shell uses +the history comment character to mark history timestamps when +writing the history file. +

    + +

    + + + +
    9.3.1 Event Designators  How to specify which history line to use.
    9.3.2 Word Designators  Specifying which words are of interest.
    9.3.3 Modifiers  Modifying the results of substitution.
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    9.3.1 Event Designators

    + +

    + +An event designator is a reference to a command line entry in the +history list. +Unless the reference is absolute, events are relative to the current +position in the history list. + +

    + +

    + +
    ! +
    Start a history substitution, except when followed by a space, tab, +the end of the line, `=' or `(' (when the +extglob shell option is enabled using the shopt builtin). +

    + +

    !n +
    Refer to command line n. +

    + +

    !-n +
    Refer to the command n lines back. +

    + +

    !! +
    Refer to the previous command. This is a synonym for `!-1'. +

    + +

    !string +
    Refer to the most recent command +preceding the current position in the history list +starting with string. +

    + +

    !?string[?] +
    Refer to the most recent command +preceding the current position in the history list +containing string. +The trailing +`?' may be omitted if the string is followed immediately by +a newline. +

    + +

    ^string1^string2^ +
    Quick Substitution. Repeat the last command, replacing string1 +with string2. Equivalent to +!!:s/string1/string2/. +

    + +

    !# +
    The entire command line typed so far. +

    + +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    9.3.2 Word Designators

    + +

    + +Word designators are used to select desired words from the event. +A `:' separates the event specification from the word designator. It +may be omitted if the word designator begins with a `^', `$', +`*', `-', or `%'. Words are numbered from the beginning +of the line, with the first word being denoted by 0 (zero). Words are +inserted into the current line separated by single spaces. +

    + +For example, +

    + +

    +
    !! +
    designates the preceding command. When you type this, the preceding +command is repeated in toto. +

    + +

    !!:$ +
    designates the last argument of the preceding command. This may be +shortened to !$. +

    + +

    !fi:2 +
    designates the second argument of the most recent command starting with +the letters fi. +
    +

    + +Here are the word designators: + +

    + +
    0 (zero) +
    The 0th word. For many applications, this is the command word. +

    + +

    n +
    The nth word. +

    + +

    ^ +
    The first argument; that is, word 1. +

    + +

    $ +
    The last argument. +

    + +

    % +
    The word matched by the most recent `?string?' search. +

    + +

    x-y +
    A range of words; `-y' abbreviates `0-y'. +

    + +

    * +
    All of the words, except the 0th. This is a synonym for `1-$'. +It is not an error to use `*' if there is just one word in the event; +the empty string is returned in that case. +

    + +

    x* +
    Abbreviates `x-$' +

    + +

    x- +
    Abbreviates `x-$' like `x*', but omits the last word. +

    + +

    +

    + +If a word designator is supplied without an event specification, the +previous command is used as the event. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    9.3.3 Modifiers

    + +

    + +After the optional word designator, you can add a sequence of one or more +of the following modifiers, each preceded by a `:'. +

    + +

    + +
    h +
    Remove a trailing pathname component, leaving only the head. +

    + +

    t +
    Remove all leading pathname components, leaving the tail. +

    + +

    r +
    Remove a trailing suffix of the form `.suffix', leaving +the basename. +

    + +

    e +
    Remove all but the trailing suffix. +

    + +

    p +
    Print the new command but do not execute it. +

    + +

    q +
    Quote the substituted words, escaping further substitutions. +

    + +

    x +
    Quote the substituted words as with `q', +but break into words at spaces, tabs, and newlines. +

    + +

    s/old/new/ +
    Substitute new for the first occurrence of old in the +event line. Any delimiter may be used in place of `/'. +The delimiter may be quoted in old and new +with a single backslash. If `&' appears in new, +it is replaced by old. A single backslash will quote +the `&'. The final delimiter is optional if it is the last +character on the input line. +

    + +

    & +
    Repeat the previous substitution. +

    + +

    g +
    a +
    Cause changes to be applied over the entire event line. Used in +conjunction with `s', as in gs/old/new/, +or with `&'. +

    + +

    G +
    Apply the following `s' modifier once to each word in the event. +

    + +

    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    10. Installing Bash

    + +

    + +This chapter provides basic instructions for installing Bash on +the various supported platforms. The distribution supports the +GNU operating systems, nearly every version of Unix, and several +non-Unix systems such as BeOS and Interix. +Other independent ports exist for +MS-DOS, OS/2, and Windows platforms. +

    + +

    + + + + + + + + +
    10.1 Basic Installation  Installation instructions.
    10.2 Compilers and Options  How to set special options for various + systems.
    10.3 Compiling For Multiple Architectures  How to compile Bash for more + than one kind of system from + the same source tree.
    10.4 Installation Names  How to set the various paths used by the installation.
    10.5 Specifying the System Type  How to configure Bash for a particular system.
    10.6 Sharing Defaults  How to share default configuration values among GNU + programs.
    10.7 Operation Controls  Options recognized by the configuration program.
    10.8 Optional Features  How to enable and disable optional features when + building Bash.
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    10.1 Basic Installation

    + +

    + +These are installation instructions for Bash. +

    + +The simplest way to compile Bash is: +

    + +

      +
    1. +cd to the directory containing the source code and type +`./configure' to configure Bash for your system. If you're +using csh on an old version of System V, you might need to +type `sh ./configure' instead to prevent csh from trying +to execute configure itself. +

      + +Running configure takes some time. +While running, it prints messages telling which features it is +checking for. +

      + +

    2. +Type `make' to compile Bash and build the bashbug bug +reporting script. +

      + +

    3. +Optionally, type `make tests' to run the Bash test suite. +

      + +

    4. +Type `make install' to install bash and bashbug. +This will also install the manual pages and Info file. +

      + +

    +

    + +The configure shell script attempts to guess correct +values for various system-dependent variables used during +compilation. It uses those values to create a `Makefile' in +each directory of the package (the top directory, the +`builtins', `doc', and `support' directories, +each directory under `lib', and several others). It also creates a +`config.h' file containing system-dependent definitions. +Finally, it creates a shell script named config.status that you +can run in the future to recreate the current configuration, a +file `config.cache' that saves the results of its tests to +speed up reconfiguring, and a file `config.log' containing +compiler output (useful mainly for debugging configure). +If at some point +`config.cache' contains results you don't want to keep, you +may remove or edit it. +

    + +To find out more about the options and arguments that the +configure script understands, type +

    + +
     
    bash-2.04$ ./configure --help
    +

    + +at the Bash prompt in your Bash source directory. +

    + +If you need to do unusual things to compile Bash, please +try to figure out how configure could check whether or not +to do them, and mail diffs or instructions to +bash-maintainers@gnu.org so they can be +considered for the next release. +

    + +The file `configure.ac' is used to create configure +by a program called Autoconf. You only need +`configure.ac' if you want to change it or regenerate +configure using a newer version of Autoconf. If +you do this, make sure you are using Autoconf version 2.50 or +newer. +

    + +You can remove the program binaries and object files from the +source code directory by typing `make clean'. To also remove the +files that configure created (so you can compile Bash for +a different kind of computer), type `make distclean'. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    10.2 Compilers and Options

    + +

    + +Some systems require unusual options for compilation or linking +that the configure script does not know about. You can +give configure initial values for variables by setting +them in the environment. Using a Bourne-compatible shell, you +can do that on the command line like this: +

    + +
     
    CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
    +

    + +On systems that have the env program, you can do it like this: +

    + +
     
    env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
    +

    + +The configuration process uses GCC to build Bash if it +is available. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    10.3 Compiling For Multiple Architectures

    + +

    + +You can compile Bash for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of make that +supports the VPATH variable, such as GNU make. +cd to the +directory where you want the object files and executables to go and run +the configure script from the source directory. You may need to +supply the `--srcdir=PATH' argument to tell configure where the +source files are. configure automatically checks for the +source code in the directory that configure is in and in `..'. +

    + +If you have to use a make that does not supports the VPATH +variable, you can compile Bash for one architecture at a +time in the source code directory. After you have installed +Bash for one architecture, use `make distclean' before +reconfiguring for another architecture. +

    + +Alternatively, if your system supports symbolic links, you can use the +`support/mkclone' script to create a build tree which has +symbolic links back to each file in the source directory. Here's an +example that creates a build directory in the current directory from a +source directory `/usr/gnu/src/bash-2.0': +

    + +
     
    bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 .
    +

    + +The mkclone script requires Bash, so you must have already built +Bash for at least one architecture before you can create build +directories for other architectures. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    10.4 Installation Names

    + +

    + +By default, `make install' will install into +`/usr/local/bin', `/usr/local/man', etc. You can +specify an installation prefix other than `/usr/local' by +giving configure the option `--prefix=PATH', +or by specifying a value for the DESTDIR `make' +variable when running `make install'. +

    + +You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. +If you give configure the option +`--exec-prefix=PATH', `make install' will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    10.5 Specifying the System Type

    + +

    + +There may be some features configure can not figure out +automatically, but need to determine by the type of host Bash +will run on. Usually configure can figure that +out, but if it prints a message saying it can not guess the host +type, give it the `--host=TYPE' option. `TYPE' can +either be a short name for the system type, such as `sun4', +or a canonical name with three fields: `CPU-COMPANY-SYSTEM' +(e.g., `i386-unknown-freebsd4.2'). +

    + +See the file `support/config.sub' for the possible +values of each field. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    10.6 Sharing Defaults

    + +

    + +If you want to set default values for configure scripts to +share, you can create a site shell script called +config.site that gives default values for variables like +CC, cache_file, and prefix. configure +looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +CONFIG_SITE environment variable to the location of the site +script. A warning: the Bash configure looks for a site script, +but not all configure scripts do. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    10.7 Operation Controls

    + +

    + +configure recognizes the following options to control how it +operates. +

    + +

    + +
    --cache-file=file +
    Use and save the results of the tests in +file instead of `./config.cache'. Set file to +`/dev/null' to disable caching, for debugging +configure. +

    + +

    --help +
    Print a summary of the options to configure, and exit. +

    + +

    --quiet +
    --silent +
    -q +
    Do not print messages saying which checks are being made. +

    + +

    --srcdir=dir +
    Look for the Bash source code in directory dir. Usually +configure can determine that directory automatically. +

    + +

    --version +
    Print the version of Autoconf used to generate the configure +script, and exit. +
    +

    + +configure also accepts some other, not widely used, boilerplate +options. `configure --help' prints the complete list. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    10.8 Optional Features

    + +

    + +The Bash configure has a number of `--enable-feature' +options, where feature indicates an optional part of Bash. +There are also several `--with-package' options, +where package is something like `bash-malloc' or `purify'. +To turn off the default use of a package, use +`--without-package'. To configure Bash without a feature +that is enabled by default, use `--disable-feature'. +

    + +Here is a complete list of the `--enable-' and +`--with-' options that the Bash configure recognizes. +

    + +

    +
    --with-afs +
    Define if you are using the Andrew File System from Transarc. +

    + +

    --with-bash-malloc +
    Use the Bash version of +malloc in the directory `lib/malloc'. This is not the same +malloc that appears in GNU libc, but an older version +originally derived from the 4.2 BSD malloc. This malloc +is very fast, but wastes some space on each allocation. +This option is enabled by default. +The `NOTES' file contains a list of systems for +which this should be turned off, and configure disables this +option automatically for a number of systems. +

    + +

    --with-curses +
    Use the curses library instead of the termcap library. This should +be supplied if your system has an inadequate or incomplete termcap +database. +

    + +

    --with-gnu-malloc +
    A synonym for --with-bash-malloc. +

    + +

    --with-installed-readline[=PREFIX] +
    Define this to make Bash link with a locally-installed version of Readline +rather than the version in `lib/readline'. This works only with +Readline 5.0 and later versions. If PREFIX is yes or not +supplied, configure uses the values of the make variables +includedir and libdir, which are subdirectories of prefix +by default, to find the installed version of Readline if it is not in +the standard system include and library directories. +If PREFIX is no, Bash links with the version in +`lib/readline'. +If PREFIX is set to any other value, configure treats it as +a directory pathname and looks for +the installed version of Readline in subdirectories of that directory +(include files in PREFIX/include and the library in +PREFIX/lib). +

    + +

    --with-purify +
    Define this to use the Purify memory allocation checker from Rational +Software. +

    + +

    --enable-minimal-config +
    This produces a shell with minimal features, close to the historical +Bourne shell. +
    +

    + +There are several `--enable-' options that alter how Bash is +compiled and linked, rather than changing run-time features. +

    + +

    +
    --enable-largefile +
    Enable support for large files if the operating system requires special compiler options +to build programs which can access large files. This is enabled by +default, if the operating system provides large file support. +

    + +

    --enable-profiling +
    This builds a Bash binary that produces profiling information to be +processed by gprof each time it is executed. +

    + +

    --enable-static-link +
    This causes Bash to be linked statically, if gcc is being used. +This could be used to build a version to use as root's shell. +
    +

    + +The `minimal-config' option can be used to disable all of +the following options, but it is processed first, so individual +options may be enabled using `enable-feature'. +

    + +All of the following options except for `disabled-builtins', +`directpand-default', and +`xpg-echo-default' are +enabled by default, unless the operating system does not provide the +necessary support. +

    + +

    +
    --enable-alias +
    Allow alias expansion and include the alias and unalias +builtins (see section 6.6 Aliases). +

    + +

    --enable-arith-for-command +
    Include support for the alternate form of the for command +that behaves like the C language for statement +(see section 3.2.4.1 Looping Constructs). +

    + +

    --enable-array-variables +
    Include support for one-dimensional array shell variables +(see section 6.7 Arrays). +

    + +

    --enable-bang-history +
    Include support for csh-like history substitution +(see section 9.3 History Expansion). +

    + +

    --enable-brace-expansion +
    Include csh-like brace expansion +( b{a,b}c ==> bac bbc ). +See 3.5.1 Brace Expansion, for a complete description. +

    + +

    --enable-casemod-attributes +
    Include support for case-modifying attributes in the declare builtin +and assignment statements. Variables with the uppercase attribute, +for example, will have their values converted to uppercase upon assignment. +

    + +

    --enable-casemod-expansion +
    Include support for case-modifying word expansions. +

    + +

    --enable-command-timing +
    Include support for recognizing time as a reserved word and for +displaying timing statistics for the pipeline following time +(see section 3.2.2 Pipelines). +This allows pipelines as well as shell builtins and functions to be timed. +

    + +

    --enable-cond-command +
    Include support for the [[ conditional command. +(see section 3.2.4.2 Conditional Constructs). +

    + +

    --enable-cond-regexp +
    Include support for matching POSIX regular expressions using the +`=~' binary operator in the [[ conditional command. +(see section 3.2.4.2 Conditional Constructs). +

    + +

    --enable-coprocesses +
    Include support for coprocesses and the coproc reserved word +(see section 3.2.2 Pipelines). +

    + +

    --enable-debugger +
    Include support for the bash debugger (distributed separately). +

    + +

    --enable-direxpand-default +
    Cause the direxpand shell option (see section 4.3.2 The Shopt Builtin) +to be enabled by default when the shell starts. +It is normally disabled by default. +

    + +

    --enable-directory-stack +
    Include support for a csh-like directory stack and the +pushd, popd, and dirs builtins +(see section 6.8 The Directory Stack). +

    + +

    --enable-disabled-builtins +
    Allow builtin commands to be invoked via `builtin xxx' +even after xxx has been disabled using `enable -n xxx'. +See 4.2 Bash Builtin Commands, for details of the builtin and +enable builtin commands. +

    + +

    --enable-dparen-arithmetic +
    Include support for the ((...)) command +(see section 3.2.4.2 Conditional Constructs). +

    + +

    --enable-extended-glob +
    Include support for the extended pattern matching features described +above under 3.5.8.1 Pattern Matching. +

    + +

    --enable-extended-glob-default +
    Set the default value of the extglob shell option described +above under 4.3.2 The Shopt Builtin to be enabled. +

    + +

    --enable-glob-asciirange-default +
    Set the default value of the globasciiranges shell option described +above under 4.3.2 The Shopt Builtin to be enabled. +This controls the behavior of character ranges when used in pattern matching +bracket expressions. +

    + +

    --enable-help-builtin +
    Include the help builtin, which displays help on shell builtins and +variables (see section 4.2 Bash Builtin Commands). +

    + +

    --enable-history +
    Include command history and the fc and history +builtin commands (see section 9.1 Bash History Facilities). +

    + +

    --enable-job-control +
    This enables the job control features (see section 7. Job Control), +if the operating system supports them. +

    + +

    --enable-multibyte +
    This enables support for multibyte characters if the operating +system provides the necessary support. +

    + +

    --enable-net-redirections +
    This enables the special handling of filenames of the form +/dev/tcp/host/port and +/dev/udp/host/port +when used in redirections (see section 3.6 Redirections). +

    + +

    --enable-process-substitution +
    This enables process substitution (see section 3.5.6 Process Substitution) if +the operating system provides the necessary support. +

    + +

    --enable-progcomp +
    Enable the programmable completion facilities +(see section 8.6 Programmable Completion). +If Readline is not enabled, this option has no effect. +

    + +

    --enable-prompt-string-decoding +
    Turn on the interpretation of a number of backslash-escaped characters +in the $PS1, $PS2, $PS3, and $PS4 prompt +strings. See 6.9 Controlling the Prompt, for a complete list of prompt +string escape sequences. +

    + +

    --enable-readline +
    Include support for command-line editing and history with the Bash +version of the Readline library (see section 8. Command Line Editing). +

    + +

    --enable-restricted +
    Include support for a restricted shell. If this is enabled, Bash, +when called as rbash, enters a restricted mode. See +6.10 The Restricted Shell, for a description of restricted mode. +

    + +

    --enable-select +
    Include the select compound command, which allows the generation of +simple menus (see section 3.2.4.2 Conditional Constructs). +

    + +

    --enable-separate-helpfiles +
    Use external files for the documentation displayed by the help builtin +instead of storing the text internally. +

    + +

    --enable-single-help-strings +
    Store the text displayed by the help builtin as a single string for +each help topic. This aids in translating the text to different languages. +You may need to disable this if your compiler cannot handle very long string +literals. +

    + +

    --enable-strict-posix-default +
    Make Bash POSIX-conformant by default (see section 6.11 Bash POSIX Mode). +

    + +

    --enable-usg-echo-default +
    A synonym for --enable-xpg-echo-default. +

    + +

    --enable-xpg-echo-default +
    Make the echo builtin expand backslash-escaped characters by default, +without requiring the `-e' option. +This sets the default value of the xpg_echo shell option to on, +which makes the Bash echo behave more like the version specified in +the Single Unix Specification, version 3. +See section 4.2 Bash Builtin Commands, for a description of the escape sequences that +echo recognizes. +
    +

    + +The file `config-top.h' contains C Preprocessor +`#define' statements for options which are not settable from +configure. +Some of these are not meant to be changed; beware of the consequences if +you do. +Read the comments associated with each definition for more +information about its effect. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    A. Reporting Bugs

    + +

    + +Please report all bugs you find in Bash. +But first, you should +make sure that it really is a bug, and that it appears in the latest +version of Bash. +The latest version of Bash is always available for FTP from +ftp://ftp.gnu.org/pub/gnu/bash/. +

    + +Once you have determined that a bug actually exists, use the +bashbug command to submit a bug report. +If you have a fix, you are encouraged to mail that as well! +Suggestions and `philosophical' bug reports may be mailed +to bug-bash@gnu.org or posted to the Usenet +newsgroup gnu.bash.bug. +

    + +All bug reports should include: +

      +
    • +The version number of Bash. +
    • +The hardware and operating system. +
    • +The compiler used to compile Bash. +
    • +A description of the bug behaviour. +
    • +A short script or `recipe' which exercises the bug and may be used +to reproduce it. +
    +

    + +bashbug inserts the first three items automatically into +the template it provides for filing a bug report. +

    + +Please send all reports concerning this manual to +bug-bash@gnu.org. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    B. Major Differences From The Bourne Shell

    + +

    + +Bash implements essentially the same grammar, parameter and +variable expansion, redirection, and quoting as the Bourne Shell. +Bash uses the POSIX standard as the specification of +how these features are to be implemented. There are some +differences between the traditional Bourne shell and Bash; this +section quickly details the differences of significance. A +number of these differences are explained in greater depth in +previous sections. +This section uses the version of sh included in SVR4.2 (the +last version of the historical Bourne shell) as the baseline reference. +

    + +

      + +
    • +Bash is POSIX-conformant, even where the POSIX specification +differs from traditional sh behavior (see section 6.11 Bash POSIX Mode). +

      + +

    • +Bash has multi-character invocation options (see section 6.1 Invoking Bash). +

      + +

    • +Bash has command-line editing (see section 8. Command Line Editing) and +the bind builtin. +

      + +

    • +Bash provides a programmable word completion mechanism +(see section 8.6 Programmable Completion), and builtin commands +complete, compgen, and compopt, to +manipulate it. +

      + +

    • +Bash has command history (see section 9.1 Bash History Facilities) and the +history and fc builtins to manipulate it. +The Bash history list maintains timestamp information and uses the +value of the HISTTIMEFORMAT variable to display it. +

      + +

    • +Bash implements csh-like history expansion +(see section 9.3 History Expansion). +

      + +

    • +Bash has one-dimensional array variables (see section 6.7 Arrays), and the +appropriate variable expansions and assignment syntax to use them. +Several of the Bash builtins take options to act on arrays. +Bash provides a number of built-in array variables. +

      + +

    • +The $'...' quoting syntax, which expands ANSI-C +backslash-escaped characters in the text between the single quotes, +is supported (see section 3.1.2.4 ANSI-C Quoting). +

      + +

    • +Bash supports the $"..." quoting syntax to do +locale-specific translation of the characters between the double +quotes. The `-D', `--dump-strings', and `--dump-po-strings' +invocation options list the translatable strings found in a script +(see section 3.1.2.5 Locale-Specific Translation). +

      + +

    • +Bash implements the ! keyword to negate the return value of +a pipeline (see section 3.2.2 Pipelines). +Very useful when an if statement needs to act only if a test fails. +The Bash `-o pipefail' option to set will cause a pipeline to +return a failure status if any command fails. +

      + +

    • +Bash has the time reserved word and command timing (see section 3.2.2 Pipelines). +The display of the timing statistics may be controlled with the +TIMEFORMAT variable. +

      + +

    • +Bash implements the for (( expr1 ; expr2 ; expr3 )) +arithmetic for command, similar to the C language (see section 3.2.4.1 Looping Constructs). +

      + +

    • +Bash includes the select compound command, which allows the +generation of simple menus (see section 3.2.4.2 Conditional Constructs). +

      + +

    • +Bash includes the [[ compound command, which makes conditional +testing part of the shell grammar (see section 3.2.4.2 Conditional Constructs), including +optional regular expression matching. +

      + +

    • +Bash provides optional case-insensitive matching for the case and +[[ constructs. +

      + +

    • +Bash includes brace expansion (see section 3.5.1 Brace Expansion) and tilde +expansion (see section 3.5.2 Tilde Expansion). +

      + +

    • +Bash implements command aliases and the alias and unalias +builtins (see section 6.6 Aliases). +

      + +

    • +Bash provides shell arithmetic, the (( compound command +(see section 3.2.4.2 Conditional Constructs), +and arithmetic expansion (see section 6.5 Shell Arithmetic). +

      + +

    • +Variables present in the shell's initial environment are automatically +exported to child processes. The Bourne shell does not normally do +this unless the variables are explicitly marked using the export +command. +

      + +

    • +Bash supports the `+=' assignment operator, which appends to the value +of the variable named on the left hand side. +

      + +

    • +Bash includes the POSIX pattern removal `%', `#', `%%' +and `##' expansions to remove leading or trailing substrings from +variable values (see section 3.5.3 Shell Parameter Expansion). +

      + +

    • +The expansion ${#xx}, which returns the length of ${xx}, +is supported (see section 3.5.3 Shell Parameter Expansion). +

      + +

    • +The expansion ${var:offset[:length]}, +which expands to the substring of var's value of length +length, beginning at offset, is present +(see section 3.5.3 Shell Parameter Expansion). +

      + +

    • +The expansion +${var/[/]pattern[/replacement]}, +which matches pattern and replaces it with replacement in +the value of var, is available (see section 3.5.3 Shell Parameter Expansion). +

      + +

    • +The expansion ${!prefix*} expansion, which expands to +the names of all shell variables whose names begin with prefix, +is available (see section 3.5.3 Shell Parameter Expansion). +

      + +

    • +Bash has indirect variable expansion using ${!word} +(see section 3.5.3 Shell Parameter Expansion). +

      + +

    • +Bash can expand positional parameters beyond $9 using +${num}. +

      + +

    • +The POSIX $() form of command substitution +is implemented (see section 3.5.4 Command Substitution), +and preferred to the Bourne shell's " (which +is also implemented for backwards compatibility). +

      + +

    • +Bash has process substitution (see section 3.5.6 Process Substitution). +

      + +

    • +Bash automatically assigns variables that provide information about the +current user (UID, EUID, and GROUPS), the current host +(HOSTTYPE, OSTYPE, MACHTYPE, and HOSTNAME), +and the instance of Bash that is running (BASH, +BASH_VERSION, and BASH_VERSINFO). See section 5.2 Bash Variables, +for details. +

      + +

    • +The IFS variable is used to split only the results of expansion, +not all words (see section 3.5.7 Word Splitting). +This closes a longstanding shell security hole. +

      + +

    • +The filename expansion bracket expression code uses `!' and `^' +to negate the set of characters between the brackets. +The Bourne shell uses only `!'. +

      + +

    • +Bash implements the full set of POSIX filename expansion operators, +including character classes, equivalence classes, and +collating symbols (see section 3.5.8 Filename Expansion). +

      + +

    • +Bash implements extended pattern matching features when the extglob +shell option is enabled (see section 3.5.8.1 Pattern Matching). +

      + +

    • +It is possible to have a variable and a function with the same name; +sh does not separate the two name spaces. +

      + +

    • +Bash functions are permitted to have local variables using the +local builtin, and thus useful recursive functions may be written +(see section 4.2 Bash Builtin Commands). +

      + +

    • +Variable assignments preceding commands affect only that command, even +builtins and functions (see section 3.7.4 Environment). +In sh, all variable assignments +preceding commands are global unless the command is executed from the +file system. +

      + +

    • +Bash performs filename expansion on filenames specified as operands +to input and output redirection operators (see section 3.6 Redirections). +

      + +

    • +Bash contains the `<>' redirection operator, allowing a file to be +opened for both reading and writing, and the `&>' redirection +operator, for directing standard output and standard error to the same +file (see section 3.6 Redirections). +

      + +

    • +Bash includes the `<<<' redirection operator, allowing a string to +be used as the standard input to a command. +

      + +

    • +Bash implements the `[n]<&word' and `[n]>&word' +redirection operators, which move one file descriptor to another. +

      + +

    • +Bash treats a number of filenames specially when they are +used in redirection operators (see section 3.6 Redirections). +

      + +

    • +Bash can open network connections to arbitrary machines and services +with the redirection operators (see section 3.6 Redirections). +

      + +

    • +The noclobber option is available to avoid overwriting existing +files with output redirection (see section 4.3.1 The Set Builtin). +The `>|' redirection operator may be used to override noclobber. +

      + +

    • +The Bash cd and pwd builtins (see section 4.1 Bourne Shell Builtins) +each take `-L' and `-P' options to switch between logical and +physical modes. +

      + +

    • +Bash allows a function to override a builtin with the same name, and provides +access to that builtin's functionality within the function via the +builtin and command builtins (see section 4.2 Bash Builtin Commands). +

      + +

    • +The command builtin allows selective disabling of functions +when command lookup is performed (see section 4.2 Bash Builtin Commands). +

      + +

    • +Individual builtins may be enabled or disabled using the enable +builtin (see section 4.2 Bash Builtin Commands). +

      + +

    • +The Bash exec builtin takes additional options that allow users +to control the contents of the environment passed to the executed +command, and what the zeroth argument to the command is to be +(see section 4.1 Bourne Shell Builtins). +

      + +

    • +Shell functions may be exported to children via the environment +using export -f (see section 3.3 Shell Functions). +

      + +

    • +The Bash export, readonly, and declare builtins can +take a `-f' option to act on shell functions, a `-p' option to +display variables with various attributes set in a format that can be +used as shell input, a `-n' option to remove various variable +attributes, and `name=value' arguments to set variable attributes +and values simultaneously. +

      + +

    • +The Bash hash builtin allows a name to be associated with +an arbitrary filename, even when that filename cannot be found by +searching the $PATH, using `hash -p' +(see section 4.1 Bourne Shell Builtins). +

      + +

    • +Bash includes a help builtin for quick reference to shell +facilities (see section 4.2 Bash Builtin Commands). +

      + +

    • +The printf builtin is available to display formatted output +(see section 4.2 Bash Builtin Commands). +

      + +

    • +The Bash read builtin (see section 4.2 Bash Builtin Commands) +will read a line ending in `\' with +the `-r' option, and will use the REPLY variable as a +default if no non-option arguments are supplied. +The Bash read builtin +also accepts a prompt string with the `-p' option and will use +Readline to obtain the line when given the `-e' option. +The read builtin also has additional options to control input: +the `-s' option will turn off echoing of input characters as +they are read, the `-t' option will allow read to time out +if input does not arrive within a specified number of seconds, the +`-n' option will allow reading only a specified number of +characters rather than a full line, and the `-d' option will read +until a particular character rather than newline. +

      + +

    • +The return builtin may be used to abort execution of scripts +executed with the . or source builtins +(see section 4.1 Bourne Shell Builtins). +

      + +

    • +Bash includes the shopt builtin, for finer control of shell +optional capabilities (see section 4.3.2 The Shopt Builtin), and allows these options +to be set and unset at shell invocation (see section 6.1 Invoking Bash). +

      + +

    • +Bash has much more optional behavior controllable with the set +builtin (see section 4.3.1 The Set Builtin). +

      + +

    • +The `-x' (`xtrace') option displays commands other than +simple commands when performing an execution trace +(see section 4.3.1 The Set Builtin). +

      + +

    • +The test builtin (see section 4.1 Bourne Shell Builtins) +is slightly different, as it implements the POSIX algorithm, +which specifies the behavior based on the number of arguments. +

      + +

    • +Bash includes the caller builtin, which displays the context of +any active subroutine call (a shell function or a script executed with +the . or source builtins). This supports the bash +debugger. +

      + +

    • +The trap builtin (see section 4.1 Bourne Shell Builtins) allows a +DEBUG pseudo-signal specification, similar to EXIT. +Commands specified with a DEBUG trap are executed before every +simple command, for command, case command, +select command, every arithmetic for command, and before +the first command executes in a shell function. +The DEBUG trap is not inherited by shell functions unless the +function has been given the trace attribute or the +functrace option has been enabled using the shopt builtin. +The extdebug shell option has additional effects on the +DEBUG trap. +

      + +The trap builtin (see section 4.1 Bourne Shell Builtins) allows an +ERR pseudo-signal specification, similar to EXIT and DEBUG. +Commands specified with an ERR trap are executed after a simple +command fails, with a few exceptions. +The ERR trap is not inherited by shell functions unless the +-o errtrace option to the set builtin is enabled. +

      + +The trap builtin (see section 4.1 Bourne Shell Builtins) allows a +RETURN pseudo-signal specification, similar to +EXIT and DEBUG. +Commands specified with an RETURN trap are executed before +execution resumes after a shell function or a shell script executed with +. or source returns. +The RETURN trap is not inherited by shell functions unless the +function has been given the trace attribute or the +functrace option has been enabled using the shopt builtin. +

      + +

    • +The Bash type builtin is more extensive and gives more information +about the names it finds (see section 4.2 Bash Builtin Commands). +

      + +

    • +The Bash umask builtin permits a `-p' option to cause +the output to be displayed in the form of a umask command +that may be reused as input (see section 4.1 Bourne Shell Builtins). +

      + +

    • +Bash implements a csh-like directory stack, and provides the +pushd, popd, and dirs builtins to manipulate it +(see section 6.8 The Directory Stack). +Bash also makes the directory stack visible as the value of the +DIRSTACK shell variable. +

      + +

    • +Bash interprets special backslash-escaped characters in the prompt +strings when interactive (see section 6.9 Controlling the Prompt). +

      + +

    • +The Bash restricted mode is more useful (see section 6.10 The Restricted Shell); +the SVR4.2 shell restricted mode is too limited. +

      + +

    • +The disown builtin can remove a job from the internal shell +job table (see section 7.2 Job Control Builtins) or suppress the sending +of SIGHUP to a job when the shell exits as the result of a +SIGHUP. +

      + +

    • +Bash includes a number of features to support a separate debugger for +shell scripts. +

      + +

    • +The SVR4.2 shell has two privilege-related builtins +(mldmode and priv) not present in Bash. +

      + +

    • +Bash does not have the stop or newgrp builtins. +

      + +

    • +Bash does not use the SHACCT variable or perform shell accounting. +

      + +

    • +The SVR4.2 sh uses a TIMEOUT variable like Bash uses +TMOUT. +

      + +

    +

    + +More features unique to Bash may be found in 6. Bash Features. +

    + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    B.1 Implementation Differences From The SVR4.2 Shell

    + +

    + +Since Bash is a completely new implementation, it does not suffer from +many of the limitations of the SVR4.2 shell. For instance: +

    + +

      + +
    • +Bash does not fork a subshell when redirecting into or out of +a shell control structure such as an if or while +statement. +

      + +

    • +Bash does not allow unbalanced quotes. The SVR4.2 shell will silently +insert a needed closing quote at EOF under certain circumstances. +This can be the cause of some hard-to-find errors. +

      + +

    • +The SVR4.2 shell uses a baroque memory management scheme based on +trapping SIGSEGV. If the shell is started from a process with +SIGSEGV blocked (e.g., by using the system() C library +function call), it misbehaves badly. +

      + +

    • +In a questionable attempt at security, the SVR4.2 shell, +when invoked without the `-p' option, will alter its real +and effective UID and GID if they are less than some +magic threshold value, commonly 100. +This can lead to unexpected results. +

      + +

    • +The SVR4.2 shell does not allow users to trap SIGSEGV, +SIGALRM, or SIGCHLD. +

      + +

    • +The SVR4.2 shell does not allow the IFS, MAILCHECK, +PATH, PS1, or PS2 variables to be unset. +

      + +

    • +The SVR4.2 shell treats `^' as the undocumented equivalent of +`|'. +

      + +

    • +Bash allows multiple option arguments when it is invoked (-x -v); +the SVR4.2 shell allows only one option argument (-xv). In +fact, some versions of the shell dump core if the second argument begins +with a `-'. +

      + +

    • +The SVR4.2 shell exits a script if any builtin fails; Bash exits +a script only if one of the POSIX special builtins fails, and +only for certain failures, as enumerated in the POSIX standard. +

      + +

    • +The SVR4.2 shell behaves differently when invoked as jsh +(it turns on job control). +
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    C. GNU Free Documentation License

    + +

    + +

    + Version 1.3, 3 November 2008 +
    +

    + +
     
    Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
    +http://fsf.org/
    +
    +Everyone is permitted to copy and distribute verbatim copies
    +of this license document, but changing it is not allowed.
    +

    + +

      +
    1. +PREAMBLE +

      + +The purpose of this License is to make a manual, textbook, or other +functional and useful document free in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. +

      + +This License is a kind of "copyleft", which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. +

      + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. +

      + +

    2. +APPLICABILITY AND DEFINITIONS +

      + +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The "Document", below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as "you". You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. +

      + +A "Modified Version" of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. +

      + +A "Secondary Section" is a named appendix or a front-matter section +of the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. +

      + +The "Invariant Sections" are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. +

      + +The "Cover Texts" are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. +

      + +A "Transparent" copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not "Transparent" is called "Opaque". +

      + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input +format, SGML or XML using a publicly available +DTD, and standard-conforming simple HTML, +PostScript or PDF designed for human modification. Examples +of transparent image formats include PNG, XCF and +JPG. Opaque formats include proprietary formats that can be +read and edited only by proprietary word processors, SGML or +XML for which the DTD and/or processing tools are +not generally available, and the machine-generated HTML, +PostScript or PDF produced by some word processors for +output purposes only. +

      + +The "Title Page" means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, "Title Page" means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. +

      + +The "publisher" means any person or entity that distributes copies +of the Document to the public. +

      + +A section "Entitled XYZ" means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as "Acknowledgements", +"Dedications", "Endorsements", or "History".) To "Preserve the Title" +of such a section when you modify the Document means that it remains a +section "Entitled XYZ" according to this definition. +

      + +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. +

      + +

    3. +VERBATIM COPYING +

      + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. +

      + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. +

      + +

    4. +COPYING IN QUANTITY +

      + +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. +

      + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. +

      + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. +

      + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. +

      + +

    5. +MODIFICATIONS +

      + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: +

      + +

        +
      1. +Use in the Title Page (and on the covers, if any) a title distinct +from that of the Document, and from those of previous versions +(which should, if there were any, be listed in the History section +of the Document). You may use the same title as a previous version +if the original publisher of that version gives permission. +

        + +

      2. +List on the Title Page, as authors, one or more persons or entities +responsible for authorship of the modifications in the Modified +Version, together with at least five of the principal authors of the +Document (all of its principal authors, if it has fewer than five), +unless they release you from this requirement. +

        + +

      3. +State on the Title page the name of the publisher of the +Modified Version, as the publisher. +

        + +

      4. +Preserve all the copyright notices of the Document. +

        + +

      5. +Add an appropriate copyright notice for your modifications +adjacent to the other copyright notices. +

        + +

      6. +Include, immediately after the copyright notices, a license notice +giving the public permission to use the Modified Version under the +terms of this License, in the form shown in the Addendum below. +

        + +

      7. +Preserve in that license notice the full lists of Invariant Sections +and required Cover Texts given in the Document's license notice. +

        + +

      8. +Include an unaltered copy of this License. +

        + +

      9. +Preserve the section Entitled "History", Preserve its Title, and add +to it an item stating at least the title, year, new authors, and +publisher of the Modified Version as given on the Title Page. If +there is no section Entitled "History" in the Document, create one +stating the title, year, authors, and publisher of the Document as +given on its Title Page, then add an item describing the Modified +Version as stated in the previous sentence. +

        + +

      10. +Preserve the network location, if any, given in the Document for +public access to a Transparent copy of the Document, and likewise +the network locations given in the Document for previous versions +it was based on. These may be placed in the "History" section. +You may omit a network location for a work that was published at +least four years before the Document itself, or if the original +publisher of the version it refers to gives permission. +

        + +

      11. +For any section Entitled "Acknowledgements" or "Dedications", Preserve +the Title of the section, and preserve in the section all the +substance and tone of each of the contributor acknowledgements and/or +dedications given therein. +

        + +

      12. +Preserve all the Invariant Sections of the Document, +unaltered in their text and in their titles. Section numbers +or the equivalent are not considered part of the section titles. +

        + +

      13. +Delete any section Entitled "Endorsements". Such a section +may not be included in the Modified Version. +

        + +

      14. +Do not retitle any existing section to be Entitled "Endorsements" or +to conflict in title with any Invariant Section. +

        + +

      15. +Preserve any Warranty Disclaimers. +
      +

      + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. +

      + +You may add a section Entitled "Endorsements", provided it contains +nothing but endorsements of your Modified Version by various +parties--for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. +

      + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. +

      + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. +

      + +

    6. +COMBINING DOCUMENTS +

      + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. +

      + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. +

      + +In the combination, you must combine any sections Entitled "History" +in the various original documents, forming one section Entitled +"History"; likewise combine any sections Entitled "Acknowledgements", +and any sections Entitled "Dedications". You must delete all +sections Entitled "Endorsements." +

      + +

    7. +COLLECTIONS OF DOCUMENTS +

      + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. +

      + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. +

      + +

    8. +AGGREGATION WITH INDEPENDENT WORKS +

      + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an "aggregate" if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. +

      + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. +

      + +

    9. +TRANSLATION +

      + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. +

      + +If a section in the Document is Entitled "Acknowledgements", +"Dedications", or "History", the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. +

      + +

    10. +TERMINATION +

      + +You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. +

      + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. +

      + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. +

      + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. +

      + +

    11. +FUTURE REVISIONS OF THIS LICENSE +

      + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +http://www.gnu.org/copyleft/. +

      + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy's public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. +

      + +

    12. +RELICENSING +

      + +"Massive Multiauthor Collaboration Site" (or "MMC Site") means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +"Massive Multiauthor Collaboration" (or "MMC") contained in the +site means any set of copyrightable works thus published on the MMC +site. +

      + +"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. +

      + +"Incorporate" means to publish or republish a Document, in whole or +in part, as part of another Document. +

      + +An MMC is "eligible for relicensing" if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole +or in part into the MMC, (1) had no cover texts or invariant sections, +and (2) were thus incorporated prior to November 1, 2008. +

      + +The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. +

      + +

    +

    + + +

    ADDENDUM: How to use this License for your documents

    + +

    + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: +

    + +
     
      Copyright (C)  year  your name.
    +  Permission is granted to copy, distribute and/or modify this document
    +  under the terms of the GNU Free Documentation License, Version 1.3
    +  or any later version published by the Free Software Foundation;
    +  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
    +  Texts.  A copy of the license is included in the section entitled ``GNU
    +  Free Documentation License''.
    +

    + +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the "with...Texts." line with this: +

    + +
     
        with the Invariant Sections being list their titles, with
    +    the Front-Cover Texts being list, and with the Back-Cover Texts
    +    being list.
    +

    + +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. +

    + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    D. Indexes

    + +

    + +

    + + + + + +
    D.1 Index of Shell Builtin Commands  Index of Bash builtin commands.
    D.2 Index of Shell Reserved Words  Index of Bash reserved words.
    D.3 Parameter and Variable Index  Quick reference helps you find the + variable you want.
    D.4 Function Index  Index of bindable Readline functions.
    D.5 Concept Index  General index for concepts described in + this manual.
    +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    D.1 Index of Shell Builtin Commands

    + +
    Jump to:   . +   +: +   +[ +   +
    +A +   +B +   +C +   +D +   +E +   +F +   +G +   +H +   +J +   +K +   +L +   +M +   +P +   +R +   +S +   +T +   +U +   +W +   +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Index Entry Section

    .
    .4.1 Bourne Shell Builtins

    :
    :4.1 Bourne Shell Builtins

    [
    [4.1 Bourne Shell Builtins

    A
    alias4.2 Bash Builtin Commands

    B
    bg7.2 Job Control Builtins
    bind4.2 Bash Builtin Commands
    break4.1 Bourne Shell Builtins
    builtin4.2 Bash Builtin Commands

    C
    caller4.2 Bash Builtin Commands
    cd4.1 Bourne Shell Builtins
    command4.2 Bash Builtin Commands
    compgen8.7 Programmable Completion Builtins
    complete8.7 Programmable Completion Builtins
    compopt8.7 Programmable Completion Builtins
    continue4.1 Bourne Shell Builtins

    D
    declare4.2 Bash Builtin Commands
    dirs6.8.1 Directory Stack Builtins
    disown7.2 Job Control Builtins

    E
    echo4.2 Bash Builtin Commands
    enable4.2 Bash Builtin Commands
    eval4.1 Bourne Shell Builtins
    exec4.1 Bourne Shell Builtins
    exit4.1 Bourne Shell Builtins
    export4.1 Bourne Shell Builtins

    F
    fc9.2 Bash History Builtins
    fg7.2 Job Control Builtins

    G
    getopts4.1 Bourne Shell Builtins

    H
    hash4.1 Bourne Shell Builtins
    help4.2 Bash Builtin Commands
    history9.2 Bash History Builtins

    J
    jobs7.2 Job Control Builtins

    K
    kill7.2 Job Control Builtins

    L
    let4.2 Bash Builtin Commands
    local4.2 Bash Builtin Commands
    logout4.2 Bash Builtin Commands

    M
    mapfile4.2 Bash Builtin Commands

    P
    popd6.8.1 Directory Stack Builtins
    printf4.2 Bash Builtin Commands
    pushd6.8.1 Directory Stack Builtins
    pwd4.1 Bourne Shell Builtins

    R
    read4.2 Bash Builtin Commands
    readarray4.2 Bash Builtin Commands
    readonly4.1 Bourne Shell Builtins
    return4.1 Bourne Shell Builtins

    S
    set4.3.1 The Set Builtin
    shift4.1 Bourne Shell Builtins
    shopt4.3.2 The Shopt Builtin
    source4.2 Bash Builtin Commands
    suspend7.2 Job Control Builtins

    T
    test4.1 Bourne Shell Builtins
    times4.1 Bourne Shell Builtins
    trap4.1 Bourne Shell Builtins
    type4.2 Bash Builtin Commands
    typeset4.2 Bash Builtin Commands

    U
    ulimit4.2 Bash Builtin Commands
    umask4.1 Bourne Shell Builtins
    unalias4.2 Bash Builtin Commands
    unset4.1 Bourne Shell Builtins

    W
    wait7.2 Job Control Builtins

    Jump to:   . +   +: +   +[ +   +
    +A +   +B +   +C +   +D +   +E +   +F +   +G +   +H +   +J +   +K +   +L +   +M +   +P +   +R +   +S +   +T +   +U +   +W +   +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    D.2 Index of Shell Reserved Words

    + +
    Jump to:   ! +   +[ +   +] +   +{ +   +} +   +
    +C +   +D +   +E +   +F +   +I +   +S +   +T +   +U +   +W +   +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Index Entry Section

    !
    !3.2.2 Pipelines

    [
    [[3.2.4.2 Conditional Constructs

    ]
    ]]3.2.4.2 Conditional Constructs

    {
    {3.2.4.3 Grouping Commands

    }
    }3.2.4.3 Grouping Commands

    C
    case3.2.4.2 Conditional Constructs

    D
    do3.2.4.1 Looping Constructs
    done3.2.4.1 Looping Constructs

    E
    elif3.2.4.2 Conditional Constructs
    else3.2.4.2 Conditional Constructs
    esac3.2.4.2 Conditional Constructs

    F
    fi3.2.4.2 Conditional Constructs
    for3.2.4.1 Looping Constructs
    function3.3 Shell Functions

    I
    if3.2.4.2 Conditional Constructs
    in3.2.4.2 Conditional Constructs

    S
    select3.2.4.2 Conditional Constructs

    T
    then3.2.4.2 Conditional Constructs
    time3.2.2 Pipelines

    U
    until3.2.4.1 Looping Constructs

    W
    while3.2.4.1 Looping Constructs

    Jump to:   ! +   +[ +   +] +   +{ +   +} +   +
    +C +   +D +   +E +   +F +   +I +   +S +   +T +   +U +   +W +   +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    D.3 Parameter and Variable Index

    + +
    Jump to:   ! +   +# +   +$ +   +* +   +- +   +0 +   +? +   +@ +   +_ +   +
    +A +   +B +   +C +   +D +   +E +   +F +   +G +   +H +   +I +   +K +   +L +   +M +   +O +   +P +   +R +   +S +   +T +   +U +   +V +   +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Index Entry Section

    !
    !3.4.2 Special Parameters
    !3.4.2 Special Parameters

    #
    #3.4.2 Special Parameters
    #3.4.2 Special Parameters

    $
    $3.4.2 Special Parameters
    $3.4.2 Special Parameters
    $!3.4.2 Special Parameters
    $#3.4.2 Special Parameters
    $$3.4.2 Special Parameters
    $*3.4.2 Special Parameters
    $-3.4.2 Special Parameters
    $03.4.2 Special Parameters
    $?3.4.2 Special Parameters
    $@3.4.2 Special Parameters
    $_3.4.2 Special Parameters

    *
    *3.4.2 Special Parameters
    *3.4.2 Special Parameters

    -
    -3.4.2 Special Parameters
    -3.4.2 Special Parameters

    0
    03.4.2 Special Parameters
    03.4.2 Special Parameters

    ?
    ?3.4.2 Special Parameters
    ?3.4.2 Special Parameters

    @
    @3.4.2 Special Parameters
    @3.4.2 Special Parameters

    _
    _3.4.2 Special Parameters
    _3.4.2 Special Parameters

    A
    auto_resume7.3 Job Control Variables
    auto_resume7.3 Job Control Variables

    B
    BASH5.2 Bash Variables
    BASH5.2 Bash Variables
    BASH_ALIASES5.2 Bash Variables
    BASH_ALIASES5.2 Bash Variables
    BASH_ARGC5.2 Bash Variables
    BASH_ARGC5.2 Bash Variables
    BASH_ARGV5.2 Bash Variables
    BASH_ARGV5.2 Bash Variables
    BASH_CMDS5.2 Bash Variables
    BASH_CMDS5.2 Bash Variables
    BASH_COMMAND5.2 Bash Variables
    BASH_COMMAND5.2 Bash Variables
    BASH_COMPAT5.2 Bash Variables
    BASH_COMPAT5.2 Bash Variables
    BASH_ENV5.2 Bash Variables
    BASH_ENV5.2 Bash Variables
    BASH_EXECUTION_STRING5.2 Bash Variables
    BASH_EXECUTION_STRING5.2 Bash Variables
    BASH_LINENO5.2 Bash Variables
    BASH_LINENO5.2 Bash Variables
    BASH_REMATCH5.2 Bash Variables
    BASH_REMATCH5.2 Bash Variables
    BASH_SOURCE5.2 Bash Variables
    BASH_SOURCE5.2 Bash Variables
    BASH_SUBSHELL5.2 Bash Variables
    BASH_SUBSHELL5.2 Bash Variables
    BASH_VERSINFO5.2 Bash Variables
    BASH_VERSINFO5.2 Bash Variables
    BASH_VERSION5.2 Bash Variables
    BASH_VERSION5.2 Bash Variables
    BASH_XTRACEFD5.2 Bash Variables
    BASH_XTRACEFD5.2 Bash Variables
    BASHOPTS5.2 Bash Variables
    BASHOPTS5.2 Bash Variables
    BASHPID5.2 Bash Variables
    BASHPID5.2 Bash Variables
    bell-style8.3.1 Readline Init File Syntax
    bind-tty-special-chars8.3.1 Readline Init File Syntax

    C
    CDPATH5.1 Bourne Shell Variables
    CDPATH5.1 Bourne Shell Variables
    CHILD_MAX5.2 Bash Variables
    CHILD_MAX5.2 Bash Variables
    colored-stats8.3.1 Readline Init File Syntax
    COLUMNS5.2 Bash Variables
    COLUMNS5.2 Bash Variables
    comment-begin8.3.1 Readline Init File Syntax
    COMP_CWORD5.2 Bash Variables
    COMP_CWORD5.2 Bash Variables
    COMP_KEY5.2 Bash Variables
    COMP_KEY5.2 Bash Variables
    COMP_LINE5.2 Bash Variables
    COMP_LINE5.2 Bash Variables
    COMP_POINT5.2 Bash Variables
    COMP_POINT5.2 Bash Variables
    COMP_TYPE5.2 Bash Variables
    COMP_TYPE5.2 Bash Variables
    COMP_WORDBREAKS5.2 Bash Variables
    COMP_WORDBREAKS5.2 Bash Variables
    COMP_WORDS5.2 Bash Variables
    COMP_WORDS5.2 Bash Variables
    completion-display-width8.3.1 Readline Init File Syntax
    completion-ignore-case8.3.1 Readline Init File Syntax
    completion-map-case8.3.1 Readline Init File Syntax
    completion-prefix-display-length8.3.1 Readline Init File Syntax
    completion-query-items8.3.1 Readline Init File Syntax
    COMPREPLY5.2 Bash Variables
    COMPREPLY5.2 Bash Variables
    convert-meta8.3.1 Readline Init File Syntax
    COPROC5.2 Bash Variables
    COPROC5.2 Bash Variables

    D
    DIRSTACK5.2 Bash Variables
    DIRSTACK5.2 Bash Variables
    disable-completion8.3.1 Readline Init File Syntax

    E
    editing-mode8.3.1 Readline Init File Syntax
    EMACS5.2 Bash Variables
    EMACS5.2 Bash Variables
    enable-keypad8.3.1 Readline Init File Syntax
    ENV5.2 Bash Variables
    ENV5.2 Bash Variables
    EUID5.2 Bash Variables
    EUID5.2 Bash Variables
    expand-tilde8.3.1 Readline Init File Syntax

    F
    FCEDIT5.2 Bash Variables
    FCEDIT5.2 Bash Variables
    FIGNORE5.2 Bash Variables
    FIGNORE5.2 Bash Variables
    FUNCNAME5.2 Bash Variables
    FUNCNAME5.2 Bash Variables
    FUNCNEST5.2 Bash Variables
    FUNCNEST5.2 Bash Variables

    G
    GLOBIGNORE5.2 Bash Variables
    GLOBIGNORE5.2 Bash Variables
    GROUPS5.2 Bash Variables
    GROUPS5.2 Bash Variables

    H
    histchars5.2 Bash Variables
    histchars5.2 Bash Variables
    HISTCMD5.2 Bash Variables
    HISTCMD5.2 Bash Variables
    HISTCONTROL5.2 Bash Variables
    HISTCONTROL5.2 Bash Variables
    HISTFILE5.2 Bash Variables
    HISTFILE5.2 Bash Variables
    HISTFILESIZE5.2 Bash Variables
    HISTFILESIZE5.2 Bash Variables
    HISTIGNORE5.2 Bash Variables
    HISTIGNORE5.2 Bash Variables
    history-preserve-point8.3.1 Readline Init File Syntax
    history-size8.3.1 Readline Init File Syntax
    HISTSIZE5.2 Bash Variables
    HISTSIZE5.2 Bash Variables
    HISTTIMEFORMAT5.2 Bash Variables
    HISTTIMEFORMAT5.2 Bash Variables
    HOME5.1 Bourne Shell Variables
    HOME5.1 Bourne Shell Variables
    horizontal-scroll-mode8.3.1 Readline Init File Syntax
    HOSTFILE5.2 Bash Variables
    HOSTFILE5.2 Bash Variables
    HOSTNAME5.2 Bash Variables
    HOSTNAME5.2 Bash Variables
    HOSTTYPE5.2 Bash Variables
    HOSTTYPE5.2 Bash Variables

    I
    IFS5.1 Bourne Shell Variables
    IFS5.1 Bourne Shell Variables
    IGNOREEOF5.2 Bash Variables
    IGNOREEOF5.2 Bash Variables
    input-meta8.3.1 Readline Init File Syntax
    INPUTRC5.2 Bash Variables
    INPUTRC5.2 Bash Variables
    isearch-terminators8.3.1 Readline Init File Syntax

    K
    keymap8.3.1 Readline Init File Syntax

    L
    LANG5.2 Bash Variables
    LANG5.2 Bash Variables
    LC_ALL5.2 Bash Variables
    LC_ALL5.2 Bash Variables
    LC_COLLATE5.2 Bash Variables
    LC_COLLATE5.2 Bash Variables
    LC_CTYPE5.2 Bash Variables
    LC_CTYPE5.2 Bash Variables
    LC_MESSAGES3.1.2.5 Locale-Specific Translation
    LC_MESSAGES5.2 Bash Variables
    LC_MESSAGES5.2 Bash Variables
    LC_NUMERIC5.2 Bash Variables
    LC_NUMERIC5.2 Bash Variables
    LINENO5.2 Bash Variables
    LINENO5.2 Bash Variables
    LINES5.2 Bash Variables
    LINES5.2 Bash Variables

    M
    MACHTYPE5.2 Bash Variables
    MACHTYPE5.2 Bash Variables
    MAIL5.1 Bourne Shell Variables
    MAIL5.1 Bourne Shell Variables
    MAILCHECK5.2 Bash Variables
    MAILCHECK5.2 Bash Variables
    MAILPATH5.1 Bourne Shell Variables
    MAILPATH5.1 Bourne Shell Variables
    MAPFILE5.2 Bash Variables
    MAPFILE5.2 Bash Variables
    mark-modified-lines8.3.1 Readline Init File Syntax
    mark-symlinked-directories8.3.1 Readline Init File Syntax
    match-hidden-files8.3.1 Readline Init File Syntax
    menu-complete-display-prefix8.3.1 Readline Init File Syntax
    meta-flag8.3.1 Readline Init File Syntax

    O
    OLDPWD5.2 Bash Variables
    OLDPWD5.2 Bash Variables
    OPTARG5.1 Bourne Shell Variables
    OPTARG5.1 Bourne Shell Variables
    OPTERR5.2 Bash Variables
    OPTERR5.2 Bash Variables
    OPTIND5.1 Bourne Shell Variables
    OPTIND5.1 Bourne Shell Variables
    OSTYPE5.2 Bash Variables
    OSTYPE5.2 Bash Variables
    output-meta8.3.1 Readline Init File Syntax

    P
    page-completions8.3.1 Readline Init File Syntax
    PATH5.1 Bourne Shell Variables
    PATH5.1 Bourne Shell Variables
    PIPESTATUS5.2 Bash Variables
    PIPESTATUS5.2 Bash Variables
    POSIXLY_CORRECT5.2 Bash Variables
    POSIXLY_CORRECT5.2 Bash Variables
    PPID5.2 Bash Variables
    PPID5.2 Bash Variables
    PROMPT_COMMAND5.2 Bash Variables
    PROMPT_COMMAND5.2 Bash Variables
    PROMPT_DIRTRIM5.2 Bash Variables
    PROMPT_DIRTRIM5.2 Bash Variables
    PS15.1 Bourne Shell Variables
    PS15.1 Bourne Shell Variables
    PS25.1 Bourne Shell Variables
    PS25.1 Bourne Shell Variables
    PS35.2 Bash Variables
    PS35.2 Bash Variables
    PS45.2 Bash Variables
    PS45.2 Bash Variables
    PWD5.2 Bash Variables
    PWD5.2 Bash Variables

    R
    RANDOM5.2 Bash Variables
    RANDOM5.2 Bash Variables
    READLINE_LINE5.2 Bash Variables
    READLINE_LINE5.2 Bash Variables
    READLINE_POINT5.2 Bash Variables
    READLINE_POINT5.2 Bash Variables
    REPLY5.2 Bash Variables
    REPLY5.2 Bash Variables
    revert-all-at-newline8.3.1 Readline Init File Syntax

    S
    SECONDS5.2 Bash Variables
    SECONDS5.2 Bash Variables
    SHELL5.2 Bash Variables
    SHELL5.2 Bash Variables
    SHELLOPTS5.2 Bash Variables
    SHELLOPTS5.2 Bash Variables
    SHLVL5.2 Bash Variables
    SHLVL5.2 Bash Variables
    show-all-if-ambiguous8.3.1 Readline Init File Syntax
    show-all-if-unmodified8.3.1 Readline Init File Syntax
    show-mode-in-prompt8.3.1 Readline Init File Syntax
    skip-completed-text8.3.1 Readline Init File Syntax

    T
    TEXTDOMAIN3.1.2.5 Locale-Specific Translation
    TEXTDOMAINDIR3.1.2.5 Locale-Specific Translation
    TIMEFORMAT5.2 Bash Variables
    TIMEFORMAT5.2 Bash Variables
    TMOUT5.2 Bash Variables
    TMOUT5.2 Bash Variables
    TMPDIR5.2 Bash Variables
    TMPDIR5.2 Bash Variables

    U
    UID5.2 Bash Variables
    UID5.2 Bash Variables

    V
    visible-stats8.3.1 Readline Init File Syntax

    Jump to:   ! +   +# +   +$ +   +* +   +- +   +0 +   +? +   +@ +   +_ +   +
    +A +   +B +   +C +   +D +   +E +   +F +   +G +   +H +   +I +   +K +   +L +   +M +   +O +   +P +   +R +   +S +   +T +   +U +   +V +   +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    D.4 Function Index

    + +
    Jump to:   A +   +B +   +C +   +D +   +E +   +F +   +G +   +H +   +I +   +K +   +M +   +N +   +O +   +P +   +Q +   +R +   +S +   +T +   +U +   +Y +   +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Index Entry Section

    A
    abort (C-g)8.4.8 Some Miscellaneous Commands
    abort (C-g)8.4.8 Some Miscellaneous Commands
    accept-line (Newline or Return)8.4.2 Commands For Manipulating The History
    accept-line (Newline or Return)8.4.2 Commands For Manipulating The History
    alias-expand-line ()8.4.8 Some Miscellaneous Commands
    alias-expand-line ()8.4.8 Some Miscellaneous Commands

    B
    backward-char (C-b)8.4.1 Commands For Moving
    backward-char (C-b)8.4.1 Commands For Moving
    backward-delete-char (Rubout)8.4.3 Commands For Changing Text
    backward-delete-char (Rubout)8.4.3 Commands For Changing Text
    backward-kill-line (C-x Rubout)8.4.4 Killing And Yanking
    backward-kill-line (C-x Rubout)8.4.4 Killing And Yanking
    backward-kill-word (M-DEL)8.4.4 Killing And Yanking
    backward-kill-word (M-DEL)8.4.4 Killing And Yanking
    backward-word (M-b)8.4.1 Commands For Moving
    backward-word (M-b)8.4.1 Commands For Moving
    beginning-of-history (M-&#60;)8.4.2 Commands For Manipulating The History
    beginning-of-history (M-&#60;)8.4.2 Commands For Manipulating The History
    beginning-of-line (C-a)8.4.1 Commands For Moving
    beginning-of-line (C-a)8.4.1 Commands For Moving

    C
    call-last-kbd-macro (C-x e)8.4.7 Keyboard Macros
    call-last-kbd-macro (C-x e)8.4.7 Keyboard Macros
    capitalize-word (M-c)8.4.3 Commands For Changing Text
    capitalize-word (M-c)8.4.3 Commands For Changing Text
    character-search (C-])8.4.8 Some Miscellaneous Commands
    character-search (C-])8.4.8 Some Miscellaneous Commands
    character-search-backward (M-C-])8.4.8 Some Miscellaneous Commands
    character-search-backward (M-C-])8.4.8 Some Miscellaneous Commands
    clear-screen (C-l)8.4.1 Commands For Moving
    clear-screen (C-l)8.4.1 Commands For Moving
    complete (TAB)8.4.6 Letting Readline Type For You
    complete (TAB)8.4.6 Letting Readline Type For You
    complete-command (M-!)8.4.6 Letting Readline Type For You
    complete-command (M-!)8.4.6 Letting Readline Type For You
    complete-filename (M-/)8.4.6 Letting Readline Type For You
    complete-filename (M-/)8.4.6 Letting Readline Type For You
    complete-hostname (M-@)8.4.6 Letting Readline Type For You
    complete-hostname (M-@)8.4.6 Letting Readline Type For You
    complete-into-braces (M-{)8.4.6 Letting Readline Type For You
    complete-into-braces (M-{)8.4.6 Letting Readline Type For You
    complete-username (M-~)8.4.6 Letting Readline Type For You
    complete-username (M-~)8.4.6 Letting Readline Type For You
    complete-variable (M-$)8.4.6 Letting Readline Type For You
    complete-variable (M-$)8.4.6 Letting Readline Type For You
    copy-backward-word ()8.4.4 Killing And Yanking
    copy-backward-word ()8.4.4 Killing And Yanking
    copy-forward-word ()8.4.4 Killing And Yanking
    copy-forward-word ()8.4.4 Killing And Yanking
    copy-region-as-kill ()8.4.4 Killing And Yanking
    copy-region-as-kill ()8.4.4 Killing And Yanking

    D
    dabbrev-expand ()8.4.6 Letting Readline Type For You
    dabbrev-expand ()8.4.6 Letting Readline Type For You
    delete-char (C-d)8.4.3 Commands For Changing Text
    delete-char (C-d)8.4.3 Commands For Changing Text
    delete-char-or-list ()8.4.6 Letting Readline Type For You
    delete-char-or-list ()8.4.6 Letting Readline Type For You
    delete-horizontal-space ()8.4.4 Killing And Yanking
    delete-horizontal-space ()8.4.4 Killing And Yanking
    digit-argument (M-0, M-1, <small>...</small> M--)8.4.5 Specifying Numeric Arguments
    digit-argument (M-0, M-1, <small>...</small> M--)8.4.5 Specifying Numeric Arguments
    display-shell-version (C-x C-v)8.4.8 Some Miscellaneous Commands
    display-shell-version (C-x C-v)8.4.8 Some Miscellaneous Commands
    do-uppercase-version (M-a, M-b, M-x, <small>...</small>)8.4.8 Some Miscellaneous Commands
    do-uppercase-version (M-a, M-b, M-x, <small>...</small>)8.4.8 Some Miscellaneous Commands
    downcase-word (M-l)8.4.3 Commands For Changing Text
    downcase-word (M-l)8.4.3 Commands For Changing Text
    dump-functions ()8.4.8 Some Miscellaneous Commands
    dump-functions ()8.4.8 Some Miscellaneous Commands
    dump-macros ()8.4.8 Some Miscellaneous Commands
    dump-macros ()8.4.8 Some Miscellaneous Commands
    dump-variables ()8.4.8 Some Miscellaneous Commands
    dump-variables ()8.4.8 Some Miscellaneous Commands
    dynamic-complete-history (M-TAB)8.4.6 Letting Readline Type For You
    dynamic-complete-history (M-TAB)8.4.6 Letting Readline Type For You

    E
    edit-and-execute-command (C-xC-e)8.4.8 Some Miscellaneous Commands
    edit-and-execute-command (C-xC-e)8.4.8 Some Miscellaneous Commands
    end-kbd-macro (C-x ))8.4.7 Keyboard Macros
    end-kbd-macro (C-x ))8.4.7 Keyboard Macros
    end-of-file (usually C-d)8.4.3 Commands For Changing Text
    end-of-file (usually C-d)8.4.3 Commands For Changing Text
    end-of-history (M-&#62;)8.4.2 Commands For Manipulating The History
    end-of-history (M-&#62;)8.4.2 Commands For Manipulating The History
    end-of-line (C-e)8.4.1 Commands For Moving
    end-of-line (C-e)8.4.1 Commands For Moving
    exchange-point-and-mark (C-x C-x)8.4.8 Some Miscellaneous Commands
    exchange-point-and-mark (C-x C-x)8.4.8 Some Miscellaneous Commands

    F
    forward-backward-delete-char ()8.4.3 Commands For Changing Text
    forward-backward-delete-char ()8.4.3 Commands For Changing Text
    forward-char (C-f)8.4.1 Commands For Moving
    forward-char (C-f)8.4.1 Commands For Moving
    forward-search-history (C-s)8.4.2 Commands For Manipulating The History
    forward-search-history (C-s)8.4.2 Commands For Manipulating The History
    forward-word (M-f)8.4.1 Commands For Moving
    forward-word (M-f)8.4.1 Commands For Moving

    G
    glob-complete-word (M-g)8.4.8 Some Miscellaneous Commands
    glob-complete-word (M-g)8.4.8 Some Miscellaneous Commands
    glob-expand-word (C-x *)8.4.8 Some Miscellaneous Commands
    glob-expand-word (C-x *)8.4.8 Some Miscellaneous Commands
    glob-list-expansions (C-x g)8.4.8 Some Miscellaneous Commands
    glob-list-expansions (C-x g)8.4.8 Some Miscellaneous Commands

    H
    history-and-alias-expand-line ()8.4.8 Some Miscellaneous Commands
    history-and-alias-expand-line ()8.4.8 Some Miscellaneous Commands
    history-expand-line (M-^)8.4.8 Some Miscellaneous Commands
    history-expand-line (M-^)8.4.8 Some Miscellaneous Commands
    history-search-backward ()8.4.2 Commands For Manipulating The History
    history-search-backward ()8.4.2 Commands For Manipulating The History
    history-search-forward ()8.4.2 Commands For Manipulating The History
    history-search-forward ()8.4.2 Commands For Manipulating The History
    history-substr-search-backward ()8.4.2 Commands For Manipulating The History
    history-substr-search-backward ()8.4.2 Commands For Manipulating The History
    history-substr-search-forward ()8.4.2 Commands For Manipulating The History
    history-substr-search-forward ()8.4.2 Commands For Manipulating The History

    I
    insert-comment (M-#)8.4.8 Some Miscellaneous Commands
    insert-comment (M-#)8.4.8 Some Miscellaneous Commands
    insert-completions (M-*)8.4.6 Letting Readline Type For You
    insert-completions (M-*)8.4.6 Letting Readline Type For You
    insert-last-argument (M-. or M-_)8.4.8 Some Miscellaneous Commands
    insert-last-argument (M-. or M-_)8.4.8 Some Miscellaneous Commands

    K
    kill-line (C-k)8.4.4 Killing And Yanking
    kill-line (C-k)8.4.4 Killing And Yanking
    kill-region ()8.4.4 Killing And Yanking
    kill-region ()8.4.4 Killing And Yanking
    kill-whole-line ()8.4.4 Killing And Yanking
    kill-whole-line ()8.4.4 Killing And Yanking
    kill-word (M-d)8.4.4 Killing And Yanking
    kill-word (M-d)8.4.4 Killing And Yanking

    M
    magic-space ()8.4.8 Some Miscellaneous Commands
    magic-space ()8.4.8 Some Miscellaneous Commands
    menu-complete ()8.4.6 Letting Readline Type For You
    menu-complete ()8.4.6 Letting Readline Type For You
    menu-complete-backward ()8.4.6 Letting Readline Type For You
    menu-complete-backward ()8.4.6 Letting Readline Type For You

    N
    next-history (C-n)8.4.2 Commands For Manipulating The History
    next-history (C-n)8.4.2 Commands For Manipulating The History
    non-incremental-forward-search-history (M-n)8.4.2 Commands For Manipulating The History
    non-incremental-forward-search-history (M-n)8.4.2 Commands For Manipulating The History
    non-incremental-reverse-search-history (M-p)8.4.2 Commands For Manipulating The History
    non-incremental-reverse-search-history (M-p)8.4.2 Commands For Manipulating The History

    O
    operate-and-get-next (C-o)8.4.8 Some Miscellaneous Commands
    operate-and-get-next (C-o)8.4.8 Some Miscellaneous Commands
    overwrite-mode ()8.4.3 Commands For Changing Text
    overwrite-mode ()8.4.3 Commands For Changing Text

    P
    possible-command-completions (C-x !)8.4.6 Letting Readline Type For You
    possible-command-completions (C-x !)8.4.6 Letting Readline Type For You
    possible-completions (M-?)8.4.6 Letting Readline Type For You
    possible-completions (M-?)8.4.6 Letting Readline Type For You
    possible-filename-completions (C-x /)8.4.6 Letting Readline Type For You
    possible-filename-completions (C-x /)8.4.6 Letting Readline Type For You
    possible-hostname-completions (C-x @)8.4.6 Letting Readline Type For You
    possible-hostname-completions (C-x @)8.4.6 Letting Readline Type For You
    possible-username-completions (C-x ~)8.4.6 Letting Readline Type For You
    possible-username-completions (C-x ~)8.4.6 Letting Readline Type For You
    possible-variable-completions (C-x $)8.4.6 Letting Readline Type For You
    possible-variable-completions (C-x $)8.4.6 Letting Readline Type For You
    prefix-meta (ESC)8.4.8 Some Miscellaneous Commands
    prefix-meta (ESC)8.4.8 Some Miscellaneous Commands
    previous-history (C-p)8.4.2 Commands For Manipulating The History
    previous-history (C-p)8.4.2 Commands For Manipulating The History
    print-last-kbd-macro ()8.4.7 Keyboard Macros
    print-last-kbd-macro ()8.4.7 Keyboard Macros

    Q
    quoted-insert (C-q or C-v)8.4.3 Commands For Changing Text
    quoted-insert (C-q or C-v)8.4.3 Commands For Changing Text

    R
    re-read-init-file (C-x C-r)8.4.8 Some Miscellaneous Commands
    re-read-init-file (C-x C-r)8.4.8 Some Miscellaneous Commands
    redraw-current-line ()8.4.1 Commands For Moving
    redraw-current-line ()8.4.1 Commands For Moving
    reverse-search-history (C-r)8.4.2 Commands For Manipulating The History
    reverse-search-history (C-r)8.4.2 Commands For Manipulating The History
    revert-line (M-r)8.4.8 Some Miscellaneous Commands
    revert-line (M-r)8.4.8 Some Miscellaneous Commands

    S
    self-insert (a, b, A, 1, !, <small>...</small>)8.4.3 Commands For Changing Text
    self-insert (a, b, A, 1, !, <small>...</small>)8.4.3 Commands For Changing Text
    set-mark (C-@)8.4.8 Some Miscellaneous Commands
    set-mark (C-@)8.4.8 Some Miscellaneous Commands
    shell-backward-kill-word ()8.4.4 Killing And Yanking
    shell-backward-kill-word ()8.4.4 Killing And Yanking
    shell-backward-word ()8.4.1 Commands For Moving
    shell-backward-word ()8.4.1 Commands For Moving
    shell-expand-line (M-C-e)8.4.8 Some Miscellaneous Commands
    shell-expand-line (M-C-e)8.4.8 Some Miscellaneous Commands
    shell-forward-word ()8.4.1 Commands For Moving
    shell-forward-word ()8.4.1 Commands For Moving
    shell-kill-word ()8.4.4 Killing And Yanking
    shell-kill-word ()8.4.4 Killing And Yanking
    skip-csi-sequence ()8.4.8 Some Miscellaneous Commands
    skip-csi-sequence ()8.4.8 Some Miscellaneous Commands
    start-kbd-macro (C-x ()8.4.7 Keyboard Macros
    start-kbd-macro (C-x ()8.4.7 Keyboard Macros

    T
    tilde-expand (M-&#38;)8.4.8 Some Miscellaneous Commands
    tilde-expand (M-&#38;)8.4.8 Some Miscellaneous Commands
    transpose-chars (C-t)8.4.3 Commands For Changing Text
    transpose-chars (C-t)8.4.3 Commands For Changing Text
    transpose-words (M-t)8.4.3 Commands For Changing Text
    transpose-words (M-t)8.4.3 Commands For Changing Text

    U
    undo (C-_ or C-x C-u)8.4.8 Some Miscellaneous Commands
    undo (C-_ or C-x C-u)8.4.8 Some Miscellaneous Commands
    universal-argument ()8.4.5 Specifying Numeric Arguments
    universal-argument ()8.4.5 Specifying Numeric Arguments
    unix-filename-rubout ()8.4.4 Killing And Yanking
    unix-filename-rubout ()8.4.4 Killing And Yanking
    unix-line-discard (C-u)8.4.4 Killing And Yanking
    unix-line-discard (C-u)8.4.4 Killing And Yanking
    unix-word-rubout (C-w)8.4.4 Killing And Yanking
    unix-word-rubout (C-w)8.4.4 Killing And Yanking
    upcase-word (M-u)8.4.3 Commands For Changing Text
    upcase-word (M-u)8.4.3 Commands For Changing Text

    Y
    yank (C-y)8.4.4 Killing And Yanking
    yank (C-y)8.4.4 Killing And Yanking
    yank-last-arg (M-. or M-_)8.4.2 Commands For Manipulating The History
    yank-last-arg (M-. or M-_)8.4.2 Commands For Manipulating The History
    yank-nth-arg (M-C-y)8.4.2 Commands For Manipulating The History
    yank-nth-arg (M-C-y)8.4.2 Commands For Manipulating The History
    yank-pop (M-y)8.4.4 Killing And Yanking
    yank-pop (M-y)8.4.4 Killing And Yanking

    Jump to:   A +   +B +   +C +   +D +   +E +   +F +   +G +   +H +   +I +   +K +   +M +   +N +   +O +   +P +   +Q +   +R +   +S +   +T +   +U +   +Y +   +

    + + +


    + + + + + + + + + + + +
    [ < ][ > ]   [ << ][ Up ][ >> ]         [Top][Contents][Index][ ? ]
    +

    D.5 Concept Index

    + +
    Jump to:   A +   +B +   +C +   +D +   +E +   +F +   +H +   +I +   +J +   +K +   +L +   +M +   +N +   +O +   +P +   +Q +   +R +   +S +   +T +   +V +   +W +   +Y +   +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Index Entry Section

    A
    alias expansion6.6 Aliases
    arithmetic evaluation6.5 Shell Arithmetic
    arithmetic expansion3.5.5 Arithmetic Expansion
    arithmetic, shell6.5 Shell Arithmetic
    arrays6.7 Arrays

    B
    background7.1 Job Control Basics
    Bash configuration10.1 Basic Installation
    Bash installation10.1 Basic Installation
    Bourne shell3. Basic Shell Features
    brace expansion3.5.1 Brace Expansion
    builtin2. Definitions

    C
    command editing8.2.1 Readline Bare Essentials
    command execution3.7.2 Command Search and Execution
    command expansion3.7.1 Simple Command Expansion
    command history9.1 Bash History Facilities
    command search3.7.2 Command Search and Execution
    command substitution3.5.4 Command Substitution
    command timing3.2.2 Pipelines
    commands, compound3.2.4 Compound Commands
    commands, conditional3.2.4.2 Conditional Constructs
    commands, grouping3.2.4.3 Grouping Commands
    commands, lists3.2.3 Lists of Commands
    commands, looping3.2.4.1 Looping Constructs
    commands, pipelines3.2.2 Pipelines
    commands, shell3.2 Shell Commands
    commands, simple3.2.1 Simple Commands
    comments, shell3.1.3 Comments
    completion builtins8.7 Programmable Completion Builtins
    configuration10.1 Basic Installation
    control operator2. Definitions
    coprocess3.2.5 Coprocesses

    D
    directory stack6.8 The Directory Stack

    E
    editing command lines8.2.1 Readline Bare Essentials
    environment3.7.4 Environment
    evaluation, arithmetic6.5 Shell Arithmetic
    event designators9.3.1 Event Designators
    execution environment3.7.3 Command Execution Environment
    exit status2. Definitions
    exit status3.7.5 Exit Status
    expansion3.5 Shell Expansions
    expansion, arithmetic3.5.5 Arithmetic Expansion
    expansion, brace3.5.1 Brace Expansion
    expansion, filename3.5.8 Filename Expansion
    expansion, parameter3.5.3 Shell Parameter Expansion
    expansion, pathname3.5.8 Filename Expansion
    expansion, tilde3.5.2 Tilde Expansion
    expressions, arithmetic6.5 Shell Arithmetic
    expressions, conditional6.4 Bash Conditional Expressions

    F
    field2. Definitions
    filename2. Definitions
    filename expansion3.5.8 Filename Expansion
    foreground7.1 Job Control Basics
    functions, shell3.3 Shell Functions

    H
    history builtins9.2 Bash History Builtins
    history events9.3.1 Event Designators
    history expansion9.3 History Expansion
    history list9.1 Bash History Facilities
    History, how to use8.8 A Programmable Completion Example

    I
    identifier2. Definitions
    initialization file, readline8.3 Readline Init File
    installation10.1 Basic Installation
    interaction, readline8.2 Readline Interaction
    interactive shell6.1 Invoking Bash
    interactive shell6.3 Interactive Shells
    internationalization3.1.2.5 Locale-Specific Translation

    J
    job2. Definitions
    job control2. Definitions
    job control7.1 Job Control Basics

    K
    kill ring8.2.3 Readline Killing Commands
    killing text8.2.3 Readline Killing Commands

    L
    localization3.1.2.5 Locale-Specific Translation
    login shell6.1 Invoking Bash

    M
    matching, pattern3.5.8.1 Pattern Matching
    metacharacter2. Definitions

    N
    name2. Definitions
    native languages3.1.2.5 Locale-Specific Translation
    notation, readline8.2.1 Readline Bare Essentials

    O
    operator, shell2. Definitions

    P
    parameter expansion3.5.3 Shell Parameter Expansion
    parameters3.4 Shell Parameters
    parameters, positional3.4.1 Positional Parameters
    parameters, special3.4.2 Special Parameters
    pathname expansion3.5.8 Filename Expansion
    pattern matching3.5.8.1 Pattern Matching
    pipeline3.2.2 Pipelines
    POSIX2. Definitions
    POSIX Mode6.11 Bash POSIX Mode
    process group2. Definitions
    process group ID2. Definitions
    process substitution3.5.6 Process Substitution
    programmable completion8.6 Programmable Completion
    prompting6.9 Controlling the Prompt

    Q
    quoting3.1.2 Quoting
    quoting, ANSI3.1.2.4 ANSI-C Quoting

    R
    Readline, how to use7.3 Job Control Variables
    redirection3.6 Redirections
    reserved word2. Definitions
    restricted shell6.10 The Restricted Shell
    return status2. Definitions

    S
    shell arithmetic6.5 Shell Arithmetic
    shell function3.3 Shell Functions
    shell script3.8 Shell Scripts
    shell variable3.4 Shell Parameters
    shell, interactive6.3 Interactive Shells
    signal2. Definitions
    signal handling3.7.6 Signals
    special builtin2. Definitions
    special builtin4.4 Special Builtins
    startup files6.2 Bash Startup Files
    suspending jobs7.1 Job Control Basics

    T
    tilde expansion3.5.2 Tilde Expansion
    token2. Definitions
    translation, native languages3.1.2.5 Locale-Specific Translation

    V
    variable, shell3.4 Shell Parameters
    variables, readline8.3.1 Readline Init File Syntax

    W
    word2. Definitions
    word splitting3.5.7 Word Splitting

    Y
    yanking text8.2.3 Readline Killing Commands

    Jump to:   A +   +B +   +C +   +D +   +E +   +F +   +H +   +I +   +J +   +K +   +L +   +M +   +N +   +O +   +P +   +Q +   +R +   +S +   +T +   +V +   +W +   +Y +   +

    + +


    + + + + + + +
    [Top][Contents][Index][ ? ]
    +

    Table of Contents

    + +
    + + + + + + +
    [Top][Contents][Index][ ? ]
    +

    Short Table of Contents

    +
    +1. Introduction +
    +2. Definitions +
    +3. Basic Shell Features +
    +4. Shell Builtin Commands +
    +5. Shell Variables +
    +6. Bash Features +
    +7. Job Control +
    +8. Command Line Editing +
    +9. Using History Interactively +
    +10. Installing Bash +
    +A. Reporting Bugs +
    +B. Major Differences From The Bourne Shell +
    +C. GNU Free Documentation License +
    +D. Indexes +
    + +
    +
    + + + + + + +
    [Top][Contents][Index][ ? ]
    +

    About this document

    +This document was generated by Chet Ramey on February, 24 2014 +using texi2html +

    +The buttons in the navigation panels have the following meaning: +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Button Name Go to From 1.2.3 go to
    + [ < ] +Back + +previous section in reading order + +1.2.2 +
    + [ > ] +Forward + +next section in reading order + +1.2.4 +
    + [ << ] +FastBack + +previous or up-and-previous section + +1.1 +
    + [ Up ] +Up + +up section + +1.2 +
    + [ >> ] +FastForward + +next or up-and-next section + +1.3 +
    + [Top] +Top + +cover (top) of document + +   +
    + [Contents] +Contents + +table of contents + +   +
    + [Index] +Index + +concept index + +   +
    + [ ? ] +About + +this page + +   +
    +

    +where the Example assumes that the current position +is at Subsubsection One-Two-Three of a document of +the following structure: +
      +
    • 1. Section One
    • +
        +
      • 1.1 Subsection One-One
      • +
          +
        • ...
        • +
        +
      • 1.2 Subsection One-Two
      • +
          +
        • 1.2.1 Subsubsection One-Two-One +
        • 1.2.2 Subsubsection One-Two-Two +
        • 1.2.3 Subsubsection One-Two-Three     +<== Current Position +
        • 1.2.4 Subsubsection One-Two-Four +
        +
      • 1.3 Subsection One-Three
      • +
          +
        • ...
        • +
        +
      • 1.4 Subsection One-Four
      • +
      +
    + +
    +
    + +This document was generated +by Chet Ramey on February, 24 2014 +using texi2html + + + diff --git a/doc/bashref.info b/doc/bashref.info new file mode 100644 index 0000000..6f60af1 --- /dev/null +++ b/doc/bashref.info @@ -0,0 +1,11298 @@ +This is bashref.info, produced by makeinfo version 4.13 from +/usr/homes/chet/src/bash/src/doc/bashref.texi. + +This text is a brief description of the features that are present in +the Bash shell (version 4.3, 2 February 2014). + + This is Edition 4.3, last updated 2 February 2014, of `The GNU Bash +Reference Manual', for `Bash', Version 4.3. + + Copyright (C) 1988-2014 Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts, and + no Back-Cover Texts. A copy of the license is included in the + section entitled "GNU Free Documentation License". + +INFO-DIR-SECTION Basics +START-INFO-DIR-ENTRY +* Bash: (bash). The GNU Bourne-Again SHell. +END-INFO-DIR-ENTRY + + +File: bashref.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) + +Bash Features +************* + +This text is a brief description of the features that are present in +the Bash shell (version 4.3, 2 February 2014). The Bash home page is +`http://www.gnu.org/software/bash/'. + + This is Edition 4.3, last updated 2 February 2014, of `The GNU Bash +Reference Manual', for `Bash', Version 4.3. + + Bash contains features that appear in other popular shells, and some +features that only appear in Bash. Some of the shells that Bash has +borrowed concepts from are the Bourne Shell (`sh'), the Korn Shell +(`ksh'), and the C-shell (`csh' and its successor, `tcsh'). The +following menu breaks the features up into categories, noting which +features were inspired by other shells and which are specific to Bash. + + This manual is meant as a brief introduction to features found in +Bash. The Bash manual page should be used as the definitive reference +on shell behavior. + +* Menu: + +* Introduction:: An introduction to the shell. +* Definitions:: Some definitions used in the rest of this + manual. +* Basic Shell Features:: The shell "building blocks". +* Shell Builtin Commands:: Commands that are a part of the shell. +* Shell Variables:: Variables used or set by Bash. +* Bash Features:: Features found only in Bash. +* Job Control:: What job control is and how Bash allows you + to use it. +* Command Line Editing:: Chapter describing the command line + editing features. +* Using History Interactively:: Command History Expansion +* Installing Bash:: How to build and install Bash on your system. +* Reporting Bugs:: How to report bugs in Bash. +* Major Differences From The Bourne Shell:: A terse list of the differences + between Bash and historical + versions of /bin/sh. +* GNU Free Documentation License:: Copying and sharing this documentation. +* Indexes:: Various indexes for this manual. + + +File: bashref.info, Node: Introduction, Next: Definitions, Prev: Top, Up: Top + +1 Introduction +************** + +* Menu: + +* What is Bash?:: A short description of Bash. +* What is a shell?:: A brief introduction to shells. + + +File: bashref.info, Node: What is Bash?, Next: What is a shell?, Up: Introduction + +1.1 What is Bash? +================= + +Bash is the shell, or command language interpreter, for the GNU +operating system. The name is an acronym for the `Bourne-Again SHell', +a pun on Stephen Bourne, the author of the direct ancestor of the +current Unix shell `sh', which appeared in the Seventh Edition Bell +Labs Research version of Unix. + + Bash is largely compatible with `sh' and incorporates useful +features from the Korn shell `ksh' and the C shell `csh'. It is +intended to be a conformant implementation of the IEEE POSIX Shell and +Tools portion of the IEEE POSIX specification (IEEE Standard 1003.1). +It offers functional improvements over `sh' for both interactive and +programming use. + + While the GNU operating system provides other shells, including a +version of `csh', Bash is the default shell. Like other GNU software, +Bash is quite portable. It currently runs on nearly every version of +Unix and a few other operating systems - independently-supported ports +exist for MS-DOS, OS/2, and Windows platforms. + + +File: bashref.info, Node: What is a shell?, Prev: What is Bash?, Up: Introduction + +1.2 What is a shell? +==================== + +At its base, a shell is simply a macro processor that executes +commands. The term macro processor means functionality where text and +symbols are expanded to create larger expressions. + + A Unix shell is both a command interpreter and a programming +language. As a command interpreter, the shell provides the user +interface to the rich set of GNU utilities. The programming language +features allow these utilities to be combined. Files containing +commands can be created, and become commands themselves. These new +commands have the same status as system commands in directories such as +`/bin', allowing users or groups to establish custom environments to +automate their common tasks. + + Shells may be used interactively or non-interactively. In +interactive mode, they accept input typed from the keyboard. When +executing non-interactively, shells execute commands read from a file. + + A shell allows execution of GNU commands, both synchronously and +asynchronously. The shell waits for synchronous commands to complete +before accepting more input; asynchronous commands continue to execute +in parallel with the shell while it reads and executes additional +commands. The "redirection" constructs permit fine-grained control of +the input and output of those commands. Moreover, the shell allows +control over the contents of commands' environments. + + Shells also provide a small set of built-in commands ("builtins") +implementing functionality impossible or inconvenient to obtain via +separate utilities. For example, `cd', `break', `continue', and `exec' +cannot be implemented outside of the shell because they directly +manipulate the shell itself. The `history', `getopts', `kill', or `pwd' +builtins, among others, could be implemented in separate utilities, but +they are more convenient to use as builtin commands. All of the shell +builtins are described in subsequent sections. + + While executing commands is essential, most of the power (and +complexity) of shells is due to their embedded programming languages. +Like any high-level language, the shell provides variables, flow +control constructs, quoting, and functions. + + Shells offer features geared specifically for interactive use rather +than to augment the programming language. These interactive features +include job control, command line editing, command history and aliases. +Each of these features is described in this manual. + + +File: bashref.info, Node: Definitions, Next: Basic Shell Features, Prev: Introduction, Up: Top + +2 Definitions +************* + +These definitions are used throughout the remainder of this manual. + +`POSIX' + A family of open system standards based on Unix. Bash is + primarily concerned with the Shell and Utilities portion of the + POSIX 1003.1 standard. + +`blank' + A space or tab character. + +`builtin' + A command that is implemented internally by the shell itself, + rather than by an executable program somewhere in the file system. + +`control operator' + A `token' that performs a control function. It is a `newline' or + one of the following: `||', `&&', `&', `;', `;;', `|', `|&', `(', + or `)'. + +`exit status' + The value returned by a command to its caller. The value is + restricted to eight bits, so the maximum value is 255. + +`field' + A unit of text that is the result of one of the shell expansions. + After expansion, when executing a command, the resulting fields + are used as the command name and arguments. + +`filename' + A string of characters used to identify a file. + +`job' + A set of processes comprising a pipeline, and any processes + descended from it, that are all in the same process group. + +`job control' + A mechanism by which users can selectively stop (suspend) and + restart (resume) execution of processes. + +`metacharacter' + A character that, when unquoted, separates words. A metacharacter + is a `blank' or one of the following characters: `|', `&', `;', + `(', `)', `<', or `>'. + +`name' + A `word' consisting solely of letters, numbers, and underscores, + and beginning with a letter or underscore. `Name's are used as + shell variable and function names. Also referred to as an + `identifier'. + +`operator' + A `control operator' or a `redirection operator'. *Note + Redirections::, for a list of redirection operators. Operators + contain at least one unquoted `metacharacter'. + +`process group' + A collection of related processes each having the same process + group ID. + +`process group ID' + A unique identifier that represents a `process group' during its + lifetime. + +`reserved word' + A `word' that has a special meaning to the shell. Most reserved + words introduce shell flow control constructs, such as `for' and + `while'. + +`return status' + A synonym for `exit status'. + +`signal' + A mechanism by which a process may be notified by the kernel of an + event occurring in the system. + +`special builtin' + A shell builtin command that has been classified as special by the + POSIX standard. + +`token' + A sequence of characters considered a single unit by the shell. + It is either a `word' or an `operator'. + +`word' + A sequence of characters treated as a unit by the shell. Words + may not include unquoted `metacharacters'. + + +File: bashref.info, Node: Basic Shell Features, Next: Shell Builtin Commands, Prev: Definitions, Up: Top + +3 Basic Shell Features +********************** + +Bash is an acronym for `Bourne-Again SHell'. The Bourne shell is the +traditional Unix shell originally written by Stephen Bourne. All of +the Bourne shell builtin commands are available in Bash, The rules for +evaluation and quoting are taken from the POSIX specification for the +`standard' Unix shell. + + This chapter briefly summarizes the shell's `building blocks': +commands, control structures, shell functions, shell parameters, shell +expansions, redirections, which are a way to direct input and output +from and to named files, and how the shell executes commands. + +* Menu: + +* Shell Syntax:: What your input means to the shell. +* Shell Commands:: The types of commands you can use. +* Shell Functions:: Grouping commands by name. +* Shell Parameters:: How the shell stores values. +* Shell Expansions:: How Bash expands parameters and the various + expansions available. +* Redirections:: A way to control where input and output go. +* Executing Commands:: What happens when you run a command. +* Shell Scripts:: Executing files of shell commands. + + +File: bashref.info, Node: Shell Syntax, Next: Shell Commands, Up: Basic Shell Features + +3.1 Shell Syntax +================ + +* Menu: + +* Shell Operation:: The basic operation of the shell. +* Quoting:: How to remove the special meaning from characters. +* Comments:: How to specify comments. + + When the shell reads input, it proceeds through a sequence of +operations. If the input indicates the beginning of a comment, the +shell ignores the comment symbol (`#'), and the rest of that line. + + Otherwise, roughly speaking, the shell reads its input and divides +the input into words and operators, employing the quoting rules to +select which meanings to assign various words and characters. + + The shell then parses these tokens into commands and other +constructs, removes the special meaning of certain words or characters, +expands others, redirects input and output as needed, executes the +specified command, waits for the command's exit status, and makes that +exit status available for further inspection or processing. + + +File: bashref.info, Node: Shell Operation, Next: Quoting, Up: Shell Syntax + +3.1.1 Shell Operation +--------------------- + +The following is a brief description of the shell's operation when it +reads and executes a command. Basically, the shell does the following: + + 1. Reads its input from a file (*note Shell Scripts::), from a string + supplied as an argument to the `-c' invocation option (*note + Invoking Bash::), or from the user's terminal. + + 2. Breaks the input into words and operators, obeying the quoting + rules described in *note Quoting::. These tokens are separated by + `metacharacters'. Alias expansion is performed by this step + (*note Aliases::). + + 3. Parses the tokens into simple and compound commands (*note Shell + Commands::). + + 4. Performs the various shell expansions (*note Shell Expansions::), + breaking the expanded tokens into lists of filenames (*note + Filename Expansion::) and commands and arguments. + + 5. Performs any necessary redirections (*note Redirections::) and + removes the redirection operators and their operands from the + argument list. + + 6. Executes the command (*note Executing Commands::). + + 7. Optionally waits for the command to complete and collects its exit + status (*note Exit Status::). + + + +File: bashref.info, Node: Quoting, Next: Comments, Prev: Shell Operation, Up: Shell Syntax + +3.1.2 Quoting +------------- + +* Menu: + +* Escape Character:: How to remove the special meaning from a single + character. +* Single Quotes:: How to inhibit all interpretation of a sequence + of characters. +* Double Quotes:: How to suppress most of the interpretation of a + sequence of characters. +* ANSI-C Quoting:: How to expand ANSI-C sequences in quoted strings. +* Locale Translation:: How to translate strings into different languages. + + Quoting is used to remove the special meaning of certain characters +or words to the shell. Quoting can be used to disable special +treatment for special characters, to prevent reserved words from being +recognized as such, and to prevent parameter expansion. + + Each of the shell metacharacters (*note Definitions::) has special +meaning to the shell and must be quoted if it is to represent itself. +When the command history expansion facilities are being used (*note +History Interaction::), the HISTORY EXPANSION character, usually `!', +must be quoted to prevent history expansion. *Note Bash History +Facilities::, for more details concerning history expansion. + + There are three quoting mechanisms: the ESCAPE CHARACTER, single +quotes, and double quotes. + + +File: bashref.info, Node: Escape Character, Next: Single Quotes, Up: Quoting + +3.1.2.1 Escape Character +........................ + +A non-quoted backslash `\' is the Bash escape character. It preserves +the literal value of the next character that follows, with the +exception of `newline'. If a `\newline' pair appears, and the +backslash itself is not quoted, the `\newline' is treated as a line +continuation (that is, it is removed from the input stream and +effectively ignored). + + +File: bashref.info, Node: Single Quotes, Next: Double Quotes, Prev: Escape Character, Up: Quoting + +3.1.2.2 Single Quotes +..................... + +Enclosing characters in single quotes (`'') preserves the literal value +of each character within the quotes. A single quote may not occur +between single quotes, even when preceded by a backslash. + + +File: bashref.info, Node: Double Quotes, Next: ANSI-C Quoting, Prev: Single Quotes, Up: Quoting + +3.1.2.3 Double Quotes +..................... + +Enclosing characters in double quotes (`"') preserves the literal value +of all characters within the quotes, with the exception of `$', ``', +`\', and, when history expansion is enabled, `!'. The characters `$' +and ``' retain their special meaning within double quotes (*note Shell +Expansions::). The backslash retains its special meaning only when +followed by one of the following characters: `$', ``', `"', `\', or +`newline'. Within double quotes, backslashes that are followed by one +of these characters are removed. Backslashes preceding characters +without a special meaning are left unmodified. A double quote may be +quoted within double quotes by preceding it with a backslash. If +enabled, history expansion will be performed unless an `!' appearing in +double quotes is escaped using a backslash. The backslash preceding +the `!' is not removed. + + The special parameters `*' and `@' have special meaning when in +double quotes (*note Shell Parameter Expansion::). + + +File: bashref.info, Node: ANSI-C Quoting, Next: Locale Translation, Prev: Double Quotes, Up: Quoting + +3.1.2.4 ANSI-C Quoting +...................... + +Words of the form `$'STRING'' are treated specially. The word expands +to STRING, with backslash-escaped characters replaced as specified by +the ANSI C standard. Backslash escape sequences, if present, are +decoded as follows: + +`\a' + alert (bell) + +`\b' + backspace + +`\e' +`\E' + an escape character (not ANSI C) + +`\f' + form feed + +`\n' + newline + +`\r' + carriage return + +`\t' + horizontal tab + +`\v' + vertical tab + +`\\' + backslash + +`\'' + single quote + +`\"' + double quote + +`\NNN' + the eight-bit character whose value is the octal value NNN (one to + three digits) + +`\xHH' + the eight-bit character whose value is the hexadecimal value HH + (one or two hex digits) + +`\uHHHH' + the Unicode (ISO/IEC 10646) character whose value is the + hexadecimal value HHHH (one to four hex digits) + +`\UHHHHHHHH' + the Unicode (ISO/IEC 10646) character whose value is the + hexadecimal value HHHHHHHH (one to eight hex digits) + +`\cX' + a control-X character + +The expanded result is single-quoted, as if the dollar sign had not +been present. + + +File: bashref.info, Node: Locale Translation, Prev: ANSI-C Quoting, Up: Quoting + +3.1.2.5 Locale-Specific Translation +................................... + +A double-quoted string preceded by a dollar sign (`$') will cause the +string to be translated according to the current locale. If the +current locale is `C' or `POSIX', the dollar sign is ignored. If the +string is translated and replaced, the replacement is double-quoted. + + Some systems use the message catalog selected by the `LC_MESSAGES' +shell variable. Others create the name of the message catalog from the +value of the `TEXTDOMAIN' shell variable, possibly adding a suffix of +`.mo'. If you use the `TEXTDOMAIN' variable, you may need to set the +`TEXTDOMAINDIR' variable to the location of the message catalog files. +Still others use both variables in this fashion: +`TEXTDOMAINDIR'/`LC_MESSAGES'/LC_MESSAGES/`TEXTDOMAIN'.mo. + + +File: bashref.info, Node: Comments, Prev: Quoting, Up: Shell Syntax + +3.1.3 Comments +-------------- + +In a non-interactive shell, or an interactive shell in which the +`interactive_comments' option to the `shopt' builtin is enabled (*note +The Shopt Builtin::), a word beginning with `#' causes that word and +all remaining characters on that line to be ignored. An interactive +shell without the `interactive_comments' option enabled does not allow +comments. The `interactive_comments' option is on by default in +interactive shells. *Note Interactive Shells::, for a description of +what makes a shell interactive. + + +File: bashref.info, Node: Shell Commands, Next: Shell Functions, Prev: Shell Syntax, Up: Basic Shell Features + +3.2 Shell Commands +================== + +A simple shell command such as `echo a b c' consists of the command +itself followed by arguments, separated by spaces. + + More complex shell commands are composed of simple commands arranged +together in a variety of ways: in a pipeline in which the output of one +command becomes the input of a second, in a loop or conditional +construct, or in some other grouping. + +* Menu: + +* Simple Commands:: The most common type of command. +* Pipelines:: Connecting the input and output of several + commands. +* Lists:: How to execute commands sequentially. +* Compound Commands:: Shell commands for control flow. +* Coprocesses:: Two-way communication between commands. +* GNU Parallel:: Running commands in parallel. + + +File: bashref.info, Node: Simple Commands, Next: Pipelines, Up: Shell Commands + +3.2.1 Simple Commands +--------------------- + +A simple command is the kind of command encountered most often. It's +just a sequence of words separated by `blank's, terminated by one of +the shell's control operators (*note Definitions::). The first word +generally specifies a command to be executed, with the rest of the +words being that command's arguments. + + The return status (*note Exit Status::) of a simple command is its +exit status as provided by the POSIX 1003.1 `waitpid' function, or +128+N if the command was terminated by signal N. + + +File: bashref.info, Node: Pipelines, Next: Lists, Prev: Simple Commands, Up: Shell Commands + +3.2.2 Pipelines +--------------- + +A `pipeline' is a sequence of simple commands separated by one of the +control operators `|' or `|&'. + + The format for a pipeline is + [time [-p]] [!] COMMAND1 [ | or |& COMMAND2 ] ... + +The output of each command in the pipeline is connected via a pipe to +the input of the next command. That is, each command reads the +previous command's output. This connection is performed before any +redirections specified by the command. + + If `|&' is used, COMMAND1's standard error, in addition to its +standard output, is connected to COMMAND2's standard input through the +pipe; it is shorthand for `2>&1 |'. This implicit redirection of the +standard error to the standard output is performed after any +redirections specified by the command. + + The reserved word `time' causes timing statistics to be printed for +the pipeline once it finishes. The statistics currently consist of +elapsed (wall-clock) time and user and system time consumed by the +command's execution. The `-p' option changes the output format to that +specified by POSIX. When the shell is in POSIX mode (*note Bash POSIX +Mode::), it does not recognize `time' as a reserved word if the next +token begins with a `-'. The `TIMEFORMAT' variable may be set to a +format string that specifies how the timing information should be +displayed. *Note Bash Variables::, for a description of the available +formats. The use of `time' as a reserved word permits the timing of +shell builtins, shell functions, and pipelines. An external `time' +command cannot time these easily. + + When the shell is in POSIX mode (*note Bash POSIX Mode::), `time' +may be followed by a newline. In this case, the shell displays the +total user and system time consumed by the shell and its children. The +`TIMEFORMAT' variable may be used to specify the format of the time +information. + + If the pipeline is not executed asynchronously (*note Lists::), the +shell waits for all commands in the pipeline to complete. + + Each command in a pipeline is executed in its own subshell (*note +Command Execution Environment::). The exit status of a pipeline is the +exit status of the last command in the pipeline, unless the `pipefail' +option is enabled (*note The Set Builtin::). If `pipefail' is enabled, +the pipeline's return status is the value of the last (rightmost) +command to exit with a non-zero status, or zero if all commands exit +successfully. If the reserved word `!' precedes the pipeline, the exit +status is the logical negation of the exit status as described above. +The shell waits for all commands in the pipeline to terminate before +returning a value. + + +File: bashref.info, Node: Lists, Next: Compound Commands, Prev: Pipelines, Up: Shell Commands + +3.2.3 Lists of Commands +----------------------- + +A `list' is a sequence of one or more pipelines separated by one of the +operators `;', `&', `&&', or `||', and optionally terminated by one of +`;', `&', or a `newline'. + + Of these list operators, `&&' and `||' have equal precedence, +followed by `;' and `&', which have equal precedence. + + A sequence of one or more newlines may appear in a `list' to delimit +commands, equivalent to a semicolon. + + If a command is terminated by the control operator `&', the shell +executes the command asynchronously in a subshell. This is known as +executing the command in the BACKGROUND. The shell does not wait for +the command to finish, and the return status is 0 (true). When job +control is not active (*note Job Control::), the standard input for +asynchronous commands, in the absence of any explicit redirections, is +redirected from `/dev/null'. + + Commands separated by a `;' are executed sequentially; the shell +waits for each command to terminate in turn. The return status is the +exit status of the last command executed. + + AND and OR lists are sequences of one or more pipelines separated by +the control operators `&&' and `||', respectively. AND and OR lists +are executed with left associativity. + + An AND list has the form + COMMAND1 && COMMAND2 + +COMMAND2 is executed if, and only if, COMMAND1 returns an exit status +of zero. + + An OR list has the form + COMMAND1 || COMMAND2 + +COMMAND2 is executed if, and only if, COMMAND1 returns a non-zero exit +status. + + The return status of AND and OR lists is the exit status of the last +command executed in the list. + + +File: bashref.info, Node: Compound Commands, Next: Coprocesses, Prev: Lists, Up: Shell Commands + +3.2.4 Compound Commands +----------------------- + +* Menu: + +* Looping Constructs:: Shell commands for iterative action. +* Conditional Constructs:: Shell commands for conditional execution. +* Command Grouping:: Ways to group commands. + + Compound commands are the shell programming constructs. Each +construct begins with a reserved word or control operator and is +terminated by a corresponding reserved word or operator. Any +redirections (*note Redirections::) associated with a compound command +apply to all commands within that compound command unless explicitly +overridden. + + In most cases a list of commands in a compound command's description +may be separated from the rest of the command by one or more newlines, +and may be followed by a newline in place of a semicolon. + + Bash provides looping constructs, conditional commands, and +mechanisms to group commands and execute them as a unit. + + +File: bashref.info, Node: Looping Constructs, Next: Conditional Constructs, Up: Compound Commands + +3.2.4.1 Looping Constructs +.......................... + +Bash supports the following looping constructs. + + Note that wherever a `;' appears in the description of a command's +syntax, it may be replaced with one or more newlines. + +`until' + The syntax of the `until' command is: + + until TEST-COMMANDS; do CONSEQUENT-COMMANDS; done + + Execute CONSEQUENT-COMMANDS as long as TEST-COMMANDS has an exit + status which is not zero. The return status is the exit status of + the last command executed in CONSEQUENT-COMMANDS, or zero if none + was executed. + +`while' + The syntax of the `while' command is: + + while TEST-COMMANDS; do CONSEQUENT-COMMANDS; done + + Execute CONSEQUENT-COMMANDS as long as TEST-COMMANDS has an exit + status of zero. The return status is the exit status of the last + command executed in CONSEQUENT-COMMANDS, or zero if none was + executed. + +`for' + The syntax of the `for' command is: + + for NAME [ [in [WORDS ...] ] ; ] do COMMANDS; done + + Expand WORDS, and execute COMMANDS once for each member in the + resultant list, with NAME bound to the current member. If `in + WORDS' is not present, the `for' command executes the COMMANDS + once for each positional parameter that is set, as if `in "$@"' + had been specified (*note Special Parameters::). The return + status is the exit status of the last command that executes. If + there are no items in the expansion of WORDS, no commands are + executed, and the return status is zero. + + An alternate form of the `for' command is also supported: + + for (( EXPR1 ; EXPR2 ; EXPR3 )) ; do COMMANDS ; done + + First, the arithmetic expression EXPR1 is evaluated according to + the rules described below (*note Shell Arithmetic::). The + arithmetic expression EXPR2 is then evaluated repeatedly until it + evaluates to zero. Each time EXPR2 evaluates to a non-zero value, + COMMANDS are executed and the arithmetic expression EXPR3 is + evaluated. If any expression is omitted, it behaves as if it + evaluates to 1. The return value is the exit status of the last + command in COMMANDS that is executed, or false if any of the + expressions is invalid. + + The `break' and `continue' builtins (*note Bourne Shell Builtins::) +may be used to control loop execution. + + +File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Prev: Looping Constructs, Up: Compound Commands + +3.2.4.2 Conditional Constructs +.............................. + +`if' + The syntax of the `if' command is: + + if TEST-COMMANDS; then + CONSEQUENT-COMMANDS; + [elif MORE-TEST-COMMANDS; then + MORE-CONSEQUENTS;] + [else ALTERNATE-CONSEQUENTS;] + fi + + The TEST-COMMANDS list is executed, and if its return status is + zero, the CONSEQUENT-COMMANDS list is executed. If TEST-COMMANDS + returns a non-zero status, each `elif' list is executed in turn, + and if its exit status is zero, the corresponding MORE-CONSEQUENTS + is executed and the command completes. If `else + ALTERNATE-CONSEQUENTS' is present, and the final command in the + final `if' or `elif' clause has a non-zero exit status, then + ALTERNATE-CONSEQUENTS is executed. The return status is the exit + status of the last command executed, or zero if no condition + tested true. + +`case' + The syntax of the `case' command is: + + case WORD in [ [(] PATTERN [| PATTERN]...) COMMAND-LIST ;;]... esac + + `case' will selectively execute the COMMAND-LIST corresponding to + the first PATTERN that matches WORD. If the shell option + `nocasematch' (see the description of `shopt' in *note The Shopt + Builtin::) is enabled, the match is performed without regard to + the case of alphabetic characters. The `|' is used to separate + multiple patterns, and the `)' operator terminates a pattern list. + A list of patterns and an associated command-list is known as a + CLAUSE. + + Each clause must be terminated with `;;', `;&', or `;;&'. The + WORD undergoes tilde expansion, parameter expansion, command + substitution, arithmetic expansion, and quote removal before + matching is attempted. Each PATTERN undergoes tilde expansion, + parameter expansion, command substitution, and arithmetic + expansion. + + There may be an arbitrary number of `case' clauses, each terminated + by a `;;', `;&', or `;;&'. The first pattern that matches + determines the command-list that is executed. It's a common idiom + to use `*' as the final pattern to define the default case, since + that pattern will always match. + + Here is an example using `case' in a script that could be used to + describe one interesting feature of an animal: + + echo -n "Enter the name of an animal: " + read ANIMAL + echo -n "The $ANIMAL has " + case $ANIMAL in + horse | dog | cat) echo -n "four";; + man | kangaroo ) echo -n "two";; + *) echo -n "an unknown number of";; + esac + echo " legs." + + If the `;;' operator is used, no subsequent matches are attempted + after the first pattern match. Using `;&' in place of `;;' + causes execution to continue with the COMMAND-LIST associated with + the next clause, if any. Using `;;&' in place of `;;' causes the + shell to test the patterns in the next clause, if any, and execute + any associated COMMAND-LIST on a successful match. + + The return status is zero if no PATTERN is matched. Otherwise, the + return status is the exit status of the COMMAND-LIST executed. + +`select' + The `select' construct allows the easy generation of menus. It + has almost the same syntax as the `for' command: + + select NAME [in WORDS ...]; do COMMANDS; done + + The list of words following `in' is expanded, generating a list of + items. The set of expanded words is printed on the standard error + output stream, each preceded by a number. If the `in WORDS' is + omitted, the positional parameters are printed, as if `in "$@"' + had been specified. The `PS3' prompt is then displayed and a line + is read from the standard input. If the line consists of a number + corresponding to one of the displayed words, then the value of + NAME is set to that word. If the line is empty, the words and + prompt are displayed again. If `EOF' is read, the `select' + command completes. Any other value read causes NAME to be set to + null. The line read is saved in the variable `REPLY'. + + The COMMANDS are executed after each selection until a `break' + command is executed, at which point the `select' command completes. + + Here is an example that allows the user to pick a filename from the + current directory, and displays the name and index of the file + selected. + + select fname in *; + do + echo you picked $fname \($REPLY\) + break; + done + +`((...))' + (( EXPRESSION )) + + The arithmetic EXPRESSION is evaluated according to the rules + described below (*note Shell Arithmetic::). If the value of the + expression is non-zero, the return status is 0; otherwise the + return status is 1. This is exactly equivalent to + let "EXPRESSION" + *Note Bash Builtins::, for a full description of the `let' builtin. + +`[[...]]' + [[ EXPRESSION ]] + + Return a status of 0 or 1 depending on the evaluation of the + conditional expression EXPRESSION. Expressions are composed of + the primaries described below in *note Bash Conditional + Expressions::. Word splitting and filename expansion are not + performed on the words between the `[[' and `]]'; tilde expansion, + parameter and variable expansion, arithmetic expansion, command + substitution, process substitution, and quote removal are + performed. Conditional operators such as `-f' must be unquoted to + be recognized as primaries. + + When used with `[[', the `<' and `>' operators sort + lexicographically using the current locale. + + When the `==' and `!=' operators are used, the string to the right + of the operator is considered a pattern and matched according to + the rules described below in *note Pattern Matching::, as if the + `extglob' shell option were enabled. The `=' operator is + identical to `=='. If the shell option `nocasematch' (see the + description of `shopt' in *note The Shopt Builtin::) is enabled, + the match is performed without regard to the case of alphabetic + characters. The return value is 0 if the string matches (`==') or + does not match (`!=')the pattern, and 1 otherwise. Any part of + the pattern may be quoted to force the quoted portion to be + matched as a string. + + An additional binary operator, `=~', is available, with the same + precedence as `==' and `!='. When it is used, the string to the + right of the operator is considered an extended regular expression + and matched accordingly (as in regex3)). The return value is 0 if + the string matches the pattern, and 1 otherwise. If the regular + expression is syntactically incorrect, the conditional + expression's return value is 2. If the shell option `nocasematch' + (see the description of `shopt' in *note The Shopt Builtin::) is + enabled, the match is performed without regard to the case of + alphabetic characters. Any part of the pattern may be quoted to + force the quoted portion to be matched as a string. Bracket + expressions in regular expressions must be treated carefully, + since normal quoting characters lose their meanings between + brackets. If the pattern is stored in a shell variable, quoting + the variable expansion forces the entire pattern to be matched as + a string. Substrings matched by parenthesized subexpressions + within the regular expression are saved in the array variable + `BASH_REMATCH'. The element of `BASH_REMATCH' with index 0 is the + portion of the string matching the entire regular expression. The + element of `BASH_REMATCH' with index N is the portion of the + string matching the Nth parenthesized subexpression. + + For example, the following will match a line (stored in the shell + variable LINE) if there is a sequence of characters in the value + consisting of any number, including zero, of space characters, + zero or one instances of `a', then a `b': + [[ $line =~ [[:space:]]*(a)?b ]] + + That means values like `aab' and ` aaaaaab' will match, as will a + line containing a `b' anywhere in its value. + + Storing the regular expression in a shell variable is often a + useful way to avoid problems with quoting characters that are + special to the shell. It is sometimes difficult to specify a + regular expression literally without using quotes, or to keep + track of the quoting used by regular expressions while paying + attention to the shell's quote removal. Using a shell variable to + store the pattern decreases these problems. For example, the + following is equivalent to the above: + pattern='[[:space:]]*(a)?b' + [[ $line =~ $pattern ]] + + If you want to match a character that's special to the regular + expression grammar, it has to be quoted to remove its special + meaning. This means that in the pattern `xxx.txt', the `.' + matches any character in the string (its usual regular expression + meaning), but in the pattern `"xxx.txt"' it can only match a + literal `.'. Shell programmers should take special care with + backslashes, since backslashes are used both by the shell and + regular expressions to remove the special meaning from the + following character. The following two sets of commands are _not_ + equivalent: + pattern='\.' + + [[ . =~ $pattern ]] + [[ . =~ \. ]] + + [[ . =~ "$pattern" ]] + [[ . =~ '\.' ]] + + The first two matches will succeed, but the second two will not, + because in the second two the backslash will be part of the + pattern to be matched. In the first two examples, the backslash + removes the special meaning from `.', so the literal `.' matches. + If the string in the first examples were anything other than `.', + say `a', the pattern would not match, because the quoted `.' in the + pattern loses its special meaning of matching any single character. + + Expressions may be combined using the following operators, listed + in decreasing order of precedence: + + `( EXPRESSION )' + Returns the value of EXPRESSION. This may be used to + override the normal precedence of operators. + + `! EXPRESSION' + True if EXPRESSION is false. + + `EXPRESSION1 && EXPRESSION2' + True if both EXPRESSION1 and EXPRESSION2 are true. + + `EXPRESSION1 || EXPRESSION2' + True if either EXPRESSION1 or EXPRESSION2 is true. + + The `&&' and `||' operators do not evaluate EXPRESSION2 if the + value of EXPRESSION1 is sufficient to determine the return value + of the entire conditional expression. + + +File: bashref.info, Node: Command Grouping, Prev: Conditional Constructs, Up: Compound Commands + +3.2.4.3 Grouping Commands +......................... + +Bash provides two ways to group a list of commands to be executed as a +unit. When commands are grouped, redirections may be applied to the +entire command list. For example, the output of all the commands in +the list may be redirected to a single stream. + +`()' + ( LIST ) + + Placing a list of commands between parentheses causes a subshell + environment to be created (*note Command Execution Environment::), + and each of the commands in LIST to be executed in that subshell. + Since the LIST is executed in a subshell, variable assignments do + not remain in effect after the subshell completes. + +`{}' + { LIST; } + + Placing a list of commands between curly braces causes the list to + be executed in the current shell context. No subshell is created. + The semicolon (or newline) following LIST is required. + + In addition to the creation of a subshell, there is a subtle +difference between these two constructs due to historical reasons. The +braces are `reserved words', so they must be separated from the LIST by +`blank's or other shell metacharacters. The parentheses are +`operators', and are recognized as separate tokens by the shell even if +they are not separated from the LIST by whitespace. + + The exit status of both of these constructs is the exit status of +LIST. + + +File: bashref.info, Node: Coprocesses, Next: GNU Parallel, Prev: Compound Commands, Up: Shell Commands + +3.2.5 Coprocesses +----------------- + +A `coprocess' is a shell command preceded by the `coproc' reserved word. +A coprocess is executed asynchronously in a subshell, as if the command +had been terminated with the `&' control operator, with a two-way pipe +established between the executing shell and the coprocess. + + The format for a coprocess is: + coproc [NAME] COMMAND [REDIRECTIONS] + +This creates a coprocess named NAME. If NAME is not supplied, the +default name is COPROC. NAME must not be supplied if COMMAND is a +simple command (*note Simple Commands::); otherwise, it is interpreted +as the first word of the simple command. + + When the coprocess is executed, the shell creates an array variable +(*note Arrays::) named `NAME' in the context of the executing shell. +The standard output of COMMAND is connected via a pipe to a file +descriptor in the executing shell, and that file descriptor is assigned +to `NAME'[0]. The standard input of COMMAND is connected via a pipe to +a file descriptor in the executing shell, and that file descriptor is +assigned to `NAME'[1]. This pipe is established before any +redirections specified by the command (*note Redirections::). The file +descriptors can be utilized as arguments to shell commands and +redirections using standard word expansions. The file descriptors are +not available in subshells. + + The process ID of the shell spawned to execute the coprocess is +available as the value of the variable `NAME'_PID. The `wait' builtin +command may be used to wait for the coprocess to terminate. + + Since the coprocess is created as an asynchronous command, the +`coproc' command always returns success. The return status of a +coprocess is the exit status of COMMAND. + + +File: bashref.info, Node: GNU Parallel, Prev: Coprocesses, Up: Shell Commands + +3.2.6 GNU Parallel +------------------ + +There are ways to run commands in parallel that are not built into Bash. +GNU Parallel is a tool to do just that. + + GNU Parallel, as its name suggests, can be used to build and run +commands in parallel. You may run the same command with different +arguments, whether they are filenames, usernames, hostnames, or lines +read from files. GNU Parallel provides shorthand references to many of +the most common operations (input lines, various portions of the input +line, different ways to specify the input source, and so on). Parallel +can replace `xargs' or feed commands from its input sources to several +different instances of Bash. + + For a complete description, refer to the GNU Parallel documentation. +A few examples should provide a brief introduction to its use. + + For example, it is easy to replace `xargs' to gzip all html files in +the current directory and its subdirectories: + find . -type f -name '*.html' -print | parallel gzip + If you need to protect special characters such as newlines in file +names, use find's `-print0' option and parallel's `-0' option. + + You can use Parallel to move files from the current directory when +the number of files is too large to process with one `mv' invocation: + ls | parallel mv {} destdir + + As you can see, the {} is replaced with each line read from standard +input. While using `ls' will work in most instances, it is not +sufficient to deal with all filenames. If you need to accommodate +special characters in filenames, you can use + + find . -depth 1 \! -name '.*' -print0 | parallel -0 mv {} destdir + +as alluded to above. + + This will run as many `mv' commands as there are files in the current +directory. You can emulate a parallel `xargs' by adding the `-X' +option: + find . -depth 1 \! -name '.*' -print0 | parallel -0 -X mv {} destdir + + GNU Parallel can replace certain common idioms that operate on lines +read from a file (in this case, filenames listed one per line): + while IFS= read -r x; do + do-something1 "$x" "config-$x" + do-something2 < "$x" + done < file | process-output + +with a more compact syntax reminiscent of lambdas: + cat list | parallel "do-something1 {} config-{} ; do-something2 < {}" | process-output + + Parallel provides a built-in mechanism to remove filename +extensions, which lends itself to batch file transformations or +renaming: + ls *.gz | parallel -j+0 "zcat {} | bzip2 >{.}.bz2 && rm {}" + This will recompress all files in the current directory with names +ending in .gz using bzip2, running one job per CPU (-j+0) in parallel. +(We use `ls' for brevity here; using `find' as above is more robust in +the face of filenames containing unexpected characters.) Parallel can +take arguments from the command line; the above can also be written as + + parallel "zcat {} | bzip2 >{.}.bz2 && rm {}" ::: *.gz + + If a command generates output, you may want to preserve the input +order in the output. For instance, the following command + { echo foss.org.my ; echo debian.org; echo freenetproject.org; } | parallel traceroute + will display as output the traceroute invocation that finishes first. +Adding the `-k' option + { echo foss.org.my ; echo debian.org; echo freenetproject.org; } | parallel -k traceroute + will ensure that the output of `traceroute foss.org.my' is displayed +first. + + Finally, Parallel can be used to run a sequence of shell commands in +parallel, similar to `cat file | bash'. It is not uncommon to take a +list of filenames, create a series of shell commands to operate on +them, and feed that list of commnds to a shell. Parallel can speed +this up. Assuming that `file' contains a list of shell commands, one +per line, + + parallel -j 10 < file + +will evaluate the commands using the shell (since no explicit command is +supplied as an argument), in blocks of ten shell jobs at a time. + + +File: bashref.info, Node: Shell Functions, Next: Shell Parameters, Prev: Shell Commands, Up: Basic Shell Features + +3.3 Shell Functions +=================== + +Shell functions are a way to group commands for later execution using a +single name for the group. They are executed just like a "regular" +command. When the name of a shell function is used as a simple command +name, the list of commands associated with that function name is +executed. Shell functions are executed in the current shell context; +no new process is created to interpret them. + + Functions are declared using this syntax: + NAME () COMPOUND-COMMAND [ REDIRECTIONS ] + + or + + function NAME [()] COMPOUND-COMMAND [ REDIRECTIONS ] + + This defines a shell function named NAME. The reserved word +`function' is optional. If the `function' reserved word is supplied, +the parentheses are optional. The BODY of the function is the compound +command COMPOUND-COMMAND (*note Compound Commands::). That command is +usually a LIST enclosed between { and }, but may be any compound +command listed above. COMPOUND-COMMAND is executed whenever NAME is +specified as the name of a command. When the shell is in POSIX mode +(*note Bash POSIX Mode::), NAME may not be the same as one of the +special builtins (*note Special Builtins::). Any redirections (*note +Redirections::) associated with the shell function are performed when +the function is executed. + + A function definition may be deleted using the `-f' option to the +`unset' builtin (*note Bourne Shell Builtins::). + + The exit status of a function definition is zero unless a syntax +error occurs or a readonly function with the same name already exists. +When executed, the exit status of a function is the exit status of the +last command executed in the body. + + Note that for historical reasons, in the most common usage the curly +braces that surround the body of the function must be separated from +the body by `blank's or newlines. This is because the braces are +reserved words and are only recognized as such when they are separated +from the command list by whitespace or another shell metacharacter. +Also, when using the braces, the LIST must be terminated by a semicolon, +a `&', or a newline. + + When a function is executed, the arguments to the function become +the positional parameters during its execution (*note Positional +Parameters::). The special parameter `#' that expands to the number of +positional parameters is updated to reflect the change. Special +parameter `0' is unchanged. The first element of the `FUNCNAME' +variable is set to the name of the function while the function is +executing. + + All other aspects of the shell execution environment are identical +between a function and its caller with these exceptions: the `DEBUG' +and `RETURN' traps are not inherited unless the function has been given +the `trace' attribute using the `declare' builtin or the `-o functrace' +option has been enabled with the `set' builtin, (in which case all +functions inherit the `DEBUG' and `RETURN' traps), and the `ERR' trap +is not inherited unless the `-o errtrace' shell option has been enabled. +*Note Bourne Shell Builtins::, for the description of the `trap' +builtin. + + The `FUNCNEST' variable, if set to a numeric value greater than 0, +defines a maximum function nesting level. Function invocations that +exceed the limit cause the entire command to abort. + + If the builtin command `return' is executed in a function, the +function completes and execution resumes with the next command after +the function call. Any command associated with the `RETURN' trap is +executed before execution resumes. When a function completes, the +values of the positional parameters and the special parameter `#' are +restored to the values they had prior to the function's execution. If +a numeric argument is given to `return', that is the function's return +status; otherwise the function's return status is the exit status of +the last command executed before the `return'. + + Variables local to the function may be declared with the `local' +builtin. These variables are visible only to the function and the +commands it invokes. + + Function names and definitions may be listed with the `-f' option to +the `declare' (`typeset') builtin command (*note Bash Builtins::). The +`-F' option to `declare' or `typeset' will list the function names only +(and optionally the source file and line number, if the `extdebug' +shell option is enabled). Functions may be exported so that subshells +automatically have them defined with the `-f' option to the `export' +builtin (*note Bourne Shell Builtins::). Note that shell functions and +variables with the same name may result in multiple identically-named +entries in the environment passed to the shell's children. Care should +be taken in cases where this may cause a problem. + + Functions may be recursive. The `FUNCNEST' variable may be used to +limit the depth of the function call stack and restrict the number of +function invocations. By default, no limit is placed on the number of +recursive calls. + + +File: bashref.info, Node: Shell Parameters, Next: Shell Expansions, Prev: Shell Functions, Up: Basic Shell Features + +3.4 Shell Parameters +==================== + +* Menu: + +* Positional Parameters:: The shell's command-line arguments. +* Special Parameters:: Parameters denoted by special characters. + + A PARAMETER is an entity that stores values. It can be a `name', a +number, or one of the special characters listed below. A VARIABLE is a +parameter denoted by a `name'. A variable has a VALUE and zero or more +ATTRIBUTES. Attributes are assigned using the `declare' builtin command +(see the description of the `declare' builtin in *note Bash Builtins::). + + A parameter is set if it has been assigned a value. The null string +is a valid value. Once a variable is set, it may be unset only by using +the `unset' builtin command. + + A variable may be assigned to by a statement of the form + NAME=[VALUE] + If VALUE is not given, the variable is assigned the null string. All +VALUEs undergo tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote removal (detailed +below). If the variable has its `integer' attribute set, then VALUE is +evaluated as an arithmetic expression even if the `$((...))' expansion +is not used (*note Arithmetic Expansion::). Word splitting is not +performed, with the exception of `"$@"' as explained below. Filename +expansion is not performed. Assignment statements may also appear as +arguments to the `alias', `declare', `typeset', `export', `readonly', +and `local' builtin commands. When in POSIX mode (*note Bash POSIX +Mode::), these builtins may appear in a command after one or more +instances of the `command' builtin and retain these assignment +statement properties. + + In the context where an assignment statement is assigning a value to +a shell variable or array index (*note Arrays::), the `+=' operator can +be used to append to or add to the variable's previous value. When +`+=' is applied to a variable for which the INTEGER attribute has been +set, VALUE is evaluated as an arithmetic expression and added to the +variable's current value, which is also evaluated. When `+=' is +applied to an array variable using compound assignment (*note +Arrays::), the variable's value is not unset (as it is when using `='), +and new values are appended to the array beginning at one greater than +the array's maximum index (for indexed arrays), or added as additional +key-value pairs in an associative array. When applied to a +string-valued variable, VALUE is expanded and appended to the +variable's value. + + A variable can be assigned the NAMEREF attribute using the `-n' +option to the \fBdeclare\fP or \fBlocal\fP builtin commands (*note Bash +Builtins::) to create a NAMEREF, or a reference to another variable. +This allows variables to be manipulated indirectly. Whenever the +nameref variable is referenced or assigned to, the operation is +actually performed on the variable specified by the nameref variable's +value. A nameref is commonly used within shell functions to refer to a +variable whose name is passed as an argument to the function. For +instance, if a variable name is passed to a shell function as its first +argument, running + declare -n ref=$1 + inside the function creates a nameref variable REF whose value is +the variable name passed as the first argument. References and +assignments to REF are treated as references and assignments to the +variable whose name was passed as `$1'. + + If the control variable in a `for' loop has the nameref attribute, +the list of words can be a list of shell variables, and a name reference +will be established for each word in the list, in turn, when the loop is +executed. Array variables cannot be given the `-n' attribute. +However, nameref variables can reference array variables and subscripted +array variables. Namerefs can be unset using the `-n' option to the +`unset' builtin (*note Bourne Shell Builtins::). Otherwise, if `unset' +is executed with the name of a nameref variable as an argument, the +variable referenced by the nameref variable will be unset. + + +File: bashref.info, Node: Positional Parameters, Next: Special Parameters, Up: Shell Parameters + +3.4.1 Positional Parameters +--------------------------- + +A POSITIONAL PARAMETER is a parameter denoted by one or more digits, +other than the single digit `0'. Positional parameters are assigned +from the shell's arguments when it is invoked, and may be reassigned +using the `set' builtin command. Positional parameter `N' may be +referenced as `${N}', or as `$N' when `N' consists of a single digit. +Positional parameters may not be assigned to with assignment statements. +The `set' and `shift' builtins are used to set and unset them (*note +Shell Builtin Commands::). The positional parameters are temporarily +replaced when a shell function is executed (*note Shell Functions::). + + When a positional parameter consisting of more than a single digit +is expanded, it must be enclosed in braces. + + +File: bashref.info, Node: Special Parameters, Prev: Positional Parameters, Up: Shell Parameters + +3.4.2 Special Parameters +------------------------ + +The shell treats several parameters specially. These parameters may +only be referenced; assignment to them is not allowed. + +`*' + ($*) Expands to the positional parameters, starting from one. + When the expansion is not within double quotes, each positional + parameter expands to a separate word. In contexts where it is + performed, those words are subject to further word splitting and + pathname expansion. When the expansion occurs within double + quotes, it expands to a single word with the value of each + parameter separated by the first character of the `IFS' special + variable. That is, `"$*"' is equivalent to `"$1C$2C..."', where C + is the first character of the value of the `IFS' variable. If + `IFS' is unset, the parameters are separated by spaces. If `IFS' + is null, the parameters are joined without intervening separators. + +`@' + ($@) Expands to the positional parameters, starting from one. + When the expansion occurs within double quotes, each parameter + expands to a separate word. That is, `"$@"' is equivalent to + `"$1" "$2" ...'. If the double-quoted expansion occurs within a + word, the expansion of the first parameter is joined with the + beginning part of the original word, and the expansion of the last + parameter is joined with the last part of the original word. When + there are no positional parameters, `"$@"' and `$@' expand to + nothing (i.e., they are removed). + +`#' + ($#) Expands to the number of positional parameters in decimal. + +`?' + ($?) Expands to the exit status of the most recently executed + foreground pipeline. + +`-' + ($-, a hyphen.) Expands to the current option flags as specified + upon invocation, by the `set' builtin command, or those set by the + shell itself (such as the `-i' option). + +`$' + ($$) Expands to the process ID of the shell. In a `()' subshell, + it expands to the process ID of the invoking shell, not the + subshell. + +`!' + ($!) Expands to the process ID of the job most recently placed + into the background, whether executed as an asynchronous command + or using the `bg' builtin (*note Job Control Builtins::). + +`0' + ($0) Expands to the name of the shell or shell script. This is + set at shell initialization. If Bash is invoked with a file of + commands (*note Shell Scripts::), `$0' is set to the name of that + file. If Bash is started with the `-c' option (*note Invoking + Bash::), then `$0' is set to the first argument after the string + to be executed, if one is present. Otherwise, it is set to the + filename used to invoke Bash, as given by argument zero. + +`_' + ($_, an underscore.) At shell startup, set to the absolute + pathname used to invoke the shell or shell script being executed + as passed in the environment or argument list. Subsequently, + expands to the last argument to the previous command, after + expansion. Also set to the full pathname used to invoke each + command executed and placed in the environment exported to that + command. When checking mail, this parameter holds the name of the + mail file. + + +File: bashref.info, Node: Shell Expansions, Next: Redirections, Prev: Shell Parameters, Up: Basic Shell Features + +3.5 Shell Expansions +==================== + +Expansion is performed on the command line after it has been split into +`token's. There are seven kinds of expansion performed: + + * brace expansion + + * tilde expansion + + * parameter and variable expansion + + * command substitution + + * arithmetic expansion + + * word splitting + + * filename expansion + +* Menu: + +* Brace Expansion:: Expansion of expressions within braces. +* Tilde Expansion:: Expansion of the ~ character. +* Shell Parameter Expansion:: How Bash expands variables to their values. +* Command Substitution:: Using the output of a command as an argument. +* Arithmetic Expansion:: How to use arithmetic in shell expansions. +* Process Substitution:: A way to write and read to and from a + command. +* Word Splitting:: How the results of expansion are split into separate + arguments. +* Filename Expansion:: A shorthand for specifying filenames matching patterns. +* Quote Removal:: How and when quote characters are removed from + words. + + The order of expansions is: brace expansion; tilde expansion, +parameter and variable expansion, arithmetic expansion, and command +substitution (done in a left-to-right fashion); word splitting; and +filename expansion. + + On systems that can support it, there is an additional expansion +available: PROCESS SUBSTITUTION. This is performed at the same time as +tilde, parameter, variable, and arithmetic expansion and command +substitution. + + Only brace expansion, word splitting, and filename expansion can +change the number of words of the expansion; other expansions expand a +single word to a single word. The only exceptions to this are the +expansions of `"$@"' (*note Special Parameters::) and `"${NAME[@]}"' +(*note Arrays::). + + After all expansions, `quote removal' (*note Quote Removal::) is +performed. + + +File: bashref.info, Node: Brace Expansion, Next: Tilde Expansion, Up: Shell Expansions + +3.5.1 Brace Expansion +--------------------- + +Brace expansion is a mechanism by which arbitrary strings may be +generated. This mechanism is similar to FILENAME EXPANSION (*note +Filename Expansion::), but the filenames generated need not exist. +Patterns to be brace expanded take the form of an optional PREAMBLE, +followed by either a series of comma-separated strings or a sequence +expression between a pair of braces, followed by an optional POSTSCRIPT. +The preamble is prefixed to each string contained within the braces, and +the postscript is then appended to each resulting string, expanding left +to right. + + Brace expansions may be nested. The results of each expanded string +are not sorted; left to right order is preserved. For example, + bash$ echo a{d,c,b}e + ade ace abe + + A sequence expression takes the form `{X..Y[..INCR]}', where X and Y +are either integers or single characters, and INCR, an optional +increment, is an integer. When integers are supplied, the expression +expands to each number between X and Y, inclusive. Supplied integers +may be prefixed with `0' to force each term to have the same width. +When either X or Y begins with a zero, the shell attempts to force all +generated terms to contain the same number of digits, zero-padding +where necessary. When characters are supplied, the expression expands +to each character lexicographically between X and Y, inclusive, using +the default C locale. Note that both X and Y must be of the same type. +When the increment is supplied, it is used as the difference between +each term. The default increment is 1 or -1 as appropriate. + + Brace expansion is performed before any other expansions, and any +characters special to other expansions are preserved in the result. It +is strictly textual. Bash does not apply any syntactic interpretation +to the context of the expansion or the text between the braces. To +avoid conflicts with parameter expansion, the string `${' is not +considered eligible for brace expansion. + + A correctly-formed brace expansion must contain unquoted opening and +closing braces, and at least one unquoted comma or a valid sequence +expression. Any incorrectly formed brace expansion is left unchanged. + + A { or `,' may be quoted with a backslash to prevent its being +considered part of a brace expression. To avoid conflicts with +parameter expansion, the string `${' is not considered eligible for +brace expansion. + + This construct is typically used as shorthand when the common prefix +of the strings to be generated is longer than in the above example: + mkdir /usr/local/src/bash/{old,new,dist,bugs} + or + chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} + + +File: bashref.info, Node: Tilde Expansion, Next: Shell Parameter Expansion, Prev: Brace Expansion, Up: Shell Expansions + +3.5.2 Tilde Expansion +--------------------- + +If a word begins with an unquoted tilde character (`~'), all of the +characters up to the first unquoted slash (or all characters, if there +is no unquoted slash) are considered a TILDE-PREFIX. If none of the +characters in the tilde-prefix are quoted, the characters in the +tilde-prefix following the tilde are treated as a possible LOGIN NAME. +If this login name is the null string, the tilde is replaced with the +value of the `HOME' shell variable. If `HOME' is unset, the home +directory of the user executing the shell is substituted instead. +Otherwise, the tilde-prefix is replaced with the home directory +associated with the specified login name. + + If the tilde-prefix is `~+', the value of the shell variable `PWD' +replaces the tilde-prefix. If the tilde-prefix is `~-', the value of +the shell variable `OLDPWD', if it is set, is substituted. + + If the characters following the tilde in the tilde-prefix consist of +a number N, optionally prefixed by a `+' or a `-', the tilde-prefix is +replaced with the corresponding element from the directory stack, as it +would be displayed by the `dirs' builtin invoked with the characters +following tilde in the tilde-prefix as an argument (*note The Directory +Stack::). If the tilde-prefix, sans the tilde, consists of a number +without a leading `+' or `-', `+' is assumed. + + If the login name is invalid, or the tilde expansion fails, the word +is left unchanged. + + Each variable assignment is checked for unquoted tilde-prefixes +immediately following a `:' or the first `='. In these cases, tilde +expansion is also performed. Consequently, one may use filenames with +tildes in assignments to `PATH', `MAILPATH', and `CDPATH', and the +shell assigns the expanded value. + + The following table shows how Bash treats unquoted tilde-prefixes: + +`~' + The value of `$HOME' + +`~/foo' + `$HOME/foo' + +`~fred/foo' + The subdirectory `foo' of the home directory of the user `fred' + +`~+/foo' + `$PWD/foo' + +`~-/foo' + `${OLDPWD-'~-'}/foo' + +`~N' + The string that would be displayed by `dirs +N' + +`~+N' + The string that would be displayed by `dirs +N' + +`~-N' + The string that would be displayed by `dirs -N' + + +File: bashref.info, Node: Shell Parameter Expansion, Next: Command Substitution, Prev: Tilde Expansion, Up: Shell Expansions + +3.5.3 Shell Parameter Expansion +------------------------------- + +The `$' character introduces parameter expansion, command substitution, +or arithmetic expansion. The parameter name or symbol to be expanded +may be enclosed in braces, which are optional but serve to protect the +variable to be expanded from characters immediately following it which +could be interpreted as part of the name. + + When braces are used, the matching ending brace is the first `}' not +escaped by a backslash or within a quoted string, and not within an +embedded arithmetic expansion, command substitution, or parameter +expansion. + + The basic form of parameter expansion is ${PARAMETER}. The value of +PARAMETER is substituted. The PARAMETER is a shell parameter as +described above (*note Shell Parameters::) or an array reference (*note +Arrays::). The braces are required when PARAMETER is a positional +parameter with more than one digit, or when PARAMETER is followed by a +character that is not to be interpreted as part of its name. + + If the first character of PARAMETER is an exclamation point (!), it +introduces a level of variable indirection. Bash uses the value of the +variable formed from the rest of PARAMETER as the name of the variable; +this variable is then expanded and that value is used in the rest of +the substitution, rather than the value of PARAMETER itself. This is +known as `indirect expansion'. The exceptions to this are the +expansions of ${!PREFIX*} and ${!NAME[@]} described below. The +exclamation point must immediately follow the left brace in order to +introduce indirection. + + In each of the cases below, WORD is subject to tilde expansion, +parameter expansion, command substitution, and arithmetic expansion. + + When not performing substring expansion, using the form described +below (e.g., `:-'), Bash tests for a parameter that is unset or null. +Omitting the colon results in a test only for a parameter that is unset. +Put another way, if the colon is included, the operator tests for both +PARAMETER's existence and that its value is not null; if the colon is +omitted, the operator tests only for existence. + +`${PARAMETER:-WORD}' + If PARAMETER is unset or null, the expansion of WORD is + substituted. Otherwise, the value of PARAMETER is substituted. + +`${PARAMETER:=WORD}' + If PARAMETER is unset or null, the expansion of WORD is assigned + to PARAMETER. The value of PARAMETER is then substituted. + Positional parameters and special parameters may not be assigned to + in this way. + +`${PARAMETER:?WORD}' + If PARAMETER is null or unset, the expansion of WORD (or a message + to that effect if WORD is not present) is written to the standard + error and the shell, if it is not interactive, exits. Otherwise, + the value of PARAMETER is substituted. + +`${PARAMETER:+WORD}' + If PARAMETER is null or unset, nothing is substituted, otherwise + the expansion of WORD is substituted. + +`${PARAMETER:OFFSET}' +`${PARAMETER:OFFSET:LENGTH}' + This is referred to as Substring Expansion. It expands to up to + LENGTH characters of the value of PARAMETER starting at the + character specified by OFFSET. If PARAMETER is `@', an indexed + array subscripted by `@' or `*', or an associative array name, the + results differ as described below. If LENGTH is omitted, it + expands to the substring of the value of PARAMETER starting at the + character specified by OFFSET and extending to the end of the + value. LENGTH and OFFSET are arithmetic expressions (*note Shell + Arithmetic::). + + If OFFSET evaluates to a number less than zero, the value is used + as an offset in characters from the end of the value of PARAMETER. + If LENGTH evaluates to a number less than zero, it is interpreted + as an offset in characters from the end of the value of PARAMETER + rather than a number of characters, and the expansion is the + characters between OFFSET and that result. Note that a negative + offset must be separated from the colon by at least one space to + avoid being confused with the `:-' expansion. + + Here are some examples illustrating substring expansion on + parameters and subscripted arrays: + + $ string=01234567890abcdefgh + $ echo ${string:7} + 7890abcdefgh + $ echo ${string:7:0} + + $ echo ${string:7:2} + 78 + $ echo ${string:7:-2} + 7890abcdef + $ echo ${string: -7} + bcdefgh + $ echo ${string: -7:0} + + $ echo ${string: -7:2} + bc + $ echo ${string: -7:-2} + bcdef + $ set -- 01234567890abcdefgh + $ echo ${1:7} + 7890abcdefgh + $ echo ${1:7:0} + + $ echo ${1:7:2} + 78 + $ echo ${1:7:-2} + 7890abcdef + $ echo ${1: -7} + bcdefgh + $ echo ${1: -7:0} + + $ echo ${1: -7:2} + bc + $ echo ${1: -7:-2} + bcdef + $ array[0]=01234567890abcdefgh + $ echo ${array[0]:7} + 7890abcdefgh + $ echo ${array[0]:7:0} + + $ echo ${array[0]:7:2} + 78 + $ echo ${array[0]:7:-2} + 7890abcdef + $ echo ${array[0]: -7} + bcdefgh + $ echo ${array[0]: -7:0} + + $ echo ${array[0]: -7:2} + bc + $ echo ${array[0]: -7:-2} + bcdef + + If PARAMETER is `@', the result is LENGTH positional parameters + beginning at OFFSET. A negative OFFSET is taken relative to one + greater than the greatest positional parameter, so an offset of -1 + evaluates to the last positional parameter. It is an expansion + error if LENGTH evaluates to a number less than zero. + + The following examples illustrate substring expansion using + positional parameters: + + $ set -- 1 2 3 4 5 6 7 8 9 0 a b c d e f g h + $ echo ${@:7} + 7 8 9 0 a b c d e f g h + $ echo ${@:7:0} + + $ echo ${@:7:2} + 7 8 + $ echo ${@:7:-2} + bash: -2: substring expression < 0 + $ echo ${@: -7:2} + b c + $ echo ${@:0} + ./bash 1 2 3 4 5 6 7 8 9 0 a b c d e f g h + $ echo ${@:0:2} + ./bash 1 + $ echo ${@: -7:0} + + If PARAMETER is an indexed array name subscripted by `@' or `*', + the result is the LENGTH members of the array beginning with + `${PARAMETER[OFFSET]}'. A negative OFFSET is taken relative to + one greater than the maximum index of the specified array. It is + an expansion error if LENGTH evaluates to a number less than zero. + + These examples show how you can use substring expansion with + indexed arrays: + + $ array=(0 1 2 3 4 5 6 7 8 9 0 a b c d e f g h) + $ echo ${array[@]:7} + 7 8 9 0 a b c d e f g h + $ echo ${array[@]:7:2} + 7 8 + $ echo ${array[@]: -7:2} + b c + $ echo ${array[@]: -7:-2} + bash: -2: substring expression < 0 + $ echo ${array[@]:0} + 0 1 2 3 4 5 6 7 8 9 0 a b c d e f g h + $ echo ${array[@]:0:2} + 0 1 + $ echo ${array[@]: -7:0} + + Substring expansion applied to an associative array produces + undefined results. + + Substring indexing is zero-based unless the positional parameters + are used, in which case the indexing starts at 1 by default. If + OFFSET is 0, and the positional parameters are used, `$@' is + prefixed to the list. + +`${!PREFIX*}' +`${!PREFIX@}' + Expands to the names of variables whose names begin with PREFIX, + separated by the first character of the `IFS' special variable. + When `@' is used and the expansion appears within double quotes, + each variable name expands to a separate word. + +`${!NAME[@]}' +`${!NAME[*]}' + If NAME is an array variable, expands to the list of array indices + (keys) assigned in NAME. If NAME is not an array, expands to 0 if + NAME is set and null otherwise. When `@' is used and the + expansion appears within double quotes, each key expands to a + separate word. + +`${#PARAMETER}' + The length in characters of the expanded value of PARAMETER is + substituted. If PARAMETER is `*' or `@', the value substituted is + the number of positional parameters. If PARAMETER is an array + name subscripted by `*' or `@', the value substituted is the + number of elements in the array. If PARAMETER is an indexed array + name subscripted by a negative number, that number is interpreted + as relative to one greater than the maximum index of PARAMETER, so + negative indices count back from the end of the array, and an + index of -1 references the last element. + +`${PARAMETER#WORD}' +`${PARAMETER##WORD}' + The WORD is expanded to produce a pattern just as in filename + expansion (*note Filename Expansion::). If the pattern matches + the beginning of the expanded value of PARAMETER, then the result + of the expansion is the expanded value of PARAMETER with the + shortest matching pattern (the `#' case) or the longest matching + pattern (the `##' case) deleted. If PARAMETER is `@' or `*', the + pattern removal operation is applied to each positional parameter + in turn, and the expansion is the resultant list. If PARAMETER is + an array variable subscripted with `@' or `*', the pattern removal + operation is applied to each member of the array in turn, and the + expansion is the resultant list. + +`${PARAMETER%WORD}' +`${PARAMETER%%WORD}' + The WORD is expanded to produce a pattern just as in filename + expansion. If the pattern matches a trailing portion of the + expanded value of PARAMETER, then the result of the expansion is + the value of PARAMETER with the shortest matching pattern (the `%' + case) or the longest matching pattern (the `%%' case) deleted. If + PARAMETER is `@' or `*', the pattern removal operation is applied + to each positional parameter in turn, and the expansion is the + resultant list. If PARAMETER is an array variable subscripted + with `@' or `*', the pattern removal operation is applied to each + member of the array in turn, and the expansion is the resultant + list. + +`${PARAMETER/PATTERN/STRING}' + The PATTERN is expanded to produce a pattern just as in filename + expansion. PARAMETER is expanded and the longest match of PATTERN + against its value is replaced with STRING. If PATTERN begins with + `/', all matches of PATTERN are replaced with STRING. Normally + only the first match is replaced. If PATTERN begins with `#', it + must match at the beginning of the expanded value of PARAMETER. + If PATTERN begins with `%', it must match at the end of the + expanded value of PARAMETER. If STRING is null, matches of + PATTERN are deleted and the `/' following PATTERN may be omitted. + If PARAMETER is `@' or `*', the substitution operation is applied + to each positional parameter in turn, and the expansion is the + resultant list. If PARAMETER is an array variable subscripted + with `@' or `*', the substitution operation is applied to each + member of the array in turn, and the expansion is the resultant + list. + +`${PARAMETER^PATTERN}' +`${PARAMETER^^PATTERN}' +`${PARAMETER,PATTERN}' +`${PARAMETER,,PATTERN}' + This expansion modifies the case of alphabetic characters in + PARAMETER. The PATTERN is expanded to produce a pattern just as in + filename expansion. Each character in the expanded value of + PARAMETER is tested against PATTERN, and, if it matches the + pattern, its case is converted. The pattern should not attempt to + match more than one character. The `^' operator converts + lowercase letters matching PATTERN to uppercase; the `,' operator + converts matching uppercase letters to lowercase. The `^^' and + `,,' expansions convert each matched character in the expanded + value; the `^' and `,' expansions match and convert only the first + character in the expanded value. If PATTERN is omitted, it is + treated like a `?', which matches every character. If PARAMETER + is `@' or `*', the case modification operation is applied to each + positional parameter in turn, and the expansion is the resultant + list. If PARAMETER is an array variable subscripted with `@' or + `*', the case modification operation is applied to each member of + the array in turn, and the expansion is the resultant list. + + +File: bashref.info, Node: Command Substitution, Next: Arithmetic Expansion, Prev: Shell Parameter Expansion, Up: Shell Expansions + +3.5.4 Command Substitution +-------------------------- + +Command substitution allows the output of a command to replace the +command itself. Command substitution occurs when a command is enclosed +as follows: + $(COMMAND) + or + `COMMAND` + +Bash performs the expansion by executing COMMAND and replacing the +command substitution with the standard output of the command, with any +trailing newlines deleted. Embedded newlines are not deleted, but they +may be removed during word splitting. The command substitution `$(cat +FILE)' can be replaced by the equivalent but faster `$(< FILE)'. + + When the old-style backquote form of substitution is used, backslash +retains its literal meaning except when followed by `$', ``', or `\'. +The first backquote not preceded by a backslash terminates the command +substitution. When using the `$(COMMAND)' form, all characters between +the parentheses make up the command; none are treated specially. + + Command substitutions may be nested. To nest when using the +backquoted form, escape the inner backquotes with backslashes. + + If the substitution appears within double quotes, word splitting and +filename expansion are not performed on the results. + + +File: bashref.info, Node: Arithmetic Expansion, Next: Process Substitution, Prev: Command Substitution, Up: Shell Expansions + +3.5.5 Arithmetic Expansion +-------------------------- + +Arithmetic expansion allows the evaluation of an arithmetic expression +and the substitution of the result. The format for arithmetic +expansion is: + + $(( EXPRESSION )) + + The expression is treated as if it were within double quotes, but a +double quote inside the parentheses is not treated specially. All +tokens in the expression undergo parameter and variable expansion, +command substitution, and quote removal. The result is treated as the +arithmetic expression to be evaluated. Arithmetic expansions may be +nested. + + The evaluation is performed according to the rules listed below +(*note Shell Arithmetic::). If the expression is invalid, Bash prints +a message indicating failure to the standard error and no substitution +occurs. + + +File: bashref.info, Node: Process Substitution, Next: Word Splitting, Prev: Arithmetic Expansion, Up: Shell Expansions + +3.5.6 Process Substitution +-------------------------- + +Process substitution is supported on systems that support named pipes +(FIFOs) or the `/dev/fd' method of naming open files. It takes the +form of + <(LIST) + or + >(LIST) + The process LIST is run with its input or output connected to a FIFO +or some file in `/dev/fd'. The name of this file is passed as an +argument to the current command as the result of the expansion. If the +`>(LIST)' form is used, writing to the file will provide input for +LIST. If the `<(LIST)' form is used, the file passed as an argument +should be read to obtain the output of LIST. Note that no space may +appear between the `<' or `>' and the left parenthesis, otherwise the +construct would be interpreted as a redirection. + + When available, process substitution is performed simultaneously with +parameter and variable expansion, command substitution, and arithmetic +expansion. + + +File: bashref.info, Node: Word Splitting, Next: Filename Expansion, Prev: Process Substitution, Up: Shell Expansions + +3.5.7 Word Splitting +-------------------- + +The shell scans the results of parameter expansion, command +substitution, and arithmetic expansion that did not occur within double +quotes for word splitting. + + The shell treats each character of `$IFS' as a delimiter, and splits +the results of the other expansions into words using these characters +as field terminators. If `IFS' is unset, or its value is exactly +`', the default, then sequences of ` ', +`', and `' at the beginning and end of the results of the +previous expansions are ignored, and any sequence of `IFS' characters +not at the beginning or end serves to delimit words. If `IFS' has a +value other than the default, then sequences of the whitespace +characters `space' and `tab' are ignored at the beginning and end of the +word, as long as the whitespace character is in the value of `IFS' (an +`IFS' whitespace character). Any character in `IFS' that is not `IFS' +whitespace, along with any adjacent `IFS' whitespace characters, +delimits a field. A sequence of `IFS' whitespace characters is also +treated as a delimiter. If the value of `IFS' is null, no word +splitting occurs. + + Explicit null arguments (`""' or `''') are retained. Unquoted +implicit null arguments, resulting from the expansion of parameters +that have no values, are removed. If a parameter with no value is +expanded within double quotes, a null argument results and is retained. + + Note that if no expansion occurs, no splitting is performed. + + +File: bashref.info, Node: Filename Expansion, Next: Quote Removal, Prev: Word Splitting, Up: Shell Expansions + +3.5.8 Filename Expansion +------------------------ + +* Menu: + +* Pattern Matching:: How the shell matches patterns. + + After word splitting, unless the `-f' option has been set (*note The +Set Builtin::), Bash scans each word for the characters `*', `?', and +`['. If one of these characters appears, then the word is regarded as +a PATTERN, and replaced with an alphabetically sorted list of filenames +matching the pattern (*note Pattern Matching::). If no matching +filenames are found, and the shell option `nullglob' is disabled, the +word is left unchanged. If the `nullglob' option is set, and no +matches are found, the word is removed. If the `failglob' shell option +is set, and no matches are found, an error message is printed and the +command is not executed. If the shell option `nocaseglob' is enabled, +the match is performed without regard to the case of alphabetic +characters. + + When a pattern is used for filename expansion, the character `.' at +the start of a filename or immediately following a slash must be +matched explicitly, unless the shell option `dotglob' is set. When +matching a filename, the slash character must always be matched +explicitly. In other cases, the `.' character is not treated specially. + + See the description of `shopt' in *note The Shopt Builtin::, for a +description of the `nocaseglob', `nullglob', `failglob', and `dotglob' +options. + + The `GLOBIGNORE' shell variable may be used to restrict the set of +filenames matching a pattern. If `GLOBIGNORE' is set, each matching +filename that also matches one of the patterns in `GLOBIGNORE' is +removed from the list of matches. The filenames `.' and `..' are +always ignored when `GLOBIGNORE' is set and not null. However, setting +`GLOBIGNORE' to a non-null value has the effect of enabling the +`dotglob' shell option, so all other filenames beginning with a `.' +will match. To get the old behavior of ignoring filenames beginning +with a `.', make `.*' one of the patterns in `GLOBIGNORE'. The +`dotglob' option is disabled when `GLOBIGNORE' is unset. + + +File: bashref.info, Node: Pattern Matching, Up: Filename Expansion + +3.5.8.1 Pattern Matching +........................ + +Any character that appears in a pattern, other than the special pattern +characters described below, matches itself. The NUL character may not +occur in a pattern. A backslash escapes the following character; the +escaping backslash is discarded when matching. The special pattern +characters must be quoted if they are to be matched literally. + + The special pattern characters have the following meanings: +`*' + Matches any string, including the null string. When the + `globstar' shell option is enabled, and `*' is used in a filename + expansion context, two adjacent `*'s used as a single pattern will + match all files and zero or more directories and subdirectories. + If followed by a `/', two adjacent `*'s will match only + directories and subdirectories. + +`?' + Matches any single character. + +`[...]' + Matches any one of the enclosed characters. A pair of characters + separated by a hyphen denotes a RANGE EXPRESSION; any character + that falls between those two characters, inclusive, using the + current locale's collating sequence and character set, is matched. + If the first character following the `[' is a `!' or a `^' then + any character not enclosed is matched. A `-' may be matched by + including it as the first or last character in the set. A `]' may + be matched by including it as the first character in the set. The + sorting order of characters in range expressions is determined by + the current locale and the values of the `LC_COLLATE' and `LC_ALL' + shell variables, if set. + + For example, in the default C locale, `[a-dx-z]' is equivalent to + `[abcdxyz]'. Many locales sort characters in dictionary order, + and in these locales `[a-dx-z]' is typically not equivalent to + `[abcdxyz]'; it might be equivalent to `[aBbCcDdxXyYz]', for + example. To obtain the traditional interpretation of ranges in + bracket expressions, you can force the use of the C locale by + setting the `LC_COLLATE' or `LC_ALL' environment variable to the + value `C', or enable the `globasciiranges' shell option. + + Within `[' and `]', CHARACTER CLASSES can be specified using the + syntax `[:'CLASS`:]', where CLASS is one of the following classes + defined in the POSIX standard: + alnum alpha ascii blank cntrl digit graph lower + print punct space upper word xdigit + A character class matches any character belonging to that class. + The `word' character class matches letters, digits, and the + character `_'. + + Within `[' and `]', an EQUIVALENCE CLASS can be specified using + the syntax `[='C`=]', which matches all characters with the same + collation weight (as defined by the current locale) as the + character C. + + Within `[' and `]', the syntax `[.'SYMBOL`.]' matches the + collating symbol SYMBOL. + + If the `extglob' shell option is enabled using the `shopt' builtin, +several extended pattern matching operators are recognized. In the +following description, a PATTERN-LIST is a list of one or more patterns +separated by a `|'. Composite patterns may be formed using one or more +of the following sub-patterns: + +`?(PATTERN-LIST)' + Matches zero or one occurrence of the given patterns. + +`*(PATTERN-LIST)' + Matches zero or more occurrences of the given patterns. + +`+(PATTERN-LIST)' + Matches one or more occurrences of the given patterns. + +`@(PATTERN-LIST)' + Matches one of the given patterns. + +`!(PATTERN-LIST)' + Matches anything except one of the given patterns. + + +File: bashref.info, Node: Quote Removal, Prev: Filename Expansion, Up: Shell Expansions + +3.5.9 Quote Removal +------------------- + +After the preceding expansions, all unquoted occurrences of the +characters `\', `'', and `"' that did not result from one of the above +expansions are removed. + + +File: bashref.info, Node: Redirections, Next: Executing Commands, Prev: Shell Expansions, Up: Basic Shell Features + +3.6 Redirections +================ + +Before a command is executed, its input and output may be REDIRECTED +using a special notation interpreted by the shell. Redirection allows +commands' file handles to be duplicated, opened, closed, made to refer +to different files, and can change the files the command reads from and +writes to. Redirection may also be used to modify file handles in the +current shell execution environment. The following redirection +operators may precede or appear anywhere within a simple command or may +follow a command. Redirections are processed in the order they appear, +from left to right. + + Each redirection that may be preceded by a file descriptor number +may instead be preceded by a word of the form {VARNAME}. In this case, +for each redirection operator except >&- and <&-, the shell will +allocate a file descriptor greater than 10 and assign it to {VARNAME}. +If >&- or <&- is preceded by {VARNAME}, the value of VARNAME defines +the file descriptor to close. + + In the following descriptions, if the file descriptor number is +omitted, and the first character of the redirection operator is `<', +the redirection refers to the standard input (file descriptor 0). If +the first character of the redirection operator is `>', the redirection +refers to the standard output (file descriptor 1). + + The word following the redirection operator in the following +descriptions, unless otherwise noted, is subjected to brace expansion, +tilde expansion, parameter expansion, command substitution, arithmetic +expansion, quote removal, filename expansion, and word splitting. If +it expands to more than one word, Bash reports an error. + + Note that the order of redirections is significant. For example, +the command + ls > DIRLIST 2>&1 + directs both standard output (file descriptor 1) and standard error +(file descriptor 2) to the file DIRLIST, while the command + ls 2>&1 > DIRLIST + directs only the standard output to file DIRLIST, because the +standard error was made a copy of the standard output before the +standard output was redirected to DIRLIST. + + Bash handles several filenames specially when they are used in +redirections, as described in the following table: + +`/dev/fd/FD' + If FD is a valid integer, file descriptor FD is duplicated. + +`/dev/stdin' + File descriptor 0 is duplicated. + +`/dev/stdout' + File descriptor 1 is duplicated. + +`/dev/stderr' + File descriptor 2 is duplicated. + +`/dev/tcp/HOST/PORT' + If HOST is a valid hostname or Internet address, and PORT is an + integer port number or service name, Bash attempts to open the + corresponding TCP socket. + +`/dev/udp/HOST/PORT' + If HOST is a valid hostname or Internet address, and PORT is an + integer port number or service name, Bash attempts to open the + corresponding UDP socket. + + A failure to open or create a file causes the redirection to fail. + + Redirections using file descriptors greater than 9 should be used +with care, as they may conflict with file descriptors the shell uses +internally. + +3.6.1 Redirecting Input +----------------------- + +Redirection of input causes the file whose name results from the +expansion of WORD to be opened for reading on file descriptor `n', or +the standard input (file descriptor 0) if `n' is not specified. + + The general format for redirecting input is: + [N][|]WORD + + If the redirection operator is `>', and the `noclobber' option to +the `set' builtin has been enabled, the redirection will fail if the +file whose name results from the expansion of WORD exists and is a +regular file. If the redirection operator is `>|', or the redirection +operator is `>' and the `noclobber' option is not enabled, the +redirection is attempted even if the file named by WORD exists. + +3.6.3 Appending Redirected Output +--------------------------------- + +Redirection of output in this fashion causes the file whose name +results from the expansion of WORD to be opened for appending on file +descriptor N, or the standard output (file descriptor 1) if N is not +specified. If the file does not exist it is created. + + The general format for appending output is: + [N]>>WORD + +3.6.4 Redirecting Standard Output and Standard Error +---------------------------------------------------- + +This construct allows both the standard output (file descriptor 1) and +the standard error output (file descriptor 2) to be redirected to the +file whose name is the expansion of WORD. + + There are two formats for redirecting standard output and standard +error: + &>WORD + and + >&WORD + Of the two forms, the first is preferred. This is semantically +equivalent to + >WORD 2>&1 + When using the second form, WORD may not expand to a number or `-'. +If it does, other redirection operators apply (see Duplicating File +Descriptors below) for compatibility reasons. + +3.6.5 Appending Standard Output and Standard Error +-------------------------------------------------- + +This construct allows both the standard output (file descriptor 1) and +the standard error output (file descriptor 2) to be appended to the +file whose name is the expansion of WORD. + + The format for appending standard output and standard error is: + &>>WORD + This is semantically equivalent to + >>WORD 2>&1 + (see Duplicating File Descriptors below). + +3.6.6 Here Documents +-------------------- + +This type of redirection instructs the shell to read input from the +current source until a line containing only WORD (with no trailing +blanks) is seen. All of the lines read up to that point are then used +as the standard input for a command. + + The format of here-documents is: + <<[-]WORD + HERE-DOCUMENT + DELIMITER + + No parameter and variable expansion, command substitution, +arithmetic expansion, or filename expansion is performed on WORD. If +any characters in WORD are quoted, the DELIMITER is the result of quote +removal on WORD, and the lines in the here-document are not expanded. +If WORD is unquoted, all lines of the here-document are subjected to +parameter expansion, command substitution, and arithmetic expansion, +the character sequence `\newline' is ignored, and `\' must be used to +quote the characters `\', `$', and ``'. + + If the redirection operator is `<<-', then all leading tab +characters are stripped from input lines and the line containing +DELIMITER. This allows here-documents within shell scripts to be +indented in a natural fashion. + +3.6.7 Here Strings +------------------ + +A variant of here documents, the format is: + <<< WORD + + The WORD undergoes brace expansion, tilde expansion, parameter and +variable expansion, command substitution, arithmetic expansion, and +quote removal. Pathname expansion and word splitting are not performed. +The result is supplied as a single string to the command on its +standard input. + +3.6.8 Duplicating File Descriptors +---------------------------------- + +The redirection operator + [N]<&WORD + is used to duplicate input file descriptors. If WORD expands to one +or more digits, the file descriptor denoted by N is made to be a copy +of that file descriptor. If the digits in WORD do not specify a file +descriptor open for input, a redirection error occurs. If WORD +evaluates to `-', file descriptor N is closed. If N is not specified, +the standard input (file descriptor 0) is used. + + The operator + [N]>&WORD + is used similarly to duplicate output file descriptors. If N is not +specified, the standard output (file descriptor 1) is used. If the +digits in WORD do not specify a file descriptor open for output, a +redirection error occurs. If WORD evaluates to `-', file descriptor N +is closed. As a special case, if N is omitted, and WORD does not +expand to one or more digits or `-', the standard output and standard +error are redirected as described previously. + +3.6.9 Moving File Descriptors +----------------------------- + +The redirection operator + [N]<&DIGIT- + moves the file descriptor DIGIT to file descriptor N, or the +standard input (file descriptor 0) if N is not specified. DIGIT is +closed after being duplicated to N. + + Similarly, the redirection operator + [N]>&DIGIT- + moves the file descriptor DIGIT to file descriptor N, or the +standard output (file descriptor 1) if N is not specified. + +3.6.10 Opening File Descriptors for Reading and Writing +------------------------------------------------------- + +The redirection operator + [N]<>WORD + causes the file whose name is the expansion of WORD to be opened for +both reading and writing on file descriptor N, or on file descriptor 0 +if N is not specified. If the file does not exist, it is created. + + +File: bashref.info, Node: Executing Commands, Next: Shell Scripts, Prev: Redirections, Up: Basic Shell Features + +3.7 Executing Commands +====================== + +* Menu: + +* Simple Command Expansion:: How Bash expands simple commands before + executing them. +* Command Search and Execution:: How Bash finds commands and runs them. +* Command Execution Environment:: The environment in which Bash + executes commands that are not + shell builtins. +* Environment:: The environment given to a command. +* Exit Status:: The status returned by commands and how Bash + interprets it. +* Signals:: What happens when Bash or a command it runs + receives a signal. + + +File: bashref.info, Node: Simple Command Expansion, Next: Command Search and Execution, Up: Executing Commands + +3.7.1 Simple Command Expansion +------------------------------ + +When a simple command is executed, the shell performs the following +expansions, assignments, and redirections, from left to right. + + 1. The words that the parser has marked as variable assignments (those + preceding the command name) and redirections are saved for later + processing. + + 2. The words that are not variable assignments or redirections are + expanded (*note Shell Expansions::). If any words remain after + expansion, the first word is taken to be the name of the command + and the remaining words are the arguments. + + 3. Redirections are performed as described above (*note + Redirections::). + + 4. The text after the `=' in each variable assignment undergoes tilde + expansion, parameter expansion, command substitution, arithmetic + expansion, and quote removal before being assigned to the variable. + + If no command name results, the variable assignments affect the +current shell environment. Otherwise, the variables are added to the +environment of the executed command and do not affect the current shell +environment. If any of the assignments attempts to assign a value to a +readonly variable, an error occurs, and the command exits with a +non-zero status. + + If no command name results, redirections are performed, but do not +affect the current shell environment. A redirection error causes the +command to exit with a non-zero status. + + If there is a command name left after expansion, execution proceeds +as described below. Otherwise, the command exits. If one of the +expansions contained a command substitution, the exit status of the +command is the exit status of the last command substitution performed. +If there were no command substitutions, the command exits with a status +of zero. + + +File: bashref.info, Node: Command Search and Execution, Next: Command Execution Environment, Prev: Simple Command Expansion, Up: Executing Commands + +3.7.2 Command Search and Execution +---------------------------------- + +After a command has been split into words, if it results in a simple +command and an optional list of arguments, the following actions are +taken. + + 1. If the command name contains no slashes, the shell attempts to + locate it. If there exists a shell function by that name, that + function is invoked as described in *note Shell Functions::. + + 2. If the name does not match a function, the shell searches for it + in the list of shell builtins. If a match is found, that builtin + is invoked. + + 3. If the name is neither a shell function nor a builtin, and + contains no slashes, Bash searches each element of `$PATH' for a + directory containing an executable file by that name. Bash uses a + hash table to remember the full pathnames of executable files to + avoid multiple `PATH' searches (see the description of `hash' in + *note Bourne Shell Builtins::). A full search of the directories + in `$PATH' is performed only if the command is not found in the + hash table. If the search is unsuccessful, the shell searches for + a defined shell function named `command_not_found_handle'. If + that function exists, it is invoked with the original command and + the original command's arguments as its arguments, and the + function's exit status becomes the exit status of the shell. If + that function is not defined, the shell prints an error message + and returns an exit status of 127. + + 4. If the search is successful, or if the command name contains one + or more slashes, the shell executes the named program in a + separate execution environment. Argument 0 is set to the name + given, and the remaining arguments to the command are set to the + arguments supplied, if any. + + 5. If this execution fails because the file is not in executable + format, and the file is not a directory, it is assumed to be a + SHELL SCRIPT and the shell executes it as described in *note Shell + Scripts::. + + 6. If the command was not begun asynchronously, the shell waits for + the command to complete and collects its exit status. + + + +File: bashref.info, Node: Command Execution Environment, Next: Environment, Prev: Command Search and Execution, Up: Executing Commands + +3.7.3 Command Execution Environment +----------------------------------- + +The shell has an EXECUTION ENVIRONMENT, which consists of the following: + + * open files inherited by the shell at invocation, as modified by + redirections supplied to the `exec' builtin + + * the current working directory as set by `cd', `pushd', or `popd', + or inherited by the shell at invocation + + * the file creation mode mask as set by `umask' or inherited from + the shell's parent + + * current traps set by `trap' + + * shell parameters that are set by variable assignment or with `set' + or inherited from the shell's parent in the environment + + * shell functions defined during execution or inherited from the + shell's parent in the environment + + * options enabled at invocation (either by default or with + command-line arguments) or by `set' + + * options enabled by `shopt' (*note The Shopt Builtin::) + + * shell aliases defined with `alias' (*note Aliases::) + + * various process IDs, including those of background jobs (*note + Lists::), the value of `$$', and the value of `$PPID' + + + When a simple command other than a builtin or shell function is to +be executed, it is invoked in a separate execution environment that +consists of the following. Unless otherwise noted, the values are +inherited from the shell. + + * the shell's open files, plus any modifications and additions + specified by redirections to the command + + * the current working directory + + * the file creation mode mask + + * shell variables and functions marked for export, along with + variables exported for the command, passed in the environment + (*note Environment::) + + * traps caught by the shell are reset to the values inherited from + the shell's parent, and traps ignored by the shell are ignored + + + A command invoked in this separate environment cannot affect the +shell's execution environment. + + Command substitution, commands grouped with parentheses, and +asynchronous commands are invoked in a subshell environment that is a +duplicate of the shell environment, except that traps caught by the +shell are reset to the values that the shell inherited from its parent +at invocation. Builtin commands that are invoked as part of a pipeline +are also executed in a subshell environment. Changes made to the +subshell environment cannot affect the shell's execution environment. + + Subshells spawned to execute command substitutions inherit the value +of the `-e' option from the parent shell. When not in POSIX mode, Bash +clears the `-e' option in such subshells. + + If a command is followed by a `&' and job control is not active, the +default standard input for the command is the empty file `/dev/null'. +Otherwise, the invoked command inherits the file descriptors of the +calling shell as modified by redirections. + + +File: bashref.info, Node: Environment, Next: Exit Status, Prev: Command Execution Environment, Up: Executing Commands + +3.7.4 Environment +----------------- + +When a program is invoked it is given an array of strings called the +ENVIRONMENT. This is a list of name-value pairs, of the form +`name=value'. + + Bash provides several ways to manipulate the environment. On +invocation, the shell scans its own environment and creates a parameter +for each name found, automatically marking it for EXPORT to child +processes. Executed commands inherit the environment. The `export' +and `declare -x' commands allow parameters and functions to be added to +and deleted from the environment. If the value of a parameter in the +environment is modified, the new value becomes part of the environment, +replacing the old. The environment inherited by any executed command +consists of the shell's initial environment, whose values may be +modified in the shell, less any pairs removed by the `unset' and +`export -n' commands, plus any additions via the `export' and `declare +-x' commands. + + The environment for any simple command or function may be augmented +temporarily by prefixing it with parameter assignments, as described in +*note Shell Parameters::. These assignment statements affect only the +environment seen by that command. + + If the `-k' option is set (*note The Set Builtin::), then all +parameter assignments are placed in the environment for a command, not +just those that precede the command name. + + When Bash invokes an external command, the variable `$_' is set to +the full pathname of the command and passed to that command in its +environment. + + +File: bashref.info, Node: Exit Status, Next: Signals, Prev: Environment, Up: Executing Commands + +3.7.5 Exit Status +----------------- + +The exit status of an executed command is the value returned by the +WAITPID system call or equivalent function. Exit statuses fall between +0 and 255, though, as explained below, the shell may use values above +125 specially. Exit statuses from shell builtins and compound commands +are also limited to this range. Under certain circumstances, the shell +will use special values to indicate specific failure modes. + + For the shell's purposes, a command which exits with a zero exit +status has succeeded. A non-zero exit status indicates failure. This +seemingly counter-intuitive scheme is used so there is one well-defined +way to indicate success and a variety of ways to indicate various +failure modes. When a command terminates on a fatal signal whose +number is N, Bash uses the value 128+N as the exit status. + + If a command is not found, the child process created to execute it +returns a status of 127. If a command is found but is not executable, +the return status is 126. + + If a command fails because of an error during expansion or +redirection, the exit status is greater than zero. + + The exit status is used by the Bash conditional commands (*note +Conditional Constructs::) and some of the list constructs (*note +Lists::). + + All of the Bash builtins return an exit status of zero if they +succeed and a non-zero status on failure, so they may be used by the +conditional and list constructs. All builtins return an exit status of +2 to indicate incorrect usage. + + +File: bashref.info, Node: Signals, Prev: Exit Status, Up: Executing Commands + +3.7.6 Signals +------------- + +When Bash is interactive, in the absence of any traps, it ignores +`SIGTERM' (so that `kill 0' does not kill an interactive shell), and +`SIGINT' is caught and handled (so that the `wait' builtin is +interruptible). When Bash receives a `SIGINT', it breaks out of any +executing loops. In all cases, Bash ignores `SIGQUIT'. If job control +is in effect (*note Job Control::), Bash ignores `SIGTTIN', `SIGTTOU', +and `SIGTSTP'. + + Non-builtin commands started by Bash have signal handlers set to the +values inherited by the shell from its parent. When job control is not +in effect, asynchronous commands ignore `SIGINT' and `SIGQUIT' in +addition to these inherited handlers. Commands run as a result of +command substitution ignore the keyboard-generated job control signals +`SIGTTIN', `SIGTTOU', and `SIGTSTP'. + + The shell exits by default upon receipt of a `SIGHUP'. Before +exiting, an interactive shell resends the `SIGHUP' to all jobs, running +or stopped. Stopped jobs are sent `SIGCONT' to ensure that they receive +the `SIGHUP'. To prevent the shell from sending the `SIGHUP' signal to +a particular job, it should be removed from the jobs table with the +`disown' builtin (*note Job Control Builtins::) or marked to not +receive `SIGHUP' using `disown -h'. + + If the `huponexit' shell option has been set with `shopt' (*note +The Shopt Builtin::), Bash sends a `SIGHUP' to all jobs when an +interactive login shell exits. + + If Bash is waiting for a command to complete and receives a signal +for which a trap has been set, the trap will not be executed until the +command completes. When Bash is waiting for an asynchronous command +via the `wait' builtin, the reception of a signal for which a trap has +been set will cause the `wait' builtin to return immediately with an +exit status greater than 128, immediately after which the trap is +executed. + + +File: bashref.info, Node: Shell Scripts, Prev: Executing Commands, Up: Basic Shell Features + +3.8 Shell Scripts +================= + +A shell script is a text file containing shell commands. When such a +file is used as the first non-option argument when invoking Bash, and +neither the `-c' nor `-s' option is supplied (*note Invoking Bash::), +Bash reads and executes commands from the file, then exits. This mode +of operation creates a non-interactive shell. The shell first searches +for the file in the current directory, and looks in the directories in +`$PATH' if not found there. + + When Bash runs a shell script, it sets the special parameter `0' to +the name of the file, rather than the name of the shell, and the +positional parameters are set to the remaining arguments, if any are +given. If no additional arguments are supplied, the positional +parameters are unset. + + A shell script may be made executable by using the `chmod' command +to turn on the execute bit. When Bash finds such a file while +searching the `$PATH' for a command, it spawns a subshell to execute +it. In other words, executing + filename ARGUMENTS + is equivalent to executing + bash filename ARGUMENTS + +if `filename' is an executable shell script. This subshell +reinitializes itself, so that the effect is as if a new shell had been +invoked to interpret the script, with the exception that the locations +of commands remembered by the parent (see the description of `hash' in +*note Bourne Shell Builtins::) are retained by the child. + + Most versions of Unix make this a part of the operating system's +command execution mechanism. If the first line of a script begins with +the two characters `#!', the remainder of the line specifies an +interpreter for the program. Thus, you can specify Bash, `awk', Perl, +or some other interpreter and write the rest of the script file in that +language. + + The arguments to the interpreter consist of a single optional +argument following the interpreter name on the first line of the script +file, followed by the name of the script file, followed by the rest of +the arguments. Bash will perform this action on operating systems that +do not handle it themselves. Note that some older versions of Unix +limit the interpreter name and argument to a maximum of 32 characters. + + Bash scripts often begin with `#! /bin/bash' (assuming that Bash has +been installed in `/bin'), since this ensures that Bash will be used to +interpret the script, even if it is executed under another shell. + + +File: bashref.info, Node: Shell Builtin Commands, Next: Shell Variables, Prev: Basic Shell Features, Up: Top + +4 Shell Builtin Commands +************************ + +* Menu: + +* Bourne Shell Builtins:: Builtin commands inherited from the Bourne + Shell. +* Bash Builtins:: Table of builtins specific to Bash. +* Modifying Shell Behavior:: Builtins to modify shell attributes and + optional behavior. +* Special Builtins:: Builtin commands classified specially by + POSIX. + + Builtin commands are contained within the shell itself. When the +name of a builtin command is used as the first word of a simple command +(*note Simple Commands::), the shell executes the command directly, +without invoking another program. Builtin commands are necessary to +implement functionality impossible or inconvenient to obtain with +separate utilities. + + This section briefly describes the builtins which Bash inherits from +the Bourne Shell, as well as the builtin commands which are unique to +or have been extended in Bash. + + Several builtin commands are described in other chapters: builtin +commands which provide the Bash interface to the job control facilities +(*note Job Control Builtins::), the directory stack (*note Directory +Stack Builtins::), the command history (*note Bash History Builtins::), +and the programmable completion facilities (*note Programmable +Completion Builtins::). + + Many of the builtins have been extended by POSIX or Bash. + + Unless otherwise noted, each builtin command documented as accepting +options preceded by `-' accepts `--' to signify the end of the options. +The `:', `true', `false', and `test' builtins do not accept options and +do not treat `--' specially. The `exit', `logout', `break', +`continue', `let', and `shift' builtins accept and process arguments +beginning with `-' without requiring `--'. Other builtins that accept +arguments but are not specified as accepting options interpret +arguments beginning with `-' as invalid options and require `--' to +prevent this interpretation. + + +File: bashref.info, Node: Bourne Shell Builtins, Next: Bash Builtins, Up: Shell Builtin Commands + +4.1 Bourne Shell Builtins +========================= + +The following shell builtin commands are inherited from the Bourne +Shell. These commands are implemented as specified by the POSIX +standard. + +`: (a colon)' + : [ARGUMENTS] + + Do nothing beyond expanding ARGUMENTS and performing redirections. + The return status is zero. + +`. (a period)' + . FILENAME [ARGUMENTS] + + Read and execute commands from the FILENAME argument in the + current shell context. If FILENAME does not contain a slash, the + `PATH' variable is used to find FILENAME. When Bash is not in + POSIX mode, the current directory is searched if FILENAME is not + found in `$PATH'. If any ARGUMENTS are supplied, they become the + positional parameters when FILENAME is executed. Otherwise the + positional parameters are unchanged. The return status is the + exit status of the last command executed, or zero if no commands + are executed. If FILENAME is not found, or cannot be read, the + return status is non-zero. This builtin is equivalent to `source'. + +`break' + break [N] + + Exit from a `for', `while', `until', or `select' loop. If N is + supplied, the Nth enclosing loop is exited. N must be greater + than or equal to 1. The return status is zero unless N is not + greater than or equal to 1. + +`cd' + cd [-L|[-P [-e]] [-@] [DIRECTORY] + + Change the current working directory to DIRECTORY. If DIRECTORY + is not supplied, the value of the `HOME' shell variable is used. + Any additional arguments following DIRECTORY are ignored. If the + shell variable `CDPATH' exists, it is used as a search path: each + directory name in `CDPATH' is searched for DIRECTORY, with + alternative directory names in `CDPATH' separated by a colon (`:'). + If DIRECTORY begins with a slash, `CDPATH' is not used. + + The `-P' option means to not follow symbolic links: symbolic links + are resolved while `cd' is traversing DIRECTORY and before + processing an instance of `..' in DIRECTORY. + + By default, or when the `-L' option is supplied, symbolic links in + DIRECTORY are resolved after `cd' processes an instance of `..' in + DIRECTORY. + + If `..' appears in DIRECTORY, it is processed by removing the + immediately preceding pathname component, back to a slash or the + beginning of DIRECTORY. + + If the `-e' option is supplied with `-P' and the current working + directory cannot be successfully determined after a successful + directory change, `cd' will return an unsuccessful status. + + On systems that support it, the `-@' option presents the extended + attributes associated with a file as a directory. + + If DIRECTORY is `-', it is converted to `$OLDPWD' before the + directory change is attempted. + + If a non-empty directory name from `CDPATH' is used, or if `-' is + the first argument, and the directory change is successful, the + absolute pathname of the new working directory is written to the + standard output. + + The return status is zero if the directory is successfully changed, + non-zero otherwise. + +`continue' + continue [N] + + Resume the next iteration of an enclosing `for', `while', `until', + or `select' loop. If N is supplied, the execution of the Nth + enclosing loop is resumed. N must be greater than or equal to 1. + The return status is zero unless N is not greater than or equal to + 1. + +`eval' + eval [ARGUMENTS] + + The arguments are concatenated together into a single command, + which is then read and executed, and its exit status returned as + the exit status of `eval'. If there are no arguments or only + empty arguments, the return status is zero. + +`exec' + exec [-cl] [-a NAME] [COMMAND [ARGUMENTS]] + + If COMMAND is supplied, it replaces the shell without creating a + new process. If the `-l' option is supplied, the shell places a + dash at the beginning of the zeroth argument passed to COMMAND. + This is what the `login' program does. The `-c' option causes + COMMAND to be executed with an empty environment. If `-a' is + supplied, the shell passes NAME as the zeroth argument to COMMAND. + If COMMAND cannot be executed for some reason, a non-interactive + shell exits, unless the `execfail' shell option is enabled. In + that case, it returns failure. An interactive shell returns + failure if the file cannot be executed. If no COMMAND is + specified, redirections may be used to affect the current shell + environment. If there are no redirection errors, the return + status is zero; otherwise the return status is non-zero. + +`exit' + exit [N] + + Exit the shell, returning a status of N to the shell's parent. If + N is omitted, the exit status is that of the last command executed. + Any trap on `EXIT' is executed before the shell terminates. + +`export' + export [-fn] [-p] [NAME[=VALUE]] + + Mark each NAME to be passed to child processes in the environment. + If the `-f' option is supplied, the NAMEs refer to shell + functions; otherwise the names refer to shell variables. The `-n' + option means to no longer mark each NAME for export. If no NAMES + are supplied, or if the `-p' option is given, a list of names of + all exported variables is displayed. The `-p' option displays + output in a form that may be reused as input. If a variable name + is followed by =VALUE, the value of the variable is set to VALUE. + + The return status is zero unless an invalid option is supplied, + one of the names is not a valid shell variable name, or `-f' is + supplied with a name that is not a shell function. + +`getopts' + getopts OPTSTRING NAME [ARGS] + + `getopts' is used by shell scripts to parse positional parameters. + OPTSTRING contains the option characters to be recognized; if a + character is followed by a colon, the option is expected to have an + argument, which should be separated from it by whitespace. The + colon (`:') and question mark (`?') may not be used as option + characters. Each time it is invoked, `getopts' places the next + option in the shell variable NAME, initializing NAME if it does + not exist, and the index of the next argument to be processed into + the variable `OPTIND'. `OPTIND' is initialized to 1 each time the + shell or a shell script is invoked. When an option requires an + argument, `getopts' places that argument into the variable + `OPTARG'. The shell does not reset `OPTIND' automatically; it + must be manually reset between multiple calls to `getopts' within + the same shell invocation if a new set of parameters is to be used. + + When the end of options is encountered, `getopts' exits with a + return value greater than zero. `OPTIND' is set to the index of + the first non-option argument, and NAME is set to `?'. + + `getopts' normally parses the positional parameters, but if more + arguments are given in ARGS, `getopts' parses those instead. + + `getopts' can report errors in two ways. If the first character of + OPTSTRING is a colon, SILENT error reporting is used. In normal + operation, diagnostic messages are printed when invalid options or + missing option arguments are encountered. If the variable `OPTERR' + is set to 0, no error messages will be displayed, even if the first + character of `optstring' is not a colon. + + If an invalid option is seen, `getopts' places `?' into NAME and, + if not silent, prints an error message and unsets `OPTARG'. If + `getopts' is silent, the option character found is placed in + `OPTARG' and no diagnostic message is printed. + + If a required argument is not found, and `getopts' is not silent, + a question mark (`?') is placed in NAME, `OPTARG' is unset, and a + diagnostic message is printed. If `getopts' is silent, then a + colon (`:') is placed in NAME and `OPTARG' is set to the option + character found. + +`hash' + hash [-r] [-p FILENAME] [-dt] [NAME] + + Each time `hash' is invoked, it remembers the full pathnames of the + commands specified as NAME arguments, so they need not be searched + for on subsequent invocations. The commands are found by + searching through the directories listed in `$PATH'. Any + previously-remembered pathname is discarded. The `-p' option + inhibits the path search, and FILENAME is used as the location of + NAME. The `-r' option causes the shell to forget all remembered + locations. The `-d' option causes the shell to forget the + remembered location of each NAME. If the `-t' option is supplied, + the full pathname to which each NAME corresponds is printed. If + multiple NAME arguments are supplied with `-t' the NAME is printed + before the hashed full pathname. The `-l' option causes output to + be displayed in a format that may be reused as input. If no + arguments are given, or if only `-l' is supplied, information + about remembered commands is printed. The return status is zero + unless a NAME is not found or an invalid option is supplied. + +`pwd' + pwd [-LP] + + Print the absolute pathname of the current working directory. If + the `-P' option is supplied, the pathname printed will not contain + symbolic links. If the `-L' option is supplied, the pathname + printed may contain symbolic links. The return status is zero + unless an error is encountered while determining the name of the + current directory or an invalid option is supplied. + +`readonly' + readonly [-aAf] [-p] [NAME[=VALUE]] ... + + Mark each NAME as readonly. The values of these names may not be + changed by subsequent assignment. If the `-f' option is supplied, + each NAME refers to a shell function. The `-a' option means each + NAME refers to an indexed array variable; the `-A' option means + each NAME refers to an associative array variable. If both + options are supplied, `-A' takes precedence. If no NAME arguments + are given, or if the `-p' option is supplied, a list of all + readonly names is printed. The other options may be used to + restrict the output to a subset of the set of readonly names. The + `-p' option causes output to be displayed in a format that may be + reused as input. If a variable name is followed by =VALUE, the + value of the variable is set to VALUE. The return status is zero + unless an invalid option is supplied, one of the NAME arguments is + not a valid shell variable or function name, or the `-f' option is + supplied with a name that is not a shell function. + +`return' + return [N] + + Cause a shell function to stop executing and return the value N to + its caller. If N is not supplied, the return value is the exit + status of the last command executed in the function. `return' may + also be used to terminate execution of a script being executed + with the `.' (`source') builtin, returning either N or the exit + status of the last command executed within the script as the exit + status of the script. If N is supplied, the return value is its + least significant 8 bits. Any command associated with the + `RETURN' trap is executed before execution resumes after the + function or script. The return status is non-zero if `return' is + supplied a non-numeric argument or is used outside a function and + not during the execution of a script by `.' or `source'. + +`shift' + shift [N] + + Shift the positional parameters to the left by N. The positional + parameters from N+1 ... `$#' are renamed to `$1' ... `$#'-N. + Parameters represented by the numbers `$#' to `$#'-N+1 are unset. + N must be a non-negative number less than or equal to `$#'. If N + is zero or greater than `$#', the positional parameters are not + changed. If N is not supplied, it is assumed to be 1. The return + status is zero unless N is greater than `$#' or less than zero, + non-zero otherwise. + +`test' +`[' + test EXPR + + Evaluate a conditional express ion EXPR and return a status of 0 + (true) or 1 (false). Each operator and operand must be a separate + argument. Expressions are composed of the primaries described + below in *note Bash Conditional Expressions::. `test' does not + accept any options, nor does it accept and ignore an argument of + `--' as signifying the end of options. + + When the `[' form is used, the last argument to the command must + be a `]'. + + Expressions may be combined using the following operators, listed + in decreasing order of precedence. The evaluation depends on the + number of arguments; see below. Operator precedence is used when + there are five or more arguments. + + `! EXPR' + True if EXPR is false. + + `( EXPR )' + Returns the value of EXPR. This may be used to override the + normal precedence of operators. + + `EXPR1 -a EXPR2' + True if both EXPR1 and EXPR2 are true. + + `EXPR1 -o EXPR2' + True if either EXPR1 or EXPR2 is true. + + The `test' and `[' builtins evaluate conditional expressions using + a set of rules based on the number of arguments. + + 0 arguments + The expression is false. + + 1 argument + The expression is true if and only if the argument is not + null. + + 2 arguments + If the first argument is `!', the expression is true if and + only if the second argument is null. If the first argument + is one of the unary conditional operators (*note Bash + Conditional Expressions::), the expression is true if the + unary test is true. If the first argument is not a valid + unary operator, the expression is false. + + 3 arguments + The following conditions are applied in the order listed. If + the second argument is one of the binary conditional + operators (*note Bash Conditional Expressions::), the result + of the expression is the result of the binary test using the + first and third arguments as operands. The `-a' and `-o' + operators are considered binary operators when there are + three arguments. If the first argument is `!', the value is + the negation of the two-argument test using the second and + third arguments. If the first argument is exactly `(' and + the third argument is exactly `)', the result is the + one-argument test of the second argument. Otherwise, the + expression is false. + + 4 arguments + If the first argument is `!', the result is the negation of + the three-argument expression composed of the remaining + arguments. Otherwise, the expression is parsed and evaluated + according to precedence using the rules listed above. + + 5 or more arguments + The expression is parsed and evaluated according to precedence + using the rules listed above. + + When used with `test' or `[', the `<' and `>' operators sort + lexicographically using ASCII ordering. + +`times' + times + + Print out the user and system times used by the shell and its + children. The return status is zero. + +`trap' + trap [-lp] [ARG] [SIGSPEC ...] + + The commands in ARG are to be read and executed when the shell + receives signal SIGSPEC. If ARG is absent (and there is a single + SIGSPEC) or equal to `-', each specified signal's disposition is + reset to the value it had when the shell was started. If ARG is + the null string, then the signal specified by each SIGSPEC is + ignored by the shell and commands it invokes. If ARG is not + present and `-p' has been supplied, the shell displays the trap + commands associated with each SIGSPEC. If no arguments are + supplied, or only `-p' is given, `trap' prints the list of commands + associated with each signal number in a form that may be reused as + shell input. The `-l' option causes the shell to print a list of + signal names and their corresponding numbers. Each SIGSPEC is + either a signal name or a signal number. Signal names are case + insensitive and the `SIG' prefix is optional. + + If a SIGSPEC is `0' or `EXIT', ARG is executed when the shell + exits. If a SIGSPEC is `DEBUG', the command ARG is executed + before every simple command, `for' command, `case' command, + `select' command, every arithmetic `for' command, and before the + first command executes in a shell function. Refer to the + description of the `extdebug' option to the `shopt' builtin (*note + The Shopt Builtin::) for details of its effect on the `DEBUG' trap. + If a SIGSPEC is `RETURN', the command ARG is executed each time a + shell function or a script executed with the `.' or `source' + builtins finishes executing. + + If a SIGSPEC is `ERR', the command ARG is executed whenever a + pipeline (which may consist of a single simple command), a list, + or a compound command returns a non-zero exit status, subject to + the following conditions. The `ERR' trap is not executed if the + failed command is part of the command list immediately following + an `until' or `while' keyword, part of the test following the `if' + or `elif' reserved words, part of a command executed in a `&&' or + `||' list except the command following the final `&&' or `||', any + command in a pipeline but the last, or if the command's return + status is being inverted using `!'. These are the same conditions + obeyed by the `errexit' (`-e') option. + + Signals ignored upon entry to the shell cannot be trapped or reset. + Trapped signals that are not being ignored are reset to their + original values in a subshell or subshell environment when one is + created. + + The return status is zero unless a SIGSPEC does not specify a + valid signal. + +`umask' + umask [-p] [-S] [MODE] + + Set the shell process's file creation mask to MODE. If MODE + begins with a digit, it is interpreted as an octal number; if not, + it is interpreted as a symbolic mode mask similar to that accepted + by the `chmod' command. If MODE is omitted, the current value of + the mask is printed. If the `-S' option is supplied without a + MODE argument, the mask is printed in a symbolic format. If the + `-p' option is supplied, and MODE is omitted, the output is in a + form that may be reused as input. The return status is zero if + the mode is successfully changed or if no MODE argument is + supplied, and non-zero otherwise. + + Note that when the mode is interpreted as an octal number, each + number of the umask is subtracted from `7'. Thus, a umask of `022' + results in permissions of `755'. + +`unset' + unset [-fnv] [NAME] + + Remove each variable or function NAME. If the `-v' option is + given, each NAME refers to a shell variable and that variable is + remvoved. If the `-f' option is given, the NAMEs refer to shell + functions, and the function definition is removed. If the `-n' + option is supplied, and NAME is a variable with the NAMEREF + attribute, NAME will be unset rather than the variable it + references. `-n' has no effect if the `-f' option is supplied. + If no options are supplied, each NAME refers to a variable; if + there is no variable by that name, any function with that name is + unset. Readonly variables and functions may not be unset. The + return status is zero unless a NAME is readonly. + + +File: bashref.info, Node: Bash Builtins, Next: Modifying Shell Behavior, Prev: Bourne Shell Builtins, Up: Shell Builtin Commands + +4.2 Bash Builtin Commands +========================= + +This section describes builtin commands which are unique to or have +been extended in Bash. Some of these commands are specified in the +POSIX standard. + +`alias' + alias [-p] [NAME[=VALUE] ...] + + Without arguments or with the `-p' option, `alias' prints the list + of aliases on the standard output in a form that allows them to be + reused as input. If arguments are supplied, an alias is defined + for each NAME whose VALUE is given. If no VALUE is given, the name + and value of the alias is printed. Aliases are described in *note + Aliases::. + +`bind' + bind [-m KEYMAP] [-lpsvPSVX] + bind [-m KEYMAP] [-q FUNCTION] [-u FUNCTION] [-r KEYSEQ] + bind [-m KEYMAP] -f FILENAME + bind [-m KEYMAP] -x KEYSEQ:SHELL-COMMAND + bind [-m KEYMAP] KEYSEQ:FUNCTION-NAME + bind READLINE-COMMAND + + Display current Readline (*note Command Line Editing::) key and + function bindings, bind a key sequence to a Readline function or + macro, or set a Readline variable. Each non-option argument is a + command as it would appear in a Readline initialization file + (*note Readline Init File::), but each binding or command must be + passed as a separate argument; e.g., + `"\C-x\C-r":re-read-init-file'. + + Options, if supplied, have the following meanings: + + `-m KEYMAP' + Use KEYMAP as the keymap to be affected by the subsequent + bindings. Acceptable KEYMAP names are `emacs', + `emacs-standard', `emacs-meta', `emacs-ctlx', `vi', `vi-move', + `vi-command', and `vi-insert'. `vi' is equivalent to + `vi-command'; `emacs' is equivalent to `emacs-standard'. + + `-l' + List the names of all Readline functions. + + `-p' + Display Readline function names and bindings in such a way + that they can be used as input or in a Readline + initialization file. + + `-P' + List current Readline function names and bindings. + + `-v' + Display Readline variable names and values in such a way that + they can be used as input or in a Readline initialization + file. + + `-V' + List current Readline variable names and values. + + `-s' + Display Readline key sequences bound to macros and the + strings they output in such a way that they can be used as + input or in a Readline initialization file. + + `-S' + Display Readline key sequences bound to macros and the + strings they output. + + `-f FILENAME' + Read key bindings from FILENAME. + + `-q FUNCTION' + Query about which keys invoke the named FUNCTION. + + `-u FUNCTION' + Unbind all keys bound to the named FUNCTION. + + `-r KEYSEQ' + Remove any current binding for KEYSEQ. + + `-x KEYSEQ:SHELL-COMMAND' + Cause SHELL-COMMAND to be executed whenever KEYSEQ is entered. + When SHELL-COMMAND is executed, the shell sets the + `READLINE_LINE' variable to the contents of the Readline line + buffer and the `READLINE_POINT' variable to the current + location of the insertion point. If the executed command + changes the value of `READLINE_LINE' or `READLINE_POINT', + those new values will be reflected in the editing state. + + `-X' + List all key sequences bound to shell commands and the + associated commands in a format that can be reused as input. + + The return status is zero unless an invalid option is supplied or + an error occurs. + +`builtin' + builtin [SHELL-BUILTIN [ARGS]] + + Run a shell builtin, passing it ARGS, and return its exit status. + This is useful when defining a shell function with the same name + as a shell builtin, retaining the functionality of the builtin + within the function. The return status is non-zero if + SHELL-BUILTIN is not a shell builtin command. + +`caller' + caller [EXPR] + + Returns the context of any active subroutine call (a shell + function or a script executed with the `.' or `source' builtins). + + Without EXPR, `caller' displays the line number and source + filename of the current subroutine call. If a non-negative + integer is supplied as EXPR, `caller' displays the line number, + subroutine name, and source file corresponding to that position in + the current execution call stack. This extra information may be + used, for example, to print a stack trace. The current frame is + frame 0. + + The return value is 0 unless the shell is not executing a + subroutine call or EXPR does not correspond to a valid position in + the call stack. + +`command' + command [-pVv] COMMAND [ARGUMENTS ...] + + Runs COMMAND with ARGUMENTS ignoring any shell function named + COMMAND. Only shell builtin commands or commands found by + searching the `PATH' are executed. If there is a shell function + named `ls', running `command ls' within the function will execute + the external command `ls' instead of calling the function + recursively. The `-p' option means to use a default value for + `PATH' that is guaranteed to find all of the standard utilities. + The return status in this case is 127 if COMMAND cannot be found + or an error occurred, and the exit status of COMMAND otherwise. + + If either the `-V' or `-v' option is supplied, a description of + COMMAND is printed. The `-v' option causes a single word + indicating the command or file name used to invoke COMMAND to be + displayed; the `-V' option produces a more verbose description. + In this case, the return status is zero if COMMAND is found, and + non-zero if not. + +`declare' + declare [-aAfFgilnrtux] [-p] [NAME[=VALUE] ...] + + Declare variables and give them attributes. If no NAMEs are + given, then display the values of variables instead. + + The `-p' option will display the attributes and values of each + NAME. When `-p' is used with NAME arguments, additional options, + other than `-f' and `-F', are ignored. + + When `-p' is supplied without NAME arguments, `declare' will + display the attributes and values of all variables having the + attributes specified by the additional options. If no other + options are supplied with `-p', `declare' will display the + attributes and values of all shell variables. The `-f' option + will restrict the display to shell functions. + + The `-F' option inhibits the display of function definitions; only + the function name and attributes are printed. If the `extdebug' + shell option is enabled using `shopt' (*note The Shopt Builtin::), + the source file name and line number where the function is defined + are displayed as well. `-F' implies `-f'. + + The `-g' option forces variables to be created or modified at the + global scope, even when `declare' is executed in a shell function. + It is ignored in all other cases. + + The following options can be used to restrict output to variables + with the specified attributes or to give variables attributes: + + `-a' + Each NAME is an indexed array variable (*note Arrays::). + + `-A' + Each NAME is an associative array variable (*note Arrays::). + + `-f' + Use function names only. + + `-i' + The variable is to be treated as an integer; arithmetic + evaluation (*note Shell Arithmetic::) is performed when the + variable is assigned a value. + + `-l' + When the variable is assigned a value, all upper-case + characters are converted to lower-case. The upper-case + attribute is disabled. + + `-n' + Give each NAME the NAMEREF attribute, making it a name + reference to another variable. That other variable is + defined by the value of NAME. All references and assignments + to NAME, except for changing the `-n' attribute itself, are + performed on the variable referenced by NAME's value. The + `-n' attribute cannot be applied to array variables. + + `-r' + Make NAMEs readonly. These names cannot then be assigned + values by subsequent assignment statements or unset. + + `-t' + Give each NAME the `trace' attribute. Traced functions + inherit the `DEBUG' and `RETURN' traps from the calling shell. + The trace attribute has no special meaning for variables. + + `-u' + When the variable is assigned a value, all lower-case + characters are converted to upper-case. The lower-case + attribute is disabled. + + `-x' + Mark each NAME for export to subsequent commands via the + environment. + + Using `+' instead of `-' turns off the attribute instead, with the + exceptions that `+a' may not be used to destroy an array variable + and `+r' will not remove the readonly attribute. When used in a + function, `declare' makes each NAME local, as with the `local' + command, unless the `-g' option is used. If a variable name is + followed by =VALUE, the value of the variable is set to VALUE. + + When using `-a' or `-A' and the compound assignment syntax to + create array variables, additional attributes do not take effect + until subsequent assignments. + + The return status is zero unless an invalid option is encountered, + an attempt is made to define a function using `-f foo=bar', an + attempt is made to assign a value to a readonly variable, an + attempt is made to assign a value to an array variable without + using the compound assignment syntax (*note Arrays::), one of the + NAMES is not a valid shell variable name, an attempt is made to + turn off readonly status for a readonly variable, an attempt is + made to turn off array status for an array variable, or an attempt + is made to display a non-existent function with `-f'. + +`echo' + echo [-neE] [ARG ...] + + Output the ARGs, separated by spaces, terminated with a newline. + The return status is 0 unless a write error occurs. If `-n' is + specified, the trailing newline is suppressed. If the `-e' option + is given, interpretation of the following backslash-escaped + characters is enabled. The `-E' option disables the + interpretation of these escape characters, even on systems where + they are interpreted by default. The `xpg_echo' shell option may + be used to dynamically determine whether or not `echo' expands + these escape characters by default. `echo' does not interpret + `--' to mean the end of options. + + `echo' interprets the following escape sequences: + `\a' + alert (bell) + + `\b' + backspace + + `\c' + suppress further output + + `\e' + `\E' + escape + + `\f' + form feed + + `\n' + new line + + `\r' + carriage return + + `\t' + horizontal tab + + `\v' + vertical tab + + `\\' + backslash + + `\0NNN' + the eight-bit character whose value is the octal value NNN + (zero to three octal digits) + + `\xHH' + the eight-bit character whose value is the hexadecimal value + HH (one or two hex digits) + + `\uHHHH' + the Unicode (ISO/IEC 10646) character whose value is the + hexadecimal value HHHH (one to four hex digits) + + `\UHHHHHHHH' + the Unicode (ISO/IEC 10646) character whose value is the + hexadecimal value HHHHHHHH (one to eight hex digits) + +`enable' + enable [-a] [-dnps] [-f FILENAME] [NAME ...] + + Enable and disable builtin shell commands. Disabling a builtin + allows a disk command which has the same name as a shell builtin + to be executed without specifying a full pathname, even though the + shell normally searches for builtins before disk commands. If + `-n' is used, the NAMEs become disabled. Otherwise NAMEs are + enabled. For example, to use the `test' binary found via `$PATH' + instead of the shell builtin version, type `enable -n test'. + + If the `-p' option is supplied, or no NAME arguments appear, a + list of shell builtins is printed. With no other arguments, the + list consists of all enabled shell builtins. The `-a' option + means to list each builtin with an indication of whether or not it + is enabled. + + The `-f' option means to load the new builtin command NAME from + shared object FILENAME, on systems that support dynamic loading. + The `-d' option will delete a builtin loaded with `-f'. + + If there are no options, a list of the shell builtins is displayed. + The `-s' option restricts `enable' to the POSIX special builtins. + If `-s' is used with `-f', the new builtin becomes a special + builtin (*note Special Builtins::). + + The return status is zero unless a NAME is not a shell builtin or + there is an error loading a new builtin from a shared object. + +`help' + help [-dms] [PATTERN] + + Display helpful information about builtin commands. If PATTERN is + specified, `help' gives detailed help on all commands matching + PATTERN, otherwise a list of the builtins is printed. + + Options, if supplied, have the following meanings: + + `-d' + Display a short description of each PATTERN + + `-m' + Display the description of each PATTERN in a manpage-like + format + + `-s' + Display only a short usage synopsis for each PATTERN + + The return status is zero unless no command matches PATTERN. + +`let' + let EXPRESSION [EXPRESSION ...] + + The `let' builtin allows arithmetic to be performed on shell + variables. Each EXPRESSION is evaluated according to the rules + given below in *note Shell Arithmetic::. If the last EXPRESSION + evaluates to 0, `let' returns 1; otherwise 0 is returned. + +`local' + local [OPTION] NAME[=VALUE] ... + + For each argument, a local variable named NAME is created, and + assigned VALUE. The OPTION can be any of the options accepted by + `declare'. `local' can only be used within a function; it makes + the variable NAME have a visible scope restricted to that function + and its children. The return status is zero unless `local' is + used outside a function, an invalid NAME is supplied, or NAME is a + readonly variable. + +`logout' + logout [N] + + Exit a login shell, returning a status of N to the shell's parent. + +`mapfile' + mapfile [-n COUNT] [-O ORIGIN] [-s COUNT] [-t] [-u FD] + [-C CALLBACK] [-c QUANTUM] [ARRAY] + + Read lines from the standard input into the indexed array variable + ARRAY, or from file descriptor FD if the `-u' option is supplied. + The variable `MAPFILE' is the default ARRAY. Options, if + supplied, have the following meanings: + + `-n' + Copy at most COUNT lines. If COUNT is 0, all lines are + copied. + + `-O' + Begin assigning to ARRAY at index ORIGIN. The default index + is 0. + + `-s' + Discard the first COUNT lines read. + + `-t' + Remove a trailing newline from each line read. + + `-u' + Read lines from file descriptor FD instead of the standard + input. + + `-C' + Evaluate CALLBACK each time QUANTUMP lines are read. The + `-c' option specifies QUANTUM. + + `-c' + Specify the number of lines read between each call to + CALLBACK. + + If `-C' is specified without `-c', the default quantum is 5000. + When CALLBACK is evaluated, it is supplied the index of the next + array element to be assigned and the line to be assigned to that + element as additional arguments. CALLBACK is evaluated after the + line is read but before the array element is assigned. + + If not supplied with an explicit origin, `mapfile' will clear ARRAY + before assigning to it. + + `mapfile' returns successfully unless an invalid option or option + argument is supplied, ARRAY is invalid or unassignable, or ARRAY + is not an indexed array. + +`printf' + printf [-v VAR] FORMAT [ARGUMENTS] + + Write the formatted ARGUMENTS to the standard output under the + control of the FORMAT. The `-v' option causes the output to be + assigned to the variable VAR rather than being printed to the + standard output. + + The FORMAT is a character string which contains three types of + objects: plain characters, which are simply copied to standard + output, character escape sequences, which are converted and copied + to the standard output, and format specifications, each of which + causes printing of the next successive ARGUMENT. In addition to + the standard `printf(1)' formats, `printf' interprets the + following extensions: + + `%b' + Causes `printf' to expand backslash escape sequences in the + corresponding ARGUMENT, except that `\c' terminates output, + backslashes in `\'', `\"', and `\?' are not removed, and + octal escapes beginning with `\0' may contain up to four + digits. + + `%q' + Causes `printf' to output the corresponding ARGUMENT in a + format that can be reused as shell input. + + `%(DATEFMT)T' + Causes `printf' to output the date-time string resulting from + using DATEFMT as a format string for `strftime'(3). The + corresponding ARGUMENT is an integer representing the number + of seconds since the epoch. Two special argument values may + be used: -1 represents the current time, and -2 represents + the time the shell was invoked. If no argument is specified, + conversion behaves as if -1 had been given. This is an + exception to the usual `printf' behavior. + + Arguments to non-string format specifiers are treated as C + language constants, except that a leading plus or minus sign is + allowed, and if the leading character is a single or double quote, + the value is the ASCII value of the following character. + + The FORMAT is reused as necessary to consume all of the ARGUMENTS. + If the FORMAT requires more ARGUMENTS than are supplied, the extra + format specifications behave as if a zero value or null string, as + appropriate, had been supplied. The return value is zero on + success, non-zero on failure. + +`read' + read [-ers] [-a ANAME] [-d DELIM] [-i TEXT] [-n NCHARS] + [-N NCHARS] [-p PROMPT] [-t TIMEOUT] [-u FD] [NAME ...] + + One line is read from the standard input, or from the file + descriptor FD supplied as an argument to the `-u' option, and the + first word is assigned to the first NAME, the second word to the + second NAME, and so on, with leftover words and their intervening + separators assigned to the last NAME. If there are fewer words + read from the input stream than names, the remaining names are + assigned empty values. The characters in the value of the `IFS' + variable are used to split the line into words using the same + rules the shell uses for expansion (described above in *note Word + Splitting::). The backslash character `\' may be used to remove + any special meaning for the next character read and for line + continuation. If no names are supplied, the line read is assigned + to the variable `REPLY'. The return code is zero, unless + end-of-file is encountered, `read' times out (in which case the + return code is greater than 128), a variable assignment error + (such as assigning to a readonly variable) occurs, or an invalid + file descriptor is supplied as the argument to `-u'. + + Options, if supplied, have the following meanings: + + `-a ANAME' + The words are assigned to sequential indices of the array + variable ANAME, starting at 0. All elements are removed from + ANAME before the assignment. Other NAME arguments are + ignored. + + `-d DELIM' + The first character of DELIM is used to terminate the input + line, rather than newline. + + `-e' + Readline (*note Command Line Editing::) is used to obtain the + line. Readline uses the current (or default, if line editing + was not previously active) editing settings. + + `-i TEXT' + If Readline is being used to read the line, TEXT is placed + into the editing buffer before editing begins. + + `-n NCHARS' + `read' returns after reading NCHARS characters rather than + waiting for a complete line of input, but honor a delimiter + if fewer than NCHARS characters are read before the delimiter. + + `-N NCHARS' + `read' returns after reading exactly NCHARS characters rather + than waiting for a complete line of input, unless EOF is + encountered or `read' times out. Delimiter characters + encountered in the input are not treated specially and do not + cause `read' to return until NCHARS characters are read. + + `-p PROMPT' + Display PROMPT, without a trailing newline, before attempting + to read any input. The prompt is displayed only if input is + coming from a terminal. + + `-r' + If this option is given, backslash does not act as an escape + character. The backslash is considered to be part of the + line. In particular, a backslash-newline pair may not be + used as a line continuation. + + `-s' + Silent mode. If input is coming from a terminal, characters + are not echoed. + + `-t TIMEOUT' + Cause `read' to time out and return failure if a complete + line of input (or a specified number of characters) is not + read within TIMEOUT seconds. TIMEOUT may be a decimal + number with a fractional portion following the decimal point. + This option is only effective if `read' is reading input from + a terminal, pipe, or other special file; it has no effect + when reading from regular files. If `read' times out, `read' + saves any partial input read into the specified variable NAME. + If TIMEOUT is 0, `read' returns immediately, without trying to + read and data. The exit status is 0 if input is available on + the specified file descriptor, non-zero otherwise. The exit + status is greater than 128 if the timeout is exceeded. + + `-u FD' + Read input from file descriptor FD. + +`readarray' + readarray [-n COUNT] [-O ORIGIN] [-s COUNT] [-t] [-u FD] + [-C CALLBACK] [-c QUANTUM] [ARRAY] + + Read lines from the standard input into the indexed array variable + ARRAY, or from file descriptor FD if the `-u' option is supplied. + + A synonym for `mapfile'. + +`source' + source FILENAME + + A synonym for `.' (*note Bourne Shell Builtins::). + +`type' + type [-afptP] [NAME ...] + + For each NAME, indicate how it would be interpreted if used as a + command name. + + If the `-t' option is used, `type' prints a single word which is + one of `alias', `function', `builtin', `file' or `keyword', if + NAME is an alias, shell function, shell builtin, disk file, or + shell reserved word, respectively. If the NAME is not found, then + nothing is printed, and `type' returns a failure status. + + If the `-p' option is used, `type' either returns the name of the + disk file that would be executed, or nothing if `-t' would not + return `file'. + + The `-P' option forces a path search for each NAME, even if `-t' + would not return `file'. + + If a command is hashed, `-p' and `-P' print the hashed value, + which is not necessarily the file that appears first in `$PATH'. + + If the `-a' option is used, `type' returns all of the places that + contain an executable named FILE. This includes aliases and + functions, if and only if the `-p' option is not also used. + + If the `-f' option is used, `type' does not attempt to find shell + functions, as with the `command' builtin. + + The return status is zero if all of the NAMES are found, non-zero + if any are not found. + +`typeset' + typeset [-afFgrxilnrtux] [-p] [NAME[=VALUE] ...] + + The `typeset' command is supplied for compatibility with the Korn + shell. It is a synonym for the `declare' builtin command. + +`ulimit' + ulimit [-abcdefilmnpqrstuvxHST] [LIMIT] + + `ulimit' provides control over the resources available to processes + started by the shell, on systems that allow such control. If an + option is given, it is interpreted as follows: + + `-S' + Change and report the soft limit associated with a resource. + + `-H' + Change and report the hard limit associated with a resource. + + `-a' + All current limits are reported. + + `-b' + The maximum socket buffer size. + + `-c' + The maximum size of core files created. + + `-d' + The maximum size of a process's data segment. + + `-e' + The maximum scheduling priority ("nice"). + + `-f' + The maximum size of files written by the shell and its + children. + + `-i' + The maximum number of pending signals. + + `-l' + The maximum size that may be locked into memory. + + `-m' + The maximum resident set size (many systems do not honor this + limit). + + `-n' + The maximum number of open file descriptors (most systems do + not allow this value to be set). + + `-p' + The pipe buffer size. + + `-q' + The maximum number of bytes in POSIX message queues. + + `-r' + The maximum real-time scheduling priority. + + `-s' + The maximum stack size. + + `-t' + The maximum amount of cpu time in seconds. + + `-u' + The maximum number of processes available to a single user. + + `-v' + The maximum amount of virtual memory available to the shell, + and, on some systems, to its children. + + `-x' + The maximum number of file locks. + + `-T' + The maximum number of threads. + + If LIMIT is given, and the `-a' option is not used, LIMIT is the + new value of the specified resource. The special LIMIT values + `hard', `soft', and `unlimited' stand for the current hard limit, + the current soft limit, and no limit, respectively. A hard limit + cannot be increased by a non-root user once it is set; a soft + limit may be increased up to the value of the hard limit. + Otherwise, the current value of the soft limit for the specified + resource is printed, unless the `-H' option is supplied. When + setting new limits, if neither `-H' nor `-S' is supplied, both the + hard and soft limits are set. If no option is given, then `-f' is + assumed. Values are in 1024-byte increments, except for `-t', + which is in seconds; `-p', which is in units of 512-byte blocks; + and `-T', `-b', `-n' and `-u', which are unscaled values. + + The return status is zero unless an invalid option or argument is + supplied, or an error occurs while setting a new limit. + +`unalias' + unalias [-a] [NAME ... ] + + Remove each NAME from the list of aliases. If `-a' is supplied, + all aliases are removed. Aliases are described in *note Aliases::. + + +File: bashref.info, Node: Modifying Shell Behavior, Next: Special Builtins, Prev: Bash Builtins, Up: Shell Builtin Commands + +4.3 Modifying Shell Behavior +============================ + +* Menu: + +* The Set Builtin:: Change the values of shell attributes and + positional parameters. +* The Shopt Builtin:: Modify shell optional behavior. + + +File: bashref.info, Node: The Set Builtin, Next: The Shopt Builtin, Up: Modifying Shell Behavior + +4.3.1 The Set Builtin +--------------------- + +This builtin is so complicated that it deserves its own section. `set' +allows you to change the values of shell options and set the positional +parameters, or to display the names and values of shell variables. + +`set' + set [--abefhkmnptuvxBCEHPT] [-o OPTION-NAME] [ARGUMENT ...] + set [+abefhkmnptuvxBCEHPT] [+o OPTION-NAME] [ARGUMENT ...] + + If no options or arguments are supplied, `set' displays the names + and values of all shell variables and functions, sorted according + to the current locale, in a format that may be reused as input for + setting or resetting the currently-set variables. Read-only + variables cannot be reset. In POSIX mode, only shell variables + are listed. + + When options are supplied, they set or unset shell attributes. + Options, if specified, have the following meanings: + + `-a' + Mark variables and function which are modified or created for + export to the environment of subsequent commands. + + `-b' + Cause the status of terminated background jobs to be reported + immediately, rather than before printing the next primary + prompt. + + `-e' + Exit immediately if a pipeline (*note Pipelines::), which may + consist of a single simple command (*note Simple Commands::), + a list (*note Lists::), or a compound command (*note Compound + Commands::) returns a non-zero status. The shell does not + exit if the command that fails is part of the command list + immediately following a `while' or `until' keyword, part of + the test in an `if' statement, part of any command executed + in a `&&' or `||' list except the command following the final + `&&' or `||', any command in a pipeline but the last, or if + the command's return status is being inverted with `!'. If a + compound command other than a subshell returns a non-zero + status because a command failed while `-e' was being ignored, + the shell does not exit. A trap on `ERR', if set, is + executed before the shell exits. + + This option applies to the shell environment and each + subshell environment separately (*note Command Execution + Environment::), and may cause subshells to exit before + executing all the commands in the subshell. + + If a compound command or shell function executes in a context + where `-e' is being ignored, none of the commands executed + within the compound command or function body will be affected + by the `-e' setting, even if `-e' is set and a command + returns a failure status. If a compound command or shell + function sets `-e' while executing in a context where `-e' is + ignored, that setting will not have any effect until the + compound command or the command containing the function call + completes. + + `-f' + Disable filename expansion (globbing). + + `-h' + Locate and remember (hash) commands as they are looked up for + execution. This option is enabled by default. + + `-k' + All arguments in the form of assignment statements are placed + in the environment for a command, not just those that precede + the command name. + + `-m' + Job control is enabled (*note Job Control::). All processes + run in a separate process group. When a background job + completes, the shell prints a line containing its exit status. + + `-n' + Read commands but do not execute them; this may be used to + check a script for syntax errors. This option is ignored by + interactive shells. + + `-o OPTION-NAME' + Set the option corresponding to OPTION-NAME: + + `allexport' + Same as `-a'. + + `braceexpand' + Same as `-B'. + + `emacs' + Use an `emacs'-style line editing interface (*note + Command Line Editing::). This also affects the editing + interface used for `read -e'. + + `errexit' + Same as `-e'. + + `errtrace' + Same as `-E'. + + `functrace' + Same as `-T'. + + `hashall' + Same as `-h'. + + `histexpand' + Same as `-H'. + + `history' + Enable command history, as described in *note Bash + History Facilities::. This option is on by default in + interactive shells. + + `ignoreeof' + An interactive shell will not exit upon reading EOF. + + `keyword' + Same as `-k'. + + `monitor' + Same as `-m'. + + `noclobber' + Same as `-C'. + + `noexec' + Same as `-n'. + + `noglob' + Same as `-f'. + + `nolog' + Currently ignored. + + `notify' + Same as `-b'. + + `nounset' + Same as `-u'. + + `onecmd' + Same as `-t'. + + `physical' + Same as `-P'. + + `pipefail' + If set, the return value of a pipeline is the value of + the last (rightmost) command to exit with a non-zero + status, or zero if all commands in the pipeline exit + successfully. This option is disabled by default. + + `posix' + Change the behavior of Bash where the default operation + differs from the POSIX standard to match the standard + (*note Bash POSIX Mode::). This is intended to make + Bash behave as a strict superset of that standard. + + `privileged' + Same as `-p'. + + `verbose' + Same as `-v'. + + `vi' + Use a `vi'-style line editing interface. This also + affects the editing interface used for `read -e'. + + `xtrace' + Same as `-x'. + + `-p' + Turn on privileged mode. In this mode, the `$BASH_ENV' and + `$ENV' files are not processed, shell functions are not + inherited from the environment, and the `SHELLOPTS', + `BASHOPTS', `CDPATH' and `GLOBIGNORE' variables, if they + appear in the environment, are ignored. If the shell is + started with the effective user (group) id not equal to the + real user (group) id, and the `-p' option is not supplied, + these actions are taken and the effective user id is set to + the real user id. If the `-p' option is supplied at startup, + the effective user id is not reset. Turning this option off + causes the effective user and group ids to be set to the real + user and group ids. + + `-t' + Exit after reading and executing one command. + + `-u' + Treat unset variables and parameters other than the special + parameters `@' or `*' as an error when performing parameter + expansion. An error message will be written to the standard + error, and a non-interactive shell will exit. + + `-v' + Print shell input lines as they are read. + + `-x' + Print a trace of simple commands, `for' commands, `case' + commands, `select' commands, and arithmetic `for' commands + and their arguments or associated word lists after they are + expanded and before they are executed. The value of the `PS4' + variable is expanded and the resultant value is printed before + the command and its expanded arguments. + + `-B' + The shell will perform brace expansion (*note Brace + Expansion::). This option is on by default. + + `-C' + Prevent output redirection using `>', `>&', and `<>' from + overwriting existing files. + + `-E' + If set, any trap on `ERR' is inherited by shell functions, + command substitutions, and commands executed in a subshell + environment. The `ERR' trap is normally not inherited in + such cases. + + `-H' + Enable `!' style history substitution (*note History + Interaction::). This option is on by default for interactive + shells. + + `-P' + If set, do not resolve symbolic links when performing + commands such as `cd' which change the current directory. + The physical directory is used instead. By default, Bash + follows the logical chain of directories when performing + commands which change the current directory. + + For example, if `/usr/sys' is a symbolic link to + `/usr/local/sys' then: + $ cd /usr/sys; echo $PWD + /usr/sys + $ cd ..; pwd + /usr + + If `set -P' is on, then: + $ cd /usr/sys; echo $PWD + /usr/local/sys + $ cd ..; pwd + /usr/local + + `-T' + If set, any trap on `DEBUG' and `RETURN' are inherited by + shell functions, command substitutions, and commands executed + in a subshell environment. The `DEBUG' and `RETURN' traps + are normally not inherited in such cases. + + `--' + If no arguments follow this option, then the positional + parameters are unset. Otherwise, the positional parameters + are set to the ARGUMENTS, even if some of them begin with a + `-'. + + `-' + Signal the end of options, cause all remaining ARGUMENTS to + be assigned to the positional parameters. The `-x' and `-v' + options are turned off. If there are no arguments, the + positional parameters remain unchanged. + + Using `+' rather than `-' causes these options to be turned off. + The options can also be used upon invocation of the shell. The + current set of options may be found in `$-'. + + The remaining N ARGUMENTS are positional parameters and are + assigned, in order, to `$1', `$2', ... `$N'. The special + parameter `#' is set to N. + + The return status is always zero unless an invalid option is + supplied. + + +File: bashref.info, Node: The Shopt Builtin, Prev: The Set Builtin, Up: Modifying Shell Behavior + +4.3.2 The Shopt Builtin +----------------------- + +This builtin allows you to change additional shell optional behavior. + +`shopt' + shopt [-pqsu] [-o] [OPTNAME ...] + + Toggle the values of settings controlling optional shell behavior. + The settings can be either those listed below, or, if the `-o' + option is used, those available with the `-o' option to the `set' + builtin command (*note The Set Builtin::). With no options, or + with the `-p' option, a list of all settable options is displayed, + with an indication of whether or not each is set. The `-p' option + causes output to be displayed in a form that may be reused as + input. Other options have the following meanings: + + `-s' + Enable (set) each OPTNAME. + + `-u' + Disable (unset) each OPTNAME. + + `-q' + Suppresses normal output; the return status indicates whether + the OPTNAME is set or unset. If multiple OPTNAME arguments + are given with `-q', the return status is zero if all + OPTNAMES are enabled; non-zero otherwise. + + `-o' + Restricts the values of OPTNAME to be those defined for the + `-o' option to the `set' builtin (*note The Set Builtin::). + + If either `-s' or `-u' is used with no OPTNAME arguments, `shopt' + shows only those options which are set or unset, respectively. + + Unless otherwise noted, the `shopt' options are disabled (off) by + default. + + The return status when listing options is zero if all OPTNAMES are + enabled, non-zero otherwise. When setting or unsetting options, + the return status is zero unless an OPTNAME is not a valid shell + option. + + The list of `shopt' options is: + `autocd' + If set, a command name that is the name of a directory is + executed as if it were the argument to the `cd' command. + This option is only used by interactive shells. + + `cdable_vars' + If this is set, an argument to the `cd' builtin command that + is not a directory is assumed to be the name of a variable + whose value is the directory to change to. + + `cdspell' + If set, minor errors in the spelling of a directory component + in a `cd' command will be corrected. The errors checked for + are transposed characters, a missing character, and a + character too many. If a correction is found, the corrected + path is printed, and the command proceeds. This option is + only used by interactive shells. + + `checkhash' + If this is set, Bash checks that a command found in the hash + table exists before trying to execute it. If a hashed + command no longer exists, a normal path search is performed. + + `checkjobs' + If set, Bash lists the status of any stopped and running jobs + before exiting an interactive shell. If any jobs are + running, this causes the exit to be deferred until a second + exit is attempted without an intervening command (*note Job + Control::). The shell always postpones exiting if any jobs + are stopped. + + `checkwinsize' + If set, Bash checks the window size after each command and, + if necessary, updates the values of `LINES' and `COLUMNS'. + + `cmdhist' + If set, Bash attempts to save all lines of a multiple-line + command in the same history entry. This allows easy + re-editing of multi-line commands. + + `compat31' + If set, Bash changes its behavior to that of version 3.1 with + respect to quoted arguments to the conditional command's `=~' + operator and with respect to locale-specific string + comparison when using the `[[' conditional command's `<' and + `>' operators. Bash versions prior to bash-4.1 use ASCII + collation and strcmp(3); bash-4.1 and later use the current + locale's collation sequence and strcoll(3). + + `compat32' + If set, Bash changes its behavior to that of version 3.2 with + respect to locale-specific string comparison when using the + `[[' conditional command's `<' and `>' operators (see + previous item). + + `compat40' + If set, Bash changes its behavior to that of version 4.0 with + respect to locale-specific string comparison when using the + `[[' conditional command's `<' and `>' operators (see + description of `compat31') and the effect of interrupting a + command list. Bash versions 4.0 and later interrupt the list + as if the shell received the interrupt; previous versions + continue with the next command in the list. + + `compat41' + If set, Bash, when in POSIX mode, treats a single quote in a + double-quoted parameter expansion as a special character. + The single quotes must match (an even number) and the + characters between the single quotes are considered quoted. + This is the behavior of POSIX mode through version 4.1. The + default Bash behavior remains as in previous versions. + + `compat42' + If set, Bash does not process the replacement string in the + pattern substitution word expansion using quote removal. + + `complete_fullquote' + If set, Bash quotes all shell metacharacters in filenames and + directory names when performing completion. If not set, Bash + removes metacharacters such as the dollar sign from the set of + characters that will be quoted in completed filenames when + these metacharacters appear in shell variable references in + words to be completed. This means that dollar signs in + variable names that expand to directories will not be quoted; + however, any dollar signs appearing in filenames will not be + quoted, either. This is active only when bash is using + backslashes to quote completed filenames. This variable is + set by default, which is the default Bash behavior in + versions through 4.2. + + `direxpand' + If set, Bash replaces directory names with the results of + word expansion when performing filename completion. This + changes the contents of the readline editing buffer. If not + set, Bash attempts to preserve what the user typed. + + `dirspell' + If set, Bash attempts spelling correction on directory names + during word completion if the directory name initially + supplied does not exist. + + `dotglob' + If set, Bash includes filenames beginning with a `.' in the + results of filename expansion. + + `execfail' + If this is set, a non-interactive shell will not exit if it + cannot execute the file specified as an argument to the `exec' + builtin command. An interactive shell does not exit if `exec' + fails. + + `expand_aliases' + If set, aliases are expanded as described below under Aliases, + *note Aliases::. This option is enabled by default for + interactive shells. + + `extdebug' + If set, behavior intended for use by debuggers is enabled: + + 1. The `-F' option to the `declare' builtin (*note Bash + Builtins::) displays the source file name and line + number corresponding to each function name supplied as + an argument. + + 2. If the command run by the `DEBUG' trap returns a + non-zero value, the next command is skipped and not + executed. + + 3. If the command run by the `DEBUG' trap returns a value + of 2, and the shell is executing in a subroutine (a + shell function or a shell script executed by the `.' or + `source' builtins), a call to `return' is simulated. + + 4. `BASH_ARGC' and `BASH_ARGV' are updated as described in + their descriptions (*note Bash Variables::). + + 5. Function tracing is enabled: command substitution, + shell functions, and subshells invoked with `( COMMAND + )' inherit the `DEBUG' and `RETURN' traps. + + 6. Error tracing is enabled: command substitution, shell + functions, and subshells invoked with `( COMMAND )' + inherit the `ERR' trap. + + `extglob' + If set, the extended pattern matching features described above + (*note Pattern Matching::) are enabled. + + `extquote' + If set, `$'STRING'' and `$"STRING"' quoting is performed + within `${PARAMETER}' expansions enclosed in double quotes. + This option is enabled by default. + + `failglob' + If set, patterns which fail to match filenames during + filename expansion result in an expansion error. + + `force_fignore' + If set, the suffixes specified by the `FIGNORE' shell variable + cause words to be ignored when performing word completion + even if the ignored words are the only possible completions. + *Note Bash Variables::, for a description of `FIGNORE'. This + option is enabled by default. + + `globasciiranges' + If set, range expressions used in pattern matching bracket + expressions (*note Pattern Matching::) behave as if in the + traditional C locale when performing comparisons. That is, + the current locale's collating sequence is not taken into + account, so `b' will not collate between `A' and `B', and + upper-case and lower-case ASCII characters will collate + together. + + `globstar' + If set, the pattern `**' used in a filename expansion context + will match all files and zero or more directories and + subdirectories. If the pattern is followed by a `/', only + directories and subdirectories match. + + `gnu_errfmt' + If set, shell error messages are written in the standard GNU + error message format. + + `histappend' + If set, the history list is appended to the file named by the + value of the `HISTFILE' variable when the shell exits, rather + than overwriting the file. + + `histreedit' + If set, and Readline is being used, a user is given the + opportunity to re-edit a failed history substitution. + + `histverify' + If set, and Readline is being used, the results of history + substitution are not immediately passed to the shell parser. + Instead, the resulting line is loaded into the Readline + editing buffer, allowing further modification. + + `hostcomplete' + If set, and Readline is being used, Bash will attempt to + perform hostname completion when a word containing a `@' is + being completed (*note Commands For Completion::). This + option is enabled by default. + + `huponexit' + If set, Bash will send `SIGHUP' to all jobs when an + interactive login shell exits (*note Signals::). + + `interactive_comments' + Allow a word beginning with `#' to cause that word and all + remaining characters on that line to be ignored in an + interactive shell. This option is enabled by default. + + `lastpipe' + If set, and job control is not active, the shell runs the + last command of a pipeline not executed in the background in + the current shell environment. + + `lithist' + If enabled, and the `cmdhist' option is enabled, multi-line + commands are saved to the history with embedded newlines + rather than using semicolon separators where possible. + + `login_shell' + The shell sets this option if it is started as a login shell + (*note Invoking Bash::). The value may not be changed. + + `mailwarn' + If set, and a file that Bash is checking for mail has been + accessed since the last time it was checked, the message + `"The mail in MAILFILE has been read"' is displayed. + + `no_empty_cmd_completion' + If set, and Readline is being used, Bash will not attempt to + search the `PATH' for possible completions when completion is + attempted on an empty line. + + `nocaseglob' + If set, Bash matches filenames in a case-insensitive fashion + when performing filename expansion. + + `nocasematch' + If set, Bash matches patterns in a case-insensitive fashion + when performing matching while executing `case' or `[[' + conditional commands. + + `nullglob' + If set, Bash allows filename patterns which match no files to + expand to a null string, rather than themselves. + + `progcomp' + If set, the programmable completion facilities (*note + Programmable Completion::) are enabled. This option is + enabled by default. + + `promptvars' + If set, prompt strings undergo parameter expansion, command + substitution, arithmetic expansion, and quote removal after + being expanded as described below (*note Controlling the + Prompt::). This option is enabled by default. + + `restricted_shell' + The shell sets this option if it is started in restricted mode + (*note The Restricted Shell::). The value may not be changed. + This is not reset when the startup files are executed, + allowing the startup files to discover whether or not a shell + is restricted. + + `shift_verbose' + If this is set, the `shift' builtin prints an error message + when the shift count exceeds the number of positional + parameters. + + `sourcepath' + If set, the `source' builtin uses the value of `PATH' to find + the directory containing the file supplied as an argument. + This option is enabled by default. + + `xpg_echo' + If set, the `echo' builtin expands backslash-escape sequences + by default. + + + The return status when listing options is zero if all OPTNAMES are + enabled, non-zero otherwise. When setting or unsetting options, + the return status is zero unless an OPTNAME is not a valid shell + option. + + +File: bashref.info, Node: Special Builtins, Prev: Modifying Shell Behavior, Up: Shell Builtin Commands + +4.4 Special Builtins +==================== + +For historical reasons, the POSIX standard has classified several +builtin commands as _special_. When Bash is executing in POSIX mode, +the special builtins differ from other builtin commands in three +respects: + + 1. Special builtins are found before shell functions during command + lookup. + + 2. If a special builtin returns an error status, a non-interactive + shell exits. + + 3. Assignment statements preceding the command stay in effect in the + shell environment after the command completes. + + When Bash is not executing in POSIX mode, these builtins behave no +differently than the rest of the Bash builtin commands. The Bash POSIX +mode is described in *note Bash POSIX Mode::. + + These are the POSIX special builtins: + break : . continue eval exec exit export readonly return set + shift trap unset + + +File: bashref.info, Node: Shell Variables, Next: Bash Features, Prev: Shell Builtin Commands, Up: Top + +5 Shell Variables +***************** + +* Menu: + +* Bourne Shell Variables:: Variables which Bash uses in the same way + as the Bourne Shell. +* Bash Variables:: List of variables that exist in Bash. + + This chapter describes the shell variables that Bash uses. Bash +automatically assigns default values to a number of variables. + + +File: bashref.info, Node: Bourne Shell Variables, Next: Bash Variables, Up: Shell Variables + +5.1 Bourne Shell Variables +========================== + +Bash uses certain shell variables in the same way as the Bourne shell. +In some cases, Bash assigns a default value to the variable. + +`CDPATH' + A colon-separated list of directories used as a search path for + the `cd' builtin command. + +`HOME' + The current user's home directory; the default for the `cd' builtin + command. The value of this variable is also used by tilde + expansion (*note Tilde Expansion::). + +`IFS' + A list of characters that separate fields; used when the shell + splits words as part of expansion. + +`MAIL' + If this parameter is set to a filename or directory name and the + `MAILPATH' variable is not set, Bash informs the user of the + arrival of mail in the specified file or Maildir-format directory. + +`MAILPATH' + A colon-separated list of filenames which the shell periodically + checks for new mail. Each list entry can specify the message that + is printed when new mail arrives in the mail file by separating + the filename from the message with a `?'. When used in the text + of the message, `$_' expands to the name of the current mail file. + +`OPTARG' + The value of the last option argument processed by the `getopts' + builtin. + +`OPTIND' + The index of the last option argument processed by the `getopts' + builtin. + +`PATH' + A colon-separated list of directories in which the shell looks for + commands. A zero-length (null) directory name in the value of + `PATH' indicates the current directory. A null directory name may + appear as two adjacent colons, or as an initial or trailing colon. + +`PS1' + The primary prompt string. The default value is `\s-\v\$ '. + *Note Controlling the Prompt::, for the complete list of escape + sequences that are expanded before `PS1' is displayed. + +`PS2' + The secondary prompt string. The default value is `> '. + + + +File: bashref.info, Node: Bash Variables, Prev: Bourne Shell Variables, Up: Shell Variables + +5.2 Bash Variables +================== + +These variables are set or used by Bash, but other shells do not +normally treat them specially. + + A few variables used by Bash are described in different chapters: +variables for controlling the job control facilities (*note Job Control +Variables::). + +`BASH' + The full pathname used to execute the current instance of Bash. + +`BASHOPTS' + A colon-separated list of enabled shell options. Each word in the + list is a valid argument for the `-s' option to the `shopt' + builtin command (*note The Shopt Builtin::). The options + appearing in `BASHOPTS' are those reported as `on' by `shopt'. If + this variable is in the environment when Bash starts up, each + shell option in the list will be enabled before reading any + startup files. This variable is readonly. + +`BASHPID' + Expands to the process ID of the current Bash process. This + differs from `$$' under certain circumstances, such as subshells + that do not require Bash to be re-initialized. + +`BASH_ALIASES' + An associative array variable whose members correspond to the + internal list of aliases as maintained by the `alias' builtin. + (*note Bourne Shell Builtins::). Elements added to this array + appear in the alias list; unsetting array elements cause aliases + to be removed from the alias list. + +`BASH_ARGC' + An array variable whose values are the number of parameters in each + frame of the current bash execution call stack. The number of + parameters to the current subroutine (shell function or script + executed with `.' or `source') is at the top of the stack. When a + subroutine is executed, the number of parameters passed is pushed + onto `BASH_ARGC'. The shell sets `BASH_ARGC' only when in + extended debugging mode (see *note The Shopt Builtin:: for a + description of the `extdebug' option to the `shopt' builtin). + +`BASH_ARGV' + An array variable containing all of the parameters in the current + bash execution call stack. The final parameter of the last + subroutine call is at the top of the stack; the first parameter of + the initial call is at the bottom. When a subroutine is executed, + the parameters supplied are pushed onto `BASH_ARGV'. The shell + sets `BASH_ARGV' only when in extended debugging mode (see *note + The Shopt Builtin:: for a description of the `extdebug' option to + the `shopt' builtin). + +`BASH_CMDS' + An associative array variable whose members correspond to the + internal hash table of commands as maintained by the `hash' builtin + (*note Bourne Shell Builtins::). Elements added to this array + appear in the hash table; unsetting array elements cause commands + to be removed from the hash table. + +`BASH_COMMAND' + The command currently being executed or about to be executed, + unless the shell is executing a command as the result of a trap, + in which case it is the command executing at the time of the trap. + +`BASH_COMPAT' + The value is used to set the shell's compatibility level. *Note + The Shopt Builtin::, for a description of the various compatibility + levels and their effects. The value may be a decimal number + (e.g., 4.2) or an integer (e.g., 42) corresponding to the desired + compatibility level. If `BASH_COMPAT' is unset or set to the + empty string, the compatibility level is set to the default for + the current version. If `BASH_COMPAT' is set to a value that is + not one of the valid compatibility levels, the shell prints an + error message and sets the compatibility level to the default for + the current version. The valid compatibility levels correspond to + the compatibility options accepted by the `shopt' builtin + described above (for example, COMPAT42 means that 4.2 and 42 are + valid values). The current version is also a valid value. + +`BASH_ENV' + If this variable is set when Bash is invoked to execute a shell + script, its value is expanded and used as the name of a startup + file to read before executing the script. *Note Bash Startup + Files::. + +`BASH_EXECUTION_STRING' + The command argument to the `-c' invocation option. + +`BASH_LINENO' + An array variable whose members are the line numbers in source + files where each corresponding member of FUNCNAME was invoked. + `${BASH_LINENO[$i]}' is the line number in the source file + (`${BASH_SOURCE[$i+1]}') where `${FUNCNAME[$i]}' was called (or + `${BASH_LINENO[$i-1]}' if referenced within another shell + function). Use `LINENO' to obtain the current line number. + +`BASH_REMATCH' + An array variable whose members are assigned by the `=~' binary + operator to the `[[' conditional command (*note Conditional + Constructs::). The element with index 0 is the portion of the + string matching the entire regular expression. The element with + index N is the portion of the string matching the Nth + parenthesized subexpression. This variable is read-only. + +`BASH_SOURCE' + An array variable whose members are the source filenames where the + corresponding shell function names in the `FUNCNAME' array + variable are defined. The shell function `${FUNCNAME[$i]}' is + defined in the file `${BASH_SOURCE[$i]}' and called from + `${BASH_SOURCE[$i+1]}' + +`BASH_SUBSHELL' + Incremented by one within each subshell or subshell environment + when the shell begins executing in that environment. The initial + value is 0. + +`BASH_VERSINFO' + A readonly array variable (*note Arrays::) whose members hold + version information for this instance of Bash. The values + assigned to the array members are as follows: + + `BASH_VERSINFO[0]' + The major version number (the RELEASE). + + `BASH_VERSINFO[1]' + The minor version number (the VERSION). + + `BASH_VERSINFO[2]' + The patch level. + + `BASH_VERSINFO[3]' + The build version. + + `BASH_VERSINFO[4]' + The release status (e.g., BETA1). + + `BASH_VERSINFO[5]' + The value of `MACHTYPE'. + +`BASH_VERSION' + The version number of the current instance of Bash. + +`BASH_XTRACEFD' + If set to an integer corresponding to a valid file descriptor, Bash + will write the trace output generated when `set -x' is enabled to + that file descriptor. This allows tracing output to be separated + from diagnostic and error messages. The file descriptor is closed + when `BASH_XTRACEFD' is unset or assigned a new value. Unsetting + `BASH_XTRACEFD' or assigning it the empty string causes the trace + output to be sent to the standard error. Note that setting + `BASH_XTRACEFD' to 2 (the standard error file descriptor) and then + unsetting it will result in the standard error being closed. + +`CHILD_MAX' + Set the number of exited child status values for the shell to + remember. Bash will not allow this value to be decreased below a + POSIX-mandated minimum, and there is a maximum value (currently + 8192) that this may not exceed. The minimum value is + system-dependent. + +`COLUMNS' + Used by the `select' command to determine the terminal width when + printing selection lists. Automatically set if the `checkwinsize' + option is enabled (*note The Shopt Builtin::), or in an + interactive shell upon receipt of a `SIGWINCH'. + +`COMP_CWORD' + An index into `${COMP_WORDS}' of the word containing the current + cursor position. This variable is available only in shell + functions invoked by the programmable completion facilities (*note + Programmable Completion::). + +`COMP_LINE' + The current command line. This variable is available only in + shell functions and external commands invoked by the programmable + completion facilities (*note Programmable Completion::). + +`COMP_POINT' + The index of the current cursor position relative to the beginning + of the current command. If the current cursor position is at the + end of the current command, the value of this variable is equal to + `${#COMP_LINE}'. This variable is available only in shell + functions and external commands invoked by the programmable + completion facilities (*note Programmable Completion::). + +`COMP_TYPE' + Set to an integer value corresponding to the type of completion + attempted that caused a completion function to be called: TAB, for + normal completion, `?', for listing completions after successive + tabs, `!', for listing alternatives on partial word completion, + `@', to list completions if the word is not unmodified, or `%', + for menu completion. This variable is available only in shell + functions and external commands invoked by the programmable + completion facilities (*note Programmable Completion::). + +`COMP_KEY' + The key (or final key of a key sequence) used to invoke the current + completion function. + +`COMP_WORDBREAKS' + The set of characters that the Readline library treats as word + separators when performing word completion. If `COMP_WORDBREAKS' + is unset, it loses its special properties, even if it is + subsequently reset. + +`COMP_WORDS' + An array variable consisting of the individual words in the + current command line. The line is split into words as Readline + would split it, using `COMP_WORDBREAKS' as described above. This + variable is available only in shell functions invoked by the + programmable completion facilities (*note Programmable + Completion::). + +`COMPREPLY' + An array variable from which Bash reads the possible completions + generated by a shell function invoked by the programmable + completion facility (*note Programmable Completion::). Each array + element contains one possible completion. + +`COPROC' + An array variable created to hold the file descriptors for output + from and input to an unnamed coprocess (*note Coprocesses::). + +`DIRSTACK' + An array variable containing the current contents of the directory + stack. Directories appear in the stack in the order they are + displayed by the `dirs' builtin. Assigning to members of this + array variable may be used to modify directories already in the + stack, but the `pushd' and `popd' builtins must be used to add and + remove directories. Assignment to this variable will not change + the current directory. If `DIRSTACK' is unset, it loses its + special properties, even if it is subsequently reset. + +`EMACS' + If Bash finds this variable in the environment when the shell + starts with value `t', it assumes that the shell is running in an + Emacs shell buffer and disables line editing. + +`ENV' + Similar to `BASH_ENV'; used when the shell is invoked in POSIX + Mode (*note Bash POSIX Mode::). + +`EUID' + The numeric effective user id of the current user. This variable + is readonly. + +`FCEDIT' + The editor used as a default by the `-e' option to the `fc' + builtin command. + +`FIGNORE' + A colon-separated list of suffixes to ignore when performing + filename completion. A filename whose suffix matches one of the + entries in `FIGNORE' is excluded from the list of matched + filenames. A sample value is `.o:~' + +`FUNCNAME' + An array variable containing the names of all shell functions + currently in the execution call stack. The element with index 0 + is the name of any currently-executing shell function. The + bottom-most element (the one with the highest index) is `"main"'. + This variable exists only when a shell function is executing. + Assignments to `FUNCNAME' have no effect and return an error + status. If `FUNCNAME' is unset, it loses its special properties, + even if it is subsequently reset. + + This variable can be used with `BASH_LINENO' and `BASH_SOURCE'. + Each element of `FUNCNAME' has corresponding elements in + `BASH_LINENO' and `BASH_SOURCE' to describe the call stack. For + instance, `${FUNCNAME[$i]}' was called from the file + `${BASH_SOURCE[$i+1]}' at line number `${BASH_LINENO[$i]}'. The + `caller' builtin displays the current call stack using this + information. + +`FUNCNEST' + If set to a numeric value greater than 0, defines a maximum + function nesting level. Function invocations that exceed this + nesting level will cause the current command to abort. + +`GLOBIGNORE' + A colon-separated list of patterns defining the set of filenames to + be ignored by filename expansion. If a filename matched by a + filename expansion pattern also matches one of the patterns in + `GLOBIGNORE', it is removed from the list of matches. + +`GROUPS' + An array variable containing the list of groups of which the + current user is a member. Assignments to `GROUPS' have no effect + and return an error status. If `GROUPS' is unset, it loses its + special properties, even if it is subsequently reset. + +`histchars' + Up to three characters which control history expansion, quick + substitution, and tokenization (*note History Interaction::). The + first character is the HISTORY EXPANSION character, that is, the + character which signifies the start of a history expansion, + normally `!'. The second character is the character which + signifies `quick substitution' when seen as the first character on + a line, normally `^'. The optional third character is the + character which indicates that the remainder of the line is a + comment when found as the first character of a word, usually `#'. + The history comment character causes history substitution to be + skipped for the remaining words on the line. It does not + necessarily cause the shell parser to treat the rest of the line + as a comment. + +`HISTCMD' + The history number, or index in the history list, of the current + command. If `HISTCMD' is unset, it loses its special properties, + even if it is subsequently reset. + +`HISTCONTROL' + A colon-separated list of values controlling how commands are + saved on the history list. If the list of values includes + `ignorespace', lines which begin with a space character are not + saved in the history list. A value of `ignoredups' causes lines + which match the previous history entry to not be saved. A value + of `ignoreboth' is shorthand for `ignorespace' and `ignoredups'. + A value of `erasedups' causes all previous lines matching the + current line to be removed from the history list before that line + is saved. Any value not in the above list is ignored. If + `HISTCONTROL' is unset, or does not include a valid value, all + lines read by the shell parser are saved on the history list, + subject to the value of `HISTIGNORE'. The second and subsequent + lines of a multi-line compound command are not tested, and are + added to the history regardless of the value of `HISTCONTROL'. + +`HISTFILE' + The name of the file to which the command history is saved. The + default value is `~/.bash_history'. + +`HISTFILESIZE' + The maximum number of lines contained in the history file. When + this variable is assigned a value, the history file is truncated, + if necessary, to contain no more than that number of lines by + removing the oldest entries. The history file is also truncated + to this size after writing it when a shell exits. If the value is + 0, the history file is truncated to zero size. Non-numeric values + and numeric values less than zero inhibit truncation. The shell + sets the default value to the value of `HISTSIZE' after reading + any startup files. + +`HISTIGNORE' + A colon-separated list of patterns used to decide which command + lines should be saved on the history list. Each pattern is + anchored at the beginning of the line and must match the complete + line (no implicit `*' is appended). Each pattern is tested + against the line after the checks specified by `HISTCONTROL' are + applied. In addition to the normal shell pattern matching + characters, `&' matches the previous history line. `&' may be + escaped using a backslash; the backslash is removed before + attempting a match. The second and subsequent lines of a + multi-line compound command are not tested, and are added to the + history regardless of the value of `HISTIGNORE'. + + `HISTIGNORE' subsumes the function of `HISTCONTROL'. A pattern of + `&' is identical to `ignoredups', and a pattern of `[ ]*' is + identical to `ignorespace'. Combining these two patterns, + separating them with a colon, provides the functionality of + `ignoreboth'. + +`HISTSIZE' + The maximum number of commands to remember on the history list. + If the value is 0, commands are not saved in the history list. + Numeric values less than zero result in every command being saved + on the history list (there is no limit). The shell sets the + default value to 500 after reading any startup files. + +`HISTTIMEFORMAT' + If this variable is set and not null, its value is used as a + format string for STRFTIME to print the time stamp associated with + each history entry displayed by the `history' builtin. If this + variable is set, time stamps are written to the history file so + they may be preserved across shell sessions. This uses the + history comment character to distinguish timestamps from other + history lines. + +`HOSTFILE' + Contains the name of a file in the same format as `/etc/hosts' that + should be read when the shell needs to complete a hostname. The + list of possible hostname completions may be changed while the + shell is running; the next time hostname completion is attempted + after the value is changed, Bash adds the contents of the new file + to the existing list. If `HOSTFILE' is set, but has no value, or + does not name a readable file, Bash attempts to read `/etc/hosts' + to obtain the list of possible hostname completions. When + `HOSTFILE' is unset, the hostname list is cleared. + +`HOSTNAME' + The name of the current host. + +`HOSTTYPE' + A string describing the machine Bash is running on. + +`IGNOREEOF' + Controls the action of the shell on receipt of an `EOF' character + as the sole input. If set, the value denotes the number of + consecutive `EOF' characters that can be read as the first + character on an input line before the shell will exit. If the + variable exists but does not have a numeric value (or has no + value) then the default is 10. If the variable does not exist, + then `EOF' signifies the end of input to the shell. This is only + in effect for interactive shells. + +`INPUTRC' + The name of the Readline initialization file, overriding the + default of `~/.inputrc'. + +`LANG' + Used to determine the locale category for any category not + specifically selected with a variable starting with `LC_'. + +`LC_ALL' + This variable overrides the value of `LANG' and any other `LC_' + variable specifying a locale category. + +`LC_COLLATE' + This variable determines the collation order used when sorting the + results of filename expansion, and determines the behavior of + range expressions, equivalence classes, and collating sequences + within filename expansion and pattern matching (*note Filename + Expansion::). + +`LC_CTYPE' + This variable determines the interpretation of characters and the + behavior of character classes within filename expansion and pattern + matching (*note Filename Expansion::). + +`LC_MESSAGES' + This variable determines the locale used to translate double-quoted + strings preceded by a `$' (*note Locale Translation::). + +`LC_NUMERIC' + This variable determines the locale category used for number + formatting. + +`LINENO' + The line number in the script or shell function currently + executing. + +`LINES' + Used by the `select' command to determine the column length for + printing selection lists. Automatically set if the `checkwinsize' + option is enabled (*note The Shopt Builtin::), or in an + interactive shell upon receipt of a `SIGWINCH'. + +`MACHTYPE' + A string that fully describes the system type on which Bash is + executing, in the standard GNU CPU-COMPANY-SYSTEM format. + +`MAILCHECK' + How often (in seconds) that the shell should check for mail in the + files specified in the `MAILPATH' or `MAIL' variables. The + default is 60 seconds. When it is time to check for mail, the + shell does so before displaying the primary prompt. If this + variable is unset, or set to a value that is not a number greater + than or equal to zero, the shell disables mail checking. + +`MAPFILE' + An array variable created to hold the text read by the `mapfile' + builtin when no variable name is supplied. + +`OLDPWD' + The previous working directory as set by the `cd' builtin. + +`OPTERR' + If set to the value 1, Bash displays error messages generated by + the `getopts' builtin command. + +`OSTYPE' + A string describing the operating system Bash is running on. + +`PIPESTATUS' + An array variable (*note Arrays::) containing a list of exit + status values from the processes in the most-recently-executed + foreground pipeline (which may contain only a single command). + +`POSIXLY_CORRECT' + If this variable is in the environment when Bash starts, the shell + enters POSIX mode (*note Bash POSIX Mode::) before reading the + startup files, as if the `--posix' invocation option had been + supplied. If it is set while the shell is running, Bash enables + POSIX mode, as if the command + `set -o posix' + had been executed. + +`PPID' + The process ID of the shell's parent process. This variable is + readonly. + +`PROMPT_COMMAND' + If set, the value is interpreted as a command to execute before + the printing of each primary prompt (`$PS1'). + +`PROMPT_DIRTRIM' + If set to a number greater than zero, the value is used as the + number of trailing directory components to retain when expanding + the `\w' and `\W' prompt string escapes (*note Controlling the + Prompt::). Characters removed are replaced with an ellipsis. + +`PS3' + The value of this variable is used as the prompt for the `select' + command. If this variable is not set, the `select' command + prompts with `#? ' + +`PS4' + The value is the prompt printed before the command line is echoed + when the `-x' option is set (*note The Set Builtin::). The first + character of `PS4' is replicated multiple times, as necessary, to + indicate multiple levels of indirection. The default is `+ '. + +`PWD' + The current working directory as set by the `cd' builtin. + +`RANDOM' + Each time this parameter is referenced, a random integer between 0 + and 32767 is generated. Assigning a value to this variable seeds + the random number generator. + +`READLINE_LINE' + The contents of the Readline line buffer, for use with `bind -x' + (*note Bash Builtins::). + +`READLINE_POINT' + The position of the insertion point in the Readline line buffer, + for use with `bind -x' (*note Bash Builtins::). + +`REPLY' + The default variable for the `read' builtin. + +`SECONDS' + This variable expands to the number of seconds since the shell was + started. Assignment to this variable resets the count to the + value assigned, and the expanded value becomes the value assigned + plus the number of seconds since the assignment. + +`SHELL' + The full pathname to the shell is kept in this environment + variable. If it is not set when the shell starts, Bash assigns to + it the full pathname of the current user's login shell. + +`SHELLOPTS' + A colon-separated list of enabled shell options. Each word in the + list is a valid argument for the `-o' option to the `set' builtin + command (*note The Set Builtin::). The options appearing in + `SHELLOPTS' are those reported as `on' by `set -o'. If this + variable is in the environment when Bash starts up, each shell + option in the list will be enabled before reading any startup + files. This variable is readonly. + +`SHLVL' + Incremented by one each time a new instance of Bash is started. + This is intended to be a count of how deeply your Bash shells are + nested. + +`TIMEFORMAT' + The value of this parameter is used as a format string specifying + how the timing information for pipelines prefixed with the `time' + reserved word should be displayed. The `%' character introduces an + escape sequence that is expanded to a time value or other + information. The escape sequences and their meanings are as + follows; the braces denote optional portions. + + `%%' + A literal `%'. + + `%[P][l]R' + The elapsed time in seconds. + + `%[P][l]U' + The number of CPU seconds spent in user mode. + + `%[P][l]S' + The number of CPU seconds spent in system mode. + + `%P' + The CPU percentage, computed as (%U + %S) / %R. + + The optional P is a digit specifying the precision, the number of + fractional digits after a decimal point. A value of 0 causes no + decimal point or fraction to be output. At most three places + after the decimal point may be specified; values of P greater than + 3 are changed to 3. If P is not specified, the value 3 is used. + + The optional `l' specifies a longer format, including minutes, of + the form MMmSS.FFs. The value of P determines whether or not the + fraction is included. + + If this variable is not set, Bash acts as if it had the value + `$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'' + If the value is null, no timing information is displayed. A + trailing newline is added when the format string is displayed. + +`TMOUT' + If set to a value greater than zero, `TMOUT' is treated as the + default timeout for the `read' builtin (*note Bash Builtins::). + The `select' command (*note Conditional Constructs::) terminates + if input does not arrive after `TMOUT' seconds when input is coming + from a terminal. + + In an interactive shell, the value is interpreted as the number of + seconds to wait for a line of input after issuing the primary + prompt. Bash terminates after waiting for that number of seconds + if a complete line of input does not arrive. + +`TMPDIR' + If set, Bash uses its value as the name of a directory in which + Bash creates temporary files for the shell's use. + +`UID' + The numeric real user id of the current user. This variable is + readonly. + + + +File: bashref.info, Node: Bash Features, Next: Job Control, Prev: Shell Variables, Up: Top + +6 Bash Features +*************** + +This chapter describes features unique to Bash. + +* Menu: + +* Invoking Bash:: Command line options that you can give + to Bash. +* Bash Startup Files:: When and how Bash executes scripts. +* Interactive Shells:: What an interactive shell is. +* Bash Conditional Expressions:: Primitives used in composing expressions for + the `test' builtin. +* Shell Arithmetic:: Arithmetic on shell variables. +* Aliases:: Substituting one command for another. +* Arrays:: Array Variables. +* The Directory Stack:: History of visited directories. +* Controlling the Prompt:: Customizing the various prompt strings. +* The Restricted Shell:: A more controlled mode of shell execution. +* Bash POSIX Mode:: Making Bash behave more closely to what + the POSIX standard specifies. + + +File: bashref.info, Node: Invoking Bash, Next: Bash Startup Files, Up: Bash Features + +6.1 Invoking Bash +================= + + bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o OPTION] [-O SHOPT_OPTION] [ARGUMENT ...] + bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o OPTION] [-O SHOPT_OPTION] -c STRING [ARGUMENT ...] + bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o OPTION] [-O SHOPT_OPTION] [ARGUMENT ...] + + All of the single-character options used with the `set' builtin +(*note The Set Builtin::) can be used as options when the shell is +invoked. In addition, there are several multi-character options that +you can use. These options must appear on the command line before the +single-character options to be recognized. + +`--debugger' + Arrange for the debugger profile to be executed before the shell + starts. Turns on extended debugging mode (see *note The Shopt + Builtin:: for a description of the `extdebug' option to the `shopt' + builtin). + +`--dump-po-strings' + A list of all double-quoted strings preceded by `$' is printed on + the standard output in the GNU `gettext' PO (portable object) file + format. Equivalent to `-D' except for the output format. + +`--dump-strings' + Equivalent to `-D'. + +`--help' + Display a usage message on standard output and exit successfully. + +`--init-file FILENAME' +`--rcfile FILENAME' + Execute commands from FILENAME (instead of `~/.bashrc') in an + interactive shell. + +`--login' + Equivalent to `-l'. + +`--noediting' + Do not use the GNU Readline library (*note Command Line Editing::) + to read command lines when the shell is interactive. + +`--noprofile' + Don't load the system-wide startup file `/etc/profile' or any of + the personal initialization files `~/.bash_profile', + `~/.bash_login', or `~/.profile' when Bash is invoked as a login + shell. + +`--norc' + Don't read the `~/.bashrc' initialization file in an interactive + shell. This is on by default if the shell is invoked as `sh'. + +`--posix' + Change the behavior of Bash where the default operation differs + from the POSIX standard to match the standard. This is intended + to make Bash behave as a strict superset of that standard. *Note + Bash POSIX Mode::, for a description of the Bash POSIX mode. + +`--restricted' + Make the shell a restricted shell (*note The Restricted Shell::). + +`--verbose' + Equivalent to `-v'. Print shell input lines as they're read. + +`--version' + Show version information for this instance of Bash on the standard + output and exit successfully. + + There are several single-character options that may be supplied at +invocation which are not available with the `set' builtin. + +`-c' + Read and execute commands from the first non-option ARGUMENT after + processing the options, then exit. Any remaining arguments are + assigned to the positional parameters, starting with `$0'. + +`-i' + Force the shell to run interactively. Interactive shells are + described in *note Interactive Shells::. + +`-l' + Make this shell act as if it had been directly invoked by login. + When the shell is interactive, this is equivalent to starting a + login shell with `exec -l bash'. When the shell is not + interactive, the login shell startup files will be executed. + `exec bash -l' or `exec bash --login' will replace the current + shell with a Bash login shell. *Note Bash Startup Files::, for a + description of the special behavior of a login shell. + +`-r' + Make the shell a restricted shell (*note The Restricted Shell::). + +`-s' + If this option is present, or if no arguments remain after option + processing, then commands are read from the standard input. This + option allows the positional parameters to be set when invoking an + interactive shell. + +`-D' + A list of all double-quoted strings preceded by `$' is printed on + the standard output. These are the strings that are subject to + language translation when the current locale is not `C' or `POSIX' + (*note Locale Translation::). This implies the `-n' option; no + commands will be executed. + +`[-+]O [SHOPT_OPTION]' + SHOPT_OPTION is one of the shell options accepted by the `shopt' + builtin (*note The Shopt Builtin::). If SHOPT_OPTION is present, + `-O' sets the value of that option; `+O' unsets it. If + SHOPT_OPTION is not supplied, the names and values of the shell + options accepted by `shopt' are printed on the standard output. + If the invocation option is `+O', the output is displayed in a + format that may be reused as input. + +`--' + A `--' signals the end of options and disables further option + processing. Any arguments after the `--' are treated as filenames + and arguments. + + A _login_ shell is one whose first character of argument zero is +`-', or one invoked with the `--login' option. + + An _interactive_ shell is one started without non-option arguments, +unless `-s' is specified, without specifying the `-c' option, and whose +input and output are both connected to terminals (as determined by +`isatty(3)'), or one started with the `-i' option. *Note Interactive +Shells::, for more information. + + If arguments remain after option processing, and neither the `-c' +nor the `-s' option has been supplied, the first argument is assumed to +be the name of a file containing shell commands (*note Shell Scripts::). +When Bash is invoked in this fashion, `$0' is set to the name of the +file, and the positional parameters are set to the remaining arguments. +Bash reads and executes commands from this file, then exits. Bash's +exit status is the exit status of the last command executed in the +script. If no commands are executed, the exit status is 0. + + +File: bashref.info, Node: Bash Startup Files, Next: Interactive Shells, Prev: Invoking Bash, Up: Bash Features + +6.2 Bash Startup Files +====================== + +This section describes how Bash executes its startup files. If any of +the files exist but cannot be read, Bash reports an error. Tildes are +expanded in filenames as described above under Tilde Expansion (*note +Tilde Expansion::). + + Interactive shells are described in *note Interactive Shells::. + +Invoked as an interactive login shell, or with `--login' +........................................................ + +When Bash is invoked as an interactive login shell, or as a +non-interactive shell with the `--login' option, it first reads and +executes commands from the file `/etc/profile', if that file exists. +After reading that file, it looks for `~/.bash_profile', +`~/.bash_login', and `~/.profile', in that order, and reads and +executes commands from the first one that exists and is readable. The +`--noprofile' option may be used when the shell is started to inhibit +this behavior. + + When a login shell exits, Bash reads and executes commands from the +file `~/.bash_logout', if it exists. + +Invoked as an interactive non-login shell +......................................... + +When an interactive shell that is not a login shell is started, Bash +reads and executes commands from `~/.bashrc', if that file exists. +This may be inhibited by using the `--norc' option. The `--rcfile +FILE' option will force Bash to read and execute commands from FILE +instead of `~/.bashrc'. + + So, typically, your `~/.bash_profile' contains the line + `if [ -f ~/.bashrc ]; then . ~/.bashrc; fi' + after (or before) any login-specific initializations. + +Invoked non-interactively +......................... + +When Bash is started non-interactively, to run a shell script, for +example, it looks for the variable `BASH_ENV' in the environment, +expands its value if it appears there, and uses the expanded value as +the name of a file to read and execute. Bash behaves as if the +following command were executed: + `if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi' + but the value of the `PATH' variable is not used to search for the +filename. + + As noted above, if a non-interactive shell is invoked with the +`--login' option, Bash attempts to read and execute commands from the +login shell startup files. + +Invoked with name `sh' +...................... + +If Bash is invoked with the name `sh', it tries to mimic the startup +behavior of historical versions of `sh' as closely as possible, while +conforming to the POSIX standard as well. + + When invoked as an interactive login shell, or as a non-interactive +shell with the `--login' option, it first attempts to read and execute +commands from `/etc/profile' and `~/.profile', in that order. The +`--noprofile' option may be used to inhibit this behavior. When +invoked as an interactive shell with the name `sh', Bash looks for the +variable `ENV', expands its value if it is defined, and uses the +expanded value as the name of a file to read and execute. Since a +shell invoked as `sh' does not attempt to read and execute commands +from any other startup files, the `--rcfile' option has no effect. A +non-interactive shell invoked with the name `sh' does not attempt to +read any other startup files. + + When invoked as `sh', Bash enters POSIX mode after the startup files +are read. + +Invoked in POSIX mode +..................... + +When Bash is started in POSIX mode, as with the `--posix' command line +option, it follows the POSIX standard for startup files. In this mode, +interactive shells expand the `ENV' variable and commands are read and +executed from the file whose name is the expanded value. No other +startup files are read. + +Invoked by remote shell daemon +.............................. + +Bash attempts to determine when it is being run with its standard input +connected to a network connection, as when executed by the remote shell +daemon, usually `rshd', or the secure shell daemon `sshd'. If Bash +determines it is being run in this fashion, it reads and executes +commands from `~/.bashrc', if that file exists and is readable. It +will not do this if invoked as `sh'. The `--norc' option may be used +to inhibit this behavior, and the `--rcfile' option may be used to +force another file to be read, but neither `rshd' nor `sshd' generally +invoke the shell with those options or allow them to be specified. + +Invoked with unequal effective and real UID/GIDs +................................................ + +If Bash is started with the effective user (group) id not equal to the +real user (group) id, and the `-p' option is not supplied, no startup +files are read, shell functions are not inherited from the environment, +the `SHELLOPTS', `BASHOPTS', `CDPATH', and `GLOBIGNORE' variables, if +they appear in the environment, are ignored, and the effective user id +is set to the real user id. If the `-p' option is supplied at +invocation, the startup behavior is the same, but the effective user id +is not reset. + + +File: bashref.info, Node: Interactive Shells, Next: Bash Conditional Expressions, Prev: Bash Startup Files, Up: Bash Features + +6.3 Interactive Shells +====================== + +* Menu: + +* What is an Interactive Shell?:: What determines whether a shell is Interactive. +* Is this Shell Interactive?:: How to tell if a shell is interactive. +* Interactive Shell Behavior:: What changes in a interactive shell? + + +File: bashref.info, Node: What is an Interactive Shell?, Next: Is this Shell Interactive?, Up: Interactive Shells + +6.3.1 What is an Interactive Shell? +----------------------------------- + +An interactive shell is one started without non-option arguments, +unless `-s' is specified, without specifying the `-c' option, and whose +input and error output are both connected to terminals (as determined +by `isatty(3)'), or one started with the `-i' option. + + An interactive shell generally reads from and writes to a user's +terminal. + + The `-s' invocation option may be used to set the positional +parameters when an interactive shell is started. + + +File: bashref.info, Node: Is this Shell Interactive?, Next: Interactive Shell Behavior, Prev: What is an Interactive Shell?, Up: Interactive Shells + +6.3.2 Is this Shell Interactive? +-------------------------------- + +To determine within a startup script whether or not Bash is running +interactively, test the value of the `-' special parameter. It +contains `i' when the shell is interactive. For example: + + case "$-" in + *i*) echo This shell is interactive ;; + *) echo This shell is not interactive ;; + esac + + Alternatively, startup scripts may examine the variable `PS1'; it is +unset in non-interactive shells, and set in interactive shells. Thus: + + if [ -z "$PS1" ]; then + echo This shell is not interactive + else + echo This shell is interactive + fi + + +File: bashref.info, Node: Interactive Shell Behavior, Prev: Is this Shell Interactive?, Up: Interactive Shells + +6.3.3 Interactive Shell Behavior +-------------------------------- + +When the shell is running interactively, it changes its behavior in +several ways. + + 1. Startup files are read and executed as described in *note Bash + Startup Files::. + + 2. Job Control (*note Job Control::) is enabled by default. When job + control is in effect, Bash ignores the keyboard-generated job + control signals `SIGTTIN', `SIGTTOU', and `SIGTSTP'. + + 3. Bash expands and displays `PS1' before reading the first line of a + command, and expands and displays `PS2' before reading the second + and subsequent lines of a multi-line command. + + 4. Bash executes the value of the `PROMPT_COMMAND' variable as a + command before printing the primary prompt, `$PS1' (*note Bash + Variables::). + + 5. Readline (*note Command Line Editing::) is used to read commands + from the user's terminal. + + 6. Bash inspects the value of the `ignoreeof' option to `set -o' + instead of exiting immediately when it receives an `EOF' on its + standard input when reading a command (*note The Set Builtin::). + + 7. Command history (*note Bash History Facilities::) and history + expansion (*note History Interaction::) are enabled by default. + Bash will save the command history to the file named by `$HISTFILE' + when a shell with history enabled exits. + + 8. Alias expansion (*note Aliases::) is performed by default. + + 9. In the absence of any traps, Bash ignores `SIGTERM' (*note + Signals::). + + 10. In the absence of any traps, `SIGINT' is caught and handled + ((*note Signals::). `SIGINT' will interrupt some shell builtins. + + 11. An interactive login shell sends a `SIGHUP' to all jobs on exit if + the `huponexit' shell option has been enabled (*note Signals::). + + 12. The `-n' invocation option is ignored, and `set -n' has no effect + (*note The Set Builtin::). + + 13. Bash will check for mail periodically, depending on the values of + the `MAIL', `MAILPATH', and `MAILCHECK' shell variables (*note + Bash Variables::). + + 14. Expansion errors due to references to unbound shell variables after + `set -u' has been enabled will not cause the shell to exit (*note + The Set Builtin::). + + 15. The shell will not exit on expansion errors caused by VAR being + unset or null in `${VAR:?WORD}' expansions (*note Shell Parameter + Expansion::). + + 16. Redirection errors encountered by shell builtins will not cause the + shell to exit. + + 17. When running in POSIX mode, a special builtin returning an error + status will not cause the shell to exit (*note Bash POSIX Mode::). + + 18. A failed `exec' will not cause the shell to exit (*note Bourne + Shell Builtins::). + + 19. Parser syntax errors will not cause the shell to exit. + + 20. Simple spelling correction for directory arguments to the `cd' + builtin is enabled by default (see the description of the `cdspell' + option to the `shopt' builtin in *note The Shopt Builtin::). + + 21. The shell will check the value of the `TMOUT' variable and exit if + a command is not read within the specified number of seconds after + printing `$PS1' (*note Bash Variables::). + + + +File: bashref.info, Node: Bash Conditional Expressions, Next: Shell Arithmetic, Prev: Interactive Shells, Up: Bash Features + +6.4 Bash Conditional Expressions +================================ + +Conditional expressions are used by the `[[' compound command and the +`test' and `[' builtin commands. + + Expressions may be unary or binary. Unary expressions are often +used to examine the status of a file. There are string operators and +numeric comparison operators as well. If the FILE argument to one of +the primaries is of the form `/dev/fd/N', then file descriptor N is +checked. If the FILE argument to one of the primaries is one of +`/dev/stdin', `/dev/stdout', or `/dev/stderr', file descriptor 0, 1, or +2, respectively, is checked. + + When used with `[[', the `<' and `>' operators sort +lexicographically using the current locale. The `test' command uses +ASCII ordering. + + Unless otherwise specified, primaries that operate on files follow +symbolic links and operate on the target of the link, rather than the +link itself. + +`-a FILE' + True if FILE exists. + +`-b FILE' + True if FILE exists and is a block special file. + +`-c FILE' + True if FILE exists and is a character special file. + +`-d FILE' + True if FILE exists and is a directory. + +`-e FILE' + True if FILE exists. + +`-f FILE' + True if FILE exists and is a regular file. + +`-g FILE' + True if FILE exists and its set-group-id bit is set. + +`-h FILE' + True if FILE exists and is a symbolic link. + +`-k FILE' + True if FILE exists and its "sticky" bit is set. + +`-p FILE' + True if FILE exists and is a named pipe (FIFO). + +`-r FILE' + True if FILE exists and is readable. + +`-s FILE' + True if FILE exists and has a size greater than zero. + +`-t FD' + True if file descriptor FD is open and refers to a terminal. + +`-u FILE' + True if FILE exists and its set-user-id bit is set. + +`-w FILE' + True if FILE exists and is writable. + +`-x FILE' + True if FILE exists and is executable. + +`-G FILE' + True if FILE exists and is owned by the effective group id. + +`-L FILE' + True if FILE exists and is a symbolic link. + +`-N FILE' + True if FILE exists and has been modified since it was last read. + +`-O FILE' + True if FILE exists and is owned by the effective user id. + +`-S FILE' + True if FILE exists and is a socket. + +`FILE1 -ef FILE2' + True if FILE1 and FILE2 refer to the same device and inode numbers. + +`FILE1 -nt FILE2' + True if FILE1 is newer (according to modification date) than + FILE2, or if FILE1 exists and FILE2 does not. + +`FILE1 -ot FILE2' + True if FILE1 is older than FILE2, or if FILE2 exists and FILE1 + does not. + +`-o OPTNAME' + True if the shell option OPTNAME is enabled. The list of options + appears in the description of the `-o' option to the `set' builtin + (*note The Set Builtin::). + +`-v VARNAME' + True if the shell variable VARNAME is set (has been assigned a + value). + +`-R VARNAME' + True if the shell variable VARNAME is set and is a name reference. + +`-z STRING' + True if the length of STRING is zero. + +`-n STRING' +`STRING' + True if the length of STRING is non-zero. + +`STRING1 == STRING2' +`STRING1 = STRING2' + True if the strings are equal. When used with the `[[' command, + this performs pattern matching as described above (*note + Conditional Constructs::). + + `=' should be used with the `test' command for POSIX conformance. + +`STRING1 != STRING2' + True if the strings are not equal. + +`STRING1 < STRING2' + True if STRING1 sorts before STRING2 lexicographically. + +`STRING1 > STRING2' + True if STRING1 sorts after STRING2 lexicographically. + +`ARG1 OP ARG2' + `OP' is one of `-eq', `-ne', `-lt', `-le', `-gt', or `-ge'. These + arithmetic binary operators return true if ARG1 is equal to, not + equal to, less than, less than or equal to, greater than, or + greater than or equal to ARG2, respectively. ARG1 and ARG2 may be + positive or negative integers. + + +File: bashref.info, Node: Shell Arithmetic, Next: Aliases, Prev: Bash Conditional Expressions, Up: Bash Features + +6.5 Shell Arithmetic +==================== + +The shell allows arithmetic expressions to be evaluated, as one of the +shell expansions or by the `let' and the `-i' option to the `declare' +builtins. + + Evaluation is done in fixed-width integers with no check for +overflow, though division by 0 is trapped and flagged as an error. The +operators and their precedence, associativity, and values are the same +as in the C language. The following list of operators is grouped into +levels of equal-precedence operators. The levels are listed in order +of decreasing precedence. + +`ID++ ID--' + variable post-increment and post-decrement + +`++ID --ID' + variable pre-increment and pre-decrement + +`- +' + unary minus and plus + +`! ~' + logical and bitwise negation + +`**' + exponentiation + +`* / %' + multiplication, division, remainder + +`+ -' + addition, subtraction + +`<< >>' + left and right bitwise shifts + +`<= >= < >' + comparison + +`== !=' + equality and inequality + +`&' + bitwise AND + +`^' + bitwise exclusive OR + +`|' + bitwise OR + +`&&' + logical AND + +`||' + logical OR + +`expr ? expr : expr' + conditional operator + +`= *= /= %= += -= <<= >>= &= ^= |=' + assignment + +`expr1 , expr2' + comma + + Shell variables are allowed as operands; parameter expansion is +performed before the expression is evaluated. Within an expression, +shell variables may also be referenced by name without using the +parameter expansion syntax. A shell variable that is null or unset +evaluates to 0 when referenced by name without using the parameter +expansion syntax. The value of a variable is evaluated as an +arithmetic expression when it is referenced, or when a variable which +has been given the INTEGER attribute using `declare -i' is assigned a +value. A null value evaluates to 0. A shell variable need not have +its INTEGER attribute turned on to be used in an expression. + + Constants with a leading 0 are interpreted as octal numbers. A +leading `0x' or `0X' denotes hexadecimal. Otherwise, numbers take the +form [BASE`#']N, where the optional BASE is a decimal number between 2 +and 64 representing the arithmetic base, and N is a number in that base. +If BASE`#' is omitted, then base 10 is used. When specifying N, he +digits greater than 9 are represented by the lowercase letters, the +uppercase letters, `@', and `_', in that order. If BASE is less than +or equal to 36, lowercase and uppercase letters may be used +interchangeably to represent numbers between 10 and 35. + + Operators are evaluated in order of precedence. Sub-expressions in +parentheses are evaluated first and may override the precedence rules +above. + + +File: bashref.info, Node: Aliases, Next: Arrays, Prev: Shell Arithmetic, Up: Bash Features + +6.6 Aliases +=========== + +ALIASES allow a string to be substituted for a word when it is used as +the first word of a simple command. The shell maintains a list of +aliases that may be set and unset with the `alias' and `unalias' +builtin commands. + + The first word of each simple command, if unquoted, is checked to see +if it has an alias. If so, that word is replaced by the text of the +alias. The characters `/', `$', ``', `=' and any of the shell +metacharacters or quoting characters listed above may not appear in an +alias name. The replacement text may contain any valid shell input, +including shell metacharacters. The first word of the replacement text +is tested for aliases, but a word that is identical to an alias being +expanded is not expanded a second time. This means that one may alias +`ls' to `"ls -F"', for instance, and Bash does not try to recursively +expand the replacement text. If the last character of the alias value +is a BLANK, then the next command word following the alias is also +checked for alias expansion. + + Aliases are created and listed with the `alias' command, and removed +with the `unalias' command. + + There is no mechanism for using arguments in the replacement text, +as in `csh'. If arguments are needed, a shell function should be used +(*note Shell Functions::). + + Aliases are not expanded when the shell is not interactive, unless +the `expand_aliases' shell option is set using `shopt' (*note The Shopt +Builtin::). + + The rules concerning the definition and use of aliases are somewhat +confusing. Bash always reads at least one complete line of input +before executing any of the commands on that line. Aliases are +expanded when a command is read, not when it is executed. Therefore, an +alias definition appearing on the same line as another command does not +take effect until the next line of input is read. The commands +following the alias definition on that line are not affected by the new +alias. This behavior is also an issue when functions are executed. +Aliases are expanded when a function definition is read, not when the +function is executed, because a function definition is itself a +compound command. As a consequence, aliases defined in a function are +not available until after that function is executed. To be safe, +always put alias definitions on a separate line, and do not use `alias' +in compound commands. + + For almost every purpose, shell functions are preferred over aliases. + + +File: bashref.info, Node: Arrays, Next: The Directory Stack, Prev: Aliases, Up: Bash Features + +6.7 Arrays +========== + +Bash provides one-dimensional indexed and associative array variables. +Any variable may be used as an indexed array; the `declare' builtin +will explicitly declare an array. There is no maximum limit on the +size of an array, nor any requirement that members be indexed or +assigned contiguously. Indexed arrays are referenced using integers +(including arithmetic expressions (*note Shell Arithmetic::)) and are +zero-based; associative arrays use arbitrary strings. Unless otherwise +noted, indexed array indices must be non-negative integers. + + An indexed array is created automatically if any variable is +assigned to using the syntax + NAME[SUBSCRIPT]=VALUE + +The SUBSCRIPT is treated as an arithmetic expression that must evaluate +to a number. To explicitly declare an array, use + declare -a NAME + The syntax + declare -a NAME[SUBSCRIPT] + is also accepted; the SUBSCRIPT is ignored. + +Associative arrays are created using + declare -A NAME. + + Attributes may be specified for an array variable using the +`declare' and `readonly' builtins. Each attribute applies to all +members of an array. + + Arrays are assigned to using compound assignments of the form + NAME=(VALUE1 VALUE2 ... ) + where each VALUE is of the form `[SUBSCRIPT]='STRING. Indexed array +assignments do not require anything but STRING. When assigning to +indexed arrays, if the optional subscript is supplied, that index is +assigned to; otherwise the index of the element assigned is the last +index assigned to by the statement plus one. Indexing starts at zero. + + When assigning to an associative array, the subscript is required. + + This syntax is also accepted by the `declare' builtin. Individual +array elements may be assigned to using the `NAME[SUBSCRIPT]=VALUE' +syntax introduced above. + + When assigning to an indexed array, if NAME is subscripted by a +negative number, that number is interpreted as relative to one greater +than the maximum index of NAME, so negative indices count back from the +end of the array, and an index of -1 references the last element. + + Any element of an array may be referenced using `${NAME[SUBSCRIPT]}'. +The braces are required to avoid conflicts with the shell's filename +expansion operators. If the SUBSCRIPT is `@' or `*', the word expands +to all members of the array NAME. These subscripts differ only when +the word appears within double quotes. If the word is double-quoted, +`${NAME[*]}' expands to a single word with the value of each array +member separated by the first character of the `IFS' variable, and +`${NAME[@]}' expands each element of NAME to a separate word. When +there are no array members, `${NAME[@]}' expands to nothing. If the +double-quoted expansion occurs within a word, the expansion of the +first parameter is joined with the beginning part of the original word, +and the expansion of the last parameter is joined with the last part of +the original word. This is analogous to the expansion of the special +parameters `@' and `*'. `${#NAME[SUBSCRIPT]}' expands to the length of +`${NAME[SUBSCRIPT]}'. If SUBSCRIPT is `@' or `*', the expansion is the +number of elements in the array. Referencing an array variable without +a subscript is equivalent to referencing with a subscript of 0. If the +SUBSCRIPT used to reference an element of an indexed array evaluates to +a number less than zero, it is interpreted as relative to one greater +than the maximum index of the array, so negative indices count back +from the end of the array, and an index of -1 refers to the last +element. + + An array variable is considered set if a subscript has been assigned +a value. The null string is a valid value. + + It is possible to obtain the keys (indices) of an array as well as +the values. ${!NAME[@]} and ${!NAME[*]} expand to the indices assigned +in array variable NAME. The treatment when in double quotes is similar +to the expansion of the special parameters `@' and `*' within double +quotes. + + The `unset' builtin is used to destroy arrays. `unset +NAME[SUBSCRIPT]' destroys the array element at index SUBSCRIPT. +Negative subscripts to indexed arrays are interpreted as described +above. Care must be taken to avoid unwanted side effects caused by +filename expansion. `unset NAME', where NAME is an array, removes the +entire array. A subscript of `*' or `@' also removes the entire array. + + The `declare', `local', and `readonly' builtins each accept a `-a' +option to specify an indexed array and a `-A' option to specify an +associative array. If both options are supplied, `-A' takes precedence. +The `read' builtin accepts a `-a' option to assign a list of words read +from the standard input to an array, and can read values from the +standard input into individual array elements. The `set' and `declare' +builtins display array values in a way that allows them to be reused as +input. + + +File: bashref.info, Node: The Directory Stack, Next: Controlling the Prompt, Prev: Arrays, Up: Bash Features + +6.8 The Directory Stack +======================= + +* Menu: + +* Directory Stack Builtins:: Bash builtin commands to manipulate + the directory stack. + + The directory stack is a list of recently-visited directories. The +`pushd' builtin adds directories to the stack as it changes the current +directory, and the `popd' builtin removes specified directories from +the stack and changes the current directory to the directory removed. +The `dirs' builtin displays the contents of the directory stack. + + The contents of the directory stack are also visible as the value of +the `DIRSTACK' shell variable. + + +File: bashref.info, Node: Directory Stack Builtins, Up: The Directory Stack + +6.8.1 Directory Stack Builtins +------------------------------ + +`dirs' + dirs [-clpv] [+N | -N] + + Display the list of currently remembered directories. Directories + are added to the list with the `pushd' command; the `popd' command + removes directories from the list. + + `-c' + Clears the directory stack by deleting all of the elements. + + `-l' + Produces a listing using full pathnames; the default listing + format uses a tilde to denote the home directory. + + `-p' + Causes `dirs' to print the directory stack with one entry per + line. + + `-v' + Causes `dirs' to print the directory stack with one entry per + line, prefixing each entry with its index in the stack. + + `+N' + Displays the Nth directory (counting from the left of the + list printed by `dirs' when invoked without options), starting + with zero. + + `-N' + Displays the Nth directory (counting from the right of the + list printed by `dirs' when invoked without options), starting + with zero. + +`popd' + popd [-n] [+N | -N] + + Remove the top entry from the directory stack, and `cd' to the new + top directory. When no arguments are given, `popd' removes the + top directory from the stack and performs a `cd' to the new top + directory. The elements are numbered from 0 starting at the first + directory listed with `dirs'; that is, `popd' is equivalent to + `popd +0'. + + `-n' + Suppresses the normal change of directory when removing + directories from the stack, so that only the stack is + manipulated. + + `+N' + Removes the Nth directory (counting from the left of the list + printed by `dirs'), starting with zero. + + `-N' + Removes the Nth directory (counting from the right of the + list printed by `dirs'), starting with zero. + +`pushd' + pushd [-n] [+N | -N | DIR] + + Save the current directory on the top of the directory stack and + then `cd' to DIR. With no arguments, `pushd' exchanges the top + two directories. + + `-n' + Suppresses the normal change of directory when adding + directories to the stack, so that only the stack is + manipulated. + + `+N' + Brings the Nth directory (counting from the left of the list + printed by `dirs', starting with zero) to the top of the list + by rotating the stack. + + `-N' + Brings the Nth directory (counting from the right of the list + printed by `dirs', starting with zero) to the top of the list + by rotating the stack. + + `DIR' + Makes the current working directory be the top of the stack, + making it the new current directory as if it had been + supplied as an argument to the `cd' builtin. + + +File: bashref.info, Node: Controlling the Prompt, Next: The Restricted Shell, Prev: The Directory Stack, Up: Bash Features + +6.9 Controlling the Prompt +========================== + +The value of the variable `PROMPT_COMMAND' is examined just before Bash +prints each primary prompt. If `PROMPT_COMMAND' is set and has a +non-null value, then the value is executed just as if it had been typed +on the command line. + + In addition, the following table describes the special characters +which can appear in the prompt variables `PS1' to `PS4': + +`\a' + A bell character. + +`\d' + The date, in "Weekday Month Date" format (e.g., "Tue May 26"). + +`\D{FORMAT}' + The FORMAT is passed to `strftime'(3) and the result is inserted + into the prompt string; an empty FORMAT results in a + locale-specific time representation. The braces are required. + +`\e' + An escape character. + +`\h' + The hostname, up to the first `.'. + +`\H' + The hostname. + +`\j' + The number of jobs currently managed by the shell. + +`\l' + The basename of the shell's terminal device name. + +`\n' + A newline. + +`\r' + A carriage return. + +`\s' + The name of the shell, the basename of `$0' (the portion following + the final slash). + +`\t' + The time, in 24-hour HH:MM:SS format. + +`\T' + The time, in 12-hour HH:MM:SS format. + +`\@' + The time, in 12-hour am/pm format. + +`\A' + The time, in 24-hour HH:MM format. + +`\u' + The username of the current user. + +`\v' + The version of Bash (e.g., 2.00) + +`\V' + The release of Bash, version + patchlevel (e.g., 2.00.0) + +`\w' + The current working directory, with `$HOME' abbreviated with a + tilde (uses the `$PROMPT_DIRTRIM' variable). + +`\W' + The basename of `$PWD', with `$HOME' abbreviated with a tilde. + +`\!' + The history number of this command. + +`\#' + The command number of this command. + +`\$' + If the effective uid is 0, `#', otherwise `$'. + +`\NNN' + The character whose ASCII code is the octal value NNN. + +`\\' + A backslash. + +`\[' + Begin a sequence of non-printing characters. This could be used to + embed a terminal control sequence into the prompt. + +`\]' + End a sequence of non-printing characters. + + The command number and the history number are usually different: the +history number of a command is its position in the history list, which +may include commands restored from the history file (*note Bash History +Facilities::), while the command number is the position in the sequence +of commands executed during the current shell session. + + After the string is decoded, it is expanded via parameter expansion, +command substitution, arithmetic expansion, and quote removal, subject +to the value of the `promptvars' shell option (*note Bash Builtins::). + + +File: bashref.info, Node: The Restricted Shell, Next: Bash POSIX Mode, Prev: Controlling the Prompt, Up: Bash Features + +6.10 The Restricted Shell +========================= + +If Bash is started with the name `rbash', or the `--restricted' or `-r' +option is supplied at invocation, the shell becomes restricted. A +restricted shell is used to set up an environment more controlled than +the standard shell. A restricted shell behaves identically to `bash' +with the exception that the following are disallowed or not performed: + + * Changing directories with the `cd' builtin. + + * Setting or unsetting the values of the `SHELL', `PATH', `ENV', or + `BASH_ENV' variables. + + * Specifying command names containing slashes. + + * Specifying a filename containing a slash as an argument to the `.' + builtin command. + + * Specifying a filename containing a slash as an argument to the `-p' + option to the `hash' builtin command. + + * Importing function definitions from the shell environment at + startup. + + * Parsing the value of `SHELLOPTS' from the shell environment at + startup. + + * Redirecting output using the `>', `>|', `<>', `>&', `&>', and `>>' + redirection operators. + + * Using the `exec' builtin to replace the shell with another command. + + * Adding or deleting builtin commands with the `-f' and `-d' options + to the `enable' builtin. + + * Using the `enable' builtin command to enable disabled shell + builtins. + + * Specifying the `-p' option to the `command' builtin. + + * Turning off restricted mode with `set +r' or `set +o restricted'. + + These restrictions are enforced after any startup files are read. + + When a command that is found to be a shell script is executed (*note +Shell Scripts::), `rbash' turns off any restrictions in the shell +spawned to execute the script. + + +File: bashref.info, Node: Bash POSIX Mode, Prev: The Restricted Shell, Up: Bash Features + +6.11 Bash POSIX Mode +==================== + +Starting Bash with the `--posix' command-line option or executing `set +-o posix' while Bash is running will cause Bash to conform more closely +to the POSIX standard by changing the behavior to match that specified +by POSIX in areas where the Bash default differs. + + When invoked as `sh', Bash enters POSIX mode after reading the +startup files. + + The following list is what's changed when `POSIX mode' is in effect: + + 1. When a command in the hash table no longer exists, Bash will + re-search `$PATH' to find the new location. This is also + available with `shopt -s checkhash'. + + 2. The message printed by the job control code and builtins when a job + exits with a non-zero status is `Done(status)'. + + 3. The message printed by the job control code and builtins when a job + is stopped is `Stopped(SIGNAME)', where SIGNAME is, for example, + `SIGTSTP'. + + 4. The `bg' builtin uses the required format to describe each job + placed in the background, which does not include an indication of + whether the job is the current or previous job. + + 5. Reserved words appearing in a context where reserved words are + recognized do not undergo alias expansion. + + 6. The POSIX `PS1' and `PS2' expansions of `!' to the history number + and `!!' to `!' are enabled, and parameter expansion is performed + on the values of `PS1' and `PS2' regardless of the setting of the + `promptvars' option. + + 7. The POSIX startup files are executed (`$ENV') rather than the + normal Bash files. + + 8. Tilde expansion is only performed on assignments preceding a + command name, rather than on all assignment statements on the line. + + 9. The `command' builtin does not prevent builtins that take + assignment statements as arguments from expanding them as + assignment statements; when not in POSIX mode, assignment builtins + lose their assignment statement expansion properties when preceded + by `command'. + + 10. The default history file is `~/.sh_history' (this is the default + value of `$HISTFILE'). + + 11. The output of `kill -l' prints all the signal names on a single + line, separated by spaces, without the `SIG' prefix. + + 12. The `kill' builtin does not accept signal names with a `SIG' + prefix. + + 13. Non-interactive shells exit if FILENAME in `.' FILENAME is not + found. + + 14. Non-interactive shells exit if a syntax error in an arithmetic + expansion results in an invalid expression. + + 15. Non-interactive shells exit if there is a syntax error in a script + read with the `.' or `source' builtins, or in a string processed by + the `eval' builtin. + + 16. Redirection operators do not perform filename expansion on the word + in the redirection unless the shell is interactive. + + 17. Redirection operators do not perform word splitting on the word in + the redirection. + + 18. Function names must be valid shell `name's. That is, they may not + contain characters other than letters, digits, and underscores, and + may not start with a digit. Declaring a function with an invalid + name causes a fatal syntax error in non-interactive shells. + + 19. Function names may not be the same as one of the POSIX special + builtins. + + 20. POSIX special builtins are found before shell functions during + command lookup. + + 21. The `time' reserved word may be used by itself as a command. When + used in this way, it displays timing statistics for the shell and + its completed children. The `TIMEFORMAT' variable controls the + format of the timing information. + + 22. When parsing and expanding a ${...} expansion that appears within + double quotes, single quotes are no longer special and cannot be + used to quote a closing brace or other special character, unless + the operator is one of those defined to perform pattern removal. + In this case, they do not have to appear as matched pairs. + + 23. The parser does not recognize `time' as a reserved word if the next + token begins with a `-'. + + 24. If a POSIX special builtin returns an error status, a + non-interactive shell exits. The fatal errors are those listed in + the POSIX standard, and include things like passing incorrect + options, redirection errors, variable assignment errors for + assignments preceding the command name, and so on. + + 25. A non-interactive shell exits with an error status if a variable + assignment error occurs when no command name follows the assignment + statements. A variable assignment error occurs, for example, when + trying to assign a value to a readonly variable. + + 26. A non-interactive shell exits with an error status if a variable + assignment error occurs in an assignment statement preceding a + special builtin, but not with any other simple command. + + 27. A non-interactive shell exits with an error status if the iteration + variable in a `for' statement or the selection variable in a + `select' statement is a readonly variable. + + 28. Process substitution is not available. + + 29. While variable indirection is available, it may not be applied to + the `#' and `?' special parameters. + + 30. Assignment statements preceding POSIX special builtins persist in + the shell environment after the builtin completes. + + 31. Assignment statements preceding shell function calls persist in the + shell environment after the function returns, as if a POSIX + special builtin command had been executed. + + 32. The `export' and `readonly' builtin commands display their output + in the format required by POSIX. + + 33. The `trap' builtin displays signal names without the leading `SIG'. + + 34. The `trap' builtin doesn't check the first argument for a possible + signal specification and revert the signal handling to the original + disposition if it is, unless that argument consists solely of + digits and is a valid signal number. If users want to reset the + handler for a given signal to the original disposition, they + should use `-' as the first argument. + + 35. The `.' and `source' builtins do not search the current directory + for the filename argument if it is not found by searching `PATH'. + + 36. Subshells spawned to execute command substitutions inherit the + value of the `-e' option from the parent shell. When not in POSIX + mode, Bash clears the `-e' option in such subshells. + + 37. Alias expansion is always enabled, even in non-interactive shells. + + 38. When the `alias' builtin displays alias definitions, it does not + display them with a leading `alias ' unless the `-p' option is + supplied. + + 39. When the `set' builtin is invoked without options, it does not + display shell function names and definitions. + + 40. When the `set' builtin is invoked without options, it displays + variable values without quotes, unless they contain shell + metacharacters, even if the result contains nonprinting characters. + + 41. When the `cd' builtin is invoked in LOGICAL mode, and the pathname + constructed from `$PWD' and the directory name supplied as an + argument does not refer to an existing directory, `cd' will fail + instead of falling back to PHYSICAL mode. + + 42. The `pwd' builtin verifies that the value it prints is the same as + the current directory, even if it is not asked to check the file + system with the `-P' option. + + 43. When listing the history, the `fc' builtin does not include an + indication of whether or not a history entry has been modified. + + 44. The default editor used by `fc' is `ed'. + + 45. The `type' and `command' builtins will not report a non-executable + file as having been found, though the shell will attempt to + execute such a file if it is the only so-named file found in + `$PATH'. + + 46. The `vi' editing mode will invoke the `vi' editor directly when + the `v' command is run, instead of checking `$VISUAL' and + `$EDITOR'. + + 47. When the `xpg_echo' option is enabled, Bash does not attempt to + interpret any arguments to `echo' as options. Each argument is + displayed, after escape characters are converted. + + 48. The `ulimit' builtin uses a block size of 512 bytes for the `-c' + and `-f' options. + + 49. The arrival of `SIGCHLD' when a trap is set on `SIGCHLD' does not + interrupt the `wait' builtin and cause it to return immediately. + The trap command is run once for each child that exits. + + 50. The `read' builtin may be interrupted by a signal for which a trap + has been set. If Bash receives a trapped signal while executing + `read', the trap handler executes and `read' returns an exit + status greater than 128. + + + There is other POSIX behavior that Bash does not implement by +default even when in POSIX mode. Specifically: + + 1. The `fc' builtin checks `$EDITOR' as a program to edit history + entries if `FCEDIT' is unset, rather than defaulting directly to + `ed'. `fc' uses `ed' if `EDITOR' is unset. + + 2. As noted above, Bash requires the `xpg_echo' option to be enabled + for the `echo' builtin to be fully conformant. + + + Bash can be configured to be POSIX-conformant by default, by +specifying the `--enable-strict-posix-default' to `configure' when +building (*note Optional Features::). + + +File: bashref.info, Node: Job Control, Next: Command Line Editing, Prev: Bash Features, Up: Top + +7 Job Control +************* + +This chapter discusses what job control is, how it works, and how Bash +allows you to access its facilities. + +* Menu: + +* Job Control Basics:: How job control works. +* Job Control Builtins:: Bash builtin commands used to interact + with job control. +* Job Control Variables:: Variables Bash uses to customize job + control. + + +File: bashref.info, Node: Job Control Basics, Next: Job Control Builtins, Up: Job Control + +7.1 Job Control Basics +====================== + +Job control refers to the ability to selectively stop (suspend) the +execution of processes and continue (resume) their execution at a later +point. A user typically employs this facility via an interactive +interface supplied jointly by the operating system kernel's terminal +driver and Bash. + + The shell associates a JOB with each pipeline. It keeps a table of +currently executing jobs, which may be listed with the `jobs' command. +When Bash starts a job asynchronously, it prints a line that looks like: + [1] 25647 + indicating that this job is job number 1 and that the process ID of +the last process in the pipeline associated with this job is 25647. +All of the processes in a single pipeline are members of the same job. +Bash uses the JOB abstraction as the basis for job control. + + To facilitate the implementation of the user interface to job +control, the operating system maintains the notion of a current terminal +process group ID. Members of this process group (processes whose +process group ID is equal to the current terminal process group ID) +receive keyboard-generated signals such as `SIGINT'. These processes +are said to be in the foreground. Background processes are those whose +process group ID differs from the terminal's; such processes are immune +to keyboard-generated signals. Only foreground processes are allowed +to read from or, if the user so specifies with `stty tostop', write to +the terminal. Background processes which attempt to read from (write +to when `stty tostop' is in effect) the terminal are sent a `SIGTTIN' +(`SIGTTOU') signal by the kernel's terminal driver, which, unless +caught, suspends the process. + + If the operating system on which Bash is running supports job +control, Bash contains facilities to use it. Typing the SUSPEND +character (typically `^Z', Control-Z) while a process is running causes +that process to be stopped and returns control to Bash. Typing the +DELAYED SUSPEND character (typically `^Y', Control-Y) causes the +process to be stopped when it attempts to read input from the terminal, +and control to be returned to Bash. The user then manipulates the +state of this job, using the `bg' command to continue it in the +background, the `fg' command to continue it in the foreground, or the +`kill' command to kill it. A `^Z' takes effect immediately, and has +the additional side effect of causing pending output and typeahead to +be discarded. + + There are a number of ways to refer to a job in the shell. The +character `%' introduces a job specification (JOBSPEC). + + Job number `n' may be referred to as `%n'. The symbols `%%' and +`%+' refer to the shell's notion of the current job, which is the last +job stopped while it was in the foreground or started in the background. +A single `%' (with no accompanying job specification) also refers to +the current job. The previous job may be referenced using `%-'. If +there is only a single job, `%+' and `%-' can both be used to refer to +that job. In output pertaining to jobs (e.g., the output of the `jobs' +command), the current job is always flagged with a `+', and the +previous job with a `-'. + + A job may also be referred to using a prefix of the name used to +start it, or using a substring that appears in its command line. For +example, `%ce' refers to a stopped `ce' job. Using `%?ce', on the +other hand, refers to any job containing the string `ce' in its command +line. If the prefix or substring matches more than one job, Bash +reports an error. + + Simply naming a job can be used to bring it into the foreground: +`%1' is a synonym for `fg %1', bringing job 1 from the background into +the foreground. Similarly, `%1 &' resumes job 1 in the background, +equivalent to `bg %1' + + The shell learns immediately whenever a job changes state. +Normally, Bash waits until it is about to print a prompt before +reporting changes in a job's status so as to not interrupt any other +output. If the `-b' option to the `set' builtin is enabled, Bash +reports such changes immediately (*note The Set Builtin::). Any trap +on `SIGCHLD' is executed for each child process that exits. + + If an attempt to exit Bash is made while jobs are stopped, (or +running, if the `checkjobs' option is enabled - see *note The Shopt +Builtin::), the shell prints a warning message, and if the `checkjobs' +option is enabled, lists the jobs and their statuses. The `jobs' +command may then be used to inspect their status. If a second attempt +to exit is made without an intervening command, Bash does not print +another warning, and any stopped jobs are terminated. + + +File: bashref.info, Node: Job Control Builtins, Next: Job Control Variables, Prev: Job Control Basics, Up: Job Control + +7.2 Job Control Builtins +======================== + +`bg' + bg [JOBSPEC ...] + + Resume each suspended job JOBSPEC in the background, as if it had + been started with `&'. If JOBSPEC is not supplied, the current + job is used. The return status is zero unless it is run when job + control is not enabled, or, when run with job control enabled, any + JOBSPEC was not found or specifies a job that was started without + job control. + +`fg' + fg [JOBSPEC] + + Resume the job JOBSPEC in the foreground and make it the current + job. If JOBSPEC is not supplied, the current job is used. The + return status is that of the command placed into the foreground, + or non-zero if run when job control is disabled or, when run with + job control enabled, JOBSPEC does not specify a valid job or + JOBSPEC specifies a job that was started without job control. + +`jobs' + jobs [-lnprs] [JOBSPEC] + jobs -x COMMAND [ARGUMENTS] + + The first form lists the active jobs. The options have the + following meanings: + + `-l' + List process IDs in addition to the normal information. + + `-n' + Display information only about jobs that have changed status + since the user was last notified of their status. + + `-p' + List only the process ID of the job's process group leader. + + `-r' + Display only running jobs. + + `-s' + Display only stopped jobs. + + If JOBSPEC is given, output is restricted to information about + that job. If JOBSPEC is not supplied, the status of all jobs is + listed. + + If the `-x' option is supplied, `jobs' replaces any JOBSPEC found + in COMMAND or ARGUMENTS with the corresponding process group ID, + and executes COMMAND, passing it ARGUMENTs, returning its exit + status. + +`kill' + kill [-s SIGSPEC] [-n SIGNUM] [-SIGSPEC] JOBSPEC or PID + kill -l [EXIT_STATUS] + + Send a signal specified by SIGSPEC or SIGNUM to the process named + by job specification JOBSPEC or process ID PID. SIGSPEC is either + a case-insensitive signal name such as `SIGINT' (with or without + the `SIG' prefix) or a signal number; SIGNUM is a signal number. + If SIGSPEC and SIGNUM are not present, `SIGTERM' is used. The + `-l' option lists the signal names. If any arguments are supplied + when `-l' is given, the names of the signals corresponding to the + arguments are listed, and the return status is zero. EXIT_STATUS + is a number specifying a signal number or the exit status of a + process terminated by a signal. The return status is zero if at + least one signal was successfully sent, or non-zero if an error + occurs or an invalid option is encountered. + +`wait' + wait [-n] [JOBSPEC or PID ...] + + Wait until the child process specified by each process ID PID or + job specification JOBSPEC exits and return the exit status of the + last command waited for. If a job spec is given, all processes in + the job are waited for. If no arguments are given, all currently + active child processes are waited for, and the return status is + zero. If the `-n' option is supplied, `wait' waits for any job to + terminate and returns its exit status. If neither JOBSPEC nor PID + specifies an active child process of the shell, the return status + is 127. + +`disown' + disown [-ar] [-h] [JOBSPEC ...] + + Without options, remove each JOBSPEC from the table of active jobs. + If the `-h' option is given, the job is not removed from the table, + but is marked so that `SIGHUP' is not sent to the job if the shell + receives a `SIGHUP'. If JOBSPEC is not present, and neither the + `-a' nor the `-r' option is supplied, the current job is used. If + no JOBSPEC is supplied, the `-a' option means to remove or mark + all jobs; the `-r' option without a JOBSPEC argument restricts + operation to running jobs. + +`suspend' + suspend [-f] + + Suspend the execution of this shell until it receives a `SIGCONT' + signal. A login shell cannot be suspended; the `-f' option can be + used to override this and force the suspension. + + When job control is not active, the `kill' and `wait' builtins do +not accept JOBSPEC arguments. They must be supplied process IDs. + + +File: bashref.info, Node: Job Control Variables, Prev: Job Control Builtins, Up: Job Control + +7.3 Job Control Variables +========================= + +`auto_resume' + This variable controls how the shell interacts with the user and + job control. If this variable exists then single word simple + commands without redirections are treated as candidates for + resumption of an existing job. There is no ambiguity allowed; if + there is more than one job beginning with the string typed, then + the most recently accessed job will be selected. The name of a + stopped job, in this context, is the command line used to start + it. If this variable is set to the value `exact', the string + supplied must match the name of a stopped job exactly; if set to + `substring', the string supplied needs to match a substring of the + name of a stopped job. The `substring' value provides + functionality analogous to the `%?' job ID (*note Job Control + Basics::). If set to any other value, the supplied string must be + a prefix of a stopped job's name; this provides functionality + analogous to the `%' job ID. + + + +File: bashref.info, Node: Command Line Editing, Next: Using History Interactively, Prev: Job Control, Up: Top + +8 Command Line Editing +********************** + +This chapter describes the basic features of the GNU command line +editing interface. Command line editing is provided by the Readline +library, which is used by several different programs, including Bash. +Command line editing is enabled by default when using an interactive +shell, unless the `--noediting' option is supplied at shell invocation. +Line editing is also used when using the `-e' option to the `read' +builtin command (*note Bash Builtins::). By default, the line editing +commands are similar to those of Emacs. A vi-style line editing +interface is also available. Line editing can be enabled at any time +using the `-o emacs' or `-o vi' options to the `set' builtin command +(*note The Set Builtin::), or disabled using the `+o emacs' or `+o vi' +options to `set'. + +* Menu: + +* Introduction and Notation:: Notation used in this text. +* Readline Interaction:: The minimum set of commands for editing a line. +* Readline Init File:: Customizing Readline from a user's view. +* Bindable Readline Commands:: A description of most of the Readline commands + available for binding +* Readline vi Mode:: A short description of how to make Readline + behave like the vi editor. + +* Programmable Completion:: How to specify the possible completions for + a specific command. +* Programmable Completion Builtins:: Builtin commands to specify how to + complete arguments for a particular command. +* A Programmable Completion Example:: An example shell function for + generating possible completions. + + +File: bashref.info, Node: Introduction and Notation, Next: Readline Interaction, Up: Command Line Editing + +8.1 Introduction to Line Editing +================================ + +The following paragraphs describe the notation used to represent +keystrokes. + + The text `C-k' is read as `Control-K' and describes the character +produced when the key is pressed while the Control key is depressed. + + The text `M-k' is read as `Meta-K' and describes the character +produced when the Meta key (if you have one) is depressed, and the +key is pressed. The Meta key is labeled on many keyboards. On +keyboards with two keys labeled (usually to either side of the +space bar), the on the left side is generally set to work as a +Meta key. The key on the right may also be configured to work as +a Meta key or may be configured as some other modifier, such as a +Compose key for typing accented characters. + + If you do not have a Meta or key, or another key working as a +Meta key, the identical keystroke can be generated by typing +_first_, and then typing . Either process is known as "metafying" +the key. + + The text `M-C-k' is read as `Meta-Control-k' and describes the +character produced by "metafying" `C-k'. + + In addition, several keys have their own names. Specifically, +, , , , , and all stand for themselves +when seen in this text, or in an init file (*note Readline Init File::). +If your keyboard lacks a key, typing will produce the +desired character. The key may be labeled or on +some keyboards. + + +File: bashref.info, Node: Readline Interaction, Next: Readline Init File, Prev: Introduction and Notation, Up: Command Line Editing + +8.2 Readline Interaction +======================== + +Often during an interactive session you type in a long line of text, +only to notice that the first word on the line is misspelled. The +Readline library gives you a set of commands for manipulating the text +as you type it in, allowing you to just fix your typo, and not forcing +you to retype the majority of the line. Using these editing commands, +you move the cursor to the place that needs correction, and delete or +insert the text of the corrections. Then, when you are satisfied with +the line, you simply press . You do not have to be at the end of +the line to press ; the entire line is accepted regardless of the +location of the cursor within the line. + +* Menu: + +* Readline Bare Essentials:: The least you need to know about Readline. +* Readline Movement Commands:: Moving about the input line. +* Readline Killing Commands:: How to delete text, and how to get it back! +* Readline Arguments:: Giving numeric arguments to commands. +* Searching:: Searching through previous lines. + + +File: bashref.info, Node: Readline Bare Essentials, Next: Readline Movement Commands, Up: Readline Interaction + +8.2.1 Readline Bare Essentials +------------------------------ + +In order to enter characters into the line, simply type them. The typed +character appears where the cursor was, and then the cursor moves one +space to the right. If you mistype a character, you can use your erase +character to back up and delete the mistyped character. + + Sometimes you may mistype a character, and not notice the error +until you have typed several other characters. In that case, you can +type `C-b' to move the cursor to the left, and then correct your +mistake. Afterwards, you can move the cursor to the right with `C-f'. + + When you add text in the middle of a line, you will notice that +characters to the right of the cursor are `pushed over' to make room +for the text that you have inserted. Likewise, when you delete text +behind the cursor, characters to the right of the cursor are `pulled +back' to fill in the blank space created by the removal of the text. A +list of the bare essentials for editing the text of an input line +follows. + +`C-b' + Move back one character. + +`C-f' + Move forward one character. + + or + Delete the character to the left of the cursor. + +`C-d' + Delete the character underneath the cursor. + +Printing characters + Insert the character into the line at the cursor. + +`C-_' or `C-x C-u' + Undo the last editing command. You can undo all the way back to an + empty line. + +(Depending on your configuration, the key be set to delete +the character to the left of the cursor and the key set to delete +the character underneath the cursor, like `C-d', rather than the +character to the left of the cursor.) + + +File: bashref.info, Node: Readline Movement Commands, Next: Readline Killing Commands, Prev: Readline Bare Essentials, Up: Readline Interaction + +8.2.2 Readline Movement Commands +-------------------------------- + +The above table describes the most basic keystrokes that you need in +order to do editing of the input line. For your convenience, many +other commands have been added in addition to `C-b', `C-f', `C-d', and +. Here are some commands for moving more rapidly about the line. + +`C-a' + Move to the start of the line. + +`C-e' + Move to the end of the line. + +`M-f' + Move forward a word, where a word is composed of letters and + digits. + +`M-b' + Move backward a word. + +`C-l' + Clear the screen, reprinting the current line at the top. + + Notice how `C-f' moves forward a character, while `M-f' moves +forward a word. It is a loose convention that control keystrokes +operate on characters while meta keystrokes operate on words. + + +File: bashref.info, Node: Readline Killing Commands, Next: Readline Arguments, Prev: Readline Movement Commands, Up: Readline Interaction + +8.2.3 Readline Killing Commands +------------------------------- + +"Killing" text means to delete the text from the line, but to save it +away for later use, usually by "yanking" (re-inserting) it back into +the line. (`Cut' and `paste' are more recent jargon for `kill' and +`yank'.) + + If the description for a command says that it `kills' text, then you +can be sure that you can get the text back in a different (or the same) +place later. + + When you use a kill command, the text is saved in a "kill-ring". +Any number of consecutive kills save all of the killed text together, so +that when you yank it back, you get it all. The kill ring is not line +specific; the text that you killed on a previously typed line is +available to be yanked back later, when you are typing another line. + + Here is the list of commands for killing text. + +`C-k' + Kill the text from the current cursor position to the end of the + line. + +`M-d' + Kill from the cursor to the end of the current word, or, if between + words, to the end of the next word. Word boundaries are the same + as those used by `M-f'. + +`M-' + Kill from the cursor the start of the current word, or, if between + words, to the start of the previous word. Word boundaries are the + same as those used by `M-b'. + +`C-w' + Kill from the cursor to the previous whitespace. This is + different than `M-' because the word boundaries differ. + + + Here is how to "yank" the text back into the line. Yanking means to +copy the most-recently-killed text from the kill buffer. + +`C-y' + Yank the most recently killed text back into the buffer at the + cursor. + +`M-y' + Rotate the kill-ring, and yank the new top. You can only do this + if the prior command is `C-y' or `M-y'. + + +File: bashref.info, Node: Readline Arguments, Next: Searching, Prev: Readline Killing Commands, Up: Readline Interaction + +8.2.4 Readline Arguments +------------------------ + +You can pass numeric arguments to Readline commands. Sometimes the +argument acts as a repeat count, other times it is the sign of the +argument that is significant. If you pass a negative argument to a +command which normally acts in a forward direction, that command will +act in a backward direction. For example, to kill text back to the +start of the line, you might type `M-- C-k'. + + The general way to pass numeric arguments to a command is to type +meta digits before the command. If the first `digit' typed is a minus +sign (`-'), then the sign of the argument will be negative. Once you +have typed one meta digit to get the argument started, you can type the +remainder of the digits, and then the command. For example, to give +the `C-d' command an argument of 10, you could type `M-1 0 C-d', which +will delete the next ten characters on the input line. + + +File: bashref.info, Node: Searching, Prev: Readline Arguments, Up: Readline Interaction + +8.2.5 Searching for Commands in the History +------------------------------------------- + +Readline provides commands for searching through the command history +(*note Bash History Facilities::) for lines containing a specified +string. There are two search modes: "incremental" and +"non-incremental". + + Incremental searches begin before the user has finished typing the +search string. As each character of the search string is typed, +Readline displays the next entry from the history matching the string +typed so far. An incremental search requires only as many characters +as needed to find the desired history entry. To search backward in the +history for a particular string, type `C-r'. Typing `C-s' searches +forward through the history. The characters present in the value of +the `isearch-terminators' variable are used to terminate an incremental +search. If that variable has not been assigned a value, the and +`C-J' characters will terminate an incremental search. `C-g' will +abort an incremental search and restore the original line. When the +search is terminated, the history entry containing the search string +becomes the current line. + + To find other matching entries in the history list, type `C-r' or +`C-s' as appropriate. This will search backward or forward in the +history for the next entry matching the search string typed so far. +Any other key sequence bound to a Readline command will terminate the +search and execute that command. For instance, a will terminate +the search and accept the line, thereby executing the command from the +history list. A movement command will terminate the search, make the +last line found the current line, and begin editing. + + Readline remembers the last incremental search string. If two +`C-r's are typed without any intervening characters defining a new +search string, any remembered search string is used. + + Non-incremental searches read the entire search string before +starting to search for matching history lines. The search string may be +typed by the user or be part of the contents of the current line. + + +File: bashref.info, Node: Readline Init File, Next: Bindable Readline Commands, Prev: Readline Interaction, Up: Command Line Editing + +8.3 Readline Init File +====================== + +Although the Readline library comes with a set of Emacs-like +keybindings installed by default, it is possible to use a different set +of keybindings. Any user can customize programs that use Readline by +putting commands in an "inputrc" file, conventionally in his home +directory. The name of this file is taken from the value of the shell +variable `INPUTRC'. If that variable is unset, the default is +`~/.inputrc'. If that file does not exist or cannot be read, the +ultimate default is `/etc/inputrc'. + + When a program which uses the Readline library starts up, the init +file is read, and the key bindings are set. + + In addition, the `C-x C-r' command re-reads this init file, thus +incorporating any changes that you might have made to it. + +* Menu: + +* Readline Init File Syntax:: Syntax for the commands in the inputrc file. + +* Conditional Init Constructs:: Conditional key bindings in the inputrc file. + +* Sample Init File:: An example inputrc file. + + +File: bashref.info, Node: Readline Init File Syntax, Next: Conditional Init Constructs, Up: Readline Init File + +8.3.1 Readline Init File Syntax +------------------------------- + +There are only a few basic constructs allowed in the Readline init +file. Blank lines are ignored. Lines beginning with a `#' are +comments. Lines beginning with a `$' indicate conditional constructs +(*note Conditional Init Constructs::). Other lines denote variable +settings and key bindings. + +Variable Settings + You can modify the run-time behavior of Readline by altering the + values of variables in Readline using the `set' command within the + init file. The syntax is simple: + + set VARIABLE VALUE + + Here, for example, is how to change from the default Emacs-like + key binding to use `vi' line editing commands: + + set editing-mode vi + + Variable names and values, where appropriate, are recognized + without regard to case. Unrecognized variable names are ignored. + + Boolean variables (those that can be set to on or off) are set to + on if the value is null or empty, ON (case-insensitive), or 1. + Any other value results in the variable being set to off. + + The `bind -V' command lists the current Readline variable names + and values. *Note Bash Builtins::. + + A great deal of run-time behavior is changeable with the following + variables. + + `bell-style' + Controls what happens when Readline wants to ring the + terminal bell. If set to `none', Readline never rings the + bell. If set to `visible', Readline uses a visible bell if + one is available. If set to `audible' (the default), + Readline attempts to ring the terminal's bell. + + `bind-tty-special-chars' + If set to `on', Readline attempts to bind the control + characters treated specially by the kernel's terminal driver + to their Readline equivalents. + + `colored-stats' + If set to `on', Readline displays possible completions using + different colors to indicate their file type. The color + definitions are taken from the value of the `LS_COLORS' + environment variable. The default is `off'. + + `comment-begin' + The string to insert at the beginning of the line when the + `insert-comment' command is executed. The default value is + `"#"'. + + `completion-display-width' + The number of screen columns used to display possible matches + when performing completion. The value is ignored if it is + less than 0 or greater than the terminal screen width. A + value of 0 will cause matches to be displayed one per line. + The default value is -1. + + `completion-ignore-case' + If set to `on', Readline performs filename matching and + completion in a case-insensitive fashion. The default value + is `off'. + + `completion-map-case' + If set to `on', and COMPLETION-IGNORE-CASE is enabled, + Readline treats hyphens (`-') and underscores (`_') as + equivalent when performing case-insensitive filename matching + and completion. + + `completion-prefix-display-length' + The length in characters of the common prefix of a list of + possible completions that is displayed without modification. + When set to a value greater than zero, common prefixes longer + than this value are replaced with an ellipsis when displaying + possible completions. + + `completion-query-items' + The number of possible completions that determines when the + user is asked whether the list of possibilities should be + displayed. If the number of possible completions is greater + than this value, Readline will ask the user whether or not he + wishes to view them; otherwise, they are simply listed. This + variable must be set to an integer value greater than or + equal to 0. A negative value means Readline should never ask. + The default limit is `100'. + + `convert-meta' + If set to `on', Readline will convert characters with the + eighth bit set to an ASCII key sequence by stripping the + eighth bit and prefixing an character, converting them + to a meta-prefixed key sequence. The default value is `on'. + + `disable-completion' + If set to `On', Readline will inhibit word completion. + Completion characters will be inserted into the line as if + they had been mapped to `self-insert'. The default is `off'. + + `editing-mode' + The `editing-mode' variable controls which default set of key + bindings is used. By default, Readline starts up in Emacs + editing mode, where the keystrokes are most similar to Emacs. + This variable can be set to either `emacs' or `vi'. + + `echo-control-characters' + When set to `on', on operating systems that indicate they + support it, readline echoes a character corresponding to a + signal generated from the keyboard. The default is `on'. + + `enable-keypad' + When set to `on', Readline will try to enable the application + keypad when it is called. Some systems need this to enable + the arrow keys. The default is `off'. + + `enable-meta-key' + When set to `on', Readline will try to enable any meta + modifier key the terminal claims to support when it is + called. On many terminals, the meta key is used to send + eight-bit characters. The default is `on'. + + `expand-tilde' + If set to `on', tilde expansion is performed when Readline + attempts word completion. The default is `off'. + + `history-preserve-point' + If set to `on', the history code attempts to place the point + (the current cursor position) at the same location on each + history line retrieved with `previous-history' or + `next-history'. The default is `off'. + + `history-size' + Set the maximum number of history entries saved in the + history list. If set to zero, any existing history entries + are deleted and no new entries are saved. If set to a value + less than zero, the number of history entries is not limited. + By default, the number of history entries is not limited. + + `horizontal-scroll-mode' + This variable can be set to either `on' or `off'. Setting it + to `on' means that the text of the lines being edited will + scroll horizontally on a single screen line when they are + longer than the width of the screen, instead of wrapping onto + a new screen line. By default, this variable is set to `off'. + + `input-meta' + If set to `on', Readline will enable eight-bit input (it will + not clear the eighth bit in the characters it reads), + regardless of what the terminal claims it can support. The + default value is `off'. The name `meta-flag' is a synonym + for this variable. + + `isearch-terminators' + The string of characters that should terminate an incremental + search without subsequently executing the character as a + command (*note Searching::). If this variable has not been + given a value, the characters and `C-J' will terminate + an incremental search. + + `keymap' + Sets Readline's idea of the current keymap for key binding + commands. Acceptable `keymap' names are `emacs', + `emacs-standard', `emacs-meta', `emacs-ctlx', `vi', `vi-move', + `vi-command', and `vi-insert'. `vi' is equivalent to + `vi-command'; `emacs' is equivalent to `emacs-standard'. The + default value is `emacs'. The value of the `editing-mode' + variable also affects the default keymap. + + `keyseq-timeout' + Specifies the duration Readline will wait for a character + when reading an ambiguous key sequence (one that can form a + complete key sequence using the input read so far, or can + take additional input to complete a longer key sequence). If + no input is received within the timeout, Readline will use + the shorter but complete key sequence. Readline uses this + value to determine whether or not input is available on the + current input source (`rl_instream' by default). The value + is specified in milliseconds, so a value of 1000 means that + Readline will wait one second for additional input. If this + variable is set to a value less than or equal to zero, or to a + non-numeric value, Readline will wait until another key is + pressed to decide which key sequence to complete. The + default value is `500'. + + `mark-directories' + If set to `on', completed directory names have a slash + appended. The default is `on'. + + `mark-modified-lines' + This variable, when set to `on', causes Readline to display an + asterisk (`*') at the start of history lines which have been + modified. This variable is `off' by default. + + `mark-symlinked-directories' + If set to `on', completed names which are symbolic links to + directories have a slash appended (subject to the value of + `mark-directories'). The default is `off'. + + `match-hidden-files' + This variable, when set to `on', causes Readline to match + files whose names begin with a `.' (hidden files) when + performing filename completion. If set to `off', the leading + `.' must be supplied by the user in the filename to be + completed. This variable is `on' by default. + + `menu-complete-display-prefix' + If set to `on', menu completion displays the common prefix of + the list of possible completions (which may be empty) before + cycling through the list. The default is `off'. + + `output-meta' + If set to `on', Readline will display characters with the + eighth bit set directly rather than as a meta-prefixed escape + sequence. The default is `off'. + + `page-completions' + If set to `on', Readline uses an internal `more'-like pager + to display a screenful of possible completions at a time. + This variable is `on' by default. + + `print-completions-horizontally' + If set to `on', Readline will display completions with matches + sorted horizontally in alphabetical order, rather than down + the screen. The default is `off'. + + `revert-all-at-newline' + If set to `on', Readline will undo all changes to history + lines before returning when `accept-line' is executed. By + default, history lines may be modified and retain individual + undo lists across calls to `readline'. The default is `off'. + + `show-all-if-ambiguous' + This alters the default behavior of the completion functions. + If set to `on', words which have more than one possible + completion cause the matches to be listed immediately instead + of ringing the bell. The default value is `off'. + + `show-all-if-unmodified' + This alters the default behavior of the completion functions + in a fashion similar to SHOW-ALL-IF-AMBIGUOUS. If set to + `on', words which have more than one possible completion + without any possible partial completion (the possible + completions don't share a common prefix) cause the matches to + be listed immediately instead of ringing the bell. The + default value is `off'. + + `show-mode-in-prompt' + If set to `on', add a character to the beginning of the prompt + indicating the editing mode: emacs (`@'), vi command (`:'), + or vi insertion (`+'). The default value is `off'. + + `skip-completed-text' + If set to `on', this alters the default completion behavior + when inserting a single match into the line. It's only + active when performing completion in the middle of a word. + If enabled, readline does not insert characters from the + completion that match characters after point in the word + being completed, so portions of the word following the cursor + are not duplicated. For instance, if this is enabled, + attempting completion when the cursor is after the `e' in + `Makefile' will result in `Makefile' rather than + `Makefilefile', assuming there is a single possible + completion. The default value is `off'. + + `visible-stats' + If set to `on', a character denoting a file's type is + appended to the filename when listing possible completions. + The default is `off'. + + +Key Bindings + The syntax for controlling key bindings in the init file is + simple. First you need to find the name of the command that you + want to change. The following sections contain tables of the + command name, the default keybinding, if any, and a short + description of what the command does. + + Once you know the name of the command, simply place on a line in + the init file the name of the key you wish to bind the command to, + a colon, and then the name of the command. There can be no space + between the key name and the colon - that will be interpreted as + part of the key name. The name of the key can be expressed in + different ways, depending on what you find most comfortable. + + In addition to command names, readline allows keys to be bound to + a string that is inserted when the key is pressed (a MACRO). + + The `bind -p' command displays Readline function names and + bindings in a format that can put directly into an initialization + file. *Note Bash Builtins::. + + KEYNAME: FUNCTION-NAME or MACRO + KEYNAME is the name of a key spelled out in English. For + example: + Control-u: universal-argument + Meta-Rubout: backward-kill-word + Control-o: "> output" + + In the above example, `C-u' is bound to the function + `universal-argument', `M-DEL' is bound to the function + `backward-kill-word', and `C-o' is bound to run the macro + expressed on the right hand side (that is, to insert the text + `> output' into the line). + + A number of symbolic character names are recognized while + processing this key binding syntax: DEL, ESC, ESCAPE, LFD, + NEWLINE, RET, RETURN, RUBOUT, SPACE, SPC, and TAB. + + "KEYSEQ": FUNCTION-NAME or MACRO + KEYSEQ differs from KEYNAME above in that strings denoting an + entire key sequence can be specified, by placing the key + sequence in double quotes. Some GNU Emacs style key escapes + can be used, as in the following example, but the special + character names are not recognized. + + "\C-u": universal-argument + "\C-x\C-r": re-read-init-file + "\e[11~": "Function Key 1" + + In the above example, `C-u' is again bound to the function + `universal-argument' (just as it was in the first example), + `C-x C-r' is bound to the function `re-read-init-file', and + ` <[> <1> <1> <~>' is bound to insert the text `Function + Key 1'. + + + The following GNU Emacs style escape sequences are available when + specifying key sequences: + + `\C-' + control prefix + + `\M-' + meta prefix + + `\e' + an escape character + + `\\' + backslash + + `\"' + <">, a double quotation mark + + `\'' + <'>, a single quote or apostrophe + + In addition to the GNU Emacs style escape sequences, a second set + of backslash escapes is available: + + `\a' + alert (bell) + + `\b' + backspace + + `\d' + delete + + `\f' + form feed + + `\n' + newline + + `\r' + carriage return + + `\t' + horizontal tab + + `\v' + vertical tab + + `\NNN' + the eight-bit character whose value is the octal value NNN + (one to three digits) + + `\xHH' + the eight-bit character whose value is the hexadecimal value + HH (one or two hex digits) + + When entering the text of a macro, single or double quotes must be + used to indicate a macro definition. Unquoted text is assumed to + be a function name. In the macro body, the backslash escapes + described above are expanded. Backslash will quote any other + character in the macro text, including `"' and `''. For example, + the following binding will make `C-x \' insert a single `\' into + the line: + "\C-x\\": "\\" + + + +File: bashref.info, Node: Conditional Init Constructs, Next: Sample Init File, Prev: Readline Init File Syntax, Up: Readline Init File + +8.3.2 Conditional Init Constructs +--------------------------------- + +Readline implements a facility similar in spirit to the conditional +compilation features of the C preprocessor which allows key bindings +and variable settings to be performed as the result of tests. There +are four parser directives used. + +`$if' + The `$if' construct allows bindings to be made based on the + editing mode, the terminal being used, or the application using + Readline. The text of the test extends to the end of the line; no + characters are required to isolate it. + + `mode' + The `mode=' form of the `$if' directive is used to test + whether Readline is in `emacs' or `vi' mode. This may be + used in conjunction with the `set keymap' command, for + instance, to set bindings in the `emacs-standard' and + `emacs-ctlx' keymaps only if Readline is starting out in + `emacs' mode. + + `term' + The `term=' form may be used to include terminal-specific key + bindings, perhaps to bind the key sequences output by the + terminal's function keys. The word on the right side of the + `=' is tested against both the full name of the terminal and + the portion of the terminal name before the first `-'. This + allows `sun' to match both `sun' and `sun-cmd', for instance. + + `application' + The APPLICATION construct is used to include + application-specific settings. Each program using the + Readline library sets the APPLICATION NAME, and you can test + for a particular value. This could be used to bind key + sequences to functions useful for a specific program. For + instance, the following command adds a key sequence that + quotes the current or previous word in Bash: + $if Bash + # Quote the current or previous word + "\C-xq": "\eb\"\ef\"" + $endif + +`$endif' + This command, as seen in the previous example, terminates an `$if' + command. + +`$else' + Commands in this branch of the `$if' directive are executed if the + test fails. + +`$include' + This directive takes a single filename as an argument and reads + commands and bindings from that file. For example, the following + directive reads from `/etc/inputrc': + $include /etc/inputrc + + +File: bashref.info, Node: Sample Init File, Prev: Conditional Init Constructs, Up: Readline Init File + +8.3.3 Sample Init File +---------------------- + +Here is an example of an INPUTRC file. This illustrates key binding, +variable assignment, and conditional syntax. + + + # This file controls the behaviour of line input editing for + # programs that use the GNU Readline library. Existing + # programs include FTP, Bash, and GDB. + # + # You can re-read the inputrc file with C-x C-r. + # Lines beginning with '#' are comments. + # + # First, include any system-wide bindings and variable + # assignments from /etc/Inputrc + $include /etc/Inputrc + + # + # Set various bindings for emacs mode. + + set editing-mode emacs + + $if mode=emacs + + Meta-Control-h: backward-kill-word Text after the function name is ignored + + # + # Arrow keys in keypad mode + # + #"\M-OD": backward-char + #"\M-OC": forward-char + #"\M-OA": previous-history + #"\M-OB": next-history + # + # Arrow keys in ANSI mode + # + "\M-[D": backward-char + "\M-[C": forward-char + "\M-[A": previous-history + "\M-[B": next-history + # + # Arrow keys in 8 bit keypad mode + # + #"\M-\C-OD": backward-char + #"\M-\C-OC": forward-char + #"\M-\C-OA": previous-history + #"\M-\C-OB": next-history + # + # Arrow keys in 8 bit ANSI mode + # + #"\M-\C-[D": backward-char + #"\M-\C-[C": forward-char + #"\M-\C-[A": previous-history + #"\M-\C-[B": next-history + + C-q: quoted-insert + + $endif + + # An old-style binding. This happens to be the default. + TAB: complete + + # Macros that are convenient for shell interaction + $if Bash + # edit the path + "\C-xp": "PATH=${PATH}\e\C-e\C-a\ef\C-f" + # prepare to type a quoted word -- + # insert open and close double quotes + # and move to just after the open quote + "\C-x\"": "\"\"\C-b" + # insert a backslash (testing backslash escapes + # in sequences and macros) + "\C-x\\": "\\" + # Quote the current or previous word + "\C-xq": "\eb\"\ef\"" + # Add a binding to refresh the line, which is unbound + "\C-xr": redraw-current-line + # Edit variable on current line. + "\M-\C-v": "\C-a\C-k$\C-y\M-\C-e\C-a\C-y=" + $endif + + # use a visible bell if one is available + set bell-style visible + + # don't strip characters to 7 bits when reading + set input-meta on + + # allow iso-latin1 characters to be inserted rather + # than converted to prefix-meta sequences + set convert-meta off + + # display characters with the eighth bit set directly + # rather than as meta-prefixed characters + set output-meta on + + # if there are more than 150 possible completions for + # a word, ask the user if he wants to see all of them + set completion-query-items 150 + + # For FTP + $if Ftp + "\C-xg": "get \M-?" + "\C-xt": "put \M-?" + "\M-.": yank-last-arg + $endif + + +File: bashref.info, Node: Bindable Readline Commands, Next: Readline vi Mode, Prev: Readline Init File, Up: Command Line Editing + +8.4 Bindable Readline Commands +============================== + +* Menu: + +* Commands For Moving:: Moving about the line. +* Commands For History:: Getting at previous lines. +* Commands For Text:: Commands for changing text. +* Commands For Killing:: Commands for killing and yanking. +* Numeric Arguments:: Specifying numeric arguments, repeat counts. +* Commands For Completion:: Getting Readline to do the typing for you. +* Keyboard Macros:: Saving and re-executing typed characters +* Miscellaneous Commands:: Other miscellaneous commands. + + This section describes Readline commands that may be bound to key +sequences. You can list your key bindings by executing `bind -P' or, +for a more terse format, suitable for an INPUTRC file, `bind -p'. +(*Note Bash Builtins::.) Command names without an accompanying key +sequence are unbound by default. + + In the following descriptions, "point" refers to the current cursor +position, and "mark" refers to a cursor position saved by the +`set-mark' command. The text between the point and mark is referred to +as the "region". + + +File: bashref.info, Node: Commands For Moving, Next: Commands For History, Up: Bindable Readline Commands + +8.4.1 Commands For Moving +------------------------- + +`beginning-of-line (C-a)' + Move to the start of the current line. + +`end-of-line (C-e)' + Move to the end of the line. + +`forward-char (C-f)' + Move forward a character. + +`backward-char (C-b)' + Move back a character. + +`forward-word (M-f)' + Move forward to the end of the next word. Words are composed of + letters and digits. + +`backward-word (M-b)' + Move back to the start of the current or previous word. Words are + composed of letters and digits. + +`shell-forward-word ()' + Move forward to the end of the next word. Words are delimited by + non-quoted shell metacharacters. + +`shell-backward-word ()' + Move back to the start of the current or previous word. Words are + delimited by non-quoted shell metacharacters. + +`clear-screen (C-l)' + Clear the screen and redraw the current line, leaving the current + line at the top of the screen. + +`redraw-current-line ()' + Refresh the current line. By default, this is unbound. + + + +File: bashref.info, Node: Commands For History, Next: Commands For Text, Prev: Commands For Moving, Up: Bindable Readline Commands + +8.4.2 Commands For Manipulating The History +------------------------------------------- + +`accept-line (Newline or Return)' + Accept the line regardless of where the cursor is. If this line is + non-empty, add it to the history list according to the setting of + the `HISTCONTROL' and `HISTIGNORE' variables. If this line is a + modified history line, then restore the history line to its + original state. + +`previous-history (C-p)' + Move `back' through the history list, fetching the previous + command. + +`next-history (C-n)' + Move `forward' through the history list, fetching the next command. + +`beginning-of-history (M-<)' + Move to the first line in the history. + +`end-of-history (M->)' + Move to the end of the input history, i.e., the line currently + being entered. + +`reverse-search-history (C-r)' + Search backward starting at the current line and moving `up' + through the history as necessary. This is an incremental search. + +`forward-search-history (C-s)' + Search forward starting at the current line and moving `down' + through the the history as necessary. This is an incremental + search. + +`non-incremental-reverse-search-history (M-p)' + Search backward starting at the current line and moving `up' + through the history as necessary using a non-incremental search + for a string supplied by the user. + +`non-incremental-forward-search-history (M-n)' + Search forward starting at the current line and moving `down' + through the the history as necessary using a non-incremental search + for a string supplied by the user. + +`history-search-forward ()' + Search forward through the history for the string of characters + between the start of the current line and the point. The search + string must match at the beginning of a history line. This is a + non-incremental search. By default, this command is unbound. + +`history-search-backward ()' + Search backward through the history for the string of characters + between the start of the current line and the point. The search + string must match at the beginning of a history line. This is a + non-incremental search. By default, this command is unbound. + +`history-substr-search-forward ()' + Search forward through the history for the string of characters + between the start of the current line and the point. The search + string may match anywhere in a history line. This is a + non-incremental search. By default, this command is unbound. + +`history-substr-search-backward ()' + Search backward through the history for the string of characters + between the start of the current line and the point. The search + string may match anywhere in a history line. This is a + non-incremental search. By default, this command is unbound. + +`yank-nth-arg (M-C-y)' + Insert the first argument to the previous command (usually the + second word on the previous line) at point. With an argument N, + insert the Nth word from the previous command (the words in the + previous command begin with word 0). A negative argument inserts + the Nth word from the end of the previous command. Once the + argument N is computed, the argument is extracted as if the `!N' + history expansion had been specified. + +`yank-last-arg (M-. or M-_)' + Insert last argument to the previous command (the last word of the + previous history entry). With a numeric argument, behave exactly + like `yank-nth-arg'. Successive calls to `yank-last-arg' move + back through the history list, inserting the last word (or the + word specified by the argument to the first call) of each line in + turn. Any numeric argument supplied to these successive calls + determines the direction to move through the history. A negative + argument switches the direction through the history (back or + forward). The history expansion facilities are used to extract + the last argument, as if the `!$' history expansion had been + specified. + + + +File: bashref.info, Node: Commands For Text, Next: Commands For Killing, Prev: Commands For History, Up: Bindable Readline Commands + +8.4.3 Commands For Changing Text +-------------------------------- + +`end-of-file (usually C-d)' + The character indicating end-of-file as set, for example, by + `stty'. If this character is read when there are no characters on + the line, and point is at the beginning of the line, Readline + interprets it as the end of input and returns EOF. + +`delete-char (C-d)' + Delete the character at point. If this function is bound to the + same character as the tty EOF character, as `C-d' commonly is, see + above for the effects. + +`backward-delete-char (Rubout)' + Delete the character behind the cursor. A numeric argument means + to kill the characters instead of deleting them. + +`forward-backward-delete-char ()' + Delete the character under the cursor, unless the cursor is at the + end of the line, in which case the character behind the cursor is + deleted. By default, this is not bound to a key. + +`quoted-insert (C-q or C-v)' + Add the next character typed to the line verbatim. This is how to + insert key sequences like `C-q', for example. + +`self-insert (a, b, A, 1, !, ...)' + Insert yourself. + +`transpose-chars (C-t)' + Drag the character before the cursor forward over the character at + the cursor, moving the cursor forward as well. If the insertion + point is at the end of the line, then this transposes the last two + characters of the line. Negative arguments have no effect. + +`transpose-words (M-t)' + Drag the word before point past the word after point, moving point + past that word as well. If the insertion point is at the end of + the line, this transposes the last two words on the line. + +`upcase-word (M-u)' + Uppercase the current (or following) word. With a negative + argument, uppercase the previous word, but do not move the cursor. + +`downcase-word (M-l)' + Lowercase the current (or following) word. With a negative + argument, lowercase the previous word, but do not move the cursor. + +`capitalize-word (M-c)' + Capitalize the current (or following) word. With a negative + argument, capitalize the previous word, but do not move the cursor. + +`overwrite-mode ()' + Toggle overwrite mode. With an explicit positive numeric argument, + switches to overwrite mode. With an explicit non-positive numeric + argument, switches to insert mode. This command affects only + `emacs' mode; `vi' mode does overwrite differently. Each call to + `readline()' starts in insert mode. + + In overwrite mode, characters bound to `self-insert' replace the + text at point rather than pushing the text to the right. + Characters bound to `backward-delete-char' replace the character + before point with a space. + + By default, this command is unbound. + + + +File: bashref.info, Node: Commands For Killing, Next: Numeric Arguments, Prev: Commands For Text, Up: Bindable Readline Commands + +8.4.4 Killing And Yanking +------------------------- + +`kill-line (C-k)' + Kill the text from point to the end of the line. + +`backward-kill-line (C-x Rubout)' + Kill backward to the beginning of the line. + +`unix-line-discard (C-u)' + Kill backward from the cursor to the beginning of the current line. + +`kill-whole-line ()' + Kill all characters on the current line, no matter where point is. + By default, this is unbound. + +`kill-word (M-d)' + Kill from point to the end of the current word, or if between + words, to the end of the next word. Word boundaries are the same + as `forward-word'. + +`backward-kill-word (M-)' + Kill the word behind point. Word boundaries are the same as + `backward-word'. + +`shell-kill-word ()' + Kill from point to the end of the current word, or if between + words, to the end of the next word. Word boundaries are the same + as `shell-forward-word'. + +`shell-backward-kill-word ()' + Kill the word behind point. Word boundaries are the same as + `shell-backward-word'. + +`unix-word-rubout (C-w)' + Kill the word behind point, using white space as a word boundary. + The killed text is saved on the kill-ring. + +`unix-filename-rubout ()' + Kill the word behind point, using white space and the slash + character as the word boundaries. The killed text is saved on the + kill-ring. + +`delete-horizontal-space ()' + Delete all spaces and tabs around point. By default, this is + unbound. + +`kill-region ()' + Kill the text in the current region. By default, this command is + unbound. + +`copy-region-as-kill ()' + Copy the text in the region to the kill buffer, so it can be yanked + right away. By default, this command is unbound. + +`copy-backward-word ()' + Copy the word before point to the kill buffer. The word + boundaries are the same as `backward-word'. By default, this + command is unbound. + +`copy-forward-word ()' + Copy the word following point to the kill buffer. The word + boundaries are the same as `forward-word'. By default, this + command is unbound. + +`yank (C-y)' + Yank the top of the kill ring into the buffer at point. + +`yank-pop (M-y)' + Rotate the kill-ring, and yank the new top. You can only do this + if the prior command is `yank' or `yank-pop'. + + +File: bashref.info, Node: Numeric Arguments, Next: Commands For Completion, Prev: Commands For Killing, Up: Bindable Readline Commands + +8.4.5 Specifying Numeric Arguments +---------------------------------- + +`digit-argument (M-0, M-1, ... M--)' + Add this digit to the argument already accumulating, or start a new + argument. `M--' starts a negative argument. + +`universal-argument ()' + This is another way to specify an argument. If this command is + followed by one or more digits, optionally with a leading minus + sign, those digits define the argument. If the command is + followed by digits, executing `universal-argument' again ends the + numeric argument, but is otherwise ignored. As a special case, if + this command is immediately followed by a character that is + neither a digit or minus sign, the argument count for the next + command is multiplied by four. The argument count is initially + one, so executing this function the first time makes the argument + count four, a second time makes the argument count sixteen, and so + on. By default, this is not bound to a key. + + +File: bashref.info, Node: Commands For Completion, Next: Keyboard Macros, Prev: Numeric Arguments, Up: Bindable Readline Commands + +8.4.6 Letting Readline Type For You +----------------------------------- + +`complete ()' + Attempt to perform completion on the text before point. The + actual completion performed is application-specific. Bash + attempts completion treating the text as a variable (if the text + begins with `$'), username (if the text begins with `~'), hostname + (if the text begins with `@'), or command (including aliases and + functions) in turn. If none of these produces a match, filename + completion is attempted. + +`possible-completions (M-?)' + List the possible completions of the text before point. When + displaying completions, Readline sets the number of columns used + for display to the value of `completion-display-width', the value + of the environment variable `COLUMNS', or the screen width, in + that order. + +`insert-completions (M-*)' + Insert all completions of the text before point that would have + been generated by `possible-completions'. + +`menu-complete ()' + Similar to `complete', but replaces the word to be completed with + a single match from the list of possible completions. Repeated + execution of `menu-complete' steps through the list of possible + completions, inserting each match in turn. At the end of the list + of completions, the bell is rung (subject to the setting of + `bell-style') and the original text is restored. An argument of N + moves N positions forward in the list of matches; a negative + argument may be used to move backward through the list. This + command is intended to be bound to , but is unbound by + default. + +`menu-complete-backward ()' + Identical to `menu-complete', but moves backward through the list + of possible completions, as if `menu-complete' had been given a + negative argument. + +`delete-char-or-list ()' + Deletes the character under the cursor if not at the beginning or + end of the line (like `delete-char'). If at the end of the line, + behaves identically to `possible-completions'. This command is + unbound by default. + +`complete-filename (M-/)' + Attempt filename completion on the text before point. + +`possible-filename-completions (C-x /)' + List the possible completions of the text before point, treating + it as a filename. + +`complete-username (M-~)' + Attempt completion on the text before point, treating it as a + username. + +`possible-username-completions (C-x ~)' + List the possible completions of the text before point, treating + it as a username. + +`complete-variable (M-$)' + Attempt completion on the text before point, treating it as a + shell variable. + +`possible-variable-completions (C-x $)' + List the possible completions of the text before point, treating + it as a shell variable. + +`complete-hostname (M-@)' + Attempt completion on the text before point, treating it as a + hostname. + +`possible-hostname-completions (C-x @)' + List the possible completions of the text before point, treating + it as a hostname. + +`complete-command (M-!)' + Attempt completion on the text before point, treating it as a + command name. Command completion attempts to match the text + against aliases, reserved words, shell functions, shell builtins, + and finally executable filenames, in that order. + +`possible-command-completions (C-x !)' + List the possible completions of the text before point, treating + it as a command name. + +`dynamic-complete-history (M-)' + Attempt completion on the text before point, comparing the text + against lines from the history list for possible completion + matches. + +`dabbrev-expand ()' + Attempt menu completion on the text before point, comparing the + text against lines from the history list for possible completion + matches. + +`complete-into-braces (M-{)' + Perform filename completion and insert the list of possible + completions enclosed within braces so the list is available to the + shell (*note Brace Expansion::). + + + +File: bashref.info, Node: Keyboard Macros, Next: Miscellaneous Commands, Prev: Commands For Completion, Up: Bindable Readline Commands + +8.4.7 Keyboard Macros +--------------------- + +`start-kbd-macro (C-x ()' + Begin saving the characters typed into the current keyboard macro. + +`end-kbd-macro (C-x ))' + Stop saving the characters typed into the current keyboard macro + and save the definition. + +`call-last-kbd-macro (C-x e)' + Re-execute the last keyboard macro defined, by making the + characters in the macro appear as if typed at the keyboard. + +`print-last-kbd-macro ()' + Print the last keboard macro defined in a format suitable for the + INPUTRC file. + + + +File: bashref.info, Node: Miscellaneous Commands, Prev: Keyboard Macros, Up: Bindable Readline Commands + +8.4.8 Some Miscellaneous Commands +--------------------------------- + +`re-read-init-file (C-x C-r)' + Read in the contents of the INPUTRC file, and incorporate any + bindings or variable assignments found there. + +`abort (C-g)' + Abort the current editing command and ring the terminal's bell + (subject to the setting of `bell-style'). + +`do-uppercase-version (M-a, M-b, M-X, ...)' + If the metafied character X is lowercase, run the command that is + bound to the corresponding uppercase character. + +`prefix-meta ()' + Metafy the next character typed. This is for keyboards without a + meta key. Typing ` f' is equivalent to typing `M-f'. + +`undo (C-_ or C-x C-u)' + Incremental undo, separately remembered for each line. + +`revert-line (M-r)' + Undo all changes made to this line. This is like executing the + `undo' command enough times to get back to the beginning. + +`tilde-expand (M-&)' + Perform tilde expansion on the current word. + +`set-mark (C-@)' + Set the mark to the point. If a numeric argument is supplied, the + mark is set to that position. + +`exchange-point-and-mark (C-x C-x)' + Swap the point with the mark. The current cursor position is set + to the saved position, and the old cursor position is saved as the + mark. + +`character-search (C-])' + A character is read and point is moved to the next occurrence of + that character. A negative count searches for previous + occurrences. + +`character-search-backward (M-C-])' + A character is read and point is moved to the previous occurrence + of that character. A negative count searches for subsequent + occurrences. + +`skip-csi-sequence ()' + Read enough characters to consume a multi-key sequence such as + those defined for keys like Home and End. Such sequences begin + with a Control Sequence Indicator (CSI), usually ESC-[. If this + sequence is bound to "\e[", keys producing such sequences will + have no effect unless explicitly bound to a readline command, + instead of inserting stray characters into the editing buffer. + This is unbound by default, but usually bound to ESC-[. + +`insert-comment (M-#)' + Without a numeric argument, the value of the `comment-begin' + variable is inserted at the beginning of the current line. If a + numeric argument is supplied, this command acts as a toggle: if + the characters at the beginning of the line do not match the value + of `comment-begin', the value is inserted, otherwise the + characters in `comment-begin' are deleted from the beginning of + the line. In either case, the line is accepted as if a newline + had been typed. The default value of `comment-begin' causes this + command to make the current line a shell comment. If a numeric + argument causes the comment character to be removed, the line will + be executed by the shell. + +`dump-functions ()' + Print all of the functions and their key bindings to the Readline + output stream. If a numeric argument is supplied, the output is + formatted in such a way that it can be made part of an INPUTRC + file. This command is unbound by default. + +`dump-variables ()' + Print all of the settable variables and their values to the + Readline output stream. If a numeric argument is supplied, the + output is formatted in such a way that it can be made part of an + INPUTRC file. This command is unbound by default. + +`dump-macros ()' + Print all of the Readline key sequences bound to macros and the + strings they output. If a numeric argument is supplied, the + output is formatted in such a way that it can be made part of an + INPUTRC file. This command is unbound by default. + +`glob-complete-word (M-g)' + The word before point is treated as a pattern for pathname + expansion, with an asterisk implicitly appended. This pattern is + used to generate a list of matching file names for possible + completions. + +`glob-expand-word (C-x *)' + The word before point is treated as a pattern for pathname + expansion, and the list of matching file names is inserted, + replacing the word. If a numeric argument is supplied, a `*' is + appended before pathname expansion. + +`glob-list-expansions (C-x g)' + The list of expansions that would have been generated by + `glob-expand-word' is displayed, and the line is redrawn. If a + numeric argument is supplied, a `*' is appended before pathname + expansion. + +`display-shell-version (C-x C-v)' + Display version information about the current instance of Bash. + +`shell-expand-line (M-C-e)' + Expand the line as the shell does. This performs alias and + history expansion as well as all of the shell word expansions + (*note Shell Expansions::). + +`history-expand-line (M-^)' + Perform history expansion on the current line. + +`magic-space ()' + Perform history expansion on the current line and insert a space + (*note History Interaction::). + +`alias-expand-line ()' + Perform alias expansion on the current line (*note Aliases::). + +`history-and-alias-expand-line ()' + Perform history and alias expansion on the current line. + +`insert-last-argument (M-. or M-_)' + A synonym for `yank-last-arg'. + +`operate-and-get-next (C-o)' + Accept the current line for execution and fetch the next line + relative to the current line from the history for editing. Any + argument is ignored. + +`edit-and-execute-command (C-xC-e)' + Invoke an editor on the current command line, and execute the + result as shell commands. Bash attempts to invoke `$VISUAL', + `$EDITOR', and `emacs' as the editor, in that order. + + + +File: bashref.info, Node: Readline vi Mode, Next: Programmable Completion, Prev: Bindable Readline Commands, Up: Command Line Editing + +8.5 Readline vi Mode +==================== + +While the Readline library does not have a full set of `vi' editing +functions, it does contain enough to allow simple editing of the line. +The Readline `vi' mode behaves as specified in the POSIX standard. + + In order to switch interactively between `emacs' and `vi' editing +modes, use the `set -o emacs' and `set -o vi' commands (*note The Set +Builtin::). The Readline default is `emacs' mode. + + When you enter a line in `vi' mode, you are already placed in +`insertion' mode, as if you had typed an `i'. Pressing switches +you into `command' mode, where you can edit the text of the line with +the standard `vi' movement keys, move to previous history lines with +`k' and subsequent lines with `j', and so forth. + + +File: bashref.info, Node: Programmable Completion, Next: Programmable Completion Builtins, Prev: Readline vi Mode, Up: Command Line Editing + +8.6 Programmable Completion +=========================== + +When word completion is attempted for an argument to a command for +which a completion specification (a COMPSPEC) has been defined using +the `complete' builtin (*note Programmable Completion Builtins::), the +programmable completion facilities are invoked. + + First, the command name is identified. If a compspec has been +defined for that command, the compspec is used to generate the list of +possible completions for the word. If the command word is the empty +string (completion attempted at the beginning of an empty line), any +compspec defined with the `-E' option to `complete' is used. If the +command word is a full pathname, a compspec for the full pathname is +searched for first. If no compspec is found for the full pathname, an +attempt is made to find a compspec for the portion following the final +slash. If those searches do not result in a compspec, any compspec +defined with the `-D' option to `complete' is used as the default. + + Once a compspec has been found, it is used to generate the list of +matching words. If a compspec is not found, the default Bash completion +described above (*note Commands For Completion::) is performed. + + First, the actions specified by the compspec are used. Only matches +which are prefixed by the word being completed are returned. When the +`-f' or `-d' option is used for filename or directory name completion, +the shell variable `FIGNORE' is used to filter the matches. *Note Bash +Variables::, for a description of `FIGNORE'. + + Any completions specified by a filename expansion pattern to the +`-G' option are generated next. The words generated by the pattern +need not match the word being completed. The `GLOBIGNORE' shell +variable is not used to filter the matches, but the `FIGNORE' shell +variable is used. + + Next, the string specified as the argument to the `-W' option is +considered. The string is first split using the characters in the `IFS' +special variable as delimiters. Shell quoting is honored. Each word +is then expanded using brace expansion, tilde expansion, parameter and +variable expansion, command substitution, and arithmetic expansion, as +described above (*note Shell Expansions::). The results are split +using the rules described above (*note Word Splitting::). The results +of the expansion are prefix-matched against the word being completed, +and the matching words become the possible completions. + + After these matches have been generated, any shell function or +command specified with the `-F' and `-C' options is invoked. When the +command or function is invoked, the `COMP_LINE', `COMP_POINT', +`COMP_KEY', and `COMP_TYPE' variables are assigned values as described +above (*note Bash Variables::). If a shell function is being invoked, +the `COMP_WORDS' and `COMP_CWORD' variables are also set. When the +function or command is invoked, the first argument ($1) is the name of +the command whose arguments are being completed, the second argument +($2) is the word being completed, and the third argument ($3) is the +word preceding the word being completed on the current command line. +No filtering of the generated completions against the word being +completed is performed; the function or command has complete freedom in +generating the matches. + + Any function specified with `-F' is invoked first. The function may +use any of the shell facilities, including the `compgen' and `compopt' +builtins described below (*note Programmable Completion Builtins::), to +generate the matches. It must put the possible completions in the +`COMPREPLY' array variable, one per array element. + + Next, any command specified with the `-C' option is invoked in an +environment equivalent to command substitution. It should print a list +of completions, one per line, to the standard output. Backslash may be +used to escape a newline, if necessary. + + After all of the possible completions are generated, any filter +specified with the `-X' option is applied to the list. The filter is a +pattern as used for pathname expansion; a `&' in the pattern is +replaced with the text of the word being completed. A literal `&' may +be escaped with a backslash; the backslash is removed before attempting +a match. Any completion that matches the pattern will be removed from +the list. A leading `!' negates the pattern; in this case any +completion not matching the pattern will be removed. + + Finally, any prefix and suffix specified with the `-P' and `-S' +options are added to each member of the completion list, and the result +is returned to the Readline completion code as the list of possible +completions. + + If the previously-applied actions do not generate any matches, and +the `-o dirnames' option was supplied to `complete' when the compspec +was defined, directory name completion is attempted. + + If the `-o plusdirs' option was supplied to `complete' when the +compspec was defined, directory name completion is attempted and any +matches are added to the results of the other actions. + + By default, if a compspec is found, whatever it generates is +returned to the completion code as the full set of possible completions. +The default Bash completions are not attempted, and the Readline default +of filename completion is disabled. If the `-o bashdefault' option was +supplied to `complete' when the compspec was defined, the default Bash +completions are attempted if the compspec generates no matches. If the +`-o default' option was supplied to `complete' when the compspec was +defined, Readline's default completion will be performed if the +compspec (and, if attempted, the default Bash completions) generate no +matches. + + When a compspec indicates that directory name completion is desired, +the programmable completion functions force Readline to append a slash +to completed names which are symbolic links to directories, subject to +the value of the MARK-DIRECTORIES Readline variable, regardless of the +setting of the MARK-SYMLINKED-DIRECTORIES Readline variable. + + There is some support for dynamically modifying completions. This is +most useful when used in combination with a default completion specified +with `-D'. It's possible for shell functions executed as completion +handlers to indicate that completion should be retried by returning an +exit status of 124. If a shell function returns 124, and changes the +compspec associated with the command on which completion is being +attempted (supplied as the first argument when the function is +executed), programmable completion restarts from the beginning, with an +attempt to find a new compspec for that command. This allows a set of +completions to be built dynamically as completion is attempted, rather +than being loaded all at once. + + For instance, assuming that there is a library of compspecs, each +kept in a file corresponding to the name of the command, the following +default completion function would load completions dynamically: + + _completion_loader() + { + . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124 + } + complete -D -F _completion_loader -o bashdefault -o default + + +File: bashref.info, Node: Programmable Completion Builtins, Next: A Programmable Completion Example, Prev: Programmable Completion, Up: Command Line Editing + +8.7 Programmable Completion Builtins +==================================== + +Three builtin commands are available to manipulate the programmable +completion facilities: one to specify how the arguments to a particular +command are to be completed, and two to modify the completion as it is +happening. + +`compgen' + `compgen [OPTION] [WORD]' + + Generate possible completion matches for WORD according to the + OPTIONs, which may be any option accepted by the `complete' + builtin with the exception of `-p' and `-r', and write the matches + to the standard output. When using the `-F' or `-C' options, the + various shell variables set by the programmable completion + facilities, while available, will not have useful values. + + The matches will be generated in the same way as if the + programmable completion code had generated them directly from a + completion specification with the same flags. If WORD is + specified, only those completions matching WORD will be displayed. + + The return value is true unless an invalid option is supplied, or + no matches were generated. + +`complete' + `complete [-abcdefgjksuv] [-o COMP-OPTION] [-DE] [-A ACTION] [-G GLOBPAT] [-W WORDLIST] + [-F FUNCTION] [-C COMMAND] [-X FILTERPAT] + [-P PREFIX] [-S SUFFIX] NAME [NAME ...]' + `complete -pr [-DE] [NAME ...]' + + Specify how arguments to each NAME should be completed. If the + `-p' option is supplied, or if no options are supplied, existing + completion specifications are printed in a way that allows them to + be reused as input. The `-r' option removes a completion + specification for each NAME, or, if no NAMEs are supplied, all + completion specifications. The `-D' option indicates that the + remaining options and actions should apply to the "default" + command completion; that is, completion attempted on a command for + which no completion has previously been defined. The `-E' option + indicates that the remaining options and actions should apply to + "empty" command completion; that is, completion attempted on a + blank line. + + The process of applying these completion specifications when word + completion is attempted is described above (*note Programmable + Completion::). The `-D' option takes precedence over `-E'. + + Other options, if specified, have the following meanings. The + arguments to the `-G', `-W', and `-X' options (and, if necessary, + the `-P' and `-S' options) should be quoted to protect them from + expansion before the `complete' builtin is invoked. + + `-o COMP-OPTION' + The COMP-OPTION controls several aspects of the compspec's + behavior beyond the simple generation of completions. + COMP-OPTION may be one of: + + `bashdefault' + Perform the rest of the default Bash completions if the + compspec generates no matches. + + `default' + Use Readline's default filename completion if the + compspec generates no matches. + + `dirnames' + Perform directory name completion if the compspec + generates no matches. + + `filenames' + Tell Readline that the compspec generates filenames, so + it can perform any filename-specific processing (like + adding a slash to directory names quoting special + characters, or suppressing trailing spaces). This + option is intended to be used with shell functions + specified with `-F'. + + `noquote' + Tell Readline not to quote the completed words if they + are filenames (quoting filenames is the default). + + `nospace' + Tell Readline not to append a space (the default) to + words completed at the end of the line. + + `plusdirs' + After any matches defined by the compspec are generated, + directory name completion is attempted and any matches + are added to the results of the other actions. + + + `-A ACTION' + The ACTION may be one of the following to generate a list of + possible completions: + + `alias' + Alias names. May also be specified as `-a'. + + `arrayvar' + Array variable names. + + `binding' + Readline key binding names (*note Bindable Readline + Commands::). + + `builtin' + Names of shell builtin commands. May also be specified + as `-b'. + + `command' + Command names. May also be specified as `-c'. + + `directory' + Directory names. May also be specified as `-d'. + + `disabled' + Names of disabled shell builtins. + + `enabled' + Names of enabled shell builtins. + + `export' + Names of exported shell variables. May also be + specified as `-e'. + + `file' + File names. May also be specified as `-f'. + + `function' + Names of shell functions. + + `group' + Group names. May also be specified as `-g'. + + `helptopic' + Help topics as accepted by the `help' builtin (*note + Bash Builtins::). + + `hostname' + Hostnames, as taken from the file specified by the + `HOSTFILE' shell variable (*note Bash Variables::). + + `job' + Job names, if job control is active. May also be + specified as `-j'. + + `keyword' + Shell reserved words. May also be specified as `-k'. + + `running' + Names of running jobs, if job control is active. + + `service' + Service names. May also be specified as `-s'. + + `setopt' + Valid arguments for the `-o' option to the `set' builtin + (*note The Set Builtin::). + + `shopt' + Shell option names as accepted by the `shopt' builtin + (*note Bash Builtins::). + + `signal' + Signal names. + + `stopped' + Names of stopped jobs, if job control is active. + + `user' + User names. May also be specified as `-u'. + + `variable' + Names of all shell variables. May also be specified as + `-v'. + + `-C COMMAND' + COMMAND is executed in a subshell environment, and its output + is used as the possible completions. + + `-F FUNCTION' + The shell function FUNCTION is executed in the current shell + environment. When it is executed, $1 is the name of the + command whose arguments are being completed, $2 is the word + being completed, and $3 is the word preceding the word being + completed, as described above (*note Programmable + Completion::). When it finishes, the possible completions + are retrieved from the value of the `COMPREPLY' array + variable. + + `-G GLOBPAT' + The filename expansion pattern GLOBPAT is expanded to generate + the possible completions. + + `-P PREFIX' + PREFIX is added at the beginning of each possible completion + after all other options have been applied. + + `-S SUFFIX' + SUFFIX is appended to each possible completion after all + other options have been applied. + + `-W WORDLIST' + The WORDLIST is split using the characters in the `IFS' + special variable as delimiters, and each resultant word is + expanded. The possible completions are the members of the + resultant list which match the word being completed. + + `-X FILTERPAT' + FILTERPAT is a pattern as used for filename expansion. It is + applied to the list of possible completions generated by the + preceding options and arguments, and each completion matching + FILTERPAT is removed from the list. A leading `!' in + FILTERPAT negates the pattern; in this case, any completion + not matching FILTERPAT is removed. + + The return value is true unless an invalid option is supplied, an + option other than `-p' or `-r' is supplied without a NAME + argument, an attempt is made to remove a completion specification + for a NAME for which no specification exists, or an error occurs + adding a completion specification. + +`compopt' + `compopt' [-o OPTION] [-DE] [+o OPTION] [NAME] + Modify completion options for each NAME according to the OPTIONs, + or for the currently-executing completion if no NAMEs are supplied. + If no OPTIONs are given, display the completion options for each + NAME or the current completion. The possible values of OPTION are + those valid for the `complete' builtin described above. The `-D' + option indicates that the remaining options should apply to the + "default" command completion; that is, completion attempted on a + command for which no completion has previously been defined. The + `-E' option indicates that the remaining options should apply to + "empty" command completion; that is, completion attempted on a + blank line. + + The `-D' option takes precedence over `-E'. + + The return value is true unless an invalid option is supplied, an + attempt is made to modify the options for a NAME for which no + completion specification exists, or an output error occurs. + + + +File: bashref.info, Node: A Programmable Completion Example, Prev: Programmable Completion Builtins, Up: Command Line Editing + +8.8 A Programmable Completion Example +===================================== + +The most common way to obtain additional completion functionality beyond +the default actions `complete' and `compgen' provide is to use a shell +function and bind it to a particular command using `complete -F'. + + The following function provides completions for the `cd' builtin. +It is a reasonably good example of what shell functions must do when +used for completion. This function uses the word passsed as `$2' to +determine the directory name to complete. You can also use the +`COMP_WORDS' array variable; the current word is indexed by the +`COMP_CWORD' variable. + + The function relies on the `complete' and `compgen' builtins to do +much of the work, adding only the things that the Bash `cd' does beyond +accepting basic directory names: tilde expansion (*note Tilde +Expansion::), searching directories in $CDPATH, which is described above +(*note Bourne Shell Builtins::), and basic support for the +`cdable_vars' shell option (*note The Shopt Builtin::). `_comp_cd' +modifies the value of IFS so that it contains only a newline to +accommodate file names containing spaces and tabs - `compgen' prints +the possible completions it generates one per line. + + Possible completions go into the COMPREPLY array variable, one +completion per array element. The programmable completion system +retrieves the completions from there when the function returns. + + # A completion function for the cd builtin + # based on the cd completion function from the bash_completion package + _comp_cd() + { + local IFS=$' \t\n' # normalize IFS + local cur _skipdot _cdpath + local i j k + + # Tilde expansion, with side effect of expanding tilde to full pathname + case "$2" in + \~*) eval cur="$2" ;; + *) cur=$2 ;; + esac + + # no cdpath or absolute pathname -- straight directory completion + if [[ -z "${CDPATH:-}" ]] || [[ "$cur" == @(./*|../*|/*) ]]; then + # compgen prints paths one per line; could also use while loop + IFS=$'\n' + COMPREPLY=( $(compgen -d -- "$cur") ) + IFS=$' \t\n' + # CDPATH+directories in the current directory if not in CDPATH + else + IFS=$'\n' + _skipdot=false + # preprocess CDPATH to convert null directory names to . + _cdpath=${CDPATH/#:/.:} + _cdpath=${_cdpath//::/:.:} + _cdpath=${_cdpath/%:/:.} + for i in ${_cdpath//:/$'\n'}; do + if [[ $i -ef . ]]; then _skipdot=true; fi + k="${#COMPREPLY[@]}" + for j in $( compgen -d -- "$i/$cur" ); do + COMPREPLY[k++]=${j#$i/} # cut off directory + done + done + $_skipdot || COMPREPLY+=( $(compgen -d -- "$cur") ) + IFS=$' \t\n' + fi + + # variable names if appropriate shell option set and no completions + if shopt -q cdable_vars && [[ ${#COMPREPLY[@]} -eq 0 ]]; then + COMPREPLY=( $(compgen -v -- "$cur") ) + fi + + return 0 + } + + We install the completion function using the `-F' option to +`complete': + + # Tell readline to quote appropriate and append slashes to directories; + # use the bash default completion for other arguments + complete -o filenames -o nospace -o bashdefault -F _comp_cd cd + +Since we'd like Bash and Readline to take care of some of the other +details for us, we use several other options to tell Bash and Readline +what to do. The `-o filenames' option tells Readline that the possible +completions should be treated as filenames, and quoted appropriately. +That option will also cause Readline to append a slash to filenames it +can determine are directories (which is why we might want to extend +`_comp_cd' to append a slash if we're using directories found via +CDPATH: Readline can't tell those completions are directories). The +`-o nospace' option tells Readline to not append a space character to +the directory name, in case we want to append to it. The `-o +bashdefault' option brings in the rest of the "Bash default" +completions - possible completion that Bash adds to the default Readline +set. These include things like command name completion, variable +completion for words beginning with `{', completions containing pathname +expansion patterns (*note Filename Expansion::), and so on. + + Once installed using `complete', `_comp_cd' will be called every +time we attempt word completion for a `cd' command. + + Many more examples - an extensive collection of completions for most +of the common GNU, Unix, and Linux commands - are available as part of +the bash_completion project. This is installed by default on many +GNU/Linux distributions. Originally written by Ian Macdonald, the +project now lives at `http://bash-completion.alioth.debian.org/'. +There are ports for other systems such as Solaris and Mac OS X. + + An older version of the bash_completion package is distributed with +bash in the `examples/complete' subdirectory. + + +File: bashref.info, Node: Using History Interactively, Next: Installing Bash, Prev: Command Line Editing, Up: Top + +9 Using History Interactively +***************************** + +This chapter describes how to use the GNU History Library +interactively, from a user's standpoint. It should be considered a +user's guide. For information on using the GNU History Library in +other programs, see the GNU Readline Library Manual. + +* Menu: + +* Bash History Facilities:: How Bash lets you manipulate your command + history. +* Bash History Builtins:: The Bash builtin commands that manipulate + the command history. +* History Interaction:: What it feels like using History as a user. + + +File: bashref.info, Node: Bash History Facilities, Next: Bash History Builtins, Up: Using History Interactively + +9.1 Bash History Facilities +=========================== + +When the `-o history' option to the `set' builtin is enabled (*note The +Set Builtin::), the shell provides access to the "command history", the +list of commands previously typed. The value of the `HISTSIZE' shell +variable is used as the number of commands to save in a history list. +The text of the last `$HISTSIZE' commands (default 500) is saved. The +shell stores each command in the history list prior to parameter and +variable expansion but after history expansion is performed, subject to +the values of the shell variables `HISTIGNORE' and `HISTCONTROL'. + + When the shell starts up, the history is initialized from the file +named by the `HISTFILE' variable (default `~/.bash_history'). The file +named by the value of `HISTFILE' is truncated, if necessary, to contain +no more than the number of lines specified by the value of the +`HISTFILESIZE' variable. When a shell with history enabled exits, the +last `$HISTSIZE' lines are copied from the history list to the file +named by `$HISTFILE'. If the `histappend' shell option is set (*note +Bash Builtins::), the lines are appended to the history file, otherwise +the history file is overwritten. If `HISTFILE' is unset, or if the +history file is unwritable, the history is not saved. After saving the +history, the history file is truncated to contain no more than +`$HISTFILESIZE' lines. If `HISTFILESIZE' is unset, or set to null, a +non-numeric value, or a numeric value less than zero, the history file +is not truncated. + + If the `HISTTIMEFORMAT' is set, the time stamp information +associated with each history entry is written to the history file, +marked with the history comment character. When the history file is +read, lines beginning with the history comment character followed +immediately by a digit are interpreted as timestamps for the previous +history line. + + The builtin command `fc' may be used to list or edit and re-execute +a portion of the history list. The `history' builtin may be used to +display or modify the history list and manipulate the history file. +When using command-line editing, search commands are available in each +editing mode that provide access to the history list (*note Commands +For History::). + + The shell allows control over which commands are saved on the history +list. The `HISTCONTROL' and `HISTIGNORE' variables may be set to cause +the shell to save only a subset of the commands entered. The `cmdhist' +shell option, if enabled, causes the shell to attempt to save each line +of a multi-line command in the same history entry, adding semicolons +where necessary to preserve syntactic correctness. The `lithist' shell +option causes the shell to save the command with embedded newlines +instead of semicolons. The `shopt' builtin is used to set these +options. *Note Bash Builtins::, for a description of `shopt'. + + +File: bashref.info, Node: Bash History Builtins, Next: History Interaction, Prev: Bash History Facilities, Up: Using History Interactively + +9.2 Bash History Builtins +========================= + +Bash provides two builtin commands which manipulate the history list +and history file. + +`fc' + `fc [-e ENAME] [-lnr] [FIRST] [LAST]' + `fc -s [PAT=REP] [COMMAND]' + + The first form selects a range of commands from FIRST to LAST from + the history list and displays or edits and re-executes them. Both + FIRST and LAST may be specified as a string (to locate the most + recent command beginning with that string) or as a number (an + index into the history list, where a negative number is used as an + offset from the current command number). If LAST is not specified + it is set to FIRST. If FIRST is not specified it is set to the + previous command for editing and -16 for listing. If the `-l' + flag is given, the commands are listed on standard output. The + `-n' flag suppresses the command numbers when listing. The `-r' + flag reverses the order of the listing. Otherwise, the editor + given by ENAME is invoked on a file containing those commands. If + ENAME is not given, the value of the following variable expansion + is used: `${FCEDIT:-${EDITOR:-vi}}'. This says to use the value + of the `FCEDIT' variable if set, or the value of the `EDITOR' + variable if that is set, or `vi' if neither is set. When editing + is complete, the edited commands are echoed and executed. + + In the second form, COMMAND is re-executed after each instance of + PAT in the selected command is replaced by REP. COMMAND is + intepreted the same as FIRST above. + + A useful alias to use with the `fc' command is `r='fc -s'', so + that typing `r cc' runs the last command beginning with `cc' and + typing `r' re-executes the last command (*note Aliases::). + +`history' + history [N] + history -c + history -d OFFSET + history [-anrw] [FILENAME] + history -ps ARG + + With no options, display the history list with line numbers. + Lines prefixed with a `*' have been modified. An argument of N + lists only the last N lines. If the shell variable + `HISTTIMEFORMAT' is set and not null, it is used as a format + string for STRFTIME to display the time stamp associated with each + displayed history entry. No intervening blank is printed between + the formatted time stamp and the history line. + + Options, if supplied, have the following meanings: + + `-c' + Clear the history list. This may be combined with the other + options to replace the history list completely. + + `-d OFFSET' + Delete the history entry at position OFFSET. OFFSET should + be specified as it appears when the history is displayed. + + `-a' + Append the new history lines (history lines entered since the + beginning of the current Bash session) to the history file. + + `-n' + Append the history lines not already read from the history + file to the current history list. These are lines appended + to the history file since the beginning of the current Bash + session. + + `-r' + Read the history file and append its contents to the history + list. + + `-w' + Write out the current history list to the history file. + + `-p' + Perform history substitution on the ARGs and display the + result on the standard output, without storing the results in + the history list. + + `-s' + The ARGs are added to the end of the history list as a single + entry. + + + When any of the `-w', `-r', `-a', or `-n' options is used, if + FILENAME is given, then it is used as the history file. If not, + then the value of the `HISTFILE' variable is used. + + + +File: bashref.info, Node: History Interaction, Prev: Bash History Builtins, Up: Using History Interactively + +9.3 History Expansion +===================== + +The History library provides a history expansion feature that is similar +to the history expansion provided by `csh'. This section describes the +syntax used to manipulate the history information. + + History expansions introduce words from the history list into the +input stream, making it easy to repeat commands, insert the arguments +to a previous command into the current input line, or fix errors in +previous commands quickly. + + History expansion takes place in two parts. The first is to +determine which line from the history list should be used during +substitution. The second is to select portions of that line for +inclusion into the current one. The line selected from the history is +called the "event", and the portions of that line that are acted upon +are called "words". Various "modifiers" are available to manipulate +the selected words. The line is broken into words in the same fashion +that Bash does, so that several words surrounded by quotes are +considered one word. History expansions are introduced by the +appearance of the history expansion character, which is `!' by default. +Only `\' and `'' may be used to escape the history expansion character. + + Several shell options settable with the `shopt' builtin (*note Bash +Builtins::) may be used to tailor the behavior of history expansion. +If the `histverify' shell option is enabled, and Readline is being +used, history substitutions are not immediately passed to the shell +parser. Instead, the expanded line is reloaded into the Readline +editing buffer for further modification. If Readline is being used, +and the `histreedit' shell option is enabled, a failed history +expansion will be reloaded into the Readline editing buffer for +correction. The `-p' option to the `history' builtin command may be +used to see what a history expansion will do before using it. The `-s' +option to the `history' builtin may be used to add commands to the end +of the history list without actually executing them, so that they are +available for subsequent recall. This is most useful in conjunction +with Readline. + + The shell allows control of the various characters used by the +history expansion mechanism with the `histchars' variable, as explained +above (*note Bash Variables::). The shell uses the history comment +character to mark history timestamps when writing the history file. + +* Menu: + +* Event Designators:: How to specify which history line to use. +* Word Designators:: Specifying which words are of interest. +* Modifiers:: Modifying the results of substitution. + + +File: bashref.info, Node: Event Designators, Next: Word Designators, Up: History Interaction + +9.3.1 Event Designators +----------------------- + +An event designator is a reference to a command line entry in the +history list. Unless the reference is absolute, events are relative to +the current position in the history list. + +`!' + Start a history substitution, except when followed by a space, tab, + the end of the line, `=' or `(' (when the `extglob' shell option + is enabled using the `shopt' builtin). + +`!N' + Refer to command line N. + +`!-N' + Refer to the command N lines back. + +`!!' + Refer to the previous command. This is a synonym for `!-1'. + +`!STRING' + Refer to the most recent command preceding the current position in + the history list starting with STRING. + +`!?STRING[?]' + Refer to the most recent command preceding the current position in + the history list containing STRING. The trailing `?' may be + omitted if the STRING is followed immediately by a newline. + +`^STRING1^STRING2^' + Quick Substitution. Repeat the last command, replacing STRING1 + with STRING2. Equivalent to `!!:s/STRING1/STRING2/'. + +`!#' + The entire command line typed so far. + + + +File: bashref.info, Node: Word Designators, Next: Modifiers, Prev: Event Designators, Up: History Interaction + +9.3.2 Word Designators +---------------------- + +Word designators are used to select desired words from the event. A +`:' separates the event specification from the word designator. It may +be omitted if the word designator begins with a `^', `$', `*', `-', or +`%'. Words are numbered from the beginning of the line, with the first +word being denoted by 0 (zero). Words are inserted into the current +line separated by single spaces. + + For example, + +`!!' + designates the preceding command. When you type this, the + preceding command is repeated in toto. + +`!!:$' + designates the last argument of the preceding command. This may be + shortened to `!$'. + +`!fi:2' + designates the second argument of the most recent command starting + with the letters `fi'. + + Here are the word designators: + +`0 (zero)' + The `0'th word. For many applications, this is the command word. + +`N' + The Nth word. + +`^' + The first argument; that is, word 1. + +`$' + The last argument. + +`%' + The word matched by the most recent `?STRING?' search. + +`X-Y' + A range of words; `-Y' abbreviates `0-Y'. + +`*' + All of the words, except the `0'th. This is a synonym for `1-$'. + It is not an error to use `*' if there is just one word in the + event; the empty string is returned in that case. + +`X*' + Abbreviates `X-$' + +`X-' + Abbreviates `X-$' like `X*', but omits the last word. + + + If a word designator is supplied without an event specification, the +previous command is used as the event. + + +File: bashref.info, Node: Modifiers, Prev: Word Designators, Up: History Interaction + +9.3.3 Modifiers +--------------- + +After the optional word designator, you can add a sequence of one or +more of the following modifiers, each preceded by a `:'. + +`h' + Remove a trailing pathname component, leaving only the head. + +`t' + Remove all leading pathname components, leaving the tail. + +`r' + Remove a trailing suffix of the form `.SUFFIX', leaving the + basename. + +`e' + Remove all but the trailing suffix. + +`p' + Print the new command but do not execute it. + +`q' + Quote the substituted words, escaping further substitutions. + +`x' + Quote the substituted words as with `q', but break into words at + spaces, tabs, and newlines. + +`s/OLD/NEW/' + Substitute NEW for the first occurrence of OLD in the event line. + Any delimiter may be used in place of `/'. The delimiter may be + quoted in OLD and NEW with a single backslash. If `&' appears in + NEW, it is replaced by OLD. A single backslash will quote the + `&'. The final delimiter is optional if it is the last character + on the input line. + +`&' + Repeat the previous substitution. + +`g' +`a' + Cause changes to be applied over the entire event line. Used in + conjunction with `s', as in `gs/OLD/NEW/', or with `&'. + +`G' + Apply the following `s' modifier once to each word in the event. + + + +File: bashref.info, Node: Installing Bash, Next: Reporting Bugs, Prev: Using History Interactively, Up: Top + +10 Installing Bash +****************** + +This chapter provides basic instructions for installing Bash on the +various supported platforms. The distribution supports the GNU +operating systems, nearly every version of Unix, and several non-Unix +systems such as BeOS and Interix. Other independent ports exist for +MS-DOS, OS/2, and Windows platforms. + +* Menu: + +* Basic Installation:: Installation instructions. +* Compilers and Options:: How to set special options for various + systems. +* Compiling For Multiple Architectures:: How to compile Bash for more + than one kind of system from + the same source tree. +* Installation Names:: How to set the various paths used by the installation. +* Specifying the System Type:: How to configure Bash for a particular system. +* Sharing Defaults:: How to share default configuration values among GNU + programs. +* Operation Controls:: Options recognized by the configuration program. +* Optional Features:: How to enable and disable optional features when + building Bash. + + +File: bashref.info, Node: Basic Installation, Next: Compilers and Options, Up: Installing Bash + +10.1 Basic Installation +======================= + +These are installation instructions for Bash. + + The simplest way to compile Bash is: + + 1. `cd' to the directory containing the source code and type + `./configure' to configure Bash for your system. If you're using + `csh' on an old version of System V, you might need to type `sh + ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes some time. While running, it prints + messages telling which features it is checking for. + + 2. Type `make' to compile Bash and build the `bashbug' bug reporting + script. + + 3. Optionally, type `make tests' to run the Bash test suite. + + 4. Type `make install' to install `bash' and `bashbug'. This will + also install the manual pages and Info file. + + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package +(the top directory, the `builtins', `doc', and `support' directories, +each directory under `lib', and several others). It also creates a +`config.h' file containing system-dependent definitions. Finally, it +creates a shell script named `config.status' that you can run in the +future to recreate the current configuration, a file `config.cache' +that saves the results of its tests to speed up reconfiguring, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). If at some point `config.cache' contains +results you don't want to keep, you may remove or edit it. + + To find out more about the options and arguments that the +`configure' script understands, type + + bash-2.04$ ./configure --help + +at the Bash prompt in your Bash source directory. + + If you need to do unusual things to compile Bash, please try to +figure out how `configure' could check whether or not to do them, and +mail diffs or instructions to so they can be +considered for the next release. + + The file `configure.ac' is used to create `configure' by a program +called Autoconf. You only need `configure.ac' if you want to change it +or regenerate `configure' using a newer version of Autoconf. If you do +this, make sure you are using Autoconf version 2.50 or newer. + + You can remove the program binaries and object files from the source +code directory by typing `make clean'. To also remove the files that +`configure' created (so you can compile Bash for a different kind of +computer), type `make distclean'. + + +File: bashref.info, Node: Compilers and Options, Next: Compiling For Multiple Architectures, Prev: Basic Installation, Up: Installing Bash + +10.2 Compilers and Options +========================== + +Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + + On systems that have the `env' program, you can do it like this: + + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + + The configuration process uses GCC to build Bash if it is available. + + +File: bashref.info, Node: Compiling For Multiple Architectures, Next: Installation Names, Prev: Compilers and Options, Up: Installing Bash + +10.3 Compiling For Multiple Architectures +========================================= + +You can compile Bash for more than one kind of computer at the same +time, by placing the object files for each architecture in their own +directory. To do this, you must use a version of `make' that supports +the `VPATH' variable, such as GNU `make'. `cd' to the directory where +you want the object files and executables to go and run the `configure' +script from the source directory. You may need to supply the +`--srcdir=PATH' argument to tell `configure' where the source files +are. `configure' automatically checks for the source code in the +directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you can compile Bash for one architecture at a time in the +source code directory. After you have installed Bash for one +architecture, use `make distclean' before reconfiguring for another +architecture. + + Alternatively, if your system supports symbolic links, you can use +the `support/mkclone' script to create a build tree which has symbolic +links back to each file in the source directory. Here's an example +that creates a build directory in the current directory from a source +directory `/usr/gnu/src/bash-2.0': + + bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 . + +The `mkclone' script requires Bash, so you must have already built Bash +for at least one architecture before you can create build directories +for other architectures. + + +File: bashref.info, Node: Installation Names, Next: Specifying the System Type, Prev: Compiling For Multiple Architectures, Up: Installing Bash + +10.4 Installation Names +======================= + +By default, `make install' will install into `/usr/local/bin', +`/usr/local/man', etc. You can specify an installation prefix other +than `/usr/local' by giving `configure' the option `--prefix=PATH', or +by specifying a value for the `DESTDIR' `make' variable when running +`make install'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', `make install' will +use PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + +File: bashref.info, Node: Specifying the System Type, Next: Sharing Defaults, Prev: Installation Names, Up: Installing Bash + +10.5 Specifying the System Type +=============================== + +There may be some features `configure' can not figure out +automatically, but need to determine by the type of host Bash will run +on. Usually `configure' can figure that out, but if it prints a +message saying it can not guess the host type, give it the +`--host=TYPE' option. `TYPE' can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: +`CPU-COMPANY-SYSTEM' (e.g., `i386-unknown-freebsd4.2'). + + See the file `support/config.sub' for the possible values of each +field. + + +File: bashref.info, Node: Sharing Defaults, Next: Operation Controls, Prev: Specifying the System Type, Up: Installing Bash + +10.6 Sharing Defaults +===================== + +If you want to set default values for `configure' scripts to share, you +can create a site shell script called `config.site' that gives default +values for variables like `CC', `cache_file', and `prefix'. `configure' +looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: the Bash `configure' looks for a site script, but not all +`configure' scripts do. + + +File: bashref.info, Node: Operation Controls, Next: Optional Features, Prev: Sharing Defaults, Up: Installing Bash + +10.7 Operation Controls +======================= + +`configure' recognizes the following options to control how it operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. + +`--srcdir=DIR' + Look for the Bash source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + + `configure' also accepts some other, not widely used, boilerplate +options. `configure --help' prints the complete list. + + +File: bashref.info, Node: Optional Features, Prev: Operation Controls, Up: Installing Bash + +10.8 Optional Features +====================== + +The Bash `configure' has a number of `--enable-FEATURE' options, where +FEATURE indicates an optional part of Bash. There are also several +`--with-PACKAGE' options, where PACKAGE is something like `bash-malloc' +or `purify'. To turn off the default use of a package, use +`--without-PACKAGE'. To configure Bash without a feature that is +enabled by default, use `--disable-FEATURE'. + + Here is a complete list of the `--enable-' and `--with-' options +that the Bash `configure' recognizes. + +`--with-afs' + Define if you are using the Andrew File System from Transarc. + +`--with-bash-malloc' + Use the Bash version of `malloc' in the directory `lib/malloc'. + This is not the same `malloc' that appears in GNU libc, but an + older version originally derived from the 4.2 BSD `malloc'. This + `malloc' is very fast, but wastes some space on each allocation. + This option is enabled by default. The `NOTES' file contains a + list of systems for which this should be turned off, and + `configure' disables this option automatically for a number of + systems. + +`--with-curses' + Use the curses library instead of the termcap library. This should + be supplied if your system has an inadequate or incomplete termcap + database. + +`--with-gnu-malloc' + A synonym for `--with-bash-malloc'. + +`--with-installed-readline[=PREFIX]' + Define this to make Bash link with a locally-installed version of + Readline rather than the version in `lib/readline'. This works + only with Readline 5.0 and later versions. If PREFIX is `yes' or + not supplied, `configure' uses the values of the make variables + `includedir' and `libdir', which are subdirectories of `prefix' by + default, to find the installed version of Readline if it is not in + the standard system include and library directories. If PREFIX is + `no', Bash links with the version in `lib/readline'. If PREFIX is + set to any other value, `configure' treats it as a directory + pathname and looks for the installed version of Readline in + subdirectories of that directory (include files in + PREFIX/`include' and the library in PREFIX/`lib'). + +`--with-purify' + Define this to use the Purify memory allocation checker from + Rational Software. + +`--enable-minimal-config' + This produces a shell with minimal features, close to the + historical Bourne shell. + + There are several `--enable-' options that alter how Bash is +compiled and linked, rather than changing run-time features. + +`--enable-largefile' + Enable support for large files + (http://www.sas.com/standards/large_file/x_open.20Mar96.html) if + the operating system requires special compiler options to build + programs which can access large files. This is enabled by + default, if the operating system provides large file support. + +`--enable-profiling' + This builds a Bash binary that produces profiling information to be + processed by `gprof' each time it is executed. + +`--enable-static-link' + This causes Bash to be linked statically, if `gcc' is being used. + This could be used to build a version to use as root's shell. + + The `minimal-config' option can be used to disable all of the +following options, but it is processed first, so individual options may +be enabled using `enable-FEATURE'. + + All of the following options except for `disabled-builtins', +`directpand-default', and `xpg-echo-default' are enabled by default, +unless the operating system does not provide the necessary support. + +`--enable-alias' + Allow alias expansion and include the `alias' and `unalias' + builtins (*note Aliases::). + +`--enable-arith-for-command' + Include support for the alternate form of the `for' command that + behaves like the C language `for' statement (*note Looping + Constructs::). + +`--enable-array-variables' + Include support for one-dimensional array shell variables (*note + Arrays::). + +`--enable-bang-history' + Include support for `csh'-like history substitution (*note History + Interaction::). + +`--enable-brace-expansion' + Include `csh'-like brace expansion ( `b{a,b}c' ==> `bac bbc' ). + See *note Brace Expansion::, for a complete description. + +`--enable-casemod-attributes' + Include support for case-modifying attributes in the `declare' + builtin and assignment statements. Variables with the UPPERCASE + attribute, for example, will have their values converted to + uppercase upon assignment. + +`--enable-casemod-expansion' + Include support for case-modifying word expansions. + +`--enable-command-timing' + Include support for recognizing `time' as a reserved word and for + displaying timing statistics for the pipeline following `time' + (*note Pipelines::). This allows pipelines as well as shell + builtins and functions to be timed. + +`--enable-cond-command' + Include support for the `[[' conditional command. (*note + Conditional Constructs::). + +`--enable-cond-regexp' + Include support for matching POSIX regular expressions using the + `=~' binary operator in the `[[' conditional command. (*note + Conditional Constructs::). + +`--enable-coprocesses' + Include support for coprocesses and the `coproc' reserved word + (*note Pipelines::). + +`--enable-debugger' + Include support for the bash debugger (distributed separately). + +`--enable-direxpand-default' + Cause the `direxpand' shell option (*note The Shopt Builtin::) to + be enabled by default when the shell starts. It is normally + disabled by default. + +`--enable-directory-stack' + Include support for a `csh'-like directory stack and the `pushd', + `popd', and `dirs' builtins (*note The Directory Stack::). + +`--enable-disabled-builtins' + Allow builtin commands to be invoked via `builtin xxx' even after + `xxx' has been disabled using `enable -n xxx'. See *note Bash + Builtins::, for details of the `builtin' and `enable' builtin + commands. + +`--enable-dparen-arithmetic' + Include support for the `((...))' command (*note Conditional + Constructs::). + +`--enable-extended-glob' + Include support for the extended pattern matching features + described above under *note Pattern Matching::. + +`--enable-extended-glob-default' + Set the default value of the EXTGLOB shell option described above + under *note The Shopt Builtin:: to be enabled. + +`--enable-glob-asciirange-default' + Set the default value of the GLOBASCIIRANGES shell option described + above under *note The Shopt Builtin:: to be enabled. This + controls the behavior of character ranges when used in pattern + matching bracket expressions. + +`--enable-help-builtin' + Include the `help' builtin, which displays help on shell builtins + and variables (*note Bash Builtins::). + +`--enable-history' + Include command history and the `fc' and `history' builtin + commands (*note Bash History Facilities::). + +`--enable-job-control' + This enables the job control features (*note Job Control::), if + the operating system supports them. + +`--enable-multibyte' + This enables support for multibyte characters if the operating + system provides the necessary support. + +`--enable-net-redirections' + This enables the special handling of filenames of the form + `/dev/tcp/HOST/PORT' and `/dev/udp/HOST/PORT' when used in + redirections (*note Redirections::). + +`--enable-process-substitution' + This enables process substitution (*note Process Substitution::) if + the operating system provides the necessary support. + +`--enable-progcomp' + Enable the programmable completion facilities (*note Programmable + Completion::). If Readline is not enabled, this option has no + effect. + +`--enable-prompt-string-decoding' + Turn on the interpretation of a number of backslash-escaped + characters in the `$PS1', `$PS2', `$PS3', and `$PS4' prompt + strings. See *note Controlling the Prompt::, for a complete list + of prompt string escape sequences. + +`--enable-readline' + Include support for command-line editing and history with the Bash + version of the Readline library (*note Command Line Editing::). + +`--enable-restricted' + Include support for a "restricted shell". If this is enabled, + Bash, when called as `rbash', enters a restricted mode. See *note + The Restricted Shell::, for a description of restricted mode. + +`--enable-select' + Include the `select' compound command, which allows the generation + of simple menus (*note Conditional Constructs::). + +`--enable-separate-helpfiles' + Use external files for the documentation displayed by the `help' + builtin instead of storing the text internally. + +`--enable-single-help-strings' + Store the text displayed by the `help' builtin as a single string + for each help topic. This aids in translating the text to + different languages. You may need to disable this if your + compiler cannot handle very long string literals. + +`--enable-strict-posix-default' + Make Bash POSIX-conformant by default (*note Bash POSIX Mode::). + +`--enable-usg-echo-default' + A synonym for `--enable-xpg-echo-default'. + +`--enable-xpg-echo-default' + Make the `echo' builtin expand backslash-escaped characters by + default, without requiring the `-e' option. This sets the default + value of the `xpg_echo' shell option to `on', which makes the Bash + `echo' behave more like the version specified in the Single Unix + Specification, version 3. *Note Bash Builtins::, for a + description of the escape sequences that `echo' recognizes. + + The file `config-top.h' contains C Preprocessor `#define' statements +for options which are not settable from `configure'. Some of these are +not meant to be changed; beware of the consequences if you do. Read +the comments associated with each definition for more information about +its effect. + + +File: bashref.info, Node: Reporting Bugs, Next: Major Differences From The Bourne Shell, Prev: Installing Bash, Up: Top + +Appendix A Reporting Bugs +************************* + +Please report all bugs you find in Bash. But first, you should make +sure that it really is a bug, and that it appears in the latest version +of Bash. The latest version of Bash is always available for FTP from +`ftp://ftp.gnu.org/pub/gnu/bash/'. + + Once you have determined that a bug actually exists, use the +`bashbug' command to submit a bug report. If you have a fix, you are +encouraged to mail that as well! Suggestions and `philosophical' bug +reports may be mailed to or posted to the Usenet +newsgroup `gnu.bash.bug'. + + All bug reports should include: + * The version number of Bash. + + * The hardware and operating system. + + * The compiler used to compile Bash. + + * A description of the bug behaviour. + + * A short script or `recipe' which exercises the bug and may be used + to reproduce it. + +`bashbug' inserts the first three items automatically into the template +it provides for filing a bug report. + + Please send all reports concerning this manual to . + + +File: bashref.info, Node: Major Differences From The Bourne Shell, Next: GNU Free Documentation License, Prev: Reporting Bugs, Up: Top + +Appendix B Major Differences From The Bourne Shell +************************************************** + +Bash implements essentially the same grammar, parameter and variable +expansion, redirection, and quoting as the Bourne Shell. Bash uses the +POSIX standard as the specification of how these features are to be +implemented. There are some differences between the traditional Bourne +shell and Bash; this section quickly details the differences of +significance. A number of these differences are explained in greater +depth in previous sections. This section uses the version of `sh' +included in SVR4.2 (the last version of the historical Bourne shell) as +the baseline reference. + + * Bash is POSIX-conformant, even where the POSIX specification + differs from traditional `sh' behavior (*note Bash POSIX Mode::). + + * Bash has multi-character invocation options (*note Invoking + Bash::). + + * Bash has command-line editing (*note Command Line Editing::) and + the `bind' builtin. + + * Bash provides a programmable word completion mechanism (*note + Programmable Completion::), and builtin commands `complete', + `compgen', and `compopt', to manipulate it. + + * Bash has command history (*note Bash History Facilities::) and the + `history' and `fc' builtins to manipulate it. The Bash history + list maintains timestamp information and uses the value of the + `HISTTIMEFORMAT' variable to display it. + + * Bash implements `csh'-like history expansion (*note History + Interaction::). + + * Bash has one-dimensional array variables (*note Arrays::), and the + appropriate variable expansions and assignment syntax to use them. + Several of the Bash builtins take options to act on arrays. Bash + provides a number of built-in array variables. + + * The `$'...'' quoting syntax, which expands ANSI-C + backslash-escaped characters in the text between the single quotes, + is supported (*note ANSI-C Quoting::). + + * Bash supports the `$"..."' quoting syntax to do locale-specific + translation of the characters between the double quotes. The + `-D', `--dump-strings', and `--dump-po-strings' invocation options + list the translatable strings found in a script (*note Locale + Translation::). + + * Bash implements the `!' keyword to negate the return value of a + pipeline (*note Pipelines::). Very useful when an `if' statement + needs to act only if a test fails. The Bash `-o pipefail' option + to `set' will cause a pipeline to return a failure status if any + command fails. + + * Bash has the `time' reserved word and command timing (*note + Pipelines::). The display of the timing statistics may be + controlled with the `TIMEFORMAT' variable. + + * Bash implements the `for (( EXPR1 ; EXPR2 ; EXPR3 ))' arithmetic + for command, similar to the C language (*note Looping + Constructs::). + + * Bash includes the `select' compound command, which allows the + generation of simple menus (*note Conditional Constructs::). + + * Bash includes the `[[' compound command, which makes conditional + testing part of the shell grammar (*note Conditional + Constructs::), including optional regular expression matching. + + * Bash provides optional case-insensitive matching for the `case' and + `[[' constructs. + + * Bash includes brace expansion (*note Brace Expansion::) and tilde + expansion (*note Tilde Expansion::). + + * Bash implements command aliases and the `alias' and `unalias' + builtins (*note Aliases::). + + * Bash provides shell arithmetic, the `((' compound command (*note + Conditional Constructs::), and arithmetic expansion (*note Shell + Arithmetic::). + + * Variables present in the shell's initial environment are + automatically exported to child processes. The Bourne shell does + not normally do this unless the variables are explicitly marked + using the `export' command. + + * Bash supports the `+=' assignment operator, which appends to the + value of the variable named on the left hand side. + + * Bash includes the POSIX pattern removal `%', `#', `%%' and `##' + expansions to remove leading or trailing substrings from variable + values (*note Shell Parameter Expansion::). + + * The expansion `${#xx}', which returns the length of `${xx}', is + supported (*note Shell Parameter Expansion::). + + * The expansion `${var:'OFFSET`[:'LENGTH`]}', which expands to the + substring of `var''s value of length LENGTH, beginning at OFFSET, + is present (*note Shell Parameter Expansion::). + + * The expansion `${var/[/]'PATTERN`[/'REPLACEMENT`]}', which matches + PATTERN and replaces it with REPLACEMENT in the value of `var', is + available (*note Shell Parameter Expansion::). + + * The expansion `${!PREFIX*}' expansion, which expands to the names + of all shell variables whose names begin with PREFIX, is available + (*note Shell Parameter Expansion::). + + * Bash has INDIRECT variable expansion using `${!word}' (*note Shell + Parameter Expansion::). + + * Bash can expand positional parameters beyond `$9' using `${NUM}'. + + * The POSIX `$()' form of command substitution is implemented (*note + Command Substitution::), and preferred to the Bourne shell's ```' + (which is also implemented for backwards compatibility). + + * Bash has process substitution (*note Process Substitution::). + + * Bash automatically assigns variables that provide information + about the current user (`UID', `EUID', and `GROUPS'), the current + host (`HOSTTYPE', `OSTYPE', `MACHTYPE', and `HOSTNAME'), and the + instance of Bash that is running (`BASH', `BASH_VERSION', and + `BASH_VERSINFO'). *Note Bash Variables::, for details. + + * The `IFS' variable is used to split only the results of expansion, + not all words (*note Word Splitting::). This closes a + longstanding shell security hole. + + * The filename expansion bracket expression code uses `!' and `^' to + negate the set of characters between the brackets. The Bourne + shell uses only `!'. + + * Bash implements the full set of POSIX filename expansion operators, + including CHARACTER CLASSES, EQUIVALENCE CLASSES, and COLLATING + SYMBOLS (*note Filename Expansion::). + + * Bash implements extended pattern matching features when the + `extglob' shell option is enabled (*note Pattern Matching::). + + * It is possible to have a variable and a function with the same + name; `sh' does not separate the two name spaces. + + * Bash functions are permitted to have local variables using the + `local' builtin, and thus useful recursive functions may be written + (*note Bash Builtins::). + + * Variable assignments preceding commands affect only that command, + even builtins and functions (*note Environment::). In `sh', all + variable assignments preceding commands are global unless the + command is executed from the file system. + + * Bash performs filename expansion on filenames specified as operands + to input and output redirection operators (*note Redirections::). + + * Bash contains the `<>' redirection operator, allowing a file to be + opened for both reading and writing, and the `&>' redirection + operator, for directing standard output and standard error to the + same file (*note Redirections::). + + * Bash includes the `<<<' redirection operator, allowing a string to + be used as the standard input to a command. + + * Bash implements the `[n]<&WORD' and `[n]>&WORD' redirection + operators, which move one file descriptor to another. + + * Bash treats a number of filenames specially when they are used in + redirection operators (*note Redirections::). + + * Bash can open network connections to arbitrary machines and + services with the redirection operators (*note Redirections::). + + * The `noclobber' option is available to avoid overwriting existing + files with output redirection (*note The Set Builtin::). The `>|' + redirection operator may be used to override `noclobber'. + + * The Bash `cd' and `pwd' builtins (*note Bourne Shell Builtins::) + each take `-L' and `-P' options to switch between logical and + physical modes. + + * Bash allows a function to override a builtin with the same name, + and provides access to that builtin's functionality within the + function via the `builtin' and `command' builtins (*note Bash + Builtins::). + + * The `command' builtin allows selective disabling of functions when + command lookup is performed (*note Bash Builtins::). + + * Individual builtins may be enabled or disabled using the `enable' + builtin (*note Bash Builtins::). + + * The Bash `exec' builtin takes additional options that allow users + to control the contents of the environment passed to the executed + command, and what the zeroth argument to the command is to be + (*note Bourne Shell Builtins::). + + * Shell functions may be exported to children via the environment + using `export -f' (*note Shell Functions::). + + * The Bash `export', `readonly', and `declare' builtins can take a + `-f' option to act on shell functions, a `-p' option to display + variables with various attributes set in a format that can be used + as shell input, a `-n' option to remove various variable + attributes, and `name=value' arguments to set variable attributes + and values simultaneously. + + * The Bash `hash' builtin allows a name to be associated with an + arbitrary filename, even when that filename cannot be found by + searching the `$PATH', using `hash -p' (*note Bourne Shell + Builtins::). + + * Bash includes a `help' builtin for quick reference to shell + facilities (*note Bash Builtins::). + + * The `printf' builtin is available to display formatted output + (*note Bash Builtins::). + + * The Bash `read' builtin (*note Bash Builtins::) will read a line + ending in `\' with the `-r' option, and will use the `REPLY' + variable as a default if no non-option arguments are supplied. + The Bash `read' builtin also accepts a prompt string with the `-p' + option and will use Readline to obtain the line when given the + `-e' option. The `read' builtin also has additional options to + control input: the `-s' option will turn off echoing of input + characters as they are read, the `-t' option will allow `read' to + time out if input does not arrive within a specified number of + seconds, the `-n' option will allow reading only a specified + number of characters rather than a full line, and the `-d' option + will read until a particular character rather than newline. + + * The `return' builtin may be used to abort execution of scripts + executed with the `.' or `source' builtins (*note Bourne Shell + Builtins::). + + * Bash includes the `shopt' builtin, for finer control of shell + optional capabilities (*note The Shopt Builtin::), and allows + these options to be set and unset at shell invocation (*note + Invoking Bash::). + + * Bash has much more optional behavior controllable with the `set' + builtin (*note The Set Builtin::). + + * The `-x' (`xtrace') option displays commands other than simple + commands when performing an execution trace (*note The Set + Builtin::). + + * The `test' builtin (*note Bourne Shell Builtins::) is slightly + different, as it implements the POSIX algorithm, which specifies + the behavior based on the number of arguments. + + * Bash includes the `caller' builtin, which displays the context of + any active subroutine call (a shell function or a script executed + with the `.' or `source' builtins). This supports the bash + debugger. + + * The `trap' builtin (*note Bourne Shell Builtins::) allows a + `DEBUG' pseudo-signal specification, similar to `EXIT'. Commands + specified with a `DEBUG' trap are executed before every simple + command, `for' command, `case' command, `select' command, every + arithmetic `for' command, and before the first command executes in + a shell function. The `DEBUG' trap is not inherited by shell + functions unless the function has been given the `trace' attribute + or the `functrace' option has been enabled using the `shopt' + builtin. The `extdebug' shell option has additional effects on the + `DEBUG' trap. + + The `trap' builtin (*note Bourne Shell Builtins::) allows an `ERR' + pseudo-signal specification, similar to `EXIT' and `DEBUG'. + Commands specified with an `ERR' trap are executed after a simple + command fails, with a few exceptions. The `ERR' trap is not + inherited by shell functions unless the `-o errtrace' option to + the `set' builtin is enabled. + + The `trap' builtin (*note Bourne Shell Builtins::) allows a + `RETURN' pseudo-signal specification, similar to `EXIT' and + `DEBUG'. Commands specified with an `RETURN' trap are executed + before execution resumes after a shell function or a shell script + executed with `.' or `source' returns. The `RETURN' trap is not + inherited by shell functions unless the function has been given + the `trace' attribute or the `functrace' option has been enabled + using the `shopt' builtin. + + * The Bash `type' builtin is more extensive and gives more + information about the names it finds (*note Bash Builtins::). + + * The Bash `umask' builtin permits a `-p' option to cause the output + to be displayed in the form of a `umask' command that may be + reused as input (*note Bourne Shell Builtins::). + + * Bash implements a `csh'-like directory stack, and provides the + `pushd', `popd', and `dirs' builtins to manipulate it (*note The + Directory Stack::). Bash also makes the directory stack visible + as the value of the `DIRSTACK' shell variable. + + * Bash interprets special backslash-escaped characters in the prompt + strings when interactive (*note Controlling the Prompt::). + + * The Bash restricted mode is more useful (*note The Restricted + Shell::); the SVR4.2 shell restricted mode is too limited. + + * The `disown' builtin can remove a job from the internal shell job + table (*note Job Control Builtins::) or suppress the sending of + `SIGHUP' to a job when the shell exits as the result of a `SIGHUP'. + + * Bash includes a number of features to support a separate debugger + for shell scripts. + + * The SVR4.2 shell has two privilege-related builtins (`mldmode' and + `priv') not present in Bash. + + * Bash does not have the `stop' or `newgrp' builtins. + + * Bash does not use the `SHACCT' variable or perform shell + accounting. + + * The SVR4.2 `sh' uses a `TIMEOUT' variable like Bash uses `TMOUT'. + + +More features unique to Bash may be found in *note Bash Features::. + +B.1 Implementation Differences From The SVR4.2 Shell +==================================================== + +Since Bash is a completely new implementation, it does not suffer from +many of the limitations of the SVR4.2 shell. For instance: + + * Bash does not fork a subshell when redirecting into or out of a + shell control structure such as an `if' or `while' statement. + + * Bash does not allow unbalanced quotes. The SVR4.2 shell will + silently insert a needed closing quote at `EOF' under certain + circumstances. This can be the cause of some hard-to-find errors. + + * The SVR4.2 shell uses a baroque memory management scheme based on + trapping `SIGSEGV'. If the shell is started from a process with + `SIGSEGV' blocked (e.g., by using the `system()' C library + function call), it misbehaves badly. + + * In a questionable attempt at security, the SVR4.2 shell, when + invoked without the `-p' option, will alter its real and effective + UID and GID if they are less than some magic threshold value, + commonly 100. This can lead to unexpected results. + + * The SVR4.2 shell does not allow users to trap `SIGSEGV', + `SIGALRM', or `SIGCHLD'. + + * The SVR4.2 shell does not allow the `IFS', `MAILCHECK', `PATH', + `PS1', or `PS2' variables to be unset. + + * The SVR4.2 shell treats `^' as the undocumented equivalent of `|'. + + * Bash allows multiple option arguments when it is invoked (`-x -v'); + the SVR4.2 shell allows only one option argument (`-xv'). In + fact, some versions of the shell dump core if the second argument + begins with a `-'. + + * The SVR4.2 shell exits a script if any builtin fails; Bash exits a + script only if one of the POSIX special builtins fails, and only + for certain failures, as enumerated in the POSIX standard. + + * The SVR4.2 shell behaves differently when invoked as `jsh' (it + turns on job control). + + +File: bashref.info, Node: GNU Free Documentation License, Next: Indexes, Prev: Major Differences From The Bourne Shell, Up: Top + +Appendix C GNU Free Documentation License +***************************************** + + Version 1.3, 3 November 2008 + + Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + `http://fsf.org/' + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + functional and useful document "free" in the sense of freedom: to + assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or + noncommercially. Secondarily, this License preserves for the + author and publisher a way to get credit for their work, while not + being considered responsible for modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. + We recommend this License principally for works whose purpose is + instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work, in any medium, + that contains a notice placed by the copyright holder saying it + can be distributed under the terms of this License. Such a notice + grants a world-wide, royalty-free license, unlimited in duration, + to use that work under the conditions stated herein. The + "Document", below, refers to any such manual or work. Any member + of the public is a licensee, and is addressed as "you". You + accept the license if you copy, modify or distribute the work in a + way requiring permission under copyright law. + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter section + of the Document that deals exclusively with the relationship of the + publishers or authors of the Document to the Document's overall + subject (or to related matters) and contains nothing that could + fall directly within that overall subject. (Thus, if the Document + is in part a textbook of mathematics, a Secondary Section may not + explain any mathematics.) The relationship could be a matter of + historical connection with the subject or with related matters, or + of legal, commercial, philosophical, ethical or political position + regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in + the notice that says that the Document is released under this + License. If a section does not fit the above definition of + Secondary then it is not allowed to be designated as Invariant. + The Document may contain zero Invariant Sections. If the Document + does not identify any Invariant Sections then there are none. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. A + Front-Cover Text may be at most 5 words, and a Back-Cover Text may + be at most 25 words. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, that is suitable for revising the document + straightforwardly with generic text editors or (for images + composed of pixels) generic paint programs or (for drawings) some + widely available drawing editor, and that is suitable for input to + text formatters or for automatic translation to a variety of + formats suitable for input to text formatters. A copy made in an + otherwise Transparent file format whose markup, or absence of + markup, has been arranged to thwart or discourage subsequent + modification by readers is not Transparent. An image format is + not Transparent if used for any substantial amount of text. A + copy that is not "Transparent" is called "Opaque". + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and + standard-conforming simple HTML, PostScript or PDF designed for + human modification. Examples of transparent image formats include + PNG, XCF and JPG. Opaque formats include proprietary formats that + can be read and edited only by proprietary word processors, SGML or + XML for which the DTD and/or processing tools are not generally + available, and the machine-generated HTML, PostScript or PDF + produced by some word processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + The "publisher" means any person or entity that distributes copies + of the Document to the public. + + A section "Entitled XYZ" means a named subunit of the Document + whose title either is precisely XYZ or contains XYZ in parentheses + following text that translates XYZ in another language. (Here XYZ + stands for a specific section name mentioned below, such as + "Acknowledgements", "Dedications", "Endorsements", or "History".) + To "Preserve the Title" of such a section when you modify the + Document means that it remains a section "Entitled XYZ" according + to this definition. + + The Document may include Warranty Disclaimers next to the notice + which states that this License applies to the Document. These + Warranty Disclaimers are considered to be included by reference in + this License, but only as regards disclaiming warranties: any other + implication that these Warranty Disclaimers may have is void and + has no effect on the meaning of this License. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow + the conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies (or copies in media that commonly + have printed covers) of the Document, numbering more than 100, and + the Document's license notice requires Cover Texts, you must + enclose the copies in covers that carry, clearly and legibly, all + these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the + title equally prominent and visible. You may add other material + on the covers in addition. Copying with changes limited to the + covers, as long as they preserve the title of the Document and + satisfy these conditions, can be treated as verbatim copying in + other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a + machine-readable Transparent copy along with each Opaque copy, or + state in or with each Opaque copy a computer-network location from + which the general network-using public has access to download + using public-standard network protocols a complete Transparent + copy of the Document, free of added material. If you use the + latter option, you must take reasonably prudent steps, when you + begin distribution of Opaque copies in quantity, to ensure that + this Transparent copy will remain thus accessible at the stated + location until at least one year after the last time you + distribute an Opaque copy (directly or through your agents or + retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of + copies, to give them a chance to provide you with an updated + version of the Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with + the Modified Version filling the role of the Document, thus + licensing distribution and modification of the Modified Version to + whoever possesses a copy of it. In addition, you must do these + things in the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of + previous versions (which should, if there were any, be listed + in the History section of the Document). You may use the + same title as a previous version if the original publisher of + that version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has fewer than five), unless they release you + from this requirement. + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section Entitled "History", Preserve its Title, + and add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on + the Title Page. If there is no section Entitled "History" in + the Document, create one stating the title, year, authors, + and publisher of the Document as given on its Title Page, + then add an item describing the Modified Version as stated in + the previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in + the "History" section. You may omit a network location for a + work that was published at least four years before the + Document itself, or if the original publisher of the version + it refers to gives permission. + + K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the + section all the substance and tone of each of the contributor + acknowledgements and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section + titles. + + M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section to be Entitled + "Endorsements" or to conflict in title with any Invariant + Section. + + O. Preserve any Warranty Disclaimers. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option + designate some or all of these sections as invariant. To do this, + add their titles to the list of Invariant Sections in the Modified + Version's license notice. These titles must be distinct from any + other section titles. + + You may add a section Entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties--for example, statements of peer review or that the text + has been approved by an organization as the authoritative + definition of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end + of the list of Cover Texts in the Modified Version. Only one + passage of Front-Cover Text and one of Back-Cover Text may be + added by (or through arrangements made by) any one entity. If the + Document already includes a cover text for the same cover, + previously added by you or by arrangement made by the same entity + you are acting on behalf of, you may not add another; but you may + replace the old one, on explicit permission from the previous + publisher that added the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination + all of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice, and that you preserve all + their Warranty Disclaimers. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections Entitled + "History" in the various original documents, forming one section + Entitled "History"; likewise combine any sections Entitled + "Acknowledgements", and any sections Entitled "Dedications". You + must delete all sections Entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the + documents in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow + this License in all other respects regarding verbatim copying of + that document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of + a storage or distribution medium, is called an "aggregate" if the + copyright resulting from the compilation is not used to limit the + legal rights of the compilation's users beyond what the individual + works permit. When the Document is included in an aggregate, this + License does not apply to the other works in the aggregate which + are not themselves derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one half + of the entire aggregate, the Document's Cover Texts may be placed + on covers that bracket the Document within the aggregate, or the + electronic equivalent of covers if the Document is in electronic + form. Otherwise they must appear on printed covers that bracket + the whole aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License, and all the license notices in the + Document, and any Warranty Disclaimers, provided that you also + include the original English version of this License and the + original versions of those notices and disclaimers. In case of a + disagreement between the translation and the original version of + this License or a notice or disclaimer, the original version will + prevail. + + If a section in the Document is Entitled "Acknowledgements", + "Dedications", or "History", the requirement (section 4) to + Preserve its Title (section 1) will typically require changing the + actual title. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense, or distribute it is void, + and will automatically terminate your rights under this License. + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly + and finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from + that copyright holder, and you cure the violation prior to 30 days + after your receipt of the notice. + + Termination of your rights under this section does not terminate + the licenses of parties who have received copies or rights from + you under this License. If your rights have been terminated and + not permanently reinstated, receipt of a copy of some or all of + the same material does not give you any rights to use it. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + `http://www.gnu.org/copyleft/'. + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If + the Document does not specify a version number of this License, + you may choose any version ever published (not as a draft) by the + Free Software Foundation. If the Document specifies that a proxy + can decide which future versions of this License can be used, that + proxy's public statement of acceptance of a version permanently + authorizes you to choose that version for the Document. + + 11. RELICENSING + + "Massive Multiauthor Collaboration Site" (or "MMC Site") means any + World Wide Web server that publishes copyrightable works and also + provides prominent facilities for anybody to edit those works. A + public wiki that anybody can edit is an example of such a server. + A "Massive Multiauthor Collaboration" (or "MMC") contained in the + site means any set of copyrightable works thus published on the MMC + site. + + "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 + license published by Creative Commons Corporation, a not-for-profit + corporation with a principal place of business in San Francisco, + California, as well as future copyleft versions of that license + published by that same organization. + + "Incorporate" means to publish or republish a Document, in whole or + in part, as part of another Document. + + An MMC is "eligible for relicensing" if it is licensed under this + License, and if all works that were first published under this + License somewhere other than this MMC, and subsequently + incorporated in whole or in part into the MMC, (1) had no cover + texts or invariant sections, and (2) were thus incorporated prior + to November 1, 2008. + + The operator of an MMC Site may republish an MMC contained in the + site under CC-BY-SA on the same site at any time before August 1, + 2009, provided the MMC is eligible for relicensing. + + +ADDENDUM: How to use this License for your documents +==================================================== + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + + If you have Invariant Sections, Front-Cover Texts and Back-Cover +Texts, replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with + the Front-Cover Texts being LIST, and with the Back-Cover Texts + being LIST. + + If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, to +permit their use in free software. + + +File: bashref.info, Node: Indexes, Prev: GNU Free Documentation License, Up: Top + +Appendix D Indexes +****************** + +* Menu: + +* Builtin Index:: Index of Bash builtin commands. +* Reserved Word Index:: Index of Bash reserved words. +* Variable Index:: Quick reference helps you find the + variable you want. +* Function Index:: Index of bindable Readline functions. +* Concept Index:: General index for concepts described in + this manual. + + +File: bashref.info, Node: Builtin Index, Next: Reserved Word Index, Up: Indexes + +D.1 Index of Shell Builtin Commands +=================================== + +[index] +* Menu: + +* .: Bourne Shell Builtins. + (line 17) +* :: Bourne Shell Builtins. + (line 11) +* [: Bourne Shell Builtins. + (line 258) +* alias: Bash Builtins. (line 11) +* bg: Job Control Builtins. + (line 7) +* bind: Bash Builtins. (line 21) +* break: Bourne Shell Builtins. + (line 31) +* builtin: Bash Builtins. (line 102) +* caller: Bash Builtins. (line 111) +* cd: Bourne Shell Builtins. + (line 39) +* command: Bash Builtins. (line 129) +* compgen: Programmable Completion Builtins. + (line 12) +* complete: Programmable Completion Builtins. + (line 30) +* compopt: Programmable Completion Builtins. + (line 228) +* continue: Bourne Shell Builtins. + (line 80) +* declare: Bash Builtins. (line 149) +* dirs: Directory Stack Builtins. + (line 7) +* disown: Job Control Builtins. + (line 89) +* echo: Bash Builtins. (line 245) +* enable: Bash Builtins. (line 307) +* eval: Bourne Shell Builtins. + (line 89) +* exec: Bourne Shell Builtins. + (line 97) +* exit: Bourne Shell Builtins. + (line 114) +* export: Bourne Shell Builtins. + (line 121) +* fc: Bash History Builtins. + (line 10) +* fg: Job Control Builtins. + (line 17) +* getopts: Bourne Shell Builtins. + (line 137) +* hash: Bourne Shell Builtins. + (line 180) +* help: Bash Builtins. (line 336) +* history: Bash History Builtins. + (line 40) +* jobs: Job Control Builtins. + (line 27) +* kill: Job Control Builtins. + (line 59) +* let: Bash Builtins. (line 357) +* local: Bash Builtins. (line 365) +* logout: Bash Builtins. (line 376) +* mapfile: Bash Builtins. (line 381) +* popd: Directory Stack Builtins. + (line 39) +* printf: Bash Builtins. (line 429) +* pushd: Directory Stack Builtins. + (line 61) +* pwd: Bourne Shell Builtins. + (line 200) +* read: Bash Builtins. (line 477) +* readarray: Bash Builtins. (line 564) +* readonly: Bourne Shell Builtins. + (line 210) +* return: Bourne Shell Builtins. + (line 229) +* set: The Set Builtin. (line 11) +* shift: Bourne Shell Builtins. + (line 245) +* shopt: The Shopt Builtin. (line 9) +* source: Bash Builtins. (line 573) +* suspend: Job Control Builtins. + (line 101) +* test: Bourne Shell Builtins. + (line 258) +* times: Bourne Shell Builtins. + (line 334) +* trap: Bourne Shell Builtins. + (line 340) +* type: Bash Builtins. (line 578) +* typeset: Bash Builtins. (line 610) +* ulimit: Bash Builtins. (line 616) +* umask: Bourne Shell Builtins. + (line 389) +* unalias: Bash Builtins. (line 707) +* unset: Bourne Shell Builtins. + (line 407) +* wait: Job Control Builtins. + (line 76) + + +File: bashref.info, Node: Reserved Word Index, Next: Variable Index, Prev: Builtin Index, Up: Indexes + +D.2 Index of Shell Reserved Words +================================= + +[index] +* Menu: + +* !: Pipelines. (line 9) +* [[: Conditional Constructs. + (line 119) +* ]]: Conditional Constructs. + (line 119) +* case: Conditional Constructs. + (line 28) +* do: Looping Constructs. (line 12) +* done: Looping Constructs. (line 12) +* elif: Conditional Constructs. + (line 7) +* else: Conditional Constructs. + (line 7) +* esac: Conditional Constructs. + (line 28) +* fi: Conditional Constructs. + (line 7) +* for: Looping Constructs. (line 32) +* function: Shell Functions. (line 13) +* if: Conditional Constructs. + (line 7) +* in: Conditional Constructs. + (line 28) +* select: Conditional Constructs. + (line 78) +* then: Conditional Constructs. + (line 7) +* time: Pipelines. (line 9) +* until: Looping Constructs. (line 12) +* while: Looping Constructs. (line 22) +* {: Command Grouping. (line 21) +* }: Command Grouping. (line 21) + + +File: bashref.info, Node: Variable Index, Next: Function Index, Prev: Reserved Word Index, Up: Indexes + +D.3 Parameter and Variable Index +================================ + +[index] +* Menu: + +* !: Special Parameters. (line 50) +* #: Special Parameters. (line 33) +* $: Special Parameters. (line 45) +* $!: Special Parameters. (line 51) +* $#: Special Parameters. (line 34) +* $$: Special Parameters. (line 46) +* $*: Special Parameters. (line 10) +* $-: Special Parameters. (line 41) +* $0: Special Parameters. (line 56) +* $?: Special Parameters. (line 37) +* $@: Special Parameters. (line 23) +* $_: Special Parameters. (line 65) +* *: Special Parameters. (line 9) +* -: Special Parameters. (line 40) +* 0: Special Parameters. (line 55) +* ?: Special Parameters. (line 36) +* @: Special Parameters. (line 22) +* _: Special Parameters. (line 64) +* auto_resume: Job Control Variables. + (line 6) +* BASH: Bash Variables. (line 13) +* BASH_ALIASES: Bash Variables. (line 30) +* BASH_ARGC: Bash Variables. (line 37) +* BASH_ARGV: Bash Variables. (line 47) +* BASH_CMDS: Bash Variables. (line 57) +* BASH_COMMAND: Bash Variables. (line 64) +* BASH_COMPAT: Bash Variables. (line 69) +* BASH_ENV: Bash Variables. (line 84) +* BASH_EXECUTION_STRING: Bash Variables. (line 90) +* BASH_LINENO: Bash Variables. (line 93) +* BASH_REMATCH: Bash Variables. (line 101) +* BASH_SOURCE: Bash Variables. (line 109) +* BASH_SUBSHELL: Bash Variables. (line 116) +* BASH_VERSINFO: Bash Variables. (line 121) +* BASH_VERSION: Bash Variables. (line 144) +* BASH_XTRACEFD: Bash Variables. (line 147) +* BASHOPTS: Bash Variables. (line 16) +* BASHPID: Bash Variables. (line 25) +* bell-style: Readline Init File Syntax. + (line 38) +* bind-tty-special-chars: Readline Init File Syntax. + (line 45) +* CDPATH: Bourne Shell Variables. + (line 9) +* CHILD_MAX: Bash Variables. (line 158) +* colored-stats: Readline Init File Syntax. + (line 50) +* COLUMNS: Bash Variables. (line 165) +* comment-begin: Readline Init File Syntax. + (line 56) +* COMP_CWORD: Bash Variables. (line 171) +* COMP_KEY: Bash Variables. (line 200) +* COMP_LINE: Bash Variables. (line 177) +* COMP_POINT: Bash Variables. (line 182) +* COMP_TYPE: Bash Variables. (line 190) +* COMP_WORDBREAKS: Bash Variables. (line 204) +* COMP_WORDS: Bash Variables. (line 210) +* completion-display-width: Readline Init File Syntax. + (line 61) +* completion-ignore-case: Readline Init File Syntax. + (line 68) +* completion-map-case: Readline Init File Syntax. + (line 73) +* completion-prefix-display-length: Readline Init File Syntax. + (line 79) +* completion-query-items: Readline Init File Syntax. + (line 86) +* COMPREPLY: Bash Variables. (line 218) +* convert-meta: Readline Init File Syntax. + (line 96) +* COPROC: Bash Variables. (line 224) +* DIRSTACK: Bash Variables. (line 228) +* disable-completion: Readline Init File Syntax. + (line 102) +* editing-mode: Readline Init File Syntax. + (line 107) +* EMACS: Bash Variables. (line 238) +* enable-keypad: Readline Init File Syntax. + (line 118) +* ENV: Bash Variables. (line 243) +* EUID: Bash Variables. (line 247) +* expand-tilde: Readline Init File Syntax. + (line 129) +* FCEDIT: Bash Variables. (line 251) +* FIGNORE: Bash Variables. (line 255) +* FUNCNAME: Bash Variables. (line 261) +* FUNCNEST: Bash Variables. (line 279) +* GLOBIGNORE: Bash Variables. (line 284) +* GROUPS: Bash Variables. (line 290) +* histchars: Bash Variables. (line 296) +* HISTCMD: Bash Variables. (line 311) +* HISTCONTROL: Bash Variables. (line 316) +* HISTFILE: Bash Variables. (line 332) +* HISTFILESIZE: Bash Variables. (line 336) +* HISTIGNORE: Bash Variables. (line 347) +* history-preserve-point: Readline Init File Syntax. + (line 133) +* history-size: Readline Init File Syntax. + (line 139) +* HISTSIZE: Bash Variables. (line 366) +* HISTTIMEFORMAT: Bash Variables. (line 373) +* HOME: Bourne Shell Variables. + (line 13) +* horizontal-scroll-mode: Readline Init File Syntax. + (line 146) +* HOSTFILE: Bash Variables. (line 382) +* HOSTNAME: Bash Variables. (line 393) +* HOSTTYPE: Bash Variables. (line 396) +* IFS: Bourne Shell Variables. + (line 18) +* IGNOREEOF: Bash Variables. (line 399) +* input-meta: Readline Init File Syntax. + (line 153) +* INPUTRC: Bash Variables. (line 409) +* isearch-terminators: Readline Init File Syntax. + (line 160) +* keymap: Readline Init File Syntax. + (line 167) +* LANG: Bash Variables. (line 413) +* LC_ALL: Bash Variables. (line 417) +* LC_COLLATE: Bash Variables. (line 421) +* LC_CTYPE: Bash Variables. (line 428) +* LC_MESSAGES <1>: Locale Translation. (line 11) +* LC_MESSAGES: Bash Variables. (line 433) +* LC_NUMERIC: Bash Variables. (line 437) +* LINENO: Bash Variables. (line 441) +* LINES: Bash Variables. (line 445) +* MACHTYPE: Bash Variables. (line 451) +* MAIL: Bourne Shell Variables. + (line 22) +* MAILCHECK: Bash Variables. (line 455) +* MAILPATH: Bourne Shell Variables. + (line 27) +* MAPFILE: Bash Variables. (line 463) +* mark-modified-lines: Readline Init File Syntax. + (line 196) +* mark-symlinked-directories: Readline Init File Syntax. + (line 201) +* match-hidden-files: Readline Init File Syntax. + (line 206) +* menu-complete-display-prefix: Readline Init File Syntax. + (line 213) +* meta-flag: Readline Init File Syntax. + (line 153) +* OLDPWD: Bash Variables. (line 467) +* OPTARG: Bourne Shell Variables. + (line 34) +* OPTERR: Bash Variables. (line 470) +* OPTIND: Bourne Shell Variables. + (line 38) +* OSTYPE: Bash Variables. (line 474) +* output-meta: Readline Init File Syntax. + (line 218) +* page-completions: Readline Init File Syntax. + (line 223) +* PATH: Bourne Shell Variables. + (line 42) +* PIPESTATUS: Bash Variables. (line 477) +* POSIXLY_CORRECT: Bash Variables. (line 482) +* PPID: Bash Variables. (line 491) +* PROMPT_COMMAND: Bash Variables. (line 495) +* PROMPT_DIRTRIM: Bash Variables. (line 499) +* PS1: Bourne Shell Variables. + (line 48) +* PS2: Bourne Shell Variables. + (line 53) +* PS3: Bash Variables. (line 505) +* PS4: Bash Variables. (line 510) +* PWD: Bash Variables. (line 516) +* RANDOM: Bash Variables. (line 519) +* READLINE_LINE: Bash Variables. (line 524) +* READLINE_POINT: Bash Variables. (line 528) +* REPLY: Bash Variables. (line 532) +* revert-all-at-newline: Readline Init File Syntax. + (line 233) +* SECONDS: Bash Variables. (line 535) +* SHELL: Bash Variables. (line 541) +* SHELLOPTS: Bash Variables. (line 546) +* SHLVL: Bash Variables. (line 555) +* show-all-if-ambiguous: Readline Init File Syntax. + (line 239) +* show-all-if-unmodified: Readline Init File Syntax. + (line 245) +* show-mode-in-prompt: Readline Init File Syntax. + (line 254) +* skip-completed-text: Readline Init File Syntax. + (line 259) +* TEXTDOMAIN: Locale Translation. (line 11) +* TEXTDOMAINDIR: Locale Translation. (line 11) +* TIMEFORMAT: Bash Variables. (line 560) +* TMOUT: Bash Variables. (line 598) +* TMPDIR: Bash Variables. (line 610) +* UID: Bash Variables. (line 614) +* visible-stats: Readline Init File Syntax. + (line 272) + + +File: bashref.info, Node: Function Index, Next: Concept Index, Prev: Variable Index, Up: Indexes + +D.4 Function Index +================== + +[index] +* Menu: + +* abort (C-g): Miscellaneous Commands. + (line 10) +* accept-line (Newline or Return): Commands For History. (line 6) +* backward-char (C-b): Commands For Moving. (line 15) +* backward-delete-char (Rubout): Commands For Text. (line 17) +* backward-kill-line (C-x Rubout): Commands For Killing. (line 9) +* backward-kill-word (M-): Commands For Killing. (line 24) +* backward-word (M-b): Commands For Moving. (line 22) +* beginning-of-history (M-<): Commands For History. (line 20) +* beginning-of-line (C-a): Commands For Moving. (line 6) +* call-last-kbd-macro (C-x e): Keyboard Macros. (line 13) +* capitalize-word (M-c): Commands For Text. (line 52) +* character-search (C-]): Miscellaneous Commands. + (line 41) +* character-search-backward (M-C-]): Miscellaneous Commands. + (line 46) +* clear-screen (C-l): Commands For Moving. (line 34) +* complete (): Commands For Completion. + (line 6) +* copy-backward-word (): Commands For Killing. (line 58) +* copy-forward-word (): Commands For Killing. (line 63) +* copy-region-as-kill (): Commands For Killing. (line 54) +* delete-char (C-d): Commands For Text. (line 12) +* delete-char-or-list (): Commands For Completion. + (line 43) +* delete-horizontal-space (): Commands For Killing. (line 46) +* digit-argument (M-0, M-1, ... M--): Numeric Arguments. (line 6) +* do-uppercase-version (M-a, M-b, M-X, ...): Miscellaneous Commands. + (line 14) +* downcase-word (M-l): Commands For Text. (line 48) +* dump-functions (): Miscellaneous Commands. + (line 73) +* dump-macros (): Miscellaneous Commands. + (line 85) +* dump-variables (): Miscellaneous Commands. + (line 79) +* end-kbd-macro (C-x )): Keyboard Macros. (line 9) +* end-of-file (usually C-d): Commands For Text. (line 6) +* end-of-history (M->): Commands For History. (line 23) +* end-of-line (C-e): Commands For Moving. (line 9) +* exchange-point-and-mark (C-x C-x): Miscellaneous Commands. + (line 36) +* forward-backward-delete-char (): Commands For Text. (line 21) +* forward-char (C-f): Commands For Moving. (line 12) +* forward-search-history (C-s): Commands For History. (line 31) +* forward-word (M-f): Commands For Moving. (line 18) +* history-search-backward (): Commands For History. (line 52) +* history-search-forward (): Commands For History. (line 46) +* history-substr-search-backward (): Commands For History. (line 64) +* history-substr-search-forward (): Commands For History. (line 58) +* insert-comment (M-#): Miscellaneous Commands. + (line 60) +* insert-completions (M-*): Commands For Completion. + (line 22) +* kill-line (C-k): Commands For Killing. (line 6) +* kill-region (): Commands For Killing. (line 50) +* kill-whole-line (): Commands For Killing. (line 15) +* kill-word (M-d): Commands For Killing. (line 19) +* menu-complete (): Commands For Completion. + (line 26) +* menu-complete-backward (): Commands For Completion. + (line 38) +* next-history (C-n): Commands For History. (line 17) +* non-incremental-forward-search-history (M-n): Commands For History. + (line 41) +* non-incremental-reverse-search-history (M-p): Commands For History. + (line 36) +* overwrite-mode (): Commands For Text. (line 56) +* possible-completions (M-?): Commands For Completion. + (line 15) +* prefix-meta (): Miscellaneous Commands. + (line 18) +* previous-history (C-p): Commands For History. (line 13) +* print-last-kbd-macro (): Keyboard Macros. (line 17) +* quoted-insert (C-q or C-v): Commands For Text. (line 26) +* re-read-init-file (C-x C-r): Miscellaneous Commands. + (line 6) +* redraw-current-line (): Commands For Moving. (line 38) +* reverse-search-history (C-r): Commands For History. (line 27) +* revert-line (M-r): Miscellaneous Commands. + (line 25) +* self-insert (a, b, A, 1, !, ...): Commands For Text. (line 30) +* set-mark (C-@): Miscellaneous Commands. + (line 32) +* skip-csi-sequence (): Miscellaneous Commands. + (line 51) +* start-kbd-macro (C-x (): Keyboard Macros. (line 6) +* transpose-chars (C-t): Commands For Text. (line 33) +* transpose-words (M-t): Commands For Text. (line 39) +* undo (C-_ or C-x C-u): Miscellaneous Commands. + (line 22) +* universal-argument (): Numeric Arguments. (line 10) +* unix-filename-rubout (): Commands For Killing. (line 41) +* unix-line-discard (C-u): Commands For Killing. (line 12) +* unix-word-rubout (C-w): Commands For Killing. (line 37) +* upcase-word (M-u): Commands For Text. (line 44) +* yank (C-y): Commands For Killing. (line 68) +* yank-last-arg (M-. or M-_): Commands For History. (line 79) +* yank-nth-arg (M-C-y): Commands For History. (line 70) +* yank-pop (M-y): Commands For Killing. (line 71) + + +File: bashref.info, Node: Concept Index, Prev: Function Index, Up: Indexes + +D.5 Concept Index +================= + +[index] +* Menu: + +* alias expansion: Aliases. (line 6) +* arithmetic evaluation: Shell Arithmetic. (line 6) +* arithmetic expansion: Arithmetic Expansion. + (line 6) +* arithmetic, shell: Shell Arithmetic. (line 6) +* arrays: Arrays. (line 6) +* background: Job Control Basics. (line 6) +* Bash configuration: Basic Installation. (line 6) +* Bash installation: Basic Installation. (line 6) +* Bourne shell: Basic Shell Features. + (line 6) +* brace expansion: Brace Expansion. (line 6) +* builtin: Definitions. (line 17) +* command editing: Readline Bare Essentials. + (line 6) +* command execution: Command Search and Execution. + (line 6) +* command expansion: Simple Command Expansion. + (line 6) +* command history: Bash History Facilities. + (line 6) +* command search: Command Search and Execution. + (line 6) +* command substitution: Command Substitution. + (line 6) +* command timing: Pipelines. (line 9) +* commands, compound: Compound Commands. (line 6) +* commands, conditional: Conditional Constructs. + (line 6) +* commands, grouping: Command Grouping. (line 6) +* commands, lists: Lists. (line 6) +* commands, looping: Looping Constructs. (line 6) +* commands, pipelines: Pipelines. (line 6) +* commands, shell: Shell Commands. (line 6) +* commands, simple: Simple Commands. (line 6) +* comments, shell: Comments. (line 6) +* completion builtins: Programmable Completion Builtins. + (line 6) +* configuration: Basic Installation. (line 6) +* control operator: Definitions. (line 21) +* coprocess: Coprocesses. (line 6) +* directory stack: The Directory Stack. (line 6) +* editing command lines: Readline Bare Essentials. + (line 6) +* environment: Environment. (line 6) +* evaluation, arithmetic: Shell Arithmetic. (line 6) +* event designators: Event Designators. (line 6) +* execution environment: Command Execution Environment. + (line 6) +* exit status <1>: Exit Status. (line 6) +* exit status: Definitions. (line 26) +* expansion: Shell Expansions. (line 6) +* expansion, arithmetic: Arithmetic Expansion. + (line 6) +* expansion, brace: Brace Expansion. (line 6) +* expansion, filename: Filename Expansion. (line 9) +* expansion, parameter: Shell Parameter Expansion. + (line 6) +* expansion, pathname: Filename Expansion. (line 9) +* expansion, tilde: Tilde Expansion. (line 6) +* expressions, arithmetic: Shell Arithmetic. (line 6) +* expressions, conditional: Bash Conditional Expressions. + (line 6) +* field: Definitions. (line 30) +* filename: Definitions. (line 35) +* filename expansion: Filename Expansion. (line 9) +* foreground: Job Control Basics. (line 6) +* functions, shell: Shell Functions. (line 6) +* history builtins: Bash History Builtins. + (line 6) +* history events: Event Designators. (line 8) +* history expansion: History Interaction. (line 6) +* history list: Bash History Facilities. + (line 6) +* History, how to use: A Programmable Completion Example. + (line 114) +* identifier: Definitions. (line 51) +* initialization file, readline: Readline Init File. (line 6) +* installation: Basic Installation. (line 6) +* interaction, readline: Readline Interaction. + (line 6) +* interactive shell <1>: Interactive Shells. (line 6) +* interactive shell: Invoking Bash. (line 125) +* internationalization: Locale Translation. (line 6) +* job: Definitions. (line 38) +* job control <1>: Job Control Basics. (line 6) +* job control: Definitions. (line 42) +* kill ring: Readline Killing Commands. + (line 19) +* killing text: Readline Killing Commands. + (line 6) +* localization: Locale Translation. (line 6) +* login shell: Invoking Bash. (line 122) +* matching, pattern: Pattern Matching. (line 6) +* metacharacter: Definitions. (line 46) +* name: Definitions. (line 51) +* native languages: Locale Translation. (line 6) +* notation, readline: Readline Bare Essentials. + (line 6) +* operator, shell: Definitions. (line 57) +* parameter expansion: Shell Parameter Expansion. + (line 6) +* parameters: Shell Parameters. (line 6) +* parameters, positional: Positional Parameters. + (line 6) +* parameters, special: Special Parameters. (line 6) +* pathname expansion: Filename Expansion. (line 9) +* pattern matching: Pattern Matching. (line 6) +* pipeline: Pipelines. (line 6) +* POSIX: Definitions. (line 9) +* POSIX Mode: Bash POSIX Mode. (line 6) +* process group: Definitions. (line 62) +* process group ID: Definitions. (line 66) +* process substitution: Process Substitution. + (line 6) +* programmable completion: Programmable Completion. + (line 6) +* prompting: Controlling the Prompt. + (line 6) +* quoting: Quoting. (line 6) +* quoting, ANSI: ANSI-C Quoting. (line 6) +* Readline, how to use: Job Control Variables. + (line 24) +* redirection: Redirections. (line 6) +* reserved word: Definitions. (line 70) +* restricted shell: The Restricted Shell. + (line 6) +* return status: Definitions. (line 75) +* shell arithmetic: Shell Arithmetic. (line 6) +* shell function: Shell Functions. (line 6) +* shell script: Shell Scripts. (line 6) +* shell variable: Shell Parameters. (line 6) +* shell, interactive: Interactive Shells. (line 6) +* signal: Definitions. (line 78) +* signal handling: Signals. (line 6) +* special builtin <1>: Special Builtins. (line 6) +* special builtin: Definitions. (line 82) +* startup files: Bash Startup Files. (line 6) +* suspending jobs: Job Control Basics. (line 6) +* tilde expansion: Tilde Expansion. (line 6) +* token: Definitions. (line 86) +* translation, native languages: Locale Translation. (line 6) +* variable, shell: Shell Parameters. (line 6) +* variables, readline: Readline Init File Syntax. + (line 37) +* word: Definitions. (line 90) +* word splitting: Word Splitting. (line 6) +* yanking text: Readline Killing Commands. + (line 6) + + + +Tag Table: +Node: Top930 +Node: Introduction2848 +Node: What is Bash?3076 +Node: What is a shell?4189 +Node: Definitions6728 +Node: Basic Shell Features9646 +Node: Shell Syntax10865 +Node: Shell Operation11895 +Node: Quoting13189 +Node: Escape Character14492 +Node: Single Quotes14977 +Node: Double Quotes15325 +Node: ANSI-C Quoting16450 +Node: Locale Translation17694 +Node: Comments18590 +Node: Shell Commands19208 +Node: Simple Commands20080 +Node: Pipelines20711 +Node: Lists23449 +Node: Compound Commands25178 +Node: Looping Constructs26184 +Node: Conditional Constructs28647 +Node: Command Grouping39577 +Node: Coprocesses41056 +Node: GNU Parallel42889 +Node: Shell Functions46875 +Node: Shell Parameters51959 +Node: Positional Parameters56088 +Node: Special Parameters56988 +Node: Shell Expansions60327 +Node: Brace Expansion62270 +Node: Tilde Expansion65051 +Node: Shell Parameter Expansion67400 +Node: Command Substitution79694 +Node: Arithmetic Expansion81027 +Node: Process Substitution81959 +Node: Word Splitting83009 +Node: Filename Expansion84657 +Node: Pattern Matching86822 +Node: Quote Removal90522 +Node: Redirections90817 +Node: Executing Commands99981 +Node: Simple Command Expansion100651 +Node: Command Search and Execution102581 +Node: Command Execution Environment104918 +Node: Environment107904 +Node: Exit Status109563 +Node: Signals111185 +Node: Shell Scripts113153 +Node: Shell Builtin Commands115671 +Node: Bourne Shell Builtins117699 +Node: Bash Builtins137606 +Node: Modifying Shell Behavior165232 +Node: The Set Builtin165577 +Node: The Shopt Builtin175903 +Node: Special Builtins190324 +Node: Shell Variables191303 +Node: Bourne Shell Variables191743 +Node: Bash Variables193774 +Node: Bash Features220649 +Node: Invoking Bash221548 +Node: Bash Startup Files227326 +Node: Interactive Shells232355 +Node: What is an Interactive Shell?232765 +Node: Is this Shell Interactive?233414 +Node: Interactive Shell Behavior234229 +Node: Bash Conditional Expressions237517 +Node: Shell Arithmetic241519 +Node: Aliases244295 +Node: Arrays246851 +Node: The Directory Stack251832 +Node: Directory Stack Builtins252551 +Node: Controlling the Prompt255507 +Node: The Restricted Shell258279 +Node: Bash POSIX Mode260116 +Node: Job Control269502 +Node: Job Control Basics269962 +Node: Job Control Builtins274681 +Node: Job Control Variables279152 +Node: Command Line Editing280310 +Node: Introduction and Notation281982 +Node: Readline Interaction283604 +Node: Readline Bare Essentials284795 +Node: Readline Movement Commands286584 +Node: Readline Killing Commands287549 +Node: Readline Arguments289469 +Node: Searching290513 +Node: Readline Init File292699 +Node: Readline Init File Syntax293846 +Node: Conditional Init Constructs310832 +Node: Sample Init File313365 +Node: Bindable Readline Commands316483 +Node: Commands For Moving317690 +Node: Commands For History318834 +Node: Commands For Text323019 +Node: Commands For Killing325948 +Node: Numeric Arguments328405 +Node: Commands For Completion329544 +Node: Keyboard Macros333736 +Node: Miscellaneous Commands334424 +Node: Readline vi Mode340230 +Node: Programmable Completion341137 +Node: Programmable Completion Builtins348413 +Node: A Programmable Completion Example358159 +Node: Using History Interactively363409 +Node: Bash History Facilities364093 +Node: Bash History Builtins367092 +Node: History Interaction371020 +Node: Event Designators373725 +Node: Word Designators374947 +Node: Modifiers376586 +Node: Installing Bash377990 +Node: Basic Installation379127 +Node: Compilers and Options381819 +Node: Compiling For Multiple Architectures382560 +Node: Installation Names384224 +Node: Specifying the System Type385042 +Node: Sharing Defaults385758 +Node: Operation Controls386431 +Node: Optional Features387389 +Node: Reporting Bugs397453 +Node: Major Differences From The Bourne Shell398651 +Node: GNU Free Documentation License415510 +Node: Indexes440706 +Node: Builtin Index441160 +Node: Reserved Word Index447987 +Node: Variable Index450435 +Node: Function Index464615 +Node: Concept Index471916 + +End Tag Table diff --git a/doc/bashref.pdf b/doc/bashref.pdf new file mode 100644 index 0000000000000000000000000000000000000000..45284f780b8750840a583ceca8d02d8ee796e5e6 GIT binary patch literal 463824 zcma%iLzE^=wr$$BZ5x%gS!wG_+qP}ncBO6GHY#mr-oER-LHD{n_-8T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aFtWMM+bEZsxt=As0lI3jj#LZh%rNA$RaM4Ze*6V;uCOu!zQSQ>{}7X z%vgAQ?|@!W1zz=R>>rYVHHc@F1b;KN(|*)g=AsB?>iNooAV*G-WuG-gr2P~*PXs*^2+05|mxG2)FjtB;JHIwUQI=jTb^L`ibBglvHt@L=lzL0F!&u_o zR)X!)Tzv)dx=ys3U*$b}%q+mZAtit;ID1YFC%oImS(8>%!u}F1&ua+|d+>Q$Wmp6o zQMW3}UoAY~5WW6BNfs$Gnct6SLY_Lp1~c099+O}8Yh%2S)DF8BVK9zmhOJHsaFp6( zO6$W1m~bqMW_|I6oXHT6=hbHy-enEVbxOXEX3FZw46(4d00L7`^nq`wjpo?I?(adQ zei8+n{-1IiEpvIBhJ*vDQpY*{&yZSP5o6uYrpjvO{%Q?{wm9y*o!e6m@W#^oH?uCAD-h6=melPPeh}rqRdvwSw;|wXY<}u*??nN6kVSLjk3o_h zmyp#4g(tHte~q+5O1~a{FBHf$m=K&5o)2%{#MG9xNc?Rn-SnvC{Tj7!lC(+gtJ8YD z7W`8gHA6d-3zM2{U2;96$H(D$@n!f$yeQriWu1PA$F*qyH@#|Jl+Tmb>c)Dd&s*`G z&G2+Hg8j7UY?9+WUN!qPDbJDkuVkM_!B*buPd}6pGAn%5?DVI-8t2J(%4;`zShUq4 zj!|y|J)Nc6@0hC^(r$~6-8f02eqJq4>i^{RhE1QFQPob&nMJF)O3azI?KlT*^z@S; z!M<0), with Reserved Font Name CMTT12. +% This Font Software is licensed under the SIL Open Font License, Version 1.1. +% This license is in the accompanying file OFL.txt, and is also +% available with a FAQ at: http://scripts.sil.org/OFL. +%%EndComments +FontDirectory/CMTT12 known{/CMTT12 findfont dup/UniqueID known{dup +/UniqueID get 5000833 eq exch/FontType get 1 eq and}{pop false}ifelse +{save true}{false}ifelse}{false}ifelse +11 dict begin +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0 ]readonly def +/FontName /CMTT12 def +/FontBBox {-1 -234 524 695 }readonly def +/UniqueID 5000833 def +/PaintType 0 def +/FontInfo 9 dict dup begin +/version (003.002) readonly def +/Notice (Copyright \050c\051 1997, 2009 American Mathematical Society \050\051, with Reserved Font Name CMTT12.) readonly def +/FullName (CMTT12) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle 0 def +/isFixedPitch true def +/UnderlinePosition -100 def +/UnderlineThickness 50 def +end readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 45 /hyphen put +dup 103 /g put +dup 104 /h put +dup 105 /i put +dup 108 /l put +dup 110 /n put +dup 111 /o put +dup 115 /s put +dup 124 /bar put +readonly def +currentdict end +currentfile eexec +D9D66F633B846AB284BCF8B0411B772DE5CE32340DC6F28AF40857E4451976E7 +5182433CF9F333A38BD841C0D4E68BF9E012EB32A8FFB76B5816306B5EDF7C99 +8B3A16D9B4BC056662E32C7CD0123DFAEB734C7532E64BBFBF5A60336E646716 +EFB852C877F440D329172C71F1E5D59CE9473C26B8AEF7AD68EF0727B6EC2E0C +02CE8D8B07183838330C0284BD419CBDAE42B141D3D4BE492473F240CEED931D +46E9F999C5CB3235E2C6DAAA2C0169E1991BEAEA0D704BF49CEA3E98E8C2361A +4B60D020D325E4C2450F3BCF59223103D20DB6943DE1B57D05DA0555DF933BB0 +7B42D264831116C06C79335D519461E7B0E870A6715E3D74A08D1BCF86E3BCC3 +A43FC6BAD1C68BD9D4AFCC06D845FD1F1E70D7A47F0BBCAECE8396E04591E5E3 +4797F646AFEEB7DB548183F0B74C9BB6BA2AA04E7F5950EC8AE97C741D4B2C5C +A8E7A8DF5A36A30B5A7592D95E1DBC63EF33C92FE459792CED29E2B8B6919251 +75EF62089BD7D44A6E1F9B62EC802FBE62B821DA1C3B2DDED45D27964AD29ED0 +9FB7868F3A8FEADA87A8E42D52C1EB7229D7C79B60BDA263F2BDB025AE14A507 +098FA274206BACFB4A0A7257D5998EE8F0FDCA79CB61DD1FC59DADD11E16BF02 +ECDFD706CDA1E72054D4EB55AF7BA9F19955886BC0BD6E0E3FE3769C94AF3581 +DFB2BCD67FE2892AF07E858A01280194D8DD7332B3D0A585C87FAB056C2EAA9B +5AD48D1C9F00CEF8EF0D1408DBE1C03D04B231D7B8D5D998FE0CD7EE19828EF2 +F988EBF6DDBFEE00F04A4A1F4E1A55DED7EF3AACEAB5005F1962C724A017C914 +2936E2E0DF26A55ACD7DD836C6035CBF07981C1BCE3615064F0540A1034C69B4 +E3908E76EF8925D486DF0B4A8E1F02D8AA99585A7C31847AB9382F83880C1C21 +C496AB2DF8E7BD4643B28B704B5F6B53429D3EE940A79135F5BF0396E5B46F23 +42AF406C26D12BEA7A41F332AEB75DF43C15334CF4651A99F602036946B1B91D +4BB0D2E51C20216D892C8173241AC8FD15A37C3CDD8AB4FB67D8565AFA61C068 +95E3D6E46D7C09BBD09428207D506AD43C693F3C3D787F6A5C39084AE45E81C9 +830900DB50DAD10A17E118FB5E9680B5194716A788FF7514A1167DD1A305FBE5 +5925388A2E95AE46E8806E0F7B954D1A9F70EE29B069A9FEB0349298CE5311BB +CAB039C21AEB714781BBCDBF2FFCBE7C4750D7693ED142ED0475EE9DB5D5F94F +4D4613E2C379E494464447C4167C625D70B9DBE4756DEF299974B704A3C238DC +FCD3AD96645559ACA5056F7FD695D2AA709960E30F055ADBDCC7FDF641920A9F +A279AAB98424E76D01937F9CFE3CF4E3779650D7C2DC38AB27FB81EB16C19B13 +D47E0AC60C83641CCC1A00136625FE274C6AC706B516CBF14C54000BC2B7BD20 +A28D40FCD6D9B321855BDA608E23BD365208DAB23983C0D8A7C9DDC28ED62216 +12A20A3068D843B5FA016B8C6B9BBD36356BF85A128F96F0CE861FB9C998BB21 +E8624E3DE453C686D41DA7B72ABD919C5BE2F24440D11962C77742A8C0115A72 +9E974E71247FCD58318A4347813D4D5A73CF882A7513E2EFE05CE8C7195BDDC7 +DF250B59AD14D02D2991E2D0CF2D0022EF52D78780A34D2A5EBDB458198535BE +8B67CE5E1C9152A21FBB14C4E72828182A77418DF5E3439ED90AC7529AF0E761 +A8FF0676364C61692CCAD317817EDCC17260FF7E2BD3FBD5B6BB078C8D5E78E2 +E2344C0FC14382F41601EE374DBBB0C2465AED57BC4ADF0622B22B2B9DEE8A65 +41F49237821D3C04AC267AE38B4847CA255747D41718122F35239FD328634281 +701854F90CF39734734FD82C4A893B68CA3DD5F353A5416BC710F8B627AB30E2 +CBE1887C4F4A8892FEE7FEC1FC2FD27005C3B416E3146D5C0F157710504DD523 +DD7196888D0DAD10D8BA80034973346DA10C42C39F13C7A1CC3A206874DAC8F4 +FF91066FE31954D26803547C6D73CF884ABA4E9919F94C61BE31389F338670CD +EDD348C3147161C8A013BD73075E9D5453BB63F0D1C1FAF2D3508999293EFE73 +1938DEAAF8E9912B570CFA85337C0097B65F0BD87BC2985088EBC9C82C603762 +36C212F08216BCF7409C3C0C45EA3B3A70F355C88B00991913B8B37B394A51B0 +F31480B8864B519B46A664D84DA0DFAA5EF761088C8D753BB68DEDAB413082EF +A3D13D88404B22353D13CADE3FE1A4C4C84B22D6E01883DB55B1070FF8DF4AED +629BB76EDE1DCE72DD5E67DC7A65A823BD897435159D2A19EF6C1B8140DF6FA3 +B134DF24C97EBE566E371DAE070410144971C9591FC918AF87D5282DDB0B5646 +4FEDE6C79EB2442F59D3C9078750AD6BC35A5ECADC438496B1AD5DAC09445A54 +7DED15E0B678EB9310B3576A4962D846B405B019F7D9601A0435B34CEDB468F2 +249228EFB45311A50211148FBDCA8141406B7AF8A7F1712E15149114134BFB10 +D10CF434EC53D2E1482B3CAA38A50F3712C0FB9AA1452F468595BAA7C16BEB59 +B2F3C6771FECA7C8B2608C37FBB7142D61F31E86F5B712FE3B7DFB52153C6CC9 +95AC0DC8764DB20787FC4366FB90441976CECD1FF9D4ECB82FBED648C292401D +DC2B6A71FAFF6D22C8FAEF0928C7280E8B0DB146EC742F8A479138642430AC85 +F6933F11D5171C0BDCA8DD5155489C4E9066882EDC00B078108B4A3C605C165F +184C4198F9FCBBD65FDF7B7AFED6768C847E3C5E9788402902976DBCD5FB3CE3 +3D592281A1B5A17F0E648ED88529D43D525DF5FD966F9707C264A5AA7F703546 +F103259FC2F77CD379FF00A34BE6385EAA9DA5A06C7801F000EC795747997CC9 +C31D4EDA25CD2037DBD53DA48F51FBB2A757971D33F0C3EBF1F6B051F6D995F0 +082CA7139AA8C990D10197A25C613C199A634B63C5E8B8EBB91272F510D13162 +47A2ABB34D5741CD9E45022A81934C3CC7A8042BBF28A3E9BA7718E08AC91E35 +9C1864328AB297AFBF2DD62A13EE850B12DA21E621AECFD642FD70A42520E854 +9BC128C75DAB4B316F3FC8A944E6102B2F6700FAE355319F079027274E610266 +83C4F35A4FE9689BE48536E93D0C6C5F6011707F95E5DAE8DA8256B7CC81F688 +4184B8E96CBCF86E99E515AF5F90B209228DB44EC8618D12F602591F010A2669 +2BA8E81C1E18161D532D0C61DC696860227170A05406A52A6D89BF19FC952FF8 +D47D8E6333C1828A7E7E3B8BB1C7A85C35AA50AC0CC070E540D8F0BF951C6F87 +4B8A4E41D65350806F04B06F3F98E881649F3895D83A27B5A4F2D4DBC8EC483E +5E43E196A6448A82B881F7EFF91D6C99C287E3439C5E6ACA6A53070CD1FA6384 +068F78E11E6F596E080C84EB0CD85422B46339CC8B5598D0D699C506ED02884E +3C9B9EE27357AB5D42096F +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +{restore}if +%%EndFont +%%BeginFont: CMR9 +%!PS-AdobeFont-1.0: CMR9 003.002 +%%Title: CMR9 +%Version: 003.002 +%%CreationDate: Mon Jul 13 16:17:00 2009 +%%Creator: David M. Jones +%Copyright: Copyright (c) 1997, 2009 American Mathematical Society +%Copyright: (), with Reserved Font Name CMR9. +% This Font Software is licensed under the SIL Open Font License, Version 1.1. +% This license is in the accompanying file OFL.txt, and is also +% available with a FAQ at: http://scripts.sil.org/OFL. +%%EndComments +FontDirectory/CMR9 known{/CMR9 findfont dup/UniqueID known{dup +/UniqueID get 5000792 eq exch/FontType get 1 eq and}{pop false}ifelse +{save true}{false}ifelse}{false}ifelse +11 dict begin +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0 ]readonly def +/FontName /CMR9 def +/FontBBox {-39 -250 1036 750 }readonly def +/UniqueID 5000792 def +/PaintType 0 def +/FontInfo 9 dict dup begin +/version (003.002) readonly def +/Notice (Copyright \050c\051 1997, 2009 American Mathematical Society \050\051, with Reserved Font Name CMR9.) readonly def +/FullName (CMR9) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle 0 def +/isFixedPitch false def +/UnderlinePosition -100 def +/UnderlineThickness 50 def +end readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 12 /fi put +dup 44 /comma put +dup 48 /zero put +dup 49 /one put +dup 50 /two put +dup 51 /three put +dup 52 /four put +dup 53 /five put +dup 54 /six put +dup 55 /seven put +dup 56 /eight put +dup 57 /nine put +dup 65 /A put +dup 66 /B put +dup 68 /D put +dup 72 /H put +dup 73 /I put +dup 77 /M put +dup 78 /N put +dup 79 /O put +dup 80 /P put +dup 82 /R put +dup 83 /S put +dup 88 /X put +dup 97 /a put +dup 98 /b put +dup 99 /c put +dup 100 /d put +dup 101 /e put +dup 102 /f put +dup 103 /g put +dup 104 /h put +dup 105 /i put +dup 106 /j put +dup 107 /k put +dup 108 /l put +dup 109 /m put +dup 110 /n put +dup 111 /o put +dup 112 /p put +dup 113 /q put +dup 114 /r put +dup 115 /s put +dup 116 /t put +dup 117 /u put +dup 118 /v put +dup 119 /w put +dup 120 /x put +dup 121 /y put +dup 122 /z put +readonly def +currentdict end +currentfile eexec +D9D66F633B846AB284BCF8B0411B772DE5CE3DD325E55798292D7BD972BD75FA +0E079529AF9C82DF72F64195C9C210DCE34528F540DA1FFD7BEBB9B40787BA93 +51BBFB7CFC5F9152D1E5BB0AD8D016C6CFA4EB41B3C51D091C2D5440E67CFD71 +7C56816B03B901BF4A25A07175380E50A213F877C44778B3C5AADBCC86D6E551 +E6AF364B0BFCAAD22D8D558C5C81A7D425A1629DD5182206742D1D082A12F078 +0FD4F5F6D3129FCFFF1F4A912B0A7DEC8D33A57B5AE0328EF9D57ADDAC543273 +C01924195A181D03F5054A93B71E5065F8D92FE23794D2DB9AF72336CC4AD340 +15A449513D5F74BFB9A68ABC471020464E3E6E33008238B123DEDE18557D712E +ED5223722892A4DAC477120B8C9F3FE3FD334EACD3E8AABDC3C967C61FF003B4 +B10C56D6A490CE9594D57A2D431B9E5E10FE3D8832E227A7087611431ABCD029 +85F4865E17E17F8CFBD2CADC97E0A8820E3ACEC873F31464466A9545E967E53C +DBDDB8478E69063FBB891566BAF88B7660A4405B16834761F041CCF7650AF955 +F9E853AA9F5F4382E1FE7D0C5BB4023818A2383F91249D48CE021250EC9EEB1D +2835E18FB73026250B32A8849067D5E2258797C917F998F2D4121D96560C5FB5 +B5D3471216639A8671B6DFAC5E3554EC36D9A72518525A795590C74DD70DA3A7 +78BFC43E51D6F2BA52F17D4DD00D389D3983EC54912AFF73684A8A7E345537B7 +E62361C04A47859DA084BC72EA53512DC54132EB2EE671793603015652EAFDE3 +41C4B6B679BD60AEC5153EA0D2200CB1D097DAD770F5F31E6FC475A225995277 +B867B731D5401E2D02B85BA85158C80FF7E2BBCC42B98AC867E67D25DB656072 +55A0D32AB7AA483A5A9686CEA4E2B3031D90D84DB3E2DEE7706C91BA81CB8DAA +700E5F61E07D6998C9552C81B66FD10A10033D49EF3BCB0FF22ED0A3737523C9 +8F851C61C4BF8A213BF6EC70C956AE48B5BD276CC0437C72BF6515B10739919A +F00F6ADD2798CB211668842349171A5AEB0664D2C44397E55A4A9EBDF54A3EF4 +FBBCDAD9DAEF4B0CAEF7112FA828F2F8D9F633D37E5516AB5ECEA87342EF8DC4 +3A50548490F5BC9A8A1F98AC7AEAD9D913BFA10CA86D73AEB5BACC1FEEFDCC15 +B3655522CCA2C772E902FAB2A6FC153597D52763EB44AB7489FF061F7F58E8F2 +AEAAF4D17F36CBFC00D3C653F335D14240C87DB4339DA9D30A5BD1F502BC9013 +461B9DB2FBEEC01BB18990439A0E9CA6576BC9CF6B1A3DB9386C4A5D4AA6A5DC +CFA45FB75F22E10ECB72565DB441A194902C91427B4F676E531C661F7A2C3C85 +CD534D1C89B6779B2EDC8E44667B992C20C70B663BFBF680A6CF4383EB7CA26C +4D1F06B5EF4025BBE65795F1EDB5CCB97050872D6C07BC2974F905ACDB7A765F +291365D6C8152153E7F017A25FB4476C60FD9EAF9A121633DBEAC32F62850223 +D6418566AB350F90F4B35F19598478F76B63E347D4C61E203D4DB8ECB9889181 +C387F4B663A502C638761D2782BB96EAC81A0108D7BD6938F67FEBB69218D115 +D8E89CFABCE15C6ACC7FEB983332A51A6A73CF4E341574F366713D7FB29956D9 +9BF238A87483D37E526A2EA2F101EDD34E34CB92730DCA7235AA0027189BE405 +2DAB4AA021A30C28B26C50808E1E965C02F6212EC7C72F5683339425A7739380 +A422E6191ED8453AF0CAAA424AE44DFA7CC5C2F6EAA8D73A5101D8E9517DBCFB +2858D0E8ECB7DC430EF23A9E4428CB7DED8D035D6050251AC101A2D0E884721E +2F21E573F948048BB8FF888911C508CC198BD750083B339500C426AFCD5634A6 +AAAC1C7E91249667B231BBFC64B4317192FE07FE9DA0DDB5E517D097AAE46577 +9555F29D45C67CDE9812CAD03F220B20519F2FF32DCA56A554D4296FE2D1F3FB +B209B5270E0E695EA5A0EF1144957CE045881AEB8D05D72CE57F4D34617AED67 +0D3AF0472CD8D60933651626550366E300E72A9C89ACD475C2E2ED9BD44B472D +9DAFE943F8E02A6DC38E447EED964624C37C3130E48211CA279BB6A0BD59466B +42F3D89B5746F29E084E22CF58395AF0F29E55113F3A3F2F52CB3A6DF3D026D0 +C81754B8E2E4A15F6943BE9D0087D5166060734FD07C4C57D7C7D90E8C9C1F35 +623CEEE3ABAE75E1A18A1E3B50B7266BD2D8E812CFEB4A46B856885B185640D6 +B9C22179551002B94282F57FB433B7FF157D2F0D240836B72AF4A331668AE5D4 +E6B85415F4E8B9D2F9AF90FAFAA0A3866DF417CA5A31348CF9B41B8F5F4D2F97 +CCF7ADE851B5E2E2F6E319AAF5792EBB9DA2C6AA8B73D889F3CDAA42932CDA7D +07A7E59183CD89520DDFC36E5D513BFD8AD0886046585F29B4D7F42CC0C27AA7 +53915AB1167D292FE91957E94A57FEE2D49C20C9070ECD736BDEE0F046E60350 +EA539DC298156A4E0D019E7D481FDDA6861E20678516AB80ABEC1F09B126BCB9 +52E8272A06BB6DD87ACFC423B4A4FC9A3DC8DCAEBB807C5F748F1FF8B17B8B88 +F426206BF1B7B7D239D26BC3CF0776C467A98CFBBCA5FB6145D5900137ED19DC +D002F10704AA680EC753C22E29AAB15712EF22AF73D80820A1EEE953463D4EA3 +81FAF99518D4FD0F862A324FC44C4B9542A92C5B60CC983CC8F647CE5BDB4D6D +B92B380E0E5F7208A9CD91FA9A469548162C761C1BA05AC9D60B766764D821B6 +B4E17F56CE455F06EA1EE2D38FE47581746C4C5FBA63AEE2B58E877D1A8FA83A +31C972D53B64E92EEEA147426A92CFBF76FC614119C6E9C6476FD6A069C803BF +E949FBE50B5AB1F1463F9747E8D353F7BBD991C4F90F920BC9407D8E24720293 +846D052214E60390C3CB926D38C83AF697425D80C2B4FC4706615B905516B733 +46ACA325CEA68FB21B2D17CF0B68BA4DF249368625CF83441EDBF2B86C957C1E +44CD722BD2537CE84FBA07EC7AE15C840041B9F7F3040072E6084CD55B301C08 +A64A53BD4D3DC30DCAC6C152F316ABC59B8EE978793EBD568849DCC2A75A495A +BC83470D503F8E389F54B4A4A31624E83C601B43AC1E52CB811FAA7CA6B644A5 +1AE0BFD4FC774C9C9DFC2769ABFA9C83F900BE2DD4010416053A1D4874E6ECF4 +D86E44B4CAB15D53E5630C144B0C15B58DAAD785BA298B1893D1B09BA5D40344 +6678FD2D17FF6674433C976D6DAC659175CED26139967C9B2B9CFFD78FC2570A +E5142141C2888DBF2DC8503F9137CE7CB21A1EBC2D65BF33FCEFBC85C9CB736E +24E8595CE934AB032CC70BD6A3B0F3BDBFBBE185512FDB7BE3D4A6620478453E +75D044BF770B44C9741E31985E6DAF5A318D7BED12B02A4BCFE60D25EF12843D +EFC9BAE2A3F2EFAD66D7858E83EB46BB09D2FF8AE9C43844A7001C86ED97AF51 +C511E3A89A1BE349FF5215D1A57843EF51456B9838133846F19BE79AAA5C1AB0 +5F400E5E8E7B0BF96EFCA3B8F0894BE589F2C9FB6C97BD16D38F0A237CD4F034 +099C41F85C7E2C7BEC8E02C4F327306A53B4B48B26A8926670CEEF96F6DF2281 +7C2DAD99EF8B81BBB777227C2475AE7400DC393D9C0445E925DB1E955950F7AE +53E9AC4306794239346A419F7B5DF4168382EF5956B81F83BD4BB7635B3BCC84 +7D84D05AEDC02D14675D777CD19B08124001A4F4EA96990D96000C082A12F00F +7FEF793A7FA69D56D3A38D012168C5458B667190AFE80E02C816CAFF0A71953C +D80B085CD286027E2FDBB05452AA762FD7C813B2E19A79C74190E04E746C4933 +CE1E300CAF5DD53B08110509BDA404EF07FA1BC5224BF1205DE8E0C3276A13DD +866675103B960C5F36644F96B4FAC16F5D6E91F74629B318FCCC8E8CB13EB76B +B0B7B90718D913A52A04732EA3667674994A325A7973C601A7DDD50F658E0826 +ACB8E53D4914B0274AED98D7BC3B2B7F9D48A7ECC2F8ABEE05CF2C4F2B90360B +B7DF779EAF3E103D1D83EDBE32DDA873768D8C37DC10A5354A94B4153049AD64 +FF3E0BB51AB91D7C0B4134D8731CD0270DAAF19BED9EAD800A14B65B68EEE89B +40DD624111670DDC7C030DEFE0D1B96420E249332445C155BA96231C88E70643 +D526BDF3CA1E05FEE72CE2B881CFC01ED780C10E89F0828AD55FE29043BC56E8 +2750A6DD15AADD54492F6092618F4CC6A31766B17FC60766D18C307EFC9BB787 +39047DAD6B38419EFBA46B4E2C932F97451FE78AD75FA90DE409FC6DD46585D2 +1941F5ED47A8FBAEF5A917A240959E8D9F9917DEA3247D9CAE6BF7A88DB4C4A4 +F9F5A6DCE542420A032FF3392FE0F3357B51F884D6181583A554F75B1DF192E9 +253CC828FF06B0D992D5316435980B044BB191508C7C45CD90F797F88856424B +14A5707459C50EDCF3E3D8D1667AAA83015405354CE744C66D9A5728F29E0085 +6DBF740717FA0799E3BCC4ED7841588B496A5E549B953A7FD288B4A045DB611E +E3B2F35963FF18ACCB1C968BEEA2CBF52B3999AAF89A05320BB2E97F52CFE06B +9F10E3A79865A3059A957F97972D80ADF678A36E2B586C101FC6AFA4D137C13E +EE7102C9B8EF78CB057F8B7476F146E8FF5C897FD5503DD198128CFF7B5FB339 +FAD0AF0EA967F77B07B367A4AC9F668F8BED99B98E87FAC750EE045602D76C3F +289FC9D97694C96AAC0AD1BD3FA94DF2CBCEA24B40F47B9B59E54EECEE7AC4C3 +A3F5D19160E4C1EA830D57FBE10D8D46AC5CA0260F22FAA45236F0F542BEA9C5 +5A88F878F68B36114E0573900C65E305462B22A3429A17C7A567694414DDDA46 +5F30542B8FD4F00F6C295B2E8D3A986B953D96822DB2ECD48E8BB1763434E652 +152EF3717F5E7FA10FF0B01D9F64E22C5DBD7254629658887BACEC0ABDE972EE +67299FB84A05B3EFE22B6976DB4CCA384232DDAE38C31623A4E39EA2E82C1EA3 +BBB68F1A7DBF405DEC37CB7203A895C36A44BD2D63F45B3888AF91D37B510A59 +3C921BB44DA620892AD87B665F69F6FA510B071ECC403CB2BE2F54B3969C9E88 +713244BC97C1466DA8216DA7600C221E7E7EF5C789D2E12B36422023A03E11BF +2790FD6062FE6BF62F5010A92F0A104B76E255A0975E04F6F20F760881BDA7F5 +D834D1D328B6EC19AA7D5E5678A84C74C82553DBE8BB5765E84F5A8789032143 +6020940B4B8D45FC3433D356E28C25F42D0C19F911213D85951B2B00D01B77BB +A4C72E964F9D95422BEDE582A05CD52E03D28A996E6CC8FCD910CBAB728073F9 +F9FAEED5470FFA55930447C5BA816F826F983D53EC9941EC8364B3060FD74C95 +26D4F5CA753B574FD2FA4D1D333785241D8741B79E628BC852FDC35478C5ED9A +C1BE88C5EE7302816E65C12B58EA16FEDD4672EB3E24B6EDAD5DCE263BA8A970 +350B651E5A9F3C281D85BC3F44EADD0D93402E36489BA5185E7D388974B0B700 +70575188BB610CCA20F081E2CBDA13DCC6F72567962ADB342E02C1E763B673C5 +F7384E24C6E1730A3A790D690A2103AEF88E0C1D4480DC9B25E5C8C9E1919C95 +F83320179B4C7C4A26D559BFB24D7D596FB73758C9990C451E77FCDDD17763B8 +9C30A9534E3CB6680D3D419D4B70B0B0A0D160FCCDE169714E373F65B7144CC2 +DB9A44E041211E1517D3148E65A2486CBE5E74E625261CCF65392FB4F3091473 +F9E8DF327D59A58558E5C9F7190DB577D5DC658F5E36258291C708B3D224653D +064BB6079F91293FC733710893AD1C96169B30CBFE4E9D52E7EFAE4AFEE68FEF +1AFD5E7E9DFCE8DE332B0FDC0514F9B3090AC85BBFB527FD8034DD33E9576325 +A8769AE09AF1BA792447DDD932B98FC9486B39E0B04DDB3EFB7A30DA0940B33E +E27490E0E841E87B1C90E5248A91742ABEDC10F43A8AF0F9C5B4A4930B1AADAF +01874B9AC3B8D0DBECCDA6CD7E96471FAA15CB7F8A599C5746327CE392224C3C +40BD60AF97BCA6FF6FCAB2FEA114D7300B89E91C3BC92D5B3E2C83BB37992D8C +72F661EFD0AA034C738C019DFB79BF40651A1A34BC1EB9F5AAF58F8B3DA32645 +24AFF8636486F08BC21533B5FF7391B0679A78DFDCB03DAF6BB7475A1D51DAC1 +EE4BE9B986655D1FDB6936445EF99B58B303FE79F11275EEA96A9F6808EA8775 +D873D1052FAC93769789C700F20EB2ED6D15676F6E563A769CA9298E463FC311 +83281483B1C953370D196727A6A0E66D32D9480AB1B6DCA77868C1A2D5DB6483 +5F31EB6B18EEFEF1CDC31533E69B0AFC6B30FC9912DC89BAAEEADC30BE14F448 +1A6B70D36A5D9B01799BEEA686066114910842D022EB464A9A1E8F0A5628BA69 +AA9A1925CCADD44703BC67A89F3B48E4680726DC4360274185CF3C8AB747A8FC +4B928AD62B092EFE48B01E33ED756DB696171FDB775396BBA138E056F71EDAE3 +7A1E4CC272B8418114B0E81DE0BC43DB3C133167344488820A92DF10FFA26FB9 +65FCA2C87D302E956DE6B4FE145145440C83DB43A68F8B29A592B127BDF49063 +B7F11E155CD4CAE305525BEA56B7C412A6260426407BD892A3F2B444AC3421E6 +FB6E6425EB5C3053C5644666B80405530FA0012B54557327C98E0F4F064099A6 +4ACAAFC1870359C1B6FBE7606BB8A26026AE20C212210449905E628AF1B20490 +8CE908B7EF3E3DB551C85AEB0F7FEB6A8D215B97998E5DD9C7CCFB2A9402B8B6 +1770D4023777D4B45A73F471355353412C51D4CE71FAD1E0AFBD87B5F86307F3 +10D0B94F1194EFFB64AD5DA54A4200490F609CA8B912E149F8217ABB1E9EBB3B +C4470E7365CF5E1E761AA1945044B225BD53D142F6588C50E0644740F7DD55E4 +8F73201E5354A8BC78339211AFC4935F44701FBA043AAC4BA4698E9D7700029A +C79F992F62627C91EB855F64C4B251718FDA71EDAF082A0C7B00550949D617A0 +7071FB14F05620CCF2180941341D8E60FC88823438FD728A4042AFA8B853107F +852F631518B61B234565291B5D5B89DA818DEE3AE3B68A2869DFA63255CC882C +3B16BBA08FCE3632E57FF7A07F857A1F0FDCADAB39D77960BD827CCC8661A997 +648BF5BEBC0FD2286C2A112A8DEB9CCB6330A049170D5D68EEEEA011D3EF3EBD +855236B9380087CBBB6BE24191F728B7EAC5B50F7A547AA0989B7C7D3437DBCE +1669341264E290646F2C8C5A3ACAAC7CB63DC692FAAE13E9B40E8BD39FE16A0C +1660CE66872D061056C04DDDC265C024BEF8B7E3C3AEE76FE5C9702002C28BE0 +B180295EE00E567FA2E5CD1638226D24A7C732E1BD8103B476EF5702768689C7 +D4FCD47F2AB94A2B1FBAE6ABF87B09E7713C773FB65CA83F7318035B332B9F99 +24A2C8897527021321D003AAD7C273E4BFA2710B9BB26C2CFD3D9A5D7ED1096C +552D50028AE2476FCD6D12A5D0A897521313ED1A3A8456A70C16EAA50A3E6733 +6DC89FEC56AB54A579EF264377A103939D5EE00A90B4F2206D0023AF9491FBE0 +800C6540FC945199E20E945F46CEEA2E885F6800B9DF042BCEF4291A4B1A62C8 +6A7ACFF872B25FA3AE69E0093F3D0FF13A3313430C06F1AF94D500431566F659 +E8C859A5F80F5BD2E85C8E32603D3745628E8FE6FBC50FA68F9C3811A2BEFEA4 +5852CAE2AE5AAD3230ED050593BAD0A9581EB7B327C6916B8FC348F4C23E6FA2 +00FA28AAACCB3091C1D83F7BB88672A53A2EA3B8C7C24374E400C57F0F01019F +E52D5C47F389D4C9AF126F4080F9AB8D1C8F470932BBECCEC72A9796F6E965A4 +82057DDB43D68298A00880D4C2E2496F26F015FD83C5549215753459310339B7 +6B2961EEEE74DA31FEC8E2BDDA42D4080A32372AC372524BDDA580EF6634ACE3 +128C69D04D890DCA337212B109585C665AA83EFE47D5BABC2627A86EAD11BF7D +744176652C7F9497785A7A06A994ED8414BBE8B26E74D48CB83FA24AAFBDD507 +84A90195EA3D77BCE8C2BEDDD1DC52E8164DF15D65B916EBDF3A8A76849653DF +AE3CAF9561AF3B705F75B9E5DFD6758DB65A2FD54683759912E0D0035CFBCD86 +5C7018E5F1DFB86B739C4749DDCFB2F40529E1F15174DF4AE9833958B66ED869 +920CFB9524F05AB2FA84A4AC41A02490699F277A3B4ECC3C31ACF79E884B979C +AEFF660A8EEF118C79F8DA266F89F32078B1C333DFA5264D6B64371276ED4DBD +5A2DF213D85A56B1CA85DEA53ED0299C1FA48D463B11FC9A0751C986CAABB184 +829B1133CA8422DC11C6CEAAD463FEB468FC7AA2DDBE2E708D27D89164B12BD8 +B9A71A1D06D2FA9ED0B02168B32F6CC0FE765F2AF8A19C7196EE55648E642184 +BDF993C99EF7C10AD2A7962DB9B7851E6EE24A0C53475186BB44083AE18254B9 +F1CEA0B66A6581C81DE19DA8EEC9330A030F3384C1DF8216E5A25FB38C1B94F3 +403C3541593A016CB5FD306F41F40E82D4561EBCBF76153BDFCF338284348755 +0208360C5842FCD6B2D614387575B6E49F4B5A4DA281A352ABE8B76CFCD94A00 +1C586D19B68D965BD8D7EF0DC87271478CB4D0D1633676A2FC51B36876002A9B +F5D632ED778BA9EA1C3741FFCC15AEEC11C8E1544DA7358473325812E50C2135 +84ECE7DCE281956681179C09C0E8DBAC5E4424AAD00FDA269BCD6412F1D6DCE0 +2BC7CABF85AE803D620F5140C63DAC4B0E5F7896343973FBB99486B93B6DB58F +38ACBE8868CC58B3918C1AB4406FBCC7BE8496C78C9D628716BF1E306AA802D4 +5FAC522B1EE90448387DB8E85235FFAAF3754E2317B693D567A488753993B8C5 +DA3C8FA50A35202958FD0BF2900A6CE175920C2EC7CD449D4DB189A50958BF17 +644345CC38250088A694CF0F482ECC55ADCD02E17B3CCE66213A6163B8B44C9A +89068E3B5301D2364F85BF9DF7C77342796363A7B6B294CE26DBB9179DC15756 +E1B32CE919AF44BC79A3AA8FDF6118345B2AE03F3B11D57D9AF50EBCF7152E37 +15510FBF60F16756FC674E2BF58E88CAB2CA2E8B47F50096C51179684331FD61 +8B34520C9C7D01E1511C924FA76B3CAF79501E0AA2C6E1EC6F00CB6CE24B4123 +F493B149B5A5147EF6BF1EF3CD21A76945B95082E1FB3C5A150D8AF793348E8C +A988354FA46E3775486A6999E022EBE293E8396C8F9416929607730606CFA772 +BC8388BA5D64B79E52DD2048ABF21661121A001E6A75731B5DC43CE040396BD7 +B85603C8A0F37E522FD0CBA63C454B12960451CE65A69F98FB2FDBAE725C0999 +05FB68B4C1D320F5F3D61FA8446BE6F8BC46AD9CFA5674A3EC73B8F3419AF9EF +7A1A3C9EDE3BD6359902D4B5F3AB4E3FF9CB2E1937937AFA182C651985703F20 +FB70E37AADED6345EF4E83CB140FF92310BACFBDA11F2CD5AD93AA7563D7426B +0D4B6CF9B669F9A702956CA845E3814E4B5491E58F8C89714229942165A6E8E6 +58982D89C4FA7BC557214BF9ACE2C63AD88F2D1B18A04F510211687C35AA1F7F +D2003D4E60400B95E70422024A7111D926F1B5A77074910710594B95680CFC4D +911FC16B928D9644340A9D2382767FE6AD453E8E4CBF19F77D3DA2934B11FC95 +A6900C3CA3F2B6AE4290A005F908305CB37700680D76C4999AFE509B18305D28 +88C36292D6DA208A8D42F8B81FDEA7E93EE59D6AF3F1A3522EE91BE71BC655B9 +79C49B033A036E1FCD94FC581AE732A224F055503CFC69FBCDEA39CB00DC8A0B +4BEFED99CFC4E44ED51DEDF9EA825FF6BB97D316726531CB4BA083B033C0B69B +8068D5D3E3E31DED5F6267439F149549A6E12B00BA85818AEB491978364D9F7D +7375CBD6C5511CC846D0058BD2CE5467EBCEACE5CBEB2D33AC8E12A84CA620EA +99A0ED916B7770A056F6A9C361CD5118B5DDB10A5A4E643FFB8FC5DCBACDCB28 +696E26D030C5918548AD8B87E21E1B4BAA91AF23663CDE350A21C2CEEFD28947 +BC07BB49404FA39F251E36B95B7338EF03F2E63FBE0E023452097F21931A2599 +4EBA7BFA669EBEDC0F5B33375DFE6DB1638D19D4B5112B5338B14C93F707D340 +056B2B75AFE418EAF9CD57ED842F7B5FFF037B3A4B369C63E4DF9F0BDB4E39C6 +C5BE8EDA628F1C6FEEBC9D9886DBE502CCAA86092646094118069757DAC25C38 +2CA53CBA27577BAF2C57196489CBA54B96C650A1C130184A4444CDE2D0CB1A49 +FADCAF1FE3A66334F85FAFB00F142F28AF2D8FEFC29FE8E0FDA448F181040BF1 +62EA7AE75100BA46B49EF30F596CD9091164AF70666E254938BF6A44F01BBD2C +4160164FD89FCD358E48908BEFBAAC4411B52390CEED6B46D729698CCA8E164C +F77CEBB50C5254F81570E414B1E9E79269D3B2575E161620CC732C0405A29ED7 +1E5A6597D35B11EE08DC09FC9C27F0126C22C73A0EED657D7F91790777E7D8B1 +EBAFB0EC9ADAEFEF7F6A91A1028E46D76289EB1BC15D3597CFCD78D88B633759 +93CB4477596E28A1E413BE25D513BA611757C994AE812C5A6D9AD3F770499252 +C7F53E585E03B2FF056EECFB7ABAC474A981D757AB3B6F281744F01713782887 +9BE48307BC5516A067743C054A3927E015AB0B2AD2D80D229BA32FDAB660C3C2 +40DE8C83E1E4941B8D765B879222847F855960604EFF94E9D99E4AD0FF2E887D +54DB39B984A9E9F69ABDDBB2A452661703841BE79200EDF24C4172D736B461E9 +8BC314AC1CE1650083B18B2AD809B5F2DCB314651433E357042A8AA73A184D38 +290AFF0443C4A293CA6F04643EA3C313FC6070D76400B0BCCEDD20B5F0A67200 +01584F0062794AD3D82C83FCE4380E28312815EE20DF3DD21D381046940A8C96 +4DFCB07E5A558DBF1DE489FF4FCD1C851A597B0EA58604BD16DC8FD89B9E70CC +36F99E8327E9112D98C1AA1C355FEC942E879C3CF8C358FE955B1E2518C81270 +9BBB3F4BDDB57D04685FC0D90AD3566A81086B3BF196B2CDD42BD1455F588342 +C817CB9E0E75A0A24BE751B46DE8DC974554DF975D02864773F2EE856A0CF595 +0D614F71A1AAF4A72DB4E5896AE9C2B33F993C006DD7F644DD1B3AEBBF34AF8F +A809C51EEF38E3912E82F7F15F4DBB9D6E5D7974B1B871AB3F3A48B72F0356DF +CAD862D11273580D1BEC9E88931B7B9C74B8AC3DB5F3B3FA05213D3CE48C0F2B +237A7DDC33D850D1B2B5B8CB7CC1A1A2221451FFF0AF88175EEF18EB932F47FA +9A8A97F92B6E2A01CF8BDDCEED9E1776A1A3D4328FB7F8537689CCE7F145A8A6 +2DAD7C9C23C0DBA934E4803FCF9E7C292E67D748F972415E62E56B60DE016930 +B82AD792313A7D1CE655B0E08076AEE57E1BA5FB00FA2B264771507126FDEDBC +688FA19EF5A87B5958A952A2CE751BF57B84FF314D5A005C32D5E7B63A56F336 +BE5C5BEDAC69462C93252A6C5CFA9C3AF6C40C8A2D13A738DBC1730D665FA91C +60280FBCCF36E3EDEDA845C74817706474551248130533880FCB0B81C5BD0340 +B85157690619844D18A13AF540F18DA0AA3B172636B1FFB5380D937F11BB8F48 +E14384548CD17D33133B624733533E20C1C7A68F32C814E73C790EE009EE9721 +FE6B3C0503A45BF0D1747BD8D5E55E0021A12F97D8A913EC9AC33856CE65D0C6 +4BECD978E7B1C5A22FB51800C9B554341C40C619DE8053C50A3828E2B2AD44BB +54F2D6AD9B0EF34235533491A2C369324D5045A6A72041FC486D20370D571D6E +8ED76A32C6F4CB552933AE68B1E71945F9316C6F5DB23CF258A27C358D8F207A +0B19A734F426D447CD45F2ECA02BE75BE30DAF9FE2F84DBB35DAF6663F34D0FC +C25F317EBD33FCFAA24848D0F56B54009C105B42BF5CD900AD2C1393D57EE2E0 +6438DD0ACD28B342F813A7C9C0D1CF42E459589F5D7A102F8551158611E14AE4 +9033B687C0D41927D592D79F14FF0467EF256DD23FBFD7AAB6D514C0A7204009 +A1B8BB21323997EFFBE265D369AFF7093B13E98A26AE4B55F9F5F5B5EB77D844 +7F1ED62F1A030DA13046FB40C94080BA76C9C7F25AEBFBDF76997DAD76884D80 +854959216CF55D0A4F13E559B9382617523947D1E5BCA59E7CE7BE0EAF7C269F +4887C747072D7C96115B9C1145CAB6BEE769A4CAD44518413FA7BBEA3DA15BBC +E07087389695E766B103DDE55D1F8C1D04F9FB3334A36942CB754F89EBF3EFF0 +679DF5BE6C3E6616B77FE1DC41B111A8029140BF783F2F27268E54CBCAABF4BA +FD116E27995957C0CC70B58A501847218F77F84AD941E244D1A72A50F537720A +4BFFD96C7FCFE7B4A79A0BC31377D462371E4024166CDFE5186AEDFA642EABF2 +9FD28CC8CC0C57B2C883B10357C5446D501D0803338FA9F50816D17F6FEB077D +5DCCC960972610D8AD90DCED3B00F6FBF110FCA7E929E7D393C508DBE61CC834 +EF0AA977EA93C2A3C9CDF7E5C608F838B1B3CB734DD982A1AC623ADB79254851 +474E0E1C2AED4B35A9A18010451F2D7482A9DAC24942F38E8B1AF5D2AD6AA0D1 +BEA5DB0D318A434EBE068EA54431DCC06FA6F926172B8E50CF99A61745EE3372 +49520D7C1B343AAF52BF71F3905BB01CC894D8DE06AA256BBA16F57EDC72094C +5AF15066607143AFA5878C3090E58FFCA4723DFC356BE32A4F3CDFB06D012A67 +892C6A003A3882F41F09AB778C8E8E10C1AF7C458194706535EA8D4072A61E70 +9176ED028D863C9E5A0AD6949F439A1FF4FADBF40E5E928CEA8777FC00DDB0D1 +E822AEC89BB6B4B336070F0D2BC30AA4AD2A11DBC1F8B9B0549D50949CD3F47C +C71FCB5081AF3D9E311A28E18E7FD6289B11D1A39EFF0497D9795B85E260F970 +799696C14BA5D5B9151C72DB327CCE9AC8AF75125DA580A2ABBD51E4F6CB72D9 +9ACDCDBA1CD5C9B03898D71294D500F3FB5CDAD4397430A86D6B3977CA15A2CE +1A87CFE80A49CE46988BEBBD8A7860937AD2DF3DC11005ABB4773ECF0007BD95 +BBF8837949DAA8988D6BB30E422E9DAA401D4FFD63015B094F0A457FCF9AAE88 +3F3E024679830D4150E525BCA3498B184EAF19AD2867770F1F03469433077651 +0094B6581D5B0E54EDD40111A97E60E73C0B9330C9CF68A003D9749902BC0ABD +8474348A4869B6FD17F55C705C12C31A028151848C6737F72698D1BE9C7088A6 +29E22CB19BF8E3042249D0C2583101AF3ACC511A810D47A473FBF542EC8209F2 +A3D16F24E2DCABAE3CCCF382BA30E258AB884479532DD04A6DA6604DF2B32625 +B3CC54C079281BA50EDDA55B30154547E9A8761659AADB488A018AEEAF68F80E +0C7034F74267EB98E471E5BA1A9BEE783C32BE433A46FB39D161210FFB2D862B +B62B8EB2B3C4A5C51A5214B96FB4FA1E040BDA70507B5B20071E401C23CFC0D7 +702EEEDFE1CE5419628C804607362866A89FC32212EC9A32400E65ACF2AAF06D +2211C1013BB3178BD882E77D1781AF39374641925FDDCAD306E8C03E28FE4104 +750D9AF95BFA667F3A2992A1DD79560AF95D3B5398CD3BECF601C7A42B9B0D30 +943B26DB414F1661C0EF2A1E8D8191E649AF2A33D3F1A4F340F7CE44B95C923C +EE17F390D1A6480F1C10D55EF9B8007BD1FED5ED6123F9998225BE27A8E6E2B3 +5843A30AAC796EEB9C47F143C965AD99DBF3AFDB7B491C465DB02CD8DE18D62F +9E3201C95B045490043DA9DACDF9DAD3E79492DF5B2B33A85B2610A1CF604F98 +913BB447E6FA6834AF454BA5D841B7D8EFD9733FA010ADEF81A2E4C2D6874D8E +80811743BB114A07DC96A66E8520A4054BC1AF6C080147BF8C0B55678194467F +909043328297E38C777DA2104B14C0E7C7F0D6AAFBD5CE82531DA83DAFAB4059 +70DC981AF4E6A75187B499A13D918600D4D68CB073BFEB8F4EC1E48451E10236 +ACEDF95B93467357C7028C6BC1AFE878E1988B39DA06C2123727AA6549815BD4 +E88BE89E04CD0D9226C8FC0118CB9DE223ED54684A86284D3F6E0192DD8EC04B +F1E5ADC9B5001C6A5D57605EAE071648045C256B743E02DDE3729D4A2E82BD0B +A448C6153732FBA2B507607517E0E8F4B3A44A4BA58D546C5A446100B9D94033 +B68D986182DBE076AA0BF2BA88B85A1EB27A1F4F48C77987A84E9FC3F2BD19CE +F0359FB3C2C0E4A1908D209F78C64A1B6C4F6F9DFA036B764F87715B7AB94E4C +153F2640F2BBF27A088F1BD64455648CC448B808F15FF1A1209EBC6C6FAEC16A +B2D161F097766B771C80593A0225256080B651B0BC64B5D07A04DC34C767A796 +B371F1974633D579A7BBE8F5CF1152AE55F7F0766A316CEBBF79D7C59F11DDFB +6A89E19FF51BFB7DF15FDB6045892B586B6BD1C86C85E01BED07F0E60270B4D9 +2302E6572419FCF662763ED382EAC4FD445BCFC78F62C1CD65F9D12A35EA2D97 +22B818CE6C8CED2C7EEDFABC2F54E043A9DD67645050C2A715093A7EAEAB21DC +99D14DD19FA2A6A268171AA569A86E6F879F4EBDA7A992F2F6F4ABEA25C489F0 +E4123EE182BD059A8515708BCA74846920202EE2ABBE9D53DC2CC16BBDAF02C5 +BD46600A6E80BD3A477AA960A4A2906651A7338419529F30755BFB064ACF916E +9F4D354C309DBDB3479EC7F9F5EFA0058E10742DB647B0C45EB886A2F997DE9F +534C01676E9EE0CC91DAE378111A7B0359978A43F1CE9EA98AF86FB5C59A894A +B418CB112B4BA5BF017A7AC5D2D1F003FB274715A1D35B4BCCE309FDB9EE0DD1 +AF8567E3F5002155C6413A31D8970CB1A42A6D6E16B67CB24D1609EF671DBF2F +B1085E1505CB05BEF96770B176A19F521D60B2F9AC46A5464A2401E2945F4559 +1D0603255DCA93B1F958381D3DB4A5FED62548BDEE0CBD9977AED1F17A00F19E +1CF565C08EC5B4DE3C108B15615285BDB402A4480EFA1AD102846B3E543EDE5A +5E6F7D37743479426F267415347E4C356B92F7D5D4A0632F333E5CFF2870FE19 +6C398FD66A952EFD26CD6C3BBC23041CD57D0860BC421D710D06E2FEA071080B +56212A069CDDED701398CD9185BEEF08FA0AB16C97C7FE79FE16D6A6B11B7AF1 +A8816DEA4F99D2EE29A357913C51D569700D5C84A52ADD60F9E75562567E9AB5 +E35A1A1F656D12D0EEBD2AAB9846FAB4F7DE2699CF6D100E973DD0E5373289A9 +570A364A562306BF8501CACA8DB84C63F1EDE6BED1432B138EE201635897586E +912EDC76BACE7047C529617C42582643BACEA3DE8B895B2AE895F77B140C4E15 +69E8ED61B57223B2BBC5C9E5A9A4475A2FB97BCE4DBF40280469FB1C685884ED +C5974BE43BEB2A20AC947BEB1CB5CAC0A35E0D7671702AC28BCC4A999E57DA38 +194210379106144B965CDC4F246D0CACA7CD201A72007CE0C5FFCC37EBCF76E9 +45A77F7FCF51C434A9A89A020CA63A27A65972C05887FBE1BBC42B4F4F73957F +7D33819A42CE80975F3034FB97366691F43273B5B93E472B51D792AC8BC7ADD1 +3519A5AD82C8A0087853DBEA22DFAD4B8534D21B8FC56316AE951E53F81EDC7B +CADBDEECE84759DA9C23073B64561BA02B8DF0C2459165AF170FB95B316201BE +D38F5982A2609E1BD8FBD493573F4E52843A2CD17B30B715DBCD82146AD366A6 +DCFF854DEFE6B59491BB56B0632C28D29AA90C76DB5FA0C1F9B128B9B12D53E2 +DA7BF86CDBB5E9432751AC5476690DCDA8F8F8CCF639FDBA2DEF0CA00BCB5011 +CECD240F45B271B6015EB7B7654CFB5DA4A2E8F320FB1E9234B98626D9D8D8F4 +057FDFAD9811182BD620CFF4DE2864AE715AFAD34840D128A30AFD1307FBFB6C +876DDE39C2796C1718ED8A2DA7D9EB4D4341DF3F534419618FE709DF8BABAF3F +3FE8288D735493B788668B75845CCBAC3F8C00CFE5E1552DC7107782512C509C +A20C301A0DB7BCC34CB41D75A104E27B6059B0C3A6C504DF208CC3BF011D04F1 +2AE2716010DDF5AE6133701AC7058B43118C84B41CCC0DC299B6606912276854 +4B83958032CB8EBA71753D1BEBED53D2EEA20CF31FBC5072B2EAB23AEBE5248A +FA27968481E19EB28B98414B7D31C7F26BB1924B291C366EBB48C571B3A7926F +749B80FA339E44259F0119A5BD8B57E08DA3D0742043E5BC1C19A346B4895AC1 +3A04F9343956FF300493843F4E4B099F729BD3FD908A6DBBCFFA5ED0215A0BE3 +35ABF720CF166B5BCDD246BF0FDCBE949150BEF341C9E69E05FCC71E0C3E16ED +4CF58BA615D931F318A071CDDC95EE4F7C5115AEA57B7858628F8E13DE33E771 +1F57861F42DB53EBBC4332DD5D3F96098E01BD1D66EB13144C2CE6A0558279EA +51742CD7208D1C1E65A283D1CA73556856863CD47D78D1FC79CCE077BC2E5D14 +F10606DA0FEBF17CF8401A6CA37CFFD262A87432223A80BB1ABADED4261D46EC +A83D208F90699DE6C9A389BB96F6C3F4E02777D308C2E3F508A14E21B1446E2A +33BD47CA44355E7E128C73B9B3CCF46F50760248270603260C40BD9FCA63C01A +F3270E80DC263E0B5BEEADFB0AD0EA48ACE0023AA6EBD736AAD1E999C492C674 +167E3746D71B4F58E6CD01B59C73A1E3AC18CEF0891FE511EAC8444133133AB4 +DC7CB359F92E7C53DE1E022B448E7E4E566D4FBD0096F4583EDC6756797D8635 +523B99ABBA63EAA2F25F1AB5F7C687D41B933897E1F8B27A6952E46381EF63BF +FBA20918503CE2EC45C1A17E29CB5E462DFB547958356E2FF656C3A7C600F28A +888A1B5DEE4D72CE606CD61AAC7E426BAC6119584F552F04B3D7EC96ED1EF048 +0FFC3B36569070BF4FCD2E46B3792E3A365D695CBB7E4826B4C83B1BFA88FDD2 +133A119122B249CACAA06EDF17D451B21136D01E343A78F365A0116510CB5C2B +E947F1ECF2A62A32330D778525EA0D577B8F84FF34C27E30FC3C650697B96139 +C54204EA3DBFD74E6C42281A27C121F757FECCE281DB11740E3A56F380C79471 +294ACA3D94D03F62AC700C4B9E53C55AA423C5E0E7581192DF9CBBE60753DD4D +181FBE50213D9D0705DA4CECF039B959308EDBFE219BE4E0541D30175E448717 +8496143152423969B755D9CDA8B1329836CC618BC0994B93DD83578BA6FDBD21 +AF4923DC8E1075B8BEF515738F2E681DB3D6E9AF5F7AA7BA32FEA6C6C10DA83B +E1E01A0359A25C564AA1739D56FB040C56018CA5E8F69EDDD735BCE0EAF3EFCF +7E9E6696C48AE1FA14D4CEBAA680170D300027C1329DFC81CB6C2349EE9789C0 +D15F7F2E1490447870E09FD26D40F18E5DE32E945996FDA4E8A9F77995C9AEEF +24E82B7F26D107251EFEFD92A62FDC3E46E357EABF76D4B7D3543F02A33941C3 +0EA0A9E1691533C2E2EF79E02E0C4579794418496499C47C1E01C03D30616371 +B14C9850A0FF427FAD4F21FC84777EBB8B0CA14F7526C37779D1ED6ED2526E29 +1072467F0AC8079F509C634445322A859FF846F437D6455A0AC702D59B0F932F +0EF41B329F42F83566FBA693B87C45E95D743F6523DE11DFA2CF7144CC329060 +BE3C24F17A584998B4EFA6E48CB65ADC840D6554793A9647E3BFEA0B865832D0 +9657A13D20641ADE20DDAC86D26583F5DA14101DA5C971CB385FAB7F4848CB1D +8800CC239CB3A9E79FD1CCB5A667DE7184EF65A459FFCE472240A803D0ADB5C5 +7FD08B11C77EE7BB13B787DF3E01B99D57D101D8B209B6F7A274299E1EC57BDE +0D385104C7C0D5F0F835EADB865073C334B74BFD2F5F34705E07334855658D49 +4A1FDE32645FA4DE91CDA7B17B941D0B23F104BB3377E983099AB3B61F794956 +F4854DF574FDA0B4C356C90ACBA0963F98390FA630BFEE1E2D9F995FC82BCD6F +8C658B842D9574AF472082B60E52CC67070DA5AB29A7C973C9399749018CB904 +88A6FA21224F8DE7EF9F8069B12CC04622CBB7A0C55BA8AEA0523C6D4A64B089 +27E52BBA3B44E98569DBB50ECE9C48B2DDBE9502680E5B618A30C4B95DBEBC91 +9BA2355A940F6304770E70DED7453EC77B3C9C732C9DB9567E4193FB23C89592 +7BB60137EDFC52DF7B06F1262DA52F926E48CD5A750F71FDFC573EB8462845A0 +4EA8E0DAAC302A0EF2A156444F8703D5702EB6C9B58DC70F7F154C0F22A6B53F +573FBE610D2A2DA232B21DC38D37D56D147670ECCA5DD005B990257691E5548F +4095517F9FDB1EA0670BB3C325092635CD1207F565B27A6F901AD91484855A71 +A8683156ACB1A795255E8EB09D32F598E9475C97BA191469642FC49C81EE721F +77B6363572A188885DBD798057AFF88DDF08724DF475B00BB73F681D975E9CF1 +1BFC142990DD34F2E1726FCC8D9F10BD9FDFA8A7BC92212709F00855B547E630 +C26BE4D5488927E8992AD160D8B55FC68C0F1D6A54C0679D275E58A3CAE51977 +B8048A8C2455D58F200DE978859A7D1FC44304C7EA735EFE591E28EC3DD083A9 +9E53D4EA808E10F4B9F3866643E2A0D1CC177FDB0F2CEC6C3DF9B1A92A6ACFAC +08BE08436F708C3D13DB49DF09EEB57866CDD598B663F10AB42CD229E6325317 +F55716A44C75E7CD8D2B292DF39DE5040DB9F3563CFD2C186065730A0712D446 +501BAED4FD53A9D8F521624E270FA7F932294726E4B84A3FBB7659AD1C5A9240 +DAFC17654ECCDC38A9FAF28F301F10E5923F33DDB0B9AE116143218BB22BC3CE +402633B164D6E4E3B3788216DE8E9B38677C71AEF5DD109C63641AA99C2B2DCA +EB99606BC079F386CE077B9647CF93B400D50D11162AABEB08F42A19C52F9D68 +80FF02F006874D2AA3F41BA095DECE25CB7E021C91D25EFC992390C1ACB76357 +9225F06096DDD549FB855CD9F8FDEEFD1375D702E2E806760529475ABA67EE50 +B70FC8860FBBAD5745459DCB1B8AB9F1EAA5084080C2FF89141FF10B459DFB93 +2C35A171AE9219ED5FE507CE7E3813C94F346E924792B1130E9355628980A18C +6F808F28C396EC813617EBFF922F73BBC8651438A1614C9F24043D110A589B89 +3FFB6F4E99C0AB4EA4E50A6284644137F093D527AB9490A7EBF6140D9DC1FB98 +5090CA16E9F08BE79B49912963719B3B35A442FCA493EE5198F9916F8655005A +9EE372FC4404CB4168F82F810A58371ACF7AFD46CA46F2F94B194429255A9BC9 +4185CEC1C929945451968B0817842B3BAA28A1CE1E10B6CCC328E0487CFE90BC +3BD9EECF5F8FF1C99C8805A4970CD486F4DC9BAB0129E86B1F67F08070F04A46 +B0910BA9E173FD4DCB568B08BBECFCF6695414662DE690BF32A90237C8B0E72C +206D09A580DC92A135179A5E3F1E611A3B05DBB05E4A8D51BA3D0A165D3C40A6 +AE013DEBDF26FA757F6CBC881BE672BB467C1920C067A0B2A49A532A391A8E87 +F2C6E50D247AB108A1740D4D82F955A91D49E95259A3DF9715F34CB45ED5DC9A +77631A4A1553EDB8D4ABD93869FF52D3CF0017CF887B408C02E8509DFCECDD27 +A295ECFE0332BDA5678C4393ADDD5D171B5FBD360CCA5810F79F5F879939DAE7 +892D53FF5F505CC0501BD40590420A291BFE8E67F09AB7A3E0665F6AA8FD04F9 +67C4B0084C48F9DE8F7E0785F3261844E45C9F5D4A45855BC5B7E00CBB865B31 +2BDBC1B1292DC374B6190D12246DB97BCF04F679DE3605E532451B3E9D7F5997 +E1F353BD1E35CB11C850C9CD5ECBC40C9685DCEAAD279E315FCF85855D6B40C5 +D0FEE8692D4108B04338A70A50BC6E2C04F4472E294A182B88C9021AD8C0ADA8 +0C7A752F764548A51DFECA58D6E39AB4F78BE0A83DF6D60D25CB0F328D8FFD49 +16427FFF198D1FC3F574B3271688A31DA28952EF065C884BC0FFEB547360A372 +7C39E5F2FC458831B9C42128CA69A8198FA0545CFB207856D6BA97E113FF7E26 +DC46395E649205C83DC7565F4130CD6BDD44ED8D4D383D0F37B34C6F2DC98CC7 +4F96BA2722C996879329A4B27089F0A68FD6355D26946039F25D013AAD2F22FF +12FD7F617282C6F005A6EB12554C47FEE2A5B1D0FC7C595B9DAF268084C91B37 +5FE0ED62A934EB511362D1F14BCAC4950EBFBB2A3D1F45C1E34498871CB4C346 +54B7349577D54D26385D784C5E3C2D869A7336159724FAE151FAEB10E231F3C3 +A17B959192186081556463C3F5EE6FFDB06E82B8B9BD08C0443D8CD84BD6EA7B +1C2BDB46327CA21FCF002B3E8EF4DECE86077AFE6BB5A941B9E068CA023D54C2 +8E91E503F48B0B4B96ABB07F084C2EADE9B2F41415EB312B9EE0612E69F51177 +654AD20A2D93D457E2FC3C66C3705F9B48A947329BE59DC7B871C055C590FFC3 +F6B5FD8212255D25EB7787E637D5CCAE0E1EA386BF0B911F414BA45E30F36CCD +6F5A17D0A887B5BEC58B8E8D228E12C9568F820A7F820B6C9B6631EA8C2340EB +377CEB0A490166FC33AE1F38D3629C090606D3E8AE8662A98D6C63793B1077CF +092624F46AE4548DB4B22FB602C39EA2E74B5A26DCCCD210E043D508849703E1 +451C8A9061514DC7312755EF16C2165DC1DDE554A29C8AB6F9ABC9A5127041F9 +FC22CD3BF15A4A23DFC8FD5661DCDB1E1E1EA65E77DE4A8D60A2E564F467F071 +5C8EB4509C3F9A97D0371EBBD4584430AC8EF155084B63B9848FD4CE2B5C6DB2 +C3A1946B4BEFA7B088587F912D20F0A2E15A580584441A4742312DD4B34503FD +338BFA7BFEB94379353CE264541D33433C4E996BECF418A2E3295B9961FBDF28 +77EB608CC870B97D9EB43FC3AF2DBAFEF337BE2F108DDFBFA090190158A244F0 +8A757A95FF8E25B6FBCE09A1DD6FC5C8897456E12AE7A9AAAF0E42FC632D35AD +EA2C00D7C61E047CB071163F05FB5ADAE82D0E177BB7E6C9492C2FC9F511F75C +0FCBF74F06E057F6B66D3F72873559C5C983DA7D7E75EEF7B783EA44E4AEDAFB +2FD8C3779D38EFEFEE5BD565C3A73D307D81EC6C45C2F02B7B342DFBE2356484 +BE59EF6527E956D8E1C48C80395F34CF4AE1B8B5C2A06072DE5C59255ABA30B4 +3B5039CE2524141C0BA73CF79209B0B5AF17C59BA0EAB437802A22A2E2D6407C +C861A71EA547220134412109DFA1F6D78BB0C34F6FD36003850FD3D9EDF39741 +2EBB9AA349BB5801C9FCFBAB69E1D3BD5F4752663E616A8E1FE486545F3F1BA3 +8F8A11E4C13B2CF97A497C2333A22C696B499647DD7439D3D7B636FBEED2D32C +86FF745763413B53E064B16E5BF157C9DF7313FB9D46C752B52E963BFAFCB392 +531F4E46194A3BE24E2F51EC9BD57FD5E82668E2AA9D72DFDF7F4500C1B81526 +C09DEF71CA6D3A3A7ABB1BEF21E99DDDB82D307BAE2B6FB28FEFA5160E18304D +25B1665A7375FFACA6C843A0E8BCBBF59FBE24068A79ED68A6F45AEB7201BB6F +06EF67DD19243E68DB34025209E851DE3AB65D10E108316E733DFD25B0F8CC8C +056740761BCF195AA6E1C2857BDE85983408D400A96EDB887889F7CCFF403606 +F9C01F7CA76C9CEFFFC9AB7D3ADCA36A0269283F5A65594ED68F43DC1BFC6117 +1D113760B0F469C34CF089EAEC99C5F7448BF6285DB05D35CE182CD80491D88E +3CF21FDB249EC96516EA42BA9A716283C7C60A1D9E7EB9E217B2B4EE5F316110 +2DECF4D895423D64B87B776883FA49225B6061E820C9425129736754184CDEC0 +67B63E5D07A455BE0B9AE382FC997195AE0AC4C07FB761EA5002C3943008F7A4 +BC04588165242A9F4C31E811EBF1E145C2D102D1D7C9331EE6660E054E74CD7D +8FA19BEBD2F89BDEA0DD0B54B0E1B5EBE3E9CB1E5A1F477CCAE0955BFE9950E0 +01211AC8F3430F958A4DFC6E74502D9E2EDF5E2CE261DE00D8DA75BCDB83293A +0802B7D5F14BE14380DC1013877AE4624853F3FA041F944D19185862A8DCE73F +5F0181BD84C3E65AD11B2F0A2FE36B1803084E82274CF4BE3B0151D309C3F104 +771C6DC985D7DDDC77BA40D844173A9486B539DCE051DC82FF6D6831F99B9891 +48D6B027B8B6B6279E6CEC7D0606DAAB1A86F2309F1A4842A1DFDD5116FBFEA5 +0AB6C354CB65782464770B72B39DDBA2565CDE941D68ED928151E23675B541EF +33B070ACC0ED70A3A18D0833CE7A90C911840E06577872FD4C3A67E7C195F73C +2418EF0889AB1AEA93269CB1B98CEF136DD38DDEEC2450F7C5FAA9775973E178 +1182455E0321C4DF13B1EC1466D8F5BBBFC38A2A054B57FED2E429ADD7CD3EB3 +425F266AD5F0B37576EF54143D42D675E895EF20F54E1CAFE0F2A2D2075B28FB +EC034601A147177976623733D6FC00CBE2DDB1E9DC5DD9E7D12AF9E589843FD3 +607AFD7DCC3AC648862C559B98790640A78E112B757B15FA513A76E1C3AC4074 +DD520E94998D5DB08C1D3E822FEC4ECBFD1E398B480AE01690B14BF92948135B +4C042F70CDF3B988BD02CD54CDCACF912AF09C0C59CF23F84094E5C976E6392D +D7D5ABC68E9EE23C080B564096A30F67241987999244686137175D8570DE9AE4 +57EF670B5576BBC1C0AD4E26D7817B202674F70CA62A5EEB882C2ED1C6272C00 +5598595DF2AC7F82FD1C9606183157EAE7575B07828BC2C0B2D171F86BF3900E +43FFD4F6463FB5C6A1201D26A8B58677F7CB00C5CBDE1FABE2641CC2172775C6 +3F9FB0496CE71E179D70333A628091B47A3100A5B4CE624EC9CE5E4D740CE3E0 +0F03450F95138A0437BD3A7C4F6FAFD1B8B2A0EE07FDF76E427A8ADEE7CBED56 +B57F9522F8CBDC3236224E6E3FADB549018E757E090E1CEEE91C45C032CF1F25 +67FE17978B998DEE1635236EAAE953623BE263D2C444327E91C4EF9740B768F8 +70A6CFEC3511252D7432C96E5B11B7AA80BF620B63B82AA4777823F7D0266A75 +6DDBBC79CB7EF862FC8AA67C07B87C40EAFC0C81C122AC0348F7702E95760F93 +33508D7852E4A494F5C6CCEB7CF67F1AFD391977AE0D85397BC85BA02C0C02ED +51C9489230B568BDBB8485087350E140611053373E46EDE979AF4C1D1047925E +9F67E9708D11BC71659DD61D3166B156670D67046AC2EBA08A25FCF2B84E7BB9 +56FAA25B67004C1D6DF8D12D4E9F1E3793CC1667EA7DFD6D67243DCFAB276AC4 +DA755EC98D63C11D5D10E59D74A4CF627F699F1A018B2AD652584A810B2DC519 +549B2CE246622CB20DB69F25399315A33B244BE0C05FEBAE53D00E4E266DEEDB +D1912D49E6699105767FE996B0CE64AF777E5D559D36BB141456339447216362 +59721641A762F6F6A54CEB3D0D2D3F75927E362D6A6A99CA6A8BF739681A60C3 +232E952935AE9B34DD4FD3D15385F5A30B045F3670D517BFB924BCAB0371F3D3 +CE9C5161D8C634BCCCD3134F8AE366D3D7B2C7B32EA89FD61231E30DD3DC1BD7 +FD295D5E49051F6C35DD7AEF31CA904FC20F36F19E0B9B838750868D69A752BC +64398CF36B006D8313D0A349C9D93AF56F0E01274D9AB369309B9F4E4BD0B8F9 +C6B3C66F38C3027CD1AF8802BC82904F3A619F89D5CA5BB78150A8D39B9A92A8 +9B5F5BD2674CBA06F7819C0C9261EA9671810A804C1C14CD6A1D7116F9491BBE +269653566173D334F26E76CB8AC3C345D47220D777449AC0E82B435A2817AF7A +711A664519CFC16804C966D8AC088DA2AAAAC79AE21E7B538F3554B65CF29AC1 +57B646E6BA127A7A0B169EC680ECF5C230CAA91A9ED6AB2A54B8EB7E8C94DA78 +67C22B180ED661264EB2004EEDF1923FC5EE30E0A6F87DDC414B7507887F8411 +9B999F25ECBDCF8FC3D9AF99AB8AC08736091CA28D78E77354F3205CD56F9221 +B6CB6D81A34E3C954F73BB23BC73D4E4E6B961EB4589E5C2E21E426D78E71958 +3782FAA65DC184CB4944FCBAD6ED0A882F8767E2E8A8CF272683BBCA8A4657FF +8E856DB3188939D424341DD0D9B8074461D8F15FBFCFA7AD63C81C4F51396640 +9FF1B14685624376BD753D186F75C695CFF5BF63EC9B20D2CE365BD0A4822069 +686C8737732EA874127D96CE11F889A71071771D8356A5BCE475F98D79C8CA22 +E98F5175D0016913B0C927616AEC836578F02024E3D4FAE49F428F68A026C592 +37870C5DE3A1833AE1C24D461FEA +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +{restore}if +%%EndFont +%%BeginFont: CMMI9 +%!PS-AdobeFont-1.0: CMMI9 003.002 +%%Title: CMMI9 +%Version: 003.002 +%%CreationDate: Mon Jul 13 16:17:00 2009 +%%Creator: David M. Jones +%Copyright: Copyright (c) 1997, 2009 American Mathematical Society +%Copyright: (), with Reserved Font Name CMMI9. +% This Font Software is licensed under the SIL Open Font License, Version 1.1. +% This license is in the accompanying file OFL.txt, and is also +% available with a FAQ at: http://scripts.sil.org/OFL. +%%EndComments +FontDirectory/CMMI9 known{/CMMI9 findfont dup/UniqueID known{dup +/UniqueID get 5087384 eq exch/FontType get 1 eq and}{pop false}ifelse +{save true}{false}ifelse}{false}ifelse +11 dict begin +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0 ]readonly def +/FontName /CMMI9 def +/FontBBox {-29 -250 1075 750 }readonly def +/UniqueID 5087384 def +/PaintType 0 def +/FontInfo 10 dict dup begin +/version (003.002) readonly def +/Notice (Copyright \050c\051 1997, 2009 American Mathematical Society \050\051, with Reserved Font Name CMMI9.) readonly def +/FullName (CMMI9) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle -14.04 def +/isFixedPitch false def +/UnderlinePosition -100 def +/UnderlineThickness 50 def +/ascent 750 def +end readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 58 /period put +readonly def +currentdict end +currentfile eexec +D9D66F633B846AB284BCF8B0411B772DE5CE3C05EF98F858322DCEA45E0874C5 +45D25FE192539D9CDA4BAA46D9C431465E6ABF4E4271F89EDED7F37BE4B31FB4 +7934F62D1F46E8671F6290D6FFF601D4937BF71C22D60FB800A15796421E3AA7 +72C500501D8B10C0093F6467C553250F7C27B2C3D893772614A846374A85BC4E +BEC0B0A89C4C161C3956ECE25274B962C854E535F418279FE26D8F83E38C5C89 +974E9A224B3CBEF90A9277AF10E0C7CAC8DC11C41DC18B814A7682E5F0248674 +11453BC81C443407AF41AF8A831A85A700CFC65E2181BCBFBD07FC5A8862A8DB +7E2B90C16137614CDAFB584A32E50C0935109679E31306B8BDD29F1756946A67 +7A7C2D9BA6FAB9B20A424AA0E6F4BA64C2801C2FB5A1156CBEED0ACB95F697B8 +BC2A6E6AA7EB1F9FD8E3C9B1A16697EE1F0E7400421A7765AB218FC837A49365 +82DC6B2C877A7DA84A81E6126EE96DB25C17A207D3020A045DCDAA064360DFFC +E3CD50E21ED239D2A6450D04F879A26443ADEB6A20ACC504989876476C7D1A74 +91564FEA1F4CC2C8C8FDF666DB537F315AE1886C73CB5B00E67E7B398A6C018E +540EAEE98BB8136C4F044EDD63C33431D2CF9740F051DF365A4045D9D8782112 +7BB5D494D9235BA98CF2F30CB119F5A904C32AD04C960C43FC1F5FD8DA7D90D8 +93AFB59F3FF4F796481AE2A7548F948FECFC6C127C4D3F159B08F206AE8C296D +EE470DB2F879EA79475E029D22D7A8535C09A18689DB0609CC233E5199C02756 +972CC9C94D9FCE264DEE5D75C8D651E4E2D1189AD9588CB815722BB5EE3C379A +6F31C2E6AE1AE4CCEB29766190AFA20EA937114978752189F1A9F42B39483149 +796FCFA123BA9CCD1D9BE28289660BCAE16C40B5B504058D55CFCBFB4F4E3D94 +DDBF39F157E63946534DA81C018B1C01B9F10DDB55E0A5C2B3985ED1977C039B +D6755EA42CD09E27751E159C30B93F376DBE61CD3AED34BA36A768F232EB3B80 +E3E6B77C4A48D408217818E398B83D995AB6BC871F20991DF57313D6EB0C793D +0F28088EBDB7F38DAF7E01AAB3476EC24D7BB38A9889A7D3038D930FF4289B83 +F54A7BE1E2D98A3822098D2E4D067A0D400C20C0B2B4BBD74C13ED1B827490F9 +ECF48F8C3994C1C5AAC9CF783BFA4F307528F51EAB55F961808A42ED53F00C97 +72A432EAEDCFCFB622389BDA707B6ACC9433B065CF29EBFE93AD14B8ECD5F47F +F073F11822C49B8BE924CDFA6348C3A75E9BB9BF3F31C41716B34794B28CDAC9 +4DB8B087E180A9B3B17680F73D9C12C8D86A922C948093629F5D7F542ED882A1 +692F4F6696865E53E3E2DD43B2D5E8C989CFAA5CA5C4C5999045E170BDE9921C +BACD6F2863F5553EAB2BA2D4A9034729EC0C4201DE90DA89B0A27C5A5C974109 +4E37BFB3F46B3A506169FB0C68E1CAFC844419A8D261A1FD86A3BB78E33D5FB1 +CFC687A5975987CE45155E5FDFAF0CC5FD5568CB1C26212F92E88255F0549F59 +41B33125946DE43436BEC00804063FBF03EC796E3361B1C852EC3038D107F80A +9198968265D5488B26D7670B22C2D75EDFFD1B7B4AAFA36DFD94640C9D0E2D20 +5BCA18683EFB91834A3939AB8EB60E2F09655BE003582634C52770DA9668C292 +2E02929D812EE2B0CC65F020064AD5BDAC5F5693B30508F40ED8E20E87149BD5 +8DD41AFF83FD1944804017DC5A04512E593549FFFAE501131CE2FDB65EFD0B8B +33809CBAEE411B3941C241550B9C30DD28088708F1C0CC3125CBEDCD985EAD28 +03313741F67DB5744A87B381147D5BA70AE1145C27F794854628D87D6C1ECCA1 +749E3465B950175D3C3F40E344297BD92D3190041A4392033A79BEAEAABB8DBE +CC14E39612F43721CFAE6F79074429221CA588AA2501DE520A464DE157A03AFE +3C082FAE7628FC0C57FFC61D0330AE6332D20FDBB09BF36848FE05E782D6379F +64F9C82C45402481B0A35989027F9756BF5A79DA2D96E10F39167ADB4305578F +90B509B6891338FA1D67DCFD61804AA6621526B2EE4769589A2646581712AC05 +DA6E98D16494F07D612743058F54FEE516BD89A8EC3E03F9D7F905175D3412C8 +F7329077FD6EB25213F3CAC94BA0C3363B759401B6EF7548C7D709F3241D030D +4EB46A1AE81863C412BDDAEA6084C37143A4C5E41BC646315B1CD09F934186CF +49D1D8239E363A435307030BD79536B50B723A39DD763DB539F24A10DDA12BD4 +E467339D2D6DB177D6FC539FA77D2DE4118EBAC161E928749F7C753ADEF86117 +58619F1155C563DF2E11ACA8347908B98113AED58FCD0394150EEC94B7F986EE +88BF7171D208D8F1774B1DD478F0C2958AE372D257E7EDF0F6B5D6059CC4D5D3 +B00FCBD2E9CBE79235B9A5A3E943CC27AABB58728C95C7DBD4F4A1F8A4DA99AE +7377B0CC0BFBD454794398AE0D5F7281771FFE87B25A819F36E692286A42D776 +01794A43CA9BB30FB8FFDAAF014F909A369E34C2F6C75B7D4EB9DB0580E33F46 +19654443AFF8384B95600B86FF8E41FEFD032355626D60C7507C058EF832DF41 +194B48A36F11082D1DCF4723E21401E0C7447AABFAB4639B26E3D2730E348F55 +53EBFF39CDD03E06E2FA5FB379603C879EDB7E1A10F89695C9C47DEEE52BE0A3 +F446F187AB9D7E93E6F9387F21129034F36DF40605D28FD526AF82CA9D232BE4 +412567F06B38ECCD496EF40A7B243E46C9FEBA4F1BF4B1ECA029C5EC239353D6 +C0B100BF7E7DB33BD1277DE104F15AA19F37340A777741AD1AD693BC76DA48CC +C6F83CD84591ECFEE375979972B0FAC4C10B625E4BFB261B9FFFA83C31DA0108 +4FFB6377466E9739E0EB64424BD9FC7239C7DD834EC6788A0F97FE714AF92831 +E1BA36A8A9E24739F1DC82DC26CC3CE28C210AA7C569B19E1784D663A0CA4E81 +AFF43E86D6F5F63778847700072CEB77A4EB946DC1F23DBC00BCE773203F76DF +00F0B085F31420672974DDC642D885E95BA6BBE43E1CA8ABF464D9881CDECC7A +E98E31B9754C9B72A8BD5CF6D4D214DBC3BA7A0CDF6635953F5AC1E7639C4A91 +C7AECE4C75CA3389C348F656FC2CC96C84C85A926237B6504DB51937C9CFCDAC +B75C31ED570D180757884E27757783DB2D5F35ECC48C496CDA342D49AA947BF8 +2FDAD2F19DFE8CD1C76A8FA08F33681F3E12E229D7DAB45BE3A3F258B5ED4980 +F15340CF20D965252843E026803E8AEE736EC41CCA82167401977AB719AA2F50 +0B791EEAA82027B3C712D2EB9D14BF8F94FBDE2227609BCAC41EC08DE2BAC023 +28352F913F7DF08D4E1C66E83F764578B22B4EB7191E852B91ADCCB1BCFDB1F4 +E63DFD152E86FA9DE9BC8908130EFDE29CC4401339C05B5B9764CF8EFF14951A +C6C13AF979546996BF22F2B96D3D585B90CD27DADEC78914DA48432C6ACBDD42 +20EF583FD41F2F6D6D10C3DF7DD077304B5940BB0462656E306CBD91EB9B756B +7014B1884A36201EC582FC9345C386043DD2818FC301EF78791C1D7854F8FACE +5DE9801DE9F59D5B4271E003AB897B2EF49501589D681D59CFFD9B03F722EEF4 +74ABD29997515DA3591496B62666744EA76DCA45504F8075C0652D6779DBEAE4 +90430C2945FBD60AD53B51DDBEFC7ED703C418B4B244C8FFA5A3C1B7600C5A55 +3EBDB93C16AC191C3A28EB2279BD3F0D67C826BC6A73D3C0AD02262368AB4621 +98A1605F2887BC5880E1AF2780330E0FD01D7CAACBB0F008A42C427F38236066 +54799594E515B289044BAC4DADF8B3686B4372C5110201221FDA923F131E07E7 +93C44BAD406838BA4D1C277EF74098B8C0EDC41EEDD58C195D7DFF5FEDBF96FC +19CEBC6C3006DD2CBF76916B4298BB915663C2F61AFD7747E03A03BD7280197A +9DA590E3D081C6F53DBF94E8D6FDDDD910A70AB18A0F6D48A590FFAB314D6CFD +E3FB20C1F3C91063F00726A2C13A3D48323F9854839405E5A29D66A43E6E2B84 +A8B3765F1D817071D4D6FF42BC785C2D11AB2B9452F141696CE19C6AFB9777DB +107D6E22D8CC6C26440BC48248AD8805C4329D46BF433741CB519B21663392DA +5DC7FC9BF37E5BC396BFADD7263D09F6B4D69594AB386B7BDFCF3BACB97A0E08 +22013E716E642592A20136CF9CFD61D4E515D80E06A4CB4FC9D9B916C93CEA95 +B83B98C48CF36C1D02291D4F5C0419338D64E33C90C90EDD2BA3B96D70FAFE0D +403A060CFF448D3E28A9B1E3916018465E86095BAAB4706CF7ED350D7C554789 +D7F4FE5F180767DE8739259E68CF142040BE1E2E8C6152DE3417C1FAEA7584B6 +20781DC4A9796431EE713DAC4E713C839D7A4FDC8AB6BFEFFE767AFD8B67FDA6 +943AD387E5D3BCB09039ADB64ECC2BE2620C6EC269E708DD06C311F450099E33 +AF46AEC644222E7DC4DBB9371EE12CFBC4F9B27AB46AD1DA96CE006E1DF8291F +A550A93026CBFFC1087B134EC6EA76F5E109CDA58FF47338A0039A786A575F70 +B8A03A4F9C8D07A4C856C77D9BCC8E3EAA740172D0C2D0A15BA35C9E5717D7FA +2691774DDE730BB9D7C70D7AE103DB8D35F3728470C76EBA0E670634E1A0BA84 +2FA102BAD7271DF2680D86A4CA6FC353869987700E5E3FD778165456033D624F +E9B3E80EBF431ACC934AA0357E824B8AD73E222B510DE8445C55C07C8E5DE46D +E478F832BDDECAF2EBB11941DCF84CCD887043FAED9AA90D12BC8CA9A0C8D94F +8D3BF1F80B14B6CAE6BB1C6AA405AA64BB94D5A82CFEA548BA070796A02F9642 +87326D066101435AB9EB40BA9EA9E61B363F5F5E3B924369796E8B78DE3414A4 +2B79C6A13ECB2F34E6299658D07D2B3DEF3D4383CE009A927F0EF5C196652842 +D96B857AB5E905201E7E8BA21A5EBED1FC6863BA9A1A6E5390407F75055E2EEC +512FBDB3E82CEA13663F1A1944DA072C765D8CED06AB461470C5723BDC1271D4 +4D1D049D3EB131743F1EC9A6ADDAA038ACA2C41D139DC6A84EC3C61AC7F1E559 +6155CC2F49171F6E07CF56D721D9728E87FC7DCBCAC46455A3694C765FE807E9 +9CBC2D304AF37E0F28CCB22F239541B53A4D24D09C662559267467EA487BD33A +0BEFD4899B581D20582930703A868655C31BE935364CA6A95FBCB22CB714C040 +9718824DFE97929D0482430726CCB5A5307957DD2432A9B6271E849148DEB76B +FAA290FF6D0B18DC5B76407852E81C105EC6CFAB0F620C6DC9DA555A33C167B1 +430A8BC338BFC7D75B7099CC906AD923FA107C74D3FBB719D77A4E5A685FF9D8 +56424EE4AA074434B809D894ED50F6A60A035C5223EA25DD8983B9B34210DABE +718D7B2BEB293FF1B63CFB1CBDAFC69552963D90F5E3FF533A3FDBB626E9FAA3 +F3C119E5E01C7BFF832A033C3515BF049E29558B1DAD652F2888E339E67D15AE +95F9BD14E3253DFE9072B24C0E7E85025B71096AF51C86AECB2921126A43156B +EC812B32B1164BD9B2B947D503C015616DBF2024F5C8CB3236C1DCA653D661FE +6B1C19A22D272A176B7F1B7F9E67AF40DB0EFD4940E58B2A050249CA4E55CAF7 +6ACFD84FB46FEF952D18552B3972D79D808B4C263B8C7E1BB647A2D03E102867 +630D5C3F2C917F765A4F6FB8106BA6A9D0093E27A4CB6049C2371287D94B5111 +6E7020776EBD744C6C920464BBBC0AC206033E8240017F8CCB112596ECD7CAFA +89950CF43FD87ACA750C03A778A37FBCE9C82C2F5ABB135BB02DA8E8C0D24475 +3BEA9D79372D0022FF1ABD378C151417DBC69FE5C9CA38D23A3900E34BF924A2 +90777ACDC37930B67DD44A2E76DDBD9B89598D5F626BFD325A978D277265DA47 +38CFAF16E7FF1946E15F41CA73F7B4B02E5AE8FC4C37B115BC567E4EEEFEFC34 +EC8974B1465AE57759EDDA28DD38A9210871D35D331AE1BE6097C3EC21C770C9 +B25D040B2ECCC3AEB1EA1BF99E0C2C0F192C13BB9152CFCF75332E03F9CEC376 +9B8C285A35F53655BE38713E09AE34BA2DA9C06FA42A6FD2D00CBF2AFD2BADB9 +1571629C65DA38A431710CF5B01FCA68E8B8569922FBC3F9B64A5509B6F677AF +1B97E91FFFEB6308AB68AC58F9BA43DB5E764021E75B56170EB44C2C0A7DB86C +62B8982256D3621EBE3DB3994DBF5C5A14CF34B4AF3BD5697F8E3203085DE9D5 +84B0598169760B925463E93DC87CE70AF4C2DF0F4287D2F2069847BCCF7A37A2 +AD451D5ACE4DBCCB2E14D5DF38B226952E7446BF87BEC736EF3D5AE793304618 +D66D3299AB9F9CA1D13F134FAEDF36750046E27706C7CBD8E0877BB6276E5196 +BC2A355D109C0253644918E1CC11B717DE6FBDA201E769812752888CD66268F6 +4ACF4A9449378F9F9923D584BA1B51F33663BE7A306887BC14A37E3C5A4654E6 +531D6EB63DE3946BD8BA95CFB037991174F36D61D842071E6625605CAA350A24 +FE551025D10871FE0E2599A63900C8520EF4911C53A03897C8BEE152451708E2 +43FCF4E700C583A5E8DBCC03BF9CAB864DBD19E1760945DEA0EC0BA38BEA8256 +D3A8D4F70F6685A99C6BD2BA8B412A26C002D76138CFCC7DF6802931E5D97BA6 +0151F6A4C572235B4196B22B7B2D14B32886DF0D2CA8A277ABAAC53B63F64CE4 +E4C088192AAB674497E8AF81961359C389B51F4A257373D907C615030BFBEF53 +DBD99058FD06E352450B658478C10454AC8FC0232B70D5CB916981978053E358 +99D322A07294748BA427FFD1E45C909171017B52B7C742FD77A8560852D819DD +8DD53211A14D7B2FD11E42941722FD3985D627FDAF87EB57326A0D290B5077D1 +8A4230BEB40523A8565F95E0D44F036A571DB698EDD9D94FEC9512369E5E5E73 +A3CA5C142617944F4F99C0697ED088ACAC007FCE06E5A6EDE7D0E03A3399DCE5 +362271BC31533866BA79FD1FB3F608B22CCD4111FFB1BA35D920A23AD157C6B3 +C3DAE11069D5E46DEDA7158C6478D8B8C0D9DC237CDF0CC6633911673C43FB79 +E4F9B7F27495201E5ADE66255BC2CBE9D9F237DECB62A19D62CB41A1C92432D2 +07F0629E913A71B3F1AAF8B8C5AC66D3C8605A48F8913E39C859E163DB1DBC8F +0ACFEE80A40B6172032E95A76B752B873FB4DF23CF3A655AF1A1B88C8DC156C6 +190DE72973950565454C0A188A33395FD3D529A88F2B578356DE8EBBC12F04C4 +5B899F667D9E6F3A4EC6DD8DE71FD4C2E2B6D56823EE4E0526679D71FF1B868D +F261489F06F97B010CCBE640E2F57BA3DC3332B329F7958394BA9777D833AB50 +005E8E9232547104065ACE33396772B0E0BD66D2C6CC54DEDD071E444D8C95F8 +6F88B31E20FDB80F77C83151B7E25BD3736B4F9BDC52EE78C41E9475E5A6D94C +D348AB42F5E36B4F167D29EBDFBD43B03F77EB296B06A36880FF17D412E77EA9 +F2E7C25FD05E16BEC6732681EA21AC3FF6893B93FC09316A370CDDB86D9E6087 +F6042C3F9ECD742778389170F5F041329782FB9F9702F7533E51F355F71825AE +2BF4F8FE50D413AC9A20C41B42537FDBE8DDC5A5C793D3760C1EE13716068752 +F0AF10812250BEDFB4D7133FD58F4587BACD572505C84A7D3802D27443175FE0 +0D89C3398B55176D8642AFBAB5CBCDFD6220C8488564B4306D74A58CD2921AAD +73CF803C754DAC2F30A5324886E273064FA51781D5BC596BFEDDCE3982EA1AA2 +62CA7BAA1B16C6EBB99B2AAC4E6C9CEFB3D10F19987045C4918DB239E6E63D79 +5F44B9D097118D081153AFF96E5EB39CBFBB99A3BE30909F614869031358EB98 +F07A97EA78AE50375941B2474DB46AF3305F2B208D45921F93743A6CB8AC584F +6BEBE25ECAADD5A789EF60C9F54446687E7B030DA3E5243189F02BA46BFD28B7 +DC14822E136AC7E40CE20458DDBF356488045C95907363864CD6943643BF0109 +EE027A3091C11EA392EA91320EBFEA3B857370AD8EB86D73F035A476F7058222 +E8CDE78CA1AA9EA69A8AA6EBFF3E67324C567B914134DE042D6F8F18A9373107 +536E8D90189917D343F5299024239E2EC1D2D177D82DC8E344A7CF2AC71AEC18 +36F139E7A4EB59A67192BCA9ED0EB25DE13032F6FEAFC3B1F4FC81BB0EDC41DF +B9EB92618667C59EA499B788CD26C2137D70F1B0AF793AF5AD0D0941F2E746E3 +F5A7F0288BC1EE11E982EAAE763CA422D72FBBC0D754AD58FBF92629DC8866A0 +431213513744DB48E52EFC89C83FEB082588E4F30D7DA77BB598E51CAE7E4900 +5CD570C914EFBA426BAFF7A56FC775ECF5BE13F2C42E51EF96784E5201C0B64C +074AC229FF0BFDF71E6D5E08D8755D2C12B770B6466A9C9C61C15582DCD2FF78 +E9E74DC2B1CAA344EC0339EBFF92CD2CC1D62E2FA8FF15E7459A83C6CFA58A77 +2F1A40BD276E76B675FD6834052B33BF9190F04DF6AA5FA3BB7D77A88DD5B600 +324C5E28216F47682EC29EABF35BA842BA2294A3D72B126EBB852AB741186C9F +FC84B12DC4A6CEC08F2D03EE61B65C845841EE17F1B765649A +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +{restore}if +%%EndFont +%%BeginFont: CMSLTT10 +%!PS-AdobeFont-1.0: CMSLTT10 003.002 +%%Title: CMSLTT10 +%Version: 003.002 +%%CreationDate: Mon Jul 13 16:17:00 2009 +%%Creator: David M. Jones +%Copyright: Copyright (c) 1997, 2009 American Mathematical Society +%Copyright: (), with Reserved Font Name CMSLTT10. +% This Font Software is licensed under the SIL Open Font License, Version 1.1. +% This license is in the accompanying file OFL.txt, and is also +% available with a FAQ at: http://scripts.sil.org/OFL. +%%EndComments +FontDirectory/CMSLTT10 known{/CMSLTT10 findfont dup/UniqueID known{dup +/UniqueID get 5000800 eq exch/FontType get 1 eq and}{pop false}ifelse +{save true}{false}ifelse}{false}ifelse +11 dict begin +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0 ]readonly def +/FontName /CMSLTT10 def +/FontBBox {-20 -233 617 696 }readonly def +/UniqueID 5000800 def +/PaintType 0 def +/FontInfo 9 dict dup begin +/version (003.002) readonly def +/Notice (Copyright \050c\051 1997, 2009 American Mathematical Society \050\051, with Reserved Font Name CMSLTT10.) readonly def +/FullName (CMSLTT10) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle -9.46 def +/isFixedPitch true def +/UnderlinePosition -100 def +/UnderlineThickness 50 def +end readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 39 /quoteright put +dup 45 /hyphen put +dup 48 /zero put +dup 49 /one put +dup 50 /two put +dup 51 /three put +dup 58 /colon put +dup 65 /A put +dup 67 /C put +dup 68 /D put +dup 69 /E put +dup 70 /F put +dup 72 /H put +dup 73 /I put +dup 74 /J put +dup 76 /L put +dup 77 /M put +dup 78 /N put +dup 80 /P put +dup 82 /R put +dup 84 /T put +dup 88 /X put +dup 92 /backslash put +dup 95 /underscore put +dup 97 /a put +dup 98 /b put +dup 99 /c put +dup 100 /d put +dup 101 /e put +dup 102 /f put +dup 103 /g put +dup 104 /h put +dup 105 /i put +dup 106 /j put +dup 107 /k put +dup 108 /l put +dup 109 /m put +dup 110 /n put +dup 111 /o put +dup 112 /p put +dup 113 /q put +dup 114 /r put +dup 115 /s put +dup 116 /t put +dup 117 /u put +dup 118 /v put +dup 119 /w put +dup 120 /x put +dup 121 /y put +readonly def +currentdict end +currentfile eexec +D9D66F633B846AB284BCF8B0411B772DE5CE33C33655F6FF751F340A8D6C01E3 +2E02C24E186BA91B34A1F538959D4450CB683EAE5B034D030186901B458D3777 +6B3942BD2E07121385120248891AEC2EB33C4E3A0CF00828D0F130C31A918C18 +979FE94379C648EF21ABF659253E43CD1253866F157F1DF85AE7E8714F061B1E +ABA3AD094FE8D6293916FA82EE4F486C7E513A06D4C9BE44306A8287970B4ABF +B6D1F9274A5A0BB6ECF713ADBD1260D5D6C4420D357FD486470A74B2F0621B59 +A9373ABECDBF32FA68AABB66FAB0C970A3354A335FEDDA1C288245E6C890B8DA +3D0EB953283ABFE372221EEB1586B0167F634E3F29CADCAB484B81A243CE1E3F +D5106AD6BDB1AEC91123377F816711CB9D5140120FEA84B8205B79D1569509FC +6B671211985CEF51691C45A168740BD826464B2CB0ABC575E7D453161328F80F +3AF1C99EC219010EC6C95E0A8D1909719CF18BE424967E90DF67537220E60C3C +4345B154D08F9EA684710E659DFFB0BA1B7FDDCD519305900A5E1CDA219A6C90 +DF8BD712A3686DAB90344E8784C7A9AF3318550285039B701B9FA1D3A3C3B6C2 +753F1E794A3463A173C99A9EC0E2AB5737134CEC2C97CD6A37E38692ADB4B131 +54697B7BBBB23680C72CE96066D8007B90AF0FC5958232AB4F21826691E9874D +107F47DAC1026298D787989BD77CB43A09FC95F6997DB00D8483AE9C2716CBD3 +7CDF02DA34FDA2F0754ED0968270E118DDD8BAAAA65C41D699E2BCC2556AA231 +328187D2F50FD518CF458B0BA1F7DBAF4B231CFD61D5DC56335B53C3013BCCC9 +85690E19E992ACE55EEF2BA7A75DEE6DC33933C226FC1494269B7CA4CBAE987C +2C787386400172AE3F44AE47115F4117EED866713BDDCA4A7AF658C49F913CB7 +308635000043F63BA210410A66E192289592882C477B2EEA0B2A339F0E7CF450 +CA0EF79D3A6C28598825CA03FD688DA60C95EF707C6E67CB7E57DE7A80545195 +739ACBDF27069F34C9E0216C3D17CFE7A652B910FCC9B9AECC2E646809C22D93 +FAFAD465DE794755AFF5BEC17160C9563B5C51D07022E2D3A256FB5CACE131D6 +F4B30F591A0419D957D8F0DCAA0A8D65A8D83422AD7C2613FF13A302E152B312 +3F1ABB45E42084EAC894FE335C07324849C9736D00C872C4551997DB889AF17A +A52C5AA77DEB548B0103B77F65717F70B90C1BBAEA7BCB4959F32851A9882A3F +55673F24103D6BF7FB3AD3EC3CC50FD8FBB4A6B13C3D278174320713A7B327CC +A71F01E50840B33D0FC3F5F6A6F2B0F2D0E38494B1C73096A430510F927235FB +69E931DA8CE5415EE88D0248565E3347353621A48F7948AC9EAB5F5057541B50 +82BA955D90BBC82E582FD71904445A59186022FB928015235B60830DA59813D0 +8DA3FC306C43FF8BB2CB6772B1F7BA3C1AA4B2343E7DA7E065EA53A4E5E28DC8 +0790F2D5CFB203CB135A08DCC9702B59A63290444F202756E55B9FB053F773D6 +0F69C63E74DE593E49186FF4304E8FA76C3E3006358DE549E946DB69431981E8 +1261C9C9A884E4EC708F69E6AF5D22C5BAC49F2AE85903E3D48D03B7B97054F1 +D2937A0C685D912D6D20A75A77712164DCBF8FE4D5460DACE139C5A934EEA09F +B94DBF168A4BC03A9D689936D833018FF43837DF9519AD10F357F00BC068E737 +170FC9FC6715165F733A0B6FADB9ABB48B845167DBE6D771C916577FC2132863 +767DC6E3D460E779254194AA690983184D934F5E858C1176B3862B69B42EBE7D +EC9AC4E020085D474093F7694C8A8C2025D4B0163E29320C384D62A9F3FBCB1F +AB5A374EF3DBA48AC2147A207AEFE8B78BECEBC55C97B538F3A0FF4589D171E3 +826342C8A5186224FEE54E4C6AD5EB02BCB4088B132FA1A48362824BEF161235 +8E661DCFDFD8429C65CCEF63902D0E07C2FEC1DC2756D942F13FECCB7E8A8048 +345338F24B7808E46A04A915C111F939E2669A12FAC0BA4F74B832EAC83EABEE +67E2817C058E69C2010F2572FDD15194CD8DF0FE9F827D349C0444A18D1A86FD +802BC120A5114FA3523C221242C7E767B0AAF6AD15DA1561CE8EB18A2401D71E +20481FA5F1E247CB5288F47795A6A3A3BB186E89EAAC4A54AC91405427136127 +5B151203426830F7CADABDB3FF63B40CA29CF8E667E71615869978E99E6F3F07 +0170EACDE3DC62DC05681D7680E2E96C30002AE34A4E5EAEDF88577601A82C36 +22D625A03B0451D7BBAAAE0C396711500E94A482EA787495073F16A76D1657DC +4EA7C7B83BC30CE7F145B65B6E2ADC207D192CE3B5FEF7031F4BD64F57E1BEFF +CCFFE06F1E4ECA48B442DF413766A70DA626359183A9B24C70419487423C816B +4BCB067E661E47E172563090D6328BD738D2B0FE41A0C1D7A47576A79BAFC880 +0473229D134F998909898301CEF50A82B627A9A06DF59D0B9C530EC5D877F1E5 +220D3A1ABD2ACBFDF1933F92B3137B22B9F95A961D93B729307749A50D8A6403 +7AD0F9C40743E39B8D198CFCF7C033D99440D46D821D97545B930EF92E7AE005 +27F2FC766FDD4790FD1913C7A13328E73E587618ABD9008022C5C6C23935CEFE +B5ECA2CEBA1D25DD846B48423F7186E03B1F61C8F1D5AC95CE03C83B2F221300 +7A761D6CB5F7F9251D3F9A7F4B25B99EE7A1347ED3059A811A82A35A033E9B07 +A4FB2A95009576F48665605C478E5F6C1B135016FEB4AE6A6BE4B4359836E04D +45AA11366992162973FB6266547C2E570B8F56F6D992D2C0F63950A16839FE10 +F56E59D93A37573E3268C5892C9F3358753D1FAD6379E82BE740FA17236E96F7 +C53A2FF785FAB86AD17EB1DE8A6AA9C69B91C9D9B43B5188E51F6939FEC21B65 +AF17DCE95DD3BA4F1DD51F0BD5E5869A1ECA7398B6E664EB0D189181E9C23012 +DC1E54C146842A90909DBEC03B79B58909205F2CB2A7F83C66B437D7F7DB9781 +FF0C67F004E979C95B706D8D85255CCD827CF6196D847DB380B56980109E96CA +997157BE78A4F758CE59D78158A854EF2C20099438F74777D3B0298D45BA86D4 +3C0AC30C984718FD62ABA0567AF0A70C1DD41953E3E7212D5C562085177E650A +2ACD49940551E3F7619B4CC31DBF67AC15D938619B95DBF66E6D1300B1BB8605 +31C4011379FB5388CA49E4A9BD6C921560CB8D513F8716A0733D2A7D77E62D22 +A69B54E9048CA168D210816E613CF6357706EF6B118A1263B858B7E19AA98891 +43BD675B06C893579957BAB97199ACB82C080593ECB8B66A7334779CC16E4D0D +4AF365CA6AF9727AE29417B61A5FD52452873B1D666044F8E7C1F6C6AA3397B5 +94A5780F4005FB5E41698FADD1594B505A58253D68D2AE3320E22165D198050E +425820CC0A43FF1D61F168D87CDD30C14D387610B6CDB63BAA39B3EC9B3CA616 +FF1CC679227749DED3DDEA26B4D97C633090DCB8D8A6E5E07E3579E4A99BF1D5 +51E43D1D7F139C9CB1D76D8F693A3F23A74EFBE79F01E0B850BC6B6C7F62C2E9 +859469A144853434895D73DA6BD2B348A48BA80E79327ABD96539F2EA2209852 +E1BF6B0B819D7C68A9A1D0F6F39416E3EC4AC21DCD3C51D3B5B8D417EFAE165F +2A7E0B76E558AC9F685A76FEC7E3C73CD607D9025DE6113BE5D0401887A53910 +82A813B026A502B51D484797D9D7E79A25B6624940AEDB4A15F2C73CA1AF60FA +22D15BFBF268EB044FAE17822511AC6580D1D74DBA3C3335217780B29FEE792D +200B00B8CD888A8BFF15D938FC758BB5CD9B3E08E1AC6CD1669E663BE86711A5 +892684DFCAF70C11E803164994BDAD89128AAD6461D4558AC2ECA3E05EB56D32 +0290AB16A6DF7133DDCBDEAE89C6CD83552792E23CBF567D57E46548EEB0A140 +437492B53C14419B6FE7E64AC23923A9E85F56A9DF209DC4E6BCAF1E045F9CA3 +BB904BFA150F4083C18B0CB5580450CDB657EA768E71222C71DA911A722AB9D9 +E18B6847F417125C40EA8A0CA1F551A4548712D098209C78DF9C3F78605E5402 +DA2DBE2218E49B819296D5AC88D17DDBA982E171733D1E9E295B3157C9B90BF1 +CE68CB185947D1E3D7544155B741296D14B064BEFD3E6AF25C74006CF6800551 +80FCAAEE6FC9105E1674EDFE68C45617D8D3E2264CD395EE94EDD017EB85884F +FDF530EDF4F3F14750CA066F149E688FAF8EF4B5FE6AB515CD298E8D170346CA +9B32BAD1D86DC147BD12EBEDF6CE1E749C5B48314F512470A568C172C35CFA41 +031E34586A89404CB5372D7B2C7A6D96F420D4D7C2D4C08184F4AF86B4536A90 +9367598424112A7B05D7107B23695CBCD569002290599E0FF4EC5C852C31F5F3 +9BD56BB840DC17DEEA579E7A7A9F764788D4E3774BD523D21267869224D68891 +4523070E80A123B58F7B579866332FC38A41A5915EC06F2D14FBE4A6CAF59AEB +57E98D661637EBB885AA5D74AD429CCFF64E5149815E7350118E6385F4C74E0B +2EB474A6DED021D429F01C9B0634A09250C40E22B3BFE1B7246D18116D585F39 +0E06E9B5F27A6CB77C8E9462189CB900CFEF08F798CAE15FBD94587F33816EE9 +03FB2DA6826EB69D8C284AB9F7B00630D0420EB6E35E0E288BA25F5C2345C067 +22412633898AF99C2FB232D1469025BF262B567F29A05F4816FE8EEF5F02BD79 +06202F6A1E3E5D4B3C91BA8D5FF53D5136BF70E5FAEF441A7310CA83721711FC +39EE48BFB2FF287234B1A6102AF146B10A632A53AF97E11FFAC3A2A86BBAE3BD +E0459ECF0305366078066F2CC628A3918E775E4236651B3D817AF1684B07A163 +A0142D16F55D2FB5F2255A8813B8E54EF3E801E95A4A226AB8C0476AC5EDCAD6 +9258ACB6F7C0CBDD298A0B816560622A1871FBE2FAEBFE697A8216A0D8FE30C6 +B1BA6C3E975F78182743842E7F851064037394142AC91B2530FB1D511EB20F3F +79EDD8B7E1579D35F6E7B2883C47A46B6C1A458BECD6BE58AAFD834A7D82A553 +2FE4E66878E4699856DEDE964F454638F768AEDB595A883E380408F558015FB5 +8720954ECE2704AFAD4D62E8BB2657C4FA920D72248B3F762B2F12D125B796AA +1C4BD6B42D766EC1C9B2C7AA4B6A3474BF753742DE8AB76D0AB0DD9A20EE2DCA +0F34CB25995ED3183759CA83ABC32B8BDF0B06EF169252587971F7D37463BFA2 +BE36B2E45559DD73DE7CBE29DE92B9BE6B9F8093F934BA311D81E18A8DA92FC3 +312E3FAB43C53E803975981F0076EBB8F257C123908450661B6FA79E7ECE98F3 +B0A94E0DE3A4DCC8E0FEC106CDEDAA297A75BF1E40F3C2419BF72A644F452E2F +9A8793810319885EB3AB23B1E80E8B62A889311355C73722C18E62711A7E6A16 +A5B923408444B13F6522FECA9A60B067EE332B83E1A69CD835C9D69B5D8859D6 +91F9276863D2E2E8193641E4239F4ED15E2C482C735BF5434BAA454EC2830C1F +7CF766DAC9E924F17F03093132627673BA3D99DC2DBFC89E5BA032C16D3C1C8D +78B3C464081044DB53C7A29E925F4157EEEE928C8E28EDA5F0A4BB6E0042D8AC +7595C350645118172D04FBF06B2C9A9F3603A54B57999E2960C993724CCD6A09 +766BDF73F66E07FCA9BD09079CE8010E6CFECBE2E5DE1EA4E280AB78D5184C11 +016385007CB5AC0BC95955A1E88EA1A1D8EFEA886007708BA063F556D9284D4D +C764E75CECA51BEE3D35DFCEBF6175953D30FDAC00F23B1721A1DD577945B5E3 +8176A21A649D907B5F63C71718ECF32ECCF1B26BF15AF694F1045CF98FC75278 +E9782ACD3D83CBDBEE690D29B3176E745AAE436382D258CB22F3DEDD02E441FC +6A9931AC2F61156DE258DAAD5EDAD41E6C0DFC902173168BB4F51DFA7EA615C8 +B0F92FDB118378CBAC3D56B6B9BB0883C0C14EAA67396AAA7987222A132B7959 +44FC1E9D6DB6D549DFBEF8D2DD8C53DD3B66935FC239E74E2C440CCA13C068EB +C4A3B69F499F573D076E2C92E24F2C69B806591B0807CD903E078683854963EE +5125C3640860CEF37BE186DB781475554BFE6C528A9633AD5772BD53244E24AB +42CA2D1123AF45FA257940CE611D83014DF04E60220E9AF27CB2A2247BBB004A +F5722A5EF058FDC7DC2B6ED1406649DBAA58DF2ED3A91483D60F11C4A39BAF57 +CB1E320A987B790672CDD3E3BEF4A67032244DED2FF4588B2072CDABFEB36009 +9F4BCBEE16F811A44CEC77F8AE873C90C0F4C975E51014ECBD45A56A63F034C2 +82212977023A132E5C88AAA826D841FDE9CBCE7A01E4B6F0EBDDB9A69EFEBD72 +0B41EDA807CEDB791084047624BC11CE10B7A0A311272EFC9E013FA374D97EA5 +F7998FD908748CA72D8CABFD0F01220C2114D3B462B22FB71A23B284B1CBC7D9 +EA20BE71F8ACCED21F096009A14A7C7B51450BA51514707EB46B9FAAB31CFBEA +E1DDA6F5D9AF0B6E7D05A1EEEEECD606427B0F2363D1B882B50140466B9D3CBD +D00DB06DDD1BD4681E367DAA4B7C405C6281B67FFF794041738FC6A01D261CDD +F6E0A330985F2CA782CBCC02B6F4EE5993434F656B91A51CC03B1D73FFA6629F +14F6075EBFD83B702D8844A96CFB5C14051595BC7DB2218156A6DEDA5C98CAD8 +BEB5284D9D9F86406A8C1AE85857185991C360E5F44DEF352A1F301207BE94C2 +9A3A11BA468FACB3FA2D683419C44EFDD7C8F1079659F3ABD89D7F168B1591E5 +6105F9B3FA481BA953CD34CCFE73E427D3AFC46E5C58C2981198BA284DB8B37A +6647BEAA561799877DD6858FCA71CA6003F2961FAA529906673EA94D82D78116 +4DAC81011FD175DA707C1E15D4B6FF19F8720A4E05E6E103E2DE880FA9C192BE +C5ABE7C311C2ECCBCE8F9713DBA74AEC37A61C8F21F271B35F0F7C88B182525B +A4183377597ACDA9A6E2F181725D427795B975BC4168A408D292CAA484BD1B8C +9DC62E737ABC805C8FCB7E96454DA032B601345570EAE0379BDA84BB6D15D780 +42FA1E068A7D62F152B43B788513E13724666FAB4E2B4F04B0448194E46582CE +7389BAF0D1DD4435BAA6B82AC305C04686B89FD51197C721D941BD2893596024 +1598E6C2BD84527EDA6FAB782033E4BB4F964FBACD96CAEC3F3CF89CBABF6B4D +4D3AD14A03D4BE931632BB03BC2B92842FAD51A19A756892D5B978DB695D0540 +CC9D030C612E2B201D60D09F56332DD0BA1351EE62816C21A35C33DC11B37BE4 +D2F164ACD836A5CA1553CBC733E3B159860454B17064B4E22D3764FF6293BC81 +CFA3B2325C8E072857F6FF4ADAA8818247D431A28D3C5FDFBFB24A6CAA327AC1 +0B3630C84ED9F0D33B8255A3CAA9C5A0C79F7BF6BA3B9801C3BD0B30AEF7CCA9 +92F25E332EA97A7CC653C93D1497992D6B76363885B92ADE34C2A33E30A3B1A0 +57E9C16D8CEC189565808D3FAC92973C71CDE74DE9D8781CCAF88747758014C4 +5B62667D4D2CC5EBEBE77C5AD00C6A69D1819F5A786964501E077EB3BBEA52A4 +57729AEDF35253F7E1D31F2DD1587BC15CCFC1B0CA930DA83E2031B099A38158 +8D1849E7145AC74777A3C7136DEABB0C787E5A218309A65EC7D128147EDE3AE0 +C0AC039B56F767A22555CFCC12DCBC7F5A5A3B4E86EF5A69EEA93DF0BAF2A3F3 +7504F5C6A7A67388D2F9045BD755BEB7DFBC2EED679497EBEC808BE20FDCB5C7 +B586463BBB898DECCCF7249E9047DA943FAF0718A2050FCFDF8A4C2029FBA674 +EA64003AC03A847185936FC375CC67B3006EA681F61F640C3640A78D0C7FF521 +D477981E23E5956BAF42252463FDBEC49BB560A9428D248B0C5250CFA2A49CD9 +DBCEF73123C13BA382D3CF6A7B8A8CA3191D379A659F0E2C6E9CAFE9DA2AC074 +F622E397A2F7C73347364AE249B11AE2C34AA7F0D27B5F35D548D5AD1228597D +D16A478C901D3A34D870BA39F770885B7DE62298F0114752435050E99EA4E5E0 +56B965EA185E8DF96B9FE97EE23DD45AADBFE02B427222B9FC99DA94FB2648B8 +46BD30F881BAD3820DCA4D8093BA0FE70E03482CC063B751439125623FA7AE40 +52DB2A380D89D5E37BF264CC73DA9A1540031587F481A0F146C6ED6F3F2957FA +19477F075ACF64D424279612DA5AE02B2A140048386D01B1F30EADF2050B71A7 +993773D5B68C6FE65EAC53411AC6E7E26E49BE5FE1079A8BC565D2CEB7E3B896 +593D720DBF66CDB26DA5D8E533A346845E31374A7C85FB6B06C3D54FE3408013 +864CB0954A2FFC00ED17CC167AF714716376B789A71059DF2032E0E907761E81 +F0C887810337F52662AF43FA1A7528923B0A30A217FA184ACB73207EB3018D5C +09EA88CA0873AE690E94D43B360D9C1070D7CBAE9BBA72E82EF9914D3AED6D1A +5539585EA969F0A1407C8FEDAB69BA3EEE3097D5B123C5770D5ACBCB0882F35A +E8A3E3B1FE3903A941EA2090266B60D218407AB99EEF38F18C9FA307D73E2F5C +42F8C37E2F668BA6B0779791D8404E2B2CA52E28F0B34C85250B0D6AAF9D2DCA +A12133B5B601D971345EB6D892B85FB971DB8C4A4188ADA6575DC6DC42D2F0C8 +4EB946AB47F487B6B4C4C59B2FCEB1291C386805C5B62B61FD7310A13B4620BA +650DDF28FC1AF21FA124C16EE8ABB98904F03E7F49E54348B1AF2211A1768768 +D62E35EA2EF7F2756B58168F9FFB5785DAEAB324C90FDF6207E670DF277D6AB5 +F0924B26BCF52CDA2980680320314F41244B73DA6367C434B5DCDB96B6F0F454 +89BE7553B58CB230BE71B2C7A7F1D63C3B1E80C159DD941027EA44D54767355C +6EB30D38D407FA1189474C2F9D3FD92F5CC6CECC63CF6CA6B33D77F08D274A1B +0AD7C2DCEE55F1B425BCB98F24D0BD431A5BAF6F42BF897BDE9198E6BB331C81 +6B5B63F3604235FB733A882BA5464A3E5415341C8E9A2E79A5896C8C334CCBB8 +A2047CB4E6BB167BD586FFC4A1409B4C13DA0B84608126D10754D562A9812A79 +F2B3078B7CD1D0A37A192E1D58623331B582E62291B6EF6FE3C92E8EC9A40C37 +B251270944393FCF133426FBCE86A318E16141654DD7BB12AD46B60A05E86D3F +14BDDE12FE3B17F9E2443E057FD0A25677D1F17C2BD87F84BA7D6AE3E7EF3EF9 +3DEB268B580A7823253430FF8D80FEFA0F9E4F66D0733E251E7F680B8B23B7B5 +A614F4FAEFAB880843451E4D9840AF7B8BBB6333E010A169528748AFBAE9A6D9 +499E221149C0AA19D536F3F121DF1AE056D3D0FF5C6D837BD8061153501F0209 +79076B4E0C63738C54BB31156F2273A327D3B6D0DDB5039D27D1C4020E90C94E +4A4B156B32F28DD132D2AB4D9CFE18B7851A65BA965382B23CCC0915EB6847A0 +B14492B0405395BDDAB36C2205F229891D989196608455629CB3CD67E07DEDB6 +A09E68BE431182D6CE52CE41B8531FF111ECECA60A68E7E7BDB6B91C7B694688 +47786E04588AE7D21DC6F2309D492FC9795DD054C150ED94110A7F89CF3E92F7 +4649D3F4C778FBF02ADA9E577C5EBA24A1F0278E9D9DC5556A60EADEC068AC57 +5359E9FD0D2E3E7B0006127F95F333D2BE77C70EBB163EA9679207C76C999903 +50D76BDAB2DF0D6A506EEA9C952A3D28D419FB78CC64078CD91C39A5D4FCD9B9 +D135A4E24E373E24047EF1180D3BF51DE4167F3945825B7124198FCDF7432E20 +C35BE9B0C7C0CC194867C4CE9BCD27860826C14749B811E8FEE29015CD65E7F5 +307300B316054B7914CB7464E6AA37DFF4BD0AFC04C0E8BFD1269E2D4CB5A201 +785C32B6B5656A7F6CA6AD8F7C77DF8F70B8F99C88BD8D548E78986096C917F1 +C0C195F4CE7972F1354B95D1BD84934D80CFD09FA14F3DF37300B5E8C208C66B +C544BFBF9B18AA7E27AC4E8567CB7188C20B1807BE56BB2B348C551767F40A07 +022EBCBE0749DE0D8FF1E2792A0BF2B84C940A127203E2216EA4F8689C84C739 +58D5693082E057B67C9BD80FBCA6463D9EFBA2B9F4D3C8F239C1A70D8A4A824C +B045489E1C6BCD28DA4F1BEA2BD80D424722479D0E8A1A99A8B2FE26822D3198 +722E2D276A123A95128EB6C5C6AF9AAD213D088EE92917E0870179888296F4D1 +0FFB87A340D7F052B07C6274027559A8B3843F2422C3640848CD8BF664645EA7 +20EBCB14E9B15F552E9E793B2F5D7BFE849817CCDD9BAF7DBA26BEED536DF80B +E250F831A12EC703AEE5ED6F5C688849B00C85AF124451A29CB67398FD3D4015 +C5D8824B7EC81F85CE9170560BEACD43ABF5EB5329A4E38431F243099B8F88F6 +58E8F6A7DF8AED9153CA90F9C941320750E5C26262BD14CE3CDBA9AED2270546 +24917E378761B5A96F0689511C12A0E598E7BD54A6ABD40AA4FE651AAB9DE733 +88677F863423C714476E797F4A22B94AF646819D91F9612E6E5CCFD9F7D11AB2 +DBDD3C8ED9D257E5A8BE4B7DF9997EB2ED23EBF4BFCBA1993796E34AD93C8CAD +DDEE75EC199BF642C34BA24E323A7099C4B7D232328ED3C7A3BD476FC0B3D921 +8E773970ED221BFD47FC656BD14FEE47F06834C55C0EF960DF0265E847EA4421 +CF81FDFB40A4C997B1EDA3556FCD8BB4EB141EAF4DF853FD353120BBD37D4B44 +2CA1C1D5D8A5626870AAFD925B461A65FA0E2924A197F27B224E53A7140A83C3 +10A7F3868E4801C216EBFC5F8391A1576C69537686DB1CF7F2AE299FB03CF222 +6A38A57466A9C0DC13E9A8200649DA837A6C40E002C25114F0CFB3D2C0A9AF20 +C7B387856AEEE008AD60FA1B26179D95B3486DD3E5BBD096D4B105117418F60B +26AEFDF53A815F712956AFAE0585B243D5A2B4AF5B517023867F57ECE2D538D3 +89804EFA77C0D9CE905A3303F19A9AB3B228A03B88CB26631814A36C27D09E56 +E965514293048ACF6BBAC80329F0422591F06637A274F2582A6BC59ECE5DBB7B +7CB5056822A2426E4359DE632F89734AEB6F783952B007EA1D2EBB7CFB1C1D78 +7EADDF28CA76CE34F78E568B11AA69FAB64D8B0FC933FAD372B9EF19D5F31A25 +35BAF075193980F69141538B7E7586E8DB534762CBD9E95442AD17C8C2F438D4 +DAC23C5F5D772D1809ECEB13809662C6C8B97DCFA5AFD46C6CF3FC6F07BDD604 +5A4C473C7FF3ED34462A79487EB47D5BD4580E98BD44CFF016DCC942E831F7BC +759A345622F5C65C067C83F7474EBEEF62E63F5B49519E0E1A7BA279784977DB +C646DFE8D0AC7D78CD27B8F9D8E18A3A1C1AD427A85401543B0CE4F4469FE14F +BFD02FEBB2050BD06558FEBA3F61D35AE7A0E49639DF68910174F41A20F5C839 +79545CB64FA870FA9AAB20B80CE7D85DB8A0F64915E1742E5835B5152BCD4B89 +4E7BC34E8D8CC93F5DE675090B7BDAD2728022F29D6A7D0F5508A189B8E0CCBB +87AB29B9680978381252A9A37AD5CEBA8E4F8CA2C06D7A2133FF94B3AF05EA7B +0C1497955A4E04183092871E66A7386E063B58764B62C33B6997F2E0D7F4AB76 +6093F606DF3C4E5F8A06E9D602E36F2DF4CA2E8C59EA6F8537A8269EEE427271 +E1FFFFEC053811328AB1FC60821F4C13D277EC66F56F27E0208726C915CBF178 +D2DFBEB767FE08AF1DEF4219F6C97BA5505DA3CF06BCE02E8E5013872DDB0E9B +01103E8F7213F1A00C473349820BA7F202C9F8632B9D7AC4FCC98287175CB2EC +7800B05D4A7617335D1CCC2094F70BA6556A99F2B9365409971DA4BA1913B7E8 +D6D84BBF1CB40FFCBC9B1C6306E9A148F39874A1E2A8FC677EB621FB46304D59 +B982A381886E99BE387640FAEFCE8182A2CC9AC76C1078D9E03CEAFA0747AACE +16F9A95F5A97265A208ABD10C3BF49C1856461B710A29887CB6D57B61D24DDC1 +5DBBFEE1DD43EA93F9B0B70276253A89546A4E3918B5C93A991AD372606F091F +EC35362E95CAAC00280DB8BA15DFA28F9AF7A6F9EC51FB2ADE3D15599AF01627 +B4D96F3D35FC4995EB18DA916FB6D24B56D60084E0CD8A32AB934845FF24B689 +67883D3EAB40BAB8FEBC3C17F6145CE0B96BA50A9ABEC6F1FF955C9FF80DF500 +BEEC7AEEA8C2FAA50968A57FFA5E9AFBAFF08451A63625918621B8FE9A46255C +86B9E145C2526E4D27F974D74221FC90BC691454D7CC6413AEE3321D64E57F58 +81DF5C5954C794492D4135F130855678C8BB7C4A3E3551D2E89F3DF6B049D857 +9115B3697E07024C34985FDAF5EF24210B2864F9471879835FBFED10D7535002 +E806CE05BEC90ACF31E49AA6C62D9E169196A7C358E1AA5C886C1E1544568C2B +500F208319AFCB37CBE4A568136B1791844DB5B627F66C75DBB7FCAAC4EA4620 +323DD1FC501727D74CEEA2C3D1B4D63779120AE0B0843FC978E1EAA6FE4FC337 +46F12F90D6168313CA077B85990EF9C6EB27F71D3B8C262FDBB297B1B88625E4 +62143BD515F6FEFEBAAF35ADF8B57486A14DC57614488C332E2B81B946397168 +1069CE21C21E8F44B2DB9EFC2F4160F17ADC55DA7218DBE64FBD5BABCA4C5718 +9748B61B8F7F9573847E7BB62DCA710100AD39FA555C2C3B3800BCE7C78BA404 +3DBEE48BA6328F47B1E72A507432BE4A7EA3F0AF034B2E29A4CFFAE8B30AF806 +F71936B5FE86F73F9C4B81123E1AE017B60EB2EB108EAC9579F3EF142CEEC861 +EAECCABA38C637306D8379C02548B4B33FB5D8A6169B3899A2D0499899946371 +BCD7D8D37924B66E4DFDF25ECD17408AA78A9A1D1C8A3615E428EDAE3E56017A +0C2CD79A0D92E6DDC54746E5095B4659D73A251F3B7FD7625CE7EAC3EFB61409 +C1463D4015619BA3746F278188E2F30F997D477491D39625C2B829845D4EA97E +56D7F3883CDD5938BF1BDCA2DF5BBD0E3D495554A01840E7E7A081A736DF6D7E +6BDD580F717261F6A3953157DA05AA3B57FBB1E977C6A43555F7BDFCB35C8B8E +B6356A4F1B01317B029918AB1C0400CD32A41515CA55E59CDC9C4641A570DA65 +96FA304094735B8B070FCDBA01DABC55C493A390F3A0B60D31C6EE3176BD5257 +F6CFCD17682833155B9DE734CE94A232BF9FD8AA45C35DCC0B16FEE6EC241BC1 +E944B183ACFFCBA57219D6BD9132E9610780D4AB07FB2F77428114E800CB5855 +0C26502E4B09AD0EC8A4B342DA732E24CBCBC7BEB15322BC3A4B004CB9652D27 +B85525C0E59DF15D972EE00D5D6DCDDE1A141DEDF0BF9309463C7D5D0D95077C +F41EACAFA40CBA65004AC680983DB2CC892C1089A58514051E2C0FC16D74056B +34151DCA72FADD08765BF73139A2A15A46067064490DAC5AB5039C545DE452F7 +35416482DD79C77BD0256D6BE9005C80902D9BE36F06FA4431F1DFBA7C982C66 +E141DA88A07902D83D1A83C0538DF2F8F8719409259196EC46B9D7815E17F836 +4F06E024C1A05A594BCC8C7489B3DE9E9C3B9D2D15B8149F6D09A35A8444CE1C +704E2B8F273FAD8128A6033E871F1A36B95969EF3EA5EE8DE9B2720FED92D43A +B894DFB54E6F3E4D92E18AFD7B4D72FD675AB7447729F4F618FAC4938ABBE9BF +29045FD578CFEDE3BAFA55419C564CE39F324592304FF7B339DC2D889C157BE3 +A182E42DBCB6BEA7773CE2A058EE2076C77CC98F0C37CE8128E1671D8BD8AEB3 +1E724BE5297AEF6F8F90719D75E2218470034C970C7C3BC4CE46234CF25F3092 +526AD39838F4DD2399A4DE9BE341EA932FC616B02FBFE7EC68AD6E98F5AB3040 +C00C615ED7C7D427387D5AA99594EAFD54D3CE88DEEAB0A408C14B48217D73B7 +AAFF60D219FC71262E05BF9D15DA7739FAB52683D27A3E094B40D84E3C272D26 +F9CC125000AADA491137363EEBDE57EF302943F26E7DE08EC71707B62E717F92 +BE14CB7F5D4FF8A802030B10FA8AB4D93286AC064E0547032E2AAFA3E353F4A2 +4B3EA80EF4221C81BA5698D58A460C0412B1C1BF143E547DCA6CCA584011B55F +526742925DBE8300564D621015796CD280DE573A0A733C5F6B2D4AD811EE4778 +FE60F46ACF6B6943B07B0EB0E4636823430A301B06BE688CC24785A8896BCD42 +39B97D9963BB74BD8BF05217B615983E27994FBEDB0577010E46BCAA04DB1A72 +77F4ED8257D145EC44B2B65B408BC71239F1C2E8434C1C2FEE4642BEA1C60C7A +F02BF44140D0DA3E94D7658312A212FABFC0AA74F3512D513E82248BACD86A15 +B5A2C71F3692C8D702FA11B262ECE33B382C681D54BC275FBAB326D928A6A327 +AB2ABFF6C4A65339D945A671AD839DEACA7412ACA3253B399BA17E363B213FCC +962725E0BD8CCE55985438700204353C507E4DB96C1B57DD7A071124476A5095 +BDA4C678F514AA63CADCF7003C73F0C505590526C0D1BCD7DAC0236243AEE48A +5F351E12194DE6754336416227A63FE6C37D472EA1688AFD88FC94922094E799 +930F9952B2B1B86D1436C843A90AA230139B82449E16EA8B29108AA624933D1F +5BB7E1EC1E7F570BD1DC0D2A9C338F4590D590AFE417D289B103E11156D66DEF +F9E1F1F3A68DF07D69FB9CF4D09F2E2D47C2168E0BCECB8BA1CF856826B51D23 +D440D7EE177DC922BA367BC69871D037A508B80E75F43C331F7BB5FC96493932 +0B3CA39DB05BB29C08348C3F0FAC71ADA5C07BCFD160FE677A8A030BDE2C4A6C +A866D89CAFBFE647B36F7931664F82997CBFDECB6F88C795609D1C94DC80F09A +87221FDA3A699D0748F97E682B5B8C7B1EBA75BD44070DDBECB03824F9EA4E1B +BC66A08A1A0F8AA3DC482D408C83B469315A2ABA685726CEA99BC3D15799D28D +F81E0BB958E34A1670C23FCEE68A0DADD2BE3CFCC1914A9FA1B1A661693ADFC6 +378969C2E400E5D4AB0CB7DC0FA364893D2484DA98264CB50205B7B9A2532492 +81A2697B7FA4FC77E71D3117608ED7C474AA2FFEE8B3F1DD942CB16A1FF06C6F +3741AF6972D09A5EDA91B4EDE291A7B3E3D481005BB578DC5AF13C88EEE51380 +78E57D8E073FA46B89A1DD73D51AB11B44048CE2F031031018697B2DA15BB05E +B69E9E54F85E09EE3EBCFF390A9CF28B6F0932A46C9306911F2F36B8CA3ABC14 +022697A6BC560C0A688BD1E49AA9F9CF4917130ECF08F8C500E0096A8BE65E01 +EE5A2618E3C9DDD1D227EB584EB0763C6294B91DADC65AA8F1DB42BA25E77B9B +AAAABEC083135CC61C18987128961505D602E409C3DB90F301CE2C792AB7ABD8 +1B7442AB1C8D5B1FB5AB30444752254A530B227A1E7CBC615B045031FB07468D +DADBE63C9D1AC6F9742738FCF2896ECE73C131063E6FB3B954A77D1CD1F5764E +3D65A43B627E8E7E10C5966C93E9794A3211D8B349D7F82427A65DA39B4AD1AE +A98733594453F400B9841AD3207DF9A908372B8B7F8EAC363D0DDFB90411A468 +1F3F0E7A8DE83F3CEC745BF43D341A20F53BD0667B70613FDB9B1379FA61BC9E +516118F7B1DC7A7B049E116A7A254F0A363694920EA156DF045038B14C229E6D +19417309B6DFF125580B5279D6CAE9AACA31A1D21AAEA8DE32180F3456AF61E8 +AE8011BFA62D7B5A8123A02131D2F622211D74F104CD729CBE44EBC70672C064 +6D8CE2956C78B8CAF172B77E78F715DDA875A492CDD8357CB3AA3ED817043631 +0D278C6AB079AEC3C765D5E0267BD01C1D3F7AAACD0CF34EF8DD2FC5FF8FE85D +E410CBDCE53C792C0ED5092162DB85E6465C058D95816008077E22EB8A98B8D2 +5A4069933FD3F3DE33926152C7DC712807784C17863EC78F9FD11A335BF8C700 +F4963F7C1A72505DB453012507A3EE51F7F2E814CB77769356C7654B9569B68D +36C1EBCFACDF5C8D91D664820758BA73A83EA9660E33D4589C6950CC5C612710 +E9E97BEB5CB43F4109FC0F9E5EA126C1A9F2C4617CA146013F01E810EED40041 +5D09159A5B53FAF73B151499CF4BA3B79A19034CE461298D1B805E161CE837C1 +AE9A7298DB9DD9E54C347E64772AF100A5C736173D5D9EF4C45B8FF6B0ECA17D +C1ED7FA96FAC530778D72CAB4D9920BC6C137EB3187B1DEE669419753B6472C4 +D29CF8ECD1D43AC03DB1413FE6D4A883857E2574C68AEC9AC7F7D3173E9EA7AD +1A8762EB2841D29BA98B8C59BF52ADB41A1C06A50FA66C169605BF950AFFFED3 +6CF7FEE0126C0AF7DD7A85796BE7D93A124581EF530AA62DF4CB06A15A17D5E3 +F6B6B72CD7481D238B2EF97123EE55872A43599ADCD48443DD9DFBFD469C71D2 +624FE39A15FB5CC331E29B20DD1994FDBADF7E2843ADFEFFB38AF6E727638848 +4BB02352C312A363C3920604853550205484499FE4B1D8A29A4913F440E37CBA +9CFE762651749B33BA532DDFEBA257869BE4585699ED7E918FF72D25F3EC0C71 +FC49EF6C38DD1105AE50D5DC13F6F1AE2FC3264C549FB4D8D1A959F25DFE913C +1ABC41ECBB5B538BA1C4870E73599BA518FF41B6445D40C9B9BDAC2D552E4533 +670DE0C40C155E46AEDF4B74BD44A521815B69981F4F33EBB774391320D8B6DB +AD9C9545557E21A90EA55CFA69B967F3E136CCA7A1E4C9D312D9D08940DECDC9 +1CF646FB7704DFDF783BBB1739DA1D2EF502B7B3A1FBEAD958DC99F086E6B623 +F33ADC3A758138E47EA3DE1FEC42EBC6D675C658B9AAA4C4054B1F81CCC4D216 +9559BDFD542140F2A101095F2B3FFEA124F407A8B650032265A48F065C3C5BD9 +66D843E3A2BA4CD7BF56A6A10D90345B51969A03DF45C91EBC2F3023A3E71B4A +B6A7DADD9E3EC5C70207F743157A9A0ECE23A7A95798C2174281A7900919878D +955EBCA90D02F07876BC3F5EB1252A82D891FB3E0FB9FC032080E6F700981030 +0E81FC3E75AC8623405CCAFA66161D5D471EA952F0FD4021754CB61A7B1445AC +0547EBD4D78F141651A5DEA6262F0A05559DEFD434C5485FFBEEE7DA647AFECD +6468D4D3905576FC4F670BA39F9956149CC371A31ACA929CAF0668B667DC2CF1 +8810C6CF9EA23CD5576C110183155DBF15F24CF0973532800274127C6C5C9C79 +EB121C5F0B74D824DDFA3EC4BD7BBB8799875B8A4776B60F840AE96A8F65724F +AAC3BB862EA6F8697D935C60C2DF962F042521BB1D3EB9C064F2CBFD84208D94 +0E9DD9242157F4D3DB05194E82FAD5EF8C09092055463620D1B4ACE3BF9CFDC4 +989840A2CE7BF62D69BBC387D0184EBD87755E4DCEB8296D1005E79779A19B14 +354345A8A0324F1E61D88A22BC423D3DB4686ACB6CCA3CC515B6A5CCA6C888FD +EC2CCB767778AE3FFD7ECBD8BF1828E5BDDF119247F11B299D5272C475C67113 +8F124D25A87AD26E8B7713A5189FDD920EAFC2D9069664744B6E7DE1AB20E798 +8BF9B8885BED5CBAB904032F6245AC752F392524C2FE09F636B59B17ACCE1E56 +ECDE4533FEE75C6ACA81D3FD7F6032B865D8B6F34DF1A99E01FB6534659921FB +81631346B4530CC2E6B15389D7D494A4851C5F7CB502B394E840ECB67D359B77 +E940F25E96B3AA4DBFB0689C0C8D41EBFB5A9ABF7B817AC487093BA1013E345F +B42647E031C22B77A319062324A7BBFDC9DAB8D5B1E0FA4FBF8036AD46E554F9 +6B925144323B7A79B103E808A43954DB3A03120EE5BF48438C0ED2807DE82FF1 +6800AA8EEEA5C70DE747B76246A437B09F402C8E1B545636E0860F670D10E42D +9A579DEFDAFC447917E0AE0AD49F49EFEEAD72A83149A22A82F909670FDF4A9A +B106147A6CD6D9CA4FD64191B7883E89C30FFC30D3262B9B09CD7D2440D85F28 +983B191CEDBCDBC06375195625EB247DAF10FC3F01259E59184F462B79592181 +DF37D70E698785E55E0810FC9A5094CA115B2067FBEE8ECB004856C68A18AE7C +9BB1186342D173068A4BD0020FC703BC1AE0D6C8EF419288D7D0F09042C5CAC3 +6DDFFAF9A79B811C55F41AC87F93DF99604165A6D6E5938016C155EC65393512 +EF633ED422AD5BF8C66AD82B3B2B0FC59F40ACA8B62B2195D84478F920C39EFC +328C9EEAB999D28CB365ABA1A99475D57D5BE151E107BCA6C65D535D8E83EF91 +35EC4BBDC0C5A124CE24ED6438F2103FA03BC103F899CC0E12428A807763DDC6 +CD11E4E11749145810B387906A7B3065BCF1E29A1815ED266DB7A429C3FB2860 +AF3305E4FE74E02626385FAB8833954B803CFF6231810CA8CE55EDB2DC2B1548 +82CFD8F105CC916B0A55E3955BEF60680B544501937E9A6FBDFF46E12B114967 +2066512D019B1D727D3759A708E5D8D8FCD99AEB82B3F660602F8BAF091A7AE9 +ECBF15E7720F671E85C5FE0F2871CE1EC0A7B8E923EDD845F6C8F8CEACC70DDD +B2F87D25890FF1DB39BFF89A3A35B8B14742B4571F412CDF868177E406C9D07D +B759D6D32A7CE22D9E9FD13802A170F20E9FD757B9DA76B12712FF6DD0E8F4E7 +4A296ED2795FFA5A0C3CE468C7A9CCA440C599C207BB084B1DEE83817A7F23EA +1A4ECF72B3786D72D12FE3123D33559793046B7773C9E93AC1172026014A1917 +4B66A90C5AF50072C231F0B633F00EFED86156FF0FBD451C161DD06EDF438A38 +91FA7FFBA022A4468296A7132A3D88AC243B69C70F21B7AEB32BB5AA21800620 +BE6C8116466BB843FEBE361D1DE93F7C38033C95EBFA922FCC45E812B48B1A23 +C33DE814EE885A2354B37C05E405D27A0D3870E19CC718284FDD45F7926758DC +62D79AC3C0EAF56B6812049148970442ABD34E0C0F49A6711A134C5568004C24 +F92B455E8085D77F48ECE5FE9F27FA91379C939919E78B60A54E235B0936B3F0 +E1300BB4CBFD05A18DBBBD76524B4084D54D990F5EA51E5670906E358B4977C1 +83A7124F6BC09AEC282DB90C2FCCD9D909B57959E6E68D2E50344100EB1B6BD0 +1A1FF2C2F0B250AC9B1FFB4A4EF3F28C022F7F873C7B3AF76E1830C9B039154F +B3C3BD97DB32958B718D53B552A7A0B033E84EE515B42184A22A10D77FFE32EC +0E1CD1708021D7931DC73448FB098A61C93B7D03F98465BA42D4B927AB115C49 +C0CB10C0BD55B16E6BA017306506D3D610ABECFA480D8840DAAF23CA03AFD9CF +1075C8E9B821499DE23D4882C081D51649E5C9BBFF1431057D95D61351287B03 +0C9A6BD89F33C02555E1D3DA7F03CC395C1E3633FC902F060DF903FC96C19719 +A5B6A39E +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +{restore}if +%%EndFont +%%BeginFont: CMTT9 +%!PS-AdobeFont-1.0: CMTT9 003.002 +%%Title: CMTT9 +%Version: 003.002 +%%CreationDate: Mon Jul 13 16:17:00 2009 +%%Creator: David M. Jones +%Copyright: Copyright (c) 1997, 2009 American Mathematical Society +%Copyright: (), with Reserved Font Name CMTT9. +% This Font Software is licensed under the SIL Open Font License, Version 1.1. +% This license is in the accompanying file OFL.txt, and is also +% available with a FAQ at: http://scripts.sil.org/OFL. +%%EndComments +FontDirectory/CMTT9 known{/CMTT9 findfont dup/UniqueID known{dup +/UniqueID get 5000831 eq exch/FontType get 1 eq and}{pop false}ifelse +{save true}{false}ifelse}{false}ifelse +11 dict begin +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0 ]readonly def +/FontName /CMTT9 def +/FontBBox {-6 -233 542 698 }readonly def +/UniqueID 5000831 def +/PaintType 0 def +/FontInfo 9 dict dup begin +/version (003.002) readonly def +/Notice (Copyright \050c\051 1997, 2009 American Mathematical Society \050\051, with Reserved Font Name CMTT9.) readonly def +/FullName (CMTT9) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle 0 def +/isFixedPitch true def +/UnderlinePosition -100 def +/UnderlineThickness 50 def +end readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 33 /exclam put +dup 35 /numbersign put +dup 36 /dollar put +dup 38 /ampersand put +dup 39 /quoteright put +dup 40 /parenleft put +dup 41 /parenright put +dup 42 /asterisk put +dup 44 /comma put +dup 45 /hyphen put +dup 46 /period put +dup 47 /slash put +dup 48 /zero put +dup 49 /one put +dup 50 /two put +dup 51 /three put +dup 52 /four put +dup 58 /colon put +dup 59 /semicolon put +dup 60 /less put +dup 62 /greater put +dup 63 /question put +dup 64 /at put +dup 65 /A put +dup 66 /B put +dup 67 /C put +dup 68 /D put +dup 69 /E put +dup 70 /F put +dup 71 /G put +dup 72 /H put +dup 73 /I put +dup 75 /K put +dup 76 /L put +dup 77 /M put +dup 78 /N put +dup 79 /O put +dup 80 /P put +dup 82 /R put +dup 83 /S put +dup 84 /T put +dup 85 /U put +dup 86 /V put +dup 87 /W put +dup 88 /X put +dup 89 /Y put +dup 90 /Z put +dup 91 /bracketleft put +dup 93 /bracketright put +dup 94 /asciicircum put +dup 95 /underscore put +dup 96 /quoteleft put +dup 97 /a put +dup 98 /b put +dup 99 /c put +dup 100 /d put +dup 101 /e put +dup 102 /f put +dup 103 /g put +dup 104 /h put +dup 105 /i put +dup 106 /j put +dup 107 /k put +dup 108 /l put +dup 109 /m put +dup 110 /n put +dup 111 /o put +dup 112 /p put +dup 113 /q put +dup 114 /r put +dup 115 /s put +dup 116 /t put +dup 117 /u put +dup 118 /v put +dup 119 /w put +dup 120 /x put +dup 121 /y put +dup 122 /z put +dup 123 /braceleft put +dup 125 /braceright put +dup 126 /asciitilde put +readonly def +currentdict end +currentfile eexec +D9D66F633B846AB284BCF8B0411B772DE5CE3DD325E55798292D7BD972BD75FA +0E079529AF9C82DF72F64195C9C210DCE34528F540DA1FFD7BEBB9B40787BA93 +51BBFB7CFC5F9152D1E5BB0AD8D016C6CFA4EB41B3C51D091C2D5440E67CFD71 +7C56816B03B901BF4A25A07175380E50A213F877C44778B3C5AADBCC86D6E551 +E6AF364B0BFCAAD22D8D558C5C81A7D425A1629DD5182206742D1D082A12F078 +0FD4F5F6D3129FCFFF1F4A912B0A7DEC8D33A57B5AE0328EF9D57ADDAC543273 +C01924195A181D03F5054A93B71E5065F8D92FE23794DDF2E6BABDA4215500A0 +42D1A3D0D02C0C98BB1D6ED0B7791274C38B038FC7921FF1FB8FAE7258C09259 +4B8E1BD9EDCEDE9ADAD9BD9598EEA9691589649A9A21539161E374075BEE3457 +689F308A4A7AC9F2FE4B301A6C36B0442FB92E3B002623493DC087800B5A0521 +0DB96A23175AC584DE166F59142779F26FEE9783E28DE49FC3A8D6583EE63FBA +610DA773CA18ACE6F64A4867A1A7817120ABF9DE4D17782866E6CB6B65A9F6D8 +3667C8D3E61E5356E35343FDD4C6436DF73934470916CB5F0ECEA6BFF092E735 +C7C355B56189D1DD5715EC97E50145FFC17BB1497315A9585D713A7A6DFC7933 +995468EFD0F59E3C15865B87925A3F2930E20D5A35970E2C44F1629FA16E00EE +EE21EFC50D49F5BC02300D0A7BB85E649CB4E2E828C8B1C5469463013E71D723 +2CB11BCBAC191AC751A2AF7FC228395CE9472DC1809052012AEC2CD66695DAF0 +4CA04234F0187F4116C93F59A7F1F8123DE87F111853B785A20CA8B49B3B0CEC +B11AD345E1A11578D2EFEB0536D125237086CC8CD9F34A5137AC5DDFD8746014 +D74AAE8239B81ACF65F379CF2153B06A238A2D767F294CAE0D79228F0B7D45CE +510AC9657A1776202FEF42F96D476E7DF407786AEA12DEA0013D3B4C5D0640F5 +BC5BB72C34066270399CE595827175B23B25072723BD24E07F6BCD9EF0175DEF +93714BAA53960F81103CFB731CED4A267B53727BCA3C97B0BA5004055D4EF0EC +F725658E53AC86E4061B489AD4154915C3981B3B703E1E2A8D390CCECCA99385 +45EBE35441B062D7D12DAB2B31569387187D74A4043FD71F1C6D352EAE0F6757 +4345FBFB6DB15CAE47CAC4BAE47AECAE5FF5EC19057DCEFA1B23F47364ABDF47 +088A7C6A2AE26B10459B6D41CB69182FD1472F326CE3A15B59255D1DE3B616D8 +9D1F12561038839781E657C896B8C58A32DF5AEA23732A0966D96C68C988ED7A +09B7E2C8F9F3D0D56879764781566299A4EDD3588BDF70E3D924D25074F30988 +E35BDD827AE4D0B4A06F55A9976BF0DB3C0B1D09CD08E8CB168B50617691638C +0EC1A791C228177D4FFB021EC3DF5082CA3487AD2EFC8DE9466A690ADDB4C52A +FE2A6DB4CC275CD33D9136E735279FBB2008D59E667905EBB04326EC33C98B2C +94744B7F540D86E90DED64572ECF1EAD3A58EC101642B245A9C7232DC8FB8741 +03F97883BB32FB955C22F878FA0FD114451A3B3859B0B5537AFAB73AEC7DB2BF +409E1FB41D473714F6BEA73CB085139879FA31710E01915C2938C37BAD6D7D71 +45B897E00857D3931A489EAC7B42BCE4E65F73F67FE027CE482DC47598ABCB95 +39E98DA8ECA3E23F0799D5963ABA6E2984DEACBE7B46B40ADC6213E0F4D08971 +58F68C946C748E4B4217CBA2391BE2086C9758F4E32C9B6413E48D84D33A6E85 +84747029C0A9C9B92841D217A902BA8EB333999D62FDA9F82BFC8ED11F67988A +0CAE42182E414A9766AFFF4B046A09D476F8E3F15A8C7829BEE982D8350BDF5F +F215F2BBBF68D4B567BAB798B9604C79306C475926E9FEC0F07A99F43473C6FD +B15AC29C3D07FEBAD1BAFF75AAF2FBE94F104F1DBF838044FAD94B661B06AECD +D9AEBD02B60CA4546DD6B5B5C1A3833ED07845671CEFCA8955CE0DE5DB8FC93B +3306683CBFB8E5B79A863DE78D455DE9D592043C2686F88A43140F8B9F3B553B +7047420E93E753829F8D47AC7621CFE3626F271E31F0019CC02D0B57F67BB47D +8CFB63E902EA3231C00EC66EEC0D30FE8394558BD3535C888C4CEFC6EB72E737 +712ADC6300162D5D79BEE0CA1F6E4127A0BC90656C01692F6D82C85550AFC97E +C2693E379160FDB9636FA41AE9C75B7F6643B05971C6D67CE30971D590FC07B3 +E0B36B4D1C7F25110B5DA2130D574FA292B47322975A2BADBDB39AAE69BDDBDA +A880F9AAB580117708C79204DFFDC08BF4A48919B5C22228845CE8C3109E93AC +2479E523B8A1C12A6E541118F121DC6B4EAED83491A03192D5C3A2A45D1A2467 +757E7B377C635CF5CAE11A7CB49D49F3A1BB2286090B5F0E4F89869D1771D50C +54B5C5E091E3048A2C194F0ED00DD64FB95BAC6FA9D61ECD093ED416DA3A4981 +DB07CFF17C4F55C62DF628EBFF06FAC3F3D3F91C30EBB34052BE1A08F5EDA4B9 +08977197950A282B84E21D43C64BE3AE4BCE22C70E7D392DE09D89B7F23351AD +6AD37225C12BA79EC9951F5DA1E505DB26200190ADE0E549305B7530CB86EFD2 +A896F13A97E51754F70B609CB4511CEFC38BA579C071E9510A49982389980DC5 +336D6C4A2DB100DFEC4055C7AA9C55880F94FBEA9EB280BEF66CB8E1E38A359D +E5AFB12B540CD599085ADDA7FC2C72E7C873015773FFEECA2C596B75BC39A3EB +3C43FA2E53C0D7993042F3D652BCC483E48B7F6C94C3FF6D38E276086A6AE67A +E5A571B9C72E0D7824E0BC2ADF51A393B9E334649F786EC1923C854382B89627 +1B9E701AE5A6C42E672B2C6A33C8BBCA8F69B9061E787D6B92183F20CF4C3903 +FF5417427B84798C82BE28D2C81624E3920CA61EC9EADB364B5A6E50E49A1A72 +A9A090A1FCD84814B8B2708AD787D2B5015DA1305874F58C5EB62F843685FCB6 +465FCA80176CAB2B2FE65E0A270BCE1E3DB97564BEDFAE5CA44395A8DF4505C0 +3E103CC3B914359B2870DA6CD30382EAE8949131CFE31E9E75C3E47A3834BB32 +CF183D4A8B9001710D0A11390C9DAD116196568591D38C2AF4ADD852F31494EF +573462759A35415900360882739789D6B89ACEFA251C5ED90ED704DD7C3C80CA +9F6CDED69537D201D520C99E69EEAD5D3C0EB84C166660B3C190166D93EDFE6D +15BCB6DC5CDCA825E48D33845CC2FB15291AAB823F25CF8BB0A1EAED8BEC524D +D9CA016027141FAC9D35B64FB9C224552F29EF6B32497254E319090E698FD8A5 +15491CDFE1B988C79A0E3B9D01E12FF084E9FA86CCAE02A3EE6F2917B61A2CC1 +64B8CAF309D1AB48A34227A7729DFF99CB6EC282E3FAEDD2673779AA7E4C1789 +D93FDC37FE95F087C5F88F53D30A2DA9C913BF205FC6BDD060A40184F4AAEB3C +D080D63B89CA3DEFF310D09EF0A83F3914BD5B7932980ECE139EF0313C20B4C8 +576EE0FE3F28FAF4D3CE7CD0890BC824A85B8EF4636BDF1EF1BB519F93D36540 +ED09FAF93FD71992CA2CE2E83F5355162ECEB32AD218092F45D5A61A44E67135 +EF0453589CECDC6962D0E8DA7E7567603BAF50B2C8F1CA65EA5320984E7D69AC +9A7D3D7F92565D79E8C9DD2D92CCA7DE9CD058545E9F98AA47904D70E1897099 +3C4C852B3BA131DDD348433C336BDF5FBDFB62120DDEAEB3255E3207B0C84A0A +1ECF9EC869DB9BFA3693B03FCB27C5A5D3CDD62630DEDE91B4DD5B9784BF0BDD +FC6EEC3FA7ACA9E15FAE47CDD9B7FCD2BF0EFA10716F08C0AF25FF67CB6F9598 +C607D2FCA452417D2C69DC808A9441A66492394C3450BD30632AE739EAD654BA +4343459CA36B6D5B2C12C39495952F2EF93D82C73E33236785A79609E260C4E0 +CF3A3C950DE71DDC3939D42DB1CB1CA917CEAD56979A70F8F3B207C805319FA7 +3C000AE2B21D711A6D78C7BFB901334DC06F59EAB6D94B507734C27971F8458D +D00193645AB92FB8FE163D5C51AE4F40BDB4F2C51691E76EE0636F071F37AAA9 +BA78BD12459CA499210EB0CE2F8BD317387797C33F5933AE7A6264DA06B4A6A6 +1188326147A16B205D1F965872DED7D8EDB3294FAD2FCDF0D423329E9CCF879D +4E0B966D509F45527F7609DD09694D286F6FF7535EF8971B7DFBAF608A19D442 +C133207EB1152ABBD11C455D0977F66A9B73E51381D1CA4B66E87C0C7175A63D +80C699A052F00C41DAEF42E7A40E07B1B14107AB0787E24E17C1462960E3C54C +AE73BE4924464FB177EC62F116B2822842541543EFF7ABDDEE197D6BD8F8D4E6 +59175D8C5957550B70BE775AD52FFF6E7C00DA7CDC16E1DF7446BB5D8FD82647 +3E9F87D5EA365C82A2D991321ECB14A9E3AEADC5A56665DF7072D6DAE402BCB6 +14D92B17F9E063E4E9D8D239C91F5C7C0BCD2FBD936C9D4A0B57659420343B59 +B395BBD1AB5B6003F653699D57E7581F9813CC98D4F072FB78899D6DECC42D34 +F2787EDEA64058B46C4BFAA2BB96E9BE5CACE8D91E4C080ADFC0FA0D4A29C6B8 +54FEA9E11DBCF53D9CA40A21AE5076451EDAB3593E56B6D453DC8EAB8C78B588 +34D4C4F36861B5649BC1E9F3091E704BDA7613ED45C911DFECA74EEA05165191 +825F95A947CAF382FBAF01F3B8B041ACCDF39718D7DC5BA6CA12BB20EEE96439 +BF2E2628AA3BD2C91998E6247A690FCB0CC95F286F427345CC4F1115BA3A6E54 +4743355F2CC991CBDFF5725902C1F5A6DEFDC8638A26EA456C33C27773D6214F +66536CD2E44FD253531732D5A8C44B336B1BB47B0477350EB8CF74889B93402E +2356A9CAAFCA562315D8E0B3F42F08932CB87BA2499A875AFA08D11DA73B38AF +F46D03B7F639A8D7BF88CF07FFF4E91716DCCE6E2CCAB60A64D5E40EFD8B336A +1BFCC4CB04F49DE1FBDE7AA5B2092A6EDBD913D161A3271AB6411622D0E14416 +37F81E0102F5B0F2F9A2B27819E4BACD7C50E29D6291AE5B0973C657761545A6 +741729620EF2BF1046B3913399C10982EE5F4142CF461EA31042E432CC79A1A1 +39C607D22E45A6DEC008CB4BF6007CDE9DD5802B49A62C8E02A6D448B64177CC +887AD71D171B99E7ABE2085B37D90B3BD8513995D9A57F53184DA474F6DB5E49 +B73E04CC214EA5398DF7D7541F94E623E8687B511640457A48A68E9D9D6584CD +15B57CC044D8091C771D175F2EEDD411099BC8F7B4317DC503BB5E405AEEB526 +5E6E1B1F2705275D274E012A98F66075CEB90AFC648B964DDC0E9C4AE7B24CE1 +80B051022E5781A533A21DCFB97893847D685137EAD85BA708A7E118C72FA839 +A9E460B5D17365A0AF1F53A98319FB64A5819B087F554BC056C4BE44113A5404 +BEF759F890C1CA5E7AE156F4F8106FDB4F8DFCCC640976983EADB30976344048 +2A86D7B2AF4A01CA736B98D52ACE392AD4BECE7E61C710B08B66F01857CA460B +B8376E257113E10F6DEDF14CE2A4E6A99ECBCD302C36CADB713D849EAE9EB598 +F29DC98531D793B79F83091F9B136809E006F34E423D528CC4309AFFB3EEB47B +9A9DE4D5B25CE953345C326BCBE2B4912641780637783084D3D12693F8135483 +CBB0AC4EE0B5610D7CEB7DF205830BDB9BB404DC1B28FB0824CC187B26C19A91 +DA0025EC739BF3993700101D042DED86D67F5FB87912CFC51AA7DF53F2162D62 +6314A2CE13810D0B8D81F45771391A236422CFA0F35F7A0CDF14ACB2724AA57B +7C2C28D53029B1146558610E0CFBBF72A85AB9BA308F846228F299F13F68E8F7 +D963B2EE9EF7D4C21690632B640BDDAD0556EFA4EFBF035F13377ABB5CBC280B +9E0C12AACB153C93351E5BA95A7D149010E204950A59C7FC6581D9703468C1E9 +EFAE37E7E6ACB892B3F8D1248D9A4A72F642FECC5E0B25C15EEB921EDDE84D12 +0E524FE6133C4921FF4921242392C12FBE69744D53739F7E849C1B96C4020AB2 +1FF10DEA608F111749E2FBD8DBCB17F353DCB3075B4F4B8186963EFE95A76A10 +85AA5BB6DB4095291974221829A8E436680F4860E01C3843BE5BB3101D0869C0 +EFCE08D187BC04F58C7A450A59093680A0F09E8E3F12DF5223E7EAFEFA01978F +D8354753A68022CC92C71F2CA732DADAA8A466D4AAE5999B0DC077715671F518 +E6277741F44AE798EE50DF44CCF71FCF8BC71F76374005FEBC4883C6EDA854B0 +88C0C2B476709AA809ECE41AE786DB1A32B3FBBCC14921673578D3514C8CA842 +E1FF90BE33F7B93ADF6BFB8B1AFBBD080783BEF056A6BFAEF676F7BF9F2DFCC8 +01D255A9F0391951210D60D4D4DCA93AA858B38C0D7B8FD740D5FC6F277C2A68 +54CC2DE1F40B6347201FCA2A0A91822708D820CE645C3E4E5A09FE25721AB33A +97871ED448F38FC5A349D81F402B34461D840D5768BFC6849439AB6115104F78 +B87115B1DAE12542EA898F86ACE247709817850B067F537E6137196101D46DD2 +D842EA03EF4501E34074E8458E638ACC4EB349A7430AB035BEF2DD4CE00554F9 +18F9FE32A55AC1E7E50D64AAFDA278D77A7149C59DC5B1E3064A4B281A54C9CE +A5EA94ABEAE4C6D5674C208ABC72563976487136AF2E21F835BEFD232D7F0D13 +1D19932367F51D5379934DA7F1635AC51EE5CEBFA63D4D32F018DEF13624EE62 +31DAE68A08DBE3B4FDAAFC75291C8C6CC7A657E3C7453C7D1461A36E88E633D5 +408253B673AD87A9FB2D0F56DF1305916D14D5DD62051E27BCE09CEE9A1F14AF +1D7164BA5FB6E6EC8D38750F7E28BE330909F303ECDEE692E347DE13C8C2F82E +29C8BE6EFD76546F362A12A1C2DC12389EA95ACB4DCBE95620F0C193EAD91B33 +BAAC5801AE827B9AB3FCE5D11D1D7854F8FA8A31670119CC0CA98628F801838B +AAC7EF90AC5466BE69CE3E3CD9951A5EB9AC08014285422F6DA6F6E221BB30F8 +0042A11F2E4B765BB0D142AD52F4D85785EA71B2E1CE20728B9E9306CE93268D +99B822A5AB5232EC7E26EE1160850AD3905864A01357F22722B6A54D4EBE58CE +480EAD9FBF068EE965AC4B5FD2FA8CCB91ECFC6E90B9C49268CA0B0FDAD23ADC +D5A74B41149BB08454054C451AD0DA4CCF8B60F2EBD061AA03A011D548B6B481 +FAB00AF9225BB5463F27FD67333FB51F8664536267E95CFAA0BE3BC1B8F889CB +587A3A4FA2B45864F07E11372C9507A625C0030EF7030A0B4D931BCC48F6DD51 +A4D1F63FDC4B59C1CB18E6242E9F4B4B8AD9755B870FE60D640181FB7EB8120C +C56F51DC8C47FCC6318C2145EDCBEFA7BC4253315BA67FD2B3D4AF6A9F3F229C +AB75B592EADE15B1FB5FDBA1C0F786BD21A51506B7A2E42C2D086BA6F84D1B3D +AC7531545F0B01346831FF36A52CAC1E390F99AEDC265B44B0FC9C581BBA6BE4 +48B723811EBCAEA5FEFAEA7E5B987F2C7B3E9A65D2D14A7B74F099401C57E367 +385352D0776D2A908F7A5A2E4D4160946C5591397877025C8C387CA413EFED56 +8B142E8341E349DB4DBA422A4FEE56A573972A0C66590175158E48850A9F7F38 +4B95726787B8F969FDBC97491CC81CABC976CD00A27D1DFCA7CF467A956C1C6C +839817AEF8794B6151FAE9261119DD5DB787DC9D3B420FD325ED6599FACADE0C +320D54C2E0D296537E22C1783670A9D9BECAEC63853EC2F05A990260DC189D63 +7CCC0BDDF2CF7585071ABAC14630666737041194D0777EA4292AE60BD7F7100E +DB568C90F0D899EA006CA423CFFD6EC70A5D3D8AC43C747DBAD3B02219E47D8D +DE030631F4678C357A58ECC52782B31B50CFD44EC33F41585E51B27E3997D33F +461BEF897220AEC80007F13C5A1EE3A0430CA899047DF944831F8B010A7DE74A +BFD26001472DC00CDC9F17CC435F61ADAD4E9AE062ED477FC621FDDF9242C449 +1BB3F77FDD1519A251B663A693D84B42BF0962F537757F38CE5C5D56B98AB10A +3B70C8AE8D52DCAFCEC22E7B09D3C4EFDA1841C74CA975E4F8294F7BDC796500 +0ABE197ED3737A65F7BAE601C91DB3983EAE11DA3EA18ABBBA3650DC361C2E77 +EF9F97618B0C337A906FF39926D2B0B7883ABBA650816C4C6B34EEA836994EEA +AFEDDE56E0099D0E09EB88EB093544B9BF4871200746A0409C475FC4232A38D8 +F3105B0FF44E4F132378DD12D9E796412FD0F9478322215E9F59E69396C35AC4 +097C4995B2C3BAB2DD04B1A7097DE16DFDD76465E79ADEEBA90489ADD0914EBA +53E11A43ECB11D072C68D2131BE1C7C43CB9DD5FBA0A67BA43D6851AD4CD3BC7 +39AE2E22CCC183A56CEB71D4F9F578518E376426E42B6390426A8434B5A83E78 +77A5B9963BAECD5FA5521C2A29418764E4EC1A72462B04957F823E2817A7F8D0 +1512919889500024B1C42EC107E8B8533C0B314EE4E23313A4C1BDB009A2073F +9BAB479A3F9DA76CCD65629CCEF78015ADBC2D0D124B3BB2D322FC4D209E417D +84BC3C758B6AB64A01E25C9C7B71D741AF90A19A339F99A0BE9FC39622F04C6F +737474CFEC19C890A657BCE192B9DCD8F273CDC5294875DD4507DC5723EBB357 +73DB0933927DC21081E67E5DCF4E41FAA6E00E8DF04128F86348FB0718068FA9 +918319C4EE9D090CDF348153B6CC48648C55E889B4FFD3D75466F1B50C437546 +7DD9CF20980B148F60BB146402DC0732A27F255DCB859CFB6F9D329C12FB14A6 +7824D6DE27B03FF85BC59703A5D6C5B7D1CEBCF3C3FCD71D6D6F0311E41BF8BF +0609D23C84720FA9EAC961C9D49C2E962D9618C32BAFBAA8CAB0B2F616E57DA6 +8CB44C5595A22377B28599F7D34A3BEA4173E1D31A2A6C5670D1F026EE2092A1 +DD0D2BBACAB46E5B0A7113B1BC379709C5870981E482E01EE3D16AF9ACF1A5D8 +7ABDB4BA5C3B13AF047826F360C8892642B482C3C61FAC97F332888AE156B35C +5C8415A75B4F0F25F8E95BC4102FEB4A8287C544C99778EB0C163C22481F615B +0004F764FB7CCB01AE01A614AFC9650D3934F748E8785416BBC89F66C696AF5B +B5F6F125F115241728D85E7159FCDBB10B64598249BB0E6FF1AF845B0A2370AE +E6A973023FCAC4BB6158D48B0C928ABC4E29A0DD611D0F5266AAC8239064C266 +82D4D33B032418967406BC98156CFCE1F091F733D8BAB9523690B4D6765DBADC +210E814DB8715A269474EC0501CF66FA0D8FD224EDDE93AF243032E73714F730 +FB382372C0F9B9372450FA6F13689C9429EDE1A105F234B216263A7D0A917A15 +D1FC128580A16B5572436E398C353A0EC62539CAA188901FC30DF7511C1BF6E3 +B462203AE937653C4562FFFF03078EE7A184F554E6F01932AFD07722A00E50BB +2D2BB785961F76273A16CEEB0EE833DFE14BBA539CC7E48F67A9D20C94283137 +BE84025E86C714DC9C6FD7CE4D1D0C50B6EDC79E066521FDFAB6285C83A68B4E +B1A119875B4E45BF5403950A25286214CB4183C345173F72E6ACFEA5C13B4D2D +FD12BD235193EE6BB66519B553CD963EDD68E7EF9439DF0411C8193ACB183C09 +4143657304B1BE2AB8D2D0203E677FA1DD01152D2ECF9D987B16C3FE0B3F5F12 +5C920243E1CB5FDCBE97DF55102EDED12811F3F7165F4FE1F6FD5A6BA809824C +041FF9441529509EF4442EA873E8E7FF507607D526DD27315859B31D0AC11475 +53C573EBF9DC37A4667133E99D8AA608ACB729F90B736395211043CCA3272AD1 +470F1EB485629AA8B9DCB56479F734703D859F1E4EE8789FD6F739D0122348F5 +1D487FAF1F24EF7A14CF69ADE7A87550F55F394506BC7627A5E319B30F362528 +8AB497EC03B69B58736A5EE0AD63743E7F22125536104674EA63F9AC5286A746 +47C73EE8E0320E7DC098CF43F23EDEF32D213523125110140F46202435EA8E79 +E285C7F3AA0C5877F75FE0F16BDF478A00A6F380C7B677BE479FE900ED3C4A0C +832966F634C63211B58E9AAC3A3346ACACBD040164B491287B45E0131479046F +B430EDCF59B0DB6B0594775AA57CE029EE8DC445463169EA976945A5765AC390 +CA615933FD05173C47D30DD5CCBD56D89B4557C7192C31D7B500B779D7DD3707 +BD4B64980767B6C9A1BC9A948DFB8518AEF581A1D888C6F767F3315EE99F57E8 +4EAA54D04A3A9E34B100024AA7C49DFE273231E3DF17073CCAF5B0EF20566755 +6831F85C57454D1B0A5A8438EFC7F4E396F09CC200643564BADECD2208915FEC +78E94025CEC8ED965EEE5F6B8BA081478231547355F93491915CFC4DBD619862 +0F99133CE7F44756C593C8DF1874E973237ACB17F9614B79D45672CF62AFE009 +EC61B395BD96B0081DE750421A41E9D474F0E030C6B8591D364F29A6D7246EF1 +6B4CF9B931A9A474011C62D504F408651692921AE83116CA0E4E6F41AF877FC3 +CE77764197719291E68B01570AB7038D91B8B81EA501DCB5ECB6083B6764BE3D +DF21B4B3A1E1A5C917F324A1CE5AF92BE3B2F8634A140637425F9BDFBD21FF33 +CBA42069981B230D211602FEF410EFDC199B6DF283343FA5E6B4FF2804DE56A1 +61DDC684579F82C65DAC3A4F92B34FFB6273EF4F4591317B8D2250850BBA236B +C1E36185BC3C8C7A7654B24D7A10A489BDF675F6EFE7B4253F14CB3B5ECD1756 +1882F3D139EB5EC7860D70A176D1536F5119A6C23EE9AE9AB21B586DA19B483C +6BEBA87C457B9DE3D7C71DD7F97E352B642D84455E44EFC54417ADBE7E190F7B +7ABF6FA0EA84A394C8316BF420D6E2DE5B867E6D602365925C3ACFC69ED653A1 +DA30FF3B49D407237196B9401B1EDB7EF2260E582D02B18EDD38AC0016F28896 +0A61CA720216012D0FE2B58D5D675D25A679B1D70FAC10A4EB38060C0BB1AD1D +D1C59BD5F44FDD8768EFBE75B6795543533C02198E21A4B8A5430C2C432E45AA +0C0937D6CED532EE6714C58ADFE2B15B117E9AEDFFC1E172716C756260BA9931 +23AB837CCC7C36BD6B86B628BAA7D6002720AF00411E9D039E435EE479D5015E +23DC9F3993546E50A442CD9D0429F7AF22D9F14064CADF2A3062F218582CA520 +3FD8E0F30B224408594EC426C8DEA57ED60FAB24461611E86302C421BA600CDF +D4EDBF4044F0E2893143D4BABF0A6AA09F28FB4190B779B82A61C65264A199D7 +C2F50BD82837F08970F630E1CC74B4EF421B1032967FEF552DF3C1C83ED995BC +CB9192ED8AAA906CD9708A4882150B27B1E75FFC0D1383C50BB3E6C36F5CBF28 +C0572BD2F01AFFEE5927EBE3B6CB8FE778ED2B524E252F59AF00A3F8F880116B +8EA655D9C6A68CAA28DB7A75003D0C3B653C7587BD1A7D93BE73CA6219024EA1 +07C31E7F7BC9B874183C9337538C925226CDC48FA25D51A6A0677A2BFF699AE1 +E28D9E58369BD6AD73ABA706531DE565E1984A9C89D0C1EC6FC030A93D3D863F +C45EA66F195CFEFF9A03A1673BC544FB4F491AE5E50ECFF7F34B095DA96288F4 +31C02347DCB6792ABE9DE684A1A92318A2BDA38C2D8DDEF29B8FED450DCDCC7A +5C5D124FF0DA047D37E8874370D5537AEE869E771835EA607E1634BC0707C0FF +75D5764B867BEDD8FA075F0CBBA7191B3CBAFC9EF8DFE79E9D7FD5A58916101A +A920F37BC5EC845621EFE3A953C19853C2989FD31952FC4876A8F7C58C4F21C1 +31E6ECE0389BFDC8D6E391B04D443EDEFAEB77985808C398583BC4D8C9979A38 +9842C4FCB7A4E84BD67BE72551A43B2B330293D8655A3D6655A2358E014F5686 +613D19B474AE0A92A80E6E701F4B63EDAF59C3E12DD961A5B413FD1CB5400743 +91F673B3502C6FD90A1349D649EBA4F5D8A6E5AA41F1A4DE1C387E22C9CC2733 +D542291D5B2E5CCD0E1FC1835BD6A74F5DB97FC174730AF33CFE5E68349BEFB6 +F2C76171C578412F075F9730567BE7A2644B17012DDA04D681018CBE09BDFCA6 +1BB460699CBD6006C031A02634BE0B16375FDB9C582EBE6683B60768BC3901E7 +4388A7E058B61713E3046F28F5ABF58417DA878E1870787C472FA08C2FAC7517 +4CE71727BB69D19BB40AEB50F1BD66704EA37D2A0B82F60D72E15440BD27064C +E67CA41D97349309151DA28E1A7850587569A794E9FE46848A4611066291973C +A6CD19857B92F0E36B271F24D54ED663A7C64DE3534B0989D41E21E01469AD69 +916AE35C5177C6BA8CEDA45C92694077DF3EBB0377269619F9925876919A472D +14751E6515118EF9B84A5DD8C92695818BA4C959485EE1EDB6C6D3553B6FBD27 +A0FC42DDF20BB335F7D46F0951C51E9BB69FA6E7C76A8C960FB6A4305FDD2A30 +234A5EFA64C34948422255C14C2A0D8A57174AFB7DF3DB2F520EBB401CA2DD79 +FDF6C624654DFFCEA8FCF5B34C34CAA7C6EAEBA6DC98E8557042126E49E51C3E +BB7C91497A44A69E4EBCBDC0656AA5A7F419D0443576F530C8136AE8612589CE +781205654730006F3A39B4F3E5301784F164A2C87C2F86C894EAFB5E79D7231B +E410219BED0210BADEFCF27EEF683A01FE01DAB70AC8DC4E82ACCF6B5BFB4DAC +A42AEF344755A06DE8A6BF6F2786435E2EB1D103C8FA4306573BE699571880DA +53548A1FC1F24E50B3C2BACE9261C0245F671694A0FBFB4ADAD535AB9949C020 +DEFE36F7EA12B3F8D80E3E3D7B3CBBD8B6EB0AD2573DD5DD0B4FABBC790C9F28 +428B33CA533D5A6348D1A64D868863F4385A3F19D9F4766B6B81CF634981090D +AF0D763F09A2919A9DABC0DC4602D72F8747176F947A92077956FF59FD0D88CF +FE224B9B16C5DD710E6DE3B94D47DED695BCE5414A3794E4CEB7845915272ECF +E4A657C7B53DE7DE96A8C901DA24D54A467EE083181CEE606E5917FED2C97728 +57887C7D19EEA950AADF6E8A99798789757BA126D925E330BB7D931FDF4EE14A +04F58858CE09DCB1F57B8F780DABEDD1C26D72C9A5287C9DD30365693C5DD06D +7365B309AF1C97BD3443B393309929F6D1AE27A1CB55C2F5085EE81928E138F4 +4FA21E90C89F0397C9CDB4D707780F2418B38D8A8D76793C868D4BBF10AFBCD2 +9BBB8202DCC02C37BE63D3CD22208A23743025921A54307A72037E6356EF807F +B2E7DF2B94C51F19895C3C059DB4C42C2DBF4E08E27E31A294B580E2367D2F63 +0C074F03DB73EEC7293AB98DEF387B3C18761C716EE02C95315A36D42BC5334D +984E6E35587BC0711D1B7F8EA8656C8059683C49CA41B0520D6FE1952A1991DC +659D83269307EAAF5A9CA8000FA086B55587FCD0C798FD93905B1CD88A9AA33E +9DBC2FE2A89CC800565567422052BCF5BAA443EB441E3B7B6AF0322014458764 +7AAEF162D0E03F28F1D0A0EEED8714442E9DC41FD4B90436DB8A7E3A9431E726 +FAC0CB7151B6236B2438DCE9EE814A358DC10699244FAFB932C928E0E878D91E +36E840135A9F372A0DC2EECA730E8490F4D42DE218150497C5EE87A5FF5C2282 +3AA9D4B71996F86F8BDA700EBC01E3054459AA3F87CAB9C3A230551D4534C3AD +18F6C76C41E10DB9DD67D19614A516BDD39C432005676C78B36C53BDB3646934 +3AE6BC84D339851BD4D07CEC26129467C7181760DE58D0A288FF1F0DEE52D68A +8423FEA92D3D9331F75E3B062BDB37BEE45D5C338BFC462612D1CA5CFF432D7D +89D34ABEB9F42CB40A63BBECECACC033538136B3F9B81F1230453A52549B648F +E8AA9EE2B0AE82A1904FB78A6237247DD96B906B82945AAA772DA058B85494B5 +DBF53ADE76C1013C1DCC7A19AA3ADD198E3EEDE3269C4F3A6DFE54CBD17C7608 +3BF7513E37D9C8D688087E2A09B863882D46454A5B99CBFF538C008FA9BADC2C +004ED4ECE65C4301862323B134BA11C6D4E691AA899C0E83CEA6A625AED13F65 +78D330A389A6D6EC23CD82D70D53D4F571C9D872E1A09679444FE686A12647B1 +6BB67C8AA4D500F6DACCB2E0C682C835D24C646A51259A72ED3E281C93743832 +A51B3B89D38E575B8521A39D87F8105F892AE9BE53FD758B8DBE2021716ACFB7 +350D5408C621CDEDC04E63DC4468C301435C2C2D61F3B2C24117F9ACBCD9E3A6 +BEA36A9A4227287DCACA0EBB1C6267F23BC0C3E0F28A89184FACFB919D49843B +AEA30EDC40944FFE38FFBD7B33B6B05F5AE1D0E168E924AC698B7200D2E86C14 +E79E6768E27E848768A75DD694B48FE4839058824A9F5C472081962020B96FE8 +45DBD7153E2086C2DECB97B99850286211660573EB090E315BD727C989B8FE41 +D25635F195218A2F15FE8A5C5FAD2857F75969D1257158EE5C52055C1E11D18A +8770E2DE895D7118B3886FD549441424F56DCB3820D5709B9D838435AAE4D64B +6F49CB37B640BD905D6C3FC1E53C8304B0EB694269D6C48D81300DD537373040 +65B95EF64F81AEE581FFAFFF8B32DBFC16B4F1F7FF9DDCE9CF5D6A8A6D79E4C4 +209E47E16C32343B7D8B65D863F33717FC01CEF14A0F012805FAA46552535809 +14126B88CCC2F0E276F5EB42E0C7628CB2397645DD951E31566B9D80F4379A57 +8D10288DD980E93AD47F7F5EB41C4E0DE8AFC5118CFE87A804F309C6A9D1E126 +C0912E55D9B1FA95611FE7FD22C722610746316AA8703953AEE8D52F4B67F0E8 +1C12A3A1A38B3AFC87E78B29AB79174E1CB09880DED63F5EE28AE6916E9BDF2D +3DBBF6F8A09A229BCFE45B37D0E28A3A519DD20CD8B7AFAABCF0EEE058EC5BEC +98CA3FF46CDB8324A5CFD9985AFD545B1425BA1B1F8A3209D159925194C2C7B4 +F353F587F1CEC839996FB9761DA1343F24A17BBE4206324041E9DB6DC5CFB21E +789DCC82093269E3D2894773C8BCD25DB0D6B3DBF7A799276936132C262C2F0C +980D6689EBC8459C62E19C91EF5169439185F8DB0946D7156108A689F9B0A52D +10E02422207CDF2CEF1C2B5D3D50E4D458B4A6C936CE9E6A6C4975AFD8790E5D +057FACE7B96263BAE67A549B42F8CA016C5EF42B55C2FDF20D3A25A68B13FA44 +99D57478B9FFB6BACF69CABEA3C64B559A0D0897176CE2BE218396DD2CB25D70 +59BB599060F97D2CA6422F46D28D3FED8AA36FE161A91DADE4B621EC24BEB0DB +31FAB9F4B67209C5DA12F4AC49B8BADD510C8226962D4657A80DD7DD49104E88 +A0287F75C8784516C98BD7BD15D91F4513384B46BB097291EF6D6229A529BF62 +0A5F4AF3C21150A058B08D0B47DAF540DB98EAAFC88E117BC9DBA9AC19DDD756 +9A90C45BA3E8C37368C7E44BD6BDFD96619ED819CB067ECBC13BE325409987C6 +CB804C705C040AE82EEA129A1A7AD4B7B362E799F2CE5C0390722A16FC60B1E8 +44B0B85D097AE0D5E08DEC18C3E576E22268D7F0CDA46D9469019C20EAE9BA74 +7B49EA6166F5AC94672063D25C4C0E8FCE359712939ACEDFFF9AB5E7442A2A00 +A7E7A05E9E10A209672155C03EB12CD5E80155A5DEE3D503BA08D71E423C472B +A74CD26E15A200FBAB8E94086928E73860E50BB7389B3A8E0E833ABAC5FF8C62 +B894E007E5C220FAE6D53ADE85C747BD84D88BD0F40132A0D1FE51ECDCE1BE9B +BD89734A56C3577515520025A7743F45B01D74588DAED6FCC209CC819CE0DC65 +B590337F93D92D71615422728C6A8AA4D357A4E350BF6CE2480D4E1A818EFD9C +E6243B96F72EF5C5E88645A73189D9772E97911A0713A03201A69D78A98F743C +C0C8562CD876F8DE0A488CCAA3EC11142190BC32B2D8FFBEE6E155EFD20BB003 +055C74D843F2AB34D9552E5620FACE9E40C04DD84E29A602151B7C3352798963 +94674A8246B77CECFCC9A896B64F296EBD891E669A538343C0394E6634D9BDB7 +AB6D9C584DC7DEDF6AEB695FF83953653CED9E2B7F6E5D2A965B60F1FD3DC752 +3FE4EBD010AD47E0A9FD989B15559783B429F50B3A70A1D8CFCBC150A492A8C6 +4F570111E78A66DB463BB2EA226890FC25BD5CCFAEDAB7DEB2D081480821426B +45EDFD5C048A41F295415C43E86930C53961D954B54F6886044A1C5F6D2526EF +F6521BFA9BCEA510AB3E1731719DA2E83729BD08AA2814663532756B1AC5E199 +329025C143B47106919977514AC51B681FBBF5B115AB82A15E24C7315091DFD4 +CD11E813DCFB89355F4CFAFBBD54822018E7EA7ACB3A06DE7B571267E0C66BD5 +6DEFA8A8AED615B9A7F40B138841D094D5BEB32197BF5213BA572AED3C87AC6F +6ED6356BA2A2B9A3E26E43B3E6780BB66CC93A1A2CE94C90D48ADCA2BE608B64 +7C0C0410A9134B81EF24CCDC7426E5096CAE44EE96D666A4F3F72774105AB03E +320FC752F294CA8A537BE8EB6FA85F069E6809553D3A9CB3384E132275D2028A +DC6CE52E75DE9142E8D19C656F7A74D985BEC5367F151A151E5D41346AF70ED3 +14D68F0C83E4EC225E6F60A48200AAA0FAC3725551B8859AF513FFBE2AB3C205 +DCD56B1177021C5D819DC38BA8A042DB92A0A34224E37250AA0F65707C2786C6 +189F518C2E635D327D999949C4358402F4EFB6237C8A0A8BBC01E9B01F58A83E +3BF161E39EF504F2E31BB62F27B4830EAE9B05977DA47EF338817109E0BA1059 +6DFFC6426DBBCE33297E6D36D3492B098C1691DEA31FDF967BE80808199760C8 +46E9D075B01F433DD5A43A2AD872061B3852B74BB421B3564E57C44ED0DE500B +D976E02B51C656974673846B1B5E31F7F9EB5FAB81F92F62ED34EA0715950780 +6F5674E2D6120A4B9B89F749120921EE65043A66F0272B75C05BDDD09217A10F +E9E93E647617CA513F52252556D23F34248D0EBDB3FFCA6BD7C31E3369CB1F0C +20BF53BDF7C4F7A1C37BAD112254C227FACDFD40CA33EDF4688600E16586A5B1 +D53C2AFEEAA2416B29948B4FA677FC1EAC94B4A7A2AA4EFFA901F90B56BC2F04 +921AAC33FA46982497BD267EC185F64A2C6F51C48691908568A4F9814175AC6B +E1B34565EF12D99AD27B74481FCBA29E4C58C8D031DAC1E58E24AE5E432C74E4 +CFDA7278C66FE60C11D9501EE25CFB8F816F06D1427D8A8A119F7E9A66471847 +90BEA16129627D6E12463C9DB6E4CBF9AC20F51EEFC808ED48D41F334115616C +FC0F037AAEAB996F754FA6A8653B8912BA0A9BD0D0EA381B3A54A86155156D1E +BF1BFF694F9EEA20EBE388D4F01CE5117C0EA6E061B807AD4B53270006E6CC45 +5016272BB7FE8540070D51A260A018E09D9A1C7CB3E3C6409BC1993E59667A42 +049F2393C872D0E8EC41FBC2671D0F5E4B99BDC5AD13F7B0930B881CC049FC39 +938DD4D270BA8FD68DFF2ADCC21C7C24ABD1391C947142F1C7CC6E7EE5D31252 +F84B92C304757C0B8394E9E2C2D4DCEBD7709FA645B883D8A5F9657FE6116F2C +891F3DB3BD7DEA5922EE488678297C5A043720DDD777451AB916FA664519A6A8 +9BE9214DC67D68FAF516E19E1F65F162C246B6C010911220978C2FAEEA7023CD +E2C2A175D2C79817AD4E4364090B9C6B95CE86840857599448EA77982CDEE30D +F4E739DE78F7C1831B2FAD322EB48FCA0ED8FE56A0BE9E26E6921171C31F8E79 +D5A59BC6225A0AA217FEB684D1CCF1B12E21DBEF1F1315C920EB46163B5C2F46 +80669943D09CD519256D5A4DE9144FD5103B52774A530D2A4318E9ABFFEF15A0 +24F0590F23BA7612351FC0BD9E5F9A5A8D6ECB677978C4E2AFC4560986B7A8DD +0CC30A82C2CBD2707A18D988C164F2B8CED74B1C12991E705F005E3A8D10BB25 +F5A45974096ED5C5F8A09ADA293175C763CDF9C3484C4B9ABA9839BB9028425F +DD34E700820CA4B2BAF969C1DEEE659A6FF568EDE7B58400C07BDA06310B92EE +17FEF247A7FAFBB56044FAD23EB2933D8F313A161767FE211FC103F392A9A1E8 +B633A259920A15D19A4F5780C09071ED04C83FBAB9ABF344A1B0F1FBD2A96A87 +E03F2785DD00CFD5B3B95736CFE6315E86E8A5E838F4C02B36859AB4CA203FED +4AB0D43E2964FEF26993ACA619F1CF12D3DCFBD8E50AD02A72A6593EB876E244 +D5CDFEE1128408A5C10B5E70D680299E8A33489E1179FA0F753B7FABBB826BD1 +39D7F7A8E7C15C359E24B6569640123700FF628B2D76E2B7B2DE7C2F098A7A46 +8309CCDEA49CD277E96366EF221C4DBCCF17882C4565340EA41EBE83998AC89F +D66825F75F751395FACA772DFCEDA5E3368094CF378C31DF2B405D92690F2546 +AA982FE7F32660E0FB33BF253F632FE978DDAFEECCF840997558C607ECF0CD57 +5CDB3EE71642ADAC37D462F7A23541F850382BC1140C8437FC62C34CD9BE7002 +0C136657F2ED4AF914AD3AEC860B2E873A77C818E491440EEE98075FBD7EE393 +B68FAB94C574EC914FAE259B065C8666CBB2D3604F9FFAA52DEB5F157079D53D +3FBBCC93C598FD83769A8C039EFA0C7BDC027A34721E437E548F120137EC099B +15D65CF68B5F2E5ACBD11A46A6E2168F6E38DACB52D0AF949B8BFC8AA92A6C1B +E5A362B1B05A46F3E58921F6A1CD4C97730B14D31F0C1E2C132D25B2A63D631D +C65813C00332FB695789D21D9903B3CD1425CC36C25C18C7D49014F85BB771C8 +D0D18204492ECCBF69D97B2342457C95A7CBD46C489690CE6B4A4363653B9D46 +A5A03BB8BC675B56A1CDFC8E0C3BC7DD7E4804E61DD27EB6D25119887EEF49DE +905543AEA98A60471A3D512D63CFA12F8768CBDCF8F9EDD9AF084027DBF313DD +059EC75136FC08C22D280B76F1A4AE628CF21DB9A6E567085DCEF55E68812A8D +F72DFBF59786430216884E02416419FEC67428E36B62093250EE61EDA4E9FDC9 +08F01063F9841E1A5FC54F34A65F738A9E330E8074930BD9E85F05AB0E9DDCF1 +2CCC343C8BA7619FA512292B53F37BC95635A3EE07C3E4E91B123E2CC34EA9F9 +123C38F41B1DF9C2A7034BD05D83CFC2B86D69639B8C34940F53F44D5F549305 +F196464989975EF35F33B2B4B52CA9EDC6B32033B63BB03462CC58BBED662365 +2F36F7A46A371A60B245D53F9A7DAA64428EECD40A8F4C93D460490B092558CB +647E53E34771DC04DEEB2C285965F4DCF2CCB8669ADB238CC12897F7DF46E6DB +FD9D5BFBEA1DD262C4CC1B24E681643FAB80B34D057BC920ABAED5B39D2ACFE7 +4CA3A1999ACF8C9AD0F99B12922D37C03D06B77985EF38B3FBCBD6AFD21572BF +84A7BB8C4ED5C3BE657673F8E9F3A1655C0179A4CA565D3B6F0949B2CBBEC189 +B0B46D5727EA5EDB274B66C9FD872C00969B9C6B7CDC3A8CEC053A443CB847F2 +540FAE81CBE3F6B306D1B8B913919D1B9FC029CD5D414DB2E16C7EC97F0BC73C +1BDCD5F3FB0695EB84873FA73629005D7CE48A9A1374CD2A0DAC7F507D3F04EA +A8F71F37B65C4D5F5928C7A59BDB73E1702D4E9508519508DF62DD29AE1209FA +8766D6311A78B12C830AC0D870CB02DAC0D6434801CB48972C196E0CC92BDDEA +398622BAA5B384FB8A0396777CF517A08F646774EFD5C6CAB81C37ED7AF68276 +C86AD81C3C41476A6398A6A22D65421526EEC405F6CC9F2520FAD97FFDDBA3EF +9E8DD5295CE2390650C5B19930B45A410083442196A24413ED58BC3994D003EE +F13DA0A43E7D99C70365FE768AADD61628BDF66FFC0D4195AE0CB7FF33EE475E +2B0EB97F66B2FE63D3436568729519B2639BF5AD17F7061BF9F8A2EADDC7F806 +50C1EBC0AF0BAB233868B10EC7711A0C2FFAACDCE3C49D3A0301C49B82A2DD78 +92BD6740EC601CBD20D460B90EED562B2AE48E55A7C28C8643B4DACAE95AD33F +27F2CB34AC65A0E62BE71CDC3D05361D1F07584945E4E89514C40D8A3132C707 +A4D56B054572CAF5F12E40406C26E5077C9E255516000F1733B136CA5C58961D +A9B22F6FEE7B57DA278A3F8F2B8A2B52B5E2E1FED54F14AFC9F13B18734E42C5 +C04846F7CEE4700920DAC45D381100CF7D5DF4E601D3B933998D86D5FDFDF666 +CC4ECF675477D74327EAB256DC1727A44C3F7A6A970D9598EB46A5C38E81F3C5 +10D8307C19D849BBEB0C962BFBB37409195756E505278D619A73140B2C661235 +2091B4C6A3C81A3F532B8168E69EB1DA998C84834C2C87A910A2A65B264A20AD +50F7B5B8DDA82DC3F45F394BAAE1BAAF5FE217BB95A30E2164C3193083013EDB +950B9F2F8559B483BD35507E77A8C59CE5E6571EF07AA5ADFC51C4E54346AE1E +6E22EE5A58C7B31687B936299B29547E214971677A0D5FDC566E61EA08E86BC6 +976077F73FBC8EA0CFCA796D37DDF0977130FF25C4791DC6CD5B7450A594BD1B +291A8650DFFFAB3154F4129AEBE08C3A0F76A61F23A6662795F20B096772DA49 +FDC818E8F431C8D7488139A55443B81474F5D80D63E1CC6B1AA2241C0AEE0169 +9077ED92D2CB61C71F765AEB0A26665F2677D214B6C5EF0111171B165531D3E4 +7E9E43F1659A4F3E96BFE53F74D902BCCB2557013D900D19B86DBEE27F12CE31 +A94697D4DA12D98DF2F197BF7B7F6380E1CD7D1F9E13B65D5841A990642DE6F8 +0F86E9C087D82FD2A903B7C5191D7D87CB2797C3B24432F7D29BB50DE05D37A5 +B9090F2D26B1AF1EF3DF11645E317BBAD8136611F64885A3D635C3C1F1F42995 +83BB3D6719766FE2D016B42753A30887C1D57DF9CB860FAC2F95BF993EB7DC4B +F61EA29CCCA247F2728D4504648A8EE0B7FA0A766282E63511F89CAD7B612348 +7E83A9D8F233757716321B251D122D9793FCC20090AB7BE19B1575A3AD6CB93B +9FED5A9A6CDD855A1F09FCBE5C9DD97F93C49FAD92D3DAB4B32DFAE82E36165D +5A6BFCE2AEA0F568A481C480D75C1F32ABA8FB904CCBF3FA6AAF58C02B501A62 +4D6C1F8F690BB4B7325A31B13A712549AFA18174BDFDA6010BBFECCCDFDB06B9 +406732F56AA41EFBC80266EBF0B9852EE08E76EEB14A276935114FAD24214CB5 +D177262C90AB93798A00D55A152D635C96846D70395C7EAC49F7A750027F9024 +3781BEE23D56131397B4B241BC6976A4F2B04C8C64EFD55E801D833664019765 +7A22B810889C096B55AD2B4D8963CE240D5DF0FDAB71E9091A167A80F5A3418F +DF87AA78FFB1EFEBD8A2C97E8E7667B289BC23CFC16F0B138CE179402015CC4D +F36912CAE318490F6A050B56B778DCEDA7AD335FBB6F3F05C526C8B5EF0B7BD2 +DFBCF5FD5C40F39B6A3455B86B34E89060AB0E6AB96C3914019CEE49EED033F2 +EE547725E1EDD60358DDF57F9EC734134515949C482D52079316D9A2481A1547 +94B4CA6724EFABBE3DE13F07951329A119D84A07CA8CDB199704694F4B3AF26B +95DABE0B18F99025A88898EDE46BB3C314FDDA77018279B5DC8C854096F3C7F5 +4DE88F3BE84881A03C5E19A77B769EC57B4F6E5BB885485CF242A23C6E5FC322 +04511A00F27AB274232A97A2E5C45188538013667C552E804283C579F1700DD8 +B3C70F6D22FE133C15FA6D5095582333F9B4495282BAD0537B90BC6548427F7E +12C9D744869A3F5F133CB2CA078C83B80F95AAEE5D64203110CA1AF12E5E0273 +298B2EB72DBB5FBC3F6A6D7004FAA17AEFB086870C83E8D742EE560DEAA5F727 +CD7BA16A4D6FAB7ED191AB92BA39300BFB73EE31B7820D85DAE74DE35B2E3FF5 +8879D9D02B251D7903CA30DA07E2B5694F23631CFB5EB08656AECE21A93DA6B9 +EB6CE1A290631B795A55CA75A5EFBC99BD1E21C40D7374181C96B43B696F9079 +E7BC8BCC96044E09E48EAA625B9D5C53CAF79C84E8032A0F976EC2FEEA9583AC +25DCC02DEC8D4798E0C145CC523E5EEE82A1A73AE0EFBB08876278A7983FFF86 +527052AC0100CB273390888702DA5C62889808C3DC427BCC5B0A8D787102E641 +2ABFCA74C325F26A74AE2CC7637C9996547B34F33CE355165910F2C0E6445E7E +70DE25D7D187EF97902D4D535956A4ADA1F1FA0CE9881399477A0B72CFB5F841 +1893157F662F071419B5AAB14EE66E1D478AA9DDA4E4DCDAFB7060EC629ADFAF +5C779DE9AB8A65A65722109954599B931C42DE431F5A988459BE94F48F7D2539 +1A8D09133020EA37FA9C7CF8A32C9C1BAE51E112CFCF59CD7FA6E9676BAFD4D8 +093CBF4FCC3BB2E468ED55E28D75DF47CCF621662632E2087A8227945723823C +02629CCDF94D5168A3810B815522588487CD8AD69EDE6D7FA593E638F603D808 +0E2DC9278B63534E63D22876BDEE3A7CAB88C637DC55C9D1C4F3309C01DF68F0 +3919523B2CE7CA52961AA3C2E618EFE1BBCD2C8DC65EC648CD380E3421F287C7 +6F7308C13F6D857C74522BE6A0B09E15420CFAAE8DE28CFE6350217DA9DB5083 +D15B0CA455D343119E3C1D25F1CA143D5568D63CE32856F21328D5AAD69236BD +208BEC83099D6652E91253440A613155EBE7F2D902CAC765F5049FB5433AD361 +7C7EF2BF062877DB1981B9481F961A097D0402CD89E0BFA180027E29B990C2EF +138AACF0D146CE117990CB9561FA6C0A8D1929D5B8BA4C4D9168D6A744ED4B4F +457EFD4B36189371E60DCE4D2D97EDE139145241DFB26394A142D4457AFC0E04 +990DBBF7E40FF9CC5B0624E9B898CEED3A63865690D1CA256330F472EFA9059E +81920A9D365AD4CF9618E64AF8FE19DEFEFAAABF8B878C42C07490AA600C0E56 +76E6C97F5B0038169395855E4338C84108D1ACB59E5482AF5FA034769A116EF2 +F408FDFAF2205DAD5AE5324EE9F1AC7192E070EA40EF350817F8A69D680DCEE2 +1B30277FDCE432D5541D27536E9086C2C74B2B0D5AB976C3E188EBED10777172 +76F7D7F73E38D15D03809B350C2F55E80AB7EB7D4C4C9B7DD97179F36DB5E4F0 +1140662023CA3C389A8B168A68303117179A4AF84A64B2C2A56ACCBECD6A98AA +14CD43B8CD3FB79202D957E0D5BFFB49967E5421426205FE24C9608E5F591854 +DF895083505CD0A4F53DA06D931AFE3BB68F3FC3DCEC7059D3FF5218BF5F1082 +CDEA29587E7E9E357EC1329411FCCA0C3078E9787A12EA78D59B2E8CF2AF09C8 +DA12B2B0EA4A43283C8FC9AC945EB0E63CCFE272BE758B0F8B2C9BAC46F3BA97 +D05C0E720C584E805589D2804EFEFEDA9962B4CD5B145FF7305FA959B660FC9B +37C79503EBC2D1639D2593B0A9F24EE3CC07352614C0B6C531585F27CFB6EFCF +044F2F2A261B0C2D79FF78899DB6B1F2FB06BFAFEB488504D2FD579F55980DFE +9D15DBCCC176E41EA7AD6364D40D931CE561E0AB57F5FEA21549290E539A3C7F +DCE12F4ED93538385B2D30DFA578BAC6DC92A144A72D1C2CEA334ACA6F6C2133 +D1996B97AE8B102EC56426ED5D59DBBA11BA7D6FD39A8692F0931B64538975F5 +61B79F8640773407E873FB4714516037A5C6FFA8C796A9B01898CDFDC2A3F2A1 +5D3BD4C09165F6AFA9EEA3E0C84DB1D058A4C54EC0673860170038CC318DCCF7 +1F3960F12AA2C9447090D91B0EF8A320E933FC8E89FDA5D5897266A4D156BDB4 +077745CC076FB9A12F9D3BE989E2F8ABF44F4BF842DF548111DE129B36B535ED +E5ECF8AB96D94EDB9E0484E00BF942491ED250EA8E062FC59F223A85F26649CC +AB1AF18824045625756CE044529471B253B1F3B5FA2BBC3DCEDC457C0A42E29D +7A152AE14C8D60122C5AEAF5D4360E51BE81A84F3A6CB164181DD1B62AB204E2 +3F078794D9FE570D6115B1C9DEA193996CEBDC5A32D8EF3EA3C309B9F87C726C +5F2957494663A92639A418C450D42D027053DE7342921EEFD3CCF162DBD32E16 +9C8FF39084FE1117958230EF168E6FA9B48590EDC108D7FDCEBD76BAAAFFBD0A +4EBBA485DEA8C89778456A1A36F420FE78B0A8F854CFDE7E26E76CDC2270C983 +1D5D914F3EEEC7E4105228ADD1646013CAE11C03108C6971EAD9C13524537A4C +2CC3D193CE5CF0FED9939AF23E241FF6C82FCBE73CACA6B4B6F88C17A18CE4D3 +4F49BEFCF830777A1B26CF228DA61EA5177A826645B18F21C10E06C748E113C9 +03402DFE318270EAA54F518FF635C340FF581055C1529CD6976951F6819D5A45 +A4DD081C55E7597D257DB9E2E3DBD46B0878895155DB0C4D859B1E61291EAFFA +7F2816E365A5D6AF6EACFD49362833DE3ECA447871D071BEACE9EB8591F31EC7 +CBCE3C2EA428301FCEB42ED2E082F89476F39F7EB993044B8DC23832B25DD3AB +FD6E0A199A3CF03A79F323FF826682C8FEC47BB2B74C22A92D01F0E0CD8CEBB5 +C59ECEE83A7B02E949225EDEE26D5D11521DB381A26E30CEAC4D8E2FFB87E0F1 +44ED94C0E3C022D4B2DC2922321EEF1BB71DE6C221535B0EB6A9837C8A775440 +BDC58FAA05C859F05A654242BBB4620D92E5E8B3C5A937B98064BF97549E68B8 +8FD29B4E57EE27055217C910A199900E2A465051AE0573E3D46E5CD541BBBA59 +5062CF9444E95536CAB30FDCD35A56AF4F5038E65690633DA9890CE8229F6EB9 +E5BAA68E54F9AF6590B4FDAD42B7BC0A6708A1C2E809B743A5767ED46FCB9847 +8274E288E9B2A49803D238ED5FAEFBDE3863B29D55118E3ADC937E4B02287439 +B452DD41CE8298B10AE99AE275D45C5E0EB5680DDDE9F449855FF97B28AD1A9B +BE728BC56C8B4632938A4337D794EFDB56050F5459C031DCCBB1CFAEBBA79348 +F5514685F1F16FADF390B55DB5B671D0E020C03C8D301683FDA4BE8CDB3C7948 +2F5648A2E049A495608CE414857236A70AAEF5EBAABAF1A0950A2B0B814AFD0D +443CD6D2E0365332CEBFD557DD16FE1E3342A85057C5C8337ECEE5466406A324 +B7A5F881BBB2E442C9775A1C33B5321887E3A8E8001ABAA65B1B2BD1191D6659 +3BBD32F2B01A37BBFE2A3964BF37646262E4D667BEBCAF970226BE5AFFB86A1A +21CC0D74E7376B9634EC8BCC46D551FAA67603D4B707DCBF6C65D932FC76C2B4 +8B2D03F5E29C4E2327F5791CCE1E42395319739422607AFC0B6962680A04A5CE +B9FCA10C3EA7F9B1CFEA675F44029F68E3C9C0B90CD7751040239137508E1E3F +1FFCA19DA7B0933ACEB8239703097AFA4DBEC0FD8F94AA7854F83DF191A44326 +EA23CB5F18E342A9110D30A1D9427492564E7CA82FA80CDE8B7ADD8787B3FCDF +A5D52B14B6147262461F3563101CD20A457672F78F9BCB7F996D7699975C018C +07ABAE4E0987AEB32A45577BA6157B51E9BBC37839FCBB886B8987389D8C82C2 +0281A89F98874003140328866916A547FF0B47F24982E346FEC11458EF35C95B +033F35334E2956A631F7192A +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +{restore}if +%%EndFont +%%BeginFont: CMR10 +%!PS-AdobeFont-1.0: CMR10 003.002 +%%Title: CMR10 +%Version: 003.002 +%%CreationDate: Mon Jul 13 16:17:00 2009 +%%Creator: David M. Jones +%Copyright: Copyright (c) 1997, 2009 American Mathematical Society +%Copyright: (), with Reserved Font Name CMR10. +% This Font Software is licensed under the SIL Open Font License, Version 1.1. +% This license is in the accompanying file OFL.txt, and is also +% available with a FAQ at: http://scripts.sil.org/OFL. +%%EndComments +FontDirectory/CMR10 known{/CMR10 findfont dup/UniqueID known{dup +/UniqueID get 5000793 eq exch/FontType get 1 eq and}{pop false}ifelse +{save true}{false}ifelse}{false}ifelse +11 dict begin +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0 ]readonly def +/FontName /CMR10 def +/FontBBox {-40 -250 1009 750 }readonly def +/UniqueID 5000793 def +/PaintType 0 def +/FontInfo 9 dict dup begin +/version (003.002) readonly def +/Notice (Copyright \050c\051 1997, 2009 American Mathematical Society \050\051, with Reserved Font Name CMR10.) readonly def +/FullName (CMR10) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle 0 def +/isFixedPitch false def +/UnderlinePosition -100 def +/UnderlineThickness 50 def +end readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 11 /ff put +dup 12 /fi put +dup 13 /fl put +dup 14 /ffi put +dup 33 /exclam put +dup 34 /quotedblright put +dup 35 /numbersign put +dup 36 /dollar put +dup 37 /percent put +dup 38 /ampersand put +dup 39 /quoteright put +dup 40 /parenleft put +dup 41 /parenright put +dup 42 /asterisk put +dup 44 /comma put +dup 45 /hyphen put +dup 46 /period put +dup 47 /slash put +dup 48 /zero put +dup 49 /one put +dup 50 /two put +dup 51 /three put +dup 52 /four put +dup 53 /five put +dup 54 /six put +dup 55 /seven put +dup 56 /eight put +dup 57 /nine put +dup 58 /colon put +dup 59 /semicolon put +dup 61 /equal put +dup 63 /question put +dup 64 /at put +dup 65 /A put +dup 66 /B put +dup 67 /C put +dup 68 /D put +dup 69 /E put +dup 70 /F put +dup 71 /G put +dup 72 /H put +dup 73 /I put +dup 74 /J put +dup 75 /K put +dup 76 /L put +dup 77 /M put +dup 78 /N put +dup 79 /O put +dup 80 /P put +dup 81 /Q put +dup 82 /R put +dup 83 /S put +dup 84 /T put +dup 85 /U put +dup 86 /V put +dup 87 /W put +dup 88 /X put +dup 89 /Y put +dup 90 /Z put +dup 91 /bracketleft put +dup 92 /quotedblleft put +dup 93 /bracketright put +dup 96 /quoteleft put +dup 97 /a put +dup 98 /b put +dup 99 /c put +dup 100 /d put +dup 101 /e put +dup 102 /f put +dup 103 /g put +dup 104 /h put +dup 105 /i put +dup 106 /j put +dup 107 /k put +dup 108 /l put +dup 109 /m put +dup 110 /n put +dup 111 /o put +dup 112 /p put +dup 113 /q put +dup 114 /r put +dup 115 /s put +dup 116 /t put +dup 117 /u put +dup 118 /v put +dup 119 /w put +dup 120 /x put +dup 121 /y put +dup 122 /z put +dup 123 /endash put +dup 124 /emdash put +readonly def +currentdict end +currentfile eexec +D9D66F633B846AB284BCF8B0411B772DE5CE3DD325E55798292D7BD972BD75FA +0E079529AF9C82DF72F64195C9C210DCE34528F540DA1FFD7BEBB9B40787BA93 +51BBFB7CFC5F9152D1E5BB0AD8D016C6CFA4EB41B3C51D091C2D5440E67CFD71 +7C56816B03B901BF4A25A07175380E50A213F877C44778B3C5AADBCC86D6E551 +E6AF364B0BFCAAD22D8D558C5C81A7D425A1629DD5182206742D1D082A12F078 +0FD4F5F6D3129FCFFF1F4A912B0A7DEC8D33A57B5AE0328EF9D57ADDAC543273 +C01924195A181D03F5054A93B71E5065F8D92FE23794D2DB9B8591E5F01442D8 +569672CF86B91C3F79C5DDC97C190EE0082814A5B5A2A5E77C790F087E729079 +24A5AC880DDED58334DD5E8DC6A0B2BD4F04B17334A74BF8FF5D88B7B678A04A +2255C050CB39A389106B0C672A1912AFA86A49EFD02E61E6509E50EE35E67944 +8FC63D91C3D2794B49A0C2993832BC4CDC8F7BD7575AD61BCDF42E2E421AA93E +3FF9E4FAD980256D8B377043A07FC75D6169338028692CCA8CD1FE92FD60AD26 +D57B7519B80A8F8DCE9CEE5CDF720AF268D3C14099498A843D76E3B6C0328F24 +D36EFE7F5C4E5B5C612786200C8DE3A41EE5F1FFAF4097653CFCDC8F4FD32E0B +03EDB3E413283B9EFB0AC33B055617005BC9B0057FD68C52D1B0E67F0C571685 +767F2AA85ADE4E0104A1C777733D5E318A22A9944336E5B98D965E50D31F357A +8B6EA5A0EA98E1B027CE68C2EDB149EDDD04ED74A1B3D206D471A0C11C11449B +DE190BBFEBC08C9E1B7513B43DA3134D6B11A2516E6E86B67F68C970A320D05E +94FEC57FB347606DF89989C33482BD09D011C55AA920319E7B26A205D3D0F004 +22466F09C0482A164CFB27EF6ED2B040ECCC3DCAF345B5A73676F193D43123B7 +72FD6CFC5E37930E61EBD5A6307E4DE70194E6384EC0D79DB6AD86D3B319A31C +8B0589D0FE28241D8ACE280D0530EE99C80723E560BB72AE9D53F4713181F491 +344B06D3027BA4E9E94D4305BE1D817197C54C8FF56CD6964165F6448ECC8A8A +64B48B4F0FD69299A137589E2491A283509B21A3A5772F75B7602A9F60AE559B +07A58436D04222C73EAEA72DE9A5A441F88D27C11F4F91255EFE280E91A4ACAC +1E98A4E5E6C57B9AE86FD218C3CD8F24A4104156A80F13821384E529783C52C8 +78B94AB3A0096090867ED32E8A30980E737922037F75F062BD83BF4F5929BC51 +CC22AEE2DBBAAA001CFFBFF41D258424FAD888FFF1BEAB796A44E3126159E120 +7E4025C676CF94888A1971AEF8B6764B3AF4A92D36FAF6FC56FD049710EE3782 +BC2CD84FE2473F133BE03C1346B875463F126DCAB15C7A9BCC9A727D23611462 +4E8D2BFD2466600285D79518712B8681ABCD69608E6AA9578F7BD771EC36E01A +5A17BC17E375020ECA59B43790ABEB9DF5F4FBBEF807E5699EFEAC563E1ACC5D +EFA336E75DE6D8248E9381BB110884FDC89C2F9A41EBBC9A8A1F98E6A41F68BE +EE30E25CA148C1EFF42DFF8C214A6537AB11F260B8C329A4947B5FC8DC9C5622 +4DF7BF4FBFB00380D47BABB03BC30627AA74103E553F55278F538EDD8C1E64CE +0F1398CA0AB5A86630139B4A7E8FC02804CAFF3830114640AE50D2FDA3B561B5 +C63AD7EE3347804CBB40FB1E77A6C89735DD870351C3A1811591AB493251B904 +314F65791963C0412377C1D02362C5E9655F1C3D4803CD379A8EF24C48218C2E +DF1165840462BF37DDE1B8D5FF09FA2C3B261E2F1A65ECFBE5D4EAD43B52C029 +EEB3948CB8A252CBAF545C8FA1C31E920E23A12DD7222CEF2D2A513BD758EA13 +DA33BF5FBF1D734653EB83DA2D374A5B9A0CE316F24EE375D6DF6BDA49954C2E +DB25A88821193636119D469BA66E5DAA9C92520FD4F84426A4E54273FA469084 +7517817A6EE3E21176D333825E88046F50B3CF6938AF9BA79A2F51398239EB91 +1A2D07F7FCD948427FF62F40FF95E39FE1A1AA8451411563FD5388472251C155 +69BDE9283B41900B21EB1190D06E6B13B7794FED020D2C1BDD205AE77B084BCE +EF628249398B496DE85B406FC2E1939EF00DFC84C07E26CF72EC401BAAE756E5 +7F6673216E7560D1C2A723CB405EE5CA474A07F61B81F8836482F73DC9516D67 +CE0CB770EAD755B6B356198B4B97EBB29C63456953270CCC8D5650C1D006E69D +38DE2DFEAB27DAD50A817F0D645D30AF5B75A7B53CBD3D2B8D87BD0A7E525AF3 +22F7ADDFCE31716914C2318260C2E2B4664893921B68C5A93334A361D94A759C +0D7B146D6FD94F0442D672BDA0F6432E18F3C5DFA37ADA378D95B75F413C9ED1 +BB5C606A3EC7DFB3F796F59B0478C13FD1900381EFE0BB5242D5B5D34D03AF1D +4BDC93EAF8020E26CA23C8B0E7DDEBBC6762A557067A4CE05A524188A8F02E2F +3625DA38DFCF381727887F5646A3995A8A38A5FB1E5D5EBB395FDD0B7C8E71AD +B48EEDB62AB2CE99D121435EFBBFCEEA69AE9ED8238B60CC7288DE33C766CDFE +15B767B4AE2E6CE0965E77272AC9F86023DA620548CFAC85BC751C44218A29C9 +849F1C2DCBDFAD895B54E51A569952ED50F82DC8A19F367E7E44643854EFD6B3 +FCAEB04E55E4661C82D31E2932611748480EF61FB2FBFB0CFB940BEA81AFCD84 +4C6A6332D7A600170E38A8EAFCD4F93DC153C43175434C86BC747348FAC61B76 +1FEC9027C1A193E55C80F1F20B5317AA0A05AAA36AE235F6E49F06E570FEE798 +84857D7552EA92EF3EFAD52DE39C2F8F43C59E3A957B7B926FC95FC4B60186DF +7F3523EE2AB74E294C8C4BCD8B4975E84849E0FBDA6C0B0F24A636DFA578B122 +CF97BC5089E21E9F5298D1C9F30CB8BAFF6A3A11BB4D9A0A5CF2B18D055C44CA +4FD4D8FE1AF3630907DE7E585AA811F9CD11FB2C8FC791851D651009FA5DF20B +3C33FD2FF848A9E3F5652BD294965A332DD3F246C91B0ADA34017FF2451D1394 +F9C3C95AAC6EC8062BE98E8914D51DA6A164AD13938693D446044859D03A949D +F9AC5DF4A000CDA98BB516D762CB9F6D44B5268FD0C26E88BC4A760C0F75A140 +DEBDECA4F511128B7D2805872160C55236F0A0FA7637FF0D4E94AC079CD3C8A7 +D03A5A56F26B0438B577C46011A10532FEBCAD14FBD6032E224F45691A726886 +56F305231EB2FCDF59C8BBFCB5DBD2D093A0E84D62AC93A2312CA69295E937C4 +8DBA1802B85F54B5E7E6D6216A918F911FF705D3B5CF055F1D873B96283A0B53 +59344D910CD396D883F6F7836BA65FAB4393A773A8F6BC298069E5BA38210EED +49C9D920F718E3FCE692527DC7CCE6963BF744F2C91BC5952564196D60574E86 +87A0FAB21F2DB2BD5A51D7FBD8FC19946D24E5A228462C4772F978E650ADCE3B +8D66B9C21279C531CA1C3A8ECE3420BB65837287A7222CC3673A2A5F8BBFDB60 +C719CD073EF9A23675198462C7C87B24CC92D6AEE5C25AC63855CC3281494342 +D28F3D2FDE0C183486769A4FD5B0143193D31FCB2C2A14E487BBD96D0BADBB64 +D1B56021C363A795BF10E2DB448261C363A54A4AC1182B470C457AA82DF3F5D1 +F4B329806141EBD53CAE309319B94133D7EBDC2D0453A905ADD207364371E178 +0A95C2686E3B34C4A978BFC0EE968C39ABA00889BC5149162C2B54483D44FD3B +5CFF41F611C7E03B94945F414560E874D7CF27FFD0630890D7D7EA66CBD15448 +229059E1C436BB33D69552B5367AB5D53591C4678D0C704DD3EA23F5D9E8A7AC +17D003C19E333E726FFFA2961F33C70F429085F7BFE3E2510F59B78F58B19CB4 +01B48E184BAD9020FECCE3AF52048A056981DAEA02AE78197E65855DDB170616 +F54278395D9EA50DC83761AE759F9CDEF9E1948E7002414FC05286ED793E6662 +3347F2A9AF8917493D7305B92CF93E8E9185F70015F5594084298A6C2F9FD3C0 +689F262AC9FEDC9B89577ECDE92F08D3142209FBCE7B5C0A840CC767BCA56C20 +4E4E545E2BE4D21C53855CEE4CD0AB35D1A604C0FFFF77DBAE4289752276559F +A05FEE65F45ECAF44E95E23FAB6052195C7948AF0B1126482D4E02D72BF8AB03 +DE0F1A632F7672AD9DDE70EDC82AA993678A82BEAD0BC2649C4707FD8509810D +364B5C6FE0E10772E95288C622C2F06C634F4DF8C7FD1432BC9310D5F24FEE3F +7AB324863D6DABAA1576E70643CA79EF4D7DF4105093D66CEE0F3B87D2164A7F +26EA05F5C4645B22D3E1BFD2219657712C168FD90DE801FB0F32759E80DEC1E1 +43CEEB19FED12D757205043FC98FEC62D6A8D8B97BC083B4A0E985AF7850D6FD +8716B9957C1C35A0675BC53DF672C425C79F43FDABAEE7D63F092CF271C9A9D7 +C41F40C4189510987887942E60A412B3EEC84C9A6E1AC7D54D528F5604B72C08 +94B7882621A5BF1F325B92FF96B80878CC550D1AE4D8196E41CB1251856609A5 +C4D3BD05A922D0D45E039D9450DEF8490A3E924E41434194910BF60BA1B08BE1 +B41824345627745541A4F1703E956328F6227D11C74946B38CFB096139979E56 +4E723B889B44C6D78673868C89912F8B4F0B4B485F1587A637B630F92E6072D5 +7F3B44EA6FD96BBD4FC28A6C1D90805E3BE3E42A7BC9C880762966C55BC04E01 +204D083AE976FAE6F37C94F27E68F8C0F28D52B17F6C0FD7C9150701FD78F8CE +B8E8DC9260E3974005EB5CA728171F482D765016C94D4ADFE4A42EF42212BC56 +7E4EEEE8B0D2A7856CD4E44F55C0BAB762F92CB8D64C17022D4BF3A47C12F5E6 +279FC23101FEE93753653CE8CEDC3B75C9CCB29BF1D4554C6120DE8EE750FCBB +E38B5D915206974962E320362E59B3F21B3AB1875703191043D03284D4467346 +CFF2F98CEB4845B73ED8E003E0DC94251B73E13A9B51A3F1430BCF6A21EB9B7A +65E17FA411F53BE6432F1506232B8159E008FA257F884A4A01AC53BE91754D78 +BF14A5B0FBFB9C31BF4908355F8A762052968DF526D118708CCB0B7CB5BEE285 +6DAB6CD2E3934178E60BECB11AAB5478623CF6C50C92F8BB5D1A583609028FA7 +B8A53B791BDC9EF76A124F3F7641857E4BEA0837CB36176EC9A522EA7F41B8D3 +63C37D1145367BD300F17B54522A834BBB74DE12BF9EB26ACE6F24A046D58F89 +4D4B7DF74875F1A0C1C9D97BE0849593D7B398EB4B00BEBC8C8D1497B6EF831A +A35380FFB7F1AFA4D888AA52C9482E8B1755CC209905F98F40D95B44D4DCBCB6 +67423D1BC2F3560FF0A8B4F0CAC352A4EE2C1D946E45AAEC8A6AD40303F3382C +DF0756BFA3B1ED64C169E56ED1C760F2FF0E24DC5C9F41306EF8D2628153D30A +5DCB0791126BEFD4947D7EF08301FE015F2B0008DFFCBF9F2D4D859FD43EC7D9 +C5BE237E9BF6665B7B1BEBB362F0C0C3A8D86010B9C97FA741C97C2E0513386C +9C26C235B14DD2A58BFDAC7B5F63DB4DA6D5D37D0098175A9071590E1DF66A3D +B8173A047C29D7D35557F06132CC920B5460B8AFC11D23D09A4E45D089F5EB51 +963FA1A6256E359D485107FD143B2BF21FDE9DA5744BC2615E86C31C89470CF0 +D06C6397D9FCCB316EA9989430240759D2C4945D941F159FC02327F34B042BAB +B5C3A47C78E8C1A6FBCD396B1A51CC4B020B8AD401841EDABACECDB482D6EC5B +72D2BFEB4556720FADD49D07307C8B22ACB7E310CA4151A85C71EEF70E8D15DE +B3B00F26E0E166C14647A65ADA228A3D1C89025BE059306565DB1B1EFC37D358 +8C1EB024254AFD049BA977BD4C2C605050E17940A89D0D4C5D963E792320F5DB +3706682E03D25D9E02487247819551465092CC22B6B56E93F3AB528038FEC3F0 +668F866707A19B0463BE706EC729D2EE1653AAC7E29BD25BFB3241D4792F5152 +ED415B4E7FA92C2EE5A22E27E8B75542C492E56D811C192E95542A6FE0BFE5A5 +69273C2ABED4300D491B92D2AECDD278404CB84B1BB1BD7AFEC858215837D118 +C0E928BE7E07CFEEB51A6D21375B772B8248C994564014015232A0DA4BEA1754 +3274F407FED0837A236371F1A32056240F2015B1E7F4B2CA72C6B58610A66F13 +407CFFBA5E0A2893C1F572D50F51286E9133B5A84239C9493B0574E77D281D01 +11D00683354A000C9700EAFBC1FD104EA19DFCB87470190E7E2CE26E3A6FD0FF +2620B87B82AC8686B6206B530F17E9348BC7D04B948348802CE53A312443DB87 +4DBBA5313A6A2A8DAB8A1CC9A594FF8C299281C0A261C8CB2226B732FBEEDE40 +2C6ACC74A1A61379E2E1CD5548CD908268A32FA83D8504C442EA0E183ADBF7FF +9FD09C037AB03516ECCA93FF048235BD11A25DB07F164512A079C5392AC7F889 +CE96AE5C8D9580BCAFCC087C35E76EED1A671E87C12E3045E15A687134736DF8 +DA984772AFD189D68571A2ED7256F1E204230E41D3D9DD876F938951714A3973 +0CA9310489F8E807C1C7A4E51AEA5BC030610A5D7263FF7E0F9FDE3E5E37A362 +5B919000BD94D978583B942EB79CF2BEAC33FEBC9A67272EB10865BA8FB75FD7 +9D280AB59F91B96C16C982DE848D76D8FA8620DFD7C80B7DEAE7264350D6FB3A +EF04794DA3305844A7CF718F6D1A4A3AFF6826173A076A1372ABFC54ED3AC6C2 +09C9287FC830556CA694E21CA5342ECA7B10C90AFC4783D841D7B1E34FA3DB7A +2B706F3E21B0FBAB23E7257962FC3BC309CEA2C7239A9D6B44CC96825115ABD2 +AF9A2566D2F3382C01569FBDB94C8D664A5DA0F7DC3DD140CA77C743D7BC1420 +324ECF9E4780280EB119885E96A6C619CE3C0C8E1E264E2DEB137E5DC8149786 +486D65667ECF47B1A1E20E9E6E4FC8323E0BC8E61BDD3BCDFC6575C69C03E31A +EFFC290472CBBD049DE3F840AEE37A2486034240F80E75D8A79E0762377DF660 +52B12EAA16D678990B11A9BFBC03C1D4FCDA9FD4FFBB3E88352438102F10B7C5 +9F04C013B6575B5E948FAB58EA691984A0E54E6B9F3F505FFFEF74D06FA1CDF3 +4B8A95904C8A2763AA8AF5B71D00F5DE09DC1CDF87A08B6D181453063E14C12D +B7BB3775A6E2A901636273D9EEB833EA8CF20FD83AE899E28DADE10EEEC20BD7 +BD93085A4B1AC80AC1AE8280C14767F1A487BD066007A0D050317BD081131A14 +6EA0898ED59E46DA7B6254BDCCBC660686E2EDA0E77A705A653733BB5C5497D0 +B130359F866CF293FB6EF0C2AC5BAA2DB0DED045E2DED3A2612D078333260359 +16CF0CCB272D34767EA069E0F0B0D42327A18529D72E890EDA6195C2688438ED +E9ACDBEED41E81CA8EB5E43C2B09CE266EFCA03F2D7FF57F12B06F9E54FCC6A6 +546676F6FFC5B8B7D3F0982B6FF0D21D949309F0C0B175CC1D0976F8C55C6AED +6E821C39041E22D91AB30922F2B2EC2746BC7DAB484991542FBC82D87B487507 +559AB466F73EE23C2D3194DC5CE4C9AE66D3164613AC5CBB3DB501B64DA7C91B +C7ED2EE9027FC0906820B35D4F2CF66C4F9CE4A884B7C07155BCA884ECA5EB3A +ABB83F84DB1F5639599DC7D3F51241AB5D95C3BCB7AB1EC90B4BC989F74FB354 +04B2D7366A34D335A47B8C00C05CB423482BF6C7970A95545424A08AFF9A035B +7F83F52B65A9799CE76E303B85664B624C65E9CA58184C7BE2BB9D9C86A4DE5A +8165EE3DA2E652B5022EE7893896BABD88931DE1D538F615787645DF5ACBBA0B +A8E5B899A37321AA7D4B283AC9234978C2DD81813A1EE5DB6EC170DAC1B6EF02 +94892635B498765C07A38D2E9DB0B7581B11056C28278F89B0E60998379C07EB +C0EAEDC32AA69B8B836F92A61AFD35688315B2C3F860632FC13E4BDFB63214BC +41CC6859EAB3AC3034449213CAB99FA1D216563419CD6D6CE4E1B56F33E6C654 +7AA9DCB5B05FC068DF02AC32408C8010AD004F6CCA9887830927F8CBCD49CDB5 +18CAC1EAFF815FF2F6F527F936948201565003022C6C7390B4E3C2B219FB4F76 +9F12BD25CA7B3B61D1A2F8DFEE795D04D5428B42FB66E0C254AF7B7A10CEF7FD +E5ADA5E217BE24851180E9A1700FBA66C7D2B0D7BFDE4F4EED1D24B821A40947 +5620363657F6D048E651A689822CF815E72FC8AE9D835BE31D1DD8B54C9A717F +4DC319B4B59AE073936EA40B070524C7E71D5A7B64436DA107749746B516E29F +E3BBCB8F8C473E706670E11E5B221716F315FF097CD1841D0069FA69EA1898FF +9F9EC2518C77806A19730C97F54BEAD604548D553D4A6EDB247853225E24E7E9 +89D71F6BC94DB986467E755CCC99069B313F5745B02B4BB608A39F0A0A732B87 +7EA2DED68219754BF1FBCA350327572D769C962EF9242132D93A5C8E9725D8D3 +AAAEC15ED0F362471AA58488620156F3474FA59CA080EA96FE995D2B3DEEADF3 +3141D157481C66507725ACA5953CBBE1ACEE7E3F02C72C6552D15EB3D612730E +61A06A43575568DC3CF3844BABF04CA767E2995196097015E0C4F622C4356B6B +F41DBAFD797A4B9D7AC22332C552043EF98913D0D9B50CA6B7CDAF903BC5C04F +D20A952BA5CC35B646ACD0A287C956B98C450051AF6AAF79DF37F8954473F8F6 +652BF03AE2AE82B99D820CF93F5FC0BA17EBD7AF90313E70594EB5C354023BFA +07912408F1757319C7288E99872B907D5AB583B082EEED8AB079C63E38B07D11 +6744856E689A479CB3A8BC081F33CB06755926204981DC0A45B3ACC18F6865BB +EE2C50DB43B62E3630FC1D9B1FFB3BFFAA6D0A20C0381ADF48E4D916BEE85BA2 +BB40F538F55C11D50F882B73913840B45161262BC8B0012694C3EF26452F9B77 +2CD7C7AD6BFEEAFE31C8A721C2D46AA00C10681BA9970D09F1E10DDC250E2AC3 +9A160EC8C9654FCEB36AC2B586E978D54744FC8A0E963D8EF6E228ADD22D093B +B889C940206F504F14DD921D909BE06EC9BACBC23EB9E9D137FBC983570FFD2E +CC5D2EB5D2A4A8604A4AD418B800EDC6B89809E0009760E9470F037FDD15E649 +93E9C8FCD9436AF02447C7F5AC380FBE69D1405189E8DBFDACF0E7DAECFA095F +E6AE1A2E9ACFC032BA9A5DEDE9DDEE22A88D9A1F1E0FD9BAE2D88FA168386D43 +4B93EFF3AD84A9C05A80462BB3A940B2F7311CF7054F501BDD4F1347213C9327 +5653B73E9D78866901235C66B0C49CBDE3A1BA3A11991E6B8443117745D96020 +38F4A74D9676E4E99291D4420C57ADE4A8D5214D07B14916D83DF15114393048 +FBE0DB83223F609ABE120AB877FEF549B6E2389487BB7ECF1979BCB0785DAD1A +2916961A1DA60AB491FC90BCD6578571226B4DFD204E75FF18FB5E72DFE8A028 +C66F8576254930567A877DBD22F8372E7BA4F23F9497ED653906F5F67A66A1B2 +51957AEB8D443550161075E5523F3D2AFF386E2640B276C3EC5EDAB74AC0DC94 +7D975D7F5781A652BD13AA7F97ADDBE68847167997ACDD038E74E930D8248F0C +2CCBC094031C7147BD8D4DD664184695CF8C474845692540FE2B8A72CDF9DB62 +BE05E15A05F59D56E5EDBE7C371BE5CB3B276FC7A03B5942057EC3136591A1B9 +15E504DC497B663A9DD1729EFD1478C233B9317351D000DC0982F061BFF25A3A +8983E560AE31E321DFB137C77C0AEC704F8DA99024232F26AA6920D58CB17DE3 +C1BC8E20988FBC4705E594569BEFC3F6666785B2FFA49367E3CC695F2A1EB846 +DEB37E120B0F4C0783C0D54655C143C4F74DA0690C6D08D07ED225F361BC0F86 +572D79540730791DCAC15823991FD5DF1AB8F25F84EF40C085B17C9070C59EE6 +31DCE45AFA78440BDE4C69A4D954C2006070A2C310179851F2D39B1B5D3EDBAA +289570BE80F25D75116BBDA61F002B832F9EF2C32B53258B15A1174225168B28 +EC3324C6EC61E5711811E658A1BA65C8D2D47CEC6071CD88DBCDE9CFD2BC34DF +1ECD2226AD588B50AF2399D171E99D8086DDE33E24640A767F249797B1B742CC +F4E95A64E1AF8D88FB128194673CDEFD6A1672DD1D03B6749E729587C0CB7C6D +13BFC785759F35578D611E924CD89FF87DFBC5C93FA7BE150624825F7D137CBB +FBFB1238C1A397826B8D1DF0A39EBDABA5F10B37FE8C27568E1C088F279A0E28 +020DFD377694024FA154AB5C06EDC3CAAC3CB5A69297E1079F5C2F351D81614C +D73ED708907A96F6F8FB0994D3247045E8D41028432E91C7ADB2F22066D6F8D2 +701298CC9FDA7928F99CA135B69808AF6FA1E0A3CCE1BFDE234E9218A565FE28 +96541CB9381E887182873FD7866F5F8415EBE92E51E7FF064D6CEB7BDBEE4DF9 +97633E53488AB11EE93137AA185AA7E4AA043BC73DF1739C92B4D3A8C46BA689 +B9F8FA73BE010D7C4F9007937AD0EE3EE4E3041C72A2C4DB92C6C5433DF33A10 +700F9E891885DAFDA44A00781BD019A9FFFDB6FDF9361520D50AA5037E654C8A +ACD179511AF61BA10DB29A0535972DDE8B838091B5EC3F6C3408E02B8CBB3FD1 +E213E2C53DB7AB14D465CB0E4FE2A2CAFA20E74BF4601CC23687FA7921CB1B86 +6DB57E04C99BF7F56FED75A052362016840676DE91888490B4A1DFE0C079C88D +C8C3BD3527F7C006E1403DABB47C3F9174208A379C221931724F06270985BDE6 +A53263227EDB00124C5677613BEA94BA029F9D6F8BD1F7B87C4426210AE554C0 +7BC707199BF6DB673E40D55741CE1F0853504A414099BA8E0BC7F5EBA5392684 +79552A5D4F7C0CD3A6D80B18014008AB011C8C66C74D32AAD748EF30C1AD484D +B56BFB090C5BB937E81189912665F332911E11E83CCE75A79DEC2838E811D5B7 +DA85AD6ACB7D8A98D15DEC66504CF2131FF06AC9A8A4FBC4CF34EFB8455C231D +0F73A50052AC8FCFB2B2ACB95033AF04078E9CB99551FBB1C46EE6C413D86C90 +AE8BD7FBDB7BA6E9087658C79C4758E242256C0546DB76A3857BC89F26A4DD9A +F4A848104BF1ADB2DCDA25C79BBBDB66CE1C1A45C7427FE7CE5BDDA7CB599B4D +B5D346B15414DC9688A9D00F0372DB98FD33E6164E5D78D6CCEEF0FEA60A7F5A +9873AA7E2A7F98893AC5A9598B71BD06D13D2766489248190A262E5EAA459888 +6D0A38261697EBFA55180F3D416C2190B36C309202D1619A405764612BAA3506 +7D157F49FA1E0A7F252FCB0B8459A30975E02748AE1A891FD6BB288E0D7C144A +1D348F1DDD145912678DAE1906796591E35012373AE01E18515F5CC3BB29A629 +F8B28B54376A9E10D0CFB29B81981E66F27B6AF44DDE0A3621B9ADADA9588201 +11A0362FEF840B200C84480177C9E3F0777350BE92707BA916A90AA81160D498 +6417DB6C7E15766EC5C9058CD51879041BDF2D2514B0D6B968CA0A300EE2E30B +6AE41238D76DF324B0502BF79D58C2DA1FF7E384891182AA59918DC8EDF92299 +BA162134FC3DADB6FA5CEABB94D1CA9BE1635F769EAA88377AD96510A4DA8F8C +5319E0C06CDBDA1BA9845302F716DECFF7B965BE413A7BCFF3C4EADC91626070 +9A5776EC64C67DDBDBBC66F16962306631D70E62616DE4997ECFE39DC6BC9A75 +D2297C2159066195F43B7002138456AE7EF69220925877C87405D06144D250E3 +55EEF1575DE8564BF98E2ED403591F2EA4F6AD71A126A9B1F5D350819058FE4A +949B8C3A7907A725B463B752EB3B44B090C731EBB86FAFE24340D1A89D3FC0A6 +B89E64C3FA480C91DFCCE4922C000B0533A052FB9305EA3B58A38A3AC2688715 +A7C7418637C393439725F0509B3B08E07DE5E0350A005E4C5DB815CD317EDACF +6460DADCF9281BC6523DC8FFFFE18CFFB2EC61884E7B324806851A91F7E0336C +F86AF2C88F1EA1EAF0F87013AFC7DAB6F6BE426D92A406437E38C75614AAC461 +4EDBD8F129D985A1385B0F9F1A4E6D9936FEC600F4E431C653DFD1D56F694471 +FABDCEC7BAAA0C266D35D7380AEE587F61DA5CD1229D99F82BFA7B1A45A165FB +658A4E7A741E11931D6E5C1358CF76056CC0DCF4B623C2A8CCED91694E46661F +BCBA0225541BA9A58EA1F2E2B2402299EF2B691C39A87AB3D5C722DB2738EDC6 +8ADEB09750D714286EB392D198A55784AD908470517724B92849D539ACAE89E7 +A8E37CF20CA87635FF92F1140DDBAA76CD52BFC0B40FBFCA768F837D0AFBC7E9 +BBC89422CBD6429B284F67AD2DF917AF69346A5BFE8DA3DA8F9597C2265F3BC5 +A90CCE79572DB45176AED6E1A5FBADC98816F0E29BF58DBCEF62EF76A8D8C845 +4C7E9AB94A0EA43D2FA271BEA800890613D8247171938596CE4948BCBC7960AD +5B2BA3E0A4384749A7D88F3DD515CC1DA7292EE9775B67F621E156020419D0D2 +1A6AF5B51E64D3EA7D182AA65AD1F663FB28739B86F9EE5880A5A96C3AE1C563 +7A002FD0ECE3AEE80AF18A0FBCA3EDD496C18C8974E856BA39226C382CF8541F +F7E2C35B3CEB1DEE3BA8F346199944BE2F350E4C3DC89D789250C3C5192236AC +513D1A3058230470BBA11E0B39141F48065B808B6FC459A897C304B749B5A656 +38B55950D6F379A535CE2816498DE36D03747FD07514C2DA1764217BF2DE17BF +C8FB2F06382136D301953DC42EA0B429489275571F6B86AAF496E6A2EB196547 +B76BD6DFF6054DAFC9CDC11FBC541426DF0351ED027FE76128411F6F62DAD159 +C116B43AC59C885B3308B158EB74405541F2BD247BEED5D3B35554EABCC133F1 +B71EA3C7C7876661EEDC141818A3E8A9C519E7054E26DC023320A0166FED1C19 +DB1C3044D23E5BA7F039D86ACFBCB5F881A6FF9135E1F5DCF910A873E6F7DF8F +11372C039D09A875DDACA3FFADB73504C1749932C3792CA80D78979CE0269AD7 +47CBE7CA39E26FCE1E71DB711D176644423FB964CF8CCDF16FBB686877B1B99B +FC570BBEE55DC7F2AED8E81FF38DFD61322F1FB69E5CD6EEB8135128A35FC23A +5ADD95D4F873B2EFD14A1FF76CD20454BD3BD2752C9A5F0C21F1E5F39C5865C6 +D4874580E6224B22FAB9240E0346C843AF0C495E7FD5B3310D90A6308D47E882 +EAF80772C87D3F7FB9DDA52F253FE4E3D1E56EBFCBDB9BB9A977DC7E9772428C +47EDCE4D4F793F4DB9C66E65827109E83723E50424A87B36D6E74DD05B327128 +E407252F937ABE315B18312C8BE965E84ED9C895D275A331EBA6E872DBCEE1BB +C6254960940B95F46CAB4F8469E7412F546E62683AA356366F454308367A789E +B1E6F3A07B87829111DD17856727E948E0FAECA4EB00192F125C2331011AABA8 +F4067FD01D56853FA445ADEAE5901242DF460ED8AEF939332F87D81DBE9A30A4 +18884AFF8A7F00530BC7DDD3A1E6C40549BE3E567B225E7C8844F0AF3E19A4A7 +E61F818A5F1BC836012FBB9AC4A5AE737FFA908EBFC88B2EAA62877B05B1B1BB +65062420B89BC4C3C4B7CFAD1148C6A373F26ABA9A8DDC74DBFE47937035DB49 +20F0B8E788C0AD02381732BEB2B9587D6B50E6F7B4E9DAD171B8C64B60A04776 +F70BDD9C6C8831AE39561701FB54D68810E4C3249C32E4D39BB40C500C8A735D +F316A68985E3A0338D8CF730881326E2B76D75BD2566D7387C0DD8C5724592D5 +1FEE9798B269DE09387D3A1EDAB20063BA852726BC7EF07CED98E2DD1957F94F +7E336F6047A935E128444DA8F525FF1E458ADBCB1B6D910B68955DCC59512591 +2F1228007F9524A0AA6113FC6805AC4ED806D5CE6E03AC9EB6830EA9A7AE975D +99A4FDA50B92FB6977BCE8BCBE2D8EA44BCE9B39718584A452205C4349561CBC +7B1E281C058D0BE636CDDE883E1C1AE3802A35C5426443AEB6FF705EC26AF94A +2A7BC536F373C0EBAB41C780E56F5BD1CA645DCED5090CF32D4F0E5A780651A0 +477CB27558B2D0E2AE3D0A02565EE38D5F437D01308A6BEF55E80422F5B5B56F +6DD11ED717B034083F9BB1536D76E321255A137E618B398875B5BB8F5AF02B6E +B4DFFB173C424B24BCAF3C9271A54166A65927519C9770B0DC44CE276ED0C20C +8EF41AC3AEBEB0996DEE664E8F872023710D0BA81DD3A3EBF79BC24717BA1280 +9E9CEE362F5BBADAF6D8200835311B1063FAE4D6EC8325A694EC516AFD24FF99 +EEE758AC14E76FA1573462BCAA75D246AC363C412185D20CDF1539011C35D1C9 +B3B3717F6A37DE522943CF9B3D8CF284B4C0068A1ABD9B58FDFC20CFDC45BCA3 +DD054AF00C18CD7EAF8DFFD45C28A82C7B417AB7188BDB49A5871320B2EFE0B0 +25CE25F3BEFB53856689A44D365C55218190B407B7BF9855ADCBEC5C0094CA63 +11E014EAFA0D1BB324D3B1D94DA4A7AAE9D29C71E2D5F122F1C79726731FD066 +6545816A5E05DE1F8DEF865DDAE0D80E9AD0120A0C81384AFA5BCAED3F8FF80B +B9F8C8A7517A3863034C312BE64AEABAD77A5269253883D460DCB2F0A3B28700 +255BB96397D1D613A14C3368C9F27F3E42B887108793F4B12E2233E5A3620BC4 +F886F124503FE64421C1A40C37B25127094476713D39EB73004CB56E877935BF +BA0C7B095414A1FD59CA11573B86EA32E297BA38B907938B3A25992F0563022D +CF54FD863B8792EFB58A27DC2CA6C4DF48B9388F5676CD462C1AC745488F6BA4 +2B923427A7D29935417E010099FEB69B16BE5A2AF7B4883BBA80815A09693AD3 +2B78D3A939FF18798043F7C88A76BDD527B554BEBAEF922FDC9B381D72C7CD3C +49698A1444FC33E276D3B9263CAFA375F1E64C8B39C89D4A65FC42A7183E41F4 +1C3F0CF7EBBE5260F862EBBA059765497817B8597DECFCDDDA5C1D15AFD3C3D1 +6F1A8E43709540948B1E3B41E32AC13B469222867483B0E765FB427300AE9BB5 +4CED17DE5C45EC8391687036EF43D57835CFE689B99FA0B860E3FAA6471417AB +BD505F23013DBD726BB5645F3006BDAFFD5ED0CAA7428EAFB448E0A30F8B7858 +311E3FC16FAF9FAC5E86998E4954AC4C9E32FBE6E9DF280B457BE80DDA2959A4 +0A874282A7F9AE5236843298C26D5D4160A4554ADBD3EF0254C4F2D108D49DAD +E1D1B996D5147560D574FC238DD005D18CB32A6CD73C265F05E0AEA17C73E3F7 +2FAA00290D1A6361CF67EEAA68800D9212BB5B8F0259FC8D133A21E6BD375FF0 +4BB0FB1E78F065E51298E97164C1FF241336428932D1AB97E1D0ADEE93BA8903 +A8124A3169AE0B905465D7E8DF132D903C9B4C64074147F2BDB1F722BC261E10 +D366C246E8D664CB57A92883CD7174218655BA68D9919D0C8678DC4E7A7E66B5 +DD7DA4E011769991DA9D93311A06A623B680DDCA32B287104A1D7BBD05AA061E +019BE06684F9BF987FA635B9764DCEC3A3286340A7D50355663D5556103267CF +8CD9DDB4DAF109C47176A1E9443F3E2703788B85B6FDC8951783D08F02DF72AB +DB5F8739B2B9B38CC813796F48FCC21B0CFEBC8F074E464989AE5EDDEE5CC3EA +69C281CC4CC295360FC11F67AF3746CE3598A215FA109709A4B193BFEA270261 +8ACB9B7081A9D60CC49AB3F25B0B6F922672E58708BD707AF7DF35E32E7CB939 +CC25BE8392B3DF687FB67F25342671FA831264230CA39D189AB6267095B7CBE5 +09DDBFD5512A8831DFDCF53CDA45E3F0C097C0C4DA1F12589F7AB3D83178E9FB +2E9B5236ABD35A872EB9A37ED9545C6ADAF8FF2000E67AA8C8A8E61C9829F29C +5555FA19BF6949AE81487EBA68E8ACB6244ED2EE8CD537155B68BD1305FCE20D +710147B9AB3CCF6BBC0F2C3D8D77D783ADFA68B208829F05522211E28432729E +AE8A8C09C04174BAEF8D560D62733BBAF506D2EBA030AA77F18A38EA8E98B38B +C03B5A3C33A7B36EBFD1D55D503FC06F19056EEF9D1D01CE279D2BF23B04E880 +D6873E16AAA583ABBEF1EA8E5D6C3D038738573081E264C01DFBEEEF02B8844B +19BB8D27BAD7354AD310ED720DE2D4240F3106275AEF6F7ED61735D799306DB6 +4A3BECE20525769A0D99EB90D957297D5913CC48A98EEE84FEE5D02B30651CA3 +B7573DE50F1B9D8D50E5746394DA8C5BA5D71CF1647F80BC9337F00EC31476E3 +1019B41BD01DE7FD55886402565F688D1E09810DD8AF982032B048548D87AEBF +B20C6B938C6D8F96C2D7B42A1E69DBFE6AC28D166804E03AC698B180A48503D0 +0549D2DD2EBA5C601841A711DBE9D7019E5DE56CF78457F412E42CEEC248DC5A +C0F349903F745E40897D0331124749D0F9F9C71B704E4CB0898AC7120A880215 +236800020AC60B1E5682656534F3332C2DB06A7510AEA061D9206B4C033A80F8 +77DC8EAF7D32A7B791FA3930647CB1A29228DE62A9733C6AE072144BEFF15651 +791C8F99508DA1E3F8B451985DC68251044FEF9F91C7578A2F3956D97D544D3D +0E6A3F7719F9561B47D76612D833BDB64780728A6456E8CF273BB708FFFEF743 +CF069E55B1A871718E02778CA80A5D21597D597246C260AD390E5F4A285A5CCD +E55AE1C37589EE307C6D2E1DEFC605C9BC33511968CC8AA7E61F5390951087AC +F4376C5BC48DCB22D8F0CA6CABF25383616DADD012FAD655FF4198245209E305 +274D18A98D760203C8AB09F7204A967D07B75E7650BE0A0595742F821F74193D +CA0AF1A4875F50D1F3F2786C5532EA3913B3589215386E78157D6F38C4860698 +7DC51E51908A7AA304DF1233ABAE2B3C9B03F2496B320DCA5B7DE98FFBFD6FF6 +EFD2FFECDCEA32D0A7F799382366C6325B89C94B37CED9A1A1BC88602AC5D9BD +1BEDB8D5CD2D38FD1FA33703C41F979BC24F1609B3B35295CF756551F9F2D770 +ADC3D23C5B7C6A777CB33A06791EE8481BF577A94016A061D8AF8882466F7499 +E66E7E93F104E599C79CB6F76D42608B9BC1171A9AFAAD93E846008330DC3C0B +6E8BC7623E8693C1E7E8B5B8BC426B1EF8EE705D2E806486775BAC15660BDB75 +66BD708939D23762BFB8628A863C4F9978F83733049F63709066CD4203476CF4 +575DB5CA5B5F01D8E4DF345D78C2A938B5EEEE618507B2AC9EB9C4BC9B64CFBD +AECF052FA5D93B306C075AA8A645E5B93D1005C252F0DAB540243C7E3C3EE52C +0886A5D89A30DAAB4ED8F38ECE11217F0198347E62BDA7A1BEB6D46482BE3726 +33CFBB23A78756BA63741693D764467273078167DA48362985CCEA2889133C7F +A5B0BA827E92333BB02221F6757E4ACB8C2198BD7A976A29387CFB9B7F51C65C +2E151D1D1F73470B14587A6F11AAD77465975961CB77306E7793EDAC65EA7AD5 +E562F2673FBE78794C9D38659647EF5189F6ADD9B4250085A59F84C0448EE47A +A073B712B6B1CE984DDE3125960C16AC77098424004666BA6116A042551B48E7 +507FA464B21209D31C506D1DAFB628FC2AB30279E6148F3A2DFDD183FD770551 +0CD3FE854FD619E7D2B62A8888C300838E41744BA759EA4E4F19AD5CD249E8DF +74E81BFBFBEE42B2F67370B748B1B3FD5C6201866D8CFFF8D9ED127F43F4009A +CB5D9651587B54ACB8C6D410128362A74EB358437D0CEBB9E0FEA7FFC27A5509 +E799762B27F30B5FAA4ED3B492752B04702E48B1D0C55155157FD7B4E578A560 +5C0343A472546826E9B9B80E91867D2D4C3EEC02133BC338954AC6B58499AA9D +24CC3CBD2023E962D147618C08BBDDCDF36E91EC2D51D6DEB97A1477D8156707 +9C1B858385FBA45CF0FE74563A5D5A51ACCC3EFE991429A8CE57131AD56F352C +E95401BEE11B310C96E9C3CFACACA00114625BA7B4400FFBC5947574317E8699 +90BD8678107AAFFE1516A59027E9907359B61C6B8A97B4F99A338BEFDA2C25DC +D6413A0CAC46051E76BF732CFFCCD0FF1408DD26C76DFFB54F7745C79F3A7ED3 +1D9F8BED7C6977067E6C8E46EFEC63AE0D3953175A6E51DA38EFA2DEF475DD93 +1C34376F5C6C6218DF78EB84773361B9339FA58A88E96C646F291CEEF398D281 +E0DEB2EE21C3EDE0996427EDA0CA0A44247B1A0E03BD9366E75F763C9B1D2BD8 +00D2066BEF933DC6AB3586EEBD04E6D750A22978ABE902200200B468135B690F +B840BEAD5EF80E068F6F87442D93848684A127EA79F4A8A24DE737A373ECCA3B +B405847430C138E51DC18C367702E868CBAAEF6890FEE68A75C5781F32B96D86 +BF5A0C99F04DF2B7FE968B6566BD816C96D7EE35A863C0D4635047FF09F68302 +EF62B9293BBB8BADCFA64C6CD9024C4F739C8C730BD62F2B613C6E1923F04BD5 +62C556E3927411C2655045B9744C9DCB7F1DA9C1B5C70A145E9A35DACF1B68A8 +B5DAE1C62DF9220483F1DC721D559B87D7CD802AB539AF1BF3E434EBCB796A8E +378B1139CB3DD3134DE8F40C716BA87185D3E406E3C941D336A1436D891803E3 +D2C8E627204A343811FA82FD1A232FFD6915501C1B158E890C534CB94FCD9ABA +F64EAF649056C1198F0F58F56D3E1C91C167D4D9B4481D48A12CE297D5DCD0BB +8BE16BF18DE1D58F7D2587B70FF5734EF8391DC5F709BC39E729713CDCFC2EC4 +5E7AA863CBEE1CE8185E657E7FA6565EBD6868F478554E96FA808A708B48E463 +AACC817DF43EB9A5233606A402F3A83FCE99F73B8DD819A4D014FB435BA7F23D +F2AC40C473A34FEAF0A5DE457AB5A18A6CEEE95A55FF604AB5225C5C1DB6C6C7 +0C7647F075E5FD3CBA9F3B316887B4A01F1C2FE09719B4BD09A84C5A3DCB82BF +F5EE9FD0133F987FCF77098E0CB919CA7FB8468059FD35088B97705F180D5A19 +CDEFA29A02C5D3EC4893985A2478B0BE83B18FABD32654040A2F2A9BF7BB4F7B +5781D2A6B5E416BA14BDBB481B3D619B0C885CB392111E32B2AD6C8BA13E9F93 +49CC4B5A35B1F93B68A5ACCA4823DE44BA8979181E50A3804E43D6245488A15A +BD51999A729A20B9DE927F728E59312ABCF89176C35BDED4BEBEC14636B19989 +CB8BF2927C1BDF5460BBB09BA81FB83020BE4D4B69179C8E3B838D6763946166 +B328ED82B448CAB5EC2331CE7601EE8B39B334BCE11038B0EBD8437E5463C640 +73C5FACEA06A219AE83515674CEF03AA2F5FEACF656ADBAB944CBB237813CDC5 +06C303EA518CC59486410D65F5E5395DE84D0EBF8EA37633BECF5A08851B4758 +1BAE6460B2B67D29A8F88FBE52A26DE7A6E6D859CA00BF437837DC123C459B9E +43FB6DA6B79DC16C60F9035EE3B10E2CCEA9F7ED4FE29667E0559A3A34F6B550 +E4184ED8E953247B104DE7D912C5BF66F3259214FF091096DAD710C9F4EF531B +B4C6B3BFBB4715F3654587A5EAC63C917E100F37862B03EC240E762F2DF72CCC +9CBF233ED204EB966F6A34519C0A169EA6130D18CB8E53EE96B7A63C828CFB28 +45CDBBF7FD775137119B7C7BB2A665074691199B387ECF452A3DC5F859D4248F +3A02D4D65167A9E6C92E0A16D293ACE234C049D98E961D14D070DF2A7F55C232 +B2CBF0378ED83686DF80E05DD417153A3FB34A7B2F0DEFA69A34E19CBFF56D1F +14EB4CEFE99DE9CABC5F0FDDEDED79A50F29151294E2576CE97CA00F734702C7 +B94243299D8080957B7102AB370D5448226870CBB5DEA5A295D3D5C8F7D1B5C9 +44E6F16F703E4CD3F74B37AD19BB53635CC4801A317C953F2A131F82DBF39694 +FE552FC18B94EEFC490A579F263DCF470D2AF1336C166F0FC69D84800CB1765D +85937598431461E7B5DB95839BFA81D51ADE49E4242E2DEA4560DF41D27C7733 +2D1F036614FA1AB505537197F419E6722D4EBAF5DB087FCFF838E782D239BE68 +43AB130B26003747C36CFFE7A96CF8522F3F369E1E6443C923C4EF6616241DC2 +5366259FA9FB2559B5B797ECFA474D491E96F2CF07DFCB0765A1A7B0FA8EB181 +0A82708A93C8C8C2EC711CEB46D4A4D51ED42E6D023932F6C29F7E4D9735A5D5 +269481F9A92673E88970CD15DD2F532A2D96C48150C10854F3A98B200612EED5 +C2074848780E53C5E086AB78EBD0444A064C5377945680900997D1739E93EABB +520519269E2516C7757FFACF312E6725805BB2261552C760CB68A7BCDDA0438E +0BD4E6DD87C204039396684FDFC4398421E1D94B110F2831AC0DA589822357AD +A78CEF72FAB2EFCC848DE7C5486AC56D56DBD0BCB39D608F40E0981572B9FB0E +51F11778CDE7A9DCE029ACD63D61C22135CA5AC9DA490C29FF12165AE20F3127 +9D57AF7441F31659BDA2872A720100F3F63D9CBEB596FCC23FE1BDC7DAB26FD8 +00182A4EB8C9ED92B3BB9971AD01063CA67ABE06F51F66232545EA42AC145113 +1BB165ED65DCC3A1C0E288FED14706BD7FA08D3D4F143B8B3BA68BEABE09225D +2D0524B51E2D7ECDFAC0F8D66C7D96D885D0D87B7657F6134B3E7D0493E4BA5A +6DD7591027A957EF7E04AD08B10D93205A5F268E65B30242AD7D07C2EF59238F +F5B6FB46BAFB04D0E354072DD934FC5C63A4FD47541A4BA4B68E531E4614BEF5 +15AC43BEB87A1204B9BC873E9E79BAE958F4622077B7F7C2EBC0FFB7F7B6EA39 +C9D47152C26BC4A41188B367569A22762B8800E715416B7B396BB3B5ABC11A19 +C427DA9CC6EFAB2450C54030DC95A775422AF14156388FC0DB8901D3D13CB248 +B774DC8E8E36C7FEB216ECD93288F0520FDA6FCAC443C62347D680CFE38039F4 +1D15F56B06632BB1E91AA8E098EF73D8A054AF1A8E327BC6E7D37EF19166633D +1714371B2E916869E420A69BFC9AF4CCD3F1DA4569D3542AA43722748E5079E6 +EBDAD7306314586BB17C9C7FF0825D865AF14F0FB03EA08F5E2D22A97B9702A4 +8A169602A94B3F08ED7A0CF6B9288E35FD989F2D0020411EE777702C408920E2 +7A7F37E36734BA4937FEC3B14FB1FCC92BE0944C9D893929A63DEA8030DFD9BF +86C40A4E5421C663BEE7F2C29248B4839E441AD9D04F051AA0991A6D6EC47280 +10CEF96A41D329CB263A566A2D0C993FB918C6356C1249BC14BBE3B39596F7FE +DF719A7A9175B271E37F0C3B46B6F1A53ED40E6C3EA4313A7C90B65997EBD308 +E2F08EA3B7038E0694294BE05E9583BC74306255DE19846A692C0D0D64506C30 +F1E7B83EE2090F0B0C9A1DE01474DF9DC7D618193149E95DB2F6BD8C0DDE48C9 +625313BC0C265A6A4BF5FC9598EF8E16477DD19068CD1AB4C52777E9CBD2EF5F +99E28F5A2CE31E2924C196492A8E3319B1024C84CBD4FC175BE286F1F0829E3C +7628AA9FFFB1810C93336E3749A818E46206A3E415139064C9C7D004D0CEC1F1 +FAB611B672C0EB951AB9CEFE67BEB2817BE9248F887836DB614BD26A59CCA79F +04CA82700DDD8D792E89EA14D0B90FB3F8D6648090A39C99894C8CB638EADAEB +D9BC62555D36EBED36A39AD7601BCE938D26C84EB1A6302CA1111B0C362C7718 +3791067E2B506460D1BE71A13D02451036C4FAD7B917CC9CB347E8FC30EDE59E +8BF9874561A4B0E4235BBA799471EFBAAA64DC644958D1695526A86D56DAA3B6 +8AFA3A1AA7B66C840DDA7860072BF4C937B37FDA41922388FF8B4E3C305335BB +ED114714115CFE1385261C6EF0EC27CE200A0B2434BE519CF064FD5860CB7395 +C934A9D7B06DAA01F039DCF3318F393E22AA8CCEA80F58094F5129B06A5856C6 +9DB2EEB9B377135ACDD04876012CFCE0CAEFA831CDDE6B3ABF574573EB6D72D6 +F03D294CE59A42D5348781C90D1F0D8BDCF770E6989A939E3FD42A68D34E6B0E +A0AE88E2B52577B1BAA36EEA23071FCFB8FC4C41A8FCB9F8871F265D78B274B2 +D0D8F92D55011A124E037B5254162E7956465E96DC76D0CD96643AF172BD33A9 +DD48C30161EF717BA3AE6C7231F05DC4E330964C01F6BE6EE652AEE0AA41086A +B2FB3DEE6697965BF24EFDEB87D49BB4D617A10480CC29C978C953A0B826E470 +BC73AB39F4A8A94306CAC840DE844C60F650537E695C6323991AB9038DB838DC +0264EDB30E27E3F38B9073C8F7FAEEEF4B8285FDFEFF1C7CB16E43C712D78345 +813848FC335ACBA0768BCA0A9D57E99026CF04808F002FD842AF9DDD4E72BC61 +4997B2B39E28E971F60F8D96B66D8EB5911B8856287E3CC2D24D662312C238F3 +777745B73A30CF91BCAF4C6205808A2286285462580052DE31EC1EDB0BBDE46E +5DBA461A815EEDCA60F8D64F7A2A84613DEB4C4745EBD6C04DAE969BF4681B5A +F95ABFAFD2E9FB49A8504348551E67EB6EED4F87362FF9A5CC9BF06478E815E9 +EB946FBAC21430CF51569E331E0060BABFC7B21535D987B480FE1264A3738EB9 +F67197E54D9C2B032A06AAACD80FEEE298763DF5CFD00E2814F58A69A8643AB3 +3902057079A36C46D8ABE38C48ECCC6F7491D4D4A581A452C48CFC961DD8E85A +5929131DD9543262E81C96631C7FD7B94C724102DE9C365AD97D6ABAF44AEFEC +BFFCB5DB96D395117A665FD30A70E8090C3883FCF7ABE76954BFC07E4467E5D6 +262D9C949ADA532E94F9676D15DE90911D34BA384081A789D304584C688025BA +4F6EABB4ABBD427CD00FF823773B11F283241BAA9B9719808D7FC5E77FCFFFA4 +F95DAA339D4843AD99133A1DE37103F386B4092343814923FCC22A87D8A91F98 +3E72139EA419D61789C36D99A207600C188477278887467F15D6A6635BC18D38 +53FC280A6AF75015E003E2C80F312FC1D967203234583FF829FF13890D62FDAD +69DBF4D1AA69AB22A11A64662AFA11952042294C55F890EC1805936402B7C229 +F0A33C29453754544D92CB1E338AB7F3337BAFDC535CC93DCA0A049368B91FB7 +07670DEC8F84592CA1B4B8CF94E0D6A64A0DF9C0C239382D283AB166206B1893 +510E6320866A16450FBC2B0F82A38E460689EB07AD663A0785971D53E42EDD4A +4BA81BAECF10B93B346B20FBAA70E4D15AFEFBE7CCA040D982A92E7853D055E2 +065A09DEBCFA1B2ECAE26C38F8DBD378E976FF597397C27828EE0E6791B8641A +95CEAAEE1849027B06DA878994B70F94C835444F6B69A2DFBD6E4FECA5160C53 +7F12F395CBB410A6C92DFF74F8CDDAF64EFCF4F8ED9B832AD75E48B3F01DBFA8 +86D7ABCC22CA3C13603580C64B639948E2B74654FC8AF03B4F56BC8302645BB3 +B682950933DF6086F8641FEA62CC01F451312D22F4CC5804EDCDF981F6DEE997 +BB777110A8E8ACADFAF6428096108F535472D856AF4165C255A1B43342202F3B +A72C931CD8A966D1898B78B12B14DBC0D3663983A9E2153CBC23184A4FDA6A0F +779AF83DB6FA36FF6258473B17FB452EA4AB02F0D34C0B8C8E1FBBB35B680D94 +0201AB0D0F0637DDE7031FDD239BCD083FF5A28AC9AAB7271D9179A8AE589B26 +A897659AA8E9CA50ADCECF5D5F4D21C7142D4A85678466CBF033D883ADF819FD +CD27E3A6046F3EAEF987DD9171440DE702ECFD3AA51C12AEAB971FB8E3128291 +592A3619A00A4DDE933F960CF460C31AB712D12AE4A37357E42CAA235672926B +00FF510B7686F013ED7841FD01805D2496293CC262F80E730D2FB94EF320314B +2E9BFC65A17A0BCC2233F53ACCC3ADFFAE00F19277AFABBBE4D2E377BE54EC2D +82038A9D3A35D7B13744E468A1AB3D0231D394EBEFF06BC1D52F18430F7F77E8 +DB47FE2A958D86452CB7FB6FAB65198AC7507BAC92FF4F46B97A265BB80E99EE +B2211B9989BBF73B1753B4BD6730271DB7679FAF4D3B223839094C1C980C15D3 +2C9E74DC9DCE7CE0D48B1E2A8E2E3DEBE2DCF6FF7B8407FA88F59A8D572E818F +0C6AEF5B4A99F83398F97B162429D82A62E2377361853F630E7D0A7D728DFEC6 +EE39A9DAD89967BF1579C57AB99CD78DE820C407CAE52C2D7E65C97A594FCE3D +378AC8FF6F8867E8953FBE91D2D8131AF97821F28D6EAA5A9F025DF790FA0967 +2C0A1339E953EEE5FC75F76FEEEE780F332A1C0C08DD80EEF52F1CB7E02DFE52 +86F148A998753B27CB823FA9B4907B37007A5FDB8395AB3FEE7CCD947D1F6CFE +E81CD88BC9690E2F89F7CB130C9A2834F938B3D562A42CEFDC45A38E6BF62ADA +1517974E61F6D35267795C7A9E945856824329B14E70EB350C997756A8FC0A8F +7CBABC48C4AAF0A5D6A8F58AC190AC3F980C00D93FEFF1539D417AF2DFBE1021 +2882782C625D2BD323B9E0D53F1494F8CEF84ABEE30CA90C251887075A697386 +89F38001C3B2FDA9991D9A5EDA186C37DFBD0A77D47E24204981DC0A45B3AC66 +DD14D43A8A9826A0BBD96FE2279638F5AF12F010474075C381BE0243E3217199 +ABF00214D7D13F66411A6AB4FDBFDDF295163DEF72E788302F63FA8225F08ECE +1F32D71BDBCC1ECBBC067187C9713C686E3EDF304BD3C58981C76B6943E66F34 +2BE57CB3145FE9A286F570074DC259CDAB2A415DCFDCAF46FA3E195FD43C38F5 +A612D653E3F178E16D9FCCB637CAC9AFEA648AF52B945B9BFE37F241DF9DDD61 +5425B37F903B079F337E8E15B70CCDB8920F15AF89538608A573E7C9008BE814 +FFAD305F0B94C7AE5F3DB35D34C04C1A250E89C252759581AD933896B468547F +BF0AFC136FEC40C7436120A944979C9DB4D492A52B0FD658E8083E0EACBC60DE +67DCC01E3F87F04754223A34732D211B43248A5A5BDB19992CAF481A564DC9DE +B16CABD3BBF40BB4F84D67015773F7261FB175806DBA97597A0A8AF8920596A1 +3C77C728F23CDA310161CC8573ADE490419AE08CEB622DB6883CF0B75D43F0B8 +B37715EB9AFD9CBA33DEC10BD2D78E541499738D77A6450B93B795EBAD5F44C7 +311134D264B1881069ED3422281C15D1822DE565FF7768B80B58096D5B03D168 +0158B52A52B7B5B94609793DB02F8EA785A2E0A039FE4F8CBA3CD0C2A934F2D0 +A2F862F75093FFB2743748EAE9947B5D9F56CA0D67ABCC01E4432BE67E22DE05 +39664D8D7E9D732A897F03DF889A0D3C09E60C4F3A3996AED7293B8743353739 +DE1D41C5FEDC2BBF6662BFC35660CF8EA4F2C0DA06AE90AE91A9E0A8BC94D43A +B79F3778BB68BB937032EE09062E1C4611EF8E86CB7007F2AA7DD3E46A31AC00 +8CC36771023DE9E9BB5483C051FFEF412A14A65F30DF95C91990408BBB8A1E6E +FE801BA15666D3C270F045A8178BE9E424998653471706D0D86D49967771961C +3F62F1B6F36652DE97526AD89E748221893C9B6E5915C1504FF46B6CD09D85F5 +57F881284D70C35BEA64731C99C0D865E2E9C9FFBD50806164157CE198DF009F +B560FA76FD75CF742308B01F8ABF13E7F9DF82298FE454C1F709387B6F23C306 +61FD8651CA2F51C5F28786D6766B4339928115601BB265F6895712C39D4EB75E +1E1EBE9BD2E808299CAD5092397B7AFC8B386E992AF8A47FB618101925514570 +2CF7F3D9418ECDF120DE0D9B14BA35A19312BB4C87C9A1862E7AC946AAF7E0DB +9126282D6813095178325D6F7510550788D387CC3F7936E5BDFC55543FC2AD73 +0A47BF75CB6B625FE8F087C3E53330DA3EDA69BEB3601FE3223BF111C6235FC6 +8ACA71E69693779A68F93DB849000C3915225B007E9F1A64211A66634F67247D +CB39A389107705AD40B0EE4D1E1AFB6B6F6E7F1D59D12847F748BAA026367172 +61FB9E0FF8EAD4609047340623E92C4954683F777B761B09A1B6E06E13977B66 +B7D5B557C9E0682A0E4EB4B04EC5191E68ED14DB179A9E167389023CEBD2F046 +05B7B10F352B91FBC1D499BC63A8B63A782692732DD2C49C0532E0D98BF9B5B9 +F1EDF5A5E00EA42DF50F9FF5700FA06DE26B5EFDBD15375BFB87068ABFD6101E +4DCFB11A4F6CE0A126B1AF08A0DD21B487FCE447DB919FB215BF614D5027E67C +CBDD8B631B0755EF9B2F6E261D4EE7D892285D1579F3027F9B04BCB1DB28A8E3 +BB0E83592AB3BF25CB92A3BA038A91C5854402DD5C47E1F535750D1090DEE1BB +A5AB0785C67806FE7A4D1C7DA3A8D40E5F8EECD2DB7F5221ECC3AAE50BC607A5 +6B91C718E2092102B2958EEE11B3FAA96868D425513142D1C374886E63A705EE +6D996AE31AC5F89456AD296DD490CA6E63BA98B78E4E9FC2AB540F27D47BAA6D +C8BA9D2F10FB380F3C37575FDCAFC69F42E83301FCFA1DC31DEE29087614B306 +F158970D92374D7435EF08EFB3B32BECBC3C6C9FBD42951801B86C715A7FB306 +65B90CFF9FDE5AA20F20BC8DA696E5FE7214E98F39D2EE60185F926027A6CD5B +960579744D143C1A7BC8BDF10C70003858B2A6EE72F854CD35ECCEC8E92BD664 +F9734FEBD981C41DAA2A42AE83697E3B030C9E2C6C3969293D324A7D68274044 +487004C3F6FAC5B64BA149DF711EDF2F17881864AEDE3E1E4C3147BB3DDB4ED0 +2F79305B402E76F974CD56CB04A4B562DFF36B40DBED2F35D38DBCA5CE8DDD12 +70C28A19C891D126927DAAECF16B2DF41802882956716BDBB442E9F062DAF65F +6E3808CF58F9A4912209644195F04B4A5B209314017E96A700903AF6F4A8E8EA +6CE36F67EA9139F816CC75A806C3585BBFD882F14028770670FEA22F34358E0D +CD9626705BEDEB3A0965697647220C1962FCE67D0D3E2B9FC5DA3C3861F84209 +C56B90CC792B95076CD73D35974433DF6567FCE72A24162B434208A79117055E +53BE3CDCA527E33638F940BED805EE57A3526186F80ADC5B6ACAEE25E2081A63 +3E6D985A8A6256F923B971E34BDA04D21EA99D34095AB201BF44B62258B19ECC +45149754F896F64FBBBA939E41A11082C307165C5EA32F7C8CDEB80851B5219B +7A680F7A8D02C9BAB72FE3B941E324F554E34F5DD5E4936250A82DB846F5966B +779F29A9A4E53BCEA49CB4C6CC7D0034515E9F7B357B6AFC0FCC6FCDA1A34B5B +103062647367EB77762F6B47773264536E40536C5DB2985C3048969F9D6C698A +EEB959112EC964BDB8DC3C6F307477C2615BB536C03E9C9B346A7916D1C69C0E +116DD955FEE0B8F6A0B476DDF245B7C901473A96C2C53DFB5BF4833F984F4D42 +C06B6751BFA6D96E9493139AEE7BE7839B8CB2290735C80542C40D266283CF68 +4DE60FABB54F29A930357CD2AAA60F5E85D1E674610F2E7C280401061AD47B55 +5A1EA0B0196423DD4DC994CD41094818332B99FC9218B2D628E86983DBC5B842 +AEDB7362D479C940452A947973C8BCCD46588808F0F9FFC55EF2D75C1C075BF7 +FE6C21DF51E5F6B00D807B033ACD1C7C6A8B3CCB7332E5ADC93433422095C0C3 +8CBDC619DC8EAC0382428C88443B16ED0DF49CD042D38082CDA4DFB035CE50C3 +9271344F46D3765ACA3E1B2942215F559EF1E308DBC2AF0659DC980F5DCEC6DA +B33D596CB3F26EDD5A11D6647DB7AC5AC4FD41B62BC353356CD12DA5FC6EC2ED +86DB312ED5C8323E1C766A0108ECE43C11D2BA0A63F1BE2B0A9D40EB995647C1 +82D5C9FC55169F50121ECA94D1953CFBF9F38B1FE0C7DD8B786902A841F24A23 +B8762B929FB5AF021414A5321C7288BCA19A240EE15D106043DA19354C4EE1B2 +434A967968C29B9125BE84A907D22B0BC2A2CD09AED00F3CC3C5C7C9AE7C906A +7050756D4E67E11F2F2C14DE59A92C013849CAD0A1B6CD32C0CEAD2A4B20AD3E +ACF8CE2AA125F1EE154B79690659E1B90563E3884B47699AE1F7A71579C3C4CD +B66E6FA9BF98769452C5A2BD8B54112351F05BB77D3D3E3EE9250953BBA94EC9 +C0DAF20B0606C3CFCE4815A876F9CAB8A9A2E5662F7764050A0F5A7852B9AE4B +5799C95B8718D481452AB4262A843E01CCE943DBB8377B7052FB397600962A01 +25E5FA112149DF197FD9C8F16BE5819096B87CB3555969026B8A5F4FCDBF3171 +BB1D5F36E7CF89D94457F4CFFFECFD8BB3E009655D799C4F262FBEF937E5107A +511677585FE4D4560C34F03183E6293EC2BDECF5DB400CD1A29BA1678083CBDF +EAFE8D078B72B42BC1CEF9FB5FAB5B2EAA044F5E98D99D9B907A3FE4E1BD4E0A +2B845C58D7D0119C323AAC85463968D97A651A087DF3B6866EE0D09BA5583D8A +8DB9837B487DF5FA27624BE3C7F17E6C734D294A1D200D971EAECF983A0A2378 +BC2FF6B206A5121EC01229C14E0C22CFE7371AE1007ED8F556B54347ED545D05 +EB488D7DBD5F668F45986703122FFF97A19523731B7D3CDFF8FE45ECCF2B91A2 +0907AB03E8698E0E3F6D846A4417B9F66703DEC16AB8DE158431D3424BF6462A +70085CD88F8BD3DF2023F0738FA6E3F36E752DBE7590F6BBFE1BA8092CB69B54 +BA30D871F6200BB9CEAAD3D6A5AD721FD4A48D002BDFD8E339483D6E32ABE379 +914BE6B673F6FF3CC20BB2A971184433A714E802CBAFE2C85DD5F0E29B5F9459 +16AFA7D594B373139006786FB5B8594D50C91217D49ECE8E684C292946D79658 +A9BC010ACED5F757796BB9C32F98409ECA6511351E340C2C9E3CE2AC1007A52E +95E6DA9F56E11D4B0586F88A149FA8A2BE78DD25F89BF504A99140A7453E4C3B +EC9F94B300E4F6AB24C4528E029DBC0C61E116BDA8F0AE3108E3269A76927509 +95B41AAF17DB3759D04E9F0E7CA4863A9A771A49293B1EE6CB38E33A125342D0 +6C63AB27F308D08F60F4DEB8C0A335B115D25683F8AFF549598A3B1E88BBCBFB +7C418723054B346E748DB987ADF0EB40FD0B8FAAFE5871EDDF9D68821C8C9643 +7A3EF4FD3BDE591022C83EECE829BE8189C6D819708103BB96A29CD107F416FE +3230C3E7E358722AFD9469FFF2C7FD9DEC35BE527B99BAFF00C799B99080BE0E +C88272197BFDEE472E29D1A197083F1BF10324E834C9D76190223E095487AB37 +50BB4FC92179754DD1138F9A55269137543FDE3173BB57BF3E5A2C42F5C58536 +BF4FE748D9033B0E319E3061A7044883A795BFF107E9C12F2449197FD29A2BD4 +C5B7DBC42C28596D43CA57E4184250213D3EE5D447A0D8023E2BDCA6B095DAB2 +3094B07797FA4AD49A4BC874F462D46F9DB4A21773BA0181B3482CF9235D9C78 +B967B280FF82EF3938F51211D5822F527127A5B4D7D643A443581EC8599C62A9 +A91D57B358D8787A39DFC4AD363869F6002E1EE878EC3573521ABBA11B6FAA80 +2F73E889DE675B42463A8488C72AF383482D6509F49786ADA521F76D93C4A91B +7A5B23417305F5F89FB34261C2FF16B3BF983B19DBAB9BB6B1A2EBA3C2AF80C7 +450248EFADA22E1F8D18CBEE599C8D210498432C47CA067449143710A73DA7C1 +38C859665D0D88FF0E4ACB573E954655B5DD4B8C7DBE9B8A3B2C4526872CEB80 +45CB40C3D53F89ACEF33BF54BA05439AB4137D9F6A5F7CC983CC0344216AEE0E +2BCED1790BF4506A8908E1D7AC441366E9938551A962C6AF4BF5E2E6B706CB0D +8572EC4AC8CA0714A5EF6D4861932F42509F217477AC1547A3F96CCD15787A6B +B7DFFA17B0F44E83A08486E779A1E36B7748B17F2D09FE6D7717E1CD3E306004 +F69F2EE47DD0A9FEDA1D43558C8217FC810C109B8E55446B6F151D44C08FC996 +63530C24C7F0B8A59AE9FB7ECD212902BD8E4115A6F6411266A57CA3F7532E2F +C631F18FAAEE1F1B7224B598AC585A4279155501B1BE29E06893A8C56DE80D66 +4D5586C74C54B88D1B61602D44CAC618E21F447A3A17123F9032AE7B7854C08E +E63B5335540A7F4B36DCD11A47FC8E672E8EDBD9BE813702927FA8B0E0715943 +E1AD81AFDA2350A8D9C05295A208EAB36592672ED05E16C4D9392B3CDC1EAC2C +526F600BACC7C2F6E0AD1283259B1388E83880DF85DC9790DCED3EE2CB06245C +3FA795567CF8F6E63059D974D5E2DA8B5262CBEAE15984ED2D6FBE0C5580CD20 +05640AC7C4D28C5692D3F814A1A90A7BA2633A68A7A9752AE74761AD428B19DB +79133438C8E0CACA1624A5780A14DF07A74003E6EF75F75662EF6E817223BACB +0B0B47C05B22016F6EC2E518EA8AF4DA0BDC4B02EBBA5D746CCD8F698E5F25CC +47184CA13E1670BC214C44C27A70CE6DFBFA31B6C82B015C1A4F64F2C767960D +E2E40BC61F84B19C6F874381488053602966F43AE5058C0FAD7FCD563D01DC11 +09C7252BD1FC94D7975F72047395F685A7FABA083130F64B8DEA9029F14C6AC6 +874B97B05248E3D6A435711263526F395BA49D30A21D4AE548141E399FBAB5B1 +6EE081015FE3C5663CCC484B8B4183EFB92E69EFFDD7F01F518569E03A72C4FB +6772A0644FA922FC56B0B99B1F35832A11D929CAEC8280793D062109E3BC57B9 +43E01331FCA8548A573FEB914F916BE1D06D2561296972C28F6AB92BD7C739FB +B1D5251FC46E2ACA742585DA6C13ABF373F66B51B45B44DB1471220A3C5AC33D +B1CBEA5B541B8C1AAEE38ED30735CB1C12D02DF0F6770979AE08BA566887CFF7 +54C4AF9ACC382793D4BF251D09A088691EDF51E72BD9BF9F2455A8380D40723B +1D90B78C210ED9972BA6BEAD25A7B240219C012E3757353802DA6183C365F51D +D94C2C57373A44EC5C422D3959C140BD87F1271405B33BB9747A78E5460A96DE +2C1E98D4B4FD3A15E10989FAFBBA5C57644D6206CDB81493667B3E4FD684F3F5 +8FAEC6F36B47625DAC46AF37D9A04536EB5D64B84D17FA194BA862BADF76E107 +548B078BD5DEAFEC764E789E6CC8E78039801CC4716FFF5E7857B0FA3BC31CA7 +E1AB37C519A9EFC58DD1D3926226A3AB147EEDF10D63CBCDAF2DE66E4356711D +EFB9601764562A81D21D943A01AAA3D814DA167531C164BDE763F6E3D619FE40 +4705A2A03672929945500B4D11F01ECB2B09CED1927029D49A9ABC19B23463EB +0FAB85297CE11F97C1D560C5CFD27691E39FAAA95B468A502988BA484664EF88 +2630187E829EAFC67146942DAFE5DD566A72FD6BF32B33F27B383ABF99F9E438 +C30F7CF8513F209A6B4E76F16BEA603005E8F71C817BA98D25B415B930988A1D +4EFC4CC7BA7801869D53863261CCAF234BBC398FFC8D7F736F231E77DC9C0EA3 +1AA359D0A1962649825F59DBBA3B5975D70B2D6FBEE024FEBB2908E47858568D +4BF000D59D21F549FBC46726878B0123BC5F2450F60B092AB46065DDC9BB7D41 +8E3CDB9982369E2CED9B88B58D47A94A108324E6BC009395CB656230FD9C5EC3 +8631D1F70F5B29CBABA91706687A4EC238AADFD7BC3B43166134AC044E72007B +8BB28A578560F256B2C9F818D948CD3CB57E351BA8F34834C164F3AF6F544B64 +0DA5FF8D23E70669BE37DDD66EDD81132EE4AC92607D6309C5CDFC6D800FA012 +BEDEF9E53F5F3DE3B0955FF6D7F6AFAF7C5026F2B989F8103E4FD2E39176E5C7 +A50333B89EC266B1C39E2534EA4AB75B62B90962065D26D8958DE43A879FB0A6 +316D86559080C6048BF798AAB878E578673FF67A92741F60CADD40265C658184 +A42E9B85997CC8BB4696F50CB08AA5F0F1A658041F6C32A0859B99E9B41A0141 +E9EC90FDA5A358995A7FE0F8E7D5B74F1CEE7C6EE8272B35BD242B5219AC103B +CDD20FB4F83F7BC30E2D0DC150B036CEB93C92908D53C6FD6D2D5BE1A1EB1596 +CD9374A4F388507EB1624048C79366F13C1319E410B9EEF4F33C5BC5BA7392CE +852B8F2F649AF0781AD969BA91CE623BAAE3A45626D4A6D98F210C30C60DFB30 +72C19559C54ECD9FBE406551B0B3C8B1833A8834E1BFECD87A20D90B25F4859A +3A7A21054BD82BD20A3E2112F447ADAD7BDE83EE87ED04683DAB283627AEC13E +450DA15C25855BC4ADA345C1D92CB5880AD4466DDA84568FF703A824A8EE8E29 +F0E221661D6BCF20BF046F80C044A860A2925E96063CCE02D044DAA35923E5FF +6DAEFA7845ECDA7EB4D3145F0436EB4850AB3A65120C32BD2AFAFF65518A7529 +AF8B2E8F5DB78B7F789ED6144D3EE5588A64DC1709E64C69B3907A8B4872AAC2 +896172C0119889060CFC265751C8A781208282157BA8F925BFDFE72E4AE0BB4C +D472F838F9FD40E229A3B36F18D96C99FE8D88CA44BD2702C5723D7BD75CA5E7 +E606909DC6EF9550DC7866C54E6F08F6993E6AC0E78CA0FDB60DB16AFE9149D9 +CE9E29E6461C1FDCAC59B0CA7814F7CB663BD335998F2B946407D92791AB32CA +BC3FAF02A19178205981B654FBC761D3316337936BB9C02F4435E9FF33A93228 +CDCB3DBD347E15779CEB58473E78A5AF2F234F2FF350FF5F2589FD2A3F38EA2A +0411507AE1ED51B550AD45D561344D3A6470C9449E25522F261E9F861A87F272 +250144D4A7FF42EFE2F53F262B4D50A9296958A5FCCAB2A72192C87AA4D7163E +F5C23005FB2BFDDBB7696A39A987822C4D71A1BCFFF58FCE32435CE6580DC9FF +F02B40A04772837D1C090B31D98E73E79D6E63D973AF32C762643D50575E99B2 +D2944583F89A5C23DB7BC78F34E2A23079DFE9CE9E9AD70C5EA9AC910B721861 +9CD2CF56C2E9F92311D2F4319C4E55411BCE3D593188E4324A653B730C2435DA +3D2839B68C3919AF4DFE343C1F1BE951985F50F264253552CC514B6962EA363D +CA92F7AFF2A2F64B14194F69137D3EE3E4854B0BE9E9D9400EF10A9F1B40A01F +0AB88A7542A3F40A29B012ACD52C644EBE181CD24FBAA9A2687A182BDC142695 +6013E51C2A8E561A067760B4696EC55E2DF1D6A04CEE65E74A11F712BCB2F8A6 +9994358EC86660EC04F7DA6C7A133CAB415B034B567F36DC71EDD3DEF8F0802D +437DC1488532EDEC290E147FC9279F4821F0EA2F5BA6E2A43B64CAF0B1942F33 +215C18ED620C928F1EA7D0452613927FE3A78377C01542FBA8A397D0C6D6D26B +AEE8F0A3C15AE5CC927CA38E4C0CD2AB9C71B6780E5EE878523177130C291C70 +75D865FD73B3A875F450331C332ED0205F74355A07C528AA047568789CE16005 +A3CDB32578707DFABCA888B476BDB2FBC69425F9157AE29C0E807B4D996DA7E0 +75C8F714F2EF2803C456E2EE318F6111C286CC7305D2C1E270643BAD7587DC7D +4030E32069D4CB84C8F07D0DF1E492E4F4C9AC6C71ADC174925CECA25FE6878C +4C2BD2D4E3A3CFF16E0FCD8C308B759C2A4FEEDF484BEB0F5BB9B7895DC641D2 +922631FD2E23257128523B31B369AEC4D3A63E3AB3DBE2F649BA1C2E4BB4F8FA +7CC579D3C6FBF2B045EAEC3E5522802DF1E107179B98CDB9F0A9D400CC5DC89C +561A93455644ECF841E34C28FD690062504AEF2D5E09E9E84230E93B56B741D1 +1AC88BDB4E77B90D49DAFF1333758F9E72CC153F4F1823407E9EA929067E180B +989D5B459D867D3B242CECABDA3439BA08BE3F96155B62E3323FFD874DB7897B +CC139739546D83739C5C1665F6CCD89F74CB7C07138891E23DACABD4B67AD04A +1DA2D547378B8E77D1D6CF3A89295BC499F383FEE55EA8359544EF60ACF1F750 +1C607FFAA1AA10A361DDDE23B2858E77C71F0FD2D47ECDE5E77CEE1DA878A8B1 +40211679D7691011B81246ACFF2B487F106FEFF52E79B7B7B05442D846FA7381 +98E1EE04940FD3446A516B47C815943870C9CA9C1B1BDA2894AD89DEA6E1B96E +60C94BE49C89A0FC4B009AEAA8B9E658798B79AB404EB06515D23D0C83465473 +4833AFB6B56761858EDBC5E125891D58DE477CD512943AEFCFCCA741D39CFA02 +E0CBD9045ED5FAF2580C39A1102196A85E1CBC67A1C56A7CDFA12BE2AD351D9F +37D4783CD6A8B0EA717B5FE28D7B39000712E37E622A821D040AC927726402E3 +63345131FE928E3147B83D619DA8F212E144B19EDA829C7F6CBDE636F76ABEB7 +82658AE7276C2F8BEFD02188598DC592E05666984DA2BC8C9F3549E96DF45D44 +9FC713AF972127020E99F95AF3904EAA898F4B67D19BA296AA36FBC14C4DC5AB +C88DCCE567002214C7518098D015FA37AF02BEA5D9F5845FE3FF9037C15EBC79 +4CDCB7D79129ACBFD2573A884EDEAF3939E2D3D6967F1A0117A0DC6C8597FD47 +01813A0B01D60D7709BC55D5DDFCB08F53B441D7EEC6544FF96638CF1ED431EC +794A0E716F63233C0D80E8B4123F30E632AD427857EF57A6CF6A106F5382EF74 +F9088615AF05E3362609E86DC9CB58CD2F709F8196FB61FB4F82F9B1F0792B09 +D6AD2F194A9353F60EDE331B84B7704F0C797415FAC6F5DBD56D39B44A45D1DE +B6A2319784AF1B2A9573DB75B573926AFC074627FAA9E8B4BF773A802896CC96 +65B535DDA172851A2F052934E7D7D593D3E2644444F7C635179D00536099420E +CC56526A9FBCA1B2DDFC48D479DD9A928197AE138735926D72737FE8EF7D1B21 +6425B94AF20B5EE8BC00FD87705DB8DF11ADF16715177FE917C2AAE6DC1CE5EC +EBFA2BBC044398B8F85DF05D50BA8A53E97F44D6CCE9690F901A50B844416408 +91F0DA30C55BC25008122D9A08EE92A8C84F6CEACF40591E4320A114E2B62F15 +92971E5DD0613D6D323245F1DE0C5397802E88C79D9C8C7719F4A13902828BDB +34D6E8D8B68BEEF5A4AB6A4DFCD93AF6ACE8C60A16A593474CB17982F611D6B1 +3294A28699B8E8E73C27C68910AB90B2CC147944323A5F339A5844B674AD75EE +7BA8094D3BFA4FBE6D1EFBBF7603607E38B920BF9CE43E418452E4D61A6D28C1 +F91CC04699210332A1555931106ECB43AC1FE2D08882F0E9180E5924C0335693 +AA13697E9F7F1091D71360D373661CBAA631992B3B2627DA5340DC655F712572 +FD675340127A1CBEFE3656AB4009BCD1BAE64048275146C32E79F031EEC428A2 +0B786601B1B44D5BF9E464CAF224E5636B0D2D83EF07E81A545EE9A5F9A531D2 +064EC94A90714E13760440450A6ACF3DD244C32A9ED0A65C546BA46C27FD7801 +C94F5C0735A1E9E6934D30AD680799FB3A761896C9E1F1BC0422CEEDDE021770 +1837B9A79B0F8775340CE0C2A18E260F6C471E98A3C6E4AC73A148CAB6EFAB3C +E50F14240785645FEE335349C9B8D59B99FD884EA4A1C878A5AB6934511DA544 +7D009675FD5B62F999ED528C3B70D337A7D93D4D14522D1270B5C345B5ADE5ED +518AB80590221630B0E66A85B1DC67A6CDC6B3694F8EE53BF90223FD68ACF7D9 +A4106D543E16EA756EC3CF9C96FAD7E45A8966B8BBBD5B1E5E9509F2DDA57EC1 +AB2B457D495F9C8452376C11C649FE4015844D876967666AF9824AE5E3ED033C +D3DE8808897B223FB36CC42BF7867775B8B97610CAD61760B48C7F3F2DE23908 +035EA9A89551B4AC734DEFF55D121AA9D365BFE4C621AC78344A11360E042213 +EE8F7EB0EEC8BEC6C9294D22467B5D6DB1A0B0E03F371E1AE162C5DD46DD127F +F8F75142EA07F5F5E3B4848E9F4B884F0257D4FCBA87797839A716CAAF03EE52 +FF4479EB9FA912146C609AD0784C7EBC41CD480FB7B3CBA7D5BB91BEBA43B5BC +AA5E4A9CEDB68B34B4EF7A15AE58EEBD677D7D2ACB6570A569F79AA9F8C08334 +2575F0AD37AD980DECA14BD61D6D0F38DA4C8F5E4350778BE866AB63AA8260F0 +3D9105FD3738B1C5417EBC9BE27027718016DAB611E3D06529A5F9C2C0A05371 +3A7B87144805AE4E317F26B518FAC096F5A9BAA8EA45D77BE19CDD1E352FC955 +1ADDD93B080C6E95DE94CE3CC6AE60E797B09EB9FF1EA0B5C60822953F8612A5 +93923E7D7FA07A86AD52B23D3D0B88630B88D6E8C62D009DEF41CC7D95EAC8EB +B26AC8E3DCF0929016378EC4841E1C4F951059105BB7F4D9D827ABA155102A09 +0242EDC57D050CBB9A0B6C5302B1534EC041093CF0C05C0E30F0B3513F3F5356 +75E913640AE066B795197E009D880CF19ED6C92FBE4D9CD3C96C88A59F2097E3 +D9F0F923CF7537FC69D5C714DA5E53CBEF307D8BA7FEB8CAF2DC63B9B07D4556 +CF751C7AA7CB1268BEE3591838C5DA625BDD22B4748A2118B7073C7AC7A885A1 +4996A7900CE4F42B19383E12F0BFBF0862E3A539F952038E1149B57D3B92DD18 +FC33B2AEFF202D53D5212300869B57A104AD5640DDE1A5E3F1240482EA9CC7DD +A63BE8B6DB82A2FBB5DFD31E72A6CED413ABA65C6DD3674A76E547A4CC9C1C5A +504992A649C7F2AC469A9BCA5E9C84333AA74C686A863A05FB73110E466A34C1 +3E3AE5E21B912282BEDAE14864E420B05F9E2EE8B1C523B362A4237929BF2D06 +A0D398D91ADCFD021113D4489736B4D8E703D77F2BB92973874EE461E76ECFE3 +D114EEB3F611531FF20CE6310C338C6C426F2CDE535C69E3F14CBFE16F48C7E7 +7420777D9A175710174DD5E23B2BA6FFEC521907939AD66488857BE8021B385B +D6E1162BFD8BB36174E0D5C238BFD778BA5817BF31B2624429080A5B93AC98E3 +B6C5E9C792F9B1CBA7BBDF63277A28B6891DDCD36D0CF656C4F510C77AA08991 +0545717C76D2289D77C79DB34F2FF22E29AFB3F5E9B6313A2F582E4DDD2373CE +6064843D24FBC35B1A08AAD4A9B408541301166DBE585317FF2A8E15C25DA94F +5A5B9D11F5F0B1A658648C529717151A96623F590FD41908A5CA20CDC0D75D84 +6DBFD25E5D4739177AF9 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +{restore}if +%%EndFont +%%BeginFont: CMCSC10 +%!PS-AdobeFont-1.0: CMCSC10 003.002 +%%Title: CMCSC10 +%Version: 003.002 +%%CreationDate: Mon Jul 13 16:17:00 2009 +%%Creator: David M. Jones +%Copyright: Copyright (c) 1997, 2009 American Mathematical Society +%Copyright: (), with Reserved Font Name CMCSC10. +% This Font Software is licensed under the SIL Open Font License, Version 1.1. +% This license is in the accompanying file OFL.txt, and is also +% available with a FAQ at: http://scripts.sil.org/OFL. +%%EndComments +FontDirectory/CMCSC10 known{/CMCSC10 findfont dup/UniqueID known{dup +/UniqueID get 5087402 eq exch/FontType get 1 eq and}{pop false}ifelse +{save true}{false}ifelse}{false}ifelse +11 dict begin +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0 ]readonly def +/FontName /CMCSC10 def +/FontBBox {14 -250 1077 750 }readonly def +/UniqueID 5087402 def +/PaintType 0 def +/FontInfo 10 dict dup begin +/version (003.002) readonly def +/Notice (Copyright \050c\051 1997, 2009 American Mathematical Society \050\051, with Reserved Font Name CMCSC10.) readonly def +/FullName (CMCSC10) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle 0 def +/isFixedPitch false def +/UnderlinePosition -100 def +/UnderlineThickness 50 def +/ascent 750 def +end readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 45 /hyphen put +dup 47 /slash put +dup 50 /two put +dup 97 /a put +dup 98 /b put +dup 99 /c put +dup 100 /d put +dup 101 /e put +dup 102 /f put +dup 103 /g put +dup 105 /i put +dup 108 /l put +dup 109 /m put +dup 110 /n put +dup 111 /o put +dup 112 /p put +dup 114 /r put +dup 115 /s put +dup 117 /u put +dup 120 /x put +readonly def +currentdict end +currentfile eexec +D9D66F633B846AB284BCF8B0411B772DE5CE3C05EF98F858322DCEA45E0874C5 +45D25FE192539D9CDA4BAA46D9C431465E6ABF4E4271F89EDED7F37BE4B31FB4 +7934F62D1F46E8671F6290D6FFF601D4937BF71C22D60FB800A15796421E3AA7 +72C500501D8B10C0093F6467C553250F7C27B2C3D893772614A846374A85BC4E +BEC0B0A89C4C161C3956ECE25274B962C854E535F418279FE26D8F83E38C5C89 +974E9A224B3CBEF90A9277AF10E0C7CAC8DC11C41DC18B814A7682E5F0248674 +11453BC81C443407AF41AF8A831A85A700CFC65E2181BB89566A9BDEC70EB4F2 +048A6EB631F05C014D372103E37FC3FA317EBC9973565A638403DA02E48B7D31 +CFF6C241DC5CDB470561002FF46437C06EF93BC99352DF04393C661FFFBF4BA2 +0723ABD9B3E9CA9E63BA57EFDBAE684655CBBDBA15ADAE43E1A2C98A3CF060A3 +D16AF8FE3A49B50A24C20EEED716E49AF6013D4D38CD9CC41A91C17E4D04D79D +567E1EF49110AA9C34464E95D81A730ECEB2C9AF38FBA6B45E253288438B4CB3 +DC75B3A906D4357293BA41E59C35223A6C9CBD6FF5FC90C2D07CBB376C7320FF +435A6251822BFCBB612CE630EDF826C37E95F541C21B93FCE127591D5E38165E +2B58A34AAE37712BC58B63FFD70AB80F4F24612CFD2F1466BAAF3CA2BCB45148 +D0DEA0E9B8FBA4C4FF5B8B3CB02E461355051842BD1C94F41066B9B909DB83B1 +DCDCBEF7CD00A43E4C0B8191A29600CA197F0BA227FB8309BB539D2A620BAC70 +8A1AB2DFA51ADC9873B8E5582DCD3ED154E5D727D1665F99BD89883D69E6CC2F +DB3A57AEB612171A88E22F038461DE03FC357F771675E34E90D4D19B4B36891C +9D2333960400E97494F4FC4DBCE6A73C34A0409E433BBDC0AAAEBA7D3555066E +1CFBB4515C8B573C9B9DD12ED5B6ECEBE35AD0DDEA9DB004FC6CB540B5117B49 +59CABE5FD74C6F5B6482B42C20B5FF0467D1DBD7CED2CC651CA57852B6FBB402 +A6764DB342889132C911CAA713A7F2FDD8A5E849345D6C81025E02F5B8B682BA +90CC9B467FBC37362436EA6BF8EB62D784B01D5430147945BC09D1F49EE89F2E +3E2B8E6D439248A56F82F2E03EA5C7A922F2813BE6538A3A423BEBC55B345AFB +3B3C125306749E137C647D78028AE1FBF3E1A82C260132832A9668F454D39C41 +736717DED0A99F6B11F005F0E1D07FE84713AAB4C042FDC166AA146D7B5E9198 +E4F485BE5B135EA281FF1C1E616B5AAF02771F58C5840CB5A427FF9794F93E94 +17FD799C78AED1DC4810BCEF4C6C51D3C1504EA2C6F2B29805B7ECF97B5F637D +FE92E168CB9029E90404CB54FB312FC7AA8A9F2F524C03E61F03B1E31D4F061E +1677B39D5D30C9FD4673E1723F4AE3CCF38593AD6D7F61E9DF3C010E51F25085 +35D51105E1464BA146A78D7297D4D310AD91342A0BB942034A3EC0696B467367 +3E39D202D637E6B14D0EBCA6AD3CF22B07D4CA69C0FCBB6C93782B2F0DFC5AC1 +5D8A16CB5EDB671A0C1BA9D10F63CEAFCD0E06E42C730C8EF769CCFD57937245 +658F486036D37E8BDDE5670A212FB488A8753322A5B170C9662750AA958C0BBD +8E97D8239D2A08B30416504DEEC4E506013E037C91785C674F8A6A44E23FEE6F +CCC00CC5E4D355B0871FDB8ECD64F70EE32449BB5D6F84F8C8AA2D5B1A489BA9 +D7FF2DBAA8D0B84054E93D64D3E77850A3724824914A0F821EEC3D605DD851A7 +606936B8B9E24D6E932E16C448140FE94DD96C75AECB73850035ED9C04A1D93C +64B21E7D4657E030483EC5C3554AEF8BE4D0FE5B9743B875340B09E01273DAE8 +F256C50A1A8F2E0417440A8BB0173F59E11523E1CEF2593A4AC5AF2167627B00 +C5EA97D125EB8A4BD4C372877ABF10F5B7B149D73787E0834BFB3084E9508DF7 +072DD71637019599252059738D4D6BC57A9358E4B14F6AF9C4B31DB8E25C29B3 +7A15F9953BD73ACDE5F0445A5DC406BB4635FAE51C1D8202AE31730E6F355317 +1DC197DB0B6177307C60E5D38F4487363EE051B2E609A52BC4D45B14B6558B6B +5E1618748794B8340752CDBE7756C068975B559615D4CD5A97CE30BAA7B2B1A3 +2FEF2E055232B24FD8A21BECDE1B6A479A28EC80AE2CD16DB50B30B4A6CFCF06 +491C7CD5AC29FB964D4846415233947522676DEABDA0D9535F8507D33693930C +B4E4240A02B0CE7EA288516B8A6EF908D7F8BAF9012D052C6AC96D9F8F6ADB07 +8984F3559C5E7E3022A957982155FC9CD599C74E18328D3AB46F9DD15D1C4C3F +9B93ADB4489BA02CFCF57DE6270F3AD2F8597BE71786510EF08142F430EE5568 +4F9DDB792B7C46B6135E341DBBF062FBC50FABA80CD4A384157BAE57CBEA9781 +AA4416323265168AC097DE7E30A0D4750143A4FCE70A863A31876A8FA5327C3E +36E89589E363AA2B1A6E8B09F5AEB8FFFD0396067173465B6503383DE517A6EA +88C0FC08578398C2A721E5AEB29F4AC9BC990A50CD87BD35A11F9E81F68E7B85 +5E5B95A4F9A5D30379EF90D78E1E466DEF867BAEFC4F5ED2C762BFF099C1C2B3 +5E0DA1C2FB33BE1379413CDDB1EE6BB3A495331F72F2FAEB8152E8AD5FD334A8 +AAB0082A71D5574B618EA8D487B8FAF1B445F3395B1E21224F5492A0E06F5152 +7726835C900E2E52BE3B7B654183AEDEC68053DD0AF19EF6DBC10B6FC08EC7D0 +CC0E2C8FAF8C9A4C21FB7C34E074BBA4EE64226BEC8C928A784C1BEE35B72EC8 +E9295240B29DDC2539CD118BAC38DB3917D14CD33AB45FE47E827F2A2B193AFF +53C5396C52CEA4F43F06AC2D08C74CC85D608CBA267175EC31311EE25AB48DD9 +FE811B411AE426C9FC0B6044D1EBF130231623F1566CEA4D1C06D8032FD9808A +94479C842BC41B675CF6B90113BD681F8D43F51D5016D80EDC11D7640FB950D4 +E709A46184406ED90D0892A4CD9062938A8205697A200DBE1F38EB166EFEA0EC +4FCB45CDAF82EA103DD6FDD03D146F3E42EDA6496064DB3F4FC1C5280C9E604B +D5EBCA08BF2AAC90156C11EF68137DC76502EBF216F3AF3EE30DD2676D218428 +F41C655093F8B530FCA378B5769F262A6FDB4B66B83F18F050E77227E28D71F4 +5F4425CB8D51B3DAE872CD86D7804F870BC564A6DA1CA13EDB00D131CE4F6460 +7021661B99612629DCC20C85CF155EDC5111E015A77B0B82A8FC1EBB374B7EF2 +361419BA93B857D5C9944BB5B4AEDD86ABCC261542077FE09701C96370168579 +5F89D5AAA08D700E2643E88C2FB8D1D56D37AAA9744872E7C050B4CE046B47A7 +83F224FA9FD311C955EFBF173042C8FC66524135F579B1397828870D5C9DC71F +8615FADE2A1CFAEA90F732B6C266E2F3048FC43EDA7A6B6D98E9DB793CF457B3 +F5877E7A055C92B0246FEA8C72B3B3456F93BF36E2651D32CD614C3AECC0B4BC +F824C8363E593A6458D37408FC5B09883B280005DD24123E2D4B1B85F4113327 +EEDD9186A4AF2CD6439B46C5C168C125CA80F9EE9E68906620EE126CFBF26E15 +B269838A54224EDCFE2A373EB750D4829BFA410DE5F1541E428BB1E024AF496D +F5F1C151F5A645C8622F2EF9088D57A2811868A8A8BFCDBFCE3ACB8463AC35B4 +8B6F44E1C1232805842F56FA468F81FF37D5D55B81CA56058558544C142EB3BE +07CFB1F75DECB1E48C14D6AFDD455989AA6FFE8B8DC54F462B3C20E31D270BCE +8E68E2B43A6625AC7E9792704FAAD6CE8BBE0B341DA7189EBB3E9D5375B27FD4 +12506D5BCA50AEDC6955E6C3C7BAA84BACAF7ABDF3A270C7734EC3C6EC22793B +E67B0E288F99699D38DA8B79F2D21DD97945FBDDD132A8F0BF947950D3C0B4AA +EB7B2C435AFE54489E1930610311D718AC610C21A644F34CB2D1959B3066F39B +EADEAB5CFC6AF4D191D86B02402B00D1C5262707861C5308730579795EB53207 +A291A27A8B5C4DAE0A87A0C6A260026CA3CB620E1002E066A515D7990F3DEA29 +0FAC962E0B82B7A6C86B1EDC54007822BAECED673FAAEF88C8109777EB79A53F +AF3C58546974F2F56E70E9B5CB59ACB5C27CB01895557B2D82134D7F02029B24 +3331621F38E68717F5CB68A8892D0B9C0A8ED4F8BB56E80505170D44C6856128 +2DED0254ADA4875CF56B4D97372AAE730D4C77A2940DC8C178274DF88A9EE037 +215C6FE7B9D481EE4DE809B124C0270782411ACCCF89906A8B143D0BA8B2CEDE +E9B90465C3E57A4FD9AD2702323450256ABD09A1F8C26F08480317C08B75B720 +70A161C99715A35A94DD5C9647ED0F8A5337B774C8E54F9653AC859485A1FED5 +37B725A7E4BA58711CBCDA6054E34CBD8E9F9460179DA7DBD243D81A1531FDDE +BF2BD425BD9DBE75EAA333B1F5793669A215549A774597E6ADA16D323FE5601A +EDA41092730009A99BF5B5AAE281844A6BF3292D4D4EDE36B4FD8BCAEB6EB72F +AC5D3CD53D0D621CA9EA8D254FDCB2B5161EE9E80B266563F669805A3A15271A +0753983004A1ECC7FBADF62AFEA4DAB49A178C231759857DB910668BDB07CB3F +7E8EC24901863088B3231EE3FA563924032C91CA9D68DB398F9BD9AC0C651EC8 +9051C9F709CD784F3FF5951DECD7E869ACC34B83AECDB011E6594347855EE7F5 +28811F744A4BD70D4E9077EA7EC19FFCF612689F12B34332857AE41F13E6D16A +962DB9B6AAAC167B9FBDF0068EA13412F318384134B29F3F0C399F1973A3564E +F9C3C39B5BDD4C98D81A6CB476E565860B50704BD65ABD630A5F1372F2D826F3 +3AD47C08B8AD3176A170C369EF3CEEB190134006D6135C5B8CCDBE1C11FFF1EC +3F6D8C46E15C4F5EB9ED9F31A129594D542D40DC3815CD075A0DBB648D868AF5 +15A05C4BDB28BF23653A3AD96CF6AFC065DCCCB23D5D9A945F8CBB539DD3BFA8 +DB8F1FBF9B6F25B41EB4309995CA3D5D6ABD70CBB4A2F0C6364E5439AD1045FF +72F6B45A30BD3A548CFAADDCC6C15D46F6D783D3E520215751DC98335A4ED512 +D7D19235CDF911CC69F3CF4365B678EBF3E87C456A4E77339C74930083445588 +462529C22A96A28C5CE87AFA0C981F26CAED5A1C8DBCDDA612624DBE0373F026 +465185A4D8C73CCD8D71EE97116F8F7D341B87FD78F9CCB9FBDA2A7799711607 +6BBA855AE9D5C505870DC85FDFAAA130A351D56AADBFBD6A7D52055E3200F8B7 +8AE9A00092B55DEA8BDE224B4BA7FD4A191CB1FFC4CB995FEE1AC2883AB69E1A +AFFC09AB5B9AE311A030A5BA05E2213F9BBF016C8FA80689C069314D91274B20 +53FCC65C7D7B3A7504887525BFFA060304931672A078BCD7F269595686310E34 +E1ECA868899BC402D17EC36CE40D5041D7CEDA77F7764C9D98793F5334F574DF +E93CB10A5E8ADAE95CE63D2339557091B4B4911A4987CF21B7F1DBADBC2DD605 +8EB72473C1F2EABCC44E0D0339EECB55DA74085606C3F89D57ACFBF5755A5395 +CA8D4BD47E4EE8D8B882D3AB31A1F0C62E74654C7E041E4FF2693A38A9796064 +46526B0A37E6B5BF8E48E80EDEF81E34DA8F6CC9025936A4D0E6D709D61B7B5C +AB550397117F3F9D2F5A542A64DEA8E1178F7337124D6B56BA92F659AAD694D7 +391028731E01284BFEA635314A8DA8DF7A34EA3B6B2F8803BE6DCB423A9E8015 +55EBD90EBAE8A00298B3B6B1C02BA516AF528122C1F2B07EF69F5466C2C36643 +0D665D6561705509B7582D8301AF3C32E2F3B9433E3E04D62117C7E8A368BDE1 +0D4DAA1C415B2A6573116D2A169AFEF700A83F55D88813585E89C94C07802BA8 +3AE8F9BC3CDBFD9C2E35D062B1FD6E79E1EF104FC70B0AB09D12CA027F33F85A +22F0ECBB4AD55FE8C616B82C46CE69A600E4F767BD7A9C5F9B37A3196B038384 +5DEF76A8884425FE598A63AEB19FA698C2AF7CAA4983CEC789268E22BA051EE0 +20A40633D22D8F707626ED30E8273EAAD1C065F0B2E1718B5AC853ABE09330C3 +B0082A71D557169BC1559B6D285A3499D41C4CCF1F74884EC3917EB9C574371E +AFE8578DDCA459B8D22C0188A8D150437B05FB92022C95EB6FBCC954216B5FED +CBC7C90B9A1F061376A9840FB64390A6BA99CFC8279A86A730C6DBFD14C53C4B +7277D676BD42203677E9ABEEC8C97E13DAA626474513B06F8734DD784F2FBBB9 +B3B448B8E8221E380AB4A86D3A683B86A54129519D50DD4FE63B30954D805CED +A9A5D9A39C58B65B08E1C19555E927C6DBF7FD07252B2B57F62B905D6B488201 +213D106A41033B26FFBAC2E616DA6ADA6D560BADF10E68872806CFD6F6E19D7B +57CF1F7A030A7BAD374F16A977E0ECB8742D034ADAF9C247DA19C8AEA74EF6CE +DAFD6B1DC562FD3B77E4D008BDE4D8C7FCA9895DA1AC9EAA01C32A0DA712B082 +9438E77230D38FC4153E1711417B918BA6CC03203A5FF082AF880F48518D8271 +C1121E4F1386B30A7F1BC6F10EA98443F8A65C867A109336B808BC9A8E2A75AC +F950835AA84B56F59DA4C8A18859C3B68F6B6DE09A6675F639EA9107BDB67B0F +54EBC564BC2D781B61C14363A54956BA78A2BB89C9F966C94EEFC29EE9F4E23E +C0BF750144DC289F0DEE1F8A25BB52E54F656FAFEE4BD2DA57E1306BBE648051 +1D0CFD6A23A3DF082E3CF13197BF1B7FB22B2CD427BB78F455C9634DF989DC90 +7BB2AE247B1C99AB2062855B2948341B0F857ACD750B59E370A6698C6A1F5287 +72A4A9628A592E313956C242DF8277EDD2F1FDFB07CDC104275FFBF796D7518A +DF49FF3CDEC3BDFF1D290C382F244DF18005ECDABF0C5C2C64EEC4383E2E07DC +5C82587C071E59B46B7BEF31D268F39D9B12D534344FBA515E9DE8F166FAD1E2 +7D1558967AAAD3829D3F7EC6938D20E5379F414532976ABA844D97A5E9078901 +EAE4D0ED1F4C7EE7A2D80D891A5013D6409A38ACFA497F5A169EB7F9F4890DC4 +62FA6A89EA48267331F086992B9CA9305E16611E6AEE67DCDD588A25D37F45B1 +0DE75C802EE021E574B64B3969DE2E5061ED9364B646C38D4BBA86802CA6338A +94E135D2256920EBFB1AA22D9E90C7D16853F0DF9F2D942748EE540E4FCE63C6 +5380D7AB4ADD6CB00FE8F7867E4862D8DB432F28331428CC350CDF7F447A65ED +D7683ECA35A22ADD06E9FE6BAF060913AEEE7B2B8EE4798E437698CC9EB2428E +74CE73F84D0D2292DE709D71FFF8901C3505370E6F1D4E28E6B7372492C65A88 +159371B1D60D77CEC93B272B6C5394EE1D2EF9969DB2838B8E128553879A1BA5 +2884B0A596E8FC3D1E648B7E26A4AC57DF09B9CE09B2F91D8CA618CA52AB3DBD +D005A56A420366069B73146A6F58E88BA49671A1AB7C2070C3D42AA770285143 +40AE7D7868C0E1993506B07C086AD7D4F28CE2D15853FC5FBCBF9425D8012B9E +DB6E1E5002517659C8DA69DCEACA94F368537668843D281FC11782F1C5F71977 +CA215349EE6F20565DE3D8D8212A40E1227A4B22965FA64A0B02C62BFDE97E6F +C3C54FED4057EF9D258C42D7440C78C5E0CC58A40DD74ECED4152F70A93CE71A +1B3A57C46F74A6D27BF98C97CCD31A8EA487260F224A3E40F52C65490AB4098A +7B9EEB54A5A415C8C88568F7D9EFE74BBB785FA18AA27D9201F28BBC477A20A5 +D1307AA78EB8C7CAD409AB64B29E4115E45F5FADDCC80CA74B296C4265A40614 +37F2ACD8386AC0202D6FDB6711E8CB06442F209D781E940ADDD6D881D4F8E874 +357C533115923B90138FFE31D3577C6AAE60D768970FAAB682CD0DCA3E9A9A68 +6393E4B772691C1013ADFFC90C508D51B02D2518ADCC7E79F7DE5DF9D18B8435 +6129064DD1A3995E5A6F45D78287CC10A0EAFBF47223494C5EA934B1BC2F7C53 +686C5880303F9E3ADC8B100D441D944686E1FD811C646C6DD0224F6CF55FA87F +D132EF50450879A25242A18683BD6D0266F8F333F3768D1952B0F32AA75106D8 +EC0AB703F287E847CB91FFB88CD9DA174B49171822BDE34621CF41EA772230A6 +3088F8D19CF2364A329162D39E166AC728B15800222E54C40FDA8B73C48CE82B +B2B3E7EF15157FB4510BCDD7EEBBE3FDDF708EA08540D94827AF3EA1B210446C +DEA9EE0EE9B4758863AA33FC296740F0DD9B42A45861516AAE6208F189D8CB8E +BBBDDBCC34B65A7D17B8BE932148C39084A9C71516582BCE25EBF7C1E0D84314 +45B273AF903055D53313DBD159BB698038A397AEF418B4446739318E8D273642 +095B1E04CC60718A2DC2BCD99B34202878786A58AE7C2F43D985874AB8A3F204 +4DBD4B9240EE96F0487CB687830972BF302F262C6381B2C79773EEB152B712E9 +34E8229E0B59788EB9B9FC1AC1E123751D1FF032610410F0847E6B9B9A575306 +53FC00ED82D0BDA8EB008F2380FDBA06D2F8C0210A261508BA95DD600436E0BF +5E8A00CE3C92859961557763D413E79CDD37FDB07131FDC420EF525CC0B5377F +9772D3876DBFDB57FE6275D187832F2B7A635967B201E70B532E85838ED3874B +82B36AB9EAB7DD4D2B5C4140419CA04E87316E802CC93DE6336C22FEBE80C3A5 +D43A0F808E5E6A17F7BCF812FF5EE5AC1959E07F36B24C9192E375FCA3C0A84C +1D1DD2093D4F151B9FEFBA90DB4E94A1D68E49DF5A715A5BE04E7B7D8C384D61 +5DDD71F057FEF51DE7D002AB3BFE0096C47EB3AAC7B89EEEB9E2F9CFC6BCDFD9 +A438C1097D5253E49DC0DE5B6E8F976AE8894914BF8CAB5236C8A3BB2A437CE6 +374D96AFC592F1238357817E1F2836EA763A3C0DEA2DD3F7D758BA61307C21F4 +796A18638504797DD9A5131EC48DB0D23FC9A3E069B2FECA5B36A2260C6FED2E +6EBDE3AED119EDFA96B837C56202ADF7F7747291A43CDDED6EB7DB5B9373CB78 +F6FA0B92BB2C17AD8DA549E878D8DEA681028539E5E2A223E2F9BA4CA09A6FF4 +EA195F1EAE62CC33F2282888962B9032D1C83EC4EDD832866A472426EBA6080A +75E02F39CE0421C5C06B9D593022C23D675D7BE879FCE0B20A9CBB394F9D3815 +9C847518BB8DDBF3A89D699C1FA84E704B02BC85D61ADA5E548CD8DBE269A3E7 +03626A0FEE75E116F95B5D31C73BC852C5FDCF524542BFD9D05D8EB4B2A114E0 +C2FFCE282CBD87D82C1D4E64772B0492068B139B1795E287899CED7791EF5C8F +E77391C51552FF08DAA85BC8B9896CB5C792C3E1C4D44E3CAC1EAEC02E4B986F +E5059463613DD3643F8DCE2264FA66D712A0DACCF86DDAB315393219F5EBD18E +E220AD61CE3C67664615A5F9734421152382E8EA9CBED8269ACFFC37873BA329 +20649A6F684D31BF37194952496E8B962B75B83CEDE72F0DAAB761120B710677 +F3AECF2A67F512F7C423B1DA012D0D0D44F009346C4953447950F514731830D1 +59D01BFF4511CD0257D5ECC2CC4A859E0ED92627F659547C8F137DC0F49F06D6 +02F624EEBDBC779FBECB1816A88F02B3565A9C3D42E919F755F3D80F6FAB681B +585B5A49F62581EDE1D1DF1906007A8926932FE74FA2A94B92026DE9D678EA3B +ABC3C2EE5A3757317AD5F5CD361A511F4019CAF77C46C8FFE4615CD6CFDF7F8C +8CD06F1A2DDBD3BBA03FBBF8DCC898EE71E7D19CDE66971150359310D0BB68B8 +65F3E41D34C8D063A71C27B6C0F27753A9E35D291477858E5B734D72C40C4573 +203C5529340CB56BC00EA0E02B3DB54173E6480D29D957E6735146163980F0A8 +CA4086192E6095F411939DD3FF19854F8F58B39A23D3ABA22BEAE05C4B6B6845 +98968C08559A037DE955F77359FC39249C1149BC4634D10DAABB086A23D9A37A +73A61EAB63BE3B1A8D8E76ED94E731169E892B469056757EC885D8AC4FF50E5C +1D80EFE20E40E26006953C53D765B3BCB4C5396646DB3AEF01F939BD163ADD87 +FEB1E55A73722A0866DEC922EFF8B06AFDF2FC742EB1CA422822BB378310A994 +794062BE62D5BC4D44C25655C902F4FB4FA63CE21E095E4DF3723CFE7D2D961F +10A715B194ED855942588BDA460A28F1B5D849A34D85756CC8CE874E2384AD9F +3A1C348996EA94927BCE9715A8B229C0D7FCC2C07592052796D7BAE23DF895DA +1CF991E912EAC97601FD79F35616A1F23D82647BCB49C360740CF010CA4E8ADF +97A9CAC032D12919CC167CA4C2E6C60EBB4AB87C8F2BDF71E28E91A9BC96056F +5D905902AE964E5336CFDACC8C5CFC5607D75CA5F364AB8E9A65FD372BF15FA9 +0CE1519CD7DBF31F92D2A078754E4BF90F3121F6F698DEC238404EDDD4EEA153 +0335941E4EB8F08DE0104FD8633BE277E9ED26FC65D28FC1D604D8504B2F788A +11E2206ACE8AB33D14CE9D4CFC917008D44AFA2B1877C3D42455593889867784 +7CE696EABDEF95872F065DAFEFAC253F367D47127CE76FCB85BBF0684DD1663C +876E68EC35B21593A10EA5553311880B8EF744014CD1ACFC067FDFD46978BA23 +C86FBA05CEB66E67621680BEE0ABF82364D4E3235A20033437C6B84A71FB34E6 +F8A160AC477A1302B4F98D00FDDB2A35ED9B315700669D9D8A3D254F786316AF +882CAC6555A766281A0836CD45D8CD8245CA69729260D54C11DB43032A0FAC0B +05869ED0A432CEF854FE665BACB0F780C9123B4DA1E1895F8717DDE4A58BD3FD +D214195066D4587463E839EDF667E475BC04EEDAEC41422AC9BC27C238E88318 +7DFFED5D04AAFB1F63AC651B1A4113B7CE9838ABAF75632EDA8B5EE0C8474678 +58898AD595ACD99029DC34EB4BADE834C04444941C3D8280B93951A9E8554EF9 +5F0FAA218DD8224B94807CE2D8DF7E4A5E2B28C44A551DB0708B5D6D5F000B96 +0422A8E953233296B6E5EA698921F1EEEBDF0C5CC72263663895940B4C1EA28E +E0E3AF21698D5430D6495E32E0D5F5E538EF835FBCF4A96DAD8F011B145584EF +1C33809372DF602D1FB3D80A4EAB65897F672642E4317926DF178BAB6F9851C7 +63613B3DB11FF07F9C7582592B620C7767D005D7B0C28AF2D309E6CAC222055F +2C20A58AC1B407641B483D571B9E959A3AE0DEF316EFF7A4514D5313C47AAFBE +82CC583BEB32F20E4C3A5650B58812EF357B68F26882D30A6BBEBDE64E2FD910 +AB8D974CE5C968C7D34390529F4714A9F1D2373DB1D912D418225932541FB250 +9C74346749DE9C5662B1C40437E783A78A283AD6EF43B2C111DEFBEECEB17ED7 +3630AE404B310F1148C82F4969A794D945CA5E1C18F39BB6F9C46EDC8BC3C88B +FAC2116B2338E1AF9C975ECC8474BCA351E3FDF89ED4352FF6A3D6C7EF7A7BDC +DD4B2DA9E7C77F8A6623B670963D2B9B9A80F8445E17B85194AD45E02FF10484 +85E0A700BDE9F574487F9494B424646D48999EA67D469A22B9CB72123F31EA5E +51C07370BFB1C5EDB4ADE75E7111A0116C212920F1362353BF58F33D7E8EE680 +DBF8085B46AFC40ED9FFD7AE756CB267D0F321FDB71F2DD35FBD3003E91E2758 +3DED65748BE5CD0D2D244E8FA187749FED44ED0C71056AD954FCF656DE28E70B +93A79EB4D7BD59E92911EC64EA794732A79B9908B7C6DD42C99BDF07AAA06E07 +5CD6497C489BC56B09E44D22D0FE69521A9BA20ACBFDAB8EE718625711BF479E +512FEC4A8F9EC7CF66D4CC44E2D0EA1235BF17C3D0AD6859385CECA3D4A640B0 +762D325D3A449BF7115CE8469A493C494721D6636BCB9C55ACF1D0F3489E5534 +4A76A8F3E3AD6252D8CBD3EDFDAC890A7B497286241AFE35B2261B66018A1523 +4B9FD31AE07A6CCA6B91A176BC38BC03F97D71F80270E14B83B012FA5270B7B4 +73F889DED2D4BFB24536E495F96BDF408E3840AF1567E9960A4F22F0B749749B +C156336BD7F349F2F82CE54B459462CB7C9846CC090E752DCDC871FF0873076E +8885B0AEF490DB0C9FA98A8FDF84EDFD52AB0F992EEB236A79FB8FB52718EBA6 +E0D586512F81079D468A75336540163B966670B437304F3272CF6E49252662C6 +419E8B2B14D240A1DB0CF6EF14E024F9D8C6882F865D7E007B46DB65E2E6AB1A +22C5F096B255E91CABA7C441A3149FFB4E19BA97E5D43779C2A80208E279A91E +8B8A281C079B819BBB6A5B1A62F34D59B7223D9FBB5F5E96F0D9AFEBD3CE3D57 +A4C4D2345776FCA140EA95242C8AF1EE7B93D2676209B750ABFCFC8CAF50F578 +4C364CF8BC46839A4379624D56B7B917743E9D6A284E7B315D461ED66B262413 +A9AE1741C633A92061DF92AAF78A18586CDCA41248C586F7D272378F9CA76980 +202A391CC9FD46794140F06CC75AF2F4986D690939E083CDF9B96D066B1EC8F3 +DE3B68AC8FAB84970B1A199B3F3AA5BE27ED8119F306CC5F26230C16E9D9FB31 +1EE9D3F5175E4D4D7A8A2945000C37BC73816AEDE6F2AC0F09B788C9988BA69B +82CF336482F490F05725696EB080E460FC03B3E28C1B3613C8E5FE3DEA048D97 +4AC72C9955FDE282FA8C8385B30E3A7EFE247B48B370DCB439FA721BED19AF4C +FDC3D3543A25A4E0273419B6CDD7209FB336C1542BA56257E5D31B70529C12D7 +524617868F4F3B49799322EDF504750D1BAAE307ABC4843704B64ED8AD4996B7 +5193CEA660390527734BF1448AC09998E70FF15BD70F8B6388B0A987CBC783FC +990F7A5EA016EBC024F12BC9812C7C4DD6E991DB89415A49D0B265E453732F4D +2B6BB50E995E719B00DEBE74E7D1E291A739C4EAB39B5A61763DDB65BDA6E1C9 +17C49BF1A76546BE0EDAAA17310AB2D01BDF059B066263C8FFBDA53281C882DA +E2DA35ECE5B4454C8031DBECD8675B60E54261A7D1F70560C6D8CBAB436EF058 +5A0189426AF00AD7EB43FBD13976D8D769ED2639ACBF613A308C941CDB5A632F +F76E14224909A8E7E45B9B5A47BDC9B7B3E3616AEC4DEEAF2899A59B6E144802 +534109EB0E3ECD270E417B2E9CD8D27DE637AC798ED5CCF791061297A0B218A6 +1188C03BAC8DD8DD783BBBF8C4C9AE98E8F1EFC4684CA4BEE6D533458BB229ED +4E31392DC4591DF2D2D07632EBEC0A5FA2C4508C1FD48D56EE871EAF4A84AC07 +A1E34CA2CD81ED369043998A23DD01301D41C582963F07EC3417F09ABF45844E +A74F386BA813F0AC462FE268407B9D2A8813FFCA604C342CE82493DAF631B2B3 +B6D3E9F3398761C4B958569F0D833D27973B07F9DA9D84AC512C284844C04866 +74A325E4ED894F640B8F802097B7C6C4F04BBBC8A7BC6EAECC60EBBF4E676A30 +4A5D0DE4AB45D0C913CCEEB8032D1946A35928BFB0FD76AE324E7E3CEB5B99C9 +0A0A6EBAA6F6D8E4292F9C5408D3859CFDEBFC9413032FA1A6E194C5F616A3D6 +FB0FEB8966534CCC9E6D67DFCA105E8994810D8EE414DAFC80B8A95CAFA254CA +CCAA72B84130B5E485529013A35040074072A8A63B2F4384D976BBFA0A743C5A +0A079A2CD15E598801AD121303CC37A2FD3942776FD1AA0805BED2B646D4D1CD +9DE65CB859735EDC177C5A4D1A54C3E8BE7A91BCA91AB93A9DACAC90204CC207 +8432E95B2C47654DA02EC1664566E2137860F16F798E0A1EFFC819F4304B0FE2 +AA54AFE0AF6CC26D417B0CC9E3F5F6B9BD6DDDE6A2D7FC4C840E4AEF73452D16 +241FF01413DF2125BA3563B3A49EECC8EC4D0BF06283B3C8242F362A546E71B6 +21F3C6DA63882992A14E295926387D66EA6D9F296455276D4FEF0CDC706FBC25 +57169AAF546A1BC72114A3A6DC3A1A76CE001962D771C267864A987188BF6087 +183573E3E9DED10D7023965D29F19C8950B6B9B83E680010995360E54911AAAB +44D07524518EE59F58E49485E885F56FF2CF8D30FC5779770685C305AEC4262C +B8C0C194C26F5E122DF5E4153316C971460C3B3B336C1B72 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +{restore}if +%%EndFont +%%BeginFont: SFRM1095 +%!FontType1-1.0: SFRM1095 0.3 +%%CreationDate: Wed Sep 12 2001 +% Copyright (c) 2001 Vladimir Volovich . +% See the file COPYING (GNU General Public License) for license conditions. +% Converted from METAFONT EC/TC and LH fonts: +% ecrm1095, tcrm1095, larm1095, lbrm1095, lcrm1095, rxrm1095. +11 dict begin +/FontInfo 6 dict dup begin +/version (0.3) def +/FullName (Computer Modern Roman) def +/FamilyName (Computer Modern) def +/ItalicAngle 0 def +/isFixedPitch false def +/Weight (Medium) def +end readonly def +/FontName /SFRM1095 def +/Encoding StandardEncoding def +/PaintType 0 def +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0] def +/FontBBox{-188 -320 1445 942}readonly def +currentdict end +currentfile eexec +D9D66F633B846A97B686A97E45A3D0AA052BD0CE60552BD63101D7CDBEEF5B11 +69C468645FE4ED1AF2541AA0770C1DCF81623DE0ECDF49F2B522618F650CE6CB +CC8C21885DD61AF8A523AA677EAEDDFA51A1F9B1885EEE0456196D634E04EF89 +F17499DAD982502ACC349B9EEAAE4A71A73D1147318C60A8BAC10510DE90D8D3 +F46E47295D27129A5AFE0C65E22BAD10D06885A2EE623FF8E1D90287A083E00C +EF25195F68A2A98170E48759F33528B839DFD4B92DF0482493852D12053A7904 +BF6E144B9488970F220C299E80886366662C1276120E72472BF84082B9EEC729 +F7007ECDC5A850C88810EA679DABE81714004E65D938DA9ABDF29C949A52EF02 +EDA8451563235D51286E9133FFC7A27067DF0332ED614AC2D4FAB88EC84E6CB9 +FAB41C933E84B88097BA8742BC30A81416D1CAA3545F08E2554B28362B99B79E +FC42281922B94604AABAF5F7A9B8E2D9A4358F38F2382EF9544B859D098DF243 +034CC475CEDEBF0EDD0A60C907127BB32F7D85A62A44E90B4056D9B4B2FF3A49 +786032C6B25794E2C0003C7852C6B0688351FBFC43300FB0B72880BB7B58BB61 +3D1064E7D4DDB128A9B38EF7510B7E5F82BDE39489E2D1DF08816781B13836E4 +89390F84577F31776FE43A5F94F817A4AA4A698AA4AE84B178FCB65F1B5A5CE1 +334417595F6E40849041565BAA497F6E4B8F4305D849128C9A26A98B909EABE9 +8F2659189ED27C588ADC7C744712B4D9AD0C5DD25D1233E979DE7F53C5F1C47C +E9DF254086E5EC70EBC6B7E080060BA72F15E6BB75C75011B15B7ABB6BF761DD +428FF1BD688938C75BEABA7DEE2AF49364D2E198FDC7F8FA2313BBE598ED3703 +7ECAAA4670BE3A85C693ACA829A5936778BCDCDB38A5981D4CAC8994E2B2F086 +26D8793AC1393D49A8F2FE391F0EF8899F63CFA5A77BC739C867C6CFB9A226B4 +620AED34573F068052604331B7E8E1F0C3BC0BD7DF733F056DB8C3F57E3035BB +EC82DF5B511453A952D429AC721A4F94D5C9BA5B83545948643D0596F4C6C9C5 +796BEC7B26EB9D729F337E0FDFA91E5955585C330D0C4F193FAC870A28CE054C +8942BDA170717B7AE9927C936DF0076507F55CA2979BADD3EFACC0A599933EB6 +F148BB7C3D61066CCC93A5856D253D759F30E37534743210743F0D53F58D0B45 +463F053E19A16E5A1B111915D1E664802F8C6C3ACA0F1BFCF3E209D1FD6C79D1 +5D867E142AD6E69933768274F4E2AB57CC518AD5A1C120887EEDDDF18C291BE7 +B3DB17E8FDB124B11B6142DC60F560DDD668D700614732F3FBAC4637B9F41361 +54CD2D8757A9D9BEDD1EC72FDAAED3CE4A1144F1E919FDB952BA7CA1E3D31C3E +9E434E2E44E7A83AE3480EBE89E0881584045E4AA5814897382EEE5FB5C9410C +2DC7A2136551DE2AA713487A77B911A7E7AEE41F0BEA1FDAC1950473B1394479 +513741DE60091BFB9751C780D99F2DADD5AD8283DC9CD1C81B902C9F3C9C3EB9 +55608E09D6DD423540BCF72394A24F81135C9D9063C0F4441BFE0120E03558D3 +4A16744457EC281AB2A60432C97DEDD16B2F1FF4C1A90D72D46C9F9BE984C6E3 +E239F98B59A938C2A6490889B437CFC21D923572530E41B7567A9C7E2464DB2B +18FAF3EB7CBFE7BED6E77219C0366A7D54D469CE3FF62E75FCA2ED6A46F3E5C4 +489992EE1A42C19DA52F0CB2B1A6956BB3F1767B97FDF225685FF7C9E9243497 +144D31ECF634CABABB79E323CFD483BD7A7B0C2679A9C3DFF0D44F09F084CF3E +886CBC91C5386A266730CE2AF3863534E2450583F6ABB520C27C4EFEA01EBC8A +F019D25B7BDB40CD6712D7DF2DEBF0BC70A92D3B64D1FDF723DBF3D4AE939E96 +D93646BAAE0BC57BB244AAF47ADE59A5228F057192D917E2BBBF588335E09095 +1CD4AA406C1D10C8EE6812DA676A8FD166461064BE4150CB95C41FC055FF8FA1 +89A4BAACB0B978A58EDDDB0CBEBF6566D47CC0AFC93110751B59EA33AB5D6EAB +0DB9A65CB16A053495F06B0D49A70BA8A7826EB571B8428AFE5EBB99AB9B56C6 +F69DCC77C25BBBB53FF25C5DB5CB8E742E3C0BFC25098B4CAEF12D299C886881 +0D4EB71D637BC0CD4D63BD6B4F5FEF9B083D95C34FB9E7BC9FCCAC0B9C7D8AB1 +1816B17AFBFE1DA146662723887E435E17AD2E2315AD800EBEE700B3C12B50EF +4A48C2839AB4BB367E908F59BB5AB88635C3E1B89948BE9F32EFEDC2E439CC79 +BD9754280477F7C982850438092D309C213D70F8D476728119E8FA03762C22B8 +89AC2A2A7C0BEBB0C91CAA95BCCDF91AA918766C82A978B7313870327F89107E +11A44FF02F597C8D4B085F6D7A098233ADADA521CDF34A78081F8965DCA615FB +55DB12C1E3459E49C273ABD2663B13447365C9C1C52E192282E96049FD58506F +FBC9507DDD77014C29275D1352CD5FC765853E858A5781F2DA41360D32FB5A54 +D04E088FD99F8C01DF740E587AACB0E431E03E170CBDA9FF1FCDE8D9FF5E43A5 +73166AF5990B238122AB322F709FEF2F0E2FA7C04FBB62C5383997BC9CFAC8EE +3FAD26E788DB37ECB388CD80A7D861AA9E9199E7BD065BD7A4D21A0D56DA9323 +2AFAE158CBB662283EA7310D32FB5A54D04E088FD99F8C01DF7535A5156B8344 +F1CCDE84A46AB2CC7F0CFD113074A1C4D90758EE58F61589051A0150121A7BAB +A636171E6814A1398DCB9F13FE9B11ED5A5F2EEAC14E0C831B2540D10BC0EDAE +833A83965A33180B0AEA361848DF8FE8E50DF6856F1D10C8EE6BB5198CFB7607 +B6B044160CBE8D4CFF067DF3579918B19B9128C2A83512FC0567CF47B38961BD +CC60FB8C6330A30AFEA9B276DA89313D6A83343298F34461B13C382575BE392E +F94E3EA3004D6D37C025DA3F1846E41606DD510D2C7D0BE9DD194E46BE7CAAF7 +A60D496CE85D2393457C50B2D586E010C7C4C7272F496F0CED0084EA956455F6 +2EE57D13B6485B968190360A3E30210D2664BF91C73AD1A811651CAC09A9DC0E +3A328E1DCA16082699B41A3D533703E58E366E871C982F262478E41DA3483028 +6BDBF03E444C6F0F4DA2CE9AB049F324F887732D21C4BF9C5365C603C9971CFA +7E45249203329FB9B4054B163C166E1322DED12CAAE39E289C126301D25076D0 +2FD409FABA5247D7A25945AD5881E18C2DAEC09606228CF925557DDFA155400F +8D446CFB8AD19704B6C544CFCE47ACCB854A74DEB5C646318679DD738987F800 +96844722729076811B5054DA998F9AEBE37DE5068418F41A007E645599C0BC21 +8363573C695B3F68111CE4A6199C8BD40D61E46A153C3C25D0C7DC125415D125 +D0C6130BB6B603ED78153E0CFE7384F7481FD4EDA141C27898B3636398EFBBC1 +9E81060816655B2F7052016A4C72A6A1CDB83BCCB2EB475A9BE17EB08A5ADA04 +CA8AACF6FE68BBDE580243B111BE76EC06E70CB7751A8B206143D0134BF52670 +BB3F44DD8AA7D26283A483CB46286EE0A9BB4FDB0337342BBF362C236C30A120 +D85812760265E3B283F48C05E78F47CF5C678F54658A30EBD7AAD5840F3C7B9E +21D8CA390CFD164792FF2040E07FA087FDA110A93430C7FAD65C951AEEF79D91 +FC25EC950E250511BB22156C2886A249CD442575934D385554B2B4534AC28C31 +43A657DC937CFAF3F6C87EF4F2826BB02C41DB634D91B70BCCC4F83F4C32796F +C5664490597DA5F2CAC7C0013B18373EF51520DFE081F95E0C1693D02E39AA2B +E356FD312C233285B2A8C8C337504C1EA7E9E1F6BD250B5874842F68C92DA11D +F74E6068495709EDCC6E4BB3A96AA3A4C89411FF06B66DA03FCBB052CF5DE837 +4834FDB84E2248DBC10CD7454636E97E399A7AC5A16A2191D763AFC09588F5EE +57E80130CBDAF18FE2F530BDBD2CFC21D684AF84A8CA37BF2258C80CA61485BB +27EFEBB52E5FDDA77E57AC8EEB3811BE2BC948A926FBBBAE974D9CE89333C945 +A9DFE37E5F34BA68EE97019BDBDAC7482826B8F71EC51A777B64C52B1C37326D +1172F83F6E4DF93B37E66CDD6344810758B10B2EA8C68918DBDBC72F8821F1E1 +96AB78288A2E00C2E03FA05640009DD0EB0D0D318C6A726DE5D8F2B1B035C658 +D09053A4B27B18F18BE4396C900A730908D832F3E8A21C36E32F2D603D0263C0 +8EADB43290CC59C43AD57D357057B13C9ABE55F11DAAA8D78574C430939CEF9E +FB36B462DA71CFB6E86C72ACAA04D5FE4732AC386F52D4AC92C47F9B11FC32E5 +B188AF2890EE3786AE2772D2FBC5D75A7FC59B0519F32D930B71AAEC8B88F1F5 +DCBACC2CBB9951DCC8F21A26F197A309C26ABBC4C25E3FF22B2A511A96F0BFF1 +2BD9AA37DA5DDDF261EAB0E48C62DE0885B8D074A7642D59C8E216B5F0A8B327 +1794E0BA5B672E41832562DE119AC5DA1AFB74AA66885ADB605AF60B44C1D904 +EF85F00E1F143A19DAC00F751E77EE62D394ACD26B463F7C7EBE4EFD40DD93F8 +81C2956C4250F5F28207671D7AFB3AC09FDD0126533384CF1B2004F31E053135 +44EDCAD0114140E52B7E153C354CF3F2BF37A15E2D19A2ED688710B6F9F83C5B +BA14795934112F7963FFD217F016DE82353B915549CECBDF7BDFC6FA4F7B74BE +E202170C9F25C7448970684BC555C8390E34A5098F55E0B003B841CAE775D48C +1603730AF8C091C0622640AC5A0B46757165B44F0AE1EC1072DA26A8EE0DA335 +A6BC8AF994F5508921F3D9E4E09B375A58ACBB9E6B0448903E19A5CF2A51F619 +81D2A539A4556B9C25722D4DFAAB480586C90874DCDFC2D70716B18572557BE9 +E9CAB7F5A3959D5419DD9FEC22D015EBB5D4BB5CABE110D76E8A76D6EF3513DB +5C23D3AE05BEFA77BF6B4ED5C413E8DB87B5ABD1B2FA9B3BF37A81C784ABC42B +1FEFDE6DF012974241B33B67AA67FA38798336F7354F0984D612DBB455D0662B +C8F15F12DA07E391480C1A150213ABBBB0F2927D223D5752B69C930053655C34 +FC487DD271A8AF594F457F6A083C4150686FBCBD60832E4E7D0D4987CAE5484B +CA81A230A21F9C49DFBEB24C94C93ADC954B9B3B3EC484C502BD0DFD605F6D5E +13158237535FA2EADA044ADCC1E1AD42918C8C67320F6621369C250D5335FC05 +AFEA1B294EA5D2A6F335FADB80CB26FCE9EBC0A4EBF72DD47806EBA23C3BCD77 +7F175E2041EA03E2F0B2BD2B81E9A6DD43BA3486375883C30B8606D917C678B6 +6E567A92A0E0DE89BEE5E5AC45C9202D46EED5E045302B71EABAC5FD997A9A7D +8F522B2CA316B7FDF16CE4981DBC25E4E2FCE3981324B16A18236476FE242584 +AE70C683199B7647325D295528EB7CB15A7E3940FE2D248945015E9DEEB9EB26 +7012041740F5A2A6C7DB7B2358EBC0358E9385E734D208957ADFC7DEF83F5E5F +4EDE55E2F078E994312214EEAF63F8D0B481C3D523E712901AD838AF2D840055 +E57D34F8FDD4C842D64D3D94B1CA46CEADF497A2FC75A45AC59F8696DE49672E +E33773AEB31A204F01793262E820E813949115DB90A7C798BDDEA0D5D1E699ED +753593F2B6373BD24D4647CF35A448037ED5E72DF3175DD6744ABAA0E2E0864A +2F4EFF3B07B035520A598CDF1AA97D7DC3057414513DDDDE40C2A9DEFB23631C +B2291ECEEF4D18652CEA451BB1559C0743FE3205BFB6711F1026A613D244BB07 +DB3830F07F32EA637775BCC1B2CEF0C6B0D119AF6CCA17DB1B03AB1E9281C568 +33502239B067013D261BBF33358AAB8803C451B2F570EC34BBA052170AB42F95 +F9386DA11A2C7BB9C05E8C9FDC96111549EAC90DFD8DC906C03F0281C40EC1BF +EB6B15455CF32FCE5C7DF6F55C91132223FD13FBD62A787EB15CF3E4E6E59AB7 +A529DA186B178CC6E8A4D876794527F3AD72FA86B7C2BAE14D3E5A41D8F90754 +AA28185D92C9ECBBDE4EE53E2BBDF05AB4C9700C1367B3D81FFC1AA34A79CEC1 +1CA7D422CB58C8E21870F680E48EB1B2D5A30D974A7E9B24DE13958976C76225 +45415635E32FF316DC4A69B3CD5EFC6EF5F845C8E24C92166C9076691817FA6E +AA5D1F1CE12235DEA3902F3C355CBDA5CC344376A5394AAA7C2CB50BCF32DB50 +4B6D9BED63F0A8928C0C06829558B714FD54F355501EEBE29882185A6CA1703F +6AE65F03CB07406324CCDF00093EBC76627A11A84B5EDB688D20DF49616D8D3F +7491719761E7627CF8FDCFC0DD2265160BEB33ADBE3AD01E7464370E3E0F9D45 +51FC9A87C678EAE5B16A564333DB11687FCB4D1D82C75A2F551FB4F940E0C71D +74CFDDA0974D787BE959B2B87FE13DC290C53819DBDC2081CCD16F34F0A61AF4 +3CF53914B713820BF8F2243C0679345EFD56307165AEDF16E3BC771EFBFF595E +C6B1DB8B028342D5DA1E8CF3FF4269126B48BDDE9BEEF7896CBA70EC77063CFB +0EB3C6FF697509736BCACAA7F03C4C326875396F0499B198DAF7842384C36C2F +36B17A65A1D9FB77649DD78499592C817679F344E0B88D80B8D78EEF9EC6A9FF +41F4D635520B2269035CEDDCB3B5518D63DEBAD4F365A70533AE119F11323AB2 +EF07047536DA6370C07B2215C3A82BFDB44DA593C6B3A33BACC38A105BEA2109 +06DC63737E3EB362A122FE90CE8EF37B9C73FA6933BF27C39EBDE137F15AC495 +7F58F6549759FFD86C2BD3A09490AB47B60E204B16910AFB0C18E4F2361AA033 +9BE5EF972F4B52F18548E3CB947F083768C7254FC019CBD8C4DE7E01DFA456A1 +065EF834C7B146FD395ADBB9FB72B8EABF58EE9E2B2276C87FB83CEAD49BBA55 +7DA56ECA50BE1AE4819EA3C72DBE30F363D43C75287945B0DE47D1FF0283C494 +EA65527E8708279B3B2437BF1CA2456E260020E4FC0A85BA18562CDB8261FDBE +0B928EF40F0DD40E215B8BBD40BB5B5DCF2FD9AB4D5AF64F82EC77BFF8C37BE3 +74BB9B2E44C819E84CE2C634D55A9EEB4F6DA28025C3831B601AD254108178F3 +3EC068E78ED8C72AFC5C3BE0BFE17F31A23B55E7158FFC40381F36DFEB6612EF +33A54D2004D92F0A44B3468DBAC0ED5E34F70561F5E77DA369754685B7F6B04F +233454A59AFDF45F28383B05B6120717744B58D2A96BA706CC9317B5E7FD0848 +56665EB38E31C7F8C87B0C65041A5D2E349CB4264523AABF9C10CA95CDD3BE1D +9923C1A11D046FFC2E82A09E36ED0146978DC383AC6D70EABB20327360CF7EE1 +DC4DE736760F5CF3B47F7BA082DCBF881ED8DEBC1A4580C287418295CFEBFB01 +51B09DFC98C8A8C9C5F9AAA6971CA95D96A23166E5931F7E464B288F4E357112 +4111BB33FB7F0E042448478D3ED7AAEA57D1B0B4E237F919152F8D9E86229BFC +B8D59BF9FB9E0062A3ED67A367669D0F2F8EFEB2219E5FFE7400A9DC725ADA62 +706D4D1860BC04D4432F49D7F4271376678D381B148D72DAD9012173FF3779A1 +7C4D92B28D3117888C864440902499FF0F9BEAB0C83FBD788E26B0BA47484188 +FC01B0349E045421E7D912E1BD329A536F61169344F16D65F6B90DB87E22F72D +8E6F486F8D21E6DAE282C35A2723464F560CAD8B31A931CCA7A2FDB9530769FC +BE0A5F66F1D4DBC0EAF834D078CFAFA415F43DC87AC62A1D8913334016B3FF37 +20902A7E5644848A57346228A13D7B1C757DFA9B5FC4E9E1DCB2C2AA2FD37386 +87E6B350662256D158D8C7DCD2F7AB1E02D6C5C8E3ECB1C6055A6C0B807B8FF7 +997E562EDBEDF7646B64165A55DED91178BF13FD30ADC1A6B6D621B1A7AEE1F4 +2E30D49CF3BD0656F584CECE76A17151913D7ADB223727B47EB3D7F491385112 +D36848973526DDAD7C1C1C0FB672EC627172D10DD33ADF2445483470F28AF65F +29CB086189B3FFA31E0CDA710B6DE2B0EE515A46A3FCFC354AF01AF5C5D0B301 +C8FDEADC6DB9D492554777965E2751A715F8FFB6E0248AC51928DD65CA4F6574 +BB1E01B3ED95D736691EBEA8ADFCD8265F128A67C372720840A206056F66A7A4 +10E1722E4C1BDEA8C980250F9E034C29FE0F7D2F5DAACAE3173C865CA9C4C240 +49B6D4D0CD90B75D3BC68B8C84605923075A9A2D5D6F7008365E52796975CCA5 +02770D168EAF28C337D45762A08817666907C68142CFAB9D75C4F6D6A73FB4C0 +748F038F140CB009A24A80270037C9B5E514E04AEAD7CA8468C4D22E1059F2D2 +EA0E7CA2979C7066F1629B49FDB893DBECF6620FF9C48132297E81F717820A90 +BDB45E16CA1D0D9C152B12D50AF4E1B2519FBB2B779218C5E42E31FDF82448E3 +5AFC5F90AA018902EFFC4D5A14D4326911F7055F9B7AC5B592E2E2D3A198E2C7 +F476CB49DBA0FFB2CAAF494DAD087639203084CEA25DED422E0F8A30634FF1DF +EE5C61FEEC33D547A17961534B3535AA673AE15F560DDFF08EA7AC126882B57F +A1AE8A5313E6D21F67FB6D16AD32690FCE021616D0DB89C51001090A4A7FB515 +139B751F6137DFEA833004F4689474DE3A8FF64D98EF09D25802C3B35DD2DED9 +FB5300E4F50E5CC70FAD3A21917D15D5DAAFE30DC1CCF79A359B81AA3F21359D +297B9795636C03E483A80D47A4826930854329FAC093193AEE3A19BA91063421 +988EA0ACD987862A716C42F071140254B72AC91B91911CD6A9D275FD7F6636B7 +4B1B0A47FD39120411E1D5442E711A6C1EB0741C67B0A44C1A2F98C9FF245A9D +5AE4A04B529CC5FDBABB1C6E8C1590B3CE658EB77B58F4D04803DC351C5645D0 +4DB49D76906E068C3FB553AE91FDFF5F22F734DC4BF8E9D019B06D3A1BB7CDCE +9101E9D2276CCACFB36B9EC74AD213BCE896FAC45D08EBE43E676816DDA135EA +8B78003042DA8581975D4C14CBDECE0B027AE87DF28611F387E64B951812C848 +B661FCC0DF91B39DEF14976D7D00609DE2DB8195C186E376F4029CBACE3AF24D +AABB788FB1AC87D58BF341F95EC2DBD14BFF27D3DAD9A06569FD4EEE40C516AC +D809E761BFCA049DCD6F8E43E60A0BFE64BCB922D1989CC14EAC1987147A5559 +4F1CA14635DF029AC387BE36036BAEA8AE7DD09D090EBE271FE59FD806894A72 +61C714D6D08322726CAAF168C08CE31F26CDF6613C06CC50DBD59B70DA211B44 +1BFA22AD62D56AD098FFB998E25FABBD89A2C17EB7A3AE81F79C05AA4677D744 +7F412484C16CFB322FABEACF98AF9F152E3217D0F2593D6863E7872C5B6F82BB +FDFD09B13FA639680E972DC7B086D7DAAB076CF346814556119BDFBDC3A16374 +E7B92CE50B3BEE8B7C26856BDD3C2ED98337C2B877ED5EE4878C50F06A64F750 +E9C8CA83B7FE6C91E10FA717CCEC0D2F8E21CB5A2367B5C90A81897B6973FAD7 +D4D95F6BEDE4E1EBE6D852A937D5D814AA6BA62324C08AC12FC09C5037588F7B +1B043BC503D725EC657F47DE02CBA939ECD8418F4B7C705EDA3E9AF1E623A989 +074165DB0DDD59B7ECF513C714B7D0A1013E4E3F2B071F6A6DB89B7BBC2774B8 +87ADA7C572B0AA702156B715159829BA38A9EC28E1CF3494B0CEC876A97B4617 +2CC9162F204C36850CA9188B0B97300CDB1AB4F57B55D39BC539BFA5047B032F +02A88CDF11D098FD30F6A6B82B98AB9D288570FE18E4E6A707179D96287D438F +2D5D3C2305C5FAF075E0979EAB1DB645AD9DC87A621219C260FF67C2DB8D541F +8BE9E20ACDCF64C4C721AEF5B2B65761D0310CEF36B1A3E57092DEFB978A43F8 +B553169F523517518CA0618E31F9A5940EDA42D8B9D851AD1E77BC1C0C8EED23 +F469B0568B5A556A5FD5A20F5F4E00FA6F030ECC5E711865F1549E409792F7DA +D1FFD1BE1E6DD22619163B98EB0425319E738254ADA0AE57FE29E121B0D8F172 +DD717E0B59842BE9F6B37FEC3F1BBECE15664851EDA3DA3A1848191C38F2CF60 +7A262D4440322C26150C605AADAD4EC3EF0CA22D6A2F63BE63C9C08EA643B68B +9C88ED95D2F2F0868CC40278DC2752A1E61C793FB87EE69A6D348F98A0174B09 +5AE09E214EDA066174A6823347B831ADF2619281E43A71D549FE194D5AD4ED5B +1DE112CA90BB9D92C57FC3D89F1A57F7CEF2ACE8E944B8B725557F567D9DFC72 +3D28B0E11DA3F81633C042B5FD05513542A2B431B3744E2E9581ED828F5F8A8A +C600F526EA874274FEB94E64F0AD787F47C98899DAA4552E447D4B97B3774334 +8DF26A38D7CD36EA79B64CB31DB0302BFD0DD2280E10FFDEF59E2D1F6452FB09 +E2A7015523BC1A46AC2F816135FD4EC198D30E95203ECD2623E83FFC1436FF74 +068CFF87C1ABDE2D31AD1FEEE6031D889A25B9F2C05036F16BBDC143705545D8 +4D14A2467639644AFF1D239BB08AA769BB5476DD4FE9974DC01E85C02F82958C +12C3AAE071BF1E57C358F72290F15A2655C1C79DB5E5264133AD0139F9F9B540 +972A3FD82BF0377FDB8711A746B9F4C6016172C30CB33CEC0B327DA0DE2668BB +CD41 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +%%EndFont +%%BeginFont: CMBX12 +%!PS-AdobeFont-1.0: CMBX12 003.002 +%%Title: CMBX12 +%Version: 003.002 +%%CreationDate: Mon Jul 13 16:17:00 2009 +%%Creator: David M. Jones +%Copyright: Copyright (c) 1997, 2009 American Mathematical Society +%Copyright: (), with Reserved Font Name CMBX12. +% This Font Software is licensed under the SIL Open Font License, Version 1.1. +% This license is in the accompanying file OFL.txt, and is also +% available with a FAQ at: http://scripts.sil.org/OFL. +%%EndComments +FontDirectory/CMBX12 known{/CMBX12 findfont dup/UniqueID known{dup +/UniqueID get 5000769 eq exch/FontType get 1 eq and}{pop false}ifelse +{save true}{false}ifelse}{false}ifelse +11 dict begin +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0 ]readonly def +/FontName /CMBX12 def +/FontBBox {-53 -251 1139 750 }readonly def +/UniqueID 5000769 def +/PaintType 0 def +/FontInfo 9 dict dup begin +/version (003.002) readonly def +/Notice (Copyright \050c\051 1997, 2009 American Mathematical Society \050\051, with Reserved Font Name CMBX12.) readonly def +/FullName (CMBX12) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Bold) readonly def +/ItalicAngle 0 def +/isFixedPitch false def +/UnderlinePosition -100 def +/UnderlineThickness 50 def +end readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 11 /ff put +dup 12 /fi put +dup 33 /exclam put +dup 35 /numbersign put +dup 36 /dollar put +dup 42 /asterisk put +dup 44 /comma put +dup 45 /hyphen put +dup 46 /period put +dup 48 /zero put +dup 49 /one put +dup 50 /two put +dup 51 /three put +dup 52 /four put +dup 53 /five put +dup 54 /six put +dup 55 /seven put +dup 56 /eight put +dup 57 /nine put +dup 58 /colon put +dup 63 /question put +dup 64 /at put +dup 65 /A put +dup 66 /B put +dup 67 /C put +dup 68 /D put +dup 69 /E put +dup 70 /F put +dup 71 /G put +dup 72 /H put +dup 73 /I put +dup 74 /J put +dup 75 /K put +dup 76 /L put +dup 77 /M put +dup 78 /N put +dup 79 /O put +dup 80 /P put +dup 81 /Q put +dup 82 /R put +dup 83 /S put +dup 84 /T put +dup 85 /U put +dup 86 /V put +dup 87 /W put +dup 88 /X put +dup 89 /Y put +dup 91 /bracketleft put +dup 93 /bracketright put +dup 97 /a put +dup 98 /b put +dup 99 /c put +dup 100 /d put +dup 101 /e put +dup 102 /f put +dup 103 /g put +dup 104 /h put +dup 105 /i put +dup 106 /j put +dup 107 /k put +dup 108 /l put +dup 109 /m put +dup 110 /n put +dup 111 /o put +dup 112 /p put +dup 113 /q put +dup 114 /r put +dup 115 /s put +dup 116 /t put +dup 117 /u put +dup 118 /v put +dup 119 /w put +dup 120 /x put +dup 121 /y put +readonly def +currentdict end +currentfile eexec +D9D66F633B846AB284BCF8B0411B772DE5CE3DD325E55798292D7BD972BD75FA +0E079529AF9C82DF72F64195C9C210DCE34528F540DA1FFD7BEBB9B40787BA93 +51BBFB7CFC5F9152D1E5BB0AD8D016C6CFA4EB41B3C51D091C2D5440E67CFD71 +7C56816B03B901BF4A25A07175380E50A213F877C44778B3C5AADBCC86D6E551 +E6AF364B0BFCAAD22D8D558C5C81A7D425A1629DD5182206742D1D082A12F078 +0FD4F5F6D3129FCFFF1F4A912B0A7DEC8D33A57B5AE0328EF9D57ADDAC543273 +C01924195A181D03F5054A93B71E5065F8D92FE23794D2D43A151FEE81296FBE +0CF37DF6A338C826464BA5198991445EC4BE80971DB687336AE8F74B516E333D +2D8AB74D362C559AAE6ACFAE49AEEF4F52E28C869222C1301D041E7A0BC1B608 +1BF728EF9E98F3A12EB2714E7F16B14E055FE1FA0EEFB058860ACADEDA9D0E4C +42E3C6F1E4869471BFAA3760175F3FBD842755A9D7847EBF605F18293B42F557 +FBE2715002669091BB033E1AAD657532F34F7C66E4F04D63ABB07E6CB9D9AEAE +78EDE8B79DD9BC87A1FF445EAA05B5572BB880E69F4DE1F82D7F0E9980AB0C18 +22C448B0B1722D3CC33C56FF287CECB80658B3AF5E7675BE82CEFF3DAD5942EE +A03C955FF979E41E54BCFB5316A9AB8945C403A73180D0961416EC9C92F49811 +4B91BC4C788392994587517718521E416D469F69952149FF7F9224377EBA1065 +4A727BF806A112A7B45B0A1BA1D5A23683960575368D9EAC8C04753BF7465AF7 +95F25C258C63E4FDFFD0B412FD381946AA38C0B961652BCEC30322C47BF4755D +9F91880688AF066E32FFB22E1A52DE741307AD3ED830D6BAA1D1F562919666DC +5E8FD9862AC8600B0AE0BC7FC779252AAC57248744ACC8A8AAFA836BCF09B0DF +9253DFBB1CB77EA8A59D42D1B18FF25E9AED72FA62FEC3F126F030F5D7DED9C3 +CF60FE890BA4A48E39E687BFFAEAB96AE542A6387F6624486037C8924002A511 +BEE5FBFD780AC1D4BEC3FBC47A930BAD0280D444259528B6C565DE11DE36BB65 +9BADC55C1EDA1A80458E98896D782DFB5C137897419602809F9BF8CA39F00C68 +EFB9E076FB324C2963F23CBFED28B9EF70EAA4E4B903225D1F199A7162AB239A +D92D71C18B1B682D04C6A48926275BCB16D413B2A0E953E1257E0B12D8B717CE +2EC84CFBC046A4338A69F454A469B12118E562B4F56C5FFB3CA5D357513E6FFE +947A564B229C7FD873057D5C7CDF03E958294A1003B37D8DF565A70A00A3734B +0138AE5277D383D10C2BD853EF806D3CCDC47739F0E374A3DF3B63638B949ED6 +4EC25869DC1C0B1F4DBDFFCC97382841D8F10F3635C792139A1EC462FDBA379C +BE0990CA2E70FE73137AFBBF30CA54954D7E7377CC50BDD780DDD4C7FDC77AD2 +F3EB1169F14A0041F18160F43C24FAF556DB5D621709FBC544CE55424F7446D4 +6AC07A51C8CD5161AB0AD5084A96FB35D77F1CA155147DEF8D7A590EA6939514 +D4A226588295CE0007BA8A550895511C8D80BBE5CDFB8A50D249C3BDCA974415 +F5557914A9B805782F399E4078DDB6264F1A49A9A5BA45E284A5196E9828EBA8 +481D357B8D9E6ECA631A6204439FDFACE7D7E6A2392726107CB7D2517CD19A24 +FBE592C119626DB221BBB635B6EB84845C16A9585282E34958B961F4A543AF9D +419B6A9105BF185FC767712D923437BE08A9C0EB92AB6792DBDC671029B6FCA6 +7F717FCE379C0F3B51C6CF042A762ED04898FBB4B0105C3C4ADDDC18C51BAA3B +70A93666669547081D9246732CFF74C83EE90DA17F5B4F8BAF47FE4D81590988 +2858C9B96071341FA0A0D23BDD4947FC9BC2297913CFBD4FD6CA4303AB3179AE +0203F1BD502065F90CE9BEA3B52DAFE4A29446082EA0E6B1D7AF1F31D0AD02CC +9A7FACE2CA86E5FE0F6A425B28A5940ECA306891CECDB3CFC7A5BBC76B5D9E8A +C754379ADE80B4D72CE493010317BF21A0CF4A0A55C1246218839DCA3F4D626D +1F4161D38F54AD5142C1CEE95C61D8BB10FAD4B772F4955777AFDE8AE5A837C2 +A2BBB11D0BF5DA2E63D0B75ED421DBA9C789B281B01846B65DC572BA69591969 +21265DB722AE86BD8CAA3D887C975A617ACEDDFB7AAB341F47532AC0F354A530 +7662C089DA3939588774FFA16FC4A52555DED6D6F51DE718BF5F345C23C90198 +17B77CB8B5D53A5CE7A79F3E286B6A59F3F6178AC8BF15C0A15C1A8A95D03B60 +30EBE53DE328CE085CD9A1D49C69AA299C5B58B24334A546F6E274C1B534DC8F +3289553F560C2F81E413ADB92FA0E7DD1C2F39D5FD268EBA97AB7335ECF28257 +96B4EADB7D0778706CB41C7E9C882760E7670936774A1088FFB2011115FDADB3 +B69EBD5108760762521C25C968C3E282DC3400001AC8FB1EA27FF643E3025950 +1D617BB8BB321281708E496277E11DD3AE0023DA9F25AD06B39C7CF527FED27B +57397E88D3DF70EE4FCCEFC8A0927D6B05517E571B3E70ECC99F3CBA32CCD4DE +B8BF22626B6C94FE65598A88AB90D238461EBD9A098DADEA4091AF1CDD7560EC +8E1B9BC2321686E1759E6B8A270C8CB4A254F7368039602EAEAB86ED21CDED91 +8F2DB9889F46981C494C7EAF5E819B91C129F0740B8002B510014985E5791F59 +B16879CC6521D8E9F1C4C1890AC85A78022BE614BEFF318AB2616F0C3F02405E +BB425D1555472A2642BA7686E431DC3FB8A1688B76660D9957C3FDE8D58109AC +21B1234C9DDF3F0FAF93BCF7B2F88A001F23162E1A13E5E9118D51B485B70A91 +D0CBC39CF44413FD8686D9030782DAB58064F5B987E0402AF5B264B17BD31BD4 +FDF63951BECD73ACA6138854EF35B062D01F33073850D9C09A818828C581241F +A625AB3638081DD0F00F946BE5450D38489CECEA4E66B4D85CC8AE0157E2AEE4 +A22A9313829F24D573101D84CC1784D1CED7DFAD5DD966601370C6CCBB723082 +A86BBAF0A5D867D0D2E3CA16E14E5109A29EF02649C47E12E88B3B397D65CACA +DEB9940B92100744D686066F8250FF30E5F13D81428EE238A2E4E07ACE0F5C38 +7D79D4A336D0D26AF9C2B84088ED8ECDF94A1E3FADB45AFDAB46CAD6FF950B0F +07AA2CDF82374DA76C56D29C80138841EB13F0D02ADD32F88B23E282ECC845F9 +BB9AAECE9CDC644AC2D49577A92307A83A99434F6493156DF25DBF0FCF2EC21E +8C50A312C3D19E0609C0038554CF4FEF3ACEB7A833FD54B06EF0D617C2971C89 +E4C06075B09B84A4F78A82152B9A9C540B1D881313C2C74F20ED064A9606EC2C +B56D7BB4797F1EEF4A9B13579CCF311FA4A4DFA62D80FDB7F535CC6526D1AAE5 +45C008EAF024B48C377522F74D939A475970533E645B1BFA81997549AFF26F67 +2AAE6C2EFA357DB3B525276EF330905688777057F4E4CBF584520A534A8587E5 +5A8360891E75A15205E8ADAC4A4E5A6E27D0C4A7D492216E4BC023AB027F37AF +A8DC7579BA50204D5F45A51460C5BD8A5A7F87668CA6451137F2F59E117BBE28 +5C40820882A5546FA76F0CF49F8A6EC445F0647CC3227C400F56E7E9B84A6975 +E85E243CC1666DBAFF4E07EEAF3AF71BDACB30DAEA792F2B8504CAB071544F01 +5D66243D529C479D276FE22F7E275D9E7FA9C6EECA18716B2F213916E32C1D94 +6E32397B41AC6779543218E506569E3544803BBF9B404A983EBA62A494187B30 +8D3DFA4E1237A2E5E08224A60492C09ADAD8775B7CDB830520829BA164209ACB +BCDEB2D574CEBFB7AE4BE72DF4EB1945FEF2458761AD8DCC0D378AEB7DA002C6 +9C14A665DAAA532B0ABA98D7BFB5A6151FF6703385AF7AE8FD315A492FCCDBCB +B825707F9566B3B4943A3C61C3DEFDC31A843A2D67AB06891F3E110DD8C73D3B +B5E4151B51D9F13905D7D94DB9ABBFCAF35F43B6EEE256B1A80ED6D1739D8D5E +8C767F6F0E8704C5345D028A2A6DAFD9BB7AA048B8B895FE9423A7ACE858BADD +595CB074A128DAFE08FDFFD6BDAC0114159A702FDCBF8013804B0CAEAD7AF38E +FAF086A3248AD4FCA1401A85AE2F72E3E6956DC0996FE8ADB18F89B14A208A15 +13F81AF73D0DB72F78C4DA634ADE3C73756CAE6AF2E149C26316DFD93370BE1A +FB4A79F77A67C07CB0A53C78367F21661D4AFE9E27328E077B522B50FD9AE2E3 +DA087BE481515B5DD7BF894A96A84A6C78874100505B7DDE1D22EFCE8D58B3AB +313AB5495F72E2CA4E6AE22C0CB854302B9990372F1661D9F0A517F90686F248 +C5643008B3D29F7296E5C8FD4049886662EFDD4106E17C879F5D41CE84F87E89 +F6A3117C968B95A35940CC29C43E1E0DEF51C1E46B676301F40D59615C3F73DD +DE37B72FF7105DB84227DA5241583272AB1C3CD97AE11C1EE98FFDB5E5F44844 +8FC41BEA5C54B26341AFF6830D9D0A5A2901B0653D8BD0746838194D240FF753 +E99750D3383373F453723D86BE97B571B8B84D8696089B5CFDD53E6C562A2197 +A8C4FB0CC690C27761A816B441029D3D306245052E0C41B53025D8CB7267CFE3 +C17FDFE348E765326F91AEB700CC49162DF748171214252CBC821493DD01AA20 +417D66DF47EBEFFF3E9BB2B0A2BE7D9B8C68BD570FC2EB0FA54CECC318F04C43 +19598BDE93F2F13DC7847354C99059AB20593EE51E94F9D4E9241869D605AAF4 +9D9B5FD88C3798A039A67993C5EC68B6326B132E647F67EACCA7F7AE7F718D85 +12666E90D7C73EF210E344964A38228B236679A2B18F5E081234CAA2458F8D83 +3F0CA308D19663CB12EB904076EF88E556407C33C9380A6A3D68A9EFE65387C1 +A1BCD2D26DFD2AC0881EC30E81C0A4E76C244A2BD822EE88C4A60B480D107E68 +90E419A1F512E865BA922A7830909BC2611A80931CB2E9344529586726614D94 +3AC5200FB9FF68AD9686506C5EFA8788C0AD0251AFE7F95E84683380CDB421C5 +B1A783B6D5F3A6BD1BC1C14B363DB01C87C0796DCDD5BECF41A1A9F43183CF6B +82C2AE49F0BFDC5DEF7729F2E638EE6EA9E4D059EB9BB1B992AD8C82D501A550 +1BF73CBBFE740179B54E193E84A55DCD61B343C1852780FFB44248FC9426AC94 +AA2B3FE20FBA30F6C4D1E0FF3EDCDD8C0F57CCB50CDB0EFE2E04A8927E239C1D +9B026C7929BB48461D4D695FFC766C8A0E545B1BCC2AA068D1865333108E7985 +2D93F9B00EA0A90939D0D3840D59B6CC0CE2C147B2E1A9A4F14270FE3ACF51D5 +99F7349106165AD627CBBB0ABA01ECC6D3A14C1DC1ED23A9DB9865BB4396C51A +31ECD001EAC94B33C34E29C5611148EF3E55DD61813470B8F3CE32564C749414 +3C93C77EA5A3538A0B5AE3FC4DA32813B06772E0E48E25BB39F3F6FDCC077E86 +F86FA50E18FD19EB2F37311CE87F18F3BC85CE7FD71CA92D5C3264E34E04A2E5 +70C79D99F54D6C6D9D527AE45EBB48411221134587D2253E7C8ED7658EDCA34E +5E768DD14E0200470F73C44D006CE8CB35DE1CA3EC10ADC668B0662A7774C891 +84EC95A31DD872F0728D9F65CA80940080E04630BE4DEC77A2C49E3913C39978 +BF145F8832AF2C4385EBCDB15F9D32C22CBA0CF950877717D6F1591D7C0B8047 +8C9BFCB16AF7124ED83137695F3D69228DB633053208C29E0ABA1B06A7FB3EE7 +5625CB44927E2DA6E038A6E62DEBDA2D96A03177982D8FA33BAAF4426E05F4B7 +9C1748B3FF7691F9888E7FF864A10B9DF761A41E6B5CFAD2BDD7E1C4924AC97B +F4B352705316DD1A58637CC12D71C18A5CA691AB2AA8F171590EC24582B1123E +94D4DC587D8F99E18A711776BF4013C96446BFECFEE4C809EA94B169088024DE +0CBD20199A915AA406F0BD5F3D63D1467C49B4691AEBBB35ED6624F2D7BB74BC +E80FD92B9FD04DD9C2BE9B6FD29EC7EC07FAB447511C61DD299C783BC09AE2A4 +7B3CBCA6A20C6631D06D0B2E2482A50612BB7C29B7E7D0A205EB0E8436702581 +596BC996ABD58CD8D5BAAE4B1478195CAFF98FE0141287296C4EFB8D2E7A8442 +F0A3AA9F9264329982532295A176BA1867EF732BBAC49AF485D9D0F7130F617E +7F7DEEF935874D55A22240F8EDE4F247D5F73481373A392D40A8076BD91079E1 +1CE5998BA13D48D56B49A92B4A18430E316405D2E2E391B496A1934671FF1785 +AF42BA3B2D14B8E04014437FD194455C50289DFBA61B5C377BCBDADA48E82DEE +4E70EF5E9DC03064907BCB8BE4D59DE069FB0C0CB140DA54708E630767313F9F +744594AD8A499CFEF733E640A11FD74E46A749F9C7D18D49251BF85C6EB4668D +67598C31A8F90922FEAEAD4B83B6E7184567DC798E4BA1C4C9B3461A478D63CA +054F13B502DACB674EB49D6BB935E5EC82BF99FDA7D47C581AD7F940DF4FC6FA +6C6D25D647033AC69505F0CAC58DE99087F365531A6283CB89CB644688963C3B +8B2203A94294E58739EF23C7803630A1F9121D62BE1977DE2F41687C8CAF87FE +CBD7AD3B98E0D95C8C6E1A7CCB0E09465AA874DC90A0F5DB2C5E7C130297FD39 +EFE63B0350B5139D09E6864D22C3F1150B29196E40EEF9723E71158B7ECFB8E4 +C426FEDCD439420B7F1C251FADA347C9A2C49738B5A17922E1EA93CA7B125B76 +57449EAA9C1D591CAD327D0E98EF2D44D614EE9ED49DD31ACAC0B956620B6BA5 +5BF6D08CA7541059D5ED2EF00AE2EE95488F5645BF6837D9241C0D3959B7580F +C9ECB2BCF3E65C07D52EC9CFB21C11CD4C883E44C173214C900C44D2E1E43DD1 +CE8DFE3DA93C38B548BC4EC46FF91F30CFB97525E1FD4E77686433B20BABF8D2 +848C1CDF1BCF185CFD7A81D2D4BB826E837E2AF35CFC4F419F698DB0C43E9F9C +B0FB628AC9A3CBE9B1FF4A067016E70333E78B32AB2D89C483834B31F5808FDB +77492E099F1504DABCA5722C7860CDCEDB2DDEB512FFCC7D287F4945FD711F28 +87BC3D36173566B81FC2C1290C717A09697DAC6072408E20926D39270121CE58 +3EF97CE12EDD7F87F2C8CFE36C3C0400869C0D813B71C425343EE0CDF717BDD8 +409D5297D0F8F7FDEB0257C0A391F5635E0DB1116058942FF3E7C94D5F2873A7 +A3B0ADAFC3835AF2BE474E6741319BC6695FB37F59AEE388F81F6E66F910000B +72E6BA7531B4378CEFEEDC79CCF4947BA1703823B5AB4F4AD73D9615C66C489D +99D68E49C9BF765B7FC547BAB9640D51D5A7A2396507AB5A4DFF3D14F52422CD +8FCFEAA06A56C6C7FFCD29C9A7A59DDD2A909A9363FE5F1E9629616D25ED38CB +E754C059E4379318CC491C3B1A90128693AC53F80F8210FAEA7EE638902A7D3C +82B95B3F5AE340EC1B648DBB9FB679D6E80B7F426D8671FE7136D97F51E2D2F3 +C9CE9183E4061CA40091A2A70DBB9ECBB19CE3F65ADD0FB346B54BAB182E2CD0 +EAF4C0F402C25573FB344EA771B297BEB615FCD0595172E84ED2A62FF8962634 +23C19076C2A9ECEED5135994EB397303A9619C76DC55E032DA83FBA441BD484A +59F70A5110A8927F6239A14D4E223E189A5462E4A92EAEFFA4B961A2A32B320F +C2B4E8C1821FA67A655B5042C15E4DE1FB3652B55078DB123573C4E986B19DB0 +1C5131F3DFAB271C30A5476B4A19D8FC922E31879C34BAED94C07A4841B8209C +403369FB8E842610D1EB4662B6171A4465FD0E819964F62EC5B0ADC92F08CF90 +1DE0B410FFBAD16F6D355E8AD72CCF67961EDB6CDA82398021007C2D0462E893 +75EB0710AE4A6CDD15077C9DEFC5774EF4A657734D703CE42174259B58E5277E +0DF26BF59AF8D1A3E7DC12E3C12AA4B67CF35B19962F6950C2020B698D971B35 +82FF84E72F72FBB0C54A112BADBAE6C4CAA358BDE6A705AB59332C3850CA3D25 +C7564499BC1319121CE0D93218210C68080AFF33420E3CB3A48BF9EB66BC07C8 +A79D8CD8E78C200FF7CFA3DAED0B9E87E6141C88B436D8FCBA50AC195FCBB9BC +9512B95FE3A37FFAAB39850FCEBD4D50A243EA416E73F53B4B00F3B6EAE0CA06 +0693AFFEF215D00BFCAD02E45496D7C8F5E99EB9096FC4300D038C1AFD31EC4C +5ACA6B72C1BE7204E37A4CBBCB1EC26AB87F2FF82DE20601025169A5FBD2D060 +62B5B2DBC288C79C33B596832AA18D730AD572C6EDFABCBD36DEA87C0F323C3D +6E537AD3B43C6F3A905597570A8C6B0B4A5E08C08EAFF9731E745F2BA8ED0C0E +1ADF7821CFCD4E38F3F4C243CAD31D9F8FC68B9043740852B4CCBDD37BF728E5 +648215961FA82A0C847ADCC5187331D0863A4573BE520C02CAE14AED4F06B3F1 +FB4A318AB54CD86DEC824707B29F858FD726A167F2333855C0575EAF4EBEA0B6 +754B1775F967140641FC06F82B191244186FF347A351FBD8FA62E8C978B21F6A +E124929876488AFA97FAD262BE3D172E2F03F564F1325C9F1E050C83C12E0CE3 +C7F58270B5C40B46B3F592FB41FFB7F59EBD69B2F489441E398FEF7F84C85055 +531D95FD21629B0E509C2FCEE995D025BAD5D3F28CDBA5CD414405ACBD936C3F +AA4CB2620D7426002161F983AE95E542EB8553AFF7E57B82E05FDD5FC433E1DB +BBCFFB1ED92299DB0291CAB10A84529B7FE279C62628A24A2FC36B01976E13A9 +C528A198B8EC8654AD69CCB5C209964A2B25D6DA9BA0FFB366D19D8C69701D7E +8ECBEA88569601C80ACCC2D5487DDBDC27DC463A53A8E59F9EC17D0ECB7D2188 +B6CEC6BBCEE631DBB9959A9855B997481B5D88B8BA29995053CF42C5518A3E8C +AD21553A0F6BC3483624B013D3537F7C85D7C558A9C772554CFC1C3FE7A70633 +318A99533A1AD864430BEAB8A5D4290194F13FC1EEB80C2005998C0126EA9C07 +9DF7B66876309A37685C8555A6CE41C0EE4BF759159FB90FD85AB248BDAA0417 +4245331D416A4ECD2C10905CDCD95169CBBCEAA3E45A70778A746B11D7974C6C +616C217475E1632707B465B622DC2BE08B366A43F3B1F55E1384532F37F5CBC1 +8B2840EB834739DC02C8A477A0E0B5B1DE8F7944DDFFE6B4BA18D9DFFC2A9A7A +78E3BC3A0CBA942C110DD323775ACBAB430724E21575298C6D19663A9F4DFAE8 +AB299158B24294CACB53584FA5931C45205AF58AC7D6075890B8377997E18CC0 +C65436BB7790279B58D2E3C7BCF91EE077B0EEFFB07A403D702B9DA567AC51CE +FE7054FCC281CC34CD04E539FB17299816486830EBBB9DB3AA76247D50FAE981 +65CF044E39923C4E2173A9FE6E38A21CA36F70FB9FA6D2E2246B402D4BB5F150 +48434F9B4F2C2FC1E7C19C30374AC31C2EA87732DA14B6E925DD0F34E48941DE +796C44890144DD9691AE6F0381F174714B9E17A44CED61B9FFE40DA5986D29A6 +587781B9D3AC5CB19BC448E3CE9661EDA021755BC8DF86B3F766B0FFCC6504ED +82B4B8B53B62B399406D1658A37579EE7CAD4ED2554EA16F53122BDB72C89E96 +390332C0EDAE62DC139A6091E640D555E6D7C5AD81CEA20CB8B1272ADA2105FF +FD816EA361C24DCF0BB660E2228DAD143C5E0C101D34F9E1FD23466F672DBBA2 +586DC5BEDEBB112CC621B8778580EEF6B8EFF9BD99F335F43523E09E2062AD1F +DCEA3169348EB141776FA49800CF1173899E5D331768C864E998CE2078C1868B +5F3D166C13AD2C17639BE80856AFBD3B2C8EB89FD41E998A0AEB832AD421FB40 +1AE013CBB43D3D13647A2E27C41470ECC344534289FFF79162D7322C3EF5AD08 +345ECB050186836AA02A47D934D3FEF1BCBA503B9214949974A9C206055BE582 +42632173653D9A62EF76D442ECF4DEBE87030B9C366C7280BE342FF8D0A2DCC8 +A5C6993F0338A71D54F3AAB1CDFFB6AE9ACA6DB5E29024CD357054EC0A149893 +31AF86ABF24E2F7492E461DC9E399E815264D4A06F6DA4364432A12A8492A88F +DC7C433D4D884FF56DC2FC982F8FA87D69D59C4281C8B9529B3D41B854B00032 +8258AFF0063BB4DE1F824D6A526F7F196F21A01E503DB7FB20614F6AD61C84AF +13C23624346FF7A14EE8C073F7FDC888D43F917B353E56BD9C6E69D82ADCDBA6 +AC5EC3523627CF71FD5302B0BEA306EAA6FDBFB2168252D4C4D345775F5AB141 +9233B18ED9373D56FA74DA7A39CB7A90FC6DF98AC03BECD64FCDC2A85041C4B3 +48E999BCE6425C6A0B26574D99AFB5F61B500F600C0E9D5835B0296420FB81DE +14310596E2C64313849B8CE782437D712F8987B3033FD2FEF0A7AA0E26D33D28 +AC6E45A65F03530ACD022F2496B9F500FB274669061791AD5862D1AC84ED0012 +FCBBEC5BDE13D2907F1593011E0F92E558DA86BCE9C464C3037E3B63A3A67B54 +A3CA185B9E87AF9D76D67D100C59BBA1B530CF0E191D013D0DE94B0F9C50ED21 +D7930F0EE3A56EBAC215B0E1C9F85BE211E9164C990E7D4B1072DF49AA02D927 +53A129CD1144A6E4F8C1D23CB2D6FC87A2240B16C9E54BA04E33201A8BEE54C2 +F8798C93FA35EB287004DF64FA5C6AC4F7274F312F6264E94F2215A39CB8F6C3 +563AF9DE8F41D67AE31B326AB9C6607FCB47652F642118977AF4BE0A5E48ED98 +68F717085F0602B309777AD2E4044E1FCAF55EDF8327AE7FBB78AA15A4AF7C51 +5D521D1C6155DF31E7C7CDEC35B5AB7956F7FD06A8FC259A4845C5BA0A293028 +BF5FEC5984BB3702AAD0096C832BB1812A49FDB0D8B4ED1A02D24E82FFD80696 +79B1D2EDEA6D1F10CBF1649320FC04CDA340CB047A276DC388BCA1E39FD11980 +B0676294E4B690D371E3B8DE6F2A6C65861A161BAFBF18900D50D8F5B802D241 +F119E63504AACF61722EC2A9199A7F3C4DB29593C4C3321C1AADB9CF077B7BDB +17E5C1842B9D58DCF916C7DD7B848CDAED357E874D9788C648775A9725973A8B +046CE0FC513437C9436D5278915F74956D7C9B33DFFFEFEEA13176D5E9C7EED8 +E9350EEE1451FFB840E5B8B23A0B065CC861A91ACC2268D2CEDE02799D369AD5 +B9BF63A092F045D25B39FE41758D342B87EFB59F6EFF26F009A5D5411424E027 +EEC7FB8DCB92B707FD2DC7A41FE17E6722BE107873749FBC39B1B02E0E926FC9 +9ABF2343B114AE78DC9987FF435B351002570D9D5A831B96A6FDECAD60B523CB +7BCC09642E31877EF538B6DA969BC71A152139CFF5C656197B0051485A3E621C +B1E9357CD5D9D067C2B0F6E1DE201534EBA84182840CBCA07564BE64BDB09A88 +5C7B39B6FC6E32A2B4F5F22A250609FD5AB034E79FB9B8CDFCF306D878975696 +79D0403D07D02D94C7836B542AA0A163406A81B4B2286A7A3342787C56A13AA5 +B9376622404830BC533CAFC715EFB19518B239ACB7E94637829E3BC6EE7B455F +16DAD8DC390637F1781CA7A11A3FDD7BD3FC9F66656E90596401B633612BEC56 +F5C727D7BD9A3C6303F409C302EFF0280DC344D432C96548A7165F3463D9EB42 +F0BBA79E2AD7C748571732FB1437454179A5F62A790FA31B49492AD4D3A30EE8 +CC221C9F501A58E97E028A15B2598D0CDDB2BBD43D80C69B69637B0CBF24A2F2 +E5841B0FAF27D855A4C22D8FD6F07821B3DD76DBCBC76CB0647E862497F022A0 +367CD77D2BDC6DC109BA966540D94F15F55BAD3C0C2D3114748540E6BE9CF5F1 +31591307B1FA1BC1608635A76845967C4AB1F3190F07C5CC085EB16291C6B8C5 +0046511F7B428757B62FA04C038DF7F2AB09173ECE9BB93293A8BA18B25087CF +20600A85099BF39E6D4E2ED40350BCC6743036D7E5AD9AC8C81C53AD3C5F9D94 +2EACAF71E3256BB90BD1D956BFEE1F7655EEE5728A90BD5C90CEF59FA7CE811A +A708FBD232A38267A6D8A3166CC04E073414B729A70BA253BEA7BC97D77B40FF +4FB239DDB790DF1CC9658004202391FC6E394875C577C1FDC0CFA3E305E5C003 +36D0DC031675AA408BF3FAB297485F413002A79249F6D5DA9825879F2467933C +91B127E329E8E6A02993E92B9DDB3BB4F93E4DB927449A29DE84474086C994E5 +4D15E4A486197F4394920F810396C9F906E8FC0AFFB54B032F3D047156B49030 +3119CC2D5504B057D86D957BA326E961501846829EEA8B847F1FFE4DB8C547D6 +396A1516CF68E589861B56C3F5B6377E22195E3FA866ECE9AA8373A84BFA3554 +553446468572F84A6C7D35059DA21546EA5D0A60A747CC0C2E6E29F1DD7ADD2C +6F756959A5DB3CA09F4134FEF64C2DE432AEBAD846EF2E84920FB3D085BAF23A +7E91F3C016F560EFA44FC34D79B0FAAE2658626F830A59DD723A391329B0134F +F6DC21AAB7FD9CBBA5BC1C625AA6C2BC7D9C12894874A24EC5A90111EEE65E02 +3892B8B22BCF79D983CC56FBF48B7D8DBB0EA0471461A14541F2830160E96B29 +6545EBB30DD19646AB2898FBE1D5962735A99046BED138D650620A35F39FDC72 +42EC7A5CCFE733DA53A6E23373FB2B49D52EC20277393128BE44EBCBB4D7C37D +E924B1F166A0C7ED01E33994FBD2004928082EF54BE02A8357C218637CBC59B3 +476265DFEA687DEFBD0E4BE9264F25F7EE02347A164E9A36B62D5E1EDCEE907F +392A1F2969F52446DA4CCEE43FA9E9BF4310B7A764B90B6FE1350D60F6F21D0D +185DCAC079FF7A45C2A60E65561514CF4928B8523C8368BB4E368AC2F7203A1C +49150748497BBA696E9DFB2FD0617EADFEC5706B4FBAB17E13CCBC9CC1FD283F +F99734D174E503AC25247D76FC76B1AD3A78DAA8AD3A0CE6A3ED326C96043B17 +BAADF2985D521A26ED378841F41FAE21C29339143F904EDC5CA27CA82B0BBC8C +647D31968E47A57322926336F7D5F69CF8CE237FA1E69108E29123A80E65C769 +90156286FE39B33353E85F540649DF392A458ECED452A6973C6D994CD728522A +FE47E7C1617B4F3233150E265FBDF30DBD9DE574D7B938BE61CCA3D275C5D76B +89B3CEFCCD927F9781320882BD26627CA7BFB69B3B76ABD9533F085254F21637 +FBAAE05DB5A50BAA63395D70821126327011E2DFD713323378F55A24DFCB2C2E +129BA5CFAB9315ED4DCE755F1A79013FE4D490F955609FBFB7DB8EC0AC6EBEF5 +DB76FC9DF8F4957F275621DEEDE9125C5B3FBD32174F4FE78C2563C0E00209CB +393B3ACEB8DE30AA20DD26B6894E316872689D5954CF95FD0E5D292F29DF1ED4 +0B0746E862F7F4D9916D82E82CFF6BFC8E2277A2E43F57D152D54C56123EC368 +B9BE0CC8BEA71A1AB5CF35C2CF7AA39AA539B56781DEAF53E245415454B530A3 +08B5C59950A279AE37A48C95EA86FF8339ABF4720AA68FD68B078B246373AF6F +E409295C5E1B6E7B733B1C1FADD4863FCE5E373B3E8439FBBF3AA45F30FBC656 +15BFFE5748E6C3B5FA9F3FAEE38263E5A5504D88A31CFA5B00E253062B681D0D +7CEFAD5B0FF85B58BD4A0509CA4B342DE63D25B935F9AB6DE5A30463DC59EFA0 +DABFCAD726EE8342A3FD62997C3A7ABC8AEBCF22DE843BB456E3987904A421DF +76D9D3337F9396D94A6A9496A4B5011C97F6D7262927238A579B29B08CEF0E72 +09C760D2B8D26D32CD36409C8866DCE819E59989530A3BCF2E374D7D0DABF73C +D365C0EB1EB94F356F72CA27BBFBB45FE5FCD2DE0B79D4E17398593B4515FF21 +618FAEBF277D59E5C5B72D6A1F6739AF3E223BA4CCB15D619C322E36AB334DFE +50F72B9217965D2DF82C4274E98CDC2753F48D1901765709ACD6E270E3F78956 +1528FD58DFDDD0D859F9DCA28306B67014263719016BC9298C4EFDBB7F4CCEC4 +E56C2D9B407F0AEA035DEDC80B4EB576AD60C5368295F6D249E74F686B8D0281 +32B91C1BD7DB446408EDAA43DA867703C9956056C700347557BF693335289143 +F70FBBBEE55DDC1571435DBE799B45B689FEDFADB3C756D67FC290A71AE1BD0F +44D918CAA1B3622247E4798F4A6D6F89F6A36B467322CA2D3B9BD3483DF80A0F +7E09D321708BAF010640A28F916E44396C0140FB96E6121FCE625F81566B06B2 +8F9516262397C4C0DD8FD22D072C28D257AE2132B7658EDC786857B9057E3759 +A27EE1E770BC0745D9BF5F0F9A2C2F457BCD31036EFAF67219B9C79981A68074 +D3EB41251AA58ADB9392B56DBF091AD17A51A291ED8FFFAB28BA0627D4A0E90B +B489573EDB53E6F150348285460928A848DB92143FCCC84F525D51F2A36D4274 +F9A543E5FA4CF3EA68A49FDC679F5961212FAEAD82BEBD924A926E9DC6BB450A +09E969D4C2DFC5723473B70C023613DA4CEA344B7233CEB3D00C6F0945EE11D7 +E0F701E2C8427FCBB0D57C4ED46424E4CFAB43A4E5AA36D1A38D3B045DD1DF64 +8B9BC4A96333CD95206F436486180F113767AE8ABBFC3D400C80ED653D7BC095 +CCE6DD2ECC53106F65E7736335AB2685D6A51A94061C4CDF3DFF06E6D879A91C +949D2C2CA8666151836E124F686FAEF0FB42859A172E2D0F8D081E1A73A5F6C6 +E61C586B43B28EB7D08ECD915CDBB1CE735C0FC08A850176DF9704DB9BF71AC6 +29D21D3374BEAE9D51C81DEB509918A6637E0E00794B05540EDA577F379B09B4 +19E10C6629A33E029ADB3A4934F05454745C6A17CC6F1359FABFB5AB53B2F910 +B5F397291E6A463A5AC971965FDA9FC053EAA894E1FE04A24F47EB19FFE67A3B +2A5DFE539C57004C2B1AC8C0A59764F91CC6E9FAD6158427F82B9E1C77F715ED +B7EC1202D698A6913D3EBCD6CEFD098076A6827DCBED5812B5F969AE9D4BA95A +F12C40519E33EF065C9C69496C2042267E20ADC4BF0C8DCCF5FFF524E5ECDF22 +B31A066015FD4A5E8DCF4C484A11E39A53C813C87CCBC147912B9EA28C535602 +B7C5D5882F4FB764EE060C3D363D5563865F67CC8EC87165A37D00DB05287364 +84EFE9A54C36D8EF6F4B86A79D79903B77469F48288261F83970F7B56CC0E6AC +60B1F2AD9BDFEE0372C4E5DA1EC2DED6D8FC0230D2875A58D127D2599954ECF6 +962CFEE9C966FD747F60F3A9E02D219BD3031B041669CED09F9DECB766806A69 +19EAD473044DD90156E552925DE0844F7B8913F83CEED2B03E27DBD811B6497F +CEFF454F02330D3F0DBB6F742FD650D8FC64BB8ECD63421002E486CCE5AD262C +E26BCA5323B70AAD8699467A1A720F87F86BA0E289E463F772CDB7894E6D7808 +BEAFE9E0A69CA4A4BCA8DF61C7260BA3658C8678CA2A3CEEDAB05599E1BEDBDE +B213CC753C946A22BD0A545590F53642F89299BACFC5F1936F9EE63388670F8D +7AFF3E514BC93BC357F1A037D0DF7A511AF561366C1BD53C203606F06ACC61A7 +9565308A39A1EAE5E9809EE7D948795EAA763B05B6027D2F597607DB8EB5B545 +EA8F935A00086D86EF34DD686E7FA152FF18766F9F680070A0FD20995B09753B +3EE773684F79D01C7F40DC742FAB74716753DE9848C0AE8E96203692C2137D2F +6889EB67827ED0FA63709951A68D9C426D3598EB0CF3F8B8AADE80C2EE0FC92F +96005CEF73FAD0BD11F23B003E7094C72C702727C315BBACA116E29F61C37B32 +D39A19D53DEAE15279C9A2FB1DF92E989B4EE2974D78738B0E39C57E44131EB7 +42F7C271EEA410273698F4C02FA17EF7A33C216FE37849737D62A9A339595F5A +1A330346B6500F33C4C37A9E1CD824B3D34947BC5FD36DBDA232559005C2B14F +C4D9B2CA6467E4BF0E835D9A29053127EC8F19B0935DC4AF2F3997C59B1BE5AD +6B4E8F50B75A501F60715783CD39DDA3616165AAF4F904680E2C01B66AE2EEDD +6DC49B5D4378F381A086E3DBDB8E6790FE69AAA2385E653928DDF995656AEC06 +61E73AE147CA437524B559D6EE05D68C1F8ECE741DD6E99C1C3F8946F9B9A002 +C534775EEA9D77A594326AA4B50C234C965BD32EC7F7E9CE813E24EA47C452D2 +E8A6F2A20B0ECFCA3209011E3328B5E458056782BB79EF56485D7E6F796E50B5 +B0E5375F09C46590A9912913F9C702E294633F5AEF12AE2AE0E279794ABE5F23 +25F777B4DAD76416CBA671CF7C295E1B539FA057681F86E6882BFCFAAE205BC5 +7C0A6D0DA33A4EDE00EB08BB3B863664BCE2E70BE0AECC9E9F7B9CD9C921324D +C88D67922DEB40A3DDC0096CE0261C3366BF374717D6761942460D115C9C3F31 +053A1D5105D6D1F8938222720E8FECCD989F95A33290CF0B48A41FE6AA8A135A +F52E439552DF6334711E9E47603D471F6F6E13C1B16BBDFF6BE2BF2EDAAB15A4 +CDE92BE381E945F8C9D3454D4B5789D1C70851934961FC16682021BB8711F61C +0A5C1E236D891EC50BC4B2BA6D8A2C6983057A10F36E52AB407E852822EE91CA +5F54DB15A878DCB322ADE1142636D912678D42A68C07719CE59360BC08ACE64D +31196B5CBA3C03F62930F8E23FCAFE7CB64E8451CAE1F29C093CC4249699654E +B64649C3AB8ECA5ECDF9B2206AE64953F20ADE3D43EDAEA9A4D041A05C5FF7D6 +C02A8BB1FB32280BFDC1794647F11C7CF83FB1E9D7C3283AB3DB8A2B8E50FA58 +59AF00AE5134AE93BB3689A9446E55D42DAF400AA41C5532BB9490C00720D309 +E279614BABCCD807F0649982B356228F2B5A7FCA0CAB90969C23B71DD27A9796 +D096B860743AF9F9734233180983C4218D5234AD1E28BB2489DE60D8CBD23D2D +A2990C3A2310091FA37B80BD6C5B963DC989042D254953EB7AE64D1C965F1ADE +3EEC885838F428458EEE082EED5DA4F267792F890BC757447327BFE0A7BD11A8 +CA512B4A118E191E4F0E9AF7CF3B2184D49A3CC5751E59CFADC9A955DAC0C0EB +2C6F9CD152E90D780EF52B1D7DE430C66CE9DD188EFEB2EB3249B6B59467AF14 +6809310C1157E226FD7C94BCF528F741F745E3940C1F1B9CEB731DE7C5BEE08E +83A157EDD5380C618336CED69A064B2B8091B5F76CF63536F17CF81AFB04A225 +DA54D3EE177EBA1B804B7949BC4B8758C584D67C821633B563D72BD9F834017A +26E32DFC18BBDB6FD96DE9BE41254E676EA376EEBA85C15AB5AB88B773978F79 +BD31844F188F4D372B1810F9DD89961A2EDB3E129C80121FD1035E619F36081E +CC276BDE9146156681A7482B0CD3A7E963BCCE935C3E69F77035C2320736930D +C935A27D293348A28937BFD30395075BE40F1C5474CBC7D65BEE830271FBCCD9 +DFAAB5567DC25D131547E4ECBE55B03EFED0E44277559DB19FAA37C164B85DE9 +432D7364145D7E5DC443E920AACB0CF6931719E08EE784B25D848AA9CFBE5539 +761F88B94C9886394A7C1D9B0AAEB8612E11FC84CD3EDC25E8485BA5690086D3 +E39C038A53184DF677721C03276C629D414067B4AB0F6E5B1AE6FBC292FF71B0 +BCAA67C86E452CED1749AC2AA1D02CBC7B5BB9C564EE1FB3B45B2DCF9E1F9B2C +D5DF634277817342C527618AC1B86BF15D4E248CE50D5EA773A118EA6A37D658 +57954885B158B4A434CAC9457756BAC356EFBA3B00E9268CBADB61DD1AF33CDF +A1DCA6B8D96757925E509DD7B0D33BE0C21045CDE0DEA92FD943B1D0E2811F62 +3F061B367DE01BDFABDF2EF3FCF0491819D25619AABADEC9965FBFAD1D58A802 +F8F253F46AB4756ADFC1B3DD64326FBE340A71021DCADEFC44743C99A9CC8575 +3B0C7F25CA9FEA918F82AA648FEC525EBB75B1AA47216050C74088FA42091BAF +3D95286800E400535A83D504A353CC016A269D13E4C74E79FDCEDC4B56905217 +9018D85ACE1B989D55731515706CF39AFF2ABBFA8489F42447E7560C3294FF60 +F58785664096508D35EB80F81A39493426F3C1C070D946C77362C925897E5D05 +21EE4B210B79B3431300CCE5EA39355FEA878857CB789D16B957E39F995CF488 +892FF7FD7CFF4AE95B5B32583AD35710EFCF4C5CAE1F96AE7BA8DEC42CD57C31 +BCD3318F0F7117FCEC41E4BFE543CCFC69D57C0149EFE6075EBC81592E534564 +C7480C20EFFCB57D3F7EFBD3952F5599A8AC376CD2BBD4EBB12B44D9D9863569 +560D2D59520DBB6A2613D3174BC810C89514E0828323A9164D20832D2C75153B +BF388B98239B4AC9751AD57C2A25C5631EE7BCE893995F10306766D483FD867B +C29386B3BFAB3C5F9A07E56C8D6D45336265078428FFEF66E957602C0A4040FC +291B8648491AF5CAEDC6D40758E436432C0BF40A93F96CF1B4E9492DE1D142C7 +47C422EAFB4AD732A345B3BFC2C615A10B59F29FD8C58B6A0CBAFE329D9178C1 +744D14FAE70E94754EC67E41B837C14AC865630F8C9CD1E9BB8E97EC953BACC5 +0B4B5B4F04C75635E2830876E2AE7D0EB0B2CFBADF5B6E41231960F37553C42F +5F5E83B41AD4A75C8296C3ED321333ACADA874EA607FC84615E06EDDBB31B456 +8593F57DBC39EB41A1C0DD4539B7933829AC1B116B8661DFE674EBE05B068D1D +C4209B86051F6B585D66AFE23A5501DEFF3EA0C229F218D861FAAE80403606ED +1310B5F1EEBA5B1B83A6A959ACDBFE22D46BE01B07B8B7FB5B0CDF1E66E2FD90 +118A192A9B1E97B5D1D9165A948744A1B960DA72AF308E496E9D5FB2EECA8119 +808ADF470941702DB7235CE46FD7CF378A3CAA8D6970B15578A12F894297E27B +7E203AF7F93D6D2B194523B2D51064A3272582712ED56A12987BE676E20BCF79 +D9A507162F330F648A4236A1283DFA6C602F87A4C1A1AF205DC57128FF70BEF2 +50039CACA401D3A9002EDAA9DC6F72CEA7B30E032AD42EAE66789C13680682DD +C3CE5D10483745E6B12E963683CD1C5B2F86884A0E59F2D04AF9DED9E822DB1F +E5F14CD13AD39ECC1E8745B05B879834A8BBAF4578686557958B2257D0B34356 +D89D751E2BBA14F3755273479DC653ED01F6052639DDA9F6CBD9A4A319357F91 +B2D2BF5292B32BE971F2EAB21C651CA38FB9BF1B7C3F3BB46536F63F61BE88B9 +F8E20A197C1B94FF572D53B4BA8EBC6898AEE82464570EEEAC49D2ED9C653877 +773B3ED7E9C597952A6379F83F4177C133A6E770435FA67EC39AF6F9BDBC5849 +A1D27E68F5540EF421A081BE87F4C3C0178A3BA6BE166BB18B669E2FBE8AD2F2 +80A1979B7356E82388B51A98243BB9D6C29B2653E104B916E6B1A90F96885ABC +5A48B448448946E274150F1AD1816CE4D56D59CF148AF178947E52FA1EBFC874 +0931E0315C5037F24F139CC9E039A184EBB036ECA2033A70D9D14DEC4EEA2B9F +A0F132F6E63CBAEB544683469D3A5866F65E13CDD80623E5499584CCE7DE8AED +A85B1F7F53567BF58497ECE9A32E7B1EFBD9FDC256D724CBB7EBFDE3924EF67B +E944CB5396696625CE74F971CA520204D8D9EDE5A440CAE121A208DD3BBB0AAC +EF332B272870F26C605DD0974DA9BA728BB155303F5C5751B9B7B1FBE515EF05 +D481B9FCD96E6F3DFBFAFE846828ACB2AE66C90C6689E66790F1D142B3D4331F +59896FA02F4588D2C4A1666D6B3E6330059159C133B5F80C1FEA6983B3A7D65E +ECB180A121C6117D53C1DAEA9E4FAD13B0B3804208F11F175593673477427338 +FE402CC01CD6D8B46908E190BF08A477D7C65B58241EA83F584490FE1D18CC18 +18503402228FF42B65ED61368C7CC198CA98A3E269EDCF1742F59528EB81FB5B +017D5F3158B2224EEC7A2C21CD2A701D834F602760229B9CF2FFC290405D7D21 +394F7CFD9D7B5413DC52B36E2AA18BC769B4DA6912B2452CDE7CF15746864CE1 +A45E9E9268822265D1380A3CA82F651F9F8584F3C75D366C6BB96A732E23E0A2 +E1E1F0E4FA87B119E547047F4341638B7D9386C0F8F2810E03A461512EDD9C61 +2EA6E18D0BB04A3CEBB75498A4D826043CA86CB57FE14A00A4FA5517850E1511 +6D7E0664F97CA7C495D01D02908BAAE8160B0B0325E73B3C85A34838979B1F42 +70EB7B0FBAA076DCCE4D1ADDDCD332F42E4FD943515FFCDF34735034F13B5803 +42F0605590B3A8A23C0D6308A621EE8837C79290F3341ED3958355F0B4927AF6 +85BCA5A62FAD45E72442F541EC9A89A9937ACD7904C9D3066E059CA6E20CCFC5 +7983FAFC88F6844C274A8F42D34F052CF6C4930E6871A4F76B573CDC48B10DD2 +5980DF5663CDD00B7701C7DC0D72A535713E6CF18EF5BE8F7D315F7393890BC2 +5A641672A904E7CB8B407E0766E104E5C4DC3DD88F6A8EB255423F0F0E73247F +C4AAA97C03F2FE4AD4D10EFF0721308C6EE85F53E0EAD35F0F64567C84D5D202 +872A60C87EEBB3B6E85AC3D20E9DB260F37BD182AB50DA996406BE0B0F579EFA +7D81AB4B77CE39120C3573941386275027D72288CC873817D6E94C7BC657EAD4 +D76DA726352C2BC7B20E357DD64B3443BC80D978B2630A2AFB2293801662BE9D +D8DF886C0A4567F351400785B66D70412EDE4B53696F345F7E62738762121BD5 +0121BF06267D8534D9D02261944143F7470A2D7D70B6C30B55A9A103406D8CCC +5813E8C3CE294AFAA420C35935BEC915ECF17C495D79A9CB8DDB75E8A1C6A525 +1B1B420AE8E0159DF7AF26D635C93953ADA11C2228E0443907EB72B805644363 +65EF866ABAFD03CFDC540D3B00CC0AF1AC1BAD7D6B16E99216B3F20A4F09C559 +055D34CC6E88532735409162A53B077C37B06CA194AFE26656F180118B1A48AD +737B56AAA87A494E9B2F34D3ACBFC61C0C9620A76C0A0AA8CDB2B2B0E28D4739 +7432829128E83DEA68D6D4DBCA1648897882C8EF4C2FC6895FBBB6A230563CB7 +AC766E4C7BCEFEB342F9A5FDE6B6846FB50DBB5EEF8C6AB4F839618106250CB8 +C0EDAF9BCEEF07FC68D3E13135DDCF20EC52D6A25E533FB9E29F84CFDE8A78D0 +B5C63AFDBA8B1C4F74FF7127C7B49241B69EB9B7B126F5C575ADFFA29B27B4E1 +716BE3FA246B6500F278919D571C81EE27AC3CF8696871796A560761D477BF2E +71690CBEF553D4AF7AF6CBA53635C89A0BA6844C308478A476A42B13DCD01DD7 +73C4B2D0DFF0C0E1FE6B36B7F091307DDE52E330DC8BFEADFAA60B9193CFD6D8 +C3C1172922D6E46FC2CDE41CD0FCD1B88D485E0FE87B9458B9247C82060D33C9 +B19A7DAE9AD65579A99EFCAD02BE6390860FFC7C4E3F96235327397361B0BE9D +7B2F2EE5D47731E86DB99ACFE39AC140AEA0EB6FED70362FAE64391914233E8B +19E23092C71ED360FBF6E445E34D8972352E5D34E11B00F027B068E431C2E8EA +68A511EDCD103577D38CD594BC86789644F3DBAF2FA1FE1E4073C29BF4E39E62 +0020FD146794CB5B6090E5BF13B02355A7689A824B564B95845E51C03048B476 +32CFFB922E878699CE93E25394EB242BD21D77CA71D28EA7B6939A37DE1DD8D6 +C1BFA07F113631DFEF0CD8ADF418EDDF1D1BC0718F554CA3351AC97DF5F6C40A +B4073F62C3E604F76770D9563F149B50DE4819D8C03077FA1E2DE8AFC505EF4B +591B5A8D761B3018D5C5DD3D26329C3AEB150A34AAF84E5E1D0590BA2A17BF5B +E36A4193D13FD446339D3C9A1D4C336846C1CA17337F014BC0F52747878BDFBE +4DC8D2B871BAA9DA59718E9FABDE91AF2467BF2A322C5D9FDCD4D90AEAF2DF56 +A4446FD1C71E9FEFDDDB6940C33EFF3D60177C9681A94EFB154B1AE000292D6D +3B6B9CDDC1982FBEFF024B195AB1066645F80DD1418A70F8CA518A219EE35AE4 +D046C9560B162713FF31F2A5619E834957CB1CE9B561215711FE48927A370F53 +06FF00FA14506E42912FCE82DF59B8E1697014E9708A2EEFD0ADA95ABC545596 +FF2DA33F77D87E10B990872423FED32E3B5623166DD0A579664A46CFD8F95E20 +E35B03760E964331ED2F7FA937F9BB078F71F31ACDE4EB5050C9F8EFF4223FE2 +5E9670292E319C371791B51C7CB90681D8302BAFB9A1DA864C0C87F694ED93CD +D46A5BAFCC9579A5019A9249CF72771FD412E735D8199A48E04103CF78468E5A +AA222D2F1C9280EF55DFA685959400282E286BB56538807F5C87B193224A889C +680E05F93BB9210653613BCE43CB292AA4BEAC36C5591B5026EDE95BA780BCD4 +62422499D61B7F2A888712264BCC0B4B8B4DD28036F4950FC9DBC7FC525F5B89 +3924EFA75F7F50423B506A5F8D46E8BD5D0C5147F2AD7C9BCF57A93F8B188D6E +0BC266CDF09C0B78D7DD79B659B4F9336B98D2CFE2A0DD15CB79D87FA528EE52 +7C5CF1E83FD5403E42DA8E753051CF34C72CF5901CFA96E2F4021EF63622CA73 +F416404FEDD730D7DD28075299514670AB74CDF77609B432E3A8ABF6CDF34BE8 +82C866F9EEA56C7D36758D27E7DA6D26A37041D7DC19A8D6FE1CDCDE1A2FE3DE +51D29AC8CE19F6885A6A8906C9F3D54224028FCBD2D34C225D7165ACE46B797C +3C8B6840895554D460F6C7CB4A4AC0B0B1A8CE7016E2CFDF56072C7CC6E0913E +E924D4CF20226948F2BB641023E9C77824CC393163794A7C34E9925AF03F9E5F +E0AE47FBBF6086BEE6ABFBB0702788A63F8C5174ABDDAE23C0FB989D53EB4AE3 +9699A447724DFE258636E6DCA1B6D7A2D434C0415967C672B1F843856F87BBB9 +666328FC7FBCD4F6D120565BBE9F15203DBDA16D0B9F44E4DC1E1FB4BE45BA00 +63891961DB1EA0E711B6A13AF3BDCE301BDD9CA172E2CAF4F5BB67A1E28BA76E +8F574B86B036D79F24CDDC1FED51604C497C55479B16319471606F74CA153356 +09060F16951F28921F61C65097DC59A8A3BEB9E47C036FEB2ADB906C4339D227 +28463D527C20044AA1251DE1563CD4C897A62693E4F1FB78888C7159A8EAD8D1 +B06779571B340F6A131E1D4911BED7BC25D6DAE32928119C9C76664E53413BFE +62711326E3A3EF13E1B62F8E84E5744807BEF8F5C7035CCC2D693585ADC56A78 +D4FE6B027F4ACB9E098B0E6418045226B5F6F2349BD0450CD1A567C7E8ABC433 +8C4C850D60FC770C33910356567198F239CEC1D061A5C0D31980C379C93768F0 +728E92AD4DFE86E9F23EF4B7435939734EC22F02B029C1D4330DB135E3B8B092 +D2616EB4AB01BB854A5281F9F2CD67F6FBA75C3E5E7F70999DDE833979C7B3B4 +BF16433EFF4E9B234A85EFAA4BAEC9C47CA9C7BEAAA6D87458CCF2E12A38CDE5 +4D4CB4F60F851689C0DED75CC8701881BE66ECE19CA9791E9959215631B19C75 +5A35F948833D1228FF297D7800FEBD3F7A2B5F039D9CC39092101603F0CE8B76 +F1EF3FB06907054ED6A67D1C9E34769D36B19A12320B1C16B30DF6CF1B17CEDF +834FD6902344BA4145D7120C94882C75E30F02D96D8D7313BAB167A8A1CD4E70 +D022F26AC307F1FF2D098C1E6D89B9228B960054248374A313AD567C902B6814 +263B20792737EA1B42A228795AEFE63EC95BD7F06EE15AC1D0355D57AAE276B5 +FF364A28929E7621BC14719A265064CF6625976210806979280850CE81F1D1B0 +363B275C7A6D6BD8D56A5DF05A4CA41184BEE1D18496C3BB96DC3386FDB41E06 +F8409B79B1971B6FD73977C36A8C0A7742E7429E389CD6EF5FE87CBC16549B93 +5D31B5DE762D3BA5DDB12664314E094CD3D1E3B854B223038B3AB373C41EFA8C +3BF4D37160927CFF10954D279B2C5AD85E6E6DD56BABB683FC01D824C546E2E7 +A7FF73A1CC6330E05D3465A34440FF5581CF574F9F335CBB0F836628117819D9 +A8E4A579141A7E47EA1001A63FCA77DA6E55219BD89C64A75BE45FACB2F2E48C +A7375404E79BC059AE2839C0FFBCC8F945678D95055046696F3F2B6D8B2D7539 +BBF07A064EFA2B75EBF04A6D780A6A496A6F25593220D413AE1E37D0A08A8713 +19D6A2500B3C6467FEE0940586E4B2C524F7C8C92924EEF47EC0ABC373DC1F43 +D3AE4879D6D4495DFEDCA0EAA8134F41D5329EAA414956F1398615D779F13AF6 +338D3255646B5BA8D9C75D24A5FA1F9B0B91EFD97236F9EA50286D83C6F1EE43 +B040FD84E62469D9CA5A946A9567D2706D33CB19BCCBFB19A9CE3CCBEFC058FD +CFE63199D28E2841B458BA5E2CC0330094594FD4BAAA432B62E6F03C114E9D89 +7929597C7A8B16EE964614972FD47CD357E32D9E7581D407EB5FA16CB0D06517 +A3C9C88B756AF52975D8F419E5FFCF778499597748EA8EB85234BCAEB1AE8D2B +BB70E887569E9FC08D981B3C76E5CEF81B0B32953B92AA61DE5EFAA5310C2F20 +5E2ABE8D48AE0230986FDBA94C8D0006C0DCA86B3CD91B979B5D68277FFB26A6 +046D331FEADDD50592D143CE3628AD080B314ABC5EFA22B58B65B629E173AEE0 +55890CEC63AE5C4ACA0594F055ED0F8400A367212541A3E6164B00AE6070499F +1538603A87CBF4606E305005EE95335C411F2B396231F1B3756CE8B6EC95595F +8C66A933F2EB729A381FD502B02470741F5F7D2909C6881697772023480FE87A +E06E7FF3C7B165B53DE3531A35AC1C8C3EEAE32F44471249DA431B381F3042C1 +3D2E9750A33CB1416738B014EEFE93664B6856ABDD56FA5757EDD96949DC870A +FDA5561452DA2B61C0126916D5B8DC5D776B6495920F8A56F9754A74A47F171A +3697C75E6DE088AC7B7D7B3E8823DBBE4B66FBC2ECD8B907B428C0A5ADD93930 +45B92D9EEF1F64D9B364B4CDAF486C96B38304CAB171686B3F07019B87120B19 +64ADBC525F2261601C7BC5B17E0A1ABD4066EE6705697AE8C0992807CA3C8489 +70A76918BBBDFC662726E201C3EFF3A4626CDA05745446493CDFDC5D6C812DD5 +8CB7D705649C363FC0B111F3A6C7C0F233F79BBAEE2793C1A55561CA16B85B93 +69F84D39B401F72A8E4FE159DA89A217CA0B413F44B7592F16EBD523353E45D9 +F6DD625A39848DC224CB982A6B9F535D4A27E0BC3B2BF8EF45657E1EFBD0EBB8 +9BFBCD6E0FF339913592F43F0841F7FF864C296DD12580F0803FEDB1DA850D00 +9A8B3868F409581D04D73D356561D2E2E8020B5F62872C45381AE760D00DE6AC +C62396DAE0585B6F0ECF75A1012A63A4D54073E2D80D3CC5743B3BD03D2B1D52 +933CD3E003F28333A88AB2F091D16424C4C9EE3BCCB901E40349C6E33858B246 +BC8788B03E7B983374A37E8618B8377E0556FC76C6C87B6B8F4763D21E00F892 +4B37190E27C266CF556A12338EE1335BC5890E9D86D1B248FB67A10C358D2DB9 +AB3FCD5288973C84880DE54D5512CE587A61933AFAB1669A0D2BDBBA85E0F8C5 +2C6D6E58871999D177C9B30AAB9CEC401EFC7BC457B8A00196D228CA0E12C709 +228419492684F9CFA0B7F764D2675B672E83A7E0F39AFC997B56C6E70A447795 +ACE4D67B2832C0689189CB6A9FDE481CD3A2CAB2BFE336B929AB0954251583C1 +72402167F089E58610DF14536C155092B6998BE9CD99736E122FD3A3FBCE1953 +EBA1ABE66038DFE8C440C98B77CF80E9CB60E3144C0D80AC23DBF8537D690162 +576A2120C201D3F2E4C38D466F7A9FF33C7A8DD9E39AB1E2DD0C044897655FC7 +6B996EEFB09D6E0536C59320F8971BB5E500970356A296220233B11E19BAB3A8 +03F82CE41B3751753C320025C53F1E6304EE6D9727FB9E61AE7D125D4F656F90 +35F8AB032DD3FDB56B3F99F7828E95DF01C1F094DECCDD3AC4CE2FECF037B4A8 +6DF94FD6738E8D487A4C76A82C223ECE7A50519E6C9CF02CB92EBE0FA1BF6BDF +8CC79E6197F8E5EDC387660068C235010232B0ABEA843D722E265DA77D67FDAF +2C0277C9BF9914C322A06EB63CF8D33CBC17C7C619A16D2A0553A2DE83192009 +E9228B7A1D17837E5F99772D0A684E50896859C1DD87B51D090AD6FC0D661F14 +9EA1EDCD97EB9200E4DDC04356EC05453DA0DB84C558C55C3B7CD0C8DE5F511F +733E0AD84D1FD19474D58338D2FC530F11FB36FC72D529B4992606CE8D623850 +20B07D3B2AC91C7538A52BBE3DF079B0AB4DCC1EA2D51E3CB6321D2F92769893 +3A7D0AAAFD015AB189C1BDC9F8AF96185865E66F633A6BD74DD553B1D1B0FB66 +89CAAE8C7D0DD7A7EDC1F49E143B5AC0851330E64239DB148910C96834F9570A +65736B1E973E0DC7B65531B9A36DC5725058C466CAA1A4EF667FC9AA5A3707C8 +4D5543F8933E3DD5E0B1B8C242CA7E8892BBF6CCD481AAA99B96522FA77C1227 +A7534D02E08FCE557A93BE74E8084CFDC916566C47CDE46989517FCCA718AF98 +7FF243F5D75FAFA39D49DD87150D8F62F91A869F12F53790D0F5818DC6842E51 +26D98AD2B3A25B04D7E19D4198B02E57444DCC86D3C62FE9E0D7129DAD344D1B +F4C1EC4C8B096311109F5EB48A5EC3F4931EA134388F2B46B99F58410BACB788 +F4470FB91C8118C2A0212D5F8A4024B3B6DCB37BD1D216056B1E8763A0669EE9 +76835BB2234E86EFE2D6E4D7D882BFCFFCF29D4C553195A130C956CBA0B0ECFD +699D14A277369E5A7A5F4C482681A23FC8C7523E4BA4BA8383994007125A06B7 +C21068BB8946DC829473503EC92C873E63B9CB8631D76365C619F110AD5EBB28 +1D690D791B69BF643559E753FEE9A611815846A2F45699BA4F1768F162ABE615 +AD05C737E64E3E0E5E2A92A030D29051F74C8D6B2BC5308820EFA5FE40279C41 +1D21332BDFEA24AF7143192D6146D9AF64BF827FB2A23F7FC66D0656A986D477 +D98F41AFDB453C3C762E1D729DB377A01E9D22EFFE6E5F39ECF66FBAE371392D +D04C813F16764D194F60629538745909675CC6B087275FEC0C6DA3970135F43B +54B3DEAACE34F3F5DE1813D6E445D15E230277B91F47DA19539DD198A9349340 +5888F8D44F26AC106E9D7D7BDD133DD32CDD56736126A4CF401252BDA1C2240A +AD1653664A317A99B117BE4840A7F8A03A329846A0B927ABD28ACBAFBAACC426 +6E78328BFC11F47BE45195B5692A4EDE6FFB01FE2AB1B2678C39EEA39C74C576 +BE5D26667013087FECF4D6E397B54EFD44FEFFCA1ED10D1CEB2093C8FF01718F +6E420C769B60BC91D4A28EAA6DF03C61869E96146CA42FEF5EC2ECAC9C2B3DE2 +E43F86CEDFB029B5455503B63766C4EF624D9A04508DDBB5C38C0DE662AB1FD3 +31EF92E1C39C8B1DF11D00A4A0908A3F6000A3A7FCF6F73C5738AB3271A5B75E +CE01D536CAE4D86FEA334727961F1AF27A454947C737B44A3F528520B60B6200 +E81554075F94FD00C4A0852F44068CD096BCA5D6D3703BB886B8B5EC9B9E3B0C +D5CEB91337B3B3A9E5173C2ACD3A3E3AB4A1B9BFAE1054640DFABD1F6B0C22BF +363CB43B26262AF3BF8DE092B180FDC6C9BF4ACDED6C3BD0F7BA3D3684EACD5B +235E557FF4CF03FB3335E7EAD0846C5753C68E510670D6DAE77E0BA5101E5C89 +A68847444E4B6CBD8A1ED036AABD5C76D7902F1CC3AAB4B7F65AF3097F9BBFCC +3D79313CDF148613C31E5DD7B1DD974EF7EA50EA012F77DC1067323AA92553C5 +DDD670D1C5CA695290DF0579EA6335F7E34EE8EEBB219B75706106A0F2554F5A +7D26D6E4A642CD3CE3580C69784E95235F5356C99909494ADF969A3DB253DE9D +EA60768AE4AEDA02B9AEC2033D7784083105148ABD3CFBC816EB988B01F652C5 +A8C74C5FDDBFA5A13FFAEC90C77D932A9C41578D7DC49B11AD98DF75E7B7304E +30BC2E8E0281B6D2FD57D00DB836384BEFBA8F517F6DDD7F9E030019F27F237D +E5DBD0DB7D3A0A8DD34842FCF33770454A12DF553220F15F8916F064CDFBF9EB +67FC0BF6BEA776851431277A23D6228F6D4A51857B72E165FAEDA87B1631CE28 +E6B0827F64FDB35CF48AEE923C80B53AFB84169EF6F1574A5643BB76B7331024 +55A7F52F64A41052134BC5AD2DC092B21B033C1C4024B03B360799368594AECD +C42D45591F9875D46D5EE20EE703F1AD1C205E45D9845AD224C7D3F0EBB66F78 +ED96C162CD2CE58B5C18BB5D7938E06A860F7211B8B38FE9B849F58F8E809489 +7C6579EFB9632A0911E28DBFA491BB655A7C2AA6A833CBE87E740D3D2C +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +{restore}if +%%EndFont +%%BeginFont: CMTI10 +%!PS-AdobeFont-1.0: CMTI10 003.002 +%%Title: CMTI10 +%Version: 003.002 +%%CreationDate: Mon Jul 13 16:17:00 2009 +%%Creator: David M. Jones +%Copyright: Copyright (c) 1997, 2009 American Mathematical Society +%Copyright: (), with Reserved Font Name CMTI10. +% This Font Software is licensed under the SIL Open Font License, Version 1.1. +% This license is in the accompanying file OFL.txt, and is also +% available with a FAQ at: http://scripts.sil.org/OFL. +%%EndComments +FontDirectory/CMTI10 known{/CMTI10 findfont dup/UniqueID known{dup +/UniqueID get 5000828 eq exch/FontType get 1 eq and}{pop false}ifelse +{save true}{false}ifelse}{false}ifelse +11 dict begin +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0 ]readonly def +/FontName /CMTI10 def +/FontBBox {-35 -250 1124 750 }readonly def +/UniqueID 5000828 def +/PaintType 0 def +/FontInfo 9 dict dup begin +/version (003.002) readonly def +/Notice (Copyright \050c\051 1997, 2009 American Mathematical Society \050\051, with Reserved Font Name CMTI10.) readonly def +/FullName (CMTI10) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle -14.04 def +/isFixedPitch false def +/UnderlinePosition -100 def +/UnderlineThickness 50 def +end readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 12 /fi put +dup 45 /hyphen put +dup 97 /a put +dup 99 /c put +dup 100 /d put +dup 101 /e put +dup 103 /g put +dup 105 /i put +dup 108 /l put +dup 109 /m put +dup 110 /n put +dup 111 /o put +dup 112 /p put +dup 114 /r put +dup 115 /s put +dup 116 /t put +dup 118 /v put +dup 120 /x put +readonly def +currentdict end +currentfile eexec +D9D66F633B846AB284BCF8B0411B772DE5CE32340DC6F28AF40857E4451976E7 +5182433CF9F333A38BD841C0D4E68BF9E012EB32A8FFB76B5816306B5EDF7C99 +8B3A16D9B4BC056662E32C7CD0123DFAEB734C7532E64BBFBF5A60336E646716 +EFB852C877F440D329172C71F1E5D59CE9473C26B8AEF7AD68EF0727B6EC2E0C +02CE8D8B07183838330C0284BD419CBDAE42B141D3D4BE492473F240CEED931D +46E9F999C5CB3235E2C6DAAA2C0169E1991BEAEA0D704BF49CEA3E98E8C2361A +4B60D020D325E4C2450F3BCF59223103D20DB6943DE1B57C5FD29DA32D34C95E +2AB2ADB3F60EEB0600C8ADE15A2380DE10AC5AAD585FBD13097B1A7E8E210D4A +EE96785449E07F0C8EBC2EC5EFBFD0897DFDC15E5BFAC9584D8DE95C5AB288CD +8AD8B9BEF0B8E5F887B3B0B331542FC8184DCCB753DB6ACEEF98B85756B988DF +CAF1AE0DBE7D37D5F44A2E760AAE3A5197C27B15E32275A64946C3E4D0476FD2 +7FDE148C788DD2106F7C825E270588AC05B57E625AB17BDD02306F9E5FC851DC +32A5A6EDC43C770A71419B2C0C8074EF3F222C8A2097CD81A91F333A521B3A09 +482A4FE1CB231CE344AD126AA284C3280AAC3AD162CF0EE241BFB4C8F20502FF +118507F5D1B5FD898571015E73E5CF2281085072E00D401F6F59761EEC3E8381 +1F26F75DB66C504AB6BABA87D121B1E7040A07AA2FE01F80DBC246CC03C4B2DC +C2A715980C52B7F96BC1A78FCC7F4F52EEED5F705E08FC1E5BBFCAD121FA88AA +8EBE58172C162AF409DBB0728F14923ED02A65EA24E5D52B6AD07777455A70A4 +61833D3789C719BA92E901232599767E423D5AD9C807670BE0E7B5CFF8256A20 +C7BF7214FFE0342809570F5966A2C43E784F35015D9040BA34FEAB6A6F089504 +3A40A9E9D711A2721D3F4998371430FB3C94BFC619559B97D49627BB630F4B70 +9D0A8FE4E916235335C3962F3CFDB04C4A3CF714DB5E260F4E66FFF2F27CEF2A +D4AA26BBCAED23B8BDC98F8F453BA27AD7758537561E766B82DC3032E92A9EB0 +125D98A22C5466AF069BF72A9BFA052A8628FEC6A6AD0B711DFFEDE3AA2D7CE8 +34EA487038EF50F953B8B4471CBA6FC3C53877EC1BC94582B1123EDF44B4056A +30F49394BDE22CDAD7F01951C7013D26979277D18EFA594E8F4F2B5E615187D9 +39E842EC28461B9ABA52020A127D2CB9002A673A435B13C10602EEFDBBA6BD49 +9DDEAB9E68D655443A5C2492BA061C1391A51592BA8C353A6F6A0708E8860184 +2B5D031D2CAB87D618E9F6F7A0BF3F66B3FD5A25BB91F7F1F5F99CFF56EFF4FF +0A35C55658001ED2E97B26C869292F6274D433A5443179DBB8EE987196306348 +3F9E87C6422AFFDD30080C9AC4EE7FE5E2DCBFEE4974331F4AAE479FD8806D4D +9C2B85FC69EB0453AD827A1E767E5C484BDFBF5C8D6E2B3C96298B390F22D757 +802643A79D5E29CF3AEDF0E12CFBECA4663444FC87F2027571DBA9ECF688BF28 +FF0DDB3AEDBA0FB28447CB4B5D5205F40C1E7A525FD7373392EEFFD910AC82D0 +98E71660A1B3227C4A2592F3E853CA4CDF64DF19A52582E167234F4036FAAAB9 +5446BE102DE2BF43E82F0112C2A20F15A3F92C6571AC761665A905362C4F8BDF +AC8705519C99862CD9C0D75113C4AB5FBB83C880E46B82715B5628890D9103AD +A2329638B95D93C4DECDC5E6C588C9D5183EE6FC28FAF9825F02DCA567306D93 +5440987A81B51EE7291107A08F201C609FEF91A8F0587E8B13D4BAF74A5A6815 +DE9E4441F46AF8E1DDDFA2D611C889614040B144A5EC064DEE4638C04EAB2E37 +4CA8F50FB8C4D65BB296DCCCD39F1F554CFBED96670A91F515CA10EF896874BC +8EF48C6447752C70FF5A06F928DB55586354076773BFF7E94C4C3A7A1C1F421B +A9B4E3936EC26E0C19BBBFC90F021E877F54B62108F6DD1C7F6D5B8E64FC9362 +E173F01BF2904B7E5A08B3543611562C2714099DE7D4FA330DB148B560A9601F +42A84452811CE213DCE782A0D7809CFD954D6BC1EBF2BA4D1B18F50FA8174C96 +3E0120E266AD5DDB40B3F6798AC28CDC5C3C4BC34583528F5B5DC8A222B80B59 +A3A93DC715D061EC6915E6E6E21A25425C25E8747C60F170D61047108826F96F +7830E220C108B441B6EA3198E33C49BAD8D43086E49F5A2BC7958A1A8CD011C4 +49045193394696EC3DDD0BE084E8F2E9F0B9496F035C0DEC1CE11409DF566428 +D50043CFF5CDD1092F6E0807E660B68163BCA738E8D98FC6EE3F713164CD204C +0BA84FFF4F33F47BC31750B448603D7ADB9AE92FA91AEBBBEC0DCD66980E6955 +CEB425ED07115B24E40F53B29B9D840842EAC691B4F591F866DF27556474B485 +1C6F53DD72499847109B16C7093984A6B8487D4F3870DD517945CD90E648C1BB +8A6861E540FCF9D75B984B5009B5CC760CBE297042C240DD624111670B703388 +6FE6FC0E89C6B4C88F51DFF3913D0CC1FB4770C8CBEADD4B86393605C0B6C468 +83CA5594754411B6FC331EF56D7CD6D247FAE42E966583C29239A8F862348D29 +60B177984B6B957E733DB4D275015691D91443BBB13C2DA96097A29733CDB284 +42F89C85A7A743338C9DD3BBC4EE53F695E5163E6E1ABE5791ABF100B198B9B2 +1C21E2FA2FB4AFE7F9BB2D381260CDD3A2CC05BF513AA1E80ED69FA27BC5ED5A +21445BF00BC2F997B356D94AF13736C6D3B0613EB6F4CD96A685FEB672661DCA +206105EDC3CA07900676EB2FAB37F48D2E8207BDE1463894DA3C5B1488AC1EE9 +D39DAF691648048F5D7A384B8927F8DA2BE3602669F71D80686E427F395134E7 +7ADCC611BA91AD4B7A0237213C60CF2C905359C90795230344FC3C50A22BD44B +55B2044792509F50F5C21F53D9F9E9F063ADBED3AB99E2613B23334FE8DF70B4 +6120F2EDF69F50BE793EE145B9FF9C73179DE640FC2ACEB5C6617F918CEEB762 +4CD81E665B2E544864D13230B058717B207D3CC5D6647D5343DB4D0356082392 +871EFFA896631A7E0D6477942B632074A9A4EF7B09D4701B1639BAAB4E03A40E +9B54A7A4F845CD63F88831EBFA4FB847847CB98F3455CB5957F2E0A0F5623645 +DBB5C5564C7F8B117D6E27E65C0F3EA81AE67B4AE4B201E7C4FB0A8364FE53F5 +41A7CE8F834C2C4B322809B353A5E63BBA7BF3B7DC1A85EA700BD287C2BD3FC8 +2832B0BB4695FC937FF5EF06FCD87DCE6DE793C2B1EE10E6450352C17726155F +220D550B1759E15AB2C1D5968E52C8080CD280E99D3CCC0E80C2EF8BBFD96001 +A226FEED7311EFB4B67F424B557A877379A15BCA54780F0CD2CCA00400B9B39D +981C6B552AFD2506D1B23618FA9AE6D8143CD7198A8482CB416CCE62B992347F +337D505A4078713BBD91E5535BD58EF0351EBDCD749CC24D4AD39F8CECD7D6C8 +139756680A4C03A58B3374CEC658D30160AE4863A3938A891BB59CBE02BB451B +1BA4B2B6E68AB61DEB85F95E3C909B8B66E220B9F18280161C279F10F7093CDC +100A53D542F071CC0A5AF834DC1D18738F5DD62A5573E884E1FFD22BD810828A +1EA47F8218C15A2E97CBC609927DA3CC2B802EA4A0D7EB57627C135E3B065905 +F97597D818A2C5CC6F328AD25AD11FA50F1E4FE637980B7474D6F85A521892FB +72989AABEBE02A2D0EFE88A6F67AC29F5D8DDFEDAAF465C439983C6B84389FF7 +A6434462BEB7B07DBE4BBA61ACD4A60C55B5C0AAE527DE381DFECA2E6BAFDC8D +310364ECB42CAFF72BA93C067B2F02D1CA7C34AE7CDC46787A0E234C8BE8A928 +7A6F3DDE0338FAD532A9886E8E3525B85DD39364AB03EC4C0DD25DC179CC1989 +1BE232E387E857C78332D834679195E10F1E7B87B7966DA3B2238F53D1E13FE2 +8F55ED6A92A750C7250C9B91E29796621E7E9520373214D7DA81B2875A986D33 +80382AFF6DE1F829F048E57664D9C4ACE91E4684A51023943A4964AB5657D610 +3A5405EFD4CFD1EBA684243E15093C9667797BB47617B66054EE02C41FFEC45C +C1BAE8AD56B00D323FCB1D2744F061FA16E161988741A319B1564E04BA210996 +4F9F02A3268CABE450D166A763F5284954564A1C86B76544C5F5ACDFE0D758DB +865A1CFCF9FE8CD5F9C3B2998C56468FD52DF8EE60C6935A3D221EAEC7714E3B +301371C7DDA0B03A2416238F2B47BAD3A2C5021C886DF51C695AF9C87A864B48 +3BB3FE0B355EED5454B59B25A0D8A1B8CBD356C24F64D9B55E16C30C011365C9 +1E0380753BA3EDC0868788D5F50B9353D0227BCEE1BE36998B2622C0759BD66B +E4444250589F9CEDE766D8B940770CB6B89503E925B35C00CBEC2873D2DC4A29 +0823FB7A3717B69A7DEDBAAECC067949932728E89BEECAA91DE3AF9BF070B9C0 +30EEFA8C0A55C8388CAA2F0515915C98E67FA095BB98967D14B0DCAFA9622E4E +2E0EBFC768D80585ACDF28D8A5C2B6EE2FE7AAF62FFB90F569F84A0903996DF0 +C1D5723366C436E4088F3E2BB9B47F9789052A71CF5C49908CDC1DDA194BFB89 +14D7E3D7D4D72A150FD6FFD8303E9DE5A97A71B808B8BDF2AE466F31BF5D7A4A +44F81230BBE2B456A221E2F72A8B59F8FEA8D31F8A005A5BD93B9F49CFDC3DCC +CE2B67090460F632271C7157BDC2F05BC2749FD562FC28682A616A52D1B67654 +DF78B7843A9EC26A7DE2EB168F874904C2915B97534B2D4D9F74A9573A771D34 +9F7BC855E8F794621BF6AD471BCC347E2DF5F620F5C209E33A4CBF1EA85AEA87 +4492A77342DD33EF615FF34037D660B713C908786D9022051B825226545827A3 +2AD1B05D654DB6E6D261B4E8AF0933AD1F0FCFC7201E1A7C1B4199F160C38676 +21ABA2DDF1CEB655B3EC3226E0B122976EEA998F7A5241F062E54AD1DFD6ED26 +47C99A439E0AE95415059179867CDD3F0FF751F3141309F40E00A6C7C28433E4 +F649BCD5DAA64177580E05C495EE7BCBCC5FBF104DAF360CC2711386655B26F9 +D349D887EEB32ADE595241560FD5924A1745A22E6A01DB9C285EF14596EBFF0F +03F36EB2E0A7C3864F819EF7B0855121292D49482F046A55CD7271FE03F02EA5 +886864D9D8EC22A68C23089EAEFFF03DED6484D8C341861EF8B6FD3C5BDF5AC8 +352DA4E13A1E30D0CB71E090E9CFB9AB2CAFD0CA7C34AE7D8E3B2EB4666834BD +9CCD1AC2108348AFEF6071796F4BB2FFA4A67ED917E76A109FA2DC2A30D744A0 +9AE653A748C1D18FB52595D84E87F1C1FB6B2F32667FE203262C66627AEFFED3 +92B23861E5EB238BB4EDCE09DAE1C65BAFC198CDD1B45D42CDF93E16BB82D35F +821E9E49067E966AFAB2AB52928F8DD6359984071FC37AA652FB834A09E5BD93 +3AFAE161140E74C6531E413E8FBBFC42BFE8A464B71EB1D8CAA93B33D7BCC3B0 +47C7EEFCD3E9FCF26FF9441DD9BDE68D77AD7251C06BBB9A2103049E8827CAF0 +F26BEF33F656A690235DEEC623CC519AFA82DE2AE16FB99F780FD7D8290DA40B +9B604AEF36B529FD184239E7D50561A07428D28E51B55546590A1AEAD4B7F2B1 +AB8C5B9022C1FA03E33F8F409B24911AB8BFCF6EF4A8E415263C789F89063E71 +C0910DC20347469380B7FC1EEB87D4CED7F4A361E58B61C91AFCABA35C03F978 +B9FB5257C31657EE48504C355CE893FE3C553274C641DBC4004F5D5B879CC5ED +D3F21F867F6DF054127067DE86189F0B59A1B90FDABCDFEE61423609D888EEFD +F4A1367129962110C651D9481CEDDB8C5C2576A59AED64E95F7ED042AEAE2F7E +81AC0C408E593DC30DCAC334EDE9EE27D932B98F040DDCD195D6155607DD2038 +970EB78221A94C52BD4F0EAC65F1FC10E5DAA93C17266F351669CAE56F42B68C +6D01E1EA03AE554D63CE76D800FDD9CFD89F80A241EAEFF7EDFA41794EA25CE7 +97BD5028464D2CD45B53834B4AEF8BF0B9E7C6ECDEACEC887E8790A47A93F668 +A9095E5FA1116A122C0E5B74E2226C654D3187C6CFD8807917820423DA3EC1DE +AA020EEEF2280C44A15209EE2F3FC1776875308CEAD38571E7BF889F287E4594 +971A83605E0B4169D4A23EE790515223DF8724054EDAD905F57918FC0BC64F96 +514B4BF7DC9BA79E763C22C977FB6146B10D26FEA1BAA7BAF21312F78D1625A7 +8E242D743471DB5821408AB786E4A7EA9D35E30E85533C617689F95758FB2C7C +392E759C299DCCE36689686DE0C4DCE32649493650BA194A6208C5EAB670B170 +3F2C70BF0EF0E3BE2FB0A79224FF4ECECD6BB3388C6D06867A0E5E3DB93C1B2F +464C23E44D3132E7D4086E3B59B1D13F49EB4772DEDF8EDC4F603217233FB7BE +C13C28648E9AA51D53F11FB896839F97AEDD8834BCA53CB0021AE91FD8E95E2E +F8A094093AF556B9639F508A401542B06821FF9DE1A745FE9AC5CACD5E8E1053 +911442FC15CA5333751ABFE2C617D38FA1DC332BFEF44AE569DC631C93EC54D6 +261583A695F5A392867A57F59B741EFCD2DCFECBC55D1EA5F2317601C9DFE9ED +D1EA466210FFA905A8F85BD58B98991BEA58DFD1CDED5C9B086D42CCE632DADA +147941917B879139E016B0DDEB8446BA017FC8EE5A354533D667B0835F5D027D +C2D580C16B80B3D05CC92C0465CAE077729F0A15B2DAFC89DCD349B3F81D0516 +C65526EB5C10E45A8A85D716EE35FB9AB201FD7C89ADE5AD925A174169DA20FB +61E96C73A143DF964C20589EF24A0FCFE6195317F2FA0D2249C0D8E649C3D9AD +FF13332EA2E4C9CD36D8443EC8F027B61CEF92C6A6B72DD4ACBACC16E429A9A3 +F5F29C1631360E32F8C1C93ACB22F810B86D2969A7480F486F62F8488BEEC74C +2C1AF13BB92BC578E8CD30BEA6BC8CB68ED730F54CED0167605FA76AD7B7E88C +7AE7688E598F91C471BD65A542E96D64B1EAF19FB4F1234308C48C2DC86E2193 +11ABDB4C6189C6F201627C693691A86DD07FF55C30FDB3F72381E09C6080FD7C +9182762E5001E30F52A216E0B71E4D2D4E2F3B20F95DF3A11FDB2D2B5B5FAA66 +C46226D5E0C77066349770514E5675550FAC9394FB27CD2C2F974F1FD58C04A3 +1EF53A8AB3B2202CCA1CEFA66228E1480A0709436C44BD3319C40CF888AE4692 +5DBBB52B15CF3A518F627F672135A24D5DB9B2EBEF04C860AECF231EBB5A3BF5 +6DCCD5E72FE4B6DD29E896691868A7DE4120AD06AC573F5608B8449B38E71CA0 +EB5CDA3F942482EA7973661170F81DC88D54DD5B92323F46F833DFA757107E9E +F62A47CC50FAA1B68ED535C3E0E1073532A05ED339C8D70B3B9864808ABACD23 +AA95E9FDA43D54C66A675FA074E0A5B8777D3C07850A09087F36852B5351F35D +8BC4DDFCA35CF29CD5E3DE118A741FAC4DED36847F2E2C6CFE08669301722D94 +376F540982958074E7F1383C409652F6C99DA39FE90B38221E75BC1ECB93ABF6 +B00F410A0C5651DB418566AB350FDA1789AFD88286AF3BCB42B98386F7BC144B +02DEB8940D20A6B3062F0C4244EABC50923390064F1D027A8BACC3DE45156E56 +4A942D1B87F1C4A76B0D4D6801AE792CCAE3009BF25368B31B6AD5476FBD3BFF +9759EF463EF5E78E10B7BF64005B2ABE0E8813950A08A1808587A98E0021D0DD +751AD515E8278F1A0759E85D8A084490BBB0F8206484AA36388B1013643D3198 +3509078847BDAE08E76FA5BF3E3A73C323CE093DCC148E3C02C2DE1E26C94D5A +40EC8308ECB02FF7DD04EC1005A2A0DC74D4E587F10A3EF349E828F69FD38962 +2F0C74D5DAB3ED6CC9F97008ACCE74C086A503948DEF1AAF58FC8BEC703CD360 +D32098A56AC776B1BD08442052A2A4EF6C8798F7CDC102AF1A2009657254762A +0793F79A39DCD6ADBAA5EC84A7ED6018BBE727E5D477893D84F157074B24C13E +8D4881C7DF8ADC13EBA0D89745EF93B7616EC5355600BB0D2B630AABA3CF2946 +AFFD0B2B724EF0F28393F2034B2E69DA5061426805353EB4D80E20739BC4C510 +6C45275B8261DCBA10DE1D104B12F46ACD230977EE7D7D1D35D2814139E38C4B +CA6937CCFA653349B1EF64A98457F7B4B5D8F2978F16ECCEF7054905863AA46E +DD524CB33459220C71E9EFA7845A3A760A507B3D3ABC525B35930B613710A13D +098832C58EBBC8B0CA6AD516E6385792C59220331D0922A1F6F838A8DE13C337 +900462F952EABBDC2EB1FBF94A66186C177501453CD3FE3582073DD86F04406B +41B6AEB440DA475E13240445D46726A6D45185D56BAB8807CEC8A8F7CE1AD149 +7CE2E1BB5DE4E5B9592241DD136479A65905FD0062C91DFF7349874BFEA5D9EA +2F610ADB9AE7757B2307A1BB9D6797D9F9C4844A59841C7C7682105E23A374BC +A91885E7410F56F60C29AB8B417E2D6092F8BB70A2DD5DEDD4BA1077D7CC62FD +EA43428C6F79C332342E15F75B08A1ED360B3511F823E75AD49BA7AE63B19238 +2AFE8FAC2715E2FDC895E95036D23127557837506A3B542B0E4651CE2B89C252 +31EE8ADC26E2C04E8E30A9CA12F066CE01953BE7867171FF6C7E834742C36C3B +58E74E4B482CB85FD4D24DB03D753F260A585D552CDC9E1941446F2F5B45FF24 +2DA4932B973139F328E7E92828B900BFD398B6F41DAA0D6861C66AA7F5E3299C +87A5925CE0E0F9E09AAE0792954A1F2C0AAA8288DEEFFE579E38A3CE8A943EB4 +55322A87C1634074EBEC25F724DC1BCC1BC10458CA6C4395659B0DB6B612C151 +557CC669D8DC37769E59A5AC6BF061C79FEE265DBB59520EB8FFEA273601D1E8 +2984B8AE31AE343F37D03E2BF97DC48AFE50BB6138C7B9F9B5E28672A37BD8F5 +8F8C98DC43DB22C6537028798198E2D3B0453ED72487267D653DD50F1BBBDA92 +833A987A95FC1F275B90B581B4BB62B6863A4CFAE37F715EDF3EA5A33679FEB6 +4847ABB4B3D170C275B9F1AC3156D731198DACE0B051674E85B758500AC9FBEE +ECC75EBBD85F8D62AAA328FB09C6526F853077AEF7EFBFC2B6A29D6D508B1E19 +EAFA4C67EEE44045B9F15B9762B3DDF5CE5C18B23A5C2F73A1F6DF7F8679AB78 +843AA41FD2A7DC02B45B729EB76C66A89F5F76E5C4A0C0563B1EC5E75D72EE35 +A7F1FC89216B60D82F6F2B8DBE85E4FF4D63712C689E696F60B52AB622C2A4F9 +37C380775EDB72638D3F81F61D8D74C76D813DDFFF35ABD9A502F2BC7FF65754 +2A8660A5A53E0CDC2E8A95B6E33CA153EB711DC796D313C8183D707D3F0E3EE8 +BA65E0FCE3F1C07F3D93F77056688B5496AE35A6BA0B59619DE78640A8C3F7D9 +7DC5E94894E1E63A7D80600B945B1CCA50F1B85F57673C6CE09EFC4E229D4635 +48AB466118D273BAF7C1B52A067A88C00EBFA7FCB378F1575BC0145F294E6F7F +8007602C6560476FA20BDB91831B22404DB1C4C167594B1216C25226D262FEC6 +F5D0DBAC4B8D743C669CFF2068CB9BCD2DAE8CD6EE1B33BBF7514C4E5EA79D46 +11AAEEA72B791C22A1822E686F3858E95A37D9CEF904EDEC7EBFB0E60995CF64 +57CF0EAAE6D4925126349DE06E101868BED82BB51E911852E6780772912570AF +CD5690C6DA70110DD9903BAA3BAD581D206571D1E57712C75D112254C7A3DC8C +892B66CA346EE682E7D910343C1CCD07465D9E49489839BEDA6174FB2E0DB935 +2D2CBA6B67ADDA1BAA6A51690A10C819692C9BD35BDC689F9DEFEA78BFE79C47 +C9CCFB3D04D20F1D3E0B73498FC0BDC50A3BA6DDB3FAB9458803BB26487C1397 +511717CA3493A7590E27B34C2E2E1BE2ED884CAFD5F7C185CD6EDA68951673D6 +384E6CD12944F86D178E73C8D78D9048A5B1E2FCB489E723F8178F842B362BC9 +F3E4D511B369670908B2C8087AA29F8B592B8AF7018311C0F12A8D45A3625096 +D4C88B19890571C60821F38310685F8DEE7A7A5D209265986F92AAF11143DC85 +F435BC210621851001B6A402E3A07D0F204A3B0D75DA3CD7FF6637D1F434B962 +F404DB3C6BC318EF517AA0836A975C5196976250B5D6B21DF528FB47181F5279 +E1EEBBA0F344D7EABE71904B5C1DB0FD07694C469085D50DF4990E294334E785 +5E5BCC4ADCD38685147CE535B23F3027AAC01A0D65AC751D9CA289B4A8906A64 +165427976FE6FD699442196B0C247C960C9086AB2E440885D2C32FFC5FC7105F +6C40A76A1968AADBBAD6F3C21FBC076F4F67DE62E1CECD38BE03720FFA886743 +846FFD2005F85371FFB9C962AE2D88586DC9DA2F98996DF8572551C3D49E1ED4 +41248FA76E07B2A5CB9C3451247F60C7AA164ED895CD6290427E828A7FB72F71 +7CC249C92A012C0FE99FC07EE7E084E190CCCB95E66A39EAFA7934598C69F04C +68B2C68DF99ADB347AB05F1905B8704A51FBF9471FB20CCD3CC87EF9FD75DDDE +125EA68997DDE4174DFA0ADA2664E7209E4EA1B460CBDFA79D033D33FA9C5075 +DB424689F927F06ADB87DF0C3F4600ADC9CDB197E41430047247E7645A0AAFFE +750AA1A154498C0B5371ADB099C1E273DE2E367DDE7ADEC2CAF9406A67585AB0 +D39F051BC556A8E569AB9EA4E69557A1DFCB8CD459403A616821AC61E35DE1E9 +2673435E5969EE48F3B9F9777E5F70C682FB7C10E6E7FAC5F5732C9EC2DEFD5F +9A28572ACC62C108861AB22894979195B88E6A08A533629295A58643F854BC9E +082F9073AC94EE08DC1CFC626DE4D341D7994178E708D4D8226897B54CC2B4DE +B37D5BEDC430404177977EEEFD7201713AC45FE927D4FBA0F2613A2FBCF890C1 +908E1DBCCD277E78E42363374E103BBD6C3DAD925A9422469648B9D8BE7391F6 +B448994EA40AF3A3EA7E6E938D0F93B9EBB4E09B5D2E8D9ABF1F4AAEE8A0A304 +EDBA6DF569ECD449FF362660B11DE8A13A71C6C8186273C7417C4572DDD8B993 +C96289B16223B271D026929B2CB9D3AB7A3511F09C6F303A7006705482E9AEF4 +FC76BC1B1FD42095857751315F5B06701E774FF08920342667E99EBBF5A19210 +9AAEDC8033E06007AA89BEFA5A1616095A8E90C999BC3EB266879EDE7D1218F1 +3CB238D180C463AAF853E315CA564247B6E029D8200B9DB7B13EAE09264A5DD1 +4A080EAEDA74C7FD21BB208FD8EBEC1D650C0AE392C67D65C1773A68F2CA313C +15FE2E4A0B6E7DA9CE391BF6D854431F0EEB550A818B6B95EFE6F72504AF5CE9 +73DC8E3326E2E57F4031688F10D1C272D41AB40B7EBA371ED357E67C31DBFDA0 +B8412EDBFBC2B6F26FD7331BC965DDFB1A4A17B72BB94338283A8D9139B9816F +D13C12E07B69E9FBD0C5FA9B1DAC2E51324695102DAAFA746D969E5F64980707 +228DA50443B2917FF685F5872D782CA265734036B7A7D75588C638AB9687D34D +D0221C0B3EB0A8DFE91598F07CE2C35E1C4E01E26D0358841EDADA02D3844B26 +C39D492C480244124F422EFE57D38DD912EC98582F05C74B4ED83BE81C363376 +B816F23D10C5C8CA831E1351F3BF914B07F638FA5712A1E05E3B751E756296C9 +2FF074FFC22CFC383804A92057155C4E43FA4990734C83257E810F3C2A62F42C +B5328A41BE80C23F49479EF84BA8D13BF3A45EC435781B9480659A4D58041190 +3DA62807723CDF1EE71EFA22BB67887DA88EB20DDC0D1A36A75C06BBA651DE67 +651BB57824E4F5264DEAA04927D2A29730B7293E08FE3FAE5FF493EDDC0F2232 +9476F3CA26707E823808329390EC9D8913AAC2D8DF2A6B5673E1A0F4E7E67C9A +D006E7DD429BCC550DF7323DAB781F82A837C83C80DDB8970CE699153576ABD7 +4BA82C753C82F19E30B853DD086DB119C48ADA56C39352E3C6B1FA232390BA3D +02482A6B845C324593FF845A572E1F026941AE3DDBFF83E8230FD5214B631EDC +69E178C52B5FB4BFF0C89B756E759147596D038850F0A468B20163093F8BADE8 +FB0F718C66D82C41A29EBEC417DE0B72C4F8E746EEEA33F2BFC0063E2514456D +6EC34CA68E1C667D47FB582C3A259AF4D0859C68AAC0E5F89CC91A1F508CE835 +E29B7860E6484F8B0D75C1635A32FDE55F119C8222A5D00D9C45930C9F5C97BE +A28EFB48BEF95ABD910E66CBC4C34AF6299A84CA55F780A013E8B3DBC4E57F2A +1EEE358D24775DEC537CEE09212EB3208E497330427706696335F03BA50BD193 +E022E668C6602731D51102FB7BBBF43A630BC428FCE711882EFE6E7739DC10BB +63B60272DE6FE4841F7728EA80F871F1648E3478DA71BF29F66FC3565AC3C632 +AEDBCCDDA048A807FCB6CC497A1CA11C6E802C1ABEC3BD80E116A648531484F1 +722E3EDA1EAF6DFF1D3CBB1759C4AEF33A300E7770B8A24F7EAD130B31A0AEF6 +26C369A8DDD409A1343BB66DB2B2F7882FD168C008D5721B3EF2DE8B56EA35D9 +2E456FCEF55927D78D20A99B96EE83A25BAD4DB679511BF4E27E552F871612C9 +6B8C2D5BAF77B648C654AE0D9E6402998E07906B58984B94987216AB9EDB2699 +E0EDFB6AD08E25F2575E1B93157F2F6A0D215ADCE1D21AFB6E4DCA3635E2D4B7 +825A4EAF8568D1A2ED4D6E8C9C6DBFC08D259001EEA83D3ED9A416435A79B56B +3F7B0AE9A5781694E22FC68152BB68409B61B9A59CC8D58CE1EA9C0DBB329554 +44E4D85F3A4BFCF8AD90771A203FEBD6EE00D118EA5833C96F1BC0CAABFE69FB +0BCC46E7A3280E16976D86722168F695FB6422734512954A97AA0BA8AF8155ED +2434100023E1FFCC504AFFEF6C2F70B1F2506E53648271DDCB82754F9775C323 +B77590E86374A9B01FD57FBDD3F3BF8D61CACB66909E6C95C81BA7B083913635 +30C7C0BB9EB7310F23D2991BC6D5CFA9A35AAD04B14CC5540A16C9BE0094A8DB +058B1DC4D5744C8F89257A04B1D8544C1405D8FA71A780E92D767A170C269668 +202ABE3126680D93532C2EB8EC3A140D604C79906C626AB0185669AF9A425CAA +465C3DD47810CBA44AD7E2BFCA99FCDA98EB641608032051AC5CC30329C28536 +F5637FC7E371BEFE11320FDB5B6530E513CB14122289CEFA88A97733E4F888D1 +23030714F61091B5ADFFE84E3505E32C347EE1D624AE666E8BC6F416F78CF6F5 +96FE5D12F574F8114C71A10596847A8BA0B03DEDB6AC72F218129B223F422908 +138A916F2605142D5EFF5F4BDA5627E59DAAE09A674B7D5BCECDD63BF5E7C119 +410A36161335A18A93891CABC830833D1FAC47B7A85BC9EA27BCE6F727E7D35B +348918F512C3BF7769C185A277BA930170AAAC6708F04F00C47251D2679DB455 +F9BB928838F148C1AFEA1C56AA779C54948B9DC0E827706834D9469825FEB644 +6AF843E71E44D0380311A3A6D9B7543A6A24B475BEB483D63BAC1B9421211570 +FF9BEA65E81FDAAF0E00A1555B0A69C8355143DA9B547BD1AED32120C58AFA09 +AC34163ACFBFE0E00D57A5ECC73E522AF84A2EE0C9655C6AE6E67BF4473CD8A7 +E7F95AB4EEB4AF83ADF597547CDE2426F200FB8824E2A826356096B962F31B98 +AB1B27FD681C1F67EC07FFEE7240F704E925E62749E2D2C7CD85C61F14B8A03A +666339793934155EB270C0C7B58AB8DF6C52B72038257BE0CDDD9B2A484DC97E +862C67F7AEE273480192980A5BCD8CCDDB87CBED18899B09B0A485FB4A1FB061 +79A918589500995F12211C3E636FD1A7F6F746A231E42C80152EE4E2C1E65FC4 +4075CD6B10A7183C711573498FC034C82A5B66EED4F921646F8A9AC989F7C655 +BC0C74049D81A3AA11FFC20CD823BBBEB6E58FED16B9AC143EF2E2981BCB5605 +71C71C8BE4112AF04B3D2D9C46F948C8E3862AAF882871C3A05CF720DB14ABBD +B0B2A5C41E35DA879B3109E31226C317CE405C2186F54D710AA503B8EC76BE1D +BABDC05B316D5382568D4938C7D462B3009A648BDC22C640CE6E891375DC26F2 +A7B36C4F4DBF909B2858AD23DB71783204AFA075488322462A92F0E6739E0A28 +486BD3BC19B3665275ABE63BA5B31936B0097A08717141505568962BBD257511 +B714C52EE8CA7A37B3C0322B7F5A5690BE2FB23AA9FB322107CA58B4CA4032BD +2026815102CD4688655FACF599739F8C10EE5890AB65B167C5FC0C8F855EF2E5 +0B3F95EDE6BED4CC277CBFD004B7D13734F605E1B929204850434638F7244B70 +176FDEDEEED09D16703108DF3041687BE3EF06ECC78CA7BD028A24676753F889 +32E2B027250023B80E514BCE566E9CAB8F8B516544EED082741972528E2D9D94 +29D8F03449066FA4412350A5549767945AF5E678BCBE884532DA8C66A612465F +4E2D1CA7353C2F7E0418E1C989026583844702D344900E05FB45FED3401FBED1 +F63830D700F1EC2F4AED4EF8D077EB9903AE3E1AEC126EF9A03AC25D5FB37CD1 +8CAD9A29B803EE39CD78AEA670E2304EFDF0B9E52537DF6BDDD44022F0C00895 +6EDCCFCCD3430853617597EFDC25E915E4F977F9910D640FB088085A96E7FB59 +3570E01A50A7D4903E01C398B5F461BF23638812C245AAE2F5DE500FD2D44E57 +336BDD4B538C081BBFDEE78D8FC75A19F204A15C2E18BBE879BEC3F675663D3B +73124D4FE6BB1AA1E6E5D6FAB878B479523CC51E4E734AA090DC70DF610CE359 +8357A2C4842AEC553871063A9127C952AC9A64FE3891CD4D0879B41CAAA2FF8B +0F4336BE27DC0C179FF91D867FAB89D05E382EC85C2DD1E1BFB4B66C6EF9AB3A +7A7FA0285EF3B67A1249BBB1493AAA17E355690753D2978D937FA5373D195D9C +9F2A3F7F6F71BB04BC47EFC7D24F11DAAFA20FEBBE5098976E8C002629C7A5D0 +4BC339B70105CEF46994F8780AB84FD47367F996418E00BE7002 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +{restore}if +%%EndFont +%%BeginFont: CMMI10 +%!PS-AdobeFont-1.0: CMMI10 003.002 +%%Title: CMMI10 +%Version: 003.002 +%%CreationDate: Mon Jul 13 16:17:00 2009 +%%Creator: David M. Jones +%Copyright: Copyright (c) 1997, 2009 American Mathematical Society +%Copyright: (), with Reserved Font Name CMMI10. +% This Font Software is licensed under the SIL Open Font License, Version 1.1. +% This license is in the accompanying file OFL.txt, and is also +% available with a FAQ at: http://scripts.sil.org/OFL. +%%EndComments +FontDirectory/CMMI10 known{/CMMI10 findfont dup/UniqueID known{dup +/UniqueID get 5087385 eq exch/FontType get 1 eq and}{pop false}ifelse +{save true}{false}ifelse}{false}ifelse +11 dict begin +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0 ]readonly def +/FontName /CMMI10 def +/FontBBox {-32 -250 1048 750 }readonly def +/UniqueID 5087385 def +/PaintType 0 def +/FontInfo 10 dict dup begin +/version (003.002) readonly def +/Notice (Copyright \050c\051 1997, 2009 American Mathematical Society \050\051, with Reserved Font Name CMMI10.) readonly def +/FullName (CMMI10) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle -14.04 def +/isFixedPitch false def +/UnderlinePosition -100 def +/UnderlineThickness 50 def +/ascent 750 def +end readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 58 /period put +readonly def +currentdict end +currentfile eexec +D9D66F633B846AB284BCF8B0411B772DE5CE3C05EF98F858322DCEA45E0874C5 +45D25FE192539D9CDA4BAA46D9C431465E6ABF4E4271F89EDED7F37BE4B31FB4 +7934F62D1F46E8671F6290D6FFF601D4937BF71C22D60FB800A15796421E3AA7 +72C500501D8B10C0093F6467C553250F7C27B2C3D893772614A846374A85BC4E +BEC0B0A89C4C161C3956ECE25274B962C854E535F418279FE26D8F83E38C5C89 +974E9A224B3CBEF90A9277AF10E0C7CAC8DC11C41DC18B814A7682E5F0248674 +11453BC81C443407AF41AF8A831A85A700CFC65E2181BCBFBC7878DFBD546AC2 +1EF6CC527FEEA044B7C8E686367E920F575AD585387358FFF41BCB212922791C +7B0BD3BED7C6D8F3D9D52D0F181CD4D164E75851D04F64309D810A0DEA1E257B +0D7633CEFE93FEF9D2FB7901453A46F8ACA007358D904E0189AE7B7221545085 +EDD3D5A3CEACD6023861F13C8A345A68115425E94B8FDCCEC1255454EC3E7A37 +404F6C00A3BCCF851B929D4FE66B6D8FD1C0C80130541609759F18EF07BCD133 +78CBC4A0D8A796A2574260C6A952CA73D9EB5C28356F5C90D1A59DC788762BFF +A1B6F0614958D09751C0DB2309406F6B4489125B31C5DD365B2F140CB5E42CEE +88BE11C7176E6BBC90D24E40956279FBDC9D89A6C4A1F4D27EC57F496602FBC4 +C854143903A53EF1188D117C49F8B6F2498B4698C25F2C5E8D8BD833206F88FC +BD5B495EB993A26B6055BD0BBA2B3DDFD462C39E022D4A1760C845EA448DED88 +98C44BAAB85CD0423E00154C4741240EB3A2290B67144A4C80C88BE3D59AD760 +E553DAC4E8BA00B06398B1D0DFE96FB89449D4AE18CE8B27AFE75D2B84EFDB44 +143FD887F8FB364D000651912E40B0BAEDDA5AD57A3BC0E411E1AD908C77DCE3 +981985F98E258A9BB3A1B845FC4A21BCC54559E51BC0E6C22F0C38540F8C9490 +88A0E23EA504FA79F8960CC9D58611C519D3ACDC63FB2FBCAE6674357D7F2285 +4BCC9F54D3DA421D744D3A341DA3B494BB526C0734E1A8FC71501745399F7683 +FD17EC3044419A88C3979FD2ABA5B0130907B145A8462AAF0A9B511D2C8A7C7F +347FF6AC057E6512902BFD2918E2CD31DE615F5D643764E900B60287670AE18F +FDE15545D8BC69591A8CBBB275AFFC9B14BD68DF0AAB32268FB84844D4DBC7BB +C591C1AC5102C50A9C7BAAA848DA88B0519F0F5F0813BF055CF0E3C86F633A04 +B779D2E8E656DB1E09A66A85FE21CA8BA5523F472A229E83F2C4E91ABA46C733 +F3C7B5775B06C97782BC225C46385BEBDC61572458EFC5CF4190AB7A9C1C92DA +29F84BAACF552089195966E3AD9E57CC914D20B6962BE80429A16D4DF1ECAA66 +36C4343FADF0B2B48F12E2EB8443C4AA29D00949255F3968617F98B8ABD4CC12 +048B838EE243A21AC808BD295195E4AE9027005F52258BFCA915C8D9AED9A2C0 +80814F79CF943FBE3594C530A22A92E11BE80FCEC1684C4F56712D5846B0749C +9B54A979B315222F209DEE72583B03093EC38F7C5B9F9BCB21DBE8EDDAE9BE8B +75ACE6B12A31083AC8348EC84D1D29D2297A266284B7E9734E207DAF59A25F4E +4AA38509E993C5394FED76E6A2F25462685C4C86C6E8CFC9863338EC1428BDFC +74616BB1BC8948B0ED4C87C15B4405F3A7796F9DB3798FFFE8BD0A94E834817B +D5E9812E308D0CC920470A6F2CD088FCB80462BF7CB3F039A7DF3DAF5B2B5355 +E083A385CD2EAF0FC181E40E96DD7E9AB9EF5C7E6866A13B8A54718E950FE097 +EF0951A357114F18CE9933D28B3A77AA71E3CE884661F13284BCED5D5FD1A86D +543E588FF473DC2CF9A4DC312500135F29C2D0174B32018C8DBD40EF9A232883 +710A1F2AB2CD11312300ACDF789A9B7B93D2035D81D1C84984D92D78A53A00C6 +EDA94B24BBAC1AD17774A4E07E6F74ABD90415965616AD540C8ECD8C3A44EE4F +7F4F6BB6238C5062D63FA59B7BF08BE93FAEA70A2AB08FBEAAF7DBF56B95FD93 +03CA406543BA6C9527D0DF01F5108D31A51778A5EB1C93F27B72B46146A353A2 +01CACBC829603B9989A87CF64528682CCBA0562A8165B185C58A5C6BB72F5E89 +500ACCAAB8ECEFBB2640E99EAEEC4EA979AA793D013D61D8ACF8784FF8D9398F +F6A252A709324FB39509F0B3A4E725E82F53543383C6765BE556CC897C758208 +AA3AD37B0406E4A79F8F0A6C1983FC73E71CD858C0DB66ED66D5D992978614EE +1EA91EBE191E082EBA1FC040AF19A2202575C2EBEB8058833E3520FA03D2F915 +85C1ED337E457B9FEEB0C6EF2735EFDA6E0D05FA641BCF698AC6B97751E8306C +4DF00A39B8581FF53DB8F8525FDB196D85950906CCB59B8EF171349AA3B567B1 +6A00819947A995FB383C3C1709C9A2C113B2E40BB832B7D4A0FBA0B16A2C455F +55809CC425C403E9668DC66BE45B71A81C332FD4DB279D22A2959962304A8F18 +085893DAC61317D24A8F198FDAB95F3B86F0AFD35047B868A9A17037A2829A02 +BAB042F75F349E197A7EED41984C2859754CAFD0251439921C248B463B516951 +2E1322C80D73F9CBCAA63A585450275AC2492E4D3FB78E800F788254DB5E610D +CF788DF5C70FF99892BCDF16133E34B24B77C8F097F546B87C603DDB8998B66E +BACB68BA27462AF54AA405682EC96D701F0D474DECD5F95CA2102DF639EB169E +D518162C2BAE45FF698B6DE15FC6E7DE48C336C40A670FD26952A6BAB09115E1 +991F0073419F2CC2A1C08BE91096936AA0C37E4ED3CCCEE235476074B8FF1125 +6BDE3701F85532D8BB64CCC927CC335281C95EA689706F0AC717DC2CF680C754 +E5EFD7FA4BB8880B2B727A964C876D4A223069D4E6001771F0E23EAD2A4BBC80 +E76675297B2EF05F52BF4E71B3EE2BE3048CF088C79540113C66AE98B2FD3CB1 +B0741A215FD070882C52765009D7D711DAA2508F19AE7DDA15229A856AC49BC3 +4DDF40814FF96500E4B9B02D412E94623C5FDCC76C0FB8E42DF56A904FE49D65 +1DA7C53901B2EA71AB658A464D3ABDE27D9DB8D9E0B48F64E61A2495AD5D8DAB +B5E72424AD017DF37964AF911BD7FA21A5EB4775DC8E95EF0C0EB856B00D89D7 +8172A1DE8530767D317B8256103E53CFB877E10686A04F5A08F8DC58D843DEBA +FD5F40597588663D103689F6EB3EB14D06E18C8078F2538B43E712DF491FC5C6 +AF639256C8C6134B64D560D8476DEA6329D995E46CC4BC78841C59E73648B47E +BFA7DE0846422F738454AE77E822A083405289247BD7C478BE4974F742CD6051 +E99FBB1D1B3FBABFEE855174734EE45E87D0AADF32B1283B911162A9955847FD +38944D70584FAA6B1A7191C5C134B73F98EB632B69E2F0C0F94156787C34C8A3 +7622A029D58F9626B74F8A8A1F3803E0BC20E0EADEB1E99B70F1BD9F980FB751 +2A842843DE42EB142A84D5D3138629AE9EAF6F3479C423E8829C8816FA6EFA27 +DCE5580E65AA9854B1C64163DC318420CD993C15BFD76A8BA1182860A6B03D6D +22B8CF43CFE6C8AB27C64842E239CAE707D3086BADDE1D7C94E3BC96319470D6 +8D26915C575CFDD03271D6BB9DE86A0EB6EEA6E768B224A626C62A9AB48A6EDB +44F70BB5AF991CDF9736D65933E81CC57A78F623F33EC9AF535F2F25FA4EEC90 +D50DB7E87F31E971A75A33A301CA6013EEC5A4E179D695B33DADF2C98364434A +42926776000B610E17524162253F6FA638D6581C18F99EA0BD1D2E24D2424ADF +C05010D08192485153DD03930C7BF45237593E484F9851E6D464FA10FECA5D9E +0C8CCC97DE029030900CDBB491C5CF226DBF903CFE7735D939C3FDF3A20B70CE +66579B28B99313FEE914E295388C7BC8E055A2E54EA3A8206D3C8F4F7C0BA5E6 +E519419FD8CE215F7B8E9BEC604A9E3FE272A0328A24E31997C8A91E0946BCF1 +6943A97CBED2AB9FC636B49828BBB8B89E0BBC2653796431224895ABA5DAC41E +1854BD9764E86147FD7624F736F40DE3B7582EDDFD15C2BDE3F22B5A54D7DF10 +B87A1301CE85CFC061689A890A321412A13314AE96DCD3EDA75035FDD8F4AB9B +897A2C68263A68457032C469987970648BA2D88B1C5375DFEAA35A917B8A952E +EE670427942AEDB3CB599C5746180E392837D371E15D860620ABDB6AA7772C40 +A5E346661673ACA530BE3D8E3FFB895E5DA3DC23B1B43C080C77F7E47847F0F3 +F3AA5CA9E4BF75FC5EBD18D19F21A7DAA3B11CABC6E4070A15F7DBC8B05EB6AA +A02EF1B078EB66D61D6AFE41DA9B36FE7EC9EF94D1EA26282A9871E2CACB3126 +2AD49C2D9B50A6E47D8F2CCAD50992D1B430979A45FD9E76182A19964BB2A1F6 +51779A2B258DC1DF4C2F3074621286831F3848AC152DDD2BA561E6586ADA88D3 +598A2CE2CD048F027CE0008B828BD915887D7785341E8305DF2346ADB76BE99F +87B02173BDC334E9221C8DF54114A6B24C1C5340299512FA6C8C51AB4C8778CE +178CEF531C6D1B5FF0A1BE8EFF767F959BD4C345C52699A29A17B2A230842BF6 +4B011217D6D24EDAC3F6D53482786F1CA33169B90ECD499407D37CE9B70DDF78 +7B7547B32952535BA9ACD1E244447AE3FCED3AF28717083CF9590A09780984D6 +AF0743C82AE4FB3E2BB2856A4153A3967A023FFC35382D6C22D84A924900B6A6 +3DDD400E6D2418DA6C27F2FA34C075C902B89EBAE658B3C9A18EEE449DA5A379 +337DE95CB7AB3F0970CF1A5D8FAD8090E495570FDFB2FBBA79244780D8035547 +C5A55BB21A2270F724BF5D442CDC5BB9F09BE0CAE59B1C2270F0BDACE698F2C5 +DE8F66BFB9634904B161F5BA2B1950048300D69BABD312D58D89C4ED527AF7BA +7DA2478EDC2CDEE3473DD8A8ED9D891CD1FC21F23013228BB3281B71FCE959BD +6F8E9059D682A7FCC5265A0620992D4FA8D78377EB34CE3ECA070EE3707239BC +98907DB0120CE42ABA32CF97127E28382BDDFD685674279F588D4F951216C355 +821361790F64C2CC720DE97E8ECB57326C43EE47367628E05769E106868B54F4 +C33C9951908DF6FC4F5ED2C7787BD8FA591BBB3E9C6C1DA94CC5E38D9B20C886 +7D237572FF46DD896A4D6163408EA6CEFAC398EE041EAE29D577E75326CA17A6 +B072D47A7B13EC441CE6DAA042ECD02134CBFA6809A435050413817193DAEB16 +A5882C8AEA44BCF36E74E9ECCDFE7E19FF5A5DD7A94E5AB4F8702C3DA7F42325 +23C808670A0490F5B373DADE40814FF9650241D3D69C91FBC5ECE728F827D9BF +C928602E05477903449E079164CA39859C4BCA60C579F490AA455F82B5050BB3 +969AFB478E0D4A257B3356EA3CD62051FCE6C6B1929CFF85BFDF166BEF658E10 +3A55E007F38EBBB248B3F0B8ED1925106B499B762E45113AE1AC9DE09644C84B +9C08034B297314EE69BC32DB6E7D7FB9913CE5AC17E7335979E9DCCE2BAB3725 +1976155551F9706A576FE0E3ADCCF72C87683291528ECB749CB0ED291966E239 +B5E3630676BD409E08F85BC1AEC9A2D4135376284A96EA24431243BD6FE8B966 +95F11A4BB53F392E0AEFEA623064FF8A7002367B0A515635CB2D2DDFB9B4A8D7 +FE721754E81BBA548848A235B91AD4E4F7DB19CCE2F61D277FC00AB956EB93BE +44AB4970CA56BF59506C94ED160FB1E25D3DF2988A532BDB787BFB8539D22986 +FDC378AC31444E63C4727FEE121A43751043849E6DCAC5B59D0FC703AAFBBFD4 +E8B7C268F21615AD02CE9DABEFA27B5FE6A6441B619539CAB1F810F1263447AA +633F5DAF483752EF1A0421740E3A811D2D2898CBF53E7F686C9223FD7235F02D +6F90D2D48CC20AB87778DE3C6FB335E0F0EC20B5DC5B65223FE117526DE2C72F +FE839DF93CB2A7D66CD900CB325F891E311BEC932F703FB4FEFA29DB8B9C88DD +375EC71B3D58C7BC59ADA91971A3BDA1ADEA629CE6CC92BD542CDDFAA7706FB2 +6CDDE2DF07E56D6741916AE8E8744339816F3E6C38062747AA9FDA2A2678A6B7 +EFEA870AA3A4D71B25EE3013EAB1DBA34401B867C7A41AE51E0421D41D3BB83C +E120C8FEABA6E5DEC53A689C21426D4BBCB68CB37568761C360E6D4E3596FB7D +F4DEC7918E58C0293D12D6DDA7E9DCDAAD7C939F55CD1BC4A228B31E9A904156 +DA6B40B08E6ACE674618B768DD681C772A3E55FE096CF949CF3B0460ABDCD891 +D17B37B355B29AB5137899C036F31DA026244FA25FB798FBE5105BDA29F46538 +D3D3AC1001A7BCECE64DE94FFE6C354166A0F97256137BDFA07F6E22A3D1D2F4 +9588DBAE95E895BC5E64DDCBBAA8D0A22C229B42CB717FC711E7E9DF793DF80B +9F14754585A3C7E17F37B32924B9F9870DA8635E3E18BD1DCD81EDF01834D9C6 +B33F23C956C2FCBFA47D84422F583459D827D1E120B97694D12F1F54D02379C0 +D288F7104F3FFCF4F76E3494F4ACBD1BE3A15543CC680924C78A473F8E311ADF +8FE00A04C6C393DE61AD3EDA5BC031E2353076A2489391B52632387CA28A7B93 +FBB065A6EF3658AE80B1ADA47E9B2539E73A71FA75645F85ED8ECC257FB4CF26 +B6C912DE9D0F9899E70BECCB934AD32CF49A093371A9F73DE6255EBC39DE1E7F +00D0CBDABD4D0383977E694890E71FBE5C376BE5F3A80C28987417504F515C50 +909F3D31178BB9B1D085BE514F71B910A9085BD6122DDC72A150BFE266920E49 +5661BCB4BAB51D6DEFE32B616963DBD989FCDD1637B294CE4E288655FBEFA1BF +7F25BBF8CF17C2D5FD161A7C2CC9CC7490D9BF15A1D35B3BFA43ADE256E88BDA +BD490D92907C57BAC408A575EC84D6AEE070148C7C9A91C03B09FDBD792E8FF0 +C0B886AAD2EDD86541E5E579359D40E3AC312ACD3D8FD49F71BD533DDF8859B1 +BAF17F1884E331DD07CEEF93B71D492AEBAADF7A263450A7A72210CE630A0D37 +BF024BDC09ACC882816B8C22C62AE38A3A8D0F6EBC2B1B2C0B8161A8B076DD5D +4B779C0788546BB4CF57332230D237856B00D79C28A7C01D11F44B7304F69075 +94B97A745DA43D1BE561372CE611C345A843834E46AD9DDB16CABCD3FA33D6F1 +F6B5C0497F5EE5400B305CDC16A7EC286AA4D45D0EEBB9DA06AC9C5294D68EC9 +E4DC3CA2B92CE8FC0526184A86EDC7AB34D67E60AC12D9CA8FD300235EC968BA +92C6FBDA47572BC5600F25249F60AD287CBDAE980E747FCBE7EE5CD323E733F0 +63553B494D3DDEB9CC1480B5C3BB79A28E419AA65B18CB297AB383419E890E2A +CE6F98C9900CCB4675280A10CF060B8D220DDA1BE55DFA65715EABCC1AFAA271 +B1F8732341613E17B231231A0D24D4D7FC198AE04D89A99C4536217769C6FBD9 +5EE24A6302F97438F7C0E311C878F674B4477A5ADA3952CDE4055AC408B8174E +86F8FB797646DFFFE0ECA25D1BAB9A9F71F3926D3D85AA63E7A8C931D71E79E0 +AF1EAC26FADE468F4FF7F3861D14C10E3BE1F9EAFD6D3A544E8108D5DAB5B180 +3950C74818BC8AF4758A108F462EF1826647A49667F5E482038C54716856D9BC +35F29922846D2148F92F943E951D7438C73D6A60459A8003174036C64E1629CD +155D47FD04B03C023AD67CD5A70C98AB556EEAB8C48169706E5B352F6505D580 +AC945171BFE62E81F8F500438AC3B64D857BA5BC54C2C4BBB237F8FA51296255 +E66A92A61FE13FDE781D393557EB72CEBAD86511035F775FAC39A0479CCD400F +226709118F887F47CC2ECC8F79816D4A945B2845F50AFD62D8C9A9BBF4739496 +9E644BC9F7B04803B7EE75A09EAE94365F6F374B4FCEB0B506C76297564B9B6B +8B812BC3A33929AA94692572B010E6210AEAA312BDFC88BF302244AB9D587A9B +919823FD01DE12438D960944D1977800FEB49E638C32E5B188B1CA033E0C37EE +A142F746367888AA119535F0CCAF7EAA461B790EB089D2D6962E28A398439BB7 +9C9943654D7A2D765B46BC0DD1F915327F369162E1BA1BA83110B93F442905E0 +523BFF5E279508A98568CD5CFD18FABBE9D17265A9081E7BF64155A2CE3C0DF7 +88D00671AD65654709589BAD7EA65BBA811387ABA5CA0BC3F66D3D48597A0D1D +2C268375DF47CCF62166262AE4840AB03BF49BE67A05EF66328EC729F03CA5FF +AD3937FC053E223303565DC771ACF32E63DFB96D5030E787961D72D02C195C66 +B48E9AF0309DC169CFE8D16E2818DA94693A18F027DEA0D916672480464F7E22 +CA6E431FE38D3FC019BDD229E064B72C545C61C6EA55984565CCA88ACB01F744 +3B4593CC8944C70F30925FB48A16342CC26D444F54CA15E5A624C4A2DAA2AEF8 +404145BBA339F2A2D6FC2F3ECE54387761CA1213C8D56FF96E37C6147CA44B84 +262EA87E7CC10D931E6B5B80D7F09813498497AA84ACB4AC69BC6C8481ED2953 +084F560D7B1CF90555E69BD2AF7C5D944E8E3506165014652462BE1BC81CA341 +E1B0725159D36DA0FFF3577D1DEBC5D91AE683FB0384 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +{restore}if +%%EndFont +%%BeginFont: CMMI12 +%!PS-AdobeFont-1.0: CMMI12 003.002 +%%Title: CMMI12 +%Version: 003.002 +%%CreationDate: Mon Jul 13 16:17:00 2009 +%%Creator: David M. Jones +%Copyright: Copyright (c) 1997, 2009 American Mathematical Society +%Copyright: (), with Reserved Font Name CMMI12. +% This Font Software is licensed under the SIL Open Font License, Version 1.1. +% This license is in the accompanying file OFL.txt, and is also +% available with a FAQ at: http://scripts.sil.org/OFL. +%%EndComments +FontDirectory/CMMI12 known{/CMMI12 findfont dup/UniqueID known{dup +/UniqueID get 5087386 eq exch/FontType get 1 eq and}{pop false}ifelse +{save true}{false}ifelse}{false}ifelse +11 dict begin +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0 ]readonly def +/FontName /CMMI12 def +/FontBBox {-31 -250 1026 750 }readonly def +/UniqueID 5087386 def +/PaintType 0 def +/FontInfo 10 dict dup begin +/version (003.002) readonly def +/Notice (Copyright \050c\051 1997, 2009 American Mathematical Society \050\051, with Reserved Font Name CMMI12.) readonly def +/FullName (CMMI12) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle -14.04 def +/isFixedPitch false def +/UnderlinePosition -100 def +/UnderlineThickness 50 def +/ascent 750 def +end readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 58 /period put +readonly def +currentdict end +currentfile eexec +D9D66F633B846AB284BCF8B0411B772DE5CE3C05EF98F858322DCEA45E0874C5 +45D25FE192539D9CDA4BAA46D9C431465E6ABF4E4271F89EDED7F37BE4B31FB4 +7934F62D1F46E8671F6290D6FFF601D4937BF71C22D60FB800A15796421E3AA7 +72C500501D8B10C0093F6467C553250F7C27B2C3D893772614A846374A85BC4E +BEC0B0A89C4C161C3956ECE25274B962C854E535F418279FE26D8F83E38C5C89 +974E9A224B3CBEF90A9277AF10E0C7CAC8DC11C41DC18B814A7682E5F0248674 +11453BC81C443407AF41AF8A831A85A700CFC65E2181BCBFBFE3573BF464E2BE +882A715BE109B49A15C32F62CF5C10257E5EA12C24F72137EB63297C28625AC3 +2274038691582D6D75FE8F895A0813982793297E49CC9B54053BA2ABD429156A +7FFCD7B19DAA44E2107720921B74185AE507AC33141819511A6AC20BC20FB541 +0B5AAEC5743673E9E39C1976D5E6EB4E4D8E2B31BEA302E5AF1B2FBCEC6D9E69 +987970648B9276232093695D55A806D87648B1749CB537E78BB08AA83A5001F7 +609CD1D17FFA1043EB3807AF0B596AF38C91A9675E2A53196FEF45849C95F7DC +182A5EC0EC4435A8A4B6E1CDBF9A5AF457564EA72BF85228EB6FD244F2511F5A +CA9B71A65D53CC06EF5F7EC3A85106139A4D312378BC22183C09A229577B793A +1B7422611C03E84BF809F46C62CE52D3AE29CE01C32B202ACDAA5B72733EB0AE +C31D7EF7BA88D2D14F85313F7A8B9B7A5B124B03AB923744D336C969E5CE304D +3AD977A46664479EDEFB69F113024E761C05FA48A54072DF9E12C2F352ACB3E6 +D04F6EEFFDE209E7FA3DA22E5B1D1409461F4286B7F4F8251B44E5CB7805762E +E129FF4A06A7458F3191926B1CAF70E32C6571AD2DC07C34FF62840896F4D200 +761B1A7FA356526D1E3AB4C542AF13623BAEB9F61B1BEEF79A9205B1FEFDAE24 +8799D516A9ACC30BC0139C63C9A0523E9D5439213B67D490C96F902958779B8F +68BD8E9FDDCE8A3A2E35877DB6C94B7612382ED8F218EB1157D2ADD090A2448D +10B99FBC9211C5629ED1C61C74FE93041E5AA03EA4AC3FFDA00C2B6E719CFAA4 +262FE17F66804A6B54D3669836EE4367D2A2991580C5564463C973CA0DA38AC6 +922716E13B4A807B50304B8826CEFEAA47C305FC07EB2AF25FA7945797237B16 +56CDE17AB0834F5C97E0CC5741B061C6FF3A8DD1A79B9A173B66A6A750538E26 +32FBC92E75BA15CFFE22A7302F47908547007402569158F62C29BA2956534FEA +7DACF1E507AC309DAE8C325F2A6023D2FBD81EF42146BFCE6A16A6310A650460 +7B07BB7647C8760FADDF0DBBCD3DA6CC4645D1732DB3A22D8B76E1D2D48E4D4A +46F4BEB80CE65F3517283A1AE08391FD1C10ED452133706BC6725AABC80107FD +754A8BA47B0281D479F052CE26A723EFFACB79B213041A536542AB334769A2BF +88505D82C498ABDD5A73EB539530F47CAC52825D16A969C8BB56D4A7F2830B8F +CB63B92B576E7BD922A4B25E634751F8A3B7C4EBAFCB373EDC8B8281B1D1371A +7844E9AD990CFF09F0D7ED73A5CF873D2D5C9E8A9923CFA31E1A4B4CCCC40760 +8B3AC8FC3C88BC08BD7407725281BB879A1A822D94997826418F1B89D303F2C0 +BE7A0102E6F529630CBF1BC5BF3E4578C164A3DDE45E62A957EF3FB7F0FBBA6B +CA1E79A1ED195B6A11CFB345B663C5E72FA55D80476F604F6C4257B51686AE25 +8F7D159FE605DDA0AC74BAA5034F29FFFD403070013C6E2D8EF6A0990D91173B +D5A3AEB98B64E412991505C3CB7C2CDE13C091FEB3DFBCAF30C4C19511102300 +135BD5D444BB55692013F52056908DFAB2ABFACE81A58423ACEC59344CEF7D4A +C5A3EFFFFF70759BC3E593D878281225060B97D1BEE6B26EED90571FEAFA1812 +1115C0EEC892F5DE6FDD68321A0B3F10A2D771B79BD85476AF6018472A499A86 +07D64CFF4550866AFE590C471C80EB12CB3A989A60BC7BED39097C12D9286E39 +14C7952C4C64820B4DE44A1827B7B0B535244E93FDB80036D6332F90F95B472D +7031E7E3819E881BD0313CFA112EB3AAE943C99C47635CCA7E34DC0306C04E5D +2E9F60FF037EB11602BE74E8E6B711392E866E3E55D988F7C856417A2B9C186D +639819B4786D039B77F8578EF63C088FF28BD08D8353031445C8498A8F445BC3 +D08923D32AC04BF3CAFEFCCC1E77EA894F4E846F47EF62D6841B8D8576FEAE8F +90044626869D04D61D64D56E8C51AF8C18D6CC3FEF3B6C4F7D56FE3260354948 +10104F69B117FB8269292579A7D52FED688C663B643D8D99F13956612271073E +1A337AED059B7A93819A28CDF01569CBEB51069D22ADAE25C47355560F402B2E +8C9900DA82B79C64497C8494F42FABE5AC41791C2010D98FB7E593C744F250DC +D837DB0EAA4F75D0016970F3AE8359878A08CF9A697A06C5EA945819151265B9 +1A12122B98F79185DF852257BB4798E7DC03712EA6ED34F6E6AE1476788DBC33 +9229FADB8D581BE1A63F596698DBD6DB98A092F67197A4FD4A50B648F2691875 +EE2495D6BB310078F516785A0CEC7EB6E8305FDBAEB1D15690409FE32DD9CFAE +DBD3866FB63EBCAAB73E3E4BE5D7F3AA44793938AAF3F8341683F0790F1D46A3 +60CE083F9BEDDA22E0639A92393960F86602216FA51E2754BC2F4CD0BDECE3D8 +FFAB7E0E49613DD4956C9A10AEA798BDA1F756C755BEC12147ADECAB0FB73B7D +203A11D84DD2AB5AA98FD38C1C2573570FD49A4924A94A106D2A7D850E793608 +FB135853E8C4204441CDBE697FD0CB330B1C3596F32D2BCBF263237EAB362D09 +DA6F531B40384DC91F30674760CA7B64BA1968F6A7FC9EBEF431A1AFC5E76D7F +2D44DCB7F61C7F6B16196B3E8B47343F572DBA8B8B21B43E35BB6B2DD5C7982D +244FD4304D254D6CCB5E8CF70E77F50812F41A988EEB3B26BF0F6F69BBA18077 +31134B5A5823D10FEF6201D045AEE7A24E0F25376E9FC66340C56C05F6CD810B +724D85CC4BB8D789834A447CBBA159565D08BA5793D8599035BB5063271518E8 +F6C50E7DCE71B1D186270DDC860C6DC0CD506010EB5B1FDF6BE47A9A18CC15D7 +D657E58BED9EECAD5CE5D49F63139A39BC52C6584BB2C3264D51BD584B40F8EA +AFCD8B83F548594386EB2B05CE803105E84931DC6E7A1398073D48E130E0D907 +CD0F1ECC3254EDF5D4DDBF44415DC9BA66C673820CDB0FDF033D59BE2B5EFCEF +01FF9D33EDC88F8D522E07F1689D024DBCD09A16A63519E1764C8630FF36058D +CFC07027E0ECDA01E0E85B166C613B22F587B4D355EB018BA93E92A36007B4DA +287FF5A91F7D8A0EDF5554ACCF45AC8066E88865C5692E63EB99CAC81367B605 +8E6C19EB98EBFE0D2D161B447B9A70CDD1122C7B78A413369016E6D8481E2AE9 +9AA97B5DD0ACC9B0820F7742CEB2F46F89F3E2092621969A88DC0156B4F941A1 +6BF1546D4B136657C47B082A8A35FE96016BAF3D9679B8C32EDDD6AE6DF3BFB5 +7854074FA019707FC22BFA82299E72ADF9A980AE29A8E2434277E58B01F6B03C +192E1E25DADD49F6E3F69799AE62B56E00B60A031BF8721DB8B2CB6D4A4C15CA +AB1FDE010AB7DC0DDED977389B101B8E53A949222FAA126656E02817DD32B0D4 +A49516CEC2B97EA7C78FD66229B044EB92F502384BCC6CCDFFF995EABE3BB7A9 +50D5D1AED861E7D3BA8D333026C673C5762712E763E59261426044583D789C67 +A606B96F97663F92BF104CE02FBFDFC521EC0D6670B7D4F85A229F51426DE912 +3B729C4A535FB7C88D0A5E78074751B58885DD6BDD2DD9E9C83F105E8CF63DDF +CA7DB39D0319CA7CC2E73F42747F007574DE25AE1538B4D493D22D0D5F0F80C6 +5F6FA3937C8391DE2F0116F81DB2DB0EF751EC838A7F85F163A6F48804E84B96 +8D715EF25B7E2A5CAECC558D80F421052A1D698F3B8452AC27E30A4E6226E3CE +084C8A83ADA0818A110923CF7AC7AD4CB92AE4ABBE0A9EC1FF935FD02774C1F7 +92A278E513012AD17722A23C55EF82E18F8847B5CCE47F4FE3EC508BA563F7B2 +AE56C94285A18DED4D432FB0CEFC05A20BC17DDF9FF919C724810A8ED7358A27 +97EC93C1A13C443A91947FE1F6F528EA7B628917FA7E554A1D7B31ED46C5ABCF +92BA57961C8876DB4041305EBB029B03D8351D5E2819FF87E97ED214D8F1CEF5 +7F7668DDE223721C0B810F4A4AC81CA4EAC86EAE546E1B15D91E626FB9A31824 +5BFF17C4E79FD56ADBF6DBF01BAF6453A81EBDCB38A5FC0FD0FF0646B3B0D199 +13E2E59A1B5CAB6DE5329BE389BA0E2A2AB55CA40B711ED746C24F1E48892E76 +6DACF7DA163CDC90CF076763008E7A899870CDED5A80758E6177BE6B93B07EB1 +5800A3BF7B9AAC3FA825CE594EF5B7546B181375FA8F37608DF17856D2F8EBD5 +6030A9E6F6BEAF224AD2AEF76D03B023E2FCB922CB8E3C6816AABB61FE6E4F83 +F21B4935102C860ECA03DBEFCA461F0E5B93E5A8D18440BCF7D1D6252A24CB6E +A64FDAC8B67C4888519AA368D9C4A8C08C7155DF5BACD75C5196C571C3C456C4 +7CE8D90215FA6EE8CDD72C48740F7F5930EC3632DB63A9C8D2DA125088C0F05A +9FC83D16B7F53163F4EB6FF372C6C3115F1E68EB35967D11126EDEDF0BF80817 +E68A698183B3EB0A207DB43786E1B9D289359D75AD5E465328CAA90E712C2962 +AE2A466173F2FF30EB535A6054BB0B875DC8552C16B49DF17CF84D98D35497BD +F55E273FCBB0C735899529A69990E09149FBD2DDE64B7FA8D50AE83925DF03C8 +0B63EA158FBABB12A028803DA4B9DD6C48C0FEC469C4E730729F4BB420D5B003 +1918B4AE9CF35CFD31E8E62A44C0484E3D00143BF1D330235E821E5CFEAB4D31 +7CB4604DB1F310457FCF9075A3527279644D908DE847CCD00B6F50DBDEF91D3E +38238CAF550FDCABA2C3A46237218DCC5A09AFAF69997E1EBDA7EFE6FC99ECC8 +5D4AFD5EE35FE2346BE79B499EC8EC436868154A947D13BC02C780EBA4B9E64F +3026F1BF5DC1F8D64FEA1281EA40B4BC355638A3A59BD9055BCBB232FA45EA0B +B405131B64F105814019BC55466EE78E9E9ABB62DB30EA452F7EFD7196C76A85 +15B2CFCD89922CADC0F392B0C54A231F3999AEFB53C24EB0C63B0C8A1A1ABB6B +AAB2F93E5ECC7AB90EADA320E918106BAAFC1F8C425C617639984629018BA674 +6FF4F338AC43E23BC3740542911C058D43A49A11CB3A0CC8E3088BB5BA6048D6 +CC2AD250DE956BFBE83BB24C945C20D9C22E7105983F284EF478F9B68BFB0322 +EEB7D62802CBAAEFF1C2332159DCC7243EA40CE15C734EA905E04C476B178B82 +A08ABCB0B86A7330C75E62EE7844C9E22DDB013ADDF20AFE08122EE1B930A81D +806A0F8CC584CB7FF5F56F9B35E5FF78FD93E7E4A40C64537464EAA275FE88F4 +461FC6A467C8A69B9A9FBC10D44AC1B753D313A8E7D97F5FAEB60F82855658D1 +4DCEE043C8FCDFD8A29DD091F3BA55874A458B2B8989F35055C72FC411382361 +9AADC717E602B48D7C9521D3971A6F7EB19D539445DDE9EFBC5B58FA9E5E426C +172C45CDA24985FC4632287FC3B15849DEB56F5A061993AB10A6BC59868534E6 +69888175053108B77E4978D971B4EC57224C0F93EEA4C15AE92254140A94704E +ED5666FC06C5341F643F779CC88A9E81891565C63B6F7F6286E664F4E0A48690 +356DC96F1B98026C563700772485B83BFA06435D4E0793EF822F423C93FBACA0 +E5D889D2B76771C6F0EE997A5DB43C2F6921132890406E3C33F6F159B14C5D78 +7C151BDFFDD02B697315F191B5490073EB418A4FF2A398C68D44F0CD1B87CF9C +B52F12728B72F94D752D23151196A256908135C87991E508B8906CE2539DCA8A +31F86809C8C6C18A09F6129BD7CDC6B37E76B648788056851F22BD3E3B5772FF +EC01D822B57FFDB3BAE624F05531292641FD6A7E3666152D18F6C653048DD7D7 +98A942C840C4A0FA662F260B21C64214152BB86F03662A330109C5AC0A5EBA30 +C6201F558858130703DF76AF4FBBEE069BDE45C0D9467077D85FFED4F9BA9C61 +AED87D67CDCA453A6528AC5BA153E1039D9CCC556CEA5CBB542265FF54A1B208 +E0E13740E7E7C26AA00AEE909F8F3ADC2726081A744D8EF6BB711BF5F611A900 +76F91C26A338DA13A7160A9F42410CCEB3190000D963D036FDA05A29F598EF40 +8FAE6F8E7E6F50C99C3304A573501C13A00023085F057DF331E3354CBE65D573 +CAE73BF15B3B96B502E0AAF2B4A86237E98A997AAEFFF4227D5A26E8972C48E7 +761F430733E6EF8AB2D903C17FAFBFA21C25F8A0AC157D397BF3CC1AE7598F0A +2BE4FB46B29443CE57F41FD5F91122E9D86F903E94D5B55E2BB95949C156D138 +89883BEFD634311F9280C7F028DCA6408D3A682DF5B55B9F7ABF08F019190F60 +D39E4F0E80F0594235B09A5320109638B938633A2C196E4ED2B43DCD8643C3CF +C6123B076B7F73352F906D96FDE0FBF50CCCA432712C574D5857838BAC30B485 +D25024EB254A7EFE57D1DF0892C275CDB3DF77602F0FED0FAEBC644BCACA04B8 +B424DB125E487794CAB36E01B5E1A26F5E1E97A739AA36D77A12F5B45338EB39 +AF36CEBDED55DCBFCF497FD475FC6BAB5530AD6153C6BD982564EE8712185F1F +D5EA7ADF4104661168A01994C1FD773A50C8AD6A3E4D332E4D59521BB8BBC6C3 +866EB4AC3EA4532477E6CBF6BBF0860031C3B916AA25E3492670EA67F55CF4FD +207C684A0DDB6F4AD21B2909CBA71BCE2E762012B0927BA72367A6AE0AF87F73 +756C9BC85E4EDE35317E2CCCD138C02C7A8013AFDC1A48C3A4BB8EF257BDEEA7 +60E012F54D12D31D18DC59D5E526F12567B8688B4B67E16B56713870300016BD +A3B9DA87FDC865246AF8E94316799110D86B1DDADB8A673402D4226C519C058A +1D1E5A5778584FC28AF12819B1924060BC4F54B1054EA6AB0149E04B8C4302D4 +A56D8A347EB5D3D2A0E12CF7E35059BDB53D9FF6BD25F6D9619BC4669CFC1048 +C6C9978B8751B840F27D82A69075832BE59F55C1737CBB1220FB8FF691FDBDF3 +03BD7D225A9372AC221C38245E48320E1CCF898D9EEDD678E5B8C65B7F588321 +1A3953EEB9B39EA9A8CB72DB08C3E9234DFFF5FDF9DF804C021D57E97DA7622B +97F4CB6E0EB640E0DC9EA15C5193F92A3A7565F4C7A4C9CC327F7CD2C44900AE +D9E76FFE62FC37FA376E77131B566AE67C3E09DA80F198BBB995EE8FA47EEDB8 +4B467C6C7DB8AEA745CF8C56B8BE56534E9C56FCB2B7006426DFE93D728FA4CF +94F131C549814E54ECE7C914C5FE8E4961D3437CE7475D03534B62650F551D97 +201C794AA877445DBEB11C85ADF6119B05360700F8CEDE4766E3A1D7A35CDDC7 +9ABF7C619E3868A39D1852DBE1EEAF5D7898C78323873AC005542B68C43C5000 +CC58F675EB595F87C879694751494676465891E8A897158B481F11A171CCBBD7 +29603F00210CFD7FF31FE3D273933ECC34AFBCC4108D9B76D9ECE63EA06CF939 +4799092A54A749DACB82C1424E9879672C8BC084C360014C9C1B6D5D65C68AED +66CE329C3AD712C0A36BE7EF03FDF339CAA2E0336D387A693B1DFAB5D5164E31 +14755A158168962C9B399F8F1DF3FF5060D7464D5071058C30C572A2BC7DEE53 +84BD7614A4BEC4C84E18CF7EC81C811724463BD46CECA5FB57B0F55EAE20CC74 +6AD815D1897B037C197D2456797B992C20C70B663BF99FE28C513B4E221C8E12 +49779F8C0AE8517048ADDF7CDF0D698E3EFE60071C4997B7F5EF12B6CB65390C +224F13FBB99FFC034C0710F05019899689B6D3350BBA65C7CE7C2AB03D81B9A5 +5F3D65E4D462DAB189006669F7390A78A1B8908A4C913B15DB8827DFF15BB9A4 +A6037DDB643103B937257A7DAB025F09D53FBBC2BCB6B0BCD8D56B2B2784E498 +1F6CF8470DCC892AD0CFE11578718948BABF9C1427084643B66BB9181094E29D +5FBE37708E1D8A6B7518A96876844CB66954227A7A6AF28DD075A462526DD5D6 +40EECC56FA366106E55C7068997B54B7F0D03AC1AD45D28C67C7ECA99DBEDB1C +E18A79C353113E2E05B837E703278B202112B1C69E42A69D64B62F0E7D8F7E5B +C1F93F0F99EC20EF312046F4B0CD7DAB31E422070B629A7FA96583CF3F1519CD +CF08806F40ACD7BB5C960F21E9DA7FB3C72CBA0801ADE83DF738A4EC94F2977D +2B95A166BA4AE28CAD1E37FBBF49D342CDB4DF615E2C5F3076313AC517C350DE +710F5D52DE31DF69864D29DABF14234DF13904BA4333B0D714EEA55CDD79DE45 +FF5D64259C877191547076B1C7684CD252C0337BD9DF66CDC5DBAA4F3102F2E8 +FE48385C55727B80D11F3BE0B7568AA9356FB2B180A6B1392D620DED02F0B736 +5F4399FB9D32DFBC8ED942AD311C82250DA8BFE98D65 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +{restore}if +%%EndFont +%%BeginFont: CMSY10 +%!PS-AdobeFont-1.0: CMSY10 003.002 +%%Title: CMSY10 +%Version: 003.002 +%%CreationDate: Mon Jul 13 16:17:00 2009 +%%Creator: David M. Jones +%Copyright: Copyright (c) 1997, 2009 American Mathematical Society +%Copyright: (), with Reserved Font Name CMSY10. +% This Font Software is licensed under the SIL Open Font License, Version 1.1. +% This license is in the accompanying file OFL.txt, and is also +% available with a FAQ at: http://scripts.sil.org/OFL. +%%EndComments +FontDirectory/CMSY10 known{/CMSY10 findfont dup/UniqueID known{dup +/UniqueID get 5096651 eq exch/FontType get 1 eq and}{pop false}ifelse +{save true}{false}ifelse}{false}ifelse +11 dict begin +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0 ]readonly def +/FontName /CMSY10 def +/FontBBox {-29 -960 1116 775 }readonly def +/UniqueID 5096651 def +/PaintType 0 def +/FontInfo 9 dict dup begin +/version (003.002) readonly def +/Notice (Copyright \050c\051 1997, 2009 American Mathematical Society \050\051, with Reserved Font Name CMSY10.) readonly def +/FullName (CMSY10) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle -14.04 def +/isFixedPitch false def +/UnderlinePosition -100 def +/UnderlineThickness 50 def +end readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 0 /minus put +dup 13 /circlecopyrt put +dup 15 /bullet put +dup 33 /arrowright put +dup 55 /mapsto put +readonly def +currentdict end +currentfile eexec +D9D66F633B846AB284BCF8B0411B772DE5CD06DFE1BE899059C588357426D7A0 +7B684C079A47D271426064AD18CB9750D8A986D1D67C1B2AEEF8CE785CC19C81 +DE96489F740045C5E342F02DA1C9F9F3C167651E646F1A67CF379789E311EF91 +511D0F605B045B279357D6FC8537C233E7AEE6A4FDBE73E75A39EB206D20A6F6 +1021961B748D419EBEEB028B592124E174CA595C108E12725B9875544955CFFD +028B698EF742BC8C19F979E35B8E99CADDDDC89CC6C59733F2A24BC3AF36AD86 +1319147A4A219ECB92D0D9F6228B51A97C29547000FCC8A581BE543D73F1FED4 +3D08C53693138003C01E1D216B185179E1856E2A05AA6C66AABB68B7E4409021 +91AA9D8E4C5FBBDA55F1BB6BC679EABA06BE9795DB920A6343CE934B04D75DF2 +E0C30B8FD2E475FE0D66D4AA65821864C7DD6AC9939A04094EEA832EAD33DB7A +11EE8D595FB0E543D0E80D31D584B97879B3C7B4A85CC6358A41342D70AD0B97 +C14123421FE8A7D131FB0D03900B392FDA0ABAFC25E946D2251F150EC595E857 +D17AE424DB76B431366086F377B2A0EEFD3909E3FA35E51886FC318989C1EF20 +B6F5990F1D39C22127F0A47BC8461F3AFDF87D9BDA4B6C1D1CFD7513F1E3C3D3 +93BEF764AA832316343F9FE869A720E4AA87AE76FA87A833BBC5892DE05B867F +10FA225E233BCFA9BB51F46A6DF22ADCEACC01C3CD1F54C9AEFA25E92EFAC00D +7E2BA427C25483BA42A199F4D2E43DFCE79A7156F7417ACF78E41FCA91E6C9EF +B933450D851B73A6AB6AEA7EE4C710CB5C14270D1674FA334686653793FCB31B +491E870D3C2BC654D2C1DE463EC9BA29D7371AA1078800EF93D3F66263A2EBBB +F5723697BF7448BD0D2E301544BECF497FD475B85DFEF52AF4F8F8BE445CABE6 +019318806D10C5952157FF8F8286C1EE701545C8F60EFA854EAE66835A2046A6 +915D395F1E0366EFE0C0391583FE001FF16D82A2E2DA5F57754A2C6F69306E36 +356ECF8EFC3F1188AD6FCD2427E0580C97A5B69B4E0E09B85EEDE142F5ADD2F0 +5DE51D6DB72B127412A0D57106C19CA493048A4F815129ABE767D51715B1515D +9C21067CB5BC88741B7298C83EAE36A866DFA87D8981F179B1C31292F56BBB64 +3C430779468AAF07C8A8B4934E1E775FE3F35186BD1FA6EE3689C1C750678AF1 +FBF9B23195A124C5C991FE670AC0C86FD39D2B07B9A319E74EFD498B45820252 +720ECDF7294F7B0B137CEB86D33BFCEB8606985A3260FD669E461C8BE94216C5 +D434FD8854F44EE66E5A289A9F9E32BC36AF645D53F96652602BAED418C8D726 +BD04A1B4617551FE4DEF54083D414F7DCE004E6BB2DC9C2EF7CE232B254BA2C5 +7DCBD36C2072ED46FF711F121A701E2284BF1B718B3164382B8F453D68FA0377 +DFE106503B8401D4DB87F5402A3AC9A442FA060B0610A9524D530C7157C26B56 +AC970FCC1D5655FFFFA39246E6420CF97D08ADFB7B05822679BD40C638DDF0E7 +A97BFE8918B611A145AC965C203F1428812F9D340AF499B3A915B22BE798594E +0F520109FC81E452180AE45B170FF999C5FC2761C6CECD8742A5A6FC97F16743 +AD4EFCC6572A6D3F3E4E330C5CB2FF6FEA48A5B64DD3DBE943BD9918D4A18E18 +CBCF598AEFBB6AB3CD2CBC9BFD6099272F6543F3E532E0E21E614BD2880B1023 +0AC234CB705827BF016DB84E00E8C255FDEFA0101A842929540B7B4AA8A089BD +5EFF05B72356B6BC3727817823B5CDBB1B963103000D7F2A4E2A1472FC3E614B +5CBCB6D6D784023173DEFEBFA8F9ED87EC1A0A9EE98CA59CFC964CF943DC683F +E9E00DA718C4425A705A69D99988EC6F152525C790912C2E46A2381A569424AB +54DF4798BC2D7E7A361E7991641D4B756CE2A7FF4A2848927092C59C2C4B8809 +E13AB84FB6B111E680D7FB9F2FFC2C5C66B0B501E4447C2E46C10E2F6124476F +A140C404CFE2DC9E0199BF61E035CEB481D438139A9630934E541D261FFD2906 +4CAD99E20655FA746AFB81EDBB5601F5FD6B1D6832A01D585E2C55053F6A7378 +4DAACCAC7608DBDADAAE732D66B3E7F87E79756337C1A961E53A4651BE7C77F4 +038B89C87F650C54A2A90EB7F1D525BB353F33318551EE8D84A6A83C718EA5A4 +B2AC0F7306B1E095819B87015A90CA3ED739B09061782C28CDB36BA4BD5E5308 +5CBB70414E4112193DAC4A1FA30996327230D1E021F3CD8115E12D239D93FFDC +B645910EB29E40D830E7BAF2DB255FD7C4E776557BB38157917D993EAC245837 +A3B515147043574157B8342D829C7228CCEA843ABC89D1785A9672A5923FC4CD +2F3FF27E6FCACF84E2D3136CA2C0FD3EF1EE7354CD04C38B5FB874553646ED2D +CEDF7E362EADD04B18051F20A8FB0DE18E152385B9D05F98A3A7EF177824E246 +455ABE69E2F700EB78185CCFC07E3B4C6FA301112528D977367D30D0D5D59EDE +FAEB706DDC970A9E296236C725B2B55B09B9C336B8E23CBA5FB8692D56F33B03 +16294E5FC7FAA42E96395A57CE51CA8DDD77442F142E2E576B778373FB31C81C +16840BB422CA827E30A81829648BDF1CA36700EA32AD888D097C1FE0A05B2D9F +483AEE40269DF09AF0D1AD3DF80C45DDC59C2A03FBB661C79B87853737C6D352 +67626B657321B16198DBD6DB98A092F17878AE4698121E1006E53D6F9B0A3BE2 +3FB68828EF854A0CDBAA68B37ABCA6AD4A3D809AAF0BAB1697A81FE59C98C472 +1E33CD70A75A22C249DD11D76C2575ED3370A25892A16D2FD569CDA70C130770 +93F493C7D47D6F9A5424A7A542BAD726BFC3AB225DCEBBE6AC4BE006F8C7C0EA +051424B08305BF2D951AB2986AAFEA04E078CA79B399585BFF0F1ADCED02E15B +8765EB6BF6A8E4D0901EFF2C3AA104924EAD9637A35D877E0C51A3C37DA78CD4 +8643C8CE6DCDDE3F116A6C2390F948E5371BEB5AD2E87B41C5F01FB5C196C436 +6E256A88D082E3F46E4EFFBF605B2EFF1E9D9AD5EE4DDC323A137CD9451EDEE0 +06F7D82898D71FAF2362C0FCF1F726F97F820305B7CE20728CA08C63575083A7 +84BA28B7DE2B916432475510E274C12FFD1660A717F51DACFDF0A102D85224E0 +D6DB607BB72569ABB8A7BC6A10354CBBC01732EFE35B72062DF269CB25EA3DE6 +DC603B04C90C5912D2C38D7A5ACDCDD3F6F116D884F0D8C528F69D5D47BA20DB +0A9E585C7D8CC3C324FE8A1DF150279F7E8FB43BDB720E624E5E9918032C02CD +8020636AE5C38DA2484B7F4B34163E0D0A561B43B80E97746DC05C871AB620EC +C5D47101ECED4A7E25F291184BEF8B80024AA7BB456C1B83A907652B331DEA34 +754226C39C6889EBEEFDAD081E01EF8FE47751987667836FDE4C8BB8A3FD4406 +1E643B4EA37BD370734D1A2DB17C2F4B74B4ED75098B433601F75A88C9A37A05 +CCB157EF6E32023BFA33973F3E655A4D58289136996FCFA61EEABD70791B6523 +1FF5DE71AB8A17038923118A5EED8D59C4C58D246FFA9BB26472346B40C8741F +153D19CAFF20DD2A86C6DB89154A630FB1761929FC3F0448EE2F089C1C953E02 +905BA8DE75D101A982A611056C4B237596C10951DD98BAB838B742D3CF7DE718 +617DB72E5268583223E37E029D1C8FD3F1D21690151F76B76C52C725CA135CA2 +8666553E863CE188BFC9B99AF56AC2DB5BFEBEB12FB563D00244EB89E478657A +98AF2E1223C1ABC25A4500E8119B86EB3C26B8A2F3505A3E5610F89B7C34E278 +53FA0A54A7F46D84A35EFEC36AE660A9E3C37EE3864106702DE5AF6C45ABF64B +888A4A51323138CE77DB935576FE6B4824B6942DF80625098CE1B5B32B234F1D +052A9D6039697118A9D793793775D8729D8574A2E74D7109C7B7E23BC5E2E87A +CA8E019203952A4892544E1AD3D4EDD22971611358AB230E9A2ABDF00A288501 +A01B67C42B33F6B78C39562DB50F4663B922D9BE0D8A150311AE44B83C1F129F +07337323E9A23211EE58E16043E127C6F9574019179F5635648A011266677B56 +B5D0201A4E1470B952A1579B57AB2329CD4C615395023C653F784D36B5EE3672 +10D191F29EA508CE84763CA4CE7C2C5229E38E241255A5CABCD6C7CBAED901A2 +CA53B5E24111921CDDF83578D33D463D70EDACA0E470D8F592303FB6BFD68B4D +3F3BE2D7C5EC8BBF10C90111A33E205F2649B56E8443F6FAA6C721C66575AE12 +D4C40F1F46CF9E9DA675AB5D5840D938780CD9E4AD6736ECBEB6A4397613586F +849B51048AC5F9405E03E14540A5E5582F61CDCDB57EDDF95A8C6705F433EE16 +648F098C03DED8A2AD94AE3DE202D629B9422ABB031318D48F2C85F9DBFA17BE +84708AA3B6C9F81F4508F7A5CB7B6646AB8722ECF817877B77D473F577556DAA +2BA0ABACFCF5DEA7498C47328E873019A956FBB250FD9D8885D21D368FA70CBD +2709D2DA44EE7A9869963EAB48789541906DE49FAE785ECE1F18A22C7E7ED204 +9768896B78E9EB7A2BD6EEC1B26083940656ECD689D92942CC8AF05CBF82AED0 +B45A7DF4DD7AA6526FB597322560B9ED3087A65B5EEF1371C328A021411BFE3B +D9B5088B2F1AAE381FFED52D2D1E02CD0DA78683E3B06171CBE94BE9760005D7 +135893D7CC2DB097F6AC664D9594CF1C650F84DA80D2EDE04802DBA33CE3DAFE +EB7A37E8AEFA4FDA6252FF21E8673DD98E67124D5DBC7BACF361E57077B71939 +C1D1FB923E4E35C075CD1BCBE0E80DAEA1320D55B43EAB45D9B26C366B278782 +7519FDC482D98839BF0DF2E7C3A56A1C1A3FC0E57A75CA414F6536C1FE8EB7A0 +4ADFEE3BEDA0F53BE8CF5F64230784A797133E8CD46BCCB3BF38BCE38A73CCE2 +9E073ADE792F7128231DDD1F63E6156ADB2609C200837C2E8A2D93D2A7BC9171 +050C709A71E44E32B1B03C92EB5CF1D3BAB1C38E027DC4ED9AED633D98CD7486 +3F773ACF8AE332631CF2ABE6D606607593FE862ADE31803964E3F4DC3CE3A271 +C76BDD95C87CDB3B87BC26FC7A16D567EEC62E6FF0D471B4853DB8A94D4CACF8 +843824F818083F10E88D52FC4253E8203292CB40F1414AE7E51DD7347007C342 +CD70E8E9F2D2A13D71213B841DDEAAB208AD9EA644591C15DEB084165F9DF24B +B91D3BBEEC2E34E38EF16A0C3F00700A7BDCBBFED2EC0D09601AD6538288DB50 +3478B051B5E16B604A0341FE621A58718D960D699D3FAD284310DCF54EB13175 +19A75A539EE98E804AEA24689D3540F0F12951A3C01FACCE9A7BAF4D0DAFA946 +FF65A4D2A4C39969607272C6886F44E90ABE27CA3A1F12A29D9B32E60E8E34F0 +17C5FE43D0E69A99A922D98909B2BBCD145E59A5E7F5426B3988F73B09A525F6 +8BD4915663C1301323180E760BE81CB874B020FDA3AE63340E4261E4F3E4949B +CC0966BDC4426190BE9F5D77F76A72AD925662E5FE1CEF9CCAB68F0BD33DA003 +F11EB91AC4502FBD6AE48DA0F9D07C35B96B103E379B8A83A05FE728F1716194 +1F650F75BEBADB2E3810388F3E2DC7B19F1BA9E32925F2FD9F19F4E8701F3E4E +4069125D7C401144740691E7A460021A47B1E27997FC1DDABEC5BD0EE0B20194 +2D579C7D6727AA124083242BDA46D8E116E2751C5F298851A62B60AEBE82A929 +9B9F2492BA35690D1EFD16215B8EF14E7A3803B93C28FA41D971B05B6AF3B593 +E74AD1E68A5FCE12A86E63B78BFEA87D3949FD164F12277A4688BE96356791CB +8671C49365608F3EDECC109321AF92B4C29CAF073DA3A7D73E913D0D83FAC5EB +BD884D4C686056404DAAAD6F82F94F803FA1FB0DD8908D1DF08FB87A8BB83027 +04DE0CBB1C6FEB6B517FBD7CF065120079E608CE41893C2BC96A347826CCDFD5 +C69E161217F2127A59F1A6F22037641613F191F22D5B4CDCBCC2EE5615623404 +ABA7BE6C5FE475481615B2AC1A2412E54688DD21E44CC9AF5F16E634AFCA389C +4D740B7B51BB141BFAD1080E7C726C1606A28ED492E6BDE9F800EFACD1513909 +84E98CEB6A0B7A2A6F3E1D1DCC3B2552795E0932673E59ECC56DDD37A1D52BA6 +C3F0E905978AB568941A163F4CE3AAB5C5B16F86016EC47BA6F3F7AAAA77C3B6 +09C8C3ABDB6D514A76ECD37C37AA88B5860630B3406B494F7725975596F84777 +D9CF48686EC9C5DBCC1D78513F591C7C10AB9D153B3D41426B7BF668B0D04503 +56BCB686258462C1DC61095724B9F3312316262FD7C1AEC6E54DE7E5A7BD8EFF +035299B8FD8A4A7B0F51404F4A760F4D8B4C0FB7A32FA4B2383AB6E9C78FDEDB +FE6A5788D38A6701B123630C2A6D820A684166FBBC83DB17069494FBD411B333 +CB37E2491C5BD035A33867A6D3A3D420CC31ACF43AA07182CAAE67E40EC63663 +B678F71D4C6E0EC3A0AAF904CD3AA66E0DE5E3CDE049E94249B39A1C06E3CE9A +F974B2484BB2CDA14282B9511E505B3C89F9C802218AE40D1A7541335C5736DD +CD565D4B9F4CC78F3A393737EDB4FBD0DA299E21CCFEBA5478EEF013F0552A8B +0BB11FF46CCDB784E8BDCF730A16363E66572049E42C695886EAB42A9AD9094C +B635DF4B5B9BD9B9AE8455DFA3EEFC77653190F9A8B1E93B7281C2A21EA7DDA9 +33484745BDF7E3DD63C7AC66C286C9A5A698A5E4D7A91710B7FF943FB23609B6 +4B442F83CB795788FAB5E9CF3F75D5487DA26170E4561C7941C910B088C3B86D +F844B0F340CF82786A3FCF347048463EBD2006281A816627065DDA6CD4D3AC5E +2024BC96C7D896381BBB567951E7A1F29D4E95351298B000D29E5F3D0448CB5A +CFDAE1BADE9403B90371C3A07D208948AFA022A69C519434B6813086ADF518D5 +88E0B92072A44BA1B3EBB630A13B7AB90992E85B6D67361C8D96F3E0D826FF37 +17B67E4B1EB7BADFD98D7F4FD17BECE740ADF13C141EBF0A91CB105DABB32FE0 +55086D56A0D358841D15FD349E6B95512E4EDF4C430216FF85C2ABE995E4B40A +A6044CC8820AD885C07E052B3F91C2E9A1D163BFFD210F7BE95B923E2500DB50 +2075106DB541C267BD450B25B670CE80BCD068D4DBFF2D82634175B61FBD3BC3 +406131F44C7D6F18D375D1F2270829DDF29DC14DBB58A30AC193245D18DE91F8 +AB88AB548D8138605BB5A50073295534E314366E26665AE70482B890E4101D6B +60E4F3B37ABCA1346DAAE8FDB8DD9C832EFF3E73BA470E2BACE7B8515CB43388 +C27AF99FF9322175CF8D4947E6B3846AFF5163E972156847F58A66660EC8A3A6 +5FB47C9F637B4CBB4C73B6A080B0CF6FD1E9665E92032540570FFCC747C67C50 +822811AADC404BC7ECD1673E8AA6C3A2F1D82F39430B58C29145E2F1B679C46E +94EDC711883F1E4EA84117A54757E8895A40401A26E1437B39A2F65CAADD6E02 +D71FA8AF7453668DC613F326A3344F74AD7AC67569AF399385500ABDA5EDD3BA +343CC5EDD4B558467626850E752B9959FEF1454E53E7A3DCBC2255AD8F6AB4FE +894455118A61C58840CB68A925ACCAD75CEACE863D806916228F0614191A1CD5 +DC9BAE256018615AA3725834519449B0A88B4F396654E74099C007930ADB1327 +DD119BF799FE3B0B223E1EDA04FE2DA7A1C879143E1C33B6C6344F4BA033AD6F +8E88C33DEF1977796B454BAB2494C930F492A518E8198C708A75FFEF8C49C324 +A718AB59B889DED521229E741FFE53F98EBE88B0405AD523254FD3FA4BBE96DA +DA1C27C1C979A0DD4E61C3B1F4C4DE01E42F1C4435EECFC02D97994BC8AF5270 +E7CB1458D76ED0229C5FFB4A23B8716018F9050970895D51722CDE8F2EA3D947 +DFF374D84915D5C5D16463A6FFCD079D1ED416C4347BF831FF0C4ADFB61295DC +4D5785BB0852BF472CFC97EC174491CAF961AB90629F055E75DAA6D9898E8653 +5BCF379816CAE46FEA62E7BE8E9B953466E51828172C4DBD0E1BBAD1CE28B5B1 +02B3E36403BE80B49A47446A6677FCED438F01D60EB10F478C89528FA337D0D8 +88D3FC123C076507ACDAF783A9A6E24ED73BF24B6E0F11C13E532DE5F70B15A0 +657F5ED27D204449A841ED19E01432CFFE928E921321113780D036D34F2797DE +D4459CFD15BB117B5C9745EF3CD2B296D91FAD48C80B136D94476967E255F808 +AD2B5D522ADEC64176833756510391815A1D4A8DA1D0AEE7CAD36A1D161889F2 +3347D5B6BC503300FDDD48F594F391D5FB42C42113C538E707C16EE24A3F375E +7C506E8F49CE50FF9DEF3B4A4C1BEB3848EAA3477349833BA22D2A9012287D8B +A8C4CB4307A1188ACC0E6E9338E1559BE5FAFF381BD82A6C71C267409468B3C0 +2C1A29F4281D565836EAE57F680490FEA4A952FF64C8CD11C377C294DCD1EC25 +CEFB2B6DCE959D0208F85B6E32E9B44FD455F9B134A5306D95EA29F37BB8B86D +9E592159338E1293F449380E13C21AE42E6D6952083BFD432F72DFB7B6F9257F +5784C683A6E9ACD72334E0EA8060A81E14EE32300055040E24B49810DFA1468D +A962DE1D1AEE09B49109257898F155A63A83D514996DCD2F96BC0F52796267DD +DA6229F5E9024F78B02154C27EFDB9B6E09B131C9E9E4DB41A0FAEDD93A05512 +A919AC8869C09FC929682B51174D816B85DADE28C00F6391429BA98327848AA8 +C52FEFEBB2296BB78F06BC1950A8E0405EDBA2D8C51F1F607E73F5A2173E5469 +BEB7918844D450B652DCFBC4C0D0C4AC2AD678B7165AA8F053B717C1D417ECF2 +3A2909E864E503059135C05EA8F7CF185DA45CE17FA40B4076ABDD8B167B6F02 +3C8962F09CE07257495ECE5357F755C48E49F4385DB5CE4FBACA3AD4D18E39B8 +F7057F4BF581ED26ADAEE218CE130B0CCCA0C7B273E51D7F314F53EC8EC84100 +8292750A37A4D4551A5C2A65D2382DB0941409D83FE1005752BAD1980307F153 +BD7C92FC12AEBC7C04839FD7F01BC85F0880DB22FE524204FB924445B6B3DF6E +1B657353086539BF4E60909524FFC4CCFBC8E0139F65F53ACF3EEC572C673CD0 +64AB1C29253049B26888A322E0FFCF7DF8871F701CAF5BE7B509E090C43B4755 +B100C929D5A8A4B9646E8EB39F2E705006AD23EEC58E0E1CD0C18A346D8ED66B +D0D2E215F637D25EC4F05C449FF8E25250211635C9D5121EE0D51E712B7A8699 +19E96ED8451ECBE97A7197337C65CCB44FA2522EF6735BFB60CD053EFAC10381 +C70053C2DB3B6DB8DAD720DA6DA25069131FD9759EC2182D1B649AE67FE4181D +B223BA15F5FEB0BBA498F9993F6A9C8DB9088DFACF064ECCB56FC4951EC8F9 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +{restore}if +%%EndFont +%%BeginFont: CMSL10 +%!PS-AdobeFont-1.0: CMSL10 003.002 +%%Title: CMSL10 +%Version: 003.002 +%%CreationDate: Mon Jul 13 16:17:00 2009 +%%Creator: David M. Jones +%Copyright: Copyright (c) 1997, 2009 American Mathematical Society +%Copyright: (), with Reserved Font Name CMSL10. +% This Font Software is licensed under the SIL Open Font License, Version 1.1. +% This license is in the accompanying file OFL.txt, and is also +% available with a FAQ at: http://scripts.sil.org/OFL. +%%EndComments +FontDirectory/CMSL10 known{/CMSL10 findfont dup/UniqueID known{dup +/UniqueID get 5000798 eq exch/FontType get 1 eq and}{pop false}ifelse +{save true}{false}ifelse}{false}ifelse +11 dict begin +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0 ]readonly def +/FontName /CMSL10 def +/FontBBox {-62 -250 1123 750 }readonly def +/UniqueID 5000798 def +/PaintType 0 def +/FontInfo 9 dict dup begin +/version (003.002) readonly def +/Notice (Copyright \050c\051 1997, 2009 American Mathematical Society \050\051, with Reserved Font Name CMSL10.) readonly def +/FullName (CMSL10) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle -9.46 def +/isFixedPitch false def +/UnderlinePosition -100 def +/UnderlineThickness 50 def +end readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 11 /ff put +dup 12 /fi put +dup 14 /ffi put +dup 36 /dollar put +dup 45 /hyphen put +dup 49 /one put +dup 50 /two put +dup 51 /three put +dup 52 /four put +dup 65 /A put +dup 66 /B put +dup 67 /C put +dup 68 /D put +dup 69 /E put +dup 70 /F put +dup 71 /G put +dup 72 /H put +dup 73 /I put +dup 75 /K put +dup 76 /L put +dup 77 /M put +dup 78 /N put +dup 79 /O put +dup 80 /P put +dup 82 /R put +dup 83 /S put +dup 84 /T put +dup 85 /U put +dup 87 /W put +dup 88 /X put +dup 89 /Y put +dup 97 /a put +dup 98 /b put +dup 99 /c put +dup 100 /d put +dup 101 /e put +dup 102 /f put +dup 103 /g put +dup 104 /h put +dup 105 /i put +dup 106 /j put +dup 107 /k put +dup 108 /l put +dup 109 /m put +dup 110 /n put +dup 111 /o put +dup 112 /p put +dup 113 /q put +dup 114 /r put +dup 115 /s put +dup 116 /t put +dup 117 /u put +dup 118 /v put +dup 119 /w put +dup 120 /x put +dup 121 /y put +readonly def +currentdict end +currentfile eexec +D9D66F633B846AB284BCF8B0411B772DE5CE32340DC6F28AF40857E4451976E7 +5182433CF9F333A38BD841C0D4E68BF9E012EB32A8FFB76B5816306B5EDF7C99 +8B3A16D9B4BC056662E32C7CD0123DFAEB734C7532E64BBFBF5A60336E646716 +EFB852C877F440D329172C71F1E5D59CE9473C26B8AEF7AD68EF0727B6EC2E0C +02CE8D8B07183838330C0284BD419CBDAE42B141D3D4BE492473F240CEED931D +46E9F999C5CB3235E2C6DAAA2C0169E1991BEAEA0D704BF49CEA3E98E8C2361A +4B60D020D325E4C2450F3BCF59223103D20DB6943DE1BA6FC8D4362C3CE32E0D +DCE118A7394CB72B56624142B74A3863C1D054C7CB14F89CBAFF08A4162FC384 +7FEDA760DD8E09028C461D7C8C765390E13667DD233EA2E20063634941F668C0 +C14657504A30C0C298F341B0EC9D1247E084CC760B7D4F27874744CDC5D76814 +25E2367955EA15B0B5CD2C4A0B21F3653FCC70D32D6AC6E28FB470EB246D6ED5 +7872201EF784EE43930DC4801FC99043C93D789F5ED9A09946EC104C430B5581 +299CB76590919D5538B16837F966CF6B213D6E40238F55B4E0F715DBD2A8B8B8 +80A4B633D128EB01BB783569E827F83AF61665C0510C7EA8E6FC89A30B0BC0EB +5A53E5E67EF62D8855F6606E421BD351916549C569C7368AAFB714E22A023584 +8B1D6B52FC6F635E44058690002C6BA02CEC21C54CC8875B408A8BB84F445894 +5D6B3E4841CA20AF852A660FE9C832F773691DC6F7197FF3DEAEE97418A5ED2F +F2AE65300416227CD3BB03C29003C770CD7D2A7A2E4C1DCA193651C2CDDBF93B +966938788694BFB562AB0010268955FC3555E5984CCAB0A9B7590C77C9BC713E +A29E5BD7193A4E971D1752DDD0F0AA4648E7E87BBCE66A1E836C715C408B07A5 +9EB56BEFD4596706CF839BA4CFA90CAD4038C1E006B51913279A2C31FBEE5BD4 +A7D74F9103CE6124F5B439CB860987DF44FE17EF88EF1BF62C67060D25696BCD +94ADF08F04E349CEBDF9D3389D870D94CC05E393B3F4362A13A6A672EE5E8F5A +DFE7046AFE3EBAEA58FFEBA4A47BF61F92E2003756DA643CCF2C9DFCCAB62669 +E3C2A18D690B64D907F50BCA155A85E47C3A6954C6FF7ACA36D8DFCE777B7929 +5F5D5F787B9C247ABF13D6D7B4A8F06BA25CCB342F8A5071325CDA86AD71BA23 +8A9695C7D1D50D0AAC267AB7CDBA7AAF46A264B7B081B7E79AD937FEE4969FD5 +155A99E652461EFFB4BD010E5885631E2B2497D6B8C43CE77D7D47FE201DD46E +4482FFDCE150A1183C22C004A0AF0E1F42AA6804E038E1DFC8B0A3CE26B52038 +44D2E7F759DA5C252489E5525963D68BC27C82247BEB18818C7D4CF0BC5CC97D +8C701034B8DF798DD4CE36C3F8B1FD40B2DA14EA75583852875031AF8C909EE0 +04495FDCD04B05A5EFEBA56A8CAC1F57F1B8AB91FB25C81CD51EE69D6E0F52CC +A0E12CF7E3187D67DF71A599FFD895FAA7BF80E2E6B96592BE77AE96905BAF0F +F547355A36C443797DDA7C414AA606CF9153E03450B77D1BA4088D739DF55F07 +111B9E11AF37F45B6EDE6D7AC126E05886A57C83886DA87761BE600DEECD1344 +8A82BD652BE7ABFE6A0F50ED7C6F4EE12CDFD80CA7A5518692F267C51C3FE76C +567BB8DDBE09A2AF901F79AD02B435287CB8057B3D5EE6655071F67B00438728 +C4C3EBD648BAF650993AFE5E2B29074A99ED0FB725D9B8CE8B0292B08A280214 +C3AF252BEEAD30C88F72E322FAC3E9D78A1038F5DFC41F7BF1AE3744A0677094 +51B77C2D630B67853FE5E975A395C06A4D4DA744040B272C2B88D8B7ED3A2C01 +66F503C9DFD3C7DDAC865900D2A4F2CDF517F449851DB1963468D0266D7A3E58 +9F6B2A1843E6444274F16A9930302DACD8D2BC4588765099A86BCCD8A31DF0E6 +2853114DFF2D19F812F19AE6C2E419D7AC1BC024D1195074FD0C6717BFB389A4 +4D5428E7BB2E4F9E9FDEDED7BDCBDD3460805AEA0B5F6460C2FDF19273CE5BA7 +5D3AAE0DB94C6AFA8339646191C23B0149E7CBF136FC4C844E025A38935DF256 +0A0A6466A45EE8B9B23B6A055856FB084F87C73BA28F1883E3B184CD813C72F9 +233B78CA4E125ABD26F29B92CD9DF39D6FDC2A217E2B6B45D9B0A4D536790A5D +BC0903069565A442FA7466414D948AC432C6B75D8D0E1DBB217CA3DC38A52DEF +62E9D5AE9E753956C13819D93148C7683BE4F71B80BC066D8C19FC807FB1C086 +B49215DCF56A91A42089F0D063B9981925691F7DDE3237403AC714F5CC3ACA88 +DB2F1DD205578C00472FD70C8BA4F752E3923ACF3164D442A6B639902ED060D0 +C5777BC20F9A3BDA60FA3BC986C38136FBD2E8F910E32EF36377C9CC187F4AFA +CCEC423DB925B378522B748BDF12D523804CABA83CB5A7ED69FAB9AAB75EE8FC +38D9866E3754C4E2F2B9AEFA804044D878DED0E114EA0E9682FCF38F6628E63D +FE1C1B5615E54FAE8684566EDC4B616F76EEFD6207E0386F06D3BFFA26425F24 +303CC7C8A8D7021E7D09B202616988287838C3DBCE3179B4FB5C726E603A47F2 +8248CB508F327D1291CF3F08F7C88298DC2D0F778D24304EFCF6E074182BF5B1 +8E6551811FD6991971692108E289B61053D6DCBA2925B3903E8916EBD09D97A2 +C6D08E89DE4C0CDF7185E1E00DF456B249F0BFC686E04FDAAD2772DC2C39DD53 +9C23A41471267F53A87E5C2B8CBCDB66CE0B9844BC506428E6150B48D2FA6363 +4FDB2CEDFBAE0B7DBCE4D83E29B2955F8966272CB865EDB360C8A8C19EC62A29 +03066483E4083524A1E8D80FE3867BC1AA91753C26ACBE8489AB0E3330206212 +93E07ED473DBF457EB8489E66FB4B8ED8A9EA8911CF9308CFE3E6D6F36810EE8 +91CCB11BD548617B2C683C354452B9229E7C9E68828BBEC324420DF7C188CCE0 +FBB514547553A7E9B38AC265783891F42DA472388569C8E7594F7E8810895A27 +06E456902A8D9F65CA808F1FD475D011C4572F8A654BA01D67942226A663D179 +95149FFF41A9F55AE84EEB9A6A39C017D7E4FD6EFEEE7FF3CE847CDB064A4954 +9DCD273B810E0F259501BA4003A3EC1ABA6E13D24C0B57FF82D6DF077833B6A2 +7EA54801BA81DB961C261689C0887FAD83771E55D3D137AFBB21779397E11972 +6C6CA922F45AFA5C0526863A5AD8B9C0775CCBA17FFD37A44CED4710884DBC31 +5C9D3F5441595B86CF7CA2EEE42AE87896E9E60EBF5F35C2B7FDBF9A9CDAE262 +3F48396F0F741E9DDF1D4FEF75E68AFB020D06CC29B3A7B2ED819D1AABC12B91 +CA2A65F1AFDDA2F3FB322E0268DBBA024663E49EFF076455338FE31A16B04EC1 +797EAB0B49AFFB906A0690A1E8E2F5314773E1CCFFF43E6FB3875AC907F0C5D0 +DCB9BCC127014D472463560CA0CB1C2CE614D94177C7A52A5B089316689C8112 +CA57E35D716D956DBF9013B1E5B9626456B1433C8C15FA906458F957133B9E19 +8D46DC3AC015F7602538C2AE3927C6DDBACF38E59220C2F5AF36B68DE9117C51 +04CF7DF32B1AF55B87D1D8A5F4BCFEC66F63B32B6548DEDA3AAB06C5310E4757 +78AFF947DA22809B360FE535506A554DDDE5A6F2411246653710ECE5CD3185BE +730520A766C47E1ED01890059882BE1432586864E1A86A7F586438C8DD35C00F +021A741ED47E0F16DB6070ED0C50038632CA4AC2975578A8372A080CC0447C79 +CEABDF2BCD5E78564247B0F0025F556DA8FB62125227849EACFB724A4AE3EF57 +90C07A5B27D2E59425F56BF8AD84C5F5310FEB1BC73D536339FC2E6A5BE2DAFD +97FC835E0D52F680F80ACA37DB498AACF152B9B44626CD89E3302C3EE1623EE0 +F998FA78305960AAB9F483F731F5F67A8C963C23DB8E48FB804EF8B86FAFE7F9 +4C09641915FA7E3930AC922682313408BC1607C76751CEEAFD660206A39CF394 +40ABE2A313AB7D5FD6444E219DC5C26734D322BA268D330AC17959A390D6C8E7 +3A155095BDD66516DAD5D65519A7FB871ECDA77061EFB21F359158B4470EF79B +362C35C06B85C9A9505C8361939C6AC013F2CFE8EEF46FD8CB4452AAB3EF1FA7 +DC066557BADC2ADDDF7DDC2A0E1DD4A357E27A2073427EACF9B9035DA5272136 +7DF37E26D96ED4B2ACD60596E039BCB15E259C72FEB3344E3EEE3D4F17DF4233 +04C1416BCADE80BD483DD8C9AF979E1C7D50C4CF015870703F88B92C4FE46AB8 +DE6717B55C460C805B391B84333097E116F4A51F631FAFAB34CFC925BEE8B72B +C9FD5F5A79D8F2295FBFAE649DC6AB47794AC7D73431FFE5BE992F2B5AC67049 +B5208251C0E442385A9FACF25E3A98D7F5D4C2A1ABDC600AABE84769CA83350F +9B87F71CEAD3600E02FF9AC03C1B5C21C84F911511A0CF0111BAC7605EE31229 +3C526A79D943D92E1CC3C38ABE82D560CFD4172F318030852A5FCC0534B8B3FE +D7365987C8B48A072907B26CDC2108130A33233E8E0BB5FDF14FB55098A10EA2 +B51AD9EFB119F82B08D256D396D3263FBD9DBF172D43A90ACD1A31F3E89E8571 +74BE98B9560E2CD661A2F93C69FEA3FF26B00772AE2C2C24B98D3D122EA2AA8A +44652CCDF4EF4F01CA7D62A976E23E8A86291F43BFAF38FD9C325E70F9C36CB5 +A181DAD30156E98339E6A0498D3420B7BB3B4E651A9090D4A17604AE386273A8 +3D4AE8CC18345E6E19DF06BA848F203F74B161D6A8882991CBA7385F308696A1 +BEEB0130D938A764B98A2001A38489B1334025EA848CA44A116D64926D460D64 +01159E77EA7ED9ECE7BA77635BE564A4ED89315BDFF54ACE6AA1A26591D13CD4 +6D6425CA7933769B842192858D10998509396829263290A3A7CFEBBDA3EE6CDD +DF1E492AECDFF7941B53573F01F623CA0A5ECC9D05A3D0954F7AE8CE94AC3B2A +CD4E27519B2E16F033EB732AA024BBAF74626DB55DC74B1FDDB07FAE98B4AC5C +683CFD8744F361838D343B657EBF52DEEE7AEA7565C5BEEFE455DDDBC4DCCA7D +87D6D769C5ECCF14118A14A85A86865777C8E28F953160D5E82844AE54D541DF +550D5F1519E183E0C42BE88F0458CE8087F2CD4B1B49A8E9E3D127C4A4CB74A6 +2E73BF4CC317781D03FF04BC36AC0E4AF99E2ACAD20F6F8029DE8A035DAB40DB +17D237850BCDD05931FF4B0FE2D0B79EC5A88FE0236271CCB075BD194AA25AFB +3FB93A5206F61A14602E4EB6F1C31C654527CE0C02D04314DF9AFD710D0EBB9E +F8721B97F5FB18E27507E1F800B5509A58A1A8296C72B7B73F99B6CFE42E9C2F +B63B3555475E562672645CD374BCDE937A9B05A157FB3E74C8297507253E957B +1A9DC421946734CEFA3D5EE357DAC7E9DE17A5BDDEF6B2D2A740BC58128FC514 +61154664412BA1C05209EC992A77B7CA45AB7C0EEBF590A5B5652866008CDEF7 +124A3003AE6A7CF9DF3C72750CBD281358CD2FF25B162B78CBB971DB3477F8D2 +ECA3EE9CBC90323B2C236E375337EA0848CD7CB5781A2B0A42DE7E4D99DB2746 +0B26796CEE129D23C76794B7CE21C13C7D4A998B752C8CF43A4821B736EBE246 +D2A2BD7BA3351FBCD1B0A501EC1EAABE60D06DA2FE39BE1F0AD629769FDDC933 +F9D02F9686EC8C2D7455C26AF4DD3F6860B2289E3A30E1C254AD17D731CB73B2 +BF4DFE90CAEECE3ED0CD3FB4C8F4C7BE1C056AB4E9B95781A8968E3CC1010003 +75DFBC4AB9F6B27C5A9AD88D94441A8ADF09EB275E5F0E5E6F3BFEA0FA8C308A +8593ABA0645ECA8FDC3F0E264B35D4B0DDB86B93CD8A047FC409E18196B501C3 +B003622999C47BAC04FD1ABD8AD359C977766E9643EF3BD6385306B08EE3E13E +7DA5A06AE33D17A3D574C6390DB6E9429754B210F0C349C359559C7EAA2350BD +F61D4D8A92B1AF697BC620FA0351E67E0D9F41A95A47EE0BF210C2C48691901F +F905F65693DCB85BE412F097480F6A7266AE0A928729DA0F691CBFFF3B276EA7 +322BCD2206D96E3DAFDFB992CA8F2955F0E8B882729DFF840569D12E4DA1775E +523AA734552AAB6F2F16B89B39F1A3FF0E07EA08D13E612F201716C67F327017 +6C041760DA30374434808273062C1FFA2C47B3FB578807BC26537F542040FF77 +66C995EF3E8B08B09FCD3EE89C30F157158A739606D2CEAA26694A4F1CEA6633 +B54933141CB85C60AB262E2D4E824A3B85C2BEF810DD774F296AB37D0BAE7182 +5648CD18556ACB124246A75474B232D712C2358908B5D9A76F82C626BFDE01A1 +093B8FA6AA0B32F2CDEF737B28BC0448FF816DDB5812131DA0DD5979D77C3838 +B978CC3F6778A4BFCE9A7087EFB19749285AE4C92B99A6649DA349A2E0889D72 +6D4FC664522F06C8C4D86D30BA43ED4E42211217D01636A4E17E2A132D26F394 +EC34EA12D84594AED9C6CDBBC0908860F39B240FA7D7B3003DB10322498691CF +A294C0FC7ACC0BAD1EED3E9D60AAE3F7429695892D1A21CEBF062C6129B33966 +8B2EF6E932F9891DE6028B81C5E9B23278D35B7F0D83989BCBA25E20E9D503DE +144DC485F09A4EFA1268AC5E4B551C5B2F1D51E9B9B9C0FEE585204F869D0BE0 +7287D7570A12940A47C1F51AC6134F03B415C30E147C49F89228855D093EE55F +172711F37776E97A99CC4B36E2F10713E36FB279FD3FA5A0EB9F3938F42E2BB9 +254EB8F0C0F30391735019E02BFDA21D9813C6A22279B898EAF01AA892B14DC6 +5912B9275167AB46EBC420836CC1A5F38A4EB47C039A7BCA62BC3FCE4199FC71 +011DD6E5FFA0F3D7F04AC02AF91B9249B9F993AE346572329DA852115BEF8460 +B94690E790003586F473F37EAB5AC2922F5F663EE2C3C0C336A8DB71650631AC +0A923A389AC911CB215EC2EC7D50CF8AEFD59EBFFA53A9F1FFB7E6215F17093E +3975F186FE23BB5FA5474C11408FABD223E1E6F62035B5A5C1AEFD8899F00FFB +E729C2D5FD551E80716CEA4E8281660286A802AAE8D5834F37F2EAC46297E57E +993B09251DD7789D3467417E393B7DEABD06676B96241B0E43ED1A1A9FC3B12E +0D34B2B0792B79AA648FE9450C3B209FB6D7D91F50C52A5DAB0BC81A8B698BD9 +18946EFF691912D7348D48FE68CD876FC6F71F81165D0C3272DA1A992308D9E0 +ED6D0A4DAD679AF495F62B78D462B463BD4A40931172290C615B3B3B6B47E45F +CEBB85E0A6AB6832067CA6D403C239530D07F199788AA4DD52553836851C5228 +1072406F6D7323A334E7A7FCA588897C4FBA6D4F7DEB65525EFB74E539C988C3 +A685A98752F7198E77E456A545F0D23A1BEF81EF58B02D289CF980A3F17BEC8A +6F83DD90C4A917EB0E5E2B444A608E2E9D2FF80620E16AC1D7775C0A10C1299B +BEE0E1AB24C50647E5CA1DA65CFF3B2C295F0644CA7826E1DC6FADEA93D66A20 +DE852F20AD224D28DB900519EB1569837139C833F24B799F7EBE3FDC14235323 +1D0BCD4991C861F38DF413A5A5588B73AEC3BBFDB885CE17BB3E97B4E6A79761 +93EC8418C2BC4725CD61B5E30C07352F647C3FD50083878C13CFAC241DDCB082 +E53703D182068727F9EB6FACEC25F6D901D7309ED7370867E34E267519E22D62 +4FC7093448BD0D6B1C43D318A3E14C92032325C132AE0FF7ED707E1FA4A955FB +F5224BE0045CB14ECC321D0F333FE24EEFCC504F7C756451D7693C3E6CA87526 +4912E1B6DB935BDE76FBFAFCA4ED473F1D2618812CFF25A6859C626A216603C1 +361BE3E071FCFEC2D4BF2FEBDE07DBD56A1BFF8303901168FA06488BA6B76F36 +95B0A90D7724E9ADB567C2ADC65CF3482CF47FD1D16F70AA19A97D0F9EFC611C +AEA5E1ACCDA7FB2DF05E9480936281484BC329F0B771775E73F7FD72FE3F45F0 +50ADBD03932B38F37A8F0A66B2F739EA3AC8811C8F514E68C5643E4AFF485C81 +88475A523D7FCCA5C8809BD49846C77795A38DC6406082000236A4D2628B5932 +AB7916D44EC2210CB941B1455867E510E9D8A0B83CB645BCABDCDBFCD51A4E12 +60CFFEF0CCA548F654037D01CD631FC4E1F97B4F65DA9AE79D99F13A726E93DC +BBB027B7D175FD17A704C4668F6F8428262959DACA9F8C687C923CFA053804C9 +9B2005FA7E0F07D81E52A9A37AD5CEBA8EA63929093ED0DAB9F7C99C82A50E6C +6440387049A0C359218F5268C9A28F581783BB9D29E08772D7252FAFA6739687 +22570150178893C418531769CB3D96F799BF1C6415820F96B6EFAB5344E82796 +38A0DF66609F5EA332C1065274EC93027D264B84B52AA8AD82E13E2A41AED340 +B240D1888CB89FBB748FD10B214773D466A44AA2AF44371CA8B9A4450DA76EDC +0167B4015A270B9983B89EFFA023A3DFFDE181B90C51D70557B0844362B0652A +6345C6EC83DFEFE099455232455943718297254186940D6305C96EE2B9E3E7C9 +A622D25E0471AC31A8ED3AF8897BD19E322CFC3BD3860D8A0634081D9AF53A9D +84F4ED39D8127CBCAF9AD48E9CBD10A67A2CD0CF93D61B0A2266A5D10C0D1B53 +45C41DCC3245CB3488020BF6049ED80E9A761F13650E3438D14F0EC89C11D18D +E44B6E47887F7BC25AFDE2D512647277B9CE23AAB30B7F1ED5DF84921B567F16 +CE118D5A71B65A72FE62F278D04B1311E20739AFA6D0C911CB0F041C38FC5E0F +E4CAC661E2D9102EEFB4CFE26354CA4BB30A07F2B686F1A4FD8EEB048BEB735B +A14E7905A8A538B98AC7B6C8E329B6DB2DB726C5B2B07E26F9C90A4E76C69EA1 +D928BBD0E1CA65D7402C3925A88BB09C7AA025E178D6579DA73010BF80A1332E +63C347B2A1911FF3BB0D28FCB85ED78684BDCC488A7D4D2BB91BB593ED517EFF +F0F618EF3CA13C5D281820ECE618DF32302A0EA74D7A956A0304BEC2B6CC41B1 +60A2BEE2BE369B2D9BF516E1379DF717F0D6DCDDD7855BA1475AC908334E992E +C84426AECF7209756184AE6CBDEE2005AFF66C89C743CB682403750794A927D9 +A00127CF00165DE8D171DDE90F403CD145C0B7AFA9BD46C33968D50D294148F2 +99D4B9424546FC2F0722BC22FCC5C91FA5384C95669931A721F15F0FF5752BED +6477E8A28931AC48A54699C21DA1B305EA37C12B24B00E7A0A2C9AAEC359FCF0 +18AA95A4E5701E7CFAA3D40F82C4CC20E27E9E47ED47767FEAC71CA0C22724DF +4A60B70242C35BF769D1612031ADE0B3441925EB80EFF02BD1198FABD652D0C5 +CB11A54728D9093958A5F5B9F27174BA5FF4E59A1432B21DB95C262D3999AE8D +3B41E4E5091B55780DC9F4303532CB055E7B24768E70A06F19F0F794D7F62239 +6ACB7AB588C7DBDC9B71B38A92947AB68AA4D62EF3A3A88B4D94A6B7EDE12B69 +49EABD0595AB29374374CC92553993F18AF65CAF555ADFFF11171FF7B18ACFAC +E87DBA35D6FE93754F475043791F00B1C1AC0796791775B22DE7AE5C04828EDD +DC30A00A6171300C6D65292A3FBC28EFCC8019CDFDAD405F8E29C43CCCEA3B0E +7A7E8526F631C35857CB9B29CC29A6809637444D659BE385375395A6CFD5C44E +5461CE4F66B114DEB16F2D38968512BB9F3D19D08C7E703F1FD705CCB1AB804E +107B97B09D1036A7DB5381E9B138C9233C265AD6276F5C1F9067F58B82BED76E +53B450BC3C015769AA7114DDA03FA38DBEF4A395796C7DD303CC708B118B4D63 +7A702B99D29BE641BFA37F6FA8BA2EACACFA57A1982974F77DF26A9FC28BD110 +2DFB33ABBE73E70CC60C8467CA62A943187046A0AED988A3AF7651A69DE5FA65 +F2EB7948AC50F8321CA69E02EC5DCDEF33B591CDB6B66B6B1ACC58EF567B92D9 +1A27162F811E0A5D55CD6731CD237C1F912BE6382943C1F4524D606187819BFC +A850FEB374775960D66693F2B403903FE44163FF4A0D45E21898716AAA47B981 +25274AA20F0BFDBCEB529C417FBD16B9F31AE20DEF23166A1E8D32150ECB2728 +EEAC9565BAC22C00CA9D4F47286C7034E96EADF138F320D1C18AA199446A277E +FF8FC90E337B6E04FF4C46434A8ECF1E411E2BB12175CF3997C62E1220CA6B42 +64D03960C7C5CCF873D12B4834B73A32FC8471F14EF941071B971F1BAF36B49F +8CE1310F09D42A217861210066766BE13E7103BD2D8F0486EC592B99F38B9B89 +AA15010CBD1D19BB4E4E2C321FD88C2AC255427AB2B4C77572577D4EBBF493BF +FE24B8739F771185D80120ADDAE236FACE47778E1E04A0359D60068BD20422B0 +F3467AE613FCBED36B4C9D131E854A80B01DEC5C4FE955AB5CED1021DAEDA722 +DD1254F51EBD07AAB22DC0765F57191ED0A75FDE50BB145536AF35C3017C6067 +CFF6410970179923D3B9765F633D991BB8F8BB72566E748D76A2649E21D98590 +EB4070C5777B195B8EA22F9EDC711AAAECAC4C3CDCD19181E63ECE52A9FA3B85 +08D8376FE890668FFCF11FFAB44EFBF2720375B524057D350EBD718D094D919C +F97CFA593D48847FBD6170595943405A019CAB17B75CD4DABA1610F3515CC01B +84222867AFBFD9700AFCA5E57BBDBDCC8567235F3704949CAC1B405E7EC3ADFE +6B3463E0D6B5706557B83172CF604B8B2A58538430CC7DE33A5A6E169D18506F +3FD7F0EEFB083D6300B16150FC27801760DB690FCE4418F0B410ABF1573D3F5E +603D73D40679B0F1B842F708115C547C3B3DF1E846D52AAF8615FD8A7DE426A5 +3CE27D064FE50903140620137DC9651E646A0526BCDE4BB3F1B64483C24B98EA +7361FADE8BDCC23DD19CFCED7EA733FF262A7FD65CDCA423A14B27EB321D34D5 +0F5F90FFCAA3DAC323CBE5BD09BF91E906A5EBBEB55A0190099766F2DB280096 +335E5E5E3F14181FB0699B6C267478D7CB48FB6362FF72A453A124CBBE0FA8ED +E42133899E820915B6E3A8B0EC82E76FDD1D4F4B27044C27538717ED0BE41B9E +89126E513104BDE9A5453B1A73CAD8976D13C67C785C4028860D02CDC2DC0645 +AAE179BE17C49DA8A6268AF82A8A9FB8A4F26D3E4C0B5DC7AEE18D2BC95E7B8C +F13FF31F40AC72047FE48817E2A2F71D77C81469101F19CCB7B86CCBF0364FEF +2CC8A915B20F9A949DEF1A45A1DDFFC88AEADE0FB3D638931A84CAA7FC10AE33 +02E538AA472D951F2B97B21A506D1677C5FCC30BA7B5443FBC642179D253689F +2980471A237F622A14A570F232DD885BD8F66C2449A8A434E8132F8D58A86BEC +48D627687108798FB4C8A84F5CE88721898C687E6DC0ACEB47261F89AD9A3A1F +44B63C73002F6F338BA880CA3DE4900C378542737263264B7C2EC21953744548 +DDFF14BF008F8429A12484304DDA3C4F769221081D1C75F39CF785B11DB4B6FC +BE27B473FFB49160DA29BC5C205D21CD2030BE08E406747673A0DB0720A82363 +950F059413D4994ED0A9975D4AE94D6580B1A42773F07753090A9BEFD093722A +0043130256D4A7A2ABFDEFDDEC878D8098F373E325B16EF7B3773EC72A011B76 +4357BAA1A4B56A8D8C8BE988E6F815FE40CBCD3BABEA9A1590B60D891B613C27 +7825F6058B0497C7C4393467ED8DDB8F88C15087E623AEB6D05568E4838E388C +EBB708FD7386DF5E020B27F5307EF401DA3C4397B8A475B40CBFA4E518628F5E +5A1ADD4E79E14E72DE0D3DC7C1B6EE2785D4221ED22F8A2DBA5628C897A35A5B +54A1767DF59FB0569CB787AD82CBA050B2D51275176EDCABEDFBEDF7DDFF9AB9 +8DFB0582386A7D078845811041D05C82FADD2DE71AA5004FA463B04DBD60CC44 +D0057C4C30E6095D23B6A247BA70CACAF81A4BC0373816188395888887CB6784 +E24B5A65FF3ED9DD681FEB4533B837D4C2DEB1B9AA5DD0A3118F88278A383B94 +422438257AA993C9EEB0F45C12DC1C93B5CD628B2010628422C5A66A1B7F4418 +6F7411CC00A36AB05E3C4A51124677CBD417F3E72ACD5C705F01E89CE0D1E726 +70FB8CEF1879D2152B177B3792CDE557C67C93D220457A098272879E864E020A +3878BBD1620F05303400F0B537D222E742A9371F37B781BB0A720EC93DB5C099 +AE0A2F6E55D3C694EEE143E3133B10E3B4502B8041FAB5CAF6418743A1CA7D7C +AE0A8F29973ED9B4EA82D0544DFA406C011E42865C0836191FE2392EDF93E89D +99D59DE2B4C09074DA7C8661AF0A9E37E27D6F07252B30B2CD24D2636E5256E0 +3E61FEFB743E6E87267C163D43673411F3A14F891DF034AAA2F2D2AB133793F1 +8CCC454976229F2E57874BD92979A4B94110D630E4BB02BACE6249BB738FE96E +24087A965AA5D0684A252F1C732F1C56AB9F5BD0164237A5BE15130187518A21 +FB9457DC12600A4236272499986F57240ACA7268D9990F1375877C70B742AEFF +F20557F43846233F6114F8C174FED6DBC3BF7852FE5628BD5CFA250E463E67C4 +753C56B9A10AC2A4EE4EC9440447F2E7371550BF91511C8F336EF9352BC3427C +FC17B8B8626066B1B5BABDF1D45F33C7BA4D4F0C43F5BB9FA2C36583A7FAB9A1 +EF21DF17575CD5DCBF606E564EC87C63D57B7CFC72460846448D01E007093DD9 +9BF57E18910E472790D29EB88DD1CDBA87910C6C4998308210823F992B29C38F +0C420623347BCDC52751A14B8ECC58F27B6311C31A59F7661A21D1B2B5BC11ED +68C807A086E05786B5E6091DBA26B2C4C2B4531C1A0F9AC0976F9D50A1AFF8AC +DCDAC4568B88EAFECAF7BD1566C4B0B91385CDC9BDF264E28EEA33CEF4EC51F0 +3EB360571E8CFAAABCEDCBE7A7D93E4582176E2868D2281EF5FC7F75CD7A9017 +E592C375B2512D2A3D6CB8973A6300B64738A8E4C1FA9E278A4BFAB2550A2309 +770577D0C5ADAEF4A028FF5D551952B86521144FAC12ECE5E5CFB45A80EF9D62 +731FE38839CBBC64B916BABCEB5A09DDE1135705D6AC4D611B760152CC64B7C4 +ABF78206B1992A27122D238D24BD4AFB8379EBB5B5210B2E932E983B77AE1802 +9C892AE8DF3B36DB44DA461C9030A3565557E6B15F161386A8D0A1D04C572DCE +7C23E8790A297B4D866017346EDCD257B4F0DA96FC30A4F529BC931941479BBB +261E17511C9A779AC39B22F0343153E7D835CC5932091EEAD47CF63D1E730A0E +1157D3D259EA39E202C783941A73CB7C5603A673C03742838CC7BDDE32E1350A +4A86F40FF34961241E890DC311FBE8A36E4744A1646EEE7A207DC316F5E25CC7 +E3CC4F1BBBA3E36D6705F45A4C379EF000D59DA15767720D75611496A9D632CF +5621F0969611234AB48FF342A04C6293D5472E457BF81D6064EDFC0F44A9E5AA +1B772D08F49162E5FFA2BC610C0AF91921B51EEC5D6B7D2576033356F7F33FEA +DDAC2B393312FAFBB7D17E952BB152C38A8384C3FF701CB671347EEA29D4E73B +E71D670FA1BA055DBFB487220F6BEA357AD8ECB3BCC7F77DDC236BAC7CF5FEBA +7628F5EA10233713B3891C6B67AAB0D3C6AA594D80713C1B96927AF89129B69A +6C043FCDA2F352A800802330A8238D638F798F4BBB7C54E9685C3CCEA32751B5 +717703FC2B0D796DBF4766A7083433B6D629F245E0DE0F601FD74158EBB0F134 +B72B5D7129246E2E2FC5673C1CEFDDD822C4806C9910A5326FAFFAF34215F3AD +99C3113E50EBBAEA9853BC56602BB053793DCF12E4B873D3467342E27312BBBC +D02752C3B6A47CF84A297D28BD3FD25870114A55A323551D028669C37FFAD6B3 +99D786057CA02624513B073C9C29744954FD5AF9AFFA26AE9C15959EA884E16E +620A7A138CCD2181945BF7E101D4F06E6F5DF7E9D73BE317B3661B35C1F62214 +E129ADCA71344C781E6E9E1ECC9A064386E7DCC3F768E4F5295F6E9387FFB146 +C10166BF0638FBB7662EE484158957AACFD2E82BA237DF4185924977538BB8E3 +CE992843305EAB5FD94CAA9E0574EBBC8C5AD0C608E021BF091E8B6B04A68ABC +EE8F2DF7CF10638294335F0A60E765DA7085007640C93FBE28D36C25714F79C2 +36E58ED9D7C7C2153D2F3C826332F9CCB5F8B885DA1BB7B4D50216799E96F40C +71C3D18FEBDFA61DF3ED1CE1FA509E8CA9489679253753EC72F75056B312737C +5538EC44A03324D1E1673B30BFBDC3F7F1E39F7E89A1A892F400A067C626CDA3 +4707C44558CF0EDFCDFF49AE1688FDC33C0B57B8121A747468D353DDCA12DBD2 +BC67559A8DDC13ADA201E39F2F9E9EF489DAE46F67A4D7F0FCFE5903A3414CC1 +8AB5B2D964B5B61EF371F898F904D7E0C2D61029AA0AD17A67E47729FADF757A +A480EF93A14679F98A95578342341844D7269E0E0097C5806F57423842E77D7C +A61CD293CFABEDC397979618F5FE2316FAB4176CE3F61A950A54B2F9A3DCABF8 +33947FB1B3E95324A3E647349DE49F4FF49F22E9063BB476E0AC14610EBEF55F +925B1A75F831C3C723DD24FE40D8AFA87D9469FF04CBCC871291BD6A3713B5C6 +D7EA7B5D5DDFA9CA257554746D78B2B36F4516D9CE6FF8CEDBCB31D030195FEE +9BE3D95139B498DFEC44E26CAC2A77B010FFC5A1FC4195BD901BDDA758EDF749 +5D4FEC73A568063D39ACA617DA80F65633D42B0CF1148FB1E7C5CA25B50EA90C +54441DD7FDD559ACDCDEA3B571FFE904FB56A0B771425D74B952B7EC2D068A0D +C12EECD513F6AD5F301F2DD46687EBD7244D719D77AC5D4FC76CDF4716A477FE +6D5266B9B0B13191B2435B550D1A38B17A750B64931EDA6FD26D8F90222CB8CD +BE68C829333DE429EB35BBB9F360B2FFB7780BF956B672D1E16730DC876DA3FA +8DDEB7F18E82E51FC575B1ECD64BD0CB3BA3E76145CAB6C3576FA8BFEF56BCE1 +E24E14FE2CBF26417F9C4CDC4C965D056D51307E9B2FFF45179F188B8D2D0C10 +513CC21A84D27B36FA0A14B70DEC21D427BD874B773C2EAF74CF2DCD04C0BAD8 +DA72D4BEE652348C712A391BEED641D1DB07D07AE62FEFCF89C21B427190FA84 +0269E59BD51BC2774D51CF53B7FAB70546D5F58DFCBD710A56BB6F8DEF87F1B2 +9AA5B8DBCC8E61307B42ED560CB4AA68C9DA56B9A2C2E84A57899339FF1E896D +2E78151F38F22ACC9C6CD2F0BA1DE426E42F6F8B4210AD772E9F6ADADC8D79B5 +EA761976EFE602590AF7A976D1223F68F86C2E36ECAE00825D964237E832DDBE +E4FFA28E876C61749F1C1BEA793295A5DC6E29A729FCAAFD6254E9EB5D292743 +2707953576A180A0253B6EB06C815EA1F9DA7887BB4EC2ACA690F21F1DE1B060 +001D1E80FEAFF9505F1087B35F32201F1E0E891AB42790CABFDD8BA21A80DD9E +4BB15CA6A92C2379BDE2340B54075E1E4277C27FD25331736C1594A0A1F54051 +957FC4AE2E467E386F9BB644FC26D47177AD50F20141469E0771F07407828A98 +CA3F10F1EF3431B65E9A1407E54BE5139ACF2EC930AD3478E54459C5E48E6F9D +C6EEED387822A391C1AA8793577D8CD3BFA9DE45112128A93DE58C49524A76A6 +0D86BBF7261CE424330B4DF642037C4CBD30A2B0A000B4D970CAC33F828A09A1 +605AD7F89B617C770DB19BBBDC5A4A8F52B1CF312D300D0C0575AA93E9F26418 +3C82C196AD529AA52D0EF942C8731984A668A5C89686E24F113CB5638DFA762A +90DBF8A8BDF46B1118591C7A841D8D56BF5744DB63AE3FB3538F815097193B6D +59033FF0418DDEB7C0CFF6D4517A35A7B4633A4350A9F9AA7CD5CA8E8E0AC353 +B16AB3B903579ACBA88AAC575F298B5BE14995A76E3084E578FE5230F45FB1E7 +B7B9D21BED39F5B2C117A6AA21FCC00AC8D1E2C56AB24AA15E97EC484AB788E7 +C640F05DAA0460A0B4E9C8503C20BE5D42029A3A1FB3FB29B0E4B2BBE59505A6 +F808449902CADC5620489BA1ED619B4CE1B83E516231F07472B3905CA8CAD8C9 +3AAE780F0FC1FB4F9771F9E27E3DAE55F75660904057C015CFD3C2C21394AA60 +6F67B304AD1BCF0DED6D671BB89AA2AA50BAAEDD0B1C04773886A04ADAF60C5B +CECC90C741804AB20233ACDC0EA1CEB4D3C6B0DE10AAC05FCCEA939B19B012DE +2420BB17D8A1989B12530C1A0C196207F0A653615CE0BBEA3436562DB70FA750 +5EB5C7449E0E797AD2B4D226FFE75A459867ED16D62808ECCF4F42E558D32039 +18CEBDFE50DCAB0A807C02B8914A482166D3EF5DFD7825A70A163B232BFC6D35 +44419E988103F5233D64583F54206F81D17B5C2C103CCD09552DC1DD3C7B014C +A602DEF221A959CD5BB9ADE1B392D9FECE841BF9393EBA6096E34B0E0F071A56 +3007E9BE2309AA3938CD811C204FCCEB780D718DEE7FC4B54864D6A8EC6E5A6D +CC5973F89180D77D546C98CC3F0B1BFF6CAE192F7BB56CBBD572C60EB3E32CF4 +351D25A91AAB05E506BB34103633F12F96DBD4A48F7860A5A4AEB2F5AF3C26E3 +FDCF7D711DAC9DA853C4680D3438242AA4B4F31CD30730D2BAD60D53EC855904 +52E504154986FB18D70B388BA034D613EEA3139C9D345A9C32645464DEDA4080 +5AEC9C95622FB25BB84AEFA350ED064F9F6D36D065AB5C3623BB8C530F450383 +27693BCDBEA43016499089AE96EFC1674E0C781C3D57035C9EF683EE7AA9B0D9 +129EEA4005CC5013C0125340CEB995974A3C5115A337857D9A64432C8E1DB730 +34A45C5444799FDEB48876A9FE5967E2DC5CEE966FCC7B6D44AA6646A6866705 +B03AAF1680FFD7AC4532DD9236FB93E06707CD473A784F2A0CCA080614532841 +FC6E17A3EC2071ED95630A0BFFA5E193755FBE6F5E47BB01F2D001112DC9BE21 +321BB52EAD97981DA21ED58C7EE9F1222CDDCBACBECA9EE6514F44EE67F9147F +4EE0AB51013B5347406C9E68E1B02ADB349F1683D97B11BF372E40BEB0933E53 +47B85006E4D890D1FDEBB3DF28F979B38F35D2CE40C2CF5150C2A3E89878B423 +9F276BD4DBE2D360BCD56EA90D2D2E4081FB2250041D7F91FED785256EF63DA1 +2A5E309CF063606B4D459BFF752C1FD839ED7B34CA9E35C640C74CAEC1B4E4F5 +A4E248CA558D5DD00A353E7DA3AF7F103937A1929A08501B9EBAE0C5E9370473 +D129C4D85F926E8E9EE2F66F24EA474ADAAD82BB8E7776ECB6B04D46EDCBD2C2 +3FEC310DB22C105A3781ACFDC48F4CD510E78DEC88D45551AB54D3E7A592BABA +2DB6F3D69FA6C76F824FBF91E601E53E9E1789ED7D99E1EA1C2291C2B8BDA2B5 +FC8EF6490DD3689B718A60BEA5DBC7315E90C475DC3A8777F0507D26A89FBF32 +3D65AAB9E6BA8827A40FBE05E8101D678606425930695B7212A53B06B723E99C +E8F4E1C25B6C605996E3325B03F06F8EF607C53BAD9D0457F3FD3839A5A776E0 +8009C33DA9593A898BE25FD4F9410FB0EF1D2451AC04210CFD2350D093EB0E63 +DCCFD3D9B0BD93201E22FA29EF190423156398838045FFA8A0C2D82FBDDC031D +AB5F28D4C4F599240AB650E4E464630776A69E189DB265F5CC821BF1FA583F62 +B0F3C95717D0588E37E6ABD75997E4AA9C207B2A0D72A7F210F90B9FE4ECECA0 +30C4C79401EBE7DAB29B8F8CFE9DFD8E2BEE13F60727427BC341C1C458C87C5E +2BEDCCA1C57859C5E6344E73A8EBF5C69B8696AC909FFBD1827D8627D19C6A65 +6E0B30B4A3798597BBBE6920CDC6FA7641323F9BBD55ED9594D3E7FFB8AC2A33 +103B2AC07CB3F3F13BECF1A1004CD335B66EE50070B73A1995D92D37B70A6D6A +F15C733F684ADD14D0A0FC72C4C85409EE499DE4880D0D43D254FE64BE0E0521 +299ECC1A0006A81FBB29436C1667DF12806067DA65B1065F5D13693EB6E7BFE8 +73C96D74DF79B229A14AEEFCB3BFA49AF4335E39C4F01EAADC45B8CA1985ED4D +204FA17FD2292159486E9E16036BC2DB6DFDEA0513B5EAC2E330230B3E480618 +F10FDD28EF6540BEA5176780DF7F6E1F9266C16D6B3DD4F5913F377DFFAEC6BA +5F46E222AA879FDE24C7EB91DBBFF972AC2E046580E9A08E7743652909CD36EE +C19EC34657B85CD9972F117AACA53A5CE725A4034B7C5E924E3605475A38D237 +DA7D847534A82D4C6FF313300BA22715F3D860A69218B81A428D991B9E4CE68C +E7BC3702AE8460E9E987C34B2B99447153F5A3B258946D6D89F165BADA389A2C +19AC4AE8EC3B6D3DB19A153C9418628784B0451DCA07E395DCC7703016257C84 +B9B982EAB6B28DC56EAFCC747DFF63E58017BF02BDF382C42855D313DB09C185 +115747F9037DA3A1EFCCA66A1273B89D52BB24A71B15D09CB7F064D6B8FF87D5 +2548C8C2F6263B7C1B725DAF2259092618C0626D8FE56BC5503A727A0641EFE3 +52A757AE040862B287369103FCE96987DCA9541E7572169E7685E46CD859EFD3 +ECBA9E2AAD5C0C6DBDC10691C0A33D3F2828EB8750B38A023D10F03545947991 +AE73901A3AF5D159D08FB7B0C14C318B05F606469E014C24373B22D3FB5F613C +54338D3C963D5A4BA0DB432D1C8D825C86478A9D3010CC2F61B0A78CC9421E8E +B3061AF22FB8AD68CFB67DC52256D2903FFD2C2E2625AB396F2AD254C62CD95A +3E1A80C0A683B7D46CCF682C8FF288F48940116EE40DBA2E3F2ECDC5E899613B +587C1CCDEA37B26DD65B20D1C5410B91064EAA71CC11EE1512C308DC0F531D6D +321FD8C67E1B01E2B624459F31F4935F0BA76F0156008EF59B60D1C31539151A +B99E94CF328C6D024D304FD8152DB5BDCAABE4BC885FF9C18D01727D1B07B891 +A61BDBB3AC8F10DE2974A803FEC0CBDBFD92D04A4E14AED1F275B46E485E6B1D +7C905051A643BC92E50FCC4229E08ECCD400032B99D37D34102A25E12F040027 +F6587991C200A76E654665F8B6A76B315C13F5C3A0231FA0EEF44212A07E878C +45C71818EBC120E6503681985B6E2F823767E2840575BD1F0FECDDBDB49B93DC +07952607A2FD0A5B0E70FD2D884DF7EA37D724442F9D012374D35BCF322A8C21 +CFFE14A146B5C64BD584CDC9979F02AEACDC60EBE65EE184621ADFA04D9BBD9B +C2E56BA990CC24FAF5D65EA80578A2ABEBD053780F2B9BCE917A1CCF34C8AC43 +596A571C7832DA1024A8B274A7E8628CBE9488E6B1D42E2368893EC54E7FAD55 +A207A74ADBAA302A10286906503432A3A61BE8C2A28B2B8C5A9BAFDD1DA5D618 +AB8A6567BD140318C85662F46A19169F13E07DCADE1182575D212FF6576F017B +F8C0945BC7CC00842B2D74985789C360C3AB4D76DBF4391FA9C1F47891F67F19 +2CE34FFB9ED7B6EE772B510D3390A1FED7A893865BAF4132F91A676FE24680C2 +1505FCED53401B381F3D1F0A7D475CEF103E43FBF7FC1BB18DD57C99B756FDEC +7E31B3DDC977CD34D7B577051BFDF956AA6F7C61575503474670BA367115D60B +87CD2CA6233E932EFC1F3E46E408394008815BF09908A5A62B5B314B8DCCB3A7 +9703351F62FF48B58D64792337FCDE59F66B21E948D19BE95392C79EECDD0647 +173DA0A65F174D9359A0E09FFAA5CD2A40D397DCEEF56C5F94C0EB856C40A70A +E46E0FC2364BED779584F269C4301CA425F05CBF99EC441DB67E15F6F66339E5 +D58D35085D0D659510EF769570C239A67562E92362CF1AEADED5C70C686CD434 +2D6D5087C5254AE1BAC0F58BED650E22E5EC6115B1F05185C01287E8F696F05F +34CEBF284A65342BE596CFE2C41DD8691C0CD346FEC556C2A752335E159876B0 +8E45B31F439CA3E244274F82E945EFD6F2D814E5237C51196D6B143228FCA788 +AA63CBD035E5989543F1EDB2CBD17B09283DE5380630A194F8189ECF1379EB96 +3977E67F934BF98508D20CC63AE03772C9783D7BCC4997CB8B237F7B9D7479AC +D7DA60947549215209F86833430E1977C1396CD7F60569847349FA3A89ED12AE +51D230288DC4D775332BBECD96FC4C63CDFC5C580F45BACEF0517DF7EA5E52C5 +63024775DE8D4EFF10EFE88DA538770EF6A3B11CFFC872CA021275F3311F7B08 +C0991FBCD679ECDEC5F89C1D6FFC4D328A0632CA07808DA38967E2AB1E83AE19 +990360D6E53DEC1D1B15C069C93B58E77785BD24931EC5099E97E151E663CCBB +618CB4FBB0C51183C367F44E7C9C6760E054ED47DA817941F84564C8764240D3 +6C3060868793279335D044233223157FDC3ED0C07017628F4E2FACFEFC508C98 +B8BE1F55FB67597E7742EE0135635401C0BBC1153DC40FA79A94115DAA111365 +05DED7204200D3D1324AE3C645BDA3B9D710CC10E9080C619FD3D06FE90FE2CD +15C6512FCF776DEA7DF9157728AC1FEC5CD467762B7FA1CFCA54102EB8E4AB1F +7476010D348697D06001DC098A7326E85B6AB1B07AC7AA178178E306D2A87DA9 +85FC9AB8117FD688F47BD22209B3A1D0C93083093F236C8E1B02ED15D83C33DE +11A1FB6FE719BC830824BC3328A7E49F5A873DAD276C56BD1D1AF38CAFEA899A +389C8A9DB9077118A0424DC44E7DE3DD7655FB8F6992451BDD52BE843AA1E1B8 +2BF771CB438A29F8E4DBFFC4E19C98B084E0E03A2ECFCF20A2AA0779D388A02F +72FFCA20A11F708D4D7178CB9A0EAC0D1704E183F632076BB91FB29089F2C415 +87225E605C21E978727923B2C197E8078B95397BD9C65197ABB48926A2405C10 +958A0B8BED8642D5C03C13208ECE983CCF85BF8B3E9B4245C591962E858C7E69 +6582EE85C87100C78F71B007C314CB802CFE6B7D0EB9647972E9087A58BC7F78 +B8286D4F4FEA114CD39446F7B78D3C62F09DB1788A6C222622145DB84C966ACD +9CF1CFEB0970CBA95C434F3BADD9C94FB920B61758EF7868DB006CB9573FFB63 +090FE21FB752779109B0883B8FB18E0AE30B06C311CD740349919AFF8F7CE341 +FE8AA12A4AD3C6E4C5193965012CD3B2AF97F61407D971FF1CBC88FEFB0798C5 +0AC8867C5943F906463B37AC97CC5EE1BAE2A2D5140373E47550EC7C6F8FCE28 +AA925D32635187588D606F97152A350F4F947AF926111ED0156516B8993DF0E5 +8924CF692123ABA594B0456E7B9BA4B02333D93C41A38717E37E7A712A3F890A +4A5A2D8B1533A30B3B71810A219D2208CC930C220809BCB5F36DB30A6BCCAA38 +56DE7D23ED9C96E2A8C72953B16E260D6E09EAB74156950B04C3257D9AFFE231 +0B62951CBCB49A09030B2D78A891FB32B699742D2C50DC7458946313AE2AC0D7 +EB73B761E55B2A04589FB00339405FC3159032AFEF73AF70809B709AB6B0E4CB +28623E96601DABB5F1B3AAF774D33CDC08718C0105E23858530FB96FA7C31904 +3CBEE89CDB5C2A793A0069AE0C871193A41F572B66B602B58C0296436D068802 +EA8B67BE1023512A35978D3CAAC054AD7AA7F0DA016F41637F193FC89B795FE5 +E41481E11F63E857A1C6B63D07219791842DD5B6312347D20258392D09D95A55 +3EAD367242BDBD530E3E3E2A7120702CFC9963125FBC187A232A03062ED3F96F +04B54D0F8A3F5A546DE9E7681A9B7BD3E3C8F705922DDD6CB26F695EC527CCED +DDE297B16CC18582D68002F76F0D33396783F8942837CA994BA252513C41F2BC +412B6622652B3059E9255462EE4A1CBCF81140FF1B52EB35F908E6546740F993 +E3C5E73EF0D9FFBAEF5C87F8229FC0CC6B20D23BD9AB242CA2DB98EF7728CFCE +D04763F6ADD6E73D22A432C21A4F0C7D3F1180CF70C58FA9A058588357C0A5A8 +EC78207946D27D9A92FA75F14B9E4CF297D88906C99FEAA72FB1712B096A26E0 +8516B7EE29A7FB4E371ABC9204087C14535DB58EF419C5F6FB17C19DC140F091 +D622144EB55301F2D6DA0D0DEA492C4A262DD4F154683446B5495F368A1D64FC +A002B8876566C9877B297CE3BC277846CFF0D172B8639F44DECC452B853D4D6A +5D542D09467C72F1828D28F4CDBB9F88F49B62291E893D0A34C4210EEE8C496F +373B478DEEC3CDD54E79437076FAF11AFDCA710FAD6E764A9A509876BF9B02E1 +06A72423B570EB0FEF20F16E6E00A9A0A42D360C6FDB1347610D835EFECA024F +1AC9202696B454E17857A7A7AB3A256187E056ADD478CB53EB4E59CAF829432C +75A2F22D94F64705B88AD444343D4F57C131E8E63D1C596C4862901488B32B2F +8DFE99DC26808BAE9407213AAC51F539525D37717D2A7B5010E4EC5530B5DEA2 +5FD1BDCB4801566841050E88FA011D4697D72578B7996406B8CE183F036D9335 +88DEACE05D25498E2CD79CF1A747487C3DDC42130FFD11286CF1875B4333CCFA +8442436B13CB80D5A89F3303870870E9548CB2A9E570659F0B73CCDB5F1009E9 +118CF5B44247762DEDAA6FBE729A3214B5766147988437E72B0E8B32CA1DF1DA +AC8D77B8F8BACE1D8500B6D58BC6A8288C126461AAB0EBE1E2EE7622FADB4D3E +F160AED1B52BCA0A704BECDED7CA2012D6FCB2E98CEE74A2D7C467785D5210C6 +05575C75DB41191ED6B2BACF1EB0F6A17D1CCDE10EFB0D1623C49F3A52C44A8C +9EB2AB272EE869841F39E1E72D750D1AD5CE2327A098F9D13C897BDF0EBDCEB8 +F15444E8AA1209EBBDF904850DE4571DDB125D34F143755CB048F5C5AF3B3ABE +EF05F5034BF348296F09738C06FDC144B7713132C5757D9A8DE365EB21C9AB5C +424B4930AFFD7EA03928BC200ACA870D65A6A87A9F6A885C1188387F3BD8BCF9 +AEEDDDFE6254D6AD640A25BF742A745F33F4722C5EAFCD3E67CD098491971121 +02DC643FF4DB71A9458919C8C8A266FE20D3637F0188D2ED49481CF0C0EB0BDD +F7460E837FAE3289CDF78B7CAA67F52B98E04E5ED744CA9A8D72BCA22B78F19F +14EF24C72B7D483D2F03815AAD8236E06FF5D1C4908F8EC89300E21D2336E022 +E7C02FA6266255229CA7AD057A86AE5CEE956743CCF3763B95251D4F10013790 +BBDB6F6EE8114613DA0E265DF13B74ABA350F5BCBBE53EFCC074F6F19611D88E +9F276F52BB62CA550F62B16A695C932E3515B942D2686ED2215CF411285AD334 +A63CF8D4DC2CF5A824C80DBCF7708808415CA8803707FBCE59B59523CB6AE8F9 +08E3D11996D3D7808D3AE1302149BE86E3F70946930A5EF776A234FD37D5584A +495912798C385486722D32A6D01341AA02787B42D289F23DCCEDF67F38E5CE75 +1D768A05209E55AC5AF03CA58720EB0B8F3266AE349BE0886AFC8115AEB45FB9 +F8547736A1E068674FAA085A41178D3C2A5030A622C75629F6E224BCA766E086 +114EE50337CC45D5F8F39D8F782BF4341DBC17811ABBDB6FFE8D8B8EC0813436 +A0D092C1AA0C92F0092D1B4A6D7FBBDE61D570D5B74480344C9666FC01CC07E0 +8C9202E88EF265ABDCAD12045ADE417D3C29D837A4DD066FE141697611098E81 +8100EF53433477802DF070E88B76A3BED85ABF5B93058011C8B16CAA0387A1A5 +730FFCBC09DE20A017C911BFF4A5B4DADDEDEC2365FD178D3A288194FE5AD32C +A9D6AFBEEBB05A365462F9645E03F37ADC4B46C80A2305C3D959D842C7DF5CAA +F65A4A8FE43F42B342C3B3D97FBCB31C7FC441B6E8E01DA716EB38C736B3E968 +D0EED472103E33F1624207C63E02C30032D9BD4620224073CE14F2F5F7F3ADF5 +7E835B168AB8C24DDB7C66523DE038CE91EAA70B60FCBB45979440A641F3B9CE +C032F560E902653714B803245C0B8BC46A254AA867DA7083EB2273DE81FA0F0C +13AB83BCCAE9ABC8A33475464CAB21974B4F6B9FB439DF8C1683E91C70F7A22A +D8ECE10D54D664A2684E8753448F49342505C15328708BAF94A2089CF44FC0D8 +0FE83E1860E95BD2CC330047CA486A4C1DBA61548617B0711CE9F2FFC986E9DD +69621D48462A8EF21A5C730A9AFAF9FC340D06DE2E1AD10BFC30FEF90604D72E +C151649F765A1A65B09405EB10149B2F9C3B6CB8C2498A7FD69C371850A28E15 +D001888E8821DD7A3845F2C70EFBBB08300D7CBCB976831BC2145CB8C856207B +1ECA9D27614F6B1534AD17EEFD6DF88411826A2ADC20A9E060E79DD9B3FC9425 +A19CF213F2B89D6B71409C781DAC8DBA00314319417652099BD7F637D65A9CFE +D3ED843628C740B0C7059338B2940EF373E851F722C2B475BFC1C18699148E2C +E0FDC3C012829FA69B8F42C08F36767154AFA79131D4BD6E68AEF4221B83A925 +D384E5CC415DFAB15458B1E867A4D2BDB558C21C8461677EE36503FCC9C4495E +EEAFBD937BA690826FFBB0D5C6F855BE42C907DF11C8AC7AAAAA98031533316D +D6739FB3887E2460F93991A0A7DAC9F41396638680899DB6D934E5655F9F4C27 +492AE20B322D912174F1F0BFCC88C24BC9BFDC1777FAC99238B2EB55A115C886 +CB30CB984680E6C9DC554954F5FB25362838A3F20CD715EB23E44077AFF2D5F3 +EE0407E067C202133BDF89600E40B5B50CC2D5AAB17464FA917D30FA36FAEE98 +5AE929D6624016536A3ABEE523CF597AE6DD93F51F67CF0F70356089B8398D21 +643DC8C267263301219D43345E0F60D08F9C85F542CADEFBB77A8C82CBF9BDFE +094BB5B53A91CE560D6DFF007A94A2329D072C415344A6DCAC2C3246A0A9B0B0 +AED75AB44BA60A30E06B375690DB237B340D358392F0D36CE3802638C638ED07 +334102999B4DE2F010BBFED3E2D07124E37F44C7D2BB1CDF608D76B30CB4A038 +5C483979E2A89FFDFED4ED4C56C301137205D3257005BE8A59A2A18E0FD97413 +5F9F91940128A6D0857510F3DD5EBC028F38F9951EC6159B2E7965782C284570 +8BFFFA180ADB09FEC193B7DB8E447DC2DFB0EDDD9FB0430D9FBE5141F714E2DC +AC2E2689F2A24C8FAFFB6ABB59F4E8874C588D2BAEBDB1F6DE0781C66C053B7B +BFEF8E986199F33D52FE9448B67BA40B7C970CBC92B8C06030A9A15C63233C19 +5B444218C571B9BCC07EDD39417F43B458F53B5EC2DAEC99BC9D4F83C4FCA1C6 +B86EEB2B0D9698C9DB52F50F06CB27B149D3CCDD21174B17955A68D9F8195F46 +46EBDEF81EFCC5A9259072DE9F0082CB8191D8F536A729D544C7683B7056EE10 +8FB8FC70052D988D75ED34A7FE10C4FEEB105A0EF3C2B96C20A72A77A1BF5DBD +DCEADDF4D308744F7A7397ABF6292CB1516EDF945D7CB90147E5213FED1E0B0A +5261A049778983C13D1C6A916A61773874024FC2CA69CB563708A77DAC475396 +31ADAD54ABFCFBB918C9CACD6A281139311947DAFAC6CFD0D4CABC9954EC3176 +CE6D4FF9E182039BEC3E19D08C6B70D4E93193E4CD6E01B95D9A00E693E8462D +4F49F92307515B0C76AC4FC4D864BE0A47FBAC55FBCDC8C7F299955B7D0A7BF0 +768B24879D38CFE5ADB9BF450E2A5F6A4992F792FAE4669D81778EBCA2DDEAAD +5D6FF3FED569633C82E64BDB2F49AE6C4F78E88DF6FB64856F81184DEB825149 +1D1752D36B6DE94BAE058D301A6AEF8D6447B690AA740A18F069AE107A6CF257 +0A9F8543E94DD9718EF1FD7ACEEF0706A7D5672C60261C90BCA5A5F88F111054 +1724ADC2E19E1114FFADCE989F02C2473194A361C4A1C190D82EEF2B4261E7A2 +B794A03F65130DB01BE22AC9F007DE1CF647330A5F3064EB1F4BF688B6A7C64E +801824FADBD122B593B281881C014CD1896E76CCFAEF10B2D9FAC5104A86B93B +261EA4B7A9FC1A46BB1E58D1BE20C07B5487282F2F6DCE16A27A5BCD82777DD4 +B96FFC1A83E4E0AFA129514FBF8270153A755F289AE491B9106E9F388D9C8188 +F8C4AB953C6DA15B352C9DE6F0909AFB893021980AA28FF3B9B20C3858FE2B75 +67D8986326BD73917DDB4BA8A38EC38515582A0930688E8E0608E28D504BDE86 +1AF67BC7F5D148AAC191E517E9FF35E03D160B089CC1D547E84FDC8D5FA17CE8 +5490870B089D4EA945AA47FC2B22ECE37CBBE766C0B38746601588CB91E14178 +9C6FDBD71BEDF78711AEEDE67015D056543AA7A7AA491A4FB7F3CDA7400D4F02 +21B8D1822FB22AD9CDEC77D790F693712507FAFCF7C7B688D61D791C5AEF938E +67BB2263889F70775DFE31DEA89362B2A354A66341EA25CA2B7D0B9751B063C1 +43311686A0262E6516BA3073B97B551F62B171D92A093BEEAD77F518AA47D27E +EA28F94A52B4F062EAF22A3BB55231C02ACA8F4D24575D1B20871DADAA50A45D +9DBBE67E40A4E7C73707AA92542D259D86CC2812C03D45F55F1F106389207307 +E6F819F6E72D4A3D7C7C35D501B8B4DD87B3C5245C239D50515A9DB6E6F63554 +3D539FD90D037719E641B091F043FF90DB4BE267967368ED11C7C5A978955AF2 +7E3D3FEB5DB2F73C9F17E77B29E2518C042231C0A6149CAFB0A772F2A2DD22D6 +0950A033E805DBD139D32729595752AD697749DD3AAC4E80B8EF7192A02C7E60 +C222C4BF0B4846AC80D8A503A13FE09D1E8680E701308148D04684D72F5D3924 +80D0DD922ADDC93E6C9A92746DF9F342AF9584492AEA82A3EC637875420B7784 +14B139E1540C94B5FA115AA2A414021CD04598898FF8B8634AF360B9223E968E +AEF3F4522034DF40A8D445DA9BC639EC4A33315DB7AD426B1ADB9F75BCA977CD +3FD7E509C26F319B5C4A33C82FE0C6DF3BDD7DF26A21F3B39BEFDE002A1FCFB0 +817CFCEE79B333044FCC04B0B4A9A95C35600BD6265DB61B5F6B2A679A7AA0B9 +FB0D6E5DACA9307FF3B847DFB6EB2AFE9674FF68D5528C7F5E5FC724F704C0A9 +F061FA3B46A4C382842554BA19DC3A9D452AF54B47E5C3B24D62FCD2F195AAD3 +504443027AD89DC28CC0751F1FD6BC6F730CCDCB1FCCD3A8F9984B7887A7FA1D +017F337337FD07DB4DF862A8FE056259BFC7B3A8451BD1A55DFE8B72FC716CAD +82748E02BDEDB0FD7965C2781CE769F26480D82DE5A496FD5DC8C262F2C9EA41 +691B450115B1540A0032E7CD4A1F77C1B2F9F47D60F30E4A9EC3F9B56E6038CD +00660BB8A136DA68D522DA12EC4CA4487D3563E42A0652451F406BDDD67A6733 +7516148E0DD09086F08C1D40E7EF70D176E974431DA1F2ECC17CB312C85170F8 +5AE1A8D6C0EE3C6835D853F64511A6F0B66F6CDD08DFF911A9363D16F4BAD56E +0BF03DEF1B878D1939AC19A126C5CA54FD0FD875540DFE10B2CF97BD0A11A681 +7961AFD1FB1962BD7CF163B3B9CC8FB4701D40DD739AE4280D1BFFF8922E9C6D +A4A4EBE6503CBDFEAA86A0DD12A3B524D8FEA8827E715DC3B7CA378466BCE60B +7FFA482662E85514643C5ABD7210F836F591662F331E51C7943165F8609E8A73 +E49AC4769EAED66D075AE1BB0D259FA08122D8BCFCABA7F160 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +{restore}if +%%EndFont +%%BeginFont: CMTT10 +%!PS-AdobeFont-1.0: CMTT10 003.002 +%%Title: CMTT10 +%Version: 003.002 +%%CreationDate: Mon Jul 13 16:17:00 2009 +%%Creator: David M. Jones +%Copyright: Copyright (c) 1997, 2009 American Mathematical Society +%Copyright: (), with Reserved Font Name CMTT10. +% This Font Software is licensed under the SIL Open Font License, Version 1.1. +% This license is in the accompanying file OFL.txt, and is also +% available with a FAQ at: http://scripts.sil.org/OFL. +%%EndComments +FontDirectory/CMTT10 known{/CMTT10 findfont dup/UniqueID known{dup +/UniqueID get 5000832 eq exch/FontType get 1 eq and}{pop false}ifelse +{save true}{false}ifelse}{false}ifelse +11 dict begin +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0 ]readonly def +/FontName /CMTT10 def +/FontBBox {-4 -233 537 696 }readonly def +/UniqueID 5000832 def +/PaintType 0 def +/FontInfo 9 dict dup begin +/version (003.002) readonly def +/Notice (Copyright \050c\051 1997, 2009 American Mathematical Society \050\051, with Reserved Font Name CMTT10.) readonly def +/FullName (CMTT10) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle 0 def +/isFixedPitch true def +/UnderlinePosition -100 def +/UnderlineThickness 50 def +end readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 33 /exclam put +dup 34 /quotedbl put +dup 35 /numbersign put +dup 36 /dollar put +dup 37 /percent put +dup 38 /ampersand put +dup 39 /quoteright put +dup 40 /parenleft put +dup 41 /parenright put +dup 42 /asterisk put +dup 43 /plus put +dup 44 /comma put +dup 45 /hyphen put +dup 46 /period put +dup 47 /slash put +dup 48 /zero put +dup 49 /one put +dup 50 /two put +dup 51 /three put +dup 52 /four put +dup 53 /five put +dup 54 /six put +dup 55 /seven put +dup 56 /eight put +dup 57 /nine put +dup 58 /colon put +dup 59 /semicolon put +dup 60 /less put +dup 61 /equal put +dup 62 /greater put +dup 63 /question put +dup 64 /at put +dup 65 /A put +dup 66 /B put +dup 67 /C put +dup 68 /D put +dup 69 /E put +dup 70 /F put +dup 71 /G put +dup 72 /H put +dup 73 /I put +dup 75 /K put +dup 76 /L put +dup 77 /M put +dup 78 /N put +dup 79 /O put +dup 80 /P put +dup 81 /Q put +dup 82 /R put +dup 83 /S put +dup 84 /T put +dup 85 /U put +dup 86 /V put +dup 87 /W put +dup 88 /X put +dup 89 /Y put +dup 90 /Z put +dup 91 /bracketleft put +dup 92 /backslash put +dup 93 /bracketright put +dup 94 /asciicircum put +dup 95 /underscore put +dup 96 /quoteleft put +dup 97 /a put +dup 98 /b put +dup 99 /c put +dup 100 /d put +dup 101 /e put +dup 102 /f put +dup 103 /g put +dup 104 /h put +dup 105 /i put +dup 106 /j put +dup 107 /k put +dup 108 /l put +dup 109 /m put +dup 110 /n put +dup 111 /o put +dup 112 /p put +dup 113 /q put +dup 114 /r put +dup 115 /s put +dup 116 /t put +dup 117 /u put +dup 118 /v put +dup 119 /w put +dup 120 /x put +dup 121 /y put +dup 122 /z put +dup 123 /braceleft put +dup 124 /bar put +dup 125 /braceright put +dup 126 /asciitilde put +readonly def +currentdict end +currentfile eexec +D9D66F633B846AB284BCF8B0411B772DE5CE3DD325E55798292D7BD972BD75FA +0E079529AF9C82DF72F64195C9C210DCE34528F540DA1FFD7BEBB9B40787BA93 +51BBFB7CFC5F9152D1E5BB0AD8D016C6CFA4EB41B3C51D091C2D5440E67CFD71 +7C56816B03B901BF4A25A07175380E50A213F877C44778B3C5AADBCC86D6E551 +E6AF364B0BFCAAD22D8D558C5C81A7D425A1629DD5182206742D1D082A12F078 +0FD4F5F6D3129FCFFF1F4A912B0A7DEC8D33A57B5AE0328EF9D57ADDAC543273 +C01924195A181D03F5054A93B71E5065F8D92FE23794DDF2E5ECEBA191DB82B3 +7A69521B0C4D40495B5D9CE7A3AF33D17EE69979B82B715BAD8A5904C5DE0260 +6C15950CCF6E188A0CDF841EB68E5A2F88253E382140F87C87E55C9EA93B8C89 +14A36CDF630D6BE7CD36DBDCE22B21778E8648B97B7EC6742EB5114BDF0454B0 +0EA7B1FE236C84C0E5308C871F67B973892890557AA12E00B2C20C71F516C397 +3F3BBD14A1D0149CA064391056E45E9470FC7F6F556ABC82653B3C8049AB5CF4 +BA83C8F2158C236B2FFD4208846013BAF4165E8BB8D334C8FF2E8D74AF5DAB2F +D44788869B08399421AAA900ECC6A2D594641C121660D4B5F512938994C18DD0 +FCD9B008F68F0351D21ED735B2740CB1E0C1CCD25EB548C35B844601D98828DB +556F71D07E081A593FF12DAF83676492A0FFE16E95717A07082B43A966C1EE8F +8A59E1255E1705C43A23CF29A5E4A6547C93F1680A870EE7BAD8CF74D838CD5E +F806911D8FE4262ED8E7F5BC58B92C9C6D74F8AD45FBB021EC7E97393018B9DB +B1B84E7B243ADB05ADD3F1DB3692ADC5D47FEC7DF93080669E63281F1576B673 +125EDF08016664BE73364F65389F7C3B66623AD1754ECBEF9E5CE6948D933787 +A5674279ACB2EBECD3B4E6361419AB32028A27670C9F3E18B746A10B00AF6D77 +4EC00E3BE521C02A99AE5BAA98F793EB1228952BE67934B91472E01AF7B816BC +56D7F19F631A1927846D800C107B1E9CBFF9D2DD513B4A8CE2E0DFD77B1ED178 +E43FA7052765E9FAF89989D490D8FEF6C536EC0D4AE27A74F474B98DA9E6B92F +15E063DB260571979A5DE2423920CE1F59F56EB11E00E3BB9D466A8263E1E385 +2014BEFDA8D1EA3EDA04BE32AEE6CD15C5C010A1DF7F705A2C0C18E87C8DCCE9 +05D9163181CBA56C0FAC8C06A2990554C8E759D076B01BBEADE3B5FB8B551390 +6C8E4A2A1C6E7D9C708614626F3770C0AB7DD2027469C77975C27576065862AD +04E5E50CEBE907E3E991FA0C627302C0E207B4D5992BEBAB5853AD1C0D271728 +C76F40A79392ACCA7358F948AC65DC823CFDA59E1FF69CEBB6B7EC3CF21669E4 +70D999508F9C49E2D9F8818CA53C977D93E15FBBBAF75B1E84F0BA62BCC4BAFA +4EEC82D804C8A8C0210F3E5E258BB1F6921AF02BA9861BAD5C3D5FC8CEFABA8A +A607E547B802096F7AEB09FBA99C83C9A494B94408DD607CA6561A6E6660C473 +62CF8D35F31D052F6C6C8138A8E1430CBA7EA6973D6D510C1A06B3FBD79D9364 +240C1A00272DA44B89A9FE8D5BF36DC1B5EBB4A78ADBE9C5EDB485F093D9517D +69E1AC9A8E6C9D7C324E3797CFEAD9A18E82E03F69B2CED7D5DDCD1A218BF2E2 +ED2293AE999FE2A4B5213A10083EE0407BCF8007670B8C737EAB30311C868D84 +121149ACB4A27F3ED6C0C181C98AAAF51B105F264B5672D7F745131ABAB5BEA4 +0C9B43C0DD9116D6DC61F90BE72018F290D26D5E9D341055CAF09C9F45333CDB +D45B7954271767F638EEC499F7B53C2CC5774EA7A7F024C4CABFB93D9CB1856A +0C671A4ECA7C62EA5242648A84E7F3AFB9547A0AFC29593CFCE6D8B873A78157 +D337CABD291431C0A2CE1F37E0CD7340567AC206FF98E4B5A6410F70F750451C +550EFB54AA259A1B236CA9CB730D2CEF125EC65D959441F7CC9768F777B44844 +CC9842A307C72B740680ACBBF6AA35FA7A94825069BF7696ED81A371A9E5475A +9D997F2DFAD339AADF797F7E03E654234455AC3D17702A420EE0A597BA31BDE4 +FEB8DBA7C61D311CC90441A620164DC22DC2D373973EF84CC553453AB1B3337F +7B39983B8DFFB3A9425F119B45C1CD37A76F905777B3154CA6200792F1759D06 +E017890F4041A385F2238E3C48B6C8EE6F5258463FDBFF7AC762F6C4363926D6 +50F004D473B7B7F73CA686B559C2885F1AA761653C727A77D73431E9D110E76A +2E55C68CD50F43997C9B2FC4710F8C8540909829E215678E63BB8363C4B8AF05 +9986102BB36580D9CA95CD216B7C321822CB41B2E0422CD077F3B55E0246FDB2 +44D5976F67296B5B0BE4B06F6E43535C21164E6C5089C3E9BA2D6B30888C57DE +49DC8D9D46C0D5EDC47ACF2C03B72DE3B69512508539019B759280BABEA12BC9 +385308A0395C4CD33182A10A5A229743379C2075D82D8BFCE4A66E1AA087A091 +8F5372684FA5037D1B92D50CD9CB4F50AD4F8EE7D51F1C9E63C721CB5B9BD011 +6F0A8DD4FDCD2B008F223A1036D90F0F3B252487DE7898F9AFBB3A9D9CD49E0C +EF4ADAD5155A98D2125ED5A3D3907F67301649519419F33CD942E8DDEAC1BDA0 +E90C431B198F646766A8FA9F8D1561B57E126EF604838C0C1966655CF31FB7EB +C8CCC434FC1C96046D38203E1791EC824A3D7AED85C029288D4608CA7668A2BE +484C99639F121845B22EEFCE0A3B808261921AA042AE19E641769E91277BEC29 +4594082CCB3058F90FAC4A700A8A827ACA00FCF574ABC8EB7DBCECD97F2B22C0 +0AA19E8739B81AF8C6F621D69B8E6F29BAE233FBA655A0AF5BDFD7F5C6B9167C +6BC7AB693D45EF2AD999F5DA3CEFA39BA48A17EE6D9F2C4DAB91AE3F0044DC3F +5D5506CE4675AA928B0092D6F173644F91295216D8BBB14CDDE0AD524A4D545C +1B5E284A3BF0396664081CFB4F186A84A0D24D61E82F4767C1E55A0642720CF3 +909FA1AB8EAB78030B59BEA067DEDBD2F1D0340E790AB2777DB18248521934A8 +BB38A58B7F633DEA4291B0D5D13E9A882C974697CC6D3B49E030C94EA29B5506 +CC29C44D01B4751B453A46A9F6BF3BF135AE87A4CE232AF57B66578310DE41E0 +2A6AC422117F1963C4D7CC306BD25A6E724E51921779F22F029733122E23E2F0 +CB340008813ABB104380C80A492B3FC6D0BB07CB8D8409E9576891EF6E5C9D08 +EB8320DFA31BAFFBD336D0C2BBC3D3B2D30368B9860768FC080D30569C7F7811 +0EBEDA2962476113625EEB555490B8CE4C5F99D74ED10F738C61854CFF8B41C6 +9402E56BE8856144A1A05D0B05F4CB7EF728B2F4F5A439F18C3B68CEFA41E59A +D8308ADC92EC1289DC84CF48D2CDEFF509A145BF945E1E00D552D329EBD2A7C4 +21D58082CC8FA790E981F4AC8EAB99950678FD3A7DA3DF13778681B208DD71A0 +7C3CBD0664B37C9EDC6B601D79A2C51FB54DAEE849F93209793849104E722D3F +52DFAF7047EEEDDFE744787A5801E4AC2C3D58EC5DDC15FCEE03990C53B0C57A +FC54F125A04C8E4A0ADAA725808C587E7DAFB9F784FA2875689979D316DC22BD +AA36B306A1ABCF907B63C6476737B746099973CAEA8C1E2C5C41F27E0F7DE8D7 +F0D942E34E92F43FE902653D4D2EBB6F3B9F7928B1550A82AF234D45D028F429 +067652BD3D391BF423AE72B9CB1E8D91E898161BE3A7849D456A861A2046711E +E934DC59442AE7D81661CE8EF727D8D7DDC0270E937E40F896AEAE6171661431 +C1025C53172F9D366834BA0054FBFD84503FBAE328B6FDEA180F8EA35B1DA937 +5CC3B8F00C206908C2FFFFA6A7AC6915D15EA44BDCF29E2BFCFD4A849535F19B +0D307C696BE8205C7D84B9C77F02EF27D911056EDBB4080E4D3ED72788666CAD +CD91B0ECE27A177DB23320A7FA9C31408B4D02D2A4B1CC6DDE1A6CAC3D8EC1EC +2226EC98E51046D1EC26FA20EE62D24747D83CF4941DCE5CCEEC0DBE387149CD +E05B19FFCAFC0D117F9A3E60DCD4C815228D98EF95EB559AD0ACC0D50FFDF714 +56C3C812EA5ADBB013BBD956A7C4CC0ED7D3E25D5C9AF5E626F18297F75D4957 +F5B0B33379114B903FE98BCF35C3FF76FEE1D9AEB711F2962276531F7380EE3F +E368720E0292A170A15C5539B1FC7BB954EE2624B504CB8C805B8D31AC38307F +0513606F09211AE64DAC447693B2A0AD15E9A64C34F5A911ECD0ABCA90E9791D +67C6BD202B0858EF96E7722305B8AC02B01AB1706CC6AE875A8DDD15EE349046 +EAA65005E7866B506EDFB7A5A2AFD5C9E9DCC821A79EE9C1EA2C7BBA32A40BC7 +CEC26DB1AC473C8C3960ACEC581B37D6569E8C8C42950BAB7930B65E1570E3F8 +9A7FA719F1DCFDA45A3BF2AAB32C9A93BA3552608A61C623DE59BCB346E87EF5 +9CF025A87803161221C5C1C6F6B3403712C76E9D755C7BD68D7F2DC03C14CDF0 +C1BBED1D648B905B4B17037B7263C1EA7A7F06FAAC4E09E08483A8D714C19861 +327CD9C32DDF850302DD6DDE24912D00C22ECDF3CDFB18FA831A41A7488EC203 +F564CFE30D506F0829A96D35A7E09C3DCD107D589B627A15B55C5D6649126BEC +60B88C55ECCBB4E680265D9EAB4CE22965D3B1AF759B01ACB0D0E6C92B6B4EFD +A81E6A648708979487FC591CF09631310D46891423F4EC159A73E30D8DD147A4 +B0EACF6D45D18CD16CEB8176F03ABCB41F2234747B9733C8FAF34AE5D43D3BA5 +0CE0FACFC9B087F84FB6C68678BC6E76022B1526D6E5B3A48EC1A110BD75F45F +1C4DC6D39F254976453F57DF873B7D635C80C42026DE020E5BAFE0DA0D54D1E1 +DC634D2621BA184347E5252F645A6A1DB7657C48124186F0E4C644077457C24D +55753C651A9A7B6349867641464B515B821349C795A645420508673B93750D0C +7A3B33EB1F09782033742AE8F3A23FC02284E6C03818FADD1731361542E3FA3E +75B8D52B668C3E18A4AE967D0FC3157083D952AFB8144D549E69EAAC51C279C5 +E5D88A0D9D53013DFFB4352A1598FF84DCDE6FA32FC377306B9B92C0F96EE149 +8CD55E7B2445B86CCA7A547FA732D52D59025129FD8C6333AC0DF4F0CFF6287E +F2036D5DBBB3B91B92F12FEBE0B61A313A4DB5A9CF0BB3DDB781A56FEBFFACCB +8CB9D1D3DBDBC4CB6AAE6769E470582403CB920630221B68BCB625CD4605FA8F +D3D5B7A1A28D15E44B38E92E906C138E72C15B86F64C38E23BF0440052A8C914 +54397F49DBED99D0AF7CEA3B0A05FF37C2D7EAE1412567E6776333237C31E3C0 +49949EC8BFD6E0F6446CE2D4DCD2C1524A288818CC5D159BF8463A847AE4A2B9 +CC8C58F822804B81B13BF4F2DEB6229C4F51F093075581791D02C36A13B855A0 +34900AA7CD4F1A797652656FE3A8425A38F421C4CC0ACA1CDD44FA6B31219276 +1CDE1CD63D6A58CE705CB56CCA1260F9B86E989019071563A9B4C274A87558CA +6EF1660D574EDA276801F0057740E2C3B80D253D697736484D892CE1AB128B8A +DECD69712F5E70E895FBAA927E8194D792A04AB6CE205E04E38A433BBB793FB4 +E8BBC4279D58A223C6673D909D6AFECD246E66A52F4CB35E5931D24C828489BD +4ECAF621A220D8ECF702BEB01C4FC7510197D3F6D15321EC87175ADBA6434ECD +2B5A306E91375CAD22CD94301763E4A8B981472890422C5488FCD523C9CB17DC +ED22FBF12D5F7525D0D6BCFE8CE85B0DFB1D6F989C267FFBA0A996D309E4A934 +3DB54A9D29C88B9D55D7300DA3D46419256C5A07A2A529A8DE8BD1727281F5FE +97033D861E0531B14E811378EC1AF1CC7EE9BA2B07D935843D3053F673979F8C +FAFD59D555B56CE338F606747238B22BD62C42BB7238FEA335678D474A643570 +A9E7B4970E8C541CE9DBC7BF70ED7BA33639D6744A18379455029E934C95E2EF +639C4848CE9A0879B51649FAB023A71782444B451F92A34CB8A124270CCF86D4 +D18EEF5C1D2B2A29012613851C49F50702D63BACF95EE2AB4D72B375E0A62615 +E0991E130A67ECBA9E05329B740708F1CB148724C3A6E5E3AEC1F88EBCA398D2 +1CA8827C977D72734310233176D1AE26C55CF2CEACA62223315C28FCF6305C7E +A22414D4739A059F552F1F9372CCCA5FED4F9AC987942848EB498900269511F3 +F408CBEA0659B954F5F1B18AE4FB270213646F9B28AE4439D2BA2D3E0AAAA780 +5E530E4EFC8A060EB979E12191044509DA0C14397AFF949E12DC970658D5EAF5 +4EA963F5BC1407A32F3837CA6A24B7F3D60EB8E6222B702E25ED903F9D21AE50 +664A095009BDEAF4B78DAF94E5A55D48366CABF07791A1684B2F54EA69070844 +4F031AF8DF416C2D3679F8BA038B0DC9DD0400CA6B34667BCBBC07E62C1668A8 +35A8C57C9048A7227E672E89681B54D662079A189A9E96A3CA96D8DD10189B04 +1DA49BA2729F1CA585B1BD5C467295285D52E47CA904235A1A3E48EFAE9EB6F6 +01374125CE89D53C276858668CF45D2F092DDCAA52418E0BB94C2B8266B4D88A +5D911507BB1DDA3D8F6E7C14A91CA11AE799EC42E993098E18CADA70BD2A1D82 +2C39326C6E3F9E84CD9758B9AE43D79BF99E6A0CD713E95B3D9B7DB90D127DE0 +DAFEBF850CAAACBD860B5DEF2082F1ADA64B44B193C4A1417BE221FDCA36456C +BE5934C8CE3ED55AE3A11697C2D682B7D0F72D48976451D205783BE25DBD2507 +39C14FFB4BB828DFD187104F38A7F11D5F0698C11E8C1D4F107CACE573FDC4B1 +C56FDAE47024D6FD16A2FEABB434CA320300FC4B6C1B6CA08F76C60B7C08A665 +99F404DBA8A2A1EB18EF6750E4EC186E31561A3F080BA6562967546715859481 +7BA782940F5C5D06626D6F6A412CA7C13820EC7C1DF23E15E5829F698CF617BE +D940523E4EE4ADECEC48C24297DBAD528BA1DCE7AC335A1D15D55415B108EFC8 +6D45030D27B3EA63B2B4CD771DBE66AE0218ABB1153D4B7482289D1313CEF184 +5C960B1E3C3C953912CC6F4521D1E15636C1545EEE457EFB87B88C9E43CC2F38 +6BC4BC96969F4FF28ABB06F4454C01CEF1B6DC538F1E832FC1666D977E5A881B +F72F1B4C7DD4BE167A5535F1163A0706F9A0B26400178DF8A128FB5EBE6A7B81 +E478AD183EC06622B591337B9F1872AAEA356F4FC67EE767B34CB5A4D90702D9 +39FB846947F4096FB3DCF16EC81455164783BA0B5D723060DAFF411B68307E81 +7BEA1D9A47A5AA3D648E618C83C60F060029E6EC4D46B045FA7415BAB2AD0AA5 +ED9C729C24136F6AF61E6409C0B5CA760B16225641E268A68CFB8260BBEAFC77 +6626EBD97195E77CAB425CFB0096D805D9EE699E41680D095AE9FA10122A7882 +2F00F495C9EB2102DF0D3E61833BC0A2E468C5CF7AB430FDB7C0BE3DF2C0D230 +1580BAA25D65F599378D873165482A1FBB224AEA89C6BCCFBDBA42AE1C5DCF41 +06969F585CD3B737D1388D6359F5468D88FCD2279BDB270F6A858FB7D2ABDEFE +5EE8FB79FA437F8F50237B92C307B73B0DCB808D07A9C3255CB9B3B17039CE5A +288103D05D132863FB522A02CEE3839EF9AF7F07D99732F0B8B384745369FB3E +7901166478F4A16076A1504C5E98D17408494E270BBF4470ED12B4332422679F +759F1D93984D7E506D16950DB6C2682FE1379EFFA6F6C95DD71F6E55BE3EF6AF +E0CB25388EEB436E6527806FC75484133F6E561DEB979D5C1FFEFDAF2A6D964E +03BAE0BD593C2992AD84569C81050F7A793C5263E50C2F50B98C4CC703EAE17A +6AEDAACE312DAFAF5278D125B6EFC5587484F61DAFF46B87B7C9B1EEDECA4859 +314A9A9E2248467DE1E54D90DD671660B9040B3E0DD982260822177EFD757266 +74A16C83A7FB168016A320D3DF3BD7726F1F4EC90EE5DFE810C96B099FD4368D +906AE4699049EFD37E8EF058D4B97BF71106445AADD4FC6E90615A0066823A36 +673B8DE32322BBE861AE251226B4385AB28702831270DBD25D666FBB0AD7B96E +A44E891EA1EAF0F87013AFC982E33D67A28E96E0C9CB99B9E4192536830D9901 +931A8CAFA41289633B20BA3BD7AA3414B6DA8D57CCF2FBE39920CC06361F075B +CC40335DB9A0071CFF77F6B7BB47F3100DBDC9C4A58C2B81EC99E8E966AF3390 +E3FBCC28BA1D79961C8A1584266454DF772FBA99664D74D4A89FC82FFEDFCFE1 +4C9E4A04291E803D142E37E7ACA66AB279378F2F192FFB2B5BBAD18B95F03136 +2CB594A3D6D3F8576B90A6C4DAD6D6C8EE07AF682F925F01D0B26CBA347C03BE +F3B0585CF4539FDC66915E22117078CC94D621F31DCB3E021998A5D6EE94CA4B +E214D07517283D56973D8E4367392BF6C1150DEBF459D141AE0941C1C8C5CFBE +E735D796E365A1B0F60BB4CF2801EAFE4889EE5F338D3C4885368281B3C95CCE +251C28A90D318A8A0384439B38D63B94757252062EA44E88509FDD2E75FAAB71 +7329622828B2785C1A8B26351BC74237A6BF99216652ACBD4CCF54CFC8AC72A6 +46342F1E32D4318E7E27C7B2DAC943B3E72C472FC6F1DDA8684AA922516A672C +E969C047E318B5E3B1270C1BEB1C4071A15BC81B29B268C679B41FC5E381BE33 +DD95F0D68118CBB60C521E5CB2BA46A10E50E9238163713290DF6DD8A27D3813 +F871C07E725D4518013D9A84CEC96782541E5580E33C2EBCDB18F08EB4655A46 +507A8526DB26C854928B81FD502B0CCE4A68943C12078F57C10F4E85FBEE1025 +46D925B8B3B447D4920410FEEB9844FABE985F9228FDD9F58392F2F3BD650E49 +2E3AD5A14984874DF4572816931885CE8A448EC95BBF40DDF4F85653AD90A88C +C4A879C0C7596E61997B972E8A55E57B17F802C738E5C7A8FBF6424F8B131B23 +CEE3EA3747DB066246C250EAD335A76FA166ABF75120CECB59076AB31A51F176 +57176CBE8C802A97B0542A5CFD6D5E6D7EC848B923012E45D9F065BFFA0D03E6 +788B68BA4DE51DA37994948F859D41C28BA939C3A82BFDB44DA585AE80B8CD7B +A6EEA79B70BFB4864E06F06A9751BD2D2A209D150D7135E0A25D67263EDD2A7C +C63B5B76ADB05D44BD5BC0BB3EBCE2E74E1AE5F7DE07A59D90C932DAA2553505 +27F2AFC05F7CEB39E1C7E54F69FB0BBB069959F2FBD11709F8E81F6E7CA06DBA +1CBDD8E7A78487462596DA288B50B295E46F4C3D9BA862688C68859734B232A7 +4B371D2BD786924F186524765E789EEAA30B20C069322D42C893A30BF1BD2C46 +F8F3732DDFE80B8FC1789239345944D8B457824FD80D11184E73FBA30EB80A9F +2FD466826D4E666E3A835B98A1D4AE5D17053A6A648E26E77BD08F9A3E02956A +AE82C4929E9666F539079846527D0E326FE7CBBF86E3722BA3E53F8A5121080B +ACF8D3C67A2A1DF624B9DB92105D3C833F5A6ECEC108E026E1D3D968967A1447 +15CEFDD09123D56606134BC3449404ADAB1330C9238DE48F3CDFBC91EB86D7B3 +8B85B5BA97376A0673E434DBFF19798EA90BFBD94493E2D21976F8106FC0C276 +C81C9B9F7D4A68120DDA56FC6EC65FFA40DB78A60A05EC270A106DEEBD2CB92B +F0622BD2B1D43771DF39AAD3ECB655F317AB483F7290C148690903AAA636583C +99DE3DBA99EFE20773D3D8DDD816A28D7BD8881DE570BAF5C7A30679179E1214 +FCFED81605FE56AEA21C1894167F93D648B474352A65C0756F812F97AB435ADD +22C031A21714A626DE35308AC51CD676DB1748DD2773532294FA77CFB2AAFD32 +A72BB7A045F12B4934A768F89217233DBBD69B900B28492A26713CA5D61A9042 +A982CB071F1F875718FAC168E4E275860DB6369B8114E1BDD4801110B62C3E3E +CF140554C826967A99F4E9726526E87D57BF845CE38E33893E5F9788769B6A4B +A4577C38C8D45AF2EDC9F4FA7DD9979AB8E14FF5D8956233AB4C02982BE8E561 +C63B7BC314793F634DB6F086E1A60D9FC3B69D3A7C20A99FBF3CB028CDBCEB60 +E803C8DC3C5F0CCAC030905E72BBAC052520CB0E40E23B46B2150DE67F61E4B1 +8C4D55904B7F90DDE4A4A78B11AE1009DE46DA396791B1C0EA63FB6897FDFA0F +42474042E7E9B06A703A7C6E672AC6705506F3C0B6861BC85CEBB9DC9BCFDE0D +43F5248CD7CAD4B89835BACABBCE6C791BC35FE7211E775C009844FC75CBF6CA +DA6A6B7B488270BFAFFA3E9950914CB0F88C8AB7CDEFD2FDE11ADA7073037EF3 +1A5CEEE37090F3A56D06FBC70597907A26498593783878C02722ECFD5D65903C +7D421CAFA78924DD27756853568535B02533C3393183D6E30DA6ED4BD6582E09 +A5A4B4404EC452E91CB44515AC6124EBADAAE8A98D8A95E7D14DA39951EBC461 +D426490071462F246794023DE1BDC04AB0F1834D50F748C3C60A07E1FB8EF400 +78DBAB90B59500BD1232A872ED51928329CC8F06E83164FBB2D0B24222223EE5 +992241E8E00D5DCCD6DB9A8E2325ADBE12FC8512AC127BBEABDA739672C1644B +554850CD75724E6779A7E76424CAF89E9455860E0AE2679231F4A535C0ED4336 +313717D6F7A4A4DA833847A1BCFC7BF99234FA645F2B85C9A9AAF7108931E3CB +077A9C571E57B0D7EFD92B56C3AA4FCEC0BCAA96005E649AE8012366BE6E62CD +9E742F8F45AE4C96BCD73AD80AFB6F061D629ABEAEC3018CFF45E41F46751953 +44E490B1355DC49C1E10BF343307263584091D122ABB1E3892E532B6DBAA105F +CD48375C112331EC5DB49E4D4CE2D126C9274B21E678E5E3EAAD4EA0CAAA29A7 +86FD8819217B195EC6E40AF23ABCD71156656DAD38C931C8730715A2773DC44C +4DEF14D92C2A054739F27D7EF349A0EB76D952BD9BA169B4F85C09D80984D232 +2CB4A3812BDE539DC79E2EDC7C221739D16B10246A5F57151C210878556D4176 +31EFF3AB6C4D78C4F0DF81692B3C9BDE4F85242BF0E84BACBFA39688BB222A81 +E85E9CB332868ED5B64E140C66E242B97A90C13B6DFBC3D285A49BA9D4BA1A47 +64D83577FFB50BF974D953F42A249ADF9AC228CC4D8E82213FD463BC757AFF26 +DF4D1678FBCD55AFD5FB3014C0380B2F8CA9D6400DF2AA041580A6FA5694ADBA +674286F00E531693DB28F7C996D5A66F80AAAF53001EDFBC065C72FA5BE3F114 +1FA3354376AEF7374AE1D0A8E9B06C58FD029922164DC9FA09343FB6652232E2 +2EE34C662F0092BE479D739ACE775C6F589775DD768B736F7391B9AEBDE7F760 +727702E145CF749DC457B2E98A36C52416107B1E59084B5F777B61511B8D17AC +88386A7933CAF852CA23FE179B67DF8DCF15800755605847ECC0FD77873727FC +1AF2BA8BC75D30E26C40913771E528724FD7C5DE284A8B58AE55A5C48AF26AC8 +02E155B8FCD6755D8F7F5A6F1AE66E4D24A13567B6463B18E65972BD75ABF732 +FB41F87A62FECE9A50C697BCEA1E3B3DF1E3DC961DCA598220CC746326F85F83 +72E803A4E69106EC5BCA01139F92171DBF9964BBEC8D3370039623CA1F927CBF +FE7DA71B04B4321EB4D3FCB27F8404994CC7DE5F26AB8FC019A203D6DF2F449D +85A4F103F7604986A1AC1F7D05D239E728FD6AD1DB5024B0A0542130D2B0E7EA +4432F910F9FD75568F5732EAC95F7A87CEBC359949C26595741533E952327791 +87E42DF84E1064E1BDD3F5A6455087B8E9C783AB9ABBCAF032E9FA32C27ED7E6 +CA7E3D1D76CD1905166090BD81A85485B9B4E976DB2E19A8E62EFB795FD6298C +9ADA57D5BDA2FEBB227F0EFEC59E4B51E06B8358006F9D79C1EFE92510D6046B +6AFEEDC793137DE622A8B3F5C9E3B21F29A98A589D9CEE75E348FD4D206415CE +508AB95A7496236AF1F6F5ED6B3ADFBAF1E35B51484F9B1E0C11C5AEAB9336F5 +A8861ACE1EC74C4A145A64E4FC8F6BEB3A16B021AFF4AEDA59B06326A8D7FCB3 +3B75F9729BFB7EEEDA8A1774728C80AED40BC35D42045E5CEEBBBEFAD2566CB1 +AD69A9A972826DF0F2303BB232367E611C115E8955DC97779B1AF269B84574C0 +9D816C88BAE3AACA6428CFC648FCF0869AD9236591E3B8FA326BD2EDE7F97286 +511C75F4EE4F7B4DA33BA2CE7F778D92AE7C1B4844CAB3ED8FCA285454D78469 +1639D24729E8002E4507A114407DF51543CF7DFFDB7E05ADB2D36E139F2DBACF +D90AF274AFB3E5AB5B38918A28EDFCF6EACA78248BEFDC2FAC0E041AD35B130F +8A91E20251CE976680FCE3F8B65B33118EF7C138CA1260D3CA855C94FCC02CC2 +B29C94A3FFD38056ACE512DE680DA29D97BCFC35FB2A85057E484FC9F72C9A7D +08AFAFCA705335C6E9AEDAFA97D884E0E463E79D8AB45DDF86C56EC922283C4B +777EAABC0D57BEE30D4D47FFA16FEAE2FA972E36516480E1FCAFFA5CE692B7E8 +8F887C5AE573B96643F10BC62FAFA4BC6CD04F5353C0D40CBCEFBBA4DE7B8960 +352E7F6497C9C4489779028934084522336B5E5DF6FF84A78158ED5035FFFC9F +F199AFD543D5D81C0155F3EE0E7F6FAF7898F7F26941D417F7AB37703FE67D37 +C263078FDC85C5430CF379E657FF9ADA0C00DBD605386F5494459C63D4AC057B +2E061B06E17B54AEF38A9EB401FD4C76C6755F2AB651473DA2F19E28C89229E3 +FD385D8559EFFEEE5D0CEF127A8A6CF9017459466E0FAC341DE1994C03A0CA5A +799CCD03DD2B41A05F7B36493638AAF8D7CD380E03726B0A18B02A46A0BCA027 +9BF16ED75AE0494C36161ED2C22DD7036FBBA2E319106B9A56FECC732B87E2F2 +596167125221D42DE9D4435DAD321F878FDA68B9E72DBC2E31178621327BAC50 +72148C123D4C8568DE822169839906B9F0ACAF3B4DCEB9352C8A9E246A9A5EA7 +31E04981D0A53F44B6905704CFFB9F0463518C02538DEF2DBDABE936D1213FBB +FCD28F833C5872057CAA92536B8E8EBA129745E2E2B5A9F07086A1212D466785 +EE640432A0E47C91CCFF3FED5669C8ABC2B43551AD04E7A2FEE2F3C16511F7D4 +048A8207351E83AD32A72360A2DB1AA8F78C5D2630D770F5E13D5C49BE166475 +79483B2F7FEBC1D73B04E0E5D9B8243DBEF7E5D201D9F644B150A230B5CF9B90 +CA34BB8474BCF408E37757B8CE5B33FE7400A68C70F542C7E2A22B8C0AB1EF9F +2BBA7A646A4C872C43C0A748F078AA98A13E882085B460050CB3F5B09B62EC01 +AB87AF8DFCA6823ED6CF8426EC115C5E4DA335FE416E1D37311B7FD56793CCA0 +BF90B579B0FD4E4E1D0A26FB0C1D490D99CF4994693630FA343960E15AFFC596 +49BB7297BFB82FD56BBCB36DC1597F94A157AEDFC53419BA867CC02C26464BC0 +2875127C688DA6902567716A908153DB4CBF710CDBCE50AB98E0CCF1DF5CC571 +00027F6582CF6AB4E584436471D3C8DA2D780E5B02A9B1717364899D51EC679D +CF5F4A4981EDC24F710E892772E4F891AD02B7B98A113FB1AD2B5A51046693A4 +19D03A75A3140C19791C85A0DDD173BB3618E9498CDDC8696CCA6EF81729AD1E +EFE4F3D6242E1766A3079371D1D1833841F46F04F2F8029D8C1943F6986A95E4 +9E77806F221CECAFB3EAE0F979DADC5D2E4715BFB5C64245CBD2300E59030B99 +0885F08417E1A0C57C3746230F9EF4E968C0F41F67706BDA2E983012BF317612 +38E9C0178F027EDA0E679F306AF71F0D8985C712C4B4BBBFC57A86AE052CC2FE +5C1BDFD948801509ADFD4FF9FA7A25E30D6CCC7C7E418EEAB34C4ECC6AC8FADA +637B5CC70136EA5A57B727EB11075755A7840215CE2B9939BBB6C3A7E22DE42E +B3725C1AD0BEE0A54C0B57CB93E6A20E319E2FE4515D80D09972E0A742D20DE0 +55117C1B9F3C181456406FCA70A7E3B757A813F7CF9E3562EB8CAE1CFB65DAA2 +B384C17AE103C20851906846AA4AA5EEE5EE989F292D42B11EB4C4FC057EE4BB +B09A4D81E8AF0CE1C851B2E328E977207A6989F13F7FF039A4E295507CF0A53F +10A345A516EDB7C5FD5763CC27543452249D229BC22099C6FC1DFCC07A35144C +6267BE8D5BDCE57F9C7C65F6A64A74DC2207C8601231477DD57BC8259B26C683 +22FD4DBF0E3BD814E31C9E194CE2EB212268A249216DB084226802B79DC72AAB +FAC4ED3AF6BC51E2D9A1D5A37F5124BEBB1E0B010C34A1B7FBCED45414AD2285 +43BE684BC7BB56C5036D182AFECC061F749522456B4DCD80E3315F48E7E8AB98 +40C4FBDE71DA957C8FD860C4AB02C97578BC8299EF448A526CFC585F27EA14E8 +88F9928CBF87C8E46F69100F0CB43E2720B0BC8DCA50D59FEFBB84383B4036A3 +0ED89F67B433AB4BF686487194107C63BF989A80D761EF3FB20146A0A496E5E9 +26375866581146F3537156051C61F82AA5C68B6E8418297DDA7704EA50262775 +B96E1E1D7643370288780188ABCF25B9B23BBE408EC5DE254F51469D5FB06FF6 +2EA926F94CF1730E014F34822ED267643B773B7CADF967D431B6F3DDC998E56A +243880E9F772F3BAB3702C19C5DC92ACF864D6A771783E178F4A7BFBAD36008A +F0A61C5B437A69E31235DDA9898B4B081F1176C197C0834CAA25FDC9BEB696AA +8ABD1FDBE17E30070690EDA533E2EBC19180DCE4CA8146D6657BDDB765DDFB21 +D0CDB86912E49DB109F66DBB9226E297945BCE9073E724EBABB58E42AD94CDA4 +C9DAEC40F79F3A3D36777B18C61DC9D22EC351324FAC3426917C893E36C8D953 +4ACFACA05F8764BC61A17F6B40D3A97177B97CF88C2B0023ECB3F29F9CB347DC +E686012FB31904DCA042679776108D9D611EEE971D341ABCEACBD0866DA21DCC +270D3DBBBC9CD438F4F651B58D1405A82960CA991CF690B8B564033154645D8D +ED5E4E059D9DFAF3A5C2BA1C1AFE1B865901C8D117262CAB210A3C7A03443544 +E22EA5577AEF1378A9A4528592F32A8AEBCB1CB6A7E4948FF78C6FD230A5892B +D8953ED89392929FB91C042D31E7E8A4912FC701E722D7FAF0308625B3B748F2 +26DE427383236E131022A95395C72B3DEBB139C81811582FA4E9C7F970FA605D +C8DBB3ED8B141428ACE6DF426B2567B10C5D68A4060F25D5D64BA262101CF5C3 +4B7948CDEB6CAC66FFFA0F1795C5F3174F7D319D252DC2D22BD08FAB54CEA742 +64C0C6B94BDF182DC0942C0C82E82A0B04654A7C2E6BE685EC3DAF1D5FE48790 +DA815DBBD0A176BB4D4424ED7F893B4CED54C2EF94D73CBB154E547CD33D874A +E754A17AD1F10C23BC5FA4E709330A10A73C93B843D8CD8A65D5A4241B35CD19 +938F2BA2FA95551F0C2FEF1CB8B056D9A9120F7607BD4C497762C577B66B2DF6 +8F3F661EBD7F3E73E3A0032790ED80F774423A026F8ADE2FA82129E1FF27DB3A +1B6E603479668FD783735606F7AC6BE9D65C17F7ECCA3B622C13F0FC95F8259D +DA4801A7EE18656AAC3D730CF2E17FCE8657AD6289850DC06E897A759F7B53CA +502E764B07FDDBE6E99D25ECF1600D6646622334871C57133A8AFD03FBBC2368 +1BCDABFA9FF4C4A9EF150045F694A3AA487BE461BDD2BF1BBB38BBC365837063 +70963C7C1E7E4809797F4E497DBF6D5A90A71D6E89BEEDD5D16B31ADCAD67A81 +A9A3085B4CA7BD93E1A9591BD4A7C88FF930EE7A131C5F3338817D88AE31813A +C09D5E7120AFA6565B0A647A40CA94B78F20905B7110FE44A90794F7F0CD63DB +E99675C781255B7BA257CEB14DFDF9C13A02701B0FE41C6A6F50CC62C028A3BA +E9A918549B7F9F206DA0909F2009CC87BBB565F281F24D0ACBCB71F12709DB31 +5D355415D97F66DB25CAC37E90BEDB51F2FA97E0A61EF85E845F702D0B3AF935 +14F3EB201323209D76C7C5970AEFCE4225FFB4A1477B177BB52332AA0539291B +9B8004F23CE4E055F7AB6D6F2A8E74C2994306A407A4FC831D1C887C42FFD0DF +EF07891681C7F4AA914AECC427057A8D73261E25F82DC3EEE7295C0870E91523 +E15187584B32B8F8B0F2E9BF4E67E5A2858F00B0C59DA1B1B59B00374C6C6AD9 +741E0998EE0DCC6F5ACD1925CC40807D5B66E971CDCFA4651BBF2490FADD15EF +C8A7EA3ECD078D34D875C3EC5EDAB74AC0DCA00F2329184455C24C97EB0AD4C5 +40B8E4AA2CE6E7816580F9DBCDAE7F01AF0533397CD37C401D4841B60CB976EB +E3093FC863F368C85AECE6E6CF7D9ADABDF628D9806C1269A0EE06FEC90948E5 +CBE40C0A2C72E08D9AD94F07470692D571F595E465CB32BF486AE9C3971B6F7B +FBBDE2699E1FC9DACB156D880DA379262A98C6708A9850FF8EE36C35FF636E46 +D8D00FB3550786C1D73E6B91F9B35D6998F33BC953E0C8AFF996F4C707F8DBAA +AFD76432E45605D5E703C2569856A0BD8C8ACB29BCAC87F1A72F859D20205328 +6272929343C1CBCB053D7E19AEC4B2EFAA765B2002F43E7F62ED5281C94ABDAE +750B2C88B3801559FC6DF0D66E55952FD67AD41718D49D35DBF2B7CCBC1E755E +800ABB45EA4D7547756CE9E6D3AE0B80D8D97D681DFFCF4D5D5330F0FD6AA729 +5BCB1475F18E9612197D6F5F7C7AE8FB931C242993D385AAE7829391D370819A +496B9518C6F913E666C27F0896C7684AA1DB1A335C7B50762B4F8445D45C907B +9E30F7FD84E403DACCB0A8DFF2940312386C315FFA700B0E42242EEE04042E2A +3F4840E719A42FAC426870CC20DF083537010550A6B43A02A330D92CE15222FB +BE6A9F6EFA44F7987224533983D96BD2E1E536437F89E2E43884AE09FF5C7902 +A284704F78AC067C332EA207F53CAB61ED51EF3FE79A9B7A373C3DF72A4F3A5D +67B4F60BB470E5D093FD880AD32809160E550CC1EE67E01CFA80318C03E6FDAD +A8E744FEA593E2761C60D2CE83F3F6D3A2B203739C62A69D4E271FA12372C45F +6C378E4CC21B9B0CBFCF43233562E4BD4D52F7A634D1F0493F8DE445D140EA4A +D3956E9971263B7C3CAEC8AC83E541D58F52E00C1C80EBD9A31F0A9D17FA2D63 +E5E0D22CA28D51E39A055C40AB769EF224AEFE2AF714E322FDCB9770EB00686B +208AAEE2160D059DEED823FF4F9769359C183A6A6398F9E4ED55397F02C68FB1 +016CB495A0599DED25BF1006343DF9AB7C3BAEBD1EB2F99F4FCB07E84AD2D959 +D1D573B89C220DAD815D9EBA41CEF4D664630082DB97645AEA6779A8F0D7765E +B76A4B8B429CF95F22474EEF2FF1C792DD525E50E1EE0A1ECD78570970B62293 +43DBE6E9B97585B754AEFE28E960B5F8B3F549EC7F168FFFC5EBB52C7CDDACCB +DF9E1FD89F2F8CEE44285E79724FDDFED021AAD2025006239EE5CA8543B86200 +C7E8522668B07608615F6F102E295003B1B89264810A2BFC3DAFECFF126B1807 +2388839274203BEEC2B319C7F263ABBE6B181FECB5FDB9516E8F0456B6A1BEAD +7F45DB0F95F4943B2ACF52CB30DFDC6EC936A6292DC2AD0BD67164900CECF3DC +097528073246A88607DDEE1DE4BCFC298892F3B73E897734D7001A466170F60E +5F2948ED36A6AC13975086A2D68B6CD8B033CD14C1B85EEE4AD3679D74DEB998 +AF62D045BF1102FB3927E5B9078F8AF93A0ADDF1937276C423CD346F30D17D3C +C57CE052053EC21A2991D063B157FD535850DD63E55890427BC2C883785DFBA2 +436BDED247251001AB1AE56EA19880B88B3F1BFA6C232876E6C002E9EA850700 +517C80537C27033737A162B10B179624F869FEC056F339D5A292E6E945E7BB31 +A271CA30990B4AA5874CAD851C1154275BBA868EDA5D156F4663E2D436DE6DD2 +74E6579AB19EC803927046D9130BD9E735D64248A6FA78F1DD6B51DF0B1DD553 +316D96795355878C426BDA09F052D54880E5F3E5C1F29786DA0A8084D81A5849 +B2A301BFF171446EEB4DAECAF40D8C4F6C489BEA6C592F8257E68C514180756D +A13569A03827561348B73584D69626B3175247018DB9DFAA9E989E55C97F9A32 +B02423EA16FADA78FE1E3C56EF4122C640EB8D77C5E957B5E425A2FBFD173423 +E8AA1758A91E1B5B85D174D7DA1F11B3AA76761346D2464BDBA290435A6DA50C +1F14E14FE29396C918E3E4C388E93D1C3F7A7161FC61DFA1543D4CA86B6A3A5D +B64FC69BADC3F3E0F7DA2AA5FD6C39700C2CB8A6C823D2620D39FBB0B507003B +6D28C8D67F57C019DE3D8A4B6BD01CF0B305163BB1229F470AAD7436D13C326C +5D205B4C818D0F765E2B9FDDE26B033D1060EBEEAD6E5C49EC8C6F395B54C259 +4E24E89DB787773423E358A1C64C3FDEE4CCBAAC4AC652012A0CD7269A062643 +0F52A1BD1DEE9401B5835752C48CD0B705476B00458D31E70599761C793987D1 +1A14288D5EB2C9452C2C4524202A40A8C773AA8A3B9D10ABFF457478532B2C58 +0DA8776E116853B77D1A8EE320C87B23A693BB5D3E77A9C419772675690DD75C +7AC5BC3ACF97BB11C70C0261EB5DECD96577D755B03EECBC66B3B8FAFAD87950 +94AA617A40E4CFE88939F28D0D36C5C6FB5B4F6E4321BDBF12DCD428BDEC76DC +192AD968A9699084DBFFA3FE06D5F79D336DD6CFCA4C9E1F427A29DB1F4F0492 +A29F5F052310D455E8AE1847083B70EE57C4799FF4B470655D855B8298FD3694 +66E00CF5D04415601598C0ABD6802FA0DC4C12965546076E46C2DE87467CCC8D +F9ED9FE429CDE1DB2AFE61363327B4D11F46C678B59E74F8F09D8B9C14C48004 +CEC93F33A4A6906CD71B2414C05B3599E4D1FC1EB839D4B5E5968711359D3BB2 +8E6E262896409C7EE86DF7A8CF1DCA1EDCB2BE723CAAF5B1D7DC94F093864855 +7FB08EF776FDCF9DD8342ECB7F7B307542880A7C04D3BD09D65BE13F80E36120 +24BBE4C422F1CC0DC956CE53261B903ABA0E0CF1CB0AA8895C0DA8127DE3DC9D +4B491926B5408AC8D29D2FE62CC3CEF548C0A57A1DA202EAEA8F4584D8B64E49 +A3D11A48600CC0913B744180AFB6873BE72DCDFF8EA2203E34082E011C87C3F8 +EE91457705ED0BD4E2C193B7E818B50DDDD734F2BA1B876D262C39D94B0FC27F +0B5A87423EAE91BDAB38BE457EB0309D05FA5E458109305C03295FC39B0D06BD +BFA2B4520DD610E12C3AF842A94296108FB67495B300991C3491F0983B5A0403 +68A8D19218D9429EE400C3B91DDE2A9F163684D9F28120B584FEC88628EAA60F +79F5988BE7BE31153A675BC7B344E7F62CE85E8850361D1996D57E71690472BB +8055755DE965D795E6D2424F7D76AE7F249AEF4BFD75103B2CE4D62FECCD2FAE +3702A57A3320C54D19D5015ABA5AF39B237C53D38DBD80773C0B9D6406574BFA +48BA4EE71769AD140E202D24D9F1691BA072E1AF182FD6DC06C2FD25E3437E38 +ED1D0033E77D2B188F3A84EAE17787110EC5462EF5CD0FEBBE5CE39976B5CDA4 +8206BE5EB8A06C7698C5E6A45EC7F59CAD3D6ED3AC19FABF3D29C9AEBEFDD74A +6B7261D349FE509BD769D9A24B16C276C917F0CBE8B25FFE19BF8528E1C46D38 +3738E3CEE8170E3EE323A464A3C8FF30B3DAD0BE87518E008E37F60DB471E3EC +110E9B8AAA5C875AF759126B39B90A8E7BCB25FA3EFA783AF7B069AED1887A19 +6A75C799940E5352C34A93F125DE82A7387CFDD7073A28C1026C9E06A1D8163B +E66DC3BAAEBBDF96B7B3143B9414AB45643D022294C2AF8C87EBFF1276EF991B +7A1C720C1A7CFD392F211A190A530A19012EB117670AFAE4CF700048D901A5BE +074F9B05AA555FA4ED6D0A92C08E4B795279F9BE48887886B5121DDD857E8A86 +A2885B9A672C72BAB990E0AF6DCCC769A7E18E65A86B3E1482D8297FD98E0510 +30B27AFCB9B261771A1AFC298F96E272E779A8B6AB6B03410ECE32B7B69369C7 +5597FDD08BF2E6CA29E093428DBB0BC53C64E5ECBF216111AC90E82822E7604B +A9AF479BE9FD2FB2ED27EBF4027C22357DB27A5A6FBC6B14607DC26F95A81BA5 +1737D6C406B19857FFF2903F966DCD56BB73B06F5F74C917517DF95D8D5E5108 +350AB839CBDFD7D1F3C687D0B6B576FFE108AE8708B967C29F9840A0D6784789 +DDD7A0D76E92082162603CC916ADAD75BB205E7C9B7A72D286C5411F3771EB6B +9F9022BB24AC9EE7700907280F52862F1D542605F3D3AB06679252DB9A8A4E41 +FD9740AE35473A9FD025F364B863DDD063AF91A114EB529A38F28C4B4551E276 +F76C254669B81BD3CA8479F0C7208AFE5A1927F2AB12FBEC47FE0BF9AC3DBF3C +340DC67125FA0D65B245260B32FB74F90CCA6D327874BDB6C252614C75425F20 +2AD8C9ADD15733715B9281DB9D73C66B9664491416643C04165C64F5939CA73F +F8D7652592F391E59B82EF0BEDA9DC7F42713005E4AEAA1111EAB4E74BD99119 +D86490DEE3DA6C021B36D7AFDF9EEDBB1E3253176EF0607469E0982034AF57A8 +83F024DD4B42B99BBA110514E52498F6BE463B3053DF5114F2D6644FA27702D3 +15DB327F632E3750171BDAD75F0B7D2A84267C712132373A2FE740BB086D53B5 +C3E9A68583159E46FE46ED3B645B0FD505D206E09D438052E27B75EFE7F5D83F +BC153E4BAD47FF241AD46BE13605E1840C5C2CE3492C29EA5FFF5550AA3986E4 +FF28A404908C88269D821EB2FBB193DC311750F6163D75872603A254B949C756 +CB97829F0BE3AD796D52969E483A0A53CA650CFB9AD57E0F4DED89C7746341EB +3D3333F06556BC61BABC3553C7B0D83DDC5B3BFDC77DBD9B6DE41680DD6439E9 +4C9FA49DF62830C86E7A4B1CBD37F2794EB6DAFC3F1676697392A6A635E626DD +3A3BC9E2378C152F9895178C694596191B37BE3DD8C0FF34C82C386289EBD7CC +B63139A3243F193EA10211A8E390B4C4046663CEC373928556F5CC99FE094ED2 +841DDF013CAA6CA5C48CD9382CB776964B38BC24BB009DF203DB81D4EE3A4463 +C5F2BD876E0C9B9B226FF39C0CE6E67589A38388A02A81D3DEA72CC031BB8B2F +66C481F00167DC0BEEE6740A78D736F429B44B82A3B01ED2127052646DB442FC +C1EC78B100F11D42512810F26EEABFFDEE3E46DD584FCC2194896F7BB5670634 +480771223C1E2641A253CE2490AD75591FD94F19B2DBA95F0CD64EE4BA03D3B2 +BB0C7A6437B610004CA4F1B914D9075051F7CBB6CDA305F6337307F317CC05C7 +8BA5A409ED6D915263680852670F8A474AB0646ACF77FA3AC35332DFE2B00CEA +FA99D25DAC950B173DB84ACD9DD99AB23973390FE32E384C6003FEB9A4D3FB1A +CA17FE87AD558921F203432EC00D0BD9E0294A0364048A9743516F46EAC01B7A +AF23DACE21FC2D26692D8F1A85F1B0AA8156D6360B322724C4804FAE55DFA814 +ACCE2F8508335CD775539E7931007A73DFDEEF7695487B10BB0D95FCA66D0F53 +6E86DD15234A025709C4F7DD08761711D05655EAD8122D8BA2F7177E820B48C2 +5EC82CD16644832ADF374ACF193975B4635FB374451D0AED47030807CFDCF240 +783160D79230AAC1F2E5066F09C327ACE24CA2D712D08749FC63C3D8EDADCE22 +B81A7E03350AE88F30BE8222B6954ED0D2910AECBA460EC21BB032C4D5DC1B12 +39F1EB91215B384CDE3F1FBDABA298E37D4460D0B07B0493053444AC73654815 +376ADD2F64BDE78BF59CD75D93A3A3BC730562E9A1F2A730A2F766AA19DE458F +06DD501B215E0C2070CD64DDE13E99719671FA4809FBCB6623E206253081A50F +5329F16F1B0F0F69276852A7A0AC023A821B8E7880F9D7AE5DA74D0483AACB4F +FF09D975ABF439500ADEADA4990CA29A50D82C0A7704F11DDE0C9C8E4DA21382 +C4F7289719D9A4A44BF2735CCAA2BCA698A5FAEC9A3BCCDDA1C88CCE18510733 +5A88B88A193C9DF15ACD00F20A965C11DD8A35CE316EF3E4716AB3FB4EC6288A +91C0F824FC9933315C9A71CA786C9305A9A30F407777F0AEA7D341D1D9605378 +72CF445A4A2E3666C0075E2F9AAC3F452811EF7E60E6C04F37F3808FE8BD39F2 +346F5E25757E3ED2232F1B9B4DADF83DA45F7F302809251973F705CF71E34C18 +7C452C4B5D29E0CB74CD6EA67637FFF0E9D9B211FF96E04FFFE9A27BE5E13BF6 +B51EF214FF4F0A58C5D5734E6BCB0ECD419AE3CF79AB67D1B3EAE70FC1E83691 +095D0C370C9CF847C2A914F0B810124D763A972464C5F2C1F69914A8672D46EE +30F9EFFA7E9628D667E5DB582C123160BF28E77DBBD77598F14A32DD74F67032 +B4A0537D0FF938CC61BB0F9798B600FFB1AD7AE6AEE67E0FC6557FC3FBAA1E4E +C793B0D207EE0395913818CB2446E9B82B880537C1625C70ACBC87F97CEA8C77 +82E6229E1734F80FBF8477F062F3836FA9DCF83A4BA49703FE3DCB5F2CF6266F +4480EDFA91B1D98FAB8BE14DA6E84B9D58B46DE5D034734496474241F59317F4 +4AE4AFFABA7CA3FA149A26CF5050B83BDCB1C56B529900AA20EE6098D135E65E +61026EF0852D497B3799DA044CB378332924CA360A1C62E24B5A0628813829AF +A1236DD728559DAA01188D6EBBF3CEF983C5201904D03A46B62A41E9C5F494DB +135F6B62BD5F3745625E96E1B401848BFD935AD1FE128507866FB807693E8376 +634F1B39763087EE7E454069D5CED93DAE8BE9D1366669A152968E2DF13EFA54 +D1A631CCCA33D914CC1DA8C0DF8ECE2FABD18641FFB43BB5E82DD0A56CC20DCC +64EC0A7A04709085C80C2A1477CF85A29D0C11F204CEA455072DFBA6F5F5C693 +CB2B56EA189926EB51E92D2B5D89F25AB94E1F7FA208916FFE89601B616B41EB +EFA70F4C8CFC3FAD1D056E4076E8CDC2C3058A2B35B34FA0A29A2ED3746060AD +1A6B6988B1B0986DE495FDE9A8C45119DA7EC756E1C83C89842C8744AC4B80DC +264792E2E8D5AE4120BC57C170C742EEB0EAE8C9C4537AE432654DA4DF89FD45 +AE0DBDD92D0DDFA0C90C4FB90FD5A7ABB522A193117153CF578A584447FCD674 +548ECB9250DA4669DDC8CDBEBBA49999F2519DE29B0CE693DEB2F420D4B0CE02 +D9AA3C2C15A6DC98495E1EA54C7670482E2B1034B91692285AC47EFD6271659E +400D6D7DC137A904647FD092B1B4D59170F1EED8E29FCD584FEA2C77642AB839 +0A44403D75504E8DDF1BDBBA6B51B7F9F64B63676B6FBDE514701B9333312126 +4D8AC19B638254A4BFDEACA80AB2CBC4DD12AB48BC34771E210FB576FA0DE013 +5C49E765028D57C056BD7C14E6941B0A92A2073CA3CCA67E9A18F18BE4934550 +EFB984B486B9036B8E3221F63D8642E2C71E6547A8E4B25FC3EC3C42D27DFD85 +E85F2D08C69CDCF3174A09E363E92A8B3D75BFD57CA37144D5267BA4D1750988 +8FA3A9B9100838AA7DFFA97C5E4D2516F5649CA756C97C5A3D500A60D2AC5039 +812B603639C2E3CE36F26CC0AFCB385A5BBD582E7BD1B5920F67DBAF9ABF9EE5 +FCF66EECB566DD87F0618AB73199C230034DE379CAC1F6BD17526305D6B6ECD5 +8C5C57FA76FA775B2A25C7F5C83C27A1F4C71DCA93487469004EDFF855A156C0 +8C8EE1972CEB91B9292F5619118F7DA38B1FCDD069D71D0DAE61BE55AF0E255B +3B8D2DE974592BCA7D92F0DE92538C74A801CF16A424621627BEE5BEC2CC5E68 +9B88BE0ADDB7C8125F7C35D74A52779C6D5D87143506EAB799765589617D08F3 +1305B15752D134A97F7D872CF330F4B3BB62946570C5EA7DB77612DF9B7F91E9 +22321623627FEC40FA04FDC1AA21DECC7AE531510375D6F68A68C6B8BD649A67 +A3E24B30E04ACC2171A510DCD77F7688E2ABD7D3346BD84E8363BCDB2EABBE0E +5BC87A595CE80F977190EF06D3D0BE12DA50EA0C33D25617A9DA8940967906B5 +F5317F4CDCE1DCC7ED48B4AC4DA131EBCCD11F7D241551AF8A2A723A5C634EAC +575113186D3B83F8B6E2E50796481B6CA50D440D5B20C5206A85F539FB7D52B8 +B831EF10B784D195BF7EFF05A9125A3B90CE131D84ADBBE6E47AAC2FBE51DDDF +1286C0DCCA8343F7803FCB25CD690EF9FB49C1C3B91BB7FCE5D330C781744502 +AE46FEC050B4C695101F3B86ACE09D502572DFF5F8534DBE6DEAE838B4000712 +4B21697BA3FCDCCB3B858251438F05B3EA1F8CABC08A502C5324D1315214E7DA +6B62576C10E6EE9A69FDB9D424FE1C7BC32CF37EE9EFC42B9F6726C486762574 +03913F9B3F5A20B1EFA8D4E072EA2F641D7AF64403C4EC76E3A81185B976499D +C78FAD546598AB094B628942EBA51C11FD572264BFC7B0E97A1715D7443F29EB +7BB4E6848383836F99850E22316C73B76B0E6848008B832E49B7373A94DADEE4 +E7EB32C428F531FFA2067E3316A47C08068D93E27525A9A2A915CD9F204AB4DE +01EF65ECE8167C184DFA747930AA322FC136DE0D412E99E6F37ACF87A788141B +3043A3B0D20DDE8C2137EF0DA77A899A581A51AC4CD5A1031F84BD428D0A17A9 +989877277917D07CB806DF051C23F1AB0049FBDE843B34CFC9DEC4147D97759E +983C395F0C9DC2832139DFDE0455002BEBC392E7617156400301F76441347A3E +E94D2FB65A31DA189BCC3CE94AFC1613B546D424A36EB2F83F3444DDAB0F03A0 +F3C270A9B8BC62465F46D83929DB7F0240E52CAC458194BFD50645F825D0C41C +773B1D6757625906C7643BDCE990E24467C011ACDAF6D4A26A62D71FAF1F475C +F14CA4D545E9E4F80BB01F3AC573D046DA7356FB9884CAE3A29DC357BC8CB255 +E5108AB355F0E087902C9BB458DCE8F341F1AEB79E468EE9A45855FE037780E7 +9EA9ADC1CFA141A3F976DFEF51A428D237F234BF5C694DAD4CCF2AE84FFAB574 +A25C1FBA2F38110C305D962420A310FE93301B8677478BDBBBDC518B8C94E819 +26BD2529D0EBF0E770CB3A1E107440D135848D2F90CE8F37693EDAF6071B79F4 +FEA5ABF4D9F2DC67F2468F2BDA3FA968EED4CAF8D7A22CB28AA43804F72F56B9 +545DBD0E3F27DD5617329305CD8577AF38CD4C472CB181CF3DBEA07CD42C6C1C +51E819286FFFC75E38F5EFF96C763F51A31A78B0848CF56DE1A2CBE2F39B0C41 +FC7C0D42D48D6C75516316B27F6C34AE6D5F5873233914790ECE044C014E9796 +20E200F53FC51ABFEC15C1E08D36E9A4DA7E58DAC014E2C0627EE8ACC6AD021A +D2E2C431ACE954602EB99D4584250637F807507A17DA18521B6820E066058B09 +8C2B4609FDEA9E02007A097F833C7A9854D74B38DC81016759DD8FC6F98071FE +620AFA1A8DE5AA974C281A1DEC9C8B866E7E350BE5EF3C7C53F82280790CF239 +C847E4C7F74BCEBED8BCC57D4C01BC4394F0E9EC5AD01852B3B06B93A477A1AB +AA97B588415A03C1984B0C9619C899DFD4766A2CE91CD6A65120E07756100696 +297345CACCE1551A2CB549077A292B73ECD47C3A098049BC49F2125BBF004DAA +8827C407B06A07E5F39CC17843FE876FB2DC6CA2ADC0A4D8812901FC82913ECF +BD04C66B3647B7A698B4BC6C2F136C04AF4792F10C31231F2A04E4B55538CC17 +AFE4B47BA2F575BB4E7E222E9F6A4F904F11CBBC6DF6C2F3C15DCF268A39D6AB +DEB9D091EFE6ECD5DF61ED23E570D484A6AFD5F8D34B7D484F76F150D3D97EBE +5E91D7A458FAB380BE167E7F2FAAC82BC2C7F3C14BDFD06D9665F5AB2CE34800 +E779AC43B70E22199D3BC4A2A14EFD5D20AF12D8CC26BCE54762ECCA9D9F5FDE +84B43104575B2D6533FD3BD245AAAA4B82314EAEC2E6E566EB32AE367D2F2BBE +8F6DF9D63F56693D701E259ED828A3E27561A5901B87F606AADBEDDD7E846AC1 +F07D1ACCEC90CF6AB18114A140FE4BC918EDC9B06284B40E2C82D4BE3C1EAB92 +E2E2F0DE115737561F7ACA173B81C9AF7EFCD6797BC1AE6366646C8F1ADC38A9 +F1928933BFB6AB474FA81D8C006AA11B76461ED98DB4DCB95D7772E3D15C2A29 +F116DF0437225E8EA1FC5C3997633CD63539069F7788AAB84BC9FA8A1A61316D +2C0F07D2914A61B0418912B276561540BE5DBC1F7A20241E85ED95BB775E16D4 +1F22262C8128967F53031EBA86D0A2184DEB01D51D4F7E15BADE50B7DE246C05 +38B9B49D264A4B29A372FCBF57323308C71A0E14748850B56D51BB932B1DCAA3 +A1469E84536A42B0D8B55A0292C8050D6CD1BFDCC4D287B15082801EA40AB8DE +CD8628D0E1252DBC57333D74841246D7A6392F158EAA9FD5BC6CB2E535DDBEAB +F16FF32617952596187203D41342DF7FC1E0CAEA2EE8F012236DAB0208A626E4 +5FC5EC819580727F7890BF2B114523A3006CFE3B67F19419A009826C635C4B2C +10CED88293D753A6FC63C5C17A424E911169E316DAC022EE37A5F93A6D7BB446 +5402EDB1F758FFCCBE83F7842CF09E84DAC17CC8A5D0521CDBCA8B320D90F24F +32AA9B86DAFD068FB0D234C94EC0889134DCCF83F8B0C89F67D660EC4D6E2B34 +D4CC5E094049ACFA09767E7C0AFD789767D0660825FC94878BFCA40105597194 +BDF88A8636D180BAFEF635601218B47E1242497D1E90E7A0F1098FE4161E6C7D +D1E920DBECEDE54FD9D8EA40E25881F0E31C3FECCA22ED507DF496122D25AF56 +E6E690952EC746BE46F4D228D54C634B04D036DD33252E5A5B6309E559EB9CF9 +DD17101EF262D5FEBE9C207007A2E7F3BCCCE3243333F0A79C1779E727414D60 +B451BDC14BA3FFCBB9D49641DE51BE92C7D136C2C910559A6EE106DC05CB4890 +322BC12FD592C4789FD8368DFB7827A67FF8FADE351646D0B4B35F74A924E229 +DDCBE1B5D24D049CBD4424B123B6AAE7F5AF8AEEC7F862431541F6B755A272CE +177CAB058D297A35041646435664056644B2422B2CB890080C3BEC3C52C6363C +B843F24977C482C7A37CF18DEDE4E8FECB280E86263BBB5BD413A9BE19329817 +EC424B1AEEEF713A52D68143AF0DC2B02F293425F041A616D148ABED9E7FA7A0 +AE99B5762A52E38BE8E7148EF22808632CBDEA8613948D8E3D576580FA3F4B3E +0B5F9E1B240BC7D0744FB1D121E3231994DEDE24B919A72869C15B839DDD9917 +D3BF2466E673B142E4B527B17893D3405603E1271E2D005A6318DC98CFA3D25C +3A7B59A16B1D6C5C31F267B964E951DFDB1143F8D9005E378A3D4F5B072911CC +814C191A806A989BC176544E45BA9A5CB16281394572CC6275A96865BEAB6F9D +06DD94701FB30DEAC86652473C182379F43877528F28AB0B5FD9669347003055 +2E6169601690053E00E18BE7FA7143DA61EA74326BE8122E56485E65B0572821 +BBE05576C1D9706EE219A8377338E93DFFFEE5E37E6054412A9B875A092C948C +C4663F161AEBAFBB964859E9056D42B76A806A2B1C435318459E272DD51339B6 +B16BC73787ADF1D7A2CD630CA98F8B6C479693BA427D7096E83AAC35B6D1CCAE +B5879B03B706C6AA3FC1A1D180315A2252DE59C45E9429E107D7A73A645AB182 +6FCD53B44907874A1B286BC50D9051160CBFB374856E59C961C376C3B553454B +108BC5FFAC60EB8C7426A70A1FFC2CE80D8989A3EEC43A9AD51771D48884BB32 +1749E328FDCCD4FDD104E80EB6813FB98D83139791DD2A2C9ED7A70BC458DB09 +5D73B21DAF0FFC110324B8F2BC145FA61962C5D78B4D6C8D014D6938AF09F36A +2A3E5634A140A1A525BFCAA00616AA1D8195A8A68E4260B8ADDDF789B131C074 +01EF325E06AEA94A459CE1F51F312C3C19142528AC941551F324BE2653BBCF38 +46DDC6BDF7EF77D68C32F4DE7D8604E63A632AB2108086C77B94DC31D926D1E7 +1D3653D8B35CC5AC431368B7B2D7C3A565FEE9D9B2E366F265A627FE7B4378C4 +81A0C4DBDDE6F7DD940F08764D307A5B09097320431AA76A41C4ADE92C260588 +522B197B802DC488FA2169BC2E13AE36A98591E1673C1CAC29B4E0E15D2227E7 +80928CA4C060FECE89B014C3FB6A42313FC438E448DDD73CB66ADEF1FACF2E2A +4601F76ECFF658D97BC22C765C0B1B04B03EE08A41E2C778A8E5954CABE7B386 +BFC2DC7C60E720BAB2B1A726D8AF4933355F21731FD7C930F31720C1E16F6C01 +C0C8B6747961B605CDFFB02FD6D6A7758B1097AA1D47C6DA9DBF0F87E55672AD +FE93D17DA6FE7B2E3A5360C5BF0C3F4715165CC6748BC95CFA74D4AD57B481B9 +3784040A6B1BB028CA9F69B6AE52CFF8FF3FD169FDE1A85B52651D99B4042E72 +D5E952BD9F976EFA21C935F2ECBF5C8D4D8BA0AA97DD1458650F6DB9C80B3B21 +F60761C150944567DE98E9DED3BB831A57DE2A5C8CC4417D0D02BF24EB09C2A7 +B8262EFB223FDEDB45E75E2559190060C676B43721B5894EA52440AAAF72B77D +42138ABF062B92255DCE006EC18492D4CC0CA6FE753E8851305B967B4B01D481 +85D8A1B78CAEBEB99ED44E5BD7B0CD242B46F8C3C4B1DCE6B103497A89D0C48A +FCA2DDB3CBEF2CC076673FE28DD397F4975BF03EABF542C8ECAE8311822A6564 +14C20DE022F9AFBF672B31D124F96E2475073E6B53F8032685A45AC7181B0158 +A6FDBF2DFCC9D842D42E098BC02AEFABA6D571821604BBDC389E80931BC8A767 +A92DC7CE49EDDC3C89521CD3AF5AEFF121EAA27B74A37BF043B1AC045A0D9A38 +8767D85D15DBF0F5ABC495207AA3AD05BE201642206044F470EFDF4A8D52C050 +D600F04B97ACED3F7FC8A56E7640A6A4AAAE1816F3A77D887A378AA0B130B509 +72A8ADBD5808E9BBB7F83216D995EC74FD168D5A3D171AB9C52A0E21169172A2 +9C680D926D2327A314835700D399CE25A8311D22D1127B43CB8A9D900133C4D1 +CA1F71C4331F37DBE7F26650B4D512C5E192635CD8CF4C560AB5BFFE0671424D +456BA00271A643AA2477DAB650F682D89B932BEBB5A66EBC9072A469EE78E0B3 +86F58B1BA76F31B978C167A0E5CE18889C4DA968CEF94EFA70060960E1D53535 +17230FC0C8AA0E878AD3D6E306533800DB46BF785219872DBCAAEC33A236A8AA +E86D9C9316CEE8D75888217824D56420EF7AFE70E18C6AC6E7E71161373D574A +D399548B201868F2D1B2DEC136ECFEFE25C307630331F2F893FE36E0CCC8113F +9D7A6DE87881BC713E6B438F1E804B2C6F00DAA4FF0A33F2B051EE2655BD8583 +9AA5BB2F7A4AD400F34963FA1BD28D5AB933EAE84C047D636122BE431DB097BC +85D7CB6C30B09333A567F7DFC0A0482E4373512294562297BACC2F53E2BF1718 +4E23AA470CB1879235832D66846522B8EC1536E17172B8DA9DEB14877C9405D4 +531E548E8ACEBE66D41992C0D0A25CE7FE2641DC2F06A1399C864A7C1155DDD4 +20A2D292688E6426B147572C2CD3706C96C22C977A4A6C4A30A54C7DDD50DCB9 +7BBC5C0B744CD85DF88166B916C0F1909A38742C6BCB58045C4223B70F4B3BAD +74EBBE8395A3F64A14D6838554EB6AB7CE417DD7448EBB4F3EE10B13B454C4EA +949AF16A87E72ED21159408171A4847199C5E403FADCC67D0FFA5A58452ADC67 +FC3C597826B20BD85A1AC7BFA715531D99DDA5155185E3FBF29DDF559A103F75 +538AC8CC0B4C4041288E89B387F6ABE04F90E8CEB2099293D1DC4FE00647C80C +5DBE532282708D050BC6A226F45DBC314D109554BB25CF04770ED4874EED1B1F +E18E006F254BB4297C435B416A9AFC6FC51568D89317BCDD9885E2D1ED15F4F7 +AF253B5FAEE5CC44BF9D860982B7F4706C8B8018E6488E337B773A4A7AAF9998 +6796B30721736F7AB66CE22EBEF616FE5847929A2E08D64DA7E912F4CA899F73 +6A0A1F1F2163886A7C5E6999D98AB9708EADE2030050B2D05AEF0AA9447F8698 +7C191DD81DB9131D0DC19BB7CD0CD9A60AEBBA3FAD203CA51B6FECB75EC91C14 +EE75CBB49420594C7B9A56EDE29343B5D1817AFF27B71F0BF2B8D59D8198C2B7 +A9F4091A085C973412051D6ACCD3F0B37D502D8FE193CD5E42769D1F497847CF +B986233F0DE24FE2F4ED03BFA105DD04182887D3C6CB827A1D5B00170B8DFA5E +EB1BE4FEEACCC82A5BB4BCE2C8320CBCF6EEBFC955025F3980763F51170EA440 +C2144AD36893326E5A3DC214AF59FF505E8168593AB9543FC6690F0D63262FBB +978B833906430E5D2DC99D729D1CCE7A0A91725537BCF91DFBF8073EEE494A2B +E38F1AA3D81C602D05FAD3CA3A8A5A7E1F0A7F7CA736B561F3C29275E68D01E1 +FA253D089243988C475ABF8077C71DD93F1414E69FAEE565F42C863C61BE554B +44C92919D78D898E70510D9EA1FCAB702FD53337263606A777A001224390AA6C +D8CA04FE8F34D61F03E083D0A050EA3985ED026479142A7184494C615A7AC675 +97B6196C56F2034850A77938B7585B18AEEA2D249E41D25302DFF2416FCADC13 +E69030FD907778821C66F93220A31991386640AC2315A5B7DB80B4AE91A6A4D7 +8BC19E632295CFECA8D65B4045C5A7614852CD48686A27D61F6DC6ED6120D30D +92C97F4D0B5135823FA4A59DFB7633 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +{restore}if +%%EndFont +TeXDict begin 40258431 52099146 1000 600 600 (bashref.dvi) +@start /Fa 131[62 124[{}1 119.552 /CMTT12 rf /Fb 133[34 +41 41 55 41 43 30 30 30 41 43 38 43 64 21 41 23 21 43 +38 23 34 43 34 43 38 8[58 4[43 57 1[52 60 58 70 3[28 +58 3[59 1[54 58 7[38 38 38 38 38 38 38 38 38 38 3[21 +31[43 12[{}50 74.7198 /CMR9 rf /Fc 197[21 58[{}1 74.7198 +/CMMI9 rf /Fd 134[39 39 2[39 39 39 39 2[39 39 39 39 2[39 +39 1[39 39 39 2[39 19[39 27[39 39 2[39 45[{}20 74.7198 +/CMSLTT10 rf /Fe 129[39 39 1[39 39 39 39 39 39 39 39 +39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 +39 39 39 39 39 1[39 39 39 39 39 39 39 39 39 39 1[39 39 +39 39 39 39 1[39 39 39 39 39 39 39 39 39 39 39 39 1[39 +39 39 5[39 39 39 39 39 39 39 39 39 1[39 39 39 39 39 1[39 +39 1[39 33[{}81 74.7198 /CMTT9 rf /Ff 167[62 3[60 46 +2[57 1[62 76 52 1[43 1[62 65 54 1[63 60 67[{}13 83.022 +/CMR10 rf /Fg 135[67 2[67 1[50 2[61 69 5[33 1[70 2[68 +52[60 47[{}9 109.174 /CMCSC10 rf /Fh 140[56 3[56 56 1[56 +2[56 56 56 57[56 45[{}8 109.091 /CMTT12 rf /Fi 130[45 +1[45 123[{ T1Encoding ReEncodeFont }2 91.3242 /SFRM1095 +rf /Fj 134[48 48 48 48 48 48 48 48 48 48 48 48 48 48 +48 48 48 48 48 48 48 48 48 48 48 1[48 2[48 3[48 3[48 +1[48 1[48 1[48 48 48 1[48 48 48 1[48 48 48 48 1[48 6[48 +6[48 48 48 48 2[48 5[48 39[{}49 90.9091 /CMSLTT10 rf +/Fk 134[65 65 89 65 68 48 48 50 65 68 61 68 102 34 65 +1[34 68 61 37 56 68 55 68 60 7[93 1[127 1[94 85 68 92 +92 84 92 96 116 74 96 1[46 96 96 77 81 94 89 87 93 1[58 +5[61 61 61 61 61 61 61 61 61 61 1[34 41 34 31[68 72 11[{}62 +109.091 /CMBX12 rf /Fl 135[42 1[42 1[30 37 38 1[46 46 +51 74 23 2[28 1[42 1[42 46 42 1[46 51[33 32[51 12[{}18 +90.9091 /CMTI10 rf /Fm 135[56 2[56 1[42 55 1[51 58 56 +68 47 2[27 1[58 49 51 57 54 53 56 46[50 2[50 1[34 45[{}20 +90.9091 /CMCSC10 rf /Fn 197[25 58[{}1 90.9091 /CMMI10 +rf /Fo 197[33 58[{}1 119.552 /CMMI12 rf /Fp 134[85 85 +1[85 90 63 64 66 1[90 81 90 134 45 1[49 45 90 81 49 74 +90 72 90 78 10[122 124 112 90 120 3[126 153 97 1[83 60 +126 127 101 106 124 117 115 122 7[81 81 81 81 81 81 81 +81 81 81 35[90 94 11[{}52 143.462 /CMBX12 rf /Fq 200[0 +21[91 17[45 1[91 12[71{}5 90.9091 /CMSY10 rf /Fr 134[48 +48 66 48 51 35 36 36 48 51 45 51 76 25 48 28 25 51 45 +28 40 51 40 51 45 7[68 68 93 1[68 66 51 67 1[62 71 68 +83 57 71 1[33 68 71 59 62 69 66 64 68 12[45 45 45 45 +3[30 8[45 21[76 1[51 53 11[{}56 90.9091 /CMSL10 rf /Fs +134[71 71 97 71 75 52 53 55 1[75 67 75 112 37 71 41 37 +75 67 41 61 75 60 75 65 3[37 1[37 1[102 102 139 102 103 +94 75 100 101 92 101 105 128 81 105 69 50 105 106 85 +88 103 97 96 102 105 64 4[37 67 67 67 67 67 67 67 67 +67 67 1[37 45 37 1[67 5[67 112 1[41 20[75 78 11[{}73 +119.552 /CMBX12 rf /Ft 129[48 48 48 48 48 48 48 48 48 +48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 +48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 +48 48 48 48 48 48 48 1[48 48 48 48 48 48 48 48 48 48 +48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 +48 48 48 48 48 48 48 48 48 48 48 48 48 33[{}93 90.9091 +/CMTT10 rf /Fu 131[91 45 40 48 48 66 48 51 35 36 36 48 +51 45 51 76 25 48 28 25 51 45 28 40 51 40 51 45 25 2[25 +45 25 56 68 68 93 68 68 66 51 67 71 62 71 68 83 57 71 +47 33 68 71 59 62 69 66 64 68 71 43 1[71 1[25 25 45 45 +45 45 45 45 45 45 45 45 45 25 30 25 1[45 35 35 25 71 +76 45 76 45 25 18[76 51 51 53 11[{}91 90.9091 /CMR10 +rf /Fv 138[108 1[76 79 3[108 1[54 3[108 1[59 88 1[86 +1[94 14[144 4[184 10[138 66[{}13 172.154 /CMBX12 rf end +%%EndProlog +%%BeginSetup +%%Feature: *Resolution 600dpi +TeXDict begin +%%BeginPaperSize: Letter +/setpagedevice where +{ pop << /PageSize [612 792] >> setpagedevice } +{ /letter where { pop letter } if } +ifelse +%%EndPaperSize + end +%%EndSetup +%%Page: 1 1 +TeXDict begin 1 0 bop 150 1318 a Fv(Bash)64 b(Reference)j(Man)-5 +b(ual)p 150 1385 3600 34 v 2361 1481 a Fu(Reference)31 +b(Do)s(cumen)m(tation)i(for)d(Bash)2428 1589 y(Edition)h(4.3,)g(for)f +Ft(Bash)g Fu(V)-8 b(ersion)31 b(4.3.)3180 1697 y(F)-8 +b(ebruary)30 b(2014)150 4935 y Fs(Chet)45 b(Ramey)-11 +b(,)46 b(Case)g(W)-11 b(estern)46 b(Reserv)l(e)g(Univ)l(ersit)l(y)150 +5068 y(Brian)f(F)-11 b(o)l(x,)45 b(F)-11 b(ree)45 b(Soft)l(w)l(are)h(F) +-11 b(oundation)p 150 5141 3600 17 v eop end +%%Page: 2 2 +TeXDict begin 2 1 bop 150 4279 a Fu(This)35 b(text)h(is)g(a)g(brief)f +(description)h(of)f(the)h(features)g(that)g(are)g(presen)m(t)g(in)f +(the)h(Bash)f(shell)h(\(v)m(ersion)150 4389 y(4.3,)c(2)e(F)-8 +b(ebruary)31 b(2014\).)150 4523 y(This)26 b(is)g(Edition)h(4.3,)i(last) +e(up)s(dated)e(2)i(F)-8 b(ebruary)26 b(2014,)k(of)d Fr(The)f(GNU)h +(Bash)f(Reference)i(Man)m(ual)p Fu(,)g(for)150 4633 y +Ft(Bash)p Fu(,)h(V)-8 b(ersion)31 b(4.3.)150 4767 y(Cop)m(yrigh)m(t)602 +4764 y(c)577 4767 y Fq(\015)f Fu(1988{2014)35 b(F)-8 +b(ree)31 b(Soft)m(w)m(are)h(F)-8 b(oundation,)31 b(Inc.)390 +4902 y(P)m(ermission)21 b(is)f(gran)m(ted)h(to)g(cop)m(y)-8 +b(,)24 b(distribute)c(and/or)h(mo)s(dify)e(this)i(do)s(cumen)m(t)f +(under)f(the)390 5011 y(terms)25 b(of)h(the)f(GNU)h(F)-8 +b(ree)27 b(Do)s(cumen)m(tation)g(License,)g(V)-8 b(ersion)26 +b(1.3)g(or)f(an)m(y)h(later)g(v)m(ersion)390 5121 y(published)43 +b(b)m(y)h(the)h(F)-8 b(ree)46 b(Soft)m(w)m(are)g(F)-8 +b(oundation;)53 b(with)44 b(no)g(In)m(v)-5 b(arian)m(t)46 +b(Sections,)j(no)390 5230 y(F)-8 b(ron)m(t-Co)m(v)m(er)31 +b(T)-8 b(exts,)30 b(and)f(no)f(Bac)m(k-Co)m(v)m(er)k(T)-8 +b(exts.)41 b(A)29 b(cop)m(y)h(of)f(the)g(license)h(is)f(included)390 +5340 y(in)h(the)h(section)g(en)m(titled)h(\\GNU)f(F)-8 +b(ree)32 b(Do)s(cumen)m(tation)g(License".)p eop end +%%Page: -1 3 +TeXDict begin -1 2 bop 3725 -116 a Fu(i)150 299 y Fp(T)-13 +b(able)53 b(of)h(Con)l(ten)l(ts)150 641 y Fs(1)135 b(In)l(tro)t +(duction)13 b Fo(:)19 b(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g +(:)h(:)f(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)h(:)f(:) +g(:)h(:)f(:)h(:)f(:)h(:)57 b Fs(1)275 778 y Fu(1.1)92 +b(What)31 b(is)f(Bash?)22 b Fn(:)15 b(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g +(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:) +h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h +(:)f(:)g(:)h(:)f(:)52 b Fu(1)275 888 y(1.2)92 b(What)31 +b(is)f(a)h(shell?)13 b Fn(:)j(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h +(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:) +f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f +(:)g(:)44 b Fu(1)150 1130 y Fs(2)135 b(De\014nitions)13 +b Fo(:)20 b(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f +(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:) +f(:)h(:)f(:)h(:)f(:)57 b Fs(3)150 1400 y(3)135 b(Basic)45 +b(Shell)g(F)-11 b(eatures)27 b Fo(:)21 b(:)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(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h +(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:) +f(:)g(:)h(:)46 b Fu(21)399 4167 y(3.5.1)93 b(Brace)31 +b(Expansion)21 b Fn(:)15 b(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g +(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:) +h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)50 b Fu(21)399 +4276 y(3.5.2)93 b(Tilde)30 b(Expansion)10 b Fn(:)15 b(:)h(:)f(:)g(:)h +(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:) +f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h +(:)f(:)40 b Fu(22)399 4386 y(3.5.3)93 b(Shell)30 b(P)m(arameter)i +(Expansion)18 b Fn(:)d(:)g(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g +(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:) +48 b Fu(23)399 4496 y(3.5.4)93 b(Command)29 b(Substitution)12 +b Fn(:)j(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:) +h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g +(:)42 b Fu(28)399 4605 y(3.5.5)93 b(Arithmetic)31 b(Expansion)19 +b Fn(:)c(:)g(:)h(:)f(:)g(:)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:)h(:)f(:)h(:)f(:)g(:) +h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h +(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)39 +b Fu(31)275 5263 y(3.6)92 b(Redirections)26 b Fn(:)15 +b(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g +(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:) +h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)55 +b Fu(31)p eop end +%%Page: -2 4 +TeXDict begin -2 3 bop 3699 -116 a Fu(ii)399 83 y(3.6.1)93 +b(Redirecting)31 b(Input)23 b Fn(:)14 b(:)i(:)f(:)g(:)h(:)f(:)h(:)f(:)g +(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:) +h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)52 +b Fu(33)399 193 y(3.6.2)93 b(Redirecting)31 b(Output)26 +b Fn(:)15 b(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f +(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:) +h(:)f(:)g(:)h(:)56 b Fu(33)399 302 y(3.6.3)93 b(App)s(ending)28 +b(Redirected)k(Output)12 b Fn(:)h(:)j(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f +(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:) +41 b Fu(33)399 412 y(3.6.4)93 b(Redirecting)31 b(Standard)e(Output)h +(and)f(Standard)h(Error)d Fn(:)15 b(:)g(:)h(:)f(:)h(:)f(:)g(:)58 +b Fu(33)399 521 y(3.6.5)93 b(App)s(ending)28 b(Standard)i(Output)f(and) +h(Standard)f(Error)19 b Fn(:)14 b(:)h(:)h(:)f(:)h(:)f(:)g(:)h(:)48 +b Fu(34)399 631 y(3.6.6)93 b(Here)31 b(Do)s(cumen)m(ts)c +Fn(:)15 b(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f +(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:) +h(:)f(:)g(:)h(:)f(:)h(:)f(:)56 b Fu(34)399 741 y(3.6.7)93 +b(Here)31 b(Strings)c Fn(:)16 b(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h +(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:) +f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)58 +b Fu(34)399 850 y(3.6.8)93 b(Duplicating)32 b(File)f(Descriptors)16 +b Fn(:)g(:)g(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:) +h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)46 +b Fu(34)399 960 y(3.6.9)93 b(Mo)m(ving)32 b(File)f(Descriptors)19 +b Fn(:)d(:)g(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:) +h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)49 +b Fu(35)399 1069 y(3.6.10)93 b(Op)s(ening)29 b(File)j(Descriptors)f +(for)f(Reading)h(and)f(W)-8 b(riting)19 b Fn(:)e(:)e(:)h(:)f(:)h(:)f(:) +49 b Fu(35)275 1179 y(3.7)92 b(Executing)31 b(Commands)17 +b Fn(:)d(:)h(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:) +f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f +(:)h(:)f(:)g(:)h(:)f(:)h(:)46 b Fu(35)399 1289 y(3.7.1)93 +b(Simple)30 b(Command)f(Expansion)23 b Fn(:)15 b(:)g(:)h(:)f(:)g(:)h(:) +f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f +(:)g(:)h(:)f(:)h(:)52 b Fu(35)399 1398 y(3.7.2)93 b(Command)29 +b(Searc)m(h)i(and)f(Execution)d Fn(:)15 b(:)h(:)f(:)h(:)f(:)g(:)h(:)f +(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)56 +b Fu(36)399 1508 y(3.7.3)93 b(Command)29 b(Execution)i(En)m(vironmen)m +(t)8 b Fn(:)16 b(:)g(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:) +h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)38 b Fu(36)399 1617 +y(3.7.4)93 b(En)m(vironmen)m(t)18 b Fn(:)d(:)h(:)f(:)g(:)h(:)f(:)h(:)f +(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:) +f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f +(:)h(:)47 b Fu(37)399 1727 y(3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(:)f(:)g(:)h(:)f(:)h(:)f(:)g +(:)h(:)f(:)h(:)f(:)g(:)47 b Fu(100)150 657 y Fs(8)135 +b(Command)45 b(Line)g(Editing)19 b Fo(:)i(:)e(:)h(:)f(:)h(:)f(:)g(:)h +(:)f(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)63 +b Fs(101)275 794 y Fu(8.1)92 b(In)m(tro)s(duction)30 +b(to)h(Line)f(Editing)24 b Fn(:)16 b(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:) +f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f +(:)g(:)h(:)f(:)h(:)f(:)54 b Fu(101)275 904 y(8.2)92 b(Readline)31 +b(In)m(teraction)c Fn(:)15 b(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:) +h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h +(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)56 b Fu(101)399 +1013 y(8.2.1)93 b(Readline)31 b(Bare)g(Essen)m(tials)26 +b Fn(:)15 b(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f +(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)55 +b Fu(102)399 1123 y(8.2.2)93 b(Readline)31 b(Mo)m(v)m(emen)m(t)i +(Commands)24 b Fn(:)15 b(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:) +f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)55 b +Fu(102)399 1233 y(8.2.3)93 b(Readline)31 b(Killing)g(Commands)16 +b Fn(:)f(:)g(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:) +f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)46 b +Fu(103)399 1342 y(8.2.4)93 b(Readline)31 b(Argumen)m(ts)9 +b Fn(:)15 b(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f +(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:) +g(:)h(:)f(:)39 b Fu(103)399 1452 y(8.2.5)93 b(Searc)m(hing)31 +b(for)f(Commands)f(in)h(the)h(History)c Fn(:)15 b(:)h(:)f(:)h(:)f(:)g +(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)57 b Fu(103)275 +1561 y(8.3)92 b(Readline)31 b(Init)f(File)20 b Fn(:)d(:)e(:)h(:)f(:)g +(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:) +h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g +(:)h(:)f(:)h(:)50 b Fu(104)399 1671 y(8.3.1)93 b(Readline)31 +b(Init)f(File)i(Syn)m(tax)12 b Fn(:)k(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h +(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:) +f(:)g(:)h(:)f(:)h(:)42 b Fu(104)399 1781 y(8.3.2)93 b(Conditional)31 +b(Init)f(Constructs)25 b Fn(:)16 b(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f +(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:) +g(:)56 b Fu(111)399 1890 y(8.3.3)93 b(Sample)30 b(Init)g(File)12 +b Fn(:)17 b(:)e(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h +(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:) +h(:)f(:)h(:)f(:)g(:)h(:)f(:)42 b Fu(112)275 2000 y(8.4)92 +b(Bindable)30 b(Readline)h(Commands)11 b Fn(:)k(:)g(:)g(:)h(:)f(:)h(:)f +(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:) +g(:)h(:)f(:)h(:)f(:)g(:)h(:)41 b Fu(115)399 2109 y(8.4.1)93 +b(Commands)29 b(F)-8 b(or)31 b(Mo)m(ving)e Fn(:)16 b(:)f(:)h(:)f(:)g(:) +h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h +(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)58 b Fu(115)399 +2219 y(8.4.2)93 b(Commands)29 b(F)-8 b(or)31 b(Manipulating)g(The)f +(History)17 b Fn(:)g(:)e(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:) +h(:)47 b Fu(116)399 2328 y(8.4.3)93 b(Commands)29 b(F)-8 +b(or)31 b(Changing)f(T)-8 b(ext)21 b Fn(:)c(:)e(:)h(:)f(:)h(:)f(:)g(:)h +(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:) +51 b Fu(117)399 2438 y(8.4.4)93 b(Killing)31 b(And)e(Y)-8 +b(anking)22 b Fn(:)17 b(:)e(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h +(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:) +f(:)g(:)h(:)f(:)h(:)52 b Fu(118)399 2548 y(8.4.5)93 b(Sp)s(ecifying)30 +b(Numeric)g(Argumen)m(ts)17 b Fn(:)e(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:) +f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)47 +b Fu(119)399 2657 y(8.4.6)93 b(Letting)31 b(Readline)g(T)m(yp)s(e)f(F) +-8 b(or)31 b(Y)-8 b(ou)12 b Fn(:)k(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g +(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)42 +b Fu(120)399 2767 y(8.4.7)93 b(Keyb)s(oard)29 b(Macros)21 +b Fn(:)16 b(:)g(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g +(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:) +h(:)f(:)h(:)f(:)g(:)51 b Fu(121)399 2876 y(8.4.8)93 b(Some)30 +b(Miscellaneous)j(Commands)24 b Fn(:)15 b(:)h(:)f(:)g(:)h(:)f(:)h(:)f +(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)55 +b Fu(122)275 2986 y(8.5)92 b(Readline)31 b(vi)f(Mo)s(de)20 +b Fn(:)15 b(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g +(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:) +h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)50 b Fu(124)275 +3096 y(8.6)92 b(Programmable)30 b(Completion)16 b Fn(:)g(:)f(:)h(:)f(:) +h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h +(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)46 +b Fu(124)275 3205 y(8.7)92 b(Programmable)30 b(Completion)h(Builtins)c +Fn(:)15 b(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f +(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)56 b Fu(126)275 +3315 y(8.8)92 b(A)30 b(Programmable)h(Completion)g(Example)20 +b Fn(:)15 b(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h +(:)f(:)g(:)h(:)f(:)h(:)f(:)50 b Fu(130)150 3533 y Fs(9)135 +b(Using)45 b(History)h(In)l(teractiv)l(ely)39 b Fo(:)19 +b(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)80 +b Fs(133)275 3670 y Fu(9.1)92 b(Bash)30 b(History)h(F)-8 +b(acilities)21 b Fn(:)d(:)e(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f +(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:) +g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)51 b Fu(133)275 3779 +y(9.2)92 b(Bash)30 b(History)h(Builtins)19 b Fn(:)d(:)g(:)f(:)g(:)h(:)f +(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:) +h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)49 +b Fu(133)275 3889 y(9.3)92 b(History)31 b(Expansion)21 +b Fn(:)15 b(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f +(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:) +f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)52 b Fu(135)399 3999 +y(9.3.1)93 b(Ev)m(en)m(t)31 b(Designators)10 b Fn(:)18 +b(:)d(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g +(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:) +h(:)f(:)h(:)40 b Fu(135)399 4108 y(9.3.2)93 b(W)-8 b(ord)31 +b(Designators)17 b Fn(:)g(:)e(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f +(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:) +h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)47 b Fu(136)399 4218 +y(9.3.3)93 b(Mo)s(di\014ers)26 b Fn(:)16 b(:)f(:)h(:)f(:)g(:)h(:)f(:)h +(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:) +h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h +(:)f(:)g(:)h(:)57 b Fu(137)150 4436 y Fs(10)135 b(Installing)46 +b(Bash)24 b Fo(:)c(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f +(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)h(:)f(:)68 +b Fs(138)275 4573 y Fu(10.1)92 b(Basic)32 b(Installation)20 +b Fn(:)d(:)e(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:) +g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g +(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)50 b Fu(138)275 4682 +y(10.2)92 b(Compilers)30 b(and)g(Options)8 b Fn(:)15 +b(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f +(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:) +f(:)h(:)38 b Fu(139)275 4792 y(10.3)92 b(Compiling)30 +b(F)-8 b(or)32 b(Multiple)f(Arc)m(hitectures)21 b Fn(:)c(:)e(:)h(:)f(:) +h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g +(:)52 b Fu(139)275 4902 y(10.4)92 b(Installation)32 b(Names)13 +b Fn(:)j(:)g(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:) +h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h +(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)43 b Fu(139)275 5011 y(10.5)92 +b(Sp)s(ecifying)30 b(the)g(System)h(T)m(yp)s(e)12 b Fn(:)j(:)g(:)h(:)f +(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:) +g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)42 b Fu(139)275 +5121 y(10.6)92 b(Sharing)30 b(Defaults)15 b Fn(:)i(:)e(:)g(:)h(:)f(:)h +(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:) +h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h +(:)f(:)g(:)46 b Fu(140)275 5230 y(10.7)92 b(Op)s(eration)30 +b(Con)m(trols)24 b Fn(:)16 b(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:) +f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f +(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)54 b Fu(140)275 +5340 y(10.8)92 b(Optional)31 b(F)-8 b(eatures)10 b Fn(:)17 +b(:)e(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h +(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:) +f(:)h(:)f(:)g(:)h(:)f(:)h(:)40 b Fu(140)p eop end +%%Page: -4 6 +TeXDict begin -4 5 bop 3677 -116 a Fu(iv)150 83 y Fs(App)t(endix)44 +b(A)160 b(Rep)t(orting)46 b(Bugs)35 b Fo(:)20 b(:)f(:)g(:)h(:)f(:)h(:)f +(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)80 b Fs(145)150 +353 y(App)t(endix)44 b(B)166 b(Ma)7 b(jor)45 b(Di\013erences)i(F)-11 +b(rom)44 b(The)419 486 y(Bourne)g(Shell)35 b Fo(:)19 +b(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)h +(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)78 +b Fs(146)275 623 y Fu(B.1)92 b(Implemen)m(tation)31 b(Di\013erences)h +(F)-8 b(rom)31 b(The)e(SVR4.2)j(Shell)13 b Fn(:)i(:)h(:)f(:)h(:)f(:)g +(:)h(:)f(:)h(:)43 b Fu(150)150 865 y Fs(App)t(endix)h(C)165 +b(GNU)45 b(F)-11 b(ree)45 b(Do)t(cumen)l(tation)h(License)439 +998 y Fo(:)19 b(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)h(:)f(:)g +(:)h(:)f(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)h(:)f(:) +g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)64 +b Fs(152)150 1268 y(App)t(endix)44 b(D)159 b(Indexes)15 +b Fo(:)20 b(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f +(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)59 b Fs(160)275 +1405 y Fu(D.1)92 b(Index)29 b(of)i(Shell)f(Builtin)h(Commands)16 +b Fn(:)e(:)i(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:) +h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)46 b Fu(160)275 +1514 y(D.2)92 b(Index)29 b(of)i(Shell)f(Reserv)m(ed)h(W)-8 +b(ords)12 b Fn(:)j(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h +(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)42 +b Fu(161)275 1624 y(D.3)92 b(P)m(arameter)31 b(and)f(V)-8 +b(ariable)32 b(Index)20 b Fn(:)14 b(:)i(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f +(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:) +f(:)h(:)f(:)50 b Fu(161)275 1733 y(D.4)92 b(F)-8 b(unction)31 +b(Index)16 b Fn(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f +(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:) +f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)47 +b Fu(163)275 1843 y(D.5)92 b(Concept)30 b(Index)d Fn(:)15 +b(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h +(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)h(:)f(:)g(:)h(:) +f(:)h(:)f(:)g(:)h(:)f(:)h(:)f(:)g(:)h(:)57 b Fu(165)p +eop end +%%Page: 1 7 +TeXDict begin 1 6 bop 150 -116 a Fu(Chapter)30 b(1:)41 +b(In)m(tro)s(duction)2592 b(1)150 299 y Fp(1)80 b(In)l(tro)t(duction) +150 602 y Fs(1.1)68 b(What)45 b(is)g(Bash?)150 762 y +Fu(Bash)38 b(is)g(the)g(shell,)i(or)d(command)h(language)h(in)m +(terpreter,)h(for)e(the)g Fm(gnu)f Fu(op)s(erating)h(system.)63 +b(The)150 871 y(name)33 b(is)g(an)g(acron)m(ym)g(for)g(the)g(`)p +Ft(Bourne-Again)27 b(SHell)p Fu(',)32 b(a)i(pun)d(on)i(Stephen)f +(Bourne,)h(the)g(author)150 981 y(of)f(the)f(direct)h(ancestor)h(of)e +(the)h(curren)m(t)f(Unix)g(shell)h Ft(sh)p Fu(,)f(whic)m(h)g(app)s +(eared)g(in)g(the)h(Sev)m(en)m(th)g(Edition)150 1091 +y(Bell)g(Labs)e(Researc)m(h)h(v)m(ersion)g(of)f(Unix.)275 +1220 y(Bash)f(is)g(largely)i(compatible)f(with)f Ft(sh)g +Fu(and)g(incorp)s(orates)g(useful)g(features)g(from)g(the)g(Korn)g +(shell)150 1330 y Ft(ksh)37 b Fu(and)h(the)g(C)g(shell)g +Ft(csh)p Fu(.)64 b(It)38 b(is)g(in)m(tended)g(to)h(b)s(e)f(a)g +(conforman)m(t)h(implemen)m(tation)h(of)e(the)g Fm(ieee)150 +1439 y(posix)c Fu(Shell)g(and)g(T)-8 b(o)s(ols)35 b(p)s(ortion)f(of)g +(the)h Fm(ieee)f(posix)f Fu(sp)s(eci\014cation)j(\()p +Fm(ieee)e Fu(Standard)f(1003.1\).)56 b(It)150 1549 y(o\013ers)31 +b(functional)f(impro)m(v)m(emen)m(ts)i(o)m(v)m(er)g Ft(sh)d +Fu(for)i(b)s(oth)e(in)m(teractiv)m(e)k(and)d(programming)g(use.)275 +1679 y(While)h(the)g Fm(gnu)f Fu(op)s(erating)h(system)g(pro)m(vides)f +(other)h(shells,)g(including)f(a)h(v)m(ersion)g(of)g +Ft(csh)p Fu(,)f(Bash)150 1788 y(is)j(the)h(default)f(shell.)49 +b(Lik)m(e)34 b(other)g Fm(gnu)f Fu(soft)m(w)m(are,)i(Bash)f(is)f(quite) +h(p)s(ortable.)49 b(It)33 b(curren)m(tly)g(runs)f(on)150 +1898 y(nearly)c(ev)m(ery)g(v)m(ersion)g(of)f(Unix)h(and)e(a)i(few)f +(other)h(op)s(erating)g(systems)f Fq(\000)g Fu(indep)s(enden)m +(tly-supp)s(orted)150 2008 y(p)s(orts)j(exist)h(for)f +Fm(ms-dos)p Fu(,)f Fm(os/2)p Fu(,)i(and)f(Windo)m(ws)g(platforms.)150 +2231 y Fs(1.2)68 b(What)45 b(is)g(a)h(shell?)150 2390 +y Fu(A)m(t)32 b(its)f(base,)h(a)f(shell)g(is)h(simply)e(a)h(macro)h +(pro)s(cessor)f(that)g(executes)i(commands.)42 b(The)30 +b(term)h(macro)150 2500 y(pro)s(cessor)25 b(means)g(functionalit)m(y)i +(where)d(text)j(and)d(sym)m(b)s(ols)h(are)h(expanded)e(to)i(create)h +(larger)f(expres-)150 2609 y(sions.)275 2739 y(A)34 b(Unix)h(shell)g +(is)f(b)s(oth)g(a)h(command)g(in)m(terpreter)g(and)f(a)h(programming)f +(language.)55 b(As)35 b(a)g(com-)150 2848 y(mand)30 b(in)m(terpreter,)i +(the)g(shell)f(pro)m(vides)g(the)h(user)e(in)m(terface)j(to)f(the)f +(ric)m(h)h(set)g(of)f Fm(gnu)g Fu(utilities.)44 b(The)150 +2958 y(programming)30 b(language)h(features)f(allo)m(w)h(these)g +(utilities)g(to)g(b)s(e)e(com)m(bined.)41 b(Files)31 +b(con)m(taining)g(com-)150 3068 y(mands)e(can)i(b)s(e)e(created,)j(and) +d(b)s(ecome)i(commands)f(themselv)m(es.)42 b(These)30 +b(new)f(commands)h(ha)m(v)m(e)i(the)150 3177 y(same)j(status)g(as)g +(system)g(commands)f(in)g(directories)i(suc)m(h)e(as)h +Ft(/bin)p Fu(,)g(allo)m(wing)h(users)e(or)g(groups)g(to)150 +3287 y(establish)d(custom)f(en)m(vironmen)m(ts)h(to)g(automate)h(their) +f(common)f(tasks.)275 3417 y(Shells)j(ma)m(y)h(b)s(e)f(used)g(in)m +(teractiv)m(ely)k(or)d(non-in)m(teractiv)m(ely)-8 b(.)54 +b(In)33 b(in)m(teractiv)m(e)j(mo)s(de,)f(they)e(accept)150 +3526 y(input)21 b(t)m(yp)s(ed)h(from)g(the)h(k)m(eyb)s(oard.)37 +b(When)22 b(executing)i(non-in)m(teractiv)m(ely)-8 b(,)27 +b(shells)c(execute)g(commands)150 3636 y(read)30 b(from)g(a)h(\014le.) +275 3765 y(A)41 b(shell)g(allo)m(ws)h(execution)h(of)e +Fm(gnu)g Fu(commands,)i(b)s(oth)e(sync)m(hronously)f(and)h(async)m +(hronously)-8 b(.)150 3875 y(The)29 b(shell)g(w)m(aits)i(for)e(sync)m +(hronous)f(commands)h(to)h(complete)h(b)s(efore)e(accepting)i(more)e +(input;)g(asyn-)150 3985 y(c)m(hronous)22 b(commands)h(con)m(tin)m(ue)h +(to)f(execute)h(in)e(parallel)i(with)f(the)f(shell)h(while)g(it)g +(reads)g(and)f(executes)150 4094 y(additional)35 b(commands.)50 +b(The)33 b Fr(redirection)h Fu(constructs)g(p)s(ermit)f(\014ne-grained) +g(con)m(trol)i(of)f(the)g(input)150 4204 y(and)40 b(output)f(of)i +(those)f(commands.)70 b(Moreo)m(v)m(er,)45 b(the)c(shell)f(allo)m(ws)h +(con)m(trol)h(o)m(v)m(er)g(the)e(con)m(ten)m(ts)i(of)150 +4313 y(commands')30 b(en)m(vironmen)m(ts.)275 4443 y(Shells)k(also)i +(pro)m(vide)g(a)f(small)h(set)f(of)g(built-in)g(commands)g(\()p +Fr(builtins)t Fu(\))g(implemen)m(ting)h(function-)150 +4553 y(alit)m(y)i(imp)s(ossible)e(or)g(incon)m(v)m(enien)m(t)j(to)e +(obtain)g(via)g(separate)g(utilities.)61 b(F)-8 b(or)37 +b(example,)i Ft(cd)p Fu(,)e Ft(break)p Fu(,)150 4662 +y Ft(continue)p Fu(,)28 b(and)i Ft(exec)f Fu(cannot)i(b)s(e)f(implemen) +m(ted)h(outside)g(of)f(the)h(shell)f(b)s(ecause)h(they)f(directly)h +(ma-)150 4772 y(nipulate)d(the)g(shell)g(itself.)41 b(The)27 +b Ft(history)p Fu(,)g Ft(getopts)p Fu(,)f Ft(kill)p Fu(,)i(or)g +Ft(pwd)f Fu(builtins,)h(among)g(others,)h(could)150 4881 +y(b)s(e)34 b(implemen)m(ted)g(in)g(separate)h(utilities,)i(but)d(they)g +(are)g(more)h(con)m(v)m(enien)m(t)h(to)f(use)f(as)g(builtin)g(com-)150 +4991 y(mands.)40 b(All)31 b(of)f(the)h(shell)f(builtins)g(are)h +(describ)s(ed)e(in)h(subsequen)m(t)g(sections.)275 5121 +y(While)39 b(executing)h(commands)e(is)g(essen)m(tial,)43 +b(most)c(of)g(the)g(p)s(o)m(w)m(er)f(\(and)g(complexit)m(y\))j(of)e +(shells)150 5230 y(is)34 b(due)f(to)i(their)f(em)m(b)s(edded)f +(programming)h(languages.)52 b(Lik)m(e)35 b(an)m(y)f(high-lev)m(el)i +(language,)h(the)d(shell)150 5340 y(pro)m(vides)c(v)-5 +b(ariables,)32 b(\015o)m(w)e(con)m(trol)i(constructs,)f(quoting,)g(and) +f(functions.)p eop end +%%Page: 2 8 +TeXDict begin 2 7 bop 150 -116 a Fu(Chapter)30 b(1:)41 +b(In)m(tro)s(duction)2592 b(2)275 299 y(Shells)21 b(o\013er)i(features) +f(geared)h(sp)s(eci\014cally)g(for)f(in)m(teractiv)m(e)j(use)d(rather)g +(than)g(to)h(augmen)m(t)g(the)f(pro-)150 408 y(gramming)32 +b(language.)48 b(These)32 b(in)m(teractiv)m(e)j(features)d(include)g +(job)g(con)m(trol,)j(command)c(line)i(editing,)150 518 +y(command)d(history)g(and)g(aliases.)42 b(Eac)m(h)31 +b(of)g(these)g(features)f(is)h(describ)s(ed)e(in)h(this)g(man)m(ual.)p +eop end +%%Page: 3 9 +TeXDict begin 3 8 bop 150 -116 a Fu(Chapter)30 b(2:)41 +b(De\014nitions)2662 b(3)150 299 y Fp(2)80 b(De\014nitions)150 +552 y Fu(These)30 b(de\014nitions)g(are)h(used)e(throughout)h(the)h +(remainder)f(of)g(this)h(man)m(ual.)150 720 y Ft(POSIX)240 +b Fu(A)27 b(family)g(of)g(op)s(en)f(system)g(standards)g(based)g(on)h +(Unix.)39 b(Bash)27 b(is)g(primarily)f(concerned)630 +830 y(with)k(the)h(Shell)f(and)g(Utilities)i(p)s(ortion)e(of)h(the)f +Fm(posix)g Fu(1003.1)j(standard.)150 995 y Ft(blank)240 +b Fu(A)30 b(space)h(or)g(tab)f(c)m(haracter.)150 1161 +y Ft(builtin)144 b Fu(A)35 b(command)g(that)g(is)g(implemen)m(ted)g(in) +m(ternally)h(b)m(y)f(the)g(shell)g(itself,)i(rather)d(than)h(b)m(y)630 +1271 y(an)30 b(executable)i(program)e(somewhere)h(in)f(the)g(\014le)h +(system.)150 1436 y Ft(control)d(operator)630 1546 y +Fu(A)20 b Ft(token)f Fu(that)i(p)s(erforms)e(a)i(con)m(trol)g +(function.)37 b(It)21 b(is)f(a)h Ft(newline)d Fu(or)j(one)f(of)h(the)f +(follo)m(wing:)630 1655 y(`)p Ft(||)p Fu(',)31 b(`)p +Ft(&&)p Fu(',)f(`)p Ft(&)p Fu(',)h(`)p Ft(;)p Fu(',)g(`)p +Ft(;;)p Fu(',)f(`)p Ft(|)p Fu(',)h(`)p Ft(|&)p Fu(',)f(`)p +Ft(\()p Fu(',)h(or)g(`)p Ft(\))p Fu('.)150 1821 y Ft(exit)e(status)630 +1931 y Fu(The)f(v)-5 b(alue)29 b(returned)e(b)m(y)h(a)h(command)f(to)h +(its)g(caller.)41 b(The)28 b(v)-5 b(alue)29 b(is)f(restricted)h(to)h +(eigh)m(t)630 2040 y(bits,)h(so)f(the)h(maxim)m(um)f(v)-5 +b(alue)31 b(is)f(255.)150 2206 y Ft(field)240 b Fu(A)27 +b(unit)g(of)g(text)h(that)g(is)f(the)g(result)g(of)g(one)h(of)f(the)g +(shell)g(expansions.)40 b(After)27 b(expansion,)630 2315 +y(when)e(executing)h(a)g(command,)h(the)f(resulting)f(\014elds)g(are)h +(used)f(as)h(the)g(command)f(name)630 2425 y(and)30 b(argumen)m(ts.)150 +2591 y Ft(filename)96 b Fu(A)30 b(string)h(of)f(c)m(haracters)i(used)e +(to)h(iden)m(tify)g(a)f(\014le.)150 2756 y Ft(job)336 +b Fu(A)31 b(set)h(of)f(pro)s(cesses)g(comprising)g(a)g(pip)s(eline,)g +(and)g(an)m(y)g(pro)s(cesses)g(descended)g(from)f(it,)630 +2866 y(that)h(are)g(all)g(in)f(the)h(same)f(pro)s(cess)g(group.)150 +3031 y Ft(job)f(control)630 3141 y Fu(A)22 b(mec)m(hanism)g(b)m(y)f +(whic)m(h)h(users)f(can)h(selectiv)m(ely)i(stop)e(\(susp)s(end\))e(and) +h(restart)i(\(resume\))630 3251 y(execution)32 b(of)e(pro)s(cesses.)150 +3416 y Ft(metacharacter)630 3526 y Fu(A)25 b(c)m(haracter)i(that,)g +(when)d(unquoted,)i(separates)g(w)m(ords.)38 b(A)26 b(metac)m(haracter) +i(is)d(a)g Ft(blank)630 3635 y Fu(or)30 b(one)h(of)g(the)f(follo)m +(wing)i(c)m(haracters:)42 b(`)p Ft(|)p Fu(',)31 b(`)p +Ft(&)p Fu(',)g(`)p Ft(;)p Fu(',)g(`)p Ft(\()p Fu(',)f(`)p +Ft(\))p Fu(',)h(`)p Ft(<)p Fu(',)g(or)f(`)p Ft(>)p Fu('.)150 +3801 y Ft(name)288 b Fu(A)37 b Ft(word)f Fu(consisting)i(solely)h(of)e +(letters,)j(n)m(um)m(b)s(ers,)e(and)f(underscores,)h(and)f(b)s +(eginning)630 3910 y(with)23 b(a)g(letter)h(or)f(underscore.)38 +b Ft(Name)p Fu(s)22 b(are)h(used)f(as)i(shell)f(v)-5 +b(ariable)24 b(and)e(function)h(names.)630 4020 y(Also)31 +b(referred)f(to)h(as)f(an)h Ft(identifier)p Fu(.)150 +4186 y Ft(operator)96 b Fu(A)38 b Ft(control)28 b(operator)36 +b Fu(or)h(a)i Ft(redirection)27 b(operator)p Fu(.)61 +b(See)38 b(Section)g(3.6)h([Redirec-)630 4295 y(tions],)f(page)f(31,)i +(for)d(a)g(list)h(of)f(redirection)h(op)s(erators.)58 +b(Op)s(erators)35 b(con)m(tain)j(at)f(least)630 4405 +y(one)31 b(unquoted)e Ft(metacharacter)p Fu(.)150 4570 +y Ft(process)f(group)630 4680 y Fu(A)i(collection)k(of)c(related)h(pro) +s(cesses)g(eac)m(h)g(ha)m(ving)g(the)g(same)f(pro)s(cess)g(group)g +Fm(id)p Fu(.)150 4846 y Ft(process)e(group)h(ID)630 4955 +y Fu(A)h(unique)g(iden)m(ti\014er)h(that)f(represen)m(ts)h(a)g +Ft(process)d(group)h Fu(during)g(its)i(lifetime.)150 +5121 y Ft(reserved)d(word)630 5230 y Fu(A)h Ft(word)e +Fu(that)i(has)f(a)h(sp)s(ecial)g(meaning)f(to)h(the)g(shell.)40 +b(Most)30 b(reserv)m(ed)e(w)m(ords)g(in)m(tro)s(duce)630 +5340 y(shell)j(\015o)m(w)f(con)m(trol)i(constructs,)f(suc)m(h)f(as)g +Ft(for)g Fu(and)g Ft(while)p Fu(.)p eop end +%%Page: 4 10 +TeXDict begin 4 9 bop 150 -116 a Fu(Chapter)30 b(2:)41 +b(De\014nitions)2662 b(4)150 299 y Ft(return)29 b(status)630 +408 y Fu(A)h(synon)m(ym)g(for)g Ft(exit)g(status)p Fu(.)150 +568 y Ft(signal)192 b Fu(A)40 b(mec)m(hanism)h(b)m(y)e(whic)m(h)h(a)h +(pro)s(cess)e(ma)m(y)i(b)s(e)e(noti\014ed)h(b)m(y)g(the)h(k)m(ernel)f +(of)g(an)g(ev)m(en)m(t)630 677 y(o)s(ccurring)30 b(in)g(the)h(system.) +150 837 y Ft(special)d(builtin)630 946 y Fu(A)j(shell)f(builtin)g +(command)h(that)g(has)f(b)s(een)g(classi\014ed)h(as)g(sp)s(ecial)g(b)m +(y)f(the)h Fm(posix)f Fu(stan-)630 1056 y(dard.)150 1215 +y Ft(token)240 b Fu(A)38 b(sequence)h(of)f(c)m(haracters)h(considered)f +(a)h(single)g(unit)e(b)m(y)h(the)h(shell.)64 b(It)38 +b(is)g(either)h(a)630 1325 y Ft(word)29 b Fu(or)i(an)f +Ft(operator)p Fu(.)150 1484 y Ft(word)288 b Fu(A)28 b(sequence)g(of)g +(c)m(haracters)h(treated)g(as)f(a)g(unit)f(b)m(y)h(the)g(shell.)40 +b(W)-8 b(ords)28 b(ma)m(y)g(not)g(include)630 1594 y(unquoted)i +Ft(metacharacters)p Fu(.)p eop end +%%Page: 5 11 +TeXDict begin 5 10 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2292 b(5)150 299 +y Fp(3)80 b(Basic)54 b(Shell)e(F)-13 b(eatures)150 603 +y Fu(Bash)21 b(is)g(an)f(acron)m(ym)i(for)e(`)p Ft(Bourne-Again)27 +b(SHell)p Fu('.)37 b(The)20 b(Bourne)g(shell)h(is)g(the)g(traditional)h +(Unix)f(shell)150 712 y(originally)h(written)f(b)m(y)f(Stephen)g +(Bourne.)38 b(All)21 b(of)g(the)g(Bourne)f(shell)h(builtin)f(commands)g +(are)i(a)m(v)-5 b(ailable)150 822 y(in)26 b(Bash,)h(The)f(rules)f(for)h +(ev)-5 b(aluation)28 b(and)d(quoting)h(are)h(tak)m(en)g(from)f(the)g +Fm(posix)f Fu(sp)s(eci\014cation)i(for)f(the)150 931 +y(`standard')k(Unix)g(shell.)275 1089 y(This)h(c)m(hapter)i(brie\015y)e +(summarizes)h(the)h(shell's)f(`building)g(blo)s(c)m(ks':)45 +b(commands,)32 b(con)m(trol)i(struc-)150 1199 y(tures,)k(shell)e +(functions,)h(shell)g Fl(p)-5 b(ar)g(ameters)p Fu(,)41 +b(shell)36 b(expansions,)i Fl(r)-5 b(e)g(dir)g(e)g(ctions)p +Fu(,)40 b(whic)m(h)c(are)h(a)f(w)m(a)m(y)h(to)150 1308 +y(direct)31 b(input)e(and)h(output)g(from)g(and)g(to)h(named)f +(\014les,)g(and)g(ho)m(w)g(the)h(shell)g(executes)g(commands.)150 +1576 y Fs(3.1)68 b(Shell)45 b(Syn)l(tax)150 1735 y Fu(When)40 +b(the)h(shell)g(reads)f(input,)i(it)f(pro)s(ceeds)f(through)g(a)h +(sequence)g(of)g(op)s(erations.)71 b(If)40 b(the)h(input)150 +1845 y(indicates)31 b(the)f(b)s(eginning)f(of)h(a)g(commen)m(t,)h(the)f +(shell)g(ignores)g(the)g(commen)m(t)h(sym)m(b)s(ol)f(\(`)p +Ft(#)p Fu('\),)h(and)e(the)150 1954 y(rest)i(of)f(that)h(line.)275 +2112 y(Otherwise,)h(roughly)f(sp)s(eaking,)i(the)f(shell)g(reads)g(its) +g(input)f(and)h(divides)f(the)i(input)e(in)m(to)h(w)m(ords)150 +2222 y(and)23 b(op)s(erators,)j(emplo)m(ying)e(the)g(quoting)h(rules)e +(to)h(select)i(whic)m(h)d(meanings)h(to)h(assign)f(v)-5 +b(arious)23 b(w)m(ords)150 2331 y(and)30 b(c)m(haracters.)275 +2489 y(The)38 b(shell)h(then)f(parses)g(these)h(tok)m(ens)h(in)m(to)f +(commands)g(and)f(other)h(constructs,)i(remo)m(v)m(es)f(the)150 +2598 y(sp)s(ecial)31 b(meaning)f(of)g(certain)h(w)m(ords)f(or)g(c)m +(haracters,)i(expands)d(others,)h(redirects)h(input)e(and)g(output)150 +2708 y(as)d(needed,)g(executes)g(the)g(sp)s(eci\014ed)e(command,)j(w)m +(aits)f(for)f(the)g(command's)g(exit)i(status,)f(and)f(mak)m(es)150 +2818 y(that)31 b(exit)g(status)g(a)m(v)-5 b(ailable)33 +b(for)d(further)f(insp)s(ection)h(or)h(pro)s(cessing.)150 +3040 y Fk(3.1.1)63 b(Shell)41 b(Op)s(eration)150 3187 +y Fu(The)c(follo)m(wing)h(is)f(a)h(brief)e(description)i(of)f(the)g +(shell's)h(op)s(eration)f(when)f(it)i(reads)f(and)f(executes)j(a)150 +3297 y(command.)h(Basically)-8 b(,)34 b(the)c(shell)h(do)s(es)f(the)h +(follo)m(wing:)199 3454 y(1.)61 b(Reads)42 b(its)h(input)e(from)h(a)g +(\014le)h(\(see)g(Section)g(3.8)g([Shell)f(Scripts],)j(page)e(39\),)k +(from)41 b(a)i(string)330 3564 y(supplied)30 b(as)h(an)g(argumen)m(t)h +(to)g(the)f Ft(-c)g Fu(in)m(v)m(o)s(cation)i(option)f(\(see)g(Section)g +(6.1)g([In)m(v)m(oking)g(Bash],)330 3673 y(page)f(80\),)h(or)e(from)g +(the)h(user's)f(terminal.)199 3820 y(2.)61 b(Breaks)43 +b(the)g(input)f(in)m(to)h(w)m(ords)f(and)g(op)s(erators,)k(ob)s(eying)d +(the)g(quoting)g(rules)f(describ)s(ed)f(in)330 3929 y(Section)27 +b(3.1.2)i([Quoting],)f(page)f(6.)40 b(These)26 b(tok)m(ens)i(are)f +(separated)g(b)m(y)f Ft(metacharacters)p Fu(.)36 b(Alias)330 +4039 y(expansion)30 b(is)h(p)s(erformed)d(b)m(y)j(this)f(step)g(\(see)i +(Section)f(6.6)g([Aliases],)i(page)e(88\).)199 4185 y(3.)61 +b(P)m(arses)35 b(the)g(tok)m(ens)g(in)m(to)h(simple)e(and)g(comp)s +(ound)f(commands)h(\(see)h(Section)h(3.2)f([Shell)g(Com-)330 +4294 y(mands],)30 b(page)h(8\).)199 4441 y(4.)61 b(P)m(erforms)40 +b(the)h(v)-5 b(arious)40 b(shell)h(expansions)f(\(see)h(Section)g(3.5)g +([Shell)g(Expansions],)h(page)f(21\),)330 4550 y(breaking)35 +b(the)g(expanded)g(tok)m(ens)h(in)m(to)g(lists)f(of)g(\014lenames)h +(\(see)g(Section)f(3.5.8)i([Filename)g(Ex-)330 4660 y(pansion],)30 +b(page)h(30\))h(and)e(commands)g(and)g(argumen)m(ts.)199 +4806 y(5.)61 b(P)m(erforms)36 b(an)m(y)i(necessary)f(redirections)g +(\(see)h(Section)f(3.6)h([Redirections],)i(page)e(31\))g(and)e(re-)330 +4915 y(mo)m(v)m(es)c(the)e(redirection)h(op)s(erators)g(and)f(their)g +(op)s(erands)f(from)h(the)h(argumen)m(t)f(list.)199 5062 +y(6.)61 b(Executes)31 b(the)g(command)f(\(see)h(Section)g(3.7)h +([Executing)f(Commands],)f(page)h(35\).)199 5208 y(7.)61 +b(Optionally)40 b(w)m(aits)g(for)f(the)g(command)g(to)h(complete)g(and) +f(collects)i(its)f(exit)g(status)f(\(see)h(Sec-)330 5317 +y(tion)31 b(3.7.5)h([Exit)f(Status],)g(page)g(38\).)p +eop end +%%Page: 6 12 +TeXDict begin 6 11 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2292 b(6)150 299 +y Fk(3.1.2)63 b(Quoting)150 446 y Fu(Quoting)32 b(is)h(used)e(to)i +(remo)m(v)m(e)h(the)e(sp)s(ecial)h(meaning)f(of)h(certain)g(c)m +(haracters)g(or)f(w)m(ords)g(to)h(the)f(shell.)150 555 +y(Quoting)c(can)f(b)s(e)g(used)f(to)j(disable)e(sp)s(ecial)h(treatmen)m +(t)h(for)e(sp)s(ecial)h(c)m(haracters,)i(to)e(prev)m(en)m(t)g(reserv)m +(ed)150 665 y(w)m(ords)i(from)g(b)s(eing)g(recognized)h(as)g(suc)m(h,)f +(and)g(to)h(prev)m(en)m(t)g(parameter)g(expansion.)275 +793 y(Eac)m(h)22 b(of)g(the)g(shell)g(metac)m(haracters)i(\(see)f +(Chapter)e(2)i([De\014nitions],)h(page)f(3\))g(has)e(sp)s(ecial)i +(meaning)150 902 y(to)40 b(the)g(shell)f(and)g(m)m(ust)g(b)s(e)g +(quoted)g(if)h(it)g(is)f(to)h(represen)m(t)g(itself.)68 +b(When)39 b(the)h(command)f(history)150 1012 y(expansion)i(facilities)j +(are)e(b)s(eing)f(used)g(\(see)h(Section)h(9.3)f([History)h(In)m +(teraction],)j(page)c(135\),)47 b(the)150 1122 y Fr(history)30 +b(expansion)h Fu(c)m(haracter,)h(usually)f(`)p Ft(!)p +Fu(',)g(m)m(ust)f(b)s(e)g(quoted)h(to)g(prev)m(en)m(t)g(history)g +(expansion.)41 b(See)150 1231 y(Section)22 b(9.1)g([Bash)f(History)h(F) +-8 b(acilities],)26 b(page)c(133,)j(for)20 b(more)h(details)h +(concerning)g(history)f(expansion.)275 1359 y(There)37 +b(are)h(three)f(quoting)h(mec)m(hanisms:)56 b(the)38 +b Fr(escap)s(e)g(c)m(haracter)p Fu(,)j(single)d(quotes,)i(and)d(double) +150 1469 y(quotes.)150 1655 y Fk(3.1.2.1)63 b(Escap)s(e)41 +b(Character)150 1802 y Fu(A)36 b(non-quoted)f(bac)m(kslash)h(`)p +Ft(\\)p Fu(')g(is)f(the)h(Bash)g(escap)s(e)f(c)m(haracter.)58 +b(It)36 b(preserv)m(es)f(the)h(literal)h(v)-5 b(alue)36 +b(of)150 1911 y(the)27 b(next)g(c)m(haracter)h(that)f(follo)m(ws,)i +(with)d(the)h(exception)g(of)g Ft(newline)p Fu(.)38 b(If)26 +b(a)h Ft(\\newline)d Fu(pair)i(app)s(ears,)150 2021 y(and)k(the)h(bac)m +(kslash)g(itself)g(is)g(not)g(quoted,)g(the)f Ft(\\newline)f +Fu(is)h(treated)i(as)f(a)g(line)g(con)m(tin)m(uation)h(\(that)150 +2131 y(is,)f(it)g(is)f(remo)m(v)m(ed)h(from)f(the)h(input)e(stream)i +(and)f(e\013ectiv)m(ely)j(ignored\).)150 2317 y Fk(3.1.2.2)63 +b(Single)42 b(Quotes)150 2464 y Fu(Enclosing)24 b(c)m(haracters)h(in)e +(single)h(quotes)g(\(`)p Ft(')p Fu('\))g(preserv)m(es)g(the)f(literal)i +(v)-5 b(alue)24 b(of)g(eac)m(h)g(c)m(haracter)h(within)150 +2573 y(the)31 b(quotes.)42 b(A)31 b(single)h(quote)f(ma)m(y)g(not)g(o)s +(ccur)g(b)s(et)m(w)m(een)g(single)h(quotes,)f(ev)m(en)h(when)d +(preceded)i(b)m(y)g(a)150 2683 y(bac)m(kslash.)150 2869 +y Fk(3.1.2.3)63 b(Double)42 b(Quotes)150 3016 y Fu(Enclosing)24 +b(c)m(haracters)h(in)f(double)f(quotes)h(\(`)p Ft(")p +Fu('\))g(preserv)m(es)g(the)g(literal)h(v)-5 b(alue)24 +b(of)g(all)g(c)m(haracters)h(within)150 3125 y(the)34 +b(quotes,)h(with)f(the)g(exception)h(of)f(`)p Ft($)p +Fu(',)h(`)p Ft(`)p Fu(',)g(`)p Ft(\\)p Fu(',)g(and,)f(when)f(history)g +(expansion)h(is)g(enabled,)h(`)p Ft(!)p Fu('.)150 3235 +y(The)25 b(c)m(haracters)h(`)p Ft($)p Fu(')g(and)f(`)p +Ft(`)p Fu(')g(retain)h(their)f(sp)s(ecial)h(meaning)f(within)g(double)g +(quotes)h(\(see)g(Section)g(3.5)150 3345 y([Shell)j(Expansions],)g +(page)h(21\).)41 b(The)28 b(bac)m(kslash)i(retains)f(its)h(sp)s(ecial)f +(meaning)g(only)g(when)f(follo)m(w)m(ed)150 3454 y(b)m(y)41 +b(one)f(of)h(the)g(follo)m(wing)h(c)m(haracters:)63 b(`)p +Ft($)p Fu(',)43 b(`)p Ft(`)p Fu(',)h(`)p Ft(")p Fu(',)g(`)p +Ft(\\)p Fu(',)f(or)e Ft(newline)p Fu(.)69 b(Within)41 +b(double)f(quotes,)150 3564 y(bac)m(kslashes)25 b(that)h(are)f(follo)m +(w)m(ed)h(b)m(y)e(one)h(of)g(these)g(c)m(haracters)h(are)f(remo)m(v)m +(ed.)40 b(Bac)m(kslashes)26 b(preceding)150 3673 y(c)m(haracters)35 +b(without)e(a)h(sp)s(ecial)f(meaning)h(are)f(left)h(unmo)s(di\014ed.)47 +b(A)34 b(double)f(quote)g(ma)m(y)h(b)s(e)f(quoted)150 +3783 y(within)h(double)h(quotes)g(b)m(y)g(preceding)g(it)g(with)g(a)g +(bac)m(kslash.)55 b(If)35 b(enabled,)h(history)f(expansion)g(will)150 +3892 y(b)s(e)f(p)s(erformed)g(unless)g(an)h(`)p Ft(!)p +Fu(')g(app)s(earing)f(in)h(double)f(quotes)i(is)f(escap)s(ed)g(using)f +(a)h(bac)m(kslash.)55 b(The)150 4002 y(bac)m(kslash)31 +b(preceding)f(the)h(`)p Ft(!)p Fu(')f(is)h(not)g(remo)m(v)m(ed.)275 +4130 y(The)41 b(sp)s(ecial)h(parameters)f(`)p Ft(*)p +Fu(')h(and)f(`)p Ft(@)p Fu(')h(ha)m(v)m(e)g(sp)s(ecial)g(meaning)g +(when)f(in)g(double)g(quotes)h(\(see)150 4240 y(Section)31 +b(3.5.3)h([Shell)f(P)m(arameter)h(Expansion],)e(page)h(23\).)150 +4426 y Fk(3.1.2.4)63 b(ANSI-C)40 b(Quoting)150 4573 y +Fu(W)-8 b(ords)43 b(of)f(the)h(form)f Ft($')p Fj(string)p +Ft(')e Fu(are)j(treated)g(sp)s(ecially)-8 b(.)79 b(The)42 +b(w)m(ord)g(expands)f(to)j Fr(string)p Fu(,)h(with)150 +4682 y(bac)m(kslash-escap)s(ed)f(c)m(haracters)h(replaced)f(as)g(sp)s +(eci\014ed)f(b)m(y)g(the)g(ANSI)g(C)g(standard.)79 b(Bac)m(kslash)150 +4792 y(escap)s(e)31 b(sequences,)g(if)f(presen)m(t,)h(are)g(deco)s(ded) +f(as)g(follo)m(ws:)150 4938 y Ft(\\a)384 b Fu(alert)31 +b(\(b)s(ell\))150 5084 y Ft(\\b)384 b Fu(bac)m(kspace)150 +5230 y Ft(\\e)150 5340 y(\\E)g Fu(an)30 b(escap)s(e)h(c)m(haracter)h +(\(not)f(ANSI)f(C\))p eop end +%%Page: 7 13 +TeXDict begin 7 12 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2292 b(7)150 299 +y Ft(\\f)384 b Fu(form)30 b(feed)150 488 y Ft(\\n)384 +b Fu(newline)150 678 y Ft(\\r)g Fu(carriage)32 b(return)150 +868 y Ft(\\t)384 b Fu(horizon)m(tal)32 b(tab)150 1057 +y Ft(\\v)384 b Fu(v)m(ertical)32 b(tab)150 1247 y Ft(\\\\)384 +b Fu(bac)m(kslash)150 1436 y Ft(\\')g Fu(single)31 b(quote)150 +1626 y Ft(\\")384 b Fu(double)30 b(quote)150 1816 y Ft(\\)p +Fj(nnn)288 b Fu(the)31 b(eigh)m(t-bit)h(c)m(haracter)g(whose)e(v)-5 +b(alue)31 b(is)f(the)h(o)s(ctal)g(v)-5 b(alue)31 b Fr(nnn)e +Fu(\(one)i(to)g(three)g(digits\))150 2005 y Ft(\\x)p +Fj(HH)288 b Fu(the)36 b(eigh)m(t-bit)i(c)m(haracter)f(whose)f(v)-5 +b(alue)36 b(is)g(the)g(hexadecimal)h(v)-5 b(alue)36 b +Fr(HH)46 b Fu(\(one)37 b(or)f(t)m(w)m(o)630 2115 y(hex)30 +b(digits\))150 2304 y Ft(\\u)p Fj(HHHH)192 b Fu(the)33 +b(Unico)s(de)f(\(ISO/IEC)g(10646\))j(c)m(haracter)f(whose)e(v)-5 +b(alue)33 b(is)g(the)g(hexadecimal)g(v)-5 b(alue)630 +2414 y Fr(HHHH)41 b Fu(\(one)31 b(to)g(four)f(hex)g(digits\))150 +2604 y Ft(\\U)p Fj(HHHHHHHH)630 2713 y Fu(the)j(Unico)s(de)f(\(ISO/IEC) +g(10646\))j(c)m(haracter)f(whose)e(v)-5 b(alue)33 b(is)g(the)g +(hexadecimal)g(v)-5 b(alue)630 2823 y Fr(HHHHHHHH)42 +b Fu(\(one)31 b(to)g(eigh)m(t)g(hex)g(digits\))150 3012 +y Ft(\\c)p Fj(x)336 b Fu(a)31 b(con)m(trol-)p Fr(x)38 +b Fu(c)m(haracter)150 3217 y(The)30 b(expanded)f(result)i(is)f +(single-quoted,)i(as)f(if)f(the)g(dollar)h(sign)g(had)e(not)i(b)s(een)f +(presen)m(t.)150 3446 y Fk(3.1.2.5)63 b(Lo)s(cale-Sp)s(eci\014c)41 +b(T)-10 b(ranslation)150 3593 y Fu(A)28 b(double-quoted)g(string)f +(preceded)h(b)m(y)f(a)h(dollar)h(sign)e(\(`)p Ft($)p +Fu('\))i(will)f(cause)g(the)g(string)g(to)g(b)s(e)f(translated)150 +3703 y(according)f(to)f(the)g(curren)m(t)g(lo)s(cale.)41 +b(If)24 b(the)h(curren)m(t)g(lo)s(cale)h(is)f Ft(C)g +Fu(or)g Ft(POSIX)p Fu(,)f(the)h(dollar)h(sign)f(is)g(ignored.)150 +3813 y(If)30 b(the)g(string)h(is)f(translated)h(and)f(replaced,)h(the)g +(replacemen)m(t)h(is)e(double-quoted.)275 3977 y(Some)20 +b(systems)h(use)f(the)h(message)h(catalog)h(selected)f(b)m(y)f(the)g +Ft(LC_MESSAGES)c Fu(shell)k(v)-5 b(ariable.)39 b(Others)150 +4087 y(create)g(the)e(name)g(of)g(the)g(message)h(catalog)i(from)d(the) +g(v)-5 b(alue)37 b(of)g(the)h Ft(TEXTDOMAIN)c Fu(shell)j(v)-5 +b(ariable,)150 4196 y(p)s(ossibly)31 b(adding)g(a)g(su\016x)g(of)h(`)p +Ft(.mo)p Fu('.)43 b(If)31 b(y)m(ou)h(use)f(the)h Ft(TEXTDOMAIN)c +Fu(v)-5 b(ariable,)33 b(y)m(ou)f(ma)m(y)g(need)f(to)h(set)150 +4306 y(the)22 b Ft(TEXTDOMAINDIR)d Fu(v)-5 b(ariable)23 +b(to)g(the)f(lo)s(cation)i(of)e(the)h(message)g(catalog)i(\014les.)38 +b(Still)23 b(others)f(use)g(b)s(oth)150 4416 y(v)-5 b(ariables)31 +b(in)f(this)g(fashion:)41 b Ft(TEXTDOMAINDIR)p Fu(/)p +Ft(LC_MESSAGES)p Fu(/LC)p 2528 4416 28 4 v 34 w(MESSA)m(GES/)p +Ft(TEXTDOMAIN)p Fu(.mo.)150 4645 y Fk(3.1.3)63 b(Commen)m(ts)150 +4792 y Fu(In)21 b(a)i(non-in)m(teractiv)m(e)h(shell,)g(or)e(an)g(in)m +(teractiv)m(e)j(shell)d(in)g(whic)m(h)g(the)g Ft(interactive_comments) +16 b Fu(option)150 4902 y(to)40 b(the)f Ft(shopt)e Fu(builtin)h(is)h +(enabled)g(\(see)h(Section)g(4.3.2)g([The)f(Shopt)f(Builtin],)k(page)e +(62\),)i(a)d(w)m(ord)150 5011 y(b)s(eginning)26 b(with)g(`)p +Ft(#)p Fu(')g(causes)h(that)f(w)m(ord)g(and)g(all)h(remaining)g(c)m +(haracters)g(on)f(that)h(line)g(to)g(b)s(e)f(ignored.)150 +5121 y(An)43 b(in)m(teractiv)m(e)j(shell)e(without)f(the)g +Ft(interactive_comments)38 b Fu(option)44 b(enabled)f(do)s(es)g(not)g +(allo)m(w)150 5230 y(commen)m(ts.)56 b(The)34 b Ft +(interactive_comments)c Fu(option)35 b(is)g(on)g(b)m(y)g(default)g(in)g +(in)m(teractiv)m(e)j(shells.)55 b(See)150 5340 y(Section)30 +b(6.3)f([In)m(teractiv)m(e)j(Shells],)d(page)h(83,)g(for)e(a)i +(description)e(of)h(what)g(mak)m(es)h(a)f(shell)g(in)m(teractiv)m(e.)p +eop end +%%Page: 8 14 +TeXDict begin 8 13 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2292 b(8)150 299 +y Fs(3.2)68 b(Shell)45 b(Commands)150 458 y Fu(A)d(simple)g(shell)g +(command)f(suc)m(h)h(as)g Ft(echo)29 b(a)h(b)g(c)41 b +Fu(consists)i(of)f(the)f(command)h(itself)h(follo)m(w)m(ed)g(b)m(y)150 +568 y(argumen)m(ts,)31 b(separated)g(b)m(y)f(spaces.)275 +704 y(More)h(complex)h(shell)f(commands)g(are)g(comp)s(osed)g(of)g +(simple)g(commands)g(arranged)g(together)h(in)150 814 +y(a)f(v)-5 b(ariet)m(y)32 b(of)f(w)m(a)m(ys:)41 b(in)31 +b(a)g(pip)s(eline)f(in)g(whic)m(h)g(the)h(output)f(of)h(one)f(command)h +(b)s(ecomes)f(the)h(input)f(of)150 923 y(a)h(second,)f(in)h(a)f(lo)s +(op)h(or)f(conditional)i(construct,)f(or)f(in)g(some)h(other)g +(grouping.)150 1124 y Fk(3.2.1)63 b(Simple)41 b(Commands)150 +1271 y Fu(A)29 b(simple)f(command)g(is)h(the)g(kind)e(of)i(command)f +(encoun)m(tered)h(most)g(often.)40 b(It's)29 b(just)f(a)h(sequence)g +(of)150 1381 y(w)m(ords)22 b(separated)i(b)m(y)e Ft(blank)p +Fu(s,)i(terminated)f(b)m(y)g(one)g(of)g(the)g(shell's)g(con)m(trol)h +(op)s(erators)f(\(see)h(Chapter)f(2)150 1491 y([De\014nitions],)37 +b(page)e(3\).)54 b(The)35 b(\014rst)e(w)m(ord)i(generally)g(sp)s +(eci\014es)g(a)g(command)f(to)h(b)s(e)f(executed,)j(with)150 +1600 y(the)31 b(rest)f(of)h(the)f(w)m(ords)g(b)s(eing)g(that)h +(command's)f(argumen)m(ts.)275 1736 y(The)h(return)h(status)g(\(see)i +(Section)f(3.7.5)h([Exit)f(Status],)h(page)f(38\))g(of)g(a)g(simple)f +(command)g(is)h(its)150 1846 y(exit)38 b(status)f(as)g(pro)m(vided)f(b) +m(y)h(the)g Fm(posix)f Fu(1003.1)j Ft(waitpid)c Fu(function,)j(or)f +(128)p Ft(+)p Fr(n)g Fu(if)g(the)g(command)150 1956 y(w)m(as)31 +b(terminated)g(b)m(y)f(signal)h Fr(n)p Fu(.)150 2157 +y Fk(3.2.2)63 b(Pip)s(elines)150 2304 y Fu(A)35 b Ft(pipeline)e +Fu(is)j(a)f(sequence)h(of)f(simple)g(commands)g(separated)h(b)m(y)f +(one)g(of)h(the)f(con)m(trol)i(op)s(erators)150 2413 +y(`)p Ft(|)p Fu(')31 b(or)f(`)p Ft(|&)p Fu('.)275 2550 +y(The)f(format)i(for)f(a)h(pip)s(eline)f(is)390 2686 +y Ft([time)46 b([-p]])h([!])g Fj(command1)e Ft([)j(|)f(or)g(|&)g +Fj(command2)f Ft(])h(...)150 2822 y Fu(The)25 b(output)f(of)i(eac)m(h)g +(command)f(in)f(the)i(pip)s(eline)e(is)i(connected)g(via)f(a)h(pip)s(e) +e(to)i(the)f(input)f(of)h(the)h(next)150 2932 y(command.)40 +b(That)29 b(is,)h(eac)m(h)h(command)e(reads)g(the)h(previous)f +(command's)g(output.)40 b(This)29 b(connection)150 3041 +y(is)h(p)s(erformed)f(b)s(efore)h(an)m(y)h(redirections)g(sp)s +(eci\014ed)f(b)m(y)g(the)g(command.)275 3178 y(If)k(`)p +Ft(|&)p Fu(')h(is)f(used,)i Fr(command1)7 b Fu('s)35 +b(standard)f(error,)i(in)e(addition)h(to)h(its)f(standard)f(output,)i +(is)e(con-)150 3287 y(nected)h(to)g Fr(command2)7 b Fu('s)35 +b(standard)f(input)f(through)h(the)g(pip)s(e;)i(it)f(is)g(shorthand)e +(for)h Ft(2>&1)29 b(|)p Fu(.)53 b(This)150 3397 y(implicit)41 +b(redirection)f(of)g(the)g(standard)f(error)g(to)h(the)g(standard)f +(output)g(is)h(p)s(erformed)e(after)j(an)m(y)150 3506 +y(redirections)31 b(sp)s(eci\014ed)f(b)m(y)g(the)g(command.)275 +3643 y(The)36 b(reserv)m(ed)g(w)m(ord)g Ft(time)g Fu(causes)h(timing)g +(statistics)h(to)f(b)s(e)f(prin)m(ted)g(for)g(the)h(pip)s(eline)f(once) +h(it)150 3752 y(\014nishes.)51 b(The)34 b(statistics)i(curren)m(tly)e +(consist)h(of)f(elapsed)h(\(w)m(all-clo)s(c)m(k\))i(time)e(and)f(user)f +(and)h(system)150 3862 y(time)e(consumed)e(b)m(y)h(the)g(command's)g +(execution.)44 b(The)31 b Ft(-p)f Fu(option)i(c)m(hanges)g(the)f +(output)g(format)g(to)150 3971 y(that)j(sp)s(eci\014ed)e(b)m(y)h +Fm(posix)p Fu(.)49 b(When)33 b(the)g(shell)g(is)h(in)e +Fm(posix)h Fu(mo)s(de)g(\(see)h(Section)g(6.11)g([Bash)g(POSIX)150 +4081 y(Mo)s(de],)40 b(page)f(94\),)i(it)d(do)s(es)f(not)h(recognize)i +Ft(time)c Fu(as)i(a)g(reserv)m(ed)g(w)m(ord)f(if)h(the)g(next)g(tok)m +(en)g(b)s(egins)150 4191 y(with)33 b(a)g(`)p Ft(-)p Fu('.)49 +b(The)33 b Ft(TIMEFORMAT)d Fu(v)-5 b(ariable)34 b(ma)m(y)g(b)s(e)f(set) +g(to)h(a)g(format)f(string)g(that)h(sp)s(eci\014es)f(ho)m(w)g(the)150 +4300 y(timing)38 b(information)g(should)e(b)s(e)h(displa)m(y)m(ed.)62 +b(See)38 b(Section)g(5.2)g([Bash)g(V)-8 b(ariables],)41 +b(page)d(69,)i(for)e(a)150 4410 y(description)27 b(of)g(the)h(a)m(v)-5 +b(ailable)29 b(formats.)40 b(The)26 b(use)h(of)g Ft(time)f +Fu(as)i(a)f(reserv)m(ed)g(w)m(ord)g(p)s(ermits)f(the)h(timing)150 +4519 y(of)38 b(shell)g(builtins,)i(shell)e(functions,)i(and)d(pip)s +(elines.)63 b(An)38 b(external)h Ft(time)e Fu(command)h(cannot)g(time) +150 4629 y(these)31 b(easily)-8 b(.)275 4765 y(When)29 +b(the)h(shell)h(is)f(in)f Fm(posix)g Fu(mo)s(de)h(\(see)h(Section)f +(6.11)i([Bash)e(POSIX)f(Mo)s(de],)i(page)g(94\),)g Ft(time)150 +4875 y Fu(ma)m(y)26 b(b)s(e)f(follo)m(w)m(ed)j(b)m(y)d(a)h(newline.)39 +b(In)25 b(this)h(case,)i(the)d(shell)h(displa)m(ys)g(the)g(total)h +(user)e(and)g(system)h(time)150 4984 y(consumed)33 b(b)m(y)h(the)h +(shell)f(and)f(its)i(c)m(hildren.)51 b(The)34 b Ft(TIMEFORMAT)d +Fu(v)-5 b(ariable)35 b(ma)m(y)g(b)s(e)e(used)g(to)i(sp)s(ecify)150 +5094 y(the)c(format)f(of)h(the)f(time)h(information.)275 +5230 y(If)24 b(the)h(pip)s(eline)g(is)g(not)g(executed)h(async)m +(hronously)f(\(see)h(Section)g(3.2.3)h([Lists],)g(page)e(9\),)i(the)f +(shell)150 5340 y(w)m(aits)31 b(for)f(all)i(commands)e(in)g(the)g(pip)s +(eline)g(to)h(complete.)p eop end +%%Page: 9 15 +TeXDict begin 9 14 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2292 b(9)275 299 +y(Eac)m(h)25 b(command)g(in)g(a)g(pip)s(eline)g(is)g(executed)h(in)f +(its)g(o)m(wn)h(subshell)e(\(see)i(Section)g(3.7.3)h([Command)150 +408 y(Execution)36 b(En)m(vironmen)m(t],)i(page)e(36\).)58 +b(The)36 b(exit)g(status)g(of)g(a)g(pip)s(eline)g(is)f(the)h(exit)h +(status)f(of)g(the)150 518 y(last)27 b(command)f(in)f(the)i(pip)s +(eline,)f(unless)g(the)g Ft(pipefail)e Fu(option)i(is)g(enabled)g +(\(see)h(Section)g(4.3.1)h([The)150 628 y(Set)34 b(Builtin],)j(page)e +(58\).)53 b(If)34 b Ft(pipefail)e Fu(is)i(enabled,)h(the)g(pip)s +(eline's)f(return)f(status)h(is)h(the)f(v)-5 b(alue)35 +b(of)150 737 y(the)d(last)h(\(righ)m(tmost\))h(command)e(to)h(exit)g +(with)e(a)i(non-zero)f(status,)h(or)f(zero)h(if)f(all)h(commands)f +(exit)150 847 y(successfully)-8 b(.)67 b(If)38 b(the)h(reserv)m(ed)g(w) +m(ord)g(`)p Ft(!)p Fu(')g(precedes)g(the)g(pip)s(eline,)h(the)g(exit)f +(status)g(is)g(the)g(logical)150 956 y(negation)h(of)f(the)f(exit)i +(status)f(as)f(describ)s(ed)g(ab)s(o)m(v)m(e.)66 b(The)38 +b(shell)h(w)m(aits)h(for)e(all)h(commands)g(in)f(the)150 +1066 y(pip)s(eline)30 b(to)h(terminate)g(b)s(efore)f(returning)g(a)h(v) +-5 b(alue.)150 1262 y Fk(3.2.3)63 b(Lists)41 b(of)h(Commands)150 +1409 y Fu(A)37 b Ft(list)e Fu(is)i(a)g(sequence)g(of)g(one)g(or)f(more) +h(pip)s(elines)f(separated)h(b)m(y)g(one)g(of)f(the)h(op)s(erators)g(`) +p Ft(;)p Fu(',)i(`)p Ft(&)p Fu(',)150 1518 y(`)p Ft(&&)p +Fu(',)31 b(or)f(`)p Ft(||)p Fu(',)g(and)g(optionally)i(terminated)f(b)m +(y)f(one)h(of)f(`)p Ft(;)p Fu(',)h(`)p Ft(&)p Fu(',)g(or)f(a)h +Ft(newline)p Fu(.)275 1651 y(Of)23 b(these)h(list)g(op)s(erators,)i(`)p +Ft(&&)p Fu(')d(and)g(`)p Ft(||)p Fu(')h(ha)m(v)m(e)h(equal)f +(precedence,)i(follo)m(w)m(ed)f(b)m(y)f(`)p Ft(;)p Fu(')g(and)f(`)p +Ft(&)p Fu(',)i(whic)m(h)150 1761 y(ha)m(v)m(e)32 b(equal)e(precedence.) +275 1893 y(A)f(sequence)h(of)g(one)g(or)g(more)g(newlines)f(ma)m(y)h +(app)s(ear)f(in)h(a)g Ft(list)e Fu(to)j(delimit)f(commands,)g(equiv-) +150 2003 y(alen)m(t)i(to)f(a)g(semicolon.)275 2136 y(If)c(a)h(command)f +(is)h(terminated)g(b)m(y)g(the)g(con)m(trol)h(op)s(erator)f(`)p +Ft(&)p Fu(',)h(the)e(shell)h(executes)h(the)f(command)150 +2245 y(async)m(hronously)g(in)h(a)g(subshell.)39 b(This)28 +b(is)h(kno)m(wn)f(as)h(executing)h(the)f(command)g(in)f(the)h +Fr(bac)m(kground)p Fu(.)150 2355 y(The)f(shell)h(do)s(es)f(not)h(w)m +(ait)g(for)f(the)h(command)f(to)i(\014nish,)d(and)h(the)h(return)e +(status)i(is)g(0)g(\(true\).)40 b(When)150 2464 y(job)g(con)m(trol)h +(is)g(not)f(activ)m(e)i(\(see)f(Chapter)f(7)h([Job)f(Con)m(trol],)j +(page)e(97\),)j(the)d(standard)e(input)g(for)150 2574 +y(async)m(hronous)k(commands,)k(in)d(the)f(absence)i(of)f(an)m(y)g +(explicit)h(redirections,)j(is)43 b(redirected)h(from)150 +2684 y Ft(/dev/null)p Fu(.)275 2816 y(Commands)19 b(separated)j(b)m(y)f +(a)g(`)p Ft(;)p Fu(')g(are)h(executed)g(sequen)m(tially;)k(the)21 +b(shell)g(w)m(aits)h(for)f(eac)m(h)h(command)150 2926 +y(to)31 b(terminate)h(in)e(turn.)39 b(The)30 b(return)f(status)i(is)f +(the)h(exit)g(status)g(of)g(the)f(last)h(command)f(executed.)275 +3059 y Fm(and)g Fu(and)h Fm(or)g Fu(lists)h(are)g(sequences)f(of)h(one) +g(or)f(more)h(pip)s(elines)e(separated)i(b)m(y)g(the)f(con)m(trol)i(op) +s(er-)150 3168 y(ators)e(`)p Ft(&&)p Fu(')f(and)g(`)p +Ft(||)p Fu(',)h(resp)s(ectiv)m(ely)-8 b(.)42 b Fm(and)30 +b Fu(and)f Fm(or)h Fu(lists)h(are)g(executed)g(with)f(left)h(asso)s +(ciativit)m(y)-8 b(.)275 3301 y(An)30 b Fm(and)f Fu(list)i(has)f(the)h +(form)390 3434 y Fj(command1)46 b Ft(&&)h Fj(command2)150 +3566 y Fr(command2)38 b Fu(is)30 b(executed)i(if,)e(and)g(only)g(if,)h +Fr(command1)38 b Fu(returns)29 b(an)h(exit)h(status)g(of)g(zero.)275 +3699 y(An)f Fm(or)f Fu(list)i(has)f(the)h(form)390 3832 +y Fj(command1)46 b Ft(||)h Fj(command2)150 3965 y Fr(command2)38 +b Fu(is)30 b(executed)i(if,)e(and)g(only)g(if,)h Fr(command1)38 +b Fu(returns)29 b(a)i(non-zero)g(exit)g(status.)275 4097 +y(The)h(return)g(status)i(of)f Fm(and)f Fu(and)h Fm(or)f +Fu(lists)i(is)f(the)g(exit)h(status)g(of)f(the)g(last)h(command)f +(executed)150 4207 y(in)d(the)h(list.)150 4403 y Fk(3.2.4)63 +b(Comp)s(ound)42 b(Commands)150 4550 y Fu(Comp)s(ound)32 +b(commands)j(are)g(the)g(shell)g(programming)f(constructs.)54 +b(Eac)m(h)35 b(construct)g(b)s(egins)f(with)150 4659 +y(a)k(reserv)m(ed)f(w)m(ord)h(or)f(con)m(trol)i(op)s(erator)f(and)f(is) +g(terminated)h(b)m(y)f(a)h(corresp)s(onding)f(reserv)m(ed)g(w)m(ord)150 +4769 y(or)44 b(op)s(erator.)81 b(An)m(y)44 b(redirections)g(\(see)h +(Section)g(3.6)g([Redirections],)j(page)d(31\))g(asso)s(ciated)g(with) +150 4878 y(a)g(comp)s(ound)e(command)i(apply)f(to)h(all)h(commands)e +(within)g(that)h(comp)s(ound)e(command)i(unless)150 4988 +y(explicitly)32 b(o)m(v)m(erridden.)275 5121 y(In)20 +b(most)h(cases)g(a)g(list)h(of)f(commands)f(in)g(a)h(comp)s(ound)f +(command's)g(description)h(ma)m(y)g(b)s(e)f(separated)150 +5230 y(from)30 b(the)h(rest)g(of)g(the)g(command)g(b)m(y)f(one)h(or)g +(more)g(newlines,)g(and)f(ma)m(y)i(b)s(e)e(follo)m(w)m(ed)i(b)m(y)f(a)g +(newline)150 5340 y(in)f(place)h(of)g(a)g(semicolon.)p +eop end +%%Page: 10 16 +TeXDict begin 10 15 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(10)275 299 +y(Bash)45 b(pro)m(vides)h(lo)s(oping)g(constructs,)j(conditional)e +(commands,)j(and)44 b(mec)m(hanisms)i(to)g(group)150 +408 y(commands)30 b(and)g(execute)i(them)e(as)g(a)h(unit.)150 +609 y Fk(3.2.4.1)63 b(Lo)s(oping)43 b(Constructs)150 +756 y Fu(Bash)31 b(supp)s(orts)d(the)j(follo)m(wing)g(lo)s(oping)g +(constructs.)275 891 y(Note)k(that)f(wherev)m(er)g(a)g(`)p +Ft(;)p Fu(')g(app)s(ears)f(in)h(the)g(description)g(of)g(a)g(command's) +g(syn)m(tax,)i(it)e(ma)m(y)h(b)s(e)150 1001 y(replaced)c(with)f(one)h +(or)f(more)g(newlines.)150 1162 y Ft(until)240 b Fu(The)30 +b(syn)m(tax)h(of)f(the)h Ft(until)e Fu(command)h(is:)870 +1297 y Ft(until)46 b Fj(test-commands)p Ft(;)e(do)j Fj +(consequent-commands)p Ft(;)c(done)630 1432 y Fu(Execute)f +Fr(consequen)m(t-commands)k Fu(as)41 b(long)h(as)f Fr(test-commands)46 +b Fu(has)41 b(an)g(exit)h(status)630 1542 y(whic)m(h)c(is)h(not)g +(zero.)67 b(The)38 b(return)g(status)h(is)f(the)h(exit)h(status)f(of)g +(the)g(last)g(command)630 1651 y(executed)31 b(in)f Fr(consequen)m +(t-commands)p Fu(,)i(or)e(zero)h(if)g(none)f(w)m(as)h(executed.)150 +1812 y Ft(while)240 b Fu(The)30 b(syn)m(tax)h(of)f(the)h +Ft(while)e Fu(command)h(is:)870 1947 y Ft(while)46 b +Fj(test-commands)p Ft(;)e(do)j Fj(consequent-commands)p +Ft(;)c(done)630 2082 y Fu(Execute)f Fr(consequen)m(t-commands)k +Fu(as)41 b(long)h(as)f Fr(test-commands)46 b Fu(has)41 +b(an)g(exit)h(status)630 2192 y(of)34 b(zero.)53 b(The)34 +b(return)f(status)h(is)h(the)f(exit)h(status)g(of)f(the)g(last)h +(command)f(executed)h(in)630 2301 y Fr(consequen)m(t-commands)p +Fu(,)c(or)g(zero)g(if)f(none)g(w)m(as)h(executed.)150 +2462 y Ft(for)336 b Fu(The)30 b(syn)m(tax)h(of)f(the)h +Ft(for)e Fu(command)i(is:)870 2597 y Ft(for)47 b Fj(name)g +Ft([)g([in)g([)p Fj(words)f Ft(...)o(])i(])f(;)h(])f(do)g +Fj(commands)p Ft(;)e(done)630 2732 y Fu(Expand)31 b Fr(w)m(ords)p +Fu(,)j(and)e(execute)i Fr(commands)i Fu(once)d(for)g(eac)m(h)h(mem)m(b) +s(er)e(in)g(the)h(resultan)m(t)630 2841 y(list,)d(with)f +Fr(name)34 b Fu(b)s(ound)27 b(to)i(the)h(curren)m(t)e(mem)m(b)s(er.)40 +b(If)28 b(`)p Ft(in)i Fj(words)p Fu(')e(is)h(not)g(presen)m(t,)h(the) +630 2951 y Ft(for)f Fu(command)g(executes)i(the)e Fr(commands)k +Fu(once)d(for)f(eac)m(h)i(p)s(ositional)f(parameter)g(that)630 +3060 y(is)d(set,)h(as)f(if)g(`)p Ft(in)j("$@")p Fu(')c(had)g(b)s(een)g +(sp)s(eci\014ed)g(\(see)i(Section)f(3.4.2)i([Sp)s(ecial)e(P)m +(arameters],)630 3170 y(page)c(20\).)39 b(The)21 b(return)g(status)h +(is)g(the)g(exit)h(status)f(of)g(the)g(last)g(command)g(that)g +(executes.)630 3280 y(If)i(there)h(are)h(no)e(items)i(in)e(the)h +(expansion)g(of)g Fr(w)m(ords)p Fu(,)h(no)f(commands)f(are)h(executed,) +j(and)630 3389 y(the)j(return)e(status)i(is)f(zero.)630 +3524 y(An)g(alternate)i(form)e(of)h(the)f Ft(for)g Fu(command)g(is)g +(also)h(supp)s(orted:)870 3659 y Ft(for)47 b(\(\()g Fj(expr1)f +Ft(;)i Fj(expr2)e Ft(;)i Fj(expr3)e Ft(\)\))h(;)h(do)f +Fj(commands)e Ft(;)j(done)630 3794 y Fu(First,)38 b(the)f(arithmetic)h +(expression)e Fr(expr1)43 b Fu(is)36 b(ev)-5 b(aluated)38 +b(according)f(to)g(the)g(rules)f(de-)630 3904 y(scrib)s(ed)41 +b(b)s(elo)m(w)h(\(see)h(Section)g(6.5)g([Shell)g(Arithmetic],)j(page)d +(87\).)77 b(The)42 b(arithmetic)630 4014 y(expression)33 +b Fr(expr2)41 b Fu(is)34 b(then)f(ev)-5 b(aluated)35 +b(rep)s(eatedly)f(un)m(til)g(it)g(ev)-5 b(aluates)35 +b(to)g(zero.)51 b(Eac)m(h)630 4123 y(time)23 b Fr(expr2)30 +b Fu(ev)-5 b(aluates)25 b(to)e(a)g(non-zero)h(v)-5 b(alue,)25 +b Fr(commands)h Fu(are)d(executed)g(and)g(the)g(arith-)630 +4233 y(metic)29 b(expression)f Fr(expr3)36 b Fu(is)28 +b(ev)-5 b(aluated.)41 b(If)28 b(an)m(y)h(expression)f(is)g(omitted,)i +(it)f(b)s(eha)m(v)m(es)g(as)630 4342 y(if)i(it)h(ev)-5 +b(aluates)32 b(to)g(1.)44 b(The)30 b(return)g(v)-5 b(alue)32 +b(is)f(the)g(exit)h(status)g(of)f(the)g(last)h(command)f(in)630 +4452 y Fr(commands)j Fu(that)d(is)f(executed,)i(or)e(false)h(if)f(an)m +(y)h(of)g(the)f(expressions)g(is)h(in)m(v)-5 b(alid.)275 +4613 y(The)26 b Ft(break)g Fu(and)h Ft(continue)e Fu(builtins)i(\(see)h +(Section)h(4.1)f([Bourne)g(Shell)f(Builtins],)i(page)f(41\))g(ma)m(y) +150 4723 y(b)s(e)i(used)f(to)i(con)m(trol)h(lo)s(op)f(execution.)150 +4923 y Fk(3.2.4.2)63 b(Conditional)42 b(Constructs)150 +5095 y Ft(if)384 b Fu(The)30 b(syn)m(tax)h(of)f(the)h +Ft(if)f Fu(command)g(is:)870 5230 y Ft(if)47 b Fj(test-commands)p +Ft(;)d(then)965 5340 y Fj(consequent-commands)p Ft(;)p +eop end +%%Page: 11 17 +TeXDict begin 11 16 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(11)870 299 +y Ft([elif)46 b Fj(more-test-commands)p Ft(;)d(then)965 +408 y Fj(more-consequents)p Ft(;])870 518 y([else)j Fj +(alternate-consequents)p Ft(;])870 628 y(fi)630 757 y +Fu(The)53 b Fr(test-commands)58 b Fu(list)c(is)g(executed,)60 +b(and)53 b(if)g(its)h(return)e(status)i(is)f(zero,)61 +b(the)630 867 y Fr(consequen)m(t-commands)44 b Fu(list)d(is)f +(executed.)70 b(If)40 b Fr(test-commands)k Fu(returns)39 +b(a)h(non-zero)630 976 y(status,)45 b(eac)m(h)e Ft(elif)d +Fu(list)i(is)g(executed)h(in)e(turn,)j(and)d(if)g(its)h(exit)h(status)f +(is)f(zero,)46 b(the)630 1086 y(corresp)s(onding)37 b +Fr(more-consequen)m(ts)42 b Fu(is)c(executed)g(and)f(the)h(command)g +(completes.)63 b(If)630 1196 y(`)p Ft(else)29 b Fj +(alternate-consequents)p Fu(')c(is)30 b(presen)m(t,)h(and)f(the)g +(\014nal)g(command)g(in)g(the)g(\014nal)630 1305 y Ft(if)44 +b Fu(or)g Ft(elif)f Fu(clause)i(has)f(a)h(non-zero)g(exit)g(status,)j +(then)c Fr(alternate-consequen)m(ts)51 b Fu(is)630 1415 +y(executed.)k(The)34 b(return)g(status)h(is)f(the)h(exit)h(status)f(of) +g(the)g(last)g(command)g(executed,)630 1524 y(or)30 b(zero)i(if)e(no)g +(condition)h(tested)g(true.)150 1674 y Ft(case)288 b +Fu(The)30 b(syn)m(tax)h(of)f(the)h Ft(case)e Fu(command)h(is:)870 +1803 y Ft(case)47 b Fj(word)f Ft(in)h([)h([\(])f Fj(pattern)f +Ft([|)h Fj(pattern)p Ft(]...)m(\))g Fj(command-list)e +Ft(;;]...)h(esac)630 1933 y(case)20 b Fu(will)i(selectiv)m(ely)j +(execute)e(the)e Fr(command-list)k Fu(corresp)s(onding)20 +b(to)i(the)g(\014rst)f Fr(pattern)630 2042 y Fu(that)42 +b(matc)m(hes)g Fr(w)m(ord)p Fu(.)73 b(If)41 b(the)g(shell)g(option)h +Ft(nocasematch)c Fu(\(see)k(the)g(description)f(of)630 +2152 y Ft(shopt)34 b Fu(in)h(Section)h(4.3.2)h([The)e(Shopt)f +(Builtin],)k(page)e(62\))g(is)g(enabled,)g(the)g(matc)m(h)g(is)630 +2262 y(p)s(erformed)29 b(without)i(regard)g(to)g(the)g(case)h(of)f +(alphab)s(etic)g(c)m(haracters.)44 b(The)30 b(`)p Ft(|)p +Fu(')h(is)g(used)630 2371 y(to)e(separate)g(m)m(ultiple)g(patterns,)g +(and)e(the)i(`)p Ft(\))p Fu(')f(op)s(erator)g(terminates)h(a)g(pattern) +f(list.)41 b(A)630 2481 y(list)31 b(of)g(patterns)f(and)g(an)g(asso)s +(ciated)i(command-list)f(is)f(kno)m(wn)g(as)h(a)g Fr(clause)p +Fu(.)630 2610 y(Eac)m(h)42 b(clause)g(m)m(ust)f(b)s(e)g(terminated)h +(with)e(`)p Ft(;;)p Fu(',)45 b(`)p Ft(;&)p Fu(',)f(or)d(`)p +Ft(;;&)p Fu('.)73 b(The)41 b Fr(w)m(ord)j Fu(under-)630 +2720 y(go)s(es)35 b(tilde)f(expansion,)h(parameter)g(expansion,)g +(command)f(substitution,)h(arithmetic)630 2829 y(expansion,)47 +b(and)d(quote)g(remo)m(v)-5 b(al)45 b(b)s(efore)f(matc)m(hing)h(is)f +(attempted.)82 b(Eac)m(h)45 b Fr(pattern)630 2939 y Fu(undergo)s(es)38 +b(tilde)h(expansion,)i(parameter)e(expansion,)i(command)d +(substitution,)j(and)630 3049 y(arithmetic)32 b(expansion.)630 +3178 y(There)e(ma)m(y)g(b)s(e)f(an)h(arbitrary)g(n)m(um)m(b)s(er)f(of)h +Ft(case)f Fu(clauses,)i(eac)m(h)g(terminated)g(b)m(y)e(a)i(`)p +Ft(;;)p Fu(',)630 3288 y(`)p Ft(;&)p Fu(',)c(or)e(`)p +Ft(;;&)p Fu('.)39 b(The)25 b(\014rst)g(pattern)h(that)g(matc)m(hes)h +(determines)e(the)h(command-list)g(that)630 3397 y(is)35 +b(executed.)55 b(It's)35 b(a)g(common)g(idiom)g(to)g(use)g(`)p +Ft(*)p Fu(')g(as)g(the)g(\014nal)f(pattern)h(to)h(de\014ne)e(the)630 +3507 y(default)d(case,)g(since)g(that)g(pattern)f(will)h(alw)m(a)m(ys)h +(matc)m(h.)630 3636 y(Here)j(is)g(an)g(example)h(using)e +Ft(case)g Fu(in)g(a)h(script)g(that)h(could)f(b)s(e)f(used)g(to)h +(describ)s(e)g(one)630 3746 y(in)m(teresting)d(feature)f(of)f(an)g +(animal:)870 3875 y Ft(echo)47 b(-n)g("Enter)f(the)h(name)f(of)i(an)f +(animal:)f(")870 3985 y(read)h(ANIMAL)870 4095 y(echo)g(-n)g("The)f +($ANIMAL)g(has)h(")870 4204 y(case)g($ANIMAL)e(in)965 +4314 y(horse)i(|)g(dog)g(|)h(cat\))e(echo)h(-n)g("four";;)965 +4423 y(man)g(|)h(kangaroo)d(\))j(echo)e(-n)i("two";;)965 +4533 y(*\))g(echo)e(-n)h("an)g(unknown)f(number)g(of";;)870 +4643 y(esac)870 4752 y(echo)h(")g(legs.")630 4902 y Fu(If)25 +b(the)h(`)p Ft(;;)p Fu(')g(op)s(erator)g(is)g(used,)g(no)g(subsequen)m +(t)f(matc)m(hes)i(are)f(attempted)h(after)g(the)f(\014rst)630 +5011 y(pattern)g(matc)m(h.)40 b(Using)26 b(`)p Ft(;&)p +Fu(')f(in)h(place)g(of)g(`)p Ft(;;)p Fu(')g(causes)g(execution)h(to)f +(con)m(tin)m(ue)h(with)f(the)630 5121 y Fr(command-list)39 +b Fu(asso)s(ciated)f(with)e(the)g(next)g(clause,)j(if)d(an)m(y)-8 +b(.)59 b(Using)37 b(`)p Ft(;;&)p Fu(')f(in)g(place)h(of)630 +5230 y(`)p Ft(;;)p Fu(')30 b(causes)g(the)g(shell)g(to)g(test)h(the)f +(patterns)g(in)f(the)h(next)g(clause,)h(if)e(an)m(y)-8 +b(,)31 b(and)f(execute)630 5340 y(an)m(y)h(asso)s(ciated)h +Fr(command-list)h Fu(on)d(a)h(successful)f(matc)m(h.)p +eop end +%%Page: 12 18 +TeXDict begin 12 17 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(12)630 299 +y(The)26 b(return)f(status)h(is)g(zero)h(if)f(no)g Fr(pattern)g +Fu(is)g(matc)m(hed.)40 b(Otherwise,)27 b(the)g(return)e(status)630 +408 y(is)30 b(the)h(exit)g(status)g(of)f(the)h Fr(command-list)i +Fu(executed.)150 564 y Ft(select)630 697 y Fu(The)g Ft(select)f +Fu(construct)i(allo)m(ws)h(the)f(easy)g(generation)h(of)e(men)m(us.)50 +b(It)34 b(has)f(almost)i(the)630 806 y(same)c(syn)m(tax)g(as)f(the)h +Ft(for)e Fu(command:)870 939 y Ft(select)46 b Fj(name)h +Ft([in)g Fj(words)f Ft(...)o(];)h(do)h Fj(commands)p +Ft(;)d(done)630 1072 y Fu(The)25 b(list)h(of)f(w)m(ords)g(follo)m(wing) +i Ft(in)d Fu(is)h(expanded,)h(generating)h(a)e(list)h(of)g(items.)39 +b(The)25 b(set)h(of)630 1181 y(expanded)i(w)m(ords)h(is)g(prin)m(ted)f +(on)h(the)g(standard)f(error)h(output)f(stream,)i(eac)m(h)g(preceded) +630 1291 y(b)m(y)21 b(a)g(n)m(um)m(b)s(er.)37 b(If)20 +b(the)i(`)p Ft(in)30 b Fj(words)p Fu(')20 b(is)h(omitted,)j(the)d(p)s +(ositional)h(parameters)g(are)f(prin)m(ted,)630 1401 +y(as)28 b(if)f(`)p Ft(in)j("$@")p Fu(')d(had)f(b)s(een)h(sp)s +(eci\014ed.)39 b(The)27 b Ft(PS3)g Fu(prompt)f(is)i(then)f(displa)m(y)m +(ed)h(and)f(a)h(line)630 1510 y(is)h(read)f(from)h(the)f(standard)g +(input.)39 b(If)29 b(the)g(line)g(consists)g(of)g(a)g(n)m(um)m(b)s(er)e +(corresp)s(onding)630 1620 y(to)36 b(one)f(of)h(the)f(displa)m(y)m(ed)h +(w)m(ords,)g(then)f(the)g(v)-5 b(alue)36 b(of)f Fr(name)40 +b Fu(is)35 b(set)h(to)g(that)g(w)m(ord.)54 b(If)630 1729 +y(the)37 b(line)h(is)f(empt)m(y)-8 b(,)39 b(the)e(w)m(ords)g(and)f +(prompt)g(are)i(displa)m(y)m(ed)f(again.)62 b(If)37 b +Ft(EOF)f Fu(is)h(read,)630 1839 y(the)c Ft(select)e Fu(command)i +(completes.)50 b(An)m(y)33 b(other)g(v)-5 b(alue)33 b(read)g(causes)g +Fr(name)38 b Fu(to)c(b)s(e)e(set)630 1948 y(to)f(n)m(ull.)41 +b(The)30 b(line)g(read)h(is)f(sa)m(v)m(ed)h(in)g(the)f(v)-5 +b(ariable)31 b Ft(REPLY)p Fu(.)630 2081 y(The)42 b Fr(commands)j +Fu(are)d(executed)h(after)g(eac)m(h)g(selection)h(un)m(til)e(a)h +Ft(break)d Fu(command)i(is)630 2191 y(executed,)32 b(at)f(whic)m(h)f(p) +s(oin)m(t)g(the)h Ft(select)d Fu(command)i(completes.)630 +2323 y(Here)39 b(is)g(an)g(example)h(that)f(allo)m(ws)i(the)e(user)f +(to)i(pic)m(k)f(a)g(\014lename)h(from)e(the)h(curren)m(t)630 +2433 y(directory)-8 b(,)32 b(and)d(displa)m(ys)i(the)f(name)h(and)f +(index)f(of)i(the)g(\014le)f(selected.)870 2566 y Ft(select)46 +b(fname)g(in)i(*;)870 2675 y(do)870 2785 y(echo)f(you)g(picked)f +($fname)g(\\\($REPLY\\\))870 2894 y(break;)870 3004 y(done)150 +3160 y(\(\(...)o(\)\))870 3292 y(\(\()h Fj(expression)e +Ft(\)\))630 3425 y Fu(The)33 b(arithmetic)i Fr(expression)f +Fu(is)f(ev)-5 b(aluated)35 b(according)g(to)f(the)g(rules)f(describ)s +(ed)g(b)s(elo)m(w)630 3535 y(\(see)j(Section)f(6.5)h([Shell)f +(Arithmetic],)i(page)f(87\).)55 b(If)34 b(the)h(v)-5 +b(alue)35 b(of)g(the)g(expression)g(is)630 3644 y(non-zero,)27 +b(the)f(return)e(status)i(is)g(0;)h(otherwise)f(the)g(return)e(status)i +(is)g(1.)39 b(This)25 b(is)g(exactly)630 3754 y(equiv)-5 +b(alen)m(t)32 b(to)870 3886 y Ft(let)47 b(")p Fj(expression)p +Ft(")630 4019 y Fu(See)25 b(Section)h(4.2)h([Bash)e(Builtins],)i(page)f +(48,)i(for)c(a)i(full)f(description)g(of)g(the)h Ft(let)e +Fu(builtin.)150 4175 y Ft([[...)o(]])870 4308 y([[)47 +b Fj(expression)e Ft(]])630 4440 y Fu(Return)25 b(a)h(status)f(of)h(0)g +(or)g(1)g(dep)s(ending)e(on)h(the)h(ev)-5 b(aluation)27 +b(of)e(the)h(conditional)h(expres-)630 4550 y(sion)j +Fr(expression)p Fu(.)41 b(Expressions)29 b(are)i(comp)s(osed)f(of)g +(the)h(primaries)f(describ)s(ed)f(b)s(elo)m(w)h(in)630 +4659 y(Section)36 b(6.4)h([Bash)f(Conditional)g(Expressions],)h(page)f +(85.)57 b(W)-8 b(ord)36 b(splitting)h(and)e(\014le-)630 +4769 y(name)d(expansion)g(are)h(not)g(p)s(erformed)d(on)j(the)f(w)m +(ords)g(b)s(et)m(w)m(een)h(the)f Ft([[)g Fu(and)f Ft(]])p +Fu(;)i(tilde)630 4879 y(expansion,)e(parameter)g(and)f(v)-5 +b(ariable)31 b(expansion,)g(arithmetic)g(expansion,)g(command)630 +4988 y(substitution,)40 b(pro)s(cess)f(substitution,)h(and)e(quote)h +(remo)m(v)-5 b(al)40 b(are)f(p)s(erformed.)63 b(Condi-)630 +5098 y(tional)32 b(op)s(erators)e(suc)m(h)g(as)h(`)p +Ft(-f)p Fu(')f(m)m(ust)g(b)s(e)g(unquoted)g(to)h(b)s(e)e(recognized)j +(as)f(primaries.)630 5230 y(When)k(used)f(with)h Ft([[)p +Fu(,)h(the)f(`)p Ft(<)p Fu(')g(and)g(`)p Ft(>)p Fu(')g(op)s(erators)g +(sort)g(lexicographically)j(using)d(the)630 5340 y(curren)m(t)30 +b(lo)s(cale.)p eop end +%%Page: 13 19 +TeXDict begin 13 18 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(13)630 299 +y(When)22 b(the)h(`)p Ft(==)p Fu(')f(and)g(`)p Ft(!=)p +Fu(')g(op)s(erators)h(are)g(used,)g(the)g(string)f(to)i(the)e(righ)m(t) +h(of)g(the)g(op)s(erator)630 408 y(is)31 b(considered)g(a)h(pattern)f +(and)g(matc)m(hed)h(according)g(to)g(the)g(rules)f(describ)s(ed)f(b)s +(elo)m(w)h(in)630 518 y(Section)d(3.5.8.1)h([P)m(attern)f(Matc)m +(hing],)h(page)f(30,)g(as)f(if)g(the)g Ft(extglob)d Fu(shell)j(option)g +(w)m(ere)630 628 y(enabled.)46 b(The)31 b(`)p Ft(=)p +Fu(')h(op)s(erator)h(is)f(iden)m(tical)h(to)g(`)p Ft(==)p +Fu('.)46 b(If)31 b(the)h(shell)h(option)f Ft(nocasematch)630 +737 y Fu(\(see)42 b(the)f(description)g(of)h Ft(shopt)d +Fu(in)i(Section)h(4.3.2)h([The)e(Shopt)f(Builtin],)45 +b(page)d(62\))630 847 y(is)e(enabled,)i(the)e(matc)m(h)h(is)e(p)s +(erformed)g(without)g(regard)h(to)h(the)f(case)g(of)g(alphab)s(etic)630 +956 y(c)m(haracters.)h(The)28 b(return)e(v)-5 b(alue)28 +b(is)g(0)g(if)g(the)g(string)g(matc)m(hes)h(\(`)p Ft(==)p +Fu('\))f(or)g(do)s(es)f(not)h(matc)m(h)630 1066 y(\(`)p +Ft(!=)p Fu('\)the)33 b(pattern,)g(and)f(1)g(otherwise.)47 +b(An)m(y)32 b(part)g(of)h(the)f(pattern)g(ma)m(y)h(b)s(e)f(quoted)g(to) +630 1176 y(force)f(the)g(quoted)f(p)s(ortion)g(to)h(b)s(e)f(matc)m(hed) +h(as)g(a)f(string.)630 1316 y(An)j(additional)i(binary)e(op)s(erator,)i +(`)p Ft(=~)p Fu(',)g(is)f(a)m(v)-5 b(ailable,)37 b(with)c(the)h(same)g +(precedence)h(as)630 1426 y(`)p Ft(==)p Fu(')29 b(and)f(`)p +Ft(!=)p Fu('.)40 b(When)29 b(it)g(is)g(used,)f(the)h(string)g(to)h(the) +e(righ)m(t)i(of)f(the)g(op)s(erator)g(is)g(consid-)630 +1536 y(ered)34 b(an)g(extended)g(regular)g(expression)g(and)f(matc)m +(hed)i(accordingly)g(\(as)f(in)g Fl(r)-5 b(e)g(gex)11 +b Fu(3\)\).)630 1645 y(The)29 b(return)f(v)-5 b(alue)30 +b(is)g(0)g(if)f(the)h(string)g(matc)m(hes)g(the)g(pattern,)g(and)f(1)h +(otherwise.)41 b(If)29 b(the)630 1755 y(regular)e(expression)g(is)h +(syn)m(tactically)i(incorrect,)f(the)e(conditional)i(expression's)e +(return)630 1864 y(v)-5 b(alue)40 b(is)g(2.)68 b(If)39 +b(the)h(shell)f(option)h Ft(nocasematch)d Fu(\(see)j(the)g(description) +g(of)f Ft(shopt)f Fu(in)630 1974 y(Section)32 b(4.3.2)g([The)f(Shopt)f +(Builtin],)i(page)g(62\))g(is)f(enabled,)g(the)g(matc)m(h)h(is)e(p)s +(erformed)630 2084 y(without)36 b(regard)g(to)h(the)f(case)h(of)f +(alphab)s(etic)h(c)m(haracters.)59 b(An)m(y)36 b(part)g(of)h(the)f +(pattern)630 2193 y(ma)m(y)31 b(b)s(e)f(quoted)h(to)g(force)g(the)g +(quoted)g(p)s(ortion)f(to)h(b)s(e)f(matc)m(hed)h(as)g(a)g(string.)41 +b(Brac)m(k)m(et)630 2303 y(expressions)27 b(in)f(regular)i(expressions) +e(m)m(ust)h(b)s(e)g(treated)h(carefully)-8 b(,)29 b(since)e(normal)g +(quot-)630 2412 y(ing)38 b(c)m(haracters)h(lose)f(their)g(meanings)f(b) +s(et)m(w)m(een)h(brac)m(k)m(ets.)64 b(If)37 b(the)h(pattern)f(is)h +(stored)630 2522 y(in)33 b(a)i(shell)f(v)-5 b(ariable,)35 +b(quoting)f(the)g(v)-5 b(ariable)35 b(expansion)e(forces)i(the)f(en)m +(tire)g(pattern)g(to)630 2632 y(b)s(e)h(matc)m(hed)i(as)f(a)g(string.) +56 b(Substrings)34 b(matc)m(hed)j(b)m(y)f(paren)m(thesized)g(sub)s +(expressions)630 2741 y(within)k(the)g(regular)g(expression)g(are)g(sa) +m(v)m(ed)i(in)d(the)i(arra)m(y)f(v)-5 b(ariable)41 b +Ft(BASH_REMATCH)p Fu(.)630 2851 y(The)30 b(elemen)m(t)i(of)e +Ft(BASH_REMATCH)d Fu(with)j(index)g(0)h(is)g(the)f(p)s(ortion)g(of)h +(the)f(string)h(matc)m(h-)630 2960 y(ing)j(the)g(en)m(tire)g(regular)g +(expression.)50 b(The)34 b(elemen)m(t)h(of)f Ft(BASH_REMATCH)c +Fu(with)j(index)g Fr(n)630 3070 y Fu(is)d(the)h(p)s(ortion)f(of)g(the)h +(string)f(matc)m(hing)i(the)e Fr(n)p Fu(th)g(paren)m(thesized)h(sub)s +(expression.)630 3211 y(F)-8 b(or)28 b(example,)h(the)e(follo)m(wing)i +(will)e(matc)m(h)h(a)g(line)f(\(stored)h(in)e(the)i(shell)f(v)-5 +b(ariable)28 b Fr(line)5 b Fu(\))28 b(if)630 3320 y(there)22 +b(is)g(a)h(sequence)f(of)h(c)m(haracters)g(in)f(the)g(v)-5 +b(alue)23 b(consisting)g(of)f(an)m(y)h(n)m(um)m(b)s(er,)f(including)630 +3430 y(zero,)31 b(of)g(space)g(c)m(haracters,)h(zero)f(or)g(one)f +(instances)h(of)g(`)p Ft(a)p Fu(',)f(then)g(a)h(`)p Ft(b)p +Fu(':)870 3571 y Ft([[)47 b($line)g(=~)g([[:space:]]*\(a\)?b)c(]])630 +3712 y Fu(That)24 b(means)g(v)-5 b(alues)24 b(lik)m(e)h(`)p +Ft(aab)p Fu(')e(and)h(`)30 b Ft(aaaaaab)p Fu(')22 b(will)i(matc)m(h,)j +(as)d(will)g(a)g(line)g(con)m(taining)630 3821 y(a)31 +b(`)p Ft(b)p Fu(')f(an)m(ywhere)h(in)f(its)g(v)-5 b(alue.)630 +3962 y(Storing)31 b(the)g(regular)g(expression)f(in)h(a)g(shell)g(v)-5 +b(ariable)31 b(is)g(often)g(a)g(useful)f(w)m(a)m(y)i(to)f(a)m(v)m(oid) +630 4072 y(problems)f(with)g(quoting)h(c)m(haracters)i(that)e(are)g(sp) +s(ecial)g(to)h(the)f(shell.)41 b(It)31 b(is)g(sometimes)630 +4181 y(di\016cult)24 b(to)h(sp)s(ecify)f(a)h(regular)g(expression)f +(literally)i(without)f(using)e(quotes,)k(or)d(to)h(k)m(eep)630 +4291 y(trac)m(k)33 b(of)g(the)f(quoting)g(used)g(b)m(y)g(regular)g +(expressions)g(while)g(pa)m(ying)h(atten)m(tion)h(to)f(the)630 +4401 y(shell's)25 b(quote)g(remo)m(v)-5 b(al.)40 b(Using)25 +b(a)g(shell)g(v)-5 b(ariable)26 b(to)f(store)g(the)g(pattern)g +(decreases)g(these)630 4510 y(problems.)40 b(F)-8 b(or)31 +b(example,)g(the)g(follo)m(wing)h(is)e(equiv)-5 b(alen)m(t)32 +b(to)f(the)g(ab)s(o)m(v)m(e:)870 4651 y Ft(pattern='[[:space:]]*\(a\))o +(?b')870 4761 y([[)47 b($line)g(=~)g($pattern)e(]])630 +4902 y Fu(If)28 b(y)m(ou)h(w)m(an)m(t)g(to)g(matc)m(h)h(a)e(c)m +(haracter)j(that's)e(sp)s(ecial)g(to)g(the)g(regular)f(expression)g +(gram-)630 5011 y(mar,)g(it)g(has)g(to)g(b)s(e)f(quoted)h(to)g(remo)m +(v)m(e)h(its)f(sp)s(ecial)g(meaning.)40 b(This)27 b(means)g(that)h(in)g +(the)630 5121 y(pattern)e(`)p Ft(xxx.txt)p Fu(',)g(the)h(`)p +Ft(.)p Fu(')f(matc)m(hes)i(an)m(y)e(c)m(haracter)i(in)e(the)h(string)f +(\(its)h(usual)f(regular)630 5230 y(expression)g(meaning\),)i(but)e(in) +g(the)h(pattern)f(`)p Ft("xxx.txt")p Fu(')f(it)i(can)g(only)f(matc)m(h) +i(a)e(literal)630 5340 y(`)p Ft(.)p Fu('.)56 b(Shell)35 +b(programmers)f(should)h(tak)m(e)i(sp)s(ecial)e(care)i(with)e(bac)m +(kslashes,)i(since)f(bac)m(k-)p eop end +%%Page: 14 20 +TeXDict begin 14 19 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(14)630 299 +y(slashes)27 b(are)g(used)f(b)s(oth)g(b)m(y)h(the)f(shell)h(and)f +(regular)h(expressions)g(to)g(remo)m(v)m(e)h(the)f(sp)s(ecial)630 +408 y(meaning)h(from)f(the)h(follo)m(wing)i(c)m(haracter.)41 +b(The)27 b(follo)m(wing)j(t)m(w)m(o)f(sets)f(of)g(commands)g(are)630 +518 y Fl(not)40 b Fu(equiv)-5 b(alen)m(t:)870 655 y Ft(pattern='\\.') +870 874 y([[)47 b(.)h(=~)f($pattern)e(]])870 984 y([[)i(.)h(=~)f(\\.)g +(]])870 1203 y([[)g(.)h(=~)f("$pattern")e(]])870 1313 +y([[)i(.)h(=~)f('\\.')f(]])630 1450 y Fu(The)28 b(\014rst)h(t)m(w)m(o)h +(matc)m(hes)g(will)f(succeed,)h(but)f(the)g(second)g(t)m(w)m(o)h(will)f +(not,)h(b)s(ecause)f(in)g(the)630 1559 y(second)39 b(t)m(w)m(o)i(the)e +(bac)m(kslash)h(will)f(b)s(e)g(part)g(of)g(the)h(pattern)f(to)h(b)s(e)e +(matc)m(hed.)68 b(In)39 b(the)630 1669 y(\014rst)31 b(t)m(w)m(o)h +(examples,)h(the)e(bac)m(kslash)h(remo)m(v)m(es)h(the)f(sp)s(ecial)g +(meaning)f(from)g(`)p Ft(.)p Fu(',)h(so)g(the)630 1779 +y(literal)f(`)p Ft(.)p Fu(')e(matc)m(hes.)42 b(If)28 +b(the)i(string)f(in)g(the)g(\014rst)g(examples)g(w)m(ere)h(an)m(ything) +g(other)f(than)630 1888 y(`)p Ft(.)p Fu(',)g(sa)m(y)g(`)p +Ft(a)p Fu(',)g(the)f(pattern)g(w)m(ould)g(not)h(matc)m(h,)h(b)s(ecause) +e(the)g(quoted)g(`)p Ft(.)p Fu(')h(in)e(the)i(pattern)630 +1998 y(loses)i(its)g(sp)s(ecial)g(meaning)f(of)h(matc)m(hing)g(an)m(y)g +(single)g(c)m(haracter.)630 2135 y(Expressions)23 b(ma)m(y)h(b)s(e)e +(com)m(bined)i(using)f(the)h(follo)m(wing)h(op)s(erators,)g(listed)f +(in)f(decreasing)630 2244 y(order)30 b(of)g(precedence:)630 +2409 y Ft(\()g Fj(expression)e Ft(\))1110 2519 y Fu(Returns)i(the)h(v) +-5 b(alue)31 b(of)g Fr(expression)p Fu(.)42 b(This)30 +b(ma)m(y)i(b)s(e)e(used)g(to)i(o)m(v)m(erride)g(the)1110 +2628 y(normal)e(precedence)h(of)g(op)s(erators.)630 2793 +y Ft(!)f Fj(expression)1110 2902 y Fu(T)-8 b(rue)30 b(if)g +Fr(expression)g Fu(is)h(false.)630 3067 y Fj(expression1)c +Ft(&&)j Fj(expression2)1110 3177 y Fu(T)-8 b(rue)30 b(if)g(b)s(oth)g +Fr(expression1)38 b Fu(and)29 b Fr(expression2)38 b Fu(are)31 +b(true.)630 3341 y Fj(expression1)c Ft(||)j Fj(expression2)1110 +3451 y Fu(T)-8 b(rue)30 b(if)g(either)h Fr(expression1)38 +b Fu(or)30 b Fr(expression2)38 b Fu(is)30 b(true.)630 +3615 y(The)24 b Ft(&&)h Fu(and)f Ft(||)g Fu(op)s(erators)h(do)g(not)g +(ev)-5 b(aluate)27 b Fr(expression2)32 b Fu(if)25 b(the)g(v)-5 +b(alue)25 b(of)g Fr(expression1)630 3725 y Fu(is)30 b(su\016cien)m(t)h +(to)g(determine)g(the)f(return)g(v)-5 b(alue)31 b(of)f(the)h(en)m(tire) +g(conditional)h(expression.)150 3929 y Fk(3.2.4.3)63 +b(Grouping)43 b(Commands)150 4076 y Fu(Bash)30 b(pro)m(vides)g(t)m(w)m +(o)h(w)m(a)m(ys)f(to)h(group)e(a)h(list)g(of)g(commands)f(to)i(b)s(e)e +(executed)h(as)g(a)h(unit.)40 b(When)29 b(com-)150 4186 +y(mands)h(are)i(group)s(ed,)f(redirections)h(ma)m(y)g(b)s(e)e(applied)i +(to)g(the)f(en)m(tire)h(command)g(list.)44 b(F)-8 b(or)32 +b(example,)150 4296 y(the)f(output)f(of)g(all)h(the)g(commands)f(in)g +(the)h(list)g(ma)m(y)g(b)s(e)e(redirected)i(to)g(a)g(single)g(stream.) +150 4463 y Ft(\(\))870 4600 y(\()47 b Fj(list)g Ft(\))630 +4737 y Fu(Placing)30 b(a)f(list)g(of)g(commands)f(b)s(et)m(w)m(een)i +(paren)m(theses)e(causes)i(a)f(subshell)e(en)m(vironmen)m(t)630 +4847 y(to)k(b)s(e)e(created)j(\(see)f(Section)g(3.7.3)h([Command)d +(Execution)i(En)m(vironmen)m(t],)g(page)f(36\),)630 4956 +y(and)d(eac)m(h)h(of)g(the)f(commands)g(in)g Fr(list)j +Fu(to)f(b)s(e)d(executed)j(in)e(that)h(subshell.)38 b(Since)28 +b(the)f Fr(list)630 5066 y Fu(is)i(executed)g(in)f(a)h(subshell,)g(v)-5 +b(ariable)29 b(assignmen)m(ts)g(do)g(not)g(remain)f(in)g(e\013ect)j +(after)e(the)630 5175 y(subshell)g(completes.)150 5340 +y Ft({})p eop end +%%Page: 15 21 +TeXDict begin 15 20 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(15)870 299 +y Ft({)47 b Fj(list)p Ft(;)g(})630 434 y Fu(Placing)30 +b(a)g(list)g(of)g(commands)f(b)s(et)m(w)m(een)h(curly)f(braces)g +(causes)h(the)f(list)h(to)g(b)s(e)f(executed)630 544 +y(in)d(the)h(curren)m(t)g(shell)f(con)m(text.)42 b(No)27 +b(subshell)f(is)g(created.)41 b(The)26 b(semicolon)i(\(or)f(newline\)) +630 653 y(follo)m(wing)32 b Fr(list)h Fu(is)d(required.)275 +815 y(In)44 b(addition)h(to)h(the)f(creation)i(of)e(a)g(subshell,)j +(there)e(is)f(a)g(subtle)g(di\013erence)h(b)s(et)m(w)m(een)f(these)150 +925 y(t)m(w)m(o)c(constructs)e(due)g(to)g(historical)i(reasons.)67 +b(The)39 b(braces)g(are)h Ft(reserved)28 b(words)p Fu(,)40 +b(so)g(they)f(m)m(ust)150 1034 y(b)s(e)d(separated)h(from)f(the)g +Fr(list)j Fu(b)m(y)e Ft(blank)p Fu(s)e(or)h(other)h(shell)f(metac)m +(haracters.)62 b(The)36 b(paren)m(theses)h(are)150 1144 +y Ft(operators)p Fu(,)23 b(and)h(are)g(recognized)i(as)e(separate)i +(tok)m(ens)f(b)m(y)f(the)g(shell)h(ev)m(en)g(if)f(they)g(are)h(not)f +(separated)150 1254 y(from)30 b(the)g Fr(list)j Fu(b)m(y)e(whitespace.) +275 1390 y(The)e(exit)j(status)e(of)h(b)s(oth)f(of)g(these)h +(constructs)g(is)f(the)h(exit)g(status)f(of)h Fr(list)p +Fu(.)150 1591 y Fk(3.2.5)63 b(Copro)s(cesses)150 1738 +y Fu(A)37 b Ft(coprocess)c Fu(is)k(a)g(shell)f(command)h(preceded)f(b)m +(y)g(the)h Ft(coproc)d Fu(reserv)m(ed)j(w)m(ord.)59 b(A)36 +b(copro)s(cess)h(is)150 1847 y(executed)g(async)m(hronously)g(in)f(a)h +(subshell,)g(as)g(if)g(the)f(command)h(had)f(b)s(een)f(terminated)i +(with)g(the)150 1957 y(`)p Ft(&)p Fu(')d(con)m(trol)h(op)s(erator,)g +(with)f(a)g(t)m(w)m(o-w)m(a)m(y)i(pip)s(e)d(established)h(b)s(et)m(w)m +(een)h(the)f(executing)h(shell)f(and)f(the)150 2066 y(copro)s(cess.)275 +2203 y(The)c(format)i(for)f(a)h(copro)s(cess)g(is:)390 +2339 y Ft(coproc)46 b([)p Fj(NAME)p Ft(])g Fj(command)g +Ft([)p Fj(redirections)p Ft(])150 2475 y Fu(This)39 b(creates)j(a)e +(copro)s(cess)h(named)f Fr(NAME)p Fu(.)70 b(If)40 b Fr(NAME)46 +b Fu(is)40 b(not)g(supplied,)i(the)e(default)h(name)f(is)150 +2584 y Fr(COPR)m(OC)p Fu(.)d Fr(NAME)28 b Fu(m)m(ust)23 +b(not)g(b)s(e)e(supplied)h(if)g Fr(command)k Fu(is)d(a)g(simple)f +(command)g(\(see)i(Section)f(3.2.1)150 2694 y([Simple)39 +b(Commands],)h(page)g(8\);)k(otherwise,)e(it)d(is)g(in)m(terpreted)h +(as)f(the)g(\014rst)f(w)m(ord)h(of)g(the)g(simple)150 +2804 y(command.)275 2940 y(When)j(the)i(copro)s(cess)f(is)g(executed,) +48 b(the)43 b(shell)g(creates)i(an)e(arra)m(y)g(v)-5 +b(ariable)44 b(\(see)g(Section)g(6.7)150 3049 y([Arra)m(ys],)32 +b(page)g(89\))h(named)e Ft(NAME)f Fu(in)h(the)h(con)m(text)h(of)e(the)h +(executing)g(shell.)44 b(The)31 b(standard)f(output)150 +3159 y(of)g Fr(command)j Fu(is)d(connected)g(via)g(a)g(pip)s(e)f(to)i +(a)f(\014le)g(descriptor)f(in)g(the)h(executing)h(shell,)f(and)g(that)g +(\014le)150 3269 y(descriptor)i(is)f(assigned)h(to)g +Ft(NAME)p Fu([0].)45 b(The)31 b(standard)g(input)f(of)i +Fr(command)j Fu(is)d(connected)h(via)f(a)g(pip)s(e)150 +3378 y(to)39 b(a)g(\014le)f(descriptor)g(in)g(the)g(executing)i(shell,) +g(and)e(that)h(\014le)f(descriptor)g(is)g(assigned)h(to)g +Ft(NAME)p Fu([1].)150 3488 y(This)31 b(pip)s(e)g(is)h(established)g(b)s +(efore)g(an)m(y)g(redirections)g(sp)s(eci\014ed)g(b)m(y)f(the)i +(command)e(\(see)i(Section)g(3.6)150 3597 y([Redirections],)25 +b(page)e(31\).)39 b(The)21 b(\014le)h(descriptors)g(can)g(b)s(e)f +(utilized)i(as)f(argumen)m(ts)h(to)f(shell)g(commands)150 +3707 y(and)33 b(redirections)g(using)g(standard)f(w)m(ord)h +(expansions.)49 b(The)33 b(\014le)g(descriptors)g(are)g(not)h(a)m(v)-5 +b(ailable)35 b(in)150 3817 y(subshells.)275 3953 y(The)27 +b(pro)s(cess)h(ID)h(of)f(the)h(shell)f(spa)m(wned)g(to)h(execute)h(the) +e(copro)s(cess)h(is)f(a)m(v)-5 b(ailable)31 b(as)d(the)h(v)-5 +b(alue)29 b(of)150 4062 y(the)k(v)-5 b(ariable)33 b Ft(NAME)p +850 4062 28 4 v 39 w Fu(PID.)g(The)f Ft(wait)f Fu(builtin)h(command)g +(ma)m(y)h(b)s(e)f(used)g(to)h(w)m(ait)h(for)e(the)h(copro)s(cess)150 +4172 y(to)e(terminate.)275 4308 y(Since)20 b(the)g(copro)s(cess)h(is)g +(created)g(as)g(an)f(async)m(hronous)g(command,)i(the)f +Ft(coproc)d Fu(command)i(alw)m(a)m(ys)150 4418 y(returns)29 +b(success.)41 b(The)30 b(return)f(status)i(of)f(a)h(copro)s(cess)g(is)f +(the)h(exit)g(status)g(of)f Fr(command)p Fu(.)150 4619 +y Fk(3.2.6)63 b(GNU)41 b(P)m(arallel)150 4765 y Fu(There)30 +b(are)h(w)m(a)m(ys)g(to)g(run)f(commands)g(in)g(parallel)h(that)h(are)e +(not)h(built)g(in)m(to)g(Bash.)41 b(GNU)31 b(P)m(arallel)i(is)150 +4875 y(a)e(to)s(ol)g(to)g(do)f(just)g(that.)275 5011 +y(GNU)e(P)m(arallel,)i(as)e(its)g(name)f(suggests,)j(can)d(b)s(e)g +(used)g(to)h(build)f(and)g(run)f(commands)h(in)h(parallel.)150 +5121 y(Y)-8 b(ou)41 b(ma)m(y)g(run)e(the)h(same)h(command)f(with)g +(di\013eren)m(t)h(argumen)m(ts,)j(whether)39 b(they)i(are)g +(\014lenames,)150 5230 y(usernames,)27 b(hostnames,)h(or)e(lines)h +(read)f(from)h(\014les.)39 b(GNU)27 b(P)m(arallel)i(pro)m(vides)d +(shorthand)g(references)150 5340 y(to)38 b(man)m(y)g(of)g(the)g(most)g +(common)g(op)s(erations)g(\(input)f(lines,)j(v)-5 b(arious)38 +b(p)s(ortions)f(of)h(the)g(input)e(line,)p eop end +%%Page: 16 22 +TeXDict begin 16 21 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(16)150 299 +y(di\013eren)m(t)35 b(w)m(a)m(ys)h(to)f(sp)s(ecify)f(the)h(input)f +(source,)i(and)e(so)h(on\).)54 b(P)m(arallel)36 b(can)f(replace)h +Ft(xargs)d Fu(or)i(feed)150 408 y(commands)30 b(from)g(its)h(input)e +(sources)h(to)i(sev)m(eral)f(di\013eren)m(t)g(instances)g(of)g(Bash.) +275 553 y(F)-8 b(or)33 b(a)g(complete)h(description,)g(refer)e(to)i +(the)f(GNU)g(P)m(arallel)i(do)s(cumen)m(tation.)48 b(A)33 +b(few)f(examples)150 663 y(should)d(pro)m(vide)i(a)g(brief)e(in)m(tro)s +(duction)i(to)g(its)g(use.)275 807 y(F)-8 b(or)37 b(example,)i(it)e(is) +f(easy)h(to)g(replace)h Ft(xargs)d Fu(to)i(gzip)g(all)g(h)m(tml)g +(\014les)f(in)h(the)f(curren)m(t)g(directory)150 917 +y(and)30 b(its)h(sub)s(directories:)390 1061 y Ft(find)47 +b(.)g(-type)f(f)i(-name)e('*.html')g(-print)g(|)h(parallel)f(gzip)150 +1205 y Fu(If)30 b(y)m(ou)h(need)f(to)h(protect)h(sp)s(ecial)f(c)m +(haracters)g(suc)m(h)g(as)f(newlines)h(in)f(\014le)g(names,)h(use)f +(\014nd's)f Ft(-print0)150 1315 y Fu(option)i(and)f(parallel's)h +Ft(-0)f Fu(option.)275 1460 y(Y)-8 b(ou)34 b(can)g(use)f(P)m(arallel)j +(to)e(mo)m(v)m(e)h(\014les)f(from)f(the)h(curren)m(t)f(directory)h +(when)f(the)h(n)m(um)m(b)s(er)e(of)i(\014les)150 1569 +y(is)c(to)s(o)i(large)f(to)g(pro)s(cess)f(with)g(one)h +Ft(mv)f Fu(in)m(v)m(o)s(cation:)390 1714 y Ft(ls)47 b(|)h(parallel)d +(mv)i({})h(destdir)275 1858 y Fu(As)28 b(y)m(ou)h(can)g(see,)g(the)g +Fi({})g Fu(is)g(replaced)g(with)f(eac)m(h)i(line)f(read)f(from)g +(standard)g(input.)39 b(While)29 b(using)150 1968 y Ft(ls)g +Fu(will)h(w)m(ork)g(in)f(most)h(instances,)h(it)f(is)g(not)g +(su\016cien)m(t)g(to)h(deal)f(with)f(all)i(\014lenames.)40 +b(If)30 b(y)m(ou)g(need)f(to)150 2077 y(accommo)s(date)j(sp)s(ecial)f +(c)m(haracters)h(in)e(\014lenames,)h(y)m(ou)f(can)h(use)390 +2222 y Ft(find)47 b(.)g(-depth)f(1)i(\\!)f(-name)f('.*')h(-print0)f(|)h +(parallel)f(-0)h(mv)g({})g(destdir)150 2366 y Fu(as)31 +b(alluded)f(to)h(ab)s(o)m(v)m(e.)275 2511 y(This)e(will)i(run)e(as)h +(man)m(y)h Ft(mv)e Fu(commands)h(as)h(there)f(are)h(\014les)f(in)h(the) +f(curren)m(t)g(directory)-8 b(.)42 b(Y)-8 b(ou)31 b(can)150 +2620 y(em)m(ulate)h(a)f(parallel)g Ft(xargs)e Fu(b)m(y)h(adding)g(the)h +Ft(-X)f Fu(option:)390 2765 y Ft(find)47 b(.)g(-depth)f(1)i(\\!)f +(-name)f('.*')h(-print0)f(|)h(parallel)f(-0)h(-X)g(mv)g({})g(destdir) +275 2909 y Fu(GNU)31 b(P)m(arallel)i(can)e(replace)h(certain)g(common)g +(idioms)f(that)g(op)s(erate)h(on)f(lines)g(read)g(from)f(a)i(\014le)150 +3019 y(\(in)e(this)h(case,)g(\014lenames)g(listed)g(one)f(p)s(er)g +(line\):)390 3163 y Ft(while)46 b(IFS=)h(read)g(-r)g(x;)g(do)390 +3273 y(do-something1)d("$x")j("config-$x")390 3382 y(do-something2)d(<) +k("$x")390 3492 y(done)f(<)g(file)g(|)g(process-output)150 +3636 y Fu(with)30 b(a)h(more)f(compact)i(syn)m(tax)f(reminiscen)m(t)g +(of)g(lam)m(b)s(das:)390 3781 y Ft(cat)47 b(list)g(|)g(parallel)f +("do-something1)d({})48 b(config-{})d(;)i(do-something2)e(<)i({}")g(|)g +(process-output)275 3925 y Fu(P)m(arallel)31 b(pro)m(vides)e(a)h +(built-in)g(mec)m(hanism)g(to)g(remo)m(v)m(e)h(\014lename)e +(extensions,)i(whic)m(h)e(lends)g(itself)150 4035 y(to)i(batc)m(h)g +(\014le)g(transformations)f(or)g(renaming:)390 4179 y +Ft(ls)47 b(*.gz)g(|)g(parallel)f(-j+0)g("zcat)h({})g(|)g(bzip2)g +(>{.}.bz2)e(&&)j(rm)f({}")150 4324 y Fu(This)28 b(will)i(recompress)e +(all)i(\014les)f(in)g(the)g(curren)m(t)g(directory)g(with)g(names)g +(ending)f(in)h(.gz)h(using)f(bzip2,)150 4433 y(running)37 +b(one)i(job)f(p)s(er)f(CPU)h(\(-j)p Ft(+)p Fu(0\))i(in)e(parallel.)66 +b(\(W)-8 b(e)40 b(use)e Ft(ls)g Fu(for)h(brevit)m(y)g(here;)j(using)c +Ft(find)g Fu(as)150 4543 y(ab)s(o)m(v)m(e)e(is)g(more)f(robust)f(in)h +(the)h(face)g(of)f(\014lenames)h(con)m(taining)g(unexp)s(ected)f(c)m +(haracters.\))57 b(P)m(arallel)150 4653 y(can)31 b(tak)m(e)h(argumen)m +(ts)e(from)g(the)h(command)f(line;)h(the)f(ab)s(o)m(v)m(e)i(can)f(also) +g(b)s(e)f(written)g(as)390 4797 y Ft(parallel)46 b("zcat)g({})h(|)h +(bzip2)e(>{.}.bz2)f(&&)j(rm)f({}")g(:::)g(*.gz)275 4941 +y Fu(If)24 b(a)i(command)f(generates)h(output,)g(y)m(ou)g(ma)m(y)f(w)m +(an)m(t)h(to)g(preserv)m(e)g(the)f(input)f(order)h(in)g(the)g(output.) +150 5051 y(F)-8 b(or)31 b(instance,)g(the)g(follo)m(wing)h(command)390 +5196 y Ft({)47 b(echo)g(foss.org.my)e(;)i(echo)g(debian.org;)e(echo)h +(freenetproject.org;)d(})k(|)h(parallel)d(traceroute)150 +5340 y Fu(will)31 b(displa)m(y)f(as)h(output)f(the)g(traceroute)i(in)m +(v)m(o)s(cation)h(that)e(\014nishes)e(\014rst.)40 b(Adding)30 +b(the)g Ft(-k)g Fu(option)p eop end +%%Page: 17 23 +TeXDict begin 17 22 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(17)390 299 +y Ft({)47 b(echo)g(foss.org.my)e(;)i(echo)g(debian.org;)e(echo)h +(freenetproject.org;)d(})k(|)h(parallel)d(-k)i(traceroute)150 +430 y Fu(will)31 b(ensure)e(that)i(the)g(output)f(of)g +Ft(traceroute)e(foss.org.my)f Fu(is)k(displa)m(y)m(ed)g(\014rst.)275 +560 y(Finally)-8 b(,)31 b(P)m(arallel)h(can)e(b)s(e)f(used)g(to)i(run)d +(a)i(sequence)h(of)f(shell)g(commands)f(in)h(parallel,)h(similar)f(to) +150 670 y(`)p Ft(cat)g(file)f(|)h(bash)p Fu('.)53 b(It)35 +b(is)g(not)g(uncommon)f(to)i(tak)m(e)g(a)f(list)h(of)f(\014lenames,)h +(create)g(a)g(series)f(of)g(shell)150 779 y(commands)27 +b(to)h(op)s(erate)h(on)e(them,)h(and)f(feed)h(that)g(list)g(of)g +(commnds)e(to)j(a)f(shell.)40 b(P)m(arallel)29 b(can)f(sp)s(eed)150 +889 y(this)i(up.)40 b(Assuming)30 b(that)h Ft(file)e +Fu(con)m(tains)i(a)g(list)g(of)g(shell)f(commands,)h(one)f(p)s(er)g +(line,)390 1020 y Ft(parallel)46 b(-j)h(10)g(<)g(file)150 +1150 y Fu(will)37 b(ev)-5 b(aluate)38 b(the)f(commands)f(using)g(the)h +(shell)g(\(since)g(no)f(explicit)i(command)e(is)h(supplied)e(as)i(an) +150 1260 y(argumen)m(t\),)31 b(in)f(blo)s(c)m(ks)h(of)g(ten)f(shell)h +(jobs)f(at)h(a)g(time.)150 1484 y Fs(3.3)68 b(Shell)45 +b(F)-11 b(unctions)150 1644 y Fu(Shell)35 b(functions)h(are)g(a)g(w)m +(a)m(y)g(to)h(group)e(commands)g(for)h(later)g(execution)h(using)e(a)h +(single)g(name)g(for)150 1753 y(the)f(group.)55 b(They)35 +b(are)g(executed)h(just)f(lik)m(e)h(a)g Ft(")p Fu(regular)p +Ft(")f Fu(command.)54 b(When)35 b(the)h(name)f(of)g(a)h(shell)150 +1863 y(function)j(is)g(used)f(as)h(a)h(simple)f(command)g(name,)i(the)e +(list)h(of)f(commands)g(asso)s(ciated)i(with)d(that)150 +1973 y(function)25 b(name)h(is)g(executed.)40 b(Shell)25 +b(functions)g(are)i(executed)f(in)f(the)h(curren)m(t)g(shell)g(con)m +(text;)j(no)c(new)150 2082 y(pro)s(cess)30 b(is)g(created)i(to)f(in)m +(terpret)g(them.)275 2213 y(F)-8 b(unctions)30 b(are)h(declared)g +(using)f(this)g(syn)m(tax:)390 2343 y Fj(name)47 b Ft(\(\))g +Fj(compound-command)c Ft([)48 b Fj(redirections)c Ft(])275 +2474 y Fu(or)390 2605 y Ft(function)i Fj(name)g Ft([\(\)])h +Fj(compound-command)c Ft([)48 b Fj(redirections)c Ft(])275 +2735 y Fu(This)31 b(de\014nes)h(a)h(shell)g(function)g(named)f +Fr(name)p Fu(.)48 b(The)32 b(reserv)m(ed)h(w)m(ord)f +Ft(function)f Fu(is)h(optional.)49 b(If)150 2845 y(the)39 +b Ft(function)f Fu(reserv)m(ed)h(w)m(ord)g(is)g(supplied,)i(the)e +(paren)m(theses)h(are)f(optional.)69 b(The)39 b Fr(b)s(o)s(dy)45 +b Fu(of)40 b(the)150 2954 y(function)h(is)h(the)g(comp)s(ound)e +(command)h Fr(comp)s(ound-command)j Fu(\(see)e(Section)h(3.2.4)g([Comp) +s(ound)150 3064 y(Commands],)33 b(page)h(9\).)49 b(That)33 +b(command)f(is)h(usually)g(a)g Fr(list)j Fu(enclosed)e(b)s(et)m(w)m +(een)f Fi({)h Fu(and)e Fi(})p Fu(,)i(but)e(ma)m(y)150 +3174 y(b)s(e)26 b(an)m(y)i(comp)s(ound)d(command)i(listed)h(ab)s(o)m(v) +m(e.)41 b Fr(comp)s(ound-command)29 b Fu(is)e(executed)h(whenev)m(er)f +Fr(name)150 3283 y Fu(is)k(sp)s(eci\014ed)f(as)g(the)h(name)g(of)g(a)g +(command.)41 b(When)31 b(the)f(shell)h(is)g(in)f Fm(posix)g +Fu(mo)s(de)g(\(see)i(Section)f(6.11)150 3393 y([Bash)36 +b(POSIX)f(Mo)s(de],)j(page)e(94\),)j Fr(name)i Fu(ma)m(y)36 +b(not)h(b)s(e)e(the)h(same)g(as)g(one)g(of)g(the)g(sp)s(ecial)h +(builtins)150 3502 y(\(see)24 b(Section)g(4.4)g([Sp)s(ecial)g +(Builtins],)h(page)f(68\).)40 b(An)m(y)23 b(redirections)h(\(see)g +(Section)g(3.6)g([Redirections],)150 3612 y(page)31 b(31\))h(asso)s +(ciated)g(with)e(the)g(shell)h(function)f(are)h(p)s(erformed)d(when)i +(the)g(function)g(is)h(executed.)275 3743 y(A)44 b(function)g +(de\014nition)h(ma)m(y)g(b)s(e)f(deleted)h(using)f(the)h +Ft(-f)f Fu(option)h(to)g(the)g Ft(unset)e Fu(builtin)h(\(see)150 +3852 y(Section)31 b(4.1)h([Bourne)e(Shell)g(Builtins],)h(page)h(41\).) +275 3983 y(The)26 b(exit)i(status)g(of)f(a)h(function)f(de\014nition)g +(is)g(zero)h(unless)f(a)g(syn)m(tax)h(error)f(o)s(ccurs)g(or)g(a)h +(readonly)150 4092 y(function)k(with)f(the)i(same)f(name)g(already)h +(exists.)46 b(When)32 b(executed,)h(the)f(exit)h(status)g(of)f(a)g +(function)150 4202 y(is)e(the)h(exit)g(status)g(of)f(the)h(last)g +(command)f(executed)i(in)e(the)g(b)s(o)s(dy)-8 b(.)275 +4333 y(Note)22 b(that)f(for)f(historical)i(reasons,)h(in)e(the)g(most)g +(common)g(usage)g(the)g(curly)f(braces)h(that)g(surround)150 +4442 y(the)38 b(b)s(o)s(dy)d(of)j(the)f(function)g(m)m(ust)g(b)s(e)g +(separated)h(from)f(the)g(b)s(o)s(dy)f(b)m(y)h Ft(blank)p +Fu(s)f(or)h(newlines.)62 b(This)150 4552 y(is)38 b(b)s(ecause)g(the)h +(braces)f(are)h(reserv)m(ed)f(w)m(ords)g(and)f(are)i(only)f(recognized) +i(as)e(suc)m(h)g(when)f(they)i(are)150 4661 y(separated)26 +b(from)f(the)h(command)f(list)i(b)m(y)e(whitespace)h(or)g(another)g +(shell)g(metac)m(haracter.)41 b(Also,)28 b(when)150 4771 +y(using)i(the)g(braces,)h(the)g Fr(list)i Fu(m)m(ust)d(b)s(e)g +(terminated)h(b)m(y)f(a)h(semicolon,)h(a)e(`)p Ft(&)p +Fu(',)h(or)g(a)f(newline.)275 4902 y(When)i(a)i(function)f(is)g +(executed,)i(the)e(argumen)m(ts)h(to)g(the)f(function)g(b)s(ecome)g +(the)h(p)s(ositional)g(pa-)150 5011 y(rameters)42 b(during)e(its)i +(execution)h(\(see)f(Section)g(3.4.1)h([P)m(ositional)h(P)m +(arameters],)i(page)c(19\).)75 b(The)150 5121 y(sp)s(ecial)37 +b(parameter)f(`)p Ft(#)p Fu(')g(that)h(expands)e(to)i(the)f(n)m(um)m(b) +s(er)f(of)h(p)s(ositional)h(parameters)f(is)g(up)s(dated)f(to)150 +5230 y(re\015ect)h(the)f(c)m(hange.)56 b(Sp)s(ecial)35 +b(parameter)h Ft(0)f Fu(is)g(unc)m(hanged.)54 b(The)35 +b(\014rst)f(elemen)m(t)j(of)e(the)g Ft(FUNCNAME)150 5340 +y Fu(v)-5 b(ariable)31 b(is)g(set)f(to)i(the)e(name)h(of)f(the)h +(function)f(while)g(the)h(function)f(is)g(executing.)p +eop end +%%Page: 18 24 +TeXDict begin 18 23 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(18)275 299 +y(All)25 b(other)g(asp)s(ects)g(of)g(the)g(shell)g(execution)h(en)m +(vironmen)m(t)g(are)f(iden)m(tical)h(b)s(et)m(w)m(een)g(a)f(function)g +(and)150 408 y(its)35 b(caller)i(with)d(these)i(exceptions:)50 +b(the)36 b Ft(DEBUG)d Fu(and)h Ft(RETURN)g Fu(traps)g(are)i(not)f +(inherited)f(unless)h(the)150 518 y(function)26 b(has)g(b)s(een)f(giv)m +(en)i(the)g Ft(trace)d Fu(attribute)j(using)f(the)g Ft(declare)e +Fu(builtin)i(or)g(the)h Ft(-o)i(functrace)150 628 y Fu(option)f(has)e +(b)s(een)h(enabled)g(with)g(the)g Ft(set)f Fu(builtin,)i(\(in)f(whic)m +(h)f(case)j(all)f(functions)e(inherit)h(the)g Ft(DEBUG)150 +737 y Fu(and)33 b Ft(RETURN)f Fu(traps\),)j(and)e(the)h +Ft(ERR)f Fu(trap)h(is)g(not)g(inherited)f(unless)g(the)h +Ft(-o)c(errtrace)h Fu(shell)j(option)150 847 y(has)h(b)s(een)f +(enabled.)55 b(See)35 b(Section)h(4.1)g([Bourne)f(Shell)g(Builtins],)i +(page)f(41,)i(for)c(the)i(description)f(of)150 956 y(the)c +Ft(trap)e Fu(builtin.)275 1095 y(The)38 b Ft(FUNCNEST)f +Fu(v)-5 b(ariable,)42 b(if)d(set)h(to)g(a)g(n)m(umeric)f(v)-5 +b(alue)39 b(greater)h(than)f(0,)j(de\014nes)d(a)g(maxim)m(um)150 +1204 y(function)24 b(nesting)h(lev)m(el.)40 b(F)-8 b(unction)25 +b(in)m(v)m(o)s(cations)i(that)e(exceed)g(the)g(limit)g(cause)g(the)g +(en)m(tire)g(command)150 1314 y(to)31 b(ab)s(ort.)275 +1452 y(If)37 b(the)g(builtin)g(command)h Ft(return)d +Fu(is)j(executed)g(in)g(a)g(function,)h(the)e(function)h(completes)h +(and)150 1562 y(execution)25 b(resumes)e(with)h(the)g(next)g(command)f +(after)i(the)f(function)f(call.)40 b(An)m(y)24 b(command)f(asso)s +(ciated)150 1672 y(with)36 b(the)h Ft(RETURN)d Fu(trap)i(is)h(executed) +g(b)s(efore)f(execution)i(resumes.)57 b(When)37 b(a)f(function)g +(completes,)150 1781 y(the)h(v)-5 b(alues)38 b(of)f(the)g(p)s +(ositional)h(parameters)f(and)g(the)g(sp)s(ecial)h(parameter)f(`)p +Ft(#)p Fu(')g(are)h(restored)f(to)h(the)150 1891 y(v)-5 +b(alues)26 b(they)f(had)g(prior)f(to)i(the)g(function's)f(execution.)40 +b(If)25 b(a)h(n)m(umeric)f(argumen)m(t)h(is)f(giv)m(en)h(to)g +Ft(return)p Fu(,)150 2000 y(that)j(is)g(the)f(function's)h(return)e +(status;)j(otherwise)f(the)f(function's)h(return)e(status)i(is)f(the)h +(exit)h(status)150 2110 y(of)h(the)f(last)h(command)f(executed)i(b)s +(efore)e(the)g Ft(return)p Fu(.)275 2248 y(V)-8 b(ariables)31 +b(lo)s(cal)g(to)f(the)g(function)f(ma)m(y)i(b)s(e)e(declared)h(with)f +(the)h Ft(local)f Fu(builtin.)40 b(These)29 b(v)-5 b(ariables)150 +2358 y(are)31 b(visible)g(only)f(to)h(the)g(function)f(and)g(the)g +(commands)g(it)h(in)m(v)m(ok)m(es.)275 2497 y(F)-8 b(unction)51 +b(names)f(and)g(de\014nitions)g(ma)m(y)i(b)s(e)e(listed)h(with)f(the)h +Ft(-f)f Fu(option)h(to)g(the)g Ft(declare)150 2606 y +Fu(\()p Ft(typeset)p Fu(\))35 b(builtin)g(command)h(\(see)h(Section)g +(4.2)g([Bash)f(Builtins],)i(page)f(48\).)59 b(The)35 +b Ft(-F)h Fu(option)g(to)150 2716 y Ft(declare)e Fu(or)i +Ft(typeset)e Fu(will)i(list)h(the)f(function)g(names)g(only)g(\(and)g +(optionally)h(the)f(source)g(\014le)h(and)150 2825 y(line)c(n)m(um)m(b) +s(er,)g(if)f(the)h Ft(extdebug)e Fu(shell)i(option)g(is)g(enabled\).)49 +b(F)-8 b(unctions)33 b(ma)m(y)h(b)s(e)e(exp)s(orted)g(so)h(that)150 +2935 y(subshells)j(automatically)k(ha)m(v)m(e)f(them)e(de\014ned)f +(with)h(the)h Ft(-f)e Fu(option)i(to)g(the)g Ft(export)d +Fu(builtin)i(\(see)150 3044 y(Section)c(4.1)g([Bourne)f(Shell)g +(Builtins],)i(page)f(41\).)47 b(Note)33 b(that)g(shell)f(functions)g +(and)f(v)-5 b(ariables)33 b(with)150 3154 y(the)d(same)g(name)g(ma)m(y) +g(result)g(in)g(m)m(ultiple)g(iden)m(tically-named)i(en)m(tries)f(in)e +(the)h(en)m(vironmen)m(t)g(passed)150 3264 y(to)h(the)g(shell's)f(c)m +(hildren.)41 b(Care)30 b(should)g(b)s(e)f(tak)m(en)j(in)e(cases)h +(where)f(this)g(ma)m(y)h(cause)g(a)g(problem.)275 3402 +y(F)-8 b(unctions)33 b(ma)m(y)g(b)s(e)g(recursiv)m(e.)48 +b(The)32 b Ft(FUNCNEST)f Fu(v)-5 b(ariable)34 b(ma)m(y)f(b)s(e)f(used)g +(to)i(limit)g(the)f(depth)f(of)150 3512 y(the)27 b(function)f(call)i +(stac)m(k)h(and)d(restrict)h(the)g(n)m(um)m(b)s(er)f(of)h(function)f +(in)m(v)m(o)s(cations.)42 b(By)27 b(default,)g(no)g(limit)150 +3621 y(is)j(placed)h(on)g(the)f(n)m(um)m(b)s(er)f(of)i(recursiv)m(e)f +(calls.)150 3860 y Fs(3.4)68 b(Shell)45 b(P)l(arameters)150 +4019 y Fu(A)23 b Fr(parameter)31 b Fu(is)23 b(an)g(en)m(tit)m(y)i(that) +f(stores)g(v)-5 b(alues.)39 b(It)23 b(can)h(b)s(e)f(a)g +Ft(name)p Fu(,)h(a)g(n)m(um)m(b)s(er,)f(or)h(one)f(of)h(the)f(sp)s +(ecial)150 4129 y(c)m(haracters)i(listed)e(b)s(elo)m(w.)39 +b(A)23 b Fr(v)-5 b(ariable)30 b Fu(is)23 b(a)g(parameter)h(denoted)f(b) +m(y)h(a)f Ft(name)p Fu(.)37 b(A)24 b(v)-5 b(ariable)24 +b(has)f(a)g Fr(v)-5 b(alue)150 4238 y Fu(and)33 b(zero)i(or)f(more)g +Fr(attributes)p Fu(.)52 b(A)m(ttributes)35 b(are)f(assigned)g(using)g +(the)g Ft(declare)e Fu(builtin)h(command)150 4348 y(\(see)e(the)g +(description)f(of)h(the)f Ft(declare)f Fu(builtin)h(in)g(Section)h(4.2) +g([Bash)g(Builtins],)g(page)g(48\).)275 4486 y(A)d(parameter)h(is)g +(set)g(if)f(it)h(has)f(b)s(een)g(assigned)h(a)g(v)-5 +b(alue.)40 b(The)28 b(n)m(ull)h(string)f(is)h(a)g(v)-5 +b(alid)28 b(v)-5 b(alue.)41 b(Once)150 4596 y(a)31 b(v)-5 +b(ariable)31 b(is)f(set,)i(it)e(ma)m(y)h(b)s(e)f(unset)g(only)h(b)m(y)f +(using)g(the)g Ft(unset)f Fu(builtin)h(command.)275 4734 +y(A)g(v)-5 b(ariable)31 b(ma)m(y)g(b)s(e)f(assigned)g(to)i(b)m(y)e(a)h +(statemen)m(t)h(of)e(the)h(form)390 4873 y Fj(name)p +Ft(=[)p Fj(value)p Ft(])150 5011 y Fu(If)j Fr(v)-5 b(alue)40 +b Fu(is)35 b(not)g(giv)m(en,)h(the)f(v)-5 b(ariable)35 +b(is)g(assigned)g(the)f(n)m(ull)h(string.)53 b(All)35 +b Fr(v)-5 b(alue)5 b Fu(s)35 b(undergo)f(tilde)h(ex-)150 +5121 y(pansion,)h(parameter)f(and)f(v)-5 b(ariable)36 +b(expansion,)f(command)g(substitution,)h(arithmetic)g(expansion,)150 +5230 y(and)k(quote)h(remo)m(v)-5 b(al)42 b(\(detailed)h(b)s(elo)m(w\).) +72 b(If)40 b(the)h(v)-5 b(ariable)41 b(has)g(its)g Ft(integer)e +Fu(attribute)i(set,)j(then)150 5340 y Fr(v)-5 b(alue)38 +b Fu(is)33 b(ev)-5 b(aluated)34 b(as)f(an)g(arithmetic)h(expression)f +(ev)m(en)h(if)e(the)h Ft($\(\(...)o(\)\))f Fu(expansion)h(is)g(not)g +(used)p eop end +%%Page: 19 25 +TeXDict begin 19 24 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(19)150 299 +y(\(see)31 b(Section)g(3.5.5)i([Arithmetic)e(Expansion],)f(page)h +(29\).)42 b(W)-8 b(ord)31 b(splitting)g(is)g(not)f(p)s(erformed,)f +(with)150 408 y(the)35 b(exception)h(of)f Ft("$@")f Fu(as)h(explained)g +(b)s(elo)m(w.)54 b(Filename)36 b(expansion)f(is)g(not)g(p)s(erformed.) +53 b(Assign-)150 518 y(men)m(t)33 b(statemen)m(ts)h(ma)m(y)f(also)g +(app)s(ear)f(as)g(argumen)m(ts)h(to)g(the)g Ft(alias)p +Fu(,)e Ft(declare)p Fu(,)g Ft(typeset)p Fu(,)g Ft(export)p +Fu(,)150 628 y Ft(readonly)p Fu(,)41 b(and)f Ft(local)f +Fu(builtin)h(commands.)71 b(When)40 b(in)h Fm(posix)e +Fu(mo)s(de)i(\(see)g(Section)g(6.11)i([Bash)150 737 y(POSIX)36 +b(Mo)s(de],)k(page)e(94\),)i(these)e(builtins)f(ma)m(y)h(app)s(ear)e +(in)h(a)h(command)f(after)h(one)f(or)h(more)f(in-)150 +847 y(stances)31 b(of)g(the)f Ft(command)f Fu(builtin)h(and)f(retain)i +(these)g(assignmen)m(t)g(statemen)m(t)h(prop)s(erties.)275 +994 y(In)d(the)h(con)m(text)i(where)d(an)h(assignmen)m(t)h(statemen)m +(t)h(is)e(assigning)g(a)h(v)-5 b(alue)30 b(to)h(a)f(shell)g(v)-5 +b(ariable)31 b(or)150 1104 y(arra)m(y)f(index)g(\(see)h(Section)g(6.7)g +([Arra)m(ys],)g(page)g(89\),)g(the)f(`)p Ft(+=)p Fu(')g(op)s(erator)g +(can)h(b)s(e)e(used)g(to)i(app)s(end)d(to)150 1213 y(or)36 +b(add)g(to)h(the)f(v)-5 b(ariable's)37 b(previous)f(v)-5 +b(alue.)59 b(When)36 b(`)p Ft(+=)p Fu(')g(is)g(applied)g(to)h(a)g(v)-5 +b(ariable)37 b(for)f(whic)m(h)g(the)150 1323 y Fr(in)m(teger)46 +b Fu(attribute)38 b(has)f(b)s(een)g(set,)k Fr(v)-5 b(alue)43 +b Fu(is)38 b(ev)-5 b(aluated)39 b(as)f(an)f(arithmetic)i(expression)f +(and)f(added)150 1433 y(to)f(the)f(v)-5 b(ariable's)36 +b(curren)m(t)f(v)-5 b(alue,)37 b(whic)m(h)e(is)g(also)h(ev)-5 +b(aluated.)56 b(When)35 b(`)p Ft(+=)p Fu(')g(is)h(applied)f(to)g(an)g +(arra)m(y)150 1542 y(v)-5 b(ariable)26 b(using)e(comp)s(ound)f +(assignmen)m(t)j(\(see)f(Section)h(6.7)f([Arra)m(ys],)i(page)f(89\),)h +(the)e(v)-5 b(ariable's)25 b(v)-5 b(alue)150 1652 y(is)32 +b(not)f(unset)h(\(as)g(it)g(is)f(when)g(using)g(`)p Ft(=)p +Fu('\),)i(and)e(new)g(v)-5 b(alues)32 b(are)g(app)s(ended)d(to)k(the)f +(arra)m(y)g(b)s(eginning)150 1761 y(at)27 b(one)f(greater)i(than)e(the) +g(arra)m(y's)h(maxim)m(um)f(index)g(\(for)g(indexed)g(arra)m(ys\),)i +(or)e(added)g(as)g(additional)150 1871 y(k)m(ey-v)-5 +b(alue)35 b(pairs)e(in)g(an)g(asso)s(ciativ)m(e)j(arra)m(y)-8 +b(.)51 b(When)33 b(applied)g(to)h(a)g(string-v)-5 b(alued)34 +b(v)-5 b(ariable,)35 b Fr(v)-5 b(alue)39 b Fu(is)150 +1980 y(expanded)30 b(and)f(app)s(ended)g(to)i(the)g(v)-5 +b(ariable's)31 b(v)-5 b(alue.)275 2128 y(A)41 b(v)-5 +b(ariable)42 b(can)f(b)s(e)f(assigned)i(the)f Fr(nameref)58 +b Fu(attribute)42 b(using)f(the)g Ft(-n)f Fu(option)i(to)g(the)f +Ft(\\)p Fu(fBde-)150 2237 y(clare)p Ft(\\)p Fu(fP)j(or)f +Ft(\\)p Fu(fBlo)s(cal)p Ft(\\)p Fu(fP)h(builtin)e(commands)h(\(see)h +(Section)h(4.2)f([Bash)g(Builtins],)j(page)d(48\))g(to)150 +2347 y(create)37 b(a)e Fr(nameref)p Fu(,)h(or)f(a)h(reference)f(to)h +(another)g(v)-5 b(ariable.)55 b(This)34 b(allo)m(ws)j(v)-5 +b(ariables)35 b(to)h(b)s(e)f(manipu-)150 2457 y(lated)c(indirectly)-8 +b(.)43 b(Whenev)m(er)31 b(the)g(nameref)f(v)-5 b(ariable)32 +b(is)e(referenced)h(or)f(assigned)h(to,)h(the)e(op)s(eration)150 +2566 y(is)i(actually)h(p)s(erformed)d(on)i(the)g(v)-5 +b(ariable)33 b(sp)s(eci\014ed)e(b)m(y)g(the)h(nameref)g(v)-5 +b(ariable's)33 b(v)-5 b(alue.)45 b(A)32 b(nameref)150 +2676 y(is)h(commonly)g(used)e(within)h(shell)h(functions)f(to)h(refer)f +(to)i(a)f(v)-5 b(ariable)33 b(whose)f(name)h(is)f(passed)g(as)h(an)150 +2785 y(argumen)m(t)g(to)g(the)g(function.)46 b(F)-8 b(or)33 +b(instance,)h(if)e(a)h(v)-5 b(ariable)33 b(name)g(is)f(passed)g(to)h(a) +g(shell)g(function)f(as)150 2895 y(its)f(\014rst)e(argumen)m(t,)i +(running)390 3042 y Ft(declare)46 b(-n)h(ref=$1)150 3190 +y Fu(inside)31 b(the)h(function)f(creates)i(a)g(nameref)e(v)-5 +b(ariable)32 b Fr(ref)49 b Fu(whose)32 b(v)-5 b(alue)32 +b(is)g(the)f(v)-5 b(ariable)33 b(name)e(passed)150 3299 +y(as)42 b(the)g(\014rst)f(argumen)m(t.)74 b(References)43 +b(and)e(assignmen)m(ts)h(to)g Fr(ref)59 b Fu(are)42 b(treated)h(as)f +(references)g(and)150 3409 y(assignmen)m(ts)31 b(to)g(the)g(v)-5 +b(ariable)31 b(whose)f(name)g(w)m(as)h(passed)f(as)h +Ft($1)p Fu(.)275 3556 y(If)38 b(the)i(con)m(trol)g(v)-5 +b(ariable)40 b(in)f(a)g Ft(for)g Fu(lo)s(op)g(has)g(the)g(nameref)g +(attribute,)k(the)c(list)h(of)f(w)m(ords)g(can)150 3666 +y(b)s(e)c(a)i(list)f(of)g(shell)h(v)-5 b(ariables,)38 +b(and)d(a)h(name)g(reference)h(will)f(b)s(e)f(established)i(for)e(eac)m +(h)j(w)m(ord)d(in)h(the)150 3775 y(list,)e(in)e(turn,)g(when)f(the)i +(lo)s(op)f(is)h(executed.)47 b(Arra)m(y)33 b(v)-5 b(ariables)33 +b(cannot)g(b)s(e)e(giv)m(en)j(the)e Ft(-n)g Fu(attribute.)150 +3885 y(Ho)m(w)m(ev)m(er,)39 b(nameref)d(v)-5 b(ariables)36 +b(can)g(reference)g(arra)m(y)g(v)-5 b(ariables)37 b(and)e(subscripted)f +(arra)m(y)i(v)-5 b(ariables.)150 3995 y(Namerefs)36 b(can)f(b)s(e)g +(unset)g(using)g(the)h Ft(-n)e Fu(option)i(to)g(the)g +Ft(unset)e Fu(builtin)h(\(see)h(Section)g(4.1)h([Bourne)150 +4104 y(Shell)43 b(Builtins],)j(page)e(41\).)79 b(Otherwise,)45 +b(if)e Ft(unset)e Fu(is)i(executed)h(with)e(the)h(name)g(of)g(a)g +(nameref)150 4214 y(v)-5 b(ariable)31 b(as)g(an)f(argumen)m(t,)h(the)g +(v)-5 b(ariable)31 b(referenced)f(b)m(y)g(the)h(nameref)f(v)-5 +b(ariable)31 b(will)g(b)s(e)f(unset.)150 4426 y Fk(3.4.1)63 +b(P)m(ositional)41 b(P)m(arameters)150 4573 y Fu(A)28 +b Fr(p)s(ositional)h(parameter)35 b Fu(is)28 b(a)g(parameter)g(denoted) +g(b)m(y)g(one)g(or)g(more)g(digits,)h(other)g(than)e(the)h(single)150 +4682 y(digit)34 b Ft(0)p Fu(.)48 b(P)m(ositional)36 b(parameters)d(are) +g(assigned)h(from)e(the)i(shell's)f(argumen)m(ts)g(when)f(it)i(is)f(in) +m(v)m(ok)m(ed,)150 4792 y(and)38 b(ma)m(y)i(b)s(e)e(reassigned)i(using) +e(the)h Ft(set)g Fu(builtin)f(command.)67 b(P)m(ositional)41 +b(parameter)e Ft(N)g Fu(ma)m(y)h(b)s(e)150 4902 y(referenced)34 +b(as)h Ft(${N})p Fu(,)g(or)f(as)h Ft($N)e Fu(when)h Ft(N)g +Fu(consists)h(of)f(a)h(single)g(digit.)54 b(P)m(ositional)37 +b(parameters)d(ma)m(y)150 5011 y(not)j(b)s(e)f(assigned)h(to)g(with)f +(assignmen)m(t)i(statemen)m(ts.)61 b(The)36 b Ft(set)g +Fu(and)g Ft(shift)f Fu(builtins)h(are)h(used)f(to)150 +5121 y(set)k(and)f(unset)f(them)i(\(see)g(Chapter)f(4)g([Shell)h +(Builtin)g(Commands],)h(page)f(41\).)68 b(The)39 b(p)s(ositional)150 +5230 y(parameters)44 b(are)g(temp)s(orarily)g(replaced)h(when)e(a)h +(shell)g(function)g(is)g(executed)g(\(see)h(Section)g(3.3)150 +5340 y([Shell)30 b(F)-8 b(unctions],)32 b(page)f(17\).)p +eop end +%%Page: 20 26 +TeXDict begin 20 25 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(20)275 299 +y(When)27 b(a)i(p)s(ositional)g(parameter)g(consisting)f(of)h(more)f +(than)g(a)g(single)h(digit)g(is)f(expanded,)g(it)h(m)m(ust)150 +408 y(b)s(e)h(enclosed)h(in)f(braces.)150 605 y Fk(3.4.2)63 +b(Sp)s(ecial)41 b(P)m(arameters)150 752 y Fu(The)d(shell)g(treats)h +(sev)m(eral)g(parameters)f(sp)s(ecially)-8 b(.)65 b(These)38 +b(parameters)h(ma)m(y)f(only)g(b)s(e)g(referenced;)150 +862 y(assignmen)m(t)31 b(to)g(them)g(is)f(not)h(allo)m(w)m(ed.)150 +1018 y Ft(*)432 b Fu(\($*\))38 b(Expands)d(to)i(the)f(p)s(ositional)h +(parameters,)h(starting)f(from)f(one.)59 b(When)36 b(the)g(ex-)630 +1128 y(pansion)h(is)h(not)g(within)f(double)g(quotes,)j(eac)m(h)f(p)s +(ositional)f(parameter)g(expands)f(to)i(a)630 1237 y(separate)e(w)m +(ord.)56 b(In)35 b(con)m(texts)i(where)e(it)h(is)g(p)s(erformed,)g +(those)g(w)m(ords)f(are)h(sub)5 b(ject)35 b(to)630 1347 +y(further)h(w)m(ord)h(splitting)h(and)f(pathname)g(expansion.)61 +b(When)38 b(the)f(expansion)g(o)s(ccurs)630 1457 y(within)25 +b(double)h(quotes,)h(it)f(expands)f(to)i(a)f(single)g(w)m(ord)f(with)h +(the)g(v)-5 b(alue)26 b(of)g(eac)m(h)h(param-)630 1566 +y(eter)32 b(separated)h(b)m(y)e(the)h(\014rst)f(c)m(haracter)i(of)f +(the)g Ft(IFS)f Fu(sp)s(ecial)h(v)-5 b(ariable.)45 b(That)32 +b(is,)g Ft("$*")630 1676 y Fu(is)f(equiv)-5 b(alen)m(t)32 +b(to)g Ft("$1)p Fj(c)p Ft($2)p Fj(c)p Ft(...)m(")p Fu(,)f(where)g +Fr(c)37 b Fu(is)31 b(the)g(\014rst)f(c)m(haracter)j(of)e(the)g(v)-5 +b(alue)32 b(of)f(the)630 1785 y Ft(IFS)e Fu(v)-5 b(ariable.)41 +b(If)29 b Ft(IFS)g Fu(is)h(unset,)f(the)h(parameters)g(are)g(separated) +g(b)m(y)g(spaces.)41 b(If)29 b Ft(IFS)g Fu(is)630 1895 +y(n)m(ull,)i(the)f(parameters)h(are)g(joined)f(without)g(in)m(terv)m +(ening)i(separators.)150 2052 y Ft(@)432 b Fu(\($@\))35 +b(Expands)e(to)i(the)g(p)s(ositional)g(parameters,)h(starting)f(from)f +(one.)53 b(When)34 b(the)g(ex-)630 2161 y(pansion)41 +b(o)s(ccurs)g(within)f(double)h(quotes,)k(eac)m(h)d(parameter)g +(expands)e(to)i(a)g(separate)630 2271 y(w)m(ord.)50 b(That)34 +b(is,)g Ft("$@")f Fu(is)g(equiv)-5 b(alen)m(t)35 b(to)g +Ft("$1")29 b("$2")g(...)o Fu(.)51 b(If)33 b(the)h(double-quoted)f(ex-) +630 2380 y(pansion)38 b(o)s(ccurs)h(within)f(a)h(w)m(ord,)i(the)e +(expansion)g(of)g(the)g(\014rst)f(parameter)h(is)g(joined)630 +2490 y(with)i(the)h(b)s(eginning)e(part)i(of)f(the)h(original)g(w)m +(ord,)i(and)d(the)h(expansion)f(of)g(the)h(last)630 2600 +y(parameter)31 b(is)f(joined)g(with)f(the)i(last)g(part)e(of)i(the)f +(original)h(w)m(ord.)40 b(When)30 b(there)h(are)f(no)630 +2709 y(p)s(ositional)e(parameters,)h Ft("$@")d Fu(and)h +Ft($@)f Fu(expand)h(to)h(nothing)f(\(i.e.,)j(they)e(are)f(remo)m(v)m +(ed\).)150 2866 y Ft(#)432 b Fu(\($#\))31 b(Expands)e(to)i(the)g(n)m +(um)m(b)s(er)e(of)h(p)s(ositional)i(parameters)e(in)g(decimal.)150 +3022 y Ft(?)432 b Fu(\($?\))88 b(Expands)45 b(to)h(the)g(exit)h(status) +f(of)g(the)g(most)h(recen)m(tly)g(executed)g(foreground)630 +3132 y(pip)s(eline.)150 3289 y Ft(-)432 b Fu(\($-,)24 +b(a)e(h)m(yphen.\))37 b(Expands)20 b(to)i(the)f(curren)m(t)h(option)f +(\015ags)h(as)f(sp)s(eci\014ed)g(up)s(on)f(in)m(v)m(o)s(cation,)630 +3398 y(b)m(y)38 b(the)h Ft(set)f Fu(builtin)g(command,)j(or)d(those)i +(set)f(b)m(y)f(the)h(shell)g(itself)g(\(suc)m(h)g(as)g(the)g +Ft(-i)630 3508 y Fu(option\).)150 3665 y Ft($)432 b Fu(\($$\))31 +b(Expands)d(to)j(the)e(pro)s(cess)h Fm(id)f Fu(of)h(the)g(shell.)41 +b(In)28 b(a)i Ft(\(\))f Fu(subshell,)h(it)g(expands)e(to)j(the)630 +3774 y(pro)s(cess)f Fm(id)g Fu(of)h(the)g(in)m(v)m(oking)g(shell,)g +(not)g(the)f(subshell.)150 3931 y Ft(!)432 b Fu(\($!\))51 +b(Expands)32 b(to)i(the)g(pro)s(cess)f Fm(id)h Fu(of)f(the)h(job)f +(most)h(recen)m(tly)h(placed)f(in)m(to)g(the)g(bac)m(k-)630 +4040 y(ground,)26 b(whether)g(executed)g(as)h(an)f(async)m(hronous)f +(command)h(or)g(using)g(the)g Ft(bg)f Fu(builtin)630 +4150 y(\(see)31 b(Section)h(7.2)f([Job)f(Con)m(trol)h(Builtins],)g +(page)h(98\).)150 4307 y Ft(0)432 b Fu(\($0\))46 b(Expands)d(to)i(the)g +(name)g(of)f(the)h(shell)g(or)f(shell)h(script.)83 b(This)44 +b(is)g(set)h(at)h(shell)630 4416 y(initialization.)d(If)27 +b(Bash)h(is)g(in)m(v)m(ok)m(ed)h(with)e(a)i(\014le)e(of)h(commands)g +(\(see)g(Section)h(3.8)g([Shell)630 4526 y(Scripts],)g(page)g(39\),)h +Ft($0)e Fu(is)h(set)g(to)g(the)f(name)h(of)f(that)h(\014le.)41 +b(If)28 b(Bash)g(is)h(started)g(with)f(the)630 4635 y +Ft(-c)i Fu(option)h(\(see)h(Section)g(6.1)f([In)m(v)m(oking)h(Bash],)g +(page)f(80\),)i(then)d Ft($0)g Fu(is)h(set)g(to)h(the)f(\014rst)630 +4745 y(argumen)m(t)g(after)g(the)g(string)g(to)g(b)s(e)f(executed,)i +(if)f(one)g(is)f(presen)m(t.)42 b(Otherwise,)31 b(it)g(is)f(set)630 +4855 y(to)h(the)g(\014lename)f(used)g(to)h(in)m(v)m(ok)m(e)h(Bash,)f +(as)g(giv)m(en)g(b)m(y)f(argumen)m(t)h(zero.)150 5011 +y Ft(_)432 b Fu(\($)p 716 5011 28 4 v 41 w(,)41 b(an)e(underscore.\))67 +b(A)m(t)40 b(shell)f(startup,)i(set)f(to)g(the)f(absolute)h(pathname)f +(used)f(to)630 5121 y(in)m(v)m(ok)m(e)43 b(the)e(shell)g(or)g(shell)g +(script)g(b)s(eing)f(executed)i(as)f(passed)g(in)f(the)h(en)m(vironmen) +m(t)630 5230 y(or)34 b(argumen)m(t)g(list.)52 b(Subsequen)m(tly)-8 +b(,)34 b(expands)f(to)i(the)f(last)h(argumen)m(t)f(to)g(the)g(previous) +630 5340 y(command,)g(after)f(expansion.)48 b(Also)34 +b(set)g(to)f(the)g(full)g(pathname)g(used)f(to)i(in)m(v)m(ok)m(e)h(eac) +m(h)p eop end +%%Page: 21 27 +TeXDict begin 21 26 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(21)630 299 +y(command)29 b(executed)h(and)f(placed)g(in)g(the)h(en)m(vironmen)m(t)f +(exp)s(orted)g(to)h(that)g(command.)630 408 y(When)g(c)m(hec)m(king)i +(mail,)g(this)e(parameter)h(holds)f(the)g(name)h(of)f(the)h(mail)g +(\014le.)150 639 y Fs(3.5)68 b(Shell)45 b(Expansions)150 +799 y Fu(Expansion)27 b(is)i(p)s(erformed)d(on)i(the)g(command)g(line)h +(after)f(it)h(has)f(b)s(een)f(split)h(in)m(to)i Ft(token)p +Fu(s.)38 b(There)28 b(are)150 908 y(sev)m(en)j(kinds)e(of)i(expansion)f +(p)s(erformed:)225 1042 y Fq(\017)60 b Fu(brace)31 b(expansion)225 +1176 y Fq(\017)60 b Fu(tilde)31 b(expansion)225 1309 +y Fq(\017)60 b Fu(parameter)31 b(and)f(v)-5 b(ariable)31 +b(expansion)225 1443 y Fq(\017)60 b Fu(command)30 b(substitution)225 +1577 y Fq(\017)60 b Fu(arithmetic)32 b(expansion)225 +1710 y Fq(\017)60 b Fu(w)m(ord)30 b(splitting)225 1844 +y Fq(\017)60 b Fu(\014lename)31 b(expansion)275 2002 +y(The)24 b(order)h(of)h(expansions)f(is:)39 b(brace)25 +b(expansion;)j(tilde)e(expansion,)g(parameter)g(and)f(v)-5 +b(ariable)26 b(ex-)150 2111 y(pansion,)j(arithmetic)i(expansion,)f(and) +f(command)g(substitution)g(\(done)g(in)h(a)f(left-to-righ)m(t)k +(fashion\);)150 2221 y(w)m(ord)d(splitting;)h(and)f(\014lename)h +(expansion.)275 2355 y(On)42 b(systems)h(that)h(can)g(supp)s(ort)e(it,) +47 b(there)d(is)f(an)h(additional)g(expansion)f(a)m(v)-5 +b(ailable:)69 b Fr(pro)s(cess)150 2464 y(substitution)p +Fu(.)50 b(This)33 b(is)h(p)s(erformed)e(at)j(the)f(same)g(time)g(as)g +(tilde,)i(parameter,)f(v)-5 b(ariable,)35 b(and)f(arith-)150 +2574 y(metic)d(expansion)g(and)e(command)i(substitution.)275 +2707 y(Only)k(brace)i(expansion,)h(w)m(ord)e(splitting,)j(and)d +(\014lename)g(expansion)g(can)h(c)m(hange)h(the)e(n)m(um)m(b)s(er)150 +2817 y(of)h(w)m(ords)f(of)g(the)h(expansion;)i(other)e(expansions)f +(expand)g(a)h(single)g(w)m(ord)f(to)h(a)g(single)g(w)m(ord.)58 +b(The)150 2927 y(only)32 b(exceptions)i(to)f(this)f(are)h(the)f +(expansions)g(of)h Ft("$@")e Fu(\(see)i(Section)g(3.4.2)h([Sp)s(ecial)f +(P)m(arameters],)150 3036 y(page)e(20\))h(and)d Ft("${)p +Fj(name)p Ft([@]}")e Fu(\(see)32 b(Section)f(6.7)g([Arra)m(ys],)h(page) +f(89\).)275 3170 y(After)41 b(all)i(expansions,)h Ft(quote)29 +b(removal)40 b Fu(\(see)i(Section)h(3.5.9)g([Quote)f(Remo)m(v)-5 +b(al],)47 b(page)42 b(31\))h(is)150 3279 y(p)s(erformed.)150 +3477 y Fk(3.5.1)63 b(Brace)40 b(Expansion)150 3624 y +Fu(Brace)32 b(expansion)f(is)f(a)i(mec)m(hanism)f(b)m(y)f(whic)m(h)h +(arbitrary)f(strings)h(ma)m(y)g(b)s(e)f(generated.)43 +b(This)30 b(mec)m(h-)150 3733 y(anism)35 b(is)h(similar)f(to)h +Fr(\014lename)g(expansion)f Fu(\(see)i(Section)f(3.5.8)h([Filename)g +(Expansion],)f(page)g(30\),)150 3843 y(but)26 b(the)h(\014lenames)g +(generated)h(need)f(not)g(exist.)40 b(P)m(atterns)28 +b(to)f(b)s(e)g(brace)g(expanded)f(tak)m(e)i(the)f(form)g(of)150 +3953 y(an)j(optional)h Fr(pream)m(ble)p Fu(,)g(follo)m(w)m(ed)g(b)m(y)f +(either)g(a)h(series)f(of)g(comma-separated)i(strings)d(or)h(a)h +(sequence)150 4062 y(expression)36 b(b)s(et)m(w)m(een)g(a)h(pair)e(of)i +(braces,)g(follo)m(w)m(ed)h(b)m(y)e(an)g(optional)h Fr(p)s(ostscript)p +Fu(.)57 b(The)36 b(pream)m(ble)g(is)150 4172 y(pre\014xed)28 +b(to)h(eac)m(h)h(string)f(con)m(tained)h(within)e(the)h(braces,)g(and)g +(the)g(p)s(ostscript)f(is)h(then)f(app)s(ended)f(to)150 +4281 y(eac)m(h)32 b(resulting)e(string,)h(expanding)e(left)j(to)f(righ) +m(t.)275 4415 y(Brace)37 b(expansions)f(ma)m(y)h(b)s(e)f(nested.)59 +b(The)36 b(results)g(of)h(eac)m(h)g(expanded)f(string)g(are)h(not)g +(sorted;)150 4525 y(left)31 b(to)g(righ)m(t)g(order)f(is)g(preserv)m +(ed.)41 b(F)-8 b(or)31 b(example,)390 4658 y Ft(bash$)46 +b(echo)h(a{d,c,b}e)390 4768 y(ade)g(ace)g(abe)275 4902 +y Fu(A)23 b(sequence)g(expression)g(tak)m(es)i(the)e(form)g +Ft({)p Fj(x)p Ft(..)p Fj(y)p Ft([..)p Fj(incr)p Ft(]})p +Fu(,)e(where)i Fr(x)29 b Fu(and)23 b Fr(y)30 b Fu(are)24 +b(either)g(in)m(tegers)150 5011 y(or)42 b(single)h(c)m(haracters,)48 +b(and)41 b Fr(incr)p Fu(,)46 b(an)c(optional)i(incremen)m(t,)i(is)c(an) +h(in)m(teger.)78 b(When)42 b(in)m(tegers)i(are)150 5121 +y(supplied,)f(the)f(expression)f(expands)f(to)i(eac)m(h)h(n)m(um)m(b)s +(er)d(b)s(et)m(w)m(een)i Fr(x)47 b Fu(and)41 b Fr(y)p +Fu(,)j(inclusiv)m(e.)75 b(Supplied)150 5230 y(in)m(tegers)33 +b(ma)m(y)e(b)s(e)g(pre\014xed)f(with)h(`)p Ft(0)p Fu(')h(to)g(force)g +(eac)m(h)g(term)g(to)g(ha)m(v)m(e)g(the)g(same)g(width.)42 +b(When)31 b(either)150 5340 y Fr(x)43 b Fu(or)36 b Fr(y)44 +b Fu(b)s(egins)36 b(with)g(a)h(zero,)i(the)e(shell)g(attempts)g(to)g +(force)g(all)h(generated)f(terms)g(to)g(con)m(tain)h(the)p +eop end +%%Page: 22 28 +TeXDict begin 22 27 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(22)150 299 +y(same)36 b(n)m(um)m(b)s(er)e(of)i(digits,)i(zero-padding)d(where)h +(necessary)-8 b(.)57 b(When)35 b(c)m(haracters)i(are)f(supplied,)g(the) +150 408 y(expression)24 b(expands)g(to)h(eac)m(h)h(c)m(haracter)g +(lexicographically)h(b)s(et)m(w)m(een)e Fr(x)30 b Fu(and)24 +b Fr(y)p Fu(,)i(inclusiv)m(e,)h(using)d(the)150 518 y(default)32 +b(C)g(lo)s(cale.)48 b(Note)34 b(that)f(b)s(oth)e Fr(x)39 +b Fu(and)31 b Fr(y)40 b Fu(m)m(ust)32 b(b)s(e)g(of)g(the)h(same)f(t)m +(yp)s(e.)47 b(When)32 b(the)g(incremen)m(t)150 628 y(is)d(supplied,)g +(it)h(is)f(used)f(as)i(the)f(di\013erence)h(b)s(et)m(w)m(een)g(eac)m(h) +g(term.)41 b(The)29 b(default)g(incremen)m(t)h(is)f(1)h(or)f(-1)150 +737 y(as)i(appropriate.)275 873 y(Brace)36 b(expansion)g(is)f(p)s +(erformed)f(b)s(efore)h(an)m(y)h(other)g(expansions,)h(and)e(an)m(y)g +(c)m(haracters)i(sp)s(ecial)150 982 y(to)32 b(other)g(expansions)g(are) +g(preserv)m(ed)f(in)h(the)f(result.)45 b(It)32 b(is)g(strictly)g +(textual.)46 b(Bash)32 b(do)s(es)f(not)h(apply)150 1092 +y(an)m(y)27 b(syn)m(tactic)i(in)m(terpretation)g(to)f(the)f(con)m(text) +i(of)e(the)g(expansion)g(or)g(the)h(text)g(b)s(et)m(w)m(een)f(the)h +(braces.)150 1201 y(T)-8 b(o)37 b(a)m(v)m(oid)g(con\015icts)g(with)f +(parameter)h(expansion,)g(the)g(string)f(`)p Ft(${)p +Fu(')g(is)g(not)g(considered)g(eligible)i(for)150 1311 +y(brace)31 b(expansion.)275 1446 y(A)e(correctly-formed)i(brace)f +(expansion)f(m)m(ust)h(con)m(tain)h(unquoted)e(op)s(ening)g(and)g +(closing)i(braces,)150 1556 y(and)h(at)i(least)g(one)f(unquoted)g +(comma)g(or)g(a)h(v)-5 b(alid)33 b(sequence)g(expression.)48 +b(An)m(y)33 b(incorrectly)h(formed)150 1666 y(brace)d(expansion)f(is)g +(left)h(unc)m(hanged.)275 1801 y(A)25 b Fi({)h Fu(or)f(`)p +Ft(,)p Fu(')g(ma)m(y)h(b)s(e)f(quoted)h(with)f(a)g(bac)m(kslash)h(to)g +(prev)m(en)m(t)g(its)g(b)s(eing)f(considered)g(part)g(of)h(a)g(brace) +150 1911 y(expression.)51 b(T)-8 b(o)34 b(a)m(v)m(oid)i(con\015icts)e +(with)g(parameter)g(expansion,)h(the)f(string)g(`)p Ft(${)p +Fu(')g(is)g(not)g(considered)150 2020 y(eligible)e(for)e(brace)h +(expansion.)275 2156 y(This)f(construct)h(is)g(t)m(ypically)i(used)d +(as)h(shorthand)f(when)g(the)h(common)g(pre\014x)f(of)h(the)g(strings)g +(to)150 2265 y(b)s(e)f(generated)h(is)g(longer)g(than)f(in)g(the)g(ab)s +(o)m(v)m(e)i(example:)390 2401 y Ft(mkdir)46 b +(/usr/local/src/bash/{old,n)o(ew,)o(dist)o(,bug)o(s})275 +2536 y Fu(or)390 2672 y Ft(chown)g(root)h(/usr/{ucb/{ex,edit},lib/)o +({ex?)o(.?*,)o(how)o(_ex})o(})150 2872 y Fk(3.5.2)63 +b(Tilde)41 b(Expansion)150 3019 y Fu(If)29 b(a)h(w)m(ord)g(b)s(egins)f +(with)g(an)h(unquoted)f(tilde)h(c)m(haracter)h(\(`)p +Ft(~)p Fu('\),)g(all)g(of)f(the)g(c)m(haracters)h(up)d(to)j(the)f +(\014rst)150 3128 y(unquoted)24 b(slash)g(\(or)h(all)h(c)m(haracters,)h +(if)e(there)g(is)f(no)h(unquoted)e(slash\))i(are)g(considered)g(a)g +Fr(tilde-pre\014x)p Fu(.)150 3238 y(If)38 b(none)g(of)g(the)h(c)m +(haracters)g(in)f(the)h(tilde-pre\014x)f(are)h(quoted,)h(the)f(c)m +(haracters)h(in)d(the)i(tilde-pre\014x)150 3348 y(follo)m(wing)28 +b(the)g(tilde)f(are)h(treated)g(as)f(a)g(p)s(ossible)g +Fr(login)h(name)p Fu(.)39 b(If)27 b(this)g(login)h(name)f(is)g(the)g(n) +m(ull)g(string,)150 3457 y(the)35 b(tilde)g(is)g(replaced)g(with)f(the) +h(v)-5 b(alue)35 b(of)g(the)g Ft(HOME)e Fu(shell)i(v)-5 +b(ariable.)54 b(If)34 b Ft(HOME)g Fu(is)h(unset,)g(the)g(home)150 +3567 y(directory)e(of)g(the)f(user)g(executing)i(the)e(shell)h(is)f +(substituted)g(instead.)47 b(Otherwise,)33 b(the)g(tilde-pre\014x)150 +3676 y(is)d(replaced)h(with)f(the)h(home)f(directory)h(asso)s(ciated)h +(with)e(the)h(sp)s(eci\014ed)e(login)j(name.)275 3812 +y(If)g(the)h(tilde-pre\014x)f(is)h(`)p Ft(~+)p Fu(',)g(the)g(v)-5 +b(alue)33 b(of)g(the)g(shell)g(v)-5 b(ariable)34 b Ft(PWD)d +Fu(replaces)j(the)f(tilde-pre\014x.)47 b(If)150 3921 +y(the)31 b(tilde-pre\014x)f(is)g(`)p Ft(~-)p Fu(',)h(the)f(v)-5 +b(alue)31 b(of)g(the)f(shell)h(v)-5 b(ariable)31 b Ft(OLDPWD)p +Fu(,)e(if)h(it)h(is)g(set,)g(is)f(substituted.)275 4057 +y(If)f(the)h(c)m(haracters)h(follo)m(wing)h(the)e(tilde)g(in)g(the)g +(tilde-pre\014x)g(consist)g(of)g(a)h(n)m(um)m(b)s(er)d +Fr(N)p Fu(,)j(optionally)150 4166 y(pre\014xed)22 b(b)m(y)h(a)h(`)p +Ft(+)p Fu(')f(or)h(a)f(`)p Ft(-)p Fu(',)j(the)d(tilde-pre\014x)g(is)h +(replaced)f(with)g(the)h(corresp)s(onding)e(elemen)m(t)j(from)e(the)150 +4276 y(directory)36 b(stac)m(k,)i(as)e(it)g(w)m(ould)f(b)s(e)g(displa)m +(y)m(ed)h(b)m(y)g(the)f Ft(dirs)g Fu(builtin)g(in)m(v)m(ok)m(ed)i(with) +e(the)g(c)m(haracters)150 4386 y(follo)m(wing)40 b(tilde)f(in)g(the)f +(tilde-pre\014x)h(as)g(an)f(argumen)m(t)h(\(see)h(Section)f(6.8)h([The) +e(Directory)i(Stac)m(k],)150 4495 y(page)c(90\).)57 b(If)35 +b(the)g(tilde-pre\014x,)i(sans)e(the)h(tilde,)h(consists)f(of)g(a)f(n)m +(um)m(b)s(er)f(without)i(a)f(leading)h(`)p Ft(+)p Fu(')g(or)150 +4605 y(`)p Ft(-)p Fu(',)31 b(`)p Ft(+)p Fu(')f(is)h(assumed.)275 +4740 y(If)e(the)i(login)g(name)g(is)f(in)m(v)-5 b(alid,)31 +b(or)g(the)f(tilde)h(expansion)f(fails,)i(the)e(w)m(ord)g(is)h(left)g +(unc)m(hanged.)275 4876 y(Eac)m(h)38 b(v)-5 b(ariable)38 +b(assignmen)m(t)h(is)e(c)m(hec)m(k)m(ed)j(for)d(unquoted)g +(tilde-pre\014xes)h(immediately)g(follo)m(wing)150 4985 +y(a)d(`)p Ft(:)p Fu(')g(or)g(the)g(\014rst)f(`)p Ft(=)p +Fu('.)54 b(In)34 b(these)h(cases,)i(tilde)e(expansion)g(is)g(also)h(p)s +(erformed.)52 b(Consequen)m(tly)-8 b(,)37 b(one)150 5095 +y(ma)m(y)29 b(use)e(\014lenames)h(with)g(tildes)g(in)g(assignmen)m(ts)g +(to)h Ft(PATH)p Fu(,)f Ft(MAILPATH)p Fu(,)e(and)h Ft(CDPATH)p +Fu(,)g(and)h(the)g(shell)150 5205 y(assigns)j(the)f(expanded)g(v)-5 +b(alue.)275 5340 y(The)29 b(follo)m(wing)j(table)g(sho)m(ws)e(ho)m(w)g +(Bash)h(treats)g(unquoted)e(tilde-pre\014xes:)p eop end +%%Page: 23 29 +TeXDict begin 23 28 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(23)150 299 +y Ft(~)432 b Fu(The)30 b(v)-5 b(alue)31 b(of)f Ft($HOME)150 +474 y(~/foo)240 b($HOME/foo)150 649 y(~fred/foo)630 759 +y Fu(The)30 b(sub)s(directory)f Ft(foo)h Fu(of)g(the)h(home)f +(directory)h(of)g(the)f(user)g Ft(fred)150 934 y(~+/foo)192 +b($PWD/foo)150 1109 y(~-/foo)g(${OLDPWD-'~-'}/foo)150 +1284 y(~)p Fj(N)384 b Fu(The)30 b(string)g(that)h(w)m(ould)f(b)s(e)g +(displa)m(y)m(ed)h(b)m(y)f(`)p Ft(dirs)g(+)p Fj(N)p Fu(')150 +1459 y Ft(~+)p Fj(N)336 b Fu(The)30 b(string)g(that)h(w)m(ould)f(b)s(e) +g(displa)m(y)m(ed)h(b)m(y)f(`)p Ft(dirs)g(+)p Fj(N)p +Fu(')150 1634 y Ft(~-)p Fj(N)336 b Fu(The)30 b(string)g(that)h(w)m +(ould)f(b)s(e)g(displa)m(y)m(ed)h(b)m(y)f(`)p Ft(dirs)g(-)p +Fj(N)p Fu(')150 1849 y Fk(3.5.3)63 b(Shell)41 b(P)m(arameter)f +(Expansion)150 1996 y Fu(The)g(`)p Ft($)p Fu(')h(c)m(haracter)i(in)m +(tro)s(duces)d(parameter)h(expansion,)j(command)d(substitution,)i(or)e +(arithmetic)150 2105 y(expansion.)d(The)22 b(parameter)h(name)f(or)g +(sym)m(b)s(ol)h(to)g(b)s(e)e(expanded)h(ma)m(y)h(b)s(e)f(enclosed)h(in) +f(braces,)i(whic)m(h)150 2215 y(are)31 b(optional)g(but)f(serv)m(e)h +(to)h(protect)f(the)g(v)-5 b(ariable)31 b(to)g(b)s(e)f(expanded)g(from) +g(c)m(haracters)i(immediately)150 2324 y(follo)m(wing)g(it)f(whic)m(h)f +(could)g(b)s(e)g(in)m(terpreted)h(as)f(part)h(of)f(the)h(name.)275 +2474 y(When)44 b(braces)i(are)f(used,)j(the)e(matc)m(hing)g(ending)f +(brace)g(is)g(the)g(\014rst)g(`)p Ft(})p Fu(')g(not)g(escap)s(ed)h(b)m +(y)f(a)150 2584 y(bac)m(kslash)40 b(or)f(within)g(a)g(quoted)g(string,) +j(and)c(not)i(within)e(an)h(em)m(b)s(edded)f(arithmetic)j(expansion,) +150 2694 y(command)30 b(substitution,)g(or)h(parameter)g(expansion.)275 +2844 y(The)40 b(basic)i(form)f(of)g(parameter)h(expansion)f(is)h($)p +Fi({)p Fr(parameter)7 b Fi(})p Fu(.)74 b(The)41 b(v)-5 +b(alue)42 b(of)g Fr(parameter)48 b Fu(is)150 2953 y(substituted.)43 +b(The)31 b Fr(parameter)39 b Fu(is)31 b(a)h(shell)f(parameter)h(as)g +(describ)s(ed)e(ab)s(o)m(v)m(e)j(\(see)f(Section)g(3.4)h([Shell)150 +3063 y(P)m(arameters],)e(page)f(18\))h(or)e(an)g(arra)m(y)h(reference)f +(\(see)i(Section)f(6.7)g([Arra)m(ys],)g(page)g(89\).)42 +b(The)29 b(braces)150 3172 y(are)j(required)g(when)f +Fr(parameter)39 b Fu(is)32 b(a)h(p)s(ositional)f(parameter)h(with)f +(more)g(than)g(one)g(digit,)i(or)e(when)150 3282 y Fr(parameter)37 +b Fu(is)31 b(follo)m(w)m(ed)h(b)m(y)e(a)h(c)m(haracter)h(that)f(is)f +(not)h(to)g(b)s(e)f(in)m(terpreted)g(as)h(part)f(of)h(its)f(name.)275 +3432 y(If)36 b(the)h(\014rst)f(c)m(haracter)i(of)f Fr(parameter)44 +b Fu(is)37 b(an)f(exclamation)j(p)s(oin)m(t)e(\(!\),)i(it)f(in)m(tro)s +(duces)e(a)h(lev)m(el)i(of)150 3542 y(v)-5 b(ariable)30 +b(indirection.)41 b(Bash)30 b(uses)f(the)g(v)-5 b(alue)30 +b(of)g(the)f(v)-5 b(ariable)30 b(formed)f(from)g(the)h(rest)f(of)h +Fr(parameter)150 3651 y Fu(as)c(the)g(name)g(of)g(the)h(v)-5 +b(ariable;)28 b(this)e(v)-5 b(ariable)27 b(is)f(then)f(expanded)g(and)h +(that)g(v)-5 b(alue)27 b(is)f(used)f(in)h(the)g(rest)150 +3761 y(of)34 b(the)f(substitution,)i(rather)e(than)g(the)h(v)-5 +b(alue)34 b(of)g Fr(parameter)40 b Fu(itself.)51 b(This)33 +b(is)g(kno)m(wn)g(as)h Ft(indirect)150 3871 y(expansion)p +Fu(.)78 b(The)43 b(exceptions)i(to)f(this)f(are)h(the)g(expansions)g +(of)f($)p Fi({)p Fu(!)p Fr(pre\014x)6 b Fu(*)p Fi(})45 +b Fu(and)e($)p Fi({)p Fu(!)p Fr(name)5 b Fu([@])p Fi(})150 +3980 y Fu(describ)s(ed)28 b(b)s(elo)m(w.)41 b(The)28 +b(exclamation)j(p)s(oin)m(t)f(m)m(ust)f(immediately)h(follo)m(w)g(the)g +(left)f(brace)h(in)f(order)f(to)150 4090 y(in)m(tro)s(duce)i +(indirection.)275 4240 y(In)39 b(eac)m(h)i(of)g(the)f(cases)h(b)s(elo)m +(w,)i Fr(w)m(ord)h Fu(is)c(sub)5 b(ject)40 b(to)h(tilde)f(expansion,)j +(parameter)e(expansion,)150 4349 y(command)30 b(substitution,)g(and)g +(arithmetic)i(expansion.)275 4500 y(When)h(not)h(p)s(erforming)e +(substring)h(expansion,)h(using)g(the)f(form)h(describ)s(ed)e(b)s(elo)m +(w)i(\(e.g.,)i(`)p Ft(:-)p Fu('\),)150 4609 y(Bash)d(tests)h(for)e(a)i +(parameter)f(that)h(is)e(unset)h(or)g(n)m(ull.)48 b(Omitting)33 +b(the)h(colon)f(results)g(in)g(a)g(test)h(only)150 4719 +y(for)c(a)i(parameter)f(that)g(is)g(unset.)41 b(Put)31 +b(another)f(w)m(a)m(y)-8 b(,)33 b(if)e(the)f(colon)i(is)f(included,)f +(the)h(op)s(erator)g(tests)150 4828 y(for)36 b(b)s(oth)g +Fr(parameter)7 b Fu('s)37 b(existence)h(and)e(that)i(its)f(v)-5 +b(alue)37 b(is)g(not)f(n)m(ull;)k(if)d(the)g(colon)h(is)e(omitted,)k +(the)150 4938 y(op)s(erator)31 b(tests)g(only)f(for)g(existence.)150 +5121 y Ft(${)p Fj(parameter)p Ft(:)p Fq(\000)p Fj(word)p +Ft(})630 5230 y Fu(If)g Fr(parameter)37 b Fu(is)30 b(unset)g(or)h(n)m +(ull,)f(the)h(expansion)f(of)g Fr(w)m(ord)k Fu(is)c(substituted.)40 +b(Otherwise,)630 5340 y(the)31 b(v)-5 b(alue)30 b(of)h +Fr(parameter)37 b Fu(is)31 b(substituted.)p eop end +%%Page: 24 30 +TeXDict begin 24 29 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(24)150 299 +y Ft(${)p Fj(parameter)p Ft(:=)p Fj(word)p Ft(})630 408 +y Fu(If)33 b Fr(parameter)40 b Fu(is)33 b(unset)f(or)h(n)m(ull,)h(the)f +(expansion)g(of)g Fr(w)m(ord)j Fu(is)d(assigned)g(to)h +Fr(parameter)p Fu(.)630 518 y(The)c(v)-5 b(alue)32 b(of)f +Fr(parameter)38 b Fu(is)31 b(then)g(substituted.)42 b(P)m(ositional)33 +b(parameters)e(and)f(sp)s(ecial)630 628 y(parameters)h(ma)m(y)g(not)f +(b)s(e)g(assigned)h(to)g(in)f(this)g(w)m(a)m(y)-8 b(.)150 +786 y Ft(${)p Fj(parameter)p Ft(:?)p Fj(word)p Ft(})630 +896 y Fu(If)26 b Fr(parameter)33 b Fu(is)26 b(n)m(ull)g(or)g(unset,)h +(the)f(expansion)g(of)g Fr(w)m(ord)k Fu(\(or)c(a)h(message)g(to)g(that) +f(e\013ect)630 1005 y(if)i Fr(w)m(ord)j Fu(is)d(not)g(presen)m(t\))h +(is)f(written)g(to)h(the)f(standard)f(error)h(and)f(the)h(shell,)h(if)f +(it)h(is)f(not)630 1115 y(in)m(teractiv)m(e,)33 b(exits.)42 +b(Otherwise,)30 b(the)h(v)-5 b(alue)31 b(of)f Fr(parameter)38 +b Fu(is)30 b(substituted.)150 1273 y Ft(${)p Fj(parameter)p +Ft(:+)p Fj(word)p Ft(})630 1383 y Fu(If)35 b Fr(parameter)42 +b Fu(is)36 b(n)m(ull)f(or)h(unset,)g(nothing)g(is)f(substituted,)i +(otherwise)e(the)h(expansion)630 1492 y(of)31 b Fr(w)m(ord)i +Fu(is)e(substituted.)150 1650 y Ft(${)p Fj(parameter)p +Ft(:)p Fj(offset)p Ft(})150 1760 y(${)p Fj(parameter)p +Ft(:)p Fj(offset)p Ft(:)p Fj(lengt)o(h)p Ft(})630 1870 +y Fu(This)f(is)h(referred)f(to)h(as)g(Substring)f(Expansion.)41 +b(It)31 b(expands)f(to)h(up)f(to)h Fr(length)g Fu(c)m(harac-)630 +1979 y(ters)k(of)g(the)h(v)-5 b(alue)35 b(of)g Fr(parameter)42 +b Fu(starting)36 b(at)g(the)f(c)m(haracter)i(sp)s(eci\014ed)d(b)m(y)h +Fr(o\013set)p Fu(.)55 b(If)630 2089 y Fr(parameter)32 +b Fu(is)26 b(`)p Ft(@)p Fu(',)g(an)f(indexed)g(arra)m(y)h(subscripted)e +(b)m(y)h(`)p Ft(@)p Fu(')g(or)h(`)p Ft(*)p Fu(',)g(or)g(an)f(asso)s +(ciativ)m(e)j(ar-)630 2198 y(ra)m(y)g(name,)h(the)f(results)g(di\013er) +g(as)g(describ)s(ed)f(b)s(elo)m(w.)40 b(If)28 b Fr(length)g +Fu(is)g(omitted,)i(it)f(expands)630 2308 y(to)e(the)g(substring)f(of)g +(the)h(v)-5 b(alue)27 b(of)g Fr(parameter)33 b Fu(starting)28 +b(at)f(the)g(c)m(haracter)h(sp)s(eci\014ed)e(b)m(y)630 +2418 y Fr(o\013set)37 b Fu(and)d(extending)g(to)h(the)f(end)g(of)g(the) +g(v)-5 b(alue.)53 b Fr(length)34 b Fu(and)g Fr(o\013set)j +Fu(are)e(arithmetic)630 2527 y(expressions)30 b(\(see)h(Section)g(6.5)h +([Shell)e(Arithmetic],)i(page)f(87\).)630 2661 y(If)39 +b Fr(o\013set)k Fu(ev)-5 b(aluates)41 b(to)f(a)g(n)m(um)m(b)s(er)f +(less)h(than)f(zero,)k(the)d(v)-5 b(alue)40 b(is)g(used)e(as)i(an)g +(o\013set)630 2771 y(in)33 b(c)m(haracters)i(from)f(the)f(end)g(of)h +(the)g(v)-5 b(alue)34 b(of)g Fr(parameter)p Fu(.)51 b(If)33 +b Fr(length)h Fu(ev)-5 b(aluates)35 b(to)g(a)630 2880 +y(n)m(um)m(b)s(er)23 b(less)h(than)g(zero,)j(it)d(is)h(in)m(terpreted)f +(as)g(an)h(o\013set)g(in)f(c)m(haracters)h(from)f(the)g(end)g(of)630 +2990 y(the)31 b(v)-5 b(alue)31 b(of)g Fr(parameter)38 +b Fu(rather)30 b(than)h(a)g(n)m(um)m(b)s(er)f(of)g(c)m(haracters,)j +(and)d(the)h(expansion)630 3099 y(is)39 b(the)g(c)m(haracters)i(b)s(et) +m(w)m(een)f Fr(o\013set)i Fu(and)c(that)i(result.)67 +b(Note)40 b(that)g(a)g(negativ)m(e)h(o\013set)630 3209 +y(m)m(ust)27 b(b)s(e)g(separated)g(from)g(the)g(colon)i(b)m(y)e(at)h +(least)g(one)f(space)h(to)g(a)m(v)m(oid)h(b)s(eing)e(confused)630 +3319 y(with)j(the)h(`)p Ft(:-)p Fu(')f(expansion.)630 +3453 y(Here)43 b(are)g(some)f(examples)h(illustrating)g(substring)f +(expansion)g(on)g(parameters)h(and)630 3562 y(subscripted)29 +b(arra)m(ys:)630 3696 y Ft($)47 b(string=01234567890abcdefgh)630 +3806 y($)g(echo)g(${string:7})630 3915 y(7890abcdefgh)630 +4025 y($)g(echo)g(${string:7:0})630 4244 y($)g(echo)g(${string:7:2})630 +4354 y(78)630 4463 y($)g(echo)g(${string:7:-2})630 4573 +y(7890abcdef)630 4682 y($)g(echo)g(${string:)e(-7})630 +4792 y(bcdefgh)630 4902 y($)i(echo)g(${string:)e(-7:0})630 +5121 y($)i(echo)g(${string:)e(-7:2})630 5230 y(bc)630 +5340 y($)i(echo)g(${string:)e(-7:-2})p eop end +%%Page: 25 31 +TeXDict begin 25 30 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(25)630 299 +y Ft(bcdef)630 408 y($)47 b(set)g(--)h(01234567890abcdefgh)630 +518 y($)f(echo)g(${1:7})630 628 y(7890abcdefgh)630 737 +y($)g(echo)g(${1:7:0})630 956 y($)g(echo)g(${1:7:2})630 +1066 y(78)630 1176 y($)g(echo)g(${1:7:-2})630 1285 y(7890abcdef)630 +1395 y($)g(echo)g(${1:)g(-7})630 1504 y(bcdefgh)630 1614 +y($)g(echo)g(${1:)g(-7:0})630 1833 y($)g(echo)g(${1:)g(-7:2})630 +1943 y(bc)630 2052 y($)g(echo)g(${1:)g(-7:-2})630 2162 +y(bcdef)630 2271 y($)g(array[0]=01234567890abcdef)o(gh)630 +2381 y($)g(echo)g(${array[0]:7})630 2491 y(7890abcdefgh)630 +2600 y($)g(echo)g(${array[0]:7:0})630 2819 y($)g(echo)g +(${array[0]:7:2})630 2929 y(78)630 3039 y($)g(echo)g(${array[0]:7:-2}) +630 3148 y(7890abcdef)630 3258 y($)g(echo)g(${array[0]:)e(-7})630 +3367 y(bcdefgh)630 3477 y($)i(echo)g(${array[0]:)e(-7:0})630 +3696 y($)i(echo)g(${array[0]:)e(-7:2})630 3806 y(bc)630 +3915 y($)i(echo)g(${array[0]:)e(-7:-2})630 4025 y(bcdef)630 +4171 y Fu(If)22 b Fr(parameter)30 b Fu(is)23 b(`)p Ft(@)p +Fu(',)i(the)e(result)g(is)g Fr(length)h Fu(p)s(ositional)f(parameters)h +(b)s(eginning)e(at)i Fr(o\013set)p Fu(.)630 4281 y(A)36 +b(negativ)m(e)j Fr(o\013set)g Fu(is)e(tak)m(en)g(relativ)m(e)i(to)e +(one)g(greater)g(than)f(the)h(greatest)h(p)s(ositional)630 +4390 y(parameter,)29 b(so)f(an)g(o\013set)h(of)f(-1)g(ev)-5 +b(aluates)30 b(to)e(the)g(last)h(p)s(ositional)g(parameter.)40 +b(It)28 b(is)g(an)630 4500 y(expansion)i(error)g(if)h +Fr(length)f Fu(ev)-5 b(aluates)32 b(to)f(a)g(n)m(um)m(b)s(er)e(less)i +(than)f(zero.)630 4646 y(The)i(follo)m(wing)i(examples)f(illustrate)h +(substring)d(expansion)i(using)f(p)s(ositional)h(param-)630 +4755 y(eters:)630 4902 y Ft($)47 b(set)g(--)h(1)f(2)g(3)h(4)f(5)h(6)f +(7)h(8)f(9)h(0)f(a)h(b)f(c)g(d)h(e)f(f)h(g)f(h)630 5011 +y($)g(echo)g(${@:7})630 5121 y(7)g(8)h(9)f(0)h(a)f(b)h(c)f(d)h(e)f(f)h +(g)f(h)630 5230 y($)g(echo)g(${@:7:0})p eop end +%%Page: 26 32 +TeXDict begin 26 31 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(26)630 299 +y Ft($)47 b(echo)g(${@:7:2})630 408 y(7)g(8)630 518 y($)g(echo)g +(${@:7:-2})630 628 y(bash:)f(-2:)h(substring)f(expression)f(<)i(0)630 +737 y($)g(echo)g(${@:)g(-7:2})630 847 y(b)g(c)630 956 +y($)g(echo)g(${@:0})630 1066 y(./bash)f(1)i(2)f(3)g(4)h(5)f(6)h(7)f(8)h +(9)f(0)h(a)f(b)h(c)f(d)g(e)h(f)f(g)h(h)630 1176 y($)f(echo)g(${@:0:2}) +630 1285 y(./bash)f(1)630 1395 y($)h(echo)g(${@:)g(-7:0})630 +1677 y Fu(If)36 b Fr(parameter)43 b Fu(is)36 b(an)g(indexed)g(arra)m(y) +g(name)g(subscripted)f(b)m(y)h(`)p Ft(@)p Fu(')g(or)h(`)p +Ft(*)p Fu(',)h(the)e(result)g(is)630 1786 y(the)j Fr(length)g +Fu(mem)m(b)s(ers)f(of)h(the)f(arra)m(y)i(b)s(eginning)d(with)i +Ft(${)p Fj(parameter)p Ft([)p Fj(offset)p Ft(]})p Fu(.)60 +b(A)630 1896 y(negativ)m(e)33 b Fr(o\013set)g Fu(is)e(tak)m(en)h +(relativ)m(e)g(to)g(one)f(greater)g(than)g(the)f(maxim)m(um)h(index)f +(of)h(the)630 2005 y(sp)s(eci\014ed)38 b(arra)m(y)-8 +b(.)65 b(It)38 b(is)g(an)h(expansion)f(error)f(if)i Fr(length)f +Fu(ev)-5 b(aluates)40 b(to)f(a)g(n)m(um)m(b)s(er)e(less)630 +2115 y(than)30 b(zero.)630 2287 y(These)23 b(examples)i(sho)m(w)e(ho)m +(w)h(y)m(ou)g(can)g(use)f(substring)f(expansion)i(with)f(indexed)g +(arra)m(ys:)630 2459 y Ft($)47 b(array=\(0)f(1)h(2)h(3)f(4)h(5)f(6)h(7) +f(8)h(9)f(0)h(a)f(b)g(c)h(d)f(e)h(f)f(g)h(h\))630 2569 +y($)f(echo)g(${array[@]:7})630 2679 y(7)g(8)h(9)f(0)h(a)f(b)h(c)f(d)h +(e)f(f)h(g)f(h)630 2788 y($)g(echo)g(${array[@]:7:2})630 +2898 y(7)g(8)630 3007 y($)g(echo)g(${array[@]:)e(-7:2})630 +3117 y(b)i(c)630 3226 y($)g(echo)g(${array[@]:)e(-7:-2})630 +3336 y(bash:)h(-2:)h(substring)f(expression)f(<)i(0)630 +3446 y($)g(echo)g(${array[@]:0})630 3555 y(0)g(1)h(2)f(3)h(4)f(5)h(6)f +(7)h(8)f(9)h(0)f(a)g(b)h(c)f(d)h(e)f(f)h(g)f(h)630 3665 +y($)g(echo)g(${array[@]:0:2})630 3774 y(0)g(1)630 3884 +y($)g(echo)g(${array[@]:)e(-7:0})630 4166 y Fu(Substring)25 +b(expansion)g(applied)h(to)h(an)f(asso)s(ciativ)m(e)j(arra)m(y)d(pro)s +(duces)f(unde\014ned)f(results.)630 4338 y(Substring)32 +b(indexing)i(is)f(zero-based)i(unless)e(the)h(p)s(ositional)g +(parameters)g(are)g(used,)g(in)630 4448 y(whic)m(h)29 +b(case)i(the)f(indexing)g(starts)g(at)g(1)g(b)m(y)g(default.)41 +b(If)29 b Fr(o\013set)k Fu(is)d(0,)g(and)f(the)h(p)s(ositional)630 +4557 y(parameters)h(are)f(used,)g Ft($@)g Fu(is)g(pre\014xed)g(to)h +(the)f(list.)150 4792 y Ft(${!)p Fj(prefix)p Ft(*})150 +4902 y(${!)p Fj(prefix)p Ft(@})630 5011 y Fu(Expands)24 +b(to)h(the)g(names)g(of)g(v)-5 b(ariables)26 b(whose)f(names)f(b)s +(egin)h(with)f Fr(pre\014x)p Fu(,)i(separated)f(b)m(y)630 +5121 y(the)k(\014rst)f(c)m(haracter)j(of)e(the)g Ft(IFS)f +Fu(sp)s(ecial)i(v)-5 b(ariable.)41 b(When)29 b(`)p Ft(@)p +Fu(')g(is)g(used)f(and)h(the)g(expan-)630 5230 y(sion)35 +b(app)s(ears)g(within)f(double)h(quotes,)i(eac)m(h)f(v)-5 +b(ariable)36 b(name)f(expands)g(to)g(a)h(separate)630 +5340 y(w)m(ord.)p eop end +%%Page: 27 33 +TeXDict begin 27 32 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(27)150 299 +y Ft(${!)p Fj(name)p Ft([@]})150 408 y(${!)p Fj(name)p +Ft([*]})630 518 y Fu(If)26 b Fr(name)32 b Fu(is)27 b(an)f(arra)m(y)h(v) +-5 b(ariable,)29 b(expands)d(to)h(the)g(list)g(of)g(arra)m(y)g(indices) +g(\(k)m(eys\))h(assigned)630 628 y(in)c Fr(name)p Fu(.)39 +b(If)24 b Fr(name)30 b Fu(is)24 b(not)h(an)f(arra)m(y)-8 +b(,)27 b(expands)c(to)j(0)f(if)f Fr(name)30 b Fu(is)24 +b(set)h(and)f(n)m(ull)g(otherwise.)630 737 y(When)39 +b(`)p Ft(@)p Fu(')h(is)f(used)g(and)f(the)i(expansion)f(app)s(ears)g +(within)f(double)h(quotes,)k(eac)m(h)d(k)m(ey)630 847 +y(expands)30 b(to)h(a)f(separate)i(w)m(ord.)150 1011 +y Ft(${#)p Fj(parameter)p Ft(})630 1121 y Fu(The)40 b(length)g(in)g(c)m +(haracters)i(of)e(the)h(expanded)e(v)-5 b(alue)41 b(of)f +Fr(parameter)47 b Fu(is)40 b(substituted.)630 1230 y(If)i +Fr(parameter)50 b Fu(is)43 b(`)p Ft(*)p Fu(')g(or)g(`)p +Ft(@)p Fu(',)k(the)c(v)-5 b(alue)43 b(substituted)f(is)h(the)g(n)m(um)m +(b)s(er)f(of)h(p)s(ositional)630 1340 y(parameters.)i(If)32 +b Fr(parameter)38 b Fu(is)32 b(an)g(arra)m(y)g(name)g(subscripted)f(b)m +(y)g(`)p Ft(*)p Fu(')h(or)g(`)p Ft(@)p Fu(',)g(the)g(v)-5 +b(alue)630 1450 y(substituted)30 b(is)h(the)g(n)m(um)m(b)s(er)e(of)i +(elemen)m(ts)i(in)d(the)h(arra)m(y)-8 b(.)43 b(If)30 +b Fr(parameter)38 b Fu(is)31 b(an)f(indexed)630 1559 +y(arra)m(y)37 b(name)g(subscripted)f(b)m(y)h(a)g(negativ)m(e)i(n)m(um)m +(b)s(er,)f(that)f(n)m(um)m(b)s(er)f(is)g(in)m(terpreted)i(as)630 +1669 y(relativ)m(e)47 b(to)g(one)e(greater)i(than)e(the)h(maxim)m(um)f +(index)g(of)g Fr(parameter)p Fu(,)50 b(so)c(negativ)m(e)630 +1778 y(indices)30 b(coun)m(t)h(bac)m(k)g(from)f(the)h(end)e(of)i(the)f +(arra)m(y)-8 b(,)32 b(and)e(an)g(index)g(of)g(-1)h(references)g(the)630 +1888 y(last)g(elemen)m(t.)150 2052 y Ft(${)p Fj(parameter)p +Ft(#)p Fj(word)p Ft(})150 2162 y(${)p Fj(parameter)p +Ft(##)p Fj(word)p Ft(})630 2271 y Fu(The)g Fr(w)m(ord)k +Fu(is)d(expanded)f(to)i(pro)s(duce)e(a)h(pattern)g(just)f(as)i(in)e +(\014lename)h(expansion)g(\(see)630 2381 y(Section)k(3.5.8)h([Filename) +g(Expansion],)g(page)f(30\).)56 b(If)35 b(the)h(pattern)f(matc)m(hes)i +(the)e(b)s(e-)630 2491 y(ginning)28 b(of)g(the)h(expanded)e(v)-5 +b(alue)29 b(of)f Fr(parameter)p Fu(,)h(then)f(the)g(result)g(of)h(the)f +(expansion)g(is)630 2600 y(the)36 b(expanded)f(v)-5 b(alue)36 +b(of)g Fr(parameter)43 b Fu(with)35 b(the)h(shortest)g(matc)m(hing)h +(pattern)f(\(the)g(`)p Ft(#)p Fu(')630 2710 y(case\))26 +b(or)f(the)g(longest)g(matc)m(hing)h(pattern)f(\(the)g(`)p +Ft(##)p Fu(')g(case\))h(deleted.)39 b(If)24 b Fr(parameter)32 +b Fu(is)25 b(`)p Ft(@)p Fu(')630 2819 y(or)j(`)p Ft(*)p +Fu(',)i(the)e(pattern)h(remo)m(v)-5 b(al)29 b(op)s(eration)g(is)f +(applied)h(to)g(eac)m(h)g(p)s(ositional)g(parameter)g(in)630 +2929 y(turn,)i(and)g(the)h(expansion)g(is)g(the)g(resultan)m(t)g(list.) +45 b(If)32 b Fr(parameter)38 b Fu(is)32 b(an)g(arra)m(y)g(v)-5 +b(ariable)630 3039 y(subscripted)39 b(with)g(`)p Ft(@)p +Fu(')h(or)g(`)p Ft(*)p Fu(',)j(the)d(pattern)h(remo)m(v)-5 +b(al)41 b(op)s(eration)f(is)g(applied)g(to)h(eac)m(h)630 +3148 y(mem)m(b)s(er)30 b(of)g(the)h(arra)m(y)g(in)f(turn,)f(and)h(the)h +(expansion)f(is)g(the)h(resultan)m(t)g(list.)150 3313 +y Ft(${)p Fj(parameter)p Ft(\045)p Fj(word)p Ft(})150 +3422 y(${)p Fj(parameter)p Ft(\045\045)p Fj(word)p Ft(})630 +3532 y Fu(The)k Fr(w)m(ord)k Fu(is)c(expanded)g(to)h(pro)s(duce)e(a)i +(pattern)f(just)g(as)h(in)f(\014lename)h(expansion.)55 +b(If)630 3641 y(the)43 b(pattern)g(matc)m(hes)h(a)g(trailing)g(p)s +(ortion)e(of)h(the)g(expanded)g(v)-5 b(alue)43 b(of)g +Fr(parameter)p Fu(,)630 3751 y(then)c(the)g(result)g(of)h(the)f +(expansion)g(is)h(the)f(v)-5 b(alue)40 b(of)f Fr(parameter)46 +b Fu(with)39 b(the)h(shortest)630 3861 y(matc)m(hing)31 +b(pattern)e(\(the)h(`)p Ft(\045)p Fu(')g(case\))h(or)e(the)h(longest)h +(matc)m(hing)f(pattern)g(\(the)g(`)p Ft(\045\045)p Fu(')g(case\))630 +3970 y(deleted.)49 b(If)32 b Fr(parameter)40 b Fu(is)33 +b(`)p Ft(@)p Fu(')g(or)g(`)p Ft(*)p Fu(',)h(the)f(pattern)g(remo)m(v)-5 +b(al)34 b(op)s(eration)g(is)f(applied)f(to)630 4080 y(eac)m(h)38 +b(p)s(ositional)g(parameter)g(in)f(turn,)h(and)e(the)h(expansion)g(is)h +(the)f(resultan)m(t)h(list.)61 b(If)630 4189 y Fr(parameter)38 +b Fu(is)32 b(an)f(arra)m(y)h(v)-5 b(ariable)32 b(subscripted)e(with)h +(`)p Ft(@)p Fu(')g(or)h(`)p Ft(*)p Fu(',)g(the)f(pattern)h(remo)m(v)-5 +b(al)630 4299 y(op)s(eration)30 b(is)g(applied)f(to)i(eac)m(h)g(mem)m +(b)s(er)e(of)h(the)g(arra)m(y)g(in)f(turn,)g(and)g(the)h(expansion)g +(is)630 4408 y(the)h(resultan)m(t)g(list.)150 4573 y +Ft(${)p Fj(parameter)p Ft(/)p Fj(pattern)p Ft(/)p Fj(stri)o(ng)p +Ft(})630 4682 y Fu(The)37 b Fr(pattern)g Fu(is)g(expanded)g(to)h(pro)s +(duce)e(a)h(pattern)g(just)g(as)h(in)e(\014lename)i(expansion.)630 +4792 y Fr(P)m(arameter)46 b Fu(is)38 b(expanded)f(and)g(the)i(longest)g +(matc)m(h)g(of)f Fr(pattern)g Fu(against)h(its)f(v)-5 +b(alue)39 b(is)630 4902 y(replaced)34 b(with)e Fr(string)p +Fu(.)49 b(If)33 b Fr(pattern)g Fu(b)s(egins)g(with)f(`)p +Ft(/)p Fu(',)j(all)f(matc)m(hes)g(of)f Fr(pattern)g Fu(are)h(re-)630 +5011 y(placed)28 b(with)f Fr(string)p Fu(.)40 b(Normally)28 +b(only)f(the)h(\014rst)e(matc)m(h)j(is)e(replaced.)40 +b(If)27 b Fr(pattern)g Fu(b)s(egins)630 5121 y(with)34 +b(`)p Ft(#)p Fu(',)h(it)g(m)m(ust)f(matc)m(h)h(at)f(the)h(b)s(eginning) +e(of)h(the)g(expanded)f(v)-5 b(alue)35 b(of)f Fr(parameter)p +Fu(.)630 5230 y(If)g Fr(pattern)g Fu(b)s(egins)g(with)g(`)p +Ft(\045)p Fu(',)h(it)g(m)m(ust)f(matc)m(h)h(at)g(the)f(end)g(of)g(the)h +(expanded)e(v)-5 b(alue)35 b(of)630 5340 y Fr(parameter)p +Fu(.)41 b(If)29 b Fr(string)37 b Fu(is)29 b(n)m(ull,)h(matc)m(hes)h(of) +e Fr(pattern)h Fu(are)g(deleted)g(and)f(the)g Ft(/)g +Fu(follo)m(wing)p eop end +%%Page: 28 34 +TeXDict begin 28 33 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(28)630 299 +y Fr(pattern)34 b Fu(ma)m(y)g(b)s(e)f(omitted.)51 b(If)33 +b Fr(parameter)41 b Fu(is)33 b(`)p Ft(@)p Fu(')h(or)g(`)p +Ft(*)p Fu(',)g(the)g(substitution)f(op)s(eration)630 +408 y(is)38 b(applied)g(to)g(eac)m(h)h(p)s(ositional)g(parameter)f(in)g +(turn,)h(and)e(the)h(expansion)g(is)g(the)g(re-)630 518 +y(sultan)m(t)f(list.)59 b(If)36 b Fr(parameter)43 b Fu(is)36 +b(an)g(arra)m(y)h(v)-5 b(ariable)37 b(subscripted)e(with)h(`)p +Ft(@)p Fu(')g(or)h(`)p Ft(*)p Fu(',)h(the)630 628 y(substitution)30 +b(op)s(eration)h(is)f(applied)g(to)h(eac)m(h)g(mem)m(b)s(er)f(of)g(the) +h(arra)m(y)g(in)f(turn,)f(and)h(the)630 737 y(expansion)g(is)h(the)f +(resultan)m(t)h(list.)150 931 y Ft(${)p Fj(parameter)p +Ft(^)p Fj(pattern)p Ft(})150 1040 y(${)p Fj(parameter)p +Ft(^^)p Fj(pattern)p Ft(})150 1150 y(${)p Fj(parameter)p +Ft(,)p Fj(pattern)p Ft(})150 1259 y(${)p Fj(parameter)p +Ft(,,)p Fj(pattern)p Ft(})630 1369 y Fu(This)36 b(expansion)g(mo)s +(di\014es)g(the)g(case)i(of)f(alphab)s(etic)g(c)m(haracters)h(in)e +Fr(parameter)p Fu(.)59 b(The)630 1479 y Fr(pattern)33 +b Fu(is)g(expanded)e(to)j(pro)s(duce)d(a)j(pattern)e(just)g(as)h(in)g +(\014lename)g(expansion.)47 b(Eac)m(h)630 1588 y(c)m(haracter)32 +b(in)e(the)g(expanded)f(v)-5 b(alue)31 b(of)f Fr(parameter)37 +b Fu(is)30 b(tested)h(against)h Fr(pattern)p Fu(,)e(and,)g(if)630 +1698 y(it)j(matc)m(hes)h(the)g(pattern,)f(its)h(case)g(is)f(con)m(v)m +(erted.)49 b(The)33 b(pattern)g(should)f(not)h(attempt)630 +1807 y(to)f(matc)m(h)g(more)f(than)g(one)g(c)m(haracter.)44 +b(The)30 b(`)p Ft(^)p Fu(')i(op)s(erator)f(con)m(v)m(erts)h(lo)m(w)m +(ercase)i(letters)630 1917 y(matc)m(hing)i Fr(pattern)f +Fu(to)h(upp)s(ercase;)h(the)e(`)p Ft(,)p Fu(')g(op)s(erator)g(con)m(v)m +(erts)i(matc)m(hing)f(upp)s(ercase)630 2027 y(letters)e(to)f(lo)m(w)m +(ercase.)50 b(The)32 b(`)p Ft(^^)p Fu(')h(and)f(`)p Ft(,,)p +Fu(')g(expansions)h(con)m(v)m(ert)h(eac)m(h)g(matc)m(hed)f(c)m(har-)630 +2136 y(acter)c(in)f(the)h(expanded)e(v)-5 b(alue;)30 +b(the)e(`)p Ft(^)p Fu(')g(and)g(`)p Ft(,)p Fu(')g(expansions)g(matc)m +(h)h(and)f(con)m(v)m(ert)i(only)630 2246 y(the)37 b(\014rst)g(c)m +(haracter)i(in)e(the)g(expanded)g(v)-5 b(alue.)61 b(If)37 +b Fr(pattern)g Fu(is)h(omitted,)i(it)e(is)f(treated)630 +2355 y(lik)m(e)h(a)f(`)p Ft(?)p Fu(',)i(whic)m(h)d(matc)m(hes)i(ev)m +(ery)f(c)m(haracter.)61 b(If)37 b Fr(parameter)43 b Fu(is)37 +b(`)p Ft(@)p Fu(')g(or)f(`)p Ft(*)p Fu(',)j(the)e(case)630 +2465 y(mo)s(di\014cation)29 b(op)s(eration)f(is)g(applied)g(to)h(eac)m +(h)h(p)s(ositional)f(parameter)f(in)g(turn,)g(and)g(the)630 +2575 y(expansion)38 b(is)g(the)g(resultan)m(t)h(list.)65 +b(If)37 b Fr(parameter)46 b Fu(is)38 b(an)g(arra)m(y)g(v)-5 +b(ariable)39 b(subscripted)630 2684 y(with)26 b(`)p Ft(@)p +Fu(')f(or)h(`)p Ft(*)p Fu(',)h(the)f(case)h(mo)s(di\014cation)f(op)s +(eration)h(is)e(applied)h(to)h(eac)m(h)g(mem)m(b)s(er)e(of)h(the)630 +2794 y(arra)m(y)31 b(in)f(turn,)f(and)h(the)h(expansion)f(is)g(the)h +(resultan)m(t)g(list.)150 3027 y Fk(3.5.4)63 b(Command)41 +b(Substitution)150 3174 y Fu(Command)f(substitution)h(allo)m(ws)i(the)e +(output)g(of)h(a)f(command)g(to)h(replace)g(the)g(command)f(itself.)150 +3284 y(Command)29 b(substitution)h(o)s(ccurs)h(when)e(a)i(command)f(is) +g(enclosed)h(as)g(follo)m(ws:)390 3452 y Ft($\()p Fj(command)p +Ft(\))150 3621 y Fu(or)390 3789 y Ft(`)p Fj(command)p +Ft(`)150 3958 y Fu(Bash)45 b(p)s(erforms)f(the)h(expansion)f(b)m(y)h +(executing)i Fr(command)h Fu(and)c(replacing)i(the)f(command)g(sub-)150 +4067 y(stitution)c(with)f(the)g(standard)g(output)g(of)g(the)g +(command,)j(with)d(an)m(y)h(trailing)g(newlines)f(deleted.)150 +4177 y(Em)m(b)s(edded)30 b(newlines)h(are)h(not)f(deleted,)i(but)e +(they)g(ma)m(y)h(b)s(e)f(remo)m(v)m(ed)i(during)d(w)m(ord)h(splitting.) +44 b(The)150 4286 y(command)23 b(substitution)g Ft($\(cat)29 +b Fj(file)p Ft(\))22 b Fu(can)i(b)s(e)f(replaced)g(b)m(y)h(the)f(equiv) +-5 b(alen)m(t)25 b(but)e(faster)h Ft($\(<)29 b Fj(file)p +Ft(\))p Fu(.)275 4455 y(When)k(the)i(old-st)m(yle)h(bac)m(kquote)f +(form)f(of)g(substitution)g(is)g(used,)h(bac)m(kslash)f(retains)h(its)f +(literal)150 4565 y(meaning)k(except)h(when)e(follo)m(w)m(ed)j(b)m(y)e +(`)p Ft($)p Fu(',)j(`)p Ft(`)p Fu(',)f(or)e(`)p Ft(\\)p +Fu('.)64 b(The)38 b(\014rst)f(bac)m(kquote)j(not)e(preceded)g(b)m(y)g +(a)150 4674 y(bac)m(kslash)k(terminates)f(the)h(command)e +(substitution.)72 b(When)41 b(using)f(the)i Ft($\()p +Fj(command)p Ft(\))c Fu(form,)43 b(all)150 4784 y(c)m(haracters)32 +b(b)s(et)m(w)m(een)f(the)f(paren)m(theses)h(mak)m(e)g(up)f(the)g +(command;)h(none)f(are)h(treated)g(sp)s(ecially)-8 b(.)275 +4952 y(Command)22 b(substitutions)g(ma)m(y)i(b)s(e)e(nested.)39 +b(T)-8 b(o)23 b(nest)g(when)f(using)h(the)g(bac)m(kquoted)h(form,)g +(escap)s(e)150 5062 y(the)31 b(inner)e(bac)m(kquotes)j(with)e(bac)m +(kslashes.)275 5230 y(If)e(the)i(substitution)e(app)s(ears)h(within)g +(double)f(quotes,)i(w)m(ord)f(splitting)h(and)f(\014lename)g(expansion) +150 5340 y(are)i(not)f(p)s(erformed)f(on)h(the)h(results.)p +eop end +%%Page: 29 35 +TeXDict begin 29 34 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(29)150 299 +y Fk(3.5.5)63 b(Arithmetic)40 b(Expansion)150 446 y Fu(Arithmetic)25 +b(expansion)g(allo)m(ws)g(the)g(ev)-5 b(aluation)26 b(of)f(an)f +(arithmetic)i(expression)e(and)g(the)g(substitution)150 +555 y(of)31 b(the)f(result.)41 b(The)30 b(format)g(for)g(arithmetic)i +(expansion)e(is:)390 691 y Ft($\(\()47 b Fj(expression)e +Ft(\)\))275 826 y Fu(The)33 b(expression)g(is)h(treated)g(as)g(if)g(it) +g(w)m(ere)g(within)f(double)h(quotes,)h(but)e(a)h(double)f(quote)h +(inside)150 935 y(the)k(paren)m(theses)g(is)g(not)g(treated)h(sp)s +(ecially)-8 b(.)65 b(All)38 b(tok)m(ens)h(in)f(the)g(expression)f +(undergo)g(parameter)150 1045 y(and)26 b(v)-5 b(ariable)28 +b(expansion,)g(command)e(substitution,)i(and)e(quote)i(remo)m(v)-5 +b(al.)41 b(The)26 b(result)h(is)g(treated)h(as)150 1154 +y(the)j(arithmetic)g(expression)f(to)h(b)s(e)f(ev)-5 +b(aluated.)42 b(Arithmetic)31 b(expansions)g(ma)m(y)g(b)s(e)e(nested.) +275 1290 y(The)34 b(ev)-5 b(aluation)37 b(is)f(p)s(erformed)e +(according)i(to)g(the)g(rules)f(listed)h(b)s(elo)m(w)g(\(see)g(Section) +g(6.5)h([Shell)150 1399 y(Arithmetic],)32 b(page)f(87\).)42 +b(If)30 b(the)h(expression)f(is)g(in)m(v)-5 b(alid,)32 +b(Bash)e(prin)m(ts)g(a)h(message)g(indicating)h(failure)150 +1509 y(to)f(the)g(standard)e(error)h(and)g(no)g(substitution)g(o)s +(ccurs.)150 1709 y Fk(3.5.6)63 b(Pro)s(cess)42 b(Substitution)150 +1856 y Fu(Pro)s(cess)i(substitution)g(is)g(supp)s(orted)f(on)h(systems) +g(that)h(supp)s(ort)d(named)i(pip)s(es)f(\()p Fm(fif)n(o)p +Fu(s\))i(or)f(the)150 1965 y Ft(/dev/fd)28 b Fu(metho)s(d)i(of)h +(naming)f(op)s(en)g(\014les.)40 b(It)31 b(tak)m(es)h(the)e(form)g(of) +390 2100 y Ft(<\()p Fj(list)p Ft(\))150 2235 y Fu(or)390 +2370 y Ft(>\()p Fj(list)p Ft(\))150 2506 y Fu(The)c(pro)s(cess)f +Fr(list)k Fu(is)e(run)d(with)i(its)h(input)e(or)h(output)g(connected)h +(to)g(a)g Fm(fif)n(o)f Fu(or)g(some)g(\014le)h(in)f Ft(/dev/fd)p +Fu(.)150 2615 y(The)i(name)h(of)g(this)f(\014le)h(is)g(passed)f(as)h +(an)f(argumen)m(t)h(to)h(the)f(curren)m(t)f(command)h(as)f(the)h +(result)g(of)g(the)150 2725 y(expansion.)40 b(If)29 b(the)g +Ft(>\()p Fj(list)p Ft(\))f Fu(form)g(is)i(used,)f(writing)g(to)h(the)f +(\014le)h(will)f(pro)m(vide)h(input)e(for)h Fr(list)p +Fu(.)41 b(If)29 b(the)150 2834 y Ft(<\()p Fj(list)p Ft(\))24 +b Fu(form)h(is)h(used,)g(the)g(\014le)g(passed)g(as)g(an)f(argumen)m(t) +i(should)e(b)s(e)g(read)g(to)i(obtain)f(the)g(output)g(of)150 +2944 y Fr(list)p Fu(.)41 b(Note)31 b(that)f(no)g(space)g(ma)m(y)g(app)s +(ear)f(b)s(et)m(w)m(een)h(the)g Ft(<)f Fu(or)h Ft(>)f +Fu(and)g(the)h(left)g(paren)m(thesis,)h(otherwise)150 +3054 y(the)g(construct)f(w)m(ould)g(b)s(e)g(in)m(terpreted)h(as)f(a)h +(redirection.)275 3189 y(When)36 b(a)m(v)-5 b(ailable,)40 +b(pro)s(cess)c(substitution)h(is)f(p)s(erformed)f(sim)m(ultaneously)i +(with)g(parameter)g(and)150 3298 y(v)-5 b(ariable)31 +b(expansion,)g(command)f(substitution,)g(and)g(arithmetic)i(expansion.) +150 3498 y Fk(3.5.7)63 b(W)-10 b(ord)41 b(Splitting)150 +3645 y Fu(The)30 b(shell)h(scans)g(the)g(results)f(of)h(parameter)g +(expansion,)g(command)g(substitution,)g(and)f(arithmetic)150 +3755 y(expansion)g(that)h(did)f(not)g(o)s(ccur)h(within)e(double)h +(quotes)h(for)f(w)m(ord)g(splitting.)275 3890 y(The)e(shell)g(treats)i +(eac)m(h)g(c)m(haracter)g(of)f Ft($IFS)e Fu(as)i(a)g(delimiter,)h(and)e +(splits)g(the)h(results)f(of)h(the)g(other)150 3999 y(expansions)22 +b(in)m(to)i(w)m(ords)e(using)h(these)g(c)m(haracters)h(as)f(\014eld)f +(terminators.)39 b(If)22 b Ft(IFS)g Fu(is)h(unset,)h(or)e(its)h(v)-5 +b(alue)150 4109 y(is)36 b(exactly)j Ft()p +Fu(,)32 b(the)37 b(default,)h(then)e(sequences)h(of)67 +b Ft()p Fu(,)36 b Ft()p Fu(,)h(and)150 4219 +y Ft()28 b Fu(at)k(the)f(b)s(eginning)f(and)h(end)f(of)h(the)g +(results)g(of)g(the)g(previous)g(expansions)f(are)i(ignored,)150 +4328 y(and)k(an)m(y)h(sequence)h(of)f Ft(IFS)f Fu(c)m(haracters)i(not)f +(at)h(the)f(b)s(eginning)f(or)h(end)f(serv)m(es)h(to)h(delimit)f(w)m +(ords.)150 4438 y(If)43 b Ft(IFS)f Fu(has)h(a)h(v)-5 +b(alue)43 b(other)h(than)f(the)g(default,)k(then)c(sequences)h(of)f +(the)h(whitespace)f(c)m(haracters)150 4547 y Ft(space)26 +b Fu(and)h Ft(tab)g Fu(are)h(ignored)g(at)h(the)f(b)s(eginning)f(and)g +(end)g(of)h(the)g(w)m(ord,)g(as)g(long)g(as)g(the)g(whitespace)150 +4657 y(c)m(haracter)34 b(is)f(in)f(the)h(v)-5 b(alue)33 +b(of)f Ft(IFS)g Fu(\(an)h Ft(IFS)e Fu(whitespace)j(c)m(haracter\).)49 +b(An)m(y)32 b(c)m(haracter)i(in)f Ft(IFS)e Fu(that)150 +4767 y(is)f(not)h Ft(IFS)f Fu(whitespace,)h(along)g(with)f(an)m(y)h +(adjacen)m(t)h Ft(IFS)d Fu(whitespace)i(c)m(haracters,)h(delimits)f(a)g +(\014eld.)150 4876 y(A)h(sequence)h(of)f Ft(IFS)f Fu(whitespace)i(c)m +(haracters)h(is)e(also)h(treated)g(as)g(a)f(delimiter.)47 +b(If)32 b(the)g(v)-5 b(alue)33 b(of)f Ft(IFS)150 4986 +y Fu(is)e(n)m(ull,)h(no)f(w)m(ord)g(splitting)h(o)s(ccurs.)275 +5121 y(Explicit)44 b(n)m(ull)f(argumen)m(ts)g(\()p Ft("")g +Fu(or)h Ft('')p Fu(\))f(are)g(retained.)80 b(Unquoted)43 +b(implicit)h(n)m(ull)f(argumen)m(ts,)150 5230 y(resulting)24 +b(from)f(the)g(expansion)g(of)h(parameters)g(that)g(ha)m(v)m(e)h(no)e +(v)-5 b(alues,)25 b(are)f(remo)m(v)m(ed.)40 b(If)23 b(a)g(parameter)150 +5340 y(with)30 b(no)g(v)-5 b(alue)31 b(is)g(expanded)e(within)h(double) +g(quotes,)h(a)g(n)m(ull)f(argumen)m(t)h(results)f(and)g(is)g(retained.) +p eop end +%%Page: 30 36 +TeXDict begin 30 35 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(30)275 299 +y(Note)31 b(that)g(if)g(no)f(expansion)g(o)s(ccurs,)g(no)h(splitting)g +(is)f(p)s(erformed.)150 503 y Fk(3.5.8)63 b(Filename)41 +b(Expansion)150 650 y Fu(After)30 b(w)m(ord)f(splitting,)i(unless)d +(the)i Ft(-f)f Fu(option)h(has)f(b)s(een)g(set)h(\(see)g(Section)h +(4.3.1)g([The)e(Set)h(Builtin],)150 759 y(page)d(58\),)i(Bash)d(scans)h +(eac)m(h)h(w)m(ord)e(for)g(the)h(c)m(haracters)g(`)p +Ft(*)p Fu(',)h(`)p Ft(?)p Fu(',)g(and)e(`)p Ft([)p Fu('.)39 +b(If)26 b(one)h(of)g(these)f(c)m(haracters)150 869 y(app)s(ears,)h +(then)f(the)h(w)m(ord)f(is)h(regarded)g(as)g(a)g Fr(pattern)p +Fu(,)g(and)g(replaced)g(with)f(an)h(alphab)s(etically)h(sorted)150 +979 y(list)k(of)f(\014lenames)g(matc)m(hing)h(the)f(pattern)g(\(see)h +(Section)f(3.5.8.1)j([P)m(attern)e(Matc)m(hing],)h(page)f(30\).)43 +b(If)150 1088 y(no)26 b(matc)m(hing)i(\014lenames)e(are)h(found,)f(and) +g(the)h(shell)f(option)h Ft(nullglob)d Fu(is)j(disabled,)g(the)g(w)m +(ord)f(is)g(left)150 1198 y(unc)m(hanged.)40 b(If)30 +b(the)g Ft(nullglob)e Fu(option)i(is)h(set,)f(and)g(no)g(matc)m(hes)h +(are)g(found,)e(the)h(w)m(ord)g(is)g(remo)m(v)m(ed.)150 +1307 y(If)i(the)g Ft(failglob)e Fu(shell)i(option)h(is)f(set,)h(and)f +(no)g(matc)m(hes)h(are)g(found,)e(an)h(error)g(message)h(is)f(prin)m +(ted)150 1417 y(and)e(the)g(command)g(is)h(not)f(executed.)42 +b(If)30 b(the)g(shell)h(option)g Ft(nocaseglob)c Fu(is)k(enabled,)f +(the)h(matc)m(h)g(is)150 1527 y(p)s(erformed)e(without)h(regard)h(to)g +(the)f(case)i(of)e(alphab)s(etic)h(c)m(haracters.)275 +1666 y(When)23 b(a)h(pattern)f(is)h(used)f(for)g(\014lename)h +(expansion,)h(the)e(c)m(haracter)i(`)p Ft(.)p Fu(')f(at)g(the)g(start)g +(of)g(a)g(\014lename)150 1775 y(or)f(immediately)i(follo)m(wing)g(a)f +(slash)f(m)m(ust)h(b)s(e)f(matc)m(hed)h(explicitly)-8 +b(,)27 b(unless)c(the)g(shell)h(option)g Ft(dotglob)150 +1885 y Fu(is)33 b(set.)51 b(When)33 b(matc)m(hing)h(a)g(\014lename,)h +(the)e(slash)h(c)m(haracter)h(m)m(ust)e(alw)m(a)m(ys)i(b)s(e)e(matc)m +(hed)h(explicitly)-8 b(.)150 1994 y(In)30 b(other)g(cases,)i(the)e(`)p +Ft(.)p Fu(')h(c)m(haracter)h(is)e(not)h(treated)g(sp)s(ecially)-8 +b(.)275 2134 y(See)28 b(the)g(description)g(of)g Ft(shopt)e +Fu(in)i(Section)g(4.3.2)i([The)e(Shopt)f(Builtin],)i(page)g(62,)g(for)f +(a)g(descrip-)150 2243 y(tion)j(of)f(the)h Ft(nocaseglob)p +Fu(,)d Ft(nullglob)p Fu(,)g Ft(failglob)p Fu(,)h(and)g +Ft(dotglob)g Fu(options.)275 2383 y(The)j Ft(GLOBIGNORE)f +Fu(shell)i(v)-5 b(ariable)34 b(ma)m(y)g(b)s(e)f(used)f(to)i(restrict)g +(the)g(set)f(of)h(\014lenames)f(matc)m(hing)i(a)150 2492 +y(pattern.)k(If)25 b Ft(GLOBIGNORE)e Fu(is)j(set,)h(eac)m(h)g(matc)m +(hing)g(\014lename)f(that)g(also)h(matc)m(hes)f(one)g(of)g(the)g +(patterns)150 2602 y(in)39 b Ft(GLOBIGNORE)d Fu(is)j(remo)m(v)m(ed)h +(from)e(the)h(list)h(of)f(matc)m(hes.)67 b(The)39 b(\014lenames)g +Ft(.)f Fu(and)h Ft(..)f Fu(are)h(alw)m(a)m(ys)150 2711 +y(ignored)33 b(when)e Ft(GLOBIGNORE)f Fu(is)j(set)g(and)f(not)h(n)m +(ull.)48 b(Ho)m(w)m(ev)m(er,)35 b(setting)f Ft(GLOBIGNORE)c +Fu(to)j(a)g(non-n)m(ull)150 2821 y(v)-5 b(alue)34 b(has)f(the)h +(e\013ect)h(of)f(enabling)g(the)g Ft(dotglob)e Fu(shell)h(option,)j(so) +e(all)g(other)g(\014lenames)g(b)s(eginning)150 2930 y(with)43 +b(a)h(`)p Ft(.)p Fu(')f(will)h(matc)m(h.)80 b(T)-8 b(o)44 +b(get)h(the)e(old)h(b)s(eha)m(vior)f(of)h(ignoring)f(\014lenames)h(b)s +(eginning)f(with)g(a)150 3040 y(`)p Ft(.)p Fu(',)c(mak)m(e)g(`)p +Ft(.*)p Fu(')e(one)g(of)g(the)h(patterns)f(in)g Ft(GLOBIGNORE)p +Fu(.)58 b(The)37 b Ft(dotglob)e Fu(option)j(is)f(disabled)g(when)150 +3150 y Ft(GLOBIGNORE)28 b Fu(is)i(unset.)150 3354 y Fk(3.5.8.1)63 +b(P)m(attern)40 b(Matc)m(hing)150 3501 y Fu(An)m(y)24 +b(c)m(haracter)h(that)f(app)s(ears)f(in)g(a)h(pattern,)i(other)e(than)f +(the)h(sp)s(ecial)g(pattern)g(c)m(haracters)h(describ)s(ed)150 +3610 y(b)s(elo)m(w,)31 b(matc)m(hes)g(itself.)42 b(The)29 +b Fm(nul)h Fu(c)m(haracter)i(ma)m(y)e(not)h(o)s(ccur)f(in)g(a)h +(pattern.)40 b(A)31 b(bac)m(kslash)g(escap)s(es)150 3720 +y(the)38 b(follo)m(wing)g(c)m(haracter;)43 b(the)37 b(escaping)i(bac)m +(kslash)e(is)h(discarded)f(when)f(matc)m(hing.)63 b(The)36 +b(sp)s(ecial)150 3829 y(pattern)30 b(c)m(haracters)i(m)m(ust)f(b)s(e)e +(quoted)i(if)f(they)h(are)f(to)i(b)s(e)d(matc)m(hed)i(literally)-8 +b(.)275 3969 y(The)29 b(sp)s(ecial)i(pattern)g(c)m(haracters)h(ha)m(v)m +(e)f(the)g(follo)m(wing)h(meanings:)150 4135 y Ft(*)432 +b Fu(Matc)m(hes)31 b(an)m(y)e(string,)h(including)f(the)g(n)m(ull)g +(string.)41 b(When)29 b(the)g Ft(globstar)e Fu(shell)i(option)630 +4245 y(is)37 b(enabled,)h(and)e(`)p Ft(*)p Fu(')h(is)g(used)f(in)g(a)h +(\014lename)g(expansion)g(con)m(text,)j(t)m(w)m(o)e(adjacen)m(t)g(`)p +Ft(*)p Fu('s)630 4354 y(used)f(as)g(a)h(single)g(pattern)g(will)f(matc) +m(h)i(all)f(\014les)f(and)g(zero)h(or)g(more)f(directories)i(and)630 +4464 y(sub)s(directories.)g(If)25 b(follo)m(w)m(ed)j(b)m(y)e(a)g(`)p +Ft(/)p Fu(',)h(t)m(w)m(o)g(adjacen)m(t)h(`)p Ft(*)p Fu('s)e(will)g +(matc)m(h)h(only)f(directories)630 4573 y(and)k(sub)s(directories.)150 +4737 y Ft(?)432 b Fu(Matc)m(hes)32 b(an)m(y)f(single)g(c)m(haracter.) +150 4902 y Ft([...)o(])241 b Fu(Matc)m(hes)27 b(an)m(y)e(one)g(of)g +(the)g(enclosed)g(c)m(haracters.)41 b(A)25 b(pair)f(of)h(c)m(haracters) +i(separated)e(b)m(y)g(a)630 5011 y(h)m(yphen)k(denotes)i(a)g +Fr(range)g(expression)p Fu(;)f(an)m(y)h(c)m(haracter)h(that)f(falls)g +(b)s(et)m(w)m(een)g(those)g(t)m(w)m(o)630 5121 y(c)m(haracters,)d +(inclusiv)m(e,)f(using)d(the)h(curren)m(t)f(lo)s(cale's)j(collating)g +(sequence)e(and)f(c)m(haracter)630 5230 y(set,)31 b(is)f(matc)m(hed.)42 +b(If)30 b(the)g(\014rst)g(c)m(haracter)i(follo)m(wing)g(the)e(`)p +Ft([)p Fu(')h(is)f(a)h(`)p Ft(!)p Fu(')f(or)g(a)h(`)p +Ft(^)p Fu(')g(then)f(an)m(y)630 5340 y(c)m(haracter)c(not)f(enclosed)g +(is)g(matc)m(hed.)40 b(A)25 b(`)p Fq(\000)p Fu(')f(ma)m(y)i(b)s(e)e +(matc)m(hed)h(b)m(y)f(including)h(it)g(as)g(the)p eop +end +%%Page: 31 37 +TeXDict begin 31 36 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(31)630 299 +y(\014rst)32 b(or)h(last)h(c)m(haracter)h(in)e(the)g(set.)50 +b(A)33 b(`)p Ft(])p Fu(')g(ma)m(y)h(b)s(e)e(matc)m(hed)i(b)m(y)f +(including)g(it)g(as)h(the)630 408 y(\014rst)25 b(c)m(haracter)i(in)e +(the)h(set.)40 b(The)25 b(sorting)h(order)f(of)h(c)m(haracters)h(in)f +(range)g(expressions)f(is)630 518 y(determined)h(b)m(y)h(the)g(curren)m +(t)f(lo)s(cale)j(and)d(the)h(v)-5 b(alues)27 b(of)g(the)g +Ft(LC_COLLATE)d Fu(and)i Ft(LC_ALL)630 628 y Fu(shell)31 +b(v)-5 b(ariables,)31 b(if)f(set.)630 758 y(F)-8 b(or)34 +b(example,)g(in)f(the)g(default)g(C)f(lo)s(cale,)k(`)p +Ft([a-dx-z])p Fu(')31 b(is)i(equiv)-5 b(alen)m(t)34 b(to)g(`)p +Ft([abcdxyz])p Fu('.)630 868 y(Man)m(y)68 b(lo)s(cales)h(sort)f(c)m +(haracters)h(in)e(dictionary)i(order,)76 b(and)67 b(in)g(these)h(lo)s +(cales)630 977 y(`)p Ft([a-dx-z])p Fu(')36 b(is)i(t)m(ypically)i(not)e +(equiv)-5 b(alen)m(t)39 b(to)g(`)p Ft([abcdxyz])p Fu(';)g(it)g(migh)m +(t)f(b)s(e)f(equiv)-5 b(alen)m(t)630 1087 y(to)34 b(`)p +Ft([aBbCcDdxXyYz])p Fu(',)c(for)j(example.)49 b(T)-8 +b(o)33 b(obtain)h(the)f(traditional)h(in)m(terpretation)h(of)630 +1196 y(ranges)e(in)f(brac)m(k)m(et)i(expressions,)g(y)m(ou)f(can)g +(force)g(the)g(use)f(of)h(the)g(C)f(lo)s(cale)i(b)m(y)f(setting)630 +1306 y(the)c Ft(LC_COLLATE)e Fu(or)i Ft(LC_ALL)f Fu(en)m(vironmen)m(t)i +(v)-5 b(ariable)30 b(to)g(the)f(v)-5 b(alue)30 b(`)p +Ft(C)p Fu(',)g(or)f(enable)h(the)630 1416 y Ft(globasciiranges)c +Fu(shell)31 b(option.)630 1546 y(Within)23 b(`)p Ft([)p +Fu(')h(and)e(`)p Ft(])p Fu(',)j Fr(c)m(haracter)g(classes)j +Fu(can)c(b)s(e)e(sp)s(eci\014ed)h(using)f(the)i(syn)m(tax)f +Ft([:)p Fr(class)t Ft(:])p Fu(,)630 1656 y(where)30 b +Fr(class)35 b Fu(is)30 b(one)h(of)f(the)h(follo)m(wing)h(classes)f +(de\014ned)e(in)h(the)h Fm(posix)f Fu(standard:)870 1786 +y Ft(alnum)142 b(alpha)g(ascii)f(blank)h(cntrl)g(digit)g(graph)g(lower) +870 1896 y(print)g(punct)g(space)f(upper)h(word)190 b(xdigit)630 +2026 y Fu(A)42 b(c)m(haracter)h(class)f(matc)m(hes)h(an)m(y)f(c)m +(haracter)h(b)s(elonging)f(to)g(that)g(class.)75 b(The)41 +b Ft(word)630 2135 y Fu(c)m(haracter)32 b(class)f(matc)m(hes)h +(letters,)f(digits,)h(and)d(the)i(c)m(haracter)h(`)p +Ft(_)p Fu('.)630 2266 y(Within)25 b(`)p Ft([)p Fu(')f(and)g(`)p +Ft(])p Fu(',)i(an)e Fr(equiv)-5 b(alence)26 b(class)j +Fu(can)24 b(b)s(e)g(sp)s(eci\014ed)g(using)g(the)g(syn)m(tax)h +Ft([=)p Fr(c)6 b Ft(=])p Fu(,)630 2375 y(whic)m(h)29 +b(matc)m(hes)i(all)f(c)m(haracters)h(with)e(the)h(same)g(collation)h(w) +m(eigh)m(t)g(\(as)f(de\014ned)e(b)m(y)i(the)630 2485 +y(curren)m(t)g(lo)s(cale\))j(as)d(the)h(c)m(haracter)h +Fr(c)p Fu(.)630 2615 y(Within)22 b(`)p Ft([)p Fu(')f(and)g(`)p +Ft(])p Fu(',)j(the)d(syn)m(tax)h Ft([.)p Fr(sym)m(b)s(ol)t +Ft(.])e Fu(matc)m(hes)i(the)g(collating)i(sym)m(b)s(ol)d +Fr(sym)m(b)s(ol)p Fu(.)275 2767 y(If)29 b(the)g Ft(extglob)f +Fu(shell)h(option)h(is)g(enabled)f(using)g(the)h Ft(shopt)e +Fu(builtin,)h(sev)m(eral)i(extended)f(pattern)150 2876 +y(matc)m(hing)37 b(op)s(erators)e(are)h(recognized.)58 +b(In)35 b(the)g(follo)m(wing)i(description,)g(a)f Fr(pattern-list)j +Fu(is)d(a)g(list)g(of)150 2986 y(one)d(or)f(more)h(patterns)f +(separated)h(b)m(y)f(a)h(`)p Ft(|)p Fu('.)47 b(Comp)s(osite)33 +b(patterns)f(ma)m(y)i(b)s(e)d(formed)h(using)g(one)h(or)150 +3095 y(more)e(of)f(the)h(follo)m(wing)g(sub-patterns:)150 +3247 y Ft(?\()p Fj(pattern-list)p Ft(\))630 3356 y Fu(Matc)m(hes)h +(zero)f(or)g(one)f(o)s(ccurrence)h(of)f(the)h(giv)m(en)g(patterns.)150 +3507 y Ft(*\()p Fj(pattern-list)p Ft(\))630 3617 y Fu(Matc)m(hes)h +(zero)f(or)g(more)f(o)s(ccurrences)h(of)f(the)h(giv)m(en)g(patterns.) +150 3768 y Ft(+\()p Fj(pattern-list)p Ft(\))630 3878 +y Fu(Matc)m(hes)h(one)f(or)f(more)h(o)s(ccurrences)f(of)h(the)f(giv)m +(en)i(patterns.)150 4029 y Ft(@\()p Fj(pattern-list)p +Ft(\))630 4138 y Fu(Matc)m(hes)g(one)f(of)f(the)h(giv)m(en)g(patterns.) +150 4290 y Ft(!\()p Fj(pattern-list)p Ft(\))630 4399 +y Fu(Matc)m(hes)h(an)m(ything)f(except)g(one)g(of)f(the)h(giv)m(en)g +(patterns.)150 4590 y Fk(3.5.9)63 b(Quote)41 b(Remo)m(v)-7 +b(al)150 4737 y Fu(After)32 b(the)g(preceding)g(expansions,)h(all)f +(unquoted)f(o)s(ccurrences)h(of)g(the)h(c)m(haracters)g(`)p +Ft(\\)p Fu(',)g(`)p Ft(')p Fu(',)f(and)g(`)p Ft(")p Fu(')150 +4847 y(that)f(did)f(not)g(result)g(from)g(one)h(of)g(the)f(ab)s(o)m(v)m +(e)i(expansions)e(are)h(remo)m(v)m(ed.)150 5071 y Fs(3.6)68 +b(Redirections)150 5230 y Fu(Before)32 b(a)f(command)f(is)h(executed,)h +(its)f(input)e(and)h(output)h(ma)m(y)g(b)s(e)f Fr(redirected)k +Fu(using)c(a)i(sp)s(ecial)f(no-)150 5340 y(tation)d(in)m(terpreted)f(b) +m(y)f(the)h(shell.)40 b(Redirection)27 b(allo)m(ws)h(commands')f +(\014le)f(handles)g(to)i(b)s(e)e(duplicated,)p eop end +%%Page: 32 38 +TeXDict begin 32 37 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(32)150 299 +y(op)s(ened,)28 b(closed,)i(made)e(to)h(refer)f(to)h(di\013eren)m(t)f +(\014les,)h(and)f(can)g(c)m(hange)h(the)g(\014les)f(the)g(command)g +(reads)150 408 y(from)39 b(and)g(writes)h(to.)69 b(Redirection)40 +b(ma)m(y)g(also)h(b)s(e)e(used)g(to)h(mo)s(dify)f(\014le)g(handles)g +(in)g(the)h(curren)m(t)150 518 y(shell)e(execution)h(en)m(vironmen)m +(t.)65 b(The)37 b(follo)m(wing)j(redirection)f(op)s(erators)f(ma)m(y)g +(precede)h(or)f(app)s(ear)150 628 y(an)m(ywhere)30 b(within)f(a)h +(simple)f(command)h(or)f(ma)m(y)i(follo)m(w)g(a)f(command.)40 +b(Redirections)30 b(are)g(pro)s(cessed)150 737 y(in)g(the)h(order)f +(they)g(app)s(ear,)g(from)g(left)h(to)g(righ)m(t.)275 +880 y(Eac)m(h)45 b(redirection)h(that)f(ma)m(y)h(b)s(e)e(preceded)g(b)m +(y)h(a)h(\014le)f(descriptor)f(n)m(um)m(b)s(er)g(ma)m(y)h(instead)h(b)s +(e)150 990 y(preceded)41 b(b)m(y)g(a)h(w)m(ord)f(of)g(the)h(form)f +Fi({)p Fr(v)-5 b(arname)5 b Fi(})p Fu(.)74 b(In)41 b(this)g(case,)k +(for)c(eac)m(h)i(redirection)f(op)s(erator)150 1100 y(except)30 +b Ft(>)p Fu(&-)f(and)f Ft(<)p Fu(&-,)h(the)g(shell)g(will)h(allo)s +(cate)h(a)e(\014le)h(descriptor)e(greater)j(than)d(10)i(and)e(assign)i +(it)f(to)150 1209 y Fi({)p Fr(v)-5 b(arname)5 b Fi(})p +Fu(.)45 b(If)31 b Ft(>)p Fu(&-)g(or)h Ft(<)p Fu(&-)f(is)h(preceded)f(b) +m(y)g Fi({)p Fr(v)-5 b(arname)5 b Fi(})p Fu(,)33 b(the)f(v)-5 +b(alue)32 b(of)g Fr(v)-5 b(arname)36 b Fu(de\014nes)31 +b(the)h(\014le)150 1319 y(descriptor)e(to)h(close.)275 +1462 y(In)c(the)i(follo)m(wing)h(descriptions,)g(if)e(the)h(\014le)g +(descriptor)f(n)m(um)m(b)s(er)g(is)g(omitted,)i(and)f(the)f(\014rst)g +(c)m(har-)150 1572 y(acter)42 b(of)f(the)g(redirection)g(op)s(erator)g +(is)g(`)p Ft(<)p Fu(',)i(the)e(redirection)g(refers)g(to)g(the)g +(standard)f(input)f(\(\014le)150 1681 y(descriptor)33 +b(0\).)49 b(If)33 b(the)g(\014rst)f(c)m(haracter)i(of)g(the)f +(redirection)g(op)s(erator)h(is)f(`)p Ft(>)p Fu(',)h(the)f(redirection) +g(refers)150 1791 y(to)e(the)g(standard)e(output)h(\(\014le)h +(descriptor)f(1\).)275 1934 y(The)h(w)m(ord)h(follo)m(wing)i(the)f +(redirection)g(op)s(erator)f(in)g(the)h(follo)m(wing)h(descriptions,)f +(unless)e(other-)150 2043 y(wise)21 b(noted,)i(is)e(sub)5 +b(jected)21 b(to)h(brace)f(expansion,)i(tilde)f(expansion,)h(parameter) +e(expansion,)i(command)150 2153 y(substitution,)31 b(arithmetic)h +(expansion,)f(quote)h(remo)m(v)-5 b(al,)33 b(\014lename)e(expansion,)g +(and)f(w)m(ord)h(splitting.)150 2263 y(If)f(it)h(expands)e(to)i(more)g +(than)f(one)h(w)m(ord,)f(Bash)h(rep)s(orts)e(an)h(error.)275 +2406 y(Note)h(that)g(the)g(order)f(of)g(redirections)h(is)g +(signi\014can)m(t.)41 b(F)-8 b(or)31 b(example,)h(the)e(command)390 +2549 y Ft(ls)47 b(>)h Fj(dirlist)d Ft(2>&1)150 2692 y +Fu(directs)28 b(b)s(oth)f(standard)g(output)g(\(\014le)h(descriptor)f +(1\))i(and)e(standard)f(error)i(\(\014le)g(descriptor)f(2\))h(to)h(the) +150 2802 y(\014le)h Fr(dirlist)p Fu(,)h(while)f(the)h(command)390 +2945 y Ft(ls)47 b(2>&1)g(>)g Fj(dirlist)150 3088 y Fu(directs)28 +b(only)f(the)h(standard)e(output)i(to)g(\014le)f Fr(dirlist)p +Fu(,)h(b)s(ecause)g(the)f(standard)g(error)g(w)m(as)h(made)f(a)h(cop)m +(y)150 3198 y(of)j(the)f(standard)g(output)g(b)s(efore)g(the)g +(standard)g(output)g(w)m(as)g(redirected)h(to)g Fr(dirlist)p +Fu(.)275 3341 y(Bash)26 b(handles)f(sev)m(eral)j(\014lenames)e(sp)s +(ecially)h(when)f(they)g(are)g(used)g(in)g(redirections,)i(as)e +(describ)s(ed)150 3450 y(in)k(the)h(follo)m(wing)g(table:)150 +3623 y Ft(/dev/fd/)p Fj(fd)630 3732 y Fu(If)f Fr(fd)j +Fu(is)d(a)h(v)-5 b(alid)31 b(in)m(teger,)h(\014le)e(descriptor)h +Fr(fd)i Fu(is)d(duplicated.)150 3901 y Ft(/dev/stdin)630 +4010 y Fu(File)i(descriptor)e(0)h(is)f(duplicated.)150 +4178 y Ft(/dev/stdout)630 4288 y Fu(File)i(descriptor)e(1)h(is)f +(duplicated.)150 4456 y Ft(/dev/stderr)630 4565 y Fu(File)i(descriptor) +e(2)h(is)f(duplicated.)150 4734 y Ft(/dev/tcp/)p Fj(host)p +Ft(/)p Fj(port)630 4843 y Fu(If)41 b Fr(host)i Fu(is)f(a)g(v)-5 +b(alid)41 b(hostname)h(or)f(In)m(ternet)h(address,)i(and)c +Fr(p)s(ort)j Fu(is)f(an)f(in)m(teger)i(p)s(ort)630 4953 +y(n)m(um)m(b)s(er)23 b(or)i(service)h(name,)g(Bash)f(attempts)h(to)f +(op)s(en)f(the)h(corresp)s(onding)f(TCP)g(so)s(c)m(k)m(et.)150 +5121 y Ft(/dev/udp/)p Fj(host)p Ft(/)p Fj(port)630 5230 +y Fu(If)41 b Fr(host)i Fu(is)f(a)g(v)-5 b(alid)41 b(hostname)h(or)f(In) +m(ternet)h(address,)i(and)c Fr(p)s(ort)j Fu(is)f(an)f(in)m(teger)i(p)s +(ort)630 5340 y(n)m(um)m(b)s(er)23 b(or)h(service)h(name,)h(Bash)e +(attempts)h(to)g(op)s(en)f(the)g(corresp)s(onding)f(UDP)i(so)s(c)m(k)m +(et.)p eop end +%%Page: 33 39 +TeXDict begin 33 38 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(33)275 299 +y(A)30 b(failure)h(to)g(op)s(en)e(or)i(create)h(a)e(\014le)h(causes)g +(the)f(redirection)h(to)g(fail.)275 439 y(Redirections)f(using)e +(\014le)i(descriptors)f(greater)h(than)f(9)h(should)e(b)s(e)h(used)f +(with)h(care,)h(as)g(they)f(ma)m(y)150 548 y(con\015ict)i(with)f +(\014le)h(descriptors)f(the)g(shell)h(uses)f(in)m(ternally)-8 +b(.)150 753 y Fk(3.6.1)63 b(Redirecting)40 b(Input)150 +900 y Fu(Redirection)35 b(of)f(input)f(causes)i(the)f(\014le)g(whose)g +(name)g(results)g(from)g(the)g(expansion)g(of)g Fr(w)m(ord)k +Fu(to)d(b)s(e)150 1010 y(op)s(ened)d(for)g(reading)g(on)g(\014le)h +(descriptor)f Ft(n)p Fu(,)h(or)f(the)g(standard)g(input)f(\(\014le)i +(descriptor)f(0\))h(if)f Ft(n)g Fu(is)h(not)150 1119 +y(sp)s(eci\014ed.)275 1259 y(The)c(general)j(format)e(for)h +(redirecting)g(input)e(is:)390 1399 y Ft([)p Fj(n)p Ft(]<)p +Fj(word)150 1604 y Fk(3.6.2)63 b(Redirecting)40 b(Output)150 +1751 y Fu(Redirection)31 b(of)g(output)f(causes)h(the)f(\014le)h(whose) +f(name)g(results)h(from)e(the)i(expansion)f(of)h Fr(w)m(ord)i +Fu(to)f(b)s(e)150 1861 y(op)s(ened)d(for)g(writing)g(on)g(\014le)h +(descriptor)f Fr(n)p Fu(,)g(or)g(the)h(standard)e(output)h(\(\014le)h +(descriptor)f(1\))h(if)g Fr(n)e Fu(is)i(not)150 1970 +y(sp)s(eci\014ed.)40 b(If)30 b(the)g(\014le)h(do)s(es)f(not)h(exist)g +(it)g(is)f(created;)i(if)e(it)h(do)s(es)f(exist)h(it)g(is)g(truncated)f +(to)h(zero)g(size.)275 2110 y(The)e(general)j(format)e(for)h +(redirecting)g(output)f(is:)390 2250 y Ft([)p Fj(n)p +Ft(]>[|])p Fj(word)275 2390 y Fu(If)g(the)h(redirection)g(op)s(erator)g +(is)g(`)p Ft(>)p Fu(',)g(and)f(the)h Ft(noclobber)d Fu(option)j(to)g +(the)g Ft(set)f Fu(builtin)g(has)h(b)s(een)150 2500 y(enabled,)h(the)g +(redirection)h(will)f(fail)h(if)e(the)i(\014le)e(whose)h(name)g +(results)g(from)f(the)h(expansion)g(of)g Fr(w)m(ord)150 +2609 y Fu(exists)f(and)f(is)g(a)h(regular)g(\014le.)41 +b(If)30 b(the)h(redirection)g(op)s(erator)g(is)f(`)p +Ft(>|)p Fu(',)h(or)f(the)h(redirection)g(op)s(erator)g(is)150 +2719 y(`)p Ft(>)p Fu(')36 b(and)f(the)g Ft(noclobber)e +Fu(option)j(is)g(not)g(enabled,)h(the)e(redirection)h(is)g(attempted)g +(ev)m(en)h(if)e(the)h(\014le)150 2829 y(named)30 b(b)m(y)g +Fr(w)m(ord)k Fu(exists.)150 3033 y Fk(3.6.3)63 b(App)s(ending)42 +b(Redirected)e(Output)150 3180 y Fu(Redirection)23 b(of)e(output)h(in)f +(this)h(fashion)f(causes)h(the)g(\014le)g(whose)f(name)h(results)f +(from)g(the)h(expansion)g(of)150 3290 y Fr(w)m(ord)28 +b Fu(to)e(b)s(e)e(op)s(ened)g(for)h(app)s(ending)e(on)i(\014le)g +(descriptor)g Fr(n)p Fu(,)g(or)g(the)g(standard)f(output)h(\(\014le)g +(descriptor)150 3399 y(1\))31 b(if)f Fr(n)g Fu(is)h(not)f(sp)s +(eci\014ed.)40 b(If)30 b(the)h(\014le)f(do)s(es)g(not)h(exist)g(it)g +(is)f(created.)275 3539 y(The)f(general)j(format)e(for)h(app)s(ending)e +(output)h(is:)390 3679 y Ft([)p Fj(n)p Ft(]>>)p Fj(word)150 +3884 y Fk(3.6.4)63 b(Redirecting)40 b(Standard)h(Output)g(and)g +(Standard)g(Error)150 4031 y Fu(This)33 b(construct)i(allo)m(ws)g(b)s +(oth)f(the)g(standard)g(output)f(\(\014le)i(descriptor)f(1\))h(and)f +(the)g(standard)f(error)150 4141 y(output)d(\(\014le)h(descriptor)f +(2\))h(to)g(b)s(e)f(redirected)h(to)g(the)f(\014le)h(whose)f(name)h(is) +f(the)g(expansion)h(of)f Fr(w)m(ord)p Fu(.)275 4281 y(There)f(are)i(t)m +(w)m(o)h(formats)e(for)h(redirecting)g(standard)e(output)h(and)g +(standard)f(error:)390 4421 y Ft(&>)p Fj(word)150 4561 +y Fu(and)390 4701 y Ft(>&)p Fj(word)150 4841 y Fu(Of)h(the)g(t)m(w)m(o) +i(forms,)e(the)h(\014rst)e(is)i(preferred.)39 b(This)30 +b(is)g(seman)m(tically)j(equiv)-5 b(alen)m(t)32 b(to)390 +4981 y Ft(>)p Fj(word)46 b Ft(2>&1)275 5121 y Fu(When)41 +b(using)g(the)h(second)f(form,)k Fr(w)m(ord)f Fu(ma)m(y)e(not)g(expand) +f(to)h(a)g(n)m(um)m(b)s(er)f(or)g(`)p Ft(-)p Fu('.)75 +b(If)41 b(it)h(do)s(es,)150 5230 y(other)27 b(redirection)g(op)s +(erators)f(apply)h(\(see)g(Duplicating)h(File)f(Descriptors)h(b)s(elo)m +(w\))f(for)f(compatibilit)m(y)150 5340 y(reasons.)p eop +end +%%Page: 34 40 +TeXDict begin 34 39 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(34)150 299 +y Fk(3.6.5)63 b(App)s(ending)42 b(Standard)f(Output)g(and)g(Standard)g +(Error)150 446 y Fu(This)33 b(construct)i(allo)m(ws)g(b)s(oth)f(the)g +(standard)g(output)f(\(\014le)i(descriptor)f(1\))h(and)f(the)g +(standard)f(error)150 555 y(output)d(\(\014le)h(descriptor)f(2\))h(to)g +(b)s(e)f(app)s(ended)f(to)i(the)f(\014le)h(whose)f(name)g(is)h(the)f +(expansion)h(of)f Fr(w)m(ord)p Fu(.)275 684 y(The)f(format)i(for)f(app) +s(ending)f(standard)h(output)g(and)f(standard)h(error)g(is:)390 +813 y Ft(&>>)p Fj(word)150 942 y Fu(This)g(is)g(seman)m(tically)j +(equiv)-5 b(alen)m(t)32 b(to)390 1071 y Ft(>>)p Fj(word)46 +b Ft(2>&1)275 1200 y Fu(\(see)31 b(Duplicating)h(File)f(Descriptors)g +(b)s(elo)m(w\).)150 1389 y Fk(3.6.6)63 b(Here)41 b(Do)s(cumen)m(ts)150 +1536 y Fu(This)c(t)m(yp)s(e)h(of)f(redirection)i(instructs)e(the)h +(shell)f(to)i(read)e(input)g(from)g(the)h(curren)m(t)f(source)h(un)m +(til)g(a)150 1645 y(line)31 b(con)m(taining)g(only)g +Fr(w)m(ord)i Fu(\(with)d(no)h(trailing)g(blanks\))f(is)g(seen.)41 +b(All)31 b(of)f(the)h(lines)f(read)g(up)f(to)i(that)150 +1755 y(p)s(oin)m(t)f(are)h(then)f(used)g(as)g(the)h(standard)f(input)f +(for)h(a)h(command.)275 1884 y(The)e(format)i(of)g(here-do)s(cumen)m +(ts)f(is:)390 2013 y Ft(<<[)p Fq(\000)p Ft(])p Fj(word)772 +2123 y(here-document)390 2232 y(delimiter)275 2361 y +Fu(No)i(parameter)h(and)f(v)-5 b(ariable)32 b(expansion,)h(command)f +(substitution,)h(arithmetic)g(expansion,)g(or)150 2471 +y(\014lename)38 b(expansion)g(is)g(p)s(erformed)e(on)i +Fr(w)m(ord)p Fu(.)62 b(If)38 b(an)m(y)g(c)m(haracters)h(in)e +Fr(w)m(ord)42 b Fu(are)c(quoted,)i(the)e Fr(de-)150 2580 +y(limiter)h Fu(is)32 b(the)h(result)f(of)g(quote)h(remo)m(v)-5 +b(al)33 b(on)f Fr(w)m(ord)p Fu(,)g(and)g(the)g(lines)g(in)g(the)g +(here-do)s(cumen)m(t)g(are)h(not)150 2690 y(expanded.)71 +b(If)40 b Fr(w)m(ord)k Fu(is)d(unquoted,)h(all)g(lines)f(of)g(the)f +(here-do)s(cumen)m(t)h(are)g(sub)5 b(jected)41 b(to)g(param-)150 +2800 y(eter)c(expansion,)i(command)d(substitution,)i(and)e(arithmetic)i +(expansion,)g(the)f(c)m(haracter)i(sequence)150 2909 +y Ft(\\newline)28 b Fu(is)j(ignored,)f(and)g(`)p Ft(\\)p +Fu(')h(m)m(ust)f(b)s(e)g(used)f(to)i(quote)g(the)g(c)m(haracters)h(`)p +Ft(\\)p Fu(',)e(`)p Ft($)p Fu(',)h(and)f(`)p Ft(`)p Fu('.)275 +3038 y(If)21 b(the)i(redirection)g(op)s(erator)g(is)f(`)p +Ft(<<-)p Fu(',)i(then)e(all)h(leading)g(tab)g(c)m(haracters)h(are)e +(stripp)s(ed)f(from)h(input)150 3148 y(lines)33 b(and)f(the)h(line)h +(con)m(taining)g Fr(delimiter)p Fu(.)49 b(This)32 b(allo)m(ws)i +(here-do)s(cumen)m(ts)f(within)f(shell)i(scripts)e(to)150 +3257 y(b)s(e)e(inden)m(ted)g(in)g(a)h(natural)f(fashion.)150 +3446 y Fk(3.6.7)63 b(Here)41 b(Strings)150 3593 y Fu(A)30 +b(v)-5 b(arian)m(t)32 b(of)e(here)h(do)s(cumen)m(ts,)f(the)g(format)h +(is:)390 3722 y Ft(<<<)47 b Fj(word)275 3851 y Fu(The)21 +b Fr(w)m(ord)k Fu(undergo)s(es)c(brace)h(expansion,)i(tilde)e +(expansion,)i(parameter)e(and)f(v)-5 b(ariable)23 b(expansion,)150 +3960 y(command)j(substitution,)g(arithmetic)i(expansion,)f(and)e(quote) +i(remo)m(v)-5 b(al.)40 b(P)m(athname)27 b(expansion)f(and)150 +4070 y(w)m(ord)j(splitting)i(are)f(not)g(p)s(erformed.)39 +b(The)29 b(result)h(is)g(supplied)e(as)i(a)h(single)f(string)g(to)g +(the)g(command)150 4179 y(on)g(its)h(standard)f(input.)150 +4368 y Fk(3.6.8)63 b(Duplicating)41 b(File)g(Descriptors)150 +4515 y Fu(The)30 b(redirection)h(op)s(erator)390 4644 +y Ft([)p Fj(n)p Ft(]<&)p Fj(word)150 4773 y Fu(is)k(used)e(to)j +(duplicate)f(input)f(\014le)g(descriptors.)53 b(If)34 +b Fr(w)m(ord)k Fu(expands)c(to)h(one)g(or)g(more)g(digits,)h(the)f +(\014le)150 4882 y(descriptor)e(denoted)h(b)m(y)f Fr(n)g +Fu(is)g(made)h(to)g(b)s(e)f(a)g(cop)m(y)h(of)g(that)g(\014le)f +(descriptor.)50 b(If)33 b(the)h(digits)g(in)f Fr(w)m(ord)150 +4992 y Fu(do)c(not)h(sp)s(ecify)f(a)h(\014le)f(descriptor)g(op)s(en)g +(for)g(input,)g(a)h(redirection)g(error)f(o)s(ccurs.)40 +b(If)29 b Fr(w)m(ord)j Fu(ev)-5 b(aluates)150 5101 y(to)31 +b(`)p Ft(-)p Fu(',)g(\014le)g(descriptor)g Fr(n)f Fu(is)g(closed.)43 +b(If)30 b Fr(n)g Fu(is)g(not)h(sp)s(eci\014ed,)f(the)h(standard)f +(input)g(\(\014le)h(descriptor)f(0\))150 5211 y(is)g(used.)275 +5340 y(The)f(op)s(erator)p eop end +%%Page: 35 41 +TeXDict begin 35 40 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(35)390 299 +y Ft([)p Fj(n)p Ft(]>&)p Fj(word)150 440 y Fu(is)40 b(used)g(similarly) +h(to)g(duplicate)f(output)g(\014le)h(descriptors.)70 +b(If)40 b Fr(n)f Fu(is)i(not)f(sp)s(eci\014ed,)i(the)f(standard)150 +550 y(output)30 b(\(\014le)g(descriptor)g(1\))h(is)f(used.)39 +b(If)30 b(the)g(digits)h(in)e Fr(w)m(ord)34 b Fu(do)29 +b(not)i(sp)s(ecify)e(a)i(\014le)f(descriptor)g(op)s(en)150 +660 y(for)35 b(output,)h(a)g(redirection)g(error)e(o)s(ccurs.)55 +b(If)35 b Fr(w)m(ord)j Fu(ev)-5 b(aluates)37 b(to)f(`)p +Ft(-)p Fu(',)h(\014le)e(descriptor)g Fr(n)g Fu(is)g(closed.)150 +769 y(As)f(a)g(sp)s(ecial)h(case,)h(if)e Fr(n)f Fu(is)h(omitted,)i(and) +e Fr(w)m(ord)j Fu(do)s(es)d(not)g(expand)f(to)i(one)f(or)g(more)g +(digits)h(or)f(`)p Ft(-)p Fu(',)150 879 y(the)d(standard)e(output)h +(and)g(standard)f(error)h(are)h(redirected)g(as)g(describ)s(ed)e +(previously)-8 b(.)150 1085 y Fk(3.6.9)63 b(Mo)m(ving)41 +b(File)h(Descriptors)150 1232 y Fu(The)30 b(redirection)h(op)s(erator) +390 1373 y Ft([)p Fj(n)p Ft(]<&)p Fj(digit)p Ft(-)150 +1515 y Fu(mo)m(v)m(es)i(the)f(\014le)g(descriptor)f Fr(digit)k +Fu(to)d(\014le)g(descriptor)g Fr(n)p Fu(,)f(or)h(the)g(standard)f +(input)f(\(\014le)j(descriptor)e(0\))150 1625 y(if)f +Fr(n)g Fu(is)h(not)f(sp)s(eci\014ed.)40 b Fr(digit)33 +b Fu(is)e(closed)g(after)g(b)s(eing)f(duplicated)g(to)h +Fr(n)p Fu(.)275 1766 y(Similarly)-8 b(,)31 b(the)f(redirection)h(op)s +(erator)390 1908 y Ft([)p Fj(n)p Ft(]>&)p Fj(digit)p +Ft(-)150 2049 y Fu(mo)m(v)m(es)e(the)g(\014le)f(descriptor)f +Fr(digit)k Fu(to)e(\014le)f(descriptor)g Fr(n)p Fu(,)g(or)g(the)g +(standard)f(output)h(\(\014le)g(descriptor)g(1\))150 +2159 y(if)i Fr(n)g Fu(is)h(not)f(sp)s(eci\014ed.)150 +2365 y Fk(3.6.10)63 b(Op)s(ening)42 b(File)g(Descriptors)g(for)g +(Reading)e(and)h(W)-10 b(riting)150 2512 y Fu(The)30 +b(redirection)h(op)s(erator)390 2653 y Ft([)p Fj(n)p +Ft(]<>)p Fj(word)150 2795 y Fu(causes)39 b(the)g(\014le)g(whose)g(name) +g(is)g(the)g(expansion)g(of)g Fr(w)m(ord)j Fu(to)d(b)s(e)g(op)s(ened)f +(for)g(b)s(oth)h(reading)g(and)150 2905 y(writing)33 +b(on)f(\014le)h(descriptor)f Fr(n)p Fu(,)h(or)g(on)f(\014le)h +(descriptor)g(0)g(if)f Fr(n)g Fu(is)h(not)g(sp)s(eci\014ed.)47 +b(If)32 b(the)h(\014le)f(do)s(es)h(not)150 3014 y(exist,)e(it)g(is)g +(created.)150 3257 y Fs(3.7)68 b(Executing)46 b(Commands)150 +3481 y Fk(3.7.1)63 b(Simple)41 b(Command)h(Expansion)150 +3628 y Fu(When)33 b(a)g(simple)g(command)g(is)g(executed,)h(the)g +(shell)f(p)s(erforms)e(the)i(follo)m(wing)i(expansions,)e(assign-)150 +3738 y(men)m(ts,)e(and)f(redirections,)h(from)f(left)h(to)g(righ)m(t.) +199 3879 y(1.)61 b(The)38 b(w)m(ords)f(that)i(the)g(parser)e(has)h +(mark)m(ed)g(as)h(v)-5 b(ariable)39 b(assignmen)m(ts)g(\(those)g +(preceding)f(the)330 3989 y(command)30 b(name\))h(and)f(redirections)h +(are)f(sa)m(v)m(ed)i(for)e(later)h(pro)s(cessing.)199 +4127 y(2.)61 b(The)39 b(w)m(ords)g(that)i(are)f(not)g(v)-5 +b(ariable)40 b(assignmen)m(ts)h(or)e(redirections)i(are)f(expanded)f +(\(see)h(Sec-)330 4237 y(tion)d(3.5)i([Shell)e(Expansions],)h(page)g +(21\).)61 b(If)37 b(an)m(y)g(w)m(ords)f(remain)h(after)h(expansion,)h +(the)e(\014rst)330 4346 y(w)m(ord)31 b(is)g(tak)m(en)h(to)g(b)s(e)f +(the)g(name)h(of)f(the)h(command)f(and)f(the)i(remaining)f(w)m(ords)g +(are)g(the)h(argu-)330 4456 y(men)m(ts.)199 4594 y(3.)61 +b(Redirections)25 b(are)f(p)s(erformed)f(as)h(describ)s(ed)f(ab)s(o)m +(v)m(e)i(\(see)g(Section)g(3.6)g([Redirections],)i(page)d(31\).)199 +4732 y(4.)61 b(The)25 b(text)h(after)f(the)g(`)p Ft(=)p +Fu(')h(in)e(eac)m(h)j(v)-5 b(ariable)25 b(assignmen)m(t)h(undergo)s(es) +e(tilde)i(expansion,)g(parameter)330 4841 y(expansion,)49 +b(command)d(substitution,)j(arithmetic)d(expansion,)k(and)45 +b(quote)h(remo)m(v)-5 b(al)46 b(b)s(efore)330 4951 y(b)s(eing)30 +b(assigned)h(to)g(the)f(v)-5 b(ariable.)275 5121 y(If)32 +b(no)i(command)f(name)g(results,)h(the)g(v)-5 b(ariable)34 +b(assignmen)m(ts)g(a\013ect)h(the)f(curren)m(t)f(shell)h(en)m(viron-) +150 5230 y(men)m(t.)39 b(Otherwise,)27 b(the)e(v)-5 b(ariables)26 +b(are)g(added)f(to)h(the)f(en)m(vironmen)m(t)h(of)g(the)f(executed)h +(command)g(and)150 5340 y(do)35 b(not)f(a\013ect)j(the)d(curren)m(t)h +(shell)g(en)m(vironmen)m(t.)54 b(If)34 b(an)m(y)h(of)g(the)f(assignmen) +m(ts)i(attempts)f(to)h(assign)p eop end +%%Page: 36 42 +TeXDict begin 36 41 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(36)150 299 +y(a)39 b(v)-5 b(alue)39 b(to)g(a)g(readonly)f(v)-5 b(ariable,)42 +b(an)c(error)g(o)s(ccurs,)j(and)c(the)i(command)f(exits)h(with)g(a)f +(non-zero)150 408 y(status.)275 538 y(If)33 b(no)g(command)g(name)h +(results,)g(redirections)g(are)g(p)s(erformed,)f(but)g(do)h(not)f +(a\013ect)i(the)f(curren)m(t)150 648 y(shell)d(en)m(vironmen)m(t.)41 +b(A)30 b(redirection)h(error)f(causes)h(the)g(command)f(to)h(exit)g +(with)f(a)h(non-zero)g(status.)275 778 y(If)26 b(there)i(is)f(a)h +(command)f(name)h(left)g(after)g(expansion,)g(execution)h(pro)s(ceeds)e +(as)g(describ)s(ed)f(b)s(elo)m(w.)150 887 y(Otherwise,)39 +b(the)e(command)g(exits.)62 b(If)37 b(one)g(of)g(the)h(expansions)f +(con)m(tained)h(a)g(command)f(substitu-)150 997 y(tion,)i(the)d(exit)h +(status)g(of)f(the)h(command)f(is)h(the)f(exit)h(status)g(of)f(the)h +(last)g(command)f(substitution)150 1107 y(p)s(erformed.)55 +b(If)35 b(there)g(w)m(ere)h(no)g(command)f(substitutions,)i(the)e +(command)h(exits)g(with)f(a)h(status)g(of)150 1216 y(zero.)150 +1406 y Fk(3.7.2)63 b(Command)41 b(Searc)m(h)f(and)h(Execution)150 +1553 y Fu(After)i(a)h(command)f(has)g(b)s(een)f(split)h(in)m(to)h(w)m +(ords,)j(if)c(it)g(results)g(in)g(a)h(simple)f(command)g(and)f(an)150 +1663 y(optional)32 b(list)f(of)f(argumen)m(ts,)h(the)g(follo)m(wing)g +(actions)h(are)f(tak)m(en.)199 1793 y(1.)61 b(If)24 b(the)g(command)g +(name)g(con)m(tains)i(no)e(slashes,)i(the)e(shell)h(attempts)g(to)g(lo) +s(cate)h(it.)39 b(If)24 b(there)g(exists)330 1902 y(a)h(shell)g +(function)f(b)m(y)g(that)h(name,)h(that)f(function)f(is)h(in)m(v)m(ok)m +(ed)h(as)e(describ)s(ed)g(in)g(Section)h(3.3)h([Shell)330 +2012 y(F)-8 b(unctions],)31 b(page)h(17.)199 2142 y(2.)61 +b(If)41 b(the)g(name)h(do)s(es)f(not)g(matc)m(h)i(a)e(function,)j(the)e +(shell)f(searc)m(hes)i(for)e(it)h(in)f(the)g(list)h(of)g(shell)330 +2251 y(builtins.)e(If)30 b(a)h(matc)m(h)g(is)f(found,)g(that)h(builtin) +f(is)g(in)m(v)m(ok)m(ed.)199 2381 y(3.)61 b(If)40 b(the)g(name)h(is)f +(neither)h(a)f(shell)h(function)f(nor)g(a)g(builtin,)j(and)d(con)m +(tains)h(no)g(slashes,)i(Bash)330 2491 y(searc)m(hes)c(eac)m(h)g +(elemen)m(t)g(of)g Ft($PATH)d Fu(for)i(a)g(directory)h(con)m(taining)g +(an)f(executable)h(\014le)f(b)m(y)g(that)330 2600 y(name.)56 +b(Bash)36 b(uses)f(a)h(hash)e(table)j(to)f(remem)m(b)s(er)f(the)h(full) +f(pathnames)g(of)h(executable)h(\014les)e(to)330 2710 +y(a)m(v)m(oid)e(m)m(ultiple)f Ft(PATH)f Fu(searc)m(hes)i(\(see)f(the)g +(description)g(of)f Ft(hash)g Fu(in)g(Section)i(4.1)f([Bourne)g(Shell) +330 2819 y(Builtins],)37 b(page)f(41\).)55 b(A)35 b(full)g(searc)m(h)g +(of)g(the)g(directories)h(in)f Ft($PATH)e Fu(is)i(p)s(erformed)f(only)h +(if)g(the)330 2929 y(command)24 b(is)h(not)g(found)e(in)i(the)g(hash)f +(table.)39 b(If)25 b(the)f(searc)m(h)i(is)e(unsuccessful,)h(the)g +(shell)g(searc)m(hes)330 3039 y(for)e(a)h(de\014ned)e(shell)h(function) +h(named)e Ft(command_not_found_handle)p Fu(.)32 b(If)23 +b(that)h(function)f(exists,)330 3148 y(it)32 b(is)f(in)m(v)m(ok)m(ed)i +(with)e(the)h(original)g(command)f(and)g(the)h(original)g(command's)f +(argumen)m(ts)h(as)g(its)330 3258 y(argumen)m(ts,)h(and)e(the)i +(function's)e(exit)i(status)g(b)s(ecomes)f(the)g(exit)h(status)f(of)h +(the)f(shell.)46 b(If)31 b(that)330 3367 y(function)g(is)g(not)g +(de\014ned,)f(the)i(shell)f(prin)m(ts)f(an)h(error)g(message)h(and)f +(returns)e(an)i(exit)h(status)g(of)330 3477 y(127.)199 +3607 y(4.)61 b(If)33 b(the)g(searc)m(h)h(is)g(successful,)g(or)f(if)g +(the)h(command)f(name)g(con)m(tains)i(one)f(or)f(more)g(slashes,)i(the) +330 3716 y(shell)g(executes)h(the)f(named)f(program)g(in)h(a)g +(separate)h(execution)f(en)m(vironmen)m(t.)55 b(Argumen)m(t)35 +b(0)330 3826 y(is)30 b(set)h(to)h(the)e(name)h(giv)m(en,)g(and)f(the)h +(remaining)f(argumen)m(ts)h(to)g(the)g(command)f(are)h(set)g(to)g(the) +330 3936 y(argumen)m(ts)g(supplied,)e(if)h(an)m(y)-8 +b(.)199 4065 y(5.)61 b(If)35 b(this)h(execution)h(fails)f(b)s(ecause)g +(the)f(\014le)h(is)g(not)g(in)f(executable)j(format,)f(and)e(the)h +(\014le)g(is)g(not)330 4175 y(a)d(directory)-8 b(,)34 +b(it)f(is)g(assumed)e(to)j(b)s(e)d(a)i Fr(shell)g(script)h +Fu(and)e(the)h(shell)f(executes)i(it)f(as)g(describ)s(ed)e(in)330 +4285 y(Section)g(3.8)h([Shell)e(Scripts],)g(page)i(39.)199 +4415 y(6.)61 b(If)38 b(the)h(command)f(w)m(as)h(not)g(b)s(egun)e(async) +m(hronously)-8 b(,)42 b(the)c(shell)h(w)m(aits)h(for)e(the)h(command)f +(to)330 4524 y(complete)32 b(and)e(collects)i(its)f(exit)g(status.)150 +4714 y Fk(3.7.3)63 b(Command)41 b(Execution)f(En)m(vironmen)m(t)150 +4861 y Fu(The)30 b(shell)g(has)h(an)f Fr(execution)h(en)m(vironmen)m(t) +p Fu(,)h(whic)m(h)e(consists)h(of)f(the)h(follo)m(wing:)225 +4991 y Fq(\017)60 b Fu(op)s(en)32 b(\014les)g(inherited)g(b)m(y)h(the)f +(shell)h(at)g(in)m(v)m(o)s(cation,)j(as)c(mo)s(di\014ed)g(b)m(y)g +(redirections)h(supplied)e(to)330 5101 y(the)g Ft(exec)e +Fu(builtin)225 5230 y Fq(\017)60 b Fu(the)28 b(curren)m(t)g(w)m(orking) +h(directory)g(as)f(set)h(b)m(y)f Ft(cd)p Fu(,)g Ft(pushd)p +Fu(,)g(or)g Ft(popd)p Fu(,)g(or)g(inherited)g(b)m(y)g(the)h(shell)f(at) +330 5340 y(in)m(v)m(o)s(cation)p eop end +%%Page: 37 43 +TeXDict begin 37 42 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(37)225 299 +y Fq(\017)60 b Fu(the)31 b(\014le)f(creation)i(mo)s(de)e(mask)g(as)h +(set)g(b)m(y)f Ft(umask)f Fu(or)h(inherited)g(from)g(the)h(shell's)f +(paren)m(t)225 434 y Fq(\017)60 b Fu(curren)m(t)30 b(traps)g(set)h(b)m +(y)f Ft(trap)225 570 y Fq(\017)60 b Fu(shell)30 b(parameters)f(that)h +(are)g(set)g(b)m(y)g(v)-5 b(ariable)30 b(assignmen)m(t)g(or)g(with)f +Ft(set)f Fu(or)i(inherited)f(from)g(the)330 680 y(shell's)i(paren)m(t)f +(in)g(the)h(en)m(vironmen)m(t)225 815 y Fq(\017)60 b +Fu(shell)44 b(functions)f(de\014ned)f(during)h(execution)i(or)e +(inherited)h(from)f(the)h(shell's)g(paren)m(t)f(in)h(the)330 +925 y(en)m(vironmen)m(t)225 1061 y Fq(\017)60 b Fu(options)33 +b(enabled)g(at)h(in)m(v)m(o)s(cation)h(\(either)f(b)m(y)f(default)g(or) +g(with)g(command-line)g(argumen)m(ts\))h(or)330 1170 +y(b)m(y)c Ft(set)225 1306 y Fq(\017)60 b Fu(options)31 +b(enabled)f(b)m(y)g Ft(shopt)f Fu(\(see)j(Section)f(4.3.2)h([The)e +(Shopt)g(Builtin],)h(page)g(62\))225 1441 y Fq(\017)60 +b Fu(shell)31 b(aliases)g(de\014ned)f(with)g Ft(alias)f +Fu(\(see)i(Section)g(6.6)h([Aliases],)g(page)f(88\))225 +1577 y Fq(\017)60 b Fu(v)-5 b(arious)50 b(pro)s(cess)f +Fm(id)p Fu(s,)55 b(including)49 b(those)i(of)e(bac)m(kground)h(jobs)f +(\(see)i(Section)g(3.2.3)g([Lists],)330 1687 y(page)31 +b(9\),)g(the)g(v)-5 b(alue)31 b(of)f Ft($$)p Fu(,)g(and)g(the)h(v)-5 +b(alue)31 b(of)f Ft($PPID)275 1849 y Fu(When)k(a)g(simple)h(command)f +(other)g(than)g(a)h(builtin)f(or)g(shell)h(function)f(is)g(to)h(b)s(e)f +(executed,)i(it)f(is)150 1959 y(in)m(v)m(ok)m(ed)25 b(in)f(a)g +(separate)h(execution)g(en)m(vironmen)m(t)g(that)f(consists)g(of)h(the) +f(follo)m(wing.)40 b(Unless)24 b(otherwise)150 2068 y(noted,)31 +b(the)f(v)-5 b(alues)31 b(are)g(inherited)f(from)g(the)g(shell.)225 +2205 y Fq(\017)60 b Fu(the)31 b(shell's)h(op)s(en)e(\014les,)i(plus)e +(an)m(y)h(mo)s(di\014cations)h(and)e(additions)h(sp)s(eci\014ed)g(b)m +(y)g(redirections)g(to)330 2315 y(the)g(command)225 2450 +y Fq(\017)60 b Fu(the)31 b(curren)m(t)f(w)m(orking)g(directory)225 +2586 y Fq(\017)60 b Fu(the)31 b(\014le)f(creation)i(mo)s(de)e(mask)225 +2722 y Fq(\017)60 b Fu(shell)32 b(v)-5 b(ariables)33 +b(and)e(functions)h(mark)m(ed)g(for)g(exp)s(ort,)g(along)h(with)f(v)-5 +b(ariables)32 b(exp)s(orted)g(for)g(the)330 2831 y(command,)e(passed)g +(in)g(the)h(en)m(vironmen)m(t)g(\(see)g(Section)g(3.7.4)i([En)m +(vironmen)m(t],)e(page)g(37\))225 2967 y Fq(\017)60 b +Fu(traps)31 b(caugh)m(t)h(b)m(y)f(the)g(shell)h(are)f(reset)h(to)g(the) +f(v)-5 b(alues)32 b(inherited)e(from)h(the)g(shell's)h(paren)m(t,)g +(and)330 3076 y(traps)e(ignored)h(b)m(y)f(the)g(shell)h(are)g(ignored) +275 3239 y(A)41 b(command)g(in)m(v)m(ok)m(ed)i(in)e(this)h(separate)g +(en)m(vironmen)m(t)g(cannot)g(a\013ect)h(the)f(shell's)g(execution)150 +3349 y(en)m(vironmen)m(t.)275 3485 y(Command)35 b(substitution,)j +(commands)e(group)s(ed)f(with)i(paren)m(theses,)h(and)e(async)m +(hronous)g(com-)150 3595 y(mands)c(are)h(in)m(v)m(ok)m(ed)i(in)d(a)i +(subshell)e(en)m(vironmen)m(t)h(that)h(is)f(a)g(duplicate)h(of)f(the)g +(shell)g(en)m(vironmen)m(t,)150 3705 y(except)i(that)g(traps)f(caugh)m +(t)h(b)m(y)f(the)h(shell)f(are)g(reset)h(to)g(the)f(v)-5 +b(alues)35 b(that)g(the)f(shell)h(inherited)e(from)150 +3814 y(its)g(paren)m(t)f(at)h(in)m(v)m(o)s(cation.)49 +b(Builtin)32 b(commands)g(that)h(are)g(in)m(v)m(ok)m(ed)h(as)e(part)g +(of)h(a)f(pip)s(eline)g(are)h(also)150 3924 y(executed)41 +b(in)f(a)h(subshell)e(en)m(vironmen)m(t.)72 b(Changes)40 +b(made)g(to)h(the)g(subshell)e(en)m(vironmen)m(t)i(cannot)150 +4033 y(a\013ect)32 b(the)f(shell's)f(execution)i(en)m(vironmen)m(t.)275 +4170 y(Subshells)c(spa)m(wned)i(to)h(execute)g(command)f(substitutions) +g(inherit)g(the)g(v)-5 b(alue)31 b(of)f(the)h Ft(-e)e +Fu(option)150 4280 y(from)23 b(the)i(paren)m(t)f(shell.)38 +b(When)24 b(not)g(in)g Fm(posix)f Fu(mo)s(de,)i(Bash)f(clears)h(the)f +Ft(-e)f Fu(option)i(in)e(suc)m(h)h(subshells.)275 4416 +y(If)f(a)h(command)g(is)g(follo)m(w)m(ed)h(b)m(y)f(a)g(`)p +Ft(&)p Fu(')g(and)f(job)h(con)m(trol)h(is)f(not)g(activ)m(e,)k(the)c +(default)g(standard)f(input)150 4526 y(for)35 b(the)g(command)g(is)g +(the)g(empt)m(y)h(\014le)f Ft(/dev/null)p Fu(.)52 b(Otherwise,)37 +b(the)e(in)m(v)m(ok)m(ed)h(command)f(inherits)150 4636 +y(the)c(\014le)f(descriptors)g(of)h(the)f(calling)i(shell)f(as)f(mo)s +(di\014ed)g(b)m(y)g(redirections.)150 4837 y Fk(3.7.4)63 +b(En)m(vironmen)m(t)150 4984 y Fu(When)29 b(a)g(program)f(is)h(in)m(v)m +(ok)m(ed)h(it)g(is)f(giv)m(en)g(an)g(arra)m(y)g(of)g(strings)g(called)h +(the)f Fr(en)m(vironmen)m(t)p Fu(.)41 b(This)28 b(is)h(a)150 +5094 y(list)i(of)g(name-v)-5 b(alue)31 b(pairs,)f(of)h(the)f(form)g +Ft(name=value)p Fu(.)275 5230 y(Bash)39 b(pro)m(vides)g(sev)m(eral)i(w) +m(a)m(ys)g(to)f(manipulate)f(the)h(en)m(vironmen)m(t.)69 +b(On)38 b(in)m(v)m(o)s(cation,)44 b(the)c(shell)150 5340 +y(scans)g(its)h(o)m(wn)f(en)m(vironmen)m(t)h(and)f(creates)i(a)f +(parameter)f(for)g(eac)m(h)i(name)e(found,)i(automatically)p +eop end +%%Page: 38 44 +TeXDict begin 38 43 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(38)150 299 +y(marking)26 b(it)g(for)g Fr(exp)s(ort)h Fu(to)g(c)m(hild)f(pro)s +(cesses.)39 b(Executed)26 b(commands)g(inherit)g(the)g(en)m(vironmen)m +(t.)39 b(The)150 408 y Ft(export)c Fu(and)i(`)p Ft(declare)29 +b(-x)p Fu(')36 b(commands)h(allo)m(w)i(parameters)e(and)g(functions)g +(to)h(b)s(e)e(added)h(to)h(and)150 518 y(deleted)21 b(from)f(the)h(en)m +(vironmen)m(t.)38 b(If)20 b(the)h(v)-5 b(alue)21 b(of)g(a)g(parameter)g +(in)f(the)g(en)m(vironmen)m(t)i(is)e(mo)s(di\014ed,)i(the)150 +628 y(new)31 b(v)-5 b(alue)32 b(b)s(ecomes)f(part)h(of)f(the)h(en)m +(vironmen)m(t,)g(replacing)h(the)e(old.)44 b(The)31 b(en)m(vironmen)m +(t)h(inherited)150 737 y(b)m(y)f(an)m(y)g(executed)h(command)f +(consists)g(of)g(the)g(shell's)h(initial)g(en)m(vironmen)m(t,)g(whose)f +(v)-5 b(alues)31 b(ma)m(y)h(b)s(e)150 847 y(mo)s(di\014ed)26 +b(in)g(the)h(shell,)h(less)f(an)m(y)g(pairs)f(remo)m(v)m(ed)i(b)m(y)f +(the)g Ft(unset)e Fu(and)h(`)p Ft(export)j(-n)p Fu(')e(commands,)g +(plus)150 956 y(an)m(y)k(additions)f(via)h(the)g Ft(export)d +Fu(and)i(`)p Ft(declare)f(-x)p Fu(')h(commands.)275 1100 +y(The)j(en)m(vironmen)m(t)i(for)f(an)m(y)g(simple)h(command)f(or)g +(function)g(ma)m(y)g(b)s(e)g(augmen)m(ted)h(temp)s(orarily)150 +1210 y(b)m(y)c(pre\014xing)e(it)i(with)g(parameter)g(assignmen)m(ts,)h +(as)e(describ)s(ed)g(in)g(Section)i(3.4)g([Shell)e(P)m(arameters],)150 +1320 y(page)g(18.)41 b(These)29 b(assignmen)m(t)i(statemen)m(ts)g +(a\013ect)f(only)g(the)f(en)m(vironmen)m(t)h(seen)g(b)m(y)f(that)h +(command.)275 1464 y(If)g(the)h Ft(-k)g Fu(option)g(is)g(set)h(\(see)g +(Section)g(4.3.1)g([The)f(Set)g(Builtin],)h(page)g(58\),)h(then)e(all)g +(parameter)150 1573 y(assignmen)m(ts)f(are)g(placed)h(in)e(the)h(en)m +(vironmen)m(t)g(for)g(a)g(command,)f(not)h(just)f(those)i(that)f +(precede)g(the)150 1683 y(command)g(name.)275 1827 y(When)h(Bash)h(in)m +(v)m(ok)m(es)i(an)e(external)h(command,)f(the)g(v)-5 +b(ariable)33 b(`)p Ft($_)p Fu(')f(is)g(set)h(to)f(the)g(full)g +(pathname)150 1936 y(of)f(the)f(command)g(and)g(passed)g(to)h(that)g +(command)f(in)g(its)h(en)m(vironmen)m(t.)150 2145 y Fk(3.7.5)63 +b(Exit)40 b(Status)150 2292 y Fu(The)26 b(exit)h(status)f(of)g(an)g +(executed)h(command)f(is)g(the)h(v)-5 b(alue)26 b(returned)f(b)m(y)h +(the)g Fr(w)m(aitpid)k Fu(system)d(call)g(or)150 2401 +y(equiv)-5 b(alen)m(t)33 b(function.)45 b(Exit)32 b(statuses)g(fall)g +(b)s(et)m(w)m(een)h(0)f(and)f(255,)i(though,)f(as)g(explained)g(b)s +(elo)m(w,)h(the)150 2511 y(shell)i(ma)m(y)g(use)f(v)-5 +b(alues)35 b(ab)s(o)m(v)m(e)g(125)h(sp)s(ecially)-8 b(.)54 +b(Exit)35 b(statuses)g(from)f(shell)h(builtins)f(and)f(comp)s(ound)150 +2621 y(commands)j(are)g(also)h(limited)g(to)g(this)f(range.)58 +b(Under)36 b(certain)h(circumstances,)h(the)e(shell)h(will)f(use)150 +2730 y(sp)s(ecial)31 b(v)-5 b(alues)31 b(to)g(indicate)g(sp)s(eci\014c) +f(failure)h(mo)s(des.)275 2874 y(F)-8 b(or)32 b(the)g(shell's)g(purp)s +(oses,)e(a)j(command)e(whic)m(h)h(exits)g(with)g(a)g(zero)g(exit)h +(status)f(has)f(succeeded.)150 2984 y(A)e(non-zero)h(exit)g(status)g +(indicates)g(failure.)40 b(This)28 b(seemingly)i(coun)m(ter-in)m +(tuitiv)m(e)i(sc)m(heme)e(is)f(used)g(so)150 3093 y(there)34 +b(is)g(one)g(w)m(ell-de\014ned)g(w)m(a)m(y)g(to)h(indicate)g(success)f +(and)f(a)h(v)-5 b(ariet)m(y)35 b(of)f(w)m(a)m(ys)h(to)f(indicate)h(v)-5 +b(arious)150 3203 y(failure)38 b(mo)s(des.)62 b(When)37 +b(a)h(command)f(terminates)i(on)e(a)h(fatal)h(signal)g(whose)e(n)m(um)m +(b)s(er)f(is)i Fr(N)p Fu(,)i(Bash)150 3313 y(uses)30 +b(the)g(v)-5 b(alue)31 b(128)p Ft(+)p Fr(N)42 b Fu(as)30 +b(the)h(exit)g(status.)275 3457 y(If)k(a)h(command)g(is)g(not)g(found,) +g(the)g(c)m(hild)h(pro)s(cess)e(created)i(to)g(execute)g(it)g(returns)d +(a)j(status)f(of)150 3566 y(127.)42 b(If)30 b(a)h(command)f(is)g(found) +f(but)h(is)g(not)h(executable,)h(the)f(return)e(status)i(is)f(126.)275 +3710 y(If)i(a)i(command)f(fails)g(b)s(ecause)g(of)h(an)f(error)f +(during)g(expansion)h(or)g(redirection,)i(the)f(exit)g(status)150 +3820 y(is)c(greater)i(than)e(zero.)275 3964 y(The)38 +b(exit)h(status)g(is)g(used)f(b)m(y)g(the)h(Bash)g(conditional)h +(commands)e(\(see)h(Section)h(3.2.4.2)h([Con-)150 4073 +y(ditional)i(Constructs],)h(page)f(10\))g(and)e(some)i(of)f(the)g(list) +g(constructs)g(\(see)h(Section)f(3.2.3)i([Lists],)150 +4183 y(page)31 b(9\).)275 4327 y(All)40 b(of)g(the)h(Bash)f(builtins)f +(return)g(an)h(exit)h(status)g(of)f(zero)h(if)f(they)g(succeed)g(and)g +(a)g(non-zero)150 4436 y(status)34 b(on)f(failure,)i(so)f(they)g(ma)m +(y)g(b)s(e)f(used)g(b)m(y)g(the)h(conditional)h(and)e(list)h +(constructs.)50 b(All)35 b(builtins)150 4546 y(return)29 +b(an)i(exit)g(status)g(of)f(2)h(to)g(indicate)g(incorrect)h(usage.)150 +4755 y Fk(3.7.6)63 b(Signals)150 4902 y Fu(When)36 b(Bash)g(is)h(in)m +(teractiv)m(e,)j(in)c(the)h(absence)f(of)h(an)m(y)f(traps,)i(it)e +(ignores)h Ft(SIGTERM)d Fu(\(so)j(that)g(`)p Ft(kill)150 +5011 y(0)p Fu(')c(do)s(es)g(not)g(kill)g(an)g(in)m(teractiv)m(e)j +(shell\),)f(and)d Ft(SIGINT)f Fu(is)i(caugh)m(t)h(and)f(handled)f(\(so) +h(that)h(the)f Ft(wait)150 5121 y Fu(builtin)24 b(is)h(in)m +(terruptible\).)39 b(When)24 b(Bash)g(receiv)m(es)j(a)d +Ft(SIGINT)p Fu(,)h(it)g(breaks)f(out)h(of)f(an)m(y)h(executing)h(lo)s +(ops.)150 5230 y(In)31 b(all)h(cases,)h(Bash)f(ignores)g +Ft(SIGQUIT)p Fu(.)42 b(If)32 b(job)f(con)m(trol)i(is)e(in)h(e\013ect)h +(\(see)f(Chapter)f(7)h([Job)g(Con)m(trol],)150 5340 y(page)f(97\),)h +(Bash)e(ignores)h Ft(SIGTTIN)p Fu(,)e Ft(SIGTTOU)p Fu(,)g(and)g +Ft(SIGTSTP)p Fu(.)p eop end +%%Page: 39 45 +TeXDict begin 39 44 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(39)275 299 +y(Non-builtin)31 b(commands)g(started)g(b)m(y)g(Bash)h(ha)m(v)m(e)g +(signal)g(handlers)e(set)i(to)g(the)g(v)-5 b(alues)31 +b(inherited)150 408 y(b)m(y)37 b(the)h(shell)g(from)f(its)h(paren)m(t.) +62 b(When)38 b(job)f(con)m(trol)i(is)e(not)h(in)f(e\013ect,)k(async)m +(hronous)c(commands)150 518 y(ignore)f Ft(SIGINT)e Fu(and)h +Ft(SIGQUIT)e Fu(in)j(addition)f(to)i(these)f(inherited)f(handlers.)55 +b(Commands)35 b(run)f(as)i(a)150 628 y(result)27 b(of)h(command)f +(substitution)h(ignore)g(the)g(k)m(eyb)s(oard-generated)g(job)g(con)m +(trol)h(signals)f Ft(SIGTTIN)p Fu(,)150 737 y Ft(SIGTTOU)p +Fu(,)h(and)g Ft(SIGTSTP)p Fu(.)275 883 y(The)h(shell)i(exits)g(b)m(y)f +(default)g(up)s(on)f(receipt)i(of)f(a)h Ft(SIGHUP)p Fu(.)42 +b(Before)32 b(exiting,)h(an)e(in)m(teractiv)m(e)j(shell)150 +992 y(resends)41 b(the)i Ft(SIGHUP)e Fu(to)i(all)g(jobs,)i(running)c +(or)h(stopp)s(ed.)76 b(Stopp)s(ed)41 b(jobs)h(are)h(sen)m(t)g +Ft(SIGCONT)d Fu(to)150 1102 y(ensure)32 b(that)h(they)g(receiv)m(e)i +(the)e Ft(SIGHUP)p Fu(.)47 b(T)-8 b(o)33 b(prev)m(en)m(t)g(the)g(shell) +g(from)g(sending)f(the)h Ft(SIGHUP)e Fu(signal)150 1211 +y(to)i(a)g(particular)g(job,)g(it)g(should)f(b)s(e)g(remo)m(v)m(ed)h +(from)g(the)f(jobs)g(table)i(with)e(the)h Ft(disown)e +Fu(builtin)h(\(see)150 1321 y(Section)f(7.2)g([Job)f(Con)m(trol)h +(Builtins],)g(page)g(98\))h(or)e(mark)m(ed)g(to)h(not)f(receiv)m(e)i +Ft(SIGHUP)d Fu(using)h Ft(disown)150 1431 y(-h)p Fu(.)275 +1576 y(If)38 b(the)h Ft(huponexit)e Fu(shell)i(option)g(has)g(b)s(een)f +(set)i(with)f Ft(shopt)e Fu(\(see)j(Section)g(4.3.2)h([The)e(Shopt)150 +1686 y(Builtin],)31 b(page)g(62\),)h(Bash)f(sends)e(a)i +Ft(SIGHUP)e Fu(to)i(all)g(jobs)f(when)f(an)i(in)m(teractiv)m(e)i(login) +e(shell)g(exits.)275 1831 y(If)38 b(Bash)h(is)g(w)m(aiting)h(for)f(a)g +(command)f(to)i(complete)g(and)e(receiv)m(es)j(a)e(signal)h(for)e(whic) +m(h)h(a)g(trap)150 1941 y(has)c(b)s(een)f(set,)i(the)f(trap)g(will)g +(not)g(b)s(e)f(executed)i(un)m(til)f(the)g(command)f(completes.)55 +b(When)35 b(Bash)g(is)150 2050 y(w)m(aiting)j(for)f(an)g(async)m +(hronous)g(command)g(via)h(the)f Ft(wait)f Fu(builtin,)i(the)g +(reception)g(of)f(a)g(signal)h(for)150 2160 y(whic)m(h)d(a)g(trap)g +(has)g(b)s(een)f(set)h(will)h(cause)f(the)g Ft(wait)f +Fu(builtin)h(to)g(return)f(immediately)i(with)f(an)g(exit)150 +2270 y(status)c(greater)g(than)f(128,)i(immediately)g(after)f(whic)m(h) +f(the)h(trap)f(is)g(executed.)150 2518 y Fs(3.8)68 b(Shell)45 +b(Scripts)150 2678 y Fu(A)30 b(shell)f(script)h(is)f(a)h(text)h(\014le) +f(con)m(taining)h(shell)f(commands.)40 b(When)29 b(suc)m(h)g(a)h +(\014le)g(is)f(used)g(as)h(the)g(\014rst)150 2787 y(non-option)c +(argumen)m(t)h(when)e(in)m(v)m(oking)i(Bash,)g(and)f(neither)g(the)g +Ft(-c)g Fu(nor)f Ft(-s)h Fu(option)g(is)g(supplied)f(\(see)150 +2897 y(Section)39 b(6.1)g([In)m(v)m(oking)g(Bash],)h(page)f(80\),)i +(Bash)d(reads)g(and)f(executes)i(commands)f(from)f(the)i(\014le,)150 +3007 y(then)32 b(exits.)46 b(This)32 b(mo)s(de)f(of)i(op)s(eration)f +(creates)i(a)e(non-in)m(teractiv)m(e)j(shell.)46 b(The)31 +b(shell)i(\014rst)e(searc)m(hes)150 3116 y(for)d(the)g(\014le)g(in)g +(the)g(curren)m(t)f(directory)-8 b(,)30 b(and)d(lo)s(oks)i(in)e(the)i +(directories)g(in)e Ft($PATH)g Fu(if)h(not)g(found)e(there.)275 +3262 y(When)34 b(Bash)h(runs)e(a)i(shell)g(script,)g(it)h(sets)f(the)f +(sp)s(ecial)i(parameter)f Ft(0)f Fu(to)h(the)g(name)g(of)g(the)g +(\014le,)150 3371 y(rather)k(than)g(the)h(name)f(of)h(the)f(shell,)j +(and)d(the)h(p)s(ositional)g(parameters)f(are)h(set)g(to)g(the)g +(remain-)150 3481 y(ing)f(argumen)m(ts,)j(if)d(an)m(y)g(are)g(giv)m +(en.)67 b(If)39 b(no)g(additional)g(argumen)m(ts)h(are)f(supplied,)h +(the)f(p)s(ositional)150 3590 y(parameters)31 b(are)f(unset.)275 +3736 y(A)39 b(shell)h(script)f(ma)m(y)h(b)s(e)f(made)h(executable)h(b)m +(y)e(using)g(the)h Ft(chmod)e Fu(command)h(to)h(turn)e(on)i(the)150 +3846 y(execute)j(bit.)73 b(When)41 b(Bash)g(\014nds)e(suc)m(h)i(a)h +(\014le)f(while)g(searc)m(hing)h(the)f Ft($PATH)f Fu(for)h(a)h +(command,)h(it)150 3955 y(spa)m(wns)30 b(a)g(subshell)g(to)h(execute)h +(it.)41 b(In)30 b(other)g(w)m(ords,)g(executing)390 4101 +y Ft(filename)46 b Fj(arguments)150 4246 y Fu(is)30 b(equiv)-5 +b(alen)m(t)32 b(to)f(executing)390 4392 y Ft(bash)47 +b(filename)e Fj(arguments)150 4537 y Fu(if)30 b Ft(filename)d +Fu(is)j(an)f(executable)j(shell)e(script.)40 b(This)29 +b(subshell)g(reinitializes)i(itself,)g(so)f(that)h(the)e(e\013ect)150 +4647 y(is)36 b(as)h(if)g(a)f(new)g(shell)h(had)f(b)s(een)g(in)m(v)m(ok) +m(ed)h(to)h(in)m(terpret)e(the)h(script,)h(with)e(the)h(exception)h +(that)f(the)150 4756 y(lo)s(cations)25 b(of)g(commands)e(remem)m(b)s +(ered)h(b)m(y)g(the)g(paren)m(t)g(\(see)h(the)f(description)g(of)g +Ft(hash)f Fu(in)h(Section)h(4.1)150 4866 y([Bourne)30 +b(Shell)h(Builtins],)g(page)g(41\))h(are)e(retained)h(b)m(y)f(the)h(c)m +(hild.)275 5011 y(Most)36 b(v)m(ersions)g(of)g(Unix)f(mak)m(e)h(this)g +(a)g(part)f(of)h(the)g(op)s(erating)g(system's)f(command)h(execution) +150 5121 y(mec)m(hanism.)50 b(If)33 b(the)g(\014rst)g(line)h(of)f(a)h +(script)f(b)s(egins)g(with)g(the)g(t)m(w)m(o)i(c)m(haracters)g(`)p +Ft(#!)p Fu(',)f(the)g(remainder)150 5230 y(of)d(the)g(line)h(sp)s +(eci\014es)e(an)h(in)m(terpreter)g(for)g(the)g(program.)43 +b(Th)m(us,)30 b(y)m(ou)h(can)h(sp)s(ecify)e(Bash,)i Ft(awk)p +Fu(,)e(P)m(erl,)150 5340 y(or)g(some)h(other)g(in)m(terpreter)g(and)e +(write)i(the)f(rest)h(of)g(the)f(script)g(\014le)h(in)f(that)h +(language.)p eop end +%%Page: 40 46 +TeXDict begin 40 45 bop 150 -116 a Fu(Chapter)30 b(3:)41 +b(Basic)32 b(Shell)e(F)-8 b(eatures)2246 b(40)275 299 +y(The)40 b(argumen)m(ts)h(to)g(the)g(in)m(terpreter)g(consist)g(of)g(a) +g(single)h(optional)f(argumen)m(t)h(follo)m(wing)g(the)150 +408 y(in)m(terpreter)33 b(name)h(on)f(the)g(\014rst)f(line)i(of)f(the)g +(script)g(\014le,)h(follo)m(w)m(ed)h(b)m(y)e(the)g(name)g(of)g(the)h +(script)f(\014le,)150 518 y(follo)m(w)m(ed)g(b)m(y)f(the)f(rest)h(of)g +(the)f(argumen)m(ts.)45 b(Bash)31 b(will)h(p)s(erform)e(this)i(action)h +(on)e(op)s(erating)h(systems)150 628 y(that)24 b(do)g(not)f(handle)g +(it)h(themselv)m(es.)40 b(Note)25 b(that)f(some)g(older)g(v)m(ersions)f +(of)h(Unix)f(limit)i(the)f(in)m(terpreter)150 737 y(name)30 +b(and)g(argumen)m(t)h(to)g(a)g(maxim)m(um)f(of)h(32)g(c)m(haracters.) +275 872 y(Bash)h(scripts)g(often)g(b)s(egin)g(with)g +Ft(#!)e(/bin/bash)g Fu(\(assuming)i(that)h(Bash)f(has)g(b)s(een)f +(installed)i(in)150 981 y Ft(/bin)p Fu(\),)26 b(since)h(this)f(ensures) +f(that)i(Bash)f(will)h(b)s(e)f(used)f(to)i(in)m(terpret)f(the)h +(script,)g(ev)m(en)g(if)f(it)h(is)f(executed)150 1091 +y(under)j(another)h(shell.)p eop end +%%Page: 41 47 +TeXDict begin 41 46 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(41)150 299 y Fp(4)80 +b(Shell)53 b(Builtin)f(Commands)150 541 y Fu(Builtin)34 +b(commands)f(are)h(con)m(tained)g(within)f(the)h(shell)g(itself.)50 +b(When)34 b(the)f(name)h(of)f(a)h(builtin)f(com-)150 +651 y(mand)26 b(is)i(used)e(as)i(the)g(\014rst)e(w)m(ord)h(of)h(a)f +(simple)h(command)f(\(see)h(Section)g(3.2.1)h([Simple)f(Commands],)150 +760 y(page)21 b(8\),)j(the)d(shell)g(executes)h(the)f(command)f +(directly)-8 b(,)24 b(without)d(in)m(v)m(oking)h(another)f(program.)37 +b(Builtin)150 870 y(commands)f(are)h(necessary)g(to)g(implemen)m(t)g +(functionalit)m(y)h(imp)s(ossible)e(or)h(incon)m(v)m(enien)m(t)h(to)f +(obtain)150 979 y(with)30 b(separate)h(utilities.)275 +1117 y(This)c(section)j(brie\015y)e(describ)s(es)g(the)h(builtins)f +(whic)m(h)g(Bash)h(inherits)f(from)g(the)h(Bourne)g(Shell,)g(as)150 +1226 y(w)m(ell)i(as)g(the)g(builtin)e(commands)h(whic)m(h)h(are)f +(unique)g(to)h(or)f(ha)m(v)m(e)i(b)s(een)d(extended)i(in)f(Bash.)275 +1363 y(Sev)m(eral)45 b(builtin)e(commands)h(are)h(describ)s(ed)e(in)h +(other)g(c)m(hapters:)69 b(builtin)43 b(commands)h(whic)m(h)150 +1473 y(pro)m(vide)23 b(the)h(Bash)f(in)m(terface)i(to)f(the)g(job)f +(con)m(trol)i(facilities)g(\(see)f(Section)h(7.2)f([Job)f(Con)m(trol)h +(Builtins],)150 1583 y(page)40 b(98\),)j(the)c(directory)h(stac)m(k)g +(\(see)g(Section)g(6.8.1)h([Directory)g(Stac)m(k)f(Builtins],)i(page)e +(90\),)j(the)150 1692 y(command)23 b(history)h(\(see)g(Section)g(9.2)h +([Bash)f(History)g(Builtins],)h(page)g(133\),)h(and)d(the)h +(programmable)150 1802 y(completion)32 b(facilities)g(\(see)g(Section)f +(8.7)g([Programmable)g(Completion)g(Builtins],)g(page)h(126\).)275 +1939 y(Man)m(y)f(of)f(the)h(builtins)e(ha)m(v)m(e)j(b)s(een)e(extended) +g(b)m(y)g Fm(posix)g Fu(or)g(Bash.)275 2076 y(Unless)39 +b(otherwise)h(noted,)i(eac)m(h)f(builtin)e(command)g(do)s(cumen)m(ted)g +(as)h(accepting)h(options)f(pre-)150 2186 y(ceded)33 +b(b)m(y)h(`)p Ft(-)p Fu(')f(accepts)i(`)p Ft(--)p Fu(')e(to)h(signify)f +(the)h(end)e(of)i(the)f(options.)50 b(The)33 b Ft(:)p +Fu(,)h Ft(true)p Fu(,)f Ft(false)p Fu(,)f(and)h Ft(test)150 +2295 y Fu(builtins)i(do)g(not)h(accept)g(options)g(and)f(do)g(not)h +(treat)g(`)p Ft(--)p Fu(')f(sp)s(ecially)-8 b(.)57 b(The)35 +b Ft(exit)p Fu(,)h Ft(logout)p Fu(,)f Ft(break)p Fu(,)150 +2405 y Ft(continue)p Fu(,)29 b Ft(let)p Fu(,)i(and)g +Ft(shift)f Fu(builtins)g(accept)j(and)e(pro)s(cess)g(argumen)m(ts)g(b)s +(eginning)g(with)g(`)p Ft(-)p Fu(')g(with-)150 2515 y(out)f(requiring)f +(`)p Ft(--)p Fu('.)41 b(Other)29 b(builtins)h(that)g(accept)h(argumen)m +(ts)f(but)g(are)g(not)g(sp)s(eci\014ed)f(as)h(accepting)150 +2624 y(options)25 b(in)m(terpret)f(argumen)m(ts)h(b)s(eginning)e(with)h +(`)p Ft(-)p Fu(')h(as)f(in)m(v)-5 b(alid)25 b(options)g(and)e(require)h +(`)p Ft(--)p Fu(')g(to)h(prev)m(en)m(t)150 2734 y(this)30 +b(in)m(terpretation.)150 2970 y Fs(4.1)68 b(Bourne)45 +b(Shell)g(Builtins)150 3130 y Fu(The)22 b(follo)m(wing)j(shell)d +(builtin)h(commands)f(are)h(inherited)g(from)f(the)h(Bourne)g(Shell.)38 +b(These)22 b(commands)150 3239 y(are)31 b(implemen)m(ted)g(as)f(sp)s +(eci\014ed)g(b)m(y)g(the)h Fm(posix)e Fu(standard.)150 +3403 y Ft(:)h Fu(\(a)h(colon\))870 3512 y Ft(:)47 b([)p +Fj(arguments)p Ft(])630 3648 y Fu(Do)c(nothing)f(b)s(ey)m(ond)g +(expanding)f Fr(argumen)m(ts)46 b Fu(and)c(p)s(erforming)f +(redirections.)76 b(The)630 3758 y(return)29 b(status)i(is)f(zero.)150 +3920 y Ft(.)g Fu(\(a)h(p)s(erio)s(d\))870 4029 y Ft(.)47 +b Fj(filename)f Ft([)p Fj(arguments)p Ft(])630 4165 y +Fu(Read)34 b(and)f(execute)i(commands)e(from)g(the)h +Fr(\014lename)39 b Fu(argumen)m(t)34 b(in)f(the)h(curren)m(t)g(shell) +630 4275 y(con)m(text.)45 b(If)31 b Fr(\014lename)37 +b Fu(do)s(es)31 b(not)g(con)m(tain)i(a)e(slash,)h(the)g +Ft(PATH)e Fu(v)-5 b(ariable)32 b(is)f(used)f(to)i(\014nd)630 +4384 y Fr(\014lename)p Fu(.)52 b(When)34 b(Bash)g(is)h(not)f(in)g +Fm(posix)f Fu(mo)s(de,)i(the)g(curren)m(t)f(directory)g(is)g(searc)m +(hed)630 4494 y(if)d Fr(\014lename)36 b Fu(is)31 b(not)h(found)d(in)i +Ft($PATH)p Fu(.)41 b(If)31 b(an)m(y)g Fr(argumen)m(ts)k +Fu(are)c(supplied,)f(they)i(b)s(ecome)630 4604 y(the)e(p)s(ositional)h +(parameters)g(when)e Fr(\014lename)35 b Fu(is)30 b(executed.)42 +b(Otherwise)30 b(the)g(p)s(ositional)630 4713 y(parameters)43 +b(are)h(unc)m(hanged.)79 b(The)42 b(return)g(status)i(is)f(the)g(exit)h +(status)g(of)f(the)g(last)630 4823 y(command)37 b(executed,)k(or)c +(zero)h(if)g(no)f(commands)g(are)h(executed.)63 b(If)36 +b Fr(\014lename)43 b Fu(is)38 b(not)630 4932 y(found,)22 +b(or)f(cannot)g(b)s(e)f(read,)j(the)e(return)f(status)h(is)g(non-zero.) +38 b(This)20 b(builtin)h(is)f(equiv)-5 b(alen)m(t)630 +5042 y(to)31 b Ft(source)p Fu(.)150 5204 y Ft(break)870 +5340 y(break)46 b([)p Fj(n)p Ft(])p eop end +%%Page: 42 48 +TeXDict begin 42 47 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(42)630 299 y(Exit)45 +b(from)f(a)g Ft(for)p Fu(,)k Ft(while)p Fu(,)e Ft(until)p +Fu(,)h(or)d Ft(select)f Fu(lo)s(op.)83 b(If)44 b Fr(n)g +Fu(is)g(supplied,)j(the)e Fr(n)p Fu(th)630 408 y(enclosing)c(lo)s(op)f +(is)h(exited.)70 b Fr(n)40 b Fu(m)m(ust)g(b)s(e)f(greater)j(than)d(or)i +(equal)f(to)h(1.)70 b(The)40 b(return)630 518 y(status)31 +b(is)f(zero)h(unless)f Fr(n)g Fu(is)g(not)h(greater)g(than)g(or)f +(equal)h(to)g(1.)150 677 y Ft(cd)870 812 y(cd)47 b([-L|[-P)f([-e]])g +([-@])h([)p Fj(directory)p Ft(])630 946 y Fu(Change)27 +b(the)g(curren)m(t)f(w)m(orking)h(directory)g(to)h Fr(directory)p +Fu(.)40 b(If)26 b Fr(directory)35 b Fu(is)27 b(not)g(supplied,)630 +1056 y(the)f(v)-5 b(alue)26 b(of)f(the)h Ft(HOME)e Fu(shell)i(v)-5 +b(ariable)26 b(is)g(used.)38 b(An)m(y)25 b(additional)i(argumen)m(ts)e +(follo)m(wing)630 1166 y Fr(directory)39 b Fu(are)31 +b(ignored.)41 b(If)30 b(the)h(shell)g(v)-5 b(ariable)31 +b Ft(CDPATH)e Fu(exists,)i(it)g(is)g(used)f(as)g(a)h(searc)m(h)630 +1275 y(path:)39 b(eac)m(h)29 b(directory)g(name)f(in)f +Ft(CDPATH)g Fu(is)h(searc)m(hed)g(for)g Fr(directory)p +Fu(,)h(with)f(alternativ)m(e)630 1385 y(directory)j(names)g(in)f +Ft(CDPATH)f Fu(separated)j(b)m(y)e(a)h(colon)h(\(`)p +Ft(:)p Fu('\).)43 b(If)30 b Fr(directory)39 b Fu(b)s(egins)30 +b(with)630 1494 y(a)h(slash,)f Ft(CDPATH)f Fu(is)h(not)h(used.)630 +1629 y(The)g Ft(-P)h Fu(option)g(means)g(to)h(not)f(follo)m(w)h(sym)m +(b)s(olic)g(links:)44 b(sym)m(b)s(olic)32 b(links)g(are)g(resolv)m(ed) +630 1738 y(while)41 b Ft(cd)f Fu(is)h(tra)m(v)m(ersing)h +Fr(directory)49 b Fu(and)40 b(b)s(efore)g(pro)s(cessing)h(an)f +(instance)i(of)f(`)p Ft(..)p Fu(')f(in)630 1848 y Fr(directory)p +Fu(.)630 1983 y(By)34 b(default,)h(or)e(when)g(the)g +Ft(-L)g Fu(option)h(is)g(supplied,)f(sym)m(b)s(olic)h(links)f(in)h +Fr(directory)42 b Fu(are)630 2092 y(resolv)m(ed)31 b(after)g +Ft(cd)f Fu(pro)s(cesses)g(an)g(instance)h(of)g(`)p Ft(..)p +Fu(')f(in)g Fr(directory)p Fu(.)630 2227 y(If)35 b(`)p +Ft(..)p Fu(')f(app)s(ears)h(in)f Fr(directory)p Fu(,)j(it)f(is)f(pro)s +(cessed)f(b)m(y)h(remo)m(ving)h(the)f(immediately)h(pre-)630 +2336 y(ceding)31 b(pathname)f(comp)s(onen)m(t,)h(bac)m(k)g(to)g(a)g +(slash)f(or)h(the)f(b)s(eginning)g(of)g Fr(directory)p +Fu(.)630 2471 y(If)i(the)i Ft(-e)e Fu(option)h(is)g(supplied)f(with)g +Ft(-P)h Fu(and)f(the)h(curren)m(t)g(w)m(orking)g(directory)g(cannot)630 +2580 y(b)s(e)k(successfully)g(determined)g(after)i(a)e(successful)h +(directory)g(c)m(hange,)i Ft(cd)d Fu(will)h(return)630 +2690 y(an)30 b(unsuccessful)f(status.)630 2824 y(On)41 +b(systems)h(that)h(supp)s(ort)d(it,)46 b(the)c Ft(-@)g +Fu(option)g(presen)m(ts)g(the)g(extended)g(attributes)630 +2934 y(asso)s(ciated)32 b(with)e(a)h(\014le)f(as)h(a)f(directory)-8 +b(.)630 3068 y(If)41 b Fr(directory)49 b Fu(is)41 b(`)p +Ft(-)p Fu(',)j(it)e(is)f(con)m(v)m(erted)h(to)g Ft($OLDPWD)d +Fu(b)s(efore)i(the)g(directory)h(c)m(hange)g(is)630 3178 +y(attempted.)630 3313 y(If)33 b(a)h(non-empt)m(y)g(directory)g(name)f +(from)g Ft(CDPATH)f Fu(is)h(used,)h(or)g(if)f(`)p Ft(-)p +Fu(')h(is)f(the)h(\014rst)f(argu-)630 3422 y(men)m(t,)28 +b(and)e(the)h(directory)g(c)m(hange)h(is)f(successful,)h(the)f +(absolute)g(pathname)g(of)f(the)h(new)630 3532 y(w)m(orking)k +(directory)g(is)f(written)g(to)i(the)e(standard)g(output.)630 +3666 y(The)f(return)g(status)h(is)f(zero)i(if)e(the)h(directory)g(is)g +(successfully)g(c)m(hanged,)g(non-zero)g(oth-)630 3776 +y(erwise.)150 3935 y Ft(continue)870 4070 y(continue)46 +b([)p Fj(n)p Ft(])630 4204 y Fu(Resume)32 b(the)g(next)g(iteration)i +(of)e(an)g(enclosing)h Ft(for)p Fu(,)f Ft(while)p Fu(,)f +Ft(until)p Fu(,)g(or)h Ft(select)f Fu(lo)s(op.)630 4314 +y(If)f Fr(n)h Fu(is)g(supplied,)e(the)j(execution)g(of)f(the)g +Fr(n)p Fu(th)f(enclosing)i(lo)s(op)f(is)f(resumed.)42 +b Fr(n)30 b Fu(m)m(ust)h(b)s(e)630 4423 y(greater)39 +b(than)f(or)g(equal)g(to)h(1.)63 b(The)38 b(return)e(status)j(is)e +(zero)i(unless)e Fr(n)h Fu(is)g(not)g(greater)630 4533 +y(than)30 b(or)g(equal)h(to)g(1.)150 4692 y Ft(eval)870 +4827 y(eval)47 b([)p Fj(arguments)p Ft(])630 4961 y Fu(The)25 +b(argumen)m(ts)h(are)g(concatenated)i(together)f(in)m(to)f(a)g(single)h +(command,)f(whic)m(h)g(is)f(then)630 5071 y(read)35 b(and)g(executed,)j +(and)d(its)h(exit)g(status)g(returned)e(as)h(the)h(exit)g(status)g(of)g +Ft(eval)p Fu(.)54 b(If)630 5181 y(there)31 b(are)f(no)h(argumen)m(ts)f +(or)h(only)f(empt)m(y)h(argumen)m(ts,)g(the)f(return)g(status)g(is)h +(zero.)150 5340 y Ft(exec)p eop end +%%Page: 43 49 +TeXDict begin 43 48 bop 150 -116 a Fu(Chapter)30 b(4:)h(Shell)f +(Builtin)h(Commands)2079 b(43)870 299 y Ft(exec)47 b([-cl])f([-a)h +Fj(name)p Ft(])f([)p Fj(command)g Ft([)p Fj(arguments)p +Ft(]])630 440 y Fu(If)36 b Fr(command)k Fu(is)c(supplied,)h(it)g +(replaces)h(the)e(shell)h(without)f(creating)i(a)f(new)f(pro)s(cess.) +630 549 y(If)k(the)h Ft(-l)e Fu(option)i(is)g(supplied,)h(the)e(shell)h +(places)g(a)g(dash)f(at)h(the)f(b)s(eginning)g(of)h(the)630 +659 y(zeroth)36 b(argumen)m(t)h(passed)e(to)h Fr(command)p +Fu(.)57 b(This)35 b(is)h(what)f(the)h Ft(login)e Fu(program)i(do)s(es.) +630 769 y(The)i Ft(-c)g Fu(option)g(causes)h Fr(command)j +Fu(to)d(b)s(e)f(executed)h(with)f(an)g(empt)m(y)h(en)m(vironmen)m(t.) +630 878 y(If)c Ft(-a)g Fu(is)h(supplied,)f(the)h(shell)g(passes)f +Fr(name)41 b Fu(as)36 b(the)f(zeroth)i(argumen)m(t)f(to)g +Fr(command)p Fu(.)630 988 y(If)c Fr(command)j Fu(cannot)e(b)s(e)f +(executed)h(for)f(some)g(reason,)h(a)g(non-in)m(teractiv)m(e)i(shell)d +(exits,)630 1097 y(unless)27 b(the)g Ft(execfail)e Fu(shell)i(option)h +(is)f(enabled.)40 b(In)27 b(that)g(case,)j(it)d(returns)f(failure.)40 +b(An)630 1207 y(in)m(teractiv)m(e)d(shell)c(returns)g(failure)h(if)f +(the)h(\014le)g(cannot)g(b)s(e)f(executed.)52 b(If)33 +b(no)h Fr(command)630 1316 y Fu(is)27 b(sp)s(eci\014ed,)g(redirections) +h(ma)m(y)f(b)s(e)g(used)f(to)i(a\013ect)g(the)f(curren)m(t)g(shell)g +(en)m(vironmen)m(t.)40 b(If)630 1426 y(there)34 b(are)h(no)f +(redirection)h(errors,)g(the)f(return)f(status)i(is)f(zero;)j +(otherwise)e(the)f(return)630 1536 y(status)d(is)f(non-zero.)150 +1708 y Ft(exit)870 1849 y(exit)47 b([)p Fj(n)p Ft(])630 +1990 y Fu(Exit)30 b(the)g(shell,)h(returning)d(a)j(status)f(of)g +Fr(n)f Fu(to)h(the)g(shell's)g(paren)m(t.)41 b(If)30 +b Fr(n)f Fu(is)h(omitted,)h(the)630 2099 y(exit)c(status)g(is)g(that)g +(of)g(the)g(last)g(command)f(executed.)41 b(An)m(y)26 +b(trap)h(on)f Ft(EXIT)f Fu(is)i(executed)630 2209 y(b)s(efore)j(the)h +(shell)f(terminates.)150 2381 y Ft(export)870 2522 y(export)46 +b([-fn])g([-p])h([)p Fj(name)p Ft([=)p Fj(value)p Ft(]])630 +2663 y Fu(Mark)40 b(eac)m(h)h Fr(name)k Fu(to)40 b(b)s(e)f(passed)g(to) +i(c)m(hild)f(pro)s(cesses)f(in)g(the)h(en)m(vironmen)m(t.)70 +b(If)39 b(the)630 2772 y Ft(-f)33 b Fu(option)h(is)g(supplied,)f(the)h +Fr(name)5 b Fu(s)33 b(refer)g(to)i(shell)e(functions;)i(otherwise)f +(the)g(names)630 2882 y(refer)c(to)h(shell)g(v)-5 b(ariables.)41 +b(The)30 b Ft(-n)f Fu(option)i(means)f(to)h(no)f(longer)h(mark)f(eac)m +(h)i Fr(name)j Fu(for)630 2992 y(exp)s(ort.)52 b(If)33 +b(no)h Fr(names)k Fu(are)c(supplied,)g(or)g(if)g(the)g +Ft(-p)g Fu(option)g(is)g(giv)m(en,)j(a)d(list)h(of)f(names)630 +3101 y(of)d(all)h(exp)s(orted)e(v)-5 b(ariables)31 b(is)g(displa)m(y)m +(ed.)43 b(The)30 b Ft(-p)g Fu(option)i(displa)m(ys)e(output)h(in)f(a)h +(form)630 3211 y(that)25 b(ma)m(y)g(b)s(e)f(reused)g(as)h(input.)38 +b(If)24 b(a)h(v)-5 b(ariable)25 b(name)g(is)g(follo)m(w)m(ed)h(b)m(y)e +(=)p Fr(v)-5 b(alue)p Fu(,)27 b(the)d(v)-5 b(alue)630 +3320 y(of)31 b(the)f(v)-5 b(ariable)31 b(is)g(set)g(to)g +Fr(v)-5 b(alue)p Fu(.)630 3461 y(The)29 b(return)e(status)j(is)f(zero)h +(unless)e(an)h(in)m(v)-5 b(alid)29 b(option)h(is)f(supplied,)f(one)i +(of)f(the)g(names)630 3571 y(is)k(not)g(a)h(v)-5 b(alid)33 +b(shell)h(v)-5 b(ariable)33 b(name,)i(or)e Ft(-f)f Fu(is)h(supplied)f +(with)h(a)g(name)g(that)h(is)f(not)h(a)630 3680 y(shell)d(function.)150 +3853 y Ft(getopts)870 3994 y(getopts)46 b Fj(optstring)f(name)i +Ft([)p Fj(args)p Ft(])630 4134 y(getopts)28 b Fu(is)i(used)g(b)m(y)g +(shell)g(scripts)g(to)g(parse)g(p)s(ositional)h(parameters.)41 +b Fr(optstring)d Fu(con-)630 4244 y(tains)k(the)g(option)f(c)m +(haracters)i(to)g(b)s(e)d(recognized;)49 b(if)42 b(a)f(c)m(haracter)j +(is)d(follo)m(w)m(ed)i(b)m(y)f(a)630 4354 y(colon,)33 +b(the)f(option)g(is)g(exp)s(ected)g(to)h(ha)m(v)m(e)g(an)e(argumen)m +(t,)i(whic)m(h)f(should)e(b)s(e)h(separated)630 4463 +y(from)40 b(it)g(b)m(y)g(whitespace.)70 b(The)40 b(colon)h(\(`)p +Ft(:)p Fu('\))g(and)e(question)h(mark)g(\(`)p Ft(?)p +Fu('\))h(ma)m(y)f(not)h(b)s(e)630 4573 y(used)d(as)g(option)h(c)m +(haracters.)67 b(Eac)m(h)39 b(time)g(it)g(is)f(in)m(v)m(ok)m(ed,)k +Ft(getopts)37 b Fu(places)i(the)g(next)630 4682 y(option)29 +b(in)f(the)h(shell)g(v)-5 b(ariable)30 b Fr(name)p Fu(,)f(initializing) +i Fr(name)j Fu(if)28 b(it)h(do)s(es)g(not)g(exist,)h(and)e(the)630 +4792 y(index)33 b(of)g(the)h(next)f(argumen)m(t)h(to)g(b)s(e)e(pro)s +(cessed)h(in)m(to)h(the)g(v)-5 b(ariable)34 b Ft(OPTIND)p +Fu(.)48 b Ft(OPTIND)630 4902 y Fu(is)41 b(initialized)i(to)f(1)f(eac)m +(h)h(time)g(the)f(shell)g(or)g(a)g(shell)g(script)g(is)g(in)m(v)m(ok)m +(ed.)74 b(When)41 b(an)630 5011 y(option)36 b(requires)e(an)h(argumen)m +(t,)i Ft(getopts)c Fu(places)j(that)g(argumen)m(t)g(in)m(to)g(the)f(v) +-5 b(ariable)630 5121 y Ft(OPTARG)p Fu(.)55 b(The)35 +b(shell)g(do)s(es)h(not)g(reset)g Ft(OPTIND)e Fu(automatically;)41 +b(it)36 b(m)m(ust)f(b)s(e)g(man)m(ually)630 5230 y(reset)i(b)s(et)m(w)m +(een)g(m)m(ultiple)h(calls)f(to)g Ft(getopts)e Fu(within)h(the)h(same)g +(shell)f(in)m(v)m(o)s(cation)j(if)e(a)630 5340 y(new)30 +b(set)h(of)f(parameters)h(is)f(to)i(b)s(e)d(used.)p eop +end +%%Page: 44 50 +TeXDict begin 44 49 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(44)630 299 y(When)41 +b(the)h(end)e(of)i(options)g(is)f(encoun)m(tered,)k Ft(getopts)39 +b Fu(exits)j(with)f(a)h(return)e(v)-5 b(alue)630 408 +y(greater)32 b(than)e(zero.)41 b Ft(OPTIND)29 b Fu(is)h(set)h(to)g(the) +g(index)f(of)g(the)h(\014rst)f(non-option)g(argumen)m(t,)630 +518 y(and)g Fr(name)35 b Fu(is)c(set)g(to)g(`)p Ft(?)p +Fu('.)630 655 y Ft(getopts)c Fu(normally)j(parses)e(the)i(p)s +(ositional)g(parameters,)g(but)e(if)i(more)f(argumen)m(ts)h(are)630 +765 y(giv)m(en)h(in)f Fr(args)p Fu(,)h Ft(getopts)e Fu(parses)h(those)h +(instead.)630 902 y Ft(getopts)h Fu(can)h(rep)s(ort)g(errors)g(in)h(t)m +(w)m(o)h(w)m(a)m(ys.)51 b(If)33 b(the)h(\014rst)e(c)m(haracter)k(of)d +Fr(optstring)42 b Fu(is)34 b(a)630 1011 y(colon,)g Fr(silen)m(t)h +Fu(error)d(rep)s(orting)f(is)i(used.)45 b(In)31 b(normal)h(op)s +(eration,)h(diagnostic)h(messages)630 1121 y(are)c(prin)m(ted)e(when)g +(in)m(v)-5 b(alid)30 b(options)g(or)f(missing)g(option)g(argumen)m(ts)h +(are)f(encoun)m(tered.)630 1230 y(If)34 b(the)g(v)-5 +b(ariable)35 b Ft(OPTERR)d Fu(is)i(set)h(to)f(0,)i(no)e(error)g +(messages)h(will)f(b)s(e)f(displa)m(y)m(ed,)j(ev)m(en)f(if)630 +1340 y(the)c(\014rst)e(c)m(haracter)j(of)f Ft(optstring)d +Fu(is)i(not)h(a)f(colon.)630 1477 y(If)39 b(an)h(in)m(v)-5 +b(alid)41 b(option)f(is)g(seen,)i Ft(getopts)c Fu(places)j(`)p +Ft(?)p Fu(')f(in)m(to)h Fr(name)k Fu(and,)d(if)e(not)g(silen)m(t,)630 +1587 y(prin)m(ts)f(an)h(error)f(message)h(and)f(unsets)g +Ft(OPTARG)p Fu(.)67 b(If)39 b Ft(getopts)f Fu(is)i(silen)m(t,)j(the)c +(option)630 1696 y(c)m(haracter)32 b(found)d(is)h(placed)h(in)f +Ft(OPTARG)f Fu(and)h(no)g(diagnostic)i(message)f(is)g(prin)m(ted.)630 +1833 y(If)c(a)g(required)f(argumen)m(t)i(is)f(not)g(found,)g(and)f +Ft(getopts)f Fu(is)i(not)h(silen)m(t,)h(a)e(question)g(mark)630 +1943 y(\(`)p Ft(?)p Fu('\))h(is)g(placed)g(in)f Fr(name)p +Fu(,)h Ft(OPTARG)e Fu(is)h(unset,)h(and)f(a)g(diagnostic)i(message)g +(is)e(prin)m(ted.)39 b(If)630 2052 y Ft(getopts)28 b +Fu(is)h(silen)m(t,)i(then)e(a)h(colon)h(\(`)p Ft(:)p +Fu('\))f(is)g(placed)g(in)f Fr(name)35 b Fu(and)29 b +Ft(OPTARG)f Fu(is)h(set)h(to)h(the)630 2162 y(option)g(c)m(haracter)h +(found.)150 2326 y Ft(hash)870 2463 y(hash)47 b([-r])f([-p)h +Fj(filename)p Ft(])e([-dt])i([)p Fj(name)p Ft(])630 2600 +y Fu(Eac)m(h)32 b(time)g Ft(hash)e Fu(is)h(in)m(v)m(ok)m(ed,)j(it)d +(remem)m(b)s(ers)g(the)g(full)g(pathnames)g(of)h(the)f(commands)630 +2710 y(sp)s(eci\014ed)i(as)i Fr(name)k Fu(argumen)m(ts,)c(so)g(they)f +(need)g(not)g(b)s(e)f(searc)m(hed)i(for)f(on)g(subsequen)m(t)630 +2819 y(in)m(v)m(o)s(cations.)79 b(The)41 b(commands)h(are)h(found)e(b)m +(y)h(searc)m(hing)i(through)d(the)i(directories)630 2929 +y(listed)37 b(in)g Ft($PATH)p Fu(.)58 b(An)m(y)37 b(previously-remem)m +(b)s(ered)f(pathname)h(is)g(discarded.)59 b(The)37 b +Ft(-p)630 3039 y Fu(option)d(inhibits)f(the)h(path)g(searc)m(h,)h(and)e +Fr(\014lename)39 b Fu(is)34 b(used)f(as)h(the)f(lo)s(cation)j(of)e +Fr(name)p Fu(.)630 3148 y(The)42 b Ft(-r)g Fu(option)h(causes)f(the)h +(shell)g(to)g(forget)g(all)h(remem)m(b)s(ered)d(lo)s(cations.)79 +b(The)42 b Ft(-d)630 3258 y Fu(option)31 b(causes)g(the)f(shell)h(to)g +(forget)h(the)f(remem)m(b)s(ered)e(lo)s(cation)j(of)f(eac)m(h)h +Fr(name)p Fu(.)41 b(If)30 b(the)630 3367 y Ft(-t)39 b +Fu(option)h(is)g(supplied,)g(the)g(full)f(pathname)h(to)g(whic)m(h)f +(eac)m(h)i Fr(name)k Fu(corresp)s(onds)38 b(is)630 3477 +y(prin)m(ted.)k(If)30 b(m)m(ultiple)i Fr(name)k Fu(argumen)m(ts)31 +b(are)g(supplied)f(with)g Ft(-t)g Fu(the)h Fr(name)36 +b Fu(is)31 b(prin)m(ted)630 3587 y(b)s(efore)e(the)i(hashed)e(full)g +(pathname.)41 b(The)29 b Ft(-l)g Fu(option)i(causes)f(output)f(to)i(b)s +(e)e(displa)m(y)m(ed)630 3696 y(in)23 b(a)h(format)g(that)g(ma)m(y)g(b) +s(e)f(reused)f(as)i(input.)37 b(If)23 b(no)h(argumen)m(ts)f(are)h(giv)m +(en,)i(or)e(if)f(only)h Ft(-l)630 3806 y Fu(is)35 b(supplied,)f +(information)h(ab)s(out)g(remem)m(b)s(ered)f(commands)g(is)h(prin)m +(ted.)53 b(The)34 b(return)630 3915 y(status)d(is)f(zero)h(unless)f(a)h +Fr(name)k Fu(is)c(not)f(found)f(or)i(an)f(in)m(v)-5 b(alid)31 +b(option)g(is)f(supplied.)150 4080 y Ft(pwd)870 4217 +y(pwd)47 b([-LP])630 4354 y Fu(Prin)m(t)29 b(the)g(absolute)h(pathname) +e(of)h(the)h(curren)m(t)e(w)m(orking)h(directory)-8 b(.)42 +b(If)28 b(the)h Ft(-P)f Fu(option)630 4463 y(is)39 b(supplied,)h(the)f +(pathname)g(prin)m(ted)g(will)g(not)h(con)m(tain)g(sym)m(b)s(olic)f +(links.)67 b(If)38 b(the)i Ft(-L)630 4573 y Fu(option)k(is)g(supplied,) +i(the)e(pathname)f(prin)m(ted)h(ma)m(y)g(con)m(tain)h(sym)m(b)s(olic)f +(links.)80 b(The)630 4682 y(return)26 b(status)h(is)h(zero)g(unless)e +(an)h(error)g(is)g(encoun)m(tered)g(while)h(determining)f(the)g(name) +630 4792 y(of)k(the)f(curren)m(t)g(directory)h(or)f(an)h(in)m(v)-5 +b(alid)31 b(option)g(is)f(supplied.)150 4956 y Ft(readonly)870 +5093 y(readonly)46 b([-aAf])g([-p])g([)p Fj(name)p Ft([=)p +Fj(value)p Ft(]])e(...)630 5230 y Fu(Mark)33 b(eac)m(h)h +Fr(name)39 b Fu(as)33 b(readonly)-8 b(.)49 b(The)32 b(v)-5 +b(alues)34 b(of)f(these)g(names)g(ma)m(y)h(not)f(b)s(e)f(c)m(hanged)630 +5340 y(b)m(y)38 b(subsequen)m(t)g(assignmen)m(t.)65 b(If)38 +b(the)h Ft(-f)f Fu(option)g(is)h(supplied,)g(eac)m(h)h +Fr(name)j Fu(refers)38 b(to)p eop end +%%Page: 45 51 +TeXDict begin 45 50 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(45)630 299 y(a)37 +b(shell)g(function.)59 b(The)36 b Ft(-a)g Fu(option)h(means)f(eac)m(h)i +Fr(name)k Fu(refers)36 b(to)h(an)f(indexed)g(arra)m(y)630 +408 y(v)-5 b(ariable;)28 b(the)f Ft(-A)e Fu(option)h(means)g(eac)m(h)h +Fr(name)k Fu(refers)26 b(to)g(an)g(asso)s(ciativ)m(e)i(arra)m(y)f(v)-5 +b(ariable.)630 518 y(If)35 b(b)s(oth)g(options)h(are)h(supplied,)f +Ft(-A)f Fu(tak)m(es)i(precedence.)58 b(If)35 b(no)h Fr(name)k +Fu(argumen)m(ts)d(are)630 628 y(giv)m(en,)k(or)c(if)h(the)g +Ft(-p)f Fu(option)h(is)f(supplied,)i(a)f(list)g(of)g(all)g(readonly)g +(names)f(is)h(prin)m(ted.)630 737 y(The)32 b(other)g(options)g(ma)m(y)h +(b)s(e)f(used)f(to)i(restrict)g(the)f(output)g(to)h(a)f(subset)g(of)g +(the)g(set)h(of)630 847 y(readonly)c(names.)41 b(The)28 +b Ft(-p)h Fu(option)h(causes)g(output)e(to)j(b)s(e)d(displa)m(y)m(ed)i +(in)f(a)h(format)f(that)630 956 y(ma)m(y)j(b)s(e)e(reused)g(as)i +(input.)42 b(If)30 b(a)i(v)-5 b(ariable)31 b(name)h(is)f(follo)m(w)m +(ed)h(b)m(y)f(=)p Fr(v)-5 b(alue)p Fu(,)32 b(the)f(v)-5 +b(alue)32 b(of)630 1066 y(the)i(v)-5 b(ariable)34 b(is)f(set)i(to)f +Fr(v)-5 b(alue)p Fu(.)50 b(The)33 b(return)g(status)g(is)h(zero)g +(unless)f(an)g(in)m(v)-5 b(alid)34 b(option)630 1176 +y(is)c(supplied,)f(one)h(of)g(the)g Fr(name)35 b Fu(argumen)m(ts)30 +b(is)g(not)g(a)g(v)-5 b(alid)31 b(shell)f(v)-5 b(ariable)30 +b(or)g(function)630 1285 y(name,)h(or)f(the)h Ft(-f)e +Fu(option)i(is)g(supplied)e(with)h(a)h(name)f(that)h(is)f(not)h(a)g +(shell)f(function.)150 1450 y Ft(return)870 1587 y(return)46 +b([)p Fj(n)p Ft(])630 1724 y Fu(Cause)37 b(a)g(shell)h(function)f(to)g +(stop)h(executing)g(and)e(return)h(the)g(v)-5 b(alue)37 +b Fr(n)g Fu(to)h(its)f(caller.)630 1833 y(If)h Fr(n)h +Fu(is)g(not)g(supplied,)h(the)f(return)e(v)-5 b(alue)40 +b(is)f(the)g(exit)g(status)g(of)g(the)g(last)h(command)630 +1943 y(executed)35 b(in)f(the)h(function.)53 b Ft(return)33 +b Fu(ma)m(y)i(also)g(b)s(e)f(used)f(to)j(terminate)f(execution)h(of)630 +2052 y(a)e(script)g(b)s(eing)g(executed)g(with)g(the)g +Ft(.)g Fu(\()p Ft(source)p Fu(\))f(builtin,)h(returning)f(either)i +Fr(n)e Fu(or)h(the)630 2162 y(exit)j(status)f(of)g(the)g(last)h +(command)e(executed)i(within)e(the)h(script)g(as)g(the)g(exit)h(status) +630 2271 y(of)i(the)g(script.)65 b(If)38 b Fr(n)g Fu(is)h(supplied,)h +(the)f(return)e(v)-5 b(alue)39 b(is)g(its)g(least)h(signi\014can)m(t)g +(8)f(bits.)630 2381 y(An)m(y)g(command)f(asso)s(ciated)j(with)d(the)h +Ft(RETURN)e Fu(trap)i(is)g(executed)g(b)s(efore)g(execution)630 +2491 y(resumes)29 b(after)h(the)g(function)g(or)g(script.)40 +b(The)29 b(return)g(status)h(is)g(non-zero)g(if)g Ft(return)e +Fu(is)630 2600 y(supplied)h(a)i(non-n)m(umeric)g(argumen)m(t)g(or)f(is) +h(used)f(outside)h(a)g(function)f(and)g(not)h(during)630 +2710 y(the)g(execution)g(of)g(a)f(script)h(b)m(y)f Ft(.)g +Fu(or)g Ft(source)p Fu(.)150 2874 y Ft(shift)870 3011 +y(shift)46 b([)p Fj(n)p Ft(])630 3148 y Fu(Shift)41 b(the)g(p)s +(ositional)h(parameters)g(to)g(the)f(left)h(b)m(y)g Fr(n)p +Fu(.)73 b(The)40 b(p)s(ositional)j(parameters)630 3258 +y(from)34 b Fr(n)p Ft(+)p Fu(1)39 b(.)22 b(.)h(.)45 b +Ft($#)34 b Fu(are)g(renamed)g(to)h Ft($1)k Fu(.)22 b(.)g(.)46 +b Ft($#)p Fu(-)p Fr(n)p Fu(.)51 b(P)m(arameters)36 b(represen)m(ted)e +(b)m(y)g(the)630 3367 y(n)m(um)m(b)s(ers)25 b Ft($#)i +Fu(to)g Ft($#)p Fu(-)p Fr(n)p Ft(+)p Fu(1)g(are)g(unset.)39 +b Fr(n)26 b Fu(m)m(ust)h(b)s(e)f(a)i(non-negativ)m(e)h(n)m(um)m(b)s(er) +c(less)i(than)g(or)630 3477 y(equal)33 b(to)h Ft($#)p +Fu(.)47 b(If)33 b Fr(n)f Fu(is)h(zero)g(or)g(greater)h(than)f +Ft($#)p Fu(,)g(the)g(p)s(ositional)g(parameters)g(are)h(not)630 +3587 y(c)m(hanged.)48 b(If)32 b Fr(n)g Fu(is)h(not)f(supplied,)h(it)g +(is)f(assumed)g(to)h(b)s(e)f(1.)48 b(The)32 b(return)g(status)h(is)f +(zero)630 3696 y(unless)e Fr(n)f Fu(is)i(greater)g(than)g +Ft($#)e Fu(or)i(less)f(than)h(zero,)g(non-zero)g(otherwise.)150 +3861 y Ft(test)150 3970 y([)870 4107 y(test)47 b Fj(expr)630 +4244 y Fu(Ev)-5 b(aluate)40 b(a)f(conditional)h(express)f(ion)g +Fr(expr)45 b Fu(and)38 b(return)g(a)h(status)g(of)g(0)g(\(true\))h(or)f +(1)630 4354 y(\(false\).)j(Eac)m(h)31 b(op)s(erator)f(and)f(op)s(erand) +g(m)m(ust)h(b)s(e)f(a)i(separate)g(argumen)m(t.)41 b(Expressions)630 +4463 y(are)26 b(comp)s(osed)f(of)g(the)h(primaries)f(describ)s(ed)f(b)s +(elo)m(w)h(in)g(Section)h(6.4)h([Bash)e(Conditional)630 +4573 y(Expressions],)39 b(page)g(85.)64 b Ft(test)37 +b Fu(do)s(es)g(not)h(accept)i(an)m(y)e(options,)i(nor)e(do)s(es)f(it)h +(accept)630 4682 y(and)30 b(ignore)h(an)f(argumen)m(t)h(of)f +Ft(--)g Fu(as)h(signifying)f(the)h(end)f(of)g(options.)630 +4819 y(When)g(the)h Ft([)f Fu(form)g(is)g(used,)g(the)g(last)i(argumen) +m(t)e(to)i(the)e(command)g(m)m(ust)h(b)s(e)e(a)i Ft(])p +Fu(.)630 4956 y(Expressions)23 b(ma)m(y)h(b)s(e)e(com)m(bined)i(using)f +(the)h(follo)m(wing)h(op)s(erators,)g(listed)f(in)f(decreasing)630 +5066 y(order)30 b(of)h(precedence.)43 b(The)30 b(ev)-5 +b(aluation)33 b(dep)s(ends)28 b(on)j(the)g(n)m(um)m(b)s(er)f(of)h +(argumen)m(ts;)g(see)630 5176 y(b)s(elo)m(w.)41 b(Op)s(erator)30 +b(precedence)h(is)f(used)g(when)f(there)i(are)f(\014v)m(e)h(or)f(more)h +(argumen)m(ts.)630 5340 y Ft(!)f Fj(expr)210 b Fu(T)-8 +b(rue)30 b(if)g Fr(expr)37 b Fu(is)30 b(false.)p eop +end +%%Page: 46 52 +TeXDict begin 46 51 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(46)630 299 y Ft(\()30 +b Fj(expr)f Ft(\))133 b Fu(Returns)23 b(the)i(v)-5 b(alue)25 +b(of)f Fr(expr)p Fu(.)38 b(This)24 b(ma)m(y)h(b)s(e)e(used)h(to)h(o)m +(v)m(erride)g(the)g(normal)1110 408 y(precedence)31 b(of)f(op)s +(erators.)630 568 y Fj(expr1)f Ft(-a)h Fj(expr2)1110 +677 y Fu(T)-8 b(rue)30 b(if)g(b)s(oth)g Fr(expr1)37 b +Fu(and)30 b Fr(expr2)38 b Fu(are)30 b(true.)630 837 y +Fj(expr1)f Ft(-o)h Fj(expr2)1110 946 y Fu(T)-8 b(rue)30 +b(if)g(either)h Fr(expr1)38 b Fu(or)30 b Fr(expr2)37 +b Fu(is)31 b(true.)630 1106 y(The)37 b Ft(test)f Fu(and)g +Ft([)h Fu(builtins)g(ev)-5 b(aluate)39 b(conditional)f(expressions)f +(using)g(a)g(set)h(of)f(rules)630 1215 y(based)30 b(on)g(the)h(n)m(um)m +(b)s(er)e(of)h(argumen)m(ts.)630 1375 y(0)h(argumen)m(ts)1110 +1484 y(The)f(expression)g(is)g(false.)630 1644 y(1)h(argumen)m(t)1110 +1753 y(The)f(expression)g(is)g(true)h(if)f(and)g(only)g(if)h(the)f +(argumen)m(t)h(is)f(not)h(n)m(ull.)630 1913 y(2)g(argumen)m(ts)1110 +2022 y(If)f(the)h(\014rst)f(argumen)m(t)h(is)g(`)p Ft(!)p +Fu(',)g(the)g(expression)g(is)g(true)f(if)h(and)f(only)h(if)g(the)1110 +2132 y(second)j(argumen)m(t)f(is)h(n)m(ull.)50 b(If)33 +b(the)h(\014rst)e(argumen)m(t)i(is)g(one)g(of)f(the)h(unary)1110 +2242 y(conditional)42 b(op)s(erators)f(\(see)g(Section)h(6.4)f([Bash)g +(Conditional)g(Expres-)1110 2351 y(sions],)34 b(page)f(85\),)i(the)e +(expression)f(is)h(true)g(if)g(the)g(unary)e(test)j(is)f(true.)47 +b(If)1110 2461 y(the)33 b(\014rst)g(argumen)m(t)h(is)f(not)g(a)h(v)-5 +b(alid)34 b(unary)e(op)s(erator,)i(the)g(expression)f(is)1110 +2570 y(false.)630 2730 y(3)e(argumen)m(ts)1110 2839 y(The)44 +b(follo)m(wing)i(conditions)f(are)g(applied)f(in)g(the)g(order)g +(listed.)84 b(If)44 b(the)1110 2949 y(second)f(argumen)m(t)g(is)g(one)g +(of)g(the)g(binary)f(conditional)i(op)s(erators)f(\(see)1110 +3059 y(Section)h(6.4)g([Bash)g(Conditional)g(Expressions],)i(page)e +(85\),)k(the)43 b(result)1110 3168 y(of)h(the)h(expression)f(is)g(the)g +(result)g(of)h(the)f(binary)g(test)h(using)e(the)i(\014rst)1110 +3278 y(and)31 b(third)g(argumen)m(ts)i(as)f(op)s(erands.)44 +b(The)31 b(`)p Ft(-a)p Fu(')h(and)g(`)p Ft(-o)p Fu(')f(op)s(erators)i +(are)1110 3387 y(considered)25 b(binary)g(op)s(erators)g(when)f(there)i +(are)f(three)h(argumen)m(ts.)39 b(If)25 b(the)1110 3497 +y(\014rst)j(argumen)m(t)h(is)g(`)p Ft(!)p Fu(',)h(the)f(v)-5 +b(alue)29 b(is)g(the)g(negation)i(of)e(the)g(t)m(w)m(o-argumen)m(t)1110 +3606 y(test)38 b(using)f(the)g(second)g(and)g(third)f(argumen)m(ts.)61 +b(If)37 b(the)g(\014rst)f(argumen)m(t)1110 3716 y(is)j(exactly)i(`)p +Ft(\()p Fu(')f(and)f(the)g(third)g(argumen)m(t)h(is)f(exactly)i(`)p +Ft(\))p Fu(',)h(the)e(result)f(is)1110 3826 y(the)46 +b(one-argumen)m(t)g(test)h(of)f(the)f(second)h(argumen)m(t.)86 +b(Otherwise,)50 b(the)1110 3935 y(expression)30 b(is)h(false.)630 +4095 y(4)g(argumen)m(ts)1110 4204 y(If)h(the)i(\014rst)e(argumen)m(t)h +(is)g(`)p Ft(!)p Fu(',)h(the)f(result)g(is)g(the)g(negation)h(of)f(the) +g(three-)1110 4314 y(argumen)m(t)h(expression)f(comp)s(osed)h(of)f(the) +h(remaining)g(argumen)m(ts.)50 b(Oth-)1110 4423 y(erwise,)34 +b(the)f(expression)g(is)g(parsed)g(and)f(ev)-5 b(aluated)34 +b(according)h(to)e(prece-)1110 4533 y(dence)e(using)e(the)i(rules)f +(listed)h(ab)s(o)m(v)m(e.)630 4692 y(5)g(or)f(more)h(argumen)m(ts)1110 +4802 y(The)43 b(expression)f(is)i(parsed)e(and)g(ev)-5 +b(aluated)45 b(according)f(to)f(precedence)1110 4912 +y(using)30 b(the)g(rules)g(listed)h(ab)s(o)m(v)m(e.)630 +5071 y(When)40 b(used)f(with)g Ft(test)g Fu(or)h(`)p +Ft([)p Fu(',)j(the)d(`)p Ft(<)p Fu(')g(and)f(`)p Ft(>)p +Fu(')h(op)s(erators)g(sort)g(lexicographically)630 5181 +y(using)30 b(ASCI)s(I)f(ordering.)150 5340 y Ft(times)p +eop end +%%Page: 47 53 +TeXDict begin 47 52 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(47)870 299 y Ft(times)630 +434 y Fu(Prin)m(t)37 b(out)h(the)g(user)e(and)h(system)g(times)h(used)f +(b)m(y)g(the)h(shell)f(and)g(its)h(c)m(hildren.)61 b(The)630 +543 y(return)29 b(status)i(is)f(zero.)150 704 y Ft(trap)870 +838 y(trap)47 b([-lp])f([)p Fj(arg)p Ft(])g([)p Fj(sigspec)g +Ft(...)o(])630 973 y Fu(The)d(commands)f(in)h Fr(arg)51 +b Fu(are)44 b(to)g(b)s(e)e(read)h(and)g(executed)h(when)e(the)h(shell)g +(receiv)m(es)630 1083 y(signal)36 b Fr(sigsp)s(ec)p Fu(.)57 +b(If)35 b Fr(arg)44 b Fu(is)36 b(absen)m(t)g(\(and)f(there)h(is)g(a)f +(single)i Fr(sigsp)s(ec)6 b Fu(\))35 b(or)h(equal)g(to)h(`)p +Ft(-)p Fu(',)630 1192 y(eac)m(h)k(sp)s(eci\014ed)e(signal's)h(disp)s +(osition)g(is)f(reset)i(to)f(the)g(v)-5 b(alue)40 b(it)g(had)f(when)g +(the)h(shell)630 1302 y(w)m(as)33 b(started.)47 b(If)32 +b Fr(arg)41 b Fu(is)32 b(the)h(n)m(ull)f(string,)i(then)e(the)g(signal) +i(sp)s(eci\014ed)d(b)m(y)i(eac)m(h)g Fr(sigsp)s(ec)630 +1412 y Fu(is)g(ignored)h(b)m(y)f(the)g(shell)h(and)e(commands)h(it)h +(in)m(v)m(ok)m(es.)51 b(If)33 b Fr(arg)41 b Fu(is)33 +b(not)h(presen)m(t)f(and)g Ft(-p)630 1521 y Fu(has)g(b)s(een)g +(supplied,)f(the)i(shell)f(displa)m(ys)h(the)f(trap)g(commands)g(asso)s +(ciated)i(with)e(eac)m(h)630 1631 y Fr(sigsp)s(ec)p Fu(.)47 +b(If)31 b(no)i(argumen)m(ts)f(are)h(supplied,)e(or)i(only)f +Ft(-p)g Fu(is)g(giv)m(en,)i Ft(trap)d Fu(prin)m(ts)h(the)g(list)630 +1740 y(of)c(commands)f(asso)s(ciated)i(with)f(eac)m(h)h(signal)f(n)m +(um)m(b)s(er)e(in)i(a)g(form)f(that)h(ma)m(y)h(b)s(e)e(reused)630 +1850 y(as)f(shell)h(input.)38 b(The)26 b Ft(-l)f Fu(option)i(causes)f +(the)g(shell)h(to)g(prin)m(t)e(a)i(list)f(of)h(signal)g(names)f(and)630 +1960 y(their)33 b(corresp)s(onding)f(n)m(um)m(b)s(ers.)47 +b(Eac)m(h)34 b Fr(sigsp)s(ec)39 b Fu(is)33 b(either)g(a)h(signal)g +(name)f(or)g(a)g(signal)630 2069 y(n)m(um)m(b)s(er.)39 +b(Signal)31 b(names)f(are)h(case)h(insensitiv)m(e)f(and)f(the)g +Ft(SIG)g Fu(pre\014x)f(is)i(optional.)630 2204 y(If)k(a)g +Fr(sigsp)s(ec)41 b Fu(is)35 b Ft(0)g Fu(or)g Ft(EXIT)p +Fu(,)g Fr(arg)43 b Fu(is)35 b(executed)h(when)e(the)h(shell)h(exits.)55 +b(If)35 b(a)g Fr(sigsp)s(ec)41 b Fu(is)630 2314 y Ft(DEBUG)p +Fu(,)32 b(the)g(command)g Fr(arg)40 b Fu(is)33 b(executed)g(b)s(efore)f +(ev)m(ery)h(simple)f(command,)h Ft(for)e Fu(com-)630 +2423 y(mand,)d Ft(case)g Fu(command,)h Ft(select)e Fu(command,)i(ev)m +(ery)h(arithmetic)g Ft(for)d Fu(command,)j(and)630 2533 +y(b)s(efore)22 b(the)g(\014rst)f(command)h(executes)i(in)e(a)g(shell)h +(function.)37 b(Refer)22 b(to)h(the)g(description)f(of)630 +2642 y(the)i Ft(extdebug)d Fu(option)j(to)h(the)f Ft(shopt)e +Fu(builtin)h(\(see)i(Section)f(4.3.2)i([The)d(Shopt)g(Builtin],)630 +2752 y(page)33 b(62\))g(for)f(details)h(of)f(its)h(e\013ect)g(on)f(the) +g Ft(DEBUG)f Fu(trap.)46 b(If)31 b(a)i Fr(sigsp)s(ec)38 +b Fu(is)32 b Ft(RETURN)p Fu(,)f(the)630 2862 y(command)h +Fr(arg)41 b Fu(is)33 b(executed)g(eac)m(h)h(time)f(a)g(shell)g +(function)g(or)f(a)h(script)g(executed)g(with)630 2971 +y(the)e Ft(.)f Fu(or)g Ft(source)f Fu(builtins)g(\014nishes)h +(executing.)630 3106 y(If)20 b(a)i Fr(sigsp)s(ec)27 b +Fu(is)21 b Ft(ERR)p Fu(,)h(the)f(command)g Fr(arg)29 +b Fu(is)21 b(executed)h(whenev)m(er)e(a)i(pip)s(eline)e(\(whic)m(h)h +(ma)m(y)630 3216 y(consist)35 b(of)g(a)f(single)h(simple)g(command\),)h +(a)e(list,)j(or)d(a)h(comp)s(ound)e(command)h(returns)630 +3325 y(a)41 b(non-zero)g(exit)h(status,)h(sub)5 b(ject)41 +b(to)g(the)g(follo)m(wing)h(conditions.)72 b(The)40 b +Ft(ERR)f Fu(trap)i(is)630 3435 y(not)c(executed)h(if)f(the)h(failed)f +(command)g(is)g(part)g(of)h(the)f(command)g(list)h(immediately)630 +3544 y(follo)m(wing)30 b(an)e Ft(until)f Fu(or)i Ft(while)e +Fu(k)m(eyw)m(ord,)i(part)g(of)f(the)h(test)g(follo)m(wing)h(the)f +Ft(if)f Fu(or)g Ft(elif)630 3654 y Fu(reserv)m(ed)45 +b(w)m(ords,)j(part)c(of)h(a)g(command)g(executed)g(in)g(a)g +Ft(&&)f Fu(or)h Ft(||)f Fu(list)h(except)h(the)630 3764 +y(command)28 b(follo)m(wing)j(the)d(\014nal)h Ft(&&)f +Fu(or)g Ft(||)p Fu(,)h(an)m(y)g(command)f(in)h(a)g(pip)s(eline)f(but)g +(the)h(last,)630 3873 y(or)d(if)g(the)f(command's)h(return)f(status)h +(is)g(b)s(eing)f(in)m(v)m(erted)i(using)e Ft(!)p Fu(.)39 +b(These)25 b(are)i(the)f(same)630 3983 y(conditions)31 +b(ob)s(ey)m(ed)f(b)m(y)h(the)f Ft(errexit)f Fu(\()p Ft(-e)p +Fu(\))h(option.)630 4118 y(Signals)37 b(ignored)f(up)s(on)f(en)m(try)i +(to)g(the)f(shell)h(cannot)g(b)s(e)f(trapp)s(ed)f(or)h(reset.)59 +b(T)-8 b(rapp)s(ed)630 4227 y(signals)28 b(that)f(are)h(not)f(b)s(eing) +g(ignored)g(are)g(reset)h(to)g(their)f(original)h(v)-5 +b(alues)28 b(in)e(a)i(subshell)630 4337 y(or)i(subshell)g(en)m +(vironmen)m(t)h(when)e(one)i(is)f(created.)630 4472 y(The)g(return)f +(status)i(is)f(zero)h(unless)f(a)h Fr(sigsp)s(ec)36 b +Fu(do)s(es)30 b(not)h(sp)s(ecify)f(a)g(v)-5 b(alid)31 +b(signal.)150 4632 y Ft(umask)870 4767 y(umask)46 b([-p])h([-S])g([)p +Fj(mode)p Ft(])630 4902 y Fu(Set)30 b(the)f(shell)h(pro)s(cess's)f +(\014le)h(creation)g(mask)g(to)g Fr(mo)s(de)p Fu(.)40 +b(If)29 b Fr(mo)s(de)34 b Fu(b)s(egins)29 b(with)g(a)h(digit,)630 +5011 y(it)e(is)f(in)m(terpreted)g(as)g(an)g(o)s(ctal)i(n)m(um)m(b)s +(er;)e(if)g(not,)h(it)g(is)f(in)m(terpreted)g(as)g(a)h(sym)m(b)s(olic)f +(mo)s(de)630 5121 y(mask)i(similar)g(to)g(that)h(accepted)g(b)m(y)f +(the)g Ft(chmod)e Fu(command.)40 b(If)28 b Fr(mo)s(de)34 +b Fu(is)28 b(omitted,)j(the)630 5230 y(curren)m(t)39 +b(v)-5 b(alue)40 b(of)f(the)g(mask)g(is)h(prin)m(ted.)66 +b(If)39 b(the)g Ft(-S)g Fu(option)g(is)h(supplied)d(without)j(a)630 +5340 y Fr(mo)s(de)d Fu(argumen)m(t,)d(the)e(mask)g(is)h(prin)m(ted)f +(in)g(a)g(sym)m(b)s(olic)h(format.)47 b(If)32 b(the)g +Ft(-p)g Fu(option)h(is)p eop end +%%Page: 48 54 +TeXDict begin 48 53 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(48)630 299 y(supplied,)32 +b(and)f Fr(mo)s(de)37 b Fu(is)32 b(omitted,)i(the)f(output)f(is)g(in)g +(a)g(form)g(that)h(ma)m(y)g(b)s(e)e(reused)h(as)630 408 +y(input.)62 b(The)38 b(return)f(status)h(is)g(zero)g(if)g(the)g(mo)s +(de)g(is)g(successfully)g(c)m(hanged)g(or)g(if)g(no)630 +518 y Fr(mo)s(de)d Fu(argumen)m(t)c(is)f(supplied,)g(and)f(non-zero)i +(otherwise.)630 660 y(Note)38 b(that)e(when)g(the)g(mo)s(de)g(is)g(in)m +(terpreted)h(as)f(an)g(o)s(ctal)i(n)m(um)m(b)s(er,)e(eac)m(h)i(n)m(um)m +(b)s(er)d(of)630 770 y(the)f(umask)g(is)h(subtracted)f(from)f +Ft(7)p Fu(.)53 b(Th)m(us,)34 b(a)h(umask)e(of)i Ft(022)e +Fu(results)h(in)g(p)s(ermissions)630 879 y(of)d Ft(755)p +Fu(.)150 1054 y Ft(unset)870 1196 y(unset)46 b([-fnv])g([)p +Fj(name)p Ft(])630 1338 y Fu(Remo)m(v)m(e)36 b(eac)m(h)f(v)-5 +b(ariable)35 b(or)f(function)f Fr(name)p Fu(.)52 b(If)33 +b(the)i Ft(-v)e Fu(option)h(is)g(giv)m(en,)j(eac)m(h)e +Fr(name)630 1448 y Fu(refers)24 b(to)h(a)g(shell)f(v)-5 +b(ariable)25 b(and)f(that)h(v)-5 b(ariable)25 b(is)f(rem)m(v)m(o)m(v)m +(ed.)41 b(If)23 b(the)i Ft(-f)f Fu(option)g(is)h(giv)m(en,)630 +1557 y(the)37 b Fr(name)5 b Fu(s)37 b(refer)f(to)i(shell)f(functions,)h +(and)e(the)h(function)g(de\014nition)f(is)h(remo)m(v)m(ed.)61 +b(If)630 1667 y(the)34 b Ft(-n)e Fu(option)i(is)g(supplied,)f(and)g +Fr(name)38 b Fu(is)c(a)f(v)-5 b(ariable)34 b(with)g(the)f +Fr(nameref)51 b Fu(attribute,)630 1776 y Fr(name)42 b +Fu(will)37 b(b)s(e)f(unset)g(rather)g(than)h(the)g(v)-5 +b(ariable)37 b(it)g(references.)60 b Ft(-n)36 b Fu(has)g(no)h(e\013ect) +h(if)630 1886 y(the)h Ft(-f)g Fu(option)g(is)h(supplied.)65 +b(If)39 b(no)g(options)h(are)f(supplied,)h(eac)m(h)h +Fr(name)j Fu(refers)39 b(to)h(a)630 1995 y(v)-5 b(ariable;)37 +b(if)d(there)g(is)g(no)g(v)-5 b(ariable)34 b(b)m(y)g(that)h(name,)g(an) +m(y)f(function)g(with)f(that)i(name)f(is)630 2105 y(unset.)46 +b(Readonly)33 b(v)-5 b(ariables)33 b(and)e(functions)h(ma)m(y)h(not)g +(b)s(e)e(unset.)47 b(The)31 b(return)h(status)630 2215 +y(is)e(zero)i(unless)d(a)i Fr(name)36 b Fu(is)30 b(readonly)-8 +b(.)150 2470 y Fs(4.2)68 b(Bash)45 b(Builtin)g(Commands)150 +2629 y Fu(This)c(section)h(describ)s(es)f(builtin)f(commands)h(whic)m +(h)g(are)h(unique)e(to)j(or)e(ha)m(v)m(e)h(b)s(een)f(extended)g(in)150 +2739 y(Bash.)g(Some)30 b(of)h(these)g(commands)f(are)g(sp)s(eci\014ed)g +(in)g(the)h Fm(posix)e Fu(standard.)150 2921 y Ft(alias)870 +3063 y(alias)46 b([-p])h([)p Fj(name)p Ft([=)p Fj(value)p +Ft(])d(...)o(])630 3205 y Fu(Without)26 b(argumen)m(ts)f(or)g(with)f +(the)h Ft(-p)g Fu(option,)h Ft(alias)e Fu(prin)m(ts)g(the)h(list)h(of)f +(aliases)h(on)f(the)630 3315 y(standard)g(output)g(in)g(a)h(form)f +(that)h(allo)m(ws)h(them)e(to)h(b)s(e)f(reused)g(as)g(input.)39 +b(If)25 b(argumen)m(ts)630 3424 y(are)j(supplied,)e(an)i(alias)g(is)f +(de\014ned)f(for)h(eac)m(h)h Fr(name)33 b Fu(whose)27 +b Fr(v)-5 b(alue)33 b Fu(is)27 b(giv)m(en.)41 b(If)26 +b(no)h Fr(v)-5 b(alue)630 3534 y Fu(is)37 b(giv)m(en,)j(the)d(name)g +(and)g(v)-5 b(alue)37 b(of)h(the)f(alias)h(is)f(prin)m(ted.)61 +b(Aliases)38 b(are)f(describ)s(ed)f(in)630 3643 y(Section)31 +b(6.6)h([Aliases],)g(page)f(88.)150 3818 y Ft(bind)870 +3960 y(bind)47 b([-m)g Fj(keymap)p Ft(])e([-lpsvPSVX])870 +4070 y(bind)i([-m)g Fj(keymap)p Ft(])e([-q)i Fj(function)p +Ft(])f([-u)g Fj(function)p Ft(])g([-r)h Fj(keyseq)p Ft(])870 +4179 y(bind)g([-m)g Fj(keymap)p Ft(])e(-f)j Fj(filename)870 +4289 y Ft(bind)f([-m)g Fj(keymap)p Ft(])e(-x)j Fj(keyseq:shell-command) +870 4398 y Ft(bind)f([-m)g Fj(keymap)p Ft(])e Fj(keyseq:function-name) +870 4508 y Ft(bind)i Fj(readline-command)630 4650 y Fu(Displa)m(y)22 +b(curren)m(t)f(Readline)h(\(see)f(Chapter)g(8)g([Command)f(Line)h +(Editing],)j(page)e(101\))g(k)m(ey)630 4760 y(and)36 +b(function)g(bindings,)i(bind)d(a)i(k)m(ey)g(sequence)g(to)h(a)f +(Readline)g(function)f(or)h(macro,)630 4869 y(or)44 b(set)h(a)g +(Readline)f(v)-5 b(ariable.)83 b(Eac)m(h)45 b(non-option)g(argumen)m(t) +f(is)g(a)h(command)f(as)g(it)630 4979 y(w)m(ould)e(app)s(ear)f(in)h(a)h +(Readline)g(initialization)i(\014le)d(\(see)h(Section)g(8.3)g +([Readline)g(Init)630 5088 y(File],)c(page)d(104\),)j(but)c(eac)m(h)h +(binding)f(or)g(command)h(m)m(ust)f(b)s(e)g(passed)g(as)h(a)g(separate) +630 5198 y(argumen)m(t;)31 b(e.g.,)h(`)p Ft +("\\C-x\\C-r":re-read-init-f)o(ile)p Fu('.)630 5340 y(Options,)e(if)h +(supplied,)e(ha)m(v)m(e)i(the)g(follo)m(wing)h(meanings:)p +eop end +%%Page: 49 55 +TeXDict begin 49 54 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(49)630 299 y Ft(-m)30 +b Fj(keymap)66 b Fu(Use)54 b Fr(k)m(eymap)j Fu(as)d(the)g(k)m(eymap)g +(to)h(b)s(e)e(a\013ected)i(b)m(y)f(the)g(subsequen)m(t)1110 +408 y(bindings.)46 b(Acceptable)34 b Fr(k)m(eymap)i Fu(names)c(are)h +Ft(emacs)p Fu(,)f Ft(emacs-standard)p Fu(,)1110 518 y +Ft(emacs-meta)p Fu(,)99 b Ft(emacs-ctlx)p Fu(,)f Ft(vi)p +Fu(,)j Ft(vi-move)p Fu(,)f Ft(vi-command)p Fu(,)f(and)1110 +628 y Ft(vi-insert)p Fu(.)64 b Ft(vi)38 b Fu(is)h(equiv)-5 +b(alen)m(t)41 b(to)e Ft(vi-command)p Fu(;)i Ft(emacs)c +Fu(is)i(equiv)-5 b(alen)m(t)1110 737 y(to)31 b Ft(emacs-standard)p +Fu(.)630 888 y Ft(-l)384 b Fu(List)31 b(the)f(names)g(of)h(all)g +(Readline)g(functions.)630 1039 y Ft(-p)384 b Fu(Displa)m(y)34 +b(Readline)f(function)g(names)g(and)f(bindings)f(in)i(suc)m(h)f(a)i(w)m +(a)m(y)f(that)1110 1148 y(they)e(can)f(b)s(e)g(used)g(as)g(input)g(or)g +(in)g(a)h(Readline)g(initialization)i(\014le.)630 1299 +y Ft(-P)384 b Fu(List)31 b(curren)m(t)f(Readline)h(function)f(names)g +(and)g(bindings.)630 1450 y Ft(-v)384 b Fu(Displa)m(y)25 +b(Readline)f(v)-5 b(ariable)25 b(names)f(and)f(v)-5 b(alues)24 +b(in)g(suc)m(h)f(a)i(w)m(a)m(y)f(that)h(they)1110 1559 +y(can)31 b(b)s(e)e(used)h(as)h(input)e(or)h(in)g(a)h(Readline)g +(initialization)j(\014le.)630 1710 y Ft(-V)384 b Fu(List)31 +b(curren)m(t)f(Readline)h(v)-5 b(ariable)31 b(names)f(and)g(v)-5 +b(alues.)630 1861 y Ft(-s)384 b Fu(Displa)m(y)39 b(Readline)f(k)m(ey)g +(sequences)f(b)s(ound)f(to)i(macros)g(and)f(the)g(strings)1110 +1970 y(they)d(output)f(in)h(suc)m(h)f(a)h(w)m(a)m(y)h(that)f(they)g +(can)g(b)s(e)f(used)g(as)h(input)e(or)i(in)g(a)1110 2080 +y(Readline)d(initialization)i(\014le.)630 2230 y Ft(-S)384 +b Fu(Displa)m(y)39 b(Readline)f(k)m(ey)g(sequences)f(b)s(ound)f(to)i +(macros)g(and)f(the)g(strings)1110 2340 y(they)31 b(output.)630 +2491 y Ft(-f)f Fj(filename)1110 2600 y Fu(Read)h(k)m(ey)g(bindings)e +(from)h Fr(\014lename)p Fu(.)630 2751 y Ft(-q)g Fj(function)1110 +2861 y Fu(Query)g(ab)s(out)g(whic)m(h)g(k)m(eys)h(in)m(v)m(ok)m(e)h +(the)f(named)f Fr(function)p Fu(.)630 3011 y Ft(-u)g +Fj(function)1110 3121 y Fu(Un)m(bind)f(all)i(k)m(eys)g(b)s(ound)e(to)i +(the)f(named)g Fr(function)p Fu(.)630 3271 y Ft(-r)g +Fj(keyseq)66 b Fu(Remo)m(v)m(e)32 b(an)m(y)f(curren)m(t)f(binding)f +(for)h Fr(k)m(eyseq)p Fu(.)630 3422 y Ft(-x)g Fj(keyseq:shell-command) +1110 3532 y Fu(Cause)35 b Fr(shell-command)k Fu(to)d(b)s(e)f(executed)h +(whenev)m(er)f Fr(k)m(eyseq)j Fu(is)d(en)m(tered.)1110 +3641 y(When)46 b Fr(shell-command)k Fu(is)c(executed,)51 +b(the)46 b(shell)g(sets)g(the)g Ft(READLINE_)1110 3751 +y(LINE)37 b Fu(v)-5 b(ariable)38 b(to)g(the)g(con)m(ten)m(ts)i(of)e +(the)g(Readline)g(line)g(bu\013er)f(and)g(the)1110 3861 +y Ft(READLINE_POINT)e Fu(v)-5 b(ariable)39 b(to)h(the)e(curren)m(t)h +(lo)s(cation)h(of)f(the)g(insertion)1110 3970 y(p)s(oin)m(t.)59 +b(If)37 b(the)f(executed)i(command)e(c)m(hanges)i(the)f(v)-5 +b(alue)37 b(of)f Ft(READLINE_)1110 4080 y(LINE)29 b Fu(or)h +Ft(READLINE_POINT)p Fu(,)c(those)31 b(new)e(v)-5 b(alues)31 +b(will)f(b)s(e)f(re\015ected)i(in)f(the)1110 4189 y(editing)h(state.) +630 4340 y Ft(-X)384 b Fu(List)27 b(all)i(k)m(ey)f(sequences)f(b)s +(ound)e(to)j(shell)g(commands)e(and)h(the)g(asso)s(ciated)1110 +4450 y(commands)j(in)g(a)h(format)g(that)f(can)h(b)s(e)f(reused)f(as)i +(input.)630 4600 y(The)26 b(return)f(status)i(is)f(zero)i(unless)d(an)i +(in)m(v)-5 b(alid)27 b(option)g(is)f(supplied)f(or)i(an)f(error)g(o)s +(ccurs.)150 4751 y Ft(builtin)870 4881 y(builtin)46 b([)p +Fj(shell-builtin)e Ft([)p Fj(args)p Ft(]])630 5011 y +Fu(Run)35 b(a)i(shell)f(builtin,)i(passing)e(it)h Fr(args)p +Fu(,)h(and)e(return)f(its)i(exit)g(status.)59 b(This)35 +b(is)i(useful)630 5121 y(when)29 b(de\014ning)h(a)g(shell)h(function)f +(with)g(the)g(same)h(name)f(as)h(a)g(shell)f(builtin,)g(retaining)630 +5230 y(the)k(functionalit)m(y)h(of)f(the)f(builtin)g(within)g(the)h +(function.)50 b(The)33 b(return)g(status)h(is)f(non-)630 +5340 y(zero)e(if)g Fr(shell-builtin)f Fu(is)g(not)h(a)g(shell)f +(builtin)g(command.)p eop end +%%Page: 50 56 +TeXDict begin 50 55 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(50)150 299 y Ft(caller)870 +443 y(caller)46 b([)p Fj(expr)p Ft(])630 587 y Fu(Returns)34 +b(the)g(con)m(text)j(of)e(an)m(y)g(activ)m(e)i(subroutine)c(call)j(\(a) +f(shell)g(function)f(or)h(a)g(script)630 696 y(executed)c(with)f(the)h +Ft(.)f Fu(or)g Ft(source)f Fu(builtins\).)630 840 y(Without)45 +b Fr(expr)p Fu(,)j Ft(caller)43 b Fu(displa)m(ys)i(the)f(line)h(n)m(um) +m(b)s(er)f(and)g(source)g(\014lename)h(of)g(the)630 950 +y(curren)m(t)35 b(subroutine)g(call.)58 b(If)35 b(a)h(non-negativ)m(e)i +(in)m(teger)f(is)f(supplied)e(as)i Fr(expr)p Fu(,)h Ft(caller)630 +1059 y Fu(displa)m(ys)k(the)f(line)h(n)m(um)m(b)s(er,)h(subroutine)d +(name,)44 b(and)c(source)g(\014le)h(corresp)s(onding)e(to)630 +1169 y(that)c(p)s(osition)g(in)f(the)h(curren)m(t)f(execution)i(call)g +(stac)m(k.)54 b(This)34 b(extra)h(information)g(ma)m(y)630 +1278 y(b)s(e)30 b(used,)g(for)g(example,)h(to)g(prin)m(t)f(a)h(stac)m +(k)h(trace.)42 b(The)29 b(curren)m(t)i(frame)f(is)g(frame)h(0.)630 +1422 y(The)d(return)g(v)-5 b(alue)29 b(is)g(0)g(unless)f(the)h(shell)g +(is)g(not)g(executing)h(a)f(subroutine)e(call)j(or)f +Fr(expr)630 1532 y Fu(do)s(es)h(not)h(corresp)s(ond)e(to)i(a)g(v)-5 +b(alid)30 b(p)s(osition)h(in)f(the)g(call)i(stac)m(k.)150 +1710 y Ft(command)870 1854 y(command)46 b([-pVv])g Fj(command)g +Ft([)p Fj(arguments)f Ft(...)o(])630 1998 y Fu(Runs)32 +b Fr(command)k Fu(with)d Fr(argumen)m(ts)k Fu(ignoring)c(an)m(y)g +(shell)h(function)e(named)h Fr(command)p Fu(.)630 2107 +y(Only)39 b(shell)i(builtin)e(commands)h(or)g(commands)f(found)g(b)m(y) +h(searc)m(hing)h(the)f Ft(PATH)f Fu(are)630 2217 y(executed.)59 +b(If)36 b(there)h(is)f(a)h(shell)f(function)g(named)g +Ft(ls)p Fu(,)h(running)e(`)p Ft(command)29 b(ls)p Fu(')35 +b(within)630 2326 y(the)c(function)f(will)h(execute)g(the)g(external)g +(command)g Ft(ls)f Fu(instead)g(of)h(calling)h(the)f(func-)630 +2436 y(tion)36 b(recursiv)m(ely)-8 b(.)56 b(The)34 b +Ft(-p)h Fu(option)g(means)g(to)h(use)f(a)g(default)h(v)-5 +b(alue)35 b(for)g Ft(PATH)f Fu(that)i(is)630 2545 y(guaran)m(teed)f(to) +f(\014nd)e(all)j(of)f(the)g(standard)f(utilities.)52 +b(The)33 b(return)g(status)h(in)f(this)h(case)630 2655 +y(is)29 b(127)g(if)g Fr(command)j Fu(cannot)d(b)s(e)e(found)h(or)g(an)g +(error)h(o)s(ccurred,)f(and)g(the)h(exit)g(status)g(of)630 +2765 y Fr(command)34 b Fu(otherwise.)630 2908 y(If)e(either)h(the)f +Ft(-V)g Fu(or)g Ft(-v)g Fu(option)h(is)f(supplied,)g(a)h(description)f +(of)h Fr(command)j Fu(is)c(prin)m(ted.)630 3018 y(The)f +Ft(-v)h Fu(option)g(causes)g(a)g(single)h(w)m(ord)f(indicating)g(the)g +(command)g(or)g(\014le)g(name)g(used)630 3128 y(to)40 +b(in)m(v)m(ok)m(e)h Fr(command)h Fu(to)e(b)s(e)e(displa)m(y)m(ed;)44 +b(the)39 b Ft(-V)f Fu(option)i(pro)s(duces)d(a)j(more)f(v)m(erb)s(ose) +630 3237 y(description.)61 b(In)36 b(this)h(case,)j(the)e(return)e +(status)h(is)g(zero)h(if)f Fr(command)k Fu(is)c(found,)h(and)630 +3347 y(non-zero)31 b(if)f(not.)150 3525 y Ft(declare)870 +3669 y(declare)46 b([-aAfFgilnrtux])d([-p])k([)p Fj(name)p +Ft([=)p Fj(value)p Ft(])d(...)o(])630 3813 y Fu(Declare)29 +b(v)-5 b(ariables)28 b(and)e(giv)m(e)j(them)e(attributes.)40 +b(If)27 b(no)g Fr(name)5 b Fu(s)27 b(are)h(giv)m(en,)h(then)e(displa)m +(y)630 3922 y(the)k(v)-5 b(alues)30 b(of)h(v)-5 b(ariables)31 +b(instead.)630 4066 y(The)k Ft(-p)f Fu(option)i(will)g(displa)m(y)f +(the)h(attributes)g(and)e(v)-5 b(alues)36 b(of)f(eac)m(h)i +Fr(name)p Fu(.)55 b(When)36 b Ft(-p)630 4176 y Fu(is)i(used)g(with)g +Fr(name)43 b Fu(argumen)m(ts,)e(additional)e(options,)i(other)d(than)g +Ft(-f)g Fu(and)g Ft(-F)p Fu(,)i(are)630 4285 y(ignored.)630 +4429 y(When)g Ft(-p)g Fu(is)g(supplied)f(without)i Fr(name)k +Fu(argumen)m(ts,)f Ft(declare)38 b Fu(will)j(displa)m(y)f(the)h(at-)630 +4539 y(tributes)31 b(and)f(v)-5 b(alues)31 b(of)g(all)h(v)-5 +b(ariables)31 b(ha)m(ving)h(the)f(attributes)g(sp)s(eci\014ed)f(b)m(y)h +(the)g(addi-)630 4648 y(tional)k(options.)52 b(If)34 +b(no)g(other)g(options)g(are)g(supplied)f(with)h Ft(-p)p +Fu(,)g Ft(declare)e Fu(will)j(displa)m(y)630 4758 y(the)e(attributes)h +(and)e(v)-5 b(alues)33 b(of)g(all)h(shell)f(v)-5 b(ariables.)50 +b(The)32 b Ft(-f)g Fu(option)i(will)f(restrict)h(the)630 +4867 y(displa)m(y)d(to)g(shell)f(functions.)630 5011 +y(The)41 b Ft(-F)f Fu(option)i(inhibits)e(the)i(displa)m(y)f(of)g +(function)g(de\014nitions;)47 b(only)41 b(the)g(function)630 +5121 y(name)30 b(and)f(attributes)i(are)f(prin)m(ted.)40 +b(If)30 b(the)g Ft(extdebug)e Fu(shell)i(option)g(is)g(enabled)g(using) +630 5230 y Ft(shopt)24 b Fu(\(see)i(Section)g(4.3.2)i([The)d(Shopt)f +(Builtin],)k(page)e(62\),)i(the)d(source)h(\014le)f(name)h(and)630 +5340 y(line)31 b(n)m(um)m(b)s(er)e(where)h(the)g(function)g(is)h +(de\014ned)e(are)i(displa)m(y)m(ed)g(as)f(w)m(ell.)42 +b Ft(-F)30 b Fu(implies)g Ft(-f)p Fu(.)p eop end +%%Page: 51 57 +TeXDict begin 51 56 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(51)630 299 y(The)36 +b Ft(-g)g Fu(option)h(forces)g(v)-5 b(ariables)37 b(to)g(b)s(e)f +(created)i(or)e(mo)s(di\014ed)g(at)h(the)g(global)h(scop)s(e,)630 +408 y(ev)m(en)g(when)e Ft(declare)f Fu(is)j(executed)g(in)f(a)g(shell)h +(function.)61 b(It)37 b(is)g(ignored)h(in)f(all)h(other)630 +518 y(cases.)630 654 y(The)27 b(follo)m(wing)h(options)g(can)f(b)s(e)g +(used)f(to)i(restrict)g(output)e(to)i(v)-5 b(ariables)28 +b(with)f(the)g(sp)s(ec-)630 764 y(i\014ed)j(attributes)h(or)f(to)h(giv) +m(e)h(v)-5 b(ariables)31 b(attributes:)630 926 y Ft(-a)384 +b Fu(Eac)m(h)36 b Fr(name)k Fu(is)34 b(an)h(indexed)g(arra)m(y)g(v)-5 +b(ariable)36 b(\(see)f(Section)h(6.7)g([Arra)m(ys],)1110 +1035 y(page)31 b(89\).)630 1198 y Ft(-A)384 b Fu(Eac)m(h)24 +b Fr(name)k Fu(is)23 b(an)g(asso)s(ciativ)m(e)j(arra)m(y)e(v)-5 +b(ariable)24 b(\(see)g(Section)g(6.7)g([Arra)m(ys],)1110 +1307 y(page)31 b(89\).)630 1469 y Ft(-f)384 b Fu(Use)31 +b(function)f(names)g(only)-8 b(.)630 1631 y Ft(-i)384 +b Fu(The)36 b(v)-5 b(ariable)37 b(is)f(to)h(b)s(e)f(treated)h(as)g(an)f +(in)m(teger;)41 b(arithmetic)c(ev)-5 b(aluation)1110 +1741 y(\(see)29 b(Section)f(6.5)h([Shell)f(Arithmetic],)i(page)e(87\))h +(is)f(p)s(erformed)e(when)h(the)1110 1851 y(v)-5 b(ariable)31 +b(is)g(assigned)f(a)h(v)-5 b(alue.)630 2013 y Ft(-l)384 +b Fu(When)26 b(the)g(v)-5 b(ariable)27 b(is)f(assigned)g(a)g(v)-5 +b(alue,)28 b(all)f(upp)s(er-case)e(c)m(haracters)j(are)1110 +2122 y(con)m(v)m(erted)k(to)f(lo)m(w)m(er-case.)43 b(The)30 +b(upp)s(er-case)g(attribute)h(is)g(disabled.)630 2285 +y Ft(-n)384 b Fu(Giv)m(e)28 b(eac)m(h)g Fr(name)k Fu(the)27 +b Fr(nameref)44 b Fu(attribute,)28 b(making)f(it)h(a)f(name)f +(reference)1110 2394 y(to)32 b(another)g(v)-5 b(ariable.)46 +b(That)31 b(other)h(v)-5 b(ariable)33 b(is)f(de\014ned)e(b)m(y)i(the)g +(v)-5 b(alue)32 b(of)1110 2504 y Fr(name)p Fu(.)39 b(All)26 +b(references)g(and)f(assignmen)m(ts)h(to)g Fr(name)p +Fu(,)h(except)g(for)e(c)m(hanging)1110 2613 y(the)43 +b Ft(-n)f Fu(attribute)i(itself,)j(are)c(p)s(erformed)f(on)g(the)h(v)-5 +b(ariable)44 b(referenced)1110 2723 y(b)m(y)h Fr(name)5 +b Fu('s)46 b(v)-5 b(alue.)86 b(The)45 b Ft(-n)f Fu(attribute)j(cannot)e +(b)s(e)g(applied)g(to)h(arra)m(y)1110 2833 y(v)-5 b(ariables.)630 +2995 y Ft(-r)384 b Fu(Mak)m(e)25 b Fr(name)5 b Fu(s)23 +b(readonly)-8 b(.)39 b(These)24 b(names)f(cannot)h(then)f(b)s(e)g +(assigned)h(v)-5 b(alues)1110 3104 y(b)m(y)30 b(subsequen)m(t)g +(assignmen)m(t)h(statemen)m(ts)h(or)f(unset.)630 3267 +y Ft(-t)384 b Fu(Giv)m(e)33 b(eac)m(h)h Fr(name)j Fu(the)32 +b Ft(trace)f Fu(attribute.)46 b(T)-8 b(raced)32 b(functions)g(inherit)g +(the)1110 3376 y Ft(DEBUG)26 b Fu(and)h Ft(RETURN)f Fu(traps)h(from)g +(the)h(calling)h(shell.)40 b(The)27 b(trace)i(attribute)1110 +3486 y(has)h(no)g(sp)s(ecial)h(meaning)g(for)f(v)-5 b(ariables.)630 +3648 y Ft(-u)384 b Fu(When)28 b(the)h(v)-5 b(ariable)29 +b(is)f(assigned)h(a)f(v)-5 b(alue,)30 b(all)f(lo)m(w)m(er-case)i(c)m +(haracters)f(are)1110 3758 y(con)m(v)m(erted)i(to)f(upp)s(er-case.)40 +b(The)30 b(lo)m(w)m(er-case)j(attribute)e(is)g(disabled.)630 +3920 y Ft(-x)384 b Fu(Mark)30 b(eac)m(h)h Fr(name)k Fu(for)29 +b(exp)s(ort)h(to)g(subsequen)m(t)f(commands)h(via)g(the)g(en)m(vi-)1110 +4029 y(ronmen)m(t.)630 4191 y(Using)e(`)p Ft(+)p Fu(')h(instead)f(of)g +(`)p Ft(-)p Fu(')g(turns)f(o\013)i(the)f(attribute)h(instead,)g(with)f +(the)g(exceptions)h(that)630 4301 y(`)p Ft(+a)p Fu(')h(ma)m(y)h(not)f +(b)s(e)f(used)g(to)i(destro)m(y)g(an)f(arra)m(y)g(v)-5 +b(ariable)31 b(and)f(`)p Ft(+r)p Fu(')g(will)g(not)g(remo)m(v)m(e)i +(the)630 4411 y(readonly)e(attribute.)41 b(When)30 b(used)f(in)g(a)h +(function,)g Ft(declare)e Fu(mak)m(es)j(eac)m(h)f Fr(name)35 +b Fu(lo)s(cal,)630 4520 y(as)f(with)f(the)g Ft(local)f +Fu(command,)i(unless)f(the)g Ft(-g)g Fu(option)h(is)f(used.)49 +b(If)33 b(a)h(v)-5 b(ariable)34 b(name)630 4630 y(is)c(follo)m(w)m(ed)i +(b)m(y)f(=)p Fr(v)-5 b(alue)p Fu(,)30 b(the)h(v)-5 b(alue)31 +b(of)f(the)h(v)-5 b(ariable)31 b(is)g(set)g(to)g Fr(v)-5 +b(alue)p Fu(.)630 4766 y(When)41 b(using)g Ft(-a)g Fu(or)h +Ft(-A)e Fu(and)h(the)h(comp)s(ound)e(assignmen)m(t)i(syn)m(tax)g(to)g +(create)h(arra)m(y)630 4875 y(v)-5 b(ariables,)28 b(additional)f +(attributes)g(do)f(not)h(tak)m(e)h(e\013ect)g(un)m(til)e(subsequen)m(t) +g(assignmen)m(ts.)630 5011 y(The)35 b(return)f(status)i(is)g(zero)g +(unless)f(an)g(in)m(v)-5 b(alid)36 b(option)g(is)g(encoun)m(tered,)h +(an)f(attempt)630 5121 y(is)c(made)g(to)g(de\014ne)f(a)h(function)g +(using)f(`)p Ft(-f)f(foo=bar)p Fu(',)h(an)h(attempt)g(is)g(made)g(to)h +(assign)630 5230 y(a)42 b(v)-5 b(alue)43 b(to)g(a)f(readonly)g(v)-5 +b(ariable,)47 b(an)42 b(attempt)h(is)f(made)g(to)h(assign)f(a)h(v)-5 +b(alue)42 b(to)h(an)630 5340 y(arra)m(y)30 b(v)-5 b(ariable)30 +b(without)g(using)e(the)i(comp)s(ound)e(assignmen)m(t)i(syn)m(tax)g +(\(see)h(Section)f(6.7)p eop end +%%Page: 52 58 +TeXDict begin 52 57 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(52)630 299 y([Arra)m(ys],)47 +b(page)c(89\),)48 b(one)43 b(of)g(the)g Fr(names)k Fu(is)c(not)g(a)g(v) +-5 b(alid)43 b(shell)g(v)-5 b(ariable)44 b(name,)i(an)630 +408 y(attempt)28 b(is)f(made)h(to)f(turn)f(o\013)i(readonly)f(status)g +(for)g(a)h(readonly)f(v)-5 b(ariable,)29 b(an)e(attempt)630 +518 y(is)h(made)h(to)g(turn)e(o\013)i(arra)m(y)f(status)h(for)f(an)g +(arra)m(y)h(v)-5 b(ariable,)30 b(or)e(an)g(attempt)i(is)e(made)g(to)630 +628 y(displa)m(y)j(a)f(non-existen)m(t)i(function)e(with)g +Ft(-f)p Fu(.)150 785 y Ft(echo)870 918 y(echo)47 b([-neE])f([)p +Fj(arg)g Ft(...])630 1051 y Fu(Output)31 b(the)i Fr(arg)8 +b Fu(s,)33 b(separated)g(b)m(y)g(spaces,)g(terminated)g(with)f(a)h +(newline.)47 b(The)32 b(return)630 1161 y(status)f(is)f(0)h(unless)f(a) +h(write)g(error)f(o)s(ccurs.)41 b(If)30 b Ft(-n)g Fu(is)h(sp)s +(eci\014ed,)f(the)h(trailing)g(newline)g(is)630 1270 +y(suppressed.)38 b(If)29 b(the)h Ft(-e)f Fu(option)h(is)f(giv)m(en,)i +(in)m(terpretation)g(of)e(the)h(follo)m(wing)h(bac)m(kslash-)630 +1380 y(escap)s(ed)43 b(c)m(haracters)h(is)e(enabled.)78 +b(The)42 b Ft(-E)g Fu(option)h(disables)g(the)g(in)m(terpretation)h(of) +630 1490 y(these)27 b(escap)s(e)g(c)m(haracters,)i(ev)m(en)e(on)g +(systems)f(where)g(they)h(are)g(in)m(terpreted)g(b)m(y)f(default.)630 +1599 y(The)32 b Ft(xpg_echo)f Fu(shell)i(option)g(ma)m(y)h(b)s(e)e +(used)g(to)h(dynamically)h(determine)f(whether)f(or)630 +1709 y(not)h Ft(echo)f Fu(expands)g(these)h(escap)s(e)h(c)m(haracters)g +(b)m(y)f(default.)48 b Ft(echo)32 b Fu(do)s(es)g(not)i(in)m(terpret)630 +1818 y Ft(--)c Fu(to)h(mean)f(the)h(end)f(of)g(options.)630 +1952 y Ft(echo)f Fu(in)m(terprets)i(the)f(follo)m(wing)i(escap)s(e)f +(sequences:)630 2109 y Ft(\\a)384 b Fu(alert)31 b(\(b)s(ell\))630 +2266 y Ft(\\b)384 b Fu(bac)m(kspace)630 2423 y Ft(\\c)g +Fu(suppress)28 b(further)h(output)630 2580 y Ft(\\e)630 +2689 y(\\E)384 b Fu(escap)s(e)630 2846 y Ft(\\f)g Fu(form)30 +b(feed)630 3003 y Ft(\\n)384 b Fu(new)30 b(line)630 3160 +y Ft(\\r)384 b Fu(carriage)32 b(return)630 3317 y Ft(\\t)384 +b Fu(horizon)m(tal)32 b(tab)630 3474 y Ft(\\v)384 b Fu(v)m(ertical)32 +b(tab)630 3631 y Ft(\\\\)384 b Fu(bac)m(kslash)630 3788 +y Ft(\\0)p Fj(nnn)240 b Fu(the)32 b(eigh)m(t-bit)i(c)m(haracter)g +(whose)e(v)-5 b(alue)33 b(is)f(the)g(o)s(ctal)i(v)-5 +b(alue)32 b Fr(nnn)f Fu(\(zero)i(to)1110 3898 y(three)e(o)s(ctal)g +(digits\))630 4055 y Ft(\\x)p Fj(HH)288 b Fu(the)38 b(eigh)m(t-bit)i(c) +m(haracter)g(whose)e(v)-5 b(alue)39 b(is)f(the)h(hexadecimal)g(v)-5 +b(alue)39 b Fr(HH)1110 4164 y Fu(\(one)31 b(or)f(t)m(w)m(o)i(hex)e +(digits\))630 4321 y Ft(\\u)p Fj(HHHH)192 b Fu(the)41 +b(Unico)s(de)g(\(ISO/IEC)f(10646\))j(c)m(haracter)g(whose)e(v)-5 +b(alue)41 b(is)g(the)g(hex-)1110 4431 y(adecimal)32 b(v)-5 +b(alue)31 b Fr(HHHH)41 b Fu(\(one)31 b(to)g(four)e(hex)h(digits\))630 +4588 y Ft(\\U)p Fj(HHHHHHHH)1110 4697 y Fu(the)41 b(Unico)s(de)g +(\(ISO/IEC)f(10646\))j(c)m(haracter)g(whose)e(v)-5 b(alue)41 +b(is)g(the)g(hex-)1110 4807 y(adecimal)32 b(v)-5 b(alue)31 +b Fr(HHHHHHHH)41 b Fu(\(one)31 b(to)g(eigh)m(t)h(hex)e(digits\))150 +4964 y Ft(enable)870 5097 y(enable)46 b([-a])h([-dnps])f([-f)g +Fj(filename)p Ft(])g([)p Fj(name)g Ft(...)o(])630 5230 +y Fu(Enable)36 b(and)f(disable)h(builtin)g(shell)g(commands.)56 +b(Disabling)37 b(a)g(builtin)e(allo)m(ws)i(a)f(disk)630 +5340 y(command)e(whic)m(h)g(has)g(the)g(same)h(name)f(as)h(a)f(shell)h +(builtin)e(to)i(b)s(e)f(executed)h(without)p eop end +%%Page: 53 59 +TeXDict begin 53 58 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(53)630 299 y(sp)s(ecifying)27 +b(a)g(full)g(pathname,)g(ev)m(en)h(though)f(the)g(shell)g(normally)g +(searc)m(hes)h(for)f(builtins)630 408 y(b)s(efore)35 +b(disk)g(commands.)55 b(If)35 b Ft(-n)g Fu(is)g(used,)h(the)g +Fr(name)5 b Fu(s)35 b(b)s(ecome)h(disabled.)55 b(Otherwise)630 +518 y Fr(name)5 b Fu(s)44 b(are)h(enabled.)82 b(F)-8 +b(or)45 b(example,)k(to)c(use)f(the)g Ft(test)f Fu(binary)h(found)f +(via)h Ft($PATH)630 628 y Fu(instead)31 b(of)f(the)h(shell)f(builtin)g +(v)m(ersion,)h(t)m(yp)s(e)g(`)p Ft(enable)e(-n)h(test)p +Fu('.)630 762 y(If)45 b(the)i Ft(-p)e Fu(option)h(is)g(supplied,)j(or)d +(no)g Fr(name)51 b Fu(argumen)m(ts)46 b(app)s(ear,)k(a)c(list)h(of)f +(shell)630 871 y(builtins)37 b(is)h(prin)m(ted.)63 b(With)38 +b(no)f(other)h(argumen)m(ts,)j(the)d(list)g(consists)g(of)g(all)h +(enabled)630 981 y(shell)d(builtins.)57 b(The)35 b Ft(-a)h +Fu(option)g(means)g(to)g(list)h(eac)m(h)g(builtin)f(with)f(an)h +(indication)h(of)630 1090 y(whether)30 b(or)g(not)h(it)g(is)f(enabled.) +630 1224 y(The)22 b Ft(-f)f Fu(option)h(means)g(to)h(load)g(the)f(new)g +(builtin)f(command)h Fr(name)27 b Fu(from)22 b(shared)f(ob)5 +b(ject)630 1334 y Fr(\014lename)p Fu(,)33 b(on)e(systems)h(that)h(supp) +s(ort)d(dynamic)i(loading.)46 b(The)31 b Ft(-d)g Fu(option)h(will)h +(delete)630 1443 y(a)e(builtin)f(loaded)h(with)f Ft(-f)p +Fu(.)630 1577 y(If)j(there)i(are)f(no)g(options,)h(a)f(list)h(of)f(the) +g(shell)g(builtins)g(is)g(displa)m(y)m(ed.)52 b(The)33 +b Ft(-s)g Fu(option)630 1687 y(restricts)j Ft(enable)d +Fu(to)j(the)f Fm(posix)f Fu(sp)s(ecial)i(builtins.)54 +b(If)34 b Ft(-s)h Fu(is)g(used)f(with)g Ft(-f)p Fu(,)i(the)f(new)630 +1797 y(builtin)30 b(b)s(ecomes)h(a)f(sp)s(ecial)h(builtin)f(\(see)i +(Section)f(4.4)g([Sp)s(ecial)g(Builtins],)g(page)g(68\).)630 +1931 y(The)26 b(return)f(status)h(is)g(zero)h(unless)e(a)i +Fr(name)k Fu(is)26 b(not)g(a)h(shell)f(builtin)g(or)g(there)g(is)g(an)g +(error)630 2040 y(loading)31 b(a)g(new)f(builtin)g(from)g(a)g(shared)g +(ob)5 b(ject.)150 2198 y Ft(help)870 2332 y(help)47 b([-dms])f([)p +Fj(pattern)p Ft(])630 2466 y Fu(Displa)m(y)40 b(helpful)e(information)h +(ab)s(out)g(builtin)f(commands.)66 b(If)38 b Fr(pattern)h +Fu(is)g(sp)s(eci\014ed,)630 2576 y Ft(help)28 b Fu(giv)m(es)i(detailed) +g(help)e(on)h(all)h(commands)e(matc)m(hing)i Fr(pattern)p +Fu(,)g(otherwise)f(a)g(list)h(of)630 2685 y(the)h(builtins)e(is)i(prin) +m(ted.)630 2819 y(Options,)f(if)h(supplied,)e(ha)m(v)m(e)i(the)g(follo) +m(wing)h(meanings:)630 2978 y Ft(-d)384 b Fu(Displa)m(y)32 +b(a)e(short)g(description)h(of)f(eac)m(h)i Fr(pattern)630 +3136 y Ft(-m)384 b Fu(Displa)m(y)32 b(the)e(description)g(of)h(eac)m(h) +h Fr(pattern)e Fu(in)g(a)h(manpage-lik)m(e)h(format)630 +3294 y Ft(-s)384 b Fu(Displa)m(y)32 b(only)e(a)h(short)f(usage)h +(synopsis)e(for)i(eac)m(h)g Fr(pattern)630 3453 y Fu(The)f(return)f +(status)i(is)f(zero)h(unless)f(no)g(command)h(matc)m(hes)g +Fr(pattern)p Fu(.)150 3611 y Ft(let)870 3745 y(let)47 +b Fj(expression)e Ft([)p Fj(expression)g Ft(...)o(])630 +3879 y Fu(The)c Ft(let)g Fu(builtin)g(allo)m(ws)i(arithmetic)f(to)h(b)s +(e)d(p)s(erformed)g(on)i(shell)g(v)-5 b(ariables.)74 +b(Eac)m(h)630 3988 y Fr(expression)31 b Fu(is)g(ev)-5 +b(aluated)32 b(according)f(to)h(the)f(rules)g(giv)m(en)h(b)s(elo)m(w)f +(in)f(Section)i(6.5)g([Shell)630 4098 y(Arithmetic],)51 +b(page)46 b(87.)87 b(If)45 b(the)g(last)h Fr(expression)g +Fu(ev)-5 b(aluates)47 b(to)f(0,)k Ft(let)44 b Fu(returns)g(1;)630 +4208 y(otherwise)31 b(0)g(is)f(returned.)150 4366 y Ft(local)870 +4500 y(local)46 b([)p Fj(option)p Ft(])g Fj(name)p Ft([=)p +Fj(value)p Ft(])e(...)630 4634 y Fu(F)-8 b(or)27 b(eac)m(h)g(argumen)m +(t,)g(a)f(lo)s(cal)h(v)-5 b(ariable)27 b(named)e Fr(name)31 +b Fu(is)26 b(created,)i(and)d(assigned)h Fr(v)-5 b(alue)p +Fu(.)630 4743 y(The)37 b Fr(option)h Fu(can)f(b)s(e)g(an)m(y)h(of)f +(the)h(options)g(accepted)g(b)m(y)g Ft(declare)p Fu(.)59 +b Ft(local)36 b Fu(can)i(only)630 4853 y(b)s(e)j(used)h(within)f(a)i +(function;)48 b(it)42 b(mak)m(es)h(the)f(v)-5 b(ariable)43 +b Fr(name)48 b Fu(ha)m(v)m(e)43 b(a)f(visible)h(scop)s(e)630 +4963 y(restricted)c(to)g(that)g(function)f(and)f(its)i(c)m(hildren.)64 +b(The)38 b(return)f(status)h(is)h(zero)g(unless)630 5072 +y Ft(local)g Fu(is)h(used)g(outside)g(a)h(function,)h(an)e(in)m(v)-5 +b(alid)41 b Fr(name)46 b Fu(is)40 b(supplied,)i(or)e +Fr(name)45 b Fu(is)c(a)630 5182 y(readonly)30 b(v)-5 +b(ariable.)150 5340 y Ft(logout)p eop end +%%Page: 54 60 +TeXDict begin 54 59 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(54)870 299 y Ft(logout)46 +b([)p Fj(n)p Ft(])630 429 y Fu(Exit)31 b(a)g(login)g(shell,)g +(returning)e(a)i(status)g(of)f Fr(n)g Fu(to)h(the)g(shell's)f(paren)m +(t.)150 580 y Ft(mapfile)870 710 y(mapfile)46 b([-n)h +Fj(count)p Ft(])f([-O)h Fj(origin)p Ft(])f([-s)g Fj(count)p +Ft(])h([-t])f([-u)h Fj(fd)p Ft(])1061 819 y([-C)g Fj(callback)p +Ft(])e([-c)i Fj(quantum)p Ft(])f([)p Fj(array)p Ft(])630 +950 y Fu(Read)38 b(lines)f(from)g(the)h(standard)e(input)g(in)m(to)j +(the)e(indexed)g(arra)m(y)h(v)-5 b(ariable)38 b Fr(arra)m(y)p +Fu(,)i(or)630 1059 y(from)28 b(\014le)h(descriptor)f +Fr(fd)k Fu(if)c(the)h Ft(-u)f Fu(option)h(is)g(supplied.)39 +b(The)28 b(v)-5 b(ariable)29 b Ft(MAPFILE)e Fu(is)i(the)630 +1169 y(default)i Fr(arra)m(y)p Fu(.)41 b(Options,)30 +b(if)g(supplied,)g(ha)m(v)m(e)h(the)g(follo)m(wing)h(meanings:)630 +1319 y Ft(-n)384 b Fu(Cop)m(y)30 b(at)h(most)g Fr(coun)m(t)i +Fu(lines.)41 b(If)30 b Fr(coun)m(t)j Fu(is)d(0,)h(all)h(lines)e(are)h +(copied.)630 1470 y Ft(-O)384 b Fu(Begin)31 b(assigning)g(to)g +Fr(arra)m(y)39 b Fu(at)31 b(index)f Fr(origin)p Fu(.)41 +b(The)30 b(default)h(index)f(is)g(0.)630 1621 y Ft(-s)384 +b Fu(Discard)31 b(the)f(\014rst)g Fr(coun)m(t)j Fu(lines)e(read.)630 +1771 y Ft(-t)384 b Fu(Remo)m(v)m(e)32 b(a)f(trailing)g(newline)g(from)f +(eac)m(h)h(line)g(read.)630 1922 y Ft(-u)384 b Fu(Read)31 +b(lines)f(from)g(\014le)h(descriptor)f Fr(fd)j Fu(instead)e(of)f(the)h +(standard)e(input.)630 2073 y Ft(-C)384 b Fu(Ev)-5 b(aluate)33 +b Fr(callbac)m(k)39 b Fu(eac)m(h)33 b(time)f Fr(quan)m(tum)p +Fu(P)f(lines)h(are)g(read.)45 b(The)31 b Ft(-c)g Fu(op-)1110 +2182 y(tion)g(sp)s(eci\014es)f Fr(quan)m(tum)p Fu(.)630 +2333 y Ft(-c)384 b Fu(Sp)s(ecify)30 b(the)g(n)m(um)m(b)s(er)f(of)i +(lines)f(read)h(b)s(et)m(w)m(een)g(eac)m(h)g(call)h(to)f +Fr(callbac)m(k)p Fu(.)630 2484 y(If)36 b Ft(-C)g Fu(is)g(sp)s +(eci\014ed)g(without)g Ft(-c)p Fu(,)h(the)g(default)f(quan)m(tum)g(is)h +(5000.)60 b(When)36 b Fr(callbac)m(k)44 b Fu(is)630 2593 +y(ev)-5 b(aluated,)30 b(it)e(is)g(supplied)f(the)h(index)f(of)i(the)f +(next)g(arra)m(y)g(elemen)m(t)h(to)g(b)s(e)e(assigned)i(and)630 +2703 y(the)39 b(line)g(to)h(b)s(e)e(assigned)h(to)h(that)f(elemen)m(t)i +(as)e(additional)h(argumen)m(ts.)66 b Fr(callbac)m(k)47 +b Fu(is)630 2813 y(ev)-5 b(aluated)32 b(after)e(the)h(line)g(is)f(read) +g(but)g(b)s(efore)g(the)h(arra)m(y)g(elemen)m(t)g(is)g(assigned.)630 +2943 y(If)25 b(not)g(supplied)f(with)h(an)g(explicit)i(origin,)g +Ft(mapfile)c Fu(will)j(clear)g Fr(arra)m(y)34 b Fu(b)s(efore)24 +b(assigning)630 3052 y(to)31 b(it.)630 3182 y Ft(mapfile)41 +b Fu(returns)g(successfully)i(unless)e(an)i(in)m(v)-5 +b(alid)43 b(option)g(or)g(option)g(argumen)m(t)g(is)630 +3292 y(supplied,)29 b Fr(arra)m(y)39 b Fu(is)30 b(in)m(v)-5 +b(alid)31 b(or)g(unassignable,)f(or)h Fr(arra)m(y)38 +b Fu(is)31 b(not)f(an)h(indexed)e(arra)m(y)-8 b(.)150 +3443 y Ft(printf)870 3573 y(printf)46 b([-v)h Fj(var)p +Ft(])g Fj(format)f Ft([)p Fj(arguments)p Ft(])630 3703 +y Fu(W)-8 b(rite)27 b(the)g(formatted)f Fr(argumen)m(ts)k +Fu(to)d(the)f(standard)f(output)h(under)e(the)i(con)m(trol)i(of)e(the) +630 3813 y Fr(format)p Fu(.)66 b(The)39 b Ft(-v)f Fu(option)h(causes)g +(the)g(output)g(to)g(b)s(e)f(assigned)h(to)h(the)f(v)-5 +b(ariable)39 b Fr(v)-5 b(ar)630 3922 y Fu(rather)30 b(than)g(b)s(eing)g +(prin)m(ted)g(to)h(the)g(standard)e(output.)630 4052 +y(The)36 b Fr(format)i Fu(is)f(a)f(c)m(haracter)i(string)e(whic)m(h)g +(con)m(tains)i(three)e(t)m(yp)s(es)g(of)h(ob)5 b(jects:)53 +b(plain)630 4162 y(c)m(haracters,)41 b(whic)m(h)c(are)h(simply)e +(copied)i(to)g(standard)f(output,)i(c)m(haracter)g(escap)s(e)e(se-)630 +4271 y(quences,)g(whic)m(h)f(are)g(con)m(v)m(erted)h(and)f(copied)g(to) +g(the)g(standard)f(output,)i(and)f(format)630 4381 y(sp)s +(eci\014cations,)j(eac)m(h)e(of)g(whic)m(h)f(causes)g(prin)m(ting)g(of) +h(the)f(next)h(successiv)m(e)g Fr(argumen)m(t)p Fu(.)630 +4491 y(In)24 b(addition)h(to)g(the)g(standard)f Ft(printf\(1\))e +Fu(formats,)27 b Ft(printf)c Fu(in)m(terprets)i(the)f(follo)m(wing)630 +4600 y(extensions:)630 4751 y Ft(\045b)384 b Fu(Causes)30 +b Ft(printf)e Fu(to)j(expand)f(bac)m(kslash)h(escap)s(e)f(sequences)h +(in)f(the)g(corre-)1110 4861 y(sp)s(onding)19 b Fr(argumen)m(t)p +Fu(,)24 b(except)e(that)g(`)p Ft(\\c)p Fu(')e(terminates)i(output,)h +(bac)m(kslashes)1110 4970 y(in)k(`)p Ft(\\')p Fu(',)h(`)p +Ft(\\")p Fu(',)g(and)f(`)p Ft(\\?)p Fu(')g(are)h(not)f(remo)m(v)m(ed,)j +(and)c(o)s(ctal)j(escap)s(es)f(b)s(eginning)1110 5080 +y(with)i(`)p Ft(\\0)p Fu(')g(ma)m(y)h(con)m(tain)h(up)d(to)i(four)f +(digits.)630 5230 y Ft(\045q)384 b Fu(Causes)32 b Ft(printf)e +Fu(to)i(output)g(the)g(corresp)s(onding)f Fr(argumen)m(t)j +Fu(in)d(a)i(format)1110 5340 y(that)e(can)g(b)s(e)e(reused)h(as)h +(shell)f(input.)p eop end +%%Page: 55 61 +TeXDict begin 55 60 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(55)630 299 y Ft(\045\()p +Fj(datefmt)p Ft(\)T)1110 408 y Fu(Causes)29 b Ft(printf)e +Fu(to)j(output)f(the)g(date-time)i(string)e(resulting)h(from)e(using) +1110 518 y Fr(datefm)m(t)45 b Fu(as)d(a)g(format)g(string)g(for)g +Ft(strftime)p Fu(\(3\).)74 b(The)41 b(corresp)s(onding)1110 +628 y Fr(argumen)m(t)h Fu(is)e(an)g(in)m(teger)i(represen)m(ting)e(the) +g(n)m(um)m(b)s(er)f(of)h(seconds)g(since)1110 737 y(the)24 +b(ep)s(o)s(c)m(h.)38 b(Tw)m(o)24 b(sp)s(ecial)h(argumen)m(t)f(v)-5 +b(alues)24 b(ma)m(y)h(b)s(e)e(used:)36 b(-1)25 b(represen)m(ts)1110 +847 y(the)30 b(curren)m(t)g(time,)h(and)e(-2)i(represen)m(ts)f(the)g +(time)h(the)f(shell)g(w)m(as)g(in)m(v)m(ok)m(ed.)1110 +956 y(If)38 b(no)g(argumen)m(t)h(is)f(sp)s(eci\014ed,)i(con)m(v)m +(ersion)f(b)s(eha)m(v)m(es)g(as)g(if)f(-1)h(had)f(b)s(een)1110 +1066 y(giv)m(en.)k(This)29 b(is)i(an)f(exception)i(to)f(the)f(usual)g +Ft(printf)f Fu(b)s(eha)m(vior.)630 1230 y(Argumen)m(ts)f(to)h +(non-string)e(format)i(sp)s(eci\014ers)e(are)h(treated)h(as)g(C)e +(language)j(constan)m(ts,)630 1340 y(except)22 b(that)g(a)g(leading)g +(plus)e(or)h(min)m(us)f(sign)i(is)f(allo)m(w)m(ed,)k(and)c(if)g(the)g +(leading)h(c)m(haracter)h(is)630 1450 y(a)i(single)g(or)f(double)h +(quote,)h(the)f(v)-5 b(alue)25 b(is)f(the)h(ASCI)s(I)e(v)-5 +b(alue)25 b(of)f(the)h(follo)m(wing)h(c)m(haracter.)630 +1587 y(The)31 b Fr(format)i Fu(is)f(reused)e(as)i(necessary)f(to)i +(consume)e(all)h(of)f(the)h Fr(argumen)m(ts)p Fu(.)44 +b(If)30 b(the)i Fr(for-)630 1696 y(mat)c Fu(requires)e(more)g +Fr(argumen)m(ts)k Fu(than)25 b(are)i(supplied,)e(the)h(extra)h(format)f +(sp)s(eci\014cations)630 1806 y(b)s(eha)m(v)m(e)j(as)g(if)f(a)h(zero)g +(v)-5 b(alue)29 b(or)g(n)m(ull)f(string,)h(as)g(appropriate,)g(had)f(b) +s(een)g(supplied.)38 b(The)630 1915 y(return)29 b(v)-5 +b(alue)31 b(is)g(zero)g(on)f(success,)h(non-zero)g(on)f(failure.)150 +2080 y Ft(read)870 2217 y(read)47 b([-ers])f([-a)h Fj(aname)p +Ft(])f([-d)h Fj(delim)p Ft(])f([-i)h Fj(text)p Ft(])f([-n)h +Fj(nchars)p Ft(])1061 2326 y([-N)g Fj(nchars)p Ft(])f([-p)h +Fj(prompt)p Ft(])e([-t)i Fj(timeout)p Ft(])f([-u)h Fj(fd)p +Ft(])g([)p Fj(name)f Ft(...)o(])630 2463 y Fu(One)26 +b(line)h(is)g(read)f(from)h(the)f(standard)g(input,)h(or)g(from)f(the)h +(\014le)f(descriptor)h Fr(fd)i Fu(supplied)630 2573 y(as)23 +b(an)g(argumen)m(t)h(to)f(the)h Ft(-u)e Fu(option,)j(and)e(the)g +(\014rst)f(w)m(ord)h(is)g(assigned)g(to)h(the)f(\014rst)g +Fr(name)p Fu(,)630 2682 y(the)32 b(second)g(w)m(ord)f(to)i(the)f +(second)g Fr(name)p Fu(,)g(and)g(so)g(on,)g(with)f(lefto)m(v)m(er)j(w)m +(ords)e(and)f(their)630 2792 y(in)m(terv)m(ening)f(separators)g +(assigned)g(to)g(the)g(last)g Fr(name)p Fu(.)40 b(If)29 +b(there)h(are)g(few)m(er)f(w)m(ords)g(read)630 2902 y(from)36 +b(the)i(input)d(stream)j(than)e(names,)j(the)e(remaining)g(names)g(are) +g(assigned)h(empt)m(y)630 3011 y(v)-5 b(alues.)40 b(The)26 +b(c)m(haracters)j(in)d(the)i(v)-5 b(alue)27 b(of)g(the)g +Ft(IFS)f Fu(v)-5 b(ariable)28 b(are)f(used)g(to)g(split)g(the)h(line) +630 3121 y(in)m(to)36 b(w)m(ords)e(using)g(the)h(same)g(rules)f(the)h +(shell)g(uses)f(for)g(expansion)h(\(describ)s(ed)f(ab)s(o)m(v)m(e)630 +3230 y(in)j(Section)h(3.5.7)i([W)-8 b(ord)38 b(Splitting],)i(page)e +(29\).)63 b(The)37 b(bac)m(kslash)h(c)m(haracter)h(`)p +Ft(\\)p Fu(')e(ma)m(y)630 3340 y(b)s(e)28 b(used)g(to)i(remo)m(v)m(e)g +(an)m(y)f(sp)s(ecial)h(meaning)f(for)g(the)g(next)g(c)m(haracter)h +(read)f(and)f(for)h(line)630 3450 y(con)m(tin)m(uation.)42 +b(If)27 b(no)h(names)f(are)h(supplied,)g(the)f(line)h(read)g(is)g +(assigned)g(to)g(the)g(v)-5 b(ariable)630 3559 y Ft(REPLY)p +Fu(.)37 b(The)23 b(return)f(co)s(de)h(is)g(zero,)j(unless)d +(end-of-\014le)g(is)h(encoun)m(tered,)h Ft(read)d Fu(times)i(out)630 +3669 y(\(in)k(whic)m(h)f(case)i(the)e(return)g(co)s(de)h(is)f(greater)i +(than)f(128\),)i(a)e(v)-5 b(ariable)28 b(assignmen)m(t)g(error)630 +3778 y(\(suc)m(h)g(as)h(assigning)g(to)g(a)f(readonly)h(v)-5 +b(ariable\))29 b(o)s(ccurs,)g(or)f(an)g(in)m(v)-5 b(alid)29 +b(\014le)g(descriptor)f(is)630 3888 y(supplied)h(as)i(the)f(argumen)m +(t)h(to)g Ft(-u)p Fu(.)630 4025 y(Options,)f(if)h(supplied,)e(ha)m(v)m +(e)i(the)g(follo)m(wing)h(meanings:)630 4189 y Ft(-a)e +Fj(aname)114 b Fu(The)34 b(w)m(ords)f(are)i(assigned)f(to)h(sequen)m +(tial)h(indices)e(of)g(the)g(arra)m(y)h(v)-5 b(ariable)1110 +4299 y Fr(aname)p Fu(,)29 b(starting)h(at)f(0.)40 b(All)29 +b(elemen)m(ts)h(are)e(remo)m(v)m(ed)i(from)d Fr(aname)34 +b Fu(b)s(efore)1110 4408 y(the)d(assignmen)m(t.)41 b(Other)30 +b Fr(name)36 b Fu(argumen)m(ts)30 b(are)h(ignored.)630 +4573 y Ft(-d)f Fj(delim)114 b Fu(The)41 b(\014rst)h(c)m(haracter)h(of)f +Fr(delim)g Fu(is)g(used)g(to)g(terminate)h(the)f(input)f(line,)1110 +4682 y(rather)30 b(than)g(newline.)630 4847 y Ft(-e)384 +b Fu(Readline)46 b(\(see)g(Chapter)e(8)h([Command)f(Line)h(Editing],)50 +b(page)45 b(101\))i(is)1110 4956 y(used)37 b(to)i(obtain)g(the)f(line.) +65 b(Readline)39 b(uses)e(the)i(curren)m(t)f(\(or)g(default,)j(if)1110 +5066 y(line)31 b(editing)g(w)m(as)f(not)h(previously)f(activ)m(e\))j +(editing)e(settings.)630 5230 y Ft(-i)f Fj(text)162 b +Fu(If)36 b(Readline)i(is)f(b)s(eing)g(used)f(to)h(read)g(the)g(line,)j +Fr(text)f Fu(is)e(placed)h(in)m(to)g(the)1110 5340 y(editing)31 +b(bu\013er)e(b)s(efore)h(editing)h(b)s(egins.)p eop end +%%Page: 56 62 +TeXDict begin 56 61 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(56)630 299 y Ft(-n)30 +b Fj(nchars)66 b Ft(read)38 b Fu(returns)f(after)j(reading)f +Fr(nc)m(hars)j Fu(c)m(haracters)e(rather)f(than)g(w)m(aiting)1110 +408 y(for)g(a)h(complete)h(line)f(of)f(input,)i(but)e(honor)g(a)h +(delimiter)g(if)f(few)m(er)h(than)1110 518 y Fr(nc)m(hars)34 +b Fu(c)m(haracters)e(are)e(read)h(b)s(efore)f(the)g(delimiter.)630 +673 y Ft(-N)g Fj(nchars)66 b Ft(read)39 b Fu(returns)f(after)j(reading) +e(exactly)j Fr(nc)m(hars)h Fu(c)m(haracters)f(rather)d(than)1110 +783 y(w)m(aiting)32 b(for)f(a)g(complete)i(line)e(of)g(input,)g(unless) +f(EOF)h(is)g(encoun)m(tered)g(or)1110 892 y Ft(read)f +Fu(times)i(out.)43 b(Delimiter)33 b(c)m(haracters)f(encoun)m(tered)g +(in)f(the)g(input)g(are)1110 1002 y(not)g(treated)h(sp)s(ecially)f(and) +f(do)h(not)g(cause)g Ft(read)e Fu(to)j(return)d(un)m(til)i +Fr(nc)m(hars)1110 1112 y Fu(c)m(haracters)h(are)f(read.)630 +1267 y Ft(-p)f Fj(prompt)66 b Fu(Displa)m(y)38 b Fr(prompt)p +Fu(,)g(without)e(a)h(trailing)h(newline,)h(b)s(efore)d(attempting)i(to) +1110 1377 y(read)f(an)m(y)h(input.)60 b(The)37 b(prompt)g(is)g(displa)m +(y)m(ed)h(only)f(if)g(input)g(is)g(coming)1110 1486 y(from)30 +b(a)h(terminal.)630 1641 y Ft(-r)384 b Fu(If)21 b(this)h(option)g(is)f +(giv)m(en,)k(bac)m(kslash)d(do)s(es)f(not)h(act)h(as)f(an)f(escap)s(e)h +(c)m(haracter.)1110 1751 y(The)30 b(bac)m(kslash)i(is)f(considered)g +(to)h(b)s(e)e(part)h(of)g(the)g(line.)43 b(In)30 b(particular,)i(a)1110 +1861 y(bac)m(kslash-newline)f(pair)f(ma)m(y)h(not)g(b)s(e)f(used)f(as)i +(a)g(line)f(con)m(tin)m(uation.)630 2016 y Ft(-s)384 +b Fu(Silen)m(t)28 b(mo)s(de.)40 b(If)27 b(input)f(is)i(coming)g(from)f +(a)h(terminal,)h(c)m(haracters)g(are)f(not)1110 2125 +y(ec)m(ho)s(ed.)630 2281 y Ft(-t)i Fj(timeout)1110 2390 +y Fu(Cause)42 b Ft(read)g Fu(to)h(time)h(out)f(and)f(return)f(failure)i +(if)g(a)g(complete)h(line)f(of)1110 2500 y(input)26 b(\(or)h(a)g(sp)s +(eci\014ed)f(n)m(um)m(b)s(er)g(of)h(c)m(haracters\))h(is)f(not)g(read)g +(within)f Fr(time-)1110 2609 y(out)37 b Fu(seconds.)53 +b Fr(timeout)38 b Fu(ma)m(y)d(b)s(e)f(a)h(decimal)h(n)m(um)m(b)s(er)d +(with)h(a)h(fractional)1110 2719 y(p)s(ortion)29 b(follo)m(wing)h(the)f +(decimal)h(p)s(oin)m(t.)40 b(This)29 b(option)g(is)g(only)g(e\013ectiv) +m(e)j(if)1110 2829 y Ft(read)j Fu(is)i(reading)g(input)e(from)h(a)h +(terminal,)i(pip)s(e,)e(or)g(other)f(sp)s(ecial)i(\014le;)1110 +2938 y(it)31 b(has)g(no)g(e\013ect)h(when)e(reading)h(from)g(regular)g +(\014les.)42 b(If)30 b Ft(read)g Fu(times)h(out,)1110 +3048 y Ft(read)d Fu(sa)m(v)m(es)j(an)m(y)f(partial)h(input)d(read)i(in) +m(to)h(the)e(sp)s(eci\014ed)g(v)-5 b(ariable)31 b Fr(name)p +Fu(.)1110 3157 y(If)k Fr(timeout)j Fu(is)e(0,)h Ft(read)e +Fu(returns)f(immediately)-8 b(,)39 b(without)c(trying)h(to)g(read)1110 +3267 y(and)30 b(data.)44 b(The)30 b(exit)i(status)f(is)g(0)g(if)g +(input)f(is)h(a)m(v)-5 b(ailable)34 b(on)c(the)i(sp)s(eci\014ed)1110 +3377 y(\014le)g(descriptor,)g(non-zero)h(otherwise.)46 +b(The)31 b(exit)i(status)f(is)g(greater)h(than)1110 3486 +y(128)f(if)e(the)h(timeout)g(is)f(exceeded.)630 3641 +y Ft(-u)g Fj(fd)258 b Fu(Read)31 b(input)e(from)h(\014le)g(descriptor)h +Fr(fd)p Fu(.)150 3797 y Ft(readarray)870 3906 y(readarray)45 +b([-n)i Fj(count)p Ft(])f([-O)h Fj(origin)p Ft(])f([-s)h +Fj(count)p Ft(])f([-t])h([-u)g Fj(fd)p Ft(])1061 4016 +y([-C)g Fj(callback)p Ft(])e([-c)i Fj(quantum)p Ft(])f([)p +Fj(array)p Ft(])630 4148 y Fu(Read)38 b(lines)f(from)g(the)h(standard)e +(input)g(in)m(to)j(the)e(indexed)g(arra)m(y)h(v)-5 b(ariable)38 +b Fr(arra)m(y)p Fu(,)i(or)630 4258 y(from)30 b(\014le)g(descriptor)h +Fr(fd)i Fu(if)d(the)h Ft(-u)e Fu(option)i(is)g(supplied.)630 +4390 y(A)f(synon)m(ym)g(for)g Ft(mapfile)p Fu(.)150 4545 +y Ft(source)870 4678 y(source)46 b Fj(filename)630 4810 +y Fu(A)30 b(synon)m(ym)g(for)g Ft(.)g Fu(\(see)i(Section)f(4.1)g +([Bourne)g(Shell)f(Builtins],)h(page)g(41\).)150 4966 +y Ft(type)870 5098 y(type)47 b([-afptP])e([)p Fj(name)i +Ft(...)o(])630 5230 y Fu(F)-8 b(or)42 b(eac)m(h)g Fr(name)p +Fu(,)i(indicate)e(ho)m(w)g(it)f(w)m(ould)g(b)s(e)g(in)m(terpreted)g(if) +g(used)f(as)i(a)f(command)630 5340 y(name.)p eop end +%%Page: 57 63 +TeXDict begin 57 62 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(57)630 299 y(If)41 +b(the)g Ft(-t)g Fu(option)h(is)f(used,)j Ft(type)c Fu(prin)m(ts)h(a)h +(single)g(w)m(ord)f(whic)m(h)g(is)g(one)h(of)g(`)p Ft(alias)p +Fu(',)630 408 y(`)p Ft(function)p Fu(',)32 b(`)p Ft(builtin)p +Fu(',)g(`)p Ft(file)p Fu(')g(or)h(`)p Ft(keyword)p Fu(',)f(if)h +Fr(name)38 b Fu(is)33 b(an)f(alias,)j(shell)e(function,)630 +518 y(shell)i(builtin,)g(disk)g(\014le,)h(or)e(shell)h(reserv)m(ed)g(w) +m(ord,)h(resp)s(ectiv)m(ely)-8 b(.)55 b(If)34 b(the)h +Fr(name)40 b Fu(is)35 b(not)630 628 y(found,)29 b(then)h(nothing)h(is)f +(prin)m(ted,)g(and)g Ft(type)f Fu(returns)g(a)i(failure)g(status.)630 +765 y(If)25 b(the)g Ft(-p)g Fu(option)h(is)f(used,)h +Ft(type)e Fu(either)h(returns)g(the)g(name)g(of)h(the)f(disk)g(\014le)g +(that)h(w)m(ould)630 874 y(b)s(e)k(executed,)h(or)g(nothing)f(if)g +Ft(-t)g Fu(w)m(ould)g(not)h(return)e(`)p Ft(file)p Fu('.)630 +1011 y(The)h Ft(-P)g Fu(option)h(forces)g(a)g(path)f(searc)m(h)h(for)g +(eac)m(h)g Fr(name)p Fu(,)g(ev)m(en)g(if)g Ft(-t)f Fu(w)m(ould)g(not)h +(return)630 1121 y(`)p Ft(file)p Fu('.)630 1258 y(If)f(a)g(command)g +(is)g(hashed,)f Ft(-p)h Fu(and)f Ft(-P)g Fu(prin)m(t)h(the)g(hashed)f +(v)-5 b(alue,)31 b(whic)m(h)f(is)g(not)g(neces-)630 1367 +y(sarily)h(the)f(\014le)h(that)g(app)s(ears)e(\014rst)h(in)g +Ft($PATH)p Fu(.)630 1504 y(If)22 b(the)i Ft(-a)e Fu(option)h(is)g +(used,)h Ft(type)e Fu(returns)f(all)j(of)f(the)g(places)h(that)f(con)m +(tain)i(an)d(executable)630 1614 y(named)32 b Fr(\014le)p +Fu(.)49 b(This)32 b(includes)h(aliases)h(and)e(functions,)i(if)f(and)f +(only)h(if)g(the)g Ft(-p)f Fu(option)i(is)630 1724 y(not)d(also)g +(used.)630 1861 y(If)f(the)g Ft(-f)g Fu(option)g(is)h(used,)e +Ft(type)g Fu(do)s(es)h(not)h(attempt)g(to)g(\014nd)d(shell)j +(functions,)f(as)g(with)630 1970 y(the)h Ft(command)d +Fu(builtin.)630 2107 y(The)j(return)f(status)h(is)g(zero)h(if)f(all)h +(of)f(the)h Fr(names)i Fu(are)e(found,)e(non-zero)i(if)f(an)m(y)g(are)h +(not)630 2217 y(found.)150 2381 y Ft(typeset)870 2518 +y(typeset)46 b([-afFgrxilnrtux])d([-p])k([)p Fj(name)p +Ft([=)p Fj(value)p Ft(])d(...)o(])630 2655 y Fu(The)31 +b Ft(typeset)e Fu(command)i(is)g(supplied)f(for)h(compatibilit)m(y)i +(with)e(the)g(Korn)f(shell.)44 b(It)31 b(is)630 2765 +y(a)g(synon)m(ym)f(for)g(the)g Ft(declare)f Fu(builtin)h(command.)150 +2929 y Ft(ulimit)870 3066 y(ulimit)46 b([-abcdefilmnpqrstuvxHST])41 +b([)p Fj(limit)p Ft(])630 3203 y(ulimit)25 b Fu(pro)m(vides)h(con)m +(trol)i(o)m(v)m(er)g(the)f(resources)f(a)m(v)-5 b(ailable)29 +b(to)e(pro)s(cesses)f(started)h(b)m(y)g(the)630 3313 +y(shell,)i(on)f(systems)g(that)h(allo)m(w)h(suc)m(h)e(con)m(trol.)41 +b(If)28 b(an)g(option)h(is)f(giv)m(en,)i(it)e(is)h(in)m(terpreted)630 +3422 y(as)i(follo)m(ws:)630 3587 y Ft(-S)384 b Fu(Change)30 +b(and)g(rep)s(ort)g(the)g(soft)h(limit)g(asso)s(ciated)h(with)e(a)h +(resource.)630 3751 y Ft(-H)384 b Fu(Change)30 b(and)g(rep)s(ort)g(the) +g(hard)g(limit)h(asso)s(ciated)h(with)e(a)h(resource.)630 +3915 y Ft(-a)384 b Fu(All)31 b(curren)m(t)f(limits)h(are)g(rep)s +(orted.)630 4080 y Ft(-b)384 b Fu(The)30 b(maxim)m(um)g(so)s(c)m(k)m +(et)i(bu\013er)e(size.)630 4244 y Ft(-c)384 b Fu(The)30 +b(maxim)m(um)g(size)h(of)g(core)g(\014les)f(created.)630 +4408 y Ft(-d)384 b Fu(The)30 b(maxim)m(um)g(size)h(of)g(a)g(pro)s +(cess's)f(data)h(segmen)m(t.)630 4573 y Ft(-e)384 b Fu(The)30 +b(maxim)m(um)g(sc)m(heduling)h(priorit)m(y)f(\()p Ft(")p +Fu(nice)p Ft(")p Fu(\).)630 4737 y Ft(-f)384 b Fu(The)30 +b(maxim)m(um)g(size)h(of)g(\014les)f(written)h(b)m(y)f(the)g(shell)h +(and)f(its)h(c)m(hildren.)630 4902 y Ft(-i)384 b Fu(The)30 +b(maxim)m(um)g(n)m(um)m(b)s(er)f(of)i(p)s(ending)e(signals.)630 +5066 y Ft(-l)384 b Fu(The)30 b(maxim)m(um)g(size)h(that)g(ma)m(y)g(b)s +(e)f(lo)s(c)m(k)m(ed)i(in)m(to)f(memory)-8 b(.)630 5230 +y Ft(-m)384 b Fu(The)36 b(maxim)m(um)g(residen)m(t)h(set)g(size)g +(\(man)m(y)g(systems)f(do)h(not)f(honor)g(this)1110 5340 +y(limit\).)p eop end +%%Page: 58 64 +TeXDict begin 58 63 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(58)630 299 y Ft(-n)384 +b Fu(The)38 b(maxim)m(um)h(n)m(um)m(b)s(er)e(of)i(op)s(en)f(\014le)h +(descriptors)g(\(most)g(systems)g(do)1110 408 y(not)31 +b(allo)m(w)g(this)g(v)-5 b(alue)31 b(to)g(b)s(e)e(set\).)630 +567 y Ft(-p)384 b Fu(The)30 b(pip)s(e)f(bu\013er)h(size.)630 +726 y Ft(-q)384 b Fu(The)30 b(maxim)m(um)g(n)m(um)m(b)s(er)f(of)i(b)m +(ytes)g(in)f(POSIX)f(message)j(queues.)630 885 y Ft(-r)384 +b Fu(The)30 b(maxim)m(um)g(real-time)i(sc)m(heduling)f(priorit)m(y)-8 +b(.)630 1043 y Ft(-s)384 b Fu(The)30 b(maxim)m(um)g(stac)m(k)i(size.) +630 1202 y Ft(-t)384 b Fu(The)30 b(maxim)m(um)g(amoun)m(t)h(of)f(cpu)g +(time)h(in)f(seconds.)630 1361 y Ft(-u)384 b Fu(The)30 +b(maxim)m(um)g(n)m(um)m(b)s(er)f(of)i(pro)s(cesses)f(a)m(v)-5 +b(ailable)33 b(to)e(a)f(single)i(user.)630 1520 y Ft(-v)384 +b Fu(The)41 b(maxim)m(um)h(amoun)m(t)g(of)h(virtual)f(memory)g(a)m(v)-5 +b(ailable)44 b(to)e(the)g(shell,)1110 1629 y(and,)30 +b(on)g(some)h(systems,)g(to)g(its)g(c)m(hildren.)630 +1788 y Ft(-x)384 b Fu(The)30 b(maxim)m(um)g(n)m(um)m(b)s(er)f(of)i +(\014le)f(lo)s(c)m(ks.)630 1947 y Ft(-T)384 b Fu(The)30 +b(maxim)m(um)g(n)m(um)m(b)s(er)f(of)i(threads.)630 2105 +y(If)36 b Fr(limit)k Fu(is)c(giv)m(en,)k(and)c(the)h +Ft(-a)f Fu(option)h(is)f(not)h(used,)h Fr(limit)h Fu(is)e(the)g(new)f +(v)-5 b(alue)37 b(of)g(the)630 2215 y(sp)s(eci\014ed)c(resource.)51 +b(The)34 b(sp)s(ecial)g Fr(limit)j Fu(v)-5 b(alues)34 +b Ft(hard)p Fu(,)g Ft(soft)p Fu(,)g(and)f Ft(unlimited)e +Fu(stand)630 2325 y(for)h(the)g(curren)m(t)g(hard)f(limit,)i(the)g +(curren)m(t)f(soft)g(limit,)h(and)f(no)g(limit,)h(resp)s(ectiv)m(ely)-8 +b(.)48 b(A)630 2434 y(hard)37 b(limit)h(cannot)h(b)s(e)e(increased)h(b) +m(y)f(a)h(non-ro)s(ot)g(user)f(once)i(it)f(is)g(set;)k(a)c(soft)g +(limit)630 2544 y(ma)m(y)j(b)s(e)e(increased)i(up)e(to)h(the)h(v)-5 +b(alue)40 b(of)g(the)h(hard)e(limit.)70 b(Otherwise,)43 +b(the)d(curren)m(t)630 2653 y(v)-5 b(alue)29 b(of)h(the)f(soft)g(limit) +h(for)e(the)h(sp)s(eci\014ed)g(resource)g(is)g(prin)m(ted,)g(unless)f +(the)h Ft(-H)f Fu(option)630 2763 y(is)h(supplied.)39 +b(When)29 b(setting)h(new)f(limits,)h(if)f(neither)g +Ft(-H)g Fu(nor)f Ft(-S)h Fu(is)g(supplied,)f(b)s(oth)h(the)630 +2872 y(hard)i(and)h(soft)h(limits)g(are)f(set.)48 b(If)31 +b(no)i(option)f(is)h(giv)m(en,)h(then)e Ft(-f)g Fu(is)g(assumed.)46 +b(V)-8 b(alues)630 2982 y(are)31 b(in)f(1024-b)m(yte)j(incremen)m(ts,)e +(except)g(for)f Ft(-t)p Fu(,)g(whic)m(h)g(is)g(in)g(seconds;)h +Ft(-p)p Fu(,)f(whic)m(h)g(is)g(in)630 3092 y(units)g(of)g(512-b)m(yte)j +(blo)s(c)m(ks;)e(and)f Ft(-T)p Fu(,)g Ft(-b)p Fu(,)g +Ft(-n)g Fu(and)f Ft(-u)p Fu(,)h(whic)m(h)g(are)h(unscaled)f(v)-5 +b(alues.)630 3226 y(The)34 b(return)g(status)h(is)f(zero)i(unless)e(an) +g(in)m(v)-5 b(alid)36 b(option)f(or)f(argumen)m(t)i(is)e(supplied,)h +(or)630 3335 y(an)30 b(error)g(o)s(ccurs)g(while)h(setting)g(a)g(new)f +(limit.)150 3494 y Ft(unalias)870 3628 y(unalias)46 b([-a])g([)p +Fj(name)h Ft(...)g(])630 3762 y Fu(Remo)m(v)m(e)42 b(eac)m(h)f +Fr(name)k Fu(from)39 b(the)i(list)f(of)g(aliases.)71 +b(If)40 b Ft(-a)f Fu(is)h(supplied,)h(all)g(aliases)h(are)630 +3872 y(remo)m(v)m(ed.)g(Aliases)31 b(are)g(describ)s(ed)e(in)h(Section) +i(6.6)f([Aliases],)h(page)f(88.)150 4104 y Fs(4.3)68 +b(Mo)t(difying)45 b(Shell)g(Beha)l(vior)150 4328 y Fk(4.3.1)63 +b(The)41 b(Set)g(Builtin)150 4475 y Fu(This)35 b(builtin)h(is)g(so)g +(complicated)i(that)f(it)f(deserv)m(es)h(its)f(o)m(wn)g(section.)59 +b Ft(set)35 b Fu(allo)m(ws)j(y)m(ou)e(to)h(c)m(hange)150 +4584 y(the)c(v)-5 b(alues)34 b(of)f(shell)g(options)h(and)e(set)i(the)f +(p)s(ositional)h(parameters,)h(or)e(to)h(displa)m(y)f(the)g(names)h +(and)150 4694 y(v)-5 b(alues)31 b(of)f(shell)h(v)-5 b(ariables.)150 +4852 y Ft(set)870 4987 y(set)47 b([--abefhkmnptuvxBCEHPT])41 +b([-o)47 b Fj(option-name)p Ft(])e([)p Fj(argument)g +Ft(...)o(])870 5096 y(set)i([+abefhkmnptuvxBCEHPT])42 +b([+o)47 b Fj(option-name)p Ft(])d([)p Fj(argument)h +Ft(...)o(])630 5230 y Fu(If)22 b(no)h(options)g(or)g(argumen)m(ts)g +(are)g(supplied,)g Ft(set)f Fu(displa)m(ys)g(the)h(names)g(and)f(v)-5 +b(alues)23 b(of)g(all)630 5340 y(shell)j(v)-5 b(ariables)27 +b(and)e(functions,)h(sorted)g(according)h(to)g(the)f(curren)m(t)f(lo)s +(cale,)k(in)c(a)i(format)p eop end +%%Page: 59 65 +TeXDict begin 59 64 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(59)630 299 y(that)29 +b(ma)m(y)h(b)s(e)e(reused)g(as)h(input)f(for)h(setting)h(or)e +(resetting)i(the)f(curren)m(tly-set)h(v)-5 b(ariables.)630 +408 y(Read-only)37 b(v)-5 b(ariables)37 b(cannot)h(b)s(e)e(reset.)59 +b(In)36 b Fm(posix)g Fu(mo)s(de,)i(only)f(shell)f(v)-5 +b(ariables)38 b(are)630 518 y(listed.)630 647 y(When)29 +b(options)g(are)g(supplied,)f(they)h(set)h(or)f(unset)f(shell)h +(attributes.)41 b(Options,)29 b(if)g(sp)s(ec-)630 757 +y(i\014ed,)h(ha)m(v)m(e)i(the)e(follo)m(wing)i(meanings:)630 +905 y Ft(-a)384 b Fu(Mark)32 b(v)-5 b(ariables)33 b(and)e(function)h +(whic)m(h)g(are)g(mo)s(di\014ed)f(or)h(created)h(for)f(ex-)1110 +1014 y(p)s(ort)e(to)h(the)f(en)m(vironmen)m(t)h(of)g(subsequen)m(t)f +(commands.)630 1163 y Ft(-b)384 b Fu(Cause)44 b(the)h(status)g(of)f +(terminated)h(bac)m(kground)g(jobs)f(to)h(b)s(e)f(rep)s(orted)1110 +1272 y(immediately)-8 b(,)30 b(rather)d(than)f(b)s(efore)h(prin)m(ting) +g(the)g(next)g(primary)g(prompt.)630 1421 y Ft(-e)384 +b Fu(Exit)65 b(immediately)g(if)f(a)h(pip)s(eline)e(\(see)i(Section)g +(3.2.2)h([Pip)s(elines],)1110 1530 y(page)56 b(8\),)62 +b(whic)m(h)55 b(ma)m(y)h(consist)f(of)h(a)f(single)h(simple)f(command)g +(\(see)1110 1640 y(Section)30 b(3.2.1)i([Simple)d(Commands],)g(page)h +(8\),)h(a)f(list)g(\(see)h(Section)f(3.2.3)1110 1749 +y([Lists],)66 b(page)59 b(9\),)67 b(or)58 b(a)h(comp)s(ound)e(command)h +(\(see)h(Section)g(3.2.4)1110 1859 y([Comp)s(ound)67 +b(Commands],)77 b(page)69 b(9\))g(returns)e(a)i(non-zero)g(status.)1110 +1969 y(The)41 b(shell)g(do)s(es)g(not)g(exit)h(if)f(the)h(command)f +(that)h(fails)f(is)g(part)g(of)h(the)1110 2078 y(command)g(list)h +(immediately)g(follo)m(wing)g(a)g Ft(while)e Fu(or)h +Ft(until)e Fu(k)m(eyw)m(ord,)1110 2188 y(part)61 b(of)g(the)g(test)h +(in)e(an)h Ft(if)f Fu(statemen)m(t,)71 b(part)61 b(of)g(an)m(y)g +(command)1110 2297 y(executed)50 b(in)e(a)h Ft(&&)f Fu(or)h +Ft(||)f Fu(list)h(except)g(the)g(command)g(follo)m(wing)h(the)1110 +2407 y(\014nal)37 b Ft(&&)g Fu(or)g Ft(||)p Fu(,)h(an)m(y)g(command)f +(in)g(a)g(pip)s(eline)g(but)g(the)g(last,)j(or)e(if)f(the)1110 +2516 y(command's)c(return)f(status)h(is)g(b)s(eing)g(in)m(v)m(erted)h +(with)e Ft(!)p Fu(.)48 b(If)33 b(a)g(comp)s(ound)1110 +2626 y(command)g(other)g(than)f(a)i(subshell)d(returns)h(a)h(non-zero)h +(status)f(b)s(ecause)1110 2736 y(a)k(command)g(failed)g(while)g +Ft(-e)f Fu(w)m(as)i(b)s(eing)e(ignored,)j(the)e(shell)g(do)s(es)g(not) +1110 2845 y(exit.)42 b(A)30 b(trap)g(on)h Ft(ERR)p Fu(,)e(if)i(set,)g +(is)f(executed)i(b)s(efore)e(the)g(shell)h(exits.)1110 +2974 y(This)f(option)h(applies)f(to)h(the)g(shell)g(en)m(vironmen)m(t)g +(and)f(eac)m(h)h(subshell)f(en-)1110 3084 y(vironmen)m(t)j(separately)i +(\(see)f(Section)g(3.7.3)h([Command)d(Execution)i(En-)1110 +3193 y(vironmen)m(t],)i(page)f(36\),)i(and)d(ma)m(y)h(cause)f +(subshells)g(to)h(exit)g(b)s(efore)f(exe-)1110 3303 y(cuting)d(all)g +(the)g(commands)f(in)g(the)g(subshell.)1110 3432 y(If)41 +b(a)g(comp)s(ound)e(command)i(or)g(shell)g(function)g(executes)h(in)f +(a)g(con)m(text)1110 3541 y(where)31 b Ft(-e)g Fu(is)g(b)s(eing)g +(ignored,)h(none)f(of)h(the)f(commands)g(executed)h(within)1110 +3651 y(the)j(comp)s(ound)f(command)h(or)g(function)f(b)s(o)s(dy)g(will) +h(b)s(e)f(a\013ected)j(b)m(y)e(the)1110 3761 y Ft(-e)25 +b Fu(setting,)j(ev)m(en)e(if)g Ft(-e)f Fu(is)h(set)g(and)f(a)h(command) +g(returns)e(a)i(failure)g(status.)1110 3870 y(If)32 b(a)i(comp)s(ound)d +(command)i(or)g(shell)g(function)f(sets)i Ft(-e)e Fu(while)h(executing) +1110 3980 y(in)40 b(a)h(con)m(text)i(where)d Ft(-e)g +Fu(is)h(ignored,)j(that)d(setting)h(will)f(not)g(ha)m(v)m(e)h(an)m(y) +1110 4089 y(e\013ect)g(un)m(til)e(the)h(comp)s(ound)e(command)h(or)g +(the)g(command)g(con)m(taining)1110 4199 y(the)31 b(function)f(call)h +(completes.)630 4347 y Ft(-f)384 b Fu(Disable)31 b(\014lename)g +(expansion)f(\(globbing\).)630 4495 y Ft(-h)384 b Fu(Lo)s(cate)33 +b(and)e(remem)m(b)s(er)h(\(hash\))g(commands)f(as)h(they)g(are)g(lo)s +(ok)m(ed)h(up)e(for)1110 4605 y(execution.)42 b(This)29 +b(option)i(is)g(enabled)f(b)m(y)g(default.)630 4753 y +Ft(-k)384 b Fu(All)34 b(argumen)m(ts)g(in)f(the)h(form)f(of)g +(assignmen)m(t)h(statemen)m(ts)i(are)d(placed)h(in)1110 +4863 y(the)k(en)m(vironmen)m(t)g(for)g(a)g(command,)h(not)f(just)f +(those)i(that)f(precede)g(the)1110 4973 y(command)30 +b(name.)630 5121 y Ft(-m)384 b Fu(Job)32 b(con)m(trol)h(is)f(enabled)g +(\(see)h(Chapter)f(7)g([Job)g(Con)m(trol],)i(page)e(97\).)47 +b(All)1110 5230 y(pro)s(cesses)27 b(run)f(in)i(a)g(separate)g(pro)s +(cess)f(group.)40 b(When)27 b(a)h(bac)m(kground)f(job)1110 +5340 y(completes,)32 b(the)f(shell)f(prin)m(ts)g(a)h(line)f(con)m +(taining)i(its)f(exit)g(status.)p eop end +%%Page: 60 66 +TeXDict begin 60 65 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(60)630 299 y Ft(-n)384 +b Fu(Read)21 b(commands)f(but)g(do)h(not)g(execute)h(them;)i(this)d(ma) +m(y)g(b)s(e)f(used)g(to)h(c)m(hec)m(k)1110 408 y(a)42 +b(script)g(for)g(syn)m(tax)g(errors.)75 b(This)41 b(option)h(is)g +(ignored)g(b)m(y)g(in)m(teractiv)m(e)1110 518 y(shells.)630 +667 y Ft(-o)30 b Fj(option-name)1110 777 y Fu(Set)h(the)f(option)h +(corresp)s(onding)e(to)i Fr(option-name)5 b Fu(:)1110 +927 y Ft(allexport)1590 1036 y Fu(Same)30 b(as)h Ft(-a)p +Fu(.)1110 1186 y Ft(braceexpand)1590 1295 y Fu(Same)f(as)h +Ft(-B)p Fu(.)1110 1445 y Ft(emacs)240 b Fu(Use)25 b(an)f +Ft(emacs)p Fu(-st)m(yle)h(line)f(editing)h(in)m(terface)h(\(see)g +(Chapter)e(8)1590 1554 y([Command)33 b(Line)g(Editing],)h(page)h +(101\).)51 b(This)32 b(also)i(a\013ects)1590 1664 y(the)d(editing)g(in) +m(terface)h(used)d(for)h Ft(read)f(-e)p Fu(.)1110 1813 +y Ft(errexit)144 b Fu(Same)30 b(as)h Ft(-e)p Fu(.)1110 +1963 y Ft(errtrace)96 b Fu(Same)30 b(as)h Ft(-E)p Fu(.)1110 +2112 y Ft(functrace)1590 2222 y Fu(Same)f(as)h Ft(-T)p +Fu(.)1110 2371 y Ft(hashall)144 b Fu(Same)30 b(as)h Ft(-h)p +Fu(.)1110 2521 y Ft(histexpand)1590 2630 y Fu(Same)f(as)h +Ft(-H)p Fu(.)1110 2780 y Ft(history)144 b Fu(Enable)39 +b(command)g(history)-8 b(,)42 b(as)d(describ)s(ed)f(in)h(Section)h(9.1) +1590 2889 y([Bash)d(History)g(F)-8 b(acilities],)41 b(page)c(133.)60 +b(This)36 b(option)h(is)f(on)1590 2999 y(b)m(y)30 b(default)h(in)f(in)m +(teractiv)m(e)j(shells.)1110 3148 y Ft(ignoreeof)1590 +3258 y Fu(An)d(in)m(teractiv)m(e)j(shell)e(will)g(not)f(exit)h(up)s(on) +e(reading)i(EOF.)1110 3407 y Ft(keyword)144 b Fu(Same)30 +b(as)h Ft(-k)p Fu(.)1110 3557 y Ft(monitor)144 b Fu(Same)30 +b(as)h Ft(-m)p Fu(.)1110 3706 y Ft(noclobber)1590 3816 +y Fu(Same)f(as)h Ft(-C)p Fu(.)1110 3965 y Ft(noexec)192 +b Fu(Same)30 b(as)h Ft(-n)p Fu(.)1110 4115 y Ft(noglob)192 +b Fu(Same)30 b(as)h Ft(-f)p Fu(.)1110 4264 y Ft(nolog)240 +b Fu(Curren)m(tly)30 b(ignored.)1110 4413 y Ft(notify)192 +b Fu(Same)30 b(as)h Ft(-b)p Fu(.)1110 4563 y Ft(nounset)144 +b Fu(Same)30 b(as)h Ft(-u)p Fu(.)1110 4712 y Ft(onecmd)192 +b Fu(Same)30 b(as)h Ft(-t)p Fu(.)1110 4862 y Ft(physical)96 +b Fu(Same)30 b(as)h Ft(-P)p Fu(.)1110 5011 y Ft(pipefail)96 +b Fu(If)44 b(set,)k(the)d(return)e(v)-5 b(alue)45 b(of)f(a)h(pip)s +(eline)e(is)i(the)f(v)-5 b(alue)45 b(of)1590 5121 y(the)33 +b(last)h(\(righ)m(tmost\))h(command)e(to)h(exit)g(with)f(a)g(non-zero) +1590 5230 y(status,)28 b(or)f(zero)g(if)f(all)i(commands)e(in)g(the)h +(pip)s(eline)f(exit)i(suc-)1590 5340 y(cessfully)-8 b(.)41 +b(This)30 b(option)h(is)f(disabled)g(b)m(y)h(default.)p +eop end +%%Page: 61 67 +TeXDict begin 61 66 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(61)1110 299 y +Ft(posix)240 b Fu(Change)30 b(the)g(b)s(eha)m(vior)h(of)f(Bash)g(where) +g(the)g(default)h(op)s(era-)1590 408 y(tion)25 b(di\013ers)f(from)g +(the)h Fm(posix)f Fu(standard)f(to)i(matc)m(h)h(the)f(stan-)1590 +518 y(dard)32 b(\(see)i(Section)g(6.11)h([Bash)e(POSIX)f(Mo)s(de],)j +(page)e(94\).)1590 628 y(This)k(is)g(in)m(tended)g(to)h(mak)m(e)g(Bash) +g(b)s(eha)m(v)m(e)g(as)g(a)f(strict)h(su-)1590 737 y(p)s(erset)30 +b(of)h(that)f(standard.)1110 911 y Ft(privileged)1590 +1020 y Fu(Same)g(as)h Ft(-p)p Fu(.)1110 1194 y Ft(verbose)144 +b Fu(Same)30 b(as)h Ft(-v)p Fu(.)1110 1367 y Ft(vi)384 +b Fu(Use)36 b(a)g Ft(vi)p Fu(-st)m(yle)g(line)g(editing)g(in)m +(terface.)58 b(This)35 b(also)h(a\013ects)1590 1477 y(the)31 +b(editing)g(in)m(terface)h(used)d(for)h Ft(read)f(-e)p +Fu(.)1110 1650 y Ft(xtrace)192 b Fu(Same)30 b(as)h Ft(-x)p +Fu(.)630 1824 y Ft(-p)384 b Fu(T)-8 b(urn)33 b(on)h(privileged)h(mo)s +(de.)51 b(In)34 b(this)g(mo)s(de,)h(the)f Ft($BASH_ENV)e +Fu(and)h Ft($ENV)1110 1934 y Fu(\014les)23 b(are)h(not)f(pro)s(cessed,) +h(shell)g(functions)e(are)i(not)f(inherited)g(from)f(the)i(en-)1110 +2043 y(vironmen)m(t,)h(and)e(the)g Ft(SHELLOPTS)p Fu(,)f +Ft(BASHOPTS)p Fu(,)h Ft(CDPATH)e Fu(and)i Ft(GLOBIGNORE)1110 +2153 y Fu(v)-5 b(ariables,)23 b(if)e(they)g(app)s(ear)f(in)g(the)h(en)m +(vironmen)m(t,)i(are)e(ignored.)38 b(If)20 b(the)h(shell)1110 +2262 y(is)37 b(started)h(with)f(the)g(e\013ectiv)m(e)j(user)d +(\(group\))g(id)g(not)g(equal)h(to)g(the)f(real)1110 +2372 y(user)h(\(group\))h(id,)i(and)d(the)h Ft(-p)f Fu(option)i(is)e +(not)i(supplied,)f(these)h(actions)1110 2482 y(are)32 +b(tak)m(en)i(and)d(the)h(e\013ectiv)m(e)j(user)c(id)h(is)g(set)h(to)f +(the)h(real)f(user)g(id.)45 b(If)32 b(the)1110 2591 y +Ft(-p)i Fu(option)h(is)g(supplied)f(at)h(startup,)h(the)f(e\013ectiv)m +(e)i(user)d(id)g(is)h(not)g(reset.)1110 2701 y(T)-8 b(urning)35 +b(this)i(option)g(o\013)g(causes)g(the)g(e\013ectiv)m(e)i(user)d(and)g +(group)g(ids)g(to)1110 2810 y(b)s(e)30 b(set)h(to)g(the)f(real)h(user)f +(and)g(group)g(ids.)630 2984 y Ft(-t)384 b Fu(Exit)31 +b(after)g(reading)f(and)g(executing)h(one)g(command.)630 +3157 y Ft(-u)384 b Fu(T)-8 b(reat)25 b(unset)e(v)-5 b(ariables)25 +b(and)e(parameters)h(other)h(than)e(the)h(sp)s(ecial)h(param-)1110 +3267 y(eters)35 b(`)p Ft(@)p Fu(')f(or)g(`)p Ft(*)p Fu(')h(as)f(an)g +(error)g(when)f(p)s(erforming)g(parameter)i(expansion.)1110 +3377 y(An)28 b(error)h(message)g(will)g(b)s(e)f(written)h(to)h(the)e +(standard)g(error,)h(and)f(a)h(non-)1110 3486 y(in)m(teractiv)m(e)k +(shell)e(will)g(exit.)630 3660 y Ft(-v)384 b Fu(Prin)m(t)30 +b(shell)h(input)e(lines)i(as)g(they)f(are)h(read.)630 +3833 y Ft(-x)384 b Fu(Prin)m(t)21 b(a)h(trace)h(of)f(simple)f +(commands,)i Ft(for)e Fu(commands,)i Ft(case)d Fu(commands,)1110 +3943 y Ft(select)29 b Fu(commands,)j(and)e(arithmetic)j +Ft(for)d Fu(commands)h(and)f(their)i(argu-)1110 4052 +y(men)m(ts)h(or)f(asso)s(ciated)i(w)m(ord)e(lists)h(after)g(they)f(are) +h(expanded)f(and)f(b)s(efore)1110 4162 y(they)i(are)g(executed.)49 +b(The)32 b(v)-5 b(alue)33 b(of)g(the)g Ft(PS4)f Fu(v)-5 +b(ariable)34 b(is)f(expanded)f(and)1110 4271 y(the)24 +b(resultan)m(t)h(v)-5 b(alue)24 b(is)g(prin)m(ted)g(b)s(efore)f(the)h +(command)g(and)f(its)i(expanded)1110 4381 y(argumen)m(ts.)630 +4555 y Ft(-B)384 b Fu(The)41 b(shell)g(will)g(p)s(erform)f(brace)h +(expansion)g(\(see)h(Section)g(3.5.1)g([Brace)1110 4664 +y(Expansion],)30 b(page)h(21\).)42 b(This)30 b(option)h(is)f(on)g(b)m +(y)h(default.)630 4838 y Ft(-C)384 b Fu(Prev)m(en)m(t)25 +b(output)e(redirection)h(using)f(`)p Ft(>)p Fu(',)i(`)p +Ft(>&)p Fu(',)g(and)e(`)p Ft(<>)p Fu(')g(from)h(o)m(v)m(erwriting)1110 +4947 y(existing)31 b(\014les.)630 5121 y Ft(-E)384 b +Fu(If)39 b(set,)j(an)m(y)e(trap)f(on)g Ft(ERR)g Fu(is)g(inherited)g(b)m +(y)g(shell)h(functions,)h(command)1110 5230 y(substitutions,)35 +b(and)e(commands)g(executed)i(in)f(a)g(subshell)f(en)m(vironmen)m(t.) +1110 5340 y(The)d Ft(ERR)f Fu(trap)i(is)f(normally)h(not)f(inherited)g +(in)g(suc)m(h)g(cases.)p eop end +%%Page: 62 68 +TeXDict begin 62 67 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(62)630 299 y Ft(-H)384 +b Fu(Enable)38 b(`)p Ft(!)p Fu(')h(st)m(yle)h(history)e(substitution)g +(\(see)h(Section)h(9.3)f([History)g(In-)1110 408 y(teraction],)g(page)d +(135\).)57 b(This)34 b(option)i(is)f(on)g(b)m(y)h(default)f(for)g(in)m +(teractiv)m(e)1110 518 y(shells.)630 670 y Ft(-P)384 +b Fu(If)39 b(set,)j(do)d(not)g(resolv)m(e)i(sym)m(b)s(olic)e(links)g +(when)f(p)s(erforming)g(commands)1110 780 y(suc)m(h)29 +b(as)h Ft(cd)f Fu(whic)m(h)g(c)m(hange)h(the)g(curren)m(t)f(directory) +-8 b(.)42 b(The)28 b(ph)m(ysical)j(direc-)1110 890 y(tory)j(is)g(used)f +(instead.)52 b(By)34 b(default,)h(Bash)f(follo)m(ws)h(the)f(logical)i +(c)m(hain)f(of)1110 999 y(directories)j(when)d(p)s(erforming)h +(commands)g(whic)m(h)g(c)m(hange)i(the)f(curren)m(t)1110 +1109 y(directory)-8 b(.)1110 1240 y(F)g(or)42 b(example,)i(if)d +Ft(/usr/sys)e Fu(is)i(a)g(sym)m(b)s(olic)g(link)g(to)h +Ft(/usr/local/sys)1110 1349 y Fu(then:)1350 1480 y Ft($)47 +b(cd)h(/usr/sys;)d(echo)i($PWD)1350 1590 y(/usr/sys)1350 +1700 y($)g(cd)h(..;)f(pwd)1350 1809 y(/usr)1110 1940 +y Fu(If)30 b Ft(set)f(-P)h Fu(is)h(on,)f(then:)1350 2071 +y Ft($)47 b(cd)h(/usr/sys;)d(echo)i($PWD)1350 2181 y(/usr/local/sys) +1350 2290 y($)g(cd)h(..;)f(pwd)1350 2400 y(/usr/local)630 +2552 y(-T)384 b Fu(If)34 b(set,)j(an)m(y)e(trap)g(on)g +Ft(DEBUG)e Fu(and)i Ft(RETURN)e Fu(are)i(inherited)g(b)m(y)f(shell)i +(func-)1110 2662 y(tions,)k(command)d(substitutions,)h(and)f(commands)g +(executed)h(in)f(a)h(sub-)1110 2771 y(shell)33 b(en)m(vironmen)m(t.)49 +b(The)32 b Ft(DEBUG)g Fu(and)g Ft(RETURN)f Fu(traps)h(are)i(normally)f +(not)1110 2881 y(inherited)d(in)g(suc)m(h)g(cases.)630 +3033 y Ft(--)384 b Fu(If)44 b(no)g(argumen)m(ts)g(follo)m(w)i(this)e +(option,)k(then)c(the)h(p)s(ositional)g(parame-)1110 +3143 y(ters)31 b(are)g(unset.)40 b(Otherwise,)31 b(the)f(p)s(ositional) +i(parameters)f(are)f(set)h(to)h(the)1110 3253 y Fr(argumen)m(ts)p +Fu(,)f(ev)m(en)g(if)f(some)h(of)g(them)f(b)s(egin)g(with)g(a)h(`)p +Ft(-)p Fu('.)630 3405 y Ft(-)432 b Fu(Signal)45 b(the)g(end)f(of)h +(options,)k(cause)c(all)h(remaining)e Fr(argumen)m(ts)49 +b Fu(to)d(b)s(e)1110 3515 y(assigned)33 b(to)h(the)g(p)s(ositional)g +(parameters.)49 b(The)33 b Ft(-x)g Fu(and)f Ft(-v)h Fu(options)h(are) +1110 3624 y(turned)k(o\013.)68 b(If)38 b(there)i(are)f(no)g(argumen)m +(ts,)j(the)e(p)s(ositional)g(parameters)1110 3734 y(remain)30 +b(unc)m(hanged.)630 3886 y(Using)d(`)p Ft(+)p Fu(')h(rather)f(than)g(`) +p Ft(-)p Fu(')g(causes)h(these)f(options)h(to)g(b)s(e)e(turned)g +(o\013.)40 b(The)27 b(options)h(can)630 3996 y(also)36 +b(b)s(e)f(used)f(up)s(on)g(in)m(v)m(o)s(cation)j(of)e(the)g(shell.)56 +b(The)34 b(curren)m(t)h(set)h(of)f(options)h(ma)m(y)g(b)s(e)630 +4105 y(found)29 b(in)h Ft($-)p Fu(.)630 4236 y(The)43 +b(remaining)h(N)f Fr(argumen)m(ts)48 b Fu(are)c(p)s(ositional)g +(parameters)g(and)f(are)h(assigned,)j(in)630 4346 y(order,)30 +b(to)h Ft($1)p Fu(,)f Ft($2)p Fu(,)36 b(.)22 b(.)g(.)42 +b Ft($N)p Fu(.)e(The)30 b(sp)s(ecial)h(parameter)g Ft(#)f +Fu(is)g(set)h(to)g(N.)630 4477 y(The)f(return)f(status)i(is)f(alw)m(a)m +(ys)i(zero)f(unless)f(an)g(in)m(v)-5 b(alid)31 b(option)g(is)f +(supplied.)150 4669 y Fk(4.3.2)63 b(The)41 b(Shopt)h(Builtin)150 +4816 y Fu(This)30 b(builtin)g(allo)m(ws)h(y)m(ou)g(to)g(c)m(hange)h +(additional)f(shell)f(optional)i(b)s(eha)m(vior.)150 +4968 y Ft(shopt)870 5099 y(shopt)46 b([-pqsu])g([-o])h([)p +Fj(optname)e Ft(...])630 5230 y Fu(T)-8 b(oggle)37 b(the)e(v)-5 +b(alues)35 b(of)g(settings)h(con)m(trolling)g(optional)g(shell)f(b)s +(eha)m(vior.)55 b(The)34 b(settings)630 5340 y(can)24 +b(b)s(e)g(either)h(those)f(listed)h(b)s(elo)m(w,)h(or,)f(if)g(the)f +Ft(-o)f Fu(option)i(is)f(used,)h(those)g(a)m(v)-5 b(ailable)26 +b(with)p eop end +%%Page: 63 69 +TeXDict begin 63 68 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(63)630 299 y(the)30 +b Ft(-o)f Fu(option)i(to)f(the)g Ft(set)f Fu(builtin)h(command)f(\(see) +i(Section)g(4.3.1)g([The)f(Set)g(Builtin],)630 408 y(page)i(58\).)45 +b(With)32 b(no)f(options,)h(or)g(with)f(the)g Ft(-p)g +Fu(option,)h(a)g(list)g(of)f(all)i(settable)g(options)630 +518 y(is)j(displa)m(y)m(ed,)h(with)f(an)f(indication)i(of)e(whether)g +(or)h(not)g(eac)m(h)h(is)e(set.)57 b(The)35 b Ft(-p)g +Fu(option)630 628 y(causes)i(output)e(to)i(b)s(e)e(displa)m(y)m(ed)i +(in)f(a)g(form)g(that)h(ma)m(y)f(b)s(e)g(reused)f(as)h(input.)57 +b(Other)630 737 y(options)31 b(ha)m(v)m(e)g(the)g(follo)m(wing)h +(meanings:)630 894 y Ft(-s)384 b Fu(Enable)30 b(\(set\))i(eac)m(h)f +Fr(optname)p Fu(.)630 1052 y Ft(-u)384 b Fu(Disable)31 +b(\(unset\))g(eac)m(h)h Fr(optname)p Fu(.)630 1209 y +Ft(-q)384 b Fu(Suppresses)28 b(normal)h(output;)h(the)g(return)e +(status)i(indicates)h(whether)e(the)1110 1319 y Fr(optname)37 +b Fu(is)31 b(set)h(or)f(unset.)43 b(If)31 b(m)m(ultiple)h +Fr(optname)37 b Fu(argumen)m(ts)31 b(are)h(giv)m(en)1110 +1428 y(with)d Ft(-q)p Fu(,)g(the)g(return)f(status)h(is)g(zero)h(if)f +(all)h Fr(optnames)j Fu(are)d(enabled;)f(non-)1110 1538 +y(zero)i(otherwise.)630 1695 y Ft(-o)384 b Fu(Restricts)22 +b(the)f(v)-5 b(alues)22 b(of)f Fr(optname)27 b Fu(to)22 +b(b)s(e)e(those)i(de\014ned)e(for)h(the)g Ft(-o)f Fu(option)1110 +1805 y(to)31 b(the)g Ft(set)e Fu(builtin)h(\(see)h(Section)h(4.3.1)g +([The)e(Set)g(Builtin],)i(page)f(58\).)630 1962 y(If)e(either)i +Ft(-s)e Fu(or)h Ft(-u)f Fu(is)h(used)f(with)g(no)h Fr(optname)35 +b Fu(argumen)m(ts,)c Ft(shopt)d Fu(sho)m(ws)h(only)h(those)630 +2071 y(options)h(whic)m(h)f(are)h(set)f(or)h(unset,)f(resp)s(ectiv)m +(ely)-8 b(.)630 2205 y(Unless)30 b(otherwise)h(noted,)g(the)g +Ft(shopt)d Fu(options)j(are)g(disabled)f(\(o\013)7 b(\))32 +b(b)m(y)e(default.)630 2338 y(The)d(return)f(status)i(when)f(listing)h +(options)g(is)f(zero)i(if)e(all)i Fr(optnames)i Fu(are)d(enabled,)g +(non-)630 2448 y(zero)40 b(otherwise.)66 b(When)39 b(setting)h(or)f +(unsetting)g(options,)i(the)e(return)f(status)h(is)g(zero)630 +2557 y(unless)30 b(an)g Fr(optname)36 b Fu(is)30 b(not)h(a)g(v)-5 +b(alid)30 b(shell)h(option.)630 2691 y(The)f(list)h(of)f +Ft(shopt)f Fu(options)i(is:)630 2848 y Ft(autocd)192 +b Fu(If)27 b(set,)h(a)g(command)f(name)g(that)h(is)f(the)g(name)g(of)h +(a)f(directory)h(is)f(executed)1110 2958 y(as)j(if)f(it)h(w)m(ere)f +(the)h(argumen)m(t)g(to)g(the)f Ft(cd)g Fu(command.)40 +b(This)29 b(option)g(is)h(only)1110 3067 y(used)g(b)m(y)g(in)m +(teractiv)m(e)j(shells.)630 3224 y Ft(cdable_vars)1110 +3334 y Fu(If)h(this)h(is)g(set,)i(an)e(argumen)m(t)g(to)h(the)f +Ft(cd)f Fu(builtin)h(command)f(that)i(is)f(not)1110 3444 +y(a)c(directory)g(is)g(assumed)f(to)h(b)s(e)f(the)h(name)f(of)h(a)g(v) +-5 b(ariable)31 b(whose)g(v)-5 b(alue)31 b(is)1110 3553 +y(the)g(directory)f(to)i(c)m(hange)f(to.)630 3710 y Ft(cdspell)144 +b Fu(If)27 b(set,)h(minor)f(errors)f(in)h(the)g(sp)s(elling)h(of)f(a)g +(directory)h(comp)s(onen)m(t)f(in)g(a)h Ft(cd)1110 3820 +y Fu(command)i(will)h(b)s(e)f(corrected.)43 b(The)30 +b(errors)g(c)m(hec)m(k)m(ed)j(for)d(are)h(transp)s(osed)1110 +3930 y(c)m(haracters,)46 b(a)c(missing)f(c)m(haracter,)47 +b(and)40 b(a)i(c)m(haracter)h(to)s(o)g(man)m(y)-8 b(.)74 +b(If)42 b(a)1110 4039 y(correction)25 b(is)e(found,)g(the)h(corrected)g +(path)f(is)g(prin)m(ted,)h(and)f(the)g(command)1110 4149 +y(pro)s(ceeds.)40 b(This)30 b(option)h(is)f(only)h(used)e(b)m(y)h(in)m +(teractiv)m(e)k(shells.)630 4306 y Ft(checkhash)1110 +4416 y Fu(If)29 b(this)h(is)g(set,)g(Bash)g(c)m(hec)m(ks)h(that)g(a)f +(command)f(found)g(in)g(the)h(hash)f(table)1110 4525 +y(exists)k(b)s(efore)f(trying)h(to)h(execute)g(it.)48 +b(If)32 b(a)h(hashed)e(command)i(no)f(longer)1110 4635 +y(exists,)f(a)g(normal)f(path)g(searc)m(h)h(is)g(p)s(erformed.)630 +4792 y Ft(checkjobs)1110 4902 y Fu(If)d(set,)i(Bash)e(lists)h(the)g +(status)g(of)f(an)m(y)h(stopp)s(ed)f(and)g(running)e(jobs)i(b)s(efore) +1110 5011 y(exiting)42 b(an)f(in)m(teractiv)m(e)j(shell.)72 +b(If)41 b(an)m(y)g(jobs)f(are)i(running,)g(this)f(causes)1110 +5121 y(the)30 b(exit)g(to)g(b)s(e)f(deferred)g(un)m(til)h(a)f(second)h +(exit)g(is)g(attempted)h(without)e(an)1110 5230 y(in)m(terv)m(ening)j +(command)e(\(see)h(Chapter)f(7)h([Job)f(Con)m(trol],)i(page)f(97\).)42 +b(The)1110 5340 y(shell)31 b(alw)m(a)m(ys)g(p)s(ostp)s(ones)f(exiting)h +(if)g(an)m(y)f(jobs)g(are)h(stopp)s(ed.)p eop end +%%Page: 64 70 +TeXDict begin 64 69 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(64)630 299 y Ft(checkwinsize) +1110 408 y Fu(If)41 b(set,)k(Bash)c(c)m(hec)m(ks)i(the)f(windo)m(w)e +(size)j(after)f(eac)m(h)g(command)f(and,)j(if)1110 518 +y(necessary)-8 b(,)31 b(up)s(dates)f(the)g(v)-5 b(alues)31 +b(of)g Ft(LINES)e Fu(and)g Ft(COLUMNS)p Fu(.)630 669 +y Ft(cmdhist)144 b Fu(If)33 b(set,)j(Bash)e(attempts)h(to)g(sa)m(v)m(e) +g(all)g(lines)f(of)g(a)h(m)m(ultiple-line)g(command)1110 +778 y(in)c(the)g(same)g(history)g(en)m(try)-8 b(.)42 +b(This)30 b(allo)m(ws)i(easy)g(re-editing)g(of)f(m)m(ulti-line)1110 +888 y(commands.)630 1039 y Ft(compat31)96 b Fu(If)27 +b(set,)i(Bash)e(c)m(hanges)i(its)f(b)s(eha)m(vior)f(to)i(that)f(of)f(v) +m(ersion)h(3.1)h(with)e(resp)s(ect)1110 1148 y(to)39 +b(quoted)f(argumen)m(ts)g(to)h(the)f(conditional)h(command's)f(`)p +Ft(=~)p Fu(')g(op)s(erator)1110 1258 y(and)i(with)f(resp)s(ect)i(to)g +(lo)s(cale-sp)s(eci\014c)h(string)e(comparison)g(when)f(using)1110 +1367 y(the)31 b Ft([[)e Fu(conditional)j(command's)e(`)p +Ft(<)p Fu(')h(and)f(`)p Ft(>)p Fu(')g(op)s(erators.)41 +b(Bash)31 b(v)m(ersions)1110 1477 y(prior)g(to)h(bash-4.1)g(use)g(ASCI) +s(I)e(collation)j(and)e(strcmp\(3\);)i(bash-4.1)g(and)1110 +1587 y(later)e(use)f(the)h(curren)m(t)f(lo)s(cale's)i(collation)h +(sequence)e(and)f(strcoll\(3\).)630 1737 y Ft(compat32)96 +b Fu(If)27 b(set,)i(Bash)e(c)m(hanges)i(its)f(b)s(eha)m(vior)f(to)i +(that)f(of)f(v)m(ersion)h(3.2)h(with)e(resp)s(ect)1110 +1847 y(to)34 b(lo)s(cale-sp)s(eci\014c)h(string)e(comparison)g(when)f +(using)h(the)g Ft([[)g Fu(conditional)1110 1956 y(command's)d(`)p +Ft(<)p Fu(')h(and)f(`)p Ft(>)p Fu(')g(op)s(erators)h(\(see)g(previous)f +(item\).)630 2107 y Ft(compat40)96 b Fu(If)27 b(set,)i(Bash)e(c)m +(hanges)i(its)f(b)s(eha)m(vior)f(to)i(that)f(of)f(v)m(ersion)h(4.0)h +(with)e(resp)s(ect)1110 2217 y(to)34 b(lo)s(cale-sp)s(eci\014c)h +(string)e(comparison)g(when)f(using)h(the)g Ft([[)g Fu(conditional)1110 +2326 y(command's)28 b(`)p Ft(<)p Fu(')h(and)f(`)p Ft(>)p +Fu(')h(op)s(erators)f(\(see)i(description)e(of)h Ft(compat31)p +Fu(\))e(and)1110 2436 y(the)38 b(e\013ect)i(of)e(in)m(terrupting)f(a)i +(command)e(list.)64 b(Bash)38 b(v)m(ersions)h(4.0)g(and)1110 +2545 y(later)24 b(in)m(terrupt)f(the)g(list)h(as)g(if)f(the)h(shell)f +(receiv)m(ed)i(the)e(in)m(terrupt;)i(previous)1110 2655 +y(v)m(ersions)31 b(con)m(tin)m(ue)g(with)f(the)h(next)g(command)f(in)g +(the)g(list.)630 2806 y Ft(compat41)96 b Fu(If)25 b(set,)j(Bash,)e +(when)f(in)g Fm(posix)g Fu(mo)s(de,)i(treats)f(a)g(single)h(quote)f(in) +f(a)h(double-)1110 2915 y(quoted)46 b(parameter)h(expansion)f(as)g(a)h +(sp)s(ecial)f(c)m(haracter.)90 b(The)45 b(single)1110 +3025 y(quotes)34 b(m)m(ust)g(matc)m(h)h(\(an)f(ev)m(en)h(n)m(um)m(b)s +(er\))e(and)g(the)h(c)m(haracters)h(b)s(et)m(w)m(een)1110 +3134 y(the)40 b(single)g(quotes)g(are)g(considered)g(quoted.)69 +b(This)38 b(is)i(the)g(b)s(eha)m(vior)g(of)1110 3244 +y Fm(posix)f Fu(mo)s(de)g(through)g(v)m(ersion)h(4.1.)69 +b(The)39 b(default)g(Bash)h(b)s(eha)m(vior)g(re-)1110 +3354 y(mains)30 b(as)h(in)f(previous)g(v)m(ersions.)630 +3504 y Ft(compat42)96 b Fu(If)29 b(set,)i(Bash)f(do)s(es)f(not)h(pro)s +(cess)g(the)g(replacemen)m(t)h(string)e(in)h(the)g(pattern)1110 +3614 y(substitution)g(w)m(ord)g(expansion)g(using)g(quote)h(remo)m(v)-5 +b(al.)630 3765 y Ft(complete_fullquote)1110 3874 y Fu(If)31 +b(set,)g(Bash)h(quotes)f(all)h(shell)f(metac)m(haracters)i(in)e +(\014lenames)g(and)g(direc-)1110 3984 y(tory)g(names)f(when)g(p)s +(erforming)f(completion.)43 b(If)30 b(not)h(set,)g(Bash)g(remo)m(v)m +(es)1110 4093 y(metac)m(haracters)40 b(suc)m(h)d(as)h(the)g(dollar)g +(sign)g(from)f(the)h(set)g(of)f(c)m(haracters)1110 4203 +y(that)f(will)g(b)s(e)f(quoted)g(in)g(completed)i(\014lenames)e(when)f +(these)i(metac)m(har-)1110 4313 y(acters)29 b(app)s(ear)e(in)g(shell)h +(v)-5 b(ariable)28 b(references)g(in)f(w)m(ords)g(to)i(b)s(e)e +(completed.)1110 4422 y(This)k(means)i(that)g(dollar)f(signs)g(in)g(v) +-5 b(ariable)33 b(names)g(that)f(expand)g(to)h(di-)1110 +4532 y(rectories)28 b(will)g(not)f(b)s(e)f(quoted;)j(ho)m(w)m(ev)m(er,) +g(an)m(y)e(dollar)h(signs)f(app)s(earing)f(in)1110 4641 +y(\014lenames)j(will)h(not)f(b)s(e)g(quoted,)h(either.)41 +b(This)28 b(is)i(activ)m(e)h(only)e(when)g(bash)1110 +4751 y(is)39 b(using)f(bac)m(kslashes)i(to)g(quote)g(completed)f +(\014lenames.)67 b(This)38 b(v)-5 b(ariable)1110 4861 +y(is)41 b(set)g(b)m(y)g(default,)j(whic)m(h)c(is)h(the)g(default)g +(Bash)g(b)s(eha)m(vior)g(in)g(v)m(ersions)1110 4970 y(through)30 +b(4.2.)630 5121 y Ft(direxpand)1110 5230 y Fu(If)k(set,)i(Bash)f +(replaces)g(directory)g(names)g(with)f(the)g(results)h(of)f(w)m(ord)g +(ex-)1110 5340 y(pansion)k(when)g(p)s(erforming)f(\014lename)i +(completion.)67 b(This)38 b(c)m(hanges)i(the)p eop end +%%Page: 65 71 +TeXDict begin 65 70 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(65)1110 299 y(con)m(ten)m(ts)29 +b(of)e(the)g(readline)h(editing)g(bu\013er.)38 b(If)27 +b(not)g(set,)i(Bash)e(attempts)h(to)1110 408 y(preserv)m(e)j(what)f +(the)g(user)g(t)m(yp)s(ed.)630 555 y Ft(dirspell)96 b +Fu(If)26 b(set,)i(Bash)f(attempts)g(sp)s(elling)g(correction)g(on)g +(directory)g(names)f(during)1110 664 y(w)m(ord)36 b(completion)h(if)f +(the)g(directory)g(name)g(initially)h(supplied)e(do)s(es)h(not)1110 +774 y(exist.)630 920 y Ft(dotglob)144 b Fu(If)27 b(set,)i(Bash)f +(includes)g(\014lenames)g(b)s(eginning)f(with)g(a)h(`.')41 +b(in)27 b(the)h(results)g(of)1110 1029 y(\014lename)j(expansion.)630 +1176 y Ft(execfail)96 b Fu(If)24 b(this)h(is)f(set,)j(a)e(non-in)m +(teractiv)m(e)i(shell)e(will)f(not)h(exit)h(if)e(it)h(cannot)h(execute) +1110 1285 y(the)i(\014le)g(sp)s(eci\014ed)g(as)g(an)g(argumen)m(t)g(to) +h(the)f Ft(exec)f Fu(builtin)h(command.)39 b(An)1110 +1395 y(in)m(teractiv)m(e)33 b(shell)e(do)s(es)f(not)g(exit)i(if)e +Ft(exec)f Fu(fails.)630 1541 y Ft(expand_aliases)1110 +1650 y Fu(If)j(set,)h(aliases)g(are)g(expanded)e(as)h(describ)s(ed)f(b) +s(elo)m(w)h(under)f(Aliases,)i(Sec-)1110 1760 y(tion)38 +b(6.6)h([Aliases],)j(page)d(88.)64 b(This)37 b(option)h(is)g(enabled)g +(b)m(y)g(default)g(for)1110 1870 y(in)m(teractiv)m(e)33 +b(shells.)630 2016 y Ft(extdebug)96 b Fu(If)30 b(set,)h(b)s(eha)m(vior) +g(in)m(tended)f(for)g(use)g(b)m(y)g(debuggers)g(is)h(enabled:)1159 +2144 y(1.)61 b(The)37 b Ft(-F)g Fu(option)h(to)g(the)g +Ft(declare)d Fu(builtin)i(\(see)i(Section)f(4.2)h([Bash)1290 +2253 y(Builtins],)29 b(page)g(48\))g(displa)m(ys)f(the)g(source)h +(\014le)f(name)g(and)f(line)h(n)m(um-)1290 2363 y(b)s(er)h(corresp)s +(onding)g(to)i(eac)m(h)g(function)f(name)g(supplied)f(as)i(an)f(argu-) +1290 2472 y(men)m(t.)1159 2600 y(2.)61 b(If)20 b(the)h(command)g(run)e +(b)m(y)i(the)f Ft(DEBUG)g Fu(trap)g(returns)g(a)h(non-zero)g(v)-5 +b(alue,)1290 2710 y(the)31 b(next)f(command)g(is)h(skipp)s(ed)e(and)g +(not)i(executed.)1159 2838 y(3.)61 b(If)37 b(the)g(command)g(run)f(b)m +(y)i(the)f Ft(DEBUG)f Fu(trap)h(returns)f(a)i(v)-5 b(alue)38 +b(of)f(2,)1290 2947 y(and)c(the)g(shell)h(is)f(executing)i(in)e(a)h +(subroutine)e(\(a)i(shell)g(function)f(or)1290 3057 y(a)h(shell)h +(script)f(executed)h(b)m(y)f(the)g Ft(.)g Fu(or)g Ft(source)e +Fu(builtins\),)j(a)g(call)g(to)1290 3166 y Ft(return)29 +b Fu(is)h(sim)m(ulated.)1159 3294 y(4.)61 b Ft(BASH_ARGC)34 +b Fu(and)i Ft(BASH_ARGV)e Fu(are)j(up)s(dated)e(as)h(describ)s(ed)g(in) +g(their)1290 3404 y(descriptions)30 b(\(see)i(Section)f(5.2)g([Bash)g +(V)-8 b(ariables],)32 b(page)f(69\).)1159 3532 y(5.)61 +b(F)-8 b(unction)57 b(tracing)g(is)g(enabled:)93 b(command)56 +b(substitution,)63 b(shell)1290 3641 y(functions,)32 +b(and)e(subshells)h(in)m(v)m(ok)m(ed)i(with)e Ft(\()f +Fj(command)e Ft(\))j Fu(inherit)h(the)1290 3751 y Ft(DEBUG)d +Fu(and)h Ft(RETURN)e Fu(traps.)1159 3879 y(6.)61 b(Error)41 +b(tracing)i(is)f(enabled:)63 b(command)42 b(substitution,)i(shell)f +(func-)1290 3988 y(tions,)32 b(and)e(subshells)g(in)m(v)m(ok)m(ed)i +(with)e Ft(\()g Fj(command)f Ft(\))h Fu(inherit)h(the)g +Ft(ERR)1290 4098 y Fu(trap.)630 4244 y Ft(extglob)144 +b Fu(If)26 b(set,)i(the)f(extended)f(pattern)h(matc)m(hing)g(features)g +(describ)s(ed)e(ab)s(o)m(v)m(e)j(\(see)1110 4354 y(Section)j(3.5.8.1)i +([P)m(attern)f(Matc)m(hing],)g(page)f(30\))h(are)f(enabled.)630 +4500 y Ft(extquote)96 b Fu(If)51 b(set,)58 b Ft($')p +Fj(string)p Ft(')49 b Fu(and)i Ft($")p Fj(string)p Ft(")e +Fu(quoting)k(is)e(p)s(erformed)f(within)1110 4609 y Ft(${)p +Fj(parameter)p Ft(})31 b Fu(expansions)k(enclosed)g(in)g(double)f +(quotes.)55 b(This)33 b(option)1110 4719 y(is)d(enabled)h(b)m(y)f +(default.)630 4865 y Ft(failglob)96 b Fu(If)36 b(set,)j(patterns)d +(whic)m(h)g(fail)h(to)h(matc)m(h)f(\014lenames)f(during)g(\014lename)g +(ex-)1110 4975 y(pansion)30 b(result)g(in)g(an)g(expansion)h(error.)630 +5121 y Ft(force_fignore)1110 5230 y Fu(If)43 b(set,)k(the)d(su\016xes)f +(sp)s(eci\014ed)f(b)m(y)i(the)f Ft(FIGNORE)f Fu(shell)h(v)-5 +b(ariable)44 b(cause)1110 5340 y(w)m(ords)31 b(to)h(b)s(e)f(ignored)h +(when)f(p)s(erforming)f(w)m(ord)h(completion)i(ev)m(en)f(if)g(the)p +eop end +%%Page: 66 72 +TeXDict begin 66 71 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(66)1110 299 y(ignored)37 +b(w)m(ords)g(are)g(the)h(only)f(p)s(ossible)g(completions.)62 +b(See)37 b(Section)h(5.2)1110 408 y([Bash)24 b(V)-8 b(ariables],)27 +b(page)e(69,)h(for)d(a)h(description)g(of)g Ft(FIGNORE)p +Fu(.)37 b(This)22 b(option)1110 518 y(is)30 b(enabled)h(b)m(y)f +(default.)630 701 y Ft(globasciiranges)1110 810 y Fu(If)j(set,)h(range) +f(expressions)g(used)f(in)h(pattern)g(matc)m(hing)h(brac)m(k)m(et)h +(expres-)1110 920 y(sions)28 b(\(see)h(Section)h(3.5.8.1)g([P)m(attern) +g(Matc)m(hing],)h(page)e(30\))g(b)s(eha)m(v)m(e)g(as)g(if)1110 +1029 y(in)i(the)g(traditional)i(C)d(lo)s(cale)j(when)d(p)s(erforming)g +(comparisons.)44 b(That)31 b(is,)1110 1139 y(the)d(curren)m(t)g(lo)s +(cale's)i(collating)h(sequence)d(is)h(not)f(tak)m(en)h(in)m(to)g +(accoun)m(t,)i(so)1110 1249 y(`)p Ft(b)p Fu(')j(will)g(not)g(collate)i +(b)s(et)m(w)m(een)e(`)p Ft(A)p Fu(')g(and)f(`)p Ft(B)p +Fu(',)h(and)f(upp)s(er-case)g(and)g(lo)m(w)m(er-)1110 +1358 y(case)e(ASCI)s(I)e(c)m(haracters)j(will)f(collate)i(together.)630 +1541 y Ft(globstar)96 b Fu(If)38 b(set,)j(the)e(pattern)f(`)p +Ft(**)p Fu(')h(used)e(in)i(a)f(\014lename)h(expansion)f(con)m(text)j +(will)1110 1650 y(matc)m(h)36 b(all)g(\014les)f(and)f(zero)i(or)f(more) +g(directories)h(and)e(sub)s(directories.)54 b(If)1110 +1760 y(the)30 b(pattern)g(is)g(follo)m(w)m(ed)i(b)m(y)d(a)i(`)p +Ft(/)p Fu(',)f(only)g(directories)h(and)f(sub)s(directories)1110 +1870 y(matc)m(h.)630 2052 y Ft(gnu_errfmt)1110 2162 y +Fu(If)35 b(set,)j(shell)e(error)g(messages)g(are)h(written)e(in)h(the)g +(standard)f Fm(gnu)g Fu(error)1110 2271 y(message)c(format.)630 +2454 y Ft(histappend)1110 2564 y Fu(If)c(set,)j(the)e(history)g(list)g +(is)g(app)s(ended)e(to)j(the)f(\014le)g(named)f(b)m(y)h(the)g(v)-5 +b(alue)29 b(of)1110 2673 y(the)d Ft(HISTFILE)d Fu(v)-5 +b(ariable)26 b(when)e(the)h(shell)h(exits,)h(rather)e(than)h(o)m(v)m +(erwriting)1110 2783 y(the)31 b(\014le.)630 2966 y Ft(histreedit)1110 +3075 y Fu(If)i(set,)h(and)f(Readline)h(is)f(b)s(eing)g(used,)g(a)g +(user)g(is)g(giv)m(en)h(the)g(opp)s(ortunit)m(y)1110 +3185 y(to)d(re-edit)g(a)g(failed)g(history)f(substitution.)630 +3367 y Ft(histverify)1110 3477 y Fu(If)35 b(set,)i(and)e(Readline)h(is) +f(b)s(eing)g(used,)h(the)f(results)g(of)g(history)h(substitu-)1110 +3587 y(tion)h(are)g(not)g(immediately)h(passed)e(to)h(the)g(shell)g +(parser.)59 b(Instead,)38 b(the)1110 3696 y(resulting)i(line)f(is)h +(loaded)g(in)m(to)g(the)g(Readline)g(editing)g(bu\013er,)h(allo)m(wing) +1110 3806 y(further)29 b(mo)s(di\014cation.)630 3988 +y Ft(hostcomplete)1110 4098 y Fu(If)38 b(set,)j(and)c(Readline)i(is)f +(b)s(eing)g(used,)h(Bash)g(will)f(attempt)h(to)g(p)s(erform)1110 +4208 y(hostname)d(completion)h(when)e(a)h(w)m(ord)f(con)m(taining)i(a)f +(`)p Ft(@)p Fu(')g(is)g(b)s(eing)f(com-)1110 4317 y(pleted)g(\(see)h +(Section)f(8.4.6)i([Commands)d(F)-8 b(or)36 b(Completion],)g(page)g +(120\).)1110 4427 y(This)30 b(option)g(is)h(enabled)f(b)m(y)g(default.) +630 4609 y Ft(huponexit)1110 4719 y Fu(If)i(set,)i(Bash)f(will)h(send)d +Ft(SIGHUP)h Fu(to)h(all)h(jobs)e(when)g(an)g(in)m(teractiv)m(e)k(login) +1110 4829 y(shell)31 b(exits)g(\(see)g(Section)g(3.7.6)h([Signals],)g +(page)f(38\).)630 5011 y Ft(interactive_comments)1110 +5121 y Fu(Allo)m(w)c(a)g(w)m(ord)e(b)s(eginning)g(with)h(`)p +Ft(#)p Fu(')g(to)h(cause)f(that)h(w)m(ord)f(and)f(all)i(remain-)1110 +5230 y(ing)41 b(c)m(haracters)i(on)e(that)h(line)g(to)g(b)s(e)f +(ignored)g(in)g(an)g(in)m(teractiv)m(e)j(shell.)1110 +5340 y(This)30 b(option)g(is)h(enabled)f(b)m(y)g(default.)p +eop end +%%Page: 67 73 +TeXDict begin 67 72 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(67)630 299 y Ft(lastpipe)96 +b Fu(If)24 b(set,)i(and)e(job)g(con)m(trol)i(is)f(not)f(activ)m(e,)k +(the)d(shell)f(runs)f(the)i(last)g(command)1110 408 y(of)37 +b(a)h(pip)s(eline)e(not)h(executed)h(in)f(the)g(bac)m(kground)g(in)g +(the)g(curren)m(t)g(shell)1110 518 y(en)m(vironmen)m(t.)630 +677 y Ft(lithist)144 b Fu(If)22 b(enabled,)i(and)d(the)h +Ft(cmdhist)e Fu(option)j(is)f(enabled,)i(m)m(ulti-line)f(commands)1110 +787 y(are)28 b(sa)m(v)m(ed)h(to)g(the)f(history)g(with)f(em)m(b)s +(edded)g(newlines)h(rather)g(than)f(using)1110 897 y(semicolon)32 +b(separators)f(where)e(p)s(ossible.)630 1056 y Ft(login_shell)1110 +1166 y Fu(The)35 b(shell)h(sets)g(this)f(option)h(if)g(it)g(is)f +(started)h(as)g(a)g(login)g(shell)g(\(see)g(Sec-)1110 +1275 y(tion)29 b(6.1)g([In)m(v)m(oking)h(Bash],)f(page)g(80\).)41 +b(The)28 b(v)-5 b(alue)29 b(ma)m(y)g(not)f(b)s(e)g(c)m(hanged.)630 +1435 y Ft(mailwarn)96 b Fu(If)34 b(set,)i(and)e(a)h(\014le)g(that)g +(Bash)f(is)h(c)m(hec)m(king)h(for)f(mail)g(has)f(b)s(een)g(accessed) +1110 1544 y(since)24 b(the)h(last)g(time)f(it)h(w)m(as)f(c)m(hec)m(k)m +(ed,)k(the)c(message)h Ft("The)k(mail)h(in)f Fj(mail-)1110 +1654 y(file)g Ft(has)h(been)f(read")g Fu(is)h(displa)m(y)m(ed.)630 +1813 y Ft(no_empty_cmd_completion)1110 1923 y Fu(If)g(set,)g(and)g +(Readline)g(is)h(b)s(eing)e(used,)h(Bash)g(will)g(not)g(attempt)i(to)e +(searc)m(h)1110 2032 y(the)25 b Ft(PATH)f Fu(for)h(p)s(ossible)f +(completions)j(when)d(completion)i(is)f(attempted)h(on)1110 +2142 y(an)k(empt)m(y)h(line.)630 2301 y Ft(nocaseglob)1110 +2411 y Fu(If)38 b(set,)k(Bash)d(matc)m(hes)g(\014lenames)g(in)f(a)h +(case-insensitiv)m(e)j(fashion)c(when)1110 2521 y(p)s(erforming)29 +b(\014lename)i(expansion.)630 2680 y Ft(nocasematch)1110 +2790 y Fu(If)42 b(set,)k(Bash)d(matc)m(hes)g(patterns)g(in)f(a)h +(case-insensitiv)m(e)i(fashion)d(when)1110 2899 y(p)s(erforming)31 +b(matc)m(hing)i(while)f(executing)i Ft(case)d Fu(or)h +Ft([[)g Fu(conditional)h(com-)1110 3009 y(mands.)630 +3168 y Ft(nullglob)96 b Fu(If)23 b(set,)j(Bash)e(allo)m(ws)g +(\014lename)g(patterns)g(whic)m(h)f(matc)m(h)h(no)g(\014les)f(to)i +(expand)1110 3278 y(to)31 b(a)g(n)m(ull)f(string,)h(rather)f(than)g +(themselv)m(es.)630 3437 y Ft(progcomp)96 b Fu(If)25 +b(set,)i(the)f(programmable)g(completion)g(facilities)i(\(see)f +(Section)f(8.6)h([Pro-)1110 3547 y(grammable)45 b(Completion],)k(page)c +(124\))h(are)f(enabled.)82 b(This)44 b(option)h(is)1110 +3656 y(enabled)30 b(b)m(y)h(default.)630 3816 y Ft(promptvars)1110 +3925 y Fu(If)50 b(set,)56 b(prompt)49 b(strings)h(undergo)g(parameter)h +(expansion,)k(command)1110 4035 y(substitution,)35 b(arithmetic)g +(expansion,)g(and)e(quote)i(remo)m(v)-5 b(al)35 b(after)f(b)s(eing)1110 +4144 y(expanded)53 b(as)h(describ)s(ed)e(b)s(elo)m(w)i(\(see)h(Section) +f(6.9)h([Con)m(trolling)g(the)1110 4254 y(Prompt],)30 +b(page)h(92\).)42 b(This)30 b(option)h(is)f(enabled)h(b)m(y)f(default.) +630 4413 y Ft(restricted_shell)1110 4523 y Fu(The)40 +b(shell)h(sets)g(this)g(option)g(if)g(it)h(is)e(started)i(in)e +(restricted)i(mo)s(de)e(\(see)1110 4633 y(Section)c(6.10)g([The)f +(Restricted)g(Shell],)i(page)e(93\).)56 b(The)34 b(v)-5 +b(alue)35 b(ma)m(y)h(not)1110 4742 y(b)s(e)c(c)m(hanged.)49 +b(This)32 b(is)h(not)h(reset)f(when)f(the)h(startup)g(\014les)f(are)i +(executed,)1110 4852 y(allo)m(wing)k(the)e(startup)f(\014les)h(to)g +(disco)m(v)m(er)h(whether)f(or)f(not)i(a)f(shell)g(is)g(re-)1110 +4961 y(stricted.)630 5121 y Ft(shift_verbose)1110 5230 +y Fu(If)g(this)g(is)g(set,)j(the)d Ft(shift)f Fu(builtin)h(prin)m(ts)f +(an)h(error)g(message)i(when)d(the)1110 5340 y(shift)30 +b(coun)m(t)h(exceeds)g(the)g(n)m(um)m(b)s(er)e(of)h(p)s(ositional)i +(parameters.)p eop end +%%Page: 68 74 +TeXDict begin 68 73 bop 150 -116 a Fu(Chapter)30 b(4:)41 +b(Shell)30 b(Builtin)h(Commands)2069 b(68)630 299 y Ft(sourcepath)1110 +408 y Fu(If)22 b(set,)j(the)e Ft(source)e Fu(builtin)h(uses)g(the)h(v) +-5 b(alue)23 b(of)g Ft(PATH)e Fu(to)j(\014nd)d(the)h(directory)1110 +518 y(con)m(taining)29 b(the)e(\014le)h(supplied)e(as)h(an)g(argumen)m +(t.)40 b(This)27 b(option)h(is)f(enabled)1110 628 y(b)m(y)j(default.) +630 787 y Ft(xpg_echo)96 b Fu(If)31 b(set,)h(the)g Ft(echo)e +Fu(builtin)h(expands)f(bac)m(kslash-escap)s(e)j(sequences)f(b)m(y)f +(de-)1110 897 y(fault.)630 1056 y(The)c(return)f(status)i(when)f +(listing)h(options)g(is)f(zero)i(if)e(all)i Fr(optnames)i +Fu(are)d(enabled,)g(non-)630 1166 y(zero)40 b(otherwise.)66 +b(When)39 b(setting)h(or)f(unsetting)g(options,)i(the)e(return)f +(status)h(is)g(zero)630 1275 y(unless)30 b(an)g Fr(optname)36 +b Fu(is)30 b(not)h(a)g(v)-5 b(alid)30 b(shell)h(option.)150 +1508 y Fs(4.4)68 b(Sp)t(ecial)45 b(Builtins)150 1667 +y Fu(F)-8 b(or)35 b(historical)h(reasons,)g(the)e Fm(posix)g +Fu(standard)f(has)i(classi\014ed)f(sev)m(eral)i(builtin)e(commands)g +(as)h Fl(sp)-5 b(e-)150 1777 y(cial)p Fu(.)47 b(When)33 +b(Bash)f(is)h(executing)g(in)f Fm(posix)g Fu(mo)s(de,)h(the)g(sp)s +(ecial)g(builtins)e(di\013er)i(from)f(other)g(builtin)150 +1886 y(commands)e(in)g(three)h(resp)s(ects:)199 2021 +y(1.)61 b(Sp)s(ecial)31 b(builtins)e(are)i(found)e(b)s(efore)h(shell)h +(functions)f(during)f(command)h(lo)s(okup.)199 2155 y(2.)61 +b(If)30 b(a)h(sp)s(ecial)g(builtin)f(returns)f(an)h(error)g(status,)h +(a)g(non-in)m(teractiv)m(e)i(shell)d(exits.)199 2290 +y(3.)61 b(Assignmen)m(t)30 b(statemen)m(ts)h(preceding)f(the)f(command) +g(sta)m(y)i(in)e(e\013ect)i(in)e(the)h(shell)f(en)m(vironmen)m(t)330 +2399 y(after)i(the)f(command)h(completes.)275 2559 y(When)36 +b(Bash)g(is)h(not)f(executing)i(in)e Fm(posix)f Fu(mo)s(de,)j(these)f +(builtins)f(b)s(eha)m(v)m(e)h(no)f(di\013eren)m(tly)h(than)150 +2668 y(the)31 b(rest)f(of)h(the)f(Bash)h(builtin)e(commands.)41 +b(The)30 b(Bash)g Fm(posix)g Fu(mo)s(de)g(is)g(describ)s(ed)f(in)h +(Section)h(6.11)150 2778 y([Bash)g(POSIX)e(Mo)s(de],)i(page)g(94.)275 +2912 y(These)f(are)g(the)h Fm(posix)f Fu(sp)s(ecial)h(builtins:)390 +3047 y Ft(break)46 b(:)i(.)f(continue)f(eval)g(exec)h(exit)g(export)f +(readonly)f(return)h(set)390 3156 y(shift)g(trap)h(unset)p +eop end +%%Page: 69 75 +TeXDict begin 69 74 bop 150 -116 a Fu(Chapter)30 b(5:)41 +b(Shell)30 b(V)-8 b(ariables)2459 b(69)150 299 y Fp(5)80 +b(Shell)53 b(V)-13 b(ariables)150 541 y Fu(This)21 b(c)m(hapter)i +(describ)s(es)e(the)i(shell)f(v)-5 b(ariables)23 b(that)f(Bash)h(uses.) +37 b(Bash)23 b(automatically)h(assigns)f(default)150 +651 y(v)-5 b(alues)31 b(to)g(a)g(n)m(um)m(b)s(er)e(of)h(v)-5 +b(ariables.)150 888 y Fs(5.1)68 b(Bourne)45 b(Shell)g(V)-11 +b(ariables)150 1047 y Fu(Bash)30 b(uses)g(certain)h(shell)g(v)-5 +b(ariables)31 b(in)f(the)g(same)h(w)m(a)m(y)g(as)g(the)f(Bourne)g +(shell.)41 b(In)30 b(some)g(cases,)i(Bash)150 1157 y(assigns)f(a)f +(default)h(v)-5 b(alue)31 b(to)g(the)f(v)-5 b(ariable.)150 +1320 y Ft(CDPATH)192 b Fu(A)39 b(colon-separated)i(list)e(of)g +(directories)h(used)f(as)g(a)g(searc)m(h)h(path)e(for)h(the)g +Ft(cd)f Fu(builtin)630 1430 y(command.)150 1592 y Ft(HOME)288 +b Fu(The)23 b(curren)m(t)h(user's)f(home)g(directory;)k(the)d(default)g +(for)f(the)h Ft(cd)f Fu(builtin)g(command.)38 b(The)630 +1702 y(v)-5 b(alue)37 b(of)f(this)g(v)-5 b(ariable)37 +b(is)g(also)g(used)e(b)m(y)h(tilde)h(expansion)f(\(see)i(Section)f +(3.5.2)h([Tilde)630 1811 y(Expansion],)30 b(page)h(22\).)150 +1973 y Ft(IFS)336 b Fu(A)25 b(list)i(of)e(c)m(haracters)i(that)f +(separate)g(\014elds;)h(used)e(when)f(the)i(shell)f(splits)h(w)m(ords)e +(as)i(part)630 2083 y(of)31 b(expansion.)150 2245 y Ft(MAIL)288 +b Fu(If)44 b(this)g(parameter)h(is)g(set)g(to)g(a)f(\014lename)h(or)f +(directory)h(name)g(and)f(the)g Ft(MAILPATH)630 2355 +y Fu(v)-5 b(ariable)32 b(is)e(not)h(set,)h(Bash)f(informs)f(the)h(user) +f(of)h(the)g(arriv)-5 b(al)31 b(of)g(mail)g(in)g(the)g(sp)s(eci\014ed) +630 2464 y(\014le)f(or)h(Maildir-format)g(directory)-8 +b(.)150 2627 y Ft(MAILPATH)96 b Fu(A)33 b(colon-separated)i(list)f(of)f +(\014lenames)h(whic)m(h)f(the)g(shell)g(p)s(erio)s(dically)h(c)m(hec)m +(ks)g(for)f(new)630 2736 y(mail.)60 b(Eac)m(h)37 b(list)g(en)m(try)g +(can)g(sp)s(ecify)f(the)h(message)h(that)f(is)g(prin)m(ted)f(when)f +(new)h(mail)630 2846 y(arriv)m(es)31 b(in)g(the)g(mail)g(\014le)g(b)m +(y)g(separating)h(the)f(\014lename)g(from)f(the)h(message)h(with)e(a)i +(`)p Ft(?)p Fu('.)630 2955 y(When)g(used)f(in)h(the)g(text)i(of)e(the)g +(message,)i Ft($_)e Fu(expands)f(to)i(the)f(name)g(of)h(the)f(curren)m +(t)630 3065 y(mail)f(\014le.)150 3227 y Ft(OPTARG)192 +b Fu(The)30 b(v)-5 b(alue)31 b(of)f(the)h(last)g(option)g(argumen)m(t)g +(pro)s(cessed)f(b)m(y)g(the)g Ft(getopts)f Fu(builtin.)150 +3389 y Ft(OPTIND)192 b Fu(The)30 b(index)g(of)g(the)h(last)g(option)g +(argumen)m(t)g(pro)s(cessed)f(b)m(y)g(the)g Ft(getopts)f +Fu(builtin.)150 3552 y Ft(PATH)288 b Fu(A)32 b(colon-separated)i(list)f +(of)f(directories)h(in)e(whic)m(h)h(the)g(shell)g(lo)s(oks)h(for)f +(commands.)45 b(A)630 3661 y(zero-length)e(\(n)m(ull\))g(directory)f +(name)g(in)g(the)g(v)-5 b(alue)42 b(of)g Ft(PATH)f Fu(indicates)i(the)f +(curren)m(t)630 3771 y(directory)-8 b(.)49 b(A)33 b(n)m(ull)f +(directory)i(name)e(ma)m(y)i(app)s(ear)e(as)h(t)m(w)m(o)h(adjacen)m(t)g +(colons,)g(or)f(as)g(an)630 3880 y(initial)f(or)e(trailing)h(colon.)150 +4042 y Ft(PS1)336 b Fu(The)35 b(primary)f(prompt)h(string.)55 +b(The)35 b(default)h(v)-5 b(alue)35 b(is)h(`)p Ft(\\s-\\v\\$)28 +b Fu('.)56 b(See)36 b(Section)g(6.9)630 4152 y([Con)m(trolling)42 +b(the)e(Prompt],)j(page)e(92,)j(for)c(the)g(complete)i(list)f(of)f +(escap)s(e)h(sequences)630 4262 y(that)31 b(are)g(expanded)e(b)s(efore) +h Ft(PS1)g Fu(is)g(displa)m(y)m(ed.)150 4424 y Ft(PS2)336 +b Fu(The)30 b(secondary)g(prompt)g(string.)41 b(The)29 +b(default)i(v)-5 b(alue)31 b(is)f(`)p Ft(>)g Fu('.)150 +4661 y Fs(5.2)68 b(Bash)45 b(V)-11 b(ariables)150 4820 +y Fu(These)45 b(v)-5 b(ariables)46 b(are)g(set)g(or)f(used)f(b)m(y)h +(Bash,)50 b(but)44 b(other)i(shells)f(do)h(not)f(normally)h(treat)g +(them)150 4929 y(sp)s(ecially)-8 b(.)275 5067 y(A)24 +b(few)g(v)-5 b(ariables)24 b(used)g(b)m(y)f(Bash)i(are)f(describ)s(ed)f +(in)h(di\013eren)m(t)g(c)m(hapters:)38 b(v)-5 b(ariables)25 +b(for)f(con)m(trolling)150 5176 y(the)31 b(job)f(con)m(trol)h +(facilities)i(\(see)e(Section)g(7.3)h([Job)e(Con)m(trol)h(V)-8 +b(ariables],)32 b(page)g(100\).)150 5340 y Ft(BASH)288 +b Fu(The)30 b(full)g(pathname)g(used)g(to)h(execute)h(the)e(curren)m(t) +g(instance)h(of)g(Bash.)p eop end +%%Page: 70 76 +TeXDict begin 70 75 bop 150 -116 a Fu(Chapter)30 b(5:)41 +b(Shell)30 b(V)-8 b(ariables)2459 b(70)150 299 y Ft(BASHOPTS)96 +b Fu(A)31 b(colon-separated)h(list)f(of)g(enabled)f(shell)h(options.)41 +b(Eac)m(h)31 b(w)m(ord)f(in)g(the)h(list)g(is)g(a)g(v)-5 +b(alid)630 408 y(argumen)m(t)37 b(for)g(the)g Ft(-s)f +Fu(option)i(to)f(the)g Ft(shopt)f Fu(builtin)g(command)h(\(see)g +(Section)h(4.3.2)630 518 y([The)e(Shopt)g(Builtin],)i(page)f(62\).)60 +b(The)36 b(options)h(app)s(earing)f(in)g Ft(BASHOPTS)e +Fu(are)i(those)630 628 y(rep)s(orted)e(as)h(`)p Ft(on)p +Fu(')f(b)m(y)h(`)p Ft(shopt)p Fu('.)53 b(If)34 b(this)g(v)-5 +b(ariable)36 b(is)f(in)f(the)h(en)m(vironmen)m(t)g(when)f(Bash)630 +737 y(starts)25 b(up,)f(eac)m(h)i(shell)e(option)h(in)e(the)i(list)g +(will)f(b)s(e)g(enabled)g(b)s(efore)g(reading)g(an)m(y)g(startup)630 +847 y(\014les.)41 b(This)29 b(v)-5 b(ariable)31 b(is)g(readonly)-8 +b(.)150 1003 y Ft(BASHPID)144 b Fu(Expands)35 b(to)i(the)f(pro)s(cess)f +(ID)i(of)f(the)g(curren)m(t)g(Bash)g(pro)s(cess.)58 b(This)35 +b(di\013ers)h(from)g Ft($$)630 1113 y Fu(under)31 b(certain)j +(circumstances,)h(suc)m(h)e(as)g(subshells)f(that)i(do)f(not)g(require) +g(Bash)g(to)h(b)s(e)630 1223 y(re-initialized.)150 1379 +y Ft(BASH_ALIASES)630 1489 y Fu(An)40 b(asso)s(ciativ)m(e)j(arra)m(y)d +(v)-5 b(ariable)41 b(whose)f(mem)m(b)s(ers)f(corresp)s(ond)g(to)i(the)f +(in)m(ternal)h(list)630 1598 y(of)c(aliases)h(as)f(main)m(tained)g(b)m +(y)g(the)g Ft(alias)e Fu(builtin.)59 b(\(see)37 b(Section)h(4.1)f +([Bourne)g(Shell)630 1708 y(Builtins],)f(page)e(41\).)53 +b(Elemen)m(ts)35 b(added)e(to)i(this)e(arra)m(y)i(app)s(ear)e(in)h(the) +g(alias)h(list;)i(un-)630 1817 y(setting)31 b(arra)m(y)g(elemen)m(ts)h +(cause)f(aliases)h(to)f(b)s(e)f(remo)m(v)m(ed)h(from)f(the)h(alias)g +(list.)150 1974 y Ft(BASH_ARGC)630 2084 y Fu(An)f(arra)m(y)h(v)-5 +b(ariable)31 b(whose)f(v)-5 b(alues)31 b(are)g(the)f(n)m(um)m(b)s(er)g +(of)g(parameters)h(in)f(eac)m(h)h(frame)g(of)630 2193 +y(the)26 b(curren)m(t)f(bash)g(execution)i(call)g(stac)m(k.)41 +b(The)25 b(n)m(um)m(b)s(er)g(of)h(parameters)g(to)g(the)g(curren)m(t) +630 2303 y(subroutine)i(\(shell)i(function)g(or)f(script)g(executed)i +(with)e Ft(.)g Fu(or)h Ft(source)p Fu(\))e(is)h(at)h(the)g(top)g(of)630 +2412 y(the)37 b(stac)m(k.)63 b(When)37 b(a)h(subroutine)e(is)h +(executed,)j(the)e(n)m(um)m(b)s(er)d(of)j(parameters)f(passed)630 +2522 y(is)g(pushed)f(on)m(to)i Ft(BASH_ARGC)p Fu(.)59 +b(The)37 b(shell)g(sets)h Ft(BASH_ARGC)c Fu(only)k(when)e(in)h +(extended)630 2632 y(debugging)23 b(mo)s(de)f(\(see)h(Section)g(4.3.2)i +([The)d(Shopt)g(Builtin],)j(page)e(62)h(for)e(a)h(description)630 +2741 y(of)31 b(the)f Ft(extdebug)e Fu(option)j(to)g(the)g +Ft(shopt)e Fu(builtin\).)150 2898 y Ft(BASH_ARGV)630 +3007 y Fu(An)24 b(arra)m(y)g(v)-5 b(ariable)25 b(con)m(taining)h(all)f +(of)f(the)h(parameters)f(in)g(the)g(curren)m(t)g(bash)g(execution)630 +3117 y(call)35 b(stac)m(k.)53 b(The)34 b(\014nal)g(parameter)g(of)g +(the)g(last)h(subroutine)e(call)i(is)f(at)h(the)f(top)h(of)f(the)630 +3226 y(stac)m(k;)28 b(the)c(\014rst)f(parameter)i(of)f(the)g(initial)i +(call)f(is)f(at)h(the)f(b)s(ottom.)39 b(When)24 b(a)g(subroutine)630 +3336 y(is)40 b(executed,)j(the)d(parameters)h(supplied)d(are)i(pushed)f +(on)m(to)i Ft(BASH_ARGV)p Fu(.)66 b(The)40 b(shell)630 +3446 y(sets)28 b Ft(BASH_ARGV)e Fu(only)i(when)f(in)h(extended)g +(debugging)g(mo)s(de)g(\(see)h(Section)f(4.3.2)i([The)630 +3555 y(Shopt)i(Builtin],)h(page)g(62)g(for)f(a)h(description)f(of)h +(the)f Ft(extdebug)e Fu(option)j(to)g(the)f Ft(shopt)630 +3665 y Fu(builtin\).)150 3821 y Ft(BASH_CMDS)630 3931 +y Fu(An)i(asso)s(ciativ)m(e)i(arra)m(y)f(v)-5 b(ariable)35 +b(whose)f(mem)m(b)s(ers)f(corresp)s(ond)g(to)i(the)f(in)m(ternal)h +(hash)630 4041 y(table)c(of)g(commands)f(as)g(main)m(tained)h(b)m(y)g +(the)f Ft(hash)f Fu(builtin)h(\(see)h(Section)g(4.1)h([Bourne)630 +4150 y(Shell)23 b(Builtins],)j(page)e(41\).)40 b(Elemen)m(ts)24 +b(added)e(to)j(this)e(arra)m(y)h(app)s(ear)e(in)i(the)f(hash)g(table;) +630 4260 y(unsetting)30 b(arra)m(y)h(elemen)m(ts)h(cause)f(commands)f +(to)h(b)s(e)f(remo)m(v)m(ed)h(from)f(the)h(hash)e(table.)150 +4416 y Ft(BASH_COMMAND)630 4526 y Fu(The)39 b(command)h(curren)m(tly)g +(b)s(eing)f(executed)i(or)e(ab)s(out)h(to)g(b)s(e)f(executed,)44 +b(unless)39 b(the)630 4635 y(shell)g(is)g(executing)g(a)g(command)g(as) +g(the)f(result)h(of)g(a)g(trap,)i(in)d(whic)m(h)g(case)i(it)f(is)g(the) +630 4745 y(command)30 b(executing)i(at)f(the)f(time)h(of)g(the)g(trap.) +150 4902 y Ft(BASH_COMPAT)630 5011 y Fu(The)i(v)-5 b(alue)34 +b(is)f(used)g(to)h(set)f(the)h(shell's)g(compatibilit)m(y)h(lev)m(el.) +51 b(See)34 b(Section)g(4.3.2)h([The)630 5121 y(Shopt)40 +b(Builtin],)45 b(page)c(62,)k(for)c(a)g(description)g(of)g(the)g(v)-5 +b(arious)41 b(compatibilit)m(y)i(lev)m(els)630 5230 y(and)31 +b(their)g(e\013ects.)45 b(The)31 b(v)-5 b(alue)31 b(ma)m(y)h(b)s(e)f(a) +h(decimal)g(n)m(um)m(b)s(er)e(\(e.g.,)j(4.2\))g(or)e(an)h(in)m(teger) +630 5340 y(\(e.g.,)39 b(42\))f(corresp)s(onding)d(to)i(the)f(desired)f +(compatibilit)m(y)k(lev)m(el.)59 b(If)36 b Ft(BASH_COMPAT)d +Fu(is)p eop end +%%Page: 71 77 +TeXDict begin 71 76 bop 150 -116 a Fu(Chapter)30 b(5:)41 +b(Shell)30 b(V)-8 b(ariables)2459 b(71)630 299 y(unset)37 +b(or)g(set)h(to)g(the)g(empt)m(y)f(string,)j(the)d(compatibilit)m(y)j +(lev)m(el)f(is)e(set)h(to)g(the)g(default)630 408 y(for)i(the)h(curren) +m(t)f(v)m(ersion.)72 b(If)40 b Ft(BASH_COMPAT)e Fu(is)i(set)h(to)h(a)e +(v)-5 b(alue)41 b(that)h(is)e(not)h(one)g(of)630 518 +y(the)f(v)-5 b(alid)40 b(compatibilit)m(y)i(lev)m(els,)i(the)c(shell)g +(prin)m(ts)f(an)h(error)f(message)i(and)f(sets)g(the)630 +628 y(compatibilit)m(y)23 b(lev)m(el)f(to)f(the)f(default)h(for)f(the)g +(curren)m(t)g(v)m(ersion.)38 b(The)20 b(v)-5 b(alid)21 +b(compatibilit)m(y)630 737 y(lev)m(els)40 b(corresp)s(ond)e(to)h(the)g +(compatibilit)m(y)i(options)e(accepted)h(b)m(y)f(the)g +Ft(shopt)e Fu(builtin)630 847 y(describ)s(ed)20 b(ab)s(o)m(v)m(e)i +(\(for)g(example,)h Fr(compat42)31 b Fu(means)21 b(that)g(4.2)i(and)d +(42)i(are)g(v)-5 b(alid)21 b(v)-5 b(alues\).)630 956 +y(The)30 b(curren)m(t)g(v)m(ersion)h(is)f(also)i(a)e(v)-5 +b(alid)31 b(v)-5 b(alue.)150 1121 y Ft(BASH_ENV)96 b +Fu(If)28 b(this)g(v)-5 b(ariable)30 b(is)e(set)h(when)f(Bash)g(is)h(in) +m(v)m(ok)m(ed)h(to)f(execute)h(a)e(shell)h(script,)g(its)g(v)-5 +b(alue)29 b(is)630 1230 y(expanded)k(and)h(used)g(as)g(the)h(name)f(of) +g(a)h(startup)f(\014le)g(to)h(read)f(b)s(efore)g(executing)i(the)630 +1340 y(script.)41 b(See)30 b(Section)h(6.2)h([Bash)f(Startup)e(Files],) +j(page)f(82.)150 1504 y Ft(BASH_EXECUTION_STRING)630 +1614 y Fu(The)f(command)g(argumen)m(t)h(to)g(the)g Ft(-c)e +Fu(in)m(v)m(o)s(cation)k(option.)150 1778 y Ft(BASH_LINENO)630 +1888 y Fu(An)62 b(arra)m(y)i(v)-5 b(ariable)63 b(whose)g(mem)m(b)s(ers) +e(are)j(the)e(line)h(n)m(um)m(b)s(ers)f(in)g(source)h(\014les)630 +1998 y(where)46 b(eac)m(h)i(corresp)s(onding)d(mem)m(b)s(er)h(of)h +Fr(FUNCNAME)53 b Fu(w)m(as)47 b(in)m(v)m(ok)m(ed.)91 +b Ft(${BASH_)630 2107 y(LINENO[$i]})39 b Fu(is)i(the)h(line)g(n)m(um)m +(b)s(er)e(in)i(the)f(source)h(\014le)g(\()p Ft(${BASH_SOURCE[$i+1]})p +Fu(\))630 2217 y(where)d Ft(${FUNCNAME[$i]})c Fu(w)m(as)k(called)i +(\(or)e Ft(${BASH_LINENO[$i-1]})34 b Fu(if)39 b(referenced)630 +2326 y(within)30 b(another)g(shell)h(function\).)41 b(Use)31 +b Ft(LINENO)d Fu(to)j(obtain)g(the)g(curren)m(t)f(line)h(n)m(um)m(b)s +(er.)150 2491 y Ft(BASH_REMATCH)630 2600 y Fu(An)43 b(arra)m(y)i(v)-5 +b(ariable)44 b(whose)g(mem)m(b)s(ers)f(are)h(assigned)g(b)m(y)f(the)h +(`)p Ft(=~)p Fu(')g(binary)f(op)s(erator)630 2710 y(to)37 +b(the)f Ft([[)g Fu(conditional)i(command)e(\(see)h(Section)g(3.2.4.2)i +([Conditional)e(Constructs],)630 2819 y(page)e(10\).)52 +b(The)33 b(elemen)m(t)j(with)d(index)g(0)i(is)f(the)g(p)s(ortion)f(of)h +(the)g(string)g(matc)m(hing)h(the)630 2929 y(en)m(tire)29 +b(regular)f(expression.)40 b(The)27 b(elemen)m(t)j(with)d(index)h +Fr(n)f Fu(is)h(the)g(p)s(ortion)g(of)g(the)g(string)630 +3039 y(matc)m(hing)j(the)g Fr(n)p Fu(th)f(paren)m(thesized)h(sub)s +(expression.)39 b(This)29 b(v)-5 b(ariable)31 b(is)g(read-only)-8 +b(.)150 3203 y Ft(BASH_SOURCE)630 3313 y Fu(An)40 b(arra)m(y)h(v)-5 +b(ariable)41 b(whose)f(mem)m(b)s(ers)g(are)h(the)g(source)f +(\014lenames)h(where)f(the)g(corre-)630 3422 y(sp)s(onding)27 +b(shell)i(function)f(names)g(in)g(the)h Ft(FUNCNAME)d +Fu(arra)m(y)j(v)-5 b(ariable)30 b(are)f(de\014ned.)38 +b(The)630 3532 y(shell)26 b(function)g Ft(${FUNCNAME[$i]})c +Fu(is)k(de\014ned)f(in)g(the)h(\014le)h Ft(${BASH_SOURCE[$i]})21 +b Fu(and)630 3641 y(called)32 b(from)d Ft(${BASH_SOURCE[$i+1]})150 +3806 y(BASH_SUBSHELL)630 3915 y Fu(Incremen)m(ted)24 +b(b)m(y)f(one)h(within)f(eac)m(h)i(subshell)d(or)i(subshell)e(en)m +(vironmen)m(t)i(when)f(the)h(shell)630 4025 y(b)s(egins)30 +b(executing)h(in)f(that)h(en)m(vironmen)m(t.)42 b(The)30 +b(initial)h(v)-5 b(alue)31 b(is)f(0.)150 4189 y Ft(BASH_VERSINFO)630 +4299 y Fu(A)36 b(readonly)g(arra)m(y)g(v)-5 b(ariable)37 +b(\(see)f(Section)h(6.7)g([Arra)m(ys],)h(page)e(89\))h(whose)f(mem)m(b) +s(ers)630 4408 y(hold)c(v)m(ersion)h(information)f(for)g(this)g +(instance)h(of)g(Bash.)46 b(The)32 b(v)-5 b(alues)32 +b(assigned)h(to)g(the)630 4518 y(arra)m(y)e(mem)m(b)s(ers)e(are)i(as)g +(follo)m(ws:)630 4682 y Ft(BASH_VERSINFO[0])1110 4792 +y Fu(The)f(ma)5 b(jor)30 b(v)m(ersion)h(n)m(um)m(b)s(er)e(\(the)i +Fr(release)5 b Fu(\).)630 4956 y Ft(BASH_VERSINFO[1])1110 +5066 y Fu(The)30 b(minor)g(v)m(ersion)h(n)m(um)m(b)s(er)e(\(the)i +Fr(v)m(ersion)p Fu(\).)630 5230 y Ft(BASH_VERSINFO[2])1110 +5340 y Fu(The)f(patc)m(h)h(lev)m(el.)p eop end +%%Page: 72 78 +TeXDict begin 72 77 bop 150 -116 a Fu(Chapter)30 b(5:)41 +b(Shell)30 b(V)-8 b(ariables)2459 b(72)630 299 y Ft(BASH_VERSINFO[3]) +1110 408 y Fu(The)30 b(build)f(v)m(ersion.)630 591 y +Ft(BASH_VERSINFO[4])1110 701 y Fu(The)h(release)i(status)e(\(e.g.,)j +Fr(b)s(eta1)7 b Fu(\).)630 883 y Ft(BASH_VERSINFO[5])1110 +993 y Fu(The)30 b(v)-5 b(alue)31 b(of)f Ft(MACHTYPE)p +Fu(.)150 1176 y Ft(BASH_VERSION)630 1285 y Fu(The)g(v)m(ersion)h(n)m +(um)m(b)s(er)e(of)h(the)h(curren)m(t)f(instance)h(of)g(Bash.)150 +1468 y Ft(BASH_XTRACEFD)630 1577 y Fu(If)f(set)h(to)h(an)e(in)m(teger)i +(corresp)s(onding)e(to)h(a)g(v)-5 b(alid)31 b(\014le)g(descriptor,)g +(Bash)g(will)g(write)g(the)630 1687 y(trace)37 b(output)f(generated)h +(when)f(`)p Ft(set)29 b(-x)p Fu(')36 b(is)g(enabled)h(to)g(that)f +(\014le)h(descriptor.)58 b(This)630 1797 y(allo)m(ws)29 +b(tracing)h(output)d(to)i(b)s(e)f(separated)g(from)g(diagnostic)h(and)f +(error)f(messages.)41 b(The)630 1906 y(\014le)31 b(descriptor)f(is)h +(closed)g(when)f Ft(BASH_XTRACEFD)d Fu(is)k(unset)f(or)g(assigned)h(a)g +(new)f(v)-5 b(alue.)630 2016 y(Unsetting)45 b Ft(BASH_XTRACEFD)40 +b Fu(or)k(assigning)g(it)g(the)g(empt)m(y)h(string)e(causes)i(the)f +(trace)630 2125 y(output)33 b(to)i(b)s(e)d(sen)m(t)j(to)f(the)g +(standard)e(error.)50 b(Note)35 b(that)g(setting)f Ft(BASH_XTRACEFD)c +Fu(to)630 2235 y(2)39 b(\(the)h(standard)e(error)g(\014le)h +(descriptor\))h(and)e(then)h(unsetting)g(it)g(will)g(result)g(in)g(the) +630 2345 y(standard)30 b(error)g(b)s(eing)f(closed.)150 +2527 y Ft(CHILD_MAX)630 2637 y Fu(Set)35 b(the)h(n)m(um)m(b)s(er)e(of)h +(exited)h(c)m(hild)g(status)f(v)-5 b(alues)36 b(for)f(the)g(shell)g(to) +h(remem)m(b)s(er.)55 b(Bash)630 2746 y(will)37 b(not)g(allo)m(w)i(this) +e(v)-5 b(alue)37 b(to)h(b)s(e)e(decreased)i(b)s(elo)m(w)f(a)g +Fm(posix)p Fu(-mandated)f(minim)m(um,)630 2856 y(and)30 +b(there)g(is)g(a)h(maxim)m(um)f(v)-5 b(alue)30 b(\(curren)m(tly)h +(8192\))h(that)f(this)f(ma)m(y)g(not)h(exceed.)41 b(The)630 +2966 y(minim)m(um)30 b(v)-5 b(alue)30 b(is)h(system-dep)s(enden)m(t.) +150 3148 y Ft(COLUMNS)144 b Fu(Used)32 b(b)m(y)f(the)h +Ft(select)e Fu(command)h(to)i(determine)f(the)f(terminal)i(width)d +(when)h(prin)m(ting)630 3258 y(selection)39 b(lists.)63 +b(Automatically)41 b(set)d(if)f(the)h Ft(checkwinsize)d +Fu(option)j(is)f(enabled)h(\(see)630 3367 y(Section)44 +b(4.3.2)h([The)e(Shopt)g(Builtin],)k(page)d(62\),)k(or)43 +b(in)g(an)g(in)m(teractiv)m(e)j(shell)e(up)s(on)630 3477 +y(receipt)31 b(of)g(a)g Ft(SIGWINCH)p Fu(.)150 3660 y +Ft(COMP_CWORD)630 3769 y Fu(An)38 b(index)g(in)m(to)h +Ft(${COMP_WORDS})c Fu(of)k(the)g(w)m(ord)f(con)m(taining)i(the)e +(curren)m(t)g(cursor)g(p)s(o-)630 3879 y(sition.)72 b(This)40 +b(v)-5 b(ariable)41 b(is)f(a)m(v)-5 b(ailable)43 b(only)e(in)f(shell)h +(functions)f(in)m(v)m(ok)m(ed)i(b)m(y)e(the)h(pro-)630 +3988 y(grammable)36 b(completion)g(facilities)i(\(see)e(Section)g(8.6)g +([Programmable)g(Completion],)630 4098 y(page)31 b(124\).)150 +4281 y Ft(COMP_LINE)630 4390 y Fu(The)38 b(curren)m(t)h(command)f +(line.)66 b(This)37 b(v)-5 b(ariable)40 b(is)f(a)m(v)-5 +b(ailable)41 b(only)d(in)h(shell)f(functions)630 4500 +y(and)25 b(external)h(commands)f(in)m(v)m(ok)m(ed)h(b)m(y)f(the)h +(programmable)f(completion)i(facilities)g(\(see)630 4609 +y(Section)k(8.6)h([Programmable)f(Completion],)g(page)g(124\).)150 +4792 y Ft(COMP_POINT)630 4902 y Fu(The)25 b(index)g(of)h(the)g(curren)m +(t)f(cursor)g(p)s(osition)h(relativ)m(e)i(to)e(the)g(b)s(eginning)f(of) +g(the)h(curren)m(t)630 5011 y(command.)40 b(If)27 b(the)h(curren)m(t)g +(cursor)g(p)s(osition)g(is)g(at)g(the)g(end)g(of)g(the)g(curren)m(t)g +(command,)630 5121 y(the)i(v)-5 b(alue)30 b(of)g(this)g(v)-5 +b(ariable)31 b(is)f(equal)g(to)h Ft(${#COMP_LINE})p Fu(.)37 +b(This)29 b(v)-5 b(ariable)31 b(is)f(a)m(v)-5 b(ailable)630 +5230 y(only)36 b(in)f(shell)h(functions)f(and)g(external)h(commands)g +(in)m(v)m(ok)m(ed)h(b)m(y)e(the)h(programmable)630 5340 +y(completion)c(facilities)g(\(see)g(Section)f(8.6)g([Programmable)g +(Completion],)h(page)f(124\).)p eop end +%%Page: 73 79 +TeXDict begin 73 78 bop 150 -116 a Fu(Chapter)30 b(5:)41 +b(Shell)30 b(V)-8 b(ariables)2459 b(73)150 299 y Ft(COMP_TYPE)630 +408 y Fu(Set)27 b(to)h(an)f(in)m(teger)h(v)-5 b(alue)28 +b(corresp)s(onding)e(to)h(the)h(t)m(yp)s(e)f(of)g(completion)h +(attempted)g(that)630 518 y(caused)e(a)h(completion)h(function)e(to)h +(b)s(e)f(called:)40 b Fr(T)-8 b(AB)p Fu(,)27 b(for)g(normal)f +(completion,)j(`)p Ft(?)p Fu(',)e(for)630 628 y(listing)35 +b(completions)h(after)f(successiv)m(e)g(tabs,)h(`)p Ft(!)p +Fu(',)g(for)e(listing)h(alternativ)m(es)i(on)d(partial)630 +737 y(w)m(ord)22 b(completion,)k(`)p Ft(@)p Fu(',)f(to)e(list)g +(completions)h(if)f(the)g(w)m(ord)f(is)h(not)g(unmo)s(di\014ed,)f(or)h +(`)p Ft(\045)p Fu(',)h(for)630 847 y(men)m(u)i(completion.)41 +b(This)25 b(v)-5 b(ariable)27 b(is)g(a)m(v)-5 b(ailable)28 +b(only)f(in)f(shell)g(functions)g(and)g(external)630 +956 y(commands)32 b(in)m(v)m(ok)m(ed)i(b)m(y)e(the)g(programmable)h +(completion)g(facilities)i(\(see)e(Section)g(8.6)630 +1066 y([Programmable)e(Completion],)h(page)f(124\).)150 +1241 y Ft(COMP_KEY)96 b Fu(The)29 b(k)m(ey)i(\(or)g(\014nal)e(k)m(ey)i +(of)f(a)g(k)m(ey)h(sequence\))g(used)e(to)i(in)m(v)m(ok)m(e)h(the)e +(curren)m(t)g(completion)630 1351 y(function.)150 1526 +y Ft(COMP_WORDBREAKS)630 1636 y Fu(The)f(set)i(of)e(c)m(haracters)j +(that)e(the)g(Readline)g(library)g(treats)g(as)g(w)m(ord)g(separators)g +(when)630 1745 y(p)s(erforming)i(w)m(ord)h(completion.)51 +b(If)33 b Ft(COMP_WORDBREAKS)c Fu(is)34 b(unset,)g(it)f(loses)i(its)e +(sp)s(ecial)630 1855 y(prop)s(erties,)d(ev)m(en)h(if)f(it)h(is)g +(subsequen)m(tly)f(reset.)150 2030 y Ft(COMP_WORDS)630 +2140 y Fu(An)36 b(arra)m(y)g(v)-5 b(ariable)37 b(consisting)g(of)f(the) +g(individual)f(w)m(ords)h(in)f(the)h(curren)m(t)g(command)630 +2250 y(line.)94 b(The)47 b(line)i(is)f(split)g(in)m(to)h(w)m(ords)e(as) +h(Readline)h(w)m(ould)f(split)g(it,)53 b(using)47 b Ft(COMP_)630 +2359 y(WORDBREAKS)34 b Fu(as)i(describ)s(ed)g(ab)s(o)m(v)m(e.)60 +b(This)36 b(v)-5 b(ariable)37 b(is)f(a)m(v)-5 b(ailable)39 +b(only)e(in)f(shell)h(func-)630 2469 y(tions)32 b(in)m(v)m(ok)m(ed)i(b) +m(y)d(the)i(programmable)f(completion)h(facilities)h(\(see)f(Section)g +(8.6)g([Pro-)630 2578 y(grammable)e(Completion],)g(page)g(124\).)150 +2754 y Ft(COMPREPLY)630 2863 y Fu(An)37 b(arra)m(y)h(v)-5 +b(ariable)38 b(from)f(whic)m(h)g(Bash)g(reads)g(the)h(p)s(ossible)e +(completions)j(generated)630 2973 y(b)m(y)33 b(a)g(shell)h(function)f +(in)m(v)m(ok)m(ed)h(b)m(y)f(the)g(programmable)h(completion)g(facilit)m +(y)h(\(see)f(Sec-)630 3082 y(tion)g(8.6)g([Programmable)g(Completion],) +h(page)f(124\).)51 b(Eac)m(h)34 b(arra)m(y)g(elemen)m(t)h(con)m(tains) +630 3192 y(one)c(p)s(ossible)f(completion.)150 3367 y +Ft(COPROC)192 b Fu(An)27 b(arra)m(y)g(v)-5 b(ariable)28 +b(created)g(to)f(hold)g(the)g(\014le)g(descriptors)g(for)g(output)f +(from)h(and)f(input)630 3477 y(to)31 b(an)f(unnamed)f(copro)s(cess)i +(\(see)g(Section)h(3.2.5)g([Copro)s(cesses],)f(page)g(15\).)150 +3652 y Ft(DIRSTACK)96 b Fu(An)26 b(arra)m(y)h(v)-5 b(ariable)28 +b(con)m(taining)g(the)f(curren)m(t)f(con)m(ten)m(ts)j(of)e(the)f +(directory)i(stac)m(k.)41 b(Direc-)630 3762 y(tories)33 +b(app)s(ear)f(in)g(the)h(stac)m(k)h(in)e(the)h(order)f(they)h(are)g +(displa)m(y)m(ed)g(b)m(y)f(the)h Ft(dirs)e Fu(builtin.)630 +3871 y(Assigning)f(to)h(mem)m(b)s(ers)f(of)g(this)g(arra)m(y)g(v)-5 +b(ariable)31 b(ma)m(y)g(b)s(e)e(used)h(to)h(mo)s(dify)e(directories)630 +3981 y(already)41 b(in)f(the)h(stac)m(k,)k(but)40 b(the)h +Ft(pushd)e Fu(and)h Ft(popd)f Fu(builtins)h(m)m(ust)h(b)s(e)e(used)h +(to)i(add)630 4091 y(and)37 b(remo)m(v)m(e)h(directories.)63 +b(Assignmen)m(t)37 b(to)h(this)f(v)-5 b(ariable)38 b(will)g(not)f(c)m +(hange)i(the)e(cur-)630 4200 y(ren)m(t)c(directory)-8 +b(.)47 b(If)32 b Ft(DIRSTACK)e Fu(is)i(unset,)g(it)h(loses)g(its)g(sp)s +(ecial)g(prop)s(erties,)f(ev)m(en)h(if)f(it)h(is)630 +4310 y(subsequen)m(tly)d(reset.)150 4485 y Ft(EMACS)240 +b Fu(If)31 b(Bash)h(\014nds)d(this)j(v)-5 b(ariable)32 +b(in)f(the)h(en)m(vironmen)m(t)g(when)e(the)i(shell)f(starts)h(with)f +(v)-5 b(alue)630 4595 y(`)p Ft(t)p Fu(',)36 b(it)f(assumes)f(that)h +(the)g(shell)f(is)h(running)e(in)h(an)g(Emacs)h(shell)g(bu\013er)e(and) +h(disables)630 4704 y(line)d(editing.)150 4880 y Ft(ENV)336 +b Fu(Similar)35 b(to)g Ft(BASH_ENV)p Fu(;)h(used)e(when)g(the)h(shell)g +(is)g(in)m(v)m(ok)m(ed)h(in)e Fm(posix)h Fu(Mo)s(de)g(\(see)g(Sec-)630 +4989 y(tion)c(6.11)h([Bash)f(POSIX)e(Mo)s(de],)i(page)g(94\).)150 +5165 y Ft(EUID)288 b Fu(The)30 b(n)m(umeric)g(e\013ectiv)m(e)j(user)d +(id)g(of)g(the)h(curren)m(t)f(user.)40 b(This)30 b(v)-5 +b(ariable)31 b(is)f(readonly)-8 b(.)150 5340 y Ft(FCEDIT)192 +b Fu(The)30 b(editor)h(used)e(as)i(a)g(default)f(b)m(y)h(the)f +Ft(-e)g Fu(option)h(to)g(the)f Ft(fc)g Fu(builtin)g(command.)p +eop end +%%Page: 74 80 +TeXDict begin 74 79 bop 150 -116 a Fu(Chapter)30 b(5:)41 +b(Shell)30 b(V)-8 b(ariables)2459 b(74)150 299 y Ft(FIGNORE)144 +b Fu(A)35 b(colon-separated)i(list)f(of)g(su\016xes)e(to)i(ignore)g +(when)e(p)s(erforming)g(\014lename)i(comple-)630 408 +y(tion.)k(A)27 b(\014lename)g(whose)f(su\016x)g(matc)m(hes)i(one)f(of)g +(the)g(en)m(tries)g(in)g Ft(FIGNORE)d Fu(is)j(excluded)630 +518 y(from)j(the)g(list)h(of)g(matc)m(hed)g(\014lenames.)41 +b(A)30 b(sample)h(v)-5 b(alue)31 b(is)f(`)p Ft(.o:~)p +Fu(')150 671 y Ft(FUNCNAME)96 b Fu(An)35 b(arra)m(y)i(v)-5 +b(ariable)36 b(con)m(taining)h(the)f(names)g(of)g(all)g(shell)g +(functions)g(curren)m(tly)f(in)h(the)630 781 y(execution)g(call)h(stac) +m(k.)57 b(The)34 b(elemen)m(t)j(with)e(index)g(0)h(is)f(the)g(name)h +(of)f(an)m(y)h(curren)m(tly-)630 891 y(executing)f(shell)f(function.)51 +b(The)34 b(b)s(ottom-most)h(elemen)m(t)g(\(the)g(one)f(with)g(the)g +(highest)630 1000 y(index\))e(is)h Ft("main")p Fu(.)44 +b(This)32 b(v)-5 b(ariable)33 b(exists)g(only)g(when)e(a)i(shell)f +(function)g(is)g(executing.)630 1110 y(Assignmen)m(ts)23 +b(to)h Ft(FUNCNAME)c Fu(ha)m(v)m(e)k(no)f(e\013ect)h(and)e(return)g(an) +g(error)g(status.)39 b(If)22 b Ft(FUNCNAME)630 1219 y +Fu(is)30 b(unset,)h(it)g(loses)g(its)f(sp)s(ecial)h(prop)s(erties,)f +(ev)m(en)h(if)g(it)g(is)f(subsequen)m(tly)g(reset.)630 +1351 y(This)h(v)-5 b(ariable)32 b(can)f(b)s(e)g(used)g(with)g +Ft(BASH_LINENO)d Fu(and)j Ft(BASH_SOURCE)p Fu(.)40 b(Eac)m(h)32 +b(elemen)m(t)630 1461 y(of)g Ft(FUNCNAME)d Fu(has)j(corresp)s(onding)e +(elemen)m(ts)j(in)f Ft(BASH_LINENO)c Fu(and)k Ft(BASH_SOURCE)c +Fu(to)630 1570 y(describ)s(e)39 b(the)h(call)h(stac)m(k.)70 +b(F)-8 b(or)41 b(instance,)i Ft(${FUNCNAME[$i]})35 b +Fu(w)m(as)41 b(called)f(from)g(the)630 1680 y(\014le)27 +b Ft(${BASH_SOURCE[$i+1]})21 b Fu(at)27 b(line)h(n)m(um)m(b)s(er)d +Ft(${BASH_LINENO[$i]})p Fu(.)34 b(The)27 b Ft(caller)630 +1789 y Fu(builtin)j(displa)m(ys)g(the)h(curren)m(t)f(call)i(stac)m(k)g +(using)d(this)i(information.)150 1943 y Ft(FUNCNEST)96 +b Fu(If)34 b(set)i(to)f(a)h(n)m(umeric)e(v)-5 b(alue)36 +b(greater)g(than)e(0,)j(de\014nes)d(a)h(maxim)m(um)g(function)g +(nesting)630 2052 y(lev)m(el.)42 b(F)-8 b(unction)29 +b(in)m(v)m(o)s(cations)h(that)f(exceed)h(this)e(nesting)h(lev)m(el)h +(will)f(cause)g(the)f(curren)m(t)630 2162 y(command)i(to)h(ab)s(ort.) +150 2315 y Ft(GLOBIGNORE)630 2425 y Fu(A)38 b(colon-separated)i(list)f +(of)f(patterns)g(de\014ning)f(the)h(set)g(of)h(\014lenames)f(to)g(b)s +(e)g(ignored)630 2534 y(b)m(y)31 b(\014lename)g(expansion.)43 +b(If)31 b(a)h(\014lename)f(matc)m(hed)h(b)m(y)f(a)g(\014lename)h +(expansion)f(pattern)630 2644 y(also)i(matc)m(hes)g(one)f(of)g(the)g +(patterns)g(in)f Ft(GLOBIGNORE)p Fu(,)f(it)i(is)g(remo)m(v)m(ed)h(from) +e(the)h(list)h(of)630 2754 y(matc)m(hes.)150 2907 y Ft(GROUPS)192 +b Fu(An)36 b(arra)m(y)g(v)-5 b(ariable)37 b(con)m(taining)g(the)f(list) +h(of)f(groups)g(of)g(whic)m(h)f(the)i(curren)m(t)e(user)h(is)g(a)630 +3017 y(mem)m(b)s(er.)47 b(Assignmen)m(ts)33 b(to)g Ft(GROUPS)e +Fu(ha)m(v)m(e)j(no)f(e\013ect)h(and)e(return)g(an)g(error)g(status.)48 +b(If)630 3126 y Ft(GROUPS)29 b Fu(is)h(unset,)g(it)h(loses)g(its)g(sp)s +(ecial)g(prop)s(erties,)f(ev)m(en)h(if)f(it)h(is)g(subsequen)m(tly)f +(reset.)150 3280 y Ft(histchars)630 3389 y Fu(Up)c(to)g(three)g(c)m +(haracters)i(whic)m(h)d(con)m(trol)j(history)d(expansion,)i(quic)m(k)g +(substitution,)g(and)630 3499 y(tok)m(enization)k(\(see)f(Section)f +(9.3)h([History)f(In)m(teraction],)i(page)f(135\).)41 +b(The)29 b(\014rst)e(c)m(harac-)630 3608 y(ter)j(is)f(the)g +Fr(history)g(expansion)g Fu(c)m(haracter,)j(that)e(is,)f(the)h(c)m +(haracter)h(whic)m(h)d(signi\014es)i(the)630 3718 y(start)25 +b(of)f(a)h(history)f(expansion,)i(normally)e(`)p Ft(!)p +Fu('.)39 b(The)24 b(second)g(c)m(haracter)i(is)e(the)g(c)m(haracter)630 +3828 y(whic)m(h)36 b(signi\014es)g(`quic)m(k)h(substitution')f(when)f +(seen)h(as)g(the)g(\014rst)f(c)m(haracter)j(on)e(a)g(line,)630 +3937 y(normally)27 b(`)p Ft(^)p Fu('.)39 b(The)26 b(optional)i(third)d +(c)m(haracter)j(is)e(the)h(c)m(haracter)h(whic)m(h)e(indicates)h(that) +630 4047 y(the)34 b(remainder)f(of)h(the)g(line)g(is)f(a)h(commen)m(t)h +(when)e(found)f(as)i(the)g(\014rst)f(c)m(haracter)i(of)f(a)630 +4156 y(w)m(ord,)i(usually)f(`)p Ft(#)p Fu('.)55 b(The)34 +b(history)h(commen)m(t)h(c)m(haracter)h(causes)e(history)g +(substitution)630 4266 y(to)27 b(b)s(e)f(skipp)s(ed)f(for)i(the)f +(remaining)h(w)m(ords)f(on)h(the)f(line.)40 b(It)27 b(do)s(es)f(not)h +(necessarily)g(cause)630 4376 y(the)k(shell)f(parser)g(to)h(treat)g +(the)g(rest)g(of)f(the)h(line)f(as)h(a)g(commen)m(t.)150 +4529 y Ft(HISTCMD)144 b Fu(The)35 b(history)h(n)m(um)m(b)s(er,)g(or)f +(index)g(in)h(the)g(history)f(list,)j(of)e(the)g(curren)m(t)f(command.) +56 b(If)630 4639 y Ft(HISTCMD)28 b Fu(is)h(unset,)h(it)g(loses)h(its)f +(sp)s(ecial)g(prop)s(erties,)g(ev)m(en)g(if)g(it)g(is)g(subsequen)m +(tly)f(reset.)150 4792 y Ft(HISTCONTROL)630 4902 y Fu(A)40 +b(colon-separated)i(list)f(of)f(v)-5 b(alues)40 b(con)m(trolling)i(ho)m +(w)e(commands)g(are)h(sa)m(v)m(ed)g(on)f(the)630 5011 +y(history)29 b(list.)41 b(If)28 b(the)h(list)h(of)f(v)-5 +b(alues)29 b(includes)f(`)p Ft(ignorespace)p Fu(',)f(lines)i(whic)m(h)g +(b)s(egin)f(with)630 5121 y(a)39 b(space)g(c)m(haracter)i(are)e(not)g +(sa)m(v)m(ed)g(in)g(the)g(history)f(list.)66 b(A)39 b(v)-5 +b(alue)39 b(of)g(`)p Ft(ignoredups)p Fu(')630 5230 y(causes)34 +b(lines)h(whic)m(h)f(matc)m(h)h(the)f(previous)f(history)h(en)m(try)h +(to)g(not)f(b)s(e)f(sa)m(v)m(ed.)53 b(A)34 b(v)-5 b(alue)630 +5340 y(of)32 b(`)p Ft(ignoreboth)p Fu(')d(is)j(shorthand)e(for)i(`)p +Ft(ignorespace)p Fu(')d(and)i(`)p Ft(ignoredups)p Fu('.)42 +b(A)32 b(v)-5 b(alue)32 b(of)p eop end +%%Page: 75 81 +TeXDict begin 75 80 bop 150 -116 a Fu(Chapter)30 b(5:)41 +b(Shell)30 b(V)-8 b(ariables)2459 b(75)630 299 y(`)p +Ft(erasedups)p Fu(')31 b(causes)i(all)h(previous)f(lines)g(matc)m(hing) +h(the)f(curren)m(t)g(line)g(to)h(b)s(e)e(remo)m(v)m(ed)630 +408 y(from)42 b(the)h(history)f(list)i(b)s(efore)e(that)h(line)g(is)g +(sa)m(v)m(ed.)78 b(An)m(y)43 b(v)-5 b(alue)43 b(not)g(in)f(the)h(ab)s +(o)m(v)m(e)630 518 y(list)35 b(is)g(ignored.)53 b(If)34 +b Ft(HISTCONTROL)e Fu(is)i(unset,)i(or)e(do)s(es)h(not)g(include)f(a)h +(v)-5 b(alid)35 b(v)-5 b(alue,)36 b(all)630 628 y(lines)30 +b(read)g(b)m(y)g(the)g(shell)g(parser)g(are)g(sa)m(v)m(ed)h(on)f(the)g +(history)g(list,)h(sub)5 b(ject)30 b(to)g(the)g(v)-5 +b(alue)630 737 y(of)42 b Ft(HISTIGNORE)p Fu(.)73 b(The)42 +b(second)g(and)g(subsequen)m(t)f(lines)h(of)h(a)f(m)m(ulti-line)h(comp) +s(ound)630 847 y(command)33 b(are)h(not)g(tested,)i(and)d(are)h(added)f +(to)h(the)g(history)g(regardless)g(of)g(the)f(v)-5 b(alue)630 +956 y(of)31 b Ft(HISTCONTROL)p Fu(.)150 1117 y Ft(HISTFILE)96 +b Fu(The)27 b(name)h(of)g(the)g(\014le)g(to)h(whic)m(h)f(the)g(command) +f(history)h(is)g(sa)m(v)m(ed.)41 b(The)27 b(default)h(v)-5 +b(alue)630 1226 y(is)30 b Ft(~/.bash_history)p Fu(.)150 +1386 y Ft(HISTFILESIZE)630 1496 y Fu(The)c(maxim)m(um)f(n)m(um)m(b)s +(er)g(of)h(lines)h(con)m(tained)g(in)f(the)g(history)g(\014le.)39 +b(When)26 b(this)g(v)-5 b(ariable)630 1606 y(is)25 b(assigned)h(a)g(v) +-5 b(alue,)27 b(the)f(history)f(\014le)h(is)f(truncated,)i(if)e +(necessary)-8 b(,)28 b(to)e(con)m(tain)g(no)g(more)630 +1715 y(than)37 b(that)h(n)m(um)m(b)s(er)d(of)j(lines)f(b)m(y)g(remo)m +(ving)h(the)f(oldest)h(en)m(tries.)62 b(The)37 b(history)g(\014le)g(is) +630 1825 y(also)i(truncated)f(to)h(this)e(size)i(after)g(writing)f(it)g +(when)f(a)h(shell)h(exits.)64 b(If)37 b(the)h(v)-5 b(alue)39 +b(is)630 1934 y(0,)g(the)e(history)f(\014le)h(is)g(truncated)f(to)i +(zero)f(size.)60 b(Non-n)m(umeric)37 b(v)-5 b(alues)37 +b(and)f(n)m(umeric)630 2044 y(v)-5 b(alues)31 b(less)f(than)g(zero)h +(inhibit)f(truncation.)41 b(The)29 b(shell)i(sets)f(the)h(default)f(v) +-5 b(alue)31 b(to)g(the)630 2153 y(v)-5 b(alue)31 b(of)f +Ft(HISTSIZE)f Fu(after)h(reading)h(an)m(y)g(startup)f(\014les.)150 +2314 y Ft(HISTIGNORE)630 2423 y Fu(A)j(colon-separated)h(list)f(of)g +(patterns)f(used)g(to)h(decide)g(whic)m(h)f(command)g(lines)h(should) +630 2533 y(b)s(e)f(sa)m(v)m(ed)h(on)g(the)f(history)h(list.)47 +b(Eac)m(h)33 b(pattern)g(is)f(anc)m(hored)h(at)g(the)f(b)s(eginning)g +(of)h(the)630 2642 y(line)43 b(and)e(m)m(ust)h(matc)m(h)h(the)g +(complete)h(line)e(\(no)h(implicit)g(`)p Ft(*)p Fu(')f(is)g(app)s +(ended\).)75 b(Eac)m(h)630 2752 y(pattern)42 b(is)g(tested)g(against)h +(the)f(line)g(after)g(the)g(c)m(hec)m(ks)h(sp)s(eci\014ed)e(b)m(y)h +Ft(HISTCONTROL)630 2862 y Fu(are)37 b(applied.)59 b(In)36 +b(addition)h(to)g(the)g(normal)g(shell)f(pattern)h(matc)m(hing)h(c)m +(haracters,)i(`)p Ft(&)p Fu(')630 2971 y(matc)m(hes)d(the)f(previous)g +(history)g(line.)57 b(`)p Ft(&)p Fu(')36 b(ma)m(y)h(b)s(e)e(escap)s(ed) +h(using)g(a)g(bac)m(kslash;)k(the)630 3081 y(bac)m(kslash)34 +b(is)g(remo)m(v)m(ed)h(b)s(efore)e(attempting)i(a)g(matc)m(h.)51 +b(The)34 b(second)f(and)h(subsequen)m(t)630 3190 y(lines)e(of)h(a)g(m)m +(ulti-line)g(comp)s(ound)e(command)h(are)h(not)f(tested,)i(and)e(are)g +(added)g(to)h(the)630 3300 y(history)d(regardless)h(of)g(the)f(v)-5 +b(alue)31 b(of)g Ft(HISTIGNORE)p Fu(.)630 3435 y Ft(HISTIGNORE)20 +b Fu(subsumes)g(the)j(function)f(of)h Ft(HISTCONTROL)p +Fu(.)35 b(A)23 b(pattern)f(of)h(`)p Ft(&)p Fu(')g(is)f(iden)m(tical)630 +3544 y(to)k Ft(ignoredups)p Fu(,)e(and)h(a)h(pattern)g(of)f(`)p +Ft([)31 b(]*)p Fu(')25 b(is)h(iden)m(tical)h(to)f Ft(ignorespace)p +Fu(.)36 b(Com)m(bining)630 3654 y(these)30 b(t)m(w)m(o)h(patterns,)f +(separating)g(them)g(with)f(a)h(colon,)h(pro)m(vides)e(the)h +(functionalit)m(y)h(of)630 3764 y Ft(ignoreboth)p Fu(.)150 +3924 y Ft(HISTSIZE)96 b Fu(The)37 b(maxim)m(um)g(n)m(um)m(b)s(er)e(of)j +(commands)f(to)g(remem)m(b)s(er)g(on)g(the)g(history)g(list.)62 +b(If)37 b(the)630 4033 y(v)-5 b(alue)26 b(is)g(0,)i(commands)d(are)h +(not)h(sa)m(v)m(ed)g(in)e(the)h(history)g(list.)40 b(Numeric)26 +b(v)-5 b(alues)26 b(less)g(than)630 4143 y(zero)i(result)e(in)h(ev)m +(ery)g(command)g(b)s(eing)f(sa)m(v)m(ed)i(on)f(the)g(history)f(list)i +(\(there)f(is)g(no)g(limit\).)630 4253 y(The)j(shell)g(sets)h(the)g +(default)f(v)-5 b(alue)31 b(to)g(500)h(after)f(reading)f(an)m(y)h +(startup)f(\014les.)150 4413 y Ft(HISTTIMEFORMAT)630 +4522 y Fu(If)44 b(this)g(v)-5 b(ariable)45 b(is)f(set)g(and)g(not)g(n)m +(ull,)k(its)d(v)-5 b(alue)44 b(is)g(used)g(as)g(a)h(format)f(string)g +(for)630 4632 y Fr(strftime)c Fu(to)35 b(prin)m(t)f(the)h(time)g(stamp) +f(asso)s(ciated)i(with)f(eac)m(h)g(history)g(en)m(try)f(displa)m(y)m +(ed)630 4741 y(b)m(y)g(the)f Ft(history)f Fu(builtin.)50 +b(If)33 b(this)h(v)-5 b(ariable)34 b(is)g(set,)h(time)f(stamps)g(are)g +(written)f(to)i(the)630 4851 y(history)26 b(\014le)g(so)g(they)g(ma)m +(y)h(b)s(e)e(preserv)m(ed)g(across)i(shell)f(sessions.)39 +b(This)25 b(uses)h(the)g(history)630 4961 y(commen)m(t)31 +b(c)m(haracter)h(to)f(distinguish)f(timestamps)h(from)f(other)g +(history)h(lines.)150 5121 y Ft(HOSTFILE)96 b Fu(Con)m(tains)33 +b(the)g(name)f(of)h(a)g(\014le)f(in)g(the)h(same)g(format)g(as)f +Ft(/etc/hosts)e Fu(that)j(should)f(b)s(e)630 5230 y(read)21 +b(when)g(the)g(shell)h(needs)f(to)h(complete)h(a)e(hostname.)38 +b(The)21 b(list)h(of)g(p)s(ossible)f(hostname)630 5340 +y(completions)27 b(ma)m(y)f(b)s(e)f(c)m(hanged)h(while)f(the)h(shell)g +(is)f(running;)h(the)g(next)f(time)i(hostname)p eop end +%%Page: 76 82 +TeXDict begin 76 81 bop 150 -116 a Fu(Chapter)30 b(5:)41 +b(Shell)30 b(V)-8 b(ariables)2459 b(76)630 299 y(completion)33 +b(is)g(attempted)g(after)g(the)f(v)-5 b(alue)33 b(is)f(c)m(hanged,)i +(Bash)e(adds)f(the)i(con)m(ten)m(ts)h(of)630 408 y(the)h(new)f(\014le)g +(to)h(the)g(existing)h(list.)53 b(If)34 b Ft(HOSTFILE)e +Fu(is)j(set,)h(but)e(has)g(no)h(v)-5 b(alue,)36 b(or)e(do)s(es)630 +518 y(not)d(name)f(a)h(readable)g(\014le,)g(Bash)f(attempts)i(to)f +(read)f Ft(/etc/hosts)e Fu(to)j(obtain)g(the)f(list)630 +628 y(of)h(p)s(ossible)f(hostname)h(completions.)43 b(When)31 +b Ft(HOSTFILE)d Fu(is)j(unset,)f(the)h(hostname)g(list)630 +737 y(is)f(cleared.)150 906 y Ft(HOSTNAME)96 b Fu(The)30 +b(name)g(of)h(the)f(curren)m(t)h(host.)150 1074 y Ft(HOSTTYPE)96 +b Fu(A)30 b(string)h(describing)f(the)g(mac)m(hine)h(Bash)g(is)f +(running)f(on.)150 1243 y Ft(IGNOREEOF)630 1353 y Fu(Con)m(trols)e(the) +h(action)g(of)f(the)g(shell)g(on)g(receipt)h(of)f(an)g +Ft(EOF)f Fu(c)m(haracter)i(as)g(the)f(sole)h(input.)630 +1462 y(If)i(set,)i(the)f(v)-5 b(alue)32 b(denotes)f(the)g(n)m(um)m(b)s +(er)f(of)h(consecutiv)m(e)i Ft(EOF)d Fu(c)m(haracters)i(that)f(can)h(b) +s(e)630 1572 y(read)40 b(as)f(the)h(\014rst)f(c)m(haracter)i(on)f(an)f +(input)g(line)h(b)s(efore)f(the)h(shell)g(will)g(exit.)70 +b(If)39 b(the)630 1681 y(v)-5 b(ariable)38 b(exists)f(but)f(do)s(es)g +(not)h(ha)m(v)m(e)h(a)g(n)m(umeric)e(v)-5 b(alue)37 b(\(or)h(has)e(no)h +(v)-5 b(alue\))37 b(then)g(the)630 1791 y(default)31 +b(is)g(10.)43 b(If)30 b(the)h(v)-5 b(ariable)31 b(do)s(es)g(not)g +(exist,)h(then)e Ft(EOF)g Fu(signi\014es)h(the)g(end)f(of)h(input)630 +1901 y(to)g(the)g(shell.)41 b(This)29 b(is)i(only)f(in)g(e\013ect)i +(for)e(in)m(teractiv)m(e)j(shells.)150 2069 y Ft(INPUTRC)144 +b Fu(The)68 b(name)h(of)f(the)h(Readline)g(initialization)j(\014le,)78 +b(o)m(v)m(erriding)69 b(the)g(default)g(of)630 2179 y +Ft(~/.inputrc)p Fu(.)150 2347 y Ft(LANG)288 b Fu(Used)28 +b(to)h(determine)f(the)g(lo)s(cale)h(category)h(for)e(an)m(y)h +(category)h(not)e(sp)s(eci\014cally)g(selected)630 2457 +y(with)i(a)h(v)-5 b(ariable)31 b(starting)g(with)f Ft(LC_)p +Fu(.)150 2626 y Ft(LC_ALL)192 b Fu(This)28 b(v)-5 b(ariable)29 +b(o)m(v)m(errides)h(the)f(v)-5 b(alue)29 b(of)g Ft(LANG)f +Fu(and)g(an)m(y)h(other)g Ft(LC_)f Fu(v)-5 b(ariable)29 +b(sp)s(ecifying)630 2735 y(a)i(lo)s(cale)h(category)-8 +b(.)150 2904 y Ft(LC_COLLATE)630 3013 y Fu(This)37 b(v)-5 +b(ariable)38 b(determines)g(the)g(collation)i(order)d(used)g(when)f +(sorting)i(the)g(results)g(of)630 3123 y(\014lename)e(expansion,)i(and) +e(determines)g(the)h(b)s(eha)m(vior)f(of)g(range)h(expressions,)h +(equiv-)630 3232 y(alence)e(classes,)h(and)e(collating)i(sequences)e +(within)f(\014lename)h(expansion)g(and)f(pattern)630 +3342 y(matc)m(hing)d(\(see)h(Section)f(3.5.8)h([Filename)g(Expansion],) +e(page)h(30\).)150 3511 y Ft(LC_CTYPE)96 b Fu(This)36 +b(v)-5 b(ariable)37 b(determines)f(the)h(in)m(terpretation)h(of)f(c)m +(haracters)h(and)e(the)g(b)s(eha)m(vior)h(of)630 3620 +y(c)m(haracter)46 b(classes)g(within)e(\014lename)h(expansion)g(and)f +(pattern)h(matc)m(hing)h(\(see)f(Sec-)630 3730 y(tion)31 +b(3.5.8)h([Filename)g(Expansion],)e(page)h(30\).)150 +3898 y Ft(LC_MESSAGES)630 4008 y Fu(This)25 b(v)-5 b(ariable)27 +b(determines)f(the)g(lo)s(cale)i(used)d(to)i(translate)g(double-quoted) +f(strings)g(pre-)630 4118 y(ceded)31 b(b)m(y)f(a)h(`)p +Ft($)p Fu(')f(\(see)h(Section)h(3.1.2.5)g([Lo)s(cale)g(T)-8 +b(ranslation],)32 b(page)f(7\).)150 4286 y Ft(LC_NUMERIC)630 +4396 y Fu(This)f(v)-5 b(ariable)31 b(determines)f(the)h(lo)s(cale)h +(category)g(used)e(for)g(n)m(um)m(b)s(er)f(formatting.)150 +4564 y Ft(LINENO)192 b Fu(The)30 b(line)h(n)m(um)m(b)s(er)e(in)h(the)g +(script)h(or)f(shell)g(function)h(curren)m(tly)f(executing.)150 +4733 y Ft(LINES)240 b Fu(Used)43 b(b)m(y)g(the)g Ft(select)e +Fu(command)i(to)g(determine)g(the)g(column)g(length)g(for)g(prin)m +(ting)630 4843 y(selection)c(lists.)63 b(Automatically)41 +b(set)d(if)f(the)h Ft(checkwinsize)d Fu(option)j(is)f(enabled)h(\(see) +630 4952 y(Section)44 b(4.3.2)h([The)e(Shopt)g(Builtin],)k(page)d +(62\),)k(or)43 b(in)g(an)g(in)m(teractiv)m(e)j(shell)e(up)s(on)630 +5062 y(receipt)31 b(of)g(a)g Ft(SIGWINCH)p Fu(.)150 5230 +y Ft(MACHTYPE)96 b Fu(A)26 b(string)g(that)h(fully)f(describ)s(es)f +(the)h(system)g(t)m(yp)s(e)h(on)f(whic)m(h)f(Bash)i(is)f(executing,)i +(in)e(the)630 5340 y(standard)k Fm(gnu)g Fr(cpu-compan)m(y-system)h +Fu(format.)p eop end +%%Page: 77 83 +TeXDict begin 77 82 bop 150 -116 a Fu(Chapter)30 b(5:)41 +b(Shell)30 b(V)-8 b(ariables)2459 b(77)150 299 y Ft(MAILCHECK)630 +408 y Fu(Ho)m(w)28 b(often)g(\(in)g(seconds\))g(that)g(the)f(shell)h +(should)f(c)m(hec)m(k)i(for)e(mail)h(in)f(the)h(\014les)g(sp)s +(eci\014ed)630 518 y(in)i(the)h Ft(MAILPATH)e Fu(or)i +Ft(MAIL)e Fu(v)-5 b(ariables.)43 b(The)30 b(default)h(is)f(60)i +(seconds.)42 b(When)30 b(it)h(is)g(time)630 628 y(to)37 +b(c)m(hec)m(k)h(for)e(mail,)j(the)e(shell)f(do)s(es)g(so)h(b)s(efore)f +(displa)m(ying)h(the)f(primary)g(prompt.)57 b(If)630 +737 y(this)37 b(v)-5 b(ariable)38 b(is)f(unset,)h(or)f(set)h(to)g(a)f +(v)-5 b(alue)38 b(that)f(is)g(not)h(a)f(n)m(um)m(b)s(er)f(greater)i +(than)f(or)630 847 y(equal)31 b(to)g(zero,)g(the)g(shell)g(disables)f +(mail)h(c)m(hec)m(king.)150 996 y Ft(MAPFILE)144 b Fu(An)35 +b(arra)m(y)h(v)-5 b(ariable)36 b(created)g(to)h(hold)e(the)g(text)i +(read)e(b)m(y)g(the)h Ft(mapfile)d Fu(builtin)i(when)630 +1105 y(no)30 b(v)-5 b(ariable)31 b(name)g(is)f(supplied.)150 +1254 y Ft(OLDPWD)192 b Fu(The)30 b(previous)g(w)m(orking)g(directory)h +(as)g(set)g(b)m(y)f(the)h Ft(cd)e Fu(builtin.)150 1403 +y Ft(OPTERR)192 b Fu(If)35 b(set)i(to)f(the)h(v)-5 b(alue)36 +b(1,)i(Bash)e(displa)m(ys)g(error)f(messages)i(generated)g(b)m(y)f(the) +g Ft(getopts)630 1512 y Fu(builtin)30 b(command.)150 +1661 y Ft(OSTYPE)192 b Fu(A)30 b(string)h(describing)f(the)g(op)s +(erating)h(system)g(Bash)f(is)h(running)d(on.)150 1810 +y Ft(PIPESTATUS)630 1919 y Fu(An)23 b(arra)m(y)h(v)-5 +b(ariable)24 b(\(see)h(Section)f(6.7)h([Arra)m(ys],)g(page)f(89\))h +(con)m(taining)g(a)f(list)g(of)g(exit)g(sta-)630 2029 +y(tus)h(v)-5 b(alues)27 b(from)e(the)h(pro)s(cesses)g(in)f(the)h +(most-recen)m(tly-executed)j(foreground)c(pip)s(eline)630 +2138 y(\(whic)m(h)30 b(ma)m(y)h(con)m(tain)h(only)f(a)f(single)h +(command\).)150 2287 y Ft(POSIXLY_CORRECT)630 2397 y +Fu(If)h(this)g(v)-5 b(ariable)34 b(is)e(in)g(the)h(en)m(vironmen)m(t)g +(when)e(Bash)i(starts,)g(the)g(shell)g(en)m(ters)g Fm(posix)630 +2506 y Fu(mo)s(de)22 b(\(see)h(Section)g(6.11)h([Bash)e(POSIX)f(Mo)s +(de],)k(page)e(94\))g(b)s(efore)f(reading)g(the)g(startup)630 +2616 y(\014les,)36 b(as)e(if)h(the)f Ft(--posix)f Fu(in)m(v)m(o)s +(cation)j(option)f(had)f(b)s(een)g(supplied.)51 b(If)34 +b(it)h(is)g(set)g(while)630 2725 y(the)c(shell)f(is)h(running,)d(Bash)j +(enables)g Fm(posix)e Fu(mo)s(de,)h(as)h(if)f(the)h(command)870 +2855 y Ft(set)47 b(-o)g(posix)630 2984 y Fu(had)30 b(b)s(een)f +(executed.)150 3133 y Ft(PPID)288 b Fu(The)30 b(pro)s(cess)g +Fm(id)g Fu(of)h(the)f(shell's)h(paren)m(t)g(pro)s(cess.)40 +b(This)30 b(v)-5 b(ariable)31 b(is)f(readonly)-8 b(.)150 +3281 y Ft(PROMPT_COMMAND)630 3391 y Fu(If)32 b(set,)h(the)f(v)-5 +b(alue)33 b(is)f(in)m(terpreted)g(as)g(a)h(command)f(to)h(execute)g(b)s +(efore)f(the)g(prin)m(ting)g(of)630 3500 y(eac)m(h)g(primary)d(prompt)g +(\()p Ft($PS1)p Fu(\).)150 3649 y Ft(PROMPT_DIRTRIM)630 +3759 y Fu(If)e(set)g(to)h(a)g(n)m(um)m(b)s(er)e(greater)i(than)f(zero,) +i(the)e(v)-5 b(alue)28 b(is)f(used)g(as)g(the)h(n)m(um)m(b)s(er)e(of)h +(trailing)630 3868 y(directory)35 b(comp)s(onen)m(ts)g(to)h(retain)f +(when)f(expanding)g(the)h Ft(\\w)f Fu(and)g Ft(\\W)g +Fu(prompt)g(string)630 3978 y(escap)s(es)21 b(\(see)h(Section)f(6.9)h +([Con)m(trolling)g(the)f(Prompt],)h(page)f(92\).)39 b(Characters)21 +b(remo)m(v)m(ed)630 4088 y(are)31 b(replaced)g(with)f(an)g(ellipsis.) +150 4236 y Ft(PS3)336 b Fu(The)34 b(v)-5 b(alue)35 b(of)f(this)g(v)-5 +b(ariable)35 b(is)g(used)e(as)i(the)f(prompt)g(for)g(the)g +Ft(select)f Fu(command.)52 b(If)630 4346 y(this)30 b(v)-5 +b(ariable)31 b(is)g(not)f(set,)i(the)e Ft(select)f Fu(command)h +(prompts)f(with)h(`)p Ft(#?)g Fu(')150 4495 y Ft(PS4)336 +b Fu(The)24 b(v)-5 b(alue)25 b(is)f(the)h(prompt)e(prin)m(ted)h(b)s +(efore)g(the)h(command)f(line)h(is)f(ec)m(ho)s(ed)i(when)d(the)i +Ft(-x)630 4604 y Fu(option)32 b(is)f(set)h(\(see)g(Section)h(4.3.1)g +([The)e(Set)g(Builtin],)i(page)f(58\).)45 b(The)31 b(\014rst)f(c)m +(haracter)630 4714 y(of)k Ft(PS4)g Fu(is)g(replicated)i(m)m(ultiple)f +(times,)h(as)e(necessary)-8 b(,)37 b(to)e(indicate)g(m)m(ultiple)g(lev) +m(els)h(of)630 4823 y(indirection.)41 b(The)30 b(default)h(is)f(`)p +Ft(+)g Fu('.)150 4972 y Ft(PWD)336 b Fu(The)30 b(curren)m(t)g(w)m +(orking)h(directory)g(as)f(set)h(b)m(y)f(the)h Ft(cd)f +Fu(builtin.)150 5121 y Ft(RANDOM)192 b Fu(Eac)m(h)30 +b(time)g(this)f(parameter)g(is)g(referenced,)h(a)f(random)g(in)m(teger) +h(b)s(et)m(w)m(een)g(0)f(and)g(32767)630 5230 y(is)i(generated.)43 +b(Assigning)31 b(a)g(v)-5 b(alue)31 b(to)g(this)g(v)-5 +b(ariable)31 b(seeds)g(the)g(random)f(n)m(um)m(b)s(er)f(gen-)630 +5340 y(erator.)p eop end +%%Page: 78 84 +TeXDict begin 78 83 bop 150 -116 a Fu(Chapter)30 b(5:)41 +b(Shell)30 b(V)-8 b(ariables)2459 b(78)150 299 y Ft(READLINE_LINE)630 +408 y Fu(The)27 b(con)m(ten)m(ts)i(of)f(the)g(Readline)g(line)g +(bu\013er,)f(for)h(use)f(with)g(`)p Ft(bind)j(-x)p Fu(')d(\(see)h +(Section)h(4.2)630 518 y([Bash)i(Builtins],)g(page)g(48\).)150 +667 y Ft(READLINE_POINT)630 776 y Fu(The)23 b(p)s(osition)g(of)g(the)h +(insertion)f(p)s(oin)m(t)g(in)g(the)g(Readline)h(line)f(bu\013er,)h +(for)f(use)g(with)g(`)p Ft(bind)630 886 y(-x)p Fu(')30 +b(\(see)h(Section)h(4.2)f([Bash)g(Builtins],)g(page)g(48\).)150 +1035 y Ft(REPLY)240 b Fu(The)30 b(default)g(v)-5 b(ariable)32 +b(for)e(the)g Ft(read)g Fu(builtin.)150 1183 y Ft(SECONDS)144 +b Fu(This)40 b(v)-5 b(ariable)41 b(expands)f(to)h(the)g(n)m(um)m(b)s +(er)e(of)i(seconds)g(since)g(the)f(shell)h(w)m(as)g(started.)630 +1293 y(Assignmen)m(t)i(to)g(this)g(v)-5 b(ariable)43 +b(resets)g(the)g(coun)m(t)g(to)g(the)g(v)-5 b(alue)43 +b(assigned,)j(and)c(the)630 1403 y(expanded)35 b(v)-5 +b(alue)36 b(b)s(ecomes)h(the)f(v)-5 b(alue)36 b(assigned)g(plus)f(the)h +(n)m(um)m(b)s(er)f(of)h(seconds)g(since)630 1512 y(the)31 +b(assignmen)m(t.)150 1661 y Ft(SHELL)240 b Fu(The)29 +b(full)h(pathname)g(to)h(the)f(shell)g(is)g(k)m(ept)g(in)g(this)g(en)m +(vironmen)m(t)g(v)-5 b(ariable.)42 b(If)29 b(it)i(is)f(not)630 +1771 y(set)36 b(when)f(the)h(shell)g(starts,)i(Bash)e(assigns)h(to)f +(it)h(the)f(full)f(pathname)h(of)g(the)g(curren)m(t)630 +1880 y(user's)30 b(login)h(shell.)150 2029 y Ft(SHELLOPTS)630 +2138 y Fu(A)g(colon-separated)h(list)f(of)g(enabled)f(shell)h(options.) +41 b(Eac)m(h)31 b(w)m(ord)f(in)g(the)h(list)g(is)g(a)g(v)-5 +b(alid)630 2248 y(argumen)m(t)28 b(for)f(the)h Ft(-o)e +Fu(option)i(to)g(the)g Ft(set)e Fu(builtin)h(command)g(\(see)i(Section) +f(4.3.1)h([The)630 2358 y(Set)g(Builtin],)h(page)f(58\).)42 +b(The)28 b(options)h(app)s(earing)f(in)g Ft(SHELLOPTS)e +Fu(are)j(those)h(rep)s(orted)630 2467 y(as)g(`)p Ft(on)p +Fu(')f(b)m(y)h(`)p Ft(set)g(-o)p Fu('.)40 b(If)29 b(this)h(v)-5 +b(ariable)30 b(is)g(in)f(the)h(en)m(vironmen)m(t)g(when)f(Bash)h +(starts)g(up,)630 2577 y(eac)m(h)41 b(shell)e(option)h(in)f(the)h(list) +g(will)f(b)s(e)g(enabled)h(b)s(efore)f(reading)g(an)m(y)h(startup)f +(\014les.)630 2686 y(This)30 b(v)-5 b(ariable)31 b(is)f(readonly)-8 +b(.)150 2835 y Ft(SHLVL)240 b Fu(Incremen)m(ted)21 b(b)m(y)g(one)g(eac) +m(h)h(time)f(a)h(new)e(instance)h(of)g(Bash)g(is)g(started.)38 +b(This)20 b(is)h(in)m(tended)630 2945 y(to)31 b(b)s(e)f(a)h(coun)m(t)g +(of)f(ho)m(w)h(deeply)f(y)m(our)g(Bash)h(shells)f(are)h(nested.)150 +3093 y Ft(TIMEFORMAT)630 3203 y Fu(The)f(v)-5 b(alue)32 +b(of)f(this)g(parameter)g(is)g(used)f(as)h(a)g(format)h(string)f(sp)s +(ecifying)f(ho)m(w)h(the)g(tim-)630 3313 y(ing)37 b(information)f(for)h +(pip)s(elines)f(pre\014xed)f(with)h(the)h Ft(time)e Fu(reserv)m(ed)i(w) +m(ord)f(should)g(b)s(e)630 3422 y(displa)m(y)m(ed.)k(The)27 +b(`)p Ft(\045)p Fu(')h(c)m(haracter)h(in)m(tro)s(duces)e(an)h(escap)s +(e)g(sequence)g(that)g(is)f(expanded)g(to)630 3532 y(a)37 +b(time)g(v)-5 b(alue)36 b(or)h(other)f(information.)59 +b(The)36 b(escap)s(e)g(sequences)h(and)e(their)i(meanings)630 +3641 y(are)31 b(as)f(follo)m(ws;)i(the)f(braces)f(denote)h(optional)h +(p)s(ortions.)630 3790 y Ft(\045\045)384 b Fu(A)30 b(literal)i(`)p +Ft(\045)p Fu('.)630 3939 y Ft(\045[)p Fj(p)p Ft(][l]R)96 +b Fu(The)30 b(elapsed)h(time)g(in)f(seconds.)630 4088 +y Ft(\045[)p Fj(p)p Ft(][l]U)96 b Fu(The)30 b(n)m(um)m(b)s(er)f(of)h +(CPU)g(seconds)h(sp)s(en)m(t)f(in)g(user)f(mo)s(de.)630 +4236 y Ft(\045[)p Fj(p)p Ft(][l]S)96 b Fu(The)30 b(n)m(um)m(b)s(er)f +(of)h(CPU)g(seconds)h(sp)s(en)m(t)f(in)g(system)g(mo)s(de.)630 +4385 y Ft(\045P)384 b Fu(The)30 b(CPU)g(p)s(ercen)m(tage,)i(computed)e +(as)h(\(\045U)f Ft(+)g Fu(\045S\))g(/)h(\045R.)630 4534 +y(The)23 b(optional)j Fr(p)g Fu(is)e(a)g(digit)h(sp)s(ecifying)e(the)h +(precision,)i(the)e(n)m(um)m(b)s(er)f(of)h(fractional)h(digits)630 +4643 y(after)36 b(a)f(decimal)i(p)s(oin)m(t.)55 b(A)35 +b(v)-5 b(alue)36 b(of)f(0)h(causes)g(no)f(decimal)h(p)s(oin)m(t)f(or)h +(fraction)g(to)g(b)s(e)630 4753 y(output.)48 b(A)m(t)34 +b(most)f(three)g(places)h(after)f(the)g(decimal)h(p)s(oin)m(t)f(ma)m(y) +h(b)s(e)e(sp)s(eci\014ed;)i(v)-5 b(alues)630 4862 y(of)31 +b Fr(p)h Fu(greater)g(than)e(3)h(are)f(c)m(hanged)h(to)g(3.)42 +b(If)29 b Fr(p)k Fu(is)d(not)h(sp)s(eci\014ed,)f(the)h(v)-5 +b(alue)30 b(3)h(is)g(used.)630 4992 y(The)54 b(optional)h +Ft(l)f Fu(sp)s(eci\014es)g(a)h(longer)f(format,)61 b(including)54 +b(min)m(utes,)61 b(of)54 b(the)g(form)630 5101 y Fr(MM)10 +b Fu(m)p Fr(SS)p Fu(.)p Fr(FF)d Fu(s.)103 b(The)50 b(v)-5 +b(alue)52 b(of)f Fr(p)j Fu(determines)d(whether)f(or)h(not)h(the)f +(fraction)h(is)630 5211 y(included.)630 5340 y(If)30 +b(this)g(v)-5 b(ariable)31 b(is)g(not)f(set,)i(Bash)e(acts)h(as)g(if)f +(it)h(had)f(the)h(v)-5 b(alue)p eop end +%%Page: 79 85 +TeXDict begin 79 84 bop 150 -116 a Fu(Chapter)30 b(5:)41 +b(Shell)30 b(V)-8 b(ariables)2459 b(79)870 299 y Ft +($'\\nreal\\t\0453lR\\nuser\\t\0453)o(lU\\n)o(sys\\)o(t\0453)o(lS')630 +433 y Fu(If)37 b(the)g(v)-5 b(alue)38 b(is)f(n)m(ull,)i(no)f(timing)f +(information)h(is)f(displa)m(y)m(ed.)62 b(A)37 b(trailing)i(newline)e +(is)630 543 y(added)30 b(when)f(the)i(format)f(string)h(is)f(displa)m +(y)m(ed.)150 702 y Ft(TMOUT)240 b Fu(If)22 b(set)h(to)g(a)g(v)-5 +b(alue)23 b(greater)h(than)e(zero,)j Ft(TMOUT)d Fu(is)g(treated)i(as)e +(the)h(default)g(timeout)g(for)g(the)630 812 y Ft(read)31 +b Fu(builtin)h(\(see)h(Section)f(4.2)i([Bash)e(Builtins],)h(page)g +(48\).)47 b(The)32 b Ft(select)e Fu(command)630 922 y(\(see)f(Section)h +(3.2.4.2)g([Conditional)g(Constructs],)e(page)i(10\))f(terminates)g(if) +g(input)e(do)s(es)630 1031 y(not)k(arriv)m(e)g(after)g +Ft(TMOUT)e Fu(seconds)h(when)f(input)h(is)g(coming)h(from)f(a)h +(terminal.)630 1166 y(In)40 b(an)h(in)m(teractiv)m(e)i(shell,)h(the)d +(v)-5 b(alue)41 b(is)g(in)m(terpreted)g(as)f(the)h(n)m(um)m(b)s(er)f +(of)h(seconds)f(to)630 1275 y(w)m(ait)28 b(for)e(a)g(line)h(of)g(input) +e(after)i(issuing)f(the)h(primary)e(prompt.)39 b(Bash)26 +b(terminates)h(after)630 1385 y(w)m(aiting)32 b(for)e(that)h(n)m(um)m +(b)s(er)e(of)h(seconds)h(if)f(a)h(complete)h(line)e(of)h(input)e(do)s +(es)h(not)h(arriv)m(e.)150 1544 y Ft(TMPDIR)192 b Fu(If)39 +b(set,)j(Bash)e(uses)f(its)h(v)-5 b(alue)40 b(as)f(the)h(name)f(of)h(a) +g(directory)g(in)f(whic)m(h)g(Bash)h(creates)630 1654 +y(temp)s(orary)30 b(\014les)g(for)g(the)h(shell's)g(use.)150 +1813 y Ft(UID)336 b Fu(The)30 b(n)m(umeric)g(real)h(user)f(id)g(of)g +(the)h(curren)m(t)f(user.)40 b(This)30 b(v)-5 b(ariable)31 +b(is)f(readonly)-8 b(.)p eop end +%%Page: 80 86 +TeXDict begin 80 85 bop 150 -116 a Fu(Chapter)30 b(6:)41 +b(Bash)30 b(F)-8 b(eatures)2484 b(80)150 299 y Fp(6)80 +b(Bash)54 b(F)-13 b(eatures)150 504 y Fu(This)30 b(c)m(hapter)h +(describ)s(es)e(features)i(unique)e(to)i(Bash.)150 725 +y Fs(6.1)68 b(In)l(v)l(oking)46 b(Bash)390 884 y Ft(bash)h([long-opt])e +([-ir])h([-abefhkmnptuvxdBCDHP])c([-o)47 b Fj(option)p +Ft(])e([-O)i Fj(shopt_option)p Ft(])e([)p Fj(ar-)390 +994 y(gument)h Ft(...)o(])390 1103 y(bash)h([long-opt])e +([-abefhkmnptuvxdBCDHP])c([-o)47 b Fj(option)p Ft(])f([-O)h +Fj(shopt_option)p Ft(])d(-c)j Fj(string)f Ft([)p Fj(ar-)390 +1213 y(gument)g Ft(...)o(])390 1323 y(bash)h([long-opt])e(-s)i +([-abefhkmnptuvxdBCDHP])42 b([-o)k Fj(option)p Ft(])g([-O)h +Fj(shopt_option)p Ft(])d([)p Fj(ar-)390 1432 y(gument)i +Ft(...)o(])275 1561 y Fu(All)31 b(of)g(the)f(single-c)m(haracter)k +(options)d(used)f(with)g(the)h Ft(set)f Fu(builtin)g(\(see)h(Section)h +(4.3.1)g([The)f(Set)150 1670 y(Builtin],)45 b(page)c(58\))i(can)e(b)s +(e)f(used)h(as)g(options)g(when)f(the)i(shell)f(is)g(in)m(v)m(ok)m(ed.) +74 b(In)41 b(addition,)j(there)150 1780 y(are)38 b(sev)m(eral)h(m)m +(ulti-c)m(haracter)h(options)d(that)h(y)m(ou)g(can)g(use.)61 +b(These)38 b(options)f(m)m(ust)h(app)s(ear)e(on)i(the)150 +1890 y(command)30 b(line)h(b)s(efore)f(the)g(single-c)m(haracter)j +(options)e(to)g(b)s(e)f(recognized.)150 2037 y Ft(--debugger)630 +2147 y Fu(Arrange)j(for)g(the)g(debugger)g(pro\014le)g(to)h(b)s(e)e +(executed)i(b)s(efore)f(the)g(shell)g(starts.)49 b(T)-8 +b(urns)630 2257 y(on)37 b(extended)g(debugging)g(mo)s(de)g(\(see)h +(Section)g(4.3.2)g([The)f(Shopt)g(Builtin],)i(page)f(62)630 +2366 y(for)30 b(a)h(description)f(of)h(the)f Ft(extdebug)f +Fu(option)h(to)h(the)g Ft(shopt)e Fu(builtin\).)150 2514 +y Ft(--dump-po-strings)630 2623 y Fu(A)37 b(list)g(of)f(all)i +(double-quoted)e(strings)g(preceded)g(b)m(y)h(`)p Ft($)p +Fu(')f(is)h(prin)m(ted)f(on)g(the)h(standard)630 2733 +y(output)29 b(in)g(the)g Fm(gnu)g Ft(gettext)f Fu(PO)g(\(p)s(ortable)i +(ob)5 b(ject\))30 b(\014le)g(format.)40 b(Equiv)-5 b(alen)m(t)31 +b(to)f Ft(-D)630 2843 y Fu(except)h(for)f(the)h(output)f(format.)150 +2990 y Ft(--dump-strings)630 3100 y Fu(Equiv)-5 b(alen)m(t)31 +b(to)g Ft(-D)p Fu(.)150 3248 y Ft(--help)192 b Fu(Displa)m(y)32 +b(a)e(usage)h(message)h(on)e(standard)g(output)g(and)f(exit)j +(successfully)-8 b(.)150 3396 y Ft(--init-file)27 b Fj(filename)150 +3505 y Ft(--rcfile)h Fj(filename)630 3615 y Fu(Execute)23 +b(commands)e(from)g Fr(\014lename)28 b Fu(\(instead)22 +b(of)g Ft(~/.bashrc)p Fu(\))e(in)h(an)h(in)m(teractiv)m(e)i(shell.)150 +3763 y Ft(--login)144 b Fu(Equiv)-5 b(alen)m(t)31 b(to)g +Ft(-l)p Fu(.)150 3910 y Ft(--noediting)630 4020 y Fu(Do)h(not)e(use)h +(the)g Fm(gnu)f Fu(Readline)i(library)e(\(see)h(Chapter)g(8)g([Command) +f(Line)g(Editing],)630 4130 y(page)h(101\))h(to)f(read)g(command)f +(lines)g(when)g(the)g(shell)h(is)f(in)m(teractiv)m(e.)150 +4277 y Ft(--noprofile)630 4387 y Fu(Don't)22 b(load)g(the)g +(system-wide)f(startup)g(\014le)h Ft(/etc/profile)c Fu(or)j(an)m(y)h +(of)f(the)h(p)s(ersonal)f(ini-)630 4496 y(tialization)34 +b(\014les)e Ft(~/.bash_profile)p Fu(,)c Ft(~/.bash_login)p +Fu(,)g(or)k Ft(~/.profile)c Fu(when)j(Bash)630 4606 y(is)f(in)m(v)m(ok) +m(ed)i(as)f(a)g(login)g(shell.)150 4754 y Ft(--norc)192 +b Fu(Don't)35 b(read)f(the)g Ft(~/.bashrc)e Fu(initialization)k(\014le) +f(in)e(an)h(in)m(teractiv)m(e)j(shell.)52 b(This)33 b(is)h(on)630 +4863 y(b)m(y)c(default)h(if)f(the)h(shell)f(is)h(in)m(v)m(ok)m(ed)h(as) +e Ft(sh)p Fu(.)150 5011 y Ft(--posix)144 b Fu(Change)24 +b(the)h(b)s(eha)m(vior)f(of)g(Bash)h(where)e(the)i(default)f(op)s +(eration)h(di\013ers)f(from)f(the)i Fm(posix)630 5121 +y Fu(standard)35 b(to)h(matc)m(h)g(the)g(standard.)55 +b(This)35 b(is)h(in)m(tended)f(to)h(mak)m(e)h(Bash)f(b)s(eha)m(v)m(e)g +(as)g(a)630 5230 y(strict)26 b(sup)s(erset)e(of)h(that)g(standard.)38 +b(See)26 b(Section)f(6.11)i([Bash)e(POSIX)f(Mo)s(de],)j(page)f(94,)630 +5340 y(for)k(a)h(description)f(of)h(the)f(Bash)h Fm(posix)f +Fu(mo)s(de.)p eop end +%%Page: 81 87 +TeXDict begin 81 86 bop 150 -116 a Fu(Chapter)30 b(6:)41 +b(Bash)30 b(F)-8 b(eatures)2484 b(81)150 299 y Ft(--restricted)630 +408 y Fu(Mak)m(e)54 b(the)e(shell)g(a)h(restricted)g(shell)f(\(see)h +(Section)g(6.10)h([The)d(Restricted)j(Shell],)630 518 +y(page)31 b(93\).)150 682 y Ft(--verbose)630 791 y Fu(Equiv)-5 +b(alen)m(t)31 b(to)g Ft(-v)p Fu(.)41 b(Prin)m(t)30 b(shell)g(input)g +(lines)g(as)h(they're)g(read.)150 955 y Ft(--version)630 +1065 y Fu(Sho)m(w)d(v)m(ersion)g(information)g(for)g(this)g(instance)h +(of)f(Bash)g(on)g(the)g(standard)f(output)h(and)630 1174 +y(exit)j(successfully)-8 b(.)275 1341 y(There)28 b(are)i(sev)m(eral)g +(single-c)m(haracter)i(options)d(that)h(ma)m(y)g(b)s(e)e(supplied)g(at) +i(in)m(v)m(o)s(cation)h(whic)m(h)e(are)150 1450 y(not)i(a)m(v)-5 +b(ailable)32 b(with)e(the)h Ft(set)e Fu(builtin.)150 +1616 y Ft(-c)384 b Fu(Read)44 b(and)e(execute)j(commands)e(from)g(the)g +(\014rst)g(non-option)h Fr(argumen)m(t)h Fu(after)f(pro-)630 +1726 y(cessing)37 b(the)g(options,)i(then)d(exit.)61 +b(An)m(y)37 b(remaining)f(argumen)m(ts)h(are)g(assigned)g(to)h(the)630 +1835 y(p)s(ositional)31 b(parameters,)g(starting)g(with)f +Ft($0)p Fu(.)150 1999 y Ft(-i)384 b Fu(F)-8 b(orce)22 +b(the)g(shell)f(to)g(run)f(in)m(teractiv)m(ely)-8 b(.)41 +b(In)m(teractiv)m(e)23 b(shells)e(are)h(describ)s(ed)d(in)i(Section)h +(6.3)630 2109 y([In)m(teractiv)m(e)33 b(Shells],)e(page)g(83.)150 +2273 y Ft(-l)384 b Fu(Mak)m(e)33 b(this)e(shell)h(act)g(as)g(if)f(it)h +(had)f(b)s(een)f(directly)i(in)m(v)m(ok)m(ed)h(b)m(y)f(login.)44 +b(When)31 b(the)h(shell)630 2382 y(is)37 b(in)m(teractiv)m(e,)43 +b(this)37 b(is)g(equiv)-5 b(alen)m(t)39 b(to)f(starting)h(a)e(login)i +(shell)e(with)g(`)p Ft(exec)30 b(-l)g(bash)p Fu('.)630 +2492 y(When)h(the)g(shell)h(is)f(not)g(in)m(teractiv)m(e,)k(the)c +(login)h(shell)g(startup)f(\014les)g(will)g(b)s(e)g(executed.)630 +2601 y(`)p Ft(exec)e(bash)h(-l)p Fu(')43 b(or)h(`)p Ft(exec)29 +b(bash)g(--login)p Fu(')42 b(will)i(replace)h(the)f(curren)m(t)f(shell) +h(with)g(a)630 2711 y(Bash)26 b(login)g(shell.)39 b(See)26 +b(Section)g(6.2)h([Bash)e(Startup)g(Files],)j(page)e(82,)i(for)d(a)h +(description)630 2821 y(of)31 b(the)f(sp)s(ecial)h(b)s(eha)m(vior)g(of) +f(a)h(login)g(shell.)150 2984 y Ft(-r)384 b Fu(Mak)m(e)54 +b(the)e(shell)g(a)h(restricted)g(shell)f(\(see)h(Section)g(6.10)h([The) +d(Restricted)j(Shell],)630 3094 y(page)31 b(93\).)150 +3258 y Ft(-s)384 b Fu(If)24 b(this)h(option)h(is)f(presen)m(t,)h(or)f +(if)g(no)f(argumen)m(ts)i(remain)e(after)i(option)f(pro)s(cessing,)h +(then)630 3367 y(commands)i(are)h(read)g(from)f(the)h(standard)f +(input.)39 b(This)28 b(option)h(allo)m(ws)h(the)f(p)s(ositional)630 +3477 y(parameters)i(to)g(b)s(e)f(set)g(when)g(in)m(v)m(oking)h(an)g(in) +m(teractiv)m(e)i(shell.)150 3641 y Ft(-D)384 b Fu(A)37 +b(list)g(of)f(all)i(double-quoted)e(strings)g(preceded)g(b)m(y)h(`)p +Ft($)p Fu(')f(is)h(prin)m(ted)f(on)g(the)h(standard)630 +3750 y(output.)63 b(These)38 b(are)g(the)g(strings)g(that)h(are)f(sub)5 +b(ject)38 b(to)h(language)g(translation)g(when)630 3860 +y(the)e(curren)m(t)g(lo)s(cale)h(is)f(not)g Ft(C)g Fu(or)f +Ft(POSIX)g Fu(\(see)h(Section)h(3.1.2.5)h([Lo)s(cale)g(T)-8 +b(ranslation],)630 3970 y(page)31 b(7\).)42 b(This)29 +b(implies)i(the)f Ft(-n)g Fu(option;)h(no)f(commands)g(will)h(b)s(e)f +(executed.)150 4133 y Ft([-+]O)f([)p Fj(shopt_option)p +Ft(])630 4243 y Fr(shopt)p 854 4243 28 4 v 40 w(option)44 +b Fu(is)g(one)h(of)f(the)g(shell)h(options)f(accepted)h(b)m(y)f(the)h +Ft(shopt)d Fu(builtin)i(\(see)630 4353 y(Section)32 b(4.3.2)h([The)e +(Shopt)f(Builtin],)i(page)g(62\).)44 b(If)31 b Fr(shopt)p +2724 4353 V 40 w(option)g Fu(is)g(presen)m(t,)h Ft(-O)f +Fu(sets)630 4462 y(the)24 b(v)-5 b(alue)24 b(of)g(that)h(option;)h +Ft(+O)e Fu(unsets)f(it.)39 b(If)23 b Fr(shopt)p 2423 +4462 V 40 w(option)h Fu(is)g(not)g(supplied,)g(the)g(names)630 +4572 y(and)31 b(v)-5 b(alues)32 b(of)g(the)g(shell)g(options)g +(accepted)h(b)m(y)f Ft(shopt)e Fu(are)i(prin)m(ted)f(on)h(the)g +(standard)630 4681 y(output.)40 b(If)29 b(the)h(in)m(v)m(o)s(cation)h +(option)f(is)f Ft(+O)p Fu(,)h(the)f(output)g(is)h(displa)m(y)m(ed)g(in) +f(a)h(format)f(that)630 4791 y(ma)m(y)i(b)s(e)f(reused)f(as)i(input.) +150 4955 y Ft(--)384 b Fu(A)38 b Ft(--)g Fu(signals)g(the)h(end)e(of)i +(options)f(and)g(disables)g(further)f(option)h(pro)s(cessing.)64 +b(An)m(y)630 5064 y(argumen)m(ts)31 b(after)g(the)f Ft(--)g +Fu(are)h(treated)g(as)g(\014lenames)f(and)g(argumen)m(ts.)275 +5230 y(A)d Fl(lo)-5 b(gin)35 b Fu(shell)27 b(is)g(one)h(whose)f +(\014rst)f(c)m(haracter)j(of)e(argumen)m(t)h(zero)f(is)h(`)p +Ft(-)p Fu(',)g(or)f(one)g(in)m(v)m(ok)m(ed)i(with)e(the)150 +5340 y Ft(--login)h Fu(option.)p eop end +%%Page: 82 88 +TeXDict begin 82 87 bop 150 -116 a Fu(Chapter)30 b(6:)41 +b(Bash)30 b(F)-8 b(eatures)2484 b(82)275 299 y(An)28 +b Fl(inter)-5 b(active)37 b Fu(shell)30 b(is)f(one)g(started)h(without) +f(non-option)h(argumen)m(ts,)g(unless)e Ft(-s)h Fu(is)g(sp)s +(eci\014ed,)150 408 y(without)k(sp)s(ecifying)h(the)f +Ft(-c)g Fu(option,)i(and)e(whose)g(input)g(and)f(output)h(are)h(b)s +(oth)f(connected)h(to)g(ter-)150 518 y(minals)g(\(as)g(determined)f(b)m +(y)h Ft(isatty\(3\))p Fu(\),)e(or)i(one)g(started)g(with)f(the)h +Ft(-i)f Fu(option.)51 b(See)33 b(Section)i(6.3)150 628 +y([In)m(teractiv)m(e)e(Shells],)e(page)g(83,)g(for)f(more)h +(information.)275 763 y(If)i(argumen)m(ts)h(remain)g(after)h(option)f +(pro)s(cessing,)h(and)e(neither)h(the)g Ft(-c)g Fu(nor)f(the)h +Ft(-s)g Fu(option)g(has)150 873 y(b)s(een)44 b(supplied,)j(the)d +(\014rst)g(argumen)m(t)h(is)g(assumed)e(to)j(b)s(e)d(the)i(name)g(of)f +(a)h(\014le)g(con)m(taining)h(shell)150 982 y(commands)30 +b(\(see)g(Section)h(3.8)g([Shell)f(Scripts],)g(page)h(39\).)41 +b(When)30 b(Bash)g(is)g(in)m(v)m(ok)m(ed)i(in)d(this)h(fashion,)150 +1092 y Ft($0)37 b Fu(is)g(set)h(to)h(the)e(name)h(of)f(the)h(\014le,)i +(and)c(the)i(p)s(ositional)g(parameters)g(are)g(set)g(to)g(the)g +(remaining)150 1202 y(argumen)m(ts.)h(Bash)26 b(reads)f(and)g(executes) +h(commands)f(from)g(this)g(\014le,)i(then)e(exits.)40 +b(Bash's)25 b(exit)i(status)150 1311 y(is)f(the)h(exit)h(status)e(of)h +(the)g(last)g(command)f(executed)h(in)g(the)f(script.)40 +b(If)26 b(no)g(commands)g(are)h(executed,)150 1421 y(the)k(exit)g +(status)g(is)f(0.)150 1655 y Fs(6.2)68 b(Bash)45 b(Startup)g(Files)150 +1814 y Fu(This)23 b(section)j(describ)s(es)d(ho)m(w)i(Bash)f(executes)h +(its)g(startup)f(\014les.)38 b(If)24 b(an)m(y)h(of)f(the)h(\014les)f +(exist)h(but)e(cannot)150 1924 y(b)s(e)29 b(read,)i(Bash)f(rep)s(orts)f +(an)h(error.)40 b(Tildes)30 b(are)g(expanded)f(in)h(\014lenames)g(as)g +(describ)s(ed)f(ab)s(o)m(v)m(e)i(under)150 2034 y(Tilde)f(Expansion)g +(\(see)h(Section)h(3.5.2)g([Tilde)e(Expansion],)h(page)g(22\).)275 +2169 y(In)m(teractiv)m(e)h(shells)f(are)g(describ)s(ed)e(in)h(Section)h +(6.3)h([In)m(teractiv)m(e)h(Shells],)d(page)h(83.)150 +2370 y Fk(In)m(v)m(ok)m(ed)40 b(as)h(an)f(in)m(teractiv)m(e)f(login)j +(shell,)g(or)g(with)e Fh(--login)150 2516 y Fu(When)c(Bash)f(is)h(in)m +(v)m(ok)m(ed)h(as)f(an)g(in)m(teractiv)m(e)j(login)d(shell,)i(or)e(as)g +(a)g(non-in)m(teractiv)m(e)i(shell)e(with)g(the)150 2626 +y Ft(--login)30 b Fu(option,)k(it)f(\014rst)e(reads)h(and)g(executes)i +(commands)e(from)f(the)i(\014le)f Ft(/etc/profile)p Fu(,)e(if)i(that) +150 2736 y(\014le)44 b(exists.)80 b(After)44 b(reading)g(that)g +(\014le,)j(it)d(lo)s(oks)g(for)f Ft(~/.bash_profile)p +Fu(,)g Ft(~/.bash_login)p Fu(,)h(and)150 2845 y Ft(~/.profile)p +Fu(,)25 b(in)i(that)g(order,)h(and)e(reads)h(and)f(executes)j(commands) +d(from)h(the)g(\014rst)f(one)i(that)f(exists)150 2955 +y(and)j(is)h(readable.)42 b(The)30 b Ft(--noprofile)d +Fu(option)k(ma)m(y)g(b)s(e)f(used)g(when)g(the)h(shell)f(is)h(started)g +(to)g(inhibit)150 3064 y(this)f(b)s(eha)m(vior.)275 3200 +y(When)38 b(a)h(login)h(shell)f(exits,)j(Bash)d(reads)f(and)h(executes) +h(commands)e(from)g(the)h(\014le)g Ft(~/.bash_)150 3310 +y(logout)p Fu(,)29 b(if)h(it)h(exists.)150 3510 y Fk(In)m(v)m(ok)m(ed) +40 b(as)h(an)f(in)m(teractiv)m(e)f(non-login)k(shell)150 +3657 y Fu(When)g(an)h(in)m(teractiv)m(e)i(shell)e(that)g(is)f(not)h(a)g +(login)g(shell)g(is)f(started,)48 b(Bash)c(reads)f(and)g(executes)150 +3767 y(commands)31 b(from)g Ft(~/.bashrc)p Fu(,)f(if)h(that)h(\014le)g +(exists.)44 b(This)31 b(ma)m(y)h(b)s(e)f(inhibited)g(b)m(y)g(using)g +(the)h Ft(--norc)150 3876 y Fu(option.)40 b(The)27 b +Ft(--rcfile)h Fj(file)e Fu(option)h(will)g(force)h(Bash)f(to)h(read)f +(and)f(execute)j(commands)d(from)h Fr(\014le)150 3986 +y Fu(instead)k(of)f Ft(~/.bashrc)p Fu(.)275 4121 y(So,)g(t)m(ypically) +-8 b(,)33 b(y)m(our)d Ft(~/.bash_profile)c Fu(con)m(tains)32 +b(the)f(line)390 4257 y Ft(if)47 b([)h(-f)f(~/.bashrc)e(];)i(then)g(.)g +(~/.bashrc;)e(fi)150 4393 y Fu(after)31 b(\(or)g(b)s(efore\))f(an)m(y)h +(login-sp)s(eci\014c)g(initializations.)150 4593 y Fk(In)m(v)m(ok)m(ed) +40 b(non-in)m(teractiv)m(ely)150 4740 y Fu(When)33 b(Bash)g(is)g +(started)h(non-in)m(teractiv)m(ely)-8 b(,)37 b(to)d(run)e(a)h(shell)h +(script,)g(for)f(example,)i(it)e(lo)s(oks)h(for)f(the)150 +4850 y(v)-5 b(ariable)35 b Ft(BASH_ENV)d Fu(in)i(the)h(en)m(vironmen)m +(t,)h(expands)e(its)g(v)-5 b(alue)35 b(if)g(it)g(app)s(ears)e(there,)j +(and)e(uses)g(the)150 4959 y(expanded)c(v)-5 b(alue)30 +b(as)h(the)g(name)f(of)h(a)f(\014le)h(to)g(read)f(and)g(execute.)42 +b(Bash)31 b(b)s(eha)m(v)m(es)g(as)g(if)f(the)g(follo)m(wing)150 +5069 y(command)g(w)m(ere)h(executed:)390 5204 y Ft(if)47 +b([)h(-n)f("$BASH_ENV")e(];)i(then)f(.)i("$BASH_ENV";)c(fi)150 +5340 y Fu(but)30 b(the)g(v)-5 b(alue)31 b(of)g(the)f +Ft(PATH)f Fu(v)-5 b(ariable)32 b(is)e(not)h(used)e(to)i(searc)m(h)g +(for)f(the)h(\014lename.)p eop end +%%Page: 83 89 +TeXDict begin 83 88 bop 150 -116 a Fu(Chapter)30 b(6:)41 +b(Bash)30 b(F)-8 b(eatures)2484 b(83)275 299 y(As)42 +b(noted)g(ab)s(o)m(v)m(e,)47 b(if)42 b(a)h(non-in)m(teractiv)m(e)i +(shell)d(is)g(in)m(v)m(ok)m(ed)i(with)e(the)h Ft(--login)d +Fu(option,)46 b(Bash)150 408 y(attempts)31 b(to)g(read)g(and)e(execute) +j(commands)e(from)g(the)h(login)g(shell)g(startup)e(\014les.)150 +614 y Fk(In)m(v)m(ok)m(ed)40 b(with)g(name)h Fh(sh)150 +761 y Fu(If)c(Bash)g(is)g(in)m(v)m(ok)m(ed)i(with)e(the)g(name)g +Ft(sh)p Fu(,)i(it)f(tries)f(to)h(mimic)g(the)f(startup)g(b)s(eha)m +(vior)g(of)h(historical)150 870 y(v)m(ersions)31 b(of)f +Ft(sh)g Fu(as)h(closely)h(as)e(p)s(ossible,)g(while)h(conforming)f(to)h +(the)g Fm(posix)e Fu(standard)h(as)h(w)m(ell.)275 1010 +y(When)50 b(in)m(v)m(ok)m(ed)j(as)f(an)f(in)m(teractiv)m(e)j(login)e +(shell,)57 b(or)51 b(as)g(a)h(non-in)m(teractiv)m(e)h(shell)f(with)f +(the)150 1120 y Ft(--login)31 b Fu(option,)k(it)e(\014rst)g(attempts)h +(to)g(read)f(and)g(execute)h(commands)f(from)g Ft(/etc/profile)d +Fu(and)150 1230 y Ft(~/.profile)p Fu(,)d(in)i(that)i(order.)39 +b(The)30 b Ft(--noprofile)c Fu(option)k(ma)m(y)g(b)s(e)f(used)g(to)h +(inhibit)f(this)h(b)s(eha)m(vior.)150 1339 y(When)36 +b(in)m(v)m(ok)m(ed)i(as)e(an)g(in)m(teractiv)m(e)j(shell)e(with)f(the)g +(name)h Ft(sh)p Fu(,)g(Bash)f(lo)s(oks)h(for)f(the)h(v)-5 +b(ariable)37 b Ft(ENV)p Fu(,)150 1449 y(expands)29 b(its)i(v)-5 +b(alue)30 b(if)h(it)f(is)g(de\014ned,)g(and)f(uses)h(the)g(expanded)g +(v)-5 b(alue)30 b(as)h(the)f(name)g(of)g(a)h(\014le)f(to)h(read)150 +1558 y(and)g(execute.)46 b(Since)32 b(a)g(shell)g(in)m(v)m(ok)m(ed)h +(as)f Ft(sh)f Fu(do)s(es)g(not)h(attempt)h(to)g(read)e(and)g(execute)i +(commands)150 1668 y(from)39 b(an)m(y)g(other)h(startup)e(\014les,)k +(the)d Ft(--rcfile)e Fu(option)j(has)f(no)g(e\013ect.)69 +b(A)39 b(non-in)m(teractiv)m(e)j(shell)150 1778 y(in)m(v)m(ok)m(ed)32 +b(with)e(the)g(name)h Ft(sh)f Fu(do)s(es)g(not)g(attempt)i(to)f(read)f +(an)m(y)h(other)g(startup)e(\014les.)275 1918 y(When)h(in)m(v)m(ok)m +(ed)h(as)g Ft(sh)p Fu(,)f(Bash)h(en)m(ters)g Fm(posix)e +Fu(mo)s(de)h(after)h(the)g(startup)f(\014les)g(are)h(read.)150 +2123 y Fk(In)m(v)m(ok)m(ed)40 b(in)h Fg(posix)g Fk(mo)s(de)150 +2270 y Fu(When)28 b(Bash)h(is)g(started)g(in)g Fm(posix)f +Fu(mo)s(de,)g(as)h(with)g(the)g Ft(--posix)d Fu(command)j(line)g +(option,)h(it)f(follo)m(ws)150 2380 y(the)24 b Fm(posix)f +Fu(standard)h(for)f(startup)h(\014les.)38 b(In)24 b(this)g(mo)s(de,)h +(in)m(teractiv)m(e)i(shells)d(expand)f(the)h Ft(ENV)f +Fu(v)-5 b(ariable)150 2489 y(and)30 b(commands)g(are)g(read)h(and)e +(executed)j(from)d(the)i(\014le)f(whose)g(name)h(is)f(the)h(expanded)e +(v)-5 b(alue.)41 b(No)150 2599 y(other)31 b(startup)f(\014les)g(are)h +(read.)150 2804 y Fk(In)m(v)m(ok)m(ed)40 b(b)m(y)g(remote)h(shell)h +(daemon)150 2951 y Fu(Bash)36 b(attempts)h(to)g(determine)f(when)f(it)i +(is)f(b)s(eing)g(run)e(with)i(its)g(standard)g(input)f(connected)i(to)g +(a)150 3060 y(net)m(w)m(ork)h(connection,)j(as)c(when)g(executed)h(b)m +(y)f(the)h(remote)g(shell)g(daemon,)h(usually)e Ft(rshd)p +Fu(,)h(or)g(the)150 3170 y(secure)c(shell)f(daemon)h +Ft(sshd)p Fu(.)49 b(If)33 b(Bash)g(determines)h(it)g(is)f(b)s(eing)g +(run)f(in)i(this)f(fashion,)h(it)g(reads)g(and)150 3280 +y(executes)29 b(commands)e(from)g Ft(~/.bashrc)p Fu(,)e(if)j(that)g +(\014le)f(exists)h(and)f(is)g(readable.)41 b(It)27 b(will)h(not)f(do)h +(this)f(if)150 3389 y(in)m(v)m(ok)m(ed)k(as)f Ft(sh)p +Fu(.)40 b(The)29 b Ft(--norc)f Fu(option)i(ma)m(y)g(b)s(e)f(used)f(to)j +(inhibit)e(this)g(b)s(eha)m(vior,)h(and)f(the)h Ft(--rcfile)150 +3499 y Fu(option)36 b(ma)m(y)g(b)s(e)e(used)h(to)h(force)g(another)f +(\014le)h(to)g(b)s(e)e(read,)j(but)d(neither)i Ft(rshd)e +Fu(nor)h Ft(sshd)f Fu(generally)150 3608 y(in)m(v)m(ok)m(e)e(the)f +(shell)f(with)h(those)f(options)h(or)f(allo)m(w)i(them)f(to)g(b)s(e)e +(sp)s(eci\014ed.)150 3814 y Fk(In)m(v)m(ok)m(ed)40 b(with)g(unequal)h +(e\013ectiv)m(e)e(and)i(real)g Fg(uid/gid)p Fk(s)150 +3960 y Fu(If)34 b(Bash)h(is)g(started)g(with)f(the)h(e\013ectiv)m(e)i +(user)d(\(group\))h(id)f(not)h(equal)g(to)g(the)g(real)g(user)f +(\(group\))h(id,)150 4070 y(and)26 b(the)i Ft(-p)e Fu(option)h(is)g +(not)h(supplied,)e(no)h(startup)g(\014les)g(are)g(read,)h(shell)f +(functions)g(are)g(not)g(inherited)150 4180 y(from)41 +b(the)g(en)m(vironmen)m(t,)j(the)d Ft(SHELLOPTS)p Fu(,)h +Ft(BASHOPTS)p Fu(,)g Ft(CDPATH)p Fu(,)g(and)e Ft(GLOBIGNORE)e +Fu(v)-5 b(ariables,)45 b(if)150 4289 y(they)28 b(app)s(ear)f(in)h(the)g +(en)m(vironmen)m(t,)i(are)e(ignored,)h(and)e(the)h(e\013ectiv)m(e)j +(user)c(id)h(is)g(set)g(to)h(the)f(real)h(user)150 4399 +y(id.)62 b(If)38 b(the)f Ft(-p)h Fu(option)g(is)f(supplied)g(at)h(in)m +(v)m(o)s(cation,)k(the)c(startup)f(b)s(eha)m(vior)h(is)g(the)g(same,)i +(but)d(the)150 4508 y(e\013ectiv)m(e)c(user)d(id)g(is)g(not)h(reset.) +150 4750 y Fs(6.3)68 b(In)l(teractiv)l(e)47 b(Shells)150 +4974 y Fk(6.3.1)63 b(What)40 b(is)h(an)g(In)m(teractiv)m(e)e(Shell?)150 +5121 y Fu(An)g(in)m(teractiv)m(e)k(shell)d(is)g(one)g(started)g +(without)g(non-option)g(argumen)m(ts,)j(unless)c Ft(-s)h +Fu(is)f(sp)s(eci\014ed,)150 5230 y(without)30 b(sp)s(ecifying)g(the)g +Ft(-c)f Fu(option,)h(and)g(whose)f(input)g(and)g(error)h(output)f(are)h +(b)s(oth)f(connected)i(to)150 5340 y(terminals)g(\(as)g(determined)f(b) +m(y)g Ft(isatty\(3\))p Fu(\),)e(or)j(one)f(started)h(with)f(the)h +Ft(-i)f Fu(option.)p eop end +%%Page: 84 90 +TeXDict begin 84 89 bop 150 -116 a Fu(Chapter)30 b(6:)41 +b(Bash)30 b(F)-8 b(eatures)2484 b(84)275 299 y(An)30 +b(in)m(teractiv)m(e)j(shell)d(generally)i(reads)e(from)g(and)g(writes)g +(to)h(a)g(user's)f(terminal.)275 430 y(The)i Ft(-s)g +Fu(in)m(v)m(o)s(cation)j(option)f(ma)m(y)f(b)s(e)g(used)f(to)i(set)f +(the)g(p)s(ositional)h(parameters)f(when)f(an)h(in)m(ter-)150 +540 y(activ)m(e)g(shell)d(is)h(started.)150 733 y Fk(6.3.2)63 +b(Is)41 b(this)g(Shell)g(In)m(teractiv)m(e?)150 880 y +Fu(T)-8 b(o)30 b(determine)g(within)f(a)h(startup)g(script)f(whether)g +(or)h(not)g(Bash)g(is)g(running)e(in)m(teractiv)m(ely)-8 +b(,)33 b(test)e(the)150 990 y(v)-5 b(alue)30 b(of)g(the)f(`)p +Ft(-)p Fu(')h(sp)s(ecial)g(parameter.)41 b(It)29 b(con)m(tains)i +Ft(i)e Fu(when)g(the)g(shell)h(is)f(in)m(teractiv)m(e.)44 +b(F)-8 b(or)30 b(example:)390 1121 y Ft(case)47 b("$-")f(in)390 +1231 y(*i*\))h(echo)f(This)h(shell)f(is)h(interactive)e(;;)390 +1340 y(*\))i(echo)g(This)f(shell)h(is)g(not)g(interactive)e(;;)390 +1450 y(esac)275 1581 y Fu(Alternativ)m(ely)-8 b(,)28 +b(startup)23 b(scripts)h(ma)m(y)g(examine)g(the)g(v)-5 +b(ariable)25 b Ft(PS1)p Fu(;)g(it)g(is)e(unset)h(in)f(non-in)m +(teractiv)m(e)150 1691 y(shells,)31 b(and)e(set)i(in)f(in)m(teractiv)m +(e)k(shells.)40 b(Th)m(us:)390 1822 y Ft(if)47 b([)h(-z)f("$PS1")f(];)h +(then)772 1932 y(echo)f(This)h(shell)f(is)i(not)f(interactive)390 +2042 y(else)772 2151 y(echo)f(This)h(shell)f(is)i(interactive)390 +2261 y(fi)150 2454 y Fk(6.3.3)63 b(In)m(teractiv)m(e)38 +b(Shell)k(Beha)m(vior)150 2601 y Fu(When)30 b(the)h(shell)f(is)h +(running)d(in)m(teractiv)m(ely)-8 b(,)34 b(it)d(c)m(hanges)h(its)f(b)s +(eha)m(vior)f(in)g(sev)m(eral)i(w)m(a)m(ys.)199 2732 +y(1.)61 b(Startup)37 b(\014les)g(are)h(read)f(and)g(executed)h(as)f +(describ)s(ed)g(in)g(Section)h(6.2)g([Bash)g(Startup)e(Files],)330 +2842 y(page)31 b(82.)199 2973 y(2.)61 b(Job)35 b(Con)m(trol)g(\(see)h +(Chapter)f(7)g([Job)g(Con)m(trol],)i(page)f(97\))g(is)f(enabled)g(b)m +(y)g(default.)55 b(When)34 b(job)330 3083 y(con)m(trol)h(is)f(in)f +(e\013ect,)k(Bash)d(ignores)g(the)g(k)m(eyb)s(oard-generated)h(job)e +(con)m(trol)i(signals)g Ft(SIGTTIN)p Fu(,)330 3192 y +Ft(SIGTTOU)p Fu(,)29 b(and)g Ft(SIGTSTP)p Fu(.)199 3324 +y(3.)61 b(Bash)39 b(expands)f(and)g(displa)m(ys)h Ft(PS1)f +Fu(b)s(efore)h(reading)g(the)g(\014rst)f(line)h(of)g(a)g(command,)i +(and)d(ex-)330 3434 y(pands)30 b(and)g(displa)m(ys)h +Ft(PS2)e Fu(b)s(efore)i(reading)g(the)g(second)f(and)h(subsequen)m(t)f +(lines)h(of)g(a)g(m)m(ulti-line)330 3543 y(command.)199 +3675 y(4.)61 b(Bash)26 b(executes)i(the)e(v)-5 b(alue)27 +b(of)f(the)h Ft(PROMPT_COMMAND)22 b Fu(v)-5 b(ariable)27 +b(as)g(a)f(command)g(b)s(efore)g(prin)m(ting)330 3784 +y(the)31 b(primary)e(prompt,)h Ft($PS1)f Fu(\(see)i(Section)g(5.2)h +([Bash)f(V)-8 b(ariables],)32 b(page)f(69\).)199 3916 +y(5.)61 b(Readline)27 b(\(see)g(Chapter)e(8)h([Command)g(Line)g +(Editing],)h(page)g(101\))g(is)f(used)g(to)g(read)g(commands)330 +4025 y(from)k(the)g(user's)g(terminal.)199 4157 y(6.)61 +b(Bash)36 b(insp)s(ects)g(the)h(v)-5 b(alue)37 b(of)f(the)g +Ft(ignoreeof)e Fu(option)j(to)g Ft(set)29 b(-o)36 b Fu(instead)h(of)f +(exiting)i(imme-)330 4266 y(diately)f(when)e(it)i(receiv)m(es)h(an)e +Ft(EOF)f Fu(on)h(its)g(standard)f(input)g(when)h(reading)g(a)g(command) +g(\(see)330 4376 y(Section)31 b(4.3.1)h([The)e(Set)h(Builtin],)g(page)g +(58\).)199 4507 y(7.)61 b(Command)43 b(history)h(\(see)h(Section)g(9.1) +g([Bash)f(History)h(F)-8 b(acilities],)51 b(page)45 b(133\))h(and)d +(history)330 4617 y(expansion)h(\(see)i(Section)f(9.3)h([History)g(In)m +(teraction],)k(page)45 b(135\))h(are)f(enabled)g(b)m(y)f(default.)330 +4726 y(Bash)28 b(will)g(sa)m(v)m(e)h(the)f(command)f(history)h(to)g +(the)g(\014le)g(named)f(b)m(y)h Ft($HISTFILE)d Fu(when)h(a)i(shell)g +(with)330 4836 y(history)i(enabled)h(exits.)199 4967 +y(8.)61 b(Alias)31 b(expansion)g(\(see)g(Section)g(6.6)g([Aliases],)i +(page)e(88\))h(is)e(p)s(erformed)f(b)m(y)h(default.)199 +5099 y(9.)61 b(In)24 b(the)g(absence)h(of)f(an)m(y)h(traps,)g(Bash)g +(ignores)f Ft(SIGTERM)f Fu(\(see)i(Section)g(3.7.6)h([Signals],)g(page) +f(38\).)154 5230 y(10.)61 b(In)26 b(the)h(absence)h(of)f(an)m(y)g +(traps,)g Ft(SIGINT)e Fu(is)i(caugh)m(t)h(and)f(handled)e(\(\(see)k +(Section)e(3.7.6)i([Signals],)330 5340 y(page)i(38\).)42 +b Ft(SIGINT)29 b Fu(will)h(in)m(terrupt)g(some)h(shell)g(builtins.)p +eop end +%%Page: 85 91 +TeXDict begin 85 90 bop 150 -116 a Fu(Chapter)30 b(6:)41 +b(Bash)30 b(F)-8 b(eatures)2484 b(85)154 299 y(11.)61 +b(An)40 b(in)m(teractiv)m(e)j(login)e(shell)g(sends)e(a)i +Ft(SIGHUP)d Fu(to)j(all)g(jobs)f(on)g(exit)h(if)g(the)f +Ft(huponexit)e Fu(shell)330 408 y(option)31 b(has)f(b)s(een)g(enabled)g +(\(see)h(Section)g(3.7.6)i([Signals],)e(page)g(38\).)154 +542 y(12.)61 b(The)29 b Ft(-n)g Fu(in)m(v)m(o)s(cation)j(option)e(is)g +(ignored,)g(and)f(`)p Ft(set)h(-n)p Fu(')f(has)h(no)f(e\013ect)j(\(see) +e(Section)h(4.3.1)g([The)330 652 y(Set)g(Builtin],)g(page)g(58\).)154 +785 y(13.)61 b(Bash)32 b(will)g(c)m(hec)m(k)i(for)e(mail)g(p)s(erio)s +(dically)-8 b(,)34 b(dep)s(ending)c(on)i(the)g(v)-5 b(alues)32 +b(of)g(the)h Ft(MAIL)p Fu(,)e Ft(MAILPATH)p Fu(,)330 +895 y(and)f Ft(MAILCHECK)e Fu(shell)i(v)-5 b(ariables)31 +b(\(see)h(Section)f(5.2)g([Bash)g(V)-8 b(ariables],)32 +b(page)f(69\).)154 1028 y(14.)61 b(Expansion)32 b(errors)h(due)f(to)i +(references)f(to)h(un)m(b)s(ound)c(shell)j(v)-5 b(ariables)34 +b(after)g(`)p Ft(set)29 b(-u)p Fu(')k(has)g(b)s(een)330 +1138 y(enabled)d(will)h(not)g(cause)g(the)f(shell)h(to)g(exit)g(\(see)g +(Section)h(4.3.1)g([The)e(Set)h(Builtin],)g(page)g(58\).)154 +1271 y(15.)61 b(The)48 b(shell)h(will)f(not)h(exit)g(on)g(expansion)f +(errors)g(caused)g(b)m(y)h Fr(v)-5 b(ar)54 b Fu(b)s(eing)48 +b(unset)g(or)h(n)m(ull)f(in)330 1381 y Ft(${)p Fj(var)p +Ft(:?)p Fj(word)p Ft(})27 b Fu(expansions)j(\(see)h(Section)h(3.5.3)g +([Shell)e(P)m(arameter)i(Expansion],)e(page)h(23\).)154 +1514 y(16.)61 b(Redirection)31 b(errors)f(encoun)m(tered)h(b)m(y)f +(shell)h(builtins)f(will)g(not)h(cause)g(the)f(shell)h(to)g(exit.)154 +1648 y(17.)61 b(When)26 b(running)f(in)i Fm(posix)e Fu(mo)s(de,)j(a)f +(sp)s(ecial)g(builtin)f(returning)g(an)g(error)h(status)g(will)g(not)f +(cause)330 1757 y(the)31 b(shell)f(to)h(exit)h(\(see)f(Section)g(6.11)h +([Bash)f(POSIX)e(Mo)s(de],)i(page)g(94\).)154 1891 y(18.)61 +b(A)34 b(failed)g Ft(exec)f Fu(will)h(not)g(cause)g(the)g(shell)g(to)g +(exit)h(\(see)f(Section)h(4.1)g([Bourne)f(Shell)f(Builtins],)330 +2000 y(page)e(41\).)154 2134 y(19.)61 b(P)m(arser)31 +b(syn)m(tax)f(errors)g(will)h(not)g(cause)g(the)f(shell)h(to)g(exit.) +154 2267 y(20.)61 b(Simple)21 b(sp)s(elling)h(correction)g(for)g +(directory)g(argumen)m(ts)f(to)i(the)e Ft(cd)g Fu(builtin)g(is)h +(enabled)f(b)m(y)h(default)330 2377 y(\(see)35 b(the)g(description)f +(of)h(the)f Ft(cdspell)f Fu(option)h(to)i(the)e Ft(shopt)f +Fu(builtin)h(in)g(Section)h(4.3.2)h([The)330 2486 y(Shopt)30 +b(Builtin],)h(page)g(62\).)154 2620 y(21.)61 b(The)42 +b(shell)h(will)g(c)m(hec)m(k)h(the)f(v)-5 b(alue)43 b(of)f(the)h +Ft(TMOUT)e Fu(v)-5 b(ariable)44 b(and)e(exit)h(if)g(a)g(command)f(is)h +(not)330 2729 y(read)30 b(within)g(the)g(sp)s(eci\014ed)f(n)m(um)m(b)s +(er)g(of)i(seconds)f(after)g(prin)m(ting)g Ft($PS1)f +Fu(\(see)i(Section)g(5.2)h([Bash)330 2839 y(V)-8 b(ariables],)32 +b(page)f(69\).)150 3069 y Fs(6.4)68 b(Bash)45 b(Conditional)h +(Expressions)150 3229 y Fu(Conditional)26 b(expressions)g(are)g(used)f +(b)m(y)g(the)h Ft([[)f Fu(comp)s(ound)g(command)g(and)g(the)h +Ft(test)f Fu(and)g Ft([)g Fu(builtin)150 3338 y(commands.)275 +3472 y(Expressions)32 b(ma)m(y)h(b)s(e)g(unary)f(or)h(binary)-8 +b(.)48 b(Unary)33 b(expressions)f(are)i(often)f(used)f(to)i(examine)g +(the)150 3581 y(status)i(of)g(a)g(\014le.)57 b(There)35 +b(are)h(string)g(op)s(erators)g(and)f(n)m(umeric)h(comparison)g(op)s +(erators)g(as)g(w)m(ell.)57 b(If)150 3691 y(the)27 b +Fr(\014le)33 b Fu(argumen)m(t)28 b(to)g(one)f(of)g(the)h(primaries)f +(is)g(of)g(the)h(form)f Ft(/dev/fd/)p Fj(N)p Fu(,)e(then)i(\014le)h +(descriptor)f Fr(N)37 b Fu(is)150 3800 y(c)m(hec)m(k)m(ed.)51 +b(If)32 b(the)h Fr(\014le)39 b Fu(argumen)m(t)33 b(to)h(one)f(of)g(the) +g(primaries)g(is)g(one)g(of)h Ft(/dev/stdin)p Fu(,)d +Ft(/dev/stdout)p Fu(,)150 3910 y(or)f Ft(/dev/stderr)p +Fu(,)e(\014le)i(descriptor)h(0,)g(1,)g(or)f(2,)h(resp)s(ectiv)m(ely)-8 +b(,)32 b(is)f(c)m(hec)m(k)m(ed.)275 4043 y(When)37 b(used)g(with)g +Ft([[)p Fu(,)i(the)f(`)p Ft(<)p Fu(')g(and)f(`)p Ft(>)p +Fu(')h(op)s(erators)g(sort)g(lexicographically)i(using)d(the)h(curren)m +(t)150 4153 y(lo)s(cale.)k(The)30 b Ft(test)f Fu(command)i(uses)f(ASCI) +s(I)e(ordering.)275 4287 y(Unless)44 b(otherwise)h(sp)s(eci\014ed,)j +(primaries)c(that)h(op)s(erate)g(on)g(\014les)f(follo)m(w)i(sym)m(b)s +(olic)f(links)g(and)150 4396 y(op)s(erate)31 b(on)f(the)h(target)h(of)e +(the)h(link,)f(rather)h(than)f(the)g(link)h(itself.)150 +4553 y Ft(-a)f Fj(file)162 b Fu(T)-8 b(rue)30 b(if)g +Fr(\014le)36 b Fu(exists.)150 4711 y Ft(-b)30 b Fj(file)162 +b Fu(T)-8 b(rue)30 b(if)g Fr(\014le)36 b Fu(exists)31 +b(and)f(is)g(a)h(blo)s(c)m(k)g(sp)s(ecial)g(\014le.)150 +4868 y Ft(-c)f Fj(file)162 b Fu(T)-8 b(rue)30 b(if)g +Fr(\014le)36 b Fu(exists)31 b(and)f(is)g(a)h(c)m(haracter)h(sp)s(ecial) +f(\014le.)150 5025 y Ft(-d)f Fj(file)162 b Fu(T)-8 b(rue)30 +b(if)g Fr(\014le)36 b Fu(exists)31 b(and)f(is)g(a)h(directory)-8 +b(.)150 5183 y Ft(-e)30 b Fj(file)162 b Fu(T)-8 b(rue)30 +b(if)g Fr(\014le)36 b Fu(exists.)150 5340 y Ft(-f)30 +b Fj(file)162 b Fu(T)-8 b(rue)30 b(if)g Fr(\014le)36 +b Fu(exists)31 b(and)f(is)g(a)h(regular)f(\014le.)p eop +end +%%Page: 86 92 +TeXDict begin 86 91 bop 150 -116 a Fu(Chapter)30 b(6:)41 +b(Bash)30 b(F)-8 b(eatures)2484 b(86)150 299 y Ft(-g)30 +b Fj(file)162 b Fu(T)-8 b(rue)30 b(if)g Fr(\014le)36 +b Fu(exists)31 b(and)f(its)g(set-group-id)h(bit)g(is)f(set.)150 +446 y Ft(-h)g Fj(file)162 b Fu(T)-8 b(rue)30 b(if)g Fr(\014le)36 +b Fu(exists)31 b(and)f(is)g(a)h(sym)m(b)s(olic)g(link.)150 +593 y Ft(-k)f Fj(file)162 b Fu(T)-8 b(rue)30 b(if)g Fr(\014le)36 +b Fu(exists)31 b(and)f(its)g Ft(")p Fu(stic)m(ky)p Ft(")h +Fu(bit)g(is)f(set.)150 740 y Ft(-p)g Fj(file)162 b Fu(T)-8 +b(rue)30 b(if)g Fr(\014le)36 b Fu(exists)31 b(and)f(is)g(a)h(named)f +(pip)s(e)f(\(FIF)m(O\).)150 886 y Ft(-r)h Fj(file)162 +b Fu(T)-8 b(rue)30 b(if)g Fr(\014le)36 b Fu(exists)31 +b(and)f(is)g(readable.)150 1033 y Ft(-s)g Fj(file)162 +b Fu(T)-8 b(rue)30 b(if)g Fr(\014le)36 b Fu(exists)31 +b(and)f(has)g(a)g(size)i(greater)f(than)f(zero.)150 1180 +y Ft(-t)g Fj(fd)258 b Fu(T)-8 b(rue)30 b(if)g(\014le)h(descriptor)f +Fr(fd)j Fu(is)e(op)s(en)e(and)h(refers)g(to)h(a)g(terminal.)150 +1327 y Ft(-u)f Fj(file)162 b Fu(T)-8 b(rue)30 b(if)g +Fr(\014le)36 b Fu(exists)31 b(and)f(its)g(set-user-id)h(bit)f(is)h +(set.)150 1474 y Ft(-w)f Fj(file)162 b Fu(T)-8 b(rue)30 +b(if)g Fr(\014le)36 b Fu(exists)31 b(and)f(is)g(writable.)150 +1621 y Ft(-x)g Fj(file)162 b Fu(T)-8 b(rue)30 b(if)g +Fr(\014le)36 b Fu(exists)31 b(and)f(is)g(executable.)150 +1768 y Ft(-G)g Fj(file)162 b Fu(T)-8 b(rue)30 b(if)g +Fr(\014le)36 b Fu(exists)31 b(and)f(is)g(o)m(wned)g(b)m(y)h(the)f +(e\013ectiv)m(e)j(group)d(id.)150 1915 y Ft(-L)g Fj(file)162 +b Fu(T)-8 b(rue)30 b(if)g Fr(\014le)36 b Fu(exists)31 +b(and)f(is)g(a)h(sym)m(b)s(olic)g(link.)150 2062 y Ft(-N)f +Fj(file)162 b Fu(T)-8 b(rue)30 b(if)g Fr(\014le)36 b +Fu(exists)31 b(and)f(has)g(b)s(een)f(mo)s(di\014ed)h(since)g(it)h(w)m +(as)g(last)g(read.)150 2209 y Ft(-O)f Fj(file)162 b Fu(T)-8 +b(rue)30 b(if)g Fr(\014le)36 b Fu(exists)31 b(and)f(is)g(o)m(wned)g(b)m +(y)h(the)f(e\013ectiv)m(e)j(user)d(id.)150 2355 y Ft(-S)g +Fj(file)162 b Fu(T)-8 b(rue)30 b(if)g Fr(\014le)36 b +Fu(exists)31 b(and)f(is)g(a)h(so)s(c)m(k)m(et.)150 2502 +y Fj(file1)e Ft(-ef)g Fj(file2)630 2612 y Fu(T)-8 b(rue)30 +b(if)g Fr(\014le1)38 b Fu(and)30 b Fr(\014le2)38 b Fu(refer)30 +b(to)i(the)e(same)h(device)g(and)f(ino)s(de)g(n)m(um)m(b)s(ers.)150 +2759 y Fj(file1)f Ft(-nt)g Fj(file2)630 2868 y Fu(T)-8 +b(rue)23 b(if)h Fr(\014le1)32 b Fu(is)24 b(new)m(er)g(\(according)h(to) +g(mo)s(di\014cation)f(date\))h(than)f Fr(\014le2)p Fu(,)i(or)e(if)g +Fr(\014le1)31 b Fu(exists)630 2978 y(and)f Fr(\014le2)38 +b Fu(do)s(es)30 b(not.)150 3125 y Fj(file1)f Ft(-ot)g +Fj(file2)630 3234 y Fu(T)-8 b(rue)30 b(if)g Fr(\014le1)38 +b Fu(is)31 b(older)f(than)g Fr(\014le2)p Fu(,)i(or)e(if)g +Fr(\014le2)38 b Fu(exists)31 b(and)f Fr(\014le1)38 b +Fu(do)s(es)30 b(not.)150 3381 y Ft(-o)g Fj(optname)630 +3491 y Fu(T)-8 b(rue)41 b(if)g(the)g(shell)h(option)f +Fr(optname)47 b Fu(is)41 b(enabled.)73 b(The)41 b(list)h(of)f(options)h +(app)s(ears)e(in)630 3601 y(the)33 b(description)h(of)f(the)g +Ft(-o)g Fu(option)g(to)h(the)g Ft(set)e Fu(builtin)h(\(see)h(Section)g +(4.3.1)h([The)e(Set)630 3710 y(Builtin],)e(page)g(58\).)150 +3857 y Ft(-v)f Fj(varname)630 3967 y Fu(T)-8 b(rue)30 +b(if)g(the)h(shell)f(v)-5 b(ariable)32 b Fr(v)-5 b(arname)35 +b Fu(is)30 b(set)h(\(has)g(b)s(een)e(assigned)i(a)g(v)-5 +b(alue\).)150 4114 y Ft(-R)30 b Fj(varname)630 4223 y +Fu(T)-8 b(rue)30 b(if)g(the)h(shell)f(v)-5 b(ariable)32 +b Fr(v)-5 b(arname)35 b Fu(is)30 b(set)h(and)f(is)h(a)f(name)h +(reference.)150 4370 y Ft(-z)f Fj(string)66 b Fu(T)-8 +b(rue)30 b(if)g(the)h(length)g(of)f Fr(string)38 b Fu(is)31 +b(zero.)150 4517 y Ft(-n)f Fj(string)150 4626 y(string)192 +b Fu(T)-8 b(rue)30 b(if)g(the)h(length)g(of)f Fr(string)38 +b Fu(is)31 b(non-zero.)150 4773 y Fj(string1)d Ft(==)i +Fj(string2)150 4883 y(string1)e Ft(=)i Fj(string2)630 +4993 y Fu(T)-8 b(rue)43 b(if)h(the)g(strings)g(are)g(equal.)82 +b(When)44 b(used)f(with)g(the)h Ft([[)g Fu(command,)j(this)d(p)s(er-) +630 5102 y(forms)d(pattern)g(matc)m(hing)i(as)f(describ)s(ed)e(ab)s(o)m +(v)m(e)j(\(see)f(Section)g(3.2.4.2)i([Conditional)630 +5212 y(Constructs],)30 b(page)h(10\).)630 5340 y(`)p +Ft(=)p Fu(')g(should)e(b)s(e)h(used)f(with)h(the)h Ft(test)e +Fu(command)h(for)g Fm(posix)g Fu(conformance.)p eop end +%%Page: 87 93 +TeXDict begin 87 92 bop 150 -116 a Fu(Chapter)30 b(6:)41 +b(Bash)30 b(F)-8 b(eatures)2484 b(87)150 299 y Fj(string1)28 +b Ft(!=)i Fj(string2)630 408 y Fu(T)-8 b(rue)30 b(if)g(the)h(strings)f +(are)h(not)f(equal.)150 563 y Fj(string1)e Ft(<)i Fj(string2)630 +673 y Fu(T)-8 b(rue)30 b(if)g Fr(string1)38 b Fu(sorts)31 +b(b)s(efore)f Fr(string2)38 b Fu(lexicographically)-8 +b(.)150 828 y Fj(string1)28 b Ft(>)i Fj(string2)630 937 +y Fu(T)-8 b(rue)30 b(if)g Fr(string1)38 b Fu(sorts)31 +b(after)g Fr(string2)38 b Fu(lexicographically)-8 b(.)150 +1092 y Fj(arg1)29 b Ft(OP)h Fj(arg2)630 1202 y Ft(OP)j +Fu(is)h(one)g(of)h(`)p Ft(-eq)p Fu(',)f(`)p Ft(-ne)p +Fu(',)h(`)p Ft(-lt)p Fu(',)g(`)p Ft(-le)p Fu(',)f(`)p +Ft(-gt)p Fu(',)h(or)f(`)p Ft(-ge)p Fu('.)51 b(These)34 +b(arithmetic)h(binary)630 1311 y(op)s(erators)h(return)e(true)i(if)f +Fr(arg1)44 b Fu(is)36 b(equal)g(to,)i(not)e(equal)g(to,)i(less)e(than,) +h(less)f(than)f(or)630 1421 y(equal)29 b(to,)g(greater)h(than,)e(or)g +(greater)i(than)d(or)i(equal)f(to)h Fr(arg2)p Fu(,)h(resp)s(ectiv)m +(ely)-8 b(.)42 b Fr(Arg1)36 b Fu(and)630 1531 y Fr(arg2)j +Fu(ma)m(y)30 b(b)s(e)g(p)s(ositiv)m(e)i(or)e(negativ)m(e)j(in)m +(tegers.)150 1758 y Fs(6.5)68 b(Shell)45 b(Arithmetic)150 +1918 y Fu(The)35 b(shell)g(allo)m(ws)i(arithmetic)f(expressions)f(to)h +(b)s(e)f(ev)-5 b(aluated,)38 b(as)d(one)h(of)f(the)h(shell)f +(expansions)g(or)150 2027 y(b)m(y)30 b(the)h Ft(let)e +Fu(and)h(the)h Ft(-i)e Fu(option)i(to)g(the)g Ft(declare)d +Fu(builtins.)275 2160 y(Ev)-5 b(aluation)27 b(is)g(done)f(in)g +(\014xed-width)g(in)m(tegers)i(with)e(no)h(c)m(hec)m(k)h(for)e(o)m(v)m +(er\015o)m(w,)j(though)d(division)h(b)m(y)150 2269 y(0)g(is)g(trapp)s +(ed)f(and)h(\015agged)g(as)h(an)f(error.)39 b(The)26 +b(op)s(erators)h(and)g(their)g(precedence,)h(asso)s(ciativit)m(y)-8 +b(,)32 b(and)150 2379 y(v)-5 b(alues)35 b(are)h(the)f(same)g(as)h(in)e +(the)h(C)g(language.)56 b(The)35 b(follo)m(wing)h(list)g(of)f(op)s +(erators)g(is)g(group)s(ed)f(in)m(to)150 2488 y(lev)m(els)27 +b(of)f(equal-precedence)i(op)s(erators.)39 b(The)25 b(lev)m(els)j(are)e +(listed)h(in)e(order)h(of)g(decreasing)g(precedence.)150 +2643 y Fj(id)p Ft(++)j Fj(id)p Ft(--)67 b Fu(v)-5 b(ariable)31 +b(p)s(ost-incremen)m(t)g(and)f(p)s(ost-decremen)m(t)150 +2798 y Ft(++)p Fj(id)f Ft(--)p Fj(id)67 b Fu(v)-5 b(ariable)31 +b(pre-incremen)m(t)g(and)f(pre-decremen)m(t)150 2953 +y Ft(-)g(+)354 b Fu(unary)29 b(min)m(us)h(and)g(plus)150 +3108 y Ft(!)g(~)354 b Fu(logical)33 b(and)d(bit)m(wise)h(negation)150 +3263 y Ft(**)384 b Fu(exp)s(onen)m(tiation)150 3417 y +Ft(*)30 b(/)g(\045)276 b Fu(m)m(ultiplication,)33 b(division,)d +(remainder)150 3572 y Ft(+)g(-)354 b Fu(addition,)31 +b(subtraction)150 3727 y Ft(<<)f(>>)258 b Fu(left)31 +b(and)f(righ)m(t)h(bit)m(wise)g(shifts)150 3882 y Ft(<=)f(>=)g(<)g(>) +102 b Fu(comparison)150 4037 y Ft(==)30 b(!=)258 b Fu(equalit)m(y)32 +b(and)e(inequalit)m(y)150 4192 y Ft(&)432 b Fu(bit)m(wise)31 +b(AND)150 4347 y Ft(^)432 b Fu(bit)m(wise)31 b(exclusiv)m(e)h(OR)150 +4501 y Ft(|)432 b Fu(bit)m(wise)31 b(OR)150 4656 y Ft(&&)384 +b Fu(logical)33 b(AND)150 4811 y Ft(||)384 b Fu(logical)33 +b(OR)150 4966 y Ft(expr)c(?)h(expr)f(:)h(expr)630 5076 +y Fu(conditional)i(op)s(erator)150 5230 y Ft(=)e(*=)g(/=)g(\045=)f(+=)h +(-=)g(<<=)f(>>=)h(&=)g(^=)f(|=)630 5340 y Fu(assignmen)m(t)p +eop end +%%Page: 88 94 +TeXDict begin 88 93 bop 150 -116 a Fu(Chapter)30 b(6:)41 +b(Bash)30 b(F)-8 b(eatures)2484 b(88)150 299 y Ft(expr1)29 +b(,)h(expr2)630 408 y Fu(comma)275 574 y(Shell)38 b(v)-5 +b(ariables)39 b(are)g(allo)m(w)m(ed)i(as)e(op)s(erands;)i(parameter)e +(expansion)g(is)f(p)s(erformed)g(b)s(efore)g(the)150 +684 y(expression)g(is)g(ev)-5 b(aluated.)66 b(Within)38 +b(an)h(expression,)h(shell)e(v)-5 b(ariables)39 b(ma)m(y)g(also)g(b)s +(e)f(referenced)g(b)m(y)150 793 y(name)31 b(without)f(using)g(the)h +(parameter)g(expansion)f(syn)m(tax.)42 b(A)31 b(shell)f(v)-5 +b(ariable)32 b(that)f(is)f(n)m(ull)h(or)f(unset)150 903 +y(ev)-5 b(aluates)41 b(to)f(0)g(when)e(referenced)h(b)m(y)g(name)h +(without)f(using)g(the)g(parameter)h(expansion)f(syn)m(tax.)150 +1012 y(The)c(v)-5 b(alue)37 b(of)f(a)h(v)-5 b(ariable)36 +b(is)g(ev)-5 b(aluated)38 b(as)e(an)g(arithmetic)h(expression)f(when)f +(it)h(is)g(referenced,)i(or)150 1122 y(when)31 b(a)i(v)-5 +b(ariable)33 b(whic)m(h)f(has)g(b)s(een)f(giv)m(en)j(the)e +Fr(in)m(teger)40 b Fu(attribute)33 b(using)f(`)p Ft(declare)d(-i)p +Fu(')i(is)i(assigned)150 1232 y(a)j(v)-5 b(alue.)58 b(A)36 +b(n)m(ull)f(v)-5 b(alue)37 b(ev)-5 b(aluates)37 b(to)g(0.)57 +b(A)36 b(shell)g(v)-5 b(ariable)37 b(need)e(not)h(ha)m(v)m(e)h(its)f +Fr(in)m(teger)44 b Fu(attribute)150 1341 y(turned)29 +b(on)h(to)i(b)s(e)d(used)h(in)g(an)g(expression.)275 +1480 y(Constan)m(ts)41 b(with)g(a)h(leading)f(0)h(are)g(in)m(terpreted) +f(as)g(o)s(ctal)i(n)m(um)m(b)s(ers.)72 b(A)41 b(leading)h(`)p +Ft(0x)p Fu(')f(or)g(`)p Ft(0X)p Fu(')150 1589 y(denotes)30 +b(hexadecimal.)42 b(Otherwise,)30 b(n)m(um)m(b)s(ers)f(tak)m(e)i(the)f +(form)g([)p Fr(base)5 b Ft(#)p Fu(])p Fr(n)p Fu(,)30 +b(where)f(the)i(optional)g Fr(base)150 1699 y Fu(is)e(a)h(decimal)g(n)m +(um)m(b)s(er)e(b)s(et)m(w)m(een)h(2)h(and)e(64)i(represen)m(ting)g(the) +f(arithmetic)i(base,)e(and)g Fr(n)g Fu(is)g(a)g(n)m(um)m(b)s(er)150 +1809 y(in)e(that)h(base.)40 b(If)26 b Fr(base)5 b Ft(#)27 +b Fu(is)h(omitted,)h(then)e(base)g(10)h(is)f(used.)39 +b(When)27 b(sp)s(ecifying)g Fr(n)p Fu(,)h(he)f(digits)h(greater)150 +1918 y(than)33 b(9)h(are)g(represen)m(ted)g(b)m(y)f(the)h(lo)m(w)m +(ercase)i(letters,)g(the)d(upp)s(ercase)g(letters,)j(`)p +Ft(@)p Fu(',)e(and)f(`)p Ft(_)p Fu(',)i(in)e(that)150 +2028 y(order.)69 b(If)39 b Fr(base)45 b Fu(is)40 b(less)g(than)g(or)f +(equal)i(to)f(36,)k(lo)m(w)m(ercase)e(and)d(upp)s(ercase)g(letters)i +(ma)m(y)g(b)s(e)e(used)150 2137 y(in)m(terc)m(hangeably)32 +b(to)f(represen)m(t)g(n)m(um)m(b)s(ers)e(b)s(et)m(w)m(een)i(10)g(and)f +(35.)275 2276 y(Op)s(erators)44 b(are)h(ev)-5 b(aluated)46 +b(in)f(order)f(of)h(precedence.)85 b(Sub-expressions)44 +b(in)g(paren)m(theses)i(are)150 2386 y(ev)-5 b(aluated)32 +b(\014rst)d(and)h(ma)m(y)h(o)m(v)m(erride)g(the)g(precedence)g(rules)f +(ab)s(o)m(v)m(e.)150 2624 y Fs(6.6)68 b(Aliases)150 2784 +y Fr(Aliases)41 b Fu(allo)m(w)d(a)f(string)f(to)h(b)s(e)f(substituted)g +(for)g(a)g(w)m(ord)g(when)g(it)h(is)f(used)f(as)i(the)g(\014rst)e(w)m +(ord)h(of)h(a)150 2893 y(simple)32 b(command.)45 b(The)31 +b(shell)i(main)m(tains)f(a)h(list)f(of)g(aliases)i(that)e(ma)m(y)h(b)s +(e)e(set)h(and)g(unset)f(with)h(the)150 3003 y Ft(alias)d +Fu(and)h Ft(unalias)e Fu(builtin)i(commands.)275 3142 +y(The)f(\014rst)f(w)m(ord)i(of)f(eac)m(h)i(simple)f(command,)g(if)f +(unquoted,)g(is)h(c)m(hec)m(k)m(ed)h(to)g(see)f(if)g(it)g(has)f(an)g +(alias.)150 3251 y(If)24 b(so,)i(that)g(w)m(ord)e(is)h(replaced)g(b)m +(y)f(the)h(text)h(of)e(the)h(alias.)40 b(The)24 b(c)m(haracters)i(`)p +Ft(/)p Fu(',)h(`)p Ft($)p Fu(',)f(`)p Ft(`)p Fu(',)g(`)p +Ft(=)p Fu(')f(and)f(an)m(y)h(of)150 3361 y(the)e(shell)g(metac)m +(haracters)i(or)e(quoting)g(c)m(haracters)h(listed)g(ab)s(o)m(v)m(e)g +(ma)m(y)f(not)g(app)s(ear)f(in)h(an)g(alias)h(name.)150 +3470 y(The)e(replacemen)m(t)h(text)g(ma)m(y)g(con)m(tain)h(an)m(y)e(v) +-5 b(alid)23 b(shell)f(input,)h(including)f(shell)g(metac)m(haracters.) +40 b(The)150 3580 y(\014rst)35 b(w)m(ord)g(of)h(the)g(replacemen)m(t)i +(text)e(is)g(tested)h(for)e(aliases,)k(but)c(a)h(w)m(ord)g(that)g(is)g +(iden)m(tical)i(to)e(an)150 3689 y(alias)c(b)s(eing)f(expanded)f(is)h +(not)g(expanded)f(a)h(second)g(time.)43 b(This)30 b(means)h(that)g(one) +g(ma)m(y)h(alias)g Ft(ls)e Fu(to)150 3799 y Ft("ls)f(-F")p +Fu(,)f(for)f(instance,)i(and)d(Bash)i(do)s(es)f(not)h(try)f(to)h +(recursiv)m(ely)g(expand)e(the)i(replacemen)m(t)h(text.)40 +b(If)150 3909 y(the)31 b(last)h(c)m(haracter)h(of)e(the)h(alias)g(v)-5 +b(alue)31 b(is)h(a)f Fr(blank)p Fu(,)g(then)g(the)g(next)h(command)e(w) +m(ord)h(follo)m(wing)i(the)150 4018 y(alias)f(is)e(also)h(c)m(hec)m(k)m +(ed)i(for)d(alias)h(expansion.)275 4157 y(Aliases)e(are)f(created)i +(and)d(listed)i(with)f(the)g Ft(alias)f Fu(command,)h(and)g(remo)m(v)m +(ed)h(with)f(the)g Ft(unalias)150 4267 y Fu(command.)275 +4405 y(There)44 b(is)h(no)g(mec)m(hanism)g(for)f(using)h(argumen)m(ts)g +(in)f(the)h(replacemen)m(t)i(text,)i(as)d(in)e Ft(csh)p +Fu(.)83 b(If)150 4515 y(argumen)m(ts)37 b(are)h(needed,)g(a)g(shell)f +(function)f(should)g(b)s(e)h(used)f(\(see)i(Section)g(3.3)g([Shell)f(F) +-8 b(unctions],)150 4624 y(page)31 b(17\).)275 4763 y(Aliases)i(are)h +(not)e(expanded)g(when)g(the)h(shell)g(is)g(not)g(in)m(teractiv)m(e,)j +(unless)c(the)h Ft(expand_aliases)150 4873 y Fu(shell)e(option)f(is)h +(set)g(using)f Ft(shopt)f Fu(\(see)i(Section)g(4.3.2)h([The)e(Shopt)g +(Builtin],)h(page)g(62\).)275 5011 y(The)38 b(rules)h(concerning)h(the) +f(de\014nition)g(and)g(use)g(of)g(aliases)i(are)e(somewhat)h +(confusing.)67 b(Bash)150 5121 y(alw)m(a)m(ys)42 b(reads)f(at)h(least)g +(one)f(complete)i(line)e(of)g(input)f(b)s(efore)h(executing)h(an)m(y)f +(of)g(the)g(commands)150 5230 y(on)h(that)h(line.)77 +b(Aliases)44 b(are)e(expanded)g(when)f(a)i(command)f(is)g(read,)k(not)c +(when)g(it)g(is)h(executed.)150 5340 y(Therefore,)f(an)e(alias)h +(de\014nition)e(app)s(earing)h(on)f(the)h(same)h(line)f(as)g(another)g +(command)f(do)s(es)h(not)p eop end +%%Page: 89 95 +TeXDict begin 89 94 bop 150 -116 a Fu(Chapter)30 b(6:)41 +b(Bash)30 b(F)-8 b(eatures)2484 b(89)150 299 y(tak)m(e)31 +b(e\013ect)f(un)m(til)g(the)f(next)g(line)h(of)f(input)f(is)h(read.)41 +b(The)28 b(commands)h(follo)m(wing)i(the)e(alias)h(de\014nition)150 +408 y(on)d(that)h(line)f(are)h(not)f(a\013ected)i(b)m(y)e(the)g(new)g +(alias.)41 b(This)26 b(b)s(eha)m(vior)h(is)g(also)h(an)f(issue)g(when)f +(functions)150 518 y(are)d(executed.)39 b(Aliases)24 +b(are)f(expanded)f(when)f(a)i(function)g(de\014nition)f(is)h(read,)h +(not)f(when)e(the)i(function)150 628 y(is)i(executed,)j(b)s(ecause)d(a) +h(function)f(de\014nition)f(is)i(itself)g(a)f(comp)s(ound)f(command.)39 +b(As)25 b(a)h(consequence,)150 737 y(aliases)36 b(de\014ned)d(in)h(a)g +(function)g(are)h(not)f(a)m(v)-5 b(ailable)37 b(un)m(til)d(after)h +(that)g(function)f(is)g(executed.)53 b(T)-8 b(o)35 b(b)s(e)150 +847 y(safe,)41 b(alw)m(a)m(ys)f(put)d(alias)j(de\014nitions)e(on)g(a)h +(separate)g(line,)i(and)d(do)g(not)g(use)g Ft(alias)f +Fu(in)h(comp)s(ound)150 956 y(commands.)275 1094 y(F)-8 +b(or)31 b(almost)g(ev)m(ery)g(purp)s(ose,)e(shell)i(functions)f(are)g +(preferred)g(o)m(v)m(er)h(aliases.)150 1332 y Fs(6.7)68 +b(Arra)l(ys)150 1491 y Fu(Bash)33 b(pro)m(vides)g(one-dimensional)g +(indexed)f(and)h(asso)s(ciativ)m(e)i(arra)m(y)e(v)-5 +b(ariables.)49 b(An)m(y)33 b(v)-5 b(ariable)33 b(ma)m(y)150 +1601 y(b)s(e)e(used)h(as)g(an)g(indexed)f(arra)m(y;)j(the)e +Ft(declare)e Fu(builtin)h(will)i(explicitly)g(declare)g(an)f(arra)m(y) +-8 b(.)46 b(There)32 b(is)150 1710 y(no)h(maxim)m(um)g(limit)h(on)f +(the)g(size)h(of)g(an)f(arra)m(y)-8 b(,)35 b(nor)d(an)m(y)i(requiremen) +m(t)f(that)h(mem)m(b)s(ers)e(b)s(e)g(indexed)150 1820 +y(or)26 b(assigned)h(con)m(tiguously)-8 b(.)41 b(Indexed)25 +b(arra)m(ys)i(are)f(referenced)g(using)g(in)m(tegers)i(\(including)e +(arithmetic)150 1929 y(expressions)38 b(\(see)h(Section)g(6.5)h([Shell) +e(Arithmetic],)k(page)d(87\)\))h(and)d(are)i(zero-based;)k(asso)s +(ciativ)m(e)150 2039 y(arra)m(ys)37 b(use)f(arbitrary)g(strings.)59 +b(Unless)36 b(otherwise)h(noted,)h(indexed)e(arra)m(y)h(indices)f(m)m +(ust)g(b)s(e)g(non-)150 2149 y(negativ)m(e)d(in)m(tegers.)275 +2286 y(An)26 b(indexed)h(arra)m(y)h(is)f(created)h(automatically)j(if)c +(an)m(y)g(v)-5 b(ariable)28 b(is)g(assigned)f(to)h(using)f(the)g(syn)m +(tax)390 2424 y Fj(name)p Ft([)p Fj(subscript)p Ft(]=)p +Fj(value)150 2562 y Fu(The)34 b Fr(subscript)h Fu(is)g(treated)g(as)g +(an)f(arithmetic)i(expression)e(that)h(m)m(ust)g(ev)-5 +b(aluate)36 b(to)f(a)g(n)m(um)m(b)s(er.)51 b(T)-8 b(o)150 +2672 y(explicitly)32 b(declare)f(an)g(arra)m(y)-8 b(,)31 +b(use)390 2809 y Ft(declare)46 b(-a)h Fj(name)150 2947 +y Fu(The)30 b(syn)m(tax)390 3085 y Ft(declare)46 b(-a)h +Fj(name)p Ft([)p Fj(subscript)p Ft(])150 3223 y Fu(is)30 +b(also)i(accepted;)g(the)e Fr(subscript)h Fu(is)g(ignored.)150 +3361 y(Asso)s(ciativ)m(e)i(arra)m(ys)d(are)h(created)h(using)390 +3499 y Ft(declare)46 b(-A)h Fj(name)p Ft(.)275 3636 y +Fu(A)m(ttributes)f(ma)m(y)h(b)s(e)e(sp)s(eci\014ed)g(for)h(an)g(arra)m +(y)g(v)-5 b(ariable)47 b(using)e(the)h Ft(declare)e Fu(and)h +Ft(readonly)150 3746 y Fu(builtins.)40 b(Eac)m(h)31 b(attribute)g +(applies)g(to)g(all)g(mem)m(b)s(ers)f(of)g(an)h(arra)m(y)-8 +b(.)275 3884 y(Arra)m(ys)30 b(are)h(assigned)f(to)h(using)f(comp)s +(ound)f(assignmen)m(ts)i(of)g(the)f(form)390 4022 y Fj(name)p +Ft(=\()p Fj(value1)44 b(value2)j Ft(...)f(\))150 4159 +y Fu(where)38 b(eac)m(h)i Fr(v)-5 b(alue)44 b Fu(is)39 +b(of)g(the)g(form)f Ft([)p Fj(subscript)p Ft(]=)p Fr(string)p +Fu(.)63 b(Indexed)37 b(arra)m(y)j(assignmen)m(ts)f(do)g(not)150 +4269 y(require)31 b(an)m(ything)g(but)f Fr(string)p Fu(.)43 +b(When)31 b(assigning)g(to)h(indexed)e(arra)m(ys,)i(if)f(the)g +(optional)h(subscript)e(is)150 4379 y(supplied,)i(that)h(index)f(is)h +(assigned)g(to;)h(otherwise)f(the)g(index)f(of)h(the)g(elemen)m(t)h +(assigned)f(is)f(the)h(last)150 4488 y(index)d(assigned)h(to)g(b)m(y)f +(the)g(statemen)m(t)j(plus)c(one.)41 b(Indexing)30 b(starts)h(at)g +(zero.)275 4626 y(When)f(assigning)h(to)g(an)f(asso)s(ciativ)m(e)j +(arra)m(y)-8 b(,)32 b(the)e(subscript)f(is)i(required.)275 +4764 y(This)f(syn)m(tax)j(is)e(also)i(accepted)g(b)m(y)f(the)f +Ft(declare)f Fu(builtin.)44 b(Individual)31 b(arra)m(y)h(elemen)m(ts)h +(ma)m(y)g(b)s(e)150 4873 y(assigned)e(to)g(using)f(the)g +Fj(name)p Ft([)p Fj(subscript)p Ft(]=)p Fj(value)25 b +Fu(syn)m(tax)31 b(in)m(tro)s(duced)e(ab)s(o)m(v)m(e.)275 +5011 y(When)h(assigning)h(to)h(an)e(indexed)g(arra)m(y)-8 +b(,)32 b(if)f Fr(name)36 b Fu(is)31 b(subscripted)e(b)m(y)i(a)g +(negativ)m(e)i(n)m(um)m(b)s(er,)c(that)150 5121 y(n)m(um)m(b)s(er)43 +b(is)h(in)m(terpreted)h(as)f(relativ)m(e)j(to)e(one)f(greater)i(than)e +(the)g(maxim)m(um)g(index)g(of)h Fr(name)p Fu(,)j(so)150 +5230 y(negativ)m(e)30 b(indices)d(coun)m(t)h(bac)m(k)g(from)f(the)g +(end)g(of)g(the)h(arra)m(y)-8 b(,)29 b(and)e(an)g(index)g(of)g(-1)h +(references)g(the)f(last)150 5340 y(elemen)m(t.)p eop +end +%%Page: 90 96 +TeXDict begin 90 95 bop 150 -116 a Fu(Chapter)30 b(6:)41 +b(Bash)30 b(F)-8 b(eatures)2484 b(90)275 299 y(An)m(y)28 +b(elemen)m(t)h(of)g(an)f(arra)m(y)g(ma)m(y)h(b)s(e)f(referenced)g +(using)g Ft(${)p Fj(name)p Ft([)p Fj(subscript)p Ft(]})p +Fu(.)35 b(The)27 b(braces)i(are)150 408 y(required)f(to)j(a)m(v)m(oid)f +(con\015icts)g(with)f(the)h(shell's)f(\014lename)h(expansion)f(op)s +(erators.)41 b(If)28 b(the)i Fr(subscript)g Fu(is)150 +518 y(`)p Ft(@)p Fu(')f(or)h(`)p Ft(*)p Fu(',)f(the)h(w)m(ord)f +(expands)f(to)i(all)g(mem)m(b)s(ers)e(of)i(the)f(arra)m(y)h +Fr(name)p Fu(.)40 b(These)29 b(subscripts)f(di\013er)h(only)150 +628 y(when)36 b(the)g(w)m(ord)g(app)s(ears)g(within)g(double)g(quotes.) +60 b(If)36 b(the)h(w)m(ord)f(is)g(double-quoted,)j Ft(${)p +Fj(name)p Ft([*]})150 737 y Fu(expands)25 b(to)h(a)g(single)h(w)m(ord)e +(with)g(the)h(v)-5 b(alue)26 b(of)g(eac)m(h)h(arra)m(y)f(mem)m(b)s(er)f +(separated)h(b)m(y)g(the)f(\014rst)g(c)m(harac-)150 847 +y(ter)j(of)g(the)h Ft(IFS)e Fu(v)-5 b(ariable,)29 b(and)f +Ft(${)p Fj(name)p Ft([@]})d Fu(expands)i(eac)m(h)i(elemen)m(t)h(of)e +Fr(name)33 b Fu(to)c(a)f(separate)h(w)m(ord.)150 956 +y(When)j(there)h(are)f(no)g(arra)m(y)h(mem)m(b)s(ers,)f +Ft(${)p Fj(name)p Ft([@]})e Fu(expands)h(to)i(nothing.)47 +b(If)31 b(the)i(double-quoted)150 1066 y(expansion)39 +b(o)s(ccurs)h(within)f(a)h(w)m(ord,)i(the)d(expansion)h(of)g(the)f +(\014rst)g(parameter)h(is)g(joined)f(with)h(the)150 1176 +y(b)s(eginning)29 b(part)g(of)h(the)f(original)i(w)m(ord,)e(and)g(the)h +(expansion)f(of)h(the)f(last)i(parameter)e(is)h(joined)f(with)150 +1285 y(the)g(last)h(part)f(of)g(the)g(original)h(w)m(ord.)40 +b(This)28 b(is)h(analogous)h(to)f(the)h(expansion)e(of)h(the)g(sp)s +(ecial)h(param-)150 1395 y(eters)g(`)p Ft(@)p Fu(')f(and)g(`)p +Ft(*)p Fu('.)41 b Ft(${#)p Fj(name)p Ft([)p Fj(subscript)p +Ft(]})24 b Fu(expands)k(to)i(the)g(length)g(of)f Ft(${)p +Fj(name)p Ft([)p Fj(subscript)p Ft(]})p Fu(.)35 b(If)150 +1504 y Fr(subscript)29 b Fu(is)g(`)p Ft(@)p Fu(')f(or)h(`)p +Ft(*)p Fu(',)g(the)g(expansion)f(is)h(the)f(n)m(um)m(b)s(er)g(of)g +(elemen)m(ts)i(in)e(the)h(arra)m(y)-8 b(.)41 b(Referencing)29 +b(an)150 1614 y(arra)m(y)j(v)-5 b(ariable)32 b(without)f(a)h(subscript) +e(is)h(equiv)-5 b(alen)m(t)33 b(to)f(referencing)f(with)g(a)h +(subscript)e(of)h(0.)44 b(If)31 b(the)150 1724 y Fr(subscript)f +Fu(used)e(to)i(reference)g(an)f(elemen)m(t)i(of)e(an)g(indexed)g(arra)m +(y)h(ev)-5 b(aluates)30 b(to)g(a)g(n)m(um)m(b)s(er)e(less)h(than)150 +1833 y(zero,)37 b(it)f(is)f(in)m(terpreted)g(as)g(relativ)m(e)i(to)f +(one)f(greater)i(than)d(the)i(maxim)m(um)e(index)h(of)g(the)g(arra)m(y) +-8 b(,)38 b(so)150 1943 y(negativ)m(e)33 b(indices)e(coun)m(t)h(bac)m +(k)f(from)g(the)g(end)f(of)h(the)g(arra)m(y)-8 b(,)32 +b(and)e(an)h(index)f(of)h(-1)h(refers)e(to)i(the)f(last)150 +2052 y(elemen)m(t.)275 2186 y(An)k(arra)m(y)i(v)-5 b(ariable)37 +b(is)g(considered)f(set)h(if)f(a)h(subscript)e(has)h(b)s(een)g +(assigned)g(a)h(v)-5 b(alue.)59 b(The)36 b(n)m(ull)150 +2295 y(string)30 b(is)h(a)g(v)-5 b(alid)30 b(v)-5 b(alue.)275 +2429 y(It)29 b(is)h(p)s(ossible)f(to)h(obtain)g(the)f(k)m(eys)i +(\(indices\))f(of)f(an)h(arra)m(y)g(as)f(w)m(ell)i(as)f(the)f(v)-5 +b(alues.)41 b($)p Fi({)p Fu(!)p Fr(name)5 b Fu([@])p +Fi(})150 2538 y Fu(and)39 b($)p Fi({)p Fu(!)p Fr(name)5 +b Fu([*])p Fi(})43 b Fu(expand)c(to)i(the)f(indices)h(assigned)f(in)g +(arra)m(y)g(v)-5 b(ariable)41 b Fr(name)p Fu(.)70 b(The)39 +b(treatmen)m(t)150 2648 y(when)i(in)g(double)g(quotes)h(is)f(similar)h +(to)h(the)e(expansion)h(of)f(the)h(sp)s(ecial)g(parameters)g(`)p +Ft(@)p Fu(')g(and)f(`)p Ft(*)p Fu(')150 2757 y(within)30 +b(double)g(quotes.)275 2891 y(The)j Ft(unset)g Fu(builtin)h(is)g(used)g +(to)h(destro)m(y)g(arra)m(ys.)52 b Ft(unset)29 b Fj(name)p +Ft([)p Fj(subscript)p Ft(])h Fu(destro)m(ys)35 b(the)g(ar-)150 +3000 y(ra)m(y)j(elemen)m(t)h(at)g(index)e Fr(subscript)p +Fu(.)61 b(Negativ)m(e)41 b(subscripts)36 b(to)i(indexed)g(arra)m(ys)g +(are)g(in)m(terpreted)g(as)150 3110 y(describ)s(ed)f(ab)s(o)m(v)m(e.)67 +b(Care)38 b(m)m(ust)h(b)s(e)f(tak)m(en)h(to)h(a)m(v)m(oid)g(un)m(w)m +(an)m(ted)e(side)h(e\013ects)h(caused)e(b)m(y)h(\014lename)150 +3220 y(expansion.)50 b Ft(unset)29 b Fj(name)p Fu(,)34 +b(where)f Fr(name)39 b Fu(is)34 b(an)f(arra)m(y)-8 b(,)36 +b(remo)m(v)m(es)f(the)f(en)m(tire)g(arra)m(y)-8 b(.)52 +b(A)33 b(subscript)g(of)150 3329 y(`)p Ft(*)p Fu(')e(or)f(`)p +Ft(@)p Fu(')g(also)i(remo)m(v)m(es)f(the)g(en)m(tire)g(arra)m(y)-8 +b(.)275 3463 y(The)20 b Ft(declare)p Fu(,)h Ft(local)p +Fu(,)h(and)e Ft(readonly)f Fu(builtins)h(eac)m(h)i(accept)g(a)g +Ft(-a)e Fu(option)h(to)h(sp)s(ecify)f(an)f(indexed)150 +3572 y(arra)m(y)28 b(and)f(a)h Ft(-A)e Fu(option)i(to)g(sp)s(ecify)f +(an)h(asso)s(ciativ)m(e)i(arra)m(y)-8 b(.)40 b(If)27 +b(b)s(oth)g(options)h(are)g(supplied,)f Ft(-A)f Fu(tak)m(es)150 +3682 y(precedence.)55 b(The)35 b Ft(read)f Fu(builtin)h(accepts)h(a)g +Ft(-a)e Fu(option)i(to)g(assign)f(a)g(list)h(of)f(w)m(ords)g(read)g +(from)g(the)150 3791 y(standard)h(input)g(to)i(an)f(arra)m(y)-8 +b(,)40 b(and)c(can)h(read)g(v)-5 b(alues)38 b(from)e(the)h(standard)g +(input)f(in)m(to)i(individual)150 3901 y(arra)m(y)f(elemen)m(ts.)62 +b(The)36 b Ft(set)g Fu(and)h Ft(declare)d Fu(builtins)j(displa)m(y)g +(arra)m(y)g(v)-5 b(alues)37 b(in)g(a)g(w)m(a)m(y)h(that)g(allo)m(ws)150 +4011 y(them)30 b(to)h(b)s(e)f(reused)g(as)g(input.)150 +4241 y Fs(6.8)68 b(The)45 b(Directory)g(Stac)l(k)150 +4400 y Fu(The)21 b(directory)h(stac)m(k)h(is)e(a)h(list)g(of)f(recen)m +(tly-visited)j(directories.)39 b(The)20 b Ft(pushd)g +Fu(builtin)h(adds)g(directories)150 4510 y(to)42 b(the)f(stac)m(k)i(as) +e(it)h(c)m(hanges)g(the)f(curren)m(t)g(directory)-8 b(,)45 +b(and)40 b(the)i Ft(popd)e Fu(builtin)g(remo)m(v)m(es)j(sp)s(eci\014ed) +150 4620 y(directories)29 b(from)f(the)h(stac)m(k)h(and)d(c)m(hanges)j +(the)e(curren)m(t)g(directory)h(to)g(the)g(directory)f(remo)m(v)m(ed.) +41 b(The)150 4729 y Ft(dirs)29 b Fu(builtin)h(displa)m(ys)h(the)f(con)m +(ten)m(ts)i(of)f(the)f(directory)h(stac)m(k.)275 4863 +y(The)k(con)m(ten)m(ts)i(of)f(the)h(directory)f(stac)m(k)h(are)f(also)h +(visible)g(as)f(the)g(v)-5 b(alue)36 b(of)g(the)g Ft(DIRSTACK)e +Fu(shell)150 4972 y(v)-5 b(ariable.)150 5169 y Fk(6.8.1)63 +b(Directory)40 b(Stac)m(k)g(Builtins)150 5340 y Ft(dirs)p +eop end +%%Page: 91 97 +TeXDict begin 91 96 bop 150 -116 a Fu(Chapter)30 b(6:)41 +b(Bash)30 b(F)-8 b(eatures)2484 b(91)870 299 y Ft(dirs)47 +b([-clpv])e([+)p Fj(N)i Ft(|)h(-)p Fj(N)p Ft(])630 435 +y Fu(Displa)m(y)35 b(the)f(list)g(of)g(curren)m(tly)g(remem)m(b)s(ered) +f(directories.)51 b(Directories)36 b(are)e(added)f(to)630 +545 y(the)28 b(list)h(with)f(the)g Ft(pushd)f Fu(command;)i(the)f +Ft(popd)f Fu(command)h(remo)m(v)m(es)h(directories)g(from)630 +654 y(the)i(list.)630 817 y Ft(-c)384 b Fu(Clears)31 +b(the)f(directory)h(stac)m(k)h(b)m(y)e(deleting)h(all)h(of)e(the)h +(elemen)m(ts.)630 980 y Ft(-l)384 b Fu(Pro)s(duces)31 +b(a)h(listing)h(using)e(full)h(pathnames;)h(the)f(default)g(listing)h +(format)1110 1089 y(uses)d(a)h(tilde)g(to)g(denote)g(the)f(home)h +(directory)-8 b(.)630 1252 y Ft(-p)384 b Fu(Causes)30 +b Ft(dirs)f Fu(to)i(prin)m(t)f(the)h(directory)g(stac)m(k)h(with)e(one) +g(en)m(try)h(p)s(er)e(line.)630 1415 y Ft(-v)384 b Fu(Causes)36 +b Ft(dirs)f Fu(to)i(prin)m(t)f(the)g(directory)h(stac)m(k)h(with)e(one) +h(en)m(try)f(p)s(er)f(line,)1110 1524 y(pre\014xing)30 +b(eac)m(h)h(en)m(try)g(with)f(its)h(index)e(in)i(the)f(stac)m(k.)630 +1687 y Ft(+)p Fj(N)384 b Fu(Displa)m(ys)23 b(the)f Fr(N)10 +b Fu(th)21 b(directory)h(\(coun)m(ting)h(from)e(the)h(left)g(of)g(the)g +(list)g(prin)m(ted)1110 1797 y(b)m(y)30 b Ft(dirs)f Fu(when)h(in)m(v)m +(ok)m(ed)i(without)e(options\),)h(starting)g(with)g(zero.)630 +1959 y Ft(-)p Fj(N)384 b Fu(Displa)m(ys)47 b(the)g Fr(N)10 +b Fu(th)46 b(directory)h(\(coun)m(ting)g(from)f(the)g(righ)m(t)h(of)g +(the)f(list)1110 2069 y(prin)m(ted)25 b(b)m(y)g Ft(dirs)g +Fu(when)f(in)m(v)m(ok)m(ed)j(without)f(options\),)h(starting)g(with)e +(zero.)150 2232 y Ft(popd)870 2368 y(popd)47 b([-n])f([+)p +Fj(N)h Ft(|)h(-)p Fj(N)p Ft(])630 2504 y Fu(Remo)m(v)m(e)26 +b(the)e(top)g(en)m(try)h(from)e(the)h(directory)h(stac)m(k,)i(and)c +Ft(cd)h Fu(to)h(the)f(new)f(top)i(directory)-8 b(.)630 +2614 y(When)32 b(no)g(argumen)m(ts)h(are)g(giv)m(en,)h +Ft(popd)d Fu(remo)m(v)m(es)j(the)f(top)f(directory)h(from)f(the)g(stac) +m(k)630 2723 y(and)f(p)s(erforms)e(a)j Ft(cd)f Fu(to)h(the)f(new)g(top) +h(directory)-8 b(.)44 b(The)31 b(elemen)m(ts)i(are)e(n)m(um)m(b)s(ered) +f(from)630 2833 y(0)j(starting)g(at)g(the)f(\014rst)g(directory)g +(listed)h(with)f Ft(dirs)p Fu(;)g(that)h(is,)g Ft(popd)e +Fu(is)i(equiv)-5 b(alen)m(t)33 b(to)630 2942 y Ft(popd)c(+0)p +Fu(.)630 3105 y Ft(-n)384 b Fu(Suppresses)27 b(the)j(normal)g(c)m +(hange)g(of)g(directory)g(when)e(remo)m(ving)j(directo-)1110 +3215 y(ries)f(from)g(the)h(stac)m(k,)h(so)f(that)g(only)f(the)h(stac)m +(k)g(is)g(manipulated.)630 3377 y Ft(+)p Fj(N)384 b Fu(Remo)m(v)m(es)22 +b(the)f Fr(N)10 b Fu(th)20 b(directory)g(\(coun)m(ting)i(from)e(the)g +(left)h(of)g(the)f(list)h(prin)m(ted)1110 3487 y(b)m(y)30 +b Ft(dirs)p Fu(\),)g(starting)h(with)f(zero.)630 3650 +y Ft(-)p Fj(N)384 b Fu(Remo)m(v)m(es)46 b(the)g Fr(N)10 +b Fu(th)44 b(directory)h(\(coun)m(ting)h(from)f(the)g(righ)m(t)g(of)g +(the)g(list)1110 3759 y(prin)m(ted)30 b(b)m(y)g Ft(dirs)p +Fu(\),)g(starting)h(with)f(zero.)150 3922 y Ft(pushd)870 +4058 y(pushd)46 b([-n])h([+)p Fj(N)g Ft(|)g Fj(-N)h Ft(|)f +Fj(dir)p Ft(])630 4194 y Fu(Sa)m(v)m(e)30 b(the)e(curren)m(t)g +(directory)h(on)f(the)h(top)f(of)h(the)f(directory)h(stac)m(k)h(and)e +(then)g Ft(cd)f Fu(to)i Fr(dir)p Fu(.)630 4304 y(With)i(no)f(argumen)m +(ts,)h Ft(pushd)e Fu(exc)m(hanges)j(the)e(top)h(t)m(w)m(o)h +(directories.)630 4467 y Ft(-n)384 b Fu(Suppresses)26 +b(the)i(normal)h(c)m(hange)g(of)f(directory)h(when)e(adding)h +(directories)1110 4576 y(to)j(the)g(stac)m(k,)h(so)e(that)h(only)g(the) +f(stac)m(k)i(is)f(manipulated.)630 4739 y Ft(+)p Fj(N)384 +b Fu(Brings)29 b(the)f Fr(N)10 b Fu(th)29 b(directory)g(\(coun)m(ting)h +(from)e(the)g(left)i(of)e(the)h(list)g(prin)m(ted)1110 +4848 y(b)m(y)34 b Ft(dirs)p Fu(,)g(starting)h(with)f(zero\))i(to)f(the) +f(top)g(of)h(the)f(list)h(b)m(y)f(rotating)i(the)1110 +4958 y(stac)m(k.)630 5121 y Ft(-)p Fj(N)384 b Fu(Brings)23 +b(the)g Fr(N)10 b Fu(th)23 b(directory)h(\(coun)m(ting)g(from)e(the)i +(righ)m(t)f(of)g(the)h(list)f(prin)m(ted)1110 5230 y(b)m(y)34 +b Ft(dirs)p Fu(,)g(starting)h(with)f(zero\))i(to)f(the)f(top)g(of)h +(the)f(list)h(b)m(y)f(rotating)i(the)1110 5340 y(stac)m(k.)p +eop end +%%Page: 92 98 +TeXDict begin 92 97 bop 150 -116 a Fu(Chapter)30 b(6:)41 +b(Bash)30 b(F)-8 b(eatures)2484 b(92)630 299 y Fj(dir)336 +b Fu(Mak)m(es)31 b(the)g(curren)m(t)f(w)m(orking)g(directory)g(b)s(e)g +(the)g(top)g(of)g(the)h(stac)m(k,)h(mak-)1110 408 y(ing)39 +b(it)g(the)g(new)f(curren)m(t)g(directory)h(as)g(if)g(it)g(had)f(b)s +(een)g(supplied)f(as)i(an)1110 518 y(argumen)m(t)31 b(to)g(the)f +Ft(cd)g Fu(builtin.)150 752 y Fs(6.9)68 b(Con)l(trolling)47 +b(the)e(Prompt)150 911 y Fu(The)24 b(v)-5 b(alue)24 b(of)h(the)f(v)-5 +b(ariable)25 b Ft(PROMPT_COMMAND)20 b Fu(is)25 b(examined)f(just)g(b)s +(efore)f(Bash)i(prin)m(ts)e(eac)m(h)j(primary)150 1021 +y(prompt.)39 b(If)28 b Ft(PROMPT_COMMAND)d Fu(is)j(set)h(and)f(has)g(a) +h(non-n)m(ull)f(v)-5 b(alue,)29 b(then)f(the)h(v)-5 b(alue)29 +b(is)f(executed)i(just)150 1130 y(as)h(if)f(it)h(had)f(b)s(een)f(t)m +(yp)s(ed)h(on)h(the)f(command)g(line.)275 1266 y(In)d(addition,)j(the)f +(follo)m(wing)h(table)f(describ)s(es)f(the)h(sp)s(ecial)g(c)m +(haracters)h(whic)m(h)f(can)f(app)s(ear)g(in)h(the)150 +1375 y(prompt)g(v)-5 b(ariables)32 b Ft(PS1)d Fu(to)i +Ft(PS4)p Fu(:)150 1536 y Ft(\\a)384 b Fu(A)30 b(b)s(ell)h(c)m +(haracter.)150 1696 y Ft(\\d)384 b Fu(The)30 b(date,)h(in)f +Ft(")p Fu(W)-8 b(eekda)m(y)32 b(Mon)m(th)f(Date)p Ft(")h +Fu(format)f(\(e.g.,)h Ft(")p Fu(T)-8 b(ue)30 b(Ma)m(y)h(26)p +Ft(")p Fu(\).)150 1857 y Ft(\\D{)p Fj(format)p Ft(})630 +1966 y Fu(The)c Fr(format)i Fu(is)f(passed)e(to)i Ft(strftime)p +Fu(\(3\))f(and)f(the)i(result)f(is)g(inserted)g(in)m(to)h(the)g(prompt) +630 2076 y(string;)42 b(an)d(empt)m(y)f Fr(format)j Fu(results)d(in)g +(a)h(lo)s(cale-sp)s(eci\014c)h(time)f(represen)m(tation.)65 +b(The)630 2185 y(braces)31 b(are)f(required.)150 2346 +y Ft(\\e)384 b Fu(An)30 b(escap)s(e)h(c)m(haracter.)150 +2506 y Ft(\\h)384 b Fu(The)30 b(hostname,)h(up)e(to)i(the)g(\014rst)e +(`.'.)150 2666 y Ft(\\H)384 b Fu(The)30 b(hostname.)150 +2826 y Ft(\\j)384 b Fu(The)30 b(n)m(um)m(b)s(er)f(of)h(jobs)g(curren)m +(tly)h(managed)g(b)m(y)f(the)g(shell.)150 2987 y Ft(\\l)384 +b Fu(The)30 b(basename)h(of)f(the)h(shell's)f(terminal)h(device)g +(name.)150 3147 y Ft(\\n)384 b Fu(A)30 b(newline.)150 +3307 y Ft(\\r)384 b Fu(A)30 b(carriage)i(return.)150 +3467 y Ft(\\s)384 b Fu(The)22 b(name)g(of)h(the)f(shell,)i(the)f +(basename)f(of)h Ft($0)f Fu(\(the)g(p)s(ortion)g(follo)m(wing)i(the)f +(\014nal)e(slash\).)150 3628 y Ft(\\t)384 b Fu(The)30 +b(time,)h(in)f(24-hour)h(HH:MM:SS)g(format.)150 3788 +y Ft(\\T)384 b Fu(The)30 b(time,)h(in)f(12-hour)h(HH:MM:SS)g(format.) +150 3948 y Ft(\\@)384 b Fu(The)30 b(time,)h(in)f(12-hour)h(am/pm)f +(format.)150 4109 y Ft(\\A)384 b Fu(The)30 b(time,)h(in)f(24-hour)h +(HH:MM)g(format.)150 4269 y Ft(\\u)384 b Fu(The)30 b(username)g(of)g +(the)h(curren)m(t)f(user.)150 4429 y Ft(\\v)384 b Fu(The)30 +b(v)m(ersion)h(of)f(Bash)h(\(e.g.,)h(2.00\))150 4589 +y Ft(\\V)384 b Fu(The)30 b(release)i(of)e(Bash,)h(v)m(ersion)g +Ft(+)f Fu(patc)m(hlev)m(el)i(\(e.g.,)h(2.00.0\))150 4750 +y Ft(\\w)384 b Fu(The)34 b(curren)m(t)h(w)m(orking)g(directory)-8 +b(,)37 b(with)e Ft($HOME)e Fu(abbreviated)j(with)e(a)h(tilde)h(\(uses)f +(the)630 4859 y Ft($PROMPT_DIRTRIM)26 b Fu(v)-5 b(ariable\).)150 +5019 y Ft(\\W)384 b Fu(The)30 b(basename)h(of)f Ft($PWD)p +Fu(,)g(with)g Ft($HOME)f Fu(abbreviated)h(with)g(a)h(tilde.)150 +5180 y Ft(\\!)384 b Fu(The)30 b(history)g(n)m(um)m(b)s(er)f(of)i(this)f +(command.)150 5340 y Ft(\\#)384 b Fu(The)30 b(command)g(n)m(um)m(b)s +(er)f(of)i(this)f(command.)p eop end +%%Page: 93 99 +TeXDict begin 93 98 bop 150 -116 a Fu(Chapter)30 b(6:)41 +b(Bash)30 b(F)-8 b(eatures)2484 b(93)150 299 y Ft(\\$)384 +b Fu(If)30 b(the)g(e\013ectiv)m(e)j(uid)d(is)g(0,)h Ft(#)p +Fu(,)g(otherwise)g Ft($)p Fu(.)150 479 y Ft(\\)p Fj(nnn)288 +b Fu(The)30 b(c)m(haracter)i(whose)e(ASCI)s(I)f(co)s(de)h(is)h(the)f(o) +s(ctal)i(v)-5 b(alue)31 b Fr(nnn)p Fu(.)150 659 y Ft(\\\\)384 +b Fu(A)30 b(bac)m(kslash.)150 839 y Ft(\\[)384 b Fu(Begin)38 +b(a)f(sequence)g(of)g(non-prin)m(ting)g(c)m(haracters.)61 +b(This)36 b(could)h(b)s(e)g(used)f(to)h(em)m(b)s(ed)g(a)630 +948 y(terminal)31 b(con)m(trol)h(sequence)e(in)m(to)i(the)e(prompt.)150 +1128 y Ft(\\])384 b Fu(End)29 b(a)i(sequence)g(of)f(non-prin)m(ting)g +(c)m(haracters.)275 1319 y(The)25 b(command)h(n)m(um)m(b)s(er)f(and)h +(the)g(history)g(n)m(um)m(b)s(er)f(are)i(usually)f(di\013eren)m(t:)39 +b(the)26 b(history)g(n)m(um)m(b)s(er)150 1428 y(of)h(a)f(command)h(is)f +(its)h(p)s(osition)f(in)g(the)h(history)f(list,)i(whic)m(h)f(ma)m(y)g +(include)f(commands)g(restored)g(from)150 1538 y(the)39 +b(history)h(\014le)f(\(see)h(Section)g(9.1)h([Bash)e(History)h(F)-8 +b(acilities],)45 b(page)40 b(133\),)j(while)d(the)f(command)150 +1647 y(n)m(um)m(b)s(er)j(is)h(the)h(p)s(osition)f(in)g(the)g(sequence)h +(of)f(commands)g(executed)h(during)e(the)i(curren)m(t)f(shell)150 +1757 y(session.)275 1912 y(After)35 b(the)g(string)g(is)g(deco)s(ded,)h +(it)f(is)g(expanded)f(via)i(parameter)f(expansion,)i(command)d(substi-) +150 2022 y(tution,)k(arithmetic)f(expansion,)g(and)e(quote)h(remo)m(v) +-5 b(al,)39 b(sub)5 b(ject)35 b(to)i(the)f(v)-5 b(alue)36 +b(of)g(the)g Ft(promptvars)150 2131 y Fu(shell)31 b(option)f(\(see)i +(Section)f(4.2)g([Bash)g(Builtins],)g(page)g(48\).)150 +2395 y Fs(6.10)68 b(The)45 b(Restricted)h(Shell)150 2554 +y Fu(If)34 b(Bash)g(is)g(started)g(with)g(the)g(name)h +Ft(rbash)p Fu(,)e(or)h(the)h Ft(--restricted)30 b Fu(or)k +Ft(-r)g Fu(option)g(is)g(supplied)f(at)150 2664 y(in)m(v)m(o)s(cation,) +d(the)d(shell)g(b)s(ecomes)h(restricted.)40 b(A)27 b(restricted)h +(shell)f(is)g(used)f(to)i(set)f(up)f(an)h(en)m(vironmen)m(t)150 +2773 y(more)g(con)m(trolled)i(than)e(the)g(standard)g(shell.)40 +b(A)27 b(restricted)h(shell)f(b)s(eha)m(v)m(es)h(iden)m(tically)h(to)f +Ft(bash)e Fu(with)150 2883 y(the)31 b(exception)g(that)g(the)g(follo)m +(wing)h(are)e(disallo)m(w)m(ed)i(or)e(not)h(p)s(erformed:)225 +3038 y Fq(\017)60 b Fu(Changing)30 b(directories)h(with)g(the)f +Ft(cd)g Fu(builtin.)225 3183 y Fq(\017)60 b Fu(Setting)31 +b(or)f(unsetting)h(the)g(v)-5 b(alues)30 b(of)h(the)f +Ft(SHELL)p Fu(,)g Ft(PATH)p Fu(,)f Ft(ENV)p Fu(,)h(or)g +Ft(BASH_ENV)e Fu(v)-5 b(ariables.)225 3328 y Fq(\017)60 +b Fu(Sp)s(ecifying)30 b(command)g(names)g(con)m(taining)i(slashes.)225 +3472 y Fq(\017)60 b Fu(Sp)s(ecifying)30 b(a)h(\014lename)f(con)m +(taining)i(a)f(slash)f(as)h(an)f(argumen)m(t)h(to)g(the)f +Ft(.)h Fu(builtin)e(command.)225 3617 y Fq(\017)60 b +Fu(Sp)s(ecifying)32 b(a)g(\014lename)h(con)m(taining)h(a)e(slash)g(as)h +(an)f(argumen)m(t)h(to)g(the)f Ft(-p)g Fu(option)h(to)g(the)f +Ft(hash)330 3727 y Fu(builtin)e(command.)225 3871 y Fq(\017)60 +b Fu(Imp)s(orting)30 b(function)g(de\014nitions)g(from)f(the)i(shell)g +(en)m(vironmen)m(t)g(at)g(startup.)225 4016 y Fq(\017)60 +b Fu(P)m(arsing)31 b(the)f(v)-5 b(alue)31 b(of)g Ft(SHELLOPTS)d +Fu(from)h(the)i(shell)g(en)m(vironmen)m(t)g(at)g(startup.)225 +4161 y Fq(\017)60 b Fu(Redirecting)31 b(output)f(using)g(the)h(`)p +Ft(>)p Fu(',)g(`)p Ft(>|)p Fu(',)f(`)p Ft(<>)p Fu(',)h(`)p +Ft(>&)p Fu(',)f(`)p Ft(&>)p Fu(',)h(and)e(`)p Ft(>>)p +Fu(')i(redirection)g(op)s(erators.)225 4306 y Fq(\017)60 +b Fu(Using)31 b(the)f Ft(exec)f Fu(builtin)h(to)h(replace)h(the)e +(shell)h(with)f(another)h(command.)225 4451 y Fq(\017)60 +b Fu(Adding)24 b(or)g(deleting)i(builtin)e(commands)g(with)h(the)f +Ft(-f)g Fu(and)g Ft(-d)g Fu(options)h(to)h(the)e Ft(enable)f +Fu(builtin.)225 4595 y Fq(\017)60 b Fu(Using)31 b(the)f +Ft(enable)f Fu(builtin)h(command)g(to)h(enable)g(disabled)f(shell)g +(builtins.)225 4740 y Fq(\017)60 b Fu(Sp)s(ecifying)30 +b(the)g Ft(-p)g Fu(option)h(to)g(the)g Ft(command)d Fu(builtin.)225 +4885 y Fq(\017)60 b Fu(T)-8 b(urning)29 b(o\013)i(restricted)g(mo)s(de) +f(with)g(`)p Ft(set)g(+r)p Fu(')g(or)g(`)p Ft(set)g(+o)g(restricted)p +Fu('.)275 5075 y(These)g(restrictions)h(are)g(enforced)f(after)h(an)m +(y)g(startup)f(\014les)g(are)h(read.)275 5230 y(When)j(a)i(command)e +(that)i(is)f(found)f(to)h(b)s(e)g(a)g(shell)g(script)g(is)g(executed)h +(\(see)g(Section)g(3.8)g([Shell)150 5340 y(Scripts],)25 +b(page)e(39\),)j Ft(rbash)c Fu(turns)g(o\013)i(an)m(y)f(restrictions)h +(in)f(the)g(shell)h(spa)m(wned)e(to)i(execute)g(the)g(script.)p +eop end +%%Page: 94 100 +TeXDict begin 94 99 bop 150 -116 a Fu(Chapter)30 b(6:)41 +b(Bash)30 b(F)-8 b(eatures)2484 b(94)150 299 y Fs(6.11)68 +b(Bash)45 b(POSIX)f(Mo)t(de)150 458 y Fu(Starting)39 +b(Bash)f(with)g(the)h Ft(--posix)d Fu(command-line)j(option)g(or)f +(executing)h(`)p Ft(set)30 b(-o)g(posix)p Fu(')37 b(while)150 +568 y(Bash)26 b(is)g(running)e(will)j(cause)f(Bash)g(to)h(conform)f +(more)g(closely)h(to)g(the)f Fm(posix)f Fu(standard)g(b)m(y)h(c)m +(hanging)150 677 y(the)31 b(b)s(eha)m(vior)f(to)h(matc)m(h)g(that)g(sp) +s(eci\014ed)f(b)m(y)g Fm(posix)g Fu(in)g(areas)h(where)f(the)h(Bash)f +(default)h(di\013ers.)275 811 y(When)f(in)m(v)m(ok)m(ed)h(as)g +Ft(sh)p Fu(,)f(Bash)h(en)m(ters)g Fm(posix)e Fu(mo)s(de)h(after)h +(reading)g(the)f(startup)g(\014les.)275 944 y(The)f(follo)m(wing)j +(list)f(is)g(what's)f(c)m(hanged)h(when)e(`)p Fm(posix)h +Fu(mo)s(de')h(is)f(in)g(e\013ect:)199 1077 y(1.)61 b(When)28 +b(a)i(command)e(in)g(the)h(hash)f(table)i(no)e(longer)h(exists,)h(Bash) +f(will)g(re-searc)m(h)h Ft($PATH)d Fu(to)i(\014nd)330 +1187 y(the)i(new)e(lo)s(cation.)43 b(This)29 b(is)i(also)g(a)m(v)-5 +b(ailable)33 b(with)d(`)p Ft(shopt)f(-s)h(checkhash)p +Fu('.)199 1320 y(2.)61 b(The)42 b(message)h(prin)m(ted)e(b)m(y)h(the)g +(job)g(con)m(trol)i(co)s(de)e(and)f(builtins)h(when)f(a)h(job)g(exits)h +(with)f(a)330 1430 y(non-zero)31 b(status)g(is)f(`Done\(status\)'.)199 +1563 y(3.)61 b(The)40 b(message)h(prin)m(ted)f(b)m(y)g(the)h(job)f(con) +m(trol)h(co)s(de)g(and)f(builtins)f(when)h(a)g(job)g(is)h(stopp)s(ed)e +(is)330 1673 y(`Stopp)s(ed\()p Fr(signame)5 b Fu(\)',)31 +b(where)f Fr(signame)36 b Fu(is,)31 b(for)f(example,)h +Ft(SIGTSTP)p Fu(.)199 1806 y(4.)61 b(The)27 b Ft(bg)g +Fu(builtin)g(uses)g(the)h(required)f(format)h(to)g(describ)s(e)f(eac)m +(h)i(job)e(placed)h(in)f(the)h(bac)m(kground,)330 1916 +y(whic)m(h)h(do)s(es)g(not)g(include)g(an)g(indication)h(of)f(whether)f +(the)h(job)g(is)g(the)h(curren)m(t)e(or)h(previous)g(job.)199 +2049 y(5.)61 b(Reserv)m(ed)40 b(w)m(ords)g(app)s(earing)f(in)h(a)g(con) +m(text)i(where)d(reserv)m(ed)h(w)m(ords)f(are)i(recognized)g(do)f(not) +330 2159 y(undergo)30 b(alias)h(expansion.)199 2292 y(6.)61 +b(The)38 b Fm(posix)h Ft(PS1)f Fu(and)g Ft(PS2)g Fu(expansions)g(of)i +(`)p Ft(!)p Fu(')f(to)g(the)g(history)g(n)m(um)m(b)s(er)f(and)g(`)p +Ft(!!)p Fu(')h(to)g(`)p Ft(!)p Fu(')h(are)330 2401 y(enabled,)26 +b(and)f(parameter)g(expansion)g(is)g(p)s(erformed)e(on)i(the)g(v)-5 +b(alues)25 b(of)g Ft(PS1)f Fu(and)h Ft(PS2)f Fu(regardless)330 +2511 y(of)31 b(the)f(setting)i(of)e(the)h Ft(promptvars)c +Fu(option.)199 2644 y(7.)61 b(The)30 b Fm(posix)g Fu(startup)f(\014les) +i(are)g(executed)g(\()p Ft($ENV)p Fu(\))f(rather)g(than)g(the)h(normal) +f(Bash)g(\014les.)199 2778 y(8.)61 b(Tilde)30 b(expansion)g(is)f(only)h +(p)s(erformed)f(on)h(assignmen)m(ts)g(preceding)g(a)g(command)g(name,)g +(rather)330 2887 y(than)g(on)g(all)i(assignmen)m(t)f(statemen)m(ts)h +(on)e(the)h(line.)199 3021 y(9.)61 b(The)31 b Ft(command)e +Fu(builtin)i(do)s(es)g(not)h(prev)m(en)m(t)f(builtins)g(that)h(tak)m(e) +h(assignmen)m(t)f(statemen)m(ts)h(as)f(ar-)330 3130 y(gumen)m(ts)40 +b(from)e(expanding)h(them)g(as)h(assignmen)m(t)g(statemen)m(ts;)46 +b(when)38 b(not)i(in)f Fm(posix)f Fu(mo)s(de,)330 3240 +y(assignmen)m(t)k(builtins)e(lose)h(their)g(assignmen)m(t)h(statemen)m +(t)h(expansion)d(prop)s(erties)g(when)g(pre-)330 3349 +y(ceded)31 b(b)m(y)f Ft(command)p Fu(.)154 3483 y(10.)61 +b(The)30 b(default)g(history)h(\014le)f(is)h Ft(~/.sh_history)26 +b Fu(\(this)31 b(is)f(the)h(default)g(v)-5 b(alue)30 +b(of)h Ft($HISTFILE)p Fu(\).)154 3616 y(11.)61 b(The)23 +b(output)f(of)i(`)p Ft(kill)29 b(-l)p Fu(')23 b(prin)m(ts)f(all)i(the)g +(signal)f(names)g(on)g(a)h(single)g(line,)h(separated)e(b)m(y)g +(spaces,)330 3726 y(without)30 b(the)h(`)p Ft(SIG)p Fu(')f(pre\014x.) +154 3859 y(12.)61 b(The)30 b Ft(kill)f Fu(builtin)h(do)s(es)g(not)h +(accept)h(signal)f(names)f(with)g(a)h(`)p Ft(SIG)p Fu(')f(pre\014x.)154 +3992 y(13.)61 b(Non-in)m(teractiv)m(e)34 b(shells)c(exit)h(if)g +Fr(\014lename)k Fu(in)30 b Ft(.)g Fr(\014lename)36 b +Fu(is)31 b(not)f(found.)154 4125 y(14.)61 b(Non-in)m(teractiv)m(e)41 +b(shells)d(exit)h(if)f(a)g(syn)m(tax)g(error)g(in)f(an)h(arithmetic)h +(expansion)f(results)f(in)h(an)330 4235 y(in)m(v)-5 b(alid)31 +b(expression.)154 4368 y(15.)61 b(Non-in)m(teractiv)m(e)27 +b(shells)c(exit)i(if)e(there)h(is)f(a)h(syn)m(tax)g(error)f(in)g(a)h +(script)f(read)g(with)h(the)f Ft(.)g Fu(or)h Ft(source)330 +4478 y Fu(builtins,)30 b(or)g(in)g(a)h(string)g(pro)s(cessed)e(b)m(y)i +(the)f Ft(eval)f Fu(builtin.)154 4611 y(16.)61 b(Redirection)25 +b(op)s(erators)f(do)g(not)g(p)s(erform)f(\014lename)h(expansion)g(on)g +(the)g(w)m(ord)f(in)h(the)g(redirection)330 4721 y(unless)30 +b(the)g(shell)h(is)f(in)m(teractiv)m(e.)154 4854 y(17.)61 +b(Redirection)31 b(op)s(erators)g(do)f(not)h(p)s(erform)e(w)m(ord)h +(splitting)h(on)f(the)h(w)m(ord)f(in)g(the)g(redirection.)154 +4987 y(18.)61 b(F)-8 b(unction)35 b(names)g(m)m(ust)f(b)s(e)g(v)-5 +b(alid)35 b(shell)f Ft(name)p Fu(s.)52 b(That)34 b(is,)i(they)f(ma)m(y) +g(not)g(con)m(tain)g(c)m(haracters)330 5097 y(other)e(than)g(letters,)h +(digits,)h(and)d(underscores,)h(and)f(ma)m(y)h(not)g(start)h(with)e(a)h +(digit.)49 b(Declaring)330 5207 y(a)31 b(function)f(with)g(an)g(in)m(v) +-5 b(alid)31 b(name)g(causes)f(a)h(fatal)h(syn)m(tax)f(error)f(in)g +(non-in)m(teractiv)m(e)j(shells.)154 5340 y(19.)61 b(F)-8 +b(unction)31 b(names)f(ma)m(y)h(not)g(b)s(e)f(the)g(same)h(as)g(one)f +(of)h(the)f Fm(posix)g Fu(sp)s(ecial)h(builtins.)p eop +end +%%Page: 95 101 +TeXDict begin 95 100 bop 150 -116 a Fu(Chapter)30 b(6:)41 +b(Bash)30 b(F)-8 b(eatures)2484 b(95)154 299 y(20.)61 +b Fm(posix)30 b Fu(sp)s(ecial)h(builtins)e(are)i(found)e(b)s(efore)h +(shell)h(functions)f(during)f(command)h(lo)s(okup.)154 +427 y(21.)61 b(The)29 b Ft(time)g Fu(reserv)m(ed)h(w)m(ord)g(ma)m(y)g +(b)s(e)g(used)f(b)m(y)h(itself)g(as)g(a)h(command.)40 +b(When)30 b(used)f(in)g(this)h(w)m(a)m(y)-8 b(,)330 536 +y(it)33 b(displa)m(ys)g(timing)g(statistics)h(for)e(the)h(shell)g(and)f +(its)g(completed)i(c)m(hildren.)47 b(The)32 b Ft(TIMEFORMAT)330 +646 y Fu(v)-5 b(ariable)31 b(con)m(trols)h(the)e(format)h(of)g(the)f +(timing)h(information.)154 774 y(22.)61 b(When)33 b(parsing)g(and)f +(expanding)h(a)h($)p Fi({)6 b Fu(.)22 b(.)h(.)11 b Fi(})33 +b Fu(expansion)g(that)h(app)s(ears)f(within)f(double)h(quotes,)330 +883 y(single)42 b(quotes)g(are)g(no)g(longer)g(sp)s(ecial)g(and)f +(cannot)i(b)s(e)e(used)g(to)h(quote)g(a)g(closing)h(brace)f(or)330 +993 y(other)31 b(sp)s(ecial)h(c)m(haracter,)i(unless)c(the)i(op)s +(erator)f(is)g(one)h(of)f(those)h(de\014ned)e(to)i(p)s(erform)e +(pattern)330 1103 y(remo)m(v)-5 b(al.)42 b(In)30 b(this)g(case,)i(they) +e(do)g(not)h(ha)m(v)m(e)h(to)f(app)s(ear)e(as)i(matc)m(hed)g(pairs.)154 +1230 y(23.)61 b(The)29 b(parser)g(do)s(es)g(not)h(recognize)h +Ft(time)d Fu(as)i(a)g(reserv)m(ed)f(w)m(ord)g(if)h(the)f(next)h(tok)m +(en)h(b)s(egins)d(with)i(a)330 1340 y(`)p Ft(-)p Fu('.)154 +1468 y(24.)61 b(If)24 b(a)g Fm(posix)g Fu(sp)s(ecial)h(builtin)f +(returns)f(an)h(error)g(status,)i(a)e(non-in)m(teractiv)m(e)j(shell)e +(exits.)39 b(The)24 b(fatal)330 1577 y(errors)30 b(are)h(those)f +(listed)h(in)f(the)h Fm(posix)e Fu(standard,)h(and)g(include)g(things)g +(lik)m(e)i(passing)e(incorrect)330 1687 y(options,)43 +b(redirection)d(errors,)i(v)-5 b(ariable)41 b(assignmen)m(t)g(errors)e +(for)g(assignmen)m(ts)i(preceding)f(the)330 1797 y(command)30 +b(name,)h(and)f(so)g(on.)154 1924 y(25.)61 b(A)31 b(non-in)m(teractiv)m +(e)j(shell)d(exits)h(with)e(an)h(error)g(status)g(if)g(a)g(v)-5 +b(ariable)32 b(assignmen)m(t)g(error)e(o)s(ccurs)330 +2034 y(when)38 b(no)h(command)g(name)g(follo)m(ws)i(the)e(assignmen)m +(t)h(statemen)m(ts.)69 b(A)39 b(v)-5 b(ariable)40 b(assignmen)m(t)330 +2144 y(error)30 b(o)s(ccurs,)g(for)g(example,)i(when)d(trying)i(to)g +(assign)f(a)h(v)-5 b(alue)31 b(to)g(a)g(readonly)f(v)-5 +b(ariable.)154 2271 y(26.)61 b(A)31 b(non-in)m(teractiv)m(e)j(shell)d +(exits)h(with)e(an)h(error)g(status)g(if)g(a)g(v)-5 b(ariable)32 +b(assignmen)m(t)g(error)e(o)s(ccurs)330 2381 y(in)g(an)g(assignmen)m(t) +i(statemen)m(t)g(preceding)e(a)h(sp)s(ecial)g(builtin,)f(but)g(not)g +(with)h(an)m(y)f(other)h(simple)330 2491 y(command.)154 +2619 y(27.)61 b(A)43 b(non-in)m(teractiv)m(e)i(shell)e(exits)h(with)f +(an)f(error)h(status)g(if)g(the)g(iteration)h(v)-5 b(ariable)44 +b(in)f(a)g Ft(for)330 2728 y Fu(statemen)m(t)32 b(or)f(the)f(selection) +i(v)-5 b(ariable)32 b(in)e(a)g Ft(select)f Fu(statemen)m(t)j(is)f(a)f +(readonly)h(v)-5 b(ariable.)154 2856 y(28.)61 b(Pro)s(cess)30 +b(substitution)g(is)h(not)f(a)m(v)-5 b(ailable.)154 2984 +y(29.)61 b(While)32 b(v)-5 b(ariable)32 b(indirection)f(is)g(a)m(v)-5 +b(ailable,)34 b(it)d(ma)m(y)h(not)f(b)s(e)g(applied)g(to)g(the)h(`)p +Ft(#)p Fu(')f(and)f(`)p Ft(?)p Fu(')h(sp)s(ecial)330 +3093 y(parameters.)154 3221 y(30.)61 b(Assignmen)m(t)23 +b(statemen)m(ts)h(preceding)e Fm(posix)f Fu(sp)s(ecial)i(builtins)f(p)s +(ersist)g(in)f(the)i(shell)f(en)m(vironmen)m(t)330 3331 +y(after)31 b(the)f(builtin)g(completes.)154 3459 y(31.)61 +b(Assignmen)m(t)35 b(statemen)m(ts)h(preceding)f(shell)f(function)g +(calls)i(p)s(ersist)e(in)g(the)h(shell)f(en)m(vironmen)m(t)330 +3568 y(after)d(the)f(function)h(returns,)e(as)i(if)f(a)h +Fm(posix)e Fu(sp)s(ecial)i(builtin)f(command)g(had)g(b)s(een)g +(executed.)154 3696 y(32.)61 b(The)38 b Ft(export)f Fu(and)g +Ft(readonly)f Fu(builtin)i(commands)g(displa)m(y)h(their)f(output)g(in) +g(the)h(format)g(re-)330 3806 y(quired)30 b(b)m(y)g Fm(posix)p +Fu(.)154 3934 y(33.)61 b(The)30 b Ft(trap)f Fu(builtin)h(displa)m(ys)g +(signal)i(names)e(without)g(the)h(leading)g Ft(SIG)p +Fu(.)154 4061 y(34.)61 b(The)39 b Ft(trap)e Fu(builtin)i(do)s(esn't)g +(c)m(hec)m(k)h(the)g(\014rst)e(argumen)m(t)i(for)e(a)i(p)s(ossible)e +(signal)i(sp)s(eci\014cation)330 4171 y(and)30 b(rev)m(ert)i(the)e +(signal)i(handling)e(to)h(the)g(original)h(disp)s(osition)e(if)h(it)g +(is,)g(unless)f(that)h(argumen)m(t)330 4281 y(consists)e(solely)g(of)g +(digits)g(and)f(is)g(a)h(v)-5 b(alid)29 b(signal)g(n)m(um)m(b)s(er.)38 +b(If)28 b(users)g(w)m(an)m(t)h(to)g(reset)g(the)g(handler)330 +4390 y(for)h(a)g(giv)m(en)h(signal)g(to)f(the)h(original)g(disp)s +(osition,)f(they)g(should)f(use)h(`)p Ft(-)p Fu(')g(as)g(the)g(\014rst) +f(argumen)m(t.)154 4518 y(35.)61 b(The)21 b Ft(.)h Fu(and)f +Ft(source)f Fu(builtins)h(do)g(not)h(searc)m(h)h(the)f(curren)m(t)f +(directory)h(for)g(the)g(\014lename)f(argumen)m(t)330 +4628 y(if)30 b(it)h(is)g(not)f(found)f(b)m(y)i(searc)m(hing)g +Ft(PATH)p Fu(.)154 4756 y(36.)61 b(Subshells)24 b(spa)m(wned)h(to)h +(execute)h(command)f(substitutions)f(inherit)g(the)h(v)-5 +b(alue)26 b(of)g(the)g Ft(-e)e Fu(option)330 4865 y(from)37 +b(the)h(paren)m(t)g(shell.)63 b(When)38 b(not)g(in)f +Fm(posix)g Fu(mo)s(de,)j(Bash)e(clears)g(the)g Ft(-e)g +Fu(option)g(in)f(suc)m(h)330 4975 y(subshells.)154 5103 +y(37.)61 b(Alias)31 b(expansion)g(is)f(alw)m(a)m(ys)i(enabled,)e(ev)m +(en)i(in)e(non-in)m(teractiv)m(e)j(shells.)154 5230 y(38.)61 +b(When)43 b(the)g Ft(alias)f Fu(builtin)g(displa)m(ys)i(alias)g +(de\014nitions,)i(it)d(do)s(es)g(not)g(displa)m(y)h(them)f(with)g(a)330 +5340 y(leading)31 b(`)p Ft(alias)e Fu(')i(unless)f(the)g +Ft(-p)g Fu(option)h(is)f(supplied.)p eop end +%%Page: 96 102 +TeXDict begin 96 101 bop 150 -116 a Fu(Chapter)30 b(6:)41 +b(Bash)30 b(F)-8 b(eatures)2484 b(96)154 299 y(39.)61 +b(When)40 b(the)g Ft(set)f Fu(builtin)h(is)g(in)m(v)m(ok)m(ed)h +(without)f(options,)j(it)e(do)s(es)f(not)g(displa)m(y)g(shell)g +(function)330 408 y(names)30 b(and)g(de\014nitions.)154 +543 y(40.)61 b(When)36 b(the)g Ft(set)g Fu(builtin)g(is)g(in)m(v)m(ok)m +(ed)i(without)e(options,)i(it)f(displa)m(ys)f(v)-5 b(ariable)37 +b(v)-5 b(alues)37 b(without)330 653 y(quotes,)26 b(unless)d(they)i(con) +m(tain)g(shell)f(metac)m(haracters,)k(ev)m(en)d(if)f(the)g(result)g +(con)m(tains)i(nonprin)m(ting)330 762 y(c)m(haracters.)154 +897 y(41.)61 b(When)35 b(the)g Ft(cd)f Fu(builtin)h(is)g(in)m(v)m(ok)m +(ed)i(in)d Fr(logical)41 b Fu(mo)s(de,)36 b(and)f(the)g(pathname)g +(constructed)g(from)330 1006 y Ft($PWD)i Fu(and)h(the)h(directory)f +(name)h(supplied)e(as)i(an)f(argumen)m(t)h(do)s(es)f(not)g(refer)h(to)g +(an)f(existing)330 1116 y(directory)-8 b(,)32 b Ft(cd)d +Fu(will)i(fail)g(instead)g(of)f(falling)h(bac)m(k)h(to)f +Fr(ph)m(ysical)j Fu(mo)s(de.)154 1250 y(42.)61 b(The)36 +b Ft(pwd)f Fu(builtin)h(v)m(eri\014es)h(that)g(the)f(v)-5 +b(alue)37 b(it)g(prin)m(ts)e(is)i(the)f(same)h(as)f(the)h(curren)m(t)f +(directory)-8 b(,)330 1360 y(ev)m(en)31 b(if)f(it)h(is)g(not)f(ask)m +(ed)h(to)g(c)m(hec)m(k)h(the)f(\014le)f(system)h(with)f(the)h +Ft(-P)e Fu(option.)154 1494 y(43.)61 b(When)35 b(listing)g(the)g +(history)-8 b(,)36 b(the)f Ft(fc)g Fu(builtin)f(do)s(es)g(not)h +(include)g(an)f(indication)i(of)f(whether)f(or)330 1604 +y(not)d(a)f(history)h(en)m(try)f(has)g(b)s(een)g(mo)s(di\014ed.)154 +1738 y(44.)61 b(The)30 b(default)g(editor)h(used)f(b)m(y)g +Ft(fc)g Fu(is)g Ft(ed)p Fu(.)154 1873 y(45.)61 b(The)37 +b Ft(type)g Fu(and)g Ft(command)f Fu(builtins)i(will)g(not)g(rep)s(ort) +f(a)i(non-executable)g(\014le)f(as)g(ha)m(ving)h(b)s(een)330 +1983 y(found,)26 b(though)h(the)g(shell)g(will)g(attempt)h(to)g +(execute)g(suc)m(h)f(a)g(\014le)g(if)g(it)g(is)g(the)g(only)g(so-named) +g(\014le)330 2092 y(found)i(in)h Ft($PATH)p Fu(.)154 +2227 y(46.)61 b(The)33 b Ft(vi)f Fu(editing)i(mo)s(de)f(will)g(in)m(v)m +(ok)m(e)i(the)e Ft(vi)g Fu(editor)h(directly)f(when)f(the)i(`)p +Ft(v)p Fu(')f(command)g(is)g(run,)330 2336 y(instead)e(of)f(c)m(hec)m +(king)i Ft($VISUAL)d Fu(and)g Ft($EDITOR)p Fu(.)154 2471 +y(47.)61 b(When)41 b(the)g Ft(xpg_echo)e Fu(option)i(is)g(enabled,)j +(Bash)d(do)s(es)g(not)g(attempt)h(to)g(in)m(terpret)f(an)m(y)h(ar-)330 +2580 y(gumen)m(ts)35 b(to)g Ft(echo)e Fu(as)i(options.)54 +b(Eac)m(h)35 b(argumen)m(t)g(is)f(displa)m(y)m(ed,)j(after)e(escap)s(e) +g(c)m(haracters)h(are)330 2690 y(con)m(v)m(erted.)154 +2824 y(48.)61 b(The)30 b Ft(ulimit)f Fu(builtin)g(uses)h(a)h(blo)s(c)m +(k)g(size)g(of)g(512)g(b)m(ytes)g(for)f(the)h Ft(-c)f +Fu(and)g Ft(-f)f Fu(options.)154 2959 y(49.)61 b(The)39 +b(arriv)-5 b(al)41 b(of)f Ft(SIGCHLD)e Fu(when)h(a)h(trap)g(is)g(set)h +(on)f Ft(SIGCHLD)e Fu(do)s(es)h(not)h(in)m(terrupt)g(the)g +Ft(wait)330 3068 y Fu(builtin)c(and)h(cause)g(it)h(to)f(return)f +(immediately)-8 b(.)62 b(The)37 b(trap)f(command)h(is)g(run)e(once)j +(for)f(eac)m(h)330 3178 y(c)m(hild)31 b(that)g(exits.)154 +3313 y(50.)61 b(The)27 b Ft(read)f Fu(builtin)g(ma)m(y)i(b)s(e)e(in)m +(terrupted)h(b)m(y)g(a)h(signal)f(for)g(whic)m(h)g(a)h(trap)f(has)g(b)s +(een)f(set.)40 b(If)27 b(Bash)330 3422 y(receiv)m(es)41 +b(a)f(trapp)s(ed)e(signal)i(while)f(executing)h Ft(read)p +Fu(,)h(the)e(trap)h(handler)e(executes)i(and)f Ft(read)330 +3532 y Fu(returns)29 b(an)h(exit)i(status)e(greater)i(than)e(128.)275 +3691 y(There)k(is)g(other)h Fm(posix)f Fu(b)s(eha)m(vior)h(that)g(Bash) +g(do)s(es)f(not)h(implemen)m(t)g(b)m(y)g(default)f(ev)m(en)i(when)d(in) +150 3801 y Fm(posix)d Fu(mo)s(de.)40 b(Sp)s(eci\014cally:)199 +3935 y(1.)61 b(The)30 b Ft(fc)f Fu(builtin)h(c)m(hec)m(ks)i +Ft($EDITOR)c Fu(as)j(a)f(program)g(to)h(edit)g(history)f(en)m(tries)h +(if)f Ft(FCEDIT)f Fu(is)h(unset,)330 4045 y(rather)g(than)g(defaulting) +h(directly)g(to)g Ft(ed)p Fu(.)40 b Ft(fc)30 b Fu(uses)g +Ft(ed)g Fu(if)g Ft(EDITOR)f Fu(is)h(unset.)199 4179 y(2.)61 +b(As)29 b(noted)g(ab)s(o)m(v)m(e,)i(Bash)e(requires)g(the)g +Ft(xpg_echo)e Fu(option)j(to)g(b)s(e)e(enabled)h(for)g(the)g +Ft(echo)f Fu(builtin)330 4289 y(to)j(b)s(e)f(fully)g(conforman)m(t.)275 +4448 y(Bash)c(can)g(b)s(e)f(con\014gured)h(to)g(b)s(e)g +Fm(posix)p Fu(-conforman)m(t)g(b)m(y)g(default,)h(b)m(y)f(sp)s +(ecifying)g(the)g Ft(--enable-)150 4558 y(strict-posix-default)c +Fu(to)27 b Ft(configure)e Fu(when)h(building)h(\(see)h(Section)g(10.8)g +([Optional)g(F)-8 b(eatures],)150 4667 y(page)31 b(140\).)p +eop end +%%Page: 97 103 +TeXDict begin 97 102 bop 150 -116 a Fu(Chapter)30 b(7:)41 +b(Job)30 b(Con)m(trol)2571 b(97)150 299 y Fp(7)80 b(Job)54 +b(Con)l(trol)150 521 y Fu(This)25 b(c)m(hapter)i(discusses)f(what)g +(job)f(con)m(trol)j(is,)f(ho)m(w)f(it)h(w)m(orks,)g(and)f(ho)m(w)g +(Bash)g(allo)m(ws)h(y)m(ou)g(to)g(access)150 631 y(its)k(facilities.) +150 858 y Fs(7.1)68 b(Job)45 b(Con)l(trol)h(Basics)150 +1018 y Fu(Job)27 b(con)m(trol)i(refers)e(to)h(the)g(abilit)m(y)h(to)f +(selectiv)m(ely)j(stop)c(\(susp)s(end\))f(the)i(execution)h(of)e(pro)s +(cesses)h(and)150 1127 y(con)m(tin)m(ue)38 b(\(resume\))g(their)f +(execution)h(at)g(a)g(later)g(p)s(oin)m(t.)61 b(A)37 +b(user)g(t)m(ypically)i(emplo)m(ys)f(this)f(facilit)m(y)150 +1237 y(via)27 b(an)e(in)m(teractiv)m(e)k(in)m(terface)f(supplied)d +(join)m(tly)h(b)m(y)g(the)h(op)s(erating)f(system)g(k)m(ernel's)h +(terminal)f(driv)m(er)150 1347 y(and)k(Bash.)275 1479 +y(The)23 b(shell)i(asso)s(ciates)h(a)f Fr(job)h Fu(with)e(eac)m(h)i +(pip)s(eline.)38 b(It)25 b(k)m(eeps)f(a)h(table)h(of)e(curren)m(tly)h +(executing)g(jobs,)150 1588 y(whic)m(h)33 b(ma)m(y)i(b)s(e)e(listed)h +(with)f(the)h Ft(jobs)f Fu(command.)50 b(When)33 b(Bash)h(starts)g(a)g +(job)g(async)m(hronously)-8 b(,)34 b(it)150 1698 y(prin)m(ts)c(a)h +(line)f(that)h(lo)s(oks)g(lik)m(e:)390 1830 y Ft([1])47 +b(25647)150 1962 y Fu(indicating)34 b(that)g(this)f(job)g(is)g(job)g(n) +m(um)m(b)s(er)f(1)i(and)f(that)g(the)h(pro)s(cess)f Fm(id)g +Fu(of)g(the)h(last)g(pro)s(cess)f(in)g(the)150 2072 y(pip)s(eline)42 +b(asso)s(ciated)i(with)e(this)g(job)g(is)h(25647.)78 +b(All)43 b(of)g(the)g(pro)s(cesses)f(in)g(a)h(single)g(pip)s(eline)f +(are)150 2181 y(mem)m(b)s(ers)30 b(of)g(the)h(same)f(job.)41 +b(Bash)30 b(uses)g(the)h Fr(job)h Fu(abstraction)f(as)g(the)g(basis)f +(for)g(job)g(con)m(trol.)275 2313 y(T)-8 b(o)23 b(facilitate)j(the)d +(implemen)m(tation)i(of)f(the)f(user)f(in)m(terface)j(to)f(job)f(con)m +(trol,)j(the)d(op)s(erating)h(system)150 2423 y(main)m(tains)j(the)f +(notion)h(of)f(a)g(curren)m(t)g(terminal)g(pro)s(cess)g(group)g +Fm(id)p Fu(.)39 b(Mem)m(b)s(ers)26 b(of)g(this)g(pro)s(cess)f(group)150 +2533 y(\(pro)s(cesses)h(whose)g(pro)s(cess)g(group)g +Fm(id)g Fu(is)h(equal)g(to)g(the)f(curren)m(t)g(terminal)h(pro)s(cess)f +(group)f Fm(id)p Fu(\))i(receiv)m(e)150 2642 y(k)m(eyb)s +(oard-generated)22 b(signals)g(suc)m(h)e(as)h Ft(SIGINT)p +Fu(.)36 b(These)21 b(pro)s(cesses)g(are)g(said)g(to)g(b)s(e)g(in)f(the) +h(foreground.)150 2752 y(Bac)m(kground)38 b(pro)s(cesses)f(are)h(those) +g(whose)f(pro)s(cess)g(group)g Fm(id)h Fu(di\013ers)f(from)g(the)g +(terminal's;)42 b(suc)m(h)150 2861 y(pro)s(cesses)24 +b(are)g(imm)m(une)g(to)g(k)m(eyb)s(oard-generated)h(signals.)40 +b(Only)23 b(foreground)g(pro)s(cesses)h(are)g(allo)m(w)m(ed)150 +2971 y(to)g(read)e(from)h(or,)h(if)f(the)g(user)f(so)i(sp)s(eci\014es)e +(with)h Ft(stty)29 b(tostop)p Fu(,)23 b(write)g(to)g(the)h(terminal.)38 +b(Bac)m(kground)150 3081 y(pro)s(cesses)27 b(whic)m(h)g(attempt)h(to)f +(read)g(from)g(\(write)g(to)h(when)e Ft(stty)j(tostop)d +Fu(is)h(in)f(e\013ect\))j(the)e(terminal)150 3190 y(are)32 +b(sen)m(t)g(a)g Ft(SIGTTIN)e Fu(\()p Ft(SIGTTOU)p Fu(\))g(signal)i(b)m +(y)g(the)g(k)m(ernel's)g(terminal)g(driv)m(er,)g(whic)m(h,)g(unless)f +(caugh)m(t,)150 3300 y(susp)s(ends)d(the)i(pro)s(cess.)275 +3432 y(If)k(the)i(op)s(erating)g(system)f(on)h(whic)m(h)f(Bash)g(is)h +(running)d(supp)s(orts)h(job)h(con)m(trol,)j(Bash)e(con)m(tains)150 +3541 y(facilities)30 b(to)f(use)f(it.)40 b(T)m(yping)28 +b(the)g Fr(susp)s(end)h Fu(c)m(haracter)h(\(t)m(ypically)g(`)p +Ft(^Z)p Fu(',)f(Con)m(trol-Z\))g(while)f(a)g(pro)s(cess)150 +3651 y(is)42 b(running)f(causes)i(that)g(pro)s(cess)f(to)h(b)s(e)f +(stopp)s(ed)f(and)h(returns)f(con)m(trol)j(to)f(Bash.)77 +b(T)m(yping)42 b(the)150 3761 y Fr(dela)m(y)m(ed)k(susp)s(end)f +Fu(c)m(haracter)h(\(t)m(ypically)g(`)p Ft(^Y)p Fu(',)i(Con)m(trol-Y\))e +(causes)e(the)h(pro)s(cess)e(to)i(b)s(e)f(stopp)s(ed)150 +3870 y(when)26 b(it)i(attempts)h(to)f(read)f(input)g(from)f(the)i +(terminal,)h(and)e(con)m(trol)h(to)g(b)s(e)f(returned)f(to)j(Bash.)39 +b(The)150 3980 y(user)e(then)g(manipulates)h(the)g(state)h(of)f(this)f +(job,)j(using)d(the)h Ft(bg)f Fu(command)g(to)h(con)m(tin)m(ue)h(it)f +(in)g(the)150 4089 y(bac)m(kground,)g(the)f Ft(fg)g Fu(command)f(to)i +(con)m(tin)m(ue)g(it)f(in)f(the)h(foreground,)h(or)f(the)g +Ft(kill)f Fu(command)g(to)150 4199 y(kill)27 b(it.)40 +b(A)27 b(`)p Ft(^Z)p Fu(')g(tak)m(es)h(e\013ect)g(immediately)-8 +b(,)29 b(and)d(has)h(the)f(additional)i(side)e(e\013ect)j(of)d(causing) +h(p)s(ending)150 4309 y(output)j(and)g(t)m(yp)s(eahead)h(to)g(b)s(e)e +(discarded.)275 4441 y(There)j(are)g(a)h(n)m(um)m(b)s(er)e(of)i(w)m(a)m +(ys)g(to)h(refer)e(to)h(a)g(job)f(in)g(the)h(shell.)47 +b(The)32 b(c)m(haracter)i(`)p Ft(\045)p Fu(')f(in)m(tro)s(duces)150 +4550 y(a)e(job)f(sp)s(eci\014cation)h(\()p Fr(jobsp)s(ec)6 +b Fu(\).)275 4682 y(Job)31 b(n)m(um)m(b)s(er)f Ft(n)h +Fu(ma)m(y)h(b)s(e)f(referred)g(to)h(as)g(`)p Ft(\045n)p +Fu('.)44 b(The)31 b(sym)m(b)s(ols)g(`)p Ft(\045\045)p +Fu(')h(and)f(`)p Ft(\045+)p Fu(')g(refer)h(to)g(the)g(shell's)150 +4792 y(notion)k(of)f(the)g(curren)m(t)g(job,)h(whic)m(h)f(is)g(the)g +(last)h(job)f(stopp)s(ed)f(while)h(it)h(w)m(as)g(in)e(the)i(foreground) +e(or)150 4902 y(started)27 b(in)g(the)g(bac)m(kground.)40 +b(A)27 b(single)g(`)p Ft(\045)p Fu(')g(\(with)g(no)g(accompan)m(ying)i +(job)d(sp)s(eci\014cation\))i(also)g(refers)150 5011 +y(to)k(the)e(curren)m(t)h(job.)42 b(The)30 b(previous)g(job)h(ma)m(y)g +(b)s(e)f(referenced)h(using)f(`)p Ft(\045-)p Fu('.)42 +b(If)30 b(there)h(is)g(only)g(a)g(single)150 5121 y(job,)g(`)p +Ft(\045+)p Fu(')g(and)f(`)p Ft(\045-)p Fu(')h(can)h(b)s(oth)e(b)s(e)g +(used)h(to)g(refer)g(to)h(that)g(job.)42 b(In)30 b(output)h(p)s +(ertaining)g(to)g(jobs)g(\(e.g.,)150 5230 y(the)39 b(output)f(of)g(the) +h Ft(jobs)e Fu(command\),)k(the)d(curren)m(t)h(job)f(is)g(alw)m(a)m(ys) +i(\015agged)f(with)f(a)h(`)p Ft(+)p Fu(',)i(and)d(the)150 +5340 y(previous)30 b(job)g(with)g(a)h(`)p Ft(-)p Fu('.)p +eop end +%%Page: 98 104 +TeXDict begin 98 103 bop 150 -116 a Fu(Chapter)30 b(7:)41 +b(Job)30 b(Con)m(trol)2571 b(98)275 299 y(A)38 b(job)g(ma)m(y)h(also)g +(b)s(e)f(referred)f(to)j(using)d(a)i(pre\014x)e(of)i(the)f(name)h(used) +e(to)i(start)g(it,)i(or)e(using)f(a)150 408 y(substring)29 +b(that)i(app)s(ears)f(in)g(its)h(command)f(line.)41 b(F)-8 +b(or)31 b(example,)g(`)p Ft(\045ce)p Fu(')f(refers)g(to)h(a)g(stopp)s +(ed)e Ft(ce)h Fu(job.)150 518 y(Using)d(`)p Ft(\045?ce)p +Fu(',)g(on)f(the)h(other)g(hand,)g(refers)f(to)h(an)m(y)g(job)g(con)m +(taining)h(the)f(string)f(`)p Ft(ce)p Fu(')h(in)f(its)h(command)150 +628 y(line.)41 b(If)30 b(the)h(pre\014x)e(or)h(substring)f(matc)m(hes)j +(more)e(than)h(one)f(job,)h(Bash)f(rep)s(orts)g(an)g(error.)275 +762 y(Simply)g(naming)h(a)g(job)g(can)g(b)s(e)f(used)h(to)g(bring)f(it) +i(in)m(to)g(the)f(foreground:)41 b(`)p Ft(\0451)p Fu(')31 +b(is)g(a)h(synon)m(ym)e(for)150 871 y(`)p Ft(fg)g(\0451)p +Fu(',)i(bringing)f(job)g(1)g(from)g(the)h(bac)m(kground)f(in)m(to)i +(the)e(foreground.)44 b(Similarly)-8 b(,)32 b(`)p Ft(\0451)e(&)p +Fu(')i(resumes)150 981 y(job)e(1)h(in)f(the)g(bac)m(kground,)h(equiv)-5 +b(alen)m(t)32 b(to)f(`)p Ft(bg)f(\0451)p Fu(')275 1115 +y(The)g(shell)i(learns)f(immediately)i(whenev)m(er)e(a)h(job)f(c)m +(hanges)h(state.)45 b(Normally)-8 b(,)33 b(Bash)e(w)m(aits)i(un)m(til) +150 1224 y(it)25 b(is)g(ab)s(out)f(to)i(prin)m(t)e(a)h(prompt)f(b)s +(efore)g(rep)s(orting)h(c)m(hanges)g(in)g(a)g(job's)f(status)h(so)g(as) +g(to)g(not)g(in)m(terrupt)150 1334 y(an)m(y)k(other)f(output.)40 +b(If)28 b(the)g Ft(-b)g Fu(option)g(to)h(the)g Ft(set)e +Fu(builtin)h(is)g(enabled,)h(Bash)g(rep)s(orts)e(suc)m(h)h(c)m(hanges) +150 1443 y(immediately)d(\(see)g(Section)g(4.3.1)g([The)f(Set)g +(Builtin],)i(page)f(58\).)40 b(An)m(y)24 b(trap)f(on)h +Ft(SIGCHLD)e Fu(is)i(executed)150 1553 y(for)30 b(eac)m(h)i(c)m(hild)e +(pro)s(cess)g(that)h(exits.)275 1687 y(If)25 b(an)h(attempt)h(to)g +(exit)g(Bash)f(is)h(made)f(while)g(jobs)f(are)i(stopp)s(ed,)f(\(or)h +(running,)e(if)h(the)g Ft(checkjobs)150 1796 y Fu(option)e(is)f +(enabled)h({)g(see)g(Section)g(4.3.2)h([The)e(Shopt)g(Builtin],)j(page) +e(62\),)i(the)e(shell)f(prin)m(ts)g(a)h(w)m(arning)150 +1906 y(message,)k(and)c(if)i(the)f Ft(checkjobs)e Fu(option)j(is)f +(enabled,)i(lists)e(the)h(jobs)f(and)f(their)i(statuses.)39 +b(The)25 b Ft(jobs)150 2016 y Fu(command)36 b(ma)m(y)h(then)f(b)s(e)f +(used)g(to)i(insp)s(ect)f(their)g(status.)59 b(If)36 +b(a)g(second)g(attempt)i(to)f(exit)g(is)f(made)150 2125 +y(without)e(an)f(in)m(terv)m(ening)i(command,)f(Bash)g(do)s(es)f(not)h +(prin)m(t)g(another)f(w)m(arning,)i(and)e(an)m(y)h(stopp)s(ed)150 +2235 y(jobs)c(are)h(terminated.)150 2466 y Fs(7.2)68 +b(Job)45 b(Con)l(trol)h(Builtins)150 2650 y Ft(bg)870 +2784 y(bg)h([)p Fj(jobspec)f Ft(...)o(])630 2918 y Fu(Resume)24 +b(eac)m(h)h(susp)s(ended)d(job)i Fr(jobsp)s(ec)29 b Fu(in)24 +b(the)g(bac)m(kground,)h(as)g(if)f(it)h(had)e(b)s(een)g(started)630 +3027 y(with)32 b(`)p Ft(&)p Fu('.)45 b(If)31 b Fr(jobsp)s(ec)37 +b Fu(is)32 b(not)g(supplied,)f(the)h(curren)m(t)g(job)f(is)h(used.)45 +b(The)31 b(return)g(status)630 3137 y(is)i(zero)g(unless)f(it)h(is)g +(run)e(when)h(job)g(con)m(trol)i(is)f(not)g(enabled,)h(or,)f(when)f +(run)f(with)h(job)630 3246 y(con)m(trol)h(enabled,)g(an)m(y)f +Fr(jobsp)s(ec)37 b Fu(w)m(as)32 b(not)g(found)f(or)g(sp)s(eci\014es)h +(a)g(job)g(that)g(w)m(as)g(started)630 3356 y(without)e(job)g(con)m +(trol.)150 3514 y Ft(fg)870 3648 y(fg)47 b([)p Fj(jobspec)p +Ft(])630 3782 y Fu(Resume)c(the)g(job)g Fr(jobsp)s(ec)48 +b Fu(in)43 b(the)g(foreground)g(and)f(mak)m(e)j(it)e(the)h(curren)m(t)f +(job.)78 b(If)630 3891 y Fr(jobsp)s(ec)41 b Fu(is)c(not)f(supplied,)h +(the)f(curren)m(t)h(job)f(is)g(used.)58 b(The)36 b(return)f(status)h +(is)h(that)g(of)630 4001 y(the)d(command)g(placed)h(in)m(to)g(the)f +(foreground,)g(or)g(non-zero)h(if)f(run)f(when)g(job)g(con)m(trol)630 +4111 y(is)i(disabled)g(or,)i(when)d(run)g(with)h(job)g(con)m(trol)h +(enabled,)h Fr(jobsp)s(ec)j Fu(do)s(es)35 b(not)h(sp)s(ecify)f(a)630 +4220 y(v)-5 b(alid)31 b(job)f(or)g Fr(jobsp)s(ec)35 b +Fu(sp)s(eci\014es)30 b(a)h(job)f(that)h(w)m(as)g(started)g(without)f +(job)g(con)m(trol.)150 4378 y Ft(jobs)870 4512 y(jobs)47 +b([-lnprs])e([)p Fj(jobspec)p Ft(])870 4622 y(jobs)i(-x)g +Fj(command)f Ft([)p Fj(arguments)p Ft(])630 4756 y Fu(The)30 +b(\014rst)f(form)h(lists)h(the)g(activ)m(e)h(jobs.)41 +b(The)30 b(options)g(ha)m(v)m(e)i(the)e(follo)m(wing)i(meanings:)630 +4914 y Ft(-l)384 b Fu(List)31 b(pro)s(cess)f Fm(id)p +Fu(s)g(in)g(addition)h(to)g(the)f(normal)h(information.)630 +5072 y Ft(-n)384 b Fu(Displa)m(y)26 b(information)f(only)h(ab)s(out)e +(jobs)h(that)g(ha)m(v)m(e)i(c)m(hanged)e(status)h(since)1110 +5182 y(the)31 b(user)e(w)m(as)i(last)g(noti\014ed)f(of)h(their)f +(status.)630 5340 y Ft(-p)384 b Fu(List)31 b(only)f(the)h(pro)s(cess)f +Fm(id)g Fu(of)h(the)f(job's)g(pro)s(cess)g(group)g(leader.)p +eop end +%%Page: 99 105 +TeXDict begin 99 104 bop 150 -116 a Fu(Chapter)30 b(7:)41 +b(Job)30 b(Con)m(trol)2571 b(99)630 299 y Ft(-r)384 b +Fu(Displa)m(y)32 b(only)e(running)f(jobs.)630 461 y Ft(-s)384 +b Fu(Displa)m(y)32 b(only)e(stopp)s(ed)f(jobs.)630 622 +y(If)23 b Fr(jobsp)s(ec)28 b Fu(is)23 b(giv)m(en,)i(output)e(is)g +(restricted)h(to)g(information)f(ab)s(out)g(that)h(job.)37 +b(If)23 b Fr(jobsp)s(ec)630 732 y Fu(is)30 b(not)h(supplied,)e(the)i +(status)g(of)f(all)h(jobs)f(is)h(listed.)630 868 y(If)k(the)g +Ft(-x)f Fu(option)i(is)f(supplied,)g Ft(jobs)f Fu(replaces)i(an)m(y)f +Fr(jobsp)s(ec)40 b Fu(found)34 b(in)h Fr(command)j Fu(or)630 +977 y Fr(argumen)m(ts)j Fu(with)c(the)h(corresp)s(onding)e(pro)s(cess)h +(group)f Fm(id)p Fu(,)k(and)c(executes)j Fr(command)p +Fu(,)630 1087 y(passing)30 b(it)h Fr(argumen)m(t)r Fu(s,)g(returning)f +(its)g(exit)i(status.)150 1249 y Ft(kill)870 1384 y(kill)47 +b([-s)g Fj(sigspec)p Ft(])e([-n)i Fj(signum)p Ft(])f([-)p +Fj(sigspec)p Ft(])f Fj(jobspec)h Ft(or)h Fj(pid)870 1494 +y Ft(kill)g(-l)g([)p Fj(exit_status)p Ft(])630 1630 y +Fu(Send)22 b(a)i(signal)g(sp)s(eci\014ed)f(b)m(y)g Fr(sigsp)s(ec)29 +b Fu(or)24 b Fr(sign)m(um)f Fu(to)h(the)g(pro)s(cess)f(named)g(b)m(y)g +(job)g(sp)s(eci\014-)630 1739 y(cation)k Fr(jobsp)s(ec)j +Fu(or)25 b(pro)s(cess)g Fm(id)h Fr(pid)p Fu(.)38 b Fr(sigsp)s(ec)31 +b Fu(is)25 b(either)h(a)g(case-insensitiv)m(e)i(signal)e(name)630 +1849 y(suc)m(h)37 b(as)g Ft(SIGINT)f Fu(\(with)h(or)g(without)g(the)g +Ft(SIG)g Fu(pre\014x\))f(or)h(a)h(signal)g(n)m(um)m(b)s(er;)h +Fr(sign)m(um)630 1958 y Fu(is)g(a)f(signal)i(n)m(um)m(b)s(er.)63 +b(If)39 b Fr(sigsp)s(ec)44 b Fu(and)38 b Fr(sign)m(um)g +Fu(are)h(not)g(presen)m(t,)h Ft(SIGTERM)d Fu(is)h(used.)630 +2068 y(The)27 b Ft(-l)h Fu(option)g(lists)h(the)f(signal)h(names.)39 +b(If)28 b(an)m(y)g(argumen)m(ts)h(are)f(supplied)f(when)g +Ft(-l)g Fu(is)630 2178 y(giv)m(en,)32 b(the)g(names)e(of)i(the)f +(signals)g(corresp)s(onding)f(to)i(the)f(argumen)m(ts)g(are)h(listed,)g +(and)630 2287 y(the)c(return)f(status)h(is)g(zero.)41 +b Fr(exit)p 1796 2287 28 4 v 41 w(status)32 b Fu(is)c(a)g(n)m(um)m(b)s +(er)f(sp)s(ecifying)g(a)i(signal)f(n)m(um)m(b)s(er)f(or)630 +2397 y(the)35 b(exit)h(status)f(of)g(a)g(pro)s(cess)g(terminated)g(b)m +(y)g(a)g(signal.)55 b(The)34 b(return)g(status)h(is)g(zero)630 +2506 y(if)c(at)h(least)g(one)g(signal)f(w)m(as)h(successfully)f(sen)m +(t,)h(or)f(non-zero)h(if)f(an)g(error)f(o)s(ccurs)h(or)g(an)630 +2616 y(in)m(v)-5 b(alid)31 b(option)g(is)f(encoun)m(tered.)150 +2778 y Ft(wait)870 2913 y(wait)47 b([-n])f([)p Fj(jobspec)g +Ft(or)h Fj(pid)g Ft(...)o(])630 3049 y Fu(W)-8 b(ait)28 +b(un)m(til)f(the)f(c)m(hild)h(pro)s(cess)f(sp)s(eci\014ed)g(b)m(y)g +(eac)m(h)h(pro)s(cess)f Fm(id)h Fr(pid)i Fu(or)d(job)g(sp)s +(eci\014cation)630 3159 y Fr(jobsp)s(ec)j Fu(exits)c(and)f(return)g +(the)g(exit)h(status)g(of)g(the)f(last)h(command)g(w)m(aited)g(for.)39 +b(If)23 b(a)i(job)630 3268 y(sp)s(ec)j(is)g(giv)m(en,)i(all)f(pro)s +(cesses)f(in)g(the)g(job)g(are)h(w)m(aited)g(for.)40 +b(If)27 b(no)i(argumen)m(ts)f(are)h(giv)m(en,)630 3378 +y(all)f(curren)m(tly)g(activ)m(e)i(c)m(hild)e(pro)s(cesses)f(are)h(w)m +(aited)g(for,)g(and)f(the)h(return)e(status)i(is)g(zero.)630 +3487 y(If)f(the)g Ft(-n)g Fu(option)h(is)f(supplied,)g +Ft(wait)f Fu(w)m(aits)i(for)f(an)m(y)h(job)f(to)h(terminate)g(and)f +(returns)f(its)630 3597 y(exit)37 b(status.)56 b(If)36 +b(neither)f Fr(jobsp)s(ec)41 b Fu(nor)35 b Fr(pid)j Fu(sp)s(eci\014es)d +(an)h(activ)m(e)i(c)m(hild)e(pro)s(cess)f(of)h(the)630 +3707 y(shell,)31 b(the)f(return)g(status)g(is)h(127.)150 +3868 y Ft(disown)870 4004 y(disown)46 b([-ar])g([-h])h([)p +Fj(jobspec)f Ft(...)o(])630 4140 y Fu(Without)33 b(options,)h(remo)m(v) +m(e)g(eac)m(h)f Fr(jobsp)s(ec)38 b Fu(from)32 b(the)h(table)g(of)g +(activ)m(e)h(jobs.)47 b(If)32 b(the)h Ft(-h)630 4249 +y Fu(option)j(is)f(giv)m(en,)i(the)f(job)f(is)g(not)g(remo)m(v)m(ed)h +(from)f(the)g(table,)j(but)c(is)i(mark)m(ed)f(so)g(that)630 +4359 y Ft(SIGHUP)e Fu(is)j(not)f(sen)m(t)h(to)g(the)f(job)g(if)g(the)g +(shell)h(receiv)m(es)h(a)e Ft(SIGHUP)p Fu(.)54 b(If)34 +b Fr(jobsp)s(ec)40 b Fu(is)c(not)630 4468 y(presen)m(t,)41 +b(and)d(neither)h(the)g Ft(-a)f Fu(nor)g(the)h Ft(-r)f +Fu(option)h(is)g(supplied,)g(the)g(curren)m(t)g(job)f(is)630 +4578 y(used.)g(If)25 b(no)h Fr(jobsp)s(ec)k Fu(is)c(supplied,)f(the)h +Ft(-a)f Fu(option)h(means)g(to)g(remo)m(v)m(e)h(or)e(mark)h(all)g +(jobs;)630 4688 y(the)31 b Ft(-r)e Fu(option)i(without)g(a)f +Fr(jobsp)s(ec)36 b Fu(argumen)m(t)30 b(restricts)h(op)s(eration)g(to)g +(running)e(jobs.)150 4849 y Ft(suspend)870 4985 y(suspend)46 +b([-f])630 5121 y Fu(Susp)s(end)31 b(the)i(execution)h(of)g(this)f +(shell)g(un)m(til)h(it)g(receiv)m(es)h(a)e Ft(SIGCONT)f +Fu(signal.)50 b(A)33 b(login)630 5230 y(shell)28 b(cannot)g(b)s(e)f +(susp)s(ended;)g(the)g Ft(-f)g Fu(option)i(can)f(b)s(e)f(used)g(to)h(o) +m(v)m(erride)h(this)e(and)g(force)630 5340 y(the)k(susp)s(ension.)p +eop end +%%Page: 100 106 +TeXDict begin 100 105 bop 150 -116 a Fu(Chapter)30 b(7:)41 +b(Job)30 b(Con)m(trol)2526 b(100)275 299 y(When)30 b(job)f(con)m(trol)j +(is)e(not)h(activ)m(e,)i(the)d Ft(kill)f Fu(and)h Ft(wait)f +Fu(builtins)g(do)h(not)h(accept)h Fr(jobsp)s(ec)j Fu(argu-)150 +408 y(men)m(ts.)41 b(They)30 b(m)m(ust)g(b)s(e)g(supplied)f(pro)s(cess) +h Fm(id)p Fu(s.)150 641 y Fs(7.3)68 b(Job)45 b(Con)l(trol)h(V)-11 +b(ariables)150 825 y Ft(auto_resume)630 935 y Fu(This)31 +b(v)-5 b(ariable)32 b(con)m(trols)g(ho)m(w)g(the)f(shell)h(in)m +(teracts)h(with)e(the)h(user)e(and)h(job)g(con)m(trol.)45 +b(If)630 1044 y(this)28 b(v)-5 b(ariable)30 b(exists)f(then)f(single)h +(w)m(ord)f(simple)h(commands)f(without)g(redirections)i(are)630 +1154 y(treated)h(as)g(candidates)f(for)g(resumption)g(of)g(an)g +(existing)h(job.)41 b(There)29 b(is)h(no)h(am)m(biguit)m(y)630 +1264 y(allo)m(w)m(ed;)f(if)d(there)g(is)g(more)g(than)f(one)h(job)g(b)s +(eginning)f(with)g(the)h(string)g(t)m(yp)s(ed,)g(then)g(the)630 +1373 y(most)j(recen)m(tly)h(accessed)f(job)f(will)h(b)s(e)f(selected.) +42 b(The)29 b(name)g(of)h(a)g(stopp)s(ed)e(job,)i(in)f(this)630 +1483 y(con)m(text,)h(is)e(the)g(command)g(line)g(used)f(to)h(start)g +(it.)41 b(If)27 b(this)h(v)-5 b(ariable)28 b(is)g(set)g(to)h(the)e(v)-5 +b(alue)630 1592 y(`)p Ft(exact)p Fu(',)33 b(the)g(string)g(supplied)f +(m)m(ust)h(matc)m(h)g(the)h(name)f(of)g(a)g(stopp)s(ed)f(job)h +(exactly;)j(if)630 1702 y(set)29 b(to)h(`)p Ft(substring)p +Fu(',)d(the)i(string)g(supplied)e(needs)i(to)g(matc)m(h)h(a)f +(substring)f(of)h(the)g(name)630 1812 y(of)38 b(a)f(stopp)s(ed)g(job.) +62 b(The)37 b(`)p Ft(substring)p Fu(')e(v)-5 b(alue)38 +b(pro)m(vides)f(functionalit)m(y)i(analogous)g(to)630 +1921 y(the)f(`)p Ft(\045?)p Fu(')f(job)h Fm(id)f Fu(\(see)i(Section)f +(7.1)h([Job)f(Con)m(trol)g(Basics],)j(page)d(97\).)64 +b(If)37 b(set)h(to)h(an)m(y)630 2031 y(other)32 b(v)-5 +b(alue,)32 b(the)g(supplied)e(string)i(m)m(ust)f(b)s(e)g(a)h(pre\014x)f +(of)h(a)g(stopp)s(ed)e(job's)i(name;)g(this)630 2140 +y(pro)m(vides)e(functionalit)m(y)i(analogous)g(to)f(the)g(`)p +Ft(\045)p Fu(')f(job)g Fm(id)p Fu(.)p eop end +%%Page: 101 107 +TeXDict begin 101 106 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(101)150 299 y Fp(8)80 +b(Command)54 b(Line)f(Editing)150 640 y Fu(This)28 b(c)m(hapter)i +(describ)s(es)e(the)h(basic)g(features)h(of)f(the)g Fm(gnu)f +Fu(command)h(line)g(editing)h(in)m(terface.)42 b(Com-)150 +749 y(mand)c(line)i(editing)f(is)g(pro)m(vided)g(b)m(y)g(the)g +(Readline)h(library)-8 b(,)41 b(whic)m(h)e(is)g(used)f(b)m(y)h(sev)m +(eral)h(di\013eren)m(t)150 859 y(programs,)34 b(including)e(Bash.)49 +b(Command)32 b(line)i(editing)f(is)g(enabled)g(b)m(y)g(default)g(when)f +(using)h(an)g(in-)150 969 y(teractiv)m(e)h(shell,)d(unless)g(the)g +Ft(--noediting)d Fu(option)k(is)f(supplied)e(at)j(shell)f(in)m(v)m(o)s +(cation.)45 b(Line)31 b(editing)150 1078 y(is)g(also)h(used)f(when)f +(using)h(the)g Ft(-e)g Fu(option)h(to)g(the)f Ft(read)f +Fu(builtin)h(command)g(\(see)h(Section)g(4.2)h([Bash)150 +1188 y(Builtins],)j(page)f(48\).)52 b(By)35 b(default,)g(the)f(line)h +(editing)f(commands)g(are)h(similar)f(to)h(those)f(of)g(Emacs.)150 +1297 y(A)h(vi-st)m(yle)h(line)f(editing)g(in)m(terface)h(is)e(also)i(a) +m(v)-5 b(ailable.)55 b(Line)34 b(editing)h(can)g(b)s(e)f(enabled)g(at)h +(an)m(y)g(time)150 1407 y(using)h(the)g Ft(-o)30 b(emacs)35 +b Fu(or)h Ft(-o)30 b(vi)35 b Fu(options)i(to)g(the)f +Ft(set)f Fu(builtin)h(command)g(\(see)h(Section)g(4.3.1)h([The)150 +1517 y(Set)31 b(Builtin],)g(page)g(58\),)h(or)e(disabled)g(using)g(the) +h Ft(+o)e(emacs)g Fu(or)i Ft(+o)e(vi)h Fu(options)h(to)g +Ft(set)p Fu(.)150 1802 y Fs(8.1)68 b(In)l(tro)t(duction)45 +b(to)g(Line)h(Editing)150 1962 y Fu(The)30 b(follo)m(wing)i(paragraphs) +d(describ)s(e)h(the)h(notation)g(used)f(to)h(represen)m(t)f(k)m +(eystrok)m(es.)275 2132 y(The)35 b(text)i Fj(C-k)f Fu(is)g(read)g(as)h +(`Con)m(trol-K')g(and)f(describ)s(es)f(the)h(c)m(haracter)i(pro)s +(duced)d(when)g(the)h Ft(k)150 2242 y Fu(k)m(ey)31 b(is)g(pressed)e +(while)h(the)h(Con)m(trol)g(k)m(ey)g(is)g(depressed.)275 +2412 y(The)g(text)i Fj(M-k)e Fu(is)h(read)f(as)i(`Meta-K')g(and)f +(describ)s(es)f(the)h(c)m(haracter)h(pro)s(duced)e(when)f(the)i(Meta) +150 2521 y(k)m(ey)i(\(if)f(y)m(ou)h(ha)m(v)m(e)g(one\))g(is)f +(depressed,)g(and)f(the)h Ft(k)g Fu(k)m(ey)h(is)f(pressed.)48 +b(The)32 b(Meta)j(k)m(ey)e(is)h(lab)s(eled)f Ft(ALT)150 +2631 y Fu(on)c(man)m(y)h(k)m(eyb)s(oards.)40 b(On)29 +b(k)m(eyb)s(oards)g(with)h(t)m(w)m(o)h(k)m(eys)f(lab)s(eled)g +Ft(ALT)e Fu(\(usually)i(to)g(either)g(side)g(of)g(the)150 +2740 y(space)h(bar\),)f(the)g Ft(ALT)f Fu(on)h(the)g(left)h(side)f(is)g +(generally)h(set)f(to)h(w)m(ork)f(as)g(a)h(Meta)g(k)m(ey)-8 +b(.)42 b(The)29 b Ft(ALT)g Fu(k)m(ey)i(on)150 2850 y(the)c(righ)m(t)h +(ma)m(y)g(also)g(b)s(e)f(con\014gured)f(to)i(w)m(ork)f(as)h(a)f(Meta)i +(k)m(ey)f(or)f(ma)m(y)h(b)s(e)e(con\014gured)h(as)g(some)h(other)150 +2960 y(mo)s(di\014er,)i(suc)m(h)g(as)g(a)h(Comp)s(ose)f(k)m(ey)h(for)f +(t)m(yping)h(accen)m(ted)h(c)m(haracters.)275 3130 y(If)23 +b(y)m(ou)i(do)f(not)h(ha)m(v)m(e)h(a)f(Meta)g(or)g Ft(ALT)e +Fu(k)m(ey)-8 b(,)27 b(or)e(another)f(k)m(ey)i(w)m(orking)e(as)h(a)g +(Meta)h(k)m(ey)-8 b(,)27 b(the)d(iden)m(tical)150 3239 +y(k)m(eystrok)m(e)30 b(can)f(b)s(e)f(generated)h(b)m(y)g(t)m(yping)g +Ft(ESC)e Fl(\014rst)p Fu(,)j(and)e(then)g(t)m(yping)h +Ft(k)p Fu(.)40 b(Either)28 b(pro)s(cess)g(is)g(kno)m(wn)150 +3349 y(as)j Fr(metafying)39 b Fu(the)30 b Ft(k)g Fu(k)m(ey)-8 +b(.)275 3519 y(The)39 b(text)j Fj(M-C-k)d Fu(is)h(read)g(as)h +(`Meta-Con)m(trol-k')j(and)39 b(describ)s(es)h(the)g(c)m(haracter)i +(pro)s(duced)d(b)m(y)150 3629 y Fr(metafying)g Fj(C-k)p +Fu(.)275 3799 y(In)c(addition,)j(sev)m(eral)f(k)m(eys)g(ha)m(v)m(e)g +(their)f(o)m(wn)g(names.)58 b(Sp)s(eci\014cally)-8 b(,)38 +b Ft(DEL)p Fu(,)f Ft(ESC)p Fu(,)g Ft(LFD)p Fu(,)g Ft(SPC)p +Fu(,)g Ft(RET)p Fu(,)150 3908 y(and)d Ft(TAB)f Fu(all)j(stand)e(for)g +(themselv)m(es)i(when)d(seen)i(in)f(this)g(text,)j(or)d(in)h(an)f(init) +h(\014le)f(\(see)i(Section)f(8.3)150 4018 y([Readline)f(Init)g(File],)i +(page)e(104\).)52 b(If)33 b(y)m(our)g(k)m(eyb)s(oard)h(lac)m(ks)g(a)g +Ft(LFD)f Fu(k)m(ey)-8 b(,)36 b(t)m(yping)e Ft(C-j)e Fu(will)i(pro)s +(duce)150 4128 y(the)d(desired)e(c)m(haracter.)43 b(The)30 +b Ft(RET)f Fu(k)m(ey)i(ma)m(y)g(b)s(e)f(lab)s(eled)h +Ft(Return)d Fu(or)j Ft(Enter)d Fu(on)j(some)g(k)m(eyb)s(oards.)150 +4413 y Fs(8.2)68 b(Readline)47 b(In)l(teraction)150 4573 +y Fu(Often)32 b(during)g(an)g(in)m(teractiv)m(e)j(session)e(y)m(ou)g(t) +m(yp)s(e)g(in)f(a)h(long)g(line)g(of)f(text,)j(only)d(to)i(notice)g +(that)f(the)150 4682 y(\014rst)f(w)m(ord)g(on)g(the)g(line)h(is)g +(missp)s(elled.)46 b(The)32 b(Readline)h(library)f(giv)m(es)h(y)m(ou)g +(a)g(set)g(of)f(commands)g(for)150 4792 y(manipulating)e(the)g(text)h +(as)f(y)m(ou)g(t)m(yp)s(e)g(it)g(in,)g(allo)m(wing)h(y)m(ou)f(to)h +(just)e(\014x)g(y)m(our)h(t)m(yp)s(o,)g(and)g(not)g(forcing)150 +4902 y(y)m(ou)e(to)h(ret)m(yp)s(e)g(the)f(ma)5 b(jorit)m(y)29 +b(of)f(the)h(line.)40 b(Using)28 b(these)h(editing)g(commands,)f(y)m +(ou)h(mo)m(v)m(e)g(the)g(cursor)150 5011 y(to)35 b(the)f(place)i(that)e +(needs)g(correction,)j(and)d(delete)h(or)f(insert)h(the)f(text)h(of)g +(the)f(corrections.)54 b(Then,)150 5121 y(when)24 b(y)m(ou)h(are)g +(satis\014ed)g(with)g(the)g(line,)i(y)m(ou)e(simply)f(press)g +Ft(RET)p Fu(.)39 b(Y)-8 b(ou)25 b(do)g(not)g(ha)m(v)m(e)h(to)g(b)s(e)e +(at)h(the)h(end)150 5230 y(of)33 b(the)h(line)g(to)g(press)e +Ft(RET)p Fu(;)i(the)g(en)m(tire)g(line)f(is)h(accepted)g(regardless)g +(of)f(the)h(lo)s(cation)h(of)e(the)h(cursor)150 5340 +y(within)c(the)g(line.)p eop end +%%Page: 102 108 +TeXDict begin 102 107 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(102)150 299 y Fk(8.2.1)63 +b(Readline)40 b(Bare)h(Essen)m(tials)150 446 y Fu(In)31 +b(order)h(to)h(en)m(ter)g(c)m(haracters)g(in)m(to)g(the)g(line,)g +(simply)e(t)m(yp)s(e)i(them.)46 b(The)31 b(t)m(yp)s(ed)h(c)m(haracter)i +(app)s(ears)150 555 y(where)e(the)h(cursor)e(w)m(as,)j(and)e(then)g +(the)h(cursor)e(mo)m(v)m(es)j(one)f(space)g(to)g(the)g(righ)m(t.)47 +b(If)32 b(y)m(ou)h(mist)m(yp)s(e)g(a)150 665 y(c)m(haracter,)f(y)m(ou)f +(can)g(use)f(y)m(our)g(erase)h(c)m(haracter)h(to)f(bac)m(k)g(up)f(and)f +(delete)j(the)f(mist)m(yp)s(ed)e(c)m(haracter.)275 806 +y(Sometimes)i(y)m(ou)g(ma)m(y)h(mist)m(yp)s(e)e(a)i(c)m(haracter,)g +(and)e(not)i(notice)g(the)f(error)f(un)m(til)h(y)m(ou)g(ha)m(v)m(e)h(t) +m(yp)s(ed)150 916 y(sev)m(eral)e(other)f(c)m(haracters.)42 +b(In)28 b(that)i(case,)g(y)m(ou)f(can)g(t)m(yp)s(e)h +Fj(C-b)d Fu(to)j(mo)m(v)m(e)g(the)f(cursor)g(to)g(the)g(left,)i(and)150 +1026 y(then)f(correct)i(y)m(our)e(mistak)m(e.)42 b(Afterw)m(ards,)31 +b(y)m(ou)f(can)h(mo)m(v)m(e)h(the)e(cursor)g(to)h(the)g(righ)m(t)g +(with)f Fj(C-f)p Fu(.)275 1167 y(When)i(y)m(ou)h(add)f(text)h(in)f(the) +h(middle)f(of)h(a)g(line,)h(y)m(ou)e(will)h(notice)h(that)f(c)m +(haracters)h(to)g(the)e(righ)m(t)150 1277 y(of)d(the)g(cursor)f(are)h +(`pushed)e(o)m(v)m(er')j(to)g(mak)m(e)f(ro)s(om)g(for)f(the)h(text)h +(that)f(y)m(ou)g(ha)m(v)m(e)h(inserted.)40 b(Lik)m(ewise,)150 +1386 y(when)d(y)m(ou)g(delete)i(text)g(b)s(ehind)c(the)j(cursor,)h(c)m +(haracters)g(to)f(the)g(righ)m(t)g(of)g(the)g(cursor)e(are)i(`pulled) +150 1496 y(bac)m(k')24 b(to)f(\014ll)g(in)f(the)h(blank)f(space)i +(created)f(b)m(y)g(the)g(remo)m(v)-5 b(al)24 b(of)f(the)g(text.)39 +b(A)23 b(list)g(of)g(the)g(bare)f(essen)m(tials)150 1605 +y(for)30 b(editing)h(the)g(text)g(of)g(an)f(input)f(line)i(follo)m(ws.) +150 1775 y Fj(C-b)336 b Fu(Mo)m(v)m(e)32 b(bac)m(k)g(one)e(c)m +(haracter.)150 1941 y Fj(C-f)336 b Fu(Mo)m(v)m(e)32 b(forw)m(ard)e(one) +h(c)m(haracter.)150 2108 y Ft(DEL)e Fu(or)i Ft(Backspace)630 +2217 y Fu(Delete)i(the)d(c)m(haracter)i(to)f(the)g(left)g(of)f(the)h +(cursor.)150 2384 y Fj(C-d)336 b Fu(Delete)33 b(the)d(c)m(haracter)i +(underneath)d(the)i(cursor.)150 2550 y(Prin)m(ting)g(c)m(haracters)630 +2660 y(Insert)f(the)g(c)m(haracter)i(in)m(to)g(the)e(line)h(at)g(the)g +(cursor.)150 2826 y Fj(C-_)e Fu(or)i Fj(C-x)e(C-u)630 +2936 y Fu(Undo)k(the)h(last)g(editing)g(command.)50 b(Y)-8 +b(ou)34 b(can)f(undo)g(all)h(the)f(w)m(a)m(y)i(bac)m(k)f(to)g(an)g +(empt)m(y)630 3045 y(line.)150 3215 y(\(Dep)s(ending)29 +b(on)h(y)m(our)f(con\014guration,)i(the)e Ft(Backspace)e +Fu(k)m(ey)k(b)s(e)d(set)j(to)f(delete)h(the)e(c)m(haracter)i(to)g(the) +150 3324 y(left)37 b(of)f(the)h(cursor)e(and)h(the)g +Ft(DEL)g Fu(k)m(ey)h(set)f(to)h(delete)h(the)e(c)m(haracter)i +(underneath)d(the)h(cursor,)i(lik)m(e)150 3434 y Fj(C-d)p +Fu(,)30 b(rather)g(than)g(the)h(c)m(haracter)h(to)f(the)f(left)h(of)g +(the)f(cursor.\))150 3640 y Fk(8.2.2)63 b(Readline)40 +b(Mo)m(v)m(emen)m(t)h(Commands)150 3787 y Fu(The)27 b(ab)s(o)m(v)m(e)i +(table)g(describ)s(es)e(the)g(most)i(basic)f(k)m(eystrok)m(es)h(that)f +(y)m(ou)g(need)g(in)f(order)g(to)i(do)e(editing)i(of)150 +3897 y(the)k(input)f(line.)49 b(F)-8 b(or)34 b(y)m(our)f(con)m(v)m +(enience,)j(man)m(y)d(other)g(commands)f(ha)m(v)m(e)j(b)s(een)d(added)g +(in)h(addition)150 4006 y(to)j Fj(C-b)p Fu(,)f Fj(C-f)p +Fu(,)g Fj(C-d)p Fu(,)h(and)e Ft(DEL)p Fu(.)54 b(Here)35 +b(are)g(some)h(commands)e(for)h(mo)m(ving)h(more)f(rapidly)f(ab)s(out)h +(the)150 4116 y(line.)150 4286 y Fj(C-a)336 b Fu(Mo)m(v)m(e)32 +b(to)g(the)e(start)h(of)g(the)f(line.)150 4452 y Fj(C-e)336 +b Fu(Mo)m(v)m(e)32 b(to)g(the)e(end)g(of)g(the)h(line.)150 +4618 y Fj(M-f)336 b Fu(Mo)m(v)m(e)32 b(forw)m(ard)e(a)h(w)m(ord,)f +(where)g(a)h(w)m(ord)f(is)g(comp)s(osed)g(of)h(letters)h(and)d(digits.) +150 4785 y Fj(M-b)336 b Fu(Mo)m(v)m(e)32 b(bac)m(kw)m(ard)f(a)g(w)m +(ord.)150 4951 y Fj(C-l)336 b Fu(Clear)31 b(the)f(screen,)h(reprin)m +(ting)f(the)h(curren)m(t)f(line)h(at)g(the)f(top.)275 +5121 y(Notice)c(ho)m(w)f Fj(C-f)e Fu(mo)m(v)m(es)j(forw)m(ard)e(a)h(c)m +(haracter,)j(while)d Fj(M-f)e Fu(mo)m(v)m(es)j(forw)m(ard)e(a)h(w)m +(ord.)39 b(It)24 b(is)h(a)g(lo)s(ose)150 5230 y(con)m(v)m(en)m(tion)32 +b(that)f(con)m(trol)g(k)m(eystrok)m(es)h(op)s(erate)e(on)g(c)m +(haracters)h(while)f(meta)h(k)m(eystrok)m(es)h(op)s(erate)e(on)150 +5340 y(w)m(ords.)p eop end +%%Page: 103 109 +TeXDict begin 103 108 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(103)150 299 y Fk(8.2.3)63 +b(Readline)40 b(Killing)i(Commands)150 446 y Fr(Killing)35 +b Fu(text)28 b(means)e(to)h(delete)h(the)f(text)g(from)g(the)f(line,)i +(but)e(to)h(sa)m(v)m(e)h(it)g(a)m(w)m(a)m(y)g(for)e(later)i(use,)f +(usually)150 555 y(b)m(y)g Fr(y)m(anking)35 b Fu(\(re-inserting\))28 +b(it)g(bac)m(k)f(in)m(to)h(the)f(line.)40 b(\(`Cut')27 +b(and)g(`paste')h(are)f(more)g(recen)m(t)h(jargon)f(for)150 +665 y(`kill')32 b(and)d(`y)m(ank'.\))275 801 y(If)g(the)i(description)f +(for)g(a)h(command)f(sa)m(ys)g(that)h(it)g(`kills')g(text,)h(then)e(y)m +(ou)g(can)h(b)s(e)e(sure)h(that)h(y)m(ou)150 911 y(can)g(get)g(the)g +(text)g(bac)m(k)g(in)f(a)h(di\013eren)m(t)g(\(or)g(the)f(same\))h +(place)h(later.)275 1047 y(When)23 b(y)m(ou)g(use)g(a)h(kill)g +(command,)g(the)g(text)g(is)f(sa)m(v)m(ed)i(in)e(a)g +Fr(kill-ring)p Fu(.)39 b(An)m(y)24 b(n)m(um)m(b)s(er)e(of)h(consecutiv) +m(e)150 1157 y(kills)31 b(sa)m(v)m(e)i(all)f(of)f(the)g(killed)h(text)g +(together,)g(so)g(that)f(when)f(y)m(ou)h(y)m(ank)h(it)f(bac)m(k,)h(y)m +(ou)g(get)g(it)f(all.)43 b(The)150 1267 y(kill)33 b(ring)f(is)g(not)h +(line)g(sp)s(eci\014c;)g(the)g(text)g(that)g(y)m(ou)g(killed)f(on)h(a)f +(previously)g(t)m(yp)s(ed)h(line)f(is)h(a)m(v)-5 b(ailable)150 +1376 y(to)31 b(b)s(e)f(y)m(ank)m(ed)h(bac)m(k)g(later,)h(when)d(y)m(ou) +i(are)g(t)m(yping)f(another)h(line.)275 1513 y(Here)f(is)h(the)f(list)h +(of)g(commands)f(for)g(killing)h(text.)150 1675 y Fj(C-k)336 +b Fu(Kill)31 b(the)f(text)i(from)e(the)g(curren)m(t)g(cursor)g(p)s +(osition)h(to)g(the)f(end)g(of)g(the)h(line.)150 1836 +y Fj(M-d)336 b Fu(Kill)27 b(from)f(the)g(cursor)g(to)h(the)f(end)g(of)h +(the)f(curren)m(t)g(w)m(ord,)h(or,)h(if)e(b)s(et)m(w)m(een)h(w)m(ords,) +g(to)g(the)630 1946 y(end)j(of)g(the)h(next)f(w)m(ord.)41 +b(W)-8 b(ord)30 b(b)s(oundaries)f(are)i(the)g(same)f(as)h(those)g(used) +f(b)m(y)g Fj(M-f)p Fu(.)150 2107 y Fj(M-DEL)240 b Fu(Kill)31 +b(from)f(the)h(cursor)f(the)g(start)h(of)g(the)g(curren)m(t)f(w)m(ord,) +h(or,)f(if)h(b)s(et)m(w)m(een)g(w)m(ords,)f(to)i(the)630 +2217 y(start)39 b(of)f(the)h(previous)f(w)m(ord.)64 b(W)-8 +b(ord)39 b(b)s(oundaries)e(are)i(the)f(same)h(as)g(those)f(used)g(b)m +(y)630 2326 y Fj(M-b)p Fu(.)150 2487 y Fj(C-w)336 b Fu(Kill)35 +b(from)g(the)g(cursor)f(to)i(the)f(previous)g(whitespace.)55 +b(This)34 b(is)h(di\013eren)m(t)h(than)e Fj(M-DEL)630 +2597 y Fu(b)s(ecause)c(the)h(w)m(ord)f(b)s(oundaries)f(di\013er.)275 +2759 y(Here)42 b(is)f(ho)m(w)h(to)g Fr(y)m(ank)47 b Fu(the)42 +b(text)g(bac)m(k)h(in)m(to)f(the)g(line.)74 b(Y)-8 b(anking)43 +b(means)e(to)h(cop)m(y)h(the)e(most-)150 2869 y(recen)m(tly-killed)33 +b(text)e(from)f(the)g(kill)i(bu\013er.)150 3031 y Fj(C-y)336 +b Fu(Y)-8 b(ank)31 b(the)f(most)h(recen)m(tly)h(killed)f(text)g(bac)m +(k)g(in)m(to)h(the)e(bu\013er)g(at)h(the)f(cursor.)150 +3192 y Fj(M-y)336 b Fu(Rotate)36 b(the)f(kill-ring,)i(and)d(y)m(ank)h +(the)f(new)g(top.)54 b(Y)-8 b(ou)35 b(can)g(only)f(do)h(this)f(if)h +(the)g(prior)630 3302 y(command)30 b(is)h Fj(C-y)e Fu(or)h +Fj(M-y)p Fu(.)150 3503 y Fk(8.2.4)63 b(Readline)40 b(Argumen)m(ts)150 +3650 y Fu(Y)-8 b(ou)40 b(can)f(pass)g(n)m(umeric)f(argumen)m(ts)i(to)f +(Readline)h(commands.)67 b(Sometimes)39 b(the)g(argumen)m(t)h(acts)150 +3760 y(as)g(a)h(rep)s(eat)f(coun)m(t,)j(other)e(times)f(it)h(is)f(the)g +Fl(sign)47 b Fu(of)41 b(the)f(argumen)m(t)g(that)h(is)f(signi\014can)m +(t.)71 b(If)40 b(y)m(ou)150 3869 y(pass)33 b(a)h(negativ)m(e)i(argumen) +m(t)e(to)g(a)g(command)f(whic)m(h)g(normally)h(acts)g(in)f(a)h(forw)m +(ard)f(direction,)i(that)150 3979 y(command)g(will)h(act)g(in)f(a)h +(bac)m(kw)m(ard)f(direction.)57 b(F)-8 b(or)36 b(example,)h(to)f(kill)g +(text)g(bac)m(k)g(to)g(the)g(start)g(of)150 4088 y(the)31 +b(line,)g(y)m(ou)f(migh)m(t)h(t)m(yp)s(e)g(`)p Ft(M--)f(C-k)p +Fu('.)275 4225 y(The)d(general)i(w)m(a)m(y)h(to)e(pass)g(n)m(umeric)g +(argumen)m(ts)h(to)g(a)f(command)g(is)g(to)h(t)m(yp)s(e)f(meta)i +(digits)e(b)s(efore)150 4334 y(the)j(command.)42 b(If)30 +b(the)h(\014rst)f(`digit')i(t)m(yp)s(ed)f(is)g(a)g(min)m(us)f(sign)h +(\(`)p Ft(-)p Fu('\),)h(then)f(the)g(sign)f(of)h(the)g(argumen)m(t)150 +4444 y(will)39 b(b)s(e)e(negativ)m(e.)66 b(Once)38 b(y)m(ou)h(ha)m(v)m +(e)g(t)m(yp)s(ed)f(one)h(meta)g(digit)g(to)f(get)i(the)e(argumen)m(t)h +(started,)i(y)m(ou)150 4554 y(can)29 b(t)m(yp)s(e)g(the)g(remainder)f +(of)h(the)g(digits,)h(and)f(then)f(the)h(command.)40 +b(F)-8 b(or)30 b(example,)g(to)f(giv)m(e)i(the)e Fj(C-d)150 +4663 y Fu(command)37 b(an)g(argumen)m(t)h(of)g(10,)i(y)m(ou)e(could)f +(t)m(yp)s(e)h(`)p Ft(M-1)29 b(0)h(C-d)p Fu(',)39 b(whic)m(h)e(will)h +(delete)h(the)e(next)h(ten)150 4773 y(c)m(haracters)32 +b(on)e(the)h(input)e(line.)150 4974 y Fk(8.2.5)63 b(Searc)m(hing)40 +b(for)i(Commands)g(in)f(the)g(History)150 5121 y Fu(Readline)35 +b(pro)m(vides)f(commands)g(for)g(searc)m(hing)h(through)e(the)i +(command)f(history)g(\(see)h(Section)g(9.1)150 5230 y([Bash)i(History)h +(F)-8 b(acilities],)42 b(page)37 b(133\))i(for)d(lines)h(con)m(taining) +i(a)e(sp)s(eci\014ed)f(string.)60 b(There)36 b(are)i(t)m(w)m(o)150 +5340 y(searc)m(h)31 b(mo)s(des:)40 b Fr(incremen)m(tal)35 +b Fu(and)30 b Fr(non-incremen)m(tal)p Fu(.)p eop end +%%Page: 104 110 +TeXDict begin 104 109 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(104)275 299 y(Incremen)m(tal)26 +b(searc)m(hes)h(b)s(egin)e(b)s(efore)g(the)h(user)f(has)h(\014nished)e +(t)m(yping)i(the)g(searc)m(h)g(string.)39 b(As)26 b(eac)m(h)150 +408 y(c)m(haracter)37 b(of)e(the)h(searc)m(h)g(string)f(is)h(t)m(yp)s +(ed,)g(Readline)g(displa)m(ys)g(the)f(next)h(en)m(try)g(from)e(the)i +(history)150 518 y(matc)m(hing)25 b(the)f(string)g(t)m(yp)s(ed)g(so)g +(far.)39 b(An)23 b(incremen)m(tal)j(searc)m(h)e(requires)g(only)g(as)g +(man)m(y)g(c)m(haracters)i(as)150 628 y(needed)i(to)i(\014nd)d(the)i +(desired)f(history)h(en)m(try)-8 b(.)41 b(T)-8 b(o)29 +b(searc)m(h)h(bac)m(kw)m(ard)f(in)f(the)h(history)g(for)f(a)i +(particular)150 737 y(string,)g(t)m(yp)s(e)f Fj(C-r)p +Fu(.)40 b(T)m(yping)29 b Fj(C-s)g Fu(searc)m(hes)h(forw)m(ard)f +(through)g(the)g(history)-8 b(.)41 b(The)29 b(c)m(haracters)i(presen)m +(t)150 847 y(in)38 b(the)g(v)-5 b(alue)38 b(of)g(the)g +Ft(isearch-terminators)33 b Fu(v)-5 b(ariable)39 b(are)f(used)f(to)i +(terminate)g(an)f(incremen)m(tal)150 956 y(searc)m(h.)71 +b(If)40 b(that)h(v)-5 b(ariable)41 b(has)f(not)h(b)s(een)e(assigned)i +(a)f(v)-5 b(alue,)44 b(the)c Ft(ESC)g Fu(and)f Fj(C-J)h +Fu(c)m(haracters)i(will)150 1066 y(terminate)h(an)g(incremen)m(tal)g +(searc)m(h.)78 b Fj(C-g)41 b Fu(will)i(ab)s(ort)f(an)g(incremen)m(tal)i +(searc)m(h)f(and)f(restore)h(the)150 1176 y(original)30 +b(line.)41 b(When)28 b(the)h(searc)m(h)h(is)f(terminated,)h(the)f +(history)g(en)m(try)g(con)m(taining)h(the)f(searc)m(h)h(string)150 +1285 y(b)s(ecomes)h(the)f(curren)m(t)g(line.)275 1428 +y(T)-8 b(o)31 b(\014nd)e(other)j(matc)m(hing)g(en)m(tries)g(in)e(the)h +(history)g(list,)h(t)m(yp)s(e)g Fj(C-r)e Fu(or)h Fj(C-s)f +Fu(as)h(appropriate.)43 b(This)150 1537 y(will)26 b(searc)m(h)h(bac)m +(kw)m(ard)g(or)f(forw)m(ard)g(in)f(the)i(history)f(for)g(the)g(next)g +(en)m(try)h(matc)m(hing)g(the)f(searc)m(h)h(string)150 +1647 y(t)m(yp)s(ed)37 b(so)h(far.)63 b(An)m(y)38 b(other)f(k)m(ey)i +(sequence)f(b)s(ound)e(to)i(a)g(Readline)h(command)e(will)h(terminate)h +(the)150 1757 y(searc)m(h)26 b(and)f(execute)i(that)f(command.)39 +b(F)-8 b(or)26 b(instance,)h(a)f Ft(RET)f Fu(will)g(terminate)i(the)f +(searc)m(h)g(and)e(accept)150 1866 y(the)30 b(line,)g(thereb)m(y)f +(executing)i(the)e(command)g(from)g(the)h(history)f(list.)41 +b(A)29 b(mo)m(v)m(emen)m(t)j(command)d(will)150 1976 +y(terminate)i(the)g(searc)m(h,)g(mak)m(e)h(the)e(last)h(line)g(found)e +(the)i(curren)m(t)f(line,)h(and)f(b)s(egin)g(editing.)275 +2119 y(Readline)35 b(remem)m(b)s(ers)f(the)h(last)h(incremen)m(tal)g +(searc)m(h)f(string.)54 b(If)34 b(t)m(w)m(o)j Fj(C-r)p +Fu(s)c(are)i(t)m(yp)s(ed)g(without)150 2228 y(an)m(y)i(in)m(terv)m +(ening)g(c)m(haracters)h(de\014ning)e(a)h(new)f(searc)m(h)h(string,)h +(an)m(y)f(remem)m(b)s(ered)e(searc)m(h)i(string)g(is)150 +2338 y(used.)275 2480 y(Non-incremen)m(tal)48 b(searc)m(hes)g(read)e +(the)h(en)m(tire)h(searc)m(h)f(string)g(b)s(efore)f(starting)h(to)h +(searc)m(h)f(for)150 2590 y(matc)m(hing)d(history)e(lines.)78 +b(The)42 b(searc)m(h)h(string)g(ma)m(y)g(b)s(e)f(t)m(yp)s(ed)g(b)m(y)g +(the)h(user)f(or)h(b)s(e)f(part)g(of)h(the)150 2700 y(con)m(ten)m(ts)32 +b(of)f(the)f(curren)m(t)g(line.)150 2944 y Fs(8.3)68 +b(Readline)47 b(Init)e(File)150 3104 y Fu(Although)f(the)g(Readline)g +(library)f(comes)i(with)e(a)h(set)h(of)f(Emacs-lik)m(e)h(k)m +(eybindings)f(installed)g(b)m(y)150 3213 y(default,)26 +b(it)g(is)e(p)s(ossible)h(to)g(use)f(a)i(di\013eren)m(t)f(set)g(of)g(k) +m(eybindings.)38 b(An)m(y)25 b(user)f(can)h(customize)h(programs)150 +3323 y(that)45 b(use)f(Readline)h(b)m(y)f(putting)g(commands)g(in)g(an) +g Fr(inputrc)49 b Fu(\014le,)g(con)m(v)m(en)m(tionally)e(in)d(his)g +(home)150 3433 y(directory)-8 b(.)59 b(The)35 b(name)i(of)f(this)g +(\014le)g(is)g(tak)m(en)h(from)f(the)g(v)-5 b(alue)37 +b(of)f(the)g(shell)h(v)-5 b(ariable)36 b Ft(INPUTRC)p +Fu(.)56 b(If)150 3542 y(that)36 b(v)-5 b(ariable)36 b(is)f(unset,)h +(the)f(default)h(is)f Ft(~/.inputrc)p Fu(.)52 b(If)35 +b(that)g(\014le)h(do)s(es)e(not)i(exist)g(or)f(cannot)h(b)s(e)150 +3652 y(read,)31 b(the)f(ultimate)i(default)e(is)h Ft(/etc/inputrc)p +Fu(.)275 3794 y(When)e(a)h(program)f(whic)m(h)h(uses)f(the)h(Readline)g +(library)f(starts)h(up,)f(the)h(init)g(\014le)f(is)h(read,)g(and)f(the) +150 3904 y(k)m(ey)i(bindings)e(are)i(set.)275 4047 y(In)26 +b(addition,)i(the)f Ft(C-x)i(C-r)d Fu(command)h(re-reads)g(this)f(init) +h(\014le,)h(th)m(us)f(incorp)s(orating)g(an)m(y)g(c)m(hanges)150 +4156 y(that)k(y)m(ou)g(migh)m(t)g(ha)m(v)m(e)g(made)g(to)g(it.)150 +4364 y Fk(8.3.1)63 b(Readline)40 b(Init)h(File)g(Syn)m(tax)150 +4511 y Fu(There)f(are)i(only)f(a)g(few)g(basic)g(constructs)h(allo)m(w) +m(ed)h(in)d(the)h(Readline)h(init)f(\014le.)73 b(Blank)41 +b(lines)h(are)150 4620 y(ignored.)72 b(Lines)41 b(b)s(eginning)f(with)h +(a)g(`)p Ft(#)p Fu(')g(are)h(commen)m(ts.)73 b(Lines)41 +b(b)s(eginning)f(with)g(a)i(`)p Ft($)p Fu(')f(indicate)150 +4730 y(conditional)e(constructs)f(\(see)g(Section)h(8.3.2)g +([Conditional)g(Init)e(Constructs],)j(page)e(111\).)64 +b(Other)150 4839 y(lines)31 b(denote)g(v)-5 b(ariable)31 +b(settings)g(and)f(k)m(ey)h(bindings.)150 5011 y(V)-8 +b(ariable)32 b(Settings)630 5121 y(Y)-8 b(ou)41 b(can)g(mo)s(dify)e +(the)i(run-time)f(b)s(eha)m(vior)g(of)h(Readline)g(b)m(y)f(altering)h +(the)g(v)-5 b(alues)41 b(of)630 5230 y(v)-5 b(ariables)34 +b(in)f(Readline)i(using)e(the)g Ft(set)g Fu(command)g(within)g(the)h +(init)g(\014le.)50 b(The)33 b(syn)m(tax)630 5340 y(is)d(simple:)p +eop end +%%Page: 105 111 +TeXDict begin 105 110 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(105)870 299 y Ft(set)47 +b Fj(variable)e(value)630 436 y Fu(Here,)29 b(for)e(example,)h(is)g(ho) +m(w)f(to)h(c)m(hange)g(from)f(the)g(default)h(Emacs-lik)m(e)h(k)m(ey)f +(binding)e(to)630 545 y(use)k Ft(vi)g Fu(line)h(editing)g(commands:)870 +682 y Ft(set)47 b(editing-mode)d(vi)630 819 y Fu(V)-8 +b(ariable)36 b(names)f(and)g(v)-5 b(alues,)36 b(where)f(appropriate,)h +(are)g(recognized)g(without)f(regard)630 929 y(to)c(case.)42 +b(Unrecognized)31 b(v)-5 b(ariable)31 b(names)g(are)f(ignored.)630 +1066 y(Bo)s(olean)c(v)-5 b(ariables)26 b(\(those)g(that)g(can)f(b)s(e)f +(set)i(to)g(on)f(or)g(o\013)7 b(\))25 b(are)h(set)f(to)h(on)f(if)g(the) +g(v)-5 b(alue)26 b(is)630 1176 y(n)m(ull)e(or)g(empt)m(y)-8 +b(,)27 b Fr(on)d Fu(\(case-insensitiv)m(e\),)29 b(or)24 +b(1.)39 b(An)m(y)25 b(other)f(v)-5 b(alue)25 b(results)f(in)g(the)g(v) +-5 b(ariable)630 1285 y(b)s(eing)30 b(set)h(to)g(o\013.)630 +1422 y(The)37 b Ft(bind)30 b(-V)37 b Fu(command)g(lists)i(the)f(curren) +m(t)f(Readline)i(v)-5 b(ariable)38 b(names)g(and)f(v)-5 +b(alues.)630 1532 y(See)31 b(Section)g(4.2)g([Bash)g(Builtins],)g(page) +g(48.)630 1669 y(A)f(great)i(deal)f(of)g(run-time)f(b)s(eha)m(vior)g +(is)g(c)m(hangeable)j(with)d(the)g(follo)m(wing)i(v)-5 +b(ariables.)630 1833 y Ft(bell-style)1110 1943 y Fu(Con)m(trols)44 +b(what)g(happ)s(ens)e(when)h(Readline)i(w)m(an)m(ts)f(to)h(ring)e(the)h +(termi-)1110 2052 y(nal)37 b(b)s(ell.)61 b(If)37 b(set)h(to)g(`)p +Ft(none)p Fu(',)g(Readline)g(nev)m(er)g(rings)e(the)i(b)s(ell.)61 +b(If)36 b(set)i(to)1110 2162 y(`)p Ft(visible)p Fu(',)32 +b(Readline)i(uses)f(a)g(visible)g(b)s(ell)g(if)g(one)g(is)g(a)m(v)-5 +b(ailable.)51 b(If)33 b(set)g(to)1110 2271 y(`)p Ft(audible)p +Fu(')j(\(the)i(default\),)i(Readline)e(attempts)g(to)h(ring)e(the)g +(terminal's)1110 2381 y(b)s(ell.)630 2545 y Ft(bind-tty-special-chars) +1110 2655 y Fu(If)45 b(set)h(to)f(`)p Ft(on)p Fu(',)50 +b(Readline)45 b(attempts)i(to)f(bind)d(the)j(con)m(trol)g(c)m +(haracters)1110 2765 y(treated)36 b(sp)s(ecially)h(b)m(y)e(the)h(k)m +(ernel's)g(terminal)g(driv)m(er)f(to)h(their)f(Readline)1110 +2874 y(equiv)-5 b(alen)m(ts.)630 3039 y Ft(colored-stats)1110 +3148 y Fu(If)26 b(set)h(to)g(`)p Ft(on)p Fu(',)h(Readline)f(displa)m +(ys)g(p)s(ossible)f(completions)h(using)f(di\013eren)m(t)1110 +3258 y(colors)40 b(to)g(indicate)g(their)f(\014le)h(t)m(yp)s(e.)67 +b(The)38 b(color)j(de\014nitions)d(are)i(tak)m(en)1110 +3367 y(from)24 b(the)h(v)-5 b(alue)25 b(of)g(the)g Ft(LS_COLORS)d +Fu(en)m(vironmen)m(t)j(v)-5 b(ariable.)40 b(The)24 b(default)1110 +3477 y(is)30 b(`)p Ft(off)p Fu('.)630 3641 y Ft(comment-begin)1110 +3751 y Fu(The)62 b(string)g(to)h(insert)f(at)h(the)g(b)s(eginning)e(of) +h(the)h(line)f(when)g(the)1110 3861 y Ft(insert-comment)26 +b Fu(command)31 b(is)f(executed.)42 b(The)30 b(default)g(v)-5 +b(alue)31 b(is)f Ft("#")p Fu(.)630 4025 y Ft(completion-display-width) +1110 4134 y Fu(The)41 b(n)m(um)m(b)s(er)f(of)i(screen)g(columns)f(used) +g(to)h(displa)m(y)g(p)s(ossible)f(matc)m(hes)1110 4244 +y(when)28 b(p)s(erforming)g(completion.)41 b(The)29 b(v)-5 +b(alue)29 b(is)g(ignored)g(if)g(it)h(is)f(less)g(than)1110 +4354 y(0)e(or)f(greater)h(than)f(the)g(terminal)h(screen)f(width.)39 +b(A)26 b(v)-5 b(alue)27 b(of)f(0)h(will)f(cause)1110 +4463 y(matc)m(hes)32 b(to)f(b)s(e)e(displa)m(y)m(ed)i(one)g(p)s(er)e +(line.)41 b(The)30 b(default)h(v)-5 b(alue)31 b(is)f(-1.)630 +4628 y Ft(completion-ignore-case)1110 4737 y Fu(If)d(set)h(to)g(`)p +Ft(on)p Fu(',)g(Readline)g(p)s(erforms)e(\014lename)h(matc)m(hing)i +(and)e(completion)1110 4847 y(in)j(a)h(case-insensitiv)m(e)i(fashion.) +40 b(The)30 b(default)h(v)-5 b(alue)30 b(is)h(`)p Ft(off)p +Fu('.)630 5011 y Ft(completion-map-case)1110 5121 y Fu(If)22 +b(set)g(to)h(`)p Ft(on)p Fu(',)h(and)e Fr(completion-ignore-case)31 +b Fu(is)22 b(enabled,)i(Readline)f(treats)1110 5230 y(h)m(yphens)29 +b(\(`)p Ft(-)p Fu('\))j(and)e(underscores)g(\(`)p Ft(_)p +Fu('\))i(as)f(equiv)-5 b(alen)m(t)32 b(when)e(p)s(erforming)1110 +5340 y(case-insensitiv)m(e)j(\014lename)d(matc)m(hing)i(and)e +(completion.)p eop end +%%Page: 106 112 +TeXDict begin 106 111 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(106)630 299 y Ft +(completion-prefix-displa)o(y-le)o(ngth)1110 408 y Fu(The)31 +b(length)g(in)g(c)m(haracters)i(of)f(the)f(common)h(pre\014x)e(of)h(a)h +(list)g(of)f(p)s(ossible)1110 518 y(completions)g(that)f(is)g(displa)m +(y)m(ed)g(without)g(mo)s(di\014cation.)41 b(When)29 b(set)h(to)h(a)1110 +628 y(v)-5 b(alue)26 b(greater)h(than)e(zero,)j(common)e(pre\014xes)e +(longer)j(than)e(this)g(v)-5 b(alue)27 b(are)1110 737 +y(replaced)k(with)f(an)g(ellipsis)h(when)e(displa)m(ying)i(p)s(ossible) +f(completions.)630 902 y Ft(completion-query-items)1110 +1011 y Fu(The)c(n)m(um)m(b)s(er)f(of)h(p)s(ossible)g(completions)h +(that)g(determines)f(when)f(the)i(user)1110 1121 y(is)i(ask)m(ed)h +(whether)f(the)h(list)g(of)f(p)s(ossibilities)h(should)e(b)s(e)h +(displa)m(y)m(ed.)41 b(If)29 b(the)1110 1230 y(n)m(um)m(b)s(er)d(of)h +(p)s(ossible)f(completions)i(is)f(greater)h(than)e(this)h(v)-5 +b(alue,)28 b(Readline)1110 1340 y(will)f(ask)g(the)f(user)g(whether)g +(or)g(not)h(he)f(wishes)g(to)i(view)e(them;)i(otherwise,)1110 +1450 y(they)d(are)f(simply)g(listed.)40 b(This)23 b(v)-5 +b(ariable)25 b(m)m(ust)g(b)s(e)e(set)i(to)g(an)g(in)m(teger)g(v)-5 +b(alue)1110 1559 y(greater)26 b(than)f(or)f(equal)i(to)f(0.)40 +b(A)24 b(negativ)m(e)j(v)-5 b(alue)26 b(means)e(Readline)i(should)1110 +1669 y(nev)m(er)31 b(ask.)41 b(The)29 b(default)i(limit)g(is)g +Ft(100)p Fu(.)630 1833 y Ft(convert-meta)1110 1943 y +Fu(If)22 b(set)g(to)h(`)p Ft(on)p Fu(',)h(Readline)f(will)f(con)m(v)m +(ert)i(c)m(haracters)f(with)f(the)g(eigh)m(th)h(bit)f(set)1110 +2052 y(to)33 b(an)e Fm(asci)r(i)h Fu(k)m(ey)h(sequence)f(b)m(y)g +(stripping)f(the)h(eigh)m(th)h(bit)f(and)f(pre\014xing)1110 +2162 y(an)24 b Ft(ESC)g Fu(c)m(haracter,)j(con)m(v)m(erting)f(them)f +(to)g(a)g(meta-pre\014xed)f(k)m(ey)h(sequence.)1110 2271 +y(The)30 b(default)g(v)-5 b(alue)31 b(is)g(`)p Ft(on)p +Fu('.)630 2436 y Ft(disable-completion)1110 2545 y Fu(If)36 +b(set)h(to)h(`)p Ft(On)p Fu(',)g(Readline)f(will)g(inhibit)f(w)m(ord)h +(completion.)60 b(Completion)1110 2655 y(c)m(haracters)28 +b(will)e(b)s(e)f(inserted)h(in)m(to)h(the)g(line)f(as)g(if)g(they)h +(had)e(b)s(een)g(mapp)s(ed)1110 2765 y(to)31 b Ft(self-insert)p +Fu(.)38 b(The)30 b(default)g(is)h(`)p Ft(off)p Fu('.)630 +2929 y Ft(editing-mode)1110 3039 y Fu(The)d Ft(editing-mode)e +Fu(v)-5 b(ariable)29 b(con)m(trols)h(whic)m(h)e(default)h(set)h(of)e(k) +m(ey)i(bind-)1110 3148 y(ings)25 b(is)g(used.)38 b(By)26 +b(default,)g(Readline)g(starts)f(up)f(in)h(Emacs)g(editing)h(mo)s(de,) +1110 3258 y(where)j(the)g(k)m(eystrok)m(es)i(are)e(most)h(similar)f(to) +h(Emacs.)40 b(This)29 b(v)-5 b(ariable)30 b(can)1110 +3367 y(b)s(e)g(set)h(to)g(either)g(`)p Ft(emacs)p Fu(')e(or)h(`)p +Ft(vi)p Fu('.)630 3532 y Ft(echo-control-characters)1110 +3641 y Fu(When)g(set)h(to)g(`)p Ft(on)p Fu(',)f(on)g(op)s(erating)h +(systems)f(that)h(indicate)g(they)g(supp)s(ort)1110 3751 +y(it,)i(readline)e(ec)m(ho)s(es)i(a)f(c)m(haracter)h(corresp)s(onding)d +(to)j(a)f(signal)g(generated)1110 3861 y(from)e(the)g(k)m(eyb)s(oard.) +41 b(The)30 b(default)g(is)h(`)p Ft(on)p Fu('.)630 4025 +y Ft(enable-keypad)1110 4134 y Fu(When)23 b(set)h(to)g(`)p +Ft(on)p Fu(',)h(Readline)f(will)g(try)f(to)h(enable)g(the)f +(application)i(k)m(eypad)1110 4244 y(when)h(it)h(is)f(called.)41 +b(Some)27 b(systems)f(need)h(this)f(to)h(enable)g(the)g(arro)m(w)g(k)m +(eys.)1110 4354 y(The)j(default)g(is)h(`)p Ft(off)p Fu('.)630 +4518 y Ft(enable-meta-key)1110 4628 y Fu(When)40 b(set)g(to)g(`)p +Ft(on)p Fu(',)j(Readline)d(will)g(try)g(to)g(enable)g(an)m(y)g(meta)h +(mo)s(di\014er)1110 4737 y(k)m(ey)i(the)e(terminal)i(claims)f(to)h +(supp)s(ort)d(when)h(it)h(is)g(called.)76 b(On)41 b(man)m(y)1110 +4847 y(terminals,)c(the)e(meta)h(k)m(ey)g(is)f(used)g(to)h(send)e(eigh) +m(t-bit)j(c)m(haracters.)56 b(The)1110 4956 y(default)31 +b(is)f(`)p Ft(on)p Fu('.)630 5121 y Ft(expand-tilde)1110 +5230 y Fu(If)d(set)h(to)h(`)p Ft(on)p Fu(',)f(tilde)g(expansion)g(is)f +(p)s(erformed)f(when)h(Readline)h(attempts)1110 5340 +y(w)m(ord)i(completion.)42 b(The)30 b(default)g(is)h(`)p +Ft(off)p Fu('.)p eop end +%%Page: 107 113 +TeXDict begin 107 112 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(107)630 299 y Ft +(history-preserve-point)1110 408 y Fu(If)41 b(set)h(to)h(`)p +Ft(on)p Fu(',)i(the)c(history)h(co)s(de)g(attempts)h(to)f(place)h(the)f +(p)s(oin)m(t)f(\(the)1110 518 y(curren)m(t)35 b(cursor)g(p)s(osition\)) +g(at)h(the)g(same)f(lo)s(cation)i(on)e(eac)m(h)h(history)g(line)1110 +628 y(retriev)m(ed)h(with)f Ft(previous-history)c Fu(or)37 +b Ft(next-history)p Fu(.)55 b(The)36 b(default)1110 737 +y(is)30 b(`)p Ft(off)p Fu('.)630 902 y Ft(history-size)1110 +1011 y Fu(Set)39 b(the)g(maxim)m(um)g(n)m(um)m(b)s(er)f(of)h(history)g +(en)m(tries)h(sa)m(v)m(ed)g(in)f(the)g(history)1110 1121 +y(list.)51 b(If)34 b(set)g(to)h(zero,)g(an)m(y)f(existing)h(history)f +(en)m(tries)g(are)g(deleted)h(and)e(no)1110 1230 y(new)e(en)m(tries)i +(are)f(sa)m(v)m(ed.)46 b(If)31 b(set)h(to)h(a)f(v)-5 +b(alue)32 b(less)g(than)f(zero,)i(the)f(n)m(um)m(b)s(er)1110 +1340 y(of)f(history)f(en)m(tries)h(is)g(not)g(limited.)42 +b(By)30 b(default,)h(the)g(n)m(um)m(b)s(er)e(of)i(history)1110 +1450 y(en)m(tries)g(is)g(not)f(limited.)630 1614 y Ft +(horizontal-scroll-mode)1110 1724 y Fu(This)35 b(v)-5 +b(ariable)37 b(can)f(b)s(e)f(set)h(to)h(either)f(`)p +Ft(on)p Fu(')g(or)g(`)p Ft(off)p Fu('.)57 b(Setting)36 +b(it)g(to)h(`)p Ft(on)p Fu(')1110 1833 y(means)26 b(that)h(the)f(text)h +(of)g(the)f(lines)g(b)s(eing)g(edited)h(will)f(scroll)h(horizon)m +(tally)1110 1943 y(on)32 b(a)g(single)g(screen)g(line)g(when)e(they)i +(are)g(longer)h(than)e(the)h(width)f(of)h(the)1110 2052 +y(screen,)27 b(instead)g(of)f(wrapping)f(on)m(to)i(a)f(new)g(screen)g +(line.)39 b(By)27 b(default,)g(this)1110 2162 y(v)-5 +b(ariable)31 b(is)g(set)f(to)i(`)p Ft(off)p Fu('.)630 +2326 y Ft(input-meta)1110 2436 y Fu(If)f(set)g(to)h(`)p +Ft(on)p Fu(',)g(Readline)g(will)f(enable)h(eigh)m(t-bit)h(input)d(\(it) +i(will)f(not)h(clear)1110 2545 y(the)40 b(eigh)m(th)g(bit)g(in)f(the)h +(c)m(haracters)h(it)f(reads\),)j(regardless)c(of)h(what)g(the)1110 +2655 y(terminal)g(claims)h(it)g(can)f(supp)s(ort.)68 +b(The)39 b(default)h(v)-5 b(alue)40 b(is)g(`)p Ft(off)p +Fu('.)69 b(The)1110 2765 y(name)30 b Ft(meta-flag)e Fu(is)j(a)f(synon)m +(ym)g(for)g(this)h(v)-5 b(ariable.)630 2929 y Ft(isearch-terminators) +1110 3039 y Fu(The)51 b(string)h(of)g(c)m(haracters)h(that)f(should)e +(terminate)j(an)f(incremen)m(tal)1110 3148 y(searc)m(h)25 +b(without)g(subsequen)m(tly)g(executing)h(the)f(c)m(haracter)h(as)f(a)g +(command)1110 3258 y(\(see)38 b(Section)g(8.2.5)h([Searc)m(hing],)h +(page)e(103\).)62 b(If)37 b(this)g(v)-5 b(ariable)38 +b(has)f(not)1110 3367 y(b)s(een)e(giv)m(en)h(a)g(v)-5 +b(alue,)37 b(the)f(c)m(haracters)h Ft(ESC)d Fu(and)h +Fj(C-J)g Fu(will)h(terminate)g(an)1110 3477 y(incremen)m(tal)c(searc)m +(h.)630 3641 y Ft(keymap)192 b Fu(Sets)39 b(Readline's)g(idea)h(of)f +(the)g(curren)m(t)f(k)m(eymap)h(for)g(k)m(ey)g(binding)f(com-)1110 +3751 y(mands.)81 b(Acceptable)47 b Ft(keymap)42 b Fu(names)i(are)h +Ft(emacs)p Fu(,)i Ft(emacs-standard)p Fu(,)1110 3861 +y Ft(emacs-meta)p Fu(,)99 b Ft(emacs-ctlx)p Fu(,)f Ft(vi)p +Fu(,)j Ft(vi-move)p Fu(,)f Ft(vi-command)p Fu(,)f(and)1110 +3970 y Ft(vi-insert)p Fu(.)64 b Ft(vi)38 b Fu(is)h(equiv)-5 +b(alen)m(t)41 b(to)e Ft(vi-command)p Fu(;)i Ft(emacs)c +Fu(is)i(equiv)-5 b(alen)m(t)1110 4080 y(to)33 b Ft(emacs-standard)p +Fu(.)41 b(The)31 b(default)h(v)-5 b(alue)32 b(is)g Ft(emacs)p +Fu(.)44 b(The)31 b(v)-5 b(alue)33 b(of)f(the)1110 4189 +y Ft(editing-mode)27 b Fu(v)-5 b(ariable)31 b(also)h(a\013ects)f(the)g +(default)f(k)m(eymap.)630 4354 y Ft(keyseq-timeout)1110 +4463 y Fu(Sp)s(eci\014es)25 b(the)g(duration)g(Readline)h(will)g(w)m +(ait)g(for)g(a)f(c)m(haracter)i(when)e(read-)1110 4573 +y(ing)30 b(an)g(am)m(biguous)g(k)m(ey)h(sequence)f(\(one)g(that)h(can)f +(form)g(a)g(complete)h(k)m(ey)1110 4682 y(sequence)j(using)e(the)i +(input)e(read)h(so)g(far,)h(or)g(can)f(tak)m(e)i(additional)f(input) +1110 4792 y(to)g(complete)g(a)f(longer)h(k)m(ey)f(sequence\).)49 +b(If)33 b(no)f(input)g(is)h(receiv)m(ed)h(within)1110 +4902 y(the)43 b(timeout,)48 b(Readline)43 b(will)g(use)g(the)g(shorter) +g(but)f(complete)j(k)m(ey)e(se-)1110 5011 y(quence.)c(Readline)26 +b(uses)f(this)h(v)-5 b(alue)26 b(to)g(determine)g(whether)f(or)g(not)h +(input)1110 5121 y(is)31 b(a)m(v)-5 b(ailable)33 b(on)d(the)h(curren)m +(t)f(input)g(source)h(\()p Ft(rl_instream)d Fu(b)m(y)i(default\).)1110 +5230 y(The)25 b(v)-5 b(alue)26 b(is)f(sp)s(eci\014ed)f(in)h +(milliseconds,)j(so)d(a)h(v)-5 b(alue)26 b(of)f(1000)i(means)e(that) +1110 5340 y(Readline)e(will)g(w)m(ait)g(one)g(second)f(for)g +(additional)i(input.)37 b(If)22 b(this)g(v)-5 b(ariable)23 +b(is)p eop end +%%Page: 108 114 +TeXDict begin 108 113 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(108)1110 299 y(set)28 +b(to)h(a)f(v)-5 b(alue)29 b(less)f(than)g(or)f(equal)i(to)f(zero,)i(or) +e(to)g(a)h(non-n)m(umeric)e(v)-5 b(alue,)1110 408 y(Readline)30 +b(will)f(w)m(ait)i(un)m(til)e(another)h(k)m(ey)g(is)f(pressed)g(to)h +(decide)f(whic)m(h)g(k)m(ey)1110 518 y(sequence)i(to)g(complete.)42 +b(The)30 b(default)g(v)-5 b(alue)31 b(is)g Ft(500)p Fu(.)630 +701 y Ft(mark-directories)1110 810 y Fu(If)38 b(set)g(to)h(`)p +Ft(on)p Fu(',)i(completed)e(directory)f(names)g(ha)m(v)m(e)i(a)e(slash) +g(app)s(ended.)1110 920 y(The)30 b(default)g(is)h(`)p +Ft(on)p Fu('.)630 1103 y Ft(mark-modified-lines)1110 +1212 y Fu(This)k(v)-5 b(ariable,)38 b(when)d(set)h(to)h(`)p +Ft(on)p Fu(',)g(causes)g(Readline)f(to)h(displa)m(y)f(an)f(as-)1110 +1322 y(terisk)f(\(`)p Ft(*)p Fu('\))h(at)f(the)g(start)g(of)g(history)g +(lines)g(whic)m(h)f(ha)m(v)m(e)i(b)s(een)e(mo)s(di\014ed.)1110 +1431 y(This)d(v)-5 b(ariable)31 b(is)f(`)p Ft(off)p Fu(')g(b)m(y)g +(default.)630 1614 y Ft(mark-symlinked-directori)o(es)1110 +1724 y Fu(If)59 b(set)h(to)g(`)p Ft(on)p Fu(',)67 b(completed)60 +b(names)f(whic)m(h)g(are)h(sym)m(b)s(olic)g(links)f(to)1110 +1833 y(directories)71 b(ha)m(v)m(e)f(a)g(slash)f(app)s(ended)f(\(sub)5 +b(ject)70 b(to)g(the)g(v)-5 b(alue)70 b(of)1110 1943 +y Ft(mark-directories)p Fu(\).)37 b(The)30 b(default)g(is)g(`)p +Ft(off)p Fu('.)630 2125 y Ft(match-hidden-files)1110 +2235 y Fu(This)21 b(v)-5 b(ariable,)25 b(when)d(set)g(to)h(`)p +Ft(on)p Fu(',)h(causes)f(Readline)g(to)g(matc)m(h)g(\014les)f(whose) +1110 2345 y(names)44 b(b)s(egin)g(with)g(a)g(`)p Ft(.)p +Fu(')g(\(hidden)f(\014les\))i(when)e(p)s(erforming)g(\014lename)1110 +2454 y(completion.)75 b(If)41 b(set)g(to)h(`)p Ft(off)p +Fu(',)i(the)e(leading)g(`)p Ft(.)p Fu(')f(m)m(ust)g(b)s(e)g(supplied)f +(b)m(y)1110 2564 y(the)34 b(user)g(in)g(the)g(\014lename)g(to)h(b)s(e)f +(completed.)53 b(This)33 b(v)-5 b(ariable)35 b(is)f(`)p +Ft(on)p Fu(')g(b)m(y)1110 2673 y(default.)630 2856 y +Ft(menu-complete-display-pr)o(efix)1110 2966 y Fu(If)f(set)h(to)g(`)p +Ft(on)p Fu(',)h(men)m(u)e(completion)i(displa)m(ys)e(the)h(common)g +(pre\014x)e(of)i(the)1110 3075 y(list)k(of)g(p)s(ossible)f(completions) +i(\(whic)m(h)e(ma)m(y)h(b)s(e)f(empt)m(y\))i(b)s(efore)e(cycling)1110 +3185 y(through)30 b(the)g(list.)42 b(The)29 b(default)i(is)f(`)p +Ft(off)p Fu('.)630 3367 y Ft(output-meta)1110 3477 y +Fu(If)35 b(set)h(to)g(`)p Ft(on)p Fu(',)h(Readline)f(will)g(displa)m(y) +f(c)m(haracters)i(with)e(the)h(eigh)m(th)g(bit)1110 3587 +y(set)h(directly)g(rather)f(than)g(as)h(a)g(meta-pre\014xed)f(escap)s +(e)h(sequence.)59 b(The)1110 3696 y(default)31 b(is)f(`)p +Ft(off)p Fu('.)630 3879 y Ft(page-completions)1110 3988 +y Fu(If)j(set)i(to)f(`)p Ft(on)p Fu(',)h(Readline)g(uses)e(an)h(in)m +(ternal)h Ft(more)p Fu(-lik)m(e)f(pager)g(to)h(displa)m(y)1110 +4098 y(a)e(screenful)f(of)g(p)s(ossible)g(completions)i(at)f(a)g(time.) +47 b(This)31 b(v)-5 b(ariable)34 b(is)e(`)p Ft(on)p Fu(')1110 +4208 y(b)m(y)e(default.)630 4390 y Ft(print-completions-horizo)o(ntal)o +(ly)1110 4500 y Fu(If)23 b(set)i(to)g(`)p Ft(on)p Fu(',)g(Readline)g +(will)f(displa)m(y)g(completions)h(with)f(matc)m(hes)h(sorted)1110 +4609 y(horizon)m(tally)45 b(in)e(alphab)s(etical)i(order,)i(rather)c +(than)g(do)m(wn)g(the)h(screen.)1110 4719 y(The)30 b(default)g(is)h(`)p +Ft(off)p Fu('.)630 4902 y Ft(revert-all-at-newline)1110 +5011 y Fu(If)e(set)h(to)g(`)p Ft(on)p Fu(',)g(Readline)g(will)g(undo)f +(all)h(c)m(hanges)h(to)f(history)g(lines)f(b)s(efore)1110 +5121 y(returning)f(when)f Ft(accept-line)f Fu(is)j(executed.)41 +b(By)29 b(default,)g(history)g(lines)1110 5230 y(ma)m(y)42 +b(b)s(e)g(mo)s(di\014ed)e(and)h(retain)i(individual)e(undo)g(lists)h +(across)g(calls)h(to)1110 5340 y Ft(readline)p Fu(.)38 +b(The)30 b(default)h(is)f(`)p Ft(off)p Fu('.)p eop end +%%Page: 109 115 +TeXDict begin 109 114 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(109)630 299 y Ft +(show-all-if-ambiguous)1110 408 y Fu(This)29 b(alters)i(the)f(default)g +(b)s(eha)m(vior)g(of)g(the)h(completion)g(functions.)40 +b(If)29 b(set)1110 518 y(to)f(`)p Ft(on)p Fu(',)g(w)m(ords)f(whic)m(h)g +(ha)m(v)m(e)i(more)f(than)f(one)h(p)s(ossible)f(completion)h(cause)1110 +628 y(the)39 b(matc)m(hes)h(to)g(b)s(e)e(listed)h(immediately)i +(instead)e(of)g(ringing)g(the)g(b)s(ell.)1110 737 y(The)30 +b(default)g(v)-5 b(alue)31 b(is)g(`)p Ft(off)p Fu('.)630 +920 y Ft(show-all-if-unmodified)1110 1029 y Fu(This)38 +b(alters)h(the)g(default)g(b)s(eha)m(vior)g(of)f(the)h(completion)h +(functions)e(in)h(a)1110 1139 y(fashion)25 b(similar)h(to)g +Fr(sho)m(w-all-if-am)m(biguous)p Fu(.)41 b(If)25 b(set)h(to)h(`)p +Ft(on)p Fu(',)f(w)m(ords)f(whic)m(h)1110 1249 y(ha)m(v)m(e)32 +b(more)f(than)f(one)i(p)s(ossible)e(completion)i(without)f(an)m(y)g(p)s +(ossible)f(par-)1110 1358 y(tial)43 b(completion)h(\(the)f(p)s(ossible) +f(completions)h(don't)f(share)g(a)h(common)1110 1468 +y(pre\014x\))30 b(cause)g(the)h(matc)m(hes)g(to)g(b)s(e)f(listed)g +(immediately)i(instead)e(of)h(ring-)1110 1577 y(ing)g(the)f(b)s(ell.)41 +b(The)30 b(default)g(v)-5 b(alue)31 b(is)f(`)p Ft(off)p +Fu('.)630 1760 y Ft(show-mode-in-prompt)1110 1870 y Fu(If)35 +b(set)i(to)f(`)p Ft(on)p Fu(',)h(add)e(a)h(c)m(haracter)i(to)e(the)g(b) +s(eginning)f(of)h(the)g(prompt)f(in-)1110 1979 y(dicating)43 +b(the)f(editing)h(mo)s(de:)63 b(emacs)43 b(\(`)p Ft(@)p +Fu('\),)i(vi)d(command)g(\(`)p Ft(:)p Fu('\),)k(or)c(vi)1110 +2089 y(insertion)30 b(\(`)p Ft(+)p Fu('\).)42 b(The)30 +b(default)h(v)-5 b(alue)30 b(is)h(`)p Ft(off)p Fu('.)630 +2271 y Ft(skip-completed-text)1110 2381 y Fu(If)h(set)i(to)f(`)p +Ft(on)p Fu(',)h(this)f(alters)g(the)g(default)g(completion)h(b)s(eha)m +(vior)f(when)f(in-)1110 2491 y(serting)d(a)h(single)g(matc)m(h)f(in)m +(to)h(the)g(line.)40 b(It's)30 b(only)f(activ)m(e)i(when)d(p)s(erform-) +1110 2600 y(ing)35 b(completion)h(in)e(the)h(middle)f(of)h(a)f(w)m +(ord.)53 b(If)35 b(enabled,)g(readline)g(do)s(es)1110 +2710 y(not)41 b(insert)f(c)m(haracters)i(from)e(the)h(completion)h +(that)f(matc)m(h)g(c)m(haracters)1110 2819 y(after)c(p)s(oin)m(t)g(in)g +(the)g(w)m(ord)f(b)s(eing)g(completed,)k(so)d(p)s(ortions)f(of)h(the)g +(w)m(ord)1110 2929 y(follo)m(wing)c(the)f(cursor)f(are)h(not)g +(duplicated.)45 b(F)-8 b(or)32 b(instance,)h(if)f(this)f(is)h(en-)1110 +3039 y(abled,)43 b(attempting)f(completion)g(when)d(the)i(cursor)f(is)g +(after)h(the)g(`)p Ft(e)p Fu(')f(in)1110 3148 y(`)p Ft(Makefile)p +Fu(')c(will)i(result)f(in)g(`)p Ft(Makefile)p Fu(')f(rather)h(than)h(`) +p Ft(Makefilefile)p Fu(',)1110 3258 y(assuming)d(there)g(is)h(a)f +(single)h(p)s(ossible)f(completion.)56 b(The)35 b(default)g(v)-5 +b(alue)1110 3367 y(is)30 b(`)p Ft(off)p Fu('.)630 3550 +y Ft(visible-stats)1110 3660 y Fu(If)h(set)i(to)f(`)p +Ft(on)p Fu(',)h(a)f(c)m(haracter)i(denoting)e(a)g(\014le's)g(t)m(yp)s +(e)g(is)g(app)s(ended)e(to)j(the)1110 3769 y(\014lename)e(when)e +(listing)i(p)s(ossible)f(completions.)42 b(The)30 b(default)g(is)h(`)p +Ft(off)p Fu('.)150 3952 y(Key)f(Bindings)630 4061 y(The)41 +b(syn)m(tax)i(for)f(con)m(trolling)h(k)m(ey)g(bindings)e(in)h(the)g +(init)g(\014le)g(is)g(simple.)75 b(First)43 b(y)m(ou)630 +4171 y(need)27 b(to)i(\014nd)d(the)i(name)f(of)h(the)g(command)f(that)i +(y)m(ou)f(w)m(an)m(t)g(to)g(c)m(hange.)41 b(The)27 b(follo)m(wing)630 +4281 y(sections)37 b(con)m(tain)g(tables)g(of)f(the)g(command)f(name,)j +(the)e(default)g(k)m(eybinding,)h(if)f(an)m(y)-8 b(,)630 +4390 y(and)30 b(a)h(short)f(description)g(of)h(what)f(the)g(command)h +(do)s(es.)630 4536 y(Once)36 b(y)m(ou)g(kno)m(w)g(the)g(name)g(of)g +(the)g(command,)h(simply)f(place)h(on)e(a)i(line)f(in)g(the)g(init)630 +4646 y(\014le)e(the)g(name)f(of)h(the)g(k)m(ey)g(y)m(ou)g(wish)f(to)h +(bind)f(the)h(command)f(to,)i(a)f(colon,)i(and)d(then)630 +4756 y(the)f(name)h(of)f(the)g(command.)46 b(There)32 +b(can)g(b)s(e)g(no)g(space)g(b)s(et)m(w)m(een)h(the)f(k)m(ey)h(name)g +(and)630 4865 y(the)41 b(colon)h({)f(that)g(will)g(b)s(e)g(in)m +(terpreted)g(as)g(part)f(of)h(the)g(k)m(ey)h(name.)72 +b(The)40 b(name)h(of)630 4975 y(the)35 b(k)m(ey)g(can)g(b)s(e)f +(expressed)f(in)i(di\013eren)m(t)g(w)m(a)m(ys,)h(dep)s(ending)d(on)h +(what)h(y)m(ou)g(\014nd)e(most)630 5084 y(comfortable.)630 +5230 y(In)i(addition)h(to)h(command)f(names,)i(readline)e(allo)m(ws)h +(k)m(eys)g(to)g(b)s(e)e(b)s(ound)f(to)j(a)f(string)630 +5340 y(that)31 b(is)f(inserted)h(when)e(the)i(k)m(ey)g(is)f(pressed)g +(\(a)h Fr(macro)5 b Fu(\).)p eop end +%%Page: 110 116 +TeXDict begin 110 115 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(110)630 299 y(The)42 +b Ft(bind)30 b(-p)42 b Fu(command)h(displa)m(ys)g(Readline)g(function)g +(names)g(and)f(bindings)g(in)h(a)630 408 y(format)37 +b(that)h(can)f(put)f(directly)i(in)m(to)g(an)f(initialization)j +(\014le.)60 b(See)38 b(Section)f(4.2)i([Bash)630 518 +y(Builtins],)31 b(page)g(48.)630 673 y Fr(k)m(eyname)5 +b Fu(:)42 b Fr(function-name)35 b Fu(or)c Fr(macro)1110 +783 y(k)m(eyname)k Fu(is)29 b(the)f(name)h(of)g(a)g(k)m(ey)h(sp)s +(elled)e(out)h(in)g(English.)39 b(F)-8 b(or)30 b(example:)1350 +915 y Ft(Control-u:)45 b(universal-argument)1350 1024 +y(Meta-Rubout:)f(backward-kill-word)1350 1134 y(Control-o:)h(">)i +(output")1110 1266 y Fu(In)94 b(the)g(ab)s(o)m(v)m(e)i(example,)111 +b Fj(C-u)94 b Fu(is)g(b)s(ound)f(to)i(the)f(function)1110 +1376 y Ft(universal-argument)p Fu(,)124 b Fj(M-DEL)107 +b Fu(is)i(b)s(ound)e(to)j(the)f(function)1110 1485 y +Ft(backward-kill-word)p Fu(,)75 b(and)69 b Fj(C-o)g Fu(is)h(b)s(ound)e +(to)j(run)d(the)i(macro)1110 1595 y(expressed)45 b(on)h(the)g(righ)m(t) +g(hand)e(side)i(\(that)h(is,)i(to)e(insert)e(the)h(text)h(`)p +Ft(>)1110 1705 y(output)p Fu(')29 b(in)m(to)i(the)g(line\).)1110 +1837 y(A)62 b(n)m(um)m(b)s(er)e(of)i(sym)m(b)s(olic)h(c)m(haracter)g +(names)f(are)g(recognized)h(while)1110 1946 y(pro)s(cessing)40 +b(this)f(k)m(ey)i(binding)e(syn)m(tax:)60 b Fr(DEL)p +Fu(,)42 b Fr(ESC)p Fu(,)g Fr(ESCAPE)p Fu(,)f Fr(LFD)p +Fu(,)1110 2056 y Fr(NEWLINE)p Fu(,)31 b Fr(RET)p Fu(,)f +Fr(RETURN)p Fu(,)g Fr(R)m(UBOUT)p Fu(,)h Fr(SP)-8 b(A)m(CE)p +Fu(,)31 b Fr(SPC)p Fu(,)e(and)h Fr(T)-8 b(AB)p Fu(.)630 +2211 y Ft(")p Fr(k)m(eyseq)r Ft(")p Fu(:)41 b Fr(function-name)36 +b Fu(or)30 b Fr(macro)1110 2321 y(k)m(eyseq)k Fu(di\013ers)d(from)f +Fr(k)m(eyname)37 b Fu(ab)s(o)m(v)m(e)32 b(in)f(that)h(strings)f +(denoting)g(an)g(en-)1110 2430 y(tire)j(k)m(ey)h(sequence)f(can)g(b)s +(e)f(sp)s(eci\014ed,)h(b)m(y)f(placing)i(the)f(k)m(ey)g(sequence)g(in) +1110 2540 y(double)29 b(quotes.)41 b(Some)29 b Fm(gnu)h +Fu(Emacs)f(st)m(yle)i(k)m(ey)f(escap)s(es)g(can)g(b)s(e)f(used,)g(as) +1110 2649 y(in)k(the)h(follo)m(wing)i(example,)f(but)e(the)h(sp)s +(ecial)h(c)m(haracter)g(names)f(are)g(not)1110 2759 y(recognized.)1350 +2891 y Ft("\\C-u":)46 b(universal-argument)1350 3001 +y("\\C-x\\C-r":)f(re-read-init-file)1350 3110 y("\\e[11~":)g("Function) +h(Key)g(1")1110 3243 y Fu(In)64 b(the)g(ab)s(o)m(v)m(e)i(example,)74 +b Fj(C-u)64 b Fu(is)g(again)i(b)s(ound)c(to)k(the)e(function)1110 +3352 y Ft(universal-argument)39 b Fu(\(just)k(as)h(it)g(w)m(as)g(in)g +(the)f(\014rst)g(example\),)49 b(`)p Fj(C-x)1110 3462 +y(C-r)p Fu(')30 b(is)g(b)s(ound)e(to)j(the)g(function)f +Ft(re-read-init-file)p Fu(,)c(and)j(`)p Ft(ESC)h([)g(1)g(1)1110 +3571 y(~)p Fu(')g(is)h(b)s(ound)d(to)j(insert)f(the)h(text)g(`)p +Ft(Function)e(Key)g(1)p Fu('.)630 3726 y(The)g(follo)m(wing)i +Fm(gnu)f Fu(Emacs)g(st)m(yle)h(escap)s(e)f(sequences)g(are)g(a)m(v)-5 +b(ailable)32 b(when)d(sp)s(ecifying)630 3836 y(k)m(ey)i(sequences:)630 +3991 y Fj(\\C-)336 b Fu(con)m(trol)32 b(pre\014x)630 +4146 y Fj(\\M-)336 b Fu(meta)31 b(pre\014x)630 4301 y +Fj(\\e)384 b Fu(an)30 b(escap)s(e)h(c)m(haracter)630 +4456 y Fj(\\\\)384 b Fu(bac)m(kslash)630 4611 y Fj(\\)p +Ft(")g(")p Fu(,)30 b(a)h(double)f(quotation)i(mark)630 +4766 y Fj(\\')384 b Ft(')p Fu(,)30 b(a)h(single)g(quote)g(or)f(ap)s +(ostrophe)630 4921 y(In)d(addition)h(to)g(the)g Fm(gnu)f +Fu(Emacs)h(st)m(yle)h(escap)s(e)f(sequences,)h(a)f(second)f(set)h(of)g +(bac)m(kslash)630 5030 y(escap)s(es)j(is)f(a)m(v)-5 b(ailable:)630 +5185 y Ft(\\a)384 b Fu(alert)31 b(\(b)s(ell\))630 5340 +y Ft(\\b)384 b Fu(bac)m(kspace)p eop end +%%Page: 111 117 +TeXDict begin 111 116 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(111)630 299 y Ft(\\d)384 +b Fu(delete)630 451 y Ft(\\f)g Fu(form)30 b(feed)630 +604 y Ft(\\n)384 b Fu(newline)630 757 y Ft(\\r)g Fu(carriage)32 +b(return)630 909 y Ft(\\t)384 b Fu(horizon)m(tal)32 b(tab)630 +1062 y Ft(\\v)384 b Fu(v)m(ertical)32 b(tab)630 1214 +y Ft(\\)p Fj(nnn)288 b Fu(the)35 b(eigh)m(t-bit)h(c)m(haracter)g(whose) +e(v)-5 b(alue)35 b(is)g(the)f(o)s(ctal)i(v)-5 b(alue)35 +b Fr(nnn)e Fu(\(one)i(to)1110 1324 y(three)c(digits\))630 +1477 y Ft(\\x)p Fj(HH)288 b Fu(the)38 b(eigh)m(t-bit)i(c)m(haracter)g +(whose)e(v)-5 b(alue)39 b(is)f(the)h(hexadecimal)g(v)-5 +b(alue)39 b Fr(HH)1110 1586 y Fu(\(one)31 b(or)f(t)m(w)m(o)i(hex)e +(digits\))630 1739 y(When)37 b(en)m(tering)h(the)g(text)g(of)g(a)g +(macro,)i(single)e(or)f(double)g(quotes)h(m)m(ust)f(b)s(e)g(used)f(to) +630 1848 y(indicate)23 b(a)e(macro)h(de\014nition.)38 +b(Unquoted)21 b(text)i(is)e(assumed)g(to)h(b)s(e)f(a)h(function)f +(name.)38 b(In)630 1958 y(the)22 b(macro)f(b)s(o)s(dy)-8 +b(,)23 b(the)e(bac)m(kslash)h(escap)s(es)g(describ)s(ed)e(ab)s(o)m(v)m +(e)j(are)e(expanded.)37 b(Bac)m(kslash)630 2067 y(will)j(quote)h(an)m +(y)f(other)g(c)m(haracter)i(in)d(the)i(macro)f(text,)k(including)39 +b(`)p Ft(")p Fu(')h(and)g(`)p Ft(')p Fu('.)69 b(F)-8 +b(or)630 2177 y(example,)28 b(the)e(follo)m(wing)h(binding)d(will)i +(mak)m(e)h(`)p Fj(C-x)j Ft(\\)p Fu(')c(insert)f(a)h(single)h(`)p +Ft(\\)p Fu(')f(in)m(to)g(the)g(line:)870 2308 y Ft("\\C-x\\\\":)45 +b("\\\\")150 2501 y Fk(8.3.2)63 b(Conditional)41 b(Init)g(Constructs) +150 2647 y Fu(Readline)c(implemen)m(ts)g(a)h(facilit)m(y)g(similar)f +(in)g(spirit)f(to)i(the)f(conditional)h(compilation)g(features)f(of)150 +2757 y(the)31 b(C)f(prepro)s(cessor)g(whic)m(h)g(allo)m(ws)i(k)m(ey)g +(bindings)d(and)h(v)-5 b(ariable)32 b(settings)f(to)h(b)s(e)e(p)s +(erformed)f(as)i(the)150 2867 y(result)f(of)h(tests.)41 +b(There)30 b(are)h(four)f(parser)f(directiv)m(es)j(used.)150 +3019 y Ft($if)336 b Fu(The)31 b Ft($if)f Fu(construct)i(allo)m(ws)h +(bindings)d(to)i(b)s(e)e(made)i(based)f(on)g(the)g(editing)h(mo)s(de,)g +(the)630 3129 y(terminal)39 b(b)s(eing)e(used,)j(or)e(the)g +(application)h(using)f(Readline.)64 b(The)38 b(text)h(of)f(the)g(test) +630 3238 y(extends)30 b(to)h(the)g(end)f(of)g(the)h(line;)g(no)f(c)m +(haracters)i(are)f(required)e(to)i(isolate)i(it.)630 +3391 y Ft(mode)288 b Fu(The)30 b Ft(mode=)e Fu(form)i(of)g(the)h +Ft($if)e Fu(directiv)m(e)j(is)e(used)f(to)i(test)g(whether)e(Read-)1110 +3501 y(line)44 b(is)f(in)g Ft(emacs)f Fu(or)h Ft(vi)g +Fu(mo)s(de.)79 b(This)42 b(ma)m(y)i(b)s(e)e(used)h(in)g(conjunction) +1110 3610 y(with)c(the)h(`)p Ft(set)29 b(keymap)p Fu(')38 +b(command,)k(for)d(instance,)j(to)e(set)g(bindings)e(in)1110 +3720 y(the)32 b Ft(emacs-standard)c Fu(and)j Ft(emacs-ctlx)d +Fu(k)m(eymaps)k(only)g(if)g(Readline)g(is)1110 3829 y(starting)f(out)g +(in)f Ft(emacs)f Fu(mo)s(de.)630 3982 y Ft(term)288 b +Fu(The)26 b Ft(term=)g Fu(form)g(ma)m(y)i(b)s(e)e(used)g(to)i(include)f +(terminal-sp)s(eci\014c)g(k)m(ey)h(bind-)1110 4092 y(ings,)38 +b(p)s(erhaps)c(to)j(bind)e(the)h(k)m(ey)h(sequences)f(output)g(b)m(y)g +(the)g(terminal's)1110 4201 y(function)24 b(k)m(eys.)39 +b(The)23 b(w)m(ord)h(on)f(the)i(righ)m(t)f(side)g(of)g(the)g(`)p +Ft(=)p Fu(')g(is)g(tested)h(against)1110 4311 y(b)s(oth)k(the)h(full)g +(name)g(of)g(the)g(terminal)h(and)e(the)i(p)s(ortion)e(of)h(the)g +(terminal)1110 4420 y(name)k(b)s(efore)f(the)g(\014rst)g(`)p +Ft(-)p Fu('.)50 b(This)33 b(allo)m(ws)i Ft(sun)e Fu(to)h(matc)m(h)g(b)s +(oth)f Ft(sun)g Fu(and)1110 4530 y Ft(sun-cmd)p Fu(,)c(for)h(instance.) +630 4682 y Ft(application)1110 4792 y Fu(The)21 b Fr(application)j +Fu(construct)e(is)g(used)f(to)i(include)f(application-sp)s(eci\014c)h +(set-)1110 4902 y(tings.)39 b(Eac)m(h)26 b(program)e(using)g(the)h +(Readline)g(library)g(sets)g(the)g Fr(application)1110 +5011 y(name)p Fu(,)g(and)e(y)m(ou)g(can)h(test)g(for)f(a)g(particular)h +(v)-5 b(alue.)39 b(This)22 b(could)h(b)s(e)g(used)f(to)1110 +5121 y(bind)32 b(k)m(ey)h(sequences)g(to)h(functions)e(useful)g(for)h +(a)g(sp)s(eci\014c)f(program.)48 b(F)-8 b(or)1110 5230 +y(instance,)35 b(the)e(follo)m(wing)h(command)f(adds)f(a)i(k)m(ey)f +(sequence)h(that)f(quotes)1110 5340 y(the)e(curren)m(t)f(or)g(previous) +g(w)m(ord)g(in)g(Bash:)p eop end +%%Page: 112 118 +TeXDict begin 112 117 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(112)1350 299 y Ft($if)47 +b(Bash)1350 408 y(#)g(Quote)g(the)g(current)f(or)h(previous)e(word)1350 +518 y("\\C-xq":)h("\\eb\\"\\ef\\"")1350 628 y($endif)150 +787 y($endif)192 b Fu(This)29 b(command,)i(as)f(seen)h(in)f(the)g +(previous)g(example,)h(terminates)g(an)g Ft($if)e Fu(command.)150 +946 y Ft($else)240 b Fu(Commands)29 b(in)h(this)h(branc)m(h)e(of)i(the) +f Ft($if)g Fu(directiv)m(e)i(are)f(executed)g(if)f(the)h(test)g(fails.) +150 1106 y Ft($include)96 b Fu(This)43 b(directiv)m(e)i(tak)m(es)g(a)e +(single)i(\014lename)e(as)h(an)f(argumen)m(t)h(and)f(reads)g(commands) +630 1215 y(and)38 b(bindings)f(from)h(that)i(\014le.)65 +b(F)-8 b(or)39 b(example,)j(the)d(follo)m(wing)h(directiv)m(e)g(reads)e +(from)630 1325 y Ft(/etc/inputrc)p Fu(:)870 1460 y Ft($include)46 +b(/etc/inputrc)150 1659 y Fk(8.3.3)63 b(Sample)41 b(Init)g(File)150 +1806 y Fu(Here)27 b(is)f(an)h(example)g(of)f(an)h Fr(inputrc)k +Fu(\014le.)39 b(This)26 b(illustrates)h(k)m(ey)h(binding,)e(v)-5 +b(ariable)27 b(assignmen)m(t,)i(and)150 1915 y(conditional)j(syn)m +(tax.)p eop end +%%Page: 113 119 +TeXDict begin 113 118 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(113)390 408 y Ft(#)47 +b(This)g(file)g(controls)e(the)i(behaviour)e(of)j(line)e(input)h +(editing)e(for)390 518 y(#)i(programs)f(that)h(use)g(the)f(GNU)h +(Readline)f(library.)93 b(Existing)390 628 y(#)47 b(programs)f(include) +g(FTP,)g(Bash,)h(and)g(GDB.)390 737 y(#)390 847 y(#)g(You)g(can)g +(re-read)f(the)h(inputrc)f(file)g(with)h(C-x)g(C-r.)390 +956 y(#)g(Lines)g(beginning)e(with)i('#')g(are)g(comments.)390 +1066 y(#)390 1176 y(#)g(First,)g(include)e(any)i(system-wide)e +(bindings)h(and)g(variable)390 1285 y(#)h(assignments)e(from)i +(/etc/Inputrc)390 1395 y($include)f(/etc/Inputrc)390 +1614 y(#)390 1724 y(#)h(Set)g(various)f(bindings)g(for)h(emacs)f(mode.) +390 1943 y(set)h(editing-mode)d(emacs)390 2162 y($if)j(mode=emacs)390 +2381 y(Meta-Control-h:)91 b(backward-kill-word)43 b(Text)k(after)f(the) +h(function)f(name)g(is)h(ignored)390 2600 y(#)390 2710 +y(#)g(Arrow)g(keys)f(in)i(keypad)e(mode)390 2819 y(#)390 +2929 y(#"\\M-OD":)379 b(backward-char)390 3039 y(#"\\M-OC":)g +(forward-char)390 3148 y(#"\\M-OA":)g(previous-history)390 +3258 y(#"\\M-OB":)g(next-history)390 3367 y(#)390 3477 +y(#)47 b(Arrow)g(keys)f(in)i(ANSI)e(mode)390 3587 y(#)390 +3696 y("\\M-[D":)380 b(backward-char)390 3806 y("\\M-[C":)g +(forward-char)390 3915 y("\\M-[A":)g(previous-history)390 +4025 y("\\M-[B":)g(next-history)390 4134 y(#)390 4244 +y(#)47 b(Arrow)g(keys)f(in)i(8)f(bit)g(keypad)f(mode)390 +4354 y(#)390 4463 y(#"\\M-\\C-OD":)331 b(backward-char)390 +4573 y(#"\\M-\\C-OC":)g(forward-char)390 4682 y(#"\\M-\\C-OA":)g +(previous-history)390 4792 y(#"\\M-\\C-OB":)g(next-history)390 +4902 y(#)390 5011 y(#)47 b(Arrow)g(keys)f(in)i(8)f(bit)g(ANSI)g(mode) +390 5121 y(#)390 5230 y(#"\\M-\\C-[D":)331 b(backward-char)390 +5340 y(#"\\M-\\C-[C":)g(forward-char)p eop end +%%Page: 114 120 +TeXDict begin 114 119 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(114)390 299 y Ft(#"\\M-\\C-[A":) +331 b(previous-history)390 408 y(#"\\M-\\C-[B":)g(next-history)390 +628 y(C-q:)47 b(quoted-insert)390 847 y($endif)390 1066 +y(#)g(An)h(old-style)d(binding.)93 b(This)47 b(happens)f(to)h(be)g(the) +g(default.)390 1176 y(TAB:)g(complete)390 1395 y(#)g(Macros)g(that)f +(are)h(convenient)e(for)i(shell)f(interaction)390 1504 +y($if)h(Bash)390 1614 y(#)g(edit)g(the)g(path)390 1724 +y("\\C-xp":)f("PATH=${PATH}\\e\\C-e\\C-a)o(\\ef)o(\\C-f)o(")390 +1833 y(#)h(prepare)f(to)h(type)g(a)h(quoted)e(word)g(--)390 +1943 y(#)h(insert)g(open)f(and)h(close)f(double)h(quotes)390 +2052 y(#)g(and)g(move)g(to)g(just)g(after)f(the)h(open)g(quote)390 +2162 y("\\C-x\\"":)e("\\"\\"\\C-b")390 2271 y(#)i(insert)g(a)g +(backslash)e(\(testing)h(backslash)f(escapes)390 2381 +y(#)i(in)h(sequences)d(and)i(macros\))390 2491 y("\\C-x\\\\":)e("\\\\") +390 2600 y(#)i(Quote)g(the)g(current)f(or)h(previous)e(word)390 +2710 y("\\C-xq":)h("\\eb\\"\\ef\\"")390 2819 y(#)h(Add)g(a)h(binding)e +(to)h(refresh)f(the)h(line,)f(which)g(is)h(unbound)390 +2929 y("\\C-xr":)f(redraw-current-line)390 3039 y(#)h(Edit)g(variable)f +(on)h(current)f(line.)390 3148 y("\\M-\\C-v":)f +("\\C-a\\C-k$\\C-y\\M-\\C-e\\C-)o(a\\C-)o(y=")390 3258 +y($endif)390 3477 y(#)i(use)g(a)h(visible)e(bell)g(if)h(one)g(is)h +(available)390 3587 y(set)f(bell-style)e(visible)390 +3806 y(#)i(don't)g(strip)f(characters)f(to)i(7)h(bits)e(when)h(reading) +390 3915 y(set)g(input-meta)e(on)390 4134 y(#)i(allow)g(iso-latin1)e +(characters)g(to)i(be)g(inserted)f(rather)390 4244 y(#)h(than)g +(converted)e(to)j(prefix-meta)c(sequences)390 4354 y(set)j +(convert-meta)d(off)390 4573 y(#)j(display)f(characters)f(with)i(the)g +(eighth)f(bit)h(set)g(directly)390 4682 y(#)g(rather)g(than)f(as)h +(meta-prefixed)e(characters)390 4792 y(set)i(output-meta)e(on)390 +5011 y(#)i(if)h(there)e(are)h(more)g(than)f(150)h(possible)f +(completions)e(for)390 5121 y(#)j(a)h(word,)e(ask)h(the)g(user)g(if)g +(he)g(wants)f(to)i(see)f(all)f(of)i(them)390 5230 y(set)f +(completion-query-items)42 b(150)p eop end +%%Page: 115 121 +TeXDict begin 115 120 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(115)390 299 y Ft(#)47 +b(For)g(FTP)390 408 y($if)g(Ftp)390 518 y("\\C-xg":)f("get)g(\\M-?")390 +628 y("\\C-xt":)g("put)g(\\M-?")390 737 y("\\M-.":)g(yank-last-arg)390 +847 y($endif)150 1075 y Fs(8.4)68 b(Bindable)45 b(Readline)i(Commands) +150 1235 y Fu(This)32 b(section)h(describ)s(es)f(Readline)h(commands)f +(that)h(ma)m(y)h(b)s(e)d(b)s(ound)g(to)i(k)m(ey)g(sequences.)48 +b(Y)-8 b(ou)33 b(can)150 1344 y(list)40 b(y)m(our)f(k)m(ey)i(bindings)d +(b)m(y)h(executing)i Ft(bind)29 b(-P)39 b Fu(or,)j(for)d(a)h(more)g +(terse)g(format,)i(suitable)e(for)f(an)150 1454 y Fr(inputrc)34 +b Fu(\014le,)29 b Ft(bind)g(-p)p Fu(.)40 b(\(See)30 b(Section)f(4.2)h +([Bash)g(Builtins],)g(page)g(48.\))41 b(Command)28 b(names)h(without) +150 1563 y(an)h(accompan)m(ying)i(k)m(ey)f(sequence)g(are)g(un)m(b)s +(ound)d(b)m(y)i(default.)275 1696 y(In)25 b(the)h(follo)m(wing)i +(descriptions,)f Fr(p)s(oin)m(t)h Fu(refers)e(to)h(the)f(curren)m(t)g +(cursor)g(p)s(osition,)h(and)f Fr(mark)31 b Fu(refers)150 +1805 y(to)40 b(a)f(cursor)f(p)s(osition)h(sa)m(v)m(ed)h(b)m(y)f(the)g +Ft(set-mark)d Fu(command.)66 b(The)38 b(text)i(b)s(et)m(w)m(een)g(the)f +(p)s(oin)m(t)g(and)150 1915 y(mark)30 b(is)h(referred)e(to)i(as)g(the)f +Fr(region)p Fu(.)150 2110 y Fk(8.4.1)63 b(Commands)42 +b(F)-10 b(or)41 b(Mo)m(ving)150 2280 y Ft(beginning-of-line)26 +b(\(C-a\))630 2390 y Fu(Mo)m(v)m(e)32 b(to)g(the)e(start)h(of)g(the)f +(curren)m(t)g(line.)150 2545 y Ft(end-of-line)d(\(C-e\))630 +2655 y Fu(Mo)m(v)m(e)32 b(to)g(the)e(end)g(of)g(the)h(line.)150 +2810 y Ft(forward-char)c(\(C-f\))630 2920 y Fu(Mo)m(v)m(e)32 +b(forw)m(ard)e(a)h(c)m(haracter.)150 3075 y Ft(backward-char)c(\(C-b\)) +630 3185 y Fu(Mo)m(v)m(e)32 b(bac)m(k)g(a)e(c)m(haracter.)150 +3340 y Ft(forward-word)d(\(M-f\))630 3450 y Fu(Mo)m(v)m(e)32 +b(forw)m(ard)e(to)h(the)f(end)g(of)g(the)h(next)f(w)m(ord.)41 +b(W)-8 b(ords)30 b(are)h(comp)s(osed)f(of)g(letters)i(and)630 +3559 y(digits.)150 3715 y Ft(backward-word)27 b(\(M-b\))630 +3824 y Fu(Mo)m(v)m(e)36 b(bac)m(k)e(to)g(the)g(start)g(of)g(the)g +(curren)m(t)f(or)g(previous)g(w)m(ord.)50 b(W)-8 b(ords)34 +b(are)g(comp)s(osed)630 3934 y(of)d(letters)g(and)f(digits.)150 +4089 y Ft(shell-forward-word)25 b(\(\))630 4199 y Fu(Mo)m(v)m(e)30 +b(forw)m(ard)e(to)h(the)f(end)f(of)h(the)h(next)f(w)m(ord.)40 +b(W)-8 b(ords)28 b(are)g(delimited)h(b)m(y)f(non-quoted)630 +4308 y(shell)j(metac)m(haracters.)150 4464 y Ft(shell-backward-word)25 +b(\(\))630 4573 y Fu(Mo)m(v)m(e)37 b(bac)m(k)e(to)h(the)f(start)g(of)g +(the)g(curren)m(t)g(or)f(previous)h(w)m(ord.)53 b(W)-8 +b(ords)35 b(are)g(delimited)630 4683 y(b)m(y)30 b(non-quoted)h(shell)f +(metac)m(haracters.)150 4838 y Ft(clear-screen)d(\(C-l\))630 +4948 y Fu(Clear)g(the)g(screen)f(and)h(redra)m(w)f(the)h(curren)m(t)f +(line,)i(lea)m(ving)g(the)f(curren)m(t)g(line)g(at)g(the)g(top)630 +5057 y(of)k(the)f(screen.)150 5213 y Ft(redraw-current-line)25 +b(\(\))630 5322 y Fu(Refresh)30 b(the)g(curren)m(t)h(line.)41 +b(By)30 b(default,)h(this)f(is)h(un)m(b)s(ound.)p eop +end +%%Page: 116 122 +TeXDict begin 116 121 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(116)150 299 y Fk(8.4.2)63 +b(Commands)42 b(F)-10 b(or)41 b(Manipulating)h(The)f(History)150 +473 y Ft(accept-line)27 b(\(Newline)h(or)i(Return\))630 +582 y Fu(Accept)25 b(the)e(line)h(regardless)g(of)f(where)g(the)h +(cursor)e(is.)39 b(If)23 b(this)g(line)h(is)f(non-empt)m(y)-8 +b(,)26 b(add)c(it)630 692 y(to)27 b(the)f(history)g(list)h(according)g +(to)g(the)f(setting)i(of)e(the)g Ft(HISTCONTROL)d Fu(and)j +Ft(HISTIGNORE)630 802 y Fu(v)-5 b(ariables.)42 b(If)30 +b(this)h(line)g(is)g(a)g(mo)s(di\014ed)e(history)i(line,)g(then)f +(restore)i(the)f(history)f(line)h(to)630 911 y(its)g(original)g(state.) +150 1075 y Ft(previous-history)26 b(\(C-p\))630 1184 +y Fu(Mo)m(v)m(e)32 b(`bac)m(k')g(through)e(the)g(history)h(list,)g +(fetc)m(hing)g(the)g(previous)f(command.)150 1348 y Ft(next-history)d +(\(C-n\))630 1457 y Fu(Mo)m(v)m(e)32 b(`forw)m(ard')f(through)e(the)i +(history)f(list,)i(fetc)m(hing)f(the)g(next)f(command.)150 +1621 y Ft(beginning-of-history)25 b(\(M-<\))630 1730 +y Fu(Mo)m(v)m(e)32 b(to)g(the)e(\014rst)g(line)g(in)h(the)f(history)-8 +b(.)150 1894 y Ft(end-of-history)26 b(\(M->\))630 2004 +y Fu(Mo)m(v)m(e)32 b(to)g(the)e(end)g(of)g(the)h(input)e(history)-8 +b(,)31 b(i.e.,)h(the)f(line)f(curren)m(tly)h(b)s(eing)f(en)m(tered.)150 +2167 y Ft(reverse-search-history)24 b(\(C-r\))630 2277 +y Fu(Searc)m(h)31 b(bac)m(kw)m(ard)h(starting)g(at)g(the)f(curren)m(t)g +(line)g(and)g(mo)m(ving)h(`up')e(through)h(the)g(his-)630 +2386 y(tory)g(as)f(necessary)-8 b(.)42 b(This)29 b(is)i(an)f(incremen)m +(tal)i(searc)m(h.)150 2550 y Ft(forward-search-history)24 +b(\(C-s\))630 2659 y Fu(Searc)m(h)30 b(forw)m(ard)f(starting)h(at)g +(the)g(curren)m(t)f(line)h(and)f(mo)m(ving)h(`do)m(wn')f(through)g(the) +h(the)630 2769 y(history)g(as)h(necessary)-8 b(.)41 b(This)30 +b(is)g(an)h(incremen)m(tal)g(searc)m(h.)150 2932 y Ft +(non-incremental-reverse-)o(sear)o(ch-h)o(ist)o(ory)24 +b(\(M-p\))630 3042 y Fu(Searc)m(h)31 b(bac)m(kw)m(ard)h(starting)g(at)g +(the)f(curren)m(t)g(line)g(and)g(mo)m(ving)h(`up')e(through)h(the)g +(his-)630 3152 y(tory)36 b(as)g(necessary)h(using)e(a)i(non-incremen)m +(tal)g(searc)m(h)f(for)g(a)g(string)g(supplied)f(b)m(y)h(the)630 +3261 y(user.)150 3425 y Ft(non-incremental-forward-)o(sear)o(ch-h)o +(ist)o(ory)24 b(\(M-n\))630 3534 y Fu(Searc)m(h)30 b(forw)m(ard)f +(starting)h(at)g(the)g(curren)m(t)f(line)h(and)f(mo)m(ving)h(`do)m(wn') +f(through)g(the)h(the)630 3644 y(history)d(as)f(necessary)i(using)e(a)h +(non-incremen)m(tal)g(searc)m(h)h(for)e(a)h(string)g(supplied)e(b)m(y)i +(the)630 3754 y(user.)150 3917 y Ft(history-search-forward)d(\(\))630 +4027 y Fu(Searc)m(h)42 b(forw)m(ard)f(through)f(the)i(history)f(for)g +(the)h(string)f(of)h(c)m(haracters)h(b)s(et)m(w)m(een)f(the)630 +4136 y(start)36 b(of)h(the)f(curren)m(t)f(line)i(and)e(the)h(p)s(oin)m +(t.)58 b(The)35 b(searc)m(h)i(string)e(m)m(ust)h(matc)m(h)h(at)g(the) +630 4246 y(b)s(eginning)32 b(of)g(a)h(history)g(line.)47 +b(This)32 b(is)h(a)f(non-incremen)m(tal)i(searc)m(h.)48 +b(By)33 b(default,)g(this)630 4355 y(command)d(is)h(un)m(b)s(ound.)150 +4519 y Ft(history-search-backward)24 b(\(\))630 4629 +y Fu(Searc)m(h)35 b(bac)m(kw)m(ard)g(through)f(the)h(history)g(for)g +(the)f(string)h(of)g(c)m(haracters)h(b)s(et)m(w)m(een)g(the)630 +4738 y(start)g(of)h(the)f(curren)m(t)f(line)i(and)e(the)h(p)s(oin)m(t.) +58 b(The)35 b(searc)m(h)i(string)e(m)m(ust)h(matc)m(h)h(at)g(the)630 +4848 y(b)s(eginning)32 b(of)g(a)h(history)g(line.)47 +b(This)32 b(is)h(a)f(non-incremen)m(tal)i(searc)m(h.)48 +b(By)33 b(default,)g(this)630 4957 y(command)d(is)h(un)m(b)s(ound.)150 +5121 y Ft(history-substr-search-fo)o(rwar)o(d)24 b(\(\))630 +5230 y Fu(Searc)m(h)42 b(forw)m(ard)f(through)f(the)i(history)f(for)g +(the)h(string)f(of)h(c)m(haracters)h(b)s(et)m(w)m(een)f(the)630 +5340 y(start)29 b(of)g(the)g(curren)m(t)g(line)g(and)f(the)h(p)s(oin)m +(t.)40 b(The)29 b(searc)m(h)g(string)g(ma)m(y)g(matc)m(h)h(an)m(ywhere) +p eop end +%%Page: 117 123 +TeXDict begin 117 122 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(117)630 299 y(in)32 +b(a)h(history)g(line.)47 b(This)32 b(is)g(a)h(non-incremen)m(tal)h +(searc)m(h.)47 b(By)33 b(default,)h(this)e(command)630 +408 y(is)e(un)m(b)s(ound.)150 573 y Ft(history-substr-search-ba)o(ckwa) +o(rd)24 b(\(\))630 683 y Fu(Searc)m(h)35 b(bac)m(kw)m(ard)g(through)f +(the)h(history)g(for)g(the)f(string)h(of)g(c)m(haracters)h(b)s(et)m(w)m +(een)g(the)630 793 y(start)29 b(of)g(the)g(curren)m(t)g(line)g(and)f +(the)h(p)s(oin)m(t.)40 b(The)29 b(searc)m(h)g(string)g(ma)m(y)g(matc)m +(h)h(an)m(ywhere)630 902 y(in)i(a)h(history)g(line.)47 +b(This)32 b(is)g(a)h(non-incremen)m(tal)h(searc)m(h.)47 +b(By)33 b(default,)h(this)e(command)630 1012 y(is)e(un)m(b)s(ound.)150 +1177 y Ft(yank-nth-arg)d(\(M-C-y\))630 1286 y Fu(Insert)37 +b(the)g(\014rst)f(argumen)m(t)i(to)f(the)h(previous)e(command)h +(\(usually)g(the)g(second)g(w)m(ord)630 1396 y(on)32 +b(the)g(previous)f(line\))i(at)f(p)s(oin)m(t.)46 b(With)32 +b(an)g(argumen)m(t)g Fr(n)p Fu(,)g(insert)g(the)g Fr(n)p +Fu(th)f(w)m(ord)g(from)630 1506 y(the)k(previous)f(command)h(\(the)g(w) +m(ords)g(in)f(the)h(previous)g(command)f(b)s(egin)h(with)f(w)m(ord)630 +1615 y(0\).)69 b(A)40 b(negativ)m(e)h(argumen)m(t)f(inserts)g(the)f +Fr(n)p Fu(th)g(w)m(ord)g(from)g(the)h(end)f(of)h(the)f(previous)630 +1725 y(command.)48 b(Once)33 b(the)g(argumen)m(t)h Fr(n)e +Fu(is)h(computed,)h(the)f(argumen)m(t)g(is)g(extracted)i(as)e(if)630 +1834 y(the)e(`)p Ft(!)p Fj(n)p Fu(')f(history)g(expansion)g(had)g(b)s +(een)g(sp)s(eci\014ed.)150 1999 y Ft(yank-last-arg)d(\(M-.)i(or)h +(M-_\))630 2109 y Fu(Insert)k(last)i(argumen)m(t)g(to)g(the)f(previous) +f(command)h(\(the)h(last)f(w)m(ord)g(of)g(the)g(previous)630 +2218 y(history)e(en)m(try\).)51 b(With)34 b(a)g(n)m(umeric)g(argumen)m +(t,)h(b)s(eha)m(v)m(e)f(exactly)h(lik)m(e)g Ft(yank-nth-arg)p +Fu(.)630 2328 y(Successiv)m(e)26 b(calls)g(to)f Ft(yank-last-arg)c +Fu(mo)m(v)m(e)27 b(bac)m(k)e(through)f(the)h(history)g(list,)i +(inserting)630 2438 y(the)c(last)g(w)m(ord)f(\(or)h(the)g(w)m(ord)f(sp) +s(eci\014ed)g(b)m(y)g(the)h(argumen)m(t)g(to)g(the)g(\014rst)f(call\))i +(of)f(eac)m(h)h(line)630 2547 y(in)36 b(turn.)58 b(An)m(y)36 +b(n)m(umeric)h(argumen)m(t)f(supplied)g(to)h(these)g(successiv)m(e)g +(calls)h(determines)630 2657 y(the)d(direction)g(to)h(mo)m(v)m(e)g +(through)e(the)h(history)-8 b(.)54 b(A)35 b(negativ)m(e)i(argumen)m(t)e +(switc)m(hes)h(the)630 2766 y(direction)23 b(through)g(the)g(history)f +(\(bac)m(k)i(or)f(forw)m(ard\).)38 b(The)22 b(history)h(expansion)g +(facilities)630 2876 y(are)28 b(used)f(to)h(extract)h(the)f(last)g +(argumen)m(t,)h(as)e(if)h(the)g(`)p Ft(!$)p Fu(')f(history)g(expansion) +h(had)f(b)s(een)630 2986 y(sp)s(eci\014ed.)150 3190 y +Fk(8.4.3)63 b(Commands)42 b(F)-10 b(or)41 b(Changing)g(T)-10 +b(ext)150 3365 y Fj(end-of-file)27 b Ft(\(usually)h(C-d\))630 +3475 y Fu(The)e(c)m(haracter)h(indicating)h(end-of-\014le)e(as)h(set,)g +(for)f(example,)i(b)m(y)e Ft(stty)p Fu(.)39 b(If)25 b(this)h(c)m +(harac-)630 3584 y(ter)c(is)g(read)g(when)e(there)i(are)h(no)e(c)m +(haracters)j(on)d(the)h(line,)i(and)d(p)s(oin)m(t)h(is)g(at)h(the)f(b)s +(eginning)630 3694 y(of)31 b(the)f(line,)h(Readline)g(in)m(terprets)g +(it)g(as)f(the)h(end)f(of)g(input)f(and)h(returns)f Fm(eof)p +Fu(.)150 3859 y Ft(delete-char)e(\(C-d\))630 3968 y Fu(Delete)35 +b(the)f(c)m(haracter)h(at)f(p)s(oin)m(t.)49 b(If)33 b(this)g(function)g +(is)g(b)s(ound)e(to)j(the)g(same)f(c)m(haracter)630 4078 +y(as)e(the)f(tt)m(y)i Fm(eof)d Fu(c)m(haracter,)j(as)f +Fj(C-d)e Fu(commonly)i(is,)g(see)g(ab)s(o)m(v)m(e)h(for)e(the)g +(e\013ects.)150 4243 y Ft(backward-delete-char)25 b(\(Rubout\))630 +4353 y Fu(Delete)32 b(the)f(c)m(haracter)g(b)s(ehind)e(the)h(cursor.)40 +b(A)30 b(n)m(umeric)g(argumen)m(t)h(means)f(to)h(kill)g(the)630 +4462 y(c)m(haracters)h(instead)e(of)h(deleting)g(them.)150 +4627 y Ft(forward-backward-delete-)o(char)24 b(\(\))630 +4737 y Fu(Delete)40 b(the)f(c)m(haracter)h(under)c(the)j(cursor,)h +(unless)d(the)i(cursor)e(is)h(at)h(the)g(end)e(of)i(the)630 +4846 y(line,)33 b(in)e(whic)m(h)g(case)i(the)f(c)m(haracter)h(b)s +(ehind)d(the)i(cursor)f(is)g(deleted.)46 b(By)32 b(default,)g(this)630 +4956 y(is)e(not)h(b)s(ound)d(to)j(a)g(k)m(ey)-8 b(.)150 +5121 y Ft(quoted-insert)27 b(\(C-q)i(or)h(C-v\))630 5230 +y Fu(Add)j(the)i(next)f(c)m(haracter)i(t)m(yp)s(ed)e(to)h(the)f(line)h +(v)m(erbatim.)53 b(This)33 b(is)i(ho)m(w)f(to)h(insert)f(k)m(ey)630 +5340 y(sequences)d(lik)m(e)g Fj(C-q)p Fu(,)f(for)g(example.)p +eop end +%%Page: 118 124 +TeXDict begin 118 123 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(118)150 299 y Ft(self-insert)27 +b(\(a,)j(b,)g(A,)f(1,)h(!,)g(...)o(\))630 408 y Fu(Insert)g(y)m +(ourself.)150 556 y Ft(transpose-chars)c(\(C-t\))630 +665 y Fu(Drag)33 b(the)f(c)m(haracter)h(b)s(efore)f(the)g(cursor)f +(forw)m(ard)h(o)m(v)m(er)h(the)f(c)m(haracter)i(at)e(the)g(cursor,)630 +775 y(mo)m(ving)k(the)g(cursor)f(forw)m(ard)g(as)g(w)m(ell.)57 +b(If)35 b(the)h(insertion)g(p)s(oin)m(t)f(is)g(at)i(the)e(end)g(of)h +(the)630 884 y(line,)24 b(then)e(this)g(transp)s(oses)f(the)h(last)h(t) +m(w)m(o)g(c)m(haracters)g(of)f(the)h(line.)38 b(Negativ)m(e)25 +b(argumen)m(ts)630 994 y(ha)m(v)m(e)32 b(no)e(e\013ect.)150 +1141 y Ft(transpose-words)c(\(M-t\))630 1251 y Fu(Drag)33 +b(the)g(w)m(ord)f(b)s(efore)g(p)s(oin)m(t)g(past)g(the)h(w)m(ord)f +(after)g(p)s(oin)m(t,)i(mo)m(ving)f(p)s(oin)m(t)f(past)g(that)630 +1360 y(w)m(ord)c(as)h(w)m(ell.)41 b(If)27 b(the)i(insertion)f(p)s(oin)m +(t)h(is)f(at)h(the)g(end)e(of)i(the)f(line,)i(this)e(transp)s(oses)g +(the)630 1470 y(last)j(t)m(w)m(o)h(w)m(ords)e(on)g(the)h(line.)150 +1617 y Ft(upcase-word)c(\(M-u\))630 1727 y Fu(Upp)s(ercase)32 +b(the)g(curren)m(t)g(\(or)g(follo)m(wing\))i(w)m(ord.)45 +b(With)32 b(a)g(negativ)m(e)j(argumen)m(t,)e(upp)s(er-)630 +1837 y(case)e(the)g(previous)f(w)m(ord,)g(but)g(do)g(not)h(mo)m(v)m(e)h +(the)e(cursor.)150 1984 y Ft(downcase-word)d(\(M-l\))630 +2093 y Fu(Lo)m(w)m(ercase)c(the)f(curren)m(t)f(\(or)h(follo)m(wing\))i +(w)m(ord.)37 b(With)22 b(a)g(negativ)m(e)i(argumen)m(t,)g(lo)m(w)m +(ercase)630 2203 y(the)31 b(previous)e(w)m(ord,)i(but)e(do)i(not)f(mo)m +(v)m(e)i(the)f(cursor.)150 2350 y Ft(capitalize-word)26 +b(\(M-c\))630 2460 y Fu(Capitalize)d(the)f(curren)m(t)f(\(or)g(follo)m +(wing\))i(w)m(ord.)38 b(With)21 b(a)h(negativ)m(e)h(argumen)m(t,)h +(capitalize)630 2569 y(the)31 b(previous)e(w)m(ord,)i(but)e(do)i(not)f +(mo)m(v)m(e)i(the)f(cursor.)150 2717 y Ft(overwrite-mode)26 +b(\(\))630 2826 y Fu(T)-8 b(oggle)35 b(o)m(v)m(erwrite)g(mo)s(de.)48 +b(With)33 b(an)g(explicit)h(p)s(ositiv)m(e)g(n)m(umeric)f(argumen)m(t,) +h(switc)m(hes)630 2936 y(to)22 b(o)m(v)m(erwrite)i(mo)s(de.)37 +b(With)22 b(an)g(explicit)h(non-p)s(ositiv)m(e)f(n)m(umeric)g(argumen)m +(t,)i(switc)m(hes)e(to)630 3045 y(insert)30 b(mo)s(de.)41 +b(This)30 b(command)h(a\013ects)h(only)e Ft(emacs)f Fu(mo)s(de;)i +Ft(vi)f Fu(mo)s(de)g(do)s(es)g(o)m(v)m(erwrite)630 3155 +y(di\013eren)m(tly)-8 b(.)42 b(Eac)m(h)31 b(call)h(to)f +Ft(readline\(\))c Fu(starts)k(in)f(insert)g(mo)s(de.)630 +3283 y(In)52 b(o)m(v)m(erwrite)h(mo)s(de,)58 b(c)m(haracters)c(b)s +(ound)c(to)j Ft(self-insert)c Fu(replace)k(the)g(text)g(at)630 +3393 y(p)s(oin)m(t)59 b(rather)f(than)h(pushing)e(the)i(text)g(to)h +(the)f(righ)m(t.)126 b(Characters)59 b(b)s(ound)d(to)630 +3503 y Ft(backward-delete-char)25 b Fu(replace)31 b(the)g(c)m(haracter) +h(b)s(efore)e(p)s(oin)m(t)g(with)g(a)h(space.)630 3631 +y(By)g(default,)f(this)h(command)f(is)g(un)m(b)s(ound.)150 +3818 y Fk(8.4.4)63 b(Killing)42 b(And)e(Y)-10 b(anking)150 +3984 y Ft(kill-line)28 b(\(C-k\))630 4093 y Fu(Kill)j(the)f(text)i +(from)e(p)s(oin)m(t)g(to)h(the)g(end)e(of)i(the)f(line.)150 +4241 y Ft(backward-kill-line)25 b(\(C-x)30 b(Rubout\))630 +4350 y Fu(Kill)h(bac)m(kw)m(ard)g(to)g(the)f(b)s(eginning)g(of)g(the)h +(line.)150 4498 y Ft(unix-line-discard)26 b(\(C-u\))630 +4607 y Fu(Kill)31 b(bac)m(kw)m(ard)g(from)e(the)i(cursor)f(to)h(the)f +(b)s(eginning)g(of)h(the)f(curren)m(t)g(line.)150 4754 +y Ft(kill-whole-line)c(\(\))630 4864 y Fu(Kill)37 b(all)g(c)m +(haracters)h(on)f(the)f(curren)m(t)h(line,)h(no)f(matter)g(where)f(p)s +(oin)m(t)h(is.)59 b(By)36 b(default,)630 4974 y(this)30 +b(is)h(un)m(b)s(ound.)150 5121 y Ft(kill-word)d(\(M-d\))630 +5230 y Fu(Kill)i(from)f(p)s(oin)m(t)g(to)h(the)g(end)e(of)i(the)f +(curren)m(t)h(w)m(ord,)f(or)g(if)h(b)s(et)m(w)m(een)g(w)m(ords,)f(to)h +(the)g(end)630 5340 y(of)h(the)f(next)h(w)m(ord.)40 b(W)-8 +b(ord)31 b(b)s(oundaries)e(are)h(the)h(same)g(as)f Ft(forward-word)p +Fu(.)p eop end +%%Page: 119 125 +TeXDict begin 119 124 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(119)150 299 y Ft +(backward-kill-word)25 b(\(M-DEL\))630 408 y Fu(Kill)k(the)g(w)m(ord)g +(b)s(ehind)e(p)s(oin)m(t.)40 b(W)-8 b(ord)29 b(b)s(oundaries)f(are)h +(the)g(same)g(as)g Ft(backward-word)p Fu(.)150 569 y +Ft(shell-kill-word)d(\(\))630 679 y Fu(Kill)k(from)f(p)s(oin)m(t)g(to)h +(the)g(end)e(of)i(the)f(curren)m(t)h(w)m(ord,)f(or)g(if)h(b)s(et)m(w)m +(een)g(w)m(ords,)f(to)h(the)g(end)630 788 y(of)h(the)f(next)h(w)m(ord.) +40 b(W)-8 b(ord)31 b(b)s(oundaries)e(are)h(the)h(same)g(as)f +Ft(shell-forward-word)p Fu(.)150 949 y Ft(shell-backward-kill-word)24 +b(\(\))630 1059 y Fu(Kill)e(the)h(w)m(ord)e(b)s(ehind)g(p)s(oin)m(t.)38 +b(W)-8 b(ord)22 b(b)s(oundaries)f(are)h(the)g(same)h(as)f +Ft(shell-backward-)630 1168 y(word)p Fu(.)150 1329 y +Ft(unix-word-rubout)k(\(C-w\))630 1438 y Fu(Kill)32 b(the)g(w)m(ord)f +(b)s(ehind)f(p)s(oin)m(t,)i(using)f(white)h(space)g(as)g(a)g(w)m(ord)f +(b)s(oundary)-8 b(.)43 b(The)31 b(killed)630 1548 y(text)g(is)g(sa)m(v) +m(ed)g(on)g(the)f(kill-ring.)150 1709 y Ft(unix-filename-rubout)25 +b(\(\))630 1818 y Fu(Kill)37 b(the)f(w)m(ord)g(b)s(ehind)f(p)s(oin)m +(t,)j(using)e(white)g(space)h(and)f(the)g(slash)g(c)m(haracter)i(as)f +(the)630 1928 y(w)m(ord)30 b(b)s(oundaries.)39 b(The)30 +b(killed)h(text)g(is)g(sa)m(v)m(ed)g(on)g(the)f(kill-ring.)150 +2089 y Ft(delete-horizontal-space)24 b(\(\))630 2198 +y Fu(Delete)33 b(all)e(spaces)g(and)e(tabs)i(around)e(p)s(oin)m(t.)41 +b(By)31 b(default,)f(this)h(is)f(un)m(b)s(ound.)150 2359 +y Ft(kill-region)d(\(\))630 2469 y Fu(Kill)k(the)f(text)i(in)e(the)g +(curren)m(t)h(region.)41 b(By)31 b(default,)f(this)h(command)f(is)g(un) +m(b)s(ound.)150 2629 y Ft(copy-region-as-kill)25 b(\(\))630 +2739 y Fu(Cop)m(y)34 b(the)g(text)h(in)f(the)g(region)g(to)h(the)f +(kill)h(bu\013er,)f(so)g(it)h(can)f(b)s(e)f(y)m(ank)m(ed)i(righ)m(t)f +(a)m(w)m(a)m(y)-8 b(.)630 2848 y(By)31 b(default,)f(this)h(command)f +(is)g(un)m(b)s(ound.)150 3009 y Ft(copy-backward-word)25 +b(\(\))630 3119 y Fu(Cop)m(y)38 b(the)h(w)m(ord)f(b)s(efore)g(p)s(oin)m +(t)g(to)i(the)e(kill)h(bu\013er.)64 b(The)38 b(w)m(ord)g(b)s(oundaries) +f(are)i(the)630 3228 y(same)31 b(as)f Ft(backward-word)p +Fu(.)38 b(By)30 b(default,)h(this)f(command)g(is)h(un)m(b)s(ound.)150 +3389 y Ft(copy-forward-word)26 b(\(\))630 3499 y Fu(Cop)m(y)31 +b(the)g(w)m(ord)g(follo)m(wing)h(p)s(oin)m(t)f(to)h(the)f(kill)h +(bu\013er.)42 b(The)30 b(w)m(ord)h(b)s(oundaries)e(are)j(the)630 +3608 y(same)f(as)f Ft(forward-word)p Fu(.)38 b(By)30 +b(default,)h(this)g(command)f(is)g(un)m(b)s(ound.)150 +3769 y Ft(yank)f(\(C-y\))630 3878 y Fu(Y)-8 b(ank)31 +b(the)f(top)h(of)g(the)f(kill)h(ring)f(in)m(to)i(the)e(bu\013er)g(at)h +(p)s(oin)m(t.)150 4039 y Ft(yank-pop)d(\(M-y\))630 4149 +y Fu(Rotate)36 b(the)f(kill-ring,)i(and)d(y)m(ank)h(the)f(new)g(top.)54 +b(Y)-8 b(ou)35 b(can)g(only)f(do)h(this)f(if)h(the)g(prior)630 +4258 y(command)30 b(is)h Ft(yank)e Fu(or)h Ft(yank-pop)p +Fu(.)150 4459 y Fk(8.4.5)63 b(Sp)s(ecifying)42 b(Numeric)f(Argumen)m +(ts)150 4631 y Ft(digit-argument)26 b(\()p Fj(M-0)p Ft(,)j +Fj(M-1)p Ft(,)h(...)f Fj(M--)p Ft(\))630 4741 y Fu(Add)d(this)h(digit)g +(to)h(the)f(argumen)m(t)g(already)h(accum)m(ulating,)h(or)e(start)h(a)f +(new)f(argumen)m(t.)630 4851 y Fj(M--)j Fu(starts)i(a)g(negativ)m(e)i +(argumen)m(t.)150 5011 y Ft(universal-argument)25 b(\(\))630 +5121 y Fu(This)g(is)g(another)h(w)m(a)m(y)g(to)h(sp)s(ecify)e(an)g +(argumen)m(t.)40 b(If)25 b(this)g(command)h(is)f(follo)m(w)m(ed)i(b)m +(y)f(one)630 5230 y(or)k(more)f(digits,)i(optionally)g(with)e(a)h +(leading)h(min)m(us)e(sign,)h(those)g(digits)g(de\014ne)f(the)h(ar-)630 +5340 y(gumen)m(t.)41 b(If)28 b(the)i(command)f(is)g(follo)m(w)m(ed)h(b) +m(y)f(digits,)i(executing)f Ft(universal-argument)p eop +end +%%Page: 120 126 +TeXDict begin 120 125 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(120)630 299 y(again)33 +b(ends)e(the)h(n)m(umeric)f(argumen)m(t,)i(but)e(is)h(otherwise)g +(ignored.)45 b(As)32 b(a)g(sp)s(ecial)h(case,)630 408 +y(if)g(this)g(command)f(is)h(immediately)h(follo)m(w)m(ed)h(b)m(y)d(a)h +(c)m(haracter)i(that)e(is)g(neither)g(a)g(digit)630 518 +y(or)28 b(min)m(us)f(sign,)i(the)f(argumen)m(t)g(coun)m(t)h(for)e(the)i +(next)f(command)f(is)h(m)m(ultiplied)h(b)m(y)e(four.)630 +628 y(The)37 b(argumen)m(t)h(coun)m(t)f(is)h(initially)h(one,)g(so)f +(executing)g(this)f(function)g(the)h(\014rst)e(time)630 +737 y(mak)m(es)d(the)e(argumen)m(t)i(coun)m(t)f(four,)f(a)i(second)e +(time)i(mak)m(es)f(the)g(argumen)m(t)g(coun)m(t)h(six-)630 +847 y(teen,)e(and)f(so)h(on.)40 b(By)31 b(default,)g(this)f(is)g(not)h +(b)s(ound)d(to)j(a)g(k)m(ey)-8 b(.)150 1052 y Fk(8.4.6)63 +b(Letting)40 b(Readline)h(T)m(yp)s(e)g(F)-10 b(or)42 +b(Y)-10 b(ou)150 1226 y Ft(complete)28 b(\(TAB\))630 +1336 y Fu(A)m(ttempt)c(to)f(p)s(erform)e(completion)j(on)f(the)g(text)g +(b)s(efore)f(p)s(oin)m(t.)39 b(The)22 b(actual)i(completion)630 +1445 y(p)s(erformed)33 b(is)h(application-sp)s(eci\014c.)53 +b(Bash)35 b(attempts)g(completion)g(treating)h(the)e(text)630 +1555 y(as)39 b(a)h(v)-5 b(ariable)39 b(\(if)h(the)f(text)h(b)s(egins)e +(with)h(`)p Ft($)p Fu('\),)j(username)c(\(if)i(the)f(text)h(b)s(egins)e +(with)630 1665 y(`)p Ft(~)p Fu('\),)31 b(hostname)f(\(if)g(the)g(text)h +(b)s(egins)e(with)h(`)p Ft(@)p Fu('\),)h(or)f(command)f(\(including)h +(aliases)i(and)630 1774 y(functions\))j(in)f(turn.)53 +b(If)34 b(none)g(of)h(these)h(pro)s(duces)d(a)i(matc)m(h,)i(\014lename) +e(completion)h(is)630 1884 y(attempted.)150 2049 y Ft +(possible-completions)25 b(\(M-?\))630 2158 y Fu(List)35 +b(the)g(p)s(ossible)f(completions)i(of)e(the)h(text)h(b)s(efore)e(p)s +(oin)m(t.)54 b(When)34 b(displa)m(ying)h(com-)630 2268 +y(pletions,)f(Readline)f(sets)f(the)h(n)m(um)m(b)s(er)e(of)i(columns)f +(used)f(for)i(displa)m(y)f(to)h(the)g(v)-5 b(alue)33 +b(of)630 2378 y Ft(completion-display-width)o Fu(,)g(the)j(v)-5 +b(alue)37 b(of)g(the)f(en)m(vironmen)m(t)h(v)-5 b(ariable)38 +b Ft(COLUMNS)p Fu(,)630 2487 y(or)30 b(the)h(screen)f(width,)g(in)g +(that)h(order.)150 2652 y Ft(insert-completions)25 b(\(M-*\))630 +2762 y Fu(Insert)30 b(all)h(completions)h(of)f(the)g(text)g(b)s(efore)f +(p)s(oin)m(t)h(that)g(w)m(ould)f(ha)m(v)m(e)i(b)s(een)e(generated)630 +2871 y(b)m(y)g Ft(possible-completions)p Fu(.)150 3036 +y Ft(menu-complete)d(\(\))630 3146 y Fu(Similar)d(to)g +Ft(complete)p Fu(,)f(but)h(replaces)g(the)g(w)m(ord)g(to)g(b)s(e)f +(completed)i(with)e(a)i(single)f(matc)m(h)630 3255 y(from)37 +b(the)h(list)h(of)f(p)s(ossible)f(completions.)64 b(Rep)s(eated)39 +b(execution)g(of)f Ft(menu-complete)630 3365 y Fu(steps)i(through)g +(the)g(list)h(of)f(p)s(ossible)g(completions,)k(inserting)c(eac)m(h)i +(matc)m(h)f(in)f(turn.)630 3475 y(A)m(t)e(the)f(end)f(of)h(the)g(list)g +(of)g(completions,)i(the)e(b)s(ell)g(is)g(rung)f(\(sub)5 +b(ject)36 b(to)i(the)f(setting)630 3584 y(of)f Ft(bell-style)p +Fu(\))e(and)h(the)h(original)i(text)f(is)f(restored.)57 +b(An)36 b(argumen)m(t)h(of)f Fr(n)f Fu(mo)m(v)m(es)i +Fr(n)630 3694 y Fu(p)s(ositions)e(forw)m(ard)f(in)g(the)h(list)h(of)e +(matc)m(hes;)39 b(a)c(negativ)m(e)i(argumen)m(t)e(ma)m(y)g(b)s(e)f +(used)g(to)630 3803 y(mo)m(v)m(e)40 b(bac)m(kw)m(ard)e(through)g(the)g +(list.)65 b(This)38 b(command)g(is)g(in)m(tended)g(to)h(b)s(e)f(b)s +(ound)e(to)630 3913 y Ft(TAB)p Fu(,)30 b(but)f(is)i(un)m(b)s(ound)d(b)m +(y)i(default.)150 4078 y Ft(menu-complete-backward)24 +b(\(\))630 4188 y Fu(Iden)m(tical)36 b(to)g Ft(menu-complete)p +Fu(,)d(but)h(mo)m(v)m(es)j(bac)m(kw)m(ard)e(through)f(the)i(list)f(of)g +(p)s(ossible)630 4297 y(completions,)d(as)e(if)h Ft(menu-complete)26 +b Fu(had)k(b)s(een)g(giv)m(en)h(a)g(negativ)m(e)i(argumen)m(t.)150 +4462 y Ft(delete-char-or-list)25 b(\(\))630 4572 y Fu(Deletes)41 +b(the)e(c)m(haracter)h(under)e(the)h(cursor)f(if)h(not)g(at)g(the)h(b)s +(eginning)e(or)h(end)f(of)h(the)630 4681 y(line)50 b(\(lik)m(e)h +Ft(delete-char)p Fu(\).)96 b(If)49 b(at)h(the)g(end)f(of)h(the)f(line,) +55 b(b)s(eha)m(v)m(es)c(iden)m(tically)g(to)630 4791 +y Ft(possible-completions)p Fu(.)35 b(This)30 b(command)g(is)g(un)m(b)s +(ound)e(b)m(y)i(default.)150 4956 y Ft(complete-filename)c(\(M-/\))630 +5065 y Fu(A)m(ttempt)32 b(\014lename)e(completion)i(on)e(the)h(text)g +(b)s(efore)f(p)s(oin)m(t.)150 5230 y Ft(possible-filename-comple)o +(tion)o(s)24 b(\(C-x)30 b(/\))630 5340 y Fu(List)f(the)g(p)s(ossible)f +(completions)h(of)g(the)g(text)g(b)s(efore)g(p)s(oin)m(t,)g(treating)h +(it)f(as)g(a)f(\014lename.)p eop end +%%Page: 121 127 +TeXDict begin 121 126 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(121)150 299 y Ft +(complete-username)26 b(\(M-~\))630 408 y Fu(A)m(ttempt)32 +b(completion)f(on)g(the)f(text)i(b)s(efore)e(p)s(oin)m(t,)g(treating)i +(it)f(as)f(a)h(username.)150 569 y Ft(possible-username-comple)o(tion)o +(s)24 b(\(C-x)30 b(~\))630 679 y Fu(List)25 b(the)g(p)s(ossible)g +(completions)h(of)f(the)g(text)h(b)s(efore)f(p)s(oin)m(t,)h(treating)g +(it)g(as)f(a)g(username.)150 839 y Ft(complete-variable)h(\(M-$\))630 +949 y Fu(A)m(ttempt)32 b(completion)f(on)g(the)f(text)i(b)s(efore)e(p)s +(oin)m(t,)g(treating)i(it)f(as)f(a)h(shell)g(v)-5 b(ariable.)150 +1110 y Ft(possible-variable-comple)o(tion)o(s)24 b(\(C-x)30 +b($\))630 1219 y Fu(List)42 b(the)g(p)s(ossible)g(completions)h(of)f +(the)g(text)h(b)s(efore)e(p)s(oin)m(t,)46 b(treating)d(it)f(as)g(a)h +(shell)630 1329 y(v)-5 b(ariable.)150 1490 y Ft(complete-hostname)26 +b(\(M-@\))630 1599 y Fu(A)m(ttempt)32 b(completion)f(on)g(the)f(text)i +(b)s(efore)e(p)s(oin)m(t,)g(treating)i(it)f(as)f(a)h(hostname.)150 +1760 y Ft(possible-hostname-comple)o(tion)o(s)24 b(\(C-x)30 +b(@\))630 1869 y Fu(List)25 b(the)g(p)s(ossible)f(completions)h(of)g +(the)g(text)g(b)s(efore)g(p)s(oin)m(t,)h(treating)g(it)f(as)f(a)h +(hostname.)150 2030 y Ft(complete-command)h(\(M-!\))630 +2140 y Fu(A)m(ttempt)32 b(completion)g(on)f(the)g(text)h(b)s(efore)e(p) +s(oin)m(t,)h(treating)h(it)g(as)f(a)g(command)g(name.)630 +2249 y(Command)46 b(completion)i(attempts)g(to)f(matc)m(h)h(the)f(text) +h(against)g(aliases,)53 b(reserv)m(ed)630 2359 y(w)m(ords,)36 +b(shell)g(functions,)h(shell)e(builtins,)i(and)e(\014nally)g +(executable)i(\014lenames,)g(in)e(that)630 2469 y(order.)150 +2629 y Ft(possible-command-complet)o(ions)24 b(\(C-x)29 +b(!\))630 2739 y Fu(List)d(the)h(p)s(ossible)f(completions)h(of)f(the)h +(text)g(b)s(efore)f(p)s(oin)m(t,)h(treating)g(it)g(as)g(a)f(command)630 +2848 y(name.)150 3009 y Ft(dynamic-complete-history)e(\(M-TAB\))630 +3119 y Fu(A)m(ttempt)31 b(completion)h(on)e(the)g(text)h(b)s(efore)f(p) +s(oin)m(t,)g(comparing)h(the)f(text)h(against)h(lines)630 +3228 y(from)e(the)g(history)h(list)g(for)f(p)s(ossible)g(completion)i +(matc)m(hes.)150 3389 y Ft(dabbrev-expand)26 b(\(\))630 +3499 y Fu(A)m(ttempt)i(men)m(u)e(completion)i(on)f(the)g(text)g(b)s +(efore)f(p)s(oin)m(t,)i(comparing)f(the)g(text)h(against)630 +3608 y(lines)j(from)e(the)i(history)f(list)h(for)g(p)s(ossible)e +(completion)j(matc)m(hes.)150 3769 y Ft(complete-into-braces)25 +b(\(M-{\))630 3878 y Fu(P)m(erform)f(\014lename)f(completion)i(and)f +(insert)f(the)h(list)g(of)g(p)s(ossible)f(completions)i(enclosed)630 +3988 y(within)34 b(braces)h(so)f(the)h(list)g(is)g(a)m(v)-5 +b(ailable)37 b(to)e(the)g(shell)g(\(see)g(Section)h(3.5.1)g([Brace)g +(Ex-)630 4098 y(pansion],)30 b(page)h(21\).)150 4298 +y Fk(8.4.7)63 b(Keyb)s(oard)41 b(Macros)150 4471 y Ft(start-kbd-macro) +26 b(\(C-x)j(\(\))630 4580 y Fu(Begin)i(sa)m(ving)h(the)e(c)m +(haracters)i(t)m(yp)s(ed)e(in)m(to)h(the)g(curren)m(t)f(k)m(eyb)s(oard) +g(macro.)150 4741 y Ft(end-kbd-macro)d(\(C-x)i(\)\))630 +4851 y Fu(Stop)e(sa)m(ving)h(the)g(c)m(haracters)g(t)m(yp)s(ed)f(in)m +(to)i(the)e(curren)m(t)g(k)m(eyb)s(oard)g(macro)h(and)f(sa)m(v)m(e)i +(the)630 4960 y(de\014nition.)150 5121 y Ft(call-last-kbd-macro)c +(\(C-x)k(e\))630 5230 y Fu(Re-execute)37 b(the)e(last)h(k)m(eyb)s(oard) +f(macro)h(de\014ned,)f(b)m(y)h(making)f(the)g(c)m(haracters)i(in)e(the) +630 5340 y(macro)c(app)s(ear)f(as)g(if)h(t)m(yp)s(ed)f(at)h(the)f(k)m +(eyb)s(oard.)p eop end +%%Page: 122 128 +TeXDict begin 122 127 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(122)150 299 y Ft +(print-last-kbd-macro)25 b(\(\))630 408 y Fu(Prin)m(t)30 +b(the)h(last)g(k)m(eb)s(oard)f(macro)h(de\014ned)e(in)i(a)f(format)h +(suitable)g(for)f(the)h Fr(inputrc)k Fu(\014le.)150 604 +y Fk(8.4.8)63 b(Some)41 b(Miscellaneous)i(Commands)150 +774 y Ft(re-read-init-file)26 b(\(C-x)j(C-r\))630 884 +y Fu(Read)22 b(in)g(the)g(con)m(ten)m(ts)h(of)f(the)g +Fr(inputrc)27 b Fu(\014le,)d(and)d(incorp)s(orate)h(an)m(y)h(bindings)d +(or)i(v)-5 b(ariable)630 994 y(assignmen)m(ts)31 b(found)e(there.)150 +1150 y Ft(abort)g(\(C-g\))630 1259 y Fu(Ab)s(ort)d(the)h(curren)m(t)f +(editing)h(command)f(and)g(ring)h(the)f(terminal's)h(b)s(ell)g(\(sub)5 +b(ject)26 b(to)i(the)630 1369 y(setting)j(of)g Ft(bell-style)p +Fu(\).)150 1525 y Ft(do-uppercase-version)25 b(\(M-a,)k(M-b,)g(M-)p +Fj(x)p Ft(,)g(...)o(\))630 1634 y Fu(If)e(the)h(meta\014ed)g(c)m +(haracter)h Fr(x)34 b Fu(is)28 b(lo)m(w)m(ercase,)i(run)d(the)g +(command)h(that)g(is)g(b)s(ound)d(to)k(the)630 1744 y(corresp)s(onding) +g(upp)s(ercase)h(c)m(haracter.)150 1900 y Ft(prefix-meta)d(\(ESC\))630 +2010 y Fu(Metafy)39 b(the)e(next)h(c)m(haracter)h(t)m(yp)s(ed.)62 +b(This)37 b(is)g(for)h(k)m(eyb)s(oards)f(without)g(a)h(meta)g(k)m(ey)-8 +b(.)630 2119 y(T)m(yping)30 b(`)p Ft(ESC)g(f)p Fu(')g(is)h(equiv)-5 +b(alen)m(t)31 b(to)g(t)m(yping)g Fj(M-f)p Fu(.)150 2275 +y Ft(undo)e(\(C-_)g(or)h(C-x)g(C-u\))630 2385 y Fu(Incremen)m(tal)h +(undo,)f(separately)h(remem)m(b)s(ered)f(for)g(eac)m(h)i(line.)150 +2541 y Ft(revert-line)27 b(\(M-r\))630 2650 y Fu(Undo)33 +b(all)h(c)m(hanges)g(made)f(to)h(this)f(line.)49 b(This)32 +b(is)h(lik)m(e)i(executing)f(the)f Ft(undo)f Fu(command)630 +2760 y(enough)e(times)h(to)g(get)h(bac)m(k)f(to)g(the)f(b)s(eginning.) +150 2916 y Ft(tilde-expand)d(\(M-&\))630 3026 y Fu(P)m(erform)j(tilde)h +(expansion)g(on)f(the)g(curren)m(t)h(w)m(ord.)150 3182 +y Ft(set-mark)d(\(C-@\))630 3291 y Fu(Set)33 b(the)g(mark)f(to)i(the)f +(p)s(oin)m(t.)48 b(If)32 b(a)h(n)m(umeric)g(argumen)m(t)g(is)g +(supplied,)f(the)h(mark)g(is)f(set)630 3401 y(to)f(that)g(p)s(osition.) +150 3557 y Ft(exchange-point-and-mark)24 b(\(C-x)29 b(C-x\))630 +3666 y Fu(Sw)m(ap)i(the)g(p)s(oin)m(t)g(with)g(the)g(mark.)43 +b(The)31 b(curren)m(t)g(cursor)f(p)s(osition)i(is)f(set)h(to)f(the)h +(sa)m(v)m(ed)630 3776 y(p)s(osition,)f(and)e(the)i(old)g(cursor)e(p)s +(osition)i(is)f(sa)m(v)m(ed)i(as)e(the)h(mark.)150 3932 +y Ft(character-search)26 b(\(C-]\))630 4042 y Fu(A)f(c)m(haracter)h(is) +f(read)g(and)f(p)s(oin)m(t)h(is)g(mo)m(v)m(ed)h(to)g(the)f(next)g(o)s +(ccurrence)g(of)g(that)g(c)m(haracter.)630 4151 y(A)30 +b(negativ)m(e)j(coun)m(t)e(searc)m(hes)g(for)f(previous)g(o)s +(ccurrences.)150 4307 y Ft(character-search-backwar)o(d)24 +b(\(M-C-]\))630 4417 y Fu(A)45 b(c)m(haracter)h(is)f(read)g(and)f(p)s +(oin)m(t)h(is)g(mo)m(v)m(ed)h(to)f(the)g(previous)f(o)s(ccurrence)h(of) +g(that)630 4526 y(c)m(haracter.)d(A)31 b(negativ)m(e)h(coun)m(t)f +(searc)m(hes)h(for)e(subsequen)m(t)f(o)s(ccurrences.)150 +4682 y Ft(skip-csi-sequence)d(\(\))630 4792 y Fu(Read)i(enough)f(c)m +(haracters)h(to)g(consume)f(a)h(m)m(ulti-k)m(ey)h(sequence)f(suc)m(h)f +(as)g(those)h(de\014ned)630 4902 y(for)37 b(k)m(eys)h(lik)m(e)g(Home)g +(and)f(End.)60 b(Suc)m(h)37 b(sequences)g(b)s(egin)g(with)g(a)h(Con)m +(trol)g(Sequence)630 5011 y(Indicator)f(\(CSI\),)f(usually)h(ESC-[.)59 +b(If)36 b(this)g(sequence)h(is)g(b)s(ound)d(to)k Ft("\\)p +Fu(e[)p Ft(")p Fu(,)g(k)m(eys)f(pro-)630 5121 y(ducing)31 +b(suc)m(h)h(sequences)g(will)h(ha)m(v)m(e)g(no)f(e\013ect)h(unless)e +(explicitly)j(b)s(ound)c(to)i(a)h(readline)630 5230 y(command,)f +(instead)g(of)g(inserting)g(stra)m(y)h(c)m(haracters)g(in)m(to)g(the)f +(editing)h(bu\013er.)44 b(This)31 b(is)630 5340 y(un)m(b)s(ound)d(b)m +(y)i(default,)h(but)f(usually)g(b)s(ound)e(to)j(ESC-[.)p +eop end +%%Page: 123 129 +TeXDict begin 123 128 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(123)150 299 y Ft(insert-comment)26 +b(\(M-#\))630 408 y Fu(Without)36 b(a)g(n)m(umeric)g(argumen)m(t,)h +(the)f(v)-5 b(alue)36 b(of)g(the)g Ft(comment-begin)c +Fu(v)-5 b(ariable)36 b(is)g(in-)630 518 y(serted)c(at)g(the)g(b)s +(eginning)f(of)h(the)f(curren)m(t)h(line.)45 b(If)31 +b(a)h(n)m(umeric)f(argumen)m(t)h(is)g(supplied,)630 628 +y(this)k(command)h(acts)g(as)g(a)g(toggle:)55 b(if)37 +b(the)f(c)m(haracters)i(at)g(the)e(b)s(eginning)g(of)h(the)g(line)630 +737 y(do)30 b(not)h(matc)m(h)h(the)f(v)-5 b(alue)31 b(of)f +Ft(comment-begin)p Fu(,)e(the)i(v)-5 b(alue)31 b(is)g(inserted,)g +(otherwise)g(the)630 847 y(c)m(haracters)42 b(in)d Ft(comment-begin)e +Fu(are)j(deleted)h(from)f(the)g(b)s(eginning)g(of)g(the)g(line.)71 +b(In)630 956 y(either)37 b(case,)j(the)e(line)f(is)g(accepted)i(as)e +(if)g(a)g(newline)g(had)g(b)s(een)f(t)m(yp)s(ed.)60 b(The)37 +b(default)630 1066 y(v)-5 b(alue)32 b(of)g Ft(comment-begin)c +Fu(causes)k(this)f(command)h(to)g(mak)m(e)h(the)e(curren)m(t)h(line)g +(a)g(shell)630 1176 y(commen)m(t.)40 b(If)26 b(a)h(n)m(umeric)f +(argumen)m(t)h(causes)g(the)f(commen)m(t)i(c)m(haracter)g(to)f(b)s(e)f +(remo)m(v)m(ed,)630 1285 y(the)31 b(line)f(will)h(b)s(e)f(executed)h(b) +m(y)f(the)h(shell.)150 1443 y Ft(dump-functions)26 b(\(\))630 +1553 y Fu(Prin)m(t)g(all)i(of)e(the)h(functions)f(and)g(their)g(k)m(ey) +h(bindings)e(to)j(the)e(Readline)h(output)f(stream.)630 +1663 y(If)31 b(a)h(n)m(umeric)g(argumen)m(t)g(is)g(supplied,)f(the)h +(output)f(is)h(formatted)g(in)f(suc)m(h)h(a)g(w)m(a)m(y)g(that)630 +1772 y(it)f(can)g(b)s(e)e(made)i(part)f(of)g(an)h Fr(inputrc)k +Fu(\014le.)41 b(This)29 b(command)h(is)h(un)m(b)s(ound)c(b)m(y)k +(default.)150 1931 y Ft(dump-variables)26 b(\(\))630 +2040 y Fu(Prin)m(t)21 b(all)h(of)g(the)f(settable)i(v)-5 +b(ariables)22 b(and)f(their)g(v)-5 b(alues)22 b(to)g(the)f(Readline)h +(output)f(stream.)630 2150 y(If)31 b(a)h(n)m(umeric)g(argumen)m(t)g(is) +g(supplied,)f(the)h(output)f(is)h(formatted)g(in)f(suc)m(h)h(a)g(w)m(a) +m(y)g(that)630 2259 y(it)f(can)g(b)s(e)e(made)i(part)f(of)g(an)h +Fr(inputrc)k Fu(\014le.)41 b(This)29 b(command)h(is)h(un)m(b)s(ound)c +(b)m(y)k(default.)150 2418 y Ft(dump-macros)c(\(\))630 +2527 y Fu(Prin)m(t)34 b(all)g(of)g(the)g(Readline)g(k)m(ey)h(sequences) +f(b)s(ound)e(to)i(macros)g(and)f(the)h(strings)g(they)630 +2637 y(output.)53 b(If)35 b(a)g(n)m(umeric)f(argumen)m(t)i(is)e +(supplied,)h(the)g(output)g(is)f(formatted)i(in)e(suc)m(h)h(a)630 +2746 y(w)m(a)m(y)c(that)g(it)f(can)g(b)s(e)g(made)g(part)f(of)i(an)e +Fr(inputrc)35 b Fu(\014le.)41 b(This)29 b(command)h(is)g(un)m(b)s(ound) +d(b)m(y)630 2856 y(default.)150 3014 y Ft(glob-complete-word)e(\(M-g\)) +630 3124 y Fu(The)i(w)m(ord)h(b)s(efore)f(p)s(oin)m(t)h(is)g(treated)h +(as)f(a)h(pattern)f(for)f(pathname)h(expansion,)g(with)g(an)630 +3233 y(asterisk)d(implicitly)h(app)s(ended.)37 b(This)23 +b(pattern)i(is)f(used)g(to)h(generate)h(a)e(list)h(of)g(matc)m(hing)630 +3343 y(\014le)30 b(names)h(for)f(p)s(ossible)g(completions.)150 +3501 y Ft(glob-expand-word)c(\(C-x)j(*\))630 3611 y Fu(The)40 +b(w)m(ord)g(b)s(efore)g(p)s(oin)m(t)h(is)g(treated)g(as)g(a)g(pattern)g +(for)f(pathname)g(expansion,)k(and)630 3720 y(the)c(list)g(of)f(matc)m +(hing)i(\014le)e(names)g(is)h(inserted,)h(replacing)g(the)e(w)m(ord.)67 +b(If)39 b(a)h(n)m(umeric)630 3830 y(argumen)m(t)31 b(is)f(supplied,)g +(a)g(`)p Ft(*)p Fu(')h(is)f(app)s(ended)f(b)s(efore)h(pathname)g +(expansion.)150 3988 y Ft(glob-list-expansions)25 b(\(C-x)k(g\))630 +4098 y Fu(The)k(list)h(of)f(expansions)g(that)h(w)m(ould)f(ha)m(v)m(e)h +(b)s(een)f(generated)h(b)m(y)f Ft(glob-expand-word)630 +4208 y Fu(is)h(displa)m(y)m(ed,)h(and)e(the)h(line)g(is)f(redra)m(wn.) +50 b(If)33 b(a)h(n)m(umeric)g(argumen)m(t)g(is)f(supplied,)h(a)g(`)p +Ft(*)p Fu(')630 4317 y(is)c(app)s(ended)f(b)s(efore)h(pathname)g +(expansion.)150 4475 y Ft(display-shell-version)25 b(\(C-x)k(C-v\))630 +4585 y Fu(Displa)m(y)j(v)m(ersion)e(information)h(ab)s(out)f(the)h +(curren)m(t)f(instance)h(of)f(Bash.)150 4743 y Ft(shell-expand-line)c +(\(M-C-e\))630 4853 y Fu(Expand)34 b(the)h(line)h(as)g(the)f(shell)h +(do)s(es.)55 b(This)34 b(p)s(erforms)g(alias)i(and)f(history)g +(expansion)630 4963 y(as)f(w)m(ell)g(as)g(all)h(of)e(the)h(shell)g(w)m +(ord)f(expansions)g(\(see)i(Section)f(3.5)h([Shell)e(Expansions],)630 +5072 y(page)e(21\).)150 5230 y Ft(history-expand-line)25 +b(\(M-^\))630 5340 y Fu(P)m(erform)30 b(history)h(expansion)f(on)g(the) +h(curren)m(t)f(line.)p eop end +%%Page: 124 130 +TeXDict begin 124 129 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(124)150 299 y Ft(magic-space)27 +b(\(\))630 408 y Fu(P)m(erform)c(history)g(expansion)g(on)g(the)g +(curren)m(t)g(line)g(and)g(insert)g(a)g(space)h(\(see)g(Section)g(9.3) +630 518 y([History)31 b(In)m(teraction],)i(page)e(135\).)150 +686 y Ft(alias-expand-line)26 b(\(\))630 796 y Fu(P)m(erform)i(alias)i +(expansion)e(on)g(the)h(curren)m(t)f(line)h(\(see)g(Section)g(6.6)h +([Aliases],)g(page)f(88\).)150 964 y Ft(history-and-alias-expand)o +(-lin)o(e)24 b(\(\))630 1074 y Fu(P)m(erform)30 b(history)h(and)e +(alias)j(expansion)e(on)g(the)h(curren)m(t)f(line.)150 +1242 y Ft(insert-last-argument)25 b(\(M-.)k(or)h(M-_\))630 +1352 y Fu(A)g(synon)m(ym)g(for)g Ft(yank-last-arg)p Fu(.)150 +1520 y Ft(operate-and-get-next)25 b(\(C-o\))630 1630 +y Fu(Accept)42 b(the)e(curren)m(t)h(line)f(for)h(execution)g(and)f +(fetc)m(h)i(the)e(next)h(line)g(relativ)m(e)i(to)e(the)630 +1739 y(curren)m(t)30 b(line)h(from)f(the)g(history)h(for)f(editing.)41 +b(An)m(y)31 b(argumen)m(t)f(is)h(ignored.)150 1908 y +Ft(edit-and-execute-command)24 b(\(C-xC-e\))630 2017 +y Fu(In)m(v)m(ok)m(e)34 b(an)f(editor)g(on)g(the)g(curren)m(t)f +(command)h(line,)h(and)e(execute)i(the)f(result)g(as)g(shell)630 +2127 y(commands.)81 b(Bash)44 b(attempts)h(to)g(in)m(v)m(ok)m(e)h +Ft($VISUAL)p Fu(,)f Ft($EDITOR)p Fu(,)h(and)d Ft(emacs)g +Fu(as)h(the)630 2236 y(editor,)31 b(in)f(that)h(order.)150 +2482 y Fs(8.5)68 b(Readline)47 b(vi)e(Mo)t(de)150 2642 +y Fu(While)32 b(the)g(Readline)g(library)f(do)s(es)g(not)h(ha)m(v)m(e)h +(a)f(full)f(set)h(of)g Ft(vi)f Fu(editing)h(functions,)f(it)h(do)s(es)g +(con)m(tain)150 2751 y(enough)i(to)h(allo)m(w)g(simple)f(editing)h(of)f +(the)g(line.)52 b(The)34 b(Readline)g Ft(vi)g Fu(mo)s(de)f(b)s(eha)m(v) +m(es)i(as)f(sp)s(eci\014ed)f(in)150 2861 y(the)e Fm(posix)e +Fu(standard.)275 3004 y(In)35 b(order)g(to)i(switc)m(h)f(in)m(teractiv) +m(ely)j(b)s(et)m(w)m(een)d Ft(emacs)f Fu(and)g Ft(vi)g +Fu(editing)h(mo)s(des,)h(use)f(the)g(`)p Ft(set)30 b(-o)150 +3114 y(emacs)p Fu(')43 b(and)h(`)p Ft(set)30 b(-o)f(vi)p +Fu(')44 b(commands)g(\(see)i(Section)f(4.3.1)h([The)e(Set)h(Builtin],)j +(page)e(58\).)83 b(The)150 3223 y(Readline)31 b(default)g(is)f +Ft(emacs)f Fu(mo)s(de.)275 3367 y(When)g(y)m(ou)i(en)m(ter)f(a)h(line)f +(in)g Ft(vi)f Fu(mo)s(de,)h(y)m(ou)h(are)f(already)h(placed)f(in)g +(`insertion')g(mo)s(de,)g(as)h(if)f(y)m(ou)150 3476 y(had)f(t)m(yp)s +(ed)g(an)g(`)p Ft(i)p Fu('.)41 b(Pressing)29 b Ft(ESC)f +Fu(switc)m(hes)i(y)m(ou)g(in)m(to)h(`command')e(mo)s(de,)h(where)e(y)m +(ou)i(can)g(edit)g(the)150 3586 y(text)35 b(of)f(the)g(line)g(with)f +(the)h(standard)f Ft(vi)g Fu(mo)m(v)m(emen)m(t)j(k)m(eys,)g(mo)m(v)m(e) +f(to)f(previous)g(history)f(lines)h(with)150 3695 y(`)p +Ft(k)p Fu(')d(and)e(subsequen)m(t)h(lines)h(with)f(`)p +Ft(j)p Fu(',)g(and)g(so)h(forth.)150 3941 y Fs(8.6)68 +b(Programmable)47 b(Completion)150 4101 y Fu(When)25 +b(w)m(ord)g(completion)i(is)f(attempted)g(for)g(an)f(argumen)m(t)h(to)g +(a)g(command)f(for)h(whic)m(h)f(a)h(completion)150 4210 +y(sp)s(eci\014cation)40 b(\(a)h Fr(compsp)s(ec)6 b Fu(\))39 +b(has)h(b)s(een)f(de\014ned)f(using)h(the)h Ft(complete)d +Fu(builtin)j(\(see)g(Section)h(8.7)150 4320 y([Programmable)h +(Completion)f(Builtins],)k(page)d(126\),)j(the)c(programmable)g +(completion)i(facilities)150 4429 y(are)31 b(in)m(v)m(ok)m(ed.)275 +4573 y(First,)23 b(the)e(command)g(name)g(is)h(iden)m(ti\014ed.)37 +b(If)21 b(a)g(compsp)s(ec)g(has)g(b)s(een)f(de\014ned)g(for)h(that)h +(command,)150 4682 y(the)44 b(compsp)s(ec)g(is)g(used)f(to)h(generate)i +(the)e(list)g(of)g(p)s(ossible)g(completions)h(for)e(the)h(w)m(ord.)81 +b(If)44 b(the)150 4792 y(command)36 b(w)m(ord)g(is)g(the)g(empt)m(y)h +(string)f(\(completion)i(attempted)f(at)g(the)g(b)s(eginning)e(of)h(an) +h(empt)m(y)150 4902 y(line\),)30 b(an)m(y)g(compsp)s(ec)f(de\014ned)f +(with)h(the)h Ft(-E)e Fu(option)i(to)g Ft(complete)d +Fu(is)i(used.)40 b(If)29 b(the)g(command)g(w)m(ord)150 +5011 y(is)e(a)h(full)e(pathname,)i(a)g(compsp)s(ec)e(for)h(the)g(full)g +(pathname)g(is)g(searc)m(hed)h(for)f(\014rst.)39 b(If)26 +b(no)h(compsp)s(ec)g(is)150 5121 y(found)22 b(for)g(the)h(full)g +(pathname,)h(an)f(attempt)h(is)f(made)g(to)g(\014nd)f(a)h(compsp)s(ec)f +(for)h(the)g(p)s(ortion)f(follo)m(wing)150 5230 y(the)34 +b(\014nal)g(slash.)53 b(If)34 b(those)g(searc)m(hes)i(do)e(not)g +(result)h(in)f(a)g(compsp)s(ec,)h(an)m(y)g(compsp)s(ec)f(de\014ned)f +(with)150 5340 y(the)e Ft(-D)e Fu(option)i(to)g Ft(complete)d +Fu(is)j(used)e(as)i(the)g(default.)p eop end +%%Page: 125 131 +TeXDict begin 125 130 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(125)275 299 y(Once)34 +b(a)g(compsp)s(ec)g(has)g(b)s(een)f(found,)h(it)h(is)f(used)f(to)i +(generate)h(the)e(list)h(of)f(matc)m(hing)h(w)m(ords.)51 +b(If)150 408 y(a)37 b(compsp)s(ec)f(is)g(not)h(found,)f(the)h(default)f +(Bash)h(completion)g(describ)s(ed)e(ab)s(o)m(v)m(e)j(\(see)f(Section)g +(8.4.6)150 518 y([Commands)30 b(F)-8 b(or)31 b(Completion],)g(page)g +(120\))h(is)f(p)s(erformed.)275 655 y(First,)g(the)g(actions)g(sp)s +(eci\014ed)f(b)m(y)h(the)f(compsp)s(ec)h(are)g(used.)40 +b(Only)30 b(matc)m(hes)i(whic)m(h)e(are)h(pre\014xed)150 +765 y(b)m(y)h(the)f(w)m(ord)h(b)s(eing)f(completed)h(are)g(returned.)44 +b(When)31 b(the)h Ft(-f)f Fu(or)h Ft(-d)f Fu(option)h(is)f(used)g(for)h +(\014lename)150 874 y(or)e(directory)h(name)f(completion,)i(the)e +(shell)h(v)-5 b(ariable)31 b Ft(FIGNORE)d Fu(is)i(used)f(to)i(\014lter) +g(the)f(matc)m(hes.)42 b(See)150 984 y(Section)31 b(5.2)h([Bash)e(V)-8 +b(ariables],)33 b(page)e(69,)g(for)f(a)h(description)g(of)f +Ft(FIGNORE)p Fu(.)275 1121 y(An)m(y)22 b(completions)h(sp)s(eci\014ed)f +(b)m(y)g(a)h(\014lename)f(expansion)h(pattern)f(to)h(the)g +Ft(-G)e Fu(option)i(are)g(generated)150 1230 y(next.)41 +b(The)29 b(w)m(ords)g(generated)h(b)m(y)g(the)g(pattern)f(need)h(not)f +(matc)m(h)i(the)f(w)m(ord)f(b)s(eing)g(completed.)41 +b(The)150 1340 y Ft(GLOBIGNORE)29 b Fu(shell)i(v)-5 b(ariable)32 +b(is)g(not)g(used)e(to)i(\014lter)g(the)g(matc)m(hes,)h(but)d(the)i +Ft(FIGNORE)e Fu(shell)h(v)-5 b(ariable)150 1450 y(is)30 +b(used.)275 1587 y(Next,)39 b(the)f(string)f(sp)s(eci\014ed)f(as)h(the) +g(argumen)m(t)h(to)g(the)f Ft(-W)f Fu(option)i(is)f(considered.)60 +b(The)37 b(string)150 1696 y(is)c(\014rst)e(split)i(using)f(the)h(c)m +(haracters)h(in)e(the)h Ft(IFS)e Fu(sp)s(ecial)j(v)-5 +b(ariable)33 b(as)g(delimiters.)48 b(Shell)32 b(quoting)h(is)150 +1806 y(honored.)56 b(Eac)m(h)37 b(w)m(ord)e(is)h(then)f(expanded)g +(using)h(brace)g(expansion,)h(tilde)f(expansion,)h(parameter)150 +1915 y(and)44 b(v)-5 b(ariable)46 b(expansion,)j(command)44 +b(substitution,)49 b(and)44 b(arithmetic)i(expansion,)j(as)c(describ)s +(ed)150 2025 y(ab)s(o)m(v)m(e)38 b(\(see)f(Section)h(3.5)g([Shell)e +(Expansions],)i(page)f(21\).)61 b(The)36 b(results)h(are)g(split)f +(using)h(the)f(rules)150 2134 y(describ)s(ed)29 b(ab)s(o)m(v)m(e)i +(\(see)f(Section)h(3.5.7)h([W)-8 b(ord)30 b(Splitting],)h(page)f(29\).) +42 b(The)30 b(results)f(of)h(the)g(expansion)150 2244 +y(are)f(pre\014x-matc)m(hed)h(against)g(the)f(w)m(ord)g(b)s(eing)f +(completed,)j(and)d(the)i(matc)m(hing)g(w)m(ords)e(b)s(ecome)i(the)150 +2354 y(p)s(ossible)g(completions.)275 2491 y(After)f(these)g(matc)m +(hes)i(ha)m(v)m(e)f(b)s(een)f(generated,)h(an)m(y)g(shell)f(function)g +(or)g(command)g(sp)s(eci\014ed)f(with)150 2600 y(the)36 +b Ft(-F)f Fu(and)g Ft(-C)g Fu(options)h(is)g(in)m(v)m(ok)m(ed.)59 +b(When)35 b(the)h(command)g(or)f(function)h(is)g(in)m(v)m(ok)m(ed,)i +(the)e Ft(COMP_)150 2710 y(LINE)p Fu(,)42 b Ft(COMP_POINT)p +Fu(,)d Ft(COMP_KEY)p Fu(,)i(and)e Ft(COMP_TYPE)f Fu(v)-5 +b(ariables)41 b(are)f(assigned)g(v)-5 b(alues)41 b(as)f(describ)s(ed) +150 2819 y(ab)s(o)m(v)m(e)34 b(\(see)g(Section)g(5.2)g([Bash)f(V)-8 +b(ariables],)36 b(page)d(69\).)50 b(If)33 b(a)g(shell)g(function)g(is)g +(b)s(eing)f(in)m(v)m(ok)m(ed,)k(the)150 2929 y Ft(COMP_WORDS)j +Fu(and)i Ft(COMP_CWORD)d Fu(v)-5 b(ariables)42 b(are)g(also)h(set.)74 +b(When)41 b(the)h(function)f(or)h(command)f(is)150 3039 +y(in)m(v)m(ok)m(ed,)c(the)e(\014rst)f(argumen)m(t)h(\($1\))h(is)e(the)h +(name)g(of)f(the)h(command)f(whose)h(argumen)m(ts)f(are)h(b)s(eing)150 +3148 y(completed,)30 b(the)f(second)f(argumen)m(t)h(\($2\))h(is)f(the)g +(w)m(ord)f(b)s(eing)g(completed,)i(and)e(the)h(third)e(argumen)m(t)150 +3258 y(\($3\))40 b(is)f(the)f(w)m(ord)h(preceding)f(the)h(w)m(ord)f(b)s +(eing)g(completed)i(on)e(the)h(curren)m(t)f(command)h(line.)65 +b(No)150 3367 y(\014ltering)33 b(of)h(the)f(generated)h(completions)g +(against)h(the)e(w)m(ord)g(b)s(eing)f(completed)i(is)g(p)s(erformed;)f +(the)150 3477 y(function)d(or)g(command)h(has)f(complete)i(freedom)e +(in)g(generating)h(the)g(matc)m(hes.)275 3614 y(An)m(y)j(function)h(sp) +s(eci\014ed)f(with)g Ft(-F)g Fu(is)h(in)m(v)m(ok)m(ed)h(\014rst.)53 +b(The)35 b(function)f(ma)m(y)h(use)g(an)m(y)g(of)g(the)g(shell)150 +3724 y(facilities,)50 b(including)44 b(the)h Ft(compgen)d +Fu(and)i Ft(compopt)e Fu(builtins)i(describ)s(ed)f(b)s(elo)m(w)h(\(see) +i(Section)f(8.7)150 3833 y([Programmable)31 b(Completion)h(Builtins],)f +(page)h(126\),)g(to)g(generate)g(the)f(matc)m(hes.)42 +b(It)31 b(m)m(ust)g(put)f(the)150 3943 y(p)s(ossible)g(completions)h +(in)f(the)h Ft(COMPREPLY)d Fu(arra)m(y)j(v)-5 b(ariable,)31 +b(one)g(p)s(er)e(arra)m(y)i(elemen)m(t.)275 4080 y(Next,)26 +b(an)m(y)f(command)f(sp)s(eci\014ed)g(with)g(the)h Ft(-C)f +Fu(option)h(is)f(in)m(v)m(ok)m(ed)i(in)e(an)g(en)m(vironmen)m(t)h +(equiv)-5 b(alen)m(t)150 4189 y(to)26 b(command)e(substitution.)39 +b(It)25 b(should)f(prin)m(t)h(a)g(list)h(of)f(completions,)i(one)e(p)s +(er)f(line,)j(to)f(the)f(standard)150 4299 y(output.)40 +b(Bac)m(kslash)32 b(ma)m(y)f(b)s(e)f(used)g(to)h(escap)s(e)g(a)f +(newline,)h(if)f(necessary)-8 b(.)275 4436 y(After)24 +b(all)i(of)f(the)f(p)s(ossible)g(completions)i(are)f(generated,)i(an)m +(y)e(\014lter)g(sp)s(eci\014ed)e(with)i(the)g Ft(-X)e +Fu(option)150 4545 y(is)34 b(applied)g(to)g(the)h(list.)52 +b(The)33 b(\014lter)h(is)g(a)h(pattern)f(as)g(used)f(for)h(pathname)g +(expansion;)i(a)e(`)p Ft(&)p Fu(')g(in)g(the)150 4655 +y(pattern)28 b(is)f(replaced)h(with)g(the)f(text)i(of)f(the)f(w)m(ord)h +(b)s(eing)f(completed.)40 b(A)28 b(literal)h(`)p Ft(&)p +Fu(')f(ma)m(y)g(b)s(e)f(escap)s(ed)150 4765 y(with)38 +b(a)h(bac)m(kslash;)k(the)38 b(bac)m(kslash)h(is)g(remo)m(v)m(ed)g(b)s +(efore)f(attempting)h(a)g(matc)m(h.)65 b(An)m(y)39 b(completion)150 +4874 y(that)32 b(matc)m(hes)g(the)g(pattern)g(will)f(b)s(e)g(remo)m(v)m +(ed)h(from)f(the)h(list.)44 b(A)32 b(leading)g(`)p Ft(!)p +Fu(')f(negates)i(the)f(pattern;)150 4984 y(in)e(this)g(case)i(an)m(y)e +(completion)i(not)f(matc)m(hing)g(the)g(pattern)f(will)h(b)s(e)f(remo)m +(v)m(ed.)275 5121 y(Finally)-8 b(,)42 b(an)m(y)c(pre\014x)g(and)f +(su\016x)h(sp)s(eci\014ed)f(with)i(the)f Ft(-P)g Fu(and)g +Ft(-S)f Fu(options)i(are)g(added)f(to)h(eac)m(h)150 5230 +y(mem)m(b)s(er)31 b(of)g(the)h(completion)h(list,)f(and)f(the)h(result) +f(is)h(returned)e(to)i(the)g(Readline)g(completion)h(co)s(de)150 +5340 y(as)e(the)f(list)h(of)g(p)s(ossible)f(completions.)p +eop end +%%Page: 126 132 +TeXDict begin 126 131 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(126)275 299 y(If)27 +b(the)h(previously-applied)f(actions)i(do)f(not)g(generate)h(an)m(y)f +(matc)m(hes,)i(and)d(the)h Ft(-o)h(dirnames)d Fu(op-)150 +408 y(tion)j(w)m(as)f(supplied)f(to)i Ft(complete)d Fu(when)h(the)h +(compsp)s(ec)g(w)m(as)g(de\014ned,)g(directory)g(name)h(completion)150 +518 y(is)h(attempted.)275 654 y(If)35 b(the)g Ft(-o)30 +b(plusdirs)j Fu(option)j(w)m(as)g(supplied)e(to)i Ft(complete)e +Fu(when)g(the)i(compsp)s(ec)f(w)m(as)h(de\014ned,)150 +764 y(directory)g(name)f(completion)i(is)e(attempted)h(and)f(an)m(y)h +(matc)m(hes)g(are)g(added)f(to)h(the)f(results)g(of)h(the)150 +873 y(other)31 b(actions.)275 1010 y(By)g(default,)i(if)e(a)h(compsp)s +(ec)f(is)h(found,)f(whatev)m(er)h(it)g(generates)h(is)e(returned)g(to)h +(the)g(completion)150 1119 y(co)s(de)21 b(as)g(the)g(full)g(set)g(of)g +(p)s(ossible)f(completions.)39 b(The)20 b(default)h(Bash)g(completions) +h(are)g(not)f(attempted,)150 1229 y(and)30 b(the)g(Readline)h(default)f +(of)g(\014lename)h(completion)g(is)f(disabled.)41 b(If)29 +b(the)i Ft(-o)e(bashdefault)e Fu(option)150 1338 y(w)m(as)d(supplied)e +(to)j Ft(complete)c Fu(when)i(the)g(compsp)s(ec)h(w)m(as)g(de\014ned,)g +(the)f(default)h(Bash)g(completions)h(are)150 1448 y(attempted)j(if)f +(the)h(compsp)s(ec)f(generates)h(no)f(matc)m(hes.)41 +b(If)27 b(the)g Ft(-o)j(default)25 b Fu(option)j(w)m(as)f(supplied)f +(to)150 1557 y Ft(complete)f Fu(when)h(the)h(compsp)s(ec)f(w)m(as)i +(de\014ned,)e(Readline's)i(default)f(completion)h(will)f(b)s(e)f(p)s +(erformed)150 1667 y(if)k(the)h(compsp)s(ec)f(\(and,)g(if)h(attempted,) +g(the)g(default)f(Bash)h(completions\))h(generate)g(no)e(matc)m(hes.) +275 1803 y(When)20 b(a)i(compsp)s(ec)e(indicates)i(that)g(directory)g +(name)f(completion)h(is)f(desired,)i(the)e(programmable)150 +1913 y(completion)31 b(functions)e(force)i(Readline)f(to)h(app)s(end)d +(a)i(slash)g(to)g(completed)h(names)e(whic)m(h)h(are)g(sym-)150 +2022 y(b)s(olic)40 b(links)g(to)h(directories,)j(sub)5 +b(ject)40 b(to)h(the)f(v)-5 b(alue)41 b(of)f(the)g Fr(mark-directories) +45 b Fu(Readline)c(v)-5 b(ariable,)150 2132 y(regardless)31 +b(of)f(the)h(setting)g(of)g(the)f Fr(mark-symlink)m(ed-directories)36 +b Fu(Readline)31 b(v)-5 b(ariable.)275 2268 y(There)25 +b(is)i(some)g(supp)s(ort)e(for)h(dynamically)h(mo)s(difying)f +(completions.)40 b(This)26 b(is)g(most)h(useful)f(when)150 +2378 y(used)40 b(in)h(com)m(bination)i(with)e(a)g(default)h(completion) +g(sp)s(eci\014ed)f(with)g Ft(-D)p Fu(.)72 b(It's)42 b(p)s(ossible)f +(for)g(shell)150 2487 y(functions)28 b(executed)h(as)f(completion)i +(handlers)d(to)i(indicate)g(that)g(completion)g(should)e(b)s(e)h +(retried)g(b)m(y)150 2597 y(returning)j(an)i(exit)g(status)f(of)h(124.) +48 b(If)31 b(a)i(shell)f(function)g(returns)f(124,)k(and)c(c)m(hanges)j +(the)e(compsp)s(ec)150 2707 y(asso)s(ciated)43 b(with)e(the)g(command)g +(on)g(whic)m(h)g(completion)i(is)e(b)s(eing)g(attempted)h(\(supplied)e +(as)i(the)150 2816 y(\014rst)29 b(argumen)m(t)h(when)e(the)i(function)f +(is)g(executed\),)j(programmable)d(completion)i(restarts)f(from)f(the) +150 2926 y(b)s(eginning,)e(with)g(an)h(attempt)g(to)g(\014nd)e(a)i(new) +e(compsp)s(ec)i(for)f(that)h(command.)39 b(This)27 b(allo)m(ws)h(a)g +(set)g(of)150 3035 y(completions)33 b(to)f(b)s(e)g(built)f(dynamically) +i(as)f(completion)h(is)f(attempted,)h(rather)f(than)f(b)s(eing)g +(loaded)150 3145 y(all)g(at)g(once.)275 3281 y(F)-8 b(or)38 +b(instance,)h(assuming)e(that)h(there)f(is)h(a)f(library)g(of)g(compsp) +s(ecs,)i(eac)m(h)g(k)m(ept)e(in)g(a)h(\014le)f(corre-)150 +3391 y(sp)s(onding)g(to)j(the)f(name)f(of)h(the)g(command,)i(the)e +(follo)m(wing)h(default)f(completion)h(function)e(w)m(ould)150 +3500 y(load)31 b(completions)g(dynamically:)390 3636 +y Ft(_completion_loader\(\))390 3746 y({)581 3856 y(.)47 +b("/etc/bash_completion.d/$1)o(.sh)o(")42 b(>/dev/null)j(2>&1)i(&&)g +(return)f(124)390 3965 y(})390 4075 y(complete)g(-D)h(-F)g +(_completion_loader)c(-o)k(bashdefault)e(-o)i(default)150 +4310 y Fs(8.7)68 b(Programmable)47 b(Completion)f(Builtins)150 +4469 y Fu(Three)21 b(builtin)g(commands)f(are)i(a)m(v)-5 +b(ailable)24 b(to)e(manipulate)f(the)h(programmable)f(completion)h +(facilities:)150 4579 y(one)34 b(to)g(sp)s(ecify)f(ho)m(w)h(the)f +(argumen)m(ts)h(to)g(a)g(particular)g(command)f(are)h(to)g(b)s(e)f +(completed,)j(and)d(t)m(w)m(o)150 4688 y(to)e(mo)s(dify)f(the)g +(completion)i(as)e(it)h(is)g(happ)s(ening.)150 4850 y +Ft(compgen)870 4985 y(compgen)46 b([)p Fj(option)p Ft(])f([)p +Fj(word)p Ft(])630 5121 y Fu(Generate)27 b(p)s(ossible)e(completion)i +(matc)m(hes)g(for)e Fr(w)m(ord)k Fu(according)e(to)f(the)g +Fr(option)p Fu(s,)h(whic)m(h)630 5230 y(ma)m(y)32 b(b)s(e)f(an)m(y)h +(option)g(accepted)g(b)m(y)g(the)f Ft(complete)f Fu(builtin)h(with)g +(the)g(exception)i(of)f Ft(-p)630 5340 y Fu(and)39 b +Ft(-r)p Fu(,)i(and)e(write)h(the)g(matc)m(hes)g(to)g(the)g(standard)f +(output.)68 b(When)39 b(using)g(the)h Ft(-F)p eop end +%%Page: 127 133 +TeXDict begin 127 132 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(127)630 299 y(or)33 +b Ft(-C)f Fu(options,)i(the)e(v)-5 b(arious)33 b(shell)g(v)-5 +b(ariables)33 b(set)g(b)m(y)g(the)g(programmable)g(completion)630 +408 y(facilities,)g(while)d(a)m(v)-5 b(ailable,)33 b(will)e(not)g(ha)m +(v)m(e)g(useful)f(v)-5 b(alues.)630 542 y(The)34 b(matc)m(hes)h(will)g +(b)s(e)f(generated)h(in)f(the)h(same)g(w)m(a)m(y)g(as)g(if)f(the)h +(programmable)f(com-)630 652 y(pletion)d(co)s(de)g(had)f(generated)i +(them)e(directly)i(from)e(a)h(completion)h(sp)s(eci\014cation)f(with) +630 762 y(the)e(same)h(\015ags.)40 b(If)29 b Fr(w)m(ord)j +Fu(is)d(sp)s(eci\014ed,)g(only)g(those)h(completions)g(matc)m(hing)g +Fr(w)m(ord)j Fu(will)630 871 y(b)s(e)d(displa)m(y)m(ed.)630 +1005 y(The)24 b(return)g(v)-5 b(alue)25 b(is)g(true)f(unless)g(an)h(in) +m(v)-5 b(alid)25 b(option)g(is)g(supplied,)f(or)h(no)g(matc)m(hes)g(w)m +(ere)630 1115 y(generated.)150 1273 y Ft(complete)870 +1407 y(complete)46 b([-abcdefgjksuv])d([-o)k Fj(comp-option)p +Ft(])e([-DE])h([-A)h Fj(action)p Ft(])f([-)870 1517 y(G)h +Fj(globpat)p Ft(])f([-W)h Fj(wordlist)p Ft(])870 1626 +y([-F)g Fj(function)p Ft(])e([-C)i Fj(command)p Ft(])f([-X)h +Fj(filterpat)p Ft(])870 1736 y([-P)g Fj(prefix)p Ft(])f([-S)h +Fj(suffix)p Ft(])e Fj(name)i Ft([)p Fj(name)f Ft(...])870 +1845 y(complete)g(-pr)g([-DE])h([)p Fj(name)f Ft(...)o(])630 +1979 y Fu(Sp)s(ecify)37 b(ho)m(w)h(argumen)m(ts)f(to)i(eac)m(h)g +Fr(name)j Fu(should)37 b(b)s(e)g(completed.)63 b(If)38 +b(the)f Ft(-p)g Fu(option)630 2089 y(is)30 b(supplied,)e(or)i(if)g(no)f +(options)h(are)g(supplied,)f(existing)h(completion)h(sp)s +(eci\014cations)g(are)630 2198 y(prin)m(ted)24 b(in)h(a)g(w)m(a)m(y)g +(that)h(allo)m(ws)g(them)e(to)i(b)s(e)e(reused)f(as)i(input.)38 +b(The)24 b Ft(-r)g Fu(option)i(remo)m(v)m(es)630 2308 +y(a)i(completion)h(sp)s(eci\014cation)f(for)g(eac)m(h)h +Fr(name)p Fu(,)f(or,)h(if)e(no)h Fr(name)5 b Fu(s)27 +b(are)h(supplied,)g(all)g(com-)630 2418 y(pletion)k(sp)s +(eci\014cations.)44 b(The)30 b Ft(-D)h Fu(option)h(indicates)g(that)f +(the)h(remaining)f(options)h(and)630 2527 y(actions)27 +b(should)e(apply)g(to)i(the)f(\\default")h(command)e(completion;)k +(that)e(is,)g(completion)630 2637 y(attempted)g(on)f(a)h(command)f(for) +g(whic)m(h)g(no)g(completion)i(has)d(previously)h(b)s(een)g(de\014ned.) +630 2746 y(The)f Ft(-E)g Fu(option)h(indicates)h(that)f(the)g +(remaining)g(options)g(and)f(actions)i(should)e(apply)g(to)630 +2856 y(\\empt)m(y")32 b(command)e(completion;)i(that)f(is,)f +(completion)i(attempted)f(on)g(a)f(blank)g(line.)630 +2990 y(The)f(pro)s(cess)g(of)h(applying)g(these)g(completion)g(sp)s +(eci\014cations)h(when)d(w)m(ord)i(completion)630 3099 +y(is)35 b(attempted)h(is)f(describ)s(ed)f(ab)s(o)m(v)m(e)j(\(see)f +(Section)g(8.6)g([Programmable)g(Completion],)630 3209 +y(page)31 b(124\).)42 b(The)30 b Ft(-D)g Fu(option)h(tak)m(es)h +(precedence)f(o)m(v)m(er)g Ft(-E)p Fu(.)630 3343 y(Other)d(options,)i +(if)f(sp)s(eci\014ed,)g(ha)m(v)m(e)h(the)f(follo)m(wing)i(meanings.)40 +b(The)29 b(argumen)m(ts)g(to)h(the)630 3453 y Ft(-G)p +Fu(,)41 b Ft(-W)p Fu(,)h(and)c Ft(-X)h Fu(options)h(\(and,)h(if)f +(necessary)-8 b(,)42 b(the)e Ft(-P)f Fu(and)f Ft(-S)h +Fu(options\))h(should)f(b)s(e)630 3562 y(quoted)28 b(to)h(protect)g +(them)f(from)f(expansion)h(b)s(efore)g(the)g Ft(complete)e +Fu(builtin)h(is)h(in)m(v)m(ok)m(ed.)630 3720 y Ft(-o)i +Fj(comp-option)1110 3830 y Fu(The)c Fr(comp-option)i +Fu(con)m(trols)g(sev)m(eral)h(asp)s(ects)e(of)g(the)g(compsp)s(ec's)g +(b)s(eha)m(v-)1110 3940 y(ior)g(b)s(ey)m(ond)f(the)g(simple)h +(generation)h(of)e(completions.)41 b Fr(comp-option)27 +b Fu(ma)m(y)1110 4049 y(b)s(e)j(one)g(of:)1110 4208 y +Ft(bashdefault)1590 4317 y Fu(P)m(erform)d(the)h(rest)f(of)h(the)g +(default)f(Bash)h(completions)g(if)g(the)1590 4427 y(compsp)s(ec)i +(generates)i(no)e(matc)m(hes.)1110 4585 y Ft(default)144 +b Fu(Use)22 b(Readline's)g(default)g(\014lename)g(completion)g(if)g +(the)g(comp-)1590 4695 y(sp)s(ec)30 b(generates)i(no)e(matc)m(hes.)1110 +4853 y Ft(dirnames)96 b Fu(P)m(erform)46 b(directory)g(name)h +(completion)g(if)f(the)g(compsp)s(ec)1590 4963 y(generates)32 +b(no)e(matc)m(hes.)1110 5121 y Ft(filenames)1590 5230 +y Fu(T)-8 b(ell)40 b(Readline)f(that)h(the)f(compsp)s(ec)f(generates)j +(\014lenames,)1590 5340 y(so)29 b(it)h(can)f(p)s(erform)f(an)m(y)h +(\014lename-sp)s(eci\014c)h(pro)s(cessing)e(\(lik)m(e)p +eop end +%%Page: 128 134 +TeXDict begin 128 133 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(128)1590 299 y(adding)25 +b(a)h(slash)f(to)h(directory)g(names)f(quoting)h(sp)s(ecial)g(c)m(har-) +1590 408 y(acters,)39 b(or)d(suppressing)f(trailing)i(spaces\).)59 +b(This)35 b(option)i(is)1590 518 y(in)m(tended)30 b(to)g(b)s(e)g(used)f +(with)g(shell)i(functions)e(sp)s(eci\014ed)g(with)1590 +628 y Ft(-F)p Fu(.)1110 787 y Ft(noquote)144 b Fu(T)-8 +b(ell)28 b(Readline)g(not)g(to)g(quote)g(the)g(completed)g(w)m(ords)f +(if)h(they)1590 896 y(are)j(\014lenames)f(\(quoting)h(\014lenames)g(is) +f(the)h(default\).)1110 1055 y Ft(nospace)144 b Fu(T)-8 +b(ell)40 b(Readline)g(not)g(to)g(app)s(end)d(a)j(space)g(\(the)f +(default\))h(to)1590 1165 y(w)m(ords)30 b(completed)h(at)g(the)g(end)f +(of)g(the)h(line.)1110 1324 y Ft(plusdirs)96 b Fu(After)30 +b(an)m(y)h(matc)m(hes)g(de\014ned)d(b)m(y)i(the)g(compsp)s(ec)g(are)g +(gener-)1590 1433 y(ated,)g(directory)f(name)g(completion)i(is)d +(attempted)i(and)f(an)m(y)1590 1543 y(matc)m(hes)j(are)e(added)g(to)h +(the)g(results)f(of)g(the)h(other)g(actions.)630 1702 +y Ft(-A)f Fj(action)66 b Fu(The)25 b Fr(action)h Fu(ma)m(y)g(b)s(e)e +(one)h(of)h(the)f(follo)m(wing)i(to)e(generate)i(a)e(list)h(of)f(p)s +(ossible)1110 1811 y(completions:)1110 1970 y Ft(alias)240 +b Fu(Alias)31 b(names.)41 b(Ma)m(y)31 b(also)h(b)s(e)e(sp)s(eci\014ed)f +(as)i Ft(-a)p Fu(.)1110 2129 y Ft(arrayvar)96 b Fu(Arra)m(y)31 +b(v)-5 b(ariable)31 b(names.)1110 2288 y Ft(binding)144 +b Fu(Readline)30 b(k)m(ey)f(binding)f(names)h(\(see)h(Section)f(8.4)h +([Bindable)1590 2398 y(Readline)h(Commands],)f(page)h(115\).)1110 +2556 y Ft(builtin)144 b Fu(Names)21 b(of)g(shell)f(builtin)h(commands.) +37 b(Ma)m(y)21 b(also)h(b)s(e)e(sp)s(eci\014ed)1590 2666 +y(as)31 b Ft(-b)p Fu(.)1110 2825 y Ft(command)144 b Fu(Command)29 +b(names.)41 b(Ma)m(y)32 b(also)f(b)s(e)f(sp)s(eci\014ed)f(as)i +Ft(-c)p Fu(.)1110 2984 y Ft(directory)1590 3093 y Fu(Directory)h +(names.)40 b(Ma)m(y)32 b(also)f(b)s(e)f(sp)s(eci\014ed)g(as)g +Ft(-d)p Fu(.)1110 3252 y Ft(disabled)96 b Fu(Names)31 +b(of)g(disabled)f(shell)g(builtins.)1110 3411 y Ft(enabled)144 +b Fu(Names)31 b(of)g(enabled)f(shell)g(builtins.)1110 +3570 y Ft(export)192 b Fu(Names)34 b(of)f(exp)s(orted)f(shell)h(v)-5 +b(ariables.)49 b(Ma)m(y)35 b(also)e(b)s(e)g(sp)s(eci-)1590 +3680 y(\014ed)d(as)g Ft(-e)p Fu(.)1110 3839 y Ft(file)288 +b Fu(File)32 b(names.)40 b(Ma)m(y)32 b(also)f(b)s(e)f(sp)s(eci\014ed)f +(as)i Ft(-f)p Fu(.)1110 3998 y Ft(function)96 b Fu(Names)31 +b(of)g(shell)f(functions.)1110 4156 y Ft(group)240 b +Fu(Group)30 b(names.)40 b(Ma)m(y)32 b(also)f(b)s(e)f(sp)s(eci\014ed)g +(as)g Ft(-g)p Fu(.)1110 4315 y Ft(helptopic)1590 4425 +y Fu(Help)37 b(topics)g(as)g(accepted)h(b)m(y)e(the)h +Ft(help)f Fu(builtin)g(\(see)h(Sec-)1590 4534 y(tion)31 +b(4.2)g([Bash)g(Builtins],)g(page)g(48\).)1110 4693 y +Ft(hostname)96 b Fu(Hostnames,)89 b(as)76 b(tak)m(en)h(from)f(the)g +(\014le)h(sp)s(eci\014ed)e(b)m(y)1590 4803 y(the)55 b +Ft(HOSTFILE)e Fu(shell)j(v)-5 b(ariable)56 b(\(see)g(Section)g(5.2)h +([Bash)1590 4913 y(V)-8 b(ariables],)32 b(page)f(69\).)1110 +5071 y Ft(job)336 b Fu(Job)31 b(names,)h(if)g(job)f(con)m(trol)i(is)f +(activ)m(e.)46 b(Ma)m(y)33 b(also)g(b)s(e)e(sp)s(eci-)1590 +5181 y(\014ed)f(as)g Ft(-j)p Fu(.)1110 5340 y Ft(keyword)144 +b Fu(Shell)30 b(reserv)m(ed)h(w)m(ords.)40 b(Ma)m(y)32 +b(also)f(b)s(e)f(sp)s(eci\014ed)f(as)i Ft(-k)p Fu(.)p +eop end +%%Page: 129 135 +TeXDict begin 129 134 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(129)1110 299 y Ft(running)144 +b Fu(Names)31 b(of)g(running)d(jobs,)i(if)h(job)f(con)m(trol)h(is)g +(activ)m(e.)1110 463 y Ft(service)144 b Fu(Service)31 +b(names.)41 b(Ma)m(y)31 b(also)g(b)s(e)f(sp)s(eci\014ed)g(as)g +Ft(-s)p Fu(.)1110 628 y Ft(setopt)192 b Fu(V)-8 b(alid)39 +b(argumen)m(ts)g(for)f(the)h Ft(-o)e Fu(option)i(to)g(the)g +Ft(set)e Fu(builtin)1590 737 y(\(see)31 b(Section)h(4.3.1)g([The)e(Set) +g(Builtin],)i(page)f(58\).)1110 902 y Ft(shopt)240 b +Fu(Shell)40 b(option)g(names)g(as)g(accepted)i(b)m(y)e(the)g +Ft(shopt)e Fu(builtin)1590 1011 y(\(see)31 b(Section)h(4.2)f([Bash)g +(Builtins],)g(page)g(48\).)1110 1176 y Ft(signal)192 +b Fu(Signal)31 b(names.)1110 1340 y Ft(stopped)144 b +Fu(Names)31 b(of)g(stopp)s(ed)e(jobs,)h(if)g(job)g(con)m(trol)i(is)f +(activ)m(e.)1110 1504 y Ft(user)288 b Fu(User)30 b(names.)41 +b(Ma)m(y)32 b(also)f(b)s(e)f(sp)s(eci\014ed)f(as)i Ft(-u)p +Fu(.)1110 1669 y Ft(variable)96 b Fu(Names)36 b(of)g(all)g(shell)g(v)-5 +b(ariables.)56 b(Ma)m(y)37 b(also)f(b)s(e)f(sp)s(eci\014ed)g(as)1590 +1778 y Ft(-v)p Fu(.)630 1943 y Ft(-C)30 b Fj(command)1110 +2052 y Fr(command)35 b Fu(is)e(executed)g(in)e(a)i(subshell)e(en)m +(vironmen)m(t,)i(and)f(its)g(output)g(is)1110 2162 y(used)e(as)g(the)h +(p)s(ossible)f(completions.)630 2326 y Ft(-F)g Fj(function)1110 +2436 y Fu(The)39 b(shell)g(function)g Fr(function)g Fu(is)g(executed)h +(in)f(the)g(curren)m(t)g(shell)g(en)m(vi-)1110 2545 y(ronmen)m(t.)72 +b(When)41 b(it)g(is)g(executed,)k($1)c(is)g(the)g(name)g(of)g(the)g +(command)1110 2655 y(whose)34 b(argumen)m(ts)h(are)g(b)s(eing)f +(completed,)j($2)e(is)f(the)h(w)m(ord)f(b)s(eing)g(com-)1110 +2765 y(pleted,)44 b(and)c($3)i(is)e(the)h(w)m(ord)g(preceding)f(the)h +(w)m(ord)f(b)s(eing)h(completed,)1110 2874 y(as)g(describ)s(ed)f(ab)s +(o)m(v)m(e)i(\(see)g(Section)f(8.6)h([Programmable)g(Completion],)1110 +2984 y(page)30 b(124\).)42 b(When)29 b(it)h(\014nishes,)e(the)h(p)s +(ossible)g(completions)h(are)g(retriev)m(ed)1110 3093 +y(from)g(the)g(v)-5 b(alue)31 b(of)g(the)f Ft(COMPREPLY)e +Fu(arra)m(y)j(v)-5 b(ariable.)630 3258 y Ft(-G)30 b Fj(globpat)1110 +3367 y Fu(The)39 b(\014lename)h(expansion)g(pattern)g +Fr(globpat)j Fu(is)d(expanded)f(to)h(generate)1110 3477 +y(the)31 b(p)s(ossible)e(completions.)630 3641 y Ft(-P)h +Fj(prefix)66 b Fr(pre\014x)39 b Fu(is)34 b(added)f(at)i(the)f(b)s +(eginning)f(of)i(eac)m(h)g(p)s(ossible)e(completion)i(after)1110 +3751 y(all)c(other)g(options)g(ha)m(v)m(e)g(b)s(een)f(applied.)630 +3915 y Ft(-S)g Fj(suffix)66 b Fr(su\016x)26 b Fu(is)20 +b(app)s(ended)f(to)i(eac)m(h)h(p)s(ossible)e(completion)i(after)f(all)g +(other)g(options)1110 4025 y(ha)m(v)m(e)32 b(b)s(een)d(applied.)630 +4189 y Ft(-W)h Fj(wordlist)1110 4299 y Fu(The)24 b Fr(w)m(ordlist)k +Fu(is)d(split)g(using)f(the)h(c)m(haracters)i(in)d(the)i +Ft(IFS)e Fu(sp)s(ecial)h(v)-5 b(ariable)1110 4408 y(as)36 +b(delimiters,)i(and)e(eac)m(h)h(resultan)m(t)g(w)m(ord)e(is)h +(expanded.)57 b(The)35 b(p)s(ossible)1110 4518 y(completions)c(are)e +(the)h(mem)m(b)s(ers)f(of)g(the)h(resultan)m(t)g(list)g(whic)m(h)f +(matc)m(h)i(the)1110 4628 y(w)m(ord)f(b)s(eing)g(completed.)630 +4792 y Ft(-X)g Fj(filterpat)1110 4902 y Fr(\014lterpat)d +Fu(is)e(a)g(pattern)g(as)f(used)g(for)h(\014lename)g(expansion.)38 +b(It)25 b(is)g(applied)f(to)1110 5011 y(the)30 b(list)f(of)h(p)s +(ossible)f(completions)h(generated)h(b)m(y)e(the)g(preceding)h(options) +1110 5121 y(and)d(argumen)m(ts,)i(and)e(eac)m(h)i(completion)g(matc)m +(hing)g Fr(\014lterpat)h Fu(is)e(remo)m(v)m(ed)1110 5230 +y(from)i(the)h(list.)42 b(A)30 b(leading)i(`)p Ft(!)p +Fu(')e(in)g Fr(\014lterpat)j Fu(negates)f(the)f(pattern;)g(in)f(this) +1110 5340 y(case,)i(an)m(y)e(completion)i(not)f(matc)m(hing)g +Fr(\014lterpat)i Fu(is)d(remo)m(v)m(ed.)p eop end +%%Page: 130 136 +TeXDict begin 130 135 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(130)630 299 y(The)35 +b(return)g(v)-5 b(alue)37 b(is)f(true)f(unless)h(an)f(in)m(v)-5 +b(alid)37 b(option)f(is)g(supplied,)g(an)g(option)h(other)630 +408 y(than)h Ft(-p)g Fu(or)g Ft(-r)f Fu(is)h(supplied)f(without)i(a)f +Fr(name)44 b Fu(argumen)m(t,)c(an)e(attempt)i(is)e(made)g(to)630 +518 y(remo)m(v)m(e)32 b(a)e(completion)i(sp)s(eci\014cation)f(for)f(a)h +Fr(name)k Fu(for)30 b(whic)m(h)g(no)g(sp)s(eci\014cation)h(exists,)630 +628 y(or)f(an)h(error)f(o)s(ccurs)g(adding)g(a)g(completion)i(sp)s +(eci\014cation.)150 789 y Ft(compopt)870 924 y(compopt)46 +b([-o)h Fj(option)p Ft(])f([-DE])g([+o)h Fj(option)p +Ft(])f([)p Fj(name)p Ft(])630 1060 y Fu(Mo)s(dify)33 +b(completion)h(options)g(for)f(eac)m(h)h Fr(name)39 b +Fu(according)34 b(to)g(the)f Fr(option)p Fu(s,)i(or)e(for)g(the)630 +1170 y(curren)m(tly-executing)46 b(completion)f(if)f(no)f +Fr(name)5 b Fu(s)44 b(are)h(supplied.)80 b(If)43 b(no)h +Fr(option)p Fu(s)h(are)630 1279 y(giv)m(en,)30 b(displa)m(y)e(the)g +(completion)h(options)g(for)e(eac)m(h)i Fr(name)34 b +Fu(or)27 b(the)i(curren)m(t)e(completion.)630 1389 y(The)f(p)s(ossible) +g(v)-5 b(alues)27 b(of)f Fr(option)h Fu(are)g(those)g(v)-5 +b(alid)26 b(for)g(the)h Ft(complete)d Fu(builtin)i(describ)s(ed)630 +1498 y(ab)s(o)m(v)m(e.)41 b(The)28 b Ft(-D)g Fu(option)h(indicates)h +(that)f(the)g(remaining)g(options)g(should)e(apply)h(to)i(the)630 +1608 y(\\default")j(command)f(completion;)i(that)f(is,)g(completion)g +(attempted)g(on)f(a)g(command)630 1717 y(for)g(whic)m(h)g(no)g +(completion)i(has)e(previously)g(b)s(een)g(de\014ned.)45 +b(The)32 b Ft(-E)f Fu(option)i(indicates)630 1827 y(that)24 +b(the)g(remaining)g(options)g(should)e(apply)h(to)i(\\empt)m(y")g +(command)e(completion;)k(that)630 1937 y(is,)k(completion)g(attempted)h +(on)e(a)h(blank)f(line.)630 2072 y(The)g Ft(-D)g Fu(option)g(tak)m(es)i +(precedence)f(o)m(v)m(er)h Ft(-E)p Fu(.)630 2208 y(The)23 +b(return)g(v)-5 b(alue)25 b(is)f(true)g(unless)f(an)h(in)m(v)-5 +b(alid)24 b(option)h(is)f(supplied,)g(an)g(attempt)h(is)f(made)630 +2317 y(to)32 b(mo)s(dify)f(the)g(options)h(for)f(a)h +Fr(name)k Fu(for)31 b(whic)m(h)g(no)g(completion)i(sp)s(eci\014cation)f +(exists,)630 2427 y(or)e(an)h(output)f(error)g(o)s(ccurs.)150 +2662 y Fs(8.8)68 b(A)44 b(Programmable)j(Completion)f(Example)150 +2822 y Fu(The)37 b(most)g(common)g(w)m(a)m(y)i(to)e(obtain)h +(additional)g(completion)g(functionalit)m(y)h(b)s(ey)m(ond)d(the)i +(default)150 2931 y(actions)29 b Ft(complete)d Fu(and)i +Ft(compgen)e Fu(pro)m(vide)i(is)h(to)f(use)g(a)h(shell)f(function)g +(and)g(bind)e(it)j(to)g(a)g(particular)150 3041 y(command)h(using)g +Ft(complete)e(-F)p Fu(.)275 3177 y(The)j(follo)m(wing)j(function)e(pro) +m(vides)g(completions)i(for)e(the)g Ft(cd)g Fu(builtin.)46 +b(It)32 b(is)h(a)f(reasonably)h(go)s(o)s(d)150 3287 y(example)e(of)f +(what)g(shell)g(functions)g(m)m(ust)f(do)h(when)f(used)h(for)f +(completion.)42 b(This)29 b(function)h(uses)g(the)150 +3396 y(w)m(ord)38 b(passsed)g(as)h Ft($2)g Fu(to)g(determine)g(the)g +(directory)g(name)g(to)g(complete.)67 b(Y)-8 b(ou)40 +b(can)f(also)g(use)g(the)150 3506 y Ft(COMP_WORDS)28 +b Fu(arra)m(y)i(v)-5 b(ariable;)32 b(the)e(curren)m(t)h(w)m(ord)f(is)g +(indexed)g(b)m(y)g(the)h Ft(COMP_CWORD)c Fu(v)-5 b(ariable.)275 +3642 y(The)42 b(function)h(relies)h(on)e(the)i Ft(complete)c +Fu(and)j Ft(compgen)e Fu(builtins)h(to)i(do)f(m)m(uc)m(h)g(of)g(the)h +(w)m(ork,)150 3752 y(adding)25 b(only)h(the)g(things)g(that)g(the)g +(Bash)g Ft(cd)f Fu(do)s(es)g(b)s(ey)m(ond)g(accepting)j(basic)e +(directory)g(names:)38 b(tilde)150 3862 y(expansion)22 +b(\(see)h(Section)g(3.5.2)g([Tilde)g(Expansion],)g(page)g(22\),)i +(searc)m(hing)e(directories)g(in)e Fr($CDP)-8 b(A)g(TH)p +Fu(,)150 3971 y(whic)m(h)21 b(is)h(describ)s(ed)e(ab)s(o)m(v)m(e)j +(\(see)f(Section)h(4.1)f([Bourne)g(Shell)f(Builtins],)j(page)e(41\),)j +(and)c(basic)h(supp)s(ort)150 4081 y(for)31 b(the)h Ft(cdable_vars)d +Fu(shell)i(option)h(\(see)h(Section)f(4.3.2)i([The)d(Shopt)g(Builtin],) +i(page)f(62\).)46 b Ft(_comp_)150 4190 y(cd)30 b Fu(mo)s(di\014es)g +(the)h(v)-5 b(alue)31 b(of)g Fr(IFS)36 b Fu(so)31 b(that)g(it)g(con)m +(tains)h(only)f(a)g(newline)g(to)h(accommo)s(date)g(\014le)f(names)150 +4300 y(con)m(taining)i(spaces)g(and)e(tabs)h({)g Ft(compgen)e +Fu(prin)m(ts)h(the)h(p)s(ossible)f(completions)i(it)g(generates)g(one)f +(p)s(er)150 4410 y(line.)275 4546 y(P)m(ossible)24 b(completions)h(go)g +(in)m(to)g(the)f Fr(COMPREPL)-8 b(Y)36 b Fu(arra)m(y)24 +b(v)-5 b(ariable,)26 b(one)e(completion)i(p)s(er)c(arra)m(y)150 +4656 y(elemen)m(t.)42 b(The)30 b(programmable)g(completion)i(system)e +(retriev)m(es)h(the)g(completions)g(from)f(there)g(when)150 +4765 y(the)h(function)f(returns.)390 4902 y Ft(#)47 b(A)h(completion)d +(function)g(for)i(the)g(cd)g(builtin)390 5011 y(#)g(based)g(on)g(the)g +(cd)g(completion)e(function)h(from)g(the)h(bash_completion)d(package) +390 5121 y(_comp_cd\(\))390 5230 y({)581 5340 y(local)i(IFS=$')g +(\\t\\n')190 b(#)47 b(normalize)f(IFS)p eop end +%%Page: 131 137 +TeXDict begin 131 136 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(131)581 299 y Ft(local)46 +b(cur)h(_skipdot)f(_cdpath)581 408 y(local)g(i)i(j)f(k)581 +628 y(#)g(Tilde)g(expansion,)e(with)h(side)h(effect)f(of)h(expanding)f +(tilde)g(to)h(full)g(pathname)581 737 y(case)g("$2")f(in)581 +847 y(\\~*\))190 b(eval)46 b(cur="$2")g(;;)581 956 y(*\))286 +b(cur=$2)46 b(;;)581 1066 y(esac)581 1285 y(#)h(no)h(cdpath)e(or)h +(absolute)e(pathname)h(--)h(straight)f(directory)f(completion)581 +1395 y(if)i([[)g(-z)g("${CDPATH:-}")e(]])i(||)g([[)g("$cur")f(==)h +(@\(./*|../*|/*\))d(]];)j(then)772 1504 y(#)g(compgen)f(prints)g(paths) +h(one)f(per)h(line;)g(could)f(also)h(use)g(while)f(loop)772 +1614 y(IFS=$'\\n')772 1724 y(COMPREPLY=\()f($\(compgen)g(-d)i(--)g +("$cur"\))f(\))772 1833 y(IFS=$')g(\\t\\n')581 1943 y(#)h +(CDPATH+directories)c(in)k(the)g(current)f(directory)f(if)j(not)e(in)i +(CDPATH)581 2052 y(else)772 2162 y(IFS=$'\\n')772 2271 +y(_skipdot=false)772 2381 y(#)f(preprocess)e(CDPATH)h(to)i(convert)d +(null)i(directory)e(names)i(to)g(.)772 2491 y(_cdpath=${CDPATH/#:/.:}) +772 2600 y(_cdpath=${_cdpath//::/:.)o(:})772 2710 y +(_cdpath=${_cdpath/\045:/:.})772 2819 y(for)g(i)g(in)g +(${_cdpath//:/$'\\n'};)c(do)963 2929 y(if)k([[)g($i)g(-ef)g(.)h(]];)f +(then)f(_skipdot=true;)e(fi)963 3039 y(k="${#COMPREPLY[@]}")963 +3148 y(for)j(j)g(in)g($\()g(compgen)f(-d)h(--)h("$i/$cur")d(\);)i(do) +1154 3258 y(COMPREPLY[k++]=${j#$i/})375 b(#)48 b(cut)f(off)f(directory) +963 3367 y(done)772 3477 y(done)772 3587 y($_skipdot)f(||)i +(COMPREPLY+=\()e($\(compgen)g(-d)i(--)g("$cur"\))f(\))772 +3696 y(IFS=$')g(\\t\\n')581 3806 y(fi)581 4025 y(#)h(variable)f(names)g +(if)h(appropriate)e(shell)i(option)f(set)h(and)f(no)i(completions)581 +4134 y(if)f(shopt)f(-q)i(cdable_vars)c(&&)k([[)f(${#COMPREPLY[@]})c +(-eq)k(0)g(]];)g(then)772 4244 y(COMPREPLY=\()e($\(compgen)g(-v)i(--)g +("$cur"\))f(\))581 4354 y(fi)581 4573 y(return)g(0)390 +4682 y(})275 4902 y Fu(W)-8 b(e)31 b(install)g(the)g(completion)h +(function)e(using)f(the)i Ft(-F)f Fu(option)h(to)g Ft(complete)p +Fu(:)390 5121 y Ft(#)47 b(Tell)g(readline)f(to)h(quote)f(appropriate)f +(and)i(append)f(slashes)g(to)h(directories;)390 5230 +y(#)g(use)g(the)g(bash)g(default)f(completion)f(for)i(other)f +(arguments)390 5340 y(complete)g(-o)h(filenames)e(-o)i(nospace)f(-o)h +(bashdefault)e(-F)i(_comp_cd)f(cd)p eop end +%%Page: 132 138 +TeXDict begin 132 137 bop 150 -116 a Fu(Chapter)30 b(8:)41 +b(Command)29 b(Line)i(Editing)2062 b(132)150 299 y(Since)33 +b(w)m(e'd)g(lik)m(e)i(Bash)e(and)f(Readline)i(to)g(tak)m(e)g(care)g(of) +f(some)h(of)f(the)g(other)h(details)g(for)e(us,)i(w)m(e)f(use)150 +408 y(sev)m(eral)43 b(other)g(options)f(to)h(tell)g(Bash)f(and)f +(Readline)i(what)f(to)g(do.)76 b(The)41 b Ft(-o)30 b(filenames)39 +b Fu(option)150 518 y(tells)j(Readline)g(that)g(the)f(p)s(ossible)g +(completions)h(should)f(b)s(e)f(treated)i(as)g(\014lenames,)i(and)d +(quoted)150 628 y(appropriately)-8 b(.)53 b(That)34 b(option)h(will)g +(also)g(cause)g(Readline)g(to)g(app)s(end)e(a)h(slash)g(to)h +(\014lenames)g(it)g(can)150 737 y(determine)i(are)g(directories)h +(\(whic)m(h)g(is)f(wh)m(y)f(w)m(e)i(migh)m(t)f(w)m(an)m(t)h(to)g +(extend)f Ft(_comp_cd)e Fu(to)i(app)s(end)f(a)150 847 +y(slash)22 b(if)g(w)m(e're)h(using)f(directories)h(found)e(via)i +Fr(CDP)-8 b(A)g(TH)10 b Fu(:)37 b(Readline)23 b(can't)g(tell)g(those)g +(completions)h(are)150 956 y(directories\).)45 b(The)31 +b Ft(-o)f(nospace)f Fu(option)j(tells)g(Readline)g(to)h(not)e(app)s +(end)f(a)i(space)g(c)m(haracter)h(to)f(the)150 1066 y(directory)c +(name,)h(in)f(case)h(w)m(e)f(w)m(an)m(t)h(to)f(app)s(end)f(to)h(it.)41 +b(The)27 b Ft(-o)j(bashdefault)25 b Fu(option)j(brings)f(in)h(the)150 +1176 y(rest)h(of)f(the)h Ft(")p Fu(Bash)f(default)p Ft(")h +Fu(completions)g({)g(p)s(ossible)f(completion)i(that)f(Bash)f(adds)g +(to)h(the)g(default)150 1285 y(Readline)40 b(set.)68 +b(These)39 b(include)g(things)g(lik)m(e)i(command)e(name)g(completion,) +44 b(v)-5 b(ariable)40 b(completion)150 1395 y(for)i(w)m(ords)g(b)s +(eginning)f(with)h(`)p Ft({)p Fu(',)k(completions)e(con)m(taining)f +(pathname)g(expansion)f(patterns)g(\(see)150 1504 y(Section)31 +b(3.5.8)h([Filename)g(Expansion],)e(page)i(30\),)f(and)f(so)h(on.)275 +1639 y(Once)39 b(installed)i(using)e Ft(complete)p Fu(,)h +Ft(_comp_cd)d Fu(will)j(b)s(e)g(called)g(ev)m(ery)h(time)f(w)m(e)g +(attempt)h(w)m(ord)150 1748 y(completion)32 b(for)e(a)h +Ft(cd)e Fu(command.)275 1883 y(Man)m(y)34 b(more)g(examples)g({)g(an)g +(extensiv)m(e)h(collection)i(of)c(completions)i(for)f(most)g(of)g(the)g +(common)150 1993 y(GNU,)g(Unix,)h(and)d(Lin)m(ux)h(commands)g({)h(are)g +(a)m(v)-5 b(ailable)36 b(as)e(part)f(of)h(the)f(bash)p +2943 1993 28 4 v 39 w(completion)i(pro)5 b(ject.)150 +2102 y(This)33 b(is)h(installed)h(b)m(y)f(default)g(on)g(man)m(y)h +(GNU/Lin)m(ux)f(distributions.)51 b(Originally)35 b(written)f(b)m(y)g +(Ian)150 2212 y(Macdonald,)45 b(the)c(pro)5 b(ject)42 +b(no)m(w)f(liv)m(es)i(at)f Ft(http:)9 b(/)g(/)e(bash-completio)o(n)i(.) +e(a)o(lio)o(th)i(.)d(debi)o(an)j(.)d(org)i(/)f Fu(.)150 +2321 y(There)30 b(are)h(p)s(orts)e(for)h(other)h(systems)f(suc)m(h)g +(as)h(Solaris)g(and)f(Mac)h(OS)f(X.)275 2456 y(An)54 +b(older)h(v)m(ersion)h(of)f(the)g(bash)p 1532 2456 V +40 w(completion)h(pac)m(k)-5 b(age)57 b(is)e(distributed)f(with)h(bash) +f(in)h(the)150 2565 y Ft(examples/complete)26 b Fu(sub)s(directory)-8 +b(.)p eop end +%%Page: 133 139 +TeXDict begin 133 138 bop 150 -116 a Fu(Chapter)30 b(9:)41 +b(Using)30 b(History)h(In)m(teractiv)m(ely)1925 b(133)150 +299 y Fp(9)80 b(Using)53 b(History)g(In)l(teractiv)l(ely)150 +543 y Fu(This)42 b(c)m(hapter)h(describ)s(es)f(ho)m(w)g(to)h(use)g(the) +f Fm(gnu)h Fu(History)g(Library)e(in)m(teractiv)m(ely)-8 +b(,)50 b(from)42 b(a)h(user's)150 653 y(standp)s(oin)m(t.)76 +b(It)42 b(should)f(b)s(e)h(considered)g(a)g(user's)g(guide.)76 +b(F)-8 b(or)43 b(information)f(on)g(using)g(the)g Fm(gnu)150 +762 y Fu(History)31 b(Library)f(in)g(other)g(programs,)g(see)h(the)g +Fm(gnu)f Fu(Readline)h(Library)f(Man)m(ual.)150 1000 +y Fs(9.1)68 b(Bash)45 b(History)h(F)-11 b(acilities)150 +1159 y Fu(When)44 b(the)g Ft(-o)30 b(history)42 b Fu(option)i(to)h(the) +f Ft(set)f Fu(builtin)h(is)g(enabled)g(\(see)g(Section)h(4.3.1)h([The)e +(Set)150 1269 y(Builtin],)32 b(page)g(58\),)h(the)e(shell)h(pro)m +(vides)f(access)h(to)g(the)f Fr(command)g(history)p Fu(,)h(the)f(list)h +(of)f(commands)150 1378 y(previously)h(t)m(yp)s(ed.)47 +b(The)33 b(v)-5 b(alue)33 b(of)f(the)h Ft(HISTSIZE)e +Fu(shell)h(v)-5 b(ariable)34 b(is)f(used)e(as)i(the)g(n)m(um)m(b)s(er)e +(of)i(com-)150 1488 y(mands)i(to)i(sa)m(v)m(e)h(in)e(a)g(history)h +(list.)58 b(The)36 b(text)h(of)g(the)f(last)h Ft($HISTSIZE)d +Fu(commands)i(\(default)g(500\))150 1597 y(is)h(sa)m(v)m(ed.)61 +b(The)36 b(shell)h(stores)h(eac)m(h)g(command)e(in)h(the)g(history)g +(list)g(prior)f(to)i(parameter)f(and)f(v)-5 b(ari-)150 +1707 y(able)33 b(expansion)g(but)f(after)h(history)f(expansion)h(is)g +(p)s(erformed,)e(sub)5 b(ject)33 b(to)g(the)g(v)-5 b(alues)33 +b(of)g(the)g(shell)150 1817 y(v)-5 b(ariables)31 b Ft(HISTIGNORE)d +Fu(and)h Ft(HISTCONTROL)p Fu(.)275 1954 y(When)g(the)g(shell)h(starts)g +(up,)f(the)h(history)f(is)h(initialized)h(from)e(the)h(\014le)f(named)g +(b)m(y)h(the)f Ft(HISTFILE)150 2064 y Fu(v)-5 b(ariable)26 +b(\(default)g Ft(~/.bash_history)p Fu(\).)35 b(The)24 +b(\014le)i(named)e(b)m(y)h(the)h(v)-5 b(alue)25 b(of)h +Ft(HISTFILE)c Fu(is)k(truncated,)150 2174 y(if)42 b(necessary)-8 +b(,)45 b(to)e(con)m(tain)g(no)f(more)g(than)f(the)h(n)m(um)m(b)s(er)f +(of)h(lines)g(sp)s(eci\014ed)f(b)m(y)h(the)g(v)-5 b(alue)42 +b(of)g(the)150 2283 y Ft(HISTFILESIZE)28 b Fu(v)-5 b(ariable.)46 +b(When)31 b(a)h(shell)g(with)g(history)f(enabled)h(exits,)h(the)f(last) +h Ft($HISTSIZE)c Fu(lines)150 2393 y(are)35 b(copied)g(from)g(the)g +(history)f(list)i(to)f(the)g(\014le)g(named)f(b)m(y)h +Ft($HISTFILE)p Fu(.)51 b(If)35 b(the)g Ft(histappend)d +Fu(shell)150 2502 y(option)26 b(is)g(set)g(\(see)h(Section)f(4.2)h +([Bash)f(Builtins],)h(page)g(48\),)h(the)e(lines)g(are)g(app)s(ended)e +(to)i(the)g(history)150 2612 y(\014le,)36 b(otherwise)f(the)g(history)f +(\014le)h(is)f(o)m(v)m(erwritten.)55 b(If)34 b Ft(HISTFILE)e +Fu(is)j(unset,)g(or)g(if)f(the)h(history)f(\014le)h(is)150 +2721 y(un)m(writable,)f(the)f(history)g(is)g(not)h(sa)m(v)m(ed.)49 +b(After)34 b(sa)m(ving)g(the)f(history)-8 b(,)34 b(the)g(history)f +(\014le)g(is)g(truncated)150 2831 y(to)g(con)m(tain)h(no)f(more)g(than) +f Ft($HISTFILESIZE)d Fu(lines.)48 b(If)33 b Ft(HISTFILESIZE)c +Fu(is)k(unset,)g(or)f(set)i(to)f(n)m(ull,)h(a)150 2941 +y(non-n)m(umeric)c(v)-5 b(alue,)31 b(or)f(a)h(n)m(umeric)f(v)-5 +b(alue)31 b(less)g(than)f(zero,)h(the)g(history)f(\014le)h(is)f(not)h +(truncated.)275 3078 y(If)g(the)h Ft(HISTTIMEFORMAT)d +Fu(is)j(set,)h(the)f(time)h(stamp)f(information)g(asso)s(ciated)i(with) +e(eac)m(h)h(history)150 3188 y(en)m(try)d(is)h(written)f(to)h(the)f +(history)h(\014le,)f(mark)m(ed)h(with)f(the)g(history)g(commen)m(t)h(c) +m(haracter.)43 b(When)30 b(the)150 3298 y(history)22 +b(\014le)h(is)g(read,)h(lines)f(b)s(eginning)e(with)i(the)f(history)h +(commen)m(t)g(c)m(haracter)h(follo)m(w)m(ed)h(immediately)150 +3407 y(b)m(y)30 b(a)h(digit)g(are)g(in)m(terpreted)g(as)f(timestamps)h +(for)f(the)h(previous)f(history)g(line.)275 3545 y(The)19 +b(builtin)h(command)g Ft(fc)g Fu(ma)m(y)h(b)s(e)f(used)f(to)i(list)g +(or)g(edit)g(and)e(re-execute)j(a)f(p)s(ortion)f(of)g(the)h(history)150 +3655 y(list.)41 b(The)27 b Ft(history)f Fu(builtin)i(ma)m(y)h(b)s(e)e +(used)g(to)i(displa)m(y)g(or)f(mo)s(dify)f(the)h(history)g(list)h(and)f +(manipulate)150 3764 y(the)j(history)g(\014le.)42 b(When)31 +b(using)f(command-line)h(editing,)h(searc)m(h)f(commands)g(are)g(a)m(v) +-5 b(ailable)33 b(in)e(eac)m(h)150 3874 y(editing)45 +b(mo)s(de)g(that)g(pro)m(vide)g(access)h(to)f(the)g(history)f(list)i +(\(see)f(Section)h(8.4.2)g([Commands)e(F)-8 b(or)150 +3983 y(History],)31 b(page)h(116\).)275 4121 y(The)47 +b(shell)i(allo)m(ws)h(con)m(trol)f(o)m(v)m(er)h(whic)m(h)e(commands)g +(are)h(sa)m(v)m(ed)g(on)f(the)h(history)f(list.)95 b(The)150 +4231 y Ft(HISTCONTROL)25 b Fu(and)j Ft(HISTIGNORE)e Fu(v)-5 +b(ariables)29 b(ma)m(y)h(b)s(e)d(set)j(to)f(cause)g(the)g(shell)f(to)i +(sa)m(v)m(e)g(only)f(a)g(subset)150 4340 y(of)e(the)g(commands)f(en)m +(tered.)40 b(The)26 b Ft(cmdhist)f Fu(shell)i(option,)h(if)f(enabled,)g +(causes)h(the)e(shell)h(to)h(attempt)150 4450 y(to)23 +b(sa)m(v)m(e)h(eac)m(h)f(line)g(of)f(a)h(m)m(ulti-line)g(command)f(in)g +(the)h(same)f(history)g(en)m(try)-8 b(,)25 b(adding)d(semicolons)h +(where)150 4560 y(necessary)37 b(to)f(preserv)m(e)h(syn)m(tactic)h +(correctness.)58 b(The)36 b Ft(lithist)e Fu(shell)i(option)h(causes)g +(the)f(shell)g(to)150 4669 y(sa)m(v)m(e)25 b(the)e(command)h(with)f(em) +m(b)s(edded)f(newlines)h(instead)h(of)f(semicolons.)40 +b(The)23 b Ft(shopt)e Fu(builtin)i(is)h(used)150 4779 +y(to)31 b(set)g(these)g(options.)41 b(See)31 b(Section)g(4.2)g([Bash)g +(Builtins],)g(page)g(48,)h(for)e(a)h(description)f(of)h +Ft(shopt)p Fu(.)150 5016 y Fs(9.2)68 b(Bash)45 b(History)h(Builtins)150 +5176 y Fu(Bash)31 b(pro)m(vides)f(t)m(w)m(o)i(builtin)e(commands)g +(whic)m(h)g(manipulate)g(the)h(history)f(list)h(and)f(history)g +(\014le.)150 5340 y Ft(fc)p eop end +%%Page: 134 140 +TeXDict begin 134 139 bop 150 -116 a Fu(Chapter)30 b(9:)41 +b(Using)30 b(History)h(In)m(teractiv)m(ely)1925 b(134)870 +299 y Ft(fc)47 b([-e)g Fj(ename)p Ft(])f([-lnr])g([)p +Fj(first)p Ft(])g([)p Fj(last)p Ft(])870 408 y(fc)h(-s)g([)p +Fj(pat)p Ft(=)p Fj(rep)p Ft(])f([)p Fj(command)p Ft(])630 +539 y Fu(The)22 b(\014rst)g(form)f(selects)j(a)f(range)g(of)f(commands) +g(from)g Fr(\014rst)i Fu(to)f Fr(last)i Fu(from)d(the)h(history)f(list) +630 648 y(and)i(displa)m(ys)h(or)g(edits)h(and)e(re-executes)j(them.)39 +b(Both)25 b Fr(\014rst)h Fu(and)f Fr(last)j Fu(ma)m(y)d(b)s(e)g(sp)s +(eci\014ed)630 758 y(as)31 b(a)g(string)f(\(to)i(lo)s(cate)h(the)d +(most)h(recen)m(t)h(command)f(b)s(eginning)e(with)i(that)g(string\))g +(or)630 867 y(as)d(a)g(n)m(um)m(b)s(er)f(\(an)h(index)f(in)m(to)i(the)f +(history)g(list,)h(where)e(a)h(negativ)m(e)i(n)m(um)m(b)s(er)d(is)h +(used)f(as)630 977 y(an)g(o\013set)i(from)e(the)h(curren)m(t)f(command) +h(n)m(um)m(b)s(er\).)39 b(If)27 b Fr(last)j Fu(is)e(not)f(sp)s +(eci\014ed)g(it)h(is)g(set)g(to)630 1087 y Fr(\014rst)p +Fu(.)47 b(If)32 b Fr(\014rst)i Fu(is)f(not)g(sp)s(eci\014ed)f(it)h(is)g +(set)g(to)h(the)f(previous)f(command)h(for)f(editing)i(and)630 +1196 y Fq(\000)p Fu(16)j(for)g(listing.)61 b(If)36 b(the)h +Ft(-l)f Fu(\015ag)i(is)e(giv)m(en,)k(the)d(commands)f(are)i(listed)f +(on)g(standard)630 1306 y(output.)59 b(The)36 b Ft(-n)h +Fu(\015ag)g(suppresses)e(the)h(command)h(n)m(um)m(b)s(ers)e(when)h +(listing.)60 b(The)37 b Ft(-r)630 1415 y Fu(\015ag)e(rev)m(erses)f(the) +h(order)e(of)i(the)f(listing.)53 b(Otherwise,)35 b(the)f(editor)h(giv)m +(en)g(b)m(y)f Fr(ename)40 b Fu(is)630 1525 y(in)m(v)m(ok)m(ed)33 +b(on)f(a)g(\014le)g(con)m(taining)h(those)f(commands.)44 +b(If)31 b Fr(ename)38 b Fu(is)31 b(not)h(giv)m(en,)i(the)d(v)-5 +b(alue)630 1634 y(of)29 b(the)g(follo)m(wing)i(v)-5 b(ariable)29 +b(expansion)g(is)g(used:)39 b Ft(${FCEDIT:-${EDITOR:-vi}})p +Fu(.)34 b(This)630 1744 y(sa)m(ys)g(to)g(use)f(the)h(v)-5 +b(alue)34 b(of)f(the)h Ft(FCEDIT)e Fu(v)-5 b(ariable)34 +b(if)f(set,)i(or)f(the)f(v)-5 b(alue)34 b(of)g(the)g +Ft(EDITOR)630 1854 y Fu(v)-5 b(ariable)40 b(if)e(that)i(is)f(set,)i(or) +e Ft(vi)f Fu(if)h(neither)g(is)g(set.)66 b(When)39 b(editing)g(is)g +(complete,)k(the)630 1963 y(edited)31 b(commands)f(are)g(ec)m(ho)s(ed)h +(and)f(executed.)630 2093 y(In)k(the)g(second)g(form,)h +Fr(command)j Fu(is)c(re-executed)i(after)f(eac)m(h)g(instance)g(of)f +Fr(pat)j Fu(in)d(the)630 2203 y(selected)e(command)e(is)h(replaced)g(b) +m(y)f Fr(rep)p Fu(.)41 b Fr(command)34 b Fu(is)c(in)m(tepreted)h(the)g +(same)g(as)g Fr(\014rst)630 2313 y Fu(ab)s(o)m(v)m(e.)630 +2443 y(A)g(useful)f(alias)i(to)g(use)e(with)h(the)g Ft(fc)f +Fu(command)h(is)g Ft(r='fc)e(-s')p Fu(,)h(so)h(that)h(t)m(yping)f(`)p +Ft(r)f(cc)p Fu(')630 2552 y(runs)35 b(the)h(last)h(command)f(b)s +(eginning)g(with)g Ft(cc)f Fu(and)h(t)m(yping)g(`)p Ft(r)p +Fu(')h(re-executes)h(the)e(last)630 2662 y(command)30 +b(\(see)h(Section)h(6.6)f([Aliases],)h(page)g(88\).)150 +2813 y Ft(history)870 2943 y(history)46 b([)p Fj(n)p +Ft(])870 3052 y(history)g(-c)870 3162 y(history)g(-d)h +Fj(offset)870 3271 y Ft(history)f([-anrw])g([)p Fj(filename)p +Ft(])870 3381 y(history)g(-ps)h Fj(arg)630 3511 y Fu(With)26 +b(no)g(options,)h(displa)m(y)f(the)g(history)g(list)g(with)f(line)h(n)m +(um)m(b)s(ers.)38 b(Lines)26 b(pre\014xed)e(with)630 +3621 y(a)35 b(`)p Ft(*)p Fu(')g(ha)m(v)m(e)h(b)s(een)e(mo)s(di\014ed.) +53 b(An)34 b(argumen)m(t)h(of)g Fr(n)f Fu(lists)i(only)f(the)g(last)g +Fr(n)f Fu(lines.)54 b(If)35 b(the)630 3730 y(shell)30 +b(v)-5 b(ariable)31 b Ft(HISTTIMEFORMAT)26 b Fu(is)k(set)h(and)e(not)i +(n)m(ull,)f(it)h(is)f(used)f(as)h(a)h(format)f(string)630 +3840 y(for)36 b Fr(strftime)41 b Fu(to)36 b(displa)m(y)g(the)g(time)h +(stamp)f(asso)s(ciated)h(with)f(eac)m(h)h(displa)m(y)m(ed)f(history)630 +3950 y(en)m(try)-8 b(.)47 b(No)33 b(in)m(terv)m(ening)g(blank)f(is)g +(prin)m(ted)g(b)s(et)m(w)m(een)h(the)g(formatted)f(time)h(stamp)g(and) +630 4059 y(the)e(history)f(line.)630 4189 y(Options,)g(if)h(supplied,)e +(ha)m(v)m(e)i(the)g(follo)m(wing)h(meanings:)630 4340 +y Ft(-c)384 b Fu(Clear)23 b(the)g(history)g(list.)39 +b(This)22 b(ma)m(y)i(b)s(e)e(com)m(bined)h(with)f(the)h(other)h +(options)1110 4450 y(to)31 b(replace)g(the)g(history)f(list)h +(completely)-8 b(.)630 4600 y Ft(-d)30 b Fj(offset)66 +b Fu(Delete)25 b(the)f(history)f(en)m(try)h(at)g(p)s(osition)f +Fr(o\013set)p Fu(.)39 b Fr(o\013set)27 b Fu(should)22 +b(b)s(e)h(sp)s(eci\014ed)1110 4710 y(as)31 b(it)g(app)s(ears)e(when)h +(the)g(history)g(is)h(displa)m(y)m(ed.)630 4861 y Ft(-a)384 +b Fu(App)s(end)35 b(the)i(new)g(history)g(lines)g(\(history)g(lines)g +(en)m(tered)h(since)f(the)g(b)s(e-)1110 4970 y(ginning)30 +b(of)h(the)f(curren)m(t)g(Bash)h(session\))g(to)g(the)g(history)f +(\014le.)630 5121 y Ft(-n)384 b Fu(App)s(end)32 b(the)i(history)f +(lines)h(not)g(already)g(read)g(from)f(the)h(history)f(\014le)h(to)1110 +5230 y(the)26 b(curren)m(t)f(history)g(list.)40 b(These)25 +b(are)h(lines)g(app)s(ended)e(to)i(the)f(history)h(\014le)1110 +5340 y(since)31 b(the)f(b)s(eginning)g(of)g(the)h(curren)m(t)f(Bash)h +(session.)p eop end +%%Page: 135 141 +TeXDict begin 135 140 bop 150 -116 a Fu(Chapter)30 b(9:)41 +b(Using)30 b(History)h(In)m(teractiv)m(ely)1925 b(135)630 +299 y Ft(-r)384 b Fu(Read)31 b(the)f(history)g(\014le)h(and)f(app)s +(end)e(its)j(con)m(ten)m(ts)h(to)f(the)g(history)f(list.)630 +447 y Ft(-w)384 b Fu(W)-8 b(rite)32 b(out)e(the)h(curren)m(t)f(history) +g(list)h(to)h(the)e(history)g(\014le.)630 595 y Ft(-p)384 +b Fu(P)m(erform)31 b(history)f(substitution)h(on)f(the)h +Fr(arg)8 b Fu(s)31 b(and)f(displa)m(y)h(the)f(result)h(on)1110 +705 y(the)d(standard)f(output,)i(without)f(storing)g(the)g(results)g +(in)g(the)g(history)g(list.)630 853 y Ft(-s)384 b Fu(The)30 +b Fr(arg)8 b Fu(s)30 b(are)h(added)f(to)h(the)f(end)g(of)h(the)f +(history)h(list)g(as)f(a)h(single)g(en)m(try)-8 b(.)630 +1001 y(When)26 b(an)m(y)h(of)f(the)g Ft(-w)p Fu(,)h Ft(-r)p +Fu(,)g Ft(-a)p Fu(,)g(or)f Ft(-n)f Fu(options)i(is)f(used,)h(if)f +Fr(\014lename)32 b Fu(is)26 b(giv)m(en,)i(then)e(it)h(is)630 +1111 y(used)h(as)g(the)h(history)f(\014le.)40 b(If)28 +b(not,)i(then)e(the)g(v)-5 b(alue)29 b(of)g(the)g Ft(HISTFILE)d +Fu(v)-5 b(ariable)29 b(is)f(used.)150 1332 y Fs(9.3)68 +b(History)46 b(Expansion)150 1492 y Fu(The)f(History)h(library)e(pro)m +(vides)i(a)f(history)g(expansion)g(feature)h(that)g(is)f(similar)h(to)g +(the)f(history)150 1601 y(expansion)g(pro)m(vided)f(b)m(y)h +Ft(csh)p Fu(.)83 b(This)44 b(section)i(describ)s(es)e(the)h(syn)m(tax)h +(used)e(to)i(manipulate)f(the)150 1711 y(history)30 b(information.)275 +1840 y(History)h(expansions)f(in)m(tro)s(duce)g(w)m(ords)g(from)g(the)h +(history)f(list)h(in)m(to)g(the)g(input)f(stream,)h(making)150 +1949 y(it)g(easy)g(to)g(rep)s(eat)g(commands,)f(insert)g(the)h(argumen) +m(ts)f(to)h(a)g(previous)f(command)g(in)m(to)i(the)e(curren)m(t)150 +2059 y(input)f(line,)i(or)g(\014x)f(errors)f(in)h(previous)g(commands)g +(quic)m(kly)-8 b(.)275 2188 y(History)27 b(expansion)f(tak)m(es)i +(place)f(in)f(t)m(w)m(o)i(parts.)39 b(The)26 b(\014rst)g(is)g(to)h +(determine)g(whic)m(h)f(line)h(from)f(the)150 2297 y(history)i(list)g +(should)f(b)s(e)g(used)g(during)g(substitution.)39 b(The)27 +b(second)h(is)g(to)h(select)g(p)s(ortions)e(of)h(that)h(line)150 +2407 y(for)d(inclusion)f(in)m(to)i(the)f(curren)m(t)f(one.)40 +b(The)25 b(line)h(selected)h(from)f(the)g(history)f(is)h(called)h(the)f +Fr(ev)m(en)m(t)p Fu(,)j(and)150 2517 y(the)21 b(p)s(ortions)g(of)g +(that)h(line)f(that)h(are)g(acted)g(up)s(on)e(are)h(called)h +Fr(w)m(ords)p Fu(.)38 b(V)-8 b(arious)21 b Fr(mo)s(di\014ers)j +Fu(are)e(a)m(v)-5 b(ailable)150 2626 y(to)35 b(manipulate)f(the)g +(selected)i(w)m(ords.)51 b(The)33 b(line)h(is)g(brok)m(en)g(in)m(to)h +(w)m(ords)e(in)h(the)g(same)h(fashion)e(that)150 2736 +y(Bash)i(do)s(es,)h(so)f(that)h(sev)m(eral)g(w)m(ords)e(surrounded)f(b) +m(y)i(quotes)g(are)g(considered)g(one)g(w)m(ord.)54 b(History)150 +2845 y(expansions)34 b(are)g(in)m(tro)s(duced)f(b)m(y)h(the)g(app)s +(earance)g(of)g(the)g(history)g(expansion)g(c)m(haracter,)i(whic)m(h)e +(is)150 2955 y(`)p Ft(!)p Fu(')d(b)m(y)f(default.)41 +b(Only)29 b(`)p Ft(\\)p Fu(')i(and)f(`)p Ft(')p Fu(')g(ma)m(y)h(b)s(e)f +(used)g(to)h(escap)s(e)g(the)f(history)g(expansion)h(c)m(haracter.)275 +3084 y(Sev)m(eral)40 b(shell)g(options)g(settable)h(with)e(the)h +Ft(shopt)e Fu(builtin)h(\(see)h(Section)h(4.2)f([Bash)g(Builtins],)150 +3194 y(page)32 b(48\))h(ma)m(y)f(b)s(e)f(used)g(to)i(tailor)g(the)e(b)s +(eha)m(vior)h(of)g(history)g(expansion.)44 b(If)31 b(the)h +Ft(histverify)d Fu(shell)150 3303 y(option)39 b(is)f(enabled,)i(and)e +(Readline)g(is)h(b)s(eing)e(used,)j(history)e(substitutions)g(are)g +(not)h(immediately)150 3413 y(passed)30 b(to)h(the)g(shell)g(parser.)40 +b(Instead,)30 b(the)h(expanded)f(line)h(is)f(reloaded)h(in)m(to)h(the)e +(Readline)h(editing)150 3522 y(bu\013er)e(for)i(further)e(mo)s +(di\014cation.)41 b(If)30 b(Readline)h(is)f(b)s(eing)g(used,)g(and)g +(the)g Ft(histreedit)e Fu(shell)i(option)150 3632 y(is)k(enabled,)h(a)g +(failed)g(history)f(expansion)g(will)g(b)s(e)g(reloaded)g(in)m(to)h +(the)g(Readline)f(editing)h(bu\013er)e(for)150 3741 y(correction.)68 +b(The)38 b Ft(-p)h Fu(option)g(to)h(the)f Ft(history)e +Fu(builtin)i(command)f(ma)m(y)i(b)s(e)e(used)g(to)i(see)g(what)f(a)150 +3851 y(history)f(expansion)f(will)h(do)g(b)s(efore)f(using)h(it.)63 +b(The)37 b Ft(-s)g Fu(option)i(to)f(the)g Ft(history)e +Fu(builtin)h(ma)m(y)i(b)s(e)150 3961 y(used)21 b(to)i(add)f(commands)g +(to)g(the)h(end)e(of)i(the)f(history)g(list)h(without)f(actually)i +(executing)f(them,)h(so)e(that)150 4070 y(they)31 b(are)f(a)m(v)-5 +b(ailable)33 b(for)d(subsequen)m(t)g(recall.)42 b(This)29 +b(is)i(most)g(useful)e(in)h(conjunction)h(with)f(Readline.)275 +4199 y(The)j(shell)h(allo)m(ws)h(con)m(trol)h(of)e(the)g(v)-5 +b(arious)34 b(c)m(haracters)h(used)f(b)m(y)f(the)h(history)g(expansion) +g(mec)m(h-)150 4309 y(anism)h(with)g(the)g Ft(histchars)d +Fu(v)-5 b(ariable,)38 b(as)d(explained)g(ab)s(o)m(v)m(e)i(\(see)f +(Section)f(5.2)i([Bash)e(V)-8 b(ariables],)150 4418 y(page)32 +b(69\).)44 b(The)31 b(shell)g(uses)g(the)g(history)g(commen)m(t)i(c)m +(haracter)f(to)g(mark)f(history)g(timestamps)h(when)150 +4528 y(writing)e(the)h(history)f(\014le.)150 4716 y Fk(9.3.1)63 +b(Ev)m(en)m(t)39 b(Designators)150 4863 y Fu(An)32 b(ev)m(en)m(t)j +(designator)e(is)g(a)g(reference)g(to)h(a)f(command)f(line)h(en)m(try)g +(in)g(the)g(history)g(list.)48 b(Unless)33 b(the)150 +4973 y(reference)e(is)f(absolute,)i(ev)m(en)m(ts)f(are)g(relativ)m(e)i +(to)e(the)f(curren)m(t)g(p)s(osition)h(in)f(the)h(history)f(list.)150 +5121 y Ft(!)432 b Fu(Start)34 b(a)f(history)h(substitution,)g(except)g +(when)f(follo)m(w)m(ed)i(b)m(y)e(a)h(space,)h(tab,)f(the)g(end)f(of)630 +5230 y(the)i(line,)g(`)p Ft(=)p Fu(')g(or)f(`)p Ft(\()p +Fu(')h(\(when)e(the)i Ft(extglob)d Fu(shell)j(option)f(is)h(enabled)f +(using)g(the)g Ft(shopt)630 5340 y Fu(builtin\).)p eop +end +%%Page: 136 142 +TeXDict begin 136 141 bop 150 -116 a Fu(Chapter)30 b(9:)41 +b(Using)30 b(History)h(In)m(teractiv)m(ely)1925 b(136)150 +299 y Ft(!)p Fj(n)384 b Fu(Refer)30 b(to)i(command)e(line)g +Fr(n)p Fu(.)150 460 y Ft(!-)p Fj(n)336 b Fu(Refer)30 +b(to)i(the)e(command)g Fr(n)g Fu(lines)h(bac)m(k.)150 +622 y Ft(!!)384 b Fu(Refer)30 b(to)i(the)e(previous)g(command.)40 +b(This)30 b(is)g(a)h(synon)m(ym)f(for)g(`)p Ft(!-1)p +Fu('.)150 784 y Ft(!)p Fj(string)144 b Fu(Refer)25 b(to)h(the)f(most)h +(recen)m(t)g(command)f(preceding)g(the)g(curren)m(t)g(p)s(osition)g(in) +g(the)g(history)630 893 y(list)31 b(starting)g(with)f +Fr(string)p Fu(.)150 1055 y Ft(!?)p Fj(string)p Ft([?])630 +1164 y Fu(Refer)25 b(to)h(the)f(most)h(recen)m(t)g(command)f(preceding) +g(the)g(curren)m(t)g(p)s(osition)g(in)g(the)g(history)630 +1274 y(list)32 b(con)m(taining)i Fr(string)p Fu(.)45 +b(The)31 b(trailing)i(`)p Ft(?)p Fu(')f(ma)m(y)g(b)s(e)f(omitted)i(if)f +(the)g Fr(string)39 b Fu(is)32 b(follo)m(w)m(ed)630 1384 +y(immediately)g(b)m(y)e(a)h(newline.)150 1545 y Ft(^)p +Fj(string1)p Ft(^)p Fj(string2)p Ft(^)630 1655 y Fu(Quic)m(k)h +(Substitution.)44 b(Rep)s(eat)32 b(the)g(last)h(command,)f(replacing)g +Fr(string1)40 b Fu(with)31 b Fr(string2)p Fu(.)630 1764 +y(Equiv)-5 b(alen)m(t)31 b(to)g Ft(!!:s/)p Fj(string1)p +Ft(/)p Fj(string2)p Ft(/)p Fu(.)150 1926 y Ft(!#)384 +b Fu(The)30 b(en)m(tire)h(command)f(line)h(t)m(yp)s(ed)f(so)h(far.)150 +2127 y Fk(9.3.2)63 b(W)-10 b(ord)41 b(Designators)150 +2274 y Fu(W)-8 b(ord)27 b(designators)h(are)g(used)e(to)i(select)h +(desired)d(w)m(ords)h(from)f(the)i(ev)m(en)m(t.)41 b(A)27 +b(`)p Ft(:)p Fu(')g(separates)h(the)f(ev)m(en)m(t)150 +2384 y(sp)s(eci\014cation)38 b(from)e(the)h(w)m(ord)f(designator.)61 +b(It)37 b(ma)m(y)h(b)s(e)e(omitted)i(if)e(the)h(w)m(ord)g(designator)g +(b)s(egins)150 2494 y(with)30 b(a)g(`)p Ft(^)p Fu(',)g(`)p +Ft($)p Fu(',)g(`)p Ft(*)p Fu(',)h(`)p Ft(-)p Fu(',)f(or)g(`)p +Ft(\045)p Fu('.)41 b(W)-8 b(ords)30 b(are)g(n)m(um)m(b)s(ered)e(from)i +(the)g(b)s(eginning)f(of)h(the)g(line,)g(with)g(the)150 +2603 y(\014rst)f(w)m(ord)f(b)s(eing)h(denoted)h(b)m(y)f(0)h(\(zero\).) +41 b(W)-8 b(ords)30 b(are)g(inserted)f(in)m(to)h(the)g(curren)m(t)f +(line)g(separated)h(b)m(y)150 2713 y(single)h(spaces.)275 +2849 y(F)-8 b(or)31 b(example,)150 3012 y Ft(!!)384 b +Fu(designates)37 b(the)f(preceding)g(command.)57 b(When)35 +b(y)m(ou)i(t)m(yp)s(e)f(this,)h(the)f(preceding)g(com-)630 +3122 y(mand)30 b(is)g(rep)s(eated)g(in)g(toto.)150 3283 +y Ft(!!:$)288 b Fu(designates)23 b(the)g(last)g(argumen)m(t)g(of)f(the) +h(preceding)f(command.)38 b(This)22 b(ma)m(y)h(b)s(e)e(shortened)630 +3393 y(to)31 b Ft(!$)p Fu(.)150 3555 y Ft(!fi:2)240 b +Fu(designates)30 b(the)g(second)f(argumen)m(t)h(of)f(the)h(most)f +(recen)m(t)i(command)e(starting)h(with)f(the)630 3664 +y(letters)j Ft(fi)p Fu(.)275 3827 y(Here)e(are)h(the)g(w)m(ord)f +(designators:)150 3990 y Ft(0)g(\(zero\))114 b Fu(The)30 +b Ft(0)p Fu(th)g(w)m(ord.)40 b(F)-8 b(or)31 b(man)m(y)g(applications,)h +(this)e(is)g(the)h(command)f(w)m(ord.)150 4151 y Fj(n)432 +b Fu(The)30 b Fr(n)p Fu(th)g(w)m(ord.)150 4313 y Ft(^)432 +b Fu(The)30 b(\014rst)f(argumen)m(t;)j(that)f(is,)f(w)m(ord)g(1.)150 +4474 y Ft($)432 b Fu(The)30 b(last)h(argumen)m(t.)150 +4636 y Ft(\045)432 b Fu(The)30 b(w)m(ord)g(matc)m(hed)h(b)m(y)f(the)h +(most)g(recen)m(t)g(`)p Ft(?)p Fj(string)p Ft(?)p Fu(')e(searc)m(h.)150 +4798 y Fj(x)p Ft(-)p Fj(y)336 b Fu(A)30 b(range)h(of)g(w)m(ords;)f(`)p +Ft(-)p Fj(y)p Fu(')g(abbreviates)h(`)p Ft(0-)p Fj(y)p +Fu('.)150 4959 y Ft(*)432 b Fu(All)28 b(of)g(the)g(w)m(ords,)g(except)h +(the)e Ft(0)p Fu(th.)40 b(This)27 b(is)g(a)h(synon)m(ym)f(for)h(`)p +Ft(1-$)p Fu('.)39 b(It)28 b(is)g(not)g(an)f(error)630 +5069 y(to)j(use)g(`)p Ft(*)p Fu(')f(if)h(there)g(is)g(just)f(one)h(w)m +(ord)f(in)g(the)h(ev)m(en)m(t;)i(the)d(empt)m(y)i(string)e(is)h +(returned)e(in)630 5178 y(that)j(case.)150 5340 y Fj(x)p +Ft(*)384 b Fu(Abbreviates)31 b(`)p Fj(x)p Ft(-$)p Fu(')p +eop end +%%Page: 137 143 +TeXDict begin 137 142 bop 150 -116 a Fu(Chapter)30 b(9:)41 +b(Using)30 b(History)h(In)m(teractiv)m(ely)1925 b(137)150 +299 y Fj(x)p Ft(-)384 b Fu(Abbreviates)31 b(`)p Fj(x)p +Ft(-$)p Fu(')f(lik)m(e)h(`)p Fj(x)p Ft(*)p Fu(',)g(but)f(omits)h(the)f +(last)h(w)m(ord.)275 458 y(If)i(a)h(w)m(ord)g(designator)g(is)g +(supplied)f(without)h(an)g(ev)m(en)m(t)h(sp)s(eci\014cation,)h(the)e +(previous)f(command)150 568 y(is)d(used)g(as)h(the)f(ev)m(en)m(t.)150 +767 y Fk(9.3.3)63 b(Mo)s(di\014ers)150 914 y Fu(After)29 +b(the)g(optional)g(w)m(ord)g(designator,)g(y)m(ou)g(can)g(add)f(a)h +(sequence)g(of)g(one)g(or)f(more)h(of)g(the)f(follo)m(wing)150 +1024 y(mo)s(di\014ers,)h(eac)m(h)j(preceded)e(b)m(y)g(a)h(`)p +Ft(:)p Fu('.)150 1183 y Ft(h)432 b Fu(Remo)m(v)m(e)32 +b(a)f(trailing)g(pathname)g(comp)s(onen)m(t,)g(lea)m(ving)h(only)e(the) +h(head.)150 1342 y Ft(t)432 b Fu(Remo)m(v)m(e)32 b(all)f(leading)h +(pathname)e(comp)s(onen)m(ts,)h(lea)m(ving)h(the)e(tail.)150 +1502 y Ft(r)432 b Fu(Remo)m(v)m(e)32 b(a)f(trailing)g(su\016x)f(of)g +(the)h(form)f(`)p Ft(.)p Fj(suffix)p Fu(',)f(lea)m(ving)j(the)f +(basename.)150 1661 y Ft(e)432 b Fu(Remo)m(v)m(e)32 b(all)f(but)f(the)h +(trailing)g(su\016x.)150 1821 y Ft(p)432 b Fu(Prin)m(t)30 +b(the)h(new)f(command)g(but)g(do)g(not)g(execute)i(it.)150 +1980 y Ft(q)432 b Fu(Quote)31 b(the)f(substituted)g(w)m(ords,)g +(escaping)h(further)e(substitutions.)150 2139 y Ft(x)432 +b Fu(Quote)32 b(the)f(substituted)g(w)m(ords)f(as)i(with)f(`)p +Ft(q)p Fu(',)h(but)e(break)h(in)m(to)i(w)m(ords)d(at)i(spaces,)h(tabs,) +630 2249 y(and)d(newlines.)150 2408 y Ft(s/)p Fj(old)p +Ft(/)p Fj(new)p Ft(/)630 2518 y Fu(Substitute)i Fr(new)40 +b Fu(for)32 b(the)h(\014rst)f(o)s(ccurrence)h(of)f Fr(old)37 +b Fu(in)32 b(the)h(ev)m(en)m(t)h(line.)48 b(An)m(y)32 +b(delimiter)630 2628 y(ma)m(y)25 b(b)s(e)g(used)f(in)g(place)i(of)f(`)p +Ft(/)p Fu('.)39 b(The)24 b(delimiter)h(ma)m(y)h(b)s(e)e(quoted)h(in)f +Fr(old)29 b Fu(and)24 b Fr(new)32 b Fu(with)25 b(a)630 +2737 y(single)k(bac)m(kslash.)40 b(If)28 b(`)p Ft(&)p +Fu(')g(app)s(ears)g(in)f Fr(new)p Fu(,)i(it)f(is)h(replaced)f(b)m(y)g +Fr(old)p Fu(.)40 b(A)28 b(single)h(bac)m(kslash)630 2847 +y(will)35 b(quote)g(the)g(`)p Ft(&)p Fu('.)54 b(The)34 +b(\014nal)g(delimiter)i(is)e(optional)i(if)f(it)g(is)f(the)h(last)h(c)m +(haracter)g(on)630 2956 y(the)31 b(input)e(line.)150 +3116 y Ft(&)432 b Fu(Rep)s(eat)31 b(the)f(previous)g(substitution.)150 +3275 y Ft(g)150 3385 y(a)432 b Fu(Cause)38 b(c)m(hanges)i(to)f(b)s(e)f +(applied)h(o)m(v)m(er)h(the)f(en)m(tire)g(ev)m(en)m(t)h(line.)66 +b(Used)39 b(in)f(conjunction)630 3494 y(with)30 b(`)p +Ft(s)p Fu(',)h(as)f(in)h Ft(gs/)p Fj(old)p Ft(/)p Fj(new)p +Ft(/)p Fu(,)c(or)j(with)h(`)p Ft(&)p Fu('.)150 3654 y +Ft(G)432 b Fu(Apply)30 b(the)g(follo)m(wing)i(`)p Ft(s)p +Fu(')f(mo)s(di\014er)e(once)i(to)g(eac)m(h)h(w)m(ord)e(in)g(the)g(ev)m +(en)m(t.)p eop end +%%Page: 138 144 +TeXDict begin 138 143 bop 150 -116 a Fu(Chapter)30 b(10:)41 +b(Installing)31 b(Bash)2356 b(138)150 299 y Fp(10)80 +b(Installing)52 b(Bash)150 556 y Fu(This)31 b(c)m(hapter)h(pro)m(vides) +g(basic)g(instructions)f(for)g(installing)i(Bash)f(on)f(the)h(v)-5 +b(arious)31 b(supp)s(orted)f(plat-)150 665 y(forms.)40 +b(The)28 b(distribution)h(supp)s(orts)e(the)j Fm(gnu)f +Fu(op)s(erating)h(systems,)f(nearly)h(ev)m(ery)g(v)m(ersion)f(of)h +(Unix,)150 775 y(and)d(sev)m(eral)j(non-Unix)d(systems)h(suc)m(h)g(as)g +(BeOS)g(and)f(In)m(terix.)40 b(Other)28 b(indep)s(enden)m(t)e(p)s(orts) +h(exist)i(for)150 884 y Fm(ms-dos)p Fu(,)h Fm(os/2)p +Fu(,)g(and)g(Windo)m(ws)g(platforms.)150 1128 y Fs(10.1)68 +b(Basic)45 b(Installation)150 1288 y Fu(These)30 b(are)h(installation)h +(instructions)e(for)h(Bash.)275 1430 y(The)e(simplest)i(w)m(a)m(y)g(to) +g(compile)h(Bash)e(is:)199 1572 y(1.)61 b Ft(cd)38 b +Fu(to)h(the)f(directory)h(con)m(taining)h(the)f(source)f(co)s(de)h(and) +f(t)m(yp)s(e)g(`)p Ft(./configure)p Fu(')e(to)j(con\014gure)330 +1681 y(Bash)c(for)f(y)m(our)h(system.)54 b(If)34 b(y)m(ou're)h(using)f +Ft(csh)g Fu(on)g(an)h(old)g(v)m(ersion)g(of)g(System)f(V,)h(y)m(ou)g +(migh)m(t)330 1791 y(need)21 b(to)g(t)m(yp)s(e)g(`)p +Ft(sh)30 b(./configure)p Fu(')18 b(instead)j(to)g(prev)m(en)m(t)h +Ft(csh)e Fu(from)g(trying)h(to)g(execute)h Ft(configure)330 +1901 y Fu(itself.)330 2039 y(Running)30 b Ft(configure)f +Fu(tak)m(es)k(some)e(time.)45 b(While)32 b(running,)e(it)i(prin)m(ts)f +(messages)h(telling)h(whic)m(h)330 2149 y(features)e(it)g(is)f(c)m(hec) +m(king)i(for.)199 2287 y(2.)61 b(T)m(yp)s(e)30 b(`)p +Ft(make)p Fu(')g(to)h(compile)g(Bash)g(and)e(build)h(the)g +Ft(bashbug)f Fu(bug)g(rep)s(orting)h(script.)199 2425 +y(3.)61 b(Optionally)-8 b(,)32 b(t)m(yp)s(e)e(`)p Ft(make)g(tests)p +Fu(')f(to)i(run)e(the)h(Bash)h(test)g(suite.)199 2563 +y(4.)61 b(T)m(yp)s(e)36 b(`)p Ft(make)29 b(install)p +Fu(')35 b(to)i(install)h Ft(bash)d Fu(and)h Ft(bashbug)p +Fu(.)57 b(This)35 b(will)i(also)h(install)f(the)g(man)m(ual)330 +2673 y(pages)31 b(and)f(Info)g(\014le.)275 2844 y(The)20 +b Ft(configure)f Fu(shell)i(script)g(attempts)h(to)g(guess)f(correct)i +(v)-5 b(alues)21 b(for)g(v)-5 b(arious)21 b(system-dep)s(enden)m(t)150 +2953 y(v)-5 b(ariables)31 b(used)e(during)g(compilation.)42 +b(It)31 b(uses)e(those)i(v)-5 b(alues)30 b(to)h(create)h(a)e +Ft(Makefile)e Fu(in)i(eac)m(h)i(direc-)150 3063 y(tory)k(of)g(the)g +(pac)m(k)-5 b(age)38 b(\(the)e(top)g(directory)-8 b(,)38 +b(the)e Ft(builtins)p Fu(,)f Ft(doc)p Fu(,)i(and)e Ft(support)e +Fu(directories,)39 b(eac)m(h)150 3172 y(directory)29 +b(under)d Ft(lib)p Fu(,)j(and)e(sev)m(eral)j(others\).)40 +b(It)29 b(also)g(creates)h(a)e Ft(config.h)e Fu(\014le)j(con)m(taining) +g(system-)150 3282 y(dep)s(enden)m(t)e(de\014nitions.)40 +b(Finally)-8 b(,)31 b(it)d(creates)i(a)f(shell)g(script)f(named)g +Ft(config.status)d Fu(that)k(y)m(ou)g(can)150 3392 y(run)h(in)h(the)h +(future)f(to)h(recreate)h(the)f(curren)m(t)f(con\014guration,)i(a)f +(\014le)f Ft(config.cache)e Fu(that)j(sa)m(v)m(es)h(the)150 +3501 y(results)39 b(of)g(its)h(tests)g(to)g(sp)s(eed)e(up)g +(recon\014guring,)j(and)e(a)g(\014le)g Ft(config.log)e +Fu(con)m(taining)j(compiler)150 3611 y(output)30 b(\(useful)h(mainly)g +(for)f(debugging)h Ft(configure)p Fu(\).)40 b(If)30 b(at)h(some)h(p)s +(oin)m(t)e Ft(config.cache)e Fu(con)m(tains)150 3720 +y(results)i(y)m(ou)h(don't)f(w)m(an)m(t)h(to)h(k)m(eep,)f(y)m(ou)g(ma)m +(y)g(remo)m(v)m(e)g(or)g(edit)g(it.)275 3862 y(T)-8 b(o)37 +b(\014nd)f(out)i(more)f(ab)s(out)h(the)f(options)h(and)f(argumen)m(ts)g +(that)h(the)g Ft(configure)d Fu(script)i(under-)150 3972 +y(stands,)30 b(t)m(yp)s(e)390 4114 y Ft(bash-2.04$)45 +b(./configure)g(--help)150 4256 y Fu(at)31 b(the)g(Bash)f(prompt)g(in)g +(y)m(our)g(Bash)h(source)f(directory)-8 b(.)275 4398 +y(If)53 b(y)m(ou)h(need)f(to)i(do)e(un)m(usual)g(things)g(to)i(compile) +g(Bash,)k(please)c(try)e(to)i(\014gure)e(out)h(ho)m(w)150 +4508 y Ft(configure)47 b Fu(could)j(c)m(hec)m(k)h(whether)e(or)g(not)h +(to)h(do)e(them,)55 b(and)49 b(mail)h(di\013s)f(or)h(instructions)f(to) +150 4617 y Ft(bash-maintainers@gnu.org)24 b Fu(so)30 +b(they)h(can)g(b)s(e)e(considered)i(for)f(the)g(next)h(release.)275 +4760 y(The)e(\014le)g Ft(configure.ac)d Fu(is)k(used)e(to)j(create)g +Ft(configure)c Fu(b)m(y)i(a)h(program)f(called)i(Auto)s(conf.)40 +b(Y)-8 b(ou)150 4869 y(only)34 b(need)g Ft(configure.ac)d +Fu(if)i(y)m(ou)i(w)m(an)m(t)g(to)f(c)m(hange)i(it)e(or)g(regenerate)i +Ft(configure)31 b Fu(using)j(a)g(new)m(er)150 4979 y(v)m(ersion)25 +b(of)f(Auto)s(conf.)39 b(If)24 b(y)m(ou)h(do)f(this,)i(mak)m(e)f(sure)f +(y)m(ou)h(are)f(using)g(Auto)s(conf)h(v)m(ersion)f(2.50)i(or)f(new)m +(er.)275 5121 y(Y)-8 b(ou)29 b(can)f(remo)m(v)m(e)i(the)f(program)g +(binaries)f(and)g(ob)5 b(ject)29 b(\014les)g(from)f(the)h(source)f(co)s +(de)h(directory)g(b)m(y)150 5230 y(t)m(yping)j(`)p Ft(make)d(clean)p +Fu('.)42 b(T)-8 b(o)32 b(also)g(remo)m(v)m(e)g(the)g(\014les)f(that)g +Ft(configure)e Fu(created)j(\(so)g(y)m(ou)g(can)f(compile)150 +5340 y(Bash)g(for)f(a)g(di\013eren)m(t)h(kind)f(of)g(computer\),)h(t)m +(yp)s(e)g(`)p Ft(make)e(distclean)p Fu('.)p eop end +%%Page: 139 145 +TeXDict begin 139 144 bop 150 -116 a Fu(Chapter)30 b(10:)41 +b(Installing)31 b(Bash)2356 b(139)150 299 y Fs(10.2)68 +b(Compilers)46 b(and)f(Options)150 458 y Fu(Some)28 b(systems)h +(require)f(un)m(usual)f(options)i(for)f(compilation)i(or)f(linking)f +(that)h(the)g Ft(configure)d Fu(script)150 568 y(do)s(es)32 +b(not)g(kno)m(w)g(ab)s(out.)44 b(Y)-8 b(ou)33 b(can)f(giv)m(e)h +Ft(configure)d Fu(initial)j(v)-5 b(alues)32 b(for)g(v)-5 +b(ariables)32 b(b)m(y)g(setting)h(them)150 677 y(in)k(the)g(en)m +(vironmen)m(t.)62 b(Using)38 b(a)f(Bourne-compatible)i(shell,)g(y)m(ou) +f(can)g(do)f(that)h(on)f(the)g(command)150 787 y(line)31 +b(lik)m(e)g(this:)390 920 y Ft(CC=c89)46 b(CFLAGS=-O2)f(LIBS=-lposix)g +(./configure)275 1053 y Fu(On)29 b(systems)h(that)h(ha)m(v)m(e)h(the)f +Ft(env)e Fu(program,)h(y)m(ou)h(can)g(do)f(it)h(lik)m(e)h(this:)390 +1186 y Ft(env)47 b(CPPFLAGS=-I/usr/local/in)o(clud)o(e)42 +b(LDFLAGS=-s)j(./configure)275 1318 y Fu(The)29 b(con\014guration)i +(pro)s(cess)f(uses)g(GCC)g(to)h(build)e(Bash)i(if)f(it)h(is)g(a)m(v)-5 +b(ailable.)150 1548 y Fs(10.3)68 b(Compiling)46 b(F)-11 +b(or)45 b(Multiple)g(Arc)l(hitectures)150 1707 y Fu(Y)-8 +b(ou)27 b(can)g(compile)g(Bash)g(for)f(more)h(than)f(one)h(kind)f(of)g +(computer)h(at)g(the)g(same)g(time,)h(b)m(y)e(placing)i(the)150 +1817 y(ob)5 b(ject)31 b(\014les)f(for)g(eac)m(h)i(arc)m(hitecture)f(in) +f(their)g(o)m(wn)h(directory)-8 b(.)41 b(T)-8 b(o)31 +b(do)f(this,)g(y)m(ou)h(m)m(ust)f(use)g(a)g(v)m(ersion)150 +1926 y(of)25 b Ft(make)f Fu(that)h(supp)s(orts)f(the)h +Ft(VPATH)e Fu(v)-5 b(ariable,)27 b(suc)m(h)e(as)g(GNU)h +Ft(make)p Fu(.)37 b Ft(cd)25 b Fu(to)h(the)f(directory)g(where)g(y)m +(ou)150 2036 y(w)m(an)m(t)34 b(the)f(ob)5 b(ject)34 b(\014les)f(and)f +(executables)i(to)g(go)g(and)e(run)g(the)h Ft(configure)d +Fu(script)j(from)g(the)g(source)150 2145 y(directory)-8 +b(.)44 b(Y)-8 b(ou)32 b(ma)m(y)g(need)f(to)h(supply)e(the)i +Ft(--srcdir=PATH)27 b Fu(argumen)m(t)32 b(to)g(tell)h +Ft(configure)28 b Fu(where)150 2255 y(the)36 b(source)g(\014les)f(are.) +57 b Ft(configure)33 b Fu(automatically)39 b(c)m(hec)m(ks)e(for)e(the)h +(source)g(co)s(de)f(in)h(the)f(directory)150 2364 y(that)c +Ft(configure)d Fu(is)i(in)g(and)g(in)g(`..'.)275 2497 +y(If)20 b(y)m(ou)h(ha)m(v)m(e)i(to)e(use)g(a)g Ft(make)f +Fu(that)i(do)s(es)e(not)i(supp)s(orts)d(the)i Ft(VPATH)e +Fu(v)-5 b(ariable,)24 b(y)m(ou)e(can)f(compile)h(Bash)150 +2607 y(for)33 b(one)h(arc)m(hitecture)h(at)f(a)g(time)g(in)f(the)h +(source)g(co)s(de)f(directory)-8 b(.)51 b(After)34 b(y)m(ou)g(ha)m(v)m +(e)h(installed)f(Bash)150 2716 y(for)c(one)h(arc)m(hitecture,)h(use)e +(`)p Ft(make)g(distclean)p Fu(')e(b)s(efore)i(recon\014guring)g(for)g +(another)g(arc)m(hitecture.)275 2849 y(Alternativ)m(ely)-8 +b(,)30 b(if)c(y)m(our)g(system)h(supp)s(orts)d(sym)m(b)s(olic)j(links,) +g(y)m(ou)g(can)g(use)f(the)g Ft(support/mkclone)150 2959 +y Fu(script)d(to)h(create)g(a)f(build)f(tree)i(whic)m(h)f(has)f(sym)m +(b)s(olic)i(links)e(bac)m(k)i(to)g(eac)m(h)g(\014le)f(in)g(the)g +(source)g(directory)-8 b(.)150 3068 y(Here's)41 b(an)f(example)i(that)f +(creates)h(a)e(build)g(directory)h(in)f(the)h(curren)m(t)f(directory)h +(from)f(a)h(source)150 3178 y(directory)31 b Ft(/usr/gnu/src/bash-2.0)p +Fu(:)390 3311 y Ft(bash)47 b(/usr/gnu/src/bash-2.0/s)o(uppo)o(rt/)o +(mkcl)o(one)41 b(-s)47 b(/usr/gnu/src/bash-2.0)42 b(.)150 +3444 y Fu(The)c Ft(mkclone)e Fu(script)i(requires)g(Bash,)i(so)f(y)m +(ou)f(m)m(ust)h(ha)m(v)m(e)g(already)g(built)f(Bash)g(for)g(at)h(least) +h(one)150 3553 y(arc)m(hitecture)32 b(b)s(efore)e(y)m(ou)h(can)f +(create)i(build)e(directories)h(for)f(other)h(arc)m(hitectures.)150 +3782 y Fs(10.4)68 b(Installation)47 b(Names)150 3942 +y Fu(By)37 b(default,)i(`)p Ft(make)29 b(install)p Fu(')35 +b(will)j(install)f(in)m(to)h Ft(/usr/local/bin)p Fu(,)d +Ft(/usr/local/man)p Fu(,)f(etc.)61 b(Y)-8 b(ou)150 4051 +y(can)35 b(sp)s(ecify)f(an)h(installation)i(pre\014x)c(other)j(than)e +Ft(/usr/local)e Fu(b)m(y)j(giving)g Ft(configure)e Fu(the)h(option)150 +4161 y Ft(--prefix=)p Fj(PATH)p Fu(,)41 b(or)g(b)m(y)g(sp)s(ecifying)h +(a)f(v)-5 b(alue)42 b(for)f(the)h Ft(DESTDIR)d Fu(`)p +Ft(make)p Fu(')i(v)-5 b(ariable)42 b(when)f(running)150 +4271 y(`)p Ft(make)29 b(install)p Fu('.)275 4403 y(Y)-8 +b(ou)71 b(can)h(sp)s(ecify)f(separate)h(installation)h(pre\014xes)d +(for)h(arc)m(hitecture-sp)s(eci\014c)i(\014les)f(and)150 +4513 y(arc)m(hitecture-indep)s(enden)m(t)44 b(\014les.)80 +b(If)43 b(y)m(ou)h(giv)m(e)h Ft(configure)c Fu(the)j(option)g +Ft(--exec-prefix=)p Fj(PATH)p Fu(,)150 4623 y(`)p Ft(make)29 +b(install)p Fu(')63 b(will)h(use)f Fr(P)-8 b(A)g(TH)75 +b Fu(as)64 b(the)g(pre\014x)e(for)i(installing)h(programs)e(and)h +(libraries.)150 4732 y(Do)s(cumen)m(tation)32 b(and)e(other)h(data)g +(\014les)f(will)h(still)g(use)f(the)h(regular)f(pre\014x.)150 +4961 y Fs(10.5)68 b(Sp)t(ecifying)45 b(the)g(System)h(T)l(yp)t(e)150 +5121 y Fu(There)f(ma)m(y)g(b)s(e)f(some)i(features)f +Ft(configure)e Fu(can)i(not)g(\014gure)g(out)g(automatically)-8 +b(,)52 b(but)44 b(need)h(to)150 5230 y(determine)26 b(b)m(y)g(the)g(t)m +(yp)s(e)g(of)g(host)g(Bash)g(will)g(run)f(on.)39 b(Usually)26 +b Ft(configure)d Fu(can)k(\014gure)e(that)h(out,)i(but)150 +5340 y(if)g(it)g(prin)m(ts)f(a)h(message)g(sa)m(ying)h(it)f(can)g(not)f +(guess)h(the)g(host)f(t)m(yp)s(e,)i(giv)m(e)g(it)f(the)g +Ft(--host=TYPE)c Fu(option.)p eop end +%%Page: 140 146 +TeXDict begin 140 145 bop 150 -116 a Fu(Chapter)30 b(10:)41 +b(Installing)31 b(Bash)2356 b(140)150 299 y(`)p Ft(TYPE)p +Fu(')29 b(can)h(either)g(b)s(e)g(a)g(short)f(name)h(for)f(the)h(system) +g(t)m(yp)s(e,)h(suc)m(h)e(as)h(`)p Ft(sun4)p Fu(',)g(or)f(a)h +(canonical)i(name)150 408 y(with)e(three)h(\014elds:)40 +b(`)p Ft(CPU-COMPANY-SYSTEM)p Fu(')26 b(\(e.g.,)32 b(`)p +Ft(i386-unknown-freebsd4.2)p Fu('\).)275 539 y(See)e(the)h(\014le)f +Ft(support/config.sub)c Fu(for)k(the)g(p)s(ossible)g(v)-5 +b(alues)31 b(of)f(eac)m(h)i(\014eld.)150 764 y Fs(10.6)68 +b(Sharing)45 b(Defaults)150 924 y Fu(If)d(y)m(ou)i(w)m(an)m(t)g(to)f +(set)h(default)f(v)-5 b(alues)43 b(for)g Ft(configure)d +Fu(scripts)j(to)h(share,)i(y)m(ou)d(can)g(create)i(a)e(site)150 +1033 y(shell)48 b(script)f(called)i Ft(config.site)44 +b Fu(that)k(giv)m(es)h(default)f(v)-5 b(alues)48 b(for)f(v)-5 +b(ariables)48 b(lik)m(e)h Ft(CC)p Fu(,)j Ft(cache_)150 +1143 y(file)p Fu(,)c(and)d Ft(prefix)p Fu(.)85 b Ft(configure)43 +b Fu(lo)s(oks)j(for)f Ft(PREFIX/share/config.site)39 +b Fu(if)46 b(it)g(exists,)k(then)150 1252 y Ft(PREFIX/etc/config.site) +24 b Fu(if)31 b(it)g(exists.)42 b(Or,)30 b(y)m(ou)h(can)g(set)g(the)g +Ft(CONFIG_SITE)c Fu(en)m(vironmen)m(t)k(v)-5 b(ari-)150 +1362 y(able)40 b(to)g(the)g(lo)s(cation)h(of)e(the)h(site)g(script.)67 +b(A)40 b(w)m(arning:)58 b(the)40 b(Bash)g Ft(configure)c +Fu(lo)s(oks)k(for)f(a)h(site)150 1472 y(script,)31 b(but)e(not)i(all)g +Ft(configure)d Fu(scripts)i(do.)150 1697 y Fs(10.7)68 +b(Op)t(eration)46 b(Con)l(trols)150 1856 y Ft(configure)28 +b Fu(recognizes)k(the)e(follo)m(wing)i(options)f(to)g(con)m(trol)h(ho)m +(w)e(it)h(op)s(erates.)150 2008 y Ft(--cache-file=)p +Fj(file)630 2117 y Fu(Use)d(and)g(sa)m(v)m(e)h(the)f(results)g(of)g +(the)h(tests)f(in)g Fr(\014le)33 b Fu(instead)28 b(of)h +Ft(./config.cache)p Fu(.)36 b(Set)28 b Fr(\014le)630 +2227 y Fu(to)j Ft(/dev/null)d Fu(to)j(disable)g(cac)m(hing,)h(for)e +(debugging)g Ft(configure)p Fu(.)150 2379 y Ft(--help)192 +b Fu(Prin)m(t)30 b(a)h(summary)e(of)i(the)f(options)h(to)g +Ft(configure)p Fu(,)d(and)i(exit.)150 2531 y Ft(--quiet)150 +2641 y(--silent)150 2750 y(-q)384 b Fu(Do)31 b(not)g(prin)m(t)f +(messages)h(sa)m(ying)g(whic)m(h)g(c)m(hec)m(ks)g(are)g(b)s(eing)f +(made.)150 2902 y Ft(--srcdir=)p Fj(dir)630 3012 y Fu(Lo)s(ok)i(for)g +(the)g(Bash)g(source)h(co)s(de)f(in)g(directory)g Fr(dir)p +Fu(.)45 b(Usually)33 b Ft(configure)c Fu(can)j(deter-)630 +3121 y(mine)e(that)h(directory)g(automatically)-8 b(.)150 +3273 y Ft(--version)630 3383 y Fu(Prin)m(t)29 b(the)h(v)m(ersion)g(of)g +(Auto)s(conf)f(used)g(to)h(generate)h(the)f Ft(configure)d +Fu(script,)j(and)f(exit.)275 3535 y Ft(configure)34 b +Fu(also)k(accepts)g(some)g(other,)h(not)e(widely)g(used,)h(b)s +(oilerplate)g(options.)61 b(`)p Ft(configure)150 3644 +y(--help)p Fu(')29 b(prin)m(ts)h(the)g(complete)i(list.)150 +3869 y Fs(10.8)68 b(Optional)46 b(F)-11 b(eatures)150 +4029 y Fu(The)29 b(Bash)h Ft(configure)d Fu(has)j(a)g(n)m(um)m(b)s(er)f +(of)h Ft(--enable-)p Fj(feature)25 b Fu(options,)30 b(where)g +Fr(feature)35 b Fu(indicates)150 4138 y(an)e(optional)i(part)e(of)h +(Bash.)50 b(There)33 b(are)g(also)i(sev)m(eral)g Ft(--with-)p +Fj(package)29 b Fu(options,)35 b(where)e Fr(pac)m(k)-5 +b(age)150 4248 y Fu(is)32 b(something)h(lik)m(e)h(`)p +Ft(bash-malloc)p Fu(')c(or)i(`)p Ft(purify)p Fu('.)45 +b(T)-8 b(o)33 b(turn)e(o\013)i(the)f(default)h(use)f(of)g(a)h(pac)m(k) +-5 b(age,)35 b(use)150 4357 y Ft(--without-)p Fj(package)p +Fu(.)46 b(T)-8 b(o)34 b(con\014gure)g(Bash)g(without)f(a)i(feature)f +(that)g(is)g(enabled)g(b)m(y)f(default,)i(use)150 4467 +y Ft(--disable-)p Fj(feature)p Fu(.)275 4598 y(Here)28 +b(is)g(a)h(complete)g(list)g(of)f(the)h Ft(--enable-)c +Fu(and)j Ft(--with-)e Fu(options)i(that)h(the)f(Bash)g +Ft(configure)150 4707 y Fu(recognizes.)150 4859 y Ft(--with-afs)630 +4969 y Fu(De\014ne)j(if)f(y)m(ou)h(are)f(using)g(the)h(Andrew)e(File)j +(System)e(from)g(T)-8 b(ransarc.)150 5121 y Ft(--with-bash-malloc)630 +5230 y Fu(Use)34 b(the)g(Bash)h(v)m(ersion)f(of)g Ft(malloc)e +Fu(in)i(the)g(directory)h Ft(lib/malloc)p Fu(.)48 b(This)34 +b(is)g(not)g(the)630 5340 y(same)e Ft(malloc)e Fu(that)j(app)s(ears)e +(in)g Fm(gnu)h Fu(lib)s(c,)g(but)f(an)h(older)f(v)m(ersion)i +(originally)g(deriv)m(ed)p eop end +%%Page: 141 147 +TeXDict begin 141 146 bop 150 -116 a Fu(Chapter)30 b(10:)41 +b(Installing)31 b(Bash)2356 b(141)630 299 y(from)32 b(the)h(4.2)g +Fm(bsd)f Ft(malloc)p Fu(.)45 b(This)31 b Ft(malloc)g +Fu(is)i(v)m(ery)f(fast,)i(but)e(w)m(astes)h(some)g(space)g(on)630 +408 y(eac)m(h)j(allo)s(cation.)58 b(This)34 b(option)i(is)f(enabled)g +(b)m(y)g(default.)56 b(The)34 b Ft(NOTES)g Fu(\014le)h(con)m(tains)i(a) +630 518 y(list)29 b(of)f(systems)f(for)h(whic)m(h)g(this)g(should)e(b)s +(e)i(turned)e(o\013,)j(and)f Ft(configure)d Fu(disables)j(this)630 +628 y(option)j(automatically)i(for)d(a)h(n)m(um)m(b)s(er)e(of)i +(systems.)150 789 y Ft(--with-curses)630 899 y Fu(Use)h(the)h(curses)e +(library)h(instead)g(of)h(the)f(termcap)g(library)-8 +b(.)46 b(This)32 b(should)f(b)s(e)g(supplied)630 1008 +y(if)f(y)m(our)h(system)f(has)g(an)h(inadequate)g(or)f(incomplete)i +(termcap)e(database.)150 1170 y Ft(--with-gnu-malloc)630 +1279 y Fu(A)g(synon)m(ym)g(for)g Ft(--with-bash-malloc)p +Fu(.)150 1441 y Ft(--with-installed-readlin)o(e[=)p Fj(P)o(REFI)o(X)p +Ft(])630 1550 y Fu(De\014ne)c(this)f(to)h(mak)m(e)h(Bash)f(link)f(with) +g(a)h(lo)s(cally-installed)i(v)m(ersion)e(of)g(Readline)g(rather)630 +1660 y(than)f(the)h(v)m(ersion)g(in)f Ft(lib/readline)p +Fu(.)36 b(This)25 b(w)m(orks)g(only)h(with)f(Readline)h(5.0)h(and)e +(later)630 1769 y(v)m(ersions.)46 b(If)32 b Fr(PREFIX)41 +b Fu(is)32 b Ft(yes)f Fu(or)i(not)f(supplied,)f Ft(configure)f +Fu(uses)i(the)g(v)-5 b(alues)32 b(of)h(the)630 1879 y(mak)m(e)28 +b(v)-5 b(ariables)29 b Ft(includedir)24 b Fu(and)j Ft(libdir)p +Fu(,)g(whic)m(h)g(are)h(sub)s(directories)f(of)g Ft(prefix)f +Fu(b)m(y)630 1989 y(default,)44 b(to)d(\014nd)f(the)h(installed)g(v)m +(ersion)h(of)f(Readline)g(if)g(it)g(is)g(not)g(in)g(the)g(standard)630 +2098 y(system)35 b(include)f(and)g(library)g(directories.)54 +b(If)34 b Fr(PREFIX)43 b Fu(is)35 b Ft(no)p Fu(,)g(Bash)f(links)h(with) +f(the)630 2208 y(v)m(ersion)42 b(in)e Ft(lib/readline)p +Fu(.)70 b(If)40 b Fr(PREFIX)51 b Fu(is)41 b(set)g(to)h(an)m(y)g(other)f +(v)-5 b(alue,)44 b Ft(configure)630 2317 y Fu(treats)27 +b(it)g(as)f(a)h(directory)g(pathname)f(and)f(lo)s(oks)i(for)f(the)g +(installed)h(v)m(ersion)g(of)f(Readline)630 2427 y(in)34 +b(sub)s(directories)f(of)h(that)h(directory)g(\(include)f(\014les)g(in) +g Fr(PREFIX)9 b Fu(/)p Ft(include)32 b Fu(and)i(the)630 +2536 y(library)c(in)g Fr(PREFIX)9 b Fu(/)p Ft(lib)p Fu(\).)150 +2698 y Ft(--with-purify)630 2807 y Fu(De\014ne)23 b(this)g(to)h(use)f +(the)g(Purify)f(memory)h(allo)s(cation)i(c)m(hec)m(k)m(er)g(from)e +(Rational)i(Soft)m(w)m(are.)150 2969 y Ft(--enable-minimal-config)630 +3078 y Fu(This)e(pro)s(duces)f(a)i(shell)g(with)f(minimal)h(features,)h +(close)g(to)f(the)g(historical)h(Bourne)e(shell.)275 +3241 y(There)k(are)i(sev)m(eral)g Ft(--enable-)d Fu(options)i(that)h +(alter)g(ho)m(w)f(Bash)g(is)g(compiled)h(and)e(link)m(ed,)i(rather)150 +3350 y(than)h(c)m(hanging)h(run-time)f(features.)150 +3513 y Ft(--enable-largefile)630 3622 y Fu(Enable)e(supp)s(ort)f(for)h +(large)i(\014les)f(\()p Ft(http://www.sas.com/stand)o(ards)o(/la)o +(rge_)o(file)o(/)630 3732 y(x_open)5 b(.)t(20Mar96)g(.)t(html)p +Fu(\))31 b(if)37 b(the)f(op)s(erating)h(system)g(requires)f(sp)s(ecial) +h(compiler)g(op-)630 3842 y(tions)27 b(to)h(build)e(programs)h(whic)m +(h)g(can)g(access)h(large)h(\014les.)39 b(This)26 b(is)i(enabled)f(b)m +(y)f(default,)630 3951 y(if)k(the)h(op)s(erating)g(system)f(pro)m +(vides)h(large)g(\014le)g(supp)s(ort.)150 4113 y Ft(--enable-profiling) +630 4222 y Fu(This)g(builds)f(a)i(Bash)g(binary)f(that)h(pro)s(duces)e +(pro\014ling)h(information)h(to)h(b)s(e)d(pro)s(cessed)630 +4332 y(b)m(y)g Ft(gprof)f Fu(eac)m(h)j(time)f(it)g(is)f(executed.)150 +4493 y Ft(--enable-static-link)630 4603 y Fu(This)37 +b(causes)h(Bash)f(to)h(b)s(e)f(link)m(ed)h(statically)-8 +b(,)43 b(if)37 b Ft(gcc)g Fu(is)g(b)s(eing)g(used.)61 +b(This)37 b(could)h(b)s(e)630 4712 y(used)30 b(to)h(build)e(a)i(v)m +(ersion)g(to)g(use)f(as)g(ro)s(ot's)h(shell.)275 4875 +y(The)f(`)p Ft(minimal-config)p Fu(')d(option)k(can)g(b)s(e)f(used)f +(to)j(disable)e(all)i(of)f(the)f(follo)m(wing)i(options,)g(but)d(it)150 +4984 y(is)h(pro)s(cessed)g(\014rst,)g(so)h(individual)f(options)g(ma)m +(y)h(b)s(e)f(enabled)g(using)g(`)p Ft(enable-)p Fj(feature)p +Fu('.)275 5121 y(All)41 b(of)g(the)g(follo)m(wing)i(options)e(except)h +(for)f(`)p Ft(disabled-builtins)p Fu(',)e(`)p Ft(directpand-default)p +Fu(',)150 5230 y(and)45 b(`)p Ft(xpg-echo-default)p Fu(')c(are)k +(enabled)h(b)m(y)f(default,)k(unless)44 b(the)i(op)s(erating)f(system)h +(do)s(es)f(not)150 5340 y(pro)m(vide)30 b(the)h(necessary)g(supp)s +(ort.)p eop end +%%Page: 142 148 +TeXDict begin 142 147 bop 150 -116 a Fu(Chapter)30 b(10:)41 +b(Installing)31 b(Bash)2356 b(142)150 299 y Ft(--enable-alias)630 +408 y Fu(Allo)m(w)41 b(alias)g(expansion)f(and)f(include)g(the)h +Ft(alias)f Fu(and)g Ft(unalias)e Fu(builtins)j(\(see)g(Sec-)630 +518 y(tion)31 b(6.6)g([Aliases],)i(page)e(88\).)150 682 +y Ft(--enable-arith-for-comma)o(nd)630 792 y Fu(Include)21 +b(supp)s(ort)g(for)g(the)i(alternate)g(form)f(of)g(the)g +Ft(for)f Fu(command)h(that)h(b)s(eha)m(v)m(es)f(lik)m(e)i(the)630 +902 y(C)30 b(language)i Ft(for)d Fu(statemen)m(t)j(\(see)g(Section)f +(3.2.4.1)i([Lo)s(oping)d(Constructs],)h(page)g(10\).)150 +1066 y Ft(--enable-array-variables)630 1176 y Fu(Include)h(supp)s(ort)g +(for)h(one-dimensional)h(arra)m(y)f(shell)h(v)-5 b(ariables)33 +b(\(see)h(Section)g(6.7)h([Ar-)630 1285 y(ra)m(ys],)c(page)g(89\).)150 +1450 y Ft(--enable-bang-history)630 1559 y Fu(Include)36 +b(supp)s(ort)f(for)h Ft(csh)p Fu(-lik)m(e)h(history)g(substitution)f +(\(see)h(Section)g(9.3)h([History)f(In-)630 1669 y(teraction],)c(page)e +(135\).)150 1833 y Ft(--enable-brace-expansion)630 1943 +y Fu(Include)40 b Ft(csh)p Fu(-lik)m(e)h(brace)f(expansion)g(\()h +Ft(b{a,b}c)d Fq(7!)i Ft(bac)30 b(bbc)39 b Fu(\).)71 b(See)40 +b(Section)h(3.5.1)630 2052 y([Brace)32 b(Expansion],)e(page)h(21,)h +(for)e(a)g(complete)i(description.)150 2217 y Ft +(--enable-casemod-attribu)o(tes)630 2326 y Fu(Include)37 +b(supp)s(ort)g(for)g(case-mo)s(difying)i(attributes)g(in)e(the)h +Ft(declare)e Fu(builtin)i(and)f(as-)630 2436 y(signmen)m(t)29 +b(statemen)m(ts.)41 b(V)-8 b(ariables)30 b(with)e(the)g +Fr(upp)s(ercase)k Fu(attribute,)e(for)e(example,)i(will)630 +2545 y(ha)m(v)m(e)i(their)e(v)-5 b(alues)31 b(con)m(v)m(erted)h(to)f +(upp)s(ercase)e(up)s(on)g(assignmen)m(t.)150 2710 y Ft +(--enable-casemod-expansi)o(on)630 2819 y Fu(Include)h(supp)s(ort)e +(for)i(case-mo)s(difying)i(w)m(ord)e(expansions.)150 +2984 y Ft(--enable-command-timing)630 3093 y Fu(Include)43 +b(supp)s(ort)f(for)h(recognizing)i Ft(time)e Fu(as)g(a)h(reserv)m(ed)g +(w)m(ord)f(and)g(for)h(displa)m(ying)630 3203 y(timing)37 +b(statistics)h(for)e(the)g(pip)s(eline)g(follo)m(wing)i +Ft(time)d Fu(\(see)i(Section)g(3.2.2)h([Pip)s(elines],)630 +3313 y(page)24 b(8\).)39 b(This)23 b(allo)m(ws)h(pip)s(elines)f(as)h(w) +m(ell)g(as)g(shell)f(builtins)g(and)g(functions)g(to)h(b)s(e)e(timed.) +150 3477 y Ft(--enable-cond-command)630 3587 y Fu(Include)33 +b(supp)s(ort)f(for)i(the)g Ft([[)f Fu(conditional)i(command.)51 +b(\(see)34 b(Section)h(3.2.4.2)h([Condi-)630 3696 y(tional)c +(Constructs],)e(page)h(10\).)150 3861 y Ft(--enable-cond-regexp)630 +3970 y Fu(Include)k(supp)s(ort)f(for)i(matc)m(hing)h +Fm(posix)e Fu(regular)h(expressions)g(using)f(the)h(`)p +Ft(=~)p Fu(')g(binary)630 4080 y(op)s(erator)25 b(in)f(the)h +Ft([[)f Fu(conditional)h(command.)39 b(\(see)25 b(Section)h(3.2.4.2)h +([Conditional)e(Con-)630 4189 y(structs],)31 b(page)g(10\).)150 +4354 y Ft(--enable-coprocesses)630 4463 y Fu(Include)23 +b(supp)s(ort)f(for)i(copro)s(cesses)g(and)f(the)h Ft(coproc)e +Fu(reserv)m(ed)i(w)m(ord)g(\(see)h(Section)f(3.2.2)630 +4573 y([Pip)s(elines],)31 b(page)g(8\).)150 4737 y Ft +(--enable-debugger)630 4847 y Fu(Include)f(supp)s(ort)e(for)i(the)h +(bash)f(debugger)g(\(distributed)g(separately\).)150 +5011 y Ft(--enable-direxpand-defau)o(lt)630 5121 y Fu(Cause)53 +b(the)g Ft(direxpand)d Fu(shell)j(option)h(\(see)g(Section)f(4.3.2)i +([The)e(Shopt)f(Builtin],)630 5230 y(page)29 b(62\))g(to)f(b)s(e)f +(enabled)h(b)m(y)g(default)g(when)e(the)i(shell)g(starts.)41 +b(It)27 b(is)h(normally)g(disabled)630 5340 y(b)m(y)i(default.)p +eop end +%%Page: 143 149 +TeXDict begin 143 148 bop 150 -116 a Fu(Chapter)30 b(10:)41 +b(Installing)31 b(Bash)2356 b(143)150 299 y Ft +(--enable-directory-stack)630 408 y Fu(Include)33 b(supp)s(ort)g(for)h +(a)g Ft(csh)p Fu(-lik)m(e)h(directory)f(stac)m(k)i(and)d(the)i +Ft(pushd)p Fu(,)f Ft(popd)p Fu(,)g(and)f Ft(dirs)630 +518 y Fu(builtins)d(\(see)h(Section)g(6.8)h([The)e(Directory)i(Stac)m +(k],)g(page)f(90\).)150 673 y Ft(--enable-disabled-builti)o(ns)630 +783 y Fu(Allo)m(w)40 b(builtin)e(commands)g(to)h(b)s(e)f(in)m(v)m(ok)m +(ed)i(via)f(`)p Ft(builtin)29 b(xxx)p Fu(')37 b(ev)m(en)j(after)f +Ft(xxx)e Fu(has)630 892 y(b)s(een)31 b(disabled)g(using)g(`)p +Ft(enable)d(-n)i(xxx)p Fu('.)43 b(See)32 b(Section)g(4.2)h([Bash)e +(Builtins],)i(page)f(48,)630 1002 y(for)e(details)i(of)e(the)h +Ft(builtin)d Fu(and)i Ft(enable)e Fu(builtin)i(commands.)150 +1157 y Ft(--enable-dparen-arithmet)o(ic)630 1267 y Fu(Include)42 +b(supp)s(ort)f(for)h(the)h Ft(\(\(...)o(\)\))f Fu(command)g(\(see)i +(Section)f(3.2.4.2)i([Conditional)630 1377 y(Constructs],)30 +b(page)h(10\).)150 1532 y Ft(--enable-extended-glob)630 +1641 y Fu(Include)40 b(supp)s(ort)e(for)i(the)h(extended)f(pattern)h +(matc)m(hing)g(features)g(describ)s(ed)e(ab)s(o)m(v)m(e)630 +1751 y(under)29 b(Section)i(3.5.8.1)i([P)m(attern)e(Matc)m(hing],)i +(page)e(30.)150 1906 y Ft(--enable-extended-glob-d)o(efau)o(lt)630 +2016 y Fu(Set)40 b(the)g(default)g(v)-5 b(alue)41 b(of)f(the)g +Fr(extglob)j Fu(shell)d(option)g(describ)s(ed)f(ab)s(o)m(v)m(e)i(under) +d(Sec-)630 2125 y(tion)31 b(4.3.2)h([The)e(Shopt)g(Builtin],)h(page)g +(62)g(to)h(b)s(e)d(enabled.)150 2281 y Ft(--enable-glob-asciirange)o +(-def)o(ault)630 2390 y Fu(Set)i(the)g(default)f(v)-5 +b(alue)31 b(of)g(the)g Fr(globasciiranges)36 b Fu(shell)31 +b(option)g(describ)s(ed)f(ab)s(o)m(v)m(e)h(under)630 +2500 y(Section)41 b(4.3.2)h([The)e(Shopt)f(Builtin],)44 +b(page)d(62)g(to)g(b)s(e)f(enabled.)70 b(This)39 b(con)m(trols)j(the) +630 2609 y(b)s(eha)m(vior)21 b(of)g(c)m(haracter)h(ranges)f(when)f +(used)g(in)g(pattern)h(matc)m(hing)h(brac)m(k)m(et)g(expressions.)150 +2765 y Ft(--enable-help-builtin)630 2874 y Fu(Include)i(the)h +Ft(help)f Fu(builtin,)h(whic)m(h)g(displa)m(ys)f(help)h(on)f(shell)h +(builtins)f(and)h(v)-5 b(ariables)25 b(\(see)630 2984 +y(Section)31 b(4.2)h([Bash)e(Builtins],)i(page)f(48\).)150 +3139 y Ft(--enable-history)630 3249 y Fu(Include)e(command)g(history)h +(and)f(the)h Ft(fc)f Fu(and)g Ft(history)e Fu(builtin)j(commands)f +(\(see)h(Sec-)630 3358 y(tion)h(9.1)g([Bash)g(History)g(F)-8 +b(acilities],)34 b(page)d(133\).)150 3513 y Ft(--enable-job-control)630 +3623 y Fu(This)e(enables)i(the)f(job)g(con)m(trol)h(features)g(\(see)g +(Chapter)f(7)g([Job)g(Con)m(trol],)h(page)g(97\),)h(if)630 +3733 y(the)f(op)s(erating)f(system)h(supp)s(orts)d(them.)150 +3888 y Ft(--enable-multibyte)630 3998 y Fu(This)h(enables)i(supp)s(ort) +d(for)i(m)m(ultib)m(yte)h(c)m(haracters)g(if)f(the)g(op)s(erating)h +(system)f(pro)m(vides)630 4107 y(the)h(necessary)f(supp)s(ort.)150 +4262 y Ft(--enable-net-redirection)o(s)630 4372 y Fu(This)23 +b(enables)h(the)g(sp)s(ecial)h(handling)e(of)h(\014lenames)g(of)g(the)g +(form)g Ft(/dev/tcp/)p Fj(host)p Ft(/)p Fj(port)630 4482 +y Fu(and)31 b Ft(/dev/udp/)p Fj(host)p Ft(/)p Fj(port)26 +b Fu(when)31 b(used)g(in)g(redirections)h(\(see)g(Section)g(3.6)h +([Redirec-)630 4591 y(tions],)e(page)g(31\).)150 4746 +y Ft(--enable-process-substit)o(utio)o(n)630 4856 y Fu(This)49 +b(enables)i(pro)s(cess)f(substitution)g(\(see)h(Section)g(3.5.6)h([Pro) +s(cess)e(Substitution],)630 4966 y(page)31 b(29\))h(if)e(the)h(op)s +(erating)f(system)h(pro)m(vides)f(the)h(necessary)g(supp)s(ort.)150 +5121 y Ft(--enable-progcomp)630 5230 y Fu(Enable)d(the)g(programmable)g +(completion)i(facilities)g(\(see)f(Section)g(8.6)g([Programmable)630 +5340 y(Completion],)i(page)h(124\).)42 b(If)30 b(Readline)h(is)f(not)h +(enabled,)f(this)h(option)g(has)f(no)g(e\013ect.)p eop +end +%%Page: 144 150 +TeXDict begin 144 149 bop 150 -116 a Fu(Chapter)30 b(10:)41 +b(Installing)31 b(Bash)2356 b(144)150 299 y Ft +(--enable-prompt-string-d)o(ecod)o(ing)630 408 y Fu(T)-8 +b(urn)30 b(on)i(the)f(in)m(terpretation)i(of)f(a)g(n)m(um)m(b)s(er)e +(of)i(bac)m(kslash-escap)s(ed)g(c)m(haracters)i(in)d(the)630 +518 y Ft($PS1)p Fu(,)36 b Ft($PS2)p Fu(,)g Ft($PS3)p +Fu(,)h(and)e Ft($PS4)f Fu(prompt)h(strings.)57 b(See)36 +b(Section)h(6.9)g([Con)m(trolling)g(the)630 628 y(Prompt],)30 +b(page)h(92,)h(for)e(a)h(complete)h(list)f(of)f(prompt)g(string)g +(escap)s(e)h(sequences.)150 787 y Ft(--enable-readline)630 +897 y Fu(Include)d(supp)s(ort)f(for)h(command-line)h(editing)g(and)f +(history)g(with)g(the)h(Bash)g(v)m(ersion)g(of)630 1006 +y(the)i(Readline)g(library)f(\(see)h(Chapter)f(8)g([Command)g(Line)g +(Editing],)h(page)g(101\).)150 1166 y Ft(--enable-restricted)630 +1275 y Fu(Include)41 b(supp)s(ort)f(for)i(a)g Fr(restricted)g(shell)p +Fu(.)75 b(If)42 b(this)f(is)h(enabled,)j(Bash,)g(when)c(called)630 +1385 y(as)f Ft(rbash)p Fu(,)h(en)m(ters)f(a)g(restricted)h(mo)s(de.)68 +b(See)40 b(Section)h(6.10)g([The)f(Restricted)h(Shell],)630 +1494 y(page)31 b(93,)h(for)e(a)g(description)h(of)f(restricted)h(mo)s +(de.)150 1654 y Ft(--enable-select)630 1763 y Fu(Include)25 +b(the)h Ft(select)f Fu(comp)s(ound)f(command,)j(whic)m(h)e(allo)m(ws)j +(the)e(generation)h(of)f(simple)630 1873 y(men)m(us)k(\(see)h(Section)g +(3.2.4.2)i([Conditional)e(Constructs],)g(page)g(10\).)150 +2032 y Ft(--enable-separate-helpfi)o(les)630 2142 y Fu(Use)h(external)h +(\014les)f(for)g(the)g(do)s(cumen)m(tation)h(displa)m(y)m(ed)f(b)m(y)g +(the)g Ft(help)f Fu(builtin)h(instead)630 2252 y(of)f(storing)f(the)h +(text)g(in)m(ternally)-8 b(.)150 2411 y Ft(--enable-single-help-str)o +(ings)630 2521 y Fu(Store)40 b(the)g(text)h(displa)m(y)m(ed)g(b)m(y)e +(the)i Ft(help)d Fu(builtin)i(as)g(a)g(single)h(string)f(for)f(eac)m(h) +i(help)630 2630 y(topic.)54 b(This)33 b(aids)i(in)f(translating)h(the)g +(text)g(to)g(di\013eren)m(t)g(languages.)54 b(Y)-8 b(ou)35 +b(ma)m(y)g(need)630 2740 y(to)c(disable)g(this)f(if)g(y)m(our)h +(compiler)g(cannot)f(handle)g(v)m(ery)h(long)g(string)f(literals.)150 +2899 y Ft(--enable-strict-posix-de)o(faul)o(t)630 3009 +y Fu(Mak)m(e)c(Bash)f Fm(posix)p Fu(-conforman)m(t)g(b)m(y)f(default)h +(\(see)g(Section)h(6.11)g([Bash)f(POSIX)e(Mo)s(de],)630 +3118 y(page)31 b(94\).)150 3278 y Ft(--enable-usg-echo-defaul)o(t)630 +3387 y Fu(A)f(synon)m(ym)g(for)g Ft(--enable-xpg-echo-default)p +Fu(.)150 3547 y Ft(--enable-xpg-echo-defaul)o(t)630 3656 +y Fu(Mak)m(e)c(the)f Ft(echo)e Fu(builtin)i(expand)f(bac)m +(kslash-escap)s(ed)h(c)m(haracters)h(b)m(y)f(default,)h(without)630 +3766 y(requiring)d(the)h Ft(-e)f Fu(option.)39 b(This)23 +b(sets)h(the)g(default)g(v)-5 b(alue)24 b(of)g(the)g +Ft(xpg_echo)e Fu(shell)h(option)630 3875 y(to)28 b Ft(on)p +Fu(,)g(whic)m(h)f(mak)m(es)h(the)g(Bash)f Ft(echo)f Fu(b)s(eha)m(v)m(e) +i(more)g(lik)m(e)h(the)e(v)m(ersion)h(sp)s(eci\014ed)f(in)g(the)630 +3985 y(Single)35 b(Unix)f(Sp)s(eci\014cation,)i(v)m(ersion)e(3.)53 +b(See)35 b(Section)g(4.2)g([Bash)g(Builtins],)h(page)f(48,)630 +4095 y(for)30 b(a)h(description)f(of)h(the)f(escap)s(e)h(sequences)g +(that)g Ft(echo)e Fu(recognizes.)275 4254 y(The)f(\014le)i +Ft(config-top.h)c Fu(con)m(tains)31 b(C)d(Prepro)s(cessor)h(`)p +Ft(#define)p Fu(')f(statemen)m(ts)j(for)f(options)f(whic)m(h)150 +4364 y(are)35 b(not)g(settable)i(from)d Ft(configure)p +Fu(.)51 b(Some)35 b(of)g(these)g(are)h(not)f(mean)m(t)g(to)h(b)s(e)e(c) +m(hanged;)k(b)s(ew)m(are)d(of)150 4473 y(the)h(consequences)g(if)f(y)m +(ou)h(do.)55 b(Read)36 b(the)g(commen)m(ts)g(asso)s(ciated)h(with)e +(eac)m(h)i(de\014nition)e(for)g(more)150 4583 y(information)c(ab)s(out) +f(its)h(e\013ect.)p eop end +%%Page: 145 151 +TeXDict begin 145 150 bop 150 -116 a Fu(App)s(endix)29 +b(A:)h(Rep)s(orting)h(Bugs)2299 b(145)150 299 y Fp(App)t(endix)52 +b(A)81 b(Rep)t(orting)53 b(Bugs)150 533 y Fu(Please)33 +b(rep)s(ort)e(all)h(bugs)f(y)m(ou)h(\014nd)e(in)i(Bash.)44 +b(But)32 b(\014rst,)g(y)m(ou)g(should)e(mak)m(e)j(sure)e(that)h(it)g +(really)h(is)f(a)150 643 y(bug,)d(and)g(that)h(it)g(app)s(ears)f(in)g +(the)h(latest)h(v)m(ersion)f(of)g(Bash.)40 b(The)29 b(latest)j(v)m +(ersion)e(of)f(Bash)h(is)f(alw)m(a)m(ys)150 752 y(a)m(v)-5 +b(ailable)33 b(for)d(FTP)g(from)g Ft(ftp://ftp.gnu.org/pub/gn)o(u/ba)o +(sh/)o Fu(.)275 887 y(Once)41 b(y)m(ou)g(ha)m(v)m(e)h(determined)f +(that)h(a)f(bug)g(actually)h(exists,)j(use)c(the)g Ft(bashbug)e +Fu(command)i(to)150 996 y(submit)25 b(a)h(bug)g(rep)s(ort.)38 +b(If)26 b(y)m(ou)g(ha)m(v)m(e)h(a)f(\014x,)h(y)m(ou)f(are)g(encouraged) +h(to)f(mail)h(that)f(as)g(w)m(ell!)40 b(Suggestions)150 +1106 y(and)j(`philosophical')i(bug)e(rep)s(orts)g(ma)m(y)i(b)s(e)e +(mailed)h(to)g Ft(bug-bash@gnu)11 b(.)d(org)40 b Fu(or)k(p)s(osted)f +(to)i(the)150 1215 y(Usenet)31 b(newsgroup)e Ft(gnu.bash.bug)p +Fu(.)275 1350 y(All)i(bug)e(rep)s(orts)h(should)f(include:)225 +1484 y Fq(\017)60 b Fu(The)30 b(v)m(ersion)h(n)m(um)m(b)s(er)e(of)h +(Bash.)225 1619 y Fq(\017)60 b Fu(The)30 b(hardw)m(are)g(and)g(op)s +(erating)g(system.)225 1753 y Fq(\017)60 b Fu(The)30 +b(compiler)h(used)e(to)i(compile)h(Bash.)225 1888 y Fq(\017)60 +b Fu(A)30 b(description)h(of)f(the)h(bug)f(b)s(eha)m(viour.)225 +2022 y Fq(\017)60 b Fu(A)30 b(short)h(script)f(or)g(`recip)s(e')h(whic) +m(h)f(exercises)i(the)e(bug)g(and)g(ma)m(y)h(b)s(e)f(used)f(to)i(repro) +s(duce)e(it.)150 2182 y Ft(bashbug)d Fu(inserts)i(the)h(\014rst)f +(three)g(items)h(automatically)i(in)m(to)f(the)e(template)i(it)f(pro)m +(vides)f(for)g(\014ling)h(a)150 2291 y(bug)h(rep)s(ort.)275 +2426 y(Please)h(send)f(all)h(rep)s(orts)f(concerning)g(this)h(man)m +(ual)f(to)h Ft(bug-bash@gnu.org)p Fu(.)p eop end +%%Page: 146 152 +TeXDict begin 146 151 bop 150 -116 a Fu(App)s(endix)29 +b(B:)i(Ma)5 b(jor)31 b(Di\013erences)g(F)-8 b(rom)31 +b(The)f(Bourne)g(Shell)1258 b(146)150 141 y Fp(App)t(endix)58 +b(B)81 b(Ma)9 b(jor)54 b(Di\013erences)d(F)-13 b(rom)54 +b(The)g(Bourne)1088 299 y(Shell)150 530 y Fu(Bash)26 +b(implemen)m(ts)h(essen)m(tially)g(the)g(same)f(grammar,)h(parameter)f +(and)g(v)-5 b(ariable)27 b(expansion,)g(redirec-)150 +640 y(tion,)i(and)e(quoting)g(as)h(the)g(Bourne)f(Shell.)40 +b(Bash)27 b(uses)g(the)h Fm(posix)f Fu(standard)f(as)i(the)g(sp)s +(eci\014cation)g(of)150 749 y(ho)m(w)34 b(these)h(features)g(are)g(to)g +(b)s(e)f(implemen)m(ted.)53 b(There)34 b(are)h(some)g(di\013erences)g +(b)s(et)m(w)m(een)g(the)g(tradi-)150 859 y(tional)e(Bourne)e(shell)h +(and)f(Bash;)i(this)f(section)g(quic)m(kly)h(details)g(the)e +(di\013erences)h(of)g(signi\014cance.)46 b(A)150 969 +y(n)m(um)m(b)s(er)24 b(of)h(these)h(di\013erences)f(are)h(explained)f +(in)g(greater)h(depth)f(in)g(previous)f(sections.)40 +b(This)25 b(section)150 1078 y(uses)33 b(the)i(v)m(ersion)f(of)g +Ft(sh)f Fu(included)g(in)h(SVR4.2)h(\(the)f(last)h(v)m(ersion)f(of)g +(the)g(historical)i(Bourne)d(shell\))150 1188 y(as)e(the)f(baseline)h +(reference.)225 1322 y Fq(\017)60 b Fu(Bash)32 b(is)h +Fm(posix)p Fu(-conforman)m(t,)g(ev)m(en)g(where)f(the)g +Fm(posix)g Fu(sp)s(eci\014cation)h(di\013ers)f(from)g(traditional)330 +1431 y Ft(sh)e Fu(b)s(eha)m(vior)g(\(see)i(Section)f(6.11)h([Bash)e +(POSIX)g(Mo)s(de],)h(page)g(94\).)225 1565 y Fq(\017)60 +b Fu(Bash)26 b(has)g(m)m(ulti-c)m(haracter)i(in)m(v)m(o)s(cation)g +(options)f(\(see)f(Section)h(6.1)g([In)m(v)m(oking)g(Bash],)h(page)e +(80\).)225 1699 y Fq(\017)60 b Fu(Bash)40 b(has)f(command-line)h +(editing)g(\(see)h(Chapter)e(8)h([Command)f(Line)g(Editing],)k(page)d +(101\))330 1809 y(and)30 b(the)g Ft(bind)g Fu(builtin.)225 +1943 y Fq(\017)60 b Fu(Bash)46 b(pro)m(vides)g(a)g(programmable)g(w)m +(ord)f(completion)i(mec)m(hanism)f(\(see)h(Section)g(8.6)g([Pro-)330 +2052 y(grammable)39 b(Completion],)i(page)e(124\),)i(and)d(builtin)g +(commands)f Ft(complete)p Fu(,)h Ft(compgen)p Fu(,)h(and)330 +2162 y Ft(compopt)p Fu(,)29 b(to)i(manipulate)g(it.)225 +2296 y Fq(\017)60 b Fu(Bash)26 b(has)f(command)h(history)f(\(see)i +(Section)f(9.1)h([Bash)f(History)h(F)-8 b(acilities],)30 +b(page)c(133\))i(and)d(the)330 2405 y Ft(history)k Fu(and)h +Ft(fc)g Fu(builtins)g(to)h(manipulate)g(it.)42 b(The)30 +b(Bash)h(history)g(list)g(main)m(tains)g(timestamp)330 +2515 y(information)g(and)e(uses)h(the)h(v)-5 b(alue)31 +b(of)f(the)h Ft(HISTTIMEFORMAT)26 b Fu(v)-5 b(ariable)32 +b(to)f(displa)m(y)f(it.)225 2649 y Fq(\017)60 b Fu(Bash)48 +b(implemen)m(ts)h Ft(csh)p Fu(-lik)m(e)g(history)f(expansion)g(\(see)h +(Section)g(9.3)h([History)f(In)m(teraction],)330 2759 +y(page)31 b(135\).)225 2892 y Fq(\017)60 b Fu(Bash)33 +b(has)g(one-dimensional)h(arra)m(y)f(v)-5 b(ariables)34 +b(\(see)g(Section)g(6.7)g([Arra)m(ys],)g(page)g(89\),)h(and)e(the)330 +3002 y(appropriate)39 b(v)-5 b(ariable)40 b(expansions)f(and)g +(assignmen)m(t)h(syn)m(tax)g(to)g(use)f(them.)67 b(Sev)m(eral)40 +b(of)g(the)330 3112 y(Bash)32 b(builtins)f(tak)m(e)j(options)e(to)h +(act)g(on)e(arra)m(ys.)46 b(Bash)32 b(pro)m(vides)g(a)g(n)m(um)m(b)s +(er)f(of)h(built-in)f(arra)m(y)330 3221 y(v)-5 b(ariables.)225 +3355 y Fq(\017)60 b Fu(The)37 b Ft($'...)n(')g Fu(quoting)g(syn)m(tax,) +j(whic)m(h)d(expands)f(ANSI-C)h(bac)m(kslash-escap)s(ed)h(c)m +(haracters)g(in)330 3465 y(the)26 b(text)h(b)s(et)m(w)m(een)g(the)g +(single)f(quotes,)i(is)e(supp)s(orted)f(\(see)i(Section)g(3.1.2.4)h +([ANSI-C)e(Quoting],)330 3574 y(page)31 b(6\).)225 3708 +y Fq(\017)60 b Fu(Bash)30 b(supp)s(orts)f(the)h Ft($"...)o(")f +Fu(quoting)i(syn)m(tax)g(to)f(do)g(lo)s(cale-sp)s(eci\014c)i +(translation)g(of)e(the)g(c)m(har-)330 3818 y(acters)g(b)s(et)m(w)m +(een)f(the)f(double)g(quotes.)41 b(The)28 b Ft(-D)p Fu(,)h +Ft(--dump-strings)p Fu(,)c(and)j Ft(--dump-po-strings)330 +3927 y Fu(in)m(v)m(o)s(cation)42 b(options)d(list)i(the)e(translatable) +i(strings)f(found)e(in)h(a)h(script)g(\(see)g(Section)g(3.1.2.5)330 +4037 y([Lo)s(cale)32 b(T)-8 b(ranslation],)31 b(page)h(7\).)225 +4171 y Fq(\017)60 b Fu(Bash)44 b(implemen)m(ts)g(the)f +Ft(!)h Fu(k)m(eyw)m(ord)g(to)g(negate)h(the)f(return)e(v)-5 +b(alue)44 b(of)g(a)g(pip)s(eline)f(\(see)h(Sec-)330 4281 +y(tion)33 b(3.2.2)i([Pip)s(elines],)f(page)g(8\).)49 +b(V)-8 b(ery)33 b(useful)f(when)g(an)h Ft(if)f Fu(statemen)m(t)j(needs) +d(to)i(act)g(only)f(if)330 4390 y(a)k(test)h(fails.)60 +b(The)36 b(Bash)g(`)p Ft(-o)30 b(pipefail)p Fu(')35 b(option)i(to)h +Ft(set)d Fu(will)i(cause)g(a)g(pip)s(eline)g(to)g(return)f(a)330 +4500 y(failure)31 b(status)f(if)h(an)m(y)f(command)g(fails.)225 +4634 y Fq(\017)60 b Fu(Bash)34 b(has)g(the)g Ft(time)f +Fu(reserv)m(ed)h(w)m(ord)g(and)f(command)h(timing)h(\(see)g(Section)g +(3.2.2)g([Pip)s(elines],)330 4743 y(page)g(8\).)52 b(The)33 +b(displa)m(y)i(of)f(the)g(timing)g(statistics)i(ma)m(y)f(b)s(e)e(con)m +(trolled)j(with)e(the)g Ft(TIMEFORMAT)330 4853 y Fu(v)-5 +b(ariable.)225 4987 y Fq(\017)60 b Fu(Bash)28 b(implemen)m(ts)g(the)f +Ft(for)j(\(\()g Fj(expr1)f Ft(;)h Fj(expr2)f Ft(;)h Fj(expr3)f +Ft(\)\))e Fu(arithmetic)h(for)g(command,)g(sim-)330 5096 +y(ilar)j(to)g(the)g(C)f(language)h(\(see)h(Section)f(3.2.4.1)i([Lo)s +(oping)d(Constructs],)h(page)g(10\).)225 5230 y Fq(\017)60 +b Fu(Bash)31 b(includes)f(the)g Ft(select)f Fu(comp)s(ound)g(command,)i +(whic)m(h)f(allo)m(ws)i(the)f(generation)g(of)g(simple)330 +5340 y(men)m(us)f(\(see)h(Section)g(3.2.4.2)i([Conditional)e +(Constructs],)g(page)g(10\).)p eop end +%%Page: 147 153 +TeXDict begin 147 152 bop 150 -116 a Fu(App)s(endix)29 +b(B:)i(Ma)5 b(jor)31 b(Di\013erences)g(F)-8 b(rom)31 +b(The)f(Bourne)g(Shell)1258 b(147)225 299 y Fq(\017)60 +b Fu(Bash)40 b(includes)g(the)g Ft([[)g Fu(comp)s(ound)e(command,)43 +b(whic)m(h)c(mak)m(es)i(conditional)h(testing)f(part)f(of)330 +408 y(the)f(shell)g(grammar)g(\(see)h(Section)f(3.2.4.2)j([Conditional) +d(Constructs],)i(page)f(10\),)i(including)330 518 y(optional)32 +b(regular)e(expression)g(matc)m(hing.)225 653 y Fq(\017)60 +b Fu(Bash)31 b(pro)m(vides)f(optional)h(case-insensitiv)m(e)i(matc)m +(hing)f(for)e(the)g Ft(case)g Fu(and)f Ft([[)h Fu(constructs.)225 +789 y Fq(\017)60 b Fu(Bash)27 b(includes)g(brace)h(expansion)f(\(see)h +(Section)g(3.5.1)i([Brace)e(Expansion],)g(page)g(21\))h(and)d(tilde)330 +898 y(expansion)k(\(see)i(Section)f(3.5.2)h([Tilde)f(Expansion],)f +(page)h(22\).)225 1034 y Fq(\017)60 b Fu(Bash)24 b(implemen)m(ts)h +(command)e(aliases)j(and)d(the)i Ft(alias)d Fu(and)i +Ft(unalias)e Fu(builtins)h(\(see)i(Section)g(6.6)330 +1143 y([Aliases],)32 b(page)f(88\).)225 1279 y Fq(\017)60 +b Fu(Bash)32 b(pro)m(vides)g(shell)g(arithmetic,)i(the)e +Ft(\(\()g Fu(comp)s(ound)e(command)i(\(see)h(Section)f(3.2.4.2)j([Con-) +330 1388 y(ditional)d(Constructs],)e(page)i(10\),)g(and)e(arithmetic)i +(expansion)e(\(see)i(Section)f(6.5)h([Shell)f(Arith-)330 +1498 y(metic],)h(page)f(87\).)225 1633 y Fq(\017)60 b +Fu(V)-8 b(ariables)31 b(presen)m(t)e(in)g(the)g(shell's)h(initial)g(en) +m(vironmen)m(t)g(are)g(automatically)i(exp)s(orted)d(to)h(c)m(hild)330 +1743 y(pro)s(cesses.)38 b(The)23 b(Bourne)g(shell)g(do)s(es)g(not)g +(normally)g(do)g(this)g(unless)g(the)g(v)-5 b(ariables)24 +b(are)f(explicitly)330 1852 y(mark)m(ed)30 b(using)g(the)h +Ft(export)e Fu(command.)225 1988 y Fq(\017)60 b Fu(Bash)26 +b(supp)s(orts)d(the)j(`)p Ft(+=)p Fu(')f(assignmen)m(t)i(op)s(erator,)g +(whic)m(h)e(app)s(ends)f(to)i(the)g(v)-5 b(alue)26 b(of)f(the)h(v)-5 +b(ariable)330 2097 y(named)30 b(on)g(the)h(left)g(hand)e(side.)225 +2233 y Fq(\017)60 b Fu(Bash)36 b(includes)g(the)g Fm(posix)f +Fu(pattern)h(remo)m(v)-5 b(al)37 b(`)p Ft(\045)p Fu(',)h(`)p +Ft(#)p Fu(',)g(`)p Ft(\045\045)p Fu(')e(and)f(`)p Ft(##)p +Fu(')h(expansions)g(to)g(remo)m(v)m(e)330 2342 y(leading)f(or)f +(trailing)h(substrings)e(from)g(v)-5 b(ariable)35 b(v)-5 +b(alues)35 b(\(see)g(Section)g(3.5.3)g([Shell)g(P)m(arameter)330 +2452 y(Expansion],)30 b(page)h(23\).)225 2587 y Fq(\017)60 +b Fu(The)46 b(expansion)g Ft(${#xx})p Fu(,)j(whic)m(h)d(returns)f(the)i +(length)f(of)h Ft(${xx})p Fu(,)i(is)e(supp)s(orted)d(\(see)j(Sec-)330 +2697 y(tion)31 b(3.5.3)h([Shell)f(P)m(arameter)g(Expansion],)f(page)i +(23\).)225 2832 y Fq(\017)60 b Fu(The)30 b(expansion)g +Ft(${var:)p Fr(o\013set)r Ft([:)p Fr(length)p Ft(]})p +Fu(,)g(whic)m(h)g(expands)g(to)h(the)g(substring)e(of)i +Ft(var)p Fu('s)e(v)-5 b(alue)330 2942 y(of)43 b(length)g +Fr(length)p Fu(,)k(b)s(eginning)42 b(at)i Fr(o\013set)p +Fu(,)j(is)c(presen)m(t)g(\(see)g(Section)h(3.5.3)h([Shell)e(P)m +(arameter)330 3051 y(Expansion],)30 b(page)h(23\).)225 +3187 y Fq(\017)60 b Fu(The)21 b(expansion)f Ft(${var/[/])p +Fr(pattern)p Ft([/)p Fr(replacemen)m(t)r Ft(]})p Fu(,)i(whic)m(h)e +(matc)m(hes)j Fr(pattern)e Fu(and)f(replaces)330 3296 +y(it)29 b(with)e Fr(replacemen)m(t)32 b Fu(in)c(the)g(v)-5 +b(alue)29 b(of)f Ft(var)p Fu(,)g(is)g(a)m(v)-5 b(ailable)31 +b(\(see)e(Section)f(3.5.3)i([Shell)f(P)m(arameter)330 +3406 y(Expansion],)h(page)h(23\).)225 3541 y Fq(\017)60 +b Fu(The)33 b(expansion)g Ft(${!)p Fj(prefix)p Ft(*})d +Fu(expansion,)k(whic)m(h)e(expands)h(to)h(the)f(names)g(of)g(all)h +(shell)f(v)-5 b(ari-)330 3651 y(ables)36 b(whose)g(names)g(b)s(egin)g +(with)g Fr(pre\014x)p Fu(,)g(is)g(a)m(v)-5 b(ailable)39 +b(\(see)e(Section)g(3.5.3)g([Shell)g(P)m(arameter)330 +3761 y(Expansion],)30 b(page)h(23\).)225 3896 y Fq(\017)60 +b Fu(Bash)22 b(has)f Fr(indirect)j Fu(v)-5 b(ariable)22 +b(expansion)g(using)f Ft(${!word})e Fu(\(see)k(Section)f(3.5.3)i +([Shell)e(P)m(arameter)330 4006 y(Expansion],)30 b(page)h(23\).)225 +4141 y Fq(\017)60 b Fu(Bash)31 b(can)f(expand)g(p)s(ositional)h +(parameters)g(b)s(ey)m(ond)e Ft($9)h Fu(using)g Ft(${)p +Fj(num)p Ft(})p Fu(.)225 4276 y Fq(\017)60 b Fu(The)27 +b Fm(posix)g Ft($\(\))g Fu(form)g(of)h(command)g(substitution)f(is)h +(implemen)m(ted)g(\(see)h(Section)f(3.5.4)i([Com-)330 +4386 y(mand)38 b(Substitution],)k(page)e(28\),)j(and)38 +b(preferred)g(to)i(the)g(Bourne)f(shell's)h Ft(``)e Fu(\(whic)m(h)i(is) +f(also)330 4495 y(implemen)m(ted)31 b(for)f(bac)m(kw)m(ards)h +(compatibilit)m(y\).)225 4631 y Fq(\017)60 b Fu(Bash)31 +b(has)f(pro)s(cess)g(substitution)g(\(see)h(Section)g(3.5.6)h([Pro)s +(cess)f(Substitution],)f(page)h(29\).)225 4766 y Fq(\017)60 +b Fu(Bash)55 b(automatically)j(assigns)e(v)-5 b(ariables)55 +b(that)h(pro)m(vide)f(information)h(ab)s(out)f(the)g(curren)m(t)330 +4876 y(user)40 b(\()p Ft(UID)p Fu(,)i Ft(EUID)p Fu(,)g(and)e +Ft(GROUPS)p Fu(\),)h(the)g(curren)m(t)f(host)g(\()p Ft(HOSTTYPE)p +Fu(,)h Ft(OSTYPE)p Fu(,)h Ft(MACHTYPE)p Fu(,)f(and)330 +4985 y Ft(HOSTNAME)p Fu(\),)55 b(and)c(the)g(instance)h(of)g(Bash)f +(that)h(is)f(running)f(\()p Ft(BASH)p Fu(,)56 b Ft(BASH_VERSION)p +Fu(,)e(and)330 5095 y Ft(BASH_VERSINFO)p Fu(\).)37 b(See)31 +b(Section)g(5.2)h([Bash)e(V)-8 b(ariables],)33 b(page)e(69,)g(for)f +(details.)225 5230 y Fq(\017)60 b Fu(The)44 b Ft(IFS)f +Fu(v)-5 b(ariable)45 b(is)f(used)f(to)i(split)f(only)g(the)g(results)g +(of)h(expansion,)i(not)d(all)h(w)m(ords)f(\(see)330 5340 +y(Section)29 b(3.5.7)h([W)-8 b(ord)29 b(Splitting],)h(page)f(29\).)41 +b(This)28 b(closes)h(a)g(longstanding)g(shell)f(securit)m(y)h(hole.)p +eop end +%%Page: 148 154 +TeXDict begin 148 153 bop 150 -116 a Fu(App)s(endix)29 +b(B:)i(Ma)5 b(jor)31 b(Di\013erences)g(F)-8 b(rom)31 +b(The)f(Bourne)g(Shell)1258 b(148)225 299 y Fq(\017)60 +b Fu(The)36 b(\014lename)h(expansion)f(brac)m(k)m(et)i(expression)f(co) +s(de)f(uses)g(`)p Ft(!)p Fu(')h(and)f(`)p Ft(^)p Fu(')h(to)g(negate)h +(the)f(set)g(of)330 408 y(c)m(haracters)32 b(b)s(et)m(w)m(een)f(the)f +(brac)m(k)m(ets.)43 b(The)29 b(Bourne)i(shell)f(uses)g(only)h(`)p +Ft(!)p Fu('.)225 536 y Fq(\017)60 b Fu(Bash)38 b(implemen)m(ts)g(the)g +(full)g(set)g(of)g Fm(posix)f Fu(\014lename)h(expansion)g(op)s +(erators,)i(including)d Fr(c)m(har-)330 646 y(acter)i(classes)p +Fu(,)j Fr(equiv)-5 b(alence)39 b(classes)p Fu(,)j(and)37 +b Fr(collating)k(sym)m(b)s(ols)g Fu(\(see)e(Section)g(3.5.8)h +([Filename)330 756 y(Expansion],)30 b(page)h(30\).)225 +883 y Fq(\017)60 b Fu(Bash)35 b(implemen)m(ts)g(extended)g(pattern)g +(matc)m(hing)h(features)f(when)f(the)h Ft(extglob)d Fu(shell)j(option) +330 993 y(is)30 b(enabled)h(\(see)g(Section)g(3.5.8.1)i([P)m(attern)f +(Matc)m(hing],)g(page)f(30\).)225 1121 y Fq(\017)60 b +Fu(It)22 b(is)g(p)s(ossible)g(to)h(ha)m(v)m(e)g(a)f(v)-5 +b(ariable)23 b(and)f(a)g(function)g(with)g(the)g(same)g(name;)j +Ft(sh)d Fu(do)s(es)g(not)g(separate)330 1230 y(the)31 +b(t)m(w)m(o)g(name)g(spaces.)225 1358 y Fq(\017)60 b +Fu(Bash)30 b(functions)e(are)i(p)s(ermitted)f(to)h(ha)m(v)m(e)h(lo)s +(cal)g(v)-5 b(ariables)30 b(using)f(the)g Ft(local)f +Fu(builtin,)i(and)e(th)m(us)330 1468 y(useful)i(recursiv)m(e)g +(functions)g(ma)m(y)h(b)s(e)f(written)g(\(see)i(Section)f(4.2)g([Bash)g +(Builtins],)g(page)h(48\).)225 1596 y Fq(\017)60 b Fu(V)-8 +b(ariable)25 b(assignmen)m(ts)g(preceding)e(commands)h(a\013ect)h(only) +f(that)g(command,)h(ev)m(en)f(builtins)g(and)330 1705 +y(functions)36 b(\(see)h(Section)g(3.7.4)h([En)m(vironmen)m(t],)h(page) +e(37\).)60 b(In)35 b Ft(sh)p Fu(,)j(all)f(v)-5 b(ariable)37 +b(assignmen)m(ts)330 1815 y(preceding)30 b(commands)g(are)h(global)h +(unless)d(the)i(command)f(is)h(executed)g(from)f(the)g(\014le)h +(system.)225 1943 y Fq(\017)60 b Fu(Bash)44 b(p)s(erforms)e(\014lename) +i(expansion)f(on)h(\014lenames)g(sp)s(eci\014ed)f(as)h(op)s(erands)e +(to)j(input)e(and)330 2052 y(output)30 b(redirection)h(op)s(erators)g +(\(see)g(Section)g(3.6)h([Redirections],)g(page)f(31\).)225 +2180 y Fq(\017)60 b Fu(Bash)29 b(con)m(tains)h(the)f(`)p +Ft(<>)p Fu(')f(redirection)i(op)s(erator,)f(allo)m(wing)i(a)e(\014le)g +(to)g(b)s(e)f(op)s(ened)g(for)h(b)s(oth)f(read-)330 2290 +y(ing)35 b(and)f(writing,)i(and)e(the)h(`)p Ft(&>)p Fu(')g(redirection) +g(op)s(erator,)h(for)f(directing)g(standard)f(output)h(and)330 +2399 y(standard)30 b(error)g(to)h(the)f(same)h(\014le)f(\(see)i +(Section)f(3.6)g([Redirections],)h(page)g(31\).)225 2527 +y Fq(\017)60 b Fu(Bash)21 b(includes)f(the)h(`)p Ft(<<<)p +Fu(')g(redirection)g(op)s(erator,)i(allo)m(wing)g(a)e(string)f(to)i(b)s +(e)e(used)g(as)h(the)g(standard)330 2637 y(input)29 b(to)j(a)e +(command.)225 2765 y Fq(\017)60 b Fu(Bash)32 b(implemen)m(ts)f(the)h(`) +p Ft([n]<&)p Fj(word)p Fu(')d(and)i(`)p Ft([n]>&)p Fj(word)p +Fu(')e(redirection)j(op)s(erators,)g(whic)m(h)f(mo)m(v)m(e)330 +2874 y(one)g(\014le)f(descriptor)g(to)h(another.)225 +3002 y Fq(\017)60 b Fu(Bash)25 b(treats)h(a)f(n)m(um)m(b)s(er)e(of)i +(\014lenames)g(sp)s(ecially)g(when)f(they)h(are)g(used)f(in)g +(redirection)i(op)s(erators)330 3112 y(\(see)31 b(Section)h(3.6)f +([Redirections],)h(page)f(31\).)225 3240 y Fq(\017)60 +b Fu(Bash)33 b(can)f(op)s(en)g(net)m(w)m(ork)i(connections)f(to)h +(arbitrary)e(mac)m(hines)h(and)f(services)h(with)f(the)h(redi-)330 +3349 y(rection)e(op)s(erators)g(\(see)g(Section)g(3.6)h +([Redirections],)g(page)f(31\).)225 3477 y Fq(\017)60 +b Fu(The)29 b Ft(noclobber)e Fu(option)j(is)g(a)m(v)-5 +b(ailable)32 b(to)e(a)m(v)m(oid)h(o)m(v)m(erwriting)g(existing)g +(\014les)e(with)h(output)f(redi-)330 3587 y(rection)39 +b(\(see)h(Section)f(4.3.1)h([The)e(Set)h(Builtin],)i(page)e(58\).)66 +b(The)38 b(`)p Ft(>|)p Fu(')h(redirection)g(op)s(erator)330 +3696 y(ma)m(y)31 b(b)s(e)f(used)f(to)i(o)m(v)m(erride)h +Ft(noclobber)p Fu(.)225 3824 y Fq(\017)60 b Fu(The)34 +b(Bash)g Ft(cd)g Fu(and)f Ft(pwd)g Fu(builtins)h(\(see)h(Section)g(4.1) +g([Bourne)g(Shell)f(Builtins],)h(page)g(41\))h(eac)m(h)330 +3934 y(tak)m(e)c Ft(-L)e Fu(and)f Ft(-P)h Fu(options)h(to)g(switc)m(h)g +(b)s(et)m(w)m(een)g(logical)i(and)c(ph)m(ysical)i(mo)s(des.)225 +4061 y Fq(\017)60 b Fu(Bash)25 b(allo)m(ws)h(a)g(function)e(to)i(o)m(v) +m(erride)g(a)g(builtin)e(with)h(the)g(same)g(name,)i(and)d(pro)m(vides) +h(access)h(to)330 4171 y(that)34 b(builtin's)f(functionalit)m(y)h +(within)f(the)g(function)g(via)h(the)f Ft(builtin)f Fu(and)g +Ft(command)g Fu(builtins)330 4281 y(\(see)f(Section)h(4.2)f([Bash)g +(Builtins],)g(page)g(48\).)225 4408 y Fq(\017)60 b Fu(The)35 +b Ft(command)e Fu(builtin)i(allo)m(ws)i(selectiv)m(e)h(disabling)e(of)f +(functions)g(when)g(command)g(lo)s(okup)g(is)330 4518 +y(p)s(erformed)29 b(\(see)i(Section)g(4.2)h([Bash)f(Builtins],)g(page)g +(48\).)225 4646 y Fq(\017)60 b Fu(Individual)23 b(builtins)g(ma)m(y)i +(b)s(e)e(enabled)h(or)g(disabled)g(using)f(the)h Ft(enable)f +Fu(builtin)g(\(see)i(Section)g(4.2)330 4756 y([Bash)31 +b(Builtins],)g(page)g(48\).)225 4883 y Fq(\017)60 b Fu(The)26 +b(Bash)h Ft(exec)e Fu(builtin)h(tak)m(es)i(additional)f(options)g(that) +g(allo)m(w)h(users)d(to)j(con)m(trol)g(the)e(con)m(ten)m(ts)330 +4993 y(of)35 b(the)f(en)m(vironmen)m(t)h(passed)f(to)h(the)g(executed)g +(command,)h(and)d(what)i(the)f(zeroth)h(argumen)m(t)330 +5103 y(to)c(the)g(command)f(is)g(to)h(b)s(e)f(\(see)h(Section)h(4.1)f +([Bourne)f(Shell)h(Builtins],)g(page)g(41\).)225 5230 +y Fq(\017)60 b Fu(Shell)29 b(functions)g(ma)m(y)h(b)s(e)f(exp)s(orted)g +(to)h(c)m(hildren)f(via)h(the)g(en)m(vironmen)m(t)g(using)f +Ft(export)f(-f)h Fu(\(see)330 5340 y(Section)i(3.3)h([Shell)e(F)-8 +b(unctions],)32 b(page)f(17\).)p eop end +%%Page: 149 155 +TeXDict begin 149 154 bop 150 -116 a Fu(App)s(endix)29 +b(B:)i(Ma)5 b(jor)31 b(Di\013erences)g(F)-8 b(rom)31 +b(The)f(Bourne)g(Shell)1258 b(149)225 299 y Fq(\017)60 +b Fu(The)40 b(Bash)h Ft(export)p Fu(,)h Ft(readonly)p +Fu(,)f(and)g Ft(declare)d Fu(builtins)j(can)g(tak)m(e)h(a)f +Ft(-f)f Fu(option)i(to)f(act)h(on)330 408 y(shell)30 +b(functions,)f(a)h Ft(-p)f Fu(option)g(to)i(displa)m(y)e(v)-5 +b(ariables)30 b(with)f(v)-5 b(arious)30 b(attributes)g(set)g(in)f(a)h +(format)330 518 y(that)g(can)g(b)s(e)f(used)g(as)g(shell)h(input,)f(a)h +Ft(-n)f Fu(option)h(to)g(remo)m(v)m(e)h(v)-5 b(arious)30 +b(v)-5 b(ariable)30 b(attributes,)h(and)330 628 y(`)p +Ft(name=value)p Fu(')d(argumen)m(ts)j(to)g(set)g(v)-5 +b(ariable)31 b(attributes)g(and)f(v)-5 b(alues)30 b(sim)m(ultaneously) +-8 b(.)225 765 y Fq(\017)60 b Fu(The)42 b(Bash)h Ft(hash)f +Fu(builtin)g(allo)m(ws)j(a)e(name)g(to)g(b)s(e)f(asso)s(ciated)j(with)d +(an)h(arbitrary)f(\014lename,)330 874 y(ev)m(en)30 b(when)e(that)h +(\014lename)g(cannot)h(b)s(e)e(found)g(b)m(y)h(searc)m(hing)g(the)g +Ft($PATH)p Fu(,)g(using)f(`)p Ft(hash)h(-p)p Fu(')g(\(see)330 +984 y(Section)i(4.1)h([Bourne)e(Shell)g(Builtins],)h(page)h(41\).)225 +1121 y Fq(\017)60 b Fu(Bash)27 b(includes)f(a)i Ft(help)d +Fu(builtin)i(for)f(quic)m(k)h(reference)h(to)f(shell)g(facilities)i +(\(see)f(Section)g(4.2)g([Bash)330 1230 y(Builtins],)j(page)g(48\).)225 +1367 y Fq(\017)60 b Fu(The)42 b Ft(printf)g Fu(builtin)g(is)h(a)m(v)-5 +b(ailable)45 b(to)f(displa)m(y)f(formatted)g(output)g(\(see)h(Section)g +(4.2)g([Bash)330 1477 y(Builtins],)31 b(page)g(48\).)225 +1614 y Fq(\017)60 b Fu(The)26 b(Bash)h Ft(read)f Fu(builtin)g(\(see)i +(Section)g(4.2)g([Bash)f(Builtins],)h(page)g(48\))g(will)f(read)g(a)g +(line)g(ending)330 1724 y(in)i(`)p Ft(\\)p Fu(')h(with)f(the)g +Ft(-r)g Fu(option,)i(and)d(will)i(use)f(the)h Ft(REPLY)e +Fu(v)-5 b(ariable)30 b(as)g(a)f(default)h(if)f(no)h(non-option)330 +1833 y(argumen)m(ts)h(are)h(supplied.)42 b(The)30 b(Bash)i +Ft(read)e Fu(builtin)g(also)j(accepts)f(a)g(prompt)e(string)h(with)g +(the)330 1943 y Ft(-p)c Fu(option)h(and)f(will)g(use)h(Readline)g(to)g +(obtain)g(the)g(line)f(when)g(giv)m(en)h(the)g Ft(-e)f +Fu(option.)40 b(The)27 b Ft(read)330 2052 y Fu(builtin)h(also)i(has)e +(additional)i(options)f(to)g(con)m(trol)h(input:)39 b(the)29 +b Ft(-s)f Fu(option)h(will)g(turn)e(o\013)j(ec)m(hoing)330 +2162 y(of)f(input)f(c)m(haracters)j(as)e(they)g(are)h(read,)f(the)g +Ft(-t)g Fu(option)g(will)h(allo)m(w)g Ft(read)e Fu(to)i(time)g(out)f +(if)g(input)330 2271 y(do)s(es)i(not)h(arriv)m(e)g(within)f(a)h(sp)s +(eci\014ed)f(n)m(um)m(b)s(er)f(of)i(seconds,)g(the)f +Ft(-n)g Fu(option)h(will)g(allo)m(w)h(reading)330 2381 +y(only)38 b(a)g(sp)s(eci\014ed)f(n)m(um)m(b)s(er)f(of)i(c)m(haracters)h +(rather)e(than)g(a)h(full)g(line,)i(and)d(the)h Ft(-d)f +Fu(option)h(will)330 2491 y(read)30 b(un)m(til)h(a)g(particular)f(c)m +(haracter)i(rather)f(than)f(newline.)225 2628 y Fq(\017)60 +b Fu(The)33 b Ft(return)e Fu(builtin)i(ma)m(y)g(b)s(e)g(used)f(to)i(ab) +s(ort)f(execution)h(of)f(scripts)g(executed)h(with)f(the)g +Ft(.)g Fu(or)330 2737 y Ft(source)c Fu(builtins)g(\(see)j(Section)f +(4.1)g([Bourne)g(Shell)f(Builtins],)h(page)g(41\).)225 +2874 y Fq(\017)60 b Fu(Bash)43 b(includes)g(the)g Ft(shopt)f +Fu(builtin,)k(for)d(\014ner)f(con)m(trol)j(of)e(shell)h(optional)g +(capabilities)h(\(see)330 2984 y(Section)c(4.3.2)g([The)f(Shopt)f +(Builtin],)k(page)d(62\),)k(and)39 b(allo)m(ws)i(these)f(options)h(to)f +(b)s(e)f(set)i(and)330 3093 y(unset)30 b(at)h(shell)g(in)m(v)m(o)s +(cation)h(\(see)f(Section)h(6.1)f([In)m(v)m(oking)g(Bash],)g(page)h +(80\).)225 3230 y Fq(\017)60 b Fu(Bash)45 b(has)f(m)m(uc)m(h)g(more)h +(optional)h(b)s(eha)m(vior)e(con)m(trollable)j(with)e(the)f +Ft(set)g Fu(builtin)g(\(see)h(Sec-)330 3340 y(tion)31 +b(4.3.1)h([The)e(Set)h(Builtin],)g(page)g(58\).)225 3477 +y Fq(\017)60 b Fu(The)31 b(`)p Ft(-x)p Fu(')g(\()p Ft(xtrace)p +Fu(\))g(option)h(displa)m(ys)f(commands)h(other)f(than)h(simple)f +(commands)g(when)g(p)s(er-)330 3587 y(forming)f(an)g(execution)i(trace) +f(\(see)h(Section)f(4.3.1)h([The)e(Set)h(Builtin],)g(page)g(58\).)225 +3724 y Fq(\017)60 b Fu(The)28 b Ft(test)g Fu(builtin)h(\(see)h(Section) +f(4.1)h([Bourne)f(Shell)g(Builtins],)h(page)g(41\))g(is)f(sligh)m(tly)h +(di\013eren)m(t,)330 3833 y(as)23 b(it)g(implemen)m(ts)f(the)h +Fm(posix)f Fu(algorithm,)j(whic)m(h)d(sp)s(eci\014es)g(the)h(b)s(eha)m +(vior)f(based)g(on)h(the)f(n)m(um)m(b)s(er)330 3943 y(of)31 +b(argumen)m(ts.)225 4080 y Fq(\017)60 b Fu(Bash)31 b(includes)g(the)h +Ft(caller)d Fu(builtin,)j(whic)m(h)f(displa)m(ys)g(the)g(con)m(text)i +(of)f(an)m(y)g(activ)m(e)h(subroutine)330 4189 y(call)28 +b(\(a)f(shell)f(function)h(or)f(a)h(script)f(executed)h(with)f(the)h +Ft(.)f Fu(or)g Ft(source)f Fu(builtins\).)39 b(This)26 +b(supp)s(orts)330 4299 y(the)31 b(bash)e(debugger.)225 +4436 y Fq(\017)60 b Fu(The)42 b Ft(trap)f Fu(builtin)h(\(see)i(Section) +f(4.1)h([Bourne)e(Shell)g(Builtins],)47 b(page)c(41\))h(allo)m(ws)g(a)e +Ft(DEBUG)330 4545 y Fu(pseudo-signal)c(sp)s(eci\014cation,)i(similar)e +(to)g Ft(EXIT)p Fu(.)62 b(Commands)36 b(sp)s(eci\014ed)h(with)g(a)h +Ft(DEBUG)e Fu(trap)330 4655 y(are)k(executed)g(b)s(efore)f(ev)m(ery)h +(simple)f(command,)j Ft(for)c Fu(command,)k Ft(case)c +Fu(command,)k Ft(select)330 4765 y Fu(command,)35 b(ev)m(ery)g +(arithmetic)g Ft(for)e Fu(command,)i(and)f(b)s(efore)g(the)g(\014rst)f +(command)h(executes)h(in)330 4874 y(a)29 b(shell)g(function.)40 +b(The)28 b Ft(DEBUG)g Fu(trap)g(is)h(not)g(inherited)f(b)m(y)h(shell)g +(functions)f(unless)g(the)h(function)330 4984 y(has)35 +b(b)s(een)g(giv)m(en)i(the)f Ft(trace)e Fu(attribute)i(or)g(the)g +Ft(functrace)d Fu(option)j(has)f(b)s(een)g(enabled)g(using)330 +5093 y(the)28 b Ft(shopt)e Fu(builtin.)39 b(The)27 b +Ft(extdebug)f Fu(shell)i(option)g(has)f(additional)h(e\013ects)h(on)f +(the)g Ft(DEBUG)e Fu(trap.)330 5230 y(The)21 b Ft(trap)e +Fu(builtin)i(\(see)h(Section)g(4.1)g([Bourne)f(Shell)g(Builtins],)j +(page)e(41\))g(allo)m(ws)g(an)f Ft(ERR)f Fu(pseudo-)330 +5340 y(signal)30 b(sp)s(eci\014cation,)h(similar)f(to)g +Ft(EXIT)f Fu(and)g Ft(DEBUG)p Fu(.)39 b(Commands)28 b(sp)s(eci\014ed)h +(with)g(an)g Ft(ERR)g Fu(trap)p eop end +%%Page: 150 156 +TeXDict begin 150 155 bop 150 -116 a Fu(App)s(endix)29 +b(B:)i(Ma)5 b(jor)31 b(Di\013erences)g(F)-8 b(rom)31 +b(The)f(Bourne)g(Shell)1258 b(150)330 299 y(are)40 b(executed)g(after)g +(a)f(simple)h(command)f(fails,)j(with)d(a)h(few)f(exceptions.)68 +b(The)39 b Ft(ERR)g Fu(trap)g(is)330 408 y(not)g(inherited)f(b)m(y)h +(shell)g(functions)f(unless)g(the)h Ft(-o)29 b(errtrace)37 +b Fu(option)i(to)g(the)g Ft(set)f Fu(builtin)g(is)330 +518 y(enabled.)330 650 y(The)g Ft(trap)g Fu(builtin)h(\(see)g(Section)h +(4.1)g([Bourne)f(Shell)g(Builtins],)i(page)f(41\))g(allo)m(ws)g(a)g +Ft(RETURN)330 760 y Fu(pseudo-signal)35 b(sp)s(eci\014cation,)j +(similar)d(to)h Ft(EXIT)e Fu(and)g Ft(DEBUG)p Fu(.)54 +b(Commands)34 b(sp)s(eci\014ed)g(with)h(an)330 869 y +Ft(RETURN)k Fu(trap)i(are)g(executed)h(b)s(efore)e(execution)i(resumes) +e(after)h(a)g(shell)g(function)g(or)g(a)g(shell)330 979 +y(script)36 b(executed)g(with)g Ft(.)f Fu(or)h Ft(source)e +Fu(returns.)56 b(The)35 b Ft(RETURN)f Fu(trap)i(is)g(not)g(inherited)f +(b)m(y)h(shell)330 1088 y(functions)k(unless)h(the)g(function)f(has)h +(b)s(een)f(giv)m(en)i(the)f Ft(trace)e Fu(attribute)j(or)e(the)h +Ft(functrace)330 1198 y Fu(option)31 b(has)f(b)s(een)g(enabled)g(using) +g(the)g Ft(shopt)f Fu(builtin.)225 1330 y Fq(\017)60 +b Fu(The)30 b(Bash)g Ft(type)f Fu(builtin)h(is)g(more)g(extensiv)m(e)i +(and)d(giv)m(es)j(more)e(information)h(ab)s(out)f(the)g(names)330 +1440 y(it)h(\014nds)e(\(see)i(Section)g(4.2)h([Bash)e(Builtins],)i +(page)f(48\).)225 1571 y Fq(\017)60 b Fu(The)27 b(Bash)h +Ft(umask)e Fu(builtin)h(p)s(ermits)g(a)h Ft(-p)f Fu(option)h(to)h +(cause)f(the)g(output)f(to)h(b)s(e)f(displa)m(y)m(ed)h(in)g(the)330 +1681 y(form)i(of)h(a)g Ft(umask)f Fu(command)g(that)i(ma)m(y)f(b)s(e)f +(reused)g(as)h(input)f(\(see)i(Section)f(4.1)h([Bourne)f(Shell)330 +1791 y(Builtins],)g(page)g(41\).)225 1923 y Fq(\017)60 +b Fu(Bash)34 b(implemen)m(ts)h(a)g Ft(csh)p Fu(-lik)m(e)g(directory)f +(stac)m(k,)j(and)d(pro)m(vides)g(the)g Ft(pushd)p Fu(,)g +Ft(popd)p Fu(,)g(and)g Ft(dirs)330 2032 y Fu(builtins)g(to)i +(manipulate)f(it)h(\(see)f(Section)h(6.8)g([The)f(Directory)h(Stac)m +(k],)i(page)d(90\).)56 b(Bash)35 b(also)330 2142 y(mak)m(es)c(the)g +(directory)g(stac)m(k)g(visible)g(as)g(the)f(v)-5 b(alue)31 +b(of)g(the)f Ft(DIRSTACK)f Fu(shell)h(v)-5 b(ariable.)225 +2274 y Fq(\017)60 b Fu(Bash)28 b(in)m(terprets)h(sp)s(ecial)g(bac)m +(kslash-escap)s(ed)g(c)m(haracters)g(in)f(the)h(prompt)e(strings)h +(when)f(in)m(ter-)330 2383 y(activ)m(e)33 b(\(see)e(Section)g(6.9)h +([Con)m(trolling)f(the)g(Prompt],)f(page)h(92\).)225 +2515 y Fq(\017)60 b Fu(The)46 b(Bash)h(restricted)g(mo)s(de)f(is)h +(more)f(useful)g(\(see)h(Section)h(6.10)g([The)e(Restricted)i(Shell],) +330 2625 y(page)31 b(93\);)h(the)f(SVR4.2)g(shell)f(restricted)h(mo)s +(de)f(is)h(to)s(o)g(limited.)225 2757 y Fq(\017)60 b +Fu(The)30 b Ft(disown)f Fu(builtin)h(can)h(remo)m(v)m(e)h(a)f(job)f +(from)g(the)h(in)m(ternal)g(shell)g(job)f(table)i(\(see)f(Section)h +(7.2)330 2866 y([Job)h(Con)m(trol)h(Builtins],)g(page)g(98\))h(or)e +(suppress)e(the)i(sending)g(of)g Ft(SIGHUP)e Fu(to)j(a)g(job)f(when)f +(the)330 2976 y(shell)f(exits)g(as)f(the)h(result)f(of)h(a)f +Ft(SIGHUP)p Fu(.)225 3108 y Fq(\017)60 b Fu(Bash)31 b(includes)f(a)g(n) +m(um)m(b)s(er)f(of)i(features)g(to)g(supp)s(ort)d(a)j(separate)g +(debugger)f(for)h(shell)f(scripts.)225 3240 y Fq(\017)60 +b Fu(The)28 b(SVR4.2)h(shell)f(has)g(t)m(w)m(o)i(privilege-related)g +(builtins)e(\()p Ft(mldmode)e Fu(and)i Ft(priv)p Fu(\))f(not)i(presen)m +(t)f(in)330 3350 y(Bash.)225 3482 y Fq(\017)60 b Fu(Bash)31 +b(do)s(es)f(not)g(ha)m(v)m(e)i(the)e Ft(stop)g Fu(or)g +Ft(newgrp)f Fu(builtins.)225 3613 y Fq(\017)60 b Fu(Bash)31 +b(do)s(es)f(not)g(use)g(the)h Ft(SHACCT)d Fu(v)-5 b(ariable)32 +b(or)e(p)s(erform)f(shell)i(accoun)m(ting.)225 3745 y +Fq(\017)60 b Fu(The)30 b(SVR4.2)h Ft(sh)f Fu(uses)g(a)g +Ft(TIMEOUT)f Fu(v)-5 b(ariable)31 b(lik)m(e)h(Bash)e(uses)g +Ft(TMOUT)p Fu(.)150 3900 y(More)h(features)g(unique)e(to)i(Bash)g(ma)m +(y)g(b)s(e)f(found)f(in)h(Chapter)f(6)i([Bash)g(F)-8 +b(eatures],)32 b(page)f(80.)150 4127 y Fs(B.1)67 b(Implemen)l(tation)48 +b(Di\013erences)e(F)-11 b(rom)44 b(The)h(SVR4.2)g(Shell)150 +4287 y Fu(Since)33 b(Bash)h(is)f(a)g(completely)i(new)e(implemen)m +(tation,)j(it)e(do)s(es)e(not)i(su\013er)e(from)h(man)m(y)g(of)h(the)f +(limi-)150 4396 y(tations)f(of)e(the)h(SVR4.2)g(shell.)41 +b(F)-8 b(or)31 b(instance:)225 4528 y Fq(\017)60 b Fu(Bash)32 +b(do)s(es)f(not)h(fork)f(a)h(subshell)e(when)h(redirecting)h(in)m(to)h +(or)e(out)h(of)g(a)g(shell)f(con)m(trol)i(structure)330 +4638 y(suc)m(h)d(as)h(an)f Ft(if)g Fu(or)g Ft(while)f +Fu(statemen)m(t.)225 4770 y Fq(\017)60 b Fu(Bash)29 b(do)s(es)f(not)h +(allo)m(w)h(un)m(balanced)f(quotes.)41 b(The)28 b(SVR4.2)h(shell)g +(will)g(silen)m(tly)i(insert)d(a)h(needed)330 4879 y(closing)g(quote)g +(at)f Ft(EOF)f Fu(under)g(certain)h(circumstances.)41 +b(This)27 b(can)h(b)s(e)g(the)g(cause)g(of)g(some)h(hard-)330 +4989 y(to-\014nd)h(errors.)225 5121 y Fq(\017)60 b Fu(The)45 +b(SVR4.2)h(shell)f(uses)g(a)g(baro)s(que)g(memory)g(managemen)m(t)i(sc) +m(heme)e(based)g(on)g(trapping)330 5230 y Ft(SIGSEGV)p +Fu(.)57 b(If)35 b(the)i(shell)f(is)h(started)g(from)e(a)i(pro)s(cess)f +(with)g Ft(SIGSEGV)e Fu(blo)s(c)m(k)m(ed)k(\(e.g.,)h(b)m(y)d(using)330 +5340 y(the)31 b Ft(system\(\))d Fu(C)i(library)g(function)g(call\),)i +(it)f(misb)s(eha)m(v)m(es)g(badly)-8 b(.)p eop end +%%Page: 151 157 +TeXDict begin 151 156 bop 150 -116 a Fu(App)s(endix)29 +b(B:)i(Ma)5 b(jor)31 b(Di\013erences)g(F)-8 b(rom)31 +b(The)f(Bourne)g(Shell)1258 b(151)225 299 y Fq(\017)60 +b Fu(In)30 b(a)i(questionable)g(attempt)g(at)g(securit)m(y)-8 +b(,)33 b(the)e(SVR4.2)h(shell,)g(when)e(in)m(v)m(ok)m(ed)j(without)e +(the)h Ft(-p)330 408 y Fu(option,)39 b(will)d(alter)i(its)e(real)h(and) +f(e\013ectiv)m(e)j Fm(uid)d Fu(and)g Fm(gid)h Fu(if)f(they)h(are)f +(less)h(than)f(some)h(magic)330 518 y(threshold)30 b(v)-5 +b(alue,)31 b(commonly)g(100.)42 b(This)29 b(can)i(lead)g(to)g(unexp)s +(ected)f(results.)225 653 y Fq(\017)60 b Fu(The)30 b(SVR4.2)h(shell)g +(do)s(es)f(not)g(allo)m(w)i(users)e(to)h(trap)f Ft(SIGSEGV)p +Fu(,)f Ft(SIGALRM)p Fu(,)f(or)j Ft(SIGCHLD)p Fu(.)225 +787 y Fq(\017)60 b Fu(The)34 b(SVR4.2)h(shell)g(do)s(es)g(not)f(allo)m +(w)j(the)d Ft(IFS)p Fu(,)h Ft(MAILCHECK)p Fu(,)f Ft(PATH)p +Fu(,)h Ft(PS1)p Fu(,)g(or)f Ft(PS2)g Fu(v)-5 b(ariables)35 +b(to)330 897 y(b)s(e)30 b(unset.)225 1031 y Fq(\017)60 +b Fu(The)30 b(SVR4.2)h(shell)g(treats)g(`)p Ft(^)p Fu(')f(as)h(the)g +(undo)s(cumen)m(ted)e(equiv)-5 b(alen)m(t)31 b(of)g(`)p +Ft(|)p Fu('.)225 1166 y Fq(\017)60 b Fu(Bash)37 b(allo)m(ws)h(m)m +(ultiple)f(option)g(argumen)m(ts)g(when)e(it)i(is)g(in)m(v)m(ok)m(ed)h +(\()p Ft(-x)30 b(-v)p Fu(\);)40 b(the)c(SVR4.2)i(shell)330 +1275 y(allo)m(ws)c(only)f(one)g(option)g(argumen)m(t)g(\()p +Ft(-xv)p Fu(\).)47 b(In)32 b(fact,)i(some)f(v)m(ersions)g(of)g(the)g +(shell)f(dump)f(core)330 1385 y(if)f(the)h(second)f(argumen)m(t)h(b)s +(egins)f(with)g(a)h(`)p Ft(-)p Fu('.)225 1519 y Fq(\017)60 +b Fu(The)26 b(SVR4.2)i(shell)f(exits)g(a)g(script)g(if)g(an)m(y)g +(builtin)f(fails;)j(Bash)e(exits)g(a)g(script)g(only)g(if)g(one)g(of)g +(the)330 1629 y Fm(posix)34 b Fu(sp)s(ecial)h(builtins)f(fails,)i(and)e +(only)h(for)f(certain)h(failures,)h(as)f(en)m(umerated)g(in)f(the)h +Fm(posix)330 1738 y Fu(standard.)225 1873 y Fq(\017)60 +b Fu(The)30 b(SVR4.2)h(shell)g(b)s(eha)m(v)m(es)f(di\013eren)m(tly)h +(when)f(in)m(v)m(ok)m(ed)i(as)e Ft(jsh)g Fu(\(it)h(turns)e(on)h(job)g +(con)m(trol\).)p eop end +%%Page: 152 158 +TeXDict begin 152 157 bop 150 -116 a Fu(App)s(endix)29 +b(C:)h(GNU)h(F)-8 b(ree)31 b(Do)s(cumen)m(tation)i(License)1560 +b(152)150 299 y Fp(App)t(endix)52 b(C)81 b(GNU)54 b(F)-13 +b(ree)53 b(Do)t(cumen)l(tation)e(License)1359 502 y Fu(V)-8 +b(ersion)31 b(1.3,)g(3)g(No)m(v)m(em)m(b)s(er)h(2008)390 +635 y(Cop)m(yrigh)m(t)842 632 y(c)817 635 y Fq(\015)e +Fu(2000,)j(2001,)f(2002,)g(2007,)h(2008)f(F)-8 b(ree)31 +b(Soft)m(w)m(are)h(F)-8 b(oundation,)31 b(Inc.)390 745 +y Ft(http://fsf.org/)390 964 y Fu(Ev)m(ery)m(one)g(is)g(p)s(ermitted)f +(to)h(cop)m(y)g(and)f(distribute)g(v)m(erbatim)h(copies)390 +1074 y(of)g(this)f(license)h(do)s(cumen)m(t,)g(but)e(c)m(hanging)j(it)f +(is)f(not)h(allo)m(w)m(ed.)199 1207 y(0.)61 b(PREAMBLE)330 +1340 y(The)37 b(purp)s(ose)e(of)i(this)g(License)h(is)f(to)h(mak)m(e)g +(a)g(man)m(ual,)h(textb)s(o)s(ok,)h(or)d(other)g(functional)h(and)330 +1450 y(useful)29 b(do)s(cumen)m(t)h Fr(free)36 b Fu(in)29 +b(the)i(sense)f(of)g(freedom:)41 b(to)31 b(assure)e(ev)m(ery)m(one)j +(the)e(e\013ectiv)m(e)j(freedom)330 1559 y(to)f(cop)m(y)g(and)f +(redistribute)g(it,)h(with)g(or)f(without)g(mo)s(difying)g(it,)i +(either)f(commercially)h(or)e(non-)330 1669 y(commercially)-8 +b(.)56 b(Secondarily)-8 b(,)36 b(this)f(License)g(preserv)m(es)g(for)f +(the)h(author)f(and)g(publisher)f(a)i(w)m(a)m(y)330 1778 +y(to)i(get)g(credit)g(for)f(their)g(w)m(ork,)i(while)e(not)g(b)s(eing)g +(considered)g(resp)s(onsible)f(for)h(mo)s(di\014cations)330 +1888 y(made)30 b(b)m(y)h(others.)330 2021 y(This)22 b(License)i(is)f(a) +h(kind)e(of)i(\\cop)m(yleft",)j(whic)m(h)c(means)g(that)h(deriv)-5 +b(ativ)m(e)24 b(w)m(orks)f(of)h(the)f(do)s(cumen)m(t)330 +2131 y(m)m(ust)34 b(themselv)m(es)h(b)s(e)e(free)h(in)g(the)g(same)g +(sense.)51 b(It)34 b(complemen)m(ts)h(the)f(GNU)g(General)h(Public)330 +2240 y(License,)c(whic)m(h)f(is)h(a)f(cop)m(yleft)i(license)g(designed) +e(for)g(free)h(soft)m(w)m(are.)330 2373 y(W)-8 b(e)31 +b(ha)m(v)m(e)f(designed)g(this)f(License)h(in)f(order)g(to)i(use)e(it)h +(for)f(man)m(uals)h(for)f(free)h(soft)m(w)m(are,)h(b)s(ecause)330 +2483 y(free)42 b(soft)m(w)m(are)i(needs)e(free)g(do)s(cumen)m(tation:) +65 b(a)42 b(free)h(program)f(should)f(come)i(with)f(man)m(uals)330 +2592 y(pro)m(viding)29 b(the)g(same)g(freedoms)f(that)i(the)f(soft)m(w) +m(are)h(do)s(es.)40 b(But)29 b(this)f(License)i(is)f(not)g(limited)g +(to)330 2702 y(soft)m(w)m(are)j(man)m(uals;)f(it)g(can)g(b)s(e)f(used)g +(for)g(an)m(y)h(textual)h(w)m(ork,)f(regardless)g(of)g(sub)5 +b(ject)30 b(matter)i(or)330 2812 y(whether)f(it)h(is)f(published)f(as)i +(a)f(prin)m(ted)g(b)s(o)s(ok.)44 b(W)-8 b(e)32 b(recommend)f(this)h +(License)g(principally)f(for)330 2921 y(w)m(orks)f(whose)h(purp)s(ose)d +(is)j(instruction)f(or)g(reference.)199 3054 y(1.)61 +b(APPLICABILITY)29 b(AND)j(DEFINITIONS)330 3187 y(This)39 +b(License)i(applies)f(to)g(an)m(y)h(man)m(ual)f(or)g(other)g(w)m(ork,)i +(in)e(an)m(y)g(medium,)i(that)e(con)m(tains)i(a)330 3297 +y(notice)h(placed)f(b)m(y)f(the)h(cop)m(yrigh)m(t)h(holder)e(sa)m(ying) +h(it)g(can)g(b)s(e)f(distributed)f(under)g(the)i(terms)330 +3407 y(of)c(this)f(License.)62 b(Suc)m(h)37 b(a)h(notice)h(gran)m(ts)f +(a)g(w)m(orld-wide,)h(ro)m(y)m(alt)m(y-free)i(license,)f(unlimited)d +(in)330 3516 y(duration,)49 b(to)d(use)f(that)g(w)m(ork)h(under)d(the)j +(conditions)f(stated)h(herein.)85 b(The)45 b(\\Do)s(cumen)m(t",)330 +3626 y(b)s(elo)m(w,)29 b(refers)f(to)h(an)m(y)g(suc)m(h)f(man)m(ual)h +(or)f(w)m(ork.)40 b(An)m(y)29 b(mem)m(b)s(er)e(of)i(the)f(public)g(is)g +(a)h(licensee,)i(and)330 3735 y(is)25 b(addressed)f(as)h(\\y)m(ou".)40 +b(Y)-8 b(ou)26 b(accept)g(the)f(license)h(if)f(y)m(ou)h(cop)m(y)-8 +b(,)27 b(mo)s(dify)d(or)h(distribute)g(the)g(w)m(ork)330 +3845 y(in)30 b(a)h(w)m(a)m(y)g(requiring)f(p)s(ermission)f(under)g(cop) +m(yrigh)m(t)j(la)m(w.)330 3978 y(A)i(\\Mo)s(di\014ed)f(V)-8 +b(ersion")35 b(of)f(the)g(Do)s(cumen)m(t)g(means)g(an)m(y)g(w)m(ork)f +(con)m(taining)j(the)e(Do)s(cumen)m(t)g(or)330 4088 y(a)k(p)s(ortion)f +(of)h(it,)i(either)e(copied)g(v)m(erbatim,)i(or)d(with)h(mo)s +(di\014cations)f(and/or)h(translated)g(in)m(to)330 4197 +y(another)31 b(language.)330 4330 y(A)26 b(\\Secondary)g(Section")h(is) +f(a)h(named)e(app)s(endix)f(or)i(a)h(fron)m(t-matter)g(section)g(of)f +(the)g(Do)s(cumen)m(t)330 4440 y(that)c(deals)g(exclusiv)m(ely)h(with)e +(the)g(relationship)h(of)f(the)h(publishers)d(or)i(authors)g(of)h(the)f +(Do)s(cumen)m(t)330 4549 y(to)38 b(the)f(Do)s(cumen)m(t's)i(o)m(v)m +(erall)g(sub)5 b(ject)37 b(\(or)h(to)g(related)g(matters\))g(and)f(con) +m(tains)h(nothing)f(that)330 4659 y(could)j(fall)h(directly)g(within)f +(that)h(o)m(v)m(erall)i(sub)5 b(ject.)70 b(\(Th)m(us,)42 +b(if)e(the)h(Do)s(cumen)m(t)g(is)f(in)g(part)h(a)330 +4769 y(textb)s(o)s(ok)24 b(of)g(mathematics,)j(a)d(Secondary)f(Section) +h(ma)m(y)g(not)g(explain)g(an)m(y)g(mathematics.\))40 +b(The)330 4878 y(relationship)28 b(could)f(b)s(e)g(a)g(matter)i(of)e +(historical)i(connection)f(with)f(the)h(sub)5 b(ject)27 +b(or)g(with)g(related)330 4988 y(matters,)38 b(or)d(of)h(legal,)i +(commercial,)h(philosophical,)f(ethical)f(or)e(p)s(olitical)i(p)s +(osition)f(regarding)330 5097 y(them.)330 5230 y(The)25 +b(\\In)m(v)-5 b(arian)m(t)27 b(Sections")g(are)f(certain)g(Secondary)g +(Sections)g(whose)f(titles)i(are)f(designated,)i(as)330 +5340 y(b)s(eing)e(those)h(of)g(In)m(v)-5 b(arian)m(t)27 +b(Sections,)i(in)d(the)h(notice)h(that)f(sa)m(ys)g(that)g(the)g(Do)s +(cumen)m(t)g(is)g(released)p eop end +%%Page: 153 159 +TeXDict begin 153 158 bop 150 -116 a Fu(App)s(endix)29 +b(C:)h(GNU)h(F)-8 b(ree)31 b(Do)s(cumen)m(tation)i(License)1560 +b(153)330 299 y(under)26 b(this)i(License.)40 b(If)27 +b(a)h(section)h(do)s(es)f(not)f(\014t)h(the)g(ab)s(o)m(v)m(e)h +(de\014nition)e(of)h(Secondary)f(then)h(it)g(is)330 408 +y(not)k(allo)m(w)m(ed)i(to)e(b)s(e)g(designated)g(as)g(In)m(v)-5 +b(arian)m(t.)46 b(The)31 b(Do)s(cumen)m(t)i(ma)m(y)f(con)m(tain)i(zero) +e(In)m(v)-5 b(arian)m(t)330 518 y(Sections.)39 b(If)25 +b(the)f(Do)s(cumen)m(t)i(do)s(es)e(not)h(iden)m(tify)g(an)m(y)g(In)m(v) +-5 b(arian)m(t)25 b(Sections)h(then)e(there)h(are)g(none.)330 +669 y(The)36 b(\\Co)m(v)m(er)i(T)-8 b(exts")38 b(are)f(certain)g(short) +g(passages)g(of)g(text)g(that)h(are)f(listed,)i(as)d(F)-8 +b(ron)m(t-Co)m(v)m(er)330 778 y(T)g(exts)26 b(or)f(Bac)m(k-Co)m(v)m(er) +j(T)-8 b(exts,)27 b(in)d(the)h(notice)i(that)e(sa)m(ys)h(that)g(the)f +(Do)s(cumen)m(t)h(is)f(released)g(under)330 888 y(this)h(License.)40 +b(A)25 b(F)-8 b(ron)m(t-Co)m(v)m(er)29 b(T)-8 b(ext)26 +b(ma)m(y)h(b)s(e)e(at)i(most)f(5)g(w)m(ords,)g(and)g(a)g(Bac)m(k-Co)m +(v)m(er)j(T)-8 b(ext)26 b(ma)m(y)330 998 y(b)s(e)k(at)h(most)g(25)g(w)m +(ords.)330 1148 y(A)36 b(\\T)-8 b(ransparen)m(t")36 b(cop)m(y)g(of)g +(the)f(Do)s(cumen)m(t)h(means)g(a)g(mac)m(hine-readable)h(cop)m(y)-8 +b(,)38 b(represen)m(ted)330 1258 y(in)d(a)h(format)g(whose)g(sp)s +(eci\014cation)g(is)g(a)m(v)-5 b(ailable)38 b(to)f(the)f(general)g +(public,)h(that)f(is)g(suitable)g(for)330 1367 y(revising)c(the)g(do)s +(cumen)m(t)f(straigh)m(tforw)m(ardly)i(with)e(generic)i(text)g(editors) +f(or)f(\(for)h(images)h(com-)330 1477 y(p)s(osed)23 b(of)h(pixels\))g +(generic)h(pain)m(t)f(programs)g(or)f(\(for)h(dra)m(wings\))g(some)g +(widely)g(a)m(v)-5 b(ailable)26 b(dra)m(wing)330 1587 +y(editor,)k(and)f(that)g(is)g(suitable)h(for)f(input)f(to)i(text)g +(formatters)f(or)g(for)g(automatic)i(translation)f(to)330 +1696 y(a)d(v)-5 b(ariet)m(y)28 b(of)f(formats)g(suitable)h(for)e(input) +g(to)i(text)g(formatters.)40 b(A)27 b(cop)m(y)g(made)g(in)g(an)g +(otherwise)330 1806 y(T)-8 b(ransparen)m(t)37 b(\014le)h(format)g +(whose)f(markup,)i(or)e(absence)h(of)g(markup,)g(has)g(b)s(een)f +(arranged)g(to)330 1915 y(th)m(w)m(art)27 b(or)g(discourage)g +(subsequen)m(t)f(mo)s(di\014cation)h(b)m(y)g(readers)f(is)g(not)h(T)-8 +b(ransparen)m(t.)39 b(An)27 b(image)330 2025 y(format)35 +b(is)f(not)h(T)-8 b(ransparen)m(t)34 b(if)g(used)g(for)g(an)m(y)g +(substan)m(tial)h(amoun)m(t)g(of)g(text.)53 b(A)35 b(cop)m(y)g(that)g +(is)330 2134 y(not)c(\\T)-8 b(ransparen)m(t")31 b(is)f(called)i +(\\Opaque".)330 2285 y(Examples)53 b(of)g(suitable)h(formats)f(for)g(T) +-8 b(ransparen)m(t)53 b(copies)h(include)f(plain)g Fm(asci)r(i)g +Fu(without)330 2395 y(markup,)37 b(T)-8 b(exinfo)36 b(input)f(format,)j +(LaT)1759 2414 y(E)1810 2395 y(X)e(input)f(format,)j +Ff(SGML)f Fu(or)f Ff(XML)g Fu(using)g(a)g(publicly)330 +2504 y(a)m(v)-5 b(ailable)42 b Ff(DTD)p Fu(,)h(and)c +(standard-conforming)g(simple)h Ff(HTML)p Fu(,)i(P)m(ostScript)e(or)f +Ff(PDF)h Fu(designed)330 2614 y(for)e(h)m(uman)f(mo)s(di\014cation.)65 +b(Examples)38 b(of)h(transparen)m(t)f(image)h(formats)g(include)f +Ff(PNG)p Fu(,)i Ff(X)n(CF)330 2724 y Fu(and)e Ff(JPG)p +Fu(.)64 b(Opaque)38 b(formats)h(include)f(proprietary)h(formats)f(that) +h(can)g(b)s(e)f(read)h(and)f(edited)330 2833 y(only)54 +b(b)m(y)f(proprietary)h(w)m(ord)f(pro)s(cessors,)59 b +Ff(SGML)54 b Fu(or)f Ff(XML)h Fu(for)g(whic)m(h)f(the)h +Ff(DTD)g Fu(and/or)330 2943 y(pro)s(cessing)61 b(to)s(ols)h(are)f(not)g +(generally)i(a)m(v)-5 b(ailable,)71 b(and)60 b(the)h(mac)m +(hine-generated)j Ff(HTML)p Fu(,)330 3052 y(P)m(ostScript)31 +b(or)f Ff(PDF)h Fu(pro)s(duced)d(b)m(y)j(some)f(w)m(ord)g(pro)s +(cessors)g(for)g(output)g(purp)s(oses)f(only)-8 b(.)330 +3203 y(The)34 b(\\Title)h(P)m(age")i(means,)e(for)f(a)h(prin)m(ted)f(b) +s(o)s(ok,)h(the)f(title)i(page)f(itself,)h(plus)e(suc)m(h)f(follo)m +(wing)330 3313 y(pages)28 b(as)g(are)g(needed)g(to)g(hold,)g(legibly)-8 +b(,)30 b(the)e(material)h(this)e(License)i(requires)e(to)h(app)s(ear)f +(in)h(the)330 3422 y(title)g(page.)40 b(F)-8 b(or)28 +b(w)m(orks)e(in)g(formats)h(whic)m(h)g(do)f(not)h(ha)m(v)m(e)h(an)m(y)e +(title)j(page)e(as)g(suc)m(h,)g(\\Title)h(P)m(age")330 +3532 y(means)j(the)f(text)i(near)e(the)h(most)g(prominen)m(t)g(app)s +(earance)f(of)h(the)g(w)m(ork's)g(title,)h(preceding)f(the)330 +3641 y(b)s(eginning)f(of)g(the)h(b)s(o)s(dy)e(of)h(the)h(text.)330 +3792 y(The)j(\\publisher")g(means)h(an)m(y)f(p)s(erson)g(or)h(en)m(tit) +m(y)h(that)f(distributes)f(copies)i(of)e(the)h(Do)s(cumen)m(t)330 +3902 y(to)c(the)g(public.)330 4052 y(A)f(section)h(\\En)m(titled)g +(XYZ")f(means)f(a)h(named)g(subunit)e(of)h(the)h(Do)s(cumen)m(t)h +(whose)e(title)i(either)330 4162 y(is)d(precisely)g(XYZ)g(or)f(con)m +(tains)i(XYZ)f(in)f(paren)m(theses)i(follo)m(wing)g(text)g(that)f +(translates)h(XYZ)e(in)330 4271 y(another)e(language.)40 +b(\(Here)26 b(XYZ)f(stands)f(for)h(a)g(sp)s(eci\014c)g(section)h(name)f +(men)m(tioned)h(b)s(elo)m(w,)g(suc)m(h)330 4381 y(as)i(\\Ac)m(kno)m +(wledgemen)m(ts",)33 b(\\Dedications",)e(\\Endorsemen)m(ts",)e(or)f +(\\History".\))42 b(T)-8 b(o)29 b(\\Preserv)m(e)330 4491 +y(the)34 b(Title")h(of)e(suc)m(h)h(a)g(section)g(when)f(y)m(ou)h(mo)s +(dify)e(the)i(Do)s(cumen)m(t)h(means)e(that)h(it)g(remains)g(a)330 +4600 y(section)e(\\En)m(titled)f(XYZ")g(according)g(to)g(this)g +(de\014nition.)330 4751 y(The)c(Do)s(cumen)m(t)i(ma)m(y)f(include)f(W) +-8 b(arran)m(t)m(y)30 b(Disclaimers)f(next)f(to)g(the)g(notice)h(whic)m +(h)e(states)i(that)330 4861 y(this)34 b(License)g(applies)g(to)h(the)f +(Do)s(cumen)m(t.)52 b(These)33 b(W)-8 b(arran)m(t)m(y)36 +b(Disclaimers)f(are)g(considered)e(to)330 4970 y(b)s(e)k(included)g(b)m +(y)g(reference)h(in)g(this)f(License,)j(but)d(only)h(as)g(regards)f +(disclaiming)i(w)m(arran)m(ties:)330 5080 y(an)m(y)e(other)g +(implication)i(that)e(these)g(W)-8 b(arran)m(t)m(y)39 +b(Disclaimers)f(ma)m(y)g(ha)m(v)m(e)g(is)f(v)m(oid)g(and)f(has)h(no)330 +5189 y(e\013ect)32 b(on)e(the)h(meaning)f(of)h(this)f(License.)199 +5340 y(2.)61 b(VERBA)-8 b(TIM)31 b(COPYING)p eop end +%%Page: 154 160 +TeXDict begin 154 159 bop 150 -116 a Fu(App)s(endix)29 +b(C:)h(GNU)h(F)-8 b(ree)31 b(Do)s(cumen)m(tation)i(License)1560 +b(154)330 299 y(Y)-8 b(ou)39 b(ma)m(y)f(cop)m(y)h(and)e(distribute)h +(the)g(Do)s(cumen)m(t)h(in)f(an)m(y)g(medium,)h(either)g(commercially)h +(or)330 408 y(noncommercially)-8 b(,)48 b(pro)m(vided)42 +b(that)h(this)f(License,)47 b(the)42 b(cop)m(yrigh)m(t)i(notices,)j +(and)42 b(the)h(license)330 518 y(notice)37 b(sa)m(ying)g(this)e +(License)i(applies)e(to)i(the)f(Do)s(cumen)m(t)g(are)g(repro)s(duced)e +(in)i(all)g(copies,)j(and)330 628 y(that)27 b(y)m(ou)g(add)f(no)h +(other)f(conditions)h(whatso)s(ev)m(er)h(to)f(those)g(of)g(this)f +(License.)40 b(Y)-8 b(ou)27 b(ma)m(y)g(not)g(use)330 +737 y(tec)m(hnical)35 b(measures)d(to)i(obstruct)f(or)g(con)m(trol)h +(the)f(reading)g(or)g(further)e(cop)m(ying)j(of)f(the)g(copies)330 +847 y(y)m(ou)25 b(mak)m(e)g(or)g(distribute.)38 b(Ho)m(w)m(ev)m(er,)28 +b(y)m(ou)d(ma)m(y)g(accept)h(comp)s(ensation)f(in)f(exc)m(hange)j(for)d +(copies.)330 956 y(If)32 b(y)m(ou)g(distribute)g(a)h(large)g(enough)f +(n)m(um)m(b)s(er)f(of)h(copies)h(y)m(ou)f(m)m(ust)h(also)g(follo)m(w)g +(the)f(conditions)330 1066 y(in)e(section)i(3.)330 1200 +y(Y)-8 b(ou)21 b(ma)m(y)h(also)f(lend)g(copies,)i(under)d(the)h(same)g +(conditions)g(stated)h(ab)s(o)m(v)m(e,)i(and)c(y)m(ou)h(ma)m(y)g +(publicly)330 1310 y(displa)m(y)31 b(copies.)199 1443 +y(3.)61 b(COPYING)30 b(IN)g(QUANTITY)330 1577 y(If)25 +b(y)m(ou)g(publish)f(prin)m(ted)g(copies)i(\(or)g(copies)g(in)f(media)g +(that)h(commonly)g(ha)m(v)m(e)g(prin)m(ted)f(co)m(v)m(ers\))i(of)330 +1687 y(the)32 b(Do)s(cumen)m(t,)h(n)m(um)m(b)s(ering)e(more)h(than)f +(100,)j(and)d(the)h(Do)s(cumen)m(t's)h(license)f(notice)h(requires)330 +1797 y(Co)m(v)m(er)i(T)-8 b(exts,)36 b(y)m(ou)f(m)m(ust)f(enclose)i +(the)e(copies)h(in)f(co)m(v)m(ers)i(that)f(carry)-8 b(,)36 +b(clearly)f(and)f(legibly)-8 b(,)37 b(all)330 1906 y(these)j(Co)m(v)m +(er)g(T)-8 b(exts:)59 b(F)-8 b(ron)m(t-Co)m(v)m(er)41 +b(T)-8 b(exts)40 b(on)f(the)g(fron)m(t)g(co)m(v)m(er,)44 +b(and)38 b(Bac)m(k-Co)m(v)m(er)k(T)-8 b(exts)40 b(on)330 +2016 y(the)29 b(bac)m(k)h(co)m(v)m(er.)42 b(Both)30 b(co)m(v)m(ers)h(m) +m(ust)e(also)h(clearly)g(and)f(legibly)h(iden)m(tify)f(y)m(ou)h(as)f +(the)h(publisher)330 2125 y(of)k(these)h(copies.)53 b(The)34 +b(fron)m(t)h(co)m(v)m(er)h(m)m(ust)e(presen)m(t)g(the)h(full)f(title)i +(with)d(all)j(w)m(ords)d(of)i(the)f(title)330 2235 y(equally)e +(prominen)m(t)e(and)g(visible.)43 b(Y)-8 b(ou)31 b(ma)m(y)g(add)g +(other)g(material)h(on)f(the)g(co)m(v)m(ers)h(in)e(addition.)330 +2345 y(Cop)m(ying)36 b(with)g(c)m(hanges)h(limited)g(to)g(the)g(co)m(v) +m(ers,)i(as)d(long)h(as)g(they)f(preserv)m(e)g(the)h(title)g(of)g(the) +330 2454 y(Do)s(cumen)m(t)h(and)e(satisfy)i(these)f(conditions,)j(can)d +(b)s(e)g(treated)h(as)f(v)m(erbatim)h(cop)m(ying)g(in)f(other)330 +2564 y(resp)s(ects.)330 2698 y(If)32 b(the)h(required)f(texts)i(for)e +(either)h(co)m(v)m(er)i(are)e(to)s(o)g(v)m(oluminous)g(to)g(\014t)g +(legibly)-8 b(,)35 b(y)m(ou)e(should)f(put)330 2807 y(the)h(\014rst)f +(ones)h(listed)g(\(as)h(man)m(y)f(as)g(\014t)g(reasonably\))g(on)g(the) +g(actual)h(co)m(v)m(er,)h(and)e(con)m(tin)m(ue)h(the)330 +2917 y(rest)d(on)m(to)g(adjacen)m(t)h(pages.)330 3051 +y(If)27 b(y)m(ou)g(publish)e(or)i(distribute)g(Opaque)f(copies)i(of)f +(the)h(Do)s(cumen)m(t)f(n)m(um)m(b)s(ering)f(more)i(than)e(100,)330 +3160 y(y)m(ou)i(m)m(ust)g(either)h(include)e(a)i(mac)m(hine-readable)g +(T)-8 b(ransparen)m(t)28 b(cop)m(y)h(along)g(with)e(eac)m(h)i(Opaque) +330 3270 y(cop)m(y)-8 b(,)38 b(or)d(state)h(in)f(or)g(with)g(eac)m(h)h +(Opaque)e(cop)m(y)i(a)g(computer-net)m(w)m(ork)g(lo)s(cation)h(from)d +(whic)m(h)330 3380 y(the)24 b(general)i(net)m(w)m(ork-using)f(public)e +(has)h(access)i(to)f(do)m(wnload)f(using)g(public-standard)f(net)m(w)m +(ork)330 3489 y(proto)s(cols)40 b(a)f(complete)h(T)-8 +b(ransparen)m(t)39 b(cop)m(y)g(of)g(the)h(Do)s(cumen)m(t,)i(free)d(of)g +(added)f(material.)67 b(If)330 3599 y(y)m(ou)39 b(use)g(the)g(latter)h +(option,)h(y)m(ou)f(m)m(ust)e(tak)m(e)j(reasonably)e(pruden)m(t)e +(steps,)k(when)d(y)m(ou)h(b)s(egin)330 3708 y(distribution)f(of)g +(Opaque)g(copies)h(in)e(quan)m(tit)m(y)-8 b(,)43 b(to)38 +b(ensure)g(that)h(this)f(T)-8 b(ransparen)m(t)38 b(cop)m(y)h(will)330 +3818 y(remain)30 b(th)m(us)g(accessible)i(at)f(the)f(stated)h(lo)s +(cation)h(un)m(til)e(at)h(least)h(one)e(y)m(ear)h(after)g(the)f(last)h +(time)330 3927 y(y)m(ou)37 b(distribute)f(an)h(Opaque)f(cop)m(y)i +(\(directly)g(or)e(through)g(y)m(our)h(agen)m(ts)h(or)f(retailers\))h +(of)f(that)330 4037 y(edition)31 b(to)g(the)g(public.)330 +4171 y(It)k(is)f(requested,)i(but)e(not)h(required,)g(that)g(y)m(ou)g +(con)m(tact)h(the)f(authors)f(of)h(the)g(Do)s(cumen)m(t)g(w)m(ell)330 +4281 y(b)s(efore)28 b(redistributing)g(an)m(y)h(large)h(n)m(um)m(b)s +(er)d(of)i(copies,)h(to)f(giv)m(e)h(them)f(a)g(c)m(hance)h(to)f(pro)m +(vide)g(y)m(ou)330 4390 y(with)h(an)g(up)s(dated)f(v)m(ersion)i(of)g +(the)f(Do)s(cumen)m(t.)199 4524 y(4.)61 b(MODIFICA)-8 +b(TIONS)330 4658 y(Y)g(ou)26 b(ma)m(y)g(cop)m(y)g(and)f(distribute)g(a) +h(Mo)s(di\014ed)f(V)-8 b(ersion)26 b(of)g(the)g(Do)s(cumen)m(t)g(under) +e(the)h(conditions)330 4768 y(of)c(sections)h(2)g(and)e(3)h(ab)s(o)m(v) +m(e,)k(pro)m(vided)20 b(that)i(y)m(ou)f(release)i(the)e(Mo)s(di\014ed)f +(V)-8 b(ersion)22 b(under)d(precisely)330 4877 y(this)29 +b(License,)h(with)f(the)g(Mo)s(di\014ed)f(V)-8 b(ersion)30 +b(\014lling)f(the)g(role)h(of)f(the)g(Do)s(cumen)m(t,)h(th)m(us)f +(licensing)330 4987 y(distribution)k(and)h(mo)s(di\014cation)g(of)h +(the)f(Mo)s(di\014ed)f(V)-8 b(ersion)35 b(to)g(who)s(ev)m(er)f(p)s +(ossesses)f(a)i(cop)m(y)g(of)330 5096 y(it.)41 b(In)30 +b(addition,)h(y)m(ou)f(m)m(ust)h(do)f(these)h(things)f(in)g(the)h(Mo)s +(di\014ed)e(V)-8 b(ersion:)357 5230 y(A.)60 b(Use)33 +b(in)f(the)h(Title)h(P)m(age)g(\(and)f(on)f(the)h(co)m(v)m(ers,)i(if)e +(an)m(y\))g(a)g(title)h(distinct)f(from)g(that)g(of)g(the)510 +5340 y(Do)s(cumen)m(t,)j(and)d(from)g(those)i(of)f(previous)f(v)m +(ersions)h(\(whic)m(h)g(should,)g(if)g(there)g(w)m(ere)g(an)m(y)-8 +b(,)p eop end +%%Page: 155 161 +TeXDict begin 155 160 bop 150 -116 a Fu(App)s(endix)29 +b(C:)h(GNU)h(F)-8 b(ree)31 b(Do)s(cumen)m(tation)i(License)1560 +b(155)510 299 y(b)s(e)31 b(listed)h(in)f(the)g(History)h(section)g(of)g +(the)f(Do)s(cumen)m(t\).)45 b(Y)-8 b(ou)32 b(ma)m(y)g(use)f(the)g(same) +h(title)h(as)510 408 y(a)e(previous)f(v)m(ersion)g(if)h(the)f(original) +i(publisher)d(of)h(that)h(v)m(ersion)g(giv)m(es)h(p)s(ermission.)360 +545 y(B.)61 b(List)31 b(on)f(the)h(Title)g(P)m(age,)i(as)d(authors,)h +(one)g(or)f(more)h(p)s(ersons)e(or)h(en)m(tities)j(resp)s(onsible)c +(for)510 655 y(authorship)c(of)h(the)h(mo)s(di\014cations)f(in)g(the)g +(Mo)s(di\014ed)f(V)-8 b(ersion,)28 b(together)g(with)d(at)i(least)h +(\014v)m(e)510 765 y(of)c(the)g(principal)g(authors)f(of)i(the)f(Do)s +(cumen)m(t)g(\(all)h(of)g(its)f(principal)g(authors,)h(if)f(it)g(has)g +(few)m(er)510 874 y(than)30 b(\014v)m(e\),)h(unless)f(they)h(release)g +(y)m(ou)g(from)f(this)g(requiremen)m(t.)359 1011 y(C.)60 +b(State)32 b(on)e(the)h(Title)h(page)f(the)g(name)g(of)g(the)g +(publisher)e(of)i(the)g(Mo)s(di\014ed)f(V)-8 b(ersion,)32 +b(as)f(the)510 1121 y(publisher.)355 1258 y(D.)61 b(Preserv)m(e)31 +b(all)g(the)g(cop)m(yrigh)m(t)h(notices)f(of)g(the)f(Do)s(cumen)m(t.) +363 1395 y(E.)60 b(Add)30 b(an)i(appropriate)f(cop)m(yrigh)m(t)i +(notice)f(for)g(y)m(our)f(mo)s(di\014cations)g(adjacen)m(t)i(to)f(the)g +(other)510 1504 y(cop)m(yrigh)m(t)g(notices.)365 1641 +y(F.)61 b(Include,)28 b(immediately)h(after)f(the)h(cop)m(yrigh)m(t)g +(notices,)h(a)e(license)h(notice)g(giving)g(the)f(public)510 +1751 y(p)s(ermission)23 b(to)j(use)e(the)g(Mo)s(di\014ed)g(V)-8 +b(ersion)25 b(under)e(the)i(terms)f(of)h(this)f(License,)j(in)d(the)g +(form)510 1861 y(sho)m(wn)30 b(in)g(the)g(Addendum)f(b)s(elo)m(w.)353 +1998 y(G.)61 b(Preserv)m(e)23 b(in)g(that)g(license)h(notice)g(the)f +(full)g(lists)g(of)g(In)m(v)-5 b(arian)m(t)23 b(Sections)h(and)e +(required)g(Co)m(v)m(er)510 2107 y(T)-8 b(exts)31 b(giv)m(en)g(in)f +(the)h(Do)s(cumen)m(t's)g(license)h(notice.)357 2244 +y(H.)60 b(Include)30 b(an)g(unaltered)g(cop)m(y)h(of)g(this)f(License.) +392 2381 y(I.)60 b(Preserv)m(e)33 b(the)f(section)h(En)m(titled)g +(\\History",)h(Preserv)m(e)f(its)f(Title,)i(and)d(add)h(to)h(it)f(an)g +(item)510 2491 y(stating)d(at)g(least)g(the)g(title,)h(y)m(ear,)g(new)d +(authors,)i(and)e(publisher)f(of)j(the)f(Mo)s(di\014ed)f(V)-8 +b(ersion)510 2600 y(as)32 b(giv)m(en)g(on)f(the)h(Title)g(P)m(age.)45 +b(If)31 b(there)h(is)f(no)g(section)i(En)m(titled)f(\\History")h(in)e +(the)g(Do)s(cu-)510 2710 y(men)m(t,)37 b(create)f(one)f(stating)h(the)f +(title,)i(y)m(ear,)g(authors,)f(and)e(publisher)f(of)i(the)g(Do)s +(cumen)m(t)510 2819 y(as)h(giv)m(en)h(on)f(its)h(Title)g(P)m(age,)i +(then)d(add)g(an)g(item)g(describing)g(the)g(Mo)s(di\014ed)g(V)-8 +b(ersion)37 b(as)510 2929 y(stated)31 b(in)f(the)h(previous)f(sen)m +(tence.)378 3066 y(J.)60 b(Preserv)m(e)33 b(the)g(net)m(w)m(ork)g(lo)s +(cation,)i(if)d(an)m(y)-8 b(,)34 b(giv)m(en)f(in)g(the)f(Do)s(cumen)m +(t)h(for)g(public)e(access)j(to)510 3176 y(a)e(T)-8 b(ransparen)m(t)30 +b(cop)m(y)i(of)g(the)f(Do)s(cumen)m(t,)h(and)f(lik)m(ewise)h(the)g(net) +m(w)m(ork)g(lo)s(cations)g(giv)m(en)g(in)510 3285 y(the)g(Do)s(cumen)m +(t)g(for)g(previous)f(v)m(ersions)h(it)g(w)m(as)g(based)f(on.)45 +b(These)31 b(ma)m(y)h(b)s(e)f(placed)h(in)g(the)510 3395 +y(\\History")27 b(section.)40 b(Y)-8 b(ou)25 b(ma)m(y)h(omit)g(a)f(net) +m(w)m(ork)h(lo)s(cation)g(for)f(a)h(w)m(ork)f(that)g(w)m(as)h +(published)510 3504 y(at)36 b(least)h(four)e(y)m(ears)i(b)s(efore)e +(the)h(Do)s(cumen)m(t)h(itself,)h(or)d(if)h(the)g(original)h(publisher) +d(of)i(the)510 3614 y(v)m(ersion)31 b(it)g(refers)f(to)h(giv)m(es)h(p)s +(ermission.)354 3751 y(K.)60 b(F)-8 b(or)24 b(an)m(y)h(section)f(En)m +(titled)h(\\Ac)m(kno)m(wledgemen)m(ts")i(or)d(\\Dedications",)k +(Preserv)m(e)c(the)g(Title)510 3861 y(of)j(the)f(section,)j(and)d +(preserv)m(e)h(in)f(the)h(section)g(all)h(the)e(substance)h(and)f(tone) +h(of)f(eac)m(h)i(of)f(the)510 3970 y(con)m(tributor)k(ac)m(kno)m +(wledgemen)m(ts)i(and/or)d(dedications)h(giv)m(en)h(therein.)368 +4107 y(L.)60 b(Preserv)m(e)36 b(all)g(the)g(In)m(v)-5 +b(arian)m(t)36 b(Sections)g(of)f(the)h(Do)s(cumen)m(t,)h(unaltered)f +(in)f(their)g(text)i(and)510 4217 y(in)f(their)g(titles.)58 +b(Section)37 b(n)m(um)m(b)s(ers)d(or)i(the)g(equiv)-5 +b(alen)m(t)38 b(are)e(not)g(considered)g(part)g(of)g(the)510 +4326 y(section)c(titles.)341 4463 y(M.)61 b(Delete)33 +b(an)m(y)e(section)h(En)m(titled)f(\\Endorsemen)m(ts".)42 +b(Suc)m(h)30 b(a)i(section)f(ma)m(y)h(not)f(b)s(e)f(included)510 +4573 y(in)g(the)h(Mo)s(di\014ed)e(V)-8 b(ersion.)357 +4710 y(N.)60 b(Do)29 b(not)g(retitle)h(an)m(y)e(existing)i(section)f +(to)g(b)s(e)f(En)m(titled)h(\\Endorsemen)m(ts")g(or)f(to)h(con\015ict)g +(in)510 4819 y(title)j(with)e(an)m(y)h(In)m(v)-5 b(arian)m(t)31 +b(Section.)354 4956 y(O.)60 b(Preserv)m(e)31 b(an)m(y)g(W)-8 +b(arran)m(t)m(y)32 b(Disclaimers.)330 5121 y(If)h(the)g(Mo)s(di\014ed)g +(V)-8 b(ersion)34 b(includes)f(new)g(fron)m(t-matter)i(sections)f(or)f +(app)s(endices)g(that)h(qualify)330 5230 y(as)28 b(Secondary)g +(Sections)g(and)f(con)m(tain)j(no)d(material)j(copied)e(from)f(the)h +(Do)s(cumen)m(t,)i(y)m(ou)e(ma)m(y)g(at)330 5340 y(y)m(our)k(option)h +(designate)h(some)e(or)h(all)g(of)f(these)h(sections)h(as)e(in)m(v)-5 +b(arian)m(t.)48 b(T)-8 b(o)33 b(do)f(this,)h(add)f(their)p +eop end +%%Page: 156 162 +TeXDict begin 156 161 bop 150 -116 a Fu(App)s(endix)29 +b(C:)h(GNU)h(F)-8 b(ree)31 b(Do)s(cumen)m(tation)i(License)1560 +b(156)330 299 y(titles)37 b(to)f(the)f(list)h(of)g(In)m(v)-5 +b(arian)m(t)36 b(Sections)g(in)f(the)h(Mo)s(di\014ed)f(V)-8 +b(ersion's)36 b(license)g(notice.)57 b(These)330 408 +y(titles)32 b(m)m(ust)e(b)s(e)g(distinct)h(from)e(an)m(y)i(other)g +(section)g(titles.)330 551 y(Y)-8 b(ou)43 b(ma)m(y)g(add)f(a)g(section) +i(En)m(titled)f(\\Endorsemen)m(ts",)j(pro)m(vided)c(it)h(con)m(tains)g +(nothing)g(but)330 661 y(endorsemen)m(ts)30 b(of)g(y)m(our)f(Mo)s +(di\014ed)g(V)-8 b(ersion)31 b(b)m(y)e(v)-5 b(arious)30 +b(parties|for)g(example,)g(statemen)m(ts)i(of)330 770 +y(p)s(eer)27 b(review)g(or)g(that)h(the)f(text)i(has)d(b)s(een)h(appro) +m(v)m(ed)g(b)m(y)g(an)h(organization)h(as)e(the)h(authoritativ)m(e)330 +880 y(de\014nition)i(of)h(a)f(standard.)330 1022 y(Y)-8 +b(ou)29 b(ma)m(y)g(add)e(a)i(passage)g(of)g(up)e(to)i(\014v)m(e)g(w)m +(ords)e(as)i(a)g(F)-8 b(ron)m(t-Co)m(v)m(er)30 b(T)-8 +b(ext,)30 b(and)e(a)g(passage)i(of)e(up)330 1132 y(to)g(25)g(w)m(ords)e +(as)i(a)f(Bac)m(k-Co)m(v)m(er)j(T)-8 b(ext,)29 b(to)f(the)f(end)f(of)i +(the)f(list)h(of)f(Co)m(v)m(er)h(T)-8 b(exts)27 b(in)g(the)h(Mo)s +(di\014ed)330 1241 y(V)-8 b(ersion.)58 b(Only)35 b(one)h(passage)h(of)f +(F)-8 b(ron)m(t-Co)m(v)m(er)38 b(T)-8 b(ext)36 b(and)g(one)g(of)g(Bac)m +(k-Co)m(v)m(er)j(T)-8 b(ext)36 b(ma)m(y)h(b)s(e)330 1351 +y(added)27 b(b)m(y)g(\(or)h(through)f(arrangemen)m(ts)h(made)g(b)m(y\)) +g(an)m(y)g(one)f(en)m(tit)m(y)-8 b(.)42 b(If)27 b(the)h(Do)s(cumen)m(t) +g(already)330 1461 y(includes)34 b(a)g(co)m(v)m(er)h(text)g(for)f(the)g +(same)h(co)m(v)m(er,)h(previously)e(added)f(b)m(y)h(y)m(ou)g(or)g(b)m +(y)g(arrangemen)m(t)330 1570 y(made)h(b)m(y)g(the)h(same)f(en)m(tit)m +(y)i(y)m(ou)f(are)f(acting)i(on)e(b)s(ehalf)f(of,)j(y)m(ou)f(ma)m(y)g +(not)f(add)g(another;)j(but)330 1680 y(y)m(ou)c(ma)m(y)h(replace)g(the) +f(old)g(one,)i(on)e(explicit)h(p)s(ermission)e(from)g(the)i(previous)e +(publisher)f(that)330 1789 y(added)e(the)g(old)h(one.)330 +1932 y(The)25 b(author\(s\))h(and)f(publisher\(s\))f(of)i(the)f(Do)s +(cumen)m(t)h(do)g(not)f(b)m(y)h(this)f(License)h(giv)m(e)h(p)s +(ermission)330 2041 y(to)k(use)f(their)g(names)h(for)f(publicit)m(y)g +(for)h(or)f(to)h(assert)g(or)f(imply)g(endorsemen)m(t)g(of)h(an)m(y)g +(Mo)s(di\014ed)330 2151 y(V)-8 b(ersion.)199 2293 y(5.)61 +b(COMBINING)31 b(DOCUMENTS)330 2436 y(Y)-8 b(ou)39 b(ma)m(y)g(com)m +(bine)h(the)f(Do)s(cumen)m(t)g(with)g(other)f(do)s(cumen)m(ts)h +(released)g(under)f(this)g(License,)330 2545 y(under)f(the)h(terms)g +(de\014ned)f(in)h(section)h(4)g(ab)s(o)m(v)m(e)g(for)f(mo)s(di\014ed)f +(v)m(ersions,)k(pro)m(vided)d(that)h(y)m(ou)330 2655 +y(include)25 b(in)g(the)g(com)m(bination)i(all)f(of)g(the)f(In)m(v)-5 +b(arian)m(t)26 b(Sections)g(of)g(all)g(of)f(the)h(original)g(do)s +(cumen)m(ts,)330 2765 y(unmo)s(di\014ed,)g(and)g(list)h(them)g(all)g +(as)g(In)m(v)-5 b(arian)m(t)28 b(Sections)f(of)g(y)m(our)g(com)m(bined) +g(w)m(ork)f(in)h(its)g(license)330 2874 y(notice,)32 +b(and)e(that)h(y)m(ou)f(preserv)m(e)h(all)g(their)g(W)-8 +b(arran)m(t)m(y)32 b(Disclaimers.)330 3017 y(The)e(com)m(bined)g(w)m +(ork)h(need)e(only)i(con)m(tain)g(one)g(cop)m(y)g(of)f(this)g(License,) +i(and)d(m)m(ultiple)i(iden)m(tical)330 3126 y(In)m(v)-5 +b(arian)m(t)33 b(Sections)g(ma)m(y)g(b)s(e)f(replaced)h(with)f(a)h +(single)g(cop)m(y)-8 b(.)48 b(If)32 b(there)h(are)g(m)m(ultiple)g(In)m +(v)-5 b(arian)m(t)330 3236 y(Sections)27 b(with)g(the)g(same)g(name)g +(but)f(di\013eren)m(t)h(con)m(ten)m(ts,)i(mak)m(e)f(the)f(title)h(of)f +(eac)m(h)h(suc)m(h)f(section)330 3345 y(unique)33 b(b)m(y)h(adding)f +(at)i(the)f(end)g(of)g(it,)h(in)f(paren)m(theses,)i(the)e(name)g(of)g +(the)g(original)h(author)f(or)330 3455 y(publisher)23 +b(of)i(that)h(section)g(if)f(kno)m(wn,)h(or)f(else)h(a)f(unique)f(n)m +(um)m(b)s(er.)38 b(Mak)m(e)26 b(the)g(same)f(adjustmen)m(t)330 +3565 y(to)g(the)g(section)g(titles)h(in)e(the)h(list)g(of)f(In)m(v)-5 +b(arian)m(t)26 b(Sections)f(in)f(the)g(license)i(notice)g(of)e(the)h +(com)m(bined)330 3674 y(w)m(ork.)330 3817 y(In)41 b(the)g(com)m +(bination,)46 b(y)m(ou)41 b(m)m(ust)g(com)m(bine)h(an)m(y)g(sections)g +(En)m(titled)g(\\History")h(in)e(the)g(v)-5 b(ari-)330 +3926 y(ous)32 b(original)h(do)s(cumen)m(ts,)g(forming)f(one)g(section)h +(En)m(titled)g(\\History";)i(lik)m(ewise)f(com)m(bine)f(an)m(y)330 +4036 y(sections)g(En)m(titled)f(\\Ac)m(kno)m(wledgemen)m(ts",)k(and)31 +b(an)m(y)h(sections)h(En)m(titled)g(\\Dedications".)47 +b(Y)-8 b(ou)330 4145 y(m)m(ust)30 b(delete)i(all)f(sections)h(En)m +(titled)f(\\Endorsemen)m(ts.")199 4288 y(6.)61 b(COLLECTIONS)28 +b(OF)i(DOCUMENTS)330 4430 y(Y)-8 b(ou)32 b(ma)m(y)h(mak)m(e)g(a)f +(collection)i(consisting)f(of)f(the)g(Do)s(cumen)m(t)g(and)g(other)g +(do)s(cumen)m(ts)f(released)330 4540 y(under)41 b(this)h(License,)k +(and)c(replace)h(the)g(individual)f(copies)h(of)f(this)g(License)h(in)f +(the)h(v)-5 b(arious)330 4650 y(do)s(cumen)m(ts)42 b(with)g(a)h(single) +g(cop)m(y)h(that)f(is)f(included)g(in)g(the)h(collection,)48 +b(pro)m(vided)42 b(that)i(y)m(ou)330 4759 y(follo)m(w)38 +b(the)g(rules)e(of)h(this)g(License)h(for)f(v)m(erbatim)h(cop)m(ying)g +(of)f(eac)m(h)h(of)f(the)h(do)s(cumen)m(ts)e(in)h(all)330 +4869 y(other)31 b(resp)s(ects.)330 5011 y(Y)-8 b(ou)32 +b(ma)m(y)g(extract)h(a)f(single)g(do)s(cumen)m(t)f(from)g(suc)m(h)g(a)h +(collection,)i(and)d(distribute)g(it)h(individu-)330 +5121 y(ally)k(under)d(this)i(License,)i(pro)m(vided)e(y)m(ou)g(insert)g +(a)g(cop)m(y)h(of)f(this)g(License)g(in)m(to)h(the)g(extracted)330 +5230 y(do)s(cumen)m(t,)d(and)f(follo)m(w)i(this)e(License)h(in)g(all)g +(other)g(resp)s(ects)f(regarding)h(v)m(erbatim)g(cop)m(ying)h(of)330 +5340 y(that)d(do)s(cumen)m(t.)p eop end +%%Page: 157 163 +TeXDict begin 157 162 bop 150 -116 a Fu(App)s(endix)29 +b(C:)h(GNU)h(F)-8 b(ree)31 b(Do)s(cumen)m(tation)i(License)1560 +b(157)199 299 y(7.)61 b(A)m(GGREGA)-8 b(TION)32 b(WITH)e(INDEPENDENT)h +(W)m(ORKS)330 441 y(A)d(compilation)i(of)e(the)g(Do)s(cumen)m(t)h(or)f +(its)g(deriv)-5 b(ativ)m(es)30 b(with)d(other)i(separate)g(and)e(indep) +s(enden)m(t)330 551 y(do)s(cumen)m(ts)33 b(or)g(w)m(orks,)h(in)f(or)h +(on)f(a)g(v)m(olume)h(of)g(a)f(storage)i(or)e(distribution)g(medium,)g +(is)h(called)330 661 y(an)c(\\aggregate")k(if)c(the)g(cop)m(yrigh)m(t)i +(resulting)e(from)f(the)i(compilation)g(is)f(not)h(used)e(to)i(limit)g +(the)330 770 y(legal)d(righ)m(ts)f(of)g(the)g(compilation's)h(users)e +(b)s(ey)m(ond)g(what)g(the)h(individual)f(w)m(orks)g(p)s(ermit.)39 +b(When)330 880 y(the)g(Do)s(cumen)m(t)g(is)f(included)g(in)g(an)g +(aggregate,)44 b(this)38 b(License)h(do)s(es)f(not)h(apply)f(to)h(the)g +(other)330 989 y(w)m(orks)30 b(in)g(the)h(aggregate)i(whic)m(h)d(are)h +(not)g(themselv)m(es)g(deriv)-5 b(ativ)m(e)32 b(w)m(orks)f(of)f(the)h +(Do)s(cumen)m(t.)330 1132 y(If)22 b(the)h(Co)m(v)m(er)h(T)-8 +b(ext)23 b(requiremen)m(t)g(of)g(section)h(3)f(is)g(applicable)h(to)f +(these)h(copies)f(of)g(the)g(Do)s(cumen)m(t,)330 1241 +y(then)f(if)g(the)h(Do)s(cumen)m(t)g(is)g(less)f(than)g(one)h(half)f +(of)h(the)g(en)m(tire)g(aggregate,)k(the)c(Do)s(cumen)m(t's)g(Co)m(v)m +(er)330 1351 y(T)-8 b(exts)27 b(ma)m(y)g(b)s(e)f(placed)h(on)g(co)m(v)m +(ers)h(that)f(brac)m(k)m(et)h(the)f(Do)s(cumen)m(t)g(within)f(the)h +(aggregate,)j(or)d(the)330 1461 y(electronic)37 b(equiv)-5 +b(alen)m(t)36 b(of)g(co)m(v)m(ers)g(if)f(the)g(Do)s(cumen)m(t)h(is)f +(in)g(electronic)i(form.)54 b(Otherwise)35 b(they)330 +1570 y(m)m(ust)30 b(app)s(ear)g(on)g(prin)m(ted)g(co)m(v)m(ers)i(that)f +(brac)m(k)m(et)h(the)f(whole)f(aggregate.)199 1713 y(8.)61 +b(TRANSLA)-8 b(TION)330 1855 y(T)g(ranslation)41 b(is)f(considered)f(a) +i(kind)e(of)h(mo)s(di\014cation,)j(so)d(y)m(ou)g(ma)m(y)h(distribute)e +(translations)330 1965 y(of)45 b(the)f(Do)s(cumen)m(t)h(under)e(the)h +(terms)h(of)f(section)i(4.)83 b(Replacing)45 b(In)m(v)-5 +b(arian)m(t)45 b(Sections)g(with)330 2074 y(translations)h(requires)f +(sp)s(ecial)h(p)s(ermission)f(from)g(their)g(cop)m(yrigh)m(t)i +(holders,)i(but)c(y)m(ou)g(ma)m(y)330 2184 y(include)24 +b(translations)i(of)e(some)h(or)g(all)g(In)m(v)-5 b(arian)m(t)25 +b(Sections)g(in)f(addition)h(to)g(the)g(original)h(v)m(ersions)330 +2293 y(of)32 b(these)f(In)m(v)-5 b(arian)m(t)33 b(Sections.)44 +b(Y)-8 b(ou)32 b(ma)m(y)g(include)f(a)h(translation)g(of)g(this)f +(License,)i(and)d(all)j(the)330 2403 y(license)42 b(notices)g(in)f(the) +h(Do)s(cumen)m(t,)j(and)40 b(an)m(y)i(W)-8 b(arran)m(t)m(y)42 +b(Disclaimers,)k(pro)m(vided)41 b(that)h(y)m(ou)330 2513 +y(also)f(include)f(the)g(original)h(English)f(v)m(ersion)g(of)g(this)g +(License)h(and)e(the)h(original)h(v)m(ersions)g(of)330 +2622 y(those)35 b(notices)g(and)e(disclaimers.)53 b(In)33 +b(case)i(of)g(a)f(disagreemen)m(t)h(b)s(et)m(w)m(een)g(the)f +(translation)i(and)330 2732 y(the)f(original)i(v)m(ersion)e(of)h(this)f +(License)h(or)f(a)g(notice)i(or)e(disclaimer,)i(the)f(original)g(v)m +(ersion)g(will)330 2841 y(prev)-5 b(ail.)330 2984 y(If)28 +b(a)h(section)h(in)e(the)h(Do)s(cumen)m(t)h(is)e(En)m(titled)i(\\Ac)m +(kno)m(wledgemen)m(ts",)i(\\Dedications",)g(or)d(\\His-)330 +3093 y(tory",)f(the)f(requiremen)m(t)f(\(section)i(4\))f(to)g(Preserv)m +(e)g(its)f(Title)i(\(section)f(1\))g(will)g(t)m(ypically)h(require)330 +3203 y(c)m(hanging)j(the)g(actual)h(title.)199 3345 y(9.)61 +b(TERMINA)-8 b(TION)330 3488 y(Y)g(ou)30 b(ma)m(y)h(not)f(cop)m(y)-8 +b(,)31 b(mo)s(dify)-8 b(,)30 b(sublicense,)g(or)g(distribute)f(the)h +(Do)s(cumen)m(t)g(except)h(as)f(expressly)330 3598 y(pro)m(vided)38 +b(under)f(this)i(License.)65 b(An)m(y)39 b(attempt)h(otherwise)f(to)g +(cop)m(y)-8 b(,)42 b(mo)s(dify)-8 b(,)40 b(sublicense,)h(or)330 +3707 y(distribute)30 b(it)h(is)f(v)m(oid,)h(and)f(will)h(automatically) +i(terminate)f(y)m(our)e(righ)m(ts)h(under)e(this)h(License.)330 +3850 y(Ho)m(w)m(ev)m(er,)35 b(if)e(y)m(ou)f(cease)i(all)f(violation)i +(of)d(this)g(License,)i(then)e(y)m(our)h(license)g(from)f(a)h +(particular)330 3959 y(cop)m(yrigh)m(t)k(holder)e(is)h(reinstated)h +(\(a\))f(pro)m(visionally)-8 b(,)39 b(unless)c(and)g(un)m(til)h(the)g +(cop)m(yrigh)m(t)h(holder)330 4069 y(explicitly)42 b(and)e(\014nally)h +(terminates)g(y)m(our)g(license,)j(and)c(\(b\))h(p)s(ermanen)m(tly)-8 +b(,)43 b(if)e(the)g(cop)m(yrigh)m(t)330 4178 y(holder)34 +b(fails)h(to)g(notify)g(y)m(ou)g(of)f(the)h(violation)h(b)m(y)e(some)h +(reasonable)g(means)g(prior)e(to)i(60)h(da)m(ys)330 4288 +y(after)31 b(the)f(cessation.)330 4430 y(Moreo)m(v)m(er,)k(y)m(our)d +(license)i(from)e(a)h(particular)f(cop)m(yrigh)m(t)i(holder)e(is)h +(reinstated)g(p)s(ermanen)m(tly)f(if)330 4540 y(the)d(cop)m(yrigh)m(t)h +(holder)f(noti\014es)g(y)m(ou)g(of)g(the)g(violation)h(b)m(y)f(some)g +(reasonable)h(means,)f(this)g(is)g(the)330 4650 y(\014rst)f(time)i(y)m +(ou)f(ha)m(v)m(e)h(receiv)m(ed)g(notice)g(of)f(violation)i(of)e(this)f +(License)i(\(for)f(an)m(y)g(w)m(ork\))g(from)f(that)330 +4759 y(cop)m(yrigh)m(t)33 b(holder,)g(and)e(y)m(ou)h(cure)g(the)g +(violation)i(prior)d(to)i(30)f(da)m(ys)h(after)f(y)m(our)g(receipt)h +(of)f(the)330 4869 y(notice.)330 5011 y(T)-8 b(ermination)28 +b(of)g(y)m(our)f(righ)m(ts)h(under)e(this)i(section)g(do)s(es)f(not)h +(terminate)h(the)e(licenses)i(of)f(parties)330 5121 y(who)38 +b(ha)m(v)m(e)h(receiv)m(ed)h(copies)e(or)h(righ)m(ts)f(from)g(y)m(ou)g +(under)f(this)h(License.)64 b(If)38 b(y)m(our)g(righ)m(ts)h(ha)m(v)m(e) +330 5230 y(b)s(een)25 b(terminated)i(and)e(not)h(p)s(ermanen)m(tly)g +(reinstated,)i(receipt)f(of)f(a)g(cop)m(y)h(of)f(some)h(or)f(all)h(of)f +(the)330 5340 y(same)31 b(material)h(do)s(es)e(not)g(giv)m(e)i(y)m(ou)f +(an)m(y)g(righ)m(ts)f(to)i(use)e(it.)p eop end +%%Page: 158 164 +TeXDict begin 158 163 bop 150 -116 a Fu(App)s(endix)29 +b(C:)h(GNU)h(F)-8 b(ree)31 b(Do)s(cumen)m(tation)i(License)1560 +b(158)154 299 y(10.)61 b(FUTURE)30 b(REVISIONS)f(OF)i(THIS)e(LICENSE) +330 433 y(The)41 b(F)-8 b(ree)43 b(Soft)m(w)m(are)f(F)-8 +b(oundation)43 b(ma)m(y)f(publish)e(new,)k(revised)d(v)m(ersions)h(of)g +(the)g(GNU)g(F)-8 b(ree)330 543 y(Do)s(cumen)m(tation)34 +b(License)e(from)g(time)h(to)g(time.)46 b(Suc)m(h)31 +b(new)h(v)m(ersions)g(will)h(b)s(e)e(similar)h(in)g(spirit)330 +653 y(to)j(the)g(presen)m(t)f(v)m(ersion,)i(but)e(ma)m(y)h(di\013er)f +(in)g(detail)h(to)g(address)f(new)g(problems)f(or)i(concerns.)330 +762 y(See)c Ft(http://www.gnu.org/copy)o(left)o(/)p Fu(.)330 +897 y(Eac)m(h)f(v)m(ersion)g(of)g(the)f(License)h(is)g(giv)m(en)g(a)g +(distinguishing)f(v)m(ersion)h(n)m(um)m(b)s(er.)39 b(If)29 +b(the)g(Do)s(cumen)m(t)330 1006 y(sp)s(eci\014es)45 b(that)h(a)g +(particular)f(n)m(um)m(b)s(ered)f(v)m(ersion)i(of)f(this)g(License)h +(\\or)g(an)m(y)g(later)g(v)m(ersion")330 1116 y(applies)33 +b(to)g(it,)h(y)m(ou)e(ha)m(v)m(e)i(the)f(option)g(of)f(follo)m(wing)i +(the)f(terms)f(and)g(conditions)h(either)g(of)f(that)330 +1225 y(sp)s(eci\014ed)37 b(v)m(ersion)i(or)e(of)h(an)m(y)h(later)g(v)m +(ersion)f(that)g(has)g(b)s(een)f(published)f(\(not)j(as)f(a)g(draft\))g +(b)m(y)330 1335 y(the)33 b(F)-8 b(ree)34 b(Soft)m(w)m(are)f(F)-8 +b(oundation.)49 b(If)32 b(the)h(Do)s(cumen)m(t)g(do)s(es)g(not)g(sp)s +(ecify)f(a)h(v)m(ersion)g(n)m(um)m(b)s(er)f(of)330 1445 +y(this)i(License,)j(y)m(ou)d(ma)m(y)i(c)m(ho)s(ose)f(an)m(y)g(v)m +(ersion)g(ev)m(er)g(published)e(\(not)i(as)g(a)f(draft\))h(b)m(y)f(the) +h(F)-8 b(ree)330 1554 y(Soft)m(w)m(are)33 b(F)-8 b(oundation.)46 +b(If)32 b(the)g(Do)s(cumen)m(t)g(sp)s(eci\014es)g(that)g(a)h(pro)m(xy)f +(can)g(decide)g(whic)m(h)g(future)330 1664 y(v)m(ersions)h(of)g(this)f +(License)h(can)g(b)s(e)f(used,)g(that)i(pro)m(xy's)e(public)g(statemen) +m(t)i(of)f(acceptance)i(of)e(a)330 1773 y(v)m(ersion)e(p)s(ermanen)m +(tly)f(authorizes)h(y)m(ou)g(to)g(c)m(ho)s(ose)g(that)g(v)m(ersion)g +(for)f(the)h(Do)s(cumen)m(t.)154 1908 y(11.)61 b(RELICENSING)330 +2042 y(\\Massiv)m(e)39 b(Multiauthor)f(Collab)s(oration)g(Site")h(\(or) +e(\\MMC)h(Site"\))h(means)e(an)m(y)h(W)-8 b(orld)37 b(Wide)330 +2152 y(W)-8 b(eb)36 b(serv)m(er)g(that)h(publishes)d(cop)m(yrigh)m +(table)k(w)m(orks)e(and)f(also)i(pro)m(vides)e(prominen)m(t)h +(facilities)330 2262 y(for)27 b(an)m(yb)s(o)s(dy)g(to)h(edit)g(those)g +(w)m(orks.)39 b(A)28 b(public)f(wiki)h(that)g(an)m(yb)s(o)s(dy)e(can)i +(edit)g(is)f(an)h(example)g(of)330 2371 y(suc)m(h)33 +b(a)h(serv)m(er.)51 b(A)34 b(\\Massiv)m(e)i(Multiauthor)e(Collab)s +(oration")h(\(or)f(\\MMC"\))h(con)m(tained)g(in)f(the)330 +2481 y(site)d(means)f(an)m(y)h(set)g(of)g(cop)m(yrigh)m(table)h(w)m +(orks)e(th)m(us)g(published)f(on)h(the)h(MMC)f(site.)330 +2615 y(\\CC-BY-SA")36 b(means)f(the)g(Creativ)m(e)i(Commons)e(A)m +(ttribution-Share)g(Alik)m(e)i(3.0)f(license)g(pub-)330 +2725 y(lished)27 b(b)m(y)f(Creativ)m(e)j(Commons)d(Corp)s(oration,)h(a) +g(not-for-pro\014t)g(corp)s(oration)h(with)e(a)h(principal)330 +2834 y(place)g(of)f(business)e(in)i(San)f(F)-8 b(rancisco,)29 +b(California,)f(as)e(w)m(ell)h(as)f(future)f(cop)m(yleft)i(v)m(ersions) +f(of)g(that)330 2944 y(license)31 b(published)e(b)m(y)h(that)h(same)g +(organization.)330 3078 y(\\Incorp)s(orate")h(means)e(to)h(publish)e +(or)i(republish)e(a)i(Do)s(cumen)m(t,)g(in)g(whole)g(or)f(in)g(part,)h +(as)g(part)330 3188 y(of)g(another)f(Do)s(cumen)m(t.)330 +3323 y(An)c(MMC)g(is)h(\\eligible)h(for)e(relicensing")h(if)g(it)f(is)h +(licensed)f(under)f(this)h(License,)i(and)e(if)g(all)h(w)m(orks)330 +3432 y(that)43 b(w)m(ere)f(\014rst)f(published)f(under)h(this)h +(License)g(somewhere)g(other)g(than)g(this)g(MMC,)h(and)330 +3542 y(subsequen)m(tly)34 b(incorp)s(orated)h(in)f(whole)h(or)g(in)f +(part)h(in)m(to)h(the)f(MMC,)g(\(1\))h(had)e(no)h(co)m(v)m(er)h(texts) +330 3651 y(or)30 b(in)m(v)-5 b(arian)m(t)32 b(sections,)g(and)d(\(2\))j +(w)m(ere)f(th)m(us)f(incorp)s(orated)g(prior)g(to)h(No)m(v)m(em)m(b)s +(er)g(1,)g(2008.)330 3786 y(The)40 b(op)s(erator)h(of)g(an)f(MMC)h +(Site)g(ma)m(y)g(republish)e(an)h(MMC)h(con)m(tained)h(in)e(the)h(site) +g(under)330 3895 y(CC-BY-SA)30 b(on)g(the)h(same)f(site)h(at)g(an)m(y)g +(time)g(b)s(efore)e(August)h(1,)h(2009,)h(pro)m(vided)e(the)g(MMC)h(is) +330 4005 y(eligible)h(for)e(relicensing.)p eop end +%%Page: 159 165 +TeXDict begin 159 164 bop 150 -116 a Fu(App)s(endix)29 +b(C:)h(GNU)h(F)-8 b(ree)31 b(Do)s(cumen)m(tation)i(License)1560 +b(159)150 299 y Fs(ADDENDUM:)45 b(Ho)l(w)h(to)f(use)g(this)h(License)f +(for)g(y)l(our)g(do)t(cumen)l(ts)150 458 y Fu(T)-8 b(o)35 +b(use)f(this)h(License)g(in)f(a)h(do)s(cumen)m(t)g(y)m(ou)f(ha)m(v)m(e) +i(written,)g(include)f(a)f(cop)m(y)i(of)f(the)f(License)h(in)g(the)150 +568 y(do)s(cumen)m(t)30 b(and)g(put)g(the)g(follo)m(wing)i(cop)m(yrigh) +m(t)g(and)e(license)h(notices)g(just)f(after)h(the)g(title)h(page:)468 +680 y Fe(Copyright)42 b(\(C\))79 b Fd(year)g(your)40 +b(name)p Fe(.)468 767 y(Permission)i(is)e(granted)g(to)g(copy,)h +(distribute)g(and/or)g(modify)f(this)g(document)468 854 +y(under)h(the)f(terms)g(of)g(the)g(GNU)g(Free)g(Documentation)i +(License,)f(Version)g(1.3)468 941 y(or)f(any)g(later)g(version)h +(published)h(by)d(the)h(Free)g(Software)h(Foundation;)468 +1029 y(with)g(no)e(Invariant)j(Sections,)f(no)f(Front-Cover)h(Texts,)g +(and)f(no)f(Back-Cover)468 1116 y(Texts.)80 b(A)40 b(copy)g(of)g(the)f +(license)i(is)f(included)h(in)f(the)g(section)g(entitled)h(``GNU)468 +1203 y(Free)g(Documentation)h(License''.)275 1337 y Fu(If)d(y)m(ou)h +(ha)m(v)m(e)h(In)m(v)-5 b(arian)m(t)41 b(Sections,)i(F)-8 +b(ron)m(t-Co)m(v)m(er)42 b(T)-8 b(exts)41 b(and)e(Bac)m(k-Co)m(v)m(er)k +(T)-8 b(exts,)43 b(replace)e(the)150 1447 y(\\with)6 +b(.)22 b(.)g(.)12 b(T)-8 b(exts.")41 b(line)31 b(with)f(this:)547 +1559 y Fe(with)40 b(the)g(Invariant)h(Sections)g(being)g +Fd(list)f(their)g(titles)p Fe(,)h(with)547 1646 y(the)f(Front-Cover)i +(Texts)e(being)g Fd(list)p Fe(,)h(and)f(with)g(the)g(Back-Cover)h +(Texts)547 1733 y(being)f Fd(list)p Fe(.)275 1868 y Fu(If)34 +b(y)m(ou)i(ha)m(v)m(e)g(In)m(v)-5 b(arian)m(t)36 b(Sections)g(without)f +(Co)m(v)m(er)h(T)-8 b(exts,)38 b(or)d(some)g(other)h(com)m(bination)g +(of)g(the)150 1978 y(three,)31 b(merge)g(those)g(t)m(w)m(o)g +(alternativ)m(es)i(to)e(suit)f(the)h(situation.)275 2112 +y(If)23 b(y)m(our)h(do)s(cumen)m(t)f(con)m(tains)i(non)m(trivial)g +(examples)g(of)f(program)f(co)s(de,)j(w)m(e)e(recommend)g(releasing)150 +2222 y(these)44 b(examples)f(in)g(parallel)h(under)e(y)m(our)h(c)m +(hoice)i(of)e(free)g(soft)m(w)m(are)h(license,)k(suc)m(h)43 +b(as)g(the)g(GNU)150 2331 y(General)31 b(Public)f(License,)i(to)f(p)s +(ermit)e(their)i(use)f(in)g(free)g(soft)m(w)m(are.)p +eop end +%%Page: 160 166 +TeXDict begin 160 165 bop 150 -116 a Fu(App)s(endix)29 +b(D:)i(Indexes)2623 b(160)150 299 y Fp(App)t(endix)52 +b(D)81 b(Indexes)150 631 y Fs(D.1)68 b(Index)45 b(of)g(Shell)g(Builtin) +g(Commands)150 868 y(.)150 984 y Fe(.)13 b Fc(:)g(:)g(:)g(:)h(:)f(:)g +(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) +g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)h(:)f(:)g(:)g(:)39 b Fb(41)150 1218 y Fs(:)150 1335 +y Fe(:)13 b Fc(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) +g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)39 +b Fb(41)150 1579 y Fs([)150 1695 y Fe([)13 b Fc(:)g(:)g(:)g(:)h(:)f(:)g +(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(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(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)41 +b Fb(99)p eop end +%%Page: 161 167 +TeXDict begin 161 166 bop 150 -116 a Fu(App)s(endix)29 +b(D:)i(Indexes)2623 b(161)150 299 y Fs(T)150 428 y Fe(test)23 +b Fc(:)13 b(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g +(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:) +h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)49 b Fb(45)150 522 y +Fe(times)21 b Fc(:)13 b(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:) +g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)46 b Fb(46)150 +616 y Fe(trap)23 b Fc(:)13 b(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:) +f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)49 +b Fb(47)150 709 y Fe(type)23 b Fc(:)13 b(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)49 +b Fb(56)150 803 y Fe(typeset)15 b Fc(:)f(:)f(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f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37 b Fb(20)p eop end +%%Page: 162 168 +TeXDict begin 162 167 bop 150 -116 a Fu(App)s(endix)29 +b(D:)i(Indexes)2623 b(162)150 299 y Fs(*)150 415 y Fe(*)13 +b Fc(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) +g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g +(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)39 b Fb(20)150 +649 y Fs(-)150 765 y Fe(-)13 b Fc(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g +(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:) +h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g +(:)g(:)39 b Fb(20)150 999 y Fs(?)150 1115 y Fe(?)13 b +Fc(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:) +h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)39 b Fb(20)150 +1349 y Fs(@)150 1465 y Fe(@)13 b Fc(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g +(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:) +h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g +(:)g(:)39 b Fb(20)p 159 1699 41 6 v 150 1815 a Fe(_)13 +b Fc(:)g(:)g(:)g(:)h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:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:) +33 b Fb(73)2025 824 y Fe(completion-display-width)26 +b Fc(:)13 b(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f +(:)g(:)47 b Fb(105)2025 911 y Fe(completion-ignore-case)8 +b Fc(:)18 b(:)13 b(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g +(:)g(:)g(:)g(:)h(:)f(:)35 b Fb(105)2025 999 y Fe(completion-map-case)16 +b Fc(:)h(:)c(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)g(:)h(:)f(:)g(:)g(:)g(:)43 b Fb(105)2025 1086 y Fe +(completion-prefix-display-leng)q(th)17 b Fc(:)i(:)13 +b(:)g(:)h(:)f(:)g(:)g(:)g(:)44 b Fb(106)2025 1174 y Fe +(completion-query-items)8 b Fc(:)18 b(:)13 b(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)35 b +Fb(106)2025 1261 y Fe(COMPREPLY)9 b Fc(:)15 b(:)f(:)f(:)g(:)g(:)g(:)g +(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:) +h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)36 b +Fb(73)2025 1349 y Fe(convert-meta)17 b Fc(:)e(:)f(:)f(:)g(:)g(:)g(:)g +(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:) +h(:)f(:)g(:)g(:)g(:)g(:)g(:)44 b Fb(106)2025 1436 y Fe(COPROC)17 +b Fc(:)d(:)g(:)f(:)g(:)g(:)g(:)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)g(:)h(:)f(:)g(:)46 b Fb(78)2025 2471 y Fe(SHELLOPTS)9 +b Fc(:)15 b(:)f(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:) +f(:)g(:)g(:)36 b Fb(78)2025 2560 y Fe(SHLVL)21 b Fc(:)13 +b(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) +g(:)g(:)h(:)f(:)g(:)46 b Fb(78)2025 2650 y Fe(show-all-if-ambiguous)11 +b Fc(:)18 b(:)13 b(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)h(:)f(:)g(:)g(:)g(:)g(:)38 b Fb(109)2025 2740 y Fe +(show-all-if-unmodified)8 b Fc(:)18 b(:)13 b(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)35 b +Fb(109)2025 2830 y Fe(show-mode-in-prompt)16 b Fc(:)h(:)c(:)g(:)h(:)f +(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:) +g(:)43 b Fb(109)2025 2919 y Fe(skip-completed-text)16 +b Fc(:)h(:)c(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)g(:)h(:)f(:)g(:)g(:)g(:)43 b Fb(109)2025 3184 y Fs(T)2025 +3306 y Fe(TEXTDOMAIN)9 b Fc(:)15 b(:)e(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)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+g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)34 +b Fb(79)2025 4279 y Fs(V)2025 4400 y Fe(visible-stats)14 +b Fc(:)i(:)d(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) +g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)41 +b Fb(109)150 4649 y Fs(D.4)68 b(F)-11 b(unction)44 b(Index)150 +4886 y(A)150 5010 y Fe(abort)27 b(\(C-g\))9 b Fc(:)14 +b(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)36 +b Fb(122)150 5102 y Fe(accept-line)28 b(\(Newline)g(or)e(Return\))e +Fc(:)13 b(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)50 b +Fb(116)150 5193 y Fe(alias-expand-line)29 b(\(\))21 b +Fc(:)13 b(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)47 b Fb(124)2025 4886 y Fs(B)2025 +5033 y Fe(backward-char)28 b(\(C-b\))c Fc(:)13 b(:)h(:)f(:)g(:)g(:)g(:) +g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)50 +b Fb(115)2025 5135 y Fe(backward-delete-char)30 b(\(Rubout\))14 +b Fc(:)h(:)e(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)41 +b Fb(117)2025 5238 y Fe(backward-kill-line)29 b(\(C-x)e(Rubout\))16 +b Fc(:)f(:)e(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)43 b Fb(118)2025 +5340 y Fe(backward-kill-word)29 b(\(M-DEL\))24 b Fc(:)13 +b(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)49 +b Fb(119)p eop end +%%Page: 164 170 +TeXDict begin 164 169 bop 150 -116 a Fu(App)s(endix)29 +b(D:)i(Indexes)2623 b(164)150 299 y Fe(backward-word)29 +b(\(M-b\))23 b Fc(:)14 b(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) +g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)49 b Fb(115)150 +387 y Fe(beginning-of-history)30 b(\(M-<\))23 b Fc(:)13 +b(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)49 +b Fb(116)150 475 y Fe(beginning-of-line)29 b(\(C-a\))13 +b Fc(:)h(:)f(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:) +g(:)h(:)f(:)39 b Fb(115)150 732 y Fs(C)150 851 y Fe +(call-last-kbd-macro)30 b(\(C-x)c(e\))9 b Fc(:)14 b(:)f(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)36 b Fb(121)150 +939 y Fe(capitalize-word)29 b(\(M-c\))18 b Fc(:)c(:)f(:)g(:)g(:)h(:)f +(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)44 +b Fb(118)150 1027 y Fe(character-search)29 b(\(C-]\))15 +b Fc(:)g(:)e(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:) +g(:)g(:)g(:)g(:)42 b Fb(122)150 1115 y Fe(character-search-backward)31 +b(\(M-C-]\))23 b Fc(:)13 b(:)g(:)h(:)f(:)g(:)g(:)g(:)48 +b Fb(122)150 1204 y Fe(clear-screen)28 b(\(C-l\))8 b +Fc(:)15 b(:)e(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)35 b Fb(115)150 +1292 y Fe(complete)27 b(\(TAB\))20 b Fc(:)13 b(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)g(:)h(:)f(:)g(:)45 b Fb(120)150 1380 y Fe(complete-command)29 +b(\(M-!\))15 b Fc(:)g(:)e(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)42 b Fb(121)150 1468 y +Fe(complete-filename)29 b(\(M-/\))13 b Fc(:)h(:)f(:)h(:)f(:)g(:)g(:)g +(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)39 +b Fb(120)150 1556 y Fe(complete-hostname)29 b(\(M-@\))13 +b Fc(:)h(:)f(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:) +g(:)h(:)f(:)39 b Fb(121)150 1645 y Fe(complete-into-braces)30 +b(\(M-{\))23 b Fc(:)13 b(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:) +g(:)g(:)g(:)49 b Fb(121)150 1733 y Fe(complete-username)29 +b(\(M-~\))13 b Fc(:)h(:)f(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)39 b Fb(121)150 1821 y Fe(complete-variable) +29 b(\(M-$\))13 b Fc(:)h(:)f(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:) +g(:)g(:)g(:)g(:)g(:)h(:)f(:)39 b Fb(121)150 1909 y Fe +(copy-backward-word)30 b(\(\))18 b Fc(:)13 b(:)g(:)g(:)g(:)h(:)f(:)g(:) +g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)44 +b Fb(119)150 1998 y Fe(copy-forward-word)29 b(\(\))21 +b Fc(:)13 b(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)47 b Fb(119)150 2086 y Fe +(copy-region-as-kill)30 b(\(\))15 b Fc(:)f(:)f(:)g(:)g(:)g(:)g(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)42 +b Fb(119)150 2343 y Fs(D)150 2461 y Fe(dabbrev-expand)29 +b(\(\))11 b Fc(:)i(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)38 +b Fb(121)150 2549 y Fe(delete-char)28 b(\(C-d\))11 b +Fc(:)j(:)f(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)38 b Fb(117)150 +2638 y Fe(delete-char-or-list)30 b(\(\))15 b Fc(:)f(:)f(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)42 +b Fb(120)150 2726 y Fe(delete-horizontal-space)31 b(\(\))22 +b Fc(:)13 b(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:) +49 b Fb(119)150 2814 y Fe(digit-argument)29 b(\()p Fd(M-0)p +Fe(,)e Fd(M-1)p Fe(,)f(...)g Fd(M--)p Fe(\))d Fc(:)13 +b(:)h(:)f(:)g(:)g(:)g(:)g(:)49 b Fb(119)150 2902 y Fe +(display-shell-version)30 b(\(C-x)d(C-v\))16 b Fc(:)e(:)f(:)g(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)43 b Fb(123)150 2991 y Fe(do-uppercase-version) +30 b(\(M-a,)d(M-b,)f(M-)p Fd(x)p Fe(,)h(...)q(\))325 +3078 y Fc(:)13 b(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)48 b Fb(122)150 3166 +y Fe(downcase-word)29 b(\(M-l\))23 b Fc(:)14 b(:)f(:)g(:)g(:)g(:)g(:)g +(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)49 +b Fb(118)150 3254 y Fe(dump-functions)29 b(\(\))11 b +Fc(:)i(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)38 b Fb(123)150 +3342 y Fe(dump-macros)28 b(\(\))19 b Fc(:)13 b(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)g(:)h(:)f(:)g(:)45 b Fb(123)150 3431 y Fe(dump-variables)29 +b(\(\))11 b Fc(:)i(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)38 +b Fb(123)150 3519 y Fe(dynamic-complete-history)31 b(\(M-TAB\))7 +b Fc(:)15 b(:)e(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)33 b Fb(121)150 +3776 y Fs(E)150 3894 y Fe(edit-and-execute-command)e(\(C-xC-e\))23 +b Fc(:)13 b(:)g(:)h(:)f(:)g(:)g(:)g(:)48 b Fb(124)150 +3982 y Fe(end-kbd-macro)29 b(\(C-x)d(\)\))7 b Fc(:)14 +b(:)f(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)34 b Fb(121)150 4071 y Fd(end-of-file)28 +b Fe(\(usually)g(C-d\))14 b Fc(:)g(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g +(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)41 b Fb(117)150 4159 y +Fe(end-of-history)29 b(\(M->\))21 b Fc(:)13 b(:)g(:)h(:)f(:)g(:)g(:)g +(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)47 +b Fb(116)150 4247 y Fe(end-of-line)28 b(\(C-e\))11 b +Fc(:)j(:)f(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)38 b Fb(115)150 +4335 y Fe(exchange-point-and-mark)31 b(\(C-x)26 b(C-x\))11 +b Fc(:)j(:)g(:)f(:)g(:)g(:)g(:)g(:)g(:)38 b Fb(122)150 +4592 y Fs(F)150 4710 y Fe(forward-backward-delete-char)32 +b(\(\))9 b Fc(:)14 b(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)36 +b Fb(117)150 4799 y Fe(forward-char)28 b(\(C-f\))8 b +Fc(:)15 b(:)e(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)35 b Fb(115)150 +4887 y Fe(forward-search-history)c(\(C-s\))17 b Fc(:)d(:)f(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)44 b Fb(116)150 4975 +y Fe(forward-word)28 b(\(M-f\))8 b Fc(:)15 b(:)e(:)g(:)g(:)g(:)h(:)f(:) +g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g +(:)35 b Fb(115)150 5222 y Fs(G)150 5340 y Fe(glob-complete-word)30 +b(\(M-g\))10 b Fc(:)k(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)37 b Fb(123)2025 299 y Fe(glob-expand-word)29 +b(\(C-x)e(*\))17 b Fc(:)c(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)h(:)f(:)g(:)g(:)g(:)g(:)44 b Fb(123)2025 388 y Fe +(glob-list-expansions)30 b(\(C-x)c(g\))7 b Fc(:)14 b(:)f(:)g(:)g(:)g(:) +g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)34 b Fb(123)2025 +651 y Fs(H)2025 771 y Fe(history-and-alias-expand-line)e(\(\))7 +b Fc(:)13 b(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)34 b Fb(124)2025 +860 y Fe(history-expand-line)c(\(M-^\))8 b Fc(:)13 b(:)h(:)f(:)g(:)g(:) +g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)34 b +Fb(123)2025 950 y Fe(history-search-backward)d(\(\))22 +b Fc(:)13 b(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) +49 b Fb(116)2025 1039 y Fe(history-search-forward)30 +b(\(\))8 b Fc(:)13 b(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) +g(:)g(:)g(:)h(:)34 b Fb(116)2025 1128 y Fe +(history-substr-search-backward)e(\(\))22 b Fc(:)13 b(:)g(:)g(:)g(:)h +(:)f(:)g(:)48 b Fb(117)2025 1217 y Fe(history-substr-search-forward)32 +b(\(\))7 b Fc(:)13 b(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)34 +b Fb(116)2025 1480 y Fs(I)2025 1600 y Fe(insert-comment)29 +b(\(M-#\))21 b Fc(:)13 b(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:) +f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)47 b Fb(123)2025 +1690 y Fe(insert-completions)29 b(\(M-*\))10 b Fc(:)15 +b(:)e(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)37 b Fb(120)2025 1779 y Fe(insert-last-argument)30 +b(\(M-.)c(or)g(M-_\))18 b Fc(:)c(:)f(:)h(:)f(:)g(:)g(:)g(:)g(:)45 +b Fb(124)2025 2041 y Fs(K)2025 2162 y Fe(kill-line)27 +b(\(C-k\))16 b Fc(:)f(:)e(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g +(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)43 +b Fb(118)2025 2251 y Fe(kill-region)28 b(\(\))19 b Fc(:)13 +b(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g +(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)45 b Fb(119)2025 +2340 y Fe(kill-whole-line)29 b(\(\))8 b Fc(:)14 b(:)f(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:) +f(:)g(:)35 b Fb(118)2025 2430 y Fe(kill-word)27 b(\(M-d\))16 +b Fc(:)f(:)e(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:) +f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)43 b +Fb(118)2025 2682 y Fs(M)2025 2802 y Fe(magic-space)28 +b(\(\))19 b Fc(:)13 b(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)45 +b Fb(124)2025 2891 y Fe(menu-complete)28 b(\(\))13 b +Fc(:)h(:)f(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)40 b Fb(120)2025 +2981 y Fe(menu-complete-backward)30 b(\(\))8 b Fc(:)13 +b(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)34 +b Fb(120)2025 3243 y Fs(N)2025 3364 y Fe(next-history)28 +b(\(C-n\))8 b Fc(:)15 b(:)e(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g +(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)35 +b Fb(116)2025 3453 y Fe(non-incremental-forward-search)q(-hist)q(ory)d +(\(M-n\))2200 3540 y Fc(:)13 b(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:) +g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)49 b +Fb(116)2025 3629 y Fe(non-incremental-reverse-search)q(-hist)q(ory)32 +b(\(M-p\))2200 3716 y Fc(:)13 b(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:) +g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)49 b +Fb(116)2025 3960 y Fs(O)2025 4081 y Fe(operate-and-get-next)30 +b(\(C-o\))23 b Fc(:)13 b(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:) +g(:)g(:)g(:)49 b Fb(124)2025 4170 y Fe(overwrite-mode)29 +b(\(\))11 b Fc(:)i(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f +(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)38 +b Fb(118)2025 4422 y Fs(P)2025 4542 y Fe(possible-command-completions) +32 b(\(C-x)26 b(!\))21 b Fc(:)13 b(:)g(:)h(:)f(:)47 b +Fb(121)2025 4632 y Fe(possible-completions)30 b(\(M-?\))23 +b Fc(:)13 b(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) +49 b Fb(120)2025 4721 y Fe(possible-filename-completions)32 +b(\(C-x)26 b(/\))18 b Fc(:)c(:)f(:)g(:)45 b Fb(120)2025 +4810 y Fe(possible-hostname-completions)32 b(\(C-x)26 +b(@\))18 b Fc(:)c(:)f(:)g(:)45 b Fb(121)2025 4900 y Fe +(possible-username-completions)32 b(\(C-x)26 b(~\))18 +b Fc(:)c(:)f(:)g(:)45 b Fb(121)2025 4989 y Fe +(possible-variable-completions)32 b(\(C-x)26 b($\))18 +b Fc(:)c(:)f(:)g(:)45 b Fb(121)2025 5078 y Fe(prefix-meta)28 +b(\(ESC\))11 b Fc(:)j(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)38 +b Fb(122)2025 5167 y Fe(previous-history)29 b(\(C-p\))15 +b Fc(:)f(:)g(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:) +h(:)f(:)g(:)g(:)42 b Fb(116)2025 5257 y Fe(print-last-kbd-macro)30 +b(\(\))13 b Fc(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g +(:)g(:)g(:)g(:)g(:)g(:)40 b Fb(122)p eop end +%%Page: 165 171 +TeXDict begin 165 170 bop 150 -116 a Fu(App)s(endix)29 +b(D:)i(Indexes)2623 b(165)150 299 y Fs(Q)150 416 y Fe(quoted-insert)29 +b(\(C-q)d(or)g(C-v\))20 b Fc(:)13 b(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)45 b Fb(117)150 670 y Fs(R)150 +787 y Fe(re-read-init-file)29 b(\(C-x)e(C-r\))9 b Fc(:)14 +b(:)f(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)36 +b Fb(122)150 875 y Fe(redraw-current-line)30 b(\(\))15 +b Fc(:)f(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:) +g(:)g(:)g(:)g(:)42 b Fb(115)150 963 y Fe(reverse-search-history)31 +b(\(C-r\))17 b Fc(:)d(:)f(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)44 b Fb(116)150 1051 y Fe(revert-line)28 b(\(M-r\))11 +b Fc(:)j(:)f(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)38 b Fb(122)150 +1294 y Fs(S)150 1412 y Fe(self-insert)28 b(\(a,)e(b,)g(A,)g(1,)h(!,)f +(...\))7 b Fc(:)13 b(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)33 +b Fb(118)150 1499 y Fe(set-mark)27 b(\(C-@\))20 b Fc(:)13 +b(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)45 b Fb(122)150 +1587 y Fe(shell-backward-kill-word)31 b(\(\))20 b Fc(:)13 +b(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)46 +b Fb(119)150 1675 y Fe(shell-backward-word)30 b(\(\))15 +b Fc(:)f(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:) +g(:)g(:)g(:)g(:)42 b Fb(115)150 1762 y Fe(shell-expand-line)29 +b(\(M-C-e\))8 b Fc(:)15 b(:)e(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g +(:)g(:)g(:)h(:)f(:)g(:)34 b Fb(123)150 1850 y Fe(shell-forward-word)c +(\(\))18 b Fc(:)13 b(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:) +f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)44 b Fb(115)150 1938 +y Fe(shell-kill-word)29 b(\(\))8 b Fc(:)14 b(:)f(:)g(:)g(:)g(:)h(:)f(:) +g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g +(:)35 b Fb(119)150 2026 y Fe(skip-csi-sequence)29 b(\(\))21 +b Fc(:)13 b(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)47 b Fb(122)150 2113 y Fe(start-kbd-macro)29 +b(\(C-x)e(\(\))19 b Fc(:)14 b(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g +(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)46 b Fb(121)2025 299 +y Fs(T)2025 424 y Fe(tilde-expand)28 b(\(M-&\))8 b Fc(:)15 +b(:)e(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)35 b Fb(122)2025 515 y +Fe(transpose-chars)29 b(\(C-t\))18 b Fc(:)c(:)f(:)g(:)g(:)g(:)g(:)h(:)f +(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)45 +b Fb(118)2025 607 y Fe(transpose-words)29 b(\(M-t\))18 +b Fc(:)c(:)f(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:) +g(:)g(:)g(:)g(:)g(:)45 b Fb(118)2025 881 y Fs(U)2025 +1006 y Fe(undo)26 b(\(C-_)h(or)f(C-x)g(C-u\))c Fc(:)13 +b(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g +(:)h(:)f(:)g(:)g(:)48 b Fb(122)2025 1097 y Fe(universal-argument)29 +b(\(\))18 b Fc(:)c(:)f(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g +(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)45 b Fb(119)2025 1189 +y Fe(unix-filename-rubout)30 b(\(\))13 b Fc(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)40 +b Fb(119)2025 1280 y Fe(unix-line-discard)29 b(\(C-u\))13 +b Fc(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) +g(:)g(:)g(:)40 b Fb(118)2025 1372 y Fe(unix-word-rubout)29 +b(\(C-w\))15 b Fc(:)f(:)g(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)42 b Fb(119)2025 1463 +y Fe(upcase-word)28 b(\(M-u\))11 b Fc(:)j(:)f(:)g(:)g(:)g(:)h(:)f(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) +g(:)38 b Fb(118)2025 1737 y Fs(Y)2025 1862 y Fe(yank)26 +b(\(C-y\))12 b Fc(:)i(:)f(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f +(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:) +g(:)g(:)g(:)g(:)39 b Fb(119)2025 1954 y Fe(yank-last-arg)28 +b(\(M-.)f(or)f(M-_\))19 b Fc(:)14 b(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f +(:)g(:)g(:)g(:)g(:)g(:)g(:)46 b Fb(117)2025 2045 y Fe(yank-nth-arg)28 +b(\(M-C-y\))22 b Fc(:)13 b(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)47 b Fb(117)2025 +2137 y Fe(yank-pop)27 b(\(M-y\))20 b Fc(:)13 b(:)g(:)g(:)g(:)g(:)h(:)f +(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:) +g(:)g(:)g(:)g(:)h(:)45 b Fb(119)150 2369 y Fs(D.5)68 +b(Concept)45 b(Index)150 2629 y(A)150 2748 y Fb(alias)27 +b(expansion)18 b Fc(:)c(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:) +h(:)44 b Fb(88)150 2836 y(arithmetic)26 b(ev)l(aluation)16 +b Fc(:)e(:)f(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)43 b Fb(87)150 2925 +y(arithmetic)26 b(expansion)d Fc(:)13 b(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g +(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)49 +b Fb(29)150 3013 y(arithmetic,)27 b(shell)17 b Fc(:)d(:)f(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:) +f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)43 b Fb(87)150 3102 y(arra)n(ys)15 +b Fc(:)f(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:) +f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)41 b Fb(89)150 3358 y Fs(B)150 +3477 y Fb(bac)n(kground)9 b Fc(:)j(:)i(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:) +g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)35 b Fb(97)150 3565 y(Bash)26 +b(con\014guration)d Fc(:)13 b(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)49 +b Fb(138)150 3654 y(Bash)26 b(installation)c Fc(:)13 +b(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)46 b Fb(138)150 +3742 y(Bourne)26 b(shell)13 b Fc(:)h(:)f(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:) +g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f +(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)40 b Fb(5)150 3831 +y(brace)26 b(expansion)20 b Fc(:)14 b(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:) +g(:)g(:)g(:)g(:)47 b Fb(21)150 3919 y(builtin)9 b Fc(:)k(:)g(:)g(:)g(:) +g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f +(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:) +g(:)g(:)36 b Fb(3)150 4159 y Fs(C)150 4278 y Fb(command)26 +b(editing)13 b Fc(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g +(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)40 +b Fb(102)150 4366 y(command)26 b(execution)d Fc(:)13 +b(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)49 b Fb(36)150 4455 +y(command)26 b(expansion)16 b Fc(:)d(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:) +g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)42 +b Fb(35)150 4543 y(command)26 b(history)12 b Fc(:)h(:)g(:)g(:)g(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:) +g(:)g(:)g(:)g(:)g(:)39 b Fb(133)150 4632 y(command)26 +b(searc)n(h)10 b Fc(:)j(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g +(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:) +36 b Fb(36)150 4720 y(command)26 b(substitution)15 b +Fc(:)e(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)41 b Fb(28)150 4809 y(command)26 +b(timing)7 b Fc(:)13 b(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)34 b Fb(8)150 4897 y(commands,)26 b(comp)r(ound)18 +b Fc(:)c(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:) +f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)45 b Fb(9)150 4986 +y(commands,)26 b(conditional)d Fc(:)13 b(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)48 +b Fb(10)150 5074 y(commands,)26 b(grouping)9 b Fc(:)14 +b(:)f(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)35 b Fb(14)150 5163 +y(commands,)26 b(lists)6 b Fc(:)15 b(:)e(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:) +g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)33 b Fb(9)150 5251 y(commands,)26 +b(lo)r(oping)16 b Fc(:)f(:)e(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:) +f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)42 +b Fb(10)150 5340 y(commands,)26 b(pip)r(elines)12 b Fc(:)i(:)f(:)g(:)g +(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:) +g(:)g(:)g(:)g(:)g(:)g(:)39 b Fb(8)2025 2629 y(commands,)26 +b(shell)15 b Fc(:)f(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f +(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:) +42 b Fb(8)2025 2720 y(commands,)26 b(simple)17 b Fc(:)d(:)f(:)g(:)h(:)f +(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:) +g(:)g(:)g(:)g(:)h(:)f(:)g(:)44 b Fb(8)2025 2810 y(commen)n(ts,)26 +b(shell)7 b Fc(:)14 b(:)g(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)g(:)35 b Fb(7)2025 2901 y(completion)26 b(builtins)15 +b Fc(:)f(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:) +g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)42 b Fb(126)2025 +2991 y(con\014guration)15 b Fc(:)f(:)f(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)g(:)h(:)f(:)g(:)42 b Fb(138)2025 3082 y(con)n(trol)26 +b(op)r(erator)20 b Fc(:)14 b(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:) +g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g +(:)g(:)h(:)46 b Fb(3)2025 3172 y(copro)r(cess)12 b Fc(:)i(:)f(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:) +g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)38 +b Fb(15)2025 3439 y Fs(D)2025 3562 y Fb(directory)26 +b(stac)n(k)c Fc(:)13 b(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f +(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:) +g(:)49 b Fb(90)2025 3829 y Fs(E)2025 3952 y Fb(editing)26 +b(command)g(lines)11 b Fc(:)i(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f +(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)38 +b Fb(102)2025 4043 y(en)n(vironmen)n(t)12 b Fc(:)g(:)h(:)g(:)h(:)f(:)g +(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:) +g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)39 b Fb(37)2025 +4133 y(ev)l(aluation,)26 b(arithmetic)e Fc(:)13 b(:)g(:)g(:)g(:)g(:)g +(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:) +g(:)49 b Fb(87)2025 4224 y(ev)n(en)n(t)24 b(designators)14 +b Fc(:)h(:)e(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:) +g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)41 b +Fb(135)2025 4314 y(execution)25 b(en)n(vironmen)n(t)11 +b Fc(:)i(:)g(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:) +h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)37 b Fb(36)2025 4405 +y(exit)25 b(status)18 b Fc(:)c(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g +(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:) +h(:)f(:)g(:)g(:)g(:)45 b Fb(3,)26 b(38)2025 4495 y(expansion)20 +b Fc(:)13 b(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:) +g(:)g(:)g(:)47 b Fb(21)2025 4586 y(expansion,)26 b(arithmetic)12 +b Fc(:)i(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:) +h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)38 b Fb(29)2025 4676 +y(expansion,)26 b(brace)10 b Fc(:)j(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g +(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:) +h(:)f(:)g(:)36 b Fb(21)2025 4767 y(expansion,)26 b(\014lename)12 +b Fc(:)h(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) +g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)38 b Fb(30)2025 +4857 y(expansion,)26 b(parameter)14 b Fc(:)f(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h +(:)40 b Fb(23)2025 4948 y(expansion,)26 b(pathname)18 +b Fc(:)13 b(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)45 b Fb(30)2025 +5038 y(expansion,)26 b(tilde)8 b Fc(:)13 b(:)g(:)g(:)g(:)g(:)h(:)f(:)g +(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) +g(:)g(:)g(:)h(:)f(:)g(:)34 b Fb(22)2025 5129 y(expressions,)27 +b(arithmetic)7 b Fc(:)13 b(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)34 +b Fb(87)2025 5220 y(expressions,)27 b(conditional)11 +b Fc(:)j(:)f(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)g(:)h(:)f(:)g(:)g(:)g(:)38 b Fb(85)p eop end +%%Page: 166 172 +TeXDict begin 166 171 bop 150 -116 a Fu(App)s(endix)29 +b(D:)i(Indexes)2623 b(166)150 299 y Fs(F)150 415 y Fb(\014eld)15 +b Fc(:)e(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)42 b Fb(3)150 +502 y(\014lename)15 b Fc(:)f(:)f(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) +g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g +(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)42 b Fb(3)150 +589 y(\014lename)26 b(expansion)d Fc(:)13 b(:)g(:)g(:)g(:)g(:)g(:)h(:)f +(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:) +g(:)g(:)49 b Fb(30)150 676 y(foreground)24 b Fc(:)13 +b(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) +49 b Fb(97)150 764 y(functions,)26 b(shell)21 b Fc(:)14 +b(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g +(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)47 +b Fb(17)150 1013 y Fs(H)150 1129 y Fb(history)26 b(builtins)14 +b Fc(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:) +g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)40 +b Fb(133)150 1216 y(history)26 b(ev)n(en)n(ts)18 b Fc(:)13 +b(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)46 +b Fb(135)150 1304 y(history)26 b(expansion)8 b Fc(:)13 +b(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)35 b Fb(135)150 +1391 y(history)26 b(list)21 b Fc(:)13 b(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) +g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)47 b Fb(133)150 1478 +y(History)-6 b(,)26 b(ho)n(w)g(to)f(use)13 b Fc(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)g(:)h(:)39 b Fb(132)150 1728 y Fs(I)150 1843 y Fb(iden)n(ti\014er) +22 b Fc(:)14 b(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:) +g(:)g(:)g(:)g(:)g(:)g(:)50 b Fb(3)150 1931 y(initialization)28 +b(\014le,)e(readline)11 b Fc(:)j(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) +g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)38 b Fb(104)150 +2018 y(installation)13 b Fc(:)i(:)e(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:) +f(:)g(:)g(:)g(:)g(:)g(:)40 b Fb(138)150 2105 y(in)n(teraction,)27 +b(readline)18 b Fc(:)c(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g +(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)45 +b Fb(101)150 2192 y(in)n(teractiv)n(e)26 b(shell)14 b +Fc(:)g(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f +(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)41 b Fb(81,)26 +b(83)150 2279 y(in)n(ternationalization)14 b Fc(:)h(:)f(:)f(:)g(:)g(:)g +(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)g(:)g(:)g(:)g(:)g(:)g(:)h +(:)f(:)g(:)41 b Fb(7)150 3621 y(login)27 b(shell)17 b +Fc(:)d(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)g(:)44 b Fb(81)150 3871 y Fs(M)150 3987 y Fb(matc)n(hing,)26 +b(pattern)20 b Fc(:)14 b(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) +g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)47 +b Fb(30)150 4074 y(metac)n(haracter)18 b Fc(:)d(:)e(:)g(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:) +f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)45 b Fb(3)150 4307 +y Fs(N)150 4423 y Fb(name)13 b Fc(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:) +g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)40 +b Fb(3)150 4510 y(nativ)n(e)25 b(languages)13 b Fc(:)i(:)e(:)g(:)h(:)f +(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:) +g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)40 b Fb(7)150 4597 +y(notation,)27 b(readline)7 b Fc(:)13 b(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g +(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:) +g(:)h(:)33 b Fb(102)150 4847 y Fs(O)150 4963 y Fb(op)r(erator,)27 +b(shell)16 b Fc(:)e(:)f(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:) +g(:)g(:)43 b Fb(3)150 5212 y Fs(P)150 5328 y Fb(parameter)26 +b(expansion)7 b Fc(:)14 b(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g +(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)34 +b Fb(23)150 5415 y(parameters)17 b Fc(:)d(:)f(:)g(:)h(:)f(:)g(:)g(:)g +(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:) +g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)43 b Fb(18)2025 +299 y(parameters,)27 b(p)r(ositional)18 b Fc(:)d(:)e(:)g(:)g(:)g(:)g(:) +g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h +(:)44 b Fb(19)2025 387 y(parameters,)27 b(sp)r(ecial)18 +b Fc(:)c(:)f(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:) +g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)44 b Fb(20)2025 +474 y(pathname)25 b(expansion)12 b Fc(:)h(:)g(:)h(:)f(:)g(:)g(:)g(:)g +(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(: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g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:) +f(:)g(:)g(:)g(:)g(:)49 b Fb(3)2025 1089 y(pro)r(cess)26 +b(substitution)c Fc(:)13 b(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g +(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)48 +b Fb(29)2025 1177 y(programmable)27 b(completion)20 b +Fc(:)13 b(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)46 b Fb(124)2025 1264 y(prompting)11 b +Fc(:)i(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:) +g(:)g(:)38 b Fb(92)2025 1517 y Fs(Q)2025 1634 y Fb(quoting)10 +b Fc(:)j(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:) +g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g +(:)g(:)g(:)g(:)h(:)f(:)g(:)37 b Fb(6)2025 1722 y(quoting,)26 +b(ANSI)13 b Fc(:)e(:)j(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g +(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:) +h(:)f(:)40 b Fb(6)2025 1974 y Fs(R)2025 2091 y Fb(Readline,)26 +b(ho)n(w)g(to)g(use)c Fc(:)13 b(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)49 +b Fb(100)2025 2179 y(redirection)7 b Fc(:)13 b(:)g(:)h(:)f(:)g(:)g(:)g +(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:) +g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)33 b +Fb(31)2025 2267 y(reserv)n(ed)25 b(w)n(ord)7 b Fc(:)14 +b(:)f(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)34 +b Fb(3)2025 2355 y(restricted)26 b(shell)8 b Fc(:)14 +b(:)f(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)35 +b Fb(93)2025 2443 y(return)25 b(status)c Fc(:)13 b(:)h(:)f(:)g(:)g(:)g +(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:) +g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)48 b Fb(4)2025 +2678 y Fs(S)2025 2796 y Fb(shell)26 b(arithmetic)11 b +Fc(:)j(:)f(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)37 +b Fb(87)2025 2883 y(shell)26 b(function)12 b Fc(:)h(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(: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(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:) +g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)37 b Fb(4,)26 b(68)2025 +3498 y(startup)f(\014les)d Fc(:)13 b(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:) +g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)48 b Fb(82)2025 3585 y(susp)r(ending)25 +b(jobs)6 b Fc(:)14 b(:)g(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:) +g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)33 b Fb(97)2025 3838 y Fs(T)2025 3955 y Fb(tilde)26 +b(expansion)18 b Fc(:)13 b(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f +(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:) +g(:)g(:)45 b Fb(22)2025 4043 y(tok)n(en)11 b Fc(:)h(:)i(:)f(:)g(:)g(:)g +(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:) +g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f +(:)g(:)38 b Fb(4)2025 4131 y(translation,)27 b(nativ)n(e)e(languages)13 +b Fc(:)i(:)e(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:) +g(:)g(:)g(:)40 b Fb(7)2025 4383 y Fs(V)2025 4500 y Fb(v)l(ariable,)26 +b(shell)8 b Fc(:)14 b(:)f(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g +(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:) +f(:)g(:)g(:)34 b Fb(18)2025 4588 y(v)l(ariables,)27 b(readline)18 +b Fc(:)c(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:) +f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)45 b Fb(105)2025 +4841 y Fs(W)2025 4958 y Fb(w)n(ord)21 b Fc(:)13 b(:)g(:)g(:)g(:)g(:)h +(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:) +g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g +(:)g(:)48 b Fb(4)2025 5046 y(w)n(ord)26 b(splitting)21 +b Fc(:)13 b(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)47 +b Fb(29)2025 5298 y Fs(Y)2025 5415 y Fb(y)n(anking)25 +b(text)7 b Fc(:)12 b(:)h(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:) +g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g(:)g(:)g(:)g(:)g(:)h(:)f(:)g(:)g +(:)g(:)g(:)34 b Fb(103)p eop end +%%Trailer + +userdict /end-hook known{end-hook}if +%%EOF diff --git a/doc/bashref.texi b/doc/bashref.texi new file mode 100644 index 0000000..597274b --- /dev/null +++ b/doc/bashref.texi @@ -0,0 +1,8750 @@ +\input texinfo.tex @c -*- texinfo -*- +@c %**start of header +@setfilename bashref.info +@settitle Bash Reference Manual + +@include version.texi +@c %**end of header + +@copying +This text is a brief description of the features that are present in +the Bash shell (version @value{VERSION}, @value{UPDATED}). + +This is Edition @value{EDITION}, last updated @value{UPDATED}, +of @cite{The GNU Bash Reference Manual}, +for @code{Bash}, Version @value{VERSION}. + +Copyright @copyright{} 1988--2014 Free Software Foundation, Inc. + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 or +any later version published by the Free Software Foundation; with no +Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. +A copy of the license is included in the section entitled +``GNU Free Documentation License''. +@end quotation +@end copying + +@defcodeindex bt +@defcodeindex rw +@set BashFeatures + +@dircategory Basics +@direntry +* Bash: (bash). The GNU Bourne-Again SHell. +@end direntry + +@finalout + +@titlepage +@title Bash Reference Manual +@subtitle Reference Documentation for Bash +@subtitle Edition @value{EDITION}, for @code{Bash} Version @value{VERSION}. +@subtitle @value{UPDATED-MONTH} +@author Chet Ramey, Case Western Reserve University +@author Brian Fox, Free Software Foundation + +@page +@vskip 0pt plus 1filll +@insertcopying + +@end titlepage + +@contents + +@ifnottex +@node Top, Introduction, (dir), (dir) +@top Bash Features + +This text is a brief description of the features that are present in +the Bash shell (version @value{VERSION}, @value{UPDATED}). +The Bash home page is @url{http://www.gnu.org/software/bash/}. + +This is Edition @value{EDITION}, last updated @value{UPDATED}, +of @cite{The GNU Bash Reference Manual}, +for @code{Bash}, Version @value{VERSION}. + +Bash contains features that appear in other popular shells, and some +features that only appear in Bash. Some of the shells that Bash has +borrowed concepts from are the Bourne Shell (@file{sh}), the Korn Shell +(@file{ksh}), and the C-shell (@file{csh} and its successor, +@file{tcsh}). The following menu breaks the features up into +categories, noting which features were inspired by other shells and +which are specific to Bash. + +This manual is meant as a brief introduction to features found in +Bash. The Bash manual page should be used as the definitive +reference on shell behavior. + +@menu +* Introduction:: An introduction to the shell. +* Definitions:: Some definitions used in the rest of this + manual. +* Basic Shell Features:: The shell "building blocks". +* Shell Builtin Commands:: Commands that are a part of the shell. +* Shell Variables:: Variables used or set by Bash. +* Bash Features:: Features found only in Bash. +* Job Control:: What job control is and how Bash allows you + to use it. +* Command Line Editing:: Chapter describing the command line + editing features. +* Using History Interactively:: Command History Expansion +* Installing Bash:: How to build and install Bash on your system. +* Reporting Bugs:: How to report bugs in Bash. +* Major Differences From The Bourne Shell:: A terse list of the differences + between Bash and historical + versions of /bin/sh. +* GNU Free Documentation License:: Copying and sharing this documentation. +* Indexes:: Various indexes for this manual. +@end menu +@end ifnottex + +@node Introduction +@chapter Introduction +@menu +* What is Bash?:: A short description of Bash. +* What is a shell?:: A brief introduction to shells. +@end menu + +@node What is Bash? +@section What is Bash? + +Bash is the shell, or command language interpreter, +for the @sc{gnu} operating system. +The name is an acronym for the @samp{Bourne-Again SHell}, +a pun on Stephen Bourne, the author of the direct ancestor of +the current Unix shell @code{sh}, +which appeared in the Seventh Edition Bell Labs Research version +of Unix. + +Bash is largely compatible with @code{sh} and incorporates useful +features from the Korn shell @code{ksh} and the C shell @code{csh}. +It is intended to be a conformant implementation of the @sc{ieee} +@sc{posix} Shell and Tools portion of the @sc{ieee} @sc{posix} +specification (@sc{ieee} Standard 1003.1). +It offers functional improvements over @code{sh} for both interactive and +programming use. + +While the @sc{gnu} operating system provides other shells, including +a version of @code{csh}, Bash is the default shell. +Like other @sc{gnu} software, Bash is quite portable. It currently runs +on nearly every version of Unix and a few other operating systems @minus{} +independently-supported ports exist for @sc{ms-dos}, @sc{os/2}, +and Windows platforms. + +@node What is a shell? +@section What is a shell? + +At its base, a shell is simply a macro processor that executes +commands. The term macro processor means functionality where text +and symbols are expanded to create larger expressions. + +A Unix shell is both a command interpreter and a programming +language. As a command interpreter, the shell provides the user +interface to the rich set of @sc{gnu} utilities. The programming +language features allow these utilities to be combined. +Files containing commands can be created, and become +commands themselves. These new commands have the same status as +system commands in directories such as @file{/bin}, allowing users +or groups to establish custom environments to automate their common +tasks. + +Shells may be used interactively or non-interactively. In +interactive mode, they accept input typed from the keyboard. +When executing non-interactively, shells execute commands read +from a file. + +A shell allows execution of @sc{gnu} commands, both synchronously and +asynchronously. +The shell waits for synchronous commands to complete before accepting +more input; asynchronous commands continue to execute in parallel +with the shell while it reads and executes additional commands. +The @dfn{redirection} constructs permit +fine-grained control of the input and output of those commands. +Moreover, the shell allows control over the contents of commands' +environments. + +Shells also provide a small set of built-in +commands (@dfn{builtins}) implementing functionality impossible +or inconvenient to obtain via separate utilities. +For example, @code{cd}, @code{break}, @code{continue}, and +@code{exec} cannot be implemented outside of the shell because +they directly manipulate the shell itself. +The @code{history}, @code{getopts}, @code{kill}, or @code{pwd} +builtins, among others, could be implemented in separate utilities, +but they are more convenient to use as builtin commands. +All of the shell builtins are described in +subsequent sections. + +While executing commands is essential, most of the power (and +complexity) of shells is due to their embedded programming +languages. Like any high-level language, the shell provides +variables, flow control constructs, quoting, and functions. + +Shells offer features geared specifically for +interactive use rather than to augment the programming language. +These interactive features include job control, command line +editing, command history and aliases. Each of these features is +described in this manual. + +@node Definitions +@chapter Definitions +These definitions are used throughout the remainder of this manual. + +@table @code + +@item POSIX +@cindex POSIX +A family of open system standards based on Unix. Bash +is primarily concerned with the Shell and Utilities portion of the +@sc{posix} 1003.1 standard. + +@item blank +A space or tab character. + +@item builtin +@cindex builtin +A command that is implemented internally by the shell itself, rather +than by an executable program somewhere in the file system. + +@item control operator +@cindex control operator +A @code{token} that performs a control function. It is a @code{newline} +or one of the following: +@samp{||}, @samp{&&}, @samp{&}, @samp{;}, @samp{;;}, +@samp{|}, @samp{|&}, @samp{(}, or @samp{)}. + +@item exit status +@cindex exit status +The value returned by a command to its caller. The value is restricted +to eight bits, so the maximum value is 255. + +@item field +@cindex field +A unit of text that is the result of one of the shell expansions. After +expansion, when executing a command, the resulting fields are used as +the command name and arguments. + +@item filename +@cindex filename +A string of characters used to identify a file. + +@item job +@cindex job +A set of processes comprising a pipeline, and any processes descended +from it, that are all in the same process group. + +@item job control +@cindex job control +A mechanism by which users can selectively stop (suspend) and restart +(resume) execution of processes. + +@item metacharacter +@cindex metacharacter +A character that, when unquoted, separates words. A metacharacter is +a @code{blank} or one of the following characters: +@samp{|}, @samp{&}, @samp{;}, @samp{(}, @samp{)}, @samp{<}, or +@samp{>}. + +@item name +@cindex name +@cindex identifier +A @code{word} consisting solely of letters, numbers, and underscores, +and beginning with a letter or underscore. @code{Name}s are used as +shell variable and function names. +Also referred to as an @code{identifier}. + +@item operator +@cindex operator, shell +A @code{control operator} or a @code{redirection operator}. +@xref{Redirections}, for a list of redirection operators. +Operators contain at least one unquoted @code{metacharacter}. + +@item process group +@cindex process group +A collection of related processes each having the same process +group @sc{id}. + +@item process group ID +@cindex process group ID +A unique identifier that represents a @code{process group} +during its lifetime. + +@item reserved word +@cindex reserved word +A @code{word} that has a special meaning to the shell. Most reserved +words introduce shell flow control constructs, such as @code{for} and +@code{while}. + +@item return status +@cindex return status +A synonym for @code{exit status}. + +@item signal +@cindex signal +A mechanism by which a process may be notified by the kernel +of an event occurring in the system. + +@item special builtin +@cindex special builtin +A shell builtin command that has been classified as special by the +@sc{posix} standard. + +@item token +@cindex token +A sequence of characters considered a single unit by the shell. +It is either a @code{word} or an @code{operator}. + +@item word +@cindex word +A sequence of characters treated as a unit by the shell. +Words may not include unquoted @code{metacharacters}. +@end table + +@node Basic Shell Features +@chapter Basic Shell Features +@cindex Bourne shell + +Bash is an acronym for @samp{Bourne-Again SHell}. +The Bourne shell is +the traditional Unix shell originally written by Stephen Bourne. +All of the Bourne shell builtin commands are available in Bash, +The rules for evaluation and quoting are taken from the @sc{posix} +specification for the `standard' Unix shell. + +This chapter briefly summarizes the shell's `building blocks': +commands, control structures, shell functions, shell @i{parameters}, +shell expansions, +@i{redirections}, which are a way to direct input and output from +and to named files, and how the shell executes commands. + +@menu +* Shell Syntax:: What your input means to the shell. +* Shell Commands:: The types of commands you can use. +* Shell Functions:: Grouping commands by name. +* Shell Parameters:: How the shell stores values. +* Shell Expansions:: How Bash expands parameters and the various + expansions available. +* Redirections:: A way to control where input and output go. +* Executing Commands:: What happens when you run a command. +* Shell Scripts:: Executing files of shell commands. +@end menu + +@node Shell Syntax +@section Shell Syntax +@menu +* Shell Operation:: The basic operation of the shell. +* Quoting:: How to remove the special meaning from characters. +* Comments:: How to specify comments. +@end menu + +When the shell reads input, it proceeds through a +sequence of operations. If the input indicates the beginning of a +comment, the shell ignores the comment symbol (@samp{#}), and the rest +of that line. + +Otherwise, roughly speaking, the shell reads its input and +divides the input into words and operators, employing the quoting rules +to select which meanings to assign various words and characters. + +The shell then parses these tokens into commands and other constructs, +removes the special meaning of certain words or characters, expands +others, redirects input and output as needed, executes the specified +command, waits for the command's exit status, and makes that exit status +available for further inspection or processing. + +@node Shell Operation +@subsection Shell Operation + +The following is a brief description of the shell's operation when it +reads and executes a command. Basically, the shell does the +following: + +@enumerate +@item +Reads its input from a file (@pxref{Shell Scripts}), from a string +supplied as an argument to the @option{-c} invocation option +(@pxref{Invoking Bash}), or from the user's terminal. + +@item +Breaks the input into words and operators, obeying the quoting rules +described in @ref{Quoting}. These tokens are separated by +@code{metacharacters}. Alias expansion is performed by this step +(@pxref{Aliases}). + +@item +Parses the tokens into simple and compound commands +(@pxref{Shell Commands}). + +@item +Performs the various shell expansions (@pxref{Shell Expansions}), breaking +the expanded tokens into lists of filenames (@pxref{Filename Expansion}) +and commands and arguments. + +@item +Performs any necessary redirections (@pxref{Redirections}) and removes +the redirection operators and their operands from the argument list. + +@item +Executes the command (@pxref{Executing Commands}). + +@item +Optionally waits for the command to complete and collects its exit +status (@pxref{Exit Status}). + +@end enumerate + +@node Quoting +@subsection Quoting +@cindex quoting +@menu +* Escape Character:: How to remove the special meaning from a single + character. +* Single Quotes:: How to inhibit all interpretation of a sequence + of characters. +* Double Quotes:: How to suppress most of the interpretation of a + sequence of characters. +* ANSI-C Quoting:: How to expand ANSI-C sequences in quoted strings. +* Locale Translation:: How to translate strings into different languages. +@end menu + +Quoting is used to remove the special meaning of certain +characters or words to the shell. Quoting can be used to +disable special treatment for special characters, to prevent +reserved words from being recognized as such, and to prevent +parameter expansion. + +Each of the shell metacharacters (@pxref{Definitions}) +has special meaning to the shell and must be quoted if it is to +represent itself. +When the command history expansion facilities are being used +(@pxref{History Interaction}), the +@var{history expansion} character, usually @samp{!}, must be quoted +to prevent history expansion. @xref{Bash History Facilities}, for +more details concerning history expansion. + +There are three quoting mechanisms: the +@var{escape character}, single quotes, and double quotes. + +@node Escape Character +@subsubsection Escape Character +A non-quoted backslash @samp{\} is the Bash escape character. +It preserves the literal value of the next character that follows, +with the exception of @code{newline}. If a @code{\newline} pair +appears, and the backslash itself is not quoted, the @code{\newline} +is treated as a line continuation (that is, it is removed from +the input stream and effectively ignored). + +@node Single Quotes +@subsubsection Single Quotes + +Enclosing characters in single quotes (@samp{'}) preserves the literal value +of each character within the quotes. A single quote may not occur +between single quotes, even when preceded by a backslash. + +@node Double Quotes +@subsubsection Double Quotes + +Enclosing characters in double quotes (@samp{"}) preserves the literal value +of all characters within the quotes, with the exception of +@samp{$}, @samp{`}, @samp{\}, +and, when history expansion is enabled, @samp{!}. +The characters @samp{$} and @samp{`} +retain their special meaning within double quotes (@pxref{Shell Expansions}). +The backslash retains its special meaning only when followed by one of +the following characters: +@samp{$}, @samp{`}, @samp{"}, @samp{\}, or @code{newline}. +Within double quotes, backslashes that are followed by one of these +characters are removed. Backslashes preceding characters without a +special meaning are left unmodified. +A double quote may be quoted within double quotes by preceding it with +a backslash. +If enabled, history expansion will be performed unless an @samp{!} +appearing in double quotes is escaped using a backslash. +The backslash preceding the @samp{!} is not removed. + +The special parameters @samp{*} and @samp{@@} have special meaning +when in double quotes (@pxref{Shell Parameter Expansion}). + +@node ANSI-C Quoting +@subsubsection ANSI-C Quoting +@cindex quoting, ANSI + +Words of the form @code{$'@var{string}'} are treated specially. The +word expands to @var{string}, with backslash-escaped characters replaced +as specified by the ANSI C standard. Backslash escape sequences, if +present, are decoded as follows: + +@table @code +@item \a +alert (bell) +@item \b +backspace +@item \e +@itemx \E +an escape character (not ANSI C) +@item \f +form feed +@item \n +newline +@item \r +carriage return +@item \t +horizontal tab +@item \v +vertical tab +@item \\ +backslash +@item \' +single quote +@item \" +double quote +@item \@var{nnn} +the eight-bit character whose value is the octal value @var{nnn} +(one to three digits) +@item \x@var{HH} +the eight-bit character whose value is the hexadecimal value @var{HH} +(one or two hex digits) +@item \u@var{HHHH} +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +@var{HHHH} (one to four hex digits) +@item \U@var{HHHHHHHH} +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +@var{HHHHHHHH} (one to eight hex digits) +@item \c@var{x} +a control-@var{x} character +@end table + +@noindent +The expanded result is single-quoted, as if the dollar sign had not +been present. + +@node Locale Translation +@subsubsection Locale-Specific Translation +@cindex localization +@cindex internationalization +@cindex native languages +@cindex translation, native languages + +A double-quoted string preceded by a dollar sign (@samp{$}) will cause +the string to be translated according to the current locale. +If the current locale is @code{C} or @code{POSIX}, the dollar sign +is ignored. +If the string is translated and replaced, the replacement is +double-quoted. + +@vindex LC_MESSAGES +@vindex TEXTDOMAIN +@vindex TEXTDOMAINDIR +Some systems use the message catalog selected by the @env{LC_MESSAGES} +shell variable. Others create the name of the message catalog from the +value of the @env{TEXTDOMAIN} shell variable, possibly adding a +suffix of @samp{.mo}. If you use the @env{TEXTDOMAIN} variable, you +may need to set the @env{TEXTDOMAINDIR} variable to the location of +the message catalog files. Still others use both variables in this +fashion: +@env{TEXTDOMAINDIR}/@env{LC_MESSAGES}/LC_MESSAGES/@env{TEXTDOMAIN}.mo. + +@node Comments +@subsection Comments +@cindex comments, shell + +In a non-interactive shell, or an interactive shell in which the +@code{interactive_comments} option to the @code{shopt} +builtin is enabled (@pxref{The Shopt Builtin}), +a word beginning with @samp{#} +causes that word and all remaining characters on that line to +be ignored. An interactive shell without the @code{interactive_comments} +option enabled does not allow comments. The @code{interactive_comments} +option is on by default in interactive shells. +@xref{Interactive Shells}, for a description of what makes +a shell interactive. + +@node Shell Commands +@section Shell Commands +@cindex commands, shell + +A simple shell command such as @code{echo a b c} consists of the command +itself followed by arguments, separated by spaces. + +More complex shell commands are composed of simple commands arranged together +in a variety of ways: in a pipeline in which the output of one command +becomes the input of a second, in a loop or conditional construct, or in +some other grouping. + +@menu +* Simple Commands:: The most common type of command. +* Pipelines:: Connecting the input and output of several + commands. +* Lists:: How to execute commands sequentially. +* Compound Commands:: Shell commands for control flow. +* Coprocesses:: Two-way communication between commands. +* GNU Parallel:: Running commands in parallel. +@end menu + +@node Simple Commands +@subsection Simple Commands +@cindex commands, simple + +A simple command is the kind of command encountered most often. +It's just a sequence of words separated by @code{blank}s, terminated +by one of the shell's control operators (@pxref{Definitions}). The +first word generally specifies a command to be executed, with the +rest of the words being that command's arguments. + +The return status (@pxref{Exit Status}) of a simple command is +its exit status as provided +by the @sc{posix} 1003.1 @code{waitpid} function, or 128+@var{n} if +the command was terminated by signal @var{n}. + +@node Pipelines +@subsection Pipelines +@cindex pipeline +@cindex commands, pipelines + +A @code{pipeline} is a sequence of simple commands separated by one of +the control operators @samp{|} or @samp{|&}. + +@rwindex time +@rwindex ! +@cindex command timing +The format for a pipeline is +@example +[time [-p]] [!] @var{command1} [ | or |& @var{command2} ] @dots{} +@end example + +@noindent +The output of each command in the pipeline is connected via a pipe +to the input of the next command. +That is, each command reads the previous command's output. This +connection is performed before any redirections specified by the +command. + +If @samp{|&} is used, @var{command1}'s standard error, in addition to +its standard output, is connected to +@var{command2}'s standard input through the pipe; +it is shorthand for @code{2>&1 |}. +This implicit redirection of the standard error to the standard output is +performed after any redirections specified by the command. + +The reserved word @code{time} causes timing statistics +to be printed for the pipeline once it finishes. +The statistics currently consist of elapsed (wall-clock) time and +user and system time consumed by the command's execution. +The @option{-p} option changes the output format to that specified +by @sc{posix}. +When the shell is in @sc{posix} mode (@pxref{Bash POSIX Mode}), +it does not recognize @code{time} as a reserved word if the next +token begins with a @samp{-}. +The @env{TIMEFORMAT} variable may be set to a format string that +specifies how the timing information should be displayed. +@xref{Bash Variables}, for a description of the available formats. +The use of @code{time} as a reserved word permits the timing of +shell builtins, shell functions, and pipelines. An external +@code{time} command cannot time these easily. + +When the shell is in @sc{posix} mode (@pxref{Bash POSIX Mode}), @code{time} +may be followed by a newline. In this case, the shell displays the +total user and system time consumed by the shell and its children. +The @env{TIMEFORMAT} variable may be used to specify the format of +the time information. + +If the pipeline is not executed asynchronously (@pxref{Lists}), the +shell waits for all commands in the pipeline to complete. + +Each command in a pipeline is executed in its own subshell +(@pxref{Command Execution Environment}). The exit +status of a pipeline is the exit status of the last command in the +pipeline, unless the @code{pipefail} option is enabled +(@pxref{The Set Builtin}). +If @code{pipefail} is enabled, the pipeline's return status is the +value of the last (rightmost) command to exit with a non-zero status, +or zero if all commands exit successfully. +If the reserved word @samp{!} precedes the pipeline, the +exit status is the logical negation of the exit status as described +above. +The shell waits for all commands in the pipeline to terminate before +returning a value. + +@node Lists +@subsection Lists of Commands +@cindex commands, lists + +A @code{list} is a sequence of one or more pipelines separated by one +of the operators @samp{;}, @samp{&}, @samp{&&}, or @samp{||}, +and optionally terminated by one of @samp{;}, @samp{&}, or a +@code{newline}. + +Of these list operators, @samp{&&} and @samp{||} +have equal precedence, followed by @samp{;} and @samp{&}, +which have equal precedence. + +A sequence of one or more newlines may appear in a @code{list} +to delimit commands, equivalent to a semicolon. + +If a command is terminated by the control operator @samp{&}, +the shell executes the command asynchronously in a subshell. +This is known as executing the command in the @var{background}. +The shell does not wait for the command to finish, and the return +status is 0 (true). +When job control is not active (@pxref{Job Control}), +the standard input for asynchronous commands, in the absence of any +explicit redirections, is redirected from @code{/dev/null}. + +Commands separated by a @samp{;} are executed sequentially; the shell +waits for each command to terminate in turn. The return status is the +exit status of the last command executed. + +@sc{and} and @sc{or} lists are sequences of one or more pipelines +separated by the control operators @samp{&&} and @samp{||}, +respectively. @sc{and} and @sc{or} lists are executed with left +associativity. + +An @sc{and} list has the form +@example +@var{command1} && @var{command2} +@end example + +@noindent +@var{command2} is executed if, and only if, @var{command1} +returns an exit status of zero. + +An @sc{or} list has the form +@example +@var{command1} || @var{command2} +@end example + +@noindent +@var{command2} is executed if, and only if, @var{command1} +returns a non-zero exit status. + +The return status of +@sc{and} and @sc{or} lists is the exit status of the last command +executed in the list. + +@node Compound Commands +@subsection Compound Commands +@cindex commands, compound + +@menu +* Looping Constructs:: Shell commands for iterative action. +* Conditional Constructs:: Shell commands for conditional execution. +* Command Grouping:: Ways to group commands. +@end menu + +Compound commands are the shell programming constructs. +Each construct begins with a reserved word or control operator and is +terminated by a corresponding reserved word or operator. +Any redirections (@pxref{Redirections}) associated with a compound command +apply to all commands within that compound command unless explicitly overridden. + +In most cases a list of commands in a compound command's description may be +separated from the rest of the command by one or more newlines, and may be +followed by a newline in place of a semicolon. + +Bash provides looping constructs, conditional commands, and mechanisms +to group commands and execute them as a unit. + +@node Looping Constructs +@subsubsection Looping Constructs +@cindex commands, looping + +Bash supports the following looping constructs. + +Note that wherever a @samp{;} appears in the description of a +command's syntax, it may be replaced with one or more newlines. + +@table @code +@item until +@rwindex until +@rwindex do +@rwindex done +The syntax of the @code{until} command is: + +@example +until @var{test-commands}; do @var{consequent-commands}; done +@end example + +Execute @var{consequent-commands} as long as +@var{test-commands} has an exit status which is not zero. +The return status is the exit status of the last command executed +in @var{consequent-commands}, or zero if none was executed. + +@item while +@rwindex while +The syntax of the @code{while} command is: + +@example +while @var{test-commands}; do @var{consequent-commands}; done +@end example + +Execute @var{consequent-commands} as long as +@var{test-commands} has an exit status of zero. +The return status is the exit status of the last command executed +in @var{consequent-commands}, or zero if none was executed. + +@item for +@rwindex for +The syntax of the @code{for} command is: + +@example +for @var{name} [ [in [@var{words} @dots{}] ] ; ] do @var{commands}; done +@end example + +Expand @var{words}, and execute @var{commands} once for each member +in the resultant list, with @var{name} bound to the current member. +If @samp{in @var{words}} is not present, the @code{for} command +executes the @var{commands} once for each positional parameter that is +set, as if @samp{in "$@@"} had been specified +(@pxref{Special Parameters}). +The return status is the exit status of the last command that executes. +If there are no items in the expansion of @var{words}, no commands are +executed, and the return status is zero. + +An alternate form of the @code{for} command is also supported: + +@example +for (( @var{expr1} ; @var{expr2} ; @var{expr3} )) ; do @var{commands} ; done +@end example + +First, the arithmetic expression @var{expr1} is evaluated according +to the rules described below (@pxref{Shell Arithmetic}). +The arithmetic expression @var{expr2} is then evaluated repeatedly +until it evaluates to zero. +Each time @var{expr2} evaluates to a non-zero value, @var{commands} are +executed and the arithmetic expression @var{expr3} is evaluated. +If any expression is omitted, it behaves as if it evaluates to 1. +The return value is the exit status of the last command in @var{commands} +that is executed, or false if any of the expressions is invalid. +@end table + +The @code{break} and @code{continue} builtins (@pxref{Bourne Shell Builtins}) +may be used to control loop execution. + +@node Conditional Constructs +@subsubsection Conditional Constructs +@cindex commands, conditional + +@table @code +@item if +@rwindex if +@rwindex then +@rwindex else +@rwindex elif +@rwindex fi +The syntax of the @code{if} command is: + +@example +if @var{test-commands}; then + @var{consequent-commands}; +[elif @var{more-test-commands}; then + @var{more-consequents};] +[else @var{alternate-consequents};] +fi +@end example + +The @var{test-commands} list is executed, and if its return status is zero, +the @var{consequent-commands} list is executed. +If @var{test-commands} returns a non-zero status, each @code{elif} list +is executed in turn, and if its exit status is zero, +the corresponding @var{more-consequents} is executed and the +command completes. +If @samp{else @var{alternate-consequents}} is present, and +the final command in the final @code{if} or @code{elif} clause +has a non-zero exit status, then @var{alternate-consequents} is executed. +The return status is the exit status of the last command executed, or +zero if no condition tested true. + +@item case +@rwindex case +@rwindex in +@rwindex esac +The syntax of the @code{case} command is: + +@example +case @var{word} in [ [(] @var{pattern} [| @var{pattern}]@dots{}) @var{command-list} ;;]@dots{} esac +@end example + +@code{case} will selectively execute the @var{command-list} corresponding to +the first @var{pattern} that matches @var{word}. +If the shell option @code{nocasematch} +(see the description of @code{shopt} in @ref{The Shopt Builtin}) +is enabled, the match is performed without regard to the case +of alphabetic characters. +The @samp{|} is used to separate multiple patterns, and the @samp{)} +operator terminates a pattern list. +A list of patterns and an associated command-list is known +as a @var{clause}. + +Each clause must be terminated with @samp{;;}, @samp{;&}, or @samp{;;&}. +The @var{word} undergoes tilde expansion, parameter expansion, command +substitution, arithmetic expansion, and quote removal before matching is +attempted. Each @var{pattern} undergoes tilde expansion, parameter +expansion, command substitution, and arithmetic expansion. + +There may be an arbitrary number of @code{case} clauses, each terminated +by a @samp{;;}, @samp{;&}, or @samp{;;&}. +The first pattern that matches determines the +command-list that is executed. +It's a common idiom to use @samp{*} as the final pattern to define the +default case, since that pattern will always match. + +Here is an example using @code{case} in a script that could be used to +describe one interesting feature of an animal: + +@example +echo -n "Enter the name of an animal: " +read ANIMAL +echo -n "The $ANIMAL has " +case $ANIMAL in + horse | dog | cat) echo -n "four";; + man | kangaroo ) echo -n "two";; + *) echo -n "an unknown number of";; +esac +echo " legs." +@end example + +@noindent + +If the @samp{;;} operator is used, no subsequent matches are attempted after +the first pattern match. +Using @samp{;&} in place of @samp{;;} causes execution to continue with +the @var{command-list} associated with the next clause, if any. +Using @samp{;;&} in place of @samp{;;} causes the shell to test the patterns +in the next clause, if any, and execute any associated @var{command-list} +on a successful match. + +The return status is zero if no @var{pattern} is matched. Otherwise, the +return status is the exit status of the @var{command-list} executed. + +@item select +@rwindex select + +The @code{select} construct allows the easy generation of menus. +It has almost the same syntax as the @code{for} command: + +@example +select @var{name} [in @var{words} @dots{}]; do @var{commands}; done +@end example + +The list of words following @code{in} is expanded, generating a list +of items. The set of expanded words is printed on the standard +error output stream, each preceded by a number. If the +@samp{in @var{words}} is omitted, the positional parameters are printed, +as if @samp{in "$@@"} had been specified. +The @env{PS3} prompt is then displayed and a line is read from the +standard input. +If the line consists of a number corresponding to one of the displayed +words, then the value of @var{name} is set to that word. +If the line is empty, the words and prompt are displayed again. +If @code{EOF} is read, the @code{select} command completes. +Any other value read causes @var{name} to be set to null. +The line read is saved in the variable @env{REPLY}. + +The @var{commands} are executed after each selection until a +@code{break} command is executed, at which +point the @code{select} command completes. + +Here is an example that allows the user to pick a filename from the +current directory, and displays the name and index of the file +selected. + +@example +select fname in *; +do + echo you picked $fname \($REPLY\) + break; +done +@end example + +@item ((@dots{})) +@example +(( @var{expression} )) +@end example + +The arithmetic @var{expression} is evaluated according to the rules +described below (@pxref{Shell Arithmetic}). +If the value of the expression is non-zero, the return status is 0; +otherwise the return status is 1. This is exactly equivalent to +@example +let "@var{expression}" +@end example +@noindent +@xref{Bash Builtins}, for a full description of the @code{let} builtin. + +@item [[@dots{}]] +@rwindex [[ +@rwindex ]] +@example +[[ @var{expression} ]] +@end example + +Return a status of 0 or 1 depending on the evaluation of +the conditional expression @var{expression}. +Expressions are composed of the primaries described below in +@ref{Bash Conditional Expressions}. +Word splitting and filename expansion are not performed on the words +between the @code{[[} and @code{]]}; tilde expansion, parameter and +variable expansion, arithmetic expansion, command substitution, process +substitution, and quote removal are performed. +Conditional operators such as @samp{-f} must be unquoted to be recognized +as primaries. + +When used with @code{[[}, the @samp{<} and @samp{>} operators sort +lexicographically using the current locale. + +When the @samp{==} and @samp{!=} operators are used, the string to the +right of the operator is considered a pattern and matched according +to the rules described below in @ref{Pattern Matching}, +as if the @code{extglob} shell option were enabled. +The @samp{=} operator is identical to @samp{==}. +If the shell option @code{nocasematch} +(see the description of @code{shopt} in @ref{The Shopt Builtin}) +is enabled, the match is performed without regard to the case +of alphabetic characters. +The return value is 0 if the string matches (@samp{==}) or does not +match (@samp{!=})the pattern, and 1 otherwise. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. + +An additional binary operator, @samp{=~}, is available, with the same +precedence as @samp{==} and @samp{!=}. +When it is used, the string to the right of the operator is considered +an extended regular expression and matched accordingly (as in @i{regex}3)). +The return value is 0 if the string matches +the pattern, and 1 otherwise. +If the regular expression is syntactically incorrect, the conditional +expression's return value is 2. +If the shell option @code{nocasematch} +(see the description of @code{shopt} in @ref{The Shopt Builtin}) +is enabled, the match is performed without regard to the case +of alphabetic characters. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +Bracket expressions in regular expressions must be treated carefully, +since normal quoting characters lose their meanings between brackets. +If the pattern is stored in a shell variable, quoting the variable +expansion forces the entire pattern to be matched as a string. +Substrings matched by parenthesized subexpressions within the regular +expression are saved in the array variable @code{BASH_REMATCH}. +The element of @code{BASH_REMATCH} with index 0 is the portion of the string +matching the entire regular expression. +The element of @code{BASH_REMATCH} with index @var{n} is the portion of the +string matching the @var{n}th parenthesized subexpression. + +For example, the following will match a line +(stored in the shell variable @var{line}) +if there is a sequence of characters in the value consisting of +any number, including zero, of +space characters, zero or one instances of @samp{a}, then a @samp{b}: +@example +[[ $line =~ [[:space:]]*(a)?b ]] +@end example + +@noindent +That means values like @samp{aab} and @samp{ aaaaaab} will match, as +will a line containing a @samp{b} anywhere in its value. + +Storing the regular expression in a shell variable is often a useful +way to avoid problems with quoting characters that are special to the +shell. +It is sometimes difficult to specify a regular expression literally +without using quotes, or to keep track of the quoting used by regular +expressions while paying attention to the shell's quote removal. +Using a shell variable to store the pattern decreases these problems. +For example, the following is equivalent to the above: +@example +pattern='[[:space:]]*(a)?b' +[[ $line =~ $pattern ]] +@end example + +@noindent +If you want to match a character that's special to the regular expression +grammar, it has to be quoted to remove its special meaning. +This means that in the pattern @samp{xxx.txt}, the @samp{.} matches any +character in the string (its usual regular expression meaning), but in the +pattern @samp{"xxx.txt"} it can only match a literal @samp{.}. +Shell programmers should take special care with backslashes, since backslashes +are used both by the shell and regular expressions to remove the special +meaning from the following character. +The following two sets of commands are @emph{not} equivalent: +@example +pattern='\.' + +[[ . =~ $pattern ]] +[[ . =~ \. ]] + +[[ . =~ "$pattern" ]] +[[ . =~ '\.' ]] +@end example + +@noindent +The first two matches will succeed, but the second two will not, because +in the second two the backslash will be part of the pattern to be matched. +In the first two examples, the backslash removes the special meaning from +@samp{.}, so the literal @samp{.} matches. +If the string in the first examples were anything other than @samp{.}, say +@samp{a}, the pattern would not match, because the quoted @samp{.} in the +pattern loses its special meaning of matching any single character. + +Expressions may be combined using the following operators, listed +in decreasing order of precedence: + +@table @code +@item ( @var{expression} ) +Returns the value of @var{expression}. +This may be used to override the normal precedence of operators. + +@item ! @var{expression} +True if @var{expression} is false. + +@item @var{expression1} && @var{expression2} +True if both @var{expression1} and @var{expression2} are true. + +@item @var{expression1} || @var{expression2} +True if either @var{expression1} or @var{expression2} is true. +@end table + +@noindent +The @code{&&} and @code{||} operators do not evaluate @var{expression2} if the +value of @var{expression1} is sufficient to determine the return +value of the entire conditional expression. +@end table + +@node Command Grouping +@subsubsection Grouping Commands +@cindex commands, grouping + +Bash provides two ways to group a list of commands to be executed +as a unit. When commands are grouped, redirections may be applied +to the entire command list. For example, the output of all the +commands in the list may be redirected to a single stream. + +@table @code +@item () +@example +( @var{list} ) +@end example + +Placing a list of commands between parentheses causes a subshell +environment to be created (@pxref{Command Execution Environment}), and each +of the commands in @var{list} to be executed in that subshell. Since the +@var{list} is executed in a subshell, variable assignments do not remain in +effect after the subshell completes. + +@item @{@} +@rwindex @{ +@rwindex @} +@example +@{ @var{list}; @} +@end example + +Placing a list of commands between curly braces causes the list to +be executed in the current shell context. No subshell is created. +The semicolon (or newline) following @var{list} is required. +@end table + +In addition to the creation of a subshell, there is a subtle difference +between these two constructs due to historical reasons. The braces +are @code{reserved words}, so they must be separated from the @var{list} +by @code{blank}s or other shell metacharacters. +The parentheses are @code{operators}, and are +recognized as separate tokens by the shell even if they are not separated +from the @var{list} by whitespace. + +The exit status of both of these constructs is the exit status of +@var{list}. + +@node Coprocesses +@subsection Coprocesses +@cindex coprocess + +A @code{coprocess} is a shell command preceded by the @code{coproc} +reserved word. +A coprocess is executed asynchronously in a subshell, as if the command +had been terminated with the @samp{&} control operator, with a two-way pipe +established between the executing shell and the coprocess. + +The format for a coprocess is: +@example +coproc [@var{NAME}] @var{command} [@var{redirections}] +@end example + +@noindent +This creates a coprocess named @var{NAME}. +If @var{NAME} is not supplied, the default name is @var{COPROC}. +@var{NAME} must not be supplied if @var{command} is a simple +command (@pxref{Simple Commands}); otherwise, it is interpreted as +the first word of the simple command. + +When the coprocess is executed, the shell creates an array variable +(@pxref{Arrays}) +named @env{NAME} in the context of the executing shell. +The standard output of @var{command} +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to @env{NAME}[0]. +The standard input of @var{command} +is connected via a pipe to a file descriptor in the executing shell, +and that file descriptor is assigned to @env{NAME}[1]. +This pipe is established before any redirections specified by the +command (@pxref{Redirections}). +The file descriptors can be utilized as arguments to shell commands +and redirections using standard word expansions. +The file descriptors are not available in subshells. + +The process ID of the shell spawned to execute the coprocess is +available as the value of the variable @env{NAME}_PID. +The @code{wait} +builtin command may be used to wait for the coprocess to terminate. + +Since the coprocess is created as an asynchronous command, +the @code{coproc} command always returns success. +The return status of a coprocess is the exit status of @var{command}. + +@node GNU Parallel +@subsection GNU Parallel + +There are ways to run commands in parallel that are not built into Bash. +GNU Parallel is a tool to do just that. + +GNU Parallel, as its name suggests, can be used to build and run commands +in parallel. You may run the same command with different arguments, whether +they are filenames, usernames, hostnames, or lines read from files. GNU +Parallel provides shorthand references to many of the most common operations +(input lines, various portions of the input line, different ways to specify +the input source, and so on). Parallel can replace @code{xargs} or feed +commands from its input sources to several different instances of Bash. + +For a complete description, refer to the GNU Parallel documentation. A few +examples should provide a brief introduction to its use. + +For example, it is easy to replace @code{xargs} to gzip all html files in the +current directory and its subdirectories: +@example +find . -type f -name '*.html' -print | parallel gzip +@end example +@noindent +If you need to protect special characters such as newlines in file names, +use find's @option{-print0} option and parallel's @option{-0} option. + +You can use Parallel to move files from the current directory when the +number of files is too large to process with one @code{mv} invocation: +@example +ls | parallel mv @{@} destdir +@end example + +As you can see, the @{@} is replaced with each line read from standard input. +While using @code{ls} will work in most instances, it is not sufficient to +deal with all filenames. +If you need to accommodate special characters in filenames, you can use + +@example +find . -depth 1 \! -name '.*' -print0 | parallel -0 mv @{@} destdir +@end example + +@noindent +as alluded to above. + +This will run as many @code{mv} commands as there are files in the current +directory. +You can emulate a parallel @code{xargs} by adding the @option{-X} option: +@example +find . -depth 1 \! -name '.*' -print0 | parallel -0 -X mv @{@} destdir +@end example + +GNU Parallel can replace certain common idioms that operate on lines read +from a file (in this case, filenames listed one per line): +@example + while IFS= read -r x; do + do-something1 "$x" "config-$x" + do-something2 < "$x" + done < file | process-output +@end example + +@noindent +with a more compact syntax reminiscent of lambdas: +@example +cat list | parallel "do-something1 @{@} config-@{@} ; do-something2 < @{@}" | process-output +@end example + +Parallel provides a built-in mechanism to remove filename extensions, which +lends itself to batch file transformations or renaming: +@example +ls *.gz | parallel -j+0 "zcat @{@} | bzip2 >@{.@}.bz2 && rm @{@}" +@end example +@noindent +This will recompress all files in the current directory with names ending +in .gz using bzip2, running one job per CPU (-j+0) in parallel. +(We use @code{ls} for brevity here; using @code{find} as above is more +robust in the face of filenames containing unexpected characters.) +Parallel can take arguments from the command line; the above can also be +written as + +@example +parallel "zcat @{@} | bzip2 >@{.@}.bz2 && rm @{@}" ::: *.gz +@end example + +If a command generates output, you may want to preserve the input order in +the output. For instance, the following command +@example +@{ echo foss.org.my ; echo debian.org; echo freenetproject.org; @} | parallel traceroute +@end example +@noindent +will display as output the traceroute invocation that finishes first. +Adding the @option{-k} option +@example +@{ echo foss.org.my ; echo debian.org; echo freenetproject.org; @} | parallel -k traceroute +@end example +@noindent +will ensure that the output of @code{traceroute foss.org.my} is displayed first. + +Finally, Parallel can be used to run a sequence of shell commands in parallel, +similar to @samp{cat file | bash}. +It is not uncommon to take a list of filenames, create a series of shell +commands to operate on them, and feed that list of commnds to a shell. +Parallel can speed this up. Assuming that @file{file} contains a list of +shell commands, one per line, + +@example +parallel -j 10 < file +@end example + +@noindent +will evaluate the commands using the shell (since no explicit command is +supplied as an argument), in blocks of ten shell jobs at a time. + +@node Shell Functions +@section Shell Functions +@cindex shell function +@cindex functions, shell + +Shell functions are a way to group commands for later execution +using a single name for the group. They are executed just like +a "regular" command. +When the name of a shell function is used as a simple command name, +the list of commands associated with that function name is executed. +Shell functions are executed in the current +shell context; no new process is created to interpret them. + +Functions are declared using this syntax: +@rwindex function +@example +@var{name} () @var{compound-command} [ @var{redirections} ] +@end example + +or + +@example +function @var{name} [()] @var{compound-command} [ @var{redirections} ] +@end example + +This defines a shell function named @var{name}. The reserved +word @code{function} is optional. +If the @code{function} reserved +word is supplied, the parentheses are optional. +The @var{body} of the function is the compound command +@var{compound-command} (@pxref{Compound Commands}). +That command is usually a @var{list} enclosed between @{ and @}, but +may be any compound command listed above. +@var{compound-command} is executed whenever @var{name} is specified as the +name of a command. +When the shell is in @sc{posix} mode (@pxref{Bash POSIX Mode}), +@var{name} may not be the same as one of the special builtins +(@pxref{Special Builtins}). +Any redirections (@pxref{Redirections}) associated with the shell function +are performed when the function is executed. + +A function definition may be deleted using the @option{-f} option to the +@code{unset} builtin (@pxref{Bourne Shell Builtins}). + +The exit status of a function definition is zero unless a syntax error +occurs or a readonly function with the same name already exists. +When executed, the exit status of a function is the exit status of the +last command executed in the body. + +Note that for historical reasons, in the most common usage the curly braces +that surround the body of the function must be separated from the body by +@code{blank}s or newlines. +This is because the braces are reserved words and are only recognized +as such when they are separated from the command list +by whitespace or another shell metacharacter. +Also, when using the braces, the @var{list} must be terminated by a semicolon, +a @samp{&}, or a newline. + +When a function is executed, the arguments to the +function become the positional parameters +during its execution (@pxref{Positional Parameters}). +The special parameter @samp{#} that expands to the number of +positional parameters is updated to reflect the change. +Special parameter @code{0} is unchanged. +The first element of the @env{FUNCNAME} variable is set to the +name of the function while the function is executing. + +All other aspects of the shell execution +environment are identical between a function and its caller +with these exceptions: +the @env{DEBUG} and @env{RETURN} traps +are not inherited unless the function has been given the +@code{trace} attribute using the @code{declare} builtin or +the @code{-o functrace} option has been enabled with +the @code{set} builtin, +(in which case all functions inherit the @env{DEBUG} and @env{RETURN} traps), +and the @env{ERR} trap is not inherited unless the @code{-o errtrace} +shell option has been enabled. +@xref{Bourne Shell Builtins}, for the description of the +@code{trap} builtin. + +The @env{FUNCNEST} variable, if set to a numeric value greater +than 0, defines a maximum function nesting level. Function +invocations that exceed the limit cause the entire command to +abort. + +If the builtin command @code{return} +is executed in a function, the function completes and +execution resumes with the next command after the function +call. +Any command associated with the @code{RETURN} trap is executed +before execution resumes. +When a function completes, the values of the +positional parameters and the special parameter @samp{#} +are restored to the values they had prior to the function's +execution. If a numeric argument is given to @code{return}, +that is the function's return status; otherwise the function's +return status is the exit status of the last command executed +before the @code{return}. + +Variables local to the function may be declared with the +@code{local} builtin. These variables are visible only to +the function and the commands it invokes. + +Function names and definitions may be listed with the +@option{-f} option to the @code{declare} (@code{typeset}) +builtin command (@pxref{Bash Builtins}). +The @option{-F} option to @code{declare} or @code{typeset} +will list the function names only +(and optionally the source file and line number, if the @code{extdebug} +shell option is enabled). +Functions may be exported so that subshells +automatically have them defined with the +@option{-f} option to the @code{export} builtin +(@pxref{Bourne Shell Builtins}). +Note that shell functions and variables with the same name may result +in multiple identically-named entries in the environment passed to the +shell's children. +Care should be taken in cases where this may cause a problem. + +Functions may be recursive. +The @code{FUNCNEST} variable may be used to limit the depth of the +function call stack and restrict the number of function invocations. +By default, no limit is placed on the number of recursive calls. + +@node Shell Parameters +@section Shell Parameters +@cindex parameters +@cindex variable, shell +@cindex shell variable + +@menu +* Positional Parameters:: The shell's command-line arguments. +* Special Parameters:: Parameters denoted by special characters. +@end menu + +A @var{parameter} is an entity that stores values. +It can be a @code{name}, a number, or one of the special characters +listed below. +A @var{variable} is a parameter denoted by a @code{name}. +A variable has a @var{value} and zero or more @var{attributes}. +Attributes are assigned using the @code{declare} builtin command +(see the description of the @code{declare} builtin in @ref{Bash Builtins}). + +A parameter is set if it has been assigned a value. The null string is +a valid value. Once a variable is set, it may be unset only by using +the @code{unset} builtin command. + +A variable may be assigned to by a statement of the form +@example +@var{name}=[@var{value}] +@end example +@noindent +If @var{value} +is not given, the variable is assigned the null string. All +@var{value}s undergo tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote +removal (detailed below). If the variable has its @code{integer} +attribute set, then @var{value} +is evaluated as an arithmetic expression even if the @code{$((@dots{}))} +expansion is not used (@pxref{Arithmetic Expansion}). +Word splitting is not performed, with the exception +of @code{"$@@"} as explained below. +Filename expansion is not performed. +Assignment statements may also appear as arguments to the +@code{alias}, +@code{declare}, @code{typeset}, @code{export}, @code{readonly}, +and @code{local} builtin commands. +When in @sc{posix} mode (@pxref{Bash POSIX Mode}), these builtins may appear +in a command after one or more instances of the @code{command} builtin +and retain these assignment statement properties. + +In the context where an assignment statement is assigning a value +to a shell variable or array index (@pxref{Arrays}), the @samp{+=} +operator can be used to +append to or add to the variable's previous value. +When @samp{+=} is applied to a variable for which the @var{integer} attribute +has been set, @var{value} is evaluated as an arithmetic expression and +added to the variable's current value, which is also evaluated. +When @samp{+=} is applied to an array variable using compound assignment +(@pxref{Arrays}), the +variable's value is not unset (as it is when using @samp{=}), and new +values are appended to the array beginning at one greater than the array's +maximum index (for indexed arrays), or added as additional key-value pairs +in an associative array. +When applied to a string-valued variable, @var{value} is expanded and +appended to the variable's value. + +A variable can be assigned the @var{nameref} attribute using the +@option{-n} option to the \fBdeclare\fP or \fBlocal\fP builtin commands +(@pxref{Bash Builtins}) +to create a @var{nameref}, or a reference to another variable. +This allows variables to be manipulated indirectly. +Whenever the nameref variable is referenced or assigned to, the operation +is actually performed on the variable specified by the nameref variable's +value. +A nameref is commonly used within shell functions to refer to a variable +whose name is passed as an argument to the function. +For instance, if a variable name is passed to a shell function as its first +argument, running +@example +declare -n ref=$1 +@end example +@noindent +inside the function creates a nameref variable @var{ref} whose value is +the variable name passed as the first argument. +References and assignments to @var{ref} are treated as references and +assignments to the variable whose name was passed as @code{$1}. + +If the control variable in a @code{for} loop has the nameref attribute, +the list of words can be a list of shell variables, and a name reference +will be established for each word in the list, in turn, when the loop is +executed. +Array variables cannot be given the @option{-n} attribute. +However, nameref variables can reference array variables and subscripted +array variables. +Namerefs can be unset using the @option{-n} option to the @code{unset} builtin +(@pxref{Bourne Shell Builtins}). +Otherwise, if @code{unset} is executed with the name of a nameref variable +as an argument, the variable referenced by the nameref variable will be unset. + +@node Positional Parameters +@subsection Positional Parameters +@cindex parameters, positional + +A @var{positional parameter} is a parameter denoted by one or more +digits, other than the single digit @code{0}. Positional parameters are +assigned from the shell's arguments when it is invoked, +and may be reassigned using the @code{set} builtin command. +Positional parameter @code{N} may be referenced as @code{$@{N@}}, or +as @code{$N} when @code{N} consists of a single digit. +Positional parameters may not be assigned to with assignment statements. +The @code{set} and @code{shift} builtins are used to set and +unset them (@pxref{Shell Builtin Commands}). +The positional parameters are +temporarily replaced when a shell function is executed +(@pxref{Shell Functions}). + +When a positional parameter consisting of more than a single +digit is expanded, it must be enclosed in braces. + +@node Special Parameters +@subsection Special Parameters +@cindex parameters, special + +The shell treats several parameters specially. These parameters may +only be referenced; assignment to them is not allowed. + +@vtable @code + +@item * +@vindex $* +($*) Expands to the positional parameters, starting from one. +When the expansion is not within double quotes, each positional parameter +expands to a separate word. +In contexts where it is performed, those words +are subject to further word splitting and pathname expansion. +When the expansion occurs within double quotes, it expands to a single word +with the value of each parameter separated by the first character +of the @env{IFS} +special variable. That is, @code{"$*"} is equivalent +to @code{"$1@var{c}$2@var{c}@dots{}"}, where @var{c} +is the first character of the value of the @code{IFS} +variable. +If @env{IFS} is unset, the parameters are separated by spaces. +If @env{IFS} is null, the parameters are joined without intervening +separators. + +@item @@ +@vindex $@@ +($@@) Expands to the positional parameters, starting from one. When the +expansion occurs within double quotes, each parameter expands to a +separate word. That is, @code{"$@@"} is equivalent to +@code{"$1" "$2" @dots{}}. +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +When there are no positional parameters, @code{"$@@"} and +@code{$@@} +expand to nothing (i.e., they are removed). + +@item # +@vindex $# +($#) Expands to the number of positional parameters in decimal. + +@item ? +@vindex $? +($?) Expands to the exit status of the most recently executed foreground +pipeline. + +@item - +@vindex $- +($-, a hyphen.) Expands to the current option flags as specified upon +invocation, by the @code{set} +builtin command, or those set by the shell itself +(such as the @option{-i} option). + +@item $ +@vindex $$ +($$) Expands to the process @sc{id} of the shell. In a @code{()} subshell, it +expands to the process @sc{id} of the invoking shell, not the subshell. + +@item ! +@vindex $! +($!) Expands to the process @sc{id} of the job most recently placed into the +background, whether executed as an asynchronous command or using +the @code{bg} builtin (@pxref{Job Control Builtins}). + +@item 0 +@vindex $0 +($0) Expands to the name of the shell or shell script. This is set at +shell initialization. If Bash is invoked with a file of commands +(@pxref{Shell Scripts}), @code{$0} is set to the name of that file. +If Bash is started with the @option{-c} option (@pxref{Invoking Bash}), +then @code{$0} is set to the first argument after the string to be +executed, if one is present. Otherwise, it is set +to the filename used to invoke Bash, as given by argument zero. + +@item _ +@vindex $_ +($_, an underscore.) +At shell startup, set to the absolute pathname used to invoke the +shell or shell script being executed as passed in the environment +or argument list. +Subsequently, expands to the last argument to the previous command, +after expansion. +Also set to the full pathname used to invoke each command executed +and placed in the environment exported to that command. +When checking mail, this parameter holds the name of the mail file. +@end vtable + +@node Shell Expansions +@section Shell Expansions +@cindex expansion + +Expansion is performed on the command line after it has been split into +@code{token}s. There are seven kinds of expansion performed: + +@itemize @bullet +@item brace expansion +@item tilde expansion +@item parameter and variable expansion +@item command substitution +@item arithmetic expansion +@item word splitting +@item filename expansion +@end itemize + +@menu +* Brace Expansion:: Expansion of expressions within braces. +* Tilde Expansion:: Expansion of the ~ character. +* Shell Parameter Expansion:: How Bash expands variables to their values. +* Command Substitution:: Using the output of a command as an argument. +* Arithmetic Expansion:: How to use arithmetic in shell expansions. +* Process Substitution:: A way to write and read to and from a + command. +* Word Splitting:: How the results of expansion are split into separate + arguments. +* Filename Expansion:: A shorthand for specifying filenames matching patterns. +* Quote Removal:: How and when quote characters are removed from + words. +@end menu + +The order of expansions is: +brace expansion; +tilde expansion, parameter and variable expansion, arithmetic expansion, +and command substitution (done in a left-to-right fashion); +word splitting; +and filename expansion. + +On systems that can support it, there is an additional expansion +available: @var{process substitution}. +This is performed at the +same time as tilde, parameter, variable, and arithmetic expansion and +command substitution. + +Only brace expansion, word splitting, and filename expansion +can change the number of words of the expansion; other expansions +expand a single word to a single word. +The only exceptions to this are the expansions of +@code{"$@@"} (@pxref{Special Parameters}) and @code{"$@{@var{name}[@@]@}"} +(@pxref{Arrays}). + +After all expansions, @code{quote removal} (@pxref{Quote Removal}) +is performed. + +@node Brace Expansion +@subsection Brace Expansion +@cindex brace expansion +@cindex expansion, brace + +Brace expansion is a mechanism by which arbitrary strings may be generated. +This mechanism is similar to +@var{filename expansion} (@pxref{Filename Expansion}), +but the filenames generated need not exist. +Patterns to be brace expanded take the form of an optional @var{preamble}, +followed by either a series of comma-separated strings or a sequence expression +between a pair of braces, +followed by an optional @var{postscript}. +The preamble is prefixed to each string contained within the braces, and +the postscript is then appended to each resulting string, expanding left +to right. + +Brace expansions may be nested. +The results of each expanded string are not sorted; left to right order +is preserved. +For example, +@example +bash$ echo a@{d,c,b@}e +ade ace abe +@end example + +A sequence expression takes the form @code{@{@var{x}..@var{y}[..@var{incr}]@}}, +where @var{x} and @var{y} are either integers or single characters, +and @var{incr}, an optional increment, is an integer. +When integers are supplied, the expression expands to each number between +@var{x} and @var{y}, inclusive. +Supplied integers may be prefixed with @samp{0} to force each term to have the +same width. +When either @var{x} or @var{y} begins with a zero, the shell +attempts to force all generated terms to contain the same number of digits, +zero-padding where necessary. +When characters are supplied, the expression expands to each character +lexicographically between @var{x} and @var{y}, inclusive, +using the default C locale. +Note that both @var{x} and @var{y} must be of the same type. +When the increment is supplied, it is used as the difference between +each term. The default increment is 1 or -1 as appropriate. + +Brace expansion is performed before any other expansions, +and any characters special to other expansions are preserved +in the result. It is strictly textual. Bash +does not apply any syntactic interpretation to the context of the +expansion or the text between the braces. +To avoid conflicts with parameter expansion, the string @samp{$@{} +is not considered eligible for brace expansion. + +A correctly-formed brace expansion must contain unquoted opening +and closing braces, and at least one unquoted comma or a valid +sequence expression. +Any incorrectly formed brace expansion is left unchanged. + +A @{ or @samp{,} may be quoted with a backslash to prevent its +being considered part of a brace expression. +To avoid conflicts with parameter expansion, the string @samp{$@{} +is not considered eligible for brace expansion. + +This construct is typically used as shorthand when the common +prefix of the strings to be generated is longer than in the +above example: +@example +mkdir /usr/local/src/bash/@{old,new,dist,bugs@} +@end example +or +@example +chown root /usr/@{ucb/@{ex,edit@},lib/@{ex?.?*,how_ex@}@} +@end example + +@node Tilde Expansion +@subsection Tilde Expansion +@cindex tilde expansion +@cindex expansion, tilde + +If a word begins with an unquoted tilde character (@samp{~}), all of the +characters up to the first unquoted slash (or all characters, +if there is no unquoted slash) are considered a @var{tilde-prefix}. +If none of the characters in the tilde-prefix are quoted, the +characters in the tilde-prefix following the tilde are treated as a +possible @var{login name}. +If this login name is the null string, the tilde is replaced with the +value of the @env{HOME} shell variable. +If @env{HOME} is unset, the home directory of the user executing the +shell is substituted instead. +Otherwise, the tilde-prefix is replaced with the home directory +associated with the specified login name. + +If the tilde-prefix is @samp{~+}, the value of +the shell variable @env{PWD} replaces the tilde-prefix. +If the tilde-prefix is @samp{~-}, the value of the shell variable +@env{OLDPWD}, if it is set, is substituted. + +If the characters following the tilde in the tilde-prefix consist of a +number @var{N}, optionally prefixed by a @samp{+} or a @samp{-}, +the tilde-prefix is replaced with the +corresponding element from the directory stack, as it would be displayed +by the @code{dirs} builtin invoked with the characters following tilde +in the tilde-prefix as an argument (@pxref{The Directory Stack}). +If the tilde-prefix, sans the tilde, consists of a number without a +leading @samp{+} or @samp{-}, @samp{+} is assumed. + +If the login name is invalid, or the tilde expansion fails, the word is +left unchanged. + +Each variable assignment is checked for unquoted tilde-prefixes immediately +following a @samp{:} or the first @samp{=}. +In these cases, tilde expansion is also performed. +Consequently, one may use filenames with tildes in assignments to +@env{PATH}, @env{MAILPATH}, and @env{CDPATH}, +and the shell assigns the expanded value. + +The following table shows how Bash treats unquoted tilde-prefixes: + +@table @code +@item ~ +The value of @code{$HOME} +@item ~/foo +@file{$HOME/foo} + +@item ~fred/foo +The subdirectory @code{foo} of the home directory of the user +@code{fred} + +@item ~+/foo +@file{$PWD/foo} + +@item ~-/foo +@file{$@{OLDPWD-'~-'@}/foo} + +@item ~@var{N} +The string that would be displayed by @samp{dirs +@var{N}} + +@item ~+@var{N} +The string that would be displayed by @samp{dirs +@var{N}} + +@item ~-@var{N} +The string that would be displayed by @samp{dirs -@var{N}} +@end table + +@node Shell Parameter Expansion +@subsection Shell Parameter Expansion +@cindex parameter expansion +@cindex expansion, parameter + +The @samp{$} character introduces parameter expansion, +command substitution, or arithmetic expansion. The parameter name +or symbol to be expanded may be enclosed in braces, which +are optional but serve to protect the variable to be expanded from +characters immediately following it which could be +interpreted as part of the name. + +When braces are used, the matching ending brace is the first @samp{@}} +not escaped by a backslash or within a quoted string, and not within an +embedded arithmetic expansion, command substitution, or parameter +expansion. + +The basic form of parameter expansion is $@{@var{parameter}@}. +The value of @var{parameter} is substituted. +The @var{parameter} is a shell parameter as described above +(@pxref{Shell Parameters}) or an array reference (@pxref{Arrays}). +The braces are required when @var{parameter} +is a positional parameter with more than one digit, +or when @var{parameter} is followed by a character that is not to be +interpreted as part of its name. + +If the first character of @var{parameter} is an exclamation point (!), +it introduces a level of variable indirection. +Bash uses the value of the variable formed from the rest of +@var{parameter} as the name of the variable; this variable is then +expanded and that value is used in the rest of the substitution, rather +than the value of @var{parameter} itself. +This is known as @code{indirect expansion}. +The exceptions to this are the expansions of $@{!@var{prefix}*@} +and $@{!@var{name}[@@]@} +described below. +The exclamation point must immediately follow the left brace in order to +introduce indirection. + +In each of the cases below, @var{word} is subject to tilde expansion, +parameter expansion, command substitution, and arithmetic expansion. + +When not performing substring expansion, using the form described +below (e.g., @samp{:-}), Bash tests for a parameter that is unset or null. +Omitting the colon results in a test only for a parameter that is unset. +Put another way, if the colon is included, +the operator tests for both @var{parameter}'s existence and that its value +is not null; if the colon is omitted, the operator tests only for existence. + +@table @code + +@item $@{@var{parameter}:@minus{}@var{word}@} +If @var{parameter} is unset or null, the expansion of +@var{word} is substituted. Otherwise, the value of +@var{parameter} is substituted. + +@item $@{@var{parameter}:=@var{word}@} +If @var{parameter} +is unset or null, the expansion of @var{word} +is assigned to @var{parameter}. +The value of @var{parameter} is then substituted. +Positional parameters and special parameters may not be assigned to +in this way. + +@item $@{@var{parameter}:?@var{word}@} +If @var{parameter} +is null or unset, the expansion of @var{word} (or a message +to that effect if @var{word} +is not present) is written to the standard error and the shell, if it +is not interactive, exits. Otherwise, the value of @var{parameter} is +substituted. + +@item $@{@var{parameter}:+@var{word}@} +If @var{parameter} +is null or unset, nothing is substituted, otherwise the expansion of +@var{word} is substituted. + +@item $@{@var{parameter}:@var{offset}@} +@itemx $@{@var{parameter}:@var{offset}:@var{length}@} +This is referred to as Substring Expansion. +It expands to up to @var{length} characters of the value of @var{parameter} +starting at the character specified by @var{offset}. +If @var{parameter} is @samp{@@}, an indexed array subscripted by +@samp{@@} or @samp{*}, or an associative array name, the results differ as +described below. +If @var{length} is omitted, it expands to the substring of the value of +@var{parameter} starting at the character specified by @var{offset} +and extending to the end of the value. +@var{length} and @var{offset} are arithmetic expressions +(@pxref{Shell Arithmetic}). + +If @var{offset} evaluates to a number less than zero, the value +is used as an offset in characters +from the end of the value of @var{parameter}. +If @var{length} evaluates to a number less than zero, +it is interpreted as an offset in characters +from the end of the value of @var{parameter} rather than +a number of characters, and the expansion is the characters between +@var{offset} and that result. +Note that a negative offset must be separated from the colon by at least +one space to avoid being confused with the @samp{:-} expansion. + +Here are some examples illustrating substring expansion on parameters and +subscripted arrays: + +@verbatim +$ string=01234567890abcdefgh +$ echo ${string:7} +7890abcdefgh +$ echo ${string:7:0} + +$ echo ${string:7:2} +78 +$ echo ${string:7:-2} +7890abcdef +$ echo ${string: -7} +bcdefgh +$ echo ${string: -7:0} + +$ echo ${string: -7:2} +bc +$ echo ${string: -7:-2} +bcdef +$ set -- 01234567890abcdefgh +$ echo ${1:7} +7890abcdefgh +$ echo ${1:7:0} + +$ echo ${1:7:2} +78 +$ echo ${1:7:-2} +7890abcdef +$ echo ${1: -7} +bcdefgh +$ echo ${1: -7:0} + +$ echo ${1: -7:2} +bc +$ echo ${1: -7:-2} +bcdef +$ array[0]=01234567890abcdefgh +$ echo ${array[0]:7} +7890abcdefgh +$ echo ${array[0]:7:0} + +$ echo ${array[0]:7:2} +78 +$ echo ${array[0]:7:-2} +7890abcdef +$ echo ${array[0]: -7} +bcdefgh +$ echo ${array[0]: -7:0} + +$ echo ${array[0]: -7:2} +bc +$ echo ${array[0]: -7:-2} +bcdef +@end verbatim + +If @var{parameter} is @samp{@@}, the result is @var{length} positional +parameters beginning at @var{offset}. +A negative @var{offset} is taken relative to one greater than the greatest +positional parameter, so an offset of -1 evaluates to the last positional +parameter. +It is an expansion error if @var{length} evaluates to a number less than zero. + +The following examples illustrate substring expansion using positional +parameters: + +@verbatim +$ set -- 1 2 3 4 5 6 7 8 9 0 a b c d e f g h +$ echo ${@:7} +7 8 9 0 a b c d e f g h +$ echo ${@:7:0} + +$ echo ${@:7:2} +7 8 +$ echo ${@:7:-2} +bash: -2: substring expression < 0 +$ echo ${@: -7:2} +b c +$ echo ${@:0} +./bash 1 2 3 4 5 6 7 8 9 0 a b c d e f g h +$ echo ${@:0:2} +./bash 1 +$ echo ${@: -7:0} + +@end verbatim + +If @var{parameter} is an indexed array name subscripted +by @samp{@@} or @samp{*}, the result is the @var{length} +members of the array beginning with @code{$@{@var{parameter}[@var{offset}]@}}. +A negative @var{offset} is taken relative to one greater than the maximum +index of the specified array. +It is an expansion error if @var{length} evaluates to a number less than zero. + +These examples show how you can use substring expansion with indexed +arrays: + +@verbatim +$ array=(0 1 2 3 4 5 6 7 8 9 0 a b c d e f g h) +$ echo ${array[@]:7} +7 8 9 0 a b c d e f g h +$ echo ${array[@]:7:2} +7 8 +$ echo ${array[@]: -7:2} +b c +$ echo ${array[@]: -7:-2} +bash: -2: substring expression < 0 +$ echo ${array[@]:0} +0 1 2 3 4 5 6 7 8 9 0 a b c d e f g h +$ echo ${array[@]:0:2} +0 1 +$ echo ${array[@]: -7:0} + +@end verbatim + +Substring expansion applied to an associative array produces undefined +results. + +Substring indexing is zero-based unless the positional parameters +are used, in which case the indexing starts at 1 by default. +If @var{offset} is 0, and the positional parameters are used, @code{$@@} is +prefixed to the list. + +@item $@{!@var{prefix}*@} +@itemx $@{!@var{prefix}@@@} +Expands to the names of variables whose names begin with @var{prefix}, +separated by the first character of the @env{IFS} special variable. +When @samp{@@} is used and the expansion appears within double quotes, each +variable name expands to a separate word. + +@item $@{!@var{name}[@@]@} +@itemx $@{!@var{name}[*]@} +If @var{name} is an array variable, expands to the list of array indices +(keys) assigned in @var{name}. +If @var{name} is not an array, expands to 0 if @var{name} is set and null +otherwise. +When @samp{@@} is used and the expansion appears within double quotes, each +key expands to a separate word. + +@item $@{#@var{parameter}@} +The length in characters of the expanded value of @var{parameter} is +substituted. +If @var{parameter} is @samp{*} or @samp{@@}, the value substituted +is the number of positional parameters. +If @var{parameter} is an array name subscripted by @samp{*} or @samp{@@}, +the value substituted is the number of elements in the array. +If @var{parameter} +is an indexed array name subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +@var{parameter}, so negative indices count back from the end of the +array, and an index of -1 references the last element. + +@item $@{@var{parameter}#@var{word}@} +@itemx $@{@var{parameter}##@var{word}@} +The @var{word} +is expanded to produce a pattern just as in filename +expansion (@pxref{Filename Expansion}). If the pattern matches +the beginning of the expanded value of @var{parameter}, +then the result of the expansion is the expanded value of @var{parameter} +with the shortest matching pattern (the @samp{#} case) or the +longest matching pattern (the @samp{##} case) deleted. +If @var{parameter} is @samp{@@} or @samp{*}, +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If @var{parameter} is an array variable subscripted with +@samp{@@} or @samp{*}, +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. + +@item $@{@var{parameter}%@var{word}@} +@itemx $@{@var{parameter}%%@var{word}@} +The @var{word} is expanded to produce a pattern just as in +filename expansion. +If the pattern matches a trailing portion of the expanded value of +@var{parameter}, then the result of the expansion is the value of +@var{parameter} with the shortest matching pattern (the @samp{%} case) +or the longest matching pattern (the @samp{%%} case) deleted. +If @var{parameter} is @samp{@@} or @samp{*}, +the pattern removal operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If @var{parameter} +is an array variable subscripted with @samp{@@} or @samp{*}, +the pattern removal operation is applied to each member of the +array in turn, and the expansion is the resultant list. + +@item $@{@var{parameter}/@var{pattern}/@var{string}@} + +The @var{pattern} is expanded to produce a pattern just as in +filename expansion. +@var{Parameter} is expanded and the longest match of @var{pattern} +against its value is replaced with @var{string}. +If @var{pattern} begins with @samp{/}, all matches of @var{pattern} are +replaced with @var{string}. Normally only the first match is replaced. +If @var{pattern} begins with @samp{#}, it must match at the beginning +of the expanded value of @var{parameter}. +If @var{pattern} begins with @samp{%}, it must match at the end +of the expanded value of @var{parameter}. +If @var{string} is null, matches of @var{pattern} are deleted +and the @code{/} following @var{pattern} may be omitted. +If @var{parameter} is @samp{@@} or @samp{*}, +the substitution operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If @var{parameter} +is an array variable subscripted with @samp{@@} or @samp{*}, +the substitution operation is applied to each member of the +array in turn, and the expansion is the resultant list. + +@item $@{@var{parameter}^@var{pattern}@} +@itemx $@{@var{parameter}^^@var{pattern}@} +@itemx $@{@var{parameter},@var{pattern}@} +@itemx $@{@var{parameter},,@var{pattern}@} +This expansion modifies the case of alphabetic characters in @var{parameter}. +The @var{pattern} is expanded to produce a pattern just as in +filename expansion. +Each character in the expanded value of @var{parameter} is tested against +@var{pattern}, and, if it matches the pattern, its case is converted. +The pattern should not attempt to match more than one character. +The @samp{^} operator converts lowercase letters matching @var{pattern} +to uppercase; the @samp{,} operator converts matching uppercase letters +to lowercase. +The @samp{^^} and @samp{,,} expansions convert each matched character in the +expanded value; the @samp{^} and @samp{,} expansions match and convert only +the first character in the expanded value. +If @var{pattern} is omitted, it is treated like a @samp{?}, which matches +every character. +If @var{parameter} is @samp{@@} or @samp{*}, +the case modification operation is applied to each positional +parameter in turn, and the expansion is the resultant list. +If @var{parameter} +is an array variable subscripted with @samp{@@} or @samp{*}, +the case modification operation is applied to each member of the +array in turn, and the expansion is the resultant list. +@end table + +@node Command Substitution +@subsection Command Substitution +@cindex command substitution + +Command substitution allows the output of a command to replace +the command itself. +Command substitution occurs when a command is enclosed as follows: +@example +$(@var{command}) +@end example +@noindent +or +@example +`@var{command}` +@end example + +@noindent +Bash performs the expansion by executing @var{command} and +replacing the command substitution with the standard output of the +command, with any trailing newlines deleted. +Embedded newlines are not deleted, but they may be removed during +word splitting. +The command substitution @code{$(cat @var{file})} can be +replaced by the equivalent but faster @code{$(< @var{file})}. + +When the old-style backquote form of substitution is used, +backslash retains its literal meaning except when followed by +@samp{$}, @samp{`}, or @samp{\}. +The first backquote not preceded by a backslash terminates the +command substitution. +When using the @code{$(@var{command})} form, all characters between +the parentheses make up the command; none are treated specially. + +Command substitutions may be nested. To nest when using the backquoted +form, escape the inner backquotes with backslashes. + +If the substitution appears within double quotes, word splitting and +filename expansion are not performed on the results. + +@node Arithmetic Expansion +@subsection Arithmetic Expansion +@cindex expansion, arithmetic +@cindex arithmetic expansion + +Arithmetic expansion allows the evaluation of an arithmetic expression +and the substitution of the result. The format for arithmetic expansion is: + +@example +$(( @var{expression} )) +@end example + +The expression is treated as if it were within double quotes, but +a double quote inside the parentheses is not treated specially. +All tokens in the expression undergo parameter and variable expansion, +command substitution, and quote removal. +The result is treated as the arithmetic expression to be evaluated. +Arithmetic expansions may be nested. + +The evaluation is performed according to the rules listed below +(@pxref{Shell Arithmetic}). +If the expression is invalid, Bash prints a message indicating +failure to the standard error and no substitution occurs. + +@node Process Substitution +@subsection Process Substitution +@cindex process substitution + +Process substitution is supported on systems that support named +pipes (@sc{fifo}s) or the @file{/dev/fd} method of naming open files. +It takes the form of +@example +<(@var{list}) +@end example +@noindent +or +@example +>(@var{list}) +@end example +@noindent +The process @var{list} is run with its input or output connected to a +@sc{fifo} or some file in @file{/dev/fd}. The name of this file is +passed as an argument to the current command as the result of the +expansion. If the @code{>(@var{list})} form is used, writing to +the file will provide input for @var{list}. If the +@code{<(@var{list})} form is used, the file passed as an +argument should be read to obtain the output of @var{list}. +Note that no space may appear between the @code{<} or @code{>} +and the left parenthesis, otherwise the construct would be interpreted +as a redirection. + +When available, process substitution is performed simultaneously with +parameter and variable expansion, command substitution, and arithmetic +expansion. + +@node Word Splitting +@subsection Word Splitting +@cindex word splitting + +The shell scans the results of parameter expansion, command substitution, +and arithmetic expansion that did not occur within double quotes for +word splitting. + +The shell treats each character of @env{$IFS} as a delimiter, and splits +the results of the other expansions into words using these characters +as field terminators. +If @env{IFS} is unset, or its value is exactly @code{}, +the default, then sequences of +@code{ }, @code{}, and @code{} +at the beginning and end of the results of the previous +expansions are ignored, and any sequence of @env{IFS} +characters not at the beginning or end serves to delimit words. +If @env{IFS} has a value other than the default, then sequences of +the whitespace characters @code{space} and @code{tab} +are ignored at the beginning and end of the +word, as long as the whitespace character is in the +value of @env{IFS} (an @env{IFS} whitespace character). +Any character in @env{IFS} that is not @env{IFS} +whitespace, along with any adjacent @env{IFS} +whitespace characters, delimits a field. A sequence of @env{IFS} +whitespace characters is also treated as a delimiter. +If the value of @env{IFS} is null, no word splitting occurs. + +Explicit null arguments (@code{""} or @code{''}) are retained. +Unquoted implicit null arguments, resulting from the expansion of +parameters that have no values, are removed. +If a parameter with no value is expanded within double quotes, a +null argument results and is retained. + +Note that if no expansion occurs, no splitting +is performed. + +@node Filename Expansion +@subsection Filename Expansion +@menu +* Pattern Matching:: How the shell matches patterns. +@end menu +@cindex expansion, filename +@cindex expansion, pathname +@cindex filename expansion +@cindex pathname expansion + +After word splitting, unless the @option{-f} option has been set +(@pxref{The Set Builtin}), Bash scans each word for the characters +@samp{*}, @samp{?}, and @samp{[}. +If one of these characters appears, then the word is +regarded as a @var{pattern}, +and replaced with an alphabetically sorted list of +filenames matching the pattern (@pxref{Pattern Matching}). +If no matching filenames are found, +and the shell option @code{nullglob} is disabled, the word is left +unchanged. +If the @code{nullglob} option is set, and no matches are found, the word +is removed. +If the @code{failglob} shell option is set, and no matches are found, +an error message is printed and the command is not executed. +If the shell option @code{nocaseglob} is enabled, the match is performed +without regard to the case of alphabetic characters. + +When a pattern is used for filename expansion, the character @samp{.} +at the start of a filename or immediately following a slash +must be matched explicitly, unless the shell option @code{dotglob} is set. +When matching a filename, the slash character must always be +matched explicitly. +In other cases, the @samp{.} character is not treated specially. + +See the description of @code{shopt} in @ref{The Shopt Builtin}, +for a description of the @code{nocaseglob}, @code{nullglob}, +@code{failglob}, and @code{dotglob} options. + +The @env{GLOBIGNORE} +shell variable may be used to restrict the set of filenames matching a +pattern. If @env{GLOBIGNORE} +is set, each matching filename that also matches one of the patterns in +@env{GLOBIGNORE} is removed from the list of matches. The filenames +@file{.} and @file{..} +are always ignored when @env{GLOBIGNORE} +is set and not null. +However, setting @env{GLOBIGNORE} to a non-null value has the effect of +enabling the @code{dotglob} +shell option, so all other filenames beginning with a +@samp{.} will match. +To get the old behavior of ignoring filenames beginning with a +@samp{.}, make @samp{.*} one of the patterns in @env{GLOBIGNORE}. +The @code{dotglob} option is disabled when @env{GLOBIGNORE} +is unset. + +@node Pattern Matching +@subsubsection Pattern Matching +@cindex pattern matching +@cindex matching, pattern + +Any character that appears in a pattern, other than the special pattern +characters described below, matches itself. +The @sc{nul} character may not occur in a pattern. +A backslash escapes the following character; the +escaping backslash is discarded when matching. +The special pattern characters must be quoted if they are to be matched +literally. + +The special pattern characters have the following meanings: +@table @code +@item * +Matches any string, including the null string. +When the @code{globstar} shell option is enabled, and @samp{*} is used in +a filename expansion context, two adjacent @samp{*}s used as a single +pattern will match all files and zero or more directories and +subdirectories. +If followed by a @samp{/}, two adjacent @samp{*}s will match only +directories and subdirectories. +@item ? +Matches any single character. +@item [@dots{}] +Matches any one of the enclosed characters. A pair of characters +separated by a hyphen denotes a @var{range expression}; +any character that falls between those two characters, inclusive, +using the current locale's collating sequence and character set, +is matched. If the first character following the +@samp{[} is a @samp{!} or a @samp{^} +then any character not enclosed is matched. A @samp{@minus{}} +may be matched by including it as the first or last character +in the set. A @samp{]} may be matched by including it as the first +character in the set. +The sorting order of characters in range expressions is determined by +the current locale and the values of the +@env{LC_COLLATE} and @env{LC_ALL} shell variables, if set. + +For example, in the default C locale, @samp{[a-dx-z]} is equivalent to +@samp{[abcdxyz]}. Many locales sort characters in dictionary order, and in +these locales @samp{[a-dx-z]} is typically not equivalent to @samp{[abcdxyz]}; +it might be equivalent to @samp{[aBbCcDdxXyYz]}, for example. To obtain +the traditional interpretation of ranges in bracket expressions, you can +force the use of the C locale by setting the @env{LC_COLLATE} or +@env{LC_ALL} environment variable to the value @samp{C}, or enable the +@code{globasciiranges} shell option. + +Within @samp{[} and @samp{]}, @var{character classes} can be specified +using the syntax +@code{[:}@var{class}@code{:]}, where @var{class} is one of the +following classes defined in the @sc{posix} standard: +@example +alnum alpha ascii blank cntrl digit graph lower +print punct space upper word xdigit +@end example +@noindent +A character class matches any character belonging to that class. +The @code{word} character class matches letters, digits, and the character +@samp{_}. + +Within @samp{[} and @samp{]}, an @var{equivalence class} can be +specified using the syntax @code{[=}@var{c}@code{=]}, which +matches all characters with the same collation weight (as defined +by the current locale) as the character @var{c}. + +Within @samp{[} and @samp{]}, the syntax @code{[.}@var{symbol}@code{.]} +matches the collating symbol @var{symbol}. +@end table + +If the @code{extglob} shell option is enabled using the @code{shopt} +builtin, several extended pattern matching operators are recognized. +In the following description, a @var{pattern-list} is a list of one +or more patterns separated by a @samp{|}. +Composite patterns may be formed using one or more of the following +sub-patterns: + +@table @code +@item ?(@var{pattern-list}) +Matches zero or one occurrence of the given patterns. + +@item *(@var{pattern-list}) +Matches zero or more occurrences of the given patterns. + +@item +(@var{pattern-list}) +Matches one or more occurrences of the given patterns. + +@item @@(@var{pattern-list}) +Matches one of the given patterns. + +@item !(@var{pattern-list}) +Matches anything except one of the given patterns. +@end table + +@node Quote Removal +@subsection Quote Removal + +After the preceding expansions, all unquoted occurrences of the +characters @samp{\}, @samp{'}, and @samp{"} that did not +result from one of the above expansions are removed. + +@node Redirections +@section Redirections +@cindex redirection + +Before a command is executed, its input and output +may be @var{redirected} +using a special notation interpreted by the shell. +Redirection allows commands' file handles to be +duplicated, opened, closed, +made to refer to different files, +and can change the files the command reads from and writes to. +Redirection may also be used to modify file handles in the +current shell execution environment. The following redirection +operators may precede or appear anywhere within a +simple command or may follow a command. +Redirections are processed in the order they appear, from +left to right. + +Each redirection that may be preceded by a file descriptor number +may instead be preceded by a word of the form @{@var{varname}@}. +In this case, for each redirection operator except +>&- and <&-, the shell will allocate a file descriptor greater +than 10 and assign it to @{@var{varname}@}. If >&- or <&- is preceded +by @{@var{varname}@}, the value of @var{varname} defines the file +descriptor to close. + +In the following descriptions, if the file descriptor number is +omitted, and the first character of the redirection operator is +@samp{<}, the redirection refers to the standard input (file +descriptor 0). If the first character of the redirection operator +is @samp{>}, the redirection refers to the standard output (file +descriptor 1). + +The word following the redirection operator in the following +descriptions, unless otherwise noted, is subjected to brace expansion, +tilde expansion, parameter expansion, command substitution, arithmetic +expansion, quote removal, filename expansion, and word splitting. +If it expands to more than one word, Bash reports an error. + +Note that the order of redirections is significant. For example, +the command +@example +ls > @var{dirlist} 2>&1 +@end example +@noindent +directs both standard output (file descriptor 1) and standard error +(file descriptor 2) to the file @var{dirlist}, while the command +@example +ls 2>&1 > @var{dirlist} +@end example +@noindent +directs only the standard output to file @var{dirlist}, +because the standard error was made a copy of the standard output +before the standard output was redirected to @var{dirlist}. + +Bash handles several filenames specially when they are used in +redirections, as described in the following table: + +@table @code +@item /dev/fd/@var{fd} +If @var{fd} is a valid integer, file descriptor @var{fd} is duplicated. + +@item /dev/stdin +File descriptor 0 is duplicated. + +@item /dev/stdout +File descriptor 1 is duplicated. + +@item /dev/stderr +File descriptor 2 is duplicated. + +@item /dev/tcp/@var{host}/@var{port} +If @var{host} is a valid hostname or Internet address, and @var{port} +is an integer port number or service name, Bash attempts to open +the corresponding TCP socket. + +@item /dev/udp/@var{host}/@var{port} +If @var{host} is a valid hostname or Internet address, and @var{port} +is an integer port number or service name, Bash attempts to open +the corresponding UDP socket. +@end table + +A failure to open or create a file causes the redirection to fail. + +Redirections using file descriptors greater than 9 should be used with +care, as they may conflict with file descriptors the shell uses +internally. + +Note that the @code{exec} builtin command can make redirections take +effect in the current shell. + +@subsection Redirecting Input +Redirection of input causes the file whose name results from +the expansion of @var{word} +to be opened for reading on file descriptor @code{n}, +or the standard input (file descriptor 0) if @code{n} +is not specified. + +The general format for redirecting input is: +@example +[@var{n}]<@var{word} +@end example + +@subsection Redirecting Output +Redirection of output causes the file whose name results from +the expansion of @var{word} +to be opened for writing on file descriptor @var{n}, +or the standard output (file descriptor 1) if @var{n} +is not specified. If the file does not exist it is created; +if it does exist it is truncated to zero size. + +The general format for redirecting output is: +@example +[@var{n}]>[|]@var{word} +@end example + +If the redirection operator is @samp{>}, and the @code{noclobber} +option to the @code{set} builtin has been enabled, the redirection +will fail if the file whose name results from the expansion of +@var{word} exists and is a regular file. +If the redirection operator is @samp{>|}, or the redirection operator is +@samp{>} and the @code{noclobber} option is not enabled, the redirection +is attempted even if the file named by @var{word} exists. + +@subsection Appending Redirected Output +Redirection of output in this fashion +causes the file whose name results from +the expansion of @var{word} +to be opened for appending on file descriptor @var{n}, +or the standard output (file descriptor 1) if @var{n} +is not specified. If the file does not exist it is created. + +The general format for appending output is: +@example +[@var{n}]>>@var{word} +@end example + +@subsection Redirecting Standard Output and Standard Error +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be redirected to the file whose name is the +expansion of @var{word}. + +There are two formats for redirecting standard output and +standard error: +@example +&>@var{word} +@end example +@noindent +and +@example +>&@var{word} +@end example +@noindent +Of the two forms, the first is preferred. +This is semantically equivalent to +@example +>@var{word} 2>&1 +@end example +When using the second form, @var{word} may not expand to a number or +@samp{-}. If it does, other redirection operators apply +(see Duplicating File Descriptors below) for compatibility reasons. + +@subsection Appending Standard Output and Standard Error +This construct allows both the +standard output (file descriptor 1) and +the standard error output (file descriptor 2) +to be appended to the file whose name is the +expansion of @var{word}. + +The format for appending standard output and standard error is: +@example +&>>@var{word} +@end example +@noindent +This is semantically equivalent to +@example +>>@var{word} 2>&1 +@end example +(see Duplicating File Descriptors below). + +@subsection Here Documents +This type of redirection instructs the shell to read input from the +current source until a line containing only @var{word} +(with no trailing blanks) is seen. All of +the lines read up to that point are then used as the standard +input for a command. + +The format of here-documents is: +@example +<<[@minus{}]@var{word} + @var{here-document} +@var{delimiter} +@end example + +No parameter and variable expansion, command substitution, +arithmetic expansion, or filename expansion is performed on +@var{word}. If any characters in @var{word} are quoted, the +@var{delimiter} is the result of quote removal on @var{word}, +and the lines in the here-document are not expanded. +If @var{word} is unquoted, +all lines of the here-document are subjected to +parameter expansion, command substitution, and arithmetic expansion, +the character sequence @code{\newline} is ignored, and @samp{\} +must be used to quote the characters +@samp{\}, @samp{$}, and @samp{`}. + +If the redirection operator is @samp{<<-}, +then all leading tab characters are stripped from input lines and the +line containing @var{delimiter}. +This allows here-documents within shell scripts to be indented in a +natural fashion. + +@subsection Here Strings +A variant of here documents, the format is: +@example +<<< @var{word} +@end example + +The @var{word} undergoes +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote removal. +Pathname expansion and word splitting are not performed. +The result is supplied as a single string to the command on its +standard input. + +@subsection Duplicating File Descriptors +The redirection operator +@example +[@var{n}]<&@var{word} +@end example +@noindent +is used to duplicate input file descriptors. +If @var{word} +expands to one or more digits, the file descriptor denoted by @var{n} +is made to be a copy of that file descriptor. +If the digits in @var{word} do not specify a file descriptor open for +input, a redirection error occurs. +If @var{word} +evaluates to @samp{-}, file descriptor @var{n} is closed. +If @var{n} is not specified, the standard input (file descriptor 0) is used. + +The operator +@example +[@var{n}]>&@var{word} +@end example +@noindent +is used similarly to duplicate output file descriptors. If +@var{n} is not specified, the standard output (file descriptor 1) is used. +If the digits in @var{word} do not specify a file descriptor open for +output, a redirection error occurs. +If @var{word} +evaluates to @samp{-}, file descriptor @var{n} is closed. +As a special case, if @var{n} is omitted, and @var{word} does not +expand to one or more digits or @samp{-}, the standard output and standard +error are redirected as described previously. + +@subsection Moving File Descriptors +The redirection operator +@example +[@var{n}]<&@var{digit}- +@end example +@noindent +moves the file descriptor @var{digit} to file descriptor @var{n}, +or the standard input (file descriptor 0) if @var{n} is not specified. +@var{digit} is closed after being duplicated to @var{n}. + +Similarly, the redirection operator +@example +[@var{n}]>&@var{digit}- +@end example +@noindent +moves the file descriptor @var{digit} to file descriptor @var{n}, +or the standard output (file descriptor 1) if @var{n} is not specified. + +@subsection Opening File Descriptors for Reading and Writing +The redirection operator +@example +[@var{n}]<>@var{word} +@end example +@noindent +causes the file whose name is the expansion of @var{word} +to be opened for both reading and writing on file descriptor +@var{n}, or on file descriptor 0 if @var{n} +is not specified. If the file does not exist, it is created. + +@node Executing Commands +@section Executing Commands + +@menu +* Simple Command Expansion:: How Bash expands simple commands before + executing them. +* Command Search and Execution:: How Bash finds commands and runs them. +* Command Execution Environment:: The environment in which Bash + executes commands that are not + shell builtins. +* Environment:: The environment given to a command. +* Exit Status:: The status returned by commands and how Bash + interprets it. +* Signals:: What happens when Bash or a command it runs + receives a signal. +@end menu + +@node Simple Command Expansion +@subsection Simple Command Expansion +@cindex command expansion + +When a simple command is executed, the shell performs the following +expansions, assignments, and redirections, from left to right. + +@enumerate +@item +The words that the parser has marked as variable assignments (those +preceding the command name) and redirections are saved for later +processing. + +@item +The words that are not variable assignments or redirections are +expanded (@pxref{Shell Expansions}). +If any words remain after expansion, the first word +is taken to be the name of the command and the remaining words are +the arguments. + +@item +Redirections are performed as described above (@pxref{Redirections}). + +@item +The text after the @samp{=} in each variable assignment undergoes tilde +expansion, parameter expansion, command substitution, arithmetic expansion, +and quote removal before being assigned to the variable. +@end enumerate + +If no command name results, the variable assignments affect the current +shell environment. Otherwise, the variables are added to the environment +of the executed command and do not affect the current shell environment. +If any of the assignments attempts to assign a value to a readonly variable, +an error occurs, and the command exits with a non-zero status. + +If no command name results, redirections are performed, but do not +affect the current shell environment. A redirection error causes the +command to exit with a non-zero status. + +If there is a command name left after expansion, execution proceeds as +described below. Otherwise, the command exits. If one of the expansions +contained a command substitution, the exit status of the command is +the exit status of the last command substitution performed. If there +were no command substitutions, the command exits with a status of zero. + +@node Command Search and Execution +@subsection Command Search and Execution +@cindex command execution +@cindex command search + +After a command has been split into words, if it results in a +simple command and an optional list of arguments, the following +actions are taken. + +@enumerate +@item +If the command name contains no slashes, the shell attempts to +locate it. If there exists a shell function by that name, that +function is invoked as described in @ref{Shell Functions}. + +@item +If the name does not match a function, the shell searches for +it in the list of shell builtins. If a match is found, that +builtin is invoked. + +@item +If the name is neither a shell function nor a builtin, +and contains no slashes, Bash searches each element of +@env{$PATH} for a directory containing an executable file +by that name. Bash uses a hash table to remember the full +pathnames of executable files to avoid multiple @env{PATH} searches +(see the description of @code{hash} in @ref{Bourne Shell Builtins}). +A full search of the directories in @env{$PATH} +is performed only if the command is not found in the hash table. +If the search is unsuccessful, the shell searches for a defined shell +function named @code{command_not_found_handle}. +If that function exists, it is invoked with the original command and +the original command's arguments as its arguments, and the function's +exit status becomes the exit status of the shell. +If that function is not defined, the shell prints an error +message and returns an exit status of 127. + +@item +If the search is successful, or if the command name contains +one or more slashes, the shell executes the named program in +a separate execution environment. +Argument 0 is set to the name given, and the remaining arguments +to the command are set to the arguments supplied, if any. + +@item +If this execution fails because the file is not in executable +format, and the file is not a directory, it is assumed to be a +@var{shell script} and the shell executes it as described in +@ref{Shell Scripts}. + +@item +If the command was not begun asynchronously, the shell waits for +the command to complete and collects its exit status. + +@end enumerate + +@node Command Execution Environment +@subsection Command Execution Environment +@cindex execution environment + +The shell has an @var{execution environment}, which consists of the +following: + +@itemize @bullet +@item +open files inherited by the shell at invocation, as modified by +redirections supplied to the @code{exec} builtin + +@item +the current working directory as set by @code{cd}, @code{pushd}, or +@code{popd}, or inherited by the shell at invocation + +@item +the file creation mode mask as set by @code{umask} or inherited from +the shell's parent + +@item +current traps set by @code{trap} + +@item +shell parameters that are set by variable assignment or with @code{set} +or inherited from the shell's parent in the environment + +@item +shell functions defined during execution or inherited from the shell's +parent in the environment + +@item +options enabled at invocation (either by default or with command-line +arguments) or by @code{set} + +@item +options enabled by @code{shopt} (@pxref{The Shopt Builtin}) + +@item +shell aliases defined with @code{alias} (@pxref{Aliases}) + +@item +various process @sc{id}s, including those of background jobs +(@pxref{Lists}), the value of @code{$$}, and the value of +@env{$PPID} + +@end itemize + +When a simple command other than a builtin or shell function +is to be executed, it +is invoked in a separate execution environment that consists of +the following. Unless otherwise noted, the values are inherited +from the shell. + +@itemize @bullet +@item +the shell's open files, plus any modifications and additions specified +by redirections to the command + +@item +the current working directory + +@item +the file creation mode mask + +@item +shell variables and functions marked for export, along with variables +exported for the command, passed in the environment (@pxref{Environment}) + +@item +traps caught by the shell are reset to the values inherited from the +shell's parent, and traps ignored by the shell are ignored + +@end itemize + +A command invoked in this separate environment cannot affect the +shell's execution environment. + +Command substitution, commands grouped with parentheses, +and asynchronous commands are invoked in a +subshell environment that is a duplicate of the shell environment, +except that traps caught by the shell are reset to the values +that the shell inherited from its parent at invocation. Builtin +commands that are invoked as part of a pipeline are also executed +in a subshell environment. Changes made to the subshell environment +cannot affect the shell's execution environment. + +Subshells spawned to execute command substitutions inherit the value of +the @option{-e} option from the parent shell. When not in @sc{posix} mode, +Bash clears the @option{-e} option in such subshells. + +If a command is followed by a @samp{&} and job control is not active, the +default standard input for the command is the empty file @file{/dev/null}. +Otherwise, the invoked command inherits the file descriptors of the calling +shell as modified by redirections. + +@node Environment +@subsection Environment +@cindex environment + +When a program is invoked it is given an array of strings +called the @var{environment}. +This is a list of name-value pairs, of the form @code{name=value}. + +Bash provides several ways to manipulate the environment. +On invocation, the shell scans its own environment and +creates a parameter for each name found, automatically marking +it for @var{export} +to child processes. Executed commands inherit the environment. +The @code{export} and @samp{declare -x} +commands allow parameters and functions to be added to and +deleted from the environment. If the value of a parameter +in the environment is modified, the new value becomes part +of the environment, replacing the old. The environment +inherited by any executed command consists of the shell's +initial environment, whose values may be modified in the shell, +less any pairs removed by the @code{unset} and @samp{export -n} +commands, plus any additions via the @code{export} and +@samp{declare -x} commands. + +The environment for any simple command +or function may be augmented temporarily by prefixing it with +parameter assignments, as described in @ref{Shell Parameters}. +These assignment statements affect only the environment seen +by that command. + +If the @option{-k} option is set (@pxref{The Set Builtin}), then all +parameter assignments are placed in the environment for a command, +not just those that precede the command name. + +When Bash invokes an external command, the variable @samp{$_} +is set to the full pathname of the command and passed to that +command in its environment. + +@node Exit Status +@subsection Exit Status +@cindex exit status + +The exit status of an executed command is the value returned by the +@var{waitpid} system call or equivalent function. Exit statuses +fall between 0 and 255, though, as explained below, the shell may +use values above 125 specially. Exit statuses from shell builtins and +compound commands are also limited to this range. Under certain +circumstances, the shell will use special values to indicate specific +failure modes. + +For the shell's purposes, a command which exits with a +zero exit status has succeeded. +A non-zero exit status indicates failure. +This seemingly counter-intuitive scheme is used so there +is one well-defined way to indicate success and a variety of +ways to indicate various failure modes. +When a command terminates on a fatal signal whose number is @var{N}, +Bash uses the value 128+@var{N} as the exit status. + +If a command is not found, the child process created to +execute it returns a status of 127. If a command is found +but is not executable, the return status is 126. + +If a command fails because of an error during expansion or redirection, +the exit status is greater than zero. + +The exit status is used by the Bash conditional commands +(@pxref{Conditional Constructs}) and some of the list +constructs (@pxref{Lists}). + +All of the Bash builtins return an exit status of zero if they succeed +and a non-zero status on failure, so they may be used by the +conditional and list constructs. +All builtins return an exit status of 2 to indicate incorrect usage. + +@node Signals +@subsection Signals +@cindex signal handling + +When Bash is interactive, in the absence of any traps, it ignores +@code{SIGTERM} (so that @samp{kill 0} does not kill an interactive shell), +and @code{SIGINT} +is caught and handled (so that the @code{wait} builtin is interruptible). +When Bash receives a @code{SIGINT}, it breaks out of any executing loops. +In all cases, Bash ignores @code{SIGQUIT}. +If job control is in effect (@pxref{Job Control}), Bash +ignores @code{SIGTTIN}, @code{SIGTTOU}, and @code{SIGTSTP}. + +Non-builtin commands started by Bash have signal handlers set to the +values inherited by the shell from its parent. +When job control is not in effect, asynchronous commands +ignore @code{SIGINT} and @code{SIGQUIT} in addition to these inherited +handlers. +Commands run as a result of +command substitution ignore the keyboard-generated job control signals +@code{SIGTTIN}, @code{SIGTTOU}, and @code{SIGTSTP}. + +The shell exits by default upon receipt of a @code{SIGHUP}. +Before exiting, an interactive shell resends the @code{SIGHUP} to +all jobs, running or stopped. +Stopped jobs are sent @code{SIGCONT} to ensure that they receive +the @code{SIGHUP}. +To prevent the shell from sending the @code{SIGHUP} signal to a +particular job, it should be removed +from the jobs table with the @code{disown} +builtin (@pxref{Job Control Builtins}) or marked +to not receive @code{SIGHUP} using @code{disown -h}. + +If the @code{huponexit} shell option has been set with @code{shopt} +(@pxref{The Shopt Builtin}), Bash sends a @code{SIGHUP} to all jobs when +an interactive login shell exits. + +If Bash is waiting for a command to complete and receives a signal +for which a trap has been set, the trap will not be executed until +the command completes. +When Bash is waiting for an asynchronous +command via the @code{wait} builtin, the reception of a signal for +which a trap has been set will cause the @code{wait} builtin to return +immediately with an exit status greater than 128, immediately after +which the trap is executed. + +@node Shell Scripts +@section Shell Scripts +@cindex shell script + +A shell script is a text file containing shell commands. When such +a file is used as the first non-option argument when invoking Bash, +and neither the @option{-c} nor @option{-s} option is supplied +(@pxref{Invoking Bash}), +Bash reads and executes commands from the file, then exits. This +mode of operation creates a non-interactive shell. The shell first +searches for the file in the current directory, and looks in the +directories in @env{$PATH} if not found there. + +When Bash runs +a shell script, it sets the special parameter @code{0} to the name +of the file, rather than the name of the shell, and the positional +parameters are set to the remaining arguments, if any are given. +If no additional arguments are supplied, the positional parameters +are unset. + +A shell script may be made executable by using the @code{chmod} command +to turn on the execute bit. When Bash finds such a file while +searching the @env{$PATH} for a command, it spawns a subshell to +execute it. In other words, executing +@example +filename @var{arguments} +@end example +@noindent +is equivalent to executing +@example +bash filename @var{arguments} +@end example + +@noindent +if @code{filename} is an executable shell script. +This subshell reinitializes itself, so that the effect is as if a +new shell had been invoked to interpret the script, with the +exception that the locations of commands remembered by the parent +(see the description of @code{hash} in @ref{Bourne Shell Builtins}) +are retained by the child. + +Most versions of Unix make this a part of the operating system's command +execution mechanism. If the first line of a script begins with +the two characters @samp{#!}, the remainder of the line specifies +an interpreter for the program. +Thus, you can specify Bash, @code{awk}, Perl, or some other +interpreter and write the rest of the script file in that language. + +The arguments to the interpreter +consist of a single optional argument following the interpreter +name on the first line of the script file, followed by the name of +the script file, followed by the rest of the arguments. Bash +will perform this action on operating systems that do not handle it +themselves. Note that some older versions of Unix limit the interpreter +name and argument to a maximum of 32 characters. + +Bash scripts often begin with @code{#! /bin/bash} (assuming that +Bash has been installed in @file{/bin}), since this ensures that +Bash will be used to interpret the script, even if it is executed +under another shell. + +@node Shell Builtin Commands +@chapter Shell Builtin Commands + +@menu +* Bourne Shell Builtins:: Builtin commands inherited from the Bourne + Shell. +* Bash Builtins:: Table of builtins specific to Bash. +* Modifying Shell Behavior:: Builtins to modify shell attributes and + optional behavior. +* Special Builtins:: Builtin commands classified specially by + POSIX. +@end menu + +Builtin commands are contained within the shell itself. +When the name of a builtin command is used as the first word of +a simple command (@pxref{Simple Commands}), the shell executes +the command directly, without invoking another program. +Builtin commands are necessary to implement functionality impossible +or inconvenient to obtain with separate utilities. + +This section briefly describes the builtins which Bash inherits from +the Bourne Shell, as well as the builtin commands which are unique +to or have been extended in Bash. + +Several builtin commands are described in other chapters: builtin +commands which provide the Bash interface to the job control +facilities (@pxref{Job Control Builtins}), the directory stack +(@pxref{Directory Stack Builtins}), the command history +(@pxref{Bash History Builtins}), and the programmable completion +facilities (@pxref{Programmable Completion Builtins}). + +Many of the builtins have been extended by @sc{posix} or Bash. + +Unless otherwise noted, each builtin command documented as accepting +options preceded by @samp{-} accepts @samp{--} +to signify the end of the options. +The @code{:}, @code{true}, @code{false}, and @code{test} +builtins do not accept options and do not treat @samp{--} specially. +The @code{exit}, @code{logout}, @code{break}, @code{continue}, @code{let}, +and @code{shift} builtins accept and process arguments beginning +with @samp{-} without requiring @samp{--}. +Other builtins that accept arguments but are not specified as accepting +options interpret arguments beginning with @samp{-} as invalid options and +require @samp{--} to prevent this interpretation. + +@node Bourne Shell Builtins +@section Bourne Shell Builtins + +The following shell builtin commands are inherited from the Bourne Shell. +These commands are implemented as specified by the @sc{posix} standard. + +@table @code +@item : @r{(a colon)} +@btindex : +@example +: [@var{arguments}] +@end example + +Do nothing beyond expanding @var{arguments} and performing redirections. +The return status is zero. + +@item . @r{(a period)} +@btindex . +@example +. @var{filename} [@var{arguments}] +@end example + +Read and execute commands from the @var{filename} argument in the +current shell context. If @var{filename} does not contain a slash, +the @env{PATH} variable is used to find @var{filename}. +When Bash is not in @sc{posix} mode, the current directory is searched +if @var{filename} is not found in @env{$PATH}. +If any @var{arguments} are supplied, they become the positional +parameters when @var{filename} is executed. Otherwise the positional +parameters are unchanged. +The return status is the exit status of the last command executed, or +zero if no commands are executed. If @var{filename} is not found, or +cannot be read, the return status is non-zero. +This builtin is equivalent to @code{source}. + +@item break +@btindex break +@example +break [@var{n}] +@end example + +Exit from a @code{for}, @code{while}, @code{until}, or @code{select} loop. +If @var{n} is supplied, the @var{n}th enclosing loop is exited. +@var{n} must be greater than or equal to 1. +The return status is zero unless @var{n} is not greater than or equal to 1. + +@item cd +@btindex cd +@example +cd [-L|[-P [-e]] [-@@] [@var{directory}] +@end example + +Change the current working directory to @var{directory}. +If @var{directory} is not supplied, the value of the @env{HOME} +shell variable is used. +Any additional arguments following @var{directory} are ignored. +If the shell variable +@env{CDPATH} exists, it is used as a search path: +each directory name in @env{CDPATH} is searched for +@var{directory}, with alternative directory names in @env{CDPATH} +separated by a colon (@samp{:}). +If @var{directory} begins with a slash, @env{CDPATH} is not used. + +The @option{-P} option means to not follow symbolic links: symbolic links +are resolved while @code{cd} is traversing @var{directory} and before +processing an instance of @samp{..} in @var{directory}. + +By default, or when the @option{-L} option is supplied, symbolic links +in @var{directory} are resolved after @code{cd} processes an instance +of @samp{..} in @var{directory}. + +If @samp{..} appears in @var{directory}, it is processed by removing the +immediately preceding pathname component, back to a slash or the beginning +of @var{directory}. + +If the @option{-e} option is supplied with @option{-P} +and the current working directory cannot be successfully determined +after a successful directory change, @code{cd} will return an unsuccessful +status. + +On systems that support it, the @option{-@@} option presents the extended +attributes associated with a file as a directory. + +If @var{directory} is @samp{-}, it is converted to @env{$OLDPWD} +before the directory change is attempted. + +If a non-empty directory name from @env{CDPATH} is used, or if +@samp{-} is the first argument, and the directory change is +successful, the absolute pathname of the new working directory is +written to the standard output. + +The return status is zero if the directory is successfully changed, +non-zero otherwise. + +@item continue +@btindex continue +@example +continue [@var{n}] +@end example + +Resume the next iteration of an enclosing @code{for}, @code{while}, +@code{until}, or @code{select} loop. +If @var{n} is supplied, the execution of the @var{n}th enclosing loop +is resumed. +@var{n} must be greater than or equal to 1. +The return status is zero unless @var{n} is not greater than or equal to 1. + +@item eval +@btindex eval +@example +eval [@var{arguments}] +@end example + +The arguments are concatenated together into a single command, which is +then read and executed, and its exit status returned as the exit status +of @code{eval}. +If there are no arguments or only empty arguments, the return status is +zero. + +@item exec +@btindex exec +@example +exec [-cl] [-a @var{name}] [@var{command} [@var{arguments}]] +@end example + +If @var{command} +is supplied, it replaces the shell without creating a new process. +If the @option{-l} option is supplied, the shell places a dash at the +beginning of the zeroth argument passed to @var{command}. +This is what the @code{login} program does. +The @option{-c} option causes @var{command} to be executed with an empty +environment. +If @option{-a} is supplied, the shell passes @var{name} as the zeroth +argument to @var{command}. +If @var{command} +cannot be executed for some reason, a non-interactive shell exits, +unless the @code{execfail} shell option +is enabled. In that case, it returns failure. +An interactive shell returns failure if the file cannot be executed. +If no @var{command} is specified, redirections may be used to affect +the current shell environment. If there are no redirection errors, the +return status is zero; otherwise the return status is non-zero. + +@item exit +@btindex exit +@example +exit [@var{n}] +@end example + +Exit the shell, returning a status of @var{n} to the shell's parent. +If @var{n} is omitted, the exit status is that of the last command executed. +Any trap on @code{EXIT} is executed before the shell terminates. + +@item export +@btindex export +@example +export [-fn] [-p] [@var{name}[=@var{value}]] +@end example + +Mark each @var{name} to be passed to child processes +in the environment. If the @option{-f} option is supplied, the @var{name}s +refer to shell functions; otherwise the names refer to shell variables. +The @option{-n} option means to no longer mark each @var{name} for export. +If no @var{names} are supplied, or if the @option{-p} option is given, a +list of names of all exported variables is displayed. +The @option{-p} option displays output in a form that may be reused as input. +If a variable name is followed by =@var{value}, the value of +the variable is set to @var{value}. + +The return status is zero unless an invalid option is supplied, one of +the names is not a valid shell variable name, or @option{-f} is supplied +with a name that is not a shell function. + +@item getopts +@btindex getopts +@example +getopts @var{optstring} @var{name} [@var{args}] +@end example + +@code{getopts} is used by shell scripts to parse positional parameters. +@var{optstring} contains the option characters to be recognized; if a +character is followed by a colon, the option is expected to have an +argument, which should be separated from it by whitespace. +The colon (@samp{:}) and question mark (@samp{?}) may not be +used as option characters. +Each time it is invoked, @code{getopts} +places the next option in the shell variable @var{name}, initializing +@var{name} if it does not exist, +and the index of the next argument to be processed into the +variable @env{OPTIND}. +@env{OPTIND} is initialized to 1 each time the shell or a shell script +is invoked. +When an option requires an argument, +@code{getopts} places that argument into the variable @env{OPTARG}. +The shell does not reset @env{OPTIND} automatically; it must be manually +reset between multiple calls to @code{getopts} within the same shell +invocation if a new set of parameters is to be used. + +When the end of options is encountered, @code{getopts} exits with a +return value greater than zero. +@env{OPTIND} is set to the index of the first non-option argument, +and @var{name} is set to @samp{?}. + +@code{getopts} +normally parses the positional parameters, but if more arguments are +given in @var{args}, @code{getopts} parses those instead. + +@code{getopts} can report errors in two ways. If the first character of +@var{optstring} is a colon, @var{silent} +error reporting is used. In normal operation, diagnostic messages +are printed when invalid options or missing option arguments are +encountered. +If the variable @env{OPTERR} +is set to 0, no error messages will be displayed, even if the first +character of @code{optstring} is not a colon. + +If an invalid option is seen, +@code{getopts} places @samp{?} into @var{name} and, if not silent, +prints an error message and unsets @env{OPTARG}. +If @code{getopts} is silent, the option character found is placed in +@env{OPTARG} and no diagnostic message is printed. + +If a required argument is not found, and @code{getopts} +is not silent, a question mark (@samp{?}) is placed in @var{name}, +@code{OPTARG} is unset, and a diagnostic message is printed. +If @code{getopts} is silent, then a colon (@samp{:}) is placed in +@var{name} and @env{OPTARG} is set to the option character found. + +@item hash +@btindex hash +@example +hash [-r] [-p @var{filename}] [-dt] [@var{name}] +@end example + +Each time @code{hash} is invoked, it remembers the full pathnames of the +commands specified as @var{name} arguments, +so they need not be searched for on subsequent invocations. +The commands are found by searching through the directories listed in +@env{$PATH}. +Any previously-remembered pathname is discarded. +The @option{-p} option inhibits the path search, and @var{filename} is +used as the location of @var{name}. +The @option{-r} option causes the shell to forget all remembered locations. +The @option{-d} option causes the shell to forget the remembered location +of each @var{name}. +If the @option{-t} option is supplied, the full pathname to which each +@var{name} corresponds is printed. If multiple @var{name} arguments are +supplied with @option{-t} the @var{name} is printed before the hashed +full pathname. +The @option{-l} option causes output to be displayed in a format +that may be reused as input. +If no arguments are given, or if only @option{-l} is supplied, +information about remembered commands is printed. +The return status is zero unless a @var{name} is not found or an invalid +option is supplied. + +@item pwd +@btindex pwd +@example +pwd [-LP] +@end example + +Print the absolute pathname of the current working directory. +If the @option{-P} option is supplied, the pathname printed will not +contain symbolic links. +If the @option{-L} option is supplied, the pathname printed may contain +symbolic links. +The return status is zero unless an error is encountered while +determining the name of the current directory or an invalid option +is supplied. + +@item readonly +@btindex readonly +@example +readonly [-aAf] [-p] [@var{name}[=@var{value}]] @dots{} +@end example + +Mark each @var{name} as readonly. +The values of these names may not be changed by subsequent assignment. +If the @option{-f} option is supplied, each @var{name} refers to a shell +function. +The @option{-a} option means each @var{name} refers to an indexed +array variable; the @option{-A} option means each @var{name} refers +to an associative array variable. +If both options are supplied, @option{-A} takes precedence. +If no @var{name} arguments are given, or if the @option{-p} +option is supplied, a list of all readonly names is printed. +The other options may be used to restrict the output to a subset of +the set of readonly names. +The @option{-p} option causes output to be displayed in a format that +may be reused as input. +If a variable name is followed by =@var{value}, the value of +the variable is set to @var{value}. +The return status is zero unless an invalid option is supplied, one of +the @var{name} arguments is not a valid shell variable or function name, +or the @option{-f} option is supplied with a name that is not a shell function. + +@item return +@btindex return +@example +return [@var{n}] +@end example + +Cause a shell function to stop executing and return the value @var{n} +to its caller. +If @var{n} is not supplied, the return value is the exit status of the +last command executed in the function. +@code{return} may also be used to terminate execution of a script +being executed with the @code{.} (@code{source}) builtin, +returning either @var{n} or +the exit status of the last command executed within the script as the exit +status of the script. +If @var{n} is supplied, the return value is its least significant +8 bits. +Any command associated with the @code{RETURN} trap is executed +before execution resumes after the function or script. +The return status is non-zero if @code{return} is supplied a non-numeric +argument or is used outside a function +and not during the execution of a script by @code{.} or @code{source}. + +@item shift +@btindex shift +@example +shift [@var{n}] +@end example + +Shift the positional parameters to the left by @var{n}. +The positional parameters from @var{n}+1 @dots{} @code{$#} are +renamed to @code{$1} @dots{} @code{$#}-@var{n}. +Parameters represented by the numbers @code{$#} to @code{$#}-@var{n}+1 +are unset. +@var{n} must be a non-negative number less than or equal to @code{$#}. +If @var{n} is zero or greater than @code{$#}, the positional parameters +are not changed. +If @var{n} is not supplied, it is assumed to be 1. +The return status is zero unless @var{n} is greater than @code{$#} or +less than zero, non-zero otherwise. + +@item test +@itemx [ +@btindex test +@btindex [ +@example +test @var{expr} +@end example + +Evaluate a conditional express +ion @var{expr} and return a status of 0 +(true) or 1 (false). +Each operator and operand must be a separate argument. +Expressions are composed of the primaries described below in +@ref{Bash Conditional Expressions}. +@code{test} does not accept any options, nor does it accept and ignore +an argument of @option{--} as signifying the end of options. + +When the @code{[} form is used, the last argument to the command must +be a @code{]}. + +Expressions may be combined using the following operators, listed in +decreasing order of precedence. +The evaluation depends on the number of arguments; see below. +Operator precedence is used when there are five or more arguments. + +@table @code +@item ! @var{expr} +True if @var{expr} is false. + +@item ( @var{expr} ) +Returns the value of @var{expr}. +This may be used to override the normal precedence of operators. + +@item @var{expr1} -a @var{expr2} +True if both @var{expr1} and @var{expr2} are true. + +@item @var{expr1} -o @var{expr2} +True if either @var{expr1} or @var{expr2} is true. +@end table + +The @code{test} and @code{[} builtins evaluate conditional +expressions using a set of rules based on the number of arguments. + +@table @asis +@item 0 arguments +The expression is false. + +@item 1 argument +The expression is true if and only if the argument is not null. + +@item 2 arguments +If the first argument is @samp{!}, the expression is true if and +only if the second argument is null. +If the first argument is one of the unary conditional operators +(@pxref{Bash Conditional Expressions}), the expression +is true if the unary test is true. +If the first argument is not a valid unary operator, the expression is +false. + +@item 3 arguments +The following conditions are applied in the order listed. +If the second argument is one of the binary conditional +operators (@pxref{Bash Conditional Expressions}), the +result of the expression is the result of the binary test using the +first and third arguments as operands. +The @samp{-a} and @samp{-o} operators are considered binary operators +when there are three arguments. +If the first argument is @samp{!}, the value is the negation of +the two-argument test using the second and third arguments. +If the first argument is exactly @samp{(} and the third argument is +exactly @samp{)}, the result is the one-argument test of the second +argument. +Otherwise, the expression is false. + +@item 4 arguments +If the first argument is @samp{!}, the result is the negation of +the three-argument expression composed of the remaining arguments. +Otherwise, the expression is parsed and evaluated according to +precedence using the rules listed above. + +@item 5 or more arguments +The expression is parsed and evaluated according to precedence +using the rules listed above. +@end table + +When used with @code{test} or @samp{[}, the @samp{<} and @samp{>} +operators sort lexicographically using ASCII ordering. + +@item times +@btindex times +@example +times +@end example + +Print out the user and system times used by the shell and its children. +The return status is zero. + +@item trap +@btindex trap +@example +trap [-lp] [@var{arg}] [@var{sigspec} @dots{}] +@end example + +The commands in @var{arg} are to be read and executed when the +shell receives signal @var{sigspec}. If @var{arg} is absent (and +there is a single @var{sigspec}) or +equal to @samp{-}, each specified signal's disposition is reset +to the value it had when the shell was started. +If @var{arg} is the null string, then the signal specified by +each @var{sigspec} is ignored by the shell and commands it invokes. +If @var{arg} is not present and @option{-p} has been supplied, +the shell displays the trap commands associated with each @var{sigspec}. +If no arguments are supplied, or +only @option{-p} is given, @code{trap} prints the list of commands +associated with each signal number in a form that may be reused as +shell input. +The @option{-l} option causes the shell to print a list of signal names +and their corresponding numbers. +Each @var{sigspec} is either a signal name or a signal number. +Signal names are case insensitive and the @code{SIG} prefix is optional. + +If a @var{sigspec} +is @code{0} or @code{EXIT}, @var{arg} is executed when the shell exits. +If a @var{sigspec} is @code{DEBUG}, the command @var{arg} is executed +before every simple command, @code{for} command, @code{case} command, +@code{select} command, every arithmetic @code{for} command, and before +the first command executes in a shell function. +Refer to the description of the @code{extdebug} option to the +@code{shopt} builtin (@pxref{The Shopt Builtin}) for details of its +effect on the @code{DEBUG} trap. +If a @var{sigspec} is @code{RETURN}, the command @var{arg} is executed +each time a shell function or a script executed with the @code{.} or +@code{source} builtins finishes executing. + +If a @var{sigspec} is @code{ERR}, the command @var{arg} +is executed whenever +a pipeline (which may consist of a single simple +command), a list, or a compound command returns a +non-zero exit status, +subject to the following conditions. +The @code{ERR} trap is not executed if the failed command is part of the +command list immediately following an @code{until} or @code{while} keyword, +part of the test following the @code{if} or @code{elif} reserved words, +part of a command executed in a @code{&&} or @code{||} list +except the command following the final @code{&&} or @code{||}, +any command in a pipeline but the last, +or if the command's return +status is being inverted using @code{!}. +These are the same conditions obeyed by the @code{errexit} (@option{-e}) +option. + +Signals ignored upon entry to the shell cannot be trapped or reset. +Trapped signals that are not being ignored are reset to their original +values in a subshell or subshell environment when one is created. + +The return status is zero unless a @var{sigspec} does not specify a +valid signal. + +@item umask +@btindex umask +@example +umask [-p] [-S] [@var{mode}] +@end example + +Set the shell process's file creation mask to @var{mode}. If +@var{mode} begins with a digit, it is interpreted as an octal number; +if not, it is interpreted as a symbolic mode mask similar +to that accepted by the @code{chmod} command. If @var{mode} is +omitted, the current value of the mask is printed. If the @option{-S} +option is supplied without a @var{mode} argument, the mask is printed +in a symbolic format. +If the @option{-p} option is supplied, and @var{mode} +is omitted, the output is in a form that may be reused as input. +The return status is zero if the mode is successfully changed or if +no @var{mode} argument is supplied, and non-zero otherwise. + +Note that when the mode is interpreted as an octal number, each number +of the umask is subtracted from @code{7}. Thus, a umask of @code{022} +results in permissions of @code{755}. + +@item unset +@btindex unset +@example +unset [-fnv] [@var{name}] +@end example + +Remove each variable or function @var{name}. +If the @option{-v} option is given, each +@var{name} refers to a shell variable and that variable is remvoved. +If the @option{-f} option is given, the @var{name}s refer to shell +functions, and the function definition is removed. +If the @option{-n} option is supplied, and @var{name} is a variable with +the @var{nameref} attribute, @var{name} will be unset rather than the +variable it references. +@option{-n} has no effect if the @option{-f} option is supplied. +If no options are supplied, each @var{name} refers to a variable; if +there is no variable by that name, any function with that name is +unset. +Readonly variables and functions may not be unset. +The return status is zero unless a @var{name} is readonly. +@end table + +@node Bash Builtins +@section Bash Builtin Commands + +This section describes builtin commands which are unique to +or have been extended in Bash. +Some of these commands are specified in the @sc{posix} standard. + +@table @code + +@item alias +@btindex alias +@example +alias [-p] [@var{name}[=@var{value}] @dots{}] +@end example + +Without arguments or with the @option{-p} option, @code{alias} prints +the list of aliases on the standard output in a form that allows +them to be reused as input. +If arguments are supplied, an alias is defined for each @var{name} +whose @var{value} is given. If no @var{value} is given, the name +and value of the alias is printed. +Aliases are described in @ref{Aliases}. + +@item bind +@btindex bind +@example +bind [-m @var{keymap}] [-lpsvPSVX] +bind [-m @var{keymap}] [-q @var{function}] [-u @var{function}] [-r @var{keyseq}] +bind [-m @var{keymap}] -f @var{filename} +bind [-m @var{keymap}] -x @var{keyseq:shell-command} +bind [-m @var{keymap}] @var{keyseq:function-name} +bind @var{readline-command} +@end example + +Display current Readline (@pxref{Command Line Editing}) +key and function bindings, +bind a key sequence to a Readline function or macro, +or set a Readline variable. +Each non-option argument is a command as it would appear in a +Readline initialization file (@pxref{Readline Init File}), +but each binding or command must be passed as a separate argument; e.g., +@samp{"\C-x\C-r":re-read-init-file}. + +Options, if supplied, have the following meanings: + +@table @code +@item -m @var{keymap} +Use @var{keymap} as the keymap to be affected by +the subsequent bindings. Acceptable @var{keymap} +names are +@code{emacs}, +@code{emacs-standard}, +@code{emacs-meta}, +@code{emacs-ctlx}, +@code{vi}, +@code{vi-move}, +@code{vi-command}, and +@code{vi-insert}. +@code{vi} is equivalent to @code{vi-command}; +@code{emacs} is equivalent to @code{emacs-standard}. + +@item -l +List the names of all Readline functions. + +@item -p +Display Readline function names and bindings in such a way that they +can be used as input or in a Readline initialization file. + +@item -P +List current Readline function names and bindings. + +@item -v +Display Readline variable names and values in such a way that they +can be used as input or in a Readline initialization file. + +@item -V +List current Readline variable names and values. + +@item -s +Display Readline key sequences bound to macros and the strings they output +in such a way that they can be used as input or in a Readline +initialization file. + +@item -S +Display Readline key sequences bound to macros and the strings they output. + +@item -f @var{filename} +Read key bindings from @var{filename}. + +@item -q @var{function} +Query about which keys invoke the named @var{function}. + +@item -u @var{function} +Unbind all keys bound to the named @var{function}. + +@item -r @var{keyseq} +Remove any current binding for @var{keyseq}. + +@item -x @var{keyseq:shell-command} +Cause @var{shell-command} to be executed whenever @var{keyseq} is +entered. +When @var{shell-command} is executed, the shell sets the +@code{READLINE_LINE} variable to the contents of the Readline line +buffer and the @code{READLINE_POINT} variable to the current location +of the insertion point. +If the executed command changes the value of @code{READLINE_LINE} or +@code{READLINE_POINT}, those new values will be reflected in the +editing state. + +@item -X +List all key sequences bound to shell commands and the associated commands +in a format that can be reused as input. +@end table + +@noindent +The return status is zero unless an invalid option is supplied or an +error occurs. + +@item builtin +@btindex builtin +@example +builtin [@var{shell-builtin} [@var{args}]] +@end example + +Run a shell builtin, passing it @var{args}, and return its exit status. +This is useful when defining a shell function with the same +name as a shell builtin, retaining the functionality of the builtin within +the function. +The return status is non-zero if @var{shell-builtin} is not a shell +builtin command. + +@item caller +@btindex caller +@example +caller [@var{expr}] +@end example + +Returns the context of any active subroutine call (a shell function or +a script executed with the @code{.} or @code{source} builtins). + +Without @var{expr}, @code{caller} displays the line number and source +filename of the current subroutine call. +If a non-negative integer is supplied as @var{expr}, @code{caller} +displays the line number, subroutine name, and source file corresponding +to that position in the current execution call stack. This extra +information may be used, for example, to print a stack trace. The +current frame is frame 0. + +The return value is 0 unless the shell is not executing a subroutine +call or @var{expr} does not correspond to a valid position in the +call stack. + +@item command +@btindex command +@example +command [-pVv] @var{command} [@var{arguments} @dots{}] +@end example + +Runs @var{command} with @var{arguments} ignoring any shell function +named @var{command}. +Only shell builtin commands or commands found by searching the +@env{PATH} are executed. +If there is a shell function named @code{ls}, running @samp{command ls} +within the function will execute the external command @code{ls} +instead of calling the function recursively. +The @option{-p} option means to use a default value for @env{PATH} +that is guaranteed to find all of the standard utilities. +The return status in this case is 127 if @var{command} cannot be +found or an error occurred, and the exit status of @var{command} +otherwise. + +If either the @option{-V} or @option{-v} option is supplied, a +description of @var{command} is printed. The @option{-v} option +causes a single word indicating the command or file name used to +invoke @var{command} to be displayed; the @option{-V} option produces +a more verbose description. In this case, the return status is +zero if @var{command} is found, and non-zero if not. + +@item declare +@btindex declare +@example +declare [-aAfFgilnrtux] [-p] [@var{name}[=@var{value}] @dots{}] +@end example + +Declare variables and give them attributes. If no @var{name}s +are given, then display the values of variables instead. + +The @option{-p} option will display the attributes and values of each +@var{name}. +When @option{-p} is used with @var{name} arguments, additional options, +other than @option{-f} and @option{-F}, are ignored. + +When @option{-p} is supplied without @var{name} arguments, @code{declare} +will display the attributes and values of all variables having the +attributes specified by the additional options. +If no other options are supplied with @option{-p}, @code{declare} will +display the attributes and values of all shell variables. The @option{-f} +option will restrict the display to shell functions. + +The @option{-F} option inhibits the display of function definitions; +only the function name and attributes are printed. +If the @code{extdebug} shell option is enabled using @code{shopt} +(@pxref{The Shopt Builtin}), the source file name and line number where +the function is defined are displayed as well. +@option{-F} implies @option{-f}. + +The @option{-g} option forces variables to be created or modified at +the global scope, even when @code{declare} is executed in a shell function. +It is ignored in all other cases. + +The following options can be used to restrict output to variables with +the specified attributes or to give variables attributes: + +@table @code +@item -a +Each @var{name} is an indexed array variable (@pxref{Arrays}). + +@item -A +Each @var{name} is an associative array variable (@pxref{Arrays}). + +@item -f +Use function names only. + +@item -i +The variable is to be treated as +an integer; arithmetic evaluation (@pxref{Shell Arithmetic}) is +performed when the variable is assigned a value. + +@item -l +When the variable is assigned a value, all upper-case characters are +converted to lower-case. +The upper-case attribute is disabled. + +@item -n +Give each @var{name} the @var{nameref} attribute, making +it a name reference to another variable. +That other variable is defined by the value of @var{name}. +All references and assignments to @var{name}, except for changing the +@option{-n} attribute itself, are performed on the variable referenced by +@var{name}'s value. +The @option{-n} attribute cannot be applied to array variables. + +@item -r +Make @var{name}s readonly. These names cannot then be assigned values +by subsequent assignment statements or unset. + +@item -t +Give each @var{name} the @code{trace} attribute. +Traced functions inherit the @code{DEBUG} and @code{RETURN} traps from +the calling shell. +The trace attribute has no special meaning for variables. + +@item -u +When the variable is assigned a value, all lower-case characters are +converted to upper-case. +The lower-case attribute is disabled. + +@item -x +Mark each @var{name} for export to subsequent commands via +the environment. +@end table + +Using @samp{+} instead of @samp{-} turns off the attribute instead, +with the exceptions that @samp{+a} +may not be used to destroy an array variable and @samp{+r} will not +remove the readonly attribute. +When used in a function, @code{declare} makes each @var{name} local, +as with the @code{local} command, unless the @option{-g} option is used. +If a variable name is followed by =@var{value}, the value of the variable +is set to @var{value}. + +When using @option{-a} or @option{-A} and the compound assignment syntax to +create array variables, additional attributes do not take effect until +subsequent assignments. + +The return status is zero unless an invalid option is encountered, +an attempt is made to define a function using @samp{-f foo=bar}, +an attempt is made to assign a value to a readonly variable, +an attempt is made to assign a value to an array variable without +using the compound assignment syntax (@pxref{Arrays}), +one of the @var{names} is not a valid shell variable name, +an attempt is made to turn off readonly status for a readonly variable, +an attempt is made to turn off array status for an array variable, +or an attempt is made to display a non-existent function with @option{-f}. + +@item echo +@btindex echo +@example +echo [-neE] [@var{arg} @dots{}] +@end example + +Output the @var{arg}s, separated by spaces, terminated with a +newline. +The return status is 0 unless a write error occurs. +If @option{-n} is specified, the trailing newline is suppressed. +If the @option{-e} option is given, interpretation of the following +backslash-escaped characters is enabled. +The @option{-E} option disables the interpretation of these escape characters, +even on systems where they are interpreted by default. +The @code{xpg_echo} shell option may be used to +dynamically determine whether or not @code{echo} expands these +escape characters by default. +@code{echo} does not interpret @option{--} to mean the end of options. + +@code{echo} interprets the following escape sequences: +@table @code +@item \a +alert (bell) +@item \b +backspace +@item \c +suppress further output +@item \e +@itemx \E +escape +@item \f +form feed +@item \n +new line +@item \r +carriage return +@item \t +horizontal tab +@item \v +vertical tab +@item \\ +backslash +@item \0@var{nnn} +the eight-bit character whose value is the octal value @var{nnn} +(zero to three octal digits) +@item \x@var{HH} +the eight-bit character whose value is the hexadecimal value @var{HH} +(one or two hex digits) +@item \u@var{HHHH} +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +@var{HHHH} (one to four hex digits) +@item \U@var{HHHHHHHH} +the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +@var{HHHHHHHH} (one to eight hex digits) +@end table + +@item enable +@btindex enable +@example +enable [-a] [-dnps] [-f @var{filename}] [@var{name} @dots{}] +@end example + +Enable and disable builtin shell commands. +Disabling a builtin allows a disk command which has the same name +as a shell builtin to be executed without specifying a full pathname, +even though the shell normally searches for builtins before disk commands. +If @option{-n} is used, the @var{name}s become disabled. Otherwise +@var{name}s are enabled. For example, to use the @code{test} binary +found via @env{$PATH} instead of the shell builtin version, type +@samp{enable -n test}. + +If the @option{-p} option is supplied, or no @var{name} arguments appear, +a list of shell builtins is printed. With no other arguments, the list +consists of all enabled shell builtins. +The @option{-a} option means to list +each builtin with an indication of whether or not it is enabled. + +The @option{-f} option means to load the new builtin command @var{name} +from shared object @var{filename}, on systems that support dynamic loading. +The @option{-d} option will delete a builtin loaded with @option{-f}. + +If there are no options, a list of the shell builtins is displayed. +The @option{-s} option restricts @code{enable} to the @sc{posix} special +builtins. If @option{-s} is used with @option{-f}, the new builtin becomes +a special builtin (@pxref{Special Builtins}). + +The return status is zero unless a @var{name} is not a shell builtin +or there is an error loading a new builtin from a shared object. + +@item help +@btindex help +@example +help [-dms] [@var{pattern}] +@end example + +Display helpful information about builtin commands. +If @var{pattern} is specified, @code{help} gives detailed help +on all commands matching @var{pattern}, otherwise a list of +the builtins is printed. + +Options, if supplied, have the following meanings: + +@table @code +@item -d +Display a short description of each @var{pattern} +@item -m +Display the description of each @var{pattern} in a manpage-like format +@item -s +Display only a short usage synopsis for each @var{pattern} +@end table + +The return status is zero unless no command matches @var{pattern}. + +@item let +@btindex let +@example +let @var{expression} [@var{expression} @dots{}] +@end example + +The @code{let} builtin allows arithmetic to be performed on shell +variables. Each @var{expression} is evaluated according to the +rules given below in @ref{Shell Arithmetic}. If the +last @var{expression} evaluates to 0, @code{let} returns 1; +otherwise 0 is returned. + +@item local +@btindex local +@example +local [@var{option}] @var{name}[=@var{value}] @dots{} +@end example + +For each argument, a local variable named @var{name} is created, +and assigned @var{value}. +The @var{option} can be any of the options accepted by @code{declare}. +@code{local} can only be used within a function; it makes the variable +@var{name} have a visible scope restricted to that function and its +children. The return status is zero unless @code{local} is used outside +a function, an invalid @var{name} is supplied, or @var{name} is a +readonly variable. + +@item logout +@btindex logout +@example +logout [@var{n}] +@end example + +Exit a login shell, returning a status of @var{n} to the shell's +parent. + +@item mapfile +@btindex mapfile +@example +mapfile [-n @var{count}] [-O @var{origin}] [-s @var{count}] [-t] [-u @var{fd}] + [-C @var{callback}] [-c @var{quantum}] [@var{array}] +@end example + +Read lines from the standard input into the indexed array variable @var{array}, +or from file descriptor @var{fd} +if the @option{-u} option is supplied. +The variable @code{MAPFILE} is the default @var{array}. +Options, if supplied, have the following meanings: + +@table @code + +@item -n +Copy at most @var{count} lines. If @var{count} is 0, all lines are copied. +@item -O +Begin assigning to @var{array} at index @var{origin}. +The default index is 0. +@item -s +Discard the first @var{count} lines read. +@item -t +Remove a trailing newline from each line read. +@item -u +Read lines from file descriptor @var{fd} instead of the standard input. +@item -C +Evaluate @var{callback} each time @var{quantum}P lines are read. +The @option{-c} option specifies @var{quantum}. +@item -c +Specify the number of lines read between each call to @var{callback}. +@end table + +If @option{-C} is specified without @option{-c}, +the default quantum is 5000. +When @var{callback} is evaluated, it is supplied the index of the next +array element to be assigned and the line to be assigned to that element +as additional arguments. +@var{callback} is evaluated after the line is read but before the +array element is assigned. + +If not supplied with an explicit origin, @code{mapfile} will clear @var{array} +before assigning to it. + +@code{mapfile} returns successfully unless an invalid option or option +argument is supplied, @var{array} is invalid or unassignable, or @var{array} +is not an indexed array. + +@item printf +@btindex printf +@example +printf [-v @var{var}] @var{format} [@var{arguments}] +@end example + +Write the formatted @var{arguments} to the standard output under the +control of the @var{format}. +The @option{-v} option causes the output to be assigned to the variable +@var{var} rather than being printed to the standard output. + +The @var{format} is a character string which contains three types of objects: +plain characters, which are simply copied to standard output, character +escape sequences, which are converted and copied to the standard output, and +format specifications, each of which causes printing of the next successive +@var{argument}. +In addition to the standard @code{printf(1)} formats, @code{printf} +interprets the following extensions: + +@table @code +@item %b +Causes @code{printf} to expand backslash escape sequences in the +corresponding @var{argument}, +except that @samp{\c} terminates output, backslashes in +@samp{\'}, @samp{\"}, and @samp{\?} are not removed, and octal escapes +beginning with @samp{\0} may contain up to four digits. +@item %q +Causes @code{printf} to output the +corresponding @var{argument} in a format that can be reused as shell input. +@item %(@var{datefmt})T +Causes @code{printf} to output the date-time string resulting from using +@var{datefmt} as a format string for @code{strftime}(3). +The corresponding @var{argument} is an integer representing the number of +seconds since the epoch. +Two special argument values may be used: -1 represents the current +time, and -2 represents the time the shell was invoked. +If no argument is specified, conversion behaves as if -1 had been given. +This is an exception to the usual @code{printf} behavior. +@end table + +@noindent +Arguments to non-string format specifiers are treated as C language constants, +except that a leading plus or minus sign is allowed, and if the leading +character is a single or double quote, the value is the ASCII value of +the following character. + +The @var{format} is reused as necessary to consume all of the @var{arguments}. +If the @var{format} requires more @var{arguments} than are supplied, the +extra format specifications behave as if a zero value or null string, as +appropriate, had been supplied. The return value is zero on success, +non-zero on failure. + +@item read +@btindex read +@example +read [-ers] [-a @var{aname}] [-d @var{delim}] [-i @var{text}] [-n @var{nchars}] + [-N @var{nchars}] [-p @var{prompt}] [-t @var{timeout}] [-u @var{fd}] [@var{name} @dots{}] +@end example + +One line is read from the standard input, or from the file descriptor +@var{fd} supplied as an argument to the @option{-u} option, and the first word +is assigned to the first @var{name}, the second word to the second @var{name}, +and so on, with leftover words and their intervening separators assigned +to the last @var{name}. +If there are fewer words read from the input stream than names, +the remaining names are assigned empty values. +The characters in the value of the @env{IFS} variable +are used to split the line into words using the same rules the shell +uses for expansion (described above in @ref{Word Splitting}). +The backslash character @samp{\} may be used to remove any special +meaning for the next character read and for line continuation. +If no names are supplied, the line read is assigned to the +variable @env{REPLY}. +The return code is zero, unless end-of-file is encountered, @code{read} +times out (in which case the return code is greater than 128), +a variable assignment error (such as assigning to a readonly variable) occurs, +or an invalid file descriptor is supplied as the argument to @option{-u}. + +Options, if supplied, have the following meanings: + +@table @code +@item -a @var{aname} +The words are assigned to sequential indices of the array variable +@var{aname}, starting at 0. +All elements are removed from @var{aname} before the assignment. +Other @var{name} arguments are ignored. + +@item -d @var{delim} +The first character of @var{delim} is used to terminate the input line, +rather than newline. + +@item -e +Readline (@pxref{Command Line Editing}) is used to obtain the line. +Readline uses the current (or default, if line editing was not previously +active) editing settings. + +@item -i @var{text} +If Readline is being used to read the line, @var{text} is placed into +the editing buffer before editing begins. + +@item -n @var{nchars} +@code{read} returns after reading @var{nchars} characters rather than +waiting for a complete line of input, but honor a delimiter if fewer +than @var{nchars} characters are read before the delimiter. + +@item -N @var{nchars} +@code{read} returns after reading exactly @var{nchars} characters rather +than waiting for a complete line of input, unless EOF is encountered or +@code{read} times out. +Delimiter characters encountered in the input are +not treated specially and do not cause @code{read} to return until +@var{nchars} characters are read. + +@item -p @var{prompt} +Display @var{prompt}, without a trailing newline, before attempting +to read any input. +The prompt is displayed only if input is coming from a terminal. + +@item -r +If this option is given, backslash does not act as an escape character. +The backslash is considered to be part of the line. +In particular, a backslash-newline pair may not be used as a line +continuation. + +@item -s +Silent mode. If input is coming from a terminal, characters are +not echoed. + +@item -t @var{timeout} +Cause @code{read} to time out and return failure if a complete line of +input (or a specified number of characters) +is not read within @var{timeout} seconds. +@var{timeout} may be a decimal number with a fractional portion following +the decimal point. +This option is only effective if @code{read} is reading input from a +terminal, pipe, or other special file; it has no effect when reading +from regular files. +If @code{read} times out, @code{read} saves any partial input read into +the specified variable @var{name}. +If @var{timeout} is 0, @code{read} returns immediately, without trying to +read and data. The exit status is 0 if input is available on +the specified file descriptor, non-zero otherwise. +The exit status is greater than 128 if the timeout is exceeded. + +@item -u @var{fd} +Read input from file descriptor @var{fd}. +@end table + +@item readarray +@btindex readarray +@example +readarray [-n @var{count}] [-O @var{origin}] [-s @var{count}] [-t] [-u @var{fd}] + [-C @var{callback}] [-c @var{quantum}] [@var{array}] +@end example + +Read lines from the standard input into the indexed array variable @var{array}, +or from file descriptor @var{fd} +if the @option{-u} option is supplied. + +A synonym for @code{mapfile}. + +@item source +@btindex source +@example +source @var{filename} +@end example + +A synonym for @code{.} (@pxref{Bourne Shell Builtins}). + +@item type +@btindex type +@example +type [-afptP] [@var{name} @dots{}] +@end example + +For each @var{name}, indicate how it would be interpreted if used as a +command name. + +If the @option{-t} option is used, @code{type} prints a single word +which is one of @samp{alias}, @samp{function}, @samp{builtin}, +@samp{file} or @samp{keyword}, +if @var{name} is an alias, shell function, shell builtin, +disk file, or shell reserved word, respectively. +If the @var{name} is not found, then nothing is printed, and +@code{type} returns a failure status. + +If the @option{-p} option is used, @code{type} either returns the name +of the disk file that would be executed, or nothing if @option{-t} +would not return @samp{file}. + +The @option{-P} option forces a path search for each @var{name}, even if +@option{-t} would not return @samp{file}. + +If a command is hashed, @option{-p} and @option{-P} print the hashed value, +which is not necessarily the file that appears first in @code{$PATH}. + +If the @option{-a} option is used, @code{type} returns all of the places +that contain an executable named @var{file}. +This includes aliases and functions, if and only if the @option{-p} option +is not also used. + +If the @option{-f} option is used, @code{type} does not attempt to find +shell functions, as with the @code{command} builtin. + +The return status is zero if all of the @var{names} are found, non-zero +if any are not found. + +@item typeset +@btindex typeset +@example +typeset [-afFgrxilnrtux] [-p] [@var{name}[=@var{value}] @dots{}] +@end example + +The @code{typeset} command is supplied for compatibility with the Korn +shell. +It is a synonym for the @code{declare} builtin command. + +@item ulimit +@btindex ulimit +@example +ulimit [-abcdefilmnpqrstuvxHST] [@var{limit}] +@end example + +@code{ulimit} provides control over the resources available to processes +started by the shell, on systems that allow such control. If an +option is given, it is interpreted as follows: + +@table @code +@item -S +Change and report the soft limit associated with a resource. + +@item -H +Change and report the hard limit associated with a resource. + +@item -a +All current limits are reported. + +@item -b +The maximum socket buffer size. + +@item -c +The maximum size of core files created. + +@item -d +The maximum size of a process's data segment. + +@item -e +The maximum scheduling priority ("nice"). + +@item -f +The maximum size of files written by the shell and its children. + +@item -i +The maximum number of pending signals. + +@item -l +The maximum size that may be locked into memory. + +@item -m +The maximum resident set size (many systems do not honor this limit). + +@item -n +The maximum number of open file descriptors (most systems do not +allow this value to be set). + +@item -p +The pipe buffer size. + +@item -q +The maximum number of bytes in POSIX message queues. + +@item -r +The maximum real-time scheduling priority. + +@item -s +The maximum stack size. + +@item -t +The maximum amount of cpu time in seconds. + +@item -u +The maximum number of processes available to a single user. + +@item -v +The maximum amount of virtual memory available to the shell, and, on +some systems, to its children. + +@item -x +The maximum number of file locks. + +@item -T +The maximum number of threads. +@end table + +If @var{limit} is given, and the @option{-a} option is not used, +@var{limit} is the new value of the specified resource. +The special @var{limit} values @code{hard}, @code{soft}, and +@code{unlimited} stand for the current hard limit, the current soft limit, +and no limit, respectively. +A hard limit cannot be increased by a non-root user once it is set; +a soft limit may be increased up to the value of the hard limit. +Otherwise, the current value of the soft limit for the specified resource +is printed, unless the @option{-H} option is supplied. +When setting new limits, if neither @option{-H} nor @option{-S} is supplied, +both the hard and soft limits are set. +If no option is given, then @option{-f} is assumed. Values are in 1024-byte +increments, except for @option{-t}, which is in seconds; @option{-p}, +which is in units of 512-byte blocks; and @option{-T}, @option{-b}, +@option{-n} and @option{-u}, which are unscaled values. + +The return status is zero unless an invalid option or argument is supplied, +or an error occurs while setting a new limit. + +@item unalias +@btindex unalias +@example +unalias [-a] [@var{name} @dots{} ] +@end example + +Remove each @var{name} from the list of aliases. If @option{-a} is +supplied, all aliases are removed. +Aliases are described in @ref{Aliases}. +@end table + +@node Modifying Shell Behavior +@section Modifying Shell Behavior + +@menu +* The Set Builtin:: Change the values of shell attributes and + positional parameters. +* The Shopt Builtin:: Modify shell optional behavior. +@end menu + +@node The Set Builtin +@subsection The Set Builtin + +This builtin is so complicated that it deserves its own section. @code{set} +allows you to change the values of shell options and set the positional +parameters, or to display the names and values of shell variables. + +@table @code +@item set +@btindex set +@example +set [--abefhkmnptuvxBCEHPT] [-o @var{option-name}] [@var{argument} @dots{}] +set [+abefhkmnptuvxBCEHPT] [+o @var{option-name}] [@var{argument} @dots{}] +@end example + +If no options or arguments are supplied, @code{set} displays the names +and values of all shell variables and functions, sorted according to the +current locale, in a format that may be reused as input +for setting or resetting the currently-set variables. +Read-only variables cannot be reset. +In @sc{posix} mode, only shell variables are listed. + +When options are supplied, they set or unset shell attributes. +Options, if specified, have the following meanings: + +@table @code +@item -a +Mark variables and function which are modified or created for export +to the environment of subsequent commands. + +@item -b +Cause the status of terminated background jobs to be reported +immediately, rather than before printing the next primary prompt. + +@item -e +Exit immediately if +a pipeline (@pxref{Pipelines}), which may consist of a single simple command +(@pxref{Simple Commands}), +a list (@pxref{Lists}), +or a compound command (@pxref{Compound Commands}) +returns a non-zero status. +The shell does not exit if the command that fails is part of the +command list immediately following a @code{while} or @code{until} keyword, +part of the test in an @code{if} statement, +part of any command executed in a @code{&&} or @code{||} list except +the command following the final @code{&&} or @code{||}, +any command in a pipeline but the last, +or if the command's return status is being inverted with @code{!}. +If a compound command other than a subshell +returns a non-zero status because a command failed +while @option{-e} was being ignored, the shell does not exit. +A trap on @code{ERR}, if set, is executed before the shell exits. + +This option applies to the shell environment and each subshell environment +separately (@pxref{Command Execution Environment}), and may cause +subshells to exit before executing all the commands in the subshell. + +If a compound command or shell function executes in a context where +@option{-e} is being ignored, +none of the commands executed within the compound command or function body +will be affected by the @option{-e} setting, even if @option{-e} is set +and a command returns a failure status. +If a compound command or shell function sets @option{-e} while executing in +a context where @option{-e} is ignored, that setting will not have any +effect until the compound command or the command containing the function +call completes. + +@item -f +Disable filename expansion (globbing). + +@item -h +Locate and remember (hash) commands as they are looked up for execution. +This option is enabled by default. + +@item -k +All arguments in the form of assignment statements are placed +in the environment for a command, not just those that precede +the command name. + +@item -m +Job control is enabled (@pxref{Job Control}). +All processes run in a separate process group. +When a background job completes, the shell prints a line +containing its exit status. + +@item -n +Read commands but do not execute them; this may be used to check a +script for syntax errors. +This option is ignored by interactive shells. + +@item -o @var{option-name} + +Set the option corresponding to @var{option-name}: + +@table @code +@item allexport +Same as @code{-a}. + +@item braceexpand +Same as @code{-B}. + +@item emacs +Use an @code{emacs}-style line editing interface (@pxref{Command Line Editing}). +This also affects the editing interface used for @code{read -e}. + +@item errexit +Same as @code{-e}. + +@item errtrace +Same as @code{-E}. + +@item functrace +Same as @code{-T}. + +@item hashall +Same as @code{-h}. + +@item histexpand +Same as @code{-H}. + +@item history +Enable command history, as described in @ref{Bash History Facilities}. +This option is on by default in interactive shells. + +@item ignoreeof +An interactive shell will not exit upon reading EOF. + +@item keyword +Same as @code{-k}. + +@item monitor +Same as @code{-m}. + +@item noclobber +Same as @code{-C}. + +@item noexec +Same as @code{-n}. + +@item noglob +Same as @code{-f}. + +@item nolog +Currently ignored. + +@item notify +Same as @code{-b}. + +@item nounset +Same as @code{-u}. + +@item onecmd +Same as @code{-t}. + +@item physical +Same as @code{-P}. + +@item pipefail +If set, the return value of a pipeline is the value of the last +(rightmost) command to exit with a non-zero status, or zero if all +commands in the pipeline exit successfully. +This option is disabled by default. + +@item posix +Change the behavior of Bash where the default operation differs +from the @sc{posix} standard to match the standard +(@pxref{Bash POSIX Mode}). +This is intended to make Bash behave as a strict superset of that +standard. + +@item privileged +Same as @code{-p}. + +@item verbose +Same as @code{-v}. + +@item vi +Use a @code{vi}-style line editing interface. +This also affects the editing interface used for @code{read -e}. + +@item xtrace +Same as @code{-x}. +@end table + +@item -p +Turn on privileged mode. +In this mode, the @env{$BASH_ENV} and @env{$ENV} files are not +processed, shell functions are not inherited from the environment, +and the @env{SHELLOPTS}, @env{BASHOPTS}, @env{CDPATH} and @env{GLOBIGNORE} +variables, if they appear in the environment, are ignored. +If the shell is started with the effective user (group) id not equal to the +real user (group) id, and the @option{-p} option is not supplied, these actions +are taken and the effective user id is set to the real user id. +If the @option{-p} option is supplied at startup, the effective user id is +not reset. +Turning this option off causes the effective user +and group ids to be set to the real user and group ids. + +@item -t +Exit after reading and executing one command. + +@item -u +Treat unset variables and parameters other than the special parameters +@samp{@@} or @samp{*} as an error when performing parameter expansion. +An error message will be written to the standard error, and a non-interactive +shell will exit. + +@item -v +Print shell input lines as they are read. + +@item -x +Print a trace of simple commands, @code{for} commands, @code{case} +commands, @code{select} commands, and arithmetic @code{for} commands +and their arguments or associated word lists after they are +expanded and before they are executed. The value of the @env{PS4} +variable is expanded and the resultant value is printed before +the command and its expanded arguments. + +@item -B +The shell will perform brace expansion (@pxref{Brace Expansion}). +This option is on by default. + +@item -C +Prevent output redirection using @samp{>}, @samp{>&}, and @samp{<>} +from overwriting existing files. + +@item -E +If set, any trap on @code{ERR} is inherited by shell functions, command +substitutions, and commands executed in a subshell environment. +The @code{ERR} trap is normally not inherited in such cases. + +@item -H +Enable @samp{!} style history substitution (@pxref{History Interaction}). +This option is on by default for interactive shells. + +@item -P +If set, do not resolve symbolic links when performing commands such as +@code{cd} which change the current directory. The physical directory +is used instead. By default, Bash follows +the logical chain of directories when performing commands +which change the current directory. + +For example, if @file{/usr/sys} is a symbolic link to @file{/usr/local/sys} +then: +@example +$ cd /usr/sys; echo $PWD +/usr/sys +$ cd ..; pwd +/usr +@end example + +@noindent +If @code{set -P} is on, then: +@example +$ cd /usr/sys; echo $PWD +/usr/local/sys +$ cd ..; pwd +/usr/local +@end example + +@item -T +If set, any trap on @code{DEBUG} and @code{RETURN} are inherited by +shell functions, command substitutions, and commands executed +in a subshell environment. +The @code{DEBUG} and @code{RETURN} traps are normally not inherited +in such cases. + +@item -- +If no arguments follow this option, then the positional parameters are +unset. Otherwise, the positional parameters are set to the +@var{arguments}, even if some of them begin with a @samp{-}. + +@item - +Signal the end of options, cause all remaining @var{arguments} +to be assigned to the positional parameters. The @option{-x} +and @option{-v} options are turned off. +If there are no arguments, the positional parameters remain unchanged. +@end table + +Using @samp{+} rather than @samp{-} causes these options to be +turned off. The options can also be used upon invocation of the +shell. The current set of options may be found in @code{$-}. + +The remaining N @var{arguments} are positional parameters and are +assigned, in order, to @code{$1}, @code{$2}, @dots{} @code{$N}. +The special parameter @code{#} is set to N. + +The return status is always zero unless an invalid option is supplied. +@end table + +@node The Shopt Builtin +@subsection The Shopt Builtin + +This builtin allows you to change additional shell optional behavior. + +@table @code + +@item shopt +@btindex shopt +@example +shopt [-pqsu] [-o] [@var{optname} @dots{}] +@end example + +Toggle the values of settings controlling optional shell behavior. +The settings can be either those listed below, or, if the +@option{-o} option is used, those available with the @option{-o} +option to the @code{set} builtin command (@pxref{The Set Builtin}). +With no options, or with the @option{-p} option, a list of all settable +options is displayed, with an indication of whether or not each is set. +The @option{-p} option causes output to be displayed in a form that +may be reused as input. +Other options have the following meanings: + +@table @code +@item -s +Enable (set) each @var{optname}. + +@item -u +Disable (unset) each @var{optname}. + +@item -q +Suppresses normal output; the return status +indicates whether the @var{optname} is set or unset. +If multiple @var{optname} arguments are given with @option{-q}, +the return status is zero if all @var{optnames} are enabled; +non-zero otherwise. + +@item -o +Restricts the values of +@var{optname} to be those defined for the @option{-o} option to the +@code{set} builtin (@pxref{The Set Builtin}). +@end table + +If either @option{-s} or @option{-u} +is used with no @var{optname} arguments, @code{shopt} shows only +those options which are set or unset, respectively. + +Unless otherwise noted, the @code{shopt} options are disabled (off) +by default. + +The return status when listing options is zero if all @var{optnames} +are enabled, non-zero otherwise. When setting or unsetting options, +the return status is zero unless an @var{optname} is not a valid shell +option. + +The list of @code{shopt} options is: +@table @code + +@item autocd +If set, a command name that is the name of a directory is executed as if +it were the argument to the @code{cd} command. +This option is only used by interactive shells. + +@item cdable_vars +If this is set, an argument to the @code{cd} builtin command that +is not a directory is assumed to be the name of a variable whose +value is the directory to change to. + +@item cdspell +If set, minor errors in the spelling of a directory component in a +@code{cd} command will be corrected. +The errors checked for are transposed characters, +a missing character, and a character too many. +If a correction is found, the corrected path is printed, +and the command proceeds. +This option is only used by interactive shells. + +@item checkhash +If this is set, Bash checks that a command found in the hash +table exists before trying to execute it. If a hashed command no +longer exists, a normal path search is performed. + +@item checkjobs +If set, Bash lists the status of any stopped and running jobs before +exiting an interactive shell. If any jobs are running, this causes +the exit to be deferred until a second exit is attempted without an +intervening command (@pxref{Job Control}). +The shell always postpones exiting if any jobs are stopped. + +@item checkwinsize +If set, Bash checks the window size after each command + and, if necessary, updates the values of +@env{LINES} and @env{COLUMNS}. + +@item cmdhist +If set, Bash +attempts to save all lines of a multiple-line +command in the same history entry. This allows +easy re-editing of multi-line commands. + +@item compat31 +If set, Bash +changes its behavior to that of version 3.1 with respect to quoted +arguments to the conditional command's @samp{=~} operator +and with respect to locale-specific +string comparison when using the @code{[[} +conditional command's @samp{<} and @samp{>} operators. +Bash versions prior to bash-4.1 use ASCII collation and strcmp(3); +bash-4.1 and later use the current locale's collation sequence and strcoll(3). + +@item compat32 +If set, Bash +changes its behavior to that of version 3.2 with respect to locale-specific +string comparison when using the @code{[[} +conditional command's @samp{<} and @samp{>} operators (see previous item). + +@item compat40 +If set, Bash +changes its behavior to that of version 4.0 with respect to locale-specific +string comparison when using the @code{[[} +conditional command's @samp{<} and @samp{>} operators (see description +of @code{compat31}) +and the effect of interrupting a command list. +Bash versions 4.0 and later interrupt the list as if the shell received the +interrupt; previous versions continue with the next command in the list. + +@item compat41 +If set, Bash, when in @sc{posix} mode, treats a single quote in a double-quoted +parameter expansion as a special character. The single quotes must match +(an even number) and the characters between the single quotes are considered +quoted. This is the behavior of @sc{posix} mode through version 4.1. +The default Bash behavior remains as in previous versions. + +@item compat42 +If set, Bash +does not process the replacement string in the pattern substitution word +expansion using quote removal. + +@item complete_fullquote +If set, Bash +quotes all shell metacharacters in filenames and directory names when +performing completion. +If not set, Bash +removes metacharacters such as the dollar sign from the set of +characters that will be quoted in completed filenames +when these metacharacters appear in shell variable references in words to be +completed. +This means that dollar signs in variable names that expand to directories +will not be quoted; +however, any dollar signs appearing in filenames will not be quoted, either. +This is active only when bash is using backslashes to quote completed +filenames. +This variable is set by default, which is the default Bash behavior in +versions through 4.2. + +@item direxpand +If set, Bash +replaces directory names with the results of word expansion when performing +filename completion. This changes the contents of the readline editing +buffer. +If not set, Bash attempts to preserve what the user typed. + +@item dirspell +If set, Bash +attempts spelling correction on directory names during word completion +if the directory name initially supplied does not exist. + +@item dotglob +If set, Bash includes filenames beginning with a `.' in +the results of filename expansion. + +@item execfail +If this is set, a non-interactive shell will not exit if +it cannot execute the file specified as an argument to the @code{exec} +builtin command. An interactive shell does not exit if @code{exec} +fails. + +@item expand_aliases +If set, aliases are expanded as described below under Aliases, +@ref{Aliases}. +This option is enabled by default for interactive shells. + +@item extdebug +If set, behavior intended for use by debuggers is enabled: + +@enumerate +@item +The @option{-F} option to the @code{declare} builtin (@pxref{Bash Builtins}) +displays the source file name and line number corresponding to each function +name supplied as an argument. + +@item +If the command run by the @code{DEBUG} trap returns a non-zero value, the +next command is skipped and not executed. + +@item +If the command run by the @code{DEBUG} trap returns a value of 2, and the +shell is executing in a subroutine (a shell function or a shell script +executed by the @code{.} or @code{source} builtins), a call to +@code{return} is simulated. + +@item +@code{BASH_ARGC} and @code{BASH_ARGV} are updated as described in their +descriptions (@pxref{Bash Variables}). + +@item +Function tracing is enabled: command substitution, shell functions, and +subshells invoked with @code{( @var{command} )} inherit the +@code{DEBUG} and @code{RETURN} traps. + +@item +Error tracing is enabled: command substitution, shell functions, and +subshells invoked with @code{( @var{command} )} inherit the +@code{ERR} trap. +@end enumerate + +@item extglob +If set, the extended pattern matching features described above +(@pxref{Pattern Matching}) are enabled. + +@item extquote +If set, @code{$'@var{string}'} and @code{$"@var{string}"} quoting is +performed within @code{$@{@var{parameter}@}} expansions +enclosed in double quotes. This option is enabled by default. + +@item failglob +If set, patterns which fail to match filenames during filename expansion +result in an expansion error. + +@item force_fignore +If set, the suffixes specified by the @env{FIGNORE} shell variable +cause words to be ignored when performing word completion even if +the ignored words are the only possible completions. +@xref{Bash Variables}, for a description of @env{FIGNORE}. +This option is enabled by default. + +@item globasciiranges +If set, range expressions used in pattern matching bracket expressions +(@pxref{Pattern Matching}) +behave as if in the traditional C locale when performing +comparisons. That is, the current locale's collating sequence +is not taken into account, so +@samp{b} will not collate between @samp{A} and @samp{B}, +and upper-case and lower-case ASCII characters will collate together. + +@item globstar +If set, the pattern @samp{**} used in a filename expansion context will +match all files and zero or more directories and subdirectories. +If the pattern is followed by a @samp{/}, only directories and +subdirectories match. + +@item gnu_errfmt +If set, shell error messages are written in the standard @sc{gnu} error +message format. + +@item histappend +If set, the history list is appended to the file named by the value +of the @env{HISTFILE} +variable when the shell exits, rather than overwriting the file. + +@item histreedit +If set, and Readline +is being used, a user is given the opportunity to re-edit a +failed history substitution. + +@item histverify +If set, and Readline +is being used, the results of history substitution are not immediately +passed to the shell parser. Instead, the resulting line is loaded into +the Readline editing buffer, allowing further modification. + +@item hostcomplete +If set, and Readline is being used, Bash will attempt to perform +hostname completion when a word containing a @samp{@@} is being +completed (@pxref{Commands For Completion}). This option is enabled +by default. + +@item huponexit +If set, Bash will send @code{SIGHUP} to all jobs when an interactive +login shell exits (@pxref{Signals}). + +@item interactive_comments +Allow a word beginning with @samp{#} +to cause that word and all remaining characters on that +line to be ignored in an interactive shell. +This option is enabled by default. + +@item lastpipe +If set, and job control is not active, the shell runs the last command of +a pipeline not executed in the background in the current shell environment. + +@item lithist +If enabled, and the @code{cmdhist} +option is enabled, multi-line commands are saved to the history with +embedded newlines rather than using semicolon separators where possible. + +@item login_shell +The shell sets this option if it is started as a login shell +(@pxref{Invoking Bash}). +The value may not be changed. + +@item mailwarn +If set, and a file that Bash is checking for mail has been +accessed since the last time it was checked, the message +@code{"The mail in @var{mailfile} has been read"} is displayed. + +@item no_empty_cmd_completion +If set, and Readline is being used, Bash will not attempt to search +the @env{PATH} for possible completions when completion is attempted +on an empty line. + +@item nocaseglob +If set, Bash matches filenames in a case-insensitive fashion when +performing filename expansion. + +@item nocasematch +If set, Bash matches patterns in a case-insensitive fashion when +performing matching while executing @code{case} or @code{[[} +conditional commands. + +@item nullglob +If set, Bash allows filename patterns which match no +files to expand to a null string, rather than themselves. + +@item progcomp +If set, the programmable completion facilities +(@pxref{Programmable Completion}) are enabled. +This option is enabled by default. + +@item promptvars +If set, prompt strings undergo +parameter expansion, command substitution, arithmetic +expansion, and quote removal after being expanded +as described below (@pxref{Controlling the Prompt}). +This option is enabled by default. + +@item restricted_shell +The shell sets this option if it is started in restricted mode +(@pxref{The Restricted Shell}). +The value may not be changed. +This is not reset when the startup files are executed, allowing +the startup files to discover whether or not a shell is restricted. + +@item shift_verbose +If this is set, the @code{shift} +builtin prints an error message when the shift count exceeds the +number of positional parameters. + +@item sourcepath +If set, the @code{source} builtin uses the value of @env{PATH} +to find the directory containing the file supplied as an argument. +This option is enabled by default. + +@item xpg_echo +If set, the @code{echo} builtin expands backslash-escape sequences +by default. + +@end table + +@noindent +The return status when listing options is zero if all @var{optnames} +are enabled, non-zero otherwise. +When setting or unsetting options, the return status is zero unless an +@var{optname} is not a valid shell option. +@end table + +@node Special Builtins +@section Special Builtins +@cindex special builtin + +For historical reasons, the @sc{posix} standard has classified +several builtin commands as @emph{special}. +When Bash is executing in @sc{posix} mode, the special builtins +differ from other builtin commands in three respects: + +@enumerate +@item +Special builtins are found before shell functions during command lookup. + +@item +If a special builtin returns an error status, a non-interactive shell exits. + +@item +Assignment statements preceding the command stay in effect in the shell +environment after the command completes. +@end enumerate + +When Bash is not executing in @sc{posix} mode, these builtins behave no +differently than the rest of the Bash builtin commands. +The Bash @sc{posix} mode is described in @ref{Bash POSIX Mode}. + +These are the @sc{posix} special builtins: +@example +@w{break : . continue eval exec exit export readonly return set} +@w{shift trap unset} +@end example + +@node Shell Variables +@chapter Shell Variables + +@menu +* Bourne Shell Variables:: Variables which Bash uses in the same way + as the Bourne Shell. +* Bash Variables:: List of variables that exist in Bash. +@end menu + +This chapter describes the shell variables that Bash uses. +Bash automatically assigns default values to a number of variables. + +@node Bourne Shell Variables +@section Bourne Shell Variables + +Bash uses certain shell variables in the same way as the Bourne shell. +In some cases, Bash assigns a default value to the variable. + +@vtable @code + +@item CDPATH +A colon-separated list of directories used as a search path for +the @code{cd} builtin command. + +@item HOME +The current user's home directory; the default for the @code{cd} builtin +command. +The value of this variable is also used by tilde expansion +(@pxref{Tilde Expansion}). + +@item IFS +A list of characters that separate fields; used when the shell splits +words as part of expansion. + +@item MAIL +If this parameter is set to a filename or directory name +and the @env{MAILPATH} variable +is not set, Bash informs the user of the arrival of mail in +the specified file or Maildir-format directory. + +@item MAILPATH +A colon-separated list of filenames which the shell periodically checks +for new mail. +Each list entry can specify the message that is printed when new mail +arrives in the mail file by separating the filename from the message with +a @samp{?}. +When used in the text of the message, @code{$_} expands to the name of +the current mail file. + +@item OPTARG +The value of the last option argument processed by the @code{getopts} builtin. + +@item OPTIND +The index of the last option argument processed by the @code{getopts} builtin. + +@item PATH +A colon-separated list of directories in which the shell looks for +commands. +A zero-length (null) directory name in the value of @code{PATH} indicates the +current directory. +A null directory name may appear as two adjacent colons, or as an initial +or trailing colon. + + +@item PS1 +The primary prompt string. The default value is @samp{\s-\v\$ }. +@xref{Controlling the Prompt}, for the complete list of escape +sequences that are expanded before @env{PS1} is displayed. + +@item PS2 +The secondary prompt string. The default value is @samp{> }. + +@end vtable + +@node Bash Variables +@section Bash Variables + +These variables are set or used by Bash, but other shells +do not normally treat them specially. + +A few variables used by Bash are described in different chapters: +variables for controlling the job control facilities +(@pxref{Job Control Variables}). + +@vtable @code + +@item BASH +The full pathname used to execute the current instance of Bash. + +@item BASHOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the @option{-s} option to the +@code{shopt} builtin command (@pxref{The Shopt Builtin}). +The options appearing in @env{BASHOPTS} are those reported +as @samp{on} by @samp{shopt}. +If this variable is in the environment when Bash +starts up, each shell option in the list will be enabled before +reading any startup files. This variable is readonly. + +@item BASHPID +Expands to the process ID of the current Bash process. +This differs from @code{$$} under certain circumstances, such as subshells +that do not require Bash to be re-initialized. + +@item BASH_ALIASES +An associative array variable whose members correspond to the internal +list of aliases as maintained by the @code{alias} builtin. +(@pxref{Bourne Shell Builtins}). +Elements added to this array appear in the alias list; unsetting array +elements cause aliases to be removed from the alias list. + +@item BASH_ARGC +An array variable whose values are the number of parameters in each +frame of the current bash execution call stack. The number of +parameters to the current subroutine (shell function or script executed +with @code{.} or @code{source}) is at the top of the stack. When a +subroutine is executed, the number of parameters passed is pushed onto +@code{BASH_ARGC}. +The shell sets @code{BASH_ARGC} only when in extended debugging mode +(see @ref{The Shopt Builtin} +for a description of the @code{extdebug} option to the @code{shopt} +builtin). + +@item BASH_ARGV +An array variable containing all of the parameters in the current bash +execution call stack. The final parameter of the last subroutine call +is at the top of the stack; the first parameter of the initial call is +at the bottom. When a subroutine is executed, the parameters supplied +are pushed onto @code{BASH_ARGV}. +The shell sets @code{BASH_ARGV} only when in extended debugging mode +(see @ref{The Shopt Builtin} +for a description of the @code{extdebug} option to the @code{shopt} +builtin). + +@item BASH_CMDS +An associative array variable whose members correspond to the internal +hash table of commands as maintained by the @code{hash} builtin +(@pxref{Bourne Shell Builtins}). +Elements added to this array appear in the hash table; unsetting array +elements cause commands to be removed from the hash table. + +@item BASH_COMMAND +The command currently being executed or about to be executed, unless the +shell is executing a command as the result of a trap, +in which case it is the command executing at the time of the trap. + +@item BASH_COMPAT +The value is used to set the shell's compatibility level. +@xref{The Shopt Builtin}, for a description of the various compatibility +levels and their effects. +The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42) +corresponding to the desired compatibility level. +If @code{BASH_COMPAT} is unset or set to the empty string, the compatibility +level is set to the default for the current version. +If @code{BASH_COMPAT} is set to a value that is not one of the valid +compatibility levels, the shell prints an error message and sets the +compatibility level to the default for the current version. +The valid compatibility levels correspond to the compatibility options +accepted by the @code{shopt} builtin described above (for example, +@var{compat42} means that 4.2 and 42 are valid values). +The current version is also a valid value. + +@item BASH_ENV +If this variable is set when Bash is invoked to execute a shell +script, its value is expanded and used as the name of a startup file +to read before executing the script. @xref{Bash Startup Files}. + +@item BASH_EXECUTION_STRING +The command argument to the @option{-c} invocation option. + +@item BASH_LINENO +An array variable whose members are the line numbers in source files +where each corresponding member of @var{FUNCNAME} was invoked. +@code{$@{BASH_LINENO[$i]@}} is the line number in the source file +(@code{$@{BASH_SOURCE[$i+1]@}}) where +@code{$@{FUNCNAME[$i]@}} was called (or @code{$@{BASH_LINENO[$i-1]@}} if +referenced within another shell function). +Use @code{LINENO} to obtain the current line number. + +@item BASH_REMATCH +An array variable whose members are assigned by the @samp{=~} binary +operator to the @code{[[} conditional command +(@pxref{Conditional Constructs}). +The element with index 0 is the portion of the string +matching the entire regular expression. +The element with index @var{n} is the portion of the +string matching the @var{n}th parenthesized subexpression. +This variable is read-only. + +@item BASH_SOURCE +An array variable whose members are the source filenames where the +corresponding shell function names in the @code{FUNCNAME} array +variable are defined. +The shell function @code{$@{FUNCNAME[$i]@}} is defined in the file +@code{$@{BASH_SOURCE[$i]@}} and called from @code{$@{BASH_SOURCE[$i+1]@}} + +@item BASH_SUBSHELL +Incremented by one within each subshell or subshell environment when +the shell begins executing in that environment. +The initial value is 0. + +@item BASH_VERSINFO +A readonly array variable (@pxref{Arrays}) +whose members hold version information for this instance of Bash. +The values assigned to the array members are as follows: + +@table @code + +@item BASH_VERSINFO[0] +The major version number (the @var{release}). + +@item BASH_VERSINFO[1] +The minor version number (the @var{version}). + +@item BASH_VERSINFO[2] +The patch level. + +@item BASH_VERSINFO[3] +The build version. + +@item BASH_VERSINFO[4] +The release status (e.g., @var{beta1}). + +@item BASH_VERSINFO[5] +The value of @env{MACHTYPE}. +@end table + +@item BASH_VERSION +The version number of the current instance of Bash. + +@item BASH_XTRACEFD +If set to an integer corresponding to a valid file descriptor, Bash +will write the trace output generated when @samp{set -x} +is enabled to that file descriptor. +This allows tracing output to be separated from diagnostic and error +messages. +The file descriptor is closed when @code{BASH_XTRACEFD} is unset or assigned +a new value. +Unsetting @code{BASH_XTRACEFD} or assigning it the empty string causes the +trace output to be sent to the standard error. +Note that setting @code{BASH_XTRACEFD} to 2 (the standard error file +descriptor) and then unsetting it will result in the standard error +being closed. + +@item CHILD_MAX +Set the number of exited child status values for the shell to remember. +Bash will not allow this value to be decreased below a @sc{posix}-mandated +minimum, and there is a maximum value (currently 8192) that this may +not exceed. +The minimum value is system-dependent. + +@item COLUMNS +Used by the @code{select} command to determine the terminal width +when printing selection lists. +Automatically set if the @code{checkwinsize} option is enabled +(@pxref{The Shopt Builtin}), or in an interactive shell upon receipt of a +@code{SIGWINCH}. + +@item COMP_CWORD +An index into @env{$@{COMP_WORDS@}} of the word containing the current +cursor position. +This variable is available only in shell functions invoked by the +programmable completion facilities (@pxref{Programmable Completion}). + +@item COMP_LINE +The current command line. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (@pxref{Programmable Completion}). + +@item COMP_POINT +The index of the current cursor position relative to the beginning of +the current command. +If the current cursor position is at the end of the current command, +the value of this variable is equal to @code{$@{#COMP_LINE@}}. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (@pxref{Programmable Completion}). + +@item COMP_TYPE +Set to an integer value corresponding to the type of completion attempted +that caused a completion function to be called: +@var{TAB}, for normal completion, +@samp{?}, for listing completions after successive tabs, +@samp{!}, for listing alternatives on partial word completion, +@samp{@@}, to list completions if the word is not unmodified, +or +@samp{%}, for menu completion. +This variable is available only in shell functions and external +commands invoked by the +programmable completion facilities (@pxref{Programmable Completion}). + +@item COMP_KEY +The key (or final key of a key sequence) used to invoke the current +completion function. + +@item COMP_WORDBREAKS +The set of characters that the Readline library treats as word +separators when performing word completion. +If @code{COMP_WORDBREAKS} is unset, it loses its special properties, +even if it is subsequently reset. + +@item COMP_WORDS +An array variable consisting of the individual +words in the current command line. +The line is split into words as Readline would split it, using +@code{COMP_WORDBREAKS} as described above. +This variable is available only in shell functions invoked by the +programmable completion facilities (@pxref{Programmable Completion}). + +@item COMPREPLY +An array variable from which Bash reads the possible completions +generated by a shell function invoked by the programmable completion +facility (@pxref{Programmable Completion}). +Each array element contains one possible completion. + +@item COPROC +An array variable created to hold the file descriptors +for output from and input to an unnamed coprocess (@pxref{Coprocesses}). + +@item DIRSTACK +An array variable containing the current contents of the directory stack. +Directories appear in the stack in the order they are displayed by the +@code{dirs} builtin. +Assigning to members of this array variable may be used to modify +directories already in the stack, but the @code{pushd} and @code{popd} +builtins must be used to add and remove directories. +Assignment to this variable will not change the current directory. +If @env{DIRSTACK} is unset, it loses its special properties, even if +it is subsequently reset. + +@item EMACS +If Bash finds this variable in the environment when the shell +starts with value @samp{t}, it assumes that the shell is running in an +Emacs shell buffer and disables line editing. + +@item ENV +Similar to @code{BASH_ENV}; used when the shell is invoked in +@sc{posix} Mode (@pxref{Bash POSIX Mode}). + +@item EUID +The numeric effective user id of the current user. This variable +is readonly. + +@item FCEDIT +The editor used as a default by the @option{-e} option to the @code{fc} +builtin command. + +@item FIGNORE +A colon-separated list of suffixes to ignore when performing +filename completion. +A filename whose suffix matches one of the entries in +@env{FIGNORE} +is excluded from the list of matched filenames. A sample +value is @samp{.o:~} + +@item FUNCNAME +An array variable containing the names of all shell functions +currently in the execution call stack. +The element with index 0 is the name of any currently-executing +shell function. +The bottom-most element (the one with the highest index) +is @code{"main"}. +This variable exists only when a shell function is executing. +Assignments to @env{FUNCNAME} have no effect and return an error status. +If @env{FUNCNAME} is unset, it loses its special properties, even if +it is subsequently reset. + +This variable can be used with @code{BASH_LINENO} and @code{BASH_SOURCE}. +Each element of @code{FUNCNAME} has corresponding elements in +@code{BASH_LINENO} and @code{BASH_SOURCE} to describe the call stack. +For instance, @code{$@{FUNCNAME[$i]@}} was called from the file +@code{$@{BASH_SOURCE[$i+1]@}} at line number @code{$@{BASH_LINENO[$i]@}}. +The @code{caller} builtin displays the current call stack using this +information. + +@item FUNCNEST +If set to a numeric value greater than 0, defines a maximum function +nesting level. Function invocations that exceed this nesting level +will cause the current command to abort. + +@item GLOBIGNORE +A colon-separated list of patterns defining the set of filenames to +be ignored by filename expansion. +If a filename matched by a filename expansion pattern also matches one +of the patterns in @env{GLOBIGNORE}, it is removed from the list +of matches. + +@item GROUPS +An array variable containing the list of groups of which the current +user is a member. +Assignments to @env{GROUPS} have no effect and return an error status. +If @env{GROUPS} is unset, it loses its special properties, even if it is +subsequently reset. + +@item histchars +Up to three characters which control history expansion, quick +substitution, and tokenization (@pxref{History Interaction}). +The first character is the +@var{history expansion} character, that is, the character which signifies the +start of a history expansion, normally @samp{!}. The second character is the +character which signifies `quick substitution' when seen as the first +character on a line, normally @samp{^}. The optional third character is the +character which indicates that the remainder of the line is a comment when +found as the first character of a word, usually @samp{#}. The history +comment character causes history substitution to be skipped for the +remaining words on the line. It does not necessarily cause the shell +parser to treat the rest of the line as a comment. + +@item HISTCMD +The history number, or index in the history list, of the current +command. If @env{HISTCMD} is unset, it loses its special properties, +even if it is subsequently reset. + +@item HISTCONTROL +A colon-separated list of values controlling how commands are saved on +the history list. +If the list of values includes @samp{ignorespace}, lines which begin +with a space character are not saved in the history list. +A value of @samp{ignoredups} causes lines which match the previous +history entry to not be saved. +A value of @samp{ignoreboth} is shorthand for +@samp{ignorespace} and @samp{ignoredups}. +A value of @samp{erasedups} causes all previous lines matching the +current line to be removed from the history list before that line +is saved. +Any value not in the above list is ignored. +If @env{HISTCONTROL} is unset, or does not include a valid value, +all lines read by the shell parser are saved on the history list, +subject to the value of @env{HISTIGNORE}. +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +@env{HISTCONTROL}. + +@item HISTFILE +The name of the file to which the command history is saved. The +default value is @file{~/.bash_history}. + +@item HISTFILESIZE +The maximum number of lines contained in the history file. +When this variable is assigned a value, the history file is truncated, +if necessary, to contain no more than that number of lines +by removing the oldest entries. +The history file is also truncated to this size after +writing it when a shell exits. +If the value is 0, the history file is truncated to zero size. +Non-numeric values and numeric values less than zero inhibit truncation. +The shell sets the default value to the value of @env{HISTSIZE} +after reading any startup files. + +@item HISTIGNORE +A colon-separated list of patterns used to decide which command +lines should be saved on the history list. Each pattern is +anchored at the beginning of the line and must match the complete +line (no implicit @samp{*} is appended). Each pattern is tested +against the line after the checks specified by @env{HISTCONTROL} +are applied. In addition to the normal shell pattern matching +characters, @samp{&} matches the previous history line. @samp{&} +may be escaped using a backslash; the backslash is removed +before attempting a match. +The second and subsequent lines of a multi-line compound command are +not tested, and are added to the history regardless of the value of +@env{HISTIGNORE}. + +@env{HISTIGNORE} subsumes the function of @env{HISTCONTROL}. A +pattern of @samp{&} is identical to @code{ignoredups}, and a +pattern of @samp{[ ]*} is identical to @code{ignorespace}. +Combining these two patterns, separating them with a colon, +provides the functionality of @code{ignoreboth}. + +@item HISTSIZE +The maximum number of commands to remember on the history list. +If the value is 0, commands are not saved in the history list. +Numeric values less than zero result in every command being saved +on the history list (there is no limit). +The shell sets the default value to 500 after reading any startup files. + +@item HISTTIMEFORMAT +If this variable is set and not null, its value is used as a format string +for @var{strftime} to print the time stamp associated with each history +entry displayed by the @code{history} builtin. +If this variable is set, time stamps are written to the history file so +they may be preserved across shell sessions. +This uses the history comment character to distinguish timestamps from +other history lines. + +@item HOSTFILE +Contains the name of a file in the same format as @file{/etc/hosts} that +should be read when the shell needs to complete a hostname. +The list of possible hostname completions may be changed while the shell +is running; +the next time hostname completion is attempted after the +value is changed, Bash adds the contents of the new file to the +existing list. +If @env{HOSTFILE} is set, but has no value, or does not name a readable file, +Bash attempts to read +@file{/etc/hosts} to obtain the list of possible hostname completions. +When @env{HOSTFILE} is unset, the hostname list is cleared. + +@item HOSTNAME +The name of the current host. + +@item HOSTTYPE +A string describing the machine Bash is running on. + +@item IGNOREEOF +Controls the action of the shell on receipt of an @code{EOF} character +as the sole input. If set, the value denotes the number +of consecutive @code{EOF} characters that can be read as the +first character on an input line +before the shell will exit. If the variable exists but does not +have a numeric value (or has no value) then the default is 10. +If the variable does not exist, then @code{EOF} signifies the end of +input to the shell. This is only in effect for interactive shells. + +@item INPUTRC +The name of the Readline initialization file, overriding the default +of @file{~/.inputrc}. + +@item LANG +Used to determine the locale category for any category not specifically +selected with a variable starting with @code{LC_}. + +@item LC_ALL +This variable overrides the value of @env{LANG} and any other +@code{LC_} variable specifying a locale category. + +@item LC_COLLATE +This variable determines the collation order used when sorting the +results of filename expansion, and +determines the behavior of range expressions, equivalence classes, +and collating sequences within filename expansion and pattern matching +(@pxref{Filename Expansion}). + +@item LC_CTYPE +This variable determines the interpretation of characters and the +behavior of character classes within filename expansion and pattern +matching (@pxref{Filename Expansion}). + +@item LC_MESSAGES +This variable determines the locale used to translate double-quoted +strings preceded by a @samp{$} (@pxref{Locale Translation}). + +@item LC_NUMERIC +This variable determines the locale category used for number formatting. + +@item LINENO +The line number in the script or shell function currently executing. + +@item LINES +Used by the @code{select} command to determine the column length +for printing selection lists. +Automatically set if the @code{checkwinsize} option is enabled +(@pxref{The Shopt Builtin}), or in an interactive shell upon receipt of a +@code{SIGWINCH}. + +@item MACHTYPE +A string that fully describes the system type on which Bash +is executing, in the standard @sc{gnu} @var{cpu-company-system} format. + +@item MAILCHECK +How often (in seconds) that the shell should check for mail in the +files specified in the @env{MAILPATH} or @env{MAIL} variables. +The default is 60 seconds. When it is time to check +for mail, the shell does so before displaying the primary prompt. +If this variable is unset, or set to a value that is not a number +greater than or equal to zero, the shell disables mail checking. + +@item MAPFILE +An array variable created to hold the text read by the +@code{mapfile} builtin when no variable name is supplied. + +@item OLDPWD +The previous working directory as set by the @code{cd} builtin. + +@item OPTERR +If set to the value 1, Bash displays error messages +generated by the @code{getopts} builtin command. + +@item OSTYPE +A string describing the operating system Bash is running on. + +@item PIPESTATUS +An array variable (@pxref{Arrays}) +containing a list of exit status values from the processes +in the most-recently-executed foreground pipeline (which may +contain only a single command). + +@item POSIXLY_CORRECT +If this variable is in the environment when Bash starts, the shell +enters @sc{posix} mode (@pxref{Bash POSIX Mode}) before reading the +startup files, as if the @option{--posix} invocation option had been supplied. +If it is set while the shell is running, Bash enables @sc{posix} mode, +as if the command +@example +@code{set -o posix} +@end example +@noindent +had been executed. + +@item PPID +The process @sc{id} of the shell's parent process. This variable +is readonly. + +@item PROMPT_COMMAND +If set, the value is interpreted as a command to execute +before the printing of each primary prompt (@env{$PS1}). + +@item PROMPT_DIRTRIM +If set to a number greater than zero, the value is used as the number of +trailing directory components to retain when expanding the @code{\w} and +@code{\W} prompt string escapes (@pxref{Controlling the Prompt}). +Characters removed are replaced with an ellipsis. + +@item PS3 +The value of this variable is used as the prompt for the +@code{select} command. If this variable is not set, the +@code{select} command prompts with @samp{#? } + +@item PS4 +The value is the prompt printed before the command line is echoed +when the @option{-x} option is set (@pxref{The Set Builtin}). +The first character of @env{PS4} is replicated multiple times, as +necessary, to indicate multiple levels of indirection. +The default is @samp{+ }. + +@item PWD +The current working directory as set by the @code{cd} builtin. + +@item RANDOM +Each time this parameter is referenced, a random integer +between 0 and 32767 is generated. Assigning a value to this +variable seeds the random number generator. + +@item READLINE_LINE +The contents of the Readline line buffer, for use +with @samp{bind -x} (@pxref{Bash Builtins}). + +@item READLINE_POINT +The position of the insertion point in the Readline line buffer, for use +with @samp{bind -x} (@pxref{Bash Builtins}). + +@item REPLY +The default variable for the @code{read} builtin. + +@item SECONDS +This variable expands to the number of seconds since the +shell was started. Assignment to this variable resets +the count to the value assigned, and the expanded value +becomes the value assigned plus the number of seconds +since the assignment. + +@item SHELL +The full pathname to the shell is kept in this environment variable. +If it is not set when the shell starts, +Bash assigns to it the full pathname of the current user's login shell. + +@item SHELLOPTS +A colon-separated list of enabled shell options. Each word in +the list is a valid argument for the @option{-o} option to the +@code{set} builtin command (@pxref{The Set Builtin}). +The options appearing in @env{SHELLOPTS} are those reported +as @samp{on} by @samp{set -o}. +If this variable is in the environment when Bash +starts up, each shell option in the list will be enabled before +reading any startup files. This variable is readonly. + +@item SHLVL +Incremented by one each time a new instance of Bash is started. This is +intended to be a count of how deeply your Bash shells are nested. + +@item TIMEFORMAT +The value of this parameter is used as a format string specifying +how the timing information for pipelines prefixed with the @code{time} +reserved word should be displayed. +The @samp{%} character introduces an +escape sequence that is expanded to a time value or other +information. +The escape sequences and their meanings are as +follows; the braces denote optional portions. + +@table @code + +@item %% +A literal @samp{%}. + +@item %[@var{p}][l]R +The elapsed time in seconds. + +@item %[@var{p}][l]U +The number of CPU seconds spent in user mode. + +@item %[@var{p}][l]S +The number of CPU seconds spent in system mode. + +@item %P +The CPU percentage, computed as (%U + %S) / %R. +@end table + +The optional @var{p} is a digit specifying the precision, the number of +fractional digits after a decimal point. +A value of 0 causes no decimal point or fraction to be output. +At most three places after the decimal point may be specified; values +of @var{p} greater than 3 are changed to 3. +If @var{p} is not specified, the value 3 is used. + +The optional @code{l} specifies a longer format, including minutes, of +the form @var{MM}m@var{SS}.@var{FF}s. +The value of @var{p} determines whether or not the fraction is included. + +If this variable is not set, Bash acts as if it had the value +@example +@code{$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'} +@end example +If the value is null, no timing information is displayed. +A trailing newline is added when the format string is displayed. + +@item TMOUT +If set to a value greater than zero, @code{TMOUT} is treated as the +default timeout for the @code{read} builtin (@pxref{Bash Builtins}). +The @code{select} command (@pxref{Conditional Constructs}) terminates +if input does not arrive after @code{TMOUT} seconds when input is coming +from a terminal. + +In an interactive shell, the value is interpreted as +the number of seconds to wait for a line of input after issuing +the primary prompt. +Bash +terminates after waiting for that number of seconds if a complete +line of input does not arrive. + +@item TMPDIR +If set, Bash uses its value as the name of a directory in which +Bash creates temporary files for the shell's use. + +@item UID +The numeric real user id of the current user. This variable is readonly. + +@end vtable + +@node Bash Features +@chapter Bash Features + +This chapter describes features unique to Bash. + +@menu +* Invoking Bash:: Command line options that you can give + to Bash. +* Bash Startup Files:: When and how Bash executes scripts. +* Interactive Shells:: What an interactive shell is. +* Bash Conditional Expressions:: Primitives used in composing expressions for + the @code{test} builtin. +* Shell Arithmetic:: Arithmetic on shell variables. +* Aliases:: Substituting one command for another. +* Arrays:: Array Variables. +* The Directory Stack:: History of visited directories. +* Controlling the Prompt:: Customizing the various prompt strings. +* The Restricted Shell:: A more controlled mode of shell execution. +* Bash POSIX Mode:: Making Bash behave more closely to what + the POSIX standard specifies. +@end menu + +@node Invoking Bash +@section Invoking Bash + +@example +bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o @var{option}] [-O @var{shopt_option}] [@var{argument} @dots{}] +bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o @var{option}] [-O @var{shopt_option}] -c @var{string} [@var{argument} @dots{}] +bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o @var{option}] [-O @var{shopt_option}] [@var{argument} @dots{}] +@end example + +All of the single-character options used with the @code{set} builtin +(@pxref{The Set Builtin}) can be used as options when the shell is invoked. +In addition, there are several multi-character +options that you can use. These options must appear on the command +line before the single-character options to be recognized. + +@table @code +@item --debugger +Arrange for the debugger profile to be executed before the shell +starts. Turns on extended debugging mode (see @ref{The Shopt Builtin} +for a description of the @code{extdebug} option to the @code{shopt} +builtin). + +@item --dump-po-strings +A list of all double-quoted strings preceded by @samp{$} +is printed on the standard output +in the @sc{gnu} @code{gettext} PO (portable object) file format. +Equivalent to @option{-D} except for the output format. + +@item --dump-strings +Equivalent to @option{-D}. + +@item --help +Display a usage message on standard output and exit successfully. + +@item --init-file @var{filename} +@itemx --rcfile @var{filename} +Execute commands from @var{filename} (instead of @file{~/.bashrc}) +in an interactive shell. + +@item --login +Equivalent to @option{-l}. + +@item --noediting +Do not use the @sc{gnu} Readline library (@pxref{Command Line Editing}) +to read command lines when the shell is interactive. + +@item --noprofile +Don't load the system-wide startup file @file{/etc/profile} +or any of the personal initialization files +@file{~/.bash_profile}, @file{~/.bash_login}, or @file{~/.profile} +when Bash is invoked as a login shell. + +@item --norc +Don't read the @file{~/.bashrc} initialization file in an +interactive shell. This is on by default if the shell is +invoked as @code{sh}. + +@item --posix +Change the behavior of Bash where the default operation differs +from the @sc{posix} standard to match the standard. This +is intended to make Bash behave as a strict superset of that +standard. @xref{Bash POSIX Mode}, for a description of the Bash +@sc{posix} mode. + +@item --restricted +Make the shell a restricted shell (@pxref{The Restricted Shell}). + +@item --verbose +Equivalent to @option{-v}. Print shell input lines as they're read. + +@item --version +Show version information for this instance of +Bash on the standard output and exit successfully. +@end table + +There are several single-character options that may be supplied at +invocation which are not available with the @code{set} builtin. + +@table @code +@item -c +Read and execute commands from the first non-option @var{argument} +after processing the options, then exit. +Any remaining arguments are assigned to the +positional parameters, starting with @code{$0}. + +@item -i +Force the shell to run interactively. Interactive shells are +described in @ref{Interactive Shells}. + +@item -l +Make this shell act as if it had been directly invoked by login. +When the shell is interactive, this is equivalent to starting a +login shell with @samp{exec -l bash}. +When the shell is not interactive, the login shell startup files will +be executed. +@samp{exec bash -l} or @samp{exec bash --login} +will replace the current shell with a Bash login shell. +@xref{Bash Startup Files}, for a description of the special behavior +of a login shell. + +@item -r +Make the shell a restricted shell (@pxref{The Restricted Shell}). + +@item -s +If this option is present, or if no arguments remain after option +processing, then commands are read from the standard input. +This option allows the positional parameters to be set +when invoking an interactive shell. + +@item -D +A list of all double-quoted strings preceded by @samp{$} +is printed on the standard output. +These are the strings that +are subject to language translation when the current locale +is not @code{C} or @code{POSIX} (@pxref{Locale Translation}). +This implies the @option{-n} option; no commands will be executed. + +@item [-+]O [@var{shopt_option}] +@var{shopt_option} is one of the shell options accepted by the +@code{shopt} builtin (@pxref{The Shopt Builtin}). +If @var{shopt_option} is present, @option{-O} sets the value of that option; +@option{+O} unsets it. +If @var{shopt_option} is not supplied, the names and values of the shell +options accepted by @code{shopt} are printed on the standard output. +If the invocation option is @option{+O}, the output is displayed in a format +that may be reused as input. + +@item -- +A @code{--} signals the end of options and disables further option +processing. +Any arguments after the @code{--} are treated as filenames and arguments. +@end table + +@cindex login shell +A @emph{login} shell is one whose first character of argument zero is +@samp{-}, or one invoked with the @option{--login} option. + +@cindex interactive shell +An @emph{interactive} shell is one started without non-option arguments, +unless @option{-s} is specified, +without specifying the @option{-c} option, and whose input and output are both +connected to terminals (as determined by @code{isatty(3)}), or one +started with the @option{-i} option. @xref{Interactive Shells}, for more +information. + +If arguments remain after option processing, and neither the +@option{-c} nor the @option{-s} +option has been supplied, the first argument is assumed to +be the name of a file containing shell commands (@pxref{Shell Scripts}). +When Bash is invoked in this fashion, @code{$0} +is set to the name of the file, and the positional parameters +are set to the remaining arguments. +Bash reads and executes commands from this file, then exits. +Bash's exit status is the exit status of the last command executed +in the script. If no commands are executed, the exit status is 0. + +@node Bash Startup Files +@section Bash Startup Files +@cindex startup files + +This section describes how Bash executes its startup files. +If any of the files exist but cannot be read, Bash reports an error. +Tildes are expanded in filenames as described above under +Tilde Expansion (@pxref{Tilde Expansion}). + +Interactive shells are described in @ref{Interactive Shells}. + +@subsubheading Invoked as an interactive login shell, or with @option{--login} + +When Bash is invoked as an interactive login shell, or as a +non-interactive shell with the @option{--login} option, it first reads and +executes commands from the file @file{/etc/profile}, if that file exists. +After reading that file, it looks for @file{~/.bash_profile}, +@file{~/.bash_login}, and @file{~/.profile}, in that order, and reads +and executes commands from the first one that exists and is readable. +The @option{--noprofile} option may be used when the shell is started to +inhibit this behavior. + +When a login shell exits, Bash reads and executes commands from +the file @file{~/.bash_logout}, if it exists. + +@subsubheading Invoked as an interactive non-login shell + +When an interactive shell that is not a login shell is started, Bash +reads and executes commands from @file{~/.bashrc}, if that file exists. +This may be inhibited by using the @option{--norc} option. +The @option{--rcfile @var{file}} option will force Bash to read and +execute commands from @var{file} instead of @file{~/.bashrc}. + +So, typically, your @file{~/.bash_profile} contains the line +@example +@code{if [ -f ~/.bashrc ]; then . ~/.bashrc; fi} +@end example +@noindent +after (or before) any login-specific initializations. + +@subsubheading Invoked non-interactively + +When Bash is started non-interactively, to run a shell script, +for example, it looks for the variable @env{BASH_ENV} in the environment, +expands its value if it appears there, and uses the expanded value as +the name of a file to read and execute. Bash behaves as if the +following command were executed: +@example +@code{if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi} +@end example +@noindent +but the value of the @env{PATH} variable is not used to search for the +filename. + +As noted above, if a non-interactive shell is invoked with the +@option{--login} option, Bash attempts to read and execute commands from the +login shell startup files. + +@subsubheading Invoked with name @code{sh} + +If Bash is invoked with the name @code{sh}, it tries to mimic the +startup behavior of historical versions of @code{sh} as closely as +possible, while conforming to the @sc{posix} standard as well. + +When invoked as an interactive login shell, or as a non-interactive +shell with the @option{--login} option, it first attempts to read +and execute commands from @file{/etc/profile} and @file{~/.profile}, in +that order. +The @option{--noprofile} option may be used to inhibit this behavior. +When invoked as an interactive shell with the name @code{sh}, Bash +looks for the variable @env{ENV}, expands its value if it is defined, +and uses the expanded value as the name of a file to read and execute. +Since a shell invoked as @code{sh} does not attempt to read and execute +commands from any other startup files, the @option{--rcfile} option has +no effect. +A non-interactive shell invoked with the name @code{sh} does not attempt +to read any other startup files. + +When invoked as @code{sh}, Bash enters @sc{posix} mode after +the startup files are read. + +@subsubheading Invoked in @sc{posix} mode + +When Bash is started in @sc{posix} mode, as with the +@option{--posix} command line option, it follows the @sc{posix} standard +for startup files. +In this mode, interactive shells expand the @env{ENV} variable +and commands are read and executed from the file whose name is the +expanded value. +No other startup files are read. + +@subsubheading Invoked by remote shell daemon + +Bash attempts to determine when it is being run with its standard input +connected to a network connection, as when executed by the remote shell +daemon, usually @code{rshd}, or the secure shell daemon @code{sshd}. +If Bash determines it is being run in +this fashion, it reads and executes commands from @file{~/.bashrc}, if that +file exists and is readable. +It will not do this if invoked as @code{sh}. +The @option{--norc} option may be used to inhibit this behavior, and the +@option{--rcfile} option may be used to force another file to be read, but +neither @code{rshd} nor @code{sshd} generally invoke the shell with those +options or allow them to be specified. + +@subsubheading Invoked with unequal effective and real @sc{uid/gid}s + +If Bash is started with the effective user (group) id not equal to the +real user (group) id, and the @option{-p} option is not supplied, no startup +files are read, shell functions are not inherited from the environment, +the @env{SHELLOPTS}, @env{BASHOPTS}, @env{CDPATH}, and @env{GLOBIGNORE} +variables, if they appear in the environment, are ignored, and the effective +user id is set to the real user id. +If the @option{-p} option is supplied at invocation, the startup behavior is +the same, but the effective user id is not reset. + +@node Interactive Shells +@section Interactive Shells +@cindex interactive shell +@cindex shell, interactive + +@menu +* What is an Interactive Shell?:: What determines whether a shell is Interactive. +* Is this Shell Interactive?:: How to tell if a shell is interactive. +* Interactive Shell Behavior:: What changes in a interactive shell? +@end menu + +@node What is an Interactive Shell? +@subsection What is an Interactive Shell? + +An interactive shell +is one started without non-option arguments, unless @option{-s} is +specified, without specifying the @option{-c} option, and +whose input and error output are both +connected to terminals (as determined by @code{isatty(3)}), +or one started with the @option{-i} option. + +An interactive shell generally reads from and writes to a user's +terminal. + +The @option{-s} invocation option may be used to set the positional parameters +when an interactive shell is started. + +@node Is this Shell Interactive? +@subsection Is this Shell Interactive? + +To determine within a startup script whether or not Bash is +running interactively, +test the value of the @samp{-} special parameter. +It contains @code{i} when the shell is interactive. For example: + +@example +case "$-" in +*i*) echo This shell is interactive ;; +*) echo This shell is not interactive ;; +esac +@end example + +Alternatively, startup scripts may examine the variable +@env{PS1}; it is unset in non-interactive shells, and set in +interactive shells. Thus: + +@example +if [ -z "$PS1" ]; then + echo This shell is not interactive +else + echo This shell is interactive +fi +@end example + +@node Interactive Shell Behavior +@subsection Interactive Shell Behavior + +When the shell is running interactively, it changes its behavior in +several ways. + +@enumerate +@item +Startup files are read and executed as described in @ref{Bash Startup Files}. + +@item +Job Control (@pxref{Job Control}) is enabled by default. When job +control is in effect, Bash ignores the keyboard-generated job control +signals @code{SIGTTIN}, @code{SIGTTOU}, and @code{SIGTSTP}. + +@item +Bash expands and displays @env{PS1} before reading the first line +of a command, and expands and displays @env{PS2} before reading the +second and subsequent lines of a multi-line command. + +@item +Bash executes the value of the @env{PROMPT_COMMAND} variable as a command +before printing the primary prompt, @env{$PS1} +(@pxref{Bash Variables}). + +@item +Readline (@pxref{Command Line Editing}) is used to read commands from +the user's terminal. + +@item +Bash inspects the value of the @code{ignoreeof} option to @code{set -o} +instead of exiting immediately when it receives an @code{EOF} on its +standard input when reading a command (@pxref{The Set Builtin}). + +@item +Command history (@pxref{Bash History Facilities}) +and history expansion (@pxref{History Interaction}) +are enabled by default. +Bash will save the command history to the file named by @env{$HISTFILE} +when a shell with history enabled exits. + +@item +Alias expansion (@pxref{Aliases}) is performed by default. + +@item +In the absence of any traps, Bash ignores @code{SIGTERM} +(@pxref{Signals}). + +@item +In the absence of any traps, @code{SIGINT} is caught and handled +((@pxref{Signals}). +@code{SIGINT} will interrupt some shell builtins. + +@item +An interactive login shell sends a @code{SIGHUP} to all jobs on exit +if the @code{huponexit} shell option has been enabled (@pxref{Signals}). + +@item +The @option{-n} invocation option is ignored, and @samp{set -n} has +no effect (@pxref{The Set Builtin}). + +@item +Bash will check for mail periodically, depending on the values of the +@env{MAIL}, @env{MAILPATH}, and @env{MAILCHECK} shell variables +(@pxref{Bash Variables}). + +@item +Expansion errors due to references to unbound shell variables after +@samp{set -u} has been enabled will not cause the shell to exit +(@pxref{The Set Builtin}). + +@item +The shell will not exit on expansion errors caused by @var{var} being unset +or null in @code{$@{@var{var}:?@var{word}@}} expansions +(@pxref{Shell Parameter Expansion}). + +@item +Redirection errors encountered by shell builtins will not cause the +shell to exit. + +@item +When running in @sc{posix} mode, a special builtin returning an error +status will not cause the shell to exit (@pxref{Bash POSIX Mode}). + +@item +A failed @code{exec} will not cause the shell to exit +(@pxref{Bourne Shell Builtins}). + +@item +Parser syntax errors will not cause the shell to exit. + +@item +Simple spelling correction for directory arguments to the @code{cd} +builtin is enabled by default (see the description of the @code{cdspell} +option to the @code{shopt} builtin in @ref{The Shopt Builtin}). + +@item +The shell will check the value of the @env{TMOUT} variable and exit +if a command is not read within the specified number of seconds after +printing @env{$PS1} (@pxref{Bash Variables}). + +@end enumerate + +@node Bash Conditional Expressions +@section Bash Conditional Expressions +@cindex expressions, conditional + +Conditional expressions are used by the @code{[[} compound command +and the @code{test} and @code{[} builtin commands. + +Expressions may be unary or binary. +Unary expressions are often used to examine the status of a file. +There are string operators and numeric comparison operators as well. +If the @var{file} argument to one of the primaries is of the form +@file{/dev/fd/@var{N}}, then file descriptor @var{N} is checked. +If the @var{file} argument to one of the primaries is one of +@file{/dev/stdin}, @file{/dev/stdout}, or @file{/dev/stderr}, file +descriptor 0, 1, or 2, respectively, is checked. + +When used with @code{[[}, the @samp{<} and @samp{>} operators sort +lexicographically using the current locale. +The @code{test} command uses ASCII ordering. + +Unless otherwise specified, primaries that operate on files follow symbolic +links and operate on the target of the link, rather than the link itself. + +See the description of the @code{test} builtin command (section +@pxref{Bash Builtins} below) for the handling of parameters +(i.e. missing parameters). + +@table @code +@item -a @var{file} +True if @var{file} exists. + +@item -b @var{file} +True if @var{file} exists and is a block special file. + +@item -c @var{file} +True if @var{file} exists and is a character special file. + +@item -d @var{file} +True if @var{file} exists and is a directory. + +@item -e @var{file} +True if @var{file} exists. + +@item -f @var{file} +True if @var{file} exists and is a regular file. + +@item -g @var{file} +True if @var{file} exists and its set-group-id bit is set. + +@item -h @var{file} +True if @var{file} exists and is a symbolic link. + +@item -k @var{file} +True if @var{file} exists and its "sticky" bit is set. + +@item -p @var{file} +True if @var{file} exists and is a named pipe (FIFO). + +@item -r @var{file} +True if @var{file} exists and is readable. + +@item -s @var{file} +True if @var{file} exists and has a size greater than zero. + +@item -t @var{fd} +True if file descriptor @var{fd} is open and refers to a terminal. + +@item -u @var{file} +True if @var{file} exists and its set-user-id bit is set. + +@item -w @var{file} +True if @var{file} exists and is writable. + +@item -x @var{file} +True if @var{file} exists and is executable. + +@item -G @var{file} +True if @var{file} exists and is owned by the effective group id. + +@item -L @var{file} +True if @var{file} exists and is a symbolic link. + +@item -N @var{file} +True if @var{file} exists and has been modified since it was last read. + +@item -O @var{file} +True if @var{file} exists and is owned by the effective user id. + +@item -S @var{file} +True if @var{file} exists and is a socket. + +@item @var{file1} -ef @var{file2} +True if @var{file1} and @var{file2} refer to the same device and +inode numbers. + +@item @var{file1} -nt @var{file2} +True if @var{file1} is newer (according to modification date) +than @var{file2}, or if @var{file1} exists and @var{file2} does not. + +@item @var{file1} -ot @var{file2} +True if @var{file1} is older than @var{file2}, +or if @var{file2} exists and @var{file1} does not. + +@item -o @var{optname} +True if the shell option @var{optname} is enabled. +The list of options appears in the description of the @option{-o} +option to the @code{set} builtin (@pxref{The Set Builtin}). + +@item -v @var{varname} +True if the shell variable @var{varname} is set (has been assigned a value). + +@item -R @var{varname} +True if the shell variable @var{varname} is set and is a name reference. + +@item -z @var{string} +True if the length of @var{string} is zero. + +@item -n @var{string} +@itemx @var{string} +True if the length of @var{string} is non-zero. + +@item @var{string1} == @var{string2} +@itemx @var{string1} = @var{string2} +True if the strings are equal. +When used with the @code{[[} command, this performs pattern matching as +described above (@pxref{Conditional Constructs}). + +@samp{=} should be used with the @code{test} command for @sc{posix} conformance. + +@item @var{string1} != @var{string2} +True if the strings are not equal. + +@item @var{string1} < @var{string2} +True if @var{string1} sorts before @var{string2} lexicographically. + +@item @var{string1} > @var{string2} +True if @var{string1} sorts after @var{string2} lexicographically. + +@item @var{arg1} OP @var{arg2} +@code{OP} is one of +@samp{-eq}, @samp{-ne}, @samp{-lt}, @samp{-le}, @samp{-gt}, or @samp{-ge}. +These arithmetic binary operators return true if @var{arg1} +is equal to, not equal to, less than, less than or equal to, +greater than, or greater than or equal to @var{arg2}, +respectively. @var{Arg1} and @var{arg2} +may be positive or negative integers. +@end table + +@node Shell Arithmetic +@section Shell Arithmetic +@cindex arithmetic, shell +@cindex shell arithmetic +@cindex expressions, arithmetic +@cindex evaluation, arithmetic +@cindex arithmetic evaluation + +The shell allows arithmetic expressions to be evaluated, as one of +the shell expansions or by the @code{let} and the @option{-i} option +to the @code{declare} builtins. + +Evaluation is done in fixed-width integers with no check for overflow, +though division by 0 is trapped and flagged as an error. +The operators and their precedence, associativity, and values +are the same as in the C language. +The following list of operators is grouped into levels of +equal-precedence operators. +The levels are listed in order of decreasing precedence. + +@table @code + +@item @var{id}++ @var{id}-- +variable post-increment and post-decrement + +@item ++@var{id} --@var{id} +variable pre-increment and pre-decrement + +@item - + +unary minus and plus + +@item ! ~ +logical and bitwise negation + +@item ** +exponentiation + +@item * / % +multiplication, division, remainder + +@item + - +addition, subtraction + +@item << >> +left and right bitwise shifts + +@item <= >= < > +comparison + +@item == != +equality and inequality + +@item & +bitwise AND + +@item ^ +bitwise exclusive OR + +@item | +bitwise OR + +@item && +logical AND + +@item || +logical OR + +@item expr ? expr : expr +conditional operator + +@item = *= /= %= += -= <<= >>= &= ^= |= +assignment + +@item expr1 , expr2 +comma +@end table + +Shell variables are allowed as operands; parameter expansion is +performed before the expression is evaluated. +Within an expression, shell variables may also be referenced by name +without using the parameter expansion syntax. +A shell variable that is null or unset evaluates to 0 when referenced +by name without using the parameter expansion syntax. +The value of a variable is evaluated as an arithmetic expression +when it is referenced, or when a variable which has been given the +@var{integer} attribute using @samp{declare -i} is assigned a value. +A null value evaluates to 0. +A shell variable need not have its @var{integer} attribute turned on +to be used in an expression. + +Constants with a leading 0 are interpreted as octal numbers. +A leading @samp{0x} or @samp{0X} denotes hexadecimal. Otherwise, +numbers take the form [@var{base}@code{#}]@var{n}, where the optional @var{base} +is a decimal number between 2 and 64 representing the arithmetic +base, and @var{n} is a number in that base. +If @var{base}@code{#} is omitted, then base 10 is used. +When specifying @var{n}, +he digits greater than 9 are represented by the lowercase letters, +the uppercase letters, @samp{@@}, and @samp{_}, in that order. +If @var{base} is less than or equal to 36, lowercase and uppercase +letters may be used interchangeably to represent numbers between 10 +and 35. + +Operators are evaluated in order of precedence. Sub-expressions in +parentheses are evaluated first and may override the precedence +rules above. + +@node Aliases +@section Aliases +@cindex alias expansion + +@var{Aliases} allow a string to be substituted for a word when it is used +as the first word of a simple command. +The shell maintains a list of aliases that may be set and unset with +the @code{alias} and @code{unalias} builtin commands. + +The first word of each simple command, if unquoted, is checked to see +if it has an alias. +If so, that word is replaced by the text of the alias. +The characters @samp{/}, @samp{$}, @samp{`}, @samp{=} and any of the +shell metacharacters or quoting characters listed above may not appear +in an alias name. +The replacement text may contain any valid +shell input, including shell metacharacters. +The first word of the replacement text is tested for +aliases, but a word that is identical to an alias being expanded +is not expanded a second time. +This means that one may alias @code{ls} to @code{"ls -F"}, +for instance, and Bash does not try to recursively expand the +replacement text. +If the last character of the alias value is a +@var{blank}, then the next command word following the +alias is also checked for alias expansion. + +Aliases are created and listed with the @code{alias} +command, and removed with the @code{unalias} command. + +There is no mechanism for using arguments in the replacement text, +as in @code{csh}. +If arguments are needed, a shell function should be used +(@pxref{Shell Functions}). + +Aliases are not expanded when the shell is not interactive, +unless the @code{expand_aliases} shell option is set using +@code{shopt} (@pxref{The Shopt Builtin}). + +The rules concerning the definition and use of aliases are +somewhat confusing. Bash +always reads at least one complete line +of input before executing any +of the commands on that line. Aliases are expanded when a +command is read, not when it is executed. Therefore, an +alias definition appearing on the same line as another +command does not take effect until the next line of input is read. +The commands following the alias definition +on that line are not affected by the new alias. +This behavior is also an issue when functions are executed. +Aliases are expanded when a function definition is read, +not when the function is executed, because a function definition +is itself a compound command. As a consequence, aliases +defined in a function are not available until after that +function is executed. To be safe, always put +alias definitions on a separate line, and do not use @code{alias} +in compound commands. + +For almost every purpose, shell functions are preferred over aliases. + +@node Arrays +@section Arrays +@cindex arrays + +Bash provides one-dimensional indexed and associative array variables. +Any variable may be used as an indexed array; +the @code{declare} builtin will explicitly declare an array. +There is no maximum +limit on the size of an array, nor any requirement that members +be indexed or assigned contiguously. +Indexed arrays are referenced using integers (including arithmetic +expressions (@pxref{Shell Arithmetic})) and are zero-based; +associative arrays use arbitrary strings. +Unless otherwise noted, indexed array indices must be non-negative integers. + +An indexed array is created automatically if any variable is assigned to +using the syntax +@example +@var{name}[@var{subscript}]=@var{value} +@end example + +@noindent +The @var{subscript} +is treated as an arithmetic expression that must evaluate to a number. +To explicitly declare an array, use +@example +declare -a @var{name} +@end example +@noindent +The syntax +@example +declare -a @var{name}[@var{subscript}] +@end example +@noindent +is also accepted; the @var{subscript} is ignored. + +@noindent +Associative arrays are created using +@example +declare -A @var{name}. +@end example + +Attributes may be +specified for an array variable using the @code{declare} and +@code{readonly} builtins. Each attribute applies to all members of +an array. + +Arrays are assigned to using compound assignments of the form +@example +@var{name}=(@var{value1} @var{value2} @dots{} ) +@end example +@noindent +where each +@var{value} is of the form @code{[@var{subscript}]=}@var{string}. +Indexed array assignments do not require anything but @var{string}. +When assigning to indexed arrays, if +the optional subscript is supplied, that index is assigned to; +otherwise the index of the element assigned is the last index assigned +to by the statement plus one. Indexing starts at zero. + +When assigning to an associative array, the subscript is required. + +This syntax is also accepted by the @code{declare} +builtin. Individual array elements may be assigned to using the +@code{@var{name}[@var{subscript}]=@var{value}} syntax introduced above. + +When assigning to an indexed array, if @var{name} +is subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +@var{name}, so negative indices count back from the end of the +array, and an index of -1 references the last element. + +Any element of an array may be referenced using +@code{$@{@var{name}[@var{subscript}]@}}. +The braces are required to avoid +conflicts with the shell's filename expansion operators. If the +@var{subscript} is @samp{@@} or @samp{*}, the word expands to all members +of the array @var{name}. These subscripts differ only when the word +appears within double quotes. +If the word is double-quoted, +@code{$@{@var{name}[*]@}} expands to a single word with +the value of each array member separated by the first character of the +@env{IFS} variable, and @code{$@{@var{name}[@@]@}} expands each element of +@var{name} to a separate word. When there are no array members, +@code{$@{@var{name}[@@]@}} expands to nothing. +If the double-quoted expansion occurs within a word, the expansion of +the first parameter is joined with the beginning part of the original +word, and the expansion of the last parameter is joined with the last +part of the original word. +This is analogous to the +expansion of the special parameters @samp{@@} and @samp{*}. +@code{$@{#@var{name}[@var{subscript}]@}} expands to the length of +@code{$@{@var{name}[@var{subscript}]@}}. +If @var{subscript} is @samp{@@} or +@samp{*}, the expansion is the number of elements in the array. +Referencing an array variable without a subscript is equivalent to +referencing with a subscript of 0. +If the @var{subscript} +used to reference an element of an indexed array +evaluates to a number less than zero, it is +interpreted as relative to one greater than the maximum index of the array, +so negative indices count back from the end of the array, +and an index of -1 refers to the last element. + +An array variable is considered set if a subscript has been assigned a +value. The null string is a valid value. + +It is possible to obtain the keys (indices) of an array as well as the values. +$@{!@var{name}[@@]@} and $@{!@var{name}[*]@} expand to the indices +assigned in array variable @var{name}. +The treatment when in double quotes is similar to the expansion of the +special parameters @samp{@@} and @samp{*} within double quotes. + +The @code{unset} builtin is used to destroy arrays. +@code{unset @var{name}[@var{subscript}]} +destroys the array element at index @var{subscript}. +Negative subscripts to indexed arrays are interpreted as described above. +Care must be taken to avoid unwanted side effects caused by filename +expansion. +@code{unset @var{name}}, where @var{name} is an array, removes the +entire array. A subscript of @samp{*} or @samp{@@} also removes the +entire array. + +The @code{declare}, @code{local}, and @code{readonly} +builtins each accept a @option{-a} option to specify an indexed +array and a @option{-A} option to specify an associative array. +If both options are supplied, @option{-A} takes precedence. +The @code{read} builtin accepts a @option{-a} +option to assign a list of words read from the standard input +to an array, and can read values from the standard input into +individual array elements. The @code{set} and @code{declare} +builtins display array values in a way that allows them to be +reused as input. + +@node The Directory Stack +@section The Directory Stack +@cindex directory stack + +@menu +* Directory Stack Builtins:: Bash builtin commands to manipulate + the directory stack. +@end menu + +The directory stack is a list of recently-visited directories. The +@code{pushd} builtin adds directories to the stack as it changes +the current directory, and the @code{popd} builtin removes specified +directories from the stack and changes the current directory to +the directory removed. The @code{dirs} builtin displays the contents +of the directory stack. + +The contents of the directory stack are also visible +as the value of the @env{DIRSTACK} shell variable. + +@node Directory Stack Builtins +@subsection Directory Stack Builtins + +@table @code + +@item dirs +@btindex dirs +@example +dirs [-clpv] [+@var{N} | -@var{N}] +@end example + +Display the list of currently remembered directories. Directories +are added to the list with the @code{pushd} command; the +@code{popd} command removes directories from the list. + +@table @code +@item -c +Clears the directory stack by deleting all of the elements. +@item -l +Produces a listing using full pathnames; +the default listing format uses a tilde to denote the home directory. +@item -p +Causes @code{dirs} to print the directory stack with one entry per +line. +@item -v +Causes @code{dirs} to print the directory stack with one entry per +line, prefixing each entry with its index in the stack. +@item +@var{N} +Displays the @var{N}th directory (counting from the left of the +list printed by @code{dirs} when invoked without options), starting +with zero. +@item -@var{N} +Displays the @var{N}th directory (counting from the right of the +list printed by @code{dirs} when invoked without options), starting +with zero. +@end table + +@item popd +@btindex popd +@example +popd [-n] [+@var{N} | -@var{N}] +@end example + +Remove the top entry from the directory stack, and @code{cd} +to the new top directory. +When no arguments are given, @code{popd} +removes the top directory from the stack and +performs a @code{cd} to the new top directory. The +elements are numbered from 0 starting at the first directory listed with +@code{dirs}; that is, @code{popd} is equivalent to @code{popd +0}. + +@table @code +@item -n +Suppresses the normal change of directory when removing directories +from the stack, so that only the stack is manipulated. +@item +@var{N} +Removes the @var{N}th directory (counting from the left of the +list printed by @code{dirs}), starting with zero. +@item -@var{N} +Removes the @var{N}th directory (counting from the right of the +list printed by @code{dirs}), starting with zero. +@end table + +@btindex pushd +@item pushd +@example +pushd [-n] [@var{+N} | @var{-N} | @var{dir}] +@end example + +Save the current directory on the top of the directory stack +and then @code{cd} to @var{dir}. +With no arguments, @code{pushd} exchanges the top two directories. + +@table @code +@item -n +Suppresses the normal change of directory when adding directories +to the stack, so that only the stack is manipulated. +@item +@var{N} +Brings the @var{N}th directory (counting from the left of the +list printed by @code{dirs}, starting with zero) to the top of +the list by rotating the stack. +@item -@var{N} +Brings the @var{N}th directory (counting from the right of the +list printed by @code{dirs}, starting with zero) to the top of +the list by rotating the stack. +@item @var{dir} +Makes the current working directory be the top of the stack, making +it the new current directory as if it had been supplied as an argument +to the @code{cd} builtin. +@end table +@end table + +@node Controlling the Prompt +@section Controlling the Prompt +@cindex prompting + +The value of the variable @env{PROMPT_COMMAND} is examined just before +Bash prints each primary prompt. If @env{PROMPT_COMMAND} is set and +has a non-null value, then the +value is executed just as if it had been typed on the command line. + +In addition, the following table describes the special characters which +can appear in the prompt variables @env{PS1} to @env{PS4}: + +@table @code +@item \a +A bell character. +@item \d +The date, in "Weekday Month Date" format (e.g., "Tue May 26"). +@item \D@{@var{format}@} +The @var{format} is passed to @code{strftime}(3) and the result is inserted +into the prompt string; an empty @var{format} results in a locale-specific +time representation. The braces are required. +@item \e +An escape character. +@item \h +The hostname, up to the first `.'. +@item \H +The hostname. +@item \j +The number of jobs currently managed by the shell. +@item \l +The basename of the shell's terminal device name. +@item \n +A newline. +@item \r +A carriage return. +@item \s +The name of the shell, the basename of @code{$0} (the portion +following the final slash). +@item \t +The time, in 24-hour HH:MM:SS format. +@item \T +The time, in 12-hour HH:MM:SS format. +@item \@@ +The time, in 12-hour am/pm format. +@item \A +The time, in 24-hour HH:MM format. +@item \u +The username of the current user. +@item \v +The version of Bash (e.g., 2.00) +@item \V +The release of Bash, version + patchlevel (e.g., 2.00.0) +@item \w +The current working directory, with @env{$HOME} abbreviated with a tilde +(uses the @env{$PROMPT_DIRTRIM} variable). +@item \W +The basename of @env{$PWD}, with @env{$HOME} abbreviated with a tilde. +@item \! +The history number of this command. +@item \# +The command number of this command. +@item \$ +If the effective uid is 0, @code{#}, otherwise @code{$}. +@item \@var{nnn} +The character whose ASCII code is the octal value @var{nnn}. +@item \\ +A backslash. +@item \[ +Begin a sequence of non-printing characters. This could be used to +embed a terminal control sequence into the prompt. +@item \] +End a sequence of non-printing characters. +@end table + +The command number and the history number are usually different: +the history number of a command is its position in the history +list, which may include commands restored from the history file +(@pxref{Bash History Facilities}), while the command number is +the position in the sequence of commands executed during the current +shell session. + +After the string is decoded, it is expanded via +parameter expansion, command substitution, arithmetic +expansion, and quote removal, subject to the value of the +@code{promptvars} shell option (@pxref{Bash Builtins}). + +@node The Restricted Shell +@section The Restricted Shell +@cindex restricted shell + +If Bash is started with the name @code{rbash}, or the +@option{--restricted} +or +@option{-r} +option is supplied at invocation, the shell becomes restricted. +A restricted shell is used to +set up an environment more controlled than the standard shell. +A restricted shell behaves identically to @code{bash} +with the exception that the following are disallowed or not performed: + +@itemize @bullet +@item +Changing directories with the @code{cd} builtin. +@item +Setting or unsetting the values of the @env{SHELL}, @env{PATH}, +@env{ENV}, or @env{BASH_ENV} variables. +@item +Specifying command names containing slashes. +@item +Specifying a filename containing a slash as an argument to the @code{.} +builtin command. +@item +Specifying a filename containing a slash as an argument to the @option{-p} +option to the @code{hash} builtin command. +@item +Importing function definitions from the shell environment at startup. +@item +Parsing the value of @env{SHELLOPTS} from the shell environment at startup. +@item +Redirecting output using the @samp{>}, @samp{>|}, @samp{<>}, @samp{>&}, +@samp{&>}, and @samp{>>} redirection operators. +@item +Using the @code{exec} builtin to replace the shell with another command. +@item +Adding or deleting builtin commands with the +@option{-f} and @option{-d} options to the @code{enable} builtin. +@item +Using the @code{enable} builtin command to enable disabled shell builtins. +@item +Specifying the @option{-p} option to the @code{command} builtin. +@item +Turning off restricted mode with @samp{set +r} or @samp{set +o restricted}. +@end itemize + +These restrictions are enforced after any startup files are read. + +When a command that is found to be a shell script is executed +(@pxref{Shell Scripts}), @code{rbash} turns off any restrictions in +the shell spawned to execute the script. + +@node Bash POSIX Mode +@section Bash POSIX Mode +@cindex POSIX Mode + +Starting Bash with the @option{--posix} command-line option or executing +@samp{set -o posix} while Bash is running will cause Bash to conform more +closely to the @sc{posix} standard by changing the behavior to +match that specified by @sc{posix} in areas where the Bash default differs. + +When invoked as @code{sh}, Bash enters @sc{posix} mode after reading the +startup files. + +The following list is what's changed when `@sc{posix} mode' is in effect: + +@enumerate +@item +When a command in the hash table no longer exists, Bash will re-search +@env{$PATH} to find the new location. This is also available with +@samp{shopt -s checkhash}. + +@item +The message printed by the job control code and builtins when a job +exits with a non-zero status is `Done(status)'. + +@item +The message printed by the job control code and builtins when a job +is stopped is `Stopped(@var{signame})', where @var{signame} is, for +example, @code{SIGTSTP}. + +@item +The @code{bg} builtin uses the required format to describe each job placed +in the background, which does not include an indication of whether the job +is the current or previous job. + +@item +Reserved words appearing in a context where reserved words are recognized +do not undergo alias expansion. + +@item +The @sc{posix} @env{PS1} and @env{PS2} expansions of @samp{!} to +the history number and @samp{!!} to @samp{!} are enabled, +and parameter expansion is performed on the values of @env{PS1} and +@env{PS2} regardless of the setting of the @code{promptvars} option. + +@item +The @sc{posix} startup files are executed (@env{$ENV}) rather than +the normal Bash files. + +@item +Tilde expansion is only performed on assignments preceding a command +name, rather than on all assignment statements on the line. + +@item +The @code{command} builtin does not prevent builtins that take assignment +statements as arguments from expanding them as assignment statements; +when not in @sc{posix} mode, assignment builtins lose their assignment +statement expansion properties when preceded by @code{command}. + +@item +The default history file is @file{~/.sh_history} (this is the +default value of @env{$HISTFILE}). + +@item +The output of @samp{kill -l} prints all the signal names on a single line, +separated by spaces, without the @samp{SIG} prefix. + +@item +The @code{kill} builtin does not accept signal names with a @samp{SIG} +prefix. + +@item +Non-interactive shells exit if @var{filename} in @code{.} @var{filename} +is not found. + +@item +Non-interactive shells exit if a syntax error in an arithmetic expansion +results in an invalid expression. + +@item +Non-interactive shells exit if there is a syntax error in a script read +with the @code{.} or @code{source} builtins, or in a string processed by +the @code{eval} builtin. + +@item +Redirection operators do not perform filename expansion on the word +in the redirection unless the shell is interactive. + +@item +Redirection operators do not perform word splitting on the word in the +redirection. + +@item +Function names must be valid shell @code{name}s. That is, they may not +contain characters other than letters, digits, and underscores, and +may not start with a digit. Declaring a function with an invalid name +causes a fatal syntax error in non-interactive shells. + +@item +Function names may not be the same as one of the @sc{posix} special +builtins. + +@item +@sc{posix} special builtins are found before shell functions +during command lookup. + +@item +The @code{time} reserved word may be used by itself as a command. When +used in this way, it displays timing statistics for the shell and its +completed children. The @env{TIMEFORMAT} variable controls the format +of the timing information. + +@item +When parsing and expanding a $@{@dots{}@} expansion that appears within +double quotes, single quotes are no longer special and cannot be used to +quote a closing brace or other special character, unless the operator is +one of those defined to perform pattern removal. In this case, they do +not have to appear as matched pairs. + +@item +The parser does not recognize @code{time} as a reserved word if the next +token begins with a @samp{-}. + +@item +If a @sc{posix} special builtin returns an error status, a +non-interactive shell exits. The fatal errors are those listed in +the @sc{posix} standard, and include things like passing incorrect options, +redirection errors, variable assignment errors for assignments preceding +the command name, and so on. + +@item +A non-interactive shell exits with an error status if a variable +assignment error occurs when no command name follows the assignment +statements. +A variable assignment error occurs, for example, when trying to assign +a value to a readonly variable. + +@item +A non-interactive shell exits with an error status if a variable +assignment error occurs in an assignment statement preceding a special +builtin, but not with any other simple command. + +@item +A non-interactive shell exits with an error status if the iteration +variable in a @code{for} statement or the selection variable in a +@code{select} statement is a readonly variable. + +@item +Process substitution is not available. + +@item +While variable indirection is available, it may not be applied to the +@samp{#} and @samp{?} special parameters. + +@item +Assignment statements preceding @sc{posix} special builtins +persist in the shell environment after the builtin completes. + +@item +Assignment statements preceding shell function calls persist in the +shell environment after the function returns, as if a @sc{posix} +special builtin command had been executed. + +@item +The @code{export} and @code{readonly} builtin commands display their +output in the format required by @sc{posix}. + +@item +The @code{trap} builtin displays signal names without the leading +@code{SIG}. + +@item +The @code{trap} builtin doesn't check the first argument for a possible +signal specification and revert the signal handling to the original +disposition if it is, unless that argument consists solely of digits and +is a valid signal number. If users want to reset the handler for a given +signal to the original disposition, they should use @samp{-} as the +first argument. + +@item +The @code{.} and @code{source} builtins do not search the current directory +for the filename argument if it is not found by searching @env{PATH}. + +@item +Subshells spawned to execute command substitutions inherit the value of +the @option{-e} option from the parent shell. When not in @sc{posix} mode, +Bash clears the @option{-e} option in such subshells. + +@item +Alias expansion is always enabled, even in non-interactive shells. + +@item +When the @code{alias} builtin displays alias definitions, it does not +display them with a leading @samp{alias } unless the @option{-p} option +is supplied. + +@item +When the @code{set} builtin is invoked without options, it does not display +shell function names and definitions. + +@item +When the @code{set} builtin is invoked without options, it displays +variable values without quotes, unless they contain shell metacharacters, +even if the result contains nonprinting characters. + +@item +When the @code{cd} builtin is invoked in @var{logical} mode, and the pathname +constructed from @code{$PWD} and the directory name supplied as an argument +does not refer to an existing directory, @code{cd} will fail instead of +falling back to @var{physical} mode. + +@item +The @code{pwd} builtin verifies that the value it prints is the same as the +current directory, even if it is not asked to check the file system with the +@option{-P} option. + +@item +When listing the history, the @code{fc} builtin does not include an +indication of whether or not a history entry has been modified. + +@item +The default editor used by @code{fc} is @code{ed}. + +@item +The @code{type} and @code{command} builtins will not report a non-executable +file as having been found, though the shell will attempt to execute such a +file if it is the only so-named file found in @code{$PATH}. + +@item +The @code{vi} editing mode will invoke the @code{vi} editor directly when +the @samp{v} command is run, instead of checking @code{$VISUAL} and +@code{$EDITOR}. + +@item +When the @code{xpg_echo} option is enabled, Bash does not attempt to interpret +any arguments to @code{echo} as options. Each argument is displayed, after +escape characters are converted. + +@item +The @code{ulimit} builtin uses a block size of 512 bytes for the @option{-c} +and @option{-f} options. + +@item +The arrival of @code{SIGCHLD} when a trap is set on @code{SIGCHLD} does +not interrupt the @code{wait} builtin and cause it to return immediately. +The trap command is run once for each child that exits. + +@item +The @code{read} builtin may be interrupted by a signal for which a trap +has been set. +If Bash receives a trapped signal while executing @code{read}, the trap +handler executes and @code{read} returns an exit status greater than 128. + +@end enumerate + +There is other @sc{posix} behavior that Bash does not implement by +default even when in @sc{posix} mode. +Specifically: + +@enumerate + +@item +The @code{fc} builtin checks @code{$EDITOR} as a program to edit history +entries if @code{FCEDIT} is unset, rather than defaulting directly to +@code{ed}. @code{fc} uses @code{ed} if @code{EDITOR} is unset. + +@item +As noted above, Bash requires the @code{xpg_echo} option to be enabled for +the @code{echo} builtin to be fully conformant. + +@end enumerate + +Bash can be configured to be @sc{posix}-conformant by default, by specifying +the @option{--enable-strict-posix-default} to @code{configure} when building +(@pxref{Optional Features}). + +@node Job Control +@chapter Job Control + +This chapter discusses what job control is, how it works, and how +Bash allows you to access its facilities. + +@menu +* Job Control Basics:: How job control works. +* Job Control Builtins:: Bash builtin commands used to interact + with job control. +* Job Control Variables:: Variables Bash uses to customize job + control. +@end menu + +@node Job Control Basics +@section Job Control Basics +@cindex job control +@cindex foreground +@cindex background +@cindex suspending jobs + +Job control +refers to the ability to selectively stop (suspend) +the execution of processes and continue (resume) +their execution at a later point. A user typically employs +this facility via an interactive interface supplied jointly +by the operating system kernel's terminal driver and Bash. + +The shell associates a @var{job} with each pipeline. It keeps a +table of currently executing jobs, which may be listed with the +@code{jobs} command. When Bash starts a job +asynchronously, it prints a line that looks +like: +@example +[1] 25647 +@end example +@noindent +indicating that this job is job number 1 and that the process @sc{id} +of the last process in the pipeline associated with this job is +25647. All of the processes in a single pipeline are members of +the same job. Bash uses the @var{job} abstraction as the +basis for job control. + +To facilitate the implementation of the user interface to job +control, the operating system maintains the notion of a current terminal +process group @sc{id}. Members of this process group (processes whose +process group @sc{id} is equal to the current terminal process group +@sc{id}) receive keyboard-generated signals such as @code{SIGINT}. +These processes are said to be in the foreground. Background +processes are those whose process group @sc{id} differs from the +terminal's; such processes are immune to keyboard-generated +signals. Only foreground processes are allowed to read from or, if +the user so specifies with @code{stty tostop}, write to the terminal. +Background processes which attempt to +read from (write to when @code{stty tostop} is in effect) the +terminal are sent a @code{SIGTTIN} (@code{SIGTTOU}) +signal by the kernel's terminal driver, +which, unless caught, suspends the process. + +If the operating system on which Bash is running supports +job control, Bash contains facilities to use it. Typing the +@var{suspend} character (typically @samp{^Z}, Control-Z) while a +process is running causes that process to be stopped and returns +control to Bash. Typing the @var{delayed suspend} character +(typically @samp{^Y}, Control-Y) causes the process to be stopped +when it attempts to read input from the terminal, and control to +be returned to Bash. The user then manipulates the state of +this job, using the @code{bg} command to continue it in the +background, the @code{fg} command to continue it in the +foreground, or the @code{kill} command to kill it. A @samp{^Z} +takes effect immediately, and has the additional side effect of +causing pending output and typeahead to be discarded. + +There are a number of ways to refer to a job in the shell. The +character @samp{%} introduces a job specification (@var{jobspec}). + +Job number @code{n} may be referred to as @samp{%n}. +The symbols @samp{%%} and @samp{%+} refer to the shell's notion of the +current job, which is the last job stopped while it was in the foreground +or started in the background. +A single @samp{%} (with no accompanying job specification) also refers +to the current job. +The previous job may be referenced using @samp{%-}. +If there is only a single job, @samp{%+} and @samp{%-} can both be used +to refer to that job. +In output pertaining to jobs (e.g., the output of the @code{jobs} +command), the current job is always flagged with a @samp{+}, and the +previous job with a @samp{-}. + +A job may also be referred to +using a prefix of the name used to start it, or using a substring +that appears in its command line. For example, @samp{%ce} refers +to a stopped @code{ce} job. Using @samp{%?ce}, on the +other hand, refers to any job containing the string @samp{ce} in +its command line. If the prefix or substring matches more than one job, +Bash reports an error. + +Simply naming a job can be used to bring it into the foreground: +@samp{%1} is a synonym for @samp{fg %1}, bringing job 1 from the +background into the foreground. Similarly, @samp{%1 &} resumes +job 1 in the background, equivalent to @samp{bg %1} + +The shell learns immediately whenever a job changes state. +Normally, Bash waits until it is about to print a prompt +before reporting changes in a job's status so as to not interrupt +any other output. +If the @option{-b} option to the @code{set} builtin is enabled, +Bash reports such changes immediately (@pxref{The Set Builtin}). +Any trap on @code{SIGCHLD} is executed for each child process +that exits. + +If an attempt to exit Bash is made while jobs are stopped, (or running, if +the @code{checkjobs} option is enabled -- see @ref{The Shopt Builtin}), the +shell prints a warning message, and if the @code{checkjobs} option is +enabled, lists the jobs and their statuses. +The @code{jobs} command may then be used to inspect their status. +If a second attempt to exit is made without an intervening command, +Bash does not print another warning, and any stopped jobs are terminated. + +@node Job Control Builtins +@section Job Control Builtins + +@table @code + +@item bg +@btindex bg +@example +bg [@var{jobspec} @dots{}] +@end example + +Resume each suspended job @var{jobspec} in the background, as if it +had been started with @samp{&}. +If @var{jobspec} is not supplied, the current job is used. +The return status is zero unless it is run when job control is not +enabled, or, when run with job control enabled, any +@var{jobspec} was not found or specifies a job +that was started without job control. + +@item fg +@btindex fg +@example +fg [@var{jobspec}] +@end example + +Resume the job @var{jobspec} in the foreground and make it the current job. +If @var{jobspec} is not supplied, the current job is used. +The return status is that of the command placed into the foreground, +or non-zero if run when job control is disabled or, when run with +job control enabled, @var{jobspec} does not specify a valid job or +@var{jobspec} specifies a job that was started without job control. + +@item jobs +@btindex jobs +@example +jobs [-lnprs] [@var{jobspec}] +jobs -x @var{command} [@var{arguments}] +@end example + +The first form lists the active jobs. The options have the +following meanings: + +@table @code +@item -l +List process @sc{id}s in addition to the normal information. + +@item -n +Display information only about jobs that have changed status since +the user was last notified of their status. + +@item -p +List only the process @sc{id} of the job's process group leader. + +@item -r +Display only running jobs. + +@item -s +Display only stopped jobs. +@end table + +If @var{jobspec} is given, +output is restricted to information about that job. +If @var{jobspec} is not supplied, the status of all jobs is +listed. + +If the @option{-x} option is supplied, @code{jobs} replaces any +@var{jobspec} found in @var{command} or @var{arguments} with the +corresponding process group @sc{id}, and executes @var{command}, +passing it @var{argument}s, returning its exit status. + +@item kill +@btindex kill +@example +kill [-s @var{sigspec}] [-n @var{signum}] [-@var{sigspec}] @var{jobspec} or @var{pid} +kill -l [@var{exit_status}] +@end example + +Send a signal specified by @var{sigspec} or @var{signum} to the process +named by job specification @var{jobspec} or process @sc{id} @var{pid}. +@var{sigspec} is either a case-insensitive signal name such as +@code{SIGINT} (with or without the @code{SIG} prefix) +or a signal number; @var{signum} is a signal number. +If @var{sigspec} and @var{signum} are not present, @code{SIGTERM} is used. +The @option{-l} option lists the signal names. +If any arguments are supplied when @option{-l} is given, the names of the +signals corresponding to the arguments are listed, and the return status +is zero. +@var{exit_status} is a number specifying a signal number or the exit +status of a process terminated by a signal. +The return status is zero if at least one signal was successfully sent, +or non-zero if an error occurs or an invalid option is encountered. + +@item wait +@btindex wait +@example +wait [-n] [@var{jobspec} or @var{pid} @dots{}] +@end example + +Wait until the child process specified by each process @sc{id} @var{pid} +or job specification @var{jobspec} exits and return the exit status of the +last command waited for. +If a job spec is given, all processes in the job are waited for. +If no arguments are given, all currently active child processes are +waited for, and the return status is zero. +If the @option{-n} option is supplied, @code{wait} waits for any job to +terminate and returns its exit status. +If neither @var{jobspec} nor @var{pid} specifies an active child process +of the shell, the return status is 127. + +@item disown +@btindex disown +@example +disown [-ar] [-h] [@var{jobspec} @dots{}] +@end example + +Without options, remove each @var{jobspec} from the table of +active jobs. +If the @option{-h} option is given, the job is not removed from the table, +but is marked so that @code{SIGHUP} is not sent to the job if the shell +receives a @code{SIGHUP}. +If @var{jobspec} is not present, and neither the @option{-a} nor the +@option{-r} option is supplied, the current job is used. +If no @var{jobspec} is supplied, the @option{-a} option means to remove or +mark all jobs; the @option{-r} option without a @var{jobspec} +argument restricts operation to running jobs. + +@item suspend +@btindex suspend +@example +suspend [-f] +@end example + +Suspend the execution of this shell until it receives a +@code{SIGCONT} signal. +A login shell cannot be suspended; the @option{-f} +option can be used to override this and force the suspension. +@end table + +When job control is not active, the @code{kill} and @code{wait} +builtins do not accept @var{jobspec} arguments. They must be +supplied process @sc{id}s. + +@node Job Control Variables +@section Job Control Variables + +@vtable @code + +@item auto_resume +This variable controls how the shell interacts with the user and +job control. If this variable exists then single word simple +commands without redirections are treated as candidates for resumption +of an existing job. There is no ambiguity allowed; if there is +more than one job beginning with the string typed, then +the most recently accessed job will be selected. +The name of a stopped job, in this context, is the command line +used to start it. If this variable is set to the value @samp{exact}, +the string supplied must match the name of a stopped job exactly; +if set to @samp{substring}, +the string supplied needs to match a substring of the name of a +stopped job. The @samp{substring} value provides functionality +analogous to the @samp{%?} job @sc{id} (@pxref{Job Control Basics}). +If set to any other value, the supplied string must +be a prefix of a stopped job's name; this provides functionality +analogous to the @samp{%} job @sc{id}. + +@end vtable + +@set readline-appendix +@set history-appendix +@cindex Readline, how to use +@include rluser.texi +@cindex History, how to use +@include hsuser.texi +@clear readline-appendix +@clear history-appendix + +@node Installing Bash +@chapter Installing Bash + +This chapter provides basic instructions for installing Bash on +the various supported platforms. The distribution supports the +@sc{gnu} operating systems, nearly every version of Unix, and several +non-Unix systems such as BeOS and Interix. +Other independent ports exist for +@sc{ms-dos}, @sc{os/2}, and Windows platforms. + +@menu +* Basic Installation:: Installation instructions. +* Compilers and Options:: How to set special options for various + systems. +* Compiling For Multiple Architectures:: How to compile Bash for more + than one kind of system from + the same source tree. +* Installation Names:: How to set the various paths used by the installation. +* Specifying the System Type:: How to configure Bash for a particular system. +* Sharing Defaults:: How to share default configuration values among GNU + programs. +* Operation Controls:: Options recognized by the configuration program. +* Optional Features:: How to enable and disable optional features when + building Bash. +@end menu + +@node Basic Installation +@section Basic Installation +@cindex installation +@cindex configuration +@cindex Bash installation +@cindex Bash configuration + +These are installation instructions for Bash. + +The simplest way to compile Bash is: + +@enumerate +@item +@code{cd} to the directory containing the source code and type +@samp{./configure} to configure Bash for your system. If you're +using @code{csh} on an old version of System V, you might need to +type @samp{sh ./configure} instead to prevent @code{csh} from trying +to execute @code{configure} itself. + +Running @code{configure} takes some time. +While running, it prints messages telling which features it is +checking for. + +@item +Type @samp{make} to compile Bash and build the @code{bashbug} bug +reporting script. + +@item +Optionally, type @samp{make tests} to run the Bash test suite. + +@item +Type @samp{make install} to install @code{bash} and @code{bashbug}. +This will also install the manual pages and Info file. + +@end enumerate + +The @code{configure} shell script attempts to guess correct +values for various system-dependent variables used during +compilation. It uses those values to create a @file{Makefile} in +each directory of the package (the top directory, the +@file{builtins}, @file{doc}, and @file{support} directories, +each directory under @file{lib}, and several others). It also creates a +@file{config.h} file containing system-dependent definitions. +Finally, it creates a shell script named @code{config.status} that you +can run in the future to recreate the current configuration, a +file @file{config.cache} that saves the results of its tests to +speed up reconfiguring, and a file @file{config.log} containing +compiler output (useful mainly for debugging @code{configure}). +If at some point +@file{config.cache} contains results you don't want to keep, you +may remove or edit it. + +To find out more about the options and arguments that the +@code{configure} script understands, type + +@example +bash-2.04$ ./configure --help +@end example + +@noindent +at the Bash prompt in your Bash source directory. + +If you need to do unusual things to compile Bash, please +try to figure out how @code{configure} could check whether or not +to do them, and mail diffs or instructions to +@email{bash-maintainers@@gnu.org} so they can be +considered for the next release. + +The file @file{configure.ac} is used to create @code{configure} +by a program called Autoconf. You only need +@file{configure.ac} if you want to change it or regenerate +@code{configure} using a newer version of Autoconf. If +you do this, make sure you are using Autoconf version 2.50 or +newer. + +You can remove the program binaries and object files from the +source code directory by typing @samp{make clean}. To also remove the +files that @code{configure} created (so you can compile Bash for +a different kind of computer), type @samp{make distclean}. + +@node Compilers and Options +@section Compilers and Options + +Some systems require unusual options for compilation or linking +that the @code{configure} script does not know about. You can +give @code{configure} initial values for variables by setting +them in the environment. Using a Bourne-compatible shell, you +can do that on the command line like this: + +@example +CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure +@end example + +On systems that have the @code{env} program, you can do it like this: + +@example +env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure +@end example + +The configuration process uses GCC to build Bash if it +is available. + +@node Compiling For Multiple Architectures +@section Compiling For Multiple Architectures + +You can compile Bash for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of @code{make} that +supports the @code{VPATH} variable, such as GNU @code{make}. +@code{cd} to the +directory where you want the object files and executables to go and run +the @code{configure} script from the source directory. You may need to +supply the @option{--srcdir=PATH} argument to tell @code{configure} where the +source files are. @code{configure} automatically checks for the +source code in the directory that @code{configure} is in and in `..'. + +If you have to use a @code{make} that does not supports the @code{VPATH} +variable, you can compile Bash for one architecture at a +time in the source code directory. After you have installed +Bash for one architecture, use @samp{make distclean} before +reconfiguring for another architecture. + +Alternatively, if your system supports symbolic links, you can use the +@file{support/mkclone} script to create a build tree which has +symbolic links back to each file in the source directory. Here's an +example that creates a build directory in the current directory from a +source directory @file{/usr/gnu/src/bash-2.0}: + +@example +bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 . +@end example + +@noindent +The @code{mkclone} script requires Bash, so you must have already built +Bash for at least one architecture before you can create build +directories for other architectures. + +@node Installation Names +@section Installation Names + +By default, @samp{make install} will install into +@file{/usr/local/bin}, @file{/usr/local/man}, etc. You can +specify an installation prefix other than @file{/usr/local} by +giving @code{configure} the option @option{--prefix=@var{PATH}}, +or by specifying a value for the @code{DESTDIR} @samp{make} +variable when running @samp{make install}. + +You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. +If you give @code{configure} the option +@option{--exec-prefix=@var{PATH}}, @samp{make install} will use +@var{PATH} as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + +@node Specifying the System Type +@section Specifying the System Type + +There may be some features @code{configure} can not figure out +automatically, but need to determine by the type of host Bash +will run on. Usually @code{configure} can figure that +out, but if it prints a message saying it can not guess the host +type, give it the @option{--host=TYPE} option. @samp{TYPE} can +either be a short name for the system type, such as @samp{sun4}, +or a canonical name with three fields: @samp{CPU-COMPANY-SYSTEM} +(e.g., @samp{i386-unknown-freebsd4.2}). + +See the file @file{support/config.sub} for the possible +values of each field. + +@node Sharing Defaults +@section Sharing Defaults + +If you want to set default values for @code{configure} scripts to +share, you can create a site shell script called +@code{config.site} that gives default values for variables like +@code{CC}, @code{cache_file}, and @code{prefix}. @code{configure} +looks for @file{PREFIX/share/config.site} if it exists, then +@file{PREFIX/etc/config.site} if it exists. Or, you can set the +@code{CONFIG_SITE} environment variable to the location of the site +script. A warning: the Bash @code{configure} looks for a site script, +but not all @code{configure} scripts do. + +@node Operation Controls +@section Operation Controls + +@code{configure} recognizes the following options to control how it +operates. + +@table @code + +@item --cache-file=@var{file} +Use and save the results of the tests in +@var{file} instead of @file{./config.cache}. Set @var{file} to +@file{/dev/null} to disable caching, for debugging +@code{configure}. + +@item --help +Print a summary of the options to @code{configure}, and exit. + +@item --quiet +@itemx --silent +@itemx -q +Do not print messages saying which checks are being made. + +@item --srcdir=@var{dir} +Look for the Bash source code in directory @var{dir}. Usually +@code{configure} can determine that directory automatically. + +@item --version +Print the version of Autoconf used to generate the @code{configure} +script, and exit. +@end table + +@code{configure} also accepts some other, not widely used, boilerplate +options. @samp{configure --help} prints the complete list. + +@node Optional Features +@section Optional Features + +The Bash @code{configure} has a number of @option{--enable-@var{feature}} +options, where @var{feature} indicates an optional part of Bash. +There are also several @option{--with-@var{package}} options, +where @var{package} is something like @samp{bash-malloc} or @samp{purify}. +To turn off the default use of a package, use +@option{--without-@var{package}}. To configure Bash without a feature +that is enabled by default, use @option{--disable-@var{feature}}. + +Here is a complete list of the @option{--enable-} and +@option{--with-} options that the Bash @code{configure} recognizes. + +@table @code +@item --with-afs +Define if you are using the Andrew File System from Transarc. + +@item --with-bash-malloc +Use the Bash version of +@code{malloc} in the directory @file{lib/malloc}. This is not the same +@code{malloc} that appears in @sc{gnu} libc, but an older version +originally derived from the 4.2 @sc{bsd} @code{malloc}. This @code{malloc} +is very fast, but wastes some space on each allocation. +This option is enabled by default. +The @file{NOTES} file contains a list of systems for +which this should be turned off, and @code{configure} disables this +option automatically for a number of systems. + +@item --with-curses +Use the curses library instead of the termcap library. This should +be supplied if your system has an inadequate or incomplete termcap +database. + +@item --with-gnu-malloc +A synonym for @code{--with-bash-malloc}. + +@item --with-installed-readline[=@var{PREFIX}] +Define this to make Bash link with a locally-installed version of Readline +rather than the version in @file{lib/readline}. This works only with +Readline 5.0 and later versions. If @var{PREFIX} is @code{yes} or not +supplied, @code{configure} uses the values of the make variables +@code{includedir} and @code{libdir}, which are subdirectories of @code{prefix} +by default, to find the installed version of Readline if it is not in +the standard system include and library directories. +If @var{PREFIX} is @code{no}, Bash links with the version in +@file{lib/readline}. +If @var{PREFIX} is set to any other value, @code{configure} treats it as +a directory pathname and looks for +the installed version of Readline in subdirectories of that directory +(include files in @var{PREFIX}/@code{include} and the library in +@var{PREFIX}/@code{lib}). + +@item --with-purify +Define this to use the Purify memory allocation checker from Rational +Software. + +@item --enable-minimal-config +This produces a shell with minimal features, close to the historical +Bourne shell. +@end table + +There are several @option{--enable-} options that alter how Bash is +compiled and linked, rather than changing run-time features. + +@table @code +@item --enable-largefile +Enable support for @uref{http://www.sas.com/standards/large_file/x_open.20Mar96.html, +large files} if the operating system requires special compiler options +to build programs which can access large files. This is enabled by +default, if the operating system provides large file support. + +@item --enable-profiling +This builds a Bash binary that produces profiling information to be +processed by @code{gprof} each time it is executed. + +@item --enable-static-link +This causes Bash to be linked statically, if @code{gcc} is being used. +This could be used to build a version to use as root's shell. +@end table + +The @samp{minimal-config} option can be used to disable all of +the following options, but it is processed first, so individual +options may be enabled using @samp{enable-@var{feature}}. + +All of the following options except for @samp{disabled-builtins}, +@samp{directpand-default}, and +@samp{xpg-echo-default} are +enabled by default, unless the operating system does not provide the +necessary support. + +@table @code +@item --enable-alias +Allow alias expansion and include the @code{alias} and @code{unalias} +builtins (@pxref{Aliases}). + +@item --enable-arith-for-command +Include support for the alternate form of the @code{for} command +that behaves like the C language @code{for} statement +(@pxref{Looping Constructs}). + +@item --enable-array-variables +Include support for one-dimensional array shell variables +(@pxref{Arrays}). + +@item --enable-bang-history +Include support for @code{csh}-like history substitution +(@pxref{History Interaction}). + +@item --enable-brace-expansion +Include @code{csh}-like brace expansion +( @code{b@{a,b@}c} @expansion{} @code{bac bbc} ). +See @ref{Brace Expansion}, for a complete description. + +@item --enable-casemod-attributes +Include support for case-modifying attributes in the @code{declare} builtin +and assignment statements. Variables with the @var{uppercase} attribute, +for example, will have their values converted to uppercase upon assignment. + +@item --enable-casemod-expansion +Include support for case-modifying word expansions. + +@item --enable-command-timing +Include support for recognizing @code{time} as a reserved word and for +displaying timing statistics for the pipeline following @code{time} +(@pxref{Pipelines}). +This allows pipelines as well as shell builtins and functions to be timed. + +@item --enable-cond-command +Include support for the @code{[[} conditional command. +(@pxref{Conditional Constructs}). + +@item --enable-cond-regexp +Include support for matching @sc{posix} regular expressions using the +@samp{=~} binary operator in the @code{[[} conditional command. +(@pxref{Conditional Constructs}). + +@item --enable-coprocesses +Include support for coprocesses and the @code{coproc} reserved word +(@pxref{Pipelines}). + +@item --enable-debugger +Include support for the bash debugger (distributed separately). + +@item --enable-direxpand-default +Cause the @code{direxpand} shell option (@pxref{The Shopt Builtin}) +to be enabled by default when the shell starts. +It is normally disabled by default. + +@item --enable-directory-stack +Include support for a @code{csh}-like directory stack and the +@code{pushd}, @code{popd}, and @code{dirs} builtins +(@pxref{The Directory Stack}). + +@item --enable-disabled-builtins +Allow builtin commands to be invoked via @samp{builtin xxx} +even after @code{xxx} has been disabled using @samp{enable -n xxx}. +See @ref{Bash Builtins}, for details of the @code{builtin} and +@code{enable} builtin commands. + +@item --enable-dparen-arithmetic +Include support for the @code{((@dots{}))} command +(@pxref{Conditional Constructs}). + +@item --enable-extended-glob +Include support for the extended pattern matching features described +above under @ref{Pattern Matching}. + +@item --enable-extended-glob-default +Set the default value of the @var{extglob} shell option described +above under @ref{The Shopt Builtin} to be enabled. + +@item --enable-glob-asciirange-default +Set the default value of the @var{globasciiranges} shell option described +above under @ref{The Shopt Builtin} to be enabled. +This controls the behavior of character ranges when used in pattern matching +bracket expressions. + +@item --enable-help-builtin +Include the @code{help} builtin, which displays help on shell builtins and +variables (@pxref{Bash Builtins}). + +@item --enable-history +Include command history and the @code{fc} and @code{history} +builtin commands (@pxref{Bash History Facilities}). + +@item --enable-job-control +This enables the job control features (@pxref{Job Control}), +if the operating system supports them. + +@item --enable-multibyte +This enables support for multibyte characters if the operating +system provides the necessary support. + +@item --enable-net-redirections +This enables the special handling of filenames of the form +@code{/dev/tcp/@var{host}/@var{port}} and +@code{/dev/udp/@var{host}/@var{port}} +when used in redirections (@pxref{Redirections}). + +@item --enable-process-substitution +This enables process substitution (@pxref{Process Substitution}) if +the operating system provides the necessary support. + +@item --enable-progcomp +Enable the programmable completion facilities +(@pxref{Programmable Completion}). +If Readline is not enabled, this option has no effect. + +@item --enable-prompt-string-decoding +Turn on the interpretation of a number of backslash-escaped characters +in the @env{$PS1}, @env{$PS2}, @env{$PS3}, and @env{$PS4} prompt +strings. See @ref{Controlling the Prompt}, for a complete list of prompt +string escape sequences. + +@item --enable-readline +Include support for command-line editing and history with the Bash +version of the Readline library (@pxref{Command Line Editing}). + +@item --enable-restricted +Include support for a @dfn{restricted shell}. If this is enabled, Bash, +when called as @code{rbash}, enters a restricted mode. See +@ref{The Restricted Shell}, for a description of restricted mode. + +@item --enable-select +Include the @code{select} compound command, which allows the generation of +simple menus (@pxref{Conditional Constructs}). + +@item --enable-separate-helpfiles +Use external files for the documentation displayed by the @code{help} builtin +instead of storing the text internally. + +@item --enable-single-help-strings +Store the text displayed by the @code{help} builtin as a single string for +each help topic. This aids in translating the text to different languages. +You may need to disable this if your compiler cannot handle very long string +literals. + +@item --enable-strict-posix-default +Make Bash @sc{posix}-conformant by default (@pxref{Bash POSIX Mode}). + +@item --enable-usg-echo-default +A synonym for @code{--enable-xpg-echo-default}. + +@item --enable-xpg-echo-default +Make the @code{echo} builtin expand backslash-escaped characters by default, +without requiring the @option{-e} option. +This sets the default value of the @code{xpg_echo} shell option to @code{on}, +which makes the Bash @code{echo} behave more like the version specified in +the Single Unix Specification, version 3. +@xref{Bash Builtins}, for a description of the escape sequences that +@code{echo} recognizes. +@end table + +The file @file{config-top.h} contains C Preprocessor +@samp{#define} statements for options which are not settable from +@code{configure}. +Some of these are not meant to be changed; beware of the consequences if +you do. +Read the comments associated with each definition for more +information about its effect. + +@node Reporting Bugs +@appendix Reporting Bugs + +Please report all bugs you find in Bash. +But first, you should +make sure that it really is a bug, and that it appears in the latest +version of Bash. +The latest version of Bash is always available for FTP from +@uref{ftp://ftp.gnu.org/pub/gnu/bash/}. + +Once you have determined that a bug actually exists, use the +@code{bashbug} command to submit a bug report. +If you have a fix, you are encouraged to mail that as well! +Suggestions and `philosophical' bug reports may be mailed +to @email{bug-bash@@gnu.org} or posted to the Usenet +newsgroup @code{gnu.bash.bug}. + +All bug reports should include: +@itemize @bullet +@item +The version number of Bash. +@item +The hardware and operating system. +@item +The compiler used to compile Bash. +@item +A description of the bug behaviour. +@item +A short script or `recipe' which exercises the bug and may be used +to reproduce it. +@end itemize + +@noindent +@code{bashbug} inserts the first three items automatically into +the template it provides for filing a bug report. + +Please send all reports concerning this manual to +@email{bug-bash@@gnu.org}. + +@node Major Differences From The Bourne Shell +@appendix Major Differences From The Bourne Shell + +Bash implements essentially the same grammar, parameter and +variable expansion, redirection, and quoting as the Bourne Shell. +Bash uses the @sc{posix} standard as the specification of +how these features are to be implemented. There are some +differences between the traditional Bourne shell and Bash; this +section quickly details the differences of significance. A +number of these differences are explained in greater depth in +previous sections. +This section uses the version of @code{sh} included in SVR4.2 (the +last version of the historical Bourne shell) as the baseline reference. + +@itemize @bullet + +@item +Bash is @sc{posix}-conformant, even where the @sc{posix} specification +differs from traditional @code{sh} behavior (@pxref{Bash POSIX Mode}). + +@item +Bash has multi-character invocation options (@pxref{Invoking Bash}). + +@item +Bash has command-line editing (@pxref{Command Line Editing}) and +the @code{bind} builtin. + +@item +Bash provides a programmable word completion mechanism +(@pxref{Programmable Completion}), and builtin commands +@code{complete}, @code{compgen}, and @code{compopt}, to +manipulate it. + +@item +Bash has command history (@pxref{Bash History Facilities}) and the +@code{history} and @code{fc} builtins to manipulate it. +The Bash history list maintains timestamp information and uses the +value of the @code{HISTTIMEFORMAT} variable to display it. + +@item +Bash implements @code{csh}-like history expansion +(@pxref{History Interaction}). + +@item +Bash has one-dimensional array variables (@pxref{Arrays}), and the +appropriate variable expansions and assignment syntax to use them. +Several of the Bash builtins take options to act on arrays. +Bash provides a number of built-in array variables. + +@item +The @code{$'@dots{}'} quoting syntax, which expands ANSI-C +backslash-escaped characters in the text between the single quotes, +is supported (@pxref{ANSI-C Quoting}). + +@item +Bash supports the @code{$"@dots{}"} quoting syntax to do +locale-specific translation of the characters between the double +quotes. The @option{-D}, @option{--dump-strings}, and @option{--dump-po-strings} +invocation options list the translatable strings found in a script +(@pxref{Locale Translation}). + +@item +Bash implements the @code{!} keyword to negate the return value of +a pipeline (@pxref{Pipelines}). +Very useful when an @code{if} statement needs to act only if a test fails. +The Bash @samp{-o pipefail} option to @code{set} will cause a pipeline to +return a failure status if any command fails. + +@item +Bash has the @code{time} reserved word and command timing (@pxref{Pipelines}). +The display of the timing statistics may be controlled with the +@env{TIMEFORMAT} variable. + +@item +Bash implements the @code{for (( @var{expr1} ; @var{expr2} ; @var{expr3} ))} +arithmetic for command, similar to the C language (@pxref{Looping Constructs}). + +@item +Bash includes the @code{select} compound command, which allows the +generation of simple menus (@pxref{Conditional Constructs}). + +@item +Bash includes the @code{[[} compound command, which makes conditional +testing part of the shell grammar (@pxref{Conditional Constructs}), including +optional regular expression matching. + +@item +Bash provides optional case-insensitive matching for the @code{case} and +@code{[[} constructs. + +@item +Bash includes brace expansion (@pxref{Brace Expansion}) and tilde +expansion (@pxref{Tilde Expansion}). + +@item +Bash implements command aliases and the @code{alias} and @code{unalias} +builtins (@pxref{Aliases}). + +@item +Bash provides shell arithmetic, the @code{((} compound command +(@pxref{Conditional Constructs}), +and arithmetic expansion (@pxref{Shell Arithmetic}). + +@item +Variables present in the shell's initial environment are automatically +exported to child processes. The Bourne shell does not normally do +this unless the variables are explicitly marked using the @code{export} +command. + +@item +Bash supports the @samp{+=} assignment operator, which appends to the value +of the variable named on the left hand side. + +@item +Bash includes the @sc{posix} pattern removal @samp{%}, @samp{#}, @samp{%%} +and @samp{##} expansions to remove leading or trailing substrings from +variable values (@pxref{Shell Parameter Expansion}). + +@item +The expansion @code{$@{#xx@}}, which returns the length of @code{$@{xx@}}, +is supported (@pxref{Shell Parameter Expansion}). + +@item +The expansion @code{$@{var:}@var{offset}@code{[:}@var{length}@code{]@}}, +which expands to the substring of @code{var}'s value of length +@var{length}, beginning at @var{offset}, is present +(@pxref{Shell Parameter Expansion}). + +@item +The expansion +@code{$@{var/[/]}@var{pattern}@code{[/}@var{replacement}@code{]@}}, +which matches @var{pattern} and replaces it with @var{replacement} in +the value of @code{var}, is available (@pxref{Shell Parameter Expansion}). + +@item +The expansion @code{$@{!@var{prefix}*@}} expansion, which expands to +the names of all shell variables whose names begin with @var{prefix}, +is available (@pxref{Shell Parameter Expansion}). + +@item +Bash has @var{indirect} variable expansion using @code{$@{!word@}} +(@pxref{Shell Parameter Expansion}). + +@item +Bash can expand positional parameters beyond @code{$9} using +@code{$@{@var{num}@}}. + +@item +The @sc{posix} @code{$()} form of command substitution +is implemented (@pxref{Command Substitution}), +and preferred to the Bourne shell's @code{``} (which +is also implemented for backwards compatibility). + +@item +Bash has process substitution (@pxref{Process Substitution}). + +@item +Bash automatically assigns variables that provide information about the +current user (@env{UID}, @env{EUID}, and @env{GROUPS}), the current host +(@env{HOSTTYPE}, @env{OSTYPE}, @env{MACHTYPE}, and @env{HOSTNAME}), +and the instance of Bash that is running (@env{BASH}, +@env{BASH_VERSION}, and @env{BASH_VERSINFO}). @xref{Bash Variables}, +for details. + +@item +The @env{IFS} variable is used to split only the results of expansion, +not all words (@pxref{Word Splitting}). +This closes a longstanding shell security hole. + +@item +The filename expansion bracket expression code uses @samp{!} and @samp{^} +to negate the set of characters between the brackets. +The Bourne shell uses only @samp{!}. + +@item +Bash implements the full set of @sc{posix} filename expansion operators, +including @var{character classes}, @var{equivalence classes}, and +@var{collating symbols} (@pxref{Filename Expansion}). + +@item +Bash implements extended pattern matching features when the @code{extglob} +shell option is enabled (@pxref{Pattern Matching}). + +@item +It is possible to have a variable and a function with the same name; +@code{sh} does not separate the two name spaces. + +@item +Bash functions are permitted to have local variables using the +@code{local} builtin, and thus useful recursive functions may be written +(@pxref{Bash Builtins}). + +@item +Variable assignments preceding commands affect only that command, even +builtins and functions (@pxref{Environment}). +In @code{sh}, all variable assignments +preceding commands are global unless the command is executed from the +file system. + +@item +Bash performs filename expansion on filenames specified as operands +to input and output redirection operators (@pxref{Redirections}). + +@item +Bash contains the @samp{<>} redirection operator, allowing a file to be +opened for both reading and writing, and the @samp{&>} redirection +operator, for directing standard output and standard error to the same +file (@pxref{Redirections}). + +@item +Bash includes the @samp{<<<} redirection operator, allowing a string to +be used as the standard input to a command. + +@item +Bash implements the @samp{[n]<&@var{word}} and @samp{[n]>&@var{word}} +redirection operators, which move one file descriptor to another. + +@item +Bash treats a number of filenames specially when they are +used in redirection operators (@pxref{Redirections}). + +@item +Bash can open network connections to arbitrary machines and services +with the redirection operators (@pxref{Redirections}). + +@item +The @code{noclobber} option is available to avoid overwriting existing +files with output redirection (@pxref{The Set Builtin}). +The @samp{>|} redirection operator may be used to override @code{noclobber}. + +@item +The Bash @code{cd} and @code{pwd} builtins (@pxref{Bourne Shell Builtins}) +each take @option{-L} and @option{-P} options to switch between logical and +physical modes. + +@item +Bash allows a function to override a builtin with the same name, and provides +access to that builtin's functionality within the function via the +@code{builtin} and @code{command} builtins (@pxref{Bash Builtins}). + +@item +The @code{command} builtin allows selective disabling of functions +when command lookup is performed (@pxref{Bash Builtins}). + +@item +Individual builtins may be enabled or disabled using the @code{enable} +builtin (@pxref{Bash Builtins}). + +@item +The Bash @code{exec} builtin takes additional options that allow users +to control the contents of the environment passed to the executed +command, and what the zeroth argument to the command is to be +(@pxref{Bourne Shell Builtins}). + +@item +Shell functions may be exported to children via the environment +using @code{export -f} (@pxref{Shell Functions}). + +@item +The Bash @code{export}, @code{readonly}, and @code{declare} builtins can +take a @option{-f} option to act on shell functions, a @option{-p} option to +display variables with various attributes set in a format that can be +used as shell input, a @option{-n} option to remove various variable +attributes, and @samp{name=value} arguments to set variable attributes +and values simultaneously. + +@item +The Bash @code{hash} builtin allows a name to be associated with +an arbitrary filename, even when that filename cannot be found by +searching the @env{$PATH}, using @samp{hash -p} +(@pxref{Bourne Shell Builtins}). + +@item +Bash includes a @code{help} builtin for quick reference to shell +facilities (@pxref{Bash Builtins}). + +@item +The @code{printf} builtin is available to display formatted output +(@pxref{Bash Builtins}). + +@item +The Bash @code{read} builtin (@pxref{Bash Builtins}) +will read a line ending in @samp{\} with +the @option{-r} option, and will use the @env{REPLY} variable as a +default if no non-option arguments are supplied. +The Bash @code{read} builtin +also accepts a prompt string with the @option{-p} option and will use +Readline to obtain the line when given the @option{-e} option. +The @code{read} builtin also has additional options to control input: +the @option{-s} option will turn off echoing of input characters as +they are read, the @option{-t} option will allow @code{read} to time out +if input does not arrive within a specified number of seconds, the +@option{-n} option will allow reading only a specified number of +characters rather than a full line, and the @option{-d} option will read +until a particular character rather than newline. + +@item +The @code{return} builtin may be used to abort execution of scripts +executed with the @code{.} or @code{source} builtins +(@pxref{Bourne Shell Builtins}). + +@item +Bash includes the @code{shopt} builtin, for finer control of shell +optional capabilities (@pxref{The Shopt Builtin}), and allows these options +to be set and unset at shell invocation (@pxref{Invoking Bash}). + +@item +Bash has much more optional behavior controllable with the @code{set} +builtin (@pxref{The Set Builtin}). + +@item +The @samp{-x} (@option{xtrace}) option displays commands other than +simple commands when performing an execution trace +(@pxref{The Set Builtin}). + +@item +The @code{test} builtin (@pxref{Bourne Shell Builtins}) +is slightly different, as it implements the @sc{posix} algorithm, +which specifies the behavior based on the number of arguments. + +@item +Bash includes the @code{caller} builtin, which displays the context of +any active subroutine call (a shell function or a script executed with +the @code{.} or @code{source} builtins). This supports the bash +debugger. + +@item +The @code{trap} builtin (@pxref{Bourne Shell Builtins}) allows a +@code{DEBUG} pseudo-signal specification, similar to @code{EXIT}. +Commands specified with a @code{DEBUG} trap are executed before every +simple command, @code{for} command, @code{case} command, +@code{select} command, every arithmetic @code{for} command, and before +the first command executes in a shell function. +The @code{DEBUG} trap is not inherited by shell functions unless the +function has been given the @code{trace} attribute or the +@code{functrace} option has been enabled using the @code{shopt} builtin. +The @code{extdebug} shell option has additional effects on the +@code{DEBUG} trap. + +The @code{trap} builtin (@pxref{Bourne Shell Builtins}) allows an +@code{ERR} pseudo-signal specification, similar to @code{EXIT} and @code{DEBUG}. +Commands specified with an @code{ERR} trap are executed after a simple +command fails, with a few exceptions. +The @code{ERR} trap is not inherited by shell functions unless the +@code{-o errtrace} option to the @code{set} builtin is enabled. + +The @code{trap} builtin (@pxref{Bourne Shell Builtins}) allows a +@code{RETURN} pseudo-signal specification, similar to +@code{EXIT} and @code{DEBUG}. +Commands specified with an @code{RETURN} trap are executed before +execution resumes after a shell function or a shell script executed with +@code{.} or @code{source} returns. +The @code{RETURN} trap is not inherited by shell functions unless the +function has been given the @code{trace} attribute or the +@code{functrace} option has been enabled using the @code{shopt} builtin. + +@item +The Bash @code{type} builtin is more extensive and gives more information +about the names it finds (@pxref{Bash Builtins}). + +@item +The Bash @code{umask} builtin permits a @option{-p} option to cause +the output to be displayed in the form of a @code{umask} command +that may be reused as input (@pxref{Bourne Shell Builtins}). + +@item +Bash implements a @code{csh}-like directory stack, and provides the +@code{pushd}, @code{popd}, and @code{dirs} builtins to manipulate it +(@pxref{The Directory Stack}). +Bash also makes the directory stack visible as the value of the +@env{DIRSTACK} shell variable. + +@item +Bash interprets special backslash-escaped characters in the prompt +strings when interactive (@pxref{Controlling the Prompt}). + +@item +The Bash restricted mode is more useful (@pxref{The Restricted Shell}); +the SVR4.2 shell restricted mode is too limited. + +@item +The @code{disown} builtin can remove a job from the internal shell +job table (@pxref{Job Control Builtins}) or suppress the sending +of @code{SIGHUP} to a job when the shell exits as the result of a +@code{SIGHUP}. + +@item +Bash includes a number of features to support a separate debugger for +shell scripts. + +@item +The SVR4.2 shell has two privilege-related builtins +(@code{mldmode} and @code{priv}) not present in Bash. + +@item +Bash does not have the @code{stop} or @code{newgrp} builtins. + +@item +Bash does not use the @env{SHACCT} variable or perform shell accounting. + +@item +The SVR4.2 @code{sh} uses a @env{TIMEOUT} variable like Bash uses +@env{TMOUT}. + +@end itemize + +@noindent +More features unique to Bash may be found in @ref{Bash Features}. + + +@appendixsec Implementation Differences From The SVR4.2 Shell + +Since Bash is a completely new implementation, it does not suffer from +many of the limitations of the SVR4.2 shell. For instance: + +@itemize @bullet + +@item +Bash does not fork a subshell when redirecting into or out of +a shell control structure such as an @code{if} or @code{while} +statement. + +@item +Bash does not allow unbalanced quotes. The SVR4.2 shell will silently +insert a needed closing quote at @code{EOF} under certain circumstances. +This can be the cause of some hard-to-find errors. + +@item +The SVR4.2 shell uses a baroque memory management scheme based on +trapping @code{SIGSEGV}. If the shell is started from a process with +@code{SIGSEGV} blocked (e.g., by using the @code{system()} C library +function call), it misbehaves badly. + +@item +In a questionable attempt at security, the SVR4.2 shell, +when invoked without the @option{-p} option, will alter its real +and effective @sc{uid} and @sc{gid} if they are less than some +magic threshold value, commonly 100. +This can lead to unexpected results. + +@item +The SVR4.2 shell does not allow users to trap @code{SIGSEGV}, +@code{SIGALRM}, or @code{SIGCHLD}. + +@item +The SVR4.2 shell does not allow the @env{IFS}, @env{MAILCHECK}, +@env{PATH}, @env{PS1}, or @env{PS2} variables to be unset. + +@item +The SVR4.2 shell treats @samp{^} as the undocumented equivalent of +@samp{|}. + +@item +Bash allows multiple option arguments when it is invoked (@code{-x -v}); +the SVR4.2 shell allows only one option argument (@code{-xv}). In +fact, some versions of the shell dump core if the second argument begins +with a @samp{-}. + +@item +The SVR4.2 shell exits a script if any builtin fails; Bash exits +a script only if one of the @sc{posix} special builtins fails, and +only for certain failures, as enumerated in the @sc{posix} standard. + +@item +The SVR4.2 shell behaves differently when invoked as @code{jsh} +(it turns on job control). +@end itemize + +@node GNU Free Documentation License +@appendix GNU Free Documentation License + +@include fdl.texi + +@node Indexes +@appendix Indexes + +@menu +* Builtin Index:: Index of Bash builtin commands. +* Reserved Word Index:: Index of Bash reserved words. +* Variable Index:: Quick reference helps you find the + variable you want. +* Function Index:: Index of bindable Readline functions. +* Concept Index:: General index for concepts described in + this manual. +@end menu + +@node Builtin Index +@appendixsec Index of Shell Builtin Commands +@printindex bt + +@node Reserved Word Index +@appendixsec Index of Shell Reserved Words +@printindex rw + +@node Variable Index +@appendixsec Parameter and Variable Index +@printindex vr + +@node Function Index +@appendixsec Function Index +@printindex fn + +@node Concept Index +@appendixsec Concept Index +@printindex cp + +@bye diff --git a/doc/builtins.0 b/doc/builtins.0 new file mode 100644 index 0000000..dcdc6c5 --- /dev/null +++ b/doc/builtins.0 @@ -0,0 +1,1734 @@ +BASH_BUILTINS(1) BASH_BUILTINS(1) + + + +NNAAMMEE + bash, :, ., [, alias, bg, bind, break, builtin, caller, cd, command, + compgen, complete, compopt, continue, declare, dirs, disown, echo, + enable, eval, exec, exit, export, false, fc, fg, getopts, hash, help, + history, jobs, kill, let, local, logout, mapfile, popd, printf, pushd, + pwd, read, readonly, return, set, shift, shopt, source, suspend, test, + times, trap, true, type, typeset, ulimit, umask, unalias, unset, wait - + bash built-in commands, see bbaasshh(1) + +BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS + Unless otherwise noted, each builtin command documented in this section + as accepting options preceded by -- accepts ---- to signify the end of the + options. The ::, ttrruuee, ffaallssee, and tteesstt builtins do not accept options + and do not treat ---- specially. The eexxiitt, llooggoouutt, bbrreeaakk, ccoonnttiinnuuee, lleett, + and sshhiifftt builtins accept and process arguments beginning with -- with- + out requiring ----. Other builtins that accept arguments but are not + specified as accepting options interpret arguments beginning with -- as + invalid options and require ---- to prevent this interpretation. + :: [_a_r_g_u_m_e_n_t_s] + No effect; the command does nothing beyond expanding _a_r_g_u_m_e_n_t_s + and performing any specified redirections. A zero exit code is + returned. + + .. _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] + ssoouurrccee _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] + Read and execute commands from _f_i_l_e_n_a_m_e in the current shell + environment and return the exit status of the last command exe- + cuted from _f_i_l_e_n_a_m_e. If _f_i_l_e_n_a_m_e does not contain a slash, + filenames in PPAATTHH are used to find the directory containing + _f_i_l_e_n_a_m_e. The file searched for in PPAATTHH need not be executable. + When bbaasshh is not in _p_o_s_i_x _m_o_d_e, the current directory is + searched if no file is found in PPAATTHH. If the ssoouurrcceeppaatthh option + to the sshhoopptt builtin command is turned off, the PPAATTHH is not + searched. If any _a_r_g_u_m_e_n_t_s are supplied, they become the posi- + tional parameters when _f_i_l_e_n_a_m_e is executed. Otherwise the + positional parameters are unchanged. The return status is the + status of the last command exited within the script (0 if no + commands are executed), and false if _f_i_l_e_n_a_m_e is not found or + cannot be read. + + aalliiaass [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] + AAlliiaass with no arguments or with the --pp option prints the list of + aliases in the form aalliiaass _n_a_m_e=_v_a_l_u_e on standard output. When + arguments are supplied, an alias is defined for each _n_a_m_e whose + _v_a_l_u_e is given. A trailing space in _v_a_l_u_e causes the next word + to be checked for alias substitution when the alias is expanded. + For each _n_a_m_e in the argument list for which no _v_a_l_u_e is sup- + plied, the name and value of the alias is printed. AAlliiaass + returns true unless a _n_a_m_e is given for which no alias has been + defined. + + bbgg [_j_o_b_s_p_e_c ...] + Resume each suspended job _j_o_b_s_p_e_c in the background, as if it + had been started with &&. If _j_o_b_s_p_e_c is not present, the shell's + notion of the _c_u_r_r_e_n_t _j_o_b is used. bbgg _j_o_b_s_p_e_c returns 0 unless + run when job control is disabled or, when run with job control + enabled, any specified _j_o_b_s_p_e_c was not found or was started + without job control. + + bbiinndd [--mm _k_e_y_m_a_p] [--llppssvvPPSSVVXX] + bbiinndd [--mm _k_e_y_m_a_p] [--qq _f_u_n_c_t_i_o_n] [--uu _f_u_n_c_t_i_o_n] [--rr _k_e_y_s_e_q] + bbiinndd [--mm _k_e_y_m_a_p] --ff _f_i_l_e_n_a_m_e + bbiinndd [--mm _k_e_y_m_a_p] --xx _k_e_y_s_e_q:_s_h_e_l_l_-_c_o_m_m_a_n_d + bbiinndd [--mm _k_e_y_m_a_p] _k_e_y_s_e_q:_f_u_n_c_t_i_o_n_-_n_a_m_e + bbiinndd _r_e_a_d_l_i_n_e_-_c_o_m_m_a_n_d + Display current rreeaaddlliinnee key and function bindings, bind a key + sequence to a rreeaaddlliinnee function or macro, or set a rreeaaddlliinnee + variable. Each non-option argument is a command as it would + appear in _._i_n_p_u_t_r_c, but each binding or command must be passed + as a separate argument; e.g., '"\C-x\C-r": re-read-init-file'. + Options, if supplied, have the following meanings: + --mm _k_e_y_m_a_p + Use _k_e_y_m_a_p as the keymap to be affected by the subsequent + bindings. Acceptable _k_e_y_m_a_p names are _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_- + _d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_m_o_v_e_, _v_i_-_c_o_m_m_a_n_d, + and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d; _e_m_a_c_s is + equivalent to _e_m_a_c_s_-_s_t_a_n_d_a_r_d. + --ll List the names of all rreeaaddlliinnee functions. + --pp Display rreeaaddlliinnee function names and bindings in such a + way that they can be re-read. + --PP List current rreeaaddlliinnee function names and bindings. + --ss Display rreeaaddlliinnee key sequences bound to macros and the + strings they output in such a way that they can be re- + read. + --SS Display rreeaaddlliinnee key sequences bound to macros and the + strings they output. + --vv Display rreeaaddlliinnee variable names and values in such a way + that they can be re-read. + --VV List current rreeaaddlliinnee variable names and values. + --ff _f_i_l_e_n_a_m_e + Read key bindings from _f_i_l_e_n_a_m_e. + --qq _f_u_n_c_t_i_o_n + Query about which keys invoke the named _f_u_n_c_t_i_o_n. + --uu _f_u_n_c_t_i_o_n + Unbind all keys bound to the named _f_u_n_c_t_i_o_n. + --rr _k_e_y_s_e_q + Remove any current binding for _k_e_y_s_e_q. + --xx _k_e_y_s_e_q::_s_h_e_l_l_-_c_o_m_m_a_n_d + Cause _s_h_e_l_l_-_c_o_m_m_a_n_d to be executed whenever _k_e_y_s_e_q is + entered. When _s_h_e_l_l_-_c_o_m_m_a_n_d is executed, the shell sets + the RREEAADDLLIINNEE__LLIINNEE variable to the contents of the rreeaadd-- + lliinnee line buffer and the RREEAADDLLIINNEE__PPOOIINNTT variable to the + current location of the insertion point. If the executed + command changes the value of RREEAADDLLIINNEE__LLIINNEE or RREEAADD-- + LLIINNEE__PPOOIINNTT, those new values will be reflected in the + editing state. + --XX List all key sequences bound to shell commands and the + associated commands in a format that can be reused as + input. + + The return value is 0 unless an unrecognized option is given or + an error occurred. + + bbrreeaakk [_n] + Exit from within a ffoorr, wwhhiillee, uunnttiill, or sseelleecctt loop. If _n is + specified, break _n levels. _n must be >= 1. If _n is greater + than the number of enclosing loops, all enclosing loops are + exited. The return value is 0 unless _n is not greater than or + equal to 1. + + bbuuiillttiinn _s_h_e_l_l_-_b_u_i_l_t_i_n [_a_r_g_u_m_e_n_t_s] + Execute the specified shell builtin, passing it _a_r_g_u_m_e_n_t_s, and + return its exit status. This is useful when defining a function + whose name is the same as a shell builtin, retaining the func- + tionality of the builtin within the function. The ccdd builtin is + commonly redefined this way. The return status is false if + _s_h_e_l_l_-_b_u_i_l_t_i_n is not a shell builtin command. + + ccaalllleerr [_e_x_p_r] + Returns the context of any active subroutine call (a shell func- + tion or a script executed with the .. or ssoouurrccee builtins). With- + out _e_x_p_r, ccaalllleerr displays the line number and source filename of + the current subroutine call. If a non-negative integer is sup- + plied as _e_x_p_r, ccaalllleerr displays the line number, subroutine name, + and source file corresponding to that position in the current + execution call stack. This extra information may be used, for + example, to print a stack trace. The current frame is frame 0. + The return value is 0 unless the shell is not executing a sub- + routine call or _e_x_p_r does not correspond to a valid position in + the call stack. + + ccdd [--LL|[--PP [--ee]] [-@]] [_d_i_r] + Change the current directory to _d_i_r. if _d_i_r is not supplied, + the value of the HHOOMMEE shell variable is the default. Any addi- + tional arguments following _d_i_r are ignored. The variable CCDDPPAATTHH + defines the search path for the directory containing _d_i_r: each + directory name in CCDDPPAATTHH is searched for _d_i_r. Alternative + directory names in CCDDPPAATTHH are separated by a colon (:). A null + directory name in CCDDPPAATTHH is the same as the current directory, + i.e., ``..''. If _d_i_r begins with a slash (/), then CCDDPPAATTHH is not + used. The --PP option causes ccdd to use the physical directory + structure by resolving symbolic links while traversing _d_i_r and + before processing instances of _._. in _d_i_r (see also the --PP option + to the sseett builtin command); the --LL option forces symbolic links + to be followed by resolving the link after processing instances + of _._. in _d_i_r. If _._. appears in _d_i_r, it is processed by removing + the immediately previous pathname component from _d_i_r, back to a + slash or the beginning of _d_i_r. If the --ee option is supplied + with --PP, and the current working directory cannot be success- + fully determined after a successful directory change, ccdd will + return an unsuccessful status. On systems that support it, the + --@@ option presents the extended attributes associated with a + file as a directory. An argument of -- is converted to $$OOLLDDPPWWDD + before the directory change is attempted. If a non-empty direc- + tory name from CCDDPPAATTHH is used, or if -- is the first argument, + and the directory change is successful, the absolute pathname of + the new working directory is written to the standard output. + The return value is true if the directory was successfully + changed; false otherwise. + + ccoommmmaanndd [--ppVVvv] _c_o_m_m_a_n_d [_a_r_g ...] + Run _c_o_m_m_a_n_d with _a_r_g_s suppressing the normal shell function + lookup. Only builtin commands or commands found in the PPAATTHH are + executed. If the --pp option is given, the search for _c_o_m_m_a_n_d is + performed using a default value for PPAATTHH that is guaranteed to + find all of the standard utilities. If either the --VV or --vv + option is supplied, a description of _c_o_m_m_a_n_d is printed. The --vv + option causes a single word indicating the command or filename + used to invoke _c_o_m_m_a_n_d to be displayed; the --VV option produces a + more verbose description. If the --VV or --vv option is supplied, + the exit status is 0 if _c_o_m_m_a_n_d was found, and 1 if not. If + neither option is supplied and an error occurred or _c_o_m_m_a_n_d can- + not be found, the exit status is 127. Otherwise, the exit sta- + tus of the ccoommmmaanndd builtin is the exit status of _c_o_m_m_a_n_d. + + ccoommppggeenn [_o_p_t_i_o_n] [_w_o_r_d] + Generate possible completion matches for _w_o_r_d according to the + _o_p_t_i_o_ns, which may be any option accepted by the ccoommpplleettee + builtin with the exception of --pp and --rr, and write the matches + to the standard output. When using the --FF or --CC options, the + various shell variables set by the programmable completion + facilities, while available, will not have useful values. + + The matches will be generated in the same way as if the pro- + grammable completion code had generated them directly from a + completion specification with the same flags. If _w_o_r_d is speci- + fied, only those completions matching _w_o_r_d will be displayed. + + The return value is true unless an invalid option is supplied, + or no matches were generated. + + ccoommpplleettee [--aabbccddeeffggjjkkssuuvv] [--oo _c_o_m_p_-_o_p_t_i_o_n] [--DDEE] [--AA _a_c_t_i_o_n] [--GG _g_l_o_b_- + _p_a_t] [--WW _w_o_r_d_l_i_s_t] [--FF _f_u_n_c_t_i_o_n] [--CC _c_o_m_m_a_n_d] + [--XX _f_i_l_t_e_r_p_a_t] [--PP _p_r_e_f_i_x] [--SS _s_u_f_f_i_x] _n_a_m_e [_n_a_m_e _._._.] + ccoommpplleettee --pprr [--DDEE] [_n_a_m_e ...] + Specify how arguments to each _n_a_m_e should be completed. If the + --pp option is supplied, or if no options are supplied, existing + completion specifications are printed in a way that allows them + to be reused as input. The --rr option removes a completion spec- + ification for each _n_a_m_e, or, if no _n_a_m_es are supplied, all com- + pletion specifications. The --DD option indicates that the + remaining options and actions should apply to the ``default'' + command completion; that is, completion attempted on a command + for which no completion has previously been defined. The --EE + option indicates that the remaining options and actions should + apply to ``empty'' command completion; that is, completion + attempted on a blank line. + + The process of applying these completion specifications when + word completion is attempted is described above under PPrroo-- + ggrraammmmaabbllee CCoommpplleettiioonn. + + Other options, if specified, have the following meanings. The + arguments to the --GG, --WW, and --XX options (and, if necessary, the + --PP and --SS options) should be quoted to protect them from expan- + sion before the ccoommpplleettee builtin is invoked. + --oo _c_o_m_p_-_o_p_t_i_o_n + The _c_o_m_p_-_o_p_t_i_o_n controls several aspects of the comp- + spec's behavior beyond the simple generation of comple- + tions. _c_o_m_p_-_o_p_t_i_o_n may be one of: + bbaasshhddeeffaauulltt + Perform the rest of the default bbaasshh completions + if the compspec generates no matches. + ddeeffaauulltt Use readline's default filename completion if + the compspec generates no matches. + ddiirrnnaammeess + Perform directory name completion if the comp- + spec generates no matches. + ffiilleennaammeess + Tell readline that the compspec generates file- + names, so it can perform any filename-specific + processing (like adding a slash to directory + names, quoting special characters, or suppress- + ing trailing spaces). Intended to be used with + shell functions. + nnooqquuoottee Tell readline not to quote the completed words + if they are filenames (quoting filenames is the + default). + nnoossppaaccee Tell readline not to append a space (the + default) to words completed at the end of the + line. + pplluussddiirrss + After any matches defined by the compspec are + generated, directory name completion is + attempted and any matches are added to the + results of the other actions. + --AA _a_c_t_i_o_n + The _a_c_t_i_o_n may be one of the following to generate a + list of possible completions: + aalliiaass Alias names. May also be specified as --aa. + aarrrraayyvvaarr + Array variable names. + bbiinnddiinngg RReeaaddlliinnee key binding names. + bbuuiillttiinn Names of shell builtin commands. May also be + specified as --bb. + ccoommmmaanndd Command names. May also be specified as --cc. + ddiirreeccttoorryy + Directory names. May also be specified as --dd. + ddiissaabblleedd + Names of disabled shell builtins. + eennaabblleedd Names of enabled shell builtins. + eexxppoorrtt Names of exported shell variables. May also be + specified as --ee. + ffiillee File names. May also be specified as --ff. + ffuunnccttiioonn + Names of shell functions. + ggrroouupp Group names. May also be specified as --gg. + hheellppttooppiicc + Help topics as accepted by the hheellpp builtin. + hhoossttnnaammee + Hostnames, as taken from the file specified by + the HHOOSSTTFFIILLEE shell variable. + jjoobb Job names, if job control is active. May also + be specified as --jj. + kkeeyywwoorrdd Shell reserved words. May also be specified as + --kk. + rruunnnniinngg Names of running jobs, if job control is active. + sseerrvviiccee Service names. May also be specified as --ss. + sseettoopptt Valid arguments for the --oo option to the sseett + builtin. + sshhoopptt Shell option names as accepted by the sshhoopptt + builtin. + ssiiggnnaall Signal names. + ssttooppppeedd Names of stopped jobs, if job control is active. + uusseerr User names. May also be specified as --uu. + vvaarriiaabbllee + Names of all shell variables. May also be spec- + ified as --vv. + --CC _c_o_m_m_a_n_d + _c_o_m_m_a_n_d is executed in a subshell environment, and its + output is used as the possible completions. + --FF _f_u_n_c_t_i_o_n + The shell function _f_u_n_c_t_i_o_n is executed in the current + shell environment. When the function is executed, the + first argument ($$11) is the name of the command whose + arguments are being completed, the second argument ($$22) + is the word being completed, and the third argument ($$33) + is the word preceding the word being completed on the + current command line. When it finishes, the possible + completions are retrieved from the value of the CCOOMMPPRREE-- + PPLLYY array variable. + --GG _g_l_o_b_p_a_t + The pathname expansion pattern _g_l_o_b_p_a_t is expanded to + generate the possible completions. + --PP _p_r_e_f_i_x + _p_r_e_f_i_x is added at the beginning of each possible com- + pletion after all other options have been applied. + --SS _s_u_f_f_i_x + _s_u_f_f_i_x is appended to each possible completion after all + other options have been applied. + --WW _w_o_r_d_l_i_s_t + The _w_o_r_d_l_i_s_t is split using the characters in the IIFFSS + special variable as delimiters, and each resultant word + is expanded. The possible completions are the members + of the resultant list which match the word being com- + pleted. + --XX _f_i_l_t_e_r_p_a_t + _f_i_l_t_e_r_p_a_t is a pattern as used for pathname expansion. + It is applied to the list of possible completions gener- + ated by the preceding options and arguments, and each + completion matching _f_i_l_t_e_r_p_a_t is removed from the list. + A leading !! in _f_i_l_t_e_r_p_a_t negates the pattern; in this + case, any completion not matching _f_i_l_t_e_r_p_a_t is removed. + + The return value is true unless an invalid option is supplied, + an option other than --pp or --rr is supplied without a _n_a_m_e argu- + ment, an attempt is made to remove a completion specification + for a _n_a_m_e for which no specification exists, or an error occurs + adding a completion specification. + + ccoommppoopptt [--oo _o_p_t_i_o_n] [--DDEE] [++oo _o_p_t_i_o_n] [_n_a_m_e] + Modify completion options for each _n_a_m_e according to the + _o_p_t_i_o_ns, or for the currently-executing completion if no _n_a_m_es + are supplied. If no _o_p_t_i_o_ns are given, display the completion + options for each _n_a_m_e or the current completion. The possible + values of _o_p_t_i_o_n are those valid for the ccoommpplleettee builtin + described above. The --DD option indicates that the remaining + options should apply to the ``default'' command completion; that + is, completion attempted on a command for which no completion + has previously been defined. The --EE option indicates that the + remaining options should apply to ``empty'' command completion; + that is, completion attempted on a blank line. + + The return value is true unless an invalid option is supplied, + an attempt is made to modify the options for a _n_a_m_e for which no + completion specification exists, or an output error occurs. + + ccoonnttiinnuuee [_n] + Resume the next iteration of the enclosing ffoorr, wwhhiillee, uunnttiill, or + sseelleecctt loop. If _n is specified, resume at the _nth enclosing + loop. _n must be >= 1. If _n is greater than the number of + enclosing loops, the last enclosing loop (the ``top-level'' + loop) is resumed. The return value is 0 unless _n is not greater + than or equal to 1. + + ddeeccllaarree [--aaAAffFFggiillnnrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] + ttyyppeesseett [--aaAAffFFggiillnnrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] + Declare variables and/or give them attributes. If no _n_a_m_es are + given then display the values of variables. The --pp option will + display the attributes and values of each _n_a_m_e. When --pp is used + with _n_a_m_e arguments, additional options, other than --ff and --FF, + are ignored. When --pp is supplied without _n_a_m_e arguments, it + will display the attributes and values of all variables having + the attributes specified by the additional options. If no other + options are supplied with --pp, ddeeccllaarree will display the + attributes and values of all shell variables. The --ff option + will restrict the display to shell functions. The --FF option + inhibits the display of function definitions; only the function + name and attributes are printed. If the eexxttddeebbuugg shell option + is enabled using sshhoopptt, the source file name and line number + where the function is defined are displayed as well. The --FF + option implies --ff. The --gg option forces variables to be created + or modified at the global scope, even when ddeeccllaarree is executed + in a shell function. It is ignored in all other cases. The + following options can be used to restrict output to variables + with the specified attribute or to give variables attributes: + --aa Each _n_a_m_e is an indexed array variable (see AArrrraayyss + above). + --AA Each _n_a_m_e is an associative array variable (see AArrrraayyss + above). + --ff Use function names only. + --ii The variable is treated as an integer; arithmetic evalua- + tion (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN above) is performed when + the variable is assigned a value. + --ll When the variable is assigned a value, all upper-case + characters are converted to lower-case. The upper-case + attribute is disabled. + --nn Give each _n_a_m_e the _n_a_m_e_r_e_f attribute, making it a name + reference to another variable. That other variable is + defined by the value of _n_a_m_e. All references and assign- + ments to _n_a_m_e, except for changing the --nn attribute + itself, are performed on the variable referenced by + _n_a_m_e's value. The --nn attribute cannot be applied to + array variables. + --rr Make _n_a_m_es readonly. These names cannot then be assigned + values by subsequent assignment statements or unset. + --tt Give each _n_a_m_e the _t_r_a_c_e attribute. Traced functions + inherit the DDEEBBUUGG and RREETTUURRNN traps from the calling + shell. The trace attribute has no special meaning for + variables. + --uu When the variable is assigned a value, all lower-case + characters are converted to upper-case. The lower-case + attribute is disabled. + --xx Mark _n_a_m_es for export to subsequent commands via the + environment. + + Using `+' instead of `-' turns off the attribute instead, with + the exceptions that ++aa may not be used to destroy an array vari- + able and ++rr will not remove the readonly attribute. When used + in a function, ddeeccllaarree and ttyyppeesseett make each _n_a_m_e local, as with + the llooccaall command, unless the --gg option is supplied. If a vari- + able name is followed by =_v_a_l_u_e, the value of the variable is + set to _v_a_l_u_e. When using --aa or --AA and the compound assignment + syntax to create array variables, additional attributes do not + take effect until subsequent assignments. The return value is 0 + unless an invalid option is encountered, an attempt is made to + define a function using ``-f foo=bar'', an attempt is made to + assign a value to a readonly variable, an attempt is made to + assign a value to an array variable without using the compound + assignment syntax (see AArrrraayyss above), one of the _n_a_m_e_s is not a + valid shell variable name, an attempt is made to turn off read- + only status for a readonly variable, an attempt is made to turn + off array status for an array variable, or an attempt is made to + display a non-existent function with --ff. + + ddiirrss [[--ccllppvv]] [[++_n]] [[--_n]] + Without options, displays the list of currently remembered + directories. The default display is on a single line with + directory names separated by spaces. Directories are added to + the list with the ppuusshhdd command; the ppooppdd command removes + entries from the list. + --cc Clears the directory stack by deleting all of the + entries. + --ll Produces a listing using full pathnames; the default + listing format uses a tilde to denote the home directory. + --pp Print the directory stack with one entry per line. + --vv Print the directory stack with one entry per line, pre- + fixing each entry with its index in the stack. + ++_n Displays the _nth entry counting from the left of the list + shown by ddiirrss when invoked without options, starting with + zero. + --_n Displays the _nth entry counting from the right of the + list shown by ddiirrss when invoked without options, starting + with zero. + + The return value is 0 unless an invalid option is supplied or _n + indexes beyond the end of the directory stack. + + ddiissoowwnn [--aarr] [--hh] [_j_o_b_s_p_e_c ...] + Without options, remove each _j_o_b_s_p_e_c from the table of active + jobs. If _j_o_b_s_p_e_c is not present, and neither the --aa nor the --rr + option is supplied, the _c_u_r_r_e_n_t _j_o_b is used. If the --hh option + is given, each _j_o_b_s_p_e_c is not removed from the table, but is + marked so that SSIIGGHHUUPP is not sent to the job if the shell + receives a SSIIGGHHUUPP. If no _j_o_b_s_p_e_c is supplied, the --aa option + means to remove or mark all jobs; the --rr option without a _j_o_b_- + _s_p_e_c argument restricts operation to running jobs. The return + value is 0 unless a _j_o_b_s_p_e_c does not specify a valid job. + + eecchhoo [--nneeEE] [_a_r_g ...] + Output the _a_r_gs, separated by spaces, followed by a newline. + The return status is 0 unless a write error occurs. If --nn is + specified, the trailing newline is suppressed. If the --ee option + is given, interpretation of the following backslash-escaped + characters is enabled. The --EE option disables the interpreta- + tion of these escape characters, even on systems where they are + interpreted by default. The xxppgg__eecchhoo shell option may be used + to dynamically determine whether or not eecchhoo expands these + escape characters by default. eecchhoo does not interpret ---- to + mean the end of options. eecchhoo interprets the following escape + sequences: + \\aa alert (bell) + \\bb backspace + \\cc suppress further output + \\ee + \\EE an escape character + \\ff form feed + \\nn new line + \\rr carriage return + \\tt horizontal tab + \\vv vertical tab + \\\\ backslash + \\00_n_n_n the eight-bit character whose value is the octal value + _n_n_n (zero to three octal digits) + \\xx_H_H the eight-bit character whose value is the hexadecimal + value _H_H (one or two hex digits) + \\uu_H_H_H_H the Unicode (ISO/IEC 10646) character whose value is the + hexadecimal value _H_H_H_H (one to four hex digits) + \\UU_H_H_H_H_H_H_H_H + the Unicode (ISO/IEC 10646) character whose value is the + hexadecimal value _H_H_H_H_H_H_H_H (one to eight hex digits) + + eennaabbllee [--aa] [--ddnnppss] [--ff _f_i_l_e_n_a_m_e] [_n_a_m_e ...] + Enable and disable builtin shell commands. Disabling a builtin + allows a disk command which has the same name as a shell builtin + to be executed without specifying a full pathname, even though + the shell normally searches for builtins before disk commands. + If --nn is used, each _n_a_m_e is disabled; otherwise, _n_a_m_e_s are + enabled. For example, to use the tteesstt binary found via the PPAATTHH + instead of the shell builtin version, run ``enable -n test''. + The --ff option means to load the new builtin command _n_a_m_e from + shared object _f_i_l_e_n_a_m_e, on systems that support dynamic loading. + The --dd option will delete a builtin previously loaded with --ff. + If no _n_a_m_e arguments are given, or if the --pp option is supplied, + a list of shell builtins is printed. With no other option argu- + ments, the list consists of all enabled shell builtins. If --nn + is supplied, only disabled builtins are printed. If --aa is sup- + plied, the list printed includes all builtins, with an indica- + tion of whether or not each is enabled. If --ss is supplied, the + output is restricted to the POSIX _s_p_e_c_i_a_l builtins. The return + value is 0 unless a _n_a_m_e is not a shell builtin or there is an + error loading a new builtin from a shared object. + + eevvaall [_a_r_g ...] + The _a_r_gs are read and concatenated together into a single com- + mand. This command is then read and executed by the shell, and + its exit status is returned as the value of eevvaall. If there are + no _a_r_g_s, or only null arguments, eevvaall returns 0. + + eexxeecc [--ccll] [--aa _n_a_m_e] [_c_o_m_m_a_n_d [_a_r_g_u_m_e_n_t_s]] + If _c_o_m_m_a_n_d is specified, it replaces the shell. No new process + is created. The _a_r_g_u_m_e_n_t_s become the arguments to _c_o_m_m_a_n_d. If + the --ll option is supplied, the shell places a dash at the begin- + ning of the zeroth argument passed to _c_o_m_m_a_n_d. This is what + _l_o_g_i_n(1) does. The --cc option causes _c_o_m_m_a_n_d to be executed with + an empty environment. If --aa is supplied, the shell passes _n_a_m_e + as the zeroth argument to the executed command. If _c_o_m_m_a_n_d can- + not be executed for some reason, a non-interactive shell exits, + unless the eexxeeccffaaiill shell option is enabled. In that case, it + returns failure. An interactive shell returns failure if the + file cannot be executed. If _c_o_m_m_a_n_d is not specified, any redi- + rections take effect in the current shell, and the return status + is 0. If there is a redirection error, the return status is 1. + + eexxiitt [_n] + Cause the shell to exit with a status of _n. If _n is omitted, + the exit status is that of the last command executed. A trap on + EEXXIITT is executed before the shell terminates. + + eexxppoorrtt [--ffnn] [_n_a_m_e[=_w_o_r_d]] ... + eexxppoorrtt --pp + The supplied _n_a_m_e_s are marked for automatic export to the envi- + ronment of subsequently executed commands. If the --ff option is + given, the _n_a_m_e_s refer to functions. If no _n_a_m_e_s are given, or + if the --pp option is supplied, a list of names of all exported + variables is printed. The --nn option causes the export property + to be removed from each _n_a_m_e. If a variable name is followed by + =_w_o_r_d, the value of the variable is set to _w_o_r_d. eexxppoorrtt returns + an exit status of 0 unless an invalid option is encountered, one + of the _n_a_m_e_s is not a valid shell variable name, or --ff is sup- + plied with a _n_a_m_e that is not a function. + + ffcc [--ee _e_n_a_m_e] [--llnnrr] [_f_i_r_s_t] [_l_a_s_t] + ffcc --ss [_p_a_t=_r_e_p] [_c_m_d] + The first form selects a range of commands from _f_i_r_s_t to _l_a_s_t + from the history list and displays or edits and re-executes + them. _F_i_r_s_t and _l_a_s_t may be specified as a string (to locate + the last command beginning with that string) or as a number (an + index into the history list, where a negative number is used as + an offset from the current command number). If _l_a_s_t is not + specified it is set to the current command for listing (so that + ``fc -l -10'' prints the last 10 commands) and to _f_i_r_s_t other- + wise. If _f_i_r_s_t is not specified it is set to the previous com- + mand for editing and -16 for listing. + + The --nn option suppresses the command numbers when listing. The + --rr option reverses the order of the commands. If the --ll option + is given, the commands are listed on standard output. Other- + wise, the editor given by _e_n_a_m_e is invoked on a file containing + those commands. If _e_n_a_m_e is not given, the value of the FFCCEEDDIITT + variable is used, and the value of EEDDIITTOORR if FFCCEEDDIITT is not set. + If neither variable is set, _v_i is used. When editing is com- + plete, the edited commands are echoed and executed. + + In the second form, _c_o_m_m_a_n_d is re-executed after each instance + of _p_a_t is replaced by _r_e_p. _C_o_m_m_a_n_d is intepreted the same as + _f_i_r_s_t above. A useful alias to use with this is ``r="fc -s"'', + so that typing ``r cc'' runs the last command beginning with + ``cc'' and typing ``r'' re-executes the last command. + + If the first form is used, the return value is 0 unless an + invalid option is encountered or _f_i_r_s_t or _l_a_s_t specify history + lines out of range. If the --ee option is supplied, the return + value is the value of the last command executed or failure if an + error occurs with the temporary file of commands. If the second + form is used, the return status is that of the command re-exe- + cuted, unless _c_m_d does not specify a valid history line, in + which case ffcc returns failure. + + ffgg [_j_o_b_s_p_e_c] + Resume _j_o_b_s_p_e_c in the foreground, and make it the current job. + If _j_o_b_s_p_e_c is not present, the shell's notion of the _c_u_r_r_e_n_t _j_o_b + is used. The return value is that of the command placed into + the foreground, or failure if run when job control is disabled + or, when run with job control enabled, if _j_o_b_s_p_e_c does not spec- + ify a valid job or _j_o_b_s_p_e_c specifies a job that was started + without job control. + + ggeettooppttss _o_p_t_s_t_r_i_n_g _n_a_m_e [_a_r_g_s] + ggeettooppttss is used by shell procedures to parse positional parame- + ters. _o_p_t_s_t_r_i_n_g contains the option characters to be recog- + nized; if a character is followed by a colon, the option is + expected to have an argument, which should be separated from it + by white space. The colon and question mark characters may not + be used as option characters. Each time it is invoked, ggeettooppttss + places the next option in the shell variable _n_a_m_e, initializing + _n_a_m_e if it does not exist, and the index of the next argument to + be processed into the variable OOPPTTIINNDD. OOPPTTIINNDD is initialized to + 1 each time the shell or a shell script is invoked. When an + option requires an argument, ggeettooppttss places that argument into + the variable OOPPTTAARRGG. The shell does not reset OOPPTTIINNDD automati- + cally; it must be manually reset between multiple calls to + ggeettooppttss within the same shell invocation if a new set of parame- + ters is to be used. + + When the end of options is encountered, ggeettooppttss exits with a + return value greater than zero. OOPPTTIINNDD is set to the index of + the first non-option argument, and _n_a_m_e is set to ?. + + ggeettooppttss normally parses the positional parameters, but if more + arguments are given in _a_r_g_s, ggeettooppttss parses those instead. + + ggeettooppttss can report errors in two ways. If the first character + of _o_p_t_s_t_r_i_n_g is a colon, _s_i_l_e_n_t error reporting is used. In + normal operation, diagnostic messages are printed when invalid + options or missing option arguments are encountered. If the + variable OOPPTTEERRRR is set to 0, no error messages will be dis- + played, even if the first character of _o_p_t_s_t_r_i_n_g is not a colon. + + If an invalid option is seen, ggeettooppttss places ? into _n_a_m_e and, if + not silent, prints an error message and unsets OOPPTTAARRGG. If + ggeettooppttss is silent, the option character found is placed in + OOPPTTAARRGG and no diagnostic message is printed. + + If a required argument is not found, and ggeettooppttss is not silent, + a question mark (??) is placed in _n_a_m_e, OOPPTTAARRGG is unset, and a + diagnostic message is printed. If ggeettooppttss is silent, then a + colon (::) is placed in _n_a_m_e and OOPPTTAARRGG is set to the option + character found. + + ggeettooppttss returns true if an option, specified or unspecified, is + found. It returns false if the end of options is encountered or + an error occurs. + + hhaasshh [--llrr] [--pp _f_i_l_e_n_a_m_e] [--ddtt] [_n_a_m_e] + Each time hhaasshh is invoked, the full pathname of the command _n_a_m_e + is determined by searching the directories in $$PPAATTHH and remem- + bered. Any previously-remembered pathname is discarded. If the + --pp option is supplied, no path search is performed, and _f_i_l_e_n_a_m_e + is used as the full filename of the command. The --rr option + causes the shell to forget all remembered locations. The --dd + option causes the shell to forget the remembered location of + each _n_a_m_e. If the --tt option is supplied, the full pathname to + which each _n_a_m_e corresponds is printed. If multiple _n_a_m_e argu- + ments are supplied with --tt, the _n_a_m_e is printed before the + hashed full pathname. The --ll option causes output to be dis- + played in a format that may be reused as input. If no arguments + are given, or if only --ll is supplied, information about remem- + bered commands is printed. The return status is true unless a + _n_a_m_e is not found or an invalid option is supplied. + + hheellpp [--ddmmss] [_p_a_t_t_e_r_n] + Display helpful information about builtin commands. If _p_a_t_t_e_r_n + is specified, hheellpp gives detailed help on all commands matching + _p_a_t_t_e_r_n; otherwise help for all the builtins and shell control + structures is printed. + --dd Display a short description of each _p_a_t_t_e_r_n + --mm Display the description of each _p_a_t_t_e_r_n in a manpage-like + format + --ss Display only a short usage synopsis for each _p_a_t_t_e_r_n + + The return status is 0 unless no command matches _p_a_t_t_e_r_n. + + hhiissttoorryy [[_n]] + hhiissttoorryy --cc + hhiissttoorryy --dd _o_f_f_s_e_t + hhiissttoorryy --aannrrww [_f_i_l_e_n_a_m_e] + hhiissttoorryy --pp _a_r_g [_a_r_g _._._.] + hhiissttoorryy --ss _a_r_g [_a_r_g _._._.] + With no options, display the command history list with line num- + bers. Lines listed with a ** have been modified. An argument of + _n lists only the last _n lines. If the shell variable HHIISSTTTTIIMMEE-- + FFOORRMMAATT is set and not null, it is used as a format string for + _s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis- + played history entry. No intervening blank is printed between + the formatted time stamp and the history line. If _f_i_l_e_n_a_m_e is + supplied, it is used as the name of the history file; if not, + the value of HHIISSTTFFIILLEE is used. Options, if supplied, have the + following meanings: + --cc Clear the history list by deleting all the entries. + --dd _o_f_f_s_e_t + Delete the history entry at position _o_f_f_s_e_t. + --aa Append the ``new'' history lines (history lines entered + since the beginning of the current bbaasshh session) to the + history file. + --nn Read the history lines not already read from the history + file into the current history list. These are lines + appended to the history file since the beginning of the + current bbaasshh session. + --rr Read the contents of the history file and append them to + the current history list. + --ww Write the current history list to the history file, over- + writing the history file's contents. + --pp Perform history substitution on the following _a_r_g_s and + display the result on the standard output. Does not + store the results in the history list. Each _a_r_g must be + quoted to disable normal history expansion. + --ss Store the _a_r_g_s in the history list as a single entry. + The last command in the history list is removed before + the _a_r_g_s are added. + + If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, the time stamp informa- + tion associated with each history entry is written to the his- + tory file, marked with the history comment character. When the + history file is read, lines beginning with the history comment + character followed immediately by a digit are interpreted as + timestamps for the previous history line. The return value is 0 + unless an invalid option is encountered, an error occurs while + reading or writing the history file, an invalid _o_f_f_s_e_t is sup- + plied as an argument to --dd, or the history expansion supplied as + an argument to --pp fails. + + jjoobbss [--llnnpprrss] [ _j_o_b_s_p_e_c ... ] + jjoobbss --xx _c_o_m_m_a_n_d [ _a_r_g_s ... ] + The first form lists the active jobs. The options have the fol- + lowing meanings: + --ll List process IDs in addition to the normal information. + --nn Display information only about jobs that have changed + status since the user was last notified of their status. + --pp List only the process ID of the job's process group + leader. + --rr Display only running jobs. + --ss Display only stopped jobs. + + If _j_o_b_s_p_e_c is given, output is restricted to information about + that job. The return status is 0 unless an invalid option is + encountered or an invalid _j_o_b_s_p_e_c is supplied. + + If the --xx option is supplied, jjoobbss replaces any _j_o_b_s_p_e_c found in + _c_o_m_m_a_n_d or _a_r_g_s with the corresponding process group ID, and + executes _c_o_m_m_a_n_d passing it _a_r_g_s, returning its exit status. + + kkiillll [--ss _s_i_g_s_p_e_c | --nn _s_i_g_n_u_m | --_s_i_g_s_p_e_c] [_p_i_d | _j_o_b_s_p_e_c] ... + kkiillll --ll [_s_i_g_s_p_e_c | _e_x_i_t___s_t_a_t_u_s] + Send the signal named by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes + named by _p_i_d or _j_o_b_s_p_e_c. _s_i_g_s_p_e_c is either a case-insensitive + signal name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or + a signal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not + present, then SSIIGGTTEERRMM is assumed. An argument of --ll lists the + signal names. If any arguments are supplied when --ll is given, + the names of the signals corresponding to the arguments are + listed, and the return status is 0. The _e_x_i_t___s_t_a_t_u_s argument to + --ll is a number specifying either a signal number or the exit + status of a process terminated by a signal. kkiillll returns true + if at least one signal was successfully sent, or false if an + error occurs or an invalid option is encountered. + + lleett _a_r_g [_a_r_g ...] + Each _a_r_g is an arithmetic expression to be evaluated (see AARRIITTHH-- + MMEETTIICC EEVVAALLUUAATTIIOONN above). If the last _a_r_g evaluates to 0, lleett + returns 1; 0 is returned otherwise. + + llooccaall [_o_p_t_i_o_n] [_n_a_m_e[=_v_a_l_u_e] ...] + For each argument, a local variable named _n_a_m_e is created, and + assigned _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted + by ddeeccllaarree. When llooccaall is used within a function, it causes the + variable _n_a_m_e to have a visible scope restricted to that func- + tion and its children. With no operands, llooccaall writes a list of + local variables to the standard output. It is an error to use + llooccaall when not within a function. The return status is 0 unless + llooccaall is used outside a function, an invalid _n_a_m_e is supplied, + or _n_a_m_e is a readonly variable. + + llooggoouutt Exit a login shell. + + mmaappffiillee [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k] + [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y] + rreeaaddaarrrraayy [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k] + [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y] + Read lines from the standard input into the indexed array vari- + able _a_r_r_a_y, or from file descriptor _f_d if the --uu option is sup- + plied. The variable MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if + supplied, have the following meanings: + --nn Copy at most _c_o_u_n_t lines. If _c_o_u_n_t is 0, all lines are + copied. + --OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default + index is 0. + --ss Discard the first _c_o_u_n_t lines read. + --tt Remove a trailing newline from each line read. + --uu Read lines from file descriptor _f_d instead of the stan- + dard input. + --CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The + --cc option specifies _q_u_a_n_t_u_m. + --cc Specify the number of lines read between each call to + _c_a_l_l_b_a_c_k. + + If --CC is specified without --cc, the default quantum is 5000. + When _c_a_l_l_b_a_c_k is evaluated, it is supplied the index of the next + array element to be assigned and the line to be assigned to that + element as additional arguments. _c_a_l_l_b_a_c_k is evaluated after + the line is read but before the array element is assigned. + + If not supplied with an explicit origin, mmaappffiillee will clear + _a_r_r_a_y before assigning to it. + + mmaappffiillee returns successfully unless an invalid option or option + argument is supplied, _a_r_r_a_y is invalid or unassignable, or if + _a_r_r_a_y is not an indexed array. + + ppooppdd [-nn] [+_n] [-_n] + Removes entries from the directory stack. With no arguments, + removes the top directory from the stack, and performs a ccdd to + the new top directory. Arguments, if supplied, have the follow- + ing meanings: + --nn Suppresses the normal change of directory when removing + directories from the stack, so that only the stack is + manipulated. + ++_n Removes the _nth entry counting from the left of the list + shown by ddiirrss, starting with zero. For example: ``popd + +0'' removes the first directory, ``popd +1'' the second. + --_n Removes the _nth entry counting from the right of the list + shown by ddiirrss, starting with zero. For example: ``popd + -0'' removes the last directory, ``popd -1'' the next to + last. + + If the ppooppdd command is successful, a ddiirrss is performed as well, + and the return status is 0. ppooppdd returns false if an invalid + option is encountered, the directory stack is empty, a non-exis- + tent directory stack entry is specified, or the directory change + fails. + + pprriinnttff [--vv _v_a_r] _f_o_r_m_a_t [_a_r_g_u_m_e_n_t_s] + Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the + control of the _f_o_r_m_a_t. The --vv option causes the output to be + assigned to the variable _v_a_r rather than being printed to the + standard output. + + The _f_o_r_m_a_t is a character string which contains three types of + objects: plain characters, which are simply copied to standard + output, character escape sequences, which are converted and + copied to the standard output, and format specifications, each + of which causes printing of the next successive _a_r_g_u_m_e_n_t. In + addition to the standard _p_r_i_n_t_f(1) format specifications, pprriinnttff + interprets the following extensions: + %%bb causes pprriinnttff to expand backslash escape sequences in the + corresponding _a_r_g_u_m_e_n_t (except that \\cc terminates output, + backslashes in \\'', \\"", and \\?? are not removed, and octal + escapes beginning with \\00 may contain up to four digits). + %%qq causes pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a + format that can be reused as shell input. + %%((_d_a_t_e_f_m_t))TT + causes pprriinnttff to output the date-time string resulting + from using _d_a_t_e_f_m_t as a format string for _s_t_r_f_t_i_m_e(3). + The corresponding _a_r_g_u_m_e_n_t is an integer representing the + number of seconds since the epoch. Two special argument + values may be used: -1 represents the current time, and + -2 represents the time the shell was invoked. If no + argument is specified, conversion behaves as if -1 had + been given. This is an exception to the usual pprriinnttff + behavior. + + Arguments to non-string format specifiers are treated as C con- + stants, except that a leading plus or minus sign is allowed, and + if the leading character is a single or double quote, the value + is the ASCII value of the following character. + + The _f_o_r_m_a_t is reused as necessary to consume all of the _a_r_g_u_- + _m_e_n_t_s. If the _f_o_r_m_a_t requires more _a_r_g_u_m_e_n_t_s than are supplied, + the extra format specifications behave as if a zero value or + null string, as appropriate, had been supplied. The return + value is zero on success, non-zero on failure. + + ppuusshhdd [--nn] [+_n] [-_n] + ppuusshhdd [--nn] [_d_i_r] + Adds a directory to the top of the directory stack, or rotates + the stack, making the new top of the stack the current working + directory. With no arguments, exchanges the top two directories + and returns 0, unless the directory stack is empty. Arguments, + if supplied, have the following meanings: + --nn Suppresses the normal change of directory when adding + directories to the stack, so that only the stack is + manipulated. + ++_n Rotates the stack so that the _nth directory (counting + from the left of the list shown by ddiirrss, starting with + zero) is at the top. + --_n Rotates the stack so that the _nth directory (counting + from the right of the list shown by ddiirrss, starting with + zero) is at the top. + _d_i_r Adds _d_i_r to the directory stack at the top, making it the + new current working directory as if it had been supplied + as the argument to the ccdd builtin. + + If the ppuusshhdd command is successful, a ddiirrss is performed as well. + If the first form is used, ppuusshhdd returns 0 unless the cd to _d_i_r + fails. With the second form, ppuusshhdd returns 0 unless the direc- + tory stack is empty, a non-existent directory stack element is + specified, or the directory change to the specified new current + directory fails. + + ppwwdd [--LLPP] + Print the absolute pathname of the current working directory. + The pathname printed contains no symbolic links if the --PP option + is supplied or the --oo pphhyyssiiccaall option to the sseett builtin command + is enabled. If the --LL option is used, the pathname printed may + contain symbolic links. The return status is 0 unless an error + occurs while reading the name of the current directory or an + invalid option is supplied. + + rreeaadd [--eerrss] [--aa _a_n_a_m_e] [--dd _d_e_l_i_m] [--ii _t_e_x_t] [--nn _n_c_h_a_r_s] [--NN _n_c_h_a_r_s] [--pp + _p_r_o_m_p_t] [--tt _t_i_m_e_o_u_t] [--uu _f_d] [_n_a_m_e ...] + One line is read from the standard input, or from the file + descriptor _f_d supplied as an argument to the --uu option, and the + first word is assigned to the first _n_a_m_e, the second word to the + second _n_a_m_e, and so on, with leftover words and their interven- + ing separators assigned to the last _n_a_m_e. If there are fewer + words read from the input stream than names, the remaining names + are assigned empty values. The characters in IIFFSS are used to + split the line into words using the same rules the shell uses + for expansion (described above under WWoorrdd SSpplliittttiinngg). The back- + slash character (\\) may be used to remove any special meaning + for the next character read and for line continuation. Options, + if supplied, have the following meanings: + --aa _a_n_a_m_e + The words are assigned to sequential indices of the array + variable _a_n_a_m_e, starting at 0. _a_n_a_m_e is unset before any + new values are assigned. Other _n_a_m_e arguments are + ignored. + --dd _d_e_l_i_m + The first character of _d_e_l_i_m is used to terminate the + input line, rather than newline. + --ee If the standard input is coming from a terminal, rreeaaddlliinnee + (see RREEAADDLLIINNEE above) is used to obtain the line. Read- + line uses the current (or default, if line editing was + not previously active) editing settings. + --ii _t_e_x_t + If rreeaaddlliinnee is being used to read the line, _t_e_x_t is + placed into the editing buffer before editing begins. + --nn _n_c_h_a_r_s + rreeaadd returns after reading _n_c_h_a_r_s characters rather than + waiting for a complete line of input, but honor a delim- + iter if fewer than _n_c_h_a_r_s characters are read before the + delimiter. + --NN _n_c_h_a_r_s + rreeaadd returns after reading exactly _n_c_h_a_r_s characters + rather than waiting for a complete line of input, unless + EOF is encountered or rreeaadd times out. Delimiter charac- + ters encountered in the input are not treated specially + and do not cause rreeaadd to return until _n_c_h_a_r_s characters + are read. + --pp _p_r_o_m_p_t + Display _p_r_o_m_p_t on standard error, without a trailing new- + line, before attempting to read any input. The prompt is + displayed only if input is coming from a terminal. + --rr Backslash does not act as an escape character. The back- + slash is considered to be part of the line. In particu- + lar, a backslash-newline pair may not be used as a line + continuation. + --ss Silent mode. If input is coming from a terminal, charac- + ters are not echoed. + --tt _t_i_m_e_o_u_t + Cause rreeaadd to time out and return failure if a complete + line of input (or a specified number of characters) is + not read within _t_i_m_e_o_u_t seconds. _t_i_m_e_o_u_t may be a deci- + mal number with a fractional portion following the deci- + mal point. This option is only effective if rreeaadd is + reading input from a terminal, pipe, or other special + file; it has no effect when reading from regular files. + If rreeaadd times out, rreeaadd saves any partial input read into + the specified variable _n_a_m_e. If _t_i_m_e_o_u_t is 0, rreeaadd + returns immediately, without trying to read any data. + The exit status is 0 if input is available on the speci- + fied file descriptor, non-zero otherwise. The exit sta- + tus is greater than 128 if the timeout is exceeded. + --uu _f_d Read input from file descriptor _f_d. + + If no _n_a_m_e_s are supplied, the line read is assigned to the vari- + able RREEPPLLYY. The return code is zero, unless end-of-file is + encountered, rreeaadd times out (in which case the return code is + greater than 128), a variable assignment error (such as assign- + ing to a readonly variable) occurs, or an invalid file descrip- + tor is supplied as the argument to --uu. + + rreeaaddoonnllyy [--aaAAff] [--pp] [_n_a_m_e[=_w_o_r_d] ...] + The given _n_a_m_e_s are marked readonly; the values of these _n_a_m_e_s + may not be changed by subsequent assignment. If the --ff option + is supplied, the functions corresponding to the _n_a_m_e_s are so + marked. The --aa option restricts the variables to indexed + arrays; the --AA option restricts the variables to associative + arrays. If both options are supplied, --AA takes precedence. If + no _n_a_m_e arguments are given, or if the --pp option is supplied, a + list of all readonly names is printed. The other options may be + used to restrict the output to a subset of the set of readonly + names. The --pp option causes output to be displayed in a format + that may be reused as input. If a variable name is followed by + =_w_o_r_d, the value of the variable is set to _w_o_r_d. The return + status is 0 unless an invalid option is encountered, one of the + _n_a_m_e_s is not a valid shell variable name, or --ff is supplied with + a _n_a_m_e that is not a function. + + rreettuurrnn [_n] + Causes a function to stop executing and return the value speci- + fied by _n to its caller. If _n is omitted, the return status is + that of the last command executed in the function body. If + rreettuurrnn is used outside a function, but during execution of a + script by the .. (ssoouurrccee) command, it causes the shell to stop + executing that script and return either _n or the exit status of + the last command executed within the script as the exit status + of the script. If _n is supplied, the return value is its least + significant 8 bits. The return status is non-zero if rreettuurrnn is + supplied a non-numeric argument, or is used outside a function + and not during execution of a script by .. or ssoouurrccee. Any com- + mand associated with the RREETTUURRNN trap is executed before execu- + tion resumes after the function or script. + + sseett [----aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [--oo _o_p_t_i_o_n_-_n_a_m_e] [_a_r_g ...] + sseett [++aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [++oo _o_p_t_i_o_n_-_n_a_m_e] [_a_r_g ...] + Without options, the name and value of each shell variable are + displayed in a format that can be reused as input for setting or + resetting the currently-set variables. Read-only variables can- + not be reset. In _p_o_s_i_x mode, only shell variables are listed. + The output is sorted according to the current locale. When + options are specified, they set or unset shell attributes. Any + arguments remaining after option processing are treated as val- + ues for the positional parameters and are assigned, in order, to + $$11, $$22, ...... $$_n. Options, if specified, have the following + meanings: + --aa Automatically mark variables and functions which are + modified or created for export to the environment of + subsequent commands. + --bb Report the status of terminated background jobs immedi- + ately, rather than before the next primary prompt. This + is effective only when job control is enabled. + --ee Exit immediately if a _p_i_p_e_l_i_n_e (which may consist of a + single _s_i_m_p_l_e _c_o_m_m_a_n_d), a _l_i_s_t, or a _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d + (see SSHHEELLLL GGRRAAMMMMAARR above), exits with a non-zero sta- + tus. The shell does not exit if the command that fails + is part of the command list immediately following a + wwhhiillee or uunnttiill keyword, part of the test following the + iiff or eelliiff reserved words, part of any command executed + in a &&&& or |||| list except the command following the + final &&&& or ||||, any command in a pipeline but the last, + or if the command's return value is being inverted with + !!. If a compound command other than a subshell returns + a non-zero status because a command failed while --ee was + being ignored, the shell does not exit. A trap on EERRRR, + if set, is executed before the shell exits. This option + applies to the shell environment and each subshell envi- + ronment separately (see CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONNMMEENNTT + above), and may cause subshells to exit before executing + all the commands in the subshell. + + If a compound command or shell function executes in a + context where --ee is being ignored, none of the commands + executed within the compound command or function body + will be affected by the --ee setting, even if --ee is set + and a command returns a failure status. If a compound + command or shell function sets --ee while executing in a + context where --ee is ignored, that setting will not have + any effect until the compound command or the command + containing the function call completes. + --ff Disable pathname expansion. + --hh Remember the location of commands as they are looked up + for execution. This is enabled by default. + --kk All arguments in the form of assignment statements are + placed in the environment for a command, not just those + that precede the command name. + --mm Monitor mode. Job control is enabled. This option is + on by default for interactive shells on systems that + support it (see JJOOBB CCOONNTTRROOLL above). All processes run + in a separate process group. When a background job com- + pletes, the shell prints a line containing its exit sta- + tus. + --nn Read commands but do not execute them. This may be used + to check a shell script for syntax errors. This is + ignored by interactive shells. + --oo _o_p_t_i_o_n_-_n_a_m_e + The _o_p_t_i_o_n_-_n_a_m_e can be one of the following: + aalllleexxppoorrtt + Same as --aa. + bbrraacceeeexxppaanndd + Same as --BB. + eemmaaccss Use an emacs-style command line editing inter- + face. This is enabled by default when the shell + is interactive, unless the shell is started with + the ----nnooeeddiittiinngg option. This also affects the + editing interface used for rreeaadd --ee. + eerrrreexxiitt Same as --ee. + eerrrrttrraaccee + Same as --EE. + ffuunnccttrraaccee + Same as --TT. + hhaasshhaallll Same as --hh. + hhiisstteexxppaanndd + Same as --HH. + hhiissttoorryy Enable command history, as described above under + HHIISSTTOORRYY. This option is on by default in inter- + active shells. + iiggnnoorreeeeooff + The effect is as if the shell command + ``IGNOREEOF=10'' had been executed (see SShheellll + VVaarriiaabblleess above). + kkeeyywwoorrdd Same as --kk. + mmoonniittoorr Same as --mm. + nnoocclloobbbbeerr + Same as --CC. + nnooeexxeecc Same as --nn. + nnoogglloobb Same as --ff. + nnoolloogg Currently ignored. + nnoottiiffyy Same as --bb. + nnoouunnsseett Same as --uu. + oonneeccmmdd Same as --tt. + pphhyyssiiccaall + Same as --PP. + ppiippeeffaaiill + If set, the return value of a pipeline is the + value of the last (rightmost) command to exit + with a non-zero status, or zero if all commands + in the pipeline exit successfully. This option + is disabled by default. + ppoossiixx Change the behavior of bbaasshh where the default + operation differs from the POSIX standard to + match the standard (_p_o_s_i_x _m_o_d_e). See SSEEEE AALLSSOO + below for a reference to a document that details + how posix mode affects bash's behavior. + pprriivviilleeggeedd + Same as --pp. + vveerrbboossee Same as --vv. + vvii Use a vi-style command line editing interface. + This also affects the editing interface used for + rreeaadd --ee. + xxttrraaccee Same as --xx. + If --oo is supplied with no _o_p_t_i_o_n_-_n_a_m_e, the values of the + current options are printed. If ++oo is supplied with no + _o_p_t_i_o_n_-_n_a_m_e, a series of sseett commands to recreate the + current option settings is displayed on the standard + output. + --pp Turn on _p_r_i_v_i_l_e_g_e_d mode. In this mode, the $$EENNVV and + $$BBAASSHH__EENNVV files are not processed, shell functions are + not inherited from the environment, and the SSHHEELLLLOOPPTTSS, + BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they + appear in the environment, are ignored. If the shell is + started with the effective user (group) id not equal to + the real user (group) id, and the --pp option is not sup- + plied, these actions are taken and the effective user id + is set to the real user id. If the --pp option is sup- + plied at startup, the effective user id is not reset. + Turning this option off causes the effective user and + group ids to be set to the real user and group ids. + --tt Exit after reading and executing one command. + --uu Treat unset variables and parameters other than the spe- + cial parameters "@" and "*" as an error when performing + parameter expansion. If expansion is attempted on an + unset variable or parameter, the shell prints an error + message, and, if not interactive, exits with a non-zero + status. + --vv Print shell input lines as they are read. + --xx After expanding each _s_i_m_p_l_e _c_o_m_m_a_n_d, ffoorr command, ccaassee + command, sseelleecctt command, or arithmetic ffoorr command, dis- + play the expanded value of PPSS44, followed by the command + and its expanded arguments or associated word list. + --BB The shell performs brace expansion (see BBrraaccee EExxppaannssiioonn + above). This is on by default. + --CC If set, bbaasshh does not overwrite an existing file with + the >>, >>&&, and <<>> redirection operators. This may be + overridden when creating output files by using the redi- + rection operator >>|| instead of >>. + --EE If set, any trap on EERRRR is inherited by shell functions, + command substitutions, and commands executed in a sub- + shell environment. The EERRRR trap is normally not inher- + ited in such cases. + --HH Enable !! style history substitution. This option is on + by default when the shell is interactive. + --PP If set, the shell does not resolve symbolic links when + executing commands such as ccdd that change the current + working directory. It uses the physical directory + structure instead. By default, bbaasshh follows the logical + chain of directories when performing commands which + change the current directory. + --TT If set, any traps on DDEEBBUUGG and RREETTUURRNN are inherited by + shell functions, command substitutions, and commands + executed in a subshell environment. The DDEEBBUUGG and + RREETTUURRNN traps are normally not inherited in such cases. + ---- If no arguments follow this option, then the positional + parameters are unset. Otherwise, the positional parame- + ters are set to the _a_r_gs, even if some of them begin + with a --. + -- Signal the end of options, cause all remaining _a_r_gs to + be assigned to the positional parameters. The --xx and --vv + options are turned off. If there are no _a_r_gs, the posi- + tional parameters remain unchanged. + + The options are off by default unless otherwise noted. Using + + rather than - causes these options to be turned off. The + options can also be specified as arguments to an invocation of + the shell. The current set of options may be found in $$--. The + return status is always true unless an invalid option is encoun- + tered. + + sshhiifftt [_n] + The positional parameters from _n+1 ... are renamed to $$11 ........ + Parameters represented by the numbers $$## down to $$##-_n+1 are + unset. _n must be a non-negative number less than or equal to + $$##. If _n is 0, no parameters are changed. If _n is not given, + it is assumed to be 1. If _n is greater than $$##, the positional + parameters are not changed. The return status is greater than + zero if _n is greater than $$## or less than zero; otherwise 0. + + sshhoopptt [--ppqqssuu] [--oo] [_o_p_t_n_a_m_e ...] + Toggle the values of settings controlling optional shell behav- + ior. The settings can be either those listed below, or, if the + --oo option is used, those available with the --oo option to the sseett + builtin command. With no options, or with the --pp option, a list + of all settable options is displayed, with an indication of + whether or not each is set. The --pp option causes output to be + displayed in a form that may be reused as input. Other options + have the following meanings: + --ss Enable (set) each _o_p_t_n_a_m_e. + --uu Disable (unset) each _o_p_t_n_a_m_e. + --qq Suppresses normal output (quiet mode); the return status + indicates whether the _o_p_t_n_a_m_e is set or unset. If multi- + ple _o_p_t_n_a_m_e arguments are given with --qq, the return sta- + tus is zero if all _o_p_t_n_a_m_e_s are enabled; non-zero other- + wise. + --oo Restricts the values of _o_p_t_n_a_m_e to be those defined for + the --oo option to the sseett builtin. + + If either --ss or --uu is used with no _o_p_t_n_a_m_e arguments, sshhoopptt + shows only those options which are set or unset, respectively. + Unless otherwise noted, the sshhoopptt options are disabled (unset) + by default. + + The return status when listing options is zero if all _o_p_t_n_a_m_e_s + are enabled, non-zero otherwise. When setting or unsetting + options, the return status is zero unless an _o_p_t_n_a_m_e is not a + valid shell option. + + The list of sshhoopptt options is: + + aauuttooccdd If set, a command name that is the name of a directory + is executed as if it were the argument to the ccdd com- + mand. This option is only used by interactive shells. + ccddaabbllee__vvaarrss + If set, an argument to the ccdd builtin command that is + not a directory is assumed to be the name of a variable + whose value is the directory to change to. + ccddssppeellll If set, minor errors in the spelling of a directory com- + ponent in a ccdd command will be corrected. The errors + checked for are transposed characters, a missing charac- + ter, and one character too many. If a correction is + found, the corrected filename is printed, and the com- + mand proceeds. This option is only used by interactive + shells. + cchheecckkhhaasshh + If set, bbaasshh checks that a command found in the hash ta- + ble exists before trying to execute it. If a hashed + command no longer exists, a normal path search is per- + formed. + cchheecckkjjoobbss + If set, bbaasshh lists the status of any stopped and running + jobs before exiting an interactive shell. If any jobs + are running, this causes the exit to be deferred until a + second exit is attempted without an intervening command + (see JJOOBB CCOONNTTRROOLL above). The shell always postpones + exiting if any jobs are stopped. + cchheecckkwwiinnssiizzee + If set, bbaasshh checks the window size after each command + and, if necessary, updates the values of LLIINNEESS and CCOOLL-- + UUMMNNSS. + ccmmddhhiisstt If set, bbaasshh attempts to save all lines of a multiple- + line command in the same history entry. This allows + easy re-editing of multi-line commands. + ccoommppaatt3311 + If set, bbaasshh changes its behavior to that of version 3.1 + with respect to quoted arguments to the [[[[ conditional + command's ==~~ operator and locale-specific string compar- + ison when using the [[[[ conditional command's << and >> + operators. Bash versions prior to bash-4.1 use ASCII + collation and _s_t_r_c_m_p(3); bash-4.1 and later use the cur- + rent locale's collation sequence and _s_t_r_c_o_l_l(3). + ccoommppaatt3322 + If set, bbaasshh changes its behavior to that of version 3.2 + with respect to locale-specific string comparison when + using the [[[[ conditional command's << and >> operators + (see previous item). + ccoommppaatt4400 + If set, bbaasshh changes its behavior to that of version 4.0 + with respect to locale-specific string comparison when + using the [[[[ conditional command's << and >> operators + (see description of ccoommppaatt3311) and the effect of inter- + rupting a command list. Bash versions 4.0 and later + interrupt the list as if the shell received the inter- + rupt; previous versions continue with the next command + in the list. + ccoommppaatt4411 + If set, bbaasshh, when in _p_o_s_i_x mode, treats a single quote + in a double-quoted parameter expansion as a special + character. The single quotes must match (an even num- + ber) and the characters between the single quotes are + considered quoted. This is the behavior of posix mode + through version 4.1. The default bash behavior remains + as in previous versions. + ccoommppaatt4422 + If set, bbaasshh does not process the replacement string in + the pattern substitution word expansion using quote + removal. + ccoommpplleettee__ffuullllqquuoottee + If set, bbaasshh quotes all shell metacharacters in file- + names and directory names when performing completion. + If not set, bbaasshh removes metacharacters such as the dol- + lar sign from the set of characters that will be quoted + in completed filenames when these metacharacters appear + in shell variable references in words to be completed. + This means that dollar signs in variable names that + expand to directories will not be quoted; however, any + dollar signs appearing in filenames will not be quoted, + either. This is active only when bash is using back- + slashes to quote completed filenames. This variable is + set by default, which is the default bash behavior in + versions through 4.2. + ddiirreexxppaanndd + If set, bbaasshh replaces directory names with the results + of word expansion when performing filename completion. + This changes the contents of the readline editing + buffer. If not set, bbaasshh attempts to preserve what the + user typed. + ddiirrssppeellll + If set, bbaasshh attempts spelling correction on directory + names during word completion if the directory name ini- + tially supplied does not exist. + ddoottgglloobb If set, bbaasshh includes filenames beginning with a `.' in + the results of pathname expansion. + eexxeeccffaaiill + If set, a non-interactive shell will not exit if it can- + not execute the file specified as an argument to the + eexxeecc builtin command. An interactive shell does not + exit if eexxeecc fails. + eexxppaanndd__aalliiaasseess + If set, aliases are expanded as described above under + AALLIIAASSEESS. This option is enabled by default for interac- + tive shells. + eexxttddeebbuugg + If set, behavior intended for use by debuggers is + enabled: + 11.. The --FF option to the ddeeccllaarree builtin displays the + source file name and line number corresponding to + each function name supplied as an argument. + 22.. If the command run by the DDEEBBUUGG trap returns a + non-zero value, the next command is skipped and + not executed. + 33.. If the command run by the DDEEBBUUGG trap returns a + value of 2, and the shell is executing in a sub- + routine (a shell function or a shell script exe- + cuted by the .. or ssoouurrccee builtins), a call to + rreettuurrnn is simulated. + 44.. BBAASSHH__AARRGGCC and BBAASSHH__AARRGGVV are updated as described + in their descriptions above. + 55.. Function tracing is enabled: command substitu- + tion, shell functions, and subshells invoked with + (( _c_o_m_m_a_n_d )) inherit the DDEEBBUUGG and RREETTUURRNN traps. + 66.. Error tracing is enabled: command substitution, + shell functions, and subshells invoked with (( + _c_o_m_m_a_n_d )) inherit the EERRRR trap. + eexxttgglloobb If set, the extended pattern matching features described + above under PPaatthhnnaammee EExxppaannssiioonn are enabled. + eexxttqquuoottee + If set, $$'_s_t_r_i_n_g' and $$"_s_t_r_i_n_g" quoting is performed + within $${{_p_a_r_a_m_e_t_e_r}} expansions enclosed in double + quotes. This option is enabled by default. + ffaaiillgglloobb + If set, patterns which fail to match filenames during + pathname expansion result in an expansion error. + ffoorrccee__ffiiggnnoorree + If set, the suffixes specified by the FFIIGGNNOORREE shell + variable cause words to be ignored when performing word + completion even if the ignored words are the only possi- + ble completions. See SSHHEELLLL VVAARRIIAABBLLEESS above for a + description of FFIIGGNNOORREE. This option is enabled by + default. + gglloobbaasscciiiirraannggeess + If set, range expressions used in pattern matching + bracket expressions (see PPaatttteerrnn MMaattcchhiinngg above) behave + as if in the traditional C locale when performing com- + parisons. That is, the current locale's collating + sequence is not taken into account, so bb will not col- + late between AA and BB, and upper-case and lower-case + ASCII characters will collate together. + gglloobbssttaarr + If set, the pattern **** used in a pathname expansion con- + text will match all files and zero or more directories + and subdirectories. If the pattern is followed by a //, + only directories and subdirectories match. + ggnnuu__eerrrrffmmtt + If set, shell error messages are written in the standard + GNU error message format. + hhiissttaappppeenndd + If set, the history list is appended to the file named + by the value of the HHIISSTTFFIILLEE variable when the shell + exits, rather than overwriting the file. + hhiissttrreeeeddiitt + If set, and rreeaaddlliinnee is being used, a user is given the + opportunity to re-edit a failed history substitution. + hhiissttvveerriiffyy + If set, and rreeaaddlliinnee is being used, the results of his- + tory substitution are not immediately passed to the + shell parser. Instead, the resulting line is loaded + into the rreeaaddlliinnee editing buffer, allowing further modi- + fication. + hhoossttccoommpplleettee + If set, and rreeaaddlliinnee is being used, bbaasshh will attempt to + perform hostname completion when a word containing a @@ + is being completed (see CCoommpplleettiinngg under RREEAADDLLIINNEE + above). This is enabled by default. + hhuuppoonneexxiitt + If set, bbaasshh will send SSIIGGHHUUPP to all jobs when an inter- + active login shell exits. + iinntteerraaccttiivvee__ccoommmmeennttss + If set, allow a word beginning with ## to cause that word + and all remaining characters on that line to be ignored + in an interactive shell (see CCOOMMMMEENNTTSS above). This + option is enabled by default. + llaassttppiippee + If set, and job control is not active, the shell runs + the last command of a pipeline not executed in the back- + ground in the current shell environment. + lliitthhiisstt If set, and the ccmmddhhiisstt option is enabled, multi-line + commands are saved to the history with embedded newlines + rather than using semicolon separators where possible. + llooggiinn__sshheellll + The shell sets this option if it is started as a login + shell (see IINNVVOOCCAATTIIOONN above). The value may not be + changed. + mmaaiillwwaarrnn + If set, and a file that bbaasshh is checking for mail has + been accessed since the last time it was checked, the + message ``The mail in _m_a_i_l_f_i_l_e has been read'' is dis- + played. + nnoo__eemmppttyy__ccmmdd__ccoommpplleettiioonn + If set, and rreeaaddlliinnee is being used, bbaasshh will not + attempt to search the PPAATTHH for possible completions when + completion is attempted on an empty line. + nnooccaasseegglloobb + If set, bbaasshh matches filenames in a case-insensitive + fashion when performing pathname expansion (see PPaatthhnnaammee + EExxppaannssiioonn above). + nnooccaasseemmaattcchh + If set, bbaasshh matches patterns in a case-insensitive + fashion when performing matching while executing ccaassee or + [[[[ conditional commands. + nnuullllgglloobb + If set, bbaasshh allows patterns which match no files (see + PPaatthhnnaammee EExxppaannssiioonn above) to expand to a null string, + rather than themselves. + pprrooggccoommpp + If set, the programmable completion facilities (see PPrroo-- + ggrraammmmaabbllee CCoommpplleettiioonn above) are enabled. This option is + enabled by default. + pprroommppttvvaarrss + If set, prompt strings undergo parameter expansion, com- + mand substitution, arithmetic expansion, and quote + removal after being expanded as described in PPRROOMMPPTTIINNGG + above. This option is enabled by default. + rreessttrriicctteedd__sshheellll + The shell sets this option if it is started in + restricted mode (see RREESSTTRRIICCTTEEDD SSHHEELLLL below). The value + may not be changed. This is not reset when the startup + files are executed, allowing the startup files to dis- + cover whether or not a shell is restricted. + sshhiifftt__vveerrbboossee + If set, the sshhiifftt builtin prints an error message when + the shift count exceeds the number of positional parame- + ters. + ssoouurrcceeppaatthh + If set, the ssoouurrccee (..) builtin uses the value of PPAATTHH to + find the directory containing the file supplied as an + argument. This option is enabled by default. + xxppgg__eecchhoo + If set, the eecchhoo builtin expands backslash-escape + sequences by default. + + ssuussppeenndd [--ff] + Suspend the execution of this shell until it receives a SSIIGGCCOONNTT + signal. A login shell cannot be suspended; the --ff option can be + used to override this and force the suspension. The return sta- + tus is 0 unless the shell is a login shell and --ff is not sup- + plied, or if job control is not enabled. + + tteesstt _e_x_p_r + [[ _e_x_p_r ]] + Return a status of 0 (true) or 1 (false) depending on the evalu- + ation of the conditional expression _e_x_p_r. Each operator and op- + erand must be a separate argument. Expressions are composed of + the primaries described above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. + tteesstt does not accept any options, nor does it accept and ignore + an argument of ---- as signifying the end of options. + + Expressions may be combined using the following operators, + listed in decreasing order of precedence. The evaluation + depends on the number of arguments; see below. Operator prece- + dence is used when there are five or more arguments. + !! _e_x_p_r True if _e_x_p_r is false. + (( _e_x_p_r )) + Returns the value of _e_x_p_r. This may be used to override + the normal precedence of operators. + _e_x_p_r_1 -aa _e_x_p_r_2 + True if both _e_x_p_r_1 and _e_x_p_r_2 are true. + _e_x_p_r_1 -oo _e_x_p_r_2 + True if either _e_x_p_r_1 or _e_x_p_r_2 is true. + + tteesstt and [[ evaluate conditional expressions using a set of rules + based on the number of arguments. + + 0 arguments + The expression is false. + 1 argument + The expression is true if and only if the argument is not + null. + 2 arguments + If the first argument is !!, the expression is true if and + only if the second argument is null. If the first argu- + ment is one of the unary conditional operators listed + above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the expression is + true if the unary test is true. If the first argument is + not a valid unary conditional operator, the expression is + false. + 3 arguments + The following conditions are applied in the order listed. + If the second argument is one of the binary conditional + operators listed above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the + result of the expression is the result of the binary test + using the first and third arguments as operands. The --aa + and --oo operators are considered binary operators when + there are three arguments. If the first argument is !!, + the value is the negation of the two-argument test using + the second and third arguments. If the first argument is + exactly (( and the third argument is exactly )), the result + is the one-argument test of the second argument. Other- + wise, the expression is false. + 4 arguments + If the first argument is !!, the result is the negation of + the three-argument expression composed of the remaining + arguments. Otherwise, the expression is parsed and eval- + uated according to precedence using the rules listed + above. + 5 or more arguments + The expression is parsed and evaluated according to + precedence using the rules listed above. + + When used with tteesstt or [[, the << and >> operators sort lexico- + graphically using ASCII ordering. + + ttiimmeess Print the accumulated user and system times for the shell and + for processes run from the shell. The return status is 0. + + ttrraapp [--llpp] [[_a_r_g] _s_i_g_s_p_e_c ...] + The command _a_r_g is to be read and executed when the shell + receives signal(s) _s_i_g_s_p_e_c. If _a_r_g is absent (and there is a + single _s_i_g_s_p_e_c) or --, each specified signal is reset to its + original disposition (the value it had upon entrance to the + shell). If _a_r_g is the null string the signal specified by each + _s_i_g_s_p_e_c is ignored by the shell and by the commands it invokes. + If _a_r_g is not present and --pp has been supplied, then the trap + commands associated with each _s_i_g_s_p_e_c are displayed. If no + arguments are supplied or if only --pp is given, ttrraapp prints the + list of commands associated with each signal. The --ll option + causes the shell to print a list of signal names and their cor- + responding numbers. Each _s_i_g_s_p_e_c is either a signal name + defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names are + case insensitive and the SSIIGG prefix is optional. + + If a _s_i_g_s_p_e_c is EEXXIITT (0) the command _a_r_g is executed on exit + from the shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_r_g is exe- + cuted before every _s_i_m_p_l_e _c_o_m_m_a_n_d, _f_o_r command, _c_a_s_e command, + _s_e_l_e_c_t command, every arithmetic _f_o_r command, and before the + first command executes in a shell function (see SSHHEELLLL GGRRAAMMMMAARR + above). Refer to the description of the eexxttddeebbuugg option to the + sshhoopptt builtin for details of its effect on the DDEEBBUUGG trap. If a + _s_i_g_s_p_e_c is RREETTUURRNN, the command _a_r_g is executed each time a shell + function or a script executed with the .. or ssoouurrccee builtins fin- + ishes executing. + + If a _s_i_g_s_p_e_c is EERRRR, the command _a_r_g is executed whenever a a + pipeline (which may consist of a single simple command), a list, + or a compound command returns a non-zero exit status, subject to + the following conditions. The EERRRR trap is not executed if the + failed command is part of the command list immediately following + a wwhhiillee or uunnttiill keyword, part of the test in an _i_f statement, + part of a command executed in a &&&& or |||| list except the command + following the final &&&& or ||||, any command in a pipeline but the + last, or if the command's return value is being inverted using + !!. These are the same conditions obeyed by the eerrrreexxiitt (--ee) + option. + + Signals ignored upon entry to the shell cannot be trapped or + reset. Trapped signals that are not being ignored are reset to + their original values in a subshell or subshell environment when + one is created. The return status is false if any _s_i_g_s_p_e_c is + invalid; otherwise ttrraapp returns true. + + ttyyppee [--aaffttppPP] _n_a_m_e [_n_a_m_e ...] + With no options, indicate how each _n_a_m_e would be interpreted if + used as a command name. If the --tt option is used, ttyyppee prints a + string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or + _f_i_l_e if _n_a_m_e is an alias, shell reserved word, function, + builtin, or disk file, respectively. If the _n_a_m_e is not found, + then nothing is printed, and an exit status of false is + returned. If the --pp option is used, ttyyppee either returns the + name of the disk file that would be executed if _n_a_m_e were speci- + fied as a command name, or nothing if ``type -t name'' would not + return _f_i_l_e. The --PP option forces a PPAATTHH search for each _n_a_m_e, + even if ``type -t name'' would not return _f_i_l_e. If a command is + hashed, --pp and --PP print the hashed value, which is not necessar- + ily the file that appears first in PPAATTHH. If the --aa option is + used, ttyyppee prints all of the places that contain an executable + named _n_a_m_e. This includes aliases and functions, if and only if + the --pp option is not also used. The table of hashed commands is + not consulted when using --aa. The --ff option suppresses shell + function lookup, as with the ccoommmmaanndd builtin. ttyyppee returns true + if all of the arguments are found, false if any are not found. + + uulliimmiitt [--HHSSTTaabbccddeeffiillmmnnppqqrrssttuuvvxx [_l_i_m_i_t]] + Provides control over the resources available to the shell and + to processes started by it, on systems that allow such control. + The --HH and --SS options specify that the hard or soft limit is set + for the given resource. A hard limit cannot be increased by a + non-root user once it is set; a soft limit may be increased up + to the value of the hard limit. If neither --HH nor --SS is speci- + fied, both the soft and hard limits are set. The value of _l_i_m_i_t + can be a number in the unit specified for the resource or one of + the special values hhaarrdd, ssoofftt, or uunnlliimmiitteedd, which stand for the + current hard limit, the current soft limit, and no limit, + respectively. If _l_i_m_i_t is omitted, the current value of the + soft limit of the resource is printed, unless the --HH option is + given. When more than one resource is specified, the limit name + and unit are printed before the value. Other options are inter- + preted as follows: + --aa All current limits are reported + --bb The maximum socket buffer size + --cc The maximum size of core files created + --dd The maximum size of a process's data segment + --ee The maximum scheduling priority ("nice") + --ff The maximum size of files written by the shell and its + children + --ii The maximum number of pending signals + --ll The maximum size that may be locked into memory + --mm The maximum resident set size (many systems do not honor + this limit) + --nn The maximum number of open file descriptors (most systems + do not allow this value to be set) + --pp The pipe size in 512-byte blocks (this may not be set) + --qq The maximum number of bytes in POSIX message queues + --rr The maximum real-time scheduling priority + --ss The maximum stack size + --tt The maximum amount of cpu time in seconds + --uu The maximum number of processes available to a single + user + --vv The maximum amount of virtual memory available to the + shell and, on some systems, to its children + --xx The maximum number of file locks + --TT The maximum number of threads + + If _l_i_m_i_t is given, and the --aa option is not used, _l_i_m_i_t is the + new value of the specified resource. If no option is given, + then --ff is assumed. Values are in 1024-byte increments, except + for --tt, which is in seconds; --pp, which is in units of 512-byte + blocks; and --TT, --bb, --nn, and --uu, which are unscaled values. The + return status is 0 unless an invalid option or argument is sup- + plied, or an error occurs while setting a new limit. + + uummaasskk [--pp] [--SS] [_m_o_d_e] + The user file-creation mask is set to _m_o_d_e. If _m_o_d_e begins with + a digit, it is interpreted as an octal number; otherwise it is + interpreted as a symbolic mode mask similar to that accepted by + _c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is + printed. The --SS option causes the mask to be printed in sym- + bolic form; the default output is an octal number. If the --pp + option is supplied, and _m_o_d_e is omitted, the output is in a form + that may be reused as input. The return status is 0 if the mode + was successfully changed or if no _m_o_d_e argument was supplied, + and false otherwise. + + uunnaalliiaass [-aa] [_n_a_m_e ...] + Remove each _n_a_m_e from the list of defined aliases. If --aa is + supplied, all alias definitions are removed. The return value + is true unless a supplied _n_a_m_e is not a defined alias. + + uunnsseett [-ffvv] [-nn] [_n_a_m_e ...] + For each _n_a_m_e, remove the corresponding variable or function. + If the --vv option is given, each _n_a_m_e refers to a shell variable, + and that variable is removed. Read-only variables may not be + unset. If --ff is specified, each _n_a_m_e refers to a shell func- + tion, and the function definition is removed. If the --nn option + is supplied, and _n_a_m_e is a variable with the _n_a_m_e_r_e_f attribute, + _n_a_m_e will be unset rather than the variable it references. --nn + has no effect if the --ff option is supplied. If no options are + supplied, each _n_a_m_e refers to a variable; if there is no vari- + able by that name, any function with that name is unset. Each + unset variable or function is removed from the environment + passed to subsequent commands. If any of CCOOMMPP__WWOORRDDBBRREEAAKKSS, RRAANN-- + DDOOMM, SSEECCOONNDDSS, LLIINNEENNOO, HHIISSTTCCMMDD, FFUUNNCCNNAAMMEE, GGRROOUUPPSS, or DDIIRRSSTTAACCKK are + unset, they lose their special properties, even if they are sub- + sequently reset. The exit status is true unless a _n_a_m_e is read- + only. + + wwaaiitt [--nn] [_n _._._.] + Wait for each specified child process and return its termination + status. Each _n may be a process ID or a job specification; if a + job spec is given, all processes in that job's pipeline are + waited for. If _n is not given, all currently active child pro- + cesses are waited for, and the return status is zero. If the --nn + option is supplied, wwaaiitt waits for any job to terminate and + returns its exit status. If _n specifies a non-existent process + or job, the return status is 127. Otherwise, the return status + is the exit status of the last process or job waited for. + +SSEEEE AALLSSOO + bash(1), sh(1) + + + +GNU Bash-4.2 2004 Apr 20 BASH_BUILTINS(1) diff --git a/doc/builtins.1 b/doc/builtins.1 new file mode 100644 index 0000000..829a49c --- /dev/null +++ b/doc/builtins.1 @@ -0,0 +1,24 @@ +.\" This is a hack to force bash builtins into the whatis database +.\" and to get the list of builtins to come up with the man command. +.\" +.\" File Name macro. This used to be `.PN', for Path Name, +.\" but Sun doesn't seem to like that very much. +.\" +.de FN +\fI\|\\$1\|\fP +.. +.TH BASH_BUILTINS 1 "2004 Apr 20" "GNU Bash-4.2" +.SH NAME +bash, :, ., [, alias, bg, bind, break, builtin, caller, +cd, command, compgen, complete, +compopt, continue, declare, dirs, disown, echo, enable, eval, exec, exit, +export, false, fc, fg, getopts, hash, help, history, jobs, kill, +let, local, logout, mapfile, popd, printf, pushd, pwd, read, +readonly, return, set, +shift, shopt, source, suspend, test, times, trap, true, type, typeset, +ulimit, umask, unalias, unset, wait \- bash built-in commands, see \fBbash\fR(1) +.SH BASH BUILTIN COMMANDS +.nr zZ 1 +.so bash.1 +.SH SEE ALSO +bash(1), sh(1) diff --git a/doc/builtins.ps b/doc/builtins.ps new file mode 100644 index 0000000..5d49778 --- /dev/null +++ b/doc/builtins.ps @@ -0,0 +1,2910 @@ +%!PS-Adobe-3.0 +%%Creator: groff version 1.19.2 +%%CreationDate: Mon Feb 24 08:28:31 2014 +%%DocumentNeededResources: font Times-Roman +%%+ font Times-Bold +%%+ font Times-Italic +%%+ font Symbol +%%+ font Courier +%%DocumentSuppliedResources: procset grops 1.19 2 +%%Pages: 23 +%%PageOrder: Ascend +%%DocumentMedia: Default 612 792 0 () () +%%Orientation: Portrait +%%EndComments +%%BeginDefaults +%%PageMedia: Default +%%EndDefaults +%%BeginProlog +%%BeginResource: procset grops 1.19 2 +%!PS-Adobe-3.0 Resource-ProcSet +/setpacking where{ +pop +currentpacking +true setpacking +}if +/grops 120 dict dup begin +/SC 32 def +/A/show load def +/B{0 SC 3 -1 roll widthshow}bind def +/C{0 exch ashow}bind def +/D{0 exch 0 SC 5 2 roll awidthshow}bind def +/E{0 rmoveto show}bind def +/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def +/G{0 rmoveto 0 exch ashow}bind def +/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/I{0 exch rmoveto show}bind def +/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def +/K{0 exch rmoveto 0 exch ashow}bind def +/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/M{rmoveto show}bind def +/N{rmoveto 0 SC 3 -1 roll widthshow}bind def +/O{rmoveto 0 exch ashow}bind def +/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/Q{moveto show}bind def +/R{moveto 0 SC 3 -1 roll widthshow}bind def +/S{moveto 0 exch ashow}bind def +/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/SF{ +findfont exch +[exch dup 0 exch 0 exch neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/MF{ +findfont +[5 2 roll +0 3 1 roll +neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/level0 0 def +/RES 0 def +/PL 0 def +/LS 0 def +/MANUAL{ +statusdict begin/manualfeed true store end +}bind def +/PLG{ +gsave newpath clippath pathbbox grestore +exch pop add exch pop +}bind def +/BP{ +/level0 save def +1 setlinecap +1 setlinejoin +72 RES div dup scale +LS{ +90 rotate +}{ +0 PL translate +}ifelse +1 -1 scale +}bind def +/EP{ +level0 restore +showpage +}def +/DA{ +newpath arcn stroke +}bind def +/SN{ +transform +.25 sub exch .25 sub exch +round .25 add exch round .25 add exch +itransform +}bind def +/DL{ +SN +moveto +SN +lineto stroke +}bind def +/DC{ +newpath 0 360 arc closepath +}bind def +/TM matrix def +/DE{ +TM currentmatrix pop +translate scale newpath 0 0 .5 0 360 arc closepath +TM setmatrix +}bind def +/RC/rcurveto load def +/RL/rlineto load def +/ST/stroke load def +/MT/moveto load def +/CL/closepath load def +/Fr{ +setrgbcolor fill +}bind def +/setcmykcolor where{ +pop +/Fk{ +setcmykcolor fill +}bind def +}if +/Fg{ +setgray fill +}bind def +/FL/fill load def +/LW/setlinewidth load def +/Cr/setrgbcolor load def +/setcmykcolor where{ +pop +/Ck/setcmykcolor load def +}if +/Cg/setgray load def +/RE{ +findfont +dup maxlength 1 index/FontName known not{1 add}if dict begin +{ +1 index/FID ne{def}{pop pop}ifelse +}forall +/Encoding exch def +dup/FontName exch def +currentdict end definefont pop +}bind def +/DEFS 0 def +/EBEGIN{ +moveto +DEFS begin +}bind def +/EEND/end load def +/CNT 0 def +/level1 0 def +/PBEGIN{ +/level1 save def +translate +div 3 1 roll div exch scale +neg exch neg exch translate +0 setgray +0 setlinecap +1 setlinewidth +0 setlinejoin +10 setmiterlimit +[]0 setdash +/setstrokeadjust where{ +pop +false setstrokeadjust +}if +/setoverprint where{ +pop +false setoverprint +}if +newpath +/CNT countdictstack def +userdict begin +/showpage{}def +/setpagedevice{}def +}bind def +/PEND{ +countdictstack CNT sub{end}repeat +level1 restore +}bind def +end def +/setpacking where{ +pop +setpacking +}if +%%EndResource +%%EndProlog +%%BeginSetup +%%BeginFeature: *PageSize Default +<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice +%%EndFeature +%%IncludeResource: font Times-Roman +%%IncludeResource: font Times-Bold +%%IncludeResource: font Times-Italic +%%IncludeResource: font Symbol +%%IncludeResource: font Courier +grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 +def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron +/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent +/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen +/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon +/semicolon/less/equal/greater/question/at/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/bracketleft/backslash/bracketright/circumflex +/underscore/quoteleft/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/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft +/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl +/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut +/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash +/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen +/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft +/logicalnot/minus/registered/macron/degree/plusminus/twosuperior +/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior +/ordmasculine/guilsinglright/onequarter/onehalf/threequarters +/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE +/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex +/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis +/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn +/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla +/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis +/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash +/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def +/Courier@0 ENC0/Courier RE/Times-Italic@0 ENC0/Times-Italic RE +/Times-Bold@0 ENC0/Times-Bold RE/Times-Roman@0 ENC0/Times-Roman RE +%%EndSetup +%%Page: 1 1 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10.95 +/Times-Bold@0 SF -.219(NA)72 84 S(ME).219 E F0 1.325 +(bash, :, ., [, alias, bg, bind, break, b)108 96 R 1.325(uiltin, caller) +-.2 F 3.825(,c)-.4 G 1.324 +(d, command, compgen, complete, compopt, continue,)-3.825 F .903 +(declare, dirs, diso)108 108 R .903(wn, echo, enable, e)-.25 F -.25(va) +-.25 G .904(l, e).25 F -.15(xe)-.15 G .904(c, e).15 F .904(xit, e)-.15 F +.904(xport, f)-.15 F .904(alse, fc, fg, getopts, hash, help, history)-.1 +F 3.404(,j)-.65 G(obs,)-3.404 E .133(kill, let, local, logout, map\214l\ +e, popd, printf, pushd, pwd, read, readonly)108 120 R 2.633(,r)-.65 G +.133(eturn, set, shift, shopt, source, sus-)-2.633 F .279(pend, test, t\ +imes, trap, true, type, typeset, ulimit, umask, unalias, unset, w)108 +132 R .279(ait \255 bash b)-.1 F .279(uilt-in commands, see)-.2 F/F2 10 +/Times-Bold@0 SF(bash)108 144 Q F0(\(1\))A F1 -.329(BA)72 160.8 S(SH B) +.329 E(UIL)-.11 E(TIN COMMANDS)-1.007 E F0 .063 +(Unless otherwise noted, each b)108 172.8 R .062(uiltin command documen\ +ted in this section as accepting options preceded by)-.2 F F2108 +184.8 Q F0(accepts)2.533 E F22.533 E F0 .034 +(to signify the end of the options.)2.533 F(The)5.034 E F2(:)2.534 E F0 +(,)A F2(true)2.534 E F0(,)A F2(false)2.534 E F0 2.534(,a)C(nd)-2.534 E +F2(test)2.534 E F0 -.2(bu)2.534 G .034(iltins do not accept options and) +.2 F .078(do not treat)108 196.8 R F22.577 E F0(specially)2.577 E +5.077(.T)-.65 G(he)-5.077 E F2(exit)2.577 E F0(,)A F2(logout)2.577 E F0 +(,)A F2(br)2.577 E(eak)-.18 E F0(,)A F2(continue)2.577 E F0(,)A F2(let) +2.577 E F0 2.577(,a)C(nd)-2.577 E F2(shift)2.577 E F0 -.2(bu)2.577 G +.077(iltins accept and process ar).2 F(gu-)-.18 E .319(ments be)108 +208.8 R .319(ginning with)-.15 F F22.819 E F0 .319 +(without requiring)2.819 F F22.819 E F0 5.319(.O)C .319(ther b) +-5.319 F .319(uiltins that accept ar)-.2 F .32(guments b)-.18 F .32 +(ut are not speci\214ed as)-.2 F 1.144(accepting options interpret ar) +108 220.8 R 1.144(guments be)-.18 F 1.144(ginning with)-.15 F F2 +3.643 E F0 1.143(as in)3.643 F -.25(va)-.4 G 1.143 +(lid options and require).25 F F23.643 E F0 1.143(to pre)3.643 F +-.15(ve)-.25 G 1.143(nt this).15 F(interpretation.)108 232.8 Q F2(:)108 +250.8 Q F0([)2.5 E/F3 10/Times-Italic@0 SF(ar)A(guments)-.37 E F0(])A +.451(No ef)144 262.8 R .451(fect; the command does nothing be)-.25 F +.452(yond e)-.15 F(xpanding)-.15 E F3(ar)3.282 E(guments)-.37 E F0 .452 +(and performing an)3.222 F 2.952(ys)-.15 G(peci\214ed)-2.952 E 2.5 +(redirections. A)144 274.8 R(zero e)2.5 E(xit code is returned.)-.15 E +F2(.)110.5 291.6 Q F3(\214lename)6.666 E F0([)2.5 E F3(ar)A(guments)-.37 +E F0(])A F2(sour)108 303.6 Q(ce)-.18 E F3(\214lename)2.5 E F0([)2.5 E F3 +(ar)A(guments)-.37 E F0(])A 1.02(Read and e)144 315.6 R -.15(xe)-.15 G +1.02(cute commands from).15 F F3(\214lename)5.43 E F0 1.02 +(in the current shell en)3.7 F 1.02(vironment and return the e)-.4 F +(xit)-.15 E 1.458(status of the last command e)144 327.6 R -.15(xe)-.15 +G 1.458(cuted from).15 F F3(\214lename)3.958 E F0 6.458(.I).18 G(f) +-6.458 E F3(\214lename)5.868 E F0 1.458 +(does not contain a slash, \214le-)4.138 F .608(names in)144 339.6 R/F4 +9/Times-Bold@0 SF -.666(PA)3.108 G(TH)-.189 E F0 .608 +(are used to \214nd the directory containing)2.858 F F3(\214lename)3.108 +E F0 5.608(.T).18 G .608(he \214le searched for in)-5.608 F F4 -.666(PA) +3.108 G(TH)-.189 E F0 .832(need not be e)144 351.6 R -.15(xe)-.15 G +3.332(cutable. When).15 F F2(bash)3.332 E F0 .832(is not in)3.332 F F3 +.832(posix mode)3.332 F F0 3.332(,t)C .833 +(he current directory is searched if no)-3.332 F .982 +(\214le is found in)144 363.6 R F4 -.666(PA)3.481 G(TH)-.189 E/F5 9 +/Times-Roman@0 SF(.)A F0 .981(If the)5.481 F F2(sour)3.481 E(cepath)-.18 +E F0 .981(option to the)3.481 F F2(shopt)3.481 E F0 -.2(bu)3.481 G .981 +(iltin command is turned of).2 F .981(f, the)-.25 F F4 -.666(PA)144 +375.6 S(TH)-.189 E F0 .112(is not searched.)2.362 F .112(If an)5.112 F +(y)-.15 E F3(ar)2.612 E(guments)-.37 E F0 .112(are supplied, the)2.612 F +2.612(yb)-.15 G .112(ecome the positional parameters when)-2.612 F F3 +(\214lename)144 387.6 Q F0 .342(is e)2.842 F -.15(xe)-.15 G 2.842 +(cuted. Otherwise).15 F .342(the positional parameters are unchanged.) +2.842 F .341(The return status is the)5.341 F .716 +(status of the last command e)144 399.6 R .716 +(xited within the script \(0 if no commands are e)-.15 F -.15(xe)-.15 G +.716(cuted\), and f).15 F .716(alse if)-.1 F F3(\214lename)145.91 411.6 +Q F0(is not found or cannot be read.)2.68 E F2(alias)108 428.4 Q F0([) +2.5 E F2A F0 2.5(][)C F3(name)-2.5 E F0([=)A F3(value)A F0 2.5(].) +C(..])-2.5 E F2(Alias)144 440.4 Q F0 2.725(with no ar)5.225 F 2.724 +(guments or with the)-.18 F F25.224 E F0 2.724 +(option prints the list of aliases in the form)5.224 F F2(alias)5.224 E +F3(name)144 452.4 Q F0(=)A F3(value)A F0 .58(on standard output.)3.08 F +.58(When ar)5.58 F .58 +(guments are supplied, an alias is de\214ned for each)-.18 F F3(name) +3.08 E F0(whose)144 464.4 Q F3(value)2.895 E F0 .395(is gi)2.895 F -.15 +(ve)-.25 G 2.895(n. A).15 F .395(trailing space in)2.895 F F3(value) +5.395 E F0 .395(causes the ne)2.895 F .395(xt w)-.15 F .395 +(ord to be check)-.1 F .395(ed for alias sub-)-.1 F .054 +(stitution when the alias is e)144 476.4 R 2.554(xpanded. F)-.15 F .054 +(or each)-.15 F F3(name)2.554 E F0 .054(in the ar)2.554 F .054 +(gument list for which no)-.18 F F3(value)2.554 E F0 .054(is sup-)2.554 +F 1.314(plied, the name and v)144 488.4 R 1.314 +(alue of the alias is printed.)-.25 F F2(Alias)6.314 E F0 1.314 +(returns true unless a)3.814 F F3(name)3.814 E F0 1.313(is gi)3.814 F +-.15(ve)-.25 G 3.813(nf).15 G(or)-3.813 E +(which no alias has been de\214ned.)144 500.4 Q F2(bg)108 517.2 Q F0([) +2.5 E F3(jobspec)A F0(...])2.5 E .744(Resume each suspended job)144 +529.2 R F3(jobspec)3.244 E F0 .745 +(in the background, as if it had been started with)3.244 F F2(&)3.245 E +F0 5.745(.I)C(f)-5.745 E F3(job-)4.985 E(spec)144 541.2 Q F0 .672 +(is not present, the shell')3.482 F 3.172(sn)-.55 G .672(otion of the) +-3.172 F F3(curr)3.172 E .672(ent job)-.37 F F0 .672(is used.)3.172 F F2 +(bg)5.671 E F3(jobspec)4.911 E F0 .671(returns 0 unless run)3.481 F .418 +(when job control is disabled or)144 553.2 R 2.919(,w)-.4 G .419 +(hen run with job control enabled, an)-2.919 F 2.919(ys)-.15 G +(peci\214ed)-2.919 E F3(jobspec)2.919 E F0 -.1(wa)2.919 G 2.919(sn).1 G +(ot)-2.919 E(found or w)144 565.2 Q(as started without job control.)-.1 +E F2(bind)108 582 Q F0([)2.5 E F2A F3 -.1(ke)2.5 G(ymap)-.2 E F0 +2.5(][)C F2(\255lpsvPSVX)-2.5 E F0(])A F2(bind)108 594 Q F0([)2.5 E F2 +A F3 -.1(ke)2.5 G(ymap)-.2 E F0 2.5(][)C F2-2.5 E F3 +(function)2.5 E F0 2.5(][)C F2-2.5 E F3(function)2.5 E F0 2.5(][)C +F2-2.5 E F3 -.1(ke)2.5 G(yseq)-.2 E F0(])A F2(bind)108 606 Q F0([) +2.5 E F2A F3 -.1(ke)2.5 G(ymap)-.2 E F0(])A F22.5 E F3 +(\214lename)2.5 E F2(bind)108 618 Q F0([)2.5 E F2A F3 -.1(ke)2.5 G +(ymap)-.2 E F0(])A F22.5 E F3 -.1(ke)2.5 G(yseq)-.2 E F0(:)A F3 +(shell\255command)A F2(bind)108 630 Q F0([)2.5 E F2A F3 -.1(ke)2.5 +G(ymap)-.2 E F0(])A F3 -.1(ke)2.5 G(yseq)-.2 E F0(:)A F3 +(function\255name)A F2(bind)108 642 Q F3 -.37(re)2.5 G +(adline\255command).37 E F0 .239(Display current)144 654 R F2 -.18(re) +2.739 G(adline).18 E F0 -.1(ke)2.739 G 2.739(ya)-.05 G .239 +(nd function bindings, bind a k)-2.739 F .539 -.15(ey s)-.1 H .238 +(equence to a).15 F F2 -.18(re)2.738 G(adline).18 E F0 .238(function or) +2.738 F .475(macro, or set a)144 666 R F2 -.18(re)2.975 G(adline).18 E +F0 -.25(va)2.975 G 2.975(riable. Each).25 F .476(non-option ar)2.976 F +.476(gument is a command as it w)-.18 F .476(ould appear in)-.1 F F3 +(.inputr)144 678 Q(c)-.37 E F0 2.984(,b).31 G .484 +(ut each binding or command must be passed as a separate ar)-3.184 F +.483(gument; e.g., '"\\C\255x\\C\255r":)-.18 F 2.5 +(re\255read\255init\255\214le'. Options,)144 690 R(if supplied, ha)2.5 E +.3 -.15(ve t)-.2 H(he follo).15 E(wing meanings:)-.25 E F2144 702 +Q F3 -.1(ke)2.5 G(ymap)-.2 E F0(Use)180 714 Q F3 -.1(ke)5.158 G(ymap)-.2 +E F0 2.658(as the k)5.348 F -.15(ey)-.1 G 2.658(map to be af).15 F 2.659 +(fected by the subsequent bindings.)-.25 F(Acceptable)7.659 E F3 -.1(ke) +180 726 S(ymap)-.2 E F0 3.193(names are)5.883 F F3 3.193 +(emacs, emacs\255standar)5.693 F 3.192 +(d, emacs\255meta, emacs\255ctlx, vi, vi\255mo)-.37 F(ve)-.1 E(,)-.1 E +F0(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(1)203.725 E 0 Cg EP +%%Page: 2 2 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Italic@0 SF(vi\255command)180 84 Q F0 4.429(,a)C(nd)-4.429 E F1 +(vi\255insert)4.429 E F0(.).68 E F1(vi)6.929 E F0 1.929(is equi)4.429 F +-.25(va)-.25 G 1.929(lent to).25 F F1(vi\255command)4.429 E F0(;)A F1 +(emacs)4.429 E F0 1.929(is equi)4.429 F -.25(va)-.25 G 1.93(lent to).25 +F F1(emacs\255standar)180 96 Q(d)-.37 E F0(.)A/F2 10/Times-Bold@0 SF +144 108 Q F0(List the names of all)27.52 E F2 -.18(re)2.5 G +(adline).18 E F0(functions.)2.5 E F2144 120 Q F0(Display)24.74 E +F2 -.18(re)2.5 G(adline).18 E F0 +(function names and bindings in such a w)2.5 E(ay that the)-.1 E 2.5(yc) +-.15 G(an be re-read.)-2.5 E F2144 132 Q F0(List current)24.19 E +F2 -.18(re)2.5 G(adline).18 E F0(function names and bindings.)2.5 E F2 +144 144 Q F0(Display)26.41 E F2 -.18(re)3.655 G(adline).18 E F0 +-.1(ke)3.655 G 3.655(ys)-.05 G 1.155 +(equences bound to macros and the strings the)-3.655 F 3.655(yo)-.15 G +1.155(utput in such a)-3.655 F -.1(wa)180 156 S 2.5(yt).1 G(hat the)-2.5 +E 2.5(yc)-.15 G(an be re-read.)-2.5 E F2144 168 Q F0(Display)24.74 +E F2 -.18(re)2.5 G(adline).18 E F0 -.1(ke)2.5 G 2.5(ys)-.05 G +(equences bound to macros and the strings the)-2.5 E 2.5(yo)-.15 G +(utput.)-2.5 E F2144 180 Q F0(Display)25.3 E F2 -.18(re)2.5 G +(adline).18 E F0 -.25(va)2.5 G(riable names and v).25 E +(alues in such a w)-.25 E(ay that the)-.1 E 2.5(yc)-.15 G +(an be re-read.)-2.5 E F2144 192 Q F0(List current)23.08 E F2 -.18 +(re)2.5 G(adline).18 E F0 -.25(va)2.5 G(riable names and v).25 E(alues.) +-.25 E F2144 204 Q F1(\214lename)2.5 E F0(Read k)180 216 Q .3 -.15 +(ey b)-.1 H(indings from).15 E F1(\214lename)2.5 E F0(.)A F2144 +228 Q F1(function)2.5 E F0(Query about which k)180 240 Q -.15(ey)-.1 G +2.5(si).15 G -1.9 -.4(nv o)-2.5 H .2 -.1(ke t).4 H(he named).1 E F1 +(function)2.5 E F0(.)A F2144 252 Q F1(function)2.5 E F0 +(Unbind all k)180 264 Q -.15(ey)-.1 G 2.5(sb).15 G(ound to the named) +-2.5 E F1(function)2.5 E F0(.)A F2144 276 Q F1 -.1(ke)2.5 G(yseq) +-.2 E F0(Remo)180 288 Q .3 -.15(ve a)-.15 H .3 -.15(ny c).15 H +(urrent binding for).15 E F1 -.1(ke)2.5 G(yseq)-.2 E F0(.)A F2144 +300 Q F1 -.1(ke)2.5 G(yseq)-.2 E F2(:)A F1(shell\255command)A F0(Cause) +180 312 Q F1(shell\255command)4.325 E F0 1.825(to be e)4.325 F -.15(xe) +-.15 G 1.825(cuted whene).15 F -.15(ve)-.25 G(r).15 E F1 -.1(ke)4.325 G +(yseq)-.2 E F0 1.825(is entered.)4.325 F(When)6.825 E F1(shell\255com-) +4.325 E(mand)180 324 Q F0 1.765(is e)4.265 F -.15(xe)-.15 G 1.765 +(cuted, the shell sets the).15 F/F3 9/Times-Bold@0 SF(READLINE_LINE) +4.265 E F0 -.25(va)4.015 G 1.765(riable to the contents of the).25 F F2 +-.18(re)180 336 S(adline).18 E F0 1.353(line b)3.852 F(uf)-.2 E 1.353 +(fer and the)-.25 F F3(READLINE_POINT)3.853 E F0 -.25(va)3.603 G 1.353 +(riable to the current location of the).25 F 2.012(insertion point.)180 +348 R 2.011(If the e)7.012 F -.15(xe)-.15 G 2.011 +(cuted command changes the v).15 F 2.011(alue of)-.25 F F3 +(READLINE_LINE)4.511 E F0(or)4.261 E F3(READLINE_POINT)180 360 Q/F4 9 +/Times-Roman@0 SF(,)A F0(those ne)2.25 E 2.5(wv)-.25 G +(alues will be re\215ected in the editing state.)-2.75 E F2144 372 +Q F0 .829(List all k)23.08 F 1.129 -.15(ey s)-.1 H .829 +(equences bound to shell commands and the associated commands in a for) +.15 F(-)-.2 E(mat that can be reused as input.)180 384 Q(The return v) +144 400.8 Q(alue is 0 unless an unrecognized option is gi)-.25 E -.15 +(ve)-.25 G 2.5(no).15 G 2.5(ra)-2.5 G 2.5(ne)-2.5 G(rror occurred.)-2.5 +E F2(br)108 417.6 Q(eak)-.18 E F0([)2.5 E F1(n)A F0(])A .055 +(Exit from within a)144 429.6 R F2 -.25(fo)2.555 G(r).25 E F0(,)A F2 +(while)2.555 E F0(,)A F2(until)2.555 E F0 2.555(,o)C(r)-2.555 E F2 +(select)2.555 E F0 2.555(loop. If)2.555 F F1(n)2.555 E F0 .055 +(is speci\214ed, break)2.555 F F1(n)2.555 E F0(le)2.555 E -.15(ve)-.25 G +(ls.).15 E F1(n)5.414 E F0 .054(must be)2.794 F/F5 10/Symbol SF2.554 +E F0(1.)2.554 E(If)144 441.6 Q F1(n)3.074 E F0 .215(is greater than the\ + number of enclosing loops, all enclosing loops are e)2.954 F 2.715 +(xited. The)-.15 F .215(return v)2.715 F(alue)-.25 E(is 0 unless)144 +453.6 Q F1(n)2.5 E F0(is not greater than or equal to 1.)2.5 E F2 -.2 +(bu)108 470.4 S(iltin).2 E F1(shell\255b)2.5 E(uiltin)-.2 E F0([)2.5 E +F1(ar)A(guments)-.37 E F0(])A(Ex)144 482.4 Q .793 +(ecute the speci\214ed shell b)-.15 F .793(uiltin, passing it)-.2 F F1 +(ar)3.293 E(guments)-.37 E F0 3.293(,a).27 G .793(nd return its e)-3.293 +F .792(xit status.)-.15 F .792(This is useful)5.792 F .615 +(when de\214ning a function whose name is the same as a shell b)144 +494.4 R .616(uiltin, retaining the functionality of)-.2 F .57(the b)144 +506.4 R .57(uiltin within the function.)-.2 F(The)5.57 E F2(cd)3.07 E F0 +-.2(bu)3.07 G .57(iltin is commonly rede\214ned this w).2 F(ay)-.1 E +5.57(.T)-.65 G .57(he return status)-5.57 F(is f)144 518.4 Q(alse if)-.1 +E F1(shell\255b)2.84 E(uiltin)-.2 E F0(is not a shell b)2.74 E +(uiltin command.)-.2 E F2(caller)108 535.2 Q F0([)2.5 E F1 -.2(ex)C(pr) +.2 E F0(])A .253(Returns the conte)144 547.2 R .254(xt of an)-.15 F +2.754(ya)-.15 G(cti)-2.754 E .554 -.15(ve s)-.25 H .254 +(ubroutine call \(a shell function or a script e).15 F -.15(xe)-.15 G +.254(cuted with the).15 F F2(.)2.754 E F0(or)2.754 E F2(sour)144 559.2 Q +(ce)-.18 E F0 -.2(bu)2.825 G 2.825(iltins\). W).2 F(ithout)-.4 E F1 -.2 +(ex)2.825 G(pr).2 E F0(,)A F2(caller)2.825 E F0 .324 +(displays the line number and source \214lename of the current)2.824 F +.253(subroutine call.)144 571.2 R .253(If a non-ne)5.253 F -.05(ga)-.15 +G(ti).05 E .553 -.15(ve i)-.25 H(nte).15 E .253(ger is supplied as)-.15 +F F1 -.2(ex)2.753 G(pr).2 E F0(,)A F2(caller)2.753 E F0 .254 +(displays the line number)2.754 F 2.754(,s)-.4 G(ub-)-2.754 E 1.327(rou\ +tine name, and source \214le corresponding to that position in the curr\ +ent e)144 583.2 R -.15(xe)-.15 G 1.327(cution call stack.).15 F(This e) +144 595.2 Q(xtra information may be used, for e)-.15 E .001 +(xample, to print a stack trace.)-.15 F .001(The current frame is frame) +5.001 F 3.02(0. The)144 607.2 R .52(return v)3.02 F .52 +(alue is 0 unless the shell is not e)-.25 F -.15(xe)-.15 G .519 +(cuting a subroutine call or).15 F F1 -.2(ex)3.019 G(pr).2 E F0 .519 +(does not corre-)3.019 F(spond to a v)144 619.2 Q +(alid position in the call stack.)-.25 E F2(cd)108 636 Q F0([)2.5 E F2 +A F0(|[)A F2A F0([)2.5 E F2A F0(]] [\255@]] [)A F1 +(dir)A F0(])A .321(Change the current directory to)144 648 R F1(dir) +2.821 E F0 5.321(.i)C(f)-5.321 E F1(dir)2.821 E F0 .322 +(is not supplied, the v)2.821 F .322(alue of the)-.25 F F3(HOME)2.822 E +F0 .322(shell v)2.572 F .322(ariable is)-.25 F 1.036(the def)144 660 R +3.536(ault. An)-.1 F 3.536(ya)-.15 G 1.035(dditional ar)-3.536 F 1.035 +(guments follo)-.18 F(wing)-.25 E F1(dir)3.535 E F0 1.035(are ignored.) +3.535 F 1.035(The v)6.035 F(ariable)-.25 E F3(CDP)3.535 E -.855(AT)-.666 +G(H).855 E F0(de\214nes)3.285 E .849 +(the search path for the directory containing)144 672 R F1(dir)3.349 E +F0 3.35(:e).73 G .85(ach directory name in)-3.35 F F3(CDP)3.35 E -.855 +(AT)-.666 G(H).855 E F0 .85(is searched for)3.1 F F1(dir)144 684 Q F0 +5.665(.A)C(lternati)-5.665 E .965 -.15(ve d)-.25 H .665 +(irectory names in).15 F F3(CDP)3.165 E -.855(AT)-.666 G(H).855 E F0 +.665(are separated by a colon \(:\).)2.915 F 3.165(An)5.665 G .664 +(ull directory name)-3.165 F(in)144 696 Q F3(CDP)4.162 E -.855(AT)-.666 +G(H).855 E F0 1.662(is the same as the current directory)3.912 F 4.162 +(,i)-.65 G 1.662(.e., `)-4.162 F(`)-.74 E F2(.)A F0 -.74('')C 6.662(.I) +.74 G(f)-6.662 E F1(dir)4.513 E F0(be)4.893 E 1.663 +(gins with a slash \(/\), then)-.15 F F3(CDP)144 708 Q -.855(AT)-.666 G +(H).855 E F0 .347(is not used. The)2.598 F F22.847 E F0 .347 +(option causes)2.847 F F2(cd)2.847 E F0 .347(to use the ph)2.847 F .347 +(ysical directory structure by resolving)-.05 F 1.12 +(symbolic links while tra)144 720 R -.15(ve)-.2 G(rsing).15 E F1(dir) +3.62 E F0 1.12(and before processing instances of)3.62 F F1(..)3.62 E F0 +(in)3.62 E F1(dir)3.62 E F0 1.12(\(see also the)3.62 F F23.62 E F0 +(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(2)203.725 E 0 Cg EP +%%Page: 3 3 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E .395 +(option to the)144 84 R/F1 10/Times-Bold@0 SF(set)2.895 E F0 -.2(bu) +2.895 G .395(iltin command\); the).2 F F12.895 E F0 .395 +(option forces symbolic links to be follo)2.895 F .395(wed by resolv-) +-.25 F .443(ing the link after processing instances of)144 96 R/F2 10 +/Times-Italic@0 SF(..)2.943 E F0(in)2.943 E F2(dir)2.943 E F0 5.443(.I)C +(f)-5.443 E F2(..)2.943 E F0 .443(appears in)2.943 F F2(dir)2.943 E F0 +2.943(,i)C 2.943(ti)-2.943 G 2.944(sp)-2.943 G .444(rocessed by remo) +-2.944 F(ving)-.15 E .744(the immediately pre)144 108 R .744 +(vious pathname component from)-.25 F F2(dir)3.244 E F0 3.244(,b)C .744 +(ack to a slash or the be)-3.244 F .744(ginning of)-.15 F F2(dir)3.244 E +F0(.)A 1.465(If the)144 120 R F13.965 E F0 1.465 +(option is supplied with)3.965 F F13.965 E F0 3.965(,a)C 1.465 +(nd the current w)-3.965 F 1.466 +(orking directory cannot be successfully)-.1 F .468 +(determined after a successful directory change,)144 132 R F1(cd)2.968 E +F0 .468(will return an unsuccessful status.)2.968 F .467(On systems) +5.467 F .336(that support it, the)144 144 R F12.836 E F0 .336 +(option presents the e)2.836 F .336(xtended attrib)-.15 F .337 +(utes associated with a \214le as a directory)-.2 F(.)-.65 E .71(An ar) +144 156 R .71(gument of)-.18 F F13.21 E F0 .71(is con)3.21 F -.15 +(ve)-.4 G .71(rted to).15 F/F3 9/Times-Bold@0 SF($OLDPWD)3.21 E F0 .71 +(before the directory change is attempted.)2.96 F .71(If a non-)5.71 F +.106(empty directory name from)144 168 R F3(CDP)2.606 E -.855(AT)-.666 G +(H).855 E F0 .107(is used, or if)2.356 F F12.607 E F0 .107 +(is the \214rst ar)2.607 F .107(gument, and the directory change)-.18 F +.038(is successful, the absolute pathname of the ne)144 180 R 2.538(ww) +-.25 G .038(orking directory is written to the standard output.)-2.638 F +(The return v)144 192 Q(alue is true if the directory w)-.25 E +(as successfully changed; f)-.1 E(alse otherwise.)-.1 E F1(command)108 +208.8 Q F0([)2.5 E F1(\255pVv)A F0(])A F2(command)2.5 E F0([)2.5 E F2 +(ar)A(g)-.37 E F0(...])2.5 E(Run)144 220.8 Q F2(command)2.956 E F0(with) +3.527 E F2(ar)3.087 E(gs)-.37 E F0 .257 +(suppressing the normal shell function lookup. Only b)3.027 F .257 +(uiltin commands or)-.2 F .502(commands found in the)144 232.8 R F3 +-.666(PA)3.002 G(TH)-.189 E F0 .502(are e)2.752 F -.15(xe)-.15 G 3.002 +(cuted. If).15 F(the)3.002 E F13.002 E F0 .502(option is gi)3.002 +F -.15(ve)-.25 G .501(n, the search for).15 F F2(command)3.201 E F0(is) +3.771 E .399(performed using a def)144 244.8 R .399(ault v)-.1 F .399 +(alue for)-.25 F F3 -.666(PA)2.899 G(TH)-.189 E F0 .4 +(that is guaranteed to \214nd all of the standard utilities.)2.649 F(If) +5.4 E .175(either the)144 256.8 R F12.675 E F0(or)2.675 E F1 +2.675 E F0 .175(option is supplied, a description of)2.675 F F2(command) +2.875 E F0 .174(is printed.)3.445 F(The)5.174 E F12.674 E F0 .174 +(option causes)2.674 F 3.317(as)144 268.8 S .817(ingle w)-3.317 F .817 +(ord indicating the command or \214lename used to in)-.1 F -.2(vo)-.4 G +-.1(ke).2 G F2(command)3.618 E F0 .818(to be displayed; the)4.088 F F1 +144 280.8 Q F0 .25(option produces a more v)2.75 F .25 +(erbose description.)-.15 F .249(If the)5.25 F F12.749 E F0(or) +2.749 E F12.749 E F0 .249(option is supplied, the e)2.749 F .249 +(xit status)-.15 F 1.004(is 0 if)144 292.8 R F2(command)3.704 E F0 -.1 +(wa)4.274 G 3.504(sf).1 G 1.005(ound, and 1 if not.)-3.504 F 1.005 +(If neither option is supplied and an error occurred or)6.005 F F2 +(command)144.2 304.8 Q F0 1.599(cannot be found, the e)4.869 F 1.599 +(xit status is 127.)-.15 F 1.599(Otherwise, the e)6.599 F 1.598 +(xit status of the)-.15 F F1(command)4.098 E F0 -.2(bu)144 316.8 S +(iltin is the e).2 E(xit status of)-.15 E F2(command)2.5 E F0(.).77 E F1 +(compgen)108 333.6 Q F0([)2.5 E F2(option)A F0 2.5(][)C F2(wor)-2.5 E(d) +-.37 E F0(])A .012(Generate possible completion matches for)144 345.6 R +F2(wor)2.513 E(d)-.37 E F0 .013(according to the)2.513 F F2(option)2.513 +E F0 .013(s, which may be an)B 2.513(yo)-.15 G(ption)-2.513 E .982 +(accepted by the)144 357.6 R F1(complete)3.482 E F0 -.2(bu)3.481 G .981 +(iltin with the e).2 F .981(xception of)-.15 F F13.481 E F0(and) +3.481 E F13.481 E F0 3.481(,a)C .981(nd write the matches to the) +-3.481 F 1.415(standard output.)144 369.6 R 1.415(When using the)6.415 F +F13.915 E F0(or)3.915 E F13.915 E F0 1.415(options, the v) +3.915 F 1.415(arious shell v)-.25 F 1.415(ariables set by the pro-)-.25 +F(grammable completion f)144 381.6 Q(acilities, while a)-.1 E -.25(va) +-.2 G(ilable, will not ha).25 E .3 -.15(ve u)-.2 H(seful v).15 E(alues.) +-.25 E .352(The matches will be generated in the same w)144 405.6 R .352 +(ay as if the programmable completion code had gen-)-.1 F .02(erated th\ +em directly from a completion speci\214cation with the same \215ags.)144 +417.6 R(If)5.02 E F2(wor)2.52 E(d)-.37 E F0 .02(is speci\214ed, only) +2.52 F(those completions matching)144 429.6 Q F2(wor)2.5 E(d)-.37 E F0 +(will be displayed.)2.5 E(The return v)144 453.6 Q +(alue is true unless an in)-.25 E -.25(va)-.4 G +(lid option is supplied, or no matches were generated.).25 E F1 +(complete)108 470.4 Q F0([)3.729 E F1(\255abcdefgjksuv)A F0 3.729(][)C +F1-3.729 E F2(comp-option)3.729 E F0 3.729(][)C F1(\255DE)-3.729 E +F0 3.728(][)C F1-3.728 E F2(action)3.728 E F0 3.728(][)C F1 +-3.728 E F2(globpat)3.728 E F0 3.728(][)C F1-3.728 E F2(wor)3.728 +E(dlist)-.37 E F0 3.728(][)C F1-3.728 E F2(func-)3.728 E(tion)108 +482.4 Q F0 2.5(][)C F1-2.5 E F2(command)2.5 E F0(])A([)144 494.4 Q +F1A F2(\214lterpat)2.5 E F0 2.5(][)C F1-2.5 E F2(pr)2.5 E +(e\214x)-.37 E F0 2.5(][)C F1-2.5 E F2(suf)2.5 E<8c78>-.18 E F0(]) +A F2(name)2.5 E F0([)2.5 E F2(name ...)A F0(])A F1(complete \255pr)108 +506.4 Q F0([)2.5 E F1(\255DE)A F0 2.5(][)C F2(name)-2.5 E F0(...])2.5 E +.634(Specify ho)144 518.4 R 3.134(wa)-.25 G -.18(rg)-3.134 G .634 +(uments to each).18 F F2(name)3.134 E F0 .634(should be completed.)3.134 +F .633(If the)5.634 F F13.133 E F0 .633 +(option is supplied, or if no)3.133 F .139(options are supplied, e)144 +530.4 R .139(xisting completion speci\214cations are printed in a w)-.15 +F .14(ay that allo)-.1 F .14(ws them to be)-.25 F .31(reused as input.) +144 542.4 R(The)5.31 E F12.81 E F0 .31(option remo)2.81 F -.15(ve) +-.15 G 2.81(sac).15 G .31(ompletion speci\214cation for each)-2.81 F F2 +(name)2.81 E F0 2.81(,o)C 1.11 -.4(r, i)-2.81 H 2.81(fn).4 G(o)-2.81 E +F2(name)2.81 E F0(s)A 1.346 +(are supplied, all completion speci\214cations.)144 554.4 R(The)6.347 E +F13.847 E F0 1.347(option indicates that the remaining options) +3.847 F .5(and actions should apply to the `)144 566.4 R(`def)-.74 E +(ault')-.1 E 3('c)-.74 G .5 +(ommand completion; that is, completion attempted on)-3 F 3.455(ac)144 +578.4 S .955(ommand for which no completion has pre)-3.455 F .955 +(viously been de\214ned.)-.25 F(The)5.955 E F13.455 E F0 .955 +(option indicates that)3.455 F .065 +(the remaining options and actions should apply to `)144 590.4 R +(`empty')-.74 E 2.564('c)-.74 G .064 +(ommand completion; that is, comple-)-2.564 F +(tion attempted on a blank line.)144 602.4 Q 1.437 +(The process of applying these completion speci\214cations when w)144 +626.4 R 1.438(ord completion is attempted is)-.1 F(described abo)144 +638.4 Q .3 -.15(ve u)-.15 H(nder).15 E F1(Pr)2.5 E +(ogrammable Completion)-.18 E F0(.)A .556 +(Other options, if speci\214ed, ha)144 662.4 R .856 -.15(ve t)-.2 H .555 +(he follo).15 F .555(wing meanings.)-.25 F .555(The ar)5.555 F .555 +(guments to the)-.18 F F13.055 E F0(,)A F13.055 E F0 3.055 +(,a)C(nd)-3.055 E F13.055 E F0 .722(options \(and, if necessary) +144 674.4 R 3.222(,t)-.65 G(he)-3.222 E F13.222 E F0(and)3.222 E +F13.222 E F0 .723 +(options\) should be quoted to protect them from e)3.222 F(xpan-)-.15 E +(sion before the)144 686.4 Q F1(complete)2.5 E F0 -.2(bu)2.5 G +(iltin is in).2 E -.2(vo)-.4 G -.1(ke).2 G(d.).1 E F1144 698.4 Q +F2(comp-option)2.5 E F0(The)184 710.4 Q F2(comp-option)2.791 E F0 .291 +(controls se)2.791 F -.15(ve)-.25 G .291(ral aspects of the compspec') +.15 F 2.791(sb)-.55 G(eha)-2.791 E .291(vior be)-.2 F .291 +(yond the simple)-.15 F(generation of completions.)184 722.4 Q F2 +(comp-option)5 E F0(may be one of:)2.5 E(GNU Bash-4.2)72 768 Q +(2004 Apr 20)148.735 E(3)203.725 E 0 Cg EP +%%Page: 4 4 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF(bashdefault)184 84 Q F0 .281 +(Perform the rest of the def)224 96 R(ault)-.1 E F1(bash)2.781 E F0 .281 +(completions if the compspec generates no)2.781 F(matches.)224 108 Q F1 +(default)184 120 Q F0 2.876(Use readline')10 F 5.376(sd)-.55 G(ef)-5.376 +E 2.875(ault \214lename completion if the compspec generates no)-.1 F +(matches.)224 132 Q F1(dir)184 144 Q(names)-.15 E F0(Perform directory \ +name completion if the compspec generates no matches.)224 156 Q F1 +(\214lenames)184 168 Q F0 -.7(Te)224 180 S .137(ll readline that the co\ +mpspec generates \214lenames, so it can perform an).7 F 2.637<798c>-.15 +G(le-)-2.637 E .134(name\255speci\214c processing \(lik)224 192 R 2.634 +(ea)-.1 G .134(dding a slash to directory names, quoting spe-)-2.634 F +.45(cial characters, or suppressing trailing spaces\).)224 204 R .45 +(Intended to be used with shell)5.45 F(functions.)224 216 Q F1(noquote) +184 228 Q F0 -.7(Te)5.55 G .814 +(ll readline not to quote the completed w).7 F .814(ords if the)-.1 F +3.314(ya)-.15 G .814(re \214lenames \(quoting)-3.314 F +(\214lenames is the def)224 240 Q(ault\).)-.1 E F1(nospace)184 252 Q F0 +-.7(Te)6.11 G .22(ll readline not to append a space \(the def).7 F .22 +(ault\) to w)-.1 F .22(ords completed at the end)-.1 F(of the line.)224 +264 Q F1(plusdirs)184 276 Q F0 1.985(After an)5.54 F 4.485(ym)-.15 G +1.985(atches de\214ned by the compspec are generated, directory name) +-4.485 F .583(completion is attempted and an)224 288 R 3.084(ym)-.15 G +.584(atches are added to the results of the other)-3.084 F(actions.)224 +300 Q F1144 312 Q/F2 10/Times-Italic@0 SF(action)2.5 E F0(The)184 +324 Q F2(action)2.5 E F0(may be one of the follo)2.5 E +(wing to generate a list of possible completions:)-.25 E F1(alias)184 +336 Q F0(Alias names.)20.55 E(May also be speci\214ed as)5 E F12.5 +E F0(.)A F1(arrayv)184 348 Q(ar)-.1 E F0(Array v)224 360 Q +(ariable names.)-.25 E F1 4.7(binding Readline)184 372 R F0 -.1(ke)2.5 G +2.5(yb)-.05 G(inding names.)-2.5 E F1 -.2(bu)184 384 S(iltin).2 E F0 +(Names of shell b)11.85 E(uiltin commands.)-.2 E +(May also be speci\214ed as)5 E F12.5 E F0(.)A F1(command)184 396 +Q F0(Command names.)224 408 Q(May also be speci\214ed as)5 E F12.5 +E F0(.)A F1(dir)184 420 Q(ectory)-.18 E F0(Directory names.)224 432 Q +(May also be speci\214ed as)5 E F12.5 E F0(.)A F1(disabled)184 444 +Q F0(Names of disabled shell b)224 456 Q(uiltins.)-.2 E F1(enabled)184 +468 Q F0(Names of enabled shell b)6.66 E(uiltins.)-.2 E F1(export)184 +480 Q F0(Names of e)12.23 E(xported shell v)-.15 E 2.5(ariables. May) +-.25 F(also be speci\214ed as)2.5 E F12.5 E F0(.)A F1(\214le)184 +492 Q F0(File names.)27.22 E(May also be speci\214ed as)5 E F12.5 +E F0(.)A F1(function)184 504 Q F0(Names of shell functions.)224 516 Q F1 +(gr)184 528 Q(oup)-.18 E F0(Group names.)14.62 E +(May also be speci\214ed as)5 E F12.5 E F0(.)A F1(helptopic)184 +540 Q F0(Help topics as accepted by the)224 552 Q F1(help)2.5 E F0 -.2 +(bu)2.5 G(iltin.).2 E F1(hostname)184 564 Q F0(Hostnames, as tak)224 576 +Q(en from the \214le speci\214ed by the)-.1 E/F3 9/Times-Bold@0 SF +(HOSTFILE)2.5 E F0(shell v)2.25 E(ariable.)-.25 E F1(job)184 588 Q F0 +(Job names, if job control is acti)26.11 E -.15(ve)-.25 G 5(.M).15 G +(ay also be speci\214ed as)-5 E F12.5 E F0(.)A F1 -.1(ke)184 600 S +(yw).1 E(ord)-.1 E F0(Shell reserv)224 612 Q(ed w)-.15 E 2.5(ords. May) +-.1 F(also be speci\214ed as)2.5 E F12.5 E F0(.)A F1(running)184 +624 Q F0(Names of running jobs, if job control is acti)5.54 E -.15(ve) +-.25 G(.).15 E F1(ser)184 636 Q(vice)-.1 E F0(Service names.)10.67 E +(May also be speci\214ed as)5 E F12.5 E F0(.)A F1(setopt)184 648 Q +F0 -1.11(Va)14.45 G(lid ar)1.11 E(guments for the)-.18 E F12.5 E +F0(option to the)2.5 E F1(set)2.5 E F0 -.2(bu)2.5 G(iltin.).2 E F1 +(shopt)184 660 Q F0(Shell option names as accepted by the)16.66 E F1 +(shopt)2.5 E F0 -.2(bu)2.5 G(iltin.).2 E F1(signal)184 672 Q F0 +(Signal names.)14.99 E F1(stopped)184 684 Q F0 +(Names of stopped jobs, if job control is acti)6.66 E -.15(ve)-.25 G(.) +.15 E F1(user)184 696 Q F0(User names.)21.67 E +(May also be speci\214ed as)5 E F12.5 E F0(.)A F1 -.1(va)184 708 S +(riable).1 E F0(Names of all shell v)5.1 E 2.5(ariables. May)-.25 F +(also be speci\214ed as)2.5 E F12.5 E F0(.)A(GNU Bash-4.2)72 768 Q +(2004 Apr 20)148.735 E(4)203.725 E 0 Cg EP +%%Page: 5 5 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF144 84 Q/F2 10/Times-Italic@0 SF(command)2.5 E +(command)184 96 Q F0 1.056(is e)3.556 F -.15(xe)-.15 G 1.056 +(cuted in a subshell en).15 F 1.056 +(vironment, and its output is used as the possible)-.4 F(completions.) +184 108 Q F1144 120 Q F2(function)2.5 E F0 .113 +(The shell function)184 132 R F2(function)2.614 E F0 .114(is e)2.614 F +-.15(xe)-.15 G .114(cuted in the current shell en).15 F 2.614 +(vironment. When)-.4 F .114(the func-)2.614 F .817(tion is e)184 144 R +-.15(xe)-.15 G .817(cuted, the \214rst ar).15 F .817(gument \()-.18 F F1 +($1)A F0 3.316(\)i)C 3.316(st)-3.316 G .816 +(he name of the command whose ar)-3.316 F(guments)-.18 E 1.407 +(are being completed, the second ar)184 156 R 1.407(gument \()-.18 F F1 +($2)A F0 3.907(\)i)C 3.907(st)-3.907 G 1.407(he w)-3.907 F 1.407 +(ord being completed, and the)-.1 F .104(third ar)184 168 R .104 +(gument \()-.18 F F1($3)A F0 2.604(\)i)C 2.604(st)-2.604 G .104(he w) +-2.604 F .104(ord preceding the w)-.1 F .103 +(ord being completed on the current com-)-.1 F .101(mand line.)184 180 R +.101(When it \214nishes, the possible completions are retrie)5.101 F +-.15(ve)-.25 G 2.602(df).15 G .102(rom the v)-2.602 F .102(alue of the) +-.25 F/F3 9/Times-Bold@0 SF(COMPREPL)184 192 Q(Y)-.828 E F0(array v)2.25 +E(ariable.)-.25 E F1144 204 Q F2(globpat)2.5 E F0 1.008 +(The pathname e)184 216 R 1.008(xpansion pattern)-.15 F F2(globpat)3.507 +E F0 1.007(is e)3.507 F 1.007(xpanded to generate the possible comple-) +-.15 F(tions.)184 228 Q F1144 240 Q F2(pr)2.5 E(e\214x)-.37 E(pr) +184 252 Q(e\214x)-.37 E F0 .534(is added at the be)3.034 F .534 +(ginning of each possible completion after all other options ha)-.15 F +-.15(ve)-.2 G(been applied.)184 264 Q F1144 276 Q F2(suf)2.5 E +2.81(\214x suf)-.18 F<8c78>-.18 E F0 +(is appended to each possible completion after all other options ha)2.5 +E .3 -.15(ve b)-.2 H(een applied.).15 E F1144 288 Q F2(wor)2.5 E +(dlist)-.37 E F0(The)184 300 Q F2(wor)3.64 E(dlist)-.37 E F0 1.14 +(is split using the characters in the)3.64 F F3(IFS)3.64 E F0 1.139 +(special v)3.39 F 1.139(ariable as delimiters, and)-.25 F 2.007 +(each resultant w)184 312 R 2.007(ord is e)-.1 F 4.507(xpanded. The)-.15 +F 2.008(possible completions are the members of the)4.507 F +(resultant list which match the w)184 324 Q(ord being completed.)-.1 E +F1144 336 Q F2(\214lterpat)2.5 E(\214lterpat)184 348 Q F0 .456 +(is a pattern as used for pathname e)2.956 F 2.956(xpansion. It)-.15 F +.455(is applied to the list of possible)2.956 F 1.596 +(completions generated by the preceding options and ar)184 360 R 1.596 +(guments, and each completion)-.18 F(matching)184 372 Q F2(\214lterpat) +3.205 E F0 .705(is remo)3.205 F -.15(ve)-.15 G 3.205(df).15 G .704 +(rom the list.)-3.205 F 3.204(Al)5.704 G(eading)-3.204 E F1(!)3.204 E F0 +(in)3.204 E F2(\214lterpat)3.204 E F0(ne)3.204 E -.05(ga)-.15 G .704 +(tes the pattern;).05 F(in this case, an)184 384 Q 2.5(yc)-.15 G +(ompletion not matching)-2.5 E F2(\214lterpat)2.5 E F0(is remo)2.5 E +-.15(ve)-.15 G(d.).15 E .466(The return v)144 400.8 R .466 +(alue is true unless an in)-.25 F -.25(va)-.4 G .466 +(lid option is supplied, an option other than).25 F F12.967 E F0 +(or)2.967 E F12.967 E F0 .467(is sup-)2.967 F 1.362 +(plied without a)144 412.8 R F2(name)3.862 E F0(ar)3.862 E 1.361 +(gument, an attempt is made to remo)-.18 F 1.661 -.15(ve a c)-.15 H +1.361(ompletion speci\214cation for a).15 F F2(name)144 424.8 Q F0 +(for which no speci\214cation e)2.5 E +(xists, or an error occurs adding a completion speci\214cation.)-.15 E +F1(compopt)108 441.6 Q F0([)2.5 E F1A F2(option)2.5 E F0 2.5(][)C +F1(\255DE)-2.5 E F0 2.5(][)C F1(+o)-2.5 E F2(option)2.5 E F0 2.5(][)C F2 +(name)-2.5 E F0(])A .447(Modify completion options for each)144 453.6 R +F2(name)2.947 E F0 .447(according to the)2.947 F F2(option)2.947 E F0 +.447(s, or for the currently-e)B -.15(xe)-.15 G(cuting).15 E .726 +(completion if no)144 465.6 R F2(name)3.226 E F0 3.226(sa)C .726 +(re supplied.)-3.226 F .725(If no)5.725 F F2(option)3.225 E F0 3.225(sa) +C .725(re gi)-3.225 F -.15(ve)-.25 G .725 +(n, display the completion options for).15 F(each)144 477.6 Q F2(name) +3.223 E F0 .723(or the current completion.)3.223 F .724(The possible v) +5.724 F .724(alues of)-.25 F F2(option)3.224 E F0 .724(are those v)3.224 +F .724(alid for the)-.25 F F1(com-)3.224 E(plete)144 489.6 Q F0 -.2(bu) +2.798 G .298(iltin described abo).2 F -.15(ve)-.15 G 5.297(.T).15 G(he) +-5.297 E F12.797 E F0 .297 +(option indicates that the remaining options should apply to)2.797 F +1.227(the `)144 501.6 R(`def)-.74 E(ault')-.1 E 3.727('c)-.74 G 1.228(o\ +mmand completion; that is, completion attempted on a command for which \ +no)-3.727 F 2.178(completion has pre)144 513.6 R 2.178 +(viously been de\214ned.)-.25 F(The)7.178 E F14.678 E F0 2.177 +(option indicates that the remaining options)4.677 F(should apply to `) +144 525.6 Q(`empty')-.74 E 2.5('c)-.74 G +(ommand completion; that is, completion attempted on a blank line.)-2.5 +E 1.387(The return v)144 549.6 R 1.387(alue is true unless an in)-.25 F +-.25(va)-.4 G 1.388 +(lid option is supplied, an attempt is made to modify the).25 F +(options for a)144 561.6 Q F2(name)2.5 E F0 +(for which no completion speci\214cation e)2.5 E +(xists, or an output error occurs.)-.15 E F1(continue)108 578.4 Q F0([) +2.5 E F2(n)A F0(])A 1.754(Resume the ne)144 590.4 R 1.754 +(xt iteration of the enclosing)-.15 F F1 -.25(fo)4.254 G(r).25 E F0(,)A +F1(while)4.254 E F0(,)A F1(until)4.254 E F0 4.254(,o)C(r)-4.254 E F1 +(select)4.254 E F0 4.253(loop. If)4.254 F F2(n)4.613 E F0 1.753 +(is speci\214ed,)4.493 F 1.208(resume at the)144 602.4 R F2(n)3.709 E F0 +1.209(th enclosing loop.)B F2(n)6.569 E F0 1.209(must be)3.949 F/F4 10 +/Symbol SF3.709 E F0 3.709(1. If)3.709 F F2(n)4.069 E F0 1.209 +(is greater than the number of enclosing)3.949 F .514 +(loops, the last enclosing loop \(the `)144 614.4 R(`top-le)-.74 E -.15 +(ve)-.25 G(l').15 E 3.014('l)-.74 G .514(oop\) is resumed.)-3.014 F .513 +(The return v)5.513 F .513(alue is 0 unless)-.25 F F2(n)3.013 E F0(is) +3.013 E(not greater than or equal to 1.)144 626.4 Q F1(declar)108 643.2 +Q(e)-.18 E F0([)2.5 E F1(\255aAfFgilnrtux)A F0 2.5(][)C F1-2.5 E +F0 2.5(][)C F2(name)-2.5 E F0([=)A F2(value)A F0 2.5(].)C(..])-2.5 E F1 +(typeset)108 655.2 Q F0([)2.5 E F1(\255aAfFgilnrtux)A F0 2.5(][)C F1 +-2.5 E F0 2.5(][)C F2(name)-2.5 E F0([=)A F2(value)A F0 2.5(].)C +(..])-2.5 E 1.264(Declare v)144 667.2 R 1.264(ariables and/or gi)-.25 F +1.564 -.15(ve t)-.25 H 1.264(hem attrib).15 F 3.765(utes. If)-.2 F(no) +3.765 E F2(name)3.765 E F0 3.765(sa)C 1.265(re gi)-3.765 F -.15(ve)-.25 +G 3.765(nt).15 G 1.265(hen display the v)-3.765 F 1.265(alues of)-.25 F +-.25(va)144 679.2 S 3.483(riables. The).25 F F13.483 E F0 .983 +(option will display the attrib)3.483 F .983(utes and v)-.2 F .982 +(alues of each)-.25 F F2(name)3.482 E F0 5.982(.W).18 G(hen)-5.982 E F1 +3.482 E F0 .982(is used)3.482 F(with)144 691.2 Q F2(name)2.774 E +F0(ar)2.774 E .274(guments, additional options, other than)-.18 F F1 +2.775 E F0(and)2.775 E F12.775 E F0 2.775(,a)C .275 +(re ignored.)-2.775 F(When)5.275 E F12.775 E F0 .275(is supplied) +2.775 F(without)144 703.2 Q F2(name)4.814 E F0(ar)4.814 E 2.314 +(guments, it will display the attrib)-.18 F 2.314(utes and v)-.2 F 2.313 +(alues of all v)-.25 F 2.313(ariables ha)-.25 F 2.313(ving the)-.2 F +(attrib)144 715.2 Q 1.181(utes speci\214ed by the additional options.) +-.2 F 1.182(If no other options are supplied with)6.181 F F13.682 +E F0(,)A F1(declar)3.682 E(e)-.18 E F0 .62(will display the attrib)144 +727.2 R .62(utes and v)-.2 F .62(alues of all shell v)-.25 F 3.12 +(ariables. The)-.25 F F13.12 E F0 .62 +(option will restrict the display)3.12 F(GNU Bash-4.2)72 768 Q +(2004 Apr 20)148.735 E(5)203.725 E 0 Cg EP +%%Page: 6 6 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E 1.29 +(to shell functions.)144 84 R(The)6.29 E/F1 10/Times-Bold@0 SF3.79 +E F0 1.291(option inhibits the display of function de\214nitions; only \ +the function)3.791 F .948(name and attrib)144 96 R .948 +(utes are printed.)-.2 F .948(If the)5.948 F F1(extdeb)3.448 E(ug)-.2 E +F0 .948(shell option is enabled using)3.448 F F1(shopt)3.448 E F0 3.448 +(,t)C .948(he source)-3.448 F 1.342(\214le name and line number where t\ +he function is de\214ned are displayed as well.)144 108 R(The)6.342 E F1 +3.842 E F0(option)3.842 E(implies)144 120 Q F13.892 E F0 +6.392(.T)C(he)-6.392 E F13.892 E F0 1.391(option forces v)3.892 F +1.391(ariables to be created or modi\214ed at the global scope, e)-.25 F +-.15(ve)-.25 G(n).15 E(when)144 132 Q F1(declar)4.382 E(e)-.18 E F0 +1.882(is e)4.382 F -.15(xe)-.15 G 1.882(cuted in a shell function.).15 F +1.883(It is ignored in all other cases.)6.882 F 1.883(The follo)6.883 F +(wing)-.25 E .794(options can be used to restrict output to v)144 144 R +.794(ariables with the speci\214ed attrib)-.25 F .793(ute or to gi)-.2 F +1.093 -.15(ve v)-.25 H(ariables)-.1 E(attrib)144 156 Q(utes:)-.2 E F1 +144 168 Q F0(Each)25.3 E/F2 10/Times-Italic@0 SF(name)2.5 E F0 +(is an inde)2.5 E -.15(xe)-.15 G 2.5(da).15 G(rray v)-2.5 E +(ariable \(see)-.25 E F1(Arrays)2.5 E F0(abo)2.5 E -.15(ve)-.15 G(\).) +.15 E F1144 180 Q F0(Each)23.08 E F2(name)2.5 E F0 +(is an associati)2.5 E .3 -.15(ve a)-.25 H(rray v).15 E(ariable \(see) +-.25 E F1(Arrays)2.5 E F0(abo)2.5 E -.15(ve)-.15 G(\).).15 E F1144 +192 Q F0(Use function names only)26.97 E(.)-.65 E F1144 204 Q F0 +.557(The v)27.52 F .558(ariable is treated as an inte)-.25 F .558 +(ger; arithmetic e)-.15 F -.25(va)-.25 G .558(luation \(see).25 F/F3 9 +/Times-Bold@0 SF .558(ARITHMETIC EV)3.058 F(ALU)-1.215 E(A-)-.54 E(TION) +180 216 Q F0(abo)2.25 E -.15(ve)-.15 G 2.5(\)i).15 G 2.5(sp)-2.5 G +(erformed when the v)-2.5 E(ariable is assigned a v)-.25 E(alue.)-.25 E +F1144 228 Q F0 .91(When the v)27.52 F .909 +(ariable is assigned a v)-.25 F .909(alue, all upper)-.25 F .909 +(-case characters are con)-.2 F -.15(ve)-.4 G .909(rted to lo).15 F(wer) +-.25 E(-)-.2 E 2.5(case. The)180 240 R(upper)2.5 E(-case attrib)-.2 E +(ute is disabled.)-.2 E F1144 252 Q F0(Gi)24.74 E 1.619 -.15(ve e) +-.25 H(ach).15 E F2(name)3.819 E F0(the)3.819 E F2(namer)3.819 E(ef)-.37 +E F0(attrib)3.819 E 1.319(ute, making it a name reference to another v) +-.2 F(ariable.)-.25 E 1.033(That other v)180 264 R 1.033 +(ariable is de\214ned by the v)-.25 F 1.033(alue of)-.25 F F2(name)3.533 +E F0 6.033(.A)C 1.033(ll references and assignments to)-6.033 F F2(name) +180 276 Q F0 4.032(,e)C 1.532(xcept for changing the)-4.182 F F1 +4.032 E F0(attrib)4.032 E 1.532(ute itself, are performed on the v)-.2 F +1.533(ariable refer)-.25 F(-)-.2 E(enced by)180 288 Q F2(name)2.5 E F0 +1.1 -.55('s v)D 2.5(alue. The).3 F F12.5 E F0(attrib)2.5 E +(ute cannot be applied to array v)-.2 E(ariables.)-.25 E F1144 300 +Q F0(Mak)25.86 E(e)-.1 E F2(name)5.047 E F0 5.047(sr)C(eadonly)-5.047 E +7.547(.T)-.65 G 2.546(hese names cannot then be assigned v)-7.547 F +2.546(alues by subsequent)-.25 F(assignment statements or unset.)180 312 +Q F1144 324 Q F0(Gi)26.97 E .729 -.15(ve e)-.25 H(ach).15 E F2 +(name)2.929 E F0(the)2.929 E F2(tr)2.929 E(ace)-.15 E F0(attrib)2.929 E +2.929(ute. T)-.2 F .429(raced functions inherit the)-.35 F F1(DEB)2.929 +E(UG)-.1 E F0(and)2.93 E F1(RETURN)2.93 E F0 +(traps from the calling shell.)180 336 Q(The trace attrib)5 E +(ute has no special meaning for v)-.2 E(ariables.)-.25 E F1144 348 +Q F0 .91(When the v)24.74 F .909(ariable is assigned a v)-.25 F .909 +(alue, all lo)-.25 F(wer)-.25 E .909(-case characters are con)-.2 F -.15 +(ve)-.4 G .909(rted to upper).15 F(-)-.2 E 2.5(case. The)180 360 R(lo) +2.5 E(wer)-.25 E(-case attrib)-.2 E(ute is disabled.)-.2 E F1144 +372 Q F0(Mark)25.3 E F2(name)2.5 E F0 2.5(sf)C(or e)-2.5 E +(xport to subsequent commands via the en)-.15 E(vironment.)-.4 E .12 +(Using `+' instead of `\255' turns of)144 388.8 R 2.62(ft)-.25 G .12 +(he attrib)-2.62 F .121(ute instead, with the e)-.2 F .121 +(xceptions that)-.15 F F1(+a)2.621 E F0 .121(may not be used)2.621 F +.645(to destro)144 400.8 R 3.145(ya)-.1 G 3.145(na)-3.145 G .645(rray v) +-3.145 F .645(ariable and)-.25 F F1(+r)3.145 E F0 .645(will not remo) +3.145 F .945 -.15(ve t)-.15 H .645(he readonly attrib).15 F 3.144 +(ute. When)-.2 F .644(used in a func-)3.144 F(tion,)144 412.8 Q F1 +(declar)2.835 E(e)-.18 E F0(and)2.835 E F1(typeset)2.835 E F0(mak)2.835 +E 2.835(ee)-.1 G(ach)-2.835 E F2(name)2.835 E F0 .335 +(local, as with the)2.835 F F1(local)2.835 E F0 .335 +(command, unless the)2.835 F F12.835 E F0(option)2.835 E 1.283 +(is supplied.)144 424.8 R 1.283(If a v)6.283 F 1.283 +(ariable name is follo)-.25 F 1.283(wed by =)-.25 F F2(value)A F0 3.783 +(,t)C 1.283(he v)-3.783 F 1.283(alue of the v)-.25 F 1.282 +(ariable is set to)-.25 F F2(value)3.782 E F0(.)A .926(When using)144 +436.8 R F13.426 E F0(or)3.426 E F13.426 E F0 .927 +(and the compound assignment syntax to create array v)3.426 F .927 +(ariables, additional)-.25 F(attrib)144 448.8 Q .592(utes do not tak)-.2 +F 3.092(ee)-.1 G -.25(ff)-3.092 G .592 +(ect until subsequent assignments.).25 F .592(The return v)5.592 F .592 +(alue is 0 unless an in)-.25 F -.25(va)-.4 G(lid).25 E .429 +(option is encountered, an attempt is made to de\214ne a function using) +144 460.8 R/F4 10/Courier@0 SF .429(\255f foo=bar)2.929 F F0 2.929(,a)C +2.929(na)-2.929 G .429(ttempt is)-2.929 F .063(made to assign a v)144 +472.8 R .063(alue to a readonly v)-.25 F .062 +(ariable, an attempt is made to assign a v)-.25 F .062 +(alue to an array v)-.25 F(ari-)-.25 E .102 +(able without using the compound assignment syntax \(see)144 484.8 R F1 +(Arrays)2.602 E F0(abo)2.602 E -.15(ve)-.15 G .102(\), one of the).15 F +F2(names)2.602 E F0 .102(is not a)2.602 F -.25(va)144 496.8 S .172 +(lid shell v).25 F .171(ariable name, an attempt is made to turn of)-.25 +F 2.671(fr)-.25 G .171(eadonly status for a readonly v)-2.671 F .171 +(ariable, an)-.25 F .96(attempt is made to turn of)144 508.8 R 3.46(fa) +-.25 G .96(rray status for an array v)-3.46 F .96 +(ariable, or an attempt is made to display a)-.25 F(non-e)144 520.8 Q +(xistent function with)-.15 E F12.5 E F0(.)A F1 +(dirs [\255clpv] [+)108 537.6 Q F2(n)A F1 2.5(][)C-2.5 E F2(n)A F1 +(])A F0 -.4(Wi)144 549.6 S .329 +(thout options, displays the list of currently remembered directories.) +.4 F .328(The def)5.328 F .328(ault display is on a)-.1 F 1.238 +(single line with directory names separated by spaces.)144 561.6 R 1.238 +(Directories are added to the list with the)6.238 F F1(pushd)144 573.6 Q +F0(command; the)2.5 E F1(popd)2.5 E F0(command remo)2.5 E -.15(ve)-.15 G +2.5(se).15 G(ntries from the list.)-2.5 E F1144 585.6 Q F0 +(Clears the directory stack by deleting all of the entries.)25.86 E F1 +144 597.6 Q F0 .882 +(Produces a listing using full pathnames; the def)27.52 F .881 +(ault listing format uses a tilde to denote)-.1 F(the home directory)180 +609.6 Q(.)-.65 E F1144 621.6 Q F0 +(Print the directory stack with one entry per line.)24.74 E F1144 +633.6 Q F0 .272(Print the directory stack with one entry per line, pre\ +\214xing each entry with its inde)25.3 F 2.773(xi)-.15 G 2.773(nt)-2.773 +G(he)-2.773 E(stack.)180 645.6 Q F1(+)144 657.6 Q F2(n)A F0 1.565 +(Displays the)25.3 F F2(n)4.065 E F0 1.565 +(th entry counting from the left of the list sho)B 1.564(wn by)-.25 F F1 +(dirs)4.064 E F0 1.564(when in)4.064 F -.2(vo)-.4 G -.1(ke).2 G(d).1 E +(without options, starting with zero.)180 669.6 Q F1144 681.6 Q F2 +(n)A F0 1.194(Displays the)25.3 F F2(n)3.694 E F0 1.194 +(th entry counting from the right of the list sho)B 1.194(wn by)-.25 F +F1(dirs)3.694 E F0 1.194(when in)3.694 F -.2(vo)-.4 G -.1(ke).2 G(d).1 E +(without options, starting with zero.)180 693.6 Q .258(The return v)144 +710.4 R .258(alue is 0 unless an in)-.25 F -.25(va)-.4 G .258 +(lid option is supplied or).25 F F2(n)2.758 E F0(inde)2.758 E -.15(xe) +-.15 G 2.758(sb).15 G -.15(ey)-2.758 G .258(ond the end of the direc-) +.15 F(tory stack.)144 722.4 Q(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 +E(6)203.725 E 0 Cg EP +%%Page: 7 7 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF(diso)108 84 Q(wn)-.1 E F0([)2.5 E F1(\255ar)A F0 2.5 +(][)C F1-2.5 E F0 2.5(][)C/F2 10/Times-Italic@0 SF(jobspec)-2.5 E +F0(...])2.5 E -.4(Wi)144 96 S .121(thout options, remo).4 F .422 -.15 +(ve e)-.15 H(ach).15 E F2(jobspec)4.362 E F0 .122 +(from the table of acti)2.932 F .422 -.15(ve j)-.25 H 2.622(obs. If).15 +F F2(jobspec)4.362 E F0 .122(is not present, and)2.932 F .096 +(neither the)144 108 R F12.596 E F0 .096(nor the)2.596 F F1 +2.596 E F0 .096(option is supplied, the)2.596 F F2(curr)2.596 E .096 +(ent job)-.37 F F0 .096(is used.)2.596 F .096(If the)5.096 F F1 +2.596 E F0 .096(option is gi)2.596 F -.15(ve)-.25 G .096(n, each).15 F +F2(jobspec)144 120 Q F0 .672(is not remo)3.482 F -.15(ve)-.15 G 3.172 +(df).15 G .672(rom the table, b)-3.172 F .672(ut is mark)-.2 F .672 +(ed so that)-.1 F/F3 9/Times-Bold@0 SF(SIGHUP)3.172 E F0 .673 +(is not sent to the job if the)2.922 F .962(shell recei)144 132 R -.15 +(ve)-.25 G 3.462(sa).15 G F3(SIGHUP)A/F4 9/Times-Roman@0 SF(.)A F0 .962 +(If no)5.462 F F2(jobspec)5.202 E F0 .962(is supplied, the)3.772 F F1 +3.462 E F0 .962(option means to remo)3.462 F 1.262 -.15(ve o)-.15 +H 3.462(rm).15 G .962(ark all)-3.462 F 1.358(jobs; the)144 144 R F1 +3.858 E F0 1.358(option without a)3.858 F F2(jobspec)5.598 E F0 +(ar)4.169 E 1.359(gument restricts operation to running jobs.)-.18 F +1.359(The return)6.359 F -.25(va)144 156 S(lue is 0 unless a).25 E F2 +(jobspec)4.24 E F0(does not specify a v)2.81 E(alid job)-.25 E(.)-.4 E +F1(echo)108 172.8 Q F0([)2.5 E F1(\255neE)A F0 2.5(][)C F2(ar)-2.5 E(g) +-.37 E F0(...])2.5 E .425(Output the)144 184.8 R F2(ar)2.925 E(g)-.37 E +F0 .424(s, separated by spaces, follo)B .424(wed by a ne)-.25 F 2.924 +(wline. The)-.25 F .424(return status is 0 unless a write)2.924 F .307 +(error occurs.)144 196.8 R(If)5.307 E F12.807 E F0 .307 +(is speci\214ed, the trailing ne)2.807 F .308(wline is suppressed.)-.25 +F .308(If the)5.308 F F12.808 E F0 .308(option is gi)2.808 F -.15 +(ve)-.25 G .308(n, inter).15 F(-)-.2 E 1.349(pretation of the follo)144 +208.8 R 1.348(wing backslash-escaped characters is enabled.)-.25 F(The) +6.348 E F13.848 E F0 1.348(option disables the)3.848 F 1.054 +(interpretation of these escape characters, e)144 220.8 R -.15(ve)-.25 G +3.555(no).15 G 3.555(ns)-3.555 G 1.055(ystems where the)-3.555 F 3.555 +(ya)-.15 G 1.055(re interpreted by def)-3.555 F(ault.)-.1 E(The)144 +232.8 Q F1(xpg_echo)3.459 E F0 .959 +(shell option may be used to dynamically determine whether or not)3.459 +F F1(echo)3.458 E F0 -.15(ex)3.458 G(pands).15 E .715 +(these escape characters by def)144 244.8 R(ault.)-.1 E F1(echo)5.715 E +F0 .716(does not interpret)3.215 F F13.216 E F0 .716 +(to mean the end of options.)3.216 F F1(echo)5.716 E F0 +(interprets the follo)144 256.8 Q(wing escape sequences:)-.25 E F1(\\a) +144 268.8 Q F0(alert \(bell\))28.22 E F1(\\b)144 280.8 Q F0(backspace) +27.66 E F1(\\c)144 292.8 Q F0(suppress further output)28.78 E F1(\\e)144 +304.8 Q(\\E)144 316.8 Q F0(an escape character)26.55 E F1(\\f)144 328.8 +Q F0(form feed)29.89 E F1(\\n)144 340.8 Q F0(ne)27.66 E 2.5(wl)-.25 G +(ine)-2.5 E F1(\\r)144 352.8 Q F0(carriage return)28.78 E F1(\\t)144 +364.8 Q F0(horizontal tab)29.89 E F1(\\v)144 376.8 Q F0 -.15(ve)28.22 G +(rtical tab).15 E F1(\\\\)144 388.8 Q F0(backslash)30.44 E F1(\\0)144 +400.8 Q F2(nnn)A F0(the eight-bit character whose v)13.22 E +(alue is the octal v)-.25 E(alue)-.25 E F2(nnn)2.5 E F0 +(\(zero to three octal digits\))2.5 E F1(\\x)144 412.8 Q F2(HH)A F0 +(the eight-bit character whose v)13.78 E(alue is the he)-.25 E +(xadecimal v)-.15 E(alue)-.25 E F2(HH)2.5 E F0(\(one or tw)2.5 E 2.5(oh) +-.1 G .3 -.15(ex d)-2.5 H(igits\)).15 E F1(\\u)144 424.8 Q F2(HHHH)A F0 +1.507(the Unicode \(ISO/IEC 10646\) character whose v)180 436.8 R 1.506 +(alue is the he)-.25 F 1.506(xadecimal v)-.15 F(alue)-.25 E F2(HHHH) +4.006 E F0(\(one to four he)180 448.8 Q 2.5(xd)-.15 G(igits\))-2.5 E F1 +(\\U)144 460.8 Q F2(HHHHHHHH)A F0 .547 +(the Unicode \(ISO/IEC 10646\) character whose v)180 472.8 R .547 +(alue is the he)-.25 F .548(xadecimal v)-.15 F(alue)-.25 E F2(HHHHH-) +3.048 E(HHH)180 484.8 Q F0(\(one to eight he)2.5 E 2.5(xd)-.15 G +(igits\))-2.5 E F1(enable)108 501.6 Q F0([)2.5 E F1A F0 2.5(][)C +F1(\255dnps)-2.5 E F0 2.5(][)C F1-2.5 E F2(\214lename)2.5 E F0 2.5 +(][)C F2(name)-2.5 E F0(...])2.5 E .278(Enable and disable b)144 513.6 R +.278(uiltin shell commands.)-.2 F .278(Disabling a b)5.278 F .278 +(uiltin allo)-.2 F .278(ws a disk command which has)-.25 F .833 +(the same name as a shell b)144 525.6 R .834(uiltin to be e)-.2 F -.15 +(xe)-.15 G .834(cuted without specifying a full pathname, e).15 F -.15 +(ve)-.25 G 3.334(nt).15 G(hough)-3.334 E .99 +(the shell normally searches for b)144 537.6 R .989 +(uiltins before disk commands.)-.2 F(If)5.989 E F13.489 E F0 .989 +(is used, each)3.489 F F2(name)3.489 E F0 .989(is dis-)3.489 F 1.581 +(abled; otherwise,)144 549.6 R F2(names)4.082 E F0 1.582(are enabled.) +4.082 F -.15(Fo)6.582 G 4.082(re).15 G 1.582(xample, to use the)-4.232 F +F1(test)4.082 E F0 1.582(binary found via the)4.082 F F3 -.666(PA)4.082 +G(TH)-.189 E F0 .081(instead of the shell b)144 561.6 R .081(uiltin v) +-.2 F .081(ersion, run)-.15 F/F5 10/Courier@0 SF .081(enable -n test) +2.581 F F0 5.081(.T)C(he)-5.081 E F12.58 E F0 .08 +(option means to load the ne)2.58 F(w)-.25 E -.2(bu)144 573.6 S 1.524 +(iltin command).2 F F2(name)4.384 E F0 1.524(from shared object)4.204 F +F2(\214lename)4.024 E F0 4.024(,o).18 G 4.024(ns)-4.024 G 1.524 +(ystems that support dynamic loading.)-4.024 F(The)144 585.6 Q F1 +2.867 E F0 .367(option will delete a b)2.867 F .367(uiltin pre)-.2 F +.367(viously loaded with)-.25 F F12.866 E F0 5.366(.I)C 2.866(fn) +-5.366 G(o)-2.866 E F2(name)2.866 E F0(ar)2.866 E .366(guments are gi) +-.18 F -.15(ve)-.25 G .366(n, or).15 F .398(if the)144 597.6 R F1 +2.898 E F0 .399(option is supplied, a list of shell b)2.899 F .399 +(uiltins is printed.)-.2 F -.4(Wi)5.399 G .399(th no other option ar).4 +F .399(guments, the)-.18 F .099(list consists of all enabled shell b)144 +609.6 R 2.598(uiltins. If)-.2 F F12.598 E F0 .098 +(is supplied, only disabled b)2.598 F .098(uiltins are printed.)-.2 F +(If)5.098 E F12.598 E F0 1.916 +(is supplied, the list printed includes all b)144 621.6 R 1.916 +(uiltins, with an indication of whether or not each is)-.2 F 2.879 +(enabled. If)144 633.6 R F12.879 E F0 .379 +(is supplied, the output is restricted to the POSIX)2.879 F F2(special) +2.879 E F0 -.2(bu)2.878 G 2.878(iltins. The).2 F .378(return v)2.878 F +(alue)-.25 E .994(is 0 unless a)144 645.6 R F2(name)3.854 E F0 .994 +(is not a shell b)3.674 F .994(uiltin or there is an error loading a ne) +-.2 F 3.495(wb)-.25 G .995(uiltin from a shared)-3.695 F(object.)144 +657.6 Q F1 -2.3 -.15(ev a)108 674.4 T(l).15 E F0([)2.5 E F2(ar)A(g)-.37 +E F0(...])2.5 E(The)144 686.4 Q F2(ar)3.171 E(g)-.37 E F0 3.171(sa)C +.671(re read and concatenated together into a single command.)-3.171 F +.67(This command is then read)5.67 F .495(and e)144 698.4 R -.15(xe)-.15 +G .495(cuted by the shell, and its e).15 F .495 +(xit status is returned as the v)-.15 F .495(alue of)-.25 F F1 -2.3 -.15 +(ev a)2.995 H(l).15 E F0 5.495(.I)C 2.995(ft)-5.495 G .495(here are no) +-2.995 F F2(ar)2.995 E(gs)-.37 E F0(,).27 E(or only null ar)144 710.4 Q +(guments,)-.18 E F1 -2.3 -.15(ev a)2.5 H(l).15 E F0(returns 0.)2.5 E +(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(7)203.725 E 0 Cg EP +%%Page: 8 8 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF(exec)108 84 Q F0([)2.5 E F1(\255cl)A F0 2.5(][)C F1 +-2.5 E/F2 10/Times-Italic@0 SF(name)2.5 E F0 2.5(][)C F2(command) +-2.5 E F0([)2.5 E F2(ar)A(guments)-.37 E F0(]])A(If)144 96 Q F2(command) +3.006 E F0 .306(is speci\214ed, it replaces the shell.)3.576 F .305 +(No ne)5.305 F 2.805(wp)-.25 G .305(rocess is created.)-2.805 F(The) +5.305 E F2(ar)3.135 E(guments)-.37 E F0(become)3.075 E .176(the ar)144 +108 R .176(guments to)-.18 F F2(command)2.676 E F0 5.176(.I)C 2.676(ft) +-5.176 G(he)-2.676 E F12.676 E F0 .176 +(option is supplied, the shell places a dash at the be)2.676 F .177 +(ginning of)-.15 F .5(the zeroth ar)144 120 R .5(gument passed to)-.18 F +F2(command)3 E F0 5.499(.T).77 G .499(his is what)-5.499 F F2(lo)2.999 E +(gin)-.1 E F0 .499(\(1\) does.).24 F(The)5.499 E F12.999 E F0 .499 +(option causes)2.999 F F2(com-)3.199 E(mand)144 132 Q F0 .638(to be e) +3.908 F -.15(xe)-.15 G .638(cuted with an empty en).15 F 3.138 +(vironment. If)-.4 F F13.138 E F0 .638 +(is supplied, the shell passes)3.138 F F2(name)3.499 E F0 .639(as the) +3.319 F 1.078(zeroth ar)144 144 R 1.077(gument to the e)-.18 F -.15(xe) +-.15 G 1.077(cuted command.).15 F(If)6.077 E F2(command)3.777 E F0 1.077 +(cannot be e)4.347 F -.15(xe)-.15 G 1.077(cuted for some reason, a).15 F +(non-interacti)144 156 Q .876 -.15(ve s)-.25 H .576(hell e).15 F .576 +(xits, unless the)-.15 F F1(execfail)3.076 E F0 .577 +(shell option is enabled.)3.077 F .577(In that case, it returns f)5.577 +F(ail-)-.1 E 2.505(ure. An)144 168 R(interacti)2.505 E .305 -.15(ve s) +-.25 H .005(hell returns f).15 F .005(ailure if the \214le cannot be e) +-.1 F -.15(xe)-.15 G 2.505(cuted. If).15 F F2(command)2.705 E F0 .005 +(is not speci\214ed,)3.275 F(an)144 180 Q 3.036(yr)-.15 G .536 +(edirections tak)-3.036 F 3.036(ee)-.1 G -.25(ff)-3.036 G .536 +(ect in the current shell, and the return status is 0.).25 F .536 +(If there is a redirection)5.536 F(error)144 192 Q 2.5(,t)-.4 G +(he return status is 1.)-2.5 E F1(exit)108 208.8 Q F0([)2.5 E F2(n)A F0 +6.29(]C)C .096(ause the shell to e)-6.29 F .096(xit with a status of) +-.15 F F2(n)2.596 E F0 5.096(.I)C(f)-5.096 E F2(n)2.955 E F0 .095 +(is omitted, the e)2.835 F .095(xit status is that of the last command) +-.15 F -.15(exe)144 220.8 S 2.5(cuted. A).15 F(trap on)2.5 E/F3 9 +/Times-Bold@0 SF(EXIT)2.5 E F0(is e)2.25 E -.15(xe)-.15 G +(cuted before the shell terminates.).15 E F1(export)108 237.6 Q F0([)2.5 +E F1(\255fn)A F0 2.5(][).833 G F2(name)-2.5 E F0([=)A F2(wor)A(d)-.37 E +F0(]] ...)A F1(export \255p)108 249.6 Q F0 .256(The supplied)144 261.6 R +F2(names)3.117 E F0 .257(are mark)3.027 F .257(ed for automatic e)-.1 F +.257(xport to the en)-.15 F .257(vironment of subsequently e)-.4 F -.15 +(xe)-.15 G(cuted).15 E 2.627(commands. If)144 273.6 R(the)2.627 E F1 +2.627 E F0 .127(option is gi)2.627 F -.15(ve)-.25 G .127(n, the) +.15 F F2(names)2.987 E F0 .127(refer to functions.)2.897 F .127(If no) +5.127 F F2(names)2.987 E F0 .127(are gi)2.897 F -.15(ve)-.25 G .126 +(n, or if the).15 F F1144 285.6 Q F0 .048 +(option is supplied, a list of names of all e)2.547 F .048(xported v) +-.15 F .048(ariables is printed.)-.25 F(The)5.048 E F12.548 E F0 +.048(option causes the)2.548 F -.15(ex)144 297.6 S 1.447 +(port property to be remo).15 F -.15(ve)-.15 G 3.947(df).15 G 1.447 +(rom each)-3.947 F F2(name)3.947 E F0 6.447(.I)C 3.947(fav)-6.447 G +1.447(ariable name is follo)-4.197 F 1.447(wed by =)-.25 F F2(wor)A(d) +-.37 E F0 3.946(,t)C(he)-3.946 E -.25(va)144 309.6 S .741(lue of the v) +.25 F .741(ariable is set to)-.25 F F2(wor)3.241 E(d)-.37 E F0(.)A F1 +(export)5.741 E F0 .742(returns an e)3.242 F .742 +(xit status of 0 unless an in)-.15 F -.25(va)-.4 G .742(lid option is) +.25 F .032(encountered, one of the)144 321.6 R F2(names)2.532 E F0 .032 +(is not a v)2.532 F .032(alid shell v)-.25 F .032(ariable name, or)-.25 +F F12.531 E F0 .031(is supplied with a)2.531 F F2(name)2.891 E F0 +(that)2.711 E(is not a function.)144 333.6 Q F1(fc)108 350.4 Q F0([)2.5 +E F1A F2(ename)2.5 E F0 2.5(][)C F1(\255lnr)-2.5 E F0 2.5(][)C F2 +<8c72>-2.5 E(st)-.1 E F0 2.5(][)C F2(last)-2.5 E F0(])A F1(fc \255s)108 +362.4 Q F0([)2.5 E F2(pat)A F0(=)A F2 -.37(re)C(p).37 E F0 2.5(][)C F2 +(cmd)-2.5 E F0(])A .431 +(The \214rst form selects a range of commands from)144 374.4 R F2<8c72> +4.842 E(st)-.1 E F0(to)3.612 E F2(last)3.022 E F0 .432 +(from the history list and displays or)3.612 F .142(edits and re-e)144 +386.4 R -.15(xe)-.15 G .142(cutes them.).15 F F2 -.45(Fi)5.141 G -.1(rs) +.45 G(t).1 E F0(and)3.321 E F2(last)2.731 E F0 .141 +(may be speci\214ed as a string \(to locate the last command)3.321 F(be) +144 398.4 Q .31(ginning with that string\) or as a number \(an inde)-.15 +F 2.811(xi)-.15 G .311(nto the history list, where a ne)-2.811 F -.05 +(ga)-.15 G(ti).05 E .611 -.15(ve n)-.25 H(umber).15 E .315 +(is used as an of)144 410.4 R .315 +(fset from the current command number\).)-.25 F(If)5.315 E F2(last)2.904 +E F0 .314(is not speci\214ed it is set to the cur)3.494 F(-)-.2 E .948 +(rent command for listing \(so that)144 422.4 R/F4 10/Courier@0 SF .948 +(fc \255l \25510)3.448 F F0 .948(prints the last 10 commands\) and to) +3.448 F F2<8c72>5.359 E(st)-.1 E F0(other)4.129 E(-)-.2 E 2.5(wise. If) +144 434.4 R F2<8c72>4.41 E(st)-.1 E F0 +(is not speci\214ed it is set to the pre)3.18 E +(vious command for editing and \25516 for listing.)-.25 E(The)144 458.4 +Q F12.522 E F0 .022 +(option suppresses the command numbers when listing.)2.522 F(The)5.022 E +F12.522 E F0 .022(option re)2.522 F -.15(ve)-.25 G .022 +(rses the order of).15 F .438(the commands.)144 470.4 R .438(If the) +5.438 F F12.938 E F0 .438(option is gi)2.938 F -.15(ve)-.25 G .438 +(n, the commands are listed on standard output.).15 F(Otherwise,)5.438 E +.335(the editor gi)144 482.4 R -.15(ve)-.25 G 2.835(nb).15 G(y)-2.835 E +F2(ename)3.025 E F0 .335(is in)3.015 F -.2(vo)-.4 G -.1(ke).2 G 2.835 +(do).1 G 2.835(na\214)-2.835 G .335(le containing those commands.)-2.835 +F(If)5.334 E F2(ename)3.024 E F0 .334(is not gi)3.014 F -.15(ve)-.25 G +(n,).15 E .63(the v)144 494.4 R .63(alue of the)-.25 F F3(FCEDIT)3.13 E +F0 -.25(va)2.88 G .631(riable is used, and the v).25 F .631(alue of)-.25 +F F3(EDIT)3.131 E(OR)-.162 E F0(if)2.881 E F3(FCEDIT)3.131 E F0 .631 +(is not set.)2.881 F .631(If nei-)5.631 F .951(ther v)144 506.4 R .951 +(ariable is set,)-.25 F F2(vi)5.117 E F0 .951(is used.)5.117 F .95 +(When editing is complete, the edited commands are echoed and)5.951 F +-.15(exe)144 518.4 S(cuted.).15 E .788(In the second form,)144 542.4 R +F2(command)3.288 E F0 .788(is re-e)3.288 F -.15(xe)-.15 G .788 +(cuted after each instance of).15 F F2(pat)3.288 E F0 .788 +(is replaced by)3.288 F F2 -.37(re)3.289 G(p).37 E F0(.)A F2(Com-)5.789 +E(mand)144 554.4 Q F0 .347(is intepreted the same as)2.847 F F2<8c72> +2.847 E(st)-.1 E F0(abo)2.847 E -.15(ve)-.15 G 5.347(.A).15 G .347 +(useful alias to use with this is)-2.5 F F4 .346(r='fc \255s')2.847 F F0 +2.846(,s)C 2.846(ot)-2.846 G(hat)-2.846 E(typing)144 566.4 Q F4 7.165 +(rc)3.665 G(c)-7.165 E F0 1.165(runs the last command be)3.665 F 1.166 +(ginning with)-.15 F F4(cc)3.666 E F0 1.166(and typing)3.666 F F4(r) +3.666 E F0(re-e)3.666 E -.15(xe)-.15 G 1.166(cutes the last com-).15 F +(mand.)144 578.4 Q .142(If the \214rst form is used, the return v)144 +602.4 R .142(alue is 0 unless an in)-.25 F -.25(va)-.4 G .142 +(lid option is encountered or).25 F F2<8c72>4.552 E(st)-.1 E F0(or)3.322 +E F2(last)2.732 E F0 .454(specify history lines out of range.)144 614.4 +R .454(If the)5.454 F F12.954 E F0 .454 +(option is supplied, the return v)2.954 F .455(alue is the v)-.25 F .455 +(alue of the)-.25 F .788(last command e)144 626.4 R -.15(xe)-.15 G .788 +(cuted or f).15 F .787 +(ailure if an error occurs with the temporary \214le of commands.)-.1 F +.787(If the)5.787 F 1.135 +(second form is used, the return status is that of the command re-e)144 +638.4 R -.15(xe)-.15 G 1.136(cuted, unless).15 F F2(cmd)3.836 E F0 1.136 +(does not)4.406 F(specify a v)144 650.4 Q +(alid history line, in which case)-.25 E F1(fc)2.5 E F0(returns f)2.5 E +(ailure.)-.1 E F1(fg)108 667.2 Q F0([)2.5 E F2(jobspec)A F0(])A(Resume) +144 679.2 Q F2(jobspec)5.654 E F0 1.413(in the fore)4.224 F 1.413 +(ground, and mak)-.15 F 3.913(ei)-.1 G 3.913(tt)-3.913 G 1.413 +(he current job)-3.913 F 6.413(.I)-.4 G(f)-6.413 E F2(jobspec)5.653 E F0 +1.413(is not present, the)4.223 F(shell')144 691.2 Q 3.116(sn)-.55 G +.616(otion of the)-3.116 F F2(curr)3.116 E .616(ent job)-.37 F F0 .617 +(is used.)3.116 F .617(The return v)5.617 F .617 +(alue is that of the command placed into the)-.25 F(fore)144 703.2 Q +.363(ground, or f)-.15 F .363 +(ailure if run when job control is disabled or)-.1 F 2.862(,w)-.4 G .362 +(hen run with job control enabled, if)-2.862 F F2(jobspec)145.74 715.2 Q +F0 .004(does not specify a v)2.814 F .004(alid job or)-.25 F F2(jobspec) +4.244 E F0 .004(speci\214es a job that w)2.814 F .004 +(as started without job control.)-.1 F(GNU Bash-4.2)72 768 Q +(2004 Apr 20)148.735 E(8)203.725 E 0 Cg EP +%%Page: 9 9 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF(getopts)108 84 Q/F2 10/Times-Italic@0 SF +(optstring name)2.5 E F0([)2.5 E F2(ar)A(gs)-.37 E F0(])A F1(getopts)144 +96 Q F0 .793 +(is used by shell procedures to parse positional parameters.)3.294 F F2 +(optstring)6.023 E F0 .793(contains the option)3.513 F .149 +(characters to be recognized; if a character is follo)144 108 R .15 +(wed by a colon, the option is e)-.25 F .15(xpected to ha)-.15 F .45 +-.15(ve a)-.2 H(n).15 E(ar)144 120 Q .579 +(gument, which should be separated from it by white space.)-.18 F .578 +(The colon and question mark char)5.579 F(-)-.2 E 1.665 +(acters may not be used as option characters.)144 132 R 1.665 +(Each time it is in)6.665 F -.2(vo)-.4 G -.1(ke).2 G(d,).1 E F1(getopts) +4.165 E F0 1.665(places the ne)4.165 F(xt)-.15 E .797 +(option in the shell v)144 144 R(ariable)-.25 E F2(name)3.297 E F0 3.297 +(,i).18 G(nitializing)-3.297 E F2(name)3.657 E F0 .797(if it does not e) +3.477 F .796(xist, and the inde)-.15 F 3.296(xo)-.15 G 3.296(ft)-3.296 G +.796(he ne)-3.296 F(xt)-.15 E(ar)144 156 Q .085 +(gument to be processed into the v)-.18 F(ariable)-.25 E/F3 9 +/Times-Bold@0 SF(OPTIND)2.585 E/F4 9/Times-Roman@0 SF(.)A F3(OPTIND) +4.585 E F0 .085(is initialized to 1 each time the shell)2.335 F .846 +(or a shell script is in)144 168 R -.2(vo)-.4 G -.1(ke).2 G 3.345 +(d. When).1 F .845(an option requires an ar)3.345 F(gument,)-.18 E F1 +(getopts)3.345 E F0 .845(places that ar)3.345 F(gument)-.18 E .803 +(into the v)144 180 R(ariable)-.25 E F3(OPT)3.303 E(ARG)-.81 E F4(.)A F0 +.803(The shell does not reset)5.303 F F3(OPTIND)3.303 E F0 .804 +(automatically; it must be manually)3.054 F .294 +(reset between multiple calls to)144 192 R F1(getopts)2.793 E F0 .293 +(within the same shell in)2.793 F -.2(vo)-.4 G .293(cation if a ne).2 F +2.793(ws)-.25 G .293(et of parameters)-2.793 F(is to be used.)144 204 Q +2.043(When the end of options is encountered,)144 228 R F1(getopts)4.543 +E F0 -.15(ex)4.543 G 2.043(its with a return v).15 F 2.044 +(alue greater than zero.)-.25 F F3(OPTIND)144 240 Q F0 +(is set to the inde)2.25 E 2.5(xo)-.15 G 2.5(ft)-2.5 G +(he \214rst non-option ar)-2.5 E(gument, and)-.18 E F2(name)2.5 E F0 +(is set to ?.)2.5 E F1(getopts)144 264 Q F0 2.393 +(normally parses the positional parameters, b)4.893 F 2.392 +(ut if more ar)-.2 F 2.392(guments are gi)-.18 F -.15(ve)-.25 G 4.892 +(ni).15 G(n)-4.892 E F2(ar)4.892 E(gs)-.37 E F0(,).27 E F1(getopts)144 +276 Q F0(parses those instead.)2.5 E F1(getopts)144 300 Q F0 1.165 +(can report errors in tw)3.665 F 3.665(ow)-.1 G 3.665(ays. If)-3.765 F +1.165(the \214rst character of)3.665 F F2(optstring)3.895 E F0 1.166 +(is a colon,)3.886 F F2(silent)4.006 E F0(error)4.346 E 1.071 +(reporting is used.)144 312 R 1.071 +(In normal operation, diagnostic messages are printed when in)6.071 F +-.25(va)-.4 G 1.07(lid options or).25 F .393(missing option ar)144 324 R +.393(guments are encountered.)-.18 F .394(If the v)5.394 F(ariable)-.25 +E F3(OPTERR)2.894 E F0 .394(is set to 0, no error messages)2.644 F +(will be displayed, e)144 336 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(ft)-2.5 +G(he \214rst character of)-2.5 E F2(optstring)2.73 E F0(is not a colon.) +2.72 E .667(If an in)144 360 R -.25(va)-.4 G .667(lid option is seen,) +.25 F F1(getopts)3.167 E F0 .667(places ? into)3.167 F F2(name)3.527 E +F0 .666(and, if not silent, prints an error message)3.347 F .399 +(and unsets)144 372 R F3(OPT)2.899 E(ARG)-.81 E F4(.)A F0(If)4.899 E F1 +(getopts)2.899 E F0 .399 +(is silent, the option character found is placed in)2.899 F F3(OPT)2.899 +E(ARG)-.81 E F0 .4(and no)2.65 F(diagnostic message is printed.)144 384 +Q 1.242(If a required ar)144 408 R 1.242(gument is not found, and)-.18 F +F1(getopts)3.741 E F0 1.241(is not silent, a question mark \()3.741 F F1 +(?).833 E F0 3.741(\)i).833 G 3.741(sp)-3.741 G 1.241(laced in)-3.741 F +F2(name)144 420 Q F0(,).18 E F3(OPT)2.734 E(ARG)-.81 E F0 .234 +(is unset, and a diagnostic message is printed.)2.484 F(If)5.234 E F1 +(getopts)2.734 E F0 .235(is silent, then a colon \()2.734 F F1(:).833 E +F0(\)).833 E(is placed in)144 432 Q F2(name)2.86 E F0(and)2.68 E F3(OPT) +2.5 E(ARG)-.81 E F0(is set to the option character found.)2.25 E F1 +(getopts)144 456 Q F0 .902 +(returns true if an option, speci\214ed or unspeci\214ed, is found.) +3.402 F .902(It returns f)5.902 F .901(alse if the end of)-.1 F +(options is encountered or an error occurs.)144 468 Q F1(hash)108 484.8 +Q F0([)2.5 E F1(\255lr)A F0 2.5(][)C F1-2.5 E F2(\214lename)2.5 E +F0 2.5(][)C F1(\255dt)-2.5 E F0 2.5(][)C F2(name)-2.5 E F0(])A .858 +(Each time)144 496.8 R F1(hash)3.358 E F0 .858(is in)3.358 F -.2(vo)-.4 +G -.1(ke).2 G .858(d, the full pathname of the command).1 F F2(name) +3.718 E F0 .858(is determined by searching)3.538 F .956 +(the directories in)144 508.8 R F1($P)3.456 E -.95(AT)-.74 G(H).95 E F0 +.956(and remembered.)3.456 F(An)5.956 E 3.456(yp)-.15 G(re)-3.456 E .956 +(viously-remembered pathname is discarded.)-.25 F .242(If the)144 520.8 +R F12.742 E F0 .243 +(option is supplied, no path search is performed, and)2.742 F F2 +(\214lename)4.653 E F0 .243(is used as the full \214lename)2.923 F 1.712 +(of the command.)144 532.8 R(The)6.712 E F14.212 E F0 1.711 +(option causes the shell to for)4.212 F 1.711 +(get all remembered locations.)-.18 F(The)6.711 E F14.211 E F0 +.833(option causes the shell to for)144 544.8 R .833 +(get the remembered location of each)-.18 F F2(name)3.333 E F0 5.833(.I) +C 3.333(ft)-5.833 G(he)-3.333 E F13.333 E F0 .833(option is sup-) +3.333 F .704(plied, the full pathname to which each)144 556.8 R F2(name) +3.204 E F0 .703(corresponds is printed.)3.204 F .703(If multiple)5.703 F +F2(name)3.203 E F0(ar)3.203 E(guments)-.18 E .795(are supplied with)144 +568.8 R F13.295 E F0 3.295(,t)C(he)-3.295 E F2(name)3.295 E F0 +.795(is printed before the hashed full pathname.)3.295 F(The)5.795 E F1 +3.295 E F0 .795(option causes)3.295 F .934 +(output to be displayed in a format that may be reused as input.)144 +580.8 R .934(If no ar)5.934 F .934(guments are gi)-.18 F -.15(ve)-.25 G +.934(n, or if).15 F(only)144 592.8 Q F12.821 E F0 .321 +(is supplied, information about remembered commands is printed.)2.821 F +.322(The return status is true)5.322 F(unless a)144 604.8 Q F2(name)2.86 +E F0(is not found or an in)2.68 E -.25(va)-.4 G(lid option is supplied.) +.25 E F1(help)108 621.6 Q F0([)2.5 E F1(\255dms)A F0 2.5(][)C F2 +(pattern)-2.5 E F0(])A .867(Display helpful information about b)144 +633.6 R .867(uiltin commands.)-.2 F(If)5.867 E F2(pattern)4.617 E F0 +.866(is speci\214ed,)3.607 F F1(help)3.366 E F0(gi)3.366 E -.15(ve)-.25 +G 3.366(sd).15 G(etailed)-3.366 E .306(help on all commands matching)144 +645.6 R F2(pattern)2.806 E F0 2.807(;o).24 G .307 +(therwise help for all the b)-2.807 F .307 +(uiltins and shell control struc-)-.2 F(tures is printed.)144 657.6 Q F1 +144 669.6 Q F0(Display a short description of each)24.74 E F2 +(pattern)2.5 E F1144 681.6 Q F0(Display the description of each) +21.97 E F2(pattern)2.5 E F0(in a manpage-lik)2.5 E 2.5(ef)-.1 G(ormat) +-2.5 E F1144 693.6 Q F0 +(Display only a short usage synopsis for each)26.41 E F2(pattern)2.5 E +F0(The return status is 0 unless no command matches)144 710.4 Q F2 +(pattern)2.5 E F0(.).24 E(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(9) +203.725 E 0 Cg EP +%%Page: 10 10 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF(history [)108 84 Q/F2 10/Times-Italic@0 SF(n)A F1(])A +(history \255c)108 96 Q(history \255d)108 108 Q F2(of)2.5 E(fset)-.18 E +F1(history \255anrw)108 120 Q F0([)2.5 E F2(\214lename)A F0(])A F1 +(history \255p)108 132 Q F2(ar)2.5 E(g)-.37 E F0([)2.5 E F2(ar)A 2.5(g.) +-.37 G(..)-2.5 E F0(])A F1(history \255s)108 144 Q F2(ar)2.5 E(g)-.37 E +F0([)2.5 E F2(ar)A 2.5(g.)-.37 G(..)-2.5 E F0(])A -.4(Wi)144 156 S .752 +(th no options, display the command history list with line numbers.).4 F +.752(Lines listed with a)5.752 F F1(*)3.251 E F0(ha)3.251 E -.15(ve)-.2 +G .38(been modi\214ed.)144 168 R .38(An ar)5.38 F .38(gument of)-.18 F +F2(n)3.24 E F0 .38(lists only the last)3.12 F F2(n)3.24 E F0 2.88 +(lines. If)3.12 F .38(the shell v)2.88 F(ariable)-.25 E/F3 9 +/Times-Bold@0 SF(HISTTIMEFOR-)2.881 E(MA)144 180 Q(T)-.855 E F0 .265 +(is set and not null, it is used as a format string for)2.515 F F2 +(strftime)2.764 E F0 .264(\(3\) to display the time stamp asso-)B 1.019 +(ciated with each displayed history entry)144 192 R 6.019(.N)-.65 G +3.519(oi)-6.019 G(nterv)-3.519 E 1.019 +(ening blank is printed between the formatted)-.15 F .176 +(time stamp and the history line.)144 204 R(If)5.176 E F2(\214lename) +2.676 E F0 .176 +(is supplied, it is used as the name of the history \214le; if)2.676 F +(not, the v)144 216 Q(alue of)-.25 E F3(HISTFILE)2.5 E F0(is used.)2.25 +E(Options, if supplied, ha)5 E .3 -.15(ve t)-.2 H(he follo).15 E +(wing meanings:)-.25 E F1144 228 Q F0 +(Clear the history list by deleting all the entries.)25.86 E F1144 +240 Q F2(of)2.5 E(fset)-.18 E F0(Delete the history entry at position) +180 252 Q F2(of)2.5 E(fset)-.18 E F0(.)A F1144 264 Q F0 .598 +(Append the `)25.3 F(`ne)-.74 E(w')-.25 E 3.098('h)-.74 G .598 +(istory lines \(history lines entered since the be)-3.098 F .599 +(ginning of the current)-.15 F F1(bash)180 276 Q F0 +(session\) to the history \214le.)2.5 E F1144 288 Q F0 .854(Read \ +the history lines not already read from the history \214le into the cur\ +rent history list.)24.74 F .772 +(These are lines appended to the history \214le since the be)180 300 R +.773(ginning of the current)-.15 F F1(bash)3.273 E F0(ses-)3.273 E +(sion.)180 312 Q F1144 324 Q F0(Read the contents of the history \ +\214le and append them to the current history list.)25.86 E F1144 +336 Q F0(Write the current history list to the history \214le, o)23.08 E +-.15(ve)-.15 G(rwriting the history \214le').15 E 2.5(sc)-.55 G +(ontents.)-2.5 E F1144 348 Q F0 .626 +(Perform history substitution on the follo)24.74 F(wing)-.25 E F2(ar) +3.125 E(gs)-.37 E F0 .625(and display the result on the standard)3.125 F +2.975(output. Does)180 360 R .475 +(not store the results in the history list.)2.975 F(Each)5.475 E F2(ar) +2.975 E(g)-.37 E F0 .475(must be quoted to disable)2.975 F +(normal history e)180 372 Q(xpansion.)-.15 E F1144 384 Q F0 .363 +(Store the)26.41 F F2(ar)3.193 E(gs)-.37 E F0 .363 +(in the history list as a single entry)3.133 F 5.363(.T)-.65 G .362 +(he last command in the history list is)-5.363 F(remo)180 396 Q -.15(ve) +-.15 G 2.5(db).15 G(efore the)-2.5 E F2(ar)2.83 E(gs)-.37 E F0 +(are added.)2.77 E .145(If the)144 412.8 R F3(HISTTIMEFORMA)2.645 E(T) +-.855 E F0 -.25(va)2.395 G .145 +(riable is set, the time stamp information associated with each history) +.25 F .669(entry is written to the history \214le, mark)144 424.8 R .669 +(ed with the history comment character)-.1 F 5.668(.W)-.55 G .668 +(hen the history)-5.668 F .955(\214le is read, lines be)144 436.8 R .956 +(ginning with the history comment character follo)-.15 F .956 +(wed immediately by a digit)-.25 F .416 +(are interpreted as timestamps for the pre)144 448.8 R .416 +(vious history line.)-.25 F .416(The return v)5.416 F .415 +(alue is 0 unless an in)-.25 F -.25(va)-.4 G(lid).25 E .499(option is e\ +ncountered, an error occurs while reading or writing the history \214le\ +, an in)144 460.8 R -.25(va)-.4 G(lid).25 E F2(of)3 E(fset)-.18 E F0(is) +3 E(supplied as an ar)144 472.8 Q(gument to)-.18 E F12.5 E F0 2.5 +(,o)C 2.5(rt)-2.5 G(he history e)-2.5 E(xpansion supplied as an ar)-.15 +E(gument to)-.18 E F12.5 E F0 -.1(fa)2.5 G(ils.).1 E F1(jobs)108 +489.6 Q F0([)2.5 E F1(\255lnprs)A F0 2.5(][)C F2(jobspec)A F0(... ])2.5 +E F1(jobs \255x)108 501.6 Q F2(command)2.5 E F0([)2.5 E F2(ar)2.5 E(gs) +-.37 E F0(... ])2.5 E(The \214rst form lists the acti)144 513.6 Q .3 +-.15(ve j)-.25 H 2.5(obs. The).15 F(options ha)2.5 E .3 -.15(ve t)-.2 H +(he follo).15 E(wing meanings:)-.25 E F1144 525.6 Q F0 +(List process IDs in addition to the normal information.)27.52 E F1 +144 537.6 Q F0 .194(Display information only about jobs that ha) +24.74 F .494 -.15(ve c)-.2 H .193(hanged status since the user w).15 F +.193(as last noti-)-.1 F(\214ed of their status.)180 549.6 Q F1144 +561.6 Q F0(List only the process ID of the job')24.74 E 2.5(sp)-.55 G +(rocess group leader)-2.5 E(.)-.55 E F1144 573.6 Q F0 +(Display only running jobs.)25.86 E F1144 585.6 Q F0 +(Display only stopped jobs.)26.41 E(If)144 602.4 Q F2(jobspec)4.553 E F0 +.313(is gi)3.123 F -.15(ve)-.25 G .313 +(n, output is restricted to information about that job).15 F 5.314(.T) +-.4 G .314(he return status is 0 unless)-5.314 F(an in)144 614.4 Q -.25 +(va)-.4 G(lid option is encountered or an in).25 E -.25(va)-.4 G(lid).25 +E F2(jobspec)4.24 E F0(is supplied.)2.81 E .395(If the)144 631.2 R F1 +2.895 E F0 .394(option is supplied,)2.894 F F1(jobs)2.894 E F0 +.394(replaces an)2.894 F(y)-.15 E F2(jobspec)4.634 E F0 .394(found in) +3.204 F F2(command)3.094 E F0(or)3.664 E F2(ar)3.224 E(gs)-.37 E F0 .394 +(with the corre-)3.164 F(sponding process group ID, and e)144 643.2 Q +-.15(xe)-.15 G(cutes).15 E F2(command)2.7 E F0(passing it)3.27 E F2(ar) +2.5 E(gs)-.37 E F0 2.5(,r).27 G(eturning its e)-2.5 E(xit status.)-.15 E +F1(kill)108 660 Q F0([)2.5 E F1A F2(sigspec)2.5 E F0(|)2.5 E F1 +2.5 E F2(signum)2.5 E F0(|)2.5 E F12.5 E F2(sigspec)A F0 2.5 +(][)C F2(pid)-2.5 E F0(|)2.5 E F2(jobspec)2.5 E F0 2.5(].)C(..)-2.5 E F1 +(kill \255l)108 672 Q F0([)2.5 E F2(sigspec)A F0(|)2.5 E F2 -.2(ex)2.5 G +(it_status).2 E F0(])A .119(Send the signal named by)144 684 R F2 +(sigspec)2.959 E F0(or)2.929 E F2(signum)2.959 E F0 .119 +(to the processes named by)2.939 F F2(pid)3.87 E F0(or)3.39 E F2 +(jobspec)2.62 E F0(.).31 E F2(sigspec)5.46 E F0(is)2.93 E .319 +(either a case-insensiti)144 696 R .619 -.15(ve s)-.25 H .319 +(ignal name such as).15 F F3(SIGKILL)2.819 E F0 .318 +(\(with or without the)2.569 F F3(SIG)2.818 E F0 .318 +(pre\214x\) or a signal)2.568 F(number;)144 708 Q F2(signum)4.188 E F0 +1.349(is a signal number)4.168 F 6.349(.I)-.55 G(f)-6.349 E F2(sigspec) +4.189 E F0 1.349(is not present, then)4.159 F F3(SIGTERM)3.849 E F0 +1.349(is assumed.)3.599 F(An)6.349 E(ar)144 720 Q .523(gument of)-.18 F +F13.023 E F0 .523(lists the signal names.)3.023 F .523(If an)5.523 +F 3.023(ya)-.15 G -.18(rg)-3.023 G .523(uments are supplied when).18 F +F13.023 E F0 .523(is gi)3.023 F -.15(ve)-.25 G .523(n, the names) +.15 F(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(10)198.725 E 0 Cg EP +%%Page: 11 11 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E .28 +(of the signals corresponding to the ar)144 84 R .28 +(guments are listed, and the return status is 0.)-.18 F(The)5.28 E/F1 10 +/Times-Italic@0 SF -.2(ex)2.78 G(it_status).2 E F0(ar)144 96 Q .378 +(gument to)-.18 F/F2 10/Times-Bold@0 SF2.878 E F0 .378 +(is a number specifying either a signal number or the e)2.878 F .377 +(xit status of a process termi-)-.15 F .593(nated by a signal.)144 108 R +F2(kill)5.593 E F0 .593(returns true if at least one signal w)3.093 F +.593(as successfully sent, or f)-.1 F .594(alse if an error)-.1 F +(occurs or an in)144 120 Q -.25(va)-.4 G(lid option is encountered.).25 +E F2(let)108 136.8 Q F1(ar)2.5 E(g)-.37 E F0([)2.5 E F1(ar)A(g)-.37 E F0 +(...])2.5 E(Each)144 148.8 Q F1(ar)3.027 E(g)-.37 E F0 .197 +(is an arithmetic e)2.917 F .197(xpression to be e)-.15 F -.25(va)-.25 G +.196(luated \(see).25 F/F3 9/Times-Bold@0 SF .196(ARITHMETIC EV)2.696 F +(ALU)-1.215 E -.855(AT)-.54 G(ION).855 E F0(abo)2.446 E -.15(ve)-.15 G +2.696(\). If).15 F(the last)144 160.8 Q F1(ar)2.83 E(g)-.37 E F0 -.25 +(eva)2.72 G(luates to 0,).25 E F2(let)2.5 E F0 +(returns 1; 0 is returned otherwise.)2.5 E F2(local)108 177.6 Q F0([)2.5 +E F1(option)A F0 2.5(][)C F1(name)-2.5 E F0([=)A F1(value)A F0 2.5(].)C +(..])-2.5 E -.15(Fo)144 189.6 S 2.56(re).15 G .06(ach ar)-2.56 F .06 +(gument, a local v)-.18 F .06(ariable named)-.25 F F1(name)2.92 E F0 .06 +(is created, and assigned)2.74 F F1(value)2.56 E F0 5.06(.T).18 G(he) +-5.06 E F1(option)2.56 E F0 .06(can be)2.56 F(an)144 201.6 Q 3.153(yo) +-.15 G 3.153(ft)-3.153 G .653(he options accepted by)-3.153 F F2(declar) +3.153 E(e)-.18 E F0 5.652(.W)C(hen)-5.652 E F2(local)3.152 E F0 .652 +(is used within a function, it causes the v)3.152 F(ari-)-.25 E(able)144 +213.6 Q F1(name)3.72 E F0 .86(to ha)3.54 F 1.16 -.15(ve a v)-.2 H .861 +(isible scope restricted to that function and its children.).15 F -.4 +(Wi)5.861 G .861(th no operands,).4 F F2(local)144 225.6 Q F0 1.165 +(writes a list of local v)3.665 F 1.165 +(ariables to the standard output.)-.25 F 1.165(It is an error to use) +6.165 F F2(local)3.664 E F0 1.164(when not)3.664 F .232 +(within a function.)144 237.6 R .233(The return status is 0 unless)5.232 +F F2(local)2.733 E F0 .233(is used outside a function, an in)2.733 F +-.25(va)-.4 G(lid).25 E F1(name)3.093 E F0(is)2.913 E(supplied, or)144 +249.6 Q F1(name)2.5 E F0(is a readonly v)2.5 E(ariable.)-.25 E F2 +(logout)108 266.4 Q F0(Exit a login shell.)9.33 E F2(map\214le)108 283.2 +Q F0([)2.5 E F2A F1(count)2.5 E F0 2.5(][)C F2-2.5 E F1 +(origin)2.5 E F0 2.5(][)C F2-2.5 E F1(count)2.5 E F0 2.5(][)C F2 +-2.5 E F0 2.5(][)C F2-2.5 E F1(fd)2.5 E F0 2.5(][)C F2 +-2.5 E F1(callbac)2.5 E(k)-.2 E F0 2.5(][)C F2-2.5 E F1(quantum) +2.5 E F0 2.5(][)C F1(arr)-2.5 E(ay)-.15 E F0(])A F2 -.18(re)108 295.2 S +(adarray).18 E F0([)2.5 E F2A F1(count)2.5 E F0 2.5(][)C F2 +-2.5 E F1(origin)2.5 E F0 2.5(][)C F2-2.5 E F1(count)2.5 E F0 2.5 +(][)C F2-2.5 E F0 2.5(][)C F2-2.5 E F1(fd)2.5 E F0 2.5(][)C +F2-2.5 E F1(callbac)2.5 E(k)-.2 E F0 2.5(][)C F2-2.5 E F1 +(quantum)2.5 E F0 2.5(][)C F1(arr)-2.5 E(ay)-.15 E F0(])A .351 +(Read lines from the standard input into the inde)144 307.2 R -.15(xe) +-.15 G 2.851(da).15 G .351(rray v)-2.851 F(ariable)-.25 E F1(arr)2.85 E +(ay)-.15 E F0 2.85(,o).32 G 2.85(rf)-2.85 G .35(rom \214le descriptor) +-2.85 F F1(fd)2.85 E F0 1.248(if the)144 319.2 R F23.748 E F0 +1.248(option is supplied.)3.748 F 1.249(The v)6.249 F(ariable)-.25 E F3 +(MAPFILE)3.749 E F0 1.249(is the def)3.499 F(ault)-.1 E F1(arr)3.749 E +(ay)-.15 E F0 6.249(.O)C 1.249(ptions, if supplied,)-6.249 F(ha)144 +331.2 Q .3 -.15(ve t)-.2 H(he follo).15 E(wing meanings:)-.25 E F2 +144 343.2 Q F0(Cop)24.74 E 2.5(ya)-.1 G 2.5(tm)-2.5 G(ost)-2.5 E F1 +(count)2.7 E F0 2.5(lines. If)3.18 F F1(count)2.5 E F0 +(is 0, all lines are copied.)2.5 E F2144 355.2 Q F0(Be)22.52 E +(gin assigning to)-.15 E F1(arr)2.83 E(ay)-.15 E F0(at inde)2.82 E(x) +-.15 E F1(origin)2.5 E F0 5(.T).24 G(he def)-5 E(ault inde)-.1 E 2.5(xi) +-.15 G 2.5(s0)-2.5 G(.)-2.5 E F2144 367.2 Q F0 +(Discard the \214rst)26.41 E F1(count)2.5 E F0(lines read.)2.5 E F2 +144 379.2 Q F0(Remo)26.97 E .3 -.15(ve a t)-.15 H(railing ne).15 E +(wline from each line read.)-.25 E F2144 391.2 Q F0 +(Read lines from \214le descriptor)24.74 E F1(fd)2.5 E F0 +(instead of the standard input.)2.5 E F2144 403.2 Q F0(Ev)23.08 E +(aluate)-.25 E F1(callbac)2.7 E(k)-.2 E F0(each time)3.17 E F1(quantum) +2.5 E F0(lines are read.)2.5 E(The)5 E F22.5 E F0 +(option speci\214es)2.5 E F1(quantum)2.5 E F0(.).32 E F2144 415.2 +Q F0(Specify the number of lines read between each call to)25.86 E F1 +(callbac)2.5 E(k)-.2 E F0(.).67 E(If)144 432 Q F22.968 E F0 .467 +(is speci\214ed without)2.967 F F22.967 E F0 2.967(,t)C .467 +(he def)-2.967 F .467(ault quantum is 5000.)-.1 F(When)5.467 E F1 +(callbac)2.967 E(k)-.2 E F0 .467(is e)2.967 F -.25(va)-.25 G .467 +(luated, it is sup-).25 F .261(plied the inde)144 444 R 2.761(xo)-.15 G +2.761(ft)-2.761 G .261(he ne)-2.761 F .262(xt array element to be assig\ +ned and the line to be assigned to that element)-.15 F .275 +(as additional ar)144 456 R(guments.)-.18 E F1(callbac)5.275 E(k)-.2 E +F0 .275(is e)2.775 F -.25(va)-.25 G .274 +(luated after the line is read b).25 F .274 +(ut before the array element is)-.2 F(assigned.)144 468 Q +(If not supplied with an e)144 484.8 Q(xplicit origin,)-.15 E F2 +(map\214le)2.5 E F0(will clear)2.5 E F1(arr)2.5 E(ay)-.15 E F0 +(before assigning to it.)2.5 E F2(map\214le)144 501.6 Q F0 1.905 +(returns successfully unless an in)4.405 F -.25(va)-.4 G 1.905 +(lid option or option ar).25 F 1.906(gument is supplied,)-.18 F F1(arr) +4.406 E(ay)-.15 E F0(is)4.406 E(in)144 513.6 Q -.25(va)-.4 G +(lid or unassignable, or if).25 E F1(arr)2.5 E(ay)-.15 E F0 +(is not an inde)2.5 E -.15(xe)-.15 G 2.5(da).15 G(rray)-2.5 E(.)-.65 E +F2(popd)108 530.4 Q F0<5bad>2.5 E F2(n)A F0 2.5(][)C(+)-2.5 E F1(n)A F0 +2.5(][)C-2.5 E F1(n)A F0(])A(Remo)144 542.4 Q -.15(ve)-.15 G 2.8(se) +.15 G .3(ntries from the directory stack.)-2.8 F -.4(Wi)5.299 G .299 +(th no ar).4 F .299(guments, remo)-.18 F -.15(ve)-.15 G 2.799(st).15 G +.299(he top directory from the)-2.799 F 1.478(stack, and performs a)144 +554.4 R F2(cd)3.978 E F0 1.479(to the ne)3.978 F 3.979(wt)-.25 G 1.479 +(op directory)-3.979 F 6.479(.A)-.65 G -.18(rg)-6.479 G 1.479 +(uments, if supplied, ha).18 F 1.779 -.15(ve t)-.2 H 1.479(he follo).15 +F(wing)-.25 E(meanings:)144 566.4 Q F2144 578.4 Q F0 .551 +(Suppresses the normal change of directory when remo)24.74 F .551 +(ving directories from the stack, so)-.15 F +(that only the stack is manipulated.)180 590.4 Q F2(+)144 602.4 Q F1(n)A +F0(Remo)25.3 E -.15(ve)-.15 G 2.64(st).15 G(he)-2.64 E F1(n)2.64 E F0 +.14(th entry counting from the left of the list sho)B .14(wn by)-.25 F +F2(dirs)2.64 E F0 2.64(,s)C .14(tarting with zero.)-2.64 F -.15(Fo)180 +614.4 S 2.5(re).15 G(xample:)-2.65 E/F4 10/Courier@0 SF(popd +0)2.5 E F0 +(remo)2.5 E -.15(ve)-.15 G 2.5(st).15 G(he \214rst directory)-2.5 E(,) +-.65 E F4(popd +1)2.5 E F0(the second.)2.5 E F2144 626.4 Q F1(n)A F0 +(Remo)25.3 E -.15(ve)-.15 G 3.76(st).15 G(he)-3.76 E F1(n)3.76 E F0 +1.259(th entry counting from the right of the list sho)B 1.259(wn by) +-.25 F F2(dirs)3.759 E F0 3.759(,s)C 1.259(tarting with)-3.759 F 2.5 +(zero. F)180 638.4 R(or e)-.15 E(xample:)-.15 E F4(popd -0)2.5 E F0 +(remo)2.5 E -.15(ve)-.15 G 2.5(st).15 G(he last directory)-2.5 E(,)-.65 +E F4(popd -1)2.5 E F0(the ne)2.5 E(xt to last.)-.15 E .643(If the)144 +655.2 R F2(popd)3.143 E F0 .643(command is successful, a)3.143 F F2 +(dirs)3.143 E F0 .644(is performed as well, and the return status is 0.) +3.143 F F2(popd)5.644 E F0 .416(returns f)144 667.2 R .416 +(alse if an in)-.1 F -.25(va)-.4 G .415 +(lid option is encountered, the directory stack is empty).25 F 2.915 +(,an)-.65 G(on-e)-2.915 E .415(xistent direc-)-.15 F +(tory stack entry is speci\214ed, or the directory change f)144 679.2 Q +(ails.)-.1 E F2(printf)108 696 Q F0([)2.5 E F2A F1(var)2.5 E F0(]) +A F1(format)2.5 E F0([)2.5 E F1(ar)A(guments)-.37 E F0(])A 1.436 +(Write the formatted)144 708 R F1(ar)3.936 E(guments)-.37 E F0 1.437 +(to the standard output under the control of the)3.936 F F1(format)3.937 +E F0 6.437(.T)C(he)-6.437 E F23.937 E F0 .126 +(option causes the output to be assigned to the v)144 720 R(ariable)-.25 +E F1(var)2.626 E F0 .126(rather than being printed to the standard)2.626 +F(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(11)198.725 E 0 Cg EP +%%Page: 12 12 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E(output.)144 +84 Q(The)144 108 Q/F1 10/Times-Italic@0 SF(format)3.017 E F0 .517(is a \ +character string which contains three types of objects: plain character\ +s, which are)3.017 F .704(simply copied to standard output, character e\ +scape sequences, which are con)144 120 R -.15(ve)-.4 G .703 +(rted and copied to).15 F .036(the standard output, and format speci\ +\214cations, each of which causes printing of the ne)144 132 R .037 +(xt successi)-.15 F -.15(ve)-.25 G F1(ar)144 144 Q(gument)-.37 E F0 +5.532(.I)C 3.032(na)-5.532 G .532(ddition to the standard)-3.032 F F1 +(printf)3.032 E F0 .532(\(1\) format speci\214cations,)B/F2 10 +/Times-Bold@0 SF(printf)3.031 E F0 .531(interprets the follo)3.031 F(w-) +-.25 E(ing e)144 156 Q(xtensions:)-.15 E F2(%b)144 168 Q F0(causes)20.44 +E F2(printf)5.115 E F0 2.615(to e)5.115 F 2.615 +(xpand backslash escape sequences in the corresponding)-.15 F F1(ar) +5.115 E(gument)-.37 E F0(\(e)180 180 Q .608(xcept that)-.15 F F2(\\c) +3.108 E F0 .608(terminates output, backslashes in)3.108 F F2<5c08>3.108 +E F0(,)A F2(\\")3.108 E F0 3.108(,a)C(nd)-3.108 E F2(\\?)3.108 E F0 .608 +(are not remo)3.108 F -.15(ve)-.15 G .608(d, and octal).15 F(escapes be) +180 192 Q(ginning with)-.15 E F2(\\0)2.5 E F0 +(may contain up to four digits\).)2.5 E F2(%q)144 204 Q F0(causes)20.44 +E F2(printf)2.51 E F0 .01(to output the corresponding)2.51 F F1(ar)2.51 +E(gument)-.37 E F0 .01(in a format that can be reused as shell)2.51 F +(input.)180 216 Q F2(%\()144 228 Q F1(datefmt)A F2(\)T)A F0(causes)180 +240 Q F2(printf)4.404 E F0 1.904 +(to output the date-time string resulting from using)4.404 F F1(datefmt) +4.404 E F0 1.903(as a format)4.404 F .38(string for)180 252 R F1 +(strftime)2.881 E F0 2.881(\(3\). The)B(corresponding)2.881 E F1(ar) +2.881 E(gument)-.37 E F0 .381(is an inte)2.881 F .381 +(ger representing the number)-.15 F .458(of seconds since the epoch.)180 +264 R -1 -.8(Tw o)5.458 H .458(special ar)3.758 F .458(gument v)-.18 F +.458(alues may be used: -1 represents the)-.25 F .847 +(current time, and -2 represents the time the shell w)180 276 R .847 +(as in)-.1 F -.2(vo)-.4 G -.1(ke).2 G 3.348(d. If).1 F .848(no ar)3.348 +F .848(gument is speci-)-.18 F .355(\214ed, con)180 288 R -.15(ve)-.4 G +.355(rsion beha).15 F -.15(ve)-.2 G 2.855(sa).15 G 2.855(si)-2.855 G +2.855(f-)-2.855 G 2.855(1h)-2.855 G .354(ad been gi)-2.855 F -.15(ve) +-.25 G 2.854(n. This).15 F .354(is an e)2.854 F .354 +(xception to the usual)-.15 F F2(printf)2.854 E F0(beha)180 300 Q(vior) +-.2 E(.)-.55 E(Ar)144 316.8 Q .463(guments to non-string format speci\ +\214ers are treated as C constants, e)-.18 F .464 +(xcept that a leading plus or)-.15 F 1.259(minus sign is allo)144 328.8 +R 1.259 +(wed, and if the leading character is a single or double quote, the v) +-.25 F 1.258(alue is the)-.25 F(ASCII v)144 340.8 Q(alue of the follo) +-.25 E(wing character)-.25 E(.)-.55 E(The)144 357.6 Q F1(format)3.423 E +F0 .923(is reused as necessary to consume all of the)3.423 F F1(ar)3.423 +E(guments)-.37 E F0 5.923(.I)C 3.423(ft)-5.923 G(he)-3.423 E F1(format) +3.423 E F0 .924(requires more)3.424 F F1(ar)144 369.6 Q(guments)-.37 E +F0 .033(than are supplied, the e)2.534 F .033 +(xtra format speci\214cations beha)-.15 F .333 -.15(ve a)-.2 H 2.533(si) +.15 G 2.533(faz)-2.533 G .033(ero v)-2.533 F .033(alue or null string,) +-.25 F(as appropriate, had been supplied.)144 381.6 Q(The return v)5 E +(alue is zero on success, non-zero on f)-.25 E(ailure.)-.1 E F2(pushd) +108 398.4 Q F0([)2.5 E F2A F0 2.5(][)C(+)-2.5 E F1(n)A F0 2.5(][)C +-2.5 E F1(n)A F0(])A F2(pushd)108 410.4 Q F0([)2.5 E F2A F0 +2.5(][)C F1(dir)-2.5 E F0(])A .639(Adds a directory to the top of the d\ +irectory stack, or rotates the stack, making the ne)144 422.4 R 3.14(wt) +-.25 G .64(op of the)-3.14 F 1.316(stack the current w)144 434.4 R 1.316 +(orking directory)-.1 F 6.316(.W)-.65 G 1.315(ith no ar)-6.716 F 1.315 +(guments, e)-.18 F 1.315(xchanges the top tw)-.15 F 3.815(od)-.1 G 1.315 +(irectories and)-3.815 F .871 +(returns 0, unless the directory stack is empty)144 446.4 R 5.871(.A) +-.65 G -.18(rg)-5.871 G .872(uments, if supplied, ha).18 F 1.172 -.15 +(ve t)-.2 H .872(he follo).15 F .872(wing mean-)-.25 F(ings:)144 458.4 Q +F2144 470.4 Q F0 .902(Suppresses the normal change of directory w\ +hen adding directories to the stack, so that)24.74 F +(only the stack is manipulated.)180 482.4 Q F2(+)144 494.4 Q F1(n)A F0 +1.267(Rotates the stack so that the)25.3 F F1(n)3.767 E F0 1.268 +(th directory \(counting from the left of the list sho)B 1.268(wn by) +-.25 F F2(dirs)180 506.4 Q F0 2.5(,s)C +(tarting with zero\) is at the top.)-2.5 E F2144 518.4 Q F1(n)A F0 +.92(Rotates the stack so that the)25.3 F F1(n)3.42 E F0 .92 +(th directory \(counting from the right of the list sho)B .92(wn by)-.25 +F F2(dirs)180 530.4 Q F0 2.5(,s)C(tarting with zero\) is at the top.) +-2.5 E F1(dir)144.35 542.4 Q F0(Adds)23.98 E F1(dir)3.137 E F0 .287 +(to the directory stack at the top, making it the ne)3.517 F 2.788(wc) +-.25 G .288(urrent w)-2.788 F .288(orking directory as)-.1 F +(if it had been supplied as the ar)180 554.4 Q(gument to the)-.18 E F2 +(cd)2.5 E F0 -.2(bu)2.5 G(iltin.).2 E .489(If the)144 571.2 R F2(pushd) +2.989 E F0 .489(command is successful, a)2.989 F F2(dirs)2.988 E F0 .488 +(is performed as well.)2.988 F .488(If the \214rst form is used,)5.488 F +F2(pushd)2.988 E F0 1.039(returns 0 unless the cd to)144 583.2 R F1(dir) +3.889 E F0 -.1(fa)4.269 G 3.539(ils. W).1 F 1.039(ith the second form,) +-.4 F F2(pushd)3.54 E F0 1.04(returns 0 unless the directory)3.54 F .847 +(stack is empty)144 595.2 R 3.347(,an)-.65 G(on-e)-3.347 E .847(xistent\ + directory stack element is speci\214ed, or the directory change to the) +-.15 F(speci\214ed ne)144 607.2 Q 2.5(wc)-.25 G(urrent directory f)-2.5 +E(ails.)-.1 E F2(pwd)108 624 Q F0([)2.5 E F2(\255LP)A F0(])A .844 +(Print the absolute pathname of the current w)144 636 R .845 +(orking directory)-.1 F 5.845(.T)-.65 G .845 +(he pathname printed contains no)-5.845 F .182(symbolic links if the)144 +648 R F22.681 E F0 .181(option is supplied or the)2.681 F F2 .181 +(\255o ph)2.681 F(ysical)-.15 E F0 .181(option to the)2.681 F F2(set) +2.681 E F0 -.2(bu)2.681 G .181(iltin command is).2 F 3.263(enabled. If) +144 660 R(the)3.263 E F23.263 E F0 .763 +(option is used, the pathname printed may contain symbolic links.)3.263 +F .764(The return)5.764 F 1.36(status is 0 unless an error occurs while\ + reading the name of the current directory or an in)144 672 R -.25(va) +-.4 G(lid).25 E(option is supplied.)144 684 Q F2 -.18(re)108 700.8 S(ad) +.18 E F0([)3.816 E F2(\255ers)A F0 3.816(][)C F2-3.816 E F1(aname) +3.816 E F0 3.816(][)C F2-3.816 E F1(delim)3.816 E F0 3.816(][)C F2 +-3.816 E F1(te)3.816 E(xt)-.2 E F0 3.816(][)C F2-3.816 E F1 +(nc)3.816 E(har)-.15 E(s)-.1 E F0 3.817(][)C F2-3.817 E F1(nc) +3.817 E(har)-.15 E(s)-.1 E F0 3.817(][)C F2-3.817 E F1(pr)3.817 E +(ompt)-.45 E F0 3.817(][)C F2-3.817 E F1(timeout)3.817 E F0 3.817 +(][)C F2-3.817 E F1(fd)3.817 E F0(])A([)108 712.8 Q F1(name)A F0 +(...])2.5 E .516(One line is read from the standard input, or from the \ +\214le descriptor)144 724.8 R F1(fd)3.016 E F0 .516(supplied as an ar) +3.016 F .517(gument to)-.18 F(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 +E(12)198.725 E 0 Cg EP +%%Page: 13 13 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E(the)144 84 Q +/F1 10/Times-Bold@0 SF2.539 E F0 .039(option, and the \214rst w) +2.539 F .038(ord is assigned to the \214rst)-.1 F/F2 10/Times-Italic@0 +SF(name)2.538 E F0 2.538(,t).18 G .038(he second w)-2.538 F .038 +(ord to the second)-.1 F F2(name)2.538 E F0(,).18 E .42 +(and so on, with lefto)144 96 R -.15(ve)-.15 G 2.92(rw).15 G .42 +(ords and their interv)-3.02 F .42 +(ening separators assigned to the last)-.15 F F2(name)2.92 E F0 5.42(.I) +.18 G 2.92(ft)-5.42 G(here)-2.92 E .541(are fe)144 108 R .541(wer w)-.25 +F .541(ords read from the input stream than names, the remaining names \ +are assigned empty)-.1 F -.25(va)144 120 S 3.357(lues. The).25 F .857 +(characters in)3.357 F/F3 9/Times-Bold@0 SF(IFS)3.357 E F0 .857 +(are used to split the line into w)3.107 F .857 +(ords using the same rules the shell)-.1 F .754(uses for e)144 132 R +.753(xpansion \(described abo)-.15 F 1.053 -.15(ve u)-.15 H(nder).15 E +F1 -.75(Wo)3.253 G .753(rd Splitting).75 F F0 3.253(\). The)B .753 +(backslash character \()3.253 F F1(\\)A F0 3.253(\)m)C .753(ay be)-3.253 +F .075(used to remo)144 144 R .375 -.15(ve a)-.15 H .375 -.15(ny s).15 H +.075(pecial meaning for the ne).15 F .076 +(xt character read and for line continuation.)-.15 F(Options,)5.076 E +(if supplied, ha)144 156 Q .3 -.15(ve t)-.2 H(he follo).15 E +(wing meanings:)-.25 E F1144 168 Q F2(aname)2.5 E F0 1.05(The w) +180 180 R 1.049(ords are assigned to sequential indices of the array v) +-.1 F(ariable)-.25 E F2(aname)3.549 E F0 3.549(,s).18 G 1.049 +(tarting at 0.)-3.549 F F2(aname)180.33 192 Q F0(is unset before an)2.68 +E 2.5(yn)-.15 G .5 -.25(ew va)-2.5 H(lues are assigned.).25 E(Other)5 E +F2(name)2.5 E F0(ar)2.5 E(guments are ignored.)-.18 E F1144 204 Q +F2(delim)2.5 E F0(The \214rst character of)180 216 Q F2(delim)2.5 E F0 +(is used to terminate the input line, rather than ne)2.5 E(wline.)-.25 E +F1144 228 Q F0 .372 +(If the standard input is coming from a terminal,)25.86 F F1 -.18(re) +2.873 G(adline).18 E F0(\(see)2.873 E F3(READLINE)2.873 E F0(abo)2.623 E +-.15(ve)-.15 G 2.873(\)i).15 G 2.873(su)-2.873 G(sed)-2.873 E .218 +(to obtain the line.)180 240 R .218(Readline uses the current \(or def) +5.218 F .218(ault, if line editing w)-.1 F .218(as not pre)-.1 F +(viously)-.25 E(acti)180 252 Q -.15(ve)-.25 G 2.5(\)e).15 G +(diting settings.)-2.5 E F1144 264 Q F2(te)2.5 E(xt)-.2 E F0(If) +10.78 E F1 -.18(re)2.715 G(adline).18 E F0 .216 +(is being used to read the line,)2.715 F F2(te)2.716 E(xt)-.2 E F0 .216 +(is placed into the editing b)2.716 F(uf)-.2 E .216(fer before edit-) +-.25 F(ing be)180 276 Q(gins.)-.15 E F1144 288 Q F2(nc)2.5 E(har) +-.15 E(s)-.1 E F1 -.18(re)180 300 S(ad).18 E F0 1.395 +(returns after reading)3.895 F F2(nc)3.895 E(har)-.15 E(s)-.1 E F0 1.395 +(characters rather than w)3.895 F 1.394(aiting for a complete line of) +-.1 F(input, b)180 312 Q(ut honor a delimiter if fe)-.2 E(wer than)-.25 +E F2(nc)2.5 E(har)-.15 E(s)-.1 E F0 +(characters are read before the delimiter)2.5 E(.)-.55 E F1144 324 +Q F2(nc)2.5 E(har)-.15 E(s)-.1 E F1 -.18(re)180 336 S(ad).18 E F0 1.269 +(returns after reading e)3.769 F(xactly)-.15 E F2(nc)3.769 E(har)-.15 E +(s)-.1 E F0 1.269(characters rather than w)3.769 F 1.27 +(aiting for a complete)-.1 F .275 +(line of input, unless EOF is encountered or)180 348 R F1 -.18(re)2.775 +G(ad).18 E F0 .274(times out.)2.774 F .274(Delimiter characters encoun-) +5.274 F 1.002 +(tered in the input are not treated specially and do not cause)180 360 R +F1 -.18(re)3.503 G(ad).18 E F0 1.003(to return until)3.503 F F2(nc)3.503 +E(har)-.15 E(s)-.1 E F0(characters are read.)180 372 Q F1144 384 Q +F2(pr)2.5 E(ompt)-.45 E F0(Display)180 396 Q F2(pr)3.661 E(ompt)-.45 E +F0 1.161(on standard error)3.661 F 3.661(,w)-.4 G 1.161 +(ithout a trailing ne)-3.661 F 1.161(wline, before attempting to read) +-.25 F(an)180 408 Q 2.5(yi)-.15 G 2.5(nput. The)-2.5 F +(prompt is displayed only if input is coming from a terminal.)2.5 E F1 +144 420 Q F0 .543(Backslash does not act as an escape character) +25.86 F 5.543(.T)-.55 G .544(he backslash is considered to be part of) +-5.543 F(the line.)180 432 Q(In particular)5 E 2.5(,ab)-.4 G +(ackslash-ne)-2.5 E(wline pair may not be used as a line continuation.) +-.25 E F1144 444 Q F0(Silent mode.)26.41 E +(If input is coming from a terminal, characters are not echoed.)5 E F1 +144 456 Q F2(timeout)2.5 E F0(Cause)180 468 Q F1 -.18(re)2.929 G +(ad).18 E F0 .428(to time out and return f)2.929 F .428 +(ailure if a complete line of input \(or a speci\214ed num-)-.1 F .56 +(ber of characters\) is not read within)180 480 R F2(timeout)3.061 E F0 +(seconds.)3.061 E F2(timeout)5.561 E F0 .561(may be a decimal number) +3.061 F(with a fractional portion follo)180 492 Q +(wing the decimal point.)-.25 E(This option is only ef)5 E(fecti)-.25 E +.3 -.15(ve i)-.25 H(f).15 E F1 -.18(re)2.5 G(ad).18 E F0 .506(is readin\ +g input from a terminal, pipe, or other special \214le; it has no ef)180 +504 R .506(fect when reading)-.25 F .59(from re)180 516 R .59 +(gular \214les.)-.15 F(If)5.59 E F1 -.18(re)3.09 G(ad).18 E F0 .589 +(times out,)3.09 F F1 -.18(re)3.089 G(ad).18 E F0(sa)3.089 E -.15(ve)-.2 +G 3.089(sa).15 G .889 -.15(ny p)-3.089 H .589 +(artial input read into the speci\214ed).15 F -.25(va)180 528 S(riable) +.25 E F2(name)2.77 E F0 5.27(.I)C(f)-5.27 E F2(timeout)2.77 E F0 .27 +(is 0,)2.77 F F1 -.18(re)2.77 G(ad).18 E F0 .27(returns immediately)2.77 +F 2.77(,w)-.65 G .27(ithout trying to read an)-2.77 F 2.77(yd)-.15 G +(ata.)-2.77 E 1.12(The e)180 540 R 1.12(xit status is 0 if input is a) +-.15 F -.25(va)-.2 G 1.12(ilable on the speci\214ed \214le descriptor) +.25 F 3.62(,n)-.4 G 1.12(on-zero other)-3.62 F(-)-.2 E 2.5(wise. The)180 +552 R -.15(ex)2.5 G(it status is greater than 128 if the timeout is e) +.15 E(xceeded.)-.15 E F1144 564 Q F2(fd)2.5 E F0 +(Read input from \214le descriptor)14.46 E F2(fd)2.5 E F0(.)A .191 +(If no)144 580.8 R F2(names)3.051 E F0 .191 +(are supplied, the line read is assigned to the v)2.961 F(ariable)-.25 E +F3(REPL)2.692 E(Y)-.828 E/F4 9/Times-Roman@0 SF(.)A F0 .192 +(The return code is zero,)4.692 F 1.344 +(unless end-of-\214le is encountered,)144 592.8 R F1 -.18(re)3.844 G(ad) +.18 E F0 1.343 +(times out \(in which case the return code is greater than)3.844 F .871 +(128\), a v)144 604.8 R .871 +(ariable assignment error \(such as assigning to a readonly v)-.25 F +.872(ariable\) occurs, or an in)-.25 F -.25(va)-.4 G(lid).25 E +(\214le descriptor is supplied as the ar)144 616.8 Q(gument to)-.18 E F1 +2.5 E F0(.)A F1 -.18(re)108 633.6 S(adonly).18 E F0([)2.5 E F1 +(\255aAf)A F0 2.5(][)C F1-2.5 E F0 2.5(][)C F2(name)-2.5 E F0([=)A +F2(wor)A(d)-.37 E F0 2.5(].)C(..])-2.5 E .77(The gi)144 645.6 R -.15(ve) +-.25 G(n).15 E F2(names)3.27 E F0 .77(are mark)3.27 F .77 +(ed readonly; the v)-.1 F .77(alues of these)-.25 F F2(names)3.63 E F0 +.77(may not be changed by subse-)3.54 F 1.096(quent assignment.)144 +657.6 R 1.096(If the)6.096 F F13.596 E F0 1.097 +(option is supplied, the functions corresponding to the)3.596 F F2 +(names)3.597 E F0 1.097(are so)3.597 F(mark)144 669.6 Q 3.334(ed. The) +-.1 F F13.334 E F0 .834(option restricts the v)3.334 F .834 +(ariables to inde)-.25 F -.15(xe)-.15 G 3.334(da).15 G .834(rrays; the) +-3.334 F F13.334 E F0 .834(option restricts the v)3.334 F(ari-) +-.25 E .776(ables to associati)144 681.6 R 1.076 -.15(ve a)-.25 H 3.276 +(rrays. If).15 F .777(both options are supplied,)3.276 F F13.277 E +F0(tak)3.277 E .777(es precedence.)-.1 F .777(If no)5.777 F F2(name) +3.637 E F0(ar)3.457 E(gu-)-.18 E .522(ments are gi)144 693.6 R -.15(ve) +-.25 G .521(n, or if the).15 F F13.021 E F0 .521 +(option is supplied, a list of all readonly names is printed.)3.021 F +.521(The other)5.521 F .295(options may be used to restrict the output \ +to a subset of the set of readonly names.)144 705.6 R(The)5.296 E F1 +2.796 E F0(option)2.796 E .786 +(causes output to be displayed in a format that may be reused as input.) +144 717.6 R .786(If a v)5.786 F .785(ariable name is fol-)-.25 F(lo)144 +729.6 Q .717(wed by =)-.25 F F2(wor)A(d)-.37 E F0 3.218(,t)C .718(he v) +-3.218 F .718(alue of the v)-.25 F .718(ariable is set to)-.25 F F2(wor) +3.218 E(d)-.37 E F0 5.718(.T)C .718(he return status is 0 unless an in) +-5.718 F -.25(va)-.4 G(lid).25 E(GNU Bash-4.2)72 768 Q(2004 Apr 20) +148.735 E(13)198.725 E 0 Cg EP +%%Page: 14 14 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E .26 +(option is encountered, one of the)144 84 R/F1 10/Times-Italic@0 SF +(names)3.12 E F0 .26(is not a v)3.03 F .26(alid shell v)-.25 F .26 +(ariable name, or)-.25 F/F2 10/Times-Bold@0 SF2.76 E F0 .26 +(is supplied with a)2.76 F F1(name)144.36 96 Q F0 +(that is not a function.)2.68 E F2 -.18(re)108 112.8 S(tur).18 E(n)-.15 +E F0([)2.5 E F1(n)A F0(])A .02(Causes a function to stop e)144 124.8 R +-.15(xe)-.15 G .02(cuting and return the v).15 F .021 +(alue speci\214ed by)-.25 F F1(n)2.881 E F0 .021(to its caller)2.761 F +5.021(.I)-.55 G(f)-5.021 E F1(n)2.881 E F0 .021(is omitted,)2.761 F .469 +(the return status is that of the last command e)144 136.8 R -.15(xe) +-.15 G .469(cuted in the function body).15 F 5.469(.I)-.65 G(f)-5.469 E +F2 -.18(re)2.969 G(tur).18 E(n)-.15 E F0 .468(is used out-)2.969 F .466 +(side a function, b)144 148.8 R .466(ut during e)-.2 F -.15(xe)-.15 G +.467(cution of a script by the).15 F F2(.)2.967 E F0(\()5.467 E F2(sour) +A(ce)-.18 E F0 2.967(\)c)C .467(ommand, it causes the shell to)-2.967 F +.088(stop e)144 160.8 R -.15(xe)-.15 G .087 +(cuting that script and return either).15 F F1(n)2.947 E F0 .087 +(or the e)2.827 F .087(xit status of the last command e)-.15 F -.15(xe) +-.15 G .087(cuted within).15 F .613(the script as the e)144 172.8 R .613 +(xit status of the script.)-.15 F(If)5.613 E F1(n)3.113 E F0 .613 +(is supplied, the return v)3.113 F .613 +(alue is its least signi\214cant 8)-.25 F 2.511(bits. The)144 184.8 R +.011(return status is non-zero if)2.511 F F2 -.18(re)2.511 G(tur).18 E +(n)-.15 E F0 .011(is supplied a non-numeric ar)2.511 F .01 +(gument, or is used outside)-.18 F 2.909(af)144 196.8 S .409 +(unction and not during e)-2.909 F -.15(xe)-.15 G .41 +(cution of a script by).15 F F2(.)2.91 E F0(or)3.743 E F2(sour)2.91 E +(ce)-.18 E F0 5.41(.A)C .71 -.15(ny c)-5.41 H .41 +(ommand associated with the).15 F F2(RETURN)144 208.8 Q F0(trap is e)2.5 +E -.15(xe)-.15 G(cuted before e).15 E -.15(xe)-.15 G +(cution resumes after the function or script.).15 E F2(set)108 225.6 Q +F0([)2.5 E F2(\255\255abefhkmnptuvxBCEHPT)A F0 2.5(][)C F2-2.5 E +F1(option\255name)2.5 E F0 2.5(][)C F1(ar)-2.5 E(g)-.37 E F0(...])2.5 E +F2(set)108 237.6 Q F0([)2.5 E F2(+abefhkmnptuvxBCEHPT)A F0 2.5(][)C F2 +(+o)-2.5 E F1(option\255name)2.5 E F0 2.5(][)C F1(ar)-2.5 E(g)-.37 E F0 +(...])2.5 E -.4(Wi)144 249.6 S .836(thout options, the name and v).4 F +.835(alue of each shell v)-.25 F .835 +(ariable are displayed in a format that can be)-.25 F .784 +(reused as input for setting or resetting the currently-set v)144 261.6 +R 3.284(ariables. Read-only)-.25 F -.25(va)3.284 G .784 +(riables cannot be).25 F 2.912(reset. In)144 273.6 R F1(posix)2.912 E F0 +.412(mode, only shell v)2.912 F .412(ariables are listed.)-.25 F .412 +(The output is sorted according to the current)5.412 F 3.53 +(locale. When)144 285.6 R 1.031(options are speci\214ed, the)3.53 F +3.531(ys)-.15 G 1.031(et or unset shell attrib)-3.531 F 3.531(utes. An) +-.2 F 3.531(ya)-.15 G -.18(rg)-3.531 G 1.031(uments remaining).18 F +1.624(after option processing are treated as v)144 297.6 R 1.623 +(alues for the positional parameters and are assigned, in)-.25 F(order) +144 309.6 Q 2.5(,t)-.4 G(o)-2.5 E F2($1)2.5 E F0(,)A F2($2)2.5 E F0(,)A +F2 2.5(... $)2.5 F F1(n)A F0 5(.O)C(ptions, if speci\214ed, ha)-5 E .3 +-.15(ve t)-.2 H(he follo).15 E(wing meanings:)-.25 E F2144 321.6 Q +F0 .539(Automatically mark v)29.3 F .539 +(ariables and functions which are modi\214ed or created for e)-.25 F .54 +(xport to)-.15 F(the en)184 333.6 Q(vironment of subsequent commands.) +-.4 E F2144 345.6 Q F0 .132 +(Report the status of terminated background jobs immediately)28.74 F +2.632(,r)-.65 G .131(ather than before the ne)-2.632 F(xt)-.15 E +(primary prompt.)184 357.6 Q(This is ef)5 E(fecti)-.25 E .3 -.15(ve o) +-.25 H(nly when job control is enabled.).15 E F2144 369.6 Q F0 +.087(Exit immediately if a)29.86 F F1(pipeline)2.587 E F0 .087 +(\(which may consist of a single)2.587 F F1 .088(simple command)2.588 F +F0 .088(\), a)B F1(list)2.588 E F0 2.588(,o)C(r)-2.588 E(a)184 381.6 Q +F1 1.294(compound command)3.794 F F0(\(see)3.794 E/F3 9/Times-Bold@0 SF +1.294(SHELL GRAMMAR)3.794 F F0(abo)3.544 E -.15(ve)-.15 G 3.793(\), e) +.15 F 1.293(xits with a non-zero status.)-.15 F .079 +(The shell does not e)184 393.6 R .079(xit if the command that f)-.15 F +.08(ails is part of the command list immediately)-.1 F(follo)184 405.6 Q +1.655(wing a)-.25 F F2(while)4.155 E F0(or)4.155 E F2(until)4.155 E F0 +-.1(ke)4.155 G(yw)-.05 E 1.655(ord, part of the test follo)-.1 F 1.654 +(wing the)-.25 F F2(if)4.154 E F0(or)4.154 E F2(elif)4.154 E F0(reserv) +4.154 E(ed)-.15 E -.1(wo)184 417.6 S .581(rds, part of an).1 F 3.081(yc) +-.15 G .581(ommand e)-3.081 F -.15(xe)-.15 G .581(cuted in a).15 F F2 +(&&)3.081 E F0(or)3.081 E F2(||)3.081 E F0 .582(list e)3.082 F .582 +(xcept the command follo)-.15 F(wing)-.25 E .918(the \214nal)184 429.6 R +F2(&&)3.418 E F0(or)3.418 E F2(||)3.418 E F0 3.418(,a)C 1.218 -.15(ny c) +-3.418 H .918(ommand in a pipeline b).15 F .917 +(ut the last, or if the command')-.2 F 3.417(sr)-.55 G(eturn)-3.417 E +-.25(va)184 441.6 S .66(lue is being in).25 F -.15(ve)-.4 G .66 +(rted with).15 F F2(!)3.16 E F0 5.661(.I)C 3.161(fac)-5.661 G .661 +(ompound command other than a subshell returns a)-3.161 F 1.113 +(non-zero status because a command f)184 453.6 R 1.112(ailed while)-.1 F +F23.612 E F0 -.1(wa)3.612 G 3.612(sb).1 G 1.112 +(eing ignored, the shell does)-3.612 F .177(not e)184 465.6 R 2.677 +(xit. A)-.15 F .177(trap on)2.677 F F2(ERR)2.677 E F0 2.677(,i)C 2.678 +(fs)-2.677 G .178(et, is e)-2.678 F -.15(xe)-.15 G .178 +(cuted before the shell e).15 F 2.678(xits. This)-.15 F .178 +(option applies to)2.678 F .618(the shell en)184 477.6 R .617 +(vironment and each subshell en)-.4 F .617(vironment separately \(see) +-.4 F F3 .617(COMMAND EXE-)3.117 F .642(CUTION ENVIR)184 489.6 R(ONMENT) +-.27 E F0(abo)2.893 E -.15(ve)-.15 G .643 +(\), and may cause subshells to e).15 F .643(xit before e)-.15 F -.15 +(xe)-.15 G .643(cuting all).15 F(the commands in the subshell.)184 501.6 +Q 2.042(If a compound command or shell function e)184 519.6 R -.15(xe) +-.15 G 2.042(cutes in a conte).15 F 2.042(xt where)-.15 F F24.542 +E F0 2.042(is being)4.542 F 1.435(ignored, none of the commands e)184 +531.6 R -.15(xe)-.15 G 1.436 +(cuted within the compound command or function).15 F .194 +(body will be af)184 543.6 R .194(fected by the)-.25 F F22.694 E +F0 .193(setting, e)2.693 F -.15(ve)-.25 G 2.693(ni).15 G(f)-2.693 E F2 +2.693 E F0 .193(is set and a command returns a f)2.693 F(ailure) +-.1 E 3.39(status. If)184 555.6 R 3.39(ac)3.39 G .89 +(ompound command or shell function sets)-3.39 F F23.39 E F0 .89 +(while e)3.39 F -.15(xe)-.15 G .89(cuting in a conte).15 F(xt)-.15 E +(where)184 567.6 Q F23.154 E F0 .654 +(is ignored, that setting will not ha)3.154 F .953 -.15(ve a)-.2 H .953 +-.15(ny e).15 H -.25(ff).15 G .653(ect until the compound command).25 F +(or the command containing the function call completes.)184 579.6 Q F2 +144 591.6 Q F0(Disable pathname e)30.97 E(xpansion.)-.15 E F2 +144 603.6 Q F0 2.238(Remember the location of commands as the) +28.74 F 4.738(ya)-.15 G 2.239(re look)-4.738 F 2.239(ed up for e)-.1 F +-.15(xe)-.15 G 4.739(cution. This).15 F(is)4.739 E(enabled by def)184 +615.6 Q(ault.)-.1 E F2144 627.6 Q F0 .514(All ar)28.74 F .514 +(guments in the form of assignment statements are placed in the en)-.18 +F .513(vironment for a)-.4 F +(command, not just those that precede the command name.)184 639.6 Q F2 +144 651.6 Q F0 .148(Monitor mode.)25.97 F .148 +(Job control is enabled.)5.148 F .149(This option is on by def)5.148 F +.149(ault for interacti)-.1 F .449 -.15(ve s)-.25 H(hells).15 E .651 +(on systems that support it \(see)184 663.6 R F3 .651(JOB CONTR)3.151 F +(OL)-.27 E F0(abo)2.901 E -.15(ve)-.15 G 3.151(\). All).15 F .65 +(processes run in a separate)3.151 F .678(process group.)184 675.6 R +.679(When a background job completes, the shell prints a line containin\ +g its)5.678 F -.15(ex)184 687.6 S(it status.).15 E F2144 699.6 Q +F0 .653(Read commands b)28.74 F .653(ut do not e)-.2 F -.15(xe)-.15 G +.653(cute them.).15 F .652(This may be used to check a shell script for) +5.653 F(syntax errors.)184 711.6 Q(This is ignored by interacti)5 E .3 +-.15(ve s)-.25 H(hells.).15 E(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 +E(14)198.725 E 0 Cg EP +%%Page: 15 15 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF144 84 Q/F2 10/Times-Italic@0 SF(option\255name) +2.5 E F0(The)184 96 Q F2(option\255name)2.5 E F0 +(can be one of the follo)2.5 E(wing:)-.25 E F1(allexport)184 108 Q F0 +(Same as)224 120 Q F12.5 E F0(.)A F1(braceexpand)184 132 Q F0 +(Same as)224 144 Q F12.5 E F0(.)A F1(emacs)184 156 Q F0 .089 +(Use an emacs-style command line editing interf)13.9 F 2.589(ace. This) +-.1 F .089(is enabled by def)2.589 F(ault)-.1 E .95 +(when the shell is interacti)224 168 R -.15(ve)-.25 G 3.45(,u).15 G .95 +(nless the shell is started with the)-3.45 F F1(\255\255noediting)3.45 E +F0 2.5(option. This)224 180 R(also af)2.5 E(fects the editing interf) +-.25 E(ace used for)-.1 E F1 -.18(re)2.5 G(ad \255e).18 E F0(.)A F1(err) +184 192 Q(exit)-.18 E F0(Same as)11.31 E F12.5 E F0(.)A F1 +(errtrace)184 204 Q F0(Same as)5.03 E F12.5 E F0(.)A F1(functrace) +184 216 Q F0(Same as)224 228 Q F12.5 E F0(.)A F1(hashall)184 240 Q +F0(Same as)9.43 E F12.5 E F0(.)A F1(histexpand)184 252 Q F0 +(Same as)224 264 Q F12.5 E F0(.)A F1(history)184 276 Q F0 .586 +(Enable command history)10 F 3.087(,a)-.65 G 3.087(sd)-3.087 G .587 +(escribed abo)-3.087 F .887 -.15(ve u)-.15 H(nder).15 E/F3 9 +/Times-Bold@0 SF(HIST)3.087 E(OR)-.162 E(Y)-.315 E/F4 9/Times-Roman@0 SF +(.)A F0 .587(This option is)5.087 F(on by def)224 288 Q +(ault in interacti)-.1 E .3 -.15(ve s)-.25 H(hells.).15 E F1(ignor)184 +300 Q(eeof)-.18 E F0 1.657(The ef)224 312 R 1.657 +(fect is as if the shell command)-.25 F/F5 10/Courier@0 SF(IGNOREEOF=10) +4.156 E F0 1.656(had been e)4.156 F -.15(xe)-.15 G(cuted).15 E(\(see)224 +324 Q F1(Shell V)2.5 E(ariables)-.92 E F0(abo)2.5 E -.15(ve)-.15 G(\).) +.15 E F1 -.1(ke)184 336 S(yw).1 E(ord)-.1 E F0(Same as)224 348 Q F1 +2.5 E F0(.)A F1(monitor)184 360 Q F0(Same as)5.56 E F12.5 E +F0(.)A F1(noclob)184 372 Q(ber)-.1 E F0(Same as)224 384 Q F12.5 E +F0(.)A F1(noexec)184 396 Q F0(Same as)11.12 E F12.5 E F0(.)A F1 +(noglob)184 408 Q F0(Same as)11.1 E F12.5 E F0(.)A F1(nolog)184 +420 Q F0(Currently ignored.)16.66 E F1(notify)184 432 Q F0(Same as)15 E +F12.5 E F0(.)A F1(nounset)184 444 Q F0(Same as)6.66 E F12.5 +E F0(.)A F1(onecmd)184 456 Q F0(Same as)6.67 E F12.5 E F0(.)A F1 +(ph)184 468 Q(ysical)-.15 E F0(Same as)5.14 E F12.5 E F0(.)A F1 +(pipefail)184 480 Q F0 1.029(If set, the return v)7.77 F 1.029 +(alue of a pipeline is the v)-.25 F 1.03 +(alue of the last \(rightmost\) com-)-.25 F 1.137(mand to e)224 492 R +1.136 +(xit with a non-zero status, or zero if all commands in the pipeline) +-.15 F -.15(ex)224 504 S(it successfully).15 E 5(.T)-.65 G +(his option is disabled by def)-5 E(ault.)-.1 E F1(posix)184 516 Q F0 +2.09(Change the beha)17.77 F 2.091(vior of)-.2 F F1(bash)4.591 E F0 +2.091(where the def)4.591 F 2.091(ault operation dif)-.1 F 2.091 +(fers from the)-.25 F 1.212(POSIX standard to match the standard \()224 +528 R F2 1.212(posix mode)B F0 3.712(\). See)B F3 1.212(SEE ALSO)3.712 F +F0(belo)3.462 E(w)-.25 E 2.306 +(for a reference to a document that details ho)224 540 R 4.807(wp)-.25 G +2.307(osix mode af)-4.807 F 2.307(fects bash')-.25 F(s)-.55 E(beha)224 +552 Q(vior)-.2 E(.)-.55 E F1(pri)184 564 Q(vileged)-.1 E F0(Same as)224 +576 Q F12.5 E F0(.)A F1 -.1(ve)184 588 S(rbose).1 E F0(Same as) +7.33 E F12.5 E F0(.)A F1(vi)184 600 Q F0 1.466 +(Use a vi-style command line editing interf)32.22 F 3.965(ace. This)-.1 +F 1.465(also af)3.965 F 1.465(fects the editing)-.25 F(interf)224 612 Q +(ace used for)-.1 E F1 -.18(re)2.5 G(ad \255e).18 E F0(.)A F1(xtrace)184 +624 Q F0(Same as)13.35 E F12.5 E F0(.)A(If)184 642 Q F13.052 +E F0 .552(is supplied with no)3.052 F F2(option\255name)3.053 E F0 3.053 +(,t)C .553(he v)-3.053 F .553(alues of the current options are printed.) +-.25 F(If)5.553 E F1(+o)184 654 Q F0 1.072(is supplied with no)3.572 F +F2(option\255name)3.572 E F0 3.572(,a)C 1.071(series of)-.001 F F1(set) +3.571 E F0 1.071(commands to recreate the current)3.571 F +(option settings is displayed on the standard output.)184 666 Q F1 +144 678 Q F0 -.45(Tu)28.74 G 1.071(rn on).45 F F2(privile)4.821 E -.1 +(ge)-.4 G(d).1 E F0 3.572(mode. In)4.341 F 1.072(this mode, the)3.572 F +F3($ENV)3.572 E F0(and)3.322 E F3($B)3.572 E(ASH_ENV)-.27 E F0 1.072 +(\214les are not pro-)3.322 F 1.501 +(cessed, shell functions are not inherited from the en)184 690 R 1.5 +(vironment, and the)-.4 F F3(SHELLOPTS)4 E F4(,)A F3 -.27(BA)184 702 S +(SHOPTS).27 E F4(,)A F3(CDP)2.774 E -.855(AT)-.666 G(H).855 E F4(,)A F0 +(and)2.774 E F3(GLOBIGNORE)3.024 E F0 -.25(va)2.774 G .524 +(riables, if the).25 F 3.025(ya)-.15 G .525(ppear in the en)-3.025 F +(vironment,)-.4 E .38(are ignored.)184 714 R .38 +(If the shell is started with the ef)5.38 F(fecti)-.25 E .679 -.15(ve u) +-.25 H .379(ser \(group\) id not equal to the real).15 F 2.196 +(user \(group\) id, and the)184 726 R F14.696 E F0 2.196 +(option is not supplied, these actions are tak)4.696 F 2.196(en and the) +-.1 F(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(15)198.725 E 0 Cg EP +%%Page: 16 16 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E(ef)184 84 Q +(fecti)-.25 E 1.667 -.15(ve u)-.25 H 1.367 +(ser id is set to the real user id.).15 F 1.367(If the)6.367 F/F1 10 +/Times-Bold@0 SF3.867 E F0 1.366 +(option is supplied at startup, the)3.866 F(ef)184 96 Q(fecti)-.25 E +.708 -.15(ve u)-.25 H .408(ser id is not reset.).15 F -.45(Tu)5.409 G +.409(rning this option of).45 F 2.909(fc)-.25 G .409(auses the ef)-2.909 +F(fecti)-.25 E .709 -.15(ve u)-.25 H .409(ser and group).15 F +(ids to be set to the real user and group ids.)184 108 Q F1144 120 +Q F0(Exit after reading and e)30.97 E -.15(xe)-.15 G +(cuting one command.).15 E F1144 132 Q F0 -.35(Tr)28.74 G .044 +(eat unset v).35 F .044(ariables and parameters other than the special \ +parameters "@" and "*" as an)-.25 F .182 +(error when performing parameter e)184 144 R 2.682(xpansion. If)-.15 F +-.15(ex)2.682 G .183(pansion is attempted on an unset v).15 F(ari-)-.25 +E .746(able or parameter)184 156 R 3.246(,t)-.4 G .746 +(he shell prints an error message, and, if not interacti)-3.246 F -.15 +(ve)-.25 G 3.246(,e).15 G .746(xits with a)-3.396 F(non-zero status.)184 +168 Q F1144 180 Q F0(Print shell input lines as the)29.3 E 2.5(ya) +-.15 G(re read.)-2.5 E F1144 192 Q F0 .315(After e)29.3 F .315 +(xpanding each)-.15 F/F2 10/Times-Italic@0 SF .315(simple command)2.815 +F F0(,)A F1 -.25(fo)2.815 G(r).25 E F0(command,)2.815 E F1(case)2.815 E +F0(command,)2.815 E F1(select)2.815 E F0(command,)2.815 E 1.236 +(or arithmetic)184 204 R F1 -.25(fo)3.736 G(r).25 E F0 1.236 +(command, display the e)3.736 F 1.236(xpanded v)-.15 F 1.236(alue of) +-.25 F/F3 9/Times-Bold@0 SF(PS4)3.736 E/F4 9/Times-Roman@0 SF(,)A F0 +(follo)3.486 E 1.236(wed by the com-)-.25 F(mand and its e)184 216 Q +(xpanded ar)-.15 E(guments or associated w)-.18 E(ord list.)-.1 E F1 +144 228 Q F0 2.578(The shell performs brace e)27.63 F 2.578 +(xpansion \(see)-.15 F F1 2.578(Brace Expansion)5.078 F F0(abo)5.078 E +-.15(ve)-.15 G 5.079(\). This).15 F 2.579(is on by)5.079 F(def)184 240 Q +(ault.)-.1 E F1144 252 Q F0 .214(If set,)27.08 F F1(bash)2.714 E +F0 .214(does not o)2.714 F -.15(ve)-.15 G .214(rwrite an e).15 F .214 +(xisting \214le with the)-.15 F F1(>)2.714 E F0(,)A F1(>&)2.714 E F0 +2.713(,a)C(nd)-2.713 E F1(<>)2.713 E F0 .213(redirection opera-)2.713 F +3.053(tors. This)184 264 R .553(may be o)3.053 F -.15(ve)-.15 G .553 +(rridden when creating output \214les by using the redirection opera-) +.15 F(tor)184 276 Q F1(>|)2.5 E F0(instead of)2.5 E F1(>)2.5 E F0(.)A F1 +144 288 Q F0 .104(If set, an)27.63 F 2.604(yt)-.15 G .104(rap on) +-2.604 F F1(ERR)2.604 E F0 .103 +(is inherited by shell functions, command substitutions, and com-)2.604 +F .838(mands e)184 300 R -.15(xe)-.15 G .838(cuted in a subshell en).15 +F 3.338(vironment. The)-.4 F F1(ERR)3.338 E F0 .839 +(trap is normally not inherited in)3.339 F(such cases.)184 312 Q F1 +144 324 Q F0(Enable)26.52 E F1(!)3.032 E F0 .532 +(style history substitution.)5.532 F .531(This option is on by def)5.532 +F .531(ault when the shell is inter)-.1 F(-)-.2 E(acti)184 336 Q -.15 +(ve)-.25 G(.).15 E F1144 348 Q F0 .959 +(If set, the shell does not resolv)28.19 F 3.459(es)-.15 G .959 +(ymbolic links when e)-3.459 F -.15(xe)-.15 G .96 +(cuting commands such as).15 F F1(cd)3.46 E F0 2.822 +(that change the current w)184 360 R 2.822(orking directory)-.1 F 7.822 +(.I)-.65 G 5.322(tu)-7.822 G 2.822(ses the ph)-5.322 F 2.821 +(ysical directory structure)-.05 F 2.685(instead. By)184 372 R(def)2.685 +E(ault,)-.1 E F1(bash)2.686 E F0(follo)2.686 E .186 +(ws the logical chain of directories when performing com-)-.25 F +(mands which change the current directory)184 384 Q(.)-.65 E F1144 +396 Q F0 .89(If set, an)27.63 F 3.39(yt)-.15 G .89(raps on)-3.39 F F1 +(DEB)3.39 E(UG)-.1 E F0(and)3.39 E F1(RETURN)3.39 E F0 .89 +(are inherited by shell functions, command)3.39 F 1.932 +(substitutions, and commands e)184 408 R -.15(xe)-.15 G 1.932 +(cuted in a subshell en).15 F 4.432(vironment. The)-.4 F F1(DEB)4.432 E +(UG)-.1 E F0(and)4.432 E F1(RETURN)184 420 Q F0 +(traps are normally not inherited in such cases.)2.5 E F1144 432 Q +F0 .401(If no ar)28.6 F .401(guments follo)-.18 F 2.901(wt)-.25 G .401 +(his option, then the positional parameters are unset.)-2.901 F +(Otherwise,)5.4 E(the positional parameters are set to the)184 444 Q F2 +(ar)2.5 E(g)-.37 E F0(s, e)A -.15(ve)-.25 G 2.5(ni).15 G 2.5(fs)-2.5 G +(ome of them be)-2.5 E(gin with a)-.15 E F12.5 E F0(.)A F1144 +456 Q F0 1.944(Signal the end of options, cause all remaining)34.3 F F2 +(ar)4.444 E(g)-.37 E F0 4.444(st)C 4.444(ob)-4.444 G 4.445(ea)-4.444 G +1.945(ssigned to the positional)-4.445 F 3.446(parameters. The)184 468 R +F13.446 E F0(and)3.446 E F13.446 E F0 .945 +(options are turned of)3.446 F 3.445(f. If)-.25 F .945(there are no) +3.445 F F2(ar)3.445 E(g)-.37 E F0 .945(s, the positional)B +(parameters remain unchanged.)184 480 Q .425(The options are of)144 +496.8 R 2.925(fb)-.25 G 2.925(yd)-2.925 G(ef)-2.925 E .425 +(ault unless otherwise noted.)-.1 F .425 +(Using + rather than \255 causes these options)5.425 F .178 +(to be turned of)144 508.8 R 2.678(f. The)-.25 F .178 +(options can also be speci\214ed as ar)2.678 F .178(guments to an in) +-.18 F -.2(vo)-.4 G .177(cation of the shell.).2 F(The)5.177 E .066 +(current set of options may be found in)144 520.8 R F1<24ad>2.566 E F0 +5.066(.T)C .066(he return status is al)-5.066 F -.1(wa)-.1 G .066 +(ys true unless an in).1 F -.25(va)-.4 G .067(lid option).25 F +(is encountered.)144 532.8 Q F1(shift)108 549.6 Q F0([)2.5 E F2(n)A F0 +(])A .429(The positional parameters from)144 561.6 R F2(n)2.929 E F0 +.429(+1 ... are renamed to)B F1 .429($1 ....)2.929 F F0 -.15(Pa)5.428 G +.428(rameters represented by the num-).15 F(bers)144 573.6 Q F1($#)2.582 +E F0(do)2.582 E .082(wn to)-.25 F F1($#)2.582 E F0A F2(n)A F0 .082 +(+1 are unset.)B F2(n)5.442 E F0 .082(must be a non-ne)2.822 F -.05(ga) +-.15 G(ti).05 E .383 -.15(ve n)-.25 H .083(umber less than or equal to) +.15 F F1($#)2.583 E F0 5.083(.I)C(f)-5.083 E F2(n)2.943 E F0 .06 +(is 0, no parameters are changed.)144 585.6 R(If)5.06 E F2(n)2.92 E F0 +.06(is not gi)2.8 F -.15(ve)-.25 G .06(n, it is assumed to be 1.).15 F +(If)5.06 E F2(n)2.92 E F0 .06(is greater than)2.8 F F1($#)2.56 E F0 2.56 +(,t)C(he)-2.56 E .143(positional parameters are not changed.)144 597.6 R +.144(The return status is greater than zero if)5.143 F F2(n)3.004 E F0 +.144(is greater than)2.884 F F1($#)2.644 E F0 +(or less than zero; otherwise 0.)144 609.6 Q F1(shopt)108 626.4 Q F0([) +2.5 E F1(\255pqsu)A F0 2.5(][)C F1-2.5 E F0 2.5(][)C F2(optname) +-2.5 E F0(...])2.5 E -.8(To)144 638.4 S .64(ggle the v).8 F .639 +(alues of settings controlling optional shell beha)-.25 F(vior)-.2 E +5.639(.T)-.55 G .639(he settings can be either those)-5.639 F .374 +(listed belo)144 650.4 R 1.674 -.65(w, o)-.25 H 1.174 -.4(r, i).65 H +2.874(ft).4 G(he)-2.874 E F12.874 E F0 .375 +(option is used, those a)2.875 F -.25(va)-.2 G .375(ilable with the).25 +F F12.875 E F0 .375(option to the)2.875 F F1(set)2.875 E F0 -.2 +(bu)2.875 G .375(iltin com-).2 F 3.326(mand. W)144 662.4 R .826 +(ith no options, or with the)-.4 F F13.326 E F0 .825 +(option, a list of all settable options is displayed, with an)3.326 F +.945(indication of whether or not each is set.)144 674.4 R(The)5.945 E +F13.445 E F0 .945(option causes output to be displayed in a form) +3.445 F(that may be reused as input.)144 686.4 Q(Other options ha)5 E .3 +-.15(ve t)-.2 H(he follo).15 E(wing meanings:)-.25 E F1144 698.4 Q +F0(Enable \(set\) each)26.41 E F2(optname)2.5 E F0(.)A F1144 710.4 +Q F0(Disable \(unset\) each)24.74 E F2(optname)2.5 E F0(.)A +(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(16)198.725 E 0 Cg EP +%%Page: 17 17 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF144 84 Q F0 .003(Suppresses normal output \(quiet\ + mode\); the return status indicates whether the)24.74 F/F2 10 +/Times-Italic@0 SF(optname)2.503 E F0(is)2.503 E .255(set or unset.)180 +96 R .255(If multiple)5.255 F F2(optname)2.755 E F0(ar)2.755 E .256 +(guments are gi)-.18 F -.15(ve)-.25 G 2.756(nw).15 G(ith)-2.756 E F1 +2.756 E F0 2.756(,t)C .256(he return status is zero if)-2.756 F +(all)180 108 Q F2(optnames)2.5 E F0(are enabled; non-zero otherwise.)2.5 +E F1144 120 Q F0(Restricts the v)25.3 E(alues of)-.25 E F2 +(optname)2.5 E F0(to be those de\214ned for the)2.5 E F12.5 E F0 +(option to the)2.5 E F1(set)2.5 E F0 -.2(bu)2.5 G(iltin.).2 E .625 +(If either)144 136.8 R F13.125 E F0(or)3.124 E F13.124 E F0 +.624(is used with no)3.124 F F2(optname)3.124 E F0(ar)3.124 E(guments,) +-.18 E F1(shopt)3.124 E F0(sho)3.124 E .624 +(ws only those options which are)-.25 F 2.233(set or unset, respecti)144 +148.8 R -.15(ve)-.25 G(ly).15 E 7.234(.U)-.65 G 2.234 +(nless otherwise noted, the)-7.234 F F1(shopt)4.734 E F0 2.234 +(options are disabled \(unset\) by)4.734 F(def)144 160.8 Q(ault.)-.1 E +1.544(The return status when listing options is zero if all)144 177.6 R +F2(optnames)4.044 E F0 1.544(are enabled, non-zero otherwise.)4.044 F +.696 +(When setting or unsetting options, the return status is zero unless an) +144 189.6 R F2(optname)3.196 E F0 .696(is not a v)3.196 F .696 +(alid shell)-.25 F(option.)144 201.6 Q(The list of)144 218.4 Q F1(shopt) +2.5 E F0(options is:)2.5 E F1(autocd)144 236.4 Q F0 .2 +(If set, a command name that is the name of a directory is e)11.11 F +-.15(xe)-.15 G .199(cuted as if it were the ar).15 F(gu-)-.18 E +(ment to the)184 248.4 Q F1(cd)2.5 E F0 2.5(command. This)2.5 F +(option is only used by interacti)2.5 E .3 -.15(ve s)-.25 H(hells.).15 E +F1(cdable_v)144 260.4 Q(ars)-.1 E F0 .155(If set, an ar)184 272.4 R .155 +(gument to the)-.18 F F1(cd)2.655 E F0 -.2(bu)2.655 G .156 +(iltin command that is not a directory is assumed to be the).2 F +(name of a v)184 284.4 Q(ariable whose v)-.25 E +(alue is the directory to change to.)-.25 E F1(cdspell)144 296.4 Q F0 +1.055 +(If set, minor errors in the spelling of a directory component in a) +10.55 F F1(cd)3.555 E F0 1.055(command will be)3.555 F 3.987 +(corrected. The)184 308.4 R 1.487(errors check)3.987 F 1.487 +(ed for are transposed characters, a missing character)-.1 F 3.988(,a) +-.4 G(nd)-3.988 E .77(one character too man)184 320.4 R 4.57 -.65(y. I) +-.15 H 3.27(fac).65 G .77 +(orrection is found, the corrected \214lename is printed, and)-3.27 F +(the command proceeds.)184 332.4 Q +(This option is only used by interacti)5 E .3 -.15(ve s)-.25 H(hells.) +.15 E F1(checkhash)144 344.4 Q F0 2.079(If set,)184 356.4 R F1(bash) +4.579 E F0 2.079(checks that a command found in the hash table e)4.579 F +2.08(xists before trying to)-.15 F -.15(exe)184 368.4 S(cute it.).15 E +(If a hashed command no longer e)5 E +(xists, a normal path search is performed.)-.15 E F1(checkjobs)144 380.4 +Q F0 .449(If set,)184 392.4 R F1(bash)2.949 E F0 .449 +(lists the status of an)2.949 F 2.949(ys)-.15 G .448 +(topped and running jobs before e)-2.949 F .448(xiting an interacti)-.15 +F -.15(ve)-.25 G 3.438(shell. If)184 404.4 R(an)3.438 E 3.438(yj)-.15 G +.938(obs are running, this causes the e)-3.438 F .938 +(xit to be deferred until a second e)-.15 F .939(xit is)-.15 F 2.203 +(attempted without an interv)184 416.4 R 2.203(ening command \(see)-.15 +F/F3 9/Times-Bold@0 SF 2.203(JOB CONTR)4.703 F(OL)-.27 E F0(abo)4.453 E +-.15(ve)-.15 G 4.703(\). The).15 F(shell)4.703 E(al)184 428.4 Q -.1(wa) +-.1 G(ys postpones e).1 E(xiting if an)-.15 E 2.5(yj)-.15 G +(obs are stopped.)-2.5 E F1(checkwinsize)144 440.4 Q F0 .796(If set,)184 +452.4 R F1(bash)3.296 E F0 .796(checks the windo)3.296 F 3.296(ws)-.25 G +.797(ize after each command and, if necessary)-3.296 F 3.297(,u)-.65 G +.797(pdates the)-3.297 F -.25(va)184 464.4 S(lues of).25 E F3(LINES)2.5 +E F0(and)2.25 E F3(COLUMNS)2.5 E/F4 9/Times-Roman@0 SF(.)A F1(cmdhist) +144 476.4 Q F0 1.202(If set,)6.11 F F1(bash)3.702 E F0 1.202 +(attempts to sa)3.702 F 1.502 -.15(ve a)-.2 H 1.202 +(ll lines of a multiple-line command in the same history).15 F(entry)184 +488.4 Q 5(.T)-.65 G(his allo)-5 E +(ws easy re-editing of multi-line commands.)-.25 E F1(compat31)144 500.4 +Q F0 .419(If set,)184 512.4 R F1(bash)2.919 E F0 .419(changes its beha) +2.919 F .419(vior to that of v)-.2 F .42 +(ersion 3.1 with respect to quoted ar)-.15 F(guments)-.18 E .462(to the) +184 524.4 R F1([[)2.962 E F0 .462(conditional command')2.962 F(s)-.55 E +F1(=~)2.962 E F0 .462 +(operator and locale-speci\214c string comparison when)2.962 F .71 +(using the)184 536.4 R F1([[)3.21 E F0 .71(conditional command')3.21 F +(s)-.55 E F1(<)3.21 E F0(and)3.21 E F1(>)3.21 E F0 3.21(operators. Bash) +3.21 F -.15(ve)3.21 G .71(rsions prior to bash-4.1).15 F .821 +(use ASCII collation and)184 548.4 R F2(str)3.321 E(cmp)-.37 E F0 .821 +(\(3\); bash-4.1 and later use the current locale').19 F 3.32(sc)-.55 G +(ollation)-3.32 E(sequence and)184 560.4 Q F2(str)2.5 E(coll)-.37 E F0 +(\(3\).).51 E F1(compat32)144 572.4 Q F0 1.409(If set,)184 584.4 R F1 +(bash)3.909 E F0 1.409(changes its beha)3.909 F 1.409(vior to that of v) +-.2 F 1.41(ersion 3.2 with respect to locale-speci\214c)-.15 F .423 +(string comparison when using the)184 596.4 R F1([[)2.922 E F0 .422 +(conditional command')2.922 F(s)-.55 E F1(<)2.922 E F0(and)2.922 E F1(>) +2.922 E F0 .422(operators \(see pre-)2.922 F(vious item\).)184 608.4 Q +F1(compat40)144 620.4 Q F0 1.409(If set,)184 632.4 R F1(bash)3.909 E F0 +1.409(changes its beha)3.909 F 1.409(vior to that of v)-.2 F 1.41 +(ersion 4.0 with respect to locale-speci\214c)-.15 F 2.008 +(string comparison when using the)184 644.4 R F1([[)4.508 E F0 2.007 +(conditional command')4.508 F(s)-.55 E F1(<)4.507 E F0(and)4.507 E F1(>) +4.507 E F0 2.007(operators \(see)4.507 F .769(description of)184 656.4 R +F1(compat31)3.269 E F0 3.269(\)a)C .769(nd the ef)-3.269 F .769 +(fect of interrupting a command list.)-.25 F .77(Bash v)5.77 F(ersions) +-.15 E .087(4.0 and later interrupt the list as if the shell recei)184 +668.4 R -.15(ve)-.25 G 2.586(dt).15 G .086(he interrupt; pre)-2.586 F +.086(vious v)-.25 F .086(ersions con-)-.15 F(tinue with the ne)184 680.4 +Q(xt command in the list.)-.15 E F1(compat41)144 692.4 Q F0 1.483 +(If set,)184 704.4 R F1(bash)3.983 E F0 3.983(,w)C 1.483(hen in)-3.983 F +F2(posix)3.983 E F0 1.484 +(mode, treats a single quote in a double-quoted parameter)3.983 F -.15 +(ex)184 716.4 S .959(pansion as a special character).15 F 5.959(.T)-.55 +G .958(he single quotes must match \(an e)-5.959 F -.15(ve)-.25 G 3.458 +(nn).15 G .958(umber\) and)-3.458 F .59 +(the characters between the single quotes are considered quoted.)184 +728.4 R .59(This is the beha)5.59 F .59(vior of)-.2 F(GNU Bash-4.2)72 +768 Q(2004 Apr 20)148.735 E(17)198.725 E 0 Cg EP +%%Page: 18 18 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E .59 +(posix mode through v)184 84 R .589(ersion 4.1.)-.15 F .589(The def) +5.589 F .589(ault bash beha)-.1 F .589(vior remains as in pre)-.2 F .589 +(vious v)-.25 F(er)-.15 E(-)-.2 E(sions.)184 96 Q/F1 10/Times-Bold@0 SF +(compat42)144 108 Q F0 1.796(If set,)184 120 R F1(bash)4.296 E F0 1.796 +(does not process the replacement string in the pattern substitution w) +4.296 F(ord)-.1 E -.15(ex)184 132 S(pansion using quote remo).15 E -.25 +(va)-.15 G(l.).25 E F1(complete_fullquote)144 144 Q F0 .654(If set,)184 +156 R F1(bash)3.153 E F0 .653(quotes all shell metacharacters in \214le\ +names and directory names when per)3.153 F(-)-.2 E 1.524 +(forming completion.)184 168 R 1.524(If not set,)6.524 F F1(bash)4.024 E +F0(remo)4.024 E -.15(ve)-.15 G 4.024(sm).15 G 1.524 +(etacharacters such as the dollar sign)-4.024 F 2.667(from the set of c\ +haracters that will be quoted in completed \214lenames when these)184 +180 R .028(metacharacters appear in shell v)184 192 R .028 +(ariable references in w)-.25 F .029(ords to be completed.)-.1 F .029 +(This means)5.029 F 1.073(that dollar signs in v)184 204 R 1.073 +(ariable names that e)-.25 F 1.073 +(xpand to directories will not be quoted; ho)-.15 F(w-)-.25 E -2.15 -.25 +(ev e)184 216 T 1.922 -.4(r, a).25 H 1.422 -.15(ny d).4 H 1.123 +(ollar signs appearing in \214lenames will not be quoted, either).15 F +6.123(.T)-.55 G 1.123(his is acti)-6.123 F -.15(ve)-.25 G .59 +(only when bash is using backslashes to quote completed \214lenames.)184 +228 R .59(This v)5.59 F .59(ariable is set)-.25 F(by def)184 240 Q +(ault, which is the def)-.1 E(ault bash beha)-.1 E(vior in v)-.2 E +(ersions through 4.2.)-.15 E F1(dir)144 252 Q(expand)-.18 E F0 .486 +(If set,)184 264 R F1(bash)2.986 E F0 .486 +(replaces directory names with the results of w)2.986 F .486(ord e)-.1 F +.487(xpansion when perform-)-.15 F .18(ing \214lename completion.)184 +276 R .179(This changes the contents of the readline editing b)5.18 F +(uf)-.2 E(fer)-.25 E 5.179(.I)-.55 G 2.679(fn)-5.179 G(ot)-2.679 E(set,) +184 288 Q F1(bash)2.5 E F0(attempts to preserv)2.5 E 2.5(ew)-.15 G +(hat the user typed.)-2.5 E F1(dirspell)144 300 Q F0 .858(If set,)7.77 F +F1(bash)3.358 E F0 .858 +(attempts spelling correction on directory names during w)3.358 F .859 +(ord completion if)-.1 F +(the directory name initially supplied does not e)184 312 Q(xist.)-.15 E +F1(dotglob)144 324 Q F0 .165(If set,)7.77 F F1(bash)2.665 E F0 .165 +(includes \214lenames be)2.665 F .165(ginning with a `.)-.15 F 2.665('i) +-.7 G 2.665(nt)-2.665 G .165(he results of pathname e)-2.665 F +(xpansion.)-.15 E F1(execfail)144 336 Q F0 1.386 +(If set, a non-interacti)7.79 F 1.686 -.15(ve s)-.25 H 1.386 +(hell will not e).15 F 1.386(xit if it cannot e)-.15 F -.15(xe)-.15 G +1.387(cute the \214le speci\214ed as an).15 F(ar)184 348 Q +(gument to the)-.18 E F1(exec)2.5 E F0 -.2(bu)2.5 G(iltin command.).2 E +(An interacti)5 E .3 -.15(ve s)-.25 H(hell does not e).15 E(xit if)-.15 +E F1(exec)2.5 E F0 -.1(fa)2.5 G(ils.).1 E F1(expand_aliases)144 360 Q F0 +.717(If set, aliases are e)184 372 R .717(xpanded as described abo)-.15 +F 1.017 -.15(ve u)-.15 H(nder).15 E/F2 9/Times-Bold@0 SF(ALIASES)3.217 E +/F3 9/Times-Roman@0 SF(.)A F0 .716(This option is enabled)5.217 F +(by def)184 384 Q(ault for interacti)-.1 E .3 -.15(ve s)-.25 H(hells.) +.15 E F1(extdeb)144 396 Q(ug)-.2 E F0(If set, beha)184 408 Q +(vior intended for use by deb)-.2 E(uggers is enabled:)-.2 E F1(1.)184 +420 Q F0(The)28.5 E F14.25 E F0 1.75(option to the)4.25 F F1 +(declar)4.251 E(e)-.18 E F0 -.2(bu)4.251 G 1.751 +(iltin displays the source \214le name and line).2 F +(number corresponding to each function name supplied as an ar)220 432 Q +(gument.)-.18 E F1(2.)184 444 Q F0 1.667(If the command run by the)28.5 +F F1(DEB)4.167 E(UG)-.1 E F0 1.667(trap returns a non-zero v)4.167 F +1.667(alue, the ne)-.25 F(xt)-.15 E(command is skipped and not e)220 456 +Q -.15(xe)-.15 G(cuted.).15 E F1(3.)184 468 Q F0 .84 +(If the command run by the)28.5 F F1(DEB)3.34 E(UG)-.1 E F0 .841 +(trap returns a v)3.341 F .841(alue of 2, and the shell is)-.25 F -.15 +(exe)220 480 S .488 +(cuting in a subroutine \(a shell function or a shell script e).15 F +-.15(xe)-.15 G .488(cuted by the).15 F F1(.)2.988 E F0(or)2.988 E F1 +(sour)220 492 Q(ce)-.18 E F0 -.2(bu)2.5 G(iltins\), a call to).2 E F1 +-.18(re)2.5 G(tur).18 E(n)-.15 E F0(is simulated.)2.5 E F1(4.)184 504 Q +F2 -.27(BA)28.5 G(SH_ARGC).27 E F0(and)3.153 E F2 -.27(BA)3.403 G +(SH_ARGV).27 E F0 .904(are updated as described in their descriptions) +3.154 F(abo)220 516 Q -.15(ve)-.15 G(.).15 E F1(5.)184 528 Q F0 1.359 +(Function tracing is enabled:)28.5 F 1.359 +(command substitution, shell functions, and sub-)6.359 F(shells in)220 +540 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(dw).1 G(ith)-2.5 E F1(\()2.5 E/F4 10 +/Times-Italic@0 SF(command)2.5 E F1(\))2.5 E F0(inherit the)2.5 E F1 +(DEB)2.5 E(UG)-.1 E F0(and)2.5 E F1(RETURN)2.5 E F0(traps.)2.5 E F1(6.) +184 552 Q F0 .804(Error tracing is enabled:)28.5 F .805 +(command substitution, shell functions, and subshells)5.804 F(in)220 564 +Q -.2(vo)-.4 G -.1(ke).2 G 2.5(dw).1 G(ith)-2.5 E F1(\()2.5 E F4 +(command)2.5 E F1(\))2.5 E F0(inherit the)2.5 E F1(ERR)2.5 E F0(trap.) +2.5 E F1(extglob)144 576 Q F0 .4(If set, the e)8.89 F .4 +(xtended pattern matching features described abo)-.15 F .7 -.15(ve u) +-.15 H(nder).15 E F1 -.1(Pa)2.9 G .4(thname Expan-).1 F(sion)184 588 Q +F0(are enabled.)2.5 E F1(extquote)144 600 Q F0 2.473(If set,)184 612 R +F1($)4.973 E F0<08>A F4(string)A F0 4.973<0861>C(nd)-4.973 E F1($)4.973 +E F0(")A F4(string)A F0 4.973("q)C 2.473(uoting is performed within) +-4.973 F F1(${)4.973 E F4(par)A(ameter)-.15 E F1(})A F0 -.15(ex)4.973 G +(pansions).15 E(enclosed in double quotes.)184 624 Q +(This option is enabled by def)5 E(ault.)-.1 E F1(failglob)144 636 Q F0 +1.425(If set, patterns which f)7.77 F 1.425 +(ail to match \214lenames during pathname e)-.1 F 1.424 +(xpansion result in an)-.15 F -.15(ex)184 648 S(pansion error).15 E(.) +-.55 E F1 -.25(fo)144 660 S -.18(rc).25 G(e_\214gnor).18 E(e)-.18 E F0 +.936(If set, the suf)184 672 R<8c78>-.25 E .936(es speci\214ed by the) +-.15 F F2(FIGNORE)3.436 E F0 .936(shell v)3.186 F .936(ariable cause w) +-.25 F .937(ords to be ignored)-.1 F .32(when performing w)184 684 R .32 +(ord completion e)-.1 F -.15(ve)-.25 G 2.82(ni).15 G 2.82(ft)-2.82 G .32 +(he ignored w)-2.82 F .32(ords are the only possible com-)-.1 F 2.947 +(pletions. See)184 696 R F2 .447(SHELL V)2.947 F(ARIABLES)-1.215 E F0 +(abo)2.697 E .747 -.15(ve f)-.15 H .448(or a description of).15 F F2 +(FIGNORE)2.948 E F3(.)A F0 .448(This option is)4.948 F(enabled by def) +184 708 Q(ault.)-.1 E(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(18) +198.725 E 0 Cg EP +%%Page: 19 19 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF(globasciiranges)144 84 Q F0 2.519(If set, range e)184 +96 R 2.519(xpressions used in pattern matching brack)-.15 F 2.518(et e) +-.1 F 2.518(xpressions \(see)-.15 F/F2 9/Times-Bold@0 SF -.09(Pa)5.018 G +(tter).09 E(n)-.135 E(Matching)184 108 Q F0(abo)2.964 E -.15(ve)-.15 G +3.214(\)b).15 G(eha)-3.214 E 1.014 -.15(ve a)-.2 H 3.214(si).15 G 3.214 +(fi)-3.214 G 3.214(nt)-3.214 G .714 +(he traditional C locale when performing comparisons.)-3.214 F 1.02 +(That is, the current locale')184 120 R 3.52(sc)-.55 G 1.02 +(ollating sequence is not tak)-3.52 F 1.02(en into account, so)-.1 F F1 +(b)3.52 E F0 1.02(will not)3.52 F .956(collate between)184 132 R F1(A) +3.456 E F0(and)3.456 E F1(B)3.456 E F0 3.457(,a)C .957(nd upper)-3.457 F +.957(-case and lo)-.2 F(wer)-.25 E .957 +(-case ASCII characters will collate)-.2 F(together)184 144 Q(.)-.55 E +F1(globstar)144 156 Q F0 .519(If set, the pattern)5 F F1(**)3.019 E F0 +.519(used in a pathname e)3.019 F .519(xpansion conte)-.15 F .518 +(xt will match all \214les and zero)-.15 F .431 +(or more directories and subdirectories.)184 168 R .431 +(If the pattern is follo)5.431 F .432(wed by a)-.25 F F1(/)2.932 E F0 +2.932(,o)C .432(nly directories)-2.932 F(and subdirectories match.)184 +180 Q F1(gnu_errfmt)144 192 Q F0(If set, shell error messages are writt\ +en in the standard GNU error message format.)184 204 Q F1(histappend)144 +216 Q F0 .676 +(If set, the history list is appended to the \214le named by the v)184 +228 R .676(alue of the)-.25 F F2(HISTFILE)3.176 E F0 -.25(va)2.926 G +(ri-).25 E(able when the shell e)184 240 Q(xits, rather than o)-.15 E +-.15(ve)-.15 G(rwriting the \214le.).15 E F1(histr)144 252 Q(eedit)-.18 +E F0 .575(If set, and)184 264 R F1 -.18(re)3.075 G(adline).18 E F0 .575 +(is being used, a user is gi)3.075 F -.15(ve)-.25 G 3.075(nt).15 G .576 +(he opportunity to re-edit a f)-3.075 F .576(ailed his-)-.1 F +(tory substitution.)184 276 Q F1(histv)144 288 Q(erify)-.1 E F0 .403 +(If set, and)184 300 R F1 -.18(re)2.903 G(adline).18 E F0 .403 +(is being used, the results of history substitution are not immediately) +2.903 F .661(passed to the shell parser)184 312 R 5.661(.I)-.55 G .662 +(nstead, the resulting line is loaded into the)-5.661 F F1 -.18(re)3.162 +G(adline).18 E F0(editing)3.162 E -.2(bu)184 324 S -.25(ff).2 G(er).25 E +2.5(,a)-.4 G(llo)-2.5 E(wing further modi\214cation.)-.25 E F1 +(hostcomplete)144 336 Q F0 1.182(If set, and)184 348 R F1 -.18(re)3.682 +G(adline).18 E F0 1.182(is being used,)3.682 F F1(bash)3.682 E F0 1.181 +(will attempt to perform hostname completion)3.681 F 1.38(when a w)184 +360 R 1.38(ord containing a)-.1 F F1(@)3.881 E F0 1.381 +(is being completed \(see)3.881 F F1(Completing)3.881 E F0(under)3.881 E +F2(READLINE)3.881 E F0(abo)184 372 Q -.15(ve)-.15 G 2.5(\). This).15 F +(is enabled by def)2.5 E(ault.)-.1 E F1(huponexit)144 384 Q F0(If set,) +184 396 Q F1(bash)2.5 E F0(will send)2.5 E F2(SIGHUP)2.5 E F0 +(to all jobs when an interacti)2.25 E .3 -.15(ve l)-.25 H(ogin shell e) +.15 E(xits.)-.15 E F1(interacti)144 408 Q -.1(ve)-.1 G(_comments).1 E F0 +.33(If set, allo)184 420 R 2.83(waw)-.25 G .33(ord be)-2.93 F .33 +(ginning with)-.15 F F1(#)2.83 E F0 .33(to cause that w)2.83 F .33 +(ord and all remaining characters on)-.1 F .967 +(that line to be ignored in an interacti)184 432 R 1.267 -.15(ve s)-.25 +H .967(hell \(see).15 F F2(COMMENTS)3.467 E F0(abo)3.217 E -.15(ve)-.15 +G 3.467(\). This).15 F .968(option is)3.468 F(enabled by def)184 444 Q +(ault.)-.1 E F1(lastpipe)144 456 Q F0 1.212 +(If set, and job control is not acti)6.66 F -.15(ve)-.25 G 3.712(,t).15 +G 1.212(he shell runs the last command of a pipeline not)-3.712 F -.15 +(exe)184 468 S(cuted in the background in the current shell en).15 E +(vironment.)-.4 E F1(lithist)144 480 Q F0 .654(If set, and the)15.55 F +F1(cmdhist)3.154 E F0 .654 +(option is enabled, multi-line commands are sa)3.154 F -.15(ve)-.2 G +3.155(dt).15 G 3.155(ot)-3.155 G .655(he history)-3.155 F +(with embedded ne)184 492 Q +(wlines rather than using semicolon separators where possible.)-.25 E F1 +(login_shell)144 504 Q F0 .486 +(The shell sets this option if it is started as a login shell \(see)184 +516 R F2(INV)2.986 E(OCA)-.405 E(TION)-.855 E F0(abo)2.736 E -.15(ve) +-.15 G 2.986(\). The).15 F -.25(va)184 528 S(lue may not be changed.).25 +E F1(mailwar)144 540 Q(n)-.15 E F0 .814(If set, and a \214le that)184 +552 R F1(bash)3.314 E F0 .815 +(is checking for mail has been accessed since the last time it)3.314 F +-.1(wa)184 564 S 2.5(sc).1 G(heck)-2.5 E(ed, the message `)-.1 E +(`The mail in)-.74 E/F3 10/Times-Italic@0 SF(mail\214le)2.5 E F0 +(has been read')2.5 E 2.5('i)-.74 G 2.5(sd)-2.5 G(isplayed.)-2.5 E F1 +(no_empty_cmd_completion)144 576 Q F0 .325(If set, and)184 588 R F1 -.18 +(re)2.825 G(adline).18 E F0 .325(is being used,)2.825 F F1(bash)2.824 E +F0 .324(will not attempt to search the)2.824 F F2 -.666(PA)2.824 G(TH) +-.189 E F0 .324(for possible)2.574 F +(completions when completion is attempted on an empty line.)184 600 Q F1 +(nocaseglob)144 612 Q F0 .436(If set,)184 624 R F1(bash)2.936 E F0 .436 +(matches \214lenames in a case\255insensiti)2.936 F .737 -.15(ve f)-.25 +H .437(ashion when performing pathname).05 F -.15(ex)184 636 S +(pansion \(see).15 E F1 -.1(Pa)2.5 G(thname Expansion).1 E F0(abo)2.5 E +-.15(ve)-.15 G(\).).15 E F1(nocasematch)144 648 Q F0 1.194(If set,)184 +660 R F1(bash)3.694 E F0 1.194(matches patterns in a case\255insensiti) +3.694 F 1.493 -.15(ve f)-.25 H 1.193(ashion when performing matching).05 +F(while e)184 672 Q -.15(xe)-.15 G(cuting).15 E F1(case)2.5 E F0(or)2.5 +E F1([[)2.5 E F0(conditional commands.)2.5 E F1(nullglob)144 684 Q F0 +.854(If set,)184 696 R F1(bash)3.354 E F0(allo)3.354 E .855 +(ws patterns which match no \214les \(see)-.25 F F1 -.1(Pa)3.355 G .855 +(thname Expansion).1 F F0(abo)3.355 E -.15(ve)-.15 G 3.355(\)t).15 G(o) +-3.355 E -.15(ex)184 708 S(pand to a null string, rather than themselv) +.15 E(es.)-.15 E(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(19)198.725 +E 0 Cg EP +%%Page: 20 20 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF(pr)144 84 Q(ogcomp)-.18 E F0 .677 +(If set, the programmable completion f)184 96 R .677(acilities \(see)-.1 +F F1(Pr)3.176 E .676(ogrammable Completion)-.18 F F0(abo)3.176 E -.15 +(ve)-.15 G(\)).15 E(are enabled.)184 108 Q +(This option is enabled by def)5 E(ault.)-.1 E F1(pr)144 120 Q(omptv) +-.18 E(ars)-.1 E F0 1.447(If set, prompt strings under)184 132 R 1.448 +(go parameter e)-.18 F 1.448(xpansion, command substitution, arithmetic) +-.15 F -.15(ex)184 144 S .171(pansion, and quote remo).15 F -.25(va)-.15 +G 2.67(la).25 G .17(fter being e)-2.67 F .17(xpanded as described in) +-.15 F/F2 9/Times-Bold@0 SF(PR)2.67 E(OMPTING)-.27 E F0(abo)2.42 E -.15 +(ve)-.15 G(.).15 E(This option is enabled by def)184 156 Q(ault.)-.1 E +F1 -.18(re)144 168 S(stricted_shell).18 E F0 1.069 +(The shell sets this option if it is started in restricted mode \(see) +184 180 R F2 1.069(RESTRICTED SHELL)3.569 F F0(belo)184 192 Q 4.178 +(w\). The)-.25 F -.25(va)4.178 G 1.678(lue may not be changed.).25 F +1.678(This is not reset when the startup \214les are)6.678 F -.15(exe) +184 204 S(cuted, allo).15 E(wing the startup \214les to disco)-.25 E +-.15(ve)-.15 G 2.5(rw).15 G(hether or not a shell is restricted.)-2.5 E +F1(shift_v)144 216 Q(erbose)-.1 E F0 .501(If set, the)184 228 R F1 +(shift)3.001 E F0 -.2(bu)3.001 G .501 +(iltin prints an error message when the shift count e).2 F .502 +(xceeds the number)-.15 F(of positional parameters.)184 240 Q F1(sour) +144 252 Q(cepath)-.18 E F0 .771(If set, the)184 264 R F1(sour)3.271 E +(ce)-.18 E F0(\()3.271 E F1(.)A F0 3.271(\)b)C .771(uiltin uses the v) +-3.471 F .771(alue of)-.25 F F2 -.666(PA)3.27 G(TH)-.189 E F0 .77 +(to \214nd the directory containing the)3.02 F(\214le supplied as an ar) +184 276 Q 2.5(gument. This)-.18 F(option is enabled by def)2.5 E(ault.) +-.1 E F1(xpg_echo)144 288 Q F0(If set, the)184 300 Q F1(echo)2.5 E F0 +-.2(bu)2.5 G(iltin e).2 E(xpands backslash-escape sequences by def)-.15 +E(ault.)-.1 E F1(suspend)108 316.8 Q F0([)2.5 E F1A F0(])A 1.001 +(Suspend the e)144 328.8 R -.15(xe)-.15 G 1.001 +(cution of this shell until it recei).15 F -.15(ve)-.25 G 3.501(sa).15 G +F2(SIGCONT)A F0 3.502(signal. A)3.252 F 1.002(login shell cannot be) +3.502 F .023(suspended; the)144 340.8 R F12.523 E F0 .023 +(option can be used to o)2.523 F -.15(ve)-.15 G .022 +(rride this and force the suspension.).15 F .022(The return status is) +5.022 F 2.5(0u)144 352.8 S(nless the shell is a login shell and)-2.5 E +F12.5 E F0(is not supplied, or if job control is not enabled.)2.5 +E F1(test)108 369.6 Q/F3 10/Times-Italic@0 SF -.2(ex)2.5 G(pr).2 E F1([) +108 381.6 Q F3 -.2(ex)2.5 G(pr).2 E F1(])2.5 E F0 .877 +(Return a status of 0 \(true\) or 1 \(f)6.77 F .878 +(alse\) depending on the e)-.1 F -.25(va)-.25 G .878 +(luation of the conditional e).25 F(xpression)-.15 E F3 -.2(ex)144 393.6 +S(pr).2 E F0 5.53(.E).73 G .53 +(ach operator and operand must be a separate ar)-5.53 F 3.03 +(gument. Expressions)-.18 F .53(are composed of the)3.03 F 3.079 +(primaries described abo)144 405.6 R 3.379 -.15(ve u)-.15 H(nder).15 E +F2(CONDITION)5.579 E 3.079(AL EXPRESSIONS)-.18 F/F4 9/Times-Roman@0 SF +(.)A F1(test)7.579 E F0 3.08(does not accept an)5.58 F(y)-.15 E +(options, nor does it accept and ignore an ar)144 417.6 Q(gument of)-.18 +E F12.5 E F0(as signifying the end of options.)2.5 E .786 +(Expressions may be combined using the follo)144 435.6 R .785 +(wing operators, listed in decreasing order of prece-)-.25 F 3.411 +(dence. The)144 447.6 R -.25(eva)3.411 G .911 +(luation depends on the number of ar).25 F .912(guments; see belo)-.18 F +4.712 -.65(w. O)-.25 H .912(perator precedence is).65 F +(used when there are \214v)144 459.6 Q 2.5(eo)-.15 G 2.5(rm)-2.5 G +(ore ar)-2.5 E(guments.)-.18 E F1(!)144 471.6 Q F3 -.2(ex)2.5 G(pr).2 E +F0 -.35(Tr)12.6 G(ue if).35 E F3 -.2(ex)2.5 G(pr).2 E F0(is f)3.23 E +(alse.)-.1 E F1(\()144 483.6 Q F3 -.2(ex)2.5 G(pr).2 E F1(\))2.5 E F0 +.26(Returns the v)6.77 F .26(alue of)-.25 F F3 -.2(ex)2.76 G(pr).2 E F0 +5.26(.T)C .26(his may be used to o)-5.26 F -.15(ve)-.15 G .26 +(rride the normal precedence of opera-).15 F(tors.)180 495.6 Q F3 -.2 +(ex)144 507.6 S(pr1).2 E F02.5 E F1(a)A F3 -.2(ex)2.5 G(pr2).2 E F0 +-.35(Tr)180 519.6 S(ue if both).35 E F3 -.2(ex)2.5 G(pr1).2 E F0(and)2.5 +E F3 -.2(ex)2.5 G(pr2).2 E F0(are true.)2.52 E F3 -.2(ex)144 531.6 S +(pr1).2 E F02.5 E F1(o)A F3 -.2(ex)2.5 G(pr2).2 E F0 -.35(Tr)180 +543.6 S(ue if either).35 E F3 -.2(ex)2.5 G(pr1).2 E F0(or)2.5 E F3 -.2 +(ex)2.5 G(pr2).2 E F0(is true.)2.52 E F1(test)144 560.4 Q F0(and)2.5 E +F1([)2.5 E F0 -.25(eva)2.5 G(luate conditional e).25 E +(xpressions using a set of rules based on the number of ar)-.15 E +(guments.)-.18 E 2.5(0a)144 578.4 S -.18(rg)-2.5 G(uments).18 E(The e) +180 590.4 Q(xpression is f)-.15 E(alse.)-.1 E 2.5(1a)144 602.4 S -.18 +(rg)-2.5 G(ument).18 E(The e)180 614.4 Q +(xpression is true if and only if the ar)-.15 E(gument is not null.)-.18 +E 2.5(2a)144 626.4 S -.18(rg)-2.5 G(uments).18 E .37(If the \214rst ar) +180 638.4 R .37(gument is)-.18 F F1(!)2.87 E F0 2.87(,t)C .37(he e)-2.87 +F .37(xpression is true if and only if the second ar)-.15 F .37 +(gument is null.)-.18 F .38(If the \214rst ar)180 650.4 R .38 +(gument is one of the unary conditional operators listed abo)-.18 F .679 +-.15(ve u)-.15 H(nder).15 E F2(CONDI-)2.879 E(TION)180 662.4 Q .552 +(AL EXPRESSIONS)-.18 F F4(,)A F0 .552(the e)2.802 F .552 +(xpression is true if the unary test is true.)-.15 F .552 +(If the \214rst ar)5.552 F(gu-)-.18 E(ment is not a v)180 674.4 Q +(alid unary conditional operator)-.25 E 2.5(,t)-.4 G(he e)-2.5 E +(xpression is f)-.15 E(alse.)-.1 E 2.5(3a)144 686.4 S -.18(rg)-2.5 G +(uments).18 E .236(The follo)180 698.4 R .236 +(wing conditions are applied in the order listed.)-.25 F .236 +(If the second ar)5.236 F .236(gument is one of)-.18 F .855 +(the binary conditional operators listed abo)180 710.4 R 1.155 -.15 +(ve u)-.15 H(nder).15 E F2(CONDITION)3.355 E .855(AL EXPRESSIONS)-.18 F +F4(,)A F0(the)3.105 E .579(result of the e)180 722.4 R .578(xpression i\ +s the result of the binary test using the \214rst and third ar)-.15 F +(guments)-.18 E(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(20)198.725 E +0 Cg EP +%%Page: 21 21 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E 1.332 +(as operands.)180 84 R(The)6.332 E/F1 10/Times-Bold@0 SF3.832 E F0 +(and)3.832 E F13.832 E F0 1.333 +(operators are considered binary operators when there are)3.832 F .558 +(three ar)180 96 R 3.058(guments. If)-.18 F .558(the \214rst ar)3.058 F +.558(gument is)-.18 F F1(!)3.058 E F0 3.058(,t)C .558(he v)-3.058 F .558 +(alue is the ne)-.25 F -.05(ga)-.15 G .558(tion of the tw).05 F(o-ar)-.1 +E(gument)-.18 E .52(test using the second and third ar)180 108 R 3.021 +(guments. If)-.18 F .521(the \214rst ar)3.021 F .521(gument is e)-.18 F +(xactly)-.15 E F1(\()3.021 E F0 .521(and the third)3.021 F(ar)180 120 Q +.485(gument is e)-.18 F(xactly)-.15 E F1(\))2.985 E F0 2.985(,t)C .485 +(he result is the one-ar)-2.985 F .485(gument test of the second ar)-.18 +F 2.985(gument. Other)-.18 F(-)-.2 E(wise, the e)180 132 Q +(xpression is f)-.15 E(alse.)-.1 E 2.5(4a)144 144 S -.18(rg)-2.5 G +(uments).18 E .384(If the \214rst ar)180 156 R .384(gument is)-.18 F F1 +(!)2.884 E F0 2.885(,t)C .385(he result is the ne)-2.885 F -.05(ga)-.15 +G .385(tion of the three-ar).05 F .385(gument e)-.18 F .385 +(xpression com-)-.15 F 1.648(posed of the remaining ar)180 168 R 4.147 +(guments. Otherwise,)-.18 F 1.647(the e)4.147 F 1.647 +(xpression is parsed and e)-.15 F -.25(va)-.25 G(luated).25 E +(according to precedence using the rules listed abo)180 180 Q -.15(ve) +-.15 G(.).15 E 2.5(5o)144 192 S 2.5(rm)-2.5 G(ore ar)-2.5 E(guments)-.18 +E 1.635(The e)180 204 R 1.635(xpression is parsed and e)-.15 F -.25(va) +-.25 G 1.635(luated according to precedence using the rules listed).25 F +(abo)180 216 Q -.15(ve)-.15 G(.).15 E(When used with)144 234 Q F1(test) +2.5 E F0(or)2.5 E F1([)2.5 E F0 2.5(,t)C(he)-2.5 E F1(<)2.5 E F0(and)2.5 +E F1(>)2.5 E F0(operators sort le)2.5 E +(xicographically using ASCII ordering.)-.15 E F1(times)108 250.8 Q F0 +1.229(Print the accumulated user and system times for the shell and for\ + processes run from the shell.)13.23 F(The return status is 0.)144 262.8 +Q F1(trap)108 279.6 Q F0([)2.5 E F1(\255lp)A F0 2.5(][)C([)-2.5 E/F2 10 +/Times-Italic@0 SF(ar)A(g)-.37 E F0(])A F2(sigspec)2.5 E F0(...])2.5 E +.702(The command)144 291.6 R F2(ar)3.532 E(g)-.37 E F0 .702 +(is to be read and e)3.422 F -.15(xe)-.15 G .702 +(cuted when the shell recei).15 F -.15(ve)-.25 G 3.203(ss).15 G +(ignal\(s\))-3.203 E F2(sigspec)3.203 E F0 5.703(.I).31 G(f)-5.703 E F2 +(ar)3.533 E(g)-.37 E F0(is)3.423 E .609(absent \(and there is a single) +144 303.6 R F2(sigspec)3.108 E F0 3.108(\)o)C(r)-3.108 E F13.108 E +F0 3.108(,e)C .608 +(ach speci\214ed signal is reset to its original disposition)-3.108 F +.658(\(the v)144 315.6 R .658(alue it had upon entrance to the shell\).) +-.25 F(If)5.658 E F2(ar)3.488 E(g)-.37 E F0 .659 +(is the null string the signal speci\214ed by each)3.378 F F2(sigspec) +144.34 327.6 Q F0 .581 +(is ignored by the shell and by the commands it in)3.391 F -.2(vo)-.4 G +-.1(ke).2 G 3.08(s. If).1 F F2(ar)3.41 E(g)-.37 E F0 .58 +(is not present and)3.3 F F13.08 E F0(has)3.08 E 1.214 +(been supplied, then the trap commands associated with each)144 339.6 R +F2(sigspec)4.054 E F0 1.215(are displayed.)4.024 F 1.215(If no ar)6.215 +F(gu-)-.18 E .86(ments are supplied or if only)144 351.6 R F13.36 +E F0 .86(is gi)3.36 F -.15(ve)-.25 G(n,).15 E F1(trap)3.36 E F0 .86 +(prints the list of commands associated with each)3.36 F 2.83 +(signal. The)144 363.6 R F12.83 E F0 .33(option causes the shell \ +to print a list of signal names and their corresponding num-)2.83 F +4.311(bers. Each)144 375.6 R F2(sigspec)4.651 E F0 1.811 +(is either a signal name de\214ned in <)4.621 F F2(signal.h)A F0 1.81 +(>, or a signal number)B 6.81(.S)-.55 G(ignal)-6.81 E +(names are case insensiti)144 387.6 Q .3 -.15(ve a)-.25 H(nd the).15 E +/F3 9/Times-Bold@0 SF(SIG)2.5 E F0(pre\214x is optional.)2.25 E 1.648 +(If a)144 405.6 R F2(sigspec)4.488 E F0(is)4.458 E F3(EXIT)4.148 E F0 +1.648(\(0\) the command)3.898 F F2(ar)4.479 E(g)-.37 E F0 1.649(is e) +4.369 F -.15(xe)-.15 G 1.649(cuted on e).15 F 1.649(xit from the shell.) +-.15 F 1.649(If a)6.649 F F2(sigspec)4.489 E F0(is)4.459 E F3(DEB)144 +417.6 Q(UG)-.09 E/F4 9/Times-Roman@0 SF(,)A F0 1.168(the command)3.418 F +F2(ar)3.998 E(g)-.37 E F0 1.168(is e)3.888 F -.15(xe)-.15 G 1.167 +(cuted before e).15 F -.15(ve)-.25 G(ry).15 E F2 1.167(simple command) +3.667 F F0(,)A F2(for)3.667 E F0(command,)3.667 E F2(case)3.667 E F0 +(com-)3.667 E(mand,)144 429.6 Q F2(select)2.646 E F0 .146(command, e) +2.646 F -.15(ve)-.25 G .146(ry arithmetic).15 F F2(for)2.646 E F0 .147 +(command, and before the \214rst command e)2.646 F -.15(xe)-.15 G .147 +(cutes in a).15 F .146(shell function \(see)144 441.6 R F3 .146 +(SHELL GRAMMAR)2.646 F F0(abo)2.396 E -.15(ve)-.15 G 2.646(\). Refer).15 +F .146(to the description of the)2.646 F F1(extdeb)2.645 E(ug)-.2 E F0 +.145(option to)2.645 F(the)144 453.6 Q F1(shopt)3.2 E F0 -.2(bu)3.2 G .7 +(iltin for details of its ef).2 F .7(fect on the)-.25 F F1(DEB)3.2 E(UG) +-.1 E F0 3.2(trap. If)3.2 F(a)3.2 E F2(sigspec)3.54 E F0(is)3.51 E F3 +(RETURN)3.2 E F4(,)A F0 .701(the com-)2.951 F(mand)144 465.6 Q F2(ar) +3.474 E(g)-.37 E F0 .644(is e)3.364 F -.15(xe)-.15 G .643 +(cuted each time a shell function or a script e).15 F -.15(xe)-.15 G +.643(cuted with the).15 F F1(.)3.143 E F0(or)3.143 E F1(sour)3.143 E(ce) +-.18 E F0 -.2(bu)3.143 G(iltins).2 E(\214nishes e)144 477.6 Q -.15(xe) +-.15 G(cuting.).15 E .521(If a)144 495.6 R F2(sigspec)3.361 E F0(is) +3.331 E F3(ERR)3.021 E F4(,)A F0 .522(the command)2.771 F F2(ar)3.352 E +(g)-.37 E F0 .522(is e)3.242 F -.15(xe)-.15 G .522(cuted whene).15 F +-.15(ve)-.25 G 3.022(raap).15 G .522(ipeline \(which may consist of a) +-3.022 F .185(single simple command\), a list, or a compound command re\ +turns a non\255zero e)144 507.6 R .184(xit status, subject to)-.15 F +.451(the follo)144 519.6 R .451(wing conditions.)-.25 F(The)5.451 E F3 +(ERR)2.951 E F0 .451(trap is not e)2.701 F -.15(xe)-.15 G .451 +(cuted if the f).15 F .452(ailed command is part of the com-)-.1 F .388 +(mand list immediately follo)144 531.6 R .388(wing a)-.25 F F1(while) +2.888 E F0(or)2.888 E F1(until)2.888 E F0 -.1(ke)2.888 G(yw)-.05 E .388 +(ord, part of the test in an)-.1 F F2(if)2.897 E F0 .387 +(statement, part)4.847 F .777(of a command e)144 543.6 R -.15(xe)-.15 G +.778(cuted in a).15 F F1(&&)3.278 E F0(or)3.278 E F1(||)3.278 E F0 .778 +(list e)3.278 F .778(xcept the command follo)-.15 F .778 +(wing the \214nal)-.25 F F1(&&)3.278 E F0(or)3.278 E F1(||)3.278 E F0 +3.278(,a)C -.15(ny)-3.278 G 1.28(command in a pipeline b)144 555.6 R +1.28(ut the last, or if the command')-.2 F 3.78(sr)-.55 G 1.28(eturn v) +-3.78 F 1.28(alue is being in)-.25 F -.15(ve)-.4 G 1.28(rted using).15 F +F1(!)3.78 E F0(.)A(These are the same conditions obe)144 567.6 Q +(yed by the)-.15 E F1(err)2.5 E(exit)-.18 E F0(\()2.5 E F1A F0 2.5 +(\)o)C(ption.)-2.5 E 1.095 +(Signals ignored upon entry to the shell cannot be trapped or reset.)144 +585.6 R -.35(Tr)6.095 G 1.095(apped signals that are not).35 F .662 +(being ignored are reset to their original v)144 597.6 R .662 +(alues in a subshell or subshell en)-.25 F .661(vironment when one is) +-.4 F 2.5(created. The)144 609.6 R(return status is f)2.5 E(alse if an) +-.1 E(y)-.15 E F2(sigspec)2.84 E F0(is in)2.81 E -.25(va)-.4 G +(lid; otherwise).25 E F1(trap)2.5 E F0(returns true.)2.5 E F1(type)108 +626.4 Q F0([)2.5 E F1(\255aftpP)A F0(])A F2(name)2.5 E F0([)2.5 E F2 +(name)A F0(...])2.5 E -.4(Wi)144 638.4 S .173 +(th no options, indicate ho).4 F 2.673(we)-.25 G(ach)-2.673 E F2(name) +3.033 E F0 -.1(wo)2.853 G .174 +(uld be interpreted if used as a command name.).1 F .174(If the)5.174 F +F1144 650.4 Q F0 .843(option is used,)3.343 F F1(type)3.343 E F0 +.843(prints a string which is one of)3.343 F F2(alias)3.343 E F0(,).27 E +F2 -.1(ke)3.343 G(ywor)-.2 E(d)-.37 E F0(,).77 E F2(function)3.343 E F0 +(,).24 E F2 -.2(bu)3.342 G(iltin).2 E F0 3.342(,o).24 G(r)-3.342 E F2 +(\214le)5.252 E F0(if)3.522 E F2(name)144.36 662.4 Q F0 .086 +(is an alias, shell reserv)2.766 F .086(ed w)-.15 F .086 +(ord, function, b)-.1 F .087(uiltin, or disk \214le, respecti)-.2 F -.15 +(ve)-.25 G(ly).15 E 5.087(.I)-.65 G 2.587(ft)-5.087 G(he)-2.587 E F2 +(name)2.947 E F0 .087(is not)2.767 F .119 +(found, then nothing is printed, and an e)144 674.4 R .118 +(xit status of f)-.15 F .118(alse is returned.)-.1 F .118(If the)5.118 F +F12.618 E F0 .118(option is used,)2.618 F F1(type)2.618 E F0 .855 +(either returns the name of the disk \214le that w)144 686.4 R .855 +(ould be e)-.1 F -.15(xe)-.15 G .855(cuted if).15 F F2(name)3.715 E F0 +.855(were speci\214ed as a com-)3.535 F .641(mand name, or nothing if) +144 698.4 R/F5 10/Courier@0 SF .641(type -t name)3.141 F F0 -.1(wo)3.141 +G .641(uld not return).1 F F2(\214le)3.14 E F0 5.64(.T).18 G(he)-5.64 E +F13.14 E F0 .64(option forces a)3.14 F F3 -.666(PA)3.14 G(TH)-.189 +E F0 .112(search for each)144 710.4 R F2(name)2.612 E F0 2.612(,e)C -.15 +(ve)-2.862 G 2.613(ni).15 G(f)-2.613 E F5 .113(type -t name)2.613 F F0 +-.1(wo)2.613 G .113(uld not return).1 F F2(\214le)2.613 E F0 5.113(.I) +.18 G 2.613(fac)-5.113 G .113(ommand is hashed,)-2.613 F F12.613 E +F0(and)144 722.4 Q F13.231 E F0 .731(print the hashed v)3.231 F +.73(alue, which is not necessarily the \214le that appears \214rst in) +-.25 F F3 -.666(PA)3.23 G(TH)-.189 E F4(.)A F0 .73(If the)5.23 F +(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(21)198.725 E 0 Cg EP +%%Page: 22 22 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF144 84 Q F0 1.748(option is used,)4.248 F F1(type) +4.248 E F0 1.748(prints all of the places that contain an e)4.248 F -.15 +(xe)-.15 G 1.748(cutable named).15 F/F2 10/Times-Italic@0 SF(name)4.249 +E F0 6.749(.T).18 G(his)-6.749 E .744 +(includes aliases and functions, if and only if the)144 96 R F1 +3.244 E F0 .744(option is not also used.)3.244 F .743 +(The table of hashed)5.744 F 1.223(commands is not consulted when using) +144 108 R F13.723 E F0 6.223(.T)C(he)-6.223 E F13.723 E F0 +1.223(option suppresses shell function lookup, as)3.723 F .326(with the) +144 120 R F1(command)2.826 E F0 -.2(bu)2.826 G(iltin.).2 E F1(type)5.326 +E F0 .326(returns true if all of the ar)2.826 F .325 +(guments are found, f)-.18 F .325(alse if an)-.1 F 2.825(ya)-.15 G .325 +(re not)-2.825 F(found.)144 132 Q F1(ulimit)108 148.8 Q F0([)2.5 E F1 +(\255HST)A(abcde\214lmnpqrstuvx)-.92 E F0([)2.5 E F2(limit)A F0(]])A +(Pro)144 160.8 Q .243(vides control o)-.15 F -.15(ve)-.15 G 2.743(rt).15 +G .243(he resources a)-2.743 F -.25(va)-.2 G .244 +(ilable to the shell and to processes started by it, on systems).25 F +.944(that allo)144 172.8 R 3.444(ws)-.25 G .944(uch control.)-3.444 F +(The)5.944 E F13.444 E F0(and)3.444 E F13.444 E F0 .943 +(options specify that the hard or soft limit is set for the)3.444 F(gi) +144 184.8 Q -.15(ve)-.25 G 2.708(nr).15 G 2.708(esource. A)-2.708 F .208 +(hard limit cannot be increased by a non-root user once it is set; a so\ +ft limit may)2.708 F .426(be increased up to the v)144 196.8 R .426 +(alue of the hard limit.)-.25 F .425(If neither)5.426 F F12.925 E +F0(nor)2.925 E F12.925 E F0 .425 +(is speci\214ed, both the soft and)2.925 F .139(hard limits are set.)144 +208.8 R .139(The v)5.139 F .139(alue of)-.25 F F2(limit)2.729 E F0 .139 +(can be a number in the unit speci\214ed for the resource or one)3.319 F +.742(of the special v)144 220.8 R(alues)-.25 E F1(hard)3.242 E F0(,)A F1 +(soft)3.241 E F0 3.241(,o)C(r)-3.241 E F1(unlimited)3.241 E F0 3.241(,w) +C .741(hich stand for the current hard limit, the current)-3.241 F .78 +(soft limit, and no limit, respecti)144 232.8 R -.15(ve)-.25 G(ly).15 E +5.78(.I)-.65 G(f)-5.78 E F2(limit)3.37 E F0 .78 +(is omitted, the current v)3.96 F .78(alue of the soft limit of the)-.25 +F .499(resource is printed, unless the)144 244.8 R F12.999 E F0 +.499(option is gi)2.999 F -.15(ve)-.25 G 2.999(n. When).15 F .498 +(more than one resource is speci\214ed, the)2.999 F +(limit name and unit are printed before the v)144 256.8 Q 2.5 +(alue. Other)-.25 F(options are interpreted as follo)2.5 E(ws:)-.25 E F1 +144 268.8 Q F0(All current limits are reported)25.3 E F1144 +280.8 Q F0(The maximum sock)24.74 E(et b)-.1 E(uf)-.2 E(fer size)-.25 E +F1144 292.8 Q F0(The maximum size of core \214les created)25.86 E +F1144 304.8 Q F0(The maximum size of a process')24.74 E 2.5(sd) +-.55 G(ata se)-2.5 E(gment)-.15 E F1144 316.8 Q F0 +(The maximum scheduling priority \("nice"\))25.86 E F1144 328.8 Q +F0(The maximum size of \214les written by the shell and its children) +26.97 E F1144 340.8 Q F0(The maximum number of pending signals) +27.52 E F1144 352.8 Q F0(The maximum size that may be lock)27.52 E +(ed into memory)-.1 E F1144 364.8 Q F0 +(The maximum resident set size \(man)21.97 E 2.5(ys)-.15 G +(ystems do not honor this limit\))-2.5 E F1144 376.8 Q F0 .791(Th\ +e maximum number of open \214le descriptors \(most systems do not allo) +24.74 F 3.291(wt)-.25 G .791(his v)-3.291 F .791(alue to)-.25 F +(be set\))180 388.8 Q F1144 400.8 Q F0 +(The pipe size in 512-byte blocks \(this may not be set\))24.74 E F1 +144 412.8 Q F0 +(The maximum number of bytes in POSIX message queues)24.74 E F1144 +424.8 Q F0(The maximum real-time scheduling priority)25.86 E F1144 +436.8 Q F0(The maximum stack size)26.41 E F1144 448.8 Q F0 +(The maximum amount of cpu time in seconds)26.97 E F1144 460.8 Q +F0(The maximum number of processes a)24.74 E -.25(va)-.2 G +(ilable to a single user).25 E F1144 472.8 Q F0 .47 +(The maximum amount of virtual memory a)25.3 F -.25(va)-.2 G .47 +(ilable to the shell and, on some systems, to).25 F(its children)180 +484.8 Q F1144 496.8 Q F0(The maximum number of \214le locks)25.3 E +F1144 508.8 Q F0(The maximum number of threads)23.63 E(If)144 +525.6 Q F2(limit)3.058 E F0 .468(is gi)3.648 F -.15(ve)-.25 G .468 +(n, and the).15 F F12.968 E F0 .468(option is not used,)2.968 F F2 +(limit)2.968 E F0 .468(is the ne)2.968 F 2.968(wv)-.25 G .468 +(alue of the speci\214ed resource.)-3.218 F(If)5.468 E .045 +(no option is gi)144 537.6 R -.15(ve)-.25 G .045(n, then).15 F F1 +2.545 E F0 .045(is assumed.)2.545 F -1.11(Va)5.045 G .045 +(lues are in 1024-byte increments, e)1.11 F .044(xcept for)-.15 F F1 +2.544 E F0 2.544(,w)C .044(hich is)-2.544 F .402(in seconds;)144 +549.6 R F12.902 E F0 2.902(,w)C .402 +(hich is in units of 512-byte blocks; and)-2.902 F F12.902 E F0(,) +A F12.902 E F0(,)A F12.902 E F0 2.902(,a)C(nd)-2.902 E F1 +2.903 E F0 2.903(,w)C .403(hich are unscaled)-2.903 F -.25(va)144 +561.6 S 3.083(lues. The).25 F .583(return status is 0 unless an in)3.083 +F -.25(va)-.4 G .583(lid option or ar).25 F .583 +(gument is supplied, or an error occurs)-.18 F(while setting a ne)144 +573.6 Q 2.5(wl)-.25 G(imit.)-2.5 E F1(umask)108 590.4 Q F0([)2.5 E F1 +A F0 2.5(][)C F1-2.5 E F0 2.5(][)C F2(mode)-2.5 E F0(])A .2 +(The user \214le-creation mask is set to)144 602.4 R F2(mode)2.7 E F0 +5.2(.I).18 G(f)-5.2 E F2(mode)3.08 E F0(be)2.88 E .2 +(gins with a digit, it is interpreted as an octal)-.15 F .066(number; o\ +therwise it is interpreted as a symbolic mode mask similar to that acce\ +pted by)144 614.4 R F2 -.15(ch)2.566 G(mod).15 E F0(\(1\).).77 E(If)144 +626.4 Q F2(mode)3.262 E F0 .382(is omitted, the current v)3.062 F .382 +(alue of the mask is printed.)-.25 F(The)5.382 E F12.882 E F0 .382 +(option causes the mask to be)2.882 F .547 +(printed in symbolic form; the def)144 638.4 R .547 +(ault output is an octal number)-.1 F 5.547(.I)-.55 G 3.047(ft)-5.547 G +(he)-3.047 E F13.047 E F0 .547(option is supplied, and)3.047 F F2 +(mode)144.38 650.4 Q F0 .551 +(is omitted, the output is in a form that may be reused as input.)3.231 +F .552(The return status is 0 if the)5.552 F(mode w)144 662.4 Q +(as successfully changed or if no)-.1 E F2(mode)2.5 E F0(ar)2.5 E +(gument w)-.18 E(as supplied, and f)-.1 E(alse otherwise.)-.1 E F1 +(unalias)108 679.2 Q F0<5bad>2.5 E F1(a)A F0 2.5(][)C F2(name)-2.5 E F0 +(...])2.5 E(Remo)144 691.2 Q 1.955 -.15(ve e)-.15 H(ach).15 E F2(name) +4.155 E F0 1.655(from the list of de\214ned aliases.)4.155 F(If)6.655 E +F14.155 E F0 1.655(is supplied, all alias de\214nitions are)4.155 +F(remo)144 703.2 Q -.15(ve)-.15 G 2.5(d. The).15 F(return v)2.5 E +(alue is true unless a supplied)-.25 E F2(name)2.86 E F0 +(is not a de\214ned alias.)2.68 E(GNU Bash-4.2)72 768 Q(2004 Apr 20) +148.735 E(22)198.725 E 0 Cg EP +%%Page: 23 23 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48 +(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10 +/Times-Bold@0 SF(unset)108 84 Q F0<5bad>2.5 E F1(fv)A F0 2.5(][)C +-2.5 E F1(n)A F0 2.5(][)C/F2 10/Times-Italic@0 SF(name)-2.5 E F0(...]) +2.5 E -.15(Fo)144 96 S 3.827(re).15 G(ach)-3.827 E F2(name)3.827 E F0 +3.827(,r).18 G(emo)-3.827 E 1.627 -.15(ve t)-.15 H 1.327 +(he corresponding v).15 F 1.327(ariable or function.)-.25 F 1.327 +(If the)6.327 F F13.828 E F0 1.328(option is gi)3.828 F -.15(ve) +-.25 G 1.328(n, each).15 F F2(name)144.36 108 Q F0 1.551 +(refers to a shell v)4.231 F 1.551(ariable, and that v)-.25 F 1.551 +(ariable is remo)-.25 F -.15(ve)-.15 G 4.05(d. Read-only).15 F -.25(va) +4.05 G 1.55(riables may not be).25 F 4.641(unset. If)144 120 R F1 +4.641 E F0 2.141(is speci\214ed, each)4.641 F F2(name)5.001 E F0 2.141 +(refers to a shell function, and the function de\214nition is)4.821 F +(remo)144 132 Q -.15(ve)-.15 G 2.538(d. If).15 F(the)2.537 E F1 +2.537 E F0 .037(option is supplied, and)2.537 F F2(name)2.537 E F0 .037 +(is a v)2.537 F .037(ariable with the)-.25 F F2(namer)2.537 E(ef)-.37 E +F0(attrib)2.537 E(ute,)-.2 E F2(name)2.537 E F0(will)2.537 E .492 +(be unset rather than the v)144 144 R .492(ariable it references.)-.25 F +F15.492 E F0 .492(has no ef)2.992 F .492(fect if the)-.25 F F1 +2.992 E F0 .492(option is supplied.)2.992 F .493(If no)5.493 F +.221(options are supplied, each)144 156 R F2(name)2.721 E F0 .221 +(refers to a v)2.721 F .22(ariable; if there is no v)-.25 F .22 +(ariable by that name, an)-.25 F 2.72(yf)-.15 G(unc-)-2.72 E 1.188 +(tion with that name is unset.)144 168 R 1.189(Each unset v)6.189 F +1.189(ariable or function is remo)-.25 F -.15(ve)-.15 G 3.689(df).15 G +1.189(rom the en)-3.689 F(vironment)-.4 E 3.206 +(passed to subsequent commands.)144 180 R 3.206(If an)8.206 F 5.706(yo) +-.15 G(f)-5.706 E/F3 9/Times-Bold@0 SF(COMP_W)5.706 E(ORDBREAKS)-.09 E +/F4 9/Times-Roman@0 SF(,)A F3(RANDOM)5.455 E F4(,)A F3(SECONDS)5.455 E +F4(,)A F3(LINENO)144 192 Q F4(,)A F3(HISTCMD)4.347 E F4(,)A F3(FUNCN) +4.347 E(AME)-.18 E F4(,)A F3(GR)4.347 E(OUPS)-.27 E F4(,)A F0(or)4.348 E +F3(DIRST)4.598 E -.495(AC)-.81 G(K).495 E F0 2.098(are unset, the)4.348 +F 4.598(yl)-.15 G 2.098(ose their special)-4.598 F(properties, e)144 204 +Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(ft)-2.5 G(he)-2.5 E 2.5(ya)-.15 G +(re subsequently reset.)-2.5 E(The e)5 E(xit status is true unless a) +-.15 E F2(name)2.86 E F0(is readonly)2.68 E(.)-.65 E F1(wait)108 220.8 Q +F0([)2.5 E F1A F0 2.5(][)C F2 2.5(n.)-2.5 G(..)-2.5 E F0(])A -.8 +(Wa)144 232.8 S .027(it for each speci\214ed child process and return i\ +ts termination status.).8 F(Each)5.026 E F2(n)2.886 E F0 .026 +(may be a process ID)2.766 F .256 +(or a job speci\214cation; if a job spec is gi)144 244.8 R -.15(ve)-.25 +G .256(n, all processes in that job').15 F 2.756(sp)-.55 G .256 +(ipeline are w)-2.756 F .256(aited for)-.1 F 5.256(.I)-.55 G(f)-5.256 E +F2(n)3.116 E F0 .318(is not gi)144 256.8 R -.15(ve)-.25 G .318 +(n, all currently acti).15 F .618 -.15(ve c)-.25 H .318 +(hild processes are w).15 F .318(aited for)-.1 F 2.818(,a)-.4 G .318 +(nd the return status is zero.)-2.818 F .317(If the)5.317 F F1144 +268.8 Q F0 .361(option is supplied,)2.861 F F1(wait)2.861 E F0 -.1(wa) +2.861 G .361(its for an).1 F 2.862(yj)-.15 G .362 +(ob to terminate and returns its e)-2.862 F .362(xit status.)-.15 F(If) +5.362 E F2(n)3.222 E F0(speci\214es)3.102 E 2.596(an)144 280.8 S(on-e) +-2.596 E .096(xistent process or job, the return status is 127.)-.15 F +.095(Otherwise, the return status is the e)5.095 F .095(xit status)-.15 +F(of the last process or job w)144 292.8 Q(aited for)-.1 E(.)-.55 E/F5 +10.95/Times-Bold@0 SF(SEE ALSO)72 309.6 Q F0(bash\(1\), sh\(1\))108 +321.6 Q(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(23)198.725 E 0 Cg EP +%%Trailer +end +%%EOF diff --git a/doc/fdl.texi b/doc/fdl.texi new file mode 100644 index 0000000..8805f1a --- /dev/null +++ b/doc/fdl.texi @@ -0,0 +1,506 @@ +@c The GNU Free Documentation License. +@center Version 1.3, 3 November 2008 + +@c This file is intended to be included within another document, +@c hence no sectioning command or @node. + +@display +Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. +@uref{http://fsf.org/} + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. +@end display + +@enumerate 0 +@item +PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +functional and useful document @dfn{free} in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. + +This License is a kind of ``copyleft'', which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + +@item +APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The ``Document'', below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as ``you''. You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. + +A ``Modified Version'' of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A ``Secondary Section'' is a named appendix or a front-matter section +of the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The ``Invariant Sections'' are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. + +The ``Cover Texts'' are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. + +A ``Transparent'' copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not ``Transparent'' is called ``Opaque''. + +Examples of suitable formats for Transparent copies include plain +@sc{ascii} without markup, Texinfo input format, La@TeX{} input +format, @acronym{SGML} or @acronym{XML} using a publicly available +@acronym{DTD}, and standard-conforming simple @acronym{HTML}, +PostScript or @acronym{PDF} designed for human modification. Examples +of transparent image formats include @acronym{PNG}, @acronym{XCF} and +@acronym{JPG}. Opaque formats include proprietary formats that can be +read and edited only by proprietary word processors, @acronym{SGML} or +@acronym{XML} for which the @acronym{DTD} and/or processing tools are +not generally available, and the machine-generated @acronym{HTML}, +PostScript or @acronym{PDF} produced by some word processors for +output purposes only. + +The ``Title Page'' means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, ``Title Page'' means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +The ``publisher'' means any person or entity that distributes copies +of the Document to the public. + +A section ``Entitled XYZ'' means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as ``Acknowledgements'', +``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' +of such a section when you modify the Document means that it remains a +section ``Entitled XYZ'' according to this definition. + +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. + +@item +VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + +@item +COPYING IN QUANTITY + +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. + +@item +MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +@enumerate A +@item +Use in the Title Page (and on the covers, if any) a title distinct +from that of the Document, and from those of previous versions +(which should, if there were any, be listed in the History section +of the Document). You may use the same title as a previous version +if the original publisher of that version gives permission. + +@item +List on the Title Page, as authors, one or more persons or entities +responsible for authorship of the modifications in the Modified +Version, together with at least five of the principal authors of the +Document (all of its principal authors, if it has fewer than five), +unless they release you from this requirement. + +@item +State on the Title page the name of the publisher of the +Modified Version, as the publisher. + +@item +Preserve all the copyright notices of the Document. + +@item +Add an appropriate copyright notice for your modifications +adjacent to the other copyright notices. + +@item +Include, immediately after the copyright notices, a license notice +giving the public permission to use the Modified Version under the +terms of this License, in the form shown in the Addendum below. + +@item +Preserve in that license notice the full lists of Invariant Sections +and required Cover Texts given in the Document's license notice. + +@item +Include an unaltered copy of this License. + +@item +Preserve the section Entitled ``History'', Preserve its Title, and add +to it an item stating at least the title, year, new authors, and +publisher of the Modified Version as given on the Title Page. If +there is no section Entitled ``History'' in the Document, create one +stating the title, year, authors, and publisher of the Document as +given on its Title Page, then add an item describing the Modified +Version as stated in the previous sentence. + +@item +Preserve the network location, if any, given in the Document for +public access to a Transparent copy of the Document, and likewise +the network locations given in the Document for previous versions +it was based on. These may be placed in the ``History'' section. +You may omit a network location for a work that was published at +least four years before the Document itself, or if the original +publisher of the version it refers to gives permission. + +@item +For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve +the Title of the section, and preserve in the section all the +substance and tone of each of the contributor acknowledgements and/or +dedications given therein. + +@item +Preserve all the Invariant Sections of the Document, +unaltered in their text and in their titles. Section numbers +or the equivalent are not considered part of the section titles. + +@item +Delete any section Entitled ``Endorsements''. Such a section +may not be included in the Modified Version. + +@item +Do not retitle any existing section to be Entitled ``Endorsements'' or +to conflict in title with any Invariant Section. + +@item +Preserve any Warranty Disclaimers. +@end enumerate + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section Entitled ``Endorsements'', provided it contains +nothing but endorsements of your Modified Version by various +parties---for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + +@item +COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections Entitled ``History'' +in the various original documents, forming one section Entitled +``History''; likewise combine any sections Entitled ``Acknowledgements'', +and any sections Entitled ``Dedications''. You must delete all +sections Entitled ``Endorsements.'' + +@item +COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. + +@item +AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an ``aggregate'' if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. + +@item +TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. + +If a section in the Document is Entitled ``Acknowledgements'', +``Dedications'', or ``History'', the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. + +@item +TERMINATION + +You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. + +@item +FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +@uref{http://www.gnu.org/copyleft/}. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License ``or any later version'' applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy's public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. + +@item +RELICENSING + +``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the +site means any set of copyrightable works thus published on the MMC +site. + +``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. + +``Incorporate'' means to publish or republish a Document, in whole or +in part, as part of another Document. + +An MMC is ``eligible for relicensing'' if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole +or in part into the MMC, (1) had no cover texts or invariant sections, +and (2) were thus incorporated prior to November 1, 2008. + +The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. + +@end enumerate + +@page +@heading ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + +@smallexample +@group + Copyright (C) @var{year} @var{your name}. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. +@end group +@end smallexample + +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the ``with@dots{}Texts.'' line with this: + +@smallexample +@group + with the Invariant Sections being @var{list their titles}, with + the Front-Cover Texts being @var{list}, and with the Back-Cover Texts + being @var{list}. +@end group +@end smallexample + +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. + +@c Local Variables: +@c ispell-local-pdict: "ispell-dict" +@c End: + diff --git a/doc/fdl.txt b/doc/fdl.txt new file mode 100644 index 0000000..2f7e03c --- /dev/null +++ b/doc/fdl.txt @@ -0,0 +1,451 @@ + + GNU Free Documentation License + Version 1.3, 3 November 2008 + + + Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +0. PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +functional and useful document "free" in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. + +This License is a kind of "copyleft", which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + + +1. APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The "Document", below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as "you". You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. + +A "Modified Version" of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A "Secondary Section" is a named appendix or a front-matter section of +the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The "Invariant Sections" are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. + +The "Cover Texts" are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. + +A "Transparent" copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not "Transparent" is called "Opaque". + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input format, SGML +or XML using a publicly available DTD, and standard-conforming simple +HTML, PostScript or PDF designed for human modification. Examples of +transparent image formats include PNG, XCF and JPG. Opaque formats +include proprietary formats that can be read and edited only by +proprietary word processors, SGML or XML for which the DTD and/or +processing tools are not generally available, and the +machine-generated HTML, PostScript or PDF produced by some word +processors for output purposes only. + +The "Title Page" means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, "Title Page" means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +The "publisher" means any person or entity that distributes copies of +the Document to the public. + +A section "Entitled XYZ" means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as "Acknowledgements", +"Dedications", "Endorsements", or "History".) To "Preserve the Title" +of such a section when you modify the Document means that it remains a +section "Entitled XYZ" according to this definition. + +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. + +2. VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no +other conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + + +3. COPYING IN QUANTITY + +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to +give them a chance to provide you with an updated version of the +Document. + + +4. MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +A. Use in the Title Page (and on the covers, if any) a title distinct + from that of the Document, and from those of previous versions + (which should, if there were any, be listed in the History section + of the Document). You may use the same title as a previous version + if the original publisher of that version gives permission. +B. List on the Title Page, as authors, one or more persons or entities + responsible for authorship of the modifications in the Modified + Version, together with at least five of the principal authors of the + Document (all of its principal authors, if it has fewer than five), + unless they release you from this requirement. +C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. +D. Preserve all the copyright notices of the Document. +E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. +F. Include, immediately after the copyright notices, a license notice + giving the public permission to use the Modified Version under the + terms of this License, in the form shown in the Addendum below. +G. Preserve in that license notice the full lists of Invariant Sections + and required Cover Texts given in the Document's license notice. +H. Include an unaltered copy of this License. +I. Preserve the section Entitled "History", Preserve its Title, and add + to it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. If + there is no section Entitled "History" in the Document, create one + stating the title, year, authors, and publisher of the Document as + given on its Title Page, then add an item describing the Modified + Version as stated in the previous sentence. +J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and likewise + the network locations given in the Document for previous versions + it was based on. These may be placed in the "History" section. + You may omit a network location for a work that was published at + least four years before the Document itself, or if the original + publisher of the version it refers to gives permission. +K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section all + the substance and tone of each of the contributor acknowledgements + and/or dedications given therein. +L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. +M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. +N. Do not retitle any existing section to be Entitled "Endorsements" + or to conflict in title with any Invariant Section. +O. Preserve any Warranty Disclaimers. + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section Entitled "Endorsements", provided it contains +nothing but endorsements of your Modified Version by various +parties--for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + + +5. COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections Entitled "History" +in the various original documents, forming one section Entitled +"History"; likewise combine any sections Entitled "Acknowledgements", +and any sections Entitled "Dedications". You must delete all sections +Entitled "Endorsements". + + +6. COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other +documents released under this License, and replace the individual +copies of this License in the various documents with a single copy +that is included in the collection, provided that you follow the rules +of this License for verbatim copying of each of the documents in all +other respects. + +You may extract a single document from such a collection, and +distribute it individually under this License, provided you insert a +copy of this License into the extracted document, and follow this +License in all other respects regarding verbatim copying of that +document. + + +7. AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an "aggregate" if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. + + +8. TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. + +If a section in the Document is Entitled "Acknowledgements", +"Dedications", or "History", the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. + + +9. TERMINATION + +You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. + + +10. FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions of the +GNU Free Documentation License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in +detail to address new problems or concerns. See +http://www.gnu.org/copyleft/. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy's public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. + +11. RELICENSING + +"Massive Multiauthor Collaboration Site" (or "MMC Site") means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +"Massive Multiauthor Collaboration" (or "MMC") contained in the site +means any set of copyrightable works thus published on the MMC site. + +"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. + +"Incorporate" means to publish or republish a Document, in whole or in +part, as part of another Document. + +An MMC is "eligible for relicensing" if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole or +in part into the MMC, (1) had no cover texts or invariant sections, and +(2) were thus incorporated prior to November 1, 2008. + +The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. + + +ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + + Copyright (c) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + A copy of the license is included in the section entitled "GNU + Free Documentation License". + +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. diff --git a/doc/htmlpost.sh b/doc/htmlpost.sh new file mode 100755 index 0000000..51241b1 --- /dev/null +++ b/doc/htmlpost.sh @@ -0,0 +1,19 @@ +#! /bin/sh +# +# Some of these should really be done by man2html +# +# The ~/xxx links don't really work -- netscape doesn't expand the home +# directory of the user running navigator +# + +sed -e 's|gnu.bash.bug|gnu.bash.bug|g' \ + -e 's|/bin/bash|/bin/bash|g' \ + -e 's|/etc/profile|/etc/profile|g' \ + -e 's|~/.bash_profile|~/.bash_profile|g' \ + -e 's|~/.bash_login|~/.bash_login|g' \ + -e 's|~/.profile|~/.profile|g' \ + -e 's|~/.bashrc|~/.bashrc|g' \ + -e 's|~/.bash_logout|~/.bash_logout|g' \ + -e 's|~/.bash_history|~/.bash_history|g' \ + -e 's|~/.inputrc|~/.inputrc|g' \ + -e 's|/etc/inputrc|/etc/inputrc|g' diff --git a/doc/infopost.sh b/doc/infopost.sh new file mode 100755 index 0000000..85c49b4 --- /dev/null +++ b/doc/infopost.sh @@ -0,0 +1,8 @@ +#! /bin/sh +# +# Some of these should really be done by options to makeinfo or by +# using @setfilename, but this way we can have both bashref.info and +# bash.info (for installing) +# + +sed -e 's|bashref.info|bash.info|g' diff --git a/doc/rbash.0 b/doc/rbash.0 new file mode 100644 index 0000000..3ac18d8 --- /dev/null +++ b/doc/rbash.0 @@ -0,0 +1,59 @@ +RBASH(1) RBASH(1) + + + +NNAAMMEE + rbash - restricted bash, see bbaasshh(1) + +RREESSTTRRIICCTTEEDD SSHHEELLLL + If bbaasshh is started with the name rrbbaasshh, or the --rr option is supplied at + invocation, the shell becomes restricted. A restricted shell is used + to set up an environment more controlled than the standard shell. It + behaves identically to bbaasshh with the exception that the following are + disallowed or not performed: + + +o changing directories with ccdd + + +o setting or unsetting the values of SSHHEELLLL, PPAATTHH, EENNVV, or BBAASSHH__EENNVV + + +o specifying command names containing // + + +o specifying a filename containing a // as an argument to the .. + builtin command + + +o specifying a filename containing a slash as an argument to the + --pp option to the hhaasshh builtin command + + +o importing function definitions from the shell environment at + startup + + +o parsing the value of SSHHEELLLLOOPPTTSS from the shell environment at + startup + + +o redirecting output using the >, >|, <>, >&, &>, and >> redirect- + ion operators + + +o using the eexxeecc builtin command to replace the shell with another + command + + +o adding or deleting builtin commands with the --ff and --dd options + to the eennaabbllee builtin command + + +o using the eennaabbllee builtin command to enable disabled shell + builtins + + +o specifying the --pp option to the ccoommmmaanndd builtin command + + +o turning off restricted mode with sseett ++rr or sseett ++oo rreessttrriicctteedd. + + These restrictions are enforced after any startup files are read. + + When a command that is found to be a shell script is executed, rrbbaasshh + turns off any restrictions in the shell spawned to execute the script. + +SSEEEE AALLSSOO + bash(1) + + + +GNU Bash-4.0 2004 Apr 20 RBASH(1) diff --git a/doc/rbash.1 b/doc/rbash.1 new file mode 100644 index 0000000..a25fe11 --- /dev/null +++ b/doc/rbash.1 @@ -0,0 +1,8 @@ +.TH RBASH 1 "2004 Apr 20" "GNU Bash-4.0" +.SH NAME +rbash \- restricted bash, see \fBbash\fR(1) +.SH RESTRICTED SHELL +.nr zY 1 +.so man1/bash.1 +.SH SEE ALSO +bash(1) diff --git a/doc/rbash.ps b/doc/rbash.ps new file mode 100644 index 0000000..6d2a450 --- /dev/null +++ b/doc/rbash.ps @@ -0,0 +1,280 @@ +%!PS-Adobe-3.0 +%%Creator: groff version 1.19.2 +%%CreationDate: Mon Feb 24 08:28:31 2014 +%%DocumentNeededResources: font Times-Roman +%%+ font Times-Bold +%%DocumentSuppliedResources: procset grops 1.19 2 +%%Pages: 1 +%%PageOrder: Ascend +%%DocumentMedia: Default 612 792 0 () () +%%Orientation: Portrait +%%EndComments +%%BeginDefaults +%%PageMedia: Default +%%EndDefaults +%%BeginProlog +%%BeginResource: procset grops 1.19 2 +%!PS-Adobe-3.0 Resource-ProcSet +/setpacking where{ +pop +currentpacking +true setpacking +}if +/grops 120 dict dup begin +/SC 32 def +/A/show load def +/B{0 SC 3 -1 roll widthshow}bind def +/C{0 exch ashow}bind def +/D{0 exch 0 SC 5 2 roll awidthshow}bind def +/E{0 rmoveto show}bind def +/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def +/G{0 rmoveto 0 exch ashow}bind def +/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/I{0 exch rmoveto show}bind def +/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def +/K{0 exch rmoveto 0 exch ashow}bind def +/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/M{rmoveto show}bind def +/N{rmoveto 0 SC 3 -1 roll widthshow}bind def +/O{rmoveto 0 exch ashow}bind def +/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/Q{moveto show}bind def +/R{moveto 0 SC 3 -1 roll widthshow}bind def +/S{moveto 0 exch ashow}bind def +/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def +/SF{ +findfont exch +[exch dup 0 exch 0 exch neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/MF{ +findfont +[5 2 roll +0 3 1 roll +neg 0 0]makefont +dup setfont +[exch/setfont cvx]cvx bind def +}bind def +/level0 0 def +/RES 0 def +/PL 0 def +/LS 0 def +/MANUAL{ +statusdict begin/manualfeed true store end +}bind def +/PLG{ +gsave newpath clippath pathbbox grestore +exch pop add exch pop +}bind def +/BP{ +/level0 save def +1 setlinecap +1 setlinejoin +72 RES div dup scale +LS{ +90 rotate +}{ +0 PL translate +}ifelse +1 -1 scale +}bind def +/EP{ +level0 restore +showpage +}def +/DA{ +newpath arcn stroke +}bind def +/SN{ +transform +.25 sub exch .25 sub exch +round .25 add exch round .25 add exch +itransform +}bind def +/DL{ +SN +moveto +SN +lineto stroke +}bind def +/DC{ +newpath 0 360 arc closepath +}bind def +/TM matrix def +/DE{ +TM currentmatrix pop +translate scale newpath 0 0 .5 0 360 arc closepath +TM setmatrix +}bind def +/RC/rcurveto load def +/RL/rlineto load def +/ST/stroke load def +/MT/moveto load def +/CL/closepath load def +/Fr{ +setrgbcolor fill +}bind def +/setcmykcolor where{ +pop +/Fk{ +setcmykcolor fill +}bind def +}if +/Fg{ +setgray fill +}bind def +/FL/fill load def +/LW/setlinewidth load def +/Cr/setrgbcolor load def +/setcmykcolor where{ +pop +/Ck/setcmykcolor load def +}if +/Cg/setgray load def +/RE{ +findfont +dup maxlength 1 index/FontName known not{1 add}if dict begin +{ +1 index/FID ne{def}{pop pop}ifelse +}forall +/Encoding exch def +dup/FontName exch def +currentdict end definefont pop +}bind def +/DEFS 0 def +/EBEGIN{ +moveto +DEFS begin +}bind def +/EEND/end load def +/CNT 0 def +/level1 0 def +/PBEGIN{ +/level1 save def +translate +div 3 1 roll div exch scale +neg exch neg exch translate +0 setgray +0 setlinecap +1 setlinewidth +0 setlinejoin +10 setmiterlimit +[]0 setdash +/setstrokeadjust where{ +pop +false setstrokeadjust +}if +/setoverprint where{ +pop +false setoverprint +}if +newpath +/CNT countdictstack def +userdict begin +/showpage{}def +/setpagedevice{}def +}bind def +/PEND{ +countdictstack CNT sub{end}repeat +level1 restore +}bind def +end def +/setpacking where{ +pop +setpacking +}if +%%EndResource +%%EndProlog +%%BeginSetup +%%BeginFeature: *PageSize Default +<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice +%%EndFeature +%%IncludeResource: font Times-Roman +%%IncludeResource: font Times-Bold +grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 +def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron +/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent +/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen +/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon +/semicolon/less/equal/greater/question/at/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/bracketleft/backslash/bracketright/circumflex +/underscore/quoteleft/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/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft +/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl +/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut +/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash +/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen +/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft +/logicalnot/minus/registered/macron/degree/plusminus/twosuperior +/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior +/ordmasculine/guilsinglright/onequarter/onehalf/threequarters +/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE +/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex +/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis +/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn +/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla +/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis +/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash +/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def +/Times-Bold@0 ENC0/Times-Bold RE/Times-Roman@0 ENC0/Times-Roman RE +%%EndSetup +%%Page: 1 1 +%%BeginPageSetup +BP +%%EndPageSetup +/F0 10/Times-Roman@0 SF(RB)72 48 Q 376.2(ASH\(1\) RB)-.35 F(ASH\(1\)) +-.35 E/F1 10.95/Times-Bold@0 SF -.219(NA)72 84 S(ME).219 E F0 +(rbash \255 restricted bash, see)108 96 Q/F2 10/Times-Bold@0 SF(bash)2.5 +E F0(\(1\))A F1(RESTRICTED SHELL)72 112.8 Q F0(If)108 124.8 Q F2(bash) +4.397 E F0 1.897(is started with the name)4.397 F F2(rbash)4.397 E F0 +4.397(,o)C 4.397(rt)-4.397 G(he)-4.397 E F24.397 E F0 1.896 +(option is supplied at in)4.397 F -.2(vo)-.4 G 1.896 +(cation, the shell becomes).2 F 3.445(restricted. A)108 136.8 R .945 +(restricted shell is used to set up an en)3.445 F .946 +(vironment more controlled than the standard shell.)-.4 F(It)5.946 E +(beha)108 148.8 Q -.15(ve)-.2 G 2.5(si).15 G(dentically to)-2.5 E F2 +(bash)2.5 E F0(with the e)2.5 E(xception that the follo)-.15 E +(wing are disallo)-.25 E(wed or not performed:)-.25 E 32.5<8363>108 +165.6 S(hanging directories with)-32.5 E F2(cd)2.5 E F0 32.5<8373>108 +182.4 S(etting or unsetting the v)-32.5 E(alues of)-.25 E/F3 9 +/Times-Bold@0 SF(SHELL)2.5 E/F4 9/Times-Roman@0 SF(,)A F3 -.666(PA)2.25 +G(TH)-.189 E F4(,)A F3(ENV)2.25 E F4(,)A F0(or)2.25 E F3 -.27(BA)2.5 G +(SH_ENV).27 E F0 32.5<8373>108 199.2 S +(pecifying command names containing)-32.5 E F2(/)2.5 E F0 32.5<8373>108 +216 S(pecifying a \214lename containing a)-32.5 E F2(/)2.5 E F0 +(as an ar)2.5 E(gument to the)-.18 E F2(.)2.5 E F0 -.2(bu)5 G +(iltin command).2 E 32.5<8373>108 232.8 S .45 +(pecifying a \214lename containing a slash as an ar)-32.5 F .449 +(gument to the)-.18 F F22.949 E F0 .449(option to the)2.949 F F2 +(hash)2.949 E F0 -.2(bu)2.949 G .449(iltin com-).2 F(mand)144 244.8 Q +32.5<8369>108 261.6 S(mporting function de\214nitions from the shell en) +-32.5 E(vironment at startup)-.4 E 32.5<8370>108 278.4 S(arsing the v) +-32.5 E(alue of)-.25 E F3(SHELLOPTS)2.5 E F0(from the shell en)2.25 E +(vironment at startup)-.4 E 32.5<8372>108 295.2 S(edirecting output usi\ +ng the >, >|, <>, >&, &>, and >> redirection operators)-32.5 E 32.5 +<8375>108 312 S(sing the)-32.5 E F2(exec)2.5 E F0 -.2(bu)2.5 G +(iltin command to replace the shell with another command).2 E 32.5<8361> +108 328.8 S(dding or deleting b)-32.5 E(uiltin commands with the)-.2 E +F22.5 E F0(and)2.5 E F22.5 E F0(options to the)2.5 E F2 +(enable)2.5 E F0 -.2(bu)2.5 G(iltin command).2 E 32.5<8375>108 345.6 S +(sing the)-32.5 E F2(enable)2.5 E F0 -.2(bu)2.5 G +(iltin command to enable disabled shell b).2 E(uiltins)-.2 E 32.5<8373> +108 362.4 S(pecifying the)-32.5 E F22.5 E F0(option to the)2.5 E +F2(command)2.5 E F0 -.2(bu)2.5 G(iltin command).2 E 32.5<8374>108 379.2 +S(urning of)-32.5 E 2.5(fr)-.25 G(estricted mode with)-2.5 E F2(set +r) +2.5 E F0(or)2.5 E F2(set +o r)2.5 E(estricted)-.18 E F0(.)A +(These restrictions are enforced after an)108 396 Q 2.5(ys)-.15 G +(tartup \214les are read.)-2.5 E .429 +(When a command that is found to be a shell script is e)108 412.8 R -.15 +(xe)-.15 G(cuted,).15 E F2(rbash)2.929 E F0 .429(turns of)2.929 F 2.929 +(fa)-.25 G .729 -.15(ny r)-2.929 H .429(estrictions in the shell).15 F +(spa)108 424.8 Q(wned to e)-.15 E -.15(xe)-.15 G(cute the script.).15 E +F1(SEE ALSO)72 441.6 Q F0(bash\(1\))108 453.6 Q(GNU Bash-4.0)72 768 Q +(2004 Apr 20)148.735 E(1)203.725 E 0 Cg EP +%%Trailer +end +%%EOF diff --git a/doc/texinfo.tex b/doc/texinfo.tex new file mode 100644 index 0000000..bfd765d --- /dev/null +++ b/doc/texinfo.tex @@ -0,0 +1,10145 @@ +% texinfo.tex -- TeX macros to handle Texinfo files. +% +% Load plain if necessary, i.e., if running under initex. +\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi +% +\def\texinfoversion{2013-09-11.11} +% +% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, +% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, +% 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. +% +% This texinfo.tex file is free software: you can redistribute it and/or +% modify it under the terms of the GNU General Public License as +% published by the Free Software Foundation, either version 3 of the +% License, or (at your option) any later version. +% +% This texinfo.tex file is distributed in the hope that it will be +% useful, but WITHOUT ANY WARRANTY; without even the implied warranty +% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see . +% +% As a special exception, when this file is read by TeX when processing +% a Texinfo source document, you may use the result without +% restriction. This Exception is an additional permission under section 7 +% of the GNU General Public License, version 3 ("GPLv3"). +% +% Please try the latest version of texinfo.tex before submitting bug +% reports; you can get the latest version from: +% http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or +% http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or +% http://www.gnu.org/software/texinfo/ (the Texinfo home page) +% The texinfo.tex in any given distribution could well be out +% of date, so if that's what you're using, please check. +% +% Send bug reports to bug-texinfo@gnu.org. Please include including a +% complete document in each bug report with which we can reproduce the +% problem. Patches are, of course, greatly appreciated. +% +% To process a Texinfo manual with TeX, it's most reliable to use the +% texi2dvi shell script that comes with the distribution. For a simple +% manual foo.texi, however, you can get away with this: +% tex foo.texi +% texindex foo.?? +% tex foo.texi +% tex foo.texi +% dvips foo.dvi -o # or whatever; this makes foo.ps. +% The extra TeX runs get the cross-reference information correct. +% Sometimes one run after texindex suffices, and sometimes you need more +% than two; texi2dvi does it as many times as necessary. +% +% It is possible to adapt texinfo.tex for other languages, to some +% extent. You can get the existing language-specific files from the +% full Texinfo distribution. +% +% The GNU Texinfo home page is http://www.gnu.org/software/texinfo. + + +\message{Loading texinfo [version \texinfoversion]:} + +% If in a .fmt file, print the version number +% and turn on active characters that we couldn't do earlier because +% they might have appeared in the input file name. +\everyjob{\message{[Texinfo version \texinfoversion]}% + \catcode`+=\active \catcode`\_=\active} + +\chardef\other=12 + +% We never want plain's \outer definition of \+ in Texinfo. +% For @tex, we can use \tabalign. +\let\+ = \relax + +% Save some plain tex macros whose names we will redefine. +\let\ptexb=\b +\let\ptexbullet=\bullet +\let\ptexc=\c +\let\ptexcomma=\, +\let\ptexdot=\. +\let\ptexdots=\dots +\let\ptexend=\end +\let\ptexequiv=\equiv +\let\ptexexclam=\! +\let\ptexfootnote=\footnote +\let\ptexgtr=> +\let\ptexhat=^ +\let\ptexi=\i +\let\ptexindent=\indent +\let\ptexinsert=\insert +\let\ptexlbrace=\{ +\let\ptexless=< +\let\ptexnewwrite\newwrite +\let\ptexnoindent=\noindent +\let\ptexplus=+ +\let\ptexraggedright=\raggedright +\let\ptexrbrace=\} +\let\ptexslash=\/ +\let\ptexstar=\* +\let\ptext=\t +\let\ptextop=\top +{\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode + +% If this character appears in an error message or help string, it +% starts a new line in the output. +\newlinechar = `^^J + +% Use TeX 3.0's \inputlineno to get the line number, for better error +% messages, but if we're using an old version of TeX, don't do anything. +% +\ifx\inputlineno\thisisundefined + \let\linenumber = \empty % Pre-3.0. +\else + \def\linenumber{l.\the\inputlineno:\space} +\fi + +% Set up fixed words for English if not already set. +\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi +\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi +\ifx\putworderror\undefined \gdef\putworderror{error}\fi +\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi +\ifx\putwordin\undefined \gdef\putwordin{in}\fi +\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi +\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi +\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi +\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi +\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi +\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi +\ifx\putwordof\undefined \gdef\putwordof{of}\fi +\ifx\putwordon\undefined \gdef\putwordon{on}\fi +\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi +\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi +\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi +\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi +\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi +\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi +\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi +% +\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi +\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi +\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi +\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi +\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi +\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi +\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi +\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi +\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi +\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi +\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi +\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi +% +\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi +\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi +\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi +\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi +\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi + +% Since the category of space is not known, we have to be careful. +\chardef\spacecat = 10 +\def\spaceisspace{\catcode`\ =\spacecat} + +% sometimes characters are active, so we need control sequences. +\chardef\ampChar = `\& +\chardef\colonChar = `\: +\chardef\commaChar = `\, +\chardef\dashChar = `\- +\chardef\dotChar = `\. +\chardef\exclamChar= `\! +\chardef\hashChar = `\# +\chardef\lquoteChar= `\` +\chardef\questChar = `\? +\chardef\rquoteChar= `\' +\chardef\semiChar = `\; +\chardef\slashChar = `\/ +\chardef\underChar = `\_ + +% Ignore a token. +% +\def\gobble#1{} + +% The following is used inside several \edef's. +\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} + +% Hyphenation fixes. +\hyphenation{ + Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script + ap-pen-dix bit-map bit-maps + data-base data-bases eshell fall-ing half-way long-est man-u-script + man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm + par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces + spell-ing spell-ings + stand-alone strong-est time-stamp time-stamps which-ever white-space + wide-spread wrap-around +} + +% Margin to add to right of even pages, to left of odd pages. +\newdimen\bindingoffset +\newdimen\normaloffset +\newdimen\pagewidth \newdimen\pageheight + +% For a final copy, take out the rectangles +% that mark overfull boxes (in case you have decided +% that the text looks ok even though it passes the margin). +% +\def\finalout{\overfullrule=0pt } + +% Sometimes it is convenient to have everything in the transcript file +% and nothing on the terminal. We don't just call \tracingall here, +% since that produces some useless output on the terminal. We also make +% some effort to order the tracing commands to reduce output in the log +% file; cf. trace.sty in LaTeX. +% +\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% +\def\loggingall{% + \tracingstats2 + \tracingpages1 + \tracinglostchars2 % 2 gives us more in etex + \tracingparagraphs1 + \tracingoutput1 + \tracingmacros2 + \tracingrestores1 + \showboxbreadth\maxdimen \showboxdepth\maxdimen + \ifx\eTeXversion\thisisundefined\else % etex gives us more logging + \tracingscantokens1 + \tracingifs1 + \tracinggroups1 + \tracingnesting2 + \tracingassigns1 + \fi + \tracingcommands3 % 3 gives us more in etex + \errorcontextlines16 +}% + +% @errormsg{MSG}. Do the index-like expansions on MSG, but if things +% aren't perfect, it's not the end of the world, being an error message, +% after all. +% +\def\errormsg{\begingroup \indexnofonts \doerrormsg} +\def\doerrormsg#1{\errmessage{#1}} + +% add check for \lastpenalty to plain's definitions. If the last thing +% we did was a \nobreak, we don't want to insert more space. +% +\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount + \removelastskip\penalty-50\smallskip\fi\fi} +\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount + \removelastskip\penalty-100\medskip\fi\fi} +\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount + \removelastskip\penalty-200\bigskip\fi\fi} + +% Do @cropmarks to get crop marks. +% +\newif\ifcropmarks +\let\cropmarks = \cropmarkstrue +% +% Dimensions to add cropmarks at corners. +% Added by P. A. MacKay, 12 Nov. 1986 +% +\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines +\newdimen\cornerlong \cornerlong=1pc +\newdimen\cornerthick \cornerthick=.3pt +\newdimen\topandbottommargin \topandbottommargin=.75in + +% Output a mark which sets \thischapter, \thissection and \thiscolor. +% We dump everything together because we only have one kind of mark. +% This works because we only use \botmark / \topmark, not \firstmark. +% +% A mark contains a subexpression of the \ifcase ... \fi construct. +% \get*marks macros below extract the needed part using \ifcase. +% +% Another complication is to let the user choose whether \thischapter +% (\thissection) refers to the chapter (section) in effect at the top +% of a page, or that at the bottom of a page. The solution is +% described on page 260 of The TeXbook. It involves outputting two +% marks for the sectioning macros, one before the section break, and +% one after. I won't pretend I can describe this better than DEK... +\def\domark{% + \toks0=\expandafter{\lastchapterdefs}% + \toks2=\expandafter{\lastsectiondefs}% + \toks4=\expandafter{\prevchapterdefs}% + \toks6=\expandafter{\prevsectiondefs}% + \toks8=\expandafter{\lastcolordefs}% + \mark{% + \the\toks0 \the\toks2 % 0: top marks (\last...) + \noexpand\or \the\toks4 \the\toks6 % 1: bottom marks (default, \prev...) + \noexpand\else \the\toks8 % 2: color marks + }% +} +% \topmark doesn't work for the very first chapter (after the title +% page or the contents), so we use \firstmark there -- this gets us +% the mark with the chapter defs, unless the user sneaks in, e.g., +% @setcolor (or @url, or @link, etc.) between @contents and the very +% first @chapter. +\def\gettopheadingmarks{% + \ifcase0\topmark\fi + \ifx\thischapter\empty \ifcase0\firstmark\fi \fi +} +\def\getbottomheadingmarks{\ifcase1\botmark\fi} +\def\getcolormarks{\ifcase2\topmark\fi} + +% Avoid "undefined control sequence" errors. +\def\lastchapterdefs{} +\def\lastsectiondefs{} +\def\prevchapterdefs{} +\def\prevsectiondefs{} +\def\lastcolordefs{} + +% Main output routine. +\chardef\PAGE = 255 +\output = {\onepageout{\pagecontents\PAGE}} + +\newbox\headlinebox +\newbox\footlinebox + +% \onepageout takes a vbox as an argument. Note that \pagecontents +% does insertions, but you have to call it yourself. +\def\onepageout#1{% + \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi + % + \ifodd\pageno \advance\hoffset by \bindingoffset + \else \advance\hoffset by -\bindingoffset\fi + % + % Do this outside of the \shipout so @code etc. will be expanded in + % the headline as they should be, not taken literally (outputting ''code). + \def\commmonheadfootline{\let\hsize=\pagewidth \texinfochars} + % + \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi + \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}% + % + \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi + \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}% + % + {% + % Have to do this stuff outside the \shipout because we want it to + % take effect in \write's, yet the group defined by the \vbox ends + % before the \shipout runs. + % + \indexdummies % don't expand commands in the output. + \normalturnoffactive % \ in index entries must not stay \, e.g., if + % the page break happens to be in the middle of an example. + % We don't want .vr (or whatever) entries like this: + % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} + % "\acronym" won't work when it's read back in; + % it needs to be + % {\code {{\tt \backslashcurfont }acronym} + \shipout\vbox{% + % Do this early so pdf references go to the beginning of the page. + \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi + % + \ifcropmarks \vbox to \outervsize\bgroup + \hsize = \outerhsize + \vskip-\topandbottommargin + \vtop to0pt{% + \line{\ewtop\hfil\ewtop}% + \nointerlineskip + \line{% + \vbox{\moveleft\cornerthick\nstop}% + \hfill + \vbox{\moveright\cornerthick\nstop}% + }% + \vss}% + \vskip\topandbottommargin + \line\bgroup + \hfil % center the page within the outer (page) hsize. + \ifodd\pageno\hskip\bindingoffset\fi + \vbox\bgroup + \fi + % + \unvbox\headlinebox + \pagebody{#1}% + \ifdim\ht\footlinebox > 0pt + % Only leave this space if the footline is nonempty. + % (We lessened \vsize for it in \oddfootingyyy.) + % The \baselineskip=24pt in plain's \makefootline has no effect. + \vskip 24pt + \unvbox\footlinebox + \fi + % + \ifcropmarks + \egroup % end of \vbox\bgroup + \hfil\egroup % end of (centering) \line\bgroup + \vskip\topandbottommargin plus1fill minus1fill + \boxmaxdepth = \cornerthick + \vbox to0pt{\vss + \line{% + \vbox{\moveleft\cornerthick\nsbot}% + \hfill + \vbox{\moveright\cornerthick\nsbot}% + }% + \nointerlineskip + \line{\ewbot\hfil\ewbot}% + }% + \egroup % \vbox from first cropmarks clause + \fi + }% end of \shipout\vbox + }% end of group with \indexdummies + \advancepageno + \ifnum\outputpenalty>-20000 \else\dosupereject\fi +} + +\newinsert\margin \dimen\margin=\maxdimen + +\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} +{\catcode`\@ =11 +\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi +% marginal hacks, juha@viisa.uucp (Juha Takala) +\ifvoid\margin\else % marginal info is present + \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi +\dimen@=\dp#1\relax \unvbox#1\relax +\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi +\ifr@ggedbottom \kern-\dimen@ \vfil \fi} +} + +% Here are the rules for the cropmarks. Note that they are +% offset so that the space between them is truly \outerhsize or \outervsize +% (P. A. MacKay, 12 November, 1986) +% +\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} +\def\nstop{\vbox + {\hrule height\cornerthick depth\cornerlong width\cornerthick}} +\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} +\def\nsbot{\vbox + {\hrule height\cornerlong depth\cornerthick width\cornerthick}} + +% Parse an argument, then pass it to #1. The argument is the rest of +% the input line (except we remove a trailing comment). #1 should be a +% macro which expects an ordinary undelimited TeX argument. +% +\def\parsearg{\parseargusing{}} +\def\parseargusing#1#2{% + \def\argtorun{#2}% + \begingroup + \obeylines + \spaceisspace + #1% + \parseargline\empty% Insert the \empty token, see \finishparsearg below. +} + +{\obeylines % + \gdef\parseargline#1^^M{% + \endgroup % End of the group started in \parsearg. + \argremovecomment #1\comment\ArgTerm% + }% +} + +% First remove any @comment, then any @c comment. +\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} +\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} + +% Each occurrence of `\^^M' or `\^^M' is replaced by a single space. +% +% \argremovec might leave us with trailing space, e.g., +% @end itemize @c foo +% This space token undergoes the same procedure and is eventually removed +% by \finishparsearg. +% +\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} +\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} +\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% + \def\temp{#3}% + \ifx\temp\empty + % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: + \let\temp\finishparsearg + \else + \let\temp\argcheckspaces + \fi + % Put the space token in: + \temp#1 #3\ArgTerm +} + +% If a _delimited_ argument is enclosed in braces, they get stripped; so +% to get _exactly_ the rest of the line, we had to prevent such situation. +% We prepended an \empty token at the very beginning and we expand it now, +% just before passing the control to \argtorun. +% (Similarly, we have to think about #3 of \argcheckspacesY above: it is +% either the null string, or it ends with \^^M---thus there is no danger +% that a pair of braces would be stripped. +% +% But first, we have to remove the trailing space token. +% +\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} + +% \parseargdef\foo{...} +% is roughly equivalent to +% \def\foo{\parsearg\Xfoo} +% \def\Xfoo#1{...} +% +% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my +% favourite TeX trick. --kasal, 16nov03 + +\def\parseargdef#1{% + \expandafter \doparseargdef \csname\string#1\endcsname #1% +} +\def\doparseargdef#1#2{% + \def#2{\parsearg#1}% + \def#1##1% +} + +% Several utility definitions with active space: +{ + \obeyspaces + \gdef\obeyedspace{ } + + % Make each space character in the input produce a normal interword + % space in the output. Don't allow a line break at this space, as this + % is used only in environments like @example, where each line of input + % should produce a line of output anyway. + % + \gdef\sepspaces{\obeyspaces\let =\tie} + + % If an index command is used in an @example environment, any spaces + % therein should become regular spaces in the raw index file, not the + % expansion of \tie (\leavevmode \penalty \@M \ ). + \gdef\unsepspaces{\let =\space} +} + + +\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} + +% Define the framework for environments in texinfo.tex. It's used like this: +% +% \envdef\foo{...} +% \def\Efoo{...} +% +% It's the responsibility of \envdef to insert \begingroup before the +% actual body; @end closes the group after calling \Efoo. \envdef also +% defines \thisenv, so the current environment is known; @end checks +% whether the environment name matches. The \checkenv macro can also be +% used to check whether the current environment is the one expected. +% +% Non-false conditionals (@iftex, @ifset) don't fit into this, so they +% are not treated as environments; they don't open a group. (The +% implementation of @end takes care not to call \endgroup in this +% special case.) + + +% At run-time, environments start with this: +\def\startenvironment#1{\begingroup\def\thisenv{#1}} +% initialize +\let\thisenv\empty + +% ... but they get defined via ``\envdef\foo{...}'': +\long\def\envdef#1#2{\def#1{\startenvironment#1#2}} +\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} + +% Check whether we're in the right environment: +\def\checkenv#1{% + \def\temp{#1}% + \ifx\thisenv\temp + \else + \badenverr + \fi +} + +% Environment mismatch, #1 expected: +\def\badenverr{% + \errhelp = \EMsimple + \errmessage{This command can appear only \inenvironment\temp, + not \inenvironment\thisenv}% +} +\def\inenvironment#1{% + \ifx#1\empty + outside of any environment% + \else + in environment \expandafter\string#1% + \fi +} + +% @end foo executes the definition of \Efoo. +% But first, it executes a specialized version of \checkenv +% +\parseargdef\end{% + \if 1\csname iscond.#1\endcsname + \else + % The general wording of \badenverr may not be ideal. + \expandafter\checkenv\csname#1\endcsname + \csname E#1\endcsname + \endgroup + \fi +} + +\newhelp\EMsimple{Press RETURN to continue.} + + +% Be sure we're in horizontal mode when doing a tie, since we make space +% equivalent to this in @example-like environments. Otherwise, a space +% at the beginning of a line will start with \penalty -- and +% since \penalty is valid in vertical mode, we'd end up putting the +% penalty on the vertical list instead of in the new paragraph. +{\catcode`@ = 11 + % Avoid using \@M directly, because that causes trouble + % if the definition is written into an index file. + \global\let\tiepenalty = \@M + \gdef\tie{\leavevmode\penalty\tiepenalty\ } +} + +% @: forces normal size whitespace following. +\def\:{\spacefactor=1000 } + +% @* forces a line break. +\def\*{\unskip\hfil\break\hbox{}\ignorespaces} + +% @/ allows a line break. +\let\/=\allowbreak + +% @. is an end-of-sentence period. +\def\.{.\spacefactor=\endofsentencespacefactor\space} + +% @! is an end-of-sentence bang. +\def\!{!\spacefactor=\endofsentencespacefactor\space} + +% @? is an end-of-sentence query. +\def\?{?\spacefactor=\endofsentencespacefactor\space} + +% @frenchspacing on|off says whether to put extra space after punctuation. +% +\def\onword{on} +\def\offword{off} +% +\parseargdef\frenchspacing{% + \def\temp{#1}% + \ifx\temp\onword \plainfrenchspacing + \else\ifx\temp\offword \plainnonfrenchspacing + \else + \errhelp = \EMsimple + \errmessage{Unknown @frenchspacing option `\temp', must be on|off}% + \fi\fi +} + +% @w prevents a word break. Without the \leavevmode, @w at the +% beginning of a paragraph, when TeX is still in vertical mode, would +% produce a whole line of output instead of starting the paragraph. +\def\w#1{\leavevmode\hbox{#1}} + +% @group ... @end group forces ... to be all on one page, by enclosing +% it in a TeX vbox. We use \vtop instead of \vbox to construct the box +% to keep its height that of a normal line. According to the rules for +% \topskip (p.114 of the TeXbook), the glue inserted is +% max (\topskip - \ht (first item), 0). If that height is large, +% therefore, no glue is inserted, and the space between the headline and +% the text is small, which looks bad. +% +% Another complication is that the group might be very large. This can +% cause the glue on the previous page to be unduly stretched, because it +% does not have much material. In this case, it's better to add an +% explicit \vfill so that the extra space is at the bottom. The +% threshold for doing this is if the group is more than \vfilllimit +% percent of a page (\vfilllimit can be changed inside of @tex). +% +\newbox\groupbox +\def\vfilllimit{0.7} +% +\envdef\group{% + \ifnum\catcode`\^^M=\active \else + \errhelp = \groupinvalidhelp + \errmessage{@group invalid in context where filling is enabled}% + \fi + \startsavinginserts + % + \setbox\groupbox = \vtop\bgroup + % Do @comment since we are called inside an environment such as + % @example, where each end-of-line in the input causes an + % end-of-line in the output. We don't want the end-of-line after + % the `@group' to put extra space in the output. Since @group + % should appear on a line by itself (according to the Texinfo + % manual), we don't worry about eating any user text. + \comment +} +% +% The \vtop produces a box with normal height and large depth; thus, TeX puts +% \baselineskip glue before it, and (when the next line of text is done) +% \lineskip glue after it. Thus, space below is not quite equal to space +% above. But it's pretty close. +\def\Egroup{% + % To get correct interline space between the last line of the group + % and the first line afterwards, we have to propagate \prevdepth. + \endgraf % Not \par, as it may have been set to \lisppar. + \global\dimen1 = \prevdepth + \egroup % End the \vtop. + % \dimen0 is the vertical size of the group's box. + \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox + % \dimen2 is how much space is left on the page (more or less). + \dimen2 = \pageheight \advance\dimen2 by -\pagetotal + % if the group doesn't fit on the current page, and it's a big big + % group, force a page break. + \ifdim \dimen0 > \dimen2 + \ifdim \pagetotal < \vfilllimit\pageheight + \page + \fi + \fi + \box\groupbox + \prevdepth = \dimen1 + \checkinserts +} +% +% TeX puts in an \escapechar (i.e., `@') at the beginning of the help +% message, so this ends up printing `@group can only ...'. +% +\newhelp\groupinvalidhelp{% +group can only be used in environments such as @example,^^J% +where each line of input produces a line of output.} + +% @need space-in-mils +% forces a page break if there is not space-in-mils remaining. + +\newdimen\mil \mil=0.001in + +\parseargdef\need{% + % Ensure vertical mode, so we don't make a big box in the middle of a + % paragraph. + \par + % + % If the @need value is less than one line space, it's useless. + \dimen0 = #1\mil + \dimen2 = \ht\strutbox + \advance\dimen2 by \dp\strutbox + \ifdim\dimen0 > \dimen2 + % + % Do a \strut just to make the height of this box be normal, so the + % normal leading is inserted relative to the preceding line. + % And a page break here is fine. + \vtop to #1\mil{\strut\vfil}% + % + % TeX does not even consider page breaks if a penalty added to the + % main vertical list is 10000 or more. But in order to see if the + % empty box we just added fits on the page, we must make it consider + % page breaks. On the other hand, we don't want to actually break the + % page after the empty box. So we use a penalty of 9999. + % + % There is an extremely small chance that TeX will actually break the + % page at this \penalty, if there are no other feasible breakpoints in + % sight. (If the user is using lots of big @group commands, which + % almost-but-not-quite fill up a page, TeX will have a hard time doing + % good page breaking, for example.) However, I could not construct an + % example where a page broke at this \penalty; if it happens in a real + % document, then we can reconsider our strategy. + \penalty9999 + % + % Back up by the size of the box, whether we did a page break or not. + \kern -#1\mil + % + % Do not allow a page break right after this kern. + \nobreak + \fi +} + +% @br forces paragraph break (and is undocumented). + +\let\br = \par + +% @page forces the start of a new page. +% +\def\page{\par\vfill\supereject} + +% @exdent text.... +% outputs text on separate line in roman font, starting at standard page margin + +% This records the amount of indent in the innermost environment. +% That's how much \exdent should take out. +\newskip\exdentamount + +% This defn is used inside fill environments such as @defun. +\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} + +% This defn is used inside nofill environments such as @example. +\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount + \leftline{\hskip\leftskip{\rm#1}}}} + +% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current +% paragraph. For more general purposes, use the \margin insertion +% class. WHICH is `l' or `r'. Not documented, written for gawk manual. +% +\newskip\inmarginspacing \inmarginspacing=1cm +\def\strutdepth{\dp\strutbox} +% +\def\doinmargin#1#2{\strut\vadjust{% + \nobreak + \kern-\strutdepth + \vtop to \strutdepth{% + \baselineskip=\strutdepth + \vss + % if you have multiple lines of stuff to put here, you'll need to + % make the vbox yourself of the appropriate size. + \ifx#1l% + \llap{\ignorespaces #2\hskip\inmarginspacing}% + \else + \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% + \fi + \null + }% +}} +\def\inleftmargin{\doinmargin l} +\def\inrightmargin{\doinmargin r} +% +% @inmargin{TEXT [, RIGHT-TEXT]} +% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; +% else use TEXT for both). +% +\def\inmargin#1{\parseinmargin #1,,\finish} +\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \def\lefttext{#1}% have both texts + \def\righttext{#2}% + \else + \def\lefttext{#1}% have only one text + \def\righttext{#1}% + \fi + % + \ifodd\pageno + \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin + \else + \def\temp{\inleftmargin\lefttext}% + \fi + \temp +} + +% @| inserts a changebar to the left of the current line. It should +% surround any changed text. This approach does *not* work if the +% change spans more than two lines of output. To handle that, we would +% have adopt a much more difficult approach (putting marks into the main +% vertical list for the beginning and end of each change). This command +% is not documented, not supported, and doesn't work. +% +\def\|{% + % \vadjust can only be used in horizontal mode. + \leavevmode + % + % Append this vertical mode material after the current line in the output. + \vadjust{% + % We want to insert a rule with the height and depth of the current + % leading; that is exactly what \strutbox is supposed to record. + \vskip-\baselineskip + % + % \vadjust-items are inserted at the left edge of the type. So + % the \llap here moves out into the left-hand margin. + \llap{% + % + % For a thicker or thinner bar, change the `1pt'. + \vrule height\baselineskip width1pt + % + % This is the space between the bar and the text. + \hskip 12pt + }% + }% +} + +% @include FILE -- \input text of FILE. +% +\def\include{\parseargusing\filenamecatcodes\includezzz} +\def\includezzz#1{% + \pushthisfilestack + \def\thisfile{#1}% + {% + \makevalueexpandable % we want to expand any @value in FILE. + \turnoffactive % and allow special characters in the expansion + \indexnofonts % Allow `@@' and other weird things in file names. + \wlog{texinfo.tex: doing @include of #1^^J}% + \edef\temp{\noexpand\input #1 }% + % + % This trickery is to read FILE outside of a group, in case it makes + % definitions, etc. + \expandafter + }\temp + \popthisfilestack +} +\def\filenamecatcodes{% + \catcode`\\=\other + \catcode`~=\other + \catcode`^=\other + \catcode`_=\other + \catcode`|=\other + \catcode`<=\other + \catcode`>=\other + \catcode`+=\other + \catcode`-=\other + \catcode`\`=\other + \catcode`\'=\other +} + +\def\pushthisfilestack{% + \expandafter\pushthisfilestackX\popthisfilestack\StackTerm +} +\def\pushthisfilestackX{% + \expandafter\pushthisfilestackY\thisfile\StackTerm +} +\def\pushthisfilestackY #1\StackTerm #2\StackTerm {% + \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% +} + +\def\popthisfilestack{\errthisfilestackempty} +\def\errthisfilestackempty{\errmessage{Internal error: + the stack of filenames is empty.}} +% +\def\thisfile{} + +% @center line +% outputs that line, centered. +% +\parseargdef\center{% + \ifhmode + \let\centersub\centerH + \else + \let\centersub\centerV + \fi + \centersub{\hfil \ignorespaces#1\unskip \hfil}% + \let\centersub\relax % don't let the definition persist, just in case +} +\def\centerH#1{{% + \hfil\break + \advance\hsize by -\leftskip + \advance\hsize by -\rightskip + \line{#1}% + \break +}} +% +\newcount\centerpenalty +\def\centerV#1{% + % The idea here is the same as in \startdefun, \cartouche, etc.: if + % @center is the first thing after a section heading, we need to wipe + % out the negative parskip inserted by \sectionheading, but still + % prevent a page break here. + \centerpenalty = \lastpenalty + \ifnum\centerpenalty>10000 \vskip\parskip \fi + \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi + \line{\kern\leftskip #1\kern\rightskip}% +} + +% @sp n outputs n lines of vertical space +% +\parseargdef\sp{\vskip #1\baselineskip} + +% @comment ...line which is ignored... +% @c is the same as @comment +% @ignore ... @end ignore is another way to write a comment +% +\def\comment{\begingroup \catcode`\^^M=\other% +\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% +\commentxxx} +{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} +% +\let\c=\comment + +% @paragraphindent NCHARS +% We'll use ems for NCHARS, close enough. +% NCHARS can also be the word `asis' or `none'. +% We cannot feasibly implement @paragraphindent asis, though. +% +\def\asisword{asis} % no translation, these are keywords +\def\noneword{none} +% +\parseargdef\paragraphindent{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \defaultparindent = 0pt + \else + \defaultparindent = #1em + \fi + \fi + \parindent = \defaultparindent +} + +% @exampleindent NCHARS +% We'll use ems for NCHARS like @paragraphindent. +% It seems @exampleindent asis isn't necessary, but +% I preserve it to make it similar to @paragraphindent. +\parseargdef\exampleindent{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \lispnarrowing = 0pt + \else + \lispnarrowing = #1em + \fi + \fi +} + +% @firstparagraphindent WORD +% If WORD is `none', then suppress indentation of the first paragraph +% after a section heading. If WORD is `insert', then do indent at such +% paragraphs. +% +% The paragraph indentation is suppressed or not by calling +% \suppressfirstparagraphindent, which the sectioning commands do. +% We switch the definition of this back and forth according to WORD. +% By default, we suppress indentation. +% +\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} +\def\insertword{insert} +% +\parseargdef\firstparagraphindent{% + \def\temp{#1}% + \ifx\temp\noneword + \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent + \else\ifx\temp\insertword + \let\suppressfirstparagraphindent = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @firstparagraphindent option `\temp'}% + \fi\fi +} + +% Here is how we actually suppress indentation. Redefine \everypar to +% \kern backwards by \parindent, and then reset itself to empty. +% +% We also make \indent itself not actually do anything until the next +% paragraph. +% +\gdef\dosuppressfirstparagraphindent{% + \gdef\indent{% + \restorefirstparagraphindent + \indent + }% + \gdef\noindent{% + \restorefirstparagraphindent + \noindent + }% + \global\everypar = {% + \kern -\parindent + \restorefirstparagraphindent + }% +} + +\gdef\restorefirstparagraphindent{% + \global \let \indent = \ptexindent + \global \let \noindent = \ptexnoindent + \global \everypar = {}% +} + + +% @refill is a no-op. +\let\refill=\relax + +% If working on a large document in chapters, it is convenient to +% be able to disable indexing, cross-referencing, and contents, for test runs. +% This is done with @novalidate (before @setfilename). +% +\newif\iflinks \linkstrue % by default we want the aux files. +\let\novalidate = \linksfalse + +% @setfilename is done at the beginning of every texinfo file. +% So open here the files we need to have open while reading the input. +% This makes it possible to make a .fmt file for texinfo. +\def\setfilename{% + \fixbackslash % Turn off hack to swallow `\input texinfo'. + \iflinks + \tryauxfile + % Open the new aux file. TeX will close it automatically at exit. + \immediate\openout\auxfile=\jobname.aux + \fi % \openindices needs to do some work in any case. + \openindices + \let\setfilename=\comment % Ignore extra @setfilename cmds. + % + % If texinfo.cnf is present on the system, read it. + % Useful for site-wide @afourpaper, etc. + \openin 1 texinfo.cnf + \ifeof 1 \else \input texinfo.cnf \fi + \closein 1 + % + \comment % Ignore the actual filename. +} + +% Called from \setfilename. +% +\def\openindices{% + \newindex{cp}% + \newcodeindex{fn}% + \newcodeindex{vr}% + \newcodeindex{tp}% + \newcodeindex{ky}% + \newcodeindex{pg}% +} + +% @bye. +\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} + + +\message{pdf,} +% adobe `portable' document format +\newcount\tempnum +\newcount\lnkcount +\newtoks\filename +\newcount\filenamelength +\newcount\pgn +\newtoks\toksA +\newtoks\toksB +\newtoks\toksC +\newtoks\toksD +\newbox\boxA +\newcount\countA +\newif\ifpdf +\newif\ifpdfmakepagedest + +% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 +% can be set). So we test for \relax and 0 as well as being undefined. +\ifx\pdfoutput\thisisundefined +\else + \ifx\pdfoutput\relax + \else + \ifcase\pdfoutput + \else + \pdftrue + \fi + \fi +\fi + +% PDF uses PostScript string constants for the names of xref targets, +% for display in the outlines, and in other places. Thus, we have to +% double any backslashes. Otherwise, a name like "\node" will be +% interpreted as a newline (\n), followed by o, d, e. Not good. +% +% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and +% related messages. The final outcome is that it is up to the TeX user +% to double the backslashes and otherwise make the string valid, so +% that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to +% do this reliably, so we use it. + +% #1 is a control sequence in which to do the replacements, +% which we \xdef. +\def\txiescapepdf#1{% + \ifx\pdfescapestring\thisisundefined + % No primitive available; should we give a warning or log? + % Many times it won't matter. + \else + % The expandable \pdfescapestring primitive escapes parentheses, + % backslashes, and other special chars. + \xdef#1{\pdfescapestring{#1}}% + \fi +} + +\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images +with PDF output, and none of those formats could be found. (.eps cannot +be supported due to the design of the PDF format; use regular TeX (DVI +output) for that.)} + +\ifpdf + % + % Color manipulation macros based on pdfcolor.tex, + % except using rgb instead of cmyk; the latter is said to render as a + % very dark gray on-screen and a very dark halftone in print, instead + % of actual black. + \def\rgbDarkRed{0.50 0.09 0.12} + \def\rgbBlack{0 0 0} + % + % k sets the color for filling (usual text, etc.); + % K sets the color for stroking (thin rules, e.g., normal _'s). + \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} + % + % Set color, and create a mark which defines \thiscolor accordingly, + % so that \makeheadline knows which color to restore. + \def\setcolor#1{% + \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% + \domark + \pdfsetcolor{#1}% + } + % + \def\maincolor{\rgbBlack} + \pdfsetcolor{\maincolor} + \edef\thiscolor{\maincolor} + \def\lastcolordefs{} + % + \def\makefootline{% + \baselineskip24pt + \line{\pdfsetcolor{\maincolor}\the\footline}% + } + % + \def\makeheadline{% + \vbox to 0pt{% + \vskip-22.5pt + \line{% + \vbox to8.5pt{}% + % Extract \thiscolor definition from the marks. + \getcolormarks + % Typeset the headline with \maincolor, then restore the color. + \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% + }% + \vss + }% + \nointerlineskip + } + % + % + \pdfcatalog{/PageMode /UseOutlines} + % + % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). + \def\dopdfimage#1#2#3{% + \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% + \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% + % + % pdftex (and the PDF format) support .pdf, .png, .jpg (among + % others). Let's try in that order, PDF first since if + % someone has a scalable image, presumably better to use that than a + % bitmap. + \let\pdfimgext=\empty + \begingroup + \openin 1 #1.pdf \ifeof 1 + \openin 1 #1.PDF \ifeof 1 + \openin 1 #1.png \ifeof 1 + \openin 1 #1.jpg \ifeof 1 + \openin 1 #1.jpeg \ifeof 1 + \openin 1 #1.JPG \ifeof 1 + \errhelp = \nopdfimagehelp + \errmessage{Could not find image file #1 for pdf}% + \else \gdef\pdfimgext{JPG}% + \fi + \else \gdef\pdfimgext{jpeg}% + \fi + \else \gdef\pdfimgext{jpg}% + \fi + \else \gdef\pdfimgext{png}% + \fi + \else \gdef\pdfimgext{PDF}% + \fi + \else \gdef\pdfimgext{pdf}% + \fi + \closein 1 + \endgroup + % + % without \immediate, ancient pdftex seg faults when the same image is + % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) + \ifnum\pdftexversion < 14 + \immediate\pdfimage + \else + \immediate\pdfximage + \fi + \ifdim \wd0 >0pt width \pdfimagewidth \fi + \ifdim \wd2 >0pt height \pdfimageheight \fi + \ifnum\pdftexversion<13 + #1.\pdfimgext + \else + {#1.\pdfimgext}% + \fi + \ifnum\pdftexversion < 14 \else + \pdfrefximage \pdflastximage + \fi} + % + \def\pdfmkdest#1{{% + % We have to set dummies so commands such as @code, and characters + % such as \, aren't expanded when present in a section title. + \indexnofonts + \turnoffactive + \makevalueexpandable + \def\pdfdestname{#1}% + \txiescapepdf\pdfdestname + \safewhatsit{\pdfdest name{\pdfdestname} xyz}% + }} + % + % used to mark target names; must be expandable. + \def\pdfmkpgn#1{#1} + % + % by default, use a color that is dark enough to print on paper as + % nearly black, but still distinguishable for online viewing. + \def\urlcolor{\rgbDarkRed} + \def\linkcolor{\rgbDarkRed} + \def\endlink{\setcolor{\maincolor}\pdfendlink} + % + % Adding outlines to PDF; macros for calculating structure of outlines + % come from Petr Olsak + \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% + \else \csname#1\endcsname \fi} + \def\advancenumber#1{\tempnum=\expnumber{#1}\relax + \advance\tempnum by 1 + \expandafter\xdef\csname#1\endcsname{\the\tempnum}} + % + % #1 is the section text, which is what will be displayed in the + % outline by the pdf viewer. #2 is the pdf expression for the number + % of subentries (or empty, for subsubsections). #3 is the node text, + % which might be empty if this toc entry had no corresponding node. + % #4 is the page number + % + \def\dopdfoutline#1#2#3#4{% + % Generate a link to the node text if that exists; else, use the + % page number. We could generate a destination for the section + % text in the case where a section has no node, but it doesn't + % seem worth the trouble, since most documents are normally structured. + \edef\pdfoutlinedest{#3}% + \ifx\pdfoutlinedest\empty + \def\pdfoutlinedest{#4}% + \else + \txiescapepdf\pdfoutlinedest + \fi + % + % Also escape PDF chars in the display string. + \edef\pdfoutlinetext{#1}% + \txiescapepdf\pdfoutlinetext + % + \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% + } + % + \def\pdfmakeoutlines{% + \begingroup + % Read toc silently, to get counts of subentries for \pdfoutline. + \def\partentry##1##2##3##4{}% ignore parts in the outlines + \def\numchapentry##1##2##3##4{% + \def\thischapnum{##2}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + }% + \def\numsecentry##1##2##3##4{% + \advancenumber{chap\thischapnum}% + \def\thissecnum{##2}% + \def\thissubsecnum{0}% + }% + \def\numsubsecentry##1##2##3##4{% + \advancenumber{sec\thissecnum}% + \def\thissubsecnum{##2}% + }% + \def\numsubsubsecentry##1##2##3##4{% + \advancenumber{subsec\thissubsecnum}% + }% + \def\thischapnum{0}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + % + % use \def rather than \let here because we redefine \chapentry et + % al. a second time, below. + \def\appentry{\numchapentry}% + \def\appsecentry{\numsecentry}% + \def\appsubsecentry{\numsubsecentry}% + \def\appsubsubsecentry{\numsubsubsecentry}% + \def\unnchapentry{\numchapentry}% + \def\unnsecentry{\numsecentry}% + \def\unnsubsecentry{\numsubsecentry}% + \def\unnsubsubsecentry{\numsubsubsecentry}% + \readdatafile{toc}% + % + % Read toc second time, this time actually producing the outlines. + % The `-' means take the \expnumber as the absolute number of + % subentries, which we calculated on our first read of the .toc above. + % + % We use the node names as the destinations. + \def\numchapentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% + \def\numsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% + \def\numsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% + \def\numsubsubsecentry##1##2##3##4{% count is always zero + \dopdfoutline{##1}{}{##3}{##4}}% + % + % PDF outlines are displayed using system fonts, instead of + % document fonts. Therefore we cannot use special characters, + % since the encoding is unknown. For example, the eogonek from + % Latin 2 (0xea) gets translated to a | character. Info from + % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. + % + % TODO this right, we have to translate 8-bit characters to + % their "best" equivalent, based on the @documentencoding. Too + % much work for too little return. Just use the ASCII equivalents + % we use for the index sort strings. + % + \indexnofonts + \setupdatafile + % We can have normal brace characters in the PDF outlines, unlike + % Texinfo index files. So set that up. + \def\{{\lbracecharliteral}% + \def\}{\rbracecharliteral}% + \catcode`\\=\active \otherbackslash + \input \tocreadfilename + \endgroup + } + {\catcode`[=1 \catcode`]=2 + \catcode`{=\other \catcode`}=\other + \gdef\lbracecharliteral[{]% + \gdef\rbracecharliteral[}]% + ] + % + \def\skipspaces#1{\def\PP{#1}\def\D{|}% + \ifx\PP\D\let\nextsp\relax + \else\let\nextsp\skipspaces + \addtokens{\filename}{\PP}% + \advance\filenamelength by 1 + \fi + \nextsp} + \def\getfilename#1{% + \filenamelength=0 + % If we don't expand the argument now, \skipspaces will get + % snagged on things like "@value{foo}". + \edef\temp{#1}% + \expandafter\skipspaces\temp|\relax + } + \ifnum\pdftexversion < 14 + \let \startlink \pdfannotlink + \else + \let \startlink \pdfstartlink + \fi + % make a live url in pdf output. + \def\pdfurl#1{% + \begingroup + % it seems we really need yet another set of dummies; have not + % tried to figure out what each command should do in the context + % of @url. for now, just make @/ a no-op, that's the only one + % people have actually reported a problem with. + % + \normalturnoffactive + \def\@{@}% + \let\/=\empty + \makevalueexpandable + % do we want to go so far as to use \indexnofonts instead of just + % special-casing \var here? + \def\var##1{##1}% + % + \leavevmode\setcolor{\urlcolor}% + \startlink attr{/Border [0 0 0]}% + user{/Subtype /Link /A << /S /URI /URI (#1) >>}% + \endgroup} + \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} + \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} + \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} + \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} + \def\maketoks{% + \expandafter\poptoks\the\toksA|ENDTOKS|\relax + \ifx\first0\adn0 + \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 + \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 + \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 + \else + \ifnum0=\countA\else\makelink\fi + \ifx\first.\let\next=\done\else + \let\next=\maketoks + \addtokens{\toksB}{\the\toksD} + \ifx\first,\addtokens{\toksB}{\space}\fi + \fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \next} + \def\makelink{\addtokens{\toksB}% + {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} + \def\pdflink#1{% + \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} + \setcolor{\linkcolor}#1\endlink} + \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} +\else + % non-pdf mode + \let\pdfmkdest = \gobble + \let\pdfurl = \gobble + \let\endlink = \relax + \let\setcolor = \gobble + \let\pdfsetcolor = \gobble + \let\pdfmakeoutlines = \relax +\fi % \ifx\pdfoutput + + +\message{fonts,} + +% Change the current font style to #1, remembering it in \curfontstyle. +% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in +% italics, not bold italics. +% +\def\setfontstyle#1{% + \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. + \csname ten#1\endcsname % change the current font +} + +% Select #1 fonts with the current style. +% +\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} + +\def\rm{\fam=0 \setfontstyle{rm}} +\def\it{\fam=\itfam \setfontstyle{it}} +\def\sl{\fam=\slfam \setfontstyle{sl}} +\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} +\def\tt{\fam=\ttfam \setfontstyle{tt}} + +% Unfortunately, we have to override this for titles and the like, since +% in those cases "rm" is bold. Sigh. +\def\rmisbold{\rm\def\curfontstyle{bf}} + +% Texinfo sort of supports the sans serif font style, which plain TeX does not. +% So we set up a \sf. +\newfam\sffam +\def\sf{\fam=\sffam \setfontstyle{sf}} +\let\li = \sf % Sometimes we call it \li, not \sf. + +% We don't need math for this font style. +\def\ttsl{\setfontstyle{ttsl}} + + +% Set the baselineskip to #1, and the lineskip and strut size +% correspondingly. There is no deep meaning behind these magic numbers +% used as factors; they just match (closely enough) what Knuth defined. +% +\def\lineskipfactor{.08333} +\def\strutheightpercent{.70833} +\def\strutdepthpercent {.29167} +% +% can get a sort of poor man's double spacing by redefining this. +\def\baselinefactor{1} +% +\newdimen\textleading +\def\setleading#1{% + \dimen0 = #1\relax + \normalbaselineskip = \baselinefactor\dimen0 + \normallineskip = \lineskipfactor\normalbaselineskip + \normalbaselines + \setbox\strutbox =\hbox{% + \vrule width0pt height\strutheightpercent\baselineskip + depth \strutdepthpercent \baselineskip + }% +} + +% PDF CMaps. See also LaTeX's t1.cmap. +% +% do nothing with this by default. +\expandafter\let\csname cmapOT1\endcsname\gobble +\expandafter\let\csname cmapOT1IT\endcsname\gobble +\expandafter\let\csname cmapOT1TT\endcsname\gobble + +% if we are producing pdf, and we have \pdffontattr, then define cmaps. +% (\pdffontattr was introduced many years ago, but people still run +% older pdftex's; it's easy to conditionalize, so we do.) +\ifpdf \ifx\pdffontattr\thisisundefined \else + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1-0) +%%Title: (TeX-OT1-0 TeX OT1 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1) +/Supplement 0 +>> def +/CMapName /TeX-OT1-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +8 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<23> <26> <0023> +<28> <3B> <0028> +<3F> <5B> <003F> +<5D> <5E> <005D> +<61> <7A> <0061> +<7B> <7C> <2013> +endbfrange +40 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <00660066> +<0C> <00660069> +<0D> <0066006C> +<0E> <006600660069> +<0F> <00660066006C> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<21> <0021> +<22> <201D> +<27> <2019> +<3C> <00A1> +<3D> <003D> +<3E> <00BF> +<5C> <201C> +<5F> <02D9> +<60> <2018> +<7D> <02DD> +<7E> <007E> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +% +% \cmapOT1IT + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1IT-0) +%%Title: (TeX-OT1IT-0 TeX OT1IT 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1IT) +/Supplement 0 +>> def +/CMapName /TeX-OT1IT-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +8 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<25> <26> <0025> +<28> <3B> <0028> +<3F> <5B> <003F> +<5D> <5E> <005D> +<61> <7A> <0061> +<7B> <7C> <2013> +endbfrange +42 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <00660066> +<0C> <00660069> +<0D> <0066006C> +<0E> <006600660069> +<0F> <00660066006C> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<21> <0021> +<22> <201D> +<23> <0023> +<24> <00A3> +<27> <2019> +<3C> <00A1> +<3D> <003D> +<3E> <00BF> +<5C> <201C> +<5F> <02D9> +<60> <2018> +<7D> <02DD> +<7E> <007E> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1IT\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +% +% \cmapOT1TT + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1TT-0) +%%Title: (TeX-OT1TT-0 TeX OT1TT 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1TT) +/Supplement 0 +>> def +/CMapName /TeX-OT1TT-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +5 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<21> <26> <0021> +<28> <5F> <0028> +<61> <7E> <0061> +endbfrange +32 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <2191> +<0C> <2193> +<0D> <0027> +<0E> <00A1> +<0F> <00BF> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<20> <2423> +<27> <2019> +<60> <2018> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1TT\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +\fi\fi + + +% Set the font macro #1 to the font named \fontprefix#2. +% #3 is the font's design size, #4 is a scale factor, #5 is the CMap +% encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit). +% Example: +% #1 = \textrm +% #2 = \rmshape +% #3 = 10 +% #4 = \mainmagstep +% #5 = OT1 +% +\def\setfont#1#2#3#4#5{% + \font#1=\fontprefix#2#3 scaled #4 + \csname cmap#5\endcsname#1% +} +% This is what gets called when #5 of \setfont is empty. +\let\cmap\gobble +% +% (end of cmaps) + +% Use cm as the default font prefix. +% To specify the font prefix, you must define \fontprefix +% before you read in texinfo.tex. +\ifx\fontprefix\thisisundefined +\def\fontprefix{cm} +\fi +% Support font families that don't use the same naming scheme as CM. +\def\rmshape{r} +\def\rmbshape{bx} % where the normal face is bold +\def\bfshape{b} +\def\bxshape{bx} +\def\ttshape{tt} +\def\ttbshape{tt} +\def\ttslshape{sltt} +\def\itshape{ti} +\def\itbshape{bxti} +\def\slshape{sl} +\def\slbshape{bxsl} +\def\sfshape{ss} +\def\sfbshape{ss} +\def\scshape{csc} +\def\scbshape{csc} + +% Definitions for a main text size of 11pt. (The default in Texinfo.) +% +\def\definetextfontsizexi{% +% Text fonts (11.2pt, magstep1). +\def\textnominalsize{11pt} +\edef\mainmagstep{\magstephalf} +\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} +\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} +\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} +\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} +\setfont\textsl\slshape{10}{\mainmagstep}{OT1} +\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} +\setfont\textsc\scshape{10}{\mainmagstep}{OT1} +\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} +\font\texti=cmmi10 scaled \mainmagstep +\font\textsy=cmsy10 scaled \mainmagstep +\def\textecsize{1095} + +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstep1}{OT1} +\setfont\deftt\ttshape{10}{\magstep1}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\def\smallnominalsize{9pt} +\setfont\smallrm\rmshape{9}{1000}{OT1} +\setfont\smalltt\ttshape{9}{1000}{OT1TT} +\setfont\smallbf\bfshape{10}{900}{OT1} +\setfont\smallit\itshape{9}{1000}{OT1IT} +\setfont\smallsl\slshape{9}{1000}{OT1} +\setfont\smallsf\sfshape{9}{1000}{OT1} +\setfont\smallsc\scshape{10}{900}{OT1} +\setfont\smallttsl\ttslshape{10}{900}{OT1TT} +\font\smalli=cmmi9 +\font\smallsy=cmsy9 +\def\smallecsize{0900} + +% Fonts for small examples (8pt). +\def\smallernominalsize{8pt} +\setfont\smallerrm\rmshape{8}{1000}{OT1} +\setfont\smallertt\ttshape{8}{1000}{OT1TT} +\setfont\smallerbf\bfshape{10}{800}{OT1} +\setfont\smallerit\itshape{8}{1000}{OT1IT} +\setfont\smallersl\slshape{8}{1000}{OT1} +\setfont\smallersf\sfshape{8}{1000}{OT1} +\setfont\smallersc\scshape{10}{800}{OT1} +\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} +\font\smalleri=cmmi8 +\font\smallersy=cmsy8 +\def\smallerecsize{0800} + +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} +\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} +\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} +\setfont\titlesl\slbshape{10}{\magstep4}{OT1} +\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} +\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} +\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} +\let\titlebf=\titlerm +\setfont\titlesc\scbshape{10}{\magstep4}{OT1} +\font\titlei=cmmi12 scaled \magstep3 +\font\titlesy=cmsy10 scaled \magstep4 +\def\titleecsize{2074} + +% Chapter (and unnumbered) fonts (17.28pt). +\def\chapnominalsize{17pt} +\setfont\chaprm\rmbshape{12}{\magstep2}{OT1} +\setfont\chapit\itbshape{10}{\magstep3}{OT1IT} +\setfont\chapsl\slbshape{10}{\magstep3}{OT1} +\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} +\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} +\setfont\chapsf\sfbshape{17}{1000}{OT1} +\let\chapbf=\chaprm +\setfont\chapsc\scbshape{10}{\magstep3}{OT1} +\font\chapi=cmmi12 scaled \magstep2 +\font\chapsy=cmsy10 scaled \magstep3 +\def\chapecsize{1728} + +% Section fonts (14.4pt). +\def\secnominalsize{14pt} +\setfont\secrm\rmbshape{12}{\magstep1}{OT1} +\setfont\secit\itbshape{10}{\magstep2}{OT1IT} +\setfont\secsl\slbshape{10}{\magstep2}{OT1} +\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} +\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} +\setfont\secsf\sfbshape{12}{\magstep1}{OT1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep2}{OT1} +\font\seci=cmmi12 scaled \magstep1 +\font\secsy=cmsy10 scaled \magstep2 +\def\sececsize{1440} + +% Subsection fonts (13.15pt). +\def\ssecnominalsize{13pt} +\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} +\setfont\ssecit\itbshape{10}{1315}{OT1IT} +\setfont\ssecsl\slbshape{10}{1315}{OT1} +\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} +\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} +\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{1315}{OT1} +\font\sseci=cmmi12 scaled \magstephalf +\font\ssecsy=cmsy10 scaled 1315 +\def\ssececsize{1200} + +% Reduced fonts for @acro in text (10pt). +\def\reducednominalsize{10pt} +\setfont\reducedrm\rmshape{10}{1000}{OT1} +\setfont\reducedtt\ttshape{10}{1000}{OT1TT} +\setfont\reducedbf\bfshape{10}{1000}{OT1} +\setfont\reducedit\itshape{10}{1000}{OT1IT} +\setfont\reducedsl\slshape{10}{1000}{OT1} +\setfont\reducedsf\sfshape{10}{1000}{OT1} +\setfont\reducedsc\scshape{10}{1000}{OT1} +\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} +\font\reducedi=cmmi10 +\font\reducedsy=cmsy10 +\def\reducedecsize{1000} + +\textleading = 13.2pt % line spacing for 11pt CM +\textfonts % reset the current fonts +\rm +} % end of 11pt text font size definitions, \definetextfontsizexi + + +% Definitions to make the main text be 10pt Computer Modern, with +% section, chapter, etc., sizes following suit. This is for the GNU +% Press printing of the Emacs 22 manual. Maybe other manuals in the +% future. Used with @smallbook, which sets the leading to 12pt. +% +\def\definetextfontsizex{% +% Text fonts (10pt). +\def\textnominalsize{10pt} +\edef\mainmagstep{1000} +\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} +\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} +\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} +\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} +\setfont\textsl\slshape{10}{\mainmagstep}{OT1} +\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} +\setfont\textsc\scshape{10}{\mainmagstep}{OT1} +\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} +\font\texti=cmmi10 scaled \mainmagstep +\font\textsy=cmsy10 scaled \mainmagstep +\def\textecsize{1000} + +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstephalf}{OT1} +\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\def\smallnominalsize{9pt} +\setfont\smallrm\rmshape{9}{1000}{OT1} +\setfont\smalltt\ttshape{9}{1000}{OT1TT} +\setfont\smallbf\bfshape{10}{900}{OT1} +\setfont\smallit\itshape{9}{1000}{OT1IT} +\setfont\smallsl\slshape{9}{1000}{OT1} +\setfont\smallsf\sfshape{9}{1000}{OT1} +\setfont\smallsc\scshape{10}{900}{OT1} +\setfont\smallttsl\ttslshape{10}{900}{OT1TT} +\font\smalli=cmmi9 +\font\smallsy=cmsy9 +\def\smallecsize{0900} + +% Fonts for small examples (8pt). +\def\smallernominalsize{8pt} +\setfont\smallerrm\rmshape{8}{1000}{OT1} +\setfont\smallertt\ttshape{8}{1000}{OT1TT} +\setfont\smallerbf\bfshape{10}{800}{OT1} +\setfont\smallerit\itshape{8}{1000}{OT1IT} +\setfont\smallersl\slshape{8}{1000}{OT1} +\setfont\smallersf\sfshape{8}{1000}{OT1} +\setfont\smallersc\scshape{10}{800}{OT1} +\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} +\font\smalleri=cmmi8 +\font\smallersy=cmsy8 +\def\smallerecsize{0800} + +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} +\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} +\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} +\setfont\titlesl\slbshape{10}{\magstep4}{OT1} +\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} +\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} +\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} +\let\titlebf=\titlerm +\setfont\titlesc\scbshape{10}{\magstep4}{OT1} +\font\titlei=cmmi12 scaled \magstep3 +\font\titlesy=cmsy10 scaled \magstep4 +\def\titleecsize{2074} + +% Chapter fonts (14.4pt). +\def\chapnominalsize{14pt} +\setfont\chaprm\rmbshape{12}{\magstep1}{OT1} +\setfont\chapit\itbshape{10}{\magstep2}{OT1IT} +\setfont\chapsl\slbshape{10}{\magstep2}{OT1} +\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} +\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} +\setfont\chapsf\sfbshape{12}{\magstep1}{OT1} +\let\chapbf\chaprm +\setfont\chapsc\scbshape{10}{\magstep2}{OT1} +\font\chapi=cmmi12 scaled \magstep1 +\font\chapsy=cmsy10 scaled \magstep2 +\def\chapecsize{1440} + +% Section fonts (12pt). +\def\secnominalsize{12pt} +\setfont\secrm\rmbshape{12}{1000}{OT1} +\setfont\secit\itbshape{10}{\magstep1}{OT1IT} +\setfont\secsl\slbshape{10}{\magstep1}{OT1} +\setfont\sectt\ttbshape{12}{1000}{OT1TT} +\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} +\setfont\secsf\sfbshape{12}{1000}{OT1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep1}{OT1} +\font\seci=cmmi12 +\font\secsy=cmsy10 scaled \magstep1 +\def\sececsize{1200} + +% Subsection fonts (10pt). +\def\ssecnominalsize{10pt} +\setfont\ssecrm\rmbshape{10}{1000}{OT1} +\setfont\ssecit\itbshape{10}{1000}{OT1IT} +\setfont\ssecsl\slbshape{10}{1000}{OT1} +\setfont\ssectt\ttbshape{10}{1000}{OT1TT} +\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} +\setfont\ssecsf\sfbshape{10}{1000}{OT1} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{1000}{OT1} +\font\sseci=cmmi10 +\font\ssecsy=cmsy10 +\def\ssececsize{1000} + +% Reduced fonts for @acro in text (9pt). +\def\reducednominalsize{9pt} +\setfont\reducedrm\rmshape{9}{1000}{OT1} +\setfont\reducedtt\ttshape{9}{1000}{OT1TT} +\setfont\reducedbf\bfshape{10}{900}{OT1} +\setfont\reducedit\itshape{9}{1000}{OT1IT} +\setfont\reducedsl\slshape{9}{1000}{OT1} +\setfont\reducedsf\sfshape{9}{1000}{OT1} +\setfont\reducedsc\scshape{10}{900}{OT1} +\setfont\reducedttsl\ttslshape{10}{900}{OT1TT} +\font\reducedi=cmmi9 +\font\reducedsy=cmsy9 +\def\reducedecsize{0900} + +\divide\parskip by 2 % reduce space between paragraphs +\textleading = 12pt % line spacing for 10pt CM +\textfonts % reset the current fonts +\rm +} % end of 10pt text font size definitions, \definetextfontsizex + + +% We provide the user-level command +% @fonttextsize 10 +% (or 11) to redefine the text font size. pt is assumed. +% +\def\xiword{11} +\def\xword{10} +\def\xwordpt{10pt} +% +\parseargdef\fonttextsize{% + \def\textsizearg{#1}% + %\wlog{doing @fonttextsize \textsizearg}% + % + % Set \globaldefs so that documents can use this inside @tex, since + % makeinfo 4.8 does not support it, but we need it nonetheless. + % + \begingroup \globaldefs=1 + \ifx\textsizearg\xword \definetextfontsizex + \else \ifx\textsizearg\xiword \definetextfontsizexi + \else + \errhelp=\EMsimple + \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} + \fi\fi + \endgroup +} + + +% In order for the font changes to affect most math symbols and letters, +% we have to define the \textfont of the standard families. Since +% texinfo doesn't allow for producing subscripts and superscripts except +% in the main text, we don't bother to reset \scriptfont and +% \scriptscriptfont (which would also require loading a lot more fonts). +% +\def\resetmathfonts{% + \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy + \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf + \textfont\ttfam=\tentt \textfont\sffam=\tensf +} + +% The font-changing commands redefine the meanings of \tenSTYLE, instead +% of just \STYLE. We do this because \STYLE needs to also set the +% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire +% \tenSTYLE to set the current font. +% +% Each font-changing command also sets the names \lsize (one size lower) +% and \lllsize (three sizes lower). These relative commands are used in +% the LaTeX logo and acronyms. +% +% This all needs generalizing, badly. +% +\def\textfonts{% + \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl + \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc + \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy + \let\tenttsl=\textttsl + \def\curfontsize{text}% + \def\lsize{reduced}\def\lllsize{smaller}% + \resetmathfonts \setleading{\textleading}} +\def\titlefonts{% + \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl + \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc + \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy + \let\tenttsl=\titlettsl + \def\curfontsize{title}% + \def\lsize{chap}\def\lllsize{subsec}% + \resetmathfonts \setleading{27pt}} +\def\titlefont#1{{\titlefonts\rmisbold #1}} +\def\chapfonts{% + \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl + \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc + \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy + \let\tenttsl=\chapttsl + \def\curfontsize{chap}% + \def\lsize{sec}\def\lllsize{text}% + \resetmathfonts \setleading{19pt}} +\def\secfonts{% + \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl + \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc + \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy + \let\tenttsl=\secttsl + \def\curfontsize{sec}% + \def\lsize{subsec}\def\lllsize{reduced}% + \resetmathfonts \setleading{16pt}} +\def\subsecfonts{% + \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl + \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc + \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy + \let\tenttsl=\ssecttsl + \def\curfontsize{ssec}% + \def\lsize{text}\def\lllsize{small}% + \resetmathfonts \setleading{15pt}} +\let\subsubsecfonts = \subsecfonts +\def\reducedfonts{% + \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl + \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc + \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy + \let\tenttsl=\reducedttsl + \def\curfontsize{reduced}% + \def\lsize{small}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} +\def\smallfonts{% + \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl + \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc + \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy + \let\tenttsl=\smallttsl + \def\curfontsize{small}% + \def\lsize{smaller}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} +\def\smallerfonts{% + \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl + \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc + \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy + \let\tenttsl=\smallerttsl + \def\curfontsize{smaller}% + \def\lsize{smaller}\def\lllsize{smaller}% + \resetmathfonts \setleading{9.5pt}} + +% Fonts for short table of contents. +\setfont\shortcontrm\rmshape{12}{1000}{OT1} +\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 +\setfont\shortcontsl\slshape{12}{1000}{OT1} +\setfont\shortconttt\ttshape{12}{1000}{OT1TT} + +% Define these just so they can be easily changed for other fonts. +\def\angleleft{$\langle$} +\def\angleright{$\rangle$} + +% Set the fonts to use with the @small... environments. +\let\smallexamplefonts = \smallfonts + +% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample +% can fit this many characters: +% 8.5x11=86 smallbook=72 a4=90 a5=69 +% If we use \scriptfonts (8pt), then we can fit this many characters: +% 8.5x11=90+ smallbook=80 a4=90+ a5=77 +% For me, subjectively, the few extra characters that fit aren't worth +% the additional smallness of 8pt. So I'm making the default 9pt. +% +% By the way, for comparison, here's what fits with @example (10pt): +% 8.5x11=71 smallbook=60 a4=75 a5=58 +% --karl, 24jan03. + +% Set up the default fonts, so we can use them for creating boxes. +% +\definetextfontsizexi + + +\message{markup,} + +% Check if we are currently using a typewriter font. Since all the +% Computer Modern typewriter fonts have zero interword stretch (and +% shrink), and it is reasonable to expect all typewriter fonts to have +% this property, we can check that font parameter. +% +\def\ifmonospace{\ifdim\fontdimen3\font=0pt } + +% Markup style infrastructure. \defmarkupstylesetup\INITMACRO will +% define and register \INITMACRO to be called on markup style changes. +% \INITMACRO can check \currentmarkupstyle for the innermost +% style and the set of \ifmarkupSTYLE switches for all styles +% currently in effect. +\newif\ifmarkupvar +\newif\ifmarkupsamp +\newif\ifmarkupkey +%\newif\ifmarkupfile % @file == @samp. +%\newif\ifmarkupoption % @option == @samp. +\newif\ifmarkupcode +\newif\ifmarkupkbd +%\newif\ifmarkupenv % @env == @code. +%\newif\ifmarkupcommand % @command == @code. +\newif\ifmarkuptex % @tex (and part of @math, for now). +\newif\ifmarkupexample +\newif\ifmarkupverb +\newif\ifmarkupverbatim + +\let\currentmarkupstyle\empty + +\def\setupmarkupstyle#1{% + \csname markup#1true\endcsname + \def\currentmarkupstyle{#1}% + \markupstylesetup +} + +\let\markupstylesetup\empty + +\def\defmarkupstylesetup#1{% + \expandafter\def\expandafter\markupstylesetup + \expandafter{\markupstylesetup #1}% + \def#1% +} + +% Markup style setup for left and right quotes. +\defmarkupstylesetup\markupsetuplq{% + \expandafter\let\expandafter \temp + \csname markupsetuplq\currentmarkupstyle\endcsname + \ifx\temp\relax \markupsetuplqdefault \else \temp \fi +} + +\defmarkupstylesetup\markupsetuprq{% + \expandafter\let\expandafter \temp + \csname markupsetuprq\currentmarkupstyle\endcsname + \ifx\temp\relax \markupsetuprqdefault \else \temp \fi +} + +{ +\catcode`\'=\active +\catcode`\`=\active + +\gdef\markupsetuplqdefault{\let`\lq} +\gdef\markupsetuprqdefault{\let'\rq} + +\gdef\markupsetcodequoteleft{\let`\codequoteleft} +\gdef\markupsetcodequoteright{\let'\codequoteright} +} + +\let\markupsetuplqcode \markupsetcodequoteleft +\let\markupsetuprqcode \markupsetcodequoteright +% +\let\markupsetuplqexample \markupsetcodequoteleft +\let\markupsetuprqexample \markupsetcodequoteright +% +\let\markupsetuplqkbd \markupsetcodequoteleft +\let\markupsetuprqkbd \markupsetcodequoteright +% +\let\markupsetuplqsamp \markupsetcodequoteleft +\let\markupsetuprqsamp \markupsetcodequoteright +% +\let\markupsetuplqverb \markupsetcodequoteleft +\let\markupsetuprqverb \markupsetcodequoteright +% +\let\markupsetuplqverbatim \markupsetcodequoteleft +\let\markupsetuprqverbatim \markupsetcodequoteright + +% Allow an option to not use regular directed right quote/apostrophe +% (char 0x27), but instead the undirected quote from cmtt (char 0x0d). +% The undirected quote is ugly, so don't make it the default, but it +% works for pasting with more pdf viewers (at least evince), the +% lilypond developers report. xpdf does work with the regular 0x27. +% +\def\codequoteright{% + \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax + \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax + '% + \else \char'15 \fi + \else \char'15 \fi +} +% +% and a similar option for the left quote char vs. a grave accent. +% Modern fonts display ASCII 0x60 as a grave accent, so some people like +% the code environments to do likewise. +% +\def\codequoteleft{% + \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax + \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax + % [Knuth] pp. 380,381,391 + % \relax disables Spanish ligatures ?` and !` of \tt font. + \relax`% + \else \char'22 \fi + \else \char'22 \fi +} + +% Commands to set the quote options. +% +\parseargdef\codequoteundirected{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETtxicodequoteundirected\endcsname + = t% + \else\ifx\temp\offword + \expandafter\let\csname SETtxicodequoteundirected\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}% + \fi\fi +} +% +\parseargdef\codequotebacktick{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETtxicodequotebacktick\endcsname + = t% + \else\ifx\temp\offword + \expandafter\let\csname SETtxicodequotebacktick\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}% + \fi\fi +} + +% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. +\def\noligaturesquoteleft{\relax\lq} + +% Count depth in font-changes, for error checks +\newcount\fontdepth \fontdepth=0 + +% Font commands. + +% #1 is the font command (\sl or \it), #2 is the text to slant. +% If we are in a monospaced environment, however, 1) always use \ttsl, +% and 2) do not add an italic correction. +\def\dosmartslant#1#2{% + \ifusingtt + {{\ttsl #2}\let\next=\relax}% + {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}% + \next +} +\def\smartslanted{\dosmartslant\sl} +\def\smartitalic{\dosmartslant\it} + +% Output an italic correction unless \next (presumed to be the following +% character) is such as not to need one. +\def\smartitaliccorrection{% + \ifx\next,% + \else\ifx\next-% + \else\ifx\next.% + \else\ifx\next\.% + \else\ifx\next\comma% + \else\ptexslash + \fi\fi\fi\fi\fi + \aftersmartic +} + +% Unconditional use \ttsl, and no ic. @var is set to this for defuns. +\def\ttslanted#1{{\ttsl #1}} + +% @cite is like \smartslanted except unconditionally use \sl. We never want +% ttsl for book titles, do we? +\def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection} + +\def\aftersmartic{} +\def\var#1{% + \let\saveaftersmartic = \aftersmartic + \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}% + \smartslanted{#1}% +} + +\let\i=\smartitalic +\let\slanted=\smartslanted +\let\dfn=\smartslanted +\let\emph=\smartitalic + +% Explicit font changes: @r, @sc, undocumented @ii. +\def\r#1{{\rm #1}} % roman font +\def\sc#1{{\smallcaps#1}} % smallcaps font +\def\ii#1{{\it #1}} % italic font + +% @b, explicit bold. Also @strong. +\def\b#1{{\bf #1}} +\let\strong=\b + +% @sansserif, explicit sans. +\def\sansserif#1{{\sf #1}} + +% We can't just use \exhyphenpenalty, because that only has effect at +% the end of a paragraph. Restore normal hyphenation at the end of the +% group within which \nohyphenation is presumably called. +% +\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} +\def\restorehyphenation{\hyphenchar\font = `- } + +% Set sfcode to normal for the chars that usually have another value. +% Can't use plain's \frenchspacing because it uses the `\x notation, and +% sometimes \x has an active definition that messes things up. +% +\catcode`@=11 + \def\plainfrenchspacing{% + \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m + \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m + \def\endofsentencespacefactor{1000}% for @. and friends + } + \def\plainnonfrenchspacing{% + \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 + \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 + \def\endofsentencespacefactor{3000}% for @. and friends + } +\catcode`@=\other +\def\endofsentencespacefactor{3000}% default + +% @t, explicit typewriter. +\def\t#1{% + {\tt \rawbackslash \plainfrenchspacing #1}% + \null +} + +% @samp. +\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} + +% @indicateurl is \samp, that is, with quotes. +\let\indicateurl=\samp + +% @code (and similar) prints in typewriter, but with spaces the same +% size as normal in the surrounding text, without hyphenation, etc. +% This is a subroutine for that. +\def\tclose#1{% + {% + % Change normal interword space to be same as for the current font. + \spaceskip = \fontdimen2\font + % + % Switch to typewriter. + \tt + % + % But `\ ' produces the large typewriter interword space. + \def\ {{\spaceskip = 0pt{} }}% + % + % Turn off hyphenation. + \nohyphenation + % + \rawbackslash + \plainfrenchspacing + #1% + }% + \null % reset spacefactor to 1000 +} + +% We *must* turn on hyphenation at `-' and `_' in @code. +% (But see \codedashfinish below.) +% Otherwise, it is too hard to avoid overfull hboxes +% in the Emacs manual, the Library manual, etc. +% +% Unfortunately, TeX uses one parameter (\hyphenchar) to control +% both hyphenation at - and hyphenation within words. +% We must therefore turn them both off (\tclose does that) +% and arrange explicitly to hyphenate at a dash. -- rms. +{ + \catcode`\-=\active \catcode`\_=\active + \catcode`\'=\active \catcode`\`=\active + \global\let'=\rq \global\let`=\lq % default definitions + % + \global\def\code{\begingroup + \setupmarkupstyle{code}% + % The following should really be moved into \setupmarkupstyle handlers. + \catcode\dashChar=\active \catcode\underChar=\active + \ifallowcodebreaks + \let-\codedash + \let_\codeunder + \else + \let-\normaldash + \let_\realunder + \fi + % Given -foo (with a single dash), we do not want to allow a break + % after the hyphen. + \global\let\codedashprev=\codedash + % + \codex + } + % + \gdef\codedash{\futurelet\next\codedashfinish} + \gdef\codedashfinish{% + \normaldash % always output the dash character itself. + % + % Now, output a discretionary to allow a line break, unless + % (a) the next character is a -, or + % (b) the preceding character is a -. + % E.g., given --posix, we do not want to allow a break after either -. + % Given --foo-bar, we do want to allow a break between the - and the b. + \ifx\next\codedash \else + \ifx\codedashprev\codedash + \else \discretionary{}{}{}\fi + \fi + % we need the space after the = for the case when \next itself is a + % space token; it would get swallowed otherwise. As in @code{- a}. + \global\let\codedashprev= \next + } +} +\def\normaldash{-} +% +\def\codex #1{\tclose{#1}\endgroup} + +\def\codeunder{% + % this is all so @math{@code{var_name}+1} can work. In math mode, _ + % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) + % will therefore expand the active definition of _, which is us + % (inside @code that is), therefore an endless loop. + \ifusingtt{\ifmmode + \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. + \else\normalunderscore \fi + \discretionary{}{}{}}% + {\_}% +} + +% An additional complication: the above will allow breaks after, e.g., +% each of the four underscores in __typeof__. This is bad. +% @allowcodebreaks provides a document-level way to turn breaking at - +% and _ on and off. +% +\newif\ifallowcodebreaks \allowcodebreakstrue + +\def\keywordtrue{true} +\def\keywordfalse{false} + +\parseargdef\allowcodebreaks{% + \def\txiarg{#1}% + \ifx\txiarg\keywordtrue + \allowcodebreakstrue + \else\ifx\txiarg\keywordfalse + \allowcodebreaksfalse + \else + \errhelp = \EMsimple + \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}% + \fi\fi +} + +% For @command, @env, @file, @option quotes seem unnecessary, +% so use \code rather than \samp. +\let\command=\code +\let\env=\code +\let\file=\code +\let\option=\code + +% @uref (abbreviation for `urlref') takes an optional (comma-separated) +% second argument specifying the text to display and an optional third +% arg as text to display instead of (rather than in addition to) the url +% itself. First (mandatory) arg is the url. +% (This \urefnobreak definition isn't used now, leaving it for a while +% for comparison.) +\def\urefnobreak#1{\dourefnobreak #1,,,\finish} +\def\dourefnobreak#1,#2,#3,#4\finish{\begingroup + \unsepspaces + \pdfurl{#1}% + \setbox0 = \hbox{\ignorespaces #3}% + \ifdim\wd0 > 0pt + \unhbox0 % third arg given, show only that + \else + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \ifpdf + \unhbox0 % PDF: 2nd arg given, show only it + \else + \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url + \fi + \else + \code{#1}% only url given, so show it + \fi + \fi + \endlink +\endgroup} + +% This \urefbreak definition is the active one. +\def\urefbreak{\begingroup \urefcatcodes \dourefbreak} +\let\uref=\urefbreak +\def\dourefbreak#1{\urefbreakfinish #1,,,\finish} +\def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example + \unsepspaces + \pdfurl{#1}% + \setbox0 = \hbox{\ignorespaces #3}% + \ifdim\wd0 > 0pt + \unhbox0 % third arg given, show only that + \else + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \ifpdf + \unhbox0 % PDF: 2nd arg given, show only it + \else + \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url + \fi + \else + \urefcode{#1}% only url given, so show it + \fi + \fi + \endlink +\endgroup} + +% Allow line breaks around only a few characters (only). +\def\urefcatcodes{% + \catcode\ampChar=\active \catcode\dotChar=\active + \catcode\hashChar=\active \catcode\questChar=\active + \catcode\slashChar=\active +} +{ + \urefcatcodes + % + \global\def\urefcode{\begingroup + \setupmarkupstyle{code}% + \urefcatcodes + \let&\urefcodeamp + \let.\urefcodedot + \let#\urefcodehash + \let?\urefcodequest + \let/\urefcodeslash + \codex + } + % + % By default, they are just regular characters. + \global\def&{\normalamp} + \global\def.{\normaldot} + \global\def#{\normalhash} + \global\def?{\normalquest} + \global\def/{\normalslash} +} + +% we put a little stretch before and after the breakable chars, to help +% line breaking of long url's. The unequal skips make look better in +% cmtt at least, especially for dots. +\def\urefprestretch{\urefprebreak \hskip0pt plus.13em } +\def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em } +% +\def\urefcodeamp{\urefprestretch \&\urefpoststretch} +\def\urefcodedot{\urefprestretch .\urefpoststretch} +\def\urefcodehash{\urefprestretch \#\urefpoststretch} +\def\urefcodequest{\urefprestretch ?\urefpoststretch} +\def\urefcodeslash{\futurelet\next\urefcodeslashfinish} +{ + \catcode`\/=\active + \global\def\urefcodeslashfinish{% + \urefprestretch \slashChar + % Allow line break only after the final / in a sequence of + % slashes, to avoid line break between the slashes in http://. + \ifx\next/\else \urefpoststretch \fi + } +} + +% One more complication: by default we'll break after the special +% characters, but some people like to break before the special chars, so +% allow that. Also allow no breaking at all, for manual control. +% +\parseargdef\urefbreakstyle{% + \def\txiarg{#1}% + \ifx\txiarg\wordnone + \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} + \else\ifx\txiarg\wordbefore + \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak} + \else\ifx\txiarg\wordafter + \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak} + \else + \errhelp = \EMsimple + \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% + \fi\fi\fi +} +\def\wordafter{after} +\def\wordbefore{before} +\def\wordnone{none} + +\urefbreakstyle after + +% @url synonym for @uref, since that's how everyone uses it. +% +\let\url=\uref + +% rms does not like angle brackets --karl, 17may97. +% So now @email is just like @uref, unless we are pdf. +% +%\def\email#1{\angleleft{\tt #1}\angleright} +\ifpdf + \def\email#1{\doemail#1,,\finish} + \def\doemail#1,#2,#3\finish{\begingroup + \unsepspaces + \pdfurl{mailto:#1}% + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi + \endlink + \endgroup} +\else + \let\email=\uref +\fi + +% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), +% `example' (@kbd uses ttsl only inside of @example and friends), +% or `code' (@kbd uses normal tty font always). +\parseargdef\kbdinputstyle{% + \def\txiarg{#1}% + \ifx\txiarg\worddistinct + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% + \else\ifx\txiarg\wordexample + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% + \else\ifx\txiarg\wordcode + \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% + \else + \errhelp = \EMsimple + \errmessage{Unknown @kbdinputstyle setting `\txiarg'}% + \fi\fi\fi +} +\def\worddistinct{distinct} +\def\wordexample{example} +\def\wordcode{code} + +% Default is `distinct'. +\kbdinputstyle distinct + +% @kbd is like @code, except that if the argument is just one @key command, +% then @kbd has no effect. +\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}} + +\def\xkey{\key} +\def\kbdsub#1#2#3\par{% + \def\one{#1}\def\three{#3}\def\threex{??}% + \ifx\one\xkey\ifx\threex\three \key{#2}% + \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi + \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi +} + +% definition of @key that produces a lozenge. Doesn't adjust to text size. +%\setfont\keyrm\rmshape{8}{1000}{OT1} +%\font\keysy=cmsy9 +%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% +% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% +% \vbox{\hrule\kern-0.4pt +% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% +% \kern-0.4pt\hrule}% +% \kern-.06em\raise0.4pt\hbox{\angleright}}}} + +% definition of @key with no lozenge. If the current font is already +% monospace, don't change it; that way, we respect @kbdinputstyle. But +% if it isn't monospace, then use \tt. +% +\def\key#1{{\setupmarkupstyle{key}% + \nohyphenation + \ifmonospace\else\tt\fi + #1}\null} + +% @clicksequence{File @click{} Open ...} +\def\clicksequence#1{\begingroup #1\endgroup} + +% @clickstyle @arrow (by default) +\parseargdef\clickstyle{\def\click{#1}} +\def\click{\arrow} + +% Typeset a dimension, e.g., `in' or `pt'. The only reason for the +% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. +% +\def\dmn#1{\thinspace #1} + +% @l was never documented to mean ``switch to the Lisp font'', +% and it is not used as such in any manual I can find. We need it for +% Polish suppressed-l. --karl, 22sep96. +%\def\l#1{{\li #1}\null} + +% @acronym for "FBI", "NATO", and the like. +% We print this one point size smaller, since it's intended for +% all-uppercase. +% +\def\acronym#1{\doacronym #1,,\finish} +\def\doacronym#1,#2,#3\finish{% + {\selectfonts\lsize #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi + \null % reset \spacefactor=1000 +} + +% @abbr for "Comput. J." and the like. +% No font change, but don't do end-of-sentence spacing. +% +\def\abbr#1{\doabbr #1,,\finish} +\def\doabbr#1,#2,#3\finish{% + {\plainfrenchspacing #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi + \null % reset \spacefactor=1000 +} + +% @asis just yields its argument. Used with @table, for example. +% +\def\asis#1{#1} + +% @math outputs its argument in math mode. +% +% One complication: _ usually means subscripts, but it could also mean +% an actual _ character, as in @math{@var{some_variable} + 1}. So make +% _ active, and distinguish by seeing if the current family is \slfam, +% which is what @var uses. +{ + \catcode`\_ = \active + \gdef\mathunderscore{% + \catcode`\_=\active + \def_{\ifnum\fam=\slfam \_\else\sb\fi}% + } +} +% Another complication: we want \\ (and @\) to output a math (or tt) \. +% FYI, plain.tex uses \\ as a temporary control sequence (for no +% particular reason), but this is not advertised and we don't care. +% +% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. +\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} +% +\def\math{% + \tex + \mathunderscore + \let\\ = \mathbackslash + \mathactive + % make the texinfo accent commands work in math mode + \let\"=\ddot + \let\'=\acute + \let\==\bar + \let\^=\hat + \let\`=\grave + \let\u=\breve + \let\v=\check + \let\~=\tilde + \let\dotaccent=\dot + $\finishmath +} +\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. + +% Some active characters (such as <) are spaced differently in math. +% We have to reset their definitions in case the @math was an argument +% to a command which sets the catcodes (such as @item or @section). +% +{ + \catcode`^ = \active + \catcode`< = \active + \catcode`> = \active + \catcode`+ = \active + \catcode`' = \active + \gdef\mathactive{% + \let^ = \ptexhat + \let< = \ptexless + \let> = \ptexgtr + \let+ = \ptexplus + \let' = \ptexquoteright + } +} + +% ctrl is no longer a Texinfo command, but leave this definition for fun. +\def\ctrl #1{{\tt \rawbackslash \hat}#1} + +% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. +% Ignore unless FMTNAME == tex; then it is like @iftex and @tex, +% except specified as a normal braced arg, so no newlines to worry about. +% +\def\outfmtnametex{tex} +% +\long\def\inlinefmt#1{\doinlinefmt #1,\finish} +\long\def\doinlinefmt#1,#2,\finish{% + \def\inlinefmtname{#1}% + \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi +} +% +% @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if +% FMTNAME is tex, else ELSE-TEXT. +\long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish} +\long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{% + \def\inlinefmtname{#1}% + \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi +} +% +% For raw, must switch into @tex before parsing the argument, to avoid +% setting catcodes prematurely. Doing it this way means that, for +% example, @inlineraw{html, foo{bar} gets a parse error instead of being +% ignored. But this isn't important because if people want a literal +% *right* brace they would have to use a command anyway, so they may as +% well use a command to get a left brace too. We could re-use the +% delimiter character idea from \verb, but it seems like overkill. +% +\long\def\inlineraw{\tex \doinlineraw} +\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish} +\def\doinlinerawtwo#1,#2,\finish{% + \def\inlinerawname{#1}% + \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi + \endgroup % close group opened by \tex. +} + +% @inlineifset{VAR, TEXT} expands TEXT if VAR is @set. +% +\long\def\inlineifset#1{\doinlineifset #1,\finish} +\long\def\doinlineifset#1,#2,\finish{% + \def\inlinevarname{#1}% + \expandafter\ifx\csname SET\inlinevarname\endcsname\relax + \else\ignorespaces#2\fi +} + +% @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set. +% +\long\def\inlineifclear#1{\doinlineifclear #1,\finish} +\long\def\doinlineifclear#1,#2,\finish{% + \def\inlinevarname{#1}% + \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi +} + + +\message{glyphs,} +% and logos. + +% @@ prints an @, as does @atchar{}. +\def\@{\char64 } +\let\atchar=\@ + +% @{ @} @lbracechar{} @rbracechar{} all generate brace characters. +% Unless we're in typewriter, use \ecfont because the CM text fonts do +% not have braces, and we don't want to switch into math. +\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}} +\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}} +\let\{=\mylbrace \let\lbracechar=\{ +\let\}=\myrbrace \let\rbracechar=\} +\begingroup + % Definitions to produce \{ and \} commands for indices, + % and @{ and @} for the aux/toc files. + \catcode`\{ = \other \catcode`\} = \other + \catcode`\[ = 1 \catcode`\] = 2 + \catcode`\! = 0 \catcode`\\ = \other + !gdef!lbracecmd[\{]% + !gdef!rbracecmd[\}]% + !gdef!lbraceatcmd[@{]% + !gdef!rbraceatcmd[@}]% +!endgroup + +% @comma{} to avoid , parsing problems. +\let\comma = , + +% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent +% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. +\let\, = \ptexc +\let\dotaccent = \ptexdot +\def\ringaccent#1{{\accent23 #1}} +\let\tieaccent = \ptext +\let\ubaraccent = \ptexb +\let\udotaccent = \d + +% Other special characters: @questiondown @exclamdown @ordf @ordm +% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. +\def\questiondown{?`} +\def\exclamdown{!`} +\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} +\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} + +% Dotless i and dotless j, used for accents. +\def\imacro{i} +\def\jmacro{j} +\def\dotless#1{% + \def\temp{#1}% + \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi + \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi + \else \errmessage{@dotless can be used only with i or j}% + \fi\fi +} + +% The \TeX{} logo, as in plain, but resetting the spacing so that a +% period following counts as ending a sentence. (Idea found in latex.) +% +\edef\TeX{\TeX \spacefactor=1000 } + +% @LaTeX{} logo. Not quite the same results as the definition in +% latex.ltx, since we use a different font for the raised A; it's most +% convenient for us to use an explicitly smaller font, rather than using +% the \scriptstyle font (since we don't reset \scriptstyle and +% \scriptscriptstyle). +% +\def\LaTeX{% + L\kern-.36em + {\setbox0=\hbox{T}% + \vbox to \ht0{\hbox{% + \ifx\textnominalsize\xwordpt + % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX. + % Revert to plain's \scriptsize, which is 7pt. + \count255=\the\fam $\fam\count255 \scriptstyle A$% + \else + % For 11pt, we can use our lllsize. + \selectfonts\lllsize A% + \fi + }% + \vss + }}% + \kern-.15em + \TeX +} + +% Some math mode symbols. +\def\bullet{$\ptexbullet$} +\def\geq{\ifmmode \ge\else $\ge$\fi} +\def\leq{\ifmmode \le\else $\le$\fi} +\def\minus{\ifmmode -\else $-$\fi} + +% @dots{} outputs an ellipsis using the current font. +% We do .5em per period so that it has the same spacing in the cm +% typewriter fonts as three actual period characters; on the other hand, +% in other typewriter fonts three periods are wider than 1.5em. So do +% whichever is larger. +% +\def\dots{% + \leavevmode + \setbox0=\hbox{...}% get width of three periods + \ifdim\wd0 > 1.5em + \dimen0 = \wd0 + \else + \dimen0 = 1.5em + \fi + \hbox to \dimen0{% + \hskip 0pt plus.25fil + .\hskip 0pt plus1fil + .\hskip 0pt plus1fil + .\hskip 0pt plus.5fil + }% +} + +% @enddots{} is an end-of-sentence ellipsis. +% +\def\enddots{% + \dots + \spacefactor=\endofsentencespacefactor +} + +% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. +% +% Since these characters are used in examples, they should be an even number of +% \tt widths. Each \tt character is 1en, so two makes it 1em. +% +\def\point{$\star$} +\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}} +\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} +\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}} +\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} +\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}} + +% The @error{} command. +% Adapted from the TeXbook's \boxit. +% +\newbox\errorbox +% +{\tentt \global\dimen0 = 3em}% Width of the box. +\dimen2 = .55pt % Thickness of rules +% The text. (`r' is open on the right, `e' somewhat less so on the left.) +\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} +% +\setbox\errorbox=\hbox to \dimen0{\hfil + \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. + \advance\hsize by -2\dimen2 % Rules. + \vbox{% + \hrule height\dimen2 + \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. + \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. + \kern3pt\vrule width\dimen2}% Space to right. + \hrule height\dimen2} + \hfil} +% +\def\error{\leavevmode\lower.7ex\copy\errorbox} + +% @pounds{} is a sterling sign, which Knuth put in the CM italic font. +% +\def\pounds{{\it\$}} + +% @euro{} comes from a separate font, depending on the current style. +% We use the free feym* fonts from the eurosym package by Henrik +% Theiling, which support regular, slanted, bold and bold slanted (and +% "outlined" (blackboard board, sort of) versions, which we don't need). +% It is available from http://www.ctan.org/tex-archive/fonts/eurosym. +% +% Although only regular is the truly official Euro symbol, we ignore +% that. The Euro is designed to be slightly taller than the regular +% font height. +% +% feymr - regular +% feymo - slanted +% feybr - bold +% feybo - bold slanted +% +% There is no good (free) typewriter version, to my knowledge. +% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. +% Hmm. +% +% Also doesn't work in math. Do we need to do math with euro symbols? +% Hope not. +% +% +\def\euro{{\eurofont e}} +\def\eurofont{% + % We set the font at each command, rather than predefining it in + % \textfonts and the other font-switching commands, so that + % installations which never need the symbol don't have to have the + % font installed. + % + % There is only one designed size (nominal 10pt), so we always scale + % that to the current nominal size. + % + % By the way, simply using "at 1em" works for cmr10 and the like, but + % does not work for cmbx10 and other extended/shrunken fonts. + % + \def\eurosize{\csname\curfontsize nominalsize\endcsname}% + % + \ifx\curfontstyle\bfstylename + % bold: + \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize + \else + % regular: + \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize + \fi + \thiseurofont +} + +% Glyphs from the EC fonts. We don't use \let for the aliases, because +% sometimes we redefine the original macro, and the alias should reflect +% the redefinition. +% +% Use LaTeX names for the Icelandic letters. +\def\DH{{\ecfont \char"D0}} % Eth +\def\dh{{\ecfont \char"F0}} % eth +\def\TH{{\ecfont \char"DE}} % Thorn +\def\th{{\ecfont \char"FE}} % thorn +% +\def\guillemetleft{{\ecfont \char"13}} +\def\guillemotleft{\guillemetleft} +\def\guillemetright{{\ecfont \char"14}} +\def\guillemotright{\guillemetright} +\def\guilsinglleft{{\ecfont \char"0E}} +\def\guilsinglright{{\ecfont \char"0F}} +\def\quotedblbase{{\ecfont \char"12}} +\def\quotesinglbase{{\ecfont \char"0D}} +% +% This positioning is not perfect (see the ogonek LaTeX package), but +% we have the precomposed glyphs for the most common cases. We put the +% tests to use those glyphs in the single \ogonek macro so we have fewer +% dummy definitions to worry about for index entries, etc. +% +% ogonek is also used with other letters in Lithuanian (IOU), but using +% the precomposed glyphs for those is not so easy since they aren't in +% the same EC font. +\def\ogonek#1{{% + \def\temp{#1}% + \ifx\temp\macrocharA\Aogonek + \else\ifx\temp\macrochara\aogonek + \else\ifx\temp\macrocharE\Eogonek + \else\ifx\temp\macrochare\eogonek + \else + \ecfont \setbox0=\hbox{#1}% + \ifdim\ht0=1ex\accent"0C #1% + \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}% + \fi + \fi\fi\fi\fi + }% +} +\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A} +\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a} +\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} +\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} +% +% Use the ec* fonts (cm-super in outline format) for non-CM glyphs. +\def\ecfont{% + % We can't distinguish serif/sans and italic/slanted, but this + % is used for crude hacks anyway (like adding French and German + % quotes to documents typeset with CM, where we lose kerning), so + % hopefully nobody will notice/care. + \edef\ecsize{\csname\curfontsize ecsize\endcsname}% + \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% + \ifmonospace + % typewriter: + \font\thisecfont = ectt\ecsize \space at \nominalsize + \else + \ifx\curfontstyle\bfstylename + % bold: + \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize + \else + % regular: + \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize + \fi + \fi + \thisecfont +} + +% @registeredsymbol - R in a circle. The font for the R should really +% be smaller yet, but lllsize is the best we can do for now. +% Adapted from the plain.tex definition of \copyright. +% +\def\registeredsymbol{% + $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% + \hfil\crcr\Orb}}% + }$% +} + +% @textdegree - the normal degrees sign. +% +\def\textdegree{$^\circ$} + +% Laurent Siebenmann reports \Orb undefined with: +% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 +% so we'll define it if necessary. +% +\ifx\Orb\thisisundefined +\def\Orb{\mathhexbox20D} +\fi + +% Quotes. +\chardef\quotedblleft="5C +\chardef\quotedblright=`\" +\chardef\quoteleft=`\` +\chardef\quoteright=`\' + + +\message{page headings,} + +\newskip\titlepagetopglue \titlepagetopglue = 1.5in +\newskip\titlepagebottomglue \titlepagebottomglue = 2pc + +% First the title page. Must do @settitle before @titlepage. +\newif\ifseenauthor +\newif\iffinishedtitlepage + +% Do an implicit @contents or @shortcontents after @end titlepage if the +% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. +% +\newif\ifsetcontentsaftertitlepage + \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue +\newif\ifsetshortcontentsaftertitlepage + \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue + +\parseargdef\shorttitlepage{% + \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}% + \endgroup\page\hbox{}\page} + +\envdef\titlepage{% + % Open one extra group, as we want to close it in the middle of \Etitlepage. + \begingroup + \parindent=0pt \textfonts + % Leave some space at the very top of the page. + \vglue\titlepagetopglue + % No rule at page bottom unless we print one at the top with @title. + \finishedtitlepagetrue + % + % Most title ``pages'' are actually two pages long, with space + % at the top of the second. We don't want the ragged left on the second. + \let\oldpage = \page + \def\page{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + \let\page = \oldpage + \page + \null + }% +} + +\def\Etitlepage{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + % It is important to do the page break before ending the group, + % because the headline and footline are only empty inside the group. + % If we use the new definition of \page, we always get a blank page + % after the title page, which we certainly don't want. + \oldpage + \endgroup + % + % Need this before the \...aftertitlepage checks so that if they are + % in effect the toc pages will come out with page numbers. + \HEADINGSon + % + % If they want short, they certainly want long too. + \ifsetshortcontentsaftertitlepage + \shortcontents + \contents + \global\let\shortcontents = \relax + \global\let\contents = \relax + \fi + % + \ifsetcontentsaftertitlepage + \contents + \global\let\contents = \relax + \global\let\shortcontents = \relax + \fi +} + +\def\finishtitlepage{% + \vskip4pt \hrule height 2pt width \hsize + \vskip\titlepagebottomglue + \finishedtitlepagetrue +} + +% Settings used for typesetting titles: no hyphenation, no indentation, +% don't worry much about spacing, ragged right. This should be used +% inside a \vbox, and fonts need to be set appropriately first. Because +% it is always used for titles, nothing else, we call \rmisbold. \par +% should be specified before the end of the \vbox, since a vbox is a group. +% +\def\raggedtitlesettings{% + \rmisbold + \hyphenpenalty=10000 + \parindent=0pt + \tolerance=5000 + \ptexraggedright +} + +% Macros to be used within @titlepage: + +\let\subtitlerm=\tenrm +\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} + +\parseargdef\title{% + \checkenv\titlepage + \vbox{\titlefonts \raggedtitlesettings #1\par}% + % print a rule at the page bottom also. + \finishedtitlepagefalse + \vskip4pt \hrule height 4pt width \hsize \vskip4pt +} + +\parseargdef\subtitle{% + \checkenv\titlepage + {\subtitlefont \rightline{#1}}% +} + +% @author should come last, but may come many times. +% It can also be used inside @quotation. +% +\parseargdef\author{% + \def\temp{\quotation}% + \ifx\thisenv\temp + \def\quotationauthor{#1}% printed in \Equotation. + \else + \checkenv\titlepage + \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi + {\secfonts\rmisbold \leftline{#1}}% + \fi +} + + +% Set up page headings and footings. + +\let\thispage=\folio + +\newtoks\evenheadline % headline on even pages +\newtoks\oddheadline % headline on odd pages +\newtoks\evenfootline % footline on even pages +\newtoks\oddfootline % footline on odd pages + +% Now make TeX use those variables +\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline + \else \the\evenheadline \fi}} +\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline + \else \the\evenfootline \fi}\HEADINGShook} +\let\HEADINGShook=\relax + +% Commands to set those variables. +% For example, this is what @headings on does +% @evenheading @thistitle|@thispage|@thischapter +% @oddheading @thischapter|@thispage|@thistitle +% @evenfooting @thisfile|| +% @oddfooting ||@thisfile + + +\def\evenheading{\parsearg\evenheadingxxx} +\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} +\def\evenheadingyyy #1\|#2\|#3\|#4\finish{% +\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\def\oddheading{\parsearg\oddheadingxxx} +\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} +\def\oddheadingyyy #1\|#2\|#3\|#4\finish{% +\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% + +\def\evenfooting{\parsearg\evenfootingxxx} +\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} +\def\evenfootingyyy #1\|#2\|#3\|#4\finish{% +\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\def\oddfooting{\parsearg\oddfootingxxx} +\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} +\def\oddfootingyyy #1\|#2\|#3\|#4\finish{% + \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% + % + % Leave some space for the footline. Hopefully ok to assume + % @evenfooting will not be used by itself. + \global\advance\pageheight by -12pt + \global\advance\vsize by -12pt +} + +\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} + +% @evenheadingmarks top \thischapter <- chapter at the top of a page +% @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page +% +% The same set of arguments for: +% +% @oddheadingmarks +% @evenfootingmarks +% @oddfootingmarks +% @everyheadingmarks +% @everyfootingmarks + +\def\evenheadingmarks{\headingmarks{even}{heading}} +\def\oddheadingmarks{\headingmarks{odd}{heading}} +\def\evenfootingmarks{\headingmarks{even}{footing}} +\def\oddfootingmarks{\headingmarks{odd}{footing}} +\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1} + \headingmarks{odd}{heading}{#1} } +\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1} + \headingmarks{odd}{footing}{#1} } +% #1 = even/odd, #2 = heading/footing, #3 = top/bottom. +\def\headingmarks#1#2#3 {% + \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname + \global\expandafter\let\csname get#1#2marks\endcsname \temp +} + +\everyheadingmarks bottom +\everyfootingmarks bottom + +% @headings double turns headings on for double-sided printing. +% @headings single turns headings on for single-sided printing. +% @headings off turns them off. +% @headings on same as @headings double, retained for compatibility. +% @headings after turns on double-sided headings after this page. +% @headings doubleafter turns on double-sided headings after this page. +% @headings singleafter turns on single-sided headings after this page. +% By default, they are off at the start of a document, +% and turned `on' after @end titlepage. + +\def\headings #1 {\csname HEADINGS#1\endcsname} + +\def\headingsoff{% non-global headings elimination + \evenheadline={\hfil}\evenfootline={\hfil}% + \oddheadline={\hfil}\oddfootline={\hfil}% +} + +\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting +\HEADINGSoff % it's the default + +% When we turn headings on, set the page number to 1. +% For double-sided printing, put current file name in lower left corner, +% chapter name on inside top of right hand pages, document +% title on inside top of left hand pages, and page numbers on outside top +% edge of all pages. +\def\HEADINGSdouble{% +\global\pageno=1 +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\folio\hfil\thistitle}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage +} +\let\contentsalignmacro = \chappager + +% For single-sided printing, chapter title goes across top left of page, +% page number on top right. +\def\HEADINGSsingle{% +\global\pageno=1 +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chappager +} +\def\HEADINGSon{\HEADINGSdouble} + +\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} +\let\HEADINGSdoubleafter=\HEADINGSafter +\def\HEADINGSdoublex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\folio\hfil\thistitle}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage +} + +\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} +\def\HEADINGSsinglex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chappager +} + +% Subroutines used in generating headings +% This produces Day Month Year style of output. +% Only define if not already defined, in case a txi-??.tex file has set +% up a different format (e.g., txi-cs.tex does this). +\ifx\today\thisisundefined +\def\today{% + \number\day\space + \ifcase\month + \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr + \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug + \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec + \fi + \space\number\year} +\fi + +% @settitle line... specifies the title of the document, for headings. +% It generates no output of its own. +\def\thistitle{\putwordNoTitle} +\def\settitle{\parsearg{\gdef\thistitle}} + + +\message{tables,} +% Tables -- @table, @ftable, @vtable, @item(x). + +% default indentation of table text +\newdimen\tableindent \tableindent=.8in +% default indentation of @itemize and @enumerate text +\newdimen\itemindent \itemindent=.3in +% margin between end of table item and start of table text. +\newdimen\itemmargin \itemmargin=.1in + +% used internally for \itemindent minus \itemmargin +\newdimen\itemmax + +% Note @table, @ftable, and @vtable define @item, @itemx, etc., with +% these defs. +% They also define \itemindex +% to index the item name in whatever manner is desired (perhaps none). + +\newif\ifitemxneedsnegativevskip + +\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} + +\def\internalBitem{\smallbreak \parsearg\itemzzz} +\def\internalBitemx{\itemxpar \parsearg\itemzzz} + +\def\itemzzz #1{\begingroup % + \advance\hsize by -\rightskip + \advance\hsize by -\tableindent + \setbox0=\hbox{\itemindicate{#1}}% + \itemindex{#1}% + \nobreak % This prevents a break before @itemx. + % + % If the item text does not fit in the space we have, put it on a line + % by itself, and do not allow a page break either before or after that + % line. We do not start a paragraph here because then if the next + % command is, e.g., @kindex, the whatsit would get put into the + % horizontal list on a line by itself, resulting in extra blank space. + \ifdim \wd0>\itemmax + % + % Make this a paragraph so we get the \parskip glue and wrapping, + % but leave it ragged-right. + \begingroup + \advance\leftskip by-\tableindent + \advance\hsize by\tableindent + \advance\rightskip by0pt plus1fil\relax + \leavevmode\unhbox0\par + \endgroup + % + % We're going to be starting a paragraph, but we don't want the + % \parskip glue -- logically it's part of the @item we just started. + \nobreak \vskip-\parskip + % + % Stop a page break at the \parskip glue coming up. However, if + % what follows is an environment such as @example, there will be no + % \parskip glue; then the negative vskip we just inserted would + % cause the example and the item to crash together. So we use this + % bizarre value of 10001 as a signal to \aboveenvbreak to insert + % \parskip glue after all. Section titles are handled this way also. + % + \penalty 10001 + \endgroup + \itemxneedsnegativevskipfalse + \else + % The item text fits into the space. Start a paragraph, so that the + % following text (if any) will end up on the same line. + \noindent + % Do this with kerns and \unhbox so that if there is a footnote in + % the item text, it can migrate to the main vertical list and + % eventually be printed. + \nobreak\kern-\tableindent + \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 + \unhbox0 + \nobreak\kern\dimen0 + \endgroup + \itemxneedsnegativevskiptrue + \fi +} + +\def\item{\errmessage{@item while not in a list environment}} +\def\itemx{\errmessage{@itemx while not in a list environment}} + +% @table, @ftable, @vtable. +\envdef\table{% + \let\itemindex\gobble + \tablecheck{table}% +} +\envdef\ftable{% + \def\itemindex ##1{\doind {fn}{\code{##1}}}% + \tablecheck{ftable}% +} +\envdef\vtable{% + \def\itemindex ##1{\doind {vr}{\code{##1}}}% + \tablecheck{vtable}% +} +\def\tablecheck#1{% + \ifnum \the\catcode`\^^M=\active + \endgroup + \errmessage{This command won't work in this context; perhaps the problem is + that we are \inenvironment\thisenv}% + \def\next{\doignore{#1}}% + \else + \let\next\tablex + \fi + \next +} +\def\tablex#1{% + \def\itemindicate{#1}% + \parsearg\tabley +} +\def\tabley#1{% + {% + \makevalueexpandable + \edef\temp{\noexpand\tablez #1\space\space\space}% + \expandafter + }\temp \endtablez +} +\def\tablez #1 #2 #3 #4\endtablez{% + \aboveenvbreak + \ifnum 0#1>0 \advance \leftskip by #1\mil \fi + \ifnum 0#2>0 \tableindent=#2\mil \fi + \ifnum 0#3>0 \advance \rightskip by #3\mil \fi + \itemmax=\tableindent + \advance \itemmax by -\itemmargin + \advance \leftskip by \tableindent + \exdentamount=\tableindent + \parindent = 0pt + \parskip = \smallskipamount + \ifdim \parskip=0pt \parskip=2pt \fi + \let\item = \internalBitem + \let\itemx = \internalBitemx +} +\def\Etable{\endgraf\afterenvbreak} +\let\Eftable\Etable +\let\Evtable\Etable +\let\Eitemize\Etable +\let\Eenumerate\Etable + +% This is the counter used by @enumerate, which is really @itemize + +\newcount \itemno + +\envdef\itemize{\parsearg\doitemize} + +\def\doitemize#1{% + \aboveenvbreak + \itemmax=\itemindent + \advance\itemmax by -\itemmargin + \advance\leftskip by \itemindent + \exdentamount=\itemindent + \parindent=0pt + \parskip=\smallskipamount + \ifdim\parskip=0pt \parskip=2pt \fi + % + % Try typesetting the item mark that if the document erroneously says + % something like @itemize @samp (intending @table), there's an error + % right away at the @itemize. It's not the best error message in the + % world, but it's better than leaving it to the @item. This means if + % the user wants an empty mark, they have to say @w{} not just @w. + \def\itemcontents{#1}% + \setbox0 = \hbox{\itemcontents}% + % + % @itemize with no arg is equivalent to @itemize @bullet. + \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi + % + \let\item=\itemizeitem +} + +% Definition of @item while inside @itemize and @enumerate. +% +\def\itemizeitem{% + \advance\itemno by 1 % for enumerations + {\let\par=\endgraf \smallbreak}% reasonable place to break + {% + % If the document has an @itemize directly after a section title, a + % \nobreak will be last on the list, and \sectionheading will have + % done a \vskip-\parskip. In that case, we don't want to zero + % parskip, or the item text will crash with the heading. On the + % other hand, when there is normal text preceding the item (as there + % usually is), we do want to zero parskip, or there would be too much + % space. In that case, we won't have a \nobreak before. At least + % that's the theory. + \ifnum\lastpenalty<10000 \parskip=0in \fi + \noindent + \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% + % + \vadjust{\penalty 1200}}% not good to break after first line of item. + \flushcr +} + +% \splitoff TOKENS\endmark defines \first to be the first token in +% TOKENS, and \rest to be the remainder. +% +\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% + +% Allow an optional argument of an uppercase letter, lowercase letter, +% or number, to specify the first label in the enumerated list. No +% argument is the same as `1'. +% +\envparseargdef\enumerate{\enumeratey #1 \endenumeratey} +\def\enumeratey #1 #2\endenumeratey{% + % If we were given no argument, pretend we were given `1'. + \def\thearg{#1}% + \ifx\thearg\empty \def\thearg{1}\fi + % + % Detect if the argument is a single token. If so, it might be a + % letter. Otherwise, the only valid thing it can be is a number. + % (We will always have one token, because of the test we just made. + % This is a good thing, since \splitoff doesn't work given nothing at + % all -- the first parameter is undelimited.) + \expandafter\splitoff\thearg\endmark + \ifx\rest\empty + % Only one token in the argument. It could still be anything. + % A ``lowercase letter'' is one whose \lccode is nonzero. + % An ``uppercase letter'' is one whose \lccode is both nonzero, and + % not equal to itself. + % Otherwise, we assume it's a number. + % + % We need the \relax at the end of the \ifnum lines to stop TeX from + % continuing to look for a . + % + \ifnum\lccode\expandafter`\thearg=0\relax + \numericenumerate % a number (we hope) + \else + % It's a letter. + \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax + \lowercaseenumerate % lowercase letter + \else + \uppercaseenumerate % uppercase letter + \fi + \fi + \else + % Multiple tokens in the argument. We hope it's a number. + \numericenumerate + \fi +} + +% An @enumerate whose labels are integers. The starting integer is +% given in \thearg. +% +\def\numericenumerate{% + \itemno = \thearg + \startenumeration{\the\itemno}% +} + +% The starting (lowercase) letter is in \thearg. +\def\lowercaseenumerate{% + \itemno = \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=0 + \errmessage{No more lowercase letters in @enumerate; get a bigger + alphabet}% + \fi + \char\lccode\itemno + }% +} + +% The starting (uppercase) letter is in \thearg. +\def\uppercaseenumerate{% + \itemno = \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=0 + \errmessage{No more uppercase letters in @enumerate; get a bigger + alphabet} + \fi + \char\uccode\itemno + }% +} + +% Call \doitemize, adding a period to the first argument and supplying the +% common last two arguments. Also subtract one from the initial value in +% \itemno, since @item increments \itemno. +% +\def\startenumeration#1{% + \advance\itemno by -1 + \doitemize{#1.}\flushcr +} + +% @alphaenumerate and @capsenumerate are abbreviations for giving an arg +% to @enumerate. +% +\def\alphaenumerate{\enumerate{a}} +\def\capsenumerate{\enumerate{A}} +\def\Ealphaenumerate{\Eenumerate} +\def\Ecapsenumerate{\Eenumerate} + + +% @multitable macros +% Amy Hendrickson, 8/18/94, 3/6/96 +% +% @multitable ... @end multitable will make as many columns as desired. +% Contents of each column will wrap at width given in preamble. Width +% can be specified either with sample text given in a template line, +% or in percent of \hsize, the current width of text on page. + +% Table can continue over pages but will only break between lines. + +% To make preamble: +% +% Either define widths of columns in terms of percent of \hsize: +% @multitable @columnfractions .25 .3 .45 +% @item ... +% +% Numbers following @columnfractions are the percent of the total +% current hsize to be used for each column. You may use as many +% columns as desired. + + +% Or use a template: +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item ... +% using the widest term desired in each column. + +% Each new table line starts with @item, each subsequent new column +% starts with @tab. Empty columns may be produced by supplying @tab's +% with nothing between them for as many times as empty columns are needed, +% ie, @tab@tab@tab will produce two empty columns. + +% @item, @tab do not need to be on their own lines, but it will not hurt +% if they are. + +% Sample multitable: + +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item first col stuff @tab second col stuff @tab third col +% @item +% first col stuff +% @tab +% second col stuff +% @tab +% third col +% @item first col stuff @tab second col stuff +% @tab Many paragraphs of text may be used in any column. +% +% They will wrap at the width determined by the template. +% @item@tab@tab This will be in third column. +% @end multitable + +% Default dimensions may be reset by user. +% @multitableparskip is vertical space between paragraphs in table. +% @multitableparindent is paragraph indent in table. +% @multitablecolmargin is horizontal space to be left between columns. +% @multitablelinespace is space to leave between table items, baseline +% to baseline. +% 0pt means it depends on current normal line spacing. +% +\newskip\multitableparskip +\newskip\multitableparindent +\newdimen\multitablecolspace +\newskip\multitablelinespace +\multitableparskip=0pt +\multitableparindent=6pt +\multitablecolspace=12pt +\multitablelinespace=0pt + +% Macros used to set up halign preamble: +% +\let\endsetuptable\relax +\def\xendsetuptable{\endsetuptable} +\let\columnfractions\relax +\def\xcolumnfractions{\columnfractions} +\newif\ifsetpercent + +% #1 is the @columnfraction, usually a decimal number like .5, but might +% be just 1. We just use it, whatever it is. +% +\def\pickupwholefraction#1 {% + \global\advance\colcount by 1 + \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% + \setuptable +} + +\newcount\colcount +\def\setuptable#1{% + \def\firstarg{#1}% + \ifx\firstarg\xendsetuptable + \let\go = \relax + \else + \ifx\firstarg\xcolumnfractions + \global\setpercenttrue + \else + \ifsetpercent + \let\go\pickupwholefraction + \else + \global\advance\colcount by 1 + \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a + % separator; typically that is always in the input, anyway. + \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% + \fi + \fi + \ifx\go\pickupwholefraction + % Put the argument back for the \pickupwholefraction call, so + % we'll always have a period there to be parsed. + \def\go{\pickupwholefraction#1}% + \else + \let\go = \setuptable + \fi% + \fi + \go +} + +% multitable-only commands. +% +% @headitem starts a heading row, which we typeset in bold. +% Assignments have to be global since we are inside the implicit group +% of an alignment entry. \everycr resets \everytab so we don't have to +% undo it ourselves. +\def\headitemfont{\b}% for people to use in the template row; not changeable +\def\headitem{% + \checkenv\multitable + \crcr + \global\everytab={\bf}% can't use \headitemfont since the parsing differs + \the\everytab % for the first item +}% +% +% A \tab used to include \hskip1sp. But then the space in a template +% line is not enough. That is bad. So let's go back to just `&' until +% we again encounter the problem the 1sp was intended to solve. +% --karl, nathan@acm.org, 20apr99. +\def\tab{\checkenv\multitable &\the\everytab}% + +% @multitable ... @end multitable definitions: +% +\newtoks\everytab % insert after every tab. +% +\envdef\multitable{% + \vskip\parskip + \startsavinginserts + % + % @item within a multitable starts a normal row. + % We use \def instead of \let so that if one of the multitable entries + % contains an @itemize, we don't choke on the \item (seen as \crcr aka + % \endtemplate) expanding \doitemize. + \def\item{\crcr}% + % + \tolerance=9500 + \hbadness=9500 + \setmultitablespacing + \parskip=\multitableparskip + \parindent=\multitableparindent + \overfullrule=0pt + \global\colcount=0 + % + \everycr = {% + \noalign{% + \global\everytab={}% + \global\colcount=0 % Reset the column counter. + % Check for saved footnotes, etc. + \checkinserts + % Keeps underfull box messages off when table breaks over pages. + %\filbreak + % Maybe so, but it also creates really weird page breaks when the + % table breaks over pages. Wouldn't \vfil be better? Wait until the + % problem manifests itself, so it can be fixed for real --karl. + }% + }% + % + \parsearg\domultitable +} +\def\domultitable#1{% + % To parse everything between @multitable and @item: + \setuptable#1 \endsetuptable + % + % This preamble sets up a generic column definition, which will + % be used as many times as user calls for columns. + % \vtop will set a single line and will also let text wrap and + % continue for many paragraphs if desired. + \halign\bgroup &% + \global\advance\colcount by 1 + \multistrut + \vtop{% + % Use the current \colcount to find the correct column width: + \hsize=\expandafter\csname col\the\colcount\endcsname + % + % In order to keep entries from bumping into each other + % we will add a \leftskip of \multitablecolspace to all columns after + % the first one. + % + % If a template has been used, we will add \multitablecolspace + % to the width of each template entry. + % + % If the user has set preamble in terms of percent of \hsize we will + % use that dimension as the width of the column, and the \leftskip + % will keep entries from bumping into each other. Table will start at + % left margin and final column will justify at right margin. + % + % Make sure we don't inherit \rightskip from the outer environment. + \rightskip=0pt + \ifnum\colcount=1 + % The first column will be indented with the surrounding text. + \advance\hsize by\leftskip + \else + \ifsetpercent \else + % If user has not set preamble in terms of percent of \hsize + % we will advance \hsize by \multitablecolspace. + \advance\hsize by \multitablecolspace + \fi + % In either case we will make \leftskip=\multitablecolspace: + \leftskip=\multitablecolspace + \fi + % Ignoring space at the beginning and end avoids an occasional spurious + % blank line, when TeX decides to break the line at the space before the + % box from the multistrut, so the strut ends up on a line by itself. + % For example: + % @multitable @columnfractions .11 .89 + % @item @code{#} + % @tab Legal holiday which is valid in major parts of the whole country. + % Is automatically provided with highlighting sequences respectively + % marking characters. + \noindent\ignorespaces##\unskip\multistrut + }\cr +} +\def\Emultitable{% + \crcr + \egroup % end the \halign + \global\setpercentfalse +} + +\def\setmultitablespacing{% + \def\multistrut{\strut}% just use the standard line spacing + % + % Compute \multitablelinespace (if not defined by user) for use in + % \multitableparskip calculation. We used define \multistrut based on + % this, but (ironically) that caused the spacing to be off. + % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. +\ifdim\multitablelinespace=0pt +\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip +\global\advance\multitablelinespace by-\ht0 +\fi +% Test to see if parskip is larger than space between lines of +% table. If not, do nothing. +% If so, set to same dimension as multitablelinespace. +\ifdim\multitableparskip>\multitablelinespace +\global\multitableparskip=\multitablelinespace +\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller + % than skip between lines in the table. +\fi% +\ifdim\multitableparskip=0pt +\global\multitableparskip=\multitablelinespace +\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller + % than skip between lines in the table. +\fi} + + +\message{conditionals,} + +% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, +% @ifnotxml always succeed. They currently do nothing; we don't +% attempt to check whether the conditionals are properly nested. But we +% have to remember that they are conditionals, so that @end doesn't +% attempt to close an environment group. +% +\def\makecond#1{% + \expandafter\let\csname #1\endcsname = \relax + \expandafter\let\csname iscond.#1\endcsname = 1 +} +\makecond{iftex} +\makecond{ifnotdocbook} +\makecond{ifnothtml} +\makecond{ifnotinfo} +\makecond{ifnotplaintext} +\makecond{ifnotxml} + +% Ignore @ignore, @ifhtml, @ifinfo, and the like. +% +\def\direntry{\doignore{direntry}} +\def\documentdescription{\doignore{documentdescription}} +\def\docbook{\doignore{docbook}} +\def\html{\doignore{html}} +\def\ifdocbook{\doignore{ifdocbook}} +\def\ifhtml{\doignore{ifhtml}} +\def\ifinfo{\doignore{ifinfo}} +\def\ifnottex{\doignore{ifnottex}} +\def\ifplaintext{\doignore{ifplaintext}} +\def\ifxml{\doignore{ifxml}} +\def\ignore{\doignore{ignore}} +\def\menu{\doignore{menu}} +\def\xml{\doignore{xml}} + +% Ignore text until a line `@end #1', keeping track of nested conditionals. +% +% A count to remember the depth of nesting. +\newcount\doignorecount + +\def\doignore#1{\begingroup + % Scan in ``verbatim'' mode: + \obeylines + \catcode`\@ = \other + \catcode`\{ = \other + \catcode`\} = \other + % + % Make sure that spaces turn into tokens that match what \doignoretext wants. + \spaceisspace + % + % Count number of #1's that we've seen. + \doignorecount = 0 + % + % Swallow text until we reach the matching `@end #1'. + \dodoignore{#1}% +} + +{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. + \obeylines % + % + \gdef\dodoignore#1{% + % #1 contains the command name as a string, e.g., `ifinfo'. + % + % Define a command to find the next `@end #1'. + \long\def\doignoretext##1^^M@end #1{% + \doignoretextyyy##1^^M@#1\_STOP_}% + % + % And this command to find another #1 command, at the beginning of a + % line. (Otherwise, we would consider a line `@c @ifset', for + % example, to count as an @ifset for nesting.) + \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% + % + % And now expand that command. + \doignoretext ^^M% + }% +} + +\def\doignoreyyy#1{% + \def\temp{#1}% + \ifx\temp\empty % Nothing found. + \let\next\doignoretextzzz + \else % Found a nested condition, ... + \advance\doignorecount by 1 + \let\next\doignoretextyyy % ..., look for another. + % If we're here, #1 ends with ^^M\ifinfo (for example). + \fi + \next #1% the token \_STOP_ is present just after this macro. +} + +% We have to swallow the remaining "\_STOP_". +% +\def\doignoretextzzz#1{% + \ifnum\doignorecount = 0 % We have just found the outermost @end. + \let\next\enddoignore + \else % Still inside a nested condition. + \advance\doignorecount by -1 + \let\next\doignoretext % Look for the next @end. + \fi + \next +} + +% Finish off ignored text. +{ \obeylines% + % Ignore anything after the last `@end #1'; this matters in verbatim + % environments, where otherwise the newline after an ignored conditional + % would result in a blank line in the output. + \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% +} + + +% @set VAR sets the variable VAR to an empty value. +% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. +% +% Since we want to separate VAR from REST-OF-LINE (which might be +% empty), we can't just use \parsearg; we have to insert a space of our +% own to delimit the rest of the line, and then take it out again if we +% didn't need it. +% We rely on the fact that \parsearg sets \catcode`\ =10. +% +\parseargdef\set{\setyyy#1 \endsetyyy} +\def\setyyy#1 #2\endsetyyy{% + {% + \makevalueexpandable + \def\temp{#2}% + \edef\next{\gdef\makecsname{SET#1}}% + \ifx\temp\empty + \next{}% + \else + \setzzz#2\endsetzzz + \fi + }% +} +% Remove the trailing space \setxxx inserted. +\def\setzzz#1 \endsetzzz{\next{#1}} + +% @clear VAR clears (i.e., unsets) the variable VAR. +% +\parseargdef\clear{% + {% + \makevalueexpandable + \global\expandafter\let\csname SET#1\endcsname=\relax + }% +} + +% @value{foo} gets the text saved in variable foo. +\def\value{\begingroup\makevalueexpandable\valuexxx} +\def\valuexxx#1{\expandablevalue{#1}\endgroup} +{ + \catcode`\-=\active \catcode`\_=\active + % + \gdef\makevalueexpandable{% + \let\value = \expandablevalue + % We don't want these characters active, ... + \catcode`\-=\other \catcode`\_=\other + % ..., but we might end up with active ones in the argument if + % we're called from @code, as @code{@value{foo-bar_}}, though. + % So \let them to their normal equivalents. + \let-\normaldash \let_\normalunderscore + } +} + +% We have this subroutine so that we can handle at least some @value's +% properly in indexes (we call \makevalueexpandable in \indexdummies). +% The command has to be fully expandable (if the variable is set), since +% the result winds up in the index file. This means that if the +% variable's value contains other Texinfo commands, it's almost certain +% it will fail (although perhaps we could fix that with sufficient work +% to do a one-level expansion on the result, instead of complete). +% +% Unfortunately, this has the consequence that when _ is in the *value* +% of an @set, it does not print properly in the roman fonts (get the cmr +% dot accent at position 126 instead). No fix comes to mind, and it's +% been this way since 2003 or earlier, so just ignore it. +% +\def\expandablevalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + {[No value for ``#1'']}% + \message{Variable `#1', used in @value, is not set.}% + \else + \csname SET#1\endcsname + \fi +} + +% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined +% with @set. +% +% To get the special treatment we need for `@end ifset,' we call +% \makecond and then redefine. +% +\makecond{ifset} +\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} +\def\doifset#1#2{% + {% + \makevalueexpandable + \let\next=\empty + \expandafter\ifx\csname SET#2\endcsname\relax + #1% If not set, redefine \next. + \fi + \expandafter + }\next +} +\def\ifsetfail{\doignore{ifset}} + +% @ifclear VAR ... @end executes the `...' iff VAR has never been +% defined with @set, or has been undefined with @clear. +% +% The `\else' inside the `\doifset' parameter is a trick to reuse the +% above code: if the variable is not set, do nothing, if it is set, +% then redefine \next to \ifclearfail. +% +\makecond{ifclear} +\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} +\def\ifclearfail{\doignore{ifclear}} + +% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written +% without the @) is in fact defined. We can only feasibly check at the +% TeX level, so something like `mathcode' is going to considered +% defined even though it is not a Texinfo command. +% +\makecond{ifcommanddefined} +\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}} +% +\def\doifcmddefined#1#2{{% + \makevalueexpandable + \let\next=\empty + \expandafter\ifx\csname #2\endcsname\relax + #1% If not defined, \let\next as above. + \fi + \expandafter + }\next +} +\def\ifcmddefinedfail{\doignore{ifcommanddefined}} + +% @ifcommandnotdefined CMD ... handled similar to @ifclear above. +\makecond{ifcommandnotdefined} +\def\ifcommandnotdefined{% + \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}} +\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}} + +% Set the `txicommandconditionals' variable, so documents have a way to +% test if the @ifcommand...defined conditionals are available. +\set txicommandconditionals + +% @dircategory CATEGORY -- specify a category of the dir file +% which this file should belong to. Ignore this in TeX. +\let\dircategory=\comment + +% @defininfoenclose. +\let\definfoenclose=\comment + + +\message{indexing,} +% Index generation facilities + +% Define \newwrite to be identical to plain tex's \newwrite +% except not \outer, so it can be used within macros and \if's. +\edef\newwrite{\makecsname{ptexnewwrite}} + +% \newindex {foo} defines an index named foo. +% It automatically defines \fooindex such that +% \fooindex ...rest of line... puts an entry in the index foo. +% It also defines \fooindfile to be the number of the output channel for +% the file that accumulates this index. The file's extension is foo. +% The name of an index should be no more than 2 characters long +% for the sake of vms. +% +\def\newindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 % Open the file + \fi + \expandafter\xdef\csname#1index\endcsname{% % Define @#1index + \noexpand\doindex{#1}} +} + +% @defindex foo == \newindex{foo} +% +\def\defindex{\parsearg\newindex} + +% Define @defcodeindex, like @defindex except put all entries in @code. +% +\def\defcodeindex{\parsearg\newcodeindex} +% +\def\newcodeindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 + \fi + \expandafter\xdef\csname#1index\endcsname{% + \noexpand\docodeindex{#1}}% +} + + +% @synindex foo bar makes index foo feed into index bar. +% Do this instead of @defindex foo if you don't want it as a separate index. +% +% @syncodeindex foo bar similar, but put all entries made for index foo +% inside @code. +% +\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} +\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} + +% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), +% #3 the target index (bar). +\def\dosynindex#1#2#3{% + % Only do \closeout if we haven't already done it, else we'll end up + % closing the target index. + \expandafter \ifx\csname donesynindex#2\endcsname \relax + % The \closeout helps reduce unnecessary open files; the limit on the + % Acorn RISC OS is a mere 16 files. + \expandafter\closeout\csname#2indfile\endcsname + \expandafter\let\csname donesynindex#2\endcsname = 1 + \fi + % redefine \fooindfile: + \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname + \expandafter\let\csname#2indfile\endcsname=\temp + % redefine \fooindex: + \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% +} + +% Define \doindex, the driver for all \fooindex macros. +% Argument #1 is generated by the calling \fooindex macro, +% and it is "foo", the name of the index. + +% \doindex just uses \parsearg; it calls \doind for the actual work. +% This is because \doind is more useful to call from other macros. + +% There is also \dosubind {index}{topic}{subtopic} +% which makes an entry in a two-level index such as the operation index. + +\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} +\def\singleindexer #1{\doind{\indexname}{#1}} + +% like the previous two, but they put @code around the argument. +\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} +\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} + +% Take care of Texinfo commands that can appear in an index entry. +% Since there are some commands we want to expand, and others we don't, +% we have to laboriously prevent expansion for those that we don't. +% +\def\indexdummies{% + \escapechar = `\\ % use backslash in output files. + \def\@{@}% change to @@ when we switch to @ as escape char in index files. + \def\ {\realbackslash\space }% + % + % Need these unexpandable (because we define \tt as a dummy) + % definitions when @{ or @} appear in index entry text. Also, more + % complicated, when \tex is in effect and \{ is a \delimiter again. + % We can't use \lbracecmd and \rbracecmd because texindex assumes + % braces and backslashes are used only as delimiters. Perhaps we + % should define @lbrace and @rbrace commands a la @comma. + \def\{{{\tt\char123}}% + \def\}{{\tt\char125}}% + % + % I don't entirely understand this, but when an index entry is + % generated from a macro call, the \endinput which \scanmacro inserts + % causes processing to be prematurely terminated. This is, + % apparently, because \indexsorttmp is fully expanded, and \endinput + % is an expandable command. The redefinition below makes \endinput + % disappear altogether for that purpose -- although logging shows that + % processing continues to some further point. On the other hand, it + % seems \endinput does not hurt in the printed index arg, since that + % is still getting written without apparent harm. + % + % Sample source (mac-idx3.tex, reported by Graham Percival to + % help-texinfo, 22may06): + % @macro funindex {WORD} + % @findex xyz + % @end macro + % ... + % @funindex commtest + % + % The above is not enough to reproduce the bug, but it gives the flavor. + % + % Sample whatsit resulting: + % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} + % + % So: + \let\endinput = \empty + % + % Do the redefinitions. + \commondummies +} + +% For the aux and toc files, @ is the escape character. So we want to +% redefine everything using @ as the escape character (instead of +% \realbackslash, still used for index files). When everything uses @, +% this will be simpler. +% +\def\atdummies{% + \def\@{@@}% + \def\ {@ }% + \let\{ = \lbraceatcmd + \let\} = \rbraceatcmd + % + % Do the redefinitions. + \commondummies + \otherbackslash +} + +% Called from \indexdummies and \atdummies. +% +\def\commondummies{% + % + % \definedummyword defines \#1 as \string\#1\space, thus effectively + % preventing its expansion. This is used only for control words, + % not control letters, because the \space would be incorrect for + % control characters, but is needed to separate the control word + % from whatever follows. + % + % For control letters, we have \definedummyletter, which omits the + % space. + % + % These can be used both for control words that take an argument and + % those that do not. If it is followed by {arg} in the input, then + % that will dutifully get written to the index (or wherever). + % + \def\definedummyword ##1{\def##1{\string##1\space}}% + \def\definedummyletter##1{\def##1{\string##1}}% + \let\definedummyaccent\definedummyletter + % + \commondummiesnofonts + % + \definedummyletter\_% + \definedummyletter\-% + % + % Non-English letters. + \definedummyword\AA + \definedummyword\AE + \definedummyword\DH + \definedummyword\L + \definedummyword\O + \definedummyword\OE + \definedummyword\TH + \definedummyword\aa + \definedummyword\ae + \definedummyword\dh + \definedummyword\exclamdown + \definedummyword\l + \definedummyword\o + \definedummyword\oe + \definedummyword\ordf + \definedummyword\ordm + \definedummyword\questiondown + \definedummyword\ss + \definedummyword\th + % + % Although these internal commands shouldn't show up, sometimes they do. + \definedummyword\bf + \definedummyword\gtr + \definedummyword\hat + \definedummyword\less + \definedummyword\sf + \definedummyword\sl + \definedummyword\tclose + \definedummyword\tt + % + \definedummyword\LaTeX + \definedummyword\TeX + % + % Assorted special characters. + \definedummyword\arrow + \definedummyword\bullet + \definedummyword\comma + \definedummyword\copyright + \definedummyword\registeredsymbol + \definedummyword\dots + \definedummyword\enddots + \definedummyword\entrybreak + \definedummyword\equiv + \definedummyword\error + \definedummyword\euro + \definedummyword\expansion + \definedummyword\geq + \definedummyword\guillemetleft + \definedummyword\guillemetright + \definedummyword\guilsinglleft + \definedummyword\guilsinglright + \definedummyword\lbracechar + \definedummyword\leq + \definedummyword\minus + \definedummyword\ogonek + \definedummyword\pounds + \definedummyword\point + \definedummyword\print + \definedummyword\quotedblbase + \definedummyword\quotedblleft + \definedummyword\quotedblright + \definedummyword\quoteleft + \definedummyword\quoteright + \definedummyword\quotesinglbase + \definedummyword\rbracechar + \definedummyword\result + \definedummyword\textdegree + % + % We want to disable all macros so that they are not expanded by \write. + \macrolist + % + \normalturnoffactive + % + % Handle some cases of @value -- where it does not contain any + % (non-fully-expandable) commands. + \makevalueexpandable +} + +% \commondummiesnofonts: common to \commondummies and \indexnofonts. +% +\def\commondummiesnofonts{% + % Control letters and accents. + \definedummyletter\!% + \definedummyaccent\"% + \definedummyaccent\'% + \definedummyletter\*% + \definedummyaccent\,% + \definedummyletter\.% + \definedummyletter\/% + \definedummyletter\:% + \definedummyaccent\=% + \definedummyletter\?% + \definedummyaccent\^% + \definedummyaccent\`% + \definedummyaccent\~% + \definedummyword\u + \definedummyword\v + \definedummyword\H + \definedummyword\dotaccent + \definedummyword\ogonek + \definedummyword\ringaccent + \definedummyword\tieaccent + \definedummyword\ubaraccent + \definedummyword\udotaccent + \definedummyword\dotless + % + % Texinfo font commands. + \definedummyword\b + \definedummyword\i + \definedummyword\r + \definedummyword\sansserif + \definedummyword\sc + \definedummyword\slanted + \definedummyword\t + % + % Commands that take arguments. + \definedummyword\abbr + \definedummyword\acronym + \definedummyword\anchor + \definedummyword\cite + \definedummyword\code + \definedummyword\command + \definedummyword\dfn + \definedummyword\dmn + \definedummyword\email + \definedummyword\emph + \definedummyword\env + \definedummyword\file + \definedummyword\image + \definedummyword\indicateurl + \definedummyword\inforef + \definedummyword\kbd + \definedummyword\key + \definedummyword\math + \definedummyword\option + \definedummyword\pxref + \definedummyword\ref + \definedummyword\samp + \definedummyword\strong + \definedummyword\tie + \definedummyword\uref + \definedummyword\url + \definedummyword\var + \definedummyword\verb + \definedummyword\w + \definedummyword\xref +} + +% \indexnofonts is used when outputting the strings to sort the index +% by, and when constructing control sequence names. It eliminates all +% control sequences and just writes whatever the best ASCII sort string +% would be for a given command (usually its argument). +% +\def\indexnofonts{% + % Accent commands should become @asis. + \def\definedummyaccent##1{\let##1\asis}% + % We can just ignore other control letters. + \def\definedummyletter##1{\let##1\empty}% + % All control words become @asis by default; overrides below. + \let\definedummyword\definedummyaccent + % + \commondummiesnofonts + % + % Don't no-op \tt, since it isn't a user-level command + % and is used in the definitions of the active chars like <, >, |, etc. + % Likewise with the other plain tex font commands. + %\let\tt=\asis + % + \def\ { }% + \def\@{@}% + \def\_{\normalunderscore}% + \def\-{}% @- shouldn't affect sorting + % + % Unfortunately, texindex is not prepared to handle braces in the + % content at all. So for index sorting, we map @{ and @} to strings + % starting with |, since that ASCII character is between ASCII { and }. + \def\{{|a}% + \def\lbracechar{|a}% + % + \def\}{|b}% + \def\rbracechar{|b}% + % + % Non-English letters. + \def\AA{AA}% + \def\AE{AE}% + \def\DH{DZZ}% + \def\L{L}% + \def\OE{OE}% + \def\O{O}% + \def\TH{ZZZ}% + \def\aa{aa}% + \def\ae{ae}% + \def\dh{dzz}% + \def\exclamdown{!}% + \def\l{l}% + \def\oe{oe}% + \def\ordf{a}% + \def\ordm{o}% + \def\o{o}% + \def\questiondown{?}% + \def\ss{ss}% + \def\th{zzz}% + % + \def\LaTeX{LaTeX}% + \def\TeX{TeX}% + % + % Assorted special characters. + % (The following {} will end up in the sort string, but that's ok.) + \def\arrow{->}% + \def\bullet{bullet}% + \def\comma{,}% + \def\copyright{copyright}% + \def\dots{...}% + \def\enddots{...}% + \def\equiv{==}% + \def\error{error}% + \def\euro{euro}% + \def\expansion{==>}% + \def\geq{>=}% + \def\guillemetleft{<<}% + \def\guillemetright{>>}% + \def\guilsinglleft{<}% + \def\guilsinglright{>}% + \def\leq{<=}% + \def\minus{-}% + \def\point{.}% + \def\pounds{pounds}% + \def\print{-|}% + \def\quotedblbase{"}% + \def\quotedblleft{"}% + \def\quotedblright{"}% + \def\quoteleft{`}% + \def\quoteright{'}% + \def\quotesinglbase{,}% + \def\registeredsymbol{R}% + \def\result{=>}% + \def\textdegree{o}% + % + \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax + \else \indexlquoteignore \fi + % + % We need to get rid of all macros, leaving only the arguments (if present). + % Of course this is not nearly correct, but it is the best we can do for now. + % makeinfo does not expand macros in the argument to @deffn, which ends up + % writing an index entry, and texindex isn't prepared for an index sort entry + % that starts with \. + % + % Since macro invocations are followed by braces, we can just redefine them + % to take a single TeX argument. The case of a macro invocation that + % goes to end-of-line is not handled. + % + \macrolist +} + +% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us +% ignore left quotes in the sort term. +{\catcode`\`=\active + \gdef\indexlquoteignore{\let`=\empty}} + +\let\indexbackslash=0 %overridden during \printindex. +\let\SETmarginindex=\relax % put index entries in margin (undocumented)? + +% Most index entries go through here, but \dosubind is the general case. +% #1 is the index name, #2 is the entry text. +\def\doind#1#2{\dosubind{#1}{#2}{}} + +% Workhorse for all \fooindexes. +% #1 is name of index, #2 is stuff to put there, #3 is subentry -- +% empty if called from \doind, as we usually are (the main exception +% is with most defuns, which call us directly). +% +\def\dosubind#1#2#3{% + \iflinks + {% + % Store the main index entry text (including the third arg). + \toks0 = {#2}% + % If third arg is present, precede it with a space. + \def\thirdarg{#3}% + \ifx\thirdarg\empty \else + \toks0 = \expandafter{\the\toks0 \space #3}% + \fi + % + \edef\writeto{\csname#1indfile\endcsname}% + % + \safewhatsit\dosubindwrite + }% + \fi +} + +% Write the entry in \toks0 to the index file: +% +\def\dosubindwrite{% + % Put the index entry in the margin if desired. + \ifx\SETmarginindex\relax\else + \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% + \fi + % + % Remember, we are within a group. + \indexdummies % Must do this here, since \bf, etc expand at this stage + \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now + % so it will be output as is; and it will print as backslash. + % + % Process the index entry with all font commands turned off, to + % get the string to sort by. + {\indexnofonts + \edef\temp{\the\toks0}% need full expansion + \xdef\indexsorttmp{\temp}% + }% + % + % Set up the complete index entry, with both the sort key and + % the original text, including any font commands. We write + % three arguments to \entry to the .?? file (four in the + % subentry case), texindex reduces to two when writing the .??s + % sorted result. + \edef\temp{% + \write\writeto{% + \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% + }% + \temp +} + +% Take care of unwanted page breaks/skips around a whatsit: +% +% If a skip is the last thing on the list now, preserve it +% by backing up by \lastskip, doing the \write, then inserting +% the skip again. Otherwise, the whatsit generated by the +% \write or \pdfdest will make \lastskip zero. The result is that +% sequences like this: +% @end defun +% @tindex whatever +% @defun ... +% will have extra space inserted, because the \medbreak in the +% start of the @defun won't see the skip inserted by the @end of +% the previous defun. +% +% But don't do any of this if we're not in vertical mode. We +% don't want to do a \vskip and prematurely end a paragraph. +% +% Avoid page breaks due to these extra skips, too. +% +% But wait, there is a catch there: +% We'll have to check whether \lastskip is zero skip. \ifdim is not +% sufficient for this purpose, as it ignores stretch and shrink parts +% of the skip. The only way seems to be to check the textual +% representation of the skip. +% +% The following is almost like \def\zeroskipmacro{0.0pt} except that +% the ``p'' and ``t'' characters have catcode \other, not 11 (letter). +% +\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} +% +\newskip\whatsitskip +\newcount\whatsitpenalty +% +% ..., ready, GO: +% +\def\safewhatsit#1{\ifhmode + #1% + \else + % \lastskip and \lastpenalty cannot both be nonzero simultaneously. + \whatsitskip = \lastskip + \edef\lastskipmacro{\the\lastskip}% + \whatsitpenalty = \lastpenalty + % + % If \lastskip is nonzero, that means the last item was a + % skip. And since a skip is discardable, that means this + % -\whatsitskip glue we're inserting is preceded by a + % non-discardable item, therefore it is not a potential + % breakpoint, therefore no \nobreak needed. + \ifx\lastskipmacro\zeroskipmacro + \else + \vskip-\whatsitskip + \fi + % + #1% + % + \ifx\lastskipmacro\zeroskipmacro + % If \lastskip was zero, perhaps the last item was a penalty, and + % perhaps it was >=10000, e.g., a \nobreak. In that case, we want + % to re-insert the same penalty (values >10000 are used for various + % signals); since we just inserted a non-discardable item, any + % following glue (such as a \parskip) would be a breakpoint. For example: + % @deffn deffn-whatever + % @vindex index-whatever + % Description. + % would allow a break between the index-whatever whatsit + % and the "Description." paragraph. + \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi + \else + % On the other hand, if we had a nonzero \lastskip, + % this make-up glue would be preceded by a non-discardable item + % (the whatsit from the \write), so we must insert a \nobreak. + \nobreak\vskip\whatsitskip + \fi +\fi} + +% The index entry written in the file actually looks like +% \entry {sortstring}{page}{topic} +% or +% \entry {sortstring}{page}{topic}{subtopic} +% The texindex program reads in these files and writes files +% containing these kinds of lines: +% \initial {c} +% before the first topic whose initial is c +% \entry {topic}{pagelist} +% for a topic that is used without subtopics +% \primary {topic} +% for the beginning of a topic that is used with subtopics +% \secondary {subtopic}{pagelist} +% for each subtopic. + +% Define the user-accessible indexing commands +% @findex, @vindex, @kindex, @cindex. + +\def\findex {\fnindex} +\def\kindex {\kyindex} +\def\cindex {\cpindex} +\def\vindex {\vrindex} +\def\tindex {\tpindex} +\def\pindex {\pgindex} + +\def\cindexsub {\begingroup\obeylines\cindexsub} +{\obeylines % +\gdef\cindexsub "#1" #2^^M{\endgroup % +\dosubind{cp}{#2}{#1}}} + +% Define the macros used in formatting output of the sorted index material. + +% @printindex causes a particular index (the ??s file) to get printed. +% It does not print any chapter heading (usually an @unnumbered). +% +\parseargdef\printindex{\begingroup + \dobreak \chapheadingskip{10000}% + % + \smallfonts \rm + \tolerance = 9500 + \plainfrenchspacing + \everypar = {}% don't want the \kern\-parindent from indentation suppression. + % + % See if the index file exists and is nonempty. + % Change catcode of @ here so that if the index file contains + % \initial {@} + % as its first line, TeX doesn't complain about mismatched braces + % (because it thinks @} is a control sequence). + \catcode`\@ = 11 + \openin 1 \jobname.#1s + \ifeof 1 + % \enddoublecolumns gets confused if there is no text in the index, + % and it loses the chapter title and the aux file entries for the + % index. The easiest way to prevent this problem is to make sure + % there is some text. + \putwordIndexNonexistent + \else + % + % If the index file exists but is empty, then \openin leaves \ifeof + % false. We have to make TeX try to read something from the file, so + % it can discover if there is anything in it. + \read 1 to \temp + \ifeof 1 + \putwordIndexIsEmpty + \else + % Index files are almost Texinfo source, but we use \ as the escape + % character. It would be better to use @, but that's too big a change + % to make right now. + \def\indexbackslash{\backslashcurfont}% + \catcode`\\ = 0 + \escapechar = `\\ + \begindoublecolumns + \input \jobname.#1s + \enddoublecolumns + \fi + \fi + \closein 1 +\endgroup} + +% These macros are used by the sorted index file itself. +% Change them to control the appearance of the index. + +\def\initial#1{{% + % Some minor font changes for the special characters. + \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt + % + % Remove any glue we may have, we'll be inserting our own. + \removelastskip + % + % We like breaks before the index initials, so insert a bonus. + \nobreak + \vskip 0pt plus 3\baselineskip + \penalty 0 + \vskip 0pt plus -3\baselineskip + % + % Typeset the initial. Making this add up to a whole number of + % baselineskips increases the chance of the dots lining up from column + % to column. It still won't often be perfect, because of the stretch + % we need before each entry, but it's better. + % + % No shrink because it confuses \balancecolumns. + \vskip 1.67\baselineskip plus .5\baselineskip + \leftline{\secbf #1}% + % Do our best not to break after the initial. + \nobreak + \vskip .33\baselineskip plus .1\baselineskip +}} + +% \entry typesets a paragraph consisting of the text (#1), dot leaders, and +% then page number (#2) flushed to the right margin. It is used for index +% and table of contents entries. The paragraph is indented by \leftskip. +% +% A straightforward implementation would start like this: +% \def\entry#1#2{... +% But this freezes the catcodes in the argument, and can cause problems to +% @code, which sets - active. This problem was fixed by a kludge--- +% ``-'' was active throughout whole index, but this isn't really right. +% The right solution is to prevent \entry from swallowing the whole text. +% --kasal, 21nov03 +\def\entry{% + \begingroup + % + % Start a new paragraph if necessary, so our assignments below can't + % affect previous text. + \par + % + % Do not fill out the last line with white space. + \parfillskip = 0in + % + % No extra space above this paragraph. + \parskip = 0in + % + % Do not prefer a separate line ending with a hyphen to fewer lines. + \finalhyphendemerits = 0 + % + % \hangindent is only relevant when the entry text and page number + % don't both fit on one line. In that case, bob suggests starting the + % dots pretty far over on the line. Unfortunately, a large + % indentation looks wrong when the entry text itself is broken across + % lines. So we use a small indentation and put up with long leaders. + % + % \hangafter is reset to 1 (which is the value we want) at the start + % of each paragraph, so we need not do anything with that. + \hangindent = 2em + % + % When the entry text needs to be broken, just fill out the first line + % with blank space. + \rightskip = 0pt plus1fil + % + % A bit of stretch before each entry for the benefit of balancing + % columns. + \vskip 0pt plus1pt + % + % When reading the text of entry, convert explicit line breaks + % from @* into spaces. The user might give these in long section + % titles, for instance. + \def\*{\unskip\space\ignorespaces}% + \def\entrybreak{\hfil\break}% + % + % Swallow the left brace of the text (first parameter): + \afterassignment\doentry + \let\temp = +} +\def\entrybreak{\unskip\space\ignorespaces}% +\def\doentry{% + \bgroup % Instead of the swallowed brace. + \noindent + \aftergroup\finishentry + % And now comes the text of the entry. +} +\def\finishentry#1{% + % #1 is the page number. + % + % The following is kludged to not output a line of dots in the index if + % there are no page numbers. The next person who breaks this will be + % cursed by a Unix daemon. + \setbox\boxA = \hbox{#1}% + \ifdim\wd\boxA = 0pt + \ % + \else + % + % If we must, put the page number on a line of its own, and fill out + % this line with blank space. (The \hfil is overwhelmed with the + % fill leaders glue in \indexdotfill if the page number does fit.) + \hfil\penalty50 + \null\nobreak\indexdotfill % Have leaders before the page number. + % + % The `\ ' here is removed by the implicit \unskip that TeX does as + % part of (the primitive) \par. Without it, a spurious underfull + % \hbox ensues. + \ifpdf + \pdfgettoks#1.% + \ \the\toksA + \else + \ #1% + \fi + \fi + \par + \endgroup +} + +% Like plain.tex's \dotfill, except uses up at least 1 em. +\def\indexdotfill{\cleaders + \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill} + +\def\primary #1{\line{#1\hfil}} + +\newskip\secondaryindent \secondaryindent=0.5cm +\def\secondary#1#2{{% + \parfillskip=0in + \parskip=0in + \hangindent=1in + \hangafter=1 + \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill + \ifpdf + \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + \else + #2 + \fi + \par +}} + +% Define two-column mode, which we use to typeset indexes. +% Adapted from the TeXbook, page 416, which is to say, +% the manmac.tex format used to print the TeXbook itself. +\catcode`\@=11 + +\newbox\partialpage +\newdimen\doublecolumnhsize + +\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns + % Grab any single-column material above us. + \output = {% + % + % Here is a possibility not foreseen in manmac: if we accumulate a + % whole lot of material, we might end up calling this \output + % routine twice in a row (see the doublecol-lose test, which is + % essentially a couple of indexes with @setchapternewpage off). In + % that case we just ship out what is in \partialpage with the normal + % output routine. Generally, \partialpage will be empty when this + % runs and this will be a no-op. See the indexspread.tex test case. + \ifvoid\partialpage \else + \onepageout{\pagecontents\partialpage}% + \fi + % + \global\setbox\partialpage = \vbox{% + % Unvbox the main output page. + \unvbox\PAGE + \kern-\topskip \kern\baselineskip + }% + }% + \eject % run that output routine to set \partialpage + % + % Use the double-column output routine for subsequent pages. + \output = {\doublecolumnout}% + % + % Change the page size parameters. We could do this once outside this + % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 + % format, but then we repeat the same computation. Repeating a couple + % of assignments once per index is clearly meaningless for the + % execution time, so we may as well do it in one place. + % + % First we halve the line length, less a little for the gutter between + % the columns. We compute the gutter based on the line length, so it + % changes automatically with the paper format. The magic constant + % below is chosen so that the gutter has the same value (well, +-<1pt) + % as it did when we hard-coded it. + % + % We put the result in a separate register, \doublecolumhsize, so we + % can restore it in \pagesofar, after \hsize itself has (potentially) + % been clobbered. + % + \doublecolumnhsize = \hsize + \advance\doublecolumnhsize by -.04154\hsize + \divide\doublecolumnhsize by 2 + \hsize = \doublecolumnhsize + % + % Double the \vsize as well. (We don't need a separate register here, + % since nobody clobbers \vsize.) + \vsize = 2\vsize +} + +% The double-column output routine for all double-column pages except +% the last. +% +\def\doublecolumnout{% + \splittopskip=\topskip \splitmaxdepth=\maxdepth + % Get the available space for the double columns -- the normal + % (undoubled) page height minus any material left over from the + % previous page. + \dimen@ = \vsize + \divide\dimen@ by 2 + \advance\dimen@ by -\ht\partialpage + % + % box0 will be the left-hand column, box2 the right. + \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ + \onepageout\pagesofar + \unvbox255 + \penalty\outputpenalty +} +% +% Re-output the contents of the output page -- any previous material, +% followed by the two boxes we just split, in box0 and box2. +\def\pagesofar{% + \unvbox\partialpage + % + \hsize = \doublecolumnhsize + \wd0=\hsize \wd2=\hsize + \hbox to\pagewidth{\box0\hfil\box2}% +} +% +% All done with double columns. +\def\enddoublecolumns{% + % The following penalty ensures that the page builder is exercised + % _before_ we change the output routine. This is necessary in the + % following situation: + % + % The last section of the index consists only of a single entry. + % Before this section, \pagetotal is less than \pagegoal, so no + % break occurs before the last section starts. However, the last + % section, consisting of \initial and the single \entry, does not + % fit on the page and has to be broken off. Without the following + % penalty the page builder will not be exercised until \eject + % below, and by that time we'll already have changed the output + % routine to the \balancecolumns version, so the next-to-last + % double-column page will be processed with \balancecolumns, which + % is wrong: The two columns will go to the main vertical list, with + % the broken-off section in the recent contributions. As soon as + % the output routine finishes, TeX starts reconsidering the page + % break. The two columns and the broken-off section both fit on the + % page, because the two columns now take up only half of the page + % goal. When TeX sees \eject from below which follows the final + % section, it invokes the new output routine that we've set after + % \balancecolumns below; \onepageout will try to fit the two columns + % and the final section into the vbox of \pageheight (see + % \pagebody), causing an overfull box. + % + % Note that glue won't work here, because glue does not exercise the + % page builder, unlike penalties (see The TeXbook, pp. 280-281). + \penalty0 + % + \output = {% + % Split the last of the double-column material. Leave it on the + % current page, no automatic page break. + \balancecolumns + % + % If we end up splitting too much material for the current page, + % though, there will be another page break right after this \output + % invocation ends. Having called \balancecolumns once, we do not + % want to call it again. Therefore, reset \output to its normal + % definition right away. (We hope \balancecolumns will never be + % called on to balance too much material, but if it is, this makes + % the output somewhat more palatable.) + \global\output = {\onepageout{\pagecontents\PAGE}}% + }% + \eject + \endgroup % started in \begindoublecolumns + % + % \pagegoal was set to the doubled \vsize above, since we restarted + % the current page. We're now back to normal single-column + % typesetting, so reset \pagegoal to the normal \vsize (after the + % \endgroup where \vsize got restored). + \pagegoal = \vsize +} +% +% Called at the end of the double column material. +\def\balancecolumns{% + \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. + \dimen@ = \ht0 + \advance\dimen@ by \topskip + \advance\dimen@ by-\baselineskip + \divide\dimen@ by 2 % target to split to + %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% + \splittopskip = \topskip + % Loop until we get a decent breakpoint. + {% + \vbadness = 10000 + \loop + \global\setbox3 = \copy0 + \global\setbox1 = \vsplit3 to \dimen@ + \ifdim\ht3>\dimen@ + \global\advance\dimen@ by 1pt + \repeat + }% + %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% + \setbox0=\vbox to\dimen@{\unvbox1}% + \setbox2=\vbox to\dimen@{\unvbox3}% + % + \pagesofar +} +\catcode`\@ = \other + + +\message{sectioning,} +% Chapters, sections, etc. + +% Let's start with @part. +\outer\parseargdef\part{\partzzz{#1}} +\def\partzzz#1{% + \chapoddpage + \null + \vskip.3\vsize % move it down on the page a bit + \begingroup + \noindent \titlefonts\rmisbold #1\par % the text + \let\lastnode=\empty % no node to associate with + \writetocentry{part}{#1}{}% but put it in the toc + \headingsoff % no headline or footline on the part page + \chapoddpage + \endgroup +} + +% \unnumberedno is an oxymoron. But we count the unnumbered +% sections so that we can refer to them unambiguously in the pdf +% outlines by their "section number". We avoid collisions with chapter +% numbers by starting them at 10000. (If a document ever has 10000 +% chapters, we're in trouble anyway, I'm sure.) +\newcount\unnumberedno \unnumberedno = 10000 +\newcount\chapno +\newcount\secno \secno=0 +\newcount\subsecno \subsecno=0 +\newcount\subsubsecno \subsubsecno=0 + +% This counter is funny since it counts through charcodes of letters A, B, ... +\newcount\appendixno \appendixno = `\@ +% +% \def\appendixletter{\char\the\appendixno} +% We do the following ugly conditional instead of the above simple +% construct for the sake of pdftex, which needs the actual +% letter in the expansion, not just typeset. +% +\def\appendixletter{% + \ifnum\appendixno=`A A% + \else\ifnum\appendixno=`B B% + \else\ifnum\appendixno=`C C% + \else\ifnum\appendixno=`D D% + \else\ifnum\appendixno=`E E% + \else\ifnum\appendixno=`F F% + \else\ifnum\appendixno=`G G% + \else\ifnum\appendixno=`H H% + \else\ifnum\appendixno=`I I% + \else\ifnum\appendixno=`J J% + \else\ifnum\appendixno=`K K% + \else\ifnum\appendixno=`L L% + \else\ifnum\appendixno=`M M% + \else\ifnum\appendixno=`N N% + \else\ifnum\appendixno=`O O% + \else\ifnum\appendixno=`P P% + \else\ifnum\appendixno=`Q Q% + \else\ifnum\appendixno=`R R% + \else\ifnum\appendixno=`S S% + \else\ifnum\appendixno=`T T% + \else\ifnum\appendixno=`U U% + \else\ifnum\appendixno=`V V% + \else\ifnum\appendixno=`W W% + \else\ifnum\appendixno=`X X% + \else\ifnum\appendixno=`Y Y% + \else\ifnum\appendixno=`Z Z% + % The \the is necessary, despite appearances, because \appendixletter is + % expanded while writing the .toc file. \char\appendixno is not + % expandable, thus it is written literally, thus all appendixes come out + % with the same letter (or @) in the toc without it. + \else\char\the\appendixno + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} + +% Each @chapter defines these (using marks) as the number+name, number +% and name of the chapter. Page headings and footings can use +% these. @section does likewise. +\def\thischapter{} +\def\thischapternum{} +\def\thischaptername{} +\def\thissection{} +\def\thissectionnum{} +\def\thissectionname{} + +\newcount\absseclevel % used to calculate proper heading level +\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count + +% @raisesections: treat @section as chapter, @subsection as section, etc. +\def\raisesections{\global\advance\secbase by -1} +\let\up=\raisesections % original BFox name + +% @lowersections: treat @chapter as section, @section as subsection, etc. +\def\lowersections{\global\advance\secbase by 1} +\let\down=\lowersections % original BFox name + +% we only have subsub. +\chardef\maxseclevel = 3 +% +% A numbered section within an unnumbered changes to unnumbered too. +% To achieve this, remember the "biggest" unnum. sec. we are currently in: +\chardef\unnlevel = \maxseclevel +% +% Trace whether the current chapter is an appendix or not: +% \chapheadtype is "N" or "A", unnumbered chapters are ignored. +\def\chapheadtype{N} + +% Choose a heading macro +% #1 is heading type +% #2 is heading level +% #3 is text for heading +\def\genhead#1#2#3{% + % Compute the abs. sec. level: + \absseclevel=#2 + \advance\absseclevel by \secbase + % Make sure \absseclevel doesn't fall outside the range: + \ifnum \absseclevel < 0 + \absseclevel = 0 + \else + \ifnum \absseclevel > 3 + \absseclevel = 3 + \fi + \fi + % The heading type: + \def\headtype{#1}% + \if \headtype U% + \ifnum \absseclevel < \unnlevel + \chardef\unnlevel = \absseclevel + \fi + \else + % Check for appendix sections: + \ifnum \absseclevel = 0 + \edef\chapheadtype{\headtype}% + \else + \if \headtype A\if \chapheadtype N% + \errmessage{@appendix... within a non-appendix chapter}% + \fi\fi + \fi + % Check for numbered within unnumbered: + \ifnum \absseclevel > \unnlevel + \def\headtype{U}% + \else + \chardef\unnlevel = 3 + \fi + \fi + % Now print the heading: + \if \headtype U% + \ifcase\absseclevel + \unnumberedzzz{#3}% + \or \unnumberedseczzz{#3}% + \or \unnumberedsubseczzz{#3}% + \or \unnumberedsubsubseczzz{#3}% + \fi + \else + \if \headtype A% + \ifcase\absseclevel + \appendixzzz{#3}% + \or \appendixsectionzzz{#3}% + \or \appendixsubseczzz{#3}% + \or \appendixsubsubseczzz{#3}% + \fi + \else + \ifcase\absseclevel + \chapterzzz{#3}% + \or \seczzz{#3}% + \or \numberedsubseczzz{#3}% + \or \numberedsubsubseczzz{#3}% + \fi + \fi + \fi + \suppressfirstparagraphindent +} + +% an interface: +\def\numhead{\genhead N} +\def\apphead{\genhead A} +\def\unnmhead{\genhead U} + +% @chapter, @appendix, @unnumbered. Increment top-level counter, reset +% all lower-level sectioning counters to zero. +% +% Also set \chaplevelprefix, which we prepend to @float sequence numbers +% (e.g., figures), q.v. By default (before any chapter), that is empty. +\let\chaplevelprefix = \empty +% +\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz +\def\chapterzzz#1{% + % section resetting is \global in case the chapter is in a group, such + % as an @include file. + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\chapno by 1 + % + % Used for \float. + \gdef\chaplevelprefix{\the\chapno.}% + \resetallfloatnos + % + % \putwordChapter can contain complex things in translations. + \toks0=\expandafter{\putwordChapter}% + \message{\the\toks0 \space \the\chapno}% + % + % Write the actual heading. + \chapmacro{#1}{Ynumbered}{\the\chapno}% + % + % So @section and the like are numbered underneath this chapter. + \global\let\section = \numberedsec + \global\let\subsection = \numberedsubsec + \global\let\subsubsection = \numberedsubsubsec +} + +\outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz +% +\def\appendixzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\appendixno by 1 + \gdef\chaplevelprefix{\appendixletter.}% + \resetallfloatnos + % + % \putwordAppendix can contain complex things in translations. + \toks0=\expandafter{\putwordAppendix}% + \message{\the\toks0 \space \appendixletter}% + % + \chapmacro{#1}{Yappendix}{\appendixletter}% + % + \global\let\section = \appendixsec + \global\let\subsection = \appendixsubsec + \global\let\subsubsection = \appendixsubsubsec +} + +% normally unnmhead0 calls unnumberedzzz: +\outer\parseargdef\unnumbered{\unnmhead0{#1}} +\def\unnumberedzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\unnumberedno by 1 + % + % Since an unnumbered has no number, no prefix for figures. + \global\let\chaplevelprefix = \empty + \resetallfloatnos + % + % This used to be simply \message{#1}, but TeX fully expands the + % argument to \message. Therefore, if #1 contained @-commands, TeX + % expanded them. For example, in `@unnumbered The @cite{Book}', TeX + % expanded @cite (which turns out to cause errors because \cite is meant + % to be executed, not expanded). + % + % Anyway, we don't want the fully-expanded definition of @cite to appear + % as a result of the \message, we just want `@cite' itself. We use + % \the to achieve this: TeX expands \the only once, + % simply yielding the contents of . (We also do this for + % the toc entries.) + \toks0 = {#1}% + \message{(\the\toks0)}% + % + \chapmacro{#1}{Ynothing}{\the\unnumberedno}% + % + \global\let\section = \unnumberedsec + \global\let\subsection = \unnumberedsubsec + \global\let\subsubsection = \unnumberedsubsubsec +} + +% @centerchap is like @unnumbered, but the heading is centered. +\outer\parseargdef\centerchap{% + % Well, we could do the following in a group, but that would break + % an assumption that \chapmacro is called at the outermost level. + % Thus we are safer this way: --kasal, 24feb04 + \let\centerparametersmaybe = \centerparameters + \unnmhead0{#1}% + \let\centerparametersmaybe = \relax +} + +% @top is like @unnumbered. +\let\top\unnumbered + +% Sections. +% +\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz +\def\seczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% +} + +% normally calls appendixsectionzzz: +\outer\parseargdef\appendixsection{\apphead1{#1}} +\def\appendixsectionzzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% +} +\let\appendixsec\appendixsection + +% normally calls unnumberedseczzz: +\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} +\def\unnumberedseczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% +} + +% Subsections. +% +% normally calls numberedsubseczzz: +\outer\parseargdef\numberedsubsec{\numhead2{#1}} +\def\numberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% +} + +% normally calls appendixsubseczzz: +\outer\parseargdef\appendixsubsec{\apphead2{#1}} +\def\appendixsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno}% +} + +% normally calls unnumberedsubseczzz: +\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} +\def\unnumberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno}% +} + +% Subsubsections. +% +% normally numberedsubsubseczzz: +\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} +\def\numberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynumbered}% + {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +% normally appendixsubsubseczzz: +\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} +\def\appendixsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +% normally unnumberedsubsubseczzz: +\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} +\def\unnumberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +% These macros control what the section commands do, according +% to what kind of chapter we are in (ordinary, appendix, or unnumbered). +% Define them by default for a numbered chapter. +\let\section = \numberedsec +\let\subsection = \numberedsubsec +\let\subsubsection = \numberedsubsubsec + +% Define @majorheading, @heading and @subheading + +\def\majorheading{% + {\advance\chapheadingskip by 10pt \chapbreak }% + \parsearg\chapheadingzzz +} + +\def\chapheading{\chapbreak \parsearg\chapheadingzzz} +\def\chapheadingzzz#1{% + \vbox{\chapfonts \raggedtitlesettings #1\par}% + \nobreak\bigskip \nobreak + \suppressfirstparagraphindent +} + +% @heading, @subheading, @subsubheading. +\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} + +% These macros generate a chapter, section, etc. heading only +% (including whitespace, linebreaking, etc. around it), +% given all the information in convenient, parsed form. + +% Args are the skip and penalty (usually negative) +\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} + +% Parameter controlling skip before chapter headings (if needed) +\newskip\chapheadingskip + +% Define plain chapter starts, and page on/off switching for it. +\def\chapbreak{\dobreak \chapheadingskip {-4000}} +\def\chappager{\par\vfill\supereject} +% Because \domark is called before \chapoddpage, the filler page will +% get the headings for the next chapter, which is wrong. But we don't +% care -- we just disable all headings on the filler page. +\def\chapoddpage{% + \chappager + \ifodd\pageno \else + \begingroup + \headingsoff + \null + \chappager + \endgroup + \fi +} + +\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} + +\def\CHAPPAGoff{% +\global\let\contentsalignmacro = \chappager +\global\let\pchapsepmacro=\chapbreak +\global\let\pagealignmacro=\chappager} + +\def\CHAPPAGon{% +\global\let\contentsalignmacro = \chappager +\global\let\pchapsepmacro=\chappager +\global\let\pagealignmacro=\chappager +\global\def\HEADINGSon{\HEADINGSsingle}} + +\def\CHAPPAGodd{% +\global\let\contentsalignmacro = \chapoddpage +\global\let\pchapsepmacro=\chapoddpage +\global\let\pagealignmacro=\chapoddpage +\global\def\HEADINGSon{\HEADINGSdouble}} + +\CHAPPAGon + +% Chapter opening. +% +% #1 is the text, #2 is the section type (Ynumbered, Ynothing, +% Yappendix, Yomitfromtoc), #3 the chapter number. +% +% To test against our argument. +\def\Ynothingkeyword{Ynothing} +\def\Yomitfromtockeyword{Yomitfromtoc} +\def\Yappendixkeyword{Yappendix} +% +\def\chapmacro#1#2#3{% + % Insert the first mark before the heading break (see notes for \domark). + \let\prevchapterdefs=\lastchapterdefs + \let\prevsectiondefs=\lastsectiondefs + \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% + \gdef\thissection{}}% + % + \def\temptype{#2}% + \ifx\temptype\Ynothingkeyword + \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\thischapter{\thischaptername}}% + \else\ifx\temptype\Yomitfromtockeyword + \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\thischapter{}}% + \else\ifx\temptype\Yappendixkeyword + \toks0={#1}% + \xdef\lastchapterdefs{% + \gdef\noexpand\thischaptername{\the\toks0}% + \gdef\noexpand\thischapternum{\appendixletter}% + % \noexpand\putwordAppendix avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thischapter{\noexpand\putwordAppendix{} + \noexpand\thischapternum: + \noexpand\thischaptername}% + }% + \else + \toks0={#1}% + \xdef\lastchapterdefs{% + \gdef\noexpand\thischaptername{\the\toks0}% + \gdef\noexpand\thischapternum{\the\chapno}% + % \noexpand\putwordChapter avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thischapter{\noexpand\putwordChapter{} + \noexpand\thischapternum: + \noexpand\thischaptername}% + }% + \fi\fi\fi + % + % Output the mark. Pass it through \safewhatsit, to take care of + % the preceding space. + \safewhatsit\domark + % + % Insert the chapter heading break. + \pchapsepmacro + % + % Now the second mark, after the heading break. No break points + % between here and the heading. + \let\prevchapterdefs=\lastchapterdefs + \let\prevsectiondefs=\lastsectiondefs + \domark + % + {% + \chapfonts \rmisbold + % + % Have to define \lastsection before calling \donoderef, because the + % xref code eventually uses it. On the other hand, it has to be called + % after \pchapsepmacro, or the headline will change too soon. + \gdef\lastsection{#1}% + % + % Only insert the separating space if we have a chapter/appendix + % number, and don't print the unnumbered ``number''. + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unnchap}% + \else\ifx\temptype\Yomitfromtockeyword + \setbox0 = \hbox{}% contents like unnumbered, but no toc entry + \def\toctype{omit}% + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% + \def\toctype{app}% + \else + \setbox0 = \hbox{#3\enspace}% + \def\toctype{numchap}% + \fi\fi\fi + % + % Write the toc entry for this chapter. Must come before the + % \donoderef, because we include the current node name in the toc + % entry, and \donoderef resets it to empty. + \writetocentry{\toctype}{#1}{#3}% + % + % For pdftex, we have to write out the node definition (aka, make + % the pdfdest) after any page break, but before the actual text has + % been typeset. If the destination for the pdf outline is after the + % text, then jumping from the outline may wind up with the text not + % being visible, for instance under high magnification. + \donoderef{#2}% + % + % Typeset the actual heading. + \nobreak % Avoid page breaks at the interline glue. + \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe + \unhbox0 #1\par}% + }% + \nobreak\bigskip % no page break after a chapter title + \nobreak +} + +% @centerchap -- centered and unnumbered. +\let\centerparametersmaybe = \relax +\def\centerparameters{% + \advance\rightskip by 3\rightskip + \leftskip = \rightskip + \parfillskip = 0pt +} + + +% I don't think this chapter style is supported any more, so I'm not +% updating it with the new noderef stuff. We'll see. --karl, 11aug03. +% +\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} +% +\def\unnchfopen #1{% + \chapoddpage + \vbox{\chapfonts \raggedtitlesettings #1\par}% + \nobreak\bigskip\nobreak +} +\def\chfopen #1#2{\chapoddpage {\chapfonts +\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% +\par\penalty 5000 % +} +\def\centerchfopen #1{% + \chapoddpage + \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}% + \nobreak\bigskip \nobreak +} +\def\CHAPFopen{% + \global\let\chapmacro=\chfopen + \global\let\centerchapmacro=\centerchfopen} + + +% Section titles. These macros combine the section number parts and +% call the generic \sectionheading to do the printing. +% +\newskip\secheadingskip +\def\secheadingbreak{\dobreak \secheadingskip{-1000}} + +% Subsection titles. +\newskip\subsecheadingskip +\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} + +% Subsubsection titles. +\def\subsubsecheadingskip{\subsecheadingskip} +\def\subsubsecheadingbreak{\subsecheadingbreak} + + +% Print any size, any type, section title. +% +% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is +% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the +% section number. +% +\def\seckeyword{sec} +% +\def\sectionheading#1#2#3#4{% + {% + \checkenv{}% should not be in an environment. + % + % Switch to the right set of fonts. + \csname #2fonts\endcsname \rmisbold + % + \def\sectionlevel{#2}% + \def\temptype{#3}% + % + % Insert first mark before the heading break (see notes for \domark). + \let\prevsectiondefs=\lastsectiondefs + \ifx\temptype\Ynothingkeyword + \ifx\sectionlevel\seckeyword + \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% + \gdef\thissection{\thissectionname}}% + \fi + \else\ifx\temptype\Yomitfromtockeyword + % Don't redefine \thissection. + \else\ifx\temptype\Yappendixkeyword + \ifx\sectionlevel\seckeyword + \toks0={#1}% + \xdef\lastsectiondefs{% + \gdef\noexpand\thissectionname{\the\toks0}% + \gdef\noexpand\thissectionnum{#4}% + % \noexpand\putwordSection avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thissection{\noexpand\putwordSection{} + \noexpand\thissectionnum: + \noexpand\thissectionname}% + }% + \fi + \else + \ifx\sectionlevel\seckeyword + \toks0={#1}% + \xdef\lastsectiondefs{% + \gdef\noexpand\thissectionname{\the\toks0}% + \gdef\noexpand\thissectionnum{#4}% + % \noexpand\putwordSection avoids expanding indigestible + % commands in some of the translations. + \gdef\noexpand\thissection{\noexpand\putwordSection{} + \noexpand\thissectionnum: + \noexpand\thissectionname}% + }% + \fi + \fi\fi\fi + % + % Go into vertical mode. Usually we'll already be there, but we + % don't want the following whatsit to end up in a preceding paragraph + % if the document didn't happen to have a blank line. + \par + % + % Output the mark. Pass it through \safewhatsit, to take care of + % the preceding space. + \safewhatsit\domark + % + % Insert space above the heading. + \csname #2headingbreak\endcsname + % + % Now the second mark, after the heading break. No break points + % between here and the heading. + \global\let\prevsectiondefs=\lastsectiondefs + \domark + % + % Only insert the space after the number if we have a section number. + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unn}% + \gdef\lastsection{#1}% + \else\ifx\temptype\Yomitfromtockeyword + % for @headings -- no section number, don't include in toc, + % and don't redefine \lastsection. + \setbox0 = \hbox{}% + \def\toctype{omit}% + \let\sectionlevel=\empty + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{#4\enspace}% + \def\toctype{app}% + \gdef\lastsection{#1}% + \else + \setbox0 = \hbox{#4\enspace}% + \def\toctype{num}% + \gdef\lastsection{#1}% + \fi\fi\fi + % + % Write the toc entry (before \donoderef). See comments in \chapmacro. + \writetocentry{\toctype\sectionlevel}{#1}{#4}% + % + % Write the node reference (= pdf destination for pdftex). + % Again, see comments in \chapmacro. + \donoderef{#3}% + % + % Interline glue will be inserted when the vbox is completed. + % That glue will be a valid breakpoint for the page, since it'll be + % preceded by a whatsit (usually from the \donoderef, or from the + % \writetocentry if there was no node). We don't want to allow that + % break, since then the whatsits could end up on page n while the + % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. + \nobreak + % + % Output the actual section heading. + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright + \hangindent=\wd0 % zero if no section number + \unhbox0 #1}% + }% + % Add extra space after the heading -- half of whatever came above it. + % Don't allow stretch, though. + \kern .5 \csname #2headingskip\endcsname + % + % Do not let the kern be a potential breakpoint, as it would be if it + % was followed by glue. + \nobreak + % + % We'll almost certainly start a paragraph next, so don't let that + % glue accumulate. (Not a breakpoint because it's preceded by a + % discardable item.) However, when a paragraph is not started next + % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out + % or the negative glue will cause weirdly wrong output, typically + % obscuring the section heading with something else. + \vskip-\parskip + % + % This is so the last item on the main vertical list is a known + % \penalty > 10000, so \startdefun, etc., can recognize the situation + % and do the needful. + \penalty 10001 +} + + +\message{toc,} +% Table of contents. +\newwrite\tocfile + +% Write an entry to the toc file, opening it if necessary. +% Called from @chapter, etc. +% +% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} +% We append the current node name (if any) and page number as additional +% arguments for the \{chap,sec,...}entry macros which will eventually +% read this. The node name is used in the pdf outlines as the +% destination to jump to. +% +% We open the .toc file for writing here instead of at @setfilename (or +% any other fixed time) so that @contents can be anywhere in the document. +% But if #1 is `omit', then we don't do anything. This is used for the +% table of contents chapter openings themselves. +% +\newif\iftocfileopened +\def\omitkeyword{omit}% +% +\def\writetocentry#1#2#3{% + \edef\writetoctype{#1}% + \ifx\writetoctype\omitkeyword \else + \iftocfileopened\else + \immediate\openout\tocfile = \jobname.toc + \global\tocfileopenedtrue + \fi + % + \iflinks + {\atdummies + \edef\temp{% + \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% + \temp + }% + \fi + \fi + % + % Tell \shipout to create a pdf destination on each page, if we're + % writing pdf. These are used in the table of contents. We can't + % just write one on every page because the title pages are numbered + % 1 and 2 (the page numbers aren't printed), and so are the first + % two pages of the document. Thus, we'd have two destinations named + % `1', and two named `2'. + \ifpdf \global\pdfmakepagedesttrue \fi +} + + +% These characters do not print properly in the Computer Modern roman +% fonts, so we must take special care. This is more or less redundant +% with the Texinfo input format setup at the end of this file. +% +\def\activecatcodes{% + \catcode`\"=\active + \catcode`\$=\active + \catcode`\<=\active + \catcode`\>=\active + \catcode`\\=\active + \catcode`\^=\active + \catcode`\_=\active + \catcode`\|=\active + \catcode`\~=\active +} + + +% Read the toc file, which is essentially Texinfo input. +\def\readtocfile{% + \setupdatafile + \activecatcodes + \input \tocreadfilename +} + +\newskip\contentsrightmargin \contentsrightmargin=1in +\newcount\savepageno +\newcount\lastnegativepageno \lastnegativepageno = -1 + +% Prepare to read what we've written to \tocfile. +% +\def\startcontents#1{% + % If @setchapternewpage on, and @headings double, the contents should + % start on an odd page, unlike chapters. Thus, we maintain + % \contentsalignmacro in parallel with \pagealignmacro. + % From: Torbjorn Granlund + \contentsalignmacro + \immediate\closeout\tocfile + % + % Don't need to put `Contents' or `Short Contents' in the headline. + % It is abundantly clear what they are. + \chapmacro{#1}{Yomitfromtoc}{}% + % + \savepageno = \pageno + \begingroup % Set up to handle contents files properly. + \raggedbottom % Worry more about breakpoints than the bottom. + \advance\hsize by -\contentsrightmargin % Don't use the full line length. + % + % Roman numerals for page numbers. + \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi +} + +% redefined for the two-volume lispref. We always output on +% \jobname.toc even if this is redefined. +% +\def\tocreadfilename{\jobname.toc} + +% Normal (long) toc. +% +\def\contents{% + \startcontents{\putwordTOC}% + \openin 1 \tocreadfilename\space + \ifeof 1 \else + \readtocfile + \fi + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \ifeof 1 \else + \pdfmakeoutlines + \fi + \closein 1 + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno +} + +% And just the chapters. +\def\summarycontents{% + \startcontents{\putwordShortTOC}% + % + \let\partentry = \shortpartentry + \let\numchapentry = \shortchapentry + \let\appentry = \shortchapentry + \let\unnchapentry = \shortunnchapentry + % We want a true roman here for the page numbers. + \secfonts + \let\rm=\shortcontrm \let\bf=\shortcontbf + \let\sl=\shortcontsl \let\tt=\shortconttt + \rm + \hyphenpenalty = 10000 + \advance\baselineskip by 1pt % Open it up a little. + \def\numsecentry##1##2##3##4{} + \let\appsecentry = \numsecentry + \let\unnsecentry = \numsecentry + \let\numsubsecentry = \numsecentry + \let\appsubsecentry = \numsecentry + \let\unnsubsecentry = \numsecentry + \let\numsubsubsecentry = \numsecentry + \let\appsubsubsecentry = \numsecentry + \let\unnsubsubsecentry = \numsecentry + \openin 1 \tocreadfilename\space + \ifeof 1 \else + \readtocfile + \fi + \closein 1 + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno +} +\let\shortcontents = \summarycontents + +% Typeset the label for a chapter or appendix for the short contents. +% The arg is, e.g., `A' for an appendix, or `3' for a chapter. +% +\def\shortchaplabel#1{% + % This space should be enough, since a single number is .5em, and the + % widest letter (M) is 1em, at least in the Computer Modern fonts. + % But use \hss just in case. + % (This space doesn't include the extra space that gets added after + % the label; that gets put in by \shortchapentry above.) + % + % We'd like to right-justify chapter numbers, but that looks strange + % with appendix letters. And right-justifying numbers and + % left-justifying letters looks strange when there is less than 10 + % chapters. Have to read the whole toc once to know how many chapters + % there are before deciding ... + \hbox to 1em{#1\hss}% +} + +% These macros generate individual entries in the table of contents. +% The first argument is the chapter or section name. +% The last argument is the page number. +% The arguments in between are the chapter number, section number, ... + +% Parts, in the main contents. Replace the part number, which doesn't +% exist, with an empty box. Let's hope all the numbers have the same width. +% Also ignore the page number, which is conventionally not printed. +\def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}} +\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}} +% +% Parts, in the short toc. +\def\shortpartentry#1#2#3#4{% + \penalty-300 + \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip + \shortchapentry{{\bf #1}}{\numeralbox}{}{}% +} + +% Chapters, in the main contents. +\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} +% +% Chapters, in the short toc. +% See comments in \dochapentry re vbox and related settings. +\def\shortchapentry#1#2#3#4{% + \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% +} + +% Appendices, in the main contents. +% Need the word Appendix, and a fixed-size box. +% +\def\appendixbox#1{% + % We use M since it's probably the widest letter. + \setbox0 = \hbox{\putwordAppendix{} M}% + \hbox to \wd0{\putwordAppendix{} #1\hss}} +% +\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} + +% Unnumbered chapters. +\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} +\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} + +% Sections. +\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} +\let\appsecentry=\numsecentry +\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} + +% Subsections. +\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} +\let\appsubsecentry=\numsubsecentry +\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} + +% And subsubsections. +\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} +\let\appsubsubsecentry=\numsubsubsecentry +\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} + +% This parameter controls the indentation of the various levels. +% Same as \defaultparindent. +\newdimen\tocindent \tocindent = 15pt + +% Now for the actual typesetting. In all these, #1 is the text and #2 is the +% page number. +% +% If the toc has to be broken over pages, we want it to be at chapters +% if at all possible; hence the \penalty. +\def\dochapentry#1#2{% + \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip + \begingroup + \chapentryfonts + \tocentry{#1}{\dopageno\bgroup#2\egroup}% + \endgroup + \nobreak\vskip .25\baselineskip plus.1\baselineskip +} + +\def\dosecentry#1#2{\begingroup + \secentryfonts \leftskip=\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +\def\dosubsecentry#1#2{\begingroup + \subsecentryfonts \leftskip=2\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +\def\dosubsubsecentry#1#2{\begingroup + \subsubsecentryfonts \leftskip=3\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +% We use the same \entry macro as for the index entries. +\let\tocentry = \entry + +% Space between chapter (or whatever) number and the title. +\def\labelspace{\hskip1em \relax} + +\def\dopageno#1{{\rm #1}} +\def\doshortpageno#1{{\rm #1}} + +\def\chapentryfonts{\secfonts \rm} +\def\secentryfonts{\textfonts} +\def\subsecentryfonts{\textfonts} +\def\subsubsecentryfonts{\textfonts} + + +\message{environments,} +% @foo ... @end foo. + +% @tex ... @end tex escapes into raw TeX temporarily. +% One exception: @ is still an escape character, so that @end tex works. +% But \@ or @@ will get a plain @ character. + +\envdef\tex{% + \setupmarkupstyle{tex}% + \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 + \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 + \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie + \catcode `\%=14 + \catcode `\+=\other + \catcode `\"=\other + \catcode `\|=\other + \catcode `\<=\other + \catcode `\>=\other + \catcode `\`=\other + \catcode `\'=\other + \escapechar=`\\ + % + % ' is active in math mode (mathcode"8000). So reset it, and all our + % other math active characters (just in case), to plain's definitions. + \mathactive + % + \let\b=\ptexb + \let\bullet=\ptexbullet + \let\c=\ptexc + \let\,=\ptexcomma + \let\.=\ptexdot + \let\dots=\ptexdots + \let\equiv=\ptexequiv + \let\!=\ptexexclam + \let\i=\ptexi + \let\indent=\ptexindent + \let\noindent=\ptexnoindent + \let\{=\ptexlbrace + \let\+=\tabalign + \let\}=\ptexrbrace + \let\/=\ptexslash + \let\*=\ptexstar + \let\t=\ptext + \expandafter \let\csname top\endcsname=\ptextop % we've made it outer + \let\frenchspacing=\plainfrenchspacing + % + \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% + \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% + \def\@{@}% +} +% There is no need to define \Etex. + +% Define @lisp ... @end lisp. +% @lisp environment forms a group so it can rebind things, +% including the definition of @end lisp (which normally is erroneous). + +% Amount to narrow the margins by for @lisp. +\newskip\lispnarrowing \lispnarrowing=0.4in + +% This is the definition that ^^M gets inside @lisp, @example, and other +% such environments. \null is better than a space, since it doesn't +% have any width. +\def\lisppar{\null\endgraf} + +% This space is always present above and below environments. +\newskip\envskipamount \envskipamount = 0pt + +% Make spacing and below environment symmetrical. We use \parskip here +% to help in doing that, since in @example-like environments \parskip +% is reset to zero; thus the \afterenvbreak inserts no space -- but the +% start of the next paragraph will insert \parskip. +% +\def\aboveenvbreak{{% + % =10000 instead of <10000 because of a special case in \itemzzz and + % \sectionheading, q.v. + \ifnum \lastpenalty=10000 \else + \advance\envskipamount by \parskip + \endgraf + \ifdim\lastskip<\envskipamount + \removelastskip + % it's not a good place to break if the last penalty was \nobreak + % or better ... + \ifnum\lastpenalty<10000 \penalty-50 \fi + \vskip\envskipamount + \fi + \fi +}} + +\let\afterenvbreak = \aboveenvbreak + +% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will +% also clear it, so that its embedded environments do the narrowing again. +\let\nonarrowing=\relax + +% @cartouche ... @end cartouche: draw rectangle w/rounded corners around +% environment contents. +\font\circle=lcircle10 +\newdimen\circthick +\newdimen\cartouter\newdimen\cartinner +\newskip\normbskip\newskip\normpskip\newskip\normlskip +\circthick=\fontdimen8\circle +% +\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth +\def\ctr{{\hskip 6pt\circle\char'010}} +\def\cbl{{\circle\char'012\hskip -6pt}} +\def\cbr{{\hskip 6pt\circle\char'011}} +\def\carttop{\hbox to \cartouter{\hskip\lskip + \ctl\leaders\hrule height\circthick\hfil\ctr + \hskip\rskip}} +\def\cartbot{\hbox to \cartouter{\hskip\lskip + \cbl\leaders\hrule height\circthick\hfil\cbr + \hskip\rskip}} +% +\newskip\lskip\newskip\rskip + +\envdef\cartouche{% + \ifhmode\par\fi % can't be in the midst of a paragraph. + \startsavinginserts + \lskip=\leftskip \rskip=\rightskip + \leftskip=0pt\rightskip=0pt % we want these *outside*. + \cartinner=\hsize \advance\cartinner by-\lskip + \advance\cartinner by-\rskip + \cartouter=\hsize + \advance\cartouter by 18.4pt % allow for 3pt kerns on either + % side, and for 6pt waste from + % each corner char, and rule thickness + \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip + % Flag to tell @lisp, etc., not to narrow margin. + \let\nonarrowing = t% + % + % If this cartouche directly follows a sectioning command, we need the + % \parskip glue (backspaced over by default) or the cartouche can + % collide with the section heading. + \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi + % + \vbox\bgroup + \baselineskip=0pt\parskip=0pt\lineskip=0pt + \carttop + \hbox\bgroup + \hskip\lskip + \vrule\kern3pt + \vbox\bgroup + \kern3pt + \hsize=\cartinner + \baselineskip=\normbskip + \lineskip=\normlskip + \parskip=\normpskip + \vskip -\parskip + \comment % For explanation, see the end of def\group. +} +\def\Ecartouche{% + \ifhmode\par\fi + \kern3pt + \egroup + \kern3pt\vrule + \hskip\rskip + \egroup + \cartbot + \egroup + \checkinserts +} + + +% This macro is called at the beginning of all the @example variants, +% inside a group. +\newdimen\nonfillparindent +\def\nonfillstart{% + \aboveenvbreak + \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy + \sepspaces % Make spaces be word-separators rather than space tokens. + \let\par = \lisppar % don't ignore blank lines + \obeylines % each line of input is a line of output + \parskip = 0pt + % Turn off paragraph indentation but redefine \indent to emulate + % the normal \indent. + \nonfillparindent=\parindent + \parindent = 0pt + \let\indent\nonfillindent + % + \emergencystretch = 0pt % don't try to avoid overfull boxes + \ifx\nonarrowing\relax + \advance \leftskip by \lispnarrowing + \exdentamount=\lispnarrowing + \else + \let\nonarrowing = \relax + \fi + \let\exdent=\nofillexdent +} + +\begingroup +\obeyspaces +% We want to swallow spaces (but not other tokens) after the fake +% @indent in our nonfill-environments, where spaces are normally +% active and set to @tie, resulting in them not being ignored after +% @indent. +\gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}% +\gdef\nonfillindentcheck{% +\ifx\temp % +\expandafter\nonfillindentgobble% +\else% +\leavevmode\nonfillindentbox% +\fi% +}% +\endgroup +\def\nonfillindentgobble#1{\nonfillindent} +\def\nonfillindentbox{\hbox to \nonfillparindent{\hss}} + +% If you want all examples etc. small: @set dispenvsize small. +% If you want even small examples the full size: @set dispenvsize nosmall. +% This affects the following displayed environments: +% @example, @display, @format, @lisp +% +\def\smallword{small} +\def\nosmallword{nosmall} +\let\SETdispenvsize\relax +\def\setnormaldispenv{% + \ifx\SETdispenvsize\smallword + % end paragraph for sake of leading, in case document has no blank + % line. This is redundant with what happens in \aboveenvbreak, but + % we need to do it before changing the fonts, and it's inconvenient + % to change the fonts afterward. + \ifnum \lastpenalty=10000 \else \endgraf \fi + \smallexamplefonts \rm + \fi +} +\def\setsmalldispenv{% + \ifx\SETdispenvsize\nosmallword + \else + \ifnum \lastpenalty=10000 \else \endgraf \fi + \smallexamplefonts \rm + \fi +} + +% We often define two environments, @foo and @smallfoo. +% Let's do it in one command. #1 is the env name, #2 the definition. +\def\makedispenvdef#1#2{% + \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}% + \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}% + \expandafter\let\csname E#1\endcsname \afterenvbreak + \expandafter\let\csname Esmall#1\endcsname \afterenvbreak +} + +% Define two environment synonyms (#1 and #2) for an environment. +\def\maketwodispenvdef#1#2#3{% + \makedispenvdef{#1}{#3}% + \makedispenvdef{#2}{#3}% +} +% +% @lisp: indented, narrowed, typewriter font; +% @example: same as @lisp. +% +% @smallexample and @smalllisp: use smaller fonts. +% Originally contributed by Pavel@xerox. +% +\maketwodispenvdef{lisp}{example}{% + \nonfillstart + \tt\setupmarkupstyle{example}% + \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. + \gobble % eat return +} +% @display/@smalldisplay: same as @lisp except keep current font. +% +\makedispenvdef{display}{% + \nonfillstart + \gobble +} + +% @format/@smallformat: same as @display except don't narrow margins. +% +\makedispenvdef{format}{% + \let\nonarrowing = t% + \nonfillstart + \gobble +} + +% @flushleft: same as @format, but doesn't obey \SETdispenvsize. +\envdef\flushleft{% + \let\nonarrowing = t% + \nonfillstart + \gobble +} +\let\Eflushleft = \afterenvbreak + +% @flushright. +% +\envdef\flushright{% + \let\nonarrowing = t% + \nonfillstart + \advance\leftskip by 0pt plus 1fill\relax + \gobble +} +\let\Eflushright = \afterenvbreak + + +% @raggedright does more-or-less normal line breaking but no right +% justification. From plain.tex. +\envdef\raggedright{% + \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax +} +\let\Eraggedright\par + +\envdef\raggedleft{% + \parindent=0pt \leftskip0pt plus2em + \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt + \hbadness=10000 % Last line will usually be underfull, so turn off + % badness reporting. +} +\let\Eraggedleft\par + +\envdef\raggedcenter{% + \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em + \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt + \hbadness=10000 % Last line will usually be underfull, so turn off + % badness reporting. +} +\let\Eraggedcenter\par + + +% @quotation does normal linebreaking (hence we can't use \nonfillstart) +% and narrows the margins. We keep \parskip nonzero in general, since +% we're doing normal filling. So, when using \aboveenvbreak and +% \afterenvbreak, temporarily make \parskip 0. +% +\makedispenvdef{quotation}{\quotationstart} +% +\def\quotationstart{% + \indentedblockstart % same as \indentedblock, but increase right margin too. + \ifx\nonarrowing\relax + \advance\rightskip by \lispnarrowing + \fi + \parsearg\quotationlabel +} + +% We have retained a nonzero parskip for the environment, since we're +% doing normal filling. +% +\def\Equotation{% + \par + \ifx\quotationauthor\thisisundefined\else + % indent a bit. + \leftline{\kern 2\leftskip \sl ---\quotationauthor}% + \fi + {\parskip=0pt \afterenvbreak}% +} +\def\Esmallquotation{\Equotation} + +% If we're given an argument, typeset it in bold with a colon after. +\def\quotationlabel#1{% + \def\temp{#1}% + \ifx\temp\empty \else + {\bf #1: }% + \fi +} + +% @indentedblock is like @quotation, but indents only on the left and +% has no optional argument. +% +\makedispenvdef{indentedblock}{\indentedblockstart} +% +\def\indentedblockstart{% + {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip + \parindent=0pt + % + % @cartouche defines \nonarrowing to inhibit narrowing at next level down. + \ifx\nonarrowing\relax + \advance\leftskip by \lispnarrowing + \exdentamount = \lispnarrowing + \else + \let\nonarrowing = \relax + \fi +} + +% Keep a nonzero parskip for the environment, since we're doing normal filling. +% +\def\Eindentedblock{% + \par + {\parskip=0pt \afterenvbreak}% +} +\def\Esmallindentedblock{\Eindentedblock} + + +% LaTeX-like @verbatim...@end verbatim and @verb{...} +% If we want to allow any as delimiter, +% we need the curly braces so that makeinfo sees the @verb command, eg: +% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org +% +% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. +% +% [Knuth] p.344; only we need to do the other characters Texinfo sets +% active too. Otherwise, they get lost as the first character on a +% verbatim line. +\def\dospecials{% + \do\ \do\\\do\{\do\}\do\$\do\&% + \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% + \do\<\do\>\do\|\do\@\do+\do\"% + % Don't do the quotes -- if we do, @set txicodequoteundirected and + % @set txicodequotebacktick will not have effect on @verb and + % @verbatim, and ?` and !` ligatures won't get disabled. + %\do\`\do\'% +} +% +% [Knuth] p. 380 +\def\uncatcodespecials{% + \def\do##1{\catcode`##1=\other}\dospecials} +% +% Setup for the @verb command. +% +% Eight spaces for a tab +\begingroup + \catcode`\^^I=\active + \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} +\endgroup +% +\def\setupverb{% + \tt % easiest (and conventionally used) font for verbatim + \def\par{\leavevmode\endgraf}% + \setupmarkupstyle{verb}% + \tabeightspaces + % Respect line breaks, + % print special symbols as themselves, and + % make each space count + % must do in this order: + \obeylines \uncatcodespecials \sepspaces +} + +% Setup for the @verbatim environment +% +% Real tab expansion. +\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount +% +% We typeset each line of the verbatim in an \hbox, so we can handle +% tabs. The \global is in case the verbatim line starts with an accent, +% or some other command that starts with a begin-group. Otherwise, the +% entire \verbbox would disappear at the corresponding end-group, before +% it is typeset. Meanwhile, we can't have nested verbatim commands +% (can we?), so the \global won't be overwriting itself. +\newbox\verbbox +\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup} +% +\begingroup + \catcode`\^^I=\active + \gdef\tabexpand{% + \catcode`\^^I=\active + \def^^I{\leavevmode\egroup + \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab + \divide\dimen\verbbox by\tabw + \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw + \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw + \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox + }% + } +\endgroup + +% start the verbatim environment. +\def\setupverbatim{% + \let\nonarrowing = t% + \nonfillstart + \tt % easiest (and conventionally used) font for verbatim + % The \leavevmode here is for blank lines. Otherwise, we would + % never \starttabox and the \egroup would end verbatim mode. + \def\par{\leavevmode\egroup\box\verbbox\endgraf}% + \tabexpand + \setupmarkupstyle{verbatim}% + % Respect line breaks, + % print special symbols as themselves, and + % make each space count. + % Must do in this order: + \obeylines \uncatcodespecials \sepspaces + \everypar{\starttabbox}% +} + +% Do the @verb magic: verbatim text is quoted by unique +% delimiter characters. Before first delimiter expect a +% right brace, after last delimiter expect closing brace: +% +% \def\doverb'{'#1'}'{#1} +% +% [Knuth] p. 382; only eat outer {} +\begingroup + \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other + \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] +\endgroup +% +\def\verb{\begingroup\setupverb\doverb} +% +% +% Do the @verbatim magic: define the macro \doverbatim so that +% the (first) argument ends when '@end verbatim' is reached, ie: +% +% \def\doverbatim#1@end verbatim{#1} +% +% For Texinfo it's a lot easier than for LaTeX, +% because texinfo's \verbatim doesn't stop at '\end{verbatim}': +% we need not redefine '\', '{' and '}'. +% +% Inspired by LaTeX's verbatim command set [latex.ltx] +% +\begingroup + \catcode`\ =\active + \obeylines % + % ignore everything up to the first ^^M, that's the newline at the end + % of the @verbatim input line itself. Otherwise we get an extra blank + % line in the output. + \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% + % We really want {...\end verbatim} in the body of the macro, but + % without the active space; thus we have to use \xdef and \gobble. +\endgroup +% +\envdef\verbatim{% + \setupverbatim\doverbatim +} +\let\Everbatim = \afterenvbreak + + +% @verbatiminclude FILE - insert text of file in verbatim environment. +% +\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} +% +\def\doverbatiminclude#1{% + {% + \makevalueexpandable + \setupverbatim + \indexnofonts % Allow `@@' and other weird things in file names. + \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% + \input #1 + \afterenvbreak + }% +} + +% @copying ... @end copying. +% Save the text away for @insertcopying later. +% +% We save the uninterpreted tokens, rather than creating a box. +% Saving the text in a box would be much easier, but then all the +% typesetting commands (@smallbook, font changes, etc.) have to be done +% beforehand -- and a) we want @copying to be done first in the source +% file; b) letting users define the frontmatter in as flexible order as +% possible is very desirable. +% +\def\copying{\checkenv{}\begingroup\scanargctxt\docopying} +\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} +% +\def\insertcopying{% + \begingroup + \parindent = 0pt % paragraph indentation looks wrong on title page + \scanexp\copyingtext + \endgroup +} + + +\message{defuns,} +% @defun etc. + +\newskip\defbodyindent \defbodyindent=.4in +\newskip\defargsindent \defargsindent=50pt +\newskip\deflastargmargin \deflastargmargin=18pt +\newcount\defunpenalty + +% Start the processing of @deffn: +\def\startdefun{% + \ifnum\lastpenalty<10000 + \medbreak + \defunpenalty=10003 % Will keep this @deffn together with the + % following @def command, see below. + \else + % If there are two @def commands in a row, we'll have a \nobreak, + % which is there to keep the function description together with its + % header. But if there's nothing but headers, we need to allow a + % break somewhere. Check specifically for penalty 10002, inserted + % by \printdefunline, instead of 10000, since the sectioning + % commands also insert a nobreak penalty, and we don't want to allow + % a break between a section heading and a defun. + % + % As a further refinement, we avoid "club" headers by signalling + % with penalty of 10003 after the very first @deffn in the + % sequence (see above), and penalty of 10002 after any following + % @def command. + \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi + % + % Similarly, after a section heading, do not allow a break. + % But do insert the glue. + \medskip % preceded by discardable penalty, so not a breakpoint + \fi + % + \parindent=0in + \advance\leftskip by \defbodyindent + \exdentamount=\defbodyindent +} + +\def\dodefunx#1{% + % First, check whether we are in the right environment: + \checkenv#1% + % + % As above, allow line break if we have multiple x headers in a row. + % It's not a great place, though. + \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi + % + % And now, it's time to reuse the body of the original defun: + \expandafter\gobbledefun#1% +} +\def\gobbledefun#1\startdefun{} + +% \printdefunline \deffnheader{text} +% +\def\printdefunline#1#2{% + \begingroup + % call \deffnheader: + #1#2 \endheader + % common ending: + \interlinepenalty = 10000 + \advance\rightskip by 0pt plus 1fil\relax + \endgraf + \nobreak\vskip -\parskip + \penalty\defunpenalty % signal to \startdefun and \dodefunx + % Some of the @defun-type tags do not enable magic parentheses, + % rendering the following check redundant. But we don't optimize. + \checkparencounts + \endgroup +} + +\def\Edefun{\endgraf\medbreak} + +% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; +% the only thing remaining is to define \deffnheader. +% +\def\makedefun#1{% + \expandafter\let\csname E#1\endcsname = \Edefun + \edef\temp{\noexpand\domakedefun + \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% + \temp +} + +% \domakedefun \deffn \deffnx \deffnheader +% +% Define \deffn and \deffnx, without parameters. +% \deffnheader has to be defined explicitly. +% +\def\domakedefun#1#2#3{% + \envdef#1{% + \startdefun + \doingtypefnfalse % distinguish typed functions from all else + \parseargusing\activeparens{\printdefunline#3}% + }% + \def#2{\dodefunx#1}% + \def#3% +} + +\newif\ifdoingtypefn % doing typed function? +\newif\ifrettypeownline % typeset return type on its own line? + +% @deftypefnnewline on|off says whether the return type of typed functions +% are printed on their own line. This affects @deftypefn, @deftypefun, +% @deftypeop, and @deftypemethod. +% +\parseargdef\deftypefnnewline{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETtxideftypefnnl\endcsname + = \empty + \else\ifx\temp\offword + \expandafter\let\csname SETtxideftypefnnl\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @txideftypefnnl value `\temp', + must be on|off}% + \fi\fi +} + +% Untyped functions: + +% @deffn category name args +\makedefun{deffn}{\deffngeneral{}} + +% @deffn category class name args +\makedefun{defop}#1 {\defopon{#1\ \putwordon}} + +% \defopon {category on}class name args +\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } + +% \deffngeneral {subind}category name args +% +\def\deffngeneral#1#2 #3 #4\endheader{% + % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. + \dosubind{fn}{\code{#3}}{#1}% + \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% +} + +% Typed functions: + +% @deftypefn category type name args +\makedefun{deftypefn}{\deftypefngeneral{}} + +% @deftypeop category class type name args +\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} + +% \deftypeopon {category on}class type name args +\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } + +% \deftypefngeneral {subind}category type name args +% +\def\deftypefngeneral#1#2 #3 #4 #5\endheader{% + \dosubind{fn}{\code{#4}}{#1}% + \doingtypefntrue + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% +} + +% Typed variables: + +% @deftypevr category type var args +\makedefun{deftypevr}{\deftypecvgeneral{}} + +% @deftypecv category class type var args +\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} + +% \deftypecvof {category of}class type var args +\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } + +% \deftypecvgeneral {subind}category type var args +% +\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% + \dosubind{vr}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% +} + +% Untyped variables: + +% @defvr category var args +\makedefun{defvr}#1 {\deftypevrheader{#1} {} } + +% @defcv category class var args +\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} + +% \defcvof {category of}class var args +\def\defcvof#1#2 {\deftypecvof{#1}#2 {} } + +% Types: + +% @deftp category name args +\makedefun{deftp}#1 #2 #3\endheader{% + \doind{tp}{\code{#2}}% + \defname{#1}{}{#2}\defunargs{#3\unskip}% +} + +% Remaining @defun-like shortcuts: +\makedefun{defun}{\deffnheader{\putwordDeffunc} } +\makedefun{defmac}{\deffnheader{\putwordDefmac} } +\makedefun{defspec}{\deffnheader{\putwordDefspec} } +\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } +\makedefun{defvar}{\defvrheader{\putwordDefvar} } +\makedefun{defopt}{\defvrheader{\putwordDefopt} } +\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } +\makedefun{defmethod}{\defopon\putwordMethodon} +\makedefun{deftypemethod}{\deftypeopon\putwordMethodon} +\makedefun{defivar}{\defcvof\putwordInstanceVariableof} +\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} + +% \defname, which formats the name of the @def (not the args). +% #1 is the category, such as "Function". +% #2 is the return type, if any. +% #3 is the function name. +% +% We are followed by (but not passed) the arguments, if any. +% +\def\defname#1#2#3{% + \par + % Get the values of \leftskip and \rightskip as they were outside the @def... + \advance\leftskip by -\defbodyindent + % + % Determine if we are typesetting the return type of a typed function + % on a line by itself. + \rettypeownlinefalse + \ifdoingtypefn % doing a typed function specifically? + % then check user option for putting return type on its own line: + \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else + \rettypeownlinetrue + \fi + \fi + % + % How we'll format the category name. Putting it in brackets helps + % distinguish it from the body text that may end up on the next line + % just below it. + \def\temp{#1}% + \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} + % + % Figure out line sizes for the paragraph shape. We'll always have at + % least two. + \tempnum = 2 + % + % The first line needs space for \box0; but if \rightskip is nonzero, + % we need only space for the part of \box0 which exceeds it: + \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip + % + % If doing a return type on its own line, we'll have another line. + \ifrettypeownline + \advance\tempnum by 1 + \def\maybeshapeline{0in \hsize}% + \else + \def\maybeshapeline{}% + \fi + % + % The continuations: + \dimen2=\hsize \advance\dimen2 by -\defargsindent + % + % The final paragraph shape: + \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2 + % + % Put the category name at the right margin. + \noindent + \hbox to 0pt{% + \hfil\box0 \kern-\hsize + % \hsize has to be shortened this way: + \kern\leftskip + % Intentionally do not respect \rightskip, since we need the space. + }% + % + % Allow all lines to be underfull without complaint: + \tolerance=10000 \hbadness=10000 + \exdentamount=\defbodyindent + {% + % defun fonts. We use typewriter by default (used to be bold) because: + % . we're printing identifiers, they should be in tt in principle. + % . in languages with many accents, such as Czech or French, it's + % common to leave accents off identifiers. The result looks ok in + % tt, but exceedingly strange in rm. + % . we don't want -- and --- to be treated as ligatures. + % . this still does not fix the ?` and !` ligatures, but so far no + % one has made identifiers using them :). + \df \tt + \def\temp{#2}% text of the return type + \ifx\temp\empty\else + \tclose{\temp}% typeset the return type + \ifrettypeownline + % put return type on its own line; prohibit line break following: + \hfil\vadjust{\nobreak}\break + \else + \space % type on same line, so just followed by a space + \fi + \fi % no return type + #3% output function name + }% + {\rm\enskip}% hskip 0.5 em of \tenrm + % + \boldbrax + % arguments will be output next, if any. +} + +% Print arguments in slanted roman (not ttsl), inconsistently with using +% tt for the name. This is because literal text is sometimes needed in +% the argument list (groff manual), and ttsl and tt are not very +% distinguishable. Prevent hyphenation at `-' chars. +% +\def\defunargs#1{% + % use sl by default (not ttsl), + % tt for the names. + \df \sl \hyphenchar\font=0 + % + % On the other hand, if an argument has two dashes (for instance), we + % want a way to get ttsl. We used to recommend @var for that, so + % leave the code in, but it's strange for @var to lead to typewriter. + % Nowadays we recommend @code, since the difference between a ttsl hyphen + % and a tt hyphen is pretty tiny. @code also disables ?` !`. + \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% + #1% + \sl\hyphenchar\font=45 +} + +% We want ()&[] to print specially on the defun line. +% +\def\activeparens{% + \catcode`\(=\active \catcode`\)=\active + \catcode`\[=\active \catcode`\]=\active + \catcode`\&=\active +} + +% Make control sequences which act like normal parenthesis chars. +\let\lparen = ( \let\rparen = ) + +% Be sure that we always have a definition for `(', etc. For example, +% if the fn name has parens in it, \boldbrax will not be in effect yet, +% so TeX would otherwise complain about undefined control sequence. +{ + \activeparens + \global\let(=\lparen \global\let)=\rparen + \global\let[=\lbrack \global\let]=\rbrack + \global\let& = \& + + \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} + \gdef\magicamp{\let&=\amprm} +} + +\newcount\parencount + +% If we encounter &foo, then turn on ()-hacking afterwards +\newif\ifampseen +\def\amprm#1 {\ampseentrue{\bf\ }} + +\def\parenfont{% + \ifampseen + % At the first level, print parens in roman, + % otherwise use the default font. + \ifnum \parencount=1 \rm \fi + \else + % The \sf parens (in \boldbrax) actually are a little bolder than + % the contained text. This is especially needed for [ and ] . + \sf + \fi +} +\def\infirstlevel#1{% + \ifampseen + \ifnum\parencount=1 + #1% + \fi + \fi +} +\def\bfafterword#1 {#1 \bf} + +\def\opnr{% + \global\advance\parencount by 1 + {\parenfont(}% + \infirstlevel \bfafterword +} +\def\clnr{% + {\parenfont)}% + \infirstlevel \sl + \global\advance\parencount by -1 +} + +\newcount\brackcount +\def\lbrb{% + \global\advance\brackcount by 1 + {\bf[}% +} +\def\rbrb{% + {\bf]}% + \global\advance\brackcount by -1 +} + +\def\checkparencounts{% + \ifnum\parencount=0 \else \badparencount \fi + \ifnum\brackcount=0 \else \badbrackcount \fi +} +% these should not use \errmessage; the glibc manual, at least, actually +% has such constructs (when documenting function pointers). +\def\badparencount{% + \message{Warning: unbalanced parentheses in @def...}% + \global\parencount=0 +} +\def\badbrackcount{% + \message{Warning: unbalanced square brackets in @def...}% + \global\brackcount=0 +} + + +\message{macros,} +% @macro. + +% To do this right we need a feature of e-TeX, \scantokens, +% which we arrange to emulate with a temporary file in ordinary TeX. +\ifx\eTeXversion\thisisundefined + \newwrite\macscribble + \def\scantokens#1{% + \toks0={#1}% + \immediate\openout\macscribble=\jobname.tmp + \immediate\write\macscribble{\the\toks0}% + \immediate\closeout\macscribble + \input \jobname.tmp + } +\fi + +\def\scanmacro#1{\begingroup + \newlinechar`\^^M + \let\xeatspaces\eatspaces + % + % Undo catcode changes of \startcontents and \doprintindex + % When called from @insertcopying or (short)caption, we need active + % backslash to get it printed correctly. Previously, we had + % \catcode`\\=\other instead. We'll see whether a problem appears + % with macro expansion. --kasal, 19aug04 + \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ + % + % ... and for \example: + \spaceisspace + % + % The \empty here causes a following catcode 5 newline to be eaten as + % part of reading whitespace after a control sequence. It does not + % eat a catcode 13 newline. There's no good way to handle the two + % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX + % would then have different behavior). See the Macro Details node in + % the manual for the workaround we recommend for macros and + % line-oriented commands. + % + \scantokens{#1\empty}% +\endgroup} + +\def\scanexp#1{% + \edef\temp{\noexpand\scanmacro{#1}}% + \temp +} + +\newcount\paramno % Count of parameters +\newtoks\macname % Macro name +\newif\ifrecursive % Is it recursive? + +% List of all defined macros in the form +% \definedummyword\macro1\definedummyword\macro2... +% Currently is also contains all @aliases; the list can be split +% if there is a need. +\def\macrolist{} + +% Add the macro to \macrolist +\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} +\def\addtomacrolistxxx#1{% + \toks0 = \expandafter{\macrolist\definedummyword#1}% + \xdef\macrolist{\the\toks0}% +} + +% Utility routines. +% This does \let #1 = #2, with \csnames; that is, +% \let \csname#1\endcsname = \csname#2\endcsname +% (except of course we have to play expansion games). +% +\def\cslet#1#2{% + \expandafter\let + \csname#1\expandafter\endcsname + \csname#2\endcsname +} + +% Trim leading and trailing spaces off a string. +% Concepts from aro-bend problem 15 (see CTAN). +{\catcode`\@=11 +\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} +\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} +\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} +\def\unbrace#1{#1} +\unbrace{\gdef\trim@@@ #1 } #2@{#1} +} + +% Trim a single trailing ^^M off a string. +{\catcode`\^^M=\other \catcode`\Q=3% +\gdef\eatcr #1{\eatcra #1Q^^MQ}% +\gdef\eatcra#1^^MQ{\eatcrb#1Q}% +\gdef\eatcrb#1Q#2Q{#1}% +} + +% Macro bodies are absorbed as an argument in a context where +% all characters are catcode 10, 11 or 12, except \ which is active +% (as in normal texinfo). It is necessary to change the definition of \ +% to recognize macro arguments; this is the job of \mbodybackslash. +% +% Non-ASCII encodings make 8-bit characters active, so un-activate +% them to avoid their expansion. Must do this non-globally, to +% confine the change to the current group. +% +% It's necessary to have hard CRs when the macro is executed. This is +% done by making ^^M (\endlinechar) catcode 12 when reading the macro +% body, and then making it the \newlinechar in \scanmacro. +% +\def\scanctxt{% used as subroutine + \catcode`\"=\other + \catcode`\+=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\@=\other + \catcode`\^=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\~=\other + \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi +} + +\def\scanargctxt{% used for copying and captions, not macros. + \scanctxt + \catcode`\\=\other + \catcode`\^^M=\other +} + +\def\macrobodyctxt{% used for @macro definitions + \scanctxt + \catcode`\{=\other + \catcode`\}=\other + \catcode`\^^M=\other + \usembodybackslash +} + +\def\macroargctxt{% used when scanning invocations + \scanctxt + \catcode`\\=0 +} +% why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes" +% for the single characters \ { }. Thus, we end up with the "commands" +% that would be written @\ @{ @} in a Texinfo document. +% +% We already have @{ and @}. For @\, we define it here, and only for +% this purpose, to produce a typewriter backslash (so, the @\ that we +% define for @math can't be used with @macro calls): +% +\def\\{\normalbackslash}% +% +% We would like to do this for \, too, since that is what makeinfo does. +% But it is not possible, because Texinfo already has a command @, for a +% cedilla accent. Documents must use @comma{} instead. +% +% \anythingelse will almost certainly be an error of some kind. + + +% \mbodybackslash is the definition of \ in @macro bodies. +% It maps \foo\ => \csname macarg.foo\endcsname => #N +% where N is the macro parameter number. +% We define \csname macarg.\endcsname to be \realbackslash, so +% \\ in macro replacement text gets you a backslash. +% +{\catcode`@=0 @catcode`@\=@active + @gdef@usembodybackslash{@let\=@mbodybackslash} + @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} +} +\expandafter\def\csname macarg.\endcsname{\realbackslash} + +\def\margbackslash#1{\char`\#1 } + +\def\macro{\recursivefalse\parsearg\macroxxx} +\def\rmacro{\recursivetrue\parsearg\macroxxx} + +\def\macroxxx#1{% + \getargs{#1}% now \macname is the macname and \argl the arglist + \ifx\argl\empty % no arguments + \paramno=0\relax + \else + \expandafter\parsemargdef \argl;% + \if\paramno>256\relax + \ifx\eTeXversion\thisisundefined + \errhelp = \EMsimple + \errmessage{You need eTeX to compile a file with macros with more than 256 arguments} + \fi + \fi + \fi + \if1\csname ismacro.\the\macname\endcsname + \message{Warning: redefining \the\macname}% + \else + \expandafter\ifx\csname \the\macname\endcsname \relax + \else \errmessage{Macro name \the\macname\space already defined}\fi + \global\cslet{macsave.\the\macname}{\the\macname}% + \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% + \addtomacrolist{\the\macname}% + \fi + \begingroup \macrobodyctxt + \ifrecursive \expandafter\parsermacbody + \else \expandafter\parsemacbody + \fi} + +\parseargdef\unmacro{% + \if1\csname ismacro.#1\endcsname + \global\cslet{#1}{macsave.#1}% + \global\expandafter\let \csname ismacro.#1\endcsname=0% + % Remove the macro name from \macrolist: + \begingroup + \expandafter\let\csname#1\endcsname \relax + \let\definedummyword\unmacrodo + \xdef\macrolist{\macrolist}% + \endgroup + \else + \errmessage{Macro #1 not defined}% + \fi +} + +% Called by \do from \dounmacro on each macro. The idea is to omit any +% macro definitions that have been changed to \relax. +% +\def\unmacrodo#1{% + \ifx #1\relax + % remove this + \else + \noexpand\definedummyword \noexpand#1% + \fi +} + +% This makes use of the obscure feature that if the last token of a +% is #, then the preceding argument is delimited by +% an opening brace, and that opening brace is not consumed. +\def\getargs#1{\getargsxxx#1{}} +\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} +\def\getmacname#1 #2\relax{\macname={#1}} +\def\getmacargs#1{\def\argl{#1}} + +% For macro processing make @ a letter so that we can make Texinfo private macro names. +\edef\texiatcatcode{\the\catcode`\@} +\catcode `@=11\relax + +% Parse the optional {params} list. Set up \paramno and \paramlist +% so \defmacro knows what to do. Define \macarg.BLAH for each BLAH +% in the params list to some hook where the argument si to be expanded. If +% there are less than 10 arguments that hook is to be replaced by ##N where N +% is the position in that list, that is to say the macro arguments are to be +% defined `a la TeX in the macro body. +% +% That gets used by \mbodybackslash (above). +% +% We need to get `macro parameter char #' into several definitions. +% The technique used is stolen from LaTeX: let \hash be something +% unexpandable, insert that wherever you need a #, and then redefine +% it to # just before using the token list produced. +% +% The same technique is used to protect \eatspaces till just before +% the macro is used. +% +% If there are 10 or more arguments, a different technique is used, where the +% hook remains in the body, and when macro is to be expanded the body is +% processed again to replace the arguments. +% +% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the +% argument N value and then \edef the body (nothing else will expand because of +% the catcode regime underwhich the body was input). +% +% If you compile with TeX (not eTeX), and you have macros with 10 or more +% arguments, you need that no macro has more than 256 arguments, otherwise an +% error is produced. +\def\parsemargdef#1;{% + \paramno=0\def\paramlist{}% + \let\hash\relax + \let\xeatspaces\relax + \parsemargdefxxx#1,;,% + % In case that there are 10 or more arguments we parse again the arguments + % list to set new definitions for the \macarg.BLAH macros corresponding to + % each BLAH argument. It was anyhow needed to parse already once this list + % in order to count the arguments, and as macros with at most 9 arguments + % are by far more frequent than macro with 10 or more arguments, defining + % twice the \macarg.BLAH macros does not cost too much processing power. + \ifnum\paramno<10\relax\else + \paramno0\relax + \parsemmanyargdef@@#1,;,% 10 or more arguments + \fi +} +\def\parsemargdefxxx#1,{% + \if#1;\let\next=\relax + \else \let\next=\parsemargdefxxx + \advance\paramno by 1 + \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname + {\xeatspaces{\hash\the\paramno}}% + \edef\paramlist{\paramlist\hash\the\paramno,}% + \fi\next} + +\def\parsemmanyargdef@@#1,{% + \if#1;\let\next=\relax + \else + \let\next=\parsemmanyargdef@@ + \edef\tempb{\eatspaces{#1}}% + \expandafter\def\expandafter\tempa + \expandafter{\csname macarg.\tempb\endcsname}% + % Note that we need some extra \noexpand\noexpand, this is because we + % don't want \the to be expanded in the \parsermacbody as it uses an + % \xdef . + \expandafter\edef\tempa + {\noexpand\noexpand\noexpand\the\toks\the\paramno}% + \advance\paramno by 1\relax + \fi\next} + +% These two commands read recursive and nonrecursive macro bodies. +% (They're different since rec and nonrec macros end differently.) +% + +\catcode `\@\texiatcatcode +\long\def\parsemacbody#1@end macro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% +\long\def\parsermacbody#1@end rmacro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% +\catcode `\@=11\relax + +\let\endargs@\relax +\let\nil@\relax +\def\nilm@{\nil@}% +\long\def\nillm@{\nil@}% + +% This macro is expanded during the Texinfo macro expansion, not during its +% definition. It gets all the arguments values and assigns them to macros +% macarg.ARGNAME +% +% #1 is the macro name +% #2 is the list of argument names +% #3 is the list of argument values +\def\getargvals@#1#2#3{% + \def\macargdeflist@{}% + \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion. + \def\paramlist{#2,\nil@}% + \def\macroname{#1}% + \begingroup + \macroargctxt + \def\argvaluelist{#3,\nil@}% + \def\@tempa{#3}% + \ifx\@tempa\empty + \setemptyargvalues@ + \else + \getargvals@@ + \fi +} + +% +\def\getargvals@@{% + \ifx\paramlist\nilm@ + % Some sanity check needed here that \argvaluelist is also empty. + \ifx\argvaluelist\nillm@ + \else + \errhelp = \EMsimple + \errmessage{Too many arguments in macro `\macroname'!}% + \fi + \let\next\macargexpandinbody@ + \else + \ifx\argvaluelist\nillm@ + % No more arguments values passed to macro. Set remaining named-arg + % macros to empty. + \let\next\setemptyargvalues@ + \else + % pop current arg name into \@tempb + \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}% + \expandafter\@tempa\expandafter{\paramlist}% + % pop current argument value into \@tempc + \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}% + \expandafter\@tempa\expandafter{\argvaluelist}% + % Here \@tempb is the current arg name and \@tempc is the current arg value. + % First place the new argument macro definition into \@tempd + \expandafter\macname\expandafter{\@tempc}% + \expandafter\let\csname macarg.\@tempb\endcsname\relax + \expandafter\def\expandafter\@tempe\expandafter{% + \csname macarg.\@tempb\endcsname}% + \edef\@tempd{\long\def\@tempe{\the\macname}}% + \push@\@tempd\macargdeflist@ + \let\next\getargvals@@ + \fi + \fi + \next +} + +\def\push@#1#2{% + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter#2% + \expandafter\expandafter\expandafter{% + \expandafter#1#2}% +} + +% Replace arguments by their values in the macro body, and place the result +% in macro \@tempa +\def\macvalstoargs@{% + % To do this we use the property that token registers that are \the'ed + % within an \edef expand only once. So we are going to place all argument + % values into respective token registers. + % + % First we save the token context, and initialize argument numbering. + \begingroup + \paramno0\relax + % Then, for each argument number #N, we place the corresponding argument + % value into a new token list register \toks#N + \expandafter\putargsintokens@\saveparamlist@,;,% + % Then, we expand the body so that argument are replaced by their + % values. The trick for values not to be expanded themselves is that they + % are within tokens and that tokens expand only once in an \edef . + \edef\@tempc{\csname mac.\macroname .body\endcsname}% + % Now we restore the token stack pointer to free the token list registers + % which we have used, but we make sure that expanded body is saved after + % group. + \expandafter + \endgroup + \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% + } + +\def\macargexpandinbody@{% + %% Define the named-macro outside of this group and then close this group. + \expandafter + \endgroup + \macargdeflist@ + % First the replace in body the macro arguments by their values, the result + % is in \@tempa . + \macvalstoargs@ + % Then we point at the \norecurse or \gobble (for recursive) macro value + % with \@tempb . + \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname + % Depending on whether it is recursive or not, we need some tailing + % \egroup . + \ifx\@tempb\gobble + \let\@tempc\relax + \else + \let\@tempc\egroup + \fi + % And now we do the real job: + \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}% + \@tempd +} + +\def\putargsintokens@#1,{% + \if#1;\let\next\relax + \else + \let\next\putargsintokens@ + % First we allocate the new token list register, and give it a temporary + % alias \@tempb . + \toksdef\@tempb\the\paramno + % Then we place the argument value into that token list register. + \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname + \expandafter\@tempb\expandafter{\@tempa}% + \advance\paramno by 1\relax + \fi + \next +} + +% Save the token stack pointer into macro #1 +\def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}} +% Restore the token stack pointer from number in macro #1 +\def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax} +% newtoks that can be used non \outer . +\def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi} + +% Tailing missing arguments are set to empty +\def\setemptyargvalues@{% + \ifx\paramlist\nilm@ + \let\next\macargexpandinbody@ + \else + \expandafter\setemptyargvaluesparser@\paramlist\endargs@ + \let\next\setemptyargvalues@ + \fi + \next +} + +\def\setemptyargvaluesparser@#1,#2\endargs@{% + \expandafter\def\expandafter\@tempa\expandafter{% + \expandafter\def\csname macarg.#1\endcsname{}}% + \push@\@tempa\macargdeflist@ + \def\paramlist{#2}% +} + +% #1 is the element target macro +% #2 is the list macro +% #3,#4\endargs@ is the list value +\def\pop@#1#2#3,#4\endargs@{% + \def#1{#3}% + \def#2{#4}% +} +\long\def\longpop@#1#2#3,#4\endargs@{% + \long\def#1{#3}% + \long\def#2{#4}% +} + +% This defines a Texinfo @macro. There are eight cases: recursive and +% nonrecursive macros of zero, one, up to nine, and many arguments. +% Much magic with \expandafter here. +% \xdef is used so that macro definitions will survive the file +% they're defined in; @include reads the file inside a group. +% +\def\defmacro{% + \let\hash=##% convert placeholders to macro parameter chars + \ifrecursive + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\scanmacro{\temp}}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup\noexpand\scanmacro{\temp}}% + \else + \ifnum\paramno<10\relax % at most 9 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{\egroup\noexpand\scanmacro{\temp}}% + \else % 10 or more + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\getargvals@{\the\macname}{\argl}% + }% + \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp + \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble + \fi + \fi + \else + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \else % at most 9 + \ifnum\paramno<10\relax + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \expandafter\noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \else % 10 or more: + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\getargvals@{\the\macname}{\argl}% + }% + \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp + \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse + \fi + \fi + \fi} + +\catcode `\@\texiatcatcode\relax + +\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} + +% \braceorline decides whether the next nonwhitespace character is a +% {. If so it reads up to the closing }, if not, it reads the whole +% line. Whatever was read is then fed to the next control sequence +% as an argument (by \parsebrace or \parsearg). +% +\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} +\def\braceorlinexxx{% + \ifx\nchar\bgroup\else + \expandafter\parsearg + \fi \macnamexxx} + + +% @alias. +% We need some trickery to remove the optional spaces around the equal +% sign. Make them active and then expand them all to nothing. +% +\def\alias{\parseargusing\obeyspaces\aliasxxx} +\def\aliasxxx #1{\aliasyyy#1\relax} +\def\aliasyyy #1=#2\relax{% + {% + \expandafter\let\obeyedspace=\empty + \addtomacrolist{#1}% + \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% + }% + \next +} + + +\message{cross references,} + +\newwrite\auxfile +\newif\ifhavexrefs % True if xref values are known. +\newif\ifwarnedxrefs % True if we warned once that they aren't known. + +% @inforef is relatively simple. +\def\inforef #1{\inforefzzz #1,,,,**} +\def\inforefzzz #1,#2,#3,#4**{% + \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, + node \samp{\ignorespaces#1{}}} + +% @node's only job in TeX is to define \lastnode, which is used in +% cross-references. The @node line might or might not have commas, and +% might or might not have spaces before the first comma, like: +% @node foo , bar , ... +% We don't want such trailing spaces in the node name. +% +\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} +% +% also remove a trailing comma, in case of something like this: +% @node Help-Cross, , , Cross-refs +\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} +\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} + +\let\nwnode=\node +\let\lastnode=\empty + +% Write a cross-reference definition for the current node. #1 is the +% type (Ynumbered, Yappendix, Ynothing). +% +\def\donoderef#1{% + \ifx\lastnode\empty\else + \setref{\lastnode}{#1}% + \global\let\lastnode=\empty + \fi +} + +% @anchor{NAME} -- define xref target at arbitrary point. +% +\newcount\savesfregister +% +\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} +\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} +\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} + +% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an +% anchor), which consists of three parts: +% 1) NAME-title - the current sectioning name taken from \lastsection, +% or the anchor name. +% 2) NAME-snt - section number and type, passed as the SNT arg, or +% empty for anchors. +% 3) NAME-pg - the page number. +% +% This is called from \donoderef, \anchor, and \dofloat. In the case of +% floats, there is an additional part, which is not written here: +% 4) NAME-lof - the text as it should appear in a @listoffloats. +% +\def\setref#1#2{% + \pdfmkdest{#1}% + \iflinks + {% + \atdummies % preserve commands, but don't expand them + \edef\writexrdef##1##2{% + \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef + ##1}{##2}}% these are parameters of \writexrdef + }% + \toks0 = \expandafter{\lastsection}% + \immediate \writexrdef{title}{\the\toks0 }% + \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. + \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout + }% + \fi +} + +% @xrefautosectiontitle on|off says whether @section(ing) names are used +% automatically in xrefs, if the third arg is not explicitly specified. +% This was provided as a "secret" @set xref-automatic-section-title +% variable, now it's official. +% +\parseargdef\xrefautomaticsectiontitle{% + \def\temp{#1}% + \ifx\temp\onword + \expandafter\let\csname SETxref-automatic-section-title\endcsname + = \empty + \else\ifx\temp\offword + \expandafter\let\csname SETxref-automatic-section-title\endcsname + = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @xrefautomaticsectiontitle value `\temp', + must be on|off}% + \fi\fi +} + +% +% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is +% the node name, #2 the name of the Info cross-reference, #3 the printed +% node name, #4 the name of the Info file, #5 the name of the printed +% manual. All but the node name can be omitted. +% +\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} +\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} +\def\ref#1{\xrefX[#1,,,,,,,]} +% +\newbox\toprefbox +\newbox\printedrefnamebox +\newbox\infofilenamebox +\newbox\printedmanualbox +% +\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup + \unsepspaces + % + % Get args without leading/trailing spaces. + \def\printedrefname{\ignorespaces #3}% + \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}% + % + \def\infofilename{\ignorespaces #4}% + \setbox\infofilenamebox = \hbox{\infofilename\unskip}% + % + \def\printedmanual{\ignorespaces #5}% + \setbox\printedmanualbox = \hbox{\printedmanual\unskip}% + % + % If the printed reference name (arg #3) was not explicitly given in + % the @xref, figure out what we want to use. + \ifdim \wd\printedrefnamebox = 0pt + % No printed node name was explicitly given. + \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax + % Not auto section-title: use node name inside the square brackets. + \def\printedrefname{\ignorespaces #1}% + \else + % Auto section-title: use chapter/section title inside + % the square brackets if we have it. + \ifdim \wd\printedmanualbox > 0pt + % It is in another manual, so we don't have it; use node name. + \def\printedrefname{\ignorespaces #1}% + \else + \ifhavexrefs + % We (should) know the real title if we have the xref values. + \def\printedrefname{\refx{#1-title}{}}% + \else + % Otherwise just copy the Info node name. + \def\printedrefname{\ignorespaces #1}% + \fi% + \fi + \fi + \fi + % + % Make link in pdf output. + \ifpdf + {\indexnofonts + \turnoffactive + \makevalueexpandable + % This expands tokens, so do it after making catcode changes, so _ + % etc. don't get their TeX definitions. This ignores all spaces in + % #4, including (wrongly) those in the middle of the filename. + \getfilename{#4}% + % + % This (wrongly) does not take account of leading or trailing + % spaces in #1, which should be ignored. + \edef\pdfxrefdest{#1}% + \ifx\pdfxrefdest\empty + \def\pdfxrefdest{Top}% no empty targets + \else + \txiescapepdf\pdfxrefdest % escape PDF special chars + \fi + % + \leavevmode + \startlink attr{/Border [0 0 0]}% + \ifnum\filenamelength>0 + goto file{\the\filename.pdf} name{\pdfxrefdest}% + \else + goto name{\pdfmkpgn{\pdfxrefdest}}% + \fi + }% + \setcolor{\linkcolor}% + \fi + % + % Float references are printed completely differently: "Figure 1.2" + % instead of "[somenode], p.3". We distinguish them by the + % LABEL-title being set to a magic string. + {% + % Have to otherify everything special to allow the \csname to + % include an _ in the xref name, etc. + \indexnofonts + \turnoffactive + \expandafter\global\expandafter\let\expandafter\Xthisreftitle + \csname XR#1-title\endcsname + }% + \iffloat\Xthisreftitle + % If the user specified the print name (third arg) to the ref, + % print it instead of our usual "Figure 1.2". + \ifdim\wd\printedrefnamebox = 0pt + \refx{#1-snt}{}% + \else + \printedrefname + \fi + % + % If the user also gave the printed manual name (fifth arg), append + % "in MANUALNAME". + \ifdim \wd\printedmanualbox > 0pt + \space \putwordin{} \cite{\printedmanual}% + \fi + \else + % node/anchor (non-float) references. + % + % If we use \unhbox to print the node names, TeX does not insert + % empty discretionaries after hyphens, which means that it will not + % find a line break at a hyphen in a node names. Since some manuals + % are best written with fairly long node names, containing hyphens, + % this is a loss. Therefore, we give the text of the node name + % again, so it is as if TeX is seeing it for the first time. + % + \ifdim \wd\printedmanualbox > 0pt + % Cross-manual reference with a printed manual name. + % + \crossmanualxref{\cite{\printedmanual\unskip}}% + % + \else\ifdim \wd\infofilenamebox > 0pt + % Cross-manual reference with only an info filename (arg 4), no + % printed manual name (arg 5). This is essentially the same as + % the case above; we output the filename, since we have nothing else. + % + \crossmanualxref{\code{\infofilename\unskip}}% + % + \else + % Reference within this manual. + % + % _ (for example) has to be the character _ for the purposes of the + % control sequence corresponding to the node, but it has to expand + % into the usual \leavevmode...\vrule stuff for purposes of + % printing. So we \turnoffactive for the \refx-snt, back on for the + % printing, back off for the \refx-pg. + {\turnoffactive + % Only output a following space if the -snt ref is nonempty; for + % @unnumbered and @anchor, it won't be. + \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% + \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi + }% + % output the `[mynode]' via the macro below so it can be overridden. + \xrefprintnodename\printedrefname + % + % But we always want a comma and a space: + ,\space + % + % output the `page 3'. + \turnoffactive \putwordpage\tie\refx{#1-pg}{}% + \fi\fi + \fi + \endlink +\endgroup} + +% Output a cross-manual xref to #1. Used just above (twice). +% +% Only include the text "Section ``foo'' in" if the foo is neither +% missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply +% "see The Foo Manual", the idea being to refer to the whole manual. +% +% But, this being TeX, we can't easily compare our node name against the +% string "Top" while ignoring the possible spaces before and after in +% the input. By adding the arbitrary 7sp below, we make it much less +% likely that a real node name would have the same width as "Top" (e.g., +% in a monospaced font). Hopefully it will never happen in practice. +% +% For the same basic reason, we retypeset the "Top" at every +% reference, since the current font is indeterminate. +% +\def\crossmanualxref#1{% + \setbox\toprefbox = \hbox{Top\kern7sp}% + \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}% + \ifdim \wd2 > 7sp % nonempty? + \ifdim \wd2 = \wd\toprefbox \else % same as Top? + \putwordSection{} ``\printedrefname'' \putwordin{}\space + \fi + \fi + #1% +} + +% This macro is called from \xrefX for the `[nodename]' part of xref +% output. It's a separate macro only so it can be changed more easily, +% since square brackets don't work well in some documents. Particularly +% one that Bob is working on :). +% +\def\xrefprintnodename#1{[#1]} + +% Things referred to by \setref. +% +\def\Ynothing{} +\def\Yomitfromtoc{} +\def\Ynumbered{% + \ifnum\secno=0 + \putwordChapter@tie \the\chapno + \else \ifnum\subsecno=0 + \putwordSection@tie \the\chapno.\the\secno + \else \ifnum\subsubsecno=0 + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno + \else + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} +\def\Yappendix{% + \ifnum\secno=0 + \putwordAppendix@tie @char\the\appendixno{}% + \else \ifnum\subsecno=0 + \putwordSection@tie @char\the\appendixno.\the\secno + \else \ifnum\subsubsecno=0 + \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno + \else + \putwordSection@tie + @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} + +% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. +% If its value is nonempty, SUFFIX is output afterward. +% +\def\refx#1#2{% + {% + \indexnofonts + \otherbackslash + \expandafter\global\expandafter\let\expandafter\thisrefX + \csname XR#1\endcsname + }% + \ifx\thisrefX\relax + % If not defined, say something at least. + \angleleft un\-de\-fined\angleright + \iflinks + \ifhavexrefs + {\toks0 = {#1}% avoid expansion of possibly-complex value + \message{\linenumber Undefined cross reference `\the\toks0'.}}% + \else + \ifwarnedxrefs\else + \global\warnedxrefstrue + \message{Cross reference values unknown; you must run TeX again.}% + \fi + \fi + \fi + \else + % It's defined, so just use it. + \thisrefX + \fi + #2% Output the suffix in any case. +} + +% This is the macro invoked by entries in the aux file. Usually it's +% just a \def (we prepend XR to the control sequence name to avoid +% collisions). But if this is a float type, we have more work to do. +% +\def\xrdef#1#2{% + {% The node name might contain 8-bit characters, which in our current + % implementation are changed to commands like @'e. Don't let these + % mess up the control sequence name. + \indexnofonts + \turnoffactive + \xdef\safexrefname{#1}% + }% + % + \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref + % + % Was that xref control sequence that we just defined for a float? + \expandafter\iffloat\csname XR\safexrefname\endcsname + % it was a float, and we have the (safe) float type in \iffloattype. + \expandafter\let\expandafter\floatlist + \csname floatlist\iffloattype\endcsname + % + % Is this the first time we've seen this float type? + \expandafter\ifx\floatlist\relax + \toks0 = {\do}% yes, so just \do + \else + % had it before, so preserve previous elements in list. + \toks0 = \expandafter{\floatlist\do}% + \fi + % + % Remember this xref in the control sequence \floatlistFLOATTYPE, + % for later use in \listoffloats. + \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 + {\safexrefname}}% + \fi +} + +% Read the last existing aux file, if any. No error if none exists. +% +\def\tryauxfile{% + \openin 1 \jobname.aux + \ifeof 1 \else + \readdatafile{aux}% + \global\havexrefstrue + \fi + \closein 1 +} + +\def\setupdatafile{% + \catcode`\^^@=\other + \catcode`\^^A=\other + \catcode`\^^B=\other + \catcode`\^^C=\other + \catcode`\^^D=\other + \catcode`\^^E=\other + \catcode`\^^F=\other + \catcode`\^^G=\other + \catcode`\^^H=\other + \catcode`\^^K=\other + \catcode`\^^L=\other + \catcode`\^^N=\other + \catcode`\^^P=\other + \catcode`\^^Q=\other + \catcode`\^^R=\other + \catcode`\^^S=\other + \catcode`\^^T=\other + \catcode`\^^U=\other + \catcode`\^^V=\other + \catcode`\^^W=\other + \catcode`\^^X=\other + \catcode`\^^Z=\other + \catcode`\^^[=\other + \catcode`\^^\=\other + \catcode`\^^]=\other + \catcode`\^^^=\other + \catcode`\^^_=\other + % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. + % in xref tags, i.e., node names. But since ^^e4 notation isn't + % supported in the main text, it doesn't seem desirable. Furthermore, + % that is not enough: for node names that actually contain a ^ + % character, we would end up writing a line like this: 'xrdef {'hat + % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first + % argument, and \hat is not an expandable control sequence. It could + % all be worked out, but why? Either we support ^^ or we don't. + % + % The other change necessary for this was to define \auxhat: + % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter + % and then to call \auxhat in \setq. + % + \catcode`\^=\other + % + % Special characters. Should be turned off anyway, but... + \catcode`\~=\other + \catcode`\[=\other + \catcode`\]=\other + \catcode`\"=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\$=\other + \catcode`\#=\other + \catcode`\&=\other + \catcode`\%=\other + \catcode`+=\other % avoid \+ for paranoia even though we've turned it off + % + % This is to support \ in node names and titles, since the \ + % characters end up in a \csname. It's easier than + % leaving it active and making its active definition an actual \ + % character. What I don't understand is why it works in the *value* + % of the xrdef. Seems like it should be a catcode12 \, and that + % should not typeset properly. But it works, so I'm moving on for + % now. --karl, 15jan04. + \catcode`\\=\other + % + % Make the characters 128-255 be printing characters. + {% + \count1=128 + \def\loop{% + \catcode\count1=\other + \advance\count1 by 1 + \ifnum \count1<256 \loop \fi + }% + }% + % + % @ is our escape character in .aux files, and we need braces. + \catcode`\{=1 + \catcode`\}=2 + \catcode`\@=0 +} + +\def\readdatafile#1{% +\begingroup + \setupdatafile + \input\jobname.#1 +\endgroup} + + +\message{insertions,} +% including footnotes. + +\newcount \footnoteno + +% The trailing space in the following definition for supereject is +% vital for proper filling; pages come out unaligned when you do a +% pagealignmacro call if that space before the closing brace is +% removed. (Generally, numeric constants should always be followed by a +% space to prevent strange expansion errors.) +\def\supereject{\par\penalty -20000\footnoteno =0 } + +% @footnotestyle is meaningful for Info output only. +\let\footnotestyle=\comment + +{\catcode `\@=11 +% +% Auto-number footnotes. Otherwise like plain. +\gdef\footnote{% + \let\indent=\ptexindent + \let\noindent=\ptexnoindent + \global\advance\footnoteno by \@ne + \edef\thisfootno{$^{\the\footnoteno}$}% + % + % In case the footnote comes at the end of a sentence, preserve the + % extra spacing after we do the footnote number. + \let\@sf\empty + \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi + % + % Remove inadvertent blank space before typesetting the footnote number. + \unskip + \thisfootno\@sf + \dofootnote +}% + +% Don't bother with the trickery in plain.tex to not require the +% footnote text as a parameter. Our footnotes don't need to be so general. +% +% Oh yes, they do; otherwise, @ifset (and anything else that uses +% \parseargline) fails inside footnotes because the tokens are fixed when +% the footnote is read. --karl, 16nov96. +% +\gdef\dofootnote{% + \insert\footins\bgroup + % We want to typeset this text as a normal paragraph, even if the + % footnote reference occurs in (for example) a display environment. + % So reset some parameters. + \hsize=\pagewidth + \interlinepenalty\interfootnotelinepenalty + \splittopskip\ht\strutbox % top baseline for broken footnotes + \splitmaxdepth\dp\strutbox + \floatingpenalty\@MM + \leftskip\z@skip + \rightskip\z@skip + \spaceskip\z@skip + \xspaceskip\z@skip + \parindent\defaultparindent + % + \smallfonts \rm + % + % Because we use hanging indentation in footnotes, a @noindent appears + % to exdent this text, so make it be a no-op. makeinfo does not use + % hanging indentation so @noindent can still be needed within footnote + % text after an @example or the like (not that this is good style). + \let\noindent = \relax + % + % Hang the footnote text off the number. Use \everypar in case the + % footnote extends for more than one paragraph. + \everypar = {\hang}% + \textindent{\thisfootno}% + % + % Don't crash into the line above the footnote text. Since this + % expands into a box, it must come within the paragraph, lest it + % provide a place where TeX can split the footnote. + \footstrut + % + % Invoke rest of plain TeX footnote routine. + \futurelet\next\fo@t +} +}%end \catcode `\@=11 + +% In case a @footnote appears in a vbox, save the footnote text and create +% the real \insert just after the vbox finished. Otherwise, the insertion +% would be lost. +% Similarly, if a @footnote appears inside an alignment, save the footnote +% text to a box and make the \insert when a row of the table is finished. +% And the same can be done for other insert classes. --kasal, 16nov03. + +% Replace the \insert primitive by a cheating macro. +% Deeper inside, just make sure that the saved insertions are not spilled +% out prematurely. +% +\def\startsavinginserts{% + \ifx \insert\ptexinsert + \let\insert\saveinsert + \else + \let\checkinserts\relax + \fi +} + +% This \insert replacement works for both \insert\footins{foo} and +% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. +% +\def\saveinsert#1{% + \edef\next{\noexpand\savetobox \makeSAVEname#1}% + \afterassignment\next + % swallow the left brace + \let\temp = +} +\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} +\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} + +\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} + +\def\placesaveins#1{% + \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname + {\box#1}% +} + +% eat @SAVE -- beware, all of them have catcode \other: +{ + \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) + \gdef\gobblesave @SAVE{} +} + +% initialization: +\def\newsaveins #1{% + \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% + \next +} +\def\newsaveinsX #1{% + \csname newbox\endcsname #1% + \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts + \checksaveins #1}% +} + +% initialize: +\let\checkinserts\empty +\newsaveins\footins +\newsaveins\margin + + +% @image. We use the macros from epsf.tex to support this. +% If epsf.tex is not installed and @image is used, we complain. +% +% Check for and read epsf.tex up front. If we read it only at @image +% time, we might be inside a group, and then its definitions would get +% undone and the next image would fail. +\openin 1 = epsf.tex +\ifeof 1 \else + % Do not bother showing banner with epsf.tex v2.7k (available in + % doc/epsf.tex and on ctan). + \def\epsfannounce{\toks0 = }% + \input epsf.tex +\fi +\closein 1 +% +% We will only complain once about lack of epsf.tex. +\newif\ifwarnednoepsf +\newhelp\noepsfhelp{epsf.tex must be installed for images to + work. It is also included in the Texinfo distribution, or you can get + it from ftp://tug.org/tex/epsf.tex.} +% +\def\image#1{% + \ifx\epsfbox\thisisundefined + \ifwarnednoepsf \else + \errhelp = \noepsfhelp + \errmessage{epsf.tex not found, images will be ignored}% + \global\warnednoepsftrue + \fi + \else + \imagexxx #1,,,,,\finish + \fi +} +% +% Arguments to @image: +% #1 is (mandatory) image filename; we tack on .eps extension. +% #2 is (optional) width, #3 is (optional) height. +% #4 is (ignored optional) html alt text. +% #5 is (ignored optional) extension. +% #6 is just the usual extra ignored arg for parsing stuff. +\newif\ifimagevmode +\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup + \catcode`\^^M = 5 % in case we're inside an example + \normalturnoffactive % allow _ et al. in names + % If the image is by itself, center it. + \ifvmode + \imagevmodetrue + \else \ifx\centersub\centerV + % for @center @image, we need a vbox so we can have our vertical space + \imagevmodetrue + \vbox\bgroup % vbox has better behavior than vtop herev + \fi\fi + % + \ifimagevmode + \nobreak\medskip + % Usually we'll have text after the image which will insert + % \parskip glue, so insert it here too to equalize the space + % above and below. + \nobreak\vskip\parskip + \nobreak + \fi + % + % Leave vertical mode so that indentation from an enclosing + % environment such as @quotation is respected. + % However, if we're at the top level, we don't want the + % normal paragraph indentation. + % On the other hand, if we are in the case of @center @image, we don't + % want to start a paragraph, which will create a hsize-width box and + % eradicate the centering. + \ifx\centersub\centerV\else \noindent \fi + % + % Output the image. + \ifpdf + \dopdfimage{#1}{#2}{#3}% + \else + % \epsfbox itself resets \epsf?size at each figure. + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi + \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi + \epsfbox{#1.eps}% + \fi + % + \ifimagevmode + \medskip % space after a standalone image + \fi + \ifx\centersub\centerV \egroup \fi +\endgroup} + + +% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, +% etc. We don't actually implement floating yet, we always include the +% float "here". But it seemed the best name for the future. +% +\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} + +% There may be a space before second and/or third parameter; delete it. +\def\eatcommaspace#1, {#1,} + +% #1 is the optional FLOATTYPE, the text label for this float, typically +% "Figure", "Table", "Example", etc. Can't contain commas. If omitted, +% this float will not be numbered and cannot be referred to. +% +% #2 is the optional xref label. Also must be present for the float to +% be referable. +% +% #3 is the optional positioning argument; for now, it is ignored. It +% will somehow specify the positions allowed to float to (here, top, bottom). +% +% We keep a separate counter for each FLOATTYPE, which we reset at each +% chapter-level command. +\let\resetallfloatnos=\empty +% +\def\dofloat#1,#2,#3,#4\finish{% + \let\thiscaption=\empty + \let\thisshortcaption=\empty + % + % don't lose footnotes inside @float. + % + % BEWARE: when the floats start float, we have to issue warning whenever an + % insert appears inside a float which could possibly float. --kasal, 26may04 + % + \startsavinginserts + % + % We can't be used inside a paragraph. + \par + % + \vtop\bgroup + \def\floattype{#1}% + \def\floatlabel{#2}% + \def\floatloc{#3}% we do nothing with this yet. + % + \ifx\floattype\empty + \let\safefloattype=\empty + \else + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + \fi + % + % If label is given but no type, we handle that as the empty type. + \ifx\floatlabel\empty \else + % We want each FLOATTYPE to be numbered separately (Figure 1, + % Table 1, Figure 2, ...). (And if no label, no number.) + % + \expandafter\getfloatno\csname\safefloattype floatno\endcsname + \global\advance\floatno by 1 + % + {% + % This magic value for \lastsection is output by \setref as the + % XREFLABEL-title value. \xrefX uses it to distinguish float + % labels (which have a completely different output format) from + % node and anchor labels. And \xrdef uses it to construct the + % lists of floats. + % + \edef\lastsection{\floatmagic=\safefloattype}% + \setref{\floatlabel}{Yfloat}% + }% + \fi + % + % start with \parskip glue, I guess. + \vskip\parskip + % + % Don't suppress indentation if a float happens to start a section. + \restorefirstparagraphindent +} + +% we have these possibilities: +% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap +% @float Foo,lbl & no caption: Foo 1.1 +% @float Foo & @caption{Cap}: Foo: Cap +% @float Foo & no caption: Foo +% @float ,lbl & Caption{Cap}: 1.1: Cap +% @float ,lbl & no caption: 1.1 +% @float & @caption{Cap}: Cap +% @float & no caption: +% +\def\Efloat{% + \let\floatident = \empty + % + % In all cases, if we have a float type, it comes first. + \ifx\floattype\empty \else \def\floatident{\floattype}\fi + % + % If we have an xref label, the number comes next. + \ifx\floatlabel\empty \else + \ifx\floattype\empty \else % if also had float type, need tie first. + \appendtomacro\floatident{\tie}% + \fi + % the number. + \appendtomacro\floatident{\chaplevelprefix\the\floatno}% + \fi + % + % Start the printed caption with what we've constructed in + % \floatident, but keep it separate; we need \floatident again. + \let\captionline = \floatident + % + \ifx\thiscaption\empty \else + \ifx\floatident\empty \else + \appendtomacro\captionline{: }% had ident, so need a colon between + \fi + % + % caption text. + \appendtomacro\captionline{\scanexp\thiscaption}% + \fi + % + % If we have anything to print, print it, with space before. + % Eventually this needs to become an \insert. + \ifx\captionline\empty \else + \vskip.5\parskip + \captionline + % + % Space below caption. + \vskip\parskip + \fi + % + % If have an xref label, write the list of floats info. Do this + % after the caption, to avoid chance of it being a breakpoint. + \ifx\floatlabel\empty \else + % Write the text that goes in the lof to the aux file as + % \floatlabel-lof. Besides \floatident, we include the short + % caption if specified, else the full caption if specified, else nothing. + {% + \atdummies + % + % since we read the caption text in the macro world, where ^^M + % is turned into a normal character, we have to scan it back, so + % we don't write the literal three characters "^^M" into the aux file. + \scanexp{% + \xdef\noexpand\gtemp{% + \ifx\thisshortcaption\empty + \thiscaption + \else + \thisshortcaption + \fi + }% + }% + \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident + \ifx\gtemp\empty \else : \gtemp \fi}}% + }% + \fi + \egroup % end of \vtop + % + % place the captured inserts + % + % BEWARE: when the floats start floating, we have to issue warning + % whenever an insert appears inside a float which could possibly + % float. --kasal, 26may04 + % + \checkinserts +} + +% Append the tokens #2 to the definition of macro #1, not expanding either. +% +\def\appendtomacro#1#2{% + \expandafter\def\expandafter#1\expandafter{#1#2}% +} + +% @caption, @shortcaption +% +\def\caption{\docaption\thiscaption} +\def\shortcaption{\docaption\thisshortcaption} +\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} +\def\defcaption#1#2{\egroup \def#1{#2}} + +% The parameter is the control sequence identifying the counter we are +% going to use. Create it if it doesn't exist and assign it to \floatno. +\def\getfloatno#1{% + \ifx#1\relax + % Haven't seen this figure type before. + \csname newcount\endcsname #1% + % + % Remember to reset this floatno at the next chap. + \expandafter\gdef\expandafter\resetallfloatnos + \expandafter{\resetallfloatnos #1=0 }% + \fi + \let\floatno#1% +} + +% \setref calls this to get the XREFLABEL-snt value. We want an @xref +% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we +% first read the @float command. +% +\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% + +% Magic string used for the XREFLABEL-title value, so \xrefX can +% distinguish floats from other xref types. +\def\floatmagic{!!float!!} + +% #1 is the control sequence we are passed; we expand into a conditional +% which is true if #1 represents a float ref. That is, the magic +% \lastsection value which we \setref above. +% +\def\iffloat#1{\expandafter\doiffloat#1==\finish} +% +% #1 is (maybe) the \floatmagic string. If so, #2 will be the +% (safe) float type for this float. We set \iffloattype to #2. +% +\def\doiffloat#1=#2=#3\finish{% + \def\temp{#1}% + \def\iffloattype{#2}% + \ifx\temp\floatmagic +} + +% @listoffloats FLOATTYPE - print a list of floats like a table of contents. +% +\parseargdef\listoffloats{% + \def\floattype{#1}% floattype + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + % + % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. + \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax + \ifhavexrefs + % if the user said @listoffloats foo but never @float foo. + \message{\linenumber No `\safefloattype' floats to list.}% + \fi + \else + \begingroup + \leftskip=\tocindent % indent these entries like a toc + \let\do=\listoffloatsdo + \csname floatlist\safefloattype\endcsname + \endgroup + \fi +} + +% This is called on each entry in a list of floats. We're passed the +% xref label, in the form LABEL-title, which is how we save it in the +% aux file. We strip off the -title and look up \XRLABEL-lof, which +% has the text we're supposed to typeset here. +% +% Figures without xref labels will not be included in the list (since +% they won't appear in the aux file). +% +\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} +\def\listoffloatsdoentry#1-title\finish{{% + % Can't fully expand XR#1-lof because it can contain anything. Just + % pass the control sequence. On the other hand, XR#1-pg is just the + % page number, and we want to fully expand that so we can get a link + % in pdf output. + \toksA = \expandafter{\csname XR#1-lof\endcsname}% + % + % use the same \entry macro we use to generate the TOC and index. + \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% + \writeentry +}} + + +\message{localization,} + +% For single-language documents, @documentlanguage is usually given very +% early, just after @documentencoding. Single argument is the language +% (de) or locale (de_DE) abbreviation. +% +{ + \catcode`\_ = \active + \globaldefs=1 +\parseargdef\documentlanguage{\begingroup + \let_=\normalunderscore % normal _ character for filenames + \tex % read txi-??.tex file in plain TeX. + % Read the file by the name they passed if it exists. + \openin 1 txi-#1.tex + \ifeof 1 + \documentlanguagetrywithoutunderscore{#1_\finish}% + \else + \globaldefs = 1 % everything in the txi-LL files needs to persist + \input txi-#1.tex + \fi + \closein 1 + \endgroup % end raw TeX +\endgroup} +% +% If they passed de_DE, and txi-de_DE.tex doesn't exist, +% try txi-de.tex. +% +\gdef\documentlanguagetrywithoutunderscore#1_#2\finish{% + \openin 1 txi-#1.tex + \ifeof 1 + \errhelp = \nolanghelp + \errmessage{Cannot read language file txi-#1.tex}% + \else + \globaldefs = 1 % everything in the txi-LL files needs to persist + \input txi-#1.tex + \fi + \closein 1 +} +}% end of special _ catcode +% +\newhelp\nolanghelp{The given language definition file cannot be found or +is empty. Maybe you need to install it? Putting it in the current +directory should work if nowhere else does.} + +% This macro is called from txi-??.tex files; the first argument is the +% \language name to set (without the "\lang@" prefix), the second and +% third args are \{left,right}hyphenmin. +% +% The language names to pass are determined when the format is built. +% See the etex.log file created at that time, e.g., +% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log. +% +% With TeX Live 2008, etex now includes hyphenation patterns for all +% available languages. This means we can support hyphenation in +% Texinfo, at least to some extent. (This still doesn't solve the +% accented characters problem.) +% +\catcode`@=11 +\def\txisetlanguage#1#2#3{% + % do not set the language if the name is undefined in the current TeX. + \expandafter\ifx\csname lang@#1\endcsname \relax + \message{no patterns for #1}% + \else + \global\language = \csname lang@#1\endcsname + \fi + % but there is no harm in adjusting the hyphenmin values regardless. + \global\lefthyphenmin = #2\relax + \global\righthyphenmin = #3\relax +} + +% Helpers for encodings. +% Set the catcode of characters 128 through 255 to the specified number. +% +\def\setnonasciicharscatcode#1{% + \count255=128 + \loop\ifnum\count255<256 + \global\catcode\count255=#1\relax + \advance\count255 by 1 + \repeat +} + +\def\setnonasciicharscatcodenonglobal#1{% + \count255=128 + \loop\ifnum\count255<256 + \catcode\count255=#1\relax + \advance\count255 by 1 + \repeat +} + +% @documentencoding sets the definition of non-ASCII characters +% according to the specified encoding. +% +\parseargdef\documentencoding{% + % Encoding being declared for the document. + \def\declaredencoding{\csname #1.enc\endcsname}% + % + % Supported encodings: names converted to tokens in order to be able + % to compare them with \ifx. + \def\ascii{\csname US-ASCII.enc\endcsname}% + \def\latnine{\csname ISO-8859-15.enc\endcsname}% + \def\latone{\csname ISO-8859-1.enc\endcsname}% + \def\lattwo{\csname ISO-8859-2.enc\endcsname}% + \def\utfeight{\csname UTF-8.enc\endcsname}% + % + \ifx \declaredencoding \ascii + \asciichardefs + % + \else \ifx \declaredencoding \lattwo + \setnonasciicharscatcode\active + \lattwochardefs + % + \else \ifx \declaredencoding \latone + \setnonasciicharscatcode\active + \latonechardefs + % + \else \ifx \declaredencoding \latnine + \setnonasciicharscatcode\active + \latninechardefs + % + \else \ifx \declaredencoding \utfeight + \setnonasciicharscatcode\active + \utfeightchardefs + % + \else + \message{Unknown document encoding #1, ignoring.}% + % + \fi % utfeight + \fi % latnine + \fi % latone + \fi % lattwo + \fi % ascii +} + +% A message to be logged when using a character that isn't available +% the default font encoding (OT1). +% +\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} + +% Take account of \c (plain) vs. \, (Texinfo) difference. +\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} + +% First, make active non-ASCII characters in order for them to be +% correctly categorized when TeX reads the replacement text of +% macros containing the character definitions. +\setnonasciicharscatcode\active +% +% Latin1 (ISO-8859-1) character definitions. +\def\latonechardefs{% + \gdef^^a0{\tie} + \gdef^^a1{\exclamdown} + \gdef^^a2{\missingcharmsg{CENT SIGN}} + \gdef^^a3{{\pounds}} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\missingcharmsg{YEN SIGN}} + \gdef^^a6{\missingcharmsg{BROKEN BAR}} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\copyright} + \gdef^^aa{\ordf} + \gdef^^ab{\guillemetleft} + \gdef^^ac{$\lnot$} + \gdef^^ad{\-} + \gdef^^ae{\registeredsymbol} + \gdef^^af{\={}} + % + \gdef^^b0{\textdegree} + \gdef^^b1{$\pm$} + \gdef^^b2{$^2$} + \gdef^^b3{$^3$} + \gdef^^b4{\'{}} + \gdef^^b5{$\mu$} + \gdef^^b6{\P} + % + \gdef^^b7{$^.$} + \gdef^^b8{\cedilla\ } + \gdef^^b9{$^1$} + \gdef^^ba{\ordm} + % + \gdef^^bb{\guillemetright} + \gdef^^bc{$1\over4$} + \gdef^^bd{$1\over2$} + \gdef^^be{$3\over4$} + \gdef^^bf{\questiondown} + % + \gdef^^c0{\`A} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\~A} + \gdef^^c4{\"A} + \gdef^^c5{\ringaccent A} + \gdef^^c6{\AE} + \gdef^^c7{\cedilla C} + \gdef^^c8{\`E} + \gdef^^c9{\'E} + \gdef^^ca{\^E} + \gdef^^cb{\"E} + \gdef^^cc{\`I} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\"I} + % + \gdef^^d0{\DH} + \gdef^^d1{\~N} + \gdef^^d2{\`O} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\~O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\O} + \gdef^^d9{\`U} + \gdef^^da{\'U} + \gdef^^db{\^U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\TH} + \gdef^^df{\ss} + % + \gdef^^e0{\`a} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\~a} + \gdef^^e4{\"a} + \gdef^^e5{\ringaccent a} + \gdef^^e6{\ae} + \gdef^^e7{\cedilla c} + \gdef^^e8{\`e} + \gdef^^e9{\'e} + \gdef^^ea{\^e} + \gdef^^eb{\"e} + \gdef^^ec{\`{\dotless i}} + \gdef^^ed{\'{\dotless i}} + \gdef^^ee{\^{\dotless i}} + \gdef^^ef{\"{\dotless i}} + % + \gdef^^f0{\dh} + \gdef^^f1{\~n} + \gdef^^f2{\`o} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\~o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\o} + \gdef^^f9{\`u} + \gdef^^fa{\'u} + \gdef^^fb{\^u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\th} + \gdef^^ff{\"y} +} + +% Latin9 (ISO-8859-15) encoding character definitions. +\def\latninechardefs{% + % Encoding is almost identical to Latin1. + \latonechardefs + % + \gdef^^a4{\euro} + \gdef^^a6{\v S} + \gdef^^a8{\v s} + \gdef^^b4{\v Z} + \gdef^^b8{\v z} + \gdef^^bc{\OE} + \gdef^^bd{\oe} + \gdef^^be{\"Y} +} + +% Latin2 (ISO-8859-2) character definitions. +\def\lattwochardefs{% + \gdef^^a0{\tie} + \gdef^^a1{\ogonek{A}} + \gdef^^a2{\u{}} + \gdef^^a3{\L} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\v L} + \gdef^^a6{\'S} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\v S} + \gdef^^aa{\cedilla S} + \gdef^^ab{\v T} + \gdef^^ac{\'Z} + \gdef^^ad{\-} + \gdef^^ae{\v Z} + \gdef^^af{\dotaccent Z} + % + \gdef^^b0{\textdegree} + \gdef^^b1{\ogonek{a}} + \gdef^^b2{\ogonek{ }} + \gdef^^b3{\l} + \gdef^^b4{\'{}} + \gdef^^b5{\v l} + \gdef^^b6{\'s} + \gdef^^b7{\v{}} + \gdef^^b8{\cedilla\ } + \gdef^^b9{\v s} + \gdef^^ba{\cedilla s} + \gdef^^bb{\v t} + \gdef^^bc{\'z} + \gdef^^bd{\H{}} + \gdef^^be{\v z} + \gdef^^bf{\dotaccent z} + % + \gdef^^c0{\'R} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\u A} + \gdef^^c4{\"A} + \gdef^^c5{\'L} + \gdef^^c6{\'C} + \gdef^^c7{\cedilla C} + \gdef^^c8{\v C} + \gdef^^c9{\'E} + \gdef^^ca{\ogonek{E}} + \gdef^^cb{\"E} + \gdef^^cc{\v E} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\v D} + % + \gdef^^d0{\DH} + \gdef^^d1{\'N} + \gdef^^d2{\v N} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\H O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\v R} + \gdef^^d9{\ringaccent U} + \gdef^^da{\'U} + \gdef^^db{\H U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\cedilla T} + \gdef^^df{\ss} + % + \gdef^^e0{\'r} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\u a} + \gdef^^e4{\"a} + \gdef^^e5{\'l} + \gdef^^e6{\'c} + \gdef^^e7{\cedilla c} + \gdef^^e8{\v c} + \gdef^^e9{\'e} + \gdef^^ea{\ogonek{e}} + \gdef^^eb{\"e} + \gdef^^ec{\v e} + \gdef^^ed{\'{\dotless{i}}} + \gdef^^ee{\^{\dotless{i}}} + \gdef^^ef{\v d} + % + \gdef^^f0{\dh} + \gdef^^f1{\'n} + \gdef^^f2{\v n} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\H o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\v r} + \gdef^^f9{\ringaccent u} + \gdef^^fa{\'u} + \gdef^^fb{\H u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\cedilla t} + \gdef^^ff{\dotaccent{}} +} + +% UTF-8 character definitions. +% +% This code to support UTF-8 is based on LaTeX's utf8.def, with some +% changes for Texinfo conventions. It is included here under the GPL by +% permission from Frank Mittelbach and the LaTeX team. +% +\newcount\countUTFx +\newcount\countUTFy +\newcount\countUTFz + +\gdef\UTFviiiTwoOctets#1#2{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\endcsname} +% +\gdef\UTFviiiThreeOctets#1#2#3{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} +% +\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} + +\gdef\UTFviiiDefined#1{% + \ifx #1\relax + \message{\linenumber Unicode char \string #1 not defined for Texinfo}% + \else + \expandafter #1% + \fi +} + +\begingroup + \catcode`\~13 + \catcode`\"12 + + \def\UTFviiiLoop{% + \global\catcode\countUTFx\active + \uccode`\~\countUTFx + \uppercase\expandafter{\UTFviiiTmp}% + \advance\countUTFx by 1 + \ifnum\countUTFx < \countUTFy + \expandafter\UTFviiiLoop + \fi} + + \countUTFx = "C2 + \countUTFy = "E0 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiTwoOctets\string~}} + \UTFviiiLoop + + \countUTFx = "E0 + \countUTFy = "F0 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiThreeOctets\string~}} + \UTFviiiLoop + + \countUTFx = "F0 + \countUTFy = "F4 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiFourOctets\string~}} + \UTFviiiLoop +\endgroup + +\begingroup + \catcode`\"=12 + \catcode`\<=12 + \catcode`\.=12 + \catcode`\,=12 + \catcode`\;=12 + \catcode`\!=12 + \catcode`\~=13 + + \gdef\DeclareUnicodeCharacter#1#2{% + \countUTFz = "#1\relax + %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% + \begingroup + \parseXMLCharref + \def\UTFviiiTwoOctets##1##2{% + \csname u8:##1\string ##2\endcsname}% + \def\UTFviiiThreeOctets##1##2##3{% + \csname u8:##1\string ##2\string ##3\endcsname}% + \def\UTFviiiFourOctets##1##2##3##4{% + \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% + \expandafter\expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter + \gdef\UTFviiiTmp{#2}% + \endgroup} + + \gdef\parseXMLCharref{% + \ifnum\countUTFz < "A0\relax + \errhelp = \EMsimple + \errmessage{Cannot define Unicode char value < 00A0}% + \else\ifnum\countUTFz < "800\relax + \parseUTFviiiA,% + \parseUTFviiiB C\UTFviiiTwoOctets.,% + \else\ifnum\countUTFz < "10000\relax + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% + \else + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiA!% + \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% + \fi\fi\fi + } + + \gdef\parseUTFviiiA#1{% + \countUTFx = \countUTFz + \divide\countUTFz by 64 + \countUTFy = \countUTFz + \multiply\countUTFz by 64 + \advance\countUTFx by -\countUTFz + \advance\countUTFx by 128 + \uccode `#1\countUTFx + \countUTFz = \countUTFy} + + \gdef\parseUTFviiiB#1#2#3#4{% + \advance\countUTFz by "#10\relax + \uccode `#3\countUTFz + \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} +\endgroup + +\def\utfeightchardefs{% + \DeclareUnicodeCharacter{00A0}{\tie} + \DeclareUnicodeCharacter{00A1}{\exclamdown} + \DeclareUnicodeCharacter{00A3}{\pounds} + \DeclareUnicodeCharacter{00A8}{\"{ }} + \DeclareUnicodeCharacter{00A9}{\copyright} + \DeclareUnicodeCharacter{00AA}{\ordf} + \DeclareUnicodeCharacter{00AB}{\guillemetleft} + \DeclareUnicodeCharacter{00AD}{\-} + \DeclareUnicodeCharacter{00AE}{\registeredsymbol} + \DeclareUnicodeCharacter{00AF}{\={ }} + + \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} + \DeclareUnicodeCharacter{00B4}{\'{ }} + \DeclareUnicodeCharacter{00B8}{\cedilla{ }} + \DeclareUnicodeCharacter{00BA}{\ordm} + \DeclareUnicodeCharacter{00BB}{\guillemetright} + \DeclareUnicodeCharacter{00BF}{\questiondown} + + \DeclareUnicodeCharacter{00C0}{\`A} + \DeclareUnicodeCharacter{00C1}{\'A} + \DeclareUnicodeCharacter{00C2}{\^A} + \DeclareUnicodeCharacter{00C3}{\~A} + \DeclareUnicodeCharacter{00C4}{\"A} + \DeclareUnicodeCharacter{00C5}{\AA} + \DeclareUnicodeCharacter{00C6}{\AE} + \DeclareUnicodeCharacter{00C7}{\cedilla{C}} + \DeclareUnicodeCharacter{00C8}{\`E} + \DeclareUnicodeCharacter{00C9}{\'E} + \DeclareUnicodeCharacter{00CA}{\^E} + \DeclareUnicodeCharacter{00CB}{\"E} + \DeclareUnicodeCharacter{00CC}{\`I} + \DeclareUnicodeCharacter{00CD}{\'I} + \DeclareUnicodeCharacter{00CE}{\^I} + \DeclareUnicodeCharacter{00CF}{\"I} + + \DeclareUnicodeCharacter{00D0}{\DH} + \DeclareUnicodeCharacter{00D1}{\~N} + \DeclareUnicodeCharacter{00D2}{\`O} + \DeclareUnicodeCharacter{00D3}{\'O} + \DeclareUnicodeCharacter{00D4}{\^O} + \DeclareUnicodeCharacter{00D5}{\~O} + \DeclareUnicodeCharacter{00D6}{\"O} + \DeclareUnicodeCharacter{00D8}{\O} + \DeclareUnicodeCharacter{00D9}{\`U} + \DeclareUnicodeCharacter{00DA}{\'U} + \DeclareUnicodeCharacter{00DB}{\^U} + \DeclareUnicodeCharacter{00DC}{\"U} + \DeclareUnicodeCharacter{00DD}{\'Y} + \DeclareUnicodeCharacter{00DE}{\TH} + \DeclareUnicodeCharacter{00DF}{\ss} + + \DeclareUnicodeCharacter{00E0}{\`a} + \DeclareUnicodeCharacter{00E1}{\'a} + \DeclareUnicodeCharacter{00E2}{\^a} + \DeclareUnicodeCharacter{00E3}{\~a} + \DeclareUnicodeCharacter{00E4}{\"a} + \DeclareUnicodeCharacter{00E5}{\aa} + \DeclareUnicodeCharacter{00E6}{\ae} + \DeclareUnicodeCharacter{00E7}{\cedilla{c}} + \DeclareUnicodeCharacter{00E8}{\`e} + \DeclareUnicodeCharacter{00E9}{\'e} + \DeclareUnicodeCharacter{00EA}{\^e} + \DeclareUnicodeCharacter{00EB}{\"e} + \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} + \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} + \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} + \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} + + \DeclareUnicodeCharacter{00F0}{\dh} + \DeclareUnicodeCharacter{00F1}{\~n} + \DeclareUnicodeCharacter{00F2}{\`o} + \DeclareUnicodeCharacter{00F3}{\'o} + \DeclareUnicodeCharacter{00F4}{\^o} + \DeclareUnicodeCharacter{00F5}{\~o} + \DeclareUnicodeCharacter{00F6}{\"o} + \DeclareUnicodeCharacter{00F8}{\o} + \DeclareUnicodeCharacter{00F9}{\`u} + \DeclareUnicodeCharacter{00FA}{\'u} + \DeclareUnicodeCharacter{00FB}{\^u} + \DeclareUnicodeCharacter{00FC}{\"u} + \DeclareUnicodeCharacter{00FD}{\'y} + \DeclareUnicodeCharacter{00FE}{\th} + \DeclareUnicodeCharacter{00FF}{\"y} + + \DeclareUnicodeCharacter{0100}{\=A} + \DeclareUnicodeCharacter{0101}{\=a} + \DeclareUnicodeCharacter{0102}{\u{A}} + \DeclareUnicodeCharacter{0103}{\u{a}} + \DeclareUnicodeCharacter{0104}{\ogonek{A}} + \DeclareUnicodeCharacter{0105}{\ogonek{a}} + \DeclareUnicodeCharacter{0106}{\'C} + \DeclareUnicodeCharacter{0107}{\'c} + \DeclareUnicodeCharacter{0108}{\^C} + \DeclareUnicodeCharacter{0109}{\^c} + \DeclareUnicodeCharacter{0118}{\ogonek{E}} + \DeclareUnicodeCharacter{0119}{\ogonek{e}} + \DeclareUnicodeCharacter{010A}{\dotaccent{C}} + \DeclareUnicodeCharacter{010B}{\dotaccent{c}} + \DeclareUnicodeCharacter{010C}{\v{C}} + \DeclareUnicodeCharacter{010D}{\v{c}} + \DeclareUnicodeCharacter{010E}{\v{D}} + + \DeclareUnicodeCharacter{0112}{\=E} + \DeclareUnicodeCharacter{0113}{\=e} + \DeclareUnicodeCharacter{0114}{\u{E}} + \DeclareUnicodeCharacter{0115}{\u{e}} + \DeclareUnicodeCharacter{0116}{\dotaccent{E}} + \DeclareUnicodeCharacter{0117}{\dotaccent{e}} + \DeclareUnicodeCharacter{011A}{\v{E}} + \DeclareUnicodeCharacter{011B}{\v{e}} + \DeclareUnicodeCharacter{011C}{\^G} + \DeclareUnicodeCharacter{011D}{\^g} + \DeclareUnicodeCharacter{011E}{\u{G}} + \DeclareUnicodeCharacter{011F}{\u{g}} + + \DeclareUnicodeCharacter{0120}{\dotaccent{G}} + \DeclareUnicodeCharacter{0121}{\dotaccent{g}} + \DeclareUnicodeCharacter{0124}{\^H} + \DeclareUnicodeCharacter{0125}{\^h} + \DeclareUnicodeCharacter{0128}{\~I} + \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} + \DeclareUnicodeCharacter{012A}{\=I} + \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} + \DeclareUnicodeCharacter{012C}{\u{I}} + \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} + + \DeclareUnicodeCharacter{0130}{\dotaccent{I}} + \DeclareUnicodeCharacter{0131}{\dotless{i}} + \DeclareUnicodeCharacter{0132}{IJ} + \DeclareUnicodeCharacter{0133}{ij} + \DeclareUnicodeCharacter{0134}{\^J} + \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} + \DeclareUnicodeCharacter{0139}{\'L} + \DeclareUnicodeCharacter{013A}{\'l} + + \DeclareUnicodeCharacter{0141}{\L} + \DeclareUnicodeCharacter{0142}{\l} + \DeclareUnicodeCharacter{0143}{\'N} + \DeclareUnicodeCharacter{0144}{\'n} + \DeclareUnicodeCharacter{0147}{\v{N}} + \DeclareUnicodeCharacter{0148}{\v{n}} + \DeclareUnicodeCharacter{014C}{\=O} + \DeclareUnicodeCharacter{014D}{\=o} + \DeclareUnicodeCharacter{014E}{\u{O}} + \DeclareUnicodeCharacter{014F}{\u{o}} + + \DeclareUnicodeCharacter{0150}{\H{O}} + \DeclareUnicodeCharacter{0151}{\H{o}} + \DeclareUnicodeCharacter{0152}{\OE} + \DeclareUnicodeCharacter{0153}{\oe} + \DeclareUnicodeCharacter{0154}{\'R} + \DeclareUnicodeCharacter{0155}{\'r} + \DeclareUnicodeCharacter{0158}{\v{R}} + \DeclareUnicodeCharacter{0159}{\v{r}} + \DeclareUnicodeCharacter{015A}{\'S} + \DeclareUnicodeCharacter{015B}{\'s} + \DeclareUnicodeCharacter{015C}{\^S} + \DeclareUnicodeCharacter{015D}{\^s} + \DeclareUnicodeCharacter{015E}{\cedilla{S}} + \DeclareUnicodeCharacter{015F}{\cedilla{s}} + + \DeclareUnicodeCharacter{0160}{\v{S}} + \DeclareUnicodeCharacter{0161}{\v{s}} + \DeclareUnicodeCharacter{0162}{\cedilla{t}} + \DeclareUnicodeCharacter{0163}{\cedilla{T}} + \DeclareUnicodeCharacter{0164}{\v{T}} + + \DeclareUnicodeCharacter{0168}{\~U} + \DeclareUnicodeCharacter{0169}{\~u} + \DeclareUnicodeCharacter{016A}{\=U} + \DeclareUnicodeCharacter{016B}{\=u} + \DeclareUnicodeCharacter{016C}{\u{U}} + \DeclareUnicodeCharacter{016D}{\u{u}} + \DeclareUnicodeCharacter{016E}{\ringaccent{U}} + \DeclareUnicodeCharacter{016F}{\ringaccent{u}} + + \DeclareUnicodeCharacter{0170}{\H{U}} + \DeclareUnicodeCharacter{0171}{\H{u}} + \DeclareUnicodeCharacter{0174}{\^W} + \DeclareUnicodeCharacter{0175}{\^w} + \DeclareUnicodeCharacter{0176}{\^Y} + \DeclareUnicodeCharacter{0177}{\^y} + \DeclareUnicodeCharacter{0178}{\"Y} + \DeclareUnicodeCharacter{0179}{\'Z} + \DeclareUnicodeCharacter{017A}{\'z} + \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} + \DeclareUnicodeCharacter{017C}{\dotaccent{z}} + \DeclareUnicodeCharacter{017D}{\v{Z}} + \DeclareUnicodeCharacter{017E}{\v{z}} + + \DeclareUnicodeCharacter{01C4}{D\v{Z}} + \DeclareUnicodeCharacter{01C5}{D\v{z}} + \DeclareUnicodeCharacter{01C6}{d\v{z}} + \DeclareUnicodeCharacter{01C7}{LJ} + \DeclareUnicodeCharacter{01C8}{Lj} + \DeclareUnicodeCharacter{01C9}{lj} + \DeclareUnicodeCharacter{01CA}{NJ} + \DeclareUnicodeCharacter{01CB}{Nj} + \DeclareUnicodeCharacter{01CC}{nj} + \DeclareUnicodeCharacter{01CD}{\v{A}} + \DeclareUnicodeCharacter{01CE}{\v{a}} + \DeclareUnicodeCharacter{01CF}{\v{I}} + + \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} + \DeclareUnicodeCharacter{01D1}{\v{O}} + \DeclareUnicodeCharacter{01D2}{\v{o}} + \DeclareUnicodeCharacter{01D3}{\v{U}} + \DeclareUnicodeCharacter{01D4}{\v{u}} + + \DeclareUnicodeCharacter{01E2}{\={\AE}} + \DeclareUnicodeCharacter{01E3}{\={\ae}} + \DeclareUnicodeCharacter{01E6}{\v{G}} + \DeclareUnicodeCharacter{01E7}{\v{g}} + \DeclareUnicodeCharacter{01E8}{\v{K}} + \DeclareUnicodeCharacter{01E9}{\v{k}} + + \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} + \DeclareUnicodeCharacter{01F1}{DZ} + \DeclareUnicodeCharacter{01F2}{Dz} + \DeclareUnicodeCharacter{01F3}{dz} + \DeclareUnicodeCharacter{01F4}{\'G} + \DeclareUnicodeCharacter{01F5}{\'g} + \DeclareUnicodeCharacter{01F8}{\`N} + \DeclareUnicodeCharacter{01F9}{\`n} + \DeclareUnicodeCharacter{01FC}{\'{\AE}} + \DeclareUnicodeCharacter{01FD}{\'{\ae}} + \DeclareUnicodeCharacter{01FE}{\'{\O}} + \DeclareUnicodeCharacter{01FF}{\'{\o}} + + \DeclareUnicodeCharacter{021E}{\v{H}} + \DeclareUnicodeCharacter{021F}{\v{h}} + + \DeclareUnicodeCharacter{0226}{\dotaccent{A}} + \DeclareUnicodeCharacter{0227}{\dotaccent{a}} + \DeclareUnicodeCharacter{0228}{\cedilla{E}} + \DeclareUnicodeCharacter{0229}{\cedilla{e}} + \DeclareUnicodeCharacter{022E}{\dotaccent{O}} + \DeclareUnicodeCharacter{022F}{\dotaccent{o}} + + \DeclareUnicodeCharacter{0232}{\=Y} + \DeclareUnicodeCharacter{0233}{\=y} + \DeclareUnicodeCharacter{0237}{\dotless{j}} + + \DeclareUnicodeCharacter{02DB}{\ogonek{ }} + + \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} + \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} + \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} + \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} + \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} + \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} + \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} + \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} + \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} + \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} + \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} + \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} + + \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} + \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} + + \DeclareUnicodeCharacter{1E20}{\=G} + \DeclareUnicodeCharacter{1E21}{\=g} + \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} + \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} + \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} + \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} + \DeclareUnicodeCharacter{1E26}{\"H} + \DeclareUnicodeCharacter{1E27}{\"h} + + \DeclareUnicodeCharacter{1E30}{\'K} + \DeclareUnicodeCharacter{1E31}{\'k} + \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} + \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} + \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} + \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} + \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} + \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} + \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} + \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} + \DeclareUnicodeCharacter{1E3E}{\'M} + \DeclareUnicodeCharacter{1E3F}{\'m} + + \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} + \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} + \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} + \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} + \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} + \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} + \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} + \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} + \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} + \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} + + \DeclareUnicodeCharacter{1E54}{\'P} + \DeclareUnicodeCharacter{1E55}{\'p} + \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} + \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} + \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} + \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} + \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} + \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} + \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} + \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} + + \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} + \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} + \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} + \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} + \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} + \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} + \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} + \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} + \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} + \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} + + \DeclareUnicodeCharacter{1E7C}{\~V} + \DeclareUnicodeCharacter{1E7D}{\~v} + \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} + \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} + + \DeclareUnicodeCharacter{1E80}{\`W} + \DeclareUnicodeCharacter{1E81}{\`w} + \DeclareUnicodeCharacter{1E82}{\'W} + \DeclareUnicodeCharacter{1E83}{\'w} + \DeclareUnicodeCharacter{1E84}{\"W} + \DeclareUnicodeCharacter{1E85}{\"w} + \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} + \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} + \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} + \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} + \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} + \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} + \DeclareUnicodeCharacter{1E8C}{\"X} + \DeclareUnicodeCharacter{1E8D}{\"x} + \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} + \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} + + \DeclareUnicodeCharacter{1E90}{\^Z} + \DeclareUnicodeCharacter{1E91}{\^z} + \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} + \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} + \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} + \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} + \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} + \DeclareUnicodeCharacter{1E97}{\"t} + \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} + \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} + + \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} + \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} + + \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} + \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} + \DeclareUnicodeCharacter{1EBC}{\~E} + \DeclareUnicodeCharacter{1EBD}{\~e} + + \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} + \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} + \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} + \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} + + \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} + \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} + + \DeclareUnicodeCharacter{1EF2}{\`Y} + \DeclareUnicodeCharacter{1EF3}{\`y} + \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} + + \DeclareUnicodeCharacter{1EF8}{\~Y} + \DeclareUnicodeCharacter{1EF9}{\~y} + + \DeclareUnicodeCharacter{2013}{--} + \DeclareUnicodeCharacter{2014}{---} + \DeclareUnicodeCharacter{2018}{\quoteleft} + \DeclareUnicodeCharacter{2019}{\quoteright} + \DeclareUnicodeCharacter{201A}{\quotesinglbase} + \DeclareUnicodeCharacter{201C}{\quotedblleft} + \DeclareUnicodeCharacter{201D}{\quotedblright} + \DeclareUnicodeCharacter{201E}{\quotedblbase} + \DeclareUnicodeCharacter{2022}{\bullet} + \DeclareUnicodeCharacter{2026}{\dots} + \DeclareUnicodeCharacter{2039}{\guilsinglleft} + \DeclareUnicodeCharacter{203A}{\guilsinglright} + \DeclareUnicodeCharacter{20AC}{\euro} + + \DeclareUnicodeCharacter{2192}{\expansion} + \DeclareUnicodeCharacter{21D2}{\result} + + \DeclareUnicodeCharacter{2212}{\minus} + \DeclareUnicodeCharacter{2217}{\point} + \DeclareUnicodeCharacter{2261}{\equiv} +}% end of \utfeightchardefs + + +% US-ASCII character definitions. +\def\asciichardefs{% nothing need be done + \relax +} + +% Make non-ASCII characters printable again for compatibility with +% existing Texinfo documents that may use them, even without declaring a +% document encoding. +% +\setnonasciicharscatcode \other + + +\message{formatting,} + +\newdimen\defaultparindent \defaultparindent = 15pt + +\chapheadingskip = 15pt plus 4pt minus 2pt +\secheadingskip = 12pt plus 3pt minus 2pt +\subsecheadingskip = 9pt plus 2pt minus 2pt + +% Prevent underfull vbox error messages. +\vbadness = 10000 + +% Don't be very finicky about underfull hboxes, either. +\hbadness = 6666 + +% Following George Bush, get rid of widows and orphans. +\widowpenalty=10000 +\clubpenalty=10000 + +% Use TeX 3.0's \emergencystretch to help line breaking, but if we're +% using an old version of TeX, don't do anything. We want the amount of +% stretch added to depend on the line length, hence the dependence on +% \hsize. We call this whenever the paper size is set. +% +\def\setemergencystretch{% + \ifx\emergencystretch\thisisundefined + % Allow us to assign to \emergencystretch anyway. + \def\emergencystretch{\dimen0}% + \else + \emergencystretch = .15\hsize + \fi +} + +% Parameters in order: 1) textheight; 2) textwidth; +% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; +% 7) physical page height; 8) physical page width. +% +% We also call \setleading{\textleading}, so the caller should define +% \textleading. The caller should also set \parskip. +% +\def\internalpagesizes#1#2#3#4#5#6#7#8{% + \voffset = #3\relax + \topskip = #6\relax + \splittopskip = \topskip + % + \vsize = #1\relax + \advance\vsize by \topskip + \outervsize = \vsize + \advance\outervsize by 2\topandbottommargin + \pageheight = \vsize + % + \hsize = #2\relax + \outerhsize = \hsize + \advance\outerhsize by 0.5in + \pagewidth = \hsize + % + \normaloffset = #4\relax + \bindingoffset = #5\relax + % + \ifpdf + \pdfpageheight #7\relax + \pdfpagewidth #8\relax + % if we don't reset these, they will remain at "1 true in" of + % whatever layout pdftex was dumped with. + \pdfhorigin = 1 true in + \pdfvorigin = 1 true in + \fi + % + \setleading{\textleading} + % + \parindent = \defaultparindent + \setemergencystretch +} + +% @letterpaper (the default). +\def\letterpaper{{\globaldefs = 1 + \parskip = 3pt plus 2pt minus 1pt + \textleading = 13.2pt + % + % If page is nothing but text, make it come out even. + \internalpagesizes{607.2pt}{6in}% that's 46 lines + {\voffset}{.25in}% + {\bindingoffset}{36pt}% + {11in}{8.5in}% +}} + +% Use @smallbook to reset parameters for 7x9.25 trim size. +\def\smallbook{{\globaldefs = 1 + \parskip = 2pt plus 1pt + \textleading = 12pt + % + \internalpagesizes{7.5in}{5in}% + {-.2in}{0in}% + {\bindingoffset}{16pt}% + {9.25in}{7in}% + % + \lispnarrowing = 0.3in + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = .5cm +}} + +% Use @smallerbook to reset parameters for 6x9 trim size. +% (Just testing, parameters still in flux.) +\def\smallerbook{{\globaldefs = 1 + \parskip = 1.5pt plus 1pt + \textleading = 12pt + % + \internalpagesizes{7.4in}{4.8in}% + {-.2in}{-.4in}% + {0pt}{14pt}% + {9in}{6in}% + % + \lispnarrowing = 0.25in + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = .4cm +}} + +% Use @afourpaper to print on European A4 paper. +\def\afourpaper{{\globaldefs = 1 + \parskip = 3pt plus 2pt minus 1pt + \textleading = 13.2pt + % + % Double-side printing via postscript on Laserjet 4050 + % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. + % To change the settings for a different printer or situation, adjust + % \normaloffset until the front-side and back-side texts align. Then + % do the same for \bindingoffset. You can set these for testing in + % your texinfo source file like this: + % @tex + % \global\normaloffset = -6mm + % \global\bindingoffset = 10mm + % @end tex + \internalpagesizes{673.2pt}{160mm}% that's 51 lines + {\voffset}{\hoffset}% + {\bindingoffset}{44pt}% + {297mm}{210mm}% + % + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = 5mm +}} + +% Use @afivepaper to print on European A5 paper. +% From romildo@urano.iceb.ufop.br, 2 July 2000. +% He also recommends making @example and @lisp be small. +\def\afivepaper{{\globaldefs = 1 + \parskip = 2pt plus 1pt minus 0.1pt + \textleading = 12.5pt + % + \internalpagesizes{160mm}{120mm}% + {\voffset}{\hoffset}% + {\bindingoffset}{8pt}% + {210mm}{148mm}% + % + \lispnarrowing = 0.2in + \tolerance = 800 + \hfuzz = 1.2pt + \contentsrightmargin = 0pt + \defbodyindent = 2mm + \tableindent = 12mm +}} + +% A specific text layout, 24x15cm overall, intended for A4 paper. +\def\afourlatex{{\globaldefs = 1 + \afourpaper + \internalpagesizes{237mm}{150mm}% + {\voffset}{4.6mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% + % + % Must explicitly reset to 0 because we call \afourpaper. + \globaldefs = 0 +}} + +% Use @afourwide to print on A4 paper in landscape format. +\def\afourwide{{\globaldefs = 1 + \afourpaper + \internalpagesizes{241mm}{165mm}% + {\voffset}{-2.95mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% + \globaldefs = 0 +}} + +% @pagesizes TEXTHEIGHT[,TEXTWIDTH] +% Perhaps we should allow setting the margins, \topskip, \parskip, +% and/or leading, also. Or perhaps we should compute them somehow. +% +\parseargdef\pagesizes{\pagesizesyyy #1,,\finish} +\def\pagesizesyyy#1,#2,#3\finish{{% + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi + \globaldefs = 1 + % + \parskip = 3pt plus 2pt minus 1pt + \setleading{\textleading}% + % + \dimen0 = #1\relax + \advance\dimen0 by \voffset + % + \dimen2 = \hsize + \advance\dimen2 by \normaloffset + % + \internalpagesizes{#1}{\hsize}% + {\voffset}{\normaloffset}% + {\bindingoffset}{44pt}% + {\dimen0}{\dimen2}% +}} + +% Set default to letter. +% +\letterpaper + + +\message{and turning on texinfo input format.} + +\def^^L{\par} % remove \outer, so ^L can appear in an @comment + +% DEL is a comment character, in case @c does not suffice. +\catcode`\^^? = 14 + +% Define macros to output various characters with catcode for normal text. +\catcode`\"=\other \def\normaldoublequote{"} +\catcode`\$=\other \def\normaldollar{$}%$ font-lock fix +\catcode`\+=\other \def\normalplus{+} +\catcode`\<=\other \def\normalless{<} +\catcode`\>=\other \def\normalgreater{>} +\catcode`\^=\other \def\normalcaret{^} +\catcode`\_=\other \def\normalunderscore{_} +\catcode`\|=\other \def\normalverticalbar{|} +\catcode`\~=\other \def\normaltilde{~} + +% This macro is used to make a character print one way in \tt +% (where it can probably be output as-is), and another way in other fonts, +% where something hairier probably needs to be done. +% +% #1 is what to print if we are indeed using \tt; #2 is what to print +% otherwise. Since all the Computer Modern typewriter fonts have zero +% interword stretch (and shrink), and it is reasonable to expect all +% typewriter fonts to have this, we can check that font parameter. +% +\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} + +% Same as above, but check for italic font. Actually this also catches +% non-italic slanted fonts since it is impossible to distinguish them from +% italic fonts. But since this is only used by $ and it uses \sl anyway +% this is not a problem. +\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} + +% Turn off all special characters except @ +% (and those which the user can use as if they were ordinary). +% Most of these we simply print from the \tt font, but for some, we can +% use math or other variants that look better in normal text. + +\catcode`\"=\active +\def\activedoublequote{{\tt\char34}} +\let"=\activedoublequote +\catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde +\chardef\hat=`\^ +\catcode`\^=\active \def\activehat{{\tt \hat}} \let^ = \activehat + +\catcode`\_=\active +\def_{\ifusingtt\normalunderscore\_} +\let\realunder=_ +% Subroutine for the previous macro. +\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } + +\catcode`\|=\active +\def|{{\tt\char124}} + +\chardef \less=`\< +\catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless +\chardef \gtr=`\> +\catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr +\catcode`\+=\active \def+{{\tt \char 43}} +\catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix + +% used for headline/footline in the output routine, in case the page +% breaks in the middle of an @tex block. +\def\texinfochars{% + \let< = \activeless + \let> = \activegtr + \let~ = \activetilde + \let^ = \activehat + \markupsetuplqdefault \markupsetuprqdefault + \let\b = \strong + \let\i = \smartitalic + % in principle, all other definitions in \tex have to be undone too. +} + +% If a .fmt file is being used, characters that might appear in a file +% name cannot be active until we have parsed the command line. +% So turn them off again, and have \everyjob (or @setfilename) turn them on. +% \otherifyactive is called near the end of this file. +\def\otherifyactive{\catcode`+=\other \catcode`\_=\other} + +% Used sometimes to turn off (effectively) the active characters even after +% parsing them. +\def\turnoffactive{% + \normalturnoffactive + \otherbackslash +} + +\catcode`\@=0 + +% \backslashcurfont outputs one backslash character in current font, +% as in \char`\\. +\global\chardef\backslashcurfont=`\\ +\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work + +% \realbackslash is an actual character `\' with catcode other, and +% \doublebackslash is two of them (for the pdf outlines). +{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} + +% In texinfo, backslash is an active character; it prints the backslash +% in fixed width font. +\catcode`\\=\active % @ for escape char from now on. + +% The story here is that in math mode, the \char of \backslashcurfont +% ends up printing the roman \ from the math symbol font (because \char +% in math mode uses the \mathcode, and plain.tex sets +% \mathcode`\\="026E). It seems better for @backslashchar{} to always +% print a typewriter backslash, hence we use an explicit \mathchar, +% which is the decimal equivalent of "715c (class 7, e.g., use \fam; +% ignored family value; char position "5C). We can't use " for the +% usual hex value because it has already been made active. +@def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} +@let@backslashchar = @normalbackslash % @backslashchar{} is for user documents. + +% On startup, @fixbackslash assigns: +% @let \ = @normalbackslash +% \rawbackslash defines an active \ to do \backslashcurfont. +% \otherbackslash defines an active \ to be a literal `\' character with +% catcode other. We switch back and forth between these. +@gdef@rawbackslash{@let\=@backslashcurfont} +@gdef@otherbackslash{@let\=@realbackslash} + +% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of +% the literal character `\'. Also revert - to its normal character, in +% case the active - from code has slipped in. +% +{@catcode`- = @active + @gdef@normalturnoffactive{% + @let-=@normaldash + @let"=@normaldoublequote + @let$=@normaldollar %$ font-lock fix + @let+=@normalplus + @let<=@normalless + @let>=@normalgreater + @let\=@normalbackslash + @let^=@normalcaret + @let_=@normalunderscore + @let|=@normalverticalbar + @let~=@normaltilde + @markupsetuplqdefault + @markupsetuprqdefault + @unsepspaces + } +} + +% Make _ and + \other characters, temporarily. +% This is canceled by @fixbackslash. +@otherifyactive + +% If a .fmt file is being used, we don't want the `\input texinfo' to show up. +% That is what \eatinput is for; after that, the `\' should revert to printing +% a backslash. +% +@gdef@eatinput input texinfo{@fixbackslash} +@global@let\ = @eatinput + +% On the other hand, perhaps the file did not have a `\input texinfo'. Then +% the first `\' in the file would cause an error. This macro tries to fix +% that, assuming it is called before the first `\' could plausibly occur. +% Also turn back on active characters that might appear in the input +% file name, in case not using a pre-dumped format. +% +@gdef@fixbackslash{% + @ifx\@eatinput @let\ = @normalbackslash @fi + @catcode`+=@active + @catcode`@_=@active +} + +% Say @foo, not \foo, in error messages. +@escapechar = `@@ + +% These (along with & and #) are made active for url-breaking, so need +% active definitions as the normal characters. +@def@normaldot{.} +@def@normalquest{?} +@def@normalslash{/} + +% These look ok in all fonts, so just make them not special. +% @hashchar{} gets its own user-level command, because of #line. +@catcode`@& = @other @def@normalamp{&} +@catcode`@# = @other @def@normalhash{#} +@catcode`@% = @other @def@normalpercent{%} + +@let @hashchar = @normalhash + +@c Finally, make ` and ' active, so that txicodequoteundirected and +@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we +@c don't make ` and ' active, @code will not get them as active chars. +@c Do this last of all since we use ` in the previous @catcode assignments. +@catcode`@'=@active +@catcode`@`=@active +@markupsetuplqdefault +@markupsetuprqdefault + +@c Local variables: +@c eval: (add-hook 'write-file-hooks 'time-stamp) +@c page-delimiter: "^\\\\message" +@c time-stamp-start: "def\\\\texinfoversion{" +@c time-stamp-format: "%:y-%02m-%02d.%02H" +@c time-stamp-end: "}" +@c End: + +@c vim:sw=2: + +@ignore + arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 +@end ignore diff --git a/doc/version.texi b/doc/version.texi new file mode 100644 index 0000000..5f71e55 --- /dev/null +++ b/doc/version.texi @@ -0,0 +1,10 @@ +@ignore +Copyright (C) 1988-2014 Free Software Foundation, Inc. +@end ignore + +@set LASTCHANGE Sun Feb 2 16:22:00 EST 2014 + +@set EDITION 4.3 +@set VERSION 4.3 +@set UPDATED 2 February 2014 +@set UPDATED-MONTH February 2014 diff --git a/error.c b/error.c new file mode 100644 index 0000000..64c4f41 --- /dev/null +++ b/error.c @@ -0,0 +1,489 @@ +/* error.c -- Functions for handling errors. */ + +/* Copyright (C) 1993-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (PREFER_STDARG) +# include +#else +# include +#endif + +#include + +#include +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +#include "bashansi.h" +#include "bashintl.h" + +#include "shell.h" +#include "flags.h" +#include "input.h" + +#if defined (HISTORY) +# include "bashhist.h" +#endif + +extern int executing_line_number __P((void)); + +extern int last_command_exit_value; +extern char *shell_name; +#if defined (JOB_CONTROL) +extern pid_t shell_pgrp; +extern int give_terminal_to __P((pid_t, int)); +#endif /* JOB_CONTROL */ + +#if defined (ARRAY_VARS) +extern const char * const bash_badsub_errmsg; +#endif + +static void error_prolog __P((int)); + +/* The current maintainer of the shell. You change this in the + Makefile. */ +#if !defined (MAINTAINER) +#define MAINTAINER "bash-maintainers@gnu.org" +#endif + +const char * const the_current_maintainer = MAINTAINER; + +int gnu_error_format = 0; + +static void +error_prolog (print_lineno) + int print_lineno; +{ + char *ename; + int line; + + ename = get_name_for_error (); + line = (print_lineno && interactive_shell == 0) ? executing_line_number () : -1; + + if (line > 0) + fprintf (stderr, "%s:%s%d: ", ename, gnu_error_format ? "" : _(" line "), line); + else + fprintf (stderr, "%s: ", ename); +} + +/* Return the name of the shell or the shell script for error reporting. */ +char * +get_name_for_error () +{ + char *name; +#if defined (ARRAY_VARS) + SHELL_VAR *bash_source_v; + ARRAY *bash_source_a; +#endif + + name = (char *)NULL; + if (interactive_shell == 0) + { +#if defined (ARRAY_VARS) + bash_source_v = find_variable ("BASH_SOURCE"); + if (bash_source_v && array_p (bash_source_v) && + (bash_source_a = array_cell (bash_source_v))) + name = array_reference (bash_source_a, 0); + if (name == 0 || *name == '\0') /* XXX - was just name == 0 */ +#endif + name = dollar_vars[0]; + } + if (name == 0 && shell_name && *shell_name) + name = base_pathname (shell_name); + if (name == 0) +#if defined (PROGRAM) + name = PROGRAM; +#else + name = "bash"; +#endif + + return (name); +} + +/* Report an error having to do with FILENAME. This does not use + sys_error so the filename is not interpreted as a printf-style + format string. */ +void +file_error (filename) + const char *filename; +{ + report_error ("%s: %s", filename, strerror (errno)); +} + +void +#if defined (PREFER_STDARG) +programming_error (const char *format, ...) +#else +programming_error (format, va_alist) + const char *format; + va_dcl +#endif +{ + va_list args; + char *h; + +#if defined (JOB_CONTROL) + give_terminal_to (shell_pgrp, 0); +#endif /* JOB_CONTROL */ + + SH_VA_START (args, format); + + vfprintf (stderr, format, args); + fprintf (stderr, "\n"); + va_end (args); + +#if defined (HISTORY) + if (remember_on_history) + { + h = last_history_line (); + fprintf (stderr, _("last command: %s\n"), h ? h : "(null)"); + } +#endif + +#if 0 + fprintf (stderr, "Report this to %s\n", the_current_maintainer); +#endif + + fprintf (stderr, _("Aborting...")); + fflush (stderr); + + abort (); +} + +/* Print an error message and, if `set -e' has been executed, exit the + shell. Used in this file by file_error and programming_error. Used + outside this file mostly to report substitution and expansion errors, + and for bad invocation options. */ +void +#if defined (PREFER_STDARG) +report_error (const char *format, ...) +#else +report_error (format, va_alist) + const char *format; + va_dcl +#endif +{ + va_list args; + + error_prolog (1); + + SH_VA_START (args, format); + + vfprintf (stderr, format, args); + fprintf (stderr, "\n"); + + va_end (args); + if (exit_immediately_on_error) + { + if (last_command_exit_value == 0) + last_command_exit_value = 1; + exit_shell (last_command_exit_value); + } +} + +void +#if defined (PREFER_STDARG) +fatal_error (const char *format, ...) +#else +fatal_error (format, va_alist) + const char *format; + va_dcl +#endif +{ + va_list args; + + error_prolog (0); + + SH_VA_START (args, format); + + vfprintf (stderr, format, args); + fprintf (stderr, "\n"); + + va_end (args); + sh_exit (2); +} + +void +#if defined (PREFER_STDARG) +internal_error (const char *format, ...) +#else +internal_error (format, va_alist) + const char *format; + va_dcl +#endif +{ + va_list args; + + error_prolog (1); + + SH_VA_START (args, format); + + vfprintf (stderr, format, args); + fprintf (stderr, "\n"); + + va_end (args); +} + +void +#if defined (PREFER_STDARG) +internal_warning (const char *format, ...) +#else +internal_warning (format, va_alist) + const char *format; + va_dcl +#endif +{ + va_list args; + + error_prolog (1); + fprintf (stderr, _("warning: ")); + + SH_VA_START (args, format); + + vfprintf (stderr, format, args); + fprintf (stderr, "\n"); + + va_end (args); +} + +void +#if defined (PREFER_STDARG) +sys_error (const char *format, ...) +#else +sys_error (format, va_alist) + const char *format; + va_dcl +#endif +{ + int e; + va_list args; + + e = errno; + error_prolog (0); + + SH_VA_START (args, format); + + vfprintf (stderr, format, args); + fprintf (stderr, ": %s\n", strerror (e)); + + va_end (args); +} + +/* An error from the parser takes the general form + + shell_name: input file name: line number: message + + The input file name and line number are omitted if the shell is + currently interactive. If the shell is not currently interactive, + the input file name is inserted only if it is different from the + shell name. */ +void +#if defined (PREFER_STDARG) +parser_error (int lineno, const char *format, ...) +#else +parser_error (lineno, format, va_alist) + int lineno; + const char *format; + va_dcl +#endif +{ + va_list args; + char *ename, *iname; + + ename = get_name_for_error (); + iname = yy_input_name (); + + if (interactive) + fprintf (stderr, "%s: ", ename); + else if (interactive_shell) + fprintf (stderr, "%s: %s:%s%d: ", ename, iname, gnu_error_format ? "" : _(" line "), lineno); + else if (STREQ (ename, iname)) + fprintf (stderr, "%s:%s%d: ", ename, gnu_error_format ? "" : _(" line "), lineno); + else + fprintf (stderr, "%s: %s:%s%d: ", ename, iname, gnu_error_format ? "" : _(" line "), lineno); + + SH_VA_START (args, format); + + vfprintf (stderr, format, args); + fprintf (stderr, "\n"); + + va_end (args); + + if (exit_immediately_on_error) + exit_shell (last_command_exit_value = 2); +} + +#ifdef DEBUG +/* This assumes ASCII and is suitable only for debugging */ +char * +strescape (str) + const char *str; +{ + char *r, *result; + unsigned char *s; + + r = result = (char *)xmalloc (strlen (str) * 2 + 1); + + for (s = (unsigned char *)str; s && *s; s++) + { + if (*s < ' ') + { + *r++ = '^'; + *r++ = *s+64; + } + else if (*s == 127) + { + *r++ = '^'; + *r++ = '?'; + } + else + *r++ = *s; + } + + *r = '\0'; + return result; +} + +void +#if defined (PREFER_STDARG) +itrace (const char *format, ...) +#else +itrace (format, va_alist) + const char *format; + va_dcl +#endif +{ + va_list args; + + fprintf(stderr, "TRACE: pid %ld: ", (long)getpid()); + + SH_VA_START (args, format); + + vfprintf (stderr, format, args); + fprintf (stderr, "\n"); + + va_end (args); + + fflush(stderr); +} + +/* A trace function for silent debugging -- doesn't require a control + terminal. */ +void +#if defined (PREFER_STDARG) +trace (const char *format, ...) +#else +trace (format, va_alist) + const char *format; + va_dcl +#endif +{ + va_list args; + static FILE *tracefp = (FILE *)NULL; + + if (tracefp == NULL) + tracefp = fopen("/tmp/bash-trace.log", "a+"); + + if (tracefp == NULL) + tracefp = stderr; + else + fcntl (fileno (tracefp), F_SETFD, 1); /* close-on-exec */ + + fprintf(tracefp, "TRACE: pid %ld: ", (long)getpid()); + + SH_VA_START (args, format); + + vfprintf (tracefp, format, args); + fprintf (tracefp, "\n"); + + va_end (args); + + fflush(tracefp); +} + +#endif /* DEBUG */ + +/* **************************************************************** */ +/* */ +/* Common error reporting */ +/* */ +/* **************************************************************** */ + + +static const char * const cmd_error_table[] = { + N_("unknown command error"), /* CMDERR_DEFAULT */ + N_("bad command type"), /* CMDERR_BADTYPE */ + N_("bad connector"), /* CMDERR_BADCONN */ + N_("bad jump"), /* CMDERR_BADJUMP */ + 0 +}; + +void +command_error (func, code, e, flags) + const char *func; + int code, e, flags; /* flags currently unused */ +{ + if (code > CMDERR_LAST) + code = CMDERR_DEFAULT; + + programming_error ("%s: %s: %d", func, _(cmd_error_table[code]), e); +} + +char * +command_errstr (code) + int code; +{ + if (code > CMDERR_LAST) + code = CMDERR_DEFAULT; + + return (_(cmd_error_table[code])); +} + +#ifdef ARRAY_VARS +void +err_badarraysub (s) + const char *s; +{ + report_error ("%s: %s", s, _(bash_badsub_errmsg)); +} +#endif + +void +err_unboundvar (s) + const char *s; +{ + report_error (_("%s: unbound variable"), s); +} + +void +err_readonly (s) + const char *s; +{ + report_error (_("%s: readonly variable"), s); +} diff --git a/error.h b/error.h new file mode 100644 index 0000000..4b17577 --- /dev/null +++ b/error.h @@ -0,0 +1,70 @@ +/* error.h -- External declarations of functions appearing in error.c. */ + +/* Copyright (C) 1993-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_ERROR_H_) +#define _ERROR_H_ + +#include "stdc.h" + +/* Get the name of the shell or shell script for an error message. */ +extern char *get_name_for_error __P((void)); + +/* Report an error having to do with FILENAME. */ +extern void file_error __P((const char *)); + +/* Report a programmer's error, and abort. Pass REASON, and ARG1 ... ARG5. */ +extern void programming_error __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2))); + +/* General error reporting. Pass FORMAT and ARG1 ... ARG5. */ +extern void report_error __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2))); + +/* Error messages for parts of the parser that don't call report_syntax_error */ +extern void parser_error __P((int, const char *, ...)) __attribute__((__format__ (printf, 2, 3))); + +/* Report an unrecoverable error and exit. Pass FORMAT and ARG1 ... ARG5. */ +extern void fatal_error __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2))); + +/* Report a system error, like BSD warn(3). */ +extern void sys_error __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2))); + +/* Report an internal error. */ +extern void internal_error __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2))); + +/* Report an internal warning. */ +extern void internal_warning __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2))); + +/* Debugging functions, not enabled in released version. */ +extern char *strescape __P((const char *)); +extern void itrace __P((const char *, ...)) __attribute__ ((__format__ (printf, 1, 2))); +extern void trace __P((const char *, ...)) __attribute__ ((__format__ (printf, 1, 2))); + +/* Report an error having to do with command parsing or execution. */ +extern void command_error __P((const char *, int, int, int)); + +extern char *command_errstr __P((int)); + +/* Specific error message functions that eventually call report_error or + internal_error. */ + +extern void err_badarraysub __P((const char *)); +extern void err_unboundvar __P((const char *)); +extern void err_readonly __P((const char *)); + +#endif /* !_ERROR_H_ */ diff --git a/eval.c b/eval.c new file mode 100644 index 0000000..1f65aac --- /dev/null +++ b/eval.c @@ -0,0 +1,291 @@ +/* eval.c -- reading and evaluating commands. */ + +/* Copyright (C) 1996-2011 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "bashansi.h" +#include + +#include "bashintl.h" + +#include "shell.h" +#include "flags.h" +#include "trap.h" + +#include "builtins/common.h" + +#include "input.h" +#include "execute_cmd.h" + +#if defined (HISTORY) +# include "bashhist.h" +#endif + +extern int EOF_reached; +extern int indirection_level; +extern int posixly_correct; +extern int subshell_environment, running_under_emacs; +extern int last_command_exit_value, stdin_redir; +extern int need_here_doc; +extern int current_command_number, current_command_line_count, line_number; +extern int expand_aliases; + +#if defined (HAVE_POSIX_SIGNALS) +extern sigset_t top_level_mask; +#endif + +static void send_pwd_to_eterm __P((void)); +static sighandler alrm_catcher __P((int)); + +/* Read and execute commands until EOF is reached. This assumes that + the input source has already been initialized. */ +int +reader_loop () +{ + int our_indirection_level; + COMMAND * volatile current_command; + + USE_VAR(current_command); + + current_command = (COMMAND *)NULL; + + our_indirection_level = ++indirection_level; + + while (EOF_Reached == 0) + { + int code; + + code = setjmp_nosigs (top_level); + +#if defined (PROCESS_SUBSTITUTION) + unlink_fifo_list (); +#endif /* PROCESS_SUBSTITUTION */ + + /* XXX - why do we set this every time through the loop? */ + if (interactive_shell && signal_is_ignored (SIGINT) == 0) + set_signal_handler (SIGINT, sigint_sighandler); + + if (code != NOT_JUMPED) + { + indirection_level = our_indirection_level; + + switch (code) + { + /* Some kind of throw to top_level has occurred. */ + case FORCE_EOF: + case ERREXIT: + case EXITPROG: + current_command = (COMMAND *)NULL; + if (exit_immediately_on_error) + variable_context = 0; /* not in a function */ + EOF_Reached = EOF; + goto exec_done; + + case DISCARD: + /* Make sure the exit status is reset to a non-zero value, but + leave existing non-zero values (e.g., > 128 on signal) + alone. */ + if (last_command_exit_value == 0) + last_command_exit_value = EXECUTION_FAILURE; + if (subshell_environment) + { + current_command = (COMMAND *)NULL; + EOF_Reached = EOF; + goto exec_done; + } + /* Obstack free command elements, etc. */ + if (current_command) + { + dispose_command (current_command); + current_command = (COMMAND *)NULL; + } +#if defined (HAVE_POSIX_SIGNALS) + sigprocmask (SIG_SETMASK, &top_level_mask, (sigset_t *)NULL); +#endif + break; + + default: + command_error ("reader_loop", CMDERR_BADJUMP, code, 0); + } + } + + executing = 0; + if (temporary_env) + dispose_used_env_vars (); + +#if (defined (ultrix) && defined (mips)) || defined (C_ALLOCA) + /* Attempt to reclaim memory allocated with alloca (). */ + (void) alloca (0); +#endif + + if (read_command () == 0) + { + if (interactive_shell == 0 && read_but_dont_execute) + { + last_command_exit_value = EXECUTION_SUCCESS; + dispose_command (global_command); + global_command = (COMMAND *)NULL; + } + else if (current_command = global_command) + { + global_command = (COMMAND *)NULL; + current_command_number++; + + executing = 1; + stdin_redir = 0; + execute_command (current_command); + + exec_done: + QUIT; + + if (current_command) + { + dispose_command (current_command); + current_command = (COMMAND *)NULL; + } + } + } + else + { + /* Parse error, maybe discard rest of stream if not interactive. */ + if (interactive == 0) + EOF_Reached = EOF; + } + if (just_one_command) + EOF_Reached = EOF; + } + indirection_level--; + return (last_command_exit_value); +} + +static sighandler +alrm_catcher(i) + int i; +{ + printf (_("\007timed out waiting for input: auto-logout\n")); + fflush (stdout); + bash_logout (); /* run ~/.bash_logout if this is a login shell */ + jump_to_top_level (EXITPROG); + SIGRETURN (0); +} + +/* Send an escape sequence to emacs term mode to tell it the + current working directory. */ +static void +send_pwd_to_eterm () +{ + char *pwd, *f; + + f = 0; + pwd = get_string_value ("PWD"); + if (pwd == 0) + f = pwd = get_working_directory ("eterm"); + fprintf (stderr, "\032/%s\n", pwd); + free (f); +} + +/* Call the YACC-generated parser and return the status of the parse. + Input is read from the current input stream (bash_input). yyparse + leaves the parsed command in the global variable GLOBAL_COMMAND. + This is where PROMPT_COMMAND is executed. */ +int +parse_command () +{ + int r; + char *command_to_execute; + + need_here_doc = 0; + run_pending_traps (); + + /* Allow the execution of a random command just before the printing + of each primary prompt. If the shell variable PROMPT_COMMAND + is set then the value of it is the command to execute. */ + if (interactive && bash_input.type != st_string) + { + command_to_execute = get_string_value ("PROMPT_COMMAND"); + if (command_to_execute) + execute_variable_command (command_to_execute, "PROMPT_COMMAND"); + + if (running_under_emacs == 2) + send_pwd_to_eterm (); /* Yuck */ + } + + current_command_line_count = 0; + r = yyparse (); + + if (need_here_doc) + gather_here_documents (); + + return (r); +} + +/* Read and parse a command, returning the status of the parse. The command + is left in the globval variable GLOBAL_COMMAND for use by reader_loop. + This is where the shell timeout code is executed. */ +int +read_command () +{ + SHELL_VAR *tmout_var; + int tmout_len, result; + SigHandler *old_alrm; + + set_current_prompt_level (1); + global_command = (COMMAND *)NULL; + + /* Only do timeouts if interactive. */ + tmout_var = (SHELL_VAR *)NULL; + tmout_len = 0; + old_alrm = (SigHandler *)NULL; + + if (interactive) + { + tmout_var = find_variable ("TMOUT"); + + if (tmout_var && var_isset (tmout_var)) + { + tmout_len = atoi (value_cell (tmout_var)); + if (tmout_len > 0) + { + old_alrm = set_signal_handler (SIGALRM, alrm_catcher); + alarm (tmout_len); + } + } + } + + QUIT; + + current_command_line_count = 0; + result = parse_command (); + + if (interactive && tmout_var && (tmout_len > 0)) + { + alarm(0); + set_signal_handler (SIGALRM, old_alrm); + } + + return (result); +} diff --git a/examples/INDEX.html b/examples/INDEX.html new file mode 100644 index 0000000..bd06b25 --- /dev/null +++ b/examples/INDEX.html @@ -0,0 +1,828 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PathDescriptionX-Ref
    ./obashdbDeprecated sample implementation of a bash debugger
    ./completeShell completion code
    ./functionsExample functions
    ./functions/array-stuffVarious array functions (ashift, array_sort, reverse).
    ./functions/array-to-stringConvert an array to a string.
    ./functions/autoloadAn almost ksh-compatible 'autoload' (no lazy load).ksh
    ./functions/autoload.v2An almost ksh-compatible 'autoload' (no lazy load).ksh
    ./functions/autoload.v3A more ksh-compatible 'autoload' (with lazy load).ksh
    ./functions/basenameA replacement for basename(1).basename
    ./functions/basename2Fast basename(1) and dirname(1) functions for BASH/SH.basename, dirname
    ./functions/coproc.bashStart, control, and end coprocesses.
    ./functions/coshell.bashControl shell coprocesses (see coprocess.bash).
    ./functions/coshell.READMEREADME for coshell and coproc.
    ./functions/csh-compatA C-shell compatibility package.csh
    ./functions/dirfuncsDirectory manipulation functions from the book 'The Korn Shell'.
    ./functions/dirnameA replacement for dirname(1).dirname
    ./functions/emptydirFind out if a directory is empty.
    ./functions/exitstatDisplay the exit status of processes.
    ./functions/externalLike 'command' but FORCES use of external command.
    ./functions/factRecursive factorial function.
    ./functions/fsttyFront end to sync TERM changes to both stty(1) and readline 'bind'.stty.bash
    ./functions/funcPrint out definitions for functions named by arguments.
    ./functions/gethtmlGet a web page from a remote server (wget(1) in bash!).
    ./functions/getoptx.bashgetopt function that parses long-named options.
    ./functions/inetaddrInternet address conversion (inet2hex & hex2inet).
    ./functions/inpathReturn zero if the argument is in the path and executable.inpath
    ./functions/isnum.bashTest user input on numeric or character value.
    ./functions/isnum2Test user input on numeric values, with floating point.
    ./functions/isvalidipTest user input for valid IP Addresses.
    ./functions/jdate.bashJulian date conversion.
    ./functions/jj.bashLook for running jobs.
    ./functions/keepTry to keep some programs in the foreground and running.
    ./functions/ksh-cdksh-like 'cd': cd [-LP] [dir [change]].ksh
    ./functions/ksh-compat-testksh-like arithmetic test replacements.ksh
    ./functions/kshenvFunctions and aliases to provide the beginnings of a ksh environment for bash.ksh
    ./functions/loginReplace the 'login' and 'newgrp' builtins in old Bourne shells.
    ./functions/lowercaseRename files to lower case.rename lower
    ./functions/manpageFind and print a manual page.fman
    ./functions/mhfoldPrint MH folders, useful only because folders(1) doesn't print mod date/times.
    ./functions/notify.bashNotify when jobs change status.
    ./functions/pathfuncsPath related functions (no_path, add_path, pre-path, del_path).path
    ./functions/READMEREADME
    ./functions/recurseRecursive directory traverser.
    ./functions/repeat2A clone of C shell builtin 'repeat'.repeat, csh
    ./functions/repeat3A clone of C shell builtin 'repeat'.repeat, csh
    ./functions/seqGenerate a sequence from m to n, m defaults to 1.
    ./functions/seq2Generate a sequence from m to n, m defaults to 1.
    ./functions/shcatReadline-based pager.cat, readline pager
    ./functions/shcat2Readline-based pagers.cat, readline pager
    ./functions/sort-pos-paramsSort the positional parameters.
    ./functions/substrA function to emulate the ancient ksh builtin.ksh
    ./functions/substr2A function to emulate the ancient ksh builtin.ksh
    ./functions/termA shell function to set the terminal type interactively or not.
    ./functions/whatisAn implementation of the 10th Edition Unix sh builtin 'whatis(1)' command.
    ./functions/whenceAn almost-ksh compatible 'whence(1)' command.
    ./functions/whichAn emulation of 'which(1)' as it appears in FreeBSD.
    ./functions/xalias.bashConvert csh alias commands to bash functions.csh, aliasconv
    ./functions/xfind.bashA 'find(1)' clone.
    ./loadables/Example loadable replacements
    ./loadables/basename.cReturn non-directory portion of pathname.basename
    ./loadables/cat.ccat(1) replacement with no options - the way cat was intended.cat, readline pager
    ./loadables/cut.ccut(1) replacement.
    ./loadables/dirname.cReturn directory portion of pathname.dirname
    ./loadables/finfo.cPrint file info.
    ./loadables/getconf.cPOSIX.2 getconf utility.
    ./loadables/getconf.hReplacement definitions for ones the system doesn't provide.
    ./loadables/head.cCopy first part of files.
    ./loadables/hello.cObligatory "Hello World" / sample loadable.
    ./loadables/id.cPOSIX.2 user identity.
    ./loadables/ln.cMake links.
    ./loadables/logname.cPrint login name of current user.
    ./loadables/Makefile.inSimple makefile for the sample loadable builtins.
    ./loadables/mkdir.cMake directories.
    ./loadables/necho.cecho without options or argument interpretation.
    ./loadables/pathchk.cCheck pathnames for validity and portability.
    ./loadables/print.cLoadable ksh-93 style print builtin.
    ./loadables/printenv.cMinimal builtin clone of BSD printenv(1).
    ./loadables/push.cAnyone remember TOPS-20?
    ./loadables/READMEREADME
    ./loadables/realpath.cCanonicalize pathnames, resolving symlinks.
    ./loadables/rmdir.cRemove directory.
    ./loadables/sleep.csleep for fractions of a second.
    ./loadables/strftime.cLoadable builtin interface to strftime(3).
    ./loadables/sync.cSync the disks by forcing pending filesystem writes to complete.
    ./loadables/tee.cDuplicate standard input.
    ./loadables/template.cExample template for loadable builtin.
    ./loadables/truefalse.cTrue and false builtins.
    ./loadables/tty.cReturn terminal name.
    ./loadables/uname.cPrint system information.
    ./loadables/unlink.cRemove a directory entry.
    ./loadables/whoami.cPrint out username of current user.
    ./loadables/perl/Illustrate how to build a Perl interpreter into bash.
    ./miscMiscellaneous
    ./misc/aliasconv.bashConvert csh aliases to bash aliases and functions.csh, xalias
    ./misc/aliasconv.shConvert csh aliases to bash aliases and functions.csh, xalias
    ./misc/cshtobashConvert csh aliases, environment variables, and variables to bash equivalents.csh, xalias
    ./misc/READMEREADME
    ./misc/suncmd.termcapSunView TERMCAP string.
    ./scripts.noahNoah Friedman's collection of scripts (updated to bash v2 syntax by Chet Ramey)
    ./scripts.noah/aref.bashPseudo-arrays and substring indexing examples.
    ./scripts.noah/bash.sub.bashLibrary functions used by require.bash.
    ./scripts.noah/bash_version.bashA function to slice up $BASH_VERSION.
    ./scripts.noah/meta.bashEnable and disable eight-bit readline input.
    ./scripts.noah/mktmp.bashMake a temporary file with a unique name.
    ./scripts.noah/number.bashA fun hack to translate numerals into English.
    ./scripts.noah/PERMISSIONPermissions to use the scripts in this directory.
    ./scripts.noah/prompt.bashA way to set PS1 to some predefined strings.
    ./scripts.noah/READMEREADME
    ./scripts.noah/remap_keys.bashA front end to 'bind' to redo readline bindings.
    ./scripts.noah/require.bashLisp-like require/provide library functions for bash.
    ./scripts.noah/send_mail.bashReplacement SMTP client written in bash.
    ./scripts.noah/shcat.bashBash replacement for 'cat(1)'.cat
    ./scripts.noah/source.bashReplacement for source that uses current directory.
    ./scripts.noah/string.bashThe string(3) functions at the shell level.
    ./scripts.noah/stty.bashFront-end to stty(1) that changes readline bindings too.fstty
    ./scripts.noah/y_or_n_p.bashPrompt for a yes/no/quit answer.ask
    ./scripts.v2John DuBois' ksh script collection (converted to bash v2 syntax by Chet Ramey).
    ./scripts.v2/arc2tarzConvert an "arc" archive to a compressed tar archive.
    ./scripts.v2/bashrandRandom number generator with upper and lower bounds and optional seed.random
    ./scripts.v2/cal2day.bashConvert a day number to a name.
    ./scripts.v2/cdhist.bashcd replacement with a directory stack added.
    ./scripts.v2/corenameTell what produced a core file.
    ./scripts.v2/fmanFast man(1) replacement.manpage
    ./scripts.v2/frcpCopy files using ftp(1) but with rcp-type command line syntax.
    ./scripts.v2/lowercaseChange filenames to lower case.rename lower
    ./scripts.v2/ncpA nicer front end for cp(1) (has -i, etc.).
    ./scripts.v2/newextChange the extension of a group of files.rename
    ./scripts.v2/nmvA nicer front end for mv(1) (has -i, etc.).rename
    ./scripts.v2/pagesPrint specified pages from files.
    ./scripts.v2/PERMISSIONPermissions to use the scripts in this directory.
    ./scripts.v2/pfA pager front end that handles compressed files.
    ./scripts.v2/pmtopPoor man's 'top(1)' for SunOS 4.x and BSD/OS.
    ./scripts.v2/READMEREADME
    ./scripts.v2/renRename files by changing parts of filenames that match a pattern.rename
    ./scripts.v2/renameChange the names of files that match a pattern.rename
    ./scripts.v2/repeatExecute a command multiple times.repeat
    ./scripts.v2/shprofLine profiler for bash scripts.
    ./scripts.v2/untarUnarchive a (possibly compressed) tarfile into a directory.
    ./scripts.v2/uudecCarefully uudecode(1) multiple files.
    ./scripts.v2/uuencuuencode(1) multiple files.
    ./scripts.v2/vtreePrint a visual display of a directory tree.tree
    ./scripts.v2/whereShow where commands that match a pattern are.
    ./scriptsExample scripts
    ./scripts/adventure.shText adventure game in bash!
    ./scripts/bcsh.shBourne shell cshell-emulator.csh
    ./scripts/bash-hexdump.shhexdump(1) in bashhexdump -C, hd
    ./scripts/cat.shReadline-based pager.cat, readline pager
    ./scripts/centerCenter - center a group of lines.
    ./scripts/dd-ex.shLine editor using only /bin/sh, /bin/dd and /bin/rm.
    ./scripts/fixfiles.bashRecurse a tree and fix files containing various "bad" chars.
    ./scripts/hanoi.bashThe inevitable Towers of Hanoi in bash.
    ./scripts/inpathSearch $PATH for a file the same name as $1; return TRUE if found.inpath
    ./scripts/krand.bashProduces a random number within integer limits.random
    ./scripts/line-input.bashLine input routine for GNU Bourne-Again Shell plus terminal-control primitives.
    ./scripts/nohup.bashbash version of 'nohup' command.
    ./scripts/precedenceTest relative precedences for '&&' and '||' operators.
    ./scripts/randomcard.bashPrint a random card from a card deck.random
    ./scripts/READMEREADME
    ./scripts/scrollbarDisplay scrolling text.
    ./scripts/scrollbar2Display scrolling text.
    ./scripts/self-reproA self-reproducing script (careful!)
    ./scripts/showperm.bashConvert ls(1) symbolic permissions into octal mode.
    ./scripts/shpromptDisplay a prompt and get an answer satisfying certain criteria.ask
    ./scripts/spin.bashDisplay a 'spinning wheel' to show progress.
    ./scripts/timeoutGive rsh(1) a shorter timeout.
    ./scripts/timeout2Execute a given command with a timeout.
    ./scripts/timeout3Execute a given command with a timeout.
    ./scripts/vtree2Display a tree printout of dir in 1k blocks.tree
    ./scripts/vtree3Display a graphical tree printout of dir.tree
    ./scripts/vtree3aDisplay a graphical tree printout of dir.tree
    ./scripts/websrv.shA web server in bash!
    ./scripts/xterm_titlePrint the contents of the xterm title bar.
    ./scripts/zprintfEmulate printf (obsolete since it's now a bash builtin).
    ./startup-filesExample Start-up files.
    ./startup-files/Bash_aliasesSome useful aliases (Fox).
    ./startup-files/Bash_profileSample startup file for bash login shells (Fox).
    ./startup-files/bash-profileSample startup file for bash login shells (Ramey).
    ./startup-files/bashrcSample Bourne Again SHell init file (Ramey).
    ./startup-files/Bashrc.bfoxSample Bourne Again SHell init file (Fox).
    ./startup-files/READMEREADME
    ./startup-files/appleExample Start-up files for Mac OS X.
    ./startup-files/apple/aliasesSample aliases for Mac OS X.
    ./startup-files/apple/bash.defaultsSample User preferences file.
    ./startup-files/apple/environmentSample Bourne Again Shell environment file.
    ./startup-files/apple/loginSample login wrapper.
    ./startup-files/apple/logoutSample logout wrapper.
    ./startup-files/apple/rcSample Bourne Again Shell config file.
    ./startup-files/apple/READMEREADME
    diff --git a/examples/INDEX.txt b/examples/INDEX.txt new file mode 100644 index 0000000..4b5478e --- /dev/null +++ b/examples/INDEX.txt @@ -0,0 +1,199 @@ +Path Description X-Ref +./obashdb Deprecated sample implementation of a bash debugger + +./complete Shell completion code + +./functions Example functions +./functions/array-stuff Various array functions (ashift, array_sort, reverse). +./functions/array-to-string Convert an array to a string. +./functions/autoload An almost ksh-compatible 'autoload' (no lazy load). ksh +./functions/autoload.v2 An almost ksh-compatible 'autoload' (no lazy load). ksh +./functions/autoload.v3 A more ksh-compatible 'autoload' (with lazy load). ksh +./functions/basename A replacement for basename(1). basename +./functions/basename2 Fast basename(1) and dirname(1) functions for BASH/SH. basename, dirname +./functions/coproc.bash Start, control, and end coprocesses. +./functions/coshell.bash Control shell coprocesses (see coprocess.bash). +./functions/coshell.README README for coshell and coproc. +./functions/csh-compat A C-shell compatibility package. csh +./functions/dirfuncs Directory manipulation functions from the book 'The Korn Shell'. +./functions/dirname A replacement for dirname(1). dirname +./functions/emptydir Find out if a directory is empty. +./functions/exitstat Display the exit status of processes. +./functions/external Like 'command' but FORCES use of external command. +./functions/fact Recursive factorial function. +./functions/fstty Front end to sync TERM changes to both stty(1) and readline 'bind'. stty.bash +./functions/func Print out definitions for functions named by arguments. +./functions/gethtml Get a web page from a remote server (wget(1) in bash!). +./functions/getoptx.bash getopt function that parses long-named options. +./functions/inetaddr Internet address conversion (inet2hex & hex2inet). +./functions/inpath Return zero if the argument is in the path and executable. inpath +./functions/isnum.bash Test user input on numeric or character value. +./functions/isnum2 Test user input on numeric values, with floating point. +./functions/isvalidip Test user input for valid IP Addresses. +./functions/jdate.bash Julian date conversion. +./functions/jj.bash Look for running jobs. +./functions/keep Try to keep some programs in the foreground and running. +./functions/ksh-cd ksh-like 'cd': cd [-LP] [dir [change]]. ksh +./functions/ksh-compat-test ksh-like arithmetic test replacements. ksh +./functions/kshenv Functions and aliases to provide the beginnings of a ksh environment for bash. ksh +./functions/login Replace the 'login' and 'newgrp' builtins in old Bourne shells. +./functions/lowercase Rename files to lower case. rename lower +./functions/manpage Find and print a manual page. fman +./functions/mhfold Print MH folders, useful only because folders(1) doesn't print mod date/times. +./functions/notify.bash Notify when jobs change status. +./functions/pathfuncs Path related functions (no_path, add_path, pre-path, del_path). path +./functions/README README +./functions/recurse Recursive directory traverser. +./functions/repeat2 A clone of C shell builtin 'repeat'. repeat, csh +./functions/repeat3 A clone of C shell builtin 'repeat'. repeat, csh +./functions/seq Generate a sequence from m to n, m defaults to 1. +./functions/seq2 Generate a sequence from m to n, m defaults to 1. +./functions/shcat Readline-based pager. cat, readline pager +./functions/shcat2 Readline-based pagers. cat, readline pager +./functions/sort-pos-params Sort the positional parameters. +./functions/substr A function to emulate the ancient ksh builtin. ksh +./functions/substr2 A function to emulate the ancient ksh builtin. ksh +./functions/term A shell function to set the terminal type interactively or not. +./functions/whatis An implementation of the 10th Edition Unix sh builtin 'whatis(1)' command. +./functions/whence An almost-ksh compatible 'whence(1)' command. +./functions/which An emulation of 'which(1)' as it appears in FreeBSD. +./functions/xalias.bash Convert csh alias commands to bash functions. csh, aliasconv +./functions/xfind.bash A 'find(1)' clone. + +./loadables/ Example loadable replacements +./loadables/basename.c Return non-directory portion of pathname. basename +./loadables/cat.c cat(1) replacement with no options - the way cat was intended. cat, readline pager +./loadables/cut.c cut(1) replacement. +./loadables/dirname.c Return directory portion of pathname. dirname +./loadables/finfo.c Print file info. +./loadables/getconf.c POSIX.2 getconf utility. +./loadables/getconf.h Replacement definitions for ones the system doesn't provide. +./loadables/head.c Copy first part of files. +./loadables/hello.c Obligatory "Hello World" / sample loadable. +./loadables/id.c POSIX.2 user identity. +./loadables/ln.c Make links. +./loadables/logname.c Print login name of current user. +./loadables/Makefile.in Simple makefile for the sample loadable builtins. +./loadables/mkdir.c Make directories. +./loadables/necho.c echo without options or argument interpretation. +./loadables/pathchk.c Check pathnames for validity and portability. +./loadables/print.c Loadable ksh-93 style print builtin. +./loadables/printenv.c Minimal builtin clone of BSD printenv(1). +./loadables/push.c Anyone remember TOPS-20? +./loadables/README README +./loadables/realpath.c Canonicalize pathnames, resolving symlinks. +./loadables/rmdir.c Remove directory. +./loadables/sleep.c sleep for fractions of a second. +./loadables/strftime.c Loadable builtin interface to strftime(3). +./loadables/sync.c Sync the disks by forcing pending filesystem writes to complete. +./loadables/tee.c Duplicate standard input. +./loadables/template.c Example template for loadable builtin. +./loadables/truefalse.c True and false builtins. +./loadables/tty.c Return terminal name. +./loadables/uname.c Print system information. +./loadables/unlink.c Remove a directory entry. +./loadables/whoami.c Print out username of current user. + +./loadables/perl/ Illustrate how to build a Perl interpreter into bash. + +./misc Miscellaneous +./misc/aliasconv.bash Convert csh aliases to bash aliases and functions. csh, xalias +./misc/aliasconv.sh Convert csh aliases to bash aliases and functions. csh, xalias +./misc/cshtobash Convert csh aliases, environment variables, and variables to bash equivalents. csh, xalias +./misc/README README +./misc/suncmd.termcap SunView TERMCAP string. + +./scripts.noah Noah Friedman's collection of scripts (updated to bash v2 syntax by Chet Ramey) +./scripts.noah/aref.bash Pseudo-arrays and substring indexing examples. +./scripts.noah/bash.sub.bash Library functions used by require.bash. +./scripts.noah/bash_version.bash A function to slice up $BASH_VERSION. +./scripts.noah/meta.bash Enable and disable eight-bit readline input. +./scripts.noah/mktmp.bash Make a temporary file with a unique name. +./scripts.noah/number.bash A fun hack to translate numerals into English. +./scripts.noah/PERMISSION Permissions to use the scripts in this directory. +./scripts.noah/prompt.bash A way to set PS1 to some predefined strings. +./scripts.noah/README README +./scripts.noah/remap_keys.bash A front end to 'bind' to redo readline bindings. +./scripts.noah/require.bash Lisp-like require/provide library functions for bash. +./scripts.noah/send_mail.bash Replacement SMTP client written in bash. +./scripts.noah/shcat.bash Bash replacement for 'cat(1)'. cat +./scripts.noah/source.bash Replacement for source that uses current directory. +./scripts.noah/string.bash The string(3) functions at the shell level. +./scripts.noah/stty.bash Front-end to stty(1) that changes readline bindings too. fstty +./scripts.noah/y_or_n_p.bash Prompt for a yes/no/quit answer. ask + +./scripts.v2 John DuBois' ksh script collection (converted to bash v2 syntax by Chet Ramey). +./scripts.v2/arc2tarz Convert an "arc" archive to a compressed tar archive. +./scripts.v2/bashrand Random number generator with upper and lower bounds and optional seed. random +./scripts.v2/cal2day.bash Convert a day number to a name. +./scripts.v2/cdhist.bash cd replacement with a directory stack added. +./scripts.v2/corename Tell what produced a core file. +./scripts.v2/fman Fast man(1) replacement. manpage +./scripts.v2/frcp Copy files using ftp(1) but with rcp-type command line syntax. +./scripts.v2/lowercase Change filenames to lower case. rename lower +./scripts.v2/ncp A nicer front end for cp(1) (has -i, etc.). +./scripts.v2/newext Change the extension of a group of files. rename +./scripts.v2/nmv A nicer front end for mv(1) (has -i, etc.). rename +./scripts.v2/pages Print specified pages from files. +./scripts.v2/PERMISSION Permissions to use the scripts in this directory. +./scripts.v2/pf A pager front end that handles compressed files. +./scripts.v2/pmtop Poor man's 'top(1)' for SunOS 4.x and BSD/OS. +./scripts.v2/README README +./scripts.v2/ren Rename files by changing parts of filenames that match a pattern. rename +./scripts.v2/rename Change the names of files that match a pattern. rename +./scripts.v2/repeat Execute a command multiple times. repeat +./scripts.v2/shprof Line profiler for bash scripts. +./scripts.v2/untar Unarchive a (possibly compressed) tarfile into a directory. +./scripts.v2/uudec Carefully uudecode(1) multiple files. +./scripts.v2/uuenc uuencode(1) multiple files. +./scripts.v2/vtree Print a visual display of a directory tree. tree +./scripts.v2/where Show where commands that match a pattern are. + +./scripts Example scripts +./scripts/adventure.sh Text adventure game in bash! +./scripts/bash-hexdump.sh hexdump(1) in bash +./scripts/bcsh.sh Bourne shell cshell-emulator. csh +./scripts/cat.sh Readline-based pager. cat, readline pager +./scripts/center Center - center a group of lines. +./scripts/dd-ex.sh Line editor using only /bin/sh, /bin/dd and /bin/rm. +./scripts/fixfiles.bash Recurse a tree and fix files containing various "bad" chars. +./scripts/hanoi.bash The inevitable Towers of Hanoi in bash. +./scripts/inpath Search $PATH for a file the same name as $1; return TRUE if found. inpath +./scripts/krand.bash Produces a random number within integer limits. random +./scripts/line-input.bash Line input routine for GNU Bourne-Again Shell plus terminal-control primitives. +./scripts/nohup.bash bash version of 'nohup' command. +./scripts/precedence Test relative precedences for '&&' and '||' operators. +./scripts/randomcard.bash Print a random card from a card deck. random +./scripts/README README +./scripts/scrollbar Display scrolling text. +./scripts/scrollbar2 Display scrolling text. +./scripts/self-repro A self-reproducing script (careful!) +./scripts/showperm.bash Convert ls(1) symbolic permissions into octal mode. +./scripts/shprompt Display a prompt and get an answer satisfying certain criteria. ask +./scripts/spin.bash Display a 'spinning wheel' to show progress. +./scripts/timeout Give rsh(1) a shorter timeout. +./scripts/timeout2 Execute a given command with a timeout. +./scripts/timeout3 Execute a given command with a timeout. +./scripts/vtree2 Display a tree printout of dir in 1k blocks. tree +./scripts/vtree3 Display a graphical tree printout of dir. tree +./scripts/vtree3a Display a graphical tree printout of dir. tree +./scripts/websrv.sh A web server in bash! +./scripts/xterm_title Print the contents of the xterm title bar. +./scripts/zprintf Emulate printf (obsolete since it's now a bash builtin). + +./startup-files Example Start-up files. +./startup-files/Bash_aliases Some useful aliases (Fox). +./startup-files/Bash_profile Sample startup file for bash login shells (Fox). +./startup-files/bash-profile Sample startup file for bash login shells (Ramey). +./startup-files/bashrc Sample Bourne Again SHell init file (Ramey). +./startup-files/Bashrc.bfox Sample Bourne Again SHell init file (Fox). +./startup-files/README README + +./startup-files/apple Example Start-up files for Mac OS X. +./startup-files/apple/aliases Sample aliases for Mac OS X. +./startup-files/apple/bash.defaults Sample User preferences file. +./startup-files/apple/environment Sample Bourne Again Shell environment file. +./startup-files/apple/login Sample login wrapper. +./startup-files/apple/logout Sample logout wrapper. +./startup-files/apple/rc Sample Bourne Again Shell config file. +./startup-files/apple/README README diff --git a/examples/complete/bash_completion b/examples/complete/bash_completion new file mode 100644 index 0000000..b0cf4a8 --- /dev/null +++ b/examples/complete/bash_completion @@ -0,0 +1,9401 @@ +# bash_completion - programmable completion functions for bash 3.x +# (backwards compatible with bash 2.05b) +# +# $Id: bash_completion,v 1.872 2006/03/01 16:20:18 ianmacd Exp $ +# +# Copyright (C) Ian Macdonald +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# The latest version of this software can be obtained here: +# +# http://www.caliban.org/bash/index.shtml#completion +# +# RELEASE: 20060301 + +if [[ $- == *v* ]]; then + BASH_COMPLETION_ORIGINAL_V_VALUE="-v" +else + BASH_COMPLETION_ORIGINAL_V_VALUE="+v" +fi + +if [[ -n $BASH_COMPLETION_DEBUG ]]; then + set -v +else + set +v +fi + +# Alter the following to reflect the location of this file. +# +[ -n "$BASH_COMPLETION" ] || BASH_COMPLETION=/etc/bash_completion +[ -n "$BASH_COMPLETION_DIR" ] || BASH_COMPLETION_DIR=/etc/bash_completion.d +readonly BASH_COMPLETION BASH_COMPLETION_DIR + +# Set a couple of useful vars +# +UNAME=$( uname -s ) +# strip OS type and version under Cygwin (e.g. CYGWIN_NT-5.1 => Cygwin) +UNAME=${UNAME/CYGWIN_*/Cygwin} +RELEASE=$( uname -r ) + +# features supported by bash 2.05 and higher +if [ ${BASH_VERSINFO[0]} -eq 2 ] && [[ ${BASH_VERSINFO[1]} > 04 ]] || + [ ${BASH_VERSINFO[0]} -gt 2 ]; then + declare -r bash205=$BASH_VERSION 2>/dev/null || : + default="-o default" + dirnames="-o dirnames" + filenames="-o filenames" +fi +# features supported by bash 2.05b and higher +if [ ${BASH_VERSINFO[0]} -eq 2 ] && [[ ${BASH_VERSINFO[1]} = "05b" ]] || + [ ${BASH_VERSINFO[0]} -gt 2 ]; then + declare -r bash205b=$BASH_VERSION 2>/dev/null || : + nospace="-o nospace" +fi +# features supported by bash 3.0 and higher +if [ ${BASH_VERSINFO[0]} -gt 2 ]; then + declare -r bash3=$BASH_VERSION 2>/dev/null || : + bashdefault="-o bashdefault" + plusdirs="-o plusdirs" +fi + +# Turn on extended globbing and programmable completion +shopt -s extglob progcomp + +# A lot of the following one-liners were taken directly from the +# completion examples provided with the bash 2.04 source distribution + +# Make directory commands see only directories +complete -d pushd + +# The following section lists completions that are redefined later +# Do NOT break these over multiple lines. +# +# START exclude -- do NOT remove this line +complete -f -X '!*.?(t)bz?(2)' bunzip2 bzcat bzcmp bzdiff bzegrep bzfgrep bzgrep +complete -f -X '!*.@(zip|ZIP|jar|JAR|exe|EXE|pk3|war|wsz|ear|zargo|xpi|sxw|ott)' unzip zipinfo +complete -f -X '*.Z' compress znew +complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' gunzip zcmp zdiff zcat zegrep zfgrep zgrep zless zmore +complete -f -X '!*.Z' uncompress +complete -f -X '!*.@(gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|GIF|JP?(E)G|MIFF|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX)' ee display +complete -f -X '!*.@(gif|jp?(e)g|tif?(f)|png|p[bgp]m|bmp|x[bp]m|rle|rgb|pcx|fits|pm|GIF|JPG|JP?(E)G|TIF?(F)|PNG|P[BGP]M|BMP|X[BP]M|RLE|RGB|PCX|FITS|PM)' xv qiv +complete -f -X '!*.@(@(?(e)ps|?(E)PS|pdf|PDF)?(.gz|.GZ|.bz2|.BZ2|.Z))' gv ggv kghostview +complete -f -X '!*.@(dvi|DVI)?(.@(gz|Z|bz2))' xdvi +complete -f -X '!*.@(dvi|DVI)?(.@(gz|bz2))' kdvi +complete -f -X '!*.@(dvi|DVI)' dvips dviselect dvitype dvipdf advi dvipdfm dvipdfmx +complete -f -X '!*.@(pdf|PDF)' acroread gpdf xpdf +complete -f -X '!*.@(?(e)ps|?(E)PS|pdf|PDF)' kpdf +complete -f -X '!*.@(@(?(e)ps|?(E)PS|pdf|PDF)?(.gz|.GZ)|cb(r|z)|CB(R|Z)|djv?(u)|DJV?(U)||dvi|DVI|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|GIF|JP?(E)G|MIFF|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX)' evince +complete -f -X '!*.@(?(e)ps|?(E)PS)' ps2pdf +complete -f -X '!*.texi*' makeinfo texi2html +complete -f -X '!*.@(?(la)tex|?(LA)TEX|texi|TEXI|dtx|DTX|ins|INS)' tex latex slitex jadetex pdfjadetex pdftex pdflatex texi2dvi +complete -f -X '!*.@(mp3|MP3)' mpg123 mpg321 madplay +complete -f -X '!*.@(mp?(e)g|MP?(E)G|wma|avi|AVI|asf|vob|VOB|bin|dat|divx|DIVX|vcd|ps|pes|fli|flv|FLV|viv|rm|ram|yuv|mov|MOV|qt|QT|wmv|mp3|MP3|m4v|M4V|ogg|OGG|ogm|OGM|mp4|MP4|wav|WAV|asx|ASX|mng|MNG|srt)' xine aaxine fbxine kaffeine +complete -f -X '!*.@(avi|asf|wmv)' aviplay +complete -f -X '!*.@(rm?(j)|ra?(m)|smi?(l))' realplay +complete -f -X '!*.@(mpg|mpeg|avi|mov|qt)' xanim +complete -f -X '!*.@(ogg|OGG|m3u|flac|spx)' ogg123 +complete -f -X '!*.@(mp3|MP3|ogg|OGG|pls|m3u)' gqmpeg freeamp +complete -f -X '!*.fig' xfig +complete -f -X '!*.@(mid?(i)|MID?(I))' playmidi +complete -f -X '!*.@(mid?(i)|MID?(I)|rmi|RMI|rcp|RCP|[gr]36|[GR]36|g18|G18|mod|MOD|xm|XM|it|IT|x3m|X3M)' timidity +complete -f -X '*.@(o|so|so.!(conf)|a|rpm|gif|GIF|jp?(e)g|JP?(E)G|mp3|MP3|mp?(e)g|MPG|avi|AVI|asf|ASF|ogg|OGG|class|CLASS)' vi vim gvim rvim view rview rgvim rgview gview +complete -f -X '*.@(o|so|so.!(conf)|a|rpm|gif|GIF|jp?(e)g|JP?(E)G|mp3|MP3|mp?(e)g|MPG|avi|AVI|asf|ASF|ogg|OGG|class|CLASS)' emacs +complete -f -X '!*.@(exe|EXE|com|COM|scr|SCR|exe.so)' wine +complete -f -X '!*.@(zip|ZIP|z|Z|gz|GZ|tgz|TGZ)' bzme +complete -f -X '!*.@(?([xX]|[sS])[hH][tT][mM]?([lL]))' netscape mozilla lynx opera galeon curl dillo elinks amaya +complete -f -X '!*.@(sxw|stw|sxg|sgl|doc|dot|rtf|txt|htm|html|odt|ott|odm)' oowriter +complete -f -X '!*.@(sxi|sti|pps|ppt|pot|odp|otp)' ooimpress +complete -f -X '!*.@(sxc|stc|xls|xlw|xlt|csv|ods|ots)' oocalc +complete -f -X '!*.@(sxd|std|sda|sdd|odg|otg)' oodraw +complete -f -X '!*.@(sxm|smf|mml|odf)' oomath +complete -f -X '!*.odb' oobase +complete -f -X '!*.rpm' rpm2cpio +# FINISH exclude -- do not remove this line + +# start of section containing compspecs that can be handled within bash + +# user commands see only users +complete -u su usermod userdel passwd chage write chfn groups slay w sux + +# group commands see only groups +[ -n "$bash205" ] && complete -g groupmod groupdel newgrp 2>/dev/null + +# bg completes with stopped jobs +complete -A stopped -P '%' bg + +# other job commands +complete -j -P '%' fg jobs disown + +# readonly and unset complete with shell variables +complete -v readonly unset + +# set completes with set options +complete -A setopt set + +# shopt completes with shopt options +complete -A shopt shopt + +# helptopics +complete -A helptopic help + +# unalias completes with aliases +complete -a unalias + +# bind completes with readline bindings (make this more intelligent) +complete -A binding bind + +# type and which complete on commands +complete -c command type which + +# builtin completes on builtins +complete -b builtin + +# start of section containing completion functions called by other functions + +# This function checks whether we have a given program on the system. +# No need for bulky functions in memory if we don't. +# +have() +{ + unset -v have + PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type $1 &>/dev/null && + have="yes" +} + +# use GNU sed if we have it, since its extensions are still used in our code +# +[ $UNAME != Linux ] && have gsed && alias sed=gsed + +# This function checks whether a given readline variable +# is `on'. +# +_rl_enabled() +{ + [[ "$( bind -v )" = *$1+([[:space:]])on* ]] +} + +# This function shell-quotes the argument +quote() +{ + echo \'${1//\'/\'\\\'\'}\' #'# Help vim syntax highlighting +} + +# This function quotes the argument in a way so that readline dequoting +# results in the original argument +quote_readline() +{ + local t="${1//\\/\\\\}" + echo \'${t//\'/\'\\\'\'}\' #'# Help vim syntax highlighting +} + +# This function shell-dequotes the argument +dequote() +{ + eval echo "$1" +} + + +# Get the word to complete +# This is nicer than ${COMP_WORDS[$COMP_CWORD]}, since it handles cases +# where the user is completing in the middle of a word. +# (For example, if the line is "ls foobar", +# and the cursor is here --------> ^ +# it will complete just "foo", not "foobar", which is what the user wants.) +_get_cword() +{ + if [[ "${#COMP_WORDS[COMP_CWORD]}" -eq 0 ]] || [[ "$COMP_POINT" == "${#COMP_LINE}" ]]; then + echo "${COMP_WORDS[COMP_CWORD]}" + else + local i + local cur="$COMP_LINE" + local index="$COMP_POINT" + for (( i = 0; i <= COMP_CWORD; ++i )); do + while [[ "${#cur}" -ge ${#COMP_WORDS[i]} ]] && [[ "${cur:0:${#COMP_WORDS[i]}}" != "${COMP_WORDS[i]}" ]]; do + cur="${cur:1}" + index="$(( index - 1 ))" + done + if [[ "$i" -lt "$COMP_CWORD" ]]; then + local old_size="${#cur}" + cur="${cur#${COMP_WORDS[i]}}" + local new_size="${#cur}" + index="$(( index - old_size + new_size ))" + fi + done + + if [[ "${COMP_WORDS[COMP_CWORD]:0:${#cur}}" != "$cur" ]]; then + # We messed up! At least return the whole word so things keep working + echo "${COMP_WORDS[COMP_CWORD]}" + else + echo "${cur:0:$index}" + fi + fi +} + + +# This function performs file and directory completion. It's better than +# simply using 'compgen -f', because it honours spaces in filenames. +# If passed -d, it completes only on directories. If passed anything else, +# it's assumed to be a file glob to complete on. +# +_filedir() +{ + local IFS=$'\t\n' xspec + + _expand || return 0 + + local toks=( ) tmp + while read -r tmp; do + [[ -n $tmp ]] && toks[${#toks[@]}]=$tmp + done < <( compgen -d -- "$(quote_readline "$cur")" ) + + if [[ "$1" != -d ]]; then + xspec=${1:+"!*.$1"} + while read -r tmp; do + [[ -n $tmp ]] && toks[${#toks[@]}]=$tmp + done < <( compgen -f -X "$xspec" -- "$(quote_readline "$cur")" ) + fi + + COMPREPLY=( "${COMPREPLY[@]}" "${toks[@]}" ) +} + +# This function completes on signal names +# +_signals() +{ + local i + + # standard signal completion is rather braindead, so we need + # to hack around to get what we want here, which is to + # complete on a dash, followed by the signal name minus + # the SIG prefix + COMPREPLY=( $( compgen -A signal SIG${cur#-} )) + for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do + COMPREPLY[i]=-${COMPREPLY[i]#SIG} + done +} + +# This function completes on configured network interfaces +# +_configured_interfaces() +{ + if [ -f /etc/debian_version ]; then + # Debian system + COMPREPLY=( $( sed -ne 's|^iface \([^ ]\+\).*$|\1|p' \ + /etc/network/interfaces ) ) + elif [ -f /etc/SuSE-release ]; then + # SuSE system + COMPREPLY=( $( command ls \ + /etc/sysconfig/network/ifcfg-* | \ + sed -ne 's|.*ifcfg-\('$cur'.*\)|\1|p' ) ) + elif [ -f /etc/pld-release ]; then + # PLD Linux + COMPREPLY=( $( command ls -B \ + /etc/sysconfig/interfaces | \ + sed -ne 's|.*ifcfg-\('$cur'.*\)|\1|p' ) ) + else + # Assume Red Hat + COMPREPLY=( $( command ls \ + /etc/sysconfig/network-scripts/ifcfg-* | \ + sed -ne 's|.*ifcfg-\('$cur'.*\)|\1|p' ) ) + fi +} + +# This function completes on all available network interfaces +# -a: restrict to active interfaces only +# -w: restrict to wireless interfaces only +# +_available_interfaces() +{ + local cmd + + if [ "${1:-}" = -w ]; then + cmd="iwconfig" + elif [ "${1:-}" = -a ]; then + cmd="ifconfig" + else + cmd="ifconfig -a" + fi + + COMPREPLY=( $( eval $cmd 2>/dev/null | \ + sed -ne 's|^\('$cur'[^[:space:][:punct:]]\{1,\}\).*$|\1|p') ) +} + +# This function expands tildes in pathnames +# +_expand() +{ + # FIXME: Why was this here? + # [ "$cur" != "${cur%\\}" ] && cur="$cur\\" + + # expand ~username type directory specifications + if [[ "$cur" == \~*/* ]]; then + eval cur=$cur + elif [[ "$cur" == \~* ]]; then + cur=${cur#\~} + COMPREPLY=( $( compgen -P '~' -u $cur ) ) + return ${#COMPREPLY[@]} + fi +} + +# This function completes on process IDs. +# AIX and Solaris ps prefers X/Open syntax. +[ $UNAME = SunOS -o $UNAME = AIX ] && +_pids() +{ + COMPREPLY=( $( compgen -W '$( command ps -efo pid | sed 1d )' -- $cur )) +} || +_pids() +{ + COMPREPLY=( $( compgen -W '$( command ps axo pid | sed 1d )' -- $cur ) ) +} + +# This function completes on process group IDs. +# AIX and SunOS prefer X/Open, all else should be BSD. +[ $UNAME = SunOS -o $UNAME = AIX ] && +_pgids() +{ + COMPREPLY=( $( compgen -W '$( command ps -efo pgid | sed 1d )' -- $cur )) +} || +_pgids() +{ + COMPREPLY=( $( compgen -W '$( command ps axo pgid | sed 1d )' -- $cur )) +} + +# This function completes on user IDs +# +_uids() +{ + if type getent &>/dev/null; then + COMPREPLY=( $( getent passwd | \ + awk -F: '{if ($3 ~ /^'$cur'/) print $3}' ) ) + elif type perl &>/dev/null; then + COMPREPLY=( $( compgen -W '$( perl -e '"'"'while (($uid) = (getpwent)[2]) { print $uid . "\n" }'"'"' )' -- $cur ) ) + else + # make do with /etc/passwd + COMPREPLY=( $( awk 'BEGIN {FS=":"} {if ($3 ~ /^'$cur'/) print $3}'\ + /etc/passwd ) ) + fi +} + +# This function completes on group IDs +# +_gids() +{ + if type getent &>/dev/null; then + COMPREPLY=( $( getent group | \ + awk -F: '{if ($3 ~ /^'$cur'/) print $3}' ) ) + elif type perl &>/dev/null; then + COMPREPLY=( $( compgen -W '$( perl -e '"'"'while (($gid) = (getgrent)[2]) { print $gid . "\n" }'"'"' )' -- $cur ) ) + else + # make do with /etc/group + COMPREPLY=( $( awk 'BEGIN {FS=":"} {if ($3 ~ /^'$cur'/) print $3}'\ + /etc/group ) ) + fi +} + +# This function completes on services +# +_services() +{ + local sysvdir famdir + [ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d || sysvdir=/etc/init.d + famdir=/etc/xinetd.d + COMPREPLY=( $( builtin echo $sysvdir/!(*.rpmsave|*.rpmorig|*~|functions)) ) + + if [ -d $famdir ]; then + COMPREPLY=( "${COMPREPLY[@]}" $( builtin echo $famdir/!(*.rpmsave|*.rpmorig|*~)) ) + fi + + COMPREPLY=( $( compgen -W '${COMPREPLY[@]#@($sysvdir|$famdir)/}' -- $cur ) ) +} + +# This function complete on modules +# +_modules() +{ + local modpath + modpath=/lib/modules/$1 + COMPREPLY=( $( command ls -R $modpath | \ + sed -ne 's/^\('$cur'.*\)\.k\?o\(\|.gz\)$/\1/p') ) +} + +# this function complete on user:group format +# +_usergroup() +{ + local IFS=$'\n' + cur=${cur//\\\\ / } + if [[ $cur = *@(\\:|.)* ]] && [ -n "$bash205" ]; then + user=${cur%%*([^:.])} + COMPREPLY=( $(compgen -P ${user/\\\\} -g -- ${cur##*[.:]}) ) + elif [[ $cur = *:* ]] && [ -n "$bash205" ]; then + COMPREPLY=( $( compgen -g -- ${cur##*[.:]} ) ) + else + COMPREPLY=( $( compgen -S : -u -- $cur ) ) + fi +} + +# this function count the number of mandatory args +# +_count_args() +{ + args=1 + for (( i=1; i < COMP_CWORD; i++ )); do + if [[ "${COMP_WORDS[i]}" != -* ]]; then + args=$(($args+1)) + fi + done +} + +# start of section containing completion functions for bash built-ins + +# bash alias completion +# +_alias() +{ + local cur + + COMPREPLY=() + cur=${COMP_WORDS[$COMP_CWORD]} + + case "$COMP_LINE" in + *[^=]) + COMPREPLY=( $( compgen -A alias -S '=' -- $cur ) ) + ;; + *=) + COMPREPLY=( "$( alias ${cur%=} 2>/dev/null | \ + sed -e 's|^alias '$cur'\(.*\)$|\1|' )" ) + ;; + esac +} +complete -F _alias $nospace alias + +# bash export completion +# +_export() +{ + local cur + + COMPREPLY=() + cur=${COMP_WORDS[$COMP_CWORD]} + + case "$COMP_LINE" in + *=\$*) + COMPREPLY=( $( compgen -v -P '$' -- ${cur#*=\$} ) ) + ;; + *[^=]) + COMPREPLY=( $( compgen -v -S '=' -- $cur ) ) + ;; + *=) + COMPREPLY=( "$( eval echo -n \"$`echo ${cur%=}`\" | + ( echo -n \' + sed -e 's/'\''/'\''\\\'\'''\''/g' + echo -n \' ) )" ) + ;; + esac +} +complete -F _export $default $nospace export + +# bash shell function completion +# +_function() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + if [[ $1 == @(declare|typeset) ]]; then + if [ "$prev" = -f ]; then + COMPREPLY=( $( compgen -A function -- $cur ) ) + elif [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-a -f -F -i -r -x -p' -- \ + $cur ) ) + fi + elif [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $( compgen -A function -- $cur ) ) + else + COMPREPLY=( "() $( type -- ${COMP_WORDS[1]} | sed -e 1,2d )" ) + fi +} +complete -F _function function declare typeset + +# bash complete completion +# +_complete() +{ + local cur prev options + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case $prev in + -o) + options="default dirnames filenames" + [ -n "$bash205b" ] && options="$options nospace" + [ -n "$bash3" ] && options="$options bashdefault plusdirs" + COMPREPLY=( $( compgen -W "$options" -- $cur ) ) + return 0 + ;; + + -A) + COMPREPLY=( $( compgen -W 'alias arrayvar binding \ + builtin command directory disabled enabled \ + export file function group helptopic hostname \ + job keyword running service setopt shopt \ + signal stopped user variable' -- $cur ) ) + return 0 + ;; + + -C) + COMPREPLY=( $( compgen -A command -- $cur ) ) + return 0 + ;; + -F) + COMPREPLY=( $( compgen -A function -- $cur ) ) + return 0 + ;; + -@(p|r)) + COMPREPLY=( $( complete -p | sed -e 's|.* ||' | \ + grep "^$cur" ) ) + return 0 + ;; + + esac + + if [[ "$cur" == -* ]]; then + # relevant options completion + options="-a -b -c -d -e -f -g -j -k -s -v -u -A -G -W -P -S -X -F -C" + [ -n "$bash205" ] && options="$options -o" + COMPREPLY=( $( compgen -W "$options" -- $cur ) ) + else + COMPREPLY=( $( compgen -A command -- $cur ) ) + fi +} +complete -F _complete complete + +# start of section containing completion functions for external programs + +# a little help for FreeBSD ports users +[ $UNAME = FreeBSD ] && complete -W 'index search fetch fetch-list \ + extract patch configure build install reinstall \ + deinstall clean clean-depends kernel buildworld' make + +# This completes on a list of all available service scripts for the +# 'service' command and/or the SysV init.d directory, followed by +# that script's available commands +# +{ have service || [ -d /etc/init.d/ ]; } && +_service() +{ + local cur sysvdir + + COMPREPLY=() + prev=${COMP_WORDS[COMP_CWORD-1]} + cur=`_get_cword` + + # don't complete for things like killall, ssh and mysql if it's + # the standalone command, rather than the init script + [[ ${COMP_WORDS[0]} != @(*init.d/!(functions|~)|service) ]] && return 0 + + # don't complete past 2nd token + [ $COMP_CWORD -gt 2 ] && return 0 + + [ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d \ + || sysvdir=/etc/init.d + + if [[ $COMP_CWORD -eq 1 ]] && [[ $prev == "service" ]]; then + _services + else + COMPREPLY=( $( compgen -W '`sed -ne "y/|/ /; \ + s/^.*Usage.*{\(.*\)}.*$/\1/p" \ + $sysvdir/${prev##*/} 2>/dev/null`' -- $cur ) ) + fi + + return 0 +} && +complete -F _service service +[ -d /etc/init.d/ ] && complete -F _service $default \ + $(for i in /etc/init.d/*; do echo ${i##*/}; done) + +# chown(1) completion +# +_chown() +{ + local cur + cur=`_get_cword` + + # options completion + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes \ + --dereference --no-dereference --from= --silent --quiet \ + --reference= --recursive --verbose --help --version' -- $cur ) ) + else + _count_args + + case $args in + 1) + _usergroup + ;; + *) + _filedir + ;; + esac + fi +} +complete -F _chown $filenames chown + +# chgrp(1) completion +# +_chgrp() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + cur=${cur//\\\\/} + prev=${COMP_WORDS[COMP_CWORD-1]} + + # options completion + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes \ + --dereference --no-dereference --silent --quiet \ + --reference= --recursive --verbose --help --version' -- $cur ) ) + return 0 + fi + + # first parameter on line or first since an option? + if [ $COMP_CWORD -eq 1 ] && [[ "$cur" != -* ]] || \ + [[ "$prev" == -* ]] && [ -n "$bash205" ]; then + local IFS=$'\n' + COMPREPLY=( $( compgen -g $cur 2>/dev/null ) ) + else + _filedir || return 0 + fi + + return 0 +} +complete -F _chgrp $filenames chgrp + +# umount(8) completion. This relies on the mount point being the third +# space-delimited field in the output of mount(8) +# +_umount() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + OLDIFS="$IFS" + IFS="\n" + COMPREPLY=( $( compgen -W '$( mount | cut -d" " -f 3 )' -- $cur ) ) + IFS="$OLDIFS" + + return 0 +} +complete -F _umount $dirnames umount + +# mount(8) completion. This will pull a list of possible mounts out of +# /etc/{,v}fstab, unless the word being completed contains a ':', which +# would indicate the specification of an NFS server. In that case, we +# query the server for a list of all available exports and complete on +# that instead. +# +_mount() +{ local cur i sm host + + COMPREPLY=() + cur=`_get_cword` + [[ "$cur" == \\ ]] && cur="/" + + for i in {,/usr}/{,s}bin/showmount; do [ -x $i ] && sm=$i && break; done + + if [ -n "$sm" ] && [[ "$cur" == *:* ]]; then + COMPREPLY=( $( $sm -e ${cur%%:*} | sed 1d | \ + grep ^${cur#*:} | awk '{print $1}' ) ) + elif [[ "$cur" == //* ]]; then + host=${cur#//} + host=${host%%/*} + if [ -n "$host" ]; then + COMPREPLY=( $( compgen -W "$( echo $( smbclient -d 0 -NL $host 2>/dev/null| + sed -ne '/^['"$'\t '"']*Sharename/,/^$/p' | + sed -ne '3,$s|^[^A-Za-z]*\([^'"$'\t '"']*\).*$|//'$host'/\1|p' ) )" -- "$cur" ) ) + fi + elif [ -r /etc/vfstab ]; then + # Solaris + COMPREPLY=( $( awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' \ + /etc/vfstab | grep "^$cur" ) ) + elif [ ! -e /etc/fstab ]; then + # probably Cygwin + COMPREPLY=( $( mount | awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' \ + | grep "^$cur" ) ) + else + # probably Linux + COMPREPLY=( $( awk '! /^[ \t]*#/ {if ($2 ~ /\//) print $2}' \ + /etc/fstab | grep "^$cur" ) ) + fi + + return 0 +} +complete -F _mount $default $filenames mount + +# Linux rmmod(8) completion. This completes on a list of all currently +# installed kernel modules. +# +have rmmod && { +_rmmod() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + COMPREPLY=( $( /sbin/lsmod | \ + awk '{if (NR != 1 && $1 ~ /^'$cur'/) print $1}' 2>/dev/null )) + return 0 +} +complete -F _rmmod rmmod + +# Linux insmod(8), modprobe(8) and modinfo(8) completion. This completes on a +# list of all available modules for the version of the kernel currently +# running. +# +_insmod() +{ + local cur prev modpath + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + # behave like lsmod for modprobe -r + if [ $1 = "modprobe" ] && + [ "${COMP_WORDS[1]}" = "-r" ]; then + COMPREPLY=( $( /sbin/lsmod | \ + awk '{if (NR != 1 && $1 ~ /^'$cur'/) print $1}' ) ) + return 0 + fi + + # do filename completion if we're giving a path to a module + if [[ "$cur" == */* ]]; then + _filedir '@(?(k)o?(.gz))' + return 0 + fi + + if [ $COMP_CWORD -gt 1 ] && + [[ "${COMP_WORDS[COMP_CWORD-1]}" != -* ]]; then + # do module parameter completion + COMPREPLY=( $( /sbin/modinfo -p ${COMP_WORDS[1]} 2>/dev/null | \ + awk '{if ($1 ~ /^parm:/ && $2 ~ /^'$cur'/) { print $2 } \ + else if ($1 !~ /:/ && $1 ~ /^'$cur'/) { print $1 }}' ) ) + else + _modules $(uname -r) + fi + + return 0 +} +complete -F _insmod $filenames insmod modprobe modinfo +} + +# man(1) completion +# +[ $UNAME = GNU -o $UNAME = Linux -o $UNAME = Darwin \ + -o $UNAME = FreeBSD -o $UNAME = SunOS -o $UNAME = Cygwin \ + -o $UNAME = OpenBSD ] && +_man() +{ + local cur prev sect manpath UNAME + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + _expand || return 0 + + # default completion if parameter contains / + if [[ "$cur" == */* ]]; then + _filedir + return 0 + fi + + UNAME=$( uname -s ) + # strip OS type and version under Cygwin + UNAME=${UNAME/CYGWIN_*/Cygwin} + if [ $UNAME = GNU -o $UNAME = Linux -o $UNAME = FreeBSD \ + -o $UNAME = Cygwin ]; then + manpath=$( manpath 2>/dev/null || command man --path ) + else + manpath=$MANPATH + fi + + if [ -z "$manpath" ]; then + COMPREPLY=( $( compgen -c -- $cur ) ) + return 0 + fi + + # determine manual section to search + [[ "$prev" == [0-9ln] ]] && sect=$prev || sect='*' + + manpath=$manpath: + if [ -n "$cur" ]; then + manpath="${manpath//://*man$sect/$cur* } ${manpath//://*cat$sect/$cur* }" + else + manpath="${manpath//://*man$sect/ } ${manpath//://*cat$sect/ }" + fi + + # redirect stderr for when path doesn't exist + COMPREPLY=( $( eval command ls "$manpath" 2>/dev/null ) ) + # weed out directory path names and paths to man pages + COMPREPLY=( ${COMPREPLY[@]##*/?(:)} ) + # strip suffix from man pages + COMPREPLY=( ${COMPREPLY[@]%.@(gz|bz2)} ) + COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) ) + + [[ "$prev" != [0-9ln] ]] && _filedir '[0-9ln]' + + return 0 +} +[ $UNAME = GNU -o $UNAME = Linux -o $UNAME = Darwin \ + -o $UNAME = FreeBSD -o $UNAME = SunOS -o $UNAME = Cygwin \ + -o $UNAME = OpenBSD ] && \ +complete -F _man $filenames man apropos whatis + +# renice(8) completion +# +_renice() +{ + local command cur curopt i + + COMPREPLY=() + cur=`_get_cword` + command=$1 + + i=0 + # walk back through command line and find last option + while [ $i -le $COMP_CWORD -a ${#COMPREPLY[@]} -eq 0 ]; do + curopt=${COMP_WORDS[COMP_CWORD-$i]} + case "$curopt" in + -u) + COMPREPLY=( $( compgen -u -- $cur ) ) + ;; + -g) + _pgids + ;; + -p|$command) + _pids + ;; + esac + i=$(( ++i )) + done +} +complete -F _renice renice + +# kill(1) completion +# +_kill() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + if [ $COMP_CWORD -eq 1 ] && [[ "$cur" == -* ]]; then + # return list of available signals + _signals + else + # return list of available PIDs + _pids + fi +} +complete -F _kill kill + +# Linux and FreeBSD killall(1) completion. +# +[ $UNAME = Linux -o $UNAME = FreeBSD ] && +_killall() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + if [ $COMP_CWORD -eq 1 ] && [[ "$cur" == -* ]]; then + _signals + else + COMPREPLY=( $( compgen -W '$( command ps axo command | \ + sed -ne "1d; s/^\[\?\([^-][^] ]*\).*$/\1/p" | \ + sed -e "s/.*\///" )' -- $cur ) ) + fi + + return 0 +} +[ $UNAME = Linux -o $UNAME = FreeBSD ] && complete -F _killall killall pkill + +# Linux and FreeBSD pgrep(1) completion. +# +[ $UNAME = Linux -o $UNAME = FreeBSD ] && +_pgrep() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + COMPREPLY=( $( compgen -W '$( command ps axo command | \ + sed -ne "1d; s/^\[\?\([^-][^] ]*\).*$/\1/p" | \ + sed -e "s/.*\///" )' -- $cur ) ) + + return 0 +} +[ $UNAME = Linux -o $UNAME = FreeBSD ] && complete -F _pgrep pgrep +# Linux pidof(8) completion. +[ $UNAME = Linux ] && complete -F _pgrep pidof + +# GNU find(1) completion. This makes heavy use of ksh style extended +# globs and contains Linux specific code for completing the parameter +# to the -fstype option. +# +_find() +{ + local cur prev i exprfound onlyonce + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(max|min)depth) + COMPREPLY=( $( compgen -W '0 1 2 3 4 5 6 7 8 9' -- $cur ) ) + return 0 + ;; + -?(a|c)newer|-fls|-fprint?(0|f)|-?(i)?(l)name|-?(i)wholename) + _filedir + return 0 + ;; + -fstype) + # this is highly non-portable + [ -e /proc/filesystems ] && + COMPREPLY=( $( cut -d$'\t' -f 2 /proc/filesystems | \ + grep "^$cur" ) ) + return 0 + ;; + -gid) + _gids + return 0 + ;; + -group) + if [ -n "$bash205" ]; then + COMPREPLY=( $( compgen -g -- $cur 2>/dev/null) ) + fi + return 0 + ;; + -?(x)type) + COMPREPLY=( $( compgen -W 'b c d p f l s' -- $cur ) ) + return 0 + ;; + -uid) + _uids + return 0 + ;; + -user) + COMPREPLY=( $( compgen -u -- $cur ) ) + return 0 + ;; + -exec|-ok) + COMP_WORDS=(COMP_WORDS[0] $cur) + COMP_CWORD=1 + _command + return 0 + ;; + -[acm]min|-[acm]time|-?(i)?(l)name|-inum|-?(i)path|-?(i)regex| \ + -links|-perm|-size|-used|-printf) + # do nothing, just wait for a parameter to be given + return 0 + ;; + esac + + _expand || return 0 + + # set exprfound to 1 if there is already an expression present + for i in ${COMP_WORDS[@]}; do + [[ "$i" = [-\(\),\!]* ]] && exprfound=1 && break + done + + # handle case where first parameter is not a dash option + if [ "$exprfound" != 1 ] && [[ "$cur" != [-\(\),\!]* ]]; then + _filedir -d + return 0 + fi + + # complete using basic options + COMPREPLY=( $( compgen -W '-daystart -depth -follow -help -maxdepth \ + -mindepth -mount -noleaf -version -xdev -amin -anewer \ + -atime -cmin -cnewer -ctime -empty -false -fstype \ + -gid -group -ilname -iname -inum -ipath -iregex \ + -wholename \ + -links -lname -mmin -mtime -name -newer -nouser \ + -nogroup -perm -regex -size -true -type -uid -used \ + -user -xtype -exec -fls -fprint -fprint0 -fprintf -ok \ + -print -print0 -printf -prune -ls' -- $cur ) ) + + # this removes any options from the list of completions that have + # already been specified somewhere on the command line, as long as + # these options can only be used once (in a word, "options", in + # opposition to "tests" and "actions", as in the find(1) manpage). + onlyonce=' -daystart -depth -follow -help -maxdepth -mindepth -mount \ + -noleaf -version -xdev ' + COMPREPLY=( $( echo "${COMP_WORDS[@]}" | \ + (while read -d ' ' i; do + [ "$i" == "" ] || + [ "${onlyonce/ ${i%% *} / }" == "$onlyonce" ] && + continue + # flatten array with spaces on either side, + # otherwise we cannot grep on word boundaries of + # first and last word + COMPREPLY=" ${COMPREPLY[@]} " + # remove word from list of completions + COMPREPLY=( ${COMPREPLY/ ${i%% *} / } ) + done + echo "${COMPREPLY[@]}") + ) ) + + _filedir + + return 0 +} +complete -F _find $filenames find + +# Linux iwconfig(8) completion +# +[ $UNAME = Linux ] && have iwconfig && +_iwconfig() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case $prev in + mode) + COMPREPLY=( $( compgen -W 'managed ad-hoc master \ + repeater secondary monitor' -- $cur ) ) + return 0 + ;; + essid) + COMPREPLY=( $( compgen -W 'on off any' -- $cur ) ) + if [ -n "${COMP_IWLIST_SCAN:-}" ]; then + COMPREPLY=( "${COMPREPLY[@]}" \ + $( iwlist ${COMP_WORDS[1]} scan | \ + awk -F '"' '/ESSID/ {print $2}' | \ + grep "^$cur" )) + fi + return 0 + ;; + nwid) + COMPREPLY=( $( compgen -W 'on off' -- $cur ) ) + return 0 + ;; + channel) + COMPREPLY=( $( iwlist ${COMP_WORDS[1]} channel | \ + awk '/^[[:space:]]*Channel/ {print $2}' | \ + grep "^$cur" ) ) + return 0 + ;; + + freq) + COMPREPLY=( $( iwlist ${COMP_WORDS[1]} channel | \ + awk '/^[[:space:]]*Channel/ {print $4"G"}' | \ + grep "^$cur" ) ) + return 0 + ;; + ap) + COMPREPLY=( $( compgen -W 'on off any' -- $cur ) ) + if [ -n "${COMP_IWLIST_SCAN:-}" ]; then + COMPREPLY=( "${COMPREPLY[@]}" \ + $( iwlist ${COMP_WORDS[1]} scan | \ + awk -F ': ' '/Address/ {print $2}' | \ + grep "^$cur" ) ) + fi + return 0 + ;; + rate) + COMPREPLY=( $( compgen -W 'auto fixed' -- $cur ) ) + COMPREPLY=( "${COMPREPLY[@]}" \ + $( iwlist ${COMP_WORDS[1]} rate | \ + awk '/^[[:space:]]*[0-9]/ {print $1"M"}' | \ + grep "^$cur" ) ) + return 0 + ;; + rts) + COMPREPLY=( $( compgen -W 'auto fixed off' -- $cur ) ) + return 0 + ;; + frag) + COMPREPLY=( $( compgen -W 'auto fixed off' -- $cur ) ) + return 0 + ;; + key) + COMPREPLY=( $( compgen -W 'off on open restricted' -- $cur ) ) + return 0 + ;; + enc) + COMPREPLY=( $( compgen -W 'off on open restricted' -- $cur ) ) + return 0 + ;; + power) + COMPREPLY=( $( compgen -W 'period timeout off on' -- $cur ) ) + return 0 + ;; + txpower) + COMPREPLY=( $( compgen -W 'off on auto' -- $cur ) ) + return 0 + ;; + retry) + COMPREPLY=( $( compgen -W 'limit lifetime' -- $cur ) ) + return 0 + ;; + esac + + if [ $COMP_CWORD -eq 1 ]; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--help --version' -- $cur ) ) + else + _available_interfaces -w + fi + else + COMPREPLY=( $( compgen -W 'essid nwid mode freq channel sens mode \ + ap nick rate rts frag enc key power txpower commit' -- $cur ) ) + fi + +} && +complete -F _iwconfig iwconfig + +# Linux iwlist(8) completion +# +[ $UNAME = Linux ] && have iwlist && +_iwlist() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + if [ $COMP_CWORD -eq 1 ]; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--help --version' -- $cur ) ) + else + _available_interfaces -w + fi + else + COMPREPLY=( $( compgen -W 'scan scanning freq frequency \ + channel rate bit bitrate key enc encryption power \ + txpower retry ap accesspoint peers event' -- $cur ) ) + fi +} && +complete -F _iwlist iwlist + +# Linux iwspy(8) completion +# +[ $UNAME = Linux ] && have iwspy && +_iwspy() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + if [ $COMP_CWORD -eq 1 ]; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--help --version' -- $cur ) ) + else + _available_interfaces -w + fi + else + COMPREPLY=( $( compgen -W 'setthr getthr off' -- $cur ) ) + fi +} && +complete -F _iwspy iwspy + +# Linux iwpriv(8) completion +# +[ $UNAME = Linux ] && have iwpriv && +_iwpriv() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + roam) + COMPREPLY=( $( compgen -W 'on off' -- $cur ) ) + return 0 + ;; + port) + COMPREPLY=( $( compgen -W 'ad-hoc managed' -- $cur ) ) + return 0 + ;; + esac + + if [ $COMP_CWORD -eq 1 ]; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--help --version' -- $cur ) ) + else + _available_interfaces -w + fi + else + COMPREPLY=( $( compgen -W '--all roam port' -- $cur ) ) + fi +} && +complete -F _iwpriv iwpriv + +# RedHat & Debian GNU/Linux if{up,down} completion +# +[ $UNAME = Linux ] && { have ifup || have ifdown; } && +_ifupdown() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + if [ $COMP_CWORD -eq 1 ]; then + _configured_interfaces + COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") ) + fi + + return 0 +} && +complete -F _ifupdown ifup ifdown +[ $UNAME = Linux ] && have ifstatus && complete -F _ifupdown ifstatus + +# Linux ipsec(8) completion (for FreeS/WAN) +# +[ $UNAME = Linux ] && have ipsec && +_ipsec() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $( compgen -W 'auto barf eroute klipsdebug look \ + manual pluto ranbits rsasigkey \ + setup showdefaults showhostkey spi \ + spigrp tncfg whack' -- $cur ) ) + return 0 + fi + + case ${COMP_WORDS[1]} in + auto) + COMPREPLY=( $( compgen -W '--asynchronous --up --add --delete \ + --replace --down --route --unroute \ + --ready --status --rereadsecrets' \ + -- $cur ) ) + ;; + manual) + COMPREPLY=( $( compgen -W '--up --down --route --unroute \ + --union' -- $cur ) ) + ;; + ranbits) + COMPREPLY=( $( compgen -W '--quick --continuous --bytes' \ + -- $cur ) ) + ;; + setup) + COMPREPLY=( $( compgen -W '--start --stop --restart' -- $cur ) ) + ;; + + *) + ;; + esac + + return 0 +} && +complete -F _ipsec ipsec + +# Postfix completion. +# +have postfix && { +# postfix(1) +# +_postfix() +{ + local cur prev + + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + if [[ $cur == '-' ]]; then + COMPREPLY=(-c -D -v) + return 0 + fi + if [[ $prev == '-c' ]]; then + _filedir -d + return 0 + fi + if [[ $prev == '-D' ]]; then + COMPREPLY=( $( compgen -W 'start' -- "`get_cword`" ) ) + return 0 + fi + COMPREPLY=( $( compgen -W 'start stop reload abort flush check' -- \ + "`get_cword`" ) ) +} +complete -F _postfix postfix + +# postalias(1) and postmap(1) +# +_postmap() +{ + local cur prev len idx + + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + if [[ $cur == '-' ]]; then + COMPREPLY=(-N -f -i -n -o -p -r -v -w -c -d -q) + return 0 + fi + if [[ $prev == '-c' ]]; then + _filedir -d + return 0 + fi + if [[ $prev == -[dq] ]]; then + return 0 + fi + + if [[ "$cur" == *:* ]]; then + COMPREPLY=( $( compgen -f -- ${cur#*:} ) ) + else + len=${#cur} + idx=0 + for pval in $( /usr/sbin/postconf -m ); do + if [[ "$cur" == "${pval:0:$len}" ]]; then + COMPREPLY[$idx]="$pval:" + idx=$(($idx+1)) + fi + done + if [[ $idx -eq 0 ]]; then + COMPREPLY=( $( compgen -f -- "$cur" ) ) + fi + fi + return 0 +} +complete -F _postmap postmap postalias + +# postcat(1) +# +_postcat() +{ + local cur prev pval len idx qfile + + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + if [[ $cur == '-' ]]; then + COMPREPLY=(-c -q -v) + return 0 + fi + if [[ $prev == '-c' ]]; then + _filedir -d + return 0 + fi + + qfile=0 + for idx in "${COMP_WORDS[@]}"; do + [[ "$idx" = -q ]] && qfile=1 && break + done + if [[ $qfile == 1 ]]; then + len=${#cur} + idx=0 + for pval in $( mailq | \ + sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; s/[* !].*$//' ); do + if [[ "$cur" == "${pval:0:$len}" ]]; then + COMPREPLY[$idx]=$pval + idx=$(($idx+1)) + fi + done + return 0 + else + _filedir + return 0 + fi +} +complete -F _postcat postcat + +# postconf(1) +# +_postconf() +{ + local cur prev pval len idx eqext + + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + if [[ $cur == '-' ]]; then + COMPREPLY=(-c -d -e -h -m -l -n -v) + return 0 + fi + if [[ $prev == '-c' ]]; then + _filedir -d + return 0 + fi + if [[ $prev == '-e' ]]; then + cur=${cur#[\"\']} + eqext='=' + fi + len=${#cur} + idx=0 + for pval in $( /usr/sbin/postconf | cut -d ' ' -f 1 ); do + if [[ "$cur" == "${pval:0:$len}" ]]; then + COMPREPLY[$idx]="$pval$eqext" + idx=$(($idx+1)) + fi + done + return 0 +} +complete -F _postconf postconf + +# postsuper(1) +# +_postsuper() +{ + local cur prev pval len idx + + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + if [[ $cur == '-' ]]; then + COMPREPLY=(-c -d -h -H -p -r -s -v) + return 0 + fi + case $prev in + -[dr]) + len=${#cur} + idx=0 + for pval in $( echo ALL; mailq | \ + sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; s/[* !].*$//' ); do + if [[ "$cur" == "${pval:0:$len}" ]]; then + COMPREPLY[$idx]=$pval + idx=$(($idx+1)) + fi + done + return 0 + ;; + -h) + len=${#cur} + idx=0 + for pval in $( echo ALL; mailq | \ + sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; s/[* ].*$//; /!$/d' ); do + if [[ "$cur" == "${pval:0:$len}" ]]; then + COMPREPLY[$idx]=$pval + idx=$(($idx+1)) + fi + done + return 0 + ;; + -H) + len=${#cur} + idx=0 + for pval in $( echo ALL; mailq | \ + sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; /^[0-9A-Z]*[* ]/d; s/!.*$//' ); do + if [[ "$cur" == "${pval:0:$len}" ]]; then + COMPREPLY[$idx]=$pval + idx=$(($idx+1)) + fi + done + return 0 + ;; + esac + COMPREPLY=( $( compgen -W 'hold incoming active deferred' -- $cur ) ) + return 0 +} +complete -F _postsuper postsuper +} + +# cvs(1) completion +# +have cvs && { +set_prefix() +{ + [ -z ${prefix:-} ] || prefix=${cur%/*}/ + [ -r ${prefix:-}CVS/Entries ] || prefix="" +} + +get_entries() +{ + local IFS=$'\n' + [ -r ${prefix:-}CVS/Entries ] && \ + entries=$(cut -d/ -f2 -s ${prefix:-}CVS/Entries) +} + +get_modules() +{ + if [ -n "$prefix" ]; then + COMPREPLY=( $( command ls -d ${cvsroot}/${prefix}/!(CVSROOT) ) ) + else + COMPREPLY=( $( command ls -d ${cvsroot}/!(CVSROOT) ) ) + fi +} + +_cvs() +{ + local cur count mode i cvsroot cvsroots pwd + local -a flags miss files entries changed newremoved + + COMPREPLY=() + cur=`_get_cword` + + count=0 + for i in "${COMP_WORDS[@]}"; do + [ $count -eq $COMP_CWORD ] && break + # Last parameter was the CVSROOT, now go back to mode selection + if [ "${COMP_WORDS[((count))]}" == "$cvsroot" -a "$mode" == "cvsroot" ]; then + mode="" + fi + if [ -z "$mode" ]; then + case $i in + -d) + mode=cvsroot + cvsroot=${COMP_WORDS[((count+1))]} + ;; + @(ad?(d)|new)) + mode=add + ;; + @(adm?(in)|rcs)) + mode=admin + ;; + ann?(notate)) + mode=annotate + ;; + @(checkout|co|get)) + mode=checkout + ;; + @(com?(mit)|ci)) + mode=commit + ;; + di?(f?(f))) + mode=diff + ;; + ex?(p?(ort))) + mode=export + ;; + ?(un)edit) + mode=$i + ;; + hi?(s?(tory))) + mode=history + ;; + im?(p?(ort))) + mode=import + ;; + re?(l?(ease))) + mode=release + ;; + ?(r)log) + mode=log + ;; + @(rdiff|patch)) + mode=rdiff + ;; + @(remove|rm|delete)) + mode=remove + ;; + @(rtag|rfreeze)) + mode=rtag + ;; + st?(at?(us))) + mode=status + ;; + @(tag|freeze)) + mode=tag + ;; + up?(d?(ate))) + mode=update + ;; + *) + ;; + esac + elif [[ "$i" = -* ]]; then + flags=( "${flags[@]}" $i ) + fi + count=$((++count)) + done + + case "$mode" in + add) + if [[ "$cur" != -* ]]; then + set_prefix + if [ $COMP_CWORD -gt 1 -a -r ${prefix:-}CVS/Entries ]; then + get_entries + [ -z "$cur" ] && \ + files=$( command ls -Ad !(CVS) ) || \ + files=$( command ls -d ${cur}* 2>/dev/null ) + for i in "${entries[@]}"; do + files=( ${files[@]/#$i//} ) + done + COMPREPLY=( $( compgen -W '${files[@]}' -- \ + $cur ) ) + fi + else + COMPREPLY=( $( compgen -W '-k -m' -- $cur ) ) + fi + ;; + admin) + if [[ "$cur" = -* ]]; then + COMPREPLY=( $( compgen -W '-i -a -A -e -b -c -k -l -u \ + -L -U -m -M -n -N -o -q -I \ + -s -t -t- -T -V -x -z' -- \ + $cur ) ) + fi + ;; + annotate) + if [[ "$cur" = -* ]]; then + COMPREPLY=( $( compgen -W '-D -F -f -l -R -r' -- $cur ) ) + else + get_entries + COMPREPLY=( $( compgen -W '${entries[@]}' -- $cur ) ) + fi + ;; + checkout) + if [[ "$cur" != -* ]]; then + [ -z "$cvsroot" ] && cvsroot=$CVSROOT + COMPREPLY=( $( cvs -d "$cvsroot" co -c 2> /dev/null | \ + awk '{print $1}' ) ) + COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- $cur ) ) + else + COMPREPLY=( $( compgen -W '-A -N -P -R -c -f -l -n -p \ + -s -r -D -d -k -j' -- $cur ) ) + fi + ;; + commit) + set_prefix + + if [[ "$cur" != -* ]] && [ -r ${prefix:-}CVS/Entries ]; then + # if $COMP_CVS_REMOTE is not null, 'cvs commit' will + # complete on remotely checked-out files (requires + # passwordless access to the remote repository + if [ -n "${COMP_CVS_REMOTE:-}" ]; then + # this is the least computationally intensive + # way found so far, but other changes + # (something other than changed/removed/new) + # may be missing + changed=( $( cvs -q diff --brief 2>&1 | \ + sed -ne 's/^Files [^ ]* and \([^ ]*\) differ$/\1/p' ) ) + newremoved=( $( cvs -q diff --brief 2>&1 | \ + sed -ne 's/^cvs diff: \([^ ]*\) .*, no comparison available$/\1/p' ) ) + COMPREPLY=( $( compgen -W '${changed[@]:-} \ + ${newremoved[@]:-}' -- $cur ) ) + else + _filedir + fi + else + COMPREPLY=( $( compgen -W '-n -R -l -f -F -m -r' -- \ + $cur ) ) + fi + ;; + cvsroot) + if [ -r ~/.cvspass ]; then + # Ugly escaping because of bash treating ':' specially + cvsroots=$( sed 's/^[^ ]* //; s/:/\\:/g' ~/.cvspass ) + COMPREPLY=( $( compgen -W '$cvsroots' -- $cur ) ) + fi + ;; + export) + if [[ "$cur" != -* ]]; then + [ -z "$cvsroot" ] && cvsroot=$CVSROOT + COMPREPLY=( $( cvs -d "$cvsroot" co -c | awk '{print $1}' ) ) + COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- $cur ) ) + else + COMPREPLY=( $( compgen -W '-N -f -l -R -n \ + -r -D -d -k' -- $cur ) ) + fi + ;; + diff) + if [[ "$cur" == -* ]]; then + _longopt diff + else + get_entries + COMPREPLY=( $( compgen -W '${entries[@]:-}' -- $cur ) ) + fi + ;; + remove) + if [[ "$cur" != -* ]]; then + set_prefix + if [ $COMP_CWORD -gt 1 -a -r ${prefix:-}CVS/Entries ]; then + get_entries + # find out what files are missing + for i in "${entries[@]}"; do + [ ! -r "$i" ] && miss=( "${miss[@]}" $i ) + done + COMPREPLY=( $(compgen -W '${miss[@]:-}' -- $cur) ) + fi + else + COMPREPLY=( $( compgen -W '-f -l -R' -- $cur ) ) + fi + ;; + import) + if [[ "$cur" != -* ]]; then + # starts with same algorithm as checkout + [ -z "$cvsroot" ] && cvsroot=$CVSROOT + prefix=${cur%/*} + if [ -r ${cvsroot}/${prefix} ]; then + get_modules + COMPREPLY=( ${COMPREPLY[@]#$cvsroot} ) + COMPREPLY=( ${COMPREPLY[@]#\/} ) + fi + pwd=$( pwd ) + pwd=${pwd##*/} + COMPREPLY=( $( compgen -W '${COMPREPLY[@]} $pwd' -- \ + $cur ) ) + else + COMPREPLY=( $( compgen -W '-d -k -I -b -m -W' -- $cur )) + fi + ;; + update) + if [[ "$cur" = -* ]]; then + COMPREPLY=( $( compgen -W '-A -P -C -d -f -l -R -p \ + -k -r -D -j -I -W' -- \ + $cur ) ) + fi + ;; + "") + COMPREPLY=( $( compgen -W 'add admin annotate checkout ci co \ + commit diff delete edit export \ + freeze get history import log new \ + patch rcs rdiff release remove \ + rfreeze rlog rm rtag stat status \ + tag unedit up update -H -Q -q -b \ + -d -e -f -l -n -t -r -v -w -x -z \ + --help --version' -- $cur ) ) + ;; + *) + ;; + esac + + return 0 +} +complete -F _cvs $default cvs +} + +have rpm && { +# helper functions for rpm completion +# +_rpm_installed_packages() +{ + local ver nodig nosig + + if [ -r /var/log/rpmpkgs -a \ + /var/log/rpmpkgs -nt /var/lib/rpm/Packages ]; then + # using RHL 7.2 or later - this is quicker than querying the DB + COMPREPLY=( $( sed -ne \ + 's|^\('$cur'.*\)-[0-9a-zA-Z._]\+-[0-9a-z.@]\+.*\.rpm$|\1|p' \ + /var/log/rpmpkgs ) ) + else + nodig="" + nosig="" + ver=$(rpm --version) + ver=${ver##* } + + if [[ "$ver" > "4.0.4" ]]; then + nodig="--nodigest" + fi + if [[ "$ver" > "4.0.99" ]]; then + nosig="--nosignature" + fi + + COMPREPLY=( $( rpm -qa $nodig $nosig | sed -ne \ + 's|^\('$cur'.*\)-[0-9a-zA-Z._]\+-[0-9a-z.@]\+$|\1|p' ) ) + fi +} + +_rpm_groups() +{ + local IFS=$'\t' + # remove trailing backslash, or grep will complain + cur=${cur%"\\"} + COMPREPLY=( $( rpm -qa $nodig $nosig --queryformat '%{group}\n' | \ + grep "^$cur" ) ) + # backslash escape spaces and translate newlines to tabs + COMPREPLY=( $( echo "${COMPREPLY[@]}" | sed 's/ /\\ /g' | tr '\n' '\t' ) ) +} + +# rpm(8) completion +# +_rpm() +{ + local cur prev ver nodig nosig + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + nodig="" + nosig="" + ver=$(rpm --version); ver=${ver##* } + + if [[ "$ver" > "4.0.4" ]]; then + nodig="--nodigest" + fi + if [[ "$ver" > "4.0.99" ]]; then + nosig="--nosignature" + fi + + if [ $COMP_CWORD -eq 1 ]; then + # first parameter on line + case "$cur" in + -b*) + COMPREPLY=( $( compgen -W '-ba -bb -bc -bi -bl -bp -bs'\ + -- $cur ) ) + ;; + -t*) + COMPREPLY=( $( compgen -W '-ta -tb -tc -ti -tl -tp -ts'\ + -- $cur ) ) + ;; + --*) + COMPREPLY=( $( compgen -W '--help --version --initdb \ + --checksig --recompile --rebuild --resign --addsign \ + --rebuilddb --showrc --setperms --setugids --tarbuild \ + --eval --install --upgrade --query --freshen --erase \ + --verify --querytags --rmsource --rmspec --clean \ + --import' -- $cur ) ) + ;; + *) + COMPREPLY=( $( compgen -W '-b -e -F -i -q -t -U -V' \ + -- $cur ) ) + ;; + esac + + return 0 + fi + + case "$prev" in + --@(@(db|exclude)path|prefix|relocate|root)) + _filedir -d + return 0 + ;; + --eval) + # get a list of macros + COMPREPLY=( $( sed -ne 's|^\(%'${cur#\%}'[^ '$'\t'']*\).*$|\1|p' \ + /usr/lib/rpm/macros ) ) + return 0 + ;; + --pipe) + COMPREPLY=( $( compgen -c -- $cur ) ) + return 0 + ;; + --rcfile) + _filedir + return 0 + ;; + --specfile) + # complete on .spec files + _filedir spec + return 0 + ;; + --whatprovides) + if [[ "$cur" == */* ]]; then + _filedir + else + # complete on capabilities + COMPREPLY=( $( rpm -qa $nodig $nosig --queryformat \ + '%{providename}\n' | grep "^$cur" ) ) + fi + return 0 + ;; + --whatrequires) + # complete on capabilities + COMPREPLY=( $( rpm -qa $nodig $nosig --queryformat \ + '%{requirename}\n' | grep "^$cur" ) ) + return 0 + ;; + esac + + case "${COMP_WORDS[1]}" in + -@([iFU]*|-install|-freshen|-upgrade)) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--percent --force --test \ + --replacepkgs --replacefiles --root --excludedocs \ + --includedocs --noscripts --rcfile --ignorearch \ + --dbpath --prefix --ignoreos --nodeps --allfiles \ + --ftpproxy --ftpport --justdb --httpproxy --httpport \ + --noorder --relocate --badreloc --notriggers \ + --excludepath --ignoresize --oldpackage --define \ + --eval --pipe --queryformat --repackage --nosuggests \ + --nodigest --nosignature' -- $cur ) ) + else + _filedir 'rpm' + fi + ;; + -@(e|-erase)) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--allmatches --noscripts \ + --notriggers --nodeps --test --repackage' -- $cur ) ) + else + _rpm_installed_packages + fi + ;; + -@(q*|-query)) + # check whether we're doing file completion + if [ "${COMP_LINE#* -*([^ -])f}" != "$COMP_LINE" ]; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--scripts --root \ + --rcfile --requires --ftpport --ftpproxy \ + --httpproxy --httpport --provides --triggers \ + --dump --changelog --dbpath \ + --last --filesbypkg \ + --info --list --state \ + --docfiles --configfiles --queryformat \ + --conflicts --obsoletes \ + --nodigest --nosignature \ + --triggerscripts' -- $cur ) ) + else + _filedir + fi + elif [ "${COMP_LINE#* -*([^ -])g}" != "$COMP_LINE" ]; then + _rpm_groups + elif [ "${COMP_LINE#* -*([^ -])p}" != "$COMP_LINE" ]; then + # uninstalled package completion + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--scripts --root \ + --rcfile --whatprovides --whatrequires \ + --requires --triggeredby --ftpport --ftpproxy \ + --httpproxy --httpport --provides --triggers \ + --dump --changelog --dbpath --filesbypkg \ + --define --eval --pipe --showrc --info --list \ + --state --docfiles --configfiles --queryformat\ + --conflicts --obsoletes --nodigest \ + --nosignature' -- $cur ) ) + else + _filedir 'rpm' + fi + else + # installed package completion + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--scripts --root \ + --rcfile --whatprovides --whatrequires \ + --requires --triggeredby --ftpport --ftpproxy \ + --httpproxy --httpport --provides --triggers \ + --dump --changelog --dbpath --specfile \ + --querybynumber --last --filesbypkg --define \ + --eval --pipe --showrc --info --list --state \ + --docfiles --configfiles --queryformat \ + --conflicts --obsoletes --pkgid --hdrid \ + --fileid --tid --nodigest --nosignature \ + --triggerscripts' -- $cur ) ) + elif [ "${COMP_LINE#* -*([^ -])a}" == "$COMP_LINE" ]; then + _rpm_installed_packages + fi + fi + ;; + -@(K*|-checksig)) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--nopgp --nogpg --nomd5 \ + --nodigest --nosignature' -- $cur ) ) + else + _filedir 'rpm' + fi + ;; + -@([Vy]*|-verify)) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--root --rcfile --dbpath \ + --nodeps --nogroup --nolinkto --nomode --nomtime \ + --nordev --nouser --nofiles --noscripts --nomd5 \ + --querytags --specfile --whatrequires --whatprovides \ + --nodigest --nosignature' -- $cur ) ) + # check whether we're doing file completion + elif [ "${COMP_LINE#* -*([^ -])f}" != "$COMP_LINE" ]; then + _filedir + elif [ "${COMP_LINE#* -*([^ -])g}" != "$COMP_LINE" ]; then + _rpm_groups + elif [ "${COMP_LINE#* -*([^ -])p}" != "$COMP_LINE" ]; then + _filedir 'rpm' + else + _rpm_installed_packages + fi + ;; + -[bt]*) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--short-circuit --timecheck \ + --clean --rmsource --rmspec --test --sign --buildroot \ + --target -- buildarch --buildos --nobuild --nodeps \ + --nodirtokens' -- $cur ) ) + elif [[ ${COMP_WORDS[1]} == -b* ]]; then + _filedir 'spec' + else + _filedir '@(tgz|tar.@(gz|bz2))' + fi + ;; + --re@(build|compile)) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--nodeps --rmsource \ + --rmspec --sign --nodirtokens --target' -- $cur ) ) + else + _filedir '?(no)src.rpm' + fi + ;; + --tarbuild) + _filedir '@(tgz|tar.@(gz|bz2))' + ;; + --@(re|add)sign) + _filedir 'rpm' + ;; + --set@(perms|gids)) + _rpm_installed_packages + ;; + --@(clean|rms@(ource|pec))) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--clean --rmsource \ + --rmspec' -- $cur ) ) + else + _filedir 'spec' + fi + ;; + --@(import|dbpath|root)) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--import --dbpath --root' \ + -- $cur ) ) + else + _filedir + fi + ;; + esac + + return 0 +} +complete -F _rpm $filenames rpm rpmbuild +} + +# Debian apt-get(8) completion. +# +have apt-get && +_apt_get() +{ + local cur prev special i + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do + if [[ ${COMP_WORDS[i]} == @(install|remove|purge|source|build-dep) ]]; then + special=${COMP_WORDS[i]} + fi + done + + if [ -n "$special" ]; then + case $special in + remove|purge) + if [ -f /etc/debian_version ]; then + # Debian system + COMPREPLY=( $( _comp_dpkg_installed_packages \ + $cur ) ) + else + # assume RPM based + _rpm_installed_packages + fi + return 0 + ;; + *) + COMPREPLY=( $( apt-cache pkgnames $cur 2> /dev/null ) ) + return 0 + ;; + + esac + fi + + case "$prev" in + -@(c|-config-file)) + _filedir + return 0 + ;; + + -@(t|-target-release|-default-release)) + COMPREPLY=( $( apt-cache policy | \ + grep "release.o=Debian,a=$cur" | \ + sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null) ) + return 0 + ;; + + esac + + if [[ "$cur" == -* ]]; then + + COMPREPLY=( $( compgen -W '-d -f -h -v -m -q -s -y \ + -u -t -b -c -o --download-only --fix-broken \ + --help --version --ignore-missing \ + --fix-missing --no-download --quiet --simulate \ + --just-print --dry-run --recon --no-act --yes \ + --assume-yes --show-upgraded --only-source \ + --compile --build --ignore-hold \ + --target-release --no-upgrade --force-yes \ + --print-uris --purge --reinstall \ + --list-cleanup --default-release \ + --trivial-only --no-remove --diff-only \ + --tar-only --config-file --option --auto-remove' -- $cur ) ) + else + + COMPREPLY=( $( compgen -W 'update upgrade dselect-upgrade \ + dist-upgrade install remove purge source \ + build-dep check clean autoclean autoremove' \ + -- $cur ) ) + + fi + + + return 0 +} && +complete -F _apt_get $filenames apt-get + +# Debian apt-cache(8) completion. +# +have apt-cache && +_apt_cache() +{ + local cur prev special i + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + + if [ "$cur" != show ]; then + for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do + if [[ ${COMP_WORDS[i]} == @(add|depends|dotty|policy|rdepends|madison|show?(pkg|src|)) ]]; then + special=${COMP_WORDS[i]} + fi + done + fi + + + if [ -n "$special" ]; then + case $special in + add) + _filedir + return 0 + ;; + + *) + COMPREPLY=( $( apt-cache pkgnames $cur 2> /dev/null ) ) + return 0 + ;; + + esac + fi + + + case "$prev" in + -@(c|p|s|-config-file|-@(pkg|src)-cache)) + _filedir + return 0 + ;; + search) + if [[ "$cur" != -* ]]; then + return 0 + fi + ;; + esac + + if [[ "$cur" == -* ]]; then + + COMPREPLY=( $( compgen -W '-h -v -p -s -q -i -f -a -g -c \ + -o --help --version --pkg-cache --src-cache \ + --quiet --important --full --all-versions \ + --no-all-versions --generate --no-generate \ + --names-only --all-names --recurse \ + --config-file --option' -- $cur ) ) + else + + COMPREPLY=( $( compgen -W 'add gencaches show showpkg showsrc \ + stats dump dumpavail unmet search search \ + depends rdepends pkgnames dotty xvcg \ + policy madison' -- $cur ) ) + + fi + + + return 0 +} && +complete -F _apt_cache $filenames apt-cache + + +# Debian aptitude(1) completion +# +have aptitude && { +have grep-status && { +_comp_dpkg_hold_packages() +{ + grep-status -P -e "^$1" -a -FStatus 'hold' -n -s Package +} +} || { +_comp_dpkg_hold_packages() +{ + grep -B 2 'hold' /var/lib/dpkg/status | grep "Package: $1" \ + | cut -d\ -f2 +} +} + +_aptitude() +{ + local cur dashoptions prev special i + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + + dashoptions='-S -u -i -h --help --version -s --simulate -d \ + --download-only -P --prompt -y --assume-yes -F \ + --display-format -O --sort -w --width -f -r -g \ + --with-recommends --with-suggests -R -G \ + --without-recommends --without-suggests -t \ + --target-release -V --show-versions -D --show-deps\ + -Z -v --verbose --purge-unused' + + for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do + if [[ ${COMP_WORDS[i]} == @(install|reinstall|hold|unhold|markauto|unmarkauto|dist-upgrade|full-upgrade|download|show|forbid-version|purge|remove|changelog|why|why-not|keep|keep-all) ]]; then + special=${COMP_WORDS[i]} + fi + #exclude some mutually exclusive options + [[ ${COMP_WORDS[i]} == '-u' ]] && dashoptions=${dashoptions/-i} + [[ ${COMP_WORDS[i]} == '-i' ]] && dashoptions=${dashoptions/-u} + done + + if [[ -n "$special" ]]; then + case $special in + @(install|hold|markauto|unmarkauto|dist-upgrade|full-upgrade|download|show|changelog|why|why-not)) + COMPREPLY=( $( apt-cache pkgnames $cur 2> /dev/null ) ) + return 0 + ;; + @(purge|remove|reinstall|forbid-version)) + COMPREPLY=( $( _comp_dpkg_installed_packages $cur ) ) + return 0 + ;; + unhold) + COMPREPLY=( $( _comp_dpkg_hold_packages $cur ) ) + return 0 + ;; + + esac + fi + + case $prev in + # don't complete anything if these options are found + @(autoclean|clean|forget-new|search|upgrade|safe-upgrade|update|keep-all)) + return 0 + ;; + + -S) + _filedir + return 0 + ;; + + -@(t|-target-release|-default-release)) + COMPREPLY=( $( apt-cache policy | \ + grep "release.o=Debian,a=$cur" | \ + sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null ) ) + return 0 + ;; + + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W "$dashoptions" -- $cur ) ) + else + COMPREPLY=( $( compgen -W 'update upgrade safe-upgrade forget-new clean \ + autoclean install reinstall remove \ + hold unhold purge markauto unmarkauto why why-not \ + dist-upgrade full-upgrade download search show \ + forbid-version changelog keep-all' -- $cur ) ) + fi + + + return 0 +} +complete -F _aptitude $default aptitude +} + +# Debian apt-build(1) completion. +# +have apt-build && +_apt_build() +{ + local cur prev special i + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do + if [[ ${COMP_WORDS[i]} == @(install|remove|source|info|clean) ]]; then + special=${COMP_WORDS[i]} + fi + done + + if [ -n "$special" ]; then + case $special in + @(install|source|info)) + COMPREPLY=( $( apt-cache pkgnames $cur 2> /dev/null ) ) + return 0 + ;; + remove) + COMPREPLY=( $( _comp_dpkg_installed_packages \ + $cur ) ) + return 0 + ;; + *) + return 0 + ;; + esac + fi + + case "$prev" in + + --@(patch|build-dir|repository-dir)) + _filedir + return 0 + ;; + + -@(h|-help)) + return 0 + ;; + + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--help --show-upgraded -u --build-dir \ + --repository-dir --build-only \ + --build-command --reinstall --rebuild \ + --remove-builddep --no-wrapper --purge \ + --patch --patch-strip -p --yes -y \ + --version -v --no-source' -- $cur ) ) + + else + COMPREPLY=( $( compgen -W 'update upgrade install remove \ + source dist-upgrade world clean info \ + clean-build update-repository ' -- $cur ) ) + fi + + + return 0 +} && +complete -F _apt_build $filenames apt-build + +# chsh(1) completion +# +_chsh() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + if [ "$prev" = "-s" ]; then + if [ -f /etc/debian_version ]; then + COMPREPLY=( $( /dev/null ) ) + fi + if [ ${#khd[@]} -gt 0 ]; then + # Needs to look for files called + # .../.ssh2/key_22_.pub + # dont fork any processes, because in a cluster environment, + # there can be hundreds of hostkeys + for i in "${khd[@]}" ; do + if [[ "$i" == *key_22_$curd*.pub ]] && [ -r "$i" ] ; then + host=${i/#*key_22_/} + host=${host/%.pub/} + COMPREPLY=( "${COMPREPLY[@]}" $host ) + fi + done + fi + + # append any available aliases from config files + if [ ${#config[@]} -gt 0 ] && [ -n "$aliases" ]; then + local host_aliases=$( sed -ne 's/^[Hh][Oo][Ss][Tt]\([Nn][Aa][Mm][Ee]\)\?['"$'\t '"']\+\([^*?]*\)$/\2/p' "${config[@]}" ) + hosts=$( compgen -W "$host_aliases" -- $ocur ) + COMPREPLY=( "${COMPREPLY[@]}" $hosts ) + fi + + # Now add results of normal hostname completion + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -A hostname -- $ocur ) ) + + # apply suffix + for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do + COMPREPLY[i]=$user${COMPREPLY[i]}$suffix + done + else + # Just do normal hostname completion + COMPREPLY=( $( compgen -A hostname -S "$suffix" -- $cur ) ) + fi + + return 0 +} +complete -F _known_hosts traceroute traceroute6 tracepath tracepath6 \ + ping ping6 fping fping6 telnet host nslookup rsh rlogin ftp dig ssh-installkeys mtr + +# ssh(1) completion +# +have ssh && { +_ssh() +{ + local cur prev + local -a config + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -*c) + COMPREPLY=( $( compgen -W 'blowfish 3des 3des-cbc blowfish-cbc \ + arcfour cast128-cbc' -- $cur ) ) + ;; + -*i) + _filedir + ;; + -*l) + COMPREPLY=( $( compgen -u -- $cur ) ) + ;; + *) + _known_hosts -a + + [ $COMP_CWORD -eq 1 ] || \ + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -c -- $cur ) ) + esac + + return 0 +} +shopt -u hostcomplete && complete -F _ssh ssh slogin sftp xhost autossh + +# scp(1) completion +# +_scp() +{ + local cur userhost path + + COMPREPLY=() + cur=`_get_cword` + + _expand || return 0 + + if [[ "$cur" == *:* ]]; then + local IFS=$'\t\n' + # remove backslash escape from : + cur=${cur/\\:/:} + userhost=${cur%%?(\\):*} + path=${cur#*:} + # unescape spaces + path=${path//\\\\\\\\ / } + if [ -z "$path" ]; then + # default to home dir of specified user on remote host + path=$(ssh -o 'Batchmode yes' $userhost pwd 2>/dev/null) + fi + # escape spaces; remove executables, aliases, pipes and sockets; + # add space at end of file names + COMPREPLY=( $( ssh -o 'Batchmode yes' $userhost \ + command ls -aF1d "$path*" 2>/dev/null | \ + sed -e "s/[][(){}<>\",:;^&!$&=?\`|\\ ']/\\\\\\\\\\\\&/g" \ + -e 's/[*@|=]$//g' -e 's/[^\/]$/& /g' ) ) + return 0 + fi + + [[ "$cur" == */* ]] || _known_hosts -c -a + local IFS=$'\t\n' + COMPREPLY=( "${COMPREPLY[@]}" $( command ls -aF1d $cur* \ + 2>/dev/null | sed \ + -e "s/[][(){}<>\",:;^&!$&=?\`|\\ ']/\\\\&/g" \ + -e 's/[*@|=]$//g' -e 's/[^\/]$/& /g' ) ) + return 0 +} +complete -F _scp $nospace scp +} + +# rsync(1) completion +# +have rsync && +_rsync() +{ + local cur prev shell i userhost path + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + _expand || return 0 + + case "$prev" in + --@(config|password-file|include-from|exclude-from)) + _filedir + return 0 + ;; + -@(T|-temp-dir|-compare-dest)) + _filedir -d + return 0 + ;; + -@(e|-rsh)) + COMPREPLY=( $( compgen -W 'rsh ssh' -- $cur ) ) + return 0 + ;; + esac + + case "$cur" in + -*) + COMPREPLY=( $( compgen -W '-v -q -c -a -r -R -b -u -l -L -H \ + -p -o -g -D -t -S -n -W -x -B -e -C -I -T -P \ + -z -h -4 -6 --verbose --quiet --checksum \ + --archive --recursive --relative --backup \ + --backup-dir --suffix= --update --links \ + --copy-links --copy-unsafe-links --safe-links \ + --hard-links --perms --owner --group --devices\ + --times --sparse --dry-run --whole-file \ + --no-whole-file --one-file-system \ + --block-size= --rsh= --rsync-path= \ + --cvs-exclude --existing --ignore-existing \ + --delete --delete-excluded --delete-after \ + --ignore-errors --max-delete= --partial \ + --force --numeric-ids --timeout= \ + --ignore-times --size-only --modify-window= \ + --temp-dir= --compare-dest= --compress \ + --exclude= --exclude-from= --include= \ + --include-from= --version --daemon --no-detach\ + --address= --config= --port= --blocking-io \ + --no-blocking-io --stats --progress \ + --log-format= --password-file= --bwlimit= \ + --write-batch= --read-batch= --help' -- $cur )) + ;; + *:*) + # find which remote shell is used + shell=rsh + for (( i=1; i < COMP_CWORD; i++ )); do + if [[ "${COMP_WORDS[i]}" == -@(e|-rsh) ]]; then + shell=${COMP_WORDS[i+1]} + break + fi + done + if [[ "$shell" == ssh ]]; then + # remove backslash escape from : + cur=${cur/\\:/:} + userhost=${cur%%?(\\):*} + path=${cur#*:} + # unescape spaces + path=${path//\\\\\\\\ / } + if [ -z "$path" ]; then + # default to home dir of specified + # user on remote host + path=$(ssh -o 'Batchmode yes' \ + $userhost pwd 2>/dev/null) + fi + # escape spaces; remove executables, aliases, pipes + # and sockets; add space at end of file names + COMPREPLY=( $( ssh -o 'Batchmode yes' $userhost \ + command ls -aF1d "$path*" 2>/dev/null | \ + sed -e 's/ /\\\\\\\ /g' -e 's/[*@|=]$//g' \ + -e 's/[^\/]$/& /g' ) ) + fi + ;; + *) + _known_hosts -c -a + _filedir + ;; + esac + + return 0 +} && +complete -F _rsync $nospace $filenames rsync + +# Linux route(8) completion +# +[ $UNAME = Linux ] && +_route() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + if [ "$prev" = dev ]; then + COMPREPLY=( $( ifconfig -a | sed -ne 's|^\('$cur'[^ ]*\).*$|\1|p' )) + return 0 + fi + + COMPREPLY=( $( compgen -W 'add del -host -net netmask metric mss \ + window irtt reject mod dyn reinstate dev \ + default gw' -- $cur ) ) + + COMPREPLY=( $( echo " ${COMP_WORDS[@]}" | \ + (while read -d ' ' i; do + [ "$i" == "" ] && continue + # flatten array with spaces on either side, + # otherwise we cannot grep on word + # boundaries of first and last word + COMPREPLY=" ${COMPREPLY[@]} " + # remove word from list of completions + COMPREPLY=( ${COMPREPLY/ $i / } ) + done + echo "${COMPREPLY[@]}") + ) ) + return 0 +} +[ $UNAME = Linux ] && complete -F _route route + +# GNU make(1) completion +# +have make || have gmake || have gnumake || have pmake && +_make() +{ + local file makef makef_dir="." makef_inc cur prev i + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + # --name value style option + case $prev in + -@(f|o|W)) + _filedir + return 0 + ;; + -@(I|C)) + _filedir -d + return 0 + ;; + esac + + # --name=value style option + if [[ "$cur" == *=* ]]; then + prev=${cur/=*/} + cur=${cur/*=/} + case "$prev" in + --@(file|makefile)) + _filedir + return 0 + ;; + --@(directory|include-dir)) + _filedir -d + return 0 + ;; + esac + fi + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-b -m -B -C -d -e -f -h -i -I\ + -j -l -k -n -o -p -q -r -R - s -S -t -v -w -W \ + --always-make --directory= --debug \ + --environment-overrides --file= --makefile= --help \ + --ignore-errors --include-dir= --jobs --load-average \ + --max-load --keep-going --just-print --dry-run \ + --recon --old-file= --assume-old= --print-data-base \ + --question --no-builtin-rules --no-builtin-variables \ + --silent --quiet --no-keep-goind --stop --touch \ + --version --print-directory --no-print-directory \ + --what-if= --new-file= --assume-new= \ + --warn-undefined-variables' -- $cur ) ) + else + # before we check for makefiles, see if a path was specified + # with -C + for (( i=0; i < ${#COMP_WORDS[@]}; i++ )); do + if [[ ${COMP_WORDS[i]} == -C ]]; then + # eval for tilde expansion + eval makef_dir=${COMP_WORDS[i+1]} + break + fi + done + + # make reads `GNUmakefile', then `makefile', then `Makefile' + if [ -f ${makef_dir}/GNUmakefile ]; then + makef=${makef_dir}/GNUmakefile + elif [ -f ${makef_dir}/makefile ]; then + makef=${makef_dir}/makefile + elif [ -f ${makef_dir}/Makefile ]; then + makef=${makef_dir}/Makefile + else + makef=${makef_dir}/*.mk # local convention + fi + + # before we scan for targets, see if a Makefile name was + # specified with -f + for (( i=0; i < ${#COMP_WORDS[@]}; i++ )); do + if [[ ${COMP_WORDS[i]} == -f ]]; then + # eval for tilde expansion + eval makef=${COMP_WORDS[i+1]} + break + fi + done + + [ ! -f $makef ] && return 0 + + # deal with included Makefiles + makef_inc=$( grep -E '^-?include' $makef | sed -e "s,^.* ,"$makef_dir"/," ) + + for file in $makef_inc; do + [ -f $file ] && makef="$makef $file" + done + + COMPREPLY=( $( awk -F':' '/^[a-zA-Z0-9][^$#\/\t=]*:([^=]|$)/ \ + {split($1,A,/ /);for(i in A)print A[i]}' \ + $makef 2>/dev/null | command grep "^$cur" )) + fi +} && +complete -f -F _make $filenames make gmake gnumake pmake + +# GNU tar(1) completion +# +_tar() +{ + local cur ext regex tar untar + + COMPREPLY=() + cur=`_get_cword` + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $( compgen -W 'c t x u r d A' -- $cur ) ) + return 0 + fi + + case "${COMP_WORDS[1]}" in + ?(-)[cr]*f) + _filedir + return 0 + ;; + +([^IZzjy])f) + ext='t@(ar?(.@(Z|gz|bz?(2)))|gz|bz?(2))' + regex='t\(ar\(\.\(Z\|gz\|bz2\?\)\)\?\|gz\|bz2\?\)' + ;; + *[Zz]*f) + ext='t?(ar.)@(gz|Z)' + regex='t\(ar\.\)\?\(gz\|Z\)' + ;; + *[Ijy]*f) + ext='t?(ar.)bz?(2)' + regex='t\(ar\.\)\?bz2\?' + ;; + *) + _filedir + return 0 + ;; + + esac + + if [[ "$COMP_LINE" == *$ext' ' ]]; then + # complete on files in tar file + # + # get name of tar file from command line + tar=$( echo "$COMP_LINE" | \ + sed -e 's/^.* \([^ ]*'$regex'\) .*$/\1/' ) + # devise how to untar and list it + untar=t${COMP_WORDS[1]//[^Izjyf]/} + + COMPREPLY=( $( compgen -W "$( echo $( tar $untar $tar \ + 2>/dev/null ) )" -- "$cur" ) ) + return 0 + fi + + # file completion on relevant files + _filedir "$ext" + + return 0 +} +[ -n "${COMP_TAR_INTERNAL_PATHS:-}" ] && complete -F _tar $dirnames tar || + complete -F _tar $filenames tar + +# jar(1) completion +# +have jar && +_jar() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + if [ $COMP_CWORD = 1 ]; then + COMPREPLY=( $( compgen -W 'c t x u' -- $cur ) ) + return 0 + fi + + case "${COMP_WORDS[1]}" in + *c*f) + _filedir + ;; + *f) + _filedir '?(e|j|w)ar' + ;; + *) + _filedir + ;; + esac +} && +complete -F _jar $filenames jar + +# Linux iptables(8) completion +# +have iptables && +_iptables() +{ + local cur prev table chain + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + chain='s/^Chain \([^ ]\+\).*$/\1/p' + + if [[ $COMP_LINE == *-t\ *filter* ]]; then + table="-t filter" + elif [[ $COMP_LINE == *-t\ *nat* ]]; then + table="-t nat" + elif [[ $COMP_LINE == *-t\ *mangle* ]]; then + table="-t mangle" + fi + + case "$prev" in + -*[AIDRPFXLZ]) + COMPREPLY=( $( compgen -W '`iptables $table -nL | \ + sed -ne "s/^Chain \([^ ]\+\).*$/\1/p"`' -- $cur ) ) + ;; + -*t) + COMPREPLY=( $( compgen -W 'nat filter mangle' -- $cur ) ) + ;; + -j) + if [ "$table" = "-t filter" -o "$table" = "" ]; then + COMPREPLY=( $( compgen -W 'ACCEPT DROP LOG ULOG REJECT \ + `iptables $table -nL | sed -ne "$chain" \ + -e "s/INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING//"`' -- \ + $cur ) ) + elif [ "$table" = "-t nat" ]; then + COMPREPLY=( $( compgen -W 'ACCEPT DROP LOG ULOG REJECT \ + MIRROR SNAT DNAT MASQUERADE `iptables $table -nL | \ + sed -ne "$chain" -e "s/OUTPUT|PREROUTING|POSTROUTING//"`' \ + -- $cur ) ) + elif [ "$table" = "-t mangle" ]; then + COMPREPLY=( $( compgen -W 'ACCEPT DROP LOG ULOG REJECT \ + MARK TOS `iptables $table -nL | sed -ne "$chain" \ + -e "s/INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING//"`' -- \ + $cur ) ) + fi + ;; + *) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-i -o -s -d -p -f -m --append \ + --delete --insert --replace --list --flush --zero --new \ + --delete-chain --policy --rename-chain --proto --source \ + --destination --in-interface --jump --match --numeric \ + --out-interface --table --verbose --line-numbers --exact \ + --fragment --modprobe= --set-counters --version' -- "$cur") ) + fi + ;; + esac + +} && +complete -F _iptables iptables + +# tcpdump(8) completion +# +have tcpdump && +_tcpdump() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(r|w|F)) + _filedir + return 0 + ;; + -i) + _available_interfaces -a + return 0 + ;; + esac + + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-a -d -e -f -l -n -N -O -p \ + -q -R -S -t -u -v -x -C -F -i -m -r -s -T -w \ + -E' -- $cur ) ) + fi + +} && +complete -F _tcpdump tcpdump + +# autorpm(8) completion +# +have autorpm && +_autorpm() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + COMPREPLY=( $( compgen -W '--notty --debug --help --version \ + auto add fullinfo info help install list \ + remove set' -- $cur ) ) + +} && +complete -F _autorpm autorpm + +# This meta-cd function observes the CDPATH variable, so that cd additionally +# completes on directories under those specified in CDPATH. +# +_cd() +{ + local IFS=$'\t\n' cur=`_get_cword` i j k + + # try to allow variable completion + if [[ "$cur" == ?(\\)\$* ]]; then + COMPREPLY=( $( compgen -v -P '$' -- "${cur#?(\\)$}" ) ) + return 0 + fi + + # Use standard dir completion if no CDPATH or parameter starts with /, + # ./ or ../ + if [ -z "${CDPATH:-}" ] || [[ "$cur" == ?(.)?(.)/* ]]; then + _filedir -d + return 0 + fi + + local -r mark_dirs=$(_rl_enabled mark-directories && echo y) + local -r mark_symdirs=$(_rl_enabled mark-symlinked-directories && echo y) + + # we have a CDPATH, so loop on its contents + for i in ${CDPATH//:/$'\t'}; do + # create an array of matched subdirs + k="${#COMPREPLY[@]}" + for j in $( compgen -d $i/$cur ); do + if [[ ( $mark_symdirs && -h $j || $mark_dirs && ! -h $j ) && ! -d ${j#$i/} ]]; then + j="${j}/" + fi + COMPREPLY[k++]=${j#$i/} + done + done + + _filedir -d + + if [[ ${#COMPREPLY[@]} -eq 1 ]]; then + i=${COMPREPLY[0]} + if [ "$i" == "$cur" ] && [[ $i != "*/" ]]; then + COMPREPLY[0]="${i}/" + fi + fi + + return 0 +} +if shopt -q cdable_vars; then + complete -v -F _cd $nospace $filenames cd +else + complete -F _cd $nospace $filenames cd +fi + +_remove_comp_word() +{ + if [[ COMP_CWORD -eq 0 ]]; then + return + elif [[ ${#COMP_WORDS[@]} -ge 2 ]]; then + local old_cw0="${COMP_WORDS[0]}" + local new_cw0="${COMP_WORDS[1]}" + local old_length="${#COMP_LINE}" + COMP_LINE=${COMP_LINE#${old_cw0}} + local head=${COMP_LINE:0:${#new_cw0}} + local i=1 + while [[ $head != $new_cw0 ]]; do + COMP_LINE=${COMP_LINE:1} + head=${COMP_LINE:0:${#new_cw0}} + if (( ++i > 10 )); then + break + fi + done + local new_length="${#COMP_LINE}" + COMP_POINT=$(( COMP_POINT + new_length - old_length)) + + COMP_CWORD=$(( COMP_CWORD - 1 )) + for (( i=0; i < ${#COMP_WORDS[@]} - 1; ++i )); do + COMP_WORDS[i]="${COMP_WORDS[i+1]}" + done + unset COMP_WORDS[${#COMP_WORDS[@]}-1] + else + return + fi +} + +# A meta-command completion function for commands like sudo(8), which need to +# first complete on a command, then complete according to that command's own +# completion definition - currently not quite foolproof (e.g. mount and umount +# don't work properly), but still quite useful. +# +_command() +{ + local cur func cline cspec noglob cmd done i \ + _COMMAND_FUNC _COMMAND_FUNC_ARGS + + _remove_comp_word + COMPREPLY=() + cur=`_get_cword` + # If the the first arguments following our meta-command-invoker are + # switches, get rid of them. Most definitely not foolproof. + done= + while [ -z $done ] ; do + cmd=${COMP_WORDS[0]} + if [[ "$cmd" == -* ]] && [ $COMP_CWORD -ge 1 ]; then + _remove_comp_word + elif [[ "$cmd" == -* ]] && [[ $COMP_CWORD -eq 0 ]]; then + return + else + done=1 + fi + done + + if [ $COMP_CWORD -eq 0 ]; then + COMPREPLY=( $( compgen -c -- $cur ) ) + elif complete -p $cmd &>/dev/null; then + cspec=$( complete -p $cmd ) + if [ "${cspec#* -F }" != "$cspec" ]; then + # COMP_CWORD and COMP_WORDS() are not read-only, + # so we can set them before handing off to regular + # completion routine + + # get function name + func=${cspec#*-F } + func=${func%% *} + + if [[ ${#COMP_WORDS[@]} -ge 2 ]]; then + $func $cmd "${COMP_WORDS[${#COMP_WORDS[@]}-1]}" "${COMP_WORDS[${#COMP_WORDS[@]}-2]}" + else + $func $cmd "${COMP_WORDS[${#COMP_WORDS[@]}-1]}" + fi + + # remove any \: generated by a command that doesn't + # default to filenames or dirnames (e.g. sudo chown) + # FIXME: I'm pretty sure this does not work! + if [ "${cspec#*-o }" != "$cspec" ]; then + cspec=${cspec#*-o } + cspec=${cspec%% *} + if [[ "$cspec" != @(dir|file)names ]]; then + COMPREPLY=("${COMPREPLY[@]//\\\\:/:}") + fi + fi + elif [ -n "$cspec" ]; then + cspec=${cspec#complete}; + cspec=${cspec%%$cmd}; + COMPREPLY=( $( eval compgen "$cspec" -- "$cur" ) ); + fi + fi + + [ ${#COMPREPLY[@]} -eq 0 ] && _filedir +} +complete -F _command $filenames nohup exec nice eval strace time ltrace then \ + else do vsound command xargs + +_root_command() +{ + PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin _command $1 $2 $3 +} +complete -F _root_command $filenames sudo fakeroot really + +# ant(1) completion +# +have ant && { +_ant() +{ + local cur prev buildfile i + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -buildfile|-f) + _filedir 'xml' + return 0 + ;; + -logfile) + _filedir + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + # relevant options completion + COMPREPLY=( $( compgen -W '-help -projecthelp -version -quiet \ + -verbose -debug -emacs -logfile -logger \ + -listener -buildfile -f -D -find' -- $cur ) ) + else + # available targets completion + # find which buildfile to use + buildfile=build.xml + for (( i=1; i < COMP_CWORD; i++ )); do + if [[ "${COMP_WORDS[i]}" == -buildfile ]]; then + buildfile=${COMP_WORDS[i+1]} + break + fi + done + [ ! -f $buildfile ] && return 0 + + # parse buildfile for targets + COMPREPLY=( $( awk -F'"' '//dev/null | \ + sed -e '1,/^-/d' -e '/^(/,$d' | \ + awk '{print $1}' | grep "^$cur" ) ) +} + +_pg_users() +{ + #COMPREPLY=( $( psql -qtc 'select usename from pg_user' template1 2>/dev/null | \ + # grep "^ $cur" ) ) + #[ ${#COMPREPLY[@]} -eq 0 ] && + COMPREPLY=( $( compgen -u -- $cur ) ) +} + +# createdb(1) completion +# +_createdb() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(h|-host=)) + _known_hosts + return 0 + ;; + -@(U|-username=)) + _pg_users + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-D -T -E -h -p -U -W -e -q \ + --location= --template= --encoding= --host= --port= \ + --username= --password --echo --quiet --help' -- $cur )) + else + _pg_databases + fi +} +complete -F _createdb $default createdb + +# dropdb(1) completion +# +_dropdb() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(h|-host=)) + _known_hosts + return 0 + ;; + -@(U|-username=)) + _pg_users + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-h -p -U -W -e -q \ + --host= --port= --username= --password \ + --interactive --echo --quiet --help' -- $cur ) ) + else + _pg_databases + fi +} +complete -F _dropdb $default dropdb + +# psql(1) completion +# +_psql() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -h|--host) + _known_hosts + return 0 + ;; + -U|--username) + _pg_users + return 0 + ;; + -d|--dbname) + _pg_databases + return 0 + ;; + -@(o|f)|--output|--file) + _filedir + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + # return list of available options + COMPREPLY=( $( compgen -W '-a --echo-all -A --no-align \ + -c --command -d --dbname -e --echo-queries \ + -E --echo-hidden -f --file -F --filed-separator \ + -h --host -H --html -l --list -n -o --output \ + -p --port -P --pset -q -R --record-separator \ + -s --single-step -S --single-line -t --tuples-only \ + -T --table-attr -U --username -v --variable \ + -V --version -W --password -x --expanded -X --nopsqlrc \ + -? --help ' -- $cur ) ) + else + # return list of available databases + _pg_databases + fi +} +complete -F _psql $default psql +} + +_longopt() +{ + local cur opt + + cur=`_get_cword` + + if [[ "$cur" == --*=* ]]; then + opt=${cur%%=*} + # cut backslash that gets inserted before '=' sign + opt=${opt%\\*} + cur=${cur#*=} + _filedir + COMPREPLY=( $( compgen -P "$opt=" -W '${COMPREPLY[@]}' -- $cur)) + return 0 + fi + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( $1 --help 2>&1 | sed -e '/--/!d' \ + -e 's/.*\(--[-A-Za-z0-9]\+=\?\).*/\1/' | \ + command grep "^$cur" | sort -u ) ) + elif [[ "$1" == @(mk|rm)dir ]]; then + _filedir -d + else + _filedir + fi +} +# makeinfo and texi2dvi are defined elsewhere. +for i in a2ps autoconf automake bc gprof ld nm objcopy objdump readelf strip \ + bison cpio diff patch enscript cp df dir du ln ls mkfifo mknod mv rm \ + touch vdir awk gperf grep grub indent less m4 sed shar date \ + tee who texindex cat csplit cut expand fmt fold head \ + md5sum nl od paste pr ptx sha1sum sort split tac tail tr unexpand \ + uniq wc ldd bash id irb mkdir rmdir; do + have $i && complete -F _longopt $filenames $i +done + +# These commands use filenames, so '-o filenames' is not needed. +for i in env netstat seq uname units wget; do + have $i && complete -F _longopt $default $i +done +unset i + +# gcc(1) completion +# +# The only unusual feature is that we don't parse "gcc --help -v" output +# directly, because that would include the options of all the other backend +# tools (linker, assembler, preprocessor, etc) without any indication that +# you cannot feed such options to the gcc driver directly. (For example, the +# linker takes a -z option, but you must type -Wl,-z for gcc.) Instead, we +# ask the driver ("g++") for the name of the compiler ("cc1"), and parse the +# --help output of the compiler. +# +have gcc && +_gcc() +{ + local cur cc backend + + COMPREPLY=() + cur=`_get_cword` + + _expand || return 0 + + case "$1" in + gcj) + backend=jc1 + ;; + gpc) + backend=gpc1 + ;; + *77) + backend=f771 + ;; + *) + backend=cc1 # (near-)universal backend + ;; + esac + + if [[ "$cur" == -* ]]; then + cc=$( $1 -print-prog-name=$backend ) + # sink stderr: + # for C/C++/ObjectiveC it's useless + # for FORTRAN/Java it's an error + COMPREPLY=( $( $cc --help 2>/dev/null | tr '\t' ' ' | \ + sed -e '/^ *-/!d' -e 's/ *-\([^ ]*\).*/-\1/' | \ + command grep "^$cur" | sort -u ) ) + else + _filedir + fi +} && +complete $filenames -F _gcc gcc g++ c++ g77 gcj gpc +[ $UNAME = GNU -o $UNAME = Linux -o $UNAME = Cygwin ] && \ +[ -n "${have:-}" ] && complete $filenames -F _gcc cc + +# Linux cardctl(8) completion +# +have cardctl && +_cardctl() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $( compgen -W 'status config ident suspend \ + resume reset eject insert scheme' \ + -- $cur ) ) + fi +} && +complete -F _cardctl cardctl + +# This function is required by _dpkg() and _dpkg-reconfigure() +# +have dpkg && { +_comp_dpkg_installed_packages() +{ + grep -A 1 "Package: $1" /var/lib/dpkg/status | \ + grep -B 1 -E "ok installed|half-installed|unpacked| \ + half-configured|config-files" | \ + grep "Package: $1" | cut -d\ -f2 +} + +# Debian dpkg(8) completion +# +_dpkg() +{ + local cur prev i + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + i=$COMP_CWORD + + _expand || return 0 + + # find the last option flag + if [[ $cur != -* ]]; then + while [[ $prev != -* && $i != 1 ]]; do + i=$((i-1)) + prev=${COMP_WORDS[i-1]} + done + fi + + case "$prev" in + -@(c|i|A|I|f|e|x|X|-@(install|unpack|record-avail|contents|info|fsys-tarfile|field|control|extract))) + _filedir '?(u)deb' + return 0 + ;; + -@(b|-build)) + _filedir -d + return 0 + ;; + -@(s|p|l|-@(status|print-avail|list))) + COMPREPLY=( $( apt-cache pkgnames $cur 2>/dev/null ) ) + return 0 + ;; + -@(S|-search)) + _filedir + return 0 + ;; + -@(r|L|P|-@(remove|purge|listfiles))) + COMPREPLY=( $( _comp_dpkg_installed_packages $cur ) ) + return 0 + ;; + *) + + COMPREPLY=( $( compgen -W '-i --install --unpack -A --record-avail \ + --configure -r --remove -P --purge --get-selections \ + --set-selections --update-avail --merge-avail \ + --clear-avail --command-fd --forget-old-unavail -s \ + --status -p --print-avail -L --listfiles -l --list \ + -S --search -C --audit --print-architecture \ + --print-gnu-build-architecture \ + --print-installation-architecture \ + --compare-versions --help --version --force-help \ + --force-all --force-auto-select --force-downgrade \ + --force-configure-any --force-hold --force-bad-path \ + --force-not-root --force-overwrite \ + --force-overwrite-diverted --force-bad-verify \ + --force-depends-version --force-depends \ + --force-confnew --force-confold --force-confdef \ + --force-confmiss --force-conflicts --force-architecture\ + --force-overwrite-dir --force-remove-reinstreq \ + --force-remove-essential -Dh \ + --debug=help --licence --admindir= --root= --instdir= \ + -O --selected-only -E --skip-same-version \ + -G --refuse-downgrade -B --auto-deconfigure \ + --no-debsig --no-act -D --debug= --status-fd \ + -b --build -I --info -f --field -c --contents \ + -x --extract -X --vextract --fsys-tarfile -e --control \ + --ignore-depends= --abort-after' -- $cur ) ) + ;; + esac + + +} +complete -F _dpkg $filenames dpkg dpkg-deb +} + +# Debian GNU dpkg-reconfigure(8) completion +# +have dpkg-reconfigure && +_dpkg_reconfigure() +{ + local cur prev opt + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + + case "$prev" in + -@(f|-frontend)) + opt=( $( echo /usr/share/perl5/Debconf/FrontEnd/* ) ) + opt=( ${opt[@]##*/} ) + opt=( ${opt[@]%.pm} ) + COMPREPLY=( $( compgen -W '${opt[@]}' -- $cur ) ) + return 0 + ;; + -@(p|-priority)) + COMPREPLY=( $( compgen -W 'low medium high critical' -- $cur ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-f --frontend -p --priority -a --all \ + -u --unseen-only -h --help -s --showold \ + --force --terse' -- $cur ) ) + else + COMPREPLY=( $( _comp_dpkg_installed_packages $cur ) ) + fi +} && +complete -F _dpkg_reconfigure $default dpkg-reconfigure + +# Debian dpkg-source completion +# +have dpkg-source && +_dpkg_source() +{ + local cur prev options work i action packopts unpackopts + + packopts="-c -l -F -V -T -D -U -W -E -sa -i -I -sk -sp -su -sr -ss -sn -sA -sK -sP -sU -sR" + unpackopts="-sp -sn -su" + options=`echo "-x -b $packopts $unpackopts" | xargs echo | sort -u | xargs echo` + + COMPREPLY=() + if [ "$1" != "dpkg-source" ]; then + exit 1 + fi + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + action="options" + for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do + if [[ ${COMP_WORDS[$i]} == "-x" ]]; then + action=unpack + elif [[ ${COMP_WORDS[$i]} == "-b" ]]; then + action=pack + elif [[ ${COMP_WORDS[$i]} == "-h" ]]; then + action=help + fi + done + # if currently seeing a complete option, return just itself. + for i in $options; do + if [ "$cur" = "$i" ]; then + COMPREPLY=( "$cur" ) + return 0 + fi + done + case "$action" in + "unpack") + if [ "$cur" = "-" -o "$cur" = "-s" ]; then + COMPREPLY=( $unpackots ) + return 0 + fi + case "$prev" in + "-x") + COMPREPLY=( $( compgen -d -- "$cur" ) \ + $( compgen -f -X '!*.dsc' -- "$cur" ) ) + return 0 + ;; + *) + COMPREPLY=( $unpackopts $(compgen -d -f -- "$cur" ) ) + return 0 + ;; + esac + return 0 + ;; + "pack") + if [ "$cur" = "-" ]; then + COMPREPLY=( $packopts ) + return 0 + fi + if [ "$cur" = "-s" ]; then + COMPREPLY=( "-sa" "-sk" "-sp" "-su" "-sr" "-ss" "-sn" \ + "-sA" "-sK" "-sP" "-sU" "-sR" ) + return 0 + fi + case "$prev" in + "-b") + COMPREPLY=( $( compgen -d -- "$cur" ) ) + return 0 + ;; + "-c"|"-l"|"-T"|"-i"|"-I") + # -c: get controlfile + # -l: get per-version info from this file + # -T: read variables here, not debian/substvars + # -i: filter out files to ignore diffs of. + # -I: filter out files when building tarballs. + # return directory names and file names + COMPREPLY=( $( compgen -d -f ) ) + return 0 + ;; + "-F") + # -F: force change log format + COMPREPLY=( $( ( cd /usr/lib/dpkg/parsechangelog; compgen -f "$cur" ) ) ) + return 0 + ;; + "-V"|"-D") + # -V: set a substitution variable + # we don't know anything about possible variables or values + # so we don't try to suggest any completion. + COMPREPLY=() + return 0 + ;; + "-D") + # -D: override or add a .dsc field and value + # if $cur doesn't contain a = yet, suggest variable names + if echo -- "$cur" | grep -q "="; then + # $cur contains a "=" + COMPREPLY=() + return 0 + else + COMPREPLY=( Format Source Version Binary Maintainer Uploader Architecture Standards-Version Build-Depends Files ) + return 0 + fi + ;; + "-U") + # -U: remove a field + # Suggest possible fieldnames + COMPREPLY=( Format Source Version Binary Maintainer Uploader Architecture Standards-Version Build-Depends Files ) + return 0 + ;; + *) + COMPREPLY=( $packopts ) + return 0 + ;; + esac + return 0 + ;; + *) + # if seeing a partial option, return possible completions. + if [ "$cur" = "-s" ]; then + COMPREPLY=( "-sa" "-sk" "-sp" "-su" "-sr" "-ss" "-sn" \ + "-sA" "-sK" "-sP" "-sU" "-sR" ) + return 0 + fi + # else return all possible options. + COMPREPLY=( $options ) + return 0 + ;; + esac +} && +complete -F _dpkg_source dpkg-source + +# Debian Linux dselect(8) completion. +# +have dselect && +_dselect() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + --admindir) + _filedir -d + return 0 + ;; + + -@(D|debug)) + _filedir + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--admindir --help --version --licence \ + --license --expert --debug' -- $cur ) ) + else + COMPREPLY=( $( compgen -W 'access update select install config \ + remove quit' -- $cur ) ) + fi + + + return 0 +} && +complete -F _dselect $filenames dselect + +# Java completion +# + +# available path elements completion +have java && { +_java_path() +{ + cur=${cur##*:} + _filedir '@(jar|zip)' +} + +# exact classpath determination +_java_find_classpath() +{ + local i + + # search first in current options + for (( i=1; i < COMP_CWORD; i++ )); do + if [[ "${COMP_WORDS[i]}" == -@(cp|classpath) ]]; then + classpath=${COMP_WORDS[i+1]} + break + fi + done + + # default to environment + [ -z "$classpath" ] && classpath=$CLASSPATH + + # default to current directory + [ -z "$classpath" ] && classpath=. +} + +# exact sourcepath determination +_java_find_sourcepath() +{ + local i + + # search first in current options + for (( i=1; i < COMP_CWORD; i++ )); do + if [[ "${COMP_WORDS[i]}" == -sourcepath ]]; then + sourcepath=${COMP_WORDS[i+1]} + break + fi + done + + # default to classpath + [ -z "$sourcepath" ] && _java_find_classpath + sourcepath=$classpath +} + +# available classes completion +_java_classes() +{ + local classpath i + + # find which classpath to use + _java_find_classpath + + # convert package syntax to path syntax + cur=${cur//.//} + # parse each classpath element for classes + for i in ${classpath//:/ }; do + if [ -r $i ] && [[ "$i" == *.@(jar|zip) ]]; then + if type zipinfo &> /dev/null; then + COMPREPLY=( "${COMPREPLY[@]}" $( zipinfo -1 \ + "$i" | grep "^$cur" | grep '\.class$' | \ + grep -v "\\$" ) ) + else + COMPREPLY=( "${COMPREPLY[@]}" $( jar tf "$i" \ + "$cur" | grep "\.class$" | grep -v "\\$" ) ) + fi + + elif [ -d $i ]; then + i=${i%/} + COMPREPLY=( "${COMPREPLY[@]}" $( find "$i" -type f \ + -path "$i/$cur*.class" 2>/dev/null | \ + grep -v "\\$" | sed -e "s|^$i/||" ) ) + fi + done + + # remove class extension + COMPREPLY=( ${COMPREPLY[@]%.class} ) + # convert path syntax to package syntax + COMPREPLY=( ${COMPREPLY[@]//\//.} ) +} + +# available packages completion +_java_packages() +{ + local sourcepath i + + # find wich sourcepath to use + _java_find_sourcepath + + # convert package syntax to path syntax + cur=${cur//.//} + # parse each sourcepath element for packages + for i in ${sourcepath//:/ }; do + if [ -d $i ]; then + COMPREPLY=( "${COMPREPLY[@]}" $( command ls -F -d \ + $i/$cur* 2>/dev/null | sed -e 's|^'$i'/||' ) ) + fi + done + # keep only packages + COMPREPLY=( $( echo "${COMPREPLY[@]}" | tr " " "\n" | grep "/$" ) ) + # remove packages extension + COMPREPLY=( ${COMPREPLY[@]%/} ) + # convert path syntax to package syntax + cur=${COMPREPLY[@]//\//.} +} + +# java completion +# +_java() +{ + local cur prev i + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + for ((i=1; i < $COMP_CWORD; i++)); do + case ${COMP_WORDS[$i]} in + -cp|-classpath) + ((i++)) # skip the classpath string. + ;; + -*) + # this is an option, not a class/jarfile name. + ;; + *) + # once we've seen a class, just do filename completion + _filedir + return 0 + ;; + esac + done + + case $prev in + -@(cp|classpath)) + _java_path + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + # relevant options completion + COMPREPLY=( $( compgen -W '-client -hotspot -server -classic \ + -cp -classpath -D -verbose -verbose:class \ + -verbose:gc -version:jni -version \ + -showversion -? -help -X -jar \ + -ea -enableassertions -da -disableassertions \ + -esa -enablesystemassertions \ + -dsa -disablesystemassertions ' -- $cur ) ) + else + if [[ "$prev" == -jar ]]; then + # jar file completion + _filedir jar + else + # classes completion + _java_classes + fi + fi +} +complete -F _java $filenames java +} + +# javadoc completion +# +have javadoc && +_javadoc() +{ + COMPREPLY=() + local cur prev + + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case $prev in + -@(overview|helpfile|stylesheetfile)) + _filedir + return 0 + ;; + -d) + _filedir -d + return 0 + ;; + -@(classpath|bootclasspath|docletpath|sourcepath|extdirs)) + _java_path + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + # relevant options completion + COMPREPLY=( $( compgen -W '-overview -public -protected \ + -package -private -help -doclet -docletpath \ + -sourcepath -classpath -exclude -subpackages \ + -breakiterator -bootclasspath -source -extdirs \ + -verbose -locale -encoding -J -d -use -version \ + -author -docfilessubdirs -splitindex \ + -windowtitle -doctitle -header -footer -bottom \ + -link -linkoffline -excludedocfilessubdir \ + -group -nocomment -nodeprecated -noqualifier \ + -nosince -nodeprecatedlist -notree -noindex \ + -nohelp -nonavbar -quiet -serialwarn -tag \ + -taglet -tagletpath -charset -helpfile \ + -linksource -stylesheetfile -docencoding' -- \ + $cur ) ) + else + # source files completion + _filedir java + # packages completion + _java_packages + fi +} && +complete -F _javadoc $filenames javadoc + +# javac completion +# +have javac && +_javac() +{ + COMPREPLY=() + local cur prev + + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case $prev in + -d) + _filedir -d + return 0 + ;; + -@(classpath|bootclasspath|sourcepath|extdirs)) + _java_path + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + # relevant options completion + COMPREPLY=( $( compgen -W '-g -g:none -g:lines -g:vars\ + -g:source -O -nowarn -verbose -deprecation -classpath\ + -sourcepath -bootclasspath -extdirs -d -encoding -source\ + -target -help' -- $cur ) ) + else + # source files completion + _filedir java + fi +} && +complete -F _javac $filenames javac + +# PINE address-book completion +# +have pine && +_pineaddr() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + COMPREPLY=( $( compgen -W '$( awk "{print \$1}" ~/.addressbook 2>/dev/null)' \ + -- $cur ) ) +} && +complete -F _pineaddr $default pine + +# mutt completion +# +# Mutt doesn't have an "addressbook" like Pine, but it has aliases and +# a "query" function to retrieve addresses, so that's what we use here. +have mutt || have muttng && { +_muttaddr() +{ + _muttaliases + _muttquery + return 0 +} + +_muttconffiles() +{ + local file sofar + local -a newconffiles + + sofar=" $1 " + shift + while [[ "$1" ]]; do + newconffiles=( $(sed -rn 's|^source[[:space:]]+([^[:space:]]+).*$|\1|p' $(eval echo $1) ) ) + for file in "${newconffiles[@]}"; do + [[ ! "$file" ]] || [[ "${sofar/ ${file} / }" != "$sofar" ]] && + continue + sofar="$sofar $file" + sofar=" $(eval _muttconffiles \"$sofar\" $file) " + done + shift + done + echo $sofar +} + +_muttaliases() +{ + local cur muttrc + local -a conffiles aliases + cur=`_get_cword` + + [ -f ~/.${muttcmd}/${muttcmd}rc ] && muttrc="~/.${muttcmd}/${muttcmd}rc" + [ -f ~/.${muttcmd}rc ] && muttrc="~/.${muttcmd}rc" + [ -z "$muttrc" ] && return 0 + + conffiles=( $(eval _muttconffiles $muttrc $muttrc) ) + aliases=( $( sed -rn 's|^alias[[:space:]]+([^[:space:]]+).*$|\1|p' \ + $(eval echo "${conffiles[@]}") ) ) + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W "${aliases[*]}" -- $cur ) ) + + return 0 +} + +_muttquery() +{ + local cur querycmd + local -a queryresults + cur=`_get_cword` + + querycmd="$( $muttcmd -Q query_command | sed -r 's|^query_command=\"(.*)\"$|\1|; s|%s|'$cur'|' )" + if [ -z "$cur" -o -z "$querycmd" ]; then + queryresults=() + else + queryresults=( $( $querycmd | \ + sed -nr '2,$s|^([^[:space:]]+).*|\1|p' ) ) + fi + + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W "${queryresults[*]}" \ + -- $cur ) ) + + return 0 +} + +_muttfiledir() +{ + local cur folder spoolfile + cur=`_get_cword` + + # This is currently not working so well. Perhaps this function should + # just call _filedir() for the moment. + if [[ $cur == [=+]* ]]; then + folder="$( $muttcmd -Q folder | sed -r 's|^folder=\"(.*)\"$|\1|' )" + : folder:=~/Mail + + # Match any file in $folder beginning with $cur + # (minus the leading '=' sign). + COMPREPLY=( $( compgen -f -- "$folder/${cur:1}" ) ) + COMPREPLY=( ${COMPREPLY[@]#$folder/} ) + return 0 + elif [ "$cur" == !* ]; then + spoolfile="$( $muttcmd -Q spoolfile | sed -r 's|^spoolfile=\"(.*)\"$|\1|' )" + [ ! -z "$spoolfile" ] && eval cur="${cur/^!/$spoolfile}"; + fi + _filedir + + return 0 +} + +_mutt() +{ + local cur prev + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + COMPREPLY=() + + [ ${COMP_WORDS[0]} == muttng ] && muttcmd="muttng" || muttcmd="mutt" + + case "$cur" in + -*) + COMPREPLY=( $( compgen -W '-A -a -b -c -e -f -F -H -i -m -n \ + -p -Q -R -s -v -x -y -z -Z -h' \ + -- $cur ) ) + return 0 + ;; + *) + case "$prev" in + -@(a|f|F|H|i)) + _muttfiledir + return 0 + ;; + -A) + _muttaliases + return 0 + ;; + -@(e|m|Q|s|h|p|R|v|y|z|Z)) + return 0 + ;; + *) + _muttaddr + return 0 + ;; + esac + ;; + esac + +} +complete -F _mutt $default $filenames mutt muttng +} + +_configure_func() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + # if $COMP_CONFIGURE_HINTS is not null, then completions of the form + # --option=SETTING will include 'SETTING' as a contextual hint + [[ "$cur" != -* ]] && return 0 + + if [ -n "$COMP_CONFIGURE_HINTS" ]; then + COMPREPLY=( $( $1 --help | awk '/^ --[A-Za-z]/ { print $1; if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,].*//g' | grep ^$cur ) ) + + else + COMPREPLY=( $( $1 --help | awk '/^ --[A-Za-z]/ { print $1; if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,=].*//g' | grep ^$cur ) ) + fi +} +complete -F _configure_func $default configure + +# Debian reportbug(1) completion +# +have reportbug && +_reportbug() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -f|--filename|-i|--include|--mta|-o|--output) + _filedir + return 0 + ;; + -B|--bts) + COMPREPLY=( $( compgen -W "debian guug kde mandrake help" -- \ + $cur )) + return 0 + ;; + -e|--editor|--mua) + COMP_WORDS=(COMP_WORDS[0] $cur) + COMP_CWORD=1 + _command + return 0 + ;; + --mode) + COMPREPLY=( $( compgen -W "novice standard expert" -- $cur ) ) + return 0 + ;; + -S|--severity) + COMPREPLY=( $( compgen -W "grave serious important normal \ + minor wishlist" -- $cur ) ) + return 0 + ;; + -u|--ui|--interface) + COMPREPLY=( $( compgen -W "newt text gnome" -- $cur ) ) + return 0 + ;; + -t|--type) + COMPREPLY=( $( compgen -W "gnats debbugs" -- $cur ) ) + return 0 + ;; + -T|--tags) + COMPREPLY=( $( compgen -W "none patch security upstream sid \ + woody potato sarge fixed" -- $cur )) + return 0 + ;; + *) + ;; + esac + + COMPREPLY=($( compgen -W '-h --help -v --version -a --af -b \ + --no-query-bts --query-bts -B --bts -c --configure \ + --no-config-files --check-available -d --debug \ + --no-check-available -e --editor --email -f \ + --filename -g --gnupg -H --header -i --include -j \ + --justification -l --ldap --no-ldap -L --list-cc -m \ + --maintonly --mode --mua --mta --mutt -n --mh --nmh \ + -o --output -p --print -P --pgp --proxy --http_proxy\ + -q --quiet -Q --query-only --realname --report-quiet \ + --reply-to --replyto -s --subject -S --severity \ + --smtphost -t --type -T --tags --template -V -x \ + --no-cc --package-version -z --no-compress \ + --ui --interface -u \ + wnpp boot-floppies kernel-image' -- $cur ) \ + $( apt-cache pkgnames -- $cur 2> /dev/null ) ) + _filedir + return 0 +} && +complete -F _reportbug $filenames reportbug + +# Debian querybts(1) completion +# +have querybts && +_querybts() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -B|--bts) + COMPREPLY=( $( compgen -W "debian guug kde mandrake help" -- \ + $cur )) + return 0 + ;; + -u|--ui|--interface) + COMPREPLY=($( compgen -W "newt text gnome" -- $cur )) + return 0 + ;; + *) + ;; + esac + + COMPREPLY=($( compgen -W '-h --help -v --version -A --archive \ + -B --bts -l --ldap --no-ldap --proxy= --http_proxy= \ + -s --source -w --web -u --ui --interface \ + wnpp boot-floppies' -- $cur ) \ + $( apt-cache pkgnames -- $cur 2> /dev/null ) ) +} && +complete -F _querybts $filenames querybts + +# update-alternatives completion +# +have update-alternatives && { +installed_alternatives() +{ + local admindir + # find the admin dir + for i in alternatives dpkg/alternatives rpm/alternatives; do + [ -d /var/lib/$i ] && admindir=/var/lib/$i && break + done + for (( i=1; i < COMP_CWORD; i++ )); do + if [[ "${COMP_WORDS[i]}" == --admindir ]]; then + admindir=${COMP_WORDS[i+1]} + break + fi + done + COMPREPLY=( $( command ls $admindir | grep "^$cur" ) ) +} + +_update_alternatives() +{ + local cur prev mode args i + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + --@(altdir|admindir)) + _filedir -d + return 0 + ;; + --@(help|version)) + return 0 + ;; + esac + + # find wich mode to use and how many real args used so far + for (( i=1; i < COMP_CWORD; i++ )); do + if [[ "${COMP_WORDS[i]}" == --@(install|remove|auto|display|config|remove-all) ]]; then + mode=${COMP_WORDS[i]} + args=$(($COMP_CWORD - i)) + break + fi + done + + case $mode in + --install) + case $args in + 1) + _filedir + ;; + 2) + installed_alternatives + ;; + 3) + _filedir + ;; + esac + ;; + --remove) + case $args in + 1) + installed_alternatives + ;; + 2) + _filedir + ;; + esac + ;; + --auto) + installed_alternatives + ;; + --remove-all) + installed_alternatives + ;; + --display) + installed_alternatives + ;; + --config) + installed_alternatives + ;; + *) + COMPREPLY=( $( compgen -W '--verbose --quiet --help --version \ + --altdir --admindir' -- $cur ) \ + $( compgen -W '--install --remove --auto --display \ + --config' -- $cur ) ) + esac +} +complete -F _update_alternatives update-alternatives +} + +# Python completion +# +have python && +_python() +{ + local prev cur + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]##*/} + + case "$prev" in + -Q) + COMPREPLY=( $( compgen -W "old new warn warnall" -- $cur ) ) + return 0 + ;; + -W) + COMPREPLY=( $( compgen -W "ignore default all module once error" -- $cur ) ) + return 0 + ;; + -c) + _filedir '@(py|pyc|pyo)' + return 0 + ;; + !(python|-?)) + [[ ${COMP_WORDS[COMP_CWORD-2]} != -@(Q|W) ]] && _filedir + ;; + esac + + + # if '-c' is already given, complete all kind of files. + for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do + if [[ ${COMP_WORDS[i]} == -c ]]; then + _filedir + fi + done + + + if [[ "$cur" != -* ]]; then + _filedir '@(py|pyc|pyo)' + else + COMPREPLY=( $( compgen -W "- -d -E -h -i -O -Q -S -t -u \ + -U -v -V -W -x -c" -- $cur ) ) + fi + + + + return 0 +} && +complete -F _python $filenames python + +# Perl completion +# +have perl && +{ +_perlmodules() +{ + COMPREPLY=( $( compgen -P "$prefix" -W "$( perl -e 'sub mods { my ($base,$dir)=@_; return if $base !~ /^\Q$ENV{cur}/; chdir($dir) or return; for (glob(q[*.pm])) {s/\.pm$//; print qq[$base$_\n]}; mods(/^(?:[.\d]+|$Config{archname}-$Config{osname}|auto)$/ ? undef : qq[${base}${_}\\\\:\\\\:],qq[$dir/$_]) for grep {-d} glob(q[*]); } mods(undef,$_) for @INC;' )" -- $cur ) ) +} + +_perl() +{ + local cur prev prefix temp + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + prefix="" + + # completing an option (may or may not be separated by a space) + if [[ "$cur" == -?* ]]; then + temp=$cur + prev=${temp:0:2} + cur=${temp:2} + prefix=$prev + fi + + # only handle module completion for now + case "$prev" in + -I|-x) + COMPREPLY=( $( compgen -d -P "$prev" -- "$cur" ) ) + return 0 + ;; + -m|-M) + _perlmodules + return 0 + ;; + esac + + # handle case where first parameter is not a dash option + if [[ "${COMP_WORDS[COMP_CWORD]}" != -* ]]; then + _filedir + return 0 + fi + + # complete using basic options + COMPREPLY=( $( compgen -W '-C -s -T -u -U -W -X -h -v -V -c -w -d -D -p \ + -n -a -F -l -0 -I -m -M -P -S -x -i -e ' -- $cur ) ) + return 0 +} +complete -F _perl $filenames perl + +_perldoc() +{ + local cur prev prefix temp + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + prefix="" + + # completing an option (may or may not be separated by a space) + if [[ "$cur" == -?* ]]; then + temp=$cur + prev=${temp:0:2} + cur=${temp:2} + prefix=$prev + fi + + # complete builtin perl functions + case $prev in + -f) + COMPREPLY=( $( compgen -W 'chomp chop chr crypt hex index lc \ + lcfirst length oct ord pack q qq reverse rindex sprintf \ + substr tr uc ucfirst y m pos quotemeta s split study qr abs \ + atan2 cos exp hex int log oct rand sin sqrt srand pop push \ + shift splice unshift grep join map qw reverse sort unpack \ + delete each exists keys values binmode close closedir \ + dbmclose dbmopen die eof fileno flock format getc print \ + printf read readdir rewinddir seek seekdir select syscall \ + sysread sysseek syswrite tell telldir truncate warn write \ + pack read syscall sysread syswrite unpack vec -X chdir chmod \ + chown chroot fcntl glob ioctl link lstat mkdir open opendir \ + readlink rename rmdir stat symlink umask unlink utime caller \ + continue do dump eval exit goto last next redo return \ + sub wantarray caller import local my our package use defined \ + formline reset scalar undef \ + alarm exec fork getpgrp getppid getpriority kill pipe qx \ + setpgrp setpriority sleep system times wait waitpid \ + import no package require use bless dbmclose dbmopen package \ + ref tie tied untie use accept bind connect getpeername \ + getsockname getsockopt listen recv send setsockopt shutdown \ + socket socketpair msgctl msgget msgrcv msgsnd semctl semget \ + semop shmctl shmget shmread shmwrite endgrent endhostent \ + endnetent endpwent getgrent getgrgid getgrnam getlogin \ + getpwent getpwnam getpwuid setgrent setpwent endprotoent \ + endservent gethostbyaddr gethostbyname gethostent \ + getnetbyaddr getnetbyname getnetent getprotobyname \ + getprotobynumber getprotoent getservbyname getservbyport \ + getservent sethostent setnetent setprotoent setservent \ + gmtime localtime time times' -- $cur ) ) + return 0 + ;; + esac + + case $cur in + -*) + COMPREPLY=( $( compgen -W '-h -v -t -u -m -l -F -X -f -q' -- $cur )) + return 0 + ;; + */*) + return 0 + ;; + *) + _perlmodules + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W '$( PAGER=cat man perl 2>/dev/null | sed -ne "/perl.*Perl overview/,/perlwin32/s/^[^a-z0-9]*\([a-z0-9]*\).*$/\1/p")' -- $cur ) ) + + return 0 + ;; + esac +} +complete -F _perldoc $default perldoc +} + +# rcs(1) completion +# +have rcs && +_rcs() +{ + local cur prev file dir i + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + file=${cur##*/} + dir=${cur%/*} + + # deal with relative directory + [ "$file" = "$dir" ] && dir=. + + COMPREPLY=( $( compgen -f "$dir/RCS/$file" ) ) + + for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do + file=${COMPREPLY[$i]##*/} + dir=${COMPREPLY[$i]%RCS/*} + COMPREPLY[$i]=$dir$file + done + + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -G "$dir/$file*,v" ) ) + + for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do + COMPREPLY[$i]=${COMPREPLY[$i]%,v} + done + + # default to files if nothing returned and we're checking in. + # otherwise, default to directories + [ ${#COMPREPLY[@]} -eq 0 -a $1 = ci ] && _filedir || _filedir -d +} && +complete -F _rcs $filenames ci co rlog rcs rcsdiff + +# lilo(8) completion +# +have lilo && { +_lilo_labels() +{ + COMPREPLY=( $( awk -F'=' '/label/ {print $2}' \ + /etc/lilo.conf | sed -e 's/"//g' | grep "^$cur" ) ) +} + +_lilo() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case $prev in + -@(C|i|m|s|S)) + _filedir + return 0 + ;; + -r) + _filedir -d + return 0 + ;; + -@(I|D|R)) + # label completion + _lilo_labels + return 0 + ;; + -@(A|b|M|u|U)) + # device completion + cur=${cur:=/dev/} + _filedir + return 0 + ;; + -T) + # topic completion + COMPREPLY=( $( compgen -W 'help ChRul EBDA geom geom= \ + table= video' -- $cur ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + # relevant options completion + COMPREPLY=( $( compgen -W '-A -b -c -C -d -f -g -i -I -l -L -m \ + -M -p -P -q -r -R -s -S -t -T -u -U -v -V -w -x -z' -- \ + $cur ) ) + fi +} +complete -F _lilo lilo +} + +# links completion +# +have links && +_links() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + case "$cur" in + --*) + COMPREPLY=( $( compgen -W '--help' -- $cur ) ) + ;; + -*) + COMPREPLY=( $( compgen -W '-async-dns -max-connections \ + -max-connections-to-host -retries \ + -receive-timeout -unrestartable-receive-timeout\ + -format-cache-size -memory-cache-size \ + -http-proxy -ftp-proxy -download-dir \ + -assume-codepage -anonymous -dump -no-connect \ + -source -version -help' -- $cur ) ) + ;; + *) + if [ -r ~/.links/links.his ]; then + COMPREPLY=( $( compgen -W '$( < ~/.links/links.his )' \ + -- $cur ) ) + fi + _filedir '@(htm|html)' + return 0 + ;; + esac + + return 0 +} && +complete -F _links $filenames links + +[ $UNAME = FreeBSD ] && { +# FreeBSD package management tool completion +# +_pkg_delete() +{ + local cur pkgdir prev + + pkgdir=${PKG_DBDIR:-/var/db/pkg}/ + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + [ "$prev" = "-o" -o "$prev" = "-p" -o "$prev" = "-W" ] && return 0 + + COMPREPLY=( $( compgen -d $pkgdir$cur ) ) + COMPREPLY=( ${COMPREPLY[@]#$pkgdir} ) + + return 0 +} +complete -F _pkg_delete $dirnames pkg_delete pkg_info +have pkg_deinstall && complete -F _pkg_delete $dirnames pkg_deinstall + +# FreeBSD kernel module commands +# +_kldload() +{ + local cur moddir + + moddir=/modules/ + [ -d $moddir ] || moddir=/boot/kernel/ + cur=`_get_cword` + + COMPREPLY=( $( compgen -f $moddir$cur ) ) + COMPREPLY=( ${COMPREPLY[@]#$moddir} ) + COMPREPLY=( ${COMPREPLY[@]%.ko} ) + + return 0 +} +complete -F _kldload $filenames kldload + +_kldunload() +{ + local cur + cur=`_get_cword` + COMPREPLY=( $(kldstat | sed -ne "s/^.*[ \t]\+\($cur[a-z_]\+\).ko$/\1/p") ) +} +complete -F _kldunload $filenames kldunload +} + +# FreeBSD portupgrade completion +# +have portupgrade && +_portupgrade() +{ + local cur pkgdir prev + + pkgdir=${PKG_DBDIR:-/var/db/pkg}/ + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + [ "$prev" = "-l" -o "$prev" = "-L" -o "$prev" = "-o" ] && return 0 + + COMPREPLY=( $( compgen -d $pkgdir$cur ) ) + COMPREPLY=( ${COMPREPLY[@]#$pkgdir} ) + COMPREPLY=( ${COMPREPLY[@]%-*} ) + + return 0 +} && +complete -F _portupgrade $dirnames portupgrade + +# FreeBSD portinstall completion +# +have portinstall && +_portinstall() +{ + local cur portsdir prev indexfile + local -a COMPREPLY2 + + portsdir=${PORTSDIR:-/usr/ports}/ + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + # First try INDEX-5 + indexfile=$portsdir/INDEX-5 + # Then INDEX if INDEX-5 does not exist or system is not FreeBSD 5.x + [ "${OSTYPE%.*}" = "freebsd5" -a -f $indexfile ] || + indexfile=$portsdir/INDEX + + [ "$prev" = "-l" -o "$prev" = "-L" -o "$prev" = "-o" ] && return 0 + + COMPREPLY=( $( egrep "^$cur" < $indexfile | cut -d'|' -f1 ) ) + COMPREPLY2=( $( egrep "^[^\|]+\|$portsdir$cur" < $indexfile | \ + cut -d'|' -f2 ) ) + COMPREPLY2=( ${COMPREPLY2[@]#$portsdir} ) + COMPREPLY=( "${COMPREPLY[@]}" "${COMPREPLY2[@]}" ) + + return 0 +} && +complete -F _portinstall $dirnames portinstall + +# Slackware Linux removepkg completion +# +have removepkg && [ -f /etc/slackware-version ] && +_removepkg() +{ + local packages cur + + COMPREPLY=() + cur=`_get_cword` + + COMPREPLY=( $( (cd /var/log/packages; compgen -f -- "$cur") ) ) +} && +complete -F _removepkg $filenames removepkg && + complete $dirnames -f -X '!*.tgz' installpkg upgradepkg explodepkg + +# look(1) completion +# +have look && +_look() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + if [ $COMP_CWORD = 1 ]; then + COMPREPLY=( $( compgen -W '$(look $cur)' ) ) + fi +} && +complete -F _look $default look + +# ypcat(1) and ypmatch(1) completion +# +have ypmatch && +_ypmatch() +{ + local cur map + + COMPREPLY=() + cur=`_get_cword` + + [ $1 = ypcat ] && [ $COMP_CWORD -gt 1 ] && return 0 + [ $1 = ypmatch ] && [ $COMP_CWORD -gt 2 ] && return 0 + + if [ $1 = ypmatch ] && [ $COMP_CWORD -eq 1 ] && \ + [ ${#COMP_WORDS[@]} -eq 3 ]; then + map=${COMP_WORDS[2]} + COMPREPLY=( $( compgen -W '$( ypcat $map | \ + cut -d':' -f 1 )' -- $cur) ) + else + [ $1 = ypmatch ] && [ $COMP_CWORD -ne 2 ] && return 0 + COMPREPLY=( $( compgen -W \ + '$( echo $(ypcat -x | cut -d"\"" -f 2))' -- $cur)) + fi + + return 0 +} && +complete -F _ypmatch ypmatch ypcat + +# mplayer(1) completion +# +have mplayer && { +_mplayer_options_list() +{ + cur=${cur%\\} + COMPREPLY=( $( $1 $2 help 2> /dev/null | \ + sed -e '1,/^Available/d' | awk '{print $1}' | \ + sed -e 's/:$//' -e 's/^'${2#-}'$//' -e 's/<.*//' | \ + grep "^$cur" ) ) +} + +_mplayer() +{ + local cmd cur prev skinsdir IFS=$' \t\n' i j k=0 + + COMPREPLY=() + cmd=${COMP_WORDS[0]} + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(ac|afm|vc|vfm|ao|vo|vop|fstype)) + _mplayer_options_list mplayer $prev + return 0 + ;; + -@(oac|ovc|of)) + _mplayer_options_list mencoder $prev + return 0 + ;; + -audiofile) + _filedir '@(mp3|MP3|mpg|MPG|ogg|OGG|wav|WAV|mid|MID|flac|FLAC|mka|MKA)' + return 0 + ;; + -font) + _filedir '@(desc|ttf)' + return 0 + ;; + -sub) + _filedir '@(srt|SRT|sub|SUB|txt|TXT|utf|UTF|rar|RAR|mpsub|smi|js|ssa|SSA|aas|AAS)' + return 0 + ;; + -vobsub) + _filedir '@(idx|IDX|ifo|IFO|sub|SUB)' + IFS=$'\t\n' + COMPREPLY=( $( for i in "${COMPREPLY[@]}"; do + if [ -f $i -a -r $i ]; then + echo ${i%.*} + else + echo $i + fi + done ) ) + IFS=$' \t\n' + return 0 + ;; + -ifo) + _filedir '@(ifo|IFO)' + return 0 + ;; + -cuefile) + _filedir '@(bin|BIN|cue|CUE)' + return 0 + ;; + -skin) + # if you don't have installed mplayer in /usr/local you + # may want to set the MPLAYER_SKINS_DIR global variable + if [ -n "$MPLAYER_SKINS_DIR" ]; then + skinsdir=$MPLAYER_SKINS_DIR + else + skinsdir=/usr/local/share/mplayer/Skin + fi + + IFS=$'\t\n' + for i in ~/.mplayer/Skin $skinsdir; do + if [ -d $i -a -r $i ]; then + for j in $( compgen -d $i/$cur ); do + COMPREPLY[$k]=${j#$i/} + k=$((++k)) + done + fi + done + IFS=$' \t\n' + return 0 + ;; + -@(mixer|@(cdrom|dvd)-device|dvdauth|fb|zrdev)) + cur=${cur:=/dev/} + _filedir + return 0 + ;; + -@(edl?(out)|lircconf|menu-cfg|playlist|csslib|dumpfile)| \ + -@(subfile|vobsub|aofile|fbmodeconfig|include|o|dvdkey)| \ + -passlogfile) + _filedir + return 0 + ;; + -@(auto@(q|sync)|loop|menu-root|speed|sstep|aid|alang)| \ + -@(?(@(audio|sub)-)demuxer|bandwidth|cache|chapter)| \ + -@(dvd?(angle)|fps|frames|mc|passwd|user|sb|srate|ss|vcd)| \ + -@(vi?(d|vo)|ffactor|sid|slang|spu@(align|aa|gauss))| \ + -@(vobsubid|delay|bpp|brightness|contrast|dfbopts|display)| \ + -@(fbmode|geometry|guiwid|hue|icelayer|screen[wh]|wid)| \ + -@(monitor@(aspect|-@(dotclock|[hv]freq))|panscan|saturation)| \ + -@(xineramascreen|zr@(crop|norm|quality|[xy]doff|[vh]dec))| \ + -@(aspect|pp|x|y|xy|z|stereo|audio-@(density|delay|preload))| \ + -@(endpos|osdlevel|ffourcc|sws|channels|skiplimit|format)| \ + -@(ofps|aa@(driver|@(osd|sub)color)|vobsubout?(i@(ndex|d)))| \ + -sub@(-bg-@(alpha|color)|cp|delay|fps|pos|align|width)| \ + -sub@(font-@(blur|outline|autoscale|encoding|@(osd|text)-scale))) + return 0 + ;; + -lavdopts) + COMPREPLY=( $( compgen -W 'ec er= bug= idct= gray' \ + -- $cur ) ) + return 0 + ;; + -lavcopts) + COMPREPLY=( $( compgen -W 'vcodec= vqmin= vqscale= \ + vqmax= mbqmin= mbqmax= vqdiff= \ + vmax_b_frames= vme= vhq v4mv \ + keyint= vb_strategy= vpass= \ + aspect= vbitrate= vratetol= \ + vrc_maxrate= vrc_minrate= \ + vrc_buf_size= vb_qfactor= vi_qfactor= \ + vb_qoffset= vi_qoffset= vqblur= \ + vqcomp= vrc_eq= vrc_override= \ + vrc_init_cplx= vqsquish= vlelim= \ + vcelim= vstrict= vdpart vpsize= gray \ + vfdct= idct= lumi_mask= dark_mask= \ + tcplx_mask= scplx_mask= naq ildct \ + format= pred qpel precmp= cmp= \ + subcmp= predia= dia= trell last_pred= \ + preme= subq= psnr mpeg_quant aic umv' \ + -- $cur ) ) + return 0 + ;; + -ssf) + COMPREPLY=( $( compgen -W 'lgb= cgb= ls= cs= chs= \ + cvs=' -- $cur ) ) + return 0 + ;; + -jpeg) + COMPREPLY=( $( compgen -W 'noprogressive progressive \ + nobaseline baseline optimize= \ + smooth= quality= outdir=' -- $cur ) ) + return 0 + ;; + -xvidopts) + COMPREPLY=( $( compgen -W 'dr2 nodr2' -- $cur ) ) + return 0 + ;; + -xvidencopts) + COMPREPLY=( $( compgen -W 'pass= bitrate= \ + fixed_quant= me_quality= 4mv \ + rc_reaction_delay_factor= \ + rc_averaging_period= rc_buffer= \ + quant_range= min_key_interval= \ + max_key_interval= mpeg_quant \ + mod_quant lumi_mask hintedme \ + hintfile debug keyframe_boost= \ + kfthreshold= kfreduction=' -- $cur ) ) + return 0 + ;; + -divx4opts) + COMPREPLY=( $( compgen -W 'br= key= deinterlace q= \ + min_quant= max_quant= rc_period= \ + rc_reaction_period= crispness= \ + rc_reaction_ratio= pass= vbrpass= \ + help' -- $cur ) ) + return 0 + ;; + -info) + COMPREPLY=( $( compgen -W 'name= artist= genre= \ + subject= copyright= srcform= \ + comment= help' -- $cur ) ) + return 0 + ;; + -lameopts) + COMPREPLY=( $( compgen -W 'vbr= abr cbr br= q= aq= \ + ratio= vol= mode= padding= fast \ + preset= help' -- $cur ) ) + return 0 + ;; + -rawaudio) + COMPREPLY=( $( compgen -W 'on channels= rate= \ + samplesize= format=' -- $cur ) ) + return 0 + ;; + -rawvideo) + COMPREPLY=( $( compgen -W 'on fps= sqcif qcif cif \ + 4cif pal ntsc w= h= y420 yv12 yuy2 \ + y8 format= size=' -- $cur ) ) + return 0 + ;; + -aop) + COMPREPLY=( $( compgen -W 'list= delay= format= fout= \ + volume= mul= softclip' -- $cur ) ) + return 0 + ;; + -dxr2) + COMPREPLY=( $( compgen -W 'ar-mode= iec958-encoded \ + iec958-decoded mute ucode= 75ire bw \ + color interlaced macrovision= norm= \ + square-pixel ccir601-pixel cr-left= \ + cr-right= cr-top= cr-bot= ck-rmin= \ + ck-gmin= ck-bmin= ck-rmax= ck-gmax= \ + ck-bmax= ck-r= ck-g= ck-b= \ + ignore-cache= ol-osd= olh-cor= \ + olw-cor= olx-cor= oly-cor= overlay \ + overlay-ratio= update-cache' -- $cur )) + return 0 + ;; + -tv) + COMPREPLY=( $( compgen -W 'on noaudio driver= device= \ + input= freq= outfmt= width= height= \ + buffersize= norm= channel= chanlist= \ + audiorate= forceaudio alsa amode= \ + forcechan= adevice= audioid= volume= \ + bass= treble= balance= fps= \ + channels= immediatemode=' -- $cur ) ) + return 0 + ;; + -mf) + COMPREPLY=( $( compgen -W 'on w= h= fps= type=' \ + -- $cur ) ) + return 0 + ;; + -cdda) + COMPREPLY=( $( compgen -W 'speed= paranoia= \ + generic-dev= sector-size= overlap= \ + toc-bias toc-offset= skip noskip' \ + -- $cur ) ) + return 0 + ;; + -input) + COMPREPLY=( $( compgen -W 'conf= ar-delay ar-rate \ + keylist cmdlist js-dev file' -- $cur ) ) + return 0 + ;; + -af) + COMPREPLY=( $( compgen -W 'resample resample= \ + channels channels= format format= \ + volume volume= delay delay= pan \ + pan= sub sub= surround surround=' \ + -- $cur ) ) + return 0 + ;; + -af-adv) + COMPREPLY=( $( compgen -W 'force= list=' -- $cur ) ) + return 0 + ;; + esac + + case "$cur" in + -*) + COMPREPLY=( $( compgen -W '-aid -alang -audio-demuxer \ + -audiofile -cdrom-device -cache -cdda \ + -channels -chapter -csslib -demuxer \ + -dvd -dvd-device -dvdangle -dvdauth \ + -dvdkey -dvdnav -forceidx -fps -frames \ + -hr-mp3-seek -idx -mc -mf -ni -nobps \ + -passwd -rawaudio -rtsp-stream-over-tcp\ + -skipopening -sb -srate -ss -tv -user \ + -vcd -vid -vivo -ifo -ffactor -font \ + -noautosub -nooverlapsub -sid -slang \ + -sub -subcc -subcp -sub-demuxer \ + -subdelay -subfont-autoscale \ + -subfont-blur -subfont-encoding \ + -subfont-osd-scale -subfont-outline \ + -subfont-text-scale -subfps -subfile \ + -subpos -unicode -utf8 -vobsub \ + -vobsubid -ac -afm -aspect -flip \ + -lavdopts -noaspect -nosound -pp -ssf \ + -stereo -sws -vc -vfm -vop -xvidopts\ + -xy -zoom -bandwidth -cuefile \ + -noextbased -rawvideo -overlapsub \ + -sub-bg-alpha -sub-bg-color -subalign \ + -subwidth -sub-no-text-pp -spualign \ + -spuaa -spugauss -pphelp -verbose -v \ + -noni -noidx -nohr-mp3-seek -extbased \ + -bps -oldpp -nozoom -noflip -nounicode \ + -noutf8' -- $cur ) ) + # add mplayer specific options + [[ "$cmd" == @(?(g)mplayer) ]] && COMPREPLY=( "${COMPREPLY[@]}" \ + $(compgen -W '-autoq -autosync -benchmark \ + -framedrop -h -help -hardframedrop \ + -identify -input -lircconf -loop \ + -nojoystick -nolirc -nortc -playlist \ + -quiet -really-quiet -rnd -sdp -skin \ + -slave -softsleep -speed -sstep \ + -use-stdin -dumpaudio -dumpfile \ + -dumpstream -dumpvideo -dumpmicrodvdsub\ + -dumpmpsub -dumpsrtsub -dumpjacosub \ + -dumpsami -dumpsub -osdlevel -af \ + -af-adv -ao -aofile -aop -delay -mixer \ + -nowaveheader -bpp -brightness \ + -contrast -display -double -dr -dxr2 \ + -fb -fbmode -fbmodeconfig -forcexv -fs \ + -geometry -hue -icelayer -jpeg \ + -monitor-dotclock -monitor-hfreq \ + -monitor-vfreq -monitoraspect \ + -nograbpointer -noslices -panscan \ + -rootwin -saturation -screenw -screenh \ + -stop-xscreensaver -vm -vo -vsync -wid \ + -xineramascreen -z -zrbw -zrcrop \ + -zrdev -zrfd -zrhelp -zrnorm -zrquality \ + -zrvdec -zrhdec -zrxdoff -zrydoff -y \ + -edl -edlout -enqueue -fixed-vo \ + -menu -menu-root -menu-cfg -shuffle \ + -format -aahelp -dfbopts -fstype \ + -guiwid -nokeepaspect -x --help \ + -aaosdcolor -aasubcolor -aadriver \ + -aaextended -aaeight' -- $cur) ) + # add mencoder specific options + [[ "$cmd" = mencoder ]] && COMPREPLY=( "${COMPREPLY[@]}" \ + $(compgen -W '-audio-density -audio-delay \ + -audio-preload -divx4opts -endpos \ + -ffourcc -include -info -lameopts \ + -lavcopts -noskip -o -oac -ofps -ovc \ + -passlogfile -skiplimit -vobsubout \ + -vobsuboutindex -vobsuboutid \ + -xvidencopts -of --verbose' -- $cur) ) + ;; + *) + _filedir '@(mp?(e)g|MP?(E)G|wm[av]|WM[AV]|avi|AVI|asf|ASF|vob|VOB|bin|BIN|dat|DAT|vcd|VCD|ps|PS|pes|PES|fli|FLI|flv|FLV|viv|VIV|rm?(j)|RM?(J)|ra?(m)|RA?(M)|yuv|YUV|mov|MOV|qt|QT|mp[34]|MP[34]|m4v|M4V|og[gm]|OG[GM]|wav|WAV|dump|DUMP|mk[av]|MK[AV]|m4a|M4A|aac|AAC|m2v|M2V|dv|DV|rmvb|RMVB|mid|MID|ts|TS|3gp|mpc|MPC|flac|FLAC|flv|FLV|divx|DIVX)' + ;; + esac + + return 0 +} +complete $filenames -F _mplayer mplayer mencoder gmplayer kplayer +} + +# KDE dcop completion +# +have dcop && +_dcop() +{ + local cur compstr + + COMPREPLY=() + cur=`_get_cword` + if [ -z $cur ]; then + compstr=${COMP_WORDS[*]} + else + compstr=$( command echo ${COMP_WORDS[*]} | sed "s/ $cur$//" ) + fi + COMPREPLY=( $( compgen -W '$( command $compstr | sed s/\(.*\)// )' -- $cur ) ) +} && +complete -F _dcop dcop + +# wvdial(1) completion +# +have wvdial && +_wvdial() +{ + local cur prev config i IFS=$'\t\n' + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case $prev in + --config) + _filedir + return 0 + ;; + esac + + case $cur in + -*) + COMPREPLY=( $( compgen -W '--config --chat \ + --remotename --help --version --no-syslog' \ + -- $cur ) ) + ;; + *) + # start with global and personal config files + config="/etc/wvdial.conf"$'\t'"$HOME/.wvdialrc" + # replace with command line config file if present + for (( i=1; i < COMP_CWORD; i++ )); do + if [[ "${COMP_WORDS[i]}" == "--config" ]]; then + config=${COMP_WORDS[i+1]} + break + fi + done + # parse config files for sections and + # remove default section + COMPREPLY=( $( sed -ne \ + "s|^\[Dialer \($cur.*\)\]$|\1|p" \ + $config 2>/dev/null |grep -v '^Defaults$')) + # escape spaces + COMPREPLY=${COMPREPLY// /\\ } + ;; + esac + +} && +complete -F _wvdial wvdial + +# gpg(1) completion +# +have gpg && +_gpg() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(s|-sign|-clearsign|-decrypt-files|-load-extension)) + _filedir + return 0 + ;; + --@(export|@(?(l|nr|nrl)sign|edit)-key)) + # return list of public keys + COMPREPLY=( $( compgen -W "$( gpg --list-keys 2>/dev/null | sed -ne 's@^pub.*/\([^ ]*\).*\(<\([^>]*\)>\).*$@\1 \3@p')" -- "$cur" )) + return 0 + ;; + -@(r|-recipient)) + COMPREPLY=( $( compgen -W "$( gpg --list-keys 2>/dev/null | sed -ne 's@^pub.*<\([^>]*\)>.*$@\1@p')" -- "$cur" )) + if [ -e ~/.gnupg/gpg.conf ]; then + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W "$( sed -ne 's@^[ \t]*group[ \t][ \t]*\([^=]*\).*$@\1@p' ~/.gnupg/gpg.conf )" -- "$cur") ) + fi + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-s -b -e -f -c -d -a -r -u -Z -o -v\ + -q -n -N $(gpg --dump-options)' -- $cur ) ) + fi + +} && +complete -F _gpg $default gpg + +# iconv(1) completion +# +have iconv && +_iconv() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(f|t|-@(from|to)-code)) + COMPREPLY=( $( compgen -W \ + '$( iconv --list | sed -e "s@//@@;" )' -- "$cur" ) ) + return 0 + ;; + esac + + + if [[ "$cur" = -* ]]; then + COMPREPLY=( $( compgen -W '--from-code -f --to-code -t --list + --output -o --verbose' -- "$cur" ) ) + return 0 + fi +} && +complete -F _iconv $default iconv + +# dict(1) completion +# +{ have dict || have rdict; } && { +_dictdata() +{ + dict $host $port $1 2>/dev/null | sed -ne \ + 's/^['$'\t '']['$'\t '']*\([^'$'\t '']*\).*$/\1/p' +} + +_dict() +{ + local cur prev host port db dictfile + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + dictfile=/usr/share/dict/words + + for (( i=1; i < COMP_CWORD; i++ )); do + case "${COMP_WORDS[i]}" in + -@(h|--host)) + host=${COMP_WORDS[i+1]} + [ -n "$host" ] && host="-h $host" + i=$((++i)) + ;; + -@(p|-port)) + port=${COMP_WORDS[i+1]} + [ -n "$port" ] && port="-p $port" + i=$((++i)) + ;; + -@(d|-database)) + db=${COMP_WORDS[i+1]} + [ -n "$db" ] && host="-d $db" + i=$((++i)) + ;; + *) + ;; + esac + done + + if [[ "$cur" = -* ]]; then + COMPREPLY=( $( compgen -W '-h --host -p --port -d --database \ + -m --match -s --strategy -c --config -C \ + --nocorrect -D --dbs -S --strats -H \ + --serverhelp -i --info -I --serverinfo \ + -a --noauth -u --user -k --key -V --version \ + -L --license --help -v --verbose -r --raw \ + -P --pager --debug --html --pipesize --client' \ + -- "$cur" ) ) + return 0 + fi + + case "$prev" in + -@(d|-database|i|info)) + COMPREPLY=( $( compgen -W '$( _dictdata -D )' -- "$cur" ) ) + return 0 + ;; + -@(s|-strategy)) + COMPREPLY=( $( compgen -W '$( _dictdata -S )' -- "$cur" ) ) + return 0 + ;; + *) + ;; + esac + + [ -r $dictfile ] && \ + COMPREPLY=( $( compgen -W '$( cat $dictfile )' -- "$cur" ) ) +} +complete -F _dict $default dict rdict +} + +# cdrecord(1) completion +# +have cdrecord && +_cdrecord() +{ + local cur prev i generic_options track_options track_mode + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + # foo=bar style option + if [[ "$cur" == *=* ]]; then + prev=${cur/=*/} + cur=${cur/*=/} + case "$prev" in + @(text|cue)file) + _filedir + return 0 + ;; + blank) + COMPREPLY=( $( compgen -W 'help all fast \ + track unreserve trtail unclose session' \ + -- $cur ) ) + return 0 + ;; + driveropts) + COMPREPLY=( $( compgen -W 'burnfree noburnfree\ + varirec= audiomaster forcespeed noforcespeed\ + speedread nospeedread singlesession \ + nosinglesession hidecdr nohidecdr tattooinfo\ + tattoofile=' -- $cur ) ) + return 0 + ;; + esac + fi + + generic_options=(-version -v -V -d -silent -s -force -immed -dummy \ + -dao -raw -raw96r -raw96p -raw16 -multi -msinfo -toc \ + -atip -fix -nofix -waiti -load -lock -eject -format \ + -setdropts -checkdrive -prcap -inq -scanbus -reset \ + -abort -overburn -ignsize -useinfo -packet -noclose \ + -text debug= kdebug= kd= minbuf= speed= blank= fs= \ + dev= gracetime= timeout= driver= driveropts= \ + defpregap= pktsize= mcn= textfile= cuefile=) + track_options=(-audio -swab -data -mode2 -xa -xa1 -xa2 -xamix -cdi \ + -isosize -pad padsize= -nopad -shorttrack -noshorttrack\ + pregap= -preemp -nopreemp -copy -nocopy -scms tcsize= \ + isrc= index=) + # look if previous was either a file or a track option + track_mode=0 + if [ $COMP_CWORD -gt 1 ]; then + if [ -f "$prev" ]; then + track_mode=1 + else + for (( i=0; i < ${#track_options[@]}; i++ )); do + if [[ "${track_options[i]}" == "$prev" ]]; then + track_mode=1 + break + fi + done + fi + fi + + # files are always eligible completion + _filedir + # track options are always available + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W '${track_options[@]}' -- $cur ) ) + # general options are no more available after file or track option + if [ $track_mode -eq 0 ]; then + COMPREPLY=( "${COMPREPLY[@]}" \ + $( compgen -W '${generic_options[@]}' -- $cur ) ) + fi + +} && +complete -F _cdrecord $filenames cdrecord + +# mkisofs(8) completion +# +have mkisofs && +_mkisofs() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(o|abstract|biblio|check-session|copyright|log-file|root-info|prep-boot|*-list)) + _filedir + return 0 + ;; + -*-charset) + COMPREPLY=( $( mkisofs -input-charset help 2>&1 | \ + tail +3 | grep "^$cur") ) + return 0 + ;; + -uid) + _uids + return 0 + ;; + -gid) + _gids + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-abstract -A -allow-lowercase \ + -allow-multidot -biblio -cache-inodes \ + -no-cache-inodes -b -eltorito-alt-boot -B -G \ + -hard-disk-boot -no-emul-boot -no-boot \ + -boot-load-seg -boot-load-size \ + -boot-info-table -C -c -check-oldname \ + -check-session -copyright -d -D -dir-mode \ + -dvd-video -f -file-mode -gid -gui \ + -graft-points -hide -hide-list -hidden \ + -hidden-list -hide-joliet -hide-joliet-list \ + -hide-joliet-trans-tbl -hide-rr-moved \ + -input-charset -output-charset -iso-level -J \ + -joliet-long -jcharset -l -L -log-file -m \ + -exclude-list -max-iso9660-filenames -M -N \ + -new-dir-mode -nobak -no-bak -force-rr -no-rr \ + -no-split-symlink-components \ + -no-split-symlink-fields -o -pad -no-pad \ + -path-list -P -p -print-size -quiet -R -r \ + -relaxed-filenames -sort -split-output \ + -stream-media-size -stream-file-name -sysid -T\ + -table-name -ucs-level -udf -uid \ + -use-fileversion -U -no-iso-translate -V \ + -volset -volset-size -volset-seqno -v -x -z \ + -hfs -apple -map -magic -hfs-creator \ + -hfs-type -probe -no-desktop -mac-name \ + -boot-hfs-file -part -auto -cluster-size \ + -hide-hfs -hide-hfs-list -hfs-volid \ + -icon-position -root-info -prep-boot \ + -input-hfs-charset -output-hfs-charset \ + -hfs-unlock -hfs-bless -hfs-parms --cap \ + --netatalk --double --ethershare --ushare \ + --exchange --sgi --xinet --macbin --single \ + --dave --sfm --osx-double --osx-hfs' -- $cur )) + else + _filedir + fi + +} && +complete -F _mkisofs $filenames mkisofs + +# mc(1) completion +# +have mc && +_mc() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + # -name value style option + case "$prev" in + -@(e|v|l|P)) + _filedir + return 0 + ;; + esac + + # --name=value style option + if [[ "$cur" == *=* ]]; then + prev=${cur/=*/} + cur=${cur/*=/} + case "$prev" in + --@(edit|view|ftplog|printwd)) + _filedir + return 0 + ;; + esac + fi + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-a --stickchars -b --nocolor -c \ + --color -C --colors= -d --nomouse -e --edit= -f \ + --datadir -k --resetsoft -l --ftplog= -P --printwd= \ + -s --slow -t --termcap -u --nosubshell -U --subshell \ + -v --view= -V --version -x --xterm -h --help' -- $cur ) ) + else + _filedir -d + fi +} && +complete -F _mc $filenames mc + +# yum(8) completion +# +have yum && { +_yum() +{ + local cur prev special + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do + if [[ ${COMP_WORDS[i]} == @(install|update|upgrade|remove|erase|deplist) ]]; then + special=${COMP_WORDS[i]} + fi + done + + if [ -n "$special" ]; then + case $special in + install|deplist) + COMPREPLY=( $( compgen -W '$( yum -C list | cut -d" " -f1 )' -- $cur ) ) + return 0 + ;; + *) + _rpm_installed_packages + return 0 + ;; + esac + fi + + case $cur in + --*) + COMPREPLY=( $( compgen -W '--installroot --version --help --enablerepo --disablerepo --exclude --obsoletes --noplugins' -- $cur ) ) + return 0 + ;; + -*) + COMPREPLY=( $( compgen -W '-c -e -d -y -t -R -C -h' -- $cur ) ) + return 0 + ;; + esac + + case $prev in + list) + COMPREPLY=( $( compgen -W 'all available updates installed extras obsoletes recent' -- $cur ) ) + ;; + clean) + COMPREPLY=( $( compgen -W 'packages headers metadata cache dbcache all' -- $cur ) ) + ;; + localinstall) + _filedir rpm + ;; + -c) + _filedir + ;; + --installroot) + _filedir -d + ;; + *) + COMPREPLY=( $( compgen -W 'install update check-update upgrade remove list \ + search info provides clean groupinstall groupupdate \ + grouplist deplist erase groupinfo groupremove \ + localinstall localupdate makecache resolvedep \ + shell whatprovides' -- $cur ) ) + ;; + esac +} +complete -F _yum $filenames yum + +# yum-arch(8) completion +# +_yum_arch() +{ + local cur + COMPREPLY=() + cur=`_get_cword` + + case "$cur" in + -*) + COMPREPLY=( $( compgen -W '-d -v -vv -n -c -z -s -l -q' -- $cur ) ) + ;; + *) + _filedir -d + ;; + esac + + return 0 + +} +complete -F _yum_arch $filenames yum-arch +} + +# ImageMagick completion +# +have convert && { +_ImageMagick() +{ + local prev + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -channel) + COMPREPLY=( $( compgen -W 'Red Green Blue Opacity \ + Matte Cyan Magenta Yellow Black' -- $cur ) ) + return 0 + ;; + -colormap) + COMPREPLY=( $( compgen -W 'shared private' -- $cur ) ) + return 0 + ;; + -colorspace) + COMPREPLY=( $( compgen -W 'GRAY OHTA RGB Transparent \ + XYZ YCbCr YIQ YPbPr YUV CMYK' -- $cur ) ) + return 0 + ;; + -compose) + COMPREPLY=( $( compgen -W 'Over In Out Atop Xor Plus \ + Minus Add Subtract Difference Multiply Bumpmap\ + Copy CopyRed CopyGreen CopyBlue CopyOpacity' \ + -- $cur ) ) + return 0 + ;; + -compress) + COMPREPLY=( $( compgen -W 'None BZip Fax Group4 JPEG \ + Lossless LZW RLE Zip' -- $cur ) ) + return 0 + ;; + -dispose) + COMPREPLY=( $( compgen -W 'Undefined None Background \ + Previous' -- $cur ) ) + return 0 + ;; + -encoding) + COMPREPLY=( $( compgen -W 'AdobeCustom AdobeExpert \ + AdobeStandard AppleRoman BIG5 GB2312 Latin2 \ + None SJIScode Symbol Unicode Wansung' -- $cur)) + return 0 + ;; + -endian) + COMPREPLY=( $( compgen -W 'MSB LSB' -- $cur ) ) + return 0 + ;; + -filter) + COMPREPLY=( $( compgen -W 'Point Box Triangle Hermite \ + Hanning Hamming Blackman Gaussian Quadratic \ + Cubic Catrom Mitchell Lanczos Bessel Sinc' \ + -- $cur ) ) + return 0 + ;; + -format) + COMPREPLY=( $( convert -list format | \ + awk '/ [r-][w-][+-] / {print $1}' | \ + tr -d '*' | tr [:upper:] [:lower:] | \ + grep "^$cur" ) ) + return 0 + ;; + -gravity) + COMPREPLY=( $( compgen -W 'Northwest North NorthEast \ + West Center East SouthWest South SouthEast' \ + -- $cur ) ) + return 0 + ;; + -intent) + COMPREPLY=( $( compgen -W 'Absolute Perceptual \ + Relative Saturation' -- $cur ) ) + return 0 + ;; + -interlace) + COMPREPLY=( $( compgen -W 'None Line Plane Partition' \ + -- $cur ) ) + return 0 + ;; + -limit) + COMPREPLY=( $( compgen -W 'Disk File Map Memory' \ + -- $cur ) ) + return 0 + ;; + -list) + COMPREPLY=( $( compgen -W 'Delegate Format Magic \ + Module Resource Type' -- $cur ) ) + return 0 + ;; + -map) + COMPREPLY=( $( compgen -W 'best default gray red \ + green blue' -- $cur ) ) + _filedir + return 0 + ;; + -noise) + COMPREPLY=( $( compgen -W 'Uniform Gaussian \ + Multiplicative \ + Impulse Laplacian Poisson' -- $cur ) ) + return 0 + ;; + -preview) + COMPREPLY=( $( compgen -W 'Rotate Shear Roll Hue \ + Saturation Brightness Gamma Spiff \ + Dull Grayscale Quantize Despeckle \ + ReduceNoise AddNoise Sharpen Blur \ + Treshold EdgeDetect Spread Shade \ + Raise Segment Solarize Swirl Implode \ + Wave OilPaint CharcoalDrawing JPEG' \ + -- $cur ) ) + return 0 + ;; + -@(mask|profile|texture|tile|write)) + _filedir + return 0 + ;; + -type) + COMPREPLY=( $( compgen -W 'Bilevel Grayscale Palette \ + PaletteMatte TrueColor TrueColorMatte \ + ColorSeparation ColorSeparationlMatte \ + Optimize' -- $cur ) ) + return 0 + ;; + -units) + COMPREPLY=( $( compgen -W 'Undefined PixelsPerInch \ + PixelsPerCentimeter' -- $cur ) ) + return 0 + ;; + -virtual-pixel) + COMPREPLY=( $( compgen -W 'Constant Edge mirror tile' \ + -- $cur ) ) + return 0 + ;; + -visual) + COMPREPLY=( $( compgen -W 'StaticGray GrayScale \ + StaticColor PseudoColor TrueColor \ + DirectColor defaut visualid' -- $cur )) + return 0 + ;; + esac +} + +_convert() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + _ImageMagick + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-adjoin -affine -antialias -append \ + -authenticate -average -background -black-threshold \ + -blue-primary -blur -border -bordercolor -channel \ + -charcoal -chop -clip -coalesce -colorize -colors \ + -colorspace -comment -compress -contrast -convolve \ + -crop -cycle -debug -deconstruct -delay -density \ + -depth -despeckle -display -dispose -dither -draw \ + -edge -emboss -encoding -endian -enhance -equalize \ + -extract -fill -filter -flatten -flip -flop -font \ + -frame -fuzz -gamma -gaussian -geometry \ + -green-primary -gravity -help -implode -intent \ + -interlace -label -lat -level -limit -list -log -loop \ + -map -mask -matte -median -modulate -monochrome \ + -morph -mosaic -negate -noop -noise -normalize \ + -opaque -ordered-dither -page -paint -ping -pointsize \ + -preview -profile -quality -raise -random-threshold \ + -region -raise -red-primary -render -resize -resample \ + -roll -rotate -sample -sampling-factor -scale -scene \ + -seed -segment -shade -sharpen -shave -shear -size \ + -solarize -spread -stroke -strokewidth -swirl \ + -texture -threshold -thumbnail -tile -transform \ + -transparent -treedepth -trim -type -undercolor \ + -units -unsharp -verbose -version -view \ + -virtual-pixel -wave -white-point -white-threshold \ + -write' -- $cur ) ) + elif [[ "$cur" == +* ]]; then + COMPREPLY=( $( compgen -W '+adjoin +append +compress \ + +contrast +debug +dither +endian +gamma +label +map \ + +mask +matte +negate +noise +page +raise +render \ + +write' -- $cur ) ) + else + _filedir + fi +} +complete -F _convert $filenames convert + +_mogrify() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + _ImageMagick + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-affine -antialias -authenticate \ + -background -black-threshold -blue-primary -blur \ + -border -bordercolor -channel -charcoal -chop \ + -colorize -colors -colorspace -comment -compress \ + -contrast -convolve -crop -cycle -debug -delay \ + -density -depth -despeckle -display -dispose -dither \ + -draw -edge -emboss -encoding -endian -enhance \ + -equalize -extract -fill -filter -flip -flop -font \ + -format -frame -fuzz -gamma -gaussian -geometry \ + -green-primary -implode -interlace -help -label -lat \ + -level -limit -list -log -loop -map -mask -matte \ + -median -modulate -monochrome -negate -noop \ + -normalize -opaque -page -paint -fill -ordered-dither \ + -pointsize -profile -quality -raise -random-threshold \ + -red-primary -region -resample -resize -roll -rotate \ + -sample -sampling-factor -scale -scene -seed -segment \ + -shade -sharpen -shear -size -solarize -spread \ + -stroke -strokewidth -swirl -texture -threshold \ + -thumbnail -tile -transform -transparent -treedepth \ + -trim -type -undercolor -units -unsharp -verbose \ + -version -view -virtual-pixel -wave -white-point \ + -white-threshold' -- $cur ) ) + elif [[ "$cur" == +* ]]; then + COMPREPLY=( $( compgen -W '+compress +contrast +debug +dither \ + +endian +gamma +label +map +mask +matte +negate +page \ + +raise' -- $cur ) ) + else + _filedir + fi +} +complete -F _mogrify $filenames mogrify + +_display() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + _ImageMagick + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-authenticate -backdrop -border \ + -colormap -colors -colorspace -comment -compress \ + -contrast -crop -debug -delay -density -depth \ + -despeckle -display -dispose -dither -edge -endian \ + -enhance -extract -filter -flip -flop -frame -gamma \ + -geometry -help -immutable -interlace -label -limit \ + -log -map -matte -monochrome -negate -noop -page \ + -quality -raise -remote -roll -rotate -sample \ + -sampling-factor -scene -segment -sharpen -size \ + -texture -treedepth -trim -update -verbose -version \ + -virtual-pixel -window -window_group -write' -- $cur)) + elif [[ "$cur" == +* ]]; then + COMPREPLY=( $( compgen -W '+compress +contrast +debug +dither \ + +endian +gamma +label +map +matte +negate +page \ + +raise +write' -- $cur ) ) + else + _filedir + fi +} +complete -F _display $filenames display + +_animate() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + _ImageMagick + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-authenticate -backdrop -colormap \ + -colors -colorspace -crop -debug -delay -density \ + -depth -display -dither -extract -gamma -geometry \ + -help -interlace -limit -log -matte -map -monochrome \ + -noop -pause -remote -rotate -sampling-factor -scene \ + -size -treedepth -trim -verbose -version -visual \ + -virtual-pixel -window' -- $cur ) ) + elif [[ "$cur" == +* ]]; then + COMPREPLY=( $( compgen -W '+debug +dither +gamma +map +matte' -- $cur ) ) + else + _filedir + fi +} +complete -F _animate $filenames animate + +_identify() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + _ImageMagick + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-authenticate -debug -density \ + -depth -extract -format -help -interlace -limit -list \ + -log -size -sampling-factor -verbose -version \ + -virtual-pixel' -- $cur ) ) + elif [[ "$cur" == +* ]]; then + COMPREPLY=( $( compgen -W '+debug ' -- $cur ) ) + else + _filedir + fi +} +complete -F _identify $filenames identify + +_montage() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + _ImageMagick + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-adjoin -affine -authenticate \ + -blue-primary -blur -colors -colorspace -comment \ + -compose -compress -crop -debug -density -depth \ + -display -dispose -dither -draw -encoding -endian \ + -extract -fill -filter -flip -flop -frame -gamma \ + -geometry -gravity -green-primary -interlace -help \ + -label -limit -log -matte -mode -monochrome -noop \ + -page -pointsize -quality -red-primary -resize \ + -rotate -sampling-factor -scene -shadow -size \ + -stroke -texture -thumbnail -tile -transform \ + -transparent -treedepth -trim -type -verbose \ + -version -virtual-pixel -white-point' -- $cur ) ) + elif [[ "$cur" == +* ]]; then + COMPREPLY=( $( compgen -W '+adjoin +compress +debug +dither \ + +endian +gamma +label +matte +page' -- $cur ) ) + else + _filedir + fi +} +complete -F _montage $filenames montage + +_composite() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + _ImageMagick + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-affine -authenticate \ + -blue-primary -colors -colorspace -comment -compose \ + -compress -debug -density -depth -displace -display \ + -dispose -dissolve -dither -encoding -endian -extract \ + -filter -font -geometry -gravity -green-primary -help \ + -interlace -label -limit -log -matte -monochrome \ + -negate -page -profile -quality -red-primary -rotate \ + -resize -sampling-factor -scene -sharpen -size \ + -stegano -stereo -thumbnail -tile -transform \ + -treedepth -type -units -unsharp -verbose -version \ + -virtual-pixel -watermark -white-point -write' \ + -- $cur ) ) + elif [[ "$cur" == +* ]]; then + COMPREPLY=( $( compgen -W '+compress +debug +dither +endian +label \ + +matte +negate +page +write' -- $cur ) ) + else + _filedir + fi +} +complete -F _composite $filenames composite +} + +# dd(1) completion +# +have dd && +_dd() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + case "$cur" in + if=*|of=*) + cur=${cur#*=} + _filedir + return 0 + ;; + conv=*) + cur=${cur#*=} + COMPREPLY=( $( compgen -W 'ascii ebcdic ibm block unblock \ + lcase notrunc ucase swab noerror sync' \ + -- $cur ) ) + return 0 + ;; + esac + + _expand || return 0 + + COMPREPLY=( $( compgen -W '--help --version' -- $cur ) \ + $( compgen -W 'bs cbs conv count ibs if obs of seek skip'\ + -S '=' -- $cur ) ) +} && +complete -F _dd $nospace $filenames dd + +# CUPS cancel(1) completion +# +have cancel && +_cancel() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + COMPREPLY=( $( lpstat | cut -d' ' -f1 | grep "^$cur" ) ) +} && +complete -F _cancel $filenames cancel + +# aspell(1) completion +# +have aspell && { +_aspell_dictionary() +{ + local datadir + datadir=/usr/lib/aspell + COMPREPLY=( $( command ls $datadir/*.@(multi|alias) ) ) + COMPREPLY=( ${COMPREPLY[@]%.@(multi|alias)} ) + COMPREPLY=( $( compgen -W '${COMPREPLY[@]#$datadir/}' -- $cur ) ) +} + +_aspell() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + # --name value style option + case "$prev" in + @(-c|-p|check)) + _filedir + return 0 + ;; + @(dump|create|merge)) + COMPREPLY=( $( compgen -W 'master personal repl' -- $cur ) ) + return 0 + ;; + -d) + _aspell_dictionary + return 0 + ;; + esac + + # --name=value style option + if [[ "$cur" == *=* ]]; then + prev=${cur/=*/} + cur=${cur/*=/} + case "$prev" in + --@(conf|personal|repl|per-conf)) + _filedir + return 0 + ;; + --@(conf-dir|data-dir|dict-dir|home-dir|local-data-dir|prefix)) + _filedir -d + return 0 + ;; + --master) + _aspell_dictionary + return 0 + ;; + --mode) + COMPREPLY=( $( compgen -W 'none url email sgml tex' -- $cur ) ) + return 0 + ;; + --sug-mode) + COMPREPLY=( $( compgen -W 'ultra fast normal bad-speller' -- $cur ) ) + return 0 + ;; + --keymapping) + COMPREPLY=( $( compgen -W 'aspell ispell' -- $cur ) ) + return 0 + ;; + esac + fi + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--conf= --conf-dir= --data-dir= --dict-dir= \ + --encoding= --add-filter= --rem-filter= --mode= -e \ + -H -t --add-extra-dicts= --rem-extra-dicts= \ + --home-dir= -W --ignore= --ignore-accents \ + --dont-ignore-accents --ignore-case --dont-ignore-case \ + --ignore-repl --dont-ignore-repl --jargon= --keyboard= \ + --lang= --language-tag= --local-data-dir= -d --master= \ + --module= --add-module-search-order= \ + --rem-module-search-order= --per-conf= -p --personal= \ + --prefix= --repl= -C -B --run-together --dont-run-together \ + --run-together-limit= --run-together-min= --save-repl \ + --dont-save-repl --set-prefix --dont-set-prefix --size= \ + --spelling= --strip-accents --dont-strip-accents \ + --sug-mode= --add-word-list-path= --rem-word-list-path= \ + -b -x --backup -b|-x --dont-backup --reverse --dont-reverse \ + --time --dont-time --keymapping= --add-email-quote= \ + --rem-email-quote= --email-margin= --add-tex-command= \ + --rem-tex-command= --tex-check-comments \ + --dont-tex-check-comments --add-tex-extension= \ + --rem-tex-extension= --add-sgml-check= --rem-sgml-check= \ + --add-sgml-extension= --rem-sgml-extension=' -- $cur ) ) + else + COMPREPLY=( $( compgen -W '-? help -c check -a pipe -l list \ + config config soundslike filter -v version dump \ + create merge' -- $cur ) ) + fi + +} +complete -F _aspell $filenames aspell +} + +# xmms(1) completion +# +have xmms && +_xmms() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-h --help -r --rew -p --play \ + -u --pause -s --stop -t --play-pause -f --fwd -e \ + --enqueue -m --show-main-window -i --sm-client-id \ + -v --version' -- $cur ) ) + else + _filedir '@(mp[23]|MP[23]|ogg|OGG|wav|WAV|pls|m3u|xm|mod|s[3t]m|it|mtm|ult|flac)' + + fi + +} && +complete -F _xmms $filenames xmms + +# info(1) completion +# +have info && +_info() +{ + local cur infopath UNAME + + COMPREPLY=() + cur=`_get_cword` + + _expand || return 0 + + # default completion if parameter contains / + if [[ "$cur" == */* ]]; then + _filedir + return 0 + fi + + infopath='/usr/share/info' + + if [ "${INFOPATH: -1:1}" == ':' ]; then + infopath=${INFOPATH}${infopath} + elif [ ${INFOPATH:+set} ]; then + infopath=$INFOPATH + fi + + infopath=$infopath: + if [ -n "$cur" ]; then + infopath="${infopath//://$cur* }" + else + infopath="${infopath//:// }" + fi + + # redirect stderr for when path doesn't exist + COMPREPLY=( $( eval command ls "$infopath" 2>/dev/null ) ) + # weed out directory path names and paths to info pages + COMPREPLY=( ${COMPREPLY[@]##*/?(:)} ) + # weed out info dir file + for (( i=0 ; i < ${#COMPREPLY[@]} ; ++i )); do + if [ "${COMPREPLY[$i]}" == 'dir' ]; then + unset COMPREPLY[$i]; + fi; + done + # strip suffix from info pages + COMPREPLY=( ${COMPREPLY[@]%.@(gz|bz2)} ) + COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) ) + + return 0 +} && +complete -F _info $filenames info + +# dhclient(1) completion +# +have dhclient && _dhclient() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(cf|lf|pf|sf)) + _filedir + return 0 + ;; + -s) + _known_hosts + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-p -d -q -1 -r -lf -pf \ + -cf -sf -s -g -n -nw -w' -- $cur ) ) + else + _available_interfaces + fi +} && +complete -F _dhclient dhclient + +# lvm(8) completion +# +have lvm && { +_volumegroups() +{ + COMPREPLY=( $(compgen -W "$( vgscan 2>/dev/null | \ + sed -n -e 's|.*Found.*"\(.*\)".*$|\1|p' )" -- $cur ) ) +} + +_physicalvolumes() +{ + COMPREPLY=( $(compgen -W "$( pvscan 2>/dev/null | \ + sed -n -e 's|^.*PV \(.*\) VG.*$|\1|p' )" -- $cur ) ) +} + +_logicalvolumes() +{ + COMPREPLY=( $(compgen -W "$( lvscan 2>/dev/null | \ + sed -n -e "s|^.*'\(.*\)'.*$|\1|p" )" -- $cur ) ) +} + +_units() +{ + COMPREPLY=( $( compgen -W 'h s b k m g t H K M G T' -- $cur ) ) +} + +_sizes() +{ + COMPREPLY=( $( compgen -W 'k K m M g G t T' -- $cur ) ) +} + +_args() +{ + args=0 + if [[ "${COMP_WORDS[0]}" == lvm ]]; then + offset=2 + else + offset=1 + fi + for (( i=$offset; i < COMP_CWORD; i++ )); do + if [[ "${COMP_WORDS[i]}" != -* ]]; then + args=$(($args + 1)) + fi + done +} + +_lvmdiskscan() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-d --debug -h -? --help -l \ + --lvmpartition -v --verbose --version' -- $cur ) ) + fi +} +complete -F _lvmdiskscan lvmdiskscan + +_pvscan() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-d --debug -e \ + --exported -n --novolumegroup -h -? \ + --help --ignorelockingfailure -P \ + --partial -s --short -u --uuid -v \ + --verbose --version' -- $cur ) ) + fi +} +complete -F _pvscan pvscan + +_pvs() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(o|O|-options|-sort)) + COMPREPLY=( $( compgen -W 'pv_fmt pv_uuid \ + pv_size pv_free pv_used pv_name \ + pv_attr pv_pe_count \ + pv_pe_alloc_count' -- $cur ) ) + return 0 + ;; + --units) + _units + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--aligned -a --all -d --debug \ + -h -? --help --ignorelockingfailure --noheadings \ + --nosuffix -o --options -O --sort \ + --separator --unbuffered --units \ + -v --verbose --version' -- $cur ) ) + else + _physicalvolumes + fi +} +complete -F _pvs pvs + +_pvdisplay() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + --units) + _units + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-c --colon -C --columns --units \ + -v --verbose -d --debug -h --help --version' -- $cur ) ) + else + _physicalvolumes + fi +} +complete -F _pvdisplay pvdisplay + +_pvchange() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(A|x|-autobackup|--allocatable)) + COMPREPLY=( $( compgen -W 'y n' -- $cur ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-a --all -A --autobackup \ + -d --debug -h --help -t --test -u --uuid -x \ + --allocatable -v --verbose --addtag --deltag \ + --version' -- $cur ) ) + else + _physicalvolumes + fi +} +complete -F _pvchange pvchange + +_pvcreate() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + --restorefile) + _filedir + return 0 + ;; + -@(M|-metadatatype)) + COMPREPLY=( $( compgen -W '1 2' -- $cur ) ) + return 0 + ;; + --metadatacopies) + COMPREPLY=( $( compgen -W '0 1 2' -- $cur ) ) + return 0 + ;; + --@(metadatasize|setphysicalvolumesize)) + _sizes + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--restorefile -d --debug -f \ + --force -h -? --help --labelsector -M --metadatatype \ + --metadatacopies --metadatasize \ + --setphysicalvolumesize -t --test -u --uuid uuid -v \ + --verbose -y --yes --version' -- $cur ) ) + else + _physicalvolumes + fi +} +complete -F _pvcreate pvcreate + +_pvmove() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(A|-autobackup)) + COMPREPLY=( $( compgen -W 'y n' -- $cur ) ) + return 0 + ;; + -@(n|-name)) + _logicalvolumes + return 0 + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--abort -A --autobackup \ + -b --background -d --debug -f --force -h -? \ + --help -i --interval -t --test -v --verbose \ + --version -n --name' -- $cur ) ) + else + _physicalvolumes + fi +} +complete -F _pvmove pvmove + +_pvremove() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-d --debug -f --force -h -? \ + --help -y --yes -t --test -v --verbose \ + --version' -- $cur ) ) + else + _physicalvolumes + fi +} +complete -F _pvremove pvremove + +_vgscan() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-d --debug -h --help \ + --ignorelockingfailure --mknodes -P \ + --partial -v --verbose --version' -- $cur ) ) + fi +} +complete -F _vgscan vgscan + +_vgs() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(o|O|-options|-sort)) + COMPREPLY=( $( compgen -W 'vg_fmt vg_uuid vg_name \ + vg_attr vg_size vg_free vg_sysid \ + vg_extent_size vg_extent_count vg_free_count \ + max_lv max_pv pv_count lv_count snap_count \ + vg_seqno' -- $cur ) ) + return 0 + ;; + --units) + _units + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--aligned -d --debug \ + -h --help --ignorelockingfailure --noheadings \ + --nosuffix -o --options -O --sort -P --partial \ + --separator --unbuffered --units \ + -v --verbose --version' -- $cur ) ) + else + _volumegroups + fi +} +complete -F _vgs vgs + +_vgdisplay() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + --units) + _units + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-c --colon -C --columns --units \ + -P --partial -A --activevolumegroups -v --verbose \ + -d --debug -h --help --version' -- $cur ) ) + else + _volumegroups + fi +} +complete -F _vgdisplay vgdisplay + +_vgchange() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(a|A|x|-available|-autobackup|-resizeable)) + COMPREPLY=( $( compgen -W 'y n' -- $cur ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-A --autobackup --alloc -P \ + --partial -d --debug -h --help --ignorelockingfailure \ + -t --test -u --uuid -v --verbose --version -a \ + --available -x --resizeable -l --logicalvolume \ + --addtag --deltag' -- $cur ) ) + else + _volumegroups + fi +} +complete -F _vgchange vgchange + +_vgcreate() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(A|-autobackup)) + COMPREPLY=( $( compgen -W 'y n' -- $cur ) ) + return 0 + ;; + -@(M|-metadatatype)) + COMPREPLY=( $( compgen -W '1 2' -- $cur ) ) + return 0 + ;; + -@(s|-physicalextentsize)) + _sizes + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-A --autobackup --addtag \ + --alloc -d --debug -h --help -l --maxlogicalvolumes \ + -M --metadatatype -p --maxphysicalvolumes -s \ + --physicalextentsize -t --test -v --verbose \ + --version' -- $cur ) ) + else + _args + if [ $args -eq 0 ]; then + _volumegroups + else + _physicalvolumes + fi + fi +} +complete -F _vgcreate vgcreate + +_vgremove() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-d --debug -h --help -t --test \ + -v --verbose --version' -- $cur ) ) + else + _volumegroups + fi +} +complete -F _vgremove vgremove + +_vgrename() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(A|-autobackup)) + COMPREPLY=( $( compgen -W 'y n' -- $cur ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-A --autobackup -d --debug -h \ + -? --help -t --test -v --verbose --version' -- $cur ) ) + else + _volumegroups + fi +} +complete -F _vgrename vgrename + +_vgreduce() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(A|-autobackup)) + COMPREPLY=( $( compgen -W 'y n' -- $cur ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-a --all -A --autobackup -d \ + --debug -h --help --removemissing -t --test -v \ + --verbose --version' -- $cur ) ) + + else + _args + if [ $args -eq 0 ]; then + _volumegroups + else + _physicalvolumes + fi + fi +} +complete -F _vgreduce vgreduce + +_vgextend() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(A|-autobackup)) + COMPREPLY=( $( compgen -W 'y n' -- $cur ) ) + return 0 + ;; + -@(L|-size)) + _sizes + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-A --autobackup -d --debug -h \ + -? --help -t --test -v --verbose --version' -- $cur ) ) + else + _args + if [ $args -eq 0 ]; then + _volumegroups + else + _physicalvolumes + fi + fi +} +complete -F _vgextend vgextend + +_vgport() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-a --all -d --debug -h \ + -? --help -v --verbose --version' -- $cur ) ) + else + _volumegroups + fi +} +complete -F _vgport vgimport vgexport + +_vgck() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-d --debug -h \ + -? --help -v --verbose --version' -- $cur ) ) + else + _volumegroups + fi +} +complete -F _vgck vgck + +_vgconvert() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(M|-metadatatype)) + COMPREPLY=( $( compgen -W '1 2' -- $cur ) ) + return 0 + ;; + --metadatacopies) + COMPREPLY=( $( compgen -W '0 1 2' -- $cur ) ) + return 0 + ;; + --metadatasize) + _sizes + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-d --debug -h --help --labelsector \ + -M --metadatatype --metadatacopies --metadatasize \ + -t --test -v --verbose --version' -- $cur ) ) + else + _volumegroups + fi +} +complete -F _vgconvert vgconvert + +_vgcfgbackup() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(f|-file)) + _filedir + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-d --debug -f --file -h --help \ + --ignorelockingfailure -P --partial -v --verbose \ + --version' -- $cur ) ) + else + _volumegroups + fi +} +complete -F _vgcfgbackup vgcfgbackup + +_vgcfgrestore() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(f|-file)) + _filedir + return 0 + ;; + -@(M|-metadatatype)) + COMPREPLY=( $( compgen -W '1 2' -- $cur ) ) + return 0 + ;; + -@(n|-name)) + _volumegroups + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-d --debug -f --file -l --list \ + -h --help -M --Metadatatype -n --name -t --test \ + -v --verbose --version' -- $cur ) ) + else + _volumegroups + fi +} +complete -F _vgcfgrestore vgcfgrestore + +_vgmerge() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(A|-autobackup)) + COMPREPLY=( $( compgen -W 'y n' -- $cur ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-A --autobackup -d --debug \ + -h --help -l --list -t --test -v --verbose \ + --version' -- $cur ) ) + else + _volumegroups + fi +} +complete -F _vgmerge vgmerge + +_vgsplit() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(A|-autobackup)) + COMPREPLY=( $( compgen -W 'y n' -- $cur ) ) + return 0 + ;; + -@(M|-metadatatype)) + COMPREPLY=( $( compgen -W '1 2' -- $cur ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-A --autobackup -d --debug \ + -h --help -l --list -M --metadatatype -t --test \ + -v --verbose --version' -- $cur ) ) + else + _args + if [ $args -eq 0 -o $args -eq 1 ]; then + _volumegroups + else + _physicalvolumes + fi + fi +} +complete -F _vgsplit vgsplit + +_vgmknodes() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-d --debug -h --help -v --verbose \ + --version' -- $cur ) ) + else + _volumegroups + fi +} +complete -F _vgmknodes vgmknodes + +_lvscan() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-b --blockdevice -d --debug \ + -h -? --help --ignorelockingfailure -P \ + --partial -v --verbose --version' -- $cur ) ) + fi +} +complete -F _lvscan lvscan + +_lvs() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(o|O|-options|-sort)) + COMPREPLY=( $( compgen -W 'lv_uuid lv_name \ + lv_attr lv_minor lv_size seg_count \ + origin snap_percent segtype stripes \ + stripesize chunksize seg_start \ + seg_size' -- $cur ) ) + return 0 + ;; + --units) + _units + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--aligned -d --debug \ + -h --help --ignorelockingfailure --noheadings \ + --nosuffix -o --options -O --sort -P --partial \ + --segments --separator --unbuffered --units \ + -v --verbose --version' -- $cur ) ) + else + _logicalvolumes + fi +} +complete -F _lvs lvs + +_lvdisplay() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + --units) + _units + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-c --colon -C --columns --units \ + -P --partial -m --maps -v --verbose -d --debug -h \ + --help --version' -- $cur ) ) + else + _logicalvolumes + fi +} +complete -F _lvdisplay lvdisplay + +_lvchange() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(a|A|C|M|-available|-autobackup|-continguous|-persistent)) + COMPREPLY=( $( compgen -W 'y n' -- $cur ) ) + return 0 + ;; + -@(p|-permission)) + COMPREPLY=( $( compgen -W 'r rw' -- $cur ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-A --autobackup -a --available \ + --addtag --alloc -C --contiguous -d --debug --deltag \ + -f --force -h --help --ignorelockingfailure -M \ + --persistent --major major --minor minor -P --partial \ + -p --permission -r --readahead --refresh -t --test \ + -v --verbose --version' -- $cur ) ) + else + _logicalvolumes + fi +} +complete -F _lvchange lvchange + +_lvcreate() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(A|C|M|Z|-autobackup|-continguous|-persistent|-zero)) + COMPREPLY=( $( compgen -W 'y n' -- $cur ) ) + return 0 + ;; + -@(L|-size)) + _sizes + return 0 + ;; + -@(p|-permission)) + COMPREPLY=( $( compgen -W 'r rw' -- $cur ) ) + return 0 + ;; + -@(n|-name)) + _logicalvolumes + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-A --autobackup --addtag --alloc \ + -C --contiguous -d --debug -h -? --help -i --stripes \ + -I --stripesize -l --extents -L --size -M --persistent \ + --major --minor -n --name -p --permission -r \ + --readahead -t --test --type -v --verbose -Z --zero \ + --version' -- $cur ) ) + else + _args + if [ $args -eq 0 ]; then + _volumegroups + else + _physicalvolumes + fi + fi +} +complete -F _lvcreate lvcreate + +_lvremove() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(A|-autobackup)) + COMPREPLY=( $( compgen -W 'y n' -- $cur ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-A --autobackup -d --debug -f \ + --force -h -? --help -t --test -v --verbose \ + --version' -- $cur ) ) + else + _logicalvolumes + fi +} +complete -F _lvremove lvremove + +_lvrename() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(A|-autobackup)) + COMPREPLY=( $( compgen -W 'y n' -- $cur ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-A --autobackup -d --debug -h \ + -? --help -t --test -v --verbose --version' -- $cur ) ) + else + _logicalvolumes + fi +} +complete -F _lvrename lvrename + +_lvreduce() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(A|-autobackup)) + COMPREPLY=( $( compgen -W 'y n' -- $cur ) ) + return 0 + ;; + -@(L|-size)) + _sizes + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-A --autobackup -d \ + --debug -f --force -h --help -l --extents \ + -L --size -n --nofsck -r --resizefs -t --test \ + -v --verbose --version' -- $cur ) ) + else + _logicalvolumes + fi +} +complete -F _lvreduce lvreduce + +_lvresize() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(A|-autobackup)) + COMPREPLY=( $( compgen -W 'y n' -- $cur ) ) + return 0 + ;; + -@(L|-size)) + _sizes + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-A --autobackup --alloc -d \ + --debug -h --help -i --stripes -I --stripesize \ + -l --extents -L --size -n --nofsck -r --resizefs \ + -t --test --type -v --verbose --version' -- $cur ) ) + else + _args + if [ $args -eq 0 ]; then + _logicalvolumes + else + _physicalvolumes + fi + fi +} +complete -F _lvresize lvresize + +_lvextend() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(A|-autobackup)) + COMPREPLY=( $( compgen -W 'y n' -- $cur ) ) + return 0 + ;; + -@(L|-size)) + _sizes + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-A --autobackup --alloc -d \ + --debug -h --help -i --stripes -I --stripesize \ + -l --extents -L --size -n --nofsck -r --resizefs \ + -t --test --type -v --verbose --version' -- $cur ) ) + else + _args + if [ $args -eq 0 ]; then + _logicalvolumes + else + _physicalvolumes + fi + fi +} +complete -F _lvextend lvextend + +_lvm() +{ + local prev + + COMPREPLY=() + cur=`_get_cword` + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $( compgen -W 'dumpconfig help lvchange \ + lvcreate lvdisplay lvextend lvmchange \ + lvmdiskscan lvmsadc lvmsar lvreduce \ + lvremove lvrename lvresize lvs lvscan \ + pvchange pvcreate pvdata pvdisplay pvmove \ + pvremove pvresize pvs pvscan vgcfgbackup \ + vgcfgrestore vgchange vgck vgconvert \ + vgcreate vgdisplay vgexport vgextend \ + vgimport vgmerge vgmknodes vgreduce \ + vgremove vgrename vgs vgscan vgsplit \ + version' -- $cur ) ) + else + case ${COMP_WORDS[1]} in + pvchange) + _pvchange + ;; + pvcreate) + _pvcreate + ;; + pvdisplay) + _pvdisplay + ;; + pvmove) + _pvmove + ;; + pvremove) + _pvremove + ;; + pvresize) + _pvresize + ;; + pvs) + _pvs + ;; + pvscan) + _pvscan + ;; + vgcfgbackup) + _vgcfgbackup + ;; + vgcfgrestore) + _vgcfgrestore + ;; + vgchange) + _vgchange + ;; + vgck) + _vgck + ;; + vgconvert) + _vgconvert + ;; + vgcreate) + _vgcreate + ;; + vgdisplay) + _vgdisplay + ;; + vgexport) + _vgexport + ;; + vgextend) + _vgextend + ;; + vgimport) + _vgimport + ;; + vgmerge) + _vgmerge + ;; + vgmknodes) + _vgmknodes + ;; + vgreduce) + _vgreduce + ;; + vgremove) + _vgremove + ;; + vgrename) + _vgrename + ;; + vgs) + _vgs + ;; + vgscan) + _vgscan + ;; + vgsplit) + _vgsplit + ;; + lvchange) + _lvchange + ;; + lvcreate) + _lvcreate + ;; + lvdisplay) + _lvdisplay + ;; + lvextend) + _lvextend + ;; + lvreduce) + _lvreduce + ;; + lvremove) + _lvremove + ;; + lvrename) + _lvrename + ;; + lvresize) + _lvresize + ;; + lvs) + _lvs + ;; + lvscan) + _lvscan + ;; + esac + fi +} +complete -F _lvm lvm +} + +# mkinitrd(8) completion +# +have mkinitrd && +_mkinitrd() +{ + local cur args + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + # --name value style option + case "$prev" in + --preload) + _modules + return 0 + ;; + esac + + # --name=value style option + if [[ "$cur" == *=* ]]; then + prev=${cur/=*/} + cur=${cur/*=/} + case "$prev" in + --@(with|builtin)) + _modules + return 0 + ;; + --@(fstab|dsdt)) + _filedir + return 0 + ;; + --tmpdir) + _filedir -d + return 0 + ;; + esac + fi + + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--version -v -f --preload \ + --with= --omit-scsi-modules --omit-raid-modules \ + --images-version --fstab= --nocompress --builtin= \ + --nopivot --noudev --allow-missing --tmpdir= \ + --initrdfs= --dsdt= --lvm-version= --froce-usb' \ + -- $cur ) ) + else + _count_args + + case $args in + 1) + _filedir + ;; + 2) + COMPREPLY=( $( command ls /lib/modules | grep "^$cur" ) ) + ;; + esac + fi + +} && +complete -F _mkinitrd mkinitrd + +# pkgconfig(1) completion +# +have pkg-config && +_pkg_config() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + if [[ "$cur" == -* ]]; then + # return list of available options + COMPREPLY=( $( compgen -W '-version --modversion \ + --atleast-pkgconfig-version= --libs --libs-only-l \ + --libs-only-other --libs-only-L --cflags \ + --cflags-only-I --cflags-only-other --variable= \ + --define-variable= --exists --uninstalled \ + --atleast-version= --exact-version= --max-version= \ + --list-all --debug --print-errors --silence-errors \ + --errors-to-stdout -? --help --usage' -- $cur)) + else + COMPREPLY=( $( pkg-config --list-all 2>/dev/null | \ + awk '{print $1}' | grep "^$cur" ) ) + fi +} && +complete -F _pkg_config pkg-config + + +# cpio(1) completion +# +have cpio && { +_cpio_format() +{ + COMPREPLY=( $( compgen -W 'bin odc newc crc tar ustar hpbin hpodc' -- $cur ) ) +} + +_cpio() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + # --name value style option + case $prev in + -H) + _cpio_format + return 0 + ;; + -@(E|F|I)) + _filedir + return 0 + ;; + -R) + _usergroup + return 0 + ;; + esac + + # --name=value style option + if [[ "$cur" == *=* ]]; then + prev=${cur/=*/} + cur=${cur/*=/} + case $prev in + --format) + _cpio_format + return 0 + ;; + --@(file|pattern-file)) + _filedir + return 0 + ;; + --owner) + _usergroup + return 0 + ;; + --rsh-command) + COMPREPLY=( $( compgen -c -- $cur ) ) + return 0 + ;; + esac + fi + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $( compgen -W '-o --create -i --extract -p --pass-through' -- $cur) ) + else + case ${COMP_WORDS[1]} in + -@(o|-create)) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-0 -a -c -v -A -B\ + -L -V -C -H -M -O -F --file= --format=\ + --message= --null --reset-access-time\ + --verbose --dot --append --block-size=\ + --dereference --io-size= --quiet\ + --force-local --rsh-command= --help\ + --version' -- $cur ) ) + fi + ;; + -@(i|-extract)) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-b -c -d -f -m -n -r\ + -t -s -u -v -B -S -V -C -E -H -M -R -I\ + -F --file= --make-directories\ + --nonmatching\ + --preserve-modification-time\ + --numeric-uid-gid --rename -t --list\ + --swap-bytes --swap --dot\ + --unconditional --verbose --block-size=\ + --swap-halfwords --io-size=\ + --pattern-file= --format= --owner=\ + --no-preserve-owner --message=\ + --force-local --no-absolute-filenames\ + --sparse --only-verify-crc --quiet\ + --rsh-command= --help\ + --version' -- $cur ) ) + fi + ;; + -@(p|-pass-through)) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-0 -a -d -l -m -u -v\ + -L -V -R --null --reset-access-time\ + --make-directories --link --quiet\ + --preserve-modification-time\ + --unconditional --verbose --dot\ + --dereference --owner=\ + --no-preserve-owner --sparse --help\ + --version' -- $cur ) ) + else + _filedir -d + fi + ;; + esac + fi +} +complete -F _cpio cpio +} + +# id(1) completion +# +have id && +_id() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-a -g --group -G --groups -n --name\ + -r --real -u --user --help --version' -- $cur ) ) + else + COMPREPLY=( $( compgen -u $cur ) ) + fi +} && +complete -F _id id + +# getent(1) completion +# +have getent && +_getent() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case $prev in + passwd) + COMPREPLY=( $( compgen -u $cur ) ) + return 0 + ;; + group) + COMPREPLY=( $( compgen -g $cur ) ) + return 0 + ;; + services) + COMPREPLY=( $( compgen -s $cur ) ) + return 0 + ;; + hosts) + COMPREPLY=( $( compgen -A hostname $cur ) ) + return 0 + ;; + protocols) + COMPREPLY=( $( getent protocols | awk '{print $1}' | grep "^$cur" ) ) + return 0 + ;; + networks) + COMPREPLY=( $( getent networks | awk '{print $1}' | grep "^$cur" ) ) + return 0 + ;; + esac + + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $( compgen -W 'passwd group hosts services protocols networks' -- $cur ) ) + fi +} && +complete -F _getent getent + +# ntpdate(1) completion +# +have ntpdate && +_ntpdate() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case $prev in + -k) + _filedir + return 0 + ;; + -U) + COMPREPLY=( $( compgen -u $cur ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-4 -6 -b -B -d -Q -q -s -u -v -a\ + -e -k -p -o -r -t' -- $cur ) ) + else + _known_hosts + fi +} && +complete -F _ntpdate ntpdate + +# smartctl(8) completion +# +have smartctl && { +_smartctl_quietmode() +{ + COMPREPLY=( $( compgen -W 'errorsonly silent' -- $cur ) ) +} +_smartctl_device() +{ + COMPREPLY=( $( compgen -W 'ata scsi 3ware' -- $cur ) ) +} +_smartctl_tolerance() +{ + COMPREPLY=( $( compgen -W 'warn exit ignore' -- $cur ) ) +} +_smartctl_badsum() +{ + COMPREPLY=( $( compgen -W 'normal conservative permissive verypermissive' -- $cur ) ) +} +_smartctl_report() +{ + COMPREPLY=( $( compgen -W 'ioctl ataioctl scsiioctl' -- $cur ) ) +} +_smartctl_feature() +{ + COMPREPLY=( $( compgen -W 'on off' -- $cur ) ) +} +_smartctl_log() +{ + COMPREPLY=( $( compgen -W 'error selftest selective directory' -- $cur ) ) +} +_smartctl_vendorattribute() +{ + COMPREPLY=( $( compgen -W 'help 9,minutes 9,seconds 9,halfminutes \ + 9,temp 192,emergencyretractcyclect 193,loadunload \ + 194,10xCelsius 194,unknown 198,offlinescanuncsectorct \ + 200,writeerrorcount 201,detectedtacount 220,temp' -- $cur ) ) +} +_smartctl_firmwarebug() +{ + COMPREPLY=( $( compgen -W 'none samsung samsung2' -- $cur ) ) +} +_smartctl_presets() +{ + COMPREPLY=( $( compgen -W 'use ignore show showall' -- $cur ) ) +} +_smartctl_test() +{ + COMPREPLY=( $( compgen -W 'offline short long conveyance select afterselect,on afterselect,off pending' -- $cur ) ) +} + +_smartctl() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + # --name value style option + case "$prev" in + -q) + _smartctl_quietmode + ;; + -d) + _smartctl_device + return 0 + ;; + -t) + _smartctl_tolerance + return 0 + ;; + -b) + _smartctl_badsum + return 0 + ;; + -r) + _smartctl_report + return 0 + ;; + -s) + _smartctl_feature + return 0 + ;; + -o) + _smartctl_feature + return 0 + ;; + -S) + _smartctl_feature + return 0 + ;; + -l) + _smartctl_log + return 0 + ;; + -v) + _smartctl_vendorattribute + return 0 + ;; + -F) + _smartctl_firmwarebug + return 0 + ;; + -P) + _smartctl_presets + return 0 + ;; + -t) + _smartctl_test + return 0 + ;; + esac + + # --name=value style option + if [[ "$cur" == *=* ]]; then + prev=${cur/=*/} + cur=${cur/*=/} + case "$prev" in + --quietmode) + _smartctl_quietmode + return 0 + ;; + --device) + _smartctl_device + return 0 + ;; + --tolerance) + _smartctl_tolerance + return 0 + ;; + --badsum) + _smartctl_badsum + return 0 + ;; + --report) + _smartctl_report + return 0 + ;; + --smart) + _smartctl_feature + return 0 + ;; + --offlineauto) + _smartctl_feature + return 0 + ;; + --saveauto) + _smartctl_feature + return 0 + ;; + --log) + _smartctl_log + return 0 + ;; + --vendorattribute) + _smartctl_vendorattribute + return 0 + ;; + --firmwarebug) + _smartctl_firmwarebug + return 0 + ;; + --presets) + _smartctl_presets + return 0 + ;; + --test) + _smartctl_test + return 0 + ;; + esac + fi + + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-h --help --usage -V --version \ + --copyright --license-i --info -a --all -q \ + --quietmode= -d --device= -T --tolerance= -b --badsum= \ + -r --report= -s --smart= -o --offlineauto= -S \ + --saveauto= -H --health -c --capabilities -A \ + --attributes -l --log= -v --vendorattribute= -F \ + --firmwarebug= -P --presets= -t --test= -C \ + --captive -X --abort' -- $cur ) ) + else + cur=${cur:=/dev/} + _filedir + fi +} +complete -F _smartctl smartctl +} + +# vncviewer(1) completion +# +have vncviewer && +_vncviewer() +{ + local cur prev + local -a config + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -via) + _known_hosts -a + ;; + *) + # ssh into the the server, find and ping the broadcast address, then + # sort and show the results. + COMPREPLY=( $( ssh -o 'Batchmode yes' $prev \ + "ping -bnc 4 255.255.255.255" 2>/dev/null | \ + awk -F ' ' '{print $4}' | \ + sort -n | uniq | egrep '[0-9]+\.[0-9]+\.' 2>/dev/null ) ) + esac + + return 0 +} && +complete -F _vncviewer vncviewer + +# sysctl(8) completion +# +have sysctl && +_sysctl() +{ + local cur + + COMPREPLY=() + cur=`_get_cword` + + COMPREPLY=( $( compgen -W "$(sysctl -N -a 2>/dev/null)" -- $cur ) ) + + return 0 +} && +complete -F _sysctl sysctl + +# update-rc.d(8) completion +# +# Copyright (C) 2004 Servilio Afre Puentes +# +have update-rc.d && +_update_rc_d() +{ + local cur prev sysvdir services options valid_options + + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + [ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d \ + || sysvdir=/etc/init.d + + services=( $(echo $sysvdir/!(README*|*.sh|*.dpkg*|*.rpm*)) ) + services=( ${services[@]#$sysvdir/} ) + options=( -f -n ) + + if [[ $COMP_CWORD -eq 1 || "$prev" == -* ]]; then + valid_options=( $( \ + echo "${COMP_WORDS[@]} ${options[@]}" \ + | tr " " "\n" \ + | sed -ne "/$( echo "${options[@]}" | sed "s/ /\\|/g" )/p" \ + | sort | uniq -u \ + ) ) + COMPREPLY=( $( compgen -W '${options[@]} ${services[@]}' \ + -X '$( echo ${COMP_WORDS[@]} | tr " " "|" )' -- $cur ) ) + elif [[ "$prev" == ?($( echo ${services[@]} | tr " " "|" )) ]]; then + COMPREPLY=( $( compgen -W 'remove defaults start stop' -- $cur ) ) + elif [[ "$prev" == defaults && "$cur" == [0-9] ]]; then + COMPREPLY=( 0 1 2 3 4 5 6 7 8 9 ) + elif [[ "$prev" == defaults && "$cur" == [sk]?([0-9]) ]]; then + COMPREPLY=( 0 1 2 3 4 5 6 7 8 9 ) + elif [[ "$prev" == defaults && -z "$cur" ]]; then + COMPREPLY=( 0 1 2 3 4 5 6 7 8 9 s k ) + elif [[ "$prev" == ?(start|stop) ]]; then + if [[ "$cur" == [0-9] || -z "$cur" ]]; then + COMPREPLY=( 0 1 2 3 4 5 6 7 8 9 ) + elif [[ "$cur" == [0-9][0-9] ]]; then + COMPREPLY=( $cur ) + else + COMPREPLY=() + fi + elif [[ "$prev" == ?([0-9][0-9]|[0-6S]) ]]; then + if [[ -z "$cur" ]]; then + if [[ $prev == [0-9][0-9] ]]; then + COMPREPLY=( 0 1 2 3 4 5 6 S ) + else + COMPREPLY=( 0 1 2 3 4 5 6 S . ) + fi + elif [[ "$cur" == [0-6S.] ]]; then + COMPREPLY=( $cur ) + else + COMPREPLY=() + fi + elif [[ "$prev" == "." ]]; then + COMPREPLY=( $(compgen -W "start stop" -- $cur) ) + else + COMPREPLY=() + fi + + return 0 +} && +complete -F _update_rc_d update-rc.d + +# invoke-rc.d(8) completion +# +# Copyright (C) 2004 Servilio Afre Puentes +# +have invoke-rc.d && +_invoke_rc_d() +{ + local cur prev sysvdir services options valid_options + + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + [ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d \ + || sysvdir=/etc/init.d + + services=( $(echo $sysvdir/!(README*|*.sh|*.dpkg*|*.rpm*)) ) + services=( ${services[@]#$sysvdir/} ) + options=( --help --quiet --force --try-anyway --disclose-deny --query --no-fallback ) + + if [[ ($COMP_CWORD -eq 1) || ("$prev" == --* ) ]]; then + valid_options=( $( \ + echo ${COMP_WORDS[@]} ${options[@]} \ + | tr " " "\n" \ + | sed -ne "/$( echo ${options[@]} | sed "s/ /\\\\|/g" )/p" \ + | sort | uniq -u \ + ) ) + COMPREPLY=( $( compgen -W '${valid_options[@]} ${services[@]}' -- \ + $cur ) ) + elif [ -x $sysvdir/$prev ]; then + COMPREPLY=( $( compgen -W '`sed -ne "y/|/ /; \ + s/^.*Usage:[ ]*[^ ]*[ ]*{*\([^}\"]*\).*$/\1/p" \ + $sysvdir/$prev`' -- \ + $cur ) ) + else + COMPREPLY=() + fi + + return 0 +} && +complete -F _invoke_rc_d invoke-rc.d + +# minicom(1) completion +# +have minicom && +_minicom() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case $prev in + -@(a|c)) + COMPREPLY=( $( compgen -W 'on off' -- $cur ) ) + return 0 + ;; + -@(S|C)) + _filedir + return 0 + ;; + -P) + COMPREPLY=( $( command ls /dev/tty* ) ) + COMPREPLY=( $( compgen -W '${COMPREPLY[@]} ${COMPREPLY[@]#/dev/}' -- $cur ) ) + return 0 + ;; + esac + + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-s -o -m -M -z -l -L -w -a -t \ + -c -S -d -p -C -T -8' -- $cur ) ) + else + COMPREPLY=( $( command ls /etc/minicom/minirc.* 2>/dev/null | sed -e 's|/etc/minicom/minirc.||' | grep "^$cur" ) ) + fi +} && +complete -F _minicom minicom + +# svn completion +# +have svn && +{ +_svn() +{ + local cur prev commands options command + + COMPREPLY=() + cur=`_get_cword` + + commands='add blame praise annotate ann cat checkout co cleanup commit \ + ci copy cp delete del remove rm diff di export help ? h import \ + info list ls lock log merge mkdir move mv rename ren \ + propdel pdel pd propedit pedit pe propget pget pg \ + proplist plist pl propset pset ps resolved revert \ + status stat st switch sw unlock update up' + + if [[ $COMP_CWORD -eq 1 ]] ; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--version' -- $cur ) ) + else + COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) + fi + else + + prev=${COMP_WORDS[COMP_CWORD-1]} + case $prev in + --config-dir) + _filedir -d + return 0; + ;; + -@(F|-file|-targets)) + _filedir + return 0; + ;; + --encoding) + COMPREPLY=( $( compgen -W \ + '$( iconv --list | sed -e "s@//@@;" )' \ + -- "$cur" ) ) + return 0; + ;; + --@(editor|diff|diff3)-cmd) + COMP_WORDS=(COMP_WORDS[0] $cur) + COMP_CWORD=1 + _command + return 0; + ;; + esac + + command=${COMP_WORDS[1]} + + if [[ "$cur" == -* ]]; then + # possible options for the command + case $command in + add) + options='--auto-props --no-auto-props \ + --force --targets --no-ignore \ + --non-recursive -N -q --quiet' + ;; + @(blame|annotate|ann|praise)) + options='-r --revisions --username \ + --password --no-auth-cache \ + --non-interactive -v \ + --verbose --incremental --xml' + ;; + cat) + options='-r --revision --username \ + --password --no-auth-cache \ + --non-interactive' + ;; + @(checkout|co)) + options='-r --revision -q --quiet -N \ + --non-recursive --username \ + --password --no-auth-cache \ + --non-interactive \ + --ignore-externals' + ;; + cleanup) + options='--diff3-cmd' + ;; + @(commit|ci)) + options='-m --message -F --file \ + --encoding --force-log -q \ + --quiet --non-recursive -N \ + --targets --editor-cmd \ + --username --password \ + --no-auth-cache \ + --non-interactive --no-unlock' + ;; + @(copy|cp)) + options='-m --message -F --file \ + --encoding --force-log -r \ + --revision -q --quiet \ + --editor-cmd -username \ + --password --no-auth-cache \ + --non-interactive' + ;; + @(delete|del|remove|rm)) + options='--force -m --message -F \ + --file --encoding --force-log \ + -q --quiet --targets \ + --editor-cmd -username \ + --password --no-auth-cache \ + --non-interactive' + ;; + @(diff|di)) + options='-r --revision -x --extensions \ + --diff-cmd --no-diff-deleted \ + -N --non-recursive --username \ + --password --no-auth-cache \ + --non-interactive --force \ + --old --new --notice-ancestry' + ;; + export) + options='-r --revision -q --quiet \ + --username --password \ + --no-auth-cache \ + --non-interactive -N \ + --non-recursive --force \ + --native-eol --ignore-externals' + ;; + import) + options='--auto-props --no-auto-props \ + -m --message -F --file \ + --encoding --force-log -q \ + --quiet --non-recursive \ + --no-ignore --editor-cmd \ + --username --password \ + --no-auth-cache \ + --non-interactive' + ;; + info) + options='--username --password \ + --no-auth-cache \ + --non-interactive -r \ + --revision --xml --targets \ + -R --recursive --incremental' + ;; + @(list|ls)) + options='-r --revision -v --verbose -R \ + --recursive --username \ + --password --no-auth-cache \ + --non-interactive \ + --incremental --xml' + ;; + lock) + options='-m --message -F --file \ + --encoding --force-log \ + --targets --force --username \ + --password --no-auth-cache \ + --non-interactive' + ;; + log) + options='-r --revision -v --verbose \ + --targets --username \ + --password --no-auth-cache \ + --non-interactive \ + --stop-on-copy --incremental \ + --xml -q --quiet --limit' + ;; + merge) + options='-r --revision -N \ + --non-recursive -q --quiet \ + --force --dry-run --diff3-cmd \ + --username --password \ + --no-auth-cache \ + --non-interactive \ + --ignore-ancestry' + ;; + mkdir) + options='-m --message -F --file \ + --encoding --force-log -q \ + --quiet --editor-cmd \ + --username --password \ + --no-auth-cache \ + --non-interactive' + ;; + @(move|mv|rename|ren)) + options='-m --message -F --file \ + --encoding --force-log -r \ + --revision -q --quiet \ + --force --editor-cmd \ + --username --password \ + --no-auth-cache \ + --non-interactive' + ;; + @(propdel|pdel|pd)) + options='-q --quiet -R --recursive -r \ + --revision --revprop \ + --username --password \ + --no-auth-cache \ + --non-interactive' + ;; + @(propedit|pedit|pe)) + options='-r --revision --revprop \ + --encoding --editor-cmd \ + --username --password \ + --no-auth-cache \ + --non-interactive --force' + ;; + @(propget|pget|pg)) + options='-R --recursive -r --revision \ + --revprop --strict --username \ + --password --no-auth-cache \ + --non-interactive' + ;; + @(proplist|plist|pl)) + options='-v --verbose -R --recursive \ + -r --revision --revprop -q \ + --quiet --username --password \ + --no-auth-cache \ + --non-interactive' + ;; + @(propset|pset|ps)) + options='-F --file -q --quiet \ + --targets -R --recursive \ + --revprop --encoding \ + --username --password \ + --no-auth-cache \ + --non-interactive -r \ + --revision --force' + ;; + resolved) + options='--targets -R --recursive -q \ + --quiet' + ;; + revert) + options='--targets -R --recursive -q \ + --quiet' + ;; + @(status|stat|st)) + options='-u --show-updates -v \ + --verbose -N --non-recursive \ + -q --quiet --username \ + --password --no-auth-cache \ + --non-interactive --no-ignore \ + --ignore-externals \ + --incremental --xml' + ;; + @(switch|sw)) + options='--relocate -r --revision -N \ + --non-recursive -q --quiet \ + --username --password \ + --no-auth-cache \ + --non-interactive --diff3-cmd' + ;; + unlock) + options='--targets --force --username \ + --password --no-auth-cache \ + --non-interactive' + ;; + @(update|up)) + options='-r --revision -N \ + --non-recursive -q --quiet \ + --username --password \ + --no-auth-cache \ + --non-interactive \ + --diff3-cmd --ignore-externals' + ;; + esac + options="$options --help -h --config-dir" + + COMPREPLY=( $( compgen -W "$options" -- $cur ) ) + else + if [[ "$command" == @(help|h|\?) ]]; then + COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) + else + _filedir + fi + fi + fi + + return 0 +} +complete -F _svn $default svn + +_svnadmin() +{ + local cur prev commands options mode + + COMPREPLY=() + cur=`_get_cword` + + commands='create deltify dump help ? hotcopy list-dblogs \ + list-unused-dblogs load lslocks lstxns recover rmlocks \ + rmtxns setlog verify' + + if [[ $COMP_CWORD -eq 1 ]] ; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--version' -- $cur ) ) + else + COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) + fi + else + prev=${COMP_WORDS[COMP_CWORD-1]} + case $prev in + --config-dir) + _filedir -d + return 0; + ;; + --fs-type) + COMPREPLY=( $( compgen -W 'fsfs bdb' -- $cur ) ) + return 0; + ;; + esac + + command=${COMP_WORDS[1]} + + if [[ "$cur" == -* ]]; then + # possible options for the command + case $command in + create) + options='--bdb-txn-nosync \ + --bdb-log-keep --config-dir \ + --fs-type' + ;; + deltify) + options='-r --revision -q --quiet' + ;; + dump) + options='-r --revision --incremental \ + -q --quiet --deltas' + ;; + hotcopy) + options='--clean-logs' + ;; + load) + options='--ignore-uuid --force-uuid \ + --parent-dir -q --quiet \ + --use-pre-commit-hook \ + --use-post-commit-hook' + ;; + rmtxns) + options='-q --quiet' + ;; + setlog) + options='-r --revision --bypass-hooks' + ;; + esac + + options="$options --help -h" + COMPREPLY=( $( compgen -W "$options" -- $cur ) ) + else + if [[ "$command" == @(help|h|\?) ]]; then + COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) + else + _filedir + fi + fi + fi + + return 0 +} +complete -F _svnadmin $default svnadmin + +_svnlook() +{ + local cur prev commands options mode + + COMPREPLY=() + cur=`_get_cword` + + commands='author cat changed date diff dirs-changed help ? h history \ + info lock log propget pget pg proplist plist pl tree uuid \ + youngest' + + if [[ $COMP_CWORD -eq 1 ]] ; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--version' -- $cur ) ) + else + COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) + fi + else + command=${COMP_WORDS[1]} + + if [[ "$cur" == -* ]]; then + # possible options for the command + case $command in + @(author|cat|date|dirs-changed|info|log)) + options='-r --revision -t \ + --transaction' + ;; + changed) + options='-r --revision -t \ + --transaction --copy-info' + ;; + diff) + options='-r --revision -t \ + --transaction \ + --no-diff-deleted \ + --no-diff-added \ + --diff-copy-from' + ;; + history) + options='-r --revision --show-ids' + ;; + prop@(get|list)) + options='-r --revision -t \ + --transaction --revprop' + ;; + tree) + options='-r --revision -t \ + --transaction --show-ids \ + --full-paths' + ;; + esac + + options="$options --help -h" + COMPREPLY=( $( compgen -W "$options" -- $cur ) ) + else + if [[ "$command" == @(help|h|\?) ]]; then + COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) + else + _filedir + fi + fi + fi + + return 0 +} +complete -F _svnlook $default svnlook +} + +_filedir_xspec() +{ + local IFS cur xspec + + IFS=$'\t\n' + COMPREPLY=() + cur=`_get_cword` + + _expand || return 0 + + # get first exclusion compspec that matches this command + xspec=$( sed -ne $'/^complete .*[ \t]'${1##*/}$'\([ \t]\|$\)/{p;q;}' \ + $BASH_COMPLETION ) + # prune to leave nothing but the -X spec + xspec=${xspec#*-X } + xspec=${xspec%% *} + + local toks=( ) tmp + + while read -r tmp; do + [[ -n $tmp ]] && toks[${#toks[@]}]=$tmp + done < <( compgen -d -- "$(quote_readline "$cur")" ) + + while read -r tmp; do + [[ -n $tmp ]] && toks[${#toks[@]}]=$tmp + done < <( eval compgen -f -X $xspec -- "\$(quote_readline "\$cur")" ) + + COMPREPLY=( "${toks[@]}" ) +} +list=( $( sed -ne '/^# START exclude/,/^# FINISH exclude/p' \ + $BASH_COMPLETION | \ + # read exclusion compspecs + ( + while read line + do + # ignore compspecs that are commented out + if [ "${line#\#}" != "$line" ]; then continue; fi + line=${line%# START exclude*} + line=${line%# FINISH exclude*} + line=${line##*\'} + list=( "${list[@]}" $line ) + done + echo "${list[@]}" + ) + ) ) +# remove previous compspecs +if [ ${#list[@]} -gt 0 ]; then + eval complete -r ${list[@]} + # install new compspecs + eval complete -F _filedir_xspec $filenames "${list[@]}" +fi +unset list + +# source completion directory definitions +if [ -d $BASH_COMPLETION_DIR -a -r $BASH_COMPLETION_DIR -a \ + -x $BASH_COMPLETION_DIR ]; then + for i in $BASH_COMPLETION_DIR/*; do + [[ ${i##*/} != @(*~|*.bak|*.swp|\#*\#|*.dpkg*|.rpm*) ]] && + [ \( -f $i -o -h $i \) -a -r $i ] && . $i + done +fi +unset i + +# source user completion file +[ $BASH_COMPLETION != ~/.bash_completion -a -r ~/.bash_completion ] \ + && . ~/.bash_completion +unset -f have +unset UNAME RELEASE default dirnames filenames have nospace bashdefault \ + plusdirs + +set $BASH_COMPLETION_ORIGINAL_V_VALUE +unset BASH_COMPLETION_ORIGINAL_V_VALUE + +### Local Variables: +### mode: shell-script +### End: diff --git a/examples/complete/bashcc-1.0.1.tar.gz b/examples/complete/bashcc-1.0.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d68043581b0d34255b1e104c2b04be90f4fdfcaa GIT binary patch literal 4609 zcmV+c68`NUiwFq&i#$C517cxwXk%k7F)lDJF)nmrascgH>r>lGmd|JX6+OZ;*a?1K z2vrbgA%x6jHx4PAB$WcjC8RdiqKB^}S%w`Qyl*j9I+_p47g zS5`c>?RvY>YP6eA{+OrL+V1S`?%=c4-rZ@@XKVL4|4yGLt=*mWZo9Sfyz|SGR=fSY zz57J${6X}To@ty|kq}R!IKFq@=-PAS?a!d-r#@Fj{nL-gZp4;9@#N#-Xti6d=iA%g z(|^0u-YMuG-`m@ro##(P>+wkV{_}6H{|!-6y0IY+9m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`EBkO!oBz(r-0)fQ}Zw zx(}|&s#^Wu2ne&-z(E>u3F}pY^kT*3bI+GoSwf%c*X`08jt`c})Dc literal 0 HcmV?d00001 diff --git a/examples/complete/cdfunc b/examples/complete/cdfunc new file mode 100644 index 0000000..439edaf --- /dev/null +++ b/examples/complete/cdfunc @@ -0,0 +1,76 @@ +# cdfunc - example completion function for cd +# +# based on the cd completion function from the bash_completion package +# +# Chet Ramey +# +# Copyright 2011 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +_comp_cd() +{ + local IFS=$' \t\n' # normalize IFS + local cur _skipdot _cdpath + local i j k + + # Tilde expansion, with side effect of expanding tilde to full pathname + case "$2" in + \~*) eval cur="$2" ;; + *) cur=$2 ;; + esac + + # no cdpath or absolute pathname -- straight directory completion + if [[ -z "${CDPATH:-}" ]] || [[ "$cur" == @(./*|../*|/*) ]]; then + # compgen prints paths one per line; could also use while loop + IFS=$'\n' + COMPREPLY=( $(compgen -d -- "$cur") ) + IFS=$' \t\n' + # CDPATH+directories in the current directory if not in CDPATH + else + IFS=$'\n' + _skipdot=false + # preprocess CDPATH to convert null directory names to . + _cdpath=${CDPATH/#:/.:} + _cdpath=${_cdpath//::/:.:} + _cdpath=${_cdpath/%:/:.} + for i in ${_cdpath//:/$'\n'}; do + if [[ $i -ef . ]]; then _skipdot=true; fi + k="${#COMPREPLY[@]}" + for j in $( compgen -d -- "$i/$cur" ); do + COMPREPLY[k++]=${j#$i/} # cut off directory + done + done + $_skipdot || COMPREPLY+=( $(compgen -d -- "$cur") ) + IFS=$' \t\n' + fi + + # variable names if appropriate shell option set and no completions + if shopt -q cdable_vars && [[ ${#COMPREPLY[@]} -eq 0 ]]; then + COMPREPLY=( $(compgen -v -- "$cur") ) + fi + + # append slash to passed directory name that is the only completion. + # readline will not do this if we complete from CDPATH + if [[ ${#COMPREPLY[@]} -eq 1 ]]; then + i=${COMPREPLY[0]} # shorthand + if [[ "$cur" == "$i" ]] && [[ "$i" != "*/" ]]; then + COMPREPLY[0]+=/ + fi + fi + return 0 +} + +complete -o filenames -o nospace -o bashdefault -F _comp_cd cd diff --git a/examples/complete/complete-examples b/examples/complete/complete-examples new file mode 100644 index 0000000..8a0746d --- /dev/null +++ b/examples/complete/complete-examples @@ -0,0 +1,512 @@ +# +# Completion examples +# +# Chet Ramey +# +# Copyright 2002 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# +# This encapsulates the default bash completion code +# call with the word to be completed as $1 +# +# Since programmable completion does not use the bash default completions +# or the readline default of filename completion when the compspec does +# not generate any matches, this may be used as a `last resort' in a +# completion function to mimic the default bash completion behavior. +# +_bash_def_completion () +{ + local h t + COMPREPLY=() + + # command substitution + if [[ "$1" == \$\(* ]]; then + t=${1#??} + COMPREPLY=( $(compgen -c -P '$(' $t) ) + fi + # variables with a leading `${' + if [ ${#COMPREPLY[@]} -eq 0 ] && [[ "$1" == \$\{* ]]; then + t=${1#??} + COMPREPLY=( $(compgen -v -P '${' -S '}' $t) ) + fi + # variables with a leading `$' + if [ ${#COMPREPLY[@]} -eq 0 ] && [[ "$1" == \$* ]]; then + t=${1#?} + COMPREPLY=( $(compgen -v -P '$' $t ) ) + fi + # username expansion + if [ ${#COMPREPLY[@]} -eq 0 ] && [[ "$1" == ~* ]] && [[ "$1" != */* ]]; then + t=${1#?} + COMPREPLY=( $( compgen -u -P '~' $t ) ) + fi + # hostname + if [ ${#COMPREPLY[@]} -eq 0 ] && [[ "$1" == *@* ]]; then + h=${1%%@*} + t=${1#*@} + COMPREPLY=( $( compgen -A hostname -P "${h}@" $t ) ) + fi + # glob pattern + if [ ${#COMPREPLY[@]} -eq 0 ]; then + # sh-style glob pattern + if [[ $1 == *[*?[]* ]]; then + COMPREPLY=( $( compgen -G "$1" ) ) + # ksh-style extended glob pattern - must be complete + elif shopt -q extglob && [[ $1 == *[?*+\!@]\(*\)* ]]; then + COMPREPLY=( $( compgen -G "$1" ) ) + fi + fi + + # final default is filename completion + if [ ${#COMPREPLY[@]} -eq 0 ]; then + COMPREPLY=( $(compgen -f "$1" ) ) + fi +} + +# +# Return 1 if $1 appears to contain a redirection operator. Handles backslash +# quoting (barely). +# +_redir_op() +{ + case "$1" in + *\\'[\<\>]'*) return 1;; + *[\<\>]*) return 0;; + *) return 1;; + esac +} + + +# _redir_test tests the current word ($1) and the previous word ($2) for +# redirection operators and does filename completion on the current word +# if either one contains a redirection operator +_redir_test() +{ + if _redir_op "$1" ; then + COMPREPLY=( $( compgen -f "$1" ) ) + return 0 + elif _redir_op "$2" ; then + COMPREPLY=( $( compgen -f "$1" ) ) + return 0 + fi + return 1 +} + +# optional, but without this you can't use extended glob patterns +shopt -s extglob + +# +# Easy ones for the shell builtins +# +# nothing for: alias, break, continue, dirs, echo, eval, exit, getopts, +# let, logout, popd, printf, pwd, return, shift, suspend, test, times, +# umask +# + +complete -f -- . source +complete -A enabled builtin +complete -d cd + +# this isn't exactly right yet -- needs to skip shell functions and +# do $PATH lookup (or do compgen -c and filter out matches that also +# appear in compgen -A function) +complete -c command + +# could add -S '=', but that currently screws up because readline appends +# a space unconditionally + +complete -v export local readonly +complete -A helptopic help # currently same as builtins + +complete -d pushd + +complete -A shopt shopt + +complete -c type + +complete -a unalias +complete -v unset + +# +# Job control builtins: fg, bg, disown, kill, wait +# kill not done yet +# + +complete -A stopped -P '%' bg +complete -j -P '%' fg jobs disown + +# this is not quite right at this point + +_wait_func () +{ + local cur + cur=${COMP_WORDS[COMP_CWORD]} + + case "$cur" in + %*) COMPREPLY=( $(compgen -A running -P '%' ${cur#?} ) ) ;; + [0-9]*) COMPREPLY=( $(jobs -p | grep ^${cur}) ) ;; + *) COMPREPLY=( $(compgen -A running -P '%') $(jobs -p) ) + ;; + esac +} +complete -F _wait_func wait + +# +# more complicated things, several as yet unimplemented +# + +#complete -F _bind_func bind + +_declare_func() +{ + local cur prev nflag opts + + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + COMPREPLY=() + if (( $COMP_CWORD <= 1 )) || [[ $cur == '-' ]]; then + COMPREPLY=(-a -f -F -i -p -r -t -x) + return 0; + fi + if [[ $cur == '+' ]]; then + COMPREPLY=(+i +t +x) + return 0; + fi + if [[ $prev == '-p' ]]; then + COMPREPLY=( $(compgen -v $cur) ) + return 0; + fi + return 1 +} +complete -F _declare_func declare typeset + +_enable_func() +{ + local cur prev nflag opts + + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + COMPREPLY=() + if (( $COMP_CWORD <= 1 )) || [[ $cur == '-' ]]; then + COMPREPLY=(-a -d -f -n -p -s) + return 0; + fi + if [[ $prev == '-f' ]]; then + COMPREPLY=( $( compgen -f $cur ) ) + return 0; + fi + for opts in "${COMP_WORDS[@]}" ; do + if [[ $opts == -*n* ]]; then nflag=1; fi + done + + if [ -z "$nflag" ] ; then + COMPREPLY=( $( compgen -A enabled $cur ) ) + else + COMPREPLY=( $( compgen -A disabled $cur ) ) + fi + return 0; +} +complete -F _enable_func enable + +_exec_func() +{ + local cur prev + + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + if (( $COMP_CWORD <= 1 )) || [[ $cur == '-' ]]; then + COMPREPLY=(-a -c -l) + return 0; + fi + if [[ $prev != -*a* ]]; then + COMPREPLY=( $( compgen -c $cur ) ) + return 0 + fi + return 1; +} +complete -F _exec_func exec + +_fc_func() +{ + local cur prev + + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + if (( $COMP_CWORD <= 1 )) || [[ $cur == '-' ]]; then + COMPREPLY=(-e -n -l -r -s) + return 0; + fi + if [[ $prev == -*e ]]; then + COMPREPLY=( $(compgen -c $cur) ) + return 0 + fi + return 1 +} +complete -F _fc_func fc + +_hash_func() +{ + local cur prev + + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + if (( $COMP_CWORD <= 1 )) || [[ $cur == '-' ]]; then + COMPREPLY=(-p -r -t) + return 0; + fi + + if [[ $prev == '-p' ]]; then + COMPREPLY=( $( compgen -f $cur ) ) + return 0; + fi + COMPREPLY=( $( compgen -c $cur ) ) + return 0 +} +complete -F _hash_func hash + +_history_func() +{ + local cur prev + + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + COMPREPLY=() + if (( $COMP_CWORD <= 1 )) || [[ $cur == '-' ]]; then + COMPREPLY=(-a -c -d -n -r -w -p -s) + return 0; + fi + if [[ $prev == -[anrw] ]]; then + COMPREPLY=( $( compgen -f $cur ) ) + fi + return 0 +} +complete -F _history_func history + +#complete -F _read_func read + +_set_func () +{ + local cur prev + + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + COMPREPLY=() + + _redir_test "$cur" "$prev" && return 0; + + if (( $COMP_CWORD <= 1 )) || [[ $cur == '-' ]]; then + COMPREPLY=(-a -b -e -f -k -m -n -o -p -t -u -v -x -B -C -H -P --) + return 0; + fi + if [[ $cur == '+' ]]; then + COMPREPLY=(+a +b +e +f +k +m +n +o +p +t +u +v +x +B +C +H +P) + return 0; + fi + if [[ $prev == [+-]o ]]; then + COMPREPLY=( $(compgen -A setopt $cur) ) + return 0; + fi + return 1; +} +complete -F _set_func set + +_trap_func () +{ + local cur + cur=${COMP_WORDS[COMP_CWORD]} + + if (( $COMP_CWORD <= 1 )) || [[ $cur == '-' ]]; then + COMPREPLY=(-l -p) + return 0; + fi + COMPREPLY=( $( compgen -A signal ${cur}) ) + return 0 +} +complete -F _trap_func trap + +# +# meta-completion (completion for complete/compgen) +# +_complete_meta_func() +{ + local cur prev cmd + COMPREPLY=() + + cmd=$1 + + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + _redir_test "$cur" "$prev" && return 0; + + if (( $COMP_CWORD <= 1 )) || [[ "$cur" == '-' ]]; then + case "$cmd" in + complete) COMPREPLY=(-a -b -c -d -e -f -j -k -s -v -u -r -p -A -G -W -P -S -X -F -C);; + compgen) COMPREPLY=(-a -b -c -d -e -f -j -k -s -v -u -A -G -W -P -S -X -F -C);; + esac + return 0 + fi + + if [[ $prev == -A ]]; then + COMPREPLY=(alias arrayvar binding builtin command directory \ +disabled enabled export file 'function' helptopic hostname job keyword \ +running service setopt shopt signal stopped variable) + return 0 + elif [[ $prev == -F ]]; then + COMPREPLY=( $( compgen -A function $cur ) ) + elif [[ $prev == -C ]]; then + COMPREPLY=( $( compgen -c $cur ) ) + else + COMPREPLY=( $( compgen -c $cur ) ) + fi + return 0 +} +complete -F _complete_meta_func complete compgen + +# +# some completions for shell reserved words +# +#complete -c -k time do if then else elif '{' + +# +# external commands +# + +complete -e printenv + +complete -c nohup exec nice eval trace truss strace sotruss gdb + +_make_targets () +{ + local mdef makef gcmd cur prev i + + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + # if prev argument is -f, return possible filename completions. + # we could be a little smarter here and return matches against + # `makefile Makefile *.mk', whatever exists + case "$prev" in + -*f) COMPREPLY=( $(compgen -f $cur ) ); return 0;; + esac + + # if we want an option, return the possible posix options + case "$cur" in + -) COMPREPLY=(-e -f -i -k -n -p -q -r -S -s -t); return 0;; + esac + + # make reads `makefile' before `Makefile' + # GNU make reads `GNUmakefile' before all other makefiles, but we + # check that we're completing `gmake' before checking for it + if [ -f GNUmakefile ] && [ ${COMP_WORDS[0]} == gmake ]; then + mdef=GNUmakefile + elif [ -f makefile ]; then + mdef=makefile + elif [ -f Makefile ]; then + mdef=Makefile + else + mdef=*.mk # local convention + fi + + # before we scan for targets, see if a makefile name was specified + # with -f + for (( i=0; i < ${#COMP_WORDS[@]}; i++ )); do + if [[ ${COMP_WORDS[i]} == -*f ]]; then + eval makef=${COMP_WORDS[i+1]} # eval for tilde expansion + break + fi + done + + [ -z "$makef" ] && makef=$mdef + + # if we have a partial word to complete, restrict completions to + # matches of that word + if [ -n "$2" ]; then gcmd='grep "^$2"' ; else gcmd=cat ; fi + + # if we don't want to use *.mk, we can take out the cat and use + # test -f $makef and input redirection + COMPREPLY=( $(cat $makef 2>/dev/null | awk 'BEGIN {FS=":"} /^[^.# ][^=]*:/ {print $1}' | tr -s ' ' '\012' | sort -u | eval $gcmd ) ) +} +complete -F _make_targets -X '+($*|*.[cho])' make gmake pmake + +_umount_func () +{ + COMPREPLY=( $(mount | awk '{print $1}') ) +} +complete -F _umount_func umount + +_configure_func () +{ + case "$2" in + -*) ;; + *) return ;; + esac + + case "$1" in + \~*) eval cmd=$1 ;; + *) cmd="$1" ;; + esac + + COMPREPLY=( $("$cmd" --help | awk '{if ($1 ~ /--.*/) print $1}' | grep ^"$2" | sort -u) ) +} +complete -F _configure_func configure + +complete -W '"${GROUPS[@]}"' newgrp + +complete -f chown ln more cat +complete -d mkdir rmdir +complete -f strip + +complete -f -X '*.gz' gzip +complete -f -X '*.bz2' bzip2 +complete -f -X '*.Z' compress +complete -f -X '!*.+(gz|tgz|Gz)' gunzip gzcat zcat zmore +complete -f -X '!*.Z' uncompress zmore zcat +complete -f -X '!*.bz2' bunzip2 bzcat +complete -f -X '!*.zip' unzip +complete -f -X '!*.+(gif|jpg|jpeg|GIF|JPG|JPEG|bmp)' xv + +complete -f -X '!*.pl' perl perl5 + +complete -A hostname rsh telnet rlogin ftp ping xping host traceroute nslookup +complete -A hostname rxterm rxterm3 rxvt2 + +complete -u su +complete -g newgrp groupdel groupmod + +complete -f -X '!*.+(ps|PS)' gs gv ghostview psselect pswrap +complete -f -X '!*.+(dvi|DVI)' dvips xdvi dviselect dvitype catdvi +complete -f -X '!*.+(pdf|PDF)' acroread4 +complete -f -X '!*.texi*' makeinfo texi2dvi texi2html +complete -f -X '!*.+(tex|TEX)' tex latex slitex + +complete -f -X '!*.+(mp3|MP3)' mpg123 +complete -f -X '!*.+(htm|html)' links w3m lynx + +# +# other possibilities, left as exercises +# +#complete -F _find_func find +#complete -F _man_func man +#complete -F _stty_func stty diff --git a/examples/functions/array-stuff b/examples/functions/array-stuff new file mode 100644 index 0000000..e6316c7 --- /dev/null +++ b/examples/functions/array-stuff @@ -0,0 +1,122 @@ +# +# Chet Ramey +# +# Copyright 1999 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# usage: reverse arrayname +reverse() +{ + local -a R + local -i i + local rlen temp + + # make r a copy of the array whose name is passed as an arg + eval R=\( \"\$\{$1\[@\]\}\" \) + + # reverse R + rlen=${#R[@]} + + for ((i=0; i < rlen/2; i++ )) + do + temp=${R[i]} + R[i]=${R[rlen-i-1]} + R[rlen-i-1]=$temp + done + + # and assign R back to array whose name is passed as an arg + eval $1=\( \"\$\{R\[@\]\}\" \) +} + +A=(1 2 3 4 5 6 7) +echo "${A[@]}" +reverse A +echo "${A[@]}" +reverse A +echo "${A[@]}" + +# unset last element of A +alen=${#A[@]} +unset A[$alen-1] +echo "${A[@]}" + +# ashift -- like shift, but for arrays + +ashift() +{ + local -a R + local n + + case $# in + 1) n=1 ;; + 2) n=$2 ;; + *) echo "$FUNCNAME: usage: $FUNCNAME array [count]" >&2 + exit 2;; + esac + + # make r a copy of the array whose name is passed as an arg + eval R=\( \"\$\{$1\[@\]\}\" \) + + # shift R + R=( "${R[@]:$n}" ) + + # and assign R back to array whose name is passed as an arg + eval $1=\( \"\$\{R\[@\]\}\" \) +} + +ashift A 2 +echo "${A[@]}" + +ashift A +echo "${A[@]}" + +ashift A 7 +echo "${A[@]}" + +# Sort the members of the array whose name is passed as the first non-option +# arg. If -u is the first arg, remove duplicate array members. +array_sort() +{ + local -a R + local u + + case "$1" in + -u) u=-u ; shift ;; + esac + + if [ $# -eq 0 ]; then + echo "array_sort: argument expected" >&2 + return 1 + fi + + # make r a copy of the array whose name is passed as an arg + eval R=\( \"\$\{$1\[@\]\}\" \) + + # sort R + R=( $( printf "%s\n" "${A[@]}" | sort $u) ) + + # and assign R back to array whose name is passed as an arg + eval $1=\( \"\$\{R\[@\]\}\" \) + return 0 +} + +A=(3 1 4 1 5 9 2 6 5 3 2) +array_sort A +echo "${A[@]}" + +A=(3 1 4 1 5 9 2 6 5 3 2) +array_sort -u A +echo "${A[@]}" diff --git a/examples/functions/array-to-string b/examples/functions/array-to-string new file mode 100644 index 0000000..0d2fbe5 --- /dev/null +++ b/examples/functions/array-to-string @@ -0,0 +1,15 @@ +#! /bin/bash + +# Format: array_to_string vname_of_array vname_of_string separator +array_to_string() +{ + (( ($# < 2) || ($# > 3) )) && { + "$FUNCNAME: usage: $FUNCNAME arrayname stringname [separator]" + return 2 + } + + local array=$1 string=$2 + ((3==$#)) && [[ $3 = ? ]] && local IFS="${3}${IFS}" + eval $string="\"\${$array[*]}\"" + return 0 +} diff --git a/examples/functions/autoload b/examples/functions/autoload new file mode 100644 index 0000000..a563a77 --- /dev/null +++ b/examples/functions/autoload @@ -0,0 +1,111 @@ +# +# An almost ksh-compatible `autoload'. A function declared as `autoload' will +# be read in from a file the same name as the function found by searching the +# $FPATH (which works the same as $PATH), then that definition will be run. +# +# To do this without source support, we define a dummy function that, when +# executed, will load the file (thereby re-defining the function), then +# execute that newly-redefined function with the original arguments. +# +# It's not identical to ksh because ksh apparently does lazy evaluation +# and looks for the file to load from only when the function is referenced. +# This one requires that the file exist when the function is declared as +# `autoload'. +# +# usage: autoload func [func...] +# +# The first cut of this was by Bill Trost, trost@reed.bitnet +# +# Chet Ramey +# chet@ins.CWRU.Edu + +# +# Declare a function ($1) to be autoloaded from a file ($2) when it is first +# called. This defines a `temporary' function that will `.' the file +# containg the real function definition, then execute that new definition with +# the arguments given to this `fake' function. The autoload function defined +# by the file and the file itself *must* be named identically. +# + +aload() +{ + eval $1 '() { . '$2' ; '$1' "$@" ; return $? ; }' +} + +# +# Search $FPATH for a file the same name as the function given as $1, and +# autoload the function from that file. There is no default $FPATH. +# + +autoload() +{ + # + # Save the list of functions; we're going to blow away the arguments + # in a second. If any of the names contain white space, TFB. + # + + local args="$*" + + # + # This should, I think, list the functions marked as autoload and not + # yet defined, but we don't have enough information to do that here. + # + if [ $# -eq 0 ] ; then + echo "usage: autoload function [function...]" >&2 + return 1 + fi + + # + # If there is no $FPATH, there is no work to be done + # + + if [ -z "$FPATH" ] ; then + echo autoload: FPATH not set or null >&2 + return 1 + fi + + # + # This treats FPATH exactly like PATH: a null field anywhere in the + # FPATH is treated the same as the current directory. + # + # The path splitting command is taken from Kernighan and Pike + # + +# fp=$(echo $FPATH | sed 's/^:/.:/ +# s/::/:.:/g +# s/:$/:./ +# s/:/ /g') + + # replaced with builtin mechanisms 2001 Oct 10 + + fp=${FPATH/#:/.:} + fp=${fp//::/:.:} + fp=${fp/%:/:.} + fp=${fp//:/ } + + for FUNC in $args ; do + # + # We're blowing away the arguments to autoload here... + # We have to; there are no arrays (well, there are, but + # this doesn't use them yet). + # + set -- $fp + + while [ $# -ne 0 ] ; do + if [ -f $1/$FUNC ] ; then + break # found it! + fi + shift + done + + if [ $# -eq 0 ] ; then + echo "$FUNC: autoload function not found" >&2 + continue + fi + +# echo auto-loading $FUNC from $1/$FUNC + aload $FUNC $1/$FUNC + done + + return 0 +} diff --git a/examples/functions/autoload.v2 b/examples/functions/autoload.v2 new file mode 100644 index 0000000..e8f3433 --- /dev/null +++ b/examples/functions/autoload.v2 @@ -0,0 +1,192 @@ +# +# An almost ksh-compatible `autoload'. A function declared as `autoload' will +# be read in from a file the same name as the function found by searching the +# $FPATH (which works the same as $PATH), then that definition will be run. +# +# To do this without source support, we define a dummy function that, when +# executed, will load the file (thereby re-defining the function), then +# execute that newly-redefined function with the original arguments. +# +# It's not identical to ksh because ksh apparently does lazy evaluation +# and looks for the file to load from only when the function is referenced. +# This one requires that the file exist when the function is declared as +# `autoload'. +# +# usage: autoload [-pu] [func ...] +# +# options: +# -p print in a format that can be reused as input +# -u unset each function and remove it from the autoload list +# +# The first cut of this was by Bill Trost, trost@reed.edu +# +# Chet Ramey +# chet@ins.CWRU.Edu + +unset _AUTOLOADS +_aindex=0 + +# +# Declare a function ($1) to be autoloaded from a file ($2) when it is first +# called. This defines a `temporary' function that will `.' the file +# containg the real function definition, then execute that new definition with +# the arguments given to this `fake' function. The autoload function defined +# by the file and the file itself *must* be named identically. +# + +_aload() +{ + eval $1 '() { . '$2' ; '$1' "$@" ; return $? ; }' + _autoload_addlist "$1" +} + +_autoload_addlist() +{ + local i=0 + + while (( i < $_aindex )); do + case "${_AUTOLOADS[i]}" in + "$1") return 1 ;; + esac + (( i += 1 )) + done + _AUTOLOADS[_aindex]="$1" + (( _aindex += 1 )) + return 0 +} + +_autoload_dump() +{ + local func + + for func in ${_AUTOLOADS[@]}; do + [ -n "$1" ] && echo -n "autoload " + echo "$func" + done +} + +# Remove $1 from the list of autoloaded functions +_autoload_remove_one() +{ + local i=0 nnl=0 + local -a nlist + + while (( i < _aindex )); do + case "${_AUTOLOADS[i]}" in + "$1") ;; + *) nlist[nnl]="${_AUTOLOADS[i]}" ; (( nnl += 1 ));; + esac + (( i += 1 )) + done + unset _AUTOLOADS _aindex + eval _AUTOLOADS=( ${nlist[@]} ) + _aindex=$nnl +} + +# Remove all function arguments from the list of autoloaded functions +_autoload_remove() +{ + local func i es=0 + + # first unset the autoloaded functions + for func; do + i=0 + while (( i < _aindex )); do + case "${_AUTOLOADS[i]}" in + "$func") unset -f $func ; break ;; + esac + (( i += 1 )) + done + if (( i == _aindex )); then + echo "autoload: $func: not an autoloaded function" >&2 + es=1 + fi + done + + # then rebuild the list of autoloaded functions + for func ; do + _autoload_remove_one "$func" + done + + return $es +} + +# +# Search $FPATH for a file the same name as the function given as $1, and +# autoload the function from that file. There is no default $FPATH. +# + +autoload() +{ + local -a fp + local _autoload_unset nfp i + + if (( $# == 0 )) ; then + _autoload_dump + return 0 + fi + + OPTIND=1 + while getopts pu opt + do + case "$opt" in + p) _autoload_dump printable; return 0;; + u) _autoload_unset=y ;; + *) echo "autoload: usage: autoload [-pu] [function ...]" >&2 + return 1 ;; + esac + done + + shift $(( $OPTIND - 1 )) + + if [ -n "$_autoload_unset" ]; then + _autoload_remove "$@" + return $? + fi + + # + # If there is no $FPATH, there is no work to be done + # + + if [ -z "$FPATH" ] ; then + echo "autoload: FPATH not set or null" >&2 + return 1 + fi + + # + # This treats FPATH exactly like PATH: a null field anywhere in the + # FPATH is treated the same as the current directory. + # + # This turns $FPATH into an array, substituting `.' for `' + # + eval fp=( $( + IFS=':' + set -- ${FPATH} + for p in "$@" ; do echo -n "${p:-.} "; done + ) + ) + + nfp=${#fp[@]} + + for FUNC ; do + i=0; + while (( i < nfp )) ; do + if [ -f ${fp[i]}/$FUNC ] ; then + break # found it! + fi + (( i += 1 )) + done + + if (( i == nfp )) ; then + echo "autoload: $FUNC: autoload function not found" >&2 + es=1 + continue + fi + +# echo auto-loading $FUNC from ${fp[i]}/$FUNC + _aload $FUNC ${fp[i]}/$FUNC + es=0 + done + + return $es +} diff --git a/examples/functions/autoload.v3 b/examples/functions/autoload.v3 new file mode 100644 index 0000000..b1e5dfe --- /dev/null +++ b/examples/functions/autoload.v3 @@ -0,0 +1,125 @@ +#From: Mark Kennedy () +#Message-ID: <35E2B899.63A02DF5@ny.ubs.com> +#Date: Tue, 25 Aug 1998 09:14:01 -0400 +#To: chet@nike.ins.cwru.edu +#Subject: a newer version of the ksh-style 'autoload' + +#enclosed you'll find 'autoload.v3', a version of the autoloader +#that emulates the ksh semantics of delaying the resolution (and loading) of the function +#until its first use. i took the liberty of simplifying the code a bit although it still uses the +#same functional breakdown. i recently went through the exercise of converting +#my ksh-based environment to bash (a very, very pleasant experience) +#and this popped out. + +# the psuedo-ksh autoloader. + +# The first cut of this was by Bill Trost, trost@reed.bitnet. +# The second cut came from Chet Ramey, chet@ins.CWRU.Edu +# The third cut came from Mark Kennedy, mtk@ny.ubs.com. 1998/08/25 + +unset _AUTOLOADS + +_aload() +{ + local func + for func; do + eval $func '() + { + local f=$(_autoload_resolve '$func') + if [[ $f ]]; then + . $f + '$func' "$@" + return $? + else + return 1 + fi + }' + _autoload_addlist $func + done +} + +_autoload_addlist() +{ + local func + + for func in ${_AUTOLOADS[@]}; do + [[ $func = "$1" ]] && return + done + + _AUTOLOADS[${#_AUTOLOADS[@]}]=$1 +} + +_autoload_dump() +{ + local func + + for func in ${_AUTOLOADS[@]}; do + [[ $1 ]] && echo -n "autoload " + echo $func + done +} + +_autoload_remove_one() +{ + local func + local -a NEW_AUTOLOADS + + for func in ${_AUTOLOADS[@]}; do + [[ $func != "$1" ]] && NEW_AUTOLOADS[${#NEW_AUTOLOADS[@]}]=$func + done + + _AUTOLOADS=( ${NEW_AUTOLOADS[@]} ) +} + +_autoload_remove() +{ + local victim func + + for victim; do + for func in ${_AUTOLOADS[@]}; do + [[ $victim = "$func" ]] && unset -f $func && continue 2 + done + echo "autoload: $func: not an autoloaded function" >&2 + done + + for func; do + _autoload_remove_one $func + done +} + +_autoload_resolve() +{ + if [[ ! "$FPATH" ]]; then + echo "autoload: FPATH not set or null" >&2 + return + fi + + local p + + for p in $( (IFS=':'; set -- ${FPATH}; echo "$@") ); do + p=${p:-.} + if [ -f $p/$1 ]; then echo $p/$1; return; fi + done + + echo "autoload: $1: function source file not found" >&2 +} + +autoload() +{ + if (( $# == 0 )) ; then _autoload_dump; return; fi + + local opt OPTIND + + while getopts pu opt + do + case $opt in + p) _autoload_dump printable; return;; + u) shift $((OPTIND-1)); _autoload_remove "$@"; return;; + *) echo "autoload: usage: autoload [-pu] [function ...]" >&2; return;; + esac + done + + shift $(($OPTIND-1)) + + _aload "$@" +} diff --git a/examples/functions/basename b/examples/functions/basename new file mode 100644 index 0000000..a541349 --- /dev/null +++ b/examples/functions/basename @@ -0,0 +1,23 @@ +# Date: Fri, 11 Oct 91 11:22:36 edt +# From: friedman@gnu.ai.mit.edu +# To: bfox@gnu.ai.mit.edu + +# A replacement for basename(1). Not all the systems I use have this +# program. Usage: basename [path] {extension} +function basename () +{ + local path="$1" + local suffix="$2" + local tpath="${path%/}" + + # Strip trailing '/' characters from path (unusual that this should + # ever occur, but basename(1) seems to deal with it.) + while [ "${tpath}" != "${path}" ]; do + tpath="${path}" + path="${tpath%/}" + done + + path="${path##*/}" # Strip off pathname + echo ${path%${suffix}} # Also strip off extension, if any. +} + diff --git a/examples/functions/csh-compat b/examples/functions/csh-compat new file mode 100644 index 0000000..b8dcf8f --- /dev/null +++ b/examples/functions/csh-compat @@ -0,0 +1,48 @@ +# C-shell compatabilty package. +# setenv VAR VALUE +function setenv () +{ + export $1="$2" +} + +function unsetenv () +{ + unset $1 +} + +# Can't write foreach yet. Need pattern matching, and a few extras. +function foreach () { +echo 'Can'\''t do `foreach'\'' yet. Type "help for".' +} + +# Make this work like csh's. Special case "term" and "path". +#set () { +#} + +chdir () +{ + builtin cd "$@" +} + +# alias - convert csh alias commands to bash functions +# from Mohit Aron +# posted to usenet as <4i5p17$bnu@larry.rice.edu> +function alias () +{ + if [ "x$2" = "x" ] + then + declare -f $1 + else + case $2 in + *[#\!]*) + comm=$(echo $2 | sed 's/\\!\*/\"$\@\"/g + s/\\!:\([1-9]\)/\"$\1\"/g + s/#/\\#/g') + ;; + *) + comm="$2 \"\$@\"" ;; + esac + + eval function $1 \(\) "{" command "$comm" "; }" + fi +} diff --git a/examples/functions/dirname b/examples/functions/dirname new file mode 100644 index 0000000..ccb8c84 --- /dev/null +++ b/examples/functions/dirname @@ -0,0 +1,21 @@ +# Date: Fri, 11 Oct 91 11:22:36 edt +# From: friedman@gnu.ai.mit.edu +# To: bfox@gnu.ai.mit.edu + +# A replacement for dirname(1). This one appears less often on some +# systems I use than basename(1), and I really depend on it for some +# things. Usage: dirname [path] +function dirname () +{ + local dir="$1" + local tdir="${dir%/}" + + # Strip trailing '/' characters from dir (unusual that this should + # ever occur, but dirname(1) seems to deal with it.) + while [ "${tdir}" != "${dir}" ]; do + tdir="${dir}" + dir="${tdir%/}" + done + + echo "${dir%/*}" +} diff --git a/examples/functions/exitstat b/examples/functions/exitstat new file mode 100644 index 0000000..f49ebf5 --- /dev/null +++ b/examples/functions/exitstat @@ -0,0 +1,22 @@ +# Contributed by Noah Friedman and Roland McGrath. + +# To be run by the PROMPT_COMMAND variable, so that one can see what +# the exit status of processes are. + +function check_exit_status () +{ + local status="$?" + local signal="" + + if [ ${status} -ne 0 ] && [ ${status} != 128 ]; then + # If process exited by a signal, determine name of signal. + if [ ${status} -gt 128 ]; then + signal="$(builtin kill -l $((${status} - 128)) 2>/dev/null)" + if [ "$signal" ]; then signal="($signal)"; fi + fi + echo "[Exit ${status} ${signal}]" 1>&2 + fi + return 0 +} + +PROMPT_COMMAND=check_exit_status diff --git a/examples/functions/external b/examples/functions/external new file mode 100644 index 0000000..c2e52cd --- /dev/null +++ b/examples/functions/external @@ -0,0 +1,50 @@ +# Contributed by Noah Friedman. + +# To avoid using a function in bash, you can use the `builtin' or +# `command' builtins, but neither guarantees that you use an external +# program instead of a bash builtin if there's a builtin by that name. So +# this function can be used like `command' except that it guarantees the +# program is external by first disabling any builtin by that name. After +# the command is done executing, the state of the builtin is restored. +function external () +{ + local state="" + local exit_status + + if builtin_p "$1"; then + state="builtin" + enable -n "$1" + fi + + command "$@" + exit_status=$? + + if [ "$state" = "builtin" ]; then + enable "$1" + fi + + return ${exit_status} +} + +# What is does is tell you if a particular keyword is currently enabled as +# a shell builtin. It does NOT tell you if invoking that keyword will +# necessarily run the builtin. For that, do something like +# +# test "$(builtin type -type [keyword])" = "builtin" +# +# Note also, that disabling a builtin with "enable -n" will make builtin_p +# return false, since the builtin is no longer available. +function builtin_p () +{ + local word + + set $(builtin type -all -type "$1") + + for word in "$@" ; do + if [ "${word}" = "builtin" ]; then + return 0 + fi + done + + return 1 +} diff --git a/examples/functions/fact b/examples/functions/fact new file mode 100644 index 0000000..97efd49 --- /dev/null +++ b/examples/functions/fact @@ -0,0 +1,13 @@ +# Who said shells can't use recursion? Here is a factorial function. +# You call it with a number as an argument, and it returns the factorial +# of that number. + +fact () +{ + local num=$1; + if [ "$num" = 1 ] ; then + echo 1 + return ; + fi; + echo $(( $num * $(fact $(( $num - 1 )) ) )) +} diff --git a/examples/functions/fstty b/examples/functions/fstty new file mode 100644 index 0000000..5ed594f --- /dev/null +++ b/examples/functions/fstty @@ -0,0 +1,77 @@ +# +# A function that works as a front end for both stty and the `bind' +# builtin, so the tty driver and readline see the same changes +# +# +# Chet Ramey +# +# Copyright 2011 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# +# Convert between the stty ^H control character form and the readline \C-H +# form +# +cvt() +{ + echo "$@" | cat -v | sed 's/\^/\\C-/' +} + +# +# stty front-end. Parses the argument list and creates two command strings, +# one for stty, another for bind. +# +fstty() +{ + local cmd="" bargs="" + local e + + while [ $# -gt 0 ] + do + case "$1" in + -a) cmd="$cmd everything" + ;; + erase) shift; + e=$(cvt "$1") + cmd="$cmd erase $1" + bargs="$bargs '\"$e\": backward-delete-char'" + ;; + kill) shift + e=$(cvt "$1") + cmd="$cmd kill $1" + bargs="$bargs '\"$e\": unix-line-discard'" + ;; + werase) shift; + e=$(cvt "$1") + cmd="$cmd erase $1" + bargs="$bargs '\"$e\": backward-kill-word'" + ;; + lnext) shift; + e=$(cvt "$1") + cmd="$cmd erase $1" + bargs="$bargs '\"$e\": quoted-insert'" + ;; + *) cmd="$cmd $1" + ;; + esac + shift + done + + command stty $cmd + if [ -n "$bargs" ]; then + builtin bind $bargs + fi +} diff --git a/examples/functions/func b/examples/functions/func new file mode 100644 index 0000000..e7696f7 --- /dev/null +++ b/examples/functions/func @@ -0,0 +1,43 @@ +# +# func -- print out definitions for functions named by arguments +# +# usage: func name [name ...] +# +# Chet Ramey +# +# Copyright 1991 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +func() +{ + local status=0 + + if [ $# -eq 0 ] ; then + echo "usage: func name [name...]" 1>&2 + return 1 + fi + + for f + do + if [ "$(builtin type -type $f)" != "function" ] ; then + echo "func: $f: not a function" 1>&2 + status=1 # one failed + continue + fi + builtin type $f | sed 1d + done + return $status +} diff --git a/examples/functions/inetaddr b/examples/functions/inetaddr new file mode 100644 index 0000000..9e72613 --- /dev/null +++ b/examples/functions/inetaddr @@ -0,0 +1,79 @@ +# +# Chet Ramey +# +# Copyright 2002 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# +# inet2hex - Internet address conversion, dotted-decimal to hex +# +inet2hex () +{ + local IFS + + IFS=. + set -- $1 + + if (( $# != 4 )); then + echo "inet2hex: incorrect input format: $1" >&2 + echo "inet2hex: usage: inet2hex XX.XX.XX.XX" >&2 + return 2 + fi + + printf "0x%02x%02x%02x%02x\n" $1 $2 $3 $4 +} + +# +# hex2inet - Internet address conversion, hex to dotted-decimal +# +hex2inet () +{ + local x1 x2 x3 x4 + local rev + + OPTIND=1 + while getopts "r" o + do + case "$o" in + r) rev=true;; + *) echo "hex2inet: usage: hex2inet [-r] [0x]XXXXXXXX" >&2 ; exit 2;; + esac + done + shift $(( $OPTIND - 1 )) + + case "$1" in + 0x*) h=${1#??} ;; + *) h=$1 ;; + esac + + if (( ${#h} != 8 )); then + echo "hex2inet: $h not in inet format" >&2 + echo "hex2inet: usage: hex2inet [0x]XXXXXXXX" >&2 + return 2 + fi + + x1=$(( 0x${h:0:2} )) + x2=$(( 0x${h:2:2} )) + x3=$(( 0x${h:4:2} )) + x4=$(( 0x${h:6:2} )) + + if [ -z "$rev" ] ; then + printf "%d.%d.%d.%d\n" $x1 $x2 $x3 $x4 + else + printf "%d.%d.%d.%d\n" $x4 $x3 $x2 $x1 + fi + return 0 +} diff --git a/examples/functions/inpath b/examples/functions/inpath new file mode 100644 index 0000000..cb4c93d --- /dev/null +++ b/examples/functions/inpath @@ -0,0 +1,14 @@ +inpath() +{ + local PROG + path=$(echo $PATH | sed 's/^:/.:/ + s/::/:.:/g + s/:$/:./ + s/:/ /g') + + for x in $path + do + [ -x $x/$1 ] && { PROG=$x/$1; break; } + done + [ -n "$PROG" ] +} diff --git a/examples/functions/isnum2 b/examples/functions/isnum2 new file mode 100644 index 0000000..583e374 --- /dev/null +++ b/examples/functions/isnum2 @@ -0,0 +1,41 @@ +# +# Chet Ramey +# +# Copyright 1998 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +isnum2() +{ + case "$1" in + '[-+]' | '') return 1;; # empty or bare `-' or `+' + [-+]*[!0-9]*) return 1;; # non-digit with leading sign + [-+]*) return 0;; # OK + *[!0-9]*) return 1;; # non-digit + *) return 0;; # OK + esac +} + +# this one handles floating point +isnum3() +{ + case "$1" in + '') return 1;; # empty + *[!0-9.+-]*) return 1;; # non-digit, +, -, or . + *?[-+]*) return 1;; # sign as second or later char + *.*.*) return 1;; # multiple decimal points + *) return 0;; # OK + esac +} diff --git a/examples/functions/isvalidip b/examples/functions/isvalidip new file mode 100644 index 0000000..0b2dafe --- /dev/null +++ b/examples/functions/isvalidip @@ -0,0 +1,14 @@ +# Thanks to Chris F. A. Johnson for this one +is_validip() +{ + case "$*" in + ""|*[!0-9.]*|*[!0-9]) return 1 ;; + esac + + local IFS=. + set -- $* + + [ $# -eq 4 ] && + [ ${1:-666} -le 255 ] && [ ${2:-666} -le 255 ] && + [ ${3:-666} -le 255 ] && [ ${4:-666} -le 254 ] +} diff --git a/examples/functions/ksh-cd b/examples/functions/ksh-cd new file mode 100644 index 0000000..26b00a9 --- /dev/null +++ b/examples/functions/ksh-cd @@ -0,0 +1,54 @@ +# +# Chet Ramey +# +# Copyright 2001 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# +# ksh-like `cd': cd [-LP] [dir [change]] +# +cd() +{ + OPTIND=1 + while getopts "LP" opt + do + case $opt in + L|P) CDOPTS="$CDOPTS -$opt" ;; + *) echo "$FUNCNAME: usage: $FUNCNAME [-LP] [dir] [change]" >&2 + return 2;; + esac + done + + shift $(( $OPTIND - 1 )) + + case $# in + 0) builtin cd $CDOPTS "$HOME" ;; + 1) builtin cd $CDOPTS "$@" ;; + 2) old="$1" new="$2" + case "$PWD" in + *$old*) ;; + *) echo "${0##*/}: $FUNCNAME: bad substitution" >&2 ; return 1 ;; + esac + + dir=${PWD//$old/$new} + + builtin cd $CDOPTS "$dir" && echo "$PWD" + + ;; + *) echo "${0##*/}: $FUNCNAME: usage: $FUNCNAME [-LP] [dir] [change]" >&2 + return 2 ;; + esac +} diff --git a/examples/functions/ksh-compat-test b/examples/functions/ksh-compat-test new file mode 100644 index 0000000..919d82b --- /dev/null +++ b/examples/functions/ksh-compat-test @@ -0,0 +1,58 @@ +# +# Chet Ramey +# +# Copyright 1999 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# replacements for test/[ that do arithmetic expansion on the operands to +# the arithmetic operators, like ksh. +# +function test() +{ + local -i n1 n3 + case "$#" in + 3) case "$2" in + -lt|-gt|-eq|-ne|-le|-ge) n1=$(( $1 )) + n3=$(( $3 )) + builtin test "$n1" $2 "$n3" + return $?;; + *) builtin test "$@" ;; + esac;; + *) builtin test "$@" ;; + esac +} + +function [() +{ + local -i n1 n3 + case "$#" in + 4) case "$2" in + -lt|-gt|-eq|-ne|-le|-ge) n1=$(( $1 )) + n3=$(( $3 )) + builtin [ "$n1" $2 "$n3" ] + return $?;; + *) builtin [ "$@" ;; + esac;; + *) builtin [ "$@" ;; + esac +} + +q=7 + +[ q -lt 10 ] +echo $? +[ $q -lt 10 ] +echo $? diff --git a/examples/functions/kshenv b/examples/functions/kshenv new file mode 100644 index 0000000..9faba08 --- /dev/null +++ b/examples/functions/kshenv @@ -0,0 +1,246 @@ +# +# .kshenv -- functions and aliases to provide the beginnings of a ksh +# environment for bash. +# +# Chet Ramey +# chet@ins.CWRU.Edu +# + +# +# Copyright 2002 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# +# These are definitions for the ksh compiled-in `exported aliases'. There +# are others, but we already have substitutes for them: "history", "type", +# and "hash". +# +alias r="fc -s" +alias functions="typeset -f" +alias integer="typeset -i" +alias nohup="nohup " +alias command="command " +alias stop="kill -s STOP" +alias redirect="command exec" +alias hist="fc" + +# +# An almost-ksh compatible `whence' command. This is as hairy as it is +# because of the desire to exactly mimic ksh (whose behavior was determined +# empirically). +# +# This depends somewhat on knowing the format of the output of the bash +# `builtin type' command. +# + +whence() +{ + local vflag pflag fflag defarg c + local path + + vflag= aflag= pflag= fflag= + path= + if [ "$#" = "0" ] ; then + echo "whence: usage: whence [-afpv] name..." >&2 + return 2 + fi + + OPTIND=1 + while getopts "avfp" c + do + case "$c" in + a) defarg=-a ;; + f) fflag=1 ;; # no-op + p) pflag=1 ;; + v) vflag=1 ;; + ?) echo "whence: $1: unknown option" >&2 + echo "whence: usage: whence [-afpv] name..." >&2 + return 2 ;; + esac + done + + shift $(( $OPTIND - 1 )) + + if [ "$#" = "0" ] ; then + echo "whence: usage: whence [-afpv] name..." >&2 + return 2 + fi + + for cmd + do + if [ "$vflag" ] ; then + if [ -z "$defarg" ]; then + builtin type $cmd | sed 1q + else + if builtin type $defarg -t $cmd | grep 'function$' >/dev/null 2>&1; then + # HAIRY awk script to suppress + # printing of function body -- could + # do it with sed, but I don't have + # that kind of time + builtin type $defarg $cmd | awk ' +BEGIN {printit = 1;} +$1 == "'$cmd'" && $2 == "()" {printit=0; next; } +/^}$/ { if (printit == 0) printit=1 ; else print $0; next ; } +/.*/ { if (printit) print $0; }' + else + builtin type $defarg $cmd + fi + fi + else + path=$(builtin type $defarg -p $cmd) + if [ "$path" ] ; then + echo $path + else + case "$cmd" in + /*) echo "" ;; + *) case "$(builtin type -t $cmd)" in + "") echo "" ;; + *) echo "$cmd" ;; + esac + ;; + esac + fi + fi + done + return 0 +} + +# +# For real ksh homeboy fanatics, redefine the `type' builtin with a ksh +# version. +# +#type() +#{ +# whence -v "$*" +#} + +# +# ksh-like `cd': cd [-LP] [dir [change]] +# +cd() +{ + OPTIND=1 + while getopts "LP" opt + do + case $opt in + L|P) CDOPTS="$CDOPTS -$opt" ;; + *) echo "$FUNCNAME: usage: $FUNCNAME [-LP] [dir] [change]" >&2 + return 2;; + esac + done + + shift $(( $OPTIND - 1 )) + + case $# in + 0) builtin cd $CDOPTS "$HOME" ;; + 1) builtin cd $CDOPTS "$@" ;; + 2) old="$1" new="$2" + case "$PWD" in + *$old*) ;; + *) echo "${0##*/}: $FUNCNAME: bad substitution" >&2 ; return 1 ;; + esac + + dir=${PWD//$old/$new} + + builtin cd $CDOPTS "$dir" && echo "$PWD" + + ;; + *) echo "${0##*/}: $FUNCNAME: usage: $FUNCNAME [-LP] [dir] [change]" >&2 + return 2 ;; + esac +} + +# +# ksh print emulation +# +# print [-Rnprsu[n]] [-f format] [arg ...] +# +# - end of options +# -R BSD-style -- only accept -n, no escapes +# -n do not add trailing newline +# -p no-op (no coprocesses) +# -r no escapes +# -s print to the history file +# -u n redirect output to fd n +# -f format printf "$format" "$@" +# + +print() +{ + local eflag=-e + local nflag= fflag= c + local fd=1 + + OPTIND=1 + while getopts "fRnprsu:" c + do + case $c in + R) eflag= ;; + r) eflag= ;; + n) nflag=-n ;; + s) sflag=y ;; + f) fflag=y ;; + u) fd=$OPTARG ;; + p) ;; + esac + done + shift $(( $OPTIND - 1 )) + + if [ -n "$fflag" ]; then + builtin printf "$@" >&$fd + return + fi + + case "$sflag" in + y) builtin history -s "$*" ;; + *) builtin echo $eflag $nflag "$@" >&$fd + esac +} + +# substring function +# this function should be equivalent to the substring built-in which was +# eliminated after the 06/29/84 version +substring () +{ + local lpat flag str #local variables + set -f + case $1 in + -l|-L) + flag=$1 + lpat=$2 + shift 2 + ;; + esac + # test for too few or too many arguments + if [ x"$1" = x ] || [ $# -gt 2 ]; then + print -u2 'substring: bad argument count' + return 1 + fi + str=$1 + if [ x"$flag" = x-l ]; then #substring -l lpat + str=${str#$lpat} + elif [ x"$flag" = x-L ]; then + str=${str##$lpat} #substring -L lpat + fi + + if [ x"$2" != x ]; then + echo ${str%$2} + else + echo $str + fi + + return 0 +} diff --git a/examples/functions/login b/examples/functions/login new file mode 100644 index 0000000..3d59683 --- /dev/null +++ b/examples/functions/login @@ -0,0 +1,11 @@ +# replace the `login' and `newgrp' builtins in old bourne shells + +login() +{ + exec login "$@" +} + +newgrp() +{ + exec newgrp "$@" +} diff --git a/examples/functions/notify.bash b/examples/functions/notify.bash new file mode 100644 index 0000000..ed4377c --- /dev/null +++ b/examples/functions/notify.bash @@ -0,0 +1,77 @@ +# +# Chet Ramey +# +# Copyright 1992 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +trap _notify CHLD +NOTIFY_ALL=false +unset NOTIFY_LIST +unalias false + +false() +{ + return 1 +} + +_notify () +{ + local i j + local newlist= + + if $NOTIFY_ALL + then + return # let bash take care of this itself + elif [ -z "$NOTIFY_LIST" ]; then + return + else + set -- $NOTIFY_LIST + for i in "$@" + do + j=$(jobs -n %$i) + if [ -n "$j" ]; then + echo "$j" + jobs -n %$i >/dev/null + else + newlist="newlist $i" + fi + done + NOTIFY_LIST="$newlist" + fi +} + +notify () +{ + local i j + + if [ $# -eq 0 ]; then + NOTIFY_ALL=: + set -b + return + else + for i in "$@" + do + # turn a valid job spec into a job number + j=$(jobs $i) + case "$j" in + [*) j=${j%%]*} + j=${j#[} + NOTIFY_LIST="$NOTIFY_LIST $j" + ;; + esac + done + fi +} diff --git a/examples/functions/seq b/examples/functions/seq new file mode 100644 index 0000000..c1953ee --- /dev/null +++ b/examples/functions/seq @@ -0,0 +1,48 @@ +# +# Chet Ramey +# +# Copyright 1995 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Generate a sequence from m to n, m defaults to 1. + +seq () +{ + declare -i lo hi i # makes local + local _SEQ + + case $# in + 1) seq 1 "$1" ; return $? ;; + 2) lo=$1 hi=$2 + i=$lo _SEQ="" + while let "i <= hi"; do + _SEQ="${_SEQ}$i " + let i+=1 + done + echo "${_SEQ# }" + return 0 ;; + *) echo seq: usage: seq [low] high 1>&2 ; return 2 ;; + esac +} + +# like the APL `iota' function (or at least how I remember it :-) +iota() +{ + case $# in + 1) seq 1 "$1"; return $?;; + *) echo "iota: usage: iota high" 1>&2; return 2;; + esac +} diff --git a/examples/functions/seq2 b/examples/functions/seq2 new file mode 100644 index 0000000..4a54498 --- /dev/null +++ b/examples/functions/seq2 @@ -0,0 +1,56 @@ +# +# Chet Ramey +# +# Copyright 1998 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Generate a sequence from m to n, m defaults to 1. + +seq () +{ + declare -i lo hi i # makes local + local _SEQ INIT COMPARE STEP + + case "$1" in + -r) INIT='i=$hi _SEQ=""' COMPARE='let "i >= $lo"' STEP='let i-=1' ; shift ;; + *) INIT='i=$lo _SEQ=""' COMPARE='let "i <= $hi"' STEP='let i+=1' ;; + esac + + case $# in + 1) lo=1 hi="$1" ;; + 2) lo=$1 hi=$2 ;; + *) echo seq: usage: seq [-r] [low] high 1>&2 ; return 2 ;; + esac + + # equivalent to the as-yet-unimplemented + # for (( "$INIT" ; "$COMPARE" ; "$STEP" )); do _SEQ="${_SEQ}$i "; done + eval "$INIT" + while eval "$COMPARE"; do + _SEQ="${_SEQ}$i " + eval "$STEP" + done + echo "${_SEQ# }" + return 0 +} + +# like the APL `iota' function (or at least how I remember it :-) +iota() +{ + case $# in + 1) seq 1 "$1"; return $?;; + *) echo "iota: usage: iota high" 1>&2; return 2;; + esac +} diff --git a/examples/functions/shcat b/examples/functions/shcat new file mode 100644 index 0000000..c5d3d63 --- /dev/null +++ b/examples/functions/shcat @@ -0,0 +1,7 @@ +shcat() +{ + while read -r line + do + echo "$line" + done +} diff --git a/examples/functions/shcat2 b/examples/functions/shcat2 new file mode 100644 index 0000000..6fe90f4 --- /dev/null +++ b/examples/functions/shcat2 @@ -0,0 +1,19 @@ +shcat() +{ + while read -r line + do + echo "$line" + done +} + +shcat2() +{ + while [ $# -ge 1 ]; do + case "$1" in + -) shcat ;; + *) shcat < "$1" ;; + esac + shift + done + exit 0 +} diff --git a/examples/functions/sort-pos-params b/examples/functions/sort-pos-params new file mode 100644 index 0000000..3fbf7db --- /dev/null +++ b/examples/functions/sort-pos-params @@ -0,0 +1,69 @@ +# +# Chet Ramey +# +# Copyright 2001 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Sort the positional paramters. +# Make sure the positional parameters are passed as arguments to the function. +# If -u is the first arg, remove duplicate array members. +sort_posparams() +{ + local -a R + local u + + case "$1" in + -u) u=-u ; shift ;; + esac + + # if you want the case of no positional parameters to return success, + # remove the error message and return 0 + if [ $# -eq 0 ]; then + echo "$FUNCNAME: argument expected" >&2 + return 1 + fi + + # make R a copy of the positional parameters + R=( "${@}" ) + + # sort R. + R=( $( printf "%s\n" "${R[@]}" | sort $u) ) + + printf "%s\n" "${R[@]}" + return 0 +} + +# will print everything on separate lines +set -- 3 1 4 1 5 9 2 6 5 3 2 +sort_posparams "$@" + +# sets without preserving quoted parameters +set -- $( sort_posparams "$@" ) +echo "$@" +echo $# + +# sets preserving quoted parameters, beware pos params with embedded newlines +set -- 'a b' 'a c' 'x z' + +oifs=$IFS +IFS=$'\n' +set -- $( sort_posparams "$@" ) +IFS="$oifs" + +echo "$@" +echo $# + +sort_posparams diff --git a/examples/functions/substr b/examples/functions/substr new file mode 100644 index 0000000..f19f5d7 --- /dev/null +++ b/examples/functions/substr @@ -0,0 +1,97 @@ +# +# Chet Ramey +# +# Copyright 2002 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# substr -- a function to emulate the ancient ksh builtin +# + +# +# -l == shortest from left +# -L == longest from left +# -r == shortest from right (the default) +# -R == longest from right + +substr() +{ + local flag pat str + local usage="usage: substr -lLrR pat string or substr string pat" + + case "$1" in + -l | -L | -r | -R) + flag="$1" + pat="$2" + shift 2 + ;; + -*) + echo "substr: unknown option: $1" + echo "$usage" + return 1 + ;; + *) + flag="-r" + pat="$2" + ;; + esac + + if [ "$#" -eq 0 ] || [ "$#" -gt 2 ] ; then + echo "substr: bad argument count" + return 2 + fi + + str="$1" + + # + # We don't want -f, but we don't want to turn it back on if + # we didn't have it already + # + case "$-" in + "*f*") + ;; + *) + fng=1 + set -f + ;; + esac + + case "$flag" in + -l) + str="${str#$pat}" # substr -l pat string + ;; + -L) + str="${str##$pat}" # substr -L pat string + ;; + -r) + str="${str%$pat}" # substr -r pat string + ;; + -R) + str="${str%%$pat}" # substr -R pat string + ;; + *) + str="${str%$2}" # substr string pat + ;; + esac + + echo "$str" + + # + # If we had file name generation when we started, re-enable it + # + if [ "$fng" = "1" ] ; then + set +f + fi +} diff --git a/examples/functions/substr2 b/examples/functions/substr2 new file mode 100644 index 0000000..fc21b98 --- /dev/null +++ b/examples/functions/substr2 @@ -0,0 +1,99 @@ +# +# Chet Ramey +# +# Copyright 2002 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# substr -- a function to emulate the ancient ksh builtin +# + +# -l == remove shortest from left +# -L == remove longest from left +# -r == remove shortest from right (the default) +# -R == remove longest from right + +substr() +{ + local flag pat str + local usage="usage: substr -lLrR pat string or substr string pat" + local options="l:L:r:R:" + + OPTIND=1 + while getopts "$options" c + do + case "$c" in + l | L | r | R) + flag="-$c" + pat="$OPTARG" + ;; + '?') + echo "$usage" + return 1 + ;; + esac + done + + if [ "$OPTIND" -gt 1 ] ; then + shift $(( $OPTIND -1 )) + fi + + if [ "$#" -eq 0 ] || [ "$#" -gt 2 ] ; then + echo "substr: bad argument count" + return 2 + fi + + str="$1" + + # + # We don't want -f, but we don't want to turn it back on if + # we didn't have it already + # + case "$-" in + "*f*") + ;; + *) + fng=1 + set -f + ;; + esac + + case "$flag" in + -l) + str="${str#$pat}" # substr -l pat string + ;; + -L) + str="${str##$pat}" # substr -L pat string + ;; + -r) + str="${str%$pat}" # substr -r pat string + ;; + -R) + str="${str%%$pat}" # substr -R pat string + ;; + *) + str="${str%$2}" # substr string pat + ;; + esac + + echo "$str" + + # + # If we had file name generation when we started, re-enable it + # + if [ "$fng" = "1" ] ; then + set +f + fi +} diff --git a/examples/functions/whatis b/examples/functions/whatis new file mode 100644 index 0000000..570c585 --- /dev/null +++ b/examples/functions/whatis @@ -0,0 +1,71 @@ +# +# whatis -- and implementation of the 10th Edition Unix sh builtin `whatis' +# command. +# +# usage: whatis arg [...] +# +# For each argument, whatis prints the associated value as a parameter, +# builtin, function, alias, or executable file as appropriate. In each +# case, the value is printed in a form which would yield the same value +# if typed as input to the shell itself. +# +# +# Chet Ramey +# +# Copyright 1994 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +whatis() +{ + local wusage='usage: whatis arg [arg...]' + local fail=0 + + if [ $# -eq 0 ] ; then + echo "$wusage" + return 1 + fi + + for arg + do + case $(builtin type -type $arg 2>/dev/null) in + "alias") + builtin alias "$arg" + ;; + "function") + builtin type "$arg" | sed 1d + ;; + "builtin") + echo builtin "$arg" + ;; + "file") + builtin type -path "$arg" + ;; + *) + # OK, we could have a variable, or we could have nada + if [ "$(eval echo \${$arg+set})" = "set" ] ; then + # It is a variable, and it is set + echo -n "$arg=" + eval echo '\"'\$$arg'\"' + else + echo whatis: $arg: not found + fail=1 + fi + ;; + esac + done + return $fail +} diff --git a/examples/functions/whence b/examples/functions/whence new file mode 100644 index 0000000..ba27b00 --- /dev/null +++ b/examples/functions/whence @@ -0,0 +1,78 @@ +# +# An almost-ksh compatible `whence' command. This is as hairy as it is +# because of the desire to exactly mimic ksh. +# +# This depends somewhat on knowing the format of the output of the bash +# `builtin type' command. +# +# Chet Ramey +# chet@ins.CWRU.Edu +# +# +# Chet Ramey +# +# Copyright 1994 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +whence() +{ + local vflag= path= + + if [ "$#" = "0" ] ; then + echo "whence: argument expected" + return 1 + fi + case "$1" in + -v) vflag=1 + shift 1 + ;; + -*) echo "whence: bad option: $1" + return 1 + ;; + *) ;; + esac + + if [ "$#" = "0" ] ; then + echo "whence: bad argument count" + return 1 + fi + + for cmd + do + if [ "$vflag" ] ; then + echo $(builtin type $cmd | sed 1q) + else + path=$(builtin type -path $cmd) + if [ "$path" ] ; then + echo $path + else + case "$cmd" in + /*) if [ -x "$cmd" ]; then + echo "$cmd" + fi + ;; + *) case "$(builtin type -type $cmd)" in + "") ;; + *) echo "$cmd" + ;; + esac + ;; + esac + fi + fi + done + return 0 +} diff --git a/examples/functions/which b/examples/functions/which new file mode 100644 index 0000000..f0db290 --- /dev/null +++ b/examples/functions/which @@ -0,0 +1,62 @@ +# +# which - emulation of `which' as it appears in FreeBSD +# +# usage: which [-as] command [command...] +# +# +# Chet Ramey +# +# Copyright 1999 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +which() +{ + local aflag sflag ES a opt + + OPTIND=1 + while builtin getopts as opt ; do + case "$opt" in + a) aflag=-a ;; + s) sflag=1 ;; + ?) echo "which: usage: which [-as] command [command ...]" >&2 + exit 2 ;; + esac + done + + (( $OPTIND > 1 )) && shift $(( $OPTIND - 1 )) + + # without command arguments, exit with status 1 + ES=1 + + # exit status is 0 if all commands are found, 1 if any are not found + for command; do + # if $command is a function, make sure we add -a so type + # will look in $PATH after finding the function + a=$aflag + case "$(builtin type -t $command)" in + "function") a=-a;; + esac + + if [ -n "$sflag" ]; then + builtin type -p $a $command >/dev/null 2>&1 + else + builtin type -p $a $command + fi + ES=$? + done + + return $ES +} diff --git a/examples/loadables/Makefile.in b/examples/loadables/Makefile.in new file mode 100644 index 0000000..99549bf --- /dev/null +++ b/examples/loadables/Makefile.in @@ -0,0 +1,237 @@ +# +# Simple makefile for the sample loadable builtins +# +# Copyright (C) 1996-2009 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# Include some boilerplate Gnu makefile definitions. +prefix = @prefix@ + +exec_prefix = @exec_prefix@ +bindir = @bindir@ +libdir = @libdir@ +infodir = @infodir@ +includedir = @includedir@ + +datarootdir = @datarootdir@ + +topdir = @top_srcdir@ +BUILD_DIR = @BUILD_DIR@ +srcdir = @srcdir@ +VPATH = .:@srcdir@ + +@SET_MAKE@ +CC = @CC@ +RM = rm -f + +SHELL = @MAKE_SHELL@ + +host_os = @host_os@ +host_cpu = @host_cpu@ +host_vendor = @host_vendor@ + +CFLAGS = @CFLAGS@ +LOCAL_CFLAGS = @LOCAL_CFLAGS@ +DEFS = @DEFS@ +LOCAL_DEFS = @LOCAL_DEFS@ + +CPPFLAGS = @CPPFLAGS@ + +BASHINCDIR = ${topdir}/include + +LIBBUILD = ${BUILD_DIR}/lib + +INTL_LIBSRC = ${topdir}/lib/intl +INTL_BUILDDIR = ${LIBBUILD}/intl +INTL_INC = @INTL_INC@ +LIBINTL_H = @LIBINTL_H@ + +CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(LOCAL_CFLAGS) $(CFLAGS) + +# +# These values are generated for configure by ${topdir}/support/shobj-conf. +# If your system is not supported by that script, but includes facilities for +# dynamic loading of shared objects, please update the script and send the +# changes to bash-maintainers@gnu.org. +# +SHOBJ_CC = @SHOBJ_CC@ +SHOBJ_CFLAGS = @SHOBJ_CFLAGS@ +SHOBJ_LD = @SHOBJ_LD@ +SHOBJ_LDFLAGS = @SHOBJ_LDFLAGS@ @LDFLAGS@ +SHOBJ_XLDFLAGS = @SHOBJ_XLDFLAGS@ +SHOBJ_LIBS = @SHOBJ_LIBS@ +SHOBJ_STATUS = @SHOBJ_STATUS@ + +INC = -I. -I.. -I$(topdir) -I$(topdir)/lib -I$(topdir)/builtins \ + -I$(BASHINCDIR) -I$(BUILD_DIR) -I$(LIBBUILD) \ + -I$(BUILD_DIR)/builtins $(INTL_INC) + +.c.o: + $(SHOBJ_CC) $(SHOBJ_CFLAGS) $(CCFLAGS) $(INC) -c -o $@ $< + + +ALLPROG = print truefalse sleep pushd finfo logname basename dirname \ + tty pathchk tee head mkdir rmdir printenv id whoami \ + uname sync push ln unlink realpath strftime mypid +OTHERPROG = necho hello cat + +all: $(SHOBJ_STATUS) + +supported: $(ALLPROG) +others: $(OTHERPROG) + +unsupported: + @echo "Your system (${host_os}) is not supported by the" + @echo "${topdir}/support/shobj-conf script." + @echo "If your operating system provides facilities for dynamic" + @echo "loading of shared objects using the dlopen(3) interface," + @echo "please update the script and re-run configure. + @echo "Please send the changes you made to bash-maintainers@gnu.org" + @echo "for inclusion in future bash releases." + +everything: supported others + +print: print.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ print.o $(SHOBJ_LIBS) + +necho: necho.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ necho.o $(SHOBJ_LIBS) + +hello: hello.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ hello.o $(SHOBJ_LIBS) + +truefalse: truefalse.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ truefalse.o $(SHOBJ_LIBS) + +sleep: sleep.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ sleep.o $(SHOBJ_LIBS) + +finfo: finfo.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ finfo.o $(SHOBJ_LIBS) + +cat: cat.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ cat.o $(SHOBJ_LIBS) + +logname: logname.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ logname.o $(SHOBJ_LIBS) + +basename: basename.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ basename.o $(SHOBJ_LIBS) + +dirname: dirname.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ dirname.o $(SHOBJ_LIBS) + +tty: tty.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ tty.o $(SHOBJ_LIBS) + +pathchk: pathchk.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ pathchk.o $(SHOBJ_LIBS) + +tee: tee.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ tee.o $(SHOBJ_LIBS) + +mkdir: mkdir.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ mkdir.o $(SHOBJ_LIBS) + +rmdir: rmdir.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ rmdir.o $(SHOBJ_LIBS) + +head: head.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ head.o $(SHOBJ_LIBS) + +printenv: printenv.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ printenv.o $(SHOBJ_LIBS) + +id: id.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ id.o $(SHOBJ_LIBS) + +whoami: whoami.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ whoami.o $(SHOBJ_LIBS) + +uname: uname.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ uname.o $(SHOBJ_LIBS) + +sync: sync.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ sync.o $(SHOBJ_LIBS) + +push: push.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ push.o $(SHOBJ_LIBS) + +ln: ln.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ ln.o $(SHOBJ_LIBS) + +unlink: unlink.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ unlink.o $(SHOBJ_LIBS) + +realpath: realpath.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ realpath.o $(SHOBJ_LIBS) + +strftime: strftime.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ strftime.o $(SHOBJ_LIBS) + +mypid: mypid.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ mypid.o $(SHOBJ_LIBS) + +# pushd is a special case. We use the same source that the builtin version +# uses, with special compilation options. +# +pushd.c: ${topdir}/builtins/pushd.def + $(RM) $@ + ${BUILD_DIR}/builtins/mkbuiltins -D ${topdir}/builtins ${topdir}/builtins/pushd.def + +pushd.o: pushd.c + $(RM) $@ + $(SHOBJ_CC) -DHAVE_CONFIG_H -DPUSHD_AND_POPD -DLOADABLE_BUILTIN $(SHOBJ_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(INC) -c -o $@ $< + +pushd: pushd.o + $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ pushd.o $(SHOBJ_LIBS) + +clean: + $(RM) $(ALLPROG) $(OTHERPROG) *.o + -( cd perl && ${MAKE} ${MFLAGS} $@ ) + +mostlyclean: clean + -( cd perl && ${MAKE} ${MFLAGS} $@ ) + +distclean maintainer-clean: clean + $(RM) Makefile pushd.c + -( cd perl && ${MAKE} ${MFLAGS} $@ ) + +print.o: print.c +truefalse.o: truefalse.c +sleep.o: sleep.c +finfo.o: finfo.c +logname.o: logname.c +basename.o: basename.c +dirname.o: dirname.c +tty.o: tty.c +pathchk.o: pathchk.c +tee.o: tee.c +head.o: head.c +rmdir.o: rmdir.c +necho.o: necho.c +hello.o: hello.c +cat.o: cat.c +printenv.o: printenv.c +id.o: id.c +whoami.o: whoami.c +uname.o: uname.c +sync.o: sync.c +push.o: push.c +mkdir.o: mkdir.c +realpath.o: realpath.c +strftime.o: strftime.c +mypid.o: mypid.c diff --git a/examples/loadables/README b/examples/loadables/README new file mode 100644 index 0000000..8a2ac81 --- /dev/null +++ b/examples/loadables/README @@ -0,0 +1,69 @@ +Some examples of ready-to-dynamic-load builtins. Most of the +examples given are reimplementations of standard commands whose +execution time is dominated by process startup time. The +exceptions are sleep, which allows you to sleep for fractions +of a second, finfo, which provides access to the rest of the +elements of the `stat' structure that `test' doesn't let you +see, and pushd/popd/dirs, which allows you to compile them out +of the shell. + +All of the new builtins in ksh93 that bash didn't already have +are included here, as is the ksh `print' builtin. + +The configure script in the top-level source directory uses the +support/shobj-conf script to set the right values in the Makefile, +so you should not need to change the Makefile. If your system +is not supported by support/shobj-conf, and it has the necessary +facilities for building shared objects and support for the +dlopen/dlsyn/dlclose/dlerror family of functions, please make +the necessary changes to support/shobj-conf and send the changes +to bash-maintainers@gnu.org. + +Loadable builtins are loaded into a running shell with + + enable -f filename builtin-name + +enable uses a simple reference-counting scheme to avoid unloading a +shared object that implements more than one loadable builtin before +all loadable builtins implemented in the object are removed. + +Many of the details needed by builtin writers are found in hello.c, +the canonical example. There is no real `builtin writers' programming +guide'. The file template.c provides a template to use for creating +new loadable builtins. + +On Debian GNU/Linux systems, the bash headers are in /usr/include/bash. +The appropriate options are already set in the example Makefile. + +basename.c Return non-directory portion of pathname. +cat.c cat(1) replacement with no options - the way cat was intended. +cut.c cut(1) replacement. +dirname.c Return directory portion of pathname. +finfo.c Print file info. +getconf.c POSIX.2 getconf utility. +getconf.h Replacement definitions for ones the system doesn't provide. +head.c Copy first part of files. +hello.c Obligatory "Hello World" / sample loadable. +id.c POSIX.2 user identity. +ln.c Make links. +logname.c Print login name of current user. +Makefile.in Simple makefile for the sample loadable builtins. +mkdir.c Make directories. +necho.c echo without options or argument interpretation. +pathchk.c Check pathnames for validity and portability. +print.c Loadable ksh-93 style print builtin. +printenv.c Minimal builtin clone of BSD printenv(1). +push.c Anyone remember TOPS-20? +README README +realpath.c Canonicalize pathnames, resolving symlinks. +rmdir.c Remove directory. +sleep.c sleep for fractions of a second. +strftime.c Loadable builtin interface to strftime(3). +sync.c Sync the disks by forcing pending filesystem writes to complete. +tee.c Duplicate standard input. +template.c Example template for loadable builtin. +truefalse.c True and false builtins. +tty.c Return terminal name. +uname.c Print system information. +unlink.c Remove a directory entry. +whoami.c Print out username of current user. diff --git a/examples/loadables/basename.c b/examples/loadables/basename.c new file mode 100644 index 0000000..7ee817f --- /dev/null +++ b/examples/loadables/basename.c @@ -0,0 +1,129 @@ +/* basename - return nondirectory portion of pathname */ + +/* See Makefile for compilation details. */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include "builtins.h" +#include "shell.h" +#include "common.h" + +basename_builtin (list) + WORD_LIST *list; +{ + int slen, sufflen, off; + char *string, *suffix, *fn; + + if (list == 0) + { + builtin_usage (); + return (EX_USAGE); + } + + if (no_options (list)) + return (EX_USAGE); + + string = list->word->word; + suffix = (char *)NULL; + if (list->next) + { + list = list->next; + suffix = list->word->word; + } + + if (list->next) + { + builtin_usage (); + return (EX_USAGE); + } + + slen = strlen (string); + + /* Strip trailing slashes */ + while (slen > 0 && string[slen - 1] == '/') + slen--; + + /* (2) If string consists entirely of slash characters, string shall be + set to a single slash character. In this case, skip steps (3) + through (5). */ + if (slen == 0) + { + fputs ("/\n", stdout); + return (EXECUTION_SUCCESS); + } + + /* (3) If there are any trailing slash characters in string, they + shall be removed. */ + string[slen] = '\0'; + + /* (4) If there are any slash characters remaining in string, the prefix + of string up to an including the last slash character in string + shall be removed. */ + while (--slen >= 0) + if (string[slen] == '/') + break; + + fn = string + slen + 1; + + /* (5) If the suffix operand is present, is not identical to the + characters remaining in string, and is identical to a suffix + of the characters remaining in string, the suffix suffix + shall be removed from string. Otherwise, string shall not be + modified by this step. */ + if (suffix) + { + sufflen = strlen (suffix); + slen = strlen (fn); + if (sufflen < slen) + { + off = slen - sufflen; + if (strcmp (fn + off, suffix) == 0) + fn[off] = '\0'; + } + } + printf ("%s\n", fn); + return (EXECUTION_SUCCESS); +} + +char *basename_doc[] = { + "Return non-directory portion of pathname.", + "", + "The STRING is converted to a filename corresponding to the last", + "pathname component in STRING. If the suffix string SUFFIX is", + "supplied, it is removed.", + (char *)NULL +}; + +/* The standard structure describing a builtin command. bash keeps an array + of these structures. */ +struct builtin basename_struct = { + "basename", /* builtin name */ + basename_builtin, /* function implementing the builtin */ + BUILTIN_ENABLED, /* initial flags for builtin */ + basename_doc, /* array of long documentation strings. */ + "basename string [suffix]", /* usage synopsis */ + 0 /* reserved for internal use */ +}; diff --git a/examples/loadables/cat.c b/examples/loadables/cat.c new file mode 100644 index 0000000..1ce2e2d --- /dev/null +++ b/examples/loadables/cat.c @@ -0,0 +1,120 @@ +/* + * cat replacement + * + * no options - the way cat was intended + */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include +#include + +#include "builtins.h" +#include "shell.h" + +#ifndef errno +extern int errno; +#endif + +extern char *strerror (); +extern char **make_builtin_argv (); + +static int +fcopy(fd) +int fd; +{ + char buf[1024], *s; + int n, w, e; + + while (n = read(fd, buf, sizeof (buf))) { + w = write(1, buf, n); + if (w != n) { + e = errno; + write(2, "cat: write error: ", 18); + s = strerror(e); + write(2, s, strlen(s)); + write(2, "\n", 1); + return 1; + } + } + return 0; +} + +cat_main (argc, argv) +int argc; +char **argv; +{ + int i, fd, r; + char *s; + + if (argc == 1) + return (fcopy(0)); + + for (i = r = 1; i < argc; i++) { + if (argv[i][0] == '-' && argv[i][1] == '\0') + fd = 0; + else { + fd = open(argv[i], O_RDONLY, 0666); + if (fd < 0) { + s = strerror(errno); + write(2, "cat: cannot open ", 17); + write(2, argv[i], strlen(argv[i])); + write(2, ": ", 2); + write(2, s, strlen(s)); + write(2, "\n", 1); + continue; + } + } + r = fcopy(fd); + if (fd != 0) + close(fd); + } + return (r); +} + +cat_builtin(list) +WORD_LIST *list; +{ + char **v; + int c, r; + + v = make_builtin_argv(list, &c); + r = cat_main(c, v); + free(v); + + return r; +} + +char *cat_doc[] = { + "Display files.", + "", + "Read each FILE and display it on the standard output. If any", + "FILE is `-' or if no FILE argument is given, the standard input", + "is read.", + (char *)0 +}; + +struct builtin cat_struct = { + "cat", + cat_builtin, + BUILTIN_ENABLED, + cat_doc, + "cat [-] [file ...]", + 0 +}; diff --git a/examples/loadables/dirname.c b/examples/loadables/dirname.c new file mode 100644 index 0000000..0f30286 --- /dev/null +++ b/examples/loadables/dirname.c @@ -0,0 +1,116 @@ +/* dirname - return directory portion of pathname */ + +/* See Makefile for compilation details. */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include "builtins.h" +#include "shell.h" +#include "common.h" + +dirname_builtin (list) + WORD_LIST *list; +{ + int slen; + char *string; + + if (list == 0 || list->next) + { + builtin_usage (); + return (EX_USAGE); + } + + if (no_options (list)) + return (EX_USAGE); + + string = list->word->word; + slen = strlen (string); + + /* Strip trailing slashes */ + while (slen > 0 && string[slen - 1] == '/') + slen--; + + /* (2) If string consists entirely of slash characters, string shall be + set to a single slash character. In this case, skip steps (3) + through (8). */ + if (slen == 0) + { + fputs ("/\n", stdout); + return (EXECUTION_SUCCESS); + } + + /* (3) If there are any trailing slash characters in string, they + shall be removed. */ + string[slen] = '\0'; + + /* (4) If there are no slash characters remaining in string, string + shall be set to a single period character. In this case, skip + steps (5) through (8). + + (5) If there are any trailing nonslash characters in string, + they shall be removed. */ + + while (--slen >= 0) + if (string[slen] == '/') + break; + + if (slen < 0) + { + fputs (".\n", stdout); + return (EXECUTION_SUCCESS); + } + + /* (7) If there are any trailing slash characters in string, they + shall be removed. */ + while (--slen >= 0) + if (string[slen] != '/') + break; + string[++slen] = '\0'; + + /* (8) If the remaining string is empty, string shall be set to a single + slash character. */ + printf ("%s\n", (slen == 0) ? "/" : string); + return (EXECUTION_SUCCESS); +} + +char *dirname_doc[] = { + "Display directory portion of pathname.", + "", + "The STRING is converted to the name of the directory containing", + "the filename corresponding to the last pathname component in STRING.", + (char *)NULL +}; + +/* The standard structure describing a builtin command. bash keeps an array + of these structures. */ +struct builtin dirname_struct = { + "dirname", /* builtin name */ + dirname_builtin, /* function implementing the builtin */ + BUILTIN_ENABLED, /* initial flags for builtin */ + dirname_doc, /* array of long documentation strings. */ + "dirname string", /* usage synopsis */ + 0 /* reserved for internal use */ +}; diff --git a/examples/loadables/finfo.c b/examples/loadables/finfo.c new file mode 100644 index 0000000..b806ef0 --- /dev/null +++ b/examples/loadables/finfo.c @@ -0,0 +1,620 @@ +/* + * finfo - print file info + * + * Chet Ramey + * chet@po.cwru.edu + */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include "posixstat.h" +#include +#include +#include +#include +#include "posixtime.h" + +#include "bashansi.h" +#include "shell.h" +#include "builtins.h" +#include "common.h" + +#ifndef errno +extern int errno; +#endif + +extern char **make_builtin_argv (); + +static int printst(); +static int printsome(); +static int printfinfo(); +static int finfo_main(); + +extern int sh_optind; +extern char *sh_optarg; +extern char *this_command_name; + +static char *prog; +static int pmask; + +#define OPT_UID 0x00001 +#define OPT_GID 0x00002 +#define OPT_DEV 0x00004 +#define OPT_INO 0x00008 +#define OPT_PERM 0x00010 +#define OPT_LNKNAM 0x00020 +#define OPT_FID 0x00040 +#define OPT_NLINK 0x00080 +#define OPT_RDEV 0x00100 +#define OPT_SIZE 0x00200 +#define OPT_ATIME 0x00400 +#define OPT_MTIME 0x00800 +#define OPT_CTIME 0x01000 +#define OPT_BLKSIZE 0x02000 +#define OPT_BLKS 0x04000 +#define OPT_FTYPE 0x08000 +#define OPT_PMASK 0x10000 +#define OPT_OPERM 0x20000 + +#define OPT_ASCII 0x1000000 + +#define OPTIONS "acdgiflmnopsuACGMP:U" + +static int +octal(s) +char *s; +{ + int r; + + r = *s - '0'; + while (*++s >= '0' && *s <= '7') + r = (r * 8) + (*s - '0'); + return r; +} + +static int +finfo_main(argc, argv) +int argc; +char **argv; +{ + register int i; + int mode, flags, opt; + + sh_optind = 0; /* XXX */ + prog = base_pathname(argv[0]); + if (argc == 1) { + builtin_usage(); + return(1); + } + flags = 0; + while ((opt = sh_getopt(argc, argv, OPTIONS)) != EOF) { + switch(opt) { + case 'a': flags |= OPT_ATIME; break; + case 'A': flags |= OPT_ATIME|OPT_ASCII; break; + case 'c': flags |= OPT_CTIME; break; + case 'C': flags |= OPT_CTIME|OPT_ASCII; break; + case 'd': flags |= OPT_DEV; break; + case 'i': flags |= OPT_INO; break; + case 'f': flags |= OPT_FID; break; + case 'g': flags |= OPT_GID; break; + case 'G': flags |= OPT_GID|OPT_ASCII; break; + case 'l': flags |= OPT_LNKNAM; break; + case 'm': flags |= OPT_MTIME; break; + case 'M': flags |= OPT_MTIME|OPT_ASCII; break; + case 'n': flags |= OPT_NLINK; break; + case 'o': flags |= OPT_OPERM; break; + case 'p': flags |= OPT_PERM; break; + case 'P': flags |= OPT_PMASK; pmask = octal(sh_optarg); break; + case 's': flags |= OPT_SIZE; break; + case 'u': flags |= OPT_UID; break; + case 'U': flags |= OPT_UID|OPT_ASCII; break; + default: builtin_usage (); return(1); + } + } + + argc -= sh_optind; + argv += sh_optind; + + if (argc == 0) { + builtin_usage(); + return(1); + } + + for (i = 0; i < argc; i++) + opt = flags ? printsome (argv[i], flags) : printfinfo(argv[i]); + + return(opt); +} + +static struct stat * +getstat(f) +char *f; +{ + static struct stat st; + int fd, r; + intmax_t lfd; + + if (strncmp(f, "/dev/fd/", 8) == 0) { + if ((legal_number(f + 8, &lfd) == 0) || (int)lfd != lfd) { + builtin_error("%s: invalid fd", f + 8); + return ((struct stat *)0); + } + fd = lfd; + r = fstat(fd, &st); + } else +#ifdef HAVE_LSTAT + r = lstat(f, &st); +#else + r = stat(f, &st); +#endif + if (r < 0) { + builtin_error("%s: cannot stat: %s", f, strerror(errno)); + return ((struct stat *)0); + } + return (&st); +} + +static int +printfinfo(f) +char *f; +{ + struct stat *st; + + st = getstat(f); + return (st ? printst(st) : 1); +} + +static int +getperm(m) +int m; +{ + return (m & (S_IRWXU|S_IRWXG|S_IRWXO|S_ISUID|S_ISGID)); +} + +static int +perms(m) +int m; +{ + char ubits[4], gbits[4], obits[4]; /* u=rwx,g=rwx,o=rwx */ + int i; + + i = 0; + if (m & S_IRUSR) + ubits[i++] = 'r'; + if (m & S_IWUSR) + ubits[i++] = 'w'; + if (m & S_IXUSR) + ubits[i++] = 'x'; + ubits[i] = '\0'; + + i = 0; + if (m & S_IRGRP) + gbits[i++] = 'r'; + if (m & S_IWGRP) + gbits[i++] = 'w'; + if (m & S_IXGRP) + gbits[i++] = 'x'; + gbits[i] = '\0'; + + i = 0; + if (m & S_IROTH) + obits[i++] = 'r'; + if (m & S_IWOTH) + obits[i++] = 'w'; + if (m & S_IXOTH) + obits[i++] = 'x'; + obits[i] = '\0'; + + if (m & S_ISUID) + ubits[2] = (m & S_IXUSR) ? 's' : 'S'; + if (m & S_ISGID) + gbits[2] = (m & S_IXGRP) ? 's' : 'S'; + if (m & S_ISVTX) + obits[2] = (m & S_IXOTH) ? 't' : 'T'; + + printf ("u=%s,g=%s,o=%s", ubits, gbits, obits); +} + +static int +printmode(mode) +int mode; +{ + if (S_ISBLK(mode)) + printf("S_IFBLK "); + if (S_ISCHR(mode)) + printf("S_IFCHR "); + if (S_ISDIR(mode)) + printf("S_IFDIR "); + if (S_ISREG(mode)) + printf("S_IFREG "); + if (S_ISFIFO(mode)) + printf("S_IFIFO "); + if (S_ISLNK(mode)) + printf("S_IFLNK "); + if (S_ISSOCK(mode)) + printf("S_IFSOCK "); +#ifdef S_ISWHT + if (S_ISWHT(mode)) + printf("S_ISWHT "); +#endif + perms(getperm(mode)); + printf("\n"); +} + +static int +printst(st) +struct stat *st; +{ + struct passwd *pw; + struct group *gr; + char *owner; + int ma, mi, d; + + ma = major (st->st_rdev); + mi = minor (st->st_rdev); +#if defined (makedev) + d = makedev (ma, mi); +#else + d = st->st_rdev & 0xFF; +#endif + printf("Device (major/minor): %d (%d/%d)\n", d, ma, mi); + + printf("Inode: %d\n", (int) st->st_ino); + printf("Mode: (%o) ", (int) st->st_mode); + printmode((int) st->st_mode); + printf("Link count: %d\n", (int) st->st_nlink); + pw = getpwuid(st->st_uid); + owner = pw ? pw->pw_name : "unknown"; + printf("Uid of owner: %d (%s)\n", (int) st->st_uid, owner); + gr = getgrgid(st->st_gid); + owner = gr ? gr->gr_name : "unknown"; + printf("Gid of owner: %d (%s)\n", (int) st->st_gid, owner); + printf("Device type: %d\n", (int) st->st_rdev); + printf("File size: %ld\n", (long) st->st_size); + printf("File last access time: %s", ctime (&st->st_atime)); + printf("File last modify time: %s", ctime (&st->st_mtime)); + printf("File last status change time: %s", ctime (&st->st_ctime)); + fflush(stdout); + return(0); +} + +static int +printsome(f, flags) +char *f; +int flags; +{ + struct stat *st; + struct passwd *pw; + struct group *gr; + int p; + char *b; + + st = getstat(f); + if (st == NULL) + return (1); + + /* Print requested info */ + if (flags & OPT_ATIME) { + if (flags & OPT_ASCII) + printf("%s", ctime(&st->st_atime)); + else + printf("%ld\n", st->st_atime); + } else if (flags & OPT_MTIME) { + if (flags & OPT_ASCII) + printf("%s", ctime(&st->st_mtime)); + else + printf("%ld\n", st->st_mtime); + } else if (flags & OPT_CTIME) { + if (flags & OPT_ASCII) + printf("%s", ctime(&st->st_ctime)); + else + printf("%ld\n", st->st_ctime); + } else if (flags & OPT_DEV) + printf("%d\n", st->st_dev); + else if (flags & OPT_INO) + printf("%d\n", st->st_ino); + else if (flags & OPT_FID) + printf("%d:%ld\n", st->st_dev, st->st_ino); + else if (flags & OPT_NLINK) + printf("%d\n", st->st_nlink); + else if (flags & OPT_LNKNAM) { +#ifdef S_ISLNK + b = xmalloc(4096); + p = readlink(f, b, 4096); + if (p >= 0 && p < 4096) + b[p] = '\0'; + else { + p = errno; + strcpy(b, prog); + strcat(b, ": "); + strcat(b, strerror(p)); + } + printf("%s\n", b); + free(b); +#else + printf("%s\n", f); +#endif + } else if (flags & OPT_PERM) { + perms(st->st_mode); + printf("\n"); + } else if (flags & OPT_OPERM) + printf("%o\n", getperm(st->st_mode)); + else if (flags & OPT_PMASK) + printf("%o\n", getperm(st->st_mode) & pmask); + else if (flags & OPT_UID) { + pw = getpwuid(st->st_uid); + if (flags & OPT_ASCII) + printf("%s\n", pw ? pw->pw_name : "unknown"); + else + printf("%d\n", st->st_uid); + } else if (flags & OPT_GID) { + gr = getgrgid(st->st_gid); + if (flags & OPT_ASCII) + printf("%s\n", gr ? gr->gr_name : "unknown"); + else + printf("%d\n", st->st_gid); + } else if (flags & OPT_SIZE) + printf("%ld\n", (long) st->st_size); + + return (0); +} + +#ifndef NOBUILTIN +int +finfo_builtin(list) + WORD_LIST *list; +{ + int c, r; + char **v; + WORD_LIST *l; + + v = make_builtin_argv (list, &c); + r = finfo_main (c, v); + free (v); + + return r; +} + +static char *finfo_doc[] = { + "Display information about file attributes.", + "", + "Display information about each FILE. Only single operators should", + "be supplied. If no options are supplied, a summary of the info", + "available about each FILE is printed. If FILE is of the form", + "/dev/fd/XX, file descriptor XX is described. Operators, if supplied,", + "have the following meanings:", + "", + " -a last file access time", + " -A last file access time in ctime format", + " -c last file status change time", + " -C last file status change time in ctime format", + " -m last file modification time", + " -M last file modification time in ctime format", + " -d device", + " -i inode", + " -f composite file identifier (device:inode)", + " -g gid of owner", + " -G group name of owner", + " -l name of file pointed to by symlink", + " -n link count", + " -o permissions in octal", + " -p permissions in ascii", + " -P mask permissions ANDed with MASK (like with umask)", + " -s file size in bytes", + " -u uid of owner", + " -U user name of owner", + (char *)0 +}; + +struct builtin finfo_struct = { + "finfo", + finfo_builtin, + BUILTIN_ENABLED, + finfo_doc, + "finfo [-acdgiflmnopsuACGMPU] file [file...]", + 0 +}; +#endif + +#ifdef NOBUILTIN +#if defined (PREFER_STDARG) +# include +#else +# if defined (PREFER_VARARGS) +# include +# endif +#endif + +char *this_command_name; + +main(argc, argv) +int argc; +char **argv; +{ + this_command_name = argv[0]; + exit(finfo_main(argc, argv)); +} + +void +builtin_usage() +{ + fprintf(stderr, "%s: usage: %s [-%s] [file ...]\n", prog, OPTIONS); +} + +#ifndef HAVE_STRERROR +char * +strerror(e) +int e; +{ + static char ebuf[40]; + extern int sys_nerr; + extern char *sys_errlist[]; + + if (e < 0 || e > sys_nerr) { + sprintf(ebuf,"Unknown error code %d", e); + return (&ebuf[0]); + } + return (sys_errlist[e]); +} +#endif + +char * +xmalloc(s) +size_t s; +{ + char *ret; + extern char *malloc(); + + ret = malloc(s); + if (ret) + return (ret); + fprintf(stderr, "%s: cannot malloc %d bytes\n", prog, s); + exit(1); +} + +char * +base_pathname(p) +char *p; +{ + char *t; + + if (t = strrchr(p, '/')) + return(++t); + return(p); +} + +int +legal_number (string, result) + char *string; + long *result; +{ + int sign; + long value; + + sign = 1; + value = 0; + + if (result) + *result = 0; + + /* Skip leading whitespace characters. */ + while (whitespace (*string)) + string++; + + if (!*string) + return (0); + + /* We allow leading `-' or `+'. */ + if (*string == '-' || *string == '+') + { + if (!digit (string[1])) + return (0); + + if (*string == '-') + sign = -1; + + string++; + } + + while (digit (*string)) + { + if (result) + value = (value * 10) + digit_value (*string); + string++; + } + + /* Skip trailing whitespace, if any. */ + while (whitespace (*string)) + string++; + + /* Error if not at end of string. */ + if (*string) + return (0); + + if (result) + *result = value * sign; + + return (1); +} + +int sh_optind; +char *sh_optarg; +int sh_opterr; + +extern int optind; +extern char *optarg; + +int +sh_getopt(c, v, o) +int c; +char **v, *o; +{ + int r; + + r = getopt(c, v, o); + sh_optind = optind; + sh_optarg = optarg; + return r; +} + +#if defined (USE_VARARGS) +void +#if defined (PREFER_STDARG) +builtin_error (const char *format, ...) +#else +builtin_error (format, va_alist) + const char *format; + va_dcl +#endif +{ + va_list args; + + if (this_command_name && *this_command_name) + fprintf (stderr, "%s: ", this_command_name); + +#if defined (PREFER_STDARG) + va_start (args, format); +#else + va_start (args); +#endif + + vfprintf (stderr, format, args); + va_end (args); + fprintf (stderr, "\n"); +} +#else +void +builtin_error (format, arg1, arg2, arg3, arg4, arg5) + char *format, *arg1, *arg2, *arg3, *arg4, *arg5; +{ + if (this_command_name && *this_command_name) + fprintf (stderr, "%s: ", this_command_name); + + fprintf (stderr, format, arg1, arg2, arg3, arg4, arg5); + fprintf (stderr, "\n"); + fflush (stderr); +} +#endif /* !USE_VARARGS */ + +#endif diff --git a/examples/loadables/head.c b/examples/loadables/head.c new file mode 100644 index 0000000..22cf6ab --- /dev/null +++ b/examples/loadables/head.c @@ -0,0 +1,164 @@ +/* head - copy first part of files. */ + +/* See Makefile for compilation details. */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" +#include "posixstat.h" +#include "filecntl.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" + +#include +#include +#include "chartypes.h" + +#include "builtins.h" +#include "shell.h" +#include "bashgetopt.h" +#include "common.h" + +#if !defined (errno) +extern int errno; +#endif + +static void +munge_list (list) + WORD_LIST *list; +{ + WORD_LIST *l, *nl; + WORD_DESC *wd; + char *arg; + + for (l = list; l; l = l->next) + { + arg = l->word->word; + if (arg[0] != '-' || arg[1] == '-' || (DIGIT(arg[1]) == 0)) + return; + /* We have -[0-9]* */ + wd = make_bare_word (arg+1); + nl = make_word_list (wd, l->next); + l->word->word[1] = 'n'; + l->word->word[2] = '\0'; + l->next = nl; + l = nl; /* skip over new argument */ + } +} + +static int +file_head (fp, cnt) + FILE *fp; + int cnt; +{ + int ch; + + while (cnt--) + { + while ((ch = getc (fp)) != EOF) + { + if (putchar (ch) == EOF) + { + builtin_error ("write error: %s", strerror (errno)); + return EXECUTION_FAILURE; + } + if (ch == '\n') + break; + } + } +} + +head_builtin (list) + WORD_LIST *list; +{ + int nline, opt, rval; + WORD_LIST *l; + FILE *fp; + + char *t; + + munge_list (list); /* change -num into -n num */ + + reset_internal_getopt (); + nline = 10; + while ((opt = internal_getopt (list, "n:")) != -1) + { + switch (opt) + { + case 'n': + nline = atoi (list_optarg); + if (nline <= 0) + { + builtin_error ("bad line count: %s", list_optarg); + return (EX_USAGE); + } + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + if (list == 0) + return (file_head (stdin, nline)); + + for (rval = EXECUTION_SUCCESS, opt = 1, l = list; l; l = l->next) + { + fp = fopen (l->word->word, "r"); + if (fp == NULL) + { + builtin_error ("%s: %s", l->word->word, strerror (errno)); + continue; + } + if (list->next) /* more than one file */ + { + printf ("%s==> %s <==\n", opt ? "" : "\n", l->word->word); + opt = 0; + } + rval = file_head (fp, nline); + fclose (fp); + } + + return (rval); +} + +char *head_doc[] = { + "Display lines from beginning of file.", + "", + "Copy the first N lines from the input files to the standard output.", + "N is supplied as an argument to the `-n' option. If N is not given,", + "the first ten lines are copied.", + (char *)NULL +}; + +struct builtin head_struct = { + "head", /* builtin name */ + head_builtin, /* function implementing the builtin */ + BUILTIN_ENABLED, /* initial flags for builtin */ + head_doc, /* array of long documentation strings. */ + "head [-n num] [file ...]", /* usage synopsis; becomes short_doc */ + 0 /* reserved for internal use */ +}; diff --git a/examples/loadables/hello.c b/examples/loadables/hello.c new file mode 100644 index 0000000..643156c --- /dev/null +++ b/examples/loadables/hello.c @@ -0,0 +1,82 @@ +/* Sample builtin to be dynamically loaded with enable -f and create a new + builtin. */ + +/* See Makefile for compilation details. */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include + +#include "builtins.h" +#include "shell.h" +#include "bashgetopt.h" + +/* A builtin `xxx' is normally implemented with an `xxx_builtin' function. + If you're converting a command that uses the normal Unix argc/argv + calling convention, use argv = make_builtin_argv (list, &argc) and call + the original `main' something like `xxx_main'. Look at cat.c for an + example. + + Builtins should use internal_getopt to parse options. It is the same as + getopt(3), but it takes a WORD_LIST *. Look at print.c for an example + of its use. + + If the builtin takes no options, call no_options(list) before doing + anything else. If it returns a non-zero value, your builtin should + immediately return EX_USAGE. Look at logname.c for an example. + + A builtin command returns EXECUTION_SUCCESS for success and + EXECUTION_FAILURE to indicate failure. */ +int +hello_builtin (list) + WORD_LIST *list; +{ + printf("hello world\n"); + fflush (stdout); + return (EXECUTION_SUCCESS); +} + +/* An array of strings forming the `long' documentation for a builtin xxx, + which is printed by `help xxx'. It must end with a NULL. By convention, + the first line is a short description. */ +char *hello_doc[] = { + "Sample builtin.", + "", + "this is the long doc for the sample hello builtin", + (char *)NULL +}; + +/* The standard structure describing a builtin command. bash keeps an array + of these structures. The flags must include BUILTIN_ENABLED so the + builtin can be used. */ +struct builtin hello_struct = { + "hello", /* builtin name */ + hello_builtin, /* function implementing the builtin */ + BUILTIN_ENABLED, /* initial flags for builtin */ + hello_doc, /* array of long documentation strings. */ + "hello", /* usage synopsis; becomes short_doc */ + 0 /* reserved for internal use */ +}; + diff --git a/examples/loadables/id.c b/examples/loadables/id.c new file mode 100644 index 0000000..8773349 --- /dev/null +++ b/examples/loadables/id.c @@ -0,0 +1,328 @@ +/* + * id - POSIX.2 user identity + * + * (INCOMPLETE -- supplementary groups for other users not yet done) + * + * usage: id [-Ggu] [-nr] [user] + * + * The default output format looks something like: + * uid=xxx(chet) gid=xx groups=aa(aname), bb(bname), cc(cname) + */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include +#include +#include "bashtypes.h" +#include +#include +#include "bashansi.h" + +#ifdef HAVE_LIMITS_H +# include +#else +# include +#endif + +#if !defined (HAVE_GETPW_DECLS) +extern struct passwd *getpwuid (); +#endif +extern struct group *getgrgid (); + +#include "shell.h" +#include "builtins.h" +#include "stdc.h" +#include "common.h" +#include "bashgetopt.h" + +#define ID_ALLGROUPS 0x001 /* -G */ +#define ID_GIDONLY 0x002 /* -g */ +#define ID_USENAME 0x004 /* -n */ +#define ID_USEREAL 0x008 /* -r */ +#define ID_USERONLY 0x010 /* -u */ + +#define ID_FLAGSET(s) ((id_flags & (s)) != 0) + +static int id_flags; + +static uid_t ruid, euid; +static gid_t rgid, egid; + +static char *id_user; + +static int inituser (); + +static int id_pruser (); +static int id_prgrp (); +static int id_prgroups (); +static int id_prall (); + +int +id_builtin (list) + WORD_LIST *list; +{ + int opt; + char *user; + + id_flags = 0; + reset_internal_getopt (); + while ((opt = internal_getopt (list, "Ggnru")) != -1) + { + switch (opt) + { + case 'G': id_flags |= ID_ALLGROUPS; break; + case 'g': id_flags |= ID_GIDONLY; break; + case 'n': id_flags |= ID_USENAME; break; + case 'r': id_flags |= ID_USEREAL; break; + case 'u': id_flags |= ID_USERONLY; break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + user = list ? list->word->word : (char *)NULL; + + /* Check for some invalid option combinations */ + opt = ID_FLAGSET (ID_ALLGROUPS) + ID_FLAGSET (ID_GIDONLY) + ID_FLAGSET (ID_USERONLY); + if (opt > 1 || (opt == 0 && ((id_flags & (ID_USEREAL|ID_USENAME)) != 0))) + { + builtin_usage (); + return (EX_USAGE); + } + + if (list && list->next) + { + builtin_usage (); + return (EX_USAGE); + } + + if (inituser (user) < 0) + return (EXECUTION_FAILURE); + + opt = 0; + if (id_flags & ID_USERONLY) + opt += id_pruser ((id_flags & ID_USEREAL) ? ruid : euid); + else if (id_flags & ID_GIDONLY) + opt += id_prgrp ((id_flags & ID_USEREAL) ? rgid : egid); + else if (id_flags & ID_ALLGROUPS) + opt += id_prgroups (user); + else + opt += id_prall (user); + putchar ('\n'); + fflush (stdout); + + return (opt == 0 ? EXECUTION_SUCCESS : EXECUTION_FAILURE); +} + +static int +inituser (uname) + char *uname; +{ + struct passwd *pwd; + + if (uname) + { + pwd = getpwnam (uname); + if (pwd == 0) + { + builtin_error ("%s: no such user", uname); + return -1; + } + ruid = euid = pwd->pw_uid; + rgid = egid = pwd->pw_gid; + } + else + { + ruid = current_user.uid; + euid = current_user.euid; + rgid = current_user.gid; + egid = current_user.egid; + } + return 0; +} + +/* Print the name or value of user ID UID. */ +static int +id_pruser (uid) + int uid; +{ + struct passwd *pwd = NULL; + int r; + + r = 0; + if (id_flags & ID_USENAME) + { + pwd = getpwuid (uid); + if (pwd == NULL) + r = 1; + } + if (pwd) + printf ("%s", pwd->pw_name); + else + printf ("%u", (unsigned) uid); + + return r; +} + +/* Print the name or value of group ID GID. */ + +static int +id_prgrp (gid) + int gid; +{ + struct group *grp = NULL; + int r; + + r = 0; + if (id_flags & ID_USENAME) + { + grp = getgrgid (gid); + if (grp == NULL) + r = 1; + } + + if (grp) + printf ("%s", grp->gr_name); + else + printf ("%u", (unsigned) gid); + + return r; +} + +static int +id_prgroups (uname) + char *uname; +{ + int *glist, ng, i, r; + + r = 0; + id_prgrp (rgid); + if (egid != rgid) + { + putchar (' '); + id_prgrp (egid); + } + + if (uname) + { + builtin_error ("supplementary groups for other users not yet implemented"); + glist = (int *)NULL; + ng = 0; + r = 1; + } + else + glist = get_group_array (&ng); + + for (i = 0; i < ng; i++) + if (glist[i] != rgid && glist[i] != egid) + { + putchar (' '); + id_prgrp (glist[i]); + } + + return r; +} + +static int +id_prall (uname) + char *uname; +{ + int r, i, ng, *glist; + struct passwd *pwd; + struct group *grp; + + r = 0; + printf ("uid=%u", (unsigned) ruid); + pwd = getpwuid (ruid); + if (pwd == NULL) + r = 1; + else + printf ("(%s)", pwd->pw_name); + + printf (" gid=%u", (unsigned) rgid); + grp = getgrgid (rgid); + if (grp == NULL) + r = 1; + else + printf ("(%s)", grp->gr_name); + + if (euid != ruid) + { + printf (" euid=%u", (unsigned) euid); + pwd = getpwuid (euid); + if (pwd == NULL) + r = 1; + else + printf ("(%s)", pwd->pw_name); + } + + if (egid != rgid) + { + printf (" egid=%u", (unsigned) egid); + grp = getgrgid (egid); + if (grp == NULL) + r = 1; + else + printf ("(%s)", grp->gr_name); + } + + if (uname) + { + builtin_error ("supplementary groups for other users not yet implemented"); + glist = (int *)NULL; + ng = 0; + r = 1; + } + else + glist = get_group_array (&ng); + + if (ng > 0) + printf (" groups="); + for (i = 0; i < ng; i++) + { + if (i > 0) + printf (", "); + printf ("%u", (unsigned) glist[i]); + grp = getgrgid (glist[i]); + if (grp == NULL) + r = 1; + else + printf ("(%s)", grp->gr_name); + } + + return r; +} + +char *id_doc[] = { + "Display information about user." + "", + "Return information about user identity", + (char *)NULL +}; + +struct builtin id_struct = { + "id", + id_builtin, + BUILTIN_ENABLED, + id_doc, + "id [user]\n\tid -G [-n] [user]\n\tid -g [-nr] [user]\n\tid -u [-nr] [user]", + 0 +}; diff --git a/examples/loadables/ln.c b/examples/loadables/ln.c new file mode 100644 index 0000000..ec73636 --- /dev/null +++ b/examples/loadables/ln.c @@ -0,0 +1,226 @@ +/* ln - make links */ + +/* See Makefile for compilation details. */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "posixstat.h" + +#include +#include + +#include "builtins.h" +#include "shell.h" +#include "bashgetopt.h" +#include "common.h" + +#if !defined (errno) +extern int errno; +#endif + +typedef int unix_link_syscall_t __P((const char *, const char *)); + +#define LN_SYMLINK 0x01 +#define LN_UNLINK 0x02 + +static unix_link_syscall_t *linkfn; +static int dolink (); + +ln_builtin (list) + WORD_LIST *list; +{ + int rval, opt, flags; + WORD_LIST *l; + char *sdir; + struct stat sb; + + flags = 0; + reset_internal_getopt (); + while ((opt = internal_getopt (list, "fs")) != -1) + { + switch (opt) + { + case 'f': + flags |= LN_UNLINK; + break; + case 's': + flags |= LN_SYMLINK; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + if (list == 0) + { + builtin_usage (); + return (EX_USAGE); + } + + linkfn = (flags & LN_SYMLINK) ? symlink : link; + + if (list->next == 0) /* ln target, equivalent to ln target . */ + return (dolink (list->word->word, ".", flags)); + + if (list->next->next == 0) /* ln target source */ + return (dolink (list->word->word, list->next->word->word, flags)); + + /* ln target1 target2 ... directory */ + + /* find last argument: target directory, and make sure it's an existing + directory. */ + for (l = list; l->next; l = l->next) + ; + sdir = l->word->word; + + if (stat(sdir, &sb) < 0) + { + builtin_error ("%s", sdir); + return (EXECUTION_FAILURE); + } + + if (S_ISDIR (sb.st_mode) == 0) + { + builtin_usage (); + return (EX_USAGE); + } + + for (rval = EXECUTION_SUCCESS; list != l; list = list->next) + rval += dolink (list->word->word, sdir, flags); + + return rval; +} + +static char * +mkdirpath (dir, file) + char *dir, *file; +{ + int dlen, flen; + char *ret; + + dlen = strlen (dir); + flen = strlen (file); + + ret = xmalloc (2 + dlen + flen); + + strcpy (ret, dir); + if (ret[dlen - 1] != '/') + ret[dlen++] = '/'; + strcpy (ret + dlen, file); + return ret; +} + +#if defined (HAVE_LSTAT) +# define LSTAT lstat +#else +# define LSTAT stat +#endif + +static int +dolink (src, dst, flags) + char *src, *dst; + int flags; +{ + struct stat ssb, dsb; + int exists; + char *dst_path, *p; + + /* If we're not doing symlinks, the source must exist and not be a + directory. */ + if ((flags & LN_SYMLINK) == 0) + { + if (stat (src, &ssb) != 0) + { + builtin_error ("%s: %s", src, strerror (errno)); + return (EXECUTION_FAILURE); + } + if (S_ISDIR (ssb.st_mode)) + { + errno = EISDIR; + builtin_error ("%s: %s", src, strerror (errno)); + return (EXECUTION_FAILURE); + } + } + + /* If the destination is a directory, create the final filename by appending + the basename of the source to the destination. */ + dst_path = 0; + if ((stat (dst, &dsb) == 0) && S_ISDIR (dsb.st_mode)) + { + if ((p = strrchr (src, '/')) == 0) + p = src; + else + p++; + + dst_path = mkdirpath (dst, p); + dst = dst_path; + } + + exists = LSTAT (dst, &dsb) == 0; + + /* If -f was specified, and the destination exists, unlink it. */ + if ((flags & LN_UNLINK) && exists && unlink (dst) != 0) + { + builtin_error ("%s: cannot unlink: %s", dst, strerror (errno)); + FREE (dst_path); + return (EXECUTION_FAILURE); + } + + /* Perform the link. */ + if ((*linkfn) (src, dst) != 0) + { + builtin_error ("cannot link %s to %s: %s", dst, src, strerror (errno)); + FREE (dst_path); + return (EXECUTION_FAILURE); + } + + FREE (dst_path); + return (EXECUTION_SUCCESS); +} + +char *ln_doc[] = { + "Link files.", + "", + "Create a new directory entry with the same modes as the original", + "file. The -f option means to unlink any existing file, permitting", + "the link to occur. The -s option means to create a symbolic link.", + "By default, ln makes hard links.", + (char *)NULL +}; + +/* The standard structure describing a builtin command. bash keeps an array + of these structures. */ +struct builtin ln_struct = { + "ln", /* builtin name */ + ln_builtin, /* function implementing the builtin */ + BUILTIN_ENABLED, /* initial flags for builtin */ + ln_doc, /* array of long documentation strings. */ + "ln [-fs] file1 [file2] OR ln [-fs] file ... directory", /* usage synopsis; becomes short_doc */ + 0 /* reserved for internal use */ +}; diff --git a/examples/loadables/logname.c b/examples/loadables/logname.c new file mode 100644 index 0000000..95b7e21 --- /dev/null +++ b/examples/loadables/logname.c @@ -0,0 +1,73 @@ +/* logname - print login name of current user */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include + +#include "builtins.h" +#include "shell.h" +#include "common.h" + +#if !defined (errno) +extern int errno; +#endif + +logname_builtin (list) + WORD_LIST *list; +{ + char *np; + + if (no_options (list)) + return (EX_USAGE); + + np = getlogin (); + if (np == 0) + { + builtin_error ("cannot find username: %s", strerror (errno)); + return (EXECUTION_FAILURE); + } + printf ("%s\n", np); + return (EXECUTION_SUCCESS); +} + +char *logname_doc[] = { + "Display user login name.", + "", + "Write the current user's login name to the standard output", + "and exit. logname ignores the LOGNAME and USER variables.", + "logname ignores any non-option arguments.", + (char *)NULL +}; + +struct builtin logname_struct = { + "logname", + logname_builtin, + BUILTIN_ENABLED, + logname_doc, + "logname", + 0 +}; + diff --git a/examples/loadables/mkdir.c b/examples/loadables/mkdir.c new file mode 100644 index 0000000..f5c105e --- /dev/null +++ b/examples/loadables/mkdir.c @@ -0,0 +1,237 @@ +/* mkdir - make directories */ + +/* See Makefile for compilation details. */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include "bashtypes.h" +#include "posixstat.h" +#include +#include +#include "bashansi.h" +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "builtins.h" +#include "shell.h" +#include "bashgetopt.h" +#include "common.h" + +#if !defined (errno) +extern int errno; +#endif + +#define ISOCTAL(c) ((c) >= '0' && (c) <= '7') + +extern int parse_symbolic_mode (); + +static int make_path (); + +static int original_umask; + +int +mkdir_builtin (list) + WORD_LIST *list; +{ + int opt, pflag, omode, rval, octal, nmode, parent_mode, um; + char *mode; + WORD_LIST *l; + + reset_internal_getopt (); + pflag = 0; + mode = (char *)NULL; + while ((opt = internal_getopt(list, "m:p")) != -1) + switch (opt) + { + case 'p': + pflag = 1; + break; + case 'm': + mode = list_optarg; + break; + default: + builtin_usage(); + return (EX_USAGE); + } + list = loptend; + + if (list == 0) + { + builtin_usage (); + return (EX_USAGE); + } + + if (mode == NULL) + omode = S_IRWXU | S_IRWXG | S_IRWXO; /* a=rwx */ + else if (ISOCTAL (*mode)) /* octal number */ + { + omode = read_octal (mode); + if (omode < 0) + { + builtin_error ("invalid file mode: %s", mode); + return (EXECUTION_FAILURE); + } + octal = 1; + } + else if (mode) + { + /* initial bits are a=rwx; the mode argument modifies them */ + omode = parse_symbolic_mode (mode, S_IRWXU | S_IRWXG | S_IRWXO); + if (omode < 0) + { + builtin_error ("invalid file mode: %s", mode); + return (EXECUTION_FAILURE); + } + octal = 0; + } + + /* Make the new mode */ + original_umask = umask (0); + umask (original_umask); + + nmode = (S_IRWXU | S_IRWXG | S_IRWXO) & ~original_umask; + parent_mode = nmode | (S_IWUSR|S_IXUSR); /* u+wx */ + + /* Adjust new mode based on mode argument */ + nmode &= omode; + + for (rval = EXECUTION_SUCCESS, l = list; l; l = l->next) + { + if (pflag && make_path (l->word->word, nmode, parent_mode)) + { + rval = EXECUTION_FAILURE; + continue; + } + else if (pflag == 0 && mkdir (l->word->word, nmode) < 0) + { + builtin_error ("cannot create directory `%s': %s", l->word->word, strerror (errno)); + rval = EXECUTION_FAILURE; + } + } + return rval; +} + +/* Make all the directories leading up to PATH, then create PATH. Note that + this changes the process's umask; make sure that all paths leading to a + return reset it to ORIGINAL_UMASK */ +static int +make_path (path, nmode, parent_mode) + char *path; + int nmode, parent_mode; +{ + int oumask; + struct stat sb; + char *p, *npath; + + if (stat (path, &sb) == 0) + { + if (S_ISDIR (sb.st_mode) == 0) + { + builtin_error ("`%s': file exists but is not a directory", path); + return 1; + } + + if (chmod (path, nmode)) + { + builtin_error ("%s: %s", path, strerror (errno)); + return 1; + } + + return 0; + } + + oumask = umask (0); + npath = savestring (path); /* So we can write to it. */ + + /* Check whether or not we need to do anything with intermediate dirs. */ + + /* Skip leading slashes. */ + p = npath; + while (*p == '/') + p++; + + while (p = strchr (p, '/')) + { + *p = '\0'; + if (stat (npath, &sb) != 0) + { + if (mkdir (npath, parent_mode)) + { + builtin_error ("cannot create directory `%s': %s", npath, strerror (errno)); + umask (original_umask); + free (npath); + return 1; + } + } + else if (S_ISDIR (sb.st_mode) == 0) + { + builtin_error ("`%s': file exists but is not a directory", npath); + umask (original_umask); + free (npath); + return 1; + } + + *p++ = '/'; /* restore slash */ + while (*p == '/') + p++; + } + + /* Create the final directory component. */ + if (stat (npath, &sb) && mkdir (npath, nmode)) + { + builtin_error ("cannot create directory `%s': %s", npath, strerror (errno)); + umask (original_umask); + free (npath); + return 1; + } + + umask (original_umask); + free (npath); + return 0; +} + +char *mkdir_doc[] = { + "Create directories.", + "", + "Make directories. Create the directories named as arguments, in", + "the order specified, using mode rwxrwxrwx as modified by the current", + "umask (see `help umask'). The -m option causes the file permission", + "bits of the final directory to be MODE. The MODE argument may be", + "an octal number or a symbolic mode like that used by chmod(1). If", + "a symbolic mode is used, the operations are interpreted relative to", + "an initial mode of \"a=rwx\". The -p option causes any required", + "intermediate directories in PATH to be created. The directories", + "are created with permssion bits of rwxrwxrwx as modified by the current", + "umask, plus write and search permissions for the owner. mkdir", + "returns 0 if the directories are created successfully, and non-zero", + "if an error occurs.", + (char *)NULL +}; + +struct builtin mkdir_struct = { + "mkdir", + mkdir_builtin, + BUILTIN_ENABLED, + mkdir_doc, + "mkdir [-p] [-m mode] directory [directory ...]", + 0 +}; diff --git a/examples/loadables/mypid.c b/examples/loadables/mypid.c new file mode 100644 index 0000000..135cdb3 --- /dev/null +++ b/examples/loadables/mypid.c @@ -0,0 +1,74 @@ +/* This module should be dynamically loaded with enable -f + * which would create a new builtin named mypid. You'll need + * the source code for GNU bash to recompile this module. + * + * Then, from within bash, enable -f ./mypid enable_mypid, where ./mypid + * is the binary obtained from running make. Hereafter, `${MYPID}' + * is a shell builtin variable. + */ + +#include +#include +#include + +#include "builtins.h" +#include "shell.h" + +#define INIT_DYNAMIC_VAR(var, val, gfunc, afunc) \ + do \ + { SHELL_VAR *v = bind_variable (var, (val), 0); \ + v->dynamic_value = gfunc; \ + v->assign_func = afunc; \ + } \ + while (0) + +static SHELL_VAR * +assign_mypid ( + SHELL_VAR *self, + char *value, + arrayind_t unused, + char *key ) +{ + return (self); +} + +static SHELL_VAR * +get_mypid (SHELL_VAR *var) +{ + int rv; + char *p; + + rv = getpid(); + p = itos (rv); + + FREE (value_cell (var)); + + VSETATTR (var, att_integer); + var_setvalue (var, p); + return (var); +} + +int +enable_mypid_builtin(WORD_LIST *list) +{ + INIT_DYNAMIC_VAR ("MYPID", (char *)NULL, get_mypid, assign_mypid); + + return 0; +} + +char const *enable_mypid_doc[] = { + "Enable $MYPID.", + "", + "Enables use of the ${MYPID} dynamic variable. ", + "It will yield the current pid of a subshell.", + (char *)0 +}; + +struct builtin enable_mypid_struct = { + "enable_mypid", + enable_mypid_builtin, + BUILTIN_ENABLED, + (char**)(void*)enable_mypid_doc, + "enable_mypid N", + 0 +}; diff --git a/examples/loadables/necho.c b/examples/loadables/necho.c new file mode 100644 index 0000000..b567389 --- /dev/null +++ b/examples/loadables/necho.c @@ -0,0 +1,53 @@ +/* necho - echo without options or argument interpretation */ + +/* Sample builtin to be dynamically loaded with enable -f and replace an + existing builtin. */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include +#include "builtins.h" +#include "shell.h" + +necho_builtin (list) +WORD_LIST *list; +{ + print_word_list (list, " "); + printf("\n"); + fflush (stdout); + return (EXECUTION_SUCCESS); +} + +char *necho_doc[] = { + "Display arguments.", + "", + "Print the arguments to the standard ouput separated", + "by space characters and terminated with a newline.", + (char *)NULL +}; + +struct builtin necho_struct = { + "echo", + necho_builtin, + BUILTIN_ENABLED, + necho_doc, + "echo [args]", + 0 +}; + diff --git a/examples/loadables/pathchk.c b/examples/loadables/pathchk.c new file mode 100644 index 0000000..c5fd24a --- /dev/null +++ b/examples/loadables/pathchk.c @@ -0,0 +1,379 @@ +/* pathchk - check pathnames for validity and portability */ + +/* Usage: pathchk [-p] path ... + + For each PATH, print a message if any of these conditions are false: + * all existing leading directories in PATH have search (execute) permission + * strlen (PATH) <= PATH_MAX + * strlen (each_directory_in_PATH) <= NAME_MAX + + Exit status: + 0 All PATH names passed all of the tests. + 1 An error occurred. + + Options: + -p Instead of performing length checks on the + underlying filesystem, test the length of the + pathname and its components against the POSIX.1 + minimum limits for portability, _POSIX_NAME_MAX + and _POSIX_PATH_MAX in 2.9.2. Also check that + the pathname contains no character not in the + portable filename character set. */ + +/* See Makefile for compilation details. */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include +#include "posixstat.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (HAVE_LIMITS_H) +# include +#endif + +#include "bashansi.h" + +#include +#include + +#include "builtins.h" +#include "shell.h" +#include "stdc.h" +#include "bashgetopt.h" +#include "maxpath.h" +#include "common.h" + +#if !defined (errno) +extern int errno; +#endif + +#if !defined (_POSIX_PATH_MAX) +# define _POSIX_PATH_MAX 255 +#endif +#if !defined (_POSIX_NAME_MAX) +# define _POSIX_NAME_MAX 14 +#endif + +/* How do we get PATH_MAX? */ +#if defined (_POSIX_VERSION) && !defined (PATH_MAX) +# define PATH_MAX_FOR(p) pathconf ((p), _PC_PATH_MAX) +#endif + +/* How do we get NAME_MAX? */ +#if defined (_POSIX_VERSION) && !defined (NAME_MAX) +# define NAME_MAX_FOR(p) pathconf ((p), _PC_NAME_MAX) +#endif + +#if !defined (PATH_MAX_FOR) +# define PATH_MAX_FOR(p) PATH_MAX +#endif + +#if !defined (NAME_MAX_FOR) +# define NAME_MAX_FOR(p) NAME_MAX +#endif + +extern char *strerror (); + +static int validate_path (); + +pathchk_builtin (list) + WORD_LIST *list; +{ + int retval, pflag, opt; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "p")) != -1) + { + switch (opt) + { + case 'p': + pflag = 1; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + if (list == 0) + { + builtin_usage (); + return (EX_USAGE); + } + + for (retval = 0; list; list = list->next) + retval |= validate_path (list->word->word, pflag); + + return (retval ? EXECUTION_FAILURE : EXECUTION_SUCCESS); +} + +char *pathchk_doc[] = { + "Check pathnames for validity.", + "", + "Check each pathname argument for validity (i.e., it may be used to", + "create or access a file without casuing syntax errors) and portability", + "(i.e., no filename truncation will result). If the `-p' option is", + "supplied, more extensive portability checks are performed.", + (char *)NULL +}; + +/* The standard structure describing a builtin command. bash keeps an array + of these structures. */ +struct builtin pathchk_struct = { + "pathchk", /* builtin name */ + pathchk_builtin, /* function implementing the builtin */ + BUILTIN_ENABLED, /* initial flags for builtin */ + pathchk_doc, /* array of long documentation strings. */ + "pathchk [-p] pathname ...", /* usage synopsis */ + 0 /* reserved for internal use */ +}; + +/* The remainder of this file is stolen shamelessly from `pathchk.c' in + the sh-utils-1.12 distribution, by + + David MacKenzie + and Jim Meyering */ + +/* Each element is nonzero if the corresponding ASCII character is + in the POSIX portable character set, and zero if it is not. + In addition, the entry for `/' is nonzero to simplify checking. */ +static char const portable_chars[256] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0-15 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 16-31 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, /* 32-47 */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 48-63 */ + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 64-79 */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /* 80-95 */ + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 96-111 */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 112-127 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +/* If PATH contains only portable characters, return 1, else 0. */ + +static int +portable_chars_only (path) + const char *path; +{ + const char *p; + + for (p = path; *p; ++p) + if (portable_chars[(const unsigned char) *p] == 0) + { + builtin_error ("path `%s' contains nonportable character `%c'", path, *p); + return 0; + } + return 1; +} + +/* On some systems, stat can return EINTR. */ + +#ifndef EINTR +# define SAFE_STAT(name, buf) stat (name, buf) +#else +# define SAFE_STAT(name, buf) safe_stat (name, buf) +static inline int +safe_stat (name, buf) + const char *name; + struct stat *buf; +{ + int ret; + + do + ret = stat (name, buf); + while (ret < 0 && errno == EINTR); + + return ret; +} +#endif + +/* Return 1 if PATH is a usable leading directory, 0 if not, + 2 if it doesn't exist. */ + +static int +dir_ok (path) + const char *path; +{ + struct stat stats; + + if (SAFE_STAT (path, &stats)) + return 2; + + if (!S_ISDIR (stats.st_mode)) + { + builtin_error ("`%s' is not a directory", path); + return 0; + } + + /* Use access to test for search permission because + testing permission bits of st_mode can lose with new + access control mechanisms. Of course, access loses if you're + running setuid. */ + if (access (path, X_OK) != 0) + { + if (errno == EACCES) + builtin_error ("directory `%s' is not searchable", path); + else + builtin_error ("%s: %s", path, strerror (errno)); + return 0; + } + + return 1; +} + +static char * +xstrdup (s) + char *s; +{ + return (savestring (s)); +} + +/* Make sure that + strlen (PATH) <= PATH_MAX + && strlen (each-existing-directory-in-PATH) <= NAME_MAX + + If PORTABILITY is nonzero, compare against _POSIX_PATH_MAX and + _POSIX_NAME_MAX instead, and make sure that PATH contains no + characters not in the POSIX portable filename character set, which + consists of A-Z, a-z, 0-9, ., _, -. + + Make sure that all leading directories along PATH that exist have + `x' permission. + + Return 0 if all of these tests are successful, 1 if any fail. */ + +static int +validate_path (path, portability) + char *path; + int portability; +{ + int path_max; + int last_elem; /* Nonzero if checking last element of path. */ + int exists; /* 2 if the path element exists. */ + char *slash; + char *parent; /* Last existing leading directory so far. */ + + if (portability && !portable_chars_only (path)) + return 1; + + if (*path == '\0') + return 0; + +#ifdef lint + /* Suppress `used before initialized' warning. */ + exists = 0; +#endif + + /* Figure out the parent of the first element in PATH. */ + parent = xstrdup (*path == '/' ? "/" : "."); + + slash = path; + last_elem = 0; + while (1) + { + int name_max; + int length; /* Length of partial path being checked. */ + char *start; /* Start of path element being checked. */ + + /* Find the end of this element of the path. + Then chop off the rest of the path after this element. */ + while (*slash == '/') + slash++; + start = slash; + slash = strchr (slash, '/'); + if (slash != NULL) + *slash = '\0'; + else + { + last_elem = 1; + slash = strchr (start, '\0'); + } + + if (!last_elem) + { + exists = dir_ok (path); + if (dir_ok == 0) + { + free (parent); + return 1; + } + } + + length = slash - start; + /* Since we know that `parent' is a directory, it's ok to call + pathconf with it as the argument. (If `parent' isn't a directory + or doesn't exist, the behavior of pathconf is undefined.) + But if `parent' is a directory and is on a remote file system, + it's likely that pathconf can't give us a reasonable value + and will return -1. (NFS and tempfs are not POSIX . . .) + In that case, we have no choice but to assume the pessimal + POSIX minimums. */ + name_max = portability ? _POSIX_NAME_MAX : NAME_MAX_FOR (parent); + if (name_max < 0) + name_max = _POSIX_NAME_MAX; + if (length > name_max) + { + builtin_error ("name `%s' has length %d; exceeds limit of %d", + start, length, name_max); + free (parent); + return 1; + } + + if (last_elem) + break; + + if (exists == 1) + { + free (parent); + parent = xstrdup (path); + } + + *slash++ = '/'; + } + + /* `parent' is now the last existing leading directory in the whole path, + so it's ok to call pathconf with it as the argument. */ + path_max = portability ? _POSIX_PATH_MAX : PATH_MAX_FOR (parent); + if (path_max < 0) + path_max = _POSIX_PATH_MAX; + free (parent); + if (strlen (path) > path_max) + { + builtin_error ("path `%s' has length %d; exceeds limit of %d", + path, strlen (path), path_max); + return 1; + } + + return 0; +} diff --git a/examples/loadables/perl/Makefile.in b/examples/loadables/perl/Makefile.in new file mode 100644 index 0000000..d8860bd --- /dev/null +++ b/examples/loadables/perl/Makefile.in @@ -0,0 +1,99 @@ +# +# Makefile for builtin perl interpreter +# +# +# Copyright (C) 1998 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# Include some boilerplate Gnu makefile definitions. +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +libdir = @libdir@ +infodir = @infodir@ +includedir = @includedir@ + +datarootdir = @datarootdir@ + +topdir = @top_srcdir@ +BUILD_DIR = @BUILD_DIR@ +srcdir = @srcdir@ +VPATH = .:@srcdir@ + +@SET_MAKE@ +CC = @CC@ +RM = rm -f + +SHELL = @MAKE_SHELL@ + +PERL5 = perl5 + +CFLAGS = @CFLAGS@ + +# +# These values are generated for configure by ${topdir}/support/shobj-conf. +# If your system is not supported by that script, but includes facilities for +# dynamic loading of shared objects, please update the script and send the +# changes to bash-maintainers@gnu.org. +# +SHOBJ_CC = @SHOBJ_CC@ +SHOBJ_CFLAGS = @SHOBJ_CFLAGS@ +SHOBJ_LD = @SHOBJ_LD@ +SHOBJ_LDFLAGS = @SHOBJ_LDFLAGS@ +SHOBJ_XLDFLAGS = @SHOBJ_XLDFLAGS@ +SHOBJ_LIBS = @SHOBJ_LIBS@ +SHOBJ_STATUS = @SHOBJ_STATUS@ + +# Values used for compiling the perl files +PERL_LDOPTS = `${PERL5} -MExtUtils::Embed -e ldopts` +PERL_CFLAGS = ${CCFLAGS} `${PERL5} -MExtUtils::Embed -e ccopts` + +SRC = bperl.c iperl.c perlxsi.c +OBJ = bperl.o iperl.o perlxsi.o + +BUILTIN = bperl5 + +INC = -I. -I.. -I$(topdir) -I$(topdir)/lib -I$(topdir)/builtins \ + -I$(topdir)/include -I$(BUILD_DIR) -I$(BUILD_DIR)/lib \ + -I$(BUILD_DIR)/builtins + + +${BUILTIN}: ${OBJ} + ${RM} $@ + ${SHOBJ_LD} ${SHOBJ_LDFLAGS} ${SHOBJ_XLDFLAGS} -o $@ ${OBJ} ${PERL_LDOPTS} ${SHOBJ_LIBS} + +bperl.o: bperl.c + ${RM} $@ + $(SHOBJ_CC) $(SHOBJ_CFLAGS) $(CFLAGS) $(INC) -c -o $@ ${srcdir}/bperl.c + +iperl.o: iperl.c + ${RM} $@ + $(SHOBJ_CC) ${SHOBJ_CFLAGS} $(PERL_CFLAGS) -c -o $@ ${srcdir}/iperl.c + +perlxsi.c: + ${PERL5} -MExtUtils::Embed -e xsinit -- -o $@ + +perlxsi.o: perlxsi.c + ${RM} $@ + ${SHOBJ_CC} ${SHOBJ_CFLAGS} $(PERL_CFLAGS) -c -o $@ perlxsi.c + +clean mostlyclean: + ${RM} ${OBJ} + ${RM} ${BUILTIN} + +distclean maintainer-clean: clean + ${RM} perlxsi.c diff --git a/examples/loadables/perl/README b/examples/loadables/perl/README new file mode 100644 index 0000000..a70a99b --- /dev/null +++ b/examples/loadables/perl/README @@ -0,0 +1,6 @@ +This illustrates how to build a perl interpreter into bash. It's not +especially useful; more a proof of concept (it provides none of the +bash internals to the perl interpreter, for example). + +This *may* require adding "-rpath /path/to/perl/CORE" and -lperl options +when compiling bash itself. diff --git a/examples/loadables/perl/bperl.c b/examples/loadables/perl/bperl.c new file mode 100644 index 0000000..77e3f7c --- /dev/null +++ b/examples/loadables/perl/bperl.c @@ -0,0 +1,46 @@ +/* + * perl builtin + */ +#include + +#include +#include + +#include "builtins.h" +#include "shell.h" + +#ifndef errno +extern int errno; +#endif + +extern char **make_builtin_argv (); +extern char **export_env; + +extern int perl_main(); + +bperl_builtin(list) +WORD_LIST *list; +{ + char **v; + int c, r; + + v = make_builtin_argv(list, &c); + r = perl_main(c, v, export_env); + free(v); + + return r; +} + +char *bperl_doc[] = { + "An interface to a perl5 interpreter.", + (char *)0 +}; + +struct builtin bperl_struct = { + "bperl", + bperl_builtin, + BUILTIN_ENABLED, + bperl_doc, + "bperl [perl options] [file ...]", + 0 +}; diff --git a/examples/loadables/perl/iperl.c b/examples/loadables/perl/iperl.c new file mode 100644 index 0000000..92a6038 --- /dev/null +++ b/examples/loadables/perl/iperl.c @@ -0,0 +1,24 @@ +#include /* from the Perl distribution */ +#include /* from the Perl distribution */ + +extern void xs_init _((void)); + +static PerlInterpreter *iperl; /*** The Perl interpreter ***/ + +int +perl_main(int argc, char **argv, char **env) +{ + int r; + + iperl = perl_alloc(); + perl_construct(iperl); + perl_parse(iperl, xs_init, argc, argv, (char **)NULL); + r = perl_run(iperl); + +PerlIO_flush(PerlIO_stdout()); +PerlIO_flush(PerlIO_stderr()); + + perl_destruct(iperl); + perl_free(iperl); + return (r); +} diff --git a/examples/loadables/print.c b/examples/loadables/print.c new file mode 100644 index 0000000..e17597b --- /dev/null +++ b/examples/loadables/print.c @@ -0,0 +1,191 @@ +/* + * print -- loadable ksh-93 style print builtin + */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "bashtypes.h" + +#include +#include +#include + +#include "bashansi.h" +#include "shell.h" +#include "builtins.h" +#include "stdc.h" +#include "bashgetopt.h" +#include "builtext.h" +#include "common.h" + +#if !defined (errno) +extern int errno; +#endif + +int print_builtin (); +static int printargs (); + +static FILE *ofp; + +extern char *this_command_name; + +static char *print_doc[] = { + "Display arguments.", + "", + "Output the arguments. The -f option means to use the argument as a", + "format string as would be supplied to printf(1). The rest of the", + "options are as in ksh.", + (char *)NULL +}; + +struct builtin print_struct = { + "print", + print_builtin, + BUILTIN_ENABLED, + print_doc, + "print [-Rnprs] [-u unit] [-f format] [arguments]", + (char *)0 +}; + +#ifndef ISOPTION +#define ISOPTION(s, c) (s[0] == '-' && s[2] == '\0' && s[1] == c) +#endif + +int +print_builtin (list) + WORD_LIST *list; +{ + int c, r, nflag, raw, ofd, sflag; + intmax_t lfd; + char **v, *pfmt, *arg; + WORD_LIST *l; + + nflag = raw = sflag = 0; + ofd = 1; + pfmt = 0; + + reset_internal_getopt (); + while ((c = internal_getopt (list, "Rnprsu:f:")) != -1) + { + switch (c) + { + case 'R': + raw = 2; + loptend = lcurrent; + if (loptend && ISOPTION (loptend->word->word, 'n')) + { + loptend = loptend->next; + nflag = 1; + } + goto opt_end; + case 'r': + raw = 1; + break; + case 'n': + nflag = 1; + break; + case 's': + sflag = 1; + break; + case 'p': + break; /* NOP */ + case 'u': + if (all_digits (list_optarg) && legal_number (list_optarg, &lfd) && lfd == (int)lfd) + ofd = lfd; + else + { + for (l = list; l->next && l->next != lcurrent; l = l->next); + lcurrent = loptend = l; + goto opt_end; + } + break; + case 'f': + pfmt = list_optarg; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + +opt_end: + list = loptend; + + ofp = (ofd == 1) ? stdout : fdopen (dup (ofd), "w"); + + if (pfmt) + { + WORD_DESC *w; + WORD_LIST *nlist; + + w = make_word (pfmt); + nlist = make_word_list (w, list); + r = printf_builtin (nlist); + nlist->next = (WORD_LIST *)NULL; + dispose_words (nlist); + return (r); + } + + if (raw) + { + for (l = list; l; l = l->next) + { + fprintf (ofp, "%s", l->word->word); + if (l->next) + fprintf (ofp, " "); + } + if (nflag == 0) + fprintf (ofp, "\n"); + fflush (ofp); + return (0); + } + + r = printargs (list, ofp); + if (r && nflag == 0) + fprintf (ofp, "\n"); + if (ofd != 1) + fclose (ofp); + return 0; +} + +static int +printargs (list, ofp) + WORD_LIST *list; + FILE *ofp; +{ + WORD_LIST *l; + char *ostr; + int sawc; + + for (sawc = 0, l = list; l; l = l->next) + { + ostr = ansicstr (l->word->word, strlen (l->word->word), 0, &sawc, (int *)0); + fprintf (ofp, "%s", ostr); + free (ostr); + if (sawc) + return (0); + if (l->next) + fprintf (ofp, " "); + } + return (1); +} diff --git a/examples/loadables/printenv.c b/examples/loadables/printenv.c new file mode 100644 index 0000000..8d3a05d --- /dev/null +++ b/examples/loadables/printenv.c @@ -0,0 +1,93 @@ +/* + * printenv -- minimal builtin clone of BSD printenv(1). + * + * usage: printenv [varname] + * + */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include +#include + +#include "builtins.h" +#include "shell.h" +#include "bashgetopt.h" +#include "common.h" + +extern char **export_env; + +int +printenv_builtin (list) + WORD_LIST *list; +{ + register char **envp; + int opt; + SHELL_VAR *var; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "")) != -1) + { + switch (opt) + { + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + /* printenv */ + if (list == 0) + { + maybe_make_export_env (); /* this allows minimal code */ + for (envp = export_env; *envp; envp++) + printf ("%s\n", *envp); + return (EXECUTION_SUCCESS); + } + + /* printenv varname */ + var = find_variable (list->word->word); + if (var == 0 || (exported_p (var) == 0)) + return (EXECUTION_FAILURE); + + if (function_p (var)) + print_var_function (var); + else + print_var_value (var, 0); + + printf("\n"); + return (EXECUTION_SUCCESS); +} + +char *printenv_doc[] = { + "Display environment.", + "", + "Print names and values of environment variables", + (char *)NULL +}; + +struct builtin printenv_struct = { + "printenv", + printenv_builtin, + BUILTIN_ENABLED, + printenv_doc, + "printenv [varname]", + 0 +}; diff --git a/examples/loadables/push.c b/examples/loadables/push.c new file mode 100644 index 0000000..b076073 --- /dev/null +++ b/examples/loadables/push.c @@ -0,0 +1,116 @@ +/* + * push - anyone remember TOPS-20? + * + */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include +#include +#include + +#include "builtins.h" +#include "shell.h" +#include "jobs.h" +#include "bashgetopt.h" +#include "common.h" + +#ifndef errno +extern int errno; +#endif + +extern int dollar_dollar_pid; +extern int last_command_exit_value; + +int +push_builtin (list) + WORD_LIST *list; +{ + pid_t pid; + int xstatus, opt; + + xstatus = EXECUTION_SUCCESS; + reset_internal_getopt (); + while ((opt = internal_getopt (list, "")) != -1) + { + switch (opt) + { + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + pid = make_child (savestring ("push"), 0); + if (pid == -1) + { + builtin_error ("cannot fork: %s", strerror (errno)); + return (EXECUTION_FAILURE); + } + else if (pid == 0) + { + /* Shell variable adjustments: $SHLVL, $$, $PPID, $! */ + adjust_shell_level (1); + dollar_dollar_pid = getpid (); + set_ppid (); + + /* Clean up job control stuff. */ + stop_making_children (); + cleanup_the_pipeline (); + delete_all_jobs (0); + + last_asynchronous_pid = NO_PID; + + /* Make sure the job control code has the right values for + the shell's process group and tty process group, and that + the signals are set correctly for job control. */ + initialize_job_control (0); + initialize_job_signals (); + + /* And read commands until exit. */ + reader_loop (); + exit_shell (last_command_exit_value); + } + else + { + stop_pipeline (0, (COMMAND *)NULL); + xstatus = wait_for (pid); + return (xstatus); + } +} + +char *push_doc[] = { + "Create child shell.", + "", + "Create a child that is an exact duplicate of the running shell", + "and wait for it to exit. The $SHLVL, $!, $$, and $PPID variables", + "are adjusted in the child. The return value is the exit status", + "of the child.", + (char *)NULL +}; + +struct builtin push_struct = { + "push", + push_builtin, + BUILTIN_ENABLED, + push_doc, + "push", + 0 +}; diff --git a/examples/loadables/realpath.c b/examples/loadables/realpath.c new file mode 100644 index 0000000..ffcbef8 --- /dev/null +++ b/examples/loadables/realpath.c @@ -0,0 +1,140 @@ +/* + * realpath -- canonicalize pathnames, resolving symlinks + * + * usage: realpath [-csv] pathname [pathname...] + * + * options: -c check whether or not each resolved path exists + * -s no output, exit status determines whether path is valid + * -v produce verbose output + * + * + * exit status: 0 if all pathnames resolved + * 1 if any of the pathname arguments could not be resolved + * + * + * Bash loadable builtin version + * + * Chet Ramey + * chet@po.cwru.edu + */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include +#include + +#include +#ifdef HAVE_UNISTD_H +# include +#endif +#include "bashansi.h" +#include +#include + +#include "builtins.h" +#include "shell.h" +#include "bashgetopt.h" +#include "common.h" + +#ifndef errno +extern int errno; +#endif + +extern char *sh_realpath(); + +realpath_builtin(list) +WORD_LIST *list; +{ + int opt, cflag, vflag, sflag, es; + char *r, realbuf[PATH_MAX], *p; + struct stat sb; + + if (list == 0) { + builtin_usage(); + return (EX_USAGE); + } + + vflag = cflag = sflag = 0; + reset_internal_getopt(); + while ((opt = internal_getopt (list, "csv")) != -1) { + switch (opt) { + case 'c': + cflag = 1; + break; + case 's': + sflag = 1; + break; + case 'v': + vflag = 1; + break; + default: + builtin_usage(); + } + } + + list = loptend; + + if (list == 0) + builtin_usage(); + + for (es = EXECUTION_SUCCESS; list; list = list->next) { + p = list->word->word; + r = sh_realpath(p, realbuf); + if (r == 0) { + es = EXECUTION_FAILURE; + if (sflag == 0) + builtin_error("%s: cannot resolve: %s", p, strerror(errno)); + continue; + } + if (cflag && (stat(realbuf, &sb) < 0)) { + es = EXECUTION_FAILURE; + if (sflag == 0) + builtin_error("%s: %s", p, strerror(errno)); + continue; + } + if (sflag == 0) { + if (vflag) + printf ("%s -> ", p); + printf("%s\n", realbuf); + } + } + return es; +} + +char *realpath_doc[] = { + "Display pathname in canonical form.", + "", + "Display the canonicalized version of each PATHNAME argument, resolving", + "symbolic links. The -c option checks whether or not each resolved name", + "exists. The -s option produces no output; the exit status determines the", + "valididty of each PATHNAME. The -v option produces verbose output. The", + "exit status is 0 if each PATHNAME was resolved; non-zero otherwise.", + (char *)NULL +}; + +struct builtin realpath_struct = { + "realpath", /* builtin name */ + realpath_builtin, /* function implementing the builtin */ + BUILTIN_ENABLED, /* initial flags for builtin */ + realpath_doc, /* array of long documentation strings */ + "realpath [-csv] pathname [pathname...]", /* usage synopsis */ + 0 /* reserved for internal use */ +}; diff --git a/examples/loadables/rmdir.c b/examples/loadables/rmdir.c new file mode 100644 index 0000000..0cfe6c7 --- /dev/null +++ b/examples/loadables/rmdir.c @@ -0,0 +1,71 @@ +/* rmdir - remove directory */ + +/* See Makefile for compilation details. */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include +#include +#include "builtins.h" +#include "shell.h" +#include "common.h" + +#if !defined (errno) +extern int errno; +#endif + +rmdir_builtin (list) + WORD_LIST *list; +{ + int rval; + WORD_LIST *l; + + if (no_options (list)) + return (EX_USAGE); + + for (rval = EXECUTION_SUCCESS, l = list; l; l = l->next) + if (rmdir (l->word->word) < 0) + { + builtin_error ("%s: %s", l->word->word, strerror (errno)); + rval = EXECUTION_FAILURE; + } + + return rval; +} + +char *rmdir_doc[] = { + "Remove directory.", + "", + "rmdir removes the directory entry specified by each argument,", + "provided the directory is empty.", + (char *)NULL +}; + +/* The standard structure describing a builtin command. bash keeps an array + of these structures. */ +struct builtin rmdir_struct = { + "rmdir", /* builtin name */ + rmdir_builtin, /* function implementing the builtin */ + BUILTIN_ENABLED, /* initial flags for builtin */ + rmdir_doc, /* array of long documentation strings. */ + "rmdir directory ...", /* usage synopsis; becomes short_doc */ + 0 /* reserved for internal use */ +}; diff --git a/examples/loadables/sleep.c b/examples/loadables/sleep.c new file mode 100644 index 0000000..736c8af --- /dev/null +++ b/examples/loadables/sleep.c @@ -0,0 +1,101 @@ +/* + * sleep -- sleep for fractions of a second + * + * usage: sleep seconds[.fraction] + */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" + +#if defined (TIME_WITH_SYS_TIME) +# include +# include +#else +# if defined (HAVE_SYS_TIME_H) +# include +# else +# include +# endif +#endif + +#if defined (HAVE_UNISTD_H) +#include +#endif + +#include +#include "chartypes.h" + +#include "shell.h" +#include "builtins.h" +#include "common.h" + +#define RETURN(x) \ + do { \ + if (sp) *sp = sec; \ + if (usp) *usp = usec; \ + return (x); \ + } while (0) + +int +sleep_builtin (list) +WORD_LIST *list; +{ + long sec, usec; + + if (list == 0) { + builtin_usage(); + return(EX_USAGE); + } + + /* Skip over `--' */ + if (list->word && ISOPTION (list->word->word, '-')) + list = list->next; + + if (*list->word->word == '-' || list->next) { + builtin_usage (); + return (EX_USAGE); + } + + if (uconvert(list->word->word, &sec, &usec)) { + fsleep(sec, usec); + return(EXECUTION_SUCCESS); + } + + builtin_error("%s: bad sleep interval", list->word->word); + return (EXECUTION_FAILURE); +} + +static char *sleep_doc[] = { + "Suspend execution for specified period.", + "" + "sleep suspends execution for a minimum of SECONDS[.FRACTION] seconds.", + (char *)NULL +}; + +struct builtin sleep_struct = { + "sleep", + sleep_builtin, + BUILTIN_ENABLED, + sleep_doc, + "sleep seconds[.fraction]", + 0 +}; diff --git a/examples/loadables/strftime.c b/examples/loadables/strftime.c new file mode 100644 index 0000000..2de09e3 --- /dev/null +++ b/examples/loadables/strftime.c @@ -0,0 +1,125 @@ +/* strftime - loadable builtin interface to strftime(3) */ + +/* See Makefile for compilation details. */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashtypes.h" +#include "posixtime.h" + +#include + +#include "builtins.h" +#include "shell.h" +#include "common.h" + +int +strftime_builtin (list) + WORD_LIST *list; +{ + char *format, *tbuf; + size_t tbsize, tsize; + time_t secs; + struct tm *t; + int n; + intmax_t i; + + if (list == 0) + { + builtin_usage (); + return (EX_USAGE); + } + + if (no_options (list)) + return (EX_USAGE); + + format = list->word->word; + if (format == 0 || *format == 0) + { + printf ("\n"); + return (EXECUTION_SUCCESS); + } + + list = list->next; + + if (list && list->word->word) + { + n = legal_number (list->word->word, &i); + if (n == 0 || i < 0 || i != (time_t)i) + { + sh_invalidnum (list->word->word); + return (EXECUTION_FAILURE); + } + else + secs = i; + } + else + secs = NOW; + + t = localtime (&secs); + + tbsize = strlen (format) * 4; + tbuf = 0; + + /* Now try to figure out how big the buffer should really be. strftime(3) + will return the number of bytes placed in the buffer unless it's greater + than MAXSIZE, in which case it returns 0. */ + for (n = 1; n < 4; n++) + { + tbuf = xrealloc (tbuf, tbsize * n); + tsize = strftime (tbuf, tbsize * n, format, t); + if (tsize) + break; + } + + printf ("%s\n", tbuf); + free (tbuf); + + return (EXECUTION_SUCCESS); +} + +/* An array of strings forming the `long' documentation for a builtin xxx, + which is printed by `help xxx'. It must end with a NULL. */ +char *strftime_doc[] = { + "Display formatted time.", + "", + "Converts date and time format to a string and displays it on the", + "standard output. If the optional second argument is supplied, it", + "is used as the number of seconds since the epoch to use in the", + "conversion, otherwise the current time is used.", + (char *)NULL +}; + +/* The standard structure describing a builtin command. bash keeps an array + of these structures. The flags must include BUILTIN_ENABLED so the + builtin can be used. */ +struct builtin strftime_struct = { + "strftime", /* builtin name */ + strftime_builtin, /* function implementing the builtin */ + BUILTIN_ENABLED, /* initial flags for builtin */ + strftime_doc, /* array of long documentation strings. */ + "strftime format [seconds]", /* usage synopsis; becomes short_doc */ + 0 /* reserved for internal use */ +}; diff --git a/examples/loadables/sync.c b/examples/loadables/sync.c new file mode 100644 index 0000000..d91852e --- /dev/null +++ b/examples/loadables/sync.c @@ -0,0 +1,52 @@ +/* sync - sync the disks by forcing pending filesystem writes to complete */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#ifdef HAVE_UNISTD_H +#include +#endif + +#include "builtins.h" +#include "shell.h" +#include "bashgetopt.h" + +sync_builtin (list) + WORD_LIST *list; +{ + sync(); + return (EXECUTION_SUCCESS); +} + +char *sync_doc[] = { + "Sync disks.", + "" + "Force completion of pending disk writes", + (char *)NULL +}; + +struct builtin sync_struct = { + "sync", /* builtin name */ + sync_builtin, /* function implementing the builtin */ + BUILTIN_ENABLED, /* initial flags for builtin */ + sync_doc, /* array of long documentation strings. */ + "sync", /* usage synopsis; becomes short_doc */ + 0 /* reserved for internal use */ +}; diff --git a/examples/loadables/tee.c b/examples/loadables/tee.c new file mode 100644 index 0000000..8b5715f --- /dev/null +++ b/examples/loadables/tee.c @@ -0,0 +1,178 @@ +/* tee - duplicate standard input */ + +/* See Makefile for compilation details. */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" +#include "posixstat.h" +#include "filecntl.h" + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" + +#include +#include + +#include "builtins.h" +#include "shell.h" +#include "bashgetopt.h" +#include "common.h" + +#if !defined (errno) +extern int errno; +#endif + +typedef struct flist { + struct flist *next; + int fd; + char *fname; +} FLIST; + +static FLIST *tee_flist; + +#define TEE_BUFSIZE 8192 + +extern int interrupt_immediately; + +extern char *strerror (); + +tee_builtin (list) + WORD_LIST *list; +{ + int opt, append, nointr, rval, fd, fflags; + int n, nr, nw; + FLIST *fl; + char *buf, *bp; + + char *t; + + reset_internal_getopt (); + append = nointr = 0; + tee_flist = (FLIST *)NULL; + while ((opt = internal_getopt (list, "ai")) != -1) + { + switch (opt) + { + case 'a': + append = 1; + break; + case 'i': + nointr = 1; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + if (nointr == 0) + interrupt_immediately++; + + buf = xmalloc (TEE_BUFSIZE); + + /* Initialize output file list. */ + fl = tee_flist = (FLIST *)xmalloc (sizeof(FLIST)); + tee_flist->fd = 1; + tee_flist->fname = "stdout"; + tee_flist->next = (FLIST *)NULL; + + /* Add file arguments to list of output files. */ + fflags = append ? O_WRONLY|O_CREAT|O_APPEND : O_WRONLY|O_CREAT|O_TRUNC; + for (rval = EXECUTION_SUCCESS; list; list = list->next) + { + fd = open (list->word->word, fflags, 0666); + if (fd < 0) + { + builtin_error ("%s: cannot open: %s", list->word->word, strerror (errno)); + rval = EXECUTION_FAILURE; + } + else + { + fl->next = (FLIST *)xmalloc (sizeof(FLIST)); + fl->next->fd = fd; + fl->next->fname = list->word->word; + fl = fl->next; + fl->next = (FLIST *)NULL; + } + } + + while ((nr = read(0, buf, TEE_BUFSIZE)) > 0) + for (fl = tee_flist; fl; fl = fl->next) + { + n = nr; + bp = buf; + do + { + if ((nw = write (fl->fd, bp, n)) == -1) + { + builtin_error ("%s: write error: %s", fl->fname, strerror (errno)); + rval = EXECUTION_FAILURE; + break; + } + bp += nw; + } + while (n -= nw); + } + if (nr < 0) + builtin_error ("read error: %s", strerror (errno)); + + /* Deallocate resources -- this is a builtin command. */ + tee_flist = tee_flist->next; /* skip bogus close of stdout */ + while (tee_flist) + { + fl = tee_flist; + if (close (fl->fd) < 0) + { + builtin_error ("%s: close_error: %s", fl->fname, strerror (errno)); + rval = EXECUTION_FAILURE; + } + tee_flist = tee_flist->next; + free (fl); + } + + return (rval); +} + +char *tee_doc[] = { + "Duplicate standard output.", + "", + "Copy standard input to standard output, making a copy in each", + "filename argument. If the `-a' option is gived, the specified", + "files are appended to, otherwise they are overwritten. If the", + "`-i' option is supplied, tee ignores interrupts.", + (char *)NULL +}; + +struct builtin tee_struct = { + "tee", /* builtin name */ + tee_builtin, /* function implementing the builtin */ + BUILTIN_ENABLED, /* initial flags for builtin */ + tee_doc, /* array of long documentation strings. */ + "tee [-ai] [file ...]", /* usage synopsis; becomes short_doc */ + 0 /* reserved for internal use */ +}; diff --git a/examples/loadables/template.c b/examples/loadables/template.c new file mode 100644 index 0000000..3a5814f --- /dev/null +++ b/examples/loadables/template.c @@ -0,0 +1,59 @@ +/* template - example template for loadable builtin */ + +/* See Makefile for compilation details. */ + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif +#include "bashansi.h" +#include +#include + +#include "builtins.h" +#include "shell.h" +#include "bashgetopt.h" + +#if !defined (errno) +extern int errno; +#endif + +extern char *strerror (); + +template_builtin (list) + WORD_LIST *list; +{ + int opt, rval; + + rval = EXECUTION_SUCCESS; + reset_internal_getopt (); + while ((opt = internal_getopt (list, "")) != -1) + { + switch (opt) + { + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + return (rval); +} + +char *template_doc[] = { + "Short description.", + "" + "Longer description of builtin and usage.", + (char *)NULL +}; + +struct builtin template_struct = { + "template", /* builtin name */ + template_builtin, /* function implementing the builtin */ + BUILTIN_ENABLED, /* initial flags for builtin */ + template_doc, /* array of long documentation strings. */ + "template", /* usage synopsis; becomes short_doc */ + 0 /* reserved for internal use */ +}; diff --git a/examples/loadables/truefalse.c b/examples/loadables/truefalse.c new file mode 100644 index 0000000..113e88f --- /dev/null +++ b/examples/loadables/truefalse.c @@ -0,0 +1,70 @@ +/* true and false builtins */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include "bashtypes.h" +#include "shell.h" +#include "builtins.h" +#include "common.h" + +true_builtin (list) + WORD_LIST *list; +{ + return EXECUTION_SUCCESS; +} + +false_builtin (list) + WORD_LIST *list; +{ + return EXECUTION_FAILURE; +} + +static char *true_doc[] = { + "Exit successfully.", + "", + "Return a successful result.", + (char *)NULL +}; + +static char *false_doc[] = { + "Exit unsuccessfully.", + "", + "Return an unsuccessful result.", + (char *)NULL +}; + +struct builtin true_struct = { + "true", + true_builtin, + BUILTIN_ENABLED, + true_doc, + "true", + 0 +}; + +struct builtin false_struct = { + "false", + false_builtin, + BUILTIN_ENABLED, + false_doc, + "false", + 0 +}; diff --git a/examples/loadables/tty.c b/examples/loadables/tty.c new file mode 100644 index 0000000..1d88506 --- /dev/null +++ b/examples/loadables/tty.c @@ -0,0 +1,80 @@ +/* tty - return terminal name */ + +/* See Makefile for compilation details. */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include +#include "builtins.h" +#include "shell.h" +#include "bashgetopt.h" +#include "common.h" + +extern char *ttyname (); + +tty_builtin (list) + WORD_LIST *list; +{ + int opt, sflag; + char *t; + + reset_internal_getopt (); + sflag = 0; + while ((opt = internal_getopt (list, "s")) != -1) + { + switch (opt) + { + case 's': + sflag = 1; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + t = ttyname (0); + if (sflag == 0) + puts (t ? t : "not a tty"); + return (t ? EXECUTION_SUCCESS : EXECUTION_FAILURE); +} + +char *tty_doc[] = { + "Display terminal name.", + "", + "tty writes the name of the terminal that is opened for standard", + "input to standard output. If the `-s' option is supplied, nothing", + "is written; the exit status determines whether or not the standard", + "input is connected to a tty.", + (char *)NULL +}; + +/* The standard structure describing a builtin command. bash keeps an array + of these structures. */ +struct builtin tty_struct = { + "tty", /* builtin name */ + tty_builtin, /* function implementing the builtin */ + BUILTIN_ENABLED, /* initial flags for builtin */ + tty_doc, /* array of long documentation strings. */ + "tty [-s]", /* usage synopsis; becomes short_doc */ + 0 /* reserved for internal use */ +}; diff --git a/examples/loadables/uname.c b/examples/loadables/uname.c new file mode 100644 index 0000000..a1bddd5 --- /dev/null +++ b/examples/loadables/uname.c @@ -0,0 +1,160 @@ +/* + * uname - print system information + * + * usage: uname [-amnrsv] + * + */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include +#include + +#include "bashtypes.h" + +#if defined (HAVE_UNAME) +# include +#else +struct utsname { + char sysname[32]; + char nodename[32]; + char release[32]; + char version[32]; + char machine[32]; +}; +#endif + +#include + +#include "builtins.h" +#include "shell.h" +#include "bashgetopt.h" +#include "common.h" + +#define FLAG_SYSNAME 0x01 /* -s */ +#define FLAG_NODENAME 0x02 /* -n */ +#define FLAG_RELEASE 0x04 /* -r */ +#define FLAG_VERSION 0x08 /* -v */ +#define FLAG_MACHINE 0x10 /* -m, -p */ + +#define FLAG_ALL 0x1f + +#ifndef errno +extern int errno; +#endif + +static void uprint(); + +static int uname_flags; + +uname_builtin (list) + WORD_LIST *list; +{ + int opt, r; + struct utsname uninfo; + + uname_flags = 0; + reset_internal_getopt (); + while ((opt = internal_getopt (list, "amnprsv")) != -1) + { + switch (opt) + { + case 'a': + uname_flags |= FLAG_ALL; + break; + case 'm': + case 'p': + uname_flags |= FLAG_MACHINE; + break; + case 'n': + uname_flags |= FLAG_NODENAME; + break; + case 'r': + uname_flags |= FLAG_RELEASE; + break; + case 's': + uname_flags |= FLAG_SYSNAME; + break; + case 'v': + uname_flags |= FLAG_VERSION; + break; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + if (list) + { + builtin_usage (); + return (EX_USAGE); + } + + if (uname_flags == 0) + uname_flags = FLAG_SYSNAME; + + /* Only ancient systems will not have uname(2). */ +#ifdef HAVE_UNAME + if (uname (&uninfo) < 0) + { + builtin_error ("cannot get system name: %s", strerror (errno)); + return (EXECUTION_FAILURE); + } +#else + builtin_error ("cannot get system information: uname(2) not available"); + return (EXECUTION_FAILURE); +#endif + + uprint (FLAG_SYSNAME, uninfo.sysname); + uprint (FLAG_NODENAME, uninfo.nodename); + uprint (FLAG_RELEASE, uninfo.release); + uprint (FLAG_VERSION, uninfo.version); + uprint (FLAG_MACHINE, uninfo.machine); + + return (EXECUTION_SUCCESS); +} + +static void +uprint (flag, info) + int flag; + char *info; +{ + if (uname_flags & flag) + { + uname_flags &= ~flag; + printf ("%s%c", info, uname_flags ? ' ' : '\n'); + } +} + +char *uname_doc[] = { + "Display system information.", + "", + "Display information about the system hardware and OS.", + (char *)NULL +}; + +struct builtin uname_struct = { + "uname", + uname_builtin, + BUILTIN_ENABLED, + uname_doc, + "uname [-amnrsv]", + 0 +}; diff --git a/examples/loadables/unlink.c b/examples/loadables/unlink.c new file mode 100644 index 0000000..07e3f3d --- /dev/null +++ b/examples/loadables/unlink.c @@ -0,0 +1,73 @@ +/* unlink - remove a directory entry */ + +/* Should only be used to remove directories by a superuser prepared to let + fsck clean up the file system. */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#ifdef HAVE_UNISTD_H +#include +#endif + +#include +#include + +#include "builtins.h" +#include "shell.h" +#include "common.h" + +#ifndef errno +extern int errno; +#endif + +unlink_builtin (list) + WORD_LIST *list; +{ + if (list == 0) + { + builtin_usage (); + return (EX_USAGE); + } + + if (unlink (list->word->word) != 0) + { + builtin_error ("%s: cannot unlink: %s", list->word->word, strerror (errno)); + return (EXECUTION_FAILURE); + } + + return (EXECUTION_SUCCESS); +} + +char *unlink_doc[] = { + "Remove a directory entry.", + "", + "Forcibly remove a directory entry, even if it's a directory.", + (char *)NULL +}; + +struct builtin unlink_struct = { + "unlink", /* builtin name */ + unlink_builtin, /* function implementing the builtin */ + BUILTIN_ENABLED, /* initial flags for builtin */ + unlink_doc, /* array of long documentation strings. */ + "unlink name", /* usage synopsis; becomes short_doc */ + 0 /* reserved for internal use */ +}; diff --git a/examples/loadables/whoami.c b/examples/loadables/whoami.c new file mode 100644 index 0000000..6f8471a --- /dev/null +++ b/examples/loadables/whoami.c @@ -0,0 +1,73 @@ +/* + * whoami - print out username of current user + */ + +/* + Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include +#include + +#include "builtins.h" +#include "shell.h" +#include "bashgetopt.h" +#include "common.h" + +whoami_builtin (list) + WORD_LIST *list; +{ + int opt; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "")) != -1) + { + switch (opt) + { + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + if (list) + { + builtin_usage (); + return (EX_USAGE); + } + + if (current_user.user_name == 0) + get_current_user_info (); + printf ("%s\n", current_user.user_name); + return (EXECUTION_SUCCESS); +} + +char *whoami_doc[] = { + "Print user name", + "", + "Display name of current user.", + (char *)NULL +}; + +struct builtin whoami_struct = { + "whoami", + whoami_builtin, + BUILTIN_ENABLED, + whoami_doc, + "whoami", + 0 +}; diff --git a/examples/misc/aliasconv.bash b/examples/misc/aliasconv.bash new file mode 100755 index 0000000..22a0447 --- /dev/null +++ b/examples/misc/aliasconv.bash @@ -0,0 +1,44 @@ +#! /bin/bash +# +# aliasconv.bash - convert csh aliases to bash aliases and functions +# +# usage: aliasconv.bash +# +# Chet Ramey +# chet@po.cwru.edu +# +trap 'rm -f $TMPFILE' 0 1 2 3 6 15 + +TMPFILE=$(mktemp -t cb.XXXXXX) || exit 1 + +T=$'\t' + +cat << \EOF >$TMPFILE +mkalias () +{ + case $2 in + '') echo alias ${1}="''" ;; + *[#\!]*) + comm=$(echo $2 | sed 's/\!\*/"$\@"/g + s/\!:\([1-9]\)/"$\1"/g + s/#/\#/g') + echo $1 \(\) "{" command "$comm" "; }" + ;; + *) echo alias ${1}=\'$(echo "${2}" | sed "s:':'\\\\'':g")\' ;; + esac +} +EOF + +# the first thing we want to do is to protect single quotes in the alias, +# since they whole thing is going to be surrounded by single quotes when +# passed to mkalias + +sed -e "s:':\\'\\\'\\':" -e "s/^\([a-zA-Z0-9_-]*\)$T\(.*\)$/mkalias \1 '\2'/" >>$TMPFILE + +$BASH $TMPFILE | sed -e 's/\$cwd/\$PWD/g' \ + -e 's/\$term/\$TERM/g' \ + -e 's/\$home/\$HOME/g' \ + -e 's/\$user/\$USER/g' \ + -e 's/\$prompt/\$PS1/g' + +exit 0 diff --git a/examples/misc/aliasconv.sh b/examples/misc/aliasconv.sh new file mode 100755 index 0000000..fe975d6 --- /dev/null +++ b/examples/misc/aliasconv.sh @@ -0,0 +1,42 @@ +#! /bin/bash +# +# aliasconv.sh - convert csh aliases to bash aliases and functions +# +# usage: aliasconv.sh +# +# Chet Ramey +# chet@po.cwru.edu +# +trap 'rm -f $TMPFILE' 0 1 2 3 6 15 +TMPFILE=$(mktemp -t cb.XXXXXX) || exit 1 +T=' ' + +cat << \EOF >$TMPFILE +mkalias () +{ + case $2 in + '') echo alias ${1}="''" ;; + *[#\!]*) + comm=`echo $2 | sed 's/\\!\*/"$\@"/g + s/\\!:\([1-9]\)/"$\1"/g + s/#/\#/g'` + echo $1 \(\) "{" command "$comm" "; }" + ;; + *) echo alias ${1}=\'`echo "${2}" | sed "s:':'\\\\\\\\'':"`\' ;; + esac +} +EOF + +# the first thing we want to do is to protect single quotes in the alias, +# since they whole thing is going to be surrounded by single quotes when +# passed to mkalias + +sed -e "s:':\\'\\\'\\':" -e "s/^\([a-zA-Z0-9_-]*\)$T\(.*\)$/mkalias \1 '\2'/" >>$TMPFILE + +sh $TMPFILE | sed -e 's/\$cwd/\$PWD/g' \ + -e 's/\$term/\$TERM/g' \ + -e 's/\$home/\$HOME/g' \ + -e 's/\$user/\$USER/g' \ + -e 's/\$prompt/\$PS1/g' + +exit 0 diff --git a/examples/misc/cshtobash b/examples/misc/cshtobash new file mode 100755 index 0000000..ce49bfc --- /dev/null +++ b/examples/misc/cshtobash @@ -0,0 +1,139 @@ +#! /bin/bash +# +# cshtobash - convert csh aliases, environment variables, and variables to +# bash equivalents +# +# usage: cshtobash [filename] +# +# If filename is given, that file is sourced. Note that csh always +# sources .cshrc. To recreate your csh login environment, run +# `cshtobash ~/.login'. +# +# Inspired by (and some borrowed from) a similar program distributed with +# zsh-3.0. +# +# Chet Ramey +# chet@po.cwru.edu +# +trap 'rm -f $TMPFILE1 $TMPFILEa $TMPFILEe $TMPFILEv $TMPFILEco $TMPFILEci' 0 1 2 3 6 15 + +{ TMPFILE1=$(mktemp -t cb.1.XXXXXX) && + TMPFILEa=$(mktemp -t cb.a.XXXXXX) && + TMPFILEe=$(mktemp -t cb.e.XXXXXX) && + TMPFILEv=$(mktemp -t cb.v.XXXXXX) && + TMPFILEco=$(mktemp -t cshout.XXXXXX) && + TMPFILEci=$(mktemp -t cshin.XXXXXX) +} || exit 1 + + +T=$'\t' + +SOURCE="${1:+source $1}" + +cat << EOF >$TMPFILEci +$SOURCE +alias >! $TMPFILEa +setenv >! $TMPFILEe +set >! $TMPFILEv +EOF + +# give csh a minimal environment, similar to what login would provide +/usr/bin/env - USER=$USER HOME=$HOME PATH=/usr/bin:/bin:/usr/ucb:. TERM=$TERM SHELL=$SHELL /bin/csh -i < $TMPFILEci > $TMPFILEco 2>&1 + +# First convert aliases + +cat << \EOF >$TMPFILE1 +mkalias () +{ + case $2 in + '') echo alias ${1}="''" ;; + *[#\!]*) + comm=$(echo $2 | sed 's/\!\*/"$\@"/g + s/\!:\([1-9]\)/"$\1"/g + s/#/\#/g') + echo $1 \(\) "{" command "$comm" "; }" + ;; + *) echo alias ${1}=\'$(echo "${2}" | sed "s:':'\\\\'':")\' ;; + esac +} +EOF + +sed "s/^\([a-zA-Z0-9_]*\)$T\(.*\)$/mkalias \1 '\2'/" < $TMPFILEa >>$TMPFILE1 + +echo '# csh aliases' +echo + +$BASH $TMPFILE1 | sed -e 's/\$cwd/\$PWD/g' \ + -e 's/\$term/\$TERM/g' \ + -e 's/\$home/\$HOME/g' \ + -e 's/\$user/\$USER/g' \ + -e 's/\$prompt/\$PS1/g' + +# Next, convert environment variables +echo +echo '# csh environment variables' +echo + +# Would be nice to deal with embedded newlines, e.g. in TERMCAP, but ... +sed -e '/^SHLVL/d' \ + -e '/^PWD/d' \ + -e "s/'/'"\\\\"''"/g \ + -e "s/^\([A-Za-z0-9_]*=\)/export \1'/" \ + -e "s/$/'/" < $TMPFILEe + +# Finally, convert local variables +echo +echo '# csh variables' +echo + +sed -e 's/'"$T"'/=/' \ + -e "s/'/'"\\\\"''"/g \ + -e '/^[A-Za-z0-9_]*=[^(]/{ + s/=/='"'/"' + s/$/'"'/"' + }' < $TMPFILEv | +sed -e '/^argv=/d' -e '/^cwd=/d' -e '/^filec=/d' -e '/^status=/d' \ + -e '/^verbose=/d' \ + -e '/^term=/d' \ + -e '/^home=/d' \ + -e '/^path=/d' \ + -e '/^user=/d' \ + -e '/^shell=/d' \ + -e '/^cdpath=/d' \ + -e '/^mail=/d' \ + -e '/^home=/s//HOME=/' \ + -e '/^prompt=/s//PS1=/' \ + -e '/^histfile=/s//HISTFILE=/' \ + -e '/^history=/s//HISTSIZE=/' \ + -e '/^savehist=$/s//HISTFILESIZE=${HISTSIZE-500}/' \ + -e '/^savehist=/s//HISTFILESIZE=/' \ + -e '/^ignoreeof=$/s/^.*$/set -o ignoreeof # ignoreeof/' \ + -e '/^ignoreeof=/s//IGNOREEOF=/' \ + -e '/^noclobber=/s/^.*$/set -C # noclobber/' \ + -e '/^notify=/s/^.*$/set -b # notify/' \ + -e '/^noglob=/s/^.*$/set -f # noglob/' \ + + +# now some special csh variables converted to bash equivalents +echo +echo '# special csh variables converted to bash equivalents' +echo + +sed -e 's/'"$T"'/=/' < $TMPFILEv | +grep "^cdpath=" | +sed 's/(// + s/ /:/g + s/)// + s/cdpath=/CDPATH=/' + + +sed -e 's/'"$T"'/=/' < $TMPFILEv | +grep "^mail=" | +sed 's/(// + s/ /:/g + s/)// + s/mail=/MAILPATH=/' | +sed -e 's/MAILPATH=\([0-9][0-9][^:]*\)$/MAILCHECK=\1/' \ + -e 's/MAILPATH=\([0-9][0-9][^:]*\):\(.*\)/MAILCHECK=\1 MAILPATH=\2/' + +exit 0 diff --git a/examples/scripts/cat.sh b/examples/scripts/cat.sh new file mode 100644 index 0000000..3e65b3f --- /dev/null +++ b/examples/scripts/cat.sh @@ -0,0 +1,12 @@ +shcat() +{ + while read -r ; do + printf "%s\n" "$REPLY" + done +} + +if [ -n "$1" ]; then + shcat < "$1" +else + shcat +fi diff --git a/examples/scripts/center b/examples/scripts/center new file mode 100644 index 0000000..dbe6133 --- /dev/null +++ b/examples/scripts/center @@ -0,0 +1,41 @@ +#! /bin/bash +# +# center - center a group of lines +# +# tabs in the lines might cause this to look a little bit off +# +# +# Chet Ramey +# +# Copyright 1999 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +width=${COLUMNS:-80} + +if [[ $# == 0 ]] +then + set -- /dev/stdin +fi + +for file +do + while read -r + do + printf "%*s\n" $(( (width+${#REPLY})/2 )) "$REPLY" + done < $file +done + +exit 0 diff --git a/examples/scripts/inpath b/examples/scripts/inpath new file mode 100755 index 0000000..95f28bc --- /dev/null +++ b/examples/scripts/inpath @@ -0,0 +1,19 @@ +#! /bin/sh +# +# Search $PATH for a file the same name as $1; return TRUE if found. +# + +command=$1 +[ -n "$command" ] || exit 1 + +set `echo $PATH | sed 's/^:/.:/ + s/::/:.:/g + s/:$/:./ + s/:/ /g'` + +while [ $# -ne 0 ] ; do + [ -f $1/$command ] && exit 0 # test -x not universal + shift +done + +exit 1 diff --git a/examples/scripts/shprompt b/examples/scripts/shprompt new file mode 100755 index 0000000..098c45f --- /dev/null +++ b/examples/scripts/shprompt @@ -0,0 +1,153 @@ +# +# shprompt -- give a prompt and get an answer satisfying certain criteria +# +# shprompt [-dDfFsy] prompt +# s = prompt for string +# f = prompt for filename +# F = prompt for full pathname to a file or directory +# d = prompt for a directory name +# D = prompt for a full pathname to a directory +# y = prompt for y or n answer +# +# Chet Ramey +# chet@ins.CWRU.Edu +# +# Copyright 2002 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +type=file + +OPTS=dDfFsy + +succeed() +{ + echo "$1" + exit 0 +} + +while getopts "$OPTS" c +do + case "$c" in + s) type=string + ;; + f) type=file + ;; + F) type=path + ;; + d) type=dir + ;; + D) type=dirpath + ;; + y) type=yesno + ;; + ?) echo "usage: $0 [-$OPTS] prompt" 1>&2 + exit 2 + ;; + esac +done + +if [ "$OPTIND" -gt 1 ] ; then + shift $(( $OPTIND - 1 )) +fi + +while : +do + case "$type" in + string) + echo -n "$1" 1>&2 + read ans || exit 1 + if [ -n "$ans" ] ; then + succeed "$ans" + fi + ;; + file|path) + echo -n "$1" 1>&2 + read ans || exit 1 + # + # use `fn' and eval so that bash will do tilde expansion for + # me + # + eval fn="$ans" + case "$fn" in + /*) if test -e "$fn" ; then + succeed "$fn" + else + echo "$0: '$fn' does not exist" 1>&2 + fi + ;; + *) if [ "$type" = "path" ] ; then + echo "$0: must give full pathname to file" 1>&2 + else + if test -e "$fn" ; then + succeed "$fn" + else + echo "$0: '$fn' does not exist" 1>&2 + fi + fi + ;; + esac + ;; + dir|dirpath) + echo -n "$1" 1>&2 + read ans || exit 1 + # + # use `fn' and eval so that bash will do tilde expansion for + # me + # + eval fn="$ans" + case "$fn" in + /*) if test -d "$fn" ; then + succeed "$fn" + elif test -e "$fn" ; then + echo "$0 '$fn' is not a directory" 1>&2 + else + echo "$0: '$fn' does not exist" 1>&2 + fi + ;; + *) if [ "$type" = "dirpath" ] ; then + echo "$0: must give full pathname to directory" 1>&2 + else + if test -d "$fn" ; then + succeed "$fn" + elif test -e "$fn" ; then + echo "$0 '$fn' is not a directory" 1>&2 + else + echo "$0: '$fn' does not exist" 1>&2 + fi + fi + ;; + esac + ;; + yesno) + echo -n "$1" 1>&2 + read ans || exit 1 + case "$ans" in + y|Y|[yY][eE][sS]) + succeed "yes" + ;; + n|N|[nN][oO]) + succeed "no" + exit 0 + ;; + *) + echo "$0: yes or no required" 1>&2 + ;; + esac + ;; + esac +done + +exit 1 diff --git a/examples/scripts/spin.bash b/examples/scripts/spin.bash new file mode 100644 index 0000000..9fa9125 --- /dev/null +++ b/examples/scripts/spin.bash @@ -0,0 +1,37 @@ +#!/bin/bash +# +# spin.bash -- provide a `spinning wheel' to show progress +# +# Chet Ramey +# chet@po.cwru.edu +# +# Copyright 1997 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +bs=$'\b' + +chars="|${bs} \\${bs} -${bs} /${bs}" + +# Infinite loop for demo. purposes +while : +do + for letter in $chars + do + echo -n ${letter} + done +done + +exit 0 diff --git a/examples/scripts/xterm_title b/examples/scripts/xterm_title new file mode 100755 index 0000000..839003f --- /dev/null +++ b/examples/scripts/xterm_title @@ -0,0 +1,44 @@ +#! /bin/bash +# +# xterm_title - print the contents of the xterm title bar +# +# Derived from http://www.clark.net/pub/dickey/xterm/xterm.faq.html#how2_title +# + +# Copyright 1997 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +P=${0##*/} +[ -z "$DISPLAY" ] && { + echo "${P}: not running X" >&2 + exit 1 +} + +if [ -z "$TERM" ] || [ "$TERM" != "xterm" ]; then + echo "${P}: not running in an xterm" >&2 + exit 1 +fi + +exec /dev/tty +IFS='' read -r a +stty $old +b=${a#???} +echo "${b%??}" + +exit 0 diff --git a/examples/scripts/zprintf b/examples/scripts/zprintf new file mode 100755 index 0000000..86f9e95 --- /dev/null +++ b/examples/scripts/zprintf @@ -0,0 +1,43 @@ +#! /bin/bash +# +# zprintf - function that calls gawk to do printf for those systems that +# don't have a printf executable +# +# The format and arguments can have trailing commas, just like gawk +# +# example: +# zprintf 'Eat %x %x and suck %x!\n' 57005 48879 64206 +# +# Chet Ramey +# chet@po.cwru.edu + +# Copyright 1996 Chester Ramey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# TThis program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +[ $# -lt 1 ] && { + echo "zprintf: usage: zprintf format [args ...]" >&2 + exit 2 +} + +fmt="${1%,}" +shift + +for a in "$@"; do + args="$args,\"${a%,}\"" +done + +gawk "BEGIN { printf \"$fmt\" $args }" diff --git a/examples/startup-files/Bash_aliases b/examples/startup-files/Bash_aliases new file mode 100644 index 0000000..ed21062 --- /dev/null +++ b/examples/startup-files/Bash_aliases @@ -0,0 +1,63 @@ +# Some useful aliases. +alias texclean='rm -f *.toc *.aux *.log *.cp *.fn *.tp *.vr *.pg *.ky' +alias clean='echo -n "Really clean this directory?"; + read yorn; + if test "$yorn" = "y"; then + rm -f \#* *~ .*~ *.bak .*.bak *.tmp .*.tmp core a.out; + echo "Cleaned."; + else + echo "Not cleaned."; + fi' +alias h='history' +alias j="jobs -l" +alias l="ls -l " +alias ll="ls -l" +alias ls="ls -F" +alias pu="pushd" +alias po="popd" + +# +# Csh compatability: +# +alias unsetenv=unset +function setenv () { + export $1="$2" +} + +# Function which adds an alias to the current shell and to +# the ~/.bash_aliases file. +add-alias () +{ + local name=$1 value="$2" + echo alias $name=\'$value\' >>~/.bash_aliases + eval alias $name=\'$value\' + alias $name +} + +# "repeat" command. Like: +# +# repeat 10 echo foo +repeat () +{ + local count="$1" i; + shift; + for i in $(_seq 1 "$count"); + do + eval "$@"; + done +} + +# Subfunction needed by `repeat'. +_seq () +{ + local lower upper output; + lower=$1 upper=$2; + + if [ $lower -ge $upper ]; then return; fi + while [ $lower -lt $upper ]; + do + echo -n "$lower " + lower=$(($lower + 1)) + done + echo "$lower" +} diff --git a/examples/startup-files/Bash_profile b/examples/startup-files/Bash_profile new file mode 100644 index 0000000..141e8df --- /dev/null +++ b/examples/startup-files/Bash_profile @@ -0,0 +1,18 @@ +# Startup file for bash login shells. +# +default_dir=/usr/local/lib/ + +if [ -n "$PS1" ]; then + PS1='\u@\h(\#)\$ ' + IGNOREEOF=3 +fi + +LOGIN_SHELL=true + +# If the user has her own init file, then use that one, else use the +# canonical one. +if [ -f ~/.bashrc ]; then + . ~/.bashrc +elif [ -f ${default_dir}Bashrc ]; then + . ${default_dir}Bashrc; +fi diff --git a/examples/startup-files/Bashrc.bfox b/examples/startup-files/Bashrc.bfox new file mode 100644 index 0000000..efe7d88 --- /dev/null +++ b/examples/startup-files/Bashrc.bfox @@ -0,0 +1,70 @@ +# Bourne Again SHell init file. +# +# Files you make look like rw-rw-r +umask 002 + +# Don't make useless coredump files. If you want a coredump, +# say "ulimit -c unlimited" and then cause a segmentation fault. +ulimit -c 0 + +# Sometimes, there are lots of places that one can find tex inputs. +export TEXINPUTS=.:$HOME/bin:/usr/lib/tex/inputs:/usr/local/lib/tex/inputs + +# Where's the Gnu stuff at? +GNU=/usr/gnu/bin +X11=/usr/bin/X11 + +UTIL_PATH=$GNU:$X11 +STANDARD_PATH=/usr/local/bin:/usr/ucb:/bin:/usr/bin:/usr/etc:/etc:/usr/games + +if [ -d $HOME/bin/$HOSTTYPE ]; then + MY_PATH=$HOME/bin/$HOSTTYPE +fi + +if [ -d $HOME/bin ]; then + MY_PATH=$MY_PATH:$HOME/bin +fi + +if [ -d /usr/hosts ]; then + STANDARD_PATH=$STANDARD_PATH:/usr/hosts +fi + +PATH=.:$MY_PATH:$UTIL_PATH:$STANDARD_PATH + +# If not running interactively, then return +if [ -z "$PS1" ]; then + return +fi + +# Set ignoreeof if you don't want EOF as the sole input to the shell to +# immediately signal a quit condition. This only happens at the start +# of a line if the line is empty, and you haven't just deleted a character +# with C-d. I turn this on in ~/.bash_profile so that only login shells +# have the right to be obnoxious. +# set -o ignoreeof + +# Set auto_resume if you want to resume on "emacs", as well as on +# "%emacs". +auto_resume=exact + +# Set notify if you want to be asynchronously notified about background +# job completion. +set -o notify + +# Make it so that failed `exec' commands don't flush this shell. +shopt -s execfail + +if [ -z "$LOGIN_SHELL" ]; then + PS1="\u@\h\$ " +fi + +HISTSIZE=256 +MAILCHECK=60 + +# A couple of default aliases. +alias j='jobs -l' +alias po=popd +alias pu=pushd +alias ls='ls -F' + +[ -f ~/.bash_aliases ] && . ~/.bash_aliases diff --git a/examples/startup-files/README b/examples/startup-files/README new file mode 100644 index 0000000..00df041 --- /dev/null +++ b/examples/startup-files/README @@ -0,0 +1,12 @@ +Some sample startup files. The ones starting with capital letters +are originally from Brian Fox. The ones starting with lowercase +letters are from Chet Ramey. + +They will require changes for your environment. + +Bash_aliases Some useful aliases (Fox). +Bash_profile Sample startup file for bash login shells (Fox). +bash-profile Sample startup file for bash login shells (Ramey). +bashrc Sample Bourne Again SHell init file (Ramey). +Bashrc.bfox Sample Bourne Again SHell init file (Fox). +README README diff --git a/examples/startup-files/bash-profile b/examples/startup-files/bash-profile new file mode 100644 index 0000000..e811df8 --- /dev/null +++ b/examples/startup-files/bash-profile @@ -0,0 +1,39 @@ +# This is the filename where your incoming mail arrives. +MAIL=~/mbox +MAILCHECK=30 + +HISTFILE=~/.history/history.$HOSTNAME + +PATH1=/usr/homes/chet/bin.$HOSTTYPE:/usr/local/bin/gnu: +PATH2=/usr/local/bin:/usr/ucb:/bin:/usr/bin/X11:. +PATH3=/usr/bin:/usr/new/bin:/usr/contrib/bin +PATH=$PATH1:$PATH2:$PATH3 + +EDITOR=/usr/local/bin/ce VISUAL=/usr/local/bin/ce FCEDIT=/usr/local/bin/ce + +SHELL=${SHELL:-${BASH:-/bin/bash}} + +PAGER=/usr/local/bin/less +LESS='-i -e -M -P%t?f%f :stdin .?pb%pb\%:?lbLine %lb:?bbByte %bb:-...' +# +# Bogus 1003.2 variables. This should really be in /etc/profile +# +LOGNAME=${USER-$(whoami)} +TZ=US/Eastern + +export HOME VISUAL EDITOR MAIL SHELL PATH TERM +export PAGER LESS TERMCAP HISTSIZE HISTFILE MAIL MAILCHECK LOGNAME TZ + +PS1="${HOSTNAME}\$ " +PS2='> ' +export PS1 PS2 + +umask 022 + +if [ -f /unix ] ; then + stty intr ^c # bogus +fi + +if [ -f ~/.bashrc ] ; then + . ~/.bashrc +fi diff --git a/examples/startup-files/bashrc b/examples/startup-files/bashrc new file mode 100644 index 0000000..2d8d37b --- /dev/null +++ b/examples/startup-files/bashrc @@ -0,0 +1,133 @@ +case $- in +*i*) ;; +*) return ;; +esac + +# bogus +if [ -f /unix ] ; then + alias ls='/bin/ls -CF' +else + alias ls='/bin/ls -F' +fi +alias ll='ls -l' +alias dir='ls -ba' + +alias ss="ps -aux" +alias dot='ls .[a-zA-Z0-9_]*' +alias news="xterm -g 80x45 -e trn -e -S1 -N &" + +alias c="clear" +alias m="more" +alias j="jobs" + +# common misspellings +alias mroe=more +alias pdw=pwd + +hash -p /usr/bin/mail mail + +if [ -z "$HOST" ] ; then + export HOST=${HOSTNAME} +fi + +HISTIGNORE="[ ]*:&:bg:fg" + +psgrep() +{ + ps -aux | grep $1 | grep -v grep +} + +# +# This is a little like `zap' from Kernighan and Pike +# + +pskill() +{ + local pid + + pid=$(ps -ax | grep $1 | grep -v grep | awk '{ print $1 }') + echo -n "killing $1 (process $pid)..." + kill -9 $pid + echo "slaughtered." +} + +term() +{ + TERM=$1 + export TERM + tset +} + +xtitle () +{ + echo -n -e "\033]0;$*\007" +} + +cd() +{ + builtin cd "$@" && xtitle $HOST: $PWD +} + +bold() +{ + tput smso +} + +unbold() +{ + tput rmso +} + +if [ -f /unix ] ; then +clear() +{ + tput clear +} +fi + +rot13() +{ + if [ $# = 0 ] ; then + tr "[a-m][n-z][A-M][N-Z]" "[n-z][a-m][N-Z][A-M]" + else + tr "[a-m][n-z][A-M][N-Z]" "[n-z][a-m][N-Z][A-M]" < $1 + fi +} + +watch() +{ + if [ $# -ne 1 ] ; then + tail -f nohup.out + else + tail -f $1 + fi +} + +# +# Remote login passing all 8 bits (so meta key will work) +# +rl() +{ + rlogin $* -8 +} + +function setenv() +{ + if [ $# -ne 2 ] ; then + echo "setenv: Too few arguments" + else + export $1="$2" + fi +} + +function chmog() +{ + if [ $# -ne 4 ] ; then + echo "usage: chmog mode owner group file" + return 1 + else + chmod $1 $4 + chown $2 $4 + chgrp $3 $4 + fi +} diff --git a/execute_cmd.c b/execute_cmd.c new file mode 100644 index 0000000..9cebaef --- /dev/null +++ b/execute_cmd.c @@ -0,0 +1,5454 @@ +/* execute_cmd.c -- Execute a COMMAND structure. */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#if !defined (__GNUC__) && !defined (HAVE_ALLOCA_H) && defined (_AIX) + #pragma alloca +#endif /* _AIX && RISC6000 && !__GNUC__ */ + +#include +#include "chartypes.h" +#include "bashtypes.h" +#if !defined (_MINIX) && defined (HAVE_SYS_FILE_H) +# include +#endif +#include "filecntl.h" +#include "posixstat.h" +#include +#if defined (HAVE_SYS_PARAM_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "posixtime.h" + +#if defined (HAVE_SYS_RESOURCE_H) && !defined (RLIMTYPE) +# include +#endif + +#if defined (HAVE_SYS_TIMES_H) && defined (HAVE_TIMES) +# include +#endif + +#include + +#if !defined (errno) +extern int errno; +#endif + +#define NEED_FPURGE_DECL + +#include "bashansi.h" +#include "bashintl.h" + +#include "memalloc.h" +#include "shell.h" +#include /* use <...> so we pick it up from the build directory */ +#include "flags.h" +#include "builtins.h" +#include "hashlib.h" +#include "jobs.h" +#include "execute_cmd.h" +#include "findcmd.h" +#include "redir.h" +#include "trap.h" +#include "pathexp.h" +#include "hashcmd.h" + +#if defined (COND_COMMAND) +# include "test.h" +#endif + +#include "builtins/common.h" +#include "builtins/builtext.h" /* list of builtins */ + +#include +#include + +#if defined (BUFFERED_INPUT) +# include "input.h" +#endif + +#if defined (ALIAS) +# include "alias.h" +#endif + +#if defined (HISTORY) +# include "bashhist.h" +#endif + +extern int dollar_dollar_pid; +extern int posixly_correct; +extern int expand_aliases; +extern int autocd; +extern int breaking, continuing, loop_level; +extern int parse_and_execute_level, running_trap, sourcelevel; +extern int command_string_index, line_number; +extern int dot_found_in_search; +extern int already_making_children; +extern int tempenv_assign_error; +extern char *the_printed_command, *shell_name; +extern pid_t last_command_subst_pid; +extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin; +extern char **subshell_argv, **subshell_envp; +extern int subshell_argc; +extern time_t shell_start_time; +#if 0 +extern char *glob_argv_flags; +#endif + +extern int job_control; /* XXX */ + +extern int close __P((int)); + +/* Static functions defined and used in this file. */ +static void close_pipes __P((int, int)); +static void do_piping __P((int, int)); +static void bind_lastarg __P((char *)); +static int shell_control_structure __P((enum command_type)); +static void cleanup_redirects __P((REDIRECT *)); + +#if defined (JOB_CONTROL) +static int restore_signal_mask __P((sigset_t *)); +#endif + +static void async_redirect_stdin __P((void)); + +static int builtin_status __P((int)); + +static int execute_for_command __P((FOR_COM *)); +#if defined (SELECT_COMMAND) +static int displen __P((const char *)); +static int print_index_and_element __P((int, int, WORD_LIST *)); +static void indent __P((int, int)); +static void print_select_list __P((WORD_LIST *, int, int, int)); +static char *select_query __P((WORD_LIST *, int, char *, int)); +static int execute_select_command __P((SELECT_COM *)); +#endif +#if defined (DPAREN_ARITHMETIC) +static int execute_arith_command __P((ARITH_COM *)); +#endif +#if defined (COND_COMMAND) +static int execute_cond_node __P((COND_COM *)); +static int execute_cond_command __P((COND_COM *)); +#endif +#if defined (COMMAND_TIMING) +static int mkfmt __P((char *, int, int, time_t, int)); +static void print_formatted_time __P((FILE *, char *, + time_t, int, time_t, int, + time_t, int, int)); +static int time_command __P((COMMAND *, int, int, int, struct fd_bitmap *)); +#endif +#if defined (ARITH_FOR_COMMAND) +static intmax_t eval_arith_for_expr __P((WORD_LIST *, int *)); +static int execute_arith_for_command __P((ARITH_FOR_COM *)); +#endif +static int execute_case_command __P((CASE_COM *)); +static int execute_while_command __P((WHILE_COM *)); +static int execute_until_command __P((WHILE_COM *)); +static int execute_while_or_until __P((WHILE_COM *, int)); +static int execute_if_command __P((IF_COM *)); +static int execute_null_command __P((REDIRECT *, int, int, int)); +static void fix_assignment_words __P((WORD_LIST *)); +static int execute_simple_command __P((SIMPLE_COM *, int, int, int, struct fd_bitmap *)); +static int execute_builtin __P((sh_builtin_func_t *, WORD_LIST *, int, int)); +static int execute_function __P((SHELL_VAR *, WORD_LIST *, int, struct fd_bitmap *, int, int)); +static int execute_builtin_or_function __P((WORD_LIST *, sh_builtin_func_t *, + SHELL_VAR *, + REDIRECT *, struct fd_bitmap *, int)); +static void execute_subshell_builtin_or_function __P((WORD_LIST *, REDIRECT *, + sh_builtin_func_t *, + SHELL_VAR *, + int, int, int, + struct fd_bitmap *, + int)); +static int execute_disk_command __P((WORD_LIST *, REDIRECT *, char *, + int, int, int, struct fd_bitmap *, int)); + +static char *getinterp __P((char *, int, int *)); +static void initialize_subshell __P((void)); +static int execute_in_subshell __P((COMMAND *, int, int, int, struct fd_bitmap *)); +#if defined (COPROCESS_SUPPORT) +static int execute_coproc __P((COMMAND *, int, int, struct fd_bitmap *)); +#endif + +static int execute_pipeline __P((COMMAND *, int, int, int, struct fd_bitmap *)); + +static int execute_connection __P((COMMAND *, int, int, int, struct fd_bitmap *)); + +static int execute_intern_function __P((WORD_DESC *, FUNCTION_DEF *)); + +/* Set to 1 if fd 0 was the subject of redirection to a subshell. Global + so that reader_loop can set it to zero before executing a command. */ +int stdin_redir; + +/* The name of the command that is currently being executed. + `test' needs this, for example. */ +char *this_command_name; + +/* The printed representation of the currently-executing command (same as + the_printed_command), except when a trap is being executed. Useful for + a debugger to know where exactly the program is currently executing. */ +char *the_printed_command_except_trap; + +/* For catching RETURN in a function. */ +int return_catch_flag; +int return_catch_value; +procenv_t return_catch; + +/* The value returned by the last synchronous command. */ +int last_command_exit_value; + +/* Whether or not the last command (corresponding to last_command_exit_value) + was terminated by a signal, and, if so, which one. */ +int last_command_exit_signal; + +/* Are we currently ignoring the -e option for the duration of a builtin's + execution? */ +int builtin_ignoring_errexit = 0; + +/* The list of redirections to perform which will undo the redirections + that I made in the shell. */ +REDIRECT *redirection_undo_list = (REDIRECT *)NULL; + +/* The list of redirections to perform which will undo the internal + redirections performed by the `exec' builtin. These are redirections + that must be undone even when exec discards redirection_undo_list. */ +REDIRECT *exec_redirection_undo_list = (REDIRECT *)NULL; + +/* When greater than zero, value is the `level' of builtins we are + currently executing (e.g. `eval echo a' would have it set to 2). */ +int executing_builtin = 0; + +/* Non-zero if we are executing a command list (a;b;c, etc.) */ +int executing_list = 0; + +/* Non-zero if failing commands in a command substitution should not exit the + shell even if -e is set. Used to pass the CMD_IGNORE_RETURN flag down to + commands run in command substitutions by parse_and_execute. */ +int comsub_ignore_return = 0; + +/* Non-zero if we have just forked and are currently running in a subshell + environment. */ +int subshell_environment; + +/* Count of nested subshells, like SHLVL. Available via $BASH_SUBSHELL */ +int subshell_level = 0; + +/* Currently-executing shell function. */ +SHELL_VAR *this_shell_function; + +/* If non-zero, matches in case and [[ ... ]] are case-insensitive */ +int match_ignore_case = 0; + +int executing_command_builtin = 0; + +struct stat SB; /* used for debugging */ + +static int special_builtin_failed; + +static COMMAND *currently_executing_command; + +/* The line number that the currently executing function starts on. */ +static int function_line_number; + +/* XXX - set to 1 if we're running the DEBUG trap and we want to show the line + number containing the function name. Used by executing_line_number to + report the correct line number. Kind of a hack. */ +static int showing_function_line; + +/* $LINENO ($BASH_LINENO) for use by an ERR trap. Global so parse_and_execute + can save and restore it. */ +int line_number_for_err_trap; + +/* A sort of function nesting level counter */ +int funcnest = 0; +int funcnest_max = 0; /* bash-4.2 */ + +int lastpipe_opt = 0; + +struct fd_bitmap *current_fds_to_close = (struct fd_bitmap *)NULL; + +#define FD_BITMAP_DEFAULT_SIZE 32 + +/* Functions to allocate and deallocate the structures used to pass + information from the shell to its children about file descriptors + to close. */ +struct fd_bitmap * +new_fd_bitmap (size) + int size; +{ + struct fd_bitmap *ret; + + ret = (struct fd_bitmap *)xmalloc (sizeof (struct fd_bitmap)); + + ret->size = size; + + if (size) + { + ret->bitmap = (char *)xmalloc (size); + memset (ret->bitmap, '\0', size); + } + else + ret->bitmap = (char *)NULL; + return (ret); +} + +void +dispose_fd_bitmap (fdbp) + struct fd_bitmap *fdbp; +{ + FREE (fdbp->bitmap); + free (fdbp); +} + +void +close_fd_bitmap (fdbp) + struct fd_bitmap *fdbp; +{ + register int i; + + if (fdbp) + { + for (i = 0; i < fdbp->size; i++) + if (fdbp->bitmap[i]) + { + close (i); + fdbp->bitmap[i] = 0; + } + } +} + +/* Return the line number of the currently executing command. */ +int +executing_line_number () +{ + if (executing && showing_function_line == 0 && + (variable_context == 0 || interactive_shell == 0) && + currently_executing_command) + { +#if defined (COND_COMMAND) + if (currently_executing_command->type == cm_cond) + return currently_executing_command->value.Cond->line; +#endif +#if defined (DPAREN_ARITHMETIC) + if (currently_executing_command->type == cm_arith) + return currently_executing_command->value.Arith->line; +#endif +#if defined (ARITH_FOR_COMMAND) + if (currently_executing_command->type == cm_arith_for) + return currently_executing_command->value.ArithFor->line; +#endif + + return line_number; + } + else + return line_number; +} + +/* Execute the command passed in COMMAND. COMMAND is exactly what + read_command () places into GLOBAL_COMMAND. See "command.h" for the + details of the command structure. + + EXECUTION_SUCCESS or EXECUTION_FAILURE are the only possible + return values. Executing a command with nothing in it returns + EXECUTION_SUCCESS. */ +int +execute_command (command) + COMMAND *command; +{ + struct fd_bitmap *bitmap; + int result; + + current_fds_to_close = (struct fd_bitmap *)NULL; + bitmap = new_fd_bitmap (FD_BITMAP_DEFAULT_SIZE); + begin_unwind_frame ("execute-command"); + add_unwind_protect (dispose_fd_bitmap, (char *)bitmap); + + /* Just do the command, but not asynchronously. */ + result = execute_command_internal (command, 0, NO_PIPE, NO_PIPE, bitmap); + + dispose_fd_bitmap (bitmap); + discard_unwind_frame ("execute-command"); + +#if defined (PROCESS_SUBSTITUTION) + /* don't unlink fifos if we're in a shell function; wait until the function + returns. */ + if (variable_context == 0) + unlink_fifo_list (); +#endif /* PROCESS_SUBSTITUTION */ + + QUIT; + return (result); +} + +/* Return 1 if TYPE is a shell control structure type. */ +static int +shell_control_structure (type) + enum command_type type; +{ + switch (type) + { +#if defined (ARITH_FOR_COMMAND) + case cm_arith_for: +#endif +#if defined (SELECT_COMMAND) + case cm_select: +#endif +#if defined (DPAREN_ARITHMETIC) + case cm_arith: +#endif +#if defined (COND_COMMAND) + case cm_cond: +#endif + case cm_case: + case cm_while: + case cm_until: + case cm_if: + case cm_for: + case cm_group: + case cm_function_def: + return (1); + + default: + return (0); + } +} + +/* A function to use to unwind_protect the redirection undo list + for loops. */ +static void +cleanup_redirects (list) + REDIRECT *list; +{ + do_redirections (list, RX_ACTIVE); + dispose_redirects (list); +} + +#if 0 +/* Function to unwind_protect the redirections for functions and builtins. */ +static void +cleanup_func_redirects (list) + REDIRECT *list; +{ + do_redirections (list, RX_ACTIVE); +} +#endif + +void +dispose_exec_redirects () +{ + if (exec_redirection_undo_list) + { + dispose_redirects (exec_redirection_undo_list); + exec_redirection_undo_list = (REDIRECT *)NULL; + } +} + +#if defined (JOB_CONTROL) +/* A function to restore the signal mask to its proper value when the shell + is interrupted or errors occur while creating a pipeline. */ +static int +restore_signal_mask (set) + sigset_t *set; +{ + return (sigprocmask (SIG_SETMASK, set, (sigset_t *)NULL)); +} +#endif /* JOB_CONTROL */ + +#ifdef DEBUG +/* A debugging function that can be called from gdb, for instance. */ +void +open_files () +{ + register int i; + int f, fd_table_size; + + fd_table_size = getdtablesize (); + + fprintf (stderr, "pid %ld open files:", (long)getpid ()); + for (i = 3; i < fd_table_size; i++) + { + if ((f = fcntl (i, F_GETFD, 0)) != -1) + fprintf (stderr, " %d (%s)", i, f ? "close" : "open"); + } + fprintf (stderr, "\n"); +} +#endif + +static void +async_redirect_stdin () +{ + int fd; + + fd = open ("/dev/null", O_RDONLY); + if (fd > 0) + { + dup2 (fd, 0); + close (fd); + } + else if (fd < 0) + internal_error (_("cannot redirect standard input from /dev/null: %s"), strerror (errno)); +} + +#define DESCRIBE_PID(pid) do { if (interactive) describe_pid (pid); } while (0) + +/* Execute the command passed in COMMAND, perhaps doing it asynchronously. + COMMAND is exactly what read_command () places into GLOBAL_COMMAND. + ASYNCHROUNOUS, if non-zero, says to do this command in the background. + PIPE_IN and PIPE_OUT are file descriptors saying where input comes + from and where it goes. They can have the value of NO_PIPE, which means + I/O is stdin/stdout. + FDS_TO_CLOSE is a list of file descriptors to close once the child has + been forked. This list often contains the unusable sides of pipes, etc. + + EXECUTION_SUCCESS or EXECUTION_FAILURE are the only possible + return values. Executing a command with nothing in it returns + EXECUTION_SUCCESS. */ +int +execute_command_internal (command, asynchronous, pipe_in, pipe_out, + fds_to_close) + COMMAND *command; + int asynchronous; + int pipe_in, pipe_out; + struct fd_bitmap *fds_to_close; +{ + int exec_result, user_subshell, invert, ignore_return, was_error_trap; + REDIRECT *my_undo_list, *exec_undo_list; + char *tcmd; + volatile int last_pid; + volatile int save_line_number; +#if defined (PROCESS_SUBSTITUTION) + volatile int ofifo, nfifo, osize, saved_fifo; + volatile char *ofifo_list; +#endif + + if (breaking || continuing) + return (last_command_exit_value); + if (command == 0 || read_but_dont_execute) + return (EXECUTION_SUCCESS); + + QUIT; + run_pending_traps (); + +#if 0 + if (running_trap == 0) +#endif + currently_executing_command = command; + + invert = (command->flags & CMD_INVERT_RETURN) != 0; + + /* If we're inverting the return value and `set -e' has been executed, + we don't want a failing command to inadvertently cause the shell + to exit. */ + if (exit_immediately_on_error && invert) /* XXX */ + command->flags |= CMD_IGNORE_RETURN; /* XXX */ + + exec_result = EXECUTION_SUCCESS; + + /* If a command was being explicitly run in a subshell, or if it is + a shell control-structure, and it has a pipe, then we do the command + in a subshell. */ + if (command->type == cm_subshell && (command->flags & CMD_NO_FORK)) + return (execute_in_subshell (command, asynchronous, pipe_in, pipe_out, fds_to_close)); + +#if defined (COPROCESS_SUPPORT) + if (command->type == cm_coproc) + return (execute_coproc (command, pipe_in, pipe_out, fds_to_close)); +#endif + + user_subshell = command->type == cm_subshell || ((command->flags & CMD_WANT_SUBSHELL) != 0); + + if (command->type == cm_subshell || + (command->flags & (CMD_WANT_SUBSHELL|CMD_FORCE_SUBSHELL)) || + (shell_control_structure (command->type) && + (pipe_out != NO_PIPE || pipe_in != NO_PIPE || asynchronous))) + { + pid_t paren_pid; + int s; + + /* Fork a subshell, turn off the subshell bit, turn off job + control and call execute_command () on the command again. */ + line_number_for_err_trap = line_number; + tcmd = make_command_string (command); + paren_pid = make_child (savestring (tcmd), asynchronous); + + if (user_subshell && signal_is_trapped (ERROR_TRAP) && + signal_in_progress (DEBUG_TRAP) == 0 && running_trap == 0) + { + FREE (the_printed_command_except_trap); + the_printed_command_except_trap = savestring (the_printed_command); + } + + if (paren_pid == 0) + { + /* We want to run the exit trap for forced {} subshells, and we + want to note this before execute_in_subshell modifies the + COMMAND struct. Need to keep in mind that execute_in_subshell + runs the exit trap for () subshells itself. */ + /* This handles { command; } & */ + s = user_subshell == 0 && command->type == cm_group && pipe_in == NO_PIPE && pipe_out == NO_PIPE && asynchronous; + /* run exit trap for : | { ...; } and { ...; } | : */ + /* run exit trap for : | ( ...; ) and ( ...; ) | : */ + s += user_subshell == 0 && command->type == cm_group && (pipe_in != NO_PIPE || pipe_out != NO_PIPE) && asynchronous == 0; + + last_command_exit_value = execute_in_subshell (command, asynchronous, pipe_in, pipe_out, fds_to_close); + if (s) + subshell_exit (last_command_exit_value); + else + exit (last_command_exit_value); + /* NOTREACHED */ + } + else + { + close_pipes (pipe_in, pipe_out); + +#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD) + if (variable_context == 0) /* wait until shell function completes */ + unlink_fifo_list (); +#endif + /* If we are part of a pipeline, and not the end of the pipeline, + then we should simply return and let the last command in the + pipe be waited for. If we are not in a pipeline, or are the + last command in the pipeline, then we wait for the subshell + and return its exit status as usual. */ + if (pipe_out != NO_PIPE) + return (EXECUTION_SUCCESS); + + stop_pipeline (asynchronous, (COMMAND *)NULL); + + if (asynchronous == 0) + { + was_error_trap = signal_is_trapped (ERROR_TRAP) && signal_is_ignored (ERROR_TRAP) == 0; + invert = (command->flags & CMD_INVERT_RETURN) != 0; + ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0; + + exec_result = wait_for (paren_pid); + + /* If we have to, invert the return value. */ + if (invert) + exec_result = ((exec_result == EXECUTION_SUCCESS) + ? EXECUTION_FAILURE + : EXECUTION_SUCCESS); + + last_command_exit_value = exec_result; + if (user_subshell && was_error_trap && ignore_return == 0 && invert == 0 && exec_result != EXECUTION_SUCCESS) + { + save_line_number = line_number; + line_number = line_number_for_err_trap; + run_error_trap (); + line_number = save_line_number; + } + + if (user_subshell && ignore_return == 0 && invert == 0 && exit_immediately_on_error && exec_result != EXECUTION_SUCCESS) + { + run_pending_traps (); + jump_to_top_level (ERREXIT); + } + + return (last_command_exit_value); + } + else + { + DESCRIBE_PID (paren_pid); + + run_pending_traps (); + + /* Posix 2013 2.9.3.1: "the exit status of an asynchronous list + shall be zero." */ + last_command_exit_value = 0; + return (EXECUTION_SUCCESS); + } + } + } + +#if defined (COMMAND_TIMING) + if (command->flags & CMD_TIME_PIPELINE) + { + if (asynchronous) + { + command->flags |= CMD_FORCE_SUBSHELL; + exec_result = execute_command_internal (command, 1, pipe_in, pipe_out, fds_to_close); + } + else + { + exec_result = time_command (command, asynchronous, pipe_in, pipe_out, fds_to_close); +#if 0 + if (running_trap == 0) +#endif + currently_executing_command = (COMMAND *)NULL; + } + return (exec_result); + } +#endif /* COMMAND_TIMING */ + + if (shell_control_structure (command->type) && command->redirects) + stdin_redir = stdin_redirects (command->redirects); + +#if defined (PROCESS_SUBSTITUTION) + if (variable_context != 0) + { + ofifo = num_fifos (); + ofifo_list = copy_fifo_list ((int *)&osize); + saved_fifo = 1; + } + else + saved_fifo = 0; +#endif + + /* Handle WHILE FOR CASE etc. with redirections. (Also '&' input + redirection.) */ + if (do_redirections (command->redirects, RX_ACTIVE|RX_UNDOABLE) != 0) + { + cleanup_redirects (redirection_undo_list); + redirection_undo_list = (REDIRECT *)NULL; + dispose_exec_redirects (); +#if defined (PROCESS_SUBSTITUTION) + if (saved_fifo) + free ((void *)ofifo_list); +#endif + return (last_command_exit_value = EXECUTION_FAILURE); + } + + if (redirection_undo_list) + { + /* XXX - why copy here? */ + my_undo_list = (REDIRECT *)copy_redirects (redirection_undo_list); + dispose_redirects (redirection_undo_list); + redirection_undo_list = (REDIRECT *)NULL; + } + else + my_undo_list = (REDIRECT *)NULL; + + if (exec_redirection_undo_list) + { + /* XXX - why copy here? */ + exec_undo_list = (REDIRECT *)copy_redirects (exec_redirection_undo_list); + dispose_redirects (exec_redirection_undo_list); + exec_redirection_undo_list = (REDIRECT *)NULL; + } + else + exec_undo_list = (REDIRECT *)NULL; + + if (my_undo_list || exec_undo_list) + begin_unwind_frame ("loop_redirections"); + + if (my_undo_list) + add_unwind_protect ((Function *)cleanup_redirects, my_undo_list); + + if (exec_undo_list) + add_unwind_protect ((Function *)dispose_redirects, exec_undo_list); + + ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0; + + QUIT; + + switch (command->type) + { + case cm_simple: + { + save_line_number = line_number; + /* We can't rely on variables retaining their values across a + call to execute_simple_command if a longjmp occurs as the + result of a `return' builtin. This is true for sure with gcc. */ +#if defined (RECYCLES_PIDS) + last_made_pid = NO_PID; +#endif + last_pid = last_made_pid; + was_error_trap = signal_is_trapped (ERROR_TRAP) && signal_is_ignored (ERROR_TRAP) == 0; + + if (ignore_return && command->value.Simple) + command->value.Simple->flags |= CMD_IGNORE_RETURN; + if (command->flags & CMD_STDIN_REDIR) + command->value.Simple->flags |= CMD_STDIN_REDIR; + + line_number_for_err_trap = line_number = command->value.Simple->line; + exec_result = + execute_simple_command (command->value.Simple, pipe_in, pipe_out, + asynchronous, fds_to_close); + line_number = save_line_number; + + /* The temporary environment should be used for only the simple + command immediately following its definition. */ + dispose_used_env_vars (); + +#if (defined (ultrix) && defined (mips)) || defined (C_ALLOCA) + /* Reclaim memory allocated with alloca () on machines which + may be using the alloca emulation code. */ + (void) alloca (0); +#endif /* (ultrix && mips) || C_ALLOCA */ + + /* If we forked to do the command, then we must wait_for () + the child. */ + + /* XXX - this is something to watch out for if there are problems + when the shell is compiled without job control. Don't worry about + whether or not last_made_pid == last_pid; already_making_children + tells us whether or not there are unwaited-for children to wait + for and reap. */ + if (already_making_children && pipe_out == NO_PIPE) + { + stop_pipeline (asynchronous, (COMMAND *)NULL); + + if (asynchronous) + { + DESCRIBE_PID (last_made_pid); + } + else +#if !defined (JOB_CONTROL) + /* Do not wait for asynchronous processes started from + startup files. */ + if (last_made_pid != last_asynchronous_pid) +#endif + /* When executing a shell function that executes other + commands, this causes the last simple command in + the function to be waited for twice. This also causes + subshells forked to execute builtin commands (e.g., in + pipelines) to be waited for twice. */ + exec_result = wait_for (last_made_pid); + } + } + + /* 2009/02/13 -- pipeline failure is processed elsewhere. This handles + only the failure of a simple command. */ + if (was_error_trap && ignore_return == 0 && invert == 0 && pipe_in == NO_PIPE && pipe_out == NO_PIPE && exec_result != EXECUTION_SUCCESS) + { + last_command_exit_value = exec_result; + line_number = line_number_for_err_trap; + run_error_trap (); + line_number = save_line_number; + } + + if (ignore_return == 0 && invert == 0 && + ((posixly_correct && interactive == 0 && special_builtin_failed) || + (exit_immediately_on_error && pipe_in == NO_PIPE && pipe_out == NO_PIPE && exec_result != EXECUTION_SUCCESS))) + { + last_command_exit_value = exec_result; + run_pending_traps (); + jump_to_top_level (ERREXIT); + } + + break; + + case cm_for: + if (ignore_return) + command->value.For->flags |= CMD_IGNORE_RETURN; + exec_result = execute_for_command (command->value.For); + break; + +#if defined (ARITH_FOR_COMMAND) + case cm_arith_for: + if (ignore_return) + command->value.ArithFor->flags |= CMD_IGNORE_RETURN; + exec_result = execute_arith_for_command (command->value.ArithFor); + break; +#endif + +#if defined (SELECT_COMMAND) + case cm_select: + if (ignore_return) + command->value.Select->flags |= CMD_IGNORE_RETURN; + exec_result = execute_select_command (command->value.Select); + break; +#endif + + case cm_case: + if (ignore_return) + command->value.Case->flags |= CMD_IGNORE_RETURN; + exec_result = execute_case_command (command->value.Case); + break; + + case cm_while: + if (ignore_return) + command->value.While->flags |= CMD_IGNORE_RETURN; + exec_result = execute_while_command (command->value.While); + break; + + case cm_until: + if (ignore_return) + command->value.While->flags |= CMD_IGNORE_RETURN; + exec_result = execute_until_command (command->value.While); + break; + + case cm_if: + if (ignore_return) + command->value.If->flags |= CMD_IGNORE_RETURN; + exec_result = execute_if_command (command->value.If); + break; + + case cm_group: + + /* This code can be executed from either of two paths: an explicit + '{}' command, or via a function call. If we are executed via a + function call, we have already taken care of the function being + executed in the background (down there in execute_simple_command ()), + and this command should *not* be marked as asynchronous. If we + are executing a regular '{}' group command, and asynchronous == 1, + we must want to execute the whole command in the background, so we + need a subshell, and we want the stuff executed in that subshell + (this group command) to be executed in the foreground of that + subshell (i.e. there will not be *another* subshell forked). + + What we do is to force a subshell if asynchronous, and then call + execute_command_internal again with asynchronous still set to 1, + but with the original group command, so the printed command will + look right. + + The code above that handles forking off subshells will note that + both subshell and async are on, and turn off async in the child + after forking the subshell (but leave async set in the parent, so + the normal call to describe_pid is made). This turning off + async is *crucial*; if it is not done, this will fall into an + infinite loop of executions through this spot in subshell after + subshell until the process limit is exhausted. */ + + if (asynchronous) + { + command->flags |= CMD_FORCE_SUBSHELL; + exec_result = + execute_command_internal (command, 1, pipe_in, pipe_out, + fds_to_close); + } + else + { + if (ignore_return && command->value.Group->command) + command->value.Group->command->flags |= CMD_IGNORE_RETURN; + exec_result = + execute_command_internal (command->value.Group->command, + asynchronous, pipe_in, pipe_out, + fds_to_close); + } + break; + + case cm_connection: + exec_result = execute_connection (command, asynchronous, + pipe_in, pipe_out, fds_to_close); + break; + +#if defined (DPAREN_ARITHMETIC) + case cm_arith: + was_error_trap = signal_is_trapped (ERROR_TRAP) && signal_is_ignored (ERROR_TRAP) == 0; + if (ignore_return) + command->value.Arith->flags |= CMD_IGNORE_RETURN; + line_number_for_err_trap = save_line_number = line_number; + exec_result = execute_arith_command (command->value.Arith); + line_number = save_line_number; + + if (was_error_trap && ignore_return == 0 && invert == 0 && exec_result != EXECUTION_SUCCESS) + { + last_command_exit_value = exec_result; + save_line_number = line_number; + line_number = line_number_for_err_trap; + run_error_trap (); + line_number = save_line_number; + } + + if (ignore_return == 0 && invert == 0 && exit_immediately_on_error && exec_result != EXECUTION_SUCCESS) + { + last_command_exit_value = exec_result; + run_pending_traps (); + jump_to_top_level (ERREXIT); + } + + break; +#endif + +#if defined (COND_COMMAND) + case cm_cond: + was_error_trap = signal_is_trapped (ERROR_TRAP) && signal_is_ignored (ERROR_TRAP) == 0; + if (ignore_return) + command->value.Cond->flags |= CMD_IGNORE_RETURN; + + line_number_for_err_trap = save_line_number = line_number; + exec_result = execute_cond_command (command->value.Cond); + line_number = save_line_number; + + if (was_error_trap && ignore_return == 0 && invert == 0 && exec_result != EXECUTION_SUCCESS) + { + last_command_exit_value = exec_result; + save_line_number = line_number; + line_number = line_number_for_err_trap; + run_error_trap (); + line_number = save_line_number; + } + + if (ignore_return == 0 && invert == 0 && exit_immediately_on_error && exec_result != EXECUTION_SUCCESS) + { + last_command_exit_value = exec_result; + run_pending_traps (); + jump_to_top_level (ERREXIT); + } + + break; +#endif + + case cm_function_def: + exec_result = execute_intern_function (command->value.Function_def->name, + command->value.Function_def); + break; + + default: + command_error ("execute_command", CMDERR_BADTYPE, command->type, 0); + } + + if (my_undo_list) + { + do_redirections (my_undo_list, RX_ACTIVE); + dispose_redirects (my_undo_list); + } + + if (exec_undo_list) + dispose_redirects (exec_undo_list); + + if (my_undo_list || exec_undo_list) + discard_unwind_frame ("loop_redirections"); + +#if defined (PROCESS_SUBSTITUTION) + if (saved_fifo) + { + nfifo = num_fifos (); + if (nfifo > ofifo) + close_new_fifos ((char *)ofifo_list, osize); + free ((void *)ofifo_list); + } +#endif + + /* Invert the return value if we have to */ + if (invert) + exec_result = (exec_result == EXECUTION_SUCCESS) + ? EXECUTION_FAILURE + : EXECUTION_SUCCESS; + +#if defined (DPAREN_ARITHMETIC) || defined (COND_COMMAND) + /* This is where we set PIPESTATUS from the exit status of the appropriate + compound commands (the ones that look enough like simple commands to + cause confusion). We might be able to optimize by not doing this if + subshell_environment != 0. */ + switch (command->type) + { +# if defined (DPAREN_ARITHMETIC) + case cm_arith: +# endif +# if defined (COND_COMMAND) + case cm_cond: +# endif + set_pipestatus_from_exit (exec_result); + break; + } +#endif + + last_command_exit_value = exec_result; + run_pending_traps (); +#if 0 + if (running_trap == 0) +#endif + currently_executing_command = (COMMAND *)NULL; + + return (last_command_exit_value); +} + +#if defined (COMMAND_TIMING) + +#if defined (HAVE_GETRUSAGE) && defined (HAVE_GETTIMEOFDAY) +extern struct timeval *difftimeval __P((struct timeval *, struct timeval *, struct timeval *)); +extern struct timeval *addtimeval __P((struct timeval *, struct timeval *, struct timeval *)); +extern int timeval_to_cpu __P((struct timeval *, struct timeval *, struct timeval *)); +#endif + +#define POSIX_TIMEFORMAT "real %2R\nuser %2U\nsys %2S" +#define BASH_TIMEFORMAT "\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS" + +static const int precs[] = { 0, 100, 10, 1 }; + +/* Expand one `%'-prefixed escape sequence from a time format string. */ +static int +mkfmt (buf, prec, lng, sec, sec_fraction) + char *buf; + int prec, lng; + time_t sec; + int sec_fraction; +{ + time_t min; + char abuf[INT_STRLEN_BOUND(time_t) + 1]; + int ind, aind; + + ind = 0; + abuf[sizeof(abuf) - 1] = '\0'; + + /* If LNG is non-zero, we want to decompose SEC into minutes and seconds. */ + if (lng) + { + min = sec / 60; + sec %= 60; + aind = sizeof(abuf) - 2; + do + abuf[aind--] = (min % 10) + '0'; + while (min /= 10); + aind++; + while (abuf[aind]) + buf[ind++] = abuf[aind++]; + buf[ind++] = 'm'; + } + + /* Now add the seconds. */ + aind = sizeof (abuf) - 2; + do + abuf[aind--] = (sec % 10) + '0'; + while (sec /= 10); + aind++; + while (abuf[aind]) + buf[ind++] = abuf[aind++]; + + /* We want to add a decimal point and PREC places after it if PREC is + nonzero. PREC is not greater than 3. SEC_FRACTION is between 0 + and 999. */ + if (prec != 0) + { + buf[ind++] = '.'; + for (aind = 1; aind <= prec; aind++) + { + buf[ind++] = (sec_fraction / precs[aind]) + '0'; + sec_fraction %= precs[aind]; + } + } + + if (lng) + buf[ind++] = 's'; + buf[ind] = '\0'; + + return (ind); +} + +/* Interpret the format string FORMAT, interpolating the following escape + sequences: + %[prec][l][RUS] + + where the optional `prec' is a precision, meaning the number of + characters after the decimal point, the optional `l' means to format + using minutes and seconds (MMmNN[.FF]s), like the `times' builtin', + and the last character is one of + + R number of seconds of `real' time + U number of seconds of `user' time + S number of seconds of `system' time + + An occurrence of `%%' in the format string is translated to a `%'. The + result is printed to FP, a pointer to a FILE. The other variables are + the seconds and thousandths of a second of real, user, and system time, + resectively. */ +static void +print_formatted_time (fp, format, rs, rsf, us, usf, ss, ssf, cpu) + FILE *fp; + char *format; + time_t rs; + int rsf; + time_t us; + int usf; + time_t ss; + int ssf, cpu; +{ + int prec, lng, len; + char *str, *s, ts[INT_STRLEN_BOUND (time_t) + sizeof ("mSS.FFFF")]; + time_t sum; + int sum_frac; + int sindex, ssize; + + len = strlen (format); + ssize = (len + 64) - (len % 64); + str = (char *)xmalloc (ssize); + sindex = 0; + + for (s = format; *s; s++) + { + if (*s != '%' || s[1] == '\0') + { + RESIZE_MALLOCED_BUFFER (str, sindex, 1, ssize, 64); + str[sindex++] = *s; + } + else if (s[1] == '%') + { + s++; + RESIZE_MALLOCED_BUFFER (str, sindex, 1, ssize, 64); + str[sindex++] = *s; + } + else if (s[1] == 'P') + { + s++; +#if 0 + /* clamp CPU usage at 100% */ + if (cpu > 10000) + cpu = 10000; +#endif + sum = cpu / 100; + sum_frac = (cpu % 100) * 10; + len = mkfmt (ts, 2, 0, sum, sum_frac); + RESIZE_MALLOCED_BUFFER (str, sindex, len, ssize, 64); + strcpy (str + sindex, ts); + sindex += len; + } + else + { + prec = 3; /* default is three places past the decimal point. */ + lng = 0; /* default is to not use minutes or append `s' */ + s++; + if (DIGIT (*s)) /* `precision' */ + { + prec = *s++ - '0'; + if (prec > 3) prec = 3; + } + if (*s == 'l') /* `length extender' */ + { + lng = 1; + s++; + } + if (*s == 'R' || *s == 'E') + len = mkfmt (ts, prec, lng, rs, rsf); + else if (*s == 'U') + len = mkfmt (ts, prec, lng, us, usf); + else if (*s == 'S') + len = mkfmt (ts, prec, lng, ss, ssf); + else + { + internal_error (_("TIMEFORMAT: `%c': invalid format character"), *s); + free (str); + return; + } + RESIZE_MALLOCED_BUFFER (str, sindex, len, ssize, 64); + strcpy (str + sindex, ts); + sindex += len; + } + } + + str[sindex] = '\0'; + fprintf (fp, "%s\n", str); + fflush (fp); + + free (str); +} + +static int +time_command (command, asynchronous, pipe_in, pipe_out, fds_to_close) + COMMAND *command; + int asynchronous, pipe_in, pipe_out; + struct fd_bitmap *fds_to_close; +{ + int rv, posix_time, old_flags, nullcmd; + time_t rs, us, ss; + int rsf, usf, ssf; + int cpu; + char *time_format; + +#if defined (HAVE_GETRUSAGE) && defined (HAVE_GETTIMEOFDAY) + struct timeval real, user, sys; + struct timeval before, after; +# if defined (HAVE_STRUCT_TIMEZONE) + struct timezone dtz; /* posix doesn't define this */ +# endif + struct rusage selfb, selfa, kidsb, kidsa; /* a = after, b = before */ +#else +# if defined (HAVE_TIMES) + clock_t tbefore, tafter, real, user, sys; + struct tms before, after; +# endif +#endif + +#if defined (HAVE_GETRUSAGE) && defined (HAVE_GETTIMEOFDAY) +# if defined (HAVE_STRUCT_TIMEZONE) + gettimeofday (&before, &dtz); +# else + gettimeofday (&before, (void *)NULL); +# endif /* !HAVE_STRUCT_TIMEZONE */ + getrusage (RUSAGE_SELF, &selfb); + getrusage (RUSAGE_CHILDREN, &kidsb); +#else +# if defined (HAVE_TIMES) + tbefore = times (&before); +# endif +#endif + + posix_time = command && (command->flags & CMD_TIME_POSIX); + + nullcmd = (command == 0) || (command->type == cm_simple && command->value.Simple->words == 0 && command->value.Simple->redirects == 0); + if (posixly_correct && nullcmd) + { +#if defined (HAVE_GETRUSAGE) + selfb.ru_utime.tv_sec = kidsb.ru_utime.tv_sec = selfb.ru_stime.tv_sec = kidsb.ru_stime.tv_sec = 0; + selfb.ru_utime.tv_usec = kidsb.ru_utime.tv_usec = selfb.ru_stime.tv_usec = kidsb.ru_stime.tv_usec = 0; + before.tv_sec = shell_start_time; + before.tv_usec = 0; +#else + before.tms_utime = before.tms_stime = before.tms_cutime = before.tms_cstime = 0; + tbefore = shell_start_time; +#endif + } + + old_flags = command->flags; + command->flags &= ~(CMD_TIME_PIPELINE|CMD_TIME_POSIX); + rv = execute_command_internal (command, asynchronous, pipe_in, pipe_out, fds_to_close); + command->flags = old_flags; + + rs = us = ss = 0; + rsf = usf = ssf = cpu = 0; + +#if defined (HAVE_GETRUSAGE) && defined (HAVE_GETTIMEOFDAY) +# if defined (HAVE_STRUCT_TIMEZONE) + gettimeofday (&after, &dtz); +# else + gettimeofday (&after, (void *)NULL); +# endif /* !HAVE_STRUCT_TIMEZONE */ + getrusage (RUSAGE_SELF, &selfa); + getrusage (RUSAGE_CHILDREN, &kidsa); + + difftimeval (&real, &before, &after); + timeval_to_secs (&real, &rs, &rsf); + + addtimeval (&user, difftimeval(&after, &selfb.ru_utime, &selfa.ru_utime), + difftimeval(&before, &kidsb.ru_utime, &kidsa.ru_utime)); + timeval_to_secs (&user, &us, &usf); + + addtimeval (&sys, difftimeval(&after, &selfb.ru_stime, &selfa.ru_stime), + difftimeval(&before, &kidsb.ru_stime, &kidsa.ru_stime)); + timeval_to_secs (&sys, &ss, &ssf); + + cpu = timeval_to_cpu (&real, &user, &sys); +#else +# if defined (HAVE_TIMES) + tafter = times (&after); + + real = tafter - tbefore; + clock_t_to_secs (real, &rs, &rsf); + + user = (after.tms_utime - before.tms_utime) + (after.tms_cutime - before.tms_cutime); + clock_t_to_secs (user, &us, &usf); + + sys = (after.tms_stime - before.tms_stime) + (after.tms_cstime - before.tms_cstime); + clock_t_to_secs (sys, &ss, &ssf); + + cpu = (real == 0) ? 0 : ((user + sys) * 10000) / real; + +# else + rs = us = ss = 0; + rsf = usf = ssf = cpu = 0; +# endif +#endif + + if (posix_time) + time_format = POSIX_TIMEFORMAT; + else if ((time_format = get_string_value ("TIMEFORMAT")) == 0) + { + if (posixly_correct && nullcmd) + time_format = "user\t%2lU\nsys\t%2lS"; + else + time_format = BASH_TIMEFORMAT; + } + if (time_format && *time_format) + print_formatted_time (stderr, time_format, rs, rsf, us, usf, ss, ssf, cpu); + + return rv; +} +#endif /* COMMAND_TIMING */ + +/* Execute a command that's supposed to be in a subshell. This must be + called after make_child and we must be running in the child process. + The caller will return or exit() immediately with the value this returns. */ +static int +execute_in_subshell (command, asynchronous, pipe_in, pipe_out, fds_to_close) + COMMAND *command; + int asynchronous; + int pipe_in, pipe_out; + struct fd_bitmap *fds_to_close; +{ + int user_subshell, return_code, function_value, should_redir_stdin, invert; + int ois, user_coproc; + int result; + volatile COMMAND *tcom; + + USE_VAR(user_subshell); + USE_VAR(user_coproc); + USE_VAR(invert); + USE_VAR(tcom); + USE_VAR(asynchronous); + + subshell_level++; + should_redir_stdin = (asynchronous && (command->flags & CMD_STDIN_REDIR) && + pipe_in == NO_PIPE && + stdin_redirects (command->redirects) == 0); + + invert = (command->flags & CMD_INVERT_RETURN) != 0; + user_subshell = command->type == cm_subshell || ((command->flags & CMD_WANT_SUBSHELL) != 0); + user_coproc = command->type == cm_coproc; + + command->flags &= ~(CMD_FORCE_SUBSHELL | CMD_WANT_SUBSHELL | CMD_INVERT_RETURN); + + /* If a command is asynchronous in a subshell (like ( foo ) & or + the special case of an asynchronous GROUP command where the + the subshell bit is turned on down in case cm_group: below), + turn off `asynchronous', so that two subshells aren't spawned. + XXX - asynchronous used to be set to 0 in this block, but that + means that setup_async_signals was never run. Now it's set to + 0 after subshell_environment is set appropriately and setup_async_signals + is run. + + This seems semantically correct to me. For example, + ( foo ) & seems to say ``do the command `foo' in a subshell + environment, but don't wait for that subshell to finish'', + and "{ foo ; bar ; } &" seems to me to be like functions or + builtins in the background, which executed in a subshell + environment. I just don't see the need to fork two subshells. */ + + /* Don't fork again, we are already in a subshell. A `doubly + async' shell is not interactive, however. */ + if (asynchronous) + { +#if defined (JOB_CONTROL) + /* If a construct like ( exec xxx yyy ) & is given while job + control is active, we want to prevent exec from putting the + subshell back into the original process group, carefully + undoing all the work we just did in make_child. */ + original_pgrp = -1; +#endif /* JOB_CONTROL */ + ois = interactive_shell; + interactive_shell = 0; + /* This test is to prevent alias expansion by interactive shells that + run `(command) &' but to allow scripts that have enabled alias + expansion with `shopt -s expand_alias' to continue to expand + aliases. */ + if (ois != interactive_shell) + expand_aliases = 0; + } + + /* Subshells are neither login nor interactive. */ + login_shell = interactive = 0; + + if (user_subshell) + subshell_environment = SUBSHELL_PAREN; + else + { + subshell_environment = 0; /* XXX */ + if (asynchronous) + subshell_environment |= SUBSHELL_ASYNC; + if (pipe_in != NO_PIPE || pipe_out != NO_PIPE) + subshell_environment |= SUBSHELL_PIPE; + if (user_coproc) + subshell_environment |= SUBSHELL_COPROC; + } + + reset_terminating_signals (); /* in sig.c */ + /* Cancel traps, in trap.c. */ + /* Reset the signal handlers in the child, but don't free the + trap strings. Set a flag noting that we have to free the + trap strings if we run trap to change a signal disposition. */ + reset_signal_handlers (); + subshell_environment |= SUBSHELL_RESETTRAP; + + /* Make sure restore_original_signals doesn't undo the work done by + make_child to ensure that asynchronous children are immune to SIGINT + and SIGQUIT. Turn off asynchronous to make sure more subshells are + not spawned. */ + if (asynchronous) + { + setup_async_signals (); + asynchronous = 0; + } + +#if defined (JOB_CONTROL) + set_sigchld_handler (); +#endif /* JOB_CONTROL */ + + set_sigint_handler (); + +#if defined (JOB_CONTROL) + /* Delete all traces that there were any jobs running. This is + only for subshells. */ + without_job_control (); +#endif /* JOB_CONTROL */ + + if (fds_to_close) + close_fd_bitmap (fds_to_close); + + do_piping (pipe_in, pipe_out); + +#if defined (COPROCESS_SUPPORT) + coproc_closeall (); +#endif + + /* If this is a user subshell, set a flag if stdin was redirected. + This is used later to decide whether to redirect fd 0 to + /dev/null for async commands in the subshell. This adds more + sh compatibility, but I'm not sure it's the right thing to do. */ + if (user_subshell) + { + stdin_redir = stdin_redirects (command->redirects); + restore_default_signal (EXIT_TRAP); + } + + /* If this is an asynchronous command (command &), we want to + redirect the standard input from /dev/null in the absence of + any specific redirection involving stdin. */ + if (should_redir_stdin && stdin_redir == 0) + async_redirect_stdin (); + + /* Do redirections, then dispose of them before recursive call. */ + if (command->redirects) + { + if (do_redirections (command->redirects, RX_ACTIVE) != 0) + exit (invert ? EXECUTION_SUCCESS : EXECUTION_FAILURE); + + dispose_redirects (command->redirects); + command->redirects = (REDIRECT *)NULL; + } + + if (command->type == cm_subshell) + tcom = command->value.Subshell->command; + else if (user_coproc) + tcom = command->value.Coproc->command; + else + tcom = command; + + if (command->flags & CMD_TIME_PIPELINE) + tcom->flags |= CMD_TIME_PIPELINE; + if (command->flags & CMD_TIME_POSIX) + tcom->flags |= CMD_TIME_POSIX; + + /* Make sure the subshell inherits any CMD_IGNORE_RETURN flag. */ + if ((command->flags & CMD_IGNORE_RETURN) && tcom != command) + tcom->flags |= CMD_IGNORE_RETURN; + + /* If this is a simple command, tell execute_disk_command that it + might be able to get away without forking and simply exec. + This means things like ( sleep 10 ) will only cause one fork. + If we're timing the command or inverting its return value, however, + we cannot do this optimization. */ + if ((user_subshell || user_coproc) && (tcom->type == cm_simple || tcom->type == cm_subshell) && + ((tcom->flags & CMD_TIME_PIPELINE) == 0) && + ((tcom->flags & CMD_INVERT_RETURN) == 0)) + { + tcom->flags |= CMD_NO_FORK; + if (tcom->type == cm_simple) + tcom->value.Simple->flags |= CMD_NO_FORK; + } + + invert = (tcom->flags & CMD_INVERT_RETURN) != 0; + tcom->flags &= ~CMD_INVERT_RETURN; + + result = setjmp_nosigs (top_level); + + /* If we're inside a function while executing this subshell, we + need to handle a possible `return'. */ + function_value = 0; + if (return_catch_flag) + function_value = setjmp_nosigs (return_catch); + + /* If we're going to exit the shell, we don't want to invert the return + status. */ + if (result == EXITPROG) + invert = 0, return_code = last_command_exit_value; + else if (result) + return_code = EXECUTION_FAILURE; + else if (function_value) + return_code = return_catch_value; + else + return_code = execute_command_internal ((COMMAND *)tcom, asynchronous, NO_PIPE, NO_PIPE, fds_to_close); + + /* If we are asked to, invert the return value. */ + if (invert) + return_code = (return_code == EXECUTION_SUCCESS) ? EXECUTION_FAILURE + : EXECUTION_SUCCESS; + + /* If we were explicitly placed in a subshell with (), we need + to do the `shell cleanup' things, such as running traps[0]. */ + if (user_subshell && signal_is_trapped (0)) + { + last_command_exit_value = return_code; + return_code = run_exit_trap (); + } + + subshell_level--; + return (return_code); + /* NOTREACHED */ +} + +#if defined (COPROCESS_SUPPORT) +#define COPROC_MAX 16 + +typedef struct cpelement + { + struct cpelement *next; + struct coproc *coproc; + } +cpelement_t; + +typedef struct cplist + { + struct cpelement *head; + struct cpelement *tail; + int ncoproc; + int lock; + } +cplist_t; + +static struct cpelement *cpe_alloc __P((struct coproc *)); +static void cpe_dispose __P((struct cpelement *)); +static struct cpelement *cpl_add __P((struct coproc *)); +static struct cpelement *cpl_delete __P((pid_t)); +static void cpl_reap __P((void)); +static void cpl_flush __P((void)); +static void cpl_closeall __P((void)); +static struct cpelement *cpl_search __P((pid_t)); +static struct cpelement *cpl_searchbyname __P((const char *)); +static void cpl_prune __P((void)); + +static void coproc_free __P((struct coproc *)); + +/* Will go away when there is fully-implemented support for multiple coprocs. */ +Coproc sh_coproc = { 0, NO_PID, -1, -1, 0, 0, 0, 0, 0 }; + +cplist_t coproc_list = {0, 0, 0}; + +/* Functions to manage the list of coprocs */ + +static struct cpelement * +cpe_alloc (cp) + Coproc *cp; +{ + struct cpelement *cpe; + + cpe = (struct cpelement *)xmalloc (sizeof (struct cpelement)); + cpe->coproc = cp; + cpe->next = (struct cpelement *)0; + return cpe; +} + +static void +cpe_dispose (cpe) + struct cpelement *cpe; +{ + free (cpe); +} + +static struct cpelement * +cpl_add (cp) + Coproc *cp; +{ + struct cpelement *cpe; + + cpe = cpe_alloc (cp); + + if (coproc_list.head == 0) + { + coproc_list.head = coproc_list.tail = cpe; + coproc_list.ncoproc = 0; /* just to make sure */ + } + else + { + coproc_list.tail->next = cpe; + coproc_list.tail = cpe; + } + coproc_list.ncoproc++; + + return cpe; +} + +static struct cpelement * +cpl_delete (pid) + pid_t pid; +{ + struct cpelement *prev, *p; + + for (prev = p = coproc_list.head; p; prev = p, p = p->next) + if (p->coproc->c_pid == pid) + { + prev->next = p->next; /* remove from list */ + break; + } + + if (p == 0) + return 0; /* not found */ + +#if defined (DEBUG) + itrace("cpl_delete: deleting %d", pid); +#endif + + /* Housekeeping in the border cases. */ + if (p == coproc_list.head) + coproc_list.head = coproc_list.head->next; + else if (p == coproc_list.tail) + coproc_list.tail = prev; + + coproc_list.ncoproc--; + if (coproc_list.ncoproc == 0) + coproc_list.head = coproc_list.tail = 0; + else if (coproc_list.ncoproc == 1) + coproc_list.tail = coproc_list.head; /* just to make sure */ + + return (p); +} + +static void +cpl_reap () +{ + struct cpelement *p, *next, *nh, *nt; + + /* Build a new list by removing dead coprocs and fix up the coproc_list + pointers when done. */ + nh = nt = next = (struct cpelement *)0; + for (p = coproc_list.head; p; p = next) + { + next = p->next; + if (p->coproc->c_flags & COPROC_DEAD) + { + coproc_list.ncoproc--; /* keep running count, fix up pointers later */ + +#if defined (DEBUG) + itrace("cpl_reap: deleting %d", p->coproc->c_pid); +#endif + + coproc_dispose (p->coproc); + cpe_dispose (p); + } + else if (nh == 0) + nh = nt = p; + else + { + nt->next = p; + nt = nt->next; + } + } + + if (coproc_list.ncoproc == 0) + coproc_list.head = coproc_list.tail = 0; + else + { + if (nt) + nt->next = 0; + coproc_list.head = nh; + coproc_list.tail = nt; + if (coproc_list.ncoproc == 1) + coproc_list.tail = coproc_list.head; /* just to make sure */ + } +} + +/* Clear out the list of saved statuses */ +static void +cpl_flush () +{ + struct cpelement *cpe, *p; + + for (cpe = coproc_list.head; cpe; ) + { + p = cpe; + cpe = cpe->next; + + coproc_dispose (p->coproc); + cpe_dispose (p); + } + + coproc_list.head = coproc_list.tail = 0; + coproc_list.ncoproc = 0; +} + +static void +cpl_closeall () +{ + struct cpelement *cpe; + + for (cpe = coproc_list.head; cpe; cpe = cpe->next) + coproc_close (cpe->coproc); +} + +static void +cpl_fdchk (fd) + int fd; +{ + struct cpelement *cpe; + + for (cpe = coproc_list.head; cpe; cpe = cpe->next) + coproc_checkfd (cpe->coproc, fd); +} + +/* Search for PID in the list of coprocs; return the cpelement struct if + found. If not found, return NULL. */ +static struct cpelement * +cpl_search (pid) + pid_t pid; +{ + struct cpelement *cpe; + + for (cpe = coproc_list.head ; cpe; cpe = cpe->next) + if (cpe->coproc->c_pid == pid) + return cpe; + return (struct cpelement *)NULL; +} + +/* Search for the coproc named NAME in the list of coprocs; return the + cpelement struct if found. If not found, return NULL. */ +static struct cpelement * +cpl_searchbyname (name) + const char *name; +{ + struct cpelement *cp; + + for (cp = coproc_list.head ; cp; cp = cp->next) + if (STREQ (cp->coproc->c_name, name)) + return cp; + return (struct cpelement *)NULL; +} + +#if 0 +static void +cpl_prune () +{ + struct cpelement *cp; + + while (coproc_list.head && coproc_list.ncoproc > COPROC_MAX) + { + cp = coproc_list.head; + coproc_list.head = coproc_list.head->next; + coproc_dispose (cp->coproc); + cpe_dispose (cp); + coproc_list.ncoproc--; + } +} +#endif + +/* These currently use a single global "shell coproc" but are written in a + way to not preclude additional coprocs later (using the list management + package above). */ + +struct coproc * +getcoprocbypid (pid) + pid_t pid; +{ +#if MULTIPLE_COPROCS + struct cpelement *p; + + p = cpl_search (pid); + return (p ? p->coproc : 0); +#else + return (pid == sh_coproc.c_pid ? &sh_coproc : 0); +#endif +} + +struct coproc * +getcoprocbyname (name) + const char *name; +{ +#if MULTIPLE_COPROCS + struct cpelement *p; + + p = cpl_searchbyname (name); + return (p ? p->coproc : 0); +#else + return ((sh_coproc.c_name && STREQ (sh_coproc.c_name, name)) ? &sh_coproc : 0); +#endif +} + +void +coproc_init (cp) + struct coproc *cp; +{ + cp->c_name = 0; + cp->c_pid = NO_PID; + cp->c_rfd = cp->c_wfd = -1; + cp->c_rsave = cp->c_wsave = -1; + cp->c_flags = cp->c_status = cp->c_lock = 0; +} + +struct coproc * +coproc_alloc (name, pid) + char *name; + pid_t pid; +{ + struct coproc *cp; + +#if MULTIPLE_COPROCS + cp = (struct coproc *)xmalloc (sizeof (struct coproc)); +#else + cp = &sh_coproc; +#endif + coproc_init (cp); + cp->c_lock = 2; + + cp->c_pid = pid; + cp->c_name = savestring (name); +#if MULTIPLE_COPROCS + cpl_add (cp); +#endif + cp->c_lock = 0; + return (cp); +} + +static void +coproc_free (cp) + struct coproc *cp; +{ + free (cp); +} + +void +coproc_dispose (cp) + struct coproc *cp; +{ + sigset_t set, oset; + + if (cp == 0) + return; + + BLOCK_SIGNAL (SIGCHLD, set, oset); + cp->c_lock = 3; + coproc_unsetvars (cp); + FREE (cp->c_name); + coproc_close (cp); +#if MULTIPLE_COPROCS + coproc_free (cp); +#else + coproc_init (cp); + cp->c_lock = 0; +#endif + UNBLOCK_SIGNAL (oset); +} + +/* Placeholder for now. Will require changes for multiple coprocs */ +void +coproc_flush () +{ +#if MULTIPLE_COPROCS + cpl_flush (); +#else + coproc_dispose (&sh_coproc); +#endif +} + +void +coproc_close (cp) + struct coproc *cp; +{ + if (cp->c_rfd >= 0) + { + close (cp->c_rfd); + cp->c_rfd = -1; + } + if (cp->c_wfd >= 0) + { + close (cp->c_wfd); + cp->c_wfd = -1; + } + cp->c_rsave = cp->c_wsave = -1; +} + +void +coproc_closeall () +{ +#if MULTIPLE_COPROCS + cpl_closeall (); +#else + coproc_close (&sh_coproc); /* XXX - will require changes for multiple coprocs */ +#endif +} + +void +coproc_reap () +{ +#if MULTIPLE_COPROCS + cpl_reap (); +#else + struct coproc *cp; + + cp = &sh_coproc; /* XXX - will require changes for multiple coprocs */ + if (cp && (cp->c_flags & COPROC_DEAD)) + coproc_dispose (cp); +#endif +} + +void +coproc_rclose (cp, fd) + struct coproc *cp; + int fd; +{ + if (cp->c_rfd >= 0 && cp->c_rfd == fd) + { + close (cp->c_rfd); + cp->c_rfd = -1; + } +} + +void +coproc_wclose (cp, fd) + struct coproc *cp; + int fd; +{ + if (cp->c_wfd >= 0 && cp->c_wfd == fd) + { + close (cp->c_wfd); + cp->c_wfd = -1; + } +} + +void +coproc_checkfd (cp, fd) + struct coproc *cp; + int fd; +{ + int update; + + update = 0; + if (cp->c_rfd >= 0 && cp->c_rfd == fd) + update = cp->c_rfd = -1; + if (cp->c_wfd >= 0 && cp->c_wfd == fd) + update = cp->c_wfd = -1; + if (update) + coproc_setvars (cp); +} + +void +coproc_fdchk (fd) + int fd; +{ +#if MULTIPLE_COPROCS + cpl_fdchk (fd); +#else + coproc_checkfd (&sh_coproc, fd); +#endif +} + +void +coproc_fdclose (cp, fd) + struct coproc *cp; + int fd; +{ + coproc_rclose (cp, fd); + coproc_wclose (cp, fd); + coproc_setvars (cp); +} + +void +coproc_fdsave (cp) + struct coproc *cp; +{ + cp->c_rsave = cp->c_rfd; + cp->c_wsave = cp->c_wfd; +} + +void +coproc_fdrestore (cp) + struct coproc *cp; +{ + cp->c_rfd = cp->c_rsave; + cp->c_wfd = cp->c_wsave; +} + +void +coproc_pidchk (pid, status) + pid_t pid; +{ + struct coproc *cp; + +#if MULTIPLE_COPROCS + struct cpelement *cpe; + + cpe = cpl_delete (pid); + cp = cpe ? cpe->coproc : 0; +#else + cp = getcoprocbypid (pid); +#endif + if (cp) + { + cp->c_lock = 4; + cp->c_status = status; + cp->c_flags |= COPROC_DEAD; + cp->c_flags &= ~COPROC_RUNNING; + /* Don't dispose the coproc or unset the COPROC_XXX variables because + this is executed in a signal handler context. Wait until coproc_reap + takes care of it. */ + cp->c_lock = 0; + } +} + +void +coproc_setvars (cp) + struct coproc *cp; +{ + SHELL_VAR *v; + char *namevar, *t; + int l; +#if defined (ARRAY_VARS) + arrayind_t ind; +#endif + + if (cp->c_name == 0) + return; + + l = strlen (cp->c_name); + namevar = xmalloc (l + 16); + +#if defined (ARRAY_VARS) + v = find_variable (cp->c_name); + if (v == 0) + v = make_new_array_variable (cp->c_name); + if (array_p (v) == 0) + v = convert_var_to_array (v); + + t = itos (cp->c_rfd); + ind = 0; + v = bind_array_variable (cp->c_name, ind, t, 0); + free (t); + + t = itos (cp->c_wfd); + ind = 1; + bind_array_variable (cp->c_name, ind, t, 0); + free (t); +#else + sprintf (namevar, "%s_READ", cp->c_name); + t = itos (cp->c_rfd); + bind_variable (namevar, t, 0); + free (t); + sprintf (namevar, "%s_WRITE", cp->c_name); + t = itos (cp->c_wfd); + bind_variable (namevar, t, 0); + free (t); +#endif + + sprintf (namevar, "%s_PID", cp->c_name); + t = itos (cp->c_pid); + bind_variable (namevar, t, 0); + free (t); + + free (namevar); +} + +void +coproc_unsetvars (cp) + struct coproc *cp; +{ + int l; + char *namevar; + + if (cp->c_name == 0) + return; + + l = strlen (cp->c_name); + namevar = xmalloc (l + 16); + + sprintf (namevar, "%s_PID", cp->c_name); + unbind_variable (namevar); + +#if defined (ARRAY_VARS) + unbind_variable (cp->c_name); +#else + sprintf (namevar, "%s_READ", cp->c_name); + unbind_variable (namevar); + sprintf (namevar, "%s_WRITE", cp->c_name); + unbind_variable (namevar); +#endif + + free (namevar); +} + +static int +execute_coproc (command, pipe_in, pipe_out, fds_to_close) + COMMAND *command; + int pipe_in, pipe_out; + struct fd_bitmap *fds_to_close; +{ + int rpipe[2], wpipe[2], estat, invert; + pid_t coproc_pid; + Coproc *cp; + char *tcmd; + sigset_t set, oset; + + /* XXX -- can be removed after changes to handle multiple coprocs */ +#if !MULTIPLE_COPROCS + if (sh_coproc.c_pid != NO_PID) + internal_warning ("execute_coproc: coproc [%d:%s] still exists", sh_coproc.c_pid, sh_coproc.c_name); + coproc_init (&sh_coproc); +#endif + + invert = (command->flags & CMD_INVERT_RETURN) != 0; + command_string_index = 0; + tcmd = make_command_string (command); + + sh_openpipe ((int *)&rpipe); /* 0 = parent read, 1 = child write */ + sh_openpipe ((int *)&wpipe); /* 0 = child read, 1 = parent write */ + + BLOCK_SIGNAL (SIGCHLD, set, oset); + + coproc_pid = make_child (savestring (tcmd), 1); + + if (coproc_pid == 0) + { + close (rpipe[0]); + close (wpipe[1]); + + UNBLOCK_SIGNAL (oset); + estat = execute_in_subshell (command, 1, wpipe[0], rpipe[1], fds_to_close); + + fflush (stdout); + fflush (stderr); + + exit (estat); + } + + close (rpipe[1]); + close (wpipe[0]); + + /* XXX - possibly run Coproc->name through word expansion? */ + cp = coproc_alloc (command->value.Coproc->name, coproc_pid); + cp->c_rfd = rpipe[0]; + cp->c_wfd = wpipe[1]; + + SET_CLOSE_ON_EXEC (cp->c_rfd); + SET_CLOSE_ON_EXEC (cp->c_wfd); + + coproc_setvars (cp); + + UNBLOCK_SIGNAL (oset); + +#if 0 + itrace ("execute_coproc: [%d] %s", coproc_pid, the_printed_command); +#endif + + close_pipes (pipe_in, pipe_out); +#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD) + unlink_fifo_list (); +#endif + stop_pipeline (1, (COMMAND *)NULL); + DESCRIBE_PID (coproc_pid); + run_pending_traps (); + + return (invert ? EXECUTION_FAILURE : EXECUTION_SUCCESS); +} +#endif + +static void +restore_stdin (s) + int s; +{ + dup2 (s, 0); + close (s); +} + +/* Catch-all cleanup function for lastpipe code for unwind-protects */ +static void +lastpipe_cleanup (s) + int s; +{ + unfreeze_jobs_list (); +} + +static int +execute_pipeline (command, asynchronous, pipe_in, pipe_out, fds_to_close) + COMMAND *command; + int asynchronous, pipe_in, pipe_out; + struct fd_bitmap *fds_to_close; +{ + int prev, fildes[2], new_bitmap_size, dummyfd, ignore_return, exec_result; + int lstdin, lastpipe_flag, lastpipe_jid; + COMMAND *cmd; + struct fd_bitmap *fd_bitmap; + pid_t lastpid; + +#if defined (JOB_CONTROL) + sigset_t set, oset; + BLOCK_CHILD (set, oset); +#endif /* JOB_CONTROL */ + + ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0; + + prev = pipe_in; + cmd = command; + + while (cmd && cmd->type == cm_connection && + cmd->value.Connection && cmd->value.Connection->connector == '|') + { + /* Make a pipeline between the two commands. */ + if (pipe (fildes) < 0) + { + sys_error (_("pipe error")); +#if defined (JOB_CONTROL) + terminate_current_pipeline (); + kill_current_pipeline (); + UNBLOCK_CHILD (oset); +#endif /* JOB_CONTROL */ + last_command_exit_value = EXECUTION_FAILURE; + /* The unwind-protects installed below will take care + of closing all of the open file descriptors. */ + throw_to_top_level (); + return (EXECUTION_FAILURE); /* XXX */ + } + + /* Here is a problem: with the new file close-on-exec + code, the read end of the pipe (fildes[0]) stays open + in the first process, so that process will never get a + SIGPIPE. There is no way to signal the first process + that it should close fildes[0] after forking, so it + remains open. No SIGPIPE is ever sent because there + is still a file descriptor open for reading connected + to the pipe. We take care of that here. This passes + around a bitmap of file descriptors that must be + closed after making a child process in execute_simple_command. */ + + /* We need fd_bitmap to be at least as big as fildes[0]. + If fildes[0] is less than fds_to_close->size, then + use fds_to_close->size. */ + new_bitmap_size = (fildes[0] < fds_to_close->size) + ? fds_to_close->size + : fildes[0] + 8; + + fd_bitmap = new_fd_bitmap (new_bitmap_size); + + /* Now copy the old information into the new bitmap. */ + xbcopy ((char *)fds_to_close->bitmap, (char *)fd_bitmap->bitmap, fds_to_close->size); + + /* And mark the pipe file descriptors to be closed. */ + fd_bitmap->bitmap[fildes[0]] = 1; + + /* In case there are pipe or out-of-processes errors, we + want all these file descriptors to be closed when + unwind-protects are run, and the storage used for the + bitmaps freed up. */ + begin_unwind_frame ("pipe-file-descriptors"); + add_unwind_protect (dispose_fd_bitmap, fd_bitmap); + add_unwind_protect (close_fd_bitmap, fd_bitmap); + if (prev >= 0) + add_unwind_protect (close, prev); + dummyfd = fildes[1]; + add_unwind_protect (close, dummyfd); + +#if defined (JOB_CONTROL) + add_unwind_protect (restore_signal_mask, &oset); +#endif /* JOB_CONTROL */ + + if (ignore_return && cmd->value.Connection->first) + cmd->value.Connection->first->flags |= CMD_IGNORE_RETURN; + execute_command_internal (cmd->value.Connection->first, asynchronous, + prev, fildes[1], fd_bitmap); + + if (prev >= 0) + close (prev); + + prev = fildes[0]; + close (fildes[1]); + + dispose_fd_bitmap (fd_bitmap); + discard_unwind_frame ("pipe-file-descriptors"); + + cmd = cmd->value.Connection->second; + } + + lastpid = last_made_pid; + + /* Now execute the rightmost command in the pipeline. */ + if (ignore_return && cmd) + cmd->flags |= CMD_IGNORE_RETURN; + + lastpipe_flag = 0; + + begin_unwind_frame ("lastpipe-exec"); + lstdin = -1; + /* If the `lastpipe' option is set with shopt, and job control is not + enabled, execute the last element of non-async pipelines in the + current shell environment. */ + if (lastpipe_opt && job_control == 0 && asynchronous == 0 && pipe_out == NO_PIPE && prev > 0) + { + lstdin = move_to_high_fd (0, 1, -1); + if (lstdin > 0) + { + do_piping (prev, pipe_out); + prev = NO_PIPE; + add_unwind_protect (restore_stdin, lstdin); + lastpipe_flag = 1; + freeze_jobs_list (); + lastpipe_jid = stop_pipeline (0, (COMMAND *)NULL); /* XXX */ + add_unwind_protect (lastpipe_cleanup, lastpipe_jid); + } + if (cmd) + cmd->flags |= CMD_LASTPIPE; + } + if (prev >= 0) + add_unwind_protect (close, prev); + + exec_result = execute_command_internal (cmd, asynchronous, prev, pipe_out, fds_to_close); + + if (lstdin > 0) + restore_stdin (lstdin); + + if (prev >= 0) + close (prev); + +#if defined (JOB_CONTROL) + UNBLOCK_CHILD (oset); +#endif + + QUIT; + + if (lastpipe_flag) + { +#if defined (JOB_CONTROL) + append_process (savestring (the_printed_command), dollar_dollar_pid, exec_result, lastpipe_jid); +#endif + lstdin = wait_for (lastpid); +#if defined (JOB_CONTROL) + /* If wait_for removes the job from the jobs table, use result of last + command as pipeline's exit status as usual. The jobs list can get + frozen and unfrozen at inconvenient times if there are multiple pipelines + running simultaneously. */ + if (INVALID_JOB (lastpipe_jid) == 0) + exec_result = job_exit_status (lastpipe_jid); + else if (pipefail_opt) + exec_result = exec_result | lstdin; /* XXX */ + /* otherwise we use exec_result */ + +#endif + unfreeze_jobs_list (); + } + + discard_unwind_frame ("lastpipe-exec"); + + return (exec_result); +} + +static int +execute_connection (command, asynchronous, pipe_in, pipe_out, fds_to_close) + COMMAND *command; + int asynchronous, pipe_in, pipe_out; + struct fd_bitmap *fds_to_close; +{ + COMMAND *tc, *second; + int ignore_return, exec_result, was_error_trap, invert; + volatile int save_line_number; + + ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0; + + switch (command->value.Connection->connector) + { + /* Do the first command asynchronously. */ + case '&': + tc = command->value.Connection->first; + if (tc == 0) + return (EXECUTION_SUCCESS); + + if (ignore_return) + tc->flags |= CMD_IGNORE_RETURN; + tc->flags |= CMD_AMPERSAND; + + /* If this shell was compiled without job control support, + if we are currently in a subshell via `( xxx )', or if job + control is not active then the standard input for an + asynchronous command is forced to /dev/null. */ +#if defined (JOB_CONTROL) + if ((subshell_environment || !job_control) && !stdin_redir) +#else + if (!stdin_redir) +#endif /* JOB_CONTROL */ + tc->flags |= CMD_STDIN_REDIR; + + exec_result = execute_command_internal (tc, 1, pipe_in, pipe_out, fds_to_close); + QUIT; + + if (tc->flags & CMD_STDIN_REDIR) + tc->flags &= ~CMD_STDIN_REDIR; + + second = command->value.Connection->second; + if (second) + { + if (ignore_return) + second->flags |= CMD_IGNORE_RETURN; + + exec_result = execute_command_internal (second, asynchronous, pipe_in, pipe_out, fds_to_close); + } + + break; + + /* Just call execute command on both sides. */ + case ';': + if (ignore_return) + { + if (command->value.Connection->first) + command->value.Connection->first->flags |= CMD_IGNORE_RETURN; + if (command->value.Connection->second) + command->value.Connection->second->flags |= CMD_IGNORE_RETURN; + } + executing_list++; + QUIT; + execute_command (command->value.Connection->first); + QUIT; + exec_result = execute_command_internal (command->value.Connection->second, + asynchronous, pipe_in, pipe_out, + fds_to_close); + executing_list--; + break; + + case '|': + was_error_trap = signal_is_trapped (ERROR_TRAP) && signal_is_ignored (ERROR_TRAP) == 0; + invert = (command->flags & CMD_INVERT_RETURN) != 0; + ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0; + + line_number_for_err_trap = line_number; + exec_result = execute_pipeline (command, asynchronous, pipe_in, pipe_out, fds_to_close); + + if (was_error_trap && ignore_return == 0 && invert == 0 && exec_result != EXECUTION_SUCCESS) + { + last_command_exit_value = exec_result; + save_line_number = line_number; + line_number = line_number_for_err_trap; + run_error_trap (); + line_number = save_line_number; + } + + if (ignore_return == 0 && invert == 0 && exit_immediately_on_error && exec_result != EXECUTION_SUCCESS) + { + last_command_exit_value = exec_result; + run_pending_traps (); + jump_to_top_level (ERREXIT); + } + + break; + + case AND_AND: + case OR_OR: + if (asynchronous) + { + /* If we have something like `a && b &' or `a || b &', run the + && or || stuff in a subshell. Force a subshell and just call + execute_command_internal again. Leave asynchronous on + so that we get a report from the parent shell about the + background job. */ + command->flags |= CMD_FORCE_SUBSHELL; + exec_result = execute_command_internal (command, 1, pipe_in, pipe_out, fds_to_close); + break; + } + + /* Execute the first command. If the result of that is successful + and the connector is AND_AND, or the result is not successful + and the connector is OR_OR, then execute the second command, + otherwise return. */ + + executing_list++; + if (command->value.Connection->first) + command->value.Connection->first->flags |= CMD_IGNORE_RETURN; + + exec_result = execute_command (command->value.Connection->first); + QUIT; + if (((command->value.Connection->connector == AND_AND) && + (exec_result == EXECUTION_SUCCESS)) || + ((command->value.Connection->connector == OR_OR) && + (exec_result != EXECUTION_SUCCESS))) + { + if (ignore_return && command->value.Connection->second) + command->value.Connection->second->flags |= CMD_IGNORE_RETURN; + + exec_result = execute_command (command->value.Connection->second); + } + executing_list--; + break; + + default: + command_error ("execute_connection", CMDERR_BADCONN, command->value.Connection->connector, 0); + jump_to_top_level (DISCARD); + exec_result = EXECUTION_FAILURE; + } + + return exec_result; +} + +#define REAP() \ + do \ + { \ + if (!interactive_shell) \ + reap_dead_jobs (); \ + } \ + while (0) + +/* Execute a FOR command. The syntax is: FOR word_desc IN word_list; + DO command; DONE */ +static int +execute_for_command (for_command) + FOR_COM *for_command; +{ + register WORD_LIST *releaser, *list; + SHELL_VAR *v; + char *identifier; + int retval, save_line_number; +#if 0 + SHELL_VAR *old_value = (SHELL_VAR *)NULL; /* Remember the old value of x. */ +#endif + + save_line_number = line_number; + if (check_identifier (for_command->name, 1) == 0) + { + if (posixly_correct && interactive_shell == 0) + { + last_command_exit_value = EX_BADUSAGE; + jump_to_top_level (ERREXIT); + } + return (EXECUTION_FAILURE); + } + + loop_level++; + identifier = for_command->name->word; + + line_number = for_command->line; /* for expansion error messages */ + list = releaser = expand_words_no_vars (for_command->map_list); + + begin_unwind_frame ("for"); + add_unwind_protect (dispose_words, releaser); + +#if 0 + if (lexical_scoping) + { + old_value = copy_variable (find_variable (identifier)); + if (old_value) + add_unwind_protect (dispose_variable, old_value); + } +#endif + + if (for_command->flags & CMD_IGNORE_RETURN) + for_command->action->flags |= CMD_IGNORE_RETURN; + + for (retval = EXECUTION_SUCCESS; list; list = list->next) + { + QUIT; + + line_number = for_command->line; + + /* Remember what this command looks like, for debugger. */ + command_string_index = 0; + print_for_command_head (for_command); + + if (echo_command_at_execute) + xtrace_print_for_command_head (for_command); + + /* Save this command unless it's a trap command and we're not running + a debug trap. */ + if (signal_in_progress (DEBUG_TRAP) == 0 && running_trap == 0) + { + FREE (the_printed_command_except_trap); + the_printed_command_except_trap = savestring (the_printed_command); + } + + retval = run_debug_trap (); +#if defined (DEBUGGER) + /* In debugging mode, if the DEBUG trap returns a non-zero status, we + skip the command. */ + if (debugging_mode && retval != EXECUTION_SUCCESS) + continue; +#endif + + this_command_name = (char *)NULL; + /* XXX - special ksh93 for command index variable handling */ + v = find_variable_last_nameref (identifier); + if (v && nameref_p (v)) + { + v = bind_variable_value (v, list->word->word, 0); + } + else + v = bind_variable (identifier, list->word->word, 0); + if (readonly_p (v) || noassign_p (v)) + { + line_number = save_line_number; + if (readonly_p (v) && interactive_shell == 0 && posixly_correct) + { + last_command_exit_value = EXECUTION_FAILURE; + jump_to_top_level (FORCE_EOF); + } + else + { + dispose_words (releaser); + discard_unwind_frame ("for"); + loop_level--; + return (EXECUTION_FAILURE); + } + } + retval = execute_command (for_command->action); + REAP (); + QUIT; + + if (breaking) + { + breaking--; + break; + } + + if (continuing) + { + continuing--; + if (continuing) + break; + } + } + + loop_level--; + line_number = save_line_number; + +#if 0 + if (lexical_scoping) + { + if (!old_value) + unbind_variable (identifier); + else + { + SHELL_VAR *new_value; + + new_value = bind_variable (identifier, value_cell(old_value), 0); + new_value->attributes = old_value->attributes; + dispose_variable (old_value); + } + } +#endif + + dispose_words (releaser); + discard_unwind_frame ("for"); + return (retval); +} + +#if defined (ARITH_FOR_COMMAND) +/* Execute an arithmetic for command. The syntax is + + for (( init ; step ; test )) + do + body + done + + The execution should be exactly equivalent to + + eval \(\( init \)\) + while eval \(\( test \)\) ; do + body; + eval \(\( step \)\) + done +*/ +static intmax_t +eval_arith_for_expr (l, okp) + WORD_LIST *l; + int *okp; +{ + WORD_LIST *new; + intmax_t expresult; + int r; + + new = expand_words_no_vars (l); + if (new) + { + if (echo_command_at_execute) + xtrace_print_arith_cmd (new); + this_command_name = "(("; /* )) for expression error messages */ + + command_string_index = 0; + print_arith_command (new); + if (signal_in_progress (DEBUG_TRAP) == 0) + { + FREE (the_printed_command_except_trap); + the_printed_command_except_trap = savestring (the_printed_command); + } + + r = run_debug_trap (); + /* In debugging mode, if the DEBUG trap returns a non-zero status, we + skip the command. */ +#if defined (DEBUGGER) + if (debugging_mode == 0 || r == EXECUTION_SUCCESS) + expresult = evalexp (new->word->word, okp); + else + { + expresult = 0; + if (okp) + *okp = 1; + } +#else + expresult = evalexp (new->word->word, okp); +#endif + dispose_words (new); + } + else + { + expresult = 0; + if (okp) + *okp = 1; + } + return (expresult); +} + +static int +execute_arith_for_command (arith_for_command) + ARITH_FOR_COM *arith_for_command; +{ + intmax_t expresult; + int expok, body_status, arith_lineno, save_lineno; + + body_status = EXECUTION_SUCCESS; + loop_level++; + save_lineno = line_number; + + if (arith_for_command->flags & CMD_IGNORE_RETURN) + arith_for_command->action->flags |= CMD_IGNORE_RETURN; + + this_command_name = "(("; /* )) for expression error messages */ + + /* save the starting line number of the command so we can reset + line_number before executing each expression -- for $LINENO + and the DEBUG trap. */ + line_number = arith_lineno = arith_for_command->line; + if (variable_context && interactive_shell) + line_number -= function_line_number; + + /* Evaluate the initialization expression. */ + expresult = eval_arith_for_expr (arith_for_command->init, &expok); + if (expok == 0) + { + line_number = save_lineno; + return (EXECUTION_FAILURE); + } + + while (1) + { + /* Evaluate the test expression. */ + line_number = arith_lineno; + expresult = eval_arith_for_expr (arith_for_command->test, &expok); + line_number = save_lineno; + + if (expok == 0) + { + body_status = EXECUTION_FAILURE; + break; + } + REAP (); + if (expresult == 0) + break; + + /* Execute the body of the arithmetic for command. */ + QUIT; + body_status = execute_command (arith_for_command->action); + QUIT; + + /* Handle any `break' or `continue' commands executed by the body. */ + if (breaking) + { + breaking--; + break; + } + + if (continuing) + { + continuing--; + if (continuing) + break; + } + + /* Evaluate the step expression. */ + line_number = arith_lineno; + expresult = eval_arith_for_expr (arith_for_command->step, &expok); + line_number = save_lineno; + + if (expok == 0) + { + body_status = EXECUTION_FAILURE; + break; + } + } + + loop_level--; + line_number = save_lineno; + + return (body_status); +} +#endif + +#if defined (SELECT_COMMAND) +static int LINES, COLS, tabsize; + +#define RP_SPACE ") " +#define RP_SPACE_LEN 2 + +/* XXX - does not handle numbers > 1000000 at all. */ +#define NUMBER_LEN(s) \ +((s < 10) ? 1 \ + : ((s < 100) ? 2 \ + : ((s < 1000) ? 3 \ + : ((s < 10000) ? 4 \ + : ((s < 100000) ? 5 \ + : 6))))) + +static int +displen (s) + const char *s; +{ +#if defined (HANDLE_MULTIBYTE) + wchar_t *wcstr; + size_t slen; + int wclen; + + wcstr = 0; + slen = mbstowcs (wcstr, s, 0); + if (slen == -1) + slen = 0; + wcstr = (wchar_t *)xmalloc (sizeof (wchar_t) * (slen + 1)); + mbstowcs (wcstr, s, slen + 1); + wclen = wcswidth (wcstr, slen); + free (wcstr); + return (wclen < 0 ? STRLEN(s) : wclen); +#else + return (STRLEN (s)); +#endif +} + +static int +print_index_and_element (len, ind, list) + int len, ind; + WORD_LIST *list; +{ + register WORD_LIST *l; + register int i; + + if (list == 0) + return (0); + for (i = ind, l = list; l && --i; l = l->next) + ; + if (l == 0) /* don't think this can happen */ + return (0); + fprintf (stderr, "%*d%s%s", len, ind, RP_SPACE, l->word->word); + return (displen (l->word->word)); +} + +static void +indent (from, to) + int from, to; +{ + while (from < to) + { + if ((to / tabsize) > (from / tabsize)) + { + putc ('\t', stderr); + from += tabsize - from % tabsize; + } + else + { + putc (' ', stderr); + from++; + } + } +} + +static void +print_select_list (list, list_len, max_elem_len, indices_len) + WORD_LIST *list; + int list_len, max_elem_len, indices_len; +{ + int ind, row, elem_len, pos, cols, rows; + int first_column_indices_len, other_indices_len; + + if (list == 0) + { + putc ('\n', stderr); + return; + } + + cols = max_elem_len ? COLS / max_elem_len : 1; + if (cols == 0) + cols = 1; + rows = list_len ? list_len / cols + (list_len % cols != 0) : 1; + cols = list_len ? list_len / rows + (list_len % rows != 0) : 1; + + if (rows == 1) + { + rows = cols; + cols = 1; + } + + first_column_indices_len = NUMBER_LEN (rows); + other_indices_len = indices_len; + + for (row = 0; row < rows; row++) + { + ind = row; + pos = 0; + while (1) + { + indices_len = (pos == 0) ? first_column_indices_len : other_indices_len; + elem_len = print_index_and_element (indices_len, ind + 1, list); + elem_len += indices_len + RP_SPACE_LEN; + ind += rows; + if (ind >= list_len) + break; + indent (pos + elem_len, pos + max_elem_len); + pos += max_elem_len; + } + putc ('\n', stderr); + } +} + +/* Print the elements of LIST, one per line, preceded by an index from 1 to + LIST_LEN. Then display PROMPT and wait for the user to enter a number. + If the number is between 1 and LIST_LEN, return that selection. If EOF + is read, return a null string. If a blank line is entered, or an invalid + number is entered, the loop is executed again. */ +static char * +select_query (list, list_len, prompt, print_menu) + WORD_LIST *list; + int list_len; + char *prompt; + int print_menu; +{ + int max_elem_len, indices_len, len; + intmax_t reply; + WORD_LIST *l; + char *repl_string, *t; + +#if 0 + t = get_string_value ("LINES"); + LINES = (t && *t) ? atoi (t) : 24; +#endif + t = get_string_value ("COLUMNS"); + COLS = (t && *t) ? atoi (t) : 80; + +#if 0 + t = get_string_value ("TABSIZE"); + tabsize = (t && *t) ? atoi (t) : 8; + if (tabsize <= 0) + tabsize = 8; +#else + tabsize = 8; +#endif + + max_elem_len = 0; + for (l = list; l; l = l->next) + { + len = displen (l->word->word); + if (len > max_elem_len) + max_elem_len = len; + } + indices_len = NUMBER_LEN (list_len); + max_elem_len += indices_len + RP_SPACE_LEN + 2; + + while (1) + { + if (print_menu) + print_select_list (list, list_len, max_elem_len, indices_len); + fprintf (stderr, "%s", prompt); + fflush (stderr); + QUIT; + + if (read_builtin ((WORD_LIST *)NULL) != EXECUTION_SUCCESS) + { + putchar ('\n'); + return ((char *)NULL); + } + repl_string = get_string_value ("REPLY"); + if (*repl_string == 0) + { + print_menu = 1; + continue; + } + if (legal_number (repl_string, &reply) == 0) + return ""; + if (reply < 1 || reply > list_len) + return ""; + + for (l = list; l && --reply; l = l->next) + ; + return (l->word->word); /* XXX - can't be null? */ + } +} + +/* Execute a SELECT command. The syntax is: + SELECT word IN list DO command_list DONE + Only `break' or `return' in command_list will terminate + the command. */ +static int +execute_select_command (select_command) + SELECT_COM *select_command; +{ + WORD_LIST *releaser, *list; + SHELL_VAR *v; + char *identifier, *ps3_prompt, *selection; + int retval, list_len, show_menu, save_line_number; + + if (check_identifier (select_command->name, 1) == 0) + return (EXECUTION_FAILURE); + + save_line_number = line_number; + line_number = select_command->line; + + command_string_index = 0; + print_select_command_head (select_command); + + if (echo_command_at_execute) + xtrace_print_select_command_head (select_command); + +#if 0 + if (signal_in_progress (DEBUG_TRAP) == 0 && (this_command_name == 0 || (STREQ (this_command_name, "trap") == 0))) +#else + if (signal_in_progress (DEBUG_TRAP) == 0 && running_trap == 0) +#endif + { + FREE (the_printed_command_except_trap); + the_printed_command_except_trap = savestring (the_printed_command); + } + + retval = run_debug_trap (); +#if defined (DEBUGGER) + /* In debugging mode, if the DEBUG trap returns a non-zero status, we + skip the command. */ + if (debugging_mode && retval != EXECUTION_SUCCESS) + return (EXECUTION_SUCCESS); +#endif + + loop_level++; + identifier = select_command->name->word; + + /* command and arithmetic substitution, parameter and variable expansion, + word splitting, pathname expansion, and quote removal. */ + list = releaser = expand_words_no_vars (select_command->map_list); + list_len = list_length (list); + if (list == 0 || list_len == 0) + { + if (list) + dispose_words (list); + line_number = save_line_number; + return (EXECUTION_SUCCESS); + } + + begin_unwind_frame ("select"); + add_unwind_protect (dispose_words, releaser); + + if (select_command->flags & CMD_IGNORE_RETURN) + select_command->action->flags |= CMD_IGNORE_RETURN; + + retval = EXECUTION_SUCCESS; + show_menu = 1; + + while (1) + { + line_number = select_command->line; + ps3_prompt = get_string_value ("PS3"); + if (ps3_prompt == 0) + ps3_prompt = "#? "; + + QUIT; + selection = select_query (list, list_len, ps3_prompt, show_menu); + QUIT; + if (selection == 0) + { + /* select_query returns EXECUTION_FAILURE if the read builtin + fails, so we want to return failure in this case. */ + retval = EXECUTION_FAILURE; + break; + } + + v = bind_variable (identifier, selection, 0); + if (readonly_p (v) || noassign_p (v)) + { + if (readonly_p (v) && interactive_shell == 0 && posixly_correct) + { + last_command_exit_value = EXECUTION_FAILURE; + jump_to_top_level (FORCE_EOF); + } + else + { + dispose_words (releaser); + discard_unwind_frame ("select"); + loop_level--; + line_number = save_line_number; + return (EXECUTION_FAILURE); + } + } + + retval = execute_command (select_command->action); + + REAP (); + QUIT; + + if (breaking) + { + breaking--; + break; + } + + if (continuing) + { + continuing--; + if (continuing) + break; + } + +#if defined (KSH_COMPATIBLE_SELECT) + show_menu = 0; + selection = get_string_value ("REPLY"); + if (selection && *selection == '\0') + show_menu = 1; +#endif + } + + loop_level--; + line_number = save_line_number; + + dispose_words (releaser); + discard_unwind_frame ("select"); + return (retval); +} +#endif /* SELECT_COMMAND */ + +/* Execute a CASE command. The syntax is: CASE word_desc IN pattern_list ESAC. + The pattern_list is a linked list of pattern clauses; each clause contains + some patterns to compare word_desc against, and an associated command to + execute. */ +static int +execute_case_command (case_command) + CASE_COM *case_command; +{ + register WORD_LIST *list; + WORD_LIST *wlist, *es; + PATTERN_LIST *clauses; + char *word, *pattern; + int retval, match, ignore_return, save_line_number; + + save_line_number = line_number; + line_number = case_command->line; + + command_string_index = 0; + print_case_command_head (case_command); + + if (echo_command_at_execute) + xtrace_print_case_command_head (case_command); + +#if 0 + if (signal_in_progress (DEBUG_TRAP) == 0 && (this_command_name == 0 || (STREQ (this_command_name, "trap") == 0))) +#else + if (signal_in_progress (DEBUG_TRAP) == 0 && running_trap == 0) +#endif + { + FREE (the_printed_command_except_trap); + the_printed_command_except_trap = savestring (the_printed_command); + } + + retval = run_debug_trap(); +#if defined (DEBUGGER) + /* In debugging mode, if the DEBUG trap returns a non-zero status, we + skip the command. */ + if (debugging_mode && retval != EXECUTION_SUCCESS) + { + line_number = save_line_number; + return (EXECUTION_SUCCESS); + } +#endif + + wlist = expand_word_unsplit (case_command->word, 0); + word = wlist ? string_list (wlist) : savestring (""); + dispose_words (wlist); + + retval = EXECUTION_SUCCESS; + ignore_return = case_command->flags & CMD_IGNORE_RETURN; + + begin_unwind_frame ("case"); + add_unwind_protect ((Function *)xfree, word); + +#define EXIT_CASE() goto exit_case_command + + for (clauses = case_command->clauses; clauses; clauses = clauses->next) + { + QUIT; + for (list = clauses->patterns; list; list = list->next) + { + es = expand_word_leave_quoted (list->word, 0); + + if (es && es->word && es->word->word && *(es->word->word)) + pattern = quote_string_for_globbing (es->word->word, QGLOB_CVTNULL); + else + { + pattern = (char *)xmalloc (1); + pattern[0] = '\0'; + } + + /* Since the pattern does not undergo quote removal (as per + Posix.2, section 3.9.4.3), the strmatch () call must be able + to recognize backslashes as escape characters. */ + match = strmatch (pattern, word, FNMATCH_EXTFLAG|FNMATCH_IGNCASE) != FNM_NOMATCH; + free (pattern); + + dispose_words (es); + + if (match) + { + do + { + if (clauses->action && ignore_return) + clauses->action->flags |= CMD_IGNORE_RETURN; + retval = execute_command (clauses->action); + } + while ((clauses->flags & CASEPAT_FALLTHROUGH) && (clauses = clauses->next)); + if (clauses == 0 || (clauses->flags & CASEPAT_TESTNEXT) == 0) + EXIT_CASE (); + else + break; + } + + QUIT; + } + } + +exit_case_command: + free (word); + discard_unwind_frame ("case"); + line_number = save_line_number; + return (retval); +} + +#define CMD_WHILE 0 +#define CMD_UNTIL 1 + +/* The WHILE command. Syntax: WHILE test DO action; DONE. + Repeatedly execute action while executing test produces + EXECUTION_SUCCESS. */ +static int +execute_while_command (while_command) + WHILE_COM *while_command; +{ + return (execute_while_or_until (while_command, CMD_WHILE)); +} + +/* UNTIL is just like WHILE except that the test result is negated. */ +static int +execute_until_command (while_command) + WHILE_COM *while_command; +{ + return (execute_while_or_until (while_command, CMD_UNTIL)); +} + +/* The body for both while and until. The only difference between the + two is that the test value is treated differently. TYPE is + CMD_WHILE or CMD_UNTIL. The return value for both commands should + be EXECUTION_SUCCESS if no commands in the body are executed, and + the status of the last command executed in the body otherwise. */ +static int +execute_while_or_until (while_command, type) + WHILE_COM *while_command; + int type; +{ + int return_value, body_status; + + body_status = EXECUTION_SUCCESS; + loop_level++; + + while_command->test->flags |= CMD_IGNORE_RETURN; + if (while_command->flags & CMD_IGNORE_RETURN) + while_command->action->flags |= CMD_IGNORE_RETURN; + + while (1) + { + return_value = execute_command (while_command->test); + REAP (); + + /* Need to handle `break' in the test when we would break out of the + loop. The job control code will set `breaking' to loop_level + when a job in a loop is stopped with SIGTSTP. If the stopped job + is in the loop test, `breaking' will not be reset unless we do + this, and the shell will cease to execute commands. */ + if (type == CMD_WHILE && return_value != EXECUTION_SUCCESS) + { + if (breaking) + breaking--; + break; + } + if (type == CMD_UNTIL && return_value == EXECUTION_SUCCESS) + { + if (breaking) + breaking--; + break; + } + + QUIT; + body_status = execute_command (while_command->action); + QUIT; + + if (breaking) + { + breaking--; + break; + } + + if (continuing) + { + continuing--; + if (continuing) + break; + } + } + loop_level--; + + return (body_status); +} + +/* IF test THEN command [ELSE command]. + IF also allows ELIF in the place of ELSE IF, but + the parser makes *that* stupidity transparent. */ +static int +execute_if_command (if_command) + IF_COM *if_command; +{ + int return_value, save_line_number; + + save_line_number = line_number; + if_command->test->flags |= CMD_IGNORE_RETURN; + return_value = execute_command (if_command->test); + line_number = save_line_number; + + if (return_value == EXECUTION_SUCCESS) + { + QUIT; + + if (if_command->true_case && (if_command->flags & CMD_IGNORE_RETURN)) + if_command->true_case->flags |= CMD_IGNORE_RETURN; + + return (execute_command (if_command->true_case)); + } + else + { + QUIT; + + if (if_command->false_case && (if_command->flags & CMD_IGNORE_RETURN)) + if_command->false_case->flags |= CMD_IGNORE_RETURN; + + return (execute_command (if_command->false_case)); + } +} + +#if defined (DPAREN_ARITHMETIC) +static int +execute_arith_command (arith_command) + ARITH_COM *arith_command; +{ + int expok, save_line_number, retval; + intmax_t expresult; + WORD_LIST *new; + char *exp; + + expresult = 0; + + save_line_number = line_number; + this_command_name = "(("; /* )) */ + line_number = arith_command->line; + /* If we're in a function, update the line number information. */ + if (variable_context && interactive_shell) + line_number -= function_line_number; + + command_string_index = 0; + print_arith_command (arith_command->exp); + + if (signal_in_progress (DEBUG_TRAP) == 0) + { + FREE (the_printed_command_except_trap); + the_printed_command_except_trap = savestring (the_printed_command); + } + + /* Run the debug trap before each arithmetic command, but do it after we + update the line number information and before we expand the various + words in the expression. */ + retval = run_debug_trap (); +#if defined (DEBUGGER) + /* In debugging mode, if the DEBUG trap returns a non-zero status, we + skip the command. */ + if (debugging_mode && retval != EXECUTION_SUCCESS) + { + line_number = save_line_number; + return (EXECUTION_SUCCESS); + } +#endif + + new = expand_words_no_vars (arith_command->exp); + + /* If we're tracing, make a new word list with `((' at the front and `))' + at the back and print it. */ + if (echo_command_at_execute) + xtrace_print_arith_cmd (new); + + if (new) + { + exp = new->next ? string_list (new) : new->word->word; + expresult = evalexp (exp, &expok); + line_number = save_line_number; + if (exp != new->word->word) + free (exp); + dispose_words (new); + } + else + { + expresult = 0; + expok = 1; + } + + if (expok == 0) + return (EXECUTION_FAILURE); + + return (expresult == 0 ? EXECUTION_FAILURE : EXECUTION_SUCCESS); +} +#endif /* DPAREN_ARITHMETIC */ + +#if defined (COND_COMMAND) + +static char * const nullstr = ""; + +/* XXX - can COND ever be NULL when this is called? */ +static int +execute_cond_node (cond) + COND_COM *cond; +{ + int result, invert, patmatch, rmatch, mflags, ignore; + char *arg1, *arg2; +#if 0 + char *t1, *t2; +#endif + + invert = (cond->flags & CMD_INVERT_RETURN); + ignore = (cond->flags & CMD_IGNORE_RETURN); + if (ignore) + { + if (cond->left) + cond->left->flags |= CMD_IGNORE_RETURN; + if (cond->right) + cond->right->flags |= CMD_IGNORE_RETURN; + } + + if (cond->type == COND_EXPR) + result = execute_cond_node (cond->left); + else if (cond->type == COND_OR) + { + result = execute_cond_node (cond->left); + if (result != EXECUTION_SUCCESS) + result = execute_cond_node (cond->right); + } + else if (cond->type == COND_AND) + { + result = execute_cond_node (cond->left); + if (result == EXECUTION_SUCCESS) + result = execute_cond_node (cond->right); + } + else if (cond->type == COND_UNARY) + { + if (ignore) + comsub_ignore_return++; + arg1 = cond_expand_word (cond->left->op, 0); + if (ignore) + comsub_ignore_return--; + if (arg1 == 0) + arg1 = nullstr; + if (echo_command_at_execute) + xtrace_print_cond_term (cond->type, invert, cond->op, arg1, (char *)NULL); + result = unary_test (cond->op->word, arg1) ? EXECUTION_SUCCESS : EXECUTION_FAILURE; + if (arg1 != nullstr) + free (arg1); + } + else if (cond->type == COND_BINARY) + { + rmatch = 0; + patmatch = (((cond->op->word[1] == '=') && (cond->op->word[2] == '\0') && + (cond->op->word[0] == '!' || cond->op->word[0] == '=')) || + (cond->op->word[0] == '=' && cond->op->word[1] == '\0')); +#if defined (COND_REGEXP) + rmatch = (cond->op->word[0] == '=' && cond->op->word[1] == '~' && + cond->op->word[2] == '\0'); +#endif + + if (ignore) + comsub_ignore_return++; + arg1 = cond_expand_word (cond->left->op, 0); + if (ignore) + comsub_ignore_return--; + if (arg1 == 0) + arg1 = nullstr; + if (ignore) + comsub_ignore_return++; + arg2 = cond_expand_word (cond->right->op, + (rmatch && shell_compatibility_level > 31) ? 2 : (patmatch ? 1 : 0)); + if (ignore) + comsub_ignore_return--; + if (arg2 == 0) + arg2 = nullstr; + + if (echo_command_at_execute) + xtrace_print_cond_term (cond->type, invert, cond->op, arg1, arg2); + +#if defined (COND_REGEXP) + if (rmatch) + { + mflags = SHMAT_PWARN; +#if defined (ARRAY_VARS) + mflags |= SHMAT_SUBEXP; +#endif + +#if 0 + t1 = strescape(arg1); + t2 = strescape(arg2); + itrace("execute_cond_node: sh_regmatch on `%s' and `%s'", t1, t2); + free(t1); + free(t2); +#endif + + result = sh_regmatch (arg1, arg2, mflags); + } + else +#endif /* COND_REGEXP */ + { + int oe; + oe = extended_glob; + extended_glob = 1; + result = binary_test (cond->op->word, arg1, arg2, TEST_PATMATCH|TEST_ARITHEXP|TEST_LOCALE) + ? EXECUTION_SUCCESS + : EXECUTION_FAILURE; + extended_glob = oe; + } + if (arg1 != nullstr) + free (arg1); + if (arg2 != nullstr) + free (arg2); + } + else + { + command_error ("execute_cond_node", CMDERR_BADTYPE, cond->type, 0); + jump_to_top_level (DISCARD); + result = EXECUTION_FAILURE; + } + + if (invert) + result = (result == EXECUTION_SUCCESS) ? EXECUTION_FAILURE : EXECUTION_SUCCESS; + + return result; +} + +static int +execute_cond_command (cond_command) + COND_COM *cond_command; +{ + int retval, save_line_number; + + retval = EXECUTION_SUCCESS; + save_line_number = line_number; + + this_command_name = "[["; + line_number = cond_command->line; + /* If we're in a function, update the line number information. */ + if (variable_context && interactive_shell) + line_number -= function_line_number; + command_string_index = 0; + print_cond_command (cond_command); + + if (signal_in_progress (DEBUG_TRAP) == 0) + { + FREE (the_printed_command_except_trap); + the_printed_command_except_trap = savestring (the_printed_command); + } + + /* Run the debug trap before each conditional command, but do it after we + update the line number information. */ + retval = run_debug_trap (); +#if defined (DEBUGGER) + /* In debugging mode, if the DEBUG trap returns a non-zero status, we + skip the command. */ + if (debugging_mode && retval != EXECUTION_SUCCESS) + { + line_number = save_line_number; + return (EXECUTION_SUCCESS); + } +#endif + +#if 0 + debug_print_cond_command (cond_command); +#endif + + last_command_exit_value = retval = execute_cond_node (cond_command); + line_number = save_line_number; + return (retval); +} +#endif /* COND_COMMAND */ + +static void +bind_lastarg (arg) + char *arg; +{ + SHELL_VAR *var; + + if (arg == 0) + arg = ""; + var = bind_variable ("_", arg, 0); + VUNSETATTR (var, att_exported); +} + +/* Execute a null command. Fork a subshell if the command uses pipes or is + to be run asynchronously. This handles all the side effects that are + supposed to take place. */ +static int +execute_null_command (redirects, pipe_in, pipe_out, async) + REDIRECT *redirects; + int pipe_in, pipe_out, async; +{ + int r; + int forcefork; + REDIRECT *rd; + + for (forcefork = 0, rd = redirects; rd; rd = rd->next) + forcefork += rd->rflags & REDIR_VARASSIGN; + + if (forcefork || pipe_in != NO_PIPE || pipe_out != NO_PIPE || async) + { + /* We have a null command, but we really want a subshell to take + care of it. Just fork, do piping and redirections, and exit. */ + if (make_child ((char *)NULL, async) == 0) + { + /* Cancel traps, in trap.c. */ + restore_original_signals (); /* XXX */ + + do_piping (pipe_in, pipe_out); + +#if defined (COPROCESS_SUPPORT) + coproc_closeall (); +#endif + + subshell_environment = 0; + if (async) + subshell_environment |= SUBSHELL_ASYNC; + if (pipe_in != NO_PIPE || pipe_out != NO_PIPE) + subshell_environment |= SUBSHELL_PIPE; + + if (do_redirections (redirects, RX_ACTIVE) == 0) + exit (EXECUTION_SUCCESS); + else + exit (EXECUTION_FAILURE); + } + else + { + close_pipes (pipe_in, pipe_out); +#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD) + if (pipe_out == NO_PIPE) + unlink_fifo_list (); +#endif + return (EXECUTION_SUCCESS); + } + } + else + { + /* Even if there aren't any command names, pretend to do the + redirections that are specified. The user expects the side + effects to take place. If the redirections fail, then return + failure. Otherwise, if a command substitution took place while + expanding the command or a redirection, return the value of that + substitution. Otherwise, return EXECUTION_SUCCESS. */ + + r = do_redirections (redirects, RX_ACTIVE|RX_UNDOABLE); + cleanup_redirects (redirection_undo_list); + redirection_undo_list = (REDIRECT *)NULL; + + if (r != 0) + return (EXECUTION_FAILURE); + else if (last_command_subst_pid != NO_PID) + return (last_command_exit_value); + else + return (EXECUTION_SUCCESS); + } +} + +/* This is a hack to suppress word splitting for assignment statements + given as arguments to builtins with the ASSIGNMENT_BUILTIN flag set. */ +static void +fix_assignment_words (words) + WORD_LIST *words; +{ + WORD_LIST *w, *wcmd; + struct builtin *b; + int assoc, global, array, integer; + + if (words == 0) + return; + + b = 0; + assoc = global = array = integer = 0; + + /* Skip over assignment statements preceding a command name */ + wcmd = words; + for (wcmd = words; wcmd; wcmd = wcmd->next) + if ((wcmd->word->flags & W_ASSIGNMENT) == 0) + break; + + for (w = wcmd; w; w = w->next) + if (w->word->flags & W_ASSIGNMENT) + { + if (b == 0) + { + /* Posix (post-2008) says that `command' doesn't change whether + or not the builtin it shadows is a `declaration command', even + though it removes other special builtin properties. In Posix + mode, we skip over one or more instances of `command' and + deal with the next word as the assignment builtin. */ + while (posixly_correct && wcmd && wcmd->word && wcmd->word->word && STREQ (wcmd->word->word, "command")) + wcmd = wcmd->next; + b = builtin_address_internal (wcmd->word->word, 0); + if (b == 0 || (b->flags & ASSIGNMENT_BUILTIN) == 0) + return; + else if (b && (b->flags & ASSIGNMENT_BUILTIN)) + wcmd->word->flags |= W_ASSNBLTIN; + } + w->word->flags |= (W_NOSPLIT|W_NOGLOB|W_TILDEEXP|W_ASSIGNARG); +#if defined (ARRAY_VARS) + if (assoc) + w->word->flags |= W_ASSIGNASSOC; + if (array) + w->word->flags |= W_ASSIGNARRAY; +#endif + if (global) + w->word->flags |= W_ASSNGLOBAL; + if (integer) + w->word->flags |= W_ASSIGNINT; + } +#if defined (ARRAY_VARS) + /* Note that we saw an associative array option to a builtin that takes + assignment statements. This is a bit of a kludge. */ + else if (w->word->word[0] == '-' && (strchr (w->word->word+1, 'A') || strchr (w->word->word+1, 'a') || strchr (w->word->word+1, 'g'))) +#else + else if (w->word->word[0] == '-' && strchr (w->word->word+1, 'g')) +#endif + { + if (b == 0) + { + while (posixly_correct && wcmd && wcmd->word && wcmd->word->word && STREQ (wcmd->word->word, "command")) + wcmd = wcmd->next; + b = builtin_address_internal (wcmd->word->word, 0); + if (b == 0 || (b->flags & ASSIGNMENT_BUILTIN) == 0) + return; + else if (b && (b->flags & ASSIGNMENT_BUILTIN)) + wcmd->word->flags |= W_ASSNBLTIN; + } + if ((wcmd->word->flags & W_ASSNBLTIN) && strchr (w->word->word+1, 'A')) + assoc = 1; + else if ((wcmd->word->flags & W_ASSNBLTIN) && strchr (w->word->word+1, 'a')) + array = 1; + if ((wcmd->word->flags & W_ASSNBLTIN) && strchr (w->word->word+1, 'g')) + global = 1; + if ((wcmd->word->flags & W_ASSNBLTIN) && strchr (w->word->word+1, 'i')) + integer = 1; + } +} + +/* Return 1 if the file found by searching $PATH for PATHNAME, defaulting + to PATHNAME, is a directory. Used by the autocd code below. */ +static int +is_dirname (pathname) + char *pathname; +{ + char *temp; + int ret; + + temp = search_for_command (pathname, 0); + ret = (temp ? file_isdir (temp) : file_isdir (pathname)); + free (temp); + return ret; +} + +/* The meaty part of all the executions. We have to start hacking the + real execution of commands here. Fork a process, set things up, + execute the command. */ +static int +execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close) + SIMPLE_COM *simple_command; + int pipe_in, pipe_out, async; + struct fd_bitmap *fds_to_close; +{ + WORD_LIST *words, *lastword; + char *command_line, *lastarg, *temp; + int first_word_quoted, result, builtin_is_special, already_forked, dofork; + pid_t old_last_async_pid; + sh_builtin_func_t *builtin; + SHELL_VAR *func; + volatile int old_builtin, old_command_builtin; + + result = EXECUTION_SUCCESS; + special_builtin_failed = builtin_is_special = 0; + command_line = (char *)0; + + QUIT; + + /* If we're in a function, update the line number information. */ + if (variable_context && interactive_shell && sourcelevel == 0) + line_number -= function_line_number; + + /* Remember what this command line looks like at invocation. */ + command_string_index = 0; + print_simple_command (simple_command); + +#if 0 + if (signal_in_progress (DEBUG_TRAP) == 0 && (this_command_name == 0 || (STREQ (this_command_name, "trap") == 0))) +#else + if (signal_in_progress (DEBUG_TRAP) == 0 && running_trap == 0) +#endif + { + FREE (the_printed_command_except_trap); + the_printed_command_except_trap = the_printed_command ? savestring (the_printed_command) : (char *)0; + } + + /* Run the debug trap before each simple command, but do it after we + update the line number information. */ + result = run_debug_trap (); +#if defined (DEBUGGER) + /* In debugging mode, if the DEBUG trap returns a non-zero status, we + skip the command. */ + if (debugging_mode && result != EXECUTION_SUCCESS) + return (EXECUTION_SUCCESS); +#endif + + first_word_quoted = + simple_command->words ? (simple_command->words->word->flags & W_QUOTED) : 0; + + last_command_subst_pid = NO_PID; + old_last_async_pid = last_asynchronous_pid; + + already_forked = dofork = 0; + + /* If we're in a pipeline or run in the background, set DOFORK so we + make the child early, before word expansion. This keeps assignment + statements from affecting the parent shell's environment when they + should not. */ + dofork = pipe_in != NO_PIPE || pipe_out != NO_PIPE || async; + + /* Something like `%2 &' should restart job 2 in the background, not cause + the shell to fork here. */ + if (dofork && pipe_in == NO_PIPE && pipe_out == NO_PIPE && + simple_command->words && simple_command->words->word && + simple_command->words->word->word && + (simple_command->words->word->word[0] == '%')) + dofork = 0; + + if (dofork) + { + /* Do this now, because execute_disk_command will do it anyway in the + vast majority of cases. */ + maybe_make_export_env (); + + /* Don't let a DEBUG trap overwrite the command string to be saved with + the process/job associated with this child. */ + if (make_child (savestring (the_printed_command_except_trap), async) == 0) + { + already_forked = 1; + simple_command->flags |= CMD_NO_FORK; + + subshell_environment = SUBSHELL_FORK; + if (pipe_in != NO_PIPE || pipe_out != NO_PIPE) + subshell_environment |= SUBSHELL_PIPE; + if (async) + subshell_environment |= SUBSHELL_ASYNC; + + /* We need to do this before piping to handle some really + pathological cases where one of the pipe file descriptors + is < 2. */ + if (fds_to_close) + close_fd_bitmap (fds_to_close); + + do_piping (pipe_in, pipe_out); + pipe_in = pipe_out = NO_PIPE; +#if defined (COPROCESS_SUPPORT) + coproc_closeall (); +#endif + + last_asynchronous_pid = old_last_async_pid; + + CHECK_SIGTERM; + } + else + { + /* Don't let simple commands that aren't the last command in a + pipeline change $? for the rest of the pipeline (or at all). */ + if (pipe_out != NO_PIPE) + result = last_command_exit_value; + close_pipes (pipe_in, pipe_out); +#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD) + /* Close /dev/fd file descriptors in the parent after forking the + last child in a (possibly one-element) pipeline. Defer this + until any running shell function completes. */ + if (pipe_out == NO_PIPE && variable_context == 0) /* XXX */ + unlink_fifo_list (); /* XXX */ +#endif + command_line = (char *)NULL; /* don't free this. */ + bind_lastarg ((char *)NULL); + return (result); + } + } + + /* If we are re-running this as the result of executing the `command' + builtin, do not expand the command words a second time. */ + if ((simple_command->flags & CMD_INHIBIT_EXPANSION) == 0) + { + current_fds_to_close = fds_to_close; + fix_assignment_words (simple_command->words); + /* Pass the ignore return flag down to command substitutions */ + if (simple_command->flags & CMD_IGNORE_RETURN) /* XXX */ + comsub_ignore_return++; + words = expand_words (simple_command->words); + if (simple_command->flags & CMD_IGNORE_RETURN) + comsub_ignore_return--; + current_fds_to_close = (struct fd_bitmap *)NULL; + } + else + words = copy_word_list (simple_command->words); + + /* It is possible for WORDS not to have anything left in it. + Perhaps all the words consisted of `$foo', and there was + no variable `$foo'. */ + if (words == 0) + { + this_command_name = 0; + result = execute_null_command (simple_command->redirects, + pipe_in, pipe_out, + already_forked ? 0 : async); + if (already_forked) + exit (result); + else + { + bind_lastarg ((char *)NULL); + set_pipestatus_from_exit (result); + return (result); + } + } + + lastarg = (char *)NULL; + + begin_unwind_frame ("simple-command"); + + if (echo_command_at_execute) + xtrace_print_word_list (words, 1); + + builtin = (sh_builtin_func_t *)NULL; + func = (SHELL_VAR *)NULL; + if ((simple_command->flags & CMD_NO_FUNCTIONS) == 0) + { + /* Posix.2 says special builtins are found before functions. We + don't set builtin_is_special anywhere other than here, because + this path is followed only when the `command' builtin is *not* + being used, and we don't want to exit the shell if a special + builtin executed with `command builtin' fails. `command' is not + a special builtin. */ + if (posixly_correct) + { + builtin = find_special_builtin (words->word->word); + if (builtin) + builtin_is_special = 1; + } + if (builtin == 0) + func = find_function (words->word->word); + } + + /* In POSIX mode, assignment errors in the temporary environment cause a + non-interactive shell to exit. */ + if (posixly_correct && builtin_is_special && interactive_shell == 0 && tempenv_assign_error) + { + last_command_exit_value = EXECUTION_FAILURE; + jump_to_top_level (ERREXIT); + } + tempenv_assign_error = 0; /* don't care about this any more */ + + add_unwind_protect (dispose_words, words); + QUIT; + + /* Bind the last word in this command to "$_" after execution. */ + for (lastword = words; lastword->next; lastword = lastword->next) + ; + lastarg = lastword->word->word; + +#if defined (JOB_CONTROL) + /* Is this command a job control related thing? */ + if (words->word->word[0] == '%' && already_forked == 0) + { + this_command_name = async ? "bg" : "fg"; + last_shell_builtin = this_shell_builtin; + this_shell_builtin = builtin_address (this_command_name); + result = (*this_shell_builtin) (words); + goto return_result; + } + + /* One other possibililty. The user may want to resume an existing job. + If they do, find out whether this word is a candidate for a running + job. */ + if (job_control && already_forked == 0 && async == 0 && + !first_word_quoted && + !words->next && + words->word->word[0] && + !simple_command->redirects && + pipe_in == NO_PIPE && + pipe_out == NO_PIPE && + (temp = get_string_value ("auto_resume"))) + { + int job, jflags, started_status; + + jflags = JM_STOPPED|JM_FIRSTMATCH; + if (STREQ (temp, "exact")) + jflags |= JM_EXACT; + else if (STREQ (temp, "substring")) + jflags |= JM_SUBSTRING; + else + jflags |= JM_PREFIX; + job = get_job_by_name (words->word->word, jflags); + if (job != NO_JOB) + { + run_unwind_frame ("simple-command"); + this_command_name = "fg"; + last_shell_builtin = this_shell_builtin; + this_shell_builtin = builtin_address ("fg"); + + started_status = start_job (job, 1); + return ((started_status < 0) ? EXECUTION_FAILURE : started_status); + } + } +#endif /* JOB_CONTROL */ + +run_builtin: + /* Remember the name of this command globally. */ + this_command_name = words->word->word; + + QUIT; + + /* This command could be a shell builtin or a user-defined function. + We have already found special builtins by this time, so we do not + set builtin_is_special. If this is a function or builtin, and we + have pipes, then fork a subshell in here. Otherwise, just execute + the command directly. */ + if (func == 0 && builtin == 0) + builtin = find_shell_builtin (this_command_name); + + last_shell_builtin = this_shell_builtin; + this_shell_builtin = builtin; + + if (builtin || func) + { + if (builtin) + { + old_builtin = executing_builtin; + old_command_builtin = executing_command_builtin; + unwind_protect_int (executing_builtin); /* modified in execute_builtin */ + unwind_protect_int (executing_command_builtin); /* ditto */ + } + if (already_forked) + { + /* reset_terminating_signals (); */ /* XXX */ + /* Reset the signal handlers in the child, but don't free the + trap strings. Set a flag noting that we have to free the + trap strings if we run trap to change a signal disposition. */ + reset_signal_handlers (); + subshell_environment |= SUBSHELL_RESETTRAP; + + if (async) + { + if ((simple_command->flags & CMD_STDIN_REDIR) && + pipe_in == NO_PIPE && + (stdin_redirects (simple_command->redirects) == 0)) + async_redirect_stdin (); + setup_async_signals (); + } + + subshell_level++; + execute_subshell_builtin_or_function + (words, simple_command->redirects, builtin, func, + pipe_in, pipe_out, async, fds_to_close, + simple_command->flags); + subshell_level--; + } + else + { + result = execute_builtin_or_function + (words, builtin, func, simple_command->redirects, fds_to_close, + simple_command->flags); + if (builtin) + { + if (result > EX_SHERRBASE) + { + switch (result) + { + case EX_REDIRFAIL: + case EX_BADASSIGN: + case EX_EXPFAIL: + /* These errors cause non-interactive posix mode shells to exit */ + if (posixly_correct && builtin_is_special && interactive_shell == 0) + { + last_command_exit_value = EXECUTION_FAILURE; + jump_to_top_level (ERREXIT); + } + } + result = builtin_status (result); + if (builtin_is_special) + special_builtin_failed = 1; + } + /* In POSIX mode, if there are assignment statements preceding + a special builtin, they persist after the builtin + completes. */ + if (posixly_correct && builtin_is_special && temporary_env) + merge_temporary_env (); + } + else /* function */ + { + if (result == EX_USAGE) + result = EX_BADUSAGE; + else if (result > EX_SHERRBASE) + result = EXECUTION_FAILURE; + } + + set_pipestatus_from_exit (result); + + goto return_result; + } + } + + if (autocd && interactive && words->word && is_dirname (words->word->word)) + { + words = make_word_list (make_word ("cd"), words); + xtrace_print_word_list (words, 0); + goto run_builtin; + } + + if (command_line == 0) + command_line = savestring (the_printed_command_except_trap ? the_printed_command_except_trap : ""); + +#if defined (PROCESS_SUBSTITUTION) + if ((subshell_environment & SUBSHELL_COMSUB) && (simple_command->flags & CMD_NO_FORK) && fifos_pending() > 0) + simple_command->flags &= ~CMD_NO_FORK; +#endif + + result = execute_disk_command (words, simple_command->redirects, command_line, + pipe_in, pipe_out, async, fds_to_close, + simple_command->flags); + + return_result: + bind_lastarg (lastarg); + FREE (command_line); + dispose_words (words); + if (builtin) + { + executing_builtin = old_builtin; + executing_command_builtin = old_command_builtin; + } + discard_unwind_frame ("simple-command"); + this_command_name = (char *)NULL; /* points to freed memory now */ + return (result); +} + +/* Translate the special builtin exit statuses. We don't really need a + function for this; it's a placeholder for future work. */ +static int +builtin_status (result) + int result; +{ + int r; + + switch (result) + { + case EX_USAGE: + r = EX_BADUSAGE; + break; + case EX_REDIRFAIL: + case EX_BADSYNTAX: + case EX_BADASSIGN: + case EX_EXPFAIL: + r = EXECUTION_FAILURE; + break; + default: + r = EXECUTION_SUCCESS; + break; + } + return (r); +} + +static int +execute_builtin (builtin, words, flags, subshell) + sh_builtin_func_t *builtin; + WORD_LIST *words; + int flags, subshell; +{ + int old_e_flag, result, eval_unwind; + int isbltinenv; + char *error_trap; + + error_trap = 0; + old_e_flag = exit_immediately_on_error; + + /* The eval builtin calls parse_and_execute, which does not know about + the setting of flags, and always calls the execution functions with + flags that will exit the shell on an error if -e is set. If the + eval builtin is being called, and we're supposed to ignore the exit + value of the command, we turn the -e flag off ourselves and disable + the ERR trap, then restore them when the command completes. This is + also a problem (as below) for the command and source/. builtins. */ + if (subshell == 0 && (flags & CMD_IGNORE_RETURN) && + (builtin == eval_builtin || builtin == command_builtin || builtin == source_builtin)) + { + begin_unwind_frame ("eval_builtin"); + unwind_protect_int (exit_immediately_on_error); + unwind_protect_int (builtin_ignoring_errexit); + error_trap = TRAP_STRING (ERROR_TRAP); + if (error_trap) + { + error_trap = savestring (error_trap); + add_unwind_protect (xfree, error_trap); + add_unwind_protect (set_error_trap, error_trap); + restore_default_signal (ERROR_TRAP); + } + exit_immediately_on_error = 0; + builtin_ignoring_errexit = 1; + eval_unwind = 1; + } + else + eval_unwind = 0; + + /* The temporary environment for a builtin is supposed to apply to + all commands executed by that builtin. Currently, this is a + problem only with the `unset', `source' and `eval' builtins. + `mapfile' is a special case because it uses evalstring (same as + eval or source) to run its callbacks. */ + isbltinenv = (builtin == source_builtin || builtin == eval_builtin || builtin == unset_builtin || builtin == mapfile_builtin); + + if (isbltinenv) + { + if (subshell == 0) + begin_unwind_frame ("builtin_env"); + + if (temporary_env) + { + push_scope (VC_BLTNENV, temporary_env); + if (subshell == 0) + add_unwind_protect (pop_scope, (flags & CMD_COMMAND_BUILTIN) ? 0 : "1"); + temporary_env = (HASH_TABLE *)NULL; + } + } + + /* `return' does a longjmp() back to a saved environment in execute_function. + If a variable assignment list preceded the command, and the shell is + running in POSIX mode, we need to merge that into the shell_variables + table, since `return' is a POSIX special builtin. */ + if (posixly_correct && subshell == 0 && builtin == return_builtin && temporary_env) + { + begin_unwind_frame ("return_temp_env"); + add_unwind_protect (merge_temporary_env, (char *)NULL); + } + + executing_builtin++; + executing_command_builtin |= builtin == command_builtin; + result = ((*builtin) (words->next)); + + /* This shouldn't happen, but in case `return' comes back instead of + longjmp'ing, we need to unwind. */ + if (posixly_correct && subshell == 0 && builtin == return_builtin && temporary_env) + discard_unwind_frame ("return_temp_env"); + + if (subshell == 0 && isbltinenv) + run_unwind_frame ("builtin_env"); + + if (eval_unwind) + { + exit_immediately_on_error = errexit_flag; + builtin_ignoring_errexit = 0; + if (error_trap) + { + set_error_trap (error_trap); + xfree (error_trap); + } + discard_unwind_frame ("eval_builtin"); + } + + return (result); +} + +static int +execute_function (var, words, flags, fds_to_close, async, subshell) + SHELL_VAR *var; + WORD_LIST *words; + int flags; + struct fd_bitmap *fds_to_close; + int async, subshell; +{ + int return_val, result; + COMMAND *tc, *fc, *save_current; + char *debug_trap, *error_trap, *return_trap; +#if defined (ARRAY_VARS) + SHELL_VAR *funcname_v, *nfv, *bash_source_v, *bash_lineno_v; + ARRAY *funcname_a; + volatile ARRAY *bash_source_a; + volatile ARRAY *bash_lineno_a; +#endif + FUNCTION_DEF *shell_fn; + char *sfile, *t; + + USE_VAR(fc); + + if (funcnest_max > 0 && funcnest >= funcnest_max) + { + internal_error (_("%s: maximum function nesting level exceeded (%d)"), var->name, funcnest); + funcnest = 0; /* XXX - should we reset it somewhere else? */ + jump_to_top_level (DISCARD); + } + +#if defined (ARRAY_VARS) + GET_ARRAY_FROM_VAR ("FUNCNAME", funcname_v, funcname_a); + GET_ARRAY_FROM_VAR ("BASH_SOURCE", bash_source_v, bash_source_a); + GET_ARRAY_FROM_VAR ("BASH_LINENO", bash_lineno_v, bash_lineno_a); +#endif + + tc = (COMMAND *)copy_command (function_cell (var)); + if (tc && (flags & CMD_IGNORE_RETURN)) + tc->flags |= CMD_IGNORE_RETURN; + + if (subshell == 0) + { + begin_unwind_frame ("function_calling"); + push_context (var->name, subshell, temporary_env); + add_unwind_protect (pop_context, (char *)NULL); + unwind_protect_int (line_number); + unwind_protect_int (return_catch_flag); + unwind_protect_jmp_buf (return_catch); + add_unwind_protect (dispose_command, (char *)tc); + unwind_protect_pointer (this_shell_function); + unwind_protect_int (loop_level); + unwind_protect_int (funcnest); + } + else + push_context (var->name, subshell, temporary_env); /* don't unwind-protect for subshells */ + + temporary_env = (HASH_TABLE *)NULL; + + this_shell_function = var; + make_funcname_visible (1); + + debug_trap = TRAP_STRING(DEBUG_TRAP); + error_trap = TRAP_STRING(ERROR_TRAP); + return_trap = TRAP_STRING(RETURN_TRAP); + + /* The order of the unwind protects for debug_trap, error_trap and + return_trap is important here! unwind-protect commands are run + in reverse order of registration. If this causes problems, take + out the xfree unwind-protect calls and live with the small memory leak. */ + + /* function_trace_mode != 0 means that all functions inherit the DEBUG trap. + if the function has the trace attribute set, it inherits the DEBUG trap */ + if (debug_trap && ((trace_p (var) == 0) && function_trace_mode == 0)) + { + if (subshell == 0) + { + debug_trap = savestring (debug_trap); + add_unwind_protect (xfree, debug_trap); + add_unwind_protect (set_debug_trap, debug_trap); + } + restore_default_signal (DEBUG_TRAP); + } + + /* error_trace_mode != 0 means that functions inherit the ERR trap. */ + if (error_trap && error_trace_mode == 0) + { + if (subshell == 0) + { + error_trap = savestring (error_trap); + add_unwind_protect (xfree, error_trap); + add_unwind_protect (set_error_trap, error_trap); + } + restore_default_signal (ERROR_TRAP); + } + + /* Shell functions inherit the RETURN trap if function tracing is on + globally or on individually for this function. */ +#if 0 + if (return_trap && ((trace_p (var) == 0) && function_trace_mode == 0)) +#else + if (return_trap && (signal_in_progress (DEBUG_TRAP) || ((trace_p (var) == 0) && function_trace_mode == 0))) +#endif + { + if (subshell == 0) + { + return_trap = savestring (return_trap); + add_unwind_protect (xfree, return_trap); + add_unwind_protect (set_return_trap, return_trap); + } + restore_default_signal (RETURN_TRAP); + } + + funcnest++; +#if defined (ARRAY_VARS) + /* This is quite similar to the code in shell.c and elsewhere. */ + shell_fn = find_function_def (this_shell_function->name); + sfile = shell_fn ? shell_fn->source_file : ""; + array_push ((ARRAY *)funcname_a, this_shell_function->name); + + array_push ((ARRAY *)bash_source_a, sfile); + t = itos (executing_line_number ()); + array_push ((ARRAY *)bash_lineno_a, t); + free (t); +#endif + + /* The temporary environment for a function is supposed to apply to + all commands executed within the function body. */ + + remember_args (words->next, 1); + + /* Update BASH_ARGV and BASH_ARGC */ + if (debugging_mode) + push_args (words->next); + + /* Number of the line on which the function body starts. */ + line_number = function_line_number = tc->line; + +#if defined (JOB_CONTROL) + if (subshell) + stop_pipeline (async, (COMMAND *)NULL); +#endif + + fc = tc; + + return_catch_flag++; + return_val = setjmp_nosigs (return_catch); + + if (return_val) + { + result = return_catch_value; + /* Run the RETURN trap in the function's context. */ + save_current = currently_executing_command; + run_return_trap (); + currently_executing_command = save_current; + } + else + { + /* Run the debug trap here so we can trap at the start of a function's + execution rather than the execution of the body's first command. */ + showing_function_line = 1; + save_current = currently_executing_command; + result = run_debug_trap (); +#if defined (DEBUGGER) + /* In debugging mode, if the DEBUG trap returns a non-zero status, we + skip the command. */ + if (debugging_mode == 0 || result == EXECUTION_SUCCESS) + { + showing_function_line = 0; + currently_executing_command = save_current; + result = execute_command_internal (fc, 0, NO_PIPE, NO_PIPE, fds_to_close); + + /* Run the RETURN trap in the function's context */ + save_current = currently_executing_command; + run_return_trap (); + currently_executing_command = save_current; + } +#else + result = execute_command_internal (fc, 0, NO_PIPE, NO_PIPE, fds_to_close); + + save_current = currently_executing_command; + run_return_trap (); + currently_executing_command = save_current; +#endif + showing_function_line = 0; + } + + /* Restore BASH_ARGC and BASH_ARGV */ + if (debugging_mode) + pop_args (); + + if (subshell == 0) + run_unwind_frame ("function_calling"); + +#if defined (ARRAY_VARS) + /* These two variables cannot be unset, and cannot be affected by the + function. */ + array_pop ((ARRAY *)bash_source_a); + array_pop ((ARRAY *)bash_lineno_a); + + /* FUNCNAME can be unset, and so can potentially be changed by the + function. */ + GET_ARRAY_FROM_VAR ("FUNCNAME", nfv, funcname_a); + if (nfv == funcname_v) + array_pop (funcname_a); +#endif + + if (variable_context == 0 || this_shell_function == 0) + { + make_funcname_visible (0); +#if defined (PROCESS_SUBSTITUTION) + unlink_fifo_list (); +#endif + } + + return (result); +} + +/* A convenience routine for use by other parts of the shell to execute + a particular shell function. */ +int +execute_shell_function (var, words) + SHELL_VAR *var; + WORD_LIST *words; +{ + int ret; + struct fd_bitmap *bitmap; + + bitmap = new_fd_bitmap (FD_BITMAP_DEFAULT_SIZE); + begin_unwind_frame ("execute-shell-function"); + add_unwind_protect (dispose_fd_bitmap, (char *)bitmap); + + ret = execute_function (var, words, 0, bitmap, 0, 0); + + dispose_fd_bitmap (bitmap); + discard_unwind_frame ("execute-shell-function"); + + return ret; +} + +/* Execute a shell builtin or function in a subshell environment. This + routine does not return; it only calls exit(). If BUILTIN is non-null, + it points to a function to call to execute a shell builtin; otherwise + VAR points at the body of a function to execute. WORDS is the arguments + to the command, REDIRECTS specifies redirections to perform before the + command is executed. */ +static void +execute_subshell_builtin_or_function (words, redirects, builtin, var, + pipe_in, pipe_out, async, fds_to_close, + flags) + WORD_LIST *words; + REDIRECT *redirects; + sh_builtin_func_t *builtin; + SHELL_VAR *var; + int pipe_in, pipe_out, async; + struct fd_bitmap *fds_to_close; + int flags; +{ + int result, r, funcvalue; +#if defined (JOB_CONTROL) + int jobs_hack; + + jobs_hack = (builtin == jobs_builtin) && + ((subshell_environment & SUBSHELL_ASYNC) == 0 || pipe_out != NO_PIPE); +#endif + + /* A subshell is neither a login shell nor interactive. */ + login_shell = interactive = 0; + + if (async) + subshell_environment |= SUBSHELL_ASYNC; + if (pipe_in != NO_PIPE || pipe_out != NO_PIPE) + subshell_environment |= SUBSHELL_PIPE; + + maybe_make_export_env (); /* XXX - is this needed? */ + +#if defined (JOB_CONTROL) + /* Eradicate all traces of job control after we fork the subshell, so + all jobs begun by this subshell are in the same process group as + the shell itself. */ + + /* Allow the output of `jobs' to be piped. */ + if (jobs_hack) + kill_current_pipeline (); + else + without_job_control (); + + set_sigchld_handler (); +#endif /* JOB_CONTROL */ + + set_sigint_handler (); + + if (fds_to_close) + close_fd_bitmap (fds_to_close); + + do_piping (pipe_in, pipe_out); + + if (do_redirections (redirects, RX_ACTIVE) != 0) + exit (EXECUTION_FAILURE); + + if (builtin) + { + /* Give builtins a place to jump back to on failure, + so we don't go back up to main(). */ + result = setjmp_nosigs (top_level); + + /* Give the return builtin a place to jump to when executed in a subshell + or pipeline */ + funcvalue = 0; + if (return_catch_flag && builtin == return_builtin) + funcvalue = setjmp_nosigs (return_catch); + + if (result == EXITPROG) + exit (last_command_exit_value); + else if (result) + exit (EXECUTION_FAILURE); + else if (funcvalue) + exit (return_catch_value); + else + { + r = execute_builtin (builtin, words, flags, 1); + fflush (stdout); + if (r == EX_USAGE) + r = EX_BADUSAGE; + exit (r); + } + } + else + { + r = execute_function (var, words, flags, fds_to_close, async, 1); + fflush (stdout); + exit (r); + } +} + +/* Execute a builtin or function in the current shell context. If BUILTIN + is non-null, it is the builtin command to execute, otherwise VAR points + to the body of a function. WORDS are the command's arguments, REDIRECTS + are the redirections to perform. FDS_TO_CLOSE is the usual bitmap of + file descriptors to close. + + If BUILTIN is exec_builtin, the redirections specified in REDIRECTS are + not undone before this function returns. */ +static int +execute_builtin_or_function (words, builtin, var, redirects, + fds_to_close, flags) + WORD_LIST *words; + sh_builtin_func_t *builtin; + SHELL_VAR *var; + REDIRECT *redirects; + struct fd_bitmap *fds_to_close; + int flags; +{ + int result; + REDIRECT *saved_undo_list; +#if defined (PROCESS_SUBSTITUTION) + int ofifo, nfifo, osize; + char *ofifo_list; +#endif + + +#if defined (PROCESS_SUBSTITUTION) + ofifo = num_fifos (); + ofifo_list = copy_fifo_list (&osize); +#endif + + if (do_redirections (redirects, RX_ACTIVE|RX_UNDOABLE) != 0) + { + cleanup_redirects (redirection_undo_list); + redirection_undo_list = (REDIRECT *)NULL; + dispose_exec_redirects (); +#if defined (PROCESS_SUBSTITUTION) + free (ofifo_list); +#endif + return (EX_REDIRFAIL); /* was EXECUTION_FAILURE */ + } + + saved_undo_list = redirection_undo_list; + + /* Calling the "exec" builtin changes redirections forever. */ + if (builtin == exec_builtin) + { + dispose_redirects (saved_undo_list); + saved_undo_list = exec_redirection_undo_list; + exec_redirection_undo_list = (REDIRECT *)NULL; + } + else + dispose_exec_redirects (); + + if (saved_undo_list) + { + begin_unwind_frame ("saved redirects"); + add_unwind_protect (cleanup_redirects, (char *)saved_undo_list); + } + + redirection_undo_list = (REDIRECT *)NULL; + + if (builtin) + result = execute_builtin (builtin, words, flags, 0); + else + result = execute_function (var, words, flags, fds_to_close, 0, 0); + + /* We do this before undoing the effects of any redirections. */ + fflush (stdout); + fpurge (stdout); + if (ferror (stdout)) + clearerr (stdout); + + /* If we are executing the `command' builtin, but this_shell_builtin is + set to `exec_builtin', we know that we have something like + `command exec [redirection]', since otherwise `exec' would have + overwritten the shell and we wouldn't get here. In this case, we + want to behave as if the `command' builtin had not been specified + and preserve the redirections. */ + if (builtin == command_builtin && this_shell_builtin == exec_builtin) + { + int discard; + + discard = 0; + if (saved_undo_list) + { + dispose_redirects (saved_undo_list); + discard = 1; + } + redirection_undo_list = exec_redirection_undo_list; + saved_undo_list = exec_redirection_undo_list = (REDIRECT *)NULL; + if (discard) + discard_unwind_frame ("saved redirects"); + } + + if (saved_undo_list) + { + redirection_undo_list = saved_undo_list; + discard_unwind_frame ("saved redirects"); + } + + if (redirection_undo_list) + { + cleanup_redirects (redirection_undo_list); + redirection_undo_list = (REDIRECT *)NULL; + } + +#if defined (PROCESS_SUBSTITUTION) + /* Close any FIFOs created by this builtin or function. */ + nfifo = num_fifos (); + if (nfifo > ofifo) + close_new_fifos (ofifo_list, osize); + free (ofifo_list); +#endif + + return (result); +} + +void +setup_async_signals () +{ +#if defined (__BEOS__) + set_signal_handler (SIGHUP, SIG_IGN); /* they want csh-like behavior */ +#endif + +#if defined (JOB_CONTROL) + if (job_control == 0) +#endif + { + /* Make sure we get the original signal dispositions now so we don't + confuse the trap builtin later if the subshell tries to use it to + reset SIGINT/SIGQUIT. Don't call set_signal_ignored; that sets + the value of original_signals to SIG_IGN. Posix interpretation 751. */ + get_original_signal (SIGINT); + set_signal_handler (SIGINT, SIG_IGN); + + get_original_signal (SIGQUIT); + set_signal_handler (SIGQUIT, SIG_IGN); + } +} + +/* Execute a simple command that is hopefully defined in a disk file + somewhere. + + 1) fork () + 2) connect pipes + 3) look up the command + 4) do redirections + 5) execve () + 6) If the execve failed, see if the file has executable mode set. + If so, and it isn't a directory, then execute its contents as + a shell script. + + Note that the filename hashing stuff has to take place up here, + in the parent. This is probably why the Bourne style shells + don't handle it, since that would require them to go through + this gnarly hair, for no good reason. + + NOTE: callers expect this to fork or exit(). */ + +/* Name of a shell function to call when a command name is not found. */ +#ifndef NOTFOUND_HOOK +# define NOTFOUND_HOOK "command_not_found_handle" +#endif + +static int +execute_disk_command (words, redirects, command_line, pipe_in, pipe_out, + async, fds_to_close, cmdflags) + WORD_LIST *words; + REDIRECT *redirects; + char *command_line; + int pipe_in, pipe_out, async; + struct fd_bitmap *fds_to_close; + int cmdflags; +{ + char *pathname, *command, **args; + int nofork, result; + pid_t pid; + SHELL_VAR *hookf; + WORD_LIST *wl; + + nofork = (cmdflags & CMD_NO_FORK); /* Don't fork, just exec, if no pipes */ + pathname = words->word->word; + + result = EXECUTION_SUCCESS; +#if defined (RESTRICTED_SHELL) + command = (char *)NULL; + if (restricted && mbschr (pathname, '/')) + { + internal_error (_("%s: restricted: cannot specify `/' in command names"), + pathname); + result = last_command_exit_value = EXECUTION_FAILURE; + + /* If we're not going to fork below, we must already be in a child + process or a context in which it's safe to call exit(2). */ + if (nofork && pipe_in == NO_PIPE && pipe_out == NO_PIPE) + exit (last_command_exit_value); + else + goto parent_return; + } +#endif /* RESTRICTED_SHELL */ + + command = search_for_command (pathname, 1); + + if (command) + { + maybe_make_export_env (); + put_command_name_into_env (command); + } + + /* We have to make the child before we check for the non-existence + of COMMAND, since we want the error messages to be redirected. */ + /* If we can get away without forking and there are no pipes to deal with, + don't bother to fork, just directly exec the command. */ + if (nofork && pipe_in == NO_PIPE && pipe_out == NO_PIPE) + pid = 0; + else + pid = make_child (savestring (command_line), async); + + if (pid == 0) + { + int old_interactive; + + reset_terminating_signals (); /* XXX */ + /* Cancel traps, in trap.c. */ + restore_original_signals (); + + CHECK_SIGTERM; + + /* restore_original_signals may have undone the work done + by make_child to ensure that SIGINT and SIGQUIT are ignored + in asynchronous children. */ + if (async) + { + if ((cmdflags & CMD_STDIN_REDIR) && + pipe_in == NO_PIPE && + (stdin_redirects (redirects) == 0)) + async_redirect_stdin (); + setup_async_signals (); + } + + /* This functionality is now provided by close-on-exec of the + file descriptors manipulated by redirection and piping. + Some file descriptors still need to be closed in all children + because of the way bash does pipes; fds_to_close is a + bitmap of all such file descriptors. */ + if (fds_to_close) + close_fd_bitmap (fds_to_close); + + do_piping (pipe_in, pipe_out); + + old_interactive = interactive; + if (async) + interactive = 0; + + subshell_environment = SUBSHELL_FORK; + + if (redirects && (do_redirections (redirects, RX_ACTIVE) != 0)) + { +#if defined (PROCESS_SUBSTITUTION) + /* Try to remove named pipes that may have been created as the + result of redirections. */ + unlink_fifo_list (); +#endif /* PROCESS_SUBSTITUTION */ + exit (EXECUTION_FAILURE); + } + + if (async) + interactive = old_interactive; + + if (command == 0) + { + hookf = find_function (NOTFOUND_HOOK); + if (hookf == 0) + { + /* Make sure filenames are displayed using printable characters */ + if (ansic_shouldquote (pathname)) + pathname = ansic_quote (pathname, 0, NULL); + internal_error (_("%s: command not found"), pathname); + exit (EX_NOTFOUND); /* Posix.2 says the exit status is 127 */ + } + +#if defined (JOB_CONTROL) + /* May need to reinitialize more of the job control state here. */ + kill_current_pipeline (); +#endif + + wl = make_word_list (make_word (NOTFOUND_HOOK), words); + exit (execute_shell_function (hookf, wl)); + } + + CHECK_SIGTERM; + + /* Execve expects the command name to be in args[0]. So we + leave it there, in the same format that the user used to + type it in. */ + args = strvec_from_word_list (words, 0, 0, (int *)NULL); + exit (shell_execve (command, args, export_env)); + } + else + { +parent_return: + QUIT; + + /* Make sure that the pipes are closed in the parent. */ + close_pipes (pipe_in, pipe_out); +#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD) + if (variable_context == 0) + unlink_fifo_list (); +#endif + FREE (command); + return (result); + } +} + +/* CPP defines to decide whether a particular index into the #! line + corresponds to a valid interpreter name or argument character, or + whitespace. The MSDOS define is to allow \r to be treated the same + as \n. */ + +#if !defined (MSDOS) +# define STRINGCHAR(ind) \ + (ind < sample_len && !whitespace (sample[ind]) && sample[ind] != '\n') +# define WHITECHAR(ind) \ + (ind < sample_len && whitespace (sample[ind])) +#else /* MSDOS */ +# define STRINGCHAR(ind) \ + (ind < sample_len && !whitespace (sample[ind]) && sample[ind] != '\n' && sample[ind] != '\r') +# define WHITECHAR(ind) \ + (ind < sample_len && whitespace (sample[ind])) +#endif /* MSDOS */ + +static char * +getinterp (sample, sample_len, endp) + char *sample; + int sample_len, *endp; +{ + register int i; + char *execname; + int start; + + /* Find the name of the interpreter to exec. */ + for (i = 2; i < sample_len && whitespace (sample[i]); i++) + ; + + for (start = i; STRINGCHAR(i); i++) + ; + + execname = substring (sample, start, i); + + if (endp) + *endp = i; + return execname; +} + +#if !defined (HAVE_HASH_BANG_EXEC) +/* If the operating system on which we're running does not handle + the #! executable format, then help out. SAMPLE is the text read + from the file, SAMPLE_LEN characters. COMMAND is the name of + the script; it and ARGS, the arguments given by the user, will + become arguments to the specified interpreter. ENV is the environment + to pass to the interpreter. + + The word immediately following the #! is the interpreter to execute. + A single argument to the interpreter is allowed. */ + +static int +execute_shell_script (sample, sample_len, command, args, env) + char *sample; + int sample_len; + char *command; + char **args, **env; +{ + char *execname, *firstarg; + int i, start, size_increment, larry; + + /* Find the name of the interpreter to exec. */ + execname = getinterp (sample, sample_len, &i); + size_increment = 1; + + /* Now the argument, if any. */ + for (firstarg = (char *)NULL, start = i; WHITECHAR(i); i++) + ; + + /* If there is more text on the line, then it is an argument for the + interpreter. */ + + if (STRINGCHAR(i)) + { + for (start = i; STRINGCHAR(i); i++) + ; + firstarg = substring ((char *)sample, start, i); + size_increment = 2; + } + + larry = strvec_len (args) + size_increment; + args = strvec_resize (args, larry + 1); + + for (i = larry - 1; i; i--) + args[i] = args[i - size_increment]; + + args[0] = execname; + if (firstarg) + { + args[1] = firstarg; + args[2] = command; + } + else + args[1] = command; + + args[larry] = (char *)NULL; + + return (shell_execve (execname, args, env)); +} +#undef STRINGCHAR +#undef WHITECHAR + +#endif /* !HAVE_HASH_BANG_EXEC */ + +static void +initialize_subshell () +{ +#if defined (ALIAS) + /* Forget about any aliases that we knew of. We are in a subshell. */ + delete_all_aliases (); +#endif /* ALIAS */ + +#if defined (HISTORY) + /* Forget about the history lines we have read. This is a non-interactive + subshell. */ + history_lines_this_session = 0; +#endif + +#if defined (JOB_CONTROL) + /* Forget about the way job control was working. We are in a subshell. */ + without_job_control (); + set_sigchld_handler (); + init_job_stats (); +#endif /* JOB_CONTROL */ + + /* Reset the values of the shell flags and options. */ + reset_shell_flags (); + reset_shell_options (); + reset_shopt_options (); + + /* Zero out builtin_env, since this could be a shell script run from a + sourced file with a temporary environment supplied to the `source/.' + builtin. Such variables are not supposed to be exported (empirical + testing with sh and ksh). Just throw it away; don't worry about a + memory leak. */ + if (vc_isbltnenv (shell_variables)) + shell_variables = shell_variables->down; + + clear_unwind_protect_list (0); + /* XXX -- are there other things we should be resetting here? */ + parse_and_execute_level = 0; /* nothing left to restore it */ + + /* We're no longer inside a shell function. */ + variable_context = return_catch_flag = funcnest = 0; + + executing_list = 0; /* XXX */ + + /* If we're not interactive, close the file descriptor from which we're + reading the current shell script. */ + if (interactive_shell == 0) + unset_bash_input (0); +} + +#if defined (HAVE_SETOSTYPE) && defined (_POSIX_SOURCE) +# define SETOSTYPE(x) __setostype(x) +#else +# define SETOSTYPE(x) +#endif + +#define READ_SAMPLE_BUF(file, buf, len) \ + do \ + { \ + fd = open(file, O_RDONLY); \ + if (fd >= 0) \ + { \ + len = read (fd, buf, 80); \ + close (fd); \ + } \ + else \ + len = -1; \ + } \ + while (0) + +/* Call execve (), handling interpreting shell scripts, and handling + exec failures. */ +int +shell_execve (command, args, env) + char *command; + char **args, **env; +{ + int larray, i, fd; + char sample[80]; + int sample_len; + + SETOSTYPE (0); /* Some systems use for USG/POSIX semantics */ + execve (command, args, env); + i = errno; /* error from execve() */ + CHECK_TERMSIG; + SETOSTYPE (1); + + /* If we get to this point, then start checking out the file. + Maybe it is something we can hack ourselves. */ + if (i != ENOEXEC) + { + if (file_isdir (command)) +#if defined (EISDIR) + internal_error (_("%s: %s"), command, strerror (EISDIR)); +#else + internal_error (_("%s: is a directory"), command); +#endif + else if (executable_file (command) == 0) + { + errno = i; + file_error (command); + } + /* errors not involving the path argument to execve. */ + else if (i == E2BIG || i == ENOMEM) + { + errno = i; + file_error (command); + } + else + { + /* The file has the execute bits set, but the kernel refuses to + run it for some reason. See why. */ +#if defined (HAVE_HASH_BANG_EXEC) + READ_SAMPLE_BUF (command, sample, sample_len); + sample[sample_len - 1] = '\0'; + if (sample_len > 2 && sample[0] == '#' && sample[1] == '!') + { + char *interp; + int ilen; + + interp = getinterp (sample, sample_len, (int *)NULL); + ilen = strlen (interp); + errno = i; + if (interp[ilen - 1] == '\r') + { + interp = xrealloc (interp, ilen + 2); + interp[ilen - 1] = '^'; + interp[ilen] = 'M'; + interp[ilen + 1] = '\0'; + } + sys_error (_("%s: %s: bad interpreter"), command, interp ? interp : ""); + FREE (interp); + return (EX_NOEXEC); + } +#endif + errno = i; + file_error (command); + } + return ((i == ENOENT) ? EX_NOTFOUND : EX_NOEXEC); /* XXX Posix.2 says that exit status is 126 */ + } + + /* This file is executable. + If it begins with #!, then help out people with losing operating + systems. Otherwise, check to see if it is a binary file by seeing + if the contents of the first line (or up to 80 characters) are in the + ASCII set. If it's a text file, execute the contents as shell commands, + otherwise return 126 (EX_BINARY_FILE). */ + READ_SAMPLE_BUF (command, sample, sample_len); + + if (sample_len == 0) + return (EXECUTION_SUCCESS); + + /* Is this supposed to be an executable script? + If so, the format of the line is "#! interpreter [argument]". + A single argument is allowed. The BSD kernel restricts + the length of the entire line to 32 characters (32 bytes + being the size of the BSD exec header), but we allow 80 + characters. */ + if (sample_len > 0) + { +#if !defined (HAVE_HASH_BANG_EXEC) + if (sample_len > 2 && sample[0] == '#' && sample[1] == '!') + return (execute_shell_script (sample, sample_len, command, args, env)); + else +#endif + if (check_binary_file (sample, sample_len)) + { + internal_error (_("%s: cannot execute binary file: %s"), command, strerror (i)); + return (EX_BINARY_FILE); + } + } + + /* We have committed to attempting to execute the contents of this file + as shell commands. */ + + initialize_subshell (); + + set_sigint_handler (); + + /* Insert the name of this shell into the argument list. */ + larray = strvec_len (args) + 1; + args = strvec_resize (args, larray + 1); + + for (i = larray - 1; i; i--) + args[i] = args[i - 1]; + + args[0] = shell_name; + args[1] = command; + args[larray] = (char *)NULL; + + if (args[0][0] == '-') + args[0]++; + +#if defined (RESTRICTED_SHELL) + if (restricted) + change_flag ('r', FLAG_OFF); +#endif + + if (subshell_argv) + { + /* Can't free subshell_argv[0]; that is shell_name. */ + for (i = 1; i < subshell_argc; i++) + free (subshell_argv[i]); + free (subshell_argv); + } + + dispose_command (currently_executing_command); /* XXX */ + currently_executing_command = (COMMAND *)NULL; + + subshell_argc = larray; + subshell_argv = args; + subshell_envp = env; + + unbind_args (); /* remove the positional parameters */ + + longjmp (subshell_top_level, 1); + /*NOTREACHED*/ +} + +static int +execute_intern_function (name, funcdef) + WORD_DESC *name; + FUNCTION_DEF *funcdef; +{ + SHELL_VAR *var; + + if (check_identifier (name, posixly_correct) == 0) + { + if (posixly_correct && interactive_shell == 0) + { + last_command_exit_value = EX_BADUSAGE; + jump_to_top_level (ERREXIT); + } + return (EXECUTION_FAILURE); + } + + /* Posix interpretation 383 */ + if (posixly_correct && find_special_builtin (name->word)) + { + internal_error (_("`%s': is a special builtin"), name->word); + last_command_exit_value = EX_BADUSAGE; + jump_to_top_level (ERREXIT); + } + + var = find_function (name->word); + if (var && (readonly_p (var) || noassign_p (var))) + { + if (readonly_p (var)) + internal_error (_("%s: readonly function"), var->name); + return (EXECUTION_FAILURE); + } + +#if defined (DEBUGGER) + bind_function_def (name->word, funcdef); +#endif + + bind_function (name->word, funcdef->command); + return (EXECUTION_SUCCESS); +} + +#if defined (INCLUDE_UNUSED) +#if defined (PROCESS_SUBSTITUTION) +void +close_all_files () +{ + register int i, fd_table_size; + + fd_table_size = getdtablesize (); + if (fd_table_size > 256) /* clamp to a reasonable value */ + fd_table_size = 256; + + for (i = 3; i < fd_table_size; i++) + close (i); +} +#endif /* PROCESS_SUBSTITUTION */ +#endif + +static void +close_pipes (in, out) + int in, out; +{ + if (in >= 0) + close (in); + if (out >= 0) + close (out); +} + +static void +dup_error (oldd, newd) + int oldd, newd; +{ + sys_error (_("cannot duplicate fd %d to fd %d"), oldd, newd); +} + +/* Redirect input and output to be from and to the specified pipes. + NO_PIPE and REDIRECT_BOTH are handled correctly. */ +static void +do_piping (pipe_in, pipe_out) + int pipe_in, pipe_out; +{ + if (pipe_in != NO_PIPE) + { + if (dup2 (pipe_in, 0) < 0) + dup_error (pipe_in, 0); + if (pipe_in > 0) + close (pipe_in); +#ifdef __CYGWIN__ + /* Let stdio know the fd may have changed from text to binary mode. */ + freopen (NULL, "r", stdin); +#endif /* __CYGWIN__ */ + } + if (pipe_out != NO_PIPE) + { + if (pipe_out != REDIRECT_BOTH) + { + if (dup2 (pipe_out, 1) < 0) + dup_error (pipe_out, 1); + if (pipe_out == 0 || pipe_out > 1) + close (pipe_out); + } + else + { + if (dup2 (1, 2) < 0) + dup_error (1, 2); + } +#ifdef __CYGWIN__ + /* Let stdio know the fd may have changed from text to binary mode, and + make sure to preserve stdout line buffering. */ + freopen (NULL, "w", stdout); + sh_setlinebuf (stdout); +#endif /* __CYGWIN__ */ + } +} diff --git a/execute_cmd.h b/execute_cmd.h new file mode 100644 index 0000000..67ae93a --- /dev/null +++ b/execute_cmd.h @@ -0,0 +1,68 @@ +/* execute_cmd.h - functions from execute_cmd.c. */ + +/* Copyright (C) 1993-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_EXECUTE_CMD_H_) +#define _EXECUTE_CMD_H_ + +#include "stdc.h" + +extern struct fd_bitmap *new_fd_bitmap __P((int)); +extern void dispose_fd_bitmap __P((struct fd_bitmap *)); +extern void close_fd_bitmap __P((struct fd_bitmap *)); +extern int executing_line_number __P((void)); +extern int execute_command __P((COMMAND *)); +extern int execute_command_internal __P((COMMAND *, int, int, int, struct fd_bitmap *)); +extern int shell_execve __P((char *, char **, char **)); +extern void setup_async_signals __P((void)); +extern void dispose_exec_redirects __P ((void)); + +extern int execute_shell_function __P((SHELL_VAR *, WORD_LIST *)); + +extern struct coproc *getcoprocbypid __P((pid_t)); +extern struct coproc *getcoprocbyname __P((const char *)); + +extern void coproc_init __P((struct coproc *)); +extern struct coproc *coproc_alloc __P((char *, pid_t)); +extern void coproc_dispose __P((struct coproc *)); +extern void coproc_flush __P((void)); +extern void coproc_close __P((struct coproc *)); +extern void coproc_closeall __P((void)); +extern void coproc_reap __P((void)); + +extern void coproc_rclose __P((struct coproc *, int)); +extern void coproc_wclose __P((struct coproc *, int)); +extern void coproc_fdclose __P((struct coproc *, int)); + +extern void coproc_checkfd __P((struct coproc *, int)); +extern void coproc_fdchk __P((int)); + +extern void coproc_pidchk __P((pid_t, int)); + +extern void coproc_fdsave __P((struct coproc *)); +extern void coproc_fdrestore __P((struct coproc *)); + +extern void coproc_setvars __P((struct coproc *)); +extern void coproc_unsetvars __P((struct coproc *)); + +#if defined (PROCESS_SUBSTITUTION) +extern void close_all_files __P((void)); +#endif + +#endif /* _EXECUTE_CMD_H_ */ diff --git a/expr.c b/expr.c new file mode 100644 index 0000000..1462c10 --- /dev/null +++ b/expr.c @@ -0,0 +1,1567 @@ +/* expr.c -- arithmetic expression evaluation. */ + +/* Copyright (C) 1990-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* + All arithmetic is done as intmax_t integers with no checking for overflow + (though division by 0 is caught and flagged as an error). + + The following operators are handled, grouped into a set of levels in + order of decreasing precedence. + + "id++", "id--" [post-increment and post-decrement] + "++id", "--id" [pre-increment and pre-decrement] + "-", "+" [(unary operators)] + "!", "~" + "**" [(exponentiation)] + "*", "/", "%" + "+", "-" + "<<", ">>" + "<=", ">=", "<", ">" + "==", "!=" + "&" + "^" + "|" + "&&" + "||" + "expr ? expr : expr" + "=", "*=", "/=", "%=", "+=", "-=", "<<=", ">>=", "&=", "^=", "|=" + , [comma] + + (Note that most of these operators have special meaning to bash, and an + entire expression should be quoted, e.g. "a=$a+1" or "a=a+1" to ensure + that it is passed intact to the evaluator when using `let'. When using + the $[] or $(( )) forms, the text between the `[' and `]' or `((' and `))' + is treated as if in double quotes.) + + Sub-expressions within parentheses have a precedence level greater than + all of the above levels and are evaluated first. Within a single prece- + dence group, evaluation is left-to-right, except for the arithmetic + assignment operator (`='), which is evaluated right-to-left (as in C). + + The expression evaluator returns the value of the expression (assignment + statements have as a value what is returned by the RHS). The `let' + builtin, on the other hand, returns 0 if the last expression evaluates to + a non-zero, and 1 otherwise. + + Implementation is a recursive-descent parser. + + Chet Ramey + chet@po.cwru.edu +*/ + +#include "config.h" + +#include +#include "bashansi.h" + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "chartypes.h" +#include "bashintl.h" + +#include "shell.h" +#include "typemax.h" /* INTMAX_MAX, INTMAX_MIN */ + +/* Because of the $((...)) construct, expressions may include newlines. + Here is a macro which accepts newlines, tabs and spaces as whitespace. */ +#define cr_whitespace(c) (whitespace(c) || ((c) == '\n')) + +/* Size be which the expression stack grows when necessary. */ +#define EXPR_STACK_GROW_SIZE 10 + +/* Maximum amount of recursion allowed. This prevents a non-integer + variable such as "num=num+2" from infinitely adding to itself when + "let num=num+2" is given. */ +#define MAX_EXPR_RECURSION_LEVEL 1024 + +/* The Tokens. Singing "The Lion Sleeps Tonight". */ + +#define EQEQ 1 /* "==" */ +#define NEQ 2 /* "!=" */ +#define LEQ 3 /* "<=" */ +#define GEQ 4 /* ">=" */ +#define STR 5 /* string */ +#define NUM 6 /* number */ +#define LAND 7 /* "&&" Logical AND */ +#define LOR 8 /* "||" Logical OR */ +#define LSH 9 /* "<<" Left SHift */ +#define RSH 10 /* ">>" Right SHift */ +#define OP_ASSIGN 11 /* op= expassign as in Posix.2 */ +#define COND 12 /* exp1 ? exp2 : exp3 */ +#define POWER 13 /* exp1**exp2 */ +#define PREINC 14 /* ++var */ +#define PREDEC 15 /* --var */ +#define POSTINC 16 /* var++ */ +#define POSTDEC 17 /* var-- */ +#define EQ '=' +#define GT '>' +#define LT '<' +#define PLUS '+' +#define MINUS '-' +#define MUL '*' +#define DIV '/' +#define MOD '%' +#define NOT '!' +#define LPAR '(' +#define RPAR ')' +#define BAND '&' /* Bitwise AND */ +#define BOR '|' /* Bitwise OR. */ +#define BXOR '^' /* Bitwise eXclusive OR. */ +#define BNOT '~' /* Bitwise NOT; Two's complement. */ +#define QUES '?' +#define COL ':' +#define COMMA ',' + +/* This should be the function corresponding to the operator with the + highest precedence. */ +#define EXP_HIGHEST expcomma + +#ifndef MAX_INT_LEN +# define MAX_INT_LEN 32 +#endif + +struct lvalue +{ + char *tokstr; /* possibly-rewritten lvalue if not NULL */ + intmax_t tokval; /* expression evaluated value */ + SHELL_VAR *tokvar; /* variable described by array or var reference */ + intmax_t ind; /* array index if not -1 */ +}; + +/* A structure defining a single expression context. */ +typedef struct { + int curtok, lasttok; + char *expression, *tp, *lasttp; + intmax_t tokval; + char *tokstr; + int noeval; + struct lvalue lval; +} EXPR_CONTEXT; + +static char *expression; /* The current expression */ +static char *tp; /* token lexical position */ +static char *lasttp; /* pointer to last token position */ +static int curtok; /* the current token */ +static int lasttok; /* the previous token */ +static int assigntok; /* the OP in OP= */ +static char *tokstr; /* current token string */ +static intmax_t tokval; /* current token value */ +static int noeval; /* set to 1 if no assignment to be done */ +static procenv_t evalbuf; + +static struct lvalue curlval = {0, 0, 0, -1}; +static struct lvalue lastlval = {0, 0, 0, -1}; + +static int _is_arithop __P((int)); +static void readtok __P((void)); /* lexical analyzer */ + +static void init_lvalue __P((struct lvalue *)); +static struct lvalue *alloc_lvalue __P((void)); +static void free_lvalue __P((struct lvalue *)); + +static intmax_t expr_streval __P((char *, int, struct lvalue *)); +static intmax_t strlong __P((char *)); +static void evalerror __P((const char *)); + +static void pushexp __P((void)); +static void popexp __P((void)); +static void expr_unwind __P((void)); +static void expr_bind_variable __P((char *, char *)); +#if defined (ARRAY_VARS) +static void expr_bind_array_element __P((char *, arrayind_t, char *)); +#endif + +static intmax_t subexpr __P((char *)); + +static intmax_t expcomma __P((void)); +static intmax_t expassign __P((void)); +static intmax_t expcond __P((void)); +static intmax_t explor __P((void)); +static intmax_t expland __P((void)); +static intmax_t expbor __P((void)); +static intmax_t expbxor __P((void)); +static intmax_t expband __P((void)); +static intmax_t exp5 __P((void)); +static intmax_t exp4 __P((void)); +static intmax_t expshift __P((void)); +static intmax_t exp3 __P((void)); +static intmax_t exp2 __P((void)); +static intmax_t exppower __P((void)); +static intmax_t exp1 __P((void)); +static intmax_t exp0 __P((void)); + +/* Global var which contains the stack of expression contexts. */ +static EXPR_CONTEXT **expr_stack; +static int expr_depth; /* Location in the stack. */ +static int expr_stack_size; /* Number of slots already allocated. */ + +extern char *this_command_name; +extern int unbound_vars_is_error, last_command_exit_value; + +#if defined (ARRAY_VARS) +extern const char * const bash_badsub_errmsg; +#endif + +#define SAVETOK(X) \ + do { \ + (X)->curtok = curtok; \ + (X)->lasttok = lasttok; \ + (X)->tp = tp; \ + (X)->lasttp = lasttp; \ + (X)->tokval = tokval; \ + (X)->tokstr = tokstr; \ + (X)->noeval = noeval; \ + (X)->lval = curlval; \ + } while (0) + +#define RESTORETOK(X) \ + do { \ + curtok = (X)->curtok; \ + lasttok = (X)->lasttok; \ + tp = (X)->tp; \ + lasttp = (X)->lasttp; \ + tokval = (X)->tokval; \ + tokstr = (X)->tokstr; \ + noeval = (X)->noeval; \ + curlval = (X)->lval; \ + } while (0) + +/* Push and save away the contents of the globals describing the + current expression context. */ +static void +pushexp () +{ + EXPR_CONTEXT *context; + + if (expr_depth >= MAX_EXPR_RECURSION_LEVEL) + evalerror (_("expression recursion level exceeded")); + + if (expr_depth >= expr_stack_size) + { + expr_stack_size += EXPR_STACK_GROW_SIZE; + expr_stack = (EXPR_CONTEXT **)xrealloc (expr_stack, expr_stack_size * sizeof (EXPR_CONTEXT *)); + } + + context = (EXPR_CONTEXT *)xmalloc (sizeof (EXPR_CONTEXT)); + + context->expression = expression; + SAVETOK(context); + + expr_stack[expr_depth++] = context; +} + +/* Pop the the contents of the expression context stack into the + globals describing the current expression context. */ +static void +popexp () +{ + EXPR_CONTEXT *context; + + if (expr_depth == 0) + evalerror (_("recursion stack underflow")); + + context = expr_stack[--expr_depth]; + + expression = context->expression; + RESTORETOK (context); + + free (context); +} + +static void +expr_unwind () +{ + while (--expr_depth > 0) + { + if (expr_stack[expr_depth]->tokstr) + free (expr_stack[expr_depth]->tokstr); + + if (expr_stack[expr_depth]->expression) + free (expr_stack[expr_depth]->expression); + + free (expr_stack[expr_depth]); + } + free (expr_stack[expr_depth]); /* free the allocated EXPR_CONTEXT */ + + noeval = 0; /* XXX */ +} + +static void +expr_bind_variable (lhs, rhs) + char *lhs, *rhs; +{ + SHELL_VAR *v; + + v = bind_int_variable (lhs, rhs); + if (v && (readonly_p (v) || noassign_p (v))) + longjmp (evalbuf, 1); /* variable assignment error */ + stupidly_hack_special_variables (lhs); +} + +#if defined (ARRAY_VARS) +/* Rewrite tok, which is of the form vname[expression], to vname[ind], where + IND is the already-calculated value of expression. */ +static void +expr_bind_array_element (tok, ind, rhs) + char *tok; + arrayind_t ind; + char *rhs; +{ + char *lhs, *vname; + size_t llen; + char ibuf[INT_STRLEN_BOUND (arrayind_t) + 1], *istr; + + istr = fmtumax (ind, 10, ibuf, sizeof (ibuf), 0); + vname = array_variable_name (tok, (char **)NULL, (int *)NULL); + + llen = strlen (vname) + sizeof (ibuf) + 3; + lhs = xmalloc (llen); + + sprintf (lhs, "%s[%s]", vname, istr); /* XXX */ + +/*itrace("expr_bind_array_element: %s=%s", lhs, rhs);*/ + expr_bind_variable (lhs, rhs); + free (vname); + free (lhs); +} +#endif /* ARRAY_VARS */ + +/* Evaluate EXPR, and return the arithmetic result. If VALIDP is + non-null, a zero is stored into the location to which it points + if the expression is invalid, non-zero otherwise. If a non-zero + value is returned in *VALIDP, the return value of evalexp() may + be used. + + The `while' loop after the longjmp is caught relies on the above + implementation of pushexp and popexp leaving in expr_stack[0] the + values that the variables had when the program started. That is, + the first things saved are the initial values of the variables that + were assigned at program startup or by the compiler. Therefore, it is + safe to let the loop terminate when expr_depth == 0, without freeing up + any of the expr_depth[0] stuff. */ +intmax_t +evalexp (expr, validp) + char *expr; + int *validp; +{ + intmax_t val; + int c; + procenv_t oevalbuf; + + val = 0; + noeval = 0; + + FASTCOPY (evalbuf, oevalbuf, sizeof (evalbuf)); + + c = setjmp_nosigs (evalbuf); + + if (c) + { + FREE (tokstr); + FREE (expression); + tokstr = expression = (char *)NULL; + + expr_unwind (); + + if (validp) + *validp = 0; + return (0); + } + + val = subexpr (expr); + + if (validp) + *validp = 1; + + FASTCOPY (oevalbuf, evalbuf, sizeof (evalbuf)); + + return (val); +} + +static intmax_t +subexpr (expr) + char *expr; +{ + intmax_t val; + char *p; + + for (p = expr; p && *p && cr_whitespace (*p); p++) + ; + + if (p == NULL || *p == '\0') + return (0); + + pushexp (); + expression = savestring (expr); + tp = expression; + + curtok = lasttok = 0; + tokstr = (char *)NULL; + tokval = 0; + init_lvalue (&curlval); + lastlval = curlval; + + readtok (); + + val = EXP_HIGHEST (); + + if (curtok != 0) + evalerror (_("syntax error in expression")); + + FREE (tokstr); + FREE (expression); + + popexp (); + + return val; +} + +static intmax_t +expcomma () +{ + register intmax_t value; + + value = expassign (); + while (curtok == COMMA) + { + readtok (); + value = expassign (); + } + + return value; +} + +static intmax_t +expassign () +{ + register intmax_t value; + char *lhs, *rhs; + arrayind_t lind; +#if defined (HAVE_IMAXDIV) + imaxdiv_t idiv; +#endif + + value = expcond (); + if (curtok == EQ || curtok == OP_ASSIGN) + { + int special, op; + intmax_t lvalue; + + special = curtok == OP_ASSIGN; + + if (lasttok != STR) + evalerror (_("attempted assignment to non-variable")); + + if (special) + { + op = assigntok; /* a OP= b */ + lvalue = value; + } + + /* XXX - watch out for pointer aliasing issues here */ + lhs = savestring (tokstr); + /* save ind in case rhs is string var and evaluation overwrites it */ + lind = curlval.ind; + readtok (); + value = expassign (); + + if (special) + { + if ((op == DIV || op == MOD) && value == 0) + { + if (noeval == 0) + evalerror (_("division by 0")); + else + value = 1; + } + + switch (op) + { + case MUL: + lvalue *= value; + break; + case DIV: + case MOD: + if (lvalue == INTMAX_MIN && value == -1) + lvalue = (op == DIV) ? INTMAX_MIN : 0; + else +#if HAVE_IMAXDIV + { + idiv = imaxdiv (lvalue, value); + lvalue = (op == DIV) ? idiv.quot : idiv.rem; + } +#else + lvalue = (op == DIV) ? lvalue / value : lvalue % value; +#endif + break; + case PLUS: + lvalue += value; + break; + case MINUS: + lvalue -= value; + break; + case LSH: + lvalue <<= value; + break; + case RSH: + lvalue >>= value; + break; + case BAND: + lvalue &= value; + break; + case BOR: + lvalue |= value; + break; + case BXOR: + lvalue ^= value; + break; + default: + free (lhs); + evalerror (_("bug: bad expassign token")); + break; + } + value = lvalue; + } + + rhs = itos (value); + if (noeval == 0) + { +#if defined (ARRAY_VARS) + if (lind != -1) + expr_bind_array_element (lhs, lind, rhs); + else +#endif + expr_bind_variable (lhs, rhs); + } + if (curlval.tokstr && curlval.tokstr == tokstr) + init_lvalue (&curlval); + + free (rhs); + free (lhs); + FREE (tokstr); + tokstr = (char *)NULL; /* For freeing on errors. */ + } + + return (value); +} + +/* Conditional expression (expr?expr:expr) */ +static intmax_t +expcond () +{ + intmax_t cval, val1, val2, rval; + int set_noeval; + + set_noeval = 0; + rval = cval = explor (); + if (curtok == QUES) /* found conditional expr */ + { + readtok (); + if (curtok == 0 || curtok == COL) + evalerror (_("expression expected")); + if (cval == 0) + { + set_noeval = 1; + noeval++; + } + + val1 = EXP_HIGHEST (); + + if (set_noeval) + noeval--; + if (curtok != COL) + evalerror (_("`:' expected for conditional expression")); + readtok (); + if (curtok == 0) + evalerror (_("expression expected")); + set_noeval = 0; + if (cval) + { + set_noeval = 1; + noeval++; + } + + val2 = expcond (); + if (set_noeval) + noeval--; + rval = cval ? val1 : val2; + lasttok = COND; + } + return rval; +} + +/* Logical OR. */ +static intmax_t +explor () +{ + register intmax_t val1, val2; + int set_noeval; + + val1 = expland (); + + while (curtok == LOR) + { + set_noeval = 0; + if (val1 != 0) + { + noeval++; + set_noeval = 1; + } + readtok (); + val2 = expland (); + if (set_noeval) + noeval--; + val1 = val1 || val2; + lasttok = LOR; + } + + return (val1); +} + +/* Logical AND. */ +static intmax_t +expland () +{ + register intmax_t val1, val2; + int set_noeval; + + val1 = expbor (); + + while (curtok == LAND) + { + set_noeval = 0; + if (val1 == 0) + { + set_noeval = 1; + noeval++; + } + readtok (); + val2 = expbor (); + if (set_noeval) + noeval--; + val1 = val1 && val2; + lasttok = LAND; + } + + return (val1); +} + +/* Bitwise OR. */ +static intmax_t +expbor () +{ + register intmax_t val1, val2; + + val1 = expbxor (); + + while (curtok == BOR) + { + readtok (); + val2 = expbxor (); + val1 = val1 | val2; + lasttok = NUM; + } + + return (val1); +} + +/* Bitwise XOR. */ +static intmax_t +expbxor () +{ + register intmax_t val1, val2; + + val1 = expband (); + + while (curtok == BXOR) + { + readtok (); + val2 = expband (); + val1 = val1 ^ val2; + lasttok = NUM; + } + + return (val1); +} + +/* Bitwise AND. */ +static intmax_t +expband () +{ + register intmax_t val1, val2; + + val1 = exp5 (); + + while (curtok == BAND) + { + readtok (); + val2 = exp5 (); + val1 = val1 & val2; + lasttok = NUM; + } + + return (val1); +} + +static intmax_t +exp5 () +{ + register intmax_t val1, val2; + + val1 = exp4 (); + + while ((curtok == EQEQ) || (curtok == NEQ)) + { + int op = curtok; + + readtok (); + val2 = exp4 (); + if (op == EQEQ) + val1 = (val1 == val2); + else if (op == NEQ) + val1 = (val1 != val2); + lasttok = NUM; + } + return (val1); +} + +static intmax_t +exp4 () +{ + register intmax_t val1, val2; + + val1 = expshift (); + while ((curtok == LEQ) || + (curtok == GEQ) || + (curtok == LT) || + (curtok == GT)) + { + int op = curtok; + + readtok (); + val2 = expshift (); + + if (op == LEQ) + val1 = val1 <= val2; + else if (op == GEQ) + val1 = val1 >= val2; + else if (op == LT) + val1 = val1 < val2; + else /* (op == GT) */ + val1 = val1 > val2; + lasttok = NUM; + } + return (val1); +} + +/* Left and right shifts. */ +static intmax_t +expshift () +{ + register intmax_t val1, val2; + + val1 = exp3 (); + + while ((curtok == LSH) || (curtok == RSH)) + { + int op = curtok; + + readtok (); + val2 = exp3 (); + + if (op == LSH) + val1 = val1 << val2; + else + val1 = val1 >> val2; + lasttok = NUM; + } + + return (val1); +} + +static intmax_t +exp3 () +{ + register intmax_t val1, val2; + + val1 = exp2 (); + + while ((curtok == PLUS) || (curtok == MINUS)) + { + int op = curtok; + + readtok (); + val2 = exp2 (); + + if (op == PLUS) + val1 += val2; + else if (op == MINUS) + val1 -= val2; + lasttok = NUM; + } + return (val1); +} + +static intmax_t +exp2 () +{ + register intmax_t val1, val2; +#if defined (HAVE_IMAXDIV) + imaxdiv_t idiv; +#endif + + val1 = exppower (); + + while ((curtok == MUL) || + (curtok == DIV) || + (curtok == MOD)) + { + int op = curtok; + char *stp, *sltp; + + stp = tp; + readtok (); + + val2 = exppower (); + + /* Handle division by 0 and twos-complement arithmetic overflow */ + if (((op == DIV) || (op == MOD)) && (val2 == 0)) + { + if (noeval == 0) + { + sltp = lasttp; + lasttp = stp; + while (lasttp && *lasttp && whitespace (*lasttp)) + lasttp++; + evalerror (_("division by 0")); + lasttp = sltp; + } + else + val2 = 1; + } + else if (op == MOD && val1 == INTMAX_MIN && val2 == -1) + { + val1 = 0; + continue; + } + else if (op == DIV && val1 == INTMAX_MIN && val2 == -1) + val2 = 1; + + if (op == MUL) + val1 *= val2; + else if (op == DIV || op == MOD) +#if defined (HAVE_IMAXDIV) + { + idiv = imaxdiv (val1, val2); + val1 = (op == DIV) ? idiv.quot : idiv.rem; + } +#else + val1 = (op == DIV) ? val1 / val2 : val1 % val2; +#endif + lasttok = NUM; + } + return (val1); +} + +static intmax_t +ipow (base, exp) + intmax_t base, exp; +{ + intmax_t result; + + result = 1; + while (exp) + { + if (exp & 1) + result *= base; + exp >>= 1; + base *= base; + } + return result; +} + +static intmax_t +exppower () +{ + register intmax_t val1, val2, c; + + val1 = exp1 (); + while (curtok == POWER) + { + readtok (); + val2 = exppower (); /* exponentiation is right-associative */ + lasttok = NUM; + if (val2 == 0) + return (1); + if (val2 < 0) + evalerror (_("exponent less than 0")); + val1 = ipow (val1, val2); + } + return (val1); +} + +static intmax_t +exp1 () +{ + register intmax_t val; + + if (curtok == NOT) + { + readtok (); + val = !exp1 (); + lasttok = NUM; + } + else if (curtok == BNOT) + { + readtok (); + val = ~exp1 (); + lasttok = NUM; + } + else if (curtok == MINUS) + { + readtok (); + val = - exp1 (); + lasttok = NUM; + } + else if (curtok == PLUS) + { + readtok (); + val = exp1 (); + lasttok = NUM; + } + else + val = exp0 (); + + return (val); +} + +static intmax_t +exp0 () +{ + register intmax_t val = 0, v2; + char *vincdec; + int stok; + EXPR_CONTEXT ec; + + /* XXX - might need additional logic here to decide whether or not + pre-increment or pre-decrement is legal at this point. */ + if (curtok == PREINC || curtok == PREDEC) + { + stok = lasttok = curtok; + readtok (); + if (curtok != STR) + /* readtok() catches this */ + evalerror (_("identifier expected after pre-increment or pre-decrement")); + + v2 = tokval + ((stok == PREINC) ? 1 : -1); + vincdec = itos (v2); + if (noeval == 0) + { +#if defined (ARRAY_VARS) + if (curlval.ind != -1) + expr_bind_array_element (curlval.tokstr, curlval.ind, vincdec); + else +#endif + expr_bind_variable (tokstr, vincdec); + } + free (vincdec); + val = v2; + + curtok = NUM; /* make sure --x=7 is flagged as an error */ + readtok (); + } + else if (curtok == LPAR) + { + /* XXX - save curlval here? Or entire expression context? */ + readtok (); + val = EXP_HIGHEST (); + + if (curtok != RPAR) /* ( */ + evalerror (_("missing `)'")); + + /* Skip over closing paren. */ + readtok (); + } + else if ((curtok == NUM) || (curtok == STR)) + { + val = tokval; + if (curtok == STR) + { + SAVETOK (&ec); + tokstr = (char *)NULL; /* keep it from being freed */ + noeval = 1; + readtok (); + stok = curtok; + + /* post-increment or post-decrement */ + if (stok == POSTINC || stok == POSTDEC) + { + /* restore certain portions of EC */ + tokstr = ec.tokstr; + noeval = ec.noeval; + curlval = ec.lval; + lasttok = STR; /* ec.curtok */ + + v2 = val + ((stok == POSTINC) ? 1 : -1); + vincdec = itos (v2); + if (noeval == 0) + { +#if defined (ARRAY_VARS) + if (curlval.ind != -1) + expr_bind_array_element (curlval.tokstr, curlval.ind, vincdec); + else +#endif + expr_bind_variable (tokstr, vincdec); + } + free (vincdec); + curtok = NUM; /* make sure x++=7 is flagged as an error */ + } + else + { + /* XXX - watch out for pointer aliasing issues here */ + if (stok == STR) /* free new tokstr before old one is restored */ + FREE (tokstr); + RESTORETOK (&ec); + } + } + + readtok (); + } + else + evalerror (_("syntax error: operand expected")); + + return (val); +} + +static void +init_lvalue (lv) + struct lvalue *lv; +{ + lv->tokstr = 0; + lv->tokvar = 0; + lv->tokval = lv->ind = -1; +} + +static struct lvalue * +alloc_lvalue () +{ + struct lvalue *lv; + + lv = xmalloc (sizeof (struct lvalue)); + init_lvalue (lv); + return (lv); +} + +static void +free_lvalue (lv) + struct lvalue *lv; +{ + free (lv); /* should be inlined */ +} + +static intmax_t +expr_streval (tok, e, lvalue) + char *tok; + int e; + struct lvalue *lvalue; +{ + SHELL_VAR *v; + char *value; + intmax_t tval; +#if defined (ARRAY_VARS) + arrayind_t ind; +#endif + +/*itrace("expr_streval: %s: noeval = %d", tok, noeval);*/ + /* If we are suppressing evaluation, just short-circuit here instead of + going through the rest of the evaluator. */ + if (noeval) + return (0); + + /* [[[[[ */ +#if defined (ARRAY_VARS) + v = (e == ']') ? array_variable_part (tok, (char **)0, (int *)0) : find_variable (tok); +#else + v = find_variable (tok); +#endif + + if ((v == 0 || invisible_p (v)) && unbound_vars_is_error) + { +#if defined (ARRAY_VARS) + value = (e == ']') ? array_variable_name (tok, (char **)0, (int *)0) : tok; +#else + value = tok; +#endif + + last_command_exit_value = EXECUTION_FAILURE; + err_unboundvar (value); + +#if defined (ARRAY_VARS) + if (e == ']') + FREE (value); /* array_variable_name returns new memory */ +#endif + + if (interactive_shell) + { + expr_unwind (); + top_level_cleanup (); + jump_to_top_level (DISCARD); + } + else + jump_to_top_level (FORCE_EOF); + } + +#if defined (ARRAY_VARS) + ind = -1; + /* Second argument of 0 to get_array_value means that we don't allow + references like array[@]. In this case, get_array_value is just + like get_variable_value in that it does not return newly-allocated + memory or quote the results. */ + value = (e == ']') ? get_array_value (tok, 0, (int *)NULL, &ind) : get_variable_value (v); +#else + value = get_variable_value (v); +#endif + + tval = (value && *value) ? subexpr (value) : 0; + + if (lvalue) + { + lvalue->tokstr = tok; /* XXX */ + lvalue->tokval = tval; + lvalue->tokvar = v; /* XXX */ +#if defined (ARRAY_VARS) + lvalue->ind = ind; +#else + lvalue->ind = -1; +#endif + } + + return (tval); +} + +static int +_is_multiop (c) + int c; +{ + switch (c) + { + case EQEQ: + case NEQ: + case LEQ: + case GEQ: + case LAND: + case LOR: + case LSH: + case RSH: + case OP_ASSIGN: + case COND: + case POWER: + case PREINC: + case PREDEC: + case POSTINC: + case POSTDEC: + return 1; + default: + return 0; + } +} + +static int +_is_arithop (c) + int c; +{ + switch (c) + { + case EQ: + case GT: + case LT: + case PLUS: + case MINUS: + case MUL: + case DIV: + case MOD: + case NOT: + case LPAR: + case RPAR: + case BAND: + case BOR: + case BXOR: + case BNOT: + return 1; /* operator tokens */ + case QUES: + case COL: + case COMMA: + return 1; /* questionable */ + default: + return 0; /* anything else is invalid */ + } +} + +/* Lexical analyzer/token reader for the expression evaluator. Reads the + next token and puts its value into curtok, while advancing past it. + Updates value of tp. May also set tokval (for number) or tokstr (for + string). */ +static void +readtok () +{ + register char *cp, *xp; + register unsigned char c, c1; + register int e; + struct lvalue lval; + + /* Skip leading whitespace. */ + cp = tp; + c = e = 0; + while (cp && (c = *cp) && (cr_whitespace (c))) + cp++; + + if (c) + cp++; + + if (c == '\0') + { + lasttok = curtok; + curtok = 0; + tp = cp; + return; + } + lasttp = tp = cp - 1; + + if (legal_variable_starter (c)) + { + /* variable names not preceded with a dollar sign are shell variables. */ + char *savecp; + EXPR_CONTEXT ec; + int peektok; + + while (legal_variable_char (c)) + c = *cp++; + + c = *--cp; + +#if defined (ARRAY_VARS) + if (c == '[') + { + e = skipsubscript (cp, 0, 0); + if (cp[e] == ']') + { + cp += e + 1; + c = *cp; + e = ']'; + } + else + evalerror (bash_badsub_errmsg); + } +#endif /* ARRAY_VARS */ + + *cp = '\0'; + /* XXX - watch out for pointer aliasing issues here */ + if (curlval.tokstr && curlval.tokstr == tokstr) + init_lvalue (&curlval); + + FREE (tokstr); + tokstr = savestring (tp); + *cp = c; + + /* XXX - make peektok part of saved token state? */ + SAVETOK (&ec); + tokstr = (char *)NULL; /* keep it from being freed */ + tp = savecp = cp; + noeval = 1; + curtok = STR; + readtok (); + peektok = curtok; + if (peektok == STR) /* free new tokstr before old one is restored */ + FREE (tokstr); + RESTORETOK (&ec); + cp = savecp; + + /* The tests for PREINC and PREDEC aren't strictly correct, but they + preserve old behavior if a construct like --x=9 is given. */ + if (lasttok == PREINC || lasttok == PREDEC || peektok != EQ) + { + lastlval = curlval; + tokval = expr_streval (tokstr, e, &curlval); + } + else + tokval = 0; + + lasttok = curtok; + curtok = STR; + } + else if (DIGIT(c)) + { + while (ISALNUM (c) || c == '#' || c == '@' || c == '_') + c = *cp++; + + c = *--cp; + *cp = '\0'; + + tokval = strlong (tp); + *cp = c; + lasttok = curtok; + curtok = NUM; + } + else + { + c1 = *cp++; + if ((c == EQ) && (c1 == EQ)) + c = EQEQ; + else if ((c == NOT) && (c1 == EQ)) + c = NEQ; + else if ((c == GT) && (c1 == EQ)) + c = GEQ; + else if ((c == LT) && (c1 == EQ)) + c = LEQ; + else if ((c == LT) && (c1 == LT)) + { + if (*cp == '=') /* a <<= b */ + { + assigntok = LSH; + c = OP_ASSIGN; + cp++; + } + else + c = LSH; + } + else if ((c == GT) && (c1 == GT)) + { + if (*cp == '=') + { + assigntok = RSH; /* a >>= b */ + c = OP_ASSIGN; + cp++; + } + else + c = RSH; + } + else if ((c == BAND) && (c1 == BAND)) + c = LAND; + else if ((c == BOR) && (c1 == BOR)) + c = LOR; + else if ((c == '*') && (c1 == '*')) + c = POWER; + else if ((c == '-' || c == '+') && c1 == c && curtok == STR) + c = (c == '-') ? POSTDEC : POSTINC; + else if ((c == '-' || c == '+') && c1 == c) + { + /* Quickly scan forward to see if this is followed by optional + whitespace and an identifier. */ + xp = cp; + while (xp && *xp && cr_whitespace (*xp)) + xp++; + if (legal_variable_starter ((unsigned char)*xp)) + c = (c == '-') ? PREDEC : PREINC; + else + cp--; /* not preinc or predec, so unget the character */ + } + else if (c1 == EQ && member (c, "*/%+-&^|")) + { + assigntok = c; /* a OP= b */ + c = OP_ASSIGN; + } + else if (_is_arithop (c) == 0) + { + cp--; + /* use curtok, since it hasn't been copied to lasttok yet */ + if (curtok == 0 || _is_arithop (curtok) || _is_multiop (curtok)) + evalerror (_("syntax error: operand expected")); + else + evalerror (_("syntax error: invalid arithmetic operator")); + } + else + cp--; /* `unget' the character */ + + /* Should check here to make sure that the current character is one + of the recognized operators and flag an error if not. Could create + a character map the first time through and check it on subsequent + calls. */ + lasttok = curtok; + curtok = c; + } + tp = cp; +} + +static void +evalerror (msg) + const char *msg; +{ + char *name, *t; + + name = this_command_name; + for (t = expression; whitespace (*t); t++) + ; + internal_error (_("%s%s%s: %s (error token is \"%s\")"), + name ? name : "", name ? ": " : "", t, + msg, (lasttp && *lasttp) ? lasttp : ""); + longjmp (evalbuf, 1); +} + +/* Convert a string to an intmax_t integer, with an arbitrary base. + 0nnn -> base 8 + 0[Xx]nn -> base 16 + Anything else: [base#]number (this is implemented to match ksh93) + + Base may be >=2 and <=64. If base is <= 36, the numbers are drawn + from [0-9][a-zA-Z], and lowercase and uppercase letters may be used + interchangably. If base is > 36 and <= 64, the numbers are drawn + from [0-9][a-z][A-Z]_@ (a = 10, z = 35, A = 36, Z = 61, @ = 62, _ = 63 -- + you get the picture). */ + +static intmax_t +strlong (num) + char *num; +{ + register char *s; + register unsigned char c; + int base, foundbase; + intmax_t val; + + s = num; + + base = 10; + foundbase = 0; + if (*s == '0') + { + s++; + + if (*s == '\0') + return 0; + + /* Base 16? */ + if (*s == 'x' || *s == 'X') + { + base = 16; + s++; + } + else + base = 8; + foundbase++; + } + + val = 0; + for (c = *s++; c; c = *s++) + { + if (c == '#') + { + if (foundbase) + evalerror (_("invalid number")); + + /* Illegal base specifications raise an evaluation error. */ + if (val < 2 || val > 64) + evalerror (_("invalid arithmetic base")); + + base = val; + val = 0; + foundbase++; + } + else if (ISALNUM(c) || (c == '_') || (c == '@')) + { + if (DIGIT(c)) + c = TODIGIT(c); + else if (c >= 'a' && c <= 'z') + c -= 'a' - 10; + else if (c >= 'A' && c <= 'Z') + c -= 'A' - ((base <= 36) ? 10 : 36); + else if (c == '@') + c = 62; + else if (c == '_') + c = 63; + + if (c >= base) + evalerror (_("value too great for base")); + + val = (val * base) + c; + } + else + break; + } + + return (val); +} + +#if defined (EXPR_TEST) +void * +xmalloc (n) + int n; +{ + return (malloc (n)); +} + +void * +xrealloc (s, n) + char *s; + int n; +{ + return (realloc (s, n)); +} + +SHELL_VAR *find_variable () { return 0;} +SHELL_VAR *bind_variable () { return 0; } + +char *get_string_value () { return 0; } + +procenv_t top_level; + +main (argc, argv) + int argc; + char **argv; +{ + register int i; + intmax_t v; + int expok; + + if (setjmp (top_level)) + exit (0); + + for (i = 1; i < argc; i++) + { + v = evalexp (argv[i], &expok); + if (expok == 0) + fprintf (stderr, _("%s: expression error\n"), argv[i]); + else + printf ("'%s' -> %ld\n", argv[i], v); + } + exit (0); +} + +int +builtin_error (format, arg1, arg2, arg3, arg4, arg5) + char *format; +{ + fprintf (stderr, "expr: "); + fprintf (stderr, format, arg1, arg2, arg3, arg4, arg5); + fprintf (stderr, "\n"); + return 0; +} + +char * +itos (n) + intmax_t n; +{ + return ("42"); +} + +#endif /* EXPR_TEST */ diff --git a/externs.h b/externs.h new file mode 100644 index 0000000..8db43f2 --- /dev/null +++ b/externs.h @@ -0,0 +1,517 @@ +/* externs.h -- extern function declarations which do not appear in their + own header file. */ + +/* Copyright (C) 1993-2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Make sure that this is included *after* config.h! */ + +#if !defined (_EXTERNS_H_) +# define _EXTERNS_H_ + +#include "stdc.h" + +/* Functions from expr.c. */ +extern intmax_t evalexp __P((char *, int *)); + +/* Functions from print_cmd.c. */ +#define FUNC_MULTILINE 0x01 +#define FUNC_EXTERNAL 0x02 + +extern char *make_command_string __P((COMMAND *)); +extern char *named_function_string __P((char *, COMMAND *, int)); + +extern void print_command __P((COMMAND *)); +extern void print_simple_command __P((SIMPLE_COM *)); +extern void print_word_list __P((WORD_LIST *, char *)); + +/* debugger support */ +extern void print_for_command_head __P((FOR_COM *)); +#if defined (SELECT_COMMAND) +extern void print_select_command_head __P((SELECT_COM *)); +#endif +extern void print_case_command_head __P((CASE_COM *)); +#if defined (DPAREN_ARITHMETIC) +extern void print_arith_command __P((WORD_LIST *)); +#endif +#if defined (COND_COMMAND) +extern void print_cond_command __P((COND_COM *)); +#endif + +/* set -x support */ +extern void xtrace_init __P((void)); +#ifdef NEED_XTRACE_SET_DECL +extern void xtrace_set __P((int, FILE *)); +#endif +extern void xtrace_fdchk __P((int)); +extern void xtrace_reset __P((void)); +extern char *indirection_level_string __P((void)); +extern void xtrace_print_assignment __P((char *, char *, int, int)); +extern void xtrace_print_word_list __P((WORD_LIST *, int)); +extern void xtrace_print_for_command_head __P((FOR_COM *)); +#if defined (SELECT_COMMAND) +extern void xtrace_print_select_command_head __P((SELECT_COM *)); +#endif +extern void xtrace_print_case_command_head __P((CASE_COM *)); +#if defined (DPAREN_ARITHMETIC) +extern void xtrace_print_arith_cmd __P((WORD_LIST *)); +#endif +#if defined (COND_COMMAND) +extern void xtrace_print_cond_term __P((int, int, WORD_DESC *, char *, char *)); +#endif + +/* Functions from shell.c. */ +extern void exit_shell __P((int)) __attribute__((__noreturn__)); +extern void sh_exit __P((int)) __attribute__((__noreturn__)); +extern void subshell_exit __P((int)) __attribute__((__noreturn__)); +extern void disable_priv_mode __P((void)); +extern void unbind_args __P((void)); + +#if defined (RESTRICTED_SHELL) +extern int shell_is_restricted __P((char *)); +extern int maybe_make_restricted __P((char *)); +#endif + +extern void unset_bash_input __P((int)); +extern void get_current_user_info __P((void)); + +/* Functions from eval.c. */ +extern int reader_loop __P((void)); +extern int parse_command __P((void)); +extern int read_command __P((void)); + +/* Functions from braces.c. */ +#if defined (BRACE_EXPANSION) +extern char **brace_expand __P((char *)); +#endif + +/* Miscellaneous functions from parse.y */ +extern int yyparse __P((void)); +extern int return_EOF __P((void)); +extern char *xparse_dolparen __P((char *, char *, int *, int)); +extern void reset_parser __P((void)); +extern WORD_LIST *parse_string_to_word_list __P((char *, int, const char *)); + +extern int parser_in_command_position __P((void)); + +extern void free_pushed_string_input __P((void)); + +extern int parser_expanding_alias __P((void)); +extern void parser_save_alias __P((void)); +extern void parser_restore_alias __P((void)); + +extern char *decode_prompt_string __P((char *)); + +extern int get_current_prompt_level __P((void)); +extern void set_current_prompt_level __P((int)); + +#if defined (HISTORY) +extern char *history_delimiting_chars __P((const char *)); +#endif + +/* Declarations for functions defined in locale.c */ +extern void set_default_locale __P((void)); +extern void set_default_locale_vars __P((void)); +extern int set_locale_var __P((char *, char *)); +extern int set_lang __P((char *, char *)); +extern void set_default_lang __P((void)); +extern char *get_locale_var __P((char *)); +extern char *localetrans __P((char *, int, int *)); +extern char *mk_msgstr __P((char *, int *)); +extern char *localeexpand __P((char *, int, int, int, int *)); + +/* Declarations for functions defined in list.c. */ +extern void list_walk __P((GENERIC_LIST *, sh_glist_func_t *)); +extern void wlist_walk __P((WORD_LIST *, sh_icpfunc_t *)); +extern GENERIC_LIST *list_reverse (); +extern int list_length (); +extern GENERIC_LIST *list_append (); +extern GENERIC_LIST *list_remove (); + +/* Declarations for functions defined in stringlib.c */ +extern int find_string_in_alist __P((char *, STRING_INT_ALIST *, int)); +extern char *find_token_in_alist __P((int, STRING_INT_ALIST *, int)); +extern int find_index_in_alist __P((char *, STRING_INT_ALIST *, int)); + +extern char *substring __P((const char *, int, int)); +extern char *strsub __P((char *, char *, char *, int)); +extern char *strcreplace __P((char *, int, char *, int)); +extern void strip_leading __P((char *)); +extern void strip_trailing __P((char *, int, int)); +extern void xbcopy __P((char *, char *, int)); + +/* Functions from version.c. */ +extern char *shell_version_string __P((void)); +extern void show_shell_version __P((int)); + +/* Functions from the bash library, lib/sh/libsh.a. These should really + go into a separate include file. */ + +/* declarations for functions defined in lib/sh/casemod.c */ +extern char *sh_modcase __P((const char *, char *, int)); + +/* Defines for flags argument to sh_modcase. These need to agree with what's + in lib/sh/casemode.c */ +#define CASE_LOWER 0x0001 +#define CASE_UPPER 0x0002 +#define CASE_CAPITALIZE 0x0004 +#define CASE_UNCAP 0x0008 +#define CASE_TOGGLE 0x0010 +#define CASE_TOGGLEALL 0x0020 +#define CASE_UPFIRST 0x0040 +#define CASE_LOWFIRST 0x0080 + +#define CASE_USEWORDS 0x1000 + +/* declarations for functions defined in lib/sh/clktck.c */ +extern long get_clk_tck __P((void)); + +/* declarations for functions defined in lib/sh/clock.c */ +extern void clock_t_to_secs (); +extern void print_clock_t (); + +/* Declarations for functions defined in lib/sh/dprintf.c */ +#if !defined (HAVE_DPRINTF) +extern void dprintf __P((int, const char *, ...)) __attribute__((__format__ (printf, 2, 3))); +#endif + +/* Declarations for functions defined in lib/sh/fmtulong.c */ +#define FL_PREFIX 0x01 /* add 0x, 0X, or 0 prefix as appropriate */ +#define FL_ADDBASE 0x02 /* add base# prefix to converted value */ +#define FL_HEXUPPER 0x04 /* use uppercase when converting to hex */ +#define FL_UNSIGNED 0x08 /* don't add any sign */ + +extern char *fmtulong __P((unsigned long int, int, char *, size_t, int)); + +/* Declarations for functions defined in lib/sh/fmtulong.c */ +#if defined (HAVE_LONG_LONG) +extern char *fmtullong __P((unsigned long long int, int, char *, size_t, int)); +#endif + +/* Declarations for functions defined in lib/sh/fmtumax.c */ +extern char *fmtumax __P((uintmax_t, int, char *, size_t, int)); + +/* Declarations for functions defined in lib/sh/fnxform.c */ +extern char *fnx_fromfs __P((char *, size_t)); +extern char *fnx_tofs __P((char *, size_t)); + +/* Declarations for functions defined in lib/sh/fpurge.c */ + +#if defined NEED_FPURGE_DECL +#if !HAVE_DECL_FPURGE + +#if HAVE_FPURGE +# define fpurge _bash_fpurge +#endif +extern int fpurge __P((FILE *stream)); + +#endif /* HAVE_DECL_FPURGE */ +#endif /* NEED_FPURGE_DECL */ + +/* Declarations for functions defined in lib/sh/getcwd.c */ +#if !defined (HAVE_GETCWD) +extern char *getcwd __P((char *, size_t)); +#endif + +/* Declarations for functions defined in lib/sh/input_avail.c */ +extern int input_avail __P((int)); + +/* Declarations for functions defined in lib/sh/itos.c */ +extern char *inttostr __P((intmax_t, char *, size_t)); +extern char *itos __P((intmax_t)); +extern char *mitos __P((intmax_t)); +extern char *uinttostr __P((uintmax_t, char *, size_t)); +extern char *uitos __P((uintmax_t)); + +/* declarations for functions defined in lib/sh/makepath.c */ +#define MP_DOTILDE 0x01 +#define MP_DOCWD 0x02 +#define MP_RMDOT 0x04 +#define MP_IGNDOT 0x08 + +extern char *sh_makepath __P((const char *, const char *, int)); + +/* declarations for functions defined in lib/sh/mbscasecmp.c */ +#if !defined (HAVE_MBSCASECMP) +extern char *mbscasecmp __P((const char *, const char *)); +#endif + +/* declarations for functions defined in lib/sh/mbschr.c */ +#if !defined (HAVE_MBSCHR) +extern char *mbschr __P((const char *, int)); +#endif + +/* declarations for functions defined in lib/sh/mbscmp.c */ +#if !defined (HAVE_MBSCMP) +extern char *mbscmp __P((const char *, const char *)); +#endif + +/* declarations for functions defined in lib/sh/netconn.c */ +extern int isnetconn __P((int)); + +/* declarations for functions defined in lib/sh/netopen.c */ +extern int netopen __P((char *)); + +/* Declarations for functions defined in lib/sh/oslib.c */ + +#if !defined (HAVE_DUP2) || defined (DUP2_BROKEN) +extern int dup2 __P((int, int)); +#endif + +#if !defined (HAVE_GETDTABLESIZE) +extern int getdtablesize __P((void)); +#endif /* !HAVE_GETDTABLESIZE */ + +#if !defined (HAVE_GETHOSTNAME) +extern int gethostname __P((char *, int)); +#endif /* !HAVE_GETHOSTNAME */ + +extern int getmaxgroups __P((void)); +extern long getmaxchild __P((void)); + +/* declarations for functions defined in lib/sh/pathcanon.c */ +#define PATH_CHECKDOTDOT 0x0001 +#define PATH_CHECKEXISTS 0x0002 +#define PATH_HARDPATH 0x0004 +#define PATH_NOALLOC 0x0008 + +extern char *sh_canonpath __P((char *, int)); + +/* declarations for functions defined in lib/sh/pathphys.c */ +extern char *sh_physpath __P((char *, int)); +extern char *sh_realpath __P((const char *, char *)); + +/* declarations for functions defined in lib/sh/setlinebuf.c */ +#ifdef NEED_SH_SETLINEBUF_DECL +extern int sh_setlinebuf __P((FILE *)); +#endif + +/* declarations for functions defined in lib/sh/shaccess.c */ +extern int sh_eaccess __P((char *, int)); + +/* declarations for functions defined in lib/sh/shmatch.c */ +extern int sh_regmatch __P((const char *, const char *, int)); + +/* defines for flags argument to sh_regmatch. */ +#define SHMAT_SUBEXP 0x001 /* save subexpressions in SH_REMATCH */ +#define SHMAT_PWARN 0x002 /* print a warning message on invalid regexp */ + +/* declarations for functions defined in lib/sh/shmbchar.c */ +extern size_t mbstrlen __P((const char *)); +extern char *mbsmbchar __P((const char *)); +extern int sh_mbsnlen __P((const char *, size_t, int)); + +/* declarations for functions defined in lib/sh/shquote.c */ +extern char *sh_single_quote __P((const char *)); +extern char *sh_double_quote __P((const char *)); +extern char *sh_mkdoublequoted __P((const char *, int, int)); +extern char *sh_un_double_quote __P((char *)); +extern char *sh_backslash_quote __P((char *, const char *, int)); +extern char *sh_backslash_quote_for_double_quotes __P((char *)); +extern int sh_contains_shell_metas __P((char *)); +extern int sh_contains_quotes __P((char *)); + +/* declarations for functions defined in lib/sh/spell.c */ +extern int spname __P((char *, char *)); +extern char *dirspell __P((char *)); + +/* declarations for functions defined in lib/sh/strcasecmp.c */ +#if !defined (HAVE_STRCASECMP) +extern int strncasecmp __P((const char *, const char *, int)); +extern int strcasecmp __P((const char *, const char *)); +#endif /* HAVE_STRCASECMP */ + +/* declarations for functions defined in lib/sh/strcasestr.c */ +#if ! HAVE_STRCASESTR +extern char *strcasestr __P((const char *, const char *)); +#endif + +/* declarations for functions defined in lib/sh/strchrnul.c */ +#if ! HAVE_STRCHRNUL +extern char *strchrnul __P((const char *, int)); +#endif + +/* declarations for functions defined in lib/sh/strerror.c */ +#if !defined (HAVE_STRERROR) && !defined (strerror) +extern char *strerror __P((int)); +#endif + +/* declarations for functions defined in lib/sh/strftime.c */ +#if !defined (HAVE_STRFTIME) && defined (NEED_STRFTIME_DECL) +extern size_t strftime __P((char *, size_t, const char *, const struct tm *)); +#endif + +/* declarations for functions and structures defined in lib/sh/stringlist.c */ + +/* This is a general-purpose argv-style array struct. */ +typedef struct _list_of_strings { + char **list; + int list_size; + int list_len; +} STRINGLIST; + +typedef int sh_strlist_map_func_t __P((char *)); + +extern STRINGLIST *strlist_create __P((int)); +extern STRINGLIST *strlist_resize __P((STRINGLIST *, int)); +extern void strlist_flush __P((STRINGLIST *)); +extern void strlist_dispose __P((STRINGLIST *)); +extern int strlist_remove __P((STRINGLIST *, char *)); +extern STRINGLIST *strlist_copy __P((STRINGLIST *)); +extern STRINGLIST *strlist_merge __P((STRINGLIST *, STRINGLIST *)); +extern STRINGLIST *strlist_append __P((STRINGLIST *, STRINGLIST *)); +extern STRINGLIST *strlist_prefix_suffix __P((STRINGLIST *, char *, char *)); +extern void strlist_print __P((STRINGLIST *, char *)); +extern void strlist_walk __P((STRINGLIST *, sh_strlist_map_func_t *)); +extern void strlist_sort __P((STRINGLIST *)); + +/* declarations for functions defined in lib/sh/stringvec.c */ + +extern char **strvec_create __P((int)); +extern char **strvec_resize __P((char **, int)); +extern char **strvec_mcreate __P((int)); +extern char **strvec_mresize __P((char **, int)); +extern void strvec_flush __P((char **)); +extern void strvec_dispose __P((char **)); +extern int strvec_remove __P((char **, char *)); +extern int strvec_len __P((char **)); +extern int strvec_search __P((char **, char *)); +extern char **strvec_copy __P((char **)); +extern int strvec_strcmp __P((char **, char **)); +extern void strvec_sort __P((char **)); + +extern char **strvec_from_word_list __P((WORD_LIST *, int, int, int *)); +extern WORD_LIST *strvec_to_word_list __P((char **, int, int)); + +/* declarations for functions defined in lib/sh/strnlen.c */ +#if !defined (HAVE_STRNLEN) +extern size_t strnlen __P((const char *, size_t)); +#endif + +/* declarations for functions defined in lib/sh/strpbrk.c */ +#if !defined (HAVE_STRPBRK) +extern char *strpbrk __P((const char *, const char *)); +#endif + +/* declarations for functions defined in lib/sh/strtod.c */ +#if !defined (HAVE_STRTOD) +extern double strtod __P((const char *, char **)); +#endif + +/* declarations for functions defined in lib/sh/strtol.c */ +#if !HAVE_DECL_STRTOL +extern long strtol __P((const char *, char **, int)); +#endif + +/* declarations for functions defined in lib/sh/strtoll.c */ +#if defined (HAVE_LONG_LONG) && !HAVE_DECL_STRTOLL +extern long long strtoll __P((const char *, char **, int)); +#endif + +/* declarations for functions defined in lib/sh/strtoul.c */ +#if !HAVE_DECL_STRTOUL +extern unsigned long strtoul __P((const char *, char **, int)); +#endif + +/* declarations for functions defined in lib/sh/strtoull.c */ +#if defined (HAVE_LONG_LONG) && !HAVE_DECL_STRTOULL +extern unsigned long long strtoull __P((const char *, char **, int)); +#endif + +/* declarations for functions defined in lib/sh/strimax.c */ +#if !HAVE_DECL_STRTOIMAX +extern intmax_t strtoimax __P((const char *, char **, int)); +#endif + +/* declarations for functions defined in lib/sh/strumax.c */ +#if !HAVE_DECL_STRTOUMAX +extern uintmax_t strtoumax __P((const char *, char **, int)); +#endif + +/* declarations for functions defined in lib/sh/strtrans.c */ +extern char *ansicstr __P((char *, int, int, int *, int *)); +extern char *ansic_quote __P((char *, int, int *)); +extern int ansic_shouldquote __P((const char *)); +extern char *ansiexpand __P((char *, int, int, int *)); + +/* declarations for functions defined in lib/sh/timeval.c. No prototypes + so we don't have to count on having a definition of struct timeval in + scope when this file is included. */ +extern void timeval_to_secs (); +extern void print_timeval (); + +/* declarations for functions defined in lib/sh/tmpfile.c */ +#define MT_USETMPDIR 0x0001 +#define MT_READWRITE 0x0002 +#define MT_USERANDOM 0x0004 + +extern char *sh_mktmpname __P((char *, int)); +extern int sh_mktmpfd __P((char *, int, char **)); +/* extern FILE *sh_mktmpfp __P((char *, int, char **)); */ + +/* declarations for functions defined in lib/sh/uconvert.c */ +extern int uconvert __P((char *, long *, long *)); + +/* declarations for functions defined in lib/sh/ufuncs.c */ +extern unsigned int falarm __P((unsigned int, unsigned int)); +extern unsigned int fsleep __P((unsigned int, unsigned int)); + +/* declarations for functions defined in lib/sh/unicode.c */ +extern int u32cconv __P((unsigned long, char *)); +extern void u32reset __P((void)); + +/* declarations for functions defined in lib/sh/wcsnwidth.c */ +#if defined (HANDLE_MULTIBYTE) +extern int wcsnwidth __P((const wchar_t *, size_t, int)); +#endif + +/* declarations for functions defined in lib/sh/winsize.c */ +extern void get_new_window_size __P((int, int *, int *)); + +/* declarations for functions defined in lib/sh/zcatfd.c */ +extern int zcatfd __P((int, int, char *)); + +/* declarations for functions defined in lib/sh/zgetline.c */ +extern ssize_t zgetline __P((int, char **, size_t *, int)); + +/* declarations for functions defined in lib/sh/zmapfd.c */ +extern int zmapfd __P((int, char **, char *)); + +/* declarations for functions defined in lib/sh/zread.c */ +extern ssize_t zread __P((int, char *, size_t)); +extern ssize_t zreadretry __P((int, char *, size_t)); +extern ssize_t zreadintr __P((int, char *, size_t)); +extern ssize_t zreadc __P((int, char *)); +extern ssize_t zreadcintr __P((int, char *)); +extern ssize_t zreadn __P((int, char *, size_t)); +extern void zreset __P((void)); +extern void zsyncfd __P((int)); + +/* declarations for functions defined in lib/sh/zwrite.c */ +extern int zwrite __P((int, char *, size_t)); + +/* declarations for functions defined in lib/glob/gmisc.c */ +extern int match_pattern_char __P((char *, char *)); +extern int umatchlen __P((char *, size_t)); + +#if defined (HANDLE_MULTIBYTE) +extern int match_pattern_wchar __P((wchar_t *, wchar_t *)); +extern int wmatchlen __P((wchar_t *, size_t)); +#endif + +#endif /* _EXTERNS_H_ */ diff --git a/findcmd.c b/findcmd.c new file mode 100644 index 0000000..9f3d954 --- /dev/null +++ b/findcmd.c @@ -0,0 +1,623 @@ +/* findcmd.c -- Functions to search for commands by name. */ + +/* Copyright (C) 1997-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include +#include "chartypes.h" +#include "bashtypes.h" +#if !defined (_MINIX) && defined (HAVE_SYS_FILE_H) +# include +#endif +#include "filecntl.h" +#include "posixstat.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif +#include + +#include "bashansi.h" + +#include "memalloc.h" +#include "shell.h" +#include "flags.h" +#include "hashlib.h" +#include "pathexp.h" +#include "hashcmd.h" +#include "findcmd.h" /* matching prototypes and declarations */ + +#if !defined (errno) +extern int errno; +#endif + +extern int posixly_correct; +extern int last_command_exit_value; + +/* Static functions defined and used in this file. */ +static char *_find_user_command_internal __P((const char *, int)); +static char *find_user_command_internal __P((const char *, int)); +static char *find_user_command_in_path __P((const char *, char *, int)); +static char *find_in_path_element __P((const char *, char *, int, int, struct stat *)); +static char *find_absolute_program __P((const char *, int)); + +static char *get_next_path_element __P((char *, int *)); + +/* The file name which we would try to execute, except that it isn't + possible to execute it. This is the first file that matches the + name that we are looking for while we are searching $PATH for a + suitable one to execute. If we cannot find a suitable executable + file, then we use this one. */ +static char *file_to_lose_on; + +/* Non-zero if we should stat every command found in the hash table to + make sure it still exists. */ +int check_hashed_filenames; + +/* DOT_FOUND_IN_SEARCH becomes non-zero when find_user_command () + encounters a `.' as the directory pathname while scanning the + list of possible pathnames; i.e., if `.' comes before the directory + containing the file of interest. */ +int dot_found_in_search = 0; + +/* Return some flags based on information about this file. + The EXISTS bit is non-zero if the file is found. + The EXECABLE bit is non-zero the file is executble. + Zero is returned if the file is not found. */ +int +file_status (name) + const char *name; +{ + struct stat finfo; + int r; + + /* Determine whether this file exists or not. */ + if (stat (name, &finfo) < 0) + return (0); + + /* If the file is a directory, then it is not "executable" in the + sense of the shell. */ + if (S_ISDIR (finfo.st_mode)) + return (FS_EXISTS|FS_DIRECTORY); + + r = FS_EXISTS; + +#if defined (HAVE_EACCESS) + /* Use eaccess(2) if we have it to take things like ACLs and other + file access mechanisms into account. eaccess uses the effective + user and group IDs, not the real ones. We could use sh_eaccess, + but we don't want any special treatment for /dev/fd. */ + if (eaccess (name, X_OK) == 0) + r |= FS_EXECABLE; + if (eaccess (name, R_OK) == 0) + r |= FS_READABLE; + + return r; +#elif defined (AFS) + /* We have to use access(2) to determine access because AFS does not + support Unix file system semantics. This may produce wrong + answers for non-AFS files when ruid != euid. I hate AFS. */ + if (access (name, X_OK) == 0) + r |= FS_EXECABLE; + if (access (name, R_OK) == 0) + r |= FS_READABLE; + + return r; +#else /* !HAVE_EACCESS && !AFS */ + + /* Find out if the file is actually executable. By definition, the + only other criteria is that the file has an execute bit set that + we can use. The same with whether or not a file is readable. */ + + /* Root only requires execute permission for any of owner, group or + others to be able to exec a file, and can read any file. */ + if (current_user.euid == (uid_t)0) + { + r |= FS_READABLE; + if (finfo.st_mode & S_IXUGO) + r |= FS_EXECABLE; + return r; + } + + /* If we are the owner of the file, the owner bits apply. */ + if (current_user.euid == finfo.st_uid) + { + if (finfo.st_mode & S_IXUSR) + r |= FS_EXECABLE; + if (finfo.st_mode & S_IRUSR) + r |= FS_READABLE; + } + + /* If we are in the owning group, the group permissions apply. */ + else if (group_member (finfo.st_gid)) + { + if (finfo.st_mode & S_IXGRP) + r |= FS_EXECABLE; + if (finfo.st_mode & S_IRGRP) + r |= FS_READABLE; + } + + /* Else we check whether `others' have permission to execute the file */ + else + { + if (finfo.st_mode & S_IXOTH) + r |= FS_EXECABLE; + if (finfo.st_mode & S_IROTH) + r |= FS_READABLE; + } + + return r; +#endif /* !AFS */ +} + +/* Return non-zero if FILE exists and is executable. + Note that this function is the definition of what an + executable file is; do not change this unless YOU know + what an executable file is. */ +int +executable_file (file) + const char *file; +{ + int s; + + s = file_status (file); +#if defined EISDIR + if (s & FS_DIRECTORY) + errno = EISDIR; /* let's see if we can improve error messages */ +#endif + return ((s & FS_EXECABLE) && ((s & FS_DIRECTORY) == 0)); +} + +int +is_directory (file) + const char *file; +{ + return (file_status (file) & FS_DIRECTORY); +} + +int +executable_or_directory (file) + const char *file; +{ + int s; + + s = file_status (file); + return ((s & FS_EXECABLE) || (s & FS_DIRECTORY)); +} + +/* Locate the executable file referenced by NAME, searching along + the contents of the shell PATH variable. Return a new string + which is the full pathname to the file, or NULL if the file + couldn't be found. If a file is found that isn't executable, + and that is the only match, then return that. */ +char * +find_user_command (name) + const char *name; +{ + return (find_user_command_internal (name, FS_EXEC_PREFERRED|FS_NODIRS)); +} + +/* Locate the file referenced by NAME, searching along the contents + of the shell PATH variable. Return a new string which is the full + pathname to the file, or NULL if the file couldn't be found. This + returns the first readable file found; designed to be used to look + for shell scripts or files to source. */ +char * +find_path_file (name) + const char *name; +{ + return (find_user_command_internal (name, FS_READABLE)); +} + +static char * +_find_user_command_internal (name, flags) + const char *name; + int flags; +{ + char *path_list, *cmd; + SHELL_VAR *var; + + /* Search for the value of PATH in both the temporary environments and + in the regular list of variables. */ + if (var = find_variable_tempenv ("PATH")) /* XXX could be array? */ + path_list = value_cell (var); + else + path_list = (char *)NULL; + + if (path_list == 0 || *path_list == '\0') + return (savestring (name)); + + cmd = find_user_command_in_path (name, path_list, flags); + + return (cmd); +} + +static char * +find_user_command_internal (name, flags) + const char *name; + int flags; +{ +#ifdef __WIN32__ + char *res, *dotexe; + + dotexe = (char *)xmalloc (strlen (name) + 5); + strcpy (dotexe, name); + strcat (dotexe, ".exe"); + res = _find_user_command_internal (dotexe, flags); + free (dotexe); + if (res == 0) + res = _find_user_command_internal (name, flags); + return res; +#else + return (_find_user_command_internal (name, flags)); +#endif +} + +/* Return the next element from PATH_LIST, a colon separated list of + paths. PATH_INDEX_POINTER is the address of an index into PATH_LIST; + the index is modified by this function. + Return the next element of PATH_LIST or NULL if there are no more. */ +static char * +get_next_path_element (path_list, path_index_pointer) + char *path_list; + int *path_index_pointer; +{ + char *path; + + path = extract_colon_unit (path_list, path_index_pointer); + + if (path == 0) + return (path); + + if (*path == '\0') + { + free (path); + path = savestring ("."); + } + + return (path); +} + +/* Look for PATHNAME in $PATH. Returns either the hashed command + corresponding to PATHNAME or the first instance of PATHNAME found + in $PATH. If (FLAGS&1) is non-zero, insert the instance of PATHNAME + found in $PATH into the command hash table. Returns a newly-allocated + string. */ +char * +search_for_command (pathname, flags) + const char *pathname; + int flags; +{ + char *hashed_file, *command; + int temp_path, st; + SHELL_VAR *path; + + hashed_file = command = (char *)NULL; + + /* If PATH is in the temporary environment for this command, don't use the + hash table to search for the full pathname. */ + path = find_variable_tempenv ("PATH"); + temp_path = path && tempvar_p (path); + if (temp_path == 0 && path) + path = (SHELL_VAR *)NULL; + + /* Don't waste time trying to find hashed data for a pathname + that is already completely specified or if we're using a command- + specific value for PATH. */ + if (path == 0 && absolute_program (pathname) == 0) + hashed_file = phash_search (pathname); + + /* If a command found in the hash table no longer exists, we need to + look for it in $PATH. Thank you Posix.2. This forces us to stat + every command found in the hash table. */ + + if (hashed_file && (posixly_correct || check_hashed_filenames)) + { + st = file_status (hashed_file); + if ((st & (FS_EXISTS|FS_EXECABLE)) != (FS_EXISTS|FS_EXECABLE)) + { + phash_remove (pathname); + free (hashed_file); + hashed_file = (char *)NULL; + } + } + + if (hashed_file) + command = hashed_file; + else if (absolute_program (pathname)) + /* A command containing a slash is not looked up in PATH or saved in + the hash table. */ + command = savestring (pathname); + else + { + /* If $PATH is in the temporary environment, we've already retrieved + it, so don't bother trying again. */ + if (temp_path) + { + command = find_user_command_in_path (pathname, value_cell (path), + FS_EXEC_PREFERRED|FS_NODIRS); + } + else + command = find_user_command (pathname); + if (command && hashing_enabled && temp_path == 0 && (flags & 1)) + phash_insert ((char *)pathname, command, dot_found_in_search, 1); /* XXX fix const later */ + } + return (command); +} + +char * +user_command_matches (name, flags, state) + const char *name; + int flags, state; +{ + register int i; + int path_index, name_len; + char *path_list, *path_element, *match; + struct stat dotinfo; + static char **match_list = NULL; + static int match_list_size = 0; + static int match_index = 0; + + if (state == 0) + { + /* Create the list of matches. */ + if (match_list == 0) + { + match_list_size = 5; + match_list = strvec_create (match_list_size); + } + + /* Clear out the old match list. */ + for (i = 0; i < match_list_size; i++) + match_list[i] = 0; + + /* We haven't found any files yet. */ + match_index = 0; + + if (absolute_program (name)) + { + match_list[0] = find_absolute_program (name, flags); + match_list[1] = (char *)NULL; + path_list = (char *)NULL; + } + else + { + name_len = strlen (name); + file_to_lose_on = (char *)NULL; + dot_found_in_search = 0; + if (stat (".", &dotinfo) < 0) + dotinfo.st_dev = dotinfo.st_ino = 0; /* so same_file won't match */ + path_list = get_string_value ("PATH"); + path_index = 0; + } + + while (path_list && path_list[path_index]) + { + path_element = get_next_path_element (path_list, &path_index); + + if (path_element == 0) + break; + + match = find_in_path_element (name, path_element, flags, name_len, &dotinfo); + + free (path_element); + + if (match == 0) + continue; + + if (match_index + 1 == match_list_size) + { + match_list_size += 10; + match_list = strvec_resize (match_list, (match_list_size + 1)); + } + + match_list[match_index++] = match; + match_list[match_index] = (char *)NULL; + FREE (file_to_lose_on); + file_to_lose_on = (char *)NULL; + } + + /* We haven't returned any strings yet. */ + match_index = 0; + } + + match = match_list[match_index]; + + if (match) + match_index++; + + return (match); +} + +static char * +find_absolute_program (name, flags) + const char *name; + int flags; +{ + int st; + + st = file_status (name); + + /* If the file doesn't exist, quit now. */ + if ((st & FS_EXISTS) == 0) + return ((char *)NULL); + + /* If we only care about whether the file exists or not, return + this filename. Otherwise, maybe we care about whether this + file is executable. If it is, and that is what we want, return it. */ + if ((flags & FS_EXISTS) || ((flags & FS_EXEC_ONLY) && (st & FS_EXECABLE))) + return (savestring (name)); + + return (NULL); +} + +static char * +find_in_path_element (name, path, flags, name_len, dotinfop) + const char *name; + char *path; + int flags, name_len; + struct stat *dotinfop; +{ + int status; + char *full_path, *xpath; + + xpath = (*path == '~') ? bash_tilde_expand (path, 0) : path; + + /* Remember the location of "." in the path, in all its forms + (as long as they begin with a `.', e.g. `./.') */ + if (dot_found_in_search == 0 && *xpath == '.') + dot_found_in_search = same_file (".", xpath, dotinfop, (struct stat *)NULL); + + full_path = sh_makepath (xpath, name, 0); + + status = file_status (full_path); + + if (xpath != path) + free (xpath); + + if ((status & FS_EXISTS) == 0) + { + free (full_path); + return ((char *)NULL); + } + + /* The file exists. If the caller simply wants the first file, here it is. */ + if (flags & FS_EXISTS) + return (full_path); + + /* If we have a readable file, and the caller wants a readable file, this + is it. */ + if ((flags & FS_READABLE) && (status & FS_READABLE)) + return (full_path); + + /* If the file is executable, then it satisfies the cases of + EXEC_ONLY and EXEC_PREFERRED. Return this file unconditionally. */ + if ((status & FS_EXECABLE) && (flags & (FS_EXEC_ONLY|FS_EXEC_PREFERRED)) && + (((flags & FS_NODIRS) == 0) || ((status & FS_DIRECTORY) == 0))) + { + FREE (file_to_lose_on); + file_to_lose_on = (char *)NULL; + return (full_path); + } + + /* The file is not executable, but it does exist. If we prefer + an executable, then remember this one if it is the first one + we have found. */ + if ((flags & FS_EXEC_PREFERRED) && file_to_lose_on == 0) + file_to_lose_on = savestring (full_path); + + /* If we want only executable files, or we don't want directories and + this file is a directory, or we want a readable file and this file + isn't readable, fail. */ + if ((flags & (FS_EXEC_ONLY|FS_EXEC_PREFERRED)) || + ((flags & FS_NODIRS) && (status & FS_DIRECTORY)) || + ((flags & FS_READABLE) && (status & FS_READABLE) == 0)) + { + free (full_path); + return ((char *)NULL); + } + else + return (full_path); +} + +/* This does the dirty work for find_user_command_internal () and + user_command_matches (). + NAME is the name of the file to search for. + PATH_LIST is a colon separated list of directories to search. + FLAGS contains bit fields which control the files which are eligible. + Some values are: + FS_EXEC_ONLY: The file must be an executable to be found. + FS_EXEC_PREFERRED: If we can't find an executable, then the + the first file matching NAME will do. + FS_EXISTS: The first file found will do. + FS_NODIRS: Don't find any directories. +*/ +static char * +find_user_command_in_path (name, path_list, flags) + const char *name; + char *path_list; + int flags; +{ + char *full_path, *path; + int path_index, name_len; + struct stat dotinfo; + + /* We haven't started looking, so we certainly haven't seen + a `.' as the directory path yet. */ + dot_found_in_search = 0; + + if (absolute_program (name)) + { + full_path = find_absolute_program (name, flags); + return (full_path); + } + + if (path_list == 0 || *path_list == '\0') + return (savestring (name)); /* XXX */ + + file_to_lose_on = (char *)NULL; + name_len = strlen (name); + if (stat (".", &dotinfo) < 0) + dotinfo.st_dev = dotinfo.st_ino = 0; + path_index = 0; + + while (path_list[path_index]) + { + /* Allow the user to interrupt out of a lengthy path search. */ + QUIT; + + path = get_next_path_element (path_list, &path_index); + if (path == 0) + break; + + /* Side effects: sets dot_found_in_search, possibly sets + file_to_lose_on. */ + full_path = find_in_path_element (name, path, flags, name_len, &dotinfo); + free (path); + + /* This should really be in find_in_path_element, but there isn't the + right combination of flags. */ + if (full_path && is_directory (full_path)) + { + free (full_path); + continue; + } + + if (full_path) + { + FREE (file_to_lose_on); + return (full_path); + } + } + + /* We didn't find exactly what the user was looking for. Return + the contents of FILE_TO_LOSE_ON which is NULL when the search + required an executable, or non-NULL if a file was found and the + search would accept a non-executable as a last resort. If the + caller specified FS_NODIRS, and file_to_lose_on is a directory, + return NULL. */ + if (file_to_lose_on && (flags & FS_NODIRS) && is_directory (file_to_lose_on)) + { + free (file_to_lose_on); + file_to_lose_on = (char *)NULL; + } + + return (file_to_lose_on); +} diff --git a/findcmd.h b/findcmd.h new file mode 100644 index 0000000..52ad1d0 --- /dev/null +++ b/findcmd.h @@ -0,0 +1,35 @@ +/* findcmd.h - functions from findcmd.c. */ + +/* Copyright (C) 1997-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_FINDCMD_H_) +#define _FINDCMD_H_ + +#include "stdc.h" + +extern int file_status __P((const char *)); +extern int executable_file __P((const char *)); +extern int is_directory __P((const char *)); +extern int executable_or_directory __P((const char *)); +extern char *find_user_command __P((const char *)); +extern char *find_path_file __P((const char *)); +extern char *search_for_command __P((const char *, int)); +extern char *user_command_matches __P((const char *, int, int)); + +#endif /* _FINDCMD_H_ */ diff --git a/flags.c b/flags.c new file mode 100644 index 0000000..eaec9aa --- /dev/null +++ b/flags.c @@ -0,0 +1,365 @@ +/* flags.c -- Everything about flags except the `set' command. That + is in builtins.c */ + +/* Copyright (C) 1987-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "shell.h" +#include "flags.h" + +#if defined (BANG_HISTORY) +# include "bashhist.h" +#endif + +#if defined (JOB_CONTROL) +extern int set_job_control __P((int)); +#endif + +#if defined (RESTRICTED_SHELL) +extern char *shell_name; +#endif + +extern int shell_initialized; +extern int builtin_ignoring_errexit; + +/* -c, -s invocation options -- not really flags, but they show up in $- */ +extern int want_pending_command, read_from_stdin; + +/* **************************************************************** */ +/* */ +/* The Standard sh Flags. */ +/* */ +/* **************************************************************** */ + +/* Non-zero means automatically mark variables which are modified or created + as auto export variables. */ +int mark_modified_vars = 0; + +/* Non-zero causes asynchronous job notification. Otherwise, job state + notification only takes place just before a primary prompt is printed. */ +int asynchronous_notification = 0; + +/* Non-zero means exit immediately if a command exits with a non-zero + exit status. The first is what controls set -e; the second is what + bash uses internally. */ +int errexit_flag = 0; +int exit_immediately_on_error = 0; + +/* Non-zero means disable filename globbing. */ +int disallow_filename_globbing = 0; + +/* Non-zero means that all keyword arguments are placed into the environment + for a command, not just those that appear on the line before the command + name. */ +int place_keywords_in_env = 0; + +/* Non-zero means read commands, but don't execute them. This is useful + for debugging shell scripts that should do something hairy and possibly + destructive. */ +int read_but_dont_execute = 0; + +/* Non-zero means end of file is after one command. */ +int just_one_command = 0; + +/* Non-zero means don't overwrite existing files while doing redirections. */ +int noclobber = 0; + +/* Non-zero means trying to get the value of $i where $i is undefined + causes an error, instead of a null substitution. */ +int unbound_vars_is_error = 0; + +/* Non-zero means type out input lines after you read them. */ +int echo_input_at_read = 0; + +/* Non-zero means type out the command definition after reading, but + before executing. */ +int echo_command_at_execute = 0; + +/* Non-zero means turn on the job control features. */ +int jobs_m_flag = 0; + +/* Non-zero means this shell is interactive, even if running under a + pipe. */ +int forced_interactive = 0; + +/* By default, follow the symbolic links as if they were real directories + while hacking the `cd' command. This means that `cd ..' moves up in + the string of symbolic links that make up the current directory, instead + of the absolute directory. The shell variable `nolinks' also controls + this flag. */ +int no_symbolic_links = 0; + +/* **************************************************************** */ +/* */ +/* Non-Standard Flags Follow Here. */ +/* */ +/* **************************************************************** */ + +#if 0 +/* Non-zero means do lexical scoping in the body of a FOR command. */ +int lexical_scoping = 0; +#endif + +/* Non-zero means no such thing as invisible variables. */ +int no_invisible_vars = 0; + +/* Non-zero means look up and remember command names in a hash table, */ +int hashing_enabled = 1; + +#if defined (BANG_HISTORY) +/* Non-zero means that we are doing history expansion. The default. + This means !22 gets the 22nd line of history. */ +# if defined (STRICT_POSIX) +int history_expansion = 0; +# else +int history_expansion = 1; +# endif +#endif /* BANG_HISTORY */ + +/* Non-zero means that we allow comments to appear in interactive commands. */ +int interactive_comments = 1; + +#if defined (RESTRICTED_SHELL) +/* Non-zero means that this shell is `restricted'. A restricted shell + disallows: changing directories, command or path names containing `/', + unsetting or resetting the values of $PATH and $SHELL, and any type of + output redirection. */ +int restricted = 0; /* currently restricted */ +int restricted_shell = 0; /* shell was started in restricted mode. */ +#endif /* RESTRICTED_SHELL */ + +/* Non-zero means that this shell is running in `privileged' mode. This + is required if the shell is to run setuid. If the `-p' option is + not supplied at startup, and the real and effective uids or gids + differ, disable_priv_mode is called to relinquish setuid status. */ +int privileged_mode = 0; + +#if defined (BRACE_EXPANSION) +/* Zero means to disable brace expansion: foo{a,b} -> fooa foob */ +int brace_expansion = 1; +#endif + +/* Non-zero means that shell functions inherit the DEBUG trap. */ +int function_trace_mode = 0; + +/* Non-zero means that shell functions inherit the ERR trap. */ +int error_trace_mode = 0; + +/* Non-zero means that the rightmost non-zero exit status in a pipeline + is the exit status of the entire pipeline. If each processes exits + with a 0 status, the status of the pipeline is 0. */ +int pipefail_opt = 0; + +/* **************************************************************** */ +/* */ +/* The Flags ALIST. */ +/* */ +/* **************************************************************** */ + +const struct flags_alist shell_flags[] = { + /* Standard sh flags. */ + { 'a', &mark_modified_vars }, +#if defined (JOB_CONTROL) + { 'b', &asynchronous_notification }, +#endif /* JOB_CONTROL */ + { 'e', &errexit_flag }, + { 'f', &disallow_filename_globbing }, + { 'h', &hashing_enabled }, + { 'i', &forced_interactive }, + { 'k', &place_keywords_in_env }, +#if defined (JOB_CONTROL) + { 'm', &jobs_m_flag }, +#endif /* JOB_CONTROL */ + { 'n', &read_but_dont_execute }, + { 'p', &privileged_mode }, +#if defined (RESTRICTED_SHELL) + { 'r', &restricted }, +#endif /* RESTRICTED_SHELL */ + { 't', &just_one_command }, + { 'u', &unbound_vars_is_error }, + { 'v', &echo_input_at_read }, + { 'x', &echo_command_at_execute }, + + /* New flags that control non-standard things. */ +#if 0 + { 'l', &lexical_scoping }, +#endif +#if defined (BRACE_EXPANSION) + { 'B', &brace_expansion }, +#endif + { 'C', &noclobber }, + { 'E', &error_trace_mode }, +#if defined (BANG_HISTORY) + { 'H', &history_expansion }, +#endif /* BANG_HISTORY */ + { 'I', &no_invisible_vars }, + { 'P', &no_symbolic_links }, + { 'T', &function_trace_mode }, + {0, (int *)NULL} +}; + +#define NUM_SHELL_FLAGS (sizeof (shell_flags) / sizeof (struct flags_alist)) + +char optflags[NUM_SHELL_FLAGS+4] = { '+' }; + +int * +find_flag (name) + int name; +{ + int i; + for (i = 0; shell_flags[i].name; i++) + { + if (shell_flags[i].name == name) + return (shell_flags[i].value); + } + return (FLAG_UNKNOWN); +} + +/* Change the state of a flag, and return it's original value, or return + FLAG_ERROR if there is no flag FLAG. ON_OR_OFF must be either + FLAG_ON or FLAG_OFF. */ +int +change_flag (flag, on_or_off) + int flag; + int on_or_off; +{ + int *value, old_value; + +#if defined (RESTRICTED_SHELL) + /* Don't allow "set +r" in a shell which is `restricted'. */ + if (restricted && flag == 'r' && on_or_off == FLAG_OFF) + return (FLAG_ERROR); +#endif /* RESTRICTED_SHELL */ + + value = find_flag (flag); + + if ((value == (int *)FLAG_UNKNOWN) || (on_or_off != FLAG_ON && on_or_off != FLAG_OFF)) + return (FLAG_ERROR); + + old_value = *value; + *value = (on_or_off == FLAG_ON) ? 1 : 0; + + /* Special cases for a few flags. */ + switch (flag) + { +#if defined (BANG_HISTORY) + case 'H': + if (on_or_off == FLAG_ON) + bash_initialize_history (); + break; +#endif + +#if defined (JOB_CONTROL) + case 'm': + set_job_control (on_or_off == FLAG_ON); + break; +#endif /* JOB_CONTROL */ + + case 'e': + if (builtin_ignoring_errexit == 0) + exit_immediately_on_error = errexit_flag; + break; + + case 'n': + if (interactive_shell) + read_but_dont_execute = 0; + break; + + case 'p': + if (on_or_off == FLAG_OFF) + disable_priv_mode (); + break; + +#if defined (RESTRICTED_SHELL) + case 'r': + if (on_or_off == FLAG_ON && shell_initialized) + maybe_make_restricted (shell_name); + break; +#endif + + } + + return (old_value); +} + +/* Return a string which is the names of all the currently + set shell flags. */ +char * +which_set_flags () +{ + char *temp; + int i, string_index; + + temp = (char *)xmalloc (1 + NUM_SHELL_FLAGS + read_from_stdin + want_pending_command); + for (i = string_index = 0; shell_flags[i].name; i++) + if (*(shell_flags[i].value)) + temp[string_index++] = shell_flags[i].name; + + if (want_pending_command) + temp[string_index++] = 'c'; + if (read_from_stdin) + temp[string_index++] = 's'; + + temp[string_index] = '\0'; + return (temp); +} + +void +reset_shell_flags () +{ + mark_modified_vars = exit_immediately_on_error = disallow_filename_globbing = 0; + place_keywords_in_env = read_but_dont_execute = just_one_command = 0; + noclobber = unbound_vars_is_error = echo_input_at_read = 0; + echo_command_at_execute = jobs_m_flag = forced_interactive = 0; + no_symbolic_links = no_invisible_vars = privileged_mode = pipefail_opt = 0; + + hashing_enabled = interactive_comments = 1; + +#if defined (JOB_CONTROL) + asynchronous_notification = 0; +#endif + +#if defined (BANG_HISTORY) + history_expansion = 1; +#endif + +#if defined (BRACE_EXPANSION) + brace_expansion = 1; +#endif + +#if defined (RESTRICTED_SHELL) + restricted = 0; +#endif +} + +void +initialize_flags () +{ + register int i; + + for (i = 0; shell_flags[i].name; i++) + optflags[i+1] = shell_flags[i].name; + optflags[++i] = 'o'; + optflags[++i] = ';'; + optflags[i+1] = '\0'; +} diff --git a/flags.h b/flags.h new file mode 100644 index 0000000..830edab --- /dev/null +++ b/flags.h @@ -0,0 +1,80 @@ +/* flags.h -- a list of all the flags that the shell knows about. You add + a flag to this program by adding the name here, and in flags.c. */ + +/* Copyright (C) 1993-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_FLAGS_H_) +#define _FLAGS_H_ + +#include "stdc.h" + +/* Welcome to the world of Un*x, where everything is slightly backwards. */ +#define FLAG_ON '-' +#define FLAG_OFF '+' + +#define FLAG_ERROR -1 +#define FLAG_UNKNOWN (int *)0 + +/* The thing that we build the array of flags out of. */ +struct flags_alist { + char name; + int *value; +}; + +extern const struct flags_alist shell_flags[]; +extern char optflags[]; + +extern int + mark_modified_vars, errexit_flag, exit_immediately_on_error, + disallow_filename_globbing, + place_keywords_in_env, read_but_dont_execute, + just_one_command, unbound_vars_is_error, echo_input_at_read, + echo_command_at_execute, no_invisible_vars, noclobber, + hashing_enabled, forced_interactive, privileged_mode, jobs_m_flag, + asynchronous_notification, interactive_comments, no_symbolic_links, + function_trace_mode, error_trace_mode, pipefail_opt; + +#if 0 +extern int lexical_scoping; +#endif + +#if defined (BRACE_EXPANSION) +extern int brace_expansion; +#endif + +#if defined (BANG_HISTORY) +extern int history_expansion; +#endif /* BANG_HISTORY */ + +#if defined (RESTRICTED_SHELL) +extern int restricted; +extern int restricted_shell; +#endif /* RESTRICTED_SHELL */ + +extern int *find_flag __P((int)); +extern int change_flag __P((int, int)); +extern char *which_set_flags __P((void)); +extern void reset_shell_flags __P((void)); + +extern void initialize_flags __P((void)); + +/* A macro for efficiency. */ +#define change_flag_char(flag, on_or_off) change_flag (flag, on_or_off) + +#endif /* _FLAGS_H_ */ diff --git a/general.c b/general.c new file mode 100644 index 0000000..087689e --- /dev/null +++ b/general.c @@ -0,0 +1,1177 @@ +/* general.c -- Stuff that is used by all files. */ + +/* Copyright (C) 1987-2011 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" +#if defined (HAVE_SYS_PARAM_H) +# include +#endif +#include "posixstat.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "filecntl.h" +#include "bashansi.h" +#include +#include "chartypes.h" +#include + +#include "bashintl.h" + +#include "shell.h" +#include "test.h" +#include "trap.h" + +#include + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +extern int expand_aliases; +extern int interactive_comments; +extern int check_hashed_filenames; +extern int source_uses_path; +extern int source_searches_cwd; + +static char *bash_special_tilde_expansions __P((char *)); +static int unquoted_tilde_word __P((const char *)); +static void initialize_group_array __P((void)); + +/* A standard error message to use when getcwd() returns NULL. */ +const char * const bash_getcwd_errstr = N_("getcwd: cannot access parent directories"); + +/* Do whatever is necessary to initialize `Posix mode'. */ +void +posix_initialize (on) + int on; +{ + /* Things that should be turned on when posix mode is enabled. */ + if (on != 0) + { + interactive_comments = source_uses_path = expand_aliases = 1; + source_searches_cwd = 0; + } + + /* Things that should be turned on when posix mode is disabled. */ + if (on == 0) + { + source_searches_cwd = 1; + expand_aliases = interactive_shell; + } +} + +/* **************************************************************** */ +/* */ +/* Functions to convert to and from and display non-standard types */ +/* */ +/* **************************************************************** */ + +#if defined (RLIMTYPE) +RLIMTYPE +string_to_rlimtype (s) + char *s; +{ + RLIMTYPE ret; + int neg; + + ret = 0; + neg = 0; + while (s && *s && whitespace (*s)) + s++; + if (s && (*s == '-' || *s == '+')) + { + neg = *s == '-'; + s++; + } + for ( ; s && *s && DIGIT (*s); s++) + ret = (ret * 10) + TODIGIT (*s); + return (neg ? -ret : ret); +} + +void +print_rlimtype (n, addnl) + RLIMTYPE n; + int addnl; +{ + char s[INT_STRLEN_BOUND (RLIMTYPE) + 1], *p; + + p = s + sizeof(s); + *--p = '\0'; + + if (n < 0) + { + do + *--p = '0' - n % 10; + while ((n /= 10) != 0); + + *--p = '-'; + } + else + { + do + *--p = '0' + n % 10; + while ((n /= 10) != 0); + } + + printf ("%s%s", p, addnl ? "\n" : ""); +} +#endif /* RLIMTYPE */ + +/* **************************************************************** */ +/* */ +/* Input Validation Functions */ +/* */ +/* **************************************************************** */ + +/* Return non-zero if all of the characters in STRING are digits. */ +int +all_digits (string) + char *string; +{ + register char *s; + + for (s = string; *s; s++) + if (DIGIT (*s) == 0) + return (0); + + return (1); +} + +/* Return non-zero if the characters pointed to by STRING constitute a + valid number. Stuff the converted number into RESULT if RESULT is + not null. */ +int +legal_number (string, result) + const char *string; + intmax_t *result; +{ + intmax_t value; + char *ep; + + if (result) + *result = 0; + + if (string == 0) + return 0; + + errno = 0; + value = strtoimax (string, &ep, 10); + if (errno || ep == string) + return 0; /* errno is set on overflow or underflow */ + + /* Skip any trailing whitespace, since strtoimax does not. */ + while (whitespace (*ep)) + ep++; + + /* If *string is not '\0' but *ep is '\0' on return, the entire string + is valid. */ + if (*string && *ep == '\0') + { + if (result) + *result = value; + /* The SunOS4 implementation of strtol() will happily ignore + overflow conditions, so this cannot do overflow correctly + on those systems. */ + return 1; + } + + return (0); +} + +/* Return 1 if this token is a legal shell `identifier'; that is, it consists + solely of letters, digits, and underscores, and does not begin with a + digit. */ +int +legal_identifier (name) + char *name; +{ + register char *s; + unsigned char c; + + if (!name || !(c = *name) || (legal_variable_starter (c) == 0)) + return (0); + + for (s = name + 1; (c = *s) != 0; s++) + { + if (legal_variable_char (c) == 0) + return (0); + } + return (1); +} + +/* Make sure that WORD is a valid shell identifier, i.e. + does not contain a dollar sign, nor is quoted in any way. Nor + does it consist of all digits. If CHECK_WORD is non-zero, + the word is checked to ensure that it consists of only letters, + digits, and underscores. */ +int +check_identifier (word, check_word) + WORD_DESC *word; + int check_word; +{ + if ((word->flags & (W_HASDOLLAR|W_QUOTED)) || all_digits (word->word)) + { + internal_error (_("`%s': not a valid identifier"), word->word); + return (0); + } + else if (check_word && legal_identifier (word->word) == 0) + { + internal_error (_("`%s': not a valid identifier"), word->word); + return (0); + } + else + return (1); +} + +/* Return 1 if STRING comprises a valid alias name. The shell accepts + essentially all characters except those which must be quoted to the + parser (which disqualifies them from alias expansion anyway) and `/'. */ +int +legal_alias_name (string, flags) + char *string; + int flags; +{ + register char *s; + + for (s = string; *s; s++) + if (shellbreak (*s) || shellxquote (*s) || shellexp (*s) || (*s == '/')) + return 0; + return 1; +} + +/* Returns non-zero if STRING is an assignment statement. The returned value + is the index of the `=' sign. */ +int +assignment (string, flags) + const char *string; + int flags; +{ + register unsigned char c; + register int newi, indx; + + c = string[indx = 0]; + +#if defined (ARRAY_VARS) + if ((legal_variable_starter (c) == 0) && (flags == 0 || c != '[')) /* ] */ +#else + if (legal_variable_starter (c) == 0) +#endif + return (0); + + while (c = string[indx]) + { + /* The following is safe. Note that '=' at the start of a word + is not an assignment statement. */ + if (c == '=') + return (indx); + +#if defined (ARRAY_VARS) + if (c == '[') + { + newi = skipsubscript (string, indx, 0); + if (string[newi++] != ']') + return (0); + if (string[newi] == '+' && string[newi+1] == '=') + return (newi + 1); + return ((string[newi] == '=') ? newi : 0); + } +#endif /* ARRAY_VARS */ + + /* Check for `+=' */ + if (c == '+' && string[indx+1] == '=') + return (indx + 1); + + /* Variable names in assignment statements may contain only letters, + digits, and `_'. */ + if (legal_variable_char (c) == 0) + return (0); + + indx++; + } + return (0); +} + +/* **************************************************************** */ +/* */ +/* Functions to manage files and file descriptors */ +/* */ +/* **************************************************************** */ + +/* A function to unset no-delay mode on a file descriptor. Used in shell.c + to unset it on the fd passed as stdin. Should be called on stdin if + readline gets an EAGAIN or EWOULDBLOCK when trying to read input. */ + +#if !defined (O_NDELAY) +# if defined (FNDELAY) +# define O_NDELAY FNDELAY +# endif +#endif /* O_NDELAY */ + +/* Make sure no-delay mode is not set on file descriptor FD. */ +int +sh_unset_nodelay_mode (fd) + int fd; +{ + int flags, bflags; + + if ((flags = fcntl (fd, F_GETFL, 0)) < 0) + return -1; + + bflags = 0; + + /* This is defined to O_NDELAY in filecntl.h if O_NONBLOCK is not present + and O_NDELAY is defined. */ +#ifdef O_NONBLOCK + bflags |= O_NONBLOCK; +#endif + +#ifdef O_NDELAY + bflags |= O_NDELAY; +#endif + + if (flags & bflags) + { + flags &= ~bflags; + return (fcntl (fd, F_SETFL, flags)); + } + + return 0; +} + +/* Return 1 if file descriptor FD is valid; 0 otherwise. */ +int +sh_validfd (fd) + int fd; +{ + return (fcntl (fd, F_GETFD, 0) >= 0); +} + +int +fd_ispipe (fd) + int fd; +{ + errno = 0; + if (lseek ((fd), 0L, SEEK_CUR) < 0) + return (errno == ESPIPE); + return 0; +} + +/* There is a bug in the NeXT 2.1 rlogind that causes opens + of /dev/tty to fail. */ + +#if defined (__BEOS__) +/* On BeOS, opening in non-blocking mode exposes a bug in BeOS, so turn it + into a no-op. This should probably go away in the future. */ +# undef O_NONBLOCK +# define O_NONBLOCK 0 +#endif /* __BEOS__ */ + +void +check_dev_tty () +{ + int tty_fd; + char *tty; + + tty_fd = open ("/dev/tty", O_RDWR|O_NONBLOCK); + + if (tty_fd < 0) + { + tty = (char *)ttyname (fileno (stdin)); + if (tty == 0) + return; + tty_fd = open (tty, O_RDWR|O_NONBLOCK); + } + if (tty_fd >= 0) + close (tty_fd); +} + +/* Return 1 if PATH1 and PATH2 are the same file. This is kind of + expensive. If non-NULL STP1 and STP2 point to stat structures + corresponding to PATH1 and PATH2, respectively. */ +int +same_file (path1, path2, stp1, stp2) + char *path1, *path2; + struct stat *stp1, *stp2; +{ + struct stat st1, st2; + + if (stp1 == NULL) + { + if (stat (path1, &st1) != 0) + return (0); + stp1 = &st1; + } + + if (stp2 == NULL) + { + if (stat (path2, &st2) != 0) + return (0); + stp2 = &st2; + } + + return ((stp1->st_dev == stp2->st_dev) && (stp1->st_ino == stp2->st_ino)); +} + +/* Move FD to a number close to the maximum number of file descriptors + allowed in the shell process, to avoid the user stepping on it with + redirection and causing us extra work. If CHECK_NEW is non-zero, + we check whether or not the file descriptors are in use before + duplicating FD onto them. MAXFD says where to start checking the + file descriptors. If it's less than 20, we get the maximum value + available from getdtablesize(2). */ +int +move_to_high_fd (fd, check_new, maxfd) + int fd, check_new, maxfd; +{ + int script_fd, nfds, ignore; + + if (maxfd < 20) + { + nfds = getdtablesize (); + if (nfds <= 0) + nfds = 20; + if (nfds > HIGH_FD_MAX) + nfds = HIGH_FD_MAX; /* reasonable maximum */ + } + else + nfds = maxfd; + + for (nfds--; check_new && nfds > 3; nfds--) + if (fcntl (nfds, F_GETFD, &ignore) == -1) + break; + + if (nfds > 3 && fd != nfds && (script_fd = dup2 (fd, nfds)) != -1) + { + if (check_new == 0 || fd != fileno (stderr)) /* don't close stderr */ + close (fd); + return (script_fd); + } + + /* OK, we didn't find one less than our artificial maximum; return the + original file descriptor. */ + return (fd); +} + +/* Return non-zero if the characters from SAMPLE are not all valid + characters to be found in the first line of a shell script. We + check up to the first newline, or SAMPLE_LEN, whichever comes first. + All of the characters must be printable or whitespace. */ + +int +check_binary_file (sample, sample_len) + char *sample; + int sample_len; +{ + register int i; + unsigned char c; + + for (i = 0; i < sample_len; i++) + { + c = sample[i]; + if (c == '\n') + return (0); + if (c == '\0') + return (1); + } + + return (0); +} + +/* **************************************************************** */ +/* */ +/* Functions to manipulate pipes */ +/* */ +/* **************************************************************** */ + +int +sh_openpipe (pv) + int *pv; +{ + int r; + + if ((r = pipe (pv)) < 0) + return r; + + pv[0] = move_to_high_fd (pv[0], 1, 64); + pv[1] = move_to_high_fd (pv[1], 1, 64); + + return 0; +} + +int +sh_closepipe (pv) + int *pv; +{ + if (pv[0] >= 0) + close (pv[0]); + + if (pv[1] >= 0) + close (pv[1]); + + pv[0] = pv[1] = -1; + return 0; +} + +/* **************************************************************** */ +/* */ +/* Functions to inspect pathnames */ +/* */ +/* **************************************************************** */ + +int +file_exists (fn) + char *fn; +{ + struct stat sb; + + return (stat (fn, &sb) == 0); +} + +int +file_isdir (fn) + char *fn; +{ + struct stat sb; + + return ((stat (fn, &sb) == 0) && S_ISDIR (sb.st_mode)); +} + +int +file_iswdir (fn) + char *fn; +{ + return (file_isdir (fn) && sh_eaccess (fn, W_OK) == 0); +} + +/* Return 1 if STRING is "." or "..", optionally followed by a directory + separator */ +int +path_dot_or_dotdot (string) + const char *string; +{ + if (string == 0 || *string == '\0' || *string != '.') + return (0); + + /* string[0] == '.' */ + if (PATHSEP(string[1]) || (string[1] == '.' && PATHSEP(string[2]))) + return (1); + + return (0); +} + +/* Return 1 if STRING contains an absolute pathname, else 0. Used by `cd' + to decide whether or not to look up a directory name in $CDPATH. */ +int +absolute_pathname (string) + const char *string; +{ + if (string == 0 || *string == '\0') + return (0); + + if (ABSPATH(string)) + return (1); + + if (string[0] == '.' && PATHSEP(string[1])) /* . and ./ */ + return (1); + + if (string[0] == '.' && string[1] == '.' && PATHSEP(string[2])) /* .. and ../ */ + return (1); + + return (0); +} + +/* Return 1 if STRING is an absolute program name; it is absolute if it + contains any slashes. This is used to decide whether or not to look + up through $PATH. */ +int +absolute_program (string) + const char *string; +{ + return ((char *)mbschr (string, '/') != (char *)NULL); +} + +/* **************************************************************** */ +/* */ +/* Functions to manipulate pathnames */ +/* */ +/* **************************************************************** */ + +/* Turn STRING (a pathname) into an absolute pathname, assuming that + DOT_PATH contains the symbolic location of `.'. This always + returns a new string, even if STRING was an absolute pathname to + begin with. */ +char * +make_absolute (string, dot_path) + char *string, *dot_path; +{ + char *result; + + if (dot_path == 0 || ABSPATH(string)) +#ifdef __CYGWIN__ + { + char pathbuf[PATH_MAX + 1]; + + cygwin_conv_to_full_posix_path (string, pathbuf); + result = savestring (pathbuf); + } +#else + result = savestring (string); +#endif + else + result = sh_makepath (dot_path, string, 0); + + return (result); +} + +/* Return the `basename' of the pathname in STRING (the stuff after the + last '/'). If STRING is `/', just return it. */ +char * +base_pathname (string) + char *string; +{ + char *p; + +#if 0 + if (absolute_pathname (string) == 0) + return (string); +#endif + + if (string[0] == '/' && string[1] == 0) + return (string); + + p = (char *)strrchr (string, '/'); + return (p ? ++p : string); +} + +/* Return the full pathname of FILE. Easy. Filenames that begin + with a '/' are returned as themselves. Other filenames have + the current working directory prepended. A new string is + returned in either case. */ +char * +full_pathname (file) + char *file; +{ + char *ret; + + file = (*file == '~') ? bash_tilde_expand (file, 0) : savestring (file); + + if (ABSPATH(file)) + return (file); + + ret = sh_makepath ((char *)NULL, file, (MP_DOCWD|MP_RMDOT)); + free (file); + + return (ret); +} + +/* A slightly related function. Get the prettiest name of this + directory possible. */ +static char tdir[PATH_MAX]; + +/* Return a pretty pathname. If the first part of the pathname is + the same as $HOME, then replace that with `~'. */ +char * +polite_directory_format (name) + char *name; +{ + char *home; + int l; + + home = get_string_value ("HOME"); + l = home ? strlen (home) : 0; + if (l > 1 && strncmp (home, name, l) == 0 && (!name[l] || name[l] == '/')) + { + strncpy (tdir + 1, name + l, sizeof(tdir) - 2); + tdir[0] = '~'; + tdir[sizeof(tdir) - 1] = '\0'; + return (tdir); + } + else + return (name); +} + +/* Trim NAME. If NAME begins with `~/', skip over tilde prefix. Trim to + keep any tilde prefix and PROMPT_DIRTRIM trailing directory components + and replace the intervening characters with `...' */ +char * +trim_pathname (name, maxlen) + char *name; + int maxlen; +{ + int nlen, ndirs; + intmax_t nskip; + char *nbeg, *nend, *ntail, *v; + + if (name == 0 || (nlen = strlen (name)) == 0) + return name; + nend = name + nlen; + + v = get_string_value ("PROMPT_DIRTRIM"); + if (v == 0 || *v == 0) + return name; + if (legal_number (v, &nskip) == 0 || nskip <= 0) + return name; + + /* Skip over tilde prefix */ + nbeg = name; + if (name[0] == '~') + for (nbeg = name; *nbeg; nbeg++) + if (*nbeg == '/') + { + nbeg++; + break; + } + if (*nbeg == 0) + return name; + + for (ndirs = 0, ntail = nbeg; *ntail; ntail++) + if (*ntail == '/') + ndirs++; + if (ndirs < nskip) + return name; + + for (ntail = (*nend == '/') ? nend : nend - 1; ntail > nbeg; ntail--) + { + if (*ntail == '/') + nskip--; + if (nskip == 0) + break; + } + if (ntail == nbeg) + return name; + + /* Now we want to return name[0..nbeg]+"..."+ntail, modifying name in place */ + nlen = ntail - nbeg; + if (nlen <= 3) + return name; + + *nbeg++ = '.'; + *nbeg++ = '.'; + *nbeg++ = '.'; + + nlen = nend - ntail; + memmove (nbeg, ntail, nlen); + nbeg[nlen] = '\0'; + + return name; +} + +/* Given a string containing units of information separated by colons, + return the next one pointed to by (P_INDEX), or NULL if there are no more. + Advance (P_INDEX) to the character after the colon. */ +char * +extract_colon_unit (string, p_index) + char *string; + int *p_index; +{ + int i, start, len; + char *value; + + if (string == 0) + return (string); + + len = strlen (string); + if (*p_index >= len) + return ((char *)NULL); + + i = *p_index; + + /* Each call to this routine leaves the index pointing at a colon if + there is more to the path. If I is > 0, then increment past the + `:'. If I is 0, then the path has a leading colon. Trailing colons + are handled OK by the `else' part of the if statement; an empty + string is returned in that case. */ + if (i && string[i] == ':') + i++; + + for (start = i; string[i] && string[i] != ':'; i++) + ; + + *p_index = i; + + if (i == start) + { + if (string[i]) + (*p_index)++; + /* Return "" in the case of a trailing `:'. */ + value = (char *)xmalloc (1); + value[0] = '\0'; + } + else + value = substring (string, start, i); + + return (value); +} + +/* **************************************************************** */ +/* */ +/* Tilde Initialization and Expansion */ +/* */ +/* **************************************************************** */ + +#if defined (PUSHD_AND_POPD) +extern char *get_dirstack_from_string __P((char *)); +#endif + +static char **bash_tilde_prefixes; +static char **bash_tilde_prefixes2; +static char **bash_tilde_suffixes; +static char **bash_tilde_suffixes2; + +/* If tilde_expand hasn't been able to expand the text, perhaps it + is a special shell expansion. This function is installed as the + tilde_expansion_preexpansion_hook. It knows how to expand ~- and ~+. + If PUSHD_AND_POPD is defined, ~[+-]N expands to directories from the + directory stack. */ +static char * +bash_special_tilde_expansions (text) + char *text; +{ + char *result; + + result = (char *)NULL; + + if (text[0] == '+' && text[1] == '\0') + result = get_string_value ("PWD"); + else if (text[0] == '-' && text[1] == '\0') + result = get_string_value ("OLDPWD"); +#if defined (PUSHD_AND_POPD) + else if (DIGIT (*text) || ((*text == '+' || *text == '-') && DIGIT (text[1]))) + result = get_dirstack_from_string (text); +#endif + + return (result ? savestring (result) : (char *)NULL); +} + +/* Initialize the tilde expander. In Bash, we handle `~-' and `~+', as + well as handling special tilde prefixes; `:~" and `=~' are indications + that we should do tilde expansion. */ +void +tilde_initialize () +{ + static int times_called = 0; + + /* Tell the tilde expander that we want a crack first. */ + tilde_expansion_preexpansion_hook = bash_special_tilde_expansions; + + /* Tell the tilde expander about special strings which start a tilde + expansion, and the special strings that end one. Only do this once. + tilde_initialize () is called from within bashline_reinitialize (). */ + if (times_called++ == 0) + { + bash_tilde_prefixes = strvec_create (3); + bash_tilde_prefixes[0] = "=~"; + bash_tilde_prefixes[1] = ":~"; + bash_tilde_prefixes[2] = (char *)NULL; + + bash_tilde_prefixes2 = strvec_create (2); + bash_tilde_prefixes2[0] = ":~"; + bash_tilde_prefixes2[1] = (char *)NULL; + + tilde_additional_prefixes = bash_tilde_prefixes; + + bash_tilde_suffixes = strvec_create (3); + bash_tilde_suffixes[0] = ":"; + bash_tilde_suffixes[1] = "=~"; /* XXX - ?? */ + bash_tilde_suffixes[2] = (char *)NULL; + + tilde_additional_suffixes = bash_tilde_suffixes; + + bash_tilde_suffixes2 = strvec_create (2); + bash_tilde_suffixes2[0] = ":"; + bash_tilde_suffixes2[1] = (char *)NULL; + } +} + +/* POSIX.2, 3.6.1: A tilde-prefix consists of an unquoted tilde character + at the beginning of the word, followed by all of the characters preceding + the first unquoted slash in the word, or all the characters in the word + if there is no slash...If none of the characters in the tilde-prefix are + quoted, the characters in the tilde-prefix following the tilde shell be + treated as a possible login name. */ + +#define TILDE_END(c) ((c) == '\0' || (c) == '/' || (c) == ':') + +static int +unquoted_tilde_word (s) + const char *s; +{ + const char *r; + + for (r = s; TILDE_END(*r) == 0; r++) + { + switch (*r) + { + case '\\': + case '\'': + case '"': + return 0; + } + } + return 1; +} + +/* Find the end of the tilde-prefix starting at S, and return the tilde + prefix in newly-allocated memory. Return the length of the string in + *LENP. FLAGS tells whether or not we're in an assignment context -- + if so, `:' delimits the end of the tilde prefix as well. */ +char * +bash_tilde_find_word (s, flags, lenp) + const char *s; + int flags, *lenp; +{ + const char *r; + char *ret; + int l; + + for (r = s; *r && *r != '/'; r++) + { + /* Short-circuit immediately if we see a quote character. Even though + POSIX says that `the first unquoted slash' (or `:') terminates the + tilde-prefix, in practice, any quoted portion of the tilde prefix + will cause it to not be expanded. */ + if (*r == '\\' || *r == '\'' || *r == '"') + { + ret = savestring (s); + if (lenp) + *lenp = 0; + return ret; + } + else if (flags && *r == ':') + break; + } + l = r - s; + ret = xmalloc (l + 1); + strncpy (ret, s, l); + ret[l] = '\0'; + if (lenp) + *lenp = l; + return ret; +} + +/* Tilde-expand S by running it through the tilde expansion library. + ASSIGN_P is 1 if this is a variable assignment, so the alternate + tilde prefixes should be enabled (`=~' and `:~', see above). If + ASSIGN_P is 2, we are expanding the rhs of an assignment statement, + so `=~' is not valid. */ +char * +bash_tilde_expand (s, assign_p) + const char *s; + int assign_p; +{ + int old_immed, old_term, r; + char *ret; + + old_immed = interrupt_immediately; + old_term = terminate_immediately; + /* We want to be able to interrupt tilde expansion. Ordinarily, we can just + jump to top_level, but we don't want to run any trap commands in a signal + handler context. We might be able to get away with just checking for + things like SIGINT and SIGQUIT. */ + if (any_signals_trapped () < 0) + interrupt_immediately = 1; + terminate_immediately = 1; + + tilde_additional_prefixes = assign_p == 0 ? (char **)0 + : (assign_p == 2 ? bash_tilde_prefixes2 : bash_tilde_prefixes); + if (assign_p == 2) + tilde_additional_suffixes = bash_tilde_suffixes2; + + r = (*s == '~') ? unquoted_tilde_word (s) : 1; + ret = r ? tilde_expand (s) : savestring (s); + + interrupt_immediately = old_immed; + terminate_immediately = old_term; + + QUIT; + + return (ret); +} + +/* **************************************************************** */ +/* */ +/* Functions to manipulate and search the group list */ +/* */ +/* **************************************************************** */ + +static int ngroups, maxgroups; + +/* The set of groups that this user is a member of. */ +static GETGROUPS_T *group_array = (GETGROUPS_T *)NULL; + +#if !defined (NOGROUP) +# define NOGROUP (gid_t) -1 +#endif + +static void +initialize_group_array () +{ + register int i; + + if (maxgroups == 0) + maxgroups = getmaxgroups (); + + ngroups = 0; + group_array = (GETGROUPS_T *)xrealloc (group_array, maxgroups * sizeof (GETGROUPS_T)); + +#if defined (HAVE_GETGROUPS) + ngroups = getgroups (maxgroups, group_array); +#endif + + /* If getgroups returns nothing, or the OS does not support getgroups(), + make sure the groups array includes at least the current gid. */ + if (ngroups == 0) + { + group_array[0] = current_user.gid; + ngroups = 1; + } + + /* If the primary group is not in the groups array, add it as group_array[0] + and shuffle everything else up 1, if there's room. */ + for (i = 0; i < ngroups; i++) + if (current_user.gid == (gid_t)group_array[i]) + break; + if (i == ngroups && ngroups < maxgroups) + { + for (i = ngroups; i > 0; i--) + group_array[i] = group_array[i - 1]; + group_array[0] = current_user.gid; + ngroups++; + } + + /* If the primary group is not group_array[0], swap group_array[0] and + whatever the current group is. The vast majority of systems should + not need this; a notable exception is Linux. */ + if (group_array[0] != current_user.gid) + { + for (i = 0; i < ngroups; i++) + if (group_array[i] == current_user.gid) + break; + if (i < ngroups) + { + group_array[i] = group_array[0]; + group_array[0] = current_user.gid; + } + } +} + +/* Return non-zero if GID is one that we have in our groups list. */ +int +#if defined (__STDC__) || defined ( _MINIX) +group_member (gid_t gid) +#else +group_member (gid) + gid_t gid; +#endif /* !__STDC__ && !_MINIX */ +{ +#if defined (HAVE_GETGROUPS) + register int i; +#endif + + /* Short-circuit if possible, maybe saving a call to getgroups(). */ + if (gid == current_user.gid || gid == current_user.egid) + return (1); + +#if defined (HAVE_GETGROUPS) + if (ngroups == 0) + initialize_group_array (); + + /* In case of error, the user loses. */ + if (ngroups <= 0) + return (0); + + /* Search through the list looking for GID. */ + for (i = 0; i < ngroups; i++) + if (gid == (gid_t)group_array[i]) + return (1); +#endif + + return (0); +} + +char ** +get_group_list (ngp) + int *ngp; +{ + static char **group_vector = (char **)NULL; + register int i; + + if (group_vector) + { + if (ngp) + *ngp = ngroups; + return group_vector; + } + + if (ngroups == 0) + initialize_group_array (); + + if (ngroups <= 0) + { + if (ngp) + *ngp = 0; + return (char **)NULL; + } + + group_vector = strvec_create (ngroups); + for (i = 0; i < ngroups; i++) + group_vector[i] = itos (group_array[i]); + + if (ngp) + *ngp = ngroups; + return group_vector; +} + +int * +get_group_array (ngp) + int *ngp; +{ + int i; + static int *group_iarray = (int *)NULL; + + if (group_iarray) + { + if (ngp) + *ngp = ngroups; + return (group_iarray); + } + + if (ngroups == 0) + initialize_group_array (); + + if (ngroups <= 0) + { + if (ngp) + *ngp = 0; + return (int *)NULL; + } + + group_iarray = (int *)xmalloc (ngroups * sizeof (int)); + for (i = 0; i < ngroups; i++) + group_iarray[i] = (int)group_array[i]; + + if (ngp) + *ngp = ngroups; + return group_iarray; +} diff --git a/general.h b/general.h new file mode 100644 index 0000000..1f8c54a --- /dev/null +++ b/general.h @@ -0,0 +1,327 @@ +/* general.h -- defines that everybody likes to use. */ + +/* Copyright (C) 1993-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_GENERAL_H_) +#define _GENERAL_H_ + +#include "stdc.h" + +#include "bashtypes.h" +#include "chartypes.h" + +#if defined (HAVE_SYS_RESOURCE_H) && defined (RLIMTYPE) +# if defined (HAVE_SYS_TIME_H) +# include +# endif +# include +#endif + +#if defined (HAVE_STRING_H) +# include +#else +# include +#endif /* !HAVE_STRING_H */ + +#if defined (HAVE_LIMITS_H) +# include +#endif + +#include "xmalloc.h" + +/* NULL pointer type. */ +#if !defined (NULL) +# if defined (__STDC__) +# define NULL ((void *) 0) +# else +# define NULL 0x0 +# endif /* !__STDC__ */ +#endif /* !NULL */ + +/* Hardly used anymore */ +#define pointer_to_int(x) (int)((char *)x - (char *)0) + +#if defined (alpha) && defined (__GNUC__) && !defined (strchr) && !defined (__STDC__) +extern char *strchr (), *strrchr (); +#endif + +#if !defined (strcpy) && (defined (HAVE_DECL_STRCPY) && !HAVE_DECL_STRCPY) +extern char *strcpy __P((char *, const char *)); +#endif + +#if !defined (savestring) +# define savestring(x) (char *)strcpy (xmalloc (1 + strlen (x)), (x)) +#endif + +#ifndef member +# define member(c, s) ((c) ? ((char *)mbschr ((s), (c)) != (char *)NULL) : 0) +#endif + +#ifndef whitespace +#define whitespace(c) (((c) == ' ') || ((c) == '\t')) +#endif + +#ifndef CHAR_MAX +# ifdef __CHAR_UNSIGNED__ +# define CHAR_MAX 0xff +# else +# define CHAR_MAX 0x7f +# endif +#endif + +#ifndef CHAR_BIT +# define CHAR_BIT 8 +#endif + +/* Nonzero if the integer type T is signed. */ +#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) + +/* Bound on length of the string representing an integer value of type T. + Subtract one for the sign bit if T is signed; + 302 / 1000 is log10 (2) rounded up; + add one for integer division truncation; + add one more for a minus sign if t is signed. */ +#define INT_STRLEN_BOUND(t) \ + ((sizeof (t) * CHAR_BIT - TYPE_SIGNED (t)) * 302 / 1000 \ + + 1 + TYPE_SIGNED (t)) + + +/* Define exactly what a legal shell identifier consists of. */ +#define legal_variable_starter(c) (ISALPHA(c) || (c == '_')) +#define legal_variable_char(c) (ISALNUM(c) || c == '_') + +/* Definitions used in subst.c and by the `read' builtin for field + splitting. */ +#define spctabnl(c) ((c) == ' ' || (c) == '\t' || (c) == '\n') + +/* All structs which contain a `next' field should have that field + as the first field in the struct. This means that functions + can be written to handle the general case for linked lists. */ +typedef struct g_list { + struct g_list *next; +} GENERIC_LIST; + +/* Here is a generic structure for associating character strings + with integers. It is used in the parser for shell tokenization. */ +typedef struct { + char *word; + int token; +} STRING_INT_ALIST; + +/* A macro to avoid making an unneccessary function call. */ +#define REVERSE_LIST(list, type) \ + ((list && list->next) ? (type)list_reverse ((GENERIC_LIST *)list) \ + : (type)(list)) + +#if __GNUC__ > 1 +# define FASTCOPY(s, d, n) __builtin_memcpy ((d), (s), (n)) +#else /* !__GNUC__ */ +# if !defined (HAVE_BCOPY) +# if !defined (HAVE_MEMMOVE) +# define FASTCOPY(s, d, n) memcpy ((d), (s), (n)) +# else +# define FASTCOPY(s, d, n) memmove ((d), (s), (n)) +# endif /* !HAVE_MEMMOVE */ +# else /* HAVE_BCOPY */ +# define FASTCOPY(s, d, n) bcopy ((s), (d), (n)) +# endif /* HAVE_BCOPY */ +#endif /* !__GNUC__ */ + +/* String comparisons that possibly save a function call each. */ +#define STREQ(a, b) ((a)[0] == (b)[0] && strcmp(a, b) == 0) +#define STREQN(a, b, n) ((n == 0) ? (1) \ + : ((a)[0] == (b)[0] && strncmp(a, b, n) == 0)) + +/* More convenience definitions that possibly save system or libc calls. */ +#define STRLEN(s) (((s) && (s)[0]) ? ((s)[1] ? ((s)[2] ? strlen(s) : 2) : 1) : 0) +#define FREE(s) do { if (s) free (s); } while (0) +#define MEMBER(c, s) (((c) && c == (s)[0] && !(s)[1]) || (member(c, s))) + +/* A fairly hairy macro to check whether an allocated string has more room, + and to resize it using xrealloc if it does not. + STR is the string (char *) + CIND is the current index into the string (int) + ROOM is the amount of additional room we need in the string (int) + CSIZE is the currently-allocated size of STR (int) + SINCR is how much to increment CSIZE before calling xrealloc (int) */ + +#define RESIZE_MALLOCED_BUFFER(str, cind, room, csize, sincr) \ + do { \ + if ((cind) + (room) >= csize) \ + { \ + while ((cind) + (room) >= csize) \ + csize += (sincr); \ + str = xrealloc (str, csize); \ + } \ + } while (0) + +/* Function pointers can be declared as (Function *)foo. */ +#if !defined (_FUNCTION_DEF) +# define _FUNCTION_DEF +typedef int Function (); +typedef void VFunction (); +typedef char *CPFunction (); /* no longer used */ +typedef char **CPPFunction (); /* no longer used */ +#endif /* _FUNCTION_DEF */ + +#ifndef SH_FUNCTION_TYPEDEF +# define SH_FUNCTION_TYPEDEF + +/* Shell function typedefs with prototypes */ +/* `Generic' function pointer typedefs */ + +typedef int sh_intfunc_t __P((int)); +typedef int sh_ivoidfunc_t __P((void)); +typedef int sh_icpfunc_t __P((char *)); +typedef int sh_icppfunc_t __P((char **)); +typedef int sh_iptrfunc_t __P((PTR_T)); + +typedef void sh_voidfunc_t __P((void)); +typedef void sh_vintfunc_t __P((int)); +typedef void sh_vcpfunc_t __P((char *)); +typedef void sh_vcppfunc_t __P((char **)); +typedef void sh_vptrfunc_t __P((PTR_T)); + +typedef int sh_wdesc_func_t __P((WORD_DESC *)); +typedef int sh_wlist_func_t __P((WORD_LIST *)); + +typedef int sh_glist_func_t __P((GENERIC_LIST *)); + +typedef char *sh_string_func_t __P((char *)); /* like savestring, et al. */ + +typedef int sh_msg_func_t __P((const char *, ...)); /* printf(3)-like */ +typedef void sh_vmsg_func_t __P((const char *, ...)); /* printf(3)-like */ + +/* Specific function pointer typedefs. Most of these could be done + with #defines. */ +typedef void sh_sv_func_t __P((char *)); /* sh_vcpfunc_t */ +typedef void sh_free_func_t __P((PTR_T)); /* sh_vptrfunc_t */ +typedef void sh_resetsig_func_t __P((int)); /* sh_vintfunc_t */ + +typedef int sh_ignore_func_t __P((const char *)); /* sh_icpfunc_t */ + +typedef int sh_assign_func_t __P((const char *)); +typedef int sh_wassign_func_t __P((WORD_DESC *, int)); + +typedef int sh_builtin_func_t __P((WORD_LIST *)); /* sh_wlist_func_t */ + +#endif /* SH_FUNCTION_TYPEDEF */ + +#define NOW ((time_t) time ((time_t *) 0)) + +/* Some defines for calling file status functions. */ +#define FS_EXISTS 0x1 +#define FS_EXECABLE 0x2 +#define FS_EXEC_PREFERRED 0x4 +#define FS_EXEC_ONLY 0x8 +#define FS_DIRECTORY 0x10 +#define FS_NODIRS 0x20 +#define FS_READABLE 0x40 + +/* Default maximum for move_to_high_fd */ +#define HIGH_FD_MAX 256 + +/* The type of function passed as the fourth argument to qsort(3). */ +#ifdef __STDC__ +typedef int QSFUNC (const void *, const void *); +#else +typedef int QSFUNC (); +#endif + +/* Some useful definitions for Unix pathnames. Argument convention: + x == string, c == character */ + +#if !defined (__CYGWIN__) +# define ABSPATH(x) ((x)[0] == '/') +# define RELPATH(x) ((x)[0] != '/') +#else /* __CYGWIN__ */ +# define ABSPATH(x) (((x)[0] && ISALPHA((unsigned char)(x)[0]) && (x)[1] == ':') || ISDIRSEP((x)[0])) +# define RELPATH(x) (ABSPATH(x) == 0) +#endif /* __CYGWIN__ */ + +#define ROOTEDPATH(x) (ABSPATH(x)) + +#define DIRSEP '/' +#if !defined (__CYGWIN__) +# define ISDIRSEP(c) ((c) == '/') +#else +# define ISDIRSEP(c) ((c) == '/' || (c) == '\\') +#endif /* __CYGWIN__ */ +#define PATHSEP(c) (ISDIRSEP(c) || (c) == 0) + +#if 0 +/* Declarations for functions defined in xmalloc.c */ +extern PTR_T xmalloc __P((size_t)); +extern PTR_T xrealloc __P((void *, size_t)); +extern void xfree __P((void *)); +#endif + +/* Declarations for functions defined in general.c */ +extern void posix_initialize __P((int)); + +#if defined (RLIMTYPE) +extern RLIMTYPE string_to_rlimtype __P((char *)); +extern void print_rlimtype __P((RLIMTYPE, int)); +#endif + +extern int all_digits __P((char *)); +extern int legal_number __P((const char *, intmax_t *)); +extern int legal_identifier __P((char *)); +extern int check_identifier __P((WORD_DESC *, int)); +extern int legal_alias_name __P((char *, int)); +extern int assignment __P((const char *, int)); + +extern int sh_unset_nodelay_mode __P((int)); +extern int sh_validfd __P((int)); +extern int fd_ispipe __P((int)); +extern void check_dev_tty __P((void)); +extern int move_to_high_fd __P((int, int, int)); +extern int check_binary_file __P((char *, int)); + +#ifdef _POSIXSTAT_H_ +extern int same_file __P((char *, char *, struct stat *, struct stat *)); +#endif + +extern int sh_openpipe __P((int *)); +extern int sh_closepipe __P((int *)); + +extern int file_exists __P((char *)); +extern int file_isdir __P((char *)); +extern int file_iswdir __P((char *)); +extern int path_dot_or_dotdot __P((const char *)); +extern int absolute_pathname __P((const char *)); +extern int absolute_program __P((const char *)); + +extern char *make_absolute __P((char *, char *)); +extern char *base_pathname __P((char *)); +extern char *full_pathname __P((char *)); +extern char *polite_directory_format __P((char *)); +extern char *trim_pathname __P((char *, int)); + +extern char *extract_colon_unit __P((char *, int *)); + +extern void tilde_initialize __P((void)); +extern char *bash_tilde_find_word __P((const char *, int, int *)); +extern char *bash_tilde_expand __P((const char *, int)); + +extern int group_member __P((gid_t)); +extern char **get_group_list __P((int *)); +extern int *get_group_array __P((int *)); + +#endif /* _GENERAL_H_ */ diff --git a/hashcmd.c b/hashcmd.c new file mode 100644 index 0000000..fc0bfbe --- /dev/null +++ b/hashcmd.c @@ -0,0 +1,196 @@ +/* hashcmd.c - functions for managing a hash table mapping command names to + full pathnames. */ + +/* Copyright (C) 1997-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include "bashtypes.h" +#include "posixstat.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" + +#include "shell.h" +#include "findcmd.h" +#include "hashcmd.h" + +extern int hashing_enabled; + +HASH_TABLE *hashed_filenames = (HASH_TABLE *)NULL; + +static void phash_freedata __P((PTR_T)); + +void +phash_create () +{ + if (hashed_filenames == 0) + hashed_filenames = hash_create (FILENAME_HASH_BUCKETS); +} + +static void +phash_freedata (data) + PTR_T data; +{ + free (((PATH_DATA *)data)->path); + free (data); +} + +void +phash_flush () +{ + if (hashed_filenames) + hash_flush (hashed_filenames, phash_freedata); +} + +/* Remove FILENAME from the table of hashed commands. */ +int +phash_remove (filename) + const char *filename; +{ + register BUCKET_CONTENTS *item; + + if (hashing_enabled == 0 || hashed_filenames == 0) + return 0; + + item = hash_remove (filename, hashed_filenames, 0); + if (item) + { + if (item->data) + phash_freedata (item->data); + free (item->key); + free (item); + return 0; + } + return 1; +} + +/* Place FILENAME (key) and FULL_PATH (data->path) into the + hash table. CHECK_DOT if non-null is for future calls to + phash_search (); it means that this file was found + in a directory in $PATH that is not an absolute pathname. + FOUND is the initial value for times_found. */ +void +phash_insert (filename, full_path, check_dot, found) + char *filename, *full_path; + int check_dot, found; +{ + register BUCKET_CONTENTS *item; + + if (hashing_enabled == 0) + return; + + if (hashed_filenames == 0) + phash_create (); + + item = hash_insert (filename, hashed_filenames, 0); + if (item->data) + free (pathdata(item)->path); + else + { + item->key = savestring (filename); + item->data = xmalloc (sizeof (PATH_DATA)); + } + pathdata(item)->path = savestring (full_path); + pathdata(item)->flags = 0; + if (check_dot) + pathdata(item)->flags |= HASH_CHKDOT; + if (*full_path != '/') + pathdata(item)->flags |= HASH_RELPATH; + item->times_found = found; +} + +/* Return the full pathname that FILENAME hashes to. If FILENAME + is hashed, but (data->flags & HASH_CHKDOT) is non-zero, check + ./FILENAME and return that if it is executable. This always + returns a newly-allocated string; the caller is responsible + for freeing it. */ +char * +phash_search (filename) + const char *filename; +{ + register BUCKET_CONTENTS *item; + char *path, *dotted_filename, *tail; + int same; + + if (hashing_enabled == 0 || hashed_filenames == 0) + return ((char *)NULL); + + item = hash_search (filename, hashed_filenames, 0); + + if (item == NULL) + return ((char *)NULL); + + /* If this filename is hashed, but `.' comes before it in the path, + see if ./filename is executable. If the hashed value is not an + absolute pathname, see if ./`hashed-value' exists. */ + path = pathdata(item)->path; + if (pathdata(item)->flags & (HASH_CHKDOT|HASH_RELPATH)) + { + tail = (pathdata(item)->flags & HASH_RELPATH) ? path : (char *)filename; /* XXX - fix const later */ + /* If the pathname does not start with a `./', add a `./' to it. */ + if (tail[0] != '.' || tail[1] != '/') + { + dotted_filename = (char *)xmalloc (3 + strlen (tail)); + dotted_filename[0] = '.'; dotted_filename[1] = '/'; + strcpy (dotted_filename + 2, tail); + } + else + dotted_filename = savestring (tail); + + if (executable_file (dotted_filename)) + return (dotted_filename); + + free (dotted_filename); + +#if 0 + if (pathdata(item)->flags & HASH_RELPATH) + return ((char *)NULL); +#endif + + /* Watch out. If this file was hashed to "./filename", and + "./filename" is not executable, then return NULL. */ + + /* Since we already know "./filename" is not executable, what + we're really interested in is whether or not the `path' + portion of the hashed filename is equivalent to the current + directory, but only if it starts with a `.'. (This catches + ./. and so on.) same_file () tests general Unix file + equivalence -- same device and inode. */ + if (*path == '.') + { + same = 0; + tail = (char *)strrchr (path, '/'); + + if (tail) + { + *tail = '\0'; + same = same_file (".", path, (struct stat *)NULL, (struct stat *)NULL); + *tail = '/'; + } + + return same ? (char *)NULL : savestring (path); + } + } + + return (savestring (path)); +} diff --git a/hashcmd.h b/hashcmd.h new file mode 100644 index 0000000..758f5b4 --- /dev/null +++ b/hashcmd.h @@ -0,0 +1,43 @@ +/* hashcmd.h - Common defines for hashing filenames. */ + +/* Copyright (C) 1993-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "stdc.h" +#include "hashlib.h" + +#define FILENAME_HASH_BUCKETS 64 /* must be power of two */ + +extern HASH_TABLE *hashed_filenames; + +typedef struct _pathdata { + char *path; /* The full pathname of the file. */ + int flags; +} PATH_DATA; + +#define HASH_RELPATH 0x01 /* this filename is a relative pathname. */ +#define HASH_CHKDOT 0x02 /* check `.' since it was earlier in $PATH */ + +#define pathdata(x) ((PATH_DATA *)(x)->data) + +extern void phash_create __P((void)); +extern void phash_flush __P((void)); + +extern void phash_insert __P((char *, char *, int, int)); +extern int phash_remove __P((const char *)); +extern char *phash_search __P((const char *)); diff --git a/hashlib.c b/hashlib.c new file mode 100644 index 0000000..ea67dfc --- /dev/null +++ b/hashlib.c @@ -0,0 +1,442 @@ +/* hashlib.c -- functions to manage and access hash tables for bash. */ + +/* Copyright (C) 1987,1989,1991,1995,1998,2001,2003,2005,2006,2008,2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include "bashansi.h" + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include + +#include "shell.h" +#include "hashlib.h" + +/* Rely on properties of unsigned division (unsigned/int -> unsigned) and + don't discard the upper 32 bits of the value, if present. */ +#define HASH_BUCKET(s, t, h) (((h) = hash_string (s)) & ((t)->nbuckets - 1)) + +static BUCKET_CONTENTS *copy_bucket_array __P((BUCKET_CONTENTS *, sh_string_func_t *)); + +/* Make a new hash table with BUCKETS number of buckets. Initialize + each slot in the table to NULL. */ +HASH_TABLE * +hash_create (buckets) + int buckets; +{ + HASH_TABLE *new_table; + register int i; + + new_table = (HASH_TABLE *)xmalloc (sizeof (HASH_TABLE)); + if (buckets == 0) + buckets = DEFAULT_HASH_BUCKETS; + + new_table->bucket_array = + (BUCKET_CONTENTS **)xmalloc (buckets * sizeof (BUCKET_CONTENTS *)); + new_table->nbuckets = buckets; + new_table->nentries = 0; + + for (i = 0; i < buckets; i++) + new_table->bucket_array[i] = (BUCKET_CONTENTS *)NULL; + + return (new_table); +} + +int +hash_size (table) + HASH_TABLE *table; +{ + return (HASH_ENTRIES(table)); +} + +static BUCKET_CONTENTS * +copy_bucket_array (ba, cpdata) + BUCKET_CONTENTS *ba; + sh_string_func_t *cpdata; /* data copy function */ +{ + BUCKET_CONTENTS *new_bucket, *n, *e; + + if (ba == 0) + return ((BUCKET_CONTENTS *)0); + + for (n = (BUCKET_CONTENTS *)0, e = ba; e; e = e->next) + { + if (n == 0) + { + new_bucket = (BUCKET_CONTENTS *)xmalloc (sizeof (BUCKET_CONTENTS)); + n = new_bucket; + } + else + { + n->next = (BUCKET_CONTENTS *)xmalloc (sizeof (BUCKET_CONTENTS)); + n = n->next; + } + + n->key = savestring (e->key); + n->data = e->data ? (cpdata ? (*cpdata) (e->data) : savestring (e->data)) + : NULL; + n->khash = e->khash; + n->times_found = e->times_found; + n->next = (BUCKET_CONTENTS *)NULL; + } + + return new_bucket; +} + +HASH_TABLE * +hash_copy (table, cpdata) + HASH_TABLE *table; + sh_string_func_t *cpdata; +{ + HASH_TABLE *new_table; + int i; + + if (table == 0) + return ((HASH_TABLE *)NULL); + + new_table = hash_create (table->nbuckets); + + for (i = 0; i < table->nbuckets; i++) + new_table->bucket_array[i] = copy_bucket_array (table->bucket_array[i], cpdata); + + new_table->nentries = table->nentries; + return new_table; +} + +/* The `khash' check below requires that strings that compare equally with + strcmp hash to the same value. */ +unsigned int +hash_string (s) + const char *s; +{ + register unsigned int i; + + /* This is the best string hash function I found. + + The magic is in the interesting relationship between the special prime + 16777619 (2^24 + 403) and 2^32 and 2^8. */ + + for (i = 0; *s; s++) + { + i *= 16777619; + i ^= *s; + } + + return i; +} + +/* Return the location of the bucket which should contain the data + for STRING. TABLE is a pointer to a HASH_TABLE. */ + +int +hash_bucket (string, table) + const char *string; + HASH_TABLE *table; +{ + unsigned int h; + + return (HASH_BUCKET (string, table, h)); +} + +/* Return a pointer to the hashed item. If the HASH_CREATE flag is passed, + create a new hash table entry for STRING, otherwise return NULL. */ +BUCKET_CONTENTS * +hash_search (string, table, flags) + const char *string; + HASH_TABLE *table; + int flags; +{ + BUCKET_CONTENTS *list; + int bucket; + unsigned int hv; + + if (table == 0 || ((flags & HASH_CREATE) == 0 && HASH_ENTRIES (table) == 0)) + return (BUCKET_CONTENTS *)NULL; + + bucket = HASH_BUCKET (string, table, hv); + + for (list = table->bucket_array ? table->bucket_array[bucket] : 0; list; list = list->next) + { + if (hv == list->khash && STREQ (list->key, string)) + { + list->times_found++; + return (list); + } + } + + if (flags & HASH_CREATE) + { + list = (BUCKET_CONTENTS *)xmalloc (sizeof (BUCKET_CONTENTS)); + list->next = table->bucket_array[bucket]; + table->bucket_array[bucket] = list; + + list->data = NULL; + list->key = (char *)string; /* XXX fix later */ + list->khash = hv; + list->times_found = 0; + + table->nentries++; + return (list); + } + + return (BUCKET_CONTENTS *)NULL; +} + +/* Remove the item specified by STRING from the hash table TABLE. + The item removed is returned, so you can free its contents. If + the item isn't in this table NULL is returned. */ +BUCKET_CONTENTS * +hash_remove (string, table, flags) + const char *string; + HASH_TABLE *table; + int flags; +{ + int bucket; + BUCKET_CONTENTS *prev, *temp; + unsigned int hv; + + if (table == 0 || HASH_ENTRIES (table) == 0) + return (BUCKET_CONTENTS *)NULL; + + bucket = HASH_BUCKET (string, table, hv); + prev = (BUCKET_CONTENTS *)NULL; + for (temp = table->bucket_array[bucket]; temp; temp = temp->next) + { + if (hv == temp->khash && STREQ (temp->key, string)) + { + if (prev) + prev->next = temp->next; + else + table->bucket_array[bucket] = temp->next; + + table->nentries--; + return (temp); + } + prev = temp; + } + return ((BUCKET_CONTENTS *) NULL); +} + +/* Create an entry for STRING, in TABLE. If the entry already + exists, then return it (unless the HASH_NOSRCH flag is set). */ +BUCKET_CONTENTS * +hash_insert (string, table, flags) + char *string; + HASH_TABLE *table; + int flags; +{ + BUCKET_CONTENTS *item; + int bucket; + unsigned int hv; + + if (table == 0) + table = hash_create (0); + + item = (flags & HASH_NOSRCH) ? (BUCKET_CONTENTS *)NULL + : hash_search (string, table, 0); + + if (item == 0) + { + bucket = HASH_BUCKET (string, table, hv); + + item = (BUCKET_CONTENTS *)xmalloc (sizeof (BUCKET_CONTENTS)); + item->next = table->bucket_array[bucket]; + table->bucket_array[bucket] = item; + + item->data = NULL; + item->key = string; + item->khash = hv; + item->times_found = 0; + + table->nentries++; + } + + return (item); +} + +/* Remove and discard all entries in TABLE. If FREE_DATA is non-null, it + is a function to call to dispose of a hash item's data. Otherwise, + free() is called. */ +void +hash_flush (table, free_data) + HASH_TABLE *table; + sh_free_func_t *free_data; +{ + int i; + register BUCKET_CONTENTS *bucket, *item; + + if (table == 0 || HASH_ENTRIES (table) == 0) + return; + + for (i = 0; i < table->nbuckets; i++) + { + bucket = table->bucket_array[i]; + + while (bucket) + { + item = bucket; + bucket = bucket->next; + + if (free_data) + (*free_data) (item->data); + else + free (item->data); + free (item->key); + free (item); + } + table->bucket_array[i] = (BUCKET_CONTENTS *)NULL; + } + + table->nentries = 0; +} + +/* Free the hash table pointed to by TABLE. */ +void +hash_dispose (table) + HASH_TABLE *table; +{ + free (table->bucket_array); + free (table); +} + +void +hash_walk (table, func) + HASH_TABLE *table; + hash_wfunc *func; +{ + register int i; + BUCKET_CONTENTS *item; + + if (table == 0 || HASH_ENTRIES (table) == 0) + return; + + for (i = 0; i < table->nbuckets; i++) + { + for (item = hash_items (i, table); item; item = item->next) + if ((*func) (item) < 0) + return; + } +} + +#if defined (DEBUG) || defined (TEST_HASHING) +void +hash_pstats (table, name) + HASH_TABLE *table; + char *name; +{ + register int slot, bcount; + register BUCKET_CONTENTS *bc; + + if (name == 0) + name = "unknown hash table"; + + fprintf (stderr, "%s: %d buckets; %d items\n", name, table->nbuckets, table->nentries); + + /* Print out a count of how many strings hashed to each bucket, so we can + see how even the distribution is. */ + for (slot = 0; slot < table->nbuckets; slot++) + { + bc = hash_items (slot, table); + + fprintf (stderr, "\tslot %3d: ", slot); + for (bcount = 0; bc; bc = bc->next) + bcount++; + + fprintf (stderr, "%d\n", bcount); + } +} +#endif + +#ifdef TEST_HASHING + +/* link with xmalloc.o and lib/malloc/libmalloc.a */ +#undef NULL +#include + +#ifndef NULL +#define NULL 0 +#endif + +HASH_TABLE *table, *ntable; + +int interrupt_immediately = 0; + +int +signal_is_trapped (s) + int s; +{ + return (0); +} + +void +programming_error (const char *format, ...) +{ + abort(); +} + +void +fatal_error (const char *format, ...) +{ + abort(); +} + +main () +{ + char string[256]; + int count = 0; + BUCKET_CONTENTS *tt; + + table = hash_create (0); + + for (;;) + { + char *temp_string; + if (fgets (string, sizeof (string), stdin) == 0) + break; + if (!*string) + break; + temp_string = savestring (string); + tt = hash_insert (temp_string, table, 0); + if (tt->times_found) + { + fprintf (stderr, "You have already added item `%s'\n", string); + free (temp_string); + } + else + { + count++; + } + } + + hash_pstats (table, "hash test"); + + ntable = hash_copy (table, (sh_string_func_t *)NULL); + hash_flush (table, (sh_free_func_t *)NULL); + hash_pstats (ntable, "hash copy test"); + + exit (0); +} + +#endif /* TEST_HASHING */ diff --git a/hashlib.h b/hashlib.h new file mode 100644 index 0000000..4620e42 --- /dev/null +++ b/hashlib.h @@ -0,0 +1,92 @@ +/* hashlib.h -- the data structures used in hashing in Bash. */ + +/* Copyright (C) 1993-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_HASHLIB_H_) +#define _HASHLIB_H_ + +#include "stdc.h" + +#ifndef PTR_T +# ifdef __STDC__ +# define PTR_T void * +# else +# define PTR_T char * +# endif +#endif + +typedef struct bucket_contents { + struct bucket_contents *next; /* Link to next hashed key in this bucket. */ + char *key; /* What we look up. */ + PTR_T data; /* What we really want. */ + unsigned int khash; /* What key hashes to */ + int times_found; /* Number of times this item has been found. */ +} BUCKET_CONTENTS; + +typedef struct hash_table { + BUCKET_CONTENTS **bucket_array; /* Where the data is kept. */ + int nbuckets; /* How many buckets does this table have. */ + int nentries; /* How many entries does this table have. */ +} HASH_TABLE; + +typedef int hash_wfunc __P((BUCKET_CONTENTS *)); + +/* Operations on tables as a whole */ +extern HASH_TABLE *hash_create __P((int)); +extern HASH_TABLE *hash_copy __P((HASH_TABLE *, sh_string_func_t *)); +extern void hash_flush __P((HASH_TABLE *, sh_free_func_t *)); +extern void hash_dispose __P((HASH_TABLE *)); +extern void hash_walk __P((HASH_TABLE *, hash_wfunc *)); + +/* Operations to extract information from or pieces of tables */ +extern int hash_bucket __P((const char *, HASH_TABLE *)); +extern int hash_size __P((HASH_TABLE *)); + +/* Operations on hash table entries */ +extern BUCKET_CONTENTS *hash_search __P((const char *, HASH_TABLE *, int)); +extern BUCKET_CONTENTS *hash_insert __P((char *, HASH_TABLE *, int)); +extern BUCKET_CONTENTS *hash_remove __P((const char *, HASH_TABLE *, int)); + +/* Miscellaneous */ +extern unsigned int hash_string __P((const char *)); + +/* Redefine the function as a macro for speed. */ +#define hash_items(bucket, table) \ + ((table && (bucket < table->nbuckets)) ? \ + table->bucket_array[bucket] : \ + (BUCKET_CONTENTS *)NULL) + +/* Default number of buckets in the hash table. */ +#define DEFAULT_HASH_BUCKETS 64 /* was 107, then 53, must be power of two now */ + +#define HASH_ENTRIES(ht) ((ht) ? (ht)->nentries : 0) + +/* flags for hash_search and hash_insert */ +#define HASH_NOSRCH 0x01 +#define HASH_CREATE 0x02 + +#if !defined (NULL) +# if defined (__STDC__) +# define NULL ((void *) 0) +# else +# define NULL 0x0 +# endif /* !__STDC__ */ +#endif /* !NULL */ + +#endif /* _HASHLIB_H */ diff --git a/include/ansi_stdlib.h b/include/ansi_stdlib.h new file mode 100644 index 0000000..7dc2ee0 --- /dev/null +++ b/include/ansi_stdlib.h @@ -0,0 +1,54 @@ +/* ansi_stdlib.h -- An ANSI Standard stdlib.h. */ +/* A minimal stdlib.h containing extern declarations for those functions + that bash uses. */ + +/* Copyright (C) 1993 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_STDLIB_H_) +#define _STDLIB_H_ 1 + +/* String conversion functions. */ +extern int atoi (); + +extern double atof (); +extern double strtod (); + +/* Memory allocation functions. */ +/* Generic pointer type. */ +#ifndef PTR_T + +#if defined (__STDC__) +# define PTR_T void * +#else +# define PTR_T char * +#endif + +#endif /* PTR_T */ + +extern PTR_T malloc (); +extern PTR_T realloc (); +extern void free (); + +/* Other miscellaneous functions. */ +extern void abort (); +extern void exit (); +extern char *getenv (); +extern void qsort (); + +#endif /* _STDLIB_H */ diff --git a/include/chartypes.h b/include/chartypes.h new file mode 100644 index 0000000..c708018 --- /dev/null +++ b/include/chartypes.h @@ -0,0 +1,113 @@ +/* chartypes.h -- extend ctype.h */ + +/* Copyright (C) 2001 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _SH_CHARTYPES_H +#define _SH_CHARTYPES_H + +#include + +/* Jim Meyering writes: + + "... Some ctype macros are valid only for character codes that + isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when + using /bin/cc or gcc but without giving an ansi option). So, all + ctype uses should be through macros like ISPRINT... If + STDC_HEADERS is defined, then autoconf has verified that the ctype + macros don't need to be guarded with references to isascii. ... + Defining IN_CTYPE_DOMAIN to 1 should let any compiler worth its salt + eliminate the && through constant folding." + Solaris defines some of these symbols so we must undefine them first. */ + +#if STDC_HEADERS || (!defined (isascii) && !HAVE_ISASCII) +# define IN_CTYPE_DOMAIN(c) 1 +#else +# define IN_CTYPE_DOMAIN(c) isascii(c) +#endif + +#if !defined (isspace) && !defined (HAVE_ISSPACE) +# define isspace(c) ((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) == '\f') +#endif + +#if !defined (isprint) && !defined (HAVE_ISPRINT) +# define isprint(c) (isalpha(c) || isdigit(c) || ispunct(c)) +#endif + +#if defined (isblank) || defined (HAVE_ISBLANK) +# define ISBLANK(c) (IN_CTYPE_DOMAIN (c) && isblank (c)) +#else +# define ISBLANK(c) ((c) == ' ' || (c) == '\t') +#endif + +#if defined (isgraph) || defined (HAVE_ISGRAPH) +# define ISGRAPH(c) (IN_CTYPE_DOMAIN (c) && isgraph (c)) +#else +# define ISGRAPH(c) (IN_CTYPE_DOMAIN (c) && isprint (c) && !isspace (c)) +#endif + +#if !defined (isxdigit) && !defined (HAVE_ISXDIGIT) +# define isxdigit(c) (((c) >= '0' && (c) <= '9') || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F')) +#endif + +#undef ISPRINT + +#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c)) +#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (c)) +#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (c)) +#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c)) +#define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl (c)) +#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (c)) +#define ISPUNCT(c) (IN_CTYPE_DOMAIN (c) && ispunct (c)) +#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c)) +#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c)) +#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (c)) + +#define ISLETTER(c) (ISALPHA(c)) + +#define DIGIT(c) ((c) >= '0' && (c) <= '9') + +#define ISWORD(c) (ISLETTER(c) || DIGIT(c) || ((c) == '_')) + +#define HEXVALUE(c) \ + (((c) >= 'a' && (c) <= 'f') \ + ? (c)-'a'+10 \ + : (c) >= 'A' && (c) <= 'F' ? (c)-'A'+10 : (c)-'0') + +#ifndef ISOCTAL +# define ISOCTAL(c) ((c) >= '0' && (c) <= '7') +#endif +#define OCTVALUE(c) ((c) - '0') + +#define TODIGIT(c) ((c) - '0') +#define TOCHAR(c) ((c) + '0') + +#define TOLOWER(c) (ISUPPER(c) ? tolower(c) : (c)) +#define TOUPPER(c) (ISLOWER(c) ? toupper(c) : (c)) + +#ifndef TOCTRL + /* letter to control char -- ASCII. The TOUPPER is in there so \ce and + \cE will map to the same character in $'...' expansions. */ +# define TOCTRL(x) (TOUPPER(x) & 037) +#endif +#ifndef UNCTRL + /* control char to letter -- ASCII */ +# define UNCTRL(x) (TOUPPER(x) ^ 0x40) +#endif + +#endif /* _SH_CHARTYPES_H */ diff --git a/include/filecntl.h b/include/filecntl.h new file mode 100644 index 0000000..9bcbab8 --- /dev/null +++ b/include/filecntl.h @@ -0,0 +1,53 @@ +/* filecntl.h - Definitions to set file descriptors to close-on-exec. */ + +/* Copyright (C) 1993 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_FILECNTL_H_) +#define _FILECNTL_H_ + +#include + +/* Definitions to set file descriptors to close-on-exec, the Posix way. */ +#if !defined (FD_CLOEXEC) +#define FD_CLOEXEC 1 +#endif + +#define FD_NCLOEXEC 0 + +#define SET_CLOSE_ON_EXEC(fd) (fcntl ((fd), F_SETFD, FD_CLOEXEC)) +#define SET_OPEN_ON_EXEC(fd) (fcntl ((fd), F_SETFD, FD_NCLOEXEC)) + +/* How to open a file in non-blocking mode, the Posix.1 way. */ +#if !defined (O_NONBLOCK) +# if defined (O_NDELAY) +# define O_NONBLOCK O_NDELAY +# else +# define O_NONBLOCK 0 +# endif +#endif + +/* Make sure O_BINARY and O_TEXT are defined to avoid Windows-specific code. */ +#if !defined (O_BINARY) +# define O_BINARY 0 +#endif +#if !defined (O_TEXT) +# define O_TEXT 0 +#endif + +#endif /* ! _FILECNTL_H_ */ diff --git a/include/gettext.h b/include/gettext.h new file mode 100644 index 0000000..97a1f36 --- /dev/null +++ b/include/gettext.h @@ -0,0 +1,70 @@ +/* Convenience header for conditional use of GNU . + Copyright (C) 1995-1998, 2000-2002, 2008,2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne-Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _LIBGETTEXT_H +#define _LIBGETTEXT_H 1 + +/* NLS can be disabled through the configure --disable-nls option. */ +#if ENABLE_NLS + +/* Get declarations of GNU message catalog functions. */ +# include + +#else + +/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which + chokes if dcgettext is defined as a macro. So include it now, to make + later inclusions of a NOP. We don't include + as well because people using "gettext.h" will not include , + and also including would fail on SunOS 4, whereas + is OK. */ +#if defined(__sun) +# include +#endif + +/* Disabled NLS. + The casts to 'const char *' serve the purpose of producing warnings + for invalid uses of the value returned from these functions. + On pre-ANSI systems without 'const', the config.h file is supposed to + contain "#define const". */ +# define gettext(Msgid) ((const char *) (Msgid)) +# define dgettext(Domainname, Msgid) ((const char *) (Msgid)) +# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) +# define ngettext(Msgid1, Msgid2, N) \ + ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) +# define dngettext(Domainname, Msgid1, Msgid2, N) \ + ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) +# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ + ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) +# define textdomain(Domainname) ((const char *) (Domainname)) +# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) +# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) + +#endif + +/* A pseudo function call that serves as a marker for the automated + extraction of messages, but does not call gettext(). The run-time + translation is done at a different place in the code. + The argument, String, should be a literal string. Concatenated strings + and other string expressions won't work. + The macro's expansion is not parenthesized, so that it is suitable as + initializer for static 'char[]' or 'const char[]' variables. */ +#define gettext_noop(String) String + +#endif /* _LIBGETTEXT_H */ diff --git a/include/maxpath.h b/include/maxpath.h new file mode 100644 index 0000000..db2e1fb --- /dev/null +++ b/include/maxpath.h @@ -0,0 +1,75 @@ +/* maxpath.h - Find out what this system thinks PATH_MAX and NAME_MAX are. */ + +/* Copyright (C) 1993 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_MAXPATH_H_) +#define _MAXPATH_H_ + +/* These values are supposed to be in or one of the files + it includes. */ +#if defined (HAVE_LIMITS_H) +# include +#endif /* !HAVE_LIMITS_H */ + +/* If PATH_MAX is not defined, look for MAXPATHLEN */ +#if !defined (PATH_MAX) +# if defined (HAVE_SYS_PARAM_H) +# include +# define maxpath_param_h +# endif +# if defined (MAXPATHLEN) && !defined (PATH_MAX) +# define PATH_MAX MAXPATHLEN +# endif /* MAXPATHLEN && !PATH_MAX */ +#endif /* !PATH_MAX */ + +/* If NAME_MAX is not defined, look for MAXNAMLEN */ +#if !defined (NAME_MAX) +# if defined (HAVE_SYS_PARAM_H) && !defined (maxpath_param_h) +# include +# endif +# if defined (MAXNAMLEN) && !defined (NAME_MAX) +# define NAME_MAX MAXNAMLEN +# endif /* MAXNAMLEN && !NAME_MAX */ +#endif /* !NAME_MAX */ + +/* Default POSIX values */ +#if !defined (PATH_MAX) && defined (_POSIX_PATH_MAX) +# define PATH_MAX _POSIX_PATH_MAX +#endif + +#if !defined (NAME_MAX) && defined (_POSIX_NAME_MAX) +# define NAME_MAX _POSIX_NAME_MAX +#endif + + +/* Default values */ +#if !defined (PATH_MAX) +# define PATH_MAX 1024 +#endif + +#if !defined (NAME_MAX) +# define NAME_MAX 14 +#endif + +#if PATH_MAX < 1024 +# undef PATH_MAX +# define PATH_MAX 1024 +#endif + +#endif /* _MAXPATH_H_ */ diff --git a/include/memalloc.h b/include/memalloc.h new file mode 100644 index 0000000..57318b9 --- /dev/null +++ b/include/memalloc.h @@ -0,0 +1,62 @@ +/* memalloc.h -- consolidate code for including alloca.h or malloc.h and + defining alloca. */ + +/* Copyright (C) 1993 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_MEMALLOC_H_) +# define _MEMALLOC_H_ + +#if defined (sparc) && defined (sun) && !defined (HAVE_ALLOCA_H) +# define HAVE_ALLOCA_H +#endif + +#if defined (__GNUC__) && !defined (HAVE_ALLOCA) +# define HAVE_ALLOCA +#endif + +#if defined (HAVE_ALLOCA_H) && !defined (HAVE_ALLOCA) && !defined (C_ALLOCA) +# define HAVE_ALLOCA +#endif /* HAVE_ALLOCA_H && !HAVE_ALLOCA */ + +#if defined (__GNUC__) && !defined (C_ALLOCA) +# undef alloca +# define alloca __builtin_alloca +#else /* !__GNUC__ || C_ALLOCA */ +# if defined (HAVE_ALLOCA_H) && !defined (C_ALLOCA) +# if defined (IBMESA) +# include +# else /* !IBMESA */ +# include +# endif /* !IBMESA */ +# else /* !HAVE_ALLOCA_H || C_ALLOCA */ +# if defined (__hpux) && defined (__STDC__) && !defined (alloca) +extern void *alloca (); +# else +# if !defined (alloca) +# if defined (__STDC__) +extern void *alloca (size_t); +# else +extern char *alloca (); +# endif /* !__STDC__ */ +# endif /* !alloca */ +# endif /* !__hpux || !__STDC__ && !alloca */ +# endif /* !HAVE_ALLOCA_H || C_ALLOCA */ +#endif /* !__GNUC__ || C_ALLOCA */ + +#endif /* _MEMALLOC_H_ */ diff --git a/include/ocache.h b/include/ocache.h new file mode 100644 index 0000000..c596c27 --- /dev/null +++ b/include/ocache.h @@ -0,0 +1,133 @@ +/* ocache.h -- a minimal object caching implementation. */ + +/* Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_OCACHE_H_) +#define _OCACHE_H_ 1 + +#ifndef PTR_T + +#if defined (__STDC__) +# define PTR_T void * +#else +# define PTR_T char * +#endif + +#endif /* PTR_T */ + +#define OC_MEMSET(memp, xch, nbytes) \ +do { \ + if ((nbytes) <= 32) { \ + register char * mzp = (char *)(memp); \ + unsigned long mctmp = (nbytes); \ + register long mcn; \ + if (mctmp < 8) mcn = 0; else { mcn = (mctmp-1)/8; mctmp &= 7; } \ + switch (mctmp) { \ + case 0: for(;;) { *mzp++ = xch; \ + case 7: *mzp++ = xch; \ + case 6: *mzp++ = xch; \ + case 5: *mzp++ = xch; \ + case 4: *mzp++ = xch; \ + case 3: *mzp++ = xch; \ + case 2: *mzp++ = xch; \ + case 1: *mzp++ = xch; if(mcn <= 0) break; mcn--; } \ + } \ + } else \ + memset ((memp), (xch), (nbytes)); \ +} while(0) + +typedef struct objcache { + PTR_T data; + int cs; /* cache size, number of objects */ + int nc; /* number of cache entries */ +} sh_obj_cache_t; + +/* Create an object cache C of N pointers to OTYPE. */ +#define ocache_create(c, otype, n) \ + do { \ + (c).data = xmalloc((n) * sizeof (otype *)); \ + (c).cs = (n); \ + (c).nc = 0; \ + } while (0) + +/* Destroy an object cache C. */ +#define ocache_destroy(c) \ + do { \ + if ((c).data) \ + xfree ((c).data); \ + (c).data = 0; \ + (c).cs = (c).nc = 0; \ + } while (0) + +/* Free all cached items, which are pointers to OTYPE, in object cache C. */ +#define ocache_flush(c, otype) \ + do { \ + while ((c).nc > 0) \ + xfree (((otype **)((c).data))[--(c).nc]); \ + } while (0) + +/* + * Allocate a new item of type pointer to OTYPE, using data from object + * cache C if any cached items exist, otherwise calling xmalloc. Return + * the object in R. + */ +#define ocache_alloc(c, otype, r) \ + do { \ + if ((c).nc > 0) { \ + (r) = (otype *)((otype **)((c).data))[--(c).nc]; \ + } else \ + (r) = (otype *)xmalloc (sizeof (otype)); \ + } while (0) + +/* + * Free an item R of type pointer to OTYPE, adding to object cache C if + * there is room and calling xfree if the cache is full. If R is added + * to the object cache, the contents are scrambled. + */ +#define ocache_free(c, otype, r) \ + do { \ + if ((c).nc < (c).cs) { \ + OC_MEMSET ((r), 0xdf, sizeof(otype)); \ + ((otype **)((c).data))[(c).nc++] = (r); \ + } else \ + xfree (r); \ + } while (0) + +/* + * One may declare and use an object cache as (for instance): + * + * sh_obj_cache_t wdcache = {0, 0, 0}; + * sh_obj_cache_t wlcache = {0, 0, 0}; + * + * ocache_create(wdcache, WORD_DESC, 30); + * ocache_create(wlcache, WORD_LIST, 30); + * + * WORD_DESC *wd; + * ocache_alloc (wdcache, WORD_DESC, wd); + * + * WORD_LIST *wl; + * ocache_alloc (wlcache, WORD_LIST, wl); + * + * ocache_free(wdcache, WORD_DESC, wd); + * ocache_free(wlcache, WORD_LIST, wl); + * + * The use is almost arbitrary. + */ + +#endif /* _OCACHE_H */ diff --git a/include/posixdir.h b/include/posixdir.h new file mode 100644 index 0000000..0921c5d --- /dev/null +++ b/include/posixdir.h @@ -0,0 +1,71 @@ +/* posixdir.h -- Posix directory reading includes and defines. */ + +/* Copyright (C) 1987,1991,2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* This file should be included instead of or . */ + +#if !defined (_POSIXDIR_H_) +#define _POSIXDIR_H_ + +#if defined (HAVE_DIRENT_H) +# include +# if defined (HAVE_STRUCT_DIRENT_D_NAMLEN) +# define D_NAMLEN(d) ((d)->d_namlen) +# else +# define D_NAMLEN(d) (strlen ((d)->d_name)) +# endif /* !HAVE_STRUCT_DIRENT_D_NAMLEN */ +#else +# if defined (HAVE_SYS_NDIR_H) +# include +# endif +# if defined (HAVE_SYS_DIR_H) +# include +# endif +# if defined (HAVE_NDIR_H) +# include +# endif +# if !defined (dirent) +# define dirent direct +# endif /* !dirent */ +# define D_NAMLEN(d) ((d)->d_namlen) +#endif /* !HAVE_DIRENT_H */ + +/* The bash code fairly consistenly uses d_fileno; make sure it's available */ +#if defined (HAVE_STRUCT_DIRENT_D_INO) && !defined (HAVE_STRUCT_DIRENT_D_FILENO) +# define d_fileno d_ino +#endif + +/* Posix does not require that the d_ino field be present, and some + systems do not provide it. */ +#if !defined (HAVE_STRUCT_DIRENT_D_INO) || defined (BROKEN_DIRENT_D_INO) +# define REAL_DIR_ENTRY(dp) 1 +#else +# define REAL_DIR_ENTRY(dp) (dp->d_ino != 0) +#endif /* _POSIX_SOURCE */ + +#if defined (HAVE_STRUCT_DIRENT_D_INO) && !defined (BROKEN_DIRENT_D_INO) +# define D_INO_AVAILABLE +#endif + +/* Signal the rest of the code that it can safely use dirent.d_fileno */ +#if defined (D_INO_AVAILABLE) || defined (HAVE_STRUCT_DIRENT_D_FILENO) +# define D_FILENO_AVAILABLE 1 +#endif + +#endif /* !_POSIXDIR_H_ */ diff --git a/include/posixjmp.h b/include/posixjmp.h new file mode 100644 index 0000000..98cf718 --- /dev/null +++ b/include/posixjmp.h @@ -0,0 +1,42 @@ +/* posixjmp.h -- wrapper for setjmp.h with changes for POSIX systems. */ + +/* Copyright (C) 1987,1991 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _POSIXJMP_H_ +#define _POSIXJMP_H_ + +#include + +/* This *must* be included *after* config.h */ + +#if defined (HAVE_POSIX_SIGSETJMP) +# define procenv_t sigjmp_buf +# if !defined (__OPENNT) +# undef setjmp +# define setjmp(x) sigsetjmp((x), 1) +# define setjmp_nosigs(x) sigsetjmp((x), 0) +# undef longjmp +# define longjmp(x, n) siglongjmp((x), (n)) +# endif /* !__OPENNT */ +#else +# define procenv_t jmp_buf +# define setjmp_nosigs setjmp +#endif + +#endif /* _POSIXJMP_H_ */ diff --git a/include/posixselect.h b/include/posixselect.h new file mode 100644 index 0000000..da6a1ac --- /dev/null +++ b/include/posixselect.h @@ -0,0 +1,47 @@ +/* posixselect.h -- wrapper for select(2) includes and definitions */ + +/* Copyright (C) 2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _POSIXSELECT_H_ +#define _POSIXSELECT_H_ + +#if defined (FD_SET) && !defined (HAVE_SELECT) +# define HAVE_SELECT 1 +#endif + +#if defined (HAVE_SELECT) +# if !defined (HAVE_SYS_SELECT_H) || !defined (M_UNIX) +# include +# endif +#endif /* HAVE_SELECT */ +#if defined (HAVE_SYS_SELECT_H) +# include +#endif + +#ifndef USEC_PER_SEC +# define USEC_PER_SEC 1000000 +#endif + +#define USEC_TO_TIMEVAL(us, tv) \ +do { \ + (tv).tv_sec = (us) / USEC_PER_SEC; \ + (tv).tv_usec = (us) % USEC_PER_SEC; \ +} while (0) + +#endif /* _POSIXSELECT_H_ */ diff --git a/include/posixstat.h b/include/posixstat.h new file mode 100644 index 0000000..3eb7f29 --- /dev/null +++ b/include/posixstat.h @@ -0,0 +1,142 @@ +/* posixstat.h -- Posix stat(2) definitions for systems that + don't have them. */ + +/* Copyright (C) 1987,1991 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* This file should be included instead of . + It relies on the local sys/stat.h to work though. */ +#if !defined (_POSIXSTAT_H_) +#define _POSIXSTAT_H_ + +#include + +#if defined (STAT_MACROS_BROKEN) +# undef S_ISBLK +# undef S_ISCHR +# undef S_ISDIR +# undef S_ISFIFO +# undef S_ISREG +# undef S_ISLNK +#endif /* STAT_MACROS_BROKEN */ + +/* These are guaranteed to work only on isc386 */ +#if !defined (S_IFDIR) && !defined (S_ISDIR) +# define S_IFDIR 0040000 +#endif /* !S_IFDIR && !S_ISDIR */ +#if !defined (S_IFMT) +# define S_IFMT 0170000 +#endif /* !S_IFMT */ + +/* Posix 1003.1 5.6.1.1 file types */ + +/* Some Posix-wannabe systems define _S_IF* macros instead of S_IF*, but + do not provide the S_IS* macros that Posix requires. */ + +#if defined (_S_IFMT) && !defined (S_IFMT) +#define S_IFMT _S_IFMT +#endif +#if defined (_S_IFIFO) && !defined (S_IFIFO) +#define S_IFIFO _S_IFIFO +#endif +#if defined (_S_IFCHR) && !defined (S_IFCHR) +#define S_IFCHR _S_IFCHR +#endif +#if defined (_S_IFDIR) && !defined (S_IFDIR) +#define S_IFDIR _S_IFDIR +#endif +#if defined (_S_IFBLK) && !defined (S_IFBLK) +#define S_IFBLK _S_IFBLK +#endif +#if defined (_S_IFREG) && !defined (S_IFREG) +#define S_IFREG _S_IFREG +#endif +#if defined (_S_IFLNK) && !defined (S_IFLNK) +#define S_IFLNK _S_IFLNK +#endif +#if defined (_S_IFSOCK) && !defined (S_IFSOCK) +#define S_IFSOCK _S_IFSOCK +#endif + +/* Test for each symbol individually and define the ones necessary (some + systems claiming Posix compatibility define some but not all). */ + +#if defined (S_IFBLK) && !defined (S_ISBLK) +#define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK) /* block device */ +#endif + +#if defined (S_IFCHR) && !defined (S_ISCHR) +#define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR) /* character device */ +#endif + +#if defined (S_IFDIR) && !defined (S_ISDIR) +#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) /* directory */ +#endif + +#if defined (S_IFREG) && !defined (S_ISREG) +#define S_ISREG(m) (((m)&S_IFMT) == S_IFREG) /* file */ +#endif + +#if defined (S_IFIFO) && !defined (S_ISFIFO) +#define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO) /* fifo - named pipe */ +#endif + +#if defined (S_IFLNK) && !defined (S_ISLNK) +#define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK) /* symbolic link */ +#endif + +#if defined (S_IFSOCK) && !defined (S_ISSOCK) +#define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK) /* socket */ +#endif + +/* + * POSIX 1003.1 5.6.1.2 File Modes + */ + +#if !defined (S_IRWXU) +# if !defined (S_IREAD) +# define S_IREAD 00400 +# define S_IWRITE 00200 +# define S_IEXEC 00100 +# endif /* S_IREAD */ + +# if !defined (S_IRUSR) +# define S_IRUSR S_IREAD /* read, owner */ +# define S_IWUSR S_IWRITE /* write, owner */ +# define S_IXUSR S_IEXEC /* execute, owner */ + +# define S_IRGRP (S_IREAD >> 3) /* read, group */ +# define S_IWGRP (S_IWRITE >> 3) /* write, group */ +# define S_IXGRP (S_IEXEC >> 3) /* execute, group */ + +# define S_IROTH (S_IREAD >> 6) /* read, other */ +# define S_IWOTH (S_IWRITE >> 6) /* write, other */ +# define S_IXOTH (S_IEXEC >> 6) /* execute, other */ +# endif /* !S_IRUSR */ + +# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) +# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) +# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) +#endif /* !S_IRWXU */ + +/* These are non-standard, but are used in builtins.c$symbolic_umask() */ +#define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH) +#define S_IWUGO (S_IWUSR | S_IWGRP | S_IWOTH) +#define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) + +#endif /* _POSIXSTAT_H_ */ diff --git a/include/posixtime.h b/include/posixtime.h new file mode 100644 index 0000000..31bdddf --- /dev/null +++ b/include/posixtime.h @@ -0,0 +1,49 @@ +/* posixtime.h -- wrapper for time.h, sys/times.h mess. */ + +/* Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _POSIXTIME_H_ +#define _POSIXTIME_H_ + +/* include this after config.h */ +/* Some systems require this, mostly for the definition of `struct timezone'. + For example, Dynix/ptx has that definition in rather than + sys/time.h */ +#if defined (TIME_WITH_SYS_TIME) +# include +# include +#else +# if defined (HAVE_SYS_TIME_H) +# include +# else +# include +# endif +#endif + +#if !defined (HAVE_SYSCONF) || !defined (_SC_CLK_TCK) +# if !defined (CLK_TCK) +# if defined (HZ) +# define CLK_TCK HZ +# else +# define CLK_TCK 60 /* 60HZ */ +# endif +# endif /* !CLK_TCK */ +#endif /* !HAVE_SYSCONF && !_SC_CLK_TCK */ + +#endif /* _POSIXTIME_H_ */ diff --git a/include/posixwait.h b/include/posixwait.h new file mode 100644 index 0000000..815ea22 --- /dev/null +++ b/include/posixwait.h @@ -0,0 +1,103 @@ +/* posixwait.h -- job control definitions from POSIX 1003.1 */ + +/* Copyright (C) 1997 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_POSIXWAIT_H_) +# define _POSIXWAIT_H_ + +/* If _POSIX_VERSION is not defined, we assume that defines + a `union wait' and various macros used to manipulate it. Look in + unionwait.h for the things we expect to find. */ +#if defined (HAVE_SYS_WAIT_H) +# include +#else /* !HAVE_SYS_WAIT_H */ +# if !defined (_POSIX_VERSION) +# include "unionwait.h" +# endif +#endif /* !HAVE_SYS_WAIT_H */ + +/* How to get the status of a job. For Posix, this is just an + int, but for other systems we have to crack the union wait. */ +#if !defined (_POSIX_VERSION) +typedef union wait WAIT; +# define WSTATUS(t) (t.w_status) +#else /* _POSIX_VERSION */ +typedef int WAIT; +# define WSTATUS(t) (t) +#endif /* _POSIX_VERSION */ + +/* Make sure that parameters to wait3 are defined. */ +#if !defined (WNOHANG) +# define WNOHANG 1 +# define WUNTRACED 2 +#endif /* WNOHANG */ + +/* More Posix P1003.1 definitions. In the POSIX versions, the parameter is + passed as an `int', in the non-POSIX version, as `union wait'. */ +#if defined (_POSIX_VERSION) + +# if !defined (WSTOPSIG) +# define WSTOPSIG(s) ((s) >> 8) +# endif /* !WSTOPSIG */ + +# if !defined (WTERMSIG) +# define WTERMSIG(s) ((s) & 0177) +# endif /* !WTERMSIG */ + +# if !defined (WEXITSTATUS) +# define WEXITSTATUS(s) ((s) >> 8) +# endif /* !WEXITSTATUS */ + +# if !defined (WIFSTOPPED) +# define WIFSTOPPED(s) (((s) & 0177) == 0177) +# endif /* !WIFSTOPPED */ + +# if !defined (WIFEXITED) +# define WIFEXITED(s) (((s) & 0377) == 0) +# endif /* !WIFEXITED */ + +# if !defined (WIFSIGNALED) +# define WIFSIGNALED(s) (!WIFSTOPPED(s) && !WIFEXITED(s)) +# endif /* !WIFSIGNALED */ + +# if !defined (WIFCORED) +# define WIFCORED(s) ((s) & 0200) +# endif /* !WIFCORED */ + +#else /* !_POSIX_VERSION */ + +# if !defined (WSTOPSIG) +# define WSTOPSIG(s) ((s).w_stopsig) +# endif /* !WSTOPSIG */ + +# if !defined (WTERMSIG) +# define WTERMSIG(s) ((s).w_termsig) +# endif /* !WTERMSIG */ + +# if !defined (WEXITSTATUS) +# define WEXITSTATUS(s) ((s).w_retcode) +# endif /* !WEXITSTATUS */ + +# if !defined (WIFCORED) +# define WIFCORED(s) ((s).w_coredump) +# endif /* !WIFCORED */ + +#endif /* !_POSIX_VERSION */ + +#endif /* !_POSIXWAIT_H_ */ diff --git a/include/shmbchar.h b/include/shmbchar.h new file mode 100644 index 0000000..a475f56 --- /dev/null +++ b/include/shmbchar.h @@ -0,0 +1,353 @@ +/* Multibyte character data type. + Copyright (C) 2001, 2005-2007, 2009-2010 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Bruno Haible . */ + +/* A multibyte character is a short subsequence of a char* string, + representing a single wide character. + + We use multibyte characters instead of wide characters because of + the following goals: + 1) correct multibyte handling, i.e. operate according to the LC_CTYPE + locale, + 2) ease of maintenance, i.e. the maintainer needs not know all details + of the ISO C 99 standard, + 3) don't fail grossly if the input is not in the encoding set by the + locale, because often different encodings are in use in the same + countries (ISO-8859-1/UTF-8, EUC-JP/Shift_JIS, ...), + 4) fast in the case of ASCII characters, + 5) portability, i.e. don't make unportable assumptions about wchar_t. + + Multibyte characters are only accessed through the mb* macros. + + mb_ptr (mbc) + return a pointer to the beginning of the multibyte sequence. + + mb_len (mbc) + returns the number of bytes occupied by the multibyte sequence. + Always > 0. + + mb_iseq (mbc, sc) + returns true if mbc is the standard ASCII character sc. + + mb_isnul (mbc) + returns true if mbc is the nul character. + + mb_cmp (mbc1, mbc2) + returns a positive, zero, or negative value depending on whether mbc1 + sorts after, same or before mbc2. + + mb_casecmp (mbc1, mbc2) + returns a positive, zero, or negative value depending on whether mbc1 + sorts after, same or before mbc2, modulo upper/lowercase conversion. + + mb_equal (mbc1, mbc2) + returns true if mbc1 and mbc2 are equal. + + mb_caseequal (mbc1, mbc2) + returns true if mbc1 and mbc2 are equal modulo upper/lowercase conversion. + + mb_isalnum (mbc) + returns true if mbc is alphanumeric. + + mb_isalpha (mbc) + returns true if mbc is alphabetic. + + mb_isascii(mbc) + returns true if mbc is plain ASCII. + + mb_isblank (mbc) + returns true if mbc is a blank. + + mb_iscntrl (mbc) + returns true if mbc is a control character. + + mb_isdigit (mbc) + returns true if mbc is a decimal digit. + + mb_isgraph (mbc) + returns true if mbc is a graphic character. + + mb_islower (mbc) + returns true if mbc is lowercase. + + mb_isprint (mbc) + returns true if mbc is a printable character. + + mb_ispunct (mbc) + returns true if mbc is a punctuation character. + + mb_isspace (mbc) + returns true if mbc is a space character. + + mb_isupper (mbc) + returns true if mbc is uppercase. + + mb_isxdigit (mbc) + returns true if mbc is a hexadecimal digit. + + mb_width (mbc) + returns the number of columns on the output device occupied by mbc. + Always >= 0. + + mb_putc (mbc, stream) + outputs mbc on stream, a byte oriented FILE stream opened for output. + + mb_setascii (&mbc, sc) + assigns the standard ASCII character sc to mbc. + + mb_copy (&destmbc, &srcmbc) + copies srcmbc to destmbc. + + Here are the function prototypes of the macros. + + typedef int bool; + extern const char * mb_ptr (const mbchar_t mbc); + extern size_t mb_len (const mbchar_t mbc); + extern bool mb_iseq (const mbchar_t mbc, char sc); + extern bool mb_isnul (const mbchar_t mbc); + extern int mb_cmp (const mbchar_t mbc1, const mbchar_t mbc2); + extern int mb_casecmp (const mbchar_t mbc1, const mbchar_t mbc2); + extern bool mb_equal (const mbchar_t mbc1, const mbchar_t mbc2); + extern bool mb_caseequal (const mbchar_t mbc1, const mbchar_t mbc2); + extern bool mb_isalnum (const mbchar_t mbc); + extern bool mb_isalpha (const mbchar_t mbc); + extern bool mb_isascii (const mbchar_t mbc); + extern bool mb_isblank (const mbchar_t mbc); + extern bool mb_iscntrl (const mbchar_t mbc); + extern bool mb_isdigit (const mbchar_t mbc); + extern bool mb_isgraph (const mbchar_t mbc); + extern bool mb_islower (const mbchar_t mbc); + extern bool mb_isprint (const mbchar_t mbc); + extern bool mb_ispunct (const mbchar_t mbc); + extern bool mb_isspace (const mbchar_t mbc); + extern bool mb_isupper (const mbchar_t mbc); + extern bool mb_isxdigit (const mbchar_t mbc); + extern int mb_width (const mbchar_t mbc); + extern void mb_putc (const mbchar_t mbc, FILE *stream); + extern void mb_setascii (mbchar_t *new, char sc); + extern void mb_copy (mbchar_t *new, const mbchar_t *old); + */ + +#ifndef _SHMBCHAR_H +#define _SHMBCHAR_H 1 + +#if defined (HANDLE_MULTIBYTE) + +#include + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.1 has a bug: and must be included before + . */ +#include +#include +#include +#include + +#define MBCHAR_BUF_SIZE 24 + +struct mbchar +{ + const char *ptr; /* pointer to current character */ + size_t bytes; /* number of bytes of current character, > 0 */ + int wc_valid; /* true if wc is a valid wide character */ + wchar_t wc; /* if wc_valid: the current character */ + char buf[MBCHAR_BUF_SIZE]; /* room for the bytes, used for file input only */ +}; + +/* EOF (not a real character) is represented with bytes = 0 and + wc_valid = false. */ + +typedef struct mbchar mbchar_t; + +/* Access the current character. */ +#define mb_ptr(mbc) ((mbc).ptr) +#define mb_len(mbc) ((mbc).bytes) + +/* Comparison of characters. */ +#define mb_iseq(mbc, sc) ((mbc).wc_valid && (mbc).wc == (sc)) +#define mb_isnul(mbc) ((mbc).wc_valid && (mbc).wc == 0) +#define mb_cmp(mbc1, mbc2) \ + ((mbc1).wc_valid \ + ? ((mbc2).wc_valid \ + ? (int) (mbc1).wc - (int) (mbc2).wc \ + : -1) \ + : ((mbc2).wc_valid \ + ? 1 \ + : (mbc1).bytes == (mbc2).bytes \ + ? memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) \ + : (mbc1).bytes < (mbc2).bytes \ + ? (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) > 0 ? 1 : -1) \ + : (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc2).bytes) >= 0 ? 1 : -1))) +#define mb_casecmp(mbc1, mbc2) \ + ((mbc1).wc_valid \ + ? ((mbc2).wc_valid \ + ? (int) towlower ((mbc1).wc) - (int) towlower ((mbc2).wc) \ + : -1) \ + : ((mbc2).wc_valid \ + ? 1 \ + : (mbc1).bytes == (mbc2).bytes \ + ? memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) \ + : (mbc1).bytes < (mbc2).bytes \ + ? (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) > 0 ? 1 : -1) \ + : (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc2).bytes) >= 0 ? 1 : -1))) +#define mb_equal(mbc1, mbc2) \ + ((mbc1).wc_valid && (mbc2).wc_valid \ + ? (mbc1).wc == (mbc2).wc \ + : (mbc1).bytes == (mbc2).bytes \ + && memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) == 0) +#define mb_caseequal(mbc1, mbc2) \ + ((mbc1).wc_valid && (mbc2).wc_valid \ + ? towlower ((mbc1).wc) == towlower ((mbc2).wc) \ + : (mbc1).bytes == (mbc2).bytes \ + && memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) == 0) + +/* , classification. */ +#define mb_isascii(mbc) \ + ((mbc).wc_valid && (mbc).wc >= 0 && (mbc).wc <= 127) +#define mb_isalnum(mbc) ((mbc).wc_valid && iswalnum ((mbc).wc)) +#define mb_isalpha(mbc) ((mbc).wc_valid && iswalpha ((mbc).wc)) +#define mb_isblank(mbc) ((mbc).wc_valid && iswblank ((mbc).wc)) +#define mb_iscntrl(mbc) ((mbc).wc_valid && iswcntrl ((mbc).wc)) +#define mb_isdigit(mbc) ((mbc).wc_valid && iswdigit ((mbc).wc)) +#define mb_isgraph(mbc) ((mbc).wc_valid && iswgraph ((mbc).wc)) +#define mb_islower(mbc) ((mbc).wc_valid && iswlower ((mbc).wc)) +#define mb_isprint(mbc) ((mbc).wc_valid && iswprint ((mbc).wc)) +#define mb_ispunct(mbc) ((mbc).wc_valid && iswpunct ((mbc).wc)) +#define mb_isspace(mbc) ((mbc).wc_valid && iswspace ((mbc).wc)) +#define mb_isupper(mbc) ((mbc).wc_valid && iswupper ((mbc).wc)) +#define mb_isxdigit(mbc) ((mbc).wc_valid && iswxdigit ((mbc).wc)) + +/* Extra function. */ + +/* Unprintable characters appear as a small box of width 1. */ +#define MB_UNPRINTABLE_WIDTH 1 + +static inline int +mb_width_aux (wint_t wc) +{ + int w = wcwidth (wc); + /* For unprintable characters, arbitrarily return 0 for control characters + and MB_UNPRINTABLE_WIDTH otherwise. */ + return (w >= 0 ? w : iswcntrl (wc) ? 0 : MB_UNPRINTABLE_WIDTH); +} + +#define mb_width(mbc) \ + ((mbc).wc_valid ? mb_width_aux ((mbc).wc) : MB_UNPRINTABLE_WIDTH) + +/* Output. */ +#define mb_putc(mbc, stream) fwrite ((mbc).ptr, 1, (mbc).bytes, (stream)) + +/* Assignment. */ +#define mb_setascii(mbc, sc) \ + ((mbc)->ptr = (mbc)->buf, (mbc)->bytes = 1, (mbc)->wc_valid = 1, \ + (mbc)->wc = (mbc)->buf[0] = (sc)) + +/* Copying a character. */ +static inline void +mb_copy (mbchar_t *new_mbc, const mbchar_t *old_mbc) +{ + if (old_mbc->ptr == &old_mbc->buf[0]) + { + memcpy (&new_mbc->buf[0], &old_mbc->buf[0], old_mbc->bytes); + new_mbc->ptr = &new_mbc->buf[0]; + } + else + new_mbc->ptr = old_mbc->ptr; + new_mbc->bytes = old_mbc->bytes; + if ((new_mbc->wc_valid = old_mbc->wc_valid)) + new_mbc->wc = old_mbc->wc; +} + + +/* is_basic(c) tests whether the single-byte character c is in the + ISO C "basic character set". + This is a convenience function, and is in this file only to share code + between mbiter_multi.h and mbfile_multi.h. */ +#if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126) +/* The character set is ISO-646, not EBCDIC. */ +# define IS_BASIC_ASCII 1 + +extern const unsigned int is_basic_table[]; + +static inline int +is_basic (char c) +{ + return (is_basic_table [(unsigned char) c >> 5] >> ((unsigned char) c & 31)) + & 1; +} + +#else + +static inline int +is_basic (char c) +{ + switch (c) + { + case '\t': case '\v': case '\f': + case ' ': case '!': case '"': case '#': case '%': + case '&': case '\'': case '(': case ')': case '*': + case '+': case ',': case '-': case '.': case '/': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + case ':': case ';': case '<': case '=': case '>': + case '?': + case 'A': case 'B': case 'C': case 'D': case 'E': + case 'F': case 'G': case 'H': case 'I': case 'J': + case 'K': case 'L': case 'M': case 'N': case 'O': + case 'P': case 'Q': case 'R': case 'S': case 'T': + case 'U': case 'V': case 'W': case 'X': case 'Y': + case 'Z': + case '[': case '\\': case ']': case '^': case '_': + case 'a': case 'b': case 'c': case 'd': case 'e': + case 'f': case 'g': case 'h': case 'i': case 'j': + case 'k': case 'l': case 'm': case 'n': case 'o': + case 'p': case 'q': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': case 'y': + case 'z': case '{': case '|': case '}': case '~': + return 1; + default: + return 0; + } +} + +#endif + +#endif /* HANDLE_MULTIBYTE */ +#endif /* _SHMBCHAR_H */ diff --git a/include/shmbutil.h b/include/shmbutil.h new file mode 100644 index 0000000..afb381a --- /dev/null +++ b/include/shmbutil.h @@ -0,0 +1,503 @@ +/* shmbutil.h -- utility functions for multibyte characters. */ + +/* Copyright (C) 2002-2004 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_SH_MBUTIL_H_) +#define _SH_MBUTIL_H_ + +#include "stdc.h" + +/* Include config.h for HANDLE_MULTIBYTE */ +#include + +#if defined (HANDLE_MULTIBYTE) +#include "shmbchar.h" + +extern size_t xmbsrtowcs __P((wchar_t *, const char **, size_t, mbstate_t *)); +extern size_t xdupmbstowcs __P((wchar_t **, char ***, const char *)); + +extern size_t mbstrlen __P((const char *)); + +extern char *xstrchr __P((const char *, int)); + +extern int locale_mb_cur_max; /* XXX */ + +#ifndef MB_INVALIDCH +#define MB_INVALIDCH(x) ((x) == (size_t)-1 || (x) == (size_t)-2) +#define MB_NULLWCH(x) ((x) == 0) +#endif + +#define MBSLEN(s) (((s) && (s)[0]) ? ((s)[1] ? mbstrlen (s) : 1) : 0) +#define MB_STRLEN(s) ((MB_CUR_MAX > 1) ? MBSLEN (s) : STRLEN (s)) + +#define MBLEN(s, n) ((MB_CUR_MAX > 1) ? mblen ((s), (n)) : 1) +#define MBRLEN(s, n, p) ((MB_CUR_MAX > 1) ? mbrlen ((s), (n), (p)) : 1) + +#else /* !HANDLE_MULTIBYTE */ + +#undef MB_LEN_MAX +#undef MB_CUR_MAX + +#define MB_LEN_MAX 1 +#define MB_CUR_MAX 1 + +#undef xstrchr +#define xstrchr(s, c) strchr(s, c) + +#ifndef MB_INVALIDCH +#define MB_INVALIDCH(x) (0) +#define MB_NULLWCH(x) (0) +#endif + +#define MB_STRLEN(s) (STRLEN(s)) + +#define MBLEN(s, n) 1 +#define MBRLEN(s, n, p) 1 + +#ifndef wchar_t +# define wchar_t int +#endif + +#endif /* !HANDLE_MULTIBYTE */ + +/* Declare and initialize a multibyte state. Call must be terminated + with `;'. */ +#if defined (HANDLE_MULTIBYTE) +# define DECLARE_MBSTATE \ + mbstate_t state; \ + memset (&state, '\0', sizeof (mbstate_t)) +#else +# define DECLARE_MBSTATE +#endif /* !HANDLE_MULTIBYTE */ + +/* Initialize or reinitialize a multibyte state named `state'. Call must be + terminated with `;'. */ +#if defined (HANDLE_MULTIBYTE) +# define INITIALIZE_MBSTATE memset (&state, '\0', sizeof (mbstate_t)) +#else +# define INITIALIZE_MBSTATE +#endif /* !HANDLE_MULTIBYTE */ + +/* Advance one (possibly multi-byte) character in string _STR of length + _STRSIZE, starting at index _I. STATE must have already been declared. */ +#if defined (HANDLE_MULTIBYTE) +# define ADVANCE_CHAR(_str, _strsize, _i) \ + do \ + { \ + if (locale_mb_cur_max > 1) \ + { \ + mbstate_t state_bak; \ + size_t mblength; \ + int _f; \ +\ + _f = is_basic ((_str)[_i]); \ + if (_f) \ + mblength = 1; \ + else \ + { \ + state_bak = state; \ + mblength = mbrlen ((_str) + (_i), (_strsize) - (_i), &state); \ + } \ +\ + if (mblength == (size_t)-2 || mblength == (size_t)-1) \ + { \ + state = state_bak; \ + (_i)++; \ + } \ + else if (mblength == 0) \ + (_i)++; \ + else \ + (_i) += mblength; \ + } \ + else \ + (_i)++; \ + } \ + while (0) +#else +# define ADVANCE_CHAR(_str, _strsize, _i) (_i)++ +#endif /* !HANDLE_MULTIBYTE */ + +/* Advance one (possibly multibyte) character in the string _STR of length + _STRSIZE. + SPECIAL: assume that _STR will be incremented by 1 after this call. */ +#if defined (HANDLE_MULTIBYTE) +# define ADVANCE_CHAR_P(_str, _strsize) \ + do \ + { \ + if (locale_mb_cur_max > 1) \ + { \ + mbstate_t state_bak; \ + size_t mblength; \ + int _f; \ +\ + _f = is_basic (*(_str)); \ + if (_f) \ + mblength = 1; \ + else \ + { \ + state_bak = state; \ + mblength = mbrlen ((_str), (_strsize), &state); \ + } \ +\ + if (mblength == (size_t)-2 || mblength == (size_t)-1) \ + { \ + state = state_bak; \ + mblength = 1; \ + } \ + else \ + (_str) += (mblength < 1) ? 0 : (mblength - 1); \ + } \ + } \ + while (0) +#else +# define ADVANCE_CHAR_P(_str, _strsize) +#endif /* !HANDLE_MULTIBYTE */ + +/* Back up one (possibly multi-byte) character in string _STR of length + _STRSIZE, starting at index _I. STATE must have already been declared. */ +#if defined (HANDLE_MULTIBYTE) +# define BACKUP_CHAR(_str, _strsize, _i) \ + do \ + { \ + if (locale_mb_cur_max > 1) \ + { \ + mbstate_t state_bak; \ + size_t mblength; \ + int _x, _p; /* _x == temp index into string, _p == prev index */ \ +\ + _x = _p = 0; \ + while (_x < (_i)) \ + { \ + state_bak = state; \ + mblength = mbrlen ((_str) + (_x), (_strsize) - (_x), &state); \ +\ + if (mblength == (size_t)-2 || mblength == (size_t)-1) \ + { \ + state = state_bak; \ + _x++; \ + } \ + else if (mblength == 0) \ + _x++; \ + else \ + { \ + _p = _x; /* _p == start of prev mbchar */ \ + _x += mblength; \ + } \ + } \ + (_i) = _p; \ + } \ + else \ + (_i)--; \ + } \ + while (0) +#else +# define BACKUP_CHAR(_str, _strsize, _i) (_i)-- +#endif /* !HANDLE_MULTIBYTE */ + +/* Back up one (possibly multibyte) character in the string _BASE of length + _STRSIZE starting at _STR (_BASE <= _STR <= (_BASE + _STRSIZE) ). + SPECIAL: DO NOT assume that _STR will be decremented by 1 after this call. */ +#if defined (HANDLE_MULTIBYTE) +# define BACKUP_CHAR_P(_base, _strsize, _str) \ + do \ + { \ + if (locale_mb_cur_max > 1) \ + { \ + mbstate_t state_bak; \ + size_t mblength; \ + char *_x, _p; /* _x == temp pointer into string, _p == prev pointer */ \ +\ + _x = _p = _base; \ + while (_x < (_str)) \ + { \ + state_bak = state; \ + mblength = mbrlen (_x, (_strsize) - _x, &state); \ +\ + if (mblength == (size_t)-2 || mblength == (size_t)-1) \ + { \ + state = state_bak; \ + _x++; \ + } \ + else if (mblength == 0) \ + _x++; \ + else \ + { \ + _p = _x; /* _p == start of prev mbchar */ \ + _x += mblength; \ + } \ + } \ + (_str) = _p; \ + } \ + else \ + (_str)--; \ + } \ + while (0) +#else +# define BACKUP_CHAR_P(_base, _strsize, _str) (_str)-- +#endif /* !HANDLE_MULTIBYTE */ + +/* Copy a single character from the string _SRC to the string _DST. + _SRCEND is a pointer to the end of _SRC. */ +#if defined (HANDLE_MULTIBYTE) +# define COPY_CHAR_P(_dst, _src, _srcend) \ + do \ + { \ + if (locale_mb_cur_max > 1) \ + { \ + mbstate_t state_bak; \ + size_t mblength; \ + int _k; \ +\ + _k = is_basic (*(_src)); \ + if (_k) \ + mblength = 1; \ + else \ + { \ + state_bak = state; \ + mblength = mbrlen ((_src), (_srcend) - (_src), &state); \ + } \ + if (mblength == (size_t)-2 || mblength == (size_t)-1) \ + { \ + state = state_bak; \ + mblength = 1; \ + } \ + else \ + mblength = (mblength < 1) ? 1 : mblength; \ +\ + for (_k = 0; _k < mblength; _k++) \ + *(_dst)++ = *(_src)++; \ + } \ + else \ + *(_dst)++ = *(_src)++; \ + } \ + while (0) +#else +# define COPY_CHAR_P(_dst, _src, _srcend) *(_dst)++ = *(_src)++ +#endif /* !HANDLE_MULTIBYTE */ + +/* Copy a single character from the string _SRC at index _SI to the string + _DST at index _DI. _SRCEND is a pointer to the end of _SRC. */ +#if defined (HANDLE_MULTIBYTE) +# define COPY_CHAR_I(_dst, _di, _src, _srcend, _si) \ + do \ + { \ + if (locale_mb_cur_max > 1) \ + { \ + mbstate_t state_bak; \ + size_t mblength; \ + int _k; \ +\ + _k = is_basic (*((_src) + (_si))); \ + if (_k) \ + mblength = 1; \ + else \ + {\ + state_bak = state; \ + mblength = mbrlen ((_src) + (_si), (_srcend) - ((_src)+(_si)), &state); \ + } \ + if (mblength == (size_t)-2 || mblength == (size_t)-1) \ + { \ + state = state_bak; \ + mblength = 1; \ + } \ + else \ + mblength = (mblength < 1) ? 1 : mblength; \ +\ + for (_k = 0; _k < mblength; _k++) \ + _dst[_di++] = _src[_si++]; \ + } \ + else \ + _dst[_di++] = _src[_si++]; \ + } \ + while (0) +#else +# define COPY_CHAR_I(_dst, _di, _src, _srcend, _si) _dst[_di++] = _src[_si++] +#endif /* !HANDLE_MULTIBYTE */ + +/**************************************************************** + * * + * The following are only guaranteed to work in subst.c * + * * + ****************************************************************/ + +#if defined (HANDLE_MULTIBYTE) +# define SCOPY_CHAR_I(_dst, _escchar, _sc, _src, _si, _slen) \ + do \ + { \ + if (locale_mb_cur_max > 1) \ + { \ + mbstate_t state_bak; \ + size_t mblength; \ + int _i; \ +\ + _i = is_basic (*((_src) + (_si))); \ + if (_i) \ + mblength = 1; \ + else \ + { \ + state_bak = state; \ + mblength = mbrlen ((_src) + (_si), (_slen) - (_si), &state); \ + } \ + if (mblength == (size_t)-2 || mblength == (size_t)-1) \ + { \ + state = state_bak; \ + mblength = 1; \ + } \ + else \ + mblength = (mblength < 1) ? 1 : mblength; \ +\ + temp = xmalloc (mblength + 2); \ + temp[0] = _escchar; \ + for (_i = 0; _i < mblength; _i++) \ + temp[_i + 1] = _src[_si++]; \ + temp[mblength + 1] = '\0'; \ +\ + goto add_string; \ + } \ + else \ + { \ + _dst[0] = _escchar; \ + _dst[1] = _sc; \ + } \ + } \ + while (0) +#else +# define SCOPY_CHAR_I(_dst, _escchar, _sc, _src, _si, _slen) \ + _dst[0] = _escchar; \ + _dst[1] = _sc +#endif /* !HANDLE_MULTIBYTE */ + +#if defined (HANDLE_MULTIBYTE) +# define SCOPY_CHAR_M(_dst, _src, _srcend, _si) \ + do \ + { \ + if (locale_mb_cur_max > 1) \ + { \ + mbstate_t state_bak; \ + size_t mblength; \ + int _i; \ +\ + _i = is_basic (*((_src) + (_si))); \ + if (_i) \ + mblength = 1; \ + else \ + { \ + state_bak = state; \ + mblength = mbrlen ((_src) + (_si), (_srcend) - ((_src) + (_si)), &state); \ + } \ + if (mblength == (size_t)-2 || mblength == (size_t)-1) \ + { \ + state = state_bak; \ + mblength = 1; \ + } \ + else \ + mblength = (mblength < 1) ? 1 : mblength; \ +\ + FASTCOPY(((_src) + (_si)), (_dst), mblength); \ +\ + (_dst) += mblength; \ + (_si) += mblength; \ + } \ + else \ + { \ + *(_dst)++ = _src[(_si)]; \ + (_si)++; \ + } \ + } \ + while (0) +#else +# define SCOPY_CHAR_M(_dst, _src, _srcend, _si) \ + *(_dst)++ = _src[(_si)]; \ + (_si)++ +#endif /* !HANDLE_MULTIBYTE */ + +#if HANDLE_MULTIBYTE +# define SADD_MBCHAR(_dst, _src, _si, _srcsize) \ + do \ + { \ + if (locale_mb_cur_max > 1) \ + { \ + int i; \ + mbstate_t state_bak; \ + size_t mblength; \ +\ + i = is_basic (*((_src) + (_si))); \ + if (i) \ + mblength = 1; \ + else \ + { \ + state_bak = state; \ + mblength = mbrlen ((_src) + (_si), (_srcsize) - (_si), &state); \ + } \ + if (mblength == (size_t)-1 || mblength == (size_t)-2) \ + { \ + state = state_bak; \ + mblength = 1; \ + } \ + if (mblength < 1) \ + mblength = 1; \ +\ + _dst = (char *)xmalloc (mblength + 1); \ + for (i = 0; i < mblength; i++) \ + (_dst)[i] = (_src)[(_si)++]; \ + (_dst)[mblength] = '\0'; \ +\ + goto add_string; \ + } \ + } \ + while (0) + +#else +# define SADD_MBCHAR(_dst, _src, _si, _srcsize) +#endif + +/* Watch out when using this -- it's just straight textual substitution */ +#if defined (HANDLE_MULTIBYTE) +# define SADD_MBQCHAR_BODY(_dst, _src, _si, _srcsize) \ +\ + int i; \ + mbstate_t state_bak; \ + size_t mblength; \ +\ + i = is_basic (*((_src) + (_si))); \ + if (i) \ + mblength = 1; \ + else \ + { \ + state_bak = state; \ + mblength = mbrlen ((_src) + (_si), (_srcsize) - (_si), &state); \ + } \ + if (mblength == (size_t)-1 || mblength == (size_t)-2) \ + { \ + state = state_bak; \ + mblength = 1; \ + } \ + if (mblength < 1) \ + mblength = 1; \ +\ + (_dst) = (char *)xmalloc (mblength + 2); \ + (_dst)[0] = CTLESC; \ + for (i = 0; i < mblength; i++) \ + (_dst)[i+1] = (_src)[(_si)++]; \ + (_dst)[mblength+1] = '\0'; \ +\ + goto add_string + +#endif /* HANDLE_MULTIBYTE */ +#endif /* _SH_MBUTIL_H_ */ diff --git a/include/shtty.h b/include/shtty.h new file mode 100644 index 0000000..66500d9 --- /dev/null +++ b/include/shtty.h @@ -0,0 +1,112 @@ +/* Copyright (C) 1999 Free Software Foundation, Inc. */ + +/* This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* + * shtty.h -- include the correct system-dependent files to manipulate the + * tty + */ + +#ifndef __SH_TTY_H_ +#define __SH_TTY_H_ + +#include "stdc.h" + +#if defined (_POSIX_VERSION) && defined (HAVE_TERMIOS_H) && defined (HAVE_TCGETATTR) && !defined (TERMIOS_MISSING) +# define TERMIOS_TTY_DRIVER +#else +# if defined (HAVE_TERMIO_H) +# define TERMIO_TTY_DRIVER +# else +# define NEW_TTY_DRIVER +# endif +#endif + +/* + * The _POSIX_SOURCE define is to avoid multiple symbol definitions + * between sys/ioctl.h and termios.h. Ditto for the test against SunOS4 + * and the undefining of several symbols. + */ + +#ifdef TERMIOS_TTY_DRIVER +# if (defined (SunOS4) || defined (SunOS5)) && !defined (_POSIX_SOURCE) +# define _POSIX_SOURCE +# endif +# if defined (SunOS4) +# undef ECHO +# undef NOFLSH +# undef TOSTOP +# endif /* SunOS4 */ +# include +# define TTYSTRUCT struct termios +#else +# ifdef TERMIO_TTY_DRIVER +# include +# define TTYSTRUCT struct termio +# else /* NEW_TTY_DRIVER */ +# include +# define TTYSTRUCT struct sgttyb +# endif +#endif + +/* Functions imported from lib/sh/shtty.c */ + +/* Get and set terminal attributes for the file descriptor passed as + an argument. */ +extern int ttgetattr __P((int, TTYSTRUCT *)); +extern int ttsetattr __P((int, TTYSTRUCT *)); + +/* Save and restore the terminal's attributes from static storage. */ +extern void ttsave __P((void)); +extern void ttrestore __P((void)); + +/* Return the attributes corresponding to the file descriptor (0 or 1) + passed as an argument. */ +extern TTYSTRUCT *ttattr __P((int)); + +/* These functions only operate on the passed TTYSTRUCT; they don't + actually change anything with the kernel's current tty settings. */ +extern int tt_setonechar __P((TTYSTRUCT *)); +extern int tt_setnoecho __P((TTYSTRUCT *)); +extern int tt_seteightbit __P((TTYSTRUCT *)); +extern int tt_setnocanon __P((TTYSTRUCT *)); +extern int tt_setcbreak __P((TTYSTRUCT *)); + +/* These functions are all generally mutually exclusive. If you call + more than one (bracketed with calls to ttsave and ttrestore, of + course), the right thing will happen, but more system calls will be + executed than absolutely necessary. You can do all of this yourself + with the other functions; these are only conveniences. */ + +/* These functions work with a given file descriptor and set terminal + attributes */ +extern int ttfd_onechar __P((int, TTYSTRUCT *)); +extern int ttfd_noecho __P((int, TTYSTRUCT *)); +extern int ttfd_eightbit __P((int, TTYSTRUCT *)); +extern int ttfd_nocanon __P((int, TTYSTRUCT *)); + +extern int ttfd_cbreak __P((int, TTYSTRUCT *)); + +/* These functions work with fd 0 and the TTYSTRUCT saved with ttsave () */ +extern int ttonechar __P((void)); +extern int ttnoecho __P((void)); +extern int tteightbit __P((void)); +extern int ttnocanon __P((void)); + +extern int ttcbreak __P((void)); + +#endif diff --git a/include/stat-time.h b/include/stat-time.h new file mode 100644 index 0000000..e04cc61 --- /dev/null +++ b/include/stat-time.h @@ -0,0 +1,214 @@ +/* stat-related time functions. + + Copyright (C) 2005, 2007, 2009-2012 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Paul Eggert. */ + +#ifndef STAT_TIME_H +#define STAT_TIME_H 1 + +#include + +#if defined (TIME_H_DEFINES_STRUCT_TIMESPEC) +# include +#elif defined (SYS_TIME_H_DEFINES_STRUCT_TIMESPEC) +# include +#elif defined (PTHREAD_H_DEFINES_STRUCT_TIMESPEC) +# include +#endif + +#ifndef HAVE_STRUCT_TIMESPEC +struct timespec +{ + time_t tv_sec; + long int tv_nsec; +}; +#endif + +/* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type + struct timespec, if available. If not, then STAT_TIMESPEC_NS (ST, + ST_XTIM) is the nanosecond component of the ST_XTIM member for *ST, + if available. ST_XTIM can be st_atim, st_ctim, st_mtim, or st_birthtim + for access, status change, data modification, or birth (creation) + time respectively. + + These macros are private to stat-time.h. */ +#if defined HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC +# ifdef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC +# define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) +# else +# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim.tv_nsec) +# endif +#elif defined HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC +# define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim##espec) +#elif defined HAVE_STRUCT_STAT_ST_ATIMENSEC +# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim##ensec) +#elif defined HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC +# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim.st__tim.tv_nsec) +#endif + +/* Return the nanosecond component of *ST's access time. */ +static inline long int +get_stat_atime_ns (struct stat const *st) +{ +# if defined STAT_TIMESPEC + return STAT_TIMESPEC (st, st_atim).tv_nsec; +# elif defined STAT_TIMESPEC_NS + return STAT_TIMESPEC_NS (st, st_atim); +# else + return 0; +# endif +} + +/* Return the nanosecond component of *ST's status change time. */ +static inline long int +get_stat_ctime_ns (struct stat const *st) +{ +# if defined STAT_TIMESPEC + return STAT_TIMESPEC (st, st_ctim).tv_nsec; +# elif defined STAT_TIMESPEC_NS + return STAT_TIMESPEC_NS (st, st_ctim); +# else + return 0; +# endif +} + +/* Return the nanosecond component of *ST's data modification time. */ +static inline long int +get_stat_mtime_ns (struct stat const *st) +{ +# if defined STAT_TIMESPEC + return STAT_TIMESPEC (st, st_mtim).tv_nsec; +# elif defined STAT_TIMESPEC_NS + return STAT_TIMESPEC_NS (st, st_mtim); +# else + return 0; +# endif +} + +/* Return the nanosecond component of *ST's birth time. */ +static inline long int +get_stat_birthtime_ns (struct stat const *st) +{ +# if defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC + return STAT_TIMESPEC (st, st_birthtim).tv_nsec; +# elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC + return STAT_TIMESPEC_NS (st, st_birthtim); +# else + /* Avoid a "parameter unused" warning. */ + (void) st; + return 0; +# endif +} + +/* Return *ST's access time. */ +static inline struct timespec +get_stat_atime (struct stat const *st) +{ +#ifdef STAT_TIMESPEC + return STAT_TIMESPEC (st, st_atim); +#else + struct timespec t; + t.tv_sec = st->st_atime; + t.tv_nsec = get_stat_atime_ns (st); + return t; +#endif +} + +/* Return *ST's status change time. */ +static inline struct timespec +get_stat_ctime (struct stat const *st) +{ +#ifdef STAT_TIMESPEC + return STAT_TIMESPEC (st, st_ctim); +#else + struct timespec t; + t.tv_sec = st->st_ctime; + t.tv_nsec = get_stat_ctime_ns (st); + return t; +#endif +} + +/* Return *ST's data modification time. */ +static inline struct timespec +get_stat_mtime (struct stat const *st) +{ +#ifdef STAT_TIMESPEC + return STAT_TIMESPEC (st, st_mtim); +#else + struct timespec t; + t.tv_sec = st->st_mtime; + t.tv_nsec = get_stat_mtime_ns (st); + return t; +#endif +} + +static inline int +timespec_cmp (struct timespec a, struct timespec b) +{ + return (a.tv_sec < b.tv_sec + ? -1 + : (a.tv_sec > b.tv_sec + ? 1 + : (int) (a.tv_nsec - b.tv_nsec))); +} + +/* Return *ST's birth time, if available; otherwise return a value + with tv_sec and tv_nsec both equal to -1. */ +static inline struct timespec +get_stat_birthtime (struct stat const *st) +{ + struct timespec t; + +#if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \ + || defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC) + t = STAT_TIMESPEC (st, st_birthtim); +#elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC + t.tv_sec = st->st_birthtime; + t.tv_nsec = st->st_birthtimensec; +#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* Native Windows platforms (but not Cygwin) put the "file creation + time" in st_ctime (!). See + . */ + t.tv_sec = st->st_ctime; + t.tv_nsec = 0; +#else + /* Birth time is not supported. */ + t.tv_sec = -1; + t.tv_nsec = -1; + /* Avoid a "parameter unused" warning. */ + (void) st; +#endif + +#if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \ + || defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC \ + || defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC) + /* FreeBSD and NetBSD sometimes signal the absence of knowledge by + using zero. Attempt to work around this problem. Alas, this can + report failure even for valid time stamps. Also, NetBSD + sometimes returns junk in the birth time fields; work around this + bug if it is detected. */ + if (! (t.tv_sec && 0 <= t.tv_nsec && t.tv_nsec < 1000000000)) + { + t.tv_sec = -1; + t.tv_nsec = -1; + } +#endif + + return t; +} + +#endif diff --git a/include/stdc.h b/include/stdc.h new file mode 100644 index 0000000..d2fd4b2 --- /dev/null +++ b/include/stdc.h @@ -0,0 +1,89 @@ +/* stdc.h -- macros to make source compile on both ANSI C and K&R C + compilers. */ + +/* Copyright (C) 1993 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_STDC_H_) +#define _STDC_H_ + +/* Adapted from BSD /usr/include/sys/cdefs.h. */ + +/* A function can be defined using prototypes and compile on both ANSI C + and traditional C compilers with something like this: + extern char *func __P((char *, char *, int)); */ + +#if !defined (__P) +# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus) || defined (PROTOTYPES) +# define __P(protos) protos +# else +# define __P(protos) () +# endif +#endif + +/* Fortify, at least, has trouble with this definition */ +#if defined (HAVE_STRINGIZE) +# define CPP_STRING(x) #x +#else +# define CPP_STRING(x) "x" +#endif + +#if !defined (__STDC__) + +#if defined (__GNUC__) /* gcc with -traditional */ +# if !defined (signed) +# define signed __signed +# endif +# if !defined (volatile) +# define volatile __volatile +# endif +#else /* !__GNUC__ */ +# if !defined (inline) +# define inline +# endif +# if !defined (signed) +# define signed +# endif +# if !defined (volatile) +# define volatile +# endif +#endif /* !__GNUC__ */ + +#endif /* !__STDC__ */ + +#ifndef __attribute__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) +# define __attribute__(x) +# endif +#endif + +/* For those situations when gcc handles inlining a particular function but + other compilers complain. */ +#ifdef __GNUC__ +# define INLINE inline +#else +# define INLINE +#endif + +#if defined (PREFER_STDARG) +# define SH_VA_START(va, arg) va_start(va, arg) +#else +# define SH_VA_START(va, arg) va_start(va) +#endif + +#endif /* !_STDC_H_ */ diff --git a/include/systimes.h b/include/systimes.h new file mode 100644 index 0000000..ec2d92f --- /dev/null +++ b/include/systimes.h @@ -0,0 +1,55 @@ +/* Copyright (C) 1991, 1992, 1996, 2008,2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* + * POSIX Standard: 4.5.2 Process Times + */ + +/* + * If we don't have a standard system clock_t type, this must be included + * after config.h + */ + +#ifndef _BASH_SYSTIMES_H +#define _BASH_SYSTIMES_H 1 + +#if defined (HAVE_SYS_TIMES_H) +# include +#else /* !HAVE_SYS_TIMES_H */ + +#include + +/* Structure describing CPU time used by a process and its children. */ +struct tms + { + clock_t tms_utime; /* User CPU time. */ + clock_t tms_stime; /* System CPU time. */ + + clock_t tms_cutime; /* User CPU time of dead children. */ + clock_t tms_cstime; /* System CPU time of dead children. */ + }; + +/* Store the CPU time used by this process and all its + dead descendants in BUFFER. + Return the elapsed real time from an arbitrary point in the + past (the bash emulation uses the epoch), or (clock_t) -1 for + errors. All times are in CLK_TCKths of a second. */ +extern clock_t times __P((struct tms *buffer)); + +#endif /* !HAVE_SYS_TIMES_H */ +#endif /* _BASH_SYSTIMES_H */ diff --git a/include/typemax.h b/include/typemax.h new file mode 100644 index 0000000..aa21c9c --- /dev/null +++ b/include/typemax.h @@ -0,0 +1,103 @@ +/* typemax.h -- encapsulate max values for long, long long, etc. */ + +/* Copyright (C) 2001 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* + * NOTE: This should be included after config.h, limits.h, stdint.h, and + * inttypes.h + */ + +#ifndef _SH_TYPEMAX_H +#define _SH_TYPEMAX_H + +#ifndef CHAR_BIT +# define CHAR_BIT 8 +#endif + +/* Nonzero if the integer type T is signed. */ +#ifndef TYPE_SIGNED +# define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) +#endif + +#ifndef TYPE_MINIMUM +# define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \ + ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) \ + : (t) 0)) +#endif + +#ifndef TYPE_MAXIMUM +# define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t))) +#endif + +#ifdef HAVE_LONG_LONG +# ifndef LLONG_MAX +# define LLONG_MAX TYPE_MAXIMUM(long long int) +# define LLONG_MIN TYPE_MINIMUM(long long int) +# endif +# ifndef ULLONG_MAX +# define ULLONG_MAX TYPE_MAXIMUM(unsigned long long int) +# endif +#endif + +#ifndef ULONG_MAX +# define ULONG_MAX ((unsigned long) ~(unsigned long) 0) +#endif + +#ifndef LONG_MAX +# define LONG_MAX ((long int) (ULONG_MAX >> 1)) +# define LONG_MIN ((long int) (-LONG_MAX - 1L)) +#endif + +#ifndef INT_MAX /* ouch */ +# define INT_MAX TYPE_MAXIMUM(int) +# define INT_MIN TYPE_MINIMUM(int) +# define UINT_MAX ((unsigned int) ~(unsigned int)0) +#endif + +/* workaround for gcc bug in versions < 2.7 */ +#if defined (HAVE_LONG_LONG) && __GNUC__ == 2 && __GNUC_MINOR__ < 7 +static const unsigned long long int maxquad = ULLONG_MAX; +# undef ULLONG_MAX +# define ULLONG_MAX maxquad +#endif + +#if !defined (INTMAX_MAX) || !defined (INTMAX_MIN) + +#if SIZEOF_INTMAX_T == SIZEOF_LONG_LONG +# define INTMAX_MAX LLONG_MAX +# define INTMAX_MIN LLONG_MIN +#elif SIZEOF_INTMAX_T == SIZEOF_LONG +# define INTMAX_MAX LONG_MAX +# define INTMAX_MIN LONG_MIN +#else +# define INTMAX_MAX INT_MAX +# define INTMAX_MIN INT_MIN +#endif + +#endif + +#ifndef SSIZE_MAX +# define SSIZE_MAX 32767 /* POSIX minimum max */ +#endif + +#ifndef SIZE_MAX +# define SIZE_MAX 65535 /* POSIX minimum max */ +#endif + +#endif /* _SH_TYPEMAX_H */ diff --git a/include/unionwait.h b/include/unionwait.h new file mode 100644 index 0000000..b1b4dfa --- /dev/null +++ b/include/unionwait.h @@ -0,0 +1,98 @@ +/* unionwait.h -- definitions for using a `union wait' on systems without + one. */ + +/* Copyright (C) 1996 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _UNIONWAIT_H +#define _UNIONWAIT_H + +#if !defined (WORDS_BIGENDIAN) +union wait + { + int w_status; /* used in syscall */ + + /* Terminated process status. */ + struct + { + unsigned short + w_Termsig : 7, /* termination signal */ + w_Coredump : 1, /* core dump indicator */ + w_Retcode : 8, /* exit code if w_termsig==0 */ + w_Fill1 : 16; /* high 16 bits unused */ + } w_T; + + /* Stopped process status. Returned + only for traced children unless requested + with the WUNTRACED option bit. */ + struct + { + unsigned short + w_Stopval : 8, /* == W_STOPPED if stopped */ + w_Stopsig : 8, /* actually zero on XENIX */ + w_Fill2 : 16; /* high 16 bits unused */ + } w_S; + }; + +#else /* WORDS_BIGENDIAN */ + +/* This is for big-endian machines like the IBM RT, HP 9000, or Sun-3 */ + +union wait + { + int w_status; /* used in syscall */ + + /* Terminated process status. */ + struct + { + unsigned short w_Fill1 : 16; /* high 16 bits unused */ + unsigned w_Retcode : 8; /* exit code if w_termsig==0 */ + unsigned w_Coredump : 1; /* core dump indicator */ + unsigned w_Termsig : 7; /* termination signal */ + } w_T; + + /* Stopped process status. Returned + only for traced children unless requested + with the WUNTRACED option bit. */ + struct + { + unsigned short w_Fill2 : 16; /* high 16 bits unused */ + unsigned w_Stopsig : 8; /* signal that stopped us */ + unsigned w_Stopval : 8; /* == W_STOPPED if stopped */ + } w_S; + }; + +#endif /* WORDS_BIGENDIAN */ + +#define w_termsig w_T.w_Termsig +#define w_coredump w_T.w_Coredump +#define w_retcode w_T.w_Retcode +#define w_stopval w_S.w_Stopval +#define w_stopsig w_S.w_Stopsig + +#define WSTOPPED 0177 +#define WIFSTOPPED(x) ((x).w_stopval == WSTOPPED) +#define WIFEXITED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig == 0) +#define WIFSIGNALED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig != 0) + +#define WTERMSIG(x) ((x).w_termsig) +#define WSTOPSIG(x) ((x).w_stopsig) +#define WEXITSTATUS(x) ((x).w_retcode) +#define WIFCORED(x) ((x).w_coredump) + +#endif /* _UNIONWAIT_H */ diff --git a/input.c b/input.c new file mode 100644 index 0000000..b5421d6 --- /dev/null +++ b/input.c @@ -0,0 +1,666 @@ +/* input.c -- functions to perform buffered input with synchronization. */ + +/* Copyright (C) 1992-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" +#if !defined (_MINIX) && defined (HAVE_SYS_FILE_H) +# include +#endif +#include "filecntl.h" +#include "posixstat.h" +#include +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" +#include "bashintl.h" + +#include "command.h" +#include "general.h" +#include "input.h" +#include "error.h" +#include "externs.h" +#include "quit.h" +#include "trap.h" + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +#if defined (EAGAIN) +# define X_EAGAIN EAGAIN +#else +# define X_EAGAIN -99 +#endif + +#if defined (EWOULDBLOCK) +# define X_EWOULDBLOCK EWOULDBLOCK +#else +# define X_EWOULDBLOCK -99 +#endif + +extern void termsig_handler __P((int)); + +/* Functions to handle reading input on systems that don't restart read(2) + if a signal is received. */ + +static char localbuf[128]; +static int local_index = 0, local_bufused = 0; + +/* Posix and USG systems do not guarantee to restart read () if it is + interrupted by a signal. We do the read ourselves, and restart it + if it returns EINTR. */ +int +getc_with_restart (stream) + FILE *stream; +{ + unsigned char uc; + + CHECK_TERMSIG; + + /* Try local buffering to reduce the number of read(2) calls. */ + if (local_index == local_bufused || local_bufused == 0) + { + while (1) + { + QUIT; + run_pending_traps (); + + local_bufused = read (fileno (stream), localbuf, sizeof(localbuf)); + if (local_bufused > 0) + break; + else if (local_bufused == 0) + { + local_index = 0; + return EOF; + } + else if (errno == X_EAGAIN || errno == X_EWOULDBLOCK) + { + if (sh_unset_nodelay_mode (fileno (stream)) < 0) + { + sys_error (_("cannot reset nodelay mode for fd %d"), fileno (stream)); + local_index = local_bufused = 0; + return EOF; + } + continue; + } + else if (errno != EINTR) + { + local_index = local_bufused = 0; + return EOF; + } + else if (interrupt_state || terminating_signal) /* QUIT; */ + local_index = local_bufused = 0; + } + local_index = 0; + } + uc = localbuf[local_index++]; + return uc; +} + +int +ungetc_with_restart (c, stream) + int c; + FILE *stream; +{ + if (local_index == 0 || c == EOF) + return EOF; + localbuf[--local_index] = c; + return c; +} + +#if defined (BUFFERED_INPUT) + +/* A facility similar to stdio, but input-only. */ + +#if defined (USING_BASH_MALLOC) +# define MAX_INPUT_BUFFER_SIZE 8176 +#else +# define MAX_INPUT_BUFFER_SIZE 8192 +#endif + +#if !defined (SEEK_CUR) +# define SEEK_CUR 1 +#endif /* !SEEK_CUR */ + +#ifdef max +# undef max +#endif +#define max(a, b) (((a) > (b)) ? (a) : (b)) +#ifdef min +# undef min +#endif +#define min(a, b) ((a) > (b) ? (b) : (a)) + +extern int interactive_shell; + +int bash_input_fd_changed; + +/* This provides a way to map from a file descriptor to the buffer + associated with that file descriptor, rather than just the other + way around. This is needed so that buffers are managed properly + in constructs like 3<&4. buffers[x]->b_fd == x -- that is how the + correspondence is maintained. */ +static BUFFERED_STREAM **buffers = (BUFFERED_STREAM **)NULL; +static int nbuffers; + +#define ALLOCATE_BUFFERS(n) \ + do { if ((n) >= nbuffers) allocate_buffers (n); } while (0) + +/* Make sure `buffers' has at least N elements. */ +static void +allocate_buffers (n) + int n; +{ + register int i, orig_nbuffers; + + orig_nbuffers = nbuffers; + nbuffers = n + 20; + buffers = (BUFFERED_STREAM **)xrealloc + (buffers, nbuffers * sizeof (BUFFERED_STREAM *)); + + /* Zero out the new buffers. */ + for (i = orig_nbuffers; i < nbuffers; i++) + buffers[i] = (BUFFERED_STREAM *)NULL; +} + +/* Construct and return a BUFFERED_STREAM corresponding to file descriptor + FD, using BUFFER. */ +static BUFFERED_STREAM * +make_buffered_stream (fd, buffer, bufsize) + int fd; + char *buffer; + size_t bufsize; +{ + BUFFERED_STREAM *bp; + + bp = (BUFFERED_STREAM *)xmalloc (sizeof (BUFFERED_STREAM)); + ALLOCATE_BUFFERS (fd); + buffers[fd] = bp; + bp->b_fd = fd; + bp->b_buffer = buffer; + bp->b_size = bufsize; + bp->b_used = bp->b_inputp = bp->b_flag = 0; + if (bufsize == 1) + bp->b_flag |= B_UNBUFF; + if (O_TEXT && (fcntl (fd, F_GETFL) & O_TEXT) != 0) + bp->b_flag |= O_TEXT; + return (bp); +} + +/* Allocate a new BUFFERED_STREAM, copy BP to it, and return the new copy. */ +static BUFFERED_STREAM * +copy_buffered_stream (bp) + BUFFERED_STREAM *bp; +{ + BUFFERED_STREAM *nbp; + + if (!bp) + return ((BUFFERED_STREAM *)NULL); + + nbp = (BUFFERED_STREAM *)xmalloc (sizeof (BUFFERED_STREAM)); + xbcopy ((char *)bp, (char *)nbp, sizeof (BUFFERED_STREAM)); + return (nbp); +} + +int +set_bash_input_fd (fd) + int fd; +{ + if (bash_input.type == st_bstream) + bash_input.location.buffered_fd = fd; + else if (interactive_shell == 0) + default_buffered_input = fd; + return 0; +} + +int +fd_is_bash_input (fd) + int fd; +{ + if (bash_input.type == st_bstream && bash_input.location.buffered_fd == fd) + return 1; + else if (interactive_shell == 0 && default_buffered_input == fd) + return 1; + return 0; +} + +/* Save the buffered stream corresponding to file descriptor FD (which bash + is using to read input) to a buffered stream associated with NEW_FD. If + NEW_FD is -1, a new file descriptor is allocated with fcntl. The new + file descriptor is returned on success, -1 on error. */ +int +save_bash_input (fd, new_fd) + int fd, new_fd; +{ + int nfd; + + /* Sync the stream so we can re-read from the new file descriptor. We + might be able to avoid this by copying the buffered stream verbatim + to the new file descriptor. */ + if (buffers[fd]) + sync_buffered_stream (fd); + + /* Now take care of duplicating the file descriptor that bash is + using for input, so we can reinitialize it later. */ + nfd = (new_fd == -1) ? fcntl (fd, F_DUPFD, 10) : new_fd; + if (nfd == -1) + { + if (fcntl (fd, F_GETFD, 0) == 0) + sys_error (_("cannot allocate new file descriptor for bash input from fd %d"), fd); + return -1; + } + + if (buffers[nfd]) + { + /* What's this? A stray buffer without an associated open file + descriptor? Free up the buffer and report the error. */ + internal_error (_("save_bash_input: buffer already exists for new fd %d"), nfd); + free_buffered_stream (buffers[nfd]); + } + + /* Reinitialize bash_input.location. */ + if (bash_input.type == st_bstream) + { + bash_input.location.buffered_fd = nfd; + fd_to_buffered_stream (nfd); + close_buffered_fd (fd); /* XXX */ + } + else + /* If the current input type is not a buffered stream, but the shell + is not interactive and therefore using a buffered stream to read + input (e.g. with an `eval exec 3>output' inside a script), note + that the input fd has been changed. pop_stream() looks at this + value and adjusts the input fd to the new value of + default_buffered_input accordingly. */ + bash_input_fd_changed++; + + if (default_buffered_input == fd) + default_buffered_input = nfd; + + SET_CLOSE_ON_EXEC (nfd); + return nfd; +} + +/* Check that file descriptor FD is not the one that bash is currently + using to read input from a script. FD is about to be duplicated onto, + which means that the kernel will close it for us. If FD is the bash + input file descriptor, we need to seek backwards in the script (if + possible and necessary -- scripts read from stdin are still unbuffered), + allocate a new file descriptor to use for bash input, and re-initialize + the buffered stream. Make sure the file descriptor used to save bash + input is set close-on-exec. Returns 0 on success, -1 on failure. This + works only if fd is > 0 -- if fd == 0 and bash is reading input from + fd 0, sync_buffered_stream is used instead, to cooperate with input + redirection (look at redir.c:add_undo_redirect()). */ +int +check_bash_input (fd) + int fd; +{ + if (fd_is_bash_input (fd)) + { + if (fd > 0) + return ((save_bash_input (fd, -1) == -1) ? -1 : 0); + else if (fd == 0) + return ((sync_buffered_stream (fd) == -1) ? -1 : 0); + } + return 0; +} + +/* This is the buffered stream analogue of dup2(fd1, fd2). The + BUFFERED_STREAM corresponding to fd2 is deallocated, if one exists. + BUFFERS[fd1] is copied to BUFFERS[fd2]. This is called by the + redirect code for constructs like 4<&0 and 3b_buffer && buffers[fd1]->b_buffer == buffers[fd2]->b_buffer) + buffers[fd2] = (BUFFERED_STREAM *)NULL; + else + free_buffered_stream (buffers[fd2]); + } + buffers[fd2] = copy_buffered_stream (buffers[fd1]); + if (buffers[fd2]) + buffers[fd2]->b_fd = fd2; + + if (is_bash_input) + { + if (!buffers[fd2]) + fd_to_buffered_stream (fd2); + buffers[fd2]->b_flag |= B_WASBASHINPUT; + } + + return (fd2); +} + +/* Return 1 if a seek on FD will succeed. */ +#define fd_is_seekable(fd) (lseek ((fd), 0L, SEEK_CUR) >= 0) + +/* Take FD, a file descriptor, and create and return a buffered stream + corresponding to it. If something is wrong and the file descriptor + is invalid, return a NULL stream. */ +BUFFERED_STREAM * +fd_to_buffered_stream (fd) + int fd; +{ + char *buffer; + size_t size; + struct stat sb; + + if (fstat (fd, &sb) < 0) + { + close (fd); + return ((BUFFERED_STREAM *)NULL); + } + + size = (fd_is_seekable (fd)) ? min (sb.st_size, MAX_INPUT_BUFFER_SIZE) : 1; + if (size == 0) + size = 1; + buffer = (char *)xmalloc (size); + + return (make_buffered_stream (fd, buffer, size)); +} + +/* Return a buffered stream corresponding to FILE, a file name. */ +BUFFERED_STREAM * +open_buffered_stream (file) + char *file; +{ + int fd; + + fd = open (file, O_RDONLY); + return ((fd >= 0) ? fd_to_buffered_stream (fd) : (BUFFERED_STREAM *)NULL); +} + +/* Deallocate a buffered stream and free up its resources. Make sure we + zero out the slot in BUFFERS that points to BP. */ +void +free_buffered_stream (bp) + BUFFERED_STREAM *bp; +{ + int n; + + if (!bp) + return; + + n = bp->b_fd; + if (bp->b_buffer) + free (bp->b_buffer); + free (bp); + buffers[n] = (BUFFERED_STREAM *)NULL; +} + +/* Close the file descriptor associated with BP, a buffered stream, and free + up the stream. Return the status of closing BP's file descriptor. */ +int +close_buffered_stream (bp) + BUFFERED_STREAM *bp; +{ + int fd; + + if (!bp) + return (0); + fd = bp->b_fd; + free_buffered_stream (bp); + return (close (fd)); +} + +/* Deallocate the buffered stream associated with file descriptor FD, and + close FD. Return the status of the close on FD. */ +int +close_buffered_fd (fd) + int fd; +{ + if (fd < 0) + { + errno = EBADF; + return -1; + } + if (fd >= nbuffers || !buffers || !buffers[fd]) + return (close (fd)); + return (close_buffered_stream (buffers[fd])); +} + +/* Make the BUFFERED_STREAM associated with buffers[FD] be BP, and return + the old BUFFERED_STREAM. */ +BUFFERED_STREAM * +set_buffered_stream (fd, bp) + int fd; + BUFFERED_STREAM *bp; +{ + BUFFERED_STREAM *ret; + + ret = buffers[fd]; + buffers[fd] = bp; + return ret; +} + +/* Read a buffer full of characters from BP, a buffered stream. */ +static int +b_fill_buffer (bp) + BUFFERED_STREAM *bp; +{ + ssize_t nr; + off_t o; + + CHECK_TERMSIG; + /* In an environment where text and binary files are treated differently, + compensate for lseek() on text files returning an offset different from + the count of characters read() returns. Text-mode streams have to be + treated as unbuffered. */ + if ((bp->b_flag & (B_TEXT | B_UNBUFF)) == B_TEXT) + { + o = lseek (bp->b_fd, 0, SEEK_CUR); + nr = zread (bp->b_fd, bp->b_buffer, bp->b_size); + if (nr > 0 && nr < lseek (bp->b_fd, 0, SEEK_CUR) - o) + { + lseek (bp->b_fd, o, SEEK_SET); + bp->b_flag |= B_UNBUFF; + bp->b_size = 1; + nr = zread (bp->b_fd, bp->b_buffer, bp->b_size); + } + } + else + nr = zread (bp->b_fd, bp->b_buffer, bp->b_size); + if (nr <= 0) + { + bp->b_used = 0; + bp->b_buffer[0] = 0; + if (nr == 0) + bp->b_flag |= B_EOF; + else + fatal_error("error reading input file: %s", strerror(errno)); + return (EOF); + } + + bp->b_used = nr; + bp->b_inputp = 0; + return (bp->b_buffer[bp->b_inputp++] & 0xFF); +} + +/* Get a character from buffered stream BP. */ +#define bufstream_getc(bp) \ + (bp->b_inputp == bp->b_used || !bp->b_used) \ + ? b_fill_buffer (bp) \ + : bp->b_buffer[bp->b_inputp++] & 0xFF + +/* Push C back onto buffered stream BP. */ +static int +bufstream_ungetc(c, bp) + int c; + BUFFERED_STREAM *bp; +{ + if (c == EOF || bp->b_inputp == 0) + return (EOF); + + bp->b_buffer[--bp->b_inputp] = c; + return (c); +} + +/* Seek backwards on file BFD to synchronize what we've read so far + with the underlying file pointer. */ +int +sync_buffered_stream (bfd) + int bfd; +{ + BUFFERED_STREAM *bp; + off_t chars_left; + + if (buffers == 0 || (bp = buffers[bfd]) == 0) + return (-1); + + chars_left = bp->b_used - bp->b_inputp; + if (chars_left) + lseek (bp->b_fd, -chars_left, SEEK_CUR); + bp->b_used = bp->b_inputp = 0; + return (0); +} + +int +buffered_getchar () +{ + CHECK_TERMSIG; + +#if !defined (DJGPP) + return (bufstream_getc (buffers[bash_input.location.buffered_fd])); +#else + /* On DJGPP, ignore \r. */ + int ch; + while ((ch = bufstream_getc (buffers[bash_input.location.buffered_fd])) == '\r') + ; + return ch; +#endif +} + +int +buffered_ungetchar (c) + int c; +{ + return (bufstream_ungetc (c, buffers[bash_input.location.buffered_fd])); +} + +/* Make input come from file descriptor BFD through a buffered stream. */ +void +with_input_from_buffered_stream (bfd, name) + int bfd; + char *name; +{ + INPUT_STREAM location; + BUFFERED_STREAM *bp; + + location.buffered_fd = bfd; + /* Make sure the buffered stream exists. */ + bp = fd_to_buffered_stream (bfd); + init_yy_io (bp == 0 ? return_EOF : buffered_getchar, + buffered_ungetchar, st_bstream, name, location); +} + +#if defined (TEST) +void * +xmalloc(s) +int s; +{ + return (malloc (s)); +} + +void * +xrealloc(s, size) +char *s; +int size; +{ + if (!s) + return(malloc (size)); + else + return(realloc (s, size)); +} + +void +init_yy_io () +{ +} + +process(bp) +BUFFERED_STREAM *bp; +{ + int c; + + while ((c = bufstream_getc(bp)) != EOF) + putchar(c); +} + +BASH_INPUT bash_input; + +struct stat dsb; /* can be used from gdb */ + +/* imitate /bin/cat */ +main(argc, argv) +int argc; +char **argv; +{ + register int i; + BUFFERED_STREAM *bp; + + if (argc == 1) { + bp = fd_to_buffered_stream (0); + process(bp); + exit(0); + } + for (i = 1; i < argc; i++) { + if (argv[i][0] == '-' && argv[i][1] == '\0') { + bp = fd_to_buffered_stream (0); + if (!bp) + continue; + process(bp); + free_buffered_stream (bp); + } else { + bp = open_buffered_stream (argv[i]); + if (!bp) + continue; + process(bp); + close_buffered_stream (bp); + } + } + exit(0); +} +#endif /* TEST */ +#endif /* BUFFERED_INPUT */ diff --git a/input.h b/input.h new file mode 100644 index 0000000..0cbfcbe --- /dev/null +++ b/input.h @@ -0,0 +1,133 @@ +/* input.h -- Structures and unions used for reading input. */ + +/* Copyright (C) 1993-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_INPUT_H_) +#define _INPUT_H_ + +#include "stdc.h" + +/* Function pointers can be declared as (Function *)foo. */ +#if !defined (_FUNCTION_DEF) +# define _FUNCTION_DEF +typedef int Function (); +typedef void VFunction (); +typedef char *CPFunction (); /* no longer used */ +typedef char **CPPFunction (); /* no longer used */ +#endif /* _FUNCTION_DEF */ + +typedef int sh_cget_func_t __P((void)); /* sh_ivoidfunc_t */ +typedef int sh_cunget_func_t __P((int)); /* sh_intfunc_t */ + +enum stream_type {st_none, st_stdin, st_stream, st_string, st_bstream}; + +#if defined (BUFFERED_INPUT) + +/* Possible values for b_flag. */ +#undef B_EOF +#undef B_ERROR /* There are some systems with this define */ +#undef B_UNBUFF + +#define B_EOF 0x01 +#define B_ERROR 0x02 +#define B_UNBUFF 0x04 +#define B_WASBASHINPUT 0x08 +#define B_TEXT 0x10 + +/* A buffered stream. Like a FILE *, but with our own buffering and + synchronization. Look in input.c for the implementation. */ +typedef struct BSTREAM +{ + int b_fd; + char *b_buffer; /* The buffer that holds characters read. */ + size_t b_size; /* How big the buffer is. */ + size_t b_used; /* How much of the buffer we're using, */ + int b_flag; /* Flag values. */ + size_t b_inputp; /* The input pointer, index into b_buffer. */ +} BUFFERED_STREAM; + +#if 0 +extern BUFFERED_STREAM **buffers; +#endif + +extern int default_buffered_input; + +#endif /* BUFFERED_INPUT */ + +typedef union { + FILE *file; + char *string; +#if defined (BUFFERED_INPUT) + int buffered_fd; +#endif +} INPUT_STREAM; + +typedef struct { + enum stream_type type; + char *name; + INPUT_STREAM location; + sh_cget_func_t *getter; + sh_cunget_func_t *ungetter; +} BASH_INPUT; + +extern BASH_INPUT bash_input; + +/* Functions from parse.y whose use directly or indirectly depends on the + definitions in this file. */ +extern void initialize_bash_input __P((void)); +extern void init_yy_io __P((sh_cget_func_t *, sh_cunget_func_t *, enum stream_type, const char *, INPUT_STREAM)); +extern char *yy_input_name __P((void)); +extern void with_input_from_stdin __P((void)); +extern void with_input_from_string __P((char *, const char *)); +extern void with_input_from_stream __P((FILE *, const char *)); +extern void push_stream __P((int)); +extern void pop_stream __P((void)); +extern int stream_on_stack __P((enum stream_type)); +extern char *read_secondary_line __P((int)); +extern int find_reserved_word __P((char *)); +extern void gather_here_documents __P((void)); +extern void execute_variable_command __P((char *, char *)); + +extern int *save_token_state __P((void)); +extern void restore_token_state __P((int *)); + +/* Functions from input.c */ +extern int getc_with_restart __P((FILE *)); +extern int ungetc_with_restart __P((int, FILE *)); + +#if defined (BUFFERED_INPUT) +/* Functions from input.c. */ +extern int fd_is_bash_input __P((int)); +extern int set_bash_input_fd __P((int)); +extern int save_bash_input __P((int, int)); +extern int check_bash_input __P((int)); +extern int duplicate_buffered_stream __P((int, int)); +extern BUFFERED_STREAM *fd_to_buffered_stream __P((int)); +extern BUFFERED_STREAM *set_buffered_stream __P((int, BUFFERED_STREAM *)); +extern BUFFERED_STREAM *open_buffered_stream __P((char *)); +extern void free_buffered_stream __P((BUFFERED_STREAM *)); +extern int close_buffered_stream __P((BUFFERED_STREAM *)); +extern int close_buffered_fd __P((int)); +extern int sync_buffered_stream __P((int)); +extern int buffered_getchar __P((void)); +extern int buffered_ungetchar __P((int)); +extern void with_input_from_buffered_stream __P((int, char *)); +#endif /* BUFFERED_INPUT */ + +#endif /* _INPUT_H_ */ diff --git a/jobs.c b/jobs.c new file mode 100644 index 0000000..f38b0c3 --- /dev/null +++ b/jobs.c @@ -0,0 +1,4476 @@ +/* jobs.c - functions that make children, remember them, and handle their termination. */ + +/* This file works with both POSIX and BSD systems. It implements job + control. */ + +/* Copyright (C) 1989-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" +#include "trap.h" +#include +#include +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "posixtime.h" + +#if defined (HAVE_SYS_RESOURCE_H) && defined (HAVE_WAIT3) && !defined (_POSIX_VERSION) && !defined (RLIMTYPE) +# include +#endif /* !_POSIX_VERSION && HAVE_SYS_RESOURCE_H && HAVE_WAIT3 && !RLIMTYPE */ + +#if defined (HAVE_SYS_FILE_H) +# include +#endif + +#include "filecntl.h" +#include +#if defined (HAVE_SYS_PARAM_H) +#include +#endif + +#if defined (BUFFERED_INPUT) +# include "input.h" +#endif + +/* Need to include this up here for *_TTY_DRIVER definitions. */ +#include "shtty.h" + +/* Define this if your output is getting swallowed. It's a no-op on + machines with the termio or termios tty drivers. */ +/* #define DRAIN_OUTPUT */ + +/* For the TIOCGPGRP and TIOCSPGRP ioctl parameters on HP-UX */ +#if defined (hpux) && !defined (TERMIOS_TTY_DRIVER) +# include +#endif /* hpux && !TERMIOS_TTY_DRIVER */ + +#include "bashansi.h" +#include "bashintl.h" +#include "shell.h" +#include "jobs.h" +#include "execute_cmd.h" +#include "flags.h" + +#include "builtins/builtext.h" +#include "builtins/common.h" + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +#if !defined (HAVE_KILLPG) +extern int killpg __P((pid_t, int)); +#endif + +#if !DEFAULT_CHILD_MAX +# define DEFAULT_CHILD_MAX 32 +#endif + +#if !MAX_CHILD_MAX +# define MAX_CHILD_MAX 8192 +#endif + +#if !defined (DEBUG) +#define MAX_JOBS_IN_ARRAY 4096 /* production */ +#else +#define MAX_JOBS_IN_ARRAY 128 /* testing */ +#endif + +/* Flag values for second argument to delete_job */ +#define DEL_WARNSTOPPED 1 /* warn about deleting stopped jobs */ +#define DEL_NOBGPID 2 /* don't add pgrp leader to bgpids */ + +/* Take care of system dependencies that must be handled when waiting for + children. The arguments to the WAITPID macro match those to the Posix.1 + waitpid() function. */ + +#if defined (ultrix) && defined (mips) && defined (_POSIX_VERSION) +# define WAITPID(pid, statusp, options) \ + wait3 ((union wait *)statusp, options, (struct rusage *)0) +#else +# if defined (_POSIX_VERSION) || defined (HAVE_WAITPID) +# define WAITPID(pid, statusp, options) \ + waitpid ((pid_t)pid, statusp, options) +# else +# if defined (HAVE_WAIT3) +# define WAITPID(pid, statusp, options) \ + wait3 (statusp, options, (struct rusage *)0) +# else +# define WAITPID(pid, statusp, options) \ + wait3 (statusp, options, (int *)0) +# endif /* HAVE_WAIT3 */ +# endif /* !_POSIX_VERSION && !HAVE_WAITPID*/ +#endif /* !(Ultrix && mips && _POSIX_VERSION) */ + +/* getpgrp () varies between systems. Even systems that claim to be + Posix.1 compatible lie sometimes (Ultrix, SunOS4, apollo). */ +#if defined (GETPGRP_VOID) +# define getpgid(p) getpgrp () +#else +# define getpgid(p) getpgrp (p) +#endif /* !GETPGRP_VOID */ + +/* If the system needs it, REINSTALL_SIGCHLD_HANDLER will reinstall the + handler for SIGCHLD. */ +#if defined (MUST_REINSTALL_SIGHANDLERS) +# define REINSTALL_SIGCHLD_HANDLER signal (SIGCHLD, sigchld_handler) +#else +# define REINSTALL_SIGCHLD_HANDLER +#endif /* !MUST_REINSTALL_SIGHANDLERS */ + +/* Some systems let waitpid(2) tell callers about stopped children. */ +#if !defined (WCONTINUED) || defined (WCONTINUED_BROKEN) +# undef WCONTINUED +# define WCONTINUED 0 +#endif +#if !defined (WIFCONTINUED) +# define WIFCONTINUED(s) (0) +#endif + +/* The number of additional slots to allocate when we run out. */ +#define JOB_SLOTS 8 + +typedef int sh_job_map_func_t __P((JOB *, int, int, int)); + +/* Variables used here but defined in other files. */ +extern int subshell_environment, line_number; +extern int posixly_correct, shell_level; +extern int last_command_exit_value, last_command_exit_signal; +extern int loop_level, breaking; +extern int executing_list; +extern int sourcelevel; +extern int running_trap; +extern sh_builtin_func_t *this_shell_builtin; +extern char *shell_name, *this_command_name; +extern sigset_t top_level_mask; +extern procenv_t wait_intr_buf; +extern int wait_signal_received; +extern WORD_LIST *subst_assign_varlist; + +static struct jobstats zerojs = { -1L, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NO_JOB, NO_JOB, 0, 0 }; +struct jobstats js = { -1L, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NO_JOB, NO_JOB, 0, 0 }; + +struct bgpids bgpids = { 0, 0, 0 }; + +/* The array of known jobs. */ +JOB **jobs = (JOB **)NULL; + +#if 0 +/* The number of slots currently allocated to JOBS. */ +int job_slots = 0; +#endif + +/* The controlling tty for this shell. */ +int shell_tty = -1; + +/* The shell's process group. */ +pid_t shell_pgrp = NO_PID; + +/* The terminal's process group. */ +pid_t terminal_pgrp = NO_PID; + +/* The process group of the shell's parent. */ +pid_t original_pgrp = NO_PID; + +/* The process group of the pipeline currently being made. */ +pid_t pipeline_pgrp = (pid_t)0; + +#if defined (PGRP_PIPE) +/* Pipes which each shell uses to communicate with the process group leader + until all of the processes in a pipeline have been started. Then the + process leader is allowed to continue. */ +int pgrp_pipe[2] = { -1, -1 }; +#endif + +#if 0 +/* The job which is current; i.e. the one that `%+' stands for. */ +int current_job = NO_JOB; + +/* The previous job; i.e. the one that `%-' stands for. */ +int previous_job = NO_JOB; +#endif + +/* Last child made by the shell. */ +volatile pid_t last_made_pid = NO_PID; + +/* Pid of the last asynchronous child. */ +volatile pid_t last_asynchronous_pid = NO_PID; + +/* The pipeline currently being built. */ +PROCESS *the_pipeline = (PROCESS *)NULL; + +/* If this is non-zero, do job control. */ +int job_control = 1; + +/* Call this when you start making children. */ +int already_making_children = 0; + +/* If this is non-zero, $LINES and $COLUMNS are reset after every process + exits from get_tty_state(). */ +int check_window_size = CHECKWINSIZE_DEFAULT; + +/* Functions local to this file. */ + +static sighandler wait_sigint_handler __P((int)); +static sighandler sigchld_handler __P((int)); +static sighandler sigcont_sighandler __P((int)); +static sighandler sigstop_sighandler __P((int)); + +static int waitchld __P((pid_t, int)); + +static PROCESS *find_pipeline __P((pid_t, int, int *)); +static PROCESS *find_process __P((pid_t, int, int *)); + +static char *current_working_directory __P((void)); +static char *job_working_directory __P((void)); +static char *j_strsignal __P((int)); +static char *printable_job_status __P((int, PROCESS *, int)); + +static PROCESS *find_last_proc __P((int, int)); +static pid_t find_last_pid __P((int, int)); + +static int set_new_line_discipline __P((int)); +static int map_over_jobs __P((sh_job_map_func_t *, int, int)); +static int job_last_stopped __P((int)); +static int job_last_running __P((int)); +static int most_recent_job_in_state __P((int, JOB_STATE)); +static int find_job __P((pid_t, int, PROCESS **)); +static int print_job __P((JOB *, int, int, int)); +static int process_exit_status __P((WAIT)); +static int process_exit_signal __P((WAIT)); +static int set_job_status_and_cleanup __P((int)); + +static WAIT job_signal_status __P((int)); +static WAIT raw_job_exit_status __P((int)); + +static void notify_of_job_status __P((void)); +static void reset_job_indices __P((void)); +static void cleanup_dead_jobs __P((void)); +static int processes_in_job __P((int)); +static void realloc_jobs_list __P((void)); +static int compact_jobs_list __P((int)); +static int discard_pipeline __P((PROCESS *)); +static void add_process __P((char *, pid_t)); +static void print_pipeline __P((PROCESS *, int, int, FILE *)); +static void pretty_print_job __P((int, int, FILE *)); +static void set_current_job __P((int)); +static void reset_current __P((void)); +static void set_job_running __P((int)); +static void setjstatus __P((int)); +static int maybe_give_terminal_to __P((pid_t, pid_t, int)); +static void mark_all_jobs_as_dead __P((void)); +static void mark_dead_jobs_as_notified __P((int)); +static void restore_sigint_handler __P((void)); +#if defined (PGRP_PIPE) +static void pipe_read __P((int *)); +#endif + +static struct pidstat *bgp_alloc __P((pid_t, int)); +static struct pidstat *bgp_add __P((pid_t, int)); +static int bgp_delete __P((pid_t)); +static void bgp_clear __P((void)); +static int bgp_search __P((pid_t)); +static void bgp_prune __P((void)); + +#if defined (ARRAY_VARS) +static int *pstatuses; /* list of pipeline statuses */ +static int statsize; +#endif + +/* Used to synchronize between wait_for and other functions and the SIGCHLD + signal handler. */ +static int sigchld; +static int queue_sigchld; + +#define QUEUE_SIGCHLD(os) (os) = sigchld, queue_sigchld++ + +#define UNQUEUE_SIGCHLD(os) \ + do { \ + queue_sigchld--; \ + if (queue_sigchld == 0 && os != sigchld) \ + waitchld (-1, 0); \ + } while (0) + +static SigHandler *old_tstp, *old_ttou, *old_ttin; +static SigHandler *old_cont = (SigHandler *)SIG_DFL; + +/* A place to temporarily save the current pipeline. */ +static PROCESS *saved_pipeline; +static int saved_already_making_children; + +/* Set this to non-zero whenever you don't want the jobs list to change at + all: no jobs deleted and no status change notifications. This is used, + for example, when executing SIGCHLD traps, which may run arbitrary + commands. */ +static int jobs_list_frozen; + +static char retcode_name_buffer[64]; + +#if !defined (_POSIX_VERSION) + +/* These are definitions to map POSIX 1003.1 functions onto existing BSD + library functions and system calls. */ +#define setpgid(pid, pgrp) setpgrp (pid, pgrp) +#define tcsetpgrp(fd, pgrp) ioctl ((fd), TIOCSPGRP, &(pgrp)) + +pid_t +tcgetpgrp (fd) + int fd; +{ + pid_t pgrp; + + /* ioctl will handle setting errno correctly. */ + if (ioctl (fd, TIOCGPGRP, &pgrp) < 0) + return (-1); + return (pgrp); +} + +#endif /* !_POSIX_VERSION */ + +/* Initialize the global job stats structure and other bookkeeping variables */ +void +init_job_stats () +{ + js = zerojs; +} + +/* Return the working directory for the current process. Unlike + job_working_directory, this does not call malloc (), nor do any + of the functions it calls. This is so that it can safely be called + from a signal handler. */ +static char * +current_working_directory () +{ + char *dir; + static char d[PATH_MAX]; + + dir = get_string_value ("PWD"); + + if (dir == 0 && the_current_working_directory && no_symbolic_links) + dir = the_current_working_directory; + + if (dir == 0) + { + dir = getcwd (d, sizeof(d)); + if (dir) + dir = d; + } + + return (dir == 0) ? "" : dir; +} + +/* Return the working directory for the current process. */ +static char * +job_working_directory () +{ + char *dir; + + dir = get_string_value ("PWD"); + if (dir) + return (savestring (dir)); + + dir = get_working_directory ("job-working-directory"); + if (dir) + return (dir); + + return (savestring ("")); +} + +void +making_children () +{ + if (already_making_children) + return; + + already_making_children = 1; + start_pipeline (); +} + +void +stop_making_children () +{ + already_making_children = 0; +} + +void +cleanup_the_pipeline () +{ + PROCESS *disposer; + sigset_t set, oset; + + BLOCK_CHILD (set, oset); + disposer = the_pipeline; + the_pipeline = (PROCESS *)NULL; + UNBLOCK_CHILD (oset); + + if (disposer) + discard_pipeline (disposer); +} + +void +save_pipeline (clear) + int clear; +{ + saved_pipeline = the_pipeline; + if (clear) + the_pipeline = (PROCESS *)NULL; + saved_already_making_children = already_making_children; +} + +void +restore_pipeline (discard) + int discard; +{ + PROCESS *old_pipeline; + + old_pipeline = the_pipeline; + the_pipeline = saved_pipeline; + already_making_children = saved_already_making_children; + if (discard && old_pipeline) + discard_pipeline (old_pipeline); +} + +/* Start building a pipeline. */ +void +start_pipeline () +{ + if (the_pipeline) + { + cleanup_the_pipeline (); + pipeline_pgrp = 0; +#if defined (PGRP_PIPE) + sh_closepipe (pgrp_pipe); +#endif + } + +#if defined (PGRP_PIPE) + if (job_control) + { + if (pipe (pgrp_pipe) == -1) + sys_error (_("start_pipeline: pgrp pipe")); + } +#endif +} + +/* Stop building a pipeline. Install the process list in the job array. + This returns the index of the newly installed job. + DEFERRED is a command structure to be executed upon satisfactory + execution exit of this pipeline. */ +int +stop_pipeline (async, deferred) + int async; + COMMAND *deferred; +{ + register int i, j; + JOB *newjob; + sigset_t set, oset; + + BLOCK_CHILD (set, oset); + +#if defined (PGRP_PIPE) + /* The parent closes the process group synchronization pipe. */ + sh_closepipe (pgrp_pipe); +#endif + + cleanup_dead_jobs (); + + if (js.j_jobslots == 0) + { + js.j_jobslots = JOB_SLOTS; + jobs = (JOB **)xmalloc (js.j_jobslots * sizeof (JOB *)); + + /* Now blank out these new entries. */ + for (i = 0; i < js.j_jobslots; i++) + jobs[i] = (JOB *)NULL; + + js.j_firstj = js.j_lastj = js.j_njobs = 0; + } + + /* Scan from the last slot backward, looking for the next free one. */ + /* XXX - revisit this interactive assumption */ + /* XXX - this way for now */ + if (interactive) + { + for (i = js.j_jobslots; i; i--) + if (jobs[i - 1]) + break; + } + else + { +#if 0 + /* This wraps around, but makes it inconvenient to extend the array */ + for (i = js.j_lastj+1; i != js.j_lastj; i++) + { + if (i >= js.j_jobslots) + i = 0; + if (jobs[i] == 0) + break; + } + if (i == js.j_lastj) + i = js.j_jobslots; +#else + /* This doesn't wrap around yet. */ + for (i = js.j_lastj ? js.j_lastj + 1 : js.j_lastj; i < js.j_jobslots; i++) + if (jobs[i] == 0) + break; +#endif + } + + /* Do we need more room? */ + + /* First try compaction */ + if ((interactive_shell == 0 || subshell_environment) && i == js.j_jobslots && js.j_jobslots >= MAX_JOBS_IN_ARRAY) + i = compact_jobs_list (0); + + /* If we can't compact, reallocate */ + if (i == js.j_jobslots) + { + js.j_jobslots += JOB_SLOTS; + jobs = (JOB **)xrealloc (jobs, (js.j_jobslots * sizeof (JOB *))); + + for (j = i; j < js.j_jobslots; j++) + jobs[j] = (JOB *)NULL; + } + + /* Add the current pipeline to the job list. */ + if (the_pipeline) + { + register PROCESS *p; + int any_running, any_stopped, n; + + newjob = (JOB *)xmalloc (sizeof (JOB)); + + for (n = 1, p = the_pipeline; p->next != the_pipeline; n++, p = p->next) + ; + p->next = (PROCESS *)NULL; + newjob->pipe = REVERSE_LIST (the_pipeline, PROCESS *); + for (p = newjob->pipe; p->next; p = p->next) + ; + p->next = newjob->pipe; + + the_pipeline = (PROCESS *)NULL; + newjob->pgrp = pipeline_pgrp; + pipeline_pgrp = 0; + + newjob->flags = 0; + + /* Flag to see if in another pgrp. */ + if (job_control) + newjob->flags |= J_JOBCONTROL; + + /* Set the state of this pipeline. */ + p = newjob->pipe; + any_running = any_stopped = 0; + do + { + any_running |= PRUNNING (p); + any_stopped |= PSTOPPED (p); + p = p->next; + } + while (p != newjob->pipe); + + newjob->state = any_running ? JRUNNING : (any_stopped ? JSTOPPED : JDEAD); + newjob->wd = job_working_directory (); + newjob->deferred = deferred; + + newjob->j_cleanup = (sh_vptrfunc_t *)NULL; + newjob->cleanarg = (PTR_T) NULL; + + jobs[i] = newjob; + if (newjob->state == JDEAD && (newjob->flags & J_FOREGROUND)) + setjstatus (i); + if (newjob->state == JDEAD) + { + js.c_reaped += n; /* wouldn't have been done since this was not part of a job */ + js.j_ndead++; + } + js.c_injobs += n; + + js.j_lastj = i; + js.j_njobs++; + } + else + newjob = (JOB *)NULL; + + if (newjob) + js.j_lastmade = newjob; + + if (async) + { + if (newjob) + { + newjob->flags &= ~J_FOREGROUND; + newjob->flags |= J_ASYNC; + js.j_lastasync = newjob; + } + reset_current (); + } + else + { + if (newjob) + { + newjob->flags |= J_FOREGROUND; + /* + * !!!!! NOTE !!!!! (chet@ins.cwru.edu) + * + * The currently-accepted job control wisdom says to set the + * terminal's process group n+1 times in an n-step pipeline: + * once in the parent and once in each child. This is where + * the parent gives it away. + * + * Don't give the terminal away if this shell is an asynchronous + * subshell. + * + */ + if (job_control && newjob->pgrp && (subshell_environment&SUBSHELL_ASYNC) == 0) + maybe_give_terminal_to (shell_pgrp, newjob->pgrp, 0); + } + } + + stop_making_children (); + UNBLOCK_CHILD (oset); + return (newjob ? i : js.j_current); +} + +/* Functions to manage the list of exited background pids whose status has + been saved. */ + +static struct pidstat * +bgp_alloc (pid, status) + pid_t pid; + int status; +{ + struct pidstat *ps; + + ps = (struct pidstat *)xmalloc (sizeof (struct pidstat)); + ps->pid = pid; + ps->status = status; + ps->next = (struct pidstat *)0; + return ps; +} + +static struct pidstat * +bgp_add (pid, status) + pid_t pid; + int status; +{ + struct pidstat *ps; + + ps = bgp_alloc (pid, status); + + if (bgpids.list == 0) + { + bgpids.list = bgpids.end = ps; + bgpids.npid = 0; /* just to make sure */ + } + else + { + bgpids.end->next = ps; + bgpids.end = ps; + } + bgpids.npid++; + + if (bgpids.npid > js.c_childmax) + bgp_prune (); + + return ps; +} + +static int +bgp_delete (pid) + pid_t pid; +{ + struct pidstat *prev, *p; + + for (prev = p = bgpids.list; p; prev = p, p = p->next) + if (p->pid == pid) + { + prev->next = p->next; /* remove from list */ + break; + } + + if (p == 0) + return 0; /* not found */ + +#if defined (DEBUG) + itrace("bgp_delete: deleting %d", pid); +#endif + + /* Housekeeping in the border cases. */ + if (p == bgpids.list) + bgpids.list = bgpids.list->next; + else if (p == bgpids.end) + bgpids.end = prev; + + bgpids.npid--; + if (bgpids.npid == 0) + bgpids.list = bgpids.end = 0; + else if (bgpids.npid == 1) + bgpids.end = bgpids.list; /* just to make sure */ + + free (p); + return 1; +} + +/* Clear out the list of saved statuses */ +static void +bgp_clear () +{ + struct pidstat *ps, *p; + + for (ps = bgpids.list; ps; ) + { + p = ps; + ps = ps->next; + free (p); + } + bgpids.list = bgpids.end = 0; + bgpids.npid = 0; +} + +/* Search for PID in the list of saved background pids; return its status if + found. If not found, return -1. */ +static int +bgp_search (pid) + pid_t pid; +{ + struct pidstat *ps; + + for (ps = bgpids.list ; ps; ps = ps->next) + if (ps->pid == pid) + return ps->status; + return -1; +} + +static void +bgp_prune () +{ + struct pidstat *ps; + + while (bgpids.npid > js.c_childmax) + { + ps = bgpids.list; + bgpids.list = bgpids.list->next; + free (ps); + bgpids.npid--; + } +} + +/* Reset the values of js.j_lastj and js.j_firstj after one or both have + been deleted. The caller should check whether js.j_njobs is 0 before + calling this. This wraps around, but the rest of the code does not. At + this point, it should not matter. */ +static void +reset_job_indices () +{ + int old; + + if (jobs[js.j_firstj] == 0) + { + old = js.j_firstj++; + if (old >= js.j_jobslots) + old = js.j_jobslots - 1; + while (js.j_firstj != old) + { + if (js.j_firstj >= js.j_jobslots) + js.j_firstj = 0; + if (jobs[js.j_firstj] || js.j_firstj == old) /* needed if old == 0 */ + break; + js.j_firstj++; + } + if (js.j_firstj == old) + js.j_firstj = js.j_lastj = js.j_njobs = 0; + } + if (jobs[js.j_lastj] == 0) + { + old = js.j_lastj--; + if (old < 0) + old = 0; + while (js.j_lastj != old) + { + if (js.j_lastj < 0) + js.j_lastj = js.j_jobslots - 1; + if (jobs[js.j_lastj] || js.j_lastj == old) /* needed if old == js.j_jobslots */ + break; + js.j_lastj--; + } + if (js.j_lastj == old) + js.j_firstj = js.j_lastj = js.j_njobs = 0; + } +} + +/* Delete all DEAD jobs that the user had received notification about. */ +static void +cleanup_dead_jobs () +{ + register int i; + int os; + + if (js.j_jobslots == 0 || jobs_list_frozen) + return; + + QUEUE_SIGCHLD(os); + + /* XXX could use js.j_firstj and js.j_lastj here */ + for (i = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("cleanup_dead_jobs: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("cleanup_dead_jobs: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + + if (jobs[i] && DEADJOB (i) && IS_NOTIFIED (i)) + delete_job (i, 0); + } + +#if defined (COPROCESS_SUPPORT) + coproc_reap (); +#endif + + UNQUEUE_SIGCHLD(os); +} + +static int +processes_in_job (job) + int job; +{ + int nproc; + register PROCESS *p; + + nproc = 0; + p = jobs[job]->pipe; + do + { + p = p->next; + nproc++; + } + while (p != jobs[job]->pipe); + + return nproc; +} + +static void +delete_old_job (pid) + pid_t pid; +{ + PROCESS *p; + int job; + + job = find_job (pid, 0, &p); + if (job != NO_JOB) + { +#ifdef DEBUG + itrace ("delete_old_job: found pid %d in job %d with state %d", pid, job, jobs[job]->state); +#endif + if (JOBSTATE (job) == JDEAD) + delete_job (job, DEL_NOBGPID); + else + { +#ifdef DEBUG + internal_warning (_("forked pid %d appears in running job %d"), pid, job+1); +#endif + if (p) + p->pid = 0; + } + } +} + +/* Reallocate and compress the jobs list. This returns with a jobs array + whose size is a multiple of JOB_SLOTS and can hold the current number of + jobs. Heuristics are used to minimize the number of new reallocs. */ +static void +realloc_jobs_list () +{ + sigset_t set, oset; + int nsize, i, j, ncur, nprev; + JOB **nlist; + + ncur = nprev = NO_JOB; + nsize = ((js.j_njobs + JOB_SLOTS - 1) / JOB_SLOTS); + nsize *= JOB_SLOTS; + i = js.j_njobs % JOB_SLOTS; + if (i == 0 || i > (JOB_SLOTS >> 1)) + nsize += JOB_SLOTS; + + BLOCK_CHILD (set, oset); + nlist = (js.j_jobslots == nsize) ? jobs : (JOB **) xmalloc (nsize * sizeof (JOB *)); + + js.c_reaped = js.j_ndead = 0; + for (i = j = 0; i < js.j_jobslots; i++) + if (jobs[i]) + { + if (i == js.j_current) + ncur = j; + if (i == js.j_previous) + nprev = j; + nlist[j++] = jobs[i]; + if (jobs[i]->state == JDEAD) + { + js.j_ndead++; + js.c_reaped += processes_in_job (i); + } + } + +#if 0 + itrace ("realloc_jobs_list: resize jobs list from %d to %d", js.j_jobslots, nsize); + itrace ("realloc_jobs_list: j_lastj changed from %d to %d", js.j_lastj, (j > 0) ? j - 1 : 0); + itrace ("realloc_jobs_list: j_njobs changed from %d to %d", js.j_njobs, j); + itrace ("realloc_jobs_list: js.j_ndead %d js.c_reaped %d", js.j_ndead, js.c_reaped); +#endif + + js.j_firstj = 0; + js.j_lastj = (j > 0) ? j - 1 : 0; + js.j_njobs = j; + js.j_jobslots = nsize; + + /* Zero out remaining slots in new jobs list */ + for ( ; j < nsize; j++) + nlist[j] = (JOB *)NULL; + + if (jobs != nlist) + { + free (jobs); + jobs = nlist; + } + + if (ncur != NO_JOB) + js.j_current = ncur; + if (nprev != NO_JOB) + js.j_previous = nprev; + + /* Need to reset these */ + if (js.j_current == NO_JOB || js.j_previous == NO_JOB || js.j_current > js.j_lastj || js.j_previous > js.j_lastj) + reset_current (); + +#if 0 + itrace ("realloc_jobs_list: reset js.j_current (%d) and js.j_previous (%d)", js.j_current, js.j_previous); +#endif + + UNBLOCK_CHILD (oset); +} + +/* Compact the jobs list by removing dead jobs. Assume that we have filled + the jobs array to some predefined maximum. Called when the shell is not + the foreground process (subshell_environment != 0). Returns the first + available slot in the compacted list. If that value is js.j_jobslots, then + the list needs to be reallocated. The jobs array may be in new memory if + this returns > 0 and < js.j_jobslots. FLAGS is reserved for future use. */ +static int +compact_jobs_list (flags) + int flags; +{ + if (js.j_jobslots == 0 || jobs_list_frozen) + return js.j_jobslots; + + reap_dead_jobs (); + realloc_jobs_list (); + +#if 0 + itrace("compact_jobs_list: returning %d", (js.j_lastj || jobs[js.j_lastj]) ? js.j_lastj + 1 : 0); +#endif + + return ((js.j_lastj || jobs[js.j_lastj]) ? js.j_lastj + 1 : 0); +} + +/* Delete the job at INDEX from the job list. Must be called + with SIGCHLD blocked. */ +void +delete_job (job_index, dflags) + int job_index, dflags; +{ + register JOB *temp; + PROCESS *proc; + int ndel; + + if (js.j_jobslots == 0 || jobs_list_frozen) + return; + + if ((dflags & DEL_WARNSTOPPED) && subshell_environment == 0 && STOPPED (job_index)) + internal_warning (_("deleting stopped job %d with process group %ld"), job_index+1, (long)jobs[job_index]->pgrp); + temp = jobs[job_index]; + if (temp == 0) + return; + + if ((dflags & DEL_NOBGPID) == 0) + { + proc = find_last_proc (job_index, 0); + /* Could do this just for J_ASYNC jobs, but we save all. */ + if (proc) + bgp_add (proc->pid, process_exit_status (proc->status)); + } + + jobs[job_index] = (JOB *)NULL; + if (temp == js.j_lastmade) + js.j_lastmade = 0; + else if (temp == js.j_lastasync) + js.j_lastasync = 0; + + free (temp->wd); + ndel = discard_pipeline (temp->pipe); + + js.c_injobs -= ndel; + if (temp->state == JDEAD) + { + js.c_reaped -= ndel; + js.j_ndead--; + if (js.c_reaped < 0) + { +#ifdef DEBUG + itrace("delete_job (%d pgrp %d): js.c_reaped (%d) < 0 ndel = %d js.j_ndead = %d", job_index, temp->pgrp, js.c_reaped, ndel, js.j_ndead); +#endif + js.c_reaped = 0; + } + } + + if (temp->deferred) + dispose_command (temp->deferred); + + free (temp); + + js.j_njobs--; + if (js.j_njobs == 0) + js.j_firstj = js.j_lastj = 0; + else if (jobs[js.j_firstj] == 0 || jobs[js.j_lastj] == 0) + reset_job_indices (); + + if (job_index == js.j_current || job_index == js.j_previous) + reset_current (); +} + +/* Must be called with SIGCHLD blocked. */ +void +nohup_job (job_index) + int job_index; +{ + register JOB *temp; + + if (js.j_jobslots == 0) + return; + + if (temp = jobs[job_index]) + temp->flags |= J_NOHUP; +} + +/* Get rid of the data structure associated with a process chain. */ +static int +discard_pipeline (chain) + register PROCESS *chain; +{ + register PROCESS *this, *next; + int n; + + this = chain; + n = 0; + do + { + next = this->next; + FREE (this->command); + free (this); + n++; + this = next; + } + while (this != chain); + + return n; +} + +/* Add this process to the chain being built in the_pipeline. + NAME is the command string that will be exec'ed later. + PID is the process id of the child. */ +static void +add_process (name, pid) + char *name; + pid_t pid; +{ + PROCESS *t, *p; + +#if defined (RECYCLES_PIDS) + int j; + p = find_process (pid, 0, &j); + if (p) + { +# ifdef DEBUG + if (j == NO_JOB) + internal_warning (_("add_process: process %5ld (%s) in the_pipeline"), (long)p->pid, p->command); +# endif + if (PALIVE (p)) + internal_warning (_("add_process: pid %5ld (%s) marked as still alive"), (long)p->pid, p->command); + p->running = PS_RECYCLED; /* mark as recycled */ + } +#endif + + t = (PROCESS *)xmalloc (sizeof (PROCESS)); + t->next = the_pipeline; + t->pid = pid; + WSTATUS (t->status) = 0; + t->running = PS_RUNNING; + t->command = name; + the_pipeline = t; + + if (t->next == 0) + t->next = t; + else + { + p = t->next; + while (p->next != t->next) + p = p->next; + p->next = t; + } +} + +/* Create a (dummy) PROCESS with NAME, PID, and STATUS, and make it the last + process in jobs[JID]->pipe. Used by the lastpipe code. */ +void +append_process (name, pid, status, jid) + char *name; + pid_t pid; + int status; + int jid; +{ + PROCESS *t, *p; + + t = (PROCESS *)xmalloc (sizeof (PROCESS)); + t->next = (PROCESS *)NULL; + t->pid = pid; + /* set process exit status using offset discovered by configure */ + t->status = (status & 0xff) << WEXITSTATUS_OFFSET; + t->running = PS_DONE; + t->command = name; + + js.c_reaped++; /* XXX */ + + for (p = jobs[jid]->pipe; p->next != jobs[jid]->pipe; p = p->next) + ; + p->next = t; + t->next = jobs[jid]->pipe; +} + +#if 0 +/* Take the last job and make it the first job. Must be called with + SIGCHLD blocked. */ +int +rotate_the_pipeline () +{ + PROCESS *p; + + if (the_pipeline->next == the_pipeline) + return; + for (p = the_pipeline; p->next != the_pipeline; p = p->next) + ; + the_pipeline = p; +} + +/* Reverse the order of the processes in the_pipeline. Must be called with + SIGCHLD blocked. */ +int +reverse_the_pipeline () +{ + PROCESS *p, *n; + + if (the_pipeline->next == the_pipeline) + return; + + for (p = the_pipeline; p->next != the_pipeline; p = p->next) + ; + p->next = (PROCESS *)NULL; + + n = REVERSE_LIST (the_pipeline, PROCESS *); + + the_pipeline = n; + for (p = the_pipeline; p->next; p = p->next) + ; + p->next = the_pipeline; +} +#endif + +/* Map FUNC over the list of jobs. If FUNC returns non-zero, + then it is time to stop mapping, and that is the return value + for map_over_jobs. FUNC is called with a JOB, arg1, arg2, + and INDEX. */ +static int +map_over_jobs (func, arg1, arg2) + sh_job_map_func_t *func; + int arg1, arg2; +{ + register int i; + int result; + sigset_t set, oset; + + if (js.j_jobslots == 0) + return 0; + + BLOCK_CHILD (set, oset); + + /* XXX could use js.j_firstj here */ + for (i = result = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("map_over_jobs: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("map_over_jobs: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + if (jobs[i]) + { + result = (*func)(jobs[i], arg1, arg2, i); + if (result) + break; + } + } + + UNBLOCK_CHILD (oset); + + return (result); +} + +/* Cause all the jobs in the current pipeline to exit. */ +void +terminate_current_pipeline () +{ + if (pipeline_pgrp && pipeline_pgrp != shell_pgrp) + { + killpg (pipeline_pgrp, SIGTERM); + killpg (pipeline_pgrp, SIGCONT); + } +} + +/* Cause all stopped jobs to exit. */ +void +terminate_stopped_jobs () +{ + register int i; + + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + { + if (jobs[i] && STOPPED (i)) + { + killpg (jobs[i]->pgrp, SIGTERM); + killpg (jobs[i]->pgrp, SIGCONT); + } + } +} + +/* Cause all jobs, running or stopped, to receive a hangup signal. If + a job is marked J_NOHUP, don't send the SIGHUP. */ +void +hangup_all_jobs () +{ + register int i; + + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + { + if (jobs[i]) + { + if (jobs[i]->flags & J_NOHUP) + continue; + killpg (jobs[i]->pgrp, SIGHUP); + if (STOPPED (i)) + killpg (jobs[i]->pgrp, SIGCONT); + } + } +} + +void +kill_current_pipeline () +{ + stop_making_children (); + start_pipeline (); +} + +/* Return the pipeline that PID belongs to. Note that the pipeline + doesn't have to belong to a job. Must be called with SIGCHLD blocked. + If JOBP is non-null, return the index of the job containing PID. */ +static PROCESS * +find_pipeline (pid, alive_only, jobp) + pid_t pid; + int alive_only; + int *jobp; /* index into jobs list or NO_JOB */ +{ + int job; + PROCESS *p; + + /* See if this process is in the pipeline that we are building. */ + if (jobp) + *jobp = NO_JOB; + if (the_pipeline) + { + p = the_pipeline; + do + { + /* Return it if we found it. Don't ever return a recycled pid. */ + if (p->pid == pid && ((alive_only == 0 && PRECYCLED(p) == 0) || PALIVE(p))) + return (p); + + p = p->next; + } + while (p != the_pipeline); + } + + job = find_job (pid, alive_only, &p); + if (jobp) + *jobp = job; + return (job == NO_JOB) ? (PROCESS *)NULL : jobs[job]->pipe; +} + +/* Return the PROCESS * describing PID. If JOBP is non-null return the index + into the jobs array of the job containing PID. Must be called with + SIGCHLD blocked. */ +static PROCESS * +find_process (pid, alive_only, jobp) + pid_t pid; + int alive_only; + int *jobp; /* index into jobs list or NO_JOB */ +{ + PROCESS *p; + + p = find_pipeline (pid, alive_only, jobp); + while (p && p->pid != pid) + p = p->next; + return p; +} + +/* Return the job index that PID belongs to, or NO_JOB if it doesn't + belong to any job. Must be called with SIGCHLD blocked. */ +static int +find_job (pid, alive_only, procp) + pid_t pid; + int alive_only; + PROCESS **procp; +{ + register int i; + PROCESS *p; + + /* XXX could use js.j_firstj here, and should check js.j_lastj */ + for (i = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("find_job: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("find_job: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + if (jobs[i]) + { + p = jobs[i]->pipe; + + do + { + if (p->pid == pid && ((alive_only == 0 && PRECYCLED(p) == 0) || PALIVE(p))) + { + if (procp) + *procp = p; + return (i); + } + + p = p->next; + } + while (p != jobs[i]->pipe); + } + } + + return (NO_JOB); +} + +/* Find a job given a PID. If BLOCK is non-zero, block SIGCHLD as + required by find_job. */ +int +get_job_by_pid (pid, block) + pid_t pid; + int block; +{ + int job; + sigset_t set, oset; + + if (block) + BLOCK_CHILD (set, oset); + + job = find_job (pid, 0, NULL); + + if (block) + UNBLOCK_CHILD (oset); + + return job; +} + +/* Print descriptive information about the job with leader pid PID. */ +void +describe_pid (pid) + pid_t pid; +{ + int job; + sigset_t set, oset; + + BLOCK_CHILD (set, oset); + + job = find_job (pid, 0, NULL); + + if (job != NO_JOB) + fprintf (stderr, "[%d] %ld\n", job + 1, (long)pid); + else + programming_error (_("describe_pid: %ld: no such pid"), (long)pid); + + UNBLOCK_CHILD (oset); +} + +static char * +j_strsignal (s) + int s; +{ + char *x; + + x = strsignal (s); + if (x == 0) + { + x = retcode_name_buffer; + sprintf (x, _("Signal %d"), s); + } + return x; +} + +static char * +printable_job_status (j, p, format) + int j; + PROCESS *p; + int format; +{ + static char *temp; + int es; + + temp = _("Done"); + + if (STOPPED (j) && format == 0) + { + if (posixly_correct == 0 || p == 0 || (WIFSTOPPED (p->status) == 0)) + temp = _("Stopped"); + else + { + temp = retcode_name_buffer; + sprintf (temp, _("Stopped(%s)"), signal_name (WSTOPSIG (p->status))); + } + } + else if (RUNNING (j)) + temp = _("Running"); + else + { + if (WIFSTOPPED (p->status)) + temp = j_strsignal (WSTOPSIG (p->status)); + else if (WIFSIGNALED (p->status)) + temp = j_strsignal (WTERMSIG (p->status)); + else if (WIFEXITED (p->status)) + { + temp = retcode_name_buffer; + es = WEXITSTATUS (p->status); + if (es == 0) + strcpy (temp, _("Done")); + else if (posixly_correct) + sprintf (temp, _("Done(%d)"), es); + else + sprintf (temp, _("Exit %d"), es); + } + else + temp = _("Unknown status"); + } + + return temp; +} + +/* This is the way to print out information on a job if you + know the index. FORMAT is: + + JLIST_NORMAL) [1]+ Running emacs + JLIST_LONG ) [1]+ 2378 Running emacs + -1 ) [1]+ 2378 emacs + + JLIST_NORMAL) [1]+ Stopped ls | more + JLIST_LONG ) [1]+ 2369 Stopped ls + 2367 | more + JLIST_PID_ONLY) + Just list the pid of the process group leader (really + the process group). + JLIST_CHANGED_ONLY) + Use format JLIST_NORMAL, but list only jobs about which + the user has not been notified. */ + +/* Print status for pipeline P. If JOB_INDEX is >= 0, it is the index into + the JOBS array corresponding to this pipeline. FORMAT is as described + above. Must be called with SIGCHLD blocked. + + If you're printing a pipeline that's not in the jobs array, like the + current pipeline as it's being created, pass -1 for JOB_INDEX */ +static void +print_pipeline (p, job_index, format, stream) + PROCESS *p; + int job_index, format; + FILE *stream; +{ + PROCESS *first, *last, *show; + int es, name_padding; + char *temp; + + if (p == 0) + return; + + first = last = p; + while (last->next != first) + last = last->next; + + for (;;) + { + if (p != first) + fprintf (stream, format ? " " : " |"); + + if (format != JLIST_STANDARD) + fprintf (stream, "%5ld", (long)p->pid); + + fprintf (stream, " "); + + if (format > -1 && job_index >= 0) + { + show = format ? p : last; + temp = printable_job_status (job_index, show, format); + + if (p != first) + { + if (format) + { + if (show->running == first->running && + WSTATUS (show->status) == WSTATUS (first->status)) + temp = ""; + } + else + temp = (char *)NULL; + } + + if (temp) + { + fprintf (stream, "%s", temp); + + es = STRLEN (temp); + if (es == 0) + es = 2; /* strlen ("| ") */ + name_padding = LONGEST_SIGNAL_DESC - es; + + fprintf (stream, "%*s", name_padding, ""); + + if ((WIFSTOPPED (show->status) == 0) && + (WIFCONTINUED (show->status) == 0) && + WIFCORED (show->status)) + fprintf (stream, _("(core dumped) ")); + } + } + + if (p != first && format) + fprintf (stream, "| "); + + if (p->command) + fprintf (stream, "%s", p->command); + + if (p == last && job_index >= 0) + { + temp = current_working_directory (); + + if (RUNNING (job_index) && (IS_FOREGROUND (job_index) == 0)) + fprintf (stream, " &"); + + if (strcmp (temp, jobs[job_index]->wd) != 0) + fprintf (stream, + _(" (wd: %s)"), polite_directory_format (jobs[job_index]->wd)); + } + + if (format || (p == last)) + { + /* We need to add a CR only if this is an interactive shell, and + we're reporting the status of a completed job asynchronously. + We can't really check whether this particular job is being + reported asynchronously, so just add the CR if the shell is + currently interactive and asynchronous notification is enabled. */ + if (asynchronous_notification && interactive) + fprintf (stream, "\r\n"); + else + fprintf (stream, "\n"); + } + + if (p == last) + break; + p = p->next; + } + fflush (stream); +} + +/* Print information to STREAM about jobs[JOB_INDEX] according to FORMAT. + Must be called with SIGCHLD blocked or queued with queue_sigchld */ +static void +pretty_print_job (job_index, format, stream) + int job_index, format; + FILE *stream; +{ + register PROCESS *p; + + /* Format only pid information about the process group leader? */ + if (format == JLIST_PID_ONLY) + { + fprintf (stream, "%ld\n", (long)jobs[job_index]->pipe->pid); + return; + } + + if (format == JLIST_CHANGED_ONLY) + { + if (IS_NOTIFIED (job_index)) + return; + format = JLIST_STANDARD; + } + + if (format != JLIST_NONINTERACTIVE) + fprintf (stream, "[%d]%c ", job_index + 1, + (job_index == js.j_current) ? '+': + (job_index == js.j_previous) ? '-' : ' '); + + if (format == JLIST_NONINTERACTIVE) + format = JLIST_LONG; + + p = jobs[job_index]->pipe; + + print_pipeline (p, job_index, format, stream); + + /* We have printed information about this job. When the job's + status changes, waitchld () sets the notification flag to 0. */ + jobs[job_index]->flags |= J_NOTIFIED; +} + +static int +print_job (job, format, state, job_index) + JOB *job; + int format, state, job_index; +{ + if (state == -1 || (JOB_STATE)state == job->state) + pretty_print_job (job_index, format, stdout); + return (0); +} + +void +list_one_job (job, format, ignore, job_index) + JOB *job; + int format, ignore, job_index; +{ + pretty_print_job (job_index, format, stdout); +} + +void +list_stopped_jobs (format) + int format; +{ + cleanup_dead_jobs (); + map_over_jobs (print_job, format, (int)JSTOPPED); +} + +void +list_running_jobs (format) + int format; +{ + cleanup_dead_jobs (); + map_over_jobs (print_job, format, (int)JRUNNING); +} + +/* List jobs. If FORMAT is non-zero, then the long form of the information + is printed, else just a short version. */ +void +list_all_jobs (format) + int format; +{ + cleanup_dead_jobs (); + map_over_jobs (print_job, format, -1); +} + +/* Fork, handling errors. Returns the pid of the newly made child, or 0. + COMMAND is just for remembering the name of the command; we don't do + anything else with it. ASYNC_P says what to do with the tty. If + non-zero, then don't give it away. */ +pid_t +make_child (command, async_p) + char *command; + int async_p; +{ + int forksleep; + sigset_t set, oset; + pid_t pid; + + /* XXX - block SIGTERM here and unblock in child after fork resets the + set of pending signals? */ + sigemptyset (&set); + sigaddset (&set, SIGCHLD); + sigaddset (&set, SIGINT); + sigemptyset (&oset); + sigprocmask (SIG_BLOCK, &set, &oset); + + making_children (); + + forksleep = 1; + +#if defined (BUFFERED_INPUT) + /* If default_buffered_input is active, we are reading a script. If + the command is asynchronous, we have already duplicated /dev/null + as fd 0, but have not changed the buffered stream corresponding to + the old fd 0. We don't want to sync the stream in this case. */ + if (default_buffered_input != -1 && + (!async_p || default_buffered_input > 0)) + sync_buffered_stream (default_buffered_input); +#endif /* BUFFERED_INPUT */ + + RESET_SIGTERM; + + /* Create the child, handle severe errors. Retry on EAGAIN. */ + while ((pid = fork ()) < 0 && errno == EAGAIN && forksleep < FORKSLEEP_MAX) + { + /* bash-4.2 */ + /* If we can't create any children, try to reap some dead ones. */ + waitchld (-1, 0); + + sys_error ("fork: retry"); + RESET_SIGTERM; + + if (sleep (forksleep) != 0) + break; + forksleep <<= 1; + } + + if (pid != 0) + RESET_SIGTERM; + + if (pid < 0) + { + sys_error ("fork"); + + /* Kill all of the processes in the current pipeline. */ + terminate_current_pipeline (); + + /* Discard the current pipeline, if any. */ + if (the_pipeline) + kill_current_pipeline (); + + last_command_exit_value = EX_NOEXEC; + throw_to_top_level (); /* Reset signals, etc. */ + } + + if (pid == 0) + { + /* In the child. Give this child the right process group, set the + signals to the default state for a new process. */ + pid_t mypid; + + mypid = getpid (); +#if defined (BUFFERED_INPUT) + /* Close default_buffered_input if it's > 0. We don't close it if it's + 0 because that's the file descriptor used when redirecting input, + and it's wrong to close the file in that case. */ + unset_bash_input (0); +#endif /* BUFFERED_INPUT */ + + /* Restore top-level signal mask. */ + sigprocmask (SIG_SETMASK, &top_level_mask, (sigset_t *)NULL); + + if (job_control) + { + /* All processes in this pipeline belong in the same + process group. */ + + if (pipeline_pgrp == 0) /* This is the first child. */ + pipeline_pgrp = mypid; + + /* Check for running command in backquotes. */ + if (pipeline_pgrp == shell_pgrp) + ignore_tty_job_signals (); + else + default_tty_job_signals (); + + /* Set the process group before trying to mess with the terminal's + process group. This is mandated by POSIX. */ + /* This is in accordance with the Posix 1003.1 standard, + section B.7.2.4, which says that trying to set the terminal + process group with tcsetpgrp() to an unused pgrp value (like + this would have for the first child) is an error. Section + B.4.3.3, p. 237 also covers this, in the context of job control + shells. */ + if (setpgid (mypid, pipeline_pgrp) < 0) + sys_error (_("child setpgid (%ld to %ld)"), (long)mypid, (long)pipeline_pgrp); + + /* By convention (and assumption above), if + pipeline_pgrp == shell_pgrp, we are making a child for + command substitution. + In this case, we don't want to give the terminal to the + shell's process group (we could be in the middle of a + pipeline, for example). */ + if (async_p == 0 && pipeline_pgrp != shell_pgrp && ((subshell_environment&SUBSHELL_ASYNC) == 0)) + give_terminal_to (pipeline_pgrp, 0); + +#if defined (PGRP_PIPE) + if (pipeline_pgrp == mypid) + pipe_read (pgrp_pipe); +#endif + } + else /* Without job control... */ + { + if (pipeline_pgrp == 0) + pipeline_pgrp = shell_pgrp; + + /* If these signals are set to SIG_DFL, we encounter the curious + situation of an interactive ^Z to a running process *working* + and stopping the process, but being unable to do anything with + that process to change its state. On the other hand, if they + are set to SIG_IGN, jobs started from scripts do not stop when + the shell running the script gets a SIGTSTP and stops. */ + + default_tty_job_signals (); + } + +#if defined (PGRP_PIPE) + /* Release the process group pipe, since our call to setpgid () + is done. The last call to sh_closepipe is done in stop_pipeline. */ + sh_closepipe (pgrp_pipe); +#endif /* PGRP_PIPE */ + +#if 0 + /* Don't set last_asynchronous_pid in the child */ + if (async_p) + last_asynchronous_pid = mypid; /* XXX */ + else +#endif +#if defined (RECYCLES_PIDS) + if (last_asynchronous_pid == mypid) + /* Avoid pid aliasing. 1 seems like a safe, unusual pid value. */ + last_asynchronous_pid = 1; +#endif + } + else + { + /* In the parent. Remember the pid of the child just created + as the proper pgrp if this is the first child. */ + + if (job_control) + { + if (pipeline_pgrp == 0) + { + pipeline_pgrp = pid; + /* Don't twiddle terminal pgrps in the parent! This is the bug, + not the good thing of twiddling them in the child! */ + /* give_terminal_to (pipeline_pgrp, 0); */ + } + /* This is done on the recommendation of the Rationale section of + the POSIX 1003.1 standard, where it discusses job control and + shells. It is done to avoid possible race conditions. (Ref. + 1003.1 Rationale, section B.4.3.3, page 236). */ + setpgid (pid, pipeline_pgrp); + } + else + { + if (pipeline_pgrp == 0) + pipeline_pgrp = shell_pgrp; + } + + /* Place all processes into the jobs array regardless of the + state of job_control. */ + add_process (command, pid); + + if (async_p) + last_asynchronous_pid = pid; +#if defined (RECYCLES_PIDS) + else if (last_asynchronous_pid == pid) + /* Avoid pid aliasing. 1 seems like a safe, unusual pid value. */ + last_asynchronous_pid = 1; +#endif + + /* Delete the saved status for any job containing this PID in case it's + been reused. */ + delete_old_job (pid); + + /* Perform the check for pid reuse unconditionally. Some systems reuse + PIDs before giving a process CHILD_MAX/_SC_CHILD_MAX unique ones. */ + bgp_delete (pid); /* new process, discard any saved status */ + + last_made_pid = pid; + + /* keep stats */ + js.c_totforked++; + js.c_living++; + + /* Unblock SIGINT and SIGCHLD unless creating a pipeline, in which case + SIGCHLD remains blocked until all commands in the pipeline have been + created. */ + sigprocmask (SIG_SETMASK, &oset, (sigset_t *)NULL); + } + + return (pid); +} + +/* These two functions are called only in child processes. */ +void +ignore_tty_job_signals () +{ + set_signal_handler (SIGTSTP, SIG_IGN); + set_signal_handler (SIGTTIN, SIG_IGN); + set_signal_handler (SIGTTOU, SIG_IGN); +} + +void +default_tty_job_signals () +{ + set_signal_handler (SIGTSTP, SIG_DFL); + set_signal_handler (SIGTTIN, SIG_DFL); + set_signal_handler (SIGTTOU, SIG_DFL); +} + +/* When we end a job abnormally, or if we stop a job, we set the tty to the + state kept in here. When a job ends normally, we set the state in here + to the state of the tty. */ + +static TTYSTRUCT shell_tty_info; + +#if defined (NEW_TTY_DRIVER) +static struct tchars shell_tchars; +static struct ltchars shell_ltchars; +#endif /* NEW_TTY_DRIVER */ + +#if defined (NEW_TTY_DRIVER) && defined (DRAIN_OUTPUT) +/* Since the BSD tty driver does not allow us to change the tty modes + while simultaneously waiting for output to drain and preserving + typeahead, we have to drain the output ourselves before calling + ioctl. We cheat by finding the length of the output queue, and + using select to wait for an appropriate length of time. This is + a hack, and should be labeled as such (it's a hastily-adapted + mutation of a `usleep' implementation). It's only reason for + existing is the flaw in the BSD tty driver. */ + +static int ttspeeds[] = +{ + 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, + 1800, 2400, 4800, 9600, 19200, 38400 +}; + +static void +draino (fd, ospeed) + int fd, ospeed; +{ + register int delay = ttspeeds[ospeed]; + int n; + + if (!delay) + return; + + while ((ioctl (fd, TIOCOUTQ, &n) == 0) && n) + { + if (n > (delay / 100)) + { + struct timeval tv; + + n *= 10; /* 2 bits more for conservativeness. */ + tv.tv_sec = n / delay; + tv.tv_usec = ((n % delay) * 1000000) / delay; + select (fd, (fd_set *)0, (fd_set *)0, (fd_set *)0, &tv); + } + else + break; + } +} +#endif /* NEW_TTY_DRIVER && DRAIN_OUTPUT */ + +/* Return the fd from which we are actually getting input. */ +#define input_tty() (shell_tty != -1) ? shell_tty : fileno (stderr) + +/* Fill the contents of shell_tty_info with the current tty info. */ +int +get_tty_state () +{ + int tty; + + tty = input_tty (); + if (tty != -1) + { +#if defined (NEW_TTY_DRIVER) + ioctl (tty, TIOCGETP, &shell_tty_info); + ioctl (tty, TIOCGETC, &shell_tchars); + ioctl (tty, TIOCGLTC, &shell_ltchars); +#endif /* NEW_TTY_DRIVER */ + +#if defined (TERMIO_TTY_DRIVER) + ioctl (tty, TCGETA, &shell_tty_info); +#endif /* TERMIO_TTY_DRIVER */ + +#if defined (TERMIOS_TTY_DRIVER) + if (tcgetattr (tty, &shell_tty_info) < 0) + { +#if 0 + /* Only print an error message if we're really interactive at + this time. */ + if (interactive) + sys_error ("[%ld: %d (%d)] tcgetattr", (long)getpid (), shell_level, tty); +#endif + return -1; + } +#endif /* TERMIOS_TTY_DRIVER */ + if (check_window_size) + get_new_window_size (0, (int *)0, (int *)0); + } + return 0; +} + +/* Make the current tty use the state in shell_tty_info. */ +int +set_tty_state () +{ + int tty; + + tty = input_tty (); + if (tty != -1) + { +#if defined (NEW_TTY_DRIVER) +# if defined (DRAIN_OUTPUT) + draino (tty, shell_tty_info.sg_ospeed); +# endif /* DRAIN_OUTPUT */ + ioctl (tty, TIOCSETN, &shell_tty_info); + ioctl (tty, TIOCSETC, &shell_tchars); + ioctl (tty, TIOCSLTC, &shell_ltchars); +#endif /* NEW_TTY_DRIVER */ + +#if defined (TERMIO_TTY_DRIVER) + ioctl (tty, TCSETAW, &shell_tty_info); +#endif /* TERMIO_TTY_DRIVER */ + +#if defined (TERMIOS_TTY_DRIVER) + if (tcsetattr (tty, TCSADRAIN, &shell_tty_info) < 0) + { + /* Only print an error message if we're really interactive at + this time. */ + if (interactive) + sys_error ("[%ld: %d (%d)] tcsetattr", (long)getpid (), shell_level, tty); + return -1; + } +#endif /* TERMIOS_TTY_DRIVER */ + } + return 0; +} + +/* Given an index into the jobs array JOB, return the PROCESS struct of the last + process in that job's pipeline. This is the one whose exit status + counts. Must be called with SIGCHLD blocked or queued. */ +static PROCESS * +find_last_proc (job, block) + int job; + int block; +{ + register PROCESS *p; + sigset_t set, oset; + + if (block) + BLOCK_CHILD (set, oset); + + p = jobs[job]->pipe; + while (p && p->next != jobs[job]->pipe) + p = p->next; + + if (block) + UNBLOCK_CHILD (oset); + + return (p); +} + +static pid_t +find_last_pid (job, block) + int job; + int block; +{ + PROCESS *p; + + p = find_last_proc (job, block); + /* Possible race condition here. */ + return p->pid; +} + +/* Wait for a particular child of the shell to finish executing. + This low-level function prints an error message if PID is not + a child of this shell. It returns -1 if it fails, or whatever + wait_for returns otherwise. If the child is not found in the + jobs table, it returns 127. */ +int +wait_for_single_pid (pid) + pid_t pid; +{ + register PROCESS *child; + sigset_t set, oset; + int r, job; + + BLOCK_CHILD (set, oset); + child = find_pipeline (pid, 0, (int *)NULL); + UNBLOCK_CHILD (oset); + + if (child == 0) + { + r = bgp_search (pid); + if (r >= 0) + return r; + } + + if (child == 0) + { + internal_error (_("wait: pid %ld is not a child of this shell"), (long)pid); + return (127); + } + + r = wait_for (pid); + + /* POSIX.2: if we just waited for a job, we can remove it from the jobs + table. */ + BLOCK_CHILD (set, oset); + job = find_job (pid, 0, NULL); + if (job != NO_JOB && jobs[job] && DEADJOB (job)) + jobs[job]->flags |= J_NOTIFIED; + UNBLOCK_CHILD (oset); + + /* If running in posix mode, remove the job from the jobs table immediately */ + if (posixly_correct) + { + cleanup_dead_jobs (); + bgp_delete (pid); + } + + return r; +} + +/* Wait for all of the background processes started by this shell to finish. */ +void +wait_for_background_pids () +{ + register int i, r, waited_for; + sigset_t set, oset; + pid_t pid; + + for (waited_for = 0;;) + { + BLOCK_CHILD (set, oset); + + /* find first running job; if none running in foreground, break */ + /* XXX could use js.j_firstj and js.j_lastj here */ + for (i = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("wait_for_background_pids: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("wait_for_background_pids: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + if (jobs[i] && RUNNING (i) && IS_FOREGROUND (i) == 0) + break; + } + if (i == js.j_jobslots) + { + UNBLOCK_CHILD (oset); + break; + } + + /* now wait for the last pid in that job. */ + pid = find_last_pid (i, 0); + UNBLOCK_CHILD (oset); + QUIT; + errno = 0; /* XXX */ + r = wait_for_single_pid (pid); + if (r == -1) + { + /* If we're mistaken about job state, compensate. */ + if (errno == ECHILD) + mark_all_jobs_as_dead (); + } + else + waited_for++; + } + + /* POSIX.2 says the shell can discard the statuses of all completed jobs if + `wait' is called with no arguments. */ + mark_dead_jobs_as_notified (1); + cleanup_dead_jobs (); + bgp_clear (); +} + +/* Make OLD_SIGINT_HANDLER the SIGINT signal handler. */ +#define INVALID_SIGNAL_HANDLER (SigHandler *)wait_for_background_pids +static SigHandler *old_sigint_handler = INVALID_SIGNAL_HANDLER; + +static int wait_sigint_received; +static int child_caught_sigint; +static int waiting_for_child; + +static void +restore_sigint_handler () +{ + if (old_sigint_handler != INVALID_SIGNAL_HANDLER) + { + set_signal_handler (SIGINT, old_sigint_handler); + old_sigint_handler = INVALID_SIGNAL_HANDLER; + waiting_for_child = 0; + } +} + +/* Handle SIGINT while we are waiting for children in a script to exit. + The `wait' builtin should be interruptible, but all others should be + effectively ignored (i.e. not cause the shell to exit). */ +static sighandler +wait_sigint_handler (sig) + int sig; +{ + SigHandler *sigint_handler; + + if (interrupt_immediately || + (this_shell_builtin && this_shell_builtin == wait_builtin)) + { + last_command_exit_value = 128+SIGINT; + restore_sigint_handler (); + /* If we got a SIGINT while in `wait', and SIGINT is trapped, do + what POSIX.2 says (see builtins/wait.def for more info). */ + if (this_shell_builtin && this_shell_builtin == wait_builtin && + signal_is_trapped (SIGINT) && + ((sigint_handler = trap_to_sighandler (SIGINT)) == trap_handler)) + { + trap_handler (SIGINT); /* set pending_traps[SIGINT] */ + wait_signal_received = SIGINT; + if (interrupt_immediately) + { + interrupt_immediately = 0; + longjmp (wait_intr_buf, 1); + } + else + /* Let CHECK_WAIT_INTR handle it in wait_for/waitchld */ + SIGRETURN (0); + } + else if (interrupt_immediately) + { + ADDINTERRUPT; + QUIT; + } + else /* wait_builtin but signal not trapped, treat as interrupt */ + kill (getpid (), SIGINT); + } + + /* XXX - should this be interrupt_state? If it is, the shell will act + as if it got the SIGINT interrupt. */ + if (waiting_for_child) + wait_sigint_received = 1; + else + { + last_command_exit_value = 128+SIGINT; + restore_sigint_handler (); + kill (getpid (), SIGINT); + } + + /* Otherwise effectively ignore the SIGINT and allow the running job to + be killed. */ + SIGRETURN (0); +} + +static int +process_exit_signal (status) + WAIT status; +{ + return (WIFSIGNALED (status) ? WTERMSIG (status) : 0); +} + +static int +process_exit_status (status) + WAIT status; +{ + if (WIFSIGNALED (status)) + return (128 + WTERMSIG (status)); + else if (WIFSTOPPED (status) == 0) + return (WEXITSTATUS (status)); + else + return (EXECUTION_SUCCESS); +} + +static WAIT +job_signal_status (job) + int job; +{ + register PROCESS *p; + WAIT s; + + p = jobs[job]->pipe; + do + { + s = p->status; + if (WIFSIGNALED(s) || WIFSTOPPED(s)) + break; + p = p->next; + } + while (p != jobs[job]->pipe); + + return s; +} + +/* Return the exit status of the last process in the pipeline for job JOB. + This is the exit status of the entire job. */ +static WAIT +raw_job_exit_status (job) + int job; +{ + register PROCESS *p; + int fail; + WAIT ret; + + if (pipefail_opt) + { + fail = 0; + p = jobs[job]->pipe; + do + { + if (WSTATUS (p->status) != EXECUTION_SUCCESS) + fail = WSTATUS(p->status); + p = p->next; + } + while (p != jobs[job]->pipe); + WSTATUS (ret) = fail; + return ret; + } + + for (p = jobs[job]->pipe; p->next != jobs[job]->pipe; p = p->next) + ; + return (p->status); +} + +/* Return the exit status of job JOB. This is the exit status of the last + (rightmost) process in the job's pipeline, modified if the job was killed + by a signal or stopped. */ +int +job_exit_status (job) + int job; +{ + return (process_exit_status (raw_job_exit_status (job))); +} + +int +job_exit_signal (job) + int job; +{ + return (process_exit_signal (raw_job_exit_status (job))); +} + +#define FIND_CHILD(pid, child) \ + do \ + { \ + child = find_pipeline (pid, 0, (int *)NULL); \ + if (child == 0) \ + { \ + give_terminal_to (shell_pgrp, 0); \ + UNBLOCK_CHILD (oset); \ + internal_error (_("wait_for: No record of process %ld"), (long)pid); \ + restore_sigint_handler (); \ + return (termination_state = 127); \ + } \ + } \ + while (0) + +/* Wait for pid (one of our children) to terminate, then + return the termination state. Returns 127 if PID is not found in + the jobs table. Returns -1 if waitchld() returns -1, indicating + that there are no unwaited-for child processes. */ +int +wait_for (pid) + pid_t pid; +{ + int job, termination_state, r; + WAIT s; + register PROCESS *child; + sigset_t set, oset; + + /* In the case that this code is interrupted, and we longjmp () out of it, + we are relying on the code in throw_to_top_level () to restore the + top-level signal mask. */ + child = 0; + BLOCK_CHILD (set, oset); + + /* Ignore interrupts while waiting for a job run without job control + to finish. We don't want the shell to exit if an interrupt is + received, only if one of the jobs run is killed via SIGINT. If + job control is not set, the job will be run in the same pgrp as + the shell, and the shell will see any signals the job gets. In + fact, we want this set every time the waiting shell and the waited- + for process are in the same process group, including command + substitution. */ + + /* This is possibly a race condition -- should it go in stop_pipeline? */ + wait_sigint_received = child_caught_sigint = 0; + if (job_control == 0 || (subshell_environment&SUBSHELL_COMSUB)) + { + old_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler); + waiting_for_child = 0; + if (old_sigint_handler == SIG_IGN) + set_signal_handler (SIGINT, old_sigint_handler); + } + + termination_state = last_command_exit_value; + + if (interactive && job_control == 0) + QUIT; + /* Check for terminating signals and exit the shell if we receive one */ + CHECK_TERMSIG; + + /* Check for a trapped signal interrupting the wait builtin and jump out */ + CHECK_WAIT_INTR; + + /* If we say wait_for (), then we have a record of this child somewhere. + If it and none of its peers are running, don't call waitchld(). */ + + job = NO_JOB; + do + { + if (pid != ANY_PID) + FIND_CHILD (pid, child); + + /* If this child is part of a job, then we are really waiting for the + job to finish. Otherwise, we are waiting for the child to finish. + We check for JDEAD in case the job state has been set by waitchld + after receipt of a SIGCHLD. */ + if (job == NO_JOB) + job = find_job (pid, 0, NULL); + + /* waitchld() takes care of setting the state of the job. If the job + has already exited before this is called, sigchld_handler will have + called waitchld and the state will be set to JDEAD. */ + + if (pid == ANY_PID || PRUNNING(child) || (job != NO_JOB && RUNNING (job))) + { +#if defined (WAITPID_BROKEN) /* SCOv4 */ + sigset_t suspend_set; + sigemptyset (&suspend_set); + sigsuspend (&suspend_set); +#else /* !WAITPID_BROKEN */ +# if defined (MUST_UNBLOCK_CHLD) + struct sigaction act, oact; + sigset_t nullset, chldset; + + sigemptyset (&nullset); + sigemptyset (&chldset); + sigprocmask (SIG_SETMASK, &nullset, &chldset); + act.sa_handler = SIG_DFL; + sigemptyset (&act.sa_mask); + sigemptyset (&oact.sa_mask); + act.sa_flags = 0; +# if defined (SA_RESTART) + act.sa_flags |= SA_RESTART; +# endif + sigaction (SIGCHLD, &act, &oact); +# endif /* MUST_UNBLOCK_CHLD */ + queue_sigchld = 1; + waiting_for_child++; + r = waitchld (pid, 1); /* XXX */ + waiting_for_child--; +#if 0 +itrace("wait_for: blocking wait for %d returns %d child = %p", (int)pid, r, child); +#endif +# if defined (MUST_UNBLOCK_CHLD) + sigaction (SIGCHLD, &oact, (struct sigaction *)NULL); + sigprocmask (SIG_SETMASK, &chldset, (sigset_t *)NULL); +# endif + queue_sigchld = 0; + if (r == -1 && errno == ECHILD && this_shell_builtin == wait_builtin) + { + termination_state = -1; + /* XXX - restore sigint handler here? */ + goto wait_for_return; + } + + /* If child is marked as running, but waitpid() returns -1/ECHILD, + there is something wrong. Somewhere, wait should have returned + that child's pid. Mark the child as not running and the job, + if it exists, as JDEAD. */ + if (r == -1 && errno == ECHILD) + { + if (child) + { + child->running = PS_DONE; + WSTATUS (child->status) = 0; /* XXX -- can't find true status */ + } + js.c_living = 0; /* no living child processes */ + if (job != NO_JOB) + { + jobs[job]->state = JDEAD; + js.c_reaped++; + js.j_ndead++; + } + if (pid == ANY_PID) + { + termination_state = -1; + break; + } + } +#endif /* WAITPID_BROKEN */ + } + + /* If the shell is interactive, and job control is disabled, see + if the foreground process has died due to SIGINT and jump out + of the wait loop if it has. waitchld has already restored the + old SIGINT signal handler. */ + if (interactive && job_control == 0) + QUIT; + /* Check for terminating signals and exit the shell if we receive one */ + CHECK_TERMSIG; + + /* Check for a trapped signal interrupting the wait builtin and jump out */ + CHECK_WAIT_INTR; + + if (pid == ANY_PID) + /* XXX - could set child but we don't have a handle on what waitchld + reaps. Leave termination_state alone. */ + goto wait_for_return; + } + while (PRUNNING (child) || (job != NO_JOB && RUNNING (job))); + + /* Restore the original SIGINT signal handler before we return. */ + restore_sigint_handler (); + + /* The exit state of the command is either the termination state of the + child, or the termination state of the job. If a job, the status + of the last child in the pipeline is the significant one. If the command + or job was terminated by a signal, note that value also. */ + termination_state = (job != NO_JOB) ? job_exit_status (job) + : process_exit_status (child->status); + last_command_exit_signal = (job != NO_JOB) ? job_exit_signal (job) + : process_exit_signal (child->status); + + /* XXX */ + if ((job != NO_JOB && JOBSTATE (job) == JSTOPPED) || WIFSTOPPED (child->status)) + termination_state = 128 + WSTOPSIG (child->status); + + if (job == NO_JOB || IS_JOBCONTROL (job)) + { + /* XXX - under what circumstances is a job not present in the jobs + table (job == NO_JOB)? + 1. command substitution + + In the case of command substitution, at least, it's probably not + the right thing to give the terminal to the shell's process group, + even though there is code in subst.c:command_substitute to work + around it. + + Things that don't: + $PROMPT_COMMAND execution + process substitution + */ +#if 0 +if (job == NO_JOB) + itrace("wait_for: job == NO_JOB, giving the terminal to shell_pgrp (%ld)", (long)shell_pgrp); +#endif + give_terminal_to (shell_pgrp, 0); + } + + /* If the command did not exit cleanly, or the job is just + being stopped, then reset the tty state back to what it + was before this command. Reset the tty state and notify + the user of the job termination only if the shell is + interactive. Clean up any dead jobs in either case. */ + if (job != NO_JOB) + { + if (interactive_shell && subshell_environment == 0) + { + /* This used to use `child->status'. That's wrong, however, for + pipelines. `child' is the first process in the pipeline. It's + likely that the process we want to check for abnormal termination + or stopping is the last process in the pipeline, especially if + it's long-lived and the first process is short-lived. Since we + know we have a job here, we can check all the processes in this + job's pipeline and see if one of them stopped or terminated due + to a signal. We might want to change this later to just check + the last process in the pipeline. If no process exits due to a + signal, S is left as the status of the last job in the pipeline. */ + s = job_signal_status (job); + + if (WIFSIGNALED (s) || WIFSTOPPED (s)) + { + set_tty_state (); + + /* If the current job was stopped or killed by a signal, and + the user has requested it, get a possibly new window size */ + if (check_window_size && (job == js.j_current || IS_FOREGROUND (job))) + get_new_window_size (0, (int *)0, (int *)0); + } + else + get_tty_state (); + + /* If job control is enabled, the job was started with job + control, the job was the foreground job, and it was killed + by SIGINT, then print a newline to compensate for the kernel + printing the ^C without a trailing newline. */ + if (job_control && IS_JOBCONTROL (job) && IS_FOREGROUND (job) && + WIFSIGNALED (s) && WTERMSIG (s) == SIGINT) + { + /* If SIGINT is not trapped and the shell is in a for, while, + or until loop, act as if the shell received SIGINT as + well, so the loop can be broken. This doesn't call the + SIGINT signal handler; maybe it should. */ + if (signal_is_trapped (SIGINT) == 0 && (loop_level || (shell_compatibility_level > 32 && executing_list))) + ADDINTERRUPT; + else + { + putchar ('\n'); + fflush (stdout); + } + } + } + else if ((subshell_environment & (SUBSHELL_COMSUB|SUBSHELL_PIPE)) && wait_sigint_received) + { + /* If waiting for a job in a subshell started to do command + substitution or to run a pipeline element that consists of + something like a while loop or a for loop, simulate getting + and being killed by the SIGINT to pass the status back to our + parent. */ + s = job_signal_status (job); + + if (child_caught_sigint == 0 && signal_is_trapped (SIGINT) == 0) + { + UNBLOCK_CHILD (oset); + old_sigint_handler = set_signal_handler (SIGINT, SIG_DFL); + if (old_sigint_handler == SIG_IGN) + restore_sigint_handler (); + else + kill (getpid (), SIGINT); + } + } + else if (interactive_shell == 0 && IS_FOREGROUND (job) && check_window_size) + get_new_window_size (0, (int *)0, (int *)0); + + /* Moved here from set_job_status_and_cleanup, which is in the SIGCHLD + signal handler path */ + if (DEADJOB (job) && IS_FOREGROUND (job) /*&& subshell_environment == 0*/) + setjstatus (job); + + /* If this job is dead, notify the user of the status. If the shell + is interactive, this will display a message on the terminal. If + the shell is not interactive, make sure we turn on the notify bit + so we don't get an unwanted message about the job's termination, + and so delete_job really clears the slot in the jobs table. */ + notify_and_cleanup (); + } + +wait_for_return: + + UNBLOCK_CHILD (oset); + + return (termination_state); +} + +/* Wait for the last process in the pipeline for JOB. Returns whatever + wait_for returns: the last process's termination state or -1 if there + are no unwaited-for child processes or an error occurs. */ +int +wait_for_job (job) + int job; +{ + pid_t pid; + int r; + sigset_t set, oset; + + BLOCK_CHILD(set, oset); + if (JOBSTATE (job) == JSTOPPED) + internal_warning (_("wait_for_job: job %d is stopped"), job+1); + + pid = find_last_pid (job, 0); + UNBLOCK_CHILD(oset); + r = wait_for (pid); + + /* POSIX.2: we can remove the job from the jobs table if we just waited + for it. */ + BLOCK_CHILD (set, oset); + if (job != NO_JOB && jobs[job] && DEADJOB (job)) + jobs[job]->flags |= J_NOTIFIED; + UNBLOCK_CHILD (oset); + + return r; +} + +/* Wait for any background job started by this shell to finish. Very + similar to wait_for_background_pids(). Returns the exit status of + the next exiting job, -1 if there are no background jobs. The caller + is responsible for translating -1 into the right return value. */ +int +wait_for_any_job () +{ + pid_t pid; + int i, r, waited_for; + sigset_t set, oset; + + if (jobs_list_frozen) + return -1; + + /* First see if there are any unnotified dead jobs that we can report on */ + BLOCK_CHILD (set, oset); + for (i = 0; i < js.j_jobslots; i++) + { + if (jobs[i] && DEADJOB (i) && IS_NOTIFIED (i) == 0) + { +return_job: + r = job_exit_status (i); + notify_of_job_status (); /* XXX */ + delete_job (i, 0); +#if defined (COPROCESS_SUPPORT) + coproc_reap (); +#endif + UNBLOCK_CHILD (oset); + return r; + } + } + UNBLOCK_CHILD (oset); + + /* At this point, we have no dead jobs in the jobs table. Wait until we + get one, even if it takes multiple pids exiting. */ + for (waited_for = 0;;) + { + /* Make sure there is a background job to wait for */ + BLOCK_CHILD (set, oset); + for (i = 0; i < js.j_jobslots; i++) + if (jobs[i] && RUNNING (i) && IS_FOREGROUND (i) == 0) + break; + if (i == js.j_jobslots) + { + UNBLOCK_CHILD (oset); + return -1; + } + + UNBLOCK_CHILD (oset); + + QUIT; + CHECK_TERMSIG; + CHECK_WAIT_INTR; + + errno = 0; + r = wait_for (ANY_PID); /* special sentinel value for wait_for */ + if (r == -1 && errno == ECHILD) + mark_all_jobs_as_dead (); + + /* Now we see if we have any dead jobs and return the first one */ + BLOCK_CHILD (set, oset); + for (i = 0; i < js.j_jobslots; i++) + if (jobs[i] && DEADJOB (i)) + goto return_job; + UNBLOCK_CHILD (oset); + } + + return -1; +} + +/* Print info about dead jobs, and then delete them from the list + of known jobs. This does not actually delete jobs when the + shell is not interactive, because the dead jobs are not marked + as notified. */ +void +notify_and_cleanup () +{ + if (jobs_list_frozen) + return; + + if (interactive || interactive_shell == 0 || sourcelevel) + notify_of_job_status (); + + cleanup_dead_jobs (); +} + +/* Make dead jobs disappear from the jobs array without notification. + This is used when the shell is not interactive. */ +void +reap_dead_jobs () +{ + mark_dead_jobs_as_notified (0); + cleanup_dead_jobs (); +} + +/* Return the next closest (chronologically) job to JOB which is in + STATE. STATE can be JSTOPPED, JRUNNING. NO_JOB is returned if + there is no next recent job. */ +static int +most_recent_job_in_state (job, state) + int job; + JOB_STATE state; +{ + register int i, result; + sigset_t set, oset; + + BLOCK_CHILD (set, oset); + + for (result = NO_JOB, i = job - 1; i >= 0; i--) + { + if (jobs[i] && (JOBSTATE (i) == state)) + { + result = i; + break; + } + } + + UNBLOCK_CHILD (oset); + + return (result); +} + +/* Return the newest *stopped* job older than JOB, or NO_JOB if not + found. */ +static int +job_last_stopped (job) + int job; +{ + return (most_recent_job_in_state (job, JSTOPPED)); +} + +/* Return the newest *running* job older than JOB, or NO_JOB if not + found. */ +static int +job_last_running (job) + int job; +{ + return (most_recent_job_in_state (job, JRUNNING)); +} + +/* Make JOB be the current job, and make previous be useful. Must be + called with SIGCHLD blocked. */ +static void +set_current_job (job) + int job; +{ + int candidate; + + if (js.j_current != job) + { + js.j_previous = js.j_current; + js.j_current = job; + } + + /* First choice for previous job is the old current job. */ + if (js.j_previous != js.j_current && + js.j_previous != NO_JOB && + jobs[js.j_previous] && + STOPPED (js.j_previous)) + return; + + /* Second choice: Newest stopped job that is older than + the current job. */ + candidate = NO_JOB; + if (STOPPED (js.j_current)) + { + candidate = job_last_stopped (js.j_current); + + if (candidate != NO_JOB) + { + js.j_previous = candidate; + return; + } + } + + /* If we get here, there is either only one stopped job, in which case it is + the current job and the previous job should be set to the newest running + job, or there are only running jobs and the previous job should be set to + the newest running job older than the current job. We decide on which + alternative to use based on whether or not JOBSTATE(js.j_current) is + JSTOPPED. */ + + candidate = RUNNING (js.j_current) ? job_last_running (js.j_current) + : job_last_running (js.j_jobslots); + + if (candidate != NO_JOB) + { + js.j_previous = candidate; + return; + } + + /* There is only a single job, and it is both `+' and `-'. */ + js.j_previous = js.j_current; +} + +/* Make current_job be something useful, if it isn't already. */ + +/* Here's the deal: The newest non-running job should be `+', and the + next-newest non-running job should be `-'. If there is only a single + stopped job, the js.j_previous is the newest non-running job. If there + are only running jobs, the newest running job is `+' and the + next-newest running job is `-'. Must be called with SIGCHLD blocked. */ + +static void +reset_current () +{ + int candidate; + + if (js.j_jobslots && js.j_current != NO_JOB && jobs[js.j_current] && STOPPED (js.j_current)) + candidate = js.j_current; + else + { + candidate = NO_JOB; + + /* First choice: the previous job. */ + if (js.j_previous != NO_JOB && jobs[js.j_previous] && STOPPED (js.j_previous)) + candidate = js.j_previous; + + /* Second choice: the most recently stopped job. */ + if (candidate == NO_JOB) + candidate = job_last_stopped (js.j_jobslots); + + /* Third choice: the newest running job. */ + if (candidate == NO_JOB) + candidate = job_last_running (js.j_jobslots); + } + + /* If we found a job to use, then use it. Otherwise, there + are no jobs period. */ + if (candidate != NO_JOB) + set_current_job (candidate); + else + js.j_current = js.j_previous = NO_JOB; +} + +/* Set up the job structures so we know the job and its processes are + all running. */ +static void +set_job_running (job) + int job; +{ + register PROCESS *p; + + /* Each member of the pipeline is now running. */ + p = jobs[job]->pipe; + + do + { + if (WIFSTOPPED (p->status)) + p->running = PS_RUNNING; /* XXX - could be PS_STOPPED */ + p = p->next; + } + while (p != jobs[job]->pipe); + + /* This means that the job is running. */ + JOBSTATE (job) = JRUNNING; +} + +/* Start a job. FOREGROUND if non-zero says to do that. Otherwise, + start the job in the background. JOB is a zero-based index into + JOBS. Returns -1 if it is unable to start a job, and the return + status of the job otherwise. */ +int +start_job (job, foreground) + int job, foreground; +{ + register PROCESS *p; + int already_running; + sigset_t set, oset; + char *wd, *s; + static TTYSTRUCT save_stty; + + BLOCK_CHILD (set, oset); + + if (DEADJOB (job)) + { + internal_error (_("%s: job has terminated"), this_command_name); + UNBLOCK_CHILD (oset); + return (-1); + } + + already_running = RUNNING (job); + + if (foreground == 0 && already_running) + { + internal_error (_("%s: job %d already in background"), this_command_name, job + 1); + UNBLOCK_CHILD (oset); + return (0); /* XPG6/SUSv3 says this is not an error */ + } + + wd = current_working_directory (); + + /* You don't know about the state of this job. Do you? */ + jobs[job]->flags &= ~J_NOTIFIED; + + if (foreground) + { + set_current_job (job); + jobs[job]->flags |= J_FOREGROUND; + } + + /* Tell the outside world what we're doing. */ + p = jobs[job]->pipe; + + if (foreground == 0) + { + /* POSIX.2 says `bg' doesn't give any indication about current or + previous job. */ + if (posixly_correct == 0) + s = (job == js.j_current) ? "+ ": ((job == js.j_previous) ? "- " : " "); + else + s = " "; + printf ("[%d]%s", job + 1, s); + } + + do + { + printf ("%s%s", + p->command ? p->command : "", + p->next != jobs[job]->pipe? " | " : ""); + p = p->next; + } + while (p != jobs[job]->pipe); + + if (foreground == 0) + printf (" &"); + + if (strcmp (wd, jobs[job]->wd) != 0) + printf (" (wd: %s)", polite_directory_format (jobs[job]->wd)); + + printf ("\n"); + + /* Run the job. */ + if (already_running == 0) + set_job_running (job); + + /* Save the tty settings before we start the job in the foreground. */ + if (foreground) + { + get_tty_state (); + save_stty = shell_tty_info; + /* Give the terminal to this job. */ + if (IS_JOBCONTROL (job)) + give_terminal_to (jobs[job]->pgrp, 0); + } + else + jobs[job]->flags &= ~J_FOREGROUND; + + /* If the job is already running, then don't bother jump-starting it. */ + if (already_running == 0) + { + jobs[job]->flags |= J_NOTIFIED; + killpg (jobs[job]->pgrp, SIGCONT); + } + + if (foreground) + { + pid_t pid; + int st; + + pid = find_last_pid (job, 0); + UNBLOCK_CHILD (oset); + st = wait_for (pid); + shell_tty_info = save_stty; + set_tty_state (); + return (st); + } + else + { + reset_current (); + UNBLOCK_CHILD (oset); + return (0); + } +} + +/* Give PID SIGNAL. This determines what job the pid belongs to (if any). + If PID does belong to a job, and the job is stopped, then CONTinue the + job after giving it SIGNAL. Returns -1 on failure. If GROUP is non-null, + then kill the process group associated with PID. */ +int +kill_pid (pid, sig, group) + pid_t pid; + int sig, group; +{ + register PROCESS *p; + int job, result, negative; + sigset_t set, oset; + + if (pid < -1) + { + pid = -pid; + group = negative = 1; + } + else + negative = 0; + + result = EXECUTION_SUCCESS; + if (group) + { + BLOCK_CHILD (set, oset); + p = find_pipeline (pid, 0, &job); + + if (job != NO_JOB) + { + jobs[job]->flags &= ~J_NOTIFIED; + + /* Kill process in backquotes or one started without job control? */ + + /* If we're passed a pid < -1, just call killpg and see what happens */ + if (negative && jobs[job]->pgrp == shell_pgrp) + result = killpg (pid, sig); + /* If we're killing using job control notification, for example, + without job control active, we have to do things ourselves. */ + else if (jobs[job]->pgrp == shell_pgrp) + { + p = jobs[job]->pipe; + do + { + if (PALIVE (p) == 0) + continue; /* avoid pid recycling problem */ + kill (p->pid, sig); + if (PEXITED (p) && (sig == SIGTERM || sig == SIGHUP)) + kill (p->pid, SIGCONT); + p = p->next; + } + while (p != jobs[job]->pipe); + } + else + { + result = killpg (jobs[job]->pgrp, sig); + if (p && STOPPED (job) && (sig == SIGTERM || sig == SIGHUP)) + killpg (jobs[job]->pgrp, SIGCONT); + /* If we're continuing a stopped job via kill rather than bg or + fg, emulate the `bg' behavior. */ + if (p && STOPPED (job) && (sig == SIGCONT)) + { + set_job_running (job); + jobs[job]->flags &= ~J_FOREGROUND; + jobs[job]->flags |= J_NOTIFIED; + } + } + } + else + result = killpg (pid, sig); + + UNBLOCK_CHILD (oset); + } + else + result = kill (pid, sig); + + return (result); +} + +/* sigchld_handler () flushes at least one of the children that we are + waiting for. It gets run when we have gotten a SIGCHLD signal. */ +static sighandler +sigchld_handler (sig) + int sig; +{ + int n, oerrno; + + oerrno = errno; + REINSTALL_SIGCHLD_HANDLER; + sigchld++; + n = 0; + if (queue_sigchld == 0) + n = waitchld (-1, 0); + errno = oerrno; + SIGRETURN (n); +} + +/* waitchld() reaps dead or stopped children. It's called by wait_for and + sigchld_handler, and runs until there aren't any children terminating any + more. + If BLOCK is 1, this is to be a blocking wait for a single child, although + an arriving SIGCHLD could cause the wait to be non-blocking. It returns + the number of children reaped, or -1 if there are no unwaited-for child + processes. */ +static int +waitchld (wpid, block) + pid_t wpid; + int block; +{ + WAIT status; + PROCESS *child; + pid_t pid; + + int call_set_current, last_stopped_job, job, children_exited, waitpid_flags; + static int wcontinued = WCONTINUED; /* run-time fix for glibc problem */ + + call_set_current = children_exited = 0; + last_stopped_job = NO_JOB; + + do + { + /* We don't want to be notified about jobs stopping if job control + is not active. XXX - was interactive_shell instead of job_control */ + waitpid_flags = (job_control && subshell_environment == 0) + ? (WUNTRACED|wcontinued) + : 0; + if (sigchld || block == 0) + waitpid_flags |= WNOHANG; + + /* Check for terminating signals and exit the shell if we receive one */ + CHECK_TERMSIG; + /* Check for a trapped signal interrupting the wait builtin and jump out */ + CHECK_WAIT_INTR; + + if (block == 1 && queue_sigchld == 0 && (waitpid_flags & WNOHANG) == 0) + { + internal_warning (_("waitchld: turning on WNOHANG to avoid indefinite block")); + waitpid_flags |= WNOHANG; + } + + pid = WAITPID (-1, &status, waitpid_flags); + +#if 0 +if (wpid != -1 && block) + itrace("waitchld: blocking waitpid returns %d", pid); +#endif + /* WCONTINUED may be rejected by waitpid as invalid even when defined */ + if (wcontinued && pid < 0 && errno == EINVAL) + { + wcontinued = 0; + continue; /* jump back to the test and retry without WCONTINUED */ + } + + /* The check for WNOHANG is to make sure we decrement sigchld only + if it was non-zero before we called waitpid. */ + if (sigchld > 0 && (waitpid_flags & WNOHANG)) + sigchld--; + + /* If waitpid returns -1 with errno == ECHILD, there are no more + unwaited-for child processes of this shell. */ + if (pid < 0 && errno == ECHILD) + { + if (children_exited == 0) + return -1; + else + break; + } + +#if 0 +itrace("waitchld: waitpid returns %d block = %d", pid, block); +#endif + /* If waitpid returns 0, there are running children. If it returns -1, + the only other error POSIX says it can return is EINTR. */ + CHECK_TERMSIG; + CHECK_WAIT_INTR; + + /* If waitpid returns -1/EINTR and the shell saw a SIGINT, then we + assume the child has blocked or handled SIGINT. In that case, we + require the child to actually die due to SIGINT to act on the + SIGINT we received; otherwise we assume the child handled it and + let it go. */ + if (pid < 0 && errno == EINTR && wait_sigint_received) + child_caught_sigint = 1; + + if (pid <= 0) + continue; /* jumps right to the test */ + + /* If the child process did die due to SIGINT, forget our assumption + that it caught or otherwise handled it. */ + if (WIFSIGNALED (status) && WTERMSIG (status) == SIGINT) + child_caught_sigint = 0; + + /* children_exited is used to run traps on SIGCHLD. We don't want to + run the trap if a process is just being continued. */ + if (WIFCONTINUED(status) == 0) + { + children_exited++; + js.c_living--; + } + + /* Locate our PROCESS for this pid. */ + child = find_process (pid, 1, &job); /* want living procs only */ + +#if defined (COPROCESS_SUPPORT) + coproc_pidchk (pid, WSTATUS(status)); +#endif + + /* It is not an error to have a child terminate that we did + not have a record of. This child could have been part of + a pipeline in backquote substitution. Even so, I'm not + sure child is ever non-zero. */ + if (child == 0) + { + if (WIFEXITED (status) || WIFSIGNALED (status)) + js.c_reaped++; + continue; + } + + /* Remember status, and whether or not the process is running. */ + child->status = status; + child->running = WIFCONTINUED(status) ? PS_RUNNING : PS_DONE; + + if (PEXITED (child)) + { + js.c_totreaped++; + if (job != NO_JOB) + js.c_reaped++; + } + + if (job == NO_JOB) + continue; + + call_set_current += set_job_status_and_cleanup (job); + + if (STOPPED (job)) + last_stopped_job = job; + else if (DEADJOB (job) && last_stopped_job == job) + last_stopped_job = NO_JOB; + } + while ((sigchld || block == 0) && pid > (pid_t)0); + + /* If a job was running and became stopped, then set the current + job. Otherwise, don't change a thing. */ + if (call_set_current) + { + if (last_stopped_job != NO_JOB) + set_current_job (last_stopped_job); + else + reset_current (); + } + + /* Call a SIGCHLD trap handler for each child that exits, if one is set. */ + if (job_control && signal_is_trapped (SIGCHLD) && children_exited && + trap_list[SIGCHLD] != (char *)IGNORE_SIG) + { + if (posixly_correct && this_shell_builtin && this_shell_builtin == wait_builtin) + { + interrupt_immediately = 0; + trap_handler (SIGCHLD); /* set pending_traps[SIGCHLD] */ + wait_signal_received = SIGCHLD; + /* If we're in a signal handler, let CHECK_WAIT_INTR pick it up; + run_pending_traps will call run_sigchld_trap later */ + if (sigchld == 0) + longjmp (wait_intr_buf, 1); + } + /* If not in posix mode and not executing the wait builtin, queue the + signal for later handling. Run the trap immediately if we are + executing the wait builtin, but don't break out of `wait'. */ + else if (sigchld) /* called from signal handler */ + queue_sigchld_trap (children_exited); + else if (running_trap) + queue_sigchld_trap (children_exited); + else if (this_shell_builtin == wait_builtin) + run_sigchld_trap (children_exited); /* XXX */ + else + queue_sigchld_trap (children_exited); + } + + /* We have successfully recorded the useful information about this process + that has just changed state. If we notify asynchronously, and the job + that this process belongs to is no longer running, then notify the user + of that fact now. */ + if (asynchronous_notification && interactive) + notify_of_job_status (); + + return (children_exited); +} + +/* Set the status of JOB and perform any necessary cleanup if the job is + marked as JDEAD. + + Currently, the cleanup activity is restricted to handling any SIGINT + received while waiting for a foreground job to finish. */ +static int +set_job_status_and_cleanup (job) + int job; +{ + PROCESS *child; + int tstatus, job_state, any_stopped, any_tstped, call_set_current; + SigHandler *temp_handler; + + child = jobs[job]->pipe; + jobs[job]->flags &= ~J_NOTIFIED; + + call_set_current = 0; + + /* + * COMPUTE JOB STATUS + */ + + /* If all children are not running, but any of them is stopped, then + the job is stopped, not dead. */ + job_state = any_stopped = any_tstped = 0; + do + { + job_state |= PRUNNING (child); +#if 0 + if (PEXITED (child) && (WIFSTOPPED (child->status))) +#else + /* Only checking for WIFSTOPPED now, not for PS_DONE */ + if (PSTOPPED (child)) +#endif + { + any_stopped = 1; + any_tstped |= job_control && (WSTOPSIG (child->status) == SIGTSTP); + } + child = child->next; + } + while (child != jobs[job]->pipe); + + /* If job_state != 0, the job is still running, so don't bother with + setting the process exit status and job state unless we're + transitioning from stopped to running. */ + if (job_state != 0 && JOBSTATE(job) != JSTOPPED) + return 0; + + /* + * SET JOB STATUS + */ + + /* The job is either stopped or dead. Set the state of the job accordingly. */ + if (any_stopped) + { + jobs[job]->state = JSTOPPED; + jobs[job]->flags &= ~J_FOREGROUND; + call_set_current++; + /* Suspending a job with SIGTSTP breaks all active loops. */ + if (any_tstped && loop_level) + breaking = loop_level; + } + else if (job_state != 0) /* was stopped, now running */ + { + jobs[job]->state = JRUNNING; + call_set_current++; + } + else + { + jobs[job]->state = JDEAD; + js.j_ndead++; + +#if 0 + if (IS_FOREGROUND (job)) + setjstatus (job); +#endif + + /* If this job has a cleanup function associated with it, call it + with `cleanarg' as the single argument, then set the function + pointer to NULL so it is not inadvertently called twice. The + cleanup function is responsible for deallocating cleanarg. */ + if (jobs[job]->j_cleanup) + { + (*jobs[job]->j_cleanup) (jobs[job]->cleanarg); + jobs[job]->j_cleanup = (sh_vptrfunc_t *)NULL; + } + } + + /* + * CLEANUP + * + * Currently, we just do special things if we got a SIGINT while waiting + * for a foreground job to complete + */ + + if (JOBSTATE (job) == JDEAD) + { + /* If we're running a shell script and we get a SIGINT with a + SIGINT trap handler, but the foreground job handles it and + does not exit due to SIGINT, run the trap handler but do not + otherwise act as if we got the interrupt. */ + if (wait_sigint_received && interactive_shell == 0 && + child_caught_sigint && IS_FOREGROUND (job) && + signal_is_trapped (SIGINT)) + { + int old_frozen; + wait_sigint_received = 0; + last_command_exit_value = process_exit_status (child->status); + + old_frozen = jobs_list_frozen; + jobs_list_frozen = 1; + tstatus = maybe_call_trap_handler (SIGINT); + jobs_list_frozen = old_frozen; + } + + /* If the foreground job is killed by SIGINT when job control is not + active, we need to perform some special handling. + + The check of wait_sigint_received is a way to determine if the + SIGINT came from the keyboard (in which case the shell has already + seen it, and wait_sigint_received is non-zero, because keyboard + signals are sent to process groups) or via kill(2) to the foreground + process by another process (or itself). If the shell did receive the + SIGINT, it needs to perform normal SIGINT processing. */ + else if (wait_sigint_received && + child_caught_sigint == 0 && + IS_FOREGROUND (job) && IS_JOBCONTROL (job) == 0) + { + int old_frozen; + + wait_sigint_received = 0; + + /* If SIGINT is trapped, set the exit status so that the trap + handler can see it. */ + if (signal_is_trapped (SIGINT)) + last_command_exit_value = process_exit_status (child->status); + + /* If the signal is trapped, let the trap handler get it no matter + what and simply return if the trap handler returns. + maybe_call_trap_handler() may cause dead jobs to be removed from + the job table because of a call to execute_command. We work + around this by setting JOBS_LIST_FROZEN. */ + old_frozen = jobs_list_frozen; + jobs_list_frozen = 1; + tstatus = maybe_call_trap_handler (SIGINT); + jobs_list_frozen = old_frozen; + if (tstatus == 0 && old_sigint_handler != INVALID_SIGNAL_HANDLER) + { + /* wait_sigint_handler () has already seen SIGINT and + allowed the wait builtin to jump out. We need to + call the original SIGINT handler, if necessary. If + the original handler is SIG_DFL, we need to resend + the signal to ourselves. */ + + temp_handler = old_sigint_handler; + + /* Bogus. If we've reset the signal handler as the result + of a trap caught on SIGINT, then old_sigint_handler + will point to trap_handler, which now knows nothing about + SIGINT (if we reset the sighandler to the default). + In this case, we have to fix things up. What a crock. */ + if (temp_handler == trap_handler && signal_is_trapped (SIGINT) == 0) + temp_handler = trap_to_sighandler (SIGINT); + restore_sigint_handler (); + if (temp_handler == SIG_DFL) + termsig_handler (SIGINT); /* XXX */ + else if (temp_handler != SIG_IGN) + (*temp_handler) (SIGINT); + } + } + } + + return call_set_current; +} + +/* Build the array of values for the $PIPESTATUS variable from the set of + exit statuses of all processes in the job J. */ +static void +setjstatus (j) + int j; +{ +#if defined (ARRAY_VARS) + register int i; + register PROCESS *p; + + for (i = 1, p = jobs[j]->pipe; p->next != jobs[j]->pipe; p = p->next, i++) + ; + i++; + if (statsize < i) + { + pstatuses = (int *)xrealloc (pstatuses, i * sizeof (int)); + statsize = i; + } + i = 0; + p = jobs[j]->pipe; + do + { + pstatuses[i++] = process_exit_status (p->status); + p = p->next; + } + while (p != jobs[j]->pipe); + + pstatuses[i] = -1; /* sentinel */ + set_pipestatus_array (pstatuses, i); +#endif +} + +void +run_sigchld_trap (nchild) + int nchild; +{ + char *trap_command; + int i; + + /* Turn off the trap list during the call to parse_and_execute () + to avoid potentially infinite recursive calls. Preserve the + values of last_command_exit_value, last_made_pid, and the_pipeline + around the execution of the trap commands. */ + trap_command = savestring (trap_list[SIGCHLD]); + + begin_unwind_frame ("SIGCHLD trap"); + unwind_protect_int (last_command_exit_value); + unwind_protect_int (last_command_exit_signal); + unwind_protect_var (last_made_pid); + unwind_protect_int (interrupt_immediately); + unwind_protect_int (jobs_list_frozen); + unwind_protect_pointer (the_pipeline); + unwind_protect_pointer (subst_assign_varlist); + unwind_protect_pointer (this_shell_builtin); + + /* We have to add the commands this way because they will be run + in reverse order of adding. We don't want maybe_set_sigchld_trap () + to reference freed memory. */ + add_unwind_protect (xfree, trap_command); + add_unwind_protect (maybe_set_sigchld_trap, trap_command); + + subst_assign_varlist = (WORD_LIST *)NULL; + the_pipeline = (PROCESS *)NULL; + + running_trap = SIGCHLD + 1; + + set_impossible_sigchld_trap (); + jobs_list_frozen = 1; + for (i = 0; i < nchild; i++) + { +#if 0 + interrupt_immediately = 1; +#endif + parse_and_execute (savestring (trap_command), "trap", SEVAL_NOHIST|SEVAL_RESETLINE); + } + + run_unwind_frame ("SIGCHLD trap"); + running_trap = 0; +} + +/* Function to call when you want to notify people of changes + in job status. This prints out all jobs which are pending + notification to stderr, and marks those printed as already + notified, thus making them candidates for cleanup. */ +static void +notify_of_job_status () +{ + register int job, termsig; + char *dir; + sigset_t set, oset; + WAIT s; + + if (jobs == 0 || js.j_jobslots == 0) + return; + + if (old_ttou != 0) + { + sigemptyset (&set); + sigaddset (&set, SIGCHLD); + sigaddset (&set, SIGTTOU); + sigemptyset (&oset); + sigprocmask (SIG_BLOCK, &set, &oset); + } + else + queue_sigchld++; + + /* XXX could use js.j_firstj here */ + for (job = 0, dir = (char *)NULL; job < js.j_jobslots; job++) + { + if (jobs[job] && IS_NOTIFIED (job) == 0) + { + s = raw_job_exit_status (job); + termsig = WTERMSIG (s); + + /* POSIX.2 says we have to hang onto the statuses of at most the + last CHILD_MAX background processes if the shell is running a + script. If the shell is running a script, either from a file + or standard input, don't print anything unless the job was + killed by a signal. */ + if (startup_state == 0 && WIFSIGNALED (s) == 0 && + ((DEADJOB (job) && IS_FOREGROUND (job) == 0) || STOPPED (job))) + continue; + +#if 0 + /* If job control is disabled, don't print the status messages. + Mark dead jobs as notified so that they get cleaned up. If + startup_state == 2, we were started to run `-c command', so + don't print anything. */ + if ((job_control == 0 && interactive_shell) || startup_state == 2) +#else + /* If job control is disabled, don't print the status messages. + Mark dead jobs as notified so that they get cleaned up. If + startup_state == 2 and subshell_environment has the + SUBSHELL_COMSUB bit turned on, we were started to run a command + substitution, so don't print anything. */ + if ((job_control == 0 && interactive_shell) || + (startup_state == 2 && (subshell_environment & SUBSHELL_COMSUB))) +#endif + { + /* POSIX.2 compatibility: if the shell is not interactive, + hang onto the job corresponding to the last asynchronous + pid until the user has been notified of its status or does + a `wait'. */ + if (DEADJOB (job) && (interactive_shell || (find_last_pid (job, 0) != last_asynchronous_pid))) + jobs[job]->flags |= J_NOTIFIED; + continue; + } + + /* Print info on jobs that are running in the background, + and on foreground jobs that were killed by anything + except SIGINT (and possibly SIGPIPE). */ + switch (JOBSTATE (job)) + { + case JDEAD: + if (interactive_shell == 0 && termsig && WIFSIGNALED (s) && + termsig != SIGINT && +#if defined (DONT_REPORT_SIGTERM) + termsig != SIGTERM && +#endif +#if defined (DONT_REPORT_SIGPIPE) + termsig != SIGPIPE && +#endif + signal_is_trapped (termsig) == 0) + { + /* Don't print `0' for a line number. */ + fprintf (stderr, _("%s: line %d: "), get_name_for_error (), (line_number == 0) ? 1 : line_number); + pretty_print_job (job, JLIST_NONINTERACTIVE, stderr); + } + else if (IS_FOREGROUND (job)) + { +#if !defined (DONT_REPORT_SIGPIPE) + if (termsig && WIFSIGNALED (s) && termsig != SIGINT) +#else + if (termsig && WIFSIGNALED (s) && termsig != SIGINT && termsig != SIGPIPE) +#endif + { + fprintf (stderr, "%s", j_strsignal (termsig)); + + if (WIFCORED (s)) + fprintf (stderr, _(" (core dumped)")); + + fprintf (stderr, "\n"); + } + } + else if (job_control) /* XXX job control test added */ + { + if (dir == 0) + dir = current_working_directory (); + pretty_print_job (job, JLIST_STANDARD, stderr); + if (dir && strcmp (dir, jobs[job]->wd) != 0) + fprintf (stderr, + _("(wd now: %s)\n"), polite_directory_format (dir)); + } + + jobs[job]->flags |= J_NOTIFIED; + break; + + case JSTOPPED: + fprintf (stderr, "\n"); + if (dir == 0) + dir = current_working_directory (); + pretty_print_job (job, JLIST_STANDARD, stderr); + if (dir && (strcmp (dir, jobs[job]->wd) != 0)) + fprintf (stderr, + _("(wd now: %s)\n"), polite_directory_format (dir)); + jobs[job]->flags |= J_NOTIFIED; + break; + + case JRUNNING: + case JMIXED: + break; + + default: + programming_error ("notify_of_job_status"); + } + } + } + if (old_ttou != 0) + sigprocmask (SIG_SETMASK, &oset, (sigset_t *)NULL); + else + queue_sigchld--; +} + +/* Initialize the job control mechanism, and set up the tty stuff. */ +int +initialize_job_control (force) + int force; +{ + pid_t t; + int t_errno; + + t_errno = -1; + shell_pgrp = getpgid (0); + + if (shell_pgrp == -1) + { + sys_error (_("initialize_job_control: getpgrp failed")); + exit (1); + } + + /* We can only have job control if we are interactive unless we force it. */ + if (interactive == 0 && force == 0) + { + job_control = 0; + original_pgrp = NO_PID; + shell_tty = fileno (stderr); + } + else + { + shell_tty = -1; + + /* If forced_interactive is set, we skip the normal check that stderr + is attached to a tty, so we need to check here. If it's not, we + need to see whether we have a controlling tty by opening /dev/tty, + since trying to use job control tty pgrp manipulations on a non-tty + is going to fail. */ + if (forced_interactive && isatty (fileno (stderr)) == 0) + shell_tty = open ("/dev/tty", O_RDWR|O_NONBLOCK); + + /* Get our controlling terminal. If job_control is set, or + interactive is set, then this is an interactive shell no + matter where fd 2 is directed. */ + if (shell_tty == -1) + shell_tty = dup (fileno (stderr)); /* fd 2 */ + + if (shell_tty != -1) + shell_tty = move_to_high_fd (shell_tty, 1, -1); + + /* Compensate for a bug in systems that compiled the BSD + rlogind with DEBUG defined, like NeXT and Alliant. */ + if (shell_pgrp == 0) + { + shell_pgrp = getpid (); + setpgid (0, shell_pgrp); + tcsetpgrp (shell_tty, shell_pgrp); + } + + while ((terminal_pgrp = tcgetpgrp (shell_tty)) != -1) + { + if (shell_pgrp != terminal_pgrp) + { + SigHandler *ottin; + + ottin = set_signal_handler(SIGTTIN, SIG_DFL); + kill (0, SIGTTIN); + set_signal_handler (SIGTTIN, ottin); + continue; + } + break; + } + + if (terminal_pgrp == -1) + t_errno = errno; + + /* Make sure that we are using the new line discipline. */ + if (set_new_line_discipline (shell_tty) < 0) + { + sys_error (_("initialize_job_control: line discipline")); + job_control = 0; + } + else + { + original_pgrp = shell_pgrp; + shell_pgrp = getpid (); + + if ((original_pgrp != shell_pgrp) && (setpgid (0, shell_pgrp) < 0)) + { + sys_error (_("initialize_job_control: setpgid")); + shell_pgrp = original_pgrp; + } + + job_control = 1; + + /* If (and only if) we just set our process group to our pid, + thereby becoming a process group leader, and the terminal + is not in the same process group as our (new) process group, + then set the terminal's process group to our (new) process + group. If that fails, set our process group back to what it + was originally (so we can still read from the terminal) and + turn off job control. */ + if (shell_pgrp != original_pgrp && shell_pgrp != terminal_pgrp) + { + if (give_terminal_to (shell_pgrp, 0) < 0) + { + t_errno = errno; + setpgid (0, original_pgrp); + shell_pgrp = original_pgrp; + errno = t_errno; + sys_error (_("cannot set terminal process group (%d)"), shell_pgrp); + job_control = 0; + } + } + + if (job_control && ((t = tcgetpgrp (shell_tty)) == -1 || t != shell_pgrp)) + { + if (t_errno != -1) + errno = t_errno; + sys_error (_("cannot set terminal process group (%d)"), t); + job_control = 0; + } + } + if (job_control == 0) + internal_error (_("no job control in this shell")); + } + + if (shell_tty != fileno (stderr)) + SET_CLOSE_ON_EXEC (shell_tty); + + set_signal_handler (SIGCHLD, sigchld_handler); + + change_flag ('m', job_control ? '-' : '+'); + + if (interactive) + get_tty_state (); + + if (js.c_childmax < 0) + js.c_childmax = getmaxchild (); + if (js.c_childmax < 0) + js.c_childmax = DEFAULT_CHILD_MAX; + + return job_control; +} + +#ifdef DEBUG +void +debug_print_pgrps () +{ + itrace("original_pgrp = %ld shell_pgrp = %ld terminal_pgrp = %ld", + (long)original_pgrp, (long)shell_pgrp, (long)terminal_pgrp); + itrace("tcgetpgrp(%d) -> %ld, getpgid(0) -> %ld", + shell_tty, (long)tcgetpgrp (shell_tty), (long)getpgid(0)); +} +#endif + +/* Set the line discipline to the best this system has to offer. + Return -1 if this is not possible. */ +static int +set_new_line_discipline (tty) + int tty; +{ +#if defined (NEW_TTY_DRIVER) + int ldisc; + + if (ioctl (tty, TIOCGETD, &ldisc) < 0) + return (-1); + + if (ldisc != NTTYDISC) + { + ldisc = NTTYDISC; + + if (ioctl (tty, TIOCSETD, &ldisc) < 0) + return (-1); + } + return (0); +#endif /* NEW_TTY_DRIVER */ + +#if defined (TERMIO_TTY_DRIVER) +# if defined (TERMIO_LDISC) && (NTTYDISC) + if (ioctl (tty, TCGETA, &shell_tty_info) < 0) + return (-1); + + if (shell_tty_info.c_line != NTTYDISC) + { + shell_tty_info.c_line = NTTYDISC; + if (ioctl (tty, TCSETAW, &shell_tty_info) < 0) + return (-1); + } +# endif /* TERMIO_LDISC && NTTYDISC */ + return (0); +#endif /* TERMIO_TTY_DRIVER */ + +#if defined (TERMIOS_TTY_DRIVER) +# if defined (TERMIOS_LDISC) && defined (NTTYDISC) + if (tcgetattr (tty, &shell_tty_info) < 0) + return (-1); + + if (shell_tty_info.c_line != NTTYDISC) + { + shell_tty_info.c_line = NTTYDISC; + if (tcsetattr (tty, TCSADRAIN, &shell_tty_info) < 0) + return (-1); + } +# endif /* TERMIOS_LDISC && NTTYDISC */ + return (0); +#endif /* TERMIOS_TTY_DRIVER */ + +#if !defined (NEW_TTY_DRIVER) && !defined (TERMIO_TTY_DRIVER) && !defined (TERMIOS_TTY_DRIVER) + return (-1); +#endif +} + +/* Setup this shell to handle C-C, etc. */ +void +initialize_job_signals () +{ + if (interactive) + { + set_signal_handler (SIGINT, sigint_sighandler); + set_signal_handler (SIGTSTP, SIG_IGN); + set_signal_handler (SIGTTOU, SIG_IGN); + set_signal_handler (SIGTTIN, SIG_IGN); + } + else if (job_control) + { + old_tstp = set_signal_handler (SIGTSTP, sigstop_sighandler); + old_ttin = set_signal_handler (SIGTTIN, sigstop_sighandler); + old_ttou = set_signal_handler (SIGTTOU, sigstop_sighandler); + } + /* Leave these things alone for non-interactive shells without job + control. */ +} + +/* Here we handle CONT signals. */ +static sighandler +sigcont_sighandler (sig) + int sig; +{ + initialize_job_signals (); + set_signal_handler (SIGCONT, old_cont); + kill (getpid (), SIGCONT); + + SIGRETURN (0); +} + +/* Here we handle stop signals while we are running not as a login shell. */ +static sighandler +sigstop_sighandler (sig) + int sig; +{ + set_signal_handler (SIGTSTP, old_tstp); + set_signal_handler (SIGTTOU, old_ttou); + set_signal_handler (SIGTTIN, old_ttin); + + old_cont = set_signal_handler (SIGCONT, sigcont_sighandler); + + give_terminal_to (shell_pgrp, 0); + + kill (getpid (), sig); + + SIGRETURN (0); +} + +/* Give the terminal to PGRP. */ +int +give_terminal_to (pgrp, force) + pid_t pgrp; + int force; +{ + sigset_t set, oset; + int r, e; + + r = 0; + if (job_control || force) + { + sigemptyset (&set); + sigaddset (&set, SIGTTOU); + sigaddset (&set, SIGTTIN); + sigaddset (&set, SIGTSTP); + sigaddset (&set, SIGCHLD); + sigemptyset (&oset); + sigprocmask (SIG_BLOCK, &set, &oset); + + if (tcsetpgrp (shell_tty, pgrp) < 0) + { + /* Maybe we should print an error message? */ +#if 0 + sys_error ("tcsetpgrp(%d) failed: pid %ld to pgrp %ld", + shell_tty, (long)getpid(), (long)pgrp); +#endif + r = -1; + e = errno; + } + else + terminal_pgrp = pgrp; + sigprocmask (SIG_SETMASK, &oset, (sigset_t *)NULL); + } + + if (r == -1) + errno = e; + + return r; +} + +/* Give terminal to NPGRP iff it's currently owned by OPGRP. FLAGS are the + flags to pass to give_terminal_to(). */ +static int +maybe_give_terminal_to (opgrp, npgrp, flags) + pid_t opgrp, npgrp; + int flags; +{ + int tpgrp; + + tpgrp = tcgetpgrp (shell_tty); + if (tpgrp < 0 && errno == ENOTTY) + return -1; + if (tpgrp == npgrp) + { + terminal_pgrp = npgrp; + return 0; + } + else if (tpgrp != opgrp) + { +#if defined (DEBUG) + internal_warning ("maybe_give_terminal_to: terminal pgrp == %d shell pgrp = %d new pgrp = %d", tpgrp, opgrp, npgrp); +#endif + return -1; + } + else + return (give_terminal_to (npgrp, flags)); +} + +/* Clear out any jobs in the job array. This is intended to be used by + children of the shell, who should not have any job structures as baggage + when they start executing (forking subshells for parenthesized execution + and functions with pipes are the two that spring to mind). If RUNNING_ONLY + is nonzero, only running jobs are removed from the table. */ +void +delete_all_jobs (running_only) + int running_only; +{ + register int i; + sigset_t set, oset; + + BLOCK_CHILD (set, oset); + + /* XXX - need to set j_lastj, j_firstj appropriately if running_only != 0. */ + if (js.j_jobslots) + { + js.j_current = js.j_previous = NO_JOB; + + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("delete_all_jobs: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("delete_all_jobs: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + if (jobs[i] && (running_only == 0 || (running_only && RUNNING(i)))) + delete_job (i, DEL_WARNSTOPPED); + } + if (running_only == 0) + { + free ((char *)jobs); + js.j_jobslots = 0; + js.j_firstj = js.j_lastj = js.j_njobs = 0; + } + } + + if (running_only == 0) + bgp_clear (); + + UNBLOCK_CHILD (oset); +} + +/* Mark all jobs in the job array so that they don't get a SIGHUP when the + shell gets one. If RUNNING_ONLY is nonzero, mark only running jobs. */ +void +nohup_all_jobs (running_only) + int running_only; +{ + register int i; + sigset_t set, oset; + + BLOCK_CHILD (set, oset); + + if (js.j_jobslots) + { + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + if (jobs[i] && (running_only == 0 || (running_only && RUNNING(i)))) + nohup_job (i); + } + + UNBLOCK_CHILD (oset); +} + +int +count_all_jobs () +{ + int i, n; + sigset_t set, oset; + + /* This really counts all non-dead jobs. */ + BLOCK_CHILD (set, oset); + /* XXX could use js.j_firstj here */ + for (i = n = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("count_all_jobs: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("count_all_jobs: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + if (jobs[i] && DEADJOB(i) == 0) + n++; + } + UNBLOCK_CHILD (oset); + return n; +} + +static void +mark_all_jobs_as_dead () +{ + register int i; + sigset_t set, oset; + + if (js.j_jobslots == 0) + return; + + BLOCK_CHILD (set, oset); + + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + if (jobs[i]) + { + jobs[i]->state = JDEAD; + js.j_ndead++; + } + + UNBLOCK_CHILD (oset); +} + +/* Mark all dead jobs as notified, so delete_job () cleans them out + of the job table properly. POSIX.2 says we need to save the + status of the last CHILD_MAX jobs, so we count the number of dead + jobs and mark only enough as notified to save CHILD_MAX statuses. */ +static void +mark_dead_jobs_as_notified (force) + int force; +{ + register int i, ndead, ndeadproc; + sigset_t set, oset; + + if (js.j_jobslots == 0) + return; + + BLOCK_CHILD (set, oset); + + /* If FORCE is non-zero, we don't have to keep CHILD_MAX statuses + around; just run through the array. */ + if (force) + { + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + { + if (jobs[i] && DEADJOB (i) && (interactive_shell || (find_last_pid (i, 0) != last_asynchronous_pid))) + jobs[i]->flags |= J_NOTIFIED; + } + UNBLOCK_CHILD (oset); + return; + } + + /* Mark enough dead jobs as notified to keep CHILD_MAX processes left in the + array with the corresponding not marked as notified. This is a better + way to avoid pid aliasing and reuse problems than keeping the POSIX- + mandated CHILD_MAX jobs around. delete_job() takes care of keeping the + bgpids list regulated. */ + + /* Count the number of dead jobs */ + /* XXX could use js.j_firstj here */ + for (i = ndead = ndeadproc = 0; i < js.j_jobslots; i++) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("mark_dead_jobs_as_notified: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("mark_dead_jobs_as_notified: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + if (jobs[i] && DEADJOB (i)) + { + ndead++; + ndeadproc += processes_in_job (i); + } + } + +#ifdef DEBUG +# if 0 + if (ndeadproc != js.c_reaped) + itrace("mark_dead_jobs_as_notified: ndeadproc (%d) != js.c_reaped (%d)", ndeadproc, js.c_reaped); +# endif + if (ndead != js.j_ndead) + itrace("mark_dead_jobs_as_notified: ndead (%d) != js.j_ndead (%d)", ndead, js.j_ndead); +#endif + + if (js.c_childmax < 0) + js.c_childmax = getmaxchild (); + if (js.c_childmax < 0) + js.c_childmax = DEFAULT_CHILD_MAX; + + /* Don't do anything if the number of dead processes is less than CHILD_MAX + and we're not forcing a cleanup. */ + if (ndeadproc <= js.c_childmax) + { + UNBLOCK_CHILD (oset); + return; + } + +#if 0 +itrace("mark_dead_jobs_as_notified: child_max = %d ndead = %d ndeadproc = %d", js.c_childmax, ndead, ndeadproc); +#endif + + /* Mark enough dead jobs as notified that we keep CHILD_MAX jobs in + the list. This isn't exactly right yet; changes need to be made + to stop_pipeline so we don't mark the newer jobs after we've + created CHILD_MAX slots in the jobs array. This needs to be + integrated with a way to keep the jobs array from growing without + bound. Maybe we wrap back around to 0 after we reach some max + limit, and there are sufficient job slots free (keep track of total + size of jobs array (js.j_jobslots) and running count of number of jobs + in jobs array. Then keep a job index corresponding to the `oldest job' + and start this loop there, wrapping around as necessary. In effect, + we turn the list into a circular buffer. */ + /* XXX could use js.j_firstj here */ + for (i = 0; i < js.j_jobslots; i++) + { + if (jobs[i] && DEADJOB (i) && (interactive_shell || (find_last_pid (i, 0) != last_asynchronous_pid))) + { +#if defined (DEBUG) + if (i < js.j_firstj && jobs[i]) + itrace("mark_dead_jobs_as_notified: job %d non-null before js.j_firstj (%d)", i, js.j_firstj); + if (i > js.j_lastj && jobs[i]) + itrace("mark_dead_jobs_as_notified: job %d non-null after js.j_lastj (%d)", i, js.j_lastj); +#endif + /* If marking this job as notified would drop us down below + child_max, don't mark it so we can keep at least child_max + statuses. XXX -- need to check what Posix actually says + about keeping statuses. */ + if ((ndeadproc -= processes_in_job (i)) <= js.c_childmax) + break; + jobs[i]->flags |= J_NOTIFIED; + } + } + + UNBLOCK_CHILD (oset); +} + +/* Here to allow other parts of the shell (like the trap stuff) to + freeze and unfreeze the jobs list. */ +void +freeze_jobs_list () +{ + jobs_list_frozen = 1; +} + +void +unfreeze_jobs_list () +{ + jobs_list_frozen = 0; +} + +/* Allow or disallow job control to take place. Returns the old value + of job_control. */ +int +set_job_control (arg) + int arg; +{ + int old; + + old = job_control; + job_control = arg; + + /* If we're turning on job control, reset pipeline_pgrp so make_child will + put new child processes into the right pgrp */ + if (job_control != old && job_control) + pipeline_pgrp = 0; + + return (old); +} + +/* Turn off all traces of job control. This is run by children of the shell + which are going to do shellsy things, like wait (), etc. */ +void +without_job_control () +{ + stop_making_children (); + start_pipeline (); +#if defined (PGRP_PIPE) + sh_closepipe (pgrp_pipe); +#endif + delete_all_jobs (0); + set_job_control (0); +} + +/* If this shell is interactive, terminate all stopped jobs and + restore the original terminal process group. This is done + before the `exec' builtin calls shell_execve. */ +void +end_job_control () +{ + if (interactive_shell || job_control) /* XXX - should it be just job_control? */ + { + terminate_stopped_jobs (); + + if (original_pgrp >= 0) + give_terminal_to (original_pgrp, 1); + } + + if (original_pgrp >= 0) + setpgid (0, original_pgrp); +} + +/* Restart job control by closing shell tty and reinitializing. This is + called after an exec fails in an interactive shell and we do not exit. */ +void +restart_job_control () +{ + if (shell_tty != -1) + close (shell_tty); + initialize_job_control (0); +} + +void +set_maxchild (nchild) + int nchild; +{ + static int lmaxchild = -1; + + if (lmaxchild < 0) + lmaxchild = getmaxchild (); + if (lmaxchild < 0) + lmaxchild = DEFAULT_CHILD_MAX; + + /* Clamp value we set. Minimum is what Posix requires, maximum is defined + above as MAX_CHILD_MAX. */ + if (nchild < lmaxchild) + nchild = lmaxchild; + else if (nchild > MAX_CHILD_MAX) + nchild = MAX_CHILD_MAX; + + js.c_childmax = nchild; +} + +/* Set the handler to run when the shell receives a SIGCHLD signal. */ +void +set_sigchld_handler () +{ + set_signal_handler (SIGCHLD, sigchld_handler); +} + +#if defined (PGRP_PIPE) +/* Read from the read end of a pipe. This is how the process group leader + blocks until all of the processes in a pipeline have been made. */ +static void +pipe_read (pp) + int *pp; +{ + char ch; + + if (pp[1] >= 0) + { + close (pp[1]); + pp[1] = -1; + } + + if (pp[0] >= 0) + { + while (read (pp[0], &ch, 1) == -1 && errno == EINTR) + ; + } +} + +/* Functional interface closes our local-to-job-control pipes. */ +void +close_pgrp_pipe () +{ + sh_closepipe (pgrp_pipe); +} + +void +save_pgrp_pipe (p, clear) + int *p; + int clear; +{ + p[0] = pgrp_pipe[0]; + p[1] = pgrp_pipe[1]; + if (clear) + pgrp_pipe[0] = pgrp_pipe[1] = -1; +} + +void +restore_pgrp_pipe (p) + int *p; +{ + pgrp_pipe[0] = p[0]; + pgrp_pipe[1] = p[1]; +} + +#endif /* PGRP_PIPE */ diff --git a/jobs.h b/jobs.h new file mode 100644 index 0000000..bec9527 --- /dev/null +++ b/jobs.h @@ -0,0 +1,253 @@ +/* jobs.h -- structures and definitions used by the jobs.c file. */ + +/* Copyright (C) 1993-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_JOBS_H_) +# define _JOBS_H_ + +#include "quit.h" +#include "siglist.h" + +#include "stdc.h" + +#include "posixwait.h" + +/* Defines controlling the fashion in which jobs are listed. */ +#define JLIST_STANDARD 0 +#define JLIST_LONG 1 +#define JLIST_PID_ONLY 2 +#define JLIST_CHANGED_ONLY 3 +#define JLIST_NONINTERACTIVE 4 + +/* I looked it up. For pretty_print_job (). The real answer is 24. */ +#define LONGEST_SIGNAL_DESC 24 + +/* The max time to sleep while retrying fork() on EAGAIN failure */ +#define FORKSLEEP_MAX 16 + +/* We keep an array of jobs. Each entry in the array is a linked list + of processes that are piped together. The first process encountered is + the group leader. */ + +/* Values for the `running' field of a struct process. */ +#define PS_DONE 0 +#define PS_RUNNING 1 +#define PS_STOPPED 2 +#define PS_RECYCLED 4 + +/* Each child of the shell is remembered in a STRUCT PROCESS. A circular + chain of such structures is a pipeline. */ +typedef struct process { + struct process *next; /* Next process in the pipeline. A circular chain. */ + pid_t pid; /* Process ID. */ + WAIT status; /* The status of this command as returned by wait. */ + int running; /* Non-zero if this process is running. */ + char *command; /* The particular program that is running. */ +} PROCESS; + +/* PALIVE really means `not exited' */ +#define PSTOPPED(p) (WIFSTOPPED((p)->status)) +#define PRUNNING(p) ((p)->running == PS_RUNNING) +#define PALIVE(p) (PRUNNING(p) || PSTOPPED(p)) + +#define PEXITED(p) ((p)->running == PS_DONE) +#if defined (RECYCLES_PIDS) +# define PRECYCLED(p) ((p)->running == PS_RECYCLED) +#else +# define PRECYCLED(p) (0) +#endif +#define PDEADPROC(p) (PEXITED(p) || PRECYCLED(p)) + +#define get_job_by_jid(ind) (jobs[(ind)]) + +/* A description of a pipeline's state. */ +typedef enum { JNONE = -1, JRUNNING = 1, JSTOPPED = 2, JDEAD = 4, JMIXED = 8 } JOB_STATE; +#define JOBSTATE(job) (jobs[(job)]->state) +#define J_JOBSTATE(j) ((j)->state) + +#define STOPPED(j) (jobs[(j)]->state == JSTOPPED) +#define RUNNING(j) (jobs[(j)]->state == JRUNNING) +#define DEADJOB(j) (jobs[(j)]->state == JDEAD) + +#define INVALID_JOB(j) ((j) < 0 || (j) >= js.j_jobslots || get_job_by_jid(j) == 0) + +/* Values for the FLAGS field in the JOB struct below. */ +#define J_FOREGROUND 0x01 /* Non-zero if this is running in the foreground. */ +#define J_NOTIFIED 0x02 /* Non-zero if already notified about job state. */ +#define J_JOBCONTROL 0x04 /* Non-zero if this job started under job control. */ +#define J_NOHUP 0x08 /* Don't send SIGHUP to job if shell gets SIGHUP. */ +#define J_STATSAVED 0x10 /* A process in this job had had status saved via $! */ +#define J_ASYNC 0x20 /* Job was started asynchronously */ + +#define IS_FOREGROUND(j) ((jobs[j]->flags & J_FOREGROUND) != 0) +#define IS_NOTIFIED(j) ((jobs[j]->flags & J_NOTIFIED) != 0) +#define IS_JOBCONTROL(j) ((jobs[j]->flags & J_JOBCONTROL) != 0) +#define IS_ASYNC(j) ((jobs[j]->flags & J_ASYNC) != 0) + +typedef struct job { + char *wd; /* The working directory at time of invocation. */ + PROCESS *pipe; /* The pipeline of processes that make up this job. */ + pid_t pgrp; /* The process ID of the process group (necessary). */ + JOB_STATE state; /* The state that this job is in. */ + int flags; /* Flags word: J_NOTIFIED, J_FOREGROUND, or J_JOBCONTROL. */ +#if defined (JOB_CONTROL) + COMMAND *deferred; /* Commands that will execute when this job is done. */ + sh_vptrfunc_t *j_cleanup; /* Cleanup function to call when job marked JDEAD */ + PTR_T cleanarg; /* Argument passed to (*j_cleanup)() */ +#endif /* JOB_CONTROL */ +} JOB; + +struct jobstats { + /* limits */ + long c_childmax; + /* child process statistics */ + int c_living; /* running or stopped child processes */ + int c_reaped; /* exited child processes still in jobs list */ + int c_injobs; /* total number of child processes in jobs list */ + /* child process totals */ + int c_totforked; /* total number of children this shell has forked */ + int c_totreaped; /* total number of children this shell has reaped */ + /* job counters and indices */ + int j_jobslots; /* total size of jobs array */ + int j_lastj; /* last (newest) job allocated */ + int j_firstj; /* first (oldest) job allocated */ + int j_njobs; /* number of non-NULL jobs in jobs array */ + int j_ndead; /* number of JDEAD jobs in jobs array */ + /* */ + int j_current; /* current job */ + int j_previous; /* previous job */ + /* */ + JOB *j_lastmade; /* last job allocated by stop_pipeline */ + JOB *j_lastasync; /* last async job allocated by stop_pipeline */ +}; + +struct pidstat { + struct pidstat *next; + pid_t pid; + int status; +}; + +struct bgpids { + struct pidstat *list; + struct pidstat *end; + int npid; +}; + +#define NO_JOB -1 /* An impossible job array index. */ +#define DUP_JOB -2 /* A possible return value for get_job_spec (). */ +#define BAD_JOBSPEC -3 /* Bad syntax for job spec. */ + +/* A value which cannot be a process ID. */ +#define NO_PID (pid_t)-1 + +#define ANY_PID (pid_t)-1 + +/* System calls. */ +#if !defined (HAVE_UNISTD_H) +extern pid_t fork (), getpid (), getpgrp (); +#endif /* !HAVE_UNISTD_H */ + +/* Stuff from the jobs.c file. */ +extern struct jobstats js; + +extern pid_t original_pgrp, shell_pgrp, pipeline_pgrp; +extern volatile pid_t last_made_pid, last_asynchronous_pid; +extern int asynchronous_notification; + +extern JOB **jobs; + +extern void making_children __P((void)); +extern void stop_making_children __P((void)); +extern void cleanup_the_pipeline __P((void)); +extern void save_pipeline __P((int)); +extern void restore_pipeline __P((int)); +extern void start_pipeline __P((void)); +extern int stop_pipeline __P((int, COMMAND *)); +extern void append_process __P((char *, pid_t, int, int)); + +extern void delete_job __P((int, int)); +extern void nohup_job __P((int)); +extern void delete_all_jobs __P((int)); +extern void nohup_all_jobs __P((int)); + +extern int count_all_jobs __P((void)); + +extern void terminate_current_pipeline __P((void)); +extern void terminate_stopped_jobs __P((void)); +extern void hangup_all_jobs __P((void)); +extern void kill_current_pipeline __P((void)); + +#if defined (__STDC__) && defined (pid_t) +extern int get_job_by_pid __P((int, int)); +extern void describe_pid __P((int)); +#else +extern int get_job_by_pid __P((pid_t, int)); +extern void describe_pid __P((pid_t)); +#endif + +extern void list_one_job __P((JOB *, int, int, int)); +extern void list_all_jobs __P((int)); +extern void list_stopped_jobs __P((int)); +extern void list_running_jobs __P((int)); + +extern pid_t make_child __P((char *, int)); + +extern int get_tty_state __P((void)); +extern int set_tty_state __P((void)); + +extern int job_exit_status __P((int)); +extern int job_exit_signal __P((int)); + +extern int wait_for_single_pid __P((pid_t)); +extern void wait_for_background_pids __P((void)); +extern int wait_for __P((pid_t)); +extern int wait_for_job __P((int)); +extern int wait_for_any_job __P((void)); + +extern void notify_and_cleanup __P((void)); +extern void reap_dead_jobs __P((void)); +extern int start_job __P((int, int)); +extern int kill_pid __P((pid_t, int, int)); +extern int initialize_job_control __P((int)); +extern void initialize_job_signals __P((void)); +extern int give_terminal_to __P((pid_t, int)); + +extern void run_sigchld_trap __P((int)); + +extern void freeze_jobs_list __P((void)); +extern void unfreeze_jobs_list __P((void)); +extern int set_job_control __P((int)); +extern void without_job_control __P((void)); +extern void end_job_control __P((void)); +extern void restart_job_control __P((void)); +extern void set_sigchld_handler __P((void)); +extern void ignore_tty_job_signals __P((void)); +extern void default_tty_job_signals __P((void)); + +extern void init_job_stats __P((void)); + +extern void close_pgrp_pipe __P((void)); +extern void save_pgrp_pipe __P((int *, int)); +extern void restore_pgrp_pipe __P((int *)); + +extern void set_maxchild __P((int)); + +extern int job_control; /* set to 0 in nojobs.c */ + +#endif /* _JOBS_H_ */ diff --git a/lib/glob/Makefile.in b/lib/glob/Makefile.in new file mode 100644 index 0000000..12cbb61 --- /dev/null +++ b/lib/glob/Makefile.in @@ -0,0 +1,167 @@ +## -*- text -*- #################################################### +# # +# Makefile for the GNU Glob Library. # +# # +#################################################################### +# +# Copyright (C) 1996-2009 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +srcdir = @srcdir@ +VPATH = .:@srcdir@ +topdir = @top_srcdir@ +BUILD_DIR = @BUILD_DIR@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ + +CC = @CC@ +RANLIB = @RANLIB@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +RM = rm -f +CP = cp +MV = mv + +SHELL = @MAKE_SHELL@ + +PROFILE_FLAGS = @PROFILE_FLAGS@ + +CFLAGS = @CFLAGS@ +LOCAL_CFLAGS = @LOCAL_CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ @LOCAL_LDFLAGS@ + +DEFS = @DEFS@ +LOCAL_DEFS = @LOCAL_DEFS@ + +BASHINCDIR = ${topdir}/include + +INCLUDES = -I. -I../.. -I$(topdir) -I$(BASHINCDIR) -I$(topdir)/lib + +CCFLAGS = $(PROFILE_FLAGS) $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) ${INCLUDES} \ + $(LOCAL_CFLAGS) $(CFLAGS) + +# Here is a rule for making .o files from .c files that doesn't force +# the type of the machine (like -sun3) into the flags. +.c.o: + $(RM) $@ + $(CC) -c $(CCFLAGS) $< + +# The name of the library target. +LIBRARY_NAME = libglob.a + +# The C code source files for this library. +CSOURCES = $(srcdir)/glob.c $(srcdir)/strmatch.c $(srcdir)/smatch.c \ + $(srcdir)/xmbsrtowcs.c + +# The header files for this library. +HSOURCES = $(srcdir)/strmatch.h + +OBJECTS = glob.o strmatch.o smatch.o xmbsrtowcs.o gmisc.o + +# The texinfo files which document this library. +DOCSOURCE = doc/glob.texi +DOCOBJECT = doc/glob.dvi +DOCSUPPORT = doc/Makefile +DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT) + +SUPPORT = Makefile ChangeLog $(DOCSUPPORT) + +SOURCES = $(CSOURCES) $(HSOURCES) $(DOCSOURCE) + +THINGS_TO_TAR = $(SOURCES) $(SUPPORT) + +###################################################################### + +all: $(LIBRARY_NAME) + +$(LIBRARY_NAME): $(OBJECTS) + $(RM) -f $@ + $(AR) $(ARFLAGS) $@ $(OBJECTS) + -test -n "$(RANLIB)" && $(RANLIB) $@ + +what-tar: + @for file in $(THINGS_TO_TAR); do \ + echo $(selfdir)$$file; \ + done + +documentation: force + -(cd doc; $(MAKE) $(MFLAGS)) +force: + +# The rule for 'includes' is written funny so that the if statement +# always returns TRUE unless there really was an error installing the +# include files. +install: + +clean: + rm -f $(OBJECTS) $(LIBRARY_NAME) + -(cd doc && $(MAKE) $(MFLAGS) $@ ) + +realclean distclean maintainer-clean: clean + -( cd doc && $(MAKE) $(MFLAGS) $@ ) + $(RM) -f Makefile + +mostlyclean: clean + -( cd doc && $(MAKE) $(MFLAGS) $@ ) + +${BUILD_DIR}/pathnames.h: ${BUILD_DIR}/config.h ${BUILD_DIR}/Makefile Makefile + -( cd ${BUILD_DIR} && ${MAKE} ${MFLAGS} pathnames.h ) + +###################################################################### +# # +# Dependencies for the object files which make up this library. # +# # +###################################################################### + +smatch.o: strmatch.h +smatch.o: $(BUILD_DIR)/config.h +smatch.o: $(BASHINCDIR)/chartypes.h +smatch.o: $(BASHINCDIR)/ansi_stdlib.h $(topdir)/bashansi.h +smatch.o: $(BASHINCDIR)/shmbutil.h +smatch.o: $(topdir)/xmalloc.h + +strmatch.o: strmatch.h +strmatch.o: $(BUILD_DIR)/config.h +strmatch.o: $(BASHINCDIR)/stdc.h + +glob.o: $(BUILD_DIR)/config.h +glob.o: $(topdir)/shell.h $(BUILD_DIR)/pathnames.h +glob.o: $(topdir)/bashtypes.h $(BASHINCDIR)/ansi_stdlib.h $(topdir)/bashansi.h +glob.o: $(BASHINCDIR)/posixstat.h $(BASHINCDIR)/memalloc.h +glob.o: strmatch.h glob.h +glob.o: $(BASHINCDIR)/shmbutil.h +glob.o: $(topdir)/xmalloc.h + +gmisc.o: $(BUILD_DIR)/config.h +gmisc.o: $(topdir)/bashtypes.h $(BASHINCDIR)/ansi_stdlib.h $(topdir)/bashansi.h +gmisc.o: $(BASHINCDIR)/shmbutil.h + +xmbsrtowcs.o: ${BUILD_DIR}/config.h +xmbsrtowcs.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h +xmbsrtowcs.o: ${BASHINCDIR}/shmbutil.h + +# Rules for deficient makes, like SunOS and Solaris +glob.o: glob.c +gmisc.o: gmisc.c +strmatch.o: strmatch.c +smatch.o: smatch.c +xmbsrtowcs.o: xmbsrtowcs.c + +# dependencies for C files that include other C files +glob.o: glob_loop.c +smatch.o: sm_loop.c diff --git a/lib/glob/collsyms.h b/lib/glob/collsyms.h new file mode 100644 index 0000000..d56df61 --- /dev/null +++ b/lib/glob/collsyms.h @@ -0,0 +1,140 @@ +/* collsyms.h -- collating symbol names and their corresponding characters + (in ascii) as given by POSIX.2 in table 2.8. */ + +/* Copyright (C) 1997-2002 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* The upper-case letters, lower-case letters, and digits are omitted from + this table. The digits are not included in the table in the POSIX.2 + spec. The upper and lower case letters are translated by the code + in smatch.c:collsym(). */ + +typedef struct _COLLSYM { + XCHAR *name; + CHAR code; +} __COLLSYM; + +static __COLLSYM POSIXCOLL [] = +{ + { L("NUL"), L('\0') }, + { L("SOH"), L('\001') }, + { L("STX"), L('\002') }, + { L("ETX"), L('\003') }, + { L("EOT"), L('\004') }, + { L("ENQ"), L('\005') }, + { L("ACK"), L('\006') }, +#ifdef __STDC__ + { L("alert"), L('\a') }, +#else + { L("alert"), L('\007') }, +#endif + { L("BS"), L('\010') }, + { L("backspace"), L('\b') }, + { L("HT"), L('\011') }, + { L("tab"), L('\t') }, + { L("LF"), L('\012') }, + { L("newline"), L('\n') }, + { L("VT"), L('\013') }, + { L("vertical-tab"), L('\v') }, + { L("FF"), L('\014') }, + { L("form-feed"), L('\f') }, + { L("CR"), L('\015') }, + { L("carriage-return"), L('\r') }, + { L("SO"), L('\016') }, + { L("SI"), L('\017') }, + { L("DLE"), L('\020') }, + { L("DC1"), L('\021') }, + { L("DC2"), L('\022') }, + { L("DC3"), L('\023') }, + { L("DC4"), L('\024') }, + { L("NAK"), L('\025') }, + { L("SYN"), L('\026') }, + { L("ETB"), L('\027') }, + { L("CAN"), L('\030') }, + { L("EM"), L('\031') }, + { L("SUB"), L('\032') }, + { L("ESC"), L('\033') }, + { L("IS4"), L('\034') }, + { L("FS"), L('\034') }, + { L("IS3"), L('\035') }, + { L("GS"), L('\035') }, + { L("IS2"), L('\036') }, + { L("RS"), L('\036') }, + { L("IS1"), L('\037') }, + { L("US"), L('\037') }, + { L("space"), L(' ') }, + { L("exclamation-mark"), L('!') }, + { L("quotation-mark"), L('"') }, + { L("number-sign"), L('#') }, + { L("dollar-sign"), L('$') }, + { L("percent-sign"), L('%') }, + { L("ampersand"), L('&') }, + { L("apostrophe"), L('\'') }, + { L("left-parenthesis"), L('(') }, + { L("right-parenthesis"), L(')') }, + { L("asterisk"), L('*') }, + { L("plus-sign"), L('+') }, + { L("comma"), L(',') }, + { L("hyphen"), L('-') }, + { L("hyphen-minus"), L('-') }, + { L("minus"), L('-') }, /* extension from POSIX.2 */ + { L("dash"), L('-') }, /* extension from POSIX.2 */ + { L("period"), L('.') }, + { L("full-stop"), L('.') }, + { L("slash"), L('/') }, + { L("solidus"), L('/') }, /* extension from POSIX.2 */ + { L("zero"), L('0') }, + { L("one"), L('1') }, + { L("two"), L('2') }, + { L("three"), L('3') }, + { L("four"), L('4') }, + { L("five"), L('5') }, + { L("six"), L('6') }, + { L("seven"), L('7') }, + { L("eight"), L('8') }, + { L("nine"), L('9') }, + { L("colon"), L(':') }, + { L("semicolon"), L(';') }, + { L("less-than-sign"), L('<') }, + { L("equals-sign"), L('=') }, + { L("greater-than-sign"), L('>') }, + { L("question-mark"), L('?') }, + { L("commercial-at"), L('@') }, + /* upper-case letters omitted */ + { L("left-square-bracket"), L('[') }, + { L("backslash"), L('\\') }, + { L("reverse-solidus"), L('\\') }, + { L("right-square-bracket"), L(']') }, + { L("circumflex"), L('^') }, + { L("circumflex-accent"), L('^') }, /* extension from POSIX.2 */ + { L("underscore"), L('_') }, + { L("grave-accent"), L('`') }, + /* lower-case letters omitted */ + { L("left-brace"), L('{') }, /* extension from POSIX.2 */ + { L("left-curly-bracket"), L('{') }, + { L("vertical-line"), L('|') }, + { L("right-brace"), L('}') }, /* extension from POSIX.2 */ + { L("right-curly-bracket"), L('}') }, + { L("tilde"), L('~') }, + { L("DEL"), L('\177') }, + { 0, 0 }, +}; + +#undef _COLLSYM +#undef __COLLSYM +#undef POSIXCOLL diff --git a/lib/glob/doc/Makefile b/lib/glob/doc/Makefile new file mode 100644 index 0000000..8dca606 --- /dev/null +++ b/lib/glob/doc/Makefile @@ -0,0 +1,5 @@ +all: + cp glob.texi glob.info + +clean distclean mostlyclean maintainer-clean: + rm -f glob.?? glob.info diff --git a/lib/glob/doc/glob.texi b/lib/glob/doc/glob.texi new file mode 100644 index 0000000..0262ef1 --- /dev/null +++ b/lib/glob/doc/glob.texi @@ -0,0 +1 @@ +Nothing happens here. diff --git a/lib/glob/glob.c b/lib/glob/glob.c new file mode 100644 index 0000000..ac59e8d --- /dev/null +++ b/lib/glob/glob.c @@ -0,0 +1,1391 @@ +/* glob.c -- file-name wildcard pattern matching for Bash. + + Copyright (C) 1985-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne-Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* To whomever it may concern: I have never seen the code which most + Unix programs use to perform this function. I wrote this from scratch + based on specifications for the pattern matching. --RMS. */ + +#include + +#if !defined (__GNUC__) && !defined (HAVE_ALLOCA_H) && defined (_AIX) + #pragma alloca +#endif /* _AIX && RISC6000 && !__GNUC__ */ + +#include "bashtypes.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" +#include "posixdir.h" +#include "posixstat.h" +#include "shmbutil.h" +#include "xmalloc.h" + +#include "filecntl.h" +#if !defined (F_OK) +# define F_OK 0 +#endif + +#include "stdc.h" +#include "memalloc.h" + +#include + +#include "shell.h" + +#include "glob.h" +#include "strmatch.h" + +#if !defined (HAVE_BCOPY) && !defined (bcopy) +# define bcopy(s, d, n) ((void) memcpy ((d), (s), (n))) +#endif /* !HAVE_BCOPY && !bcopy */ + +#if !defined (NULL) +# if defined (__STDC__) +# define NULL ((void *) 0) +# else +# define NULL 0x0 +# endif /* __STDC__ */ +#endif /* !NULL */ + +#if !defined (FREE) +# define FREE(x) if (x) free (x) +#endif + +/* Don't try to alloca() more than this much memory for `struct globval' + in glob_vector() */ +#ifndef ALLOCA_MAX +# define ALLOCA_MAX 100000 +#endif + +struct globval + { + struct globval *next; + char *name; + }; + +extern void throw_to_top_level __P((void)); +extern int sh_eaccess __P((char *, int)); +extern char *sh_makepath __P((const char *, const char *, int)); +extern int signal_is_pending __P((int)); +extern void run_pending_traps __P((void)); + +extern int extended_glob; + +/* Global variable which controls whether or not * matches .*. + Non-zero means don't match .*. */ +int noglob_dot_filenames = 1; + +/* Global variable which controls whether or not filename globbing + is done without regard to case. */ +int glob_ignore_case = 0; + +/* Global variable to return to signify an error in globbing. */ +char *glob_error_return; + +static struct globval finddirs_error_return; + +/* Some forward declarations. */ +static int skipname __P((char *, char *, int)); +#if HANDLE_MULTIBYTE +static int mbskipname __P((char *, char *, int)); +#endif +#if HANDLE_MULTIBYTE +static void udequote_pathname __P((char *)); +static void wdequote_pathname __P((char *)); +#else +# define dequote_pathname udequote_pathname +#endif +static void dequote_pathname __P((char *)); +static int glob_testdir __P((char *, int)); +static char **glob_dir_to_array __P((char *, char **, int)); + +/* Make sure these names continue to agree with what's in smatch.c */ +extern char *glob_patscan __P((char *, char *, int)); +extern wchar_t *glob_patscan_wc __P((wchar_t *, wchar_t *, int)); + +extern char *glob_dirscan __P((char *, int)); + +/* Compile `glob_loop.c' for single-byte characters. */ +#define CHAR unsigned char +#define INT int +#define L(CS) CS +#define INTERNAL_GLOB_PATTERN_P internal_glob_pattern_p +#include "glob_loop.c" + +/* Compile `glob_loop.c' again for multibyte characters. */ +#if HANDLE_MULTIBYTE + +#define CHAR wchar_t +#define INT wint_t +#define L(CS) L##CS +#define INTERNAL_GLOB_PATTERN_P internal_glob_wpattern_p +#include "glob_loop.c" + +#endif /* HANDLE_MULTIBYTE */ + +/* And now a function that calls either the single-byte or multibyte version + of internal_glob_pattern_p. */ +int +glob_pattern_p (pattern) + const char *pattern; +{ +#if HANDLE_MULTIBYTE + size_t n; + wchar_t *wpattern; + int r; + + if (MB_CUR_MAX == 1) + return (internal_glob_pattern_p ((unsigned char *)pattern)); + + /* Convert strings to wide chars, and call the multibyte version. */ + n = xdupmbstowcs (&wpattern, NULL, pattern); + if (n == (size_t)-1) + /* Oops. Invalid multibyte sequence. Try it as single-byte sequence. */ + return (internal_glob_pattern_p ((unsigned char *)pattern)); + + r = internal_glob_wpattern_p (wpattern); + free (wpattern); + + return r; +#else + return (internal_glob_pattern_p (pattern)); +#endif +} + +#if EXTENDED_GLOB +/* Return 1 if all subpatterns in the extended globbing pattern PAT indicate + that the name should be skipped. XXX - doesn't handle pattern negation, + not sure if it should */ +static int +extglob_skipname (pat, dname, flags) + char *pat, *dname; + int flags; +{ + char *pp, *pe, *t, *se; + int n, r, negate; + + negate = *pat == '!'; + pp = pat + 2; + se = pp + strlen (pp) - 1; /* end of string */ + pe = glob_patscan (pp, se, 0); /* end of extglob pattern (( */ + /* we should check for invalid extglob pattern here */ + if (pe == 0) + return 0; + + /* if pe != se we have more of the pattern at the end of the extglob + pattern. Check the easy case first ( */ + if (pe == se && *pe == ')' && (t = strchr (pp, '|')) == 0) + { + *pe = '\0'; +#if defined (HANDLE_MULTIBYTE) + r = mbskipname (pp, dname, flags); +#else + r = skipname (pp, dname, flags); /*(*/ +#endif + *pe = ')'; + return r; + } + + /* check every subpattern */ + while (t = glob_patscan (pp, pe, '|')) + { + n = t[-1]; + t[-1] = '\0'; +#if defined (HANDLE_MULTIBYTE) + r = mbskipname (pp, dname, flags); +#else + r = skipname (pp, dname, flags); +#endif + t[-1] = n; + if (r == 0) /* if any pattern says not skip, we don't skip */ + return r; + pp = t; + } /*(*/ + + /* glob_patscan might find end of pattern */ + if (pp == se) + return r; + + /* but if it doesn't then we didn't match a leading dot */ + return 0; +} +#endif + +/* Return 1 if DNAME should be skipped according to PAT. Mostly concerned + with matching leading `.'. */ +static int +skipname (pat, dname, flags) + char *pat; + char *dname; + int flags; +{ +#if EXTENDED_GLOB + if (extglob_pattern_p (pat)) /* XXX */ + return (extglob_skipname (pat, dname, flags)); +#endif + + /* If a leading dot need not be explicitly matched, and the pattern + doesn't start with a `.', don't match `.' or `..' */ + if (noglob_dot_filenames == 0 && pat[0] != '.' && + (pat[0] != '\\' || pat[1] != '.') && + (dname[0] == '.' && + (dname[1] == '\0' || (dname[1] == '.' && dname[2] == '\0')))) + return 1; + + /* If a dot must be explicitly matched, check to see if they do. */ + else if (noglob_dot_filenames && dname[0] == '.' && pat[0] != '.' && + (pat[0] != '\\' || pat[1] != '.')) + return 1; + + return 0; +} + +#if HANDLE_MULTIBYTE + +static int +wchkname (pat_wc, dn_wc) + wchar_t *pat_wc, *dn_wc; +{ + /* If a leading dot need not be explicitly matched, and the + pattern doesn't start with a `.', don't match `.' or `..' */ + if (noglob_dot_filenames == 0 && pat_wc[0] != L'.' && + (pat_wc[0] != L'\\' || pat_wc[1] != L'.') && + (dn_wc[0] == L'.' && + (dn_wc[1] == L'\0' || (dn_wc[1] == L'.' && dn_wc[2] == L'\0')))) + return 1; + + /* If a leading dot must be explicitly matched, check to see if the + pattern and dirname both have one. */ + else if (noglob_dot_filenames && dn_wc[0] == L'.' && + pat_wc[0] != L'.' && + (pat_wc[0] != L'\\' || pat_wc[1] != L'.')) + return 1; + + return 0; +} + +static int +wextglob_skipname (pat, dname, flags) + wchar_t *pat, *dname; + int flags; +{ +#if EXTENDED_GLOB + wchar_t *pp, *pe, *t, n, *se; + int r, negate; + + negate = *pat == L'!'; + pp = pat + 2; + se = pp + wcslen (pp) - 1; /*(*/ + pe = glob_patscan_wc (pp, se, 0); + + if (pe == se && *pe == ')' && (t = wcschr (pp, L'|')) == 0) + { + *pe = L'\0'; + r = wchkname (pp, dname); /*(*/ + *pe = L')'; + return r; + } + + /* check every subpattern */ + while (t = glob_patscan_wc (pp, pe, '|')) + { + n = t[-1]; + t[-1] = L'\0'; + r = wchkname (pp, dname); + t[-1] = n; + if (r == 0) + return 0; + pp = t; + } + + if (pp == pe) /* glob_patscan_wc might find end of pattern */ + return r; + + /* but if it doesn't then we didn't match a leading dot */ + return 0; +#else + return (wchkname (pat, dname)); +#endif +} + +/* Return 1 if DNAME should be skipped according to PAT. Handles multibyte + characters in PAT and DNAME. Mostly concerned with matching leading `.'. */ +static int +mbskipname (pat, dname, flags) + char *pat, *dname; + int flags; +{ + int ret, ext; + wchar_t *pat_wc, *dn_wc; + size_t pat_n, dn_n; + + if (mbsmbchar (dname) == 0 && mbsmbchar (pat) == 0) + return (skipname (pat, dname, flags)); + + ext = 0; +#if EXTENDED_GLOB + ext = extglob_pattern_p (pat); +#endif + + pat_wc = dn_wc = (wchar_t *)NULL; + + pat_n = xdupmbstowcs (&pat_wc, NULL, pat); + if (pat_n != (size_t)-1) + dn_n = xdupmbstowcs (&dn_wc, NULL, dname); + + ret = 0; + if (pat_n != (size_t)-1 && dn_n !=(size_t)-1) + ret = ext ? wextglob_skipname (pat_wc, dn_wc, flags) : wchkname (pat_wc, dn_wc); + else + ret = skipname (pat, dname, flags); + + FREE (pat_wc); + FREE (dn_wc); + + return ret; +} +#endif /* HANDLE_MULTIBYTE */ + +/* Remove backslashes quoting characters in PATHNAME by modifying PATHNAME. */ +static void +udequote_pathname (pathname) + char *pathname; +{ + register int i, j; + + for (i = j = 0; pathname && pathname[i]; ) + { + if (pathname[i] == '\\') + i++; + + pathname[j++] = pathname[i++]; + + if (pathname[i - 1] == 0) + break; + } + if (pathname) + pathname[j] = '\0'; +} + +#if HANDLE_MULTIBYTE +/* Remove backslashes quoting characters in PATHNAME by modifying PATHNAME. */ +static void +wdequote_pathname (pathname) + char *pathname; +{ + mbstate_t ps; + size_t len, n; + wchar_t *wpathname; + int i, j; + wchar_t *orig_wpathname; + + len = strlen (pathname); + /* Convert the strings into wide characters. */ + n = xdupmbstowcs (&wpathname, NULL, pathname); + if (n == (size_t) -1) + { + /* Something wrong. Fall back to single-byte */ + udequote_pathname (pathname); + return; + } + orig_wpathname = wpathname; + + for (i = j = 0; wpathname && wpathname[i]; ) + { + if (wpathname[i] == L'\\') + i++; + + wpathname[j++] = wpathname[i++]; + + if (wpathname[i - 1] == L'\0') + break; + } + if (wpathname) + wpathname[j] = L'\0'; + + /* Convert the wide character string into unibyte character set. */ + memset (&ps, '\0', sizeof(mbstate_t)); + n = wcsrtombs(pathname, (const wchar_t **)&wpathname, len, &ps); + pathname[len] = '\0'; + + /* Can't just free wpathname here; wcsrtombs changes it in many cases. */ + free (orig_wpathname); +} + +static void +dequote_pathname (pathname) + char *pathname; +{ + if (MB_CUR_MAX > 1) + wdequote_pathname (pathname); + else + udequote_pathname (pathname); +} +#endif /* HANDLE_MULTIBYTE */ + +/* Test whether NAME exists. */ + +#if defined (HAVE_LSTAT) +# define GLOB_TESTNAME(name) (lstat (name, &finfo)) +#else /* !HAVE_LSTAT */ +# if !defined (AFS) +# define GLOB_TESTNAME(name) (sh_eaccess (name, F_OK)) +# else /* AFS */ +# define GLOB_TESTNAME(name) (access (name, F_OK)) +# endif /* AFS */ +#endif /* !HAVE_LSTAT */ + +/* Return 0 if DIR is a directory, -1 otherwise. */ +static int +glob_testdir (dir, flags) + char *dir; + int flags; +{ + struct stat finfo; + int r; + +/*itrace("glob_testdir: testing %s" flags = %d, dir, flags);*/ +#if defined (HAVE_LSTAT) + r = (flags & GX_ALLDIRS) ? lstat (dir, &finfo) : stat (dir, &finfo); +#else + r = stat (dir, &finfo); +#endif + if (r < 0) + return (-1); + + if (S_ISDIR (finfo.st_mode) == 0) + return (-1); + + return (0); +} + +/* Recursively scan SDIR for directories matching PAT (PAT is always `**'). + FLAGS is simply passed down to the recursive call to glob_vector. Returns + a list of matching directory names. EP, if non-null, is set to the last + element of the returned list. NP, if non-null, is set to the number of + directories in the returned list. These two variables exist for the + convenience of the caller (always glob_vector). */ +static struct globval * +finddirs (pat, sdir, flags, ep, np) + char *pat; + char *sdir; + int flags; + struct globval **ep; + int *np; +{ + char **r, *n; + int ndirs; + struct globval *ret, *e, *g; + +/*itrace("finddirs: pat = `%s' sdir = `%s' flags = 0x%x", pat, sdir, flags);*/ + e = ret = 0; + r = glob_vector (pat, sdir, flags); + if (r == 0 || r[0] == 0) + { + if (np) + *np = 0; + if (ep) + *ep = 0; + if (r && r != &glob_error_return) + free (r); + return (struct globval *)0; + } + for (ndirs = 0; r[ndirs] != 0; ndirs++) + { + g = (struct globval *) malloc (sizeof (struct globval)); + if (g == 0) + { + while (ret) /* free list built so far */ + { + g = ret->next; + free (ret); + ret = g; + } + + free (r); + if (np) + *np = 0; + if (ep) + *ep = 0; + return (&finddirs_error_return); + } + if (e == 0) + e = g; + + g->next = ret; + ret = g; + + g->name = r[ndirs]; + } + + free (r); + if (ep) + *ep = e; + if (np) + *np = ndirs; + + return ret; +} + +/* Return a vector of names of files in directory DIR + whose names match glob pattern PAT. + The names are not in any particular order. + Wildcards at the beginning of PAT do not match an initial period. + + The vector is terminated by an element that is a null pointer. + + To free the space allocated, first free the vector's elements, + then free the vector. + + Return 0 if cannot get enough memory to hold the pointer + and the names. + + Return -1 if cannot access directory DIR. + Look in errno for more information. */ + +char ** +glob_vector (pat, dir, flags) + char *pat; + char *dir; + int flags; +{ + DIR *d; + register struct dirent *dp; + struct globval *lastlink, *e, *dirlist; + register struct globval *nextlink; + register char *nextname, *npat, *subdir; + unsigned int count; + int lose, skip, ndirs, isdir, sdlen, add_current, patlen; + register char **name_vector; + register unsigned int i; + int mflags; /* Flags passed to strmatch (). */ + int pflags; /* flags passed to sh_makepath () */ + int nalloca; + struct globval *firstmalloc, *tmplink; + char *convfn; + + lastlink = 0; + count = lose = skip = add_current = 0; + + firstmalloc = 0; + nalloca = 0; + +/*itrace("glob_vector: pat = `%s' dir = `%s' flags = 0x%x", pat, dir, flags);*/ + /* If PAT is empty, skip the loop, but return one (empty) filename. */ + if (pat == 0 || *pat == '\0') + { + if (glob_testdir (dir, 0) < 0) + return ((char **) &glob_error_return); + + nextlink = (struct globval *)alloca (sizeof (struct globval)); + if (nextlink == NULL) + return ((char **) NULL); + + nextlink->next = (struct globval *)0; + nextname = (char *) malloc (1); + if (nextname == 0) + lose = 1; + else + { + lastlink = nextlink; + nextlink->name = nextname; + nextname[0] = '\0'; + count = 1; + } + + skip = 1; + } + + patlen = (pat && *pat) ? strlen (pat) : 0; + + /* If the filename pattern (PAT) does not contain any globbing characters, + we can dispense with reading the directory, and just see if there is + a filename `DIR/PAT'. If there is, and we can access it, just make the + vector to return and bail immediately. */ + if (skip == 0 && glob_pattern_p (pat) == 0) + { + int dirlen; + struct stat finfo; + + if (glob_testdir (dir, 0) < 0) + return ((char **) &glob_error_return); + + dirlen = strlen (dir); + nextname = (char *)malloc (dirlen + patlen + 2); + npat = (char *)malloc (patlen + 1); + if (nextname == 0 || npat == 0) + { + FREE (nextname); + FREE (npat); + lose = 1; + } + else + { + strcpy (npat, pat); + dequote_pathname (npat); + + strcpy (nextname, dir); + nextname[dirlen++] = '/'; + strcpy (nextname + dirlen, npat); + + if (GLOB_TESTNAME (nextname) >= 0) + { + free (nextname); + nextlink = (struct globval *)alloca (sizeof (struct globval)); + if (nextlink) + { + nextlink->next = (struct globval *)0; + lastlink = nextlink; + nextlink->name = npat; + count = 1; + } + else + { + free (npat); + lose = 1; + } + } + else + { + free (nextname); + free (npat); + } + } + + skip = 1; + } + + if (skip == 0) + { + /* Open the directory, punting immediately if we cannot. If opendir + is not robust (i.e., it opens non-directories successfully), test + that DIR is a directory and punt if it's not. */ +#if defined (OPENDIR_NOT_ROBUST) + if (glob_testdir (dir, 0) < 0) + return ((char **) &glob_error_return); +#endif + + d = opendir (dir); + if (d == NULL) + return ((char **) &glob_error_return); + + /* Compute the flags that will be passed to strmatch(). We don't + need to do this every time through the loop. */ + mflags = (noglob_dot_filenames ? FNM_PERIOD : 0) | FNM_PATHNAME; + +#ifdef FNM_CASEFOLD + if (glob_ignore_case) + mflags |= FNM_CASEFOLD; +#endif + + if (extended_glob) + mflags |= FNM_EXTMATCH; + + add_current = ((flags & (GX_ALLDIRS|GX_ADDCURDIR)) == (GX_ALLDIRS|GX_ADDCURDIR)); + + /* Scan the directory, finding all names that match. + For each name that matches, allocate a struct globval + on the stack and store the name in it. + Chain those structs together; lastlink is the front of the chain. */ + while (1) + { + /* Make globbing interruptible in the shell. */ + if (interrupt_state || terminating_signal) + { + lose = 1; + break; + } + else if (signal_is_pending (SIGINT)) /* XXX - make SIGINT traps responsive */ + { + lose = 1; + break; + } + + dp = readdir (d); + if (dp == NULL) + break; + + /* If this directory entry is not to be used, try again. */ + if (REAL_DIR_ENTRY (dp) == 0) + continue; + +#if 0 + if (dp->d_name == 0 || *dp->d_name == 0) + continue; +#endif + +#if HANDLE_MULTIBYTE + if (MB_CUR_MAX > 1 && mbskipname (pat, dp->d_name, flags)) + continue; + else +#endif + if (skipname (pat, dp->d_name, flags)) + continue; + + /* If we're only interested in directories, don't bother with files */ + if (flags & (GX_MATCHDIRS|GX_ALLDIRS)) + { + pflags = (flags & GX_ALLDIRS) ? MP_RMDOT : 0; + if (flags & GX_NULLDIR) + pflags |= MP_IGNDOT; + subdir = sh_makepath (dir, dp->d_name, pflags); + isdir = glob_testdir (subdir, flags); + if (isdir < 0 && (flags & GX_MATCHDIRS)) + { + free (subdir); + continue; + } + } + + if (flags & GX_ALLDIRS) + { + if (isdir == 0) + { + dirlist = finddirs (pat, subdir, (flags & ~GX_ADDCURDIR), &e, &ndirs); + if (dirlist == &finddirs_error_return) + { + free (subdir); + lose = 1; + break; + } + if (ndirs) /* add recursive directories to list */ + { + if (firstmalloc == 0) + firstmalloc = e; + e->next = lastlink; + lastlink = dirlist; + count += ndirs; + } + } + + nextlink = (struct globval *) malloc (sizeof (struct globval)); + if (firstmalloc == 0) + firstmalloc = nextlink; + sdlen = strlen (subdir); + nextname = (char *) malloc (sdlen + 1); + if (nextlink == 0 || nextname == 0) + { + FREE (nextlink); + FREE (nextname); + free (subdir); + lose = 1; + break; + } + nextlink->next = lastlink; + lastlink = nextlink; + nextlink->name = nextname; + bcopy (subdir, nextname, sdlen + 1); + free (subdir); + ++count; + continue; + } + else if (flags & GX_MATCHDIRS) + free (subdir); + + convfn = fnx_fromfs (dp->d_name, D_NAMLEN (dp)); + if (strmatch (pat, convfn, mflags) != FNM_NOMATCH) + { + if (nalloca < ALLOCA_MAX) + { + nextlink = (struct globval *) alloca (sizeof (struct globval)); + nalloca += sizeof (struct globval); + } + else + { + nextlink = (struct globval *) malloc (sizeof (struct globval)); + if (firstmalloc == 0) + firstmalloc = nextlink; + } + + nextname = (char *) malloc (D_NAMLEN (dp) + 1); + if (nextlink == 0 || nextname == 0) + { + FREE (nextlink); + FREE (nextname); + lose = 1; + break; + } + nextlink->next = lastlink; + lastlink = nextlink; + nextlink->name = nextname; + bcopy (dp->d_name, nextname, D_NAMLEN (dp) + 1); + ++count; + } + } + + (void) closedir (d); + } + + /* compat: if GX_ADDCURDIR, add the passed directory also. Add an empty + directory name as a placeholder if GX_NULLDIR (in which case the passed + directory name is "."). */ + if (add_current) + { + sdlen = strlen (dir); + nextname = (char *)malloc (sdlen + 1); + nextlink = (struct globval *) malloc (sizeof (struct globval)); + if (nextlink == 0 || nextname == 0) + { + FREE (nextlink); + FREE (nextname); + lose = 1; + } + else + { + nextlink->name = nextname; + nextlink->next = lastlink; + lastlink = nextlink; + if (flags & GX_NULLDIR) + nextname[0] = '\0'; + else + bcopy (dir, nextname, sdlen + 1); + ++count; + } + } + + if (lose == 0) + { + name_vector = (char **) malloc ((count + 1) * sizeof (char *)); + lose |= name_vector == NULL; + } + + /* Have we run out of memory? */ + if (lose) + { + tmplink = 0; + + /* Here free the strings we have got. */ + while (lastlink) + { + /* Since we build the list in reverse order, the first N entries + will be allocated with malloc, if firstmalloc is set, from + lastlink to firstmalloc. */ + if (firstmalloc) + { + if (lastlink == firstmalloc) + firstmalloc = 0; + tmplink = lastlink; + } + else + tmplink = 0; + free (lastlink->name); + lastlink = lastlink->next; + FREE (tmplink); + } + + /* Don't call QUIT; here; let higher layers deal with it. */ + + return ((char **)NULL); + } + + /* Copy the name pointers from the linked list into the vector. */ + for (tmplink = lastlink, i = 0; i < count; ++i) + { + name_vector[i] = tmplink->name; + tmplink = tmplink->next; + } + + name_vector[count] = NULL; + + /* If we allocated some of the struct globvals, free them now. */ + if (firstmalloc) + { + tmplink = 0; + while (lastlink) + { + tmplink = lastlink; + if (lastlink == firstmalloc) + lastlink = firstmalloc = 0; + else + lastlink = lastlink->next; + free (tmplink); + } + } + + return (name_vector); +} + +/* Return a new array which is the concatenation of each string in ARRAY + to DIR. This function expects you to pass in an allocated ARRAY, and + it takes care of free()ing that array. Thus, you might think of this + function as side-effecting ARRAY. This should handle GX_MARKDIRS. */ +static char ** +glob_dir_to_array (dir, array, flags) + char *dir, **array; + int flags; +{ + register unsigned int i, l; + int add_slash; + char **result, *new; + struct stat sb; + + l = strlen (dir); + if (l == 0) + { + if (flags & GX_MARKDIRS) + for (i = 0; array[i]; i++) + { + if ((stat (array[i], &sb) == 0) && S_ISDIR (sb.st_mode)) + { + l = strlen (array[i]); + new = (char *)realloc (array[i], l + 2); + if (new == 0) + return NULL; + new[l] = '/'; + new[l+1] = '\0'; + array[i] = new; + } + } + return (array); + } + + add_slash = dir[l - 1] != '/'; + + i = 0; + while (array[i] != NULL) + ++i; + + result = (char **) malloc ((i + 1) * sizeof (char *)); + if (result == NULL) + return (NULL); + + for (i = 0; array[i] != NULL; i++) + { + /* 3 == 1 for NUL, 1 for slash at end of DIR, 1 for GX_MARKDIRS */ + result[i] = (char *) malloc (l + strlen (array[i]) + 3); + + if (result[i] == NULL) + { + int ind; + for (ind = 0; ind < i; ind++) + free (result[ind]); + free (result); + return (NULL); + } + + strcpy (result[i], dir); + if (add_slash) + result[i][l] = '/'; + strcpy (result[i] + l + add_slash, array[i]); + if (flags & GX_MARKDIRS) + { + if ((stat (result[i], &sb) == 0) && S_ISDIR (sb.st_mode)) + { + size_t rlen; + rlen = strlen (result[i]); + result[i][rlen] = '/'; + result[i][rlen+1] = '\0'; + } + } + } + result[i] = NULL; + + /* Free the input array. */ + for (i = 0; array[i] != NULL; i++) + free (array[i]); + free ((char *) array); + + return (result); +} + +/* Do globbing on PATHNAME. Return an array of pathnames that match, + marking the end of the array with a null-pointer as an element. + If no pathnames match, then the array is empty (first element is null). + If there isn't enough memory, then return NULL. + If a file system error occurs, return -1; `errno' has the error code. */ +char ** +glob_filename (pathname, flags) + char *pathname; + int flags; +{ + char **result; + unsigned int result_size; + char *directory_name, *filename, *dname, *fn; + unsigned int directory_len; + int free_dirname; /* flag */ + int dflags; + + result = (char **) malloc (sizeof (char *)); + result_size = 1; + if (result == NULL) + return (NULL); + + result[0] = NULL; + + directory_name = NULL; + + /* Find the filename. */ + filename = strrchr (pathname, '/'); +#if defined (EXTENDED_GLOB) + if (filename && extended_glob) + { + fn = glob_dirscan (pathname, '/'); +#if DEBUG_MATCHING + if (fn != filename) + fprintf (stderr, "glob_filename: glob_dirscan: fn (%s) != filename (%s)\n", fn ? fn : "(null)", filename); +#endif + filename = fn; + } +#endif + + if (filename == NULL) + { + filename = pathname; + directory_name = ""; + directory_len = 0; + free_dirname = 0; + } + else + { + directory_len = (filename - pathname) + 1; + directory_name = (char *) malloc (directory_len + 1); + + if (directory_name == 0) /* allocation failed? */ + return (NULL); + + bcopy (pathname, directory_name, directory_len); + directory_name[directory_len] = '\0'; + ++filename; + free_dirname = 1; + } + + /* If directory_name contains globbing characters, then we + have to expand the previous levels. Just recurse. */ + if (directory_len > 0 && glob_pattern_p (directory_name)) + { + char **directories, *d, *p; + register unsigned int i; + int all_starstar, last_starstar; + + all_starstar = last_starstar = 0; + d = directory_name; + dflags = flags & ~GX_MARKDIRS; + /* Collapse a sequence of ** patterns separated by one or more slashes + to a single ** terminated by a slash or NUL */ + if ((flags & GX_GLOBSTAR) && d[0] == '*' && d[1] == '*' && (d[2] == '/' || d[2] == '\0')) + { + p = d; + while (d[0] == '*' && d[1] == '*' && (d[2] == '/' || d[2] == '\0')) + { + p = d; + if (d[2]) + { + d += 3; + while (*d == '/') + d++; + if (*d == 0) + break; + } + } + if (*d == 0) + all_starstar = 1; + d = p; + dflags |= GX_ALLDIRS|GX_ADDCURDIR; + directory_len = strlen (d); + } + + /* If there is a non [star][star]/ component in directory_name, we + still need to collapse trailing sequences of [star][star]/ into + a single one and note that the directory name ends with [star][star], + so we can compensate if filename is [star][star] */ + if ((flags & GX_GLOBSTAR) && all_starstar == 0) + { + int dl, prev; + prev = dl = directory_len; + while (dl >= 4 && d[dl - 1] == '/' && + d[dl - 2] == '*' && + d[dl - 3] == '*' && + d[dl - 4] == '/') + prev = dl, dl -= 3; + if (dl != directory_len) + last_starstar = 1; + directory_len = prev; + } + + /* If the directory name ends in [star][star]/ but the filename is + [star][star], just remove the final [star][star] from the directory + so we don't have to scan everything twice. */ + if (last_starstar && directory_len > 4 && + filename[0] == '*' && filename[1] == '*' && filename[2] == 0) + { + directory_len -= 3; + } + + if (d[directory_len - 1] == '/') + d[directory_len - 1] = '\0'; + + directories = glob_filename (d, dflags); + + if (free_dirname) + { + free (directory_name); + directory_name = NULL; + } + + if (directories == NULL) + goto memory_error; + else if (directories == (char **)&glob_error_return) + { + free ((char *) result); + return ((char **) &glob_error_return); + } + else if (*directories == NULL) + { + free ((char *) directories); + free ((char *) result); + return ((char **) &glob_error_return); + } + + /* If we have something like [star][star]/[star][star], it's no use to + glob **, then do it again, and throw half the results away. */ + if (all_starstar && filename[0] == '*' && filename[1] == '*' && filename[2] == 0) + { + free ((char *) directories); + free (directory_name); + directory_name = NULL; + directory_len = 0; + goto only_filename; + } + + /* We have successfully globbed the preceding directory name. + For each name in DIRECTORIES, call glob_vector on it and + FILENAME. Concatenate the results together. */ + for (i = 0; directories[i] != NULL; ++i) + { + char **temp_results; + int shouldbreak; + + shouldbreak = 0; + /* XXX -- we've recursively scanned any directories resulting from + a `**', so turn off the flag. We turn it on again below if + filename is `**' */ + /* Scan directory even on a NULL filename. That way, `*h/' + returns only directories ending in `h', instead of all + files ending in `h' with a `/' appended. */ + dname = directories[i]; + dflags = flags & ~(GX_MARKDIRS|GX_ALLDIRS|GX_ADDCURDIR); + if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0') + dflags |= GX_ALLDIRS|GX_ADDCURDIR; + if (dname[0] == '\0' && filename[0]) + { + dflags |= GX_NULLDIR; + dname = "."; /* treat null directory name and non-null filename as current directory */ + } + temp_results = glob_vector (filename, dname, dflags); + + /* Handle error cases. */ + if (temp_results == NULL) + goto memory_error; + else if (temp_results == (char **)&glob_error_return) + /* This filename is probably not a directory. Ignore it. */ + ; + else + { + char **array; + register unsigned int l; + + /* If we're expanding **, we don't need to glue the directory + name to the results; we've already done it in glob_vector */ + if ((dflags & GX_ALLDIRS) && filename[0] == '*' && filename[1] == '*' && (filename[2] == '\0' || filename[2] == '/')) + { + /* When do we remove null elements from temp_results? And + how to avoid duplicate elements in the final result? */ + /* If (dflags & GX_NULLDIR) glob_filename potentially left a + NULL placeholder in the temp results just in case + glob_vector/glob_dir_to_array did something with it, but + if it didn't, and we're not supposed to be passing them + through for some reason ((flags & GX_NULLDIR) == 0) we + need to remove all the NULL elements from the beginning + of TEMP_RESULTS. */ + /* If we have a null directory name and ** as the filename, + we have just searched for everything from the current + directory on down. Break now (shouldbreak = 1) to avoid + duplicate entries in the final result. */ +#define NULL_PLACEHOLDER(x) ((x) && *(x) && **(x) == 0) + if ((dflags & GX_NULLDIR) && (flags & GX_NULLDIR) == 0 && + NULL_PLACEHOLDER (temp_results)) +#undef NULL_PLACEHOLDER + { + register int i, n; + for (n = 0; temp_results[n] && *temp_results[n] == 0; n++) + ; + i = n; + do + temp_results[i - n] = temp_results[i]; + while (temp_results[i++] != 0); + array = temp_results; + shouldbreak = 1; + } + else + array = temp_results; + } + else + array = glob_dir_to_array (directories[i], temp_results, flags); + l = 0; + while (array[l] != NULL) + ++l; + + result = + (char **)realloc (result, (result_size + l) * sizeof (char *)); + + if (result == NULL) + goto memory_error; + + for (l = 0; array[l] != NULL; ++l) + result[result_size++ - 1] = array[l]; + + result[result_size - 1] = NULL; + + /* Note that the elements of ARRAY are not freed. */ + if (array != temp_results) + free ((char *) array); + else if ((dflags & GX_ALLDIRS) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0') + free (temp_results); /* expanding ** case above */ + + if (shouldbreak) + break; + } + } + /* Free the directories. */ + for (i = 0; directories[i]; i++) + free (directories[i]); + + free ((char *) directories); + + return (result); + } + +only_filename: + /* If there is only a directory name, return it. */ + if (*filename == '\0') + { + result = (char **) realloc ((char *) result, 2 * sizeof (char *)); + if (result == NULL) + return (NULL); + /* Handle GX_MARKDIRS here. */ + result[0] = (char *) malloc (directory_len + 1); + if (result[0] == NULL) + goto memory_error; + bcopy (directory_name, result[0], directory_len + 1); + if (free_dirname) + free (directory_name); + result[1] = NULL; + return (result); + } + else + { + char **temp_results; + + /* There are no unquoted globbing characters in DIRECTORY_NAME. + Dequote it before we try to open the directory since there may + be quoted globbing characters which should be treated verbatim. */ + if (directory_len > 0) + dequote_pathname (directory_name); + + /* We allocated a small array called RESULT, which we won't be using. + Free that memory now. */ + free (result); + + /* Just return what glob_vector () returns appended to the + directory name. */ + /* If flags & GX_ALLDIRS, we're called recursively */ + dflags = flags & ~GX_MARKDIRS; + if (directory_len == 0) + dflags |= GX_NULLDIR; + if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0') + { + dflags |= GX_ALLDIRS|GX_ADDCURDIR; +#if 0 + /* If we want all directories (dflags & GX_ALLDIRS) and we're not + being called recursively as something like `echo [star][star]/[star].o' + ((flags & GX_ALLDIRS) == 0), we want to prevent glob_vector from + adding a null directory name to the front of the temp_results + array. We turn off ADDCURDIR if not called recursively and + dlen == 0 */ +#endif + if (directory_len == 0 && (flags & GX_ALLDIRS) == 0) + dflags &= ~GX_ADDCURDIR; + } + temp_results = glob_vector (filename, + (directory_len == 0 ? "." : directory_name), + dflags); + + if (temp_results == NULL || temp_results == (char **)&glob_error_return) + { + if (free_dirname) + free (directory_name); + QUIT; /* XXX - shell */ + run_pending_traps (); + return (temp_results); + } + + result = glob_dir_to_array ((dflags & GX_ALLDIRS) ? "" : directory_name, temp_results, flags); + + if (free_dirname) + free (directory_name); + return (result); + } + + /* We get to memory_error if the program has run out of memory, or + if this is the shell, and we have been interrupted. */ + memory_error: + if (result != NULL) + { + register unsigned int i; + for (i = 0; result[i] != NULL; ++i) + free (result[i]); + free ((char *) result); + } + + if (free_dirname && directory_name) + free (directory_name); + + QUIT; + run_pending_traps (); + + return (NULL); +} + +#if defined (TEST) + +main (argc, argv) + int argc; + char **argv; +{ + unsigned int i; + + for (i = 1; i < argc; ++i) + { + char **value = glob_filename (argv[i], 0); + if (value == NULL) + puts ("Out of memory."); + else if (value == &glob_error_return) + perror (argv[i]); + else + for (i = 0; value[i] != NULL; i++) + puts (value[i]); + } + + exit (0); +} +#endif /* TEST. */ diff --git a/lib/glob/glob.h b/lib/glob/glob.h new file mode 100644 index 0000000..b946233 --- /dev/null +++ b/lib/glob/glob.h @@ -0,0 +1,44 @@ +/* File-name wildcard pattern matching for GNU. + Copyright (C) 1985, 1988, 1989, 2008,2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne-Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _GLOB_H_ +#define _GLOB_H_ + +#include "stdc.h" + +#define GX_MARKDIRS 0x001 /* mark directory names with trailing `/' */ +#define GX_NOCASE 0x002 /* ignore case */ +#define GX_MATCHDOT 0x004 /* match `.' literally */ +#define GX_MATCHDIRS 0x008 /* match only directory names */ +#define GX_ALLDIRS 0x010 /* match all directory names, no others */ +#define GX_NULLDIR 0x100 /* internal -- no directory preceding pattern */ +#define GX_ADDCURDIR 0x200 /* internal -- add passed directory name */ +#define GX_GLOBSTAR 0x400 /* turn on special handling of ** */ + +extern int glob_pattern_p __P((const char *)); +extern char **glob_vector __P((char *, char *, int)); +extern char **glob_filename __P((char *, int)); + +extern int extglob_pattern_p __P((const char *)); + +extern char *glob_error_return; +extern int noglob_dot_filenames; +extern int glob_ignore_case; + +#endif /* _GLOB_H_ */ diff --git a/lib/glob/glob_loop.c b/lib/glob/glob_loop.c new file mode 100644 index 0000000..89e86af --- /dev/null +++ b/lib/glob/glob_loop.c @@ -0,0 +1,67 @@ +/* Copyright (C) 1991-2005 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +static int INTERNAL_GLOB_PATTERN_P __P((const CHAR *)); + +/* Return nonzero if PATTERN has any special globbing chars in it. + Compiled twice, once each for single-byte and multibyte characters. */ +static int +INTERNAL_GLOB_PATTERN_P (pattern) + const CHAR *pattern; +{ + register const CHAR *p; + register CHAR c; + int bopen; + + p = pattern; + bopen = 0; + + while ((c = *p++) != L('\0')) + switch (c) + { + case L('?'): + case L('*'): + return 1; + + case L('['): /* Only accept an open brace if there is a close */ + bopen++; /* brace to match it. Bracket expressions must be */ + continue; /* complete, according to Posix.2 */ + case L(']'): + if (bopen) + return 1; + continue; + + case L('+'): /* extended matching operators */ + case L('@'): + case L('!'): + if (*p == L('(')) /*) */ + return 1; + continue; + + case L('\\'): + if (*p++ == L('\0')) + return 0; + } + + return 0; +} + +#undef INTERNAL_GLOB_PATTERN_P +#undef L +#undef INT +#undef CHAR diff --git a/lib/glob/gmisc.c b/lib/glob/gmisc.c new file mode 100644 index 0000000..96b1bc0 --- /dev/null +++ b/lib/glob/gmisc.c @@ -0,0 +1,410 @@ +/* gmisc.c -- miscellaneous pattern matching utility functions for Bash. + + Copyright (C) 2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne-Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include "bashtypes.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" +#include "shmbutil.h" + +#include "stdc.h" + +#ifndef LPAREN +# define LPAREN '(' +#endif +#ifndef RPAREN +# define RPAREN ')' +#endif + +#if defined (HANDLE_MULTIBYTE) +#define WLPAREN L'(' +#define WRPAREN L')' + +extern char *glob_patscan __P((char *, char *, int)); + +/* Return 1 of the first character of WSTRING could match the first + character of pattern WPAT. Wide character version. */ +int +match_pattern_wchar (wpat, wstring) + wchar_t *wpat, *wstring; +{ + wchar_t wc; + + if (*wstring == 0) + return (0); + + switch (wc = *wpat++) + { + default: + return (*wstring == wc); + case L'\\': + return (*wstring == *wpat); + case L'?': + return (*wpat == WLPAREN ? 1 : (*wstring != L'\0')); + case L'*': + return (1); + case L'+': + case L'!': + case L'@': + return (*wpat == WLPAREN ? 1 : (*wstring == wc)); + case L'[': + return (*wstring != L'\0'); + } +} + +int +wmatchlen (wpat, wmax) + wchar_t *wpat; + size_t wmax; +{ + wchar_t wc; + int matlen, bracklen, t, in_cclass, in_collsym, in_equiv; + + if (*wpat == 0) + return (0); + + matlen = in_cclass = in_collsym = in_equiv = 0; + while (wc = *wpat++) + { + switch (wc) + { + default: + matlen++; + break; + case L'\\': + if (*wpat == 0) + return ++matlen; + else + { + matlen++; + wpat++; + } + break; + case L'?': + if (*wpat == WLPAREN) + return (matlen = -1); /* XXX for now */ + else + matlen++; + break; + case L'*': + return (matlen = -1); + case L'+': + case L'!': + case L'@': + if (*wpat == WLPAREN) + return (matlen = -1); /* XXX for now */ + else + matlen++; + break; + case L'[': + /* scan for ending `]', skipping over embedded [:...:] */ + bracklen = 1; + wc = *wpat++; + do + { + if (wc == 0) + { + wpat--; /* back up to NUL */ + matlen += bracklen; + goto bad_bracket; + } + else if (wc == L'\\') + { + /* *wpat == backslash-escaped character */ + bracklen++; + /* If the backslash or backslash-escape ends the string, + bail. The ++wpat skips over the backslash escape */ + if (*wpat == 0 || *++wpat == 0) + { + matlen += bracklen; + goto bad_bracket; + } + } + else if (wc == L'[' && *wpat == L':') /* character class */ + { + wpat++; + bracklen++; + in_cclass = 1; + } + else if (in_cclass && wc == L':' && *wpat == L']') + { + wpat++; + bracklen++; + in_cclass = 0; + } + else if (wc == L'[' && *wpat == L'.') /* collating symbol */ + { + wpat++; + bracklen++; + if (*wpat == L']') /* right bracket can appear as collating symbol */ + { + wpat++; + bracklen++; + } + in_collsym = 1; + } + else if (in_collsym && wc == L'.' && *wpat == L']') + { + wpat++; + bracklen++; + in_collsym = 0; + } + else if (wc == L'[' && *wpat == L'=') /* equivalence class */ + { + wpat++; + bracklen++; + if (*wpat == L']') /* right bracket can appear as equivalence class */ + { + wpat++; + bracklen++; + } + in_equiv = 1; + } + else if (in_equiv && wc == L'=' && *wpat == L']') + { + wpat++; + bracklen++; + in_equiv = 0; + } + else + bracklen++; + } + while ((wc = *wpat++) != L']'); + matlen++; /* bracket expression can only match one char */ +bad_bracket: + break; + } + } + + return matlen; +} +#endif + +int +extglob_pattern_p (pat) + char *pat; +{ + switch (pat[0]) + { + case '*': + case '+': + case '!': + case '@': + case '?': + return (pat[1] == LPAREN); + default: + return 0; + } + + return 0; +} + +/* Return 1 of the first character of STRING could match the first + character of pattern PAT. Used to avoid n2 calls to strmatch(). */ +int +match_pattern_char (pat, string) + char *pat, *string; +{ + char c; + + if (*string == 0) + return (0); + + switch (c = *pat++) + { + default: + return (*string == c); + case '\\': + return (*string == *pat); + case '?': + return (*pat == LPAREN ? 1 : (*string != '\0')); + case '*': + return (1); + case '+': + case '!': + case '@': + return (*pat == LPAREN ? 1 : (*string == c)); + case '[': + return (*string != '\0'); + } +} + +int +umatchlen (pat, max) + char *pat; + size_t max; +{ + char c; + int matlen, bracklen, t, in_cclass, in_collsym, in_equiv; + + if (*pat == 0) + return (0); + + matlen = in_cclass = in_collsym = in_equiv = 0; + while (c = *pat++) + { + switch (c) + { + default: + matlen++; + break; + case '\\': + if (*pat == 0) + return ++matlen; + else + { + matlen++; + pat++; + } + break; + case '?': + if (*pat == LPAREN) + return (matlen = -1); /* XXX for now */ + else + matlen++; + break; + case '*': + return (matlen = -1); + case '+': + case '!': + case '@': + if (*pat == LPAREN) + return (matlen = -1); /* XXX for now */ + else + matlen++; + break; + case '[': + /* scan for ending `]', skipping over embedded [:...:] */ + bracklen = 1; + c = *pat++; + do + { + if (c == 0) + { + pat--; /* back up to NUL */ + matlen += bracklen; + goto bad_bracket; + } + else if (c == '\\') + { + /* *pat == backslash-escaped character */ + bracklen++; + /* If the backslash or backslash-escape ends the string, + bail. The ++pat skips over the backslash escape */ + if (*pat == 0 || *++pat == 0) + { + matlen += bracklen; + goto bad_bracket; + } + } + else if (c == '[' && *pat == ':') /* character class */ + { + pat++; + bracklen++; + in_cclass = 1; + } + else if (in_cclass && c == ':' && *pat == ']') + { + pat++; + bracklen++; + in_cclass = 0; + } + else if (c == '[' && *pat == '.') /* collating symbol */ + { + pat++; + bracklen++; + if (*pat == ']') /* right bracket can appear as collating symbol */ + { + pat++; + bracklen++; + } + in_collsym = 1; + } + else if (in_collsym && c == '.' && *pat == ']') + { + pat++; + bracklen++; + in_collsym = 0; + } + else if (c == '[' && *pat == '=') /* equivalence class */ + { + pat++; + bracklen++; + if (*pat == ']') /* right bracket can appear as equivalence class */ + { + pat++; + bracklen++; + } + in_equiv = 1; + } + else if (in_equiv && c == '=' && *pat == ']') + { + pat++; + bracklen++; + in_equiv = 0; + } + else + bracklen++; + } + while ((c = *pat++) != ']'); + matlen++; /* bracket expression can only match one char */ +bad_bracket: + break; + } + } + + return matlen; +} + +/* Skip characters in PAT and return the final occurrence of DIRSEP. This + is only called when extended_glob is set, so we have to skip over extglob + patterns x(...) */ +char * +glob_dirscan (pat, dirsep) + char *pat; + int dirsep; +{ + char *p, *d, *pe, *se; + + d = pe = se = 0; + for (p = pat; p && *p; p++) + { + if (extglob_pattern_p (p)) + { + if (se == 0) + se = p + strlen (p) - 1; + pe = glob_patscan (p + 2, se, 0); + if (pe == 0) + continue; + else if (*pe == 0) + break; + p = pe - 1; /* will do increment above */ + continue; + } + if (*p == dirsep) + d = p; + } + return d; +} diff --git a/lib/glob/ndir.h b/lib/glob/ndir.h new file mode 100644 index 0000000..31261eb --- /dev/null +++ b/lib/glob/ndir.h @@ -0,0 +1,50 @@ +/* -- definitions for 4.2BSD-compatible directory access. + last edit: 09-Jul-1983 D A Gwyn. */ + +#if defined (VMS) +# if !defined (FAB$C_BID) +# include +# endif +# if !defined (NAM$C_BID) +# include +# endif +# if !defined (RMS$_SUC) +# include +# endif +# include "dir.h" +#endif /* VMS */ + +/* Size of directory block. */ +#define DIRBLKSIZ 512 + +/* NOTE: MAXNAMLEN must be one less than a multiple of 4 */ + +#if defined (VMS) +# define MAXNAMLEN (DIR$S_NAME + 7) /* 80 plus room for version #. */ +# define MAXFULLSPEC NAM$C_MAXRSS /* Maximum full spec */ +#else +# define MAXNAMLEN 15 /* Maximum filename length. */ +#endif /* VMS */ + +/* Data from readdir (). */ +struct direct { + long d_ino; /* Inode number of entry. */ + unsigned short d_reclen; /* Length of this record. */ + unsigned short d_namlen; /* Length of string in d_name. */ + char d_name[MAXNAMLEN + 1]; /* Name of file. */ +}; + +/* Stream data from opendir (). */ +typedef struct { + int dd_fd; /* File descriptor. */ + int dd_loc; /* Offset in block. */ + int dd_size; /* Amount of valid data. */ + char dd_buf[DIRBLKSIZ]; /* Directory block. */ +} DIR; + +extern DIR *opendir (); +extern struct direct *readdir (); +extern long telldir (); +extern void seekdir (), closedir (); + +#define rewinddir(dirp) seekdir (dirp, 0L) diff --git a/lib/glob/sm_loop.c b/lib/glob/sm_loop.c new file mode 100644 index 0000000..7e7f538 --- /dev/null +++ b/lib/glob/sm_loop.c @@ -0,0 +1,802 @@ +/* Copyright (C) 1991-2011 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +int FCT __P((CHAR *, CHAR *, int)); + +static int GMATCH __P((CHAR *, CHAR *, CHAR *, CHAR *, int)); +static CHAR *PARSE_COLLSYM __P((CHAR *, INT *)); +static CHAR *BRACKMATCH __P((CHAR *, U_CHAR, int)); +static int EXTMATCH __P((INT, CHAR *, CHAR *, CHAR *, CHAR *, int)); + +/*static*/ CHAR *PATSCAN __P((CHAR *, CHAR *, INT)); + +int +FCT (pattern, string, flags) + CHAR *pattern; + CHAR *string; + int flags; +{ + CHAR *se, *pe; + + if (string == 0 || pattern == 0) + return FNM_NOMATCH; + + se = string + STRLEN ((XCHAR *)string); + pe = pattern + STRLEN ((XCHAR *)pattern); + + return (GMATCH (string, se, pattern, pe, flags)); +} + +/* Match STRING against the filename pattern PATTERN, returning zero if + it matches, FNM_NOMATCH if not. */ +static int +GMATCH (string, se, pattern, pe, flags) + CHAR *string, *se; + CHAR *pattern, *pe; + int flags; +{ + CHAR *p, *n; /* pattern, string */ + INT c; /* current pattern character - XXX U_CHAR? */ + INT sc; /* current string character - XXX U_CHAR? */ + + p = pattern; + n = string; + + if (string == 0 || pattern == 0) + return FNM_NOMATCH; + +#if DEBUG_MATCHING +fprintf(stderr, "gmatch: string = %s; se = %s\n", string, se); +fprintf(stderr, "gmatch: pattern = %s; pe = %s\n", pattern, pe); +#endif + + while (p < pe) + { + c = *p++; + c = FOLD (c); + + sc = n < se ? *n : '\0'; + +#ifdef EXTENDED_GLOB + /* EXTMATCH () will handle recursively calling GMATCH, so we can + just return what EXTMATCH() returns. */ + if ((flags & FNM_EXTMATCH) && *p == L('(') && + (c == L('+') || c == L('*') || c == L('?') || c == L('@') || c == L('!'))) /* ) */ + { + int lflags; + /* If we're not matching the start of the string, we're not + concerned about the special cases for matching `.' */ + lflags = (n == string) ? flags : (flags & ~FNM_PERIOD); + return (EXTMATCH (c, n, se, p, pe, lflags)); + } +#endif /* EXTENDED_GLOB */ + + switch (c) + { + case L('?'): /* Match single character */ + if (sc == '\0') + return FNM_NOMATCH; + else if ((flags & FNM_PATHNAME) && sc == L('/')) + /* If we are matching a pathname, `?' can never match a `/'. */ + return FNM_NOMATCH; + else if ((flags & FNM_PERIOD) && sc == L('.') && + (n == string || ((flags & FNM_PATHNAME) && n[-1] == L('/')))) + /* `?' cannot match a `.' if it is the first character of the + string or if it is the first character following a slash and + we are matching a pathname. */ + return FNM_NOMATCH; + break; + + case L('\\'): /* backslash escape removes special meaning */ + if (p == pe) + return FNM_NOMATCH; + + if ((flags & FNM_NOESCAPE) == 0) + { + c = *p++; + /* A trailing `\' cannot match. */ + if (p > pe) + return FNM_NOMATCH; + c = FOLD (c); + } + if (FOLD (sc) != (U_CHAR)c) + return FNM_NOMATCH; + break; + + case '*': /* Match zero or more characters */ + if (p == pe) + return 0; + + if ((flags & FNM_PERIOD) && sc == L('.') && + (n == string || ((flags & FNM_PATHNAME) && n[-1] == L('/')))) + /* `*' cannot match a `.' if it is the first character of the + string or if it is the first character following a slash and + we are matching a pathname. */ + return FNM_NOMATCH; + + /* Collapse multiple consecutive `*' and `?', but make sure that + one character of the string is consumed for each `?'. */ + for (c = *p++; (c == L('?') || c == L('*')); c = *p++) + { + if ((flags & FNM_PATHNAME) && sc == L('/')) + /* A slash does not match a wildcard under FNM_PATHNAME. */ + return FNM_NOMATCH; +#ifdef EXTENDED_GLOB + else if ((flags & FNM_EXTMATCH) && c == L('?') && *p == L('(')) /* ) */ + { + CHAR *newn; + for (newn = n; newn < se; ++newn) + { + if (EXTMATCH (c, newn, se, p, pe, flags) == 0) + return (0); + } + /* We didn't match. If we have a `?(...)', we can match 0 + or 1 times. */ + return 0; + } +#endif + else if (c == L('?')) + { + if (sc == L('\0')) + return FNM_NOMATCH; + /* One character of the string is consumed in matching + this ? wildcard, so *??? won't match if there are + fewer than three characters. */ + n++; + sc = n < se ? *n : '\0'; + } + +#ifdef EXTENDED_GLOB + /* Handle ******(patlist) */ + if ((flags & FNM_EXTMATCH) && c == L('*') && *p == L('(')) /*)*/ + { + CHAR *newn; + /* We need to check whether or not the extended glob + pattern matches the remainder of the string. + If it does, we match the entire pattern. */ + for (newn = n; newn < se; ++newn) + { + if (EXTMATCH (c, newn, se, p, pe, flags) == 0) + return (0); + } + /* We didn't match the extended glob pattern, but + that's OK, since we can match 0 or more occurrences. + We need to skip the glob pattern and see if we + match the rest of the string. */ + newn = PATSCAN (p + 1, pe, 0); + /* If NEWN is 0, we have an ill-formed pattern. */ + p = newn ? newn : pe; + } +#endif + if (p == pe) + break; + } + + /* If we've hit the end of the pattern and the last character of + the pattern was handled by the loop above, we've succeeded. + Otherwise, we need to match that last character. */ + if (p == pe && (c == L('?') || c == L('*'))) + return (0); + + /* If we've hit the end of the string and the rest of the pattern + is something that matches the empty string, we can succeed. */ +#if defined (EXTENDED_GLOB) + if (n == se && ((flags & FNM_EXTMATCH) && (c == L('!') || c == L('?')) && *p == L('('))) + { + --p; + if (EXTMATCH (c, n, se, p, pe, flags) == 0) + return (c == L('!') ? FNM_NOMATCH : 0); + return (c == L('!') ? 0 : FNM_NOMATCH); + } +#endif + + /* General case, use recursion. */ + { + U_CHAR c1; + + c1 = ((flags & FNM_NOESCAPE) == 0 && c == L('\\')) ? *p : c; + c1 = FOLD (c1); + for (--p; n < se; ++n) + { + /* Only call strmatch if the first character indicates a + possible match. We can check the first character if + we're not doing an extended glob match. */ + if ((flags & FNM_EXTMATCH) == 0 && c != L('[') && FOLD (*n) != c1) /*]*/ + continue; + + /* If we're doing an extended glob match and the pattern is not + one of the extended glob patterns, we can check the first + character. */ + if ((flags & FNM_EXTMATCH) && p[1] != L('(') && /*)*/ + STRCHR (L("?*+@!"), *p) == 0 && c != L('[') && FOLD (*n) != c1) /*]*/ + continue; + + /* Otherwise, we just recurse. */ + if (GMATCH (n, se, p, pe, flags & ~FNM_PERIOD) == 0) + return (0); + } + return FNM_NOMATCH; + } + + case L('['): + { + if (sc == L('\0') || n == se) + return FNM_NOMATCH; + + /* A character class cannot match a `.' if it is the first + character of the string or if it is the first character + following a slash and we are matching a pathname. */ + if ((flags & FNM_PERIOD) && sc == L('.') && + (n == string || ((flags & FNM_PATHNAME) && n[-1] == L('/')))) + return (FNM_NOMATCH); + + p = BRACKMATCH (p, sc, flags); + if (p == 0) + return FNM_NOMATCH; + } + break; + + default: + if ((U_CHAR)c != FOLD (sc)) + return (FNM_NOMATCH); + } + + ++n; + } + + if (n == se) + return (0); + + if ((flags & FNM_LEADING_DIR) && *n == L('/')) + /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */ + return 0; + + return (FNM_NOMATCH); +} + +/* Parse a bracket expression collating symbol ([.sym.]) starting at P, find + the value of the symbol, and move P past the collating symbol expression. + The value is returned in *VP, if VP is not null. */ +static CHAR * +PARSE_COLLSYM (p, vp) + CHAR *p; + INT *vp; +{ + register int pc; + INT val; + + p++; /* move past the `.' */ + + for (pc = 0; p[pc]; pc++) + if (p[pc] == L('.') && p[pc+1] == L(']')) + break; + val = COLLSYM (p, pc); + if (vp) + *vp = val; + return (p + pc + 2); +} + +/* Use prototype definition here because of type promotion. */ +static CHAR * +#if defined (PROTOTYPES) +BRACKMATCH (CHAR *p, U_CHAR test, int flags) +#else +BRACKMATCH (p, test, flags) + CHAR *p; + U_CHAR test; + int flags; +#endif +{ + register CHAR cstart, cend, c; + register int not; /* Nonzero if the sense of the character class is inverted. */ + int brcnt, forcecoll; + INT pc; + CHAR *savep; + + test = FOLD (test); + + savep = p; + + /* POSIX.2 3.13.1 says that an exclamation mark (`!') shall replace the + circumflex (`^') in its role in a `nonmatching list'. A bracket + expression starting with an unquoted circumflex character produces + unspecified results. This implementation treats the two identically. */ + if (not = (*p == L('!') || *p == L('^'))) + ++p; + + c = *p++; + for (;;) + { + /* Initialize cstart and cend in case `-' is the last + character of the pattern. */ + cstart = cend = c; + forcecoll = 0; + + /* POSIX.2 equivalence class: [=c=]. See POSIX.2 2.8.3.2. Find + the end of the equivalence class, move the pattern pointer past + it, and check for equivalence. XXX - this handles only + single-character equivalence classes, which is wrong, or at + least incomplete. */ + if (c == L('[') && *p == L('=') && p[2] == L('=') && p[3] == L(']')) + { + pc = FOLD (p[1]); + p += 4; + if (COLLEQUIV (test, pc)) + { +/*[*/ /* Move past the closing `]', since the first thing we do at + the `matched:' label is back p up one. */ + p++; + goto matched; + } + else + { + c = *p++; + if (c == L('\0')) + return ((test == L('[')) ? savep : (CHAR *)0); /*]*/ + c = FOLD (c); + continue; + } + } + + /* POSIX.2 character class expression. See POSIX.2 2.8.3.2. */ + if (c == L('[') && *p == L(':')) + { + CHAR *close, *ccname; + + pc = 0; /* make sure invalid char classes don't match. */ + /* Find end of character class name */ + for (close = p + 1; *close != '\0'; close++) + if (*close == L(':') && *(close+1) == L(']')) + break; + + if (*close != L('\0')) + { + ccname = (CHAR *)malloc ((close - p) * sizeof (CHAR)); + if (ccname == 0) + pc = 0; + else + { + bcopy (p + 1, ccname, (close - p - 1) * sizeof (CHAR)); + *(ccname + (close - p - 1)) = L('\0'); + pc = IS_CCLASS (test, (XCHAR *)ccname); + } + if (pc == -1) + pc = 0; + else + p = close + 2; + + free (ccname); + } + + if (pc) + { +/*[*/ /* Move past the closing `]', since the first thing we do at + the `matched:' label is back p up one. */ + p++; + goto matched; + } + else + { + /* continue the loop here, since this expression can't be + the first part of a range expression. */ + c = *p++; + if (c == L('\0')) + return ((test == L('[')) ? savep : (CHAR *)0); + else if (c == L(']')) + break; + c = FOLD (c); + continue; + } + } + + /* POSIX.2 collating symbols. See POSIX.2 2.8.3.2. Find the end of + the symbol name, make sure it is terminated by `.]', translate + the name to a character using the external table, and do the + comparison. */ + if (c == L('[') && *p == L('.')) + { + p = PARSE_COLLSYM (p, &pc); + /* An invalid collating symbol cannot be the first point of a + range. If it is, we set cstart to one greater than `test', + so any comparisons later will fail. */ + cstart = (pc == INVALID) ? test + 1 : pc; + forcecoll = 1; + } + + if (!(flags & FNM_NOESCAPE) && c == L('\\')) + { + if (*p == '\0') + return (CHAR *)0; + cstart = cend = *p++; + } + + cstart = cend = FOLD (cstart); + + /* POSIX.2 2.8.3.1.2 says: `An expression containing a `[' that + is not preceded by a backslash and is not part of a bracket + expression produces undefined results.' This implementation + treats the `[' as just a character to be matched if there is + not a closing `]'. */ + if (c == L('\0')) + return ((test == L('[')) ? savep : (CHAR *)0); + + c = *p++; + c = FOLD (c); + + if ((flags & FNM_PATHNAME) && c == L('/')) + /* [/] can never match when matching a pathname. */ + return (CHAR *)0; + + /* This introduces a range, unless the `-' is the last + character of the class. Find the end of the range + and move past it. */ + if (c == L('-') && *p != L(']')) + { + cend = *p++; + if (!(flags & FNM_NOESCAPE) && cend == L('\\')) + cend = *p++; + if (cend == L('\0')) + return (CHAR *)0; + if (cend == L('[') && *p == L('.')) + { + p = PARSE_COLLSYM (p, &pc); + /* An invalid collating symbol cannot be the second part of a + range expression. If we get one, we set cend to one fewer + than the test character to make sure the range test fails. */ + cend = (pc == INVALID) ? test - 1 : pc; + forcecoll = 1; + } + cend = FOLD (cend); + + c = *p++; + + /* POSIX.2 2.8.3.2: ``The ending range point shall collate + equal to or higher than the starting range point; otherwise + the expression shall be treated as invalid.'' Note that this + applies to only the range expression; the rest of the bracket + expression is still checked for matches. */ + if (RANGECMP (cstart, cend, forcecoll) > 0) + { + if (c == L(']')) + break; + c = FOLD (c); + continue; + } + } + + if (RANGECMP (test, cstart, forcecoll) >= 0 && RANGECMP (test, cend, forcecoll) <= 0) + goto matched; + + if (c == L(']')) + break; + } + /* No match. */ + return (!not ? (CHAR *)0 : p); + +matched: + /* Skip the rest of the [...] that already matched. */ + c = *--p; + brcnt = 1; + while (brcnt > 0) + { + /* A `[' without a matching `]' is just another character to match. */ + if (c == L('\0')) + return ((test == L('[')) ? savep : (CHAR *)0); + + c = *p++; + if (c == L('[') && (*p == L('=') || *p == L(':') || *p == L('.'))) + brcnt++; + else if (c == L(']')) + brcnt--; + else if (!(flags & FNM_NOESCAPE) && c == L('\\')) + { + if (*p == '\0') + return (CHAR *)0; + /* XXX 1003.2d11 is unclear if this is right. */ + ++p; + } + } + return (not ? (CHAR *)0 : p); +} + +#if defined (EXTENDED_GLOB) +/* ksh-like extended pattern matching: + + [?*+@!](pat-list) + + where pat-list is a list of one or patterns separated by `|'. Operation + is as follows: + + ?(patlist) match zero or one of the given patterns + *(patlist) match zero or more of the given patterns + +(patlist) match one or more of the given patterns + @(patlist) match exactly one of the given patterns + !(patlist) match anything except one of the given patterns +*/ + +/* Scan a pattern starting at STRING and ending at END, keeping track of + embedded () and []. If DELIM is 0, we scan until a matching `)' + because we're scanning a `patlist'. Otherwise, we scan until we see + DELIM. In all cases, we never scan past END. The return value is the + first character after the matching DELIM. */ +/*static*/ CHAR * +PATSCAN (string, end, delim) + CHAR *string, *end; + INT delim; +{ + int pnest, bnest, skip; + INT cchar; + CHAR *s, c, *bfirst; + + pnest = bnest = skip = 0; + cchar = 0; + bfirst = NULL; + + if (string == end) + return (NULL); + + for (s = string; c = *s; s++) + { + if (s >= end) + return (s); + if (skip) + { + skip = 0; + continue; + } + switch (c) + { + case L('\\'): + skip = 1; + break; + + case L('\0'): + return ((CHAR *)NULL); + + /* `[' is not special inside a bracket expression, but it may + introduce one of the special POSIX bracket expressions + ([.SYM.], [=c=], [: ... :]) that needs special handling. */ + case L('['): + if (bnest == 0) + { + bfirst = s + 1; + if (*bfirst == L('!') || *bfirst == L('^')) + bfirst++; + bnest++; + } + else if (s[1] == L(':') || s[1] == L('.') || s[1] == L('=')) + cchar = s[1]; + break; + + /* `]' is not special if it's the first char (after a leading `!' + or `^') in a bracket expression or if it's part of one of the + special POSIX bracket expressions ([.SYM.], [=c=], [: ... :]) */ + case L(']'): + if (bnest) + { + if (cchar && s[-1] == cchar) + cchar = 0; + else if (s != bfirst) + { + bnest--; + bfirst = 0; + } + } + break; + + case L('('): + if (bnest == 0) + pnest++; + break; + + case L(')'): + if (bnest == 0 && pnest-- <= 0) + return ++s; + break; + + case L('|'): + if (bnest == 0 && pnest == 0 && delim == L('|')) + return ++s; + break; + } + } + + return (NULL); +} + +/* Return 0 if dequoted pattern matches S in the current locale. */ +static int +STRCOMPARE (p, pe, s, se) + CHAR *p, *pe, *s, *se; +{ + int ret; + CHAR c1, c2; + int l1, l2; + + l1 = pe - p; + l2 = se - s; + + if (l1 != l2) + return (FNM_NOMATCH); /* unequal lengths, can't be identical */ + + c1 = *pe; + c2 = *se; + + if (c1 != 0) + *pe = '\0'; + if (c2 != 0) + *se = '\0'; + +#if HAVE_MULTIBYTE || defined (HAVE_STRCOLL) + ret = STRCOLL ((XCHAR *)p, (XCHAR *)s); +#else + ret = STRCMP ((XCHAR *)p, (XCHAR *)s); +#endif + + if (c1 != 0) + *pe = c1; + if (c2 != 0) + *se = c2; + + return (ret == 0 ? ret : FNM_NOMATCH); +} + +/* Match a ksh extended pattern specifier. Return FNM_NOMATCH on failure or + 0 on success. This is handed the entire rest of the pattern and string + the first time an extended pattern specifier is encountered, so it calls + gmatch recursively. */ +static int +EXTMATCH (xc, s, se, p, pe, flags) + INT xc; /* select which operation */ + CHAR *s, *se; + CHAR *p, *pe; + int flags; +{ + CHAR *prest; /* pointer to rest of pattern */ + CHAR *psub; /* pointer to sub-pattern */ + CHAR *pnext; /* pointer to next sub-pattern */ + CHAR *srest; /* pointer to rest of string */ + int m1, m2, xflags; /* xflags = flags passed to recursive matches */ + +#if DEBUG_MATCHING +fprintf(stderr, "extmatch: xc = %c\n", xc); +fprintf(stderr, "extmatch: s = %s; se = %s\n", s, se); +fprintf(stderr, "extmatch: p = %s; pe = %s\n", p, pe); +fprintf(stderr, "extmatch: flags = %d\n", flags); +#endif + + prest = PATSCAN (p + (*p == L('(')), pe, 0); /* ) */ + if (prest == 0) + /* If PREST is 0, we failed to scan a valid pattern. In this + case, we just want to compare the two as strings. */ + return (STRCOMPARE (p - 1, pe, s, se)); + + switch (xc) + { + case L('+'): /* match one or more occurrences */ + case L('*'): /* match zero or more occurrences */ + /* If we can get away with no matches, don't even bother. Just + call GMATCH on the rest of the pattern and return success if + it succeeds. */ + if (xc == L('*') && (GMATCH (s, se, prest, pe, flags) == 0)) + return 0; + + /* OK, we have to do this the hard way. First, we make sure one of + the subpatterns matches, then we try to match the rest of the + string. */ + for (psub = p + 1; ; psub = pnext) + { + pnext = PATSCAN (psub, pe, L('|')); + for (srest = s; srest <= se; srest++) + { + /* Match this substring (S -> SREST) against this + subpattern (psub -> pnext - 1) */ + m1 = GMATCH (s, srest, psub, pnext - 1, flags) == 0; + /* OK, we matched a subpattern, so make sure the rest of the + string matches the rest of the pattern. Also handle + multiple matches of the pattern. */ + if (m1) + { + /* if srest > s, we are not at start of string */ + xflags = (srest > s) ? (flags & ~FNM_PERIOD) : flags; + m2 = (GMATCH (srest, se, prest, pe, xflags) == 0) || + (s != srest && GMATCH (srest, se, p - 1, pe, xflags) == 0); + } + if (m1 && m2) + return (0); + } + if (pnext == prest) + break; + } + return (FNM_NOMATCH); + + case L('?'): /* match zero or one of the patterns */ + case L('@'): /* match one (or more) of the patterns */ + /* If we can get away with no matches, don't even bother. Just + call gmatch on the rest of the pattern and return success if + it succeeds. */ + if (xc == L('?') && (GMATCH (s, se, prest, pe, flags) == 0)) + return 0; + + /* OK, we have to do this the hard way. First, we see if one of + the subpatterns matches, then, if it does, we try to match the + rest of the string. */ + for (psub = p + 1; ; psub = pnext) + { + pnext = PATSCAN (psub, pe, L('|')); + srest = (prest == pe) ? se : s; + for ( ; srest <= se; srest++) + { + /* if srest > s, we are not at start of string */ + xflags = (srest > s) ? (flags & ~FNM_PERIOD) : flags; + if (GMATCH (s, srest, psub, pnext - 1, flags) == 0 && + GMATCH (srest, se, prest, pe, xflags) == 0) + return (0); + } + if (pnext == prest) + break; + } + return (FNM_NOMATCH); + + case '!': /* match anything *except* one of the patterns */ + for (srest = s; srest <= se; srest++) + { + m1 = 0; + for (psub = p + 1; ; psub = pnext) + { + pnext = PATSCAN (psub, pe, L('|')); + /* If one of the patterns matches, just bail immediately. */ + if (m1 = (GMATCH (s, srest, psub, pnext - 1, flags) == 0)) + break; + if (pnext == prest) + break; + } + /* if srest > s, we are not at start of string */ + xflags = (srest > s) ? (flags & ~FNM_PERIOD) : flags; + if (m1 == 0 && GMATCH (srest, se, prest, pe, xflags) == 0) + return (0); + } + return (FNM_NOMATCH); + } + + return (FNM_NOMATCH); +} +#endif /* EXTENDED_GLOB */ + +#undef IS_CCLASS +#undef FOLD +#undef CHAR +#undef U_CHAR +#undef XCHAR +#undef INT +#undef INVALID +#undef FCT +#undef GMATCH +#undef COLLSYM +#undef PARSE_COLLSYM +#undef PATSCAN +#undef STRCOMPARE +#undef EXTMATCH +#undef BRACKMATCH +#undef STRCHR +#undef STRCOLL +#undef STRLEN +#undef STRCMP +#undef COLLEQUIV +#undef RANGECMP +#undef L diff --git a/lib/glob/smatch.c b/lib/glob/smatch.c new file mode 100644 index 0000000..848610a --- /dev/null +++ b/lib/glob/smatch.c @@ -0,0 +1,415 @@ +/* strmatch.c -- ksh-like extended pattern matching for the shell and filename + globbing. */ + +/* Copyright (C) 1991-2011 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include /* for debugging */ + +#include "strmatch.h" +#include + +#include "bashansi.h" +#include "shmbutil.h" +#include "xmalloc.h" + +/* First, compile `sm_loop.c' for single-byte characters. */ +#define CHAR unsigned char +#define U_CHAR unsigned char +#define XCHAR char +#define INT int +#define L(CS) CS +#define INVALID -1 + +#undef STREQ +#undef STREQN +#define STREQ(a, b) ((a)[0] == (b)[0] && strcmp(a, b) == 0) +#define STREQN(a, b, n) ((a)[0] == (b)[0] && strncmp(a, b, n) == 0) + +#ifndef GLOBASCII_DEFAULT +# define GLOBASCII_DEFAULT 0 +#endif + +int glob_asciirange = GLOBASCII_DEFAULT; + +/* We use strcoll(3) for range comparisons in bracket expressions, + even though it can have unwanted side effects in locales + other than POSIX or US. For instance, in the de locale, [A-Z] matches + all characters. If GLOB_ASCIIRANGE is non-zero, and we're not forcing + the use of strcoll (e.g., for explicit collating symbols), we use + straight ordering as if in the C locale. */ + +#if defined (HAVE_STRCOLL) +/* Helper function for collating symbol equivalence. */ +static int +rangecmp (c1, c2, forcecoll) + int c1, c2; + int forcecoll; +{ + static char s1[2] = { ' ', '\0' }; + static char s2[2] = { ' ', '\0' }; + int ret; + + /* Eight bits only. Period. */ + c1 &= 0xFF; + c2 &= 0xFF; + + if (c1 == c2) + return (0); + + if (forcecoll == 0 && glob_asciirange) + return (c1 - c2); + + s1[0] = c1; + s2[0] = c2; + + if ((ret = strcoll (s1, s2)) != 0) + return ret; + return (c1 - c2); +} +#else /* !HAVE_STRCOLL */ +# define rangecmp(c1, c2, f) ((int)(c1) - (int)(c2)) +#endif /* !HAVE_STRCOLL */ + +#if defined (HAVE_STRCOLL) +static int +collequiv (c1, c2) + int c1, c2; +{ + return (rangecmp (c1, c2, 1) == 0); +} +#else +# define collequiv(c1, c2) ((c1) == (c2)) +#endif + +#define _COLLSYM _collsym +#define __COLLSYM __collsym +#define POSIXCOLL posix_collsyms +#include "collsyms.h" + +static int +collsym (s, len) + CHAR *s; + int len; +{ + register struct _collsym *csp; + char *x; + + x = (char *)s; + for (csp = posix_collsyms; csp->name; csp++) + { + if (STREQN(csp->name, x, len) && csp->name[len] == '\0') + return (csp->code); + } + if (len == 1) + return s[0]; + return INVALID; +} + +/* unibyte character classification */ +#if !defined (isascii) && !defined (HAVE_ISASCII) +# define isascii(c) ((unsigned int)(c) <= 0177) +#endif + +enum char_class + { + CC_NO_CLASS = 0, + CC_ASCII, CC_ALNUM, CC_ALPHA, CC_BLANK, CC_CNTRL, CC_DIGIT, CC_GRAPH, + CC_LOWER, CC_PRINT, CC_PUNCT, CC_SPACE, CC_UPPER, CC_WORD, CC_XDIGIT + }; + +static char const *const cclass_name[] = + { + "", + "ascii", "alnum", "alpha", "blank", "cntrl", "digit", "graph", + "lower", "print", "punct", "space", "upper", "word", "xdigit" + }; + +#define N_CHAR_CLASS (sizeof(cclass_name) / sizeof (cclass_name[0])) + +static int +is_cclass (c, name) + int c; + const char *name; +{ + enum char_class char_class = CC_NO_CLASS; + int i, result; + + for (i = 1; i < N_CHAR_CLASS; i++) + { + if (STREQ (name, cclass_name[i])) + { + char_class = (enum char_class)i; + break; + } + } + + if (char_class == 0) + return -1; + + switch (char_class) + { + case CC_ASCII: + result = isascii (c); + break; + case CC_ALNUM: + result = ISALNUM (c); + break; + case CC_ALPHA: + result = ISALPHA (c); + break; + case CC_BLANK: + result = ISBLANK (c); + break; + case CC_CNTRL: + result = ISCNTRL (c); + break; + case CC_DIGIT: + result = ISDIGIT (c); + break; + case CC_GRAPH: + result = ISGRAPH (c); + break; + case CC_LOWER: + result = ISLOWER (c); + break; + case CC_PRINT: + result = ISPRINT (c); + break; + case CC_PUNCT: + result = ISPUNCT (c); + break; + case CC_SPACE: + result = ISSPACE (c); + break; + case CC_UPPER: + result = ISUPPER (c); + break; + case CC_WORD: + result = (ISALNUM (c) || c == '_'); + break; + case CC_XDIGIT: + result = ISXDIGIT (c); + break; + default: + result = -1; + break; + } + + return result; +} + +/* Now include `sm_loop.c' for single-byte characters. */ +/* The result of FOLD is an `unsigned char' */ +# define FOLD(c) ((flags & FNM_CASEFOLD) \ + ? TOLOWER ((unsigned char)c) \ + : ((unsigned char)c)) + +#define FCT internal_strmatch +#define GMATCH gmatch +#define COLLSYM collsym +#define PARSE_COLLSYM parse_collsym +#define BRACKMATCH brackmatch +#define PATSCAN glob_patscan +#define STRCOMPARE strcompare +#define EXTMATCH extmatch +#define STRCHR(S, C) strchr((S), (C)) +#define STRCOLL(S1, S2) strcoll((S1), (S2)) +#define STRLEN(S) strlen(S) +#define STRCMP(S1, S2) strcmp((S1), (S2)) +#define RANGECMP(C1, C2, F) rangecmp((C1), (C2), (F)) +#define COLLEQUIV(C1, C2) collequiv((C1), (C2)) +#define CTYPE_T enum char_class +#define IS_CCLASS(C, S) is_cclass((C), (S)) +#include "sm_loop.c" + +#if HANDLE_MULTIBYTE + +# define CHAR wchar_t +# define U_CHAR wint_t +# define XCHAR wchar_t +# define INT wint_t +# define L(CS) L##CS +# define INVALID WEOF + +# undef STREQ +# undef STREQN +# define STREQ(s1, s2) ((wcscmp (s1, s2) == 0)) +# define STREQN(a, b, n) ((a)[0] == (b)[0] && wcsncmp(a, b, n) == 0) + +extern char *mbsmbchar __P((const char *)); + +static int +rangecmp_wc (c1, c2, forcecoll) + wint_t c1, c2; + int forcecoll; +{ + static wchar_t s1[2] = { L' ', L'\0' }; + static wchar_t s2[2] = { L' ', L'\0' }; + + if (c1 == c2) + return 0; + + if (forcecoll == 0 && glob_asciirange && c1 <= UCHAR_MAX && c2 <= UCHAR_MAX) + return ((int)(c1 - c2)); + + s1[0] = c1; + s2[0] = c2; + + return (wcscoll (s1, s2)); +} + +static int +collequiv_wc (c, equiv) + wint_t c, equiv; +{ + return (c == equiv); +} + +/* Helper function for collating symbol. */ +# define _COLLSYM _collwcsym +# define __COLLSYM __collwcsym +# define POSIXCOLL posix_collwcsyms +# include "collsyms.h" + +static wint_t +collwcsym (s, len) + wchar_t *s; + int len; +{ + register struct _collwcsym *csp; + + for (csp = posix_collwcsyms; csp->name; csp++) + { + if (STREQN(csp->name, s, len) && csp->name[len] == L'\0') + return (csp->code); + } + if (len == 1) + return s[0]; + return INVALID; +} + +static int +is_wcclass (wc, name) + wint_t wc; + wchar_t *name; +{ + char *mbs; + mbstate_t state; + size_t mbslength; + wctype_t desc; + int want_word; + + if ((wctype ("ascii") == (wctype_t)0) && (wcscmp (name, L"ascii") == 0)) + { + int c; + + if ((c = wctob (wc)) == EOF) + return 0; + else + return (c <= 0x7F); + } + + want_word = (wcscmp (name, L"word") == 0); + if (want_word) + name = L"alnum"; + + memset (&state, '\0', sizeof (mbstate_t)); + mbs = (char *) malloc (wcslen(name) * MB_CUR_MAX + 1); + mbslength = wcsrtombs (mbs, (const wchar_t **)&name, (wcslen(name) * MB_CUR_MAX + 1), &state); + + if (mbslength == (size_t)-1 || mbslength == (size_t)-2) + { + free (mbs); + return -1; + } + desc = wctype (mbs); + free (mbs); + + if (desc == (wctype_t)0) + return -1; + + if (want_word) + return (iswctype (wc, desc) || wc == L'_'); + else + return (iswctype (wc, desc)); +} + +/* Now include `sm_loop.c' for multibyte characters. */ +#define FOLD(c) ((flags & FNM_CASEFOLD) && iswupper (c) ? towlower (c) : (c)) +#define FCT internal_wstrmatch +#define GMATCH gmatch_wc +#define COLLSYM collwcsym +#define PARSE_COLLSYM parse_collwcsym +#define BRACKMATCH brackmatch_wc +#define PATSCAN glob_patscan_wc +#define STRCOMPARE wscompare +#define EXTMATCH extmatch_wc +#define STRCHR(S, C) wcschr((S), (C)) +#define STRCOLL(S1, S2) wcscoll((S1), (S2)) +#define STRLEN(S) wcslen(S) +#define STRCMP(S1, S2) wcscmp((S1), (S2)) +#define RANGECMP(C1, C2, F) rangecmp_wc((C1), (C2), (F)) +#define COLLEQUIV(C1, C2) collequiv_wc((C1), (C2)) +#define CTYPE_T enum char_class +#define IS_CCLASS(C, S) is_wcclass((C), (S)) +#include "sm_loop.c" + +#endif /* HAVE_MULTIBYTE */ + +int +xstrmatch (pattern, string, flags) + char *pattern; + char *string; + int flags; +{ +#if HANDLE_MULTIBYTE + int ret; + size_t n; + wchar_t *wpattern, *wstring; + size_t plen, slen, mplen, mslen; + + if (mbsmbchar (string) == 0 && mbsmbchar (pattern) == 0) + return (internal_strmatch ((unsigned char *)pattern, (unsigned char *)string, flags)); + + if (MB_CUR_MAX == 1) + return (internal_strmatch ((unsigned char *)pattern, (unsigned char *)string, flags)); + + n = xdupmbstowcs (&wpattern, NULL, pattern); + if (n == (size_t)-1 || n == (size_t)-2) + return (internal_strmatch ((unsigned char *)pattern, (unsigned char *)string, flags)); + + n = xdupmbstowcs (&wstring, NULL, string); + if (n == (size_t)-1 || n == (size_t)-2) + { + free (wpattern); + return (internal_strmatch ((unsigned char *)pattern, (unsigned char *)string, flags)); + } + + ret = internal_wstrmatch (wpattern, wstring, flags); + + free (wpattern); + free (wstring); + + return ret; +#else + return (internal_strmatch ((unsigned char *)pattern, (unsigned char *)string, flags)); +#endif /* !HANDLE_MULTIBYTE */ +} diff --git a/lib/glob/strmatch.c b/lib/glob/strmatch.c new file mode 100644 index 0000000..cea9bd8 --- /dev/null +++ b/lib/glob/strmatch.c @@ -0,0 +1,79 @@ +/* strmatch.c -- ksh-like extended pattern matching for the shell and filename + globbing. */ + +/* Copyright (C) 1991-2002 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include "stdc.h" +#include "strmatch.h" + +extern int xstrmatch __P((char *, char *, int)); +#if defined (HANDLE_MULTIBYTE) +extern int internal_wstrmatch __P((wchar_t *, wchar_t *, int)); +#endif + +int +strmatch (pattern, string, flags) + char *pattern; + char *string; + int flags; +{ + if (string == 0 || pattern == 0) + return FNM_NOMATCH; + + return (xstrmatch (pattern, string, flags)); +} + +#if defined (HANDLE_MULTIBYTE) +int +wcsmatch (wpattern, wstring, flags) + wchar_t *wpattern; + wchar_t *wstring; + int flags; +{ + if (wstring == 0 || wpattern == 0) + return (FNM_NOMATCH); + + return (internal_wstrmatch (wpattern, wstring, flags)); +} +#endif + +#ifdef TEST +main (c, v) + int c; + char **v; +{ + char *string, *pat; + + string = v[1]; + pat = v[2]; + + if (strmatch (pat, string, 0) == 0) + { + printf ("%s matches %s\n", string, pat); + exit (0); + } + else + { + printf ("%s does not match %s\n", string, pat); + exit (1); + } +} +#endif diff --git a/lib/glob/strmatch.h b/lib/glob/strmatch.h new file mode 100644 index 0000000..5c99e0c --- /dev/null +++ b/lib/glob/strmatch.h @@ -0,0 +1,62 @@ +/* Copyright (C) 1991-2004 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne-Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _STRMATCH_H +#define _STRMATCH_H 1 + +#include + +#include "stdc.h" + +/* We #undef these before defining them because some losing systems + (HP-UX A.08.07 for example) define these in . */ +#undef FNM_PATHNAME +#undef FNM_NOESCAPE +#undef FNM_PERIOD + +/* Bits set in the FLAGS argument to `strmatch'. */ + +/* standard flags are like fnmatch(3). */ +#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ +#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ +#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ + +/* extended flags not available in most libc fnmatch versions, but we undef + them to avoid any possible warnings. */ +#undef FNM_LEADING_DIR +#undef FNM_CASEFOLD +#undef FNM_EXTMATCH + +#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ +#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ +#define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching. */ + +/* Value returned by `strmatch' if STRING does not match PATTERN. */ +#undef FNM_NOMATCH + +#define FNM_NOMATCH 1 + +/* Match STRING against the filename pattern PATTERN, + returning zero if it matches, FNM_NOMATCH if not. */ +extern int strmatch __P((char *, char *, int)); + +#if HANDLE_MULTIBYTE +extern int wcsmatch __P((wchar_t *, wchar_t *, int)); +#endif + +#endif /* _STRMATCH_H */ diff --git a/lib/glob/xmbsrtowcs.c b/lib/glob/xmbsrtowcs.c new file mode 100644 index 0000000..11a4d1b --- /dev/null +++ b/lib/glob/xmbsrtowcs.c @@ -0,0 +1,409 @@ +/* xmbsrtowcs.c -- replacement function for mbsrtowcs */ + +/* Copyright (C) 2002-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Ask for GNU extensions to get extern declaration for mbsnrtowcs if + available via glibc. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#include + +#include + +/* , and are included in "shmbutil.h". + If , , mbsrtowcs(), exist, HANDLE_MULTIBYTE + is defined as 1. */ +#include + +#if HANDLE_MULTIBYTE + +#define WSBUF_INC 32 + +#ifndef FREE +# define FREE(x) do { if (x) free (x); } while (0) +#endif + +#if ! HAVE_STRCHRNUL +extern char *strchrnul __P((const char *, int)); +#endif + +/* On some locales (ex. ja_JP.sjis), mbsrtowc doesn't convert 0x5c to U<0x5c>. + So, this function is made for converting 0x5c to U<0x5c>. */ + +static mbstate_t local_state; +static int local_state_use = 0; + +size_t +xmbsrtowcs (dest, src, len, pstate) + wchar_t *dest; + const char **src; + size_t len; + mbstate_t *pstate; +{ + mbstate_t *ps; + size_t mblength, wclength, n; + + ps = pstate; + if (pstate == NULL) + { + if (!local_state_use) + { + memset (&local_state, '\0', sizeof(mbstate_t)); + local_state_use = 1; + } + ps = &local_state; + } + + n = strlen (*src); + + if (dest == NULL) + { + wchar_t *wsbuf; + const char *mbs; + mbstate_t psbuf; + + /* It doesn't matter if malloc fails here, since mbsrtowcs should do + the right thing with a NULL first argument. */ + wsbuf = (wchar_t *) malloc ((n + 1) * sizeof(wchar_t)); + mbs = *src; + psbuf = *ps; + + wclength = mbsrtowcs (wsbuf, &mbs, n, &psbuf); + + if (wsbuf) + free (wsbuf); + return wclength; + } + + for (wclength = 0; wclength < len; wclength++, dest++) + { + if (mbsinit(ps)) + { + if (**src == '\0') + { + *dest = L'\0'; + *src = NULL; + return (wclength); + } + else if (**src == '\\') + { + *dest = L'\\'; + mblength = 1; + } + else + mblength = mbrtowc(dest, *src, n, ps); + } + else + mblength = mbrtowc(dest, *src, n, ps); + + /* Cannot convert multibyte character to wide character. */ + if (mblength == (size_t)-1 || mblength == (size_t)-2) + return (size_t)-1; + + *src += mblength; + n -= mblength; + + /* The multibyte string has been completely converted, + including the terminating '\0'. */ + if (*dest == L'\0') + { + *src = NULL; + break; + } + } + + return (wclength); +} + +#if HAVE_MBSNRTOWCS +/* Convert a multibyte string to a wide character string. Memory for the + new wide character string is obtained with malloc. + + Fast multiple-character version of xdupmbstowcs used when the indices are + not required and mbsnrtowcs is available. */ + +static size_t +xdupmbstowcs2 (destp, src) + wchar_t **destp; /* Store the pointer to the wide character string */ + const char *src; /* Multibyte character string */ +{ + const char *p; /* Conversion start position of src */ + wchar_t *wsbuf; /* Buffer for wide characters. */ + size_t wsbuf_size; /* Size of WSBUF */ + size_t wcnum; /* Number of wide characters in WSBUF */ + mbstate_t state; /* Conversion State */ + size_t n, wcslength; /* Number of wide characters produced by the conversion. */ + const char *end_or_backslash; + size_t nms; /* Number of multibyte characters to convert at one time. */ + mbstate_t tmp_state; + const char *tmp_p; + + memset (&state, '\0', sizeof(mbstate_t)); + + wsbuf_size = 0; + wsbuf = NULL; + + p = src; + wcnum = 0; + do + { + end_or_backslash = strchrnul(p, '\\'); + nms = end_or_backslash - p; + if (*end_or_backslash == '\0') + nms++; + + /* Compute the number of produced wide-characters. */ + tmp_p = p; + tmp_state = state; + + if (nms == 0 && *p == '\\') /* special initial case */ + nms = wcslength = 1; + else + wcslength = mbsnrtowcs (NULL, &tmp_p, nms, 0, &tmp_state); + + if (wcslength == 0) + { + tmp_p = p; /* will need below */ + tmp_state = state; + wcslength = 1; /* take a single byte */ + } + + /* Conversion failed. */ + if (wcslength == (size_t)-1) + { + free (wsbuf); + *destp = NULL; + return (size_t)-1; + } + + /* Resize the buffer if it is not large enough. */ + if (wsbuf_size < wcnum+wcslength+1) /* 1 for the L'\0' or the potential L'\\' */ + { + wchar_t *wstmp; + + while (wsbuf_size < wcnum+wcslength+1) /* 1 for the L'\0' or the potential L'\\' */ + wsbuf_size += WSBUF_INC; + + wstmp = (wchar_t *) realloc (wsbuf, wsbuf_size * sizeof (wchar_t)); + if (wstmp == NULL) + { + free (wsbuf); + *destp = NULL; + return (size_t)-1; + } + wsbuf = wstmp; + } + + /* Perform the conversion. This is assumed to return 'wcslength'. + It may set 'p' to NULL. */ + n = mbsnrtowcs(wsbuf+wcnum, &p, nms, wsbuf_size-wcnum, &state); + + if (n == 0 && p == 0) + { + wsbuf[wcnum] = L'\0'; + break; + } + + /* Compensate for taking single byte on wcs conversion failure above. */ + if (wcslength == 1 && (n == 0 || n == (size_t)-1)) + { + state = tmp_state; + p = tmp_p; + wsbuf[wcnum] = *p; + if (*p == 0) + break; + else + { + wcnum++; p++; + } + } + else + wcnum += wcslength; + + if (mbsinit (&state) && (p != NULL) && (*p == '\\')) + { + wsbuf[wcnum++] = L'\\'; + p++; + } + } + while (p != NULL); + + *destp = wsbuf; + + /* Return the length of the wide character string, not including `\0'. */ + return wcnum; +} +#endif /* HAVE_MBSNRTOWCS */ + +/* Convert a multibyte string to a wide character string. Memory for the + new wide character string is obtained with malloc. + + The return value is the length of the wide character string. Returns a + pointer to the wide character string in DESTP. If INDICESP is not NULL, + INDICESP stores the pointer to the pointer array. Each pointer is to + the first byte of each multibyte character. Memory for the pointer array + is obtained with malloc, too. + If conversion is failed, the return value is (size_t)-1 and the values + of DESTP and INDICESP are NULL. */ + +size_t +xdupmbstowcs (destp, indicesp, src) + wchar_t **destp; /* Store the pointer to the wide character string */ + char ***indicesp; /* Store the pointer to the pointer array. */ + const char *src; /* Multibyte character string */ +{ + const char *p; /* Conversion start position of src */ + wchar_t wc; /* Created wide character by conversion */ + wchar_t *wsbuf; /* Buffer for wide characters. */ + char **indices; /* Buffer for indices. */ + size_t wsbuf_size; /* Size of WSBUF */ + size_t wcnum; /* Number of wide characters in WSBUF */ + mbstate_t state; /* Conversion State */ + + /* In case SRC or DESP is NULL, conversion doesn't take place. */ + if (src == NULL || destp == NULL) + { + if (destp) + *destp = NULL; + if (indicesp) + *indicesp = NULL; + return (size_t)-1; + } + +#if HAVE_MBSNRTOWCS + if (indicesp == NULL) + return (xdupmbstowcs2 (destp, src)); +#endif + + memset (&state, '\0', sizeof(mbstate_t)); + wsbuf_size = WSBUF_INC; + + wsbuf = (wchar_t *) malloc (wsbuf_size * sizeof(wchar_t)); + if (wsbuf == NULL) + { + *destp = NULL; + if (indicesp) + *indicesp = NULL; + return (size_t)-1; + } + + indices = NULL; + if (indicesp) + { + indices = (char **) malloc (wsbuf_size * sizeof(char *)); + if (indices == NULL) + { + free (wsbuf); + *destp = NULL; + *indicesp = NULL; + return (size_t)-1; + } + } + + p = src; + wcnum = 0; + do + { + size_t mblength; /* Byte length of one multibyte character. */ + + if (mbsinit (&state)) + { + if (*p == '\0') + { + wc = L'\0'; + mblength = 1; + } + else if (*p == '\\') + { + wc = L'\\'; + mblength = 1; + } + else + mblength = mbrtowc(&wc, p, MB_LEN_MAX, &state); + } + else + mblength = mbrtowc(&wc, p, MB_LEN_MAX, &state); + + /* Conversion failed. */ + if (MB_INVALIDCH (mblength)) + { + free (wsbuf); + FREE (indices); + *destp = NULL; + if (indicesp) + *indicesp = NULL; + return (size_t)-1; + } + + ++wcnum; + + /* Resize buffers when they are not large enough. */ + if (wsbuf_size < wcnum) + { + wchar_t *wstmp; + char **idxtmp; + + wsbuf_size += WSBUF_INC; + + wstmp = (wchar_t *) realloc (wsbuf, wsbuf_size * sizeof (wchar_t)); + if (wstmp == NULL) + { + free (wsbuf); + FREE (indices); + *destp = NULL; + if (indicesp) + *indicesp = NULL; + return (size_t)-1; + } + wsbuf = wstmp; + + if (indicesp) + { + idxtmp = (char **) realloc (indices, wsbuf_size * sizeof (char *)); + if (idxtmp == NULL) + { + free (wsbuf); + free (indices); + *destp = NULL; + if (indicesp) + *indicesp = NULL; + return (size_t)-1; + } + indices = idxtmp; + } + } + + wsbuf[wcnum - 1] = wc; + if (indices) + indices[wcnum - 1] = (char *)p; + p += mblength; + } + while (MB_NULLWCH (wc) == 0); + + /* Return the length of the wide character string, not including `\0'. */ + *destp = wsbuf; + if (indicesp != NULL) + *indicesp = indices; + + return (wcnum - 1); +} + +#endif /* HANDLE_MULTIBYTE */ diff --git a/lib/intl/ChangeLog b/lib/intl/ChangeLog new file mode 100644 index 0000000..eed2d21 --- /dev/null +++ b/lib/intl/ChangeLog @@ -0,0 +1,4 @@ +2003-05-22 GNU + + * Version 0.12.1 released. + diff --git a/lib/intl/Makefile.in b/lib/intl/Makefile.in new file mode 100644 index 0000000..00fdb61 --- /dev/null +++ b/lib/intl/Makefile.in @@ -0,0 +1,472 @@ +# Makefile for directory with message catalog handling library of GNU gettext +# Copyright (C) 1995-1998, 2000-2003, 2008,2009 Free Software Foundation, Inc. +# + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +PACKAGE = @PACKAGE_NAME@ +VERSION = @PACKAGE_VERSION@ + +SHELL = /bin/sh + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +top_builddir = @BUILD_DIR@ +VPATH = $(srcdir) + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +transform = @program_transform_name@ + +datarootdir = @datarootdir@ + +libdir = @libdir@ +includedir = @includedir@ +datadir = @datadir@ +localedir = @localedir@ + +gettextsrcdir = $(datadir)/gettext/intl +aliaspath = $(localedir) +subdir = intl + +@SET_MAKE@ + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +mkinstalldirs = $(SHELL) $(MKINSTALLDIRS) + +l = @INTL_LIBTOOL_SUFFIX_PREFIX@ + +AR = @AR@ +CC = @CC@ +LIBTOOL = @LIBTOOL@ +RANLIB = @RANLIB@ +YACC = @INTLBISON@ -y -d +YFLAGS = --name-prefix=__gettext + +ARFLAGS = @ARFLAGS@ + +LOCAL_DEFS = @LOCAL_DEFS@ + +DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \ +-DLIBDIR=\"$(prefix)/libdata\" -DIN_LIBINTL \ +-DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \ +-Dset_relocation_prefix=libintl_set_relocation_prefix \ +-Drelocate=libintl_relocate \ +-DDEPENDS_ON_LIBICONV=1 @DEFS@ ${LOCAL_DEFS} +CPPFLAGS = @CPPFLAGS@ +CFLAGS = @CFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ + +COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) + +HEADERS = \ + gmo.h \ + gettextP.h \ + hash-string.h \ + loadinfo.h \ + plural-exp.h \ + eval-plural.h \ + localcharset.h \ + relocatable.h \ + os2compat.h \ + libgnuintl.h.in +SOURCES = \ + bindtextdom.c \ + dcgettext.c \ + dgettext.c \ + gettext.c \ + finddomain.c \ + loadmsgcat.c \ + localealias.c \ + textdomain.c \ + l10nflist.c \ + explodename.c \ + dcigettext.c \ + dcngettext.c \ + dngettext.c \ + ngettext.c \ + plural.y \ + plural-exp.c \ + localcharset.c \ + relocatable.c \ + localename.c \ + log.c \ + osdep.c \ + os2compat.c \ + intl-compat.c +OBJECTS = \ + bindtextdom.$lo \ + dcgettext.$lo \ + dgettext.$lo \ + gettext.$lo \ + finddomain.$lo \ + loadmsgcat.$lo \ + localealias.$lo \ + textdomain.$lo \ + l10nflist.$lo \ + explodename.$lo \ + dcigettext.$lo \ + dcngettext.$lo \ + dngettext.$lo \ + ngettext.$lo \ + plural.$lo \ + plural-exp.$lo \ + localcharset.$lo \ + relocatable.$lo \ + localename.$lo \ + log.$lo \ + osdep.$lo \ + intl-compat.$lo +DISTFILES.common = Makefile.in \ +config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES) +DISTFILES.generated = plural.c +DISTFILES.normal = VERSION +DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc \ +Makefile.vms libgnuintl.h.msvc-shared README.woe32 Makefile.msvc +DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \ +COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h + +all: all-@USE_INCLUDED_LIBINTL@ +all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed +all-no: all-no-@BUILD_INCLUDED_LIBINTL@ +all-no-yes: libgnuintl.$la +all-no-no: + +libintl.a libgnuintl.a: $(OBJECTS) + rm -f $@ + $(AR) $(ARFLAGS) $@ $(OBJECTS) + $(RANLIB) $@ + +libintl.la libgnuintl.la: $(OBJECTS) + $(LIBTOOL) --mode=link \ + $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \ + $(OBJECTS) @LTLIBICONV@ $(LIBS) \ + -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ + -rpath $(libdir) \ + -no-undefined + +# Libtool's library version information for libintl. +# Before making a gettext release, the gettext maintainer must change this +# according to the libtool documentation, section "Library interface versions". +# Maintainers of other packages that include the intl directory must *not* +# change these values. +LTV_CURRENT=5 +LTV_REVISION=0 +LTV_AGE=3 + +.SUFFIXES: +.SUFFIXES: .c .y .o .lo .sin .sed + +.c.o: + $(COMPILE) $< + +.y.c: + $(YACC) $(YFLAGS) --output $@ $< + rm -f $*.h + +bindtextdom.lo: $(srcdir)/bindtextdom.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c +dcgettext.lo: $(srcdir)/dcgettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c +dgettext.lo: $(srcdir)/dgettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c +gettext.lo: $(srcdir)/gettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c +finddomain.lo: $(srcdir)/finddomain.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c +loadmsgcat.lo: $(srcdir)/loadmsgcat.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c +localealias.lo: $(srcdir)/localealias.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c +textdomain.lo: $(srcdir)/textdomain.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c +l10nflist.lo: $(srcdir)/l10nflist.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c +explodename.lo: $(srcdir)/explodename.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c +dcigettext.lo: $(srcdir)/dcigettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c +dcngettext.lo: $(srcdir)/dcngettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c +dngettext.lo: $(srcdir)/dngettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c +ngettext.lo: $(srcdir)/ngettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c +plural.lo: $(srcdir)/plural.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c +plural-exp.lo: $(srcdir)/plural-exp.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c +localcharset.lo: $(srcdir)/localcharset.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c +relocatable.lo: $(srcdir)/relocatable.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c +localename.lo: $(srcdir)/localename.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c +log.lo: $(srcdir)/log.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c +osdep.lo: $(srcdir)/osdep.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c +intl-compat.lo: $(srcdir)/intl-compat.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c + +ref-add.sed: $(srcdir)/ref-add.sin + sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed + mv t-ref-add.sed ref-add.sed +ref-del.sed: $(srcdir)/ref-del.sin + sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed + mv t-ref-del.sed ref-del.sed + +INCLUDES = -I. -I$(srcdir) -I${top_builddir} -I${top_srcdir} + +libgnuintl.h: $(srcdir)/libgnuintl.h.in + cp $(srcdir)/libgnuintl.h.in libgnuintl.h + +libintl.h: libgnuintl.h + cmp libgnuintl.h libintl.h || cp libgnuintl.h libintl.h + +charset.alias: $(srcdir)/config.charset + $(SHELL) $(srcdir)/config.charset '@host@' > t-$@ + mv t-$@ $@ + +check: all + +# We must not install the libintl.h/libintl.a files if we are on a +# system which has the GNU gettext() function in its C library or in a +# separate library. +# If you want to use the one which comes with this version of the +# package, you have to use `configure --with-included-gettext'. +install: install-exec install-data +install-exec: all + if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \ + && test '@USE_INCLUDED_LIBINTL@' = yes; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ + $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \ + $(LIBTOOL) --mode=install \ + $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \ + if test "@RELOCATABLE@" = yes; then \ + dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \ + if test -n "$dependencies"; then \ + rm -f $(DESTDIR)$(libdir)/libintl.la; \ + fi; \ + fi; \ + else \ + : ; \ + fi + if test "$(PACKAGE)" = "gettext-tools" \ + && test '@USE_INCLUDED_LIBINTL@' = no; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir); \ + $(LIBTOOL) --mode=install \ + $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \ + rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \ + $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \ + $(LIBTOOL) --mode=uninstall \ + rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \ + else \ + : ; \ + fi + if test '@USE_INCLUDED_LIBINTL@' = yes; then \ + $(mkinstalldirs) $(DESTDIR)$(localedir); \ + test -f $(DESTDIR)$(localedir)/locale.alias \ + && orig=$(DESTDIR)$(localedir)/locale.alias \ + || orig=$(srcdir)/locale.alias; \ + temp=$(DESTDIR)$(localedir)/t-locale.alias; \ + dest=$(DESTDIR)$(localedir)/locale.alias; \ + sed -f ref-add.sed $$orig > $$temp; \ + $(INSTALL_DATA) $$temp $$dest; \ + rm -f $$temp; \ + else \ + : ; \ + fi +install-data: all + if test "$(PACKAGE)" = "gettext-tools"; then \ + $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ + $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \ + $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \ + dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \ + for file in $$dists; do \ + $(INSTALL_DATA) $(srcdir)/$$file \ + $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \ + dists="$(DISTFILES.generated)"; \ + for file in $$dists; do \ + if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ + $(INSTALL_DATA) $$dir/$$file \ + $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + dists="$(DISTFILES.obsolete)"; \ + for file in $$dists; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi + +install-strip: install + +installdirs: + if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \ + && test '@USE_INCLUDED_LIBINTL@' = yes; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ + else \ + : ; \ + fi + if test "$(PACKAGE)" = "gettext-tools" \ + && test '@USE_INCLUDED_LIBINTL@' = no; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir); \ + else \ + : ; \ + fi + if test '@USE_INCLUDED_LIBINTL@' = yes; then \ + test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \ + $(mkinstalldirs) $(DESTDIR)$(localedir); \ + else \ + : ; \ + fi + if test "$(PACKAGE)" = "gettext-tools"; then \ + $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ + else \ + : ; \ + fi + +# Define this as empty until I found a useful application. +installcheck: + +uninstall: + if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \ + && test '@USE_INCLUDED_LIBINTL@' = yes; then \ + rm -f $(DESTDIR)$(includedir)/libintl.h; \ + $(LIBTOOL) --mode=uninstall \ + rm -f $(DESTDIR)$(libdir)/libintl.$la; \ + else \ + : ; \ + fi + if test "$(PACKAGE)" = "gettext-tools" \ + && test '@USE_INCLUDED_LIBINTL@' = no; then \ + rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \ + else \ + : ; \ + fi + if test '@USE_INCLUDED_LIBINTL@' = yes; then \ + if test -f $(DESTDIR)$(prefix)/libdata/charset.alias; then \ + temp=$(DESTDIR)$(prefix)/libdata/t-charset.alias; \ + dest=$(DESTDIR)$(prefix)/libdata/charset.alias; \ + sed -f ref-del.sed $$dest > $$temp; \ + if grep '^# Packages using this file: $$' $$temp > /dev/null; then \ + rm -f $$dest; \ + else \ + $(INSTALL_DATA) $$temp $$dest; \ + fi; \ + rm -f $$temp; \ + fi; \ + if test -f $(DESTDIR)$(localedir)/locale.alias; then \ + temp=$(DESTDIR)$(localedir)/t-locale.alias; \ + dest=$(DESTDIR)$(localedir)/locale.alias; \ + sed -f ref-del.sed $$dest > $$temp; \ + if grep '^# Packages using this file: $$' $$temp > /dev/null; then \ + rm -f $$dest; \ + else \ + $(INSTALL_DATA) $$temp $$dest; \ + fi; \ + rm -f $$temp; \ + fi; \ + else \ + : ; \ + fi + if test "$(PACKAGE)" = "gettext-tools"; then \ + for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi + +info dvi ps pdf html: + +$(OBJECTS): ${top_builddir}/config.h libgnuintl.h +bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo textdomain.$lo: $(srcdir)/gettextP.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h +dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h +explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h +dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h +dcigettext.$lo: $(srcdir)/eval-plural.h +localcharset.$lo: $(srcdir)/localcharset.h +localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h + +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) + here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES) + +ctags: CTAGS + +CTAGS: $(HEADERS) $(SOURCES) + here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES) + +id: ID + +ID: $(HEADERS) $(SOURCES) + here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES) + + +mostlyclean: + rm -f *.a *.la *.o *.obj *.lo core core.* + rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed + rm -f -r .libs _libs + +clean: mostlyclean + +distclean: clean + rm -f Makefile ID TAGS + if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \ + rm -f ChangeLog.inst $(DISTFILES.normal); \ + else \ + : ; \ + fi + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + + +# GNU gettext needs not contain the file `VERSION' but contains some +# other files which should not be distributed in other packages. +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: Makefile + if test "$(PACKAGE)" = "gettext-tools"; then \ + : ; \ + else \ + if test "$(PACKAGE)" = "gettext-runtime"; then \ + additional="$(DISTFILES.gettext)"; \ + else \ + additional="$(DISTFILES.normal)"; \ + fi; \ + $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \ + for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \ + if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ + cp -p $$dir/$$file $(distdir); \ + done; \ + fi + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status +# This would be more efficient, but doesn't work any more with autoconf-2.57, +# when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used. +# cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +# Tell versions [3.59,3.63) of GNU make not to export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/lib/intl/VERSION b/lib/intl/VERSION new file mode 100644 index 0000000..1303183 --- /dev/null +++ b/lib/intl/VERSION @@ -0,0 +1 @@ +GNU gettext library from gettext-0.12.1 diff --git a/lib/intl/bindtextdom.c b/lib/intl/bindtextdom.c new file mode 100644 index 0000000..ef5479e --- /dev/null +++ b/lib/intl/bindtextdom.c @@ -0,0 +1,376 @@ +/* bindtextdom.c - Implementation of the bindtextdomain(3) function */ + +/* Copyright (C) 1995-1998, 2000, 2001, 2002, 2005-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif +#include "gettextP.h" + +#ifdef _LIBC +/* We have to handle multi-threaded applications. */ +# include +#else +/* Provide dummy implementation if this is outside glibc. */ +# define __libc_rwlock_define(CLASS, NAME) +# define __libc_rwlock_wrlock(NAME) +# define __libc_rwlock_unlock(NAME) +#endif + +/* The internal variables in the standalone libintl.a must have different + names than the internal variables in GNU libc, otherwise programs + using libintl.a cannot be linked statically. */ +#if !defined _LIBC +# define _nl_default_dirname libintl_nl_default_dirname +# define _nl_domain_bindings libintl_nl_domain_bindings +#endif + +/* Some compilers, like SunOS4 cc, don't have offsetof in . */ +#ifndef offsetof +# define offsetof(type,ident) ((size_t)&(((type*)0)->ident)) +#endif + +/* @@ end of prolog @@ */ + +/* Contains the default location of the message catalogs. */ +extern const char _nl_default_dirname[]; +#ifdef _LIBC +extern const char _nl_default_dirname_internal[] attribute_hidden; +#else +# define INTUSE(name) name +#endif + +/* List with bindings of specific domains. */ +extern struct binding *_nl_domain_bindings; + +/* Lock variable to protect the global data in the gettext implementation. */ +__libc_rwlock_define (extern, _nl_state_lock attribute_hidden) + + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define BINDTEXTDOMAIN __bindtextdomain +# define BIND_TEXTDOMAIN_CODESET __bind_textdomain_codeset +# ifndef strdup +# define strdup(str) __strdup (str) +# endif +#else +# define BINDTEXTDOMAIN libintl_bindtextdomain +# define BIND_TEXTDOMAIN_CODESET libintl_bind_textdomain_codeset +#endif + +/* Prototypes for local functions. */ +static void set_binding_values PARAMS ((const char *domainname, + const char **dirnamep, + const char **codesetp)); + +/* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP + to be used for the DOMAINNAME message catalog. + If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not + modified, only the current value is returned. + If DIRNAMEP or CODESETP is NULL, the corresponding attribute is neither + modified nor returned. */ +static void +set_binding_values (domainname, dirnamep, codesetp) + const char *domainname; + const char **dirnamep; + const char **codesetp; +{ + struct binding *binding; + int modified; + + /* Some sanity checks. */ + if (domainname == NULL || domainname[0] == '\0') + { + if (dirnamep) + *dirnamep = NULL; + if (codesetp) + *codesetp = NULL; + return; + } + + __libc_rwlock_wrlock (_nl_state_lock); + + modified = 0; + + for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) + { + int compare = strcmp (domainname, binding->domainname); + if (compare == 0) + /* We found it! */ + break; + if (compare < 0) + { + /* It is not in the list. */ + binding = NULL; + break; + } + } + + if (binding != NULL) + { + if (dirnamep) + { + const char *dirname = *dirnamep; + + if (dirname == NULL) + /* The current binding has be to returned. */ + *dirnamep = binding->dirname; + else + { + /* The domain is already bound. If the new value and the old + one are equal we simply do nothing. Otherwise replace the + old binding. */ + char *result = binding->dirname; + if (strcmp (dirname, result) != 0) + { + if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0) + result = (char *) INTUSE(_nl_default_dirname); + else + { +#if defined _LIBC || defined HAVE_STRDUP + result = strdup (dirname); +#else + size_t len = strlen (dirname) + 1; + result = (char *) malloc (len); + if (__builtin_expect (result != NULL, 1)) + memcpy (result, dirname, len); +#endif + } + + if (__builtin_expect (result != NULL, 1)) + { + if (binding->dirname != INTUSE(_nl_default_dirname)) + free (binding->dirname); + + binding->dirname = result; + modified = 1; + } + } + *dirnamep = result; + } + } + + if (codesetp) + { + const char *codeset = *codesetp; + + if (codeset == NULL) + /* The current binding has be to returned. */ + *codesetp = binding->codeset; + else + { + /* The domain is already bound. If the new value and the old + one are equal we simply do nothing. Otherwise replace the + old binding. */ + char *result = binding->codeset; + if (result == NULL || strcmp (codeset, result) != 0) + { +#if defined _LIBC || defined HAVE_STRDUP + result = strdup (codeset); +#else + size_t len = strlen (codeset) + 1; + result = (char *) malloc (len); + if (__builtin_expect (result != NULL, 1)) + memcpy (result, codeset, len); +#endif + + if (__builtin_expect (result != NULL, 1)) + { + if (binding->codeset != NULL) + free (binding->codeset); + + binding->codeset = result; + binding->codeset_cntr++; + modified = 1; + } + } + *codesetp = result; + } + } + } + else if ((dirnamep == NULL || *dirnamep == NULL) + && (codesetp == NULL || *codesetp == NULL)) + { + /* Simply return the default values. */ + if (dirnamep) + *dirnamep = INTUSE(_nl_default_dirname); + if (codesetp) + *codesetp = NULL; + } + else + { + /* We have to create a new binding. */ + size_t len = strlen (domainname) + 1; + struct binding *new_binding = + (struct binding *) malloc (offsetof (struct binding, domainname) + len); + + if (__builtin_expect (new_binding == NULL, 0)) + goto failed; + + memcpy (new_binding->domainname, domainname, len); + + if (dirnamep) + { + const char *dirname = *dirnamep; + + if (dirname == NULL) + /* The default value. */ + dirname = INTUSE(_nl_default_dirname); + else + { + if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0) + dirname = INTUSE(_nl_default_dirname); + else + { + char *result; +#if defined _LIBC || defined HAVE_STRDUP + result = strdup (dirname); + if (__builtin_expect (result == NULL, 0)) + goto failed_dirname; +#else + size_t len = strlen (dirname) + 1; + result = (char *) malloc (len); + if (__builtin_expect (result == NULL, 0)) + goto failed_dirname; + memcpy (result, dirname, len); +#endif + dirname = result; + } + } + *dirnamep = dirname; + new_binding->dirname = (char *) dirname; + } + else + /* The default value. */ + new_binding->dirname = (char *) INTUSE(_nl_default_dirname); + + new_binding->codeset_cntr = 0; + + if (codesetp) + { + const char *codeset = *codesetp; + + if (codeset != NULL) + { + char *result; + +#if defined _LIBC || defined HAVE_STRDUP + result = strdup (codeset); + if (__builtin_expect (result == NULL, 0)) + goto failed_codeset; +#else + size_t len = strlen (codeset) + 1; + result = (char *) malloc (len); + if (__builtin_expect (result == NULL, 0)) + goto failed_codeset; + memcpy (result, codeset, len); +#endif + codeset = result; + new_binding->codeset_cntr++; + } + *codesetp = codeset; + new_binding->codeset = (char *) codeset; + } + else + new_binding->codeset = NULL; + + /* Now enqueue it. */ + if (_nl_domain_bindings == NULL + || strcmp (domainname, _nl_domain_bindings->domainname) < 0) + { + new_binding->next = _nl_domain_bindings; + _nl_domain_bindings = new_binding; + } + else + { + binding = _nl_domain_bindings; + while (binding->next != NULL + && strcmp (domainname, binding->next->domainname) > 0) + binding = binding->next; + + new_binding->next = binding->next; + binding->next = new_binding; + } + + modified = 1; + + /* Here we deal with memory allocation failures. */ + if (0) + { + failed_codeset: + if (new_binding->dirname != INTUSE(_nl_default_dirname)) + free (new_binding->dirname); + failed_dirname: + free (new_binding); + failed: + if (dirnamep) + *dirnamep = NULL; + if (codesetp) + *codesetp = NULL; + } + } + + /* If we modified any binding, we flush the caches. */ + if (modified) + ++_nl_msg_cat_cntr; + + __libc_rwlock_unlock (_nl_state_lock); +} + +/* Specify that the DOMAINNAME message catalog will be found + in DIRNAME rather than in the system locale data base. */ +char * +BINDTEXTDOMAIN (domainname, dirname) + const char *domainname; + const char *dirname; +{ + set_binding_values (domainname, &dirname, NULL); + return (char *) dirname; +} + +/* Specify the character encoding in which the messages from the + DOMAINNAME message catalog will be returned. */ +char * +BIND_TEXTDOMAIN_CODESET (domainname, codeset) + const char *domainname; + const char *codeset; +{ + set_binding_values (domainname, NULL, &codeset); + return (char *) codeset; +} + +#ifdef _LIBC +/* Aliases for function names in GNU C Library. */ +weak_alias (__bindtextdomain, bindtextdomain); +weak_alias (__bind_textdomain_codeset, bind_textdomain_codeset); +#endif diff --git a/lib/intl/config.charset b/lib/intl/config.charset new file mode 100644 index 0000000..10c4439 --- /dev/null +++ b/lib/intl/config.charset @@ -0,0 +1,465 @@ +#! /bin/sh +# Output a system dependent table of character encoding aliases. +# +# Copyright (C) 2000-2009 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# The table consists of lines of the form +# ALIAS CANONICAL +# +# ALIAS is the (system dependent) result of "nl_langinfo (CODESET)". +# ALIAS is compared in a case sensitive way. +# +# CANONICAL is the GNU canonical name for this character encoding. +# It must be an encoding supported by libiconv. Support by GNU libc is +# also desirable. CANONICAL is case insensitive. Usually an upper case +# MIME charset name is preferred. +# The current list of GNU canonical charset names is as follows. +# +# name used by which systems a MIME name? +# ASCII, ANSI_X3.4-1968 glibc solaris freebsd +# ISO-8859-1 glibc aix hpux irix osf solaris freebsd yes +# ISO-8859-2 glibc aix hpux irix osf solaris freebsd yes +# ISO-8859-3 glibc solaris yes +# ISO-8859-4 osf solaris freebsd yes +# ISO-8859-5 glibc aix hpux irix osf solaris freebsd yes +# ISO-8859-6 glibc aix hpux solaris yes +# ISO-8859-7 glibc aix hpux irix osf solaris yes +# ISO-8859-8 glibc aix hpux osf solaris yes +# ISO-8859-9 glibc aix hpux irix osf solaris yes +# ISO-8859-13 glibc +# ISO-8859-14 glibc +# ISO-8859-15 glibc aix osf solaris freebsd +# KOI8-R glibc solaris freebsd yes +# KOI8-U glibc freebsd yes +# KOI8-T glibc +# CP437 dos +# CP775 dos +# CP850 aix osf dos +# CP852 dos +# CP855 dos +# CP856 aix +# CP857 dos +# CP861 dos +# CP862 dos +# CP864 dos +# CP865 dos +# CP866 freebsd dos +# CP869 dos +# CP874 woe32 dos +# CP922 aix +# CP932 aix woe32 dos +# CP943 aix +# CP949 osf woe32 dos +# CP950 woe32 dos +# CP1046 aix +# CP1124 aix +# CP1125 dos +# CP1129 aix +# CP1250 woe32 +# CP1251 glibc solaris woe32 +# CP1252 aix woe32 +# CP1253 woe32 +# CP1254 woe32 +# CP1255 glibc woe32 +# CP1256 woe32 +# CP1257 woe32 +# GB2312 glibc aix hpux irix solaris freebsd yes +# EUC-JP glibc aix hpux irix osf solaris freebsd yes +# EUC-KR glibc aix hpux irix osf solaris freebsd yes +# EUC-TW glibc aix hpux irix osf solaris +# BIG5 glibc aix hpux osf solaris freebsd yes +# BIG5-HKSCS glibc solaris +# GBK glibc aix osf solaris woe32 dos +# GB18030 glibc solaris +# SHIFT_JIS hpux osf solaris freebsd yes +# JOHAB glibc solaris woe32 +# TIS-620 glibc aix hpux osf solaris +# VISCII glibc yes +# TCVN5712-1 glibc +# GEORGIAN-PS glibc +# HP-ROMAN8 hpux +# HP-ARABIC8 hpux +# HP-GREEK8 hpux +# HP-HEBREW8 hpux +# HP-TURKISH8 hpux +# HP-KANA8 hpux +# DEC-KANJI osf +# DEC-HANYU osf +# UTF-8 glibc aix hpux osf solaris yes +# +# Note: Names which are not marked as being a MIME name should not be used in +# Internet protocols for information interchange (mail, news, etc.). +# +# Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications +# must understand both names and treat them as equivalent. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM + +host="$1" +os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'` +echo "# This file contains a table of character encoding aliases," +echo "# suitable for operating system '${os}'." +echo "# It was automatically generated from config.charset." +# List of references, updated during installation: +echo "# Packages using this file: " +case "$os" in + linux* | *-gnu*) + # With glibc-2.1 or newer, we don't need any canonicalization, + # because glibc has iconv and both glibc and libiconv support all + # GNU canonical names directly. Therefore, the Makefile does not + # need to install the alias file at all. + # The following applies only to glibc-2.0.x and older libcs. + echo "ISO_646.IRV:1983 ASCII" + ;; + aix*) + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-6 ISO-8859-6" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-8 ISO-8859-8" + echo "ISO8859-9 ISO-8859-9" + echo "ISO8859-15 ISO-8859-15" + echo "IBM-850 CP850" + echo "IBM-856 CP856" + echo "IBM-921 ISO-8859-13" + echo "IBM-922 CP922" + echo "IBM-932 CP932" + echo "IBM-943 CP943" + echo "IBM-1046 CP1046" + echo "IBM-1124 CP1124" + echo "IBM-1129 CP1129" + echo "IBM-1252 CP1252" + echo "IBM-eucCN GB2312" + echo "IBM-eucJP EUC-JP" + echo "IBM-eucKR EUC-KR" + echo "IBM-eucTW EUC-TW" + echo "big5 BIG5" + echo "GBK GBK" + echo "TIS-620 TIS-620" + echo "UTF-8 UTF-8" + ;; + hpux*) + echo "iso88591 ISO-8859-1" + echo "iso88592 ISO-8859-2" + echo "iso88595 ISO-8859-5" + echo "iso88596 ISO-8859-6" + echo "iso88597 ISO-8859-7" + echo "iso88598 ISO-8859-8" + echo "iso88599 ISO-8859-9" + echo "iso885915 ISO-8859-15" + echo "roman8 HP-ROMAN8" + echo "arabic8 HP-ARABIC8" + echo "greek8 HP-GREEK8" + echo "hebrew8 HP-HEBREW8" + echo "turkish8 HP-TURKISH8" + echo "kana8 HP-KANA8" + echo "tis620 TIS-620" + echo "big5 BIG5" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "eucTW EUC-TW" + echo "hp15CN GB2312" + #echo "ccdc ?" # what is this? + echo "SJIS SHIFT_JIS" + echo "utf8 UTF-8" + ;; + irix*) + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-9 ISO-8859-9" + echo "eucCN GB2312" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "eucTW EUC-TW" + ;; + osf*) + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-4 ISO-8859-4" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-8 ISO-8859-8" + echo "ISO8859-9 ISO-8859-9" + echo "ISO8859-15 ISO-8859-15" + echo "cp850 CP850" + echo "big5 BIG5" + echo "dechanyu DEC-HANYU" + echo "dechanzi GB2312" + echo "deckanji DEC-KANJI" + echo "deckorean EUC-KR" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "eucTW EUC-TW" + echo "GBK GBK" + echo "KSC5601 CP949" + echo "sdeckanji EUC-JP" + echo "SJIS SHIFT_JIS" + echo "TACTIS TIS-620" + echo "UTF-8 UTF-8" + ;; + solaris*) + echo "646 ASCII" + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-3 ISO-8859-3" + echo "ISO8859-4 ISO-8859-4" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-6 ISO-8859-6" + echo "ISO8859-7 ISO-8859-7" + echo "ISO8859-8 ISO-8859-8" + echo "ISO8859-9 ISO-8859-9" + echo "ISO8859-15 ISO-8859-15" + echo "koi8-r KOI8-R" + echo "ansi-1251 CP1251" + echo "BIG5 BIG5" + echo "Big5-HKSCS BIG5-HKSCS" + echo "gb2312 GB2312" + echo "GBK GBK" + echo "GB18030 GB18030" + echo "cns11643 EUC-TW" + echo "5601 EUC-KR" + echo "ko_KR.johap92 JOHAB" + echo "eucJP EUC-JP" + echo "PCK SHIFT_JIS" + echo "TIS620.2533 TIS-620" + #echo "sun_eu_greek ?" # what is this? + echo "UTF-8 UTF-8" + ;; + freebsd* | os2*) + # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore + # localcharset.c falls back to using the full locale name + # from the environment variables. + # Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just + # reuse FreeBSD's locale data for OS/2. + echo "C ASCII" + echo "US-ASCII ASCII" + for l in la_LN lt_LN; do + echo "$l.ASCII ASCII" + done + for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \ + fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \ + lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do + echo "$l.ISO_8859-1 ISO-8859-1" + echo "$l.DIS_8859-15 ISO-8859-15" + done + for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do + echo "$l.ISO_8859-2 ISO-8859-2" + done + for l in la_LN lt_LT; do + echo "$l.ISO_8859-4 ISO-8859-4" + done + for l in ru_RU ru_SU; do + echo "$l.KOI8-R KOI8-R" + echo "$l.ISO_8859-5 ISO-8859-5" + echo "$l.CP866 CP866" + done + echo "uk_UA.KOI8-U KOI8-U" + echo "zh_TW.BIG5 BIG5" + echo "zh_TW.Big5 BIG5" + echo "zh_CN.EUC GB2312" + echo "ja_JP.EUC EUC-JP" + echo "ja_JP.SJIS SHIFT_JIS" + echo "ja_JP.Shift_JIS SHIFT_JIS" + echo "ko_KR.EUC EUC-KR" + ;; + netbsd*) + echo "646 ASCII" + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-4 ISO-8859-4" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-15 ISO-8859-15" + echo "eucCN GB2312" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "eucTW EUC-TW" + echo "BIG5 BIG5" + echo "SJIS SHIFT_JIS" + ;; + beos*) + # BeOS has a single locale, and it has UTF-8 encoding. + echo "* UTF-8" + ;; + msdosdjgpp*) + # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore + # localcharset.c falls back to using the full locale name + # from the environment variables. + echo "#" + echo "# The encodings given here may not all be correct." + echo "# If you find that the encoding given for your language and" + echo "# country is not the one your DOS machine actually uses, just" + echo "# correct it in this file, and send a mail to" + echo "# Juan Manuel Guerrero " + echo "# and Bruno Haible ." + echo "#" + echo "C ASCII" + # ISO-8859-1 languages + echo "ca CP850" + echo "ca_ES CP850" + echo "da CP865" # not CP850 ?? + echo "da_DK CP865" # not CP850 ?? + echo "de CP850" + echo "de_AT CP850" + echo "de_CH CP850" + echo "de_DE CP850" + echo "en CP850" + echo "en_AU CP850" # not CP437 ?? + echo "en_CA CP850" + echo "en_GB CP850" + echo "en_NZ CP437" + echo "en_US CP437" + echo "en_ZA CP850" # not CP437 ?? + echo "es CP850" + echo "es_AR CP850" + echo "es_BO CP850" + echo "es_CL CP850" + echo "es_CO CP850" + echo "es_CR CP850" + echo "es_CU CP850" + echo "es_DO CP850" + echo "es_EC CP850" + echo "es_ES CP850" + echo "es_GT CP850" + echo "es_HN CP850" + echo "es_MX CP850" + echo "es_NI CP850" + echo "es_PA CP850" + echo "es_PY CP850" + echo "es_PE CP850" + echo "es_SV CP850" + echo "es_UY CP850" + echo "es_VE CP850" + echo "et CP850" + echo "et_EE CP850" + echo "eu CP850" + echo "eu_ES CP850" + echo "fi CP850" + echo "fi_FI CP850" + echo "fr CP850" + echo "fr_BE CP850" + echo "fr_CA CP850" + echo "fr_CH CP850" + echo "fr_FR CP850" + echo "ga CP850" + echo "ga_IE CP850" + echo "gd CP850" + echo "gd_GB CP850" + echo "gl CP850" + echo "gl_ES CP850" + echo "id CP850" # not CP437 ?? + echo "id_ID CP850" # not CP437 ?? + echo "is CP861" # not CP850 ?? + echo "is_IS CP861" # not CP850 ?? + echo "it CP850" + echo "it_CH CP850" + echo "it_IT CP850" + echo "lt CP775" + echo "lt_LT CP775" + echo "lv CP775" + echo "lv_LV CP775" + echo "nb CP865" # not CP850 ?? + echo "nb_NO CP865" # not CP850 ?? + echo "nl CP850" + echo "nl_BE CP850" + echo "nl_NL CP850" + echo "nn CP865" # not CP850 ?? + echo "nn_NO CP865" # not CP850 ?? + echo "no CP865" # not CP850 ?? + echo "no_NO CP865" # not CP850 ?? + echo "pt CP850" + echo "pt_BR CP850" + echo "pt_PT CP850" + echo "sv CP850" + echo "sv_SE CP850" + # ISO-8859-2 languages + echo "cs CP852" + echo "cs_CZ CP852" + echo "hr CP852" + echo "hr_HR CP852" + echo "hu CP852" + echo "hu_HU CP852" + echo "pl CP852" + echo "pl_PL CP852" + echo "ro CP852" + echo "ro_RO CP852" + echo "sk CP852" + echo "sk_SK CP852" + echo "sl CP852" + echo "sl_SI CP852" + echo "sq CP852" + echo "sq_AL CP852" + echo "sr CP852" # CP852 or CP866 or CP855 ?? + echo "sr_YU CP852" # CP852 or CP866 or CP855 ?? + # ISO-8859-3 languages + echo "mt CP850" + echo "mt_MT CP850" + # ISO-8859-5 languages + echo "be CP866" + echo "be_BE CP866" + echo "bg CP866" # not CP855 ?? + echo "bg_BG CP866" # not CP855 ?? + echo "mk CP866" # not CP855 ?? + echo "mk_MK CP866" # not CP855 ?? + echo "ru CP866" + echo "ru_RU CP866" + echo "uk CP1125" + echo "uk_UA CP1125" + # ISO-8859-6 languages + echo "ar CP864" + echo "ar_AE CP864" + echo "ar_DZ CP864" + echo "ar_EG CP864" + echo "ar_IQ CP864" + echo "ar_IR CP864" + echo "ar_JO CP864" + echo "ar_KW CP864" + echo "ar_MA CP864" + echo "ar_OM CP864" + echo "ar_QA CP864" + echo "ar_SA CP864" + echo "ar_SY CP864" + # ISO-8859-7 languages + echo "el CP869" + echo "el_GR CP869" + # ISO-8859-8 languages + echo "he CP862" + echo "he_IL CP862" + # ISO-8859-9 languages + echo "tr CP857" + echo "tr_TR CP857" + # Japanese + echo "ja CP932" + echo "ja_JP CP932" + # Chinese + echo "zh_CN GBK" + echo "zh_TW CP950" # not CP938 ?? + # Korean + echo "kr CP949" # not CP934 ?? + echo "kr_KR CP949" # not CP934 ?? + # Thai + echo "th CP874" + echo "th_TH CP874" + # Other + echo "eo CP850" + echo "eo_EO CP850" + ;; +esac diff --git a/lib/intl/dcgettext.c b/lib/intl/dcgettext.c new file mode 100644 index 0000000..c156ca2 --- /dev/null +++ b/lib/intl/dcgettext.c @@ -0,0 +1,61 @@ +/* dcgettext.c - Implementation of the dcgettext(3) function. */ + +/* Copyright (C) 1995-1999, 2000, 2001, 2002, 2006-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "gettextP.h" +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif + +/* @@ end of prolog @@ */ + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define DCGETTEXT __dcgettext +# define DCIGETTEXT __dcigettext +#else +# define DCGETTEXT libintl_dcgettext +# define DCIGETTEXT libintl_dcigettext +#endif + +/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY + locale. */ +char * +DCGETTEXT (domainname, msgid, category) + const char *domainname; + const char *msgid; + int category; +{ + return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category); +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +INTDEF(__dcgettext) +weak_alias (__dcgettext, dcgettext); +#endif diff --git a/lib/intl/dcigettext.c b/lib/intl/dcigettext.c new file mode 100644 index 0000000..c0f347e --- /dev/null +++ b/lib/intl/dcigettext.c @@ -0,0 +1,1248 @@ +/* dcigettext.c - Implementation of the internal dcigettext function. */ + +/* Copyright (C) 1995-1999, 2000-2003, 2006-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Tell glibc's to provide a prototype for mempcpy(). + This must come before because may include + , and once has been included, it's too late. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#ifdef __GNUC__ +# define alloca __builtin_alloca +# define HAVE_ALLOCA 1 +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# if defined HAVE_ALLOCA_H || defined _LIBC +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca +char *alloca (); +# endif +# endif +# endif +# endif +#endif + +#include +#ifndef errno +extern int errno; +#endif +#ifndef __set_errno +# define __set_errno(val) errno = (val) +#endif + +#include +#include +#include + +#if defined HAVE_UNISTD_H || defined _LIBC +# include +#endif + +#include + +#ifdef _LIBC + /* Guess whether integer division by zero raises signal SIGFPE. + Set to 1 only if you know for sure. In case of doubt, set to 0. */ +# if defined __alpha__ || defined __arm__ || defined __i386__ \ + || defined __m68k__ || defined __s390__ +# define INTDIV0_RAISES_SIGFPE 1 +# else +# define INTDIV0_RAISES_SIGFPE 0 +# endif +#endif +#if !INTDIV0_RAISES_SIGFPE +# include +#endif + +#if defined HAVE_SYS_PARAM_H || defined _LIBC +# include +#endif + +#include "gettextP.h" +#include "plural-exp.h" +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif +#include "hash-string.h" + +/* Thread safetyness. */ +#ifdef _LIBC +# include +#else +/* Provide dummy implementation if this is outside glibc. */ +# define __libc_lock_define_initialized(CLASS, NAME) +# define __libc_lock_lock(NAME) +# define __libc_lock_unlock(NAME) +# define __libc_rwlock_define_initialized(CLASS, NAME) +# define __libc_rwlock_rdlock(NAME) +# define __libc_rwlock_unlock(NAME) +#endif + +/* Alignment of types. */ +#if defined __GNUC__ && __GNUC__ >= 2 +# define alignof(TYPE) __alignof__ (TYPE) +#else +# define alignof(TYPE) \ + ((int) &((struct { char dummy1; TYPE dummy2; } *) 0)->dummy2) +#endif + +/* The internal variables in the standalone libintl.a must have different + names than the internal variables in GNU libc, otherwise programs + using libintl.a cannot be linked statically. */ +#if !defined _LIBC +# define _nl_default_default_domain libintl_nl_default_default_domain +# define _nl_current_default_domain libintl_nl_current_default_domain +# define _nl_default_dirname libintl_nl_default_dirname +# define _nl_domain_bindings libintl_nl_domain_bindings +#endif + +/* Some compilers, like SunOS4 cc, don't have offsetof in . */ +#ifndef offsetof +# define offsetof(type,ident) ((size_t)&(((type*)0)->ident)) +#endif + +/* @@ end of prolog @@ */ + +#if defined (SHELL) && !defined (HAVE_GETCWD) +# define HAVE_GETCWD +#endif + +#ifdef _LIBC +/* Rename the non ANSI C functions. This is required by the standard + because some ANSI C functions will require linking with this object + file and the name space must not be polluted. */ +# define getcwd __getcwd +# ifndef stpcpy +# define stpcpy __stpcpy +# endif +# define tfind __tfind +#else +# if !defined HAVE_GETCWD +char *getwd (); +# define getcwd(buf, max) getwd (buf) +# else +char *getcwd (); +# endif +# ifndef HAVE_STPCPY +static char *stpcpy PARAMS ((char *dest, const char *src)); +# endif +# ifndef HAVE_MEMPCPY +static void *mempcpy PARAMS ((void *dest, const void *src, size_t n)); +# endif +#endif + +/* Amount to increase buffer size by in each try. */ +#define PATH_INCR 32 + +/* The following is from pathmax.h. */ +/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define + PATH_MAX but might cause redefinition warnings when sys/param.h is + later included (as on MORE/BSD 4.3). */ +#if defined _POSIX_VERSION || (defined HAVE_LIMITS_H && !defined __GNUC__) +# include +#endif + +#ifndef _POSIX_PATH_MAX +# define _POSIX_PATH_MAX 255 +#endif + +#if !defined PATH_MAX && defined _PC_PATH_MAX +# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX)) +#endif + +/* Don't include sys/param.h if it already has been. */ +#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN +# include +#endif + +#if !defined PATH_MAX && defined MAXPATHLEN +# define PATH_MAX MAXPATHLEN +#endif + +#ifndef PATH_MAX +# define PATH_MAX _POSIX_PATH_MAX +#endif + +/* Pathname support. + ISSLASH(C) tests whether C is a directory separator character. + IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not, + it may be concatenated to a directory pathname. + IS_PATH_WITH_DIR(P) tests whether P contains a directory specification. + */ +#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ + /* Win32, OS/2, DOS */ +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +# define HAS_DEVICE(P) \ + ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ + && (P)[1] == ':') +# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P)) +# define IS_PATH_WITH_DIR(P) \ + (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P)) +#else + /* Unix */ +# define ISSLASH(C) ((C) == '/') +# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0]) +# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL) +#endif + +/* This is the type used for the search tree where known translations + are stored. */ +struct known_translation_t +{ + /* Domain in which to search. */ + char *domainname; + + /* The category. */ + int category; + + /* State of the catalog counter at the point the string was found. */ + int counter; + + /* Catalog where the string was found. */ + struct loaded_l10nfile *domain; + + /* And finally the translation. */ + const char *translation; + size_t translation_length; + + /* Pointer to the string in question. */ + char msgid[ZERO]; +}; + +/* Root of the search tree with known translations. We can use this + only if the system provides the `tsearch' function family. */ +#if defined HAVE_TSEARCH || defined _LIBC +# include + +static void *root; + +# ifdef _LIBC +# define tsearch __tsearch +# endif + +/* Function to compare two entries in the table of known translations. */ +static int transcmp PARAMS ((const void *p1, const void *p2)); +static int +transcmp (p1, p2) + const void *p1; + const void *p2; +{ + const struct known_translation_t *s1; + const struct known_translation_t *s2; + int result; + + s1 = (const struct known_translation_t *) p1; + s2 = (const struct known_translation_t *) p2; + + result = strcmp (s1->msgid, s2->msgid); + if (result == 0) + { + result = strcmp (s1->domainname, s2->domainname); + if (result == 0) + /* We compare the category last (though this is the cheapest + operation) since it is hopefully always the same (namely + LC_MESSAGES). */ + result = s1->category - s2->category; + } + + return result; +} +#endif + +#ifndef INTVARDEF +# define INTVARDEF(name) +#endif +#ifndef INTUSE +# define INTUSE(name) name +#endif + +/* Name of the default domain used for gettext(3) prior any call to + textdomain(3). The default value for this is "messages". */ +const char _nl_default_default_domain[] attribute_hidden = "messages"; + +/* Value used as the default domain for gettext(3). */ +const char *_nl_current_default_domain attribute_hidden + = _nl_default_default_domain; + +/* Contains the default location of the message catalogs. */ +#if defined __EMX__ +extern const char _nl_default_dirname[]; +#else +const char _nl_default_dirname[] = LOCALEDIR; +INTVARDEF (_nl_default_dirname) +#endif + +/* List with bindings of specific domains created by bindtextdomain() + calls. */ +struct binding *_nl_domain_bindings; + +/* Prototypes for local functions. */ +static char *plural_lookup PARAMS ((struct loaded_l10nfile *domain, + unsigned long int n, + const char *translation, + size_t translation_len)) + internal_function; +static const char *guess_category_value PARAMS ((int category, + const char *categoryname)) + internal_function; +#ifdef _LIBC +# include "../locale/localeinfo.h" +# define category_to_name(category) _nl_category_names[category] +#else +static const char *category_to_name PARAMS ((int category)) internal_function; +#endif + + +/* For those loosing systems which don't have `alloca' we have to add + some additional code emulating it. */ +#ifdef HAVE_ALLOCA +/* Nothing has to be done. */ +# define freea(p) /* nothing */ +# define ADD_BLOCK(list, address) /* nothing */ +# define FREE_BLOCKS(list) /* nothing */ +#else +struct block_list +{ + void *address; + struct block_list *next; +}; +# define ADD_BLOCK(list, addr) \ + do { \ + struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \ + /* If we cannot get a free block we cannot add the new element to \ + the list. */ \ + if (newp != NULL) { \ + newp->address = (addr); \ + newp->next = (list); \ + (list) = newp; \ + } \ + } while (0) +# define FREE_BLOCKS(list) \ + do { \ + while (list != NULL) { \ + struct block_list *old = list; \ + list = list->next; \ + free (old->address); \ + free (old); \ + } \ + } while (0) +# undef alloca +# define alloca(size) (malloc (size)) +# define freea(p) free (p) +#endif /* have alloca */ + + +#ifdef _LIBC +/* List of blocks allocated for translations. */ +typedef struct transmem_list +{ + struct transmem_list *next; + char data[ZERO]; +} transmem_block_t; +static struct transmem_list *transmem_list; +#else +typedef unsigned char transmem_block_t; +#endif + + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define DCIGETTEXT __dcigettext +#else +# define DCIGETTEXT libintl_dcigettext +#endif + +/* Lock variable to protect the global data in the gettext implementation. */ +#ifdef _LIBC +__libc_rwlock_define_initialized (, _nl_state_lock attribute_hidden) +#endif + +/* Checking whether the binaries runs SUID must be done and glibc provides + easier methods therefore we make a difference here. */ +#ifdef _LIBC +# define ENABLE_SECURE __libc_enable_secure +# define DETERMINE_SECURE +#else +# ifndef HAVE_GETUID +# define getuid() 0 +# endif +# ifndef HAVE_GETGID +# define getgid() 0 +# endif +# ifndef HAVE_GETEUID +# define geteuid() getuid() +# endif +# ifndef HAVE_GETEGID +# define getegid() getgid() +# endif +static int enable_secure; +# define ENABLE_SECURE (enable_secure == 1) +# define DETERMINE_SECURE \ + if (enable_secure == 0) \ + { \ + if (getuid () != geteuid () || getgid () != getegid ()) \ + enable_secure = 1; \ + else \ + enable_secure = -1; \ + } +#endif + +#ifndef HAVE_RAISE +# define raise(x) kill (getpid (), (x)) +#endif + +/* Get the function to evaluate the plural expression. */ +#include "eval-plural.h" + +/* Look up MSGID in the DOMAINNAME message catalog for the current + CATEGORY locale and, if PLURAL is nonzero, search over string + depending on the plural form determined by N. */ +char * +DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category) + const char *domainname; + const char *msgid1; + const char *msgid2; + int plural; + unsigned long int n; + int category; +{ +#ifndef HAVE_ALLOCA + struct block_list *block_list = NULL; +#endif + struct loaded_l10nfile *domain; + struct binding *binding; + const char *categoryname; + const char *categoryvalue; + char *dirname, *xdomainname; + char *single_locale; + char *retval; + size_t retlen; + int saved_errno; +#if defined HAVE_TSEARCH || defined _LIBC + struct known_translation_t *search; + struct known_translation_t **foundp = NULL; + size_t msgid_len; +#endif + size_t domainname_len; + + /* If no real MSGID is given return NULL. */ + if (msgid1 == NULL) + return NULL; + +#ifdef _LIBC + if (category < 0 || category >= __LC_LAST || category == LC_ALL) + /* Bogus. */ + return (plural == 0 + ? (char *) msgid1 + /* Use the Germanic plural rule. */ + : n == 1 ? (char *) msgid1 : (char *) msgid2); +#endif + + __libc_rwlock_rdlock (_nl_state_lock); + + /* If DOMAINNAME is NULL, we are interested in the default domain. If + CATEGORY is not LC_MESSAGES this might not make much sense but the + definition left this undefined. */ + if (domainname == NULL) + domainname = _nl_current_default_domain; + + /* OS/2 specific: backward compatibility with older libintl versions */ +#ifdef LC_MESSAGES_COMPAT + if (category == LC_MESSAGES_COMPAT) + category = LC_MESSAGES; +#endif + +#if defined HAVE_TSEARCH || defined _LIBC + msgid_len = strlen (msgid1) + 1; + + /* Try to find the translation among those which we found at + some time. */ + search = (struct known_translation_t *) + alloca (offsetof (struct known_translation_t, msgid) + msgid_len); + memcpy (search->msgid, msgid1, msgid_len); + search->domainname = (char *) domainname; + search->category = category; + + foundp = (struct known_translation_t **) tfind (search, &root, transcmp); + freea (search); + if (foundp != NULL && (*foundp)->counter == _nl_msg_cat_cntr) + { + /* Now deal with plural. */ + if (plural) + retval = plural_lookup ((*foundp)->domain, n, (*foundp)->translation, + (*foundp)->translation_length); + else + retval = (char *) (*foundp)->translation; + + __libc_rwlock_unlock (_nl_state_lock); + return retval; + } +#endif + + /* Preserve the `errno' value. */ + saved_errno = errno; + + /* See whether this is a SUID binary or not. */ + DETERMINE_SECURE; + + /* First find matching binding. */ + for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) + { + int compare = strcmp (domainname, binding->domainname); + if (compare == 0) + /* We found it! */ + break; + if (compare < 0) + { + /* It is not in the list. */ + binding = NULL; + break; + } + } + + if (binding == NULL) + dirname = (char *) INTUSE(_nl_default_dirname); + else if (IS_ABSOLUTE_PATH (binding->dirname)) + dirname = binding->dirname; + else + { + /* We have a relative path. Make it absolute now. */ + size_t dirname_len = strlen (binding->dirname) + 1; + size_t path_max; + char *ret; + + path_max = (unsigned int) PATH_MAX; + path_max += 2; /* The getcwd docs say to do this. */ + + for (;;) + { + dirname = (char *) alloca (path_max + dirname_len); + ADD_BLOCK (block_list, dirname); + + __set_errno (0); + ret = getcwd (dirname, path_max); + if (ret != NULL || errno != ERANGE) + break; + + path_max += path_max / 2; + path_max += PATH_INCR; + } + + if (ret == NULL) + /* We cannot get the current working directory. Don't signal an + error but simply return the default string. */ + goto return_untranslated; + + stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname); + } + + /* Now determine the symbolic name of CATEGORY and its value. */ + categoryname = category_to_name (category); + categoryvalue = guess_category_value (category, categoryname); + + domainname_len = strlen (domainname); + xdomainname = (char *) alloca (strlen (categoryname) + + domainname_len + 5); + ADD_BLOCK (block_list, xdomainname); + + stpcpy (mempcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"), + domainname, domainname_len), + ".mo"); + + /* Creating working area. */ + single_locale = (char *) alloca (strlen (categoryvalue) + 1); + ADD_BLOCK (block_list, single_locale); + + + /* Search for the given string. This is a loop because we perhaps + got an ordered list of languages to consider for the translation. */ + while (1) + { + /* Make CATEGORYVALUE point to the next element of the list. */ + while (categoryvalue[0] != '\0' && categoryvalue[0] == ':') + ++categoryvalue; + if (categoryvalue[0] == '\0') + { + /* The whole contents of CATEGORYVALUE has been searched but + no valid entry has been found. We solve this situation + by implicitly appending a "C" entry, i.e. no translation + will take place. */ + single_locale[0] = 'C'; + single_locale[1] = '\0'; + } + else + { + char *cp = single_locale; + while (categoryvalue[0] != '\0' && categoryvalue[0] != ':') + *cp++ = *categoryvalue++; + *cp = '\0'; + + /* When this is a SUID binary we must not allow accessing files + outside the dedicated directories. */ + if (ENABLE_SECURE && IS_PATH_WITH_DIR (single_locale)) + /* Ingore this entry. */ + continue; + } + + /* If the current locale value is C (or POSIX) we don't load a + domain. Return the MSGID. */ + if (strcmp (single_locale, "C") == 0 + || strcmp (single_locale, "POSIX") == 0) + break; + + /* Find structure describing the message catalog matching the + DOMAINNAME and CATEGORY. */ + domain = _nl_find_domain (dirname, single_locale, xdomainname, binding); + + if (domain != NULL) + { + retval = _nl_find_msg (domain, binding, msgid1, &retlen); + + if (retval == NULL) + { + int cnt; + + for (cnt = 0; domain->successor[cnt] != NULL; ++cnt) + { + retval = _nl_find_msg (domain->successor[cnt], binding, + msgid1, &retlen); + + if (retval != NULL) + { + domain = domain->successor[cnt]; + break; + } + } + } + + if (retval != NULL) + { + /* Found the translation of MSGID1 in domain DOMAIN: + starting at RETVAL, RETLEN bytes. */ + FREE_BLOCKS (block_list); +#if defined HAVE_TSEARCH || defined _LIBC + if (foundp == NULL) + { + /* Create a new entry and add it to the search tree. */ + struct known_translation_t *newp; + + newp = (struct known_translation_t *) + malloc (offsetof (struct known_translation_t, msgid) + + msgid_len + domainname_len + 1); + if (newp != NULL) + { + newp->domainname = + mempcpy (newp->msgid, msgid1, msgid_len); + memcpy (newp->domainname, domainname, domainname_len + 1); + newp->category = category; + newp->counter = _nl_msg_cat_cntr; + newp->domain = domain; + newp->translation = retval; + newp->translation_length = retlen; + + /* Insert the entry in the search tree. */ + foundp = (struct known_translation_t **) + tsearch (newp, &root, transcmp); + if (foundp == NULL + || __builtin_expect (*foundp != newp, 0)) + /* The insert failed. */ + free (newp); + } + } + else + { + /* We can update the existing entry. */ + (*foundp)->counter = _nl_msg_cat_cntr; + (*foundp)->domain = domain; + (*foundp)->translation = retval; + (*foundp)->translation_length = retlen; + } +#endif + __set_errno (saved_errno); + + /* Now deal with plural. */ + if (plural) + retval = plural_lookup (domain, n, retval, retlen); + + __libc_rwlock_unlock (_nl_state_lock); + return retval; + } + } + } + + return_untranslated: + /* Return the untranslated MSGID. */ + FREE_BLOCKS (block_list); + __libc_rwlock_unlock (_nl_state_lock); +#ifndef _LIBC + if (!ENABLE_SECURE) + { + extern void _nl_log_untranslated PARAMS ((const char *logfilename, + const char *domainname, + const char *msgid1, + const char *msgid2, + int plural)); + const char *logfilename = getenv ("GETTEXT_LOG_UNTRANSLATED"); + + if (logfilename != NULL && logfilename[0] != '\0') + _nl_log_untranslated (logfilename, domainname, msgid1, msgid2, plural); + } +#endif + __set_errno (saved_errno); + return (plural == 0 + ? (char *) msgid1 + /* Use the Germanic plural rule. */ + : n == 1 ? (char *) msgid1 : (char *) msgid2); +} + + +char * +internal_function +_nl_find_msg (domain_file, domainbinding, msgid, lengthp) + struct loaded_l10nfile *domain_file; + struct binding *domainbinding; + const char *msgid; + size_t *lengthp; +{ + struct loaded_domain *domain; + nls_uint32 nstrings; + size_t act; + char *result; + size_t resultlen; + + if (domain_file->decided == 0) + _nl_load_domain (domain_file, domainbinding); + + if (domain_file->data == NULL) + return NULL; + + domain = (struct loaded_domain *) domain_file->data; + + nstrings = domain->nstrings; + + /* Locate the MSGID and its translation. */ + if (domain->hash_tab != NULL) + { + /* Use the hashing table. */ + nls_uint32 len = strlen (msgid); + nls_uint32 hash_val = hash_string (msgid); + nls_uint32 idx = hash_val % domain->hash_size; + nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2)); + + while (1) + { + nls_uint32 nstr = + W (domain->must_swap_hash_tab, domain->hash_tab[idx]); + + if (nstr == 0) + /* Hash table entry is empty. */ + return NULL; + + nstr--; + + /* Compare msgid with the original string at index nstr. + We compare the lengths with >=, not ==, because plural entries + are represented by strings with an embedded NUL. */ + if (nstr < nstrings + ? W (domain->must_swap, domain->orig_tab[nstr].length) >= len + && (strcmp (msgid, + domain->data + W (domain->must_swap, + domain->orig_tab[nstr].offset)) + == 0) + : domain->orig_sysdep_tab[nstr - nstrings].length > len + && (strcmp (msgid, + domain->orig_sysdep_tab[nstr - nstrings].pointer) + == 0)) + { + act = nstr; + goto found; + } + + if (idx >= domain->hash_size - incr) + idx -= domain->hash_size - incr; + else + idx += incr; + } + /* NOTREACHED */ + } + else + { + /* Try the default method: binary search in the sorted array of + messages. */ + size_t top, bottom; + + bottom = 0; + top = nstrings; + while (bottom < top) + { + int cmp_val; + + act = (bottom + top) / 2; + cmp_val = strcmp (msgid, (domain->data + + W (domain->must_swap, + domain->orig_tab[act].offset))); + if (cmp_val < 0) + top = act; + else if (cmp_val > 0) + bottom = act + 1; + else + goto found; + } + /* No translation was found. */ + return NULL; + } + + found: + /* The translation was found at index ACT. If we have to convert the + string to use a different character set, this is the time. */ + if (act < nstrings) + { + result = (char *) + (domain->data + W (domain->must_swap, domain->trans_tab[act].offset)); + resultlen = W (domain->must_swap, domain->trans_tab[act].length) + 1; + } + else + { + result = (char *) domain->trans_sysdep_tab[act - nstrings].pointer; + resultlen = domain->trans_sysdep_tab[act - nstrings].length; + } + +#if defined _LIBC || HAVE_ICONV + if (domain->codeset_cntr + != (domainbinding != NULL ? domainbinding->codeset_cntr : 0)) + { + /* The domain's codeset has changed through bind_textdomain_codeset() + since the message catalog was initialized or last accessed. We + have to reinitialize the converter. */ + _nl_free_domain_conv (domain); + _nl_init_domain_conv (domain_file, domain, domainbinding); + } + + if ( +# ifdef _LIBC + domain->conv != (__gconv_t) -1 +# else +# if HAVE_ICONV + domain->conv != (iconv_t) -1 +# endif +# endif + ) + { + /* We are supposed to do a conversion. First allocate an + appropriate table with the same structure as the table + of translations in the file, where we can put the pointers + to the converted strings in. + There is a slight complication with plural entries. They + are represented by consecutive NUL terminated strings. We + handle this case by converting RESULTLEN bytes, including + NULs. */ + + if (domain->conv_tab == NULL + && ((domain->conv_tab = + (char **) calloc (nstrings + domain->n_sysdep_strings, + sizeof (char *))) + == NULL)) + /* Mark that we didn't succeed allocating a table. */ + domain->conv_tab = (char **) -1; + + if (__builtin_expect (domain->conv_tab == (char **) -1, 0)) + /* Nothing we can do, no more memory. */ + goto converted; + + if (domain->conv_tab[act] == NULL) + { + /* We haven't used this string so far, so it is not + translated yet. Do this now. */ + /* We use a bit more efficient memory handling. + We allocate always larger blocks which get used over + time. This is faster than many small allocations. */ + __libc_lock_define_initialized (static, lock) +# define INITIAL_BLOCK_SIZE 4080 + static unsigned char *freemem; + static size_t freemem_size; + + const unsigned char *inbuf; + unsigned char *outbuf; + int malloc_count; +# ifndef _LIBC + transmem_block_t *transmem_list = NULL; +# endif + + __libc_lock_lock (lock); + + inbuf = (const unsigned char *) result; + outbuf = freemem + sizeof (size_t); + + malloc_count = 0; + while (1) + { + transmem_block_t *newmem; +# ifdef _LIBC + size_t non_reversible; + int res; + + if (freemem_size < sizeof (size_t)) + goto resize_freemem; + + res = __gconv (domain->conv, + &inbuf, inbuf + resultlen, + &outbuf, + outbuf + freemem_size - sizeof (size_t), + &non_reversible); + + if (res == __GCONV_OK || res == __GCONV_EMPTY_INPUT) + break; + + if (res != __GCONV_FULL_OUTPUT) + { + __libc_lock_unlock (lock); + goto converted; + } + + inbuf = result; +# else +# if HAVE_ICONV + const char *inptr = (const char *) inbuf; + size_t inleft = resultlen; + char *outptr = (char *) outbuf; + size_t outleft; + + if (freemem_size < sizeof (size_t)) + goto resize_freemem; + + outleft = freemem_size - sizeof (size_t); + if (iconv (domain->conv, + (ICONV_CONST char **) &inptr, &inleft, + &outptr, &outleft) + != (size_t) (-1)) + { + outbuf = (unsigned char *) outptr; + break; + } + if (errno != E2BIG) + { + __libc_lock_unlock (lock); + goto converted; + } +# endif +# endif + + resize_freemem: + /* We must allocate a new buffer or resize the old one. */ + if (malloc_count > 0) + { + ++malloc_count; + freemem_size = malloc_count * INITIAL_BLOCK_SIZE; + newmem = (transmem_block_t *) realloc (transmem_list, + freemem_size); +# ifdef _LIBC + if (newmem != NULL) + transmem_list = transmem_list->next; + else + { + struct transmem_list *old = transmem_list; + + transmem_list = transmem_list->next; + free (old); + } +# endif + } + else + { + malloc_count = 1; + freemem_size = INITIAL_BLOCK_SIZE; + newmem = (transmem_block_t *) malloc (freemem_size); + } + if (__builtin_expect (newmem == NULL, 0)) + { + freemem = NULL; + freemem_size = 0; + __libc_lock_unlock (lock); + goto converted; + } + +# ifdef _LIBC + /* Add the block to the list of blocks we have to free + at some point. */ + newmem->next = transmem_list; + transmem_list = newmem; + + freemem = newmem->data; + freemem_size -= offsetof (struct transmem_list, data); +# else + transmem_list = newmem; + freemem = newmem; +# endif + + outbuf = freemem + sizeof (size_t); + } + + /* We have now in our buffer a converted string. Put this + into the table of conversions. */ + *(size_t *) freemem = outbuf - freemem - sizeof (size_t); + domain->conv_tab[act] = (char *) freemem; + /* Shrink freemem, but keep it aligned. */ + freemem_size -= outbuf - freemem; + freemem = outbuf; + freemem += freemem_size & (alignof (size_t) - 1); + freemem_size = freemem_size & ~ (alignof (size_t) - 1); + + __libc_lock_unlock (lock); + } + + /* Now domain->conv_tab[act] contains the translation of all + the plural variants. */ + result = domain->conv_tab[act] + sizeof (size_t); + resultlen = *(size_t *) domain->conv_tab[act]; + } + + converted: + /* The result string is converted. */ + +#endif /* _LIBC || HAVE_ICONV */ + + *lengthp = resultlen; + return result; +} + + +/* Look up a plural variant. */ +static char * +internal_function +plural_lookup (domain, n, translation, translation_len) + struct loaded_l10nfile *domain; + unsigned long int n; + const char *translation; + size_t translation_len; +{ + struct loaded_domain *domaindata = (struct loaded_domain *) domain->data; + unsigned long int index; + const char *p; + + index = plural_eval (domaindata->plural, n); + if (index >= domaindata->nplurals) + /* This should never happen. It means the plural expression and the + given maximum value do not match. */ + index = 0; + + /* Skip INDEX strings at TRANSLATION. */ + p = translation; + while (index-- > 0) + { +#ifdef _LIBC + p = __rawmemchr (p, '\0'); +#else + p = strchr (p, '\0'); +#endif + /* And skip over the NUL byte. */ + p++; + + if (p >= translation + translation_len) + /* This should never happen. It means the plural expression + evaluated to a value larger than the number of variants + available for MSGID1. */ + return (char *) translation; + } + return (char *) p; +} + +#ifndef _LIBC +/* Return string representation of locale CATEGORY. */ +static const char * +internal_function +category_to_name (category) + int category; +{ + const char *retval; + + switch (category) + { +#ifdef LC_COLLATE + case LC_COLLATE: + retval = "LC_COLLATE"; + break; +#endif +#ifdef LC_CTYPE + case LC_CTYPE: + retval = "LC_CTYPE"; + break; +#endif +#ifdef LC_MONETARY + case LC_MONETARY: + retval = "LC_MONETARY"; + break; +#endif +#ifdef LC_NUMERIC + case LC_NUMERIC: + retval = "LC_NUMERIC"; + break; +#endif +#ifdef LC_TIME + case LC_TIME: + retval = "LC_TIME"; + break; +#endif +#ifdef LC_MESSAGES + case LC_MESSAGES: + retval = "LC_MESSAGES"; + break; +#endif +#ifdef LC_RESPONSE + case LC_RESPONSE: + retval = "LC_RESPONSE"; + break; +#endif +#ifdef LC_ALL + case LC_ALL: + /* This might not make sense but is perhaps better than any other + value. */ + retval = "LC_ALL"; + break; +#endif + default: + /* If you have a better idea for a default value let me know. */ + retval = "LC_XXX"; + } + + return retval; +} +#endif + +/* Guess value of current locale from value of the environment variables. */ +static const char * +internal_function +guess_category_value (category, categoryname) + int category; + const char *categoryname; +{ + const char *language; + const char *retval; + + /* The highest priority value is the `LANGUAGE' environment + variable. But we don't use the value if the currently selected + locale is the C locale. This is a GNU extension. */ + language = getenv ("LANGUAGE"); + if (language != NULL && language[0] == '\0') + language = NULL; + + /* We have to proceed with the POSIX methods of looking to `LC_ALL', + `LC_xxx', and `LANG'. On some systems this can be done by the + `setlocale' function itself. */ +#ifdef _LIBC + retval = __current_locale_name (category); +#else + retval = _nl_locale_name (category, categoryname); +#endif + + /* Ignore LANGUAGE if the locale is set to "C" because + 1. "C" locale usually uses the ASCII encoding, and most international + messages use non-ASCII characters. These characters get displayed + as question marks (if using glibc's iconv()) or as invalid 8-bit + characters (because other iconv()s refuse to convert most non-ASCII + characters to ASCII). In any case, the output is ugly. + 2. The precise output of some programs in the "C" locale is specified + by POSIX and should not depend on environment variables like + "LANGUAGE". We allow such programs to use gettext(). */ + return language != NULL && strcmp (retval, "C") != 0 ? language : retval; +} + +/* @@ begin of epilog @@ */ + +/* We don't want libintl.a to depend on any other library. So we + avoid the non-standard function stpcpy. In GNU C Library this + function is available, though. Also allow the symbol HAVE_STPCPY + to be defined. */ +#if !_LIBC && !HAVE_STPCPY +static char * +stpcpy (dest, src) + char *dest; + const char *src; +{ + while ((*dest++ = *src++) != '\0') + /* Do nothing. */ ; + return dest - 1; +} +#endif + +#if !_LIBC && !HAVE_MEMPCPY +static void * +mempcpy (dest, src, n) + void *dest; + const void *src; + size_t n; +{ + return (void *) ((char *) memcpy (dest, src, n) + n); +} +#endif + + +#ifdef _LIBC +/* If we want to free all resources we have to do some work at + program's end. */ +libc_freeres_fn (free_mem) +{ + void *old; + + while (_nl_domain_bindings != NULL) + { + struct binding *oldp = _nl_domain_bindings; + _nl_domain_bindings = _nl_domain_bindings->next; + if (oldp->dirname != INTUSE(_nl_default_dirname)) + /* Yes, this is a pointer comparison. */ + free (oldp->dirname); + free (oldp->codeset); + free (oldp); + } + + if (_nl_current_default_domain != _nl_default_default_domain) + /* Yes, again a pointer comparison. */ + free ((char *) _nl_current_default_domain); + + /* Remove the search tree with the known translations. */ + __tdestroy (root, free); + root = NULL; + + while (transmem_list != NULL) + { + old = transmem_list; + transmem_list = transmem_list->next; + free (old); + } +} +#endif diff --git a/lib/intl/dcngettext.c b/lib/intl/dcngettext.c new file mode 100644 index 0000000..3d70b18 --- /dev/null +++ b/lib/intl/dcngettext.c @@ -0,0 +1,62 @@ +/* dcngettext.c - Implementation of the dcngettext(3) function. */ + +/* Copyright (C) 1995-1999, 2000, 2001, 2002, 2006-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "gettextP.h" +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif + +/* @@ end of prolog @@ */ + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define DCNGETTEXT __dcngettext +# define DCIGETTEXT __dcigettext +#else +# define DCNGETTEXT libintl_dcngettext +# define DCIGETTEXT libintl_dcigettext +#endif + +/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY + locale. */ +char * +DCNGETTEXT (domainname, msgid1, msgid2, n, category) + const char *domainname; + const char *msgid1; + const char *msgid2; + unsigned long int n; + int category; +{ + return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category); +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__dcngettext, dcngettext); +#endif diff --git a/lib/intl/dgettext.c b/lib/intl/dgettext.c new file mode 100644 index 0000000..5351631 --- /dev/null +++ b/lib/intl/dgettext.c @@ -0,0 +1,61 @@ +/* dgettext.c - Implementation of the dgettext(3) function. */ + +/* Copyright (C) 1995-1997, 2000, 2001, 2002, 2006-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#include "gettextP.h" +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif + +/* @@ end of prolog @@ */ + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define DGETTEXT __dgettext +# define DCGETTEXT INTUSE(__dcgettext) +#else +# define DGETTEXT libintl_dgettext +# define DCGETTEXT libintl_dcgettext +#endif + +/* Look up MSGID in the DOMAINNAME message catalog of the current + LC_MESSAGES locale. */ +char * +DGETTEXT (domainname, msgid) + const char *domainname; + const char *msgid; +{ + return DCGETTEXT (domainname, msgid, LC_MESSAGES); +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__dgettext, dgettext); +#endif diff --git a/lib/intl/dngettext.c b/lib/intl/dngettext.c new file mode 100644 index 0000000..4276f3b --- /dev/null +++ b/lib/intl/dngettext.c @@ -0,0 +1,63 @@ +/* dngettext.c - Implementation of the dngettext(3) function. */ + +/* Copyright (C) 1995-1997, 2000, 2001, 2002, 2005, 2006, 2008,2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#include "gettextP.h" +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif + +/* @@ end of prolog @@ */ + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define DNGETTEXT __dngettext +# define DCNGETTEXT __dcngettext +#else +# define DNGETTEXT libintl_dngettext +# define DCNGETTEXT libintl_dcngettext +#endif + +/* Look up MSGID in the DOMAINNAME message catalog of the current + LC_MESSAGES locale and skip message according to the plural form. */ +char * +DNGETTEXT (domainname, msgid1, msgid2, n) + const char *domainname; + const char *msgid1; + const char *msgid2; + unsigned long int n; +{ + return DCNGETTEXT (domainname, msgid1, msgid2, n, LC_MESSAGES); +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__dngettext, dngettext); +#endif diff --git a/lib/intl/eval-plural.h b/lib/intl/eval-plural.h new file mode 100644 index 0000000..3441c74 --- /dev/null +++ b/lib/intl/eval-plural.h @@ -0,0 +1,116 @@ +/* eval-plural.c - Plural expression evaluation. */ + +/* Copyright (C) 2000-2002, 2006-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef STATIC +#define STATIC static +#endif + +/* Evaluate the plural expression and return an index value. */ +STATIC unsigned long int plural_eval PARAMS ((struct expression *pexp, + unsigned long int n)) + internal_function; + +STATIC +unsigned long int +internal_function +plural_eval (pexp, n) + struct expression *pexp; + unsigned long int n; +{ + switch (pexp->nargs) + { + case 0: + switch (pexp->operation) + { + case var: + return n; + case num: + return pexp->val.num; + default: + break; + } + /* NOTREACHED */ + break; + case 1: + { + /* pexp->operation must be lnot. */ + unsigned long int arg = plural_eval (pexp->val.args[0], n); + return ! arg; + } + case 2: + { + unsigned long int leftarg = plural_eval (pexp->val.args[0], n); + if (pexp->operation == lor) + return leftarg || plural_eval (pexp->val.args[1], n); + else if (pexp->operation == land) + return leftarg && plural_eval (pexp->val.args[1], n); + else + { + unsigned long int rightarg = plural_eval (pexp->val.args[1], n); + + switch (pexp->operation) + { + case mult: + return leftarg * rightarg; + case divide: +#if !INTDIV0_RAISES_SIGFPE + if (rightarg == 0) + raise (SIGFPE); +#endif + return leftarg / rightarg; + case module: +#if !INTDIV0_RAISES_SIGFPE + if (rightarg == 0) + raise (SIGFPE); +#endif + return leftarg % rightarg; + case plus: + return leftarg + rightarg; + case minus: + return leftarg - rightarg; + case less_than: + return leftarg < rightarg; + case greater_than: + return leftarg > rightarg; + case less_or_equal: + return leftarg <= rightarg; + case greater_or_equal: + return leftarg >= rightarg; + case equal: + return leftarg == rightarg; + case not_equal: + return leftarg != rightarg; + default: + break; + } + } + /* NOTREACHED */ + break; + } + case 3: + { + /* pexp->operation must be qmop. */ + unsigned long int boolarg = plural_eval (pexp->val.args[0], n); + return plural_eval (pexp->val.args[boolarg ? 1 : 2], n); + } + } + /* NOTREACHED */ + return 0; +} diff --git a/lib/intl/explodename.c b/lib/intl/explodename.c new file mode 100644 index 0000000..adc3640 --- /dev/null +++ b/lib/intl/explodename.c @@ -0,0 +1,195 @@ +/* explodename.c */ + +/* Copyright (C) 1995-1998, 2000, 2001, 2005-2009 Free Software Foundation, Inc. + Contributed by Ulrich Drepper , 1995. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +#include "loadinfo.h" + +/* On some strange systems still no definition of NULL is found. Sigh! */ +#ifndef NULL +# if defined __STDC__ && __STDC__ +# define NULL ((void *) 0) +# else +# define NULL 0 +# endif +#endif + +/* @@ end of prolog @@ */ + +char * +_nl_find_language (name) + const char *name; +{ + while (name[0] != '\0' && name[0] != '_' && name[0] != '@' + && name[0] != '+' && name[0] != ',') + ++name; + + return (char *) name; +} + + +int +_nl_explode_name (name, language, modifier, territory, codeset, + normalized_codeset, special, sponsor, revision) + char *name; + const char **language; + const char **modifier; + const char **territory; + const char **codeset; + const char **normalized_codeset; + const char **special; + const char **sponsor; + const char **revision; +{ + enum { undecided, xpg, cen } syntax; + char *cp; + int mask; + + *modifier = NULL; + *territory = NULL; + *codeset = NULL; + *normalized_codeset = NULL; + *special = NULL; + *sponsor = NULL; + *revision = NULL; + + /* Now we determine the single parts of the locale name. First + look for the language. Termination symbols are `_' and `@' if + we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */ + mask = 0; + syntax = undecided; + *language = cp = name; + cp = _nl_find_language (*language); + + if (*language == cp) + /* This does not make sense: language has to be specified. Use + this entry as it is without exploding. Perhaps it is an alias. */ + cp = strchr (*language, '\0'); + else if (cp[0] == '_') + { + /* Next is the territory. */ + cp[0] = '\0'; + *territory = ++cp; + + while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@' + && cp[0] != '+' && cp[0] != ',' && cp[0] != '_') + ++cp; + + mask |= TERRITORY; + + if (cp[0] == '.') + { + /* Next is the codeset. */ + syntax = xpg; + cp[0] = '\0'; + *codeset = ++cp; + + while (cp[0] != '\0' && cp[0] != '@') + ++cp; + + mask |= XPG_CODESET; + + if (*codeset != cp && (*codeset)[0] != '\0') + { + *normalized_codeset = _nl_normalize_codeset (*codeset, + cp - *codeset); + if (strcmp (*codeset, *normalized_codeset) == 0) + free ((char *) *normalized_codeset); + else + mask |= XPG_NORM_CODESET; + } + } + } + + if (cp[0] == '@' || (syntax != xpg && cp[0] == '+')) + { + /* Next is the modifier. */ + syntax = cp[0] == '@' ? xpg : cen; + cp[0] = '\0'; + *modifier = ++cp; + + while (syntax == cen && cp[0] != '\0' && cp[0] != '+' + && cp[0] != ',' && cp[0] != '_') + ++cp; + + mask |= XPG_MODIFIER | CEN_AUDIENCE; + } + + if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_')) + { + syntax = cen; + + if (cp[0] == '+') + { + /* Next is special application (CEN syntax). */ + cp[0] = '\0'; + *special = ++cp; + + while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_') + ++cp; + + mask |= CEN_SPECIAL; + } + + if (cp[0] == ',') + { + /* Next is sponsor (CEN syntax). */ + cp[0] = '\0'; + *sponsor = ++cp; + + while (cp[0] != '\0' && cp[0] != '_') + ++cp; + + mask |= CEN_SPONSOR; + } + + if (cp[0] == '_') + { + /* Next is revision (CEN syntax). */ + cp[0] = '\0'; + *revision = ++cp; + + mask |= CEN_REVISION; + } + } + + /* For CEN syntax values it might be important to have the + separator character in the file name, not for XPG syntax. */ + if (syntax == xpg) + { + if (*territory != NULL && (*territory)[0] == '\0') + mask &= ~TERRITORY; + + if (*codeset != NULL && (*codeset)[0] == '\0') + mask &= ~XPG_CODESET; + + if (*modifier != NULL && (*modifier)[0] == '\0') + mask &= ~XPG_MODIFIER; + } + + return mask; +} diff --git a/lib/intl/finddomain.c b/lib/intl/finddomain.c new file mode 100644 index 0000000..69a3586 --- /dev/null +++ b/lib/intl/finddomain.c @@ -0,0 +1,197 @@ +/* finddomain.c - Handle list of needed message catalogs */ + +/* Copyright (C) 1995-1999, 2000, 2001, 2005-2009 Free Software Foundation, Inc. + Written by Ulrich Drepper , 1995. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include + +#if defined HAVE_UNISTD_H || defined _LIBC +# include +#endif + +#include "gettextP.h" +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif + +/* @@ end of prolog @@ */ +/* List of already loaded domains. */ +static struct loaded_l10nfile *_nl_loaded_domains; + + +/* Return a data structure describing the message catalog described by + the DOMAINNAME and CATEGORY parameters with respect to the currently + established bindings. */ +struct loaded_l10nfile * +internal_function +_nl_find_domain (dirname, locale, domainname, domainbinding) + const char *dirname; + char *locale; + const char *domainname; + struct binding *domainbinding; +{ + struct loaded_l10nfile *retval; + const char *language; + const char *modifier; + const char *territory; + const char *codeset; + const char *normalized_codeset; + const char *special; + const char *sponsor; + const char *revision; + const char *alias_value; + int mask; + + /* LOCALE can consist of up to four recognized parts for the XPG syntax: + + language[_territory[.codeset]][@modifier] + + and six parts for the CEN syntax: + + language[_territory][+audience][+special][,[sponsor][_revision]] + + Beside the first part all of them are allowed to be missing. If + the full specified locale is not found, the less specific one are + looked for. The various parts will be stripped off according to + the following order: + (1) revision + (2) sponsor + (3) special + (4) codeset + (5) normalized codeset + (6) territory + (7) audience/modifier + */ + + /* If we have already tested for this locale entry there has to + be one data set in the list of loaded domains. */ + retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, + strlen (dirname) + 1, 0, locale, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, domainname, 0); + if (retval != NULL) + { + /* We know something about this locale. */ + int cnt; + + if (retval->decided == 0) + _nl_load_domain (retval, domainbinding); + + if (retval->data != NULL) + return retval; + + for (cnt = 0; retval->successor[cnt] != NULL; ++cnt) + { + if (retval->successor[cnt]->decided == 0) + _nl_load_domain (retval->successor[cnt], domainbinding); + + if (retval->successor[cnt]->data != NULL) + break; + } + return cnt >= 0 ? retval : NULL; + /* NOTREACHED */ + } + + /* See whether the locale value is an alias. If yes its value + *overwrites* the alias name. No test for the original value is + done. */ + alias_value = _nl_expand_alias (locale); + if (alias_value != NULL) + { +#if defined _LIBC || defined HAVE_STRDUP + locale = strdup (alias_value); + if (locale == NULL) + return NULL; +#else + size_t len = strlen (alias_value) + 1; + locale = (char *) malloc (len); + if (locale == NULL) + return NULL; + + memcpy (locale, alias_value, len); +#endif + } + + /* Now we determine the single parts of the locale name. First + look for the language. Termination symbols are `_' and `@' if + we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */ + mask = _nl_explode_name (locale, &language, &modifier, &territory, + &codeset, &normalized_codeset, &special, + &sponsor, &revision); + + /* Create all possible locale entries which might be interested in + generalization. */ + retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, + strlen (dirname) + 1, mask, language, territory, + codeset, normalized_codeset, modifier, special, + sponsor, revision, domainname, 1); + if (retval == NULL) + /* This means we are out of core. */ + return NULL; + + if (retval->decided == 0) + _nl_load_domain (retval, domainbinding); + if (retval->data == NULL) + { + int cnt; + for (cnt = 0; retval->successor[cnt] != NULL; ++cnt) + { + if (retval->successor[cnt]->decided == 0) + _nl_load_domain (retval->successor[cnt], domainbinding); + if (retval->successor[cnt]->data != NULL) + break; + } + } + + /* The room for an alias was dynamically allocated. Free it now. */ + if (alias_value != NULL) + free (locale); + + /* The space for normalized_codeset is dynamically allocated. Free it. */ + if (mask & XPG_NORM_CODESET) + free ((void *) normalized_codeset); + + return retval; +} + + +#ifdef _LIBC +libc_freeres_fn (free_mem) +{ + struct loaded_l10nfile *runp = _nl_loaded_domains; + + while (runp != NULL) + { + struct loaded_l10nfile *here = runp; + if (runp->data != NULL) + _nl_unload_domain ((struct loaded_domain *) runp->data); + runp = runp->next; + free ((char *) here->filename); + free (here); + } +} +#endif diff --git a/lib/intl/gettext.c b/lib/intl/gettext.c new file mode 100644 index 0000000..fd3fa0f --- /dev/null +++ b/lib/intl/gettext.c @@ -0,0 +1,66 @@ +/* gettext.c - Implementation of gettext(3) function. */ + +/* Copyright (C) 1995, 1997, 2000, 2001, 2002, 2005-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifdef _LIBC +# define __need_NULL +# include +#else +# include /* Just for NULL. */ +#endif + +#include "gettextP.h" +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif + +/* @@ end of prolog @@ */ + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define GETTEXT __gettext +# define DCGETTEXT INTUSE(__dcgettext) +#else +# define GETTEXT libintl_gettext +# define DCGETTEXT libintl_dcgettext +#endif + +/* Look up MSGID in the current default message catalog for the current + LC_MESSAGES locale. If not found, returns MSGID itself (the default + text). */ +char * +GETTEXT (msgid) + const char *msgid; +{ + return DCGETTEXT (NULL, msgid, LC_MESSAGES); +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__gettext, gettext); +#endif diff --git a/lib/intl/gettextP.h b/lib/intl/gettextP.h new file mode 100644 index 0000000..5c137e5 --- /dev/null +++ b/lib/intl/gettextP.h @@ -0,0 +1,226 @@ +/* gettextP.h - Header describing internals of libintl library. */ + +/* Copyright (C) 1995-1999, 2000-2003, 2005-2009 Free Software Foundation, Inc. + Written by Ulrich Drepper , 1995. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _GETTEXTP_H +#define _GETTEXTP_H + +#include /* Get size_t. */ + +#ifdef _LIBC +# include "../iconv/gconv_int.h" +#else +# if HAVE_ICONV +# include +# endif +#endif + +#include "loadinfo.h" + +#include "gmo.h" /* Get nls_uint32. */ + +/* @@ end of prolog @@ */ + +#ifndef PARAMS +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES +# define PARAMS(args) args +# else +# define PARAMS(args) () +# endif +#endif + +#ifndef internal_function +# define internal_function +#endif + +#ifndef attribute_hidden +# define attribute_hidden +#endif + +/* Tell the compiler when a conditional or integer expression is + almost always true or almost always false. */ +#ifndef HAVE_BUILTIN_EXPECT +# define __builtin_expect(expr, val) (expr) +#endif + +#ifndef W +# define W(flag, data) ((flag) ? SWAP (data) : (data)) +#endif + + +#ifdef _LIBC +# include +# define SWAP(i) bswap_32 (i) +#else +static inline nls_uint32 +SWAP (i) + nls_uint32 i; +{ + return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24); +} +#endif + + +/* In-memory representation of system dependent string. */ +struct sysdep_string_desc +{ + /* Length of addressed string, including the trailing NUL. */ + size_t length; + /* Pointer to addressed string. */ + const char *pointer; +}; + +/* The representation of an opened message catalog. */ +struct loaded_domain +{ + /* Pointer to memory containing the .mo file. */ + const char *data; + /* 1 if the memory is mmap()ed, 0 if the memory is malloc()ed. */ + int use_mmap; + /* Size of mmap()ed memory. */ + size_t mmap_size; + /* 1 if the .mo file uses a different endianness than this machine. */ + int must_swap; + /* Pointer to additional malloc()ed memory. */ + void *malloced; + + /* Number of static strings pairs. */ + nls_uint32 nstrings; + /* Pointer to descriptors of original strings in the file. */ + const struct string_desc *orig_tab; + /* Pointer to descriptors of translated strings in the file. */ + const struct string_desc *trans_tab; + + /* Number of system dependent strings pairs. */ + nls_uint32 n_sysdep_strings; + /* Pointer to descriptors of original sysdep strings. */ + const struct sysdep_string_desc *orig_sysdep_tab; + /* Pointer to descriptors of translated sysdep strings. */ + const struct sysdep_string_desc *trans_sysdep_tab; + + /* Size of hash table. */ + nls_uint32 hash_size; + /* Pointer to hash table. */ + const nls_uint32 *hash_tab; + /* 1 if the hash table uses a different endianness than this machine. */ + int must_swap_hash_tab; + + int codeset_cntr; +#ifdef _LIBC + __gconv_t conv; +#else +# if HAVE_ICONV + iconv_t conv; +# endif +#endif + char **conv_tab; + + struct expression *plural; + unsigned long int nplurals; +}; + +/* We want to allocate a string at the end of the struct. But ISO C + doesn't allow zero sized arrays. */ +#ifdef __GNUC__ +# define ZERO 0 +#else +# define ZERO 1 +#endif + +/* A set of settings bound to a message domain. Used to store settings + from bindtextdomain() and bind_textdomain_codeset(). */ +struct binding +{ + struct binding *next; + char *dirname; + int codeset_cntr; /* Incremented each time codeset changes. */ + char *codeset; + char domainname[ZERO]; +}; + +/* A counter which is incremented each time some previous translations + become invalid. + This variable is part of the external ABI of the GNU libintl. */ +extern int _nl_msg_cat_cntr; + +#ifndef _LIBC +const char *_nl_locale_name PARAMS ((int category, const char *categoryname)); +#endif + +struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname, + char *__locale, + const char *__domainname, + struct binding *__domainbinding)) + internal_function; +void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain, + struct binding *__domainbinding)) + internal_function; +void _nl_unload_domain PARAMS ((struct loaded_domain *__domain)) + internal_function; +const char *_nl_init_domain_conv PARAMS ((struct loaded_l10nfile *__domain_file, + struct loaded_domain *__domain, + struct binding *__domainbinding)) + internal_function; +void _nl_free_domain_conv PARAMS ((struct loaded_domain *__domain)) + internal_function; + +char *_nl_find_msg PARAMS ((struct loaded_l10nfile *domain_file, + struct binding *domainbinding, + const char *msgid, size_t *lengthp)) + internal_function; + +#ifdef _LIBC +extern char *__gettext PARAMS ((const char *__msgid)); +extern char *__dgettext PARAMS ((const char *__domainname, + const char *__msgid)); +extern char *__dcgettext PARAMS ((const char *__domainname, + const char *__msgid, int __category)); +extern char *__ngettext PARAMS ((const char *__msgid1, const char *__msgid2, + unsigned long int __n)); +extern char *__dngettext PARAMS ((const char *__domainname, + const char *__msgid1, const char *__msgid2, + unsigned long int n)); +extern char *__dcngettext PARAMS ((const char *__domainname, + const char *__msgid1, const char *__msgid2, + unsigned long int __n, int __category)); +extern char *__dcigettext PARAMS ((const char *__domainname, + const char *__msgid1, const char *__msgid2, + int __plural, unsigned long int __n, + int __category)); +extern char *__textdomain PARAMS ((const char *__domainname)); +extern char *__bindtextdomain PARAMS ((const char *__domainname, + const char *__dirname)); +extern char *__bind_textdomain_codeset PARAMS ((const char *__domainname, + const char *__codeset)); +#else +/* Declare the exported libintl_* functions, in a way that allows us to + call them under their real name. */ +# define _INTL_REDIRECT_MACROS +# include "libgnuintl.h" +extern char *libintl_dcigettext PARAMS ((const char *__domainname, + const char *__msgid1, + const char *__msgid2, + int __plural, unsigned long int __n, + int __category)); +#endif + +/* @@ begin of epilog @@ */ + +#endif /* gettextP.h */ diff --git a/lib/intl/gmo.h b/lib/intl/gmo.h new file mode 100644 index 0000000..2c57851 --- /dev/null +++ b/lib/intl/gmo.h @@ -0,0 +1,150 @@ +/* gmo.h - Description of GNU message catalog format: general file layout. */ + +/* Copyright (C) 1995, 1997, 2000-2002, 2005-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _GETTEXT_H +#define _GETTEXT_H 1 + +#include + +/* @@ end of prolog @@ */ + +/* The magic number of the GNU message catalog format. */ +#define _MAGIC 0x950412de +#define _MAGIC_SWAPPED 0xde120495 + +/* Revision number of the currently used .mo (binary) file format. */ +#define MO_REVISION_NUMBER 0 + +/* The following contortions are an attempt to use the C preprocessor + to determine an unsigned integral type that is 32 bits wide. An + alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but + as of version autoconf-2.13, the AC_CHECK_SIZEOF macro doesn't work + when cross-compiling. */ + +#if __STDC__ +# define UINT_MAX_32_BITS 4294967295U +#else +# define UINT_MAX_32_BITS 0xFFFFFFFF +#endif + +/* If UINT_MAX isn't defined, assume it's a 32-bit type. + This should be valid for all systems GNU cares about because + that doesn't include 16-bit systems, and only modern systems + (that certainly have ) have 64+-bit integral types. */ + +#ifndef UINT_MAX +# define UINT_MAX UINT_MAX_32_BITS +#endif + +#if UINT_MAX == UINT_MAX_32_BITS +typedef unsigned nls_uint32; +#else +# if USHRT_MAX == UINT_MAX_32_BITS +typedef unsigned short nls_uint32; +# else +# if ULONG_MAX == UINT_MAX_32_BITS +typedef unsigned long nls_uint32; +# else + /* The following line is intended to throw an error. Using #error is + not portable enough. */ + "Cannot determine unsigned 32-bit data type." +# endif +# endif +#endif + + +/* Header for binary .mo file format. */ +struct mo_file_header +{ + /* The magic number. */ + nls_uint32 magic; + /* The revision number of the file format. */ + nls_uint32 revision; + + /* The following are only used in .mo files with major revision 0. */ + + /* The number of strings pairs. */ + nls_uint32 nstrings; + /* Offset of table with start offsets of original strings. */ + nls_uint32 orig_tab_offset; + /* Offset of table with start offsets of translated strings. */ + nls_uint32 trans_tab_offset; + /* Size of hash table. */ + nls_uint32 hash_tab_size; + /* Offset of first hash table entry. */ + nls_uint32 hash_tab_offset; + + /* The following are only used in .mo files with minor revision >= 1. */ + + /* The number of system dependent segments. */ + nls_uint32 n_sysdep_segments; + /* Offset of table describing system dependent segments. */ + nls_uint32 sysdep_segments_offset; + /* The number of system dependent strings pairs. */ + nls_uint32 n_sysdep_strings; + /* Offset of table with start offsets of original sysdep strings. */ + nls_uint32 orig_sysdep_tab_offset; + /* Offset of table with start offsets of translated sysdep strings. */ + nls_uint32 trans_sysdep_tab_offset; +}; + +/* Descriptor for static string contained in the binary .mo file. */ +struct string_desc +{ + /* Length of addressed string, not including the trailing NUL. */ + nls_uint32 length; + /* Offset of string in file. */ + nls_uint32 offset; +}; + +/* The following are only used in .mo files with minor revision >= 1. */ + +/* Descriptor for system dependent string segment. */ +struct sysdep_segment +{ + /* Length of addressed string, including the trailing NUL. */ + nls_uint32 length; + /* Offset of string in file. */ + nls_uint32 offset; +}; + +/* Descriptor for system dependent string. */ +struct sysdep_string +{ + /* Offset of static string segments in file. */ + nls_uint32 offset; + /* Alternating sequence of static and system dependent segments. + The last segment is a static segment, including the trailing NUL. */ + struct segment_pair + { + /* Size of static segment. */ + nls_uint32 segsize; + /* Reference to system dependent string segment, or ~0 at the end. */ + nls_uint32 sysdepref; + } segments[1]; +}; + +/* Marker for the end of the segments[] array. This has the value 0xFFFFFFFF, + regardless whether 'int' is 16 bit, 32 bit, or 64 bit. */ +#define SEGMENTS_END ((nls_uint32) ~0) + +/* @@ begin of epilog @@ */ + +#endif /* gettext.h */ diff --git a/lib/intl/hash-string.h b/lib/intl/hash-string.h new file mode 100644 index 0000000..b5a7d41 --- /dev/null +++ b/lib/intl/hash-string.h @@ -0,0 +1,61 @@ +/* hash-string.h - Description of GNU message catalog format: string hashing function. */ + +/* Copyright (C) 1995, 1997, 1998, 2000, 2001, 2005-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* @@ end of prolog @@ */ + +#ifndef PARAMS +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES +# define PARAMS(Args) Args +# else +# define PARAMS(Args) () +# endif +#endif + +/* We assume to have `unsigned long int' value with at least 32 bits. */ +#define HASHWORDBITS 32 + + +/* Defines the so called `hashpjw' function by P.J. Weinberger + [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools, + 1986, 1987 Bell Telephone Laboratories, Inc.] */ +static unsigned long int hash_string PARAMS ((const char *__str_param)); + +static inline unsigned long int +hash_string (str_param) + const char *str_param; +{ + unsigned long int hval, g; + const char *str = str_param; + + /* Compute the hash value for the given string. */ + hval = 0; + while (*str != '\0') + { + hval <<= 4; + hval += (unsigned long int) *str++; + g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4)); + if (g != 0) + { + hval ^= g >> (HASHWORDBITS - 8); + hval ^= g; + } + } + return hval; +} diff --git a/lib/intl/intl-compat.c b/lib/intl/intl-compat.c new file mode 100644 index 0000000..7f32349 --- /dev/null +++ b/lib/intl/intl-compat.c @@ -0,0 +1,152 @@ +/* intl-compat.c - Stub functions to call gettext functions from GNU gettext library. */ + +/* Copyright (C) 1995, 2000-2003, 2005-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "gettextP.h" + +/* @@ end of prolog @@ */ + +/* This file redirects the gettext functions (without prefix) to those + defined in the included GNU libintl library (with "libintl_" prefix). + It is compiled into libintl in order to make the AM_GNU_GETTEXT test + of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which + has the redirections primarily in the include file. + It is also compiled into libgnuintl so that libgnuintl.so can be used + as LD_PRELOADable library on glibc systems, to provide the extra + features that the functions in the libc don't have (namely, logging). */ + + +#undef gettext +#undef dgettext +#undef dcgettext +#undef ngettext +#undef dngettext +#undef dcngettext +#undef textdomain +#undef bindtextdomain +#undef bind_textdomain_codeset + + +/* When building a DLL, we must export some functions. Note that because + the functions are only defined for binary backward compatibility, we + don't need to use __declspec(dllimport) in any case. */ +#if defined _MSC_VER && BUILDING_DLL +# define DLL_EXPORTED __declspec(dllexport) +#else +# define DLL_EXPORTED +#endif + + +DLL_EXPORTED +char * +gettext (msgid) + const char *msgid; +{ + return libintl_gettext (msgid); +} + + +DLL_EXPORTED +char * +dgettext (domainname, msgid) + const char *domainname; + const char *msgid; +{ + return libintl_dgettext (domainname, msgid); +} + + +DLL_EXPORTED +char * +dcgettext (domainname, msgid, category) + const char *domainname; + const char *msgid; + int category; +{ + return libintl_dcgettext (domainname, msgid, category); +} + + +DLL_EXPORTED +char * +ngettext (msgid1, msgid2, n) + const char *msgid1; + const char *msgid2; + unsigned long int n; +{ + return libintl_ngettext (msgid1, msgid2, n); +} + + +DLL_EXPORTED +char * +dngettext (domainname, msgid1, msgid2, n) + const char *domainname; + const char *msgid1; + const char *msgid2; + unsigned long int n; +{ + return libintl_dngettext (domainname, msgid1, msgid2, n); +} + + +DLL_EXPORTED +char * +dcngettext (domainname, msgid1, msgid2, n, category) + const char *domainname; + const char *msgid1; + const char *msgid2; + unsigned long int n; + int category; +{ + return libintl_dcngettext (domainname, msgid1, msgid2, n, category); +} + + +DLL_EXPORTED +char * +textdomain (domainname) + const char *domainname; +{ + return libintl_textdomain (domainname); +} + + +DLL_EXPORTED +char * +bindtextdomain (domainname, dirname) + const char *domainname; + const char *dirname; +{ + return libintl_bindtextdomain (domainname, dirname); +} + + +DLL_EXPORTED +char * +bind_textdomain_codeset (domainname, codeset) + const char *domainname; + const char *codeset; +{ + return libintl_bind_textdomain_codeset (domainname, codeset); +} diff --git a/lib/intl/l10nflist.c b/lib/intl/l10nflist.c new file mode 100644 index 0000000..7556c8c --- /dev/null +++ b/lib/intl/l10nflist.c @@ -0,0 +1,456 @@ +/* l10nflist.c - make localization file list. */ + +/* Copyright (C) 1995-1999, 2000, 2001, 2002, 2005-2009 Free Software Foundation, Inc. + Contributed by Ulrich Drepper , 1995. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Tell glibc's to provide a prototype for stpcpy(). + This must come before because may include + , and once has been included, it's too late. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#if defined _LIBC || defined HAVE_ARGZ_H +# include +#endif +#include +#include +#include + +#include "loadinfo.h" + +/* On some strange systems still no definition of NULL is found. Sigh! */ +#ifndef NULL +# if defined __STDC__ && __STDC__ +# define NULL ((void *) 0) +# else +# define NULL 0 +# endif +#endif + +/* @@ end of prolog @@ */ + +#ifdef _LIBC +/* Rename the non ANSI C functions. This is required by the standard + because some ANSI C functions will require linking with this object + file and the name space must not be polluted. */ +# ifndef stpcpy +# define stpcpy(dest, src) __stpcpy(dest, src) +# endif +#else +# ifndef HAVE_STPCPY +static char *stpcpy PARAMS ((char *dest, const char *src)); +# endif +#endif + +/* Pathname support. + ISSLASH(C) tests whether C is a directory separator character. + IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not, + it may be concatenated to a directory pathname. + */ +#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ + /* Win32, OS/2, DOS */ +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +# define HAS_DEVICE(P) \ + ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ + && (P)[1] == ':') +# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P)) +#else + /* Unix */ +# define ISSLASH(C) ((C) == '/') +# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0]) +#endif + +/* Define function which are usually not available. */ + +#if !defined _LIBC && !defined HAVE___ARGZ_COUNT +/* Returns the number of strings in ARGZ. */ +static size_t argz_count__ PARAMS ((const char *argz, size_t len)); + +static size_t +argz_count__ (argz, len) + const char *argz; + size_t len; +{ + size_t count = 0; + while (len > 0) + { + size_t part_len = strlen (argz); + argz += part_len + 1; + len -= part_len + 1; + count++; + } + return count; +} +# undef __argz_count +# define __argz_count(argz, len) argz_count__ (argz, len) +#else +# ifdef _LIBC +# define __argz_count(argz, len) INTUSE(__argz_count) (argz, len) +# endif +#endif /* !_LIBC && !HAVE___ARGZ_COUNT */ + +#if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY +/* Make '\0' separated arg vector ARGZ printable by converting all the '\0's + except the last into the character SEP. */ +static void argz_stringify__ PARAMS ((char *argz, size_t len, int sep)); + +static void +argz_stringify__ (argz, len, sep) + char *argz; + size_t len; + int sep; +{ + while (len > 0) + { + size_t part_len = strlen (argz); + argz += part_len; + len -= part_len + 1; + if (len > 0) + *argz++ = sep; + } +} +# undef __argz_stringify +# define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep) +#else +# ifdef _LIBC +# define __argz_stringify(argz, len, sep) \ + INTUSE(__argz_stringify) (argz, len, sep) +# endif +#endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */ + +#if !defined _LIBC && !defined HAVE___ARGZ_NEXT +static char *argz_next__ PARAMS ((char *argz, size_t argz_len, + const char *entry)); + +static char * +argz_next__ (argz, argz_len, entry) + char *argz; + size_t argz_len; + const char *entry; +{ + if (entry) + { + if (entry < argz + argz_len) + entry = strchr (entry, '\0') + 1; + + return entry >= argz + argz_len ? NULL : (char *) entry; + } + else + if (argz_len > 0) + return argz; + else + return 0; +} +# undef __argz_next +# define __argz_next(argz, len, entry) argz_next__ (argz, len, entry) +#endif /* !_LIBC && !HAVE___ARGZ_NEXT */ + + +/* Return number of bits set in X. */ +static int pop PARAMS ((int x)); + +static inline int +pop (x) + int x; +{ + /* We assume that no more than 16 bits are used. */ + x = ((x & ~0x5555) >> 1) + (x & 0x5555); + x = ((x & ~0x3333) >> 2) + (x & 0x3333); + x = ((x >> 4) + x) & 0x0f0f; + x = ((x >> 8) + x) & 0xff; + + return x; +} + + +struct loaded_l10nfile * +_nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language, + territory, codeset, normalized_codeset, modifier, special, + sponsor, revision, filename, do_allocate) + struct loaded_l10nfile **l10nfile_list; + const char *dirlist; + size_t dirlist_len; + int mask; + const char *language; + const char *territory; + const char *codeset; + const char *normalized_codeset; + const char *modifier; + const char *special; + const char *sponsor; + const char *revision; + const char *filename; + int do_allocate; +{ + char *abs_filename; + struct loaded_l10nfile **lastp; + struct loaded_l10nfile *retval; + char *cp; + size_t dirlist_count; + size_t entries; + int cnt; + + /* If LANGUAGE contains an absolute directory specification, we ignore + DIRLIST. */ + if (IS_ABSOLUTE_PATH (language)) + dirlist_len = 0; + + /* Allocate room for the full file name. */ + abs_filename = (char *) malloc (dirlist_len + + strlen (language) + + ((mask & TERRITORY) != 0 + ? strlen (territory) + 1 : 0) + + ((mask & XPG_CODESET) != 0 + ? strlen (codeset) + 1 : 0) + + ((mask & XPG_NORM_CODESET) != 0 + ? strlen (normalized_codeset) + 1 : 0) + + (((mask & XPG_MODIFIER) != 0 + || (mask & CEN_AUDIENCE) != 0) + ? strlen (modifier) + 1 : 0) + + ((mask & CEN_SPECIAL) != 0 + ? strlen (special) + 1 : 0) + + (((mask & CEN_SPONSOR) != 0 + || (mask & CEN_REVISION) != 0) + ? (1 + ((mask & CEN_SPONSOR) != 0 + ? strlen (sponsor) : 0) + + ((mask & CEN_REVISION) != 0 + ? strlen (revision) + 1 : 0)) : 0) + + 1 + strlen (filename) + 1); + + if (abs_filename == NULL) + return NULL; + + /* Construct file name. */ + cp = abs_filename; + if (dirlist_len > 0) + { + memcpy (cp, dirlist, dirlist_len); + __argz_stringify (cp, dirlist_len, PATH_SEPARATOR); + cp += dirlist_len; + cp[-1] = '/'; + } + + cp = stpcpy (cp, language); + + if ((mask & TERRITORY) != 0) + { + *cp++ = '_'; + cp = stpcpy (cp, territory); + } + if ((mask & XPG_CODESET) != 0) + { + *cp++ = '.'; + cp = stpcpy (cp, codeset); + } + if ((mask & XPG_NORM_CODESET) != 0) + { + *cp++ = '.'; + cp = stpcpy (cp, normalized_codeset); + } + if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0) + { + /* This component can be part of both syntaxes but has different + leading characters. For CEN we use `+', else `@'. */ + *cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@'; + cp = stpcpy (cp, modifier); + } + if ((mask & CEN_SPECIAL) != 0) + { + *cp++ = '+'; + cp = stpcpy (cp, special); + } + if ((mask & (CEN_SPONSOR | CEN_REVISION)) != 0) + { + *cp++ = ','; + if ((mask & CEN_SPONSOR) != 0) + cp = stpcpy (cp, sponsor); + if ((mask & CEN_REVISION) != 0) + { + *cp++ = '_'; + cp = stpcpy (cp, revision); + } + } + + *cp++ = '/'; + stpcpy (cp, filename); + + /* Look in list of already loaded domains whether it is already + available. */ + lastp = l10nfile_list; + for (retval = *l10nfile_list; retval != NULL; retval = retval->next) + if (retval->filename != NULL) + { + int compare = strcmp (retval->filename, abs_filename); + if (compare == 0) + /* We found it! */ + break; + if (compare < 0) + { + /* It's not in the list. */ + retval = NULL; + break; + } + + lastp = &retval->next; + } + + if (retval != NULL || do_allocate == 0) + { + free (abs_filename); + return retval; + } + + dirlist_count = (dirlist_len > 0 ? __argz_count (dirlist, dirlist_len) : 1); + + /* Allocate a new loaded_l10nfile. */ + retval = + (struct loaded_l10nfile *) + malloc (sizeof (*retval) + + (((dirlist_count << pop (mask)) + (dirlist_count > 1 ? 1 : 0)) + * sizeof (struct loaded_l10nfile *))); + if (retval == NULL) + return NULL; + + retval->filename = abs_filename; + + /* We set retval->data to NULL here; it is filled in later. + Setting retval->decided to 1 here means that retval does not + correspond to a real file (dirlist_count > 1) or is not worth + looking up (if an unnormalized codeset was specified). */ + retval->decided = (dirlist_count > 1 + || ((mask & XPG_CODESET) != 0 + && (mask & XPG_NORM_CODESET) != 0)); + retval->data = NULL; + + retval->next = *lastp; + *lastp = retval; + + entries = 0; + /* Recurse to fill the inheritance list of RETVAL. + If the DIRLIST is a real list (i.e. DIRLIST_COUNT > 1), the RETVAL + entry does not correspond to a real file; retval->filename contains + colons. In this case we loop across all elements of DIRLIST and + across all bit patterns dominated by MASK. + If the DIRLIST is a single directory or entirely redundant (i.e. + DIRLIST_COUNT == 1), we loop across all bit patterns dominated by + MASK, excluding MASK itself. + In either case, we loop down from MASK to 0. This has the effect + that the extra bits in the locale name are dropped in this order: + first the modifier, then the territory, then the codeset, then the + normalized_codeset. */ + for (cnt = dirlist_count > 1 ? mask : mask - 1; cnt >= 0; --cnt) + if ((cnt & ~mask) == 0 + && ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0) + && ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0)) + { + if (dirlist_count > 1) + { + /* Iterate over all elements of the DIRLIST. */ + char *dir = NULL; + + while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir)) + != NULL) + retval->successor[entries++] + = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, + cnt, language, territory, codeset, + normalized_codeset, modifier, special, + sponsor, revision, filename, 1); + } + else + retval->successor[entries++] + = _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, + cnt, language, territory, codeset, + normalized_codeset, modifier, special, + sponsor, revision, filename, 1); + } + retval->successor[entries] = NULL; + + return retval; +} + +/* Normalize codeset name. There is no standard for the codeset + names. Normalization allows the user to use any of the common + names. The return value is dynamically allocated and has to be + freed by the caller. */ +const char * +_nl_normalize_codeset (codeset, name_len) + const char *codeset; + size_t name_len; +{ + int len = 0; + int only_digit = 1; + char *retval; + char *wp; + size_t cnt; + + for (cnt = 0; cnt < name_len; ++cnt) + if (isalnum ((unsigned char) codeset[cnt])) + { + ++len; + + if (isalpha ((unsigned char) codeset[cnt])) + only_digit = 0; + } + + retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1); + + if (retval != NULL) + { + if (only_digit) + wp = stpcpy (retval, "iso"); + else + wp = retval; + + for (cnt = 0; cnt < name_len; ++cnt) + if (isalpha ((unsigned char) codeset[cnt])) + *wp++ = tolower ((unsigned char) codeset[cnt]); + else if (isdigit ((unsigned char) codeset[cnt])) + *wp++ = codeset[cnt]; + + *wp = '\0'; + } + + return (const char *) retval; +} + + +/* @@ begin of epilog @@ */ + +/* We don't want libintl.a to depend on any other library. So we + avoid the non-standard function stpcpy. In GNU C Library this + function is available, though. Also allow the symbol HAVE_STPCPY + to be defined. */ +#if !_LIBC && !HAVE_STPCPY +static char * +stpcpy (dest, src) + char *dest; + const char *src; +{ + while ((*dest++ = *src++) != '\0') + /* Do nothing. */ ; + return dest - 1; +} +#endif diff --git a/lib/intl/libgnuintl.h.in b/lib/intl/libgnuintl.h.in new file mode 100644 index 0000000..14f9cf9 --- /dev/null +++ b/lib/intl/libgnuintl.h.in @@ -0,0 +1,311 @@ +/* libgnuintl.h - Message catalogs for internationalization. */ + +/* Copyright (C) 1995-1997, 2000-2003, 2004-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _LIBINTL_H +#define _LIBINTL_H 1 + +#include + +/* The LC_MESSAGES locale category is the category used by the functions + gettext() and dgettext(). It is specified in POSIX, but not in ANSI C. + On systems that don't define it, use an arbitrary value instead. + On Solaris, defines __LOCALE_H (or _LOCALE_H in Solaris 2.5) + then includes (i.e. this file!) and then only defines + LC_MESSAGES. To avoid a redefinition warning, don't define LC_MESSAGES + in this case. */ +#if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun)) +# define LC_MESSAGES 1729 +#endif + +/* We define an additional symbol to signal that we use the GNU + implementation of gettext. */ +#define __USE_GNU_GETTEXT 1 + +/* Provide information about the supported file formats. Returns the + maximum minor revision number supported for a given major revision. */ +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) \ + ((major) == 0 ? 1 : -1) + +/* Resolve a platform specific conflict on DJGPP. GNU gettext takes + precedence over _conio_gettext. */ +#ifdef __DJGPP__ +# undef gettext +#endif + +/* Use _INTL_PARAMS, not PARAMS, in order to avoid clashes with identifiers + used by programs. Similarly, test __PROTOTYPES, not PROTOTYPES. */ +#ifndef _INTL_PARAMS +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES +# define _INTL_PARAMS(args) args +# else +# define _INTL_PARAMS(args) () +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/* We redirect the functions to those prefixed with "libintl_". This is + necessary, because some systems define gettext/textdomain/... in the C + library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer). + If we used the unprefixed names, there would be cases where the + definition in the C library would override the one in the libintl.so + shared library. Recall that on ELF systems, the symbols are looked + up in the following order: + 1. in the executable, + 2. in the shared libraries specified on the link command line, in order, + 3. in the dependencies of the shared libraries specified on the link + command line, + 4. in the dlopen()ed shared libraries, in the order in which they were + dlopen()ed. + The definition in the C library would override the one in libintl.so if + either + * -lc is given on the link command line and -lintl isn't, or + * -lc is given on the link command line before -lintl, or + * libintl.so is a dependency of a dlopen()ed shared library but not + linked to the executable at link time. + Since Solaris gettext() behaves differently than GNU gettext(), this + would be unacceptable. + + The redirection happens by default through macros in C, so that &gettext + is independent of the compilation unit, but through inline functions in + C++, in order not to interfere with the name mangling of class fields or + class methods called 'gettext'. */ + +/* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS. + If he doesn't, we choose the method. A third possible method is + _INTL_REDIRECT_ASM, supported only by GCC. */ +#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS) +# if __GNUC__ >= 2 && !defined __APPLE_CC__ && (defined __STDC__ || defined __cplusplus) +# define _INTL_REDIRECT_ASM +# else +# ifdef __cplusplus +# define _INTL_REDIRECT_INLINE +# else +# define _INTL_REDIRECT_MACROS +# endif +# endif +#endif +/* Auxiliary macros. */ +#ifdef _INTL_REDIRECT_ASM +# define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname)) +# define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring +# define _INTL_STRINGIFY(prefix) #prefix +#else +# define _INTL_ASM(cname) +#endif + +/* Look up MSGID in the current default message catalog for the current + LC_MESSAGES locale. If not found, returns MSGID itself (the default + text). */ +#ifdef _INTL_REDIRECT_INLINE +extern char *libintl_gettext (const char *__msgid); +static inline char *gettext (const char *__msgid) +{ + return libintl_gettext (__msgid); +} +#else +#ifdef _INTL_REDIRECT_MACROS +# define gettext libintl_gettext +#endif +extern char *gettext _INTL_PARAMS ((const char *__msgid)) + _INTL_ASM (libintl_gettext); +#endif + +/* Look up MSGID in the DOMAINNAME message catalog for the current + LC_MESSAGES locale. */ +#ifdef _INTL_REDIRECT_INLINE +extern char *libintl_dgettext (const char *__domainname, const char *__msgid); +static inline char *dgettext (const char *__domainname, const char *__msgid) +{ + return libintl_dgettext (__domainname, __msgid); +} +#else +#ifdef _INTL_REDIRECT_MACROS +# define dgettext libintl_dgettext +#endif +extern char *dgettext _INTL_PARAMS ((const char *__domainname, + const char *__msgid)) + _INTL_ASM (libintl_dgettext); +#endif + +/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY + locale. */ +#ifdef _INTL_REDIRECT_INLINE +extern char *libintl_dcgettext (const char *__domainname, const char *__msgid, + int __category); +static inline char *dcgettext (const char *__domainname, const char *__msgid, + int __category) +{ + return libintl_dcgettext (__domainname, __msgid, __category); +} +#else +#ifdef _INTL_REDIRECT_MACROS +# define dcgettext libintl_dcgettext +#endif +extern char *dcgettext _INTL_PARAMS ((const char *__domainname, + const char *__msgid, + int __category)) + _INTL_ASM (libintl_dcgettext); +#endif + + +/* Similar to `gettext' but select the plural form corresponding to the + number N. */ +#ifdef _INTL_REDIRECT_INLINE +extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2, + unsigned long int __n); +static inline char *ngettext (const char *__msgid1, const char *__msgid2, + unsigned long int __n) +{ + return libintl_ngettext (__msgid1, __msgid2, __n); +} +#else +#ifdef _INTL_REDIRECT_MACROS +# define ngettext libintl_ngettext +#endif +extern char *ngettext _INTL_PARAMS ((const char *__msgid1, + const char *__msgid2, + unsigned long int __n)) + _INTL_ASM (libintl_ngettext); +#endif + +/* Similar to `dgettext' but select the plural form corresponding to the + number N. */ +#ifdef _INTL_REDIRECT_INLINE +extern char *libintl_dngettext (const char *__domainname, const char *__msgid1, + const char *__msgid2, unsigned long int __n); +static inline char *dngettext (const char *__domainname, const char *__msgid1, + const char *__msgid2, unsigned long int __n) +{ + return libintl_dngettext (__domainname, __msgid1, __msgid2, __n); +} +#else +#ifdef _INTL_REDIRECT_MACROS +# define dngettext libintl_dngettext +#endif +extern char *dngettext _INTL_PARAMS ((const char *__domainname, + const char *__msgid1, + const char *__msgid2, + unsigned long int __n)) + _INTL_ASM (libintl_dngettext); +#endif + +/* Similar to `dcgettext' but select the plural form corresponding to the + number N. */ +#ifdef _INTL_REDIRECT_INLINE +extern char *libintl_dcngettext (const char *__domainname, + const char *__msgid1, const char *__msgid2, + unsigned long int __n, int __category); +static inline char *dcngettext (const char *__domainname, + const char *__msgid1, const char *__msgid2, + unsigned long int __n, int __category) +{ + return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category); +} +#else +#ifdef _INTL_REDIRECT_MACROS +# define dcngettext libintl_dcngettext +#endif +extern char *dcngettext _INTL_PARAMS ((const char *__domainname, + const char *__msgid1, + const char *__msgid2, + unsigned long int __n, + int __category)) + _INTL_ASM (libintl_dcngettext); +#endif + + +/* Set the current default message catalog to DOMAINNAME. + If DOMAINNAME is null, return the current default. + If DOMAINNAME is "", reset to the default of "messages". */ +#ifdef _INTL_REDIRECT_INLINE +extern char *libintl_textdomain (const char *__domainname); +static inline char *textdomain (const char *__domainname) +{ + return libintl_textdomain (__domainname); +} +#else +#ifdef _INTL_REDIRECT_MACROS +# define textdomain libintl_textdomain +#endif +extern char *textdomain _INTL_PARAMS ((const char *__domainname)) + _INTL_ASM (libintl_textdomain); +#endif + +/* Specify that the DOMAINNAME message catalog will be found + in DIRNAME rather than in the system locale data base. */ +#ifdef _INTL_REDIRECT_INLINE +extern char *libintl_bindtextdomain (const char *__domainname, + const char *__dirname); +static inline char *bindtextdomain (const char *__domainname, + const char *__dirname) +{ + return libintl_bindtextdomain (__domainname, __dirname); +} +#else +#ifdef _INTL_REDIRECT_MACROS +# define bindtextdomain libintl_bindtextdomain +#endif +extern char *bindtextdomain _INTL_PARAMS ((const char *__domainname, + const char *__dirname)) + _INTL_ASM (libintl_bindtextdomain); +#endif + +/* Specify the character encoding in which the messages from the + DOMAINNAME message catalog will be returned. */ +#ifdef _INTL_REDIRECT_INLINE +extern char *libintl_bind_textdomain_codeset (const char *__domainname, + const char *__codeset); +static inline char *bind_textdomain_codeset (const char *__domainname, + const char *__codeset) +{ + return libintl_bind_textdomain_codeset (__domainname, __codeset); +} +#else +#ifdef _INTL_REDIRECT_MACROS +# define bind_textdomain_codeset libintl_bind_textdomain_codeset +#endif +extern char *bind_textdomain_codeset _INTL_PARAMS ((const char *__domainname, + const char *__codeset)) + _INTL_ASM (libintl_bind_textdomain_codeset); +#endif + + +/* Support for relocatable packages. */ + +/* Sets the original and the current installation prefix of the package. + Relocation simply replaces a pathname starting with the original prefix + by the corresponding pathname with the current prefix instead. Both + prefixes should be directory names without trailing slash (i.e. use "" + instead of "/"). */ +#define libintl_set_relocation_prefix libintl_set_relocation_prefix +extern void + libintl_set_relocation_prefix _INTL_PARAMS ((const char *orig_prefix, + const char *curr_prefix)); + + +#ifdef __cplusplus +} +#endif + +#endif /* libintl.h */ diff --git a/lib/intl/loadinfo.h b/lib/intl/loadinfo.h new file mode 100644 index 0000000..d06a277 --- /dev/null +++ b/lib/intl/loadinfo.h @@ -0,0 +1,159 @@ +/* loadinfo.c */ + +/* Copyright (C) 1996-1999, 2000-2002, 2005-2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1996. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _LOADINFO_H +#define _LOADINFO_H 1 + +/* Declarations of locale dependent catalog lookup functions. + Implemented in + + localealias.c Possibly replace a locale name by another. + explodename.c Split a locale name into its various fields. + l10nflist.c Generate a list of filenames of possible message catalogs. + finddomain.c Find and open the relevant message catalogs. + + The main function _nl_find_domain() in finddomain.c is declared + in gettextP.h. + */ + +#ifndef PARAMS +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES +# define PARAMS(args) args +# else +# define PARAMS(args) () +# endif +#endif + +#ifndef internal_function +# define internal_function +#endif + +/* Tell the compiler when a conditional or integer expression is + almost always true or almost always false. */ +#ifndef HAVE_BUILTIN_EXPECT +# define __builtin_expect(expr, val) (expr) +#endif + +/* Separator in PATH like lists of pathnames. */ +#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ + /* Win32, OS/2, DOS */ +# define PATH_SEPARATOR ';' +#else + /* Unix */ +# define PATH_SEPARATOR ':' +#endif + +/* Encoding of locale name parts. */ +#define CEN_REVISION 1 +#define CEN_SPONSOR 2 +#define CEN_SPECIAL 4 +#define XPG_NORM_CODESET 8 +#define XPG_CODESET 16 +#define TERRITORY 32 +#define CEN_AUDIENCE 64 +#define XPG_MODIFIER 128 + +#define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE) +#define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER) + + +struct loaded_l10nfile +{ + const char *filename; + int decided; + + const void *data; + + struct loaded_l10nfile *next; + struct loaded_l10nfile *successor[1]; +}; + + +/* Normalize codeset name. There is no standard for the codeset + names. Normalization allows the user to use any of the common + names. The return value is dynamically allocated and has to be + freed by the caller. */ +extern const char *_nl_normalize_codeset PARAMS ((const char *codeset, + size_t name_len)); + +/* Lookup a locale dependent file. + *L10NFILE_LIST denotes a pool of lookup results of locale dependent + files of the same kind, sorted in decreasing order of ->filename. + DIRLIST and DIRLIST_LEN are an argz list of directories in which to + look, containing at least one directory (i.e. DIRLIST_LEN > 0). + MASK, LANGUAGE, TERRITORY, CODESET, NORMALIZED_CODESET, MODIFIER, + SPECIAL, SPONSOR, REVISION are the pieces of the locale name, as + produced by _nl_explode_name(). FILENAME is the filename suffix. + The return value is the lookup result, either found in *L10NFILE_LIST, + or - if DO_ALLOCATE is nonzero - freshly allocated, or possibly NULL. + If the return value is non-NULL, it is added to *L10NFILE_LIST, and + its ->next field denotes the chaining inside *L10NFILE_LIST, and + furthermore its ->successor[] field contains a list of other lookup + results from which this lookup result inherits. */ +extern struct loaded_l10nfile * +_nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list, + const char *dirlist, size_t dirlist_len, int mask, + const char *language, const char *territory, + const char *codeset, + const char *normalized_codeset, + const char *modifier, const char *special, + const char *sponsor, const char *revision, + const char *filename, int do_allocate)); + +/* Lookup the real locale name for a locale alias NAME, or NULL if + NAME is not a locale alias (but possibly a real locale name). + The return value is statically allocated and must not be freed. */ +extern const char *_nl_expand_alias PARAMS ((const char *name)); + +/* Split a locale name NAME into its pieces: language, modifier, + territory, codeset, special, sponsor, revision. + NAME gets destructively modified: NUL bytes are inserted here and + there. *LANGUAGE gets assigned NAME. Each of *MODIFIER, *TERRITORY, + *CODESET, *SPECIAL, *SPONSOR, *REVISION gets assigned either a + pointer into the old NAME string, or NULL. *NORMALIZED_CODESET + gets assigned the expanded *CODESET, if it is different from *CODESET; + this one is dynamically allocated and has to be freed by the caller. + The return value is a bitmask, where each bit corresponds to one + filled-in value: + XPG_MODIFIER, CEN_AUDIENCE for *MODIFIER, + TERRITORY for *TERRITORY, + XPG_CODESET for *CODESET, + XPG_NORM_CODESET for *NORMALIZED_CODESET, + CEN_SPECIAL for *SPECIAL, + CEN_SPONSOR for *SPONSOR, + CEN_REVISION for *REVISION. + */ +extern int _nl_explode_name PARAMS ((char *name, const char **language, + const char **modifier, + const char **territory, + const char **codeset, + const char **normalized_codeset, + const char **special, + const char **sponsor, + const char **revision)); + +/* Split a locale name NAME into a leading language part and all the + rest. Return a pointer to the first character after the language, + i.e. to the first byte of the rest. */ +extern char *_nl_find_language PARAMS ((const char *name)); + +#endif /* loadinfo.h */ diff --git a/lib/intl/loadmsgcat.c b/lib/intl/loadmsgcat.c new file mode 100644 index 0000000..83ca63f --- /dev/null +++ b/lib/intl/loadmsgcat.c @@ -0,0 +1,1324 @@ +/* loadmsgcat.c - Load needed message catalogs. */ + +/* Copyright (C) 1995-1999, 2000-2003, 2005-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Tell glibc's to provide a prototype for mempcpy(). + This must come before because may include + , and once has been included, it's too late. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include +#include + +#ifdef __GNUC__ +# undef alloca +# define alloca __builtin_alloca +# define HAVE_ALLOCA 1 +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# if defined HAVE_ALLOCA_H || defined _LIBC +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca +char *alloca (); +# endif +# endif +# endif +# endif +#endif + +#include +#include + +#if defined HAVE_UNISTD_H || defined _LIBC +# include +#endif + +#ifdef _LIBC +# include +# include +#endif + +#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ + || (defined _LIBC && defined _POSIX_MAPPED_FILES) +# include +# undef HAVE_MMAP +# define HAVE_MMAP 1 +#else +# undef HAVE_MMAP +#endif + +#if defined HAVE_STDINT_H_WITH_UINTMAX || defined _LIBC +# include +#endif +#if defined HAVE_INTTYPES_H || defined _LIBC +# include +#endif + +#include "gmo.h" +#include "gettextP.h" +#include "hash-string.h" +#include "plural-exp.h" + +#ifdef _LIBC +# include "../locale/localeinfo.h" +#endif + +/* Provide fallback values for macros that ought to be defined in . + Note that our fallback values need not be literal strings, because we don't + use them with preprocessor string concatenation. */ +#if !defined PRId8 || PRI_MACROS_BROKEN +# undef PRId8 +# define PRId8 "d" +#endif +#if !defined PRIi8 || PRI_MACROS_BROKEN +# undef PRIi8 +# define PRIi8 "i" +#endif +#if !defined PRIo8 || PRI_MACROS_BROKEN +# undef PRIo8 +# define PRIo8 "o" +#endif +#if !defined PRIu8 || PRI_MACROS_BROKEN +# undef PRIu8 +# define PRIu8 "u" +#endif +#if !defined PRIx8 || PRI_MACROS_BROKEN +# undef PRIx8 +# define PRIx8 "x" +#endif +#if !defined PRIX8 || PRI_MACROS_BROKEN +# undef PRIX8 +# define PRIX8 "X" +#endif +#if !defined PRId16 || PRI_MACROS_BROKEN +# undef PRId16 +# define PRId16 "d" +#endif +#if !defined PRIi16 || PRI_MACROS_BROKEN +# undef PRIi16 +# define PRIi16 "i" +#endif +#if !defined PRIo16 || PRI_MACROS_BROKEN +# undef PRIo16 +# define PRIo16 "o" +#endif +#if !defined PRIu16 || PRI_MACROS_BROKEN +# undef PRIu16 +# define PRIu16 "u" +#endif +#if !defined PRIx16 || PRI_MACROS_BROKEN +# undef PRIx16 +# define PRIx16 "x" +#endif +#if !defined PRIX16 || PRI_MACROS_BROKEN +# undef PRIX16 +# define PRIX16 "X" +#endif +#if !defined PRId32 || PRI_MACROS_BROKEN +# undef PRId32 +# define PRId32 "d" +#endif +#if !defined PRIi32 || PRI_MACROS_BROKEN +# undef PRIi32 +# define PRIi32 "i" +#endif +#if !defined PRIo32 || PRI_MACROS_BROKEN +# undef PRIo32 +# define PRIo32 "o" +#endif +#if !defined PRIu32 || PRI_MACROS_BROKEN +# undef PRIu32 +# define PRIu32 "u" +#endif +#if !defined PRIx32 || PRI_MACROS_BROKEN +# undef PRIx32 +# define PRIx32 "x" +#endif +#if !defined PRIX32 || PRI_MACROS_BROKEN +# undef PRIX32 +# define PRIX32 "X" +#endif +#if !defined PRId64 || PRI_MACROS_BROKEN +# undef PRId64 +# define PRId64 (sizeof (long) == 8 ? "ld" : "lld") +#endif +#if !defined PRIi64 || PRI_MACROS_BROKEN +# undef PRIi64 +# define PRIi64 (sizeof (long) == 8 ? "li" : "lli") +#endif +#if !defined PRIo64 || PRI_MACROS_BROKEN +# undef PRIo64 +# define PRIo64 (sizeof (long) == 8 ? "lo" : "llo") +#endif +#if !defined PRIu64 || PRI_MACROS_BROKEN +# undef PRIu64 +# define PRIu64 (sizeof (long) == 8 ? "lu" : "llu") +#endif +#if !defined PRIx64 || PRI_MACROS_BROKEN +# undef PRIx64 +# define PRIx64 (sizeof (long) == 8 ? "lx" : "llx") +#endif +#if !defined PRIX64 || PRI_MACROS_BROKEN +# undef PRIX64 +# define PRIX64 (sizeof (long) == 8 ? "lX" : "llX") +#endif +#if !defined PRIdLEAST8 || PRI_MACROS_BROKEN +# undef PRIdLEAST8 +# define PRIdLEAST8 "d" +#endif +#if !defined PRIiLEAST8 || PRI_MACROS_BROKEN +# undef PRIiLEAST8 +# define PRIiLEAST8 "i" +#endif +#if !defined PRIoLEAST8 || PRI_MACROS_BROKEN +# undef PRIoLEAST8 +# define PRIoLEAST8 "o" +#endif +#if !defined PRIuLEAST8 || PRI_MACROS_BROKEN +# undef PRIuLEAST8 +# define PRIuLEAST8 "u" +#endif +#if !defined PRIxLEAST8 || PRI_MACROS_BROKEN +# undef PRIxLEAST8 +# define PRIxLEAST8 "x" +#endif +#if !defined PRIXLEAST8 || PRI_MACROS_BROKEN +# undef PRIXLEAST8 +# define PRIXLEAST8 "X" +#endif +#if !defined PRIdLEAST16 || PRI_MACROS_BROKEN +# undef PRIdLEAST16 +# define PRIdLEAST16 "d" +#endif +#if !defined PRIiLEAST16 || PRI_MACROS_BROKEN +# undef PRIiLEAST16 +# define PRIiLEAST16 "i" +#endif +#if !defined PRIoLEAST16 || PRI_MACROS_BROKEN +# undef PRIoLEAST16 +# define PRIoLEAST16 "o" +#endif +#if !defined PRIuLEAST16 || PRI_MACROS_BROKEN +# undef PRIuLEAST16 +# define PRIuLEAST16 "u" +#endif +#if !defined PRIxLEAST16 || PRI_MACROS_BROKEN +# undef PRIxLEAST16 +# define PRIxLEAST16 "x" +#endif +#if !defined PRIXLEAST16 || PRI_MACROS_BROKEN +# undef PRIXLEAST16 +# define PRIXLEAST16 "X" +#endif +#if !defined PRIdLEAST32 || PRI_MACROS_BROKEN +# undef PRIdLEAST32 +# define PRIdLEAST32 "d" +#endif +#if !defined PRIiLEAST32 || PRI_MACROS_BROKEN +# undef PRIiLEAST32 +# define PRIiLEAST32 "i" +#endif +#if !defined PRIoLEAST32 || PRI_MACROS_BROKEN +# undef PRIoLEAST32 +# define PRIoLEAST32 "o" +#endif +#if !defined PRIuLEAST32 || PRI_MACROS_BROKEN +# undef PRIuLEAST32 +# define PRIuLEAST32 "u" +#endif +#if !defined PRIxLEAST32 || PRI_MACROS_BROKEN +# undef PRIxLEAST32 +# define PRIxLEAST32 "x" +#endif +#if !defined PRIXLEAST32 || PRI_MACROS_BROKEN +# undef PRIXLEAST32 +# define PRIXLEAST32 "X" +#endif +#if !defined PRIdLEAST64 || PRI_MACROS_BROKEN +# undef PRIdLEAST64 +# define PRIdLEAST64 PRId64 +#endif +#if !defined PRIiLEAST64 || PRI_MACROS_BROKEN +# undef PRIiLEAST64 +# define PRIiLEAST64 PRIi64 +#endif +#if !defined PRIoLEAST64 || PRI_MACROS_BROKEN +# undef PRIoLEAST64 +# define PRIoLEAST64 PRIo64 +#endif +#if !defined PRIuLEAST64 || PRI_MACROS_BROKEN +# undef PRIuLEAST64 +# define PRIuLEAST64 PRIu64 +#endif +#if !defined PRIxLEAST64 || PRI_MACROS_BROKEN +# undef PRIxLEAST64 +# define PRIxLEAST64 PRIx64 +#endif +#if !defined PRIXLEAST64 || PRI_MACROS_BROKEN +# undef PRIXLEAST64 +# define PRIXLEAST64 PRIX64 +#endif +#if !defined PRIdFAST8 || PRI_MACROS_BROKEN +# undef PRIdFAST8 +# define PRIdFAST8 "d" +#endif +#if !defined PRIiFAST8 || PRI_MACROS_BROKEN +# undef PRIiFAST8 +# define PRIiFAST8 "i" +#endif +#if !defined PRIoFAST8 || PRI_MACROS_BROKEN +# undef PRIoFAST8 +# define PRIoFAST8 "o" +#endif +#if !defined PRIuFAST8 || PRI_MACROS_BROKEN +# undef PRIuFAST8 +# define PRIuFAST8 "u" +#endif +#if !defined PRIxFAST8 || PRI_MACROS_BROKEN +# undef PRIxFAST8 +# define PRIxFAST8 "x" +#endif +#if !defined PRIXFAST8 || PRI_MACROS_BROKEN +# undef PRIXFAST8 +# define PRIXFAST8 "X" +#endif +#if !defined PRIdFAST16 || PRI_MACROS_BROKEN +# undef PRIdFAST16 +# define PRIdFAST16 "d" +#endif +#if !defined PRIiFAST16 || PRI_MACROS_BROKEN +# undef PRIiFAST16 +# define PRIiFAST16 "i" +#endif +#if !defined PRIoFAST16 || PRI_MACROS_BROKEN +# undef PRIoFAST16 +# define PRIoFAST16 "o" +#endif +#if !defined PRIuFAST16 || PRI_MACROS_BROKEN +# undef PRIuFAST16 +# define PRIuFAST16 "u" +#endif +#if !defined PRIxFAST16 || PRI_MACROS_BROKEN +# undef PRIxFAST16 +# define PRIxFAST16 "x" +#endif +#if !defined PRIXFAST16 || PRI_MACROS_BROKEN +# undef PRIXFAST16 +# define PRIXFAST16 "X" +#endif +#if !defined PRIdFAST32 || PRI_MACROS_BROKEN +# undef PRIdFAST32 +# define PRIdFAST32 "d" +#endif +#if !defined PRIiFAST32 || PRI_MACROS_BROKEN +# undef PRIiFAST32 +# define PRIiFAST32 "i" +#endif +#if !defined PRIoFAST32 || PRI_MACROS_BROKEN +# undef PRIoFAST32 +# define PRIoFAST32 "o" +#endif +#if !defined PRIuFAST32 || PRI_MACROS_BROKEN +# undef PRIuFAST32 +# define PRIuFAST32 "u" +#endif +#if !defined PRIxFAST32 || PRI_MACROS_BROKEN +# undef PRIxFAST32 +# define PRIxFAST32 "x" +#endif +#if !defined PRIXFAST32 || PRI_MACROS_BROKEN +# undef PRIXFAST32 +# define PRIXFAST32 "X" +#endif +#if !defined PRIdFAST64 || PRI_MACROS_BROKEN +# undef PRIdFAST64 +# define PRIdFAST64 PRId64 +#endif +#if !defined PRIiFAST64 || PRI_MACROS_BROKEN +# undef PRIiFAST64 +# define PRIiFAST64 PRIi64 +#endif +#if !defined PRIoFAST64 || PRI_MACROS_BROKEN +# undef PRIoFAST64 +# define PRIoFAST64 PRIo64 +#endif +#if !defined PRIuFAST64 || PRI_MACROS_BROKEN +# undef PRIuFAST64 +# define PRIuFAST64 PRIu64 +#endif +#if !defined PRIxFAST64 || PRI_MACROS_BROKEN +# undef PRIxFAST64 +# define PRIxFAST64 PRIx64 +#endif +#if !defined PRIXFAST64 || PRI_MACROS_BROKEN +# undef PRIXFAST64 +# define PRIXFAST64 PRIX64 +#endif +#if !defined PRIdMAX || PRI_MACROS_BROKEN +# undef PRIdMAX +# define PRIdMAX (sizeof (uintmax_t) == sizeof (long) ? "ld" : "lld") +#endif +#if !defined PRIiMAX || PRI_MACROS_BROKEN +# undef PRIiMAX +# define PRIiMAX (sizeof (uintmax_t) == sizeof (long) ? "li" : "lli") +#endif +#if !defined PRIoMAX || PRI_MACROS_BROKEN +# undef PRIoMAX +# define PRIoMAX (sizeof (uintmax_t) == sizeof (long) ? "lo" : "llo") +#endif +#if !defined PRIuMAX || PRI_MACROS_BROKEN +# undef PRIuMAX +# define PRIuMAX (sizeof (uintmax_t) == sizeof (long) ? "lu" : "llu") +#endif +#if !defined PRIxMAX || PRI_MACROS_BROKEN +# undef PRIxMAX +# define PRIxMAX (sizeof (uintmax_t) == sizeof (long) ? "lx" : "llx") +#endif +#if !defined PRIXMAX || PRI_MACROS_BROKEN +# undef PRIXMAX +# define PRIXMAX (sizeof (uintmax_t) == sizeof (long) ? "lX" : "llX") +#endif +#if !defined PRIdPTR || PRI_MACROS_BROKEN +# undef PRIdPTR +# define PRIdPTR \ + (sizeof (void *) == sizeof (long) ? "ld" : \ + sizeof (void *) == sizeof (int) ? "d" : \ + "lld") +#endif +#if !defined PRIiPTR || PRI_MACROS_BROKEN +# undef PRIiPTR +# define PRIiPTR \ + (sizeof (void *) == sizeof (long) ? "li" : \ + sizeof (void *) == sizeof (int) ? "i" : \ + "lli") +#endif +#if !defined PRIoPTR || PRI_MACROS_BROKEN +# undef PRIoPTR +# define PRIoPTR \ + (sizeof (void *) == sizeof (long) ? "lo" : \ + sizeof (void *) == sizeof (int) ? "o" : \ + "llo") +#endif +#if !defined PRIuPTR || PRI_MACROS_BROKEN +# undef PRIuPTR +# define PRIuPTR \ + (sizeof (void *) == sizeof (long) ? "lu" : \ + sizeof (void *) == sizeof (int) ? "u" : \ + "llu") +#endif +#if !defined PRIxPTR || PRI_MACROS_BROKEN +# undef PRIxPTR +# define PRIxPTR \ + (sizeof (void *) == sizeof (long) ? "lx" : \ + sizeof (void *) == sizeof (int) ? "x" : \ + "llx") +#endif +#if !defined PRIXPTR || PRI_MACROS_BROKEN +# undef PRIXPTR +# define PRIXPTR \ + (sizeof (void *) == sizeof (long) ? "lX" : \ + sizeof (void *) == sizeof (int) ? "X" : \ + "llX") +#endif + +/* @@ end of prolog @@ */ + +#ifdef _LIBC +/* Rename the non ISO C functions. This is required by the standard + because some ISO C functions will require linking with this object + file and the name space must not be polluted. */ +# define open __open +# define close __close +# define read __read +# define mmap __mmap +# define munmap __munmap +#endif + +/* For those losing systems which don't have `alloca' we have to add + some additional code emulating it. */ +#ifdef HAVE_ALLOCA +# define freea(p) /* nothing */ +#else +# define alloca(n) malloc (n) +# define freea(p) free (p) +#endif + +/* For systems that distinguish between text and binary I/O. + O_BINARY is usually declared in . */ +#if !defined O_BINARY && defined _O_BINARY + /* For MSC-compatible compilers. */ +# define O_BINARY _O_BINARY +# define O_TEXT _O_TEXT +#endif +#ifdef __BEOS__ + /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ +# undef O_BINARY +# undef O_TEXT +#endif +/* On reasonable systems, binary I/O is the default. */ +#ifndef O_BINARY +# define O_BINARY 0 +#endif + + +/* Prototypes for local functions. Needed to ensure compiler checking of + function argument counts despite of K&R C function definition syntax. */ +static const char *get_sysdep_segment_value PARAMS ((const char *name)); + + +/* We need a sign, whether a new catalog was loaded, which can be associated + with all translations. This is important if the translations are + cached by one of GCC's features. */ +int _nl_msg_cat_cntr; + + +/* Expand a system dependent string segment. Return NULL if unsupported. */ +static const char * +get_sysdep_segment_value (name) + const char *name; +{ + /* Test for an ISO C 99 section 7.8.1 format string directive. + Syntax: + P R I { d | i | o | u | x | X } + { { | LEAST | FAST } { 8 | 16 | 32 | 64 } | MAX | PTR } */ + /* We don't use a table of 14 times 6 'const char *' strings here, because + data relocations cost startup time. */ + if (name[0] == 'P' && name[1] == 'R' && name[2] == 'I') + { + if (name[3] == 'd' || name[3] == 'i' || name[3] == 'o' || name[3] == 'u' + || name[3] == 'x' || name[3] == 'X') + { + if (name[4] == '8' && name[5] == '\0') + { + if (name[3] == 'd') + return PRId8; + if (name[3] == 'i') + return PRIi8; + if (name[3] == 'o') + return PRIo8; + if (name[3] == 'u') + return PRIu8; + if (name[3] == 'x') + return PRIx8; + if (name[3] == 'X') + return PRIX8; + abort (); + } + if (name[4] == '1' && name[5] == '6' && name[6] == '\0') + { + if (name[3] == 'd') + return PRId16; + if (name[3] == 'i') + return PRIi16; + if (name[3] == 'o') + return PRIo16; + if (name[3] == 'u') + return PRIu16; + if (name[3] == 'x') + return PRIx16; + if (name[3] == 'X') + return PRIX16; + abort (); + } + if (name[4] == '3' && name[5] == '2' && name[6] == '\0') + { + if (name[3] == 'd') + return PRId32; + if (name[3] == 'i') + return PRIi32; + if (name[3] == 'o') + return PRIo32; + if (name[3] == 'u') + return PRIu32; + if (name[3] == 'x') + return PRIx32; + if (name[3] == 'X') + return PRIX32; + abort (); + } + if (name[4] == '6' && name[5] == '4' && name[6] == '\0') + { + if (name[3] == 'd') + return PRId64; + if (name[3] == 'i') + return PRIi64; + if (name[3] == 'o') + return PRIo64; + if (name[3] == 'u') + return PRIu64; + if (name[3] == 'x') + return PRIx64; + if (name[3] == 'X') + return PRIX64; + abort (); + } + if (name[4] == 'L' && name[5] == 'E' && name[6] == 'A' + && name[7] == 'S' && name[8] == 'T') + { + if (name[9] == '8' && name[10] == '\0') + { + if (name[3] == 'd') + return PRIdLEAST8; + if (name[3] == 'i') + return PRIiLEAST8; + if (name[3] == 'o') + return PRIoLEAST8; + if (name[3] == 'u') + return PRIuLEAST8; + if (name[3] == 'x') + return PRIxLEAST8; + if (name[3] == 'X') + return PRIXLEAST8; + abort (); + } + if (name[9] == '1' && name[10] == '6' && name[11] == '\0') + { + if (name[3] == 'd') + return PRIdLEAST16; + if (name[3] == 'i') + return PRIiLEAST16; + if (name[3] == 'o') + return PRIoLEAST16; + if (name[3] == 'u') + return PRIuLEAST16; + if (name[3] == 'x') + return PRIxLEAST16; + if (name[3] == 'X') + return PRIXLEAST16; + abort (); + } + if (name[9] == '3' && name[10] == '2' && name[11] == '\0') + { + if (name[3] == 'd') + return PRIdLEAST32; + if (name[3] == 'i') + return PRIiLEAST32; + if (name[3] == 'o') + return PRIoLEAST32; + if (name[3] == 'u') + return PRIuLEAST32; + if (name[3] == 'x') + return PRIxLEAST32; + if (name[3] == 'X') + return PRIXLEAST32; + abort (); + } + if (name[9] == '6' && name[10] == '4' && name[11] == '\0') + { + if (name[3] == 'd') + return PRIdLEAST64; + if (name[3] == 'i') + return PRIiLEAST64; + if (name[3] == 'o') + return PRIoLEAST64; + if (name[3] == 'u') + return PRIuLEAST64; + if (name[3] == 'x') + return PRIxLEAST64; + if (name[3] == 'X') + return PRIXLEAST64; + abort (); + } + } + if (name[4] == 'F' && name[5] == 'A' && name[6] == 'S' + && name[7] == 'T') + { + if (name[8] == '8' && name[9] == '\0') + { + if (name[3] == 'd') + return PRIdFAST8; + if (name[3] == 'i') + return PRIiFAST8; + if (name[3] == 'o') + return PRIoFAST8; + if (name[3] == 'u') + return PRIuFAST8; + if (name[3] == 'x') + return PRIxFAST8; + if (name[3] == 'X') + return PRIXFAST8; + abort (); + } + if (name[8] == '1' && name[9] == '6' && name[10] == '\0') + { + if (name[3] == 'd') + return PRIdFAST16; + if (name[3] == 'i') + return PRIiFAST16; + if (name[3] == 'o') + return PRIoFAST16; + if (name[3] == 'u') + return PRIuFAST16; + if (name[3] == 'x') + return PRIxFAST16; + if (name[3] == 'X') + return PRIXFAST16; + abort (); + } + if (name[8] == '3' && name[9] == '2' && name[10] == '\0') + { + if (name[3] == 'd') + return PRIdFAST32; + if (name[3] == 'i') + return PRIiFAST32; + if (name[3] == 'o') + return PRIoFAST32; + if (name[3] == 'u') + return PRIuFAST32; + if (name[3] == 'x') + return PRIxFAST32; + if (name[3] == 'X') + return PRIXFAST32; + abort (); + } + if (name[8] == '6' && name[9] == '4' && name[10] == '\0') + { + if (name[3] == 'd') + return PRIdFAST64; + if (name[3] == 'i') + return PRIiFAST64; + if (name[3] == 'o') + return PRIoFAST64; + if (name[3] == 'u') + return PRIuFAST64; + if (name[3] == 'x') + return PRIxFAST64; + if (name[3] == 'X') + return PRIXFAST64; + abort (); + } + } + if (name[4] == 'M' && name[5] == 'A' && name[6] == 'X' + && name[7] == '\0') + { + if (name[3] == 'd') + return PRIdMAX; + if (name[3] == 'i') + return PRIiMAX; + if (name[3] == 'o') + return PRIoMAX; + if (name[3] == 'u') + return PRIuMAX; + if (name[3] == 'x') + return PRIxMAX; + if (name[3] == 'X') + return PRIXMAX; + abort (); + } + if (name[4] == 'P' && name[5] == 'T' && name[6] == 'R' + && name[7] == '\0') + { + if (name[3] == 'd') + return PRIdPTR; + if (name[3] == 'i') + return PRIiPTR; + if (name[3] == 'o') + return PRIoPTR; + if (name[3] == 'u') + return PRIuPTR; + if (name[3] == 'x') + return PRIxPTR; + if (name[3] == 'X') + return PRIXPTR; + abort (); + } + } + } + /* Other system dependent strings are not valid. */ + return NULL; +} + +/* Initialize the codeset dependent parts of an opened message catalog. + Return the header entry. */ +const char * +internal_function +_nl_init_domain_conv (domain_file, domain, domainbinding) + struct loaded_l10nfile *domain_file; + struct loaded_domain *domain; + struct binding *domainbinding; +{ + /* Find out about the character set the file is encoded with. + This can be found (in textual form) in the entry "". If this + entry does not exist or if this does not contain the `charset=' + information, we will assume the charset matches the one the + current locale and we don't have to perform any conversion. */ + char *nullentry; + size_t nullentrylen; + + /* Preinitialize fields, to avoid recursion during _nl_find_msg. */ + domain->codeset_cntr = + (domainbinding != NULL ? domainbinding->codeset_cntr : 0); +#ifdef _LIBC + domain->conv = (__gconv_t) -1; +#else +# if HAVE_ICONV + domain->conv = (iconv_t) -1; +# endif +#endif + domain->conv_tab = NULL; + + /* Get the header entry. */ + nullentry = _nl_find_msg (domain_file, domainbinding, "", &nullentrylen); + + if (nullentry != NULL) + { +#if defined _LIBC || HAVE_ICONV + const char *charsetstr; + + charsetstr = strstr (nullentry, "charset="); + if (charsetstr != NULL) + { + size_t len; + char *charset; + const char *outcharset; + + charsetstr += strlen ("charset="); + len = strcspn (charsetstr, " \t\n"); + + charset = (char *) alloca (len + 1); +# if defined _LIBC || HAVE_MEMPCPY + *((char *) mempcpy (charset, charsetstr, len)) = '\0'; +# else + memcpy (charset, charsetstr, len); + charset[len] = '\0'; +# endif + + /* The output charset should normally be determined by the + locale. But sometimes the locale is not used or not correctly + set up, so we provide a possibility for the user to override + this. Moreover, the value specified through + bind_textdomain_codeset overrides both. */ + if (domainbinding != NULL && domainbinding->codeset != NULL) + outcharset = domainbinding->codeset; + else + { + outcharset = getenv ("OUTPUT_CHARSET"); + if (outcharset == NULL || outcharset[0] == '\0') + { +# ifdef _LIBC + outcharset = _NL_CURRENT (LC_CTYPE, CODESET); +# else +# if HAVE_ICONV + extern const char *locale_charset PARAMS ((void)); + outcharset = locale_charset (); +# endif +# endif + } + } + +# ifdef _LIBC + /* We always want to use transliteration. */ + outcharset = norm_add_slashes (outcharset, "TRANSLIT"); + charset = norm_add_slashes (charset, NULL); + if (__gconv_open (outcharset, charset, &domain->conv, + GCONV_AVOID_NOCONV) + != __GCONV_OK) + domain->conv = (__gconv_t) -1; +# else +# if HAVE_ICONV + /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5, + we want to use transliteration. */ +# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \ + || _LIBICONV_VERSION >= 0x0105 + if (strchr (outcharset, '/') == NULL) + { + char *tmp; + + len = strlen (outcharset); + tmp = (char *) alloca (len + 10 + 1); + memcpy (tmp, outcharset, len); + memcpy (tmp + len, "//TRANSLIT", 10 + 1); + outcharset = tmp; + + domain->conv = iconv_open (outcharset, charset); + + freea (outcharset); + } + else +# endif + domain->conv = iconv_open (outcharset, charset); +# endif +# endif + + freea (charset); + } +#endif /* _LIBC || HAVE_ICONV */ + } + + return nullentry; +} + +/* Frees the codeset dependent parts of an opened message catalog. */ +void +internal_function +_nl_free_domain_conv (domain) + struct loaded_domain *domain; +{ + if (domain->conv_tab != NULL && domain->conv_tab != (char **) -1) + free (domain->conv_tab); + +#ifdef _LIBC + if (domain->conv != (__gconv_t) -1) + __gconv_close (domain->conv); +#else +# if HAVE_ICONV + if (domain->conv != (iconv_t) -1) + iconv_close (domain->conv); +# endif +#endif +} + +/* Load the message catalogs specified by FILENAME. If it is no valid + message catalog do nothing. */ +void +internal_function +_nl_load_domain (domain_file, domainbinding) + struct loaded_l10nfile *domain_file; + struct binding *domainbinding; +{ + int fd; + size_t size; +#ifdef _LIBC + struct stat64 st; +#else + struct stat st; +#endif + struct mo_file_header *data = (struct mo_file_header *) -1; + int use_mmap = 0; + struct loaded_domain *domain; + int revision; + const char *nullentry; + + domain_file->decided = 1; + domain_file->data = NULL; + + /* Note that it would be useless to store domainbinding in domain_file + because domainbinding might be == NULL now but != NULL later (after + a call to bind_textdomain_codeset). */ + + /* If the record does not represent a valid locale the FILENAME + might be NULL. This can happen when according to the given + specification the locale file name is different for XPG and CEN + syntax. */ + if (domain_file->filename == NULL) + return; + + /* Try to open the addressed file. */ + fd = open (domain_file->filename, O_RDONLY | O_BINARY); + if (fd == -1) + return; + + /* We must know about the size of the file. */ + if ( +#ifdef _LIBC + __builtin_expect (fstat64 (fd, &st) != 0, 0) +#else + __builtin_expect (fstat (fd, &st) != 0, 0) +#endif + || __builtin_expect ((size = (size_t) st.st_size) != st.st_size, 0) + || __builtin_expect (size < sizeof (struct mo_file_header), 0)) + { + /* Something went wrong. */ + close (fd); + return; + } + +#ifdef HAVE_MMAP + /* Now we are ready to load the file. If mmap() is available we try + this first. If not available or it failed we try to load it. */ + data = (struct mo_file_header *) mmap (NULL, size, PROT_READ, + MAP_PRIVATE, fd, 0); + + if (__builtin_expect (data != (struct mo_file_header *) -1, 1)) + { + /* mmap() call was successful. */ + close (fd); + use_mmap = 1; + } +#endif + + /* If the data is not yet available (i.e. mmap'ed) we try to load + it manually. */ + if (data == (struct mo_file_header *) -1) + { + size_t to_read; + char *read_ptr; + + data = (struct mo_file_header *) malloc (size); + if (data == NULL) + return; + + to_read = size; + read_ptr = (char *) data; + do + { + long int nb = (long int) read (fd, read_ptr, to_read); + if (nb <= 0) + { +#ifdef EINTR + if (nb == -1 && errno == EINTR) + continue; +#endif + close (fd); + return; + } + read_ptr += nb; + to_read -= nb; + } + while (to_read > 0); + + close (fd); + } + + /* Using the magic number we can test whether it really is a message + catalog file. */ + if (__builtin_expect (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED, + 0)) + { + /* The magic number is wrong: not a message catalog file. */ +#ifdef HAVE_MMAP + if (use_mmap) + munmap ((caddr_t) data, size); + else +#endif + free (data); + return; + } + + domain = (struct loaded_domain *) malloc (sizeof (struct loaded_domain)); + if (domain == NULL) + return; + domain_file->data = domain; + + domain->data = (char *) data; + domain->use_mmap = use_mmap; + domain->mmap_size = size; + domain->must_swap = data->magic != _MAGIC; + domain->malloced = NULL; + + /* Fill in the information about the available tables. */ + revision = W (domain->must_swap, data->revision); + /* We support only the major revision 0. */ + switch (revision >> 16) + { + case 0: + domain->nstrings = W (domain->must_swap, data->nstrings); + domain->orig_tab = (const struct string_desc *) + ((char *) data + W (domain->must_swap, data->orig_tab_offset)); + domain->trans_tab = (const struct string_desc *) + ((char *) data + W (domain->must_swap, data->trans_tab_offset)); + domain->hash_size = W (domain->must_swap, data->hash_tab_size); + domain->hash_tab = + (domain->hash_size > 2 + ? (const nls_uint32 *) + ((char *) data + W (domain->must_swap, data->hash_tab_offset)) + : NULL); + domain->must_swap_hash_tab = domain->must_swap; + + /* Now dispatch on the minor revision. */ + switch (revision & 0xffff) + { + case 0: + domain->n_sysdep_strings = 0; + domain->orig_sysdep_tab = NULL; + domain->trans_sysdep_tab = NULL; + break; + case 1: + default: + { + nls_uint32 n_sysdep_strings; + + if (domain->hash_tab == NULL) + /* This is invalid. These minor revisions need a hash table. */ + goto invalid; + + n_sysdep_strings = + W (domain->must_swap, data->n_sysdep_strings); + if (n_sysdep_strings > 0) + { + nls_uint32 n_sysdep_segments; + const struct sysdep_segment *sysdep_segments; + const char **sysdep_segment_values; + const nls_uint32 *orig_sysdep_tab; + const nls_uint32 *trans_sysdep_tab; + size_t memneed; + char *mem; + struct sysdep_string_desc *inmem_orig_sysdep_tab; + struct sysdep_string_desc *inmem_trans_sysdep_tab; + nls_uint32 *inmem_hash_tab; + unsigned int i; + + /* Get the values of the system dependent segments. */ + n_sysdep_segments = + W (domain->must_swap, data->n_sysdep_segments); + sysdep_segments = (const struct sysdep_segment *) + ((char *) data + + W (domain->must_swap, data->sysdep_segments_offset)); + sysdep_segment_values = + alloca (n_sysdep_segments * sizeof (const char *)); + for (i = 0; i < n_sysdep_segments; i++) + { + const char *name = + (char *) data + + W (domain->must_swap, sysdep_segments[i].offset); + nls_uint32 namelen = + W (domain->must_swap, sysdep_segments[i].length); + + if (!(namelen > 0 && name[namelen - 1] == '\0')) + { + freea (sysdep_segment_values); + goto invalid; + } + + sysdep_segment_values[i] = get_sysdep_segment_value (name); + } + + orig_sysdep_tab = (const nls_uint32 *) + ((char *) data + + W (domain->must_swap, data->orig_sysdep_tab_offset)); + trans_sysdep_tab = (const nls_uint32 *) + ((char *) data + + W (domain->must_swap, data->trans_sysdep_tab_offset)); + + /* Compute the amount of additional memory needed for the + system dependent strings and the augmented hash table. */ + memneed = 2 * n_sysdep_strings + * sizeof (struct sysdep_string_desc) + + domain->hash_size * sizeof (nls_uint32); + for (i = 0; i < 2 * n_sysdep_strings; i++) + { + const struct sysdep_string *sysdep_string = + (const struct sysdep_string *) + ((char *) data + + W (domain->must_swap, + i < n_sysdep_strings + ? orig_sysdep_tab[i] + : trans_sysdep_tab[i - n_sysdep_strings])); + size_t need = 0; + const struct segment_pair *p = sysdep_string->segments; + + if (W (domain->must_swap, p->sysdepref) != SEGMENTS_END) + for (p = sysdep_string->segments;; p++) + { + nls_uint32 sysdepref; + + need += W (domain->must_swap, p->segsize); + + sysdepref = W (domain->must_swap, p->sysdepref); + if (sysdepref == SEGMENTS_END) + break; + + if (sysdepref >= n_sysdep_segments) + { + /* Invalid. */ + freea (sysdep_segment_values); + goto invalid; + } + + need += strlen (sysdep_segment_values[sysdepref]); + } + + memneed += need; + } + + /* Allocate additional memory. */ + mem = (char *) malloc (memneed); + if (mem == NULL) + goto invalid; + + domain->malloced = mem; + inmem_orig_sysdep_tab = (struct sysdep_string_desc *) mem; + mem += n_sysdep_strings * sizeof (struct sysdep_string_desc); + inmem_trans_sysdep_tab = (struct sysdep_string_desc *) mem; + mem += n_sysdep_strings * sizeof (struct sysdep_string_desc); + inmem_hash_tab = (nls_uint32 *) mem; + mem += domain->hash_size * sizeof (nls_uint32); + + /* Compute the system dependent strings. */ + for (i = 0; i < 2 * n_sysdep_strings; i++) + { + const struct sysdep_string *sysdep_string = + (const struct sysdep_string *) + ((char *) data + + W (domain->must_swap, + i < n_sysdep_strings + ? orig_sysdep_tab[i] + : trans_sysdep_tab[i - n_sysdep_strings])); + const char *static_segments = + (char *) data + + W (domain->must_swap, sysdep_string->offset); + const struct segment_pair *p = sysdep_string->segments; + + /* Concatenate the segments, and fill + inmem_orig_sysdep_tab[i] (for i < n_sysdep_strings) and + inmem_trans_sysdep_tab[i-n_sysdep_strings] (for + i >= n_sysdep_strings). */ + + if (W (domain->must_swap, p->sysdepref) == SEGMENTS_END) + { + /* Only one static segment. */ + inmem_orig_sysdep_tab[i].length = + W (domain->must_swap, p->segsize); + inmem_orig_sysdep_tab[i].pointer = static_segments; + } + else + { + inmem_orig_sysdep_tab[i].pointer = mem; + + for (p = sysdep_string->segments;; p++) + { + nls_uint32 segsize = + W (domain->must_swap, p->segsize); + nls_uint32 sysdepref = + W (domain->must_swap, p->sysdepref); + size_t n; + + if (segsize > 0) + { + memcpy (mem, static_segments, segsize); + mem += segsize; + static_segments += segsize; + } + + if (sysdepref == SEGMENTS_END) + break; + + n = strlen (sysdep_segment_values[sysdepref]); + memcpy (mem, sysdep_segment_values[sysdepref], n); + mem += n; + } + + inmem_orig_sysdep_tab[i].length = + mem - inmem_orig_sysdep_tab[i].pointer; + } + } + + /* Compute the augmented hash table. */ + for (i = 0; i < domain->hash_size; i++) + inmem_hash_tab[i] = + W (domain->must_swap_hash_tab, domain->hash_tab[i]); + for (i = 0; i < n_sysdep_strings; i++) + { + const char *msgid = inmem_orig_sysdep_tab[i].pointer; + nls_uint32 hash_val = hash_string (msgid); + nls_uint32 idx = hash_val % domain->hash_size; + nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2)); + + for (;;) + { + if (inmem_hash_tab[idx] == 0) + { + /* Hash table entry is empty. Use it. */ + inmem_hash_tab[idx] = 1 + domain->nstrings + i; + break; + } + + if (idx >= domain->hash_size - incr) + idx -= domain->hash_size - incr; + else + idx += incr; + } + } + + freea (sysdep_segment_values); + + domain->n_sysdep_strings = n_sysdep_strings; + domain->orig_sysdep_tab = inmem_orig_sysdep_tab; + domain->trans_sysdep_tab = inmem_trans_sysdep_tab; + + domain->hash_tab = inmem_hash_tab; + domain->must_swap_hash_tab = 0; + } + else + { + domain->n_sysdep_strings = 0; + domain->orig_sysdep_tab = NULL; + domain->trans_sysdep_tab = NULL; + } + } + break; + } + break; + default: + /* This is an invalid revision. */ + invalid: + /* This is an invalid .mo file. */ + if (domain->malloced) + free (domain->malloced); +#ifdef HAVE_MMAP + if (use_mmap) + munmap ((caddr_t) data, size); + else +#endif + free (data); + free (domain); + domain_file->data = NULL; + return; + } + + /* Now initialize the character set converter from the character set + the file is encoded with (found in the header entry) to the domain's + specified character set or the locale's character set. */ + nullentry = _nl_init_domain_conv (domain_file, domain, domainbinding); + + /* Also look for a plural specification. */ + EXTRACT_PLURAL_EXPRESSION (nullentry, &domain->plural, &domain->nplurals); +} + + +#ifdef _LIBC +void +internal_function +_nl_unload_domain (domain) + struct loaded_domain *domain; +{ + if (domain->plural != &__gettext_germanic_plural) + __gettext_free_exp (domain->plural); + + _nl_free_domain_conv (domain); + + if (domain->malloced) + free (domain->malloced); + +# ifdef _POSIX_MAPPED_FILES + if (domain->use_mmap) + munmap ((caddr_t) domain->data, domain->mmap_size); + else +# endif /* _POSIX_MAPPED_FILES */ + free ((void *) domain->data); + + free (domain); +} +#endif diff --git a/lib/intl/localcharset.c b/lib/intl/localcharset.c new file mode 100644 index 0000000..6983d0b --- /dev/null +++ b/lib/intl/localcharset.c @@ -0,0 +1,399 @@ +/* localcharset.c - Determine a canonical name for the current locale's character encoding. */ + +/* Copyright (C) 2000-2003, 2005-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Written by Bruno Haible . */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +/* Specification. */ +#include "localcharset.h" + +#if HAVE_STDDEF_H +# include +#endif + +#include +#if HAVE_STRING_H +# include +#else +# include +#endif +#if HAVE_STDLIB_H +# include +#endif + +#if defined _WIN32 || defined __WIN32__ +# undef WIN32 /* avoid warning on mingw32 */ +# define WIN32 +#endif + +#if defined __EMX__ +/* Assume EMX program runs on OS/2, even if compiled under DOS. */ +# define OS2 +#endif + +#if !defined WIN32 +# if HAVE_LANGINFO_CODESET +# include +# else +# if HAVE_SETLOCALE +# include +# endif +# endif +#elif defined WIN32 +# define WIN32_LEAN_AND_MEAN +# include +#endif +#if defined OS2 +# define INCL_DOS +# include +#endif + +#if ENABLE_RELOCATABLE +# include "relocatable.h" +#else +# define relocate(pathname) (pathname) +#endif + +#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ + /* Win32, OS/2, DOS */ +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +#endif + +#ifndef DIRECTORY_SEPARATOR +# define DIRECTORY_SEPARATOR '/' +#endif + +#ifndef ISSLASH +# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR) +#endif + +#ifdef HAVE_GETC_UNLOCKED +# undef getc +# define getc getc_unlocked +#endif + +/* The following static variable is declared 'volatile' to avoid a + possible multithread problem in the function get_charset_aliases. If we + are running in a threaded environment, and if two threads initialize + 'charset_aliases' simultaneously, both will produce the same value, + and everything will be ok if the two assignments to 'charset_aliases' + are atomic. But I don't know what will happen if the two assignments mix. */ +#if __STDC__ != 1 +# define volatile /* empty */ +#endif +/* Pointer to the contents of the charset.alias file, if it has already been + read, else NULL. Its format is: + ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */ +static const char * volatile charset_aliases; + +/* Return a pointer to the contents of the charset.alias file. */ +static const char * +get_charset_aliases () +{ + const char *cp; + + cp = charset_aliases; + if (cp == NULL) + { +#if !(defined VMS || defined WIN32) + FILE *fp; + const char *dir = relocate (LIBDIR); + const char *base = "charset.alias"; + char *file_name; + + /* Concatenate dir and base into freshly allocated file_name. */ + { + size_t dir_len = strlen (dir); + size_t base_len = strlen (base); + int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1])); + file_name = (char *) malloc (dir_len + add_slash + base_len + 1); + if (file_name != NULL) + { + memcpy (file_name, dir, dir_len); + if (add_slash) + file_name[dir_len] = DIRECTORY_SEPARATOR; + memcpy (file_name + dir_len + add_slash, base, base_len + 1); + } + } + + if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL) + /* Out of memory or file not found, treat it as empty. */ + cp = ""; + else + { + /* Parse the file's contents. */ + int c; + char buf1[50+1]; + char buf2[50+1]; + char *res_ptr = NULL; + size_t res_size = 0; + size_t l1, l2; + + for (;;) + { + c = getc (fp); + if (c == EOF) + break; + if (c == '\n' || c == ' ' || c == '\t') + continue; + if (c == '#') + { + /* Skip comment, to end of line. */ + do + c = getc (fp); + while (!(c == EOF || c == '\n')); + if (c == EOF) + break; + continue; + } + ungetc (c, fp); + if (fscanf (fp, "%50s %50s", buf1, buf2) < 2) + break; + l1 = strlen (buf1); + l2 = strlen (buf2); + if (res_size == 0) + { + res_size = l1 + 1 + l2 + 1; + res_ptr = (char *) malloc (res_size + 1); + } + else + { + res_size += l1 + 1 + l2 + 1; + res_ptr = (char *) realloc (res_ptr, res_size + 1); + } + if (res_ptr == NULL) + { + /* Out of memory. */ + res_size = 0; + break; + } + strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1); + strcpy (res_ptr + res_size - (l2 + 1), buf2); + } + fclose (fp); + if (res_size == 0) + cp = ""; + else + { + *(res_ptr + res_size) = '\0'; + cp = res_ptr; + } + } + + if (file_name != NULL) + free (file_name); + +#else + +# if defined VMS + /* To avoid the troubles of an extra file charset.alias_vms in the + sources of many GNU packages, simply inline the aliases here. */ + /* The list of encodings is taken from the OpenVMS 7.3-1 documentation + "Compaq C Run-Time Library Reference Manual for OpenVMS systems" + section 10.7 "Handling Different Character Sets". */ + cp = "ISO8859-1" "\0" "ISO-8859-1" "\0" + "ISO8859-2" "\0" "ISO-8859-2" "\0" + "ISO8859-5" "\0" "ISO-8859-5" "\0" + "ISO8859-7" "\0" "ISO-8859-7" "\0" + "ISO8859-8" "\0" "ISO-8859-8" "\0" + "ISO8859-9" "\0" "ISO-8859-9" "\0" + /* Japanese */ + "eucJP" "\0" "EUC-JP" "\0" + "SJIS" "\0" "SHIFT_JIS" "\0" + "DECKANJI" "\0" "DEC-KANJI" "\0" + "SDECKANJI" "\0" "EUC-JP" "\0" + /* Chinese */ + "eucTW" "\0" "EUC-TW" "\0" + "DECHANYU" "\0" "DEC-HANYU" "\0" + "DECHANZI" "\0" "GB2312" "\0" + /* Korean */ + "DECKOREAN" "\0" "EUC-KR" "\0"; +# endif + +# if defined WIN32 + /* To avoid the troubles of installing a separate file in the same + directory as the DLL and of retrieving the DLL's directory at + runtime, simply inline the aliases here. */ + + cp = "CP936" "\0" "GBK" "\0" + "CP1361" "\0" "JOHAB" "\0" + "CP20127" "\0" "ASCII" "\0" + "CP20866" "\0" "KOI8-R" "\0" + "CP21866" "\0" "KOI8-RU" "\0" + "CP28591" "\0" "ISO-8859-1" "\0" + "CP28592" "\0" "ISO-8859-2" "\0" + "CP28593" "\0" "ISO-8859-3" "\0" + "CP28594" "\0" "ISO-8859-4" "\0" + "CP28595" "\0" "ISO-8859-5" "\0" + "CP28596" "\0" "ISO-8859-6" "\0" + "CP28597" "\0" "ISO-8859-7" "\0" + "CP28598" "\0" "ISO-8859-8" "\0" + "CP28599" "\0" "ISO-8859-9" "\0" + "CP28605" "\0" "ISO-8859-15" "\0"; +# endif +#endif + + charset_aliases = cp; + } + + return cp; +} + +/* Determine the current locale's character encoding, and canonicalize it + into one of the canonical names listed in config.charset. + The result must not be freed; it is statically allocated. + If the canonical name cannot be determined, the result is a non-canonical + name. */ + +#ifdef STATIC +STATIC +#endif +const char * +locale_charset () +{ + const char *codeset; + const char *aliases; + +#if !(defined WIN32 || defined OS2) + +# if HAVE_LANGINFO_CODESET + + /* Most systems support nl_langinfo (CODESET) nowadays. */ + codeset = nl_langinfo (CODESET); + +# else + + /* On old systems which lack it, use setlocale or getenv. */ + const char *locale = NULL; + + /* But most old systems don't have a complete set of locales. Some + (like SunOS 4 or DJGPP) have only the C locale. Therefore we don't + use setlocale here; it would return "C" when it doesn't support the + locale name the user has set. */ +# if HAVE_SETLOCALE && 0 + locale = setlocale (LC_CTYPE, NULL); +# endif + if (locale == NULL || locale[0] == '\0') + { + locale = getenv ("LC_ALL"); + if (locale == NULL || locale[0] == '\0') + { + locale = getenv ("LC_CTYPE"); + if (locale == NULL || locale[0] == '\0') + locale = getenv ("LANG"); + } + } + + /* On some old systems, one used to set locale = "iso8859_1". On others, + you set it to "language_COUNTRY.charset". In any case, we resolve it + through the charset.alias file. */ + codeset = locale; + +# endif + +#elif defined WIN32 + + static char buf[2 + 10 + 1]; + + /* Woe32 has a function returning the locale's codepage as a number. */ + sprintf (buf, "CP%u", GetACP ()); + codeset = buf; + +#elif defined OS2 + + const char *locale; + static char buf[2 + 10 + 1]; + ULONG cp[3]; + ULONG cplen; + + /* Allow user to override the codeset, as set in the operating system, + with standard language environment variables. */ + locale = getenv ("LC_ALL"); + if (locale == NULL || locale[0] == '\0') + { + locale = getenv ("LC_CTYPE"); + if (locale == NULL || locale[0] == '\0') + locale = getenv ("LANG"); + } + if (locale != NULL && locale[0] != '\0') + { + /* If the locale name contains an encoding after the dot, return it. */ + const char *dot = strchr (locale, '.'); + + if (dot != NULL) + { + const char *modifier; + + dot++; + /* Look for the possible @... trailer and remove it, if any. */ + modifier = strchr (dot, '@'); + if (modifier == NULL) + return dot; + if (modifier - dot < sizeof (buf)) + { + memcpy (buf, dot, modifier - dot); + buf [modifier - dot] = '\0'; + return buf; + } + } + + /* Resolve through the charset.alias file. */ + codeset = locale; + } + else + { + /* OS/2 has a function returning the locale's codepage as a number. */ + if (DosQueryCp (sizeof (cp), cp, &cplen)) + codeset = ""; + else + { + sprintf (buf, "CP%u", cp[0]); + codeset = buf; + } + } + +#endif + + if (codeset == NULL) + /* The canonical name cannot be determined. */ + codeset = ""; + + /* Resolve alias. */ + for (aliases = get_charset_aliases (); + *aliases != '\0'; + aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1) + if (strcmp (codeset, aliases) == 0 + || (aliases[0] == '*' && aliases[1] == '\0')) + { + codeset = aliases + strlen (aliases) + 1; + break; + } + + /* Don't return an empty string. GNU libc and GNU libiconv interpret + the empty string as denoting "the locale's character encoding", + thus GNU libiconv would call this function a second time. */ + if (codeset[0] == '\0') + codeset = "ASCII"; + + return codeset; +} diff --git a/lib/intl/localcharset.h b/lib/intl/localcharset.h new file mode 100644 index 0000000..e529958 --- /dev/null +++ b/lib/intl/localcharset.h @@ -0,0 +1,43 @@ +/* localcharset.h - Determine a canonical name for the current locale's character encoding. */ + +/* Copyright (C) 2000-2003, 2005-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _LOCALCHARSET_H +#define _LOCALCHARSET_H + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Determine the current locale's character encoding, and canonicalize it + into one of the canonical names listed in config.charset. + The result must not be freed; it is statically allocated. + If the canonical name cannot be determined, the result is a non-canonical + name. */ +extern const char * locale_charset (void); + + +#ifdef __cplusplus +} +#endif + + +#endif /* _LOCALCHARSET_H */ diff --git a/lib/intl/locale.alias b/lib/intl/locale.alias new file mode 100644 index 0000000..51dd21e --- /dev/null +++ b/lib/intl/locale.alias @@ -0,0 +1,78 @@ +# locale.alias - Locale name alias data base. +# +# Copyright (C) 1996,1997,1998,1999,2000,2001,2005-2009 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# The format of this file is the same as for the corresponding file of +# the X Window System, which normally can be found in +# /usr/lib/X11/locale/locale.alias +# A single line contains two fields: an alias and a substitution value. +# All entries are case independent. + +# Note: This file is far from being complete. If you have a value for +# your own site which you think might be useful for others too, share +# it with the rest of us. Send it using the `glibcbug' script to +# bugs@gnu.org. + +# Packages using this file: + +bokmal no_NO.ISO-8859-1 +bokmål no_NO.ISO-8859-1 +catalan ca_ES.ISO-8859-1 +croatian hr_HR.ISO-8859-2 +czech cs_CZ.ISO-8859-2 +danish da_DK.ISO-8859-1 +dansk da_DK.ISO-8859-1 +deutsch de_DE.ISO-8859-1 +dutch nl_NL.ISO-8859-1 +eesti et_EE.ISO-8859-1 +estonian et_EE.ISO-8859-1 +finnish fi_FI.ISO-8859-1 +français fr_FR.ISO-8859-1 +french fr_FR.ISO-8859-1 +galego gl_ES.ISO-8859-1 +galician gl_ES.ISO-8859-1 +german de_DE.ISO-8859-1 +greek el_GR.ISO-8859-7 +hebrew he_IL.ISO-8859-8 +hrvatski hr_HR.ISO-8859-2 +hungarian hu_HU.ISO-8859-2 +icelandic is_IS.ISO-8859-1 +italian it_IT.ISO-8859-1 +japanese ja_JP.eucJP +japanese.euc ja_JP.eucJP +ja_JP ja_JP.eucJP +ja_JP.ujis ja_JP.eucJP +japanese.sjis ja_JP.SJIS +korean ko_KR.eucKR +korean.euc ko_KR.eucKR +ko_KR ko_KR.eucKR +lithuanian lt_LT.ISO-8859-13 +nb_NO no_NO.ISO-8859-1 +nb_NO.ISO-8859-1 no_NO.ISO-8859-1 +norwegian no_NO.ISO-8859-1 +nynorsk nn_NO.ISO-8859-1 +polish pl_PL.ISO-8859-2 +portuguese pt_PT.ISO-8859-1 +romanian ro_RO.ISO-8859-2 +russian ru_RU.ISO-8859-5 +slovak sk_SK.ISO-8859-2 +slovene sl_SI.ISO-8859-2 +slovenian sl_SI.ISO-8859-2 +spanish es_ES.ISO-8859-1 +swedish sv_SE.ISO-8859-1 +thai th_TH.TIS-620 +turkish tr_TR.ISO-8859-9 diff --git a/lib/intl/localealias.c b/lib/intl/localealias.c new file mode 100644 index 0000000..0d5ded7 --- /dev/null +++ b/lib/intl/localealias.c @@ -0,0 +1,424 @@ +/* localealias.c - Handle aliases for locale names. */ + +/* Copyright (C) 1995-1999, 2000-2001, 2003, 2005-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Tell glibc's to provide a prototype for mempcpy(). + This must come before because may include + , and once has been included, it's too late. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#if defined _LIBC || defined HAVE___FSETLOCKING +# include +#endif +#include + +#ifdef __GNUC__ +# undef alloca +# define alloca __builtin_alloca +# define HAVE_ALLOCA 1 +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# if defined HAVE_ALLOCA_H || defined _LIBC +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca +char *alloca (); +# endif +# endif +# endif +# endif +#endif + +#include +#include + +#include "gettextP.h" + +#if ENABLE_RELOCATABLE +# include "relocatable.h" +#else +# define relocate(pathname) (pathname) +#endif + +/* @@ end of prolog @@ */ + +#ifdef _LIBC +/* Rename the non ANSI C functions. This is required by the standard + because some ANSI C functions will require linking with this object + file and the name space must not be polluted. */ +# define strcasecmp __strcasecmp + +# ifndef mempcpy +# define mempcpy __mempcpy +# endif +# define HAVE_MEMPCPY 1 +# define HAVE___FSETLOCKING 1 + +/* We need locking here since we can be called from different places. */ +# include + +__libc_lock_define_initialized (static, lock); +#endif + +#ifndef internal_function +# define internal_function +#endif + +/* Some optimizations for glibc. */ +#ifdef _LIBC +# define FEOF(fp) feof_unlocked (fp) +# define FGETS(buf, n, fp) fgets_unlocked (buf, n, fp) +#else +# define FEOF(fp) feof (fp) +# define FGETS(buf, n, fp) fgets (buf, n, fp) +#endif + +/* For those losing systems which don't have `alloca' we have to add + some additional code emulating it. */ +#ifdef HAVE_ALLOCA +# define freea(p) /* nothing */ +#else +# define alloca(n) malloc (n) +# define freea(p) free (p) +#endif + +#if defined _LIBC_REENTRANT || defined HAVE_FGETS_UNLOCKED +# undef fgets +# define fgets(buf, len, s) fgets_unlocked (buf, len, s) +#endif +#if defined _LIBC_REENTRANT || defined HAVE_FEOF_UNLOCKED +# undef feof +# define feof(s) feof_unlocked (s) +#endif + + +struct alias_map +{ + const char *alias; + const char *value; +}; + + +#ifndef _LIBC +# define libc_freeres_ptr(decl) decl +#endif + +libc_freeres_ptr (static char *string_space); +static size_t string_space_act; +static size_t string_space_max; +libc_freeres_ptr (static struct alias_map *map); +static size_t nmap; +static size_t maxmap; + + +/* Prototypes for local functions. */ +static size_t read_alias_file PARAMS ((const char *fname, int fname_len)) + internal_function; +static int extend_alias_table PARAMS ((void)); +static int alias_compare PARAMS ((const struct alias_map *map1, + const struct alias_map *map2)); + + +const char * +_nl_expand_alias (name) + const char *name; +{ + static const char *locale_alias_path; + struct alias_map *retval; + const char *result = NULL; + size_t added; + +#ifdef _LIBC + __libc_lock_lock (lock); +#endif + + if (locale_alias_path == NULL) + locale_alias_path = LOCALE_ALIAS_PATH; + + do + { + struct alias_map item; + + item.alias = name; + + if (nmap > 0) + retval = (struct alias_map *) bsearch (&item, map, nmap, + sizeof (struct alias_map), + (int (*) PARAMS ((const void *, + const void *)) + ) alias_compare); + else + retval = NULL; + + /* We really found an alias. Return the value. */ + if (retval != NULL) + { + result = retval->value; + break; + } + + /* Perhaps we can find another alias file. */ + added = 0; + while (added == 0 && locale_alias_path[0] != '\0') + { + const char *start; + + while (locale_alias_path[0] == PATH_SEPARATOR) + ++locale_alias_path; + start = locale_alias_path; + + while (locale_alias_path[0] != '\0' + && locale_alias_path[0] != PATH_SEPARATOR) + ++locale_alias_path; + + if (start < locale_alias_path) + added = read_alias_file (start, locale_alias_path - start); + } + } + while (added != 0); + +#ifdef _LIBC + __libc_lock_unlock (lock); +#endif + + return result; +} + + +static size_t +internal_function +read_alias_file (fname, fname_len) + const char *fname; + int fname_len; +{ + FILE *fp; + char *full_fname; + size_t added; + static const char aliasfile[] = "/locale.alias"; + + full_fname = (char *) alloca (fname_len + sizeof aliasfile); +#ifdef HAVE_MEMPCPY + mempcpy (mempcpy (full_fname, fname, fname_len), + aliasfile, sizeof aliasfile); +#else + memcpy (full_fname, fname, fname_len); + memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile); +#endif + + fp = fopen (relocate (full_fname), "r"); + freea (full_fname); + if (fp == NULL) + return 0; + +#ifdef HAVE___FSETLOCKING + /* No threads present. */ + __fsetlocking (fp, FSETLOCKING_BYCALLER); +#endif + + added = 0; + while (!FEOF (fp)) + { + /* It is a reasonable approach to use a fix buffer here because + a) we are only interested in the first two fields + b) these fields must be usable as file names and so must not + be that long + We avoid a multi-kilobyte buffer here since this would use up + stack space which we might not have if the program ran out of + memory. */ + char buf[400]; + char *alias; + char *value; + char *cp; + + if (FGETS (buf, sizeof buf, fp) == NULL) + /* EOF reached. */ + break; + + cp = buf; + /* Ignore leading white space. */ + while (isspace ((unsigned char) cp[0])) + ++cp; + + /* A leading '#' signals a comment line. */ + if (cp[0] != '\0' && cp[0] != '#') + { + alias = cp++; + while (cp[0] != '\0' && !isspace ((unsigned char) cp[0])) + ++cp; + /* Terminate alias name. */ + if (cp[0] != '\0') + *cp++ = '\0'; + + /* Now look for the beginning of the value. */ + while (isspace ((unsigned char) cp[0])) + ++cp; + + if (cp[0] != '\0') + { + size_t alias_len; + size_t value_len; + + value = cp++; + while (cp[0] != '\0' && !isspace ((unsigned char) cp[0])) + ++cp; + /* Terminate value. */ + if (cp[0] == '\n') + { + /* This has to be done to make the following test + for the end of line possible. We are looking for + the terminating '\n' which do not overwrite here. */ + *cp++ = '\0'; + *cp = '\n'; + } + else if (cp[0] != '\0') + *cp++ = '\0'; + + if (nmap >= maxmap) + if (__builtin_expect (extend_alias_table (), 0)) + { + fclose (fp); + return added; + } + + alias_len = strlen (alias) + 1; + value_len = strlen (value) + 1; + + if (string_space_act + alias_len + value_len > string_space_max) + { + /* Increase size of memory pool. */ + size_t new_size = (string_space_max + + (alias_len + value_len > 1024 + ? alias_len + value_len : 1024)); + char *new_pool = (char *) realloc (string_space, new_size); + if (new_pool == NULL) + return added; + + if (__builtin_expect (string_space != new_pool, 0)) + { + size_t i; + + for (i = 0; i < nmap; i++) + { + map[i].alias += new_pool - string_space; + map[i].value += new_pool - string_space; + } + } + + string_space = new_pool; + string_space_max = new_size; + } + + map[nmap].alias = memcpy (&string_space[string_space_act], + alias, alias_len); + string_space_act += alias_len; + + map[nmap].value = memcpy (&string_space[string_space_act], + value, value_len); + string_space_act += value_len; + + ++nmap; + ++added; + } + } + + /* Possibly not the whole line fits into the buffer. Ignore + the rest of the line. */ + while (strchr (buf, '\n') == NULL) + if (FGETS (buf, sizeof buf, fp) == NULL) + /* Make sure the inner loop will be left. The outer loop + will exit at the `feof' test. */ + break; + } + + /* Should we test for ferror()? I think we have to silently ignore + errors. --drepper */ + fclose (fp); + + if (added > 0) + qsort (map, nmap, sizeof (struct alias_map), + (int (*) PARAMS ((const void *, const void *))) alias_compare); + + return added; +} + + +static int +extend_alias_table () +{ + size_t new_size; + struct alias_map *new_map; + + new_size = maxmap == 0 ? 100 : 2 * maxmap; + new_map = (struct alias_map *) realloc (map, (new_size + * sizeof (struct alias_map))); + if (new_map == NULL) + /* Simply don't extend: we don't have any more core. */ + return -1; + + map = new_map; + maxmap = new_size; + return 0; +} + + +static int +alias_compare (map1, map2) + const struct alias_map *map1; + const struct alias_map *map2; +{ +#if defined _LIBC || defined HAVE_STRCASECMP + return strcasecmp (map1->alias, map2->alias); +#else + const unsigned char *p1 = (const unsigned char *) map1->alias; + const unsigned char *p2 = (const unsigned char *) map2->alias; + unsigned char c1, c2; + + if (p1 == p2) + return 0; + + do + { + /* I know this seems to be odd but the tolower() function in + some systems libc cannot handle nonalpha characters. */ + c1 = isupper (*p1) ? tolower (*p1) : *p1; + c2 = isupper (*p2) ? tolower (*p2) : *p2; + if (c1 == '\0') + break; + ++p1; + ++p2; + } + while (c1 == c2); + + return c1 - c2; +#endif +} diff --git a/lib/intl/localename.c b/lib/intl/localename.c new file mode 100644 index 0000000..795a34f --- /dev/null +++ b/lib/intl/localename.c @@ -0,0 +1,774 @@ +/* localename.c - Determine the current selected locale. */ + +/* Copyright (C) 1995-1999, 2000-2002, 2005-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Written by Ulrich Drepper , 1995. */ +/* Win32 code written by Tor Lillqvist . */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +#if defined _WIN32 || defined __WIN32__ +# undef WIN32 /* avoid warning on mingw32 */ +# define WIN32 +#endif + +#ifdef WIN32 +# define WIN32_LEAN_AND_MEAN +# include +/* Mingw headers don't have latest language and sublanguage codes. */ +# ifndef LANG_AFRIKAANS +# define LANG_AFRIKAANS 0x36 +# endif +# ifndef LANG_ALBANIAN +# define LANG_ALBANIAN 0x1c +# endif +# ifndef LANG_ARABIC +# define LANG_ARABIC 0x01 +# endif +# ifndef LANG_ARMENIAN +# define LANG_ARMENIAN 0x2b +# endif +# ifndef LANG_ASSAMESE +# define LANG_ASSAMESE 0x4d +# endif +# ifndef LANG_AZERI +# define LANG_AZERI 0x2c +# endif +# ifndef LANG_BASQUE +# define LANG_BASQUE 0x2d +# endif +# ifndef LANG_BELARUSIAN +# define LANG_BELARUSIAN 0x23 +# endif +# ifndef LANG_BENGALI +# define LANG_BENGALI 0x45 +# endif +# ifndef LANG_CATALAN +# define LANG_CATALAN 0x03 +# endif +# ifndef LANG_DIVEHI +# define LANG_DIVEHI 0x65 +# endif +# ifndef LANG_ESTONIAN +# define LANG_ESTONIAN 0x25 +# endif +# ifndef LANG_FAEROESE +# define LANG_FAEROESE 0x38 +# endif +# ifndef LANG_FARSI +# define LANG_FARSI 0x29 +# endif +# ifndef LANG_GALICIAN +# define LANG_GALICIAN 0x56 +# endif +# ifndef LANG_GEORGIAN +# define LANG_GEORGIAN 0x37 +# endif +# ifndef LANG_GUJARATI +# define LANG_GUJARATI 0x47 +# endif +# ifndef LANG_HEBREW +# define LANG_HEBREW 0x0d +# endif +# ifndef LANG_HINDI +# define LANG_HINDI 0x39 +# endif +# ifndef LANG_INDONESIAN +# define LANG_INDONESIAN 0x21 +# endif +# ifndef LANG_KANNADA +# define LANG_KANNADA 0x4b +# endif +# ifndef LANG_KASHMIRI +# define LANG_KASHMIRI 0x60 +# endif +# ifndef LANG_KAZAK +# define LANG_KAZAK 0x3f +# endif +# ifndef LANG_KONKANI +# define LANG_KONKANI 0x57 +# endif +# ifndef LANG_KYRGYZ +# define LANG_KYRGYZ 0x40 +# endif +# ifndef LANG_LATVIAN +# define LANG_LATVIAN 0x26 +# endif +# ifndef LANG_LITHUANIAN +# define LANG_LITHUANIAN 0x27 +# endif +# ifndef LANG_MACEDONIAN +# define LANG_MACEDONIAN 0x2f +# endif +# ifndef LANG_MALAY +# define LANG_MALAY 0x3e +# endif +# ifndef LANG_MALAYALAM +# define LANG_MALAYALAM 0x4c +# endif +# ifndef LANG_MANIPURI +# define LANG_MANIPURI 0x58 +# endif +# ifndef LANG_MARATHI +# define LANG_MARATHI 0x4e +# endif +# ifndef LANG_MONGOLIAN +# define LANG_MONGOLIAN 0x50 +# endif +# ifndef LANG_NEPALI +# define LANG_NEPALI 0x61 +# endif +# ifndef LANG_ORIYA +# define LANG_ORIYA 0x48 +# endif +# ifndef LANG_PUNJABI +# define LANG_PUNJABI 0x46 +# endif +# ifndef LANG_SANSKRIT +# define LANG_SANSKRIT 0x4f +# endif +# ifndef LANG_SERBIAN +# define LANG_SERBIAN 0x1a +# endif +# ifndef LANG_SINDHI +# define LANG_SINDHI 0x59 +# endif +# ifndef LANG_SLOVAK +# define LANG_SLOVAK 0x1b +# endif +# ifndef LANG_SORBIAN +# define LANG_SORBIAN 0x2e +# endif +# ifndef LANG_SWAHILI +# define LANG_SWAHILI 0x41 +# endif +# ifndef LANG_SYRIAC +# define LANG_SYRIAC 0x5a +# endif +# ifndef LANG_TAMIL +# define LANG_TAMIL 0x49 +# endif +# ifndef LANG_TATAR +# define LANG_TATAR 0x44 +# endif +# ifndef LANG_TELUGU +# define LANG_TELUGU 0x4a +# endif +# ifndef LANG_THAI +# define LANG_THAI 0x1e +# endif +# ifndef LANG_UKRAINIAN +# define LANG_UKRAINIAN 0x22 +# endif +# ifndef LANG_URDU +# define LANG_URDU 0x20 +# endif +# ifndef LANG_UZBEK +# define LANG_UZBEK 0x43 +# endif +# ifndef LANG_VIETNAMESE +# define LANG_VIETNAMESE 0x2a +# endif +# ifndef SUBLANG_ARABIC_SAUDI_ARABIA +# define SUBLANG_ARABIC_SAUDI_ARABIA 0x01 +# endif +# ifndef SUBLANG_ARABIC_IRAQ +# define SUBLANG_ARABIC_IRAQ 0x02 +# endif +# ifndef SUBLANG_ARABIC_EGYPT +# define SUBLANG_ARABIC_EGYPT 0x03 +# endif +# ifndef SUBLANG_ARABIC_LIBYA +# define SUBLANG_ARABIC_LIBYA 0x04 +# endif +# ifndef SUBLANG_ARABIC_ALGERIA +# define SUBLANG_ARABIC_ALGERIA 0x05 +# endif +# ifndef SUBLANG_ARABIC_MOROCCO +# define SUBLANG_ARABIC_MOROCCO 0x06 +# endif +# ifndef SUBLANG_ARABIC_TUNISIA +# define SUBLANG_ARABIC_TUNISIA 0x07 +# endif +# ifndef SUBLANG_ARABIC_OMAN +# define SUBLANG_ARABIC_OMAN 0x08 +# endif +# ifndef SUBLANG_ARABIC_YEMEN +# define SUBLANG_ARABIC_YEMEN 0x09 +# endif +# ifndef SUBLANG_ARABIC_SYRIA +# define SUBLANG_ARABIC_SYRIA 0x0a +# endif +# ifndef SUBLANG_ARABIC_JORDAN +# define SUBLANG_ARABIC_JORDAN 0x0b +# endif +# ifndef SUBLANG_ARABIC_LEBANON +# define SUBLANG_ARABIC_LEBANON 0x0c +# endif +# ifndef SUBLANG_ARABIC_KUWAIT +# define SUBLANG_ARABIC_KUWAIT 0x0d +# endif +# ifndef SUBLANG_ARABIC_UAE +# define SUBLANG_ARABIC_UAE 0x0e +# endif +# ifndef SUBLANG_ARABIC_BAHRAIN +# define SUBLANG_ARABIC_BAHRAIN 0x0f +# endif +# ifndef SUBLANG_ARABIC_QATAR +# define SUBLANG_ARABIC_QATAR 0x10 +# endif +# ifndef SUBLANG_AZERI_LATIN +# define SUBLANG_AZERI_LATIN 0x01 +# endif +# ifndef SUBLANG_AZERI_CYRILLIC +# define SUBLANG_AZERI_CYRILLIC 0x02 +# endif +# ifndef SUBLANG_CHINESE_MACAU +# define SUBLANG_CHINESE_MACAU 0x05 +# endif +# ifndef SUBLANG_ENGLISH_SOUTH_AFRICA +# define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07 +# endif +# ifndef SUBLANG_ENGLISH_JAMAICA +# define SUBLANG_ENGLISH_JAMAICA 0x08 +# endif +# ifndef SUBLANG_ENGLISH_CARIBBEAN +# define SUBLANG_ENGLISH_CARIBBEAN 0x09 +# endif +# ifndef SUBLANG_ENGLISH_BELIZE +# define SUBLANG_ENGLISH_BELIZE 0x0a +# endif +# ifndef SUBLANG_ENGLISH_TRINIDAD +# define SUBLANG_ENGLISH_TRINIDAD 0x0b +# endif +# ifndef SUBLANG_ENGLISH_ZIMBABWE +# define SUBLANG_ENGLISH_ZIMBABWE 0x0c +# endif +# ifndef SUBLANG_ENGLISH_PHILIPPINES +# define SUBLANG_ENGLISH_PHILIPPINES 0x0d +# endif +# ifndef SUBLANG_FRENCH_LUXEMBOURG +# define SUBLANG_FRENCH_LUXEMBOURG 0x05 +# endif +# ifndef SUBLANG_FRENCH_MONACO +# define SUBLANG_FRENCH_MONACO 0x06 +# endif +# ifndef SUBLANG_GERMAN_LUXEMBOURG +# define SUBLANG_GERMAN_LUXEMBOURG 0x04 +# endif +# ifndef SUBLANG_GERMAN_LIECHTENSTEIN +# define SUBLANG_GERMAN_LIECHTENSTEIN 0x05 +# endif +# ifndef SUBLANG_KASHMIRI_INDIA +# define SUBLANG_KASHMIRI_INDIA 0x02 +# endif +# ifndef SUBLANG_MALAY_MALAYSIA +# define SUBLANG_MALAY_MALAYSIA 0x01 +# endif +# ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM +# define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02 +# endif +# ifndef SUBLANG_NEPALI_INDIA +# define SUBLANG_NEPALI_INDIA 0x02 +# endif +# ifndef SUBLANG_SERBIAN_LATIN +# define SUBLANG_SERBIAN_LATIN 0x02 +# endif +# ifndef SUBLANG_SERBIAN_CYRILLIC +# define SUBLANG_SERBIAN_CYRILLIC 0x03 +# endif +# ifndef SUBLANG_SPANISH_GUATEMALA +# define SUBLANG_SPANISH_GUATEMALA 0x04 +# endif +# ifndef SUBLANG_SPANISH_COSTA_RICA +# define SUBLANG_SPANISH_COSTA_RICA 0x05 +# endif +# ifndef SUBLANG_SPANISH_PANAMA +# define SUBLANG_SPANISH_PANAMA 0x06 +# endif +# ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC +# define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07 +# endif +# ifndef SUBLANG_SPANISH_VENEZUELA +# define SUBLANG_SPANISH_VENEZUELA 0x08 +# endif +# ifndef SUBLANG_SPANISH_COLOMBIA +# define SUBLANG_SPANISH_COLOMBIA 0x09 +# endif +# ifndef SUBLANG_SPANISH_PERU +# define SUBLANG_SPANISH_PERU 0x0a +# endif +# ifndef SUBLANG_SPANISH_ARGENTINA +# define SUBLANG_SPANISH_ARGENTINA 0x0b +# endif +# ifndef SUBLANG_SPANISH_ECUADOR +# define SUBLANG_SPANISH_ECUADOR 0x0c +# endif +# ifndef SUBLANG_SPANISH_CHILE +# define SUBLANG_SPANISH_CHILE 0x0d +# endif +# ifndef SUBLANG_SPANISH_URUGUAY +# define SUBLANG_SPANISH_URUGUAY 0x0e +# endif +# ifndef SUBLANG_SPANISH_PARAGUAY +# define SUBLANG_SPANISH_PARAGUAY 0x0f +# endif +# ifndef SUBLANG_SPANISH_BOLIVIA +# define SUBLANG_SPANISH_BOLIVIA 0x10 +# endif +# ifndef SUBLANG_SPANISH_EL_SALVADOR +# define SUBLANG_SPANISH_EL_SALVADOR 0x11 +# endif +# ifndef SUBLANG_SPANISH_HONDURAS +# define SUBLANG_SPANISH_HONDURAS 0x12 +# endif +# ifndef SUBLANG_SPANISH_NICARAGUA +# define SUBLANG_SPANISH_NICARAGUA 0x13 +# endif +# ifndef SUBLANG_SPANISH_PUERTO_RICO +# define SUBLANG_SPANISH_PUERTO_RICO 0x14 +# endif +# ifndef SUBLANG_SWEDISH_FINLAND +# define SUBLANG_SWEDISH_FINLAND 0x02 +# endif +# ifndef SUBLANG_URDU_PAKISTAN +# define SUBLANG_URDU_PAKISTAN 0x01 +# endif +# ifndef SUBLANG_URDU_INDIA +# define SUBLANG_URDU_INDIA 0x02 +# endif +# ifndef SUBLANG_UZBEK_LATIN +# define SUBLANG_UZBEK_LATIN 0x01 +# endif +# ifndef SUBLANG_UZBEK_CYRILLIC +# define SUBLANG_UZBEK_CYRILLIC 0x02 +# endif +#endif + +/* XPG3 defines the result of 'setlocale (category, NULL)' as: + "Directs 'setlocale()' to query 'category' and return the current + setting of 'local'." + However it does not specify the exact format. Neither do SUSV2 and + ISO C 99. So we can use this feature only on selected systems (e.g. + those using GNU C Library). */ +#if defined _LIBC || (defined __GNU_LIBRARY__ && __GNU_LIBRARY__ >= 2) +# define HAVE_LOCALE_NULL +#endif + +/* Determine the current locale's name, and canonicalize it into XPG syntax + language[_territory[.codeset]][@modifier] + The codeset part in the result is not reliable; the locale_charset() + should be used for codeset information instead. + The result must not be freed; it is statically allocated. */ + +const char * +_nl_locale_name (category, categoryname) + int category; + const char *categoryname; +{ + const char *retval; + +#ifndef WIN32 + + /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'. + On some systems this can be done by the 'setlocale' function itself. */ +# if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL + retval = setlocale (category, NULL); +# else + /* Setting of LC_ALL overwrites all other. */ + retval = getenv ("LC_ALL"); + if (retval == NULL || retval[0] == '\0') + { + /* Next comes the name of the desired category. */ + retval = getenv (categoryname); + if (retval == NULL || retval[0] == '\0') + { + /* Last possibility is the LANG environment variable. */ + retval = getenv ("LANG"); + if (retval == NULL || retval[0] == '\0') + /* We use C as the default domain. POSIX says this is + implementation defined. */ + retval = "C"; + } + } +# endif + + return retval; + +#else /* WIN32 */ + + /* Return an XPG style locale name language[_territory][@modifier]. + Don't even bother determining the codeset; it's not useful in this + context, because message catalogs are not specific to a single + codeset. */ + + LCID lcid; + LANGID langid; + int primary, sub; + + /* Let the user override the system settings through environment + variables, as on POSIX systems. */ + retval = getenv ("LC_ALL"); + if (retval != NULL && retval[0] != '\0') + return retval; + retval = getenv (categoryname); + if (retval != NULL && retval[0] != '\0') + return retval; + retval = getenv ("LANG"); + if (retval != NULL && retval[0] != '\0') + return retval; + + /* Use native Win32 API locale ID. */ + lcid = GetThreadLocale (); + + /* Strip off the sorting rules, keep only the language part. */ + langid = LANGIDFROMLCID (lcid); + + /* Split into language and territory part. */ + primary = PRIMARYLANGID (langid); + sub = SUBLANGID (langid); + + /* Dispatch on language. + See also http://www.unicode.org/unicode/onlinedat/languages.html . + For details about languages, see http://www.ethnologue.com/ . */ + switch (primary) + { + case LANG_AFRIKAANS: return "af_ZA"; + case LANG_ALBANIAN: return "sq_AL"; + case 0x5e: /* AMHARIC */ return "am_ET"; + case LANG_ARABIC: + switch (sub) + { + case SUBLANG_ARABIC_SAUDI_ARABIA: return "ar_SA"; + case SUBLANG_ARABIC_IRAQ: return "ar_IQ"; + case SUBLANG_ARABIC_EGYPT: return "ar_EG"; + case SUBLANG_ARABIC_LIBYA: return "ar_LY"; + case SUBLANG_ARABIC_ALGERIA: return "ar_DZ"; + case SUBLANG_ARABIC_MOROCCO: return "ar_MA"; + case SUBLANG_ARABIC_TUNISIA: return "ar_TN"; + case SUBLANG_ARABIC_OMAN: return "ar_OM"; + case SUBLANG_ARABIC_YEMEN: return "ar_YE"; + case SUBLANG_ARABIC_SYRIA: return "ar_SY"; + case SUBLANG_ARABIC_JORDAN: return "ar_JO"; + case SUBLANG_ARABIC_LEBANON: return "ar_LB"; + case SUBLANG_ARABIC_KUWAIT: return "ar_KW"; + case SUBLANG_ARABIC_UAE: return "ar_AE"; + case SUBLANG_ARABIC_BAHRAIN: return "ar_BH"; + case SUBLANG_ARABIC_QATAR: return "ar_QA"; + } + return "ar"; + case LANG_ARMENIAN: return "hy_AM"; + case LANG_ASSAMESE: return "as_IN"; + case LANG_AZERI: + switch (sub) + { + /* FIXME: Adjust this when Azerbaijani locales appear on Unix. */ + case SUBLANG_AZERI_LATIN: return "az_AZ@latin"; + case SUBLANG_AZERI_CYRILLIC: return "az_AZ@cyrillic"; + } + return "az"; + case LANG_BASQUE: + return "eu"; /* Ambiguous: could be "eu_ES" or "eu_FR". */ + case LANG_BELARUSIAN: return "be_BY"; + case LANG_BENGALI: return "bn_IN"; + case LANG_BULGARIAN: return "bg_BG"; + case 0x55: /* BURMESE */ return "my_MM"; + case 0x53: /* CAMBODIAN */ return "km_KH"; + case LANG_CATALAN: return "ca_ES"; + case 0x5c: /* CHEROKEE */ return "chr_US"; + case LANG_CHINESE: + switch (sub) + { + case SUBLANG_CHINESE_TRADITIONAL: return "zh_TW"; + case SUBLANG_CHINESE_SIMPLIFIED: return "zh_CN"; + case SUBLANG_CHINESE_HONGKONG: return "zh_HK"; + case SUBLANG_CHINESE_SINGAPORE: return "zh_SG"; + case SUBLANG_CHINESE_MACAU: return "zh_MO"; + } + return "zh"; + case LANG_CROATIAN: /* LANG_CROATIAN == LANG_SERBIAN + * What used to be called Serbo-Croatian + * should really now be two separate + * languages because of political reasons. + * (Says tml, who knows nothing about Serbian + * or Croatian.) + * (I can feel those flames coming already.) + */ + switch (sub) + { + case SUBLANG_DEFAULT: return "hr_HR"; + case SUBLANG_SERBIAN_LATIN: return "sr_YU"; + case SUBLANG_SERBIAN_CYRILLIC: return "sr_YU@cyrillic"; + } + return "hr"; + case LANG_CZECH: return "cs_CZ"; + case LANG_DANISH: return "da_DK"; + case LANG_DIVEHI: return "div_MV"; + case LANG_DUTCH: + switch (sub) + { + case SUBLANG_DUTCH: return "nl_NL"; + case SUBLANG_DUTCH_BELGIAN: /* FLEMISH, VLAAMS */ return "nl_BE"; + } + return "nl"; + case 0x66: /* EDO */ return "bin_NG"; + case LANG_ENGLISH: + switch (sub) + { + /* SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. Heh. I thought + * English was the language spoken in England. + * Oh well. + */ + case SUBLANG_ENGLISH_US: return "en_US"; + case SUBLANG_ENGLISH_UK: return "en_GB"; + case SUBLANG_ENGLISH_AUS: return "en_AU"; + case SUBLANG_ENGLISH_CAN: return "en_CA"; + case SUBLANG_ENGLISH_NZ: return "en_NZ"; + case SUBLANG_ENGLISH_EIRE: return "en_IE"; + case SUBLANG_ENGLISH_SOUTH_AFRICA: return "en_ZA"; + case SUBLANG_ENGLISH_JAMAICA: return "en_JM"; + case SUBLANG_ENGLISH_CARIBBEAN: return "en_GD"; /* Grenada? */ + case SUBLANG_ENGLISH_BELIZE: return "en_BZ"; + case SUBLANG_ENGLISH_TRINIDAD: return "en_TT"; + case SUBLANG_ENGLISH_ZIMBABWE: return "en_ZW"; + case SUBLANG_ENGLISH_PHILIPPINES: return "en_PH"; + } + return "en"; + case LANG_ESTONIAN: return "et_EE"; + case LANG_FAEROESE: return "fo_FO"; + case LANG_FARSI: return "fa_IR"; + case LANG_FINNISH: return "fi_FI"; + case LANG_FRENCH: + switch (sub) + { + case SUBLANG_FRENCH: return "fr_FR"; + case SUBLANG_FRENCH_BELGIAN: /* WALLOON */ return "fr_BE"; + case SUBLANG_FRENCH_CANADIAN: return "fr_CA"; + case SUBLANG_FRENCH_SWISS: return "fr_CH"; + case SUBLANG_FRENCH_LUXEMBOURG: return "fr_LU"; + case SUBLANG_FRENCH_MONACO: return "fr_MC"; + } + return "fr"; + case 0x62: /* FRISIAN */ return "fy_NL"; + case 0x67: /* FULFULDE */ return "ful_NG"; + case 0x3c: /* GAELIC */ + switch (sub) + { + case 0x01: /* SCOTTISH */ return "gd_GB"; + case 0x02: /* IRISH */ return "ga_IE"; + } + return "C"; + case LANG_GALICIAN: return "gl_ES"; + case LANG_GEORGIAN: return "ka_GE"; + case LANG_GERMAN: + switch (sub) + { + case SUBLANG_GERMAN: return "de_DE"; + case SUBLANG_GERMAN_SWISS: return "de_CH"; + case SUBLANG_GERMAN_AUSTRIAN: return "de_AT"; + case SUBLANG_GERMAN_LUXEMBOURG: return "de_LU"; + case SUBLANG_GERMAN_LIECHTENSTEIN: return "de_LI"; + } + return "de"; + case LANG_GREEK: return "el_GR"; + case 0x74: /* GUARANI */ return "gn_PY"; + case LANG_GUJARATI: return "gu_IN"; + case 0x68: /* HAUSA */ return "ha_NG"; + case 0x75: /* HAWAIIAN */ + /* FIXME: Do they mean Hawaiian ("haw_US", 1000 speakers) + or Hawaii Creole English ("cpe_US", 600000 speakers)? */ + return "cpe_US"; + case LANG_HEBREW: return "he_IL"; + case LANG_HINDI: return "hi_IN"; + case LANG_HUNGARIAN: return "hu_HU"; + case 0x69: /* IBIBIO */ return "nic_NG"; + case LANG_ICELANDIC: return "is_IS"; + case 0x70: /* IGBO */ return "ibo_NG"; + case LANG_INDONESIAN: return "id_ID"; + case 0x5d: /* INUKTITUT */ return "iu_CA"; + case LANG_ITALIAN: + switch (sub) + { + case SUBLANG_ITALIAN: return "it_IT"; + case SUBLANG_ITALIAN_SWISS: return "it_CH"; + } + return "it"; + case LANG_JAPANESE: return "ja_JP"; + case LANG_KANNADA: return "kn_IN"; + case 0x71: /* KANURI */ return "kau_NG"; + case LANG_KASHMIRI: + switch (sub) + { + case SUBLANG_DEFAULT: return "ks_PK"; + case SUBLANG_KASHMIRI_INDIA: return "ks_IN"; + } + return "ks"; + case LANG_KAZAK: return "kk_KZ"; + case LANG_KONKANI: + /* FIXME: Adjust this when such locales appear on Unix. */ + return "kok_IN"; + case LANG_KOREAN: return "ko_KR"; + case LANG_KYRGYZ: return "ky_KG"; + case 0x54: /* LAO */ return "lo_LA"; + case 0x76: /* LATIN */ return "la_VA"; + case LANG_LATVIAN: return "lv_LV"; + case LANG_LITHUANIAN: return "lt_LT"; + case LANG_MACEDONIAN: return "mk_MK"; + case LANG_MALAY: + switch (sub) + { + case SUBLANG_MALAY_MALAYSIA: return "ms_MY"; + case SUBLANG_MALAY_BRUNEI_DARUSSALAM: return "ms_BN"; + } + return "ms"; + case LANG_MALAYALAM: return "ml_IN"; + case 0x3a: /* MALTESE */ return "mt_MT"; + case LANG_MANIPURI: + /* FIXME: Adjust this when such locales appear on Unix. */ + return "mni_IN"; + case LANG_MARATHI: return "mr_IN"; + case LANG_MONGOLIAN: + return "mn"; /* Ambiguous: could be "mn_CN" or "mn_MN". */ + case LANG_NEPALI: + switch (sub) + { + case SUBLANG_DEFAULT: return "ne_NP"; + case SUBLANG_NEPALI_INDIA: return "ne_IN"; + } + return "ne"; + case LANG_NORWEGIAN: + switch (sub) + { + case SUBLANG_NORWEGIAN_BOKMAL: return "no_NO"; + case SUBLANG_NORWEGIAN_NYNORSK: return "nn_NO"; + } + return "no"; + case LANG_ORIYA: return "or_IN"; + case 0x72: /* OROMO */ return "om_ET"; + case 0x79: /* PAPIAMENTU */ return "pap_AN"; + case 0x63: /* PASHTO */ + return "ps"; /* Ambiguous: could be "ps_PK" or "ps_AF". */ + case LANG_POLISH: return "pl_PL"; + case LANG_PORTUGUESE: + switch (sub) + { + case SUBLANG_PORTUGUESE: return "pt_PT"; + /* Hmm. SUBLANG_PORTUGUESE_BRAZILIAN == SUBLANG_DEFAULT. + Same phenomenon as SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. */ + case SUBLANG_PORTUGUESE_BRAZILIAN: return "pt_BR"; + } + return "pt"; + case LANG_PUNJABI: return "pa_IN"; + case 0x17: /* RHAETO-ROMANCE */ return "rm_CH"; + case LANG_ROMANIAN: return "ro_RO"; + case LANG_RUSSIAN: + return "ru"; /* Ambiguous: could be "ru_RU" or "ru_UA". */ + case 0x3b: /* SAMI */ return "se_NO"; + case LANG_SANSKRIT: return "sa_IN"; + case LANG_SINDHI: return "sd"; + case 0x5b: /* SINHALESE */ return "si_LK"; + case LANG_SLOVAK: return "sk_SK"; + case LANG_SLOVENIAN: return "sl_SI"; + case 0x77: /* SOMALI */ return "so_SO"; + case LANG_SORBIAN: + /* FIXME: Adjust this when such locales appear on Unix. */ + return "wen_DE"; + case LANG_SPANISH: + switch (sub) + { + case SUBLANG_SPANISH: return "es_ES"; + case SUBLANG_SPANISH_MEXICAN: return "es_MX"; + case SUBLANG_SPANISH_MODERN: + return "es_ES@modern"; /* not seen on Unix */ + case SUBLANG_SPANISH_GUATEMALA: return "es_GT"; + case SUBLANG_SPANISH_COSTA_RICA: return "es_CR"; + case SUBLANG_SPANISH_PANAMA: return "es_PA"; + case SUBLANG_SPANISH_DOMINICAN_REPUBLIC: return "es_DO"; + case SUBLANG_SPANISH_VENEZUELA: return "es_VE"; + case SUBLANG_SPANISH_COLOMBIA: return "es_CO"; + case SUBLANG_SPANISH_PERU: return "es_PE"; + case SUBLANG_SPANISH_ARGENTINA: return "es_AR"; + case SUBLANG_SPANISH_ECUADOR: return "es_EC"; + case SUBLANG_SPANISH_CHILE: return "es_CL"; + case SUBLANG_SPANISH_URUGUAY: return "es_UY"; + case SUBLANG_SPANISH_PARAGUAY: return "es_PY"; + case SUBLANG_SPANISH_BOLIVIA: return "es_BO"; + case SUBLANG_SPANISH_EL_SALVADOR: return "es_SV"; + case SUBLANG_SPANISH_HONDURAS: return "es_HN"; + case SUBLANG_SPANISH_NICARAGUA: return "es_NI"; + case SUBLANG_SPANISH_PUERTO_RICO: return "es_PR"; + } + return "es"; + case 0x30: /* SUTU */ return "bnt_TZ"; + case LANG_SWAHILI: return "sw_KE"; + case LANG_SWEDISH: + switch (sub) + { + case SUBLANG_DEFAULT: return "sv_SE"; + case SUBLANG_SWEDISH_FINLAND: return "sv_FI"; + } + return "sv"; + case LANG_SYRIAC: return "syr_TR"; /* An extinct language. */ + case 0x64: /* TAGALOG */ return "tl_PH"; + case 0x28: /* TAJIK */ return "tg_TJ"; + case 0x5f: /* TAMAZIGHT */ return "ber_MA"; + case LANG_TAMIL: + return "ta"; /* Ambiguous: could be "ta_IN" or "ta_LK" or "ta_SG". */ + case LANG_TATAR: return "tt_RU"; + case LANG_TELUGU: return "te_IN"; + case LANG_THAI: return "th_TH"; + case 0x51: /* TIBETAN */ return "bo_CN"; + case 0x73: /* TIGRINYA */ return "ti_ET"; + case 0x31: /* TSONGA */ return "ts_ZA"; + case LANG_TURKISH: return "tr_TR"; + case 0x42: /* TURKMEN */ return "tk_TM"; + case LANG_UKRAINIAN: return "uk_UA"; + case LANG_URDU: + switch (sub) + { + case SUBLANG_URDU_PAKISTAN: return "ur_PK"; + case SUBLANG_URDU_INDIA: return "ur_IN"; + } + return "ur"; + case LANG_UZBEK: + switch (sub) + { + /* FIXME: Adjust this when Uzbek locales appear on Unix. */ + case SUBLANG_UZBEK_LATIN: return "uz_UZ@latin"; + case SUBLANG_UZBEK_CYRILLIC: return "uz_UZ@cyrillic"; + } + return "uz"; + case 0x33: /* VENDA */ return "ven_ZA"; + case LANG_VIETNAMESE: return "vi_VN"; + case 0x52: /* WELSH */ return "cy_GB"; + case 0x34: /* XHOSA */ return "xh_ZA"; + case 0x78: /* YI */ return "sit_CN"; + case 0x3d: /* YIDDISH */ return "yi_IL"; + case 0x6a: /* YORUBA */ return "yo_NG"; + case 0x35: /* ZULU */ return "zu_ZA"; + default: return "C"; + } + +#endif +} diff --git a/lib/intl/log.c b/lib/intl/log.c new file mode 100644 index 0000000..e527e87 --- /dev/null +++ b/lib/intl/log.c @@ -0,0 +1,106 @@ +/* log.c - Log file output. */ + +/* Copyright (C) 2003, 2005-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Written by Bruno Haible . */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +/* Print an ASCII string with quotes and escape sequences where needed. */ +static void +print_escaped (stream, str) + FILE *stream; + const char *str; +{ + putc ('"', stream); + for (; *str != '\0'; str++) + if (*str == '\n') + { + fputs ("\\n\"", stream); + if (str[1] == '\0') + return; + fputs ("\n\"", stream); + } + else + { + if (*str == '"' || *str == '\\') + putc ('\\', stream); + putc (*str, stream); + } + putc ('"', stream); +} + +/* Add to the log file an entry denoting a failed translation. */ +void +_nl_log_untranslated (logfilename, domainname, msgid1, msgid2, plural) + const char *logfilename; + const char *domainname; + const char *msgid1; + const char *msgid2; + int plural; +{ + static char *last_logfilename = NULL; + static FILE *last_logfile = NULL; + FILE *logfile; + + /* Can we reuse the last opened logfile? */ + if (last_logfilename == NULL || strcmp (logfilename, last_logfilename) != 0) + { + /* Close the last used logfile. */ + if (last_logfilename != NULL) + { + if (last_logfile != NULL) + { + fclose (last_logfile); + last_logfile = NULL; + } + free (last_logfilename); + last_logfilename = NULL; + } + /* Open the logfile. */ + last_logfilename = (char *) malloc (strlen (logfilename) + 1); + if (last_logfilename == NULL) + return; + strcpy (last_logfilename, logfilename); + last_logfile = fopen (logfilename, "a"); + if (last_logfile == NULL) + return; + } + logfile = last_logfile; + + fprintf (logfile, "domain "); + print_escaped (logfile, domainname); + fprintf (logfile, "\nmsgid "); + print_escaped (logfile, msgid1); + if (plural) + { + fprintf (logfile, "\nmsgid_plural "); + print_escaped (logfile, msgid2); + fprintf (logfile, "\nmsgstr[0] \"\"\n"); + } + else + fprintf (logfile, "\nmsgstr \"\"\n"); + putc ('\n', logfile); +} diff --git a/lib/intl/ngettext.c b/lib/intl/ngettext.c new file mode 100644 index 0000000..95aafcc --- /dev/null +++ b/lib/intl/ngettext.c @@ -0,0 +1,70 @@ +/* ngettext.c - Implementation of ngettext(3) function. */ + +/* Copyright (C) 1995, 1997, 2000, 2001, 2002, 2005-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifdef _LIBC +# define __need_NULL +# include +#else +# include /* Just for NULL. */ +#endif + +#include "gettextP.h" +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif + +#include + +/* @@ end of prolog @@ */ + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define NGETTEXT __ngettext +# define DCNGETTEXT __dcngettext +#else +# define NGETTEXT libintl_ngettext +# define DCNGETTEXT libintl_dcngettext +#endif + +/* Look up MSGID in the current default message catalog for the current + LC_MESSAGES locale. If not found, returns MSGID itself (the default + text). */ +char * +NGETTEXT (msgid1, msgid2, n) + const char *msgid1; + const char *msgid2; + unsigned long int n; +{ + return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES); +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__ngettext, ngettext); +#endif diff --git a/lib/intl/os2compat.c b/lib/intl/os2compat.c new file mode 100644 index 0000000..1aa9dff --- /dev/null +++ b/lib/intl/os2compat.c @@ -0,0 +1,100 @@ +/* os2compat.c - OS/2 compatibility functions. */ + +/* Copyright (C) 2001-2002, 2005-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#define OS2_AWARE +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +/* A version of getenv() that works from DLLs */ +extern unsigned long DosScanEnv (const unsigned char *pszName, unsigned char **ppszValue); + +char * +_nl_getenv (const char *name) +{ + unsigned char *value; + if (DosScanEnv (name, &value)) + return NULL; + else + return value; +} + +/* A fixed size buffer. */ +char libintl_nl_default_dirname[MAXPATHLEN+1]; + +char *_nlos2_libdir = NULL; +char *_nlos2_localealiaspath = NULL; +char *_nlos2_localedir = NULL; + +static __attribute__((constructor)) void +nlos2_initialize () +{ + char *root = getenv ("UNIXROOT"); + char *gnulocaledir = getenv ("GNULOCALEDIR"); + + _nlos2_libdir = gnulocaledir; + if (!_nlos2_libdir) + { + if (root) + { + size_t sl = strlen (root); + _nlos2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1); + memcpy (_nlos2_libdir, root, sl); + memcpy (_nlos2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1); + } + else + _nlos2_libdir = LIBDIR; + } + + _nlos2_localealiaspath = gnulocaledir; + if (!_nlos2_localealiaspath) + { + if (root) + { + size_t sl = strlen (root); + _nlos2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1); + memcpy (_nlos2_localealiaspath, root, sl); + memcpy (_nlos2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1); + } + else + _nlos2_localealiaspath = LOCALE_ALIAS_PATH; + } + + _nlos2_localedir = gnulocaledir; + if (!_nlos2_localedir) + { + if (root) + { + size_t sl = strlen (root); + _nlos2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1); + memcpy (_nlos2_localedir, root, sl); + memcpy (_nlos2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1); + } + else + _nlos2_localedir = LOCALEDIR; + } + + if (strlen (_nlos2_localedir) <= MAXPATHLEN) + strcpy (libintl_nl_default_dirname, _nlos2_localedir); +} diff --git a/lib/intl/os2compat.h b/lib/intl/os2compat.h new file mode 100644 index 0000000..8de3183 --- /dev/null +++ b/lib/intl/os2compat.h @@ -0,0 +1,48 @@ +/* os2compat.h - OS/2 compatibility defines. */ + +/* This file is intended to be included from config.h + Copyright (C) 2001-2002, 2005-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* When included from os2compat.h we need all the original definitions */ +#ifndef OS2_AWARE + +#undef LIBDIR +#define LIBDIR _nlos2_libdir +extern char *_nlos2_libdir; + +#undef LOCALEDIR +#define LOCALEDIR _nlos2_localedir +extern char *_nlos2_localedir; + +#undef LOCALE_ALIAS_PATH +#define LOCALE_ALIAS_PATH _nlos2_localealiaspath +extern char *_nlos2_localealiaspath; + +#endif + +#undef HAVE_STRCASECMP +#define HAVE_STRCASECMP 1 +#define strcasecmp stricmp +#define strncasecmp strnicmp + +/* We have our own getenv() which works even if library is compiled as DLL */ +#define getenv _nl_getenv + +/* Older versions of gettext used -1 as the value of LC_MESSAGES */ +#define LC_MESSAGES_COMPAT (-1) diff --git a/lib/intl/osdep.c b/lib/intl/osdep.c new file mode 100644 index 0000000..b030022 --- /dev/null +++ b/lib/intl/osdep.c @@ -0,0 +1,26 @@ +/* osdep.c - OS dependent parts of libintl. */ + +/* Copyright (C) 2001-2002, 2005-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if defined __EMX__ +# include "os2compat.c" +#else +/* Avoid AIX compiler warning. */ +typedef int dummy; +#endif diff --git a/lib/intl/plural-exp.c b/lib/intl/plural-exp.c new file mode 100644 index 0000000..9ed3b16 --- /dev/null +++ b/lib/intl/plural-exp.c @@ -0,0 +1,158 @@ +/* plural-exp.c - Expression parsing for plural form selection. */ + +/* Copyright (C) 2000, 2001, 2005-2009 Free Software Foundation, Inc. + Written by Ulrich Drepper , 2000. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +#include "plural-exp.h" + +#if (defined __GNUC__ && !defined __APPLE_CC__) \ + || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) + +/* These structs are the constant expression for the germanic plural + form determination. It represents the expression "n != 1". */ +static const struct expression plvar = +{ + .nargs = 0, + .operation = var, +}; +static const struct expression plone = +{ + .nargs = 0, + .operation = num, + .val = + { + .num = 1 + } +}; +struct expression GERMANIC_PLURAL = +{ + .nargs = 2, + .operation = not_equal, + .val = + { + .args = + { + [0] = (struct expression *) &plvar, + [1] = (struct expression *) &plone + } + } +}; + +# define INIT_GERMANIC_PLURAL() + +#else + +/* For compilers without support for ISO C 99 struct/union initializers: + Initialization at run-time. */ + +static struct expression plvar; +static struct expression plone; +struct expression GERMANIC_PLURAL; + +static void +init_germanic_plural () +{ + if (plone.val.num == 0) + { + plvar.nargs = 0; + plvar.operation = var; + + plone.nargs = 0; + plone.operation = num; + plone.val.num = 1; + + GERMANIC_PLURAL.nargs = 2; + GERMANIC_PLURAL.operation = not_equal; + GERMANIC_PLURAL.val.args[0] = &plvar; + GERMANIC_PLURAL.val.args[1] = &plone; + } +} + +# define INIT_GERMANIC_PLURAL() init_germanic_plural () + +#endif + +void +internal_function +EXTRACT_PLURAL_EXPRESSION (nullentry, pluralp, npluralsp) + const char *nullentry; + struct expression **pluralp; + unsigned long int *npluralsp; +{ + if (nullentry != NULL) + { + const char *plural; + const char *nplurals; + + plural = strstr (nullentry, "plural="); + nplurals = strstr (nullentry, "nplurals="); + if (plural == NULL || nplurals == NULL) + goto no_plural; + else + { + char *endp; + unsigned long int n; + struct parse_args args; + + /* First get the number. */ + nplurals += 9; + while (*nplurals != '\0' && isspace ((unsigned char) *nplurals)) + ++nplurals; + if (!(*nplurals >= '0' && *nplurals <= '9')) + goto no_plural; +#if defined HAVE_STRTOUL || defined _LIBC + n = strtoul (nplurals, &endp, 10); +#else + for (endp = nplurals, n = 0; *endp >= '0' && *endp <= '9'; endp++) + n = n * 10 + (*endp - '0'); +#endif + if (nplurals == endp) + goto no_plural; + *npluralsp = n; + + /* Due to the restrictions bison imposes onto the interface of the + scanner function we have to put the input string and the result + passed up from the parser into the same structure which address + is passed down to the parser. */ + plural += 7; + args.cp = plural; + if (PLURAL_PARSE (&args) != 0) + goto no_plural; + *pluralp = args.res; + } + } + else + { + /* By default we are using the Germanic form: singular form only + for `one', the plural form otherwise. Yes, this is also what + English is using since English is a Germanic language. */ + no_plural: + INIT_GERMANIC_PLURAL (); + *pluralp = &GERMANIC_PLURAL; + *npluralsp = 2; + } +} diff --git a/lib/intl/plural-exp.h b/lib/intl/plural-exp.h new file mode 100644 index 0000000..dcb0dae --- /dev/null +++ b/lib/intl/plural-exp.h @@ -0,0 +1,128 @@ +/* plural-exp.h - defines for expression parsing and evaluation for plural form selection. */ + +/* Copyright (C) 2000, 2001, 2002, 2005-2009 Free Software Foundation, Inc. + Written by Ulrich Drepper , 2000. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _PLURAL_EXP_H +#define _PLURAL_EXP_H + +#ifndef PARAMS +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES +# define PARAMS(args) args +# else +# define PARAMS(args) () +# endif +#endif + +#ifndef internal_function +# define internal_function +#endif + +#ifndef attribute_hidden +# define attribute_hidden +#endif + + +/* This is the representation of the expressions to determine the + plural form. */ +struct expression +{ + int nargs; /* Number of arguments. */ + enum operator + { + /* Without arguments: */ + var, /* The variable "n". */ + num, /* Decimal number. */ + /* Unary operators: */ + lnot, /* Logical NOT. */ + /* Binary operators: */ + mult, /* Multiplication. */ + divide, /* Division. */ + module, /* Modulo operation. */ + plus, /* Addition. */ + minus, /* Subtraction. */ + less_than, /* Comparison. */ + greater_than, /* Comparison. */ + less_or_equal, /* Comparison. */ + greater_or_equal, /* Comparison. */ + equal, /* Comparison for equality. */ + not_equal, /* Comparison for inequality. */ + land, /* Logical AND. */ + lor, /* Logical OR. */ + /* Ternary operators: */ + qmop /* Question mark operator. */ + } operation; + union + { + unsigned long int num; /* Number value for `num'. */ + struct expression *args[3]; /* Up to three arguments. */ + } val; +}; + +/* This is the data structure to pass information to the parser and get + the result in a thread-safe way. */ +struct parse_args +{ + const char *cp; + struct expression *res; +}; + + +/* Names for the libintl functions are a problem. This source code is used + 1. in the GNU C Library library, + 2. in the GNU libintl library, + 3. in the GNU gettext tools. + The function names in each situation must be different, to allow for + binary incompatible changes in 'struct expression'. Furthermore, + 1. in the GNU C Library library, the names have a __ prefix, + 2.+3. in the GNU libintl library and in the GNU gettext tools, the names + must follow ANSI C and not start with __. + So we have to distinguish the three cases. */ +#ifdef _LIBC +# define FREE_EXPRESSION __gettext_free_exp +# define PLURAL_PARSE __gettextparse +# define GERMANIC_PLURAL __gettext_germanic_plural +# define EXTRACT_PLURAL_EXPRESSION __gettext_extract_plural +#elif defined (IN_LIBINTL) +# define FREE_EXPRESSION libintl_gettext_free_exp +# define PLURAL_PARSE libintl_gettextparse +# define GERMANIC_PLURAL libintl_gettext_germanic_plural +# define EXTRACT_PLURAL_EXPRESSION libintl_gettext_extract_plural +#else +# define FREE_EXPRESSION free_plural_expression +# define PLURAL_PARSE parse_plural_expression +# define GERMANIC_PLURAL germanic_plural +# define EXTRACT_PLURAL_EXPRESSION extract_plural_expression +#endif + +extern void FREE_EXPRESSION PARAMS ((struct expression *exp)) + internal_function; +extern int PLURAL_PARSE PARAMS ((void *arg)); +extern struct expression GERMANIC_PLURAL attribute_hidden; +extern void EXTRACT_PLURAL_EXPRESSION PARAMS ((const char *nullentry, + struct expression **pluralp, + unsigned long int *npluralsp)) + internal_function; + +#if !defined (_LIBC) && !defined (IN_LIBINTL) +extern unsigned long int plural_eval PARAMS ((struct expression *pexp, + unsigned long int n)); +#endif + +#endif /* _PLURAL_EXP_H */ diff --git a/lib/intl/plural.c b/lib/intl/plural.c new file mode 100644 index 0000000..a003151 --- /dev/null +++ b/lib/intl/plural.c @@ -0,0 +1,1679 @@ +/* A Bison parser, made by GNU Bison 2.0. */ + +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* Written by Richard Stallman by simplifying the original so called + ``semantic'' parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 1 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + +/* Substitute the variable and function names. */ +#define yyparse __gettextparse +#define yylex __gettextlex +#define yyerror __gettexterror +#define yylval __gettextlval +#define yychar __gettextchar +#define yydebug __gettextdebug +#define yynerrs __gettextnerrs + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + EQUOP2 = 258, + CMPOP2 = 259, + ADDOP2 = 260, + MULOP2 = 261, + NUMBER = 262 + }; +#endif +#define EQUOP2 258 +#define CMPOP2 259 +#define ADDOP2 260 +#define MULOP2 261 +#define NUMBER 262 + + + + +/* Copy the first part of user declarations. */ +#line 1 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y" + +/* plural.y - Expression parsing for plural form selection. */ + +/* Copyright (C) 2000, 2001, 2005-2009 Free Software Foundation, Inc. + Written by Ulrich Drepper , 2000. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* The bison generated parser uses alloca. AIX 3 forces us to put this + declaration at the beginning of the file. The declaration in bison's + skeleton file comes too late. This must come before + because may include arbitrary system headers. */ +#if defined _AIX && !defined __GNUC__ + #pragma alloca +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include "plural-exp.h" + +/* The main function generated by the parser is called __gettextparse, + but we want it to be called PLURAL_PARSE. */ +#ifndef _LIBC +# define __gettextparse PLURAL_PARSE +#endif + +#define YYLEX_PARAM &((struct parse_args *) arg)->cp +#define YYPARSE_PARAM arg + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +#line 51 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y" +typedef union YYSTYPE { + unsigned long int num; + enum operator op; + struct expression *exp; +} YYSTYPE; +/* Line 190 of yacc.c. */ +#line 152 "/usr/src/local/bash/bash-20080814/lib/intl/plural.c" +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + + + +/* Copy the second part of user declarations. */ +#line 57 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y" + +/* Prototypes for local functions. */ +static struct expression *new_exp PARAMS ((int nargs, enum operator op, + struct expression * const *args)); +static inline struct expression *new_exp_0 PARAMS ((enum operator op)); +static inline struct expression *new_exp_1 PARAMS ((enum operator op, + struct expression *right)); +static struct expression *new_exp_2 PARAMS ((enum operator op, + struct expression *left, + struct expression *right)); +static inline struct expression *new_exp_3 PARAMS ((enum operator op, + struct expression *bexp, + struct expression *tbranch, + struct expression *fbranch)); +static int yylex PARAMS ((YYSTYPE *lval, const char **pexp)); +static void yyerror PARAMS ((const char *str)); + +/* Allocation of expressions. */ + +static struct expression * +new_exp (nargs, op, args) + int nargs; + enum operator op; + struct expression * const *args; +{ + int i; + struct expression *newp; + + /* If any of the argument could not be malloc'ed, just return NULL. */ + for (i = nargs - 1; i >= 0; i--) + if (args[i] == NULL) + goto fail; + + /* Allocate a new expression. */ + newp = (struct expression *) malloc (sizeof (*newp)); + if (newp != NULL) + { + newp->nargs = nargs; + newp->operation = op; + for (i = nargs - 1; i >= 0; i--) + newp->val.args[i] = args[i]; + return newp; + } + + fail: + for (i = nargs - 1; i >= 0; i--) + FREE_EXPRESSION (args[i]); + + return NULL; +} + +static inline struct expression * +new_exp_0 (op) + enum operator op; +{ + return new_exp (0, op, NULL); +} + +static inline struct expression * +new_exp_1 (op, right) + enum operator op; + struct expression *right; +{ + struct expression *args[1]; + + args[0] = right; + return new_exp (1, op, args); +} + +static struct expression * +new_exp_2 (op, left, right) + enum operator op; + struct expression *left; + struct expression *right; +{ + struct expression *args[2]; + + args[0] = left; + args[1] = right; + return new_exp (2, op, args); +} + +static inline struct expression * +new_exp_3 (op, bexp, tbranch, fbranch) + enum operator op; + struct expression *bexp; + struct expression *tbranch; + struct expression *fbranch; +{ + struct expression *args[3]; + + args[0] = bexp; + args[1] = tbranch; + args[2] = fbranch; + return new_exp (3, op, args); +} + + + +/* Line 213 of yacc.c. */ +#line 262 "/usr/src/local/bash/bash-20080814/lib/intl/plural.c" + +#if ! defined (yyoverflow) || YYERROR_VERBOSE + +# ifndef YYFREE +# define YYFREE free +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# endif + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# else +# define YYSTACK_ALLOC alloca +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# else +# if defined (__STDC__) || defined (__cplusplus) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# endif +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# endif +#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ + + +#if (! defined (yyoverflow) \ + && (! defined (__cplusplus) \ + || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + short int yyss; + YYSTYPE yyvs; + }; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined (__GNUC__) && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + register YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (0) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) + +#endif + +#if defined (__STDC__) || defined (__cplusplus) + typedef signed char yysigned_char; +#else + typedef short int yysigned_char; +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 9 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 54 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 16 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 3 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 13 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 27 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 262 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const unsigned char yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 10, 2, 2, 2, 2, 5, 2, + 14, 15, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 12, 2, + 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 13, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 6, 7, + 8, 9, 11 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const unsigned char yyprhs[] = +{ + 0, 0, 3, 5, 11, 15, 19, 23, 27, 31, + 35, 38, 40, 42 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yysigned_char yyrhs[] = +{ + 17, 0, -1, 18, -1, 18, 3, 18, 12, 18, + -1, 18, 4, 18, -1, 18, 5, 18, -1, 18, + 6, 18, -1, 18, 7, 18, -1, 18, 8, 18, + -1, 18, 9, 18, -1, 10, 18, -1, 13, -1, + 11, -1, 14, 18, 15, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const unsigned char yyrline[] = +{ + 0, 176, 176, 184, 188, 192, 196, 200, 204, 208, + 212, 216, 220, 225 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE +/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2", + "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'", + "$accept", "start", "exp", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const unsigned short int yytoknum[] = +{ + 0, 256, 257, 63, 124, 38, 258, 259, 260, 261, + 33, 262, 58, 110, 40, 41 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const unsigned char yyr1[] = +{ + 0, 16, 17, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const unsigned char yyr2[] = +{ + 0, 2, 1, 5, 3, 3, 3, 3, 3, 3, + 2, 1, 1, 3 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const unsigned char yydefact[] = +{ + 0, 0, 12, 11, 0, 0, 2, 10, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, + 5, 6, 7, 8, 9, 0, 3 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yysigned_char yydefgoto[] = +{ + -1, 5, 6 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -10 +static const yysigned_char yypact[] = +{ + -9, -9, -10, -10, -9, 8, 36, -10, 13, -10, + -9, -9, -9, -9, -9, -9, -9, -10, 26, 41, + 45, 18, -2, 14, -10, -9, 36 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yysigned_char yypgoto[] = +{ + -10, -10, -1 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -1 +static const unsigned char yytable[] = +{ + 7, 1, 2, 8, 3, 4, 15, 16, 9, 18, + 19, 20, 21, 22, 23, 24, 10, 11, 12, 13, + 14, 15, 16, 16, 26, 14, 15, 16, 17, 10, + 11, 12, 13, 14, 15, 16, 0, 0, 25, 10, + 11, 12, 13, 14, 15, 16, 12, 13, 14, 15, + 16, 13, 14, 15, 16 +}; + +static const yysigned_char yycheck[] = +{ + 1, 10, 11, 4, 13, 14, 8, 9, 0, 10, + 11, 12, 13, 14, 15, 16, 3, 4, 5, 6, + 7, 8, 9, 9, 25, 7, 8, 9, 15, 3, + 4, 5, 6, 7, 8, 9, -1, -1, 12, 3, + 4, 5, 6, 7, 8, 9, 5, 6, 7, 8, + 9, 6, 7, 8, 9 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const unsigned char yystos[] = +{ + 0, 10, 11, 13, 14, 17, 18, 18, 18, 0, + 3, 4, 5, 6, 7, 8, 9, 15, 18, 18, + 18, 18, 18, 18, 18, 12, 18 +}; + +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) +# define YYSIZE_T __SIZE_TYPE__ +#endif +#if ! defined (YYSIZE_T) && defined (size_t) +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) +# if defined (__STDC__) || defined (__cplusplus) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# endif +#endif +#if ! defined (YYSIZE_T) +# define YYSIZE_T unsigned int +#endif + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror ("syntax error: cannot back up");\ + YYERROR; \ + } \ +while (0) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (0) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (&yylval, YYLEX_PARAM) +#else +# define YYLEX yylex (&yylval) +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yysymprint (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yy_stack_print (short int *bottom, short int *top) +#else +static void +yy_stack_print (bottom, top) + short int *bottom; + short int *top; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (/* Nothing. */; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yy_reduce_print (int yyrule) +#else +static void +yy_reduce_print (yyrule) + int yyrule; +#endif +{ + int yyi; + unsigned int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", + yyrule - 1, yylno); + /* Print the symbols being reduced, and their result. */ + for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) + YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); + YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (Rule); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined (__GLIBC__) && defined (_STRING_H) +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +static YYSIZE_T +# if defined (__STDC__) || defined (__cplusplus) +yystrlen (const char *yystr) +# else +yystrlen (yystr) + const char *yystr; +# endif +{ + register const char *yys = yystr; + + while (*yys++ != '\0') + continue; + + return yys - yystr - 1; +} +# endif +# endif + +# ifndef yystpcpy +# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +# if defined (__STDC__) || defined (__cplusplus) +yystpcpy (char *yydest, const char *yysrc) +# else +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +# endif +{ + register char *yyd = yydest; + register const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +#endif /* !YYERROR_VERBOSE */ + + + +#if YYDEBUG +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) +#else +static void +yysymprint (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; + + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif + switch (yytype) + { + default: + break; + } + YYFPRINTF (yyoutput, ")"); +} + +#endif /* ! YYDEBUG */ +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} + + +/* Prevent warnings from -Wmissing-prototypes. */ + +#ifdef YYPARSE_PARAM +# if defined (__STDC__) || defined (__cplusplus) +int yyparse (void *YYPARSE_PARAM); +# else +int yyparse (); +# endif +#else /* ! YYPARSE_PARAM */ +#if defined (__STDC__) || defined (__cplusplus) +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + + + + + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +# if defined (__STDC__) || defined (__cplusplus) +int yyparse (void *YYPARSE_PARAM) +# else +int yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +# endif +#else /* ! YYPARSE_PARAM */ +#if defined (__STDC__) || defined (__cplusplus) +int +yyparse (void) +#else +int +yyparse () + +#endif +#endif +{ + /* The look-ahead symbol. */ +int yychar; + +/* The semantic value of the look-ahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + register int yystate; + register int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + short int yyssa[YYINITDEPTH]; + short int *yyss = yyssa; + register short int *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + register YYSTYPE *yyvsp; + + + +#define YYPOPSTACK (yyvsp--, yyssp--) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + /* When reducing, the number of symbols on the RHS of the reduced + rule. */ + int yylen; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; + + + yyvsp[0] = yylval; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. + */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + short int *yyss1 = yyss; + + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow ("parser stack overflow", + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyoverflowlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyoverflowlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + short int *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyoverflowlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + +/* Do appropriate processing given the current state. */ +/* Read a look-ahead token if we need one and don't already have one. */ +/* yyresume: */ + + /* First try to decide what to do without reference to look-ahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a look-ahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + if (yyn == YYFINAL) + YYACCEPT; + + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + *++yyvsp = yylval; + + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + yystate = yyn; + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: +#line 177 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y" + { + if ((yyvsp[0].exp) == NULL) + YYABORT; + ((struct parse_args *) arg)->res = (yyvsp[0].exp); + } + break; + + case 3: +#line 185 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y" + { + (yyval.exp) = new_exp_3 (qmop, (yyvsp[-4].exp), (yyvsp[-2].exp), (yyvsp[0].exp)); + } + break; + + case 4: +#line 189 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y" + { + (yyval.exp) = new_exp_2 (lor, (yyvsp[-2].exp), (yyvsp[0].exp)); + } + break; + + case 5: +#line 193 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y" + { + (yyval.exp) = new_exp_2 (land, (yyvsp[-2].exp), (yyvsp[0].exp)); + } + break; + + case 6: +#line 197 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y" + { + (yyval.exp) = new_exp_2 ((yyvsp[-1].op), (yyvsp[-2].exp), (yyvsp[0].exp)); + } + break; + + case 7: +#line 201 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y" + { + (yyval.exp) = new_exp_2 ((yyvsp[-1].op), (yyvsp[-2].exp), (yyvsp[0].exp)); + } + break; + + case 8: +#line 205 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y" + { + (yyval.exp) = new_exp_2 ((yyvsp[-1].op), (yyvsp[-2].exp), (yyvsp[0].exp)); + } + break; + + case 9: +#line 209 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y" + { + (yyval.exp) = new_exp_2 ((yyvsp[-1].op), (yyvsp[-2].exp), (yyvsp[0].exp)); + } + break; + + case 10: +#line 213 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y" + { + (yyval.exp) = new_exp_1 (lnot, (yyvsp[0].exp)); + } + break; + + case 11: +#line 217 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y" + { + (yyval.exp) = new_exp_0 (var); + } + break; + + case 12: +#line 221 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y" + { + if (((yyval.exp) = new_exp_0 (num)) != NULL) + (yyval.exp)->val.num = (yyvsp[0].num); + } + break; + + case 13: +#line 226 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y" + { + (yyval.exp) = (yyvsp[-1].exp); + } + break; + + + } + +/* Line 1037 of yacc.c. */ +#line 1270 "/usr/src/local/bash/bash-20080814/lib/intl/plural.c" + + yyvsp -= yylen; + yyssp -= yylen; + + + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (YYPACT_NINF < yyn && yyn < YYLAST) + { + YYSIZE_T yysize = 0; + int yytype = YYTRANSLATE (yychar); + const char* yyprefix; + char *yymsg; + int yyx; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 0; + + yyprefix = ", expecting "; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); + yycount += 1; + if (yycount == 5) + { + yysize = 0; + break; + } + } + yysize += (sizeof ("syntax error, unexpected ") + + yystrlen (yytname[yytype])); + yymsg = (char *) YYSTACK_ALLOC (yysize); + if (yymsg != 0) + { + char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); + yyp = yystpcpy (yyp, yytname[yytype]); + + if (yycount < 5) + { + yyprefix = ", expecting "; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + yyp = yystpcpy (yyp, yyprefix); + yyp = yystpcpy (yyp, yytname[yyx]); + yyprefix = " or "; + } + } + yyerror (yymsg); + YYSTACK_FREE (yymsg); + } + else + yyerror ("syntax error; also virtual memory exhausted"); + } + else +#endif /* YYERROR_VERBOSE */ + yyerror ("syntax error"); + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse look-ahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* If at end of input, pop the error token, + then the rest of the stack, then return failure. */ + if (yychar == YYEOF) + for (;;) + { + + YYPOPSTACK; + if (yyssp == yyss) + YYABORT; + yydestruct ("Error: popping", + yystos[*yyssp], yyvsp); + } + } + else + { + yydestruct ("Error: discarding", yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse look-ahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + +#ifdef __GNUC__ + /* Pacify GCC when the user code never invokes YYERROR and the label + yyerrorlab therefore never appears in user code. */ + if (0) + goto yyerrorlab; +#endif + +yyvsp -= yylen; + yyssp -= yylen; + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", yystos[yystate], yyvsp); + YYPOPSTACK; + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + if (yyn == YYFINAL) + YYACCEPT; + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yydestruct ("Error: discarding lookahead", + yytoken, &yylval); + yychar = YYEMPTY; + yyresult = 1; + goto yyreturn; + +#ifndef yyoverflow +/*----------------------------------------------. +| yyoverflowlab -- parser overflow comes here. | +`----------------------------------------------*/ +yyoverflowlab: + yyerror ("parser stack overflow"); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif + return yyresult; +} + + +#line 231 "/usr/src/local/bash/bash-20080814/lib/intl/plural.y" + + +void +internal_function +FREE_EXPRESSION (exp) + struct expression *exp; +{ + if (exp == NULL) + return; + + /* Handle the recursive case. */ + switch (exp->nargs) + { + case 3: + FREE_EXPRESSION (exp->val.args[2]); + /* FALLTHROUGH */ + case 2: + FREE_EXPRESSION (exp->val.args[1]); + /* FALLTHROUGH */ + case 1: + FREE_EXPRESSION (exp->val.args[0]); + /* FALLTHROUGH */ + default: + break; + } + + free (exp); +} + + +static int +yylex (lval, pexp) + YYSTYPE *lval; + const char **pexp; +{ + const char *exp = *pexp; + int result; + + while (1) + { + if (exp[0] == '\0') + { + *pexp = exp; + return YYEOF; + } + + if (exp[0] != ' ' && exp[0] != '\t') + break; + + ++exp; + } + + result = *exp++; + switch (result) + { + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + { + unsigned long int n = result - '0'; + while (exp[0] >= '0' && exp[0] <= '9') + { + n *= 10; + n += exp[0] - '0'; + ++exp; + } + lval->num = n; + result = NUMBER; + } + break; + + case '=': + if (exp[0] == '=') + { + ++exp; + lval->op = equal; + result = EQUOP2; + } + else + result = YYERRCODE; + break; + + case '!': + if (exp[0] == '=') + { + ++exp; + lval->op = not_equal; + result = EQUOP2; + } + break; + + case '&': + case '|': + if (exp[0] == result) + ++exp; + else + result = YYERRCODE; + break; + + case '<': + if (exp[0] == '=') + { + ++exp; + lval->op = less_or_equal; + } + else + lval->op = less_than; + result = CMPOP2; + break; + + case '>': + if (exp[0] == '=') + { + ++exp; + lval->op = greater_or_equal; + } + else + lval->op = greater_than; + result = CMPOP2; + break; + + case '*': + lval->op = mult; + result = MULOP2; + break; + + case '/': + lval->op = divide; + result = MULOP2; + break; + + case '%': + lval->op = module; + result = MULOP2; + break; + + case '+': + lval->op = plus; + result = ADDOP2; + break; + + case '-': + lval->op = minus; + result = ADDOP2; + break; + + case 'n': + case '?': + case ':': + case '(': + case ')': + /* Nothing, just return the character. */ + break; + + case ';': + case '\n': + case '\0': + /* Be safe and let the user call this function again. */ + --exp; + result = YYEOF; + break; + + default: + result = YYERRCODE; +#if YYDEBUG != 0 + --exp; +#endif + break; + } + + *pexp = exp; + + return result; +} + + +static void +yyerror (str) + const char *str; +{ + /* Do nothing. We don't print error messages here. */ +} diff --git a/lib/intl/plural.y b/lib/intl/plural.y new file mode 100644 index 0000000..8b8cec7 --- /dev/null +++ b/lib/intl/plural.y @@ -0,0 +1,411 @@ +%{ +/* plural.y - Expression parsing for plural form selection. */ + +/* Copyright (C) 2000, 2001, 2005-2009 Free Software Foundation, Inc. + Written by Ulrich Drepper , 2000. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* The bison generated parser uses alloca. AIX 3 forces us to put this + declaration at the beginning of the file. The declaration in bison's + skeleton file comes too late. This must come before + because may include arbitrary system headers. */ +#if defined _AIX && !defined __GNUC__ + #pragma alloca +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include "plural-exp.h" + +/* The main function generated by the parser is called __gettextparse, + but we want it to be called PLURAL_PARSE. */ +#ifndef _LIBC +# define __gettextparse PLURAL_PARSE +#endif + +#define YYLEX_PARAM &((struct parse_args *) arg)->cp +#define YYPARSE_PARAM arg +%} +%pure_parser +%expect 7 + +%union { + unsigned long int num; + enum operator op; + struct expression *exp; +} + +%{ +/* Prototypes for local functions. */ +static struct expression *new_exp PARAMS ((int nargs, enum operator op, + struct expression * const *args)); +static inline struct expression *new_exp_0 PARAMS ((enum operator op)); +static inline struct expression *new_exp_1 PARAMS ((enum operator op, + struct expression *right)); +static struct expression *new_exp_2 PARAMS ((enum operator op, + struct expression *left, + struct expression *right)); +static inline struct expression *new_exp_3 PARAMS ((enum operator op, + struct expression *bexp, + struct expression *tbranch, + struct expression *fbranch)); +static int yylex PARAMS ((YYSTYPE *lval, const char **pexp)); +static void yyerror PARAMS ((const char *str)); + +/* Allocation of expressions. */ + +static struct expression * +new_exp (nargs, op, args) + int nargs; + enum operator op; + struct expression * const *args; +{ + int i; + struct expression *newp; + + /* If any of the argument could not be malloc'ed, just return NULL. */ + for (i = nargs - 1; i >= 0; i--) + if (args[i] == NULL) + goto fail; + + /* Allocate a new expression. */ + newp = (struct expression *) malloc (sizeof (*newp)); + if (newp != NULL) + { + newp->nargs = nargs; + newp->operation = op; + for (i = nargs - 1; i >= 0; i--) + newp->val.args[i] = args[i]; + return newp; + } + + fail: + for (i = nargs - 1; i >= 0; i--) + FREE_EXPRESSION (args[i]); + + return NULL; +} + +static inline struct expression * +new_exp_0 (op) + enum operator op; +{ + return new_exp (0, op, NULL); +} + +static inline struct expression * +new_exp_1 (op, right) + enum operator op; + struct expression *right; +{ + struct expression *args[1]; + + args[0] = right; + return new_exp (1, op, args); +} + +static struct expression * +new_exp_2 (op, left, right) + enum operator op; + struct expression *left; + struct expression *right; +{ + struct expression *args[2]; + + args[0] = left; + args[1] = right; + return new_exp (2, op, args); +} + +static inline struct expression * +new_exp_3 (op, bexp, tbranch, fbranch) + enum operator op; + struct expression *bexp; + struct expression *tbranch; + struct expression *fbranch; +{ + struct expression *args[3]; + + args[0] = bexp; + args[1] = tbranch; + args[2] = fbranch; + return new_exp (3, op, args); +} + +%} + +/* This declares that all operators have the same associativity and the + precedence order as in C. See [Harbison, Steele: C, A Reference Manual]. + There is no unary minus and no bitwise operators. + Operators with the same syntactic behaviour have been merged into a single + token, to save space in the array generated by bison. */ +%right '?' /* ? */ +%left '|' /* || */ +%left '&' /* && */ +%left EQUOP2 /* == != */ +%left CMPOP2 /* < > <= >= */ +%left ADDOP2 /* + - */ +%left MULOP2 /* * / % */ +%right '!' /* ! */ + +%token EQUOP2 CMPOP2 ADDOP2 MULOP2 +%token NUMBER +%type exp + +%% + +start: exp + { + if ($1 == NULL) + YYABORT; + ((struct parse_args *) arg)->res = $1; + } + ; + +exp: exp '?' exp ':' exp + { + $$ = new_exp_3 (qmop, $1, $3, $5); + } + | exp '|' exp + { + $$ = new_exp_2 (lor, $1, $3); + } + | exp '&' exp + { + $$ = new_exp_2 (land, $1, $3); + } + | exp EQUOP2 exp + { + $$ = new_exp_2 ($2, $1, $3); + } + | exp CMPOP2 exp + { + $$ = new_exp_2 ($2, $1, $3); + } + | exp ADDOP2 exp + { + $$ = new_exp_2 ($2, $1, $3); + } + | exp MULOP2 exp + { + $$ = new_exp_2 ($2, $1, $3); + } + | '!' exp + { + $$ = new_exp_1 (lnot, $2); + } + | 'n' + { + $$ = new_exp_0 (var); + } + | NUMBER + { + if (($$ = new_exp_0 (num)) != NULL) + $$->val.num = $1; + } + | '(' exp ')' + { + $$ = $2; + } + ; + +%% + +void +internal_function +FREE_EXPRESSION (exp) + struct expression *exp; +{ + if (exp == NULL) + return; + + /* Handle the recursive case. */ + switch (exp->nargs) + { + case 3: + FREE_EXPRESSION (exp->val.args[2]); + /* FALLTHROUGH */ + case 2: + FREE_EXPRESSION (exp->val.args[1]); + /* FALLTHROUGH */ + case 1: + FREE_EXPRESSION (exp->val.args[0]); + /* FALLTHROUGH */ + default: + break; + } + + free (exp); +} + + +static int +yylex (lval, pexp) + YYSTYPE *lval; + const char **pexp; +{ + const char *exp = *pexp; + int result; + + while (1) + { + if (exp[0] == '\0') + { + *pexp = exp; + return YYEOF; + } + + if (exp[0] != ' ' && exp[0] != '\t') + break; + + ++exp; + } + + result = *exp++; + switch (result) + { + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + { + unsigned long int n = result - '0'; + while (exp[0] >= '0' && exp[0] <= '9') + { + n *= 10; + n += exp[0] - '0'; + ++exp; + } + lval->num = n; + result = NUMBER; + } + break; + + case '=': + if (exp[0] == '=') + { + ++exp; + lval->op = equal; + result = EQUOP2; + } + else + result = YYERRCODE; + break; + + case '!': + if (exp[0] == '=') + { + ++exp; + lval->op = not_equal; + result = EQUOP2; + } + break; + + case '&': + case '|': + if (exp[0] == result) + ++exp; + else + result = YYERRCODE; + break; + + case '<': + if (exp[0] == '=') + { + ++exp; + lval->op = less_or_equal; + } + else + lval->op = less_than; + result = CMPOP2; + break; + + case '>': + if (exp[0] == '=') + { + ++exp; + lval->op = greater_or_equal; + } + else + lval->op = greater_than; + result = CMPOP2; + break; + + case '*': + lval->op = mult; + result = MULOP2; + break; + + case '/': + lval->op = divide; + result = MULOP2; + break; + + case '%': + lval->op = module; + result = MULOP2; + break; + + case '+': + lval->op = plus; + result = ADDOP2; + break; + + case '-': + lval->op = minus; + result = ADDOP2; + break; + + case 'n': + case '?': + case ':': + case '(': + case ')': + /* Nothing, just return the character. */ + break; + + case ';': + case '\n': + case '\0': + /* Be safe and let the user call this function again. */ + --exp; + result = YYEOF; + break; + + default: + result = YYERRCODE; +#if YYDEBUG != 0 + --exp; +#endif + break; + } + + *pexp = exp; + + return result; +} + + +static void +yyerror (str) + const char *str; +{ + /* Do nothing. We don't print error messages here. */ +} diff --git a/lib/intl/ref-add.sin b/lib/intl/ref-add.sin new file mode 100755 index 0000000..6fd32ed --- /dev/null +++ b/lib/intl/ref-add.sin @@ -0,0 +1,29 @@ +# Add this package to a list of references stored in a text file. +# +# Copyright (C) 2000 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# Written by Bruno Haible . +# +/^# Packages using this file: / { + s/# Packages using this file:// + ta + :a + s/ @PACKAGE@ / @PACKAGE@ / + tb + s/ $/ @PACKAGE@ / + :b + s/^/# Packages using this file:/ +} diff --git a/lib/intl/ref-del.sin b/lib/intl/ref-del.sin new file mode 100755 index 0000000..65ce9af --- /dev/null +++ b/lib/intl/ref-del.sin @@ -0,0 +1,24 @@ +# Remove this package from a list of references stored in a text file. +# +# Copyright (C) 2000 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# Written by Bruno Haible . +# +/^# Packages using this file: / { + s/# Packages using this file:// + s/ @PACKAGE@ / / + s/^/# Packages using this file:/ +} diff --git a/lib/intl/relocatable.c b/lib/intl/relocatable.c new file mode 100644 index 0000000..34b2b18 --- /dev/null +++ b/lib/intl/relocatable.c @@ -0,0 +1,440 @@ +/* relocatable.c - Provide relocatable packages. */ + +/* Copyright (C) 2003, 2005-2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2003. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Tell glibc's to provide a prototype for getline(). + This must come before because may include + , and once has been included, it's too late. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +/* Specification. */ +#include "relocatable.h" + +#if ENABLE_RELOCATABLE + +#include +#include +#include +#include + +#ifdef NO_XMALLOC +# define xmalloc malloc +#else +# include "xmalloc.h" +#endif + +#if DEPENDS_ON_LIBCHARSET +# include +#endif +#if DEPENDS_ON_LIBICONV && HAVE_ICONV +# include +#endif +#if DEPENDS_ON_LIBINTL && ENABLE_NLS +# include +#endif + +/* Faked cheap 'bool'. */ +#undef bool +#undef false +#undef true +#define bool int +#define false 0 +#define true 1 + +/* Pathname support. + ISSLASH(C) tests whether C is a directory separator character. + IS_PATH_WITH_DIR(P) tests whether P contains a directory specification. + */ +#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ + /* Win32, OS/2, DOS */ +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +# define HAS_DEVICE(P) \ + ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ + && (P)[1] == ':') +# define IS_PATH_WITH_DIR(P) \ + (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P)) +# define FILESYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0) +#else + /* Unix */ +# define ISSLASH(C) ((C) == '/') +# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL) +# define FILESYSTEM_PREFIX_LEN(P) 0 +#endif + +/* Original installation prefix. */ +static char *orig_prefix; +static size_t orig_prefix_len; +/* Current installation prefix. */ +static char *curr_prefix; +static size_t curr_prefix_len; +/* These prefixes do not end in a slash. Anything that will be concatenated + to them must start with a slash. */ + +/* Sets the original and the current installation prefix of this module. + Relocation simply replaces a pathname starting with the original prefix + by the corresponding pathname with the current prefix instead. Both + prefixes should be directory names without trailing slash (i.e. use "" + instead of "/"). */ +static void +set_this_relocation_prefix (const char *orig_prefix_arg, + const char *curr_prefix_arg) +{ + if (orig_prefix_arg != NULL && curr_prefix_arg != NULL + /* Optimization: if orig_prefix and curr_prefix are equal, the + relocation is a nop. */ + && strcmp (orig_prefix_arg, curr_prefix_arg) != 0) + { + /* Duplicate the argument strings. */ + char *memory; + + orig_prefix_len = strlen (orig_prefix_arg); + curr_prefix_len = strlen (curr_prefix_arg); + memory = (char *) xmalloc (orig_prefix_len + 1 + curr_prefix_len + 1); +#ifdef NO_XMALLOC + if (memory != NULL) +#endif + { + memcpy (memory, orig_prefix_arg, orig_prefix_len + 1); + orig_prefix = memory; + memory += orig_prefix_len + 1; + memcpy (memory, curr_prefix_arg, curr_prefix_len + 1); + curr_prefix = memory; + return; + } + } + orig_prefix = NULL; + curr_prefix = NULL; + /* Don't worry about wasted memory here - this function is usually only + called once. */ +} + +/* Sets the original and the current installation prefix of the package. + Relocation simply replaces a pathname starting with the original prefix + by the corresponding pathname with the current prefix instead. Both + prefixes should be directory names without trailing slash (i.e. use "" + instead of "/"). */ +void +set_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg) +{ + set_this_relocation_prefix (orig_prefix_arg, curr_prefix_arg); + + /* Now notify all dependent libraries. */ +#if DEPENDS_ON_LIBCHARSET + libcharset_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); +#endif +#if DEPENDS_ON_LIBICONV && HAVE_ICONV && _LIBICONV_VERSION >= 0x0109 + libiconv_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); +#endif +#if DEPENDS_ON_LIBINTL && ENABLE_NLS && defined libintl_set_relocation_prefix + libintl_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); +#endif +} + +/* Convenience function: + Computes the current installation prefix, based on the original + installation prefix, the original installation directory of a particular + file, and the current pathname of this file. Returns NULL upon failure. */ +#ifdef IN_LIBRARY +#define compute_curr_prefix local_compute_curr_prefix +static +#endif +const char * +compute_curr_prefix (const char *orig_installprefix, + const char *orig_installdir, + const char *curr_pathname) +{ + const char *curr_installdir; + const char *rel_installdir; + + if (curr_pathname == NULL) + return NULL; + + /* Determine the relative installation directory, relative to the prefix. + This is simply the difference between orig_installprefix and + orig_installdir. */ + if (strncmp (orig_installprefix, orig_installdir, strlen (orig_installprefix)) + != 0) + /* Shouldn't happen - nothing should be installed outside $(prefix). */ + return NULL; + rel_installdir = orig_installdir + strlen (orig_installprefix); + + /* Determine the current installation directory. */ + { + const char *p_base = curr_pathname + FILESYSTEM_PREFIX_LEN (curr_pathname); + const char *p = curr_pathname + strlen (curr_pathname); + char *q; + + while (p > p_base) + { + p--; + if (ISSLASH (*p)) + break; + } + + q = (char *) xmalloc (p - curr_pathname + 1); +#ifdef NO_XMALLOC + if (q == NULL) + return NULL; +#endif + memcpy (q, curr_pathname, p - curr_pathname); + q[p - curr_pathname] = '\0'; + curr_installdir = q; + } + + /* Compute the current installation prefix by removing the trailing + rel_installdir from it. */ + { + const char *rp = rel_installdir + strlen (rel_installdir); + const char *cp = curr_installdir + strlen (curr_installdir); + const char *cp_base = + curr_installdir + FILESYSTEM_PREFIX_LEN (curr_installdir); + + while (rp > rel_installdir && cp > cp_base) + { + bool same = false; + const char *rpi = rp; + const char *cpi = cp; + + while (rpi > rel_installdir && cpi > cp_base) + { + rpi--; + cpi--; + if (ISSLASH (*rpi) || ISSLASH (*cpi)) + { + if (ISSLASH (*rpi) && ISSLASH (*cpi)) + same = true; + break; + } +#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ + /* Win32, OS/2, DOS - case insignificant filesystem */ + if ((*rpi >= 'a' && *rpi <= 'z' ? *rpi - 'a' + 'A' : *rpi) + != (*cpi >= 'a' && *cpi <= 'z' ? *cpi - 'a' + 'A' : *cpi)) + break; +#else + if (*rpi != *cpi) + break; +#endif + } + if (!same) + break; + /* The last pathname component was the same. opi and cpi now point + to the slash before it. */ + rp = rpi; + cp = cpi; + } + + if (rp > rel_installdir) + /* Unexpected: The curr_installdir does not end with rel_installdir. */ + return NULL; + + { + size_t curr_prefix_len = cp - curr_installdir; + char *curr_prefix; + + curr_prefix = (char *) xmalloc (curr_prefix_len + 1); +#ifdef NO_XMALLOC + if (curr_prefix == NULL) + return NULL; +#endif + memcpy (curr_prefix, curr_installdir, curr_prefix_len); + curr_prefix[curr_prefix_len] = '\0'; + + return curr_prefix; + } + } +} + +#if defined PIC && defined INSTALLDIR + +/* Full pathname of shared library, or NULL. */ +static char *shared_library_fullname; + +#if defined _WIN32 || defined __WIN32__ + +/* Determine the full pathname of the shared library when it is loaded. */ + +BOOL WINAPI +DllMain (HINSTANCE module_handle, DWORD event, LPVOID reserved) +{ + (void) reserved; + + if (event == DLL_PROCESS_ATTACH) + { + /* The DLL is being loaded into an application's address range. */ + static char location[MAX_PATH]; + + if (!GetModuleFileName (module_handle, location, sizeof (location))) + /* Shouldn't happen. */ + return FALSE; + + if (!IS_PATH_WITH_DIR (location)) + /* Shouldn't happen. */ + return FALSE; + + shared_library_fullname = strdup (location); + } + + return TRUE; +} + +#else /* Unix */ + +static void +find_shared_library_fullname () +{ +#ifdef __linux__ + FILE *fp; + + /* Open the current process' maps file. It describes one VMA per line. */ + fp = fopen ("/proc/self/maps", "r"); + if (fp) + { + unsigned long address = (unsigned long) &find_shared_library_fullname; + for (;;) + { + unsigned long start, end; + int c; + + if (fscanf (fp, "%lx-%lx", &start, &end) != 2) + break; + if (address >= start && address <= end - 1) + { + /* Found it. Now see if this line contains a filename. */ + while (c = getc (fp), c != EOF && c != '\n' && c != '/') + continue; + if (c == '/') + { + size_t size; + int len; + + ungetc (c, fp); + shared_library_fullname = NULL; size = 0; + len = getline (&shared_library_fullname, &size, fp); + if (len >= 0) + { + /* Success: filled shared_library_fullname. */ + if (len > 0 && shared_library_fullname[len - 1] == '\n') + shared_library_fullname[len - 1] = '\0'; + } + } + break; + } + while (c = getc (fp), c != EOF && c != '\n') + continue; + } + fclose (fp); + } +#endif +} + +#endif /* WIN32 / Unix */ + +/* Return the full pathname of the current shared library. + Return NULL if unknown. + Guaranteed to work only on Linux and Woe32. */ +static char * +get_shared_library_fullname () +{ +#if !(defined _WIN32 || defined __WIN32__) + static bool tried_find_shared_library_fullname; + if (!tried_find_shared_library_fullname) + { + find_shared_library_fullname (); + tried_find_shared_library_fullname = true; + } +#endif + return shared_library_fullname; +} + +#endif /* PIC */ + +/* Returns the pathname, relocated according to the current installation + directory. */ +const char * +relocate (const char *pathname) +{ +#if defined PIC && defined INSTALLDIR + static int initialized; + + /* Initialization code for a shared library. */ + if (!initialized) + { + /* At this point, orig_prefix and curr_prefix likely have already been + set through the main program's set_program_name_and_installdir + function. This is sufficient in the case that the library has + initially been installed in the same orig_prefix. But we can do + better, to also cover the cases that 1. it has been installed + in a different prefix before being moved to orig_prefix and (later) + to curr_prefix, 2. unlike the program, it has not moved away from + orig_prefix. */ + const char *orig_installprefix = INSTALLPREFIX; + const char *orig_installdir = INSTALLDIR; + const char *curr_prefix_better; + + curr_prefix_better = + compute_curr_prefix (orig_installprefix, orig_installdir, + get_shared_library_fullname ()); + if (curr_prefix_better == NULL) + curr_prefix_better = curr_prefix; + + set_relocation_prefix (orig_installprefix, curr_prefix_better); + + initialized = 1; + } +#endif + + /* Note: It is not necessary to perform case insensitive comparison here, + even for DOS-like filesystems, because the pathname argument was + typically created from the same Makefile variable as orig_prefix came + from. */ + if (orig_prefix != NULL && curr_prefix != NULL + && strncmp (pathname, orig_prefix, orig_prefix_len) == 0) + { + if (pathname[orig_prefix_len] == '\0') + /* pathname equals orig_prefix. */ + return curr_prefix; + if (ISSLASH (pathname[orig_prefix_len])) + { + /* pathname starts with orig_prefix. */ + const char *pathname_tail = &pathname[orig_prefix_len]; + char *result = + (char *) xmalloc (curr_prefix_len + strlen (pathname_tail) + 1); + +#ifdef NO_XMALLOC + if (result != NULL) +#endif + { + memcpy (result, curr_prefix, curr_prefix_len); + strcpy (result + curr_prefix_len, pathname_tail); + return result; + } + } + } + /* Nothing to relocate. */ + return pathname; +} + +#endif diff --git a/lib/intl/relocatable.h b/lib/intl/relocatable.h new file mode 100644 index 0000000..de57f44 --- /dev/null +++ b/lib/intl/relocatable.h @@ -0,0 +1,69 @@ +/* relocatable.h - Provide relocatable packages. */ + +/* Copyright (C) 2003, 2005-2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2003. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _RELOCATABLE_H +#define _RELOCATABLE_H + +/* This can be enabled through the configure --enable-relocatable option. */ +#if ENABLE_RELOCATABLE + +/* When building a DLL, we must export some functions. Note that because + this is a private .h file, we don't need to use __declspec(dllimport) + in any case. */ +#if defined _MSC_VER && BUILDING_DLL +# define RELOCATABLE_DLL_EXPORTED __declspec(dllexport) +#else +# define RELOCATABLE_DLL_EXPORTED +#endif + +/* Sets the original and the current installation prefix of the package. + Relocation simply replaces a pathname starting with the original prefix + by the corresponding pathname with the current prefix instead. Both + prefixes should be directory names without trailing slash (i.e. use "" + instead of "/"). */ +extern RELOCATABLE_DLL_EXPORTED void + set_relocation_prefix (const char *orig_prefix, + const char *curr_prefix); + +/* Returns the pathname, relocated according to the current installation + directory. */ +extern const char * relocate (const char *pathname); + +/* Memory management: relocate() leaks memory, because it has to construct + a fresh pathname. If this is a problem because your program calls + relocate() frequently, think about caching the result. */ + +/* Convenience function: + Computes the current installation prefix, based on the original + installation prefix, the original installation directory of a particular + file, and the current pathname of this file. Returns NULL upon failure. */ +extern const char * compute_curr_prefix (const char *orig_installprefix, + const char *orig_installdir, + const char *curr_pathname); + +#else + +/* By default, we use the hardwired pathnames. */ +#define relocate(pathname) (pathname) + +#endif + +#endif /* _RELOCATABLE_H */ diff --git a/lib/intl/textdomain.c b/lib/intl/textdomain.c new file mode 100644 index 0000000..4bb0e80 --- /dev/null +++ b/lib/intl/textdomain.c @@ -0,0 +1,144 @@ +/* textdomain.c - Implementation of the textdomain(3) function. */ + +/* Copyright (C) 1995-1998, 2000, 2001, 2002, 2005-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +#ifdef _LIBC +# include +#else +# include "libgnuintl.h" +#endif +#include "gettextP.h" + +#ifdef _LIBC +/* We have to handle multi-threaded applications. */ +# include +#else +/* Provide dummy implementation if this is outside glibc. */ +# define __libc_rwlock_define(CLASS, NAME) +# define __libc_rwlock_wrlock(NAME) +# define __libc_rwlock_unlock(NAME) +#endif + +/* The internal variables in the standalone libintl.a must have different + names than the internal variables in GNU libc, otherwise programs + using libintl.a cannot be linked statically. */ +#if !defined _LIBC +# define _nl_default_default_domain libintl_nl_default_default_domain +# define _nl_current_default_domain libintl_nl_current_default_domain +#endif + +/* @@ end of prolog @@ */ + +/* Name of the default text domain. */ +extern const char _nl_default_default_domain[] attribute_hidden; + +/* Default text domain in which entries for gettext(3) are to be found. */ +extern const char *_nl_current_default_domain attribute_hidden; + + +/* Names for the libintl functions are a problem. They must not clash + with existing names and they should follow ANSI C. But this source + code is also used in GNU C Library where the names have a __ + prefix. So we have to make a difference here. */ +#ifdef _LIBC +# define TEXTDOMAIN __textdomain +# ifndef strdup +# define strdup(str) __strdup (str) +# endif +#else +# define TEXTDOMAIN libintl_textdomain +#endif + +/* Lock variable to protect the global data in the gettext implementation. */ +__libc_rwlock_define (extern, _nl_state_lock attribute_hidden) + +/* Set the current default message catalog to DOMAINNAME. + If DOMAINNAME is null, return the current default. + If DOMAINNAME is "", reset to the default of "messages". */ +char * +TEXTDOMAIN (domainname) + const char *domainname; +{ + char *new_domain; + char *old_domain; + + /* A NULL pointer requests the current setting. */ + if (domainname == NULL) + return (char *) _nl_current_default_domain; + + __libc_rwlock_wrlock (_nl_state_lock); + + old_domain = (char *) _nl_current_default_domain; + + /* If domain name is the null string set to default domain "messages". */ + if (domainname[0] == '\0' + || strcmp (domainname, _nl_default_default_domain) == 0) + { + _nl_current_default_domain = _nl_default_default_domain; + new_domain = (char *) _nl_current_default_domain; + } + else if (strcmp (domainname, old_domain) == 0) + /* This can happen and people will use it to signal that some + environment variable changed. */ + new_domain = old_domain; + else + { + /* If the following malloc fails `_nl_current_default_domain' + will be NULL. This value will be returned and so signals we + are out of core. */ +#if defined _LIBC || defined HAVE_STRDUP + new_domain = strdup (domainname); +#else + size_t len = strlen (domainname) + 1; + new_domain = (char *) malloc (len); + if (new_domain != NULL) + memcpy (new_domain, domainname, len); +#endif + + if (new_domain != NULL) + _nl_current_default_domain = new_domain; + } + + /* We use this possibility to signal a change of the loaded catalogs + since this is most likely the case and there is no other easy we + to do it. Do it only when the call was successful. */ + if (new_domain != NULL) + { + ++_nl_msg_cat_cntr; + + if (old_domain != new_domain && old_domain != _nl_default_default_domain) + free (old_domain); + } + + __libc_rwlock_unlock (_nl_state_lock); + + return new_domain; +} + +#ifdef _LIBC +/* Alias for function name in GNU C Library. */ +weak_alias (__textdomain, textdomain); +#endif diff --git a/lib/malloc/Makefile.in b/lib/malloc/Makefile.in new file mode 100644 index 0000000..abe0eca --- /dev/null +++ b/lib/malloc/Makefile.in @@ -0,0 +1,138 @@ +# Skeleton Makefile for the GNU malloc code +# +# Copyright (C) 1996-2009 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +srcdir = @srcdir@ +VPATH = .:@srcdir@ +topdir = @top_srcdir@ +BUILD_DIR = @BUILD_DIR@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ + +CC = @CC@ +RANLIB = @RANLIB@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +RM = rm -f +CP = cp +MV = mv + +SHELL = @MAKE_SHELL@ + +PROFILE_FLAGS = @PROFILE_FLAGS@ + +CFLAGS = @CFLAGS@ +LOCAL_CFLAGS = @LOCAL_CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ + +DEFS = @DEFS@ +LOCAL_DEFS = @LOCAL_DEFS@ + +LIBBUILD = ${BUILD_DIR}/lib + +BASHINCDIR = ${topdir}/include + +INTL_LIBSRC = ${topdir}/lib/intl +INTL_BUILDDIR = ${LIBBUILD}/intl +INTL_INC = @INTL_INC@ +LIBINTL_H = @LIBINTL_H@ + +INCLUDES = -I. -I../.. -I$(topdir) -I$(BASHINCDIR) -I$(topdir)/lib $(INTL_INC) + +CCFLAGS = ${PROFILE_FLAGS} ${INCLUDES} $(DEFS) $(LOCAL_DEFS) $(LOCAL_CFLAGS) \ + $(CFLAGS) $(MALLOC_CFLAGS) $(CPPFLAGS) + +.c.o: + $(CC) $(CCFLAGS) -c $< + +.s.o: + $(CC) $(CCFLAGS) -c $< + +MALLOC_SOURCE = malloc.c +STUB_SOURCE = stub.c + +ALLOCA_SOURCE = alloca.c +ALLOCA_OBJECT = alloca.o + +MALLOC_SRC = @MALLOC_SRC@ +MALLOC = @MALLOC@ +ALLOCA = @ALLOCA@ + +MALLOC_OBJS = malloc.o $(ALLOCA) trace.o stats.o table.o watch.o +STUB_OBJS = $(ALLOCA) stub.o + +.PHONY: malloc stubmalloc + +all: malloc + +malloc: ${MALLOC_OBJS} + ${RM} libmalloc.a + ${AR} ${ARFLAGS} libmalloc.a ${MALLOC_OBJS} + -test -n "$(RANLIB)" && $(RANLIB) libmalloc.a + +stubmalloc: ${STUB_OBJS} + ${RM} libmalloc.a + ${AR} ${ARFLAGS} libmalloc.a ${STUB_OBJS} + -test -n "$(RANLIB)" && $(RANLIB) libmalloc.a + +alloca: ${ALLOCA} + ${RM} libmalloc.a + ${AR} ${ARFLAGS} libmalloc.a ${ALLOCA} + -test -n "$(RANLIB)" && $(RANLIB) libmalloc.a + +alloca.o: $(srcdir)/$(ALLOCA_SOURCE) + $(CC) $(CCFLAGS) -c $(srcdir)/$(ALLOCA_SOURCE) + @- if test "$(ALLOCA_OBJECT)" != alloca.o ; then \ + mv $(ALLOCA_OBJECT) alloca.o >/dev/null 2>&1 ; \ + fi + +mostlyclean clean: + $(RM) *.o libmalloc.a + +distclean realclean maintainer-clean: clean + $(RM) Makefile + +alloca.o: $(BUILD_DIR)/config.h +malloc.o: $(BUILD_DIR)/config.h $(topdir)/bashtypes.h getpagesize.h +xmalloc.o: $(BUILD_DIR)/config.h $(BASHINCDIR)/ansi_stdlib.h +trace.o: ${BUILD_DIR}/config.h +stats.o: ${BUILD_DIR}/config.h +table.o: ${BUILD_DIR}/config.h +watch.o: ${BUILD_DIR}/config.h + +malloc.o: ${srcdir}/imalloc.h ${srcdir}/mstats.h +malloc.o: ${srcdir}/table.h ${srcdir}/watch.h +stats.o: ${srcdir}/imalloc.h ${srcdir}/mstats.h +trace.o: ${srcdir}/imalloc.h +table.o: ${srcdir}/imalloc.h ${srcdir}/table.h +watch.o: ${srcdir}/imalloc.h ${srcdir}/watch.h + +malloc.o: ${topdir}/bashintl.h ${LIBINTL_H} ${BASHINCDIR}/gettext.h +stats.o: ${topdir}/bashintl.h ${LIBINTL_H} ${BASHINCDIR}/gettext.h +trace.o: ${topdir}/bashintl.h ${LIBINTL_H} ${BASHINCDIR}/gettext.h +table.o: ${topdir}/bashintl.h ${LIBINTL_H} ${BASHINCDIR}/gettext.h +watch.o: ${topdir}/bashintl.h ${LIBINTL_H} ${BASHINCDIR}/gettext.h + +# Rules for deficient makes, like SunOS and Solaris +stub.o: stub.c +malloc.o: malloc.c +table.o: table.c +trace.o: trace.c +stats.o: stats.c +watch.o: watch.c diff --git a/lib/malloc/alloca.c b/lib/malloc/alloca.c new file mode 100644 index 0000000..26319c2 --- /dev/null +++ b/lib/malloc/alloca.c @@ -0,0 +1,482 @@ +/* alloca.c -- allocate automatically reclaimed memory + (Mostly) portable public-domain implementation -- D A Gwyn + + This implementation of the PWB library alloca function, + which is used to allocate space off the run-time stack so + that it is automatically reclaimed upon procedure exit, + was inspired by discussions with J. Q. Johnson of Cornell. + J.Otto Tennant contributed the Cray support. + + There are some preprocessor constants that can + be defined when compiling for your specific system, for + improved efficiency; however, the defaults should be okay. + + The general concept of this implementation is to keep + track of all alloca-allocated blocks, and reclaim any + that are found to be deeper in the stack than the current + invocation. This heuristic does not reclaim storage as + soon as it becomes invalid, but it will do so eventually. + + As a special case, alloca(0) reclaims storage without + allocating any. It is a good idea to use alloca(0) in + your main control loop, etc. to force garbage collection. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +/* If compiling with GCC 2, this file's not needed. */ +#if !defined (__GNUC__) || __GNUC__ < 2 + +#include /* for size_t */ + +/* If alloca is defined somewhere, this file is not needed. */ +#ifndef alloca + +#ifdef emacs +#ifdef static +/* actually, only want this if static is defined as "" + -- this is for usg, in which emacs must undefine static + in order to make unexec workable + */ +#ifndef STACK_DIRECTION +you +lose +-- must know STACK_DIRECTION at compile-time +#endif /* STACK_DIRECTION undefined */ +#endif /* static */ +#endif /* emacs */ + +/* If your stack is a linked list of frames, you have to + provide an "address metric" ADDRESS_FUNCTION macro. */ + +#if defined (CRAY) && defined (CRAY_STACKSEG_END) +long i00afunc (); +#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) +#else +#define ADDRESS_FUNCTION(arg) &(arg) +#endif /* CRAY && CRAY_STACKSEG_END */ + +#if __STDC__ +typedef void *pointer; +#else +typedef char *pointer; +#endif + +#define NULL 0 + +/* Different portions of Emacs need to call different versions of + malloc. The Emacs executable needs alloca to call xmalloc, because + ordinary malloc isn't protected from input signals. On the other + hand, the utilities in lib-src need alloca to call malloc; some of + them are very simple, and don't have an xmalloc routine. + + Non-Emacs programs expect this to call use xmalloc. + + Callers below should use malloc. */ + +#ifndef emacs +#define malloc xmalloc +extern pointer xmalloc (); +#endif + +/* Define STACK_DIRECTION if you know the direction of stack + growth for your system; otherwise it will be automatically + deduced at run-time. + + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ + +#ifndef STACK_DIRECTION +#define STACK_DIRECTION 0 /* Direction unknown. */ +#endif + +#if STACK_DIRECTION != 0 + +#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */ + +#else /* STACK_DIRECTION == 0; need run-time code. */ + +static int stack_dir; /* 1 or -1 once known. */ +#define STACK_DIR stack_dir + +static void +find_stack_direction () +{ + static char *addr = NULL; /* Address of first `dummy', once known. */ + auto char dummy; /* To get stack address. */ + + if (addr == NULL) + { /* Initial entry. */ + addr = ADDRESS_FUNCTION (dummy); + + find_stack_direction (); /* Recurse once. */ + } + else + { + /* Second entry. */ + if (ADDRESS_FUNCTION (dummy) > addr) + stack_dir = 1; /* Stack grew upward. */ + else + stack_dir = -1; /* Stack grew downward. */ + } +} + +#endif /* STACK_DIRECTION == 0 */ + +/* An "alloca header" is used to: + (a) chain together all alloca'ed blocks; + (b) keep track of stack depth. + + It is very important that sizeof(header) agree with malloc + alignment chunk size. The following default should work okay. */ + +#ifndef ALIGN_SIZE +#define ALIGN_SIZE sizeof(double) +#endif + +typedef union hdr +{ + char align[ALIGN_SIZE]; /* To force sizeof(header). */ + struct + { + union hdr *next; /* For chaining headers. */ + char *deep; /* For stack depth measure. */ + } h; +} header; + +static header *last_alloca_header = NULL; /* -> last alloca header. */ + +/* Return a pointer to at least SIZE bytes of storage, + which will be automatically reclaimed upon exit from + the procedure that called alloca. Originally, this space + was supposed to be taken from the current stack frame of the + caller, but that method cannot be made to work for some + implementations of C, for example under Gould's UTX/32. */ + +pointer +alloca (size) + size_t size; +{ + auto char probe; /* Probes stack depth: */ + register char *depth = ADDRESS_FUNCTION (probe); + +#if STACK_DIRECTION == 0 + if (STACK_DIR == 0) /* Unknown growth direction. */ + find_stack_direction (); +#endif + + /* Reclaim garbage, defined as all alloca'd storage that + was allocated from deeper in the stack than currently. */ + + { + register header *hp; /* Traverses linked list. */ + + for (hp = last_alloca_header; hp != NULL;) + if ((STACK_DIR > 0 && hp->h.deep > depth) + || (STACK_DIR < 0 && hp->h.deep < depth)) + { + register header *np = hp->h.next; + + free ((pointer) hp); /* Collect garbage. */ + + hp = np; /* -> next header. */ + } + else + break; /* Rest are not deeper. */ + + last_alloca_header = hp; /* -> last valid storage. */ + } + + if (size == 0) + return NULL; /* No allocation required. */ + + /* Allocate combined header + user data storage. */ + + { + register pointer new = malloc (sizeof (header) + size); + /* Address of header. */ + + ((header *) new)->h.next = last_alloca_header; + ((header *) new)->h.deep = depth; + + last_alloca_header = (header *) new; + + /* User storage begins just after header. */ + + return (pointer) ((char *) new + sizeof (header)); + } +} + +#if defined (CRAY) && defined (CRAY_STACKSEG_END) + +#ifdef DEBUG_I00AFUNC +#include +#endif + +#ifndef CRAY_STACK +#define CRAY_STACK +#ifndef CRAY2 +/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ +struct stack_control_header + { + long shgrow:32; /* Number of times stack has grown. */ + long shaseg:32; /* Size of increments to stack. */ + long shhwm:32; /* High water mark of stack. */ + long shsize:32; /* Current size of stack (all segments). */ + }; + +/* The stack segment linkage control information occurs at + the high-address end of a stack segment. (The stack + grows from low addresses to high addresses.) The initial + part of the stack segment linkage control information is + 0200 (octal) words. This provides for register storage + for the routine which overflows the stack. */ + +struct stack_segment_linkage + { + long ss[0200]; /* 0200 overflow words. */ + long sssize:32; /* Number of words in this segment. */ + long ssbase:32; /* Offset to stack base. */ + long:32; + long sspseg:32; /* Offset to linkage control of previous + segment of stack. */ + long:32; + long sstcpt:32; /* Pointer to task common address block. */ + long sscsnm; /* Private control structure number for + microtasking. */ + long ssusr1; /* Reserved for user. */ + long ssusr2; /* Reserved for user. */ + long sstpid; /* Process ID for pid based multi-tasking. */ + long ssgvup; /* Pointer to multitasking thread giveup. */ + long sscray[7]; /* Reserved for Cray Research. */ + long ssa0; + long ssa1; + long ssa2; + long ssa3; + long ssa4; + long ssa5; + long ssa6; + long ssa7; + long sss0; + long sss1; + long sss2; + long sss3; + long sss4; + long sss5; + long sss6; + long sss7; + }; + +#else /* CRAY2 */ +/* The following structure defines the vector of words + returned by the STKSTAT library routine. */ +struct stk_stat + { + long now; /* Current total stack size. */ + long maxc; /* Amount of contiguous space which would + be required to satisfy the maximum + stack demand to date. */ + long high_water; /* Stack high-water mark. */ + long overflows; /* Number of stack overflow ($STKOFEN) calls. */ + long hits; /* Number of internal buffer hits. */ + long extends; /* Number of block extensions. */ + long stko_mallocs; /* Block allocations by $STKOFEN. */ + long underflows; /* Number of stack underflow calls ($STKRETN). */ + long stko_free; /* Number of deallocations by $STKRETN. */ + long stkm_free; /* Number of deallocations by $STKMRET. */ + long segments; /* Current number of stack segments. */ + long maxs; /* Maximum number of stack segments so far. */ + long pad_size; /* Stack pad size. */ + long current_address; /* Current stack segment address. */ + long current_size; /* Current stack segment size. This + number is actually corrupted by STKSTAT to + include the fifteen word trailer area. */ + long initial_address; /* Address of initial segment. */ + long initial_size; /* Size of initial segment. */ + }; + +/* The following structure describes the data structure which trails + any stack segment. I think that the description in 'asdef' is + out of date. I only describe the parts that I am sure about. */ + +struct stk_trailer + { + long this_address; /* Address of this block. */ + long this_size; /* Size of this block (does not include + this trailer). */ + long unknown2; + long unknown3; + long link; /* Address of trailer block of previous + segment. */ + long unknown5; + long unknown6; + long unknown7; + long unknown8; + long unknown9; + long unknown10; + long unknown11; + long unknown12; + long unknown13; + long unknown14; + }; + +#endif /* CRAY2 */ +#endif /* not CRAY_STACK */ + +#ifdef CRAY2 +/* Determine a "stack measure" for an arbitrary ADDRESS. + I doubt that "lint" will like this much. */ + +static long +i00afunc (long *address) +{ + struct stk_stat status; + struct stk_trailer *trailer; + long *block, size; + long result = 0; + + /* We want to iterate through all of the segments. The first + step is to get the stack status structure. We could do this + more quickly and more directly, perhaps, by referencing the + $LM00 common block, but I know that this works. */ + + STKSTAT (&status); + + /* Set up the iteration. */ + + trailer = (struct stk_trailer *) (status.current_address + + status.current_size + - 15); + + /* There must be at least one stack segment. Therefore it is + a fatal error if "trailer" is null. */ + + if (trailer == 0) + abort (); + + /* Discard segments that do not contain our argument address. */ + + while (trailer != 0) + { + block = (long *) trailer->this_address; + size = trailer->this_size; + if (block == 0 || size == 0) + abort (); + trailer = (struct stk_trailer *) trailer->link; + if ((block <= address) && (address < (block + size))) + break; + } + + /* Set the result to the offset in this segment and add the sizes + of all predecessor segments. */ + + result = address - block; + + if (trailer == 0) + { + return result; + } + + do + { + if (trailer->this_size <= 0) + abort (); + result += trailer->this_size; + trailer = (struct stk_trailer *) trailer->link; + } + while (trailer != 0); + + /* We are done. Note that if you present a bogus address (one + not in any segment), you will get a different number back, formed + from subtracting the address of the first block. This is probably + not what you want. */ + + return (result); +} + +#else /* not CRAY2 */ +/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. + Determine the number of the cell within the stack, + given the address of the cell. The purpose of this + routine is to linearize, in some sense, stack addresses + for alloca. */ + +static long +i00afunc (long address) +{ + long stkl = 0; + + long size, pseg, this_segment, stack; + long result = 0; + + struct stack_segment_linkage *ssptr; + + /* Register B67 contains the address of the end of the + current stack segment. If you (as a subprogram) store + your registers on the stack and find that you are past + the contents of B67, you have overflowed the segment. + + B67 also points to the stack segment linkage control + area, which is what we are really interested in. */ + + /* This might be _getb67() or GETB67 () or getb67 () */ + stkl = CRAY_STACKSEG_END (); + ssptr = (struct stack_segment_linkage *) stkl; + + /* If one subtracts 'size' from the end of the segment, + one has the address of the first word of the segment. + + If this is not the first segment, 'pseg' will be + nonzero. */ + + pseg = ssptr->sspseg; + size = ssptr->sssize; + + this_segment = stkl - size; + + /* It is possible that calling this routine itself caused + a stack overflow. Discard stack segments which do not + contain the target address. */ + + while (!(this_segment <= address && address <= stkl)) + { +#ifdef DEBUG_I00AFUNC + fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl); +#endif + if (pseg == 0) + break; + stkl = stkl - pseg; + ssptr = (struct stack_segment_linkage *) stkl; + size = ssptr->sssize; + pseg = ssptr->sspseg; + this_segment = stkl - size; + } + + result = address - this_segment; + + /* If you subtract pseg from the current end of the stack, + you get the address of the previous stack segment's end. + This seems a little convoluted to me, but I'll bet you save + a cycle somewhere. */ + + while (pseg != 0) + { +#ifdef DEBUG_I00AFUNC + fprintf (stderr, "%011o %011o\n", pseg, size); +#endif + stkl = stkl - pseg; + ssptr = (struct stack_segment_linkage *) stkl; + size = ssptr->sssize; + pseg = ssptr->sspseg; + result += size; + } + return (result); +} + +#endif /* not CRAY2 */ +#endif /* CRAY && CRAY_STACKSEG_END */ + +#endif /* no alloca */ +#endif /* !__GNUC__ || __GNUC__ < 2 */ diff --git a/lib/malloc/getpagesize.h b/lib/malloc/getpagesize.h new file mode 100644 index 0000000..a59eabe --- /dev/null +++ b/lib/malloc/getpagesize.h @@ -0,0 +1,60 @@ +/* Emulation of getpagesize() for systems that need it. + Copyright (C) 1991-2003 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne-Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +# if defined (_SC_PAGESIZE) +# define getpagesize() sysconf(_SC_PAGESIZE) +# else +# if defined (_SC_PAGE_SIZE) +# define getpagesize() sysconf(_SC_PAGE_SIZE) +# endif /* _SC_PAGE_SIZE */ +# endif /* _SC_PAGESIZE */ +#endif + +#if !defined (getpagesize) +# if defined (HAVE_SYS_PARAM_H) +# include +# endif +# if defined (PAGESIZE) +# define getpagesize() PAGESIZE +# else /* !PAGESIZE */ +# if defined (EXEC_PAGESIZE) +# define getpagesize() EXEC_PAGESIZE +# else /* !EXEC_PAGESIZE */ +# if defined (NBPG) +# if !defined (CLSIZE) +# define CLSIZE 1 +# endif /* !CLSIZE */ +# define getpagesize() (NBPG * CLSIZE) +# else /* !NBPG */ +# if defined (NBPC) +# define getpagesize() NBPC +# endif /* NBPC */ +# endif /* !NBPG */ +# endif /* !EXEC_PAGESIZE */ +# endif /* !PAGESIZE */ +#endif /* !getpagesize */ + +#if !defined (getpagesize) +# define getpagesize() 4096 /* Just punt and use reasonable value */ +#endif diff --git a/lib/malloc/i386-alloca.s b/lib/malloc/i386-alloca.s new file mode 100644 index 0000000..01b2cfe --- /dev/null +++ b/lib/malloc/i386-alloca.s @@ -0,0 +1,16 @@ + .file "alloca.s" + .text + .align 4 + .def alloca; .val alloca; .scl 2; .type 044; .endef + .globl alloca +alloca: + popl %edx + popl %eax + addl $3,%eax + andl $0xfffffffc,%eax + subl %eax,%esp + movl %esp,%eax + pushl %eax + pushl %edx + ret + .def alloca; .val .; .scl -1; .endef diff --git a/lib/malloc/imalloc.h b/lib/malloc/imalloc.h new file mode 100644 index 0000000..82b09eb --- /dev/null +++ b/lib/malloc/imalloc.h @@ -0,0 +1,173 @@ +/* imalloc.h -- internal malloc definitions shared by source files. */ + +/* Copyright (C) 2001-2003 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Must be included *after* config.h */ + +#ifndef _IMALLOC_H +#define _IMALLOC_H + +#ifdef MALLOC_DEBUG +#define MALLOC_STATS +#define MALLOC_TRACE +#define MALLOC_REGISTER +#define MALLOC_WATCH +#endif + +#define MALLOC_WRAPFUNCS + +/* Generic pointer type. */ +#ifndef PTR_T +# if defined (__STDC__) +# define PTR_T void * +# else +# define PTR_T char * +# endif +#endif + +#if !defined (NULL) +# define NULL 0 +#endif + +#if !defined (CPP_STRING) +# if defined (HAVE_STRINGIZE) +# define CPP_STRING(x) #x +# else +# define CPP_STRING(x) "x" +# endif /* !HAVE_STRINGIZE */ +#endif /* !__STRING */ + +#if __GNUC__ > 1 +# define FASTCOPY(s, d, n) __builtin_memcpy (d, s, n) +#else /* !__GNUC__ */ +# if !defined (HAVE_BCOPY) +# if !defined (HAVE_MEMMOVE) +# define FASTCOPY(s, d, n) memcpy (d, s, n) +# else +# define FASTCOPY(s, d, n) memmove (d, s, n) +# endif /* !HAVE_MEMMOVE */ +# else /* HAVE_BCOPY */ +# define FASTCOPY(s, d, n) bcopy (s, d, n) +# endif /* HAVE_BCOPY */ +#endif /* !__GNUC__ */ + +#if !defined (__P) +# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus) || defined (PROTOTYPES) +# define __P(protos) protos +# else +# define __P(protos) () +# endif +#endif + +/* Use Duff's device for good zeroing/copying performance. DO NOT call the + Duff's device macros with NBYTES == 0. */ + +#define MALLOC_BZERO(charp, nbytes) \ +do { \ + if ((nbytes) <= 32) { \ + size_t * mzp = (size_t *)(charp); \ + unsigned long mctmp = (nbytes)/sizeof(size_t); \ + long mcn; \ + if (mctmp < 8) mcn = 0; else { mcn = (mctmp-1)/8; mctmp &= 7; } \ + switch (mctmp) { \ + case 0: for(;;) { *mzp++ = 0; \ + case 7: *mzp++ = 0; \ + case 6: *mzp++ = 0; \ + case 5: *mzp++ = 0; \ + case 4: *mzp++ = 0; \ + case 3: *mzp++ = 0; \ + case 2: *mzp++ = 0; \ + case 1: *mzp++ = 0; if(mcn <= 0) break; mcn--; } \ + } \ + else \ + memset ((charp), 0, (nbytes)); \ +} while(0) + +#define MALLOC_ZERO(charp, nbytes) \ +do { \ + size_t mzsz = (nbytes); \ + if (mzsz <= 9 * sizeof(mzsz) { \ + size_t *mz = (size_t *)(charp); \ + if(mzsz >= 5*sizeof(mzsz)) { *mz++ = 0; \ + *mz++ = 0; \ + if(mzsz >= 7*sizeof(mzsz)) { *mz++ = 0; \ + *mz++ = 0; \ + if(mzsz >= 9*sizeof(mzsz)) { *mz++ = 0; \ + *mz++ = 0; }}} \ + *mz++ = 0; \ + *mz++ = 0; \ + *mz = 0; \ + } else \ + memset ((charp), 0, mzsz); \ +} while (0) + +#define MALLOC_MEMSET(charp, xch, nbytes) \ +do { \ + if ((nbytes) <= 32) { \ + register char * mzp = (charp); \ + unsigned long mctmp = (nbytes); \ + register long mcn; \ + if (mctmp < 8) mcn = 0; else { mcn = (mctmp-1)/8; mctmp &= 7; } \ + switch (mctmp) { \ + case 0: for(;;) { *mzp++ = xch; \ + case 7: *mzp++ = xch; \ + case 6: *mzp++ = xch; \ + case 5: *mzp++ = xch; \ + case 4: *mzp++ = xch; \ + case 3: *mzp++ = xch; \ + case 2: *mzp++ = xch; \ + case 1: *mzp++ = xch; if(mcn <= 0) break; mcn--; } \ + } \ + } else \ + memset ((charp), (xch), (nbytes)); \ +} while(0) + +#define MALLOC_MEMCPY(dest,src,nbytes) \ +do { \ + if ((nbytes) <= 32) { \ + size_t* mcsrc = (size_t*) src; \ + size_t* mcdst = (size_t*) dest; \ + unsigned long mctmp = (nbytes)/sizeof(size_t); \ + long mcn; \ + if (mctmp < 8) mcn = 0; else { mcn = (mctmp-1)/8; mctmp &= 7; } \ + switch (mctmp) { \ + case 0: for(;;) { *mcdst++ = *mcsrc++; \ + case 7: *mcdst++ = *mcsrc++; \ + case 6: *mcdst++ = *mcsrc++; \ + case 5: *mcdst++ = *mcsrc++; \ + case 4: *mcdst++ = *mcsrc++; \ + case 3: *mcdst++ = *mcsrc++; \ + case 2: *mcdst++ = *mcsrc++; \ + case 1: *mcdst++ = *mcsrc++; if(mcn <= 0) break; mcn--; } \ + } else \ + memcpy ((dest), (src), (nbytes)) \ +} while(0) + +#if defined (SHELL) +# include "bashintl.h" +#else +# define _(x) x +#endif + +#include + +extern void _malloc_block_signals __P((sigset_t *, sigset_t *)); +extern void _malloc_unblock_signals __P((sigset_t *, sigset_t *)); + +#endif /* _IMALLOC_H */ diff --git a/lib/malloc/malloc.c b/lib/malloc/malloc.c new file mode 100644 index 0000000..cd987c0 --- /dev/null +++ b/lib/malloc/malloc.c @@ -0,0 +1,1307 @@ +/* malloc.c - dynamic memory allocation for bash. */ + +/* Copyright (C) 1985-2005 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne-Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* + * @(#)nmalloc.c 1 (Caltech) 2/21/82 + * + * U of M Modified: 20 Jun 1983 ACT: strange hacks for Emacs + * + * Nov 1983, Mike@BRL, Added support for 4.1C/4.2 BSD. + * + * This is a very fast storage allocator. It allocates blocks of a small + * number of different sizes, and keeps free lists of each size. Blocks + * that don't exactly fit are passed up to the next larger size. In this + * implementation, the available sizes are (2^n)-4 (or -16) bytes long. + * This is designed for use in a program that uses vast quantities of + * memory, but bombs when it runs out. To make it a little better, it + * warns the user when he starts to get near the end. + * + * June 84, ACT: modified rcheck code to check the range given to malloc, + * rather than the range determined by the 2-power used. + * + * Jan 85, RMS: calls malloc_warning to issue warning on nearly full. + * No longer Emacs-specific; can serve as all-purpose malloc for GNU. + * You should call malloc_init to reinitialize after loading dumped Emacs. + * Call malloc_stats to get info on memory stats if MALLOC_STATS turned on. + * realloc knows how to return same block given, just changing its size, + * if the power of 2 is correct. + */ + +/* + * nextf[i] is the pointer to the next free block of size 2^(i+3). The + * smallest allocatable block is 8 bytes. The overhead information will + * go in the first int of the block, and the returned pointer will point + * to the second. + */ + +/* Define MEMSCRAMBLE to have free() write 0xcf into memory as it's freed, to + uncover callers that refer to freed memory, and to have malloc() write 0xdf + into memory as it's allocated to avoid referring to previous contents. */ + +/* SCO 3.2v4 getcwd and possibly other libc routines fail with MEMSCRAMBLE; + handled by configure. */ + +#if defined (HAVE_CONFIG_H) +# include +#endif /* HAVE_CONFIG_H */ + +#if defined (SHELL) +# include "bashtypes.h" +# include "stdc.h" +#else +# include +#endif + +#if defined (HAVE_UNISTD_H) +# include +#endif + +/* Determine which kind of system this is. */ +#include + +#if defined (HAVE_STRING_H) +# include +#else +# include +#endif + +#include + +/* Define getpagesize () if the system does not. */ +#ifndef HAVE_GETPAGESIZE +# include "getpagesize.h" +#endif + +#include "imalloc.h" +#ifdef MALLOC_STATS +# include "mstats.h" +#endif +#ifdef MALLOC_REGISTER +# include "table.h" +#endif +#ifdef MALLOC_WATCH +# include "watch.h" +#endif + +/* System-specific omissions. */ +#ifdef HPUX +# define NO_VALLOC +#endif + +#define NBUCKETS 30 + +#define ISALLOC ((char) 0xf7) /* magic byte that implies allocation */ +#define ISFREE ((char) 0x54) /* magic byte that implies free block */ + /* this is for error checking only */ +#define ISMEMALIGN ((char) 0xd6) /* Stored before the value returned by + memalign, with the rest of the word + being the distance to the true + beginning of the block. */ + + +/* We have a flag indicating whether memory is allocated, an index in + nextf[], a size field, and a sentinel value to determine whether or + not a caller wrote before the start of allocated memory; to realloc() + memory we either copy mh_nbytes or just change mh_nbytes if there is + enough room in the block for the new size. Range checking is always + done. */ +union mhead { + bits64_t mh_align; /* 8 */ + struct { + char mi_alloc; /* ISALLOC or ISFREE */ /* 1 */ + char mi_index; /* index in nextf[] */ /* 1 */ + /* Remainder are valid only when block is allocated */ + u_bits16_t mi_magic2; /* should be == MAGIC2 */ /* 2 */ + u_bits32_t mi_nbytes; /* # of bytes allocated */ /* 4 */ + } minfo; +}; +#define mh_alloc minfo.mi_alloc +#define mh_index minfo.mi_index +#define mh_nbytes minfo.mi_nbytes +#define mh_magic2 minfo.mi_magic2 + +#define MOVERHEAD sizeof(union mhead) +#define MALIGN_MASK 7 /* one less than desired alignment */ + +typedef union _malloc_guard { + char s[4]; + u_bits32_t i; +} mguard_t; + +/* Access free-list pointer of a block. + It is stored at block + sizeof (char *). + This is not a field in the minfo structure member of union mhead + because we want sizeof (union mhead) + to describe the overhead for when the block is in use, + and we do not want the free-list pointer to count in that. */ + +#define CHAIN(a) \ + (*(union mhead **) (sizeof (char *) + (char *) (a))) + +/* To implement range checking, we write magic values in at the beginning + and end of each allocated block, and make sure they are undisturbed + whenever a free or a realloc occurs. */ + +/* Written in the 2 bytes before the block's real space (-4 bytes) */ +#define MAGIC2 0x5555 +#define MSLOP 4 /* 4 bytes extra for u_bits32_t size */ + +/* How many bytes are actually allocated for a request of size N -- + rounded up to nearest multiple of 8 after accounting for malloc + overhead. */ +#define ALLOCATED_BYTES(n) \ + (((n) + MOVERHEAD + MSLOP + MALIGN_MASK) & ~MALIGN_MASK) + +#define ASSERT(p) \ + do \ + { \ + if (!(p)) xbotch((PTR_T)0, ERR_ASSERT_FAILED, CPP_STRING(p), file, line); \ + } \ + while (0) + +/* Minimum and maximum bucket indices for block splitting (and to bound + the search for a block to split). */ +#define SPLIT_MIN 2 /* XXX - was 3 */ +#define SPLIT_MID 11 +#define SPLIT_MAX 14 + +/* Minimum and maximum bucket indices for block coalescing. */ +#define COMBINE_MIN 2 +#define COMBINE_MAX (pagebucket - 1) /* XXX */ + +#define LESSCORE_MIN 10 +#define LESSCORE_FRC 13 + +#define STARTBUCK 1 + +/* Flags for the internal functions. */ +#define MALLOC_WRAPPER 0x01 /* wrapper function */ +#define MALLOC_INTERNAL 0x02 /* internal function calling another */ +#define MALLOC_NOTRACE 0x04 /* don't trace this allocation or free */ +#define MALLOC_NOREG 0x08 /* don't register this allocation or free */ + +/* Future use. */ +#define ERR_DUPFREE 0x01 +#define ERR_UNALLOC 0x02 +#define ERR_UNDERFLOW 0x04 +#define ERR_ASSERT_FAILED 0x08 + +/* Evaluates to true if NB is appropriate for bucket NU. NB is adjusted + appropriately by the caller to account for malloc overhead. This only + checks that the recorded size is not too big for the bucket. We + can't check whether or not it's in between NU and NU-1 because we + might have encountered a busy bucket when allocating and moved up to + the next size. */ +#define IN_BUCKET(nb, nu) ((nb) <= binsizes[(nu)]) + +/* Use this when we want to be sure that NB is in bucket NU. */ +#define RIGHT_BUCKET(nb, nu) \ + (((nb) > binsizes[(nu)-1]) && ((nb) <= binsizes[(nu)])) + +/* nextf[i] is free list of blocks of size 2**(i + 3) */ + +static union mhead *nextf[NBUCKETS]; + +/* busy[i] is nonzero while allocation or free of block size i is in progress. */ + +static char busy[NBUCKETS]; + +static int pagesz; /* system page size. */ +static int pagebucket; /* bucket for requests a page in size */ +static int maxbuck; /* highest bucket receiving allocation request. */ + +static char *memtop; /* top of heap */ + +static const unsigned long binsizes[NBUCKETS] = { + 8UL, 16UL, 32UL, 64UL, 128UL, 256UL, 512UL, 1024UL, 2048UL, 4096UL, + 8192UL, 16384UL, 32768UL, 65536UL, 131072UL, 262144UL, 524288UL, + 1048576UL, 2097152UL, 4194304UL, 8388608UL, 16777216UL, 33554432UL, + 67108864UL, 134217728UL, 268435456UL, 536870912UL, 1073741824UL, + 2147483648UL, 4294967295UL +}; + +/* binsizes[x] == (1 << ((x) + 3)) */ +#define binsize(x) binsizes[(x)] + +/* Declarations for internal functions */ +static PTR_T internal_malloc __P((size_t, const char *, int, int)); +static PTR_T internal_realloc __P((PTR_T, size_t, const char *, int, int)); +static void internal_free __P((PTR_T, const char *, int, int)); +static PTR_T internal_memalign __P((size_t, size_t, const char *, int, int)); +#ifndef NO_CALLOC +static PTR_T internal_calloc __P((size_t, size_t, const char *, int, int)); +static void internal_cfree __P((PTR_T, const char *, int, int)); +#endif +#ifndef NO_VALLOC +static PTR_T internal_valloc __P((size_t, const char *, int, int)); +#endif + +#if defined (botch) +extern void botch (); +#else +static void botch __P((const char *, const char *, int)); +#endif +static void xbotch __P((PTR_T, int, const char *, const char *, int)); + +#if !HAVE_DECL_SBRK +extern char *sbrk (); +#endif /* !HAVE_DECL_SBRK */ + +#ifdef SHELL +extern int interrupt_immediately, running_trap; +extern int signal_is_trapped __P((int)); +#endif + +#ifdef MALLOC_STATS +struct _malstats _mstats; +#endif /* MALLOC_STATS */ + +/* Debugging variables available to applications. */ +int malloc_flags = 0; /* future use */ +int malloc_trace = 0; /* trace allocations and frees to stderr */ +int malloc_register = 0; /* future use */ + +#ifdef MALLOC_TRACE +char _malloc_trace_buckets[NBUCKETS]; + +/* These should really go into a header file. */ +extern void mtrace_alloc __P((const char *, PTR_T, size_t, const char *, int)); +extern void mtrace_free __P((PTR_T, int, const char *, int)); +#endif + +#if !defined (botch) +static void +botch (s, file, line) + const char *s; + const char *file; + int line; +{ + fprintf (stderr, _("malloc: failed assertion: %s\n"), s); + (void)fflush (stderr); + abort (); +} +#endif + +/* print the file and line number that caused the assertion failure and + call botch() to do whatever the application wants with the information */ +static void +xbotch (mem, e, s, file, line) + PTR_T mem; + int e; + const char *s; + const char *file; + int line; +{ + fprintf (stderr, _("\r\nmalloc: %s:%d: assertion botched\r\n"), + file ? file : _("unknown"), line); +#ifdef MALLOC_REGISTER + if (mem != NULL && malloc_register) + mregister_describe_mem (mem, stderr); +#endif + (void)fflush (stderr); + botch(s, file, line); +} + +/* Coalesce two adjacent free blocks off the free list for size NU - 1, + as long as we can find two adjacent free blocks. nextf[NU -1] is + assumed to not be busy; the caller (morecore()) checks for this. + BUSY[NU] must be set to 1. */ +static void +bcoalesce (nu) + register int nu; +{ + register union mhead *mp, *mp1, *mp2; + register int nbuck; + unsigned long siz; + + nbuck = nu - 1; + if (nextf[nbuck] == 0 || busy[nbuck]) + return; + + busy[nbuck] = 1; + siz = binsize (nbuck); + + mp2 = mp1 = nextf[nbuck]; + mp = CHAIN (mp1); + while (mp && mp != (union mhead *)((char *)mp1 + siz)) + { + mp2 = mp1; + mp1 = mp; + mp = CHAIN (mp); + } + + if (mp == 0) + { + busy[nbuck] = 0; + return; + } + + /* OK, now we have mp1 pointing to the block we want to add to nextf[NU]. + CHAIN(mp2) must equal mp1. Check that mp1 and mp are adjacent. */ + if (mp2 != mp1 && CHAIN(mp2) != mp1) + { + busy[nbuck] = 0; + xbotch ((PTR_T)0, 0, "bcoalesce: CHAIN(mp2) != mp1", (char *)NULL, 0); + } + +#ifdef MALLOC_DEBUG + if (CHAIN (mp1) != (union mhead *)((char *)mp1 + siz)) + { + busy[nbuck] = 0; + return; /* not adjacent */ + } +#endif + + /* Since they are adjacent, remove them from the free list */ + if (mp1 == nextf[nbuck]) + nextf[nbuck] = CHAIN (mp); + else + CHAIN (mp2) = CHAIN (mp); + busy[nbuck] = 0; + +#ifdef MALLOC_STATS + _mstats.tbcoalesce++; + _mstats.ncoalesce[nbuck]++; +#endif + + /* And add the combined two blocks to nextf[NU]. */ + mp1->mh_alloc = ISFREE; + mp1->mh_index = nu; + CHAIN (mp1) = nextf[nu]; + nextf[nu] = mp1; +} + +/* Split a block at index > NU (but less than SPLIT_MAX) into a set of + blocks of the correct size, and attach them to nextf[NU]. nextf[NU] + is assumed to be empty. Must be called with signals blocked (e.g., + by morecore()). BUSY[NU] must be set to 1. */ +static void +bsplit (nu) + register int nu; +{ + register union mhead *mp; + int nbuck, nblks, split_max; + unsigned long siz; + + split_max = (maxbuck > SPLIT_MAX) ? maxbuck : SPLIT_MAX; + + if (nu >= SPLIT_MID) + { + for (nbuck = split_max; nbuck > nu; nbuck--) + { + if (busy[nbuck] || nextf[nbuck] == 0) + continue; + break; + } + } + else + { + for (nbuck = nu + 1; nbuck <= split_max; nbuck++) + { + if (busy[nbuck] || nextf[nbuck] == 0) + continue; + break; + } + } + + if (nbuck > split_max || nbuck <= nu) + return; + + /* XXX might want to split only if nextf[nbuck] has >= 2 blocks free + and nbuck is below some threshold. */ + + /* Remove the block from the chain of larger blocks. */ + busy[nbuck] = 1; + mp = nextf[nbuck]; + nextf[nbuck] = CHAIN (mp); + busy[nbuck] = 0; + +#ifdef MALLOC_STATS + _mstats.tbsplit++; + _mstats.nsplit[nbuck]++; +#endif + + /* Figure out how many blocks we'll get. */ + siz = binsize (nu); + nblks = binsize (nbuck) / siz; + + /* Split the block and put it on the requested chain. */ + nextf[nu] = mp; + while (1) + { + mp->mh_alloc = ISFREE; + mp->mh_index = nu; + if (--nblks <= 0) break; + CHAIN (mp) = (union mhead *)((char *)mp + siz); + mp = (union mhead *)((char *)mp + siz); + } + CHAIN (mp) = 0; +} + +/* Take the memory block MP and add it to a chain < NU. NU is the right bucket, + but is busy. This avoids memory orphaning. */ +static void +xsplit (mp, nu) + union mhead *mp; + int nu; +{ + union mhead *nh; + int nbuck, nblks, split_max; + unsigned long siz; + + nbuck = nu - 1; + while (nbuck >= SPLIT_MIN && busy[nbuck]) + nbuck--; + if (nbuck < SPLIT_MIN) + return; + +#ifdef MALLOC_STATS + _mstats.tbsplit++; + _mstats.nsplit[nu]++; +#endif + + /* Figure out how many blocks we'll get. */ + siz = binsize (nu); /* original block size */ + nblks = siz / binsize (nbuck); /* should be 2 most of the time */ + + /* And add it to nextf[nbuck] */ + siz = binsize (nbuck); /* XXX - resetting here */ + nh = mp; + while (1) + { + mp->mh_alloc = ISFREE; + mp->mh_index = nbuck; + if (--nblks <= 0) break; + CHAIN (mp) = (union mhead *)((char *)mp + siz); + mp = (union mhead *)((char *)mp + siz); + } + busy[nbuck] = 1; + CHAIN (mp) = nextf[nbuck]; + nextf[nbuck] = nh; + busy[nbuck] = 0; +} + +void +_malloc_block_signals (setp, osetp) + sigset_t *setp, *osetp; +{ +#ifdef HAVE_POSIX_SIGNALS + sigfillset (setp); + sigemptyset (osetp); + sigprocmask (SIG_BLOCK, setp, osetp); +#else +# if defined (HAVE_BSD_SIGNALS) + *osetp = sigsetmask (-1); +# endif +#endif +} + +void +_malloc_unblock_signals (setp, osetp) + sigset_t *setp, *osetp; +{ +#ifdef HAVE_POSIX_SIGNALS + sigprocmask (SIG_SETMASK, osetp, (sigset_t *)NULL); +#else +# if defined (HAVE_BSD_SIGNALS) + sigsetmask (*osetp); +# endif +#endif +} + +/* Return some memory to the system by reducing the break. This is only + called with NU > pagebucket, so we're always assured of giving back + more than one page of memory. */ +static void +lesscore (nu) /* give system back some memory */ + register int nu; /* size index we're discarding */ +{ + long siz; + + siz = binsize (nu); + /* Should check for errors here, I guess. */ + sbrk (-siz); + memtop -= siz; + +#ifdef MALLOC_STATS + _mstats.nsbrk++; + _mstats.tsbrk -= siz; + _mstats.nlesscore[nu]++; +#endif +} + +/* Ask system for more memory; add to NEXTF[NU]. BUSY[NU] must be set to 1. */ +static void +morecore (nu) + register int nu; /* size index to get more of */ +{ + register union mhead *mp; + register int nblks; + register long siz; + long sbrk_amt; /* amount to get via sbrk() */ + sigset_t set, oset; + int blocked_sigs; + + /* Block all signals in case we are executed from a signal handler. */ + blocked_sigs = 0; +#ifdef SHELL +# if defined (SIGCHLD) + if (interrupt_immediately || running_trap || signal_is_trapped (SIGINT) || signal_is_trapped (SIGCHLD)) +# else + if (interrupt_immediately || running_trap || signal_is_trapped (SIGINT)) +# endif +#endif + { + _malloc_block_signals (&set, &oset); + blocked_sigs = 1; + } + + siz = binsize (nu); /* size of desired block for nextf[nu] */ + + if (siz < 0) + goto morecore_done; /* oops */ + +#ifdef MALLOC_STATS + _mstats.nmorecore[nu]++; +#endif + + /* Try to split a larger block here, if we're within the range of sizes + to split. */ + if (nu >= SPLIT_MIN) + { + bsplit (nu); + if (nextf[nu] != 0) + goto morecore_done; + } + + /* Try to coalesce two adjacent blocks from the free list on nextf[nu - 1], + if we can, and we're within the range of the block coalescing limits. */ + if (nu >= COMBINE_MIN && nu < COMBINE_MAX && busy[nu - 1] == 0 && nextf[nu - 1]) + { + bcoalesce (nu); + if (nextf[nu] != 0) + goto morecore_done; + } + + /* Take at least a page, and figure out how many blocks of the requested + size we're getting. */ + if (siz <= pagesz) + { + sbrk_amt = pagesz; + nblks = sbrk_amt / siz; + } + else + { + /* We always want to request an integral multiple of the page size + from the kernel, so let's compute whether or not `siz' is such + an amount. If it is, we can just request it. If not, we want + the smallest integral multiple of pagesize that is larger than + `siz' and will satisfy the request. */ + sbrk_amt = siz & (pagesz - 1); + if (sbrk_amt == 0) + sbrk_amt = siz; + else + sbrk_amt = siz + pagesz - sbrk_amt; + nblks = 1; + } + +#ifdef MALLOC_STATS + _mstats.nsbrk++; + _mstats.tsbrk += sbrk_amt; +#endif + + mp = (union mhead *) sbrk (sbrk_amt); + + /* Totally out of memory. */ + if ((long)mp == -1) + goto morecore_done; + + memtop += sbrk_amt; + + /* shouldn't happen, but just in case -- require 8-byte alignment */ + if ((long)mp & MALIGN_MASK) + { + mp = (union mhead *) (((long)mp + MALIGN_MASK) & ~MALIGN_MASK); + nblks--; + } + + /* save new header and link the nblks blocks together */ + nextf[nu] = mp; + while (1) + { + mp->mh_alloc = ISFREE; + mp->mh_index = nu; + if (--nblks <= 0) break; + CHAIN (mp) = (union mhead *)((char *)mp + siz); + mp = (union mhead *)((char *)mp + siz); + } + CHAIN (mp) = 0; + +morecore_done: + if (blocked_sigs) + _malloc_unblock_signals (&set, &oset); +} + +static void +malloc_debug_dummy () +{ + write (1, "malloc_debug_dummy\n", 19); +} + +#define PREPOP_BIN 2 +#define PREPOP_SIZE 32 + +static int +pagealign () +{ + register int nunits; + register union mhead *mp; + long sbrk_needed; + char *curbrk; + + pagesz = getpagesize (); + if (pagesz < 1024) + pagesz = 1024; + + /* OK, how much do we need to allocate to make things page-aligned? + Some of this partial page will be wasted space, but we'll use as + much as we can. Once we figure out how much to advance the break + pointer, go ahead and do it. */ + memtop = curbrk = sbrk (0); + sbrk_needed = pagesz - ((long)curbrk & (pagesz - 1)); /* sbrk(0) % pagesz */ + if (sbrk_needed < 0) + sbrk_needed += pagesz; + + /* Now allocate the wasted space. */ + if (sbrk_needed) + { +#ifdef MALLOC_STATS + _mstats.nsbrk++; + _mstats.tsbrk += sbrk_needed; +#endif + curbrk = sbrk (sbrk_needed); + if ((long)curbrk == -1) + return -1; + memtop += sbrk_needed; + + /* Take the memory which would otherwise be wasted and populate the most + popular bin (2 == 32 bytes) with it. Add whatever we need to curbrk + to make things 32-byte aligned, compute how many 32-byte chunks we're + going to get, and set up the bin. */ + curbrk += sbrk_needed & (PREPOP_SIZE - 1); + sbrk_needed -= sbrk_needed & (PREPOP_SIZE - 1); + nunits = sbrk_needed / PREPOP_SIZE; + + if (nunits > 0) + { + mp = (union mhead *)curbrk; + + nextf[PREPOP_BIN] = mp; + while (1) + { + mp->mh_alloc = ISFREE; + mp->mh_index = PREPOP_BIN; + if (--nunits <= 0) break; + CHAIN(mp) = (union mhead *)((char *)mp + PREPOP_SIZE); + mp = (union mhead *)((char *)mp + PREPOP_SIZE); + } + CHAIN(mp) = 0; + } + } + + /* compute which bin corresponds to the page size. */ + for (nunits = 7; nunits < NBUCKETS; nunits++) + if (pagesz <= binsize(nunits)) + break; + pagebucket = nunits; + + return 0; +} + +static PTR_T +internal_malloc (n, file, line, flags) /* get a block */ + size_t n; + const char *file; + int line, flags; +{ + register union mhead *p; + register int nunits; + register char *m, *z; + long nbytes; + mguard_t mg; + + /* Get the system page size and align break pointer so future sbrks will + be page-aligned. The page size must be at least 1K -- anything + smaller is increased. */ + if (pagesz == 0) + if (pagealign () < 0) + return ((PTR_T)NULL); + + /* Figure out how many bytes are required, rounding up to the nearest + multiple of 8, then figure out which nextf[] area to use. Try to + be smart about where to start searching -- if the number of bytes + needed is greater than the page size, we can start at pagebucket. */ + nbytes = ALLOCATED_BYTES(n); + nunits = (nbytes <= (pagesz >> 1)) ? STARTBUCK : pagebucket; + for ( ; nunits < NBUCKETS; nunits++) + if (nbytes <= binsize(nunits)) + break; + + /* Silently reject too-large requests. */ + if (nunits >= NBUCKETS) + return ((PTR_T) NULL); + + /* In case this is reentrant use of malloc from signal handler, + pick a block size that no other malloc level is currently + trying to allocate. That's the easiest harmless way not to + interfere with the other level of execution. */ +#ifdef MALLOC_STATS + if (busy[nunits]) _mstats.nrecurse++; +#endif + while (busy[nunits]) nunits++; + busy[nunits] = 1; + + if (nunits > maxbuck) + maxbuck = nunits; + + /* If there are no blocks of the appropriate size, go get some */ + if (nextf[nunits] == 0) + morecore (nunits); + + /* Get one block off the list, and set the new list head */ + if ((p = nextf[nunits]) == NULL) + { + busy[nunits] = 0; + return NULL; + } + nextf[nunits] = CHAIN (p); + busy[nunits] = 0; + + /* Check for free block clobbered */ + /* If not for this check, we would gobble a clobbered free chain ptr + and bomb out on the NEXT allocate of this size block */ + if (p->mh_alloc != ISFREE || p->mh_index != nunits) + xbotch ((PTR_T)(p+1), 0, _("malloc: block on free list clobbered"), file, line); + + /* Fill in the info, and set up the magic numbers for range checking. */ + p->mh_alloc = ISALLOC; + p->mh_magic2 = MAGIC2; + p->mh_nbytes = n; + + /* End guard */ + mg.i = n; + z = mg.s; + m = (char *) (p + 1) + n; + *m++ = *z++, *m++ = *z++, *m++ = *z++, *m++ = *z++; + +#ifdef MEMSCRAMBLE + if (n) + MALLOC_MEMSET ((char *)(p + 1), 0xdf, n); /* scramble previous contents */ +#endif +#ifdef MALLOC_STATS + _mstats.nmalloc[nunits]++; + _mstats.tmalloc[nunits]++; + _mstats.nmal++; + _mstats.bytesreq += n; +#endif /* MALLOC_STATS */ + +#ifdef MALLOC_TRACE + if (malloc_trace && (flags & MALLOC_NOTRACE) == 0) + mtrace_alloc ("malloc", p + 1, n, file, line); + else if (_malloc_trace_buckets[nunits]) + mtrace_alloc ("malloc", p + 1, n, file, line); +#endif + +#ifdef MALLOC_REGISTER + if (malloc_register && (flags & MALLOC_NOREG) == 0) + mregister_alloc ("malloc", p + 1, n, file, line); +#endif + +#ifdef MALLOC_WATCH + if (_malloc_nwatch > 0) + _malloc_ckwatch (p + 1, file, line, W_ALLOC, n); +#endif + + return (PTR_T) (p + 1); +} + +static void +internal_free (mem, file, line, flags) + PTR_T mem; + const char *file; + int line, flags; +{ + register union mhead *p; + register char *ap, *z; + register int nunits; + register unsigned int nbytes; + int ubytes; /* caller-requested size */ + mguard_t mg; + + if ((ap = (char *)mem) == 0) + return; + + p = (union mhead *) ap - 1; + + if (p->mh_alloc == ISMEMALIGN) + { + ap -= p->mh_nbytes; + p = (union mhead *) ap - 1; + } + +#if defined (MALLOC_TRACE) || defined (MALLOC_REGISTER) + if (malloc_trace || malloc_register) + ubytes = p->mh_nbytes; +#endif + + if (p->mh_alloc != ISALLOC) + { + if (p->mh_alloc == ISFREE) + xbotch (mem, ERR_DUPFREE, + _("free: called with already freed block argument"), file, line); + else + xbotch (mem, ERR_UNALLOC, + _("free: called with unallocated block argument"), file, line); + } + + ASSERT (p->mh_magic2 == MAGIC2); + + nunits = p->mh_index; + nbytes = ALLOCATED_BYTES(p->mh_nbytes); + /* Since the sizeof(u_bits32_t) bytes before the memory handed to the user + are now used for the number of bytes allocated, a simple check of + mh_magic2 is no longer sufficient to catch things like p[-1] = 'x'. + We sanity-check the value of mh_nbytes against the size of the blocks + in the appropriate bucket before we use it. This can still cause problems + and obscure errors if mh_nbytes is wrong but still within range; the + checks against the size recorded at the end of the chunk will probably + fail then. Using MALLOC_REGISTER will help here, since it saves the + original number of bytes requested. */ + + if (IN_BUCKET(nbytes, nunits) == 0) + xbotch (mem, ERR_UNDERFLOW, + _("free: underflow detected; mh_nbytes out of range"), file, line); + + ap += p->mh_nbytes; + z = mg.s; + *z++ = *ap++, *z++ = *ap++, *z++ = *ap++, *z++ = *ap++; + if (mg.i != p->mh_nbytes) + xbotch (mem, ERR_ASSERT_FAILED, _("free: start and end chunk sizes differ"), file, line); + +#if GLIBC21 + if (nunits >= LESSCORE_MIN && ((char *)p + binsize(nunits) == sbrk (0))) +#else + if (nunits >= LESSCORE_MIN && ((char *)p + binsize(nunits) == memtop)) +#endif + { + /* If above LESSCORE_FRC, give back unconditionally. This should be set + high enough to be infrequently encountered. If between LESSCORE_MIN + and LESSCORE_FRC, call lesscore if the bucket is marked as busy or if + there's already a block on the free list. */ + if ((nunits >= LESSCORE_FRC) || busy[nunits] || nextf[nunits] != 0) + { + lesscore (nunits); + /* keeps the tracing and registering code in one place */ + goto free_return; + } + } + +#ifdef MEMSCRAMBLE + if (p->mh_nbytes) + MALLOC_MEMSET (mem, 0xcf, p->mh_nbytes); +#endif + + ASSERT (nunits < NBUCKETS); + + if (busy[nunits] == 1) + { + xsplit (p, nunits); /* split block and add to different chain */ + goto free_return; + } + + p->mh_alloc = ISFREE; + /* Protect against signal handlers calling malloc. */ + busy[nunits] = 1; + /* Put this block on the free list. */ + CHAIN (p) = nextf[nunits]; + nextf[nunits] = p; + busy[nunits] = 0; + +free_return: + ; /* Empty statement in case this is the end of the function */ + +#ifdef MALLOC_STATS + _mstats.nmalloc[nunits]--; + _mstats.nfre++; +#endif /* MALLOC_STATS */ + +#ifdef MALLOC_TRACE + if (malloc_trace && (flags & MALLOC_NOTRACE) == 0) + mtrace_free (mem, ubytes, file, line); + else if (_malloc_trace_buckets[nunits]) + mtrace_free (mem, ubytes, file, line); +#endif + +#ifdef MALLOC_REGISTER + if (malloc_register && (flags & MALLOC_NOREG) == 0) + mregister_free (mem, ubytes, file, line); +#endif + +#ifdef MALLOC_WATCH + if (_malloc_nwatch > 0) + _malloc_ckwatch (mem, file, line, W_FREE, ubytes); +#endif +} + +static PTR_T +internal_realloc (mem, n, file, line, flags) + PTR_T mem; + register size_t n; + const char *file; + int line, flags; +{ + register union mhead *p; + register u_bits32_t tocopy; + register unsigned int nbytes; + register int nunits; + register char *m, *z; + mguard_t mg; + +#ifdef MALLOC_STATS + _mstats.nrealloc++; +#endif + + if (n == 0) + { + internal_free (mem, file, line, MALLOC_INTERNAL); + return (NULL); + } + if ((p = (union mhead *) mem) == 0) + return internal_malloc (n, file, line, MALLOC_INTERNAL); + + p--; + nunits = p->mh_index; + ASSERT (nunits < NBUCKETS); + + if (p->mh_alloc != ISALLOC) + xbotch (mem, ERR_UNALLOC, + _("realloc: called with unallocated block argument"), file, line); + + ASSERT (p->mh_magic2 == MAGIC2); + nbytes = ALLOCATED_BYTES(p->mh_nbytes); + /* Since the sizeof(u_bits32_t) bytes before the memory handed to the user + are now used for the number of bytes allocated, a simple check of + mh_magic2 is no longer sufficient to catch things like p[-1] = 'x'. + We sanity-check the value of mh_nbytes against the size of the blocks + in the appropriate bucket before we use it. This can still cause problems + and obscure errors if mh_nbytes is wrong but still within range; the + checks against the size recorded at the end of the chunk will probably + fail then. Using MALLOC_REGISTER will help here, since it saves the + original number of bytes requested. */ + if (IN_BUCKET(nbytes, nunits) == 0) + xbotch (mem, ERR_UNDERFLOW, + _("realloc: underflow detected; mh_nbytes out of range"), file, line); + + m = (char *)mem + (tocopy = p->mh_nbytes); + z = mg.s; + *z++ = *m++, *z++ = *m++, *z++ = *m++, *z++ = *m++; + if (mg.i != p->mh_nbytes) + xbotch (mem, ERR_ASSERT_FAILED, _("realloc: start and end chunk sizes differ"), file, line); + +#ifdef MALLOC_WATCH + if (_malloc_nwatch > 0) + _malloc_ckwatch (p + 1, file, line, W_REALLOC, n); +#endif +#ifdef MALLOC_STATS + _mstats.bytesreq += (n < tocopy) ? 0 : n - tocopy; +#endif + + /* See if desired size rounds to same power of 2 as actual size. */ + nbytes = ALLOCATED_BYTES(n); + + /* If ok, use the same block, just marking its size as changed. */ + if (RIGHT_BUCKET(nbytes, nunits)) + { +#if 0 + m = (char *)mem + p->mh_nbytes; +#else + /* Compensate for increment above. */ + m -= 4; +#endif + *m++ = 0; *m++ = 0; *m++ = 0; *m++ = 0; + m = (char *)mem + (p->mh_nbytes = n); + + mg.i = n; + z = mg.s; + *m++ = *z++, *m++ = *z++, *m++ = *z++, *m++ = *z++; + + return mem; + } + + if (n < tocopy) + tocopy = n; + +#ifdef MALLOC_STATS + _mstats.nrcopy++; +#endif + + if ((m = internal_malloc (n, file, line, MALLOC_INTERNAL|MALLOC_NOTRACE|MALLOC_NOREG)) == 0) + return 0; + FASTCOPY (mem, m, tocopy); + internal_free (mem, file, line, MALLOC_INTERNAL); + +#ifdef MALLOC_TRACE + if (malloc_trace && (flags & MALLOC_NOTRACE) == 0) + mtrace_alloc ("realloc", m, n, file, line); + else if (_malloc_trace_buckets[nunits]) + mtrace_alloc ("realloc", m, n, file, line); +#endif + +#ifdef MALLOC_REGISTER + if (malloc_register && (flags & MALLOC_NOREG) == 0) + mregister_alloc ("realloc", m, n, file, line); +#endif + +#ifdef MALLOC_WATCH + if (_malloc_nwatch > 0) + _malloc_ckwatch (m, file, line, W_RESIZED, n); +#endif + + return m; +} + +static PTR_T +internal_memalign (alignment, size, file, line, flags) + size_t alignment; + size_t size; + const char *file; + int line, flags; +{ + register char *ptr; + register char *aligned; + register union mhead *p; + + ptr = internal_malloc (size + alignment, file, line, MALLOC_INTERNAL); + + if (ptr == 0) + return 0; + /* If entire block has the desired alignment, just accept it. */ + if (((long) ptr & (alignment - 1)) == 0) + return ptr; + /* Otherwise, get address of byte in the block that has that alignment. */ +#if 0 + aligned = (char *) (((long) ptr + alignment - 1) & -alignment); +#else + aligned = (char *) (((long) ptr + alignment - 1) & (~alignment + 1)); +#endif + + /* Store a suitable indication of how to free the block, + so that free can find the true beginning of it. */ + p = (union mhead *) aligned - 1; + p->mh_nbytes = aligned - ptr; + p->mh_alloc = ISMEMALIGN; + + return aligned; +} + +#if !defined (NO_VALLOC) +/* This runs into trouble with getpagesize on HPUX, and Multimax machines. + Patching out seems cleaner than the ugly fix needed. */ +static PTR_T +internal_valloc (size, file, line, flags) + size_t size; + const char *file; + int line, flags; +{ + return internal_memalign (getpagesize (), size, file, line, flags|MALLOC_INTERNAL); +} +#endif /* !NO_VALLOC */ + +#ifndef NO_CALLOC +static PTR_T +internal_calloc (n, s, file, line, flags) + size_t n, s; + const char *file; + int line, flags; +{ + size_t total; + PTR_T result; + + total = n * s; + result = internal_malloc (total, file, line, flags|MALLOC_INTERNAL); + if (result) + memset (result, 0, total); + return result; +} + +static void +internal_cfree (p, file, line, flags) + PTR_T p; + const char *file; + int line, flags; +{ + internal_free (p, file, line, flags|MALLOC_INTERNAL); +} +#endif /* !NO_CALLOC */ + +#ifdef MALLOC_STATS +int +malloc_free_blocks (size) + int size; +{ + int nfree; + register union mhead *p; + + nfree = 0; + for (p = nextf[size]; p; p = CHAIN (p)) + nfree++; + + return nfree; +} +#endif + +#if defined (MALLOC_WRAPFUNCS) +PTR_T +sh_malloc (bytes, file, line) + size_t bytes; + const char *file; + int line; +{ + return internal_malloc (bytes, file, line, MALLOC_WRAPPER); +} + +PTR_T +sh_realloc (ptr, size, file, line) + PTR_T ptr; + size_t size; + const char *file; + int line; +{ + return internal_realloc (ptr, size, file, line, MALLOC_WRAPPER); +} + +void +sh_free (mem, file, line) + PTR_T mem; + const char *file; + int line; +{ + internal_free (mem, file, line, MALLOC_WRAPPER); +} + +PTR_T +sh_memalign (alignment, size, file, line) + size_t alignment; + size_t size; + const char *file; + int line; +{ + return internal_memalign (alignment, size, file, line, MALLOC_WRAPPER); +} + +#ifndef NO_CALLOC +PTR_T +sh_calloc (n, s, file, line) + size_t n, s; + const char *file; + int line; +{ + return internal_calloc (n, s, file, line, MALLOC_WRAPPER); +} + +void +sh_cfree (mem, file, line) + PTR_T mem; + const char *file; + int line; +{ + internal_cfree (mem, file, line, MALLOC_WRAPPER); +} +#endif + +#ifndef NO_VALLOC +PTR_T +sh_valloc (size, file, line) + size_t size; + const char *file; + int line; +{ + return internal_valloc (size, file, line, MALLOC_WRAPPER); +} +#endif /* !NO_VALLOC */ + +#endif /* MALLOC_WRAPFUNCS */ + +/* Externally-available functions that call their internal counterparts. */ + +PTR_T +malloc (size) + size_t size; +{ + return internal_malloc (size, (char *)NULL, 0, 0); +} + +PTR_T +realloc (mem, nbytes) + PTR_T mem; + size_t nbytes; +{ + return internal_realloc (mem, nbytes, (char *)NULL, 0, 0); +} + +void +free (mem) + PTR_T mem; +{ + internal_free (mem, (char *)NULL, 0, 0); +} + +PTR_T +memalign (alignment, size) + size_t alignment; + size_t size; +{ + return internal_memalign (alignment, size, (char *)NULL, 0, 0); +} + +#ifndef NO_VALLOC +PTR_T +valloc (size) + size_t size; +{ + return internal_valloc (size, (char *)NULL, 0, 0); +} +#endif + +#ifndef NO_CALLOC +PTR_T +calloc (n, s) + size_t n, s; +{ + return internal_calloc (n, s, (char *)NULL, 0, 0); +} + +void +cfree (mem) + PTR_T mem; +{ + internal_cfree (mem, (char *)NULL, 0, 0); +} +#endif diff --git a/lib/malloc/mstats.h b/lib/malloc/mstats.h new file mode 100644 index 0000000..11389ff --- /dev/null +++ b/lib/malloc/mstats.h @@ -0,0 +1,110 @@ +/* mstats.h - definitions for malloc statistics */ + +/* Copyright (C) 2001-2003 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne-Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _MSTATS_H +#define _MSTATS_H + +#include "imalloc.h" + +#ifdef MALLOC_STATS + +#ifndef NBUCKETS +# define NBUCKETS 30 +#endif + +/* + * NMALLOC[i] is the difference between the number of mallocs and frees + * for a given block size. TMALLOC[i] is the total number of mallocs for + * a given block size. NMORECORE[i] is the total number of calls to + * morecore(i). NLESSCORE[i] is the total number of calls to lesscore(i). + * + * NMAL and NFRE are counts of the number of calls to malloc() and free(), + * respectively. NREALLOC is the total number of calls to realloc(); + * NRCOPY is the number of times realloc() had to allocate new memory and + * copy to it. NRECURSE is a count of the number of recursive calls to + * malloc() for the same bucket size, which can be caused by calls to + * malloc() from a signal handler. + * + * NSBRK is the number of calls to sbrk() (whether by morecore() or for + * alignment); TSBRK is the total number of bytes requested from the kernel + * with sbrk(). + * + * BYTESUSED is the total number of bytes consumed by blocks currently in + * use; BYTESFREE is the total number of bytes currently on all of the free + * lists. BYTESREQ is the total number of bytes requested by the caller + * via calls to malloc() and realloc(). + * + * TBSPLIT is the number of times a larger block was split to satisfy a + * smaller request. NSPLIT[i] is the number of times a block of size I was + * split. + * + * TBCOALESCE is the number of times two adjacent smaller blocks off the free + * list were combined to satisfy a larger request. + */ +struct _malstats { + int nmalloc[NBUCKETS]; + int tmalloc[NBUCKETS]; + int nmorecore[NBUCKETS]; + int nlesscore[NBUCKETS]; + int nmal; + int nfre; + int nrealloc; + int nrcopy; + int nrecurse; + int nsbrk; + bits32_t tsbrk; + bits32_t bytesused; + bits32_t bytesfree; + u_bits32_t bytesreq; + int tbsplit; + int nsplit[NBUCKETS]; + int tbcoalesce; + int ncoalesce[NBUCKETS]; +}; + +/* Return statistics describing allocation of blocks of size BLOCKSIZE. + NFREE is the number of free blocks for this allocation size. NUSED + is the number of blocks in use. NMAL is the number of requests for + blocks of size BLOCKSIZE. NMORECORE is the number of times we had + to call MORECORE to repopulate the free list for this bucket. + NLESSCORE is the number of times we gave memory back to the system + from this bucket. NSPLIT is the number of times a block of this size + was split to satisfy a smaller request. NCOALESCE is the number of + times two blocks of this size were combined to satisfy a larger + request. */ +struct bucket_stats { + u_bits32_t blocksize; + int nfree; + int nused; + int nmal; + int nmorecore; + int nlesscore; + int nsplit; + int ncoalesce; +}; + +extern struct bucket_stats malloc_bucket_stats __P((int)); +extern struct _malstats malloc_stats __P((void)); +extern void print_malloc_stats __P((char *)); +extern void trace_malloc_stats __P((char *, char *)); + +#endif /* MALLOC_STATS */ + +#endif /* _MSTATS_H */ diff --git a/lib/malloc/shmalloc.h b/lib/malloc/shmalloc.h new file mode 100644 index 0000000..2dac615 --- /dev/null +++ b/lib/malloc/shmalloc.h @@ -0,0 +1,70 @@ +/* Functions (currently) for use by the shell to do malloc debugging and + tracking. */ +/* Copyright (C) 2001-2003 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne-Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _SH_MALLOC_H +#define _SH_MALLOC_H + +#ifndef __P +# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus) +# define __P(protos) protos +# else +# define __P(protos) () +# endif +#endif + +/* Generic pointer type. */ +#ifndef PTR_T + +#if defined (__STDC__) +# define PTR_T void * +#else +# define PTR_T char * +#endif + +#endif /* PTR_T */ + + +extern PTR_T sh_malloc __P((size_t, const char *, int)); +extern PTR_T sh_realloc __P((PTR_T, size_t, const char *, int)); +extern void sh_free __P((PTR_T, const char *, int)); + +extern PTR_T sh_memalign __P((size_t, size_t, const char *, int)); + +extern PTR_T sh_calloc __P((size_t, size_t, const char *, int)); +extern void sh_cfree __P((PTR_T, const char *, int)); + +extern PTR_T sh_valloc __P((size_t, const char *, int)); + +/* trace.c */ +extern int malloc_set_trace __P((int)); +extern void malloc_set_tracefp (); /* full prototype requires stdio.h */ +extern void malloc_set_tracefn __P((char *, char *)); + +/* table.c */ +extern void mregister_dump_table __P((void)); +extern void mregister_table_init __P((void)); +extern int malloc_set_register __P((int)); + +/* stats.c */ +extern void print_malloc_stats __P((char *)); +extern void fprint_malloc_stats (); /* full prototype requires stdio.h */ +extern void trace_malloc_stats __P((char *, char *)); + +#endif diff --git a/lib/malloc/stats.c b/lib/malloc/stats.c new file mode 100644 index 0000000..8665918 --- /dev/null +++ b/lib/malloc/stats.c @@ -0,0 +1,205 @@ +/* stats.c - malloc statistics */ + +/* Copyright (C) 2001-2003 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne-Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "imalloc.h" + +#ifdef MALLOC_STATS + +#include +#ifdef HAVE_UNISTD_H +# include +#endif +#include + +#include "mstats.h" + +extern int malloc_free_blocks __P((int)); + +extern struct _malstats _mstats; + +extern FILE *_imalloc_fopen __P((char *, char *, char *, char *, size_t)); + +struct bucket_stats +malloc_bucket_stats (size) + int size; +{ + struct bucket_stats v; + + v.nfree = 0; + + if (size < 0 || size >= NBUCKETS) + { + v.blocksize = 0; + v.nused = v.nmal = v.nmorecore = v.nlesscore = v.nsplit = 0; + return v; + } + + v.blocksize = 1 << (size + 3); + v.nused = _mstats.nmalloc[size]; + v.nmal = _mstats.tmalloc[size]; + v.nmorecore = _mstats.nmorecore[size]; + v.nlesscore = _mstats.nlesscore[size]; + v.nsplit = _mstats.nsplit[size]; + v.ncoalesce = _mstats.ncoalesce[size]; + + v.nfree = malloc_free_blocks (size); /* call back to malloc.c */ + + return v; +} + +/* Return a copy of _MSTATS, with two additional fields filled in: + BYTESFREE is the total number of bytes on free lists. BYTESUSED + is the total number of bytes in use. These two fields are fairly + expensive to compute, so we do it only when asked to. */ +struct _malstats +malloc_stats () +{ + struct _malstats result; + struct bucket_stats v; + register int i; + + result = _mstats; + result.bytesused = result.bytesfree = 0; + for (i = 0; i < NBUCKETS; i++) + { + v = malloc_bucket_stats (i); + result.bytesfree += v.nfree * v.blocksize; + result.bytesused += v.nused * v.blocksize; + } + return (result); +} + +static void +_print_malloc_stats (s, fp) + char *s; + FILE *fp; +{ + register int i; + unsigned long totused, totfree; + struct bucket_stats v; + + fprintf (fp, "Memory allocation statistics: %s\n size\tfree\tin use\ttotal\tmorecore lesscore split\tcoalesce\n", s ? s : ""); + for (i = totused = totfree = 0; i < NBUCKETS; i++) + { + v = malloc_bucket_stats (i); + if (v.nmal > 0) + fprintf (fp, "%8lu\t%4d\t%6d\t%5d\t%8d\t%d %5d %8d\n", (unsigned long)v.blocksize, v.nfree, v.nused, v.nmal, v.nmorecore, v.nlesscore, v.nsplit, v.ncoalesce); + totfree += v.nfree * v.blocksize; + totused += v.nused * v.blocksize; + } + fprintf (fp, "\nTotal bytes in use: %lu, total bytes free: %lu\n", + totused, totfree); + fprintf (fp, "\nTotal bytes requested by application: %lu\n", _mstats.bytesreq); + fprintf (fp, "Total mallocs: %d, total frees: %d, total reallocs: %d (%d copies)\n", + _mstats.nmal, _mstats.nfre, _mstats.nrealloc, _mstats.nrcopy); + fprintf (fp, "Total sbrks: %d, total bytes via sbrk: %d\n", + _mstats.nsbrk, _mstats.tsbrk); + fprintf (fp, "Total blocks split: %d, total block coalesces: %d\n", + _mstats.tbsplit, _mstats.tbcoalesce); +} + +void +print_malloc_stats (s) + char *s; +{ + _print_malloc_stats (s, stderr); +} + +void +fprint_malloc_stats (s, fp) + char *s; + FILE *fp; +{ + _print_malloc_stats (s, fp); +} + +#define TRACEROOT "/var/tmp/maltrace/stats." + +void +trace_malloc_stats (s, fn) + char *s, *fn; +{ + FILE *fp; + char defname[sizeof (TRACEROOT) + 64]; + static char mallbuf[1024]; + + fp = _imalloc_fopen (s, fn, TRACEROOT, defname, sizeof (defname)); + if (fp) + { + setvbuf (fp, mallbuf, _IOFBF, sizeof (mallbuf)); + _print_malloc_stats (s, fp); + fflush(fp); + fclose(fp); + } +} + +#endif /* MALLOC_STATS */ + +#if defined (MALLOC_STATS) || defined (MALLOC_TRACE) +FILE * +_imalloc_fopen (s, fn, def, defbuf, defsiz) + char *s; + char *fn; + char *def; + char *defbuf; + size_t defsiz; +{ + char fname[1024]; + long l; + FILE *fp; + + l = (long)getpid (); + if (fn == 0) + { + sprintf (defbuf, "%s%ld", def, l); + fp = fopen(defbuf, "w"); + } + else + { + char *p, *q, *r; + char pidbuf[32]; + int sp; + + sprintf (pidbuf, "%ld", l); + if ((strlen (pidbuf) + strlen (fn) + 2) >= sizeof (fname)) + return ((FILE *)0); + for (sp = 0, p = fname, q = fn; *q; ) + { + if (sp == 0 && *q == '%' && q[1] == 'p') + { + sp = 1; + for (r = pidbuf; *r; ) + *p++ = *r++; + q += 2; + } + else + *p++ = *q++; + } + *p = '\0'; + fp = fopen (fname, "w"); + } + + return fp; +} +#endif /* MALLOC_STATS || MALLOC_TRACE */ diff --git a/lib/malloc/stub.c b/lib/malloc/stub.c new file mode 100644 index 0000000..a60a624 --- /dev/null +++ b/lib/malloc/stub.c @@ -0,0 +1,22 @@ +/* Copyright (C) 1993-2003 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +void +bash_malloc_stub() +{ +} diff --git a/lib/malloc/table.c b/lib/malloc/table.c new file mode 100644 index 0000000..dfa29e2 --- /dev/null +++ b/lib/malloc/table.c @@ -0,0 +1,331 @@ +/* table.c - bookkeeping functions for allocated memory */ + +/* Copyright (C) 2001-2003 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +#include "imalloc.h" +#include "table.h" + +#ifdef SHELL +extern int interrupt_immediately, running_trap; +extern int signal_is_trapped __P((int)); +#endif + +extern int malloc_register; + +#ifdef MALLOC_REGISTER + +#define FIND_ALLOC 0x01 /* allocate new entry or find existing */ +#define FIND_EXIST 0x02 /* find existing entry */ + +static int table_count = 0; +static int table_allocated = 0; +static mr_table_t mem_table[REG_TABLE_SIZE]; +static mr_table_t mem_overflow; + +/* + * NOTE: taken from dmalloc (http://dmalloc.com) and modified. + */ +static unsigned int +mt_hash (key) + const PTR_T key; +{ + unsigned int a, b, c; + unsigned long x; + + /* set up the internal state */ + a = 0x9e3779b9; /* the golden ratio; an arbitrary value */ + x = (unsigned long)key; /* truncation is OK */ + b = x >> 8; + c = x >> 3; /* XXX - was >> 4 */ + + HASH_MIX(a, b, c); + return c; +} + +#if 0 +static unsigned int +which_bucket (mem) + PTR_T mem; +{ + return (mt_hash ((unsigned char *)mem) & (REG_TABLE_SIZE-1)); +} +#else +#define which_bucket(mem) (mt_hash ((unsigned char *)(mem)) & (REG_TABLE_SIZE-1)); +#endif + +static mr_table_t * +find_entry (mem, flags) + PTR_T mem; + int flags; +{ + unsigned int bucket; + register mr_table_t *tp; + mr_table_t *endp, *lastp; + + if (mem_overflow.mem == mem) + return (&mem_overflow); + + bucket = which_bucket (mem); /* get initial hash */ + tp = endp = mem_table + bucket; + lastp = mem_table + REG_TABLE_SIZE; + + while (1) + { + if (tp->mem == mem) + return (tp); + if (tp->mem == 0 && (flags & FIND_ALLOC)) + { + table_count++; + return (tp); + } + + tp++; + + if (tp == lastp) /* wrap around */ + tp = mem_table; + + if (tp == endp && (flags & FIND_EXIST)) + return ((mr_table_t *)NULL); + + if (tp == endp && (flags & FIND_ALLOC)) + break; + } + + /* oops. table is full. replace an existing free entry. */ + do + { + /* If there are no free entries, punt right away without searching. */ + if (table_allocated == REG_TABLE_SIZE) + break; + + if (tp->flags & MT_FREE) + { + memset(tp, 0, sizeof (mr_table_t)); + return (tp); + } + tp++; + + if (tp == lastp) + tp = mem_table; + } + while (tp != endp); + + /* wow. entirely full. return mem_overflow dummy entry. */ + tp = &mem_overflow; + memset (tp, 0, sizeof (mr_table_t)); + return tp; +} + +mr_table_t * +mr_table_entry (mem) + PTR_T mem; +{ + return (find_entry (mem, FIND_EXIST)); +} + +void +mregister_describe_mem (mem, fp) + PTR_T mem; + FILE *fp; +{ + mr_table_t *entry; + + entry = find_entry (mem, FIND_EXIST); + if (entry == 0) + return; + fprintf (fp, "malloc: %p: %s: last %s from %s:%d\n", + mem, + (entry->flags & MT_ALLOC) ? "allocated" : "free", + (entry->flags & MT_ALLOC) ? "allocated" : "freed", + entry->file ? entry->file : "unknown", + entry->line); +} + +void +mregister_alloc (tag, mem, size, file, line) + const char *tag; + PTR_T mem; + size_t size; + const char *file; + int line; +{ + mr_table_t *tentry; + sigset_t set, oset; + int blocked_sigs; + + /* Block all signals in case we are executed from a signal handler. */ + blocked_sigs = 0; +#ifdef SHELL + if (interrupt_immediately || running_trap || signal_is_trapped (SIGINT) || signal_is_trapped (SIGCHLD)) +#endif + { + _malloc_block_signals (&set, &oset); + blocked_sigs = 1; + } + + tentry = find_entry (mem, FIND_ALLOC); + + if (tentry == 0) + { + /* oops. table is full. punt. */ + fprintf (stderr, _("register_alloc: alloc table is full with FIND_ALLOC?\n")); + if (blocked_sigs) + _malloc_unblock_signals (&set, &oset); + return; + } + + if (tentry->flags & MT_ALLOC) + { + /* oops. bad bookkeeping. ignore for now */ + fprintf (stderr, _("register_alloc: %p already in table as allocated?\n"), mem); + } + + tentry->mem = mem; + tentry->size = size; + tentry->func = tag; + tentry->flags = MT_ALLOC; + tentry->file = file; + tentry->line = line; + tentry->nalloc++; + + if (tentry != &mem_overflow) + table_allocated++; + + if (blocked_sigs) + _malloc_unblock_signals (&set, &oset); +} + +void +mregister_free (mem, size, file, line) + PTR_T mem; + int size; + const char *file; + int line; +{ + mr_table_t *tentry; + sigset_t set, oset; + int blocked_sigs; + + /* Block all signals in case we are executed from a signal handler. */ + blocked_sigs = 0; +#ifdef SHELL + if (interrupt_immediately || running_trap || signal_is_trapped (SIGINT) || signal_is_trapped (SIGCHLD)) +#endif + { + _malloc_block_signals (&set, &oset); + blocked_sigs = 1; + } + + tentry = find_entry (mem, FIND_EXIST); + if (tentry == 0) + { + /* oops. not found. */ +#if 0 + fprintf (stderr, "register_free: %p not in allocation table?\n", mem); +#endif + if (blocked_sigs) + _malloc_unblock_signals (&set, &oset); + return; + } + if (tentry->flags & MT_FREE) + { + /* oops. bad bookkeeping. ignore for now */ + fprintf (stderr, _("register_free: %p already in table as free?\n"), mem); + } + + tentry->flags = MT_FREE; + tentry->func = "free"; + tentry->file = file; + tentry->line = line; + tentry->nfree++; + + if (tentry != &mem_overflow) + table_allocated--; + + if (blocked_sigs) + _malloc_unblock_signals (&set, &oset); +} + +/* If we ever add more flags, this will require changes. */ +static char * +_entry_flags(x) + int x; +{ + if (x & MT_FREE) + return "free"; + else if (x & MT_ALLOC) + return "allocated"; + else + return "undetermined?"; +} + +static void +_register_dump_table(fp) + FILE *fp; +{ + register int i; + mr_table_t entry; + + for (i = 0; i < REG_TABLE_SIZE; i++) + { + entry = mem_table[i]; + if (entry.mem) + fprintf (fp, "[%d] %p:%d:%s:%s:%s:%d:%d:%d\n", i, + entry.mem, entry.size, + _entry_flags(entry.flags), + entry.func ? entry.func : "unknown", + entry.file ? entry.file : "unknown", + entry.line, + entry.nalloc, entry.nfree); + } +} + +void +mregister_dump_table() +{ + _register_dump_table (stderr); +} + +void +mregister_table_init () +{ + memset (mem_table, 0, sizeof(mr_table_t) * REG_TABLE_SIZE); + memset (&mem_overflow, 0, sizeof (mr_table_t)); + table_count = 0; +} + +#endif /* MALLOC_REGISTER */ + +int +malloc_set_register(n) + int n; +{ + int old; + + old = malloc_register; + malloc_register = n; + return old; +} diff --git a/lib/malloc/table.h b/lib/malloc/table.h new file mode 100644 index 0000000..41ce9f7 --- /dev/null +++ b/lib/malloc/table.h @@ -0,0 +1,105 @@ +/* table.h - definitions for tables for keeping track of allocated memory */ + +/* Copyright (C) 2001-2003 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne-Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _MTABLE_H +#define _MTABLE_H + +#include "imalloc.h" + +#ifdef MALLOC_REGISTER + +/* values for flags byte. */ +#define MT_ALLOC 0x01 +#define MT_FREE 0x02 + +/* + * Memory table entry. + * + * MEM is the address of the allocated pointer. + * SIZE is the requested allocation size. + * FLAGS includes either MT_ALLOC (MEM is allocated) or MT_FREE (MEM is + * not allocated). Other flags later. + * FUNC is set to the name of the function doing the allocation (from the + * `tag' argument to register_alloc(). + * FILE and LINE are the filename and line number of the last allocation + * and free (depending on STATUS) of MEM. + * NALLOC and NFREE are incremented on each allocation that returns MEM or + * each free of MEM, respectively (way to keep track of memory reuse + * and how well the free lists are working). + * + */ +typedef struct mr_table { + PTR_T mem; + size_t size; + char flags; + const char *func; + const char *file; + int line; + int nalloc, nfree; +} mr_table_t; + +#define REG_TABLE_SIZE 8192 + +extern mr_table_t *mr_table_entry __P((PTR_T)); +extern void mregister_alloc __P((const char *, PTR_T, size_t, const char *, int)); +extern void mregister_free __P((PTR_T, int, const char *, int)); +extern void mregister_describe_mem (); +extern void mregister_dump_table __P((void)); +extern void mregister_table_init __P((void)); + +/* NOTE: HASH_MIX taken from dmalloc (http://dmalloc.com) */ + +/* + * void HASH_MIX + * + * DESCRIPTION: + * + * Mix 3 32-bit values reversibly. For every delta with one or two + * bits set, and the deltas of all three high bits or all three low + * bits, whether the original value of a,b,c is almost all zero or is + * uniformly distributed. + * + * If HASH_MIX() is run forward or backward, at least 32 bits in a,b,c + * have at least 1/4 probability of changing. If mix() is run + * forward, every bit of c will change between 1/3 and 2/3 of the + * time. (Well, 22/100 and 78/100 for some 2-bit deltas.) + * + * HASH_MIX() takes 36 machine instructions, but only 18 cycles on a + * superscalar machine (like a Pentium or a Sparc). No faster mixer + * seems to work, that's the result of my brute-force search. There + * were about 2^68 hashes to choose from. I only tested about a + * billion of those. + */ +#define HASH_MIX(a, b, c) \ + do { \ + a -= b; a -= c; a ^= (c >> 13); \ + b -= c; b -= a; b ^= (a << 8); \ + c -= a; c -= b; c ^= (b >> 13); \ + a -= b; a -= c; a ^= (c >> 12); \ + b -= c; b -= a; b ^= (a << 16); \ + c -= a; c -= b; c ^= (b >> 5); \ + a -= b; a -= c; a ^= (c >> 3); \ + b -= c; b -= a; b ^= (a << 10); \ + c -= a; c -= b; c ^= (b >> 15); \ + } while(0) + +#endif /* MALLOC_REGISTER */ + +#endif /* _MTABLE_H */ diff --git a/lib/malloc/trace.c b/lib/malloc/trace.c new file mode 100644 index 0000000..6d93f99 --- /dev/null +++ b/lib/malloc/trace.c @@ -0,0 +1,126 @@ +/* trace.c - tracing functions for malloc */ + +/* Copyright (C) 2001-2003 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#ifdef HAVE_UNISTD_H +# include +#endif + +#include "imalloc.h" + +extern int malloc_trace; + +static int _mtrace_verbose = 0; + +#ifdef MALLOC_TRACE + +extern FILE *_imalloc_fopen __P((char *, char *, char *, char *, size_t)); + +FILE *_mtrace_fp = NULL; +extern char _malloc_trace_buckets[]; + +void +mtrace_alloc (tag, mem, size, file, line) + const char *tag; + PTR_T mem; + size_t size; + const char *file; + int line; +{ + if (_mtrace_fp == NULL) + _mtrace_fp = stderr; + + if (_mtrace_verbose) + fprintf (_mtrace_fp, "alloc: %s: %p (%d bytes) from '%s:%d'\n", + tag, mem, size, file ? file : "unknown", line); + else + fprintf (_mtrace_fp, "alloc:%p:%d:%s:%d\n", + mem, size, file ? file : "unknown", line); +} + +void +mtrace_free (mem, size, file, line) + PTR_T mem; + int size; + const char *file; + int line; +{ + if (_mtrace_fp == NULL) + _mtrace_fp = stderr; + + if (_mtrace_verbose) + fprintf (_mtrace_fp, "free: %p (%d bytes) from '%s:%d'\n", + mem, size, file ? file : "unknown", line); + else + fprintf (_mtrace_fp, "free:%p:%d:%s:%d\n", + mem, size, file ? file : "unknown", line); +} +#endif /* MALLOC_TRACE */ + +int +malloc_set_trace (n) + int n; +{ + int old; + + old = malloc_trace; + malloc_trace = n; + _mtrace_verbose = (n > 1); + return old; +} + +void +malloc_set_tracefp (fp) + FILE *fp; +{ +#ifdef MALLOC_TRACE + _mtrace_fp = fp ? fp : stderr; +#endif +} + +void +malloc_trace_bin (n) + int n; +{ +#ifdef MALLOC_TRACE + _malloc_trace_buckets[n] = 1; +#endif +} + +#define TRACEROOT "/var/tmp/maltrace/trace." + +void +malloc_set_tracefn (s, fn) + char *s; + char *fn; +{ +#ifdef MALLOC_TRACE + FILE *fp; + char defname[sizeof (TRACEROOT) + 64]; + + fp = _imalloc_fopen (s, fn, TRACEROOT, defname, sizeof (defname)); + if (fp) + malloc_set_tracefp (fp); +#endif +} diff --git a/lib/malloc/watch.c b/lib/malloc/watch.c new file mode 100644 index 0000000..00c8a82 --- /dev/null +++ b/lib/malloc/watch.c @@ -0,0 +1,151 @@ +/* watch.c - watchpoint functions for malloc */ + +/* Copyright (C) 2001-2003 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#include "imalloc.h" + +#ifdef MALLOC_WATCH +#include "watch.h" + +#define WATCH_MAX 32 + +int _malloc_nwatch; +static PTR_T _malloc_watch_list[WATCH_MAX]; + +static void +watch_warn (addr, file, line, type, data) + PTR_T addr; + const char *file; + int line, type; + unsigned long data; +{ + char *tag; + + if (type == W_ALLOC) + tag = "allocated"; + else if (type == W_FREE) + tag = "freed"; + else if (type == W_REALLOC) + tag = "requesting resize"; + else if (type == W_RESIZED) + tag = "just resized"; + else + tag = "bug: unknown operation"; + + fprintf (stderr, "malloc: watch alert: %p %s ", addr, tag); + if (data != (unsigned long)-1) + fprintf (stderr, "(size %lu) ", data); + fprintf (stderr, "from '%s:%d'\n", file ? file : "unknown", line); +} + +void +_malloc_ckwatch (addr, file, line, type, data) + PTR_T addr; + const char *file; + int line, type; + unsigned long data; +{ + register int i; + + for (i = _malloc_nwatch - 1; i >= 0; i--) + { + if (_malloc_watch_list[i] == addr) + { + watch_warn (addr, file, line, type, data); + return; + } + } +} +#endif /* MALLOC_WATCH */ + +PTR_T +malloc_watch (addr) + PTR_T addr; +{ + register int i; + PTR_T ret; + + if (addr == 0) + return addr; + ret = (PTR_T)0; + +#ifdef MALLOC_WATCH + for (i = _malloc_nwatch - 1; i >= 0; i--) + { + if (_malloc_watch_list[i] == addr) + break; + } + if (i < 0) + { + if (_malloc_nwatch == WATCH_MAX) /* full, take out first */ + { + ret = _malloc_watch_list[0]; + _malloc_nwatch--; + for (i = 0; i < _malloc_nwatch; i++) + _malloc_watch_list[i] = _malloc_watch_list[i+1]; + } + _malloc_watch_list[_malloc_nwatch++] = addr; + } +#endif + + return ret; +} + +/* Remove a watchpoint set on ADDR. If ADDR is NULL, remove all + watchpoints. Returns ADDR if everything went OK, NULL if ADDR was + not being watched. */ +PTR_T +malloc_unwatch (addr) + PTR_T addr; +{ +#ifdef MALLOC_WATCH + register int i; + + if (addr == 0) + { + for (i = 0; i < _malloc_nwatch; i++) + _malloc_watch_list[i] = (PTR_T)0; + _malloc_nwatch = 0; + return ((PTR_T)0); + } + else + { + for (i = 0; i < _malloc_nwatch; i++) + { + if (_malloc_watch_list[i] == addr) + break; + } + if (i == _malloc_nwatch) + return ((PTR_T)0); /* not found */ + /* shuffle everything from i+1 to end down 1 */ + _malloc_nwatch--; + for ( ; i < _malloc_nwatch; i++) + _malloc_watch_list[i] = _malloc_watch_list[i+1]; + return addr; + } +#else + return ((PTR_T)0); +#endif +} diff --git a/lib/malloc/watch.h b/lib/malloc/watch.h new file mode 100644 index 0000000..6782acc --- /dev/null +++ b/lib/malloc/watch.h @@ -0,0 +1,41 @@ +/* watch.h - definitions for tables for keeping track of allocated memory */ + +/* Copyright (C) 2001-2003 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne-Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _MWATCH_H +#define _MWATCH_H + +#include "imalloc.h" + +#ifdef MALLOC_WATCH + +/* `Events' for watchpoints */ + +#define W_ALLOC 0x01 +#define W_FREE 0x02 +#define W_REALLOC 0x04 +#define W_RESIZED 0x08 + +extern int _malloc_nwatch; + +extern void _malloc_ckwatch __P((PTR_T, const char *, int, int, unsigned long)); + +#endif /* MALLOC_WATCH */ + +#endif /* _MWATCH_H */ diff --git a/lib/malloc/x386-alloca.s b/lib/malloc/x386-alloca.s new file mode 100644 index 0000000..112d33c --- /dev/null +++ b/lib/malloc/x386-alloca.s @@ -0,0 +1,63 @@ +;; alloca386.s 1.2 +;; GNU-compatible stack allocation function for Xenix/386. +;; Written by Chip Salzenberg at ComDev. +;; Last modified 90/01/11 +;;> Is your alloca clearly better than the one in i386-alloca.s? I haven't +;;> looked at either. +;; +;;They're different because Xenix/386 has a different assembler. SCO +;;Xenix has the Microsoft C compiler and the Microsoft macro assembler, +;;called "masm". MASM's assembler syntax is quite different from AT&T's +;;in all sorts of ways. Xenix people can't use the AT&T version. +;;-- +;;Chip Salzenberg at ComDev/TCT , + + TITLE $alloca386 + + .386 +DGROUP GROUP CONST, _BSS, _DATA +_DATA SEGMENT DWORD USE32 PUBLIC 'DATA' +_DATA ENDS +_BSS SEGMENT DWORD USE32 PUBLIC 'BSS' +_BSS ENDS +CONST SEGMENT DWORD USE32 PUBLIC 'CONST' +CONST ENDS +_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE' + ASSUME CS: _TEXT, DS: DGROUP, SS: DGROUP, ES: DGROUP + + PUBLIC _alloca +_alloca PROC NEAR + +; Get argument. + pop edx ; edx -> return address + pop eax ; eax = amount to allocate + +; Validate allocation amount. + add eax,3 + and eax,not 3 + cmp eax,0 + jg aa_size_ok + mov eax,4 +aa_size_ok: + +; Allocate stack space. + mov ecx,esp ; ecx -> old stack pointer + sub esp,eax ; perform allocation + mov eax,esp ; eax -> new stack pointer + +; Copy the three saved register variables from old stack top to new stack top. +; They may not be there. So we waste twelve bytes. Big fat hairy deal. + push DWORD PTR 8[ecx] + push DWORD PTR 4[ecx] + push DWORD PTR 0[ecx] + +; Push something so the caller can pop it off. + push eax + +; Return to caller. + jmp edx + +_alloca ENDP + +_TEXT ENDS + END diff --git a/lib/malloc/xleaktrace b/lib/malloc/xleaktrace new file mode 100755 index 0000000..d7e3cd5 --- /dev/null +++ b/lib/malloc/xleaktrace @@ -0,0 +1,47 @@ +#! /usr/bin/awk -f +# +# xleaktrace - print unfreed memory using input generated by compact malloc +# tracing (malloc_set_trace(1)) +# +# NOTE: we ignore `realloc' tags because they're just extra information +# +# Copyright (c) 2001 Chester Ramey +# Permission is hereby granted to deal in this Software without restriction. +# THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. +# +# Chet Ramey +# chet@po.cwru.edu +# +BEGIN { + FS=":"; +} + +$1 == "alloc" { + alloc[$2] = 1; + + size[$2] = $3; + file[$2] = $4; + line[$2] = $5; + +# printf "allocated: %s %d %d %s %d\n", $2, alloc[$2], size[$2], file[$2], line[$2]; + } + +$1 == "free" { + if ($2 in alloc) { + alloc[$2] = 0; +# printf "freed: %s %d\n", $2, alloc[$2]; + } else + printf "freeing unallocated pointer: %s\n", $2; + + } + +END { + printf "unfreed memory\n"; + for (ptr in alloc) { + if (alloc[ptr] == 1) { + printf "%s (%d) from %s:%d\n", ptr, size[ptr], file[ptr], line[ptr]; + } + } +} + + diff --git a/lib/malloc/xmalloc.c b/lib/malloc/xmalloc.c new file mode 100644 index 0000000..f6dec67 --- /dev/null +++ b/lib/malloc/xmalloc.c @@ -0,0 +1,94 @@ +/* xmalloc.c -- safe versions of malloc and realloc */ + +/* Copyright (C) 1991-2003 Free Software Foundation, Inc. + + This file is part of GNU Readline, a library for reading lines + of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if defined (HAVE_CONFIG_H) +#include +#endif + +#include + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +/* Generic pointer type. */ +#ifndef PTR_T + +#if defined (__STDC__) +# define PTR_T void * +#else +# define PTR_T char * +#endif + +#endif /* PTR_T */ + +/* **************************************************************** */ +/* */ +/* Memory Allocation and Deallocation. */ +/* */ +/* **************************************************************** */ + +static void +memory_error_and_abort (fname) + char *fname; +{ + fprintf (stderr, "%s: out of virtual memory\n", fname); + exit (2); +} + +/* Return a pointer to free()able block of memory large enough + to hold BYTES number of bytes. If the memory cannot be allocated, + print an error message and abort. */ +PTR_T +xmalloc (bytes) + size_t bytes; +{ + PTR_T temp; + + temp = malloc (bytes); + if (temp == 0) + memory_error_and_abort ("xmalloc"); + return (temp); +} + +PTR_T +xrealloc (pointer, bytes) + PTR_T pointer; + size_t bytes; +{ + PTR_T temp; + + temp = pointer ? realloc (pointer, bytes) : malloc (bytes); + + if (temp == 0) + memory_error_and_abort ("xrealloc"); + return (temp); +} + +void +xfree (string) + PTR_T string; +{ + if (string) + free (string); +} diff --git a/lib/readline/COPYING b/lib/readline/COPYING new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/lib/readline/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/lib/readline/ChangeLog b/lib/readline/ChangeLog new file mode 100644 index 0000000..1cf0c00 --- /dev/null +++ b/lib/readline/ChangeLog @@ -0,0 +1,403 @@ +Tue Mar 23 14:36:51 1993 Brian Fox (bfox@eos.crseo.ucsb.edu) + + * readline.c (rl_copy): Changed name to rl_copy_text. + +Mon Mar 22 19:16:05 1993 Brian Fox (bfox@eos.crseo.ucsb.edu) + + * dispose_cmd.c, several other files. Declare dispose_xxx () as + "void". + + * builtins/hashcom.h: Make declarations of hashed_filenames be + "extern" to keep the SGI compiler happy. + + * readline.c (rl_initialize_everything): Assign values to + out_stream and in_stream immediately, since + output_character_function () can be called before + readline_internal () is called. + +Tue Dec 8 09:30:56 1992 Brian Fox (bfox@cubit) + + * readline.c (rl_init_terminal) Set PC from BC, not from *buffer. + +Mon Nov 30 09:35:47 1992 Brian Fox (bfox@cubit) + + * readline.c (invoking_keyseqs_in_map, rl_parse_and_bind) Allow + backslash to quote characters, such as backslash, double quote, + and space. Backslash quotes all character indiscriminately. + + * funmap.c (vi_keymap) Fix type in "vi-replace" declaration. + +Fri Nov 20 10:55:05 1992 Brian Fox (bfox@cubit) + + * readline.c (init_terminal_io, rl_prep_terminal): FINALLY! + Declare and use termcap variable `ospeed' when setting up terminal + parameters. + +Thu Oct 8 08:53:07 1992 Brian J. Fox (bfox@helios) + + * Makefile, this directory: Include (as links to the canonical + sources), tilde.c, tilde.h, posixstat.h and xmalloc.c. + +Tue Sep 29 13:07:21 1992 Brian J. Fox (bfox@helios) + + * readline.c (init_terminal_io) Don't set arrow keys if the key + sequences that represent them are already set. + + * readline.c (rl_function_of_keyseq) New function returns the first + function (or macro) found while searching a key sequence. + +Mon Sep 28 00:34:04 1992 Brian J. Fox (bfox@helios) + + * readline.c (LibraryVersion) New static char * contains current + version number. Version is at 2.0. + + * readline.c (rl_complete_internal): Incorporated clean changes + from gilmore (gnu@cygnus.com) to support quoted substrings within + completion functions. + + * readline.c (many locations) Added support for the _GO32_, + whatever that is. Patches supplied by Cygnus, typed in by hand, + with cleanups. + +Sun Aug 16 12:46:24 1992 Brian Fox (bfox@cubit) + + * readline.c (init_terminal_io): Find out the values of the keypad + arrows and bind them to appropriate RL functions if present. + +Mon Aug 10 18:13:24 1992 Brian Fox (bfox@cubit) + + * history.c (stifle_history): A negative argument to stifle + becomes zero. + +Tue Jul 28 09:28:41 1992 Brian Fox (bfox@cubit) + + * readline.c (rl_variable_bind): New local structure describes + booleans by name and address; code in rl_variable_bind () looks at + structure to set simple variables. + + * parens.c (rl_insert_close): New variable rl_blink_matching_paren + is non-zero if we want to blink the matching open when a close is + inserted. If FD_SET is defined, rl_blink_matching_paren defaults + to 1, else 0. If FD_SET is not defined, and + rl_blink_matching_paren is non-zero, the close character(s) are/is + simply inserted. + +Wed Jul 22 20:03:59 1992 Brian Fox (bfox@cubit) + + * history.c, readline.c, vi_mode.c: Cause the functions strchr () + and strrchr () to be used instead of index () and rindex () + throughout the source. + +Mon Jul 13 11:34:07 1992 Brian Fox (bfox@cubit) + + * readline.c: (rl_variable_bind) New variable "meta-flag" if "on" + means force the use of the 8th bit as Meta bit. Internal variable + is called meta_flag. + +Thu Jul 9 10:37:56 1992 Brian Fox (bfox@cubit) + + * history.c (get_history_event) Change INDEX to LOCAL_INDEX. If + compiling for the shell, allow shell metacharacters to separate + history tokens as they would for shell tokens. + +Sat Jul 4 19:29:12 1992 Brian Fox (bfox@cubit) + + * vi_keymap.c: According to Posix, TAB self-inserts instead of + doing completion. + + * vi_mode.c: (rl_vi_yank_arg) Enter VI insert mode after yanking + an arg from the previous line. + + * search.c: New file takes over vi style searching and implements + non-incremental searching the history. + + Makefile: Add search.c and search.o. + + funmap.c: Add names for non-incremental-forward-search-history and + non-incremental-reverse-search-history. + + readline.h: Add extern definitions for non-incremental searching. + + vi_mode.c: Remove old search code; add calls to code in search.c. + +Fri Jul 3 10:36:33 1992 Brian Fox (bfox@cubit) + + * readline.c (rl_delete_horizontal_space); New function deletes + all whitespace surrounding point. + + funmap.c: Add "delete-horizontal-space". + emacs_keymap.c: Put rl_delete_horizontal_space () on M-\. + + * readline.c (rl_set_signals, rl_clear_signals); New function + rl_set_sighandler () is either defined in a Posix way (if + HAVE_POSIX_SIGNALS is defined) or in a BSD way. Function is + called from rl_set_signals () and rl_clear_signals (). + +Fri May 8 12:50:15 1992 Brian Fox (bfox@cubit) + + * readline.c: (readline_default_bindings) Do comparisons with + _POSIX_VDISABLE casted to `unsigned char'. Change tty characters + to be unsigned char. + +Thu Apr 30 12:36:35 1992 Brian Fox (bfox@cubit) + + * readline.c: (rl_getc) Handle "read would block" error on + non-blocking IO streams. + + * readline.c: (rl_signal_handler): Unblock only the signal that we + have caught, not all signals. + +Sun Feb 23 03:33:09 1992 Brian Fox (bfox at gnuwest.fsf.org) + + * readline.c: Many functions. Use only the macros META_CHAR and + UNMETA to deal with meta characters. Prior to this, we used + numeric values and tests. + + * readline.c (rl_complete_internal) Report exactly the number of + possible completions, not the number + 1. + + * vi_mode.c (rl_do_move) Do not change the cursor position when + using `cw' or `cW'. + + * vi_mode.c (rl_vi_complete) Enter insert mode after completing + with `*' or `\'. + +Fri Feb 21 05:58:18 1992 Brian Fox (bfox at gnuwest.fsf.org) + + * readline.c (rl_dispatch) Increment rl_key_sequence_length for + meta characters that map onto ESC map. + +Mon Feb 10 01:41:35 1992 Brian Fox (bfox at gnuwest.fsf.org) + + * history.c (history_do_write) Build a buffer of all of the lines + to write and write them in one fell swoop (lower overhead than + calling write () for each line). Suggested by Peter Ho. + + * readline.c: Include hbullx20 as well as hpux for determining + USGr3ness. + + * readline.c (rl_unix_word_rubout) As per the "Now REMEMBER" + comment, pass arguments to rl_kill_text () in the correct order to + preserve prepending and appending of killed text. + + * readline.c (rl_search_history) malloc (), realloc (), and free + () SEARCH_STRING so that there are no static limits on searching. + + * vi_mode.c (rl_vi_subst) Don't forget to end the undo group. + +Fri Jan 31 14:51:02 1992 Brian Fox (bfox at gnuwest.fsf.org) + + * readline.c (rl_signal_handler): Zero the current history entry's + pointer after freeing the undo_list when SIGINT received. + Reformat a couple of functions. + +Sat Jan 25 13:47:35 1992 Brian Fox (bfox at bears) + + * readline.c (parser_if): free () TNAME after use. + +Tue Jan 21 01:01:35 1992 Brian Fox (bfox at gnuwest.fsf.org) + + * readline.c (rl_redisplay) and (rl_character_len): Display + Control characters as "^c" and Meta characters as "\234", instead + of "C-C" and "M-C". + +Sun Dec 29 10:59:00 1991 Brian Fox (bfox at gnuwest.fsf.org) + + * readline.c (init_terminal_io) Default to environment variables + LINES and COLUMNS before termcap entry values. If all else fails, + then assume 80x24 terminal. + +Sat Dec 28 16:33:11 1991 Brian Fox (bfox at gnuwest.fsf.org) + + * readline.c: If this machine is USG and it is hpux, then define + USGr3. + + * history.c: Cosmetic fixes. + +Thu Nov 21 00:10:12 1991 Brian Fox (bfox at gnuwest.fsf.org) + + * vi_mode.c: (rl_do_move) Place cursor at end of line, never at + next to last character. + +Thu Nov 14 05:08:01 1991 Brian Fox (bfox at gnuwest.fsf.org) + + * history.c (get_history_event) Non-anchored searches can have a + return index of greater than zero from get_history_event (). + +Fri Nov 1 07:02:13 1991 Brian Fox (bfox at gnuwest.fsf.org) + + * readline.c (rl_translate_keyseq) Make C-? translate to RUBOUT + unconditionally. + +Mon Oct 28 11:34:52 1991 Brian Fox (bfox at gnuwest.fsf.org) + + * readline.c; Use Posix directory routines and macros. + + * funmap.c; Add entry for call-last-kbd-macro. + + * readline.c (rl_prep_term); Use system EOF character on POSIX + systems also. + +Thu Oct 3 16:19:53 1991 Brian Fox (bfox at gnuwest.fsf.org) + + * readline.c; Make a distinction between having a TERMIOS tty + driver, and having POSIX signal handling. You might one without + the other. New defines used HAVE_POSIX_SIGNALS, and + TERMIOS_TTY_DRIVER. + +Tue Jul 30 22:37:26 1991 Brian Fox (bfox at gnuwest.fsf.org) + + * readline.c: rl_getc () If a call to read () returns without an + error, but with zero characters, the file is empty, so return EOF. + +Thu Jul 11 20:58:38 1991 Brian Fox (bfox at gnuwest.fsf.org) + + * readline.c: (rl_get_next_history, rl_get_previous_history) + Reallocate the buffer space if the line being moved to is longer + the the current space allocated. Amazing that no one has found + this bug until now. + +Sun Jul 7 02:37:05 1991 Brian Fox (bfox at gnuwest.fsf.org) + + * readline.c:(rl_parse_and_bind) Allow leading whitespace. + Make sure TERMIO and TERMIOS systems treat CR and NL + disctinctly. + +Tue Jun 25 04:09:27 1991 Brian Fox (bfox at gnuwest.fsf.org) + + * readline.c: Rework parsing conditionals to pay attention to the + prior states of the conditional stack. This makes $if statements + work correctly. + +Mon Jun 24 20:45:59 1991 Brian Fox (bfox at gnuwest.fsf.org) + + * readline.c: support for displaying key binding information + includes the functions rl_list_funmap_names (), + invoking_keyseqs_in_map (), rl_invoking_keyseqs (), + rl_dump_functions (), and rl_function_dumper (). + + funmap.c: support for same includes rl_funmap_names (). + + readline.c, funmap.c: no longer define STATIC_MALLOC. However, + update both version of xrealloc () to handle a null pointer. + +Thu Apr 25 12:03:49 1991 Brian Fox (bfox at gnuwest.fsf.org) + + * vi_mode.c (rl_vi_fword, fWord, etc. All functions use + the macro `isident()'. Fixed movement bug which prevents + continious movement through the text. + +Fri Jul 27 16:47:01 1990 Brian Fox (bfox at gnuwest.fsf.org) + + * readline.c (parser_if) Allow "$if term=foo" construct. + +Wed May 23 16:10:33 1990 Brian Fox (bfox at gnuwest.fsf.org) + + * readline.c (rl_dispatch) Correctly remember the last command + executed. Fixed typo in username_completion_function (). + +Mon Apr 9 19:55:48 1990 Brian Fox (bfox at gnuwest.fsf.org) + + * readline.c: username_completion_function (); For text passed in + with a leading `~', remember that this could be a filename (after + it is completed). + +Thu Apr 5 13:44:24 1990 Brian Fox (bfox at gnuwest.fsf.org) + + * readline.c: rl_search_history (): Correctly handle case of an + unfound search string, but a graceful exit (as with ESC). + + * readline.c: rl_restart_output (); The Apollo passes the address + of the file descriptor to TIOCSTART, not the descriptor itself. + +Tue Mar 20 05:38:55 1990 Brian Fox (bfox at gnuwest.fsf.org) + + * readline.c: rl_complete (); second call in a row causes possible + completions to be listed. + + * readline.c: rl_redisplay (), added prompt_this_line variable + which is the first character character following \n in prompt. + +Sun Mar 11 04:32:03 1990 Brian Fox (bfox at gnuwest.fsf.org) + + * Signals are now supposedly handled inside of SYSV compilation. + +Wed Jan 17 19:24:09 1990 Brian Fox (bfox at sbphy.ucsb.edu) + + * history.c: history_expand (); fixed overwriting memory error, + added needed argument to call to get_history_event (). + +Thu Jan 11 10:54:04 1990 Brian Fox (bfox at sbphy.ucsb.edu) + + * readline.c: added mark_modified_lines to control the + display of an asterisk on modified history lines. Also + added a user variable called mark-modified-lines to the + `set' command. + +Thu Jan 4 10:38:05 1990 Brian Fox (bfox at sbphy.ucsb.edu) + + * readline.c: start_insert (). Only use IC if we don't have an im + capability. + +Fri Sep 8 09:00:45 1989 Brian Fox (bfox at aurel) + + * readline.c: rl_prep_terminal (). Only turn on 8th bit + as meta-bit iff the terminal is not using parity. + +Sun Sep 3 08:57:40 1989 Brian Fox (bfox at aurel) + + * readline.c: start_insert (). Uses multiple + insertion call in cases where that makes sense. + + rl_insert (). Read type-ahead buffer for additional + keys that are bound to rl_insert, and insert them + all at once. Make insertion of single keys given + with an argument much more efficient. + +Tue Aug 8 18:13:57 1989 Brian Fox (bfox at aurel) + + * readline.c: Changed handling of EOF. readline () returns + (char *)EOF or consed string. The EOF character is read from the + tty, or if the tty doesn't have one, defaults to C-d. + + * readline.c: Added support for event driven programs. + rl_event_hook is the address of a function you want called + while Readline is waiting for input. + + * readline.c: Cleanup time. Functions without type declarations + do not use return with a value. + + * history.c: history_expand () has new variable which is the + characters to ignore immediately following history_expansion_char. + +Sun Jul 16 08:14:00 1989 Brian Fox (bfox at aurel) + + * rl_prep_terminal () + BSD version turns off C-s, C-q, C-y, C-v. + + * readline.c -- rl_prep_terminal () + SYSV version hacks readline_echoing_p. + BSD version turns on passing of the 8th bit for the duration + of reading the line. + +Tue Jul 11 06:25:01 1989 Brian Fox (bfox at aurel) + + * readline.c: new variable rl_tilde_expander. + If non-null, this contains the address of a function to call if + the standard meaning for expanding a tilde fails. The function is + called with the text sans tilde (as in "foo"), and returns a + malloc()'ed string which is the expansion, or a NULL pointer if + there is no expansion. + + * readline.h - new file chardefs.h + Separates things that only readline.c needs from the standard + header file publishing interesting things about readline. + + * readline.c: + readline_default_bindings () now looks at terminal chararacters + and binds those as well. + +Wed Jun 28 20:20:51 1989 Brian Fox (bfox at aurel) + + * Made readline and history into independent libraries. + diff --git a/lib/readline/Makefile.in b/lib/readline/Makefile.in new file mode 100644 index 0000000..acccd02 --- /dev/null +++ b/lib/readline/Makefile.in @@ -0,0 +1,391 @@ +## -*- text -*- ############################################################# +# # +# Makefile for the Bash versions of the GNU Readline and History Libraries. # +# # +############################################################################# + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +PACKAGE = @PACKAGE_NAME@ +VERSION = @PACKAGE_VERSION@ + +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_VERSION = @PACKAGE_VERSION@ + +srcdir = @srcdir@ +VPATH = .:@srcdir@ +topdir = @top_srcdir@ +BUILD_DIR = @BUILD_DIR@ + +datarootdir = @datarootdir@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ + +CC = @CC@ +RANLIB = @RANLIB@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +RM = rm -f +CP = cp +MV = mv + +SHELL = @MAKE_SHELL@ + +# Programs to make tags files. +ETAGS = etags -tw +CTAGS = ctags -tw + +CFLAGS = @CFLAGS@ +LOCAL_CFLAGS = @LOCAL_CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ + +DEFS = @DEFS@ +LOCAL_DEFS = @LOCAL_DEFS@ + +INCLUDES = -I. -I$(BUILD_DIR) -I$(topdir) -I$(topdir)/lib + +CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(APP_CFLAGS) $(CPPFLAGS) ${INCLUDES} $(LOCAL_CFLAGS) $(CFLAGS) + +.c.o: + ${RM} $@ + $(CC) -c $(CCFLAGS) $< + +# The name of the main library target. +LIBRARY_NAME = libreadline.a + +# The C code source files for this library. +CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \ + $(srcdir)/vi_mode.c $(srcdir)/parens.c $(srcdir)/rltty.c \ + $(srcdir)/complete.c $(srcdir)/bind.c $(srcdir)/isearch.c \ + $(srcdir)/display.c $(srcdir)/signals.c $(srcdir)/emacs_keymap.c \ + $(srcdir)/vi_keymap.c $(srcdir)/util.c $(srcdir)/kill.c \ + $(srcdir)/undo.c $(srcdir)/macro.c $(srcdir)/input.c \ + $(srcdir)/callback.c $(srcdir)/terminal.c $(srcdir)/xmalloc.c \ + $(srcdir)/history.c $(srcdir)/histsearch.c $(srcdir)/histexpand.c \ + $(srcdir)/histfile.c $(srcdir)/nls.c $(srcdir)/search.c \ + $(srcdir)/shell.c $(srcdir)/tilde.c $(srcdir)/savestring.c \ + $(srcdir)/text.c $(srcdir)/misc.c $(srcdir)/compat.c \ + $(srcdir)/colors.c $(srcdir)/parse-colors.c \ + $(srcdir)/mbutil.c $(srcdir)/xfree.c + +# The header files for this library. +HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \ + posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \ + ansi_stdlib.h rlstdc.h tcap.h xmalloc.h rlprivate.h rlshell.h \ + rltypedefs.h rlmbutil.h colors.h parse-colors.h + +HISTOBJ = history.o histexpand.o histfile.o histsearch.o shell.o savestring.o \ + mbutil.o +TILDEOBJ = tilde.o +COLORSOBJ = colors.o parse-colors.o +OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \ + rltty.o complete.o bind.o isearch.o display.o signals.o \ + util.o kill.o undo.o macro.o input.o callback.o terminal.o \ + text.o nls.o misc.o $(HISTOBJ) $(TILDEOBJ) $(COLORSOBJ) \ + xmalloc.o xfree.o compat.o + +# The texinfo files which document this library. +DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo +DOCOBJECT = doc/readline.dvi +DOCSUPPORT = doc/Makefile +DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT) + +SUPPORT = Makefile ChangeLog $(DOCSUPPORT) examples/[-a-z.]* + +SOURCES = $(CSOURCES) $(HSOURCES) $(DOCSOURCE) + +THINGS_TO_TAR = $(SOURCES) $(SUPPORT) + +INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h \ + rlstdc.h rlconf.h rltypedefs.h + +########################################################################## + +all: libreadline.a libhistory.a + +libreadline.a: $(OBJECTS) + $(RM) $@ + $(AR) $(ARFLAGS) $@ $(OBJECTS) + -test -n "$(RANLIB)" && $(RANLIB) $@ + +libhistory.a: $(HISTOBJ) xmalloc.o xfree.o + $(RM) $@ + $(AR) $(ARFLAGS) $@ $(HISTOBJ) xmalloc.o xfree.o + -test -n "$(RANLIB)" && $(RANLIB) $@ + +documentation: force + test -d doc || mkdir doc + -( cd doc && $(MAKE) $(MFLAGS) ) + +# Since tilde.c is shared between readline and bash, make sure we compile +# it with the right flags when it's built as part of readline +tilde.o: tilde.c + rm -f $@ + $(CC) $(CCFLAGS) -DREADLINE_LIBRARY -c $(srcdir)/tilde.c + +force: + +install: + @echo "This version of the readline library should not be installed." + +uninstall: + @echo "This version of the readline library should not be installed." + +TAGS: force + $(ETAGS) $(CSOURCES) $(HSOURCES) + +tags: force + $(CTAGS) $(CSOURCES) $(HSOURCES) + +clean: force + $(RM) $(OBJECTS) *.a + -( cd doc && $(MAKE) $(MFLAGS) $@ ) + +mostlyclean: clean + -( cd doc && $(MAKE) $(MFLAGS) $@ ) + +distclean maintainer-clean: clean + -( cd doc && $(MAKE) $(MFLAGS) $@ ) + $(RM) Makefile + $(RM) TAGS tags + +# Dependencies +bind.o: ansi_stdlib.h posixstat.h +bind.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h +bind.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h +bind.o: history.h rlstdc.h +callback.o: rlconf.h ansi_stdlib.h +callback.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h +callback.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h +compat.o: rlstdc.h +complete.o: ansi_stdlib.h posixdir.h posixstat.h +complete.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h +complete.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h +complete.o: colors.h +display.o: ansi_stdlib.h posixstat.h +display.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h +display.o: tcap.h +display.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h +display.o: history.h rlstdc.h +funmap.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h +funmap.o: rlconf.h ansi_stdlib.h rlstdc.h +funmap.o: ${BUILD_DIR}/config.h +histexpand.o: ansi_stdlib.h +histexpand.o: history.h histlib.h rlstdc.h +histexpand.o: ${BUILD_DIR}/config.h +histfile.o: ansi_stdlib.h +histfile.o: history.h histlib.h rlstdc.h +histfile.o: ${BUILD_DIR}/config.h +history.o: ansi_stdlib.h +history.o: history.h histlib.h rlstdc.h +history.o: ${BUILD_DIR}/config.h +histsearch.o: ansi_stdlib.h +histsearch.o: history.h histlib.h rlstdc.h +histsearch.o: ${BUILD_DIR}/config.h +input.o: ansi_stdlib.h +input.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h +input.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h +isearch.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h +isearch.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h +isearch.o: ansi_stdlib.h history.h rlstdc.h +keymaps.o: emacs_keymap.c vi_keymap.c +keymaps.o: keymaps.h rltypedefs.h chardefs.h rlconf.h ansi_stdlib.h +keymaps.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h +keymaps.o: ${BUILD_DIR}/config.h rlstdc.h +kill.o: ansi_stdlib.h +kill.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h +kill.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h +kill.o: history.h rlstdc.h +macro.o: ansi_stdlib.h +macro.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h +macro.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h +macro.o: history.h rlstdc.h +mbutil.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h rlmbutil.h +mbutil.o: readline.h keymaps.h rltypedefs.h chardefs.h rlstdc.h +misc.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h +misc.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h +misc.o: history.h rlstdc.h ansi_stdlib.h +nls.o: ansi_stdlib.h +nls.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h +nls.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h +nls.o: history.h rlstdc.h +parens.o: rlconf.h +parens.o: ${BUILD_DIR}/config.h +parens.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h +readline.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h +readline.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h +readline.o: history.h rlstdc.h +readline.o: posixstat.h ansi_stdlib.h posixjmp.h +rltty.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h +rltty.o: rltty.h +rltty.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h +search.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h +search.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h +search.o: ansi_stdlib.h history.h rlstdc.h +shell.o: ${BUILD_DIR}/config.h ansi_stdlib.h +signals.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h +signals.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h +signals.o: history.h rlstdc.h +terminal.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h +terminal.o: tcap.h +terminal.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h +terminal.o: history.h rlstdc.h +text.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h +text.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h +text.o: history.h rlstdc.h ansi_stdlib.h +rltty.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h +tilde.o: ansi_stdlib.h +tilde.o: ${BUILD_DIR}/config.h +tilde.o: tilde.h +undo.o: ansi_stdlib.h +undo.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h +undo.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h +undo.o: history.h rlstdc.h xmalloc.h +util.o: posixjmp.h ansi_stdlib.h +util.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h +util.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h +vi_mode.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h +vi_mode.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h +vi_mode.o: history.h ansi_stdlib.h rlstdc.h +xmalloc.o: ${BUILD_DIR}/config.h ansi_stdlib.h +xfree.o: ${BUILD_DIR}/config.h ansi_stdlib.h + +colors.o: ${BUILD_DIR}/config.h colors.h +colors.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h +colors.o: rlconf.h +colors.o: ansi_stdlib.h posixstat.h +parse-colors.o: ${BUILD_DIR}/config.h colors.h parse-colors.h +parse-colors.o: rldefs.h rlconf.h +parse-colors.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h + +bind.o: rlshell.h +histfile.o: rlshell.h +nls.o: rlshell.h +readline.o: rlshell.h +shell.o: rlshell.h +terminal.o: rlshell.h +histexpand.o: rlshell.h + +bind.o: rlprivate.h +callback.o: rlprivate.h +complete.o: rlprivate.h +display.o: rlprivate.h +input.o: rlprivate.h +isearch.o: rlprivate.h +kill.o: rlprivate.h +macro.o: rlprivate.h +mbutil.o: rlprivate.h +misc.o: rlprivate.h +nls.o: rlprivate.h +parens.o: rlprivate.h +readline.o: rlprivate.h +rltty.o: rlprivate.h +search.o: rlprivate.h +signals.o: rlprivate.h +terminal.o: rlprivate.h +text.o: rlprivate.h +undo.o: rlprivate.h +util.o: rlprivate.h +vi_mode.o: rlprivate.h +colors.o: rlprivate.h +parse-colors.o: rlprivate.h + +bind.o: xmalloc.h +complete.o: xmalloc.h +display.o: xmalloc.h +funmap.o: xmalloc.h +histexpand.o: xmalloc.h +histfile.o: xmalloc.h +history.o: xmalloc.h +input.o: xmalloc.h +isearch.o: xmalloc.h +keymaps.o: xmalloc.h +kill.o: xmalloc.h +macro.o: xmalloc.h +mbutil.o: xmalloc.h +misc.o: xmalloc.h +readline.o: xmalloc.h +savestring.o: xmalloc.h +search.o: xmalloc.h +shell.o: xmalloc.h +terminal.o: xmalloc.h +text.o: xmalloc.h +tilde.o: xmalloc.h +undo.o: xmalloc.h +util.o: xmalloc.h +vi_mode.o: xmalloc.h +xfree.o: xmalloc.h +xmalloc.o: xmalloc.h +colors.o: xmalloc.h +parse-colors.o: xmalloc.h + +complete.o: rlmbutil.h +display.o: rlmbutil.h +histexpand.o: rlmbutil.h +input.o: rlmbutil.h +isearch.o: rlmbutil.h +mbutil.o: rlmbutil.h +misc.o: rlmbutil.h +readline.o: rlmbutil.h +search.o: rlmbutil.h +text.o: rlmbutil.h +vi_mode.o: rlmbutil.h +colors.o: rlmbutil.h +parse-colors.o: rlmbutil.h + +# Rules for deficient makes, like SunOS and Solaris +bind.o: bind.c +callback.o: callback.c +compat.o: compat.c +complete.o: complete.c +display.o: display.c +funmap.o: funmap.c +input.o: input.c +isearch.o: isearch.c +keymaps.o: keymaps.c emacs_keymap.c vi_keymap.c +kill.o: kill.c +macro.o: macro.c +mbutil.o: mbutil.c +misc.o: misc.c +nls.o: nls.c +parens.o: parens.c +readline.o: readline.c +rltty.o: rltty.c +savestring.o: savestring.c +search.o: search.c +shell.o: shell.c +signals.o: signals.c +terminal.o: terminal.c +text.o: text.c +tilde.o: tilde.c +undo.o: undo.c +util.o: util.c +vi_mode.o: vi_mode.c +xfree.o: xfree.c +xmalloc.o: xmalloc.c + +colors.o: colors.c +parse-colors.o: parse-colors.c + +histexpand.o: histexpand.c +histfile.o: histfile.c +history.o: history.c +histsearch.o: histsearch.c diff --git a/lib/readline/README b/lib/readline/README new file mode 100644 index 0000000..131471c --- /dev/null +++ b/lib/readline/README @@ -0,0 +1,6 @@ +This is the distribution of the Gnu Readline library. See the file +STANDALONE for a description of the #defines that can be passed via +the makefile to build readline on different systems. + +The file rlconf.h contains defines that enable and disable certain +readline features. diff --git a/lib/readline/STANDALONE b/lib/readline/STANDALONE new file mode 100644 index 0000000..c6b5cbd --- /dev/null +++ b/lib/readline/STANDALONE @@ -0,0 +1,2 @@ +This is not to be built as a standalone library to be installed in some +public place; get the full readline distribution instead. diff --git a/lib/readline/ansi_stdlib.h b/lib/readline/ansi_stdlib.h new file mode 100644 index 0000000..7dc2ee0 --- /dev/null +++ b/lib/readline/ansi_stdlib.h @@ -0,0 +1,54 @@ +/* ansi_stdlib.h -- An ANSI Standard stdlib.h. */ +/* A minimal stdlib.h containing extern declarations for those functions + that bash uses. */ + +/* Copyright (C) 1993 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_STDLIB_H_) +#define _STDLIB_H_ 1 + +/* String conversion functions. */ +extern int atoi (); + +extern double atof (); +extern double strtod (); + +/* Memory allocation functions. */ +/* Generic pointer type. */ +#ifndef PTR_T + +#if defined (__STDC__) +# define PTR_T void * +#else +# define PTR_T char * +#endif + +#endif /* PTR_T */ + +extern PTR_T malloc (); +extern PTR_T realloc (); +extern void free (); + +/* Other miscellaneous functions. */ +extern void abort (); +extern void exit (); +extern char *getenv (); +extern void qsort (); + +#endif /* _STDLIB_H */ diff --git a/lib/readline/bind.c b/lib/readline/bind.c new file mode 100644 index 0000000..8acf4ac --- /dev/null +++ b/lib/readline/bind.c @@ -0,0 +1,2483 @@ +/* bind.c -- key binding and startup file support for the readline library. */ + +/* Copyright (C) 1987-2012 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (__TANDEM) +# include +#endif + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include +#include +#include +#if defined (HAVE_SYS_FILE_H) +# include +#endif /* HAVE_SYS_FILE_H */ + +#if defined (HAVE_UNISTD_H) +# include +#endif /* HAVE_UNISTD_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +#include "posixstat.h" + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" + +/* Some standard library routines. */ +#include "readline.h" +#include "history.h" + +#include "rlprivate.h" +#include "rlshell.h" +#include "xmalloc.h" + +#if !defined (strchr) && !defined (__STDC__) +extern char *strchr (), *strrchr (); +#endif /* !strchr && !__STDC__ */ + +/* Variables exported by this file. */ +Keymap rl_binding_keymap; + +static int _rl_skip_to_delim PARAMS((char *, int, int)); + +static char *_rl_read_file PARAMS((char *, size_t *)); +static void _rl_init_file_error PARAMS((const char *)); +static int _rl_read_init_file PARAMS((const char *, int)); +static int glean_key_from_name PARAMS((char *)); + +static int find_boolean_var PARAMS((const char *)); +static int find_string_var PARAMS((const char *)); + +static char *_rl_get_string_variable_value PARAMS((const char *)); +static int substring_member_of_array PARAMS((const char *, const char * const *)); + +static int currently_reading_init_file; + +/* used only in this file */ +static int _rl_prefer_visible_bell = 1; + +/* **************************************************************** */ +/* */ +/* Binding keys */ +/* */ +/* **************************************************************** */ + +/* rl_add_defun (char *name, rl_command_func_t *function, int key) + Add NAME to the list of named functions. Make FUNCTION be the function + that gets called. If KEY is not -1, then bind it. */ +int +rl_add_defun (name, function, key) + const char *name; + rl_command_func_t *function; + int key; +{ + if (key != -1) + rl_bind_key (key, function); + rl_add_funmap_entry (name, function); + return 0; +} + +/* Bind KEY to FUNCTION. Returns non-zero if KEY is out of range. */ +int +rl_bind_key (key, function) + int key; + rl_command_func_t *function; +{ + if (key < 0) + return (key); + + if (META_CHAR (key) && _rl_convert_meta_chars_to_ascii) + { + if (_rl_keymap[ESC].type == ISKMAP) + { + Keymap escmap; + + escmap = FUNCTION_TO_KEYMAP (_rl_keymap, ESC); + key = UNMETA (key); + escmap[key].type = ISFUNC; + escmap[key].function = function; + return (0); + } + return (key); + } + + _rl_keymap[key].type = ISFUNC; + _rl_keymap[key].function = function; + rl_binding_keymap = _rl_keymap; + return (0); +} + +/* Bind KEY to FUNCTION in MAP. Returns non-zero in case of invalid + KEY. */ +int +rl_bind_key_in_map (key, function, map) + int key; + rl_command_func_t *function; + Keymap map; +{ + int result; + Keymap oldmap; + + oldmap = _rl_keymap; + _rl_keymap = map; + result = rl_bind_key (key, function); + _rl_keymap = oldmap; + return (result); +} + +/* Bind key sequence KEYSEQ to DEFAULT_FUNC if KEYSEQ is unbound. Right + now, this is always used to attempt to bind the arrow keys, hence the + check for rl_vi_movement_mode. */ +int +rl_bind_key_if_unbound_in_map (key, default_func, kmap) + int key; + rl_command_func_t *default_func; + Keymap kmap; +{ + char keyseq[2]; + + keyseq[0] = (unsigned char)key; + keyseq[1] = '\0'; + return (rl_bind_keyseq_if_unbound_in_map (keyseq, default_func, kmap)); +} + +int +rl_bind_key_if_unbound (key, default_func) + int key; + rl_command_func_t *default_func; +{ + char keyseq[2]; + + keyseq[0] = (unsigned char)key; + keyseq[1] = '\0'; + return (rl_bind_keyseq_if_unbound_in_map (keyseq, default_func, _rl_keymap)); +} + +/* Make KEY do nothing in the currently selected keymap. + Returns non-zero in case of error. */ +int +rl_unbind_key (key) + int key; +{ + return (rl_bind_key (key, (rl_command_func_t *)NULL)); +} + +/* Make KEY do nothing in MAP. + Returns non-zero in case of error. */ +int +rl_unbind_key_in_map (key, map) + int key; + Keymap map; +{ + return (rl_bind_key_in_map (key, (rl_command_func_t *)NULL, map)); +} + +/* Unbind all keys bound to FUNCTION in MAP. */ +int +rl_unbind_function_in_map (func, map) + rl_command_func_t *func; + Keymap map; +{ + register int i, rval; + + for (i = rval = 0; i < KEYMAP_SIZE; i++) + { + if (map[i].type == ISFUNC && map[i].function == func) + { + map[i].function = (rl_command_func_t *)NULL; + rval = 1; + } + } + return rval; +} + +int +rl_unbind_command_in_map (command, map) + const char *command; + Keymap map; +{ + rl_command_func_t *func; + + func = rl_named_function (command); + if (func == 0) + return 0; + return (rl_unbind_function_in_map (func, map)); +} + +/* Bind the key sequence represented by the string KEYSEQ to + FUNCTION, starting in the current keymap. This makes new + keymaps as necessary. */ +int +rl_bind_keyseq (keyseq, function) + const char *keyseq; + rl_command_func_t *function; +{ + return (rl_generic_bind (ISFUNC, keyseq, (char *)function, _rl_keymap)); +} + +/* Bind the key sequence represented by the string KEYSEQ to + FUNCTION. This makes new keymaps as necessary. The initial + place to do bindings is in MAP. */ +int +rl_bind_keyseq_in_map (keyseq, function, map) + const char *keyseq; + rl_command_func_t *function; + Keymap map; +{ + return (rl_generic_bind (ISFUNC, keyseq, (char *)function, map)); +} + +/* Backwards compatibility; equivalent to rl_bind_keyseq_in_map() */ +int +rl_set_key (keyseq, function, map) + const char *keyseq; + rl_command_func_t *function; + Keymap map; +{ + return (rl_generic_bind (ISFUNC, keyseq, (char *)function, map)); +} + +/* Bind key sequence KEYSEQ to DEFAULT_FUNC if KEYSEQ is unbound. Right + now, this is always used to attempt to bind the arrow keys, hence the + check for rl_vi_movement_mode. */ +int +rl_bind_keyseq_if_unbound_in_map (keyseq, default_func, kmap) + const char *keyseq; + rl_command_func_t *default_func; + Keymap kmap; +{ + rl_command_func_t *func; + + if (keyseq) + { + func = rl_function_of_keyseq (keyseq, kmap, (int *)NULL); +#if defined (VI_MODE) + if (!func || func == rl_do_lowercase_version || func == rl_vi_movement_mode) +#else + if (!func || func == rl_do_lowercase_version) +#endif + return (rl_bind_keyseq_in_map (keyseq, default_func, kmap)); + else + return 1; + } + return 0; +} + +int +rl_bind_keyseq_if_unbound (keyseq, default_func) + const char *keyseq; + rl_command_func_t *default_func; +{ + return (rl_bind_keyseq_if_unbound_in_map (keyseq, default_func, _rl_keymap)); +} + +/* Bind the key sequence represented by the string KEYSEQ to + the string of characters MACRO. This makes new keymaps as + necessary. The initial place to do bindings is in MAP. */ +int +rl_macro_bind (keyseq, macro, map) + const char *keyseq, *macro; + Keymap map; +{ + char *macro_keys; + int macro_keys_len; + + macro_keys = (char *)xmalloc ((2 * strlen (macro)) + 1); + + if (rl_translate_keyseq (macro, macro_keys, ¯o_keys_len)) + { + xfree (macro_keys); + return -1; + } + rl_generic_bind (ISMACR, keyseq, macro_keys, map); + return 0; +} + +/* Bind the key sequence represented by the string KEYSEQ to + the arbitrary pointer DATA. TYPE says what kind of data is + pointed to by DATA, right now this can be a function (ISFUNC), + a macro (ISMACR), or a keymap (ISKMAP). This makes new keymaps + as necessary. The initial place to do bindings is in MAP. */ +int +rl_generic_bind (type, keyseq, data, map) + int type; + const char *keyseq; + char *data; + Keymap map; +{ + char *keys; + int keys_len; + register int i; + KEYMAP_ENTRY k; + + k.function = 0; + + /* If no keys to bind to, exit right away. */ + if (keyseq == 0 || *keyseq == 0) + { + if (type == ISMACR) + xfree (data); + return -1; + } + + keys = (char *)xmalloc (1 + (2 * strlen (keyseq))); + + /* Translate the ASCII representation of KEYSEQ into an array of + characters. Stuff the characters into KEYS, and the length of + KEYS into KEYS_LEN. */ + if (rl_translate_keyseq (keyseq, keys, &keys_len)) + { + xfree (keys); + return -1; + } + + /* Bind keys, making new keymaps as necessary. */ + for (i = 0; i < keys_len; i++) + { + unsigned char uc = keys[i]; + int ic; + + ic = uc; + if (ic < 0 || ic >= KEYMAP_SIZE) + { + xfree (keys); + return -1; + } + + if (META_CHAR (ic) && _rl_convert_meta_chars_to_ascii) + { + ic = UNMETA (ic); + if (map[ESC].type == ISKMAP) + map = FUNCTION_TO_KEYMAP (map, ESC); + } + + if ((i + 1) < keys_len) + { + if (map[ic].type != ISKMAP) + { + /* We allow subsequences of keys. If a keymap is being + created that will `shadow' an existing function or macro + key binding, we save that keybinding into the ANYOTHERKEY + index in the new map. The dispatch code will look there + to find the function to execute if the subsequence is not + matched. ANYOTHERKEY was chosen to be greater than + UCHAR_MAX. */ + k = map[ic]; + + map[ic].type = ISKMAP; + map[ic].function = KEYMAP_TO_FUNCTION (rl_make_bare_keymap()); + } + map = FUNCTION_TO_KEYMAP (map, ic); + /* The dispatch code will return this function if no matching + key sequence is found in the keymap. This (with a little + help from the dispatch code in readline.c) allows `a' to be + mapped to something, `abc' to be mapped to something else, + and the function bound to `a' to be executed when the user + types `abx', leaving `bx' in the input queue. */ + if (k.function && ((k.type == ISFUNC && k.function != rl_do_lowercase_version) || k.type == ISMACR)) + { + map[ANYOTHERKEY] = k; + k.function = 0; + } + } + else + { + if (map[ic].type == ISMACR) + xfree ((char *)map[ic].function); + else if (map[ic].type == ISKMAP) + { + map = FUNCTION_TO_KEYMAP (map, ic); + ic = ANYOTHERKEY; + /* If we're trying to override a keymap with a null function + (e.g., trying to unbind it), we can't use a null pointer + here because that's indistinguishable from having not been + overridden. We use a special bindable function that does + nothing. */ + if (type == ISFUNC && data == 0) + data = (char *)_rl_null_function; + } + + map[ic].function = KEYMAP_TO_FUNCTION (data); + map[ic].type = type; + } + + rl_binding_keymap = map; + } + xfree (keys); + return 0; +} + +/* Translate the ASCII representation of SEQ, stuffing the values into ARRAY, + an array of characters. LEN gets the final length of ARRAY. Return + non-zero if there was an error parsing SEQ. */ +int +rl_translate_keyseq (seq, array, len) + const char *seq; + char *array; + int *len; +{ + register int i, c, l, temp; + + for (i = l = 0; c = seq[i]; i++) + { + if (c == '\\') + { + c = seq[++i]; + + if (c == 0) + break; + + /* Handle \C- and \M- prefixes. */ + if ((c == 'C' || c == 'M') && seq[i + 1] == '-') + { + /* Handle special case of backwards define. */ + if (strncmp (&seq[i], "C-\\M-", 5) == 0) + { + array[l++] = ESC; /* ESC is meta-prefix */ + i += 5; + array[l++] = CTRL (_rl_to_upper (seq[i])); + if (seq[i] == '\0') + i--; + } + else if (c == 'M') + { + i++; /* seq[i] == '-' */ + /* XXX - obey convert-meta setting */ + if (_rl_convert_meta_chars_to_ascii && _rl_keymap[ESC].type == ISKMAP) + array[l++] = ESC; /* ESC is meta-prefix */ + else if (seq[i+1] == '\\' && seq[i+2] == 'C' && seq[i+3] == '-') + { + i += 4; + temp = (seq[i] == '?') ? RUBOUT : CTRL (_rl_to_upper (seq[i])); + array[l++] = META (temp); + } + else + { + /* This doesn't yet handle things like \M-\a, which may + or may not have any reasonable meaning. You're + probably better off using straight octal or hex. */ + i++; + array[l++] = META (seq[i]); + } + } + else if (c == 'C') + { + i += 2; + /* Special hack for C-?... */ + array[l++] = (seq[i] == '?') ? RUBOUT : CTRL (_rl_to_upper (seq[i])); + } + continue; + } + + /* Translate other backslash-escaped characters. These are the + same escape sequences that bash's `echo' and `printf' builtins + handle, with the addition of \d -> RUBOUT. A backslash + preceding a character that is not special is stripped. */ + switch (c) + { + case 'a': + array[l++] = '\007'; + break; + case 'b': + array[l++] = '\b'; + break; + case 'd': + array[l++] = RUBOUT; /* readline-specific */ + break; + case 'e': + array[l++] = ESC; + break; + case 'f': + array[l++] = '\f'; + break; + case 'n': + array[l++] = NEWLINE; + break; + case 'r': + array[l++] = RETURN; + break; + case 't': + array[l++] = TAB; + break; + case 'v': + array[l++] = 0x0B; + break; + case '\\': + array[l++] = '\\'; + break; + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + i++; + for (temp = 2, c -= '0'; ISOCTAL (seq[i]) && temp--; i++) + c = (c * 8) + OCTVALUE (seq[i]); + i--; /* auto-increment in for loop */ + array[l++] = c & largest_char; + break; + case 'x': + i++; + for (temp = 2, c = 0; ISXDIGIT ((unsigned char)seq[i]) && temp--; i++) + c = (c * 16) + HEXVALUE (seq[i]); + if (temp == 2) + c = 'x'; + i--; /* auto-increment in for loop */ + array[l++] = c & largest_char; + break; + default: /* backslashes before non-special chars just add the char */ + array[l++] = c; + break; /* the backslash is stripped */ + } + continue; + } + + array[l++] = c; + } + + *len = l; + array[l] = '\0'; + return (0); +} + +static int +_rl_isescape (c) + int c; +{ + switch (c) + { + case '\007': + case '\b': + case '\f': + case '\n': + case '\r': + case TAB: + case 0x0b: return (1); + default: return (0); + } +} + +static int +_rl_escchar (c) + int c; +{ + switch (c) + { + case '\007': return ('a'); + case '\b': return ('b'); + case '\f': return ('f'); + case '\n': return ('n'); + case '\r': return ('r'); + case TAB: return ('t'); + case 0x0b: return ('v'); + default: return (c); + } +} + +char * +rl_untranslate_keyseq (seq) + int seq; +{ + static char kseq[16]; + int i, c; + + i = 0; + c = seq; + if (META_CHAR (c)) + { + kseq[i++] = '\\'; + kseq[i++] = 'M'; + kseq[i++] = '-'; + c = UNMETA (c); + } + else if (c == ESC) + { + kseq[i++] = '\\'; + c = 'e'; + } + else if (CTRL_CHAR (c)) + { + kseq[i++] = '\\'; + kseq[i++] = 'C'; + kseq[i++] = '-'; + c = _rl_to_lower (UNCTRL (c)); + } + else if (c == RUBOUT) + { + kseq[i++] = '\\'; + kseq[i++] = 'C'; + kseq[i++] = '-'; + c = '?'; + } + + if (c == ESC) + { + kseq[i++] = '\\'; + c = 'e'; + } + else if (c == '\\' || c == '"') + { + kseq[i++] = '\\'; + } + + kseq[i++] = (unsigned char) c; + kseq[i] = '\0'; + return kseq; +} + +char * +_rl_untranslate_macro_value (seq, use_escapes) + char *seq; + int use_escapes; +{ + char *ret, *r, *s; + int c; + + r = ret = (char *)xmalloc (7 * strlen (seq) + 1); + for (s = seq; *s; s++) + { + c = *s; + if (META_CHAR (c)) + { + *r++ = '\\'; + *r++ = 'M'; + *r++ = '-'; + c = UNMETA (c); + } + else if (c == ESC) + { + *r++ = '\\'; + c = 'e'; + } + else if (CTRL_CHAR (c)) + { + *r++ = '\\'; + if (use_escapes && _rl_isescape (c)) + c = _rl_escchar (c); + else + { + *r++ = 'C'; + *r++ = '-'; + c = _rl_to_lower (UNCTRL (c)); + } + } + else if (c == RUBOUT) + { + *r++ = '\\'; + *r++ = 'C'; + *r++ = '-'; + c = '?'; + } + + if (c == ESC) + { + *r++ = '\\'; + c = 'e'; + } + else if (c == '\\' || c == '"') + *r++ = '\\'; + + *r++ = (unsigned char)c; + } + *r = '\0'; + return ret; +} + +/* Return a pointer to the function that STRING represents. + If STRING doesn't have a matching function, then a NULL pointer + is returned. */ +rl_command_func_t * +rl_named_function (string) + const char *string; +{ + register int i; + + rl_initialize_funmap (); + + for (i = 0; funmap[i]; i++) + if (_rl_stricmp (funmap[i]->name, string) == 0) + return (funmap[i]->function); + return ((rl_command_func_t *)NULL); +} + +/* Return the function (or macro) definition which would be invoked via + KEYSEQ if executed in MAP. If MAP is NULL, then the current keymap is + used. TYPE, if non-NULL, is a pointer to an int which will receive the + type of the object pointed to. One of ISFUNC (function), ISKMAP (keymap), + or ISMACR (macro). */ +rl_command_func_t * +rl_function_of_keyseq (keyseq, map, type) + const char *keyseq; + Keymap map; + int *type; +{ + register int i; + + if (map == 0) + map = _rl_keymap; + + for (i = 0; keyseq && keyseq[i]; i++) + { + unsigned char ic = keyseq[i]; + + if (META_CHAR (ic) && _rl_convert_meta_chars_to_ascii) + { + if (map[ESC].type == ISKMAP) + { + map = FUNCTION_TO_KEYMAP (map, ESC); + ic = UNMETA (ic); + } + /* XXX - should we just return NULL here, since this obviously + doesn't match? */ + else + { + if (type) + *type = map[ESC].type; + + return (map[ESC].function); + } + } + + if (map[ic].type == ISKMAP) + { + /* If this is the last key in the key sequence, return the + map. */ + if (keyseq[i + 1] == '\0') + { + if (type) + *type = ISKMAP; + + return (map[ic].function); + } + else + map = FUNCTION_TO_KEYMAP (map, ic); + } + /* If we're not at the end of the key sequence, and the current key + is bound to something other than a keymap, then the entire key + sequence is not bound. */ + else if (map[ic].type != ISKMAP && keyseq[i+1]) + return ((rl_command_func_t *)NULL); + else /* map[ic].type != ISKMAP && keyseq[i+1] == 0 */ + { + if (type) + *type = map[ic].type; + + return (map[ic].function); + } + } + return ((rl_command_func_t *) NULL); +} + +/* The last key bindings file read. */ +static char *last_readline_init_file = (char *)NULL; + +/* The file we're currently reading key bindings from. */ +static const char *current_readline_init_file; +static int current_readline_init_include_level; +static int current_readline_init_lineno; + +/* Read FILENAME into a locally-allocated buffer and return the buffer. + The size of the buffer is returned in *SIZEP. Returns NULL if any + errors were encountered. */ +static char * +_rl_read_file (filename, sizep) + char *filename; + size_t *sizep; +{ + struct stat finfo; + size_t file_size; + char *buffer; + int i, file; + + if ((stat (filename, &finfo) < 0) || (file = open (filename, O_RDONLY, 0666)) < 0) + return ((char *)NULL); + + file_size = (size_t)finfo.st_size; + + /* check for overflow on very large files */ + if (file_size != finfo.st_size || file_size + 1 < file_size) + { + if (file >= 0) + close (file); +#if defined (EFBIG) + errno = EFBIG; +#endif + return ((char *)NULL); + } + + /* Read the file into BUFFER. */ + buffer = (char *)xmalloc (file_size + 1); + i = read (file, buffer, file_size); + close (file); + + if (i < 0) + { + xfree (buffer); + return ((char *)NULL); + } + + RL_CHECK_SIGNALS (); + + buffer[i] = '\0'; + if (sizep) + *sizep = i; + + return (buffer); +} + +/* Re-read the current keybindings file. */ +int +rl_re_read_init_file (count, ignore) + int count, ignore; +{ + int r; + r = rl_read_init_file ((const char *)NULL); + rl_set_keymap_from_edit_mode (); + return r; +} + +/* Do key bindings from a file. If FILENAME is NULL it defaults + to the first non-null filename from this list: + 1. the filename used for the previous call + 2. the value of the shell variable `INPUTRC' + 3. ~/.inputrc + 4. /etc/inputrc + If the file existed and could be opened and read, 0 is returned, + otherwise errno is returned. */ +int +rl_read_init_file (filename) + const char *filename; +{ + /* Default the filename. */ + if (filename == 0) + filename = last_readline_init_file; + if (filename == 0) + filename = sh_get_env_value ("INPUTRC"); + if (filename == 0 || *filename == 0) + { + filename = DEFAULT_INPUTRC; + /* Try to read DEFAULT_INPUTRC; fall back to SYS_INPUTRC on failure */ + if (_rl_read_init_file (filename, 0) == 0) + return 0; + filename = SYS_INPUTRC; + } + +#if defined (__MSDOS__) + if (_rl_read_init_file (filename, 0) == 0) + return 0; + filename = "~/_inputrc"; +#endif + return (_rl_read_init_file (filename, 0)); +} + +static int +_rl_read_init_file (filename, include_level) + const char *filename; + int include_level; +{ + register int i; + char *buffer, *openname, *line, *end; + size_t file_size; + + current_readline_init_file = filename; + current_readline_init_include_level = include_level; + + openname = tilde_expand (filename); + buffer = _rl_read_file (openname, &file_size); + xfree (openname); + + RL_CHECK_SIGNALS (); + if (buffer == 0) + return (errno); + + if (include_level == 0 && filename != last_readline_init_file) + { + FREE (last_readline_init_file); + last_readline_init_file = savestring (filename); + } + + currently_reading_init_file = 1; + + /* Loop over the lines in the file. Lines that start with `#' are + comments; all other lines are commands for readline initialization. */ + current_readline_init_lineno = 1; + line = buffer; + end = buffer + file_size; + while (line < end) + { + /* Find the end of this line. */ + for (i = 0; line + i != end && line[i] != '\n'; i++); + +#if defined (__CYGWIN__) + /* ``Be liberal in what you accept.'' */ + if (line[i] == '\n' && line[i-1] == '\r') + line[i - 1] = '\0'; +#endif + + /* Mark end of line. */ + line[i] = '\0'; + + /* Skip leading whitespace. */ + while (*line && whitespace (*line)) + { + line++; + i--; + } + + /* If the line is not a comment, then parse it. */ + if (*line && *line != '#') + rl_parse_and_bind (line); + + /* Move to the next line. */ + line += i + 1; + current_readline_init_lineno++; + } + + xfree (buffer); + currently_reading_init_file = 0; + return (0); +} + +static void +_rl_init_file_error (msg) + const char *msg; +{ + if (currently_reading_init_file) + _rl_errmsg ("%s: line %d: %s\n", current_readline_init_file, + current_readline_init_lineno, msg); + else + _rl_errmsg ("%s", msg); +} + +/* **************************************************************** */ +/* */ +/* Parser Directives */ +/* */ +/* **************************************************************** */ + +typedef int _rl_parser_func_t PARAMS((char *)); + +/* Things that mean `Control'. */ +const char * const _rl_possible_control_prefixes[] = { + "Control-", "C-", "CTRL-", (const char *)NULL +}; + +const char * const _rl_possible_meta_prefixes[] = { + "Meta", "M-", (const char *)NULL +}; + +/* Conditionals. */ + +/* Calling programs set this to have their argv[0]. */ +const char *rl_readline_name = "other"; + +/* Stack of previous values of parsing_conditionalized_out. */ +static unsigned char *if_stack = (unsigned char *)NULL; +static int if_stack_depth; +static int if_stack_size; + +/* Push _rl_parsing_conditionalized_out, and set parser state based + on ARGS. */ +static int +parser_if (args) + char *args; +{ + register int i; + + /* Push parser state. */ + if (if_stack_depth + 1 >= if_stack_size) + { + if (!if_stack) + if_stack = (unsigned char *)xmalloc (if_stack_size = 20); + else + if_stack = (unsigned char *)xrealloc (if_stack, if_stack_size += 20); + } + if_stack[if_stack_depth++] = _rl_parsing_conditionalized_out; + + /* If parsing is turned off, then nothing can turn it back on except + for finding the matching endif. In that case, return right now. */ + if (_rl_parsing_conditionalized_out) + return 0; + + /* Isolate first argument. */ + for (i = 0; args[i] && !whitespace (args[i]); i++); + + if (args[i]) + args[i++] = '\0'; + + /* Handle "$if term=foo" and "$if mode=emacs" constructs. If this + isn't term=foo, or mode=emacs, then check to see if the first + word in ARGS is the same as the value stored in rl_readline_name. */ + if (rl_terminal_name && _rl_strnicmp (args, "term=", 5) == 0) + { + char *tem, *tname; + + /* Terminals like "aaa-60" are equivalent to "aaa". */ + tname = savestring (rl_terminal_name); + tem = strchr (tname, '-'); + if (tem) + *tem = '\0'; + + /* Test the `long' and `short' forms of the terminal name so that + if someone has a `sun-cmd' and does not want to have bindings + that will be executed if the terminal is a `sun', they can put + `$if term=sun-cmd' into their .inputrc. */ + _rl_parsing_conditionalized_out = _rl_stricmp (args + 5, tname) && + _rl_stricmp (args + 5, rl_terminal_name); + xfree (tname); + } +#if defined (VI_MODE) + else if (_rl_strnicmp (args, "mode=", 5) == 0) + { + int mode; + + if (_rl_stricmp (args + 5, "emacs") == 0) + mode = emacs_mode; + else if (_rl_stricmp (args + 5, "vi") == 0) + mode = vi_mode; + else + mode = no_mode; + + _rl_parsing_conditionalized_out = mode != rl_editing_mode; + } +#endif /* VI_MODE */ + /* Check to see if the first word in ARGS is the same as the + value stored in rl_readline_name. */ + else if (_rl_stricmp (args, rl_readline_name) == 0) + _rl_parsing_conditionalized_out = 0; + else + _rl_parsing_conditionalized_out = 1; + return 0; +} + +/* Invert the current parser state if there is anything on the stack. */ +static int +parser_else (args) + char *args; +{ + register int i; + + if (if_stack_depth == 0) + { + _rl_init_file_error ("$else found without matching $if"); + return 0; + } + +#if 0 + /* Check the previous (n - 1) levels of the stack to make sure that + we haven't previously turned off parsing. */ + for (i = 0; i < if_stack_depth - 1; i++) +#else + /* Check the previous (n) levels of the stack to make sure that + we haven't previously turned off parsing. */ + for (i = 0; i < if_stack_depth; i++) +#endif + if (if_stack[i] == 1) + return 0; + + /* Invert the state of parsing if at top level. */ + _rl_parsing_conditionalized_out = !_rl_parsing_conditionalized_out; + return 0; +} + +/* Terminate a conditional, popping the value of + _rl_parsing_conditionalized_out from the stack. */ +static int +parser_endif (args) + char *args; +{ + if (if_stack_depth) + _rl_parsing_conditionalized_out = if_stack[--if_stack_depth]; + else + _rl_init_file_error ("$endif without matching $if"); + return 0; +} + +static int +parser_include (args) + char *args; +{ + const char *old_init_file; + char *e; + int old_line_number, old_include_level, r; + + if (_rl_parsing_conditionalized_out) + return (0); + + old_init_file = current_readline_init_file; + old_line_number = current_readline_init_lineno; + old_include_level = current_readline_init_include_level; + + e = strchr (args, '\n'); + if (e) + *e = '\0'; + r = _rl_read_init_file ((const char *)args, old_include_level + 1); + + current_readline_init_file = old_init_file; + current_readline_init_lineno = old_line_number; + current_readline_init_include_level = old_include_level; + + return r; +} + +/* Associate textual names with actual functions. */ +static const struct { + const char * const name; + _rl_parser_func_t *function; +} parser_directives [] = { + { "if", parser_if }, + { "endif", parser_endif }, + { "else", parser_else }, + { "include", parser_include }, + { (char *)0x0, (_rl_parser_func_t *)0x0 } +}; + +/* Handle a parser directive. STATEMENT is the line of the directive + without any leading `$'. */ +static int +handle_parser_directive (statement) + char *statement; +{ + register int i; + char *directive, *args; + + /* Isolate the actual directive. */ + + /* Skip whitespace. */ + for (i = 0; whitespace (statement[i]); i++); + + directive = &statement[i]; + + for (; statement[i] && !whitespace (statement[i]); i++); + + if (statement[i]) + statement[i++] = '\0'; + + for (; statement[i] && whitespace (statement[i]); i++); + + args = &statement[i]; + + /* Lookup the command, and act on it. */ + for (i = 0; parser_directives[i].name; i++) + if (_rl_stricmp (directive, parser_directives[i].name) == 0) + { + (*parser_directives[i].function) (args); + return (0); + } + + /* display an error message about the unknown parser directive */ + _rl_init_file_error ("unknown parser directive"); + return (1); +} + +/* Start at STRING[START] and look for DELIM. Return I where STRING[I] == + DELIM or STRING[I] == 0. DELIM is usually a double quote. */ +static int +_rl_skip_to_delim (string, start, delim) + char *string; + int start, delim; +{ + int i, c, passc; + + for (i = start,passc = 0; c = string[i]; i++) + { + if (passc) + { + passc = 0; + if (c == 0) + break; + continue; + } + + if (c == '\\') + { + passc = 1; + continue; + } + + if (c == delim) + break; + } + + return i; +} + +/* Read the binding command from STRING and perform it. + A key binding command looks like: Keyname: function-name\0, + a variable binding command looks like: set variable value. + A new-style keybinding looks like "\C-x\C-x": exchange-point-and-mark. */ +int +rl_parse_and_bind (string) + char *string; +{ + char *funname, *kname; + register int c, i; + int key, equivalency; + + while (string && whitespace (*string)) + string++; + + if (string == 0 || *string == 0 || *string == '#') + return 0; + + /* If this is a parser directive, act on it. */ + if (*string == '$') + { + handle_parser_directive (&string[1]); + return 0; + } + + /* If we aren't supposed to be parsing right now, then we're done. */ + if (_rl_parsing_conditionalized_out) + return 0; + + i = 0; + /* If this keyname is a complex key expression surrounded by quotes, + advance to after the matching close quote. This code allows the + backslash to quote characters in the key expression. */ + if (*string == '"') + { + i = _rl_skip_to_delim (string, 1, '"'); + + /* If we didn't find a closing quote, abort the line. */ + if (string[i] == '\0') + { + _rl_init_file_error ("no closing `\"' in key binding"); + return 1; + } + else + i++; /* skip past closing double quote */ + } + + /* Advance to the colon (:) or whitespace which separates the two objects. */ + for (; (c = string[i]) && c != ':' && c != ' ' && c != '\t'; i++ ); + + equivalency = (c == ':' && string[i + 1] == '='); + + /* Mark the end of the command (or keyname). */ + if (string[i]) + string[i++] = '\0'; + + /* If doing assignment, skip the '=' sign as well. */ + if (equivalency) + string[i++] = '\0'; + + /* If this is a command to set a variable, then do that. */ + if (_rl_stricmp (string, "set") == 0) + { + char *var, *value, *e; + int s; + + var = string + i; + /* Make VAR point to start of variable name. */ + while (*var && whitespace (*var)) var++; + + /* Make VALUE point to start of value string. */ + value = var; + while (*value && whitespace (*value) == 0) value++; + if (*value) + *value++ = '\0'; + while (*value && whitespace (*value)) value++; + + /* Strip trailing whitespace from values of boolean variables. */ + if (find_boolean_var (var) >= 0) + { + /* remove trailing whitespace */ +remove_trailing: + e = value + strlen (value) - 1; + while (e >= value && whitespace (*e)) + e--; + e++; /* skip back to whitespace or EOS */ + + if (*e && e >= value) + *e = '\0'; + } + else if ((i = find_string_var (var)) >= 0) + { + /* Allow quoted strings in variable values */ + if (*value == '"') + { + i = _rl_skip_to_delim (value, 1, *value); + value[i] = '\0'; + value++; /* skip past the quote */ + } + else + goto remove_trailing; + } + + rl_variable_bind (var, value); + return 0; + } + + /* Skip any whitespace between keyname and funname. */ + for (; string[i] && whitespace (string[i]); i++); + funname = &string[i]; + + /* Now isolate funname. + For straight function names just look for whitespace, since + that will signify the end of the string. But this could be a + macro definition. In that case, the string is quoted, so skip + to the matching delimiter. We allow the backslash to quote the + delimiter characters in the macro body. */ + /* This code exists to allow whitespace in macro expansions, which + would otherwise be gobbled up by the next `for' loop.*/ + /* XXX - it may be desirable to allow backslash quoting only if " is + the quoted string delimiter, like the shell. */ + if (*funname == '\'' || *funname == '"') + { + i = _rl_skip_to_delim (string, i+1, *funname); + if (string[i]) + i++; + } + + /* Advance to the end of the string. */ + for (; string[i] && whitespace (string[i]) == 0; i++); + + /* No extra whitespace at the end of the string. */ + string[i] = '\0'; + + /* Handle equivalency bindings here. Make the left-hand side be exactly + whatever the right-hand evaluates to, including keymaps. */ + if (equivalency) + { + return 0; + } + + /* If this is a new-style key-binding, then do the binding with + rl_bind_keyseq (). Otherwise, let the older code deal with it. */ + if (*string == '"') + { + char *seq; + register int j, k, passc; + + seq = (char *)xmalloc (1 + strlen (string)); + for (j = 1, k = passc = 0; string[j]; j++) + { + /* Allow backslash to quote characters, but leave them in place. + This allows a string to end with a backslash quoting another + backslash, or with a backslash quoting a double quote. The + backslashes are left in place for rl_translate_keyseq (). */ + if (passc || (string[j] == '\\')) + { + seq[k++] = string[j]; + passc = !passc; + continue; + } + + if (string[j] == '"') + break; + + seq[k++] = string[j]; + } + seq[k] = '\0'; + + /* Binding macro? */ + if (*funname == '\'' || *funname == '"') + { + j = strlen (funname); + + /* Remove the delimiting quotes from each end of FUNNAME. */ + if (j && funname[j - 1] == *funname) + funname[j - 1] = '\0'; + + rl_macro_bind (seq, &funname[1], _rl_keymap); + } + else + rl_bind_keyseq (seq, rl_named_function (funname)); + + xfree (seq); + return 0; + } + + /* Get the actual character we want to deal with. */ + kname = strrchr (string, '-'); + if (kname == 0) + kname = string; + else + kname++; + + key = glean_key_from_name (kname); + + /* Add in control and meta bits. */ + if (substring_member_of_array (string, _rl_possible_control_prefixes)) + key = CTRL (_rl_to_upper (key)); + + if (substring_member_of_array (string, _rl_possible_meta_prefixes)) + key = META (key); + + /* Temporary. Handle old-style keyname with macro-binding. */ + if (*funname == '\'' || *funname == '"') + { + char useq[2]; + int fl = strlen (funname); + + useq[0] = key; useq[1] = '\0'; + if (fl && funname[fl - 1] == *funname) + funname[fl - 1] = '\0'; + + rl_macro_bind (useq, &funname[1], _rl_keymap); + } +#if defined (PREFIX_META_HACK) + /* Ugly, but working hack to keep prefix-meta around. */ + else if (_rl_stricmp (funname, "prefix-meta") == 0) + { + char seq[2]; + + seq[0] = key; + seq[1] = '\0'; + rl_generic_bind (ISKMAP, seq, (char *)emacs_meta_keymap, _rl_keymap); + } +#endif /* PREFIX_META_HACK */ + else + rl_bind_key (key, rl_named_function (funname)); + return 0; +} + +/* Simple structure for boolean readline variables (i.e., those that can + have one of two values; either "On" or 1 for truth, or "Off" or 0 for + false. */ + +#define V_SPECIAL 0x1 + +static const struct { + const char * const name; + int *value; + int flags; +} boolean_varlist [] = { + { "bind-tty-special-chars", &_rl_bind_stty_chars, 0 }, + { "blink-matching-paren", &rl_blink_matching_paren, V_SPECIAL }, + { "byte-oriented", &rl_byte_oriented, 0 }, +#if defined (COLOR_SUPPORT) + { "colored-stats", &_rl_colored_stats, 0 }, +#endif + { "completion-ignore-case", &_rl_completion_case_fold, 0 }, + { "completion-map-case", &_rl_completion_case_map, 0 }, + { "convert-meta", &_rl_convert_meta_chars_to_ascii, 0 }, + { "disable-completion", &rl_inhibit_completion, 0 }, + { "echo-control-characters", &_rl_echo_control_chars, 0 }, + { "enable-keypad", &_rl_enable_keypad, 0 }, + { "enable-meta-key", &_rl_enable_meta, 0 }, + { "expand-tilde", &rl_complete_with_tilde_expansion, 0 }, + { "history-preserve-point", &_rl_history_preserve_point, 0 }, + { "horizontal-scroll-mode", &_rl_horizontal_scroll_mode, 0 }, + { "input-meta", &_rl_meta_flag, 0 }, + { "mark-directories", &_rl_complete_mark_directories, 0 }, + { "mark-modified-lines", &_rl_mark_modified_lines, 0 }, + { "mark-symlinked-directories", &_rl_complete_mark_symlink_dirs, 0 }, + { "match-hidden-files", &_rl_match_hidden_files, 0 }, + { "menu-complete-display-prefix", &_rl_menu_complete_prefix_first, 0 }, + { "meta-flag", &_rl_meta_flag, 0 }, + { "output-meta", &_rl_output_meta_chars, 0 }, + { "page-completions", &_rl_page_completions, 0 }, + { "prefer-visible-bell", &_rl_prefer_visible_bell, V_SPECIAL }, + { "print-completions-horizontally", &_rl_print_completions_horizontally, 0 }, + { "revert-all-at-newline", &_rl_revert_all_at_newline, 0 }, + { "show-all-if-ambiguous", &_rl_complete_show_all, 0 }, + { "show-all-if-unmodified", &_rl_complete_show_unmodified, 0 }, + { "show-mode-in-prompt", &_rl_show_mode_in_prompt, 0 }, + { "skip-completed-text", &_rl_skip_completed_text, 0 }, +#if defined (VISIBLE_STATS) + { "visible-stats", &rl_visible_stats, 0 }, +#endif /* VISIBLE_STATS */ + { (char *)NULL, (int *)NULL, 0 } +}; + +static int +find_boolean_var (name) + const char *name; +{ + register int i; + + for (i = 0; boolean_varlist[i].name; i++) + if (_rl_stricmp (name, boolean_varlist[i].name) == 0) + return i; + return -1; +} + +/* Hooks for handling special boolean variables, where a + function needs to be called or another variable needs + to be changed when they're changed. */ +static void +hack_special_boolean_var (i) + int i; +{ + const char *name; + + name = boolean_varlist[i].name; + + if (_rl_stricmp (name, "blink-matching-paren") == 0) + _rl_enable_paren_matching (rl_blink_matching_paren); + else if (_rl_stricmp (name, "prefer-visible-bell") == 0) + { + if (_rl_prefer_visible_bell) + _rl_bell_preference = VISIBLE_BELL; + else + _rl_bell_preference = AUDIBLE_BELL; + } + else if (_rl_stricmp (name, "show-mode-in-prompt") == 0) + _rl_reset_prompt (); +} + +typedef int _rl_sv_func_t PARAMS((const char *)); + +/* These *must* correspond to the array indices for the appropriate + string variable. (Though they're not used right now.) */ +#define V_BELLSTYLE 0 +#define V_COMBEGIN 1 +#define V_EDITMODE 2 +#define V_ISRCHTERM 3 +#define V_KEYMAP 4 + +#define V_STRING 1 +#define V_INT 2 + +/* Forward declarations */ +static int sv_bell_style PARAMS((const char *)); +static int sv_combegin PARAMS((const char *)); +static int sv_dispprefix PARAMS((const char *)); +static int sv_compquery PARAMS((const char *)); +static int sv_compwidth PARAMS((const char *)); +static int sv_editmode PARAMS((const char *)); +static int sv_histsize PARAMS((const char *)); +static int sv_isrchterm PARAMS((const char *)); +static int sv_keymap PARAMS((const char *)); +static int sv_seqtimeout PARAMS((const char *)); + +static const struct { + const char * const name; + int flags; + _rl_sv_func_t *set_func; +} string_varlist[] = { + { "bell-style", V_STRING, sv_bell_style }, + { "comment-begin", V_STRING, sv_combegin }, + { "completion-display-width", V_INT, sv_compwidth }, + { "completion-prefix-display-length", V_INT, sv_dispprefix }, + { "completion-query-items", V_INT, sv_compquery }, + { "editing-mode", V_STRING, sv_editmode }, + { "history-size", V_INT, sv_histsize }, + { "isearch-terminators", V_STRING, sv_isrchterm }, + { "keymap", V_STRING, sv_keymap }, + { "keyseq-timeout", V_INT, sv_seqtimeout }, + { (char *)NULL, 0, (_rl_sv_func_t *)0 } +}; + +static int +find_string_var (name) + const char *name; +{ + register int i; + + for (i = 0; string_varlist[i].name; i++) + if (_rl_stricmp (name, string_varlist[i].name) == 0) + return i; + return -1; +} + +/* A boolean value that can appear in a `set variable' command is true if + the value is null or empty, `on' (case-insenstive), or "1". Any other + values result in 0 (false). */ +static int +bool_to_int (value) + const char *value; +{ + return (value == 0 || *value == '\0' || + (_rl_stricmp (value, "on") == 0) || + (value[0] == '1' && value[1] == '\0')); +} + +char * +rl_variable_value (name) + const char *name; +{ + register int i; + + /* Check for simple variables first. */ + i = find_boolean_var (name); + if (i >= 0) + return (*boolean_varlist[i].value ? "on" : "off"); + + i = find_string_var (name); + if (i >= 0) + return (_rl_get_string_variable_value (string_varlist[i].name)); + + /* Unknown variable names return NULL. */ + return 0; +} + +int +rl_variable_bind (name, value) + const char *name, *value; +{ + register int i; + int v; + + /* Check for simple variables first. */ + i = find_boolean_var (name); + if (i >= 0) + { + *boolean_varlist[i].value = bool_to_int (value); + if (boolean_varlist[i].flags & V_SPECIAL) + hack_special_boolean_var (i); + return 0; + } + + i = find_string_var (name); + + /* For the time being, unknown variable names or string names without a + handler function are simply ignored. */ + if (i < 0 || string_varlist[i].set_func == 0) + return 0; + + v = (*string_varlist[i].set_func) (value); + return v; +} + +static int +sv_editmode (value) + const char *value; +{ + if (_rl_strnicmp (value, "vi", 2) == 0) + { +#if defined (VI_MODE) + _rl_keymap = vi_insertion_keymap; + rl_editing_mode = vi_mode; +#endif /* VI_MODE */ + return 0; + } + else if (_rl_strnicmp (value, "emacs", 5) == 0) + { + _rl_keymap = emacs_standard_keymap; + rl_editing_mode = emacs_mode; + return 0; + } + return 1; +} + +static int +sv_combegin (value) + const char *value; +{ + if (value && *value) + { + FREE (_rl_comment_begin); + _rl_comment_begin = savestring (value); + return 0; + } + return 1; +} + +static int +sv_dispprefix (value) + const char *value; +{ + int nval = 0; + + if (value && *value) + { + nval = atoi (value); + if (nval < 0) + nval = 0; + } + _rl_completion_prefix_display_length = nval; + return 0; +} + +static int +sv_compquery (value) + const char *value; +{ + int nval = 100; + + if (value && *value) + { + nval = atoi (value); + if (nval < 0) + nval = 0; + } + rl_completion_query_items = nval; + return 0; +} + +static int +sv_compwidth (value) + const char *value; +{ + int nval = -1; + + if (value && *value) + nval = atoi (value); + + _rl_completion_columns = nval; + return 0; +} + +static int +sv_histsize (value) + const char *value; +{ + int nval; + + nval = 500; + if (value && *value) + { + nval = atoi (value); + if (nval < 0) + { + unstifle_history (); + return 0; + } + } + stifle_history (nval); + return 0; +} + +static int +sv_keymap (value) + const char *value; +{ + Keymap kmap; + + kmap = rl_get_keymap_by_name (value); + if (kmap) + { + rl_set_keymap (kmap); + return 0; + } + return 1; +} + +static int +sv_seqtimeout (value) + const char *value; +{ + int nval; + + nval = 0; + if (value && *value) + { + nval = atoi (value); + if (nval < 0) + nval = 0; + } + _rl_keyseq_timeout = nval; + return 0; +} + +static int +sv_bell_style (value) + const char *value; +{ + if (value == 0 || *value == '\0') + _rl_bell_preference = AUDIBLE_BELL; + else if (_rl_stricmp (value, "none") == 0 || _rl_stricmp (value, "off") == 0) + _rl_bell_preference = NO_BELL; + else if (_rl_stricmp (value, "audible") == 0 || _rl_stricmp (value, "on") == 0) + _rl_bell_preference = AUDIBLE_BELL; + else if (_rl_stricmp (value, "visible") == 0) + _rl_bell_preference = VISIBLE_BELL; + else + return 1; + return 0; +} + +static int +sv_isrchterm (value) + const char *value; +{ + int beg, end, delim; + char *v; + + if (value == 0) + return 1; + + /* Isolate the value and translate it into a character string. */ + v = savestring (value); + FREE (_rl_isearch_terminators); + if (v[0] == '"' || v[0] == '\'') + { + delim = v[0]; + for (beg = end = 1; v[end] && v[end] != delim; end++) + ; + } + else + { + for (beg = end = 0; whitespace (v[end]) == 0; end++) + ; + } + + v[end] = '\0'; + + /* The value starts at v + beg. Translate it into a character string. */ + _rl_isearch_terminators = (char *)xmalloc (2 * strlen (v) + 1); + rl_translate_keyseq (v + beg, _rl_isearch_terminators, &end); + _rl_isearch_terminators[end] = '\0'; + + xfree (v); + return 0; +} + +/* Return the character which matches NAME. + For example, `Space' returns ' '. */ + +typedef struct { + const char * const name; + int value; +} assoc_list; + +static const assoc_list name_key_alist[] = { + { "DEL", 0x7f }, + { "ESC", '\033' }, + { "Escape", '\033' }, + { "LFD", '\n' }, + { "Newline", '\n' }, + { "RET", '\r' }, + { "Return", '\r' }, + { "Rubout", 0x7f }, + { "SPC", ' ' }, + { "Space", ' ' }, + { "Tab", 0x09 }, + { (char *)0x0, 0 } +}; + +static int +glean_key_from_name (name) + char *name; +{ + register int i; + + for (i = 0; name_key_alist[i].name; i++) + if (_rl_stricmp (name, name_key_alist[i].name) == 0) + return (name_key_alist[i].value); + + return (*(unsigned char *)name); /* XXX was return (*name) */ +} + +/* Auxiliary functions to manage keymaps. */ +static const struct { + const char * const name; + Keymap map; +} keymap_names[] = { + { "emacs", emacs_standard_keymap }, + { "emacs-standard", emacs_standard_keymap }, + { "emacs-meta", emacs_meta_keymap }, + { "emacs-ctlx", emacs_ctlx_keymap }, +#if defined (VI_MODE) + { "vi", vi_movement_keymap }, + { "vi-move", vi_movement_keymap }, + { "vi-command", vi_movement_keymap }, + { "vi-insert", vi_insertion_keymap }, +#endif /* VI_MODE */ + { (char *)0x0, (Keymap)0x0 } +}; + +Keymap +rl_get_keymap_by_name (name) + const char *name; +{ + register int i; + + for (i = 0; keymap_names[i].name; i++) + if (_rl_stricmp (name, keymap_names[i].name) == 0) + return (keymap_names[i].map); + return ((Keymap) NULL); +} + +char * +rl_get_keymap_name (map) + Keymap map; +{ + register int i; + for (i = 0; keymap_names[i].name; i++) + if (map == keymap_names[i].map) + return ((char *)keymap_names[i].name); + return ((char *)NULL); +} + +void +rl_set_keymap (map) + Keymap map; +{ + if (map) + _rl_keymap = map; +} + +Keymap +rl_get_keymap () +{ + return (_rl_keymap); +} + +void +rl_set_keymap_from_edit_mode () +{ + if (rl_editing_mode == emacs_mode) + _rl_keymap = emacs_standard_keymap; +#if defined (VI_MODE) + else if (rl_editing_mode == vi_mode) + _rl_keymap = vi_insertion_keymap; +#endif /* VI_MODE */ +} + +char * +rl_get_keymap_name_from_edit_mode () +{ + if (rl_editing_mode == emacs_mode) + return "emacs"; +#if defined (VI_MODE) + else if (rl_editing_mode == vi_mode) + return "vi"; +#endif /* VI_MODE */ + else + return "none"; +} + +/* **************************************************************** */ +/* */ +/* Key Binding and Function Information */ +/* */ +/* **************************************************************** */ + +/* Each of the following functions produces information about the + state of keybindings and functions known to Readline. The info + is always printed to rl_outstream, and in such a way that it can + be read back in (i.e., passed to rl_parse_and_bind ()). */ + +/* Print the names of functions known to Readline. */ +void +rl_list_funmap_names () +{ + register int i; + const char **funmap_names; + + funmap_names = rl_funmap_names (); + + if (!funmap_names) + return; + + for (i = 0; funmap_names[i]; i++) + fprintf (rl_outstream, "%s\n", funmap_names[i]); + + xfree (funmap_names); +} + +static char * +_rl_get_keyname (key) + int key; +{ + char *keyname; + int i, c; + + keyname = (char *)xmalloc (8); + + c = key; + /* Since this is going to be used to write out keysequence-function + pairs for possible inclusion in an inputrc file, we don't want to + do any special meta processing on KEY. */ + +#if 1 + /* XXX - Experimental */ + /* We might want to do this, but the old version of the code did not. */ + + /* If this is an escape character, we don't want to do any more processing. + Just add the special ESC key sequence and return. */ + if (c == ESC) + { + keyname[0] = '\\'; + keyname[1] = 'e'; + keyname[2] = '\0'; + return keyname; + } +#endif + + /* RUBOUT is translated directly into \C-? */ + if (key == RUBOUT) + { + keyname[0] = '\\'; + keyname[1] = 'C'; + keyname[2] = '-'; + keyname[3] = '?'; + keyname[4] = '\0'; + return keyname; + } + + i = 0; + /* Now add special prefixes needed for control characters. This can + potentially change C. */ + if (CTRL_CHAR (c)) + { + keyname[i++] = '\\'; + keyname[i++] = 'C'; + keyname[i++] = '-'; + c = _rl_to_lower (UNCTRL (c)); + } + + /* XXX experimental code. Turn the characters that are not ASCII or + ISO Latin 1 (128 - 159) into octal escape sequences (\200 - \237). + This changes C. */ + if (c >= 128 && c <= 159) + { + keyname[i++] = '\\'; + keyname[i++] = '2'; + c -= 128; + keyname[i++] = (c / 8) + '0'; + c = (c % 8) + '0'; + } + + /* Now, if the character needs to be quoted with a backslash, do that. */ + if (c == '\\' || c == '"') + keyname[i++] = '\\'; + + /* Now add the key, terminate the string, and return it. */ + keyname[i++] = (char) c; + keyname[i] = '\0'; + + return keyname; +} + +/* Return a NULL terminated array of strings which represent the key + sequences that are used to invoke FUNCTION in MAP. */ +char ** +rl_invoking_keyseqs_in_map (function, map) + rl_command_func_t *function; + Keymap map; +{ + register int key; + char **result; + int result_index, result_size; + + result = (char **)NULL; + result_index = result_size = 0; + + for (key = 0; key < KEYMAP_SIZE; key++) + { + switch (map[key].type) + { + case ISMACR: + /* Macros match, if, and only if, the pointers are identical. + Thus, they are treated exactly like functions in here. */ + case ISFUNC: + /* If the function in the keymap is the one we are looking for, + then add the current KEY to the list of invoking keys. */ + if (map[key].function == function) + { + char *keyname; + + keyname = _rl_get_keyname (key); + + if (result_index + 2 > result_size) + { + result_size += 10; + result = (char **)xrealloc (result, result_size * sizeof (char *)); + } + + result[result_index++] = keyname; + result[result_index] = (char *)NULL; + } + break; + + case ISKMAP: + { + char **seqs; + register int i; + + /* Find the list of keyseqs in this map which have FUNCTION as + their target. Add the key sequences found to RESULT. */ + if (map[key].function) + seqs = + rl_invoking_keyseqs_in_map (function, FUNCTION_TO_KEYMAP (map, key)); + else + break; + + if (seqs == 0) + break; + + for (i = 0; seqs[i]; i++) + { + char *keyname = (char *)xmalloc (6 + strlen (seqs[i])); + + if (key == ESC) + { + /* If ESC is the meta prefix and we're converting chars + with the eighth bit set to ESC-prefixed sequences, then + we can use \M-. Otherwise we need to use the sequence + for ESC. */ + if (_rl_convert_meta_chars_to_ascii && map[ESC].type == ISKMAP) + sprintf (keyname, "\\M-"); + else + sprintf (keyname, "\\e"); + } + else if (CTRL_CHAR (key)) + sprintf (keyname, "\\C-%c", _rl_to_lower (UNCTRL (key))); + else if (key == RUBOUT) + sprintf (keyname, "\\C-?"); + else if (key == '\\' || key == '"') + { + keyname[0] = '\\'; + keyname[1] = (char) key; + keyname[2] = '\0'; + } + else + { + keyname[0] = (char) key; + keyname[1] = '\0'; + } + + strcat (keyname, seqs[i]); + xfree (seqs[i]); + + if (result_index + 2 > result_size) + { + result_size += 10; + result = (char **)xrealloc (result, result_size * sizeof (char *)); + } + + result[result_index++] = keyname; + result[result_index] = (char *)NULL; + } + + xfree (seqs); + } + break; + } + } + return (result); +} + +/* Return a NULL terminated array of strings which represent the key + sequences that can be used to invoke FUNCTION using the current keymap. */ +char ** +rl_invoking_keyseqs (function) + rl_command_func_t *function; +{ + return (rl_invoking_keyseqs_in_map (function, _rl_keymap)); +} + +/* Print all of the functions and their bindings to rl_outstream. If + PRINT_READABLY is non-zero, then print the output in such a way + that it can be read back in. */ +void +rl_function_dumper (print_readably) + int print_readably; +{ + register int i; + const char **names; + const char *name; + + names = rl_funmap_names (); + + fprintf (rl_outstream, "\n"); + + for (i = 0; name = names[i]; i++) + { + rl_command_func_t *function; + char **invokers; + + function = rl_named_function (name); + invokers = rl_invoking_keyseqs_in_map (function, _rl_keymap); + + if (print_readably) + { + if (!invokers) + fprintf (rl_outstream, "# %s (not bound)\n", name); + else + { + register int j; + + for (j = 0; invokers[j]; j++) + { + fprintf (rl_outstream, "\"%s\": %s\n", + invokers[j], name); + xfree (invokers[j]); + } + + xfree (invokers); + } + } + else + { + if (!invokers) + fprintf (rl_outstream, "%s is not bound to any keys\n", + name); + else + { + register int j; + + fprintf (rl_outstream, "%s can be found on ", name); + + for (j = 0; invokers[j] && j < 5; j++) + { + fprintf (rl_outstream, "\"%s\"%s", invokers[j], + invokers[j + 1] ? ", " : ".\n"); + } + + if (j == 5 && invokers[j]) + fprintf (rl_outstream, "...\n"); + + for (j = 0; invokers[j]; j++) + xfree (invokers[j]); + + xfree (invokers); + } + } + } + + xfree (names); +} + +/* Print all of the current functions and their bindings to + rl_outstream. If an explicit argument is given, then print + the output in such a way that it can be read back in. */ +int +rl_dump_functions (count, key) + int count, key; +{ + if (rl_dispatching) + fprintf (rl_outstream, "\r\n"); + rl_function_dumper (rl_explicit_arg); + rl_on_new_line (); + return (0); +} + +static void +_rl_macro_dumper_internal (print_readably, map, prefix) + int print_readably; + Keymap map; + char *prefix; +{ + register int key; + char *keyname, *out; + int prefix_len; + + for (key = 0; key < KEYMAP_SIZE; key++) + { + switch (map[key].type) + { + case ISMACR: + keyname = _rl_get_keyname (key); + out = _rl_untranslate_macro_value ((char *)map[key].function, 0); + + if (print_readably) + fprintf (rl_outstream, "\"%s%s\": \"%s\"\n", prefix ? prefix : "", + keyname, + out ? out : ""); + else + fprintf (rl_outstream, "%s%s outputs %s\n", prefix ? prefix : "", + keyname, + out ? out : ""); + xfree (keyname); + xfree (out); + break; + case ISFUNC: + break; + case ISKMAP: + prefix_len = prefix ? strlen (prefix) : 0; + if (key == ESC) + { + keyname = (char *)xmalloc (3 + prefix_len); + if (prefix) + strcpy (keyname, prefix); + keyname[prefix_len] = '\\'; + keyname[prefix_len + 1] = 'e'; + keyname[prefix_len + 2] = '\0'; + } + else + { + keyname = _rl_get_keyname (key); + if (prefix) + { + out = (char *)xmalloc (strlen (keyname) + prefix_len + 1); + strcpy (out, prefix); + strcpy (out + prefix_len, keyname); + xfree (keyname); + keyname = out; + } + } + + _rl_macro_dumper_internal (print_readably, FUNCTION_TO_KEYMAP (map, key), keyname); + xfree (keyname); + break; + } + } +} + +void +rl_macro_dumper (print_readably) + int print_readably; +{ + _rl_macro_dumper_internal (print_readably, _rl_keymap, (char *)NULL); +} + +int +rl_dump_macros (count, key) + int count, key; +{ + if (rl_dispatching) + fprintf (rl_outstream, "\r\n"); + rl_macro_dumper (rl_explicit_arg); + rl_on_new_line (); + return (0); +} + +static char * +_rl_get_string_variable_value (name) + const char *name; +{ + static char numbuf[32]; + char *ret; + + if (_rl_stricmp (name, "bell-style") == 0) + { + switch (_rl_bell_preference) + { + case NO_BELL: + return "none"; + case VISIBLE_BELL: + return "visible"; + case AUDIBLE_BELL: + default: + return "audible"; + } + } + else if (_rl_stricmp (name, "comment-begin") == 0) + return (_rl_comment_begin ? _rl_comment_begin : RL_COMMENT_BEGIN_DEFAULT); + else if (_rl_stricmp (name, "completion-display-width") == 0) + { + sprintf (numbuf, "%d", _rl_completion_columns); + return (numbuf); + } + else if (_rl_stricmp (name, "completion-prefix-display-length") == 0) + { + sprintf (numbuf, "%d", _rl_completion_prefix_display_length); + return (numbuf); + } + else if (_rl_stricmp (name, "completion-query-items") == 0) + { + sprintf (numbuf, "%d", rl_completion_query_items); + return (numbuf); + } + else if (_rl_stricmp (name, "editing-mode") == 0) + return (rl_get_keymap_name_from_edit_mode ()); + else if (_rl_stricmp (name, "history-size") == 0) + { + sprintf (numbuf, "%d", history_is_stifled() ? history_max_entries : 0); + return (numbuf); + } + else if (_rl_stricmp (name, "isearch-terminators") == 0) + { + if (_rl_isearch_terminators == 0) + return 0; + ret = _rl_untranslate_macro_value (_rl_isearch_terminators, 0); + if (ret) + { + strncpy (numbuf, ret, sizeof (numbuf) - 1); + xfree (ret); + numbuf[sizeof(numbuf) - 1] = '\0'; + } + else + numbuf[0] = '\0'; + return numbuf; + } + else if (_rl_stricmp (name, "keymap") == 0) + { + ret = rl_get_keymap_name (_rl_keymap); + if (ret == 0) + ret = rl_get_keymap_name_from_edit_mode (); + return (ret ? ret : "none"); + } + else if (_rl_stricmp (name, "keyseq-timeout") == 0) + { + sprintf (numbuf, "%d", _rl_keyseq_timeout); + return (numbuf); + } + else + return (0); +} + +void +rl_variable_dumper (print_readably) + int print_readably; +{ + int i; + char *v; + + for (i = 0; boolean_varlist[i].name; i++) + { + if (print_readably) + fprintf (rl_outstream, "set %s %s\n", boolean_varlist[i].name, + *boolean_varlist[i].value ? "on" : "off"); + else + fprintf (rl_outstream, "%s is set to `%s'\n", boolean_varlist[i].name, + *boolean_varlist[i].value ? "on" : "off"); + } + + for (i = 0; string_varlist[i].name; i++) + { + v = _rl_get_string_variable_value (string_varlist[i].name); + if (v == 0) /* _rl_isearch_terminators can be NULL */ + continue; + if (print_readably) + fprintf (rl_outstream, "set %s %s\n", string_varlist[i].name, v); + else + fprintf (rl_outstream, "%s is set to `%s'\n", string_varlist[i].name, v); + } +} + +/* Print all of the current variables and their values to + rl_outstream. If an explicit argument is given, then print + the output in such a way that it can be read back in. */ +int +rl_dump_variables (count, key) + int count, key; +{ + if (rl_dispatching) + fprintf (rl_outstream, "\r\n"); + rl_variable_dumper (rl_explicit_arg); + rl_on_new_line (); + return (0); +} + +/* Return non-zero if any members of ARRAY are a substring in STRING. */ +static int +substring_member_of_array (string, array) + const char *string; + const char * const *array; +{ + while (*array) + { + if (_rl_strindex (string, *array)) + return (1); + array++; + } + return (0); +} diff --git a/lib/readline/callback.c b/lib/readline/callback.c new file mode 100644 index 0000000..6bb2c3e --- /dev/null +++ b/lib/readline/callback.c @@ -0,0 +1,293 @@ +/* callback.c -- functions to use readline as an X `callback' mechanism. */ + +/* Copyright (C) 1987-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include "rlconf.h" + +#if defined (READLINE_CALLBACKS) + +#include + +#ifdef HAVE_STDLIB_H +# include +#else +# include "ansi_stdlib.h" +#endif + +#include + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" +#include "readline.h" +#include "rlprivate.h" +#include "xmalloc.h" + +/* Private data for callback registration functions. See comments in + rl_callback_read_char for more details. */ +_rl_callback_func_t *_rl_callback_func = 0; +_rl_callback_generic_arg *_rl_callback_data = 0; + +/* **************************************************************** */ +/* */ +/* Callback Readline Functions */ +/* */ +/* **************************************************************** */ + +/* Allow using readline in situations where a program may have multiple + things to handle at once, and dispatches them via select(). Call + rl_callback_handler_install() with the prompt and a function to call + whenever a complete line of input is ready. The user must then + call rl_callback_read_char() every time some input is available, and + rl_callback_read_char() will call the user's function with the complete + text read in at each end of line. The terminal is kept prepped + all the time, except during calls to the user's function. Signal + handlers are only installed when the application calls back into + readline, so readline doesn't `steal' signals from the application. */ + +rl_vcpfunc_t *rl_linefunc; /* user callback function */ +static int in_handler; /* terminal_prepped and signals set? */ + +/* Make sure the terminal is set up, initialize readline, and prompt. */ +static void +_rl_callback_newline () +{ + rl_initialize (); + + if (in_handler == 0) + { + in_handler = 1; + + if (rl_prep_term_function) + (*rl_prep_term_function) (_rl_meta_flag); + } + + readline_internal_setup (); + RL_CHECK_SIGNALS (); +} + +/* Install a readline handler, set up the terminal, and issue the prompt. */ +void +rl_callback_handler_install (prompt, linefunc) + const char *prompt; + rl_vcpfunc_t *linefunc; +{ + rl_set_prompt (prompt); + RL_SETSTATE (RL_STATE_CALLBACK); + rl_linefunc = linefunc; + _rl_callback_newline (); +} + +#if defined (HANDLE_SIGNALS) +#define CALLBACK_READ_RETURN() \ + do { \ + rl_clear_signals (); \ + return; \ + } while (0) +#else +#define CALLBACK_READ_RETURN() return +#endif + +/* Read one character, and dispatch to the handler if it ends the line. */ +void +rl_callback_read_char () +{ + char *line; + int eof, jcode; + static procenv_t olevel; + + if (rl_linefunc == NULL) + { + _rl_errmsg ("readline_callback_read_char() called with no handler!"); + abort (); + } + + memcpy ((void *)olevel, (void *)_rl_top_level, sizeof (procenv_t)); +#if defined (HAVE_POSIX_SIGSETJMP) + jcode = sigsetjmp (_rl_top_level, 0); +#else + jcode = setjmp (_rl_top_level); +#endif + if (jcode) + { + (*rl_redisplay_function) (); + _rl_want_redisplay = 0; + memcpy ((void *)_rl_top_level, (void *)olevel, sizeof (procenv_t)); + CALLBACK_READ_RETURN (); + } + +#if defined (HANDLE_SIGNALS) + /* Install signal handlers only when readline has control. */ + rl_set_signals (); +#endif + + do + { + RL_CHECK_SIGNALS (); + if (RL_ISSTATE (RL_STATE_ISEARCH)) + { + eof = _rl_isearch_callback (_rl_iscxt); + if (eof == 0 && (RL_ISSTATE (RL_STATE_ISEARCH) == 0) && RL_ISSTATE (RL_STATE_INPUTPENDING)) + rl_callback_read_char (); + + CALLBACK_READ_RETURN (); + } + else if (RL_ISSTATE (RL_STATE_NSEARCH)) + { + eof = _rl_nsearch_callback (_rl_nscxt); + + CALLBACK_READ_RETURN (); + } +#if defined (VI_MODE) + else if (RL_ISSTATE (RL_STATE_VIMOTION)) + { + eof = _rl_vi_domove_callback (_rl_vimvcxt); + /* Should handle everything, including cleanup, numeric arguments, + and turning off RL_STATE_VIMOTION */ + if (RL_ISSTATE (RL_STATE_NUMERICARG) == 0) + _rl_internal_char_cleanup (); + + CALLBACK_READ_RETURN (); + } +#endif + else if (RL_ISSTATE (RL_STATE_NUMERICARG)) + { + eof = _rl_arg_callback (_rl_argcxt); + if (eof == 0 && (RL_ISSTATE (RL_STATE_NUMERICARG) == 0) && RL_ISSTATE (RL_STATE_INPUTPENDING)) + rl_callback_read_char (); + /* XXX - this should handle _rl_last_command_was_kill better */ + else if (RL_ISSTATE (RL_STATE_NUMERICARG) == 0) + _rl_internal_char_cleanup (); + + CALLBACK_READ_RETURN (); + } + else if (RL_ISSTATE (RL_STATE_MULTIKEY)) + { + eof = _rl_dispatch_callback (_rl_kscxt); /* For now */ + while ((eof == -1 || eof == -2) && RL_ISSTATE (RL_STATE_MULTIKEY) && _rl_kscxt && (_rl_kscxt->flags & KSEQ_DISPATCHED)) + eof = _rl_dispatch_callback (_rl_kscxt); + if (RL_ISSTATE (RL_STATE_MULTIKEY) == 0) + { + _rl_internal_char_cleanup (); + _rl_want_redisplay = 1; + } + } + else if (_rl_callback_func) + { + /* This allows functions that simply need to read an additional + character (like quoted-insert) to register a function to be + called when input is available. _rl_callback_data is a + pointer to a struct that has the argument count originally + passed to the registering function and space for any additional + parameters. */ + eof = (*_rl_callback_func) (_rl_callback_data); + /* If the function `deregisters' itself, make sure the data is + cleaned up. */ + if (_rl_callback_func == 0) + { + if (_rl_callback_data) + { + _rl_callback_data_dispose (_rl_callback_data); + _rl_callback_data = 0; + } + _rl_internal_char_cleanup (); + } + } + else + eof = readline_internal_char (); + + RL_CHECK_SIGNALS (); + if (rl_done == 0 && _rl_want_redisplay) + { + (*rl_redisplay_function) (); + _rl_want_redisplay = 0; + } + + if (rl_done) + { + line = readline_internal_teardown (eof); + + if (rl_deprep_term_function) + (*rl_deprep_term_function) (); +#if defined (HANDLE_SIGNALS) + rl_clear_signals (); +#endif + in_handler = 0; + (*rl_linefunc) (line); + + /* If the user did not clear out the line, do it for him. */ + if (rl_line_buffer[0]) + _rl_init_line_state (); + + /* Redisplay the prompt if readline_handler_{install,remove} + not called. */ + if (in_handler == 0 && rl_linefunc) + _rl_callback_newline (); + } + } + while (rl_pending_input || _rl_pushed_input_available () || RL_ISSTATE (RL_STATE_MACROINPUT)); + + CALLBACK_READ_RETURN (); +} + +/* Remove the handler, and make sure the terminal is in its normal state. */ +void +rl_callback_handler_remove () +{ + rl_linefunc = NULL; + RL_UNSETSTATE (RL_STATE_CALLBACK); + RL_CHECK_SIGNALS (); + if (in_handler) + { + in_handler = 0; + if (rl_deprep_term_function) + (*rl_deprep_term_function) (); +#if defined (HANDLE_SIGNALS) + rl_clear_signals (); +#endif + } +} + +_rl_callback_generic_arg * +_rl_callback_data_alloc (count) + int count; +{ + _rl_callback_generic_arg *arg; + + arg = (_rl_callback_generic_arg *)xmalloc (sizeof (_rl_callback_generic_arg)); + arg->count = count; + + arg->i1 = arg->i2 = 0; + + return arg; +} + +void _rl_callback_data_dispose (arg) + _rl_callback_generic_arg *arg; +{ + xfree (arg); +} + +#endif diff --git a/lib/readline/chardefs.h b/lib/readline/chardefs.h new file mode 100644 index 0000000..1fa1b08 --- /dev/null +++ b/lib/readline/chardefs.h @@ -0,0 +1,164 @@ +/* chardefs.h -- Character definitions for readline. */ + +/* Copyright (C) 1994-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#ifndef _CHARDEFS_H_ +#define _CHARDEFS_H_ + +#include + +#if defined (HAVE_CONFIG_H) +# if defined (HAVE_STRING_H) +# if ! defined (STDC_HEADERS) && defined (HAVE_MEMORY_H) +# include +# endif +# include +# endif /* HAVE_STRING_H */ +# if defined (HAVE_STRINGS_H) +# include +# endif /* HAVE_STRINGS_H */ +#else +# include +#endif /* !HAVE_CONFIG_H */ + +#ifndef whitespace +#define whitespace(c) (((c) == ' ') || ((c) == '\t')) +#endif + +#ifdef CTRL +# undef CTRL +#endif +#ifdef UNCTRL +# undef UNCTRL +#endif + +/* Some character stuff. */ +#define control_character_threshold 0x020 /* Smaller than this is control. */ +#define control_character_mask 0x1f /* 0x20 - 1 */ +#define meta_character_threshold 0x07f /* Larger than this is Meta. */ +#define control_character_bit 0x40 /* 0x000000, must be off. */ +#define meta_character_bit 0x080 /* x0000000, must be on. */ +#define largest_char 255 /* Largest character value. */ + +#define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0)) +#define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char) + +#define CTRL(c) ((c) & control_character_mask) +#define META(c) ((c) | meta_character_bit) + +#define UNMETA(c) ((c) & (~meta_character_bit)) +#define UNCTRL(c) _rl_to_upper(((c)|control_character_bit)) + +#if defined STDC_HEADERS || (!defined (isascii) && !defined (HAVE_ISASCII)) +# define IN_CTYPE_DOMAIN(c) 1 +#else +# define IN_CTYPE_DOMAIN(c) isascii(c) +#endif + +#if !defined (isxdigit) && !defined (HAVE_ISXDIGIT) && !defined (__cplusplus) +# define isxdigit(c) (isdigit((c)) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F')) +#endif + +#if defined (CTYPE_NON_ASCII) +# define NON_NEGATIVE(c) 1 +#else +# define NON_NEGATIVE(c) ((unsigned char)(c) == (c)) +#endif + +/* Some systems define these; we want our definitions. */ +#undef ISPRINT + +/* Beware: these only work with single-byte ASCII characters. */ + +#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (c)) +#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c)) +#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (c)) +#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (c)) +#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c)) +#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c)) +#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (c)) + +#define _rl_lowercase_p(c) (NON_NEGATIVE(c) && ISLOWER(c)) +#define _rl_uppercase_p(c) (NON_NEGATIVE(c) && ISUPPER(c)) +#define _rl_digit_p(c) ((c) >= '0' && (c) <= '9') + +#define _rl_pure_alphabetic(c) (NON_NEGATIVE(c) && ISALPHA(c)) +#define ALPHABETIC(c) (NON_NEGATIVE(c) && ISALNUM(c)) + +#ifndef _rl_to_upper +# define _rl_to_upper(c) (_rl_lowercase_p(c) ? toupper((unsigned char)c) : (c)) +# define _rl_to_lower(c) (_rl_uppercase_p(c) ? tolower((unsigned char)c) : (c)) +#endif + +#ifndef _rl_digit_value +# define _rl_digit_value(x) ((x) - '0') +#endif + +#ifndef _rl_isident +# define _rl_isident(c) (ISALNUM(c) || (c) == '_') +#endif + +#ifndef ISOCTAL +# define ISOCTAL(c) ((c) >= '0' && (c) <= '7') +#endif +#define OCTVALUE(c) ((c) - '0') + +#define HEXVALUE(c) \ + (((c) >= 'a' && (c) <= 'f') \ + ? (c)-'a'+10 \ + : (c) >= 'A' && (c) <= 'F' ? (c)-'A'+10 : (c)-'0') + +#ifndef NEWLINE +#define NEWLINE '\n' +#endif + +#ifndef RETURN +#define RETURN CTRL('M') +#endif + +#ifndef RUBOUT +#define RUBOUT 0x7f +#endif + +#ifndef TAB +#define TAB '\t' +#endif + +#ifdef ABORT_CHAR +#undef ABORT_CHAR +#endif +#define ABORT_CHAR CTRL('G') + +#ifdef PAGE +#undef PAGE +#endif +#define PAGE CTRL('L') + +#ifdef SPACE +#undef SPACE +#endif +#define SPACE ' ' /* XXX - was 0x20 */ + +#ifdef ESC +#undef ESC +#endif +#define ESC CTRL('[') + +#endif /* _CHARDEFS_H_ */ diff --git a/lib/readline/colors.c b/lib/readline/colors.c new file mode 100644 index 0000000..89d9035 --- /dev/null +++ b/lib/readline/colors.c @@ -0,0 +1,251 @@ +/* `dir', `vdir' and `ls' directory listing programs for GNU. + + Modified by Chet Ramey for Readline. + + Copyright (C) 1985, 1988, 1990-1991, 1995-2010, 2012 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Richard Stallman and David MacKenzie. */ + +/* Color support by Peter Anvin and Dennis + Flaherty based on original patches by + Greg Lee . */ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include "rlconf.h" + +#include + +#include "posixstat.h" // stat related macros (S_ISREG, ...) +#include // S_ISUID + +// strlen() +#if defined (HAVE_STRING_H) +# include +#else /* !HAVE_STRING_H */ +# include +#endif /* !HAVE_STRING_H */ + +// abort() +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include "readline.h" +#include "rldefs.h" + +#ifdef COLOR_SUPPORT + +#include "xmalloc.h" +#include "colors.h" + +static bool is_colored (enum indicator_no type); +static void restore_default_color (void); + +COLOR_EXT_TYPE *_rl_color_ext_list = 0; + +/* Output a color indicator (which may contain nulls). */ +void +_rl_put_indicator (const struct bin_str *ind) { + fwrite (ind->string, ind->len, 1, rl_outstream); +} + +static bool +is_colored (enum indicator_no colored_filetype) +{ + size_t len = _rl_color_indicator[colored_filetype].len; + char const *s = _rl_color_indicator[colored_filetype].string; + return ! (len == 0 + || (len == 1 && strncmp (s, "0", 1) == 0) + || (len == 2 && strncmp (s, "00", 2) == 0)); +} + +static void +restore_default_color (void) +{ + _rl_put_indicator (&_rl_color_indicator[C_LEFT]); + _rl_put_indicator (&_rl_color_indicator[C_RIGHT]); +} + +void +_rl_set_normal_color (void) +{ + if (is_colored (C_NORM)) + { + _rl_put_indicator (&_rl_color_indicator[C_LEFT]); + _rl_put_indicator (&_rl_color_indicator[C_NORM]); + _rl_put_indicator (&_rl_color_indicator[C_RIGHT]); + } +} + +/* Returns whether any color sequence was printed. */ +bool +_rl_print_color_indicator (char *f) +{ + enum indicator_no colored_filetype; + COLOR_EXT_TYPE *ext; /* Color extension */ + size_t len; /* Length of name */ + + const char* name; + char *filename; + struct stat astat; + mode_t mode; + int linkok; + + int stat_ok; + + name = f; + + /* This should already have undergone tilde expansion */ + filename = 0; + if (rl_filename_stat_hook) + { + filename = savestring (f); + (*rl_filename_stat_hook) (&filename); + name = filename; + } + +#if defined (HAVE_LSTAT) + stat_ok = lstat(name, &astat); +#else + stat_ok = stat(name, &astat); +#endif + if( stat_ok == 0 ) { + mode = astat.st_mode; + linkok = 1; //f->linkok; + } + else + linkok = -1; + + /* Is this a nonexistent file? If so, linkok == -1. */ + + if (linkok == -1 && _rl_color_indicator[C_MISSING].string != NULL) + colored_filetype = C_MISSING; + else if(stat_ok != 0) + { + static enum indicator_no filetype_indicator[] = FILETYPE_INDICATORS; + colored_filetype = filetype_indicator[normal]; //f->filetype]; + } + else + { + if (S_ISREG (mode)) + { + colored_filetype = C_FILE; + + if ((mode & S_ISUID) != 0 && is_colored (C_SETUID)) + colored_filetype = C_SETUID; + else if ((mode & S_ISGID) != 0 && is_colored (C_SETGID)) + colored_filetype = C_SETGID; + else if (is_colored (C_CAP) && 0) //f->has_capability) + colored_filetype = C_CAP; + else if ((mode & S_IXUGO) != 0 && is_colored (C_EXEC)) + colored_filetype = C_EXEC; + else if ((1 < astat.st_nlink) && is_colored (C_MULTIHARDLINK)) + colored_filetype = C_MULTIHARDLINK; + } + else if (S_ISDIR (mode)) + { + colored_filetype = C_DIR; + +#if defined (S_ISVTX) + if ((mode & S_ISVTX) && (mode & S_IWOTH) + && is_colored (C_STICKY_OTHER_WRITABLE)) + colored_filetype = C_STICKY_OTHER_WRITABLE; + else +#endif + if ((mode & S_IWOTH) != 0 && is_colored (C_OTHER_WRITABLE)) + colored_filetype = C_OTHER_WRITABLE; +#if defined (S_ISVTX) + else if ((mode & S_ISVTX) != 0 && is_colored (C_STICKY)) + colored_filetype = C_STICKY; +#endif + } + else if (S_ISLNK (mode)) + colored_filetype = ((linkok == 0 + && (!strncmp (_rl_color_indicator[C_LINK].string, "target", 6) + || _rl_color_indicator[C_ORPHAN].string)) + ? C_ORPHAN : C_LINK); + else if (S_ISFIFO (mode)) + colored_filetype = C_FIFO; + else if (S_ISSOCK (mode)) + colored_filetype = C_SOCK; + else if (S_ISBLK (mode)) + colored_filetype = C_BLK; + else if (S_ISCHR (mode)) + colored_filetype = C_CHR; + else + { + /* Classify a file of some other type as C_ORPHAN. */ + colored_filetype = C_ORPHAN; + } + } + + /* Check the file's suffix only if still classified as C_FILE. */ + ext = NULL; + if (colored_filetype == C_FILE) + { + /* Test if NAME has a recognized suffix. */ + len = strlen (name); + name += len; /* Pointer to final \0. */ + for (ext = _rl_color_ext_list; ext != NULL; ext = ext->next) + { + if (ext->ext.len <= len + && strncmp (name - ext->ext.len, ext->ext.string, + ext->ext.len) == 0) + break; + } + } + + free (filename); /* NULL or savestring return value */ + + { + const struct bin_str *const s + = ext ? &(ext->seq) : &_rl_color_indicator[colored_filetype]; + if (s->string != NULL) + { + /* Need to reset so not dealing with attribute combinations */ + if (is_colored (C_NORM)) + restore_default_color (); + _rl_put_indicator (&_rl_color_indicator[C_LEFT]); + _rl_put_indicator (s); + _rl_put_indicator (&_rl_color_indicator[C_RIGHT]); + return 0; + } + else + return 1; + } +} + +void +_rl_prep_non_filename_text (void) +{ + if (_rl_color_indicator[C_END].string != NULL) + _rl_put_indicator (&_rl_color_indicator[C_END]); + else + { + _rl_put_indicator (&_rl_color_indicator[C_LEFT]); + _rl_put_indicator (&_rl_color_indicator[C_RESET]); + _rl_put_indicator (&_rl_color_indicator[C_RIGHT]); + } +} +#endif /* COLOR_SUPPORT */ diff --git a/lib/readline/colors.h b/lib/readline/colors.h new file mode 100644 index 0000000..fc926e5 --- /dev/null +++ b/lib/readline/colors.h @@ -0,0 +1,122 @@ +/* `dir', `vdir' and `ls' directory listing programs for GNU. + + Modified by Chet Ramey for Readline. + + Copyright (C) 1985, 1988, 1990-1991, 1995-2010, 2012 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Richard Stallman and David MacKenzie. */ + +/* Color support by Peter Anvin and Dennis + Flaherty based on original patches by + Greg Lee . */ + +#ifndef _COLORS_H_ +#define _COLORS_H_ + +#include // size_t + +#if defined(__TANDEM) && defined(HAVE_STDBOOL_H) && (__STDC_VERSION__ < 199901L) +typedef int _Bool; +#endif + +#if defined (HAVE_STDBOOL_H) +# include // bool +#else +typedef int _rl_bool_t; + +#ifdef bool +# undef bool +#endif +#define bool _rl_bool_t + +#ifndef true +# define true 1 +# define false 0 +#endif + +#endif /* !HAVE_STDBOOL_H */ + +/* Null is a valid character in a color indicator (think about Epson + printers, for example) so we have to use a length/buffer string + type. */ +struct bin_str + { + size_t len; + const char *string; + }; + +/* file type indicators (dir, sock, fifo, ...) + Default value is initialized in parse-colors.c. + It is then modified from the values of $LS_COLORS. */ +extern struct bin_str _rl_color_indicator[]; + +/* The LS_COLORS variable is in a termcap-like format. */ +typedef struct _color_ext_type + { + struct bin_str ext; /* The extension we're looking for */ + struct bin_str seq; /* The sequence to output when we do */ + struct _color_ext_type *next; /* Next in list */ + } COLOR_EXT_TYPE; + +/* file extensions indicators (.txt, .log, .jpg, ...) + Values are taken from $LS_COLORS in rl_parse_colors(). */ +extern COLOR_EXT_TYPE *_rl_color_ext_list; + +#define FILETYPE_INDICATORS \ + { \ + C_ORPHAN, C_FIFO, C_CHR, C_DIR, C_BLK, C_FILE, \ + C_LINK, C_SOCK, C_FILE, C_DIR \ + } + +/* Whether we used any colors in the output so far. If so, we will + need to restore the default color later. If not, we will need to + call prep_non_filename_text before using color for the first time. */ + +enum indicator_no + { + C_LEFT, C_RIGHT, C_END, C_RESET, C_NORM, C_FILE, C_DIR, C_LINK, + C_FIFO, C_SOCK, + C_BLK, C_CHR, C_MISSING, C_ORPHAN, C_EXEC, C_DOOR, C_SETUID, C_SETGID, + C_STICKY, C_OTHER_WRITABLE, C_STICKY_OTHER_WRITABLE, C_CAP, C_MULTIHARDLINK, + C_CLR_TO_EOL + }; + + +#if !S_IXUGO +# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) +#endif + +enum filetype + { + unknown, + fifo, + chardev, + directory, + blockdev, + normal, + symbolic_link, + sock, + whiteout, + arg_directory + }; + +extern void _rl_put_indicator (const struct bin_str *ind); +extern void _rl_set_normal_color (void); +extern bool _rl_print_color_indicator (char *f); +extern void _rl_prep_non_filename_text (void); + +#endif /* !_COLORS_H_ */ diff --git a/lib/readline/compat.c b/lib/readline/compat.c new file mode 100644 index 0000000..2af5120 --- /dev/null +++ b/lib/readline/compat.c @@ -0,0 +1,113 @@ +/* compat.c -- backwards compatibility functions. */ + +/* Copyright (C) 2000-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include + +#include "rlstdc.h" +#include "rltypedefs.h" + +extern void rl_free_undo_list PARAMS((void)); +extern int rl_maybe_save_line PARAMS((void)); +extern int rl_maybe_unsave_line PARAMS((void)); +extern int rl_maybe_replace_line PARAMS((void)); + +extern int rl_crlf PARAMS((void)); +extern int rl_ding PARAMS((void)); +extern int rl_alphabetic PARAMS((int)); + +extern char **rl_completion_matches PARAMS((const char *, rl_compentry_func_t *)); +extern char *rl_username_completion_function PARAMS((const char *, int)); +extern char *rl_filename_completion_function PARAMS((const char *, int)); + +/* Provide backwards-compatible entry points for old function names. */ + +void +free_undo_list () +{ + rl_free_undo_list (); +} + +int +maybe_replace_line () +{ + return rl_maybe_replace_line (); +} + +int +maybe_save_line () +{ + return rl_maybe_save_line (); +} + +int +maybe_unsave_line () +{ + return rl_maybe_unsave_line (); +} + +int +ding () +{ + return rl_ding (); +} + +int +crlf () +{ + return rl_crlf (); +} + +int +alphabetic (c) + int c; +{ + return rl_alphabetic (c); +} + +char ** +completion_matches (s, f) + const char *s; + rl_compentry_func_t *f; +{ + return rl_completion_matches (s, f); +} + +char * +username_completion_function (s, i) + const char *s; + int i; +{ + return rl_username_completion_function (s, i); +} + +char * +filename_completion_function (s, i) + const char *s; + int i; +{ + return rl_filename_completion_function (s, i); +} diff --git a/lib/readline/complete.c b/lib/readline/complete.c new file mode 100644 index 0000000..cd9aebe --- /dev/null +++ b/lib/readline/complete.c @@ -0,0 +1,2891 @@ +/* complete.c -- filename completion for readline. */ + +/* Copyright (C) 1987-2012 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include +#include +#if defined (HAVE_SYS_FILE_H) +# include +#endif + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif /* HAVE_UNISTD_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include + +#include +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +#if defined (HAVE_PWD_H) +#include +#endif + +#include "posixdir.h" +#include "posixstat.h" + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" +#include "rlmbutil.h" + +/* Some standard library routines. */ +#include "readline.h" +#include "xmalloc.h" +#include "rlprivate.h" + +#if defined (COLOR_SUPPORT) +# include "colors.h" +#endif + +#ifdef __STDC__ +typedef int QSFUNC (const void *, const void *); +#else +typedef int QSFUNC (); +#endif + +#ifdef HAVE_LSTAT +# define LSTAT lstat +#else +# define LSTAT stat +#endif + +/* Unix version of a hidden file. Could be different on other systems. */ +#define HIDDEN_FILE(fname) ((fname)[0] == '.') + +/* Most systems don't declare getpwent in if _POSIX_SOURCE is + defined. */ +#if defined (HAVE_GETPWENT) && (!defined (HAVE_GETPW_DECLS) || defined (_POSIX_SOURCE)) +extern struct passwd *getpwent PARAMS((void)); +#endif /* HAVE_GETPWENT && (!HAVE_GETPW_DECLS || _POSIX_SOURCE) */ + +/* If non-zero, then this is the address of a function to call when + completing a word would normally display the list of possible matches. + This function is called instead of actually doing the display. + It takes three arguments: (char **matches, int num_matches, int max_length) + where MATCHES is the array of strings that matched, NUM_MATCHES is the + number of strings in that array, and MAX_LENGTH is the length of the + longest string in that array. */ +rl_compdisp_func_t *rl_completion_display_matches_hook = (rl_compdisp_func_t *)NULL; + +#if defined (VISIBLE_STATS) || defined (COLOR_SUPPORT) +# if !defined (X_OK) +# define X_OK 1 +# endif +#endif + +#if defined (VISIBLE_STATS) +static int stat_char PARAMS((char *)); +#endif + +#if defined (COLOR_SUPPORT) +static int colored_stat_start PARAMS((char *)); +static void colored_stat_end PARAMS((void)); +#endif + +static int path_isdir PARAMS((const char *)); + +static char *rl_quote_filename PARAMS((char *, int, char *)); + +static void _rl_complete_sigcleanup PARAMS((int, void *)); + +static void set_completion_defaults PARAMS((int)); +static int get_y_or_n PARAMS((int)); +static int _rl_internal_pager PARAMS((int)); +static char *printable_part PARAMS((char *)); +static int fnwidth PARAMS((const char *)); +static int fnprint PARAMS((const char *, int)); +static int print_filename PARAMS((char *, char *, int)); + +static char **gen_completion_matches PARAMS((char *, int, int, rl_compentry_func_t *, int, int)); + +static char **remove_duplicate_matches PARAMS((char **)); +static void insert_match PARAMS((char *, int, int, char *)); +static int append_to_match PARAMS((char *, int, int, int)); +static void insert_all_matches PARAMS((char **, int, char *)); +static int complete_fncmp PARAMS((const char *, int, const char *, int)); +static void display_matches PARAMS((char **)); +static int compute_lcd_of_matches PARAMS((char **, int, const char *)); +static int postprocess_matches PARAMS((char ***, int)); +static int complete_get_screenwidth PARAMS((void)); + +static char *make_quoted_replacement PARAMS((char *, int, char *)); + +/* **************************************************************** */ +/* */ +/* Completion matching, from readline's point of view. */ +/* */ +/* **************************************************************** */ + +/* Variables known only to the readline library. */ + +/* If non-zero, non-unique completions always show the list of matches. */ +int _rl_complete_show_all = 0; + +/* If non-zero, non-unique completions show the list of matches, unless it + is not possible to do partial completion and modify the line. */ +int _rl_complete_show_unmodified = 0; + +/* If non-zero, completed directory names have a slash appended. */ +int _rl_complete_mark_directories = 1; + +/* If non-zero, the symlinked directory completion behavior introduced in + readline-4.2a is disabled, and symlinks that point to directories have + a slash appended (subject to the value of _rl_complete_mark_directories). + This is user-settable via the mark-symlinked-directories variable. */ +int _rl_complete_mark_symlink_dirs = 0; + +/* If non-zero, completions are printed horizontally in alphabetical order, + like `ls -x'. */ +int _rl_print_completions_horizontally; + +/* Non-zero means that case is not significant in filename completion. */ +#if defined (__MSDOS__) && !defined (__DJGPP__) +int _rl_completion_case_fold = 1; +#else +int _rl_completion_case_fold = 0; +#endif + +/* Non-zero means that `-' and `_' are equivalent when comparing filenames + for completion. */ +int _rl_completion_case_map = 0; + +/* If zero, don't match hidden files (filenames beginning with a `.' on + Unix) when doing filename completion. */ +int _rl_match_hidden_files = 1; + +/* Length in characters of a common prefix replaced with an ellipsis (`...') + when displaying completion matches. Matches whose printable portion has + more than this number of displaying characters in common will have the common + display prefix replaced with an ellipsis. */ +int _rl_completion_prefix_display_length = 0; + +/* The readline-private number of screen columns to use when displaying + matches. If < 0 or > _rl_screenwidth, it is ignored. */ +int _rl_completion_columns = -1; + +/* Global variables available to applications using readline. */ + +#if defined (VISIBLE_STATS) +/* Non-zero means add an additional character to each filename displayed + during listing completion iff rl_filename_completion_desired which helps + to indicate the type of file being listed. */ +int rl_visible_stats = 0; +#endif /* VISIBLE_STATS */ + +#if defined (COLOR_SUPPORT) +/* Non-zero means to use colors to indicate file type when listing possible + completions. The colors used are taken from $LS_COLORS, if set. */ +int _rl_colored_stats = 0; +#endif + +/* If non-zero, when completing in the middle of a word, don't insert + characters from the match that match characters following point in + the word. This means, for instance, completing when the cursor is + after the `e' in `Makefile' won't result in `Makefilefile'. */ +int _rl_skip_completed_text = 0; + +/* If non-zero, menu completion displays the common prefix first in the + cycle of possible completions instead of the last. */ +int _rl_menu_complete_prefix_first = 0; + +/* If non-zero, then this is the address of a function to call when + completing on a directory name. The function is called with + the address of a string (the current directory name) as an arg. */ +rl_icppfunc_t *rl_directory_completion_hook = (rl_icppfunc_t *)NULL; + +rl_icppfunc_t *rl_directory_rewrite_hook = (rl_icppfunc_t *)NULL; + +rl_icppfunc_t *rl_filename_stat_hook = (rl_icppfunc_t *)NULL; + +/* If non-zero, this is the address of a function to call when reading + directory entries from the filesystem for completion and comparing + them to the partial word to be completed. The function should + either return its first argument (if no conversion takes place) or + newly-allocated memory. This can, for instance, convert filenames + between character sets for comparison against what's typed at the + keyboard. The returned value is what is added to the list of + matches. The second argument is the length of the filename to be + converted. */ +rl_dequote_func_t *rl_filename_rewrite_hook = (rl_dequote_func_t *)NULL; + +/* Non-zero means readline completion functions perform tilde expansion. */ +int rl_complete_with_tilde_expansion = 0; + +/* Pointer to the generator function for completion_matches (). + NULL means to use rl_filename_completion_function (), the default filename + completer. */ +rl_compentry_func_t *rl_completion_entry_function = (rl_compentry_func_t *)NULL; + +/* Pointer to generator function for rl_menu_complete (). NULL means to use + *rl_completion_entry_function (see above). */ +rl_compentry_func_t *rl_menu_completion_entry_function = (rl_compentry_func_t *)NULL; + +/* Pointer to alternative function to create matches. + Function is called with TEXT, START, and END. + START and END are indices in RL_LINE_BUFFER saying what the boundaries + of TEXT are. + If this function exists and returns NULL then call the value of + rl_completion_entry_function to try to match, otherwise use the + array of strings returned. */ +rl_completion_func_t *rl_attempted_completion_function = (rl_completion_func_t *)NULL; + +/* Non-zero means to suppress normal filename completion after the + user-specified completion function has been called. */ +int rl_attempted_completion_over = 0; + +/* Set to a character indicating the type of completion being performed + by rl_complete_internal, available for use by application completion + functions. */ +int rl_completion_type = 0; + +/* Up to this many items will be displayed in response to a + possible-completions call. After that, we ask the user if + she is sure she wants to see them all. A negative value means + don't ask. */ +int rl_completion_query_items = 100; + +int _rl_page_completions = 1; + +/* The basic list of characters that signal a break between words for the + completer routine. The contents of this variable is what breaks words + in the shell, i.e. " \t\n\"\\'`@$><=" */ +const char *rl_basic_word_break_characters = " \t\n\"\\'`@$><=;|&{("; /* }) */ + +/* List of basic quoting characters. */ +const char *rl_basic_quote_characters = "\"'"; + +/* The list of characters that signal a break between words for + rl_complete_internal. The default list is the contents of + rl_basic_word_break_characters. */ +/*const*/ char *rl_completer_word_break_characters = (/*const*/ char *)NULL; + +/* Hook function to allow an application to set the completion word + break characters before readline breaks up the line. Allows + position-dependent word break characters. */ +rl_cpvfunc_t *rl_completion_word_break_hook = (rl_cpvfunc_t *)NULL; + +/* List of characters which can be used to quote a substring of the line. + Completion occurs on the entire substring, and within the substring + rl_completer_word_break_characters are treated as any other character, + unless they also appear within this list. */ +const char *rl_completer_quote_characters = (const char *)NULL; + +/* List of characters that should be quoted in filenames by the completer. */ +const char *rl_filename_quote_characters = (const char *)NULL; + +/* List of characters that are word break characters, but should be left + in TEXT when it is passed to the completion function. The shell uses + this to help determine what kind of completing to do. */ +const char *rl_special_prefixes = (const char *)NULL; + +/* If non-zero, then disallow duplicates in the matches. */ +int rl_ignore_completion_duplicates = 1; + +/* Non-zero means that the results of the matches are to be treated + as filenames. This is ALWAYS zero on entry, and can only be changed + within a completion entry finder function. */ +int rl_filename_completion_desired = 0; + +/* Non-zero means that the results of the matches are to be quoted using + double quotes (or an application-specific quoting mechanism) if the + filename contains any characters in rl_filename_quote_chars. This is + ALWAYS non-zero on entry, and can only be changed within a completion + entry finder function. */ +int rl_filename_quoting_desired = 1; + +/* This function, if defined, is called by the completer when real + filename completion is done, after all the matching names have been + generated. It is passed a (char**) known as matches in the code below. + It consists of a NULL-terminated array of pointers to potential + matching strings. The 1st element (matches[0]) is the maximal + substring that is common to all matches. This function can re-arrange + the list of matches as required, but all elements of the array must be + free()'d if they are deleted. The main intent of this function is + to implement FIGNORE a la SunOS csh. */ +rl_compignore_func_t *rl_ignore_some_completions_function = (rl_compignore_func_t *)NULL; + +/* Set to a function to quote a filename in an application-specific fashion. + Called with the text to quote, the type of match found (single or multiple) + and a pointer to the quoting character to be used, which the function can + reset if desired. */ +rl_quote_func_t *rl_filename_quoting_function = rl_quote_filename; + +/* Function to call to remove quoting characters from a filename. Called + before completion is attempted, so the embedded quotes do not interfere + with matching names in the file system. Readline doesn't do anything + with this; it's set only by applications. */ +rl_dequote_func_t *rl_filename_dequoting_function = (rl_dequote_func_t *)NULL; + +/* Function to call to decide whether or not a word break character is + quoted. If a character is quoted, it does not break words for the + completer. */ +rl_linebuf_func_t *rl_char_is_quoted_p = (rl_linebuf_func_t *)NULL; + +/* If non-zero, the completion functions don't append anything except a + possible closing quote. This is set to 0 by rl_complete_internal and + may be changed by an application-specific completion function. */ +int rl_completion_suppress_append = 0; + +/* Character appended to completed words when at the end of the line. The + default is a space. */ +int rl_completion_append_character = ' '; + +/* If non-zero, the completion functions don't append any closing quote. + This is set to 0 by rl_complete_internal and may be changed by an + application-specific completion function. */ +int rl_completion_suppress_quote = 0; + +/* Set to any quote character readline thinks it finds before any application + completion function is called. */ +int rl_completion_quote_character; + +/* Set to a non-zero value if readline found quoting anywhere in the word to + be completed; set before any application completion function is called. */ +int rl_completion_found_quote; + +/* If non-zero, a slash will be appended to completed filenames that are + symbolic links to directory names, subject to the value of the + mark-directories variable (which is user-settable). This exists so + that application completion functions can override the user's preference + (set via the mark-symlinked-directories variable) if appropriate. + It's set to the value of _rl_complete_mark_symlink_dirs in + rl_complete_internal before any application-specific completion + function is called, so without that function doing anything, the user's + preferences are honored. */ +int rl_completion_mark_symlink_dirs; + +/* If non-zero, inhibit completion (temporarily). */ +int rl_inhibit_completion; + +/* Set to the last key used to invoke one of the completion functions */ +int rl_completion_invoking_key; + +/* If non-zero, sort the completion matches. On by default. */ +int rl_sort_completion_matches = 1; + +/* Variables local to this file. */ + +/* Local variable states what happened during the last completion attempt. */ +static int completion_changed_buffer; + +/* The result of the query to the user about displaying completion matches */ +static int completion_y_or_n; + +/*************************************/ +/* */ +/* Bindable completion functions */ +/* */ +/*************************************/ + +/* Complete the word at or before point. You have supplied the function + that does the initial simple matching selection algorithm (see + rl_completion_matches ()). The default is to do filename completion. */ +int +rl_complete (ignore, invoking_key) + int ignore, invoking_key; +{ + rl_completion_invoking_key = invoking_key; + + if (rl_inhibit_completion) + return (_rl_insert_char (ignore, invoking_key)); + else if (rl_last_func == rl_complete && !completion_changed_buffer) + return (rl_complete_internal ('?')); + else if (_rl_complete_show_all) + return (rl_complete_internal ('!')); + else if (_rl_complete_show_unmodified) + return (rl_complete_internal ('@')); + else + return (rl_complete_internal (TAB)); +} + +/* List the possible completions. See description of rl_complete (). */ +int +rl_possible_completions (ignore, invoking_key) + int ignore, invoking_key; +{ + rl_completion_invoking_key = invoking_key; + return (rl_complete_internal ('?')); +} + +int +rl_insert_completions (ignore, invoking_key) + int ignore, invoking_key; +{ + rl_completion_invoking_key = invoking_key; + return (rl_complete_internal ('*')); +} + +/* Return the correct value to pass to rl_complete_internal performing + the same tests as rl_complete. This allows consecutive calls to an + application's completion function to list possible completions and for + an application-specific completion function to honor the + show-all-if-ambiguous readline variable. */ +int +rl_completion_mode (cfunc) + rl_command_func_t *cfunc; +{ + if (rl_last_func == cfunc && !completion_changed_buffer) + return '?'; + else if (_rl_complete_show_all) + return '!'; + else if (_rl_complete_show_unmodified) + return '@'; + else + return TAB; +} + +/************************************/ +/* */ +/* Completion utility functions */ +/* */ +/************************************/ + +/* Reset readline state on a signal or other event. */ +void +_rl_reset_completion_state () +{ + rl_completion_found_quote = 0; + rl_completion_quote_character = 0; +} + +static void +_rl_complete_sigcleanup (sig, ptr) + int sig; + void *ptr; +{ + if (sig == SIGINT) /* XXX - for now */ + _rl_free_match_list ((char **)ptr); +} + +/* Set default values for readline word completion. These are the variables + that application completion functions can change or inspect. */ +static void +set_completion_defaults (what_to_do) + int what_to_do; +{ + /* Only the completion entry function can change these. */ + rl_filename_completion_desired = 0; + rl_filename_quoting_desired = 1; + rl_completion_type = what_to_do; + rl_completion_suppress_append = rl_completion_suppress_quote = 0; + rl_completion_append_character = ' '; + + /* The completion entry function may optionally change this. */ + rl_completion_mark_symlink_dirs = _rl_complete_mark_symlink_dirs; +} + +/* The user must press "y" or "n". Non-zero return means "y" pressed. */ +static int +get_y_or_n (for_pager) + int for_pager; +{ + int c; + + /* For now, disable pager in callback mode, until we later convert to state + driven functions. Have to wait until next major version to add new + state definition, since it will change value of RL_STATE_DONE. */ +#if defined (READLINE_CALLBACKS) + if (RL_ISSTATE (RL_STATE_CALLBACK)) + return 1; +#endif + + for (;;) + { + RL_SETSTATE(RL_STATE_MOREINPUT); + c = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + + if (c == 'y' || c == 'Y' || c == ' ') + return (1); + if (c == 'n' || c == 'N' || c == RUBOUT) + return (0); + if (c == ABORT_CHAR || c < 0) + _rl_abort_internal (); + if (for_pager && (c == NEWLINE || c == RETURN)) + return (2); + if (for_pager && (c == 'q' || c == 'Q')) + return (0); + rl_ding (); + } +} + +static int +_rl_internal_pager (lines) + int lines; +{ + int i; + + fprintf (rl_outstream, "--More--"); + fflush (rl_outstream); + i = get_y_or_n (1); + _rl_erase_entire_line (); + if (i == 0) + return -1; + else if (i == 2) + return (lines - 1); + else + return 0; +} + +static int +path_isdir (filename) + const char *filename; +{ + struct stat finfo; + + return (stat (filename, &finfo) == 0 && S_ISDIR (finfo.st_mode)); +} + +#if defined (VISIBLE_STATS) +/* Return the character which best describes FILENAME. + `@' for symbolic links + `/' for directories + `*' for executables + `=' for sockets + `|' for FIFOs + `%' for character special devices + `#' for block special devices */ +static int +stat_char (filename) + char *filename; +{ + struct stat finfo; + int character, r; + char *f; + const char *fn; + + /* Short-circuit a //server on cygwin, since that will always behave as + a directory. */ +#if __CYGWIN__ + if (filename[0] == '/' && filename[1] == '/' && strchr (filename+2, '/') == 0) + return '/'; +#endif + + f = 0; + if (rl_filename_stat_hook) + { + f = savestring (filename); + (*rl_filename_stat_hook) (&f); + fn = f; + } + else + fn = filename; + +#if defined (HAVE_LSTAT) && defined (S_ISLNK) + r = lstat (fn, &finfo); +#else + r = stat (fn, &finfo); +#endif + + if (r == -1) + return (0); + + character = 0; + if (S_ISDIR (finfo.st_mode)) + character = '/'; +#if defined (S_ISCHR) + else if (S_ISCHR (finfo.st_mode)) + character = '%'; +#endif /* S_ISCHR */ +#if defined (S_ISBLK) + else if (S_ISBLK (finfo.st_mode)) + character = '#'; +#endif /* S_ISBLK */ +#if defined (S_ISLNK) + else if (S_ISLNK (finfo.st_mode)) + character = '@'; +#endif /* S_ISLNK */ +#if defined (S_ISSOCK) + else if (S_ISSOCK (finfo.st_mode)) + character = '='; +#endif /* S_ISSOCK */ +#if defined (S_ISFIFO) + else if (S_ISFIFO (finfo.st_mode)) + character = '|'; +#endif + else if (S_ISREG (finfo.st_mode)) + { + if (access (filename, X_OK) == 0) + character = '*'; + } + + free (f); + return (character); +} +#endif /* VISIBLE_STATS */ + +#if defined (COLOR_SUPPORT) +static int +colored_stat_start (filename) + char *filename; +{ + _rl_set_normal_color (); + return (_rl_print_color_indicator (filename)); +} + +static void +colored_stat_end () +{ + _rl_prep_non_filename_text (); + _rl_put_indicator (&_rl_color_indicator[C_CLR_TO_EOL]); +} +#endif + +/* Return the portion of PATHNAME that should be output when listing + possible completions. If we are hacking filename completion, we + are only interested in the basename, the portion following the + final slash. Otherwise, we return what we were passed. Since + printing empty strings is not very informative, if we're doing + filename completion, and the basename is the empty string, we look + for the previous slash and return the portion following that. If + there's no previous slash, we just return what we were passed. */ +static char * +printable_part (pathname) + char *pathname; +{ + char *temp, *x; + + if (rl_filename_completion_desired == 0) /* don't need to do anything */ + return (pathname); + + temp = strrchr (pathname, '/'); +#if defined (__MSDOS__) + if (temp == 0 && ISALPHA ((unsigned char)pathname[0]) && pathname[1] == ':') + temp = pathname + 1; +#endif + + if (temp == 0 || *temp == '\0') + return (pathname); + /* If the basename is NULL, we might have a pathname like '/usr/src/'. + Look for a previous slash and, if one is found, return the portion + following that slash. If there's no previous slash, just return the + pathname we were passed. */ + else if (temp[1] == '\0') + { + for (x = temp - 1; x > pathname; x--) + if (*x == '/') + break; + return ((*x == '/') ? x + 1 : pathname); + } + else + return ++temp; +} + +/* Compute width of STRING when displayed on screen by print_filename */ +static int +fnwidth (string) + const char *string; +{ + int width, pos; +#if defined (HANDLE_MULTIBYTE) + mbstate_t ps; + int left, w; + size_t clen; + wchar_t wc; + + left = strlen (string) + 1; + memset (&ps, 0, sizeof (mbstate_t)); +#endif + + width = pos = 0; + while (string[pos]) + { + if (CTRL_CHAR (string[pos]) || string[pos] == RUBOUT) + { + width += 2; + pos++; + } + else + { +#if defined (HANDLE_MULTIBYTE) + clen = mbrtowc (&wc, string + pos, left - pos, &ps); + if (MB_INVALIDCH (clen)) + { + width++; + pos++; + memset (&ps, 0, sizeof (mbstate_t)); + } + else if (MB_NULLWCH (clen)) + break; + else + { + pos += clen; + w = WCWIDTH (wc); + width += (w >= 0) ? w : 1; + } +#else + width++; + pos++; +#endif + } + } + + return width; +} + +#define ELLIPSIS_LEN 3 + +static int +fnprint (to_print, prefix_bytes) + const char *to_print; + int prefix_bytes; +{ + int printed_len, w; + const char *s; +#if defined (HANDLE_MULTIBYTE) + mbstate_t ps; + const char *end; + size_t tlen; + int width; + wchar_t wc; + + end = to_print + strlen (to_print) + 1; + memset (&ps, 0, sizeof (mbstate_t)); +#endif + + printed_len = 0; + + /* Don't print only the ellipsis if the common prefix is one of the + possible completions */ + if (to_print[prefix_bytes] == '\0') + prefix_bytes = 0; + + if (prefix_bytes) + { + char ellipsis; + + ellipsis = (to_print[prefix_bytes] == '.') ? '_' : '.'; + for (w = 0; w < ELLIPSIS_LEN; w++) + putc (ellipsis, rl_outstream); + printed_len = ELLIPSIS_LEN; + } + + s = to_print + prefix_bytes; + while (*s) + { + if (CTRL_CHAR (*s)) + { + putc ('^', rl_outstream); + putc (UNCTRL (*s), rl_outstream); + printed_len += 2; + s++; +#if defined (HANDLE_MULTIBYTE) + memset (&ps, 0, sizeof (mbstate_t)); +#endif + } + else if (*s == RUBOUT) + { + putc ('^', rl_outstream); + putc ('?', rl_outstream); + printed_len += 2; + s++; +#if defined (HANDLE_MULTIBYTE) + memset (&ps, 0, sizeof (mbstate_t)); +#endif + } + else + { +#if defined (HANDLE_MULTIBYTE) + tlen = mbrtowc (&wc, s, end - s, &ps); + if (MB_INVALIDCH (tlen)) + { + tlen = 1; + width = 1; + memset (&ps, 0, sizeof (mbstate_t)); + } + else if (MB_NULLWCH (tlen)) + break; + else + { + w = WCWIDTH (wc); + width = (w >= 0) ? w : 1; + } + fwrite (s, 1, tlen, rl_outstream); + s += tlen; + printed_len += width; +#else + putc (*s, rl_outstream); + s++; + printed_len++; +#endif + } + } + + return printed_len; +} + +/* Output TO_PRINT to rl_outstream. If VISIBLE_STATS is defined and we + are using it, check for and output a single character for `special' + filenames. Return the number of characters we output. */ + +static int +print_filename (to_print, full_pathname, prefix_bytes) + char *to_print, *full_pathname; + int prefix_bytes; +{ + int printed_len, extension_char, slen, tlen; + char *s, c, *new_full_pathname, *dn; + + extension_char = 0; +#if defined (COLOR_SUPPORT) + /* Defer printing if we want to prefix with a color indicator */ + if (_rl_colored_stats == 0 || rl_filename_completion_desired == 0) +#endif + printed_len = fnprint (to_print, prefix_bytes); + + if (rl_filename_completion_desired && ( +#if defined (VISIBLE_STATS) + rl_visible_stats || +#endif +#if defined (COLOR_SUPPORT) + _rl_colored_stats || +#endif + _rl_complete_mark_directories)) + { + /* If to_print != full_pathname, to_print is the basename of the + path passed. In this case, we try to expand the directory + name before checking for the stat character. */ + if (to_print != full_pathname) + { + /* Terminate the directory name. */ + c = to_print[-1]; + to_print[-1] = '\0'; + + /* If setting the last slash in full_pathname to a NUL results in + full_pathname being the empty string, we are trying to complete + files in the root directory. If we pass a null string to the + bash directory completion hook, for example, it will expand it + to the current directory. We just want the `/'. */ + if (full_pathname == 0 || *full_pathname == 0) + dn = "/"; + else if (full_pathname[0] != '/') + dn = full_pathname; + else if (full_pathname[1] == 0) + dn = "//"; /* restore trailing slash to `//' */ + else if (full_pathname[1] == '/' && full_pathname[2] == 0) + dn = "/"; /* don't turn /// into // */ + else + dn = full_pathname; + s = tilde_expand (dn); + if (rl_directory_completion_hook) + (*rl_directory_completion_hook) (&s); + + slen = strlen (s); + tlen = strlen (to_print); + new_full_pathname = (char *)xmalloc (slen + tlen + 2); + strcpy (new_full_pathname, s); + if (s[slen - 1] == '/') + slen--; + else + new_full_pathname[slen] = '/'; + new_full_pathname[slen] = '/'; + strcpy (new_full_pathname + slen + 1, to_print); + +#if defined (VISIBLE_STATS) + if (rl_visible_stats) + extension_char = stat_char (new_full_pathname); + else +#endif + if (_rl_complete_mark_directories) + { + dn = 0; + if (rl_directory_completion_hook == 0 && rl_filename_stat_hook) + { + dn = savestring (new_full_pathname); + (*rl_filename_stat_hook) (&dn); + free (new_full_pathname); + new_full_pathname = dn; + } + if (path_isdir (new_full_pathname)) + extension_char = '/'; + } + +#if defined (COLOR_SUPPORT) + if (_rl_colored_stats) + { + colored_stat_start (new_full_pathname); + printed_len = fnprint (to_print, prefix_bytes); + colored_stat_end (); + } +#endif + + xfree (new_full_pathname); + to_print[-1] = c; + } + else + { + s = tilde_expand (full_pathname); +#if defined (VISIBLE_STATS) + if (rl_visible_stats) + extension_char = stat_char (s); + else +#endif + if (_rl_complete_mark_directories && path_isdir (s)) + extension_char = '/'; + +#if defined (COLOR_SUPPORT) + if (_rl_colored_stats) + { + colored_stat_start (s); + printed_len = fnprint (to_print, prefix_bytes); + colored_stat_end (); + } +#endif + + } + + xfree (s); + if (extension_char) + { + putc (extension_char, rl_outstream); + printed_len++; + } + } + + return printed_len; +} + +static char * +rl_quote_filename (s, rtype, qcp) + char *s; + int rtype; + char *qcp; +{ + char *r; + + r = (char *)xmalloc (strlen (s) + 2); + *r = *rl_completer_quote_characters; + strcpy (r + 1, s); + if (qcp) + *qcp = *rl_completer_quote_characters; + return r; +} + +/* Find the bounds of the current word for completion purposes, and leave + rl_point set to the end of the word. This function skips quoted + substrings (characters between matched pairs of characters in + rl_completer_quote_characters). First we try to find an unclosed + quoted substring on which to do matching. If one is not found, we use + the word break characters to find the boundaries of the current word. + We call an application-specific function to decide whether or not a + particular word break character is quoted; if that function returns a + non-zero result, the character does not break a word. This function + returns the opening quote character if we found an unclosed quoted + substring, '\0' otherwise. FP, if non-null, is set to a value saying + which (shell-like) quote characters we found (single quote, double + quote, or backslash) anywhere in the string. DP, if non-null, is set to + the value of the delimiter character that caused a word break. */ + +char +_rl_find_completion_word (fp, dp) + int *fp, *dp; +{ + int scan, end, found_quote, delimiter, pass_next, isbrk; + char quote_char, *brkchars; + + end = rl_point; + found_quote = delimiter = 0; + quote_char = '\0'; + + brkchars = 0; + if (rl_completion_word_break_hook) + brkchars = (*rl_completion_word_break_hook) (); + if (brkchars == 0) + brkchars = rl_completer_word_break_characters; + + if (rl_completer_quote_characters) + { + /* We have a list of characters which can be used in pairs to + quote substrings for the completer. Try to find the start + of an unclosed quoted substring. */ + /* FOUND_QUOTE is set so we know what kind of quotes we found. */ + for (scan = pass_next = 0; scan < end; scan = MB_NEXTCHAR (rl_line_buffer, scan, 1, MB_FIND_ANY)) + { + if (pass_next) + { + pass_next = 0; + continue; + } + + /* Shell-like semantics for single quotes -- don't allow backslash + to quote anything in single quotes, especially not the closing + quote. If you don't like this, take out the check on the value + of quote_char. */ + if (quote_char != '\'' && rl_line_buffer[scan] == '\\') + { + pass_next = 1; + found_quote |= RL_QF_BACKSLASH; + continue; + } + + if (quote_char != '\0') + { + /* Ignore everything until the matching close quote char. */ + if (rl_line_buffer[scan] == quote_char) + { + /* Found matching close. Abandon this substring. */ + quote_char = '\0'; + rl_point = end; + } + } + else if (strchr (rl_completer_quote_characters, rl_line_buffer[scan])) + { + /* Found start of a quoted substring. */ + quote_char = rl_line_buffer[scan]; + rl_point = scan + 1; + /* Shell-like quoting conventions. */ + if (quote_char == '\'') + found_quote |= RL_QF_SINGLE_QUOTE; + else if (quote_char == '"') + found_quote |= RL_QF_DOUBLE_QUOTE; + else + found_quote |= RL_QF_OTHER_QUOTE; + } + } + } + + if (rl_point == end && quote_char == '\0') + { + /* We didn't find an unclosed quoted substring upon which to do + completion, so use the word break characters to find the + substring on which to complete. */ + while (rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY)) + { + scan = rl_line_buffer[rl_point]; + + if (strchr (brkchars, scan) == 0) + continue; + + /* Call the application-specific function to tell us whether + this word break character is quoted and should be skipped. */ + if (rl_char_is_quoted_p && found_quote && + (*rl_char_is_quoted_p) (rl_line_buffer, rl_point)) + continue; + + /* Convoluted code, but it avoids an n^2 algorithm with calls + to char_is_quoted. */ + break; + } + } + + /* If we are at an unquoted word break, then advance past it. */ + scan = rl_line_buffer[rl_point]; + + /* If there is an application-specific function to say whether or not + a character is quoted and we found a quote character, let that + function decide whether or not a character is a word break, even + if it is found in rl_completer_word_break_characters. Don't bother + if we're at the end of the line, though. */ + if (scan) + { + if (rl_char_is_quoted_p) + isbrk = (found_quote == 0 || + (*rl_char_is_quoted_p) (rl_line_buffer, rl_point) == 0) && + strchr (brkchars, scan) != 0; + else + isbrk = strchr (brkchars, scan) != 0; + + if (isbrk) + { + /* If the character that caused the word break was a quoting + character, then remember it as the delimiter. */ + if (rl_basic_quote_characters && + strchr (rl_basic_quote_characters, scan) && + (end - rl_point) > 1) + delimiter = scan; + + /* If the character isn't needed to determine something special + about what kind of completion to perform, then advance past it. */ + if (rl_special_prefixes == 0 || strchr (rl_special_prefixes, scan) == 0) + rl_point++; + } + } + + if (fp) + *fp = found_quote; + if (dp) + *dp = delimiter; + + return (quote_char); +} + +static char ** +gen_completion_matches (text, start, end, our_func, found_quote, quote_char) + char *text; + int start, end; + rl_compentry_func_t *our_func; + int found_quote, quote_char; +{ + char **matches; + + rl_completion_found_quote = found_quote; + rl_completion_quote_character = quote_char; + + /* If the user wants to TRY to complete, but then wants to give + up and use the default completion function, they set the + variable rl_attempted_completion_function. */ + if (rl_attempted_completion_function) + { + matches = (*rl_attempted_completion_function) (text, start, end); + if (RL_SIG_RECEIVED()) + { + _rl_free_match_list (matches); + matches = 0; + RL_CHECK_SIGNALS (); + } + + if (matches || rl_attempted_completion_over) + { + rl_attempted_completion_over = 0; + return (matches); + } + } + + /* XXX -- filename dequoting moved into rl_filename_completion_function */ + + /* rl_completion_matches will check for signals as well to avoid a long + delay while reading a directory. */ + matches = rl_completion_matches (text, our_func); + if (RL_SIG_RECEIVED()) + { + _rl_free_match_list (matches); + matches = 0; + RL_CHECK_SIGNALS (); + } + return matches; +} + +/* Filter out duplicates in MATCHES. This frees up the strings in + MATCHES. */ +static char ** +remove_duplicate_matches (matches) + char **matches; +{ + char *lowest_common; + int i, j, newlen; + char dead_slot; + char **temp_array; + + /* Sort the items. */ + for (i = 0; matches[i]; i++) + ; + + /* Sort the array without matches[0], since we need it to + stay in place no matter what. */ + if (i && rl_sort_completion_matches) + qsort (matches+1, i-1, sizeof (char *), (QSFUNC *)_rl_qsort_string_compare); + + /* Remember the lowest common denominator for it may be unique. */ + lowest_common = savestring (matches[0]); + + for (i = newlen = 0; matches[i + 1]; i++) + { + if (strcmp (matches[i], matches[i + 1]) == 0) + { + xfree (matches[i]); + matches[i] = (char *)&dead_slot; + } + else + newlen++; + } + + /* We have marked all the dead slots with (char *)&dead_slot. + Copy all the non-dead entries into a new array. */ + temp_array = (char **)xmalloc ((3 + newlen) * sizeof (char *)); + for (i = j = 1; matches[i]; i++) + { + if (matches[i] != (char *)&dead_slot) + temp_array[j++] = matches[i]; + } + temp_array[j] = (char *)NULL; + + if (matches[0] != (char *)&dead_slot) + xfree (matches[0]); + + /* Place the lowest common denominator back in [0]. */ + temp_array[0] = lowest_common; + + /* If there is one string left, and it is identical to the + lowest common denominator, then the LCD is the string to + insert. */ + if (j == 2 && strcmp (temp_array[0], temp_array[1]) == 0) + { + xfree (temp_array[1]); + temp_array[1] = (char *)NULL; + } + return (temp_array); +} + +/* Find the common prefix of the list of matches, and put it into + matches[0]. */ +static int +compute_lcd_of_matches (match_list, matches, text) + char **match_list; + int matches; + const char *text; +{ + register int i, c1, c2, si; + int low; /* Count of max-matched characters. */ + int lx; + char *dtext; /* dequoted TEXT, if needed */ +#if defined (HANDLE_MULTIBYTE) + int v; + size_t v1, v2; + mbstate_t ps1, ps2; + wchar_t wc1, wc2; +#endif + + /* If only one match, just use that. Otherwise, compare each + member of the list with the next, finding out where they + stop matching. */ + if (matches == 1) + { + match_list[0] = match_list[1]; + match_list[1] = (char *)NULL; + return 1; + } + + for (i = 1, low = 100000; i < matches; i++) + { +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + memset (&ps1, 0, sizeof (mbstate_t)); + memset (&ps2, 0, sizeof (mbstate_t)); + } +#endif + if (_rl_completion_case_fold) + { + for (si = 0; + (c1 = _rl_to_lower(match_list[i][si])) && + (c2 = _rl_to_lower(match_list[i + 1][si])); + si++) +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + v1 = mbrtowc(&wc1, match_list[i]+si, strlen (match_list[i]+si), &ps1); + v2 = mbrtowc (&wc2, match_list[i+1]+si, strlen (match_list[i+1]+si), &ps2); + if (MB_INVALIDCH (v1) || MB_INVALIDCH (v2)) + { + if (c1 != c2) /* do byte comparison */ + break; + continue; + } + wc1 = towlower (wc1); + wc2 = towlower (wc2); + if (wc1 != wc2) + break; + else if (v1 > 1) + si += v1 - 1; + } + else +#endif + if (c1 != c2) + break; + } + else + { + for (si = 0; + (c1 = match_list[i][si]) && + (c2 = match_list[i + 1][si]); + si++) +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + mbstate_t ps_back; + ps_back = ps1; + if (!_rl_compare_chars (match_list[i], si, &ps1, match_list[i+1], si, &ps2)) + break; + else if ((v = _rl_get_char_len (&match_list[i][si], &ps_back)) > 1) + si += v - 1; + } + else +#endif + if (c1 != c2) + break; + } + + if (low > si) + low = si; + } + + /* If there were multiple matches, but none matched up to even the + first character, and the user typed something, use that as the + value of matches[0]. */ + if (low == 0 && text && *text) + { + match_list[0] = (char *)xmalloc (strlen (text) + 1); + strcpy (match_list[0], text); + } + else + { + match_list[0] = (char *)xmalloc (low + 1); + + /* XXX - this might need changes in the presence of multibyte chars */ + + /* If we are ignoring case, try to preserve the case of the string + the user typed in the face of multiple matches differing in case. */ + if (_rl_completion_case_fold) + { + /* We're making an assumption here: + IF we're completing filenames AND + the application has defined a filename dequoting function AND + we found a quote character AND + the application has requested filename quoting + THEN + we assume that TEXT was dequoted before checking against + the file system and needs to be dequoted here before we + check against the list of matches + FI */ + dtext = (char *)NULL; + if (rl_filename_completion_desired && + rl_filename_dequoting_function && + rl_completion_found_quote && + rl_filename_quoting_desired) + { + dtext = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character); + text = dtext; + } + + /* sort the list to get consistent answers. */ + qsort (match_list+1, matches, sizeof(char *), (QSFUNC *)_rl_qsort_string_compare); + + si = strlen (text); + lx = (si <= low) ? si : low; /* check shorter of text and matches */ + /* Try to preserve the case of what the user typed in the presence of + multiple matches: check each match for something that matches + what the user typed taking case into account; use it up to common + length of matches if one is found. If not, just use first match. */ + for (i = 1; i <= matches; i++) + if (strncmp (match_list[i], text, lx) == 0) + { + strncpy (match_list[0], match_list[i], low); + break; + } + /* no casematch, use first entry */ + if (i > matches) + strncpy (match_list[0], match_list[1], low); + + FREE (dtext); + } + else + strncpy (match_list[0], match_list[1], low); + + match_list[0][low] = '\0'; + } + + return matches; +} + +static int +postprocess_matches (matchesp, matching_filenames) + char ***matchesp; + int matching_filenames; +{ + char *t, **matches, **temp_matches; + int nmatch, i; + + matches = *matchesp; + + if (matches == 0) + return 0; + + /* It seems to me that in all the cases we handle we would like + to ignore duplicate possibilities. Scan for the text to + insert being identical to the other completions. */ + if (rl_ignore_completion_duplicates) + { + temp_matches = remove_duplicate_matches (matches); + xfree (matches); + matches = temp_matches; + } + + /* If we are matching filenames, then here is our chance to + do clever processing by re-examining the list. Call the + ignore function with the array as a parameter. It can + munge the array, deleting matches as it desires. */ + if (rl_ignore_some_completions_function && matching_filenames) + { + for (nmatch = 1; matches[nmatch]; nmatch++) + ; + (void)(*rl_ignore_some_completions_function) (matches); + if (matches == 0 || matches[0] == 0) + { + FREE (matches); + *matchesp = (char **)0; + return 0; + } + else + { + /* If we removed some matches, recompute the common prefix. */ + for (i = 1; matches[i]; i++) + ; + if (i > 1 && i < nmatch) + { + t = matches[0]; + compute_lcd_of_matches (matches, i - 1, t); + FREE (t); + } + } + } + + *matchesp = matches; + return (1); +} + +static int +complete_get_screenwidth () +{ + int cols; + char *envcols; + + cols = _rl_completion_columns; + if (cols >= 0 && cols <= _rl_screenwidth) + return cols; + envcols = getenv ("COLUMNS"); + if (envcols && *envcols) + cols = atoi (envcols); + if (cols >= 0 && cols <= _rl_screenwidth) + return cols; + return _rl_screenwidth; +} + +/* A convenience function for displaying a list of strings in + columnar format on readline's output stream. MATCHES is the list + of strings, in argv format, LEN is the number of strings in MATCHES, + and MAX is the length of the longest string in MATCHES. */ +void +rl_display_match_list (matches, len, max) + char **matches; + int len, max; +{ + int count, limit, printed_len, lines, cols; + int i, j, k, l, common_length, sind; + char *temp, *t; + + /* Find the length of the prefix common to all items: length as displayed + characters (common_length) and as a byte index into the matches (sind) */ + common_length = sind = 0; + if (_rl_completion_prefix_display_length > 0) + { + t = printable_part (matches[0]); + temp = strrchr (t, '/'); + common_length = temp ? fnwidth (temp) : fnwidth (t); + sind = temp ? strlen (temp) : strlen (t); + + if (common_length > _rl_completion_prefix_display_length && common_length > ELLIPSIS_LEN) + max -= common_length - ELLIPSIS_LEN; + else + common_length = sind = 0; + } + + /* How many items of MAX length can we fit in the screen window? */ + cols = complete_get_screenwidth (); + max += 2; + limit = cols / max; + if (limit != 1 && (limit * max == cols)) + limit--; + + /* If cols == 0, limit will end up -1 */ + if (cols < _rl_screenwidth && limit < 0) + limit = 1; + + /* Avoid a possible floating exception. If max > cols, + limit will be 0 and a divide-by-zero fault will result. */ + if (limit == 0) + limit = 1; + + /* How many iterations of the printing loop? */ + count = (len + (limit - 1)) / limit; + + /* Watch out for special case. If LEN is less than LIMIT, then + just do the inner printing loop. + 0 < len <= limit implies count = 1. */ + + /* Sort the items if they are not already sorted. */ + if (rl_ignore_completion_duplicates == 0 && rl_sort_completion_matches) + qsort (matches + 1, len, sizeof (char *), (QSFUNC *)_rl_qsort_string_compare); + + rl_crlf (); + + lines = 0; + if (_rl_print_completions_horizontally == 0) + { + /* Print the sorted items, up-and-down alphabetically, like ls. */ + for (i = 1; i <= count; i++) + { + for (j = 0, l = i; j < limit; j++) + { + if (l > len || matches[l] == 0) + break; + else + { + temp = printable_part (matches[l]); + printed_len = print_filename (temp, matches[l], sind); + + if (j + 1 < limit) + for (k = 0; k < max - printed_len; k++) + putc (' ', rl_outstream); + } + l += count; + } + rl_crlf (); + lines++; + if (_rl_page_completions && lines >= (_rl_screenheight - 1) && i < count) + { + lines = _rl_internal_pager (lines); + if (lines < 0) + return; + } + } + } + else + { + /* Print the sorted items, across alphabetically, like ls -x. */ + for (i = 1; matches[i]; i++) + { + temp = printable_part (matches[i]); + printed_len = print_filename (temp, matches[i], sind); + /* Have we reached the end of this line? */ + if (matches[i+1]) + { + if (limit == 1 || (i && (limit > 1) && (i % limit) == 0)) + { + rl_crlf (); + lines++; + if (_rl_page_completions && lines >= _rl_screenheight - 1) + { + lines = _rl_internal_pager (lines); + if (lines < 0) + return; + } + } + else + for (k = 0; k < max - printed_len; k++) + putc (' ', rl_outstream); + } + } + rl_crlf (); + } +} + +/* Display MATCHES, a list of matching filenames in argv format. This + handles the simple case -- a single match -- first. If there is more + than one match, we compute the number of strings in the list and the + length of the longest string, which will be needed by the display + function. If the application wants to handle displaying the list of + matches itself, it sets RL_COMPLETION_DISPLAY_MATCHES_HOOK to the + address of a function, and we just call it. If we're handling the + display ourselves, we just call rl_display_match_list. We also check + that the list of matches doesn't exceed the user-settable threshold, + and ask the user if he wants to see the list if there are more matches + than RL_COMPLETION_QUERY_ITEMS. */ +static void +display_matches (matches) + char **matches; +{ + int len, max, i; + char *temp; + + /* Move to the last visible line of a possibly-multiple-line command. */ + _rl_move_vert (_rl_vis_botlin); + + /* Handle simple case first. What if there is only one answer? */ + if (matches[1] == 0) + { + temp = printable_part (matches[0]); + rl_crlf (); + print_filename (temp, matches[0], 0); + rl_crlf (); + + rl_forced_update_display (); + rl_display_fixed = 1; + + return; + } + + /* There is more than one answer. Find out how many there are, + and find the maximum printed length of a single entry. */ + for (max = 0, i = 1; matches[i]; i++) + { + temp = printable_part (matches[i]); + len = fnwidth (temp); + + if (len > max) + max = len; + } + + len = i - 1; + + /* If the caller has defined a display hook, then call that now. */ + if (rl_completion_display_matches_hook) + { + (*rl_completion_display_matches_hook) (matches, len, max); + return; + } + + /* If there are many items, then ask the user if she really wants to + see them all. */ + if (rl_completion_query_items > 0 && len >= rl_completion_query_items) + { + rl_crlf (); + fprintf (rl_outstream, "Display all %d possibilities? (y or n)", len); + fflush (rl_outstream); + if ((completion_y_or_n = get_y_or_n (0)) == 0) + { + rl_crlf (); + + rl_forced_update_display (); + rl_display_fixed = 1; + + return; + } + } + + rl_display_match_list (matches, len, max); + + rl_forced_update_display (); + rl_display_fixed = 1; +} + +static char * +make_quoted_replacement (match, mtype, qc) + char *match; + int mtype; + char *qc; /* Pointer to quoting character, if any */ +{ + int should_quote, do_replace; + char *replacement; + + /* If we are doing completion on quoted substrings, and any matches + contain any of the completer_word_break_characters, then auto- + matically prepend the substring with a quote character (just pick + the first one from the list of such) if it does not already begin + with a quote string. FIXME: Need to remove any such automatically + inserted quote character when it no longer is necessary, such as + if we change the string we are completing on and the new set of + matches don't require a quoted substring. */ + replacement = match; + + should_quote = match && rl_completer_quote_characters && + rl_filename_completion_desired && + rl_filename_quoting_desired; + + if (should_quote) + should_quote = should_quote && (!qc || !*qc || + (rl_completer_quote_characters && strchr (rl_completer_quote_characters, *qc))); + + if (should_quote) + { + /* If there is a single match, see if we need to quote it. + This also checks whether the common prefix of several + matches needs to be quoted. */ + should_quote = rl_filename_quote_characters + ? (_rl_strpbrk (match, rl_filename_quote_characters) != 0) + : 0; + + do_replace = should_quote ? mtype : NO_MATCH; + /* Quote the replacement, since we found an embedded + word break character in a potential match. */ + if (do_replace != NO_MATCH && rl_filename_quoting_function) + replacement = (*rl_filename_quoting_function) (match, do_replace, qc); + } + return (replacement); +} + +static void +insert_match (match, start, mtype, qc) + char *match; + int start, mtype; + char *qc; +{ + char *replacement, *r; + char oqc; + int end, rlen; + + oqc = qc ? *qc : '\0'; + replacement = make_quoted_replacement (match, mtype, qc); + + /* Now insert the match. */ + if (replacement) + { + rlen = strlen (replacement); + /* Don't double an opening quote character. */ + if (qc && *qc && start && rl_line_buffer[start - 1] == *qc && + replacement[0] == *qc) + start--; + /* If make_quoted_replacement changed the quoting character, remove + the opening quote and insert the (fully-quoted) replacement. */ + else if (qc && (*qc != oqc) && start && rl_line_buffer[start - 1] == oqc && + replacement[0] != oqc) + start--; + end = rl_point - 1; + /* Don't double a closing quote character */ + if (qc && *qc && end && rl_line_buffer[rl_point] == *qc && replacement[rlen - 1] == *qc) + end++; + if (_rl_skip_completed_text) + { + r = replacement; + while (start < rl_end && *r && rl_line_buffer[start] == *r) + { + start++; + r++; + } + if (start <= end || *r) + _rl_replace_text (r, start, end); + rl_point = start + strlen (r); + } + else + _rl_replace_text (replacement, start, end); + if (replacement != match) + xfree (replacement); + } +} + +/* Append any necessary closing quote and a separator character to the + just-inserted match. If the user has specified that directories + should be marked by a trailing `/', append one of those instead. The + default trailing character is a space. Returns the number of characters + appended. If NONTRIVIAL_MATCH is set, we test for a symlink (if the OS + has them) and don't add a suffix for a symlink to a directory. A + nontrivial match is one that actually adds to the word being completed. + The variable rl_completion_mark_symlink_dirs controls this behavior + (it's initially set to the what the user has chosen, indicated by the + value of _rl_complete_mark_symlink_dirs, but may be modified by an + application's completion function). */ +static int +append_to_match (text, delimiter, quote_char, nontrivial_match) + char *text; + int delimiter, quote_char, nontrivial_match; +{ + char temp_string[4], *filename, *fn; + int temp_string_index, s; + struct stat finfo; + + temp_string_index = 0; + if (quote_char && rl_point && rl_completion_suppress_quote == 0 && + rl_line_buffer[rl_point - 1] != quote_char) + temp_string[temp_string_index++] = quote_char; + + if (delimiter) + temp_string[temp_string_index++] = delimiter; + else if (rl_completion_suppress_append == 0 && rl_completion_append_character) + temp_string[temp_string_index++] = rl_completion_append_character; + + temp_string[temp_string_index++] = '\0'; + + if (rl_filename_completion_desired) + { + filename = tilde_expand (text); + if (rl_filename_stat_hook) + { + fn = savestring (filename); + (*rl_filename_stat_hook) (&fn); + xfree (filename); + filename = fn; + } + s = (nontrivial_match && rl_completion_mark_symlink_dirs == 0) + ? LSTAT (filename, &finfo) + : stat (filename, &finfo); + if (s == 0 && S_ISDIR (finfo.st_mode)) + { + if (_rl_complete_mark_directories /* && rl_completion_suppress_append == 0 */) + { + /* This is clumsy. Avoid putting in a double slash if point + is at the end of the line and the previous character is a + slash. */ + if (rl_point && rl_line_buffer[rl_point] == '\0' && rl_line_buffer[rl_point - 1] == '/') + ; + else if (rl_line_buffer[rl_point] != '/') + rl_insert_text ("/"); + } + } +#ifdef S_ISLNK + /* Don't add anything if the filename is a symlink and resolves to a + directory. */ + else if (s == 0 && S_ISLNK (finfo.st_mode) && path_isdir (filename)) + ; +#endif + else + { + if (rl_point == rl_end && temp_string_index) + rl_insert_text (temp_string); + } + xfree (filename); + } + else + { + if (rl_point == rl_end && temp_string_index) + rl_insert_text (temp_string); + } + + return (temp_string_index); +} + +static void +insert_all_matches (matches, point, qc) + char **matches; + int point; + char *qc; +{ + int i; + char *rp; + + rl_begin_undo_group (); + /* remove any opening quote character; make_quoted_replacement will add + it back. */ + if (qc && *qc && point && rl_line_buffer[point - 1] == *qc) + point--; + rl_delete_text (point, rl_point); + rl_point = point; + + if (matches[1]) + { + for (i = 1; matches[i]; i++) + { + rp = make_quoted_replacement (matches[i], SINGLE_MATCH, qc); + rl_insert_text (rp); + rl_insert_text (" "); + if (rp != matches[i]) + xfree (rp); + } + } + else + { + rp = make_quoted_replacement (matches[0], SINGLE_MATCH, qc); + rl_insert_text (rp); + rl_insert_text (" "); + if (rp != matches[0]) + xfree (rp); + } + rl_end_undo_group (); +} + +void +_rl_free_match_list (matches) + char **matches; +{ + register int i; + + if (matches == 0) + return; + + for (i = 0; matches[i]; i++) + xfree (matches[i]); + xfree (matches); +} + +/* Complete the word at or before point. + WHAT_TO_DO says what to do with the completion. + `?' means list the possible completions. + TAB means do standard completion. + `*' means insert all of the possible completions. + `!' means to do standard completion, and list all possible completions if + there is more than one. + `@' means to do standard completion, and list all possible completions if + there is more than one and partial completion is not possible. */ +int +rl_complete_internal (what_to_do) + int what_to_do; +{ + char **matches; + rl_compentry_func_t *our_func; + int start, end, delimiter, found_quote, i, nontrivial_lcd; + char *text, *saved_line_buffer; + char quote_char; +#if 1 + int tlen, mlen; +#endif + + RL_SETSTATE(RL_STATE_COMPLETING); + + set_completion_defaults (what_to_do); + + saved_line_buffer = rl_line_buffer ? savestring (rl_line_buffer) : (char *)NULL; + our_func = rl_completion_entry_function + ? rl_completion_entry_function + : rl_filename_completion_function; + /* We now look backwards for the start of a filename/variable word. */ + end = rl_point; + found_quote = delimiter = 0; + quote_char = '\0'; + + if (rl_point) + /* This (possibly) changes rl_point. If it returns a non-zero char, + we know we have an open quote. */ + quote_char = _rl_find_completion_word (&found_quote, &delimiter); + + start = rl_point; + rl_point = end; + + text = rl_copy_text (start, end); + matches = gen_completion_matches (text, start, end, our_func, found_quote, quote_char); + /* nontrivial_lcd is set if the common prefix adds something to the word + being completed. */ + nontrivial_lcd = matches && strcmp (text, matches[0]) != 0; + if (what_to_do == '!' || what_to_do == '@') + tlen = strlen (text); + xfree (text); + + if (matches == 0) + { + rl_ding (); + FREE (saved_line_buffer); + completion_changed_buffer = 0; + RL_UNSETSTATE(RL_STATE_COMPLETING); + _rl_reset_completion_state (); + return (0); + } + + /* If we are matching filenames, the attempted completion function will + have set rl_filename_completion_desired to a non-zero value. The basic + rl_filename_completion_function does this. */ + i = rl_filename_completion_desired; + + if (postprocess_matches (&matches, i) == 0) + { + rl_ding (); + FREE (saved_line_buffer); + completion_changed_buffer = 0; + RL_UNSETSTATE(RL_STATE_COMPLETING); + _rl_reset_completion_state (); + return (0); + } + + switch (what_to_do) + { + case TAB: + case '!': + case '@': + /* Insert the first match with proper quoting. */ + if (what_to_do == TAB) + { + if (*matches[0]) + insert_match (matches[0], start, matches[1] ? MULT_MATCH : SINGLE_MATCH, "e_char); + } + else if (*matches[0] && matches[1] == 0) + /* should we perform the check only if there are multiple matches? */ + insert_match (matches[0], start, matches[1] ? MULT_MATCH : SINGLE_MATCH, "e_char); + else if (*matches[0]) /* what_to_do != TAB && multiple matches */ + { + mlen = *matches[0] ? strlen (matches[0]) : 0; + if (mlen >= tlen) + insert_match (matches[0], start, matches[1] ? MULT_MATCH : SINGLE_MATCH, "e_char); + } + + /* If there are more matches, ring the bell to indicate. + If we are in vi mode, Posix.2 says to not ring the bell. + If the `show-all-if-ambiguous' variable is set, display + all the matches immediately. Otherwise, if this was the + only match, and we are hacking files, check the file to + see if it was a directory. If so, and the `mark-directories' + variable is set, add a '/' to the name. If not, and we + are at the end of the line, then add a space. */ + if (matches[1]) + { + if (what_to_do == '!') + { + display_matches (matches); + break; + } + else if (what_to_do == '@') + { + if (nontrivial_lcd == 0) + display_matches (matches); + break; + } + else if (rl_editing_mode != vi_mode) + rl_ding (); /* There are other matches remaining. */ + } + else + append_to_match (matches[0], delimiter, quote_char, nontrivial_lcd); + + break; + + case '*': + insert_all_matches (matches, start, "e_char); + break; + + case '?': + if (rl_completion_display_matches_hook == 0) + { + _rl_sigcleanup = _rl_complete_sigcleanup; + _rl_sigcleanarg = matches; + } + display_matches (matches); + _rl_sigcleanup = 0; + _rl_sigcleanarg = 0; + break; + + default: + _rl_ttymsg ("bad value %d for what_to_do in rl_complete", what_to_do); + rl_ding (); + FREE (saved_line_buffer); + RL_UNSETSTATE(RL_STATE_COMPLETING); + _rl_free_match_list (matches); + _rl_reset_completion_state (); + return 1; + } + + _rl_free_match_list (matches); + + /* Check to see if the line has changed through all of this manipulation. */ + if (saved_line_buffer) + { + completion_changed_buffer = strcmp (rl_line_buffer, saved_line_buffer) != 0; + xfree (saved_line_buffer); + } + + RL_UNSETSTATE(RL_STATE_COMPLETING); + _rl_reset_completion_state (); + return 0; +} + +/***************************************************************/ +/* */ +/* Application-callable completion match generator functions */ +/* */ +/***************************************************************/ + +/* Return an array of (char *) which is a list of completions for TEXT. + If there are no completions, return a NULL pointer. + The first entry in the returned array is the substitution for TEXT. + The remaining entries are the possible completions. + The array is terminated with a NULL pointer. + + ENTRY_FUNCTION is a function of two args, and returns a (char *). + The first argument is TEXT. + The second is a state argument; it should be zero on the first call, and + non-zero on subsequent calls. It returns a NULL pointer to the caller + when there are no more matches. + */ +char ** +rl_completion_matches (text, entry_function) + const char *text; + rl_compentry_func_t *entry_function; +{ + register int i; + + /* Number of slots in match_list. */ + int match_list_size; + + /* The list of matches. */ + char **match_list; + + /* Number of matches actually found. */ + int matches; + + /* Temporary string binder. */ + char *string; + + matches = 0; + match_list_size = 10; + match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *)); + match_list[1] = (char *)NULL; + + while (string = (*entry_function) (text, matches)) + { + if (RL_SIG_RECEIVED ()) + { + /* Start at 1 because we don't set matches[0] in this function. + Only free the list members if we're building match list from + rl_filename_completion_function, since we know that doesn't + free the strings it returns. */ + if (entry_function == rl_filename_completion_function) + { + for (i = 1; match_list[i]; i++) + xfree (match_list[i]); + } + xfree (match_list); + match_list = 0; + match_list_size = 0; + matches = 0; + RL_CHECK_SIGNALS (); + } + + if (matches + 1 >= match_list_size) + match_list = (char **)xrealloc + (match_list, ((match_list_size += 10) + 1) * sizeof (char *)); + + if (match_list == 0) + return (match_list); + + match_list[++matches] = string; + match_list[matches + 1] = (char *)NULL; + } + + /* If there were any matches, then look through them finding out the + lowest common denominator. That then becomes match_list[0]. */ + if (matches) + compute_lcd_of_matches (match_list, matches, text); + else /* There were no matches. */ + { + xfree (match_list); + match_list = (char **)NULL; + } + return (match_list); +} + +/* A completion function for usernames. + TEXT contains a partial username preceded by a random + character (usually `~'). */ +char * +rl_username_completion_function (text, state) + const char *text; + int state; +{ +#if defined (__WIN32__) || defined (__OPENNT) + return (char *)NULL; +#else /* !__WIN32__ && !__OPENNT) */ + static char *username = (char *)NULL; + static struct passwd *entry; + static int namelen, first_char, first_char_loc; + char *value; + + if (state == 0) + { + FREE (username); + + first_char = *text; + first_char_loc = first_char == '~'; + + username = savestring (&text[first_char_loc]); + namelen = strlen (username); +#if defined (HAVE_GETPWENT) + setpwent (); +#endif + } + +#if defined (HAVE_GETPWENT) + while (entry = getpwent ()) + { + /* Null usernames should result in all users as possible completions. */ + if (namelen == 0 || (STREQN (username, entry->pw_name, namelen))) + break; + } +#endif + + if (entry == 0) + { +#if defined (HAVE_GETPWENT) + endpwent (); +#endif + return ((char *)NULL); + } + else + { + value = (char *)xmalloc (2 + strlen (entry->pw_name)); + + *value = *text; + + strcpy (value + first_char_loc, entry->pw_name); + + if (first_char == '~') + rl_filename_completion_desired = 1; + + return (value); + } +#endif /* !__WIN32__ && !__OPENNT */ +} + +/* Return non-zero if CONVFN matches FILENAME up to the length of FILENAME + (FILENAME_LEN). If _rl_completion_case_fold is set, compare without + regard to the alphabetic case of characters. If + _rl_completion_case_map is set, make `-' and `_' equivalent. CONVFN is + the possibly-converted directory entry; FILENAME is what the user typed. */ +static int +complete_fncmp (convfn, convlen, filename, filename_len) + const char *convfn; + int convlen; + const char *filename; + int filename_len; +{ + register char *s1, *s2; + int d, len; +#if defined (HANDLE_MULTIBYTE) + size_t v1, v2; + mbstate_t ps1, ps2; + wchar_t wc1, wc2; +#endif + +#if defined (HANDLE_MULTIBYTE) + memset (&ps1, 0, sizeof (mbstate_t)); + memset (&ps2, 0, sizeof (mbstate_t)); +#endif + + if (filename_len == 0) + return 1; + if (convlen < filename_len) + return 0; + + len = filename_len; + s1 = (char *)convfn; + s2 = (char *)filename; + + /* Otherwise, if these match up to the length of filename, then + it is a match. */ + if (_rl_completion_case_fold && _rl_completion_case_map) + { + /* Case-insensitive comparison treating _ and - as equivalent */ +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + do + { + v1 = mbrtowc (&wc1, s1, convlen, &ps1); + v2 = mbrtowc (&wc2, s2, filename_len, &ps2); + if (v1 == 0 && v2 == 0) + return 1; + else if (MB_INVALIDCH (v1) || MB_INVALIDCH (v2)) + { + if (*s1 != *s2) /* do byte comparison */ + return 0; + else if ((*s1 == '-' || *s1 == '_') && (*s2 == '-' || *s2 == '_')) + return 0; + s1++; s2++; len--; + continue; + } + wc1 = towlower (wc1); + wc2 = towlower (wc2); + s1 += v1; + s2 += v1; + len -= v1; + if ((wc1 == L'-' || wc1 == L'_') && (wc2 == L'-' || wc2 == L'_')) + continue; + if (wc1 != wc2) + return 0; + } + while (len != 0); + } + else +#endif + { + do + { + d = _rl_to_lower (*s1) - _rl_to_lower (*s2); + /* *s1 == [-_] && *s2 == [-_] */ + if ((*s1 == '-' || *s1 == '_') && (*s2 == '-' || *s2 == '_')) + d = 0; + if (d != 0) + return 0; + s1++; s2++; /* already checked convlen >= filename_len */ + } + while (--len != 0); + } + + return 1; + } + else if (_rl_completion_case_fold) + { +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + do + { + v1 = mbrtowc (&wc1, s1, convlen, &ps1); + v2 = mbrtowc (&wc2, s2, filename_len, &ps2); + if (v1 == 0 && v2 == 0) + return 1; + else if (MB_INVALIDCH (v1) || MB_INVALIDCH (v2)) + { + if (*s1 != *s2) /* do byte comparison */ + return 0; + s1++; s2++; len--; + continue; + } + wc1 = towlower (wc1); + wc2 = towlower (wc2); + if (wc1 != wc2) + return 0; + s1 += v1; + s2 += v1; + len -= v1; + } + while (len != 0); + return 1; + } + else +#endif + if ((_rl_to_lower (convfn[0]) == _rl_to_lower (filename[0])) && + (convlen >= filename_len) && + (_rl_strnicmp (filename, convfn, filename_len) == 0)) + return 1; + } + else + { + if ((convfn[0] == filename[0]) && + (convlen >= filename_len) && + (strncmp (filename, convfn, filename_len) == 0)) + return 1; + } + return 0; +} + +/* Okay, now we write the entry_function for filename completion. In the + general case. Note that completion in the shell is a little different + because of all the pathnames that must be followed when looking up the + completion for a command. */ +char * +rl_filename_completion_function (text, state) + const char *text; + int state; +{ + static DIR *directory = (DIR *)NULL; + static char *filename = (char *)NULL; + static char *dirname = (char *)NULL; + static char *users_dirname = (char *)NULL; + static int filename_len; + char *temp, *dentry, *convfn; + int dirlen, dentlen, convlen; + struct dirent *entry; + + /* If we don't have any state, then do some initialization. */ + if (state == 0) + { + /* If we were interrupted before closing the directory or reading + all of its contents, close it. */ + if (directory) + { + closedir (directory); + directory = (DIR *)NULL; + } + FREE (dirname); + FREE (filename); + FREE (users_dirname); + + filename = savestring (text); + if (*text == 0) + text = "."; + dirname = savestring (text); + + temp = strrchr (dirname, '/'); + +#if defined (__MSDOS__) + /* special hack for //X/... */ + if (dirname[0] == '/' && dirname[1] == '/' && ISALPHA ((unsigned char)dirname[2]) && dirname[3] == '/') + temp = strrchr (dirname + 3, '/'); +#endif + + if (temp) + { + strcpy (filename, ++temp); + *temp = '\0'; + } +#if defined (__MSDOS__) + /* searches from current directory on the drive */ + else if (ISALPHA ((unsigned char)dirname[0]) && dirname[1] == ':') + { + strcpy (filename, dirname + 2); + dirname[2] = '\0'; + } +#endif + else + { + dirname[0] = '.'; + dirname[1] = '\0'; + } + + /* We aren't done yet. We also support the "~user" syntax. */ + + /* Save the version of the directory that the user typed, dequoting + it if necessary. */ + if (rl_completion_found_quote && rl_filename_dequoting_function) + users_dirname = (*rl_filename_dequoting_function) (dirname, rl_completion_quote_character); + else + users_dirname = savestring (dirname); + + if (*dirname == '~') + { + temp = tilde_expand (dirname); + xfree (dirname); + dirname = temp; + } + + /* We have saved the possibly-dequoted version of the directory name + the user typed. Now transform the directory name we're going to + pass to opendir(2). The directory rewrite hook modifies only the + directory name; the directory completion hook modifies both the + directory name passed to opendir(2) and the version the user + typed. Both the directory completion and rewrite hooks should perform + any necessary dequoting. The hook functions return 1 if they modify + the directory name argument. If either hook returns 0, it should + not modify the directory name pointer passed as an argument. */ + if (rl_directory_rewrite_hook) + (*rl_directory_rewrite_hook) (&dirname); + else if (rl_directory_completion_hook && (*rl_directory_completion_hook) (&dirname)) + { + xfree (users_dirname); + users_dirname = savestring (dirname); + } + else if (rl_completion_found_quote && rl_filename_dequoting_function) + { + /* delete single and double quotes */ + xfree (dirname); + dirname = savestring (users_dirname); + } + directory = opendir (dirname); + + /* Now dequote a non-null filename. FILENAME will not be NULL, but may + be empty. */ + if (*filename && rl_completion_found_quote && rl_filename_dequoting_function) + { + /* delete single and double quotes */ + temp = (*rl_filename_dequoting_function) (filename, rl_completion_quote_character); + xfree (filename); + filename = temp; + } + filename_len = strlen (filename); + + rl_filename_completion_desired = 1; + } + + /* At this point we should entertain the possibility of hacking wildcarded + filenames, like /usr/man/man/te. If the directory name + contains globbing characters, then build an array of directories, and + then map over that list while completing. */ + /* *** UNIMPLEMENTED *** */ + + /* Now that we have some state, we can read the directory. */ + + entry = (struct dirent *)NULL; + while (directory && (entry = readdir (directory))) + { + convfn = dentry = entry->d_name; + convlen = dentlen = D_NAMLEN (entry); + + if (rl_filename_rewrite_hook) + { + convfn = (*rl_filename_rewrite_hook) (dentry, dentlen); + convlen = (convfn == dentry) ? dentlen : strlen (convfn); + } + + /* Special case for no filename. If the user has disabled the + `match-hidden-files' variable, skip filenames beginning with `.'. + All other entries except "." and ".." match. */ + if (filename_len == 0) + { + if (_rl_match_hidden_files == 0 && HIDDEN_FILE (convfn)) + continue; + + if (convfn[0] != '.' || + (convfn[1] && (convfn[1] != '.' || convfn[2]))) + break; + } + else + { + if (complete_fncmp (convfn, convlen, filename, filename_len)) + break; + } + } + + if (entry == 0) + { + if (directory) + { + closedir (directory); + directory = (DIR *)NULL; + } + if (dirname) + { + xfree (dirname); + dirname = (char *)NULL; + } + if (filename) + { + xfree (filename); + filename = (char *)NULL; + } + if (users_dirname) + { + xfree (users_dirname); + users_dirname = (char *)NULL; + } + + return (char *)NULL; + } + else + { + /* dirname && (strcmp (dirname, ".") != 0) */ + if (dirname && (dirname[0] != '.' || dirname[1])) + { + if (rl_complete_with_tilde_expansion && *users_dirname == '~') + { + dirlen = strlen (dirname); + temp = (char *)xmalloc (2 + dirlen + D_NAMLEN (entry)); + strcpy (temp, dirname); + /* Canonicalization cuts off any final slash present. We + may need to add it back. */ + if (dirname[dirlen - 1] != '/') + { + temp[dirlen++] = '/'; + temp[dirlen] = '\0'; + } + } + else + { + dirlen = strlen (users_dirname); + temp = (char *)xmalloc (2 + dirlen + D_NAMLEN (entry)); + strcpy (temp, users_dirname); + /* Make sure that temp has a trailing slash here. */ + if (users_dirname[dirlen - 1] != '/') + temp[dirlen++] = '/'; + } + + strcpy (temp + dirlen, convfn); + } + else + temp = savestring (convfn); + + if (convfn != dentry) + xfree (convfn); + + return (temp); + } +} + +/* An initial implementation of a menu completion function a la tcsh. The + first time (if the last readline command was not rl_old_menu_complete), we + generate the list of matches. This code is very similar to the code in + rl_complete_internal -- there should be a way to combine the two. Then, + for each item in the list of matches, we insert the match in an undoable + fashion, with the appropriate character appended (this happens on the + second and subsequent consecutive calls to rl_old_menu_complete). When we + hit the end of the match list, we restore the original unmatched text, + ring the bell, and reset the counter to zero. */ +int +rl_old_menu_complete (count, invoking_key) + int count, invoking_key; +{ + rl_compentry_func_t *our_func; + int matching_filenames, found_quote; + + static char *orig_text; + static char **matches = (char **)0; + static int match_list_index = 0; + static int match_list_size = 0; + static int orig_start, orig_end; + static char quote_char; + static int delimiter; + + /* The first time through, we generate the list of matches and set things + up to insert them. */ + if (rl_last_func != rl_old_menu_complete) + { + /* Clean up from previous call, if any. */ + FREE (orig_text); + if (matches) + _rl_free_match_list (matches); + + match_list_index = match_list_size = 0; + matches = (char **)NULL; + + rl_completion_invoking_key = invoking_key; + + RL_SETSTATE(RL_STATE_COMPLETING); + + /* Only the completion entry function can change these. */ + set_completion_defaults ('%'); + + our_func = rl_menu_completion_entry_function; + if (our_func == 0) + our_func = rl_completion_entry_function + ? rl_completion_entry_function + : rl_filename_completion_function; + + /* We now look backwards for the start of a filename/variable word. */ + orig_end = rl_point; + found_quote = delimiter = 0; + quote_char = '\0'; + + if (rl_point) + /* This (possibly) changes rl_point. If it returns a non-zero char, + we know we have an open quote. */ + quote_char = _rl_find_completion_word (&found_quote, &delimiter); + + orig_start = rl_point; + rl_point = orig_end; + + orig_text = rl_copy_text (orig_start, orig_end); + matches = gen_completion_matches (orig_text, orig_start, orig_end, + our_func, found_quote, quote_char); + + /* If we are matching filenames, the attempted completion function will + have set rl_filename_completion_desired to a non-zero value. The basic + rl_filename_completion_function does this. */ + matching_filenames = rl_filename_completion_desired; + + if (matches == 0 || postprocess_matches (&matches, matching_filenames) == 0) + { + rl_ding (); + FREE (matches); + matches = (char **)0; + FREE (orig_text); + orig_text = (char *)0; + completion_changed_buffer = 0; + RL_UNSETSTATE(RL_STATE_COMPLETING); + return (0); + } + + RL_UNSETSTATE(RL_STATE_COMPLETING); + + for (match_list_size = 0; matches[match_list_size]; match_list_size++) + ; + /* matches[0] is lcd if match_list_size > 1, but the circular buffer + code below should take care of it. */ + + if (match_list_size > 1 && _rl_complete_show_all) + display_matches (matches); + } + + /* Now we have the list of matches. Replace the text between + rl_line_buffer[orig_start] and rl_line_buffer[rl_point] with + matches[match_list_index], and add any necessary closing char. */ + + if (matches == 0 || match_list_size == 0) + { + rl_ding (); + FREE (matches); + matches = (char **)0; + completion_changed_buffer = 0; + return (0); + } + + match_list_index += count; + if (match_list_index < 0) + { + while (match_list_index < 0) + match_list_index += match_list_size; + } + else + match_list_index %= match_list_size; + + if (match_list_index == 0 && match_list_size > 1) + { + rl_ding (); + insert_match (orig_text, orig_start, MULT_MATCH, "e_char); + } + else + { + insert_match (matches[match_list_index], orig_start, SINGLE_MATCH, "e_char); + append_to_match (matches[match_list_index], delimiter, quote_char, + strcmp (orig_text, matches[match_list_index])); + } + + completion_changed_buffer = 1; + return (0); +} + +int +rl_menu_complete (count, ignore) + int count, ignore; +{ + rl_compentry_func_t *our_func; + int matching_filenames, found_quote; + + static char *orig_text; + static char **matches = (char **)0; + static int match_list_index = 0; + static int match_list_size = 0; + static int nontrivial_lcd = 0; + static int full_completion = 0; /* set to 1 if menu completion should reinitialize on next call */ + static int orig_start, orig_end; + static char quote_char; + static int delimiter, cstate; + + /* The first time through, we generate the list of matches and set things + up to insert them. */ + if ((rl_last_func != rl_menu_complete && rl_last_func != rl_backward_menu_complete) || full_completion) + { + /* Clean up from previous call, if any. */ + FREE (orig_text); + if (matches) + _rl_free_match_list (matches); + + match_list_index = match_list_size = 0; + matches = (char **)NULL; + + full_completion = 0; + + RL_SETSTATE(RL_STATE_COMPLETING); + + /* Only the completion entry function can change these. */ + set_completion_defaults ('%'); + + our_func = rl_menu_completion_entry_function; + if (our_func == 0) + our_func = rl_completion_entry_function + ? rl_completion_entry_function + : rl_filename_completion_function; + + /* We now look backwards for the start of a filename/variable word. */ + orig_end = rl_point; + found_quote = delimiter = 0; + quote_char = '\0'; + + if (rl_point) + /* This (possibly) changes rl_point. If it returns a non-zero char, + we know we have an open quote. */ + quote_char = _rl_find_completion_word (&found_quote, &delimiter); + + orig_start = rl_point; + rl_point = orig_end; + + orig_text = rl_copy_text (orig_start, orig_end); + matches = gen_completion_matches (orig_text, orig_start, orig_end, + our_func, found_quote, quote_char); + + nontrivial_lcd = matches && strcmp (orig_text, matches[0]) != 0; + + /* If we are matching filenames, the attempted completion function will + have set rl_filename_completion_desired to a non-zero value. The basic + rl_filename_completion_function does this. */ + matching_filenames = rl_filename_completion_desired; + + if (matches == 0 || postprocess_matches (&matches, matching_filenames) == 0) + { + rl_ding (); + FREE (matches); + matches = (char **)0; + FREE (orig_text); + orig_text = (char *)0; + completion_changed_buffer = 0; + RL_UNSETSTATE(RL_STATE_COMPLETING); + return (0); + } + + RL_UNSETSTATE(RL_STATE_COMPLETING); + + for (match_list_size = 0; matches[match_list_size]; match_list_size++) + ; + + if (match_list_size == 0) + { + rl_ding (); + FREE (matches); + matches = (char **)0; + match_list_index = 0; + completion_changed_buffer = 0; + return (0); + } + + /* matches[0] is lcd if match_list_size > 1, but the circular buffer + code below should take care of it. */ + if (*matches[0]) + { + insert_match (matches[0], orig_start, matches[1] ? MULT_MATCH : SINGLE_MATCH, "e_char); + orig_end = orig_start + strlen (matches[0]); + completion_changed_buffer = STREQ (orig_text, matches[0]) == 0; + } + + if (match_list_size > 1 && _rl_complete_show_all) + { + display_matches (matches); + /* If there are so many matches that the user has to be asked + whether or not he wants to see the matches, menu completion + is unwieldy. */ + if (rl_completion_query_items > 0 && match_list_size >= rl_completion_query_items) + { + rl_ding (); + FREE (matches); + matches = (char **)0; + full_completion = 1; + return (0); + } + else if (_rl_menu_complete_prefix_first) + { + rl_ding (); + return (0); + } + } + else if (match_list_size <= 1) + { + append_to_match (matches[0], delimiter, quote_char, nontrivial_lcd); + full_completion = 1; + return (0); + } + else if (_rl_menu_complete_prefix_first && match_list_size > 1) + { + rl_ding (); + return (0); + } + } + + /* Now we have the list of matches. Replace the text between + rl_line_buffer[orig_start] and rl_line_buffer[rl_point] with + matches[match_list_index], and add any necessary closing char. */ + + if (matches == 0 || match_list_size == 0) + { + rl_ding (); + FREE (matches); + matches = (char **)0; + completion_changed_buffer = 0; + return (0); + } + + match_list_index += count; + if (match_list_index < 0) + { + while (match_list_index < 0) + match_list_index += match_list_size; + } + else + match_list_index %= match_list_size; + + if (match_list_index == 0 && match_list_size > 1) + { + rl_ding (); + insert_match (matches[0], orig_start, MULT_MATCH, "e_char); + } + else + { + insert_match (matches[match_list_index], orig_start, SINGLE_MATCH, "e_char); + append_to_match (matches[match_list_index], delimiter, quote_char, + strcmp (orig_text, matches[match_list_index])); + } + + completion_changed_buffer = 1; + return (0); +} + +int +rl_backward_menu_complete (count, key) + int count, key; +{ + /* Positive arguments to backward-menu-complete translate into negative + arguments for menu-complete, and vice versa. */ + return (rl_menu_complete (-count, key)); +} diff --git a/lib/readline/display.c b/lib/readline/display.c new file mode 100644 index 0000000..4df1f73 --- /dev/null +++ b/lib/readline/display.c @@ -0,0 +1,2824 @@ +/* display.c -- readline redisplay facility. */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif /* HAVE_UNISTD_H */ + +#include "posixstat.h" + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include + +#ifdef __MSDOS__ +# include +#endif + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" +#include "rlmbutil.h" + +/* Termcap library stuff. */ +#include "tcap.h" + +/* Some standard library routines. */ +#include "readline.h" +#include "history.h" + +#include "rlprivate.h" +#include "xmalloc.h" + +#if !defined (strchr) && !defined (__STDC__) +extern char *strchr (), *strrchr (); +#endif /* !strchr && !__STDC__ */ + +static void update_line PARAMS((char *, char *, int, int, int, int)); +static void space_to_eol PARAMS((int)); +static void delete_chars PARAMS((int)); +static void insert_some_chars PARAMS((char *, int, int)); +static void open_some_spaces PARAMS((int)); +static void cr PARAMS((void)); + +/* State of visible and invisible lines. */ +struct line_state + { + char *line; + int *lbreaks; + int lbsize; +#if defined (HANDLE_MULTIBYTE) + int *wrapped_line; + int wbsize; +#endif + }; + +/* The line display buffers. One is the line currently displayed on + the screen. The other is the line about to be displayed. */ +static struct line_state line_state_array[2]; +static struct line_state *line_state_visible = &line_state_array[0]; +static struct line_state *line_state_invisible = &line_state_array[1]; +static int line_structures_initialized = 0; + +/* Backwards-compatible names. */ +#define inv_lbreaks (line_state_invisible->lbreaks) +#define inv_lbsize (line_state_invisible->lbsize) +#define vis_lbreaks (line_state_visible->lbreaks) +#define vis_lbsize (line_state_visible->lbsize) + +#define visible_line (line_state_visible->line) +#define invisible_line (line_state_invisible->line) + +#if defined (HANDLE_MULTIBYTE) +static int _rl_col_width PARAMS((const char *, int, int, int)); +#else +# define _rl_col_width(l, s, e, f) (((e) <= (s)) ? 0 : (e) - (s)) +#endif + +/* Heuristic used to decide whether it is faster to move from CUR to NEW + by backing up or outputting a carriage return and moving forward. CUR + and NEW are either both buffer positions or absolute screen positions. */ +#define CR_FASTER(new, cur) (((new) + 1) < ((cur) - (new))) + +/* _rl_last_c_pos is an absolute cursor position in multibyte locales and a + buffer index in others. This macro is used when deciding whether the + current cursor position is in the middle of a prompt string containing + invisible characters. XXX - might need to take `modmark' into account. */ +#define PROMPT_ENDING_INDEX \ + ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) ? prompt_physical_chars : prompt_last_invisible+1) + + +/* **************************************************************** */ +/* */ +/* Display stuff */ +/* */ +/* **************************************************************** */ + +/* This is the stuff that is hard for me. I never seem to write good + display routines in C. Let's see how I do this time. */ + +/* (PWP) Well... Good for a simple line updater, but totally ignores + the problems of input lines longer than the screen width. + + update_line and the code that calls it makes a multiple line, + automatically wrapping line update. Careful attention needs + to be paid to the vertical position variables. */ + +/* Keep two buffers; one which reflects the current contents of the + screen, and the other to draw what we think the new contents should + be. Then compare the buffers, and make whatever changes to the + screen itself that we should. Finally, make the buffer that we + just drew into be the one which reflects the current contents of the + screen, and place the cursor where it belongs. + + Commands that want to can fix the display themselves, and then let + this function know that the display has been fixed by setting the + RL_DISPLAY_FIXED variable. This is good for efficiency. */ + +/* Application-specific redisplay function. */ +rl_voidfunc_t *rl_redisplay_function = rl_redisplay; + +/* Global variables declared here. */ +/* What YOU turn on when you have handled all redisplay yourself. */ +int rl_display_fixed = 0; + +int _rl_suppress_redisplay = 0; +int _rl_want_redisplay = 0; + +/* The stuff that gets printed out before the actual text of the line. + This is usually pointing to rl_prompt. */ +char *rl_display_prompt = (char *)NULL; + +/* Pseudo-global variables declared here. */ + +/* The visible cursor position. If you print some text, adjust this. */ +/* NOTE: _rl_last_c_pos is used as a buffer index when not in a locale + supporting multibyte characters, and an absolute cursor position when + in such a locale. This is an artifact of the donated multibyte support. + Care must be taken when modifying its value. */ +int _rl_last_c_pos = 0; +int _rl_last_v_pos = 0; + +static int cpos_adjusted; +static int cpos_buffer_position; +static int displaying_prompt_first_line; +static int prompt_multibyte_chars; + +/* Number of lines currently on screen minus 1. */ +int _rl_vis_botlin = 0; + +/* Variables used only in this file. */ +/* The last left edge of text that was displayed. This is used when + doing horizontal scrolling. It shifts in thirds of a screenwidth. */ +static int last_lmargin; + +/* A buffer for `modeline' messages. */ +static char *msg_buf = 0; +static int msg_bufsiz = 0; + +/* Non-zero forces the redisplay even if we thought it was unnecessary. */ +static int forced_display; + +/* Default and initial buffer size. Can grow. */ +static int line_size = 1024; + +/* Variables to keep track of the expanded prompt string, which may + include invisible characters. */ + +static char *local_prompt, *local_prompt_prefix; +static int local_prompt_len; +static int prompt_visible_length, prompt_prefix_length; + +/* The number of invisible characters in the line currently being + displayed on the screen. */ +static int visible_wrap_offset; + +/* The number of invisible characters in the prompt string. Static so it + can be shared between rl_redisplay and update_line */ +static int wrap_offset; + +/* The index of the last invisible character in the prompt string. */ +static int prompt_last_invisible; + +/* The length (buffer offset) of the first line of the last (possibly + multi-line) buffer displayed on the screen. */ +static int visible_first_line_len; + +/* Number of invisible characters on the first physical line of the prompt. + Only valid when the number of physical characters in the prompt exceeds + (or is equal to) _rl_screenwidth. */ +static int prompt_invis_chars_first_line; + +static int prompt_last_screen_line; + +static int prompt_physical_chars; + +/* set to a non-zero value by rl_redisplay if we are marking modified history + lines and the current line is so marked. */ +static int modmark; + +/* Variables to save and restore prompt and display information. */ + +/* These are getting numerous enough that it's time to create a struct. */ + +static char *saved_local_prompt; +static char *saved_local_prefix; +static int saved_last_invisible; +static int saved_visible_length; +static int saved_prefix_length; +static int saved_local_length; +static int saved_invis_chars_first_line; +static int saved_physical_chars; + +/* Return a character indicating the editing mode, for use in the prompt. */ +static int +prompt_modechar () +{ + if (rl_editing_mode == emacs_mode) + return '@'; + else if (_rl_keymap == vi_insertion_keymap) + return '+'; /* vi insert mode */ + else + return ':'; /* vi command mode */ +} + +/* Expand the prompt string S and return the number of visible + characters in *LP, if LP is not null. This is currently more-or-less + a placeholder for expansion. LIP, if non-null is a place to store the + index of the last invisible character in the returned string. NIFLP, + if non-zero, is a place to store the number of invisible characters in + the first prompt line. The previous are used as byte counts -- indexes + into a character buffer. */ + +/* Current implementation: + \001 (^A) start non-visible characters + \002 (^B) end non-visible characters + all characters except \001 and \002 (following a \001) are copied to + the returned string; all characters except those between \001 and + \002 are assumed to be `visible'. */ + +static char * +expand_prompt (pmt, lp, lip, niflp, vlp) + char *pmt; + int *lp, *lip, *niflp, *vlp; +{ + char *r, *ret, *p, *igstart; + int l, rl, last, ignoring, ninvis, invfl, invflset, ind, pind, physchars; + + /* Short-circuit if we can. */ + if ((MB_CUR_MAX <= 1 || rl_byte_oriented) && strchr (pmt, RL_PROMPT_START_IGNORE) == 0) + { + if (pmt == rl_prompt && _rl_show_mode_in_prompt) + { + l = strlen (pmt); + r = (char *)xmalloc (l + 2); + r[0] = prompt_modechar (); + strcpy (r + 1, pmt); + } + else + r = savestring (pmt); + + if (lp) + *lp = strlen (r); + if (lip) + *lip = 0; + if (niflp) + *niflp = 0; + if (vlp) + *vlp = lp ? *lp : strlen (r); + return r; + } + + l = strlen (pmt); + r = ret = (char *)xmalloc (l + 2); + + rl = physchars = 0; /* move up here so mode show can set them */ + if (pmt == rl_prompt && _rl_show_mode_in_prompt) + { + *r++ = prompt_modechar (); + rl = physchars = 1; + } + + invfl = 0; /* invisible chars in first line of prompt */ + invflset = 0; /* we only want to set invfl once */ + + igstart = 0; + for (ignoring = last = ninvis = 0, p = pmt; p && *p; p++) + { + /* This code strips the invisible character string markers + RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE */ + if (ignoring == 0 && *p == RL_PROMPT_START_IGNORE) /* XXX - check ignoring? */ + { + ignoring = 1; + igstart = p; + continue; + } + else if (ignoring && *p == RL_PROMPT_END_IGNORE) + { + ignoring = 0; + if (p != (igstart + 1)) + last = r - ret - 1; + continue; + } + else + { +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + pind = p - pmt; + ind = _rl_find_next_mbchar (pmt, pind, 1, MB_FIND_NONZERO); + l = ind - pind; + while (l--) + *r++ = *p++; + if (!ignoring) + { + /* rl ends up being assigned to prompt_visible_length, + which is the number of characters in the buffer that + contribute to characters on the screen, which might + not be the same as the number of physical characters + on the screen in the presence of multibyte characters */ + rl += ind - pind; + physchars += _rl_col_width (pmt, pind, ind, 0); + } + else + ninvis += ind - pind; + p--; /* compensate for later increment */ + } + else +#endif + { + *r++ = *p; + if (!ignoring) + { + rl++; /* visible length byte counter */ + physchars++; + } + else + ninvis++; /* invisible chars byte counter */ + } + + if (invflset == 0 && rl >= _rl_screenwidth) + { + invfl = ninvis; + invflset = 1; + } + } + } + + if (rl < _rl_screenwidth) + invfl = ninvis; + + *r = '\0'; + if (lp) + *lp = rl; + if (lip) + *lip = last; + if (niflp) + *niflp = invfl; + if (vlp) + *vlp = physchars; + return ret; +} + +/* Just strip out RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE from + PMT and return the rest of PMT. */ +char * +_rl_strip_prompt (pmt) + char *pmt; +{ + char *ret; + + ret = expand_prompt (pmt, (int *)NULL, (int *)NULL, (int *)NULL, (int *)NULL); + return ret; +} + +void +_rl_reset_prompt () +{ + rl_visible_prompt_length = rl_expand_prompt (rl_prompt); +} + +/* + * Expand the prompt string into the various display components, if + * necessary. + * + * local_prompt = expanded last line of string in rl_display_prompt + * (portion after the final newline) + * local_prompt_prefix = portion before last newline of rl_display_prompt, + * expanded via expand_prompt + * prompt_visible_length = number of visible characters in local_prompt + * prompt_prefix_length = number of visible characters in local_prompt_prefix + * + * This function is called once per call to readline(). It may also be + * called arbitrarily to expand the primary prompt. + * + * The return value is the number of visible characters on the last line + * of the (possibly multi-line) prompt. + */ +int +rl_expand_prompt (prompt) + char *prompt; +{ + char *p, *t; + int c; + + /* Clear out any saved values. */ + FREE (local_prompt); + FREE (local_prompt_prefix); + + local_prompt = local_prompt_prefix = (char *)0; + local_prompt_len = 0; + prompt_last_invisible = prompt_invis_chars_first_line = 0; + prompt_visible_length = prompt_physical_chars = 0; + + if (prompt == 0 || *prompt == 0) + return (0); + + p = strrchr (prompt, '\n'); + if (!p) + { + /* The prompt is only one logical line, though it might wrap. */ + local_prompt = expand_prompt (prompt, &prompt_visible_length, + &prompt_last_invisible, + &prompt_invis_chars_first_line, + &prompt_physical_chars); + local_prompt_prefix = (char *)0; + local_prompt_len = local_prompt ? strlen (local_prompt) : 0; + return (prompt_visible_length); + } + else + { + /* The prompt spans multiple lines. */ + t = ++p; + local_prompt = expand_prompt (p, &prompt_visible_length, + &prompt_last_invisible, + &prompt_invis_chars_first_line, + &prompt_physical_chars); + c = *t; *t = '\0'; + /* The portion of the prompt string up to and including the + final newline is now null-terminated. */ + local_prompt_prefix = expand_prompt (prompt, &prompt_prefix_length, + (int *)NULL, + (int *)NULL, + (int *)NULL); + *t = c; + local_prompt_len = local_prompt ? strlen (local_prompt) : 0; + return (prompt_prefix_length); + } +} + +/* Initialize the VISIBLE_LINE and INVISIBLE_LINE arrays, and their associated + arrays of line break markers. MINSIZE is the minimum size of VISIBLE_LINE + and INVISIBLE_LINE; if it is greater than LINE_SIZE, LINE_SIZE is + increased. If the lines have already been allocated, this ensures that + they can hold at least MINSIZE characters. */ +static void +init_line_structures (minsize) + int minsize; +{ + register int n; + + if (invisible_line == 0) /* initialize it */ + { + if (line_size < minsize) + line_size = minsize; + visible_line = (char *)xmalloc (line_size); + invisible_line = (char *)xmalloc (line_size); + } + else if (line_size < minsize) /* ensure it can hold MINSIZE chars */ + { + line_size *= 2; + if (line_size < minsize) + line_size = minsize; + visible_line = (char *)xrealloc (visible_line, line_size); + invisible_line = (char *)xrealloc (invisible_line, line_size); + } + + for (n = minsize; n < line_size; n++) + { + visible_line[n] = 0; + invisible_line[n] = 1; + } + + if (vis_lbreaks == 0) + { + /* should be enough. */ + inv_lbsize = vis_lbsize = 256; + +#if defined (HANDLE_MULTIBYTE) + line_state_visible->wbsize = vis_lbsize; + line_state_visible->wrapped_line = (int *)xmalloc (line_state_visible->wbsize * sizeof (int)); + + line_state_invisible->wbsize = inv_lbsize; + line_state_invisible->wrapped_line = (int *)xmalloc (line_state_invisible->wbsize * sizeof (int)); +#endif + + inv_lbreaks = (int *)xmalloc (inv_lbsize * sizeof (int)); + vis_lbreaks = (int *)xmalloc (vis_lbsize * sizeof (int)); + inv_lbreaks[0] = vis_lbreaks[0] = 0; + } + + line_structures_initialized = 1; +} + +/* Basic redisplay algorithm. */ +void +rl_redisplay () +{ + register int in, out, c, linenum, cursor_linenum; + register char *line; + int inv_botlin, lb_botlin, lb_linenum, o_cpos; + int newlines, lpos, temp, n0, num, prompt_lines_estimate; + char *prompt_this_line; +#if defined (HANDLE_MULTIBYTE) + wchar_t wc; + size_t wc_bytes; + int wc_width; + mbstate_t ps; + int _rl_wrapped_multicolumn = 0; +#endif + + if (_rl_echoing_p == 0) + return; + + /* Block keyboard interrupts because this function manipulates global + data structures. */ + _rl_block_sigint (); + RL_SETSTATE (RL_STATE_REDISPLAYING); + + if (!rl_display_prompt) + rl_display_prompt = ""; + + if (line_structures_initialized == 0) + { + init_line_structures (0); + rl_on_new_line (); + } + + /* Draw the line into the buffer. */ + cpos_buffer_position = -1; + + prompt_multibyte_chars = prompt_visible_length - prompt_physical_chars; + + line = invisible_line; + out = inv_botlin = 0; + + /* Mark the line as modified or not. We only do this for history + lines. */ + modmark = 0; + if (_rl_mark_modified_lines && current_history () && rl_undo_list) + { + line[out++] = '*'; + line[out] = '\0'; + modmark = 1; + } + + /* If someone thought that the redisplay was handled, but the currently + visible line has a different modification state than the one about + to become visible, then correct the caller's misconception. */ + if (visible_line[0] != invisible_line[0]) + rl_display_fixed = 0; + + /* If the prompt to be displayed is the `primary' readline prompt (the + one passed to readline()), use the values we have already expanded. + If not, use what's already in rl_display_prompt. WRAP_OFFSET is the + number of non-visible characters in the prompt string. */ + if (rl_display_prompt == rl_prompt || local_prompt) + { + if (local_prompt_prefix && forced_display) + _rl_output_some_chars (local_prompt_prefix, strlen (local_prompt_prefix)); + + if (local_prompt_len > 0) + { + temp = local_prompt_len + out + 2; + if (temp >= line_size) + { + line_size = (temp + 1024) - (temp % 1024); + visible_line = (char *)xrealloc (visible_line, line_size); + line = invisible_line = (char *)xrealloc (invisible_line, line_size); + } + strncpy (line + out, local_prompt, local_prompt_len); + out += local_prompt_len; + } + line[out] = '\0'; + wrap_offset = local_prompt_len - prompt_visible_length; + } + else + { + int pmtlen; + prompt_this_line = strrchr (rl_display_prompt, '\n'); + if (!prompt_this_line) + prompt_this_line = rl_display_prompt; + else + { + prompt_this_line++; + pmtlen = prompt_this_line - rl_display_prompt; /* temp var */ + if (forced_display) + { + _rl_output_some_chars (rl_display_prompt, pmtlen); + /* Make sure we are at column zero even after a newline, + regardless of the state of terminal output processing. */ + if (pmtlen < 2 || prompt_this_line[-2] != '\r') + cr (); + } + } + + prompt_physical_chars = pmtlen = strlen (prompt_this_line); + temp = pmtlen + out + 2; + if (temp >= line_size) + { + line_size = (temp + 1024) - (temp % 1024); + visible_line = (char *)xrealloc (visible_line, line_size); + line = invisible_line = (char *)xrealloc (invisible_line, line_size); + } + strncpy (line + out, prompt_this_line, pmtlen); + out += pmtlen; + line[out] = '\0'; + wrap_offset = prompt_invis_chars_first_line = 0; + } + +#define CHECK_INV_LBREAKS() \ + do { \ + if (newlines >= (inv_lbsize - 2)) \ + { \ + inv_lbsize *= 2; \ + inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \ + } \ + } while (0) + +#if defined (HANDLE_MULTIBYTE) +#define CHECK_LPOS() \ + do { \ + lpos++; \ + if (lpos >= _rl_screenwidth) \ + { \ + if (newlines >= (inv_lbsize - 2)) \ + { \ + inv_lbsize *= 2; \ + inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \ + } \ + inv_lbreaks[++newlines] = out; \ + if (newlines >= (line_state_invisible->wbsize - 1)) \ + { \ + line_state_invisible->wbsize *= 2; \ + line_state_invisible->wrapped_line = (int *)xrealloc (line_state_invisible->wrapped_line, line_state_invisible->wbsize * sizeof(int)); \ + } \ + line_state_invisible->wrapped_line[newlines] = _rl_wrapped_multicolumn; \ + lpos = 0; \ + } \ + } while (0) +#else +#define CHECK_LPOS() \ + do { \ + lpos++; \ + if (lpos >= _rl_screenwidth) \ + { \ + if (newlines >= (inv_lbsize - 2)) \ + { \ + inv_lbsize *= 2; \ + inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \ + } \ + inv_lbreaks[++newlines] = out; \ + lpos = 0; \ + } \ + } while (0) +#endif + + /* inv_lbreaks[i] is where line i starts in the buffer. */ + inv_lbreaks[newlines = 0] = 0; + lpos = prompt_physical_chars + modmark; + +#if defined (HANDLE_MULTIBYTE) + memset (line_state_invisible->wrapped_line, 0, line_state_invisible->wbsize * sizeof (int)); + num = 0; +#endif + + /* prompt_invis_chars_first_line is the number of invisible characters in + the first physical line of the prompt. + wrap_offset - prompt_invis_chars_first_line is the number of invis + chars on the second (or, more generally, last) line. */ + + /* This is zero-based, used to set the newlines */ + prompt_lines_estimate = lpos / _rl_screenwidth; + + /* what if lpos is already >= _rl_screenwidth before we start drawing the + contents of the command line? */ + while (lpos >= _rl_screenwidth) + { + int z; + /* fix from Darin Johnson for prompt string with + invisible characters that is longer than the screen width. The + prompt_invis_chars_first_line variable could be made into an array + saying how many invisible characters there are per line, but that's + probably too much work for the benefit gained. How many people have + prompts that exceed two physical lines? + Additional logic fix from Edward Catmur */ +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0 && prompt_multibyte_chars > 0) + { + n0 = num; + temp = local_prompt_len; + while (num < temp) + { + z = _rl_col_width (local_prompt, n0, num, 1); + if (z > _rl_screenwidth) + { + num = _rl_find_prev_mbchar (local_prompt, num, MB_FIND_ANY); + break; + } + else if (z == _rl_screenwidth) + break; + num++; + } + temp = num; + } + else +#endif /* !HANDLE_MULTIBYTE */ + temp = ((newlines + 1) * _rl_screenwidth); + + /* Now account for invisible characters in the current line. */ + /* XXX - this assumes that the invisible characters may be split, but only + between the first and the last lines. */ + temp += (newlines == 0) ? prompt_invis_chars_first_line + : ((newlines == prompt_lines_estimate) ? wrap_offset : prompt_invis_chars_first_line); + + inv_lbreaks[++newlines] = temp; +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0 && prompt_multibyte_chars > 0) + lpos -= _rl_col_width (local_prompt, n0, num, 1); + else +#endif + lpos -= _rl_screenwidth; + } + + prompt_last_screen_line = newlines; + + /* Draw the rest of the line (after the prompt) into invisible_line, keeping + track of where the cursor is (cpos_buffer_position), the number of the line containing + the cursor (lb_linenum), the last line number (lb_botlin and inv_botlin). + It maintains an array of line breaks for display (inv_lbreaks). + This handles expanding tabs for display and displaying meta characters. */ + lb_linenum = 0; +#if defined (HANDLE_MULTIBYTE) + in = 0; + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + memset (&ps, 0, sizeof (mbstate_t)); + /* XXX - what if wc_bytes ends up <= 0? check for MB_INVALIDCH */ + wc_bytes = mbrtowc (&wc, rl_line_buffer, rl_end, &ps); + } + else + wc_bytes = 1; + while (in < rl_end) +#else + for (in = 0; in < rl_end; in++) +#endif + { + c = (unsigned char)rl_line_buffer[in]; + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + if (MB_INVALIDCH (wc_bytes)) + { + /* Byte sequence is invalid or shortened. Assume that the + first byte represents a character. */ + wc_bytes = 1; + /* Assume that a character occupies a single column. */ + wc_width = 1; + memset (&ps, 0, sizeof (mbstate_t)); + } + else if (MB_NULLWCH (wc_bytes)) + break; /* Found '\0' */ + else + { + temp = WCWIDTH (wc); + wc_width = (temp >= 0) ? temp : 1; + } + } +#endif + + if (out + 8 >= line_size) /* XXX - 8 for \t */ + { + line_size *= 2; + visible_line = (char *)xrealloc (visible_line, line_size); + invisible_line = (char *)xrealloc (invisible_line, line_size); + line = invisible_line; + } + + if (in == rl_point) + { + cpos_buffer_position = out; + lb_linenum = newlines; + } + +#if defined (HANDLE_MULTIBYTE) + if (META_CHAR (c) && _rl_output_meta_chars == 0) /* XXX - clean up */ +#else + if (META_CHAR (c)) +#endif + { + if (_rl_output_meta_chars == 0) + { + sprintf (line + out, "\\%o", c); + + if (lpos + 4 >= _rl_screenwidth) + { + temp = _rl_screenwidth - lpos; + CHECK_INV_LBREAKS (); + inv_lbreaks[++newlines] = out + temp; + lpos = 4 - temp; + } + else + lpos += 4; + + out += 4; + } + else + { + line[out++] = c; + CHECK_LPOS(); + } + } +#if defined (DISPLAY_TABS) + else if (c == '\t') + { + register int newout; + +#if 0 + newout = (out | (int)7) + 1; +#else + newout = out + 8 - lpos % 8; +#endif + temp = newout - out; + if (lpos + temp >= _rl_screenwidth) + { + register int temp2; + temp2 = _rl_screenwidth - lpos; + CHECK_INV_LBREAKS (); + inv_lbreaks[++newlines] = out + temp2; + lpos = temp - temp2; + while (out < newout) + line[out++] = ' '; + } + else + { + while (out < newout) + line[out++] = ' '; + lpos += temp; + } + } +#endif + else if (c == '\n' && _rl_horizontal_scroll_mode == 0 && _rl_term_up && *_rl_term_up) + { + line[out++] = '\0'; /* XXX - sentinel */ + CHECK_INV_LBREAKS (); + inv_lbreaks[++newlines] = out; + lpos = 0; + } + else if (CTRL_CHAR (c) || c == RUBOUT) + { + line[out++] = '^'; + CHECK_LPOS(); + line[out++] = CTRL_CHAR (c) ? UNCTRL (c) : '?'; + CHECK_LPOS(); + } + else + { +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + register int i; + + _rl_wrapped_multicolumn = 0; + + if (_rl_screenwidth < lpos + wc_width) + for (i = lpos; i < _rl_screenwidth; i++) + { + /* The space will be removed in update_line() */ + line[out++] = ' '; + _rl_wrapped_multicolumn++; + CHECK_LPOS(); + } + if (in == rl_point) + { + cpos_buffer_position = out; + lb_linenum = newlines; + } + for (i = in; i < in+wc_bytes; i++) + line[out++] = rl_line_buffer[i]; + for (i = 0; i < wc_width; i++) + CHECK_LPOS(); + } + else + { + line[out++] = c; + CHECK_LPOS(); + } +#else + line[out++] = c; + CHECK_LPOS(); +#endif + } + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + in += wc_bytes; + /* XXX - what if wc_bytes ends up <= 0? check for MB_INVALIDCH */ + wc_bytes = mbrtowc (&wc, rl_line_buffer + in, rl_end - in, &ps); + } + else + in++; +#endif + + } + line[out] = '\0'; + if (cpos_buffer_position < 0) + { + cpos_buffer_position = out; + lb_linenum = newlines; + } + + inv_botlin = lb_botlin = newlines; + CHECK_INV_LBREAKS (); + inv_lbreaks[newlines+1] = out; + cursor_linenum = lb_linenum; + + /* CPOS_BUFFER_POSITION == position in buffer where cursor should be placed. + CURSOR_LINENUM == line number where the cursor should be placed. */ + + /* PWP: now is when things get a bit hairy. The visible and invisible + line buffers are really multiple lines, which would wrap every + (screenwidth - 1) characters. Go through each in turn, finding + the changed region and updating it. The line order is top to bottom. */ + + /* If we can move the cursor up and down, then use multiple lines, + otherwise, let long lines display in a single terminal line, and + horizontally scroll it. */ + displaying_prompt_first_line = 1; + if (_rl_horizontal_scroll_mode == 0 && _rl_term_up && *_rl_term_up) + { + int nleft, pos, changed_screen_line, tx; + + if (!rl_display_fixed || forced_display) + { + forced_display = 0; + + /* If we have more than a screenful of material to display, then + only display a screenful. We should display the last screen, + not the first. */ + if (out >= _rl_screenchars) + { + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + out = _rl_find_prev_mbchar (line, _rl_screenchars, MB_FIND_ANY); + else + out = _rl_screenchars - 1; + } + + /* The first line is at character position 0 in the buffer. The + second and subsequent lines start at inv_lbreaks[N], offset by + OFFSET (which has already been calculated above). */ + +#define INVIS_FIRST() (prompt_physical_chars > _rl_screenwidth ? prompt_invis_chars_first_line : wrap_offset) +#define WRAP_OFFSET(line, offset) ((line == 0) \ + ? (offset ? INVIS_FIRST() : 0) \ + : ((line == prompt_last_screen_line) ? wrap_offset-prompt_invis_chars_first_line : 0)) +#define W_OFFSET(line, offset) ((line) == 0 ? offset : 0) +#define VIS_LLEN(l) ((l) > _rl_vis_botlin ? 0 : (vis_lbreaks[l+1] - vis_lbreaks[l])) +#define INV_LLEN(l) (inv_lbreaks[l+1] - inv_lbreaks[l]) +#define VIS_CHARS(line) (visible_line + vis_lbreaks[line]) +#define VIS_LINE(line) ((line) > _rl_vis_botlin) ? "" : VIS_CHARS(line) +#define INV_LINE(line) (invisible_line + inv_lbreaks[line]) + +#define OLD_CPOS_IN_PROMPT() (cpos_adjusted == 0 && \ + _rl_last_c_pos != o_cpos && \ + _rl_last_c_pos > wrap_offset && \ + o_cpos < prompt_last_invisible) + + /* For each line in the buffer, do the updating display. */ + for (linenum = 0; linenum <= inv_botlin; linenum++) + { + /* This can lead us astray if we execute a program that changes + the locale from a non-multibyte to a multibyte one. */ + o_cpos = _rl_last_c_pos; + cpos_adjusted = 0; + update_line (VIS_LINE(linenum), INV_LINE(linenum), linenum, + VIS_LLEN(linenum), INV_LLEN(linenum), inv_botlin); + + /* update_line potentially changes _rl_last_c_pos, but doesn't + take invisible characters into account, since _rl_last_c_pos + is an absolute cursor position in a multibyte locale. See + if compensating here is the right thing, or if we have to + change update_line itself. There are several cases in which + update_line adjusts _rl_last_c_pos itself (so it can pass + _rl_move_cursor_relative accurate values); it communicates + this back by setting cpos_adjusted. If we assume that + _rl_last_c_pos is correct (an absolute cursor position) each + time update_line is called, then we can assume in our + calculations that o_cpos does not need to be adjusted by + wrap_offset. */ + if (linenum == 0 && (MB_CUR_MAX > 1 && rl_byte_oriented == 0) && OLD_CPOS_IN_PROMPT()) + _rl_last_c_pos -= prompt_invis_chars_first_line; /* XXX - was wrap_offset */ + else if (linenum == prompt_last_screen_line && prompt_physical_chars > _rl_screenwidth && + (MB_CUR_MAX > 1 && rl_byte_oriented == 0) && + cpos_adjusted == 0 && + _rl_last_c_pos != o_cpos && + _rl_last_c_pos > (prompt_last_invisible - _rl_screenwidth - prompt_invis_chars_first_line)) + _rl_last_c_pos -= (wrap_offset-prompt_invis_chars_first_line); + + /* If this is the line with the prompt, we might need to + compensate for invisible characters in the new line. Do + this only if there is not more than one new line (which + implies that we completely overwrite the old visible line) + and the new line is shorter than the old. Make sure we are + at the end of the new line before clearing. */ + if (linenum == 0 && + inv_botlin == 0 && _rl_last_c_pos == out && + (wrap_offset > visible_wrap_offset) && + (_rl_last_c_pos < visible_first_line_len)) + { + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + nleft = _rl_screenwidth - _rl_last_c_pos; + else + nleft = _rl_screenwidth + wrap_offset - _rl_last_c_pos; + if (nleft) + _rl_clear_to_eol (nleft); + } +#if 0 + /* This segment is intended to handle the case where the prompt + has invisible characters on the second line and the new line + to be displayed needs to clear the rest of the old characters + out (e.g., when printing the i-search prompt). In general, + the case of the new line being shorter than the old. + Incomplete */ + else if (linenum == prompt_last_screen_line && + prompt_physical_chars > _rl_screenwidth && + wrap_offset != prompt_invis_chars_first_line && + _rl_last_c_pos == out && +#endif + + + /* Since the new first line is now visible, save its length. */ + if (linenum == 0) + visible_first_line_len = (inv_botlin > 0) ? inv_lbreaks[1] : out - wrap_offset; + } + + /* We may have deleted some lines. If so, clear the left over + blank ones at the bottom out. */ + if (_rl_vis_botlin > inv_botlin) + { + char *tt; + for (; linenum <= _rl_vis_botlin; linenum++) + { + tt = VIS_CHARS (linenum); + _rl_move_vert (linenum); + _rl_move_cursor_relative (0, tt); + _rl_clear_to_eol + ((linenum == _rl_vis_botlin) ? strlen (tt) : _rl_screenwidth); + } + } + _rl_vis_botlin = inv_botlin; + + /* CHANGED_SCREEN_LINE is set to 1 if we have moved to a + different screen line during this redisplay. */ + changed_screen_line = _rl_last_v_pos != cursor_linenum; + if (changed_screen_line) + { + _rl_move_vert (cursor_linenum); + /* If we moved up to the line with the prompt using _rl_term_up, + the physical cursor position on the screen stays the same, + but the buffer position needs to be adjusted to account + for invisible characters. */ + if ((MB_CUR_MAX == 1 || rl_byte_oriented) && cursor_linenum == 0 && wrap_offset) + _rl_last_c_pos += wrap_offset; + } + + /* We have to reprint the prompt if it contains invisible + characters, since it's not generally OK to just reprint + the characters from the current cursor position. But we + only need to reprint it if the cursor is before the last + invisible character in the prompt string. */ + nleft = prompt_visible_length + wrap_offset; + if (cursor_linenum == 0 && wrap_offset > 0 && _rl_last_c_pos > 0 && +#if 0 + _rl_last_c_pos <= PROMPT_ENDING_INDEX && local_prompt) +#else + _rl_last_c_pos < PROMPT_ENDING_INDEX && local_prompt) +#endif + { +#if defined (__MSDOS__) + putc ('\r', rl_outstream); +#else + if (_rl_term_cr) + tputs (_rl_term_cr, 1, _rl_output_character_function); +#endif + if (modmark) + _rl_output_some_chars ("*", 1); + + _rl_output_some_chars (local_prompt, nleft); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + _rl_last_c_pos = _rl_col_width (local_prompt, 0, nleft, 1) - wrap_offset + modmark; + else + _rl_last_c_pos = nleft + modmark; + } + + /* Where on that line? And where does that line start + in the buffer? */ + pos = inv_lbreaks[cursor_linenum]; + /* nleft == number of characters in the line buffer between the + start of the line and the desired cursor position. */ + nleft = cpos_buffer_position - pos; + + /* NLEFT is now a number of characters in a buffer. When in a + multibyte locale, however, _rl_last_c_pos is an absolute cursor + position that doesn't take invisible characters in the prompt + into account. We use a fudge factor to compensate. */ + + /* Since _rl_backspace() doesn't know about invisible characters in the + prompt, and there's no good way to tell it, we compensate for + those characters here and call _rl_backspace() directly. */ + if (wrap_offset && cursor_linenum == 0 && nleft < _rl_last_c_pos) + { + /* TX == new physical cursor position in multibyte locale. */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + tx = _rl_col_width (&visible_line[pos], 0, nleft, 1) - visible_wrap_offset; + else + tx = nleft; + if (tx >= 0 && _rl_last_c_pos > tx) + { + _rl_backspace (_rl_last_c_pos - tx); /* XXX */ + _rl_last_c_pos = tx; + } + } + + /* We need to note that in a multibyte locale we are dealing with + _rl_last_c_pos as an absolute cursor position, but moving to a + point specified by a buffer position (NLEFT) that doesn't take + invisible characters into account. */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + _rl_move_cursor_relative (nleft, &invisible_line[pos]); + else if (nleft != _rl_last_c_pos) + _rl_move_cursor_relative (nleft, &invisible_line[pos]); + } + } + else /* Do horizontal scrolling. */ + { +#define M_OFFSET(margin, offset) ((margin) == 0 ? offset : 0) + int lmargin, ndisp, nleft, phys_c_pos, t; + + /* Always at top line. */ + _rl_last_v_pos = 0; + + /* Compute where in the buffer the displayed line should start. This + will be LMARGIN. */ + + /* The number of characters that will be displayed before the cursor. */ + ndisp = cpos_buffer_position - wrap_offset; + nleft = prompt_visible_length + wrap_offset; + /* Where the new cursor position will be on the screen. This can be + longer than SCREENWIDTH; if it is, lmargin will be adjusted. */ + phys_c_pos = cpos_buffer_position - (last_lmargin ? last_lmargin : wrap_offset); + t = _rl_screenwidth / 3; + + /* If the number of characters had already exceeded the screenwidth, + last_lmargin will be > 0. */ + + /* If the number of characters to be displayed is more than the screen + width, compute the starting offset so that the cursor is about + two-thirds of the way across the screen. */ + if (phys_c_pos > _rl_screenwidth - 2) + { + lmargin = cpos_buffer_position - (2 * t); + if (lmargin < 0) + lmargin = 0; + /* If the left margin would be in the middle of a prompt with + invisible characters, don't display the prompt at all. */ + if (wrap_offset && lmargin > 0 && lmargin < nleft) + lmargin = nleft; + } + else if (ndisp < _rl_screenwidth - 2) /* XXX - was -1 */ + lmargin = 0; + else if (phys_c_pos < 1) + { + /* If we are moving back towards the beginning of the line and + the last margin is no longer correct, compute a new one. */ + lmargin = ((cpos_buffer_position - 1) / t) * t; /* XXX */ + if (wrap_offset && lmargin > 0 && lmargin < nleft) + lmargin = nleft; + } + else + lmargin = last_lmargin; + + displaying_prompt_first_line = lmargin < nleft; + + /* If the first character on the screen isn't the first character + in the display line, indicate this with a special character. */ + if (lmargin > 0) + line[lmargin] = '<'; + + /* If SCREENWIDTH characters starting at LMARGIN do not encompass + the whole line, indicate that with a special character at the + right edge of the screen. If LMARGIN is 0, we need to take the + wrap offset into account. */ + t = lmargin + M_OFFSET (lmargin, wrap_offset) + _rl_screenwidth; + if (t < out) + line[t - 1] = '>'; + + if (rl_display_fixed == 0 || forced_display || lmargin != last_lmargin) + { + forced_display = 0; + o_cpos = _rl_last_c_pos; + cpos_adjusted = 0; + update_line (&visible_line[last_lmargin], + &invisible_line[lmargin], + 0, + _rl_screenwidth + visible_wrap_offset, + _rl_screenwidth + (lmargin ? 0 : wrap_offset), + 0); + + if ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) && + displaying_prompt_first_line && OLD_CPOS_IN_PROMPT()) + _rl_last_c_pos -= prompt_invis_chars_first_line; /* XXX - was wrap_offset */ + + /* If the visible new line is shorter than the old, but the number + of invisible characters is greater, and we are at the end of + the new line, we need to clear to eol. */ + t = _rl_last_c_pos - M_OFFSET (lmargin, wrap_offset); + if ((M_OFFSET (lmargin, wrap_offset) > visible_wrap_offset) && + (_rl_last_c_pos == out) && displaying_prompt_first_line && + t < visible_first_line_len) + { + nleft = _rl_screenwidth - t; + _rl_clear_to_eol (nleft); + } + visible_first_line_len = out - lmargin - M_OFFSET (lmargin, wrap_offset); + if (visible_first_line_len > _rl_screenwidth) + visible_first_line_len = _rl_screenwidth; + + _rl_move_cursor_relative (cpos_buffer_position - lmargin, &invisible_line[lmargin]); + last_lmargin = lmargin; + } + } + fflush (rl_outstream); + + /* Swap visible and non-visible lines. */ + { + struct line_state *vtemp = line_state_visible; + + line_state_visible = line_state_invisible; + line_state_invisible = vtemp; + + rl_display_fixed = 0; + /* If we are displaying on a single line, and last_lmargin is > 0, we + are not displaying any invisible characters, so set visible_wrap_offset + to 0. */ + if (_rl_horizontal_scroll_mode && last_lmargin) + visible_wrap_offset = 0; + else + visible_wrap_offset = wrap_offset; + } + + RL_UNSETSTATE (RL_STATE_REDISPLAYING); + _rl_release_sigint (); +} + +/* PWP: update_line() is based on finding the middle difference of each + line on the screen; vis: + + /old first difference + /beginning of line | /old last same /old EOL + v v v v +old: eddie> Oh, my little gruntle-buggy is to me, as lurgid as +new: eddie> Oh, my little buggy says to me, as lurgid as + ^ ^ ^ ^ + \beginning of line | \new last same \new end of line + \new first difference + + All are character pointers for the sake of speed. Special cases for + no differences, as well as for end of line additions must be handled. + + Could be made even smarter, but this works well enough */ +static void +update_line (old, new, current_line, omax, nmax, inv_botlin) + register char *old, *new; + int current_line, omax, nmax, inv_botlin; +{ + register char *ofd, *ols, *oe, *nfd, *nls, *ne; + int temp, lendiff, wsatend, od, nd, twidth, o_cpos; + int current_invis_chars; + int col_lendiff, col_temp; + int bytes_to_insert; +#if defined (HANDLE_MULTIBYTE) + mbstate_t ps_new, ps_old; + int new_offset, old_offset; +#endif + + /* If we're at the right edge of a terminal that supports xn, we're + ready to wrap around, so do so. This fixes problems with knowing + the exact cursor position and cut-and-paste with certain terminal + emulators. In this calculation, TEMP is the physical screen + position of the cursor. */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + temp = _rl_last_c_pos; + else + temp = _rl_last_c_pos - WRAP_OFFSET (_rl_last_v_pos, visible_wrap_offset); + if (temp == _rl_screenwidth && _rl_term_autowrap && !_rl_horizontal_scroll_mode + && _rl_last_v_pos == current_line - 1) + { +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + wchar_t wc; + mbstate_t ps; + int tempwidth, bytes; + size_t ret; + + /* This fixes only double-column characters, but if the wrapped + character consumes more than three columns, spaces will be + inserted in the string buffer. */ + if (current_line < line_state_visible->wbsize && line_state_visible->wrapped_line[current_line] > 0) + _rl_clear_to_eol (line_state_visible->wrapped_line[current_line]); + + memset (&ps, 0, sizeof (mbstate_t)); + ret = mbrtowc (&wc, new, MB_CUR_MAX, &ps); + if (MB_INVALIDCH (ret)) + { + tempwidth = 1; + ret = 1; + } + else if (MB_NULLWCH (ret)) + tempwidth = 0; + else + tempwidth = WCWIDTH (wc); + + if (tempwidth > 0) + { + int count, i; + bytes = ret; + for (count = 0; count < bytes; count++) + putc (new[count], rl_outstream); + _rl_last_c_pos = tempwidth; + _rl_last_v_pos++; + memset (&ps, 0, sizeof (mbstate_t)); + ret = mbrtowc (&wc, old, MB_CUR_MAX, &ps); + if (ret != 0 && bytes != 0) + { + if (MB_INVALIDCH (ret)) + ret = 1; + memmove (old+bytes, old+ret, strlen (old+ret)); + memcpy (old, new, bytes); + /* Fix up indices if we copy data from one line to another */ + omax += bytes - ret; + for (i = current_line+1; i <= inv_botlin+1; i++) + vis_lbreaks[i] += bytes - ret; + } + } + else + { + putc (' ', rl_outstream); + _rl_last_c_pos = 1; + _rl_last_v_pos++; + if (old[0] && new[0]) + old[0] = new[0]; + } + } + else +#endif + { + if (new[0]) + putc (new[0], rl_outstream); + else + putc (' ', rl_outstream); + _rl_last_c_pos = 1; + _rl_last_v_pos++; + if (old[0] && new[0]) + old[0] = new[0]; + } + } + + + /* Find first difference. */ +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + /* See if the old line is a subset of the new line, so that the + only change is adding characters. */ + temp = (omax < nmax) ? omax : nmax; + if (memcmp (old, new, temp) == 0) /* adding at the end */ + { + new_offset = old_offset = temp; + ofd = old + temp; + nfd = new + temp; + } + else + { + memset (&ps_new, 0, sizeof(mbstate_t)); + memset (&ps_old, 0, sizeof(mbstate_t)); + + if (omax == nmax && STREQN (new, old, omax)) + { + old_offset = omax; + new_offset = nmax; + ofd = old + omax; + nfd = new + nmax; + } + else + { + new_offset = old_offset = 0; + for (ofd = old, nfd = new; + (ofd - old < omax) && *ofd && + _rl_compare_chars(old, old_offset, &ps_old, new, new_offset, &ps_new); ) + { + old_offset = _rl_find_next_mbchar (old, old_offset, 1, MB_FIND_ANY); + new_offset = _rl_find_next_mbchar (new, new_offset, 1, MB_FIND_ANY); + + ofd = old + old_offset; + nfd = new + new_offset; + } + } + } + } + else +#endif + for (ofd = old, nfd = new; + (ofd - old < omax) && *ofd && (*ofd == *nfd); + ofd++, nfd++) + ; + + /* Move to the end of the screen line. ND and OD are used to keep track + of the distance between ne and new and oe and old, respectively, to + move a subtraction out of each loop. */ + for (od = ofd - old, oe = ofd; od < omax && *oe; oe++, od++); + for (nd = nfd - new, ne = nfd; nd < nmax && *ne; ne++, nd++); + + /* If no difference, continue to next line. */ + if (ofd == oe && nfd == ne) + return; + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0 && _rl_utf8locale) + { + wchar_t wc; + mbstate_t ps = { 0 }; + int t; + + /* If the first character in the difference is a zero-width character, + assume it's a combining character and back one up so the two base + characters no longer compare equivalently. */ + t = mbrtowc (&wc, ofd, MB_CUR_MAX, &ps); + if (t > 0 && UNICODE_COMBINING_CHAR (wc) && WCWIDTH (wc) == 0) + { + old_offset = _rl_find_prev_mbchar (old, ofd - old, MB_FIND_ANY); + new_offset = _rl_find_prev_mbchar (new, nfd - new, MB_FIND_ANY); + ofd = old + old_offset; /* equal by definition */ + nfd = new + new_offset; + } + } +#endif + + wsatend = 1; /* flag for trailing whitespace */ + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + ols = old + _rl_find_prev_mbchar (old, oe - old, MB_FIND_ANY); + nls = new + _rl_find_prev_mbchar (new, ne - new, MB_FIND_ANY); + + while ((ols > ofd) && (nls > nfd)) + { + memset (&ps_old, 0, sizeof (mbstate_t)); + memset (&ps_new, 0, sizeof (mbstate_t)); + +#if 0 + /* On advice from jir@yamato.ibm.com */ + _rl_adjust_point (old, ols - old, &ps_old); + _rl_adjust_point (new, nls - new, &ps_new); +#endif + + if (_rl_compare_chars (old, ols - old, &ps_old, new, nls - new, &ps_new) == 0) + break; + + if (*ols == ' ') + wsatend = 0; + + ols = old + _rl_find_prev_mbchar (old, ols - old, MB_FIND_ANY); + nls = new + _rl_find_prev_mbchar (new, nls - new, MB_FIND_ANY); + } + } + else + { +#endif /* HANDLE_MULTIBYTE */ + ols = oe - 1; /* find last same */ + nls = ne - 1; + while ((ols > ofd) && (nls > nfd) && (*ols == *nls)) + { + if (*ols != ' ') + wsatend = 0; + ols--; + nls--; + } +#if defined (HANDLE_MULTIBYTE) + } +#endif + + if (wsatend) + { + ols = oe; + nls = ne; + } +#if defined (HANDLE_MULTIBYTE) + /* This may not work for stateful encoding, but who cares? To handle + stateful encoding properly, we have to scan each string from the + beginning and compare. */ + else if (_rl_compare_chars (ols, 0, NULL, nls, 0, NULL) == 0) +#else + else if (*ols != *nls) +#endif + { + if (*ols) /* don't step past the NUL */ + { + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + ols = old + _rl_find_next_mbchar (old, ols - old, 1, MB_FIND_ANY); + else + ols++; + } + if (*nls) + { + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + nls = new + _rl_find_next_mbchar (new, nls - new, 1, MB_FIND_ANY); + else + nls++; + } + } + + /* count of invisible characters in the current invisible line. */ + current_invis_chars = W_OFFSET (current_line, wrap_offset); + if (_rl_last_v_pos != current_line) + { + _rl_move_vert (current_line); + if ((MB_CUR_MAX == 1 || rl_byte_oriented) && current_line == 0 && visible_wrap_offset) + _rl_last_c_pos += visible_wrap_offset; + } + + /* If this is the first line and there are invisible characters in the + prompt string, and the prompt string has not changed, and the current + cursor position is before the last invisible character in the prompt, + and the index of the character to move to is past the end of the prompt + string, then redraw the entire prompt string. We can only do this + reliably if the terminal supports a `cr' capability. + + This is not an efficiency hack -- there is a problem with redrawing + portions of the prompt string if they contain terminal escape + sequences (like drawing the `unbold' sequence without a corresponding + `bold') that manifests itself on certain terminals. */ + + lendiff = local_prompt_len; + od = ofd - old; /* index of first difference in visible line */ + if (current_line == 0 && !_rl_horizontal_scroll_mode && + _rl_term_cr && lendiff > prompt_visible_length && _rl_last_c_pos > 0 && + od >= lendiff && _rl_last_c_pos < PROMPT_ENDING_INDEX) + { +#if defined (__MSDOS__) + putc ('\r', rl_outstream); +#else + tputs (_rl_term_cr, 1, _rl_output_character_function); +#endif + if (modmark) + _rl_output_some_chars ("*", 1); + _rl_output_some_chars (local_prompt, lendiff); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + /* We take wrap_offset into account here so we can pass correct + information to _rl_move_cursor_relative. */ + _rl_last_c_pos = _rl_col_width (local_prompt, 0, lendiff, 1) - wrap_offset + modmark; + cpos_adjusted = 1; + } + else + _rl_last_c_pos = lendiff + modmark; + } + + o_cpos = _rl_last_c_pos; + + /* When this function returns, _rl_last_c_pos is correct, and an absolute + cursor position in multibyte mode, but a buffer index when not in a + multibyte locale. */ + _rl_move_cursor_relative (od, old); + +#if defined (HANDLE_MULTIBYTE) + /* We need to indicate that the cursor position is correct in the presence of + invisible characters in the prompt string. Let's see if setting this when + we make sure we're at the end of the drawn prompt string works. */ + if (current_line == 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0 && + (_rl_last_c_pos > 0 || o_cpos > 0) && + _rl_last_c_pos == prompt_physical_chars) + cpos_adjusted = 1; +#endif + + /* if (len (new) > len (old)) + lendiff == difference in buffer (bytes) + col_lendiff == difference on screen (columns) + When not using multibyte characters, these are equal */ + lendiff = (nls - nfd) - (ols - ofd); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + col_lendiff = _rl_col_width (new, nfd - new, nls - new, 1) - _rl_col_width (old, ofd - old, ols - old, 1); + else + col_lendiff = lendiff; + + /* If we are changing the number of invisible characters in a line, and + the spot of first difference is before the end of the invisible chars, + lendiff needs to be adjusted. */ + if (current_line == 0 && /* !_rl_horizontal_scroll_mode && */ + current_invis_chars != visible_wrap_offset) + { + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + lendiff += visible_wrap_offset - current_invis_chars; + col_lendiff += visible_wrap_offset - current_invis_chars; + } + else + { + lendiff += visible_wrap_offset - current_invis_chars; + col_lendiff = lendiff; + } + } + + /* We use temp as a count of the number of bytes from the first difference + to the end of the new line. col_temp is the corresponding number of + screen columns. A `dumb' update moves to the spot of first difference + and writes TEMP bytes. */ + /* Insert (diff (len (old), len (new)) ch. */ + temp = ne - nfd; + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + col_temp = _rl_col_width (new, nfd - new, ne - new, 1); + else + col_temp = temp; + + /* how many bytes from the new line buffer to write to the display */ + bytes_to_insert = nls - nfd; + + /* col_lendiff > 0 if we are adding characters to the line */ + if (col_lendiff > 0) /* XXX - was lendiff */ + { + /* Non-zero if we're increasing the number of lines. */ + int gl = current_line >= _rl_vis_botlin && inv_botlin > _rl_vis_botlin; + /* If col_lendiff is > 0, implying that the new string takes up more + screen real estate than the old, but lendiff is < 0, meaning that it + takes fewer bytes, we need to just output the characters starting + from the first difference. These will overwrite what is on the + display, so there's no reason to do a smart update. This can really + only happen in a multibyte environment. */ + if (lendiff < 0) + { + _rl_output_some_chars (nfd, temp); + _rl_last_c_pos += col_temp; /* XXX - was _rl_col_width (nfd, 0, temp, 1); */ + /* If nfd begins before any invisible characters in the prompt, + adjust _rl_last_c_pos to account for wrap_offset and set + cpos_adjusted to let the caller know. */ + if (current_line == 0 && displaying_prompt_first_line && wrap_offset && ((nfd - new) <= prompt_last_invisible)) + { + _rl_last_c_pos -= wrap_offset; + cpos_adjusted = 1; + } + return; + } + /* Sometimes it is cheaper to print the characters rather than + use the terminal's capabilities. If we're growing the number + of lines, make sure we actually cause the new line to wrap + around on auto-wrapping terminals. */ + else if (_rl_terminal_can_insert && ((2 * col_temp) >= col_lendiff || _rl_term_IC) && (!_rl_term_autowrap || !gl)) + { + /* If lendiff > prompt_visible_length and _rl_last_c_pos == 0 and + _rl_horizontal_scroll_mode == 1, inserting the characters with + _rl_term_IC or _rl_term_ic will screw up the screen because of the + invisible characters. We need to just draw them. */ + /* The same thing happens if we're trying to draw before the last + invisible character in the prompt string or we're increasing the + number of invisible characters in the line and we're not drawing + the entire prompt string. */ + if (*ols && ((_rl_horizontal_scroll_mode && + _rl_last_c_pos == 0 && + lendiff > prompt_visible_length && + current_invis_chars > 0) == 0) && + (((MB_CUR_MAX > 1 && rl_byte_oriented == 0) && + current_line == 0 && wrap_offset && + ((nfd - new) <= prompt_last_invisible) && + (col_lendiff < prompt_visible_length)) == 0) && + (visible_wrap_offset >= current_invis_chars)) + { + open_some_spaces (col_lendiff); + _rl_output_some_chars (nfd, bytes_to_insert); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + _rl_last_c_pos += _rl_col_width (nfd, 0, bytes_to_insert, 1); + else + _rl_last_c_pos += bytes_to_insert; + } + else if ((MB_CUR_MAX == 1 || rl_byte_oriented != 0) && *ols == 0 && lendiff > 0) + { + /* At the end of a line the characters do not have to + be "inserted". They can just be placed on the screen. */ + _rl_output_some_chars (nfd, temp); + _rl_last_c_pos += col_temp; + return; + } + else /* just write from first difference to end of new line */ + { + _rl_output_some_chars (nfd, temp); + _rl_last_c_pos += col_temp; + /* If nfd begins before the last invisible character in the + prompt, adjust _rl_last_c_pos to account for wrap_offset + and set cpos_adjusted to let the caller know. */ + if ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) && current_line == 0 && displaying_prompt_first_line && wrap_offset && ((nfd - new) <= prompt_last_invisible)) + { + _rl_last_c_pos -= wrap_offset; + cpos_adjusted = 1; + } + return; + } + + if (bytes_to_insert > lendiff) + { + /* If nfd begins before the last invisible character in the + prompt, adjust _rl_last_c_pos to account for wrap_offset + and set cpos_adjusted to let the caller know. */ + if ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) && current_line == 0 && displaying_prompt_first_line && wrap_offset && ((nfd - new) <= prompt_last_invisible)) + { + _rl_last_c_pos -= wrap_offset; + cpos_adjusted = 1; + } + } + } + else + { + /* cannot insert chars, write to EOL */ + _rl_output_some_chars (nfd, temp); + _rl_last_c_pos += col_temp; + /* If we're in a multibyte locale and were before the last invisible + char in the current line (which implies we just output some invisible + characters) we need to adjust _rl_last_c_pos, since it represents + a physical character position. */ + if ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) && + current_line == prompt_last_screen_line && wrap_offset && + displaying_prompt_first_line && + wrap_offset != prompt_invis_chars_first_line && + ((nfd-new) < (prompt_last_invisible-(current_line*_rl_screenwidth)))) + { + _rl_last_c_pos -= wrap_offset - prompt_invis_chars_first_line; + cpos_adjusted = 1; + } + } + } + else /* Delete characters from line. */ + { + /* If possible and inexpensive to use terminal deletion, then do so. */ + if (_rl_term_dc && (2 * col_temp) >= -col_lendiff) + { + /* If all we're doing is erasing the invisible characters in the + prompt string, don't bother. It screws up the assumptions + about what's on the screen. */ + if (_rl_horizontal_scroll_mode && _rl_last_c_pos == 0 && + displaying_prompt_first_line && + -lendiff == visible_wrap_offset) + col_lendiff = 0; + + /* If we have moved lmargin and we're shrinking the line, we've + already moved the cursor to the first character of the new line, + so deleting -col_lendiff characters will mess up the cursor + position calculation */ + if (_rl_horizontal_scroll_mode && displaying_prompt_first_line == 0 && + col_lendiff && _rl_last_c_pos < -col_lendiff) + col_lendiff = 0; + + if (col_lendiff) + delete_chars (-col_lendiff); /* delete (diff) characters */ + + /* Copy (new) chars to screen from first diff to last match, + overwriting what is there. */ + if (bytes_to_insert > 0) + { + /* If nfd begins at the prompt, or before the invisible + characters in the prompt, we need to adjust _rl_last_c_pos + in a multibyte locale to account for the wrap offset and + set cpos_adjusted accordingly. */ + _rl_output_some_chars (nfd, bytes_to_insert); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + _rl_last_c_pos += _rl_col_width (nfd, 0, bytes_to_insert, 1); + if (current_line == 0 && wrap_offset && + displaying_prompt_first_line && + _rl_last_c_pos > wrap_offset && + ((nfd - new) <= prompt_last_invisible)) + { + _rl_last_c_pos -= wrap_offset; + cpos_adjusted = 1; + } + } + else + _rl_last_c_pos += bytes_to_insert; + + /* XXX - we only want to do this if we are at the end of the line + so we move there with _rl_move_cursor_relative */ + if (_rl_horizontal_scroll_mode && ((oe-old) > (ne-new))) + { + _rl_move_cursor_relative (ne-new, new); + goto clear_rest_of_line; + } + } + } + /* Otherwise, print over the existing material. */ + else + { + if (temp > 0) + { + /* If nfd begins at the prompt, or before the invisible + characters in the prompt, we need to adjust _rl_last_c_pos + in a multibyte locale to account for the wrap offset and + set cpos_adjusted accordingly. */ + _rl_output_some_chars (nfd, temp); + _rl_last_c_pos += col_temp; /* XXX */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + if (current_line == 0 && wrap_offset && + displaying_prompt_first_line && + _rl_last_c_pos > wrap_offset && + ((nfd - new) <= prompt_last_invisible)) + { + _rl_last_c_pos -= wrap_offset; + cpos_adjusted = 1; + } + } + } +clear_rest_of_line: + lendiff = (oe - old) - (ne - new); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + col_lendiff = _rl_col_width (old, 0, oe - old, 1) - _rl_col_width (new, 0, ne - new, 1); + else + col_lendiff = lendiff; + + /* If we've already printed over the entire width of the screen, + including the old material, then col_lendiff doesn't matter and + space_to_eol will insert too many spaces. XXX - maybe we should + adjust col_lendiff based on the difference between _rl_last_c_pos + and _rl_screenwidth */ + if (col_lendiff && ((MB_CUR_MAX == 1 || rl_byte_oriented) || (_rl_last_c_pos < _rl_screenwidth))) + { + if (_rl_term_autowrap && current_line < inv_botlin) + space_to_eol (col_lendiff); + else + _rl_clear_to_eol (col_lendiff); + } + } + } +} + +/* Tell the update routines that we have moved onto a new (empty) line. */ +int +rl_on_new_line () +{ + if (visible_line) + visible_line[0] = '\0'; + + _rl_last_c_pos = _rl_last_v_pos = 0; + _rl_vis_botlin = last_lmargin = 0; + if (vis_lbreaks) + vis_lbreaks[0] = vis_lbreaks[1] = 0; + visible_wrap_offset = 0; + return 0; +} + +/* Tell the update routines that we have moved onto a new line with the + prompt already displayed. Code originally from the version of readline + distributed with CLISP. rl_expand_prompt must have already been called + (explicitly or implicitly). This still doesn't work exactly right. */ +int +rl_on_new_line_with_prompt () +{ + int prompt_size, i, l, real_screenwidth, newlines; + char *prompt_last_line, *lprompt; + + /* Initialize visible_line and invisible_line to ensure that they can hold + the already-displayed prompt. */ + prompt_size = strlen (rl_prompt) + 1; + init_line_structures (prompt_size); + + /* Make sure the line structures hold the already-displayed prompt for + redisplay. */ + lprompt = local_prompt ? local_prompt : rl_prompt; + strcpy (visible_line, lprompt); + strcpy (invisible_line, lprompt); + + /* If the prompt contains newlines, take the last tail. */ + prompt_last_line = strrchr (rl_prompt, '\n'); + if (!prompt_last_line) + prompt_last_line = rl_prompt; + + l = strlen (prompt_last_line); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + _rl_last_c_pos = _rl_col_width (prompt_last_line, 0, l, 1); /* XXX */ + else + _rl_last_c_pos = l; + + /* Dissect prompt_last_line into screen lines. Note that here we have + to use the real screenwidth. Readline's notion of screenwidth might be + one less, see terminal.c. */ + real_screenwidth = _rl_screenwidth + (_rl_term_autowrap ? 0 : 1); + _rl_last_v_pos = l / real_screenwidth; + /* If the prompt length is a multiple of real_screenwidth, we don't know + whether the cursor is at the end of the last line, or already at the + beginning of the next line. Output a newline just to be safe. */ + if (l > 0 && (l % real_screenwidth) == 0) + _rl_output_some_chars ("\n", 1); + last_lmargin = 0; + + newlines = 0; i = 0; + while (i <= l) + { + _rl_vis_botlin = newlines; + vis_lbreaks[newlines++] = i; + i += real_screenwidth; + } + vis_lbreaks[newlines] = l; + visible_wrap_offset = 0; + + rl_display_prompt = rl_prompt; /* XXX - make sure it's set */ + + return 0; +} + +/* Actually update the display, period. */ +int +rl_forced_update_display () +{ + register char *temp; + + if (visible_line) + { + temp = visible_line; + while (*temp) + *temp++ = '\0'; + } + rl_on_new_line (); + forced_display++; + (*rl_redisplay_function) (); + return 0; +} + +/* Move the cursor from _rl_last_c_pos to NEW, which are buffer indices. + (Well, when we don't have multibyte characters, _rl_last_c_pos is a + buffer index.) + DATA is the contents of the screen line of interest; i.e., where + the movement is being done. */ +void +_rl_move_cursor_relative (new, data) + int new; + const char *data; +{ + register int i; + int woff; /* number of invisible chars on current line */ + int cpos, dpos; /* current and desired cursor positions */ + int adjust; + + woff = WRAP_OFFSET (_rl_last_v_pos, wrap_offset); + cpos = _rl_last_c_pos; + + if (cpos == 0 && cpos == new) + return; + +#if defined (HANDLE_MULTIBYTE) + /* If we have multibyte characters, NEW is indexed by the buffer point in + a multibyte string, but _rl_last_c_pos is the display position. In + this case, NEW's display position is not obvious and must be + calculated. We need to account for invisible characters in this line, + as long as we are past them and they are counted by _rl_col_width. */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + adjust = 1; + /* Try to short-circuit common cases and eliminate a bunch of multibyte + character function calls. */ + /* 1. prompt string */ + if (new == local_prompt_len && memcmp (data, local_prompt, new) == 0) + { + dpos = prompt_physical_chars; + cpos_adjusted = 1; + adjust = 0; + } + /* 2. prompt_string + line contents */ + else if (new > local_prompt_len && local_prompt && memcmp (data, local_prompt, local_prompt_len) == 0) + { + dpos = prompt_physical_chars + _rl_col_width (data, local_prompt_len, new, 1); + cpos_adjusted = 1; + adjust = 0; + } + else + dpos = _rl_col_width (data, 0, new, 1); + + if (displaying_prompt_first_line == 0) + adjust = 0; + + /* Use NEW when comparing against the last invisible character in the + prompt string, since they're both buffer indices and DPOS is a + desired display position. */ + if (adjust && ((new > prompt_last_invisible) || /* XXX - don't use woff here */ + (prompt_physical_chars >= _rl_screenwidth && + _rl_last_v_pos == prompt_last_screen_line && + wrap_offset >= woff && dpos >= woff && + new > (prompt_last_invisible-(_rl_screenwidth*_rl_last_v_pos)-wrap_offset)))) + /* XXX last comparison might need to be >= */ + { + dpos -= woff; + /* Since this will be assigned to _rl_last_c_pos at the end (more + precisely, _rl_last_c_pos == dpos when this function returns), + let the caller know. */ + cpos_adjusted = 1; + } + } + else +#endif + dpos = new; + + /* If we don't have to do anything, then return. */ + if (cpos == dpos) + return; + + /* It may be faster to output a CR, and then move forwards instead + of moving backwards. */ + /* i == current physical cursor position. */ +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + i = _rl_last_c_pos; + else +#endif + i = _rl_last_c_pos - woff; + if (dpos == 0 || CR_FASTER (dpos, _rl_last_c_pos) || + (_rl_term_autowrap && i == _rl_screenwidth)) + { +#if defined (__MSDOS__) + putc ('\r', rl_outstream); +#else + tputs (_rl_term_cr, 1, _rl_output_character_function); +#endif /* !__MSDOS__ */ + cpos = _rl_last_c_pos = 0; + } + + if (cpos < dpos) + { + /* Move the cursor forward. We do it by printing the command + to move the cursor forward if there is one, else print that + portion of the output buffer again. Which is cheaper? */ + + /* The above comment is left here for posterity. It is faster + to print one character (non-control) than to print a control + sequence telling the terminal to move forward one character. + That kind of control is for people who don't know what the + data is underneath the cursor. */ + + /* However, we need a handle on where the current display position is + in the buffer for the immediately preceding comment to be true. + In multibyte locales, we don't currently have that info available. + Without it, we don't know where the data we have to display begins + in the buffer and we have to go back to the beginning of the screen + line. In this case, we can use the terminal sequence to move forward + if it's available. */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + if (_rl_term_forward_char) + { + for (i = cpos; i < dpos; i++) + tputs (_rl_term_forward_char, 1, _rl_output_character_function); + } + else + { + tputs (_rl_term_cr, 1, _rl_output_character_function); + for (i = 0; i < new; i++) + putc (data[i], rl_outstream); + } + } + else + for (i = cpos; i < new; i++) + putc (data[i], rl_outstream); + } + +#if defined (HANDLE_MULTIBYTE) + /* NEW points to the buffer point, but _rl_last_c_pos is the display point. + The byte length of the string is probably bigger than the column width + of the string, which means that if NEW == _rl_last_c_pos, then NEW's + display point is less than _rl_last_c_pos. */ +#endif + else if (cpos > dpos) + _rl_backspace (cpos - dpos); + + _rl_last_c_pos = dpos; +} + +/* PWP: move the cursor up or down. */ +void +_rl_move_vert (to) + int to; +{ + register int delta, i; + + if (_rl_last_v_pos == to || to > _rl_screenheight) + return; + + if ((delta = to - _rl_last_v_pos) > 0) + { + for (i = 0; i < delta; i++) + putc ('\n', rl_outstream); +#if defined (__MSDOS__) + putc ('\r', rl_outstream); +#else + tputs (_rl_term_cr, 1, _rl_output_character_function); +#endif + _rl_last_c_pos = 0; + } + else + { /* delta < 0 */ +#ifdef __DJGPP__ + int row, col; + + fflush (rl_outstream); + ScreenGetCursor (&row, &col); + ScreenSetCursor (row + delta, col); + i = -delta; +#else + if (_rl_term_up && *_rl_term_up) + for (i = 0; i < -delta; i++) + tputs (_rl_term_up, 1, _rl_output_character_function); +#endif /* !__DJGPP__ */ + } + + _rl_last_v_pos = to; /* Now TO is here */ +} + +/* Physically print C on rl_outstream. This is for functions which know + how to optimize the display. Return the number of characters output. */ +int +rl_show_char (c) + int c; +{ + int n = 1; + if (META_CHAR (c) && (_rl_output_meta_chars == 0)) + { + fprintf (rl_outstream, "M-"); + n += 2; + c = UNMETA (c); + } + +#if defined (DISPLAY_TABS) + if ((CTRL_CHAR (c) && c != '\t') || c == RUBOUT) +#else + if (CTRL_CHAR (c) || c == RUBOUT) +#endif /* !DISPLAY_TABS */ + { + fprintf (rl_outstream, "C-"); + n += 2; + c = CTRL_CHAR (c) ? UNCTRL (c) : '?'; + } + + putc (c, rl_outstream); + fflush (rl_outstream); + return n; +} + +int +rl_character_len (c, pos) + register int c, pos; +{ + unsigned char uc; + + uc = (unsigned char)c; + + if (META_CHAR (uc)) + return ((_rl_output_meta_chars == 0) ? 4 : 1); + + if (uc == '\t') + { +#if defined (DISPLAY_TABS) + return (((pos | 7) + 1) - pos); +#else + return (2); +#endif /* !DISPLAY_TABS */ + } + + if (CTRL_CHAR (c) || c == RUBOUT) + return (2); + + return ((ISPRINT (uc)) ? 1 : 2); +} +/* How to print things in the "echo-area". The prompt is treated as a + mini-modeline. */ +static int msg_saved_prompt = 0; + +#if defined (USE_VARARGS) +int +#if defined (PREFER_STDARG) +rl_message (const char *format, ...) +#else +rl_message (va_alist) + va_dcl +#endif +{ + va_list args; +#if defined (PREFER_VARARGS) + char *format; +#endif +#if defined (HAVE_VSNPRINTF) + int bneed; +#endif + +#if defined (PREFER_STDARG) + va_start (args, format); +#else + va_start (args); + format = va_arg (args, char *); +#endif + + if (msg_buf == 0) + msg_buf = xmalloc (msg_bufsiz = 128); + +#if defined (HAVE_VSNPRINTF) + bneed = vsnprintf (msg_buf, msg_bufsiz - 1, format, args); + if (bneed >= msg_bufsiz - 1) + { + msg_bufsiz = bneed + 1; + msg_buf = xrealloc (msg_buf, msg_bufsiz); + va_end (args); + +#if defined (PREFER_STDARG) + va_start (args, format); +#else + va_start (args); + format = va_arg (args, char *); +#endif + vsnprintf (msg_buf, msg_bufsiz - 1, format, args); + } +#else + vsprintf (msg_buf, format, args); + msg_buf[msg_bufsiz - 1] = '\0'; /* overflow? */ +#endif + va_end (args); + + if (saved_local_prompt == 0) + { + rl_save_prompt (); + msg_saved_prompt = 1; + } + else if (local_prompt != saved_local_prompt) + { + FREE (local_prompt); + FREE (local_prompt_prefix); + local_prompt = (char *)NULL; + } + rl_display_prompt = msg_buf; + local_prompt = expand_prompt (msg_buf, &prompt_visible_length, + &prompt_last_invisible, + &prompt_invis_chars_first_line, + &prompt_physical_chars); + local_prompt_prefix = (char *)NULL; + local_prompt_len = local_prompt ? strlen (local_prompt) : 0; + (*rl_redisplay_function) (); + + return 0; +} +#else /* !USE_VARARGS */ +int +rl_message (format, arg1, arg2) + char *format; +{ + if (msg_buf == 0) + msg_buf = xmalloc (msg_bufsiz = 128); + + sprintf (msg_buf, format, arg1, arg2); + msg_buf[msg_bufsiz - 1] = '\0'; /* overflow? */ + + rl_display_prompt = msg_buf; + if (saved_local_prompt == 0) + { + rl_save_prompt (); + msg_saved_prompt = 1; + } + else if (local_prompt != saved_local_prompt) + { + FREE (local_prompt); + FREE (local_prompt_prefix); + local_prompt = (char *)NULL; + } + local_prompt = expand_prompt (msg_buf, &prompt_visible_length, + &prompt_last_invisible, + &prompt_invis_chars_first_line, + &prompt_physical_chars); + local_prompt_prefix = (char *)NULL; + local_prompt_len = local_prompt ? strlen (local_prompt) : 0; + (*rl_redisplay_function) (); + + return 0; +} +#endif /* !USE_VARARGS */ + +/* How to clear things from the "echo-area". */ +int +rl_clear_message () +{ + rl_display_prompt = rl_prompt; + if (msg_saved_prompt) + { + rl_restore_prompt (); + msg_saved_prompt = 0; + } + (*rl_redisplay_function) (); + return 0; +} + +int +rl_reset_line_state () +{ + rl_on_new_line (); + + rl_display_prompt = rl_prompt ? rl_prompt : ""; + forced_display = 1; + return 0; +} + +void +rl_save_prompt () +{ + saved_local_prompt = local_prompt; + saved_local_prefix = local_prompt_prefix; + saved_prefix_length = prompt_prefix_length; + saved_local_length = local_prompt_len; + saved_last_invisible = prompt_last_invisible; + saved_visible_length = prompt_visible_length; + saved_invis_chars_first_line = prompt_invis_chars_first_line; + saved_physical_chars = prompt_physical_chars; + + local_prompt = local_prompt_prefix = (char *)0; + local_prompt_len = 0; + prompt_last_invisible = prompt_visible_length = prompt_prefix_length = 0; + prompt_invis_chars_first_line = prompt_physical_chars = 0; +} + +void +rl_restore_prompt () +{ + FREE (local_prompt); + FREE (local_prompt_prefix); + + local_prompt = saved_local_prompt; + local_prompt_prefix = saved_local_prefix; + local_prompt_len = saved_local_length; + prompt_prefix_length = saved_prefix_length; + prompt_last_invisible = saved_last_invisible; + prompt_visible_length = saved_visible_length; + prompt_invis_chars_first_line = saved_invis_chars_first_line; + prompt_physical_chars = saved_physical_chars; + + /* can test saved_local_prompt to see if prompt info has been saved. */ + saved_local_prompt = saved_local_prefix = (char *)0; + saved_local_length = 0; + saved_last_invisible = saved_visible_length = saved_prefix_length = 0; + saved_invis_chars_first_line = saved_physical_chars = 0; +} + +char * +_rl_make_prompt_for_search (pchar) + int pchar; +{ + int len; + char *pmt, *p; + + rl_save_prompt (); + + /* We've saved the prompt, and can do anything with the various prompt + strings we need before they're restored. We want the unexpanded + portion of the prompt string after any final newline. */ + p = rl_prompt ? strrchr (rl_prompt, '\n') : 0; + if (p == 0) + { + len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0; + pmt = (char *)xmalloc (len + 2); + if (len) + strcpy (pmt, rl_prompt); + pmt[len] = pchar; + pmt[len+1] = '\0'; + } + else + { + p++; + len = strlen (p); + pmt = (char *)xmalloc (len + 2); + if (len) + strcpy (pmt, p); + pmt[len] = pchar; + pmt[len+1] = '\0'; + } + + /* will be overwritten by expand_prompt, called from rl_message */ + prompt_physical_chars = saved_physical_chars + 1; + return pmt; +} + +/* Quick redisplay hack when erasing characters at the end of the line. */ +void +_rl_erase_at_end_of_line (l) + int l; +{ + register int i; + + _rl_backspace (l); + for (i = 0; i < l; i++) + putc (' ', rl_outstream); + _rl_backspace (l); + for (i = 0; i < l; i++) + visible_line[--_rl_last_c_pos] = '\0'; + rl_display_fixed++; +} + +/* Clear to the end of the line. COUNT is the minimum + number of character spaces to clear, */ +void +_rl_clear_to_eol (count) + int count; +{ +#ifndef __MSDOS__ + if (_rl_term_clreol) + tputs (_rl_term_clreol, 1, _rl_output_character_function); + else +#endif + if (count) + space_to_eol (count); +} + +/* Clear to the end of the line using spaces. COUNT is the minimum + number of character spaces to clear, */ +static void +space_to_eol (count) + int count; +{ + register int i; + + for (i = 0; i < count; i++) + putc (' ', rl_outstream); + + _rl_last_c_pos += count; +} + +void +_rl_clear_screen () +{ +#ifndef __DJGPP__ + if (_rl_term_clrpag) + tputs (_rl_term_clrpag, 1, _rl_output_character_function); + else + rl_crlf (); +#else + ScreenClear (); + ScreenSetCursor (0, 0); +#endif /* __DJGPP__ */ +} + +/* Insert COUNT characters from STRING to the output stream at column COL. */ +static void +insert_some_chars (string, count, col) + char *string; + int count, col; +{ + open_some_spaces (col); + _rl_output_some_chars (string, count); +} + +/* Insert COL spaces, keeping the cursor at the same position. We follow the + ncurses documentation and use either im/ei with explicit spaces, or IC/ic + by itself. We assume there will either be ei or we don't need to use it. */ +static void +open_some_spaces (col) + int col; +{ +#if !defined (__MSDOS__) && !defined (__MINGW32__) + char *buffer; + register int i; + + /* If IC is defined, then we do not have to "enter" insert mode. */ + if (_rl_term_IC) + { + buffer = tgoto (_rl_term_IC, 0, col); + tputs (buffer, 1, _rl_output_character_function); + } + else if (_rl_term_im && *_rl_term_im) + { + tputs (_rl_term_im, 1, _rl_output_character_function); + /* just output the desired number of spaces */ + for (i = col; i--; ) + _rl_output_character_function (' '); + /* If there is a string to turn off insert mode, use it now. */ + if (_rl_term_ei && *_rl_term_ei) + tputs (_rl_term_ei, 1, _rl_output_character_function); + /* and move back the right number of spaces */ + _rl_backspace (col); + } + else if (_rl_term_ic && *_rl_term_ic) + { + /* If there is a special command for inserting characters, then + use that first to open up the space. */ + for (i = col; i--; ) + tputs (_rl_term_ic, 1, _rl_output_character_function); + } +#endif /* !__MSDOS__ && !__MINGW32__ */ +} + +/* Delete COUNT characters from the display line. */ +static void +delete_chars (count) + int count; +{ + if (count > _rl_screenwidth) /* XXX */ + return; + +#if !defined (__MSDOS__) && !defined (__MINGW32__) + if (_rl_term_DC && *_rl_term_DC) + { + char *buffer; + buffer = tgoto (_rl_term_DC, count, count); + tputs (buffer, count, _rl_output_character_function); + } + else + { + if (_rl_term_dc && *_rl_term_dc) + while (count--) + tputs (_rl_term_dc, 1, _rl_output_character_function); + } +#endif /* !__MSDOS__ && !__MINGW32__ */ +} + +void +_rl_update_final () +{ + int full_lines; + + full_lines = 0; + /* If the cursor is the only thing on an otherwise-blank last line, + compensate so we don't print an extra CRLF. */ + if (_rl_vis_botlin && _rl_last_c_pos == 0 && + visible_line[vis_lbreaks[_rl_vis_botlin]] == 0) + { + _rl_vis_botlin--; + full_lines = 1; + } + _rl_move_vert (_rl_vis_botlin); + /* If we've wrapped lines, remove the final xterm line-wrap flag. */ + if (full_lines && _rl_term_autowrap && (VIS_LLEN(_rl_vis_botlin) == _rl_screenwidth)) + { + char *last_line; + + last_line = &visible_line[vis_lbreaks[_rl_vis_botlin]]; + cpos_buffer_position = -1; /* don't know where we are in buffer */ + _rl_move_cursor_relative (_rl_screenwidth - 1, last_line); /* XXX */ + _rl_clear_to_eol (0); + putc (last_line[_rl_screenwidth - 1], rl_outstream); + } + _rl_vis_botlin = 0; + rl_crlf (); + fflush (rl_outstream); + rl_display_fixed++; +} + +/* Move to the start of the current line. */ +static void +cr () +{ + if (_rl_term_cr) + { +#if defined (__MSDOS__) + putc ('\r', rl_outstream); +#else + tputs (_rl_term_cr, 1, _rl_output_character_function); +#endif + _rl_last_c_pos = 0; + } +} + +/* Redraw the last line of a multi-line prompt that may possibly contain + terminal escape sequences. Called with the cursor at column 0 of the + line to draw the prompt on. */ +static void +redraw_prompt (t) + char *t; +{ + char *oldp; + + oldp = rl_display_prompt; + rl_save_prompt (); + + rl_display_prompt = t; + local_prompt = expand_prompt (t, &prompt_visible_length, + &prompt_last_invisible, + &prompt_invis_chars_first_line, + &prompt_physical_chars); + local_prompt_prefix = (char *)NULL; + local_prompt_len = local_prompt ? strlen (local_prompt) : 0; + + rl_forced_update_display (); + + rl_display_prompt = oldp; + rl_restore_prompt(); +} + +/* Redisplay the current line after a SIGWINCH is received. */ +void +_rl_redisplay_after_sigwinch () +{ + char *t; + + /* Clear the last line (assuming that the screen size change will result in + either more or fewer characters on that line only) and put the cursor at + column 0. Make sure the right thing happens if we have wrapped to a new + screen line. */ + if (_rl_term_cr) + { + _rl_move_vert (_rl_vis_botlin); + +#if defined (__MSDOS__) + putc ('\r', rl_outstream); +#else + tputs (_rl_term_cr, 1, _rl_output_character_function); +#endif + _rl_last_c_pos = 0; +#if defined (__MSDOS__) + space_to_eol (_rl_screenwidth); + putc ('\r', rl_outstream); +#else + if (_rl_term_clreol) + tputs (_rl_term_clreol, 1, _rl_output_character_function); + else + { + space_to_eol (_rl_screenwidth); + tputs (_rl_term_cr, 1, _rl_output_character_function); + } +#endif + if (_rl_last_v_pos > 0) + _rl_move_vert (0); + } + else + rl_crlf (); + + /* Redraw only the last line of a multi-line prompt. */ + t = strrchr (rl_display_prompt, '\n'); + if (t) + redraw_prompt (++t); + else + rl_forced_update_display (); +} + +void +_rl_clean_up_for_exit () +{ + if (_rl_echoing_p) + { + if (_rl_vis_botlin > 0) /* minor optimization plus bug fix */ + _rl_move_vert (_rl_vis_botlin); + _rl_vis_botlin = 0; + fflush (rl_outstream); + rl_restart_output (1, 0); + } +} + +void +_rl_erase_entire_line () +{ + cr (); + _rl_clear_to_eol (0); + cr (); + fflush (rl_outstream); +} + +/* return the `current display line' of the cursor -- the number of lines to + move up to get to the first screen line of the current readline line. */ +int +_rl_current_display_line () +{ + int ret, nleft; + + /* Find out whether or not there might be invisible characters in the + editing buffer. */ + if (rl_display_prompt == rl_prompt) + nleft = _rl_last_c_pos - _rl_screenwidth - rl_visible_prompt_length; + else + nleft = _rl_last_c_pos - _rl_screenwidth; + + if (nleft > 0) + ret = 1 + nleft / _rl_screenwidth; + else + ret = 0; + + return ret; +} + +#if defined (HANDLE_MULTIBYTE) +/* Calculate the number of screen columns occupied by STR from START to END. + In the case of multibyte characters with stateful encoding, we have to + scan from the beginning of the string to take the state into account. */ +static int +_rl_col_width (str, start, end, flags) + const char *str; + int start, end, flags; +{ + wchar_t wc; + mbstate_t ps; + int tmp, point, width, max; + + if (end <= start) + return 0; + if (MB_CUR_MAX == 1 || rl_byte_oriented) + /* this can happen in some cases where it's inconvenient to check */ + return (end - start); + + memset (&ps, 0, sizeof (mbstate_t)); + + point = 0; + max = end; + + /* Try to short-circuit common cases. The adjustment to remove wrap_offset + is done by the caller. */ + /* 1. prompt string */ + if (flags && start == 0 && end == local_prompt_len && memcmp (str, local_prompt, local_prompt_len) == 0) + return (prompt_physical_chars + wrap_offset); + /* 2. prompt string + line contents */ + else if (flags && start == 0 && local_prompt_len > 0 && end > local_prompt_len && local_prompt && memcmp (str, local_prompt, local_prompt_len) == 0) + { + tmp = prompt_physical_chars + wrap_offset; + /* XXX - try to call ourselves recursively with non-prompt portion */ + tmp += _rl_col_width (str, local_prompt_len, end, flags); + return (tmp); + } + + while (point < start) + { + tmp = mbrlen (str + point, max, &ps); + if (MB_INVALIDCH ((size_t)tmp)) + { + /* In this case, the bytes are invalid or too short to compose a + multibyte character, so we assume that the first byte represents + a single character. */ + point++; + max--; + + /* Clear the state of the byte sequence, because in this case the + effect of mbstate is undefined. */ + memset (&ps, 0, sizeof (mbstate_t)); + } + else if (MB_NULLWCH (tmp)) + break; /* Found '\0' */ + else + { + point += tmp; + max -= tmp; + } + } + + /* If START is not a byte that starts a character, then POINT will be + greater than START. In this case, assume that (POINT - START) gives + a byte count that is the number of columns of difference. */ + width = point - start; + + while (point < end) + { + tmp = mbrtowc (&wc, str + point, max, &ps); + if (MB_INVALIDCH ((size_t)tmp)) + { + /* In this case, the bytes are invalid or too short to compose a + multibyte character, so we assume that the first byte represents + a single character. */ + point++; + max--; + + /* and assume that the byte occupies a single column. */ + width++; + + /* Clear the state of the byte sequence, because in this case the + effect of mbstate is undefined. */ + memset (&ps, 0, sizeof (mbstate_t)); + } + else if (MB_NULLWCH (tmp)) + break; /* Found '\0' */ + else + { + point += tmp; + max -= tmp; + tmp = WCWIDTH(wc); + width += (tmp >= 0) ? tmp : 1; + } + } + + width += point - end; + + return width; +} +#endif /* HANDLE_MULTIBYTE */ diff --git a/lib/readline/doc/Makefile b/lib/readline/doc/Makefile new file mode 100644 index 0000000..af5ee3e --- /dev/null +++ b/lib/readline/doc/Makefile @@ -0,0 +1,145 @@ +# Derived by hand from the generated readline-src/doc/Makefile +# This makefile for Readline library documentation is in -*- text -*- mode. +# Emacs likes it that way. + +# Copyright (C) 1996-2002 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + + +topdir = . +srcdir = . +VPATH = . + +prefix = /usr/local +infodir = ${prefix}/info + +mandir = ${prefix}/man +manpfx = man + +man1ext = 1 +man1dir = $(mandir)/$(manpfx)$(man1ext) +man3ext = 3 +man3dir = $(mandir)/$(manpfx)$(man3ext) + +SHELL = /bin/sh +RM = rm -f + +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 + +BUILD_DIR = . +TEXINPUTDIR = $(srcdir) + +MAKEINFO = LANGUAGE= makeinfo +TEXI2DVI = $(srcdir)/texi2dvi +TEXI2HTML = $(srcdir)/texi2html +QUIETPS = #set this to -q to shut up dvips +PSDPI = 300 # I don't have any 600-dpi printers +DVIPS = dvips -D ${PSDPI} $(QUIETPS) -o $@ # tricky + +RLSRC = $(srcdir)/rlman.texi $(srcdir)/rluser.texi \ + $(srcdir)/rltech.texi $(srcdir)/version.texi \ + $(srcdir)/rluserman.texi +HISTSRC = $(srcdir)/history.texi $(srcdir)/hsuser.texi \ + $(srcdir)/hstech.texi $(srcdir)/version.texi + +# This should be a program that converts troff to an ascii-readable format +NROFF = groff -Tascii + +# This should be a program that converts troff to postscript +GROFF = groff + +DVIOBJ = readline.dvi history.dvi rluserman.dvi +INFOOBJ = readline.info history.info rluserman.info +PSOBJ = readline.ps history.ps rluserman.ps +HTMLOBJ = readline.html history.html rluserman.html + +INTERMEDIATE_OBJ = rlman.dvi + +CREATED_DOCS = $(DVIOBJ) $(INFOOBJ) $(PSOBJ) $(HTMLOBJ) + +.SUFFIXES: .ps .txt .dvi + +all: info dvi html ps +nodvi: info html + +readline.dvi: $(RLSRC) + TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/rlman.texi + mv rlman.dvi readline.dvi + +readline.info: $(RLSRC) + $(MAKEINFO) --no-split -I $(TEXINPUTDIR) -o $@ $(srcdir)/rlman.texi + +rluserman.dvi: $(RLSRC) + TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/rluserman.texi + +rluserman.info: $(RLSRC) + $(MAKEINFO) --no-split -I $(TEXINPUTDIR) -o $@ $(srcdir)/rluserman.texi + +history.dvi: ${HISTSRC} + TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/history.texi + +history.info: ${HISTSRC} + $(MAKEINFO) --no-split -I $(TEXINPUTDIR) -o $@ $(srcdir)/history.texi + +readline.ps: readline.dvi + $(RM) $@ + $(DVIPS) readline.dvi + +rluserman.ps: rluserman.dvi + $(RM) $@ + $(DVIPS) rluserman.dvi + +history.ps: history.dvi + $(RM) $@ + $(DVIPS) history.dvi + +readline.html: ${RLSRC} + $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/rlman.texi + sed -e 's:rlman.html:readline.html:' rlman.html > readline.html + $(RM) rlman.html + +rluserman.html: ${RLSRC} + $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/rluserman.texi + +history.html: ${HISTSRC} + $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/history.texi + +info: $(INFOOBJ) +dvi: $(DVIOBJ) +ps: $(PSOBJ) +html: $(HTMLOBJ) + +clean: + $(RM) *.aux *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps *.pgs \ + *.fns *.kys *.tps *.vrs *.o core + +distclean: clean + $(RM) $(CREATED_DOCS) + $(RM) $(INTERMEDIATE_OBJ) + $(RM) Makefile + +mostlyclean: clean + +maintainer-clean: clean + $(RM) $(CREATED_DOCS) + $(RM) $(INTERMEDIATE_OBJ) + $(RM) Makefile + +install: + @echo "This documentation should not be installed." + +uninstall: diff --git a/lib/readline/doc/fdl.texi b/lib/readline/doc/fdl.texi new file mode 100644 index 0000000..8805f1a --- /dev/null +++ b/lib/readline/doc/fdl.texi @@ -0,0 +1,506 @@ +@c The GNU Free Documentation License. +@center Version 1.3, 3 November 2008 + +@c This file is intended to be included within another document, +@c hence no sectioning command or @node. + +@display +Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. +@uref{http://fsf.org/} + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. +@end display + +@enumerate 0 +@item +PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +functional and useful document @dfn{free} in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. + +This License is a kind of ``copyleft'', which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + +@item +APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The ``Document'', below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as ``you''. You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. + +A ``Modified Version'' of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A ``Secondary Section'' is a named appendix or a front-matter section +of the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The ``Invariant Sections'' are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. + +The ``Cover Texts'' are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. + +A ``Transparent'' copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not ``Transparent'' is called ``Opaque''. + +Examples of suitable formats for Transparent copies include plain +@sc{ascii} without markup, Texinfo input format, La@TeX{} input +format, @acronym{SGML} or @acronym{XML} using a publicly available +@acronym{DTD}, and standard-conforming simple @acronym{HTML}, +PostScript or @acronym{PDF} designed for human modification. Examples +of transparent image formats include @acronym{PNG}, @acronym{XCF} and +@acronym{JPG}. Opaque formats include proprietary formats that can be +read and edited only by proprietary word processors, @acronym{SGML} or +@acronym{XML} for which the @acronym{DTD} and/or processing tools are +not generally available, and the machine-generated @acronym{HTML}, +PostScript or @acronym{PDF} produced by some word processors for +output purposes only. + +The ``Title Page'' means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, ``Title Page'' means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +The ``publisher'' means any person or entity that distributes copies +of the Document to the public. + +A section ``Entitled XYZ'' means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as ``Acknowledgements'', +``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' +of such a section when you modify the Document means that it remains a +section ``Entitled XYZ'' according to this definition. + +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. + +@item +VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + +@item +COPYING IN QUANTITY + +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. + +@item +MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +@enumerate A +@item +Use in the Title Page (and on the covers, if any) a title distinct +from that of the Document, and from those of previous versions +(which should, if there were any, be listed in the History section +of the Document). You may use the same title as a previous version +if the original publisher of that version gives permission. + +@item +List on the Title Page, as authors, one or more persons or entities +responsible for authorship of the modifications in the Modified +Version, together with at least five of the principal authors of the +Document (all of its principal authors, if it has fewer than five), +unless they release you from this requirement. + +@item +State on the Title page the name of the publisher of the +Modified Version, as the publisher. + +@item +Preserve all the copyright notices of the Document. + +@item +Add an appropriate copyright notice for your modifications +adjacent to the other copyright notices. + +@item +Include, immediately after the copyright notices, a license notice +giving the public permission to use the Modified Version under the +terms of this License, in the form shown in the Addendum below. + +@item +Preserve in that license notice the full lists of Invariant Sections +and required Cover Texts given in the Document's license notice. + +@item +Include an unaltered copy of this License. + +@item +Preserve the section Entitled ``History'', Preserve its Title, and add +to it an item stating at least the title, year, new authors, and +publisher of the Modified Version as given on the Title Page. If +there is no section Entitled ``History'' in the Document, create one +stating the title, year, authors, and publisher of the Document as +given on its Title Page, then add an item describing the Modified +Version as stated in the previous sentence. + +@item +Preserve the network location, if any, given in the Document for +public access to a Transparent copy of the Document, and likewise +the network locations given in the Document for previous versions +it was based on. These may be placed in the ``History'' section. +You may omit a network location for a work that was published at +least four years before the Document itself, or if the original +publisher of the version it refers to gives permission. + +@item +For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve +the Title of the section, and preserve in the section all the +substance and tone of each of the contributor acknowledgements and/or +dedications given therein. + +@item +Preserve all the Invariant Sections of the Document, +unaltered in their text and in their titles. Section numbers +or the equivalent are not considered part of the section titles. + +@item +Delete any section Entitled ``Endorsements''. Such a section +may not be included in the Modified Version. + +@item +Do not retitle any existing section to be Entitled ``Endorsements'' or +to conflict in title with any Invariant Section. + +@item +Preserve any Warranty Disclaimers. +@end enumerate + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section Entitled ``Endorsements'', provided it contains +nothing but endorsements of your Modified Version by various +parties---for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + +@item +COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections Entitled ``History'' +in the various original documents, forming one section Entitled +``History''; likewise combine any sections Entitled ``Acknowledgements'', +and any sections Entitled ``Dedications''. You must delete all +sections Entitled ``Endorsements.'' + +@item +COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. + +@item +AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an ``aggregate'' if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. + +@item +TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. + +If a section in the Document is Entitled ``Acknowledgements'', +``Dedications'', or ``History'', the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. + +@item +TERMINATION + +You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. + +@item +FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +@uref{http://www.gnu.org/copyleft/}. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License ``or any later version'' applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy's public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. + +@item +RELICENSING + +``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the +site means any set of copyrightable works thus published on the MMC +site. + +``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. + +``Incorporate'' means to publish or republish a Document, in whole or +in part, as part of another Document. + +An MMC is ``eligible for relicensing'' if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole +or in part into the MMC, (1) had no cover texts or invariant sections, +and (2) were thus incorporated prior to November 1, 2008. + +The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. + +@end enumerate + +@page +@heading ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + +@smallexample +@group + Copyright (C) @var{year} @var{your name}. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. +@end group +@end smallexample + +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the ``with@dots{}Texts.'' line with this: + +@smallexample +@group + with the Invariant Sections being @var{list their titles}, with + the Front-Cover Texts being @var{list}, and with the Back-Cover Texts + being @var{list}. +@end group +@end smallexample + +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. + +@c Local Variables: +@c ispell-local-pdict: "ispell-dict" +@c End: + diff --git a/lib/readline/doc/history.texi b/lib/readline/doc/history.texi new file mode 100644 index 0000000..a991fe5 --- /dev/null +++ b/lib/readline/doc/history.texi @@ -0,0 +1,85 @@ +\input texinfo @c -*-texinfo-*- +@c %**start of header (This is for running Texinfo on a region.) +@setfilename history.info +@settitle GNU History Library +@include version.texi + +@c %**end of header (This is for running Texinfo on a region.) + +@copying +This document describes the GNU History library +(version @value{VERSION}, @value{UPDATED}), +a programming tool that provides a consistent user interface for +recalling lines of previously typed input. + +Copyright @copyright{} 1988--2014 Free Software Foundation, Inc. + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 or +any later version published by the Free Software Foundation; with no +Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. +A copy of the license is included in the section entitled +``GNU Free Documentation License''. + +@end quotation +@end copying + +@dircategory Libraries +@direntry +* History: (history). The GNU history library API. +@end direntry + +@titlepage +@title GNU History Library +@subtitle Edition @value{EDITION}, for @code{History Library} Version @value{VERSION}. +@subtitle @value{UPDATED-MONTH} +@author Chet Ramey, Case Western Reserve University +@author Brian Fox, Free Software Foundation + +@page + +@vskip 0pt plus 1filll +@insertcopying + +@end titlepage + +@contents + +@ifnottex +@node Top +@top GNU History Library + +This document describes the GNU History library, a programming tool that +provides a consistent user interface for recalling lines of previously +typed input. + +@menu +* Using History Interactively:: GNU History User's Manual. +* Programming with GNU History:: GNU History Programmer's Manual. +* GNU Free Documentation License:: License for copying this manual. +* Concept Index:: Index of concepts described in this manual. +* Function and Variable Index:: Index of externally visible functions + and variables. +@end menu +@end ifnottex + +@syncodeindex fn vr + +@include hsuser.texi +@include hstech.texi + +@node GNU Free Documentation License +@appendix GNU Free Documentation License + +@include fdl.texi + +@node Concept Index +@appendix Concept Index +@printindex cp + +@node Function and Variable Index +@appendix Function and Variable Index +@printindex vr + +@bye diff --git a/lib/readline/doc/hstech.texi b/lib/readline/doc/hstech.texi new file mode 100644 index 0000000..6487f20 --- /dev/null +++ b/lib/readline/doc/hstech.texi @@ -0,0 +1,577 @@ +@ignore +This file documents the user interface to the GNU History library. + +Copyright (C) 1988-2014 Free Software Foundation, Inc. +Authored by Brian Fox and Chet Ramey. + +Permission is granted to make and distribute verbatim copies of this manual +provided the copyright notice and this permission notice are preserved on +all copies. + +Permission is granted to process this file through Tex and print the +results, provided the printed document carries copying permission notice +identical to this one except for the removal of this paragraph (this +paragraph not being relevant to the printed manual). + +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided also that the +GNU Copyright statement is available to the distributee, and provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions. +@end ignore + +@node Programming with GNU History +@chapter Programming with GNU History + +This chapter describes how to interface programs that you write +with the @sc{gnu} History Library. +It should be considered a technical guide. +For information on the interactive use of @sc{gnu} History, @pxref{Using +History Interactively}. + +@menu +* Introduction to History:: What is the GNU History library for? +* History Storage:: How information is stored. +* History Functions:: Functions that you can use. +* History Variables:: Variables that control behaviour. +* History Programming Example:: Example of using the GNU History Library. +@end menu + +@node Introduction to History +@section Introduction to History + +Many programs read input from the user a line at a time. The @sc{gnu} +History library is able to keep track of those lines, associate arbitrary +data with each line, and utilize information from previous lines in +composing new ones. + +The programmer using the History library has available functions +for remembering lines on a history list, associating arbitrary data +with a line, removing lines from the list, searching through the list +for a line containing an arbitrary text string, and referencing any line +in the list directly. In addition, a history @dfn{expansion} function +is available which provides for a consistent user interface across +different programs. + +The user using programs written with the History library has the +benefit of a consistent user interface with a set of well-known +commands for manipulating the text of previous lines and using that text +in new commands. The basic history manipulation commands are similar to +the history substitution provided by @code{csh}. + +If the programmer desires, he can use the Readline library, which +includes some history manipulation by default, and has the added +advantage of command line editing. + +Before declaring any functions using any functionality the History +library provides in other code, an application writer should include +the file @code{} in any file that uses the +History library's features. It supplies extern declarations for all +of the library's public functions and variables, and declares all of +the public data structures. + +@node History Storage +@section History Storage + +The history list is an array of history entries. A history entry is +declared as follows: + +@example +typedef void *histdata_t; + +typedef struct _hist_entry @{ + char *line; + char *timestamp; + histdata_t data; +@} HIST_ENTRY; +@end example + +The history list itself might therefore be declared as + +@example +HIST_ENTRY **the_history_list; +@end example + +The state of the History library is encapsulated into a single structure: + +@example +/* + * A structure used to pass around the current state of the history. + */ +typedef struct _hist_state @{ + HIST_ENTRY **entries; /* Pointer to the entries themselves. */ + int offset; /* The location pointer within this array. */ + int length; /* Number of elements within this array. */ + int size; /* Number of slots allocated to this array. */ + int flags; +@} HISTORY_STATE; +@end example + +If the flags member includes @code{HS_STIFLED}, the history has been +stifled. + +@node History Functions +@section History Functions + +This section describes the calling sequence for the various functions +exported by the @sc{gnu} History library. + +@menu +* Initializing History and State Management:: Functions to call when you + want to use history in a + program. +* History List Management:: Functions used to manage the list + of history entries. +* Information About the History List:: Functions returning information about + the history list. +* Moving Around the History List:: Functions used to change the position + in the history list. +* Searching the History List:: Functions to search the history list + for entries containing a string. +* Managing the History File:: Functions that read and write a file + containing the history list. +* History Expansion:: Functions to perform csh-like history + expansion. +@end menu + +@node Initializing History and State Management +@subsection Initializing History and State Management + +This section describes functions used to initialize and manage +the state of the History library when you want to use the history +functions in your program. + +@deftypefun void using_history (void) +Begin a session in which the history functions might be used. This +initializes the interactive variables. +@end deftypefun + +@deftypefun {HISTORY_STATE *} history_get_history_state (void) +Return a structure describing the current state of the input history. +@end deftypefun + +@deftypefun void history_set_history_state (HISTORY_STATE *state) +Set the state of the history list according to @var{state}. +@end deftypefun + +@node History List Management +@subsection History List Management + +These functions manage individual entries on the history list, or set +parameters managing the list itself. + +@deftypefun void add_history (const char *string) +Place @var{string} at the end of the history list. The associated data +field (if any) is set to @code{NULL}. +@end deftypefun + +@deftypefun void add_history_time (const char *string) +Change the time stamp associated with the most recent history entry to +@var{string}. +@end deftypefun + +@deftypefun {HIST_ENTRY *} remove_history (int which) +Remove history entry at offset @var{which} from the history. The +removed element is returned so you can free the line, data, +and containing structure. +@end deftypefun + +@deftypefun {histdata_t} free_history_entry (HIST_ENTRY *histent) +Free the history entry @var{histent} and any history library private +data associated with it. Returns the application-specific data +so the caller can dispose of it. +@end deftypefun + +@deftypefun {HIST_ENTRY *} replace_history_entry (int which, const char *line, histdata_t data) +Make the history entry at offset @var{which} have @var{line} and @var{data}. +This returns the old entry so the caller can dispose of any +application-specific data. In the case +of an invalid @var{which}, a @code{NULL} pointer is returned. +@end deftypefun + +@deftypefun void clear_history (void) +Clear the history list by deleting all the entries. +@end deftypefun + +@deftypefun void stifle_history (int max) +Stifle the history list, remembering only the last @var{max} entries. +@end deftypefun + +@deftypefun int unstifle_history (void) +Stop stifling the history. This returns the previously-set +maximum number of history entries (as set by @code{stifle_history()}). +The value is positive if the history was +stifled, negative if it wasn't. +@end deftypefun + +@deftypefun int history_is_stifled (void) +Returns non-zero if the history is stifled, zero if it is not. +@end deftypefun + +@node Information About the History List +@subsection Information About the History List + +These functions return information about the entire history list or +individual list entries. + +@deftypefun {HIST_ENTRY **} history_list (void) +Return a @code{NULL} terminated array of @code{HIST_ENTRY *} which is the +current input history. Element 0 of this list is the beginning of time. +If there is no history, return @code{NULL}. +@end deftypefun + +@deftypefun int where_history (void) +Returns the offset of the current history element. +@end deftypefun + +@deftypefun {HIST_ENTRY *} current_history (void) +Return the history entry at the current position, as determined by +@code{where_history()}. If there is no entry there, return a @code{NULL} +pointer. +@end deftypefun + +@deftypefun {HIST_ENTRY *} history_get (int offset) +Return the history entry at position @var{offset}, starting from +@code{history_base} (@pxref{History Variables}). +If there is no entry there, or if @var{offset} +is greater than the history length, return a @code{NULL} pointer. +@end deftypefun + +@deftypefun time_t history_get_time (HIST_ENTRY *entry) +Return the time stamp associated with the history entry @var{entry}. +@end deftypefun + +@deftypefun int history_total_bytes (void) +Return the number of bytes that the primary history entries are using. +This function returns the sum of the lengths of all the lines in the +history. +@end deftypefun + +@node Moving Around the History List +@subsection Moving Around the History List + +These functions allow the current index into the history list to be +set or changed. + +@deftypefun int history_set_pos (int pos) +Set the current history offset to @var{pos}, an absolute index +into the list. +Returns 1 on success, 0 if @var{pos} is less than zero or greater +than the number of history entries. +@end deftypefun + +@deftypefun {HIST_ENTRY *} previous_history (void) +Back up the current history offset to the previous history entry, and +return a pointer to that entry. If there is no previous entry, return +a @code{NULL} pointer. +@end deftypefun + +@deftypefun {HIST_ENTRY *} next_history (void) +Move the current history offset forward to the next history entry, and +return the a pointer to that entry. If there is no next entry, return +a @code{NULL} pointer. +@end deftypefun + +@node Searching the History List +@subsection Searching the History List +@cindex History Searching + +These functions allow searching of the history list for entries containing +a specific string. Searching may be performed both forward and backward +from the current history position. The search may be @dfn{anchored}, +meaning that the string must match at the beginning of the history entry. +@cindex anchored search + +@deftypefun int history_search (const char *string, int direction) +Search the history for @var{string}, starting at the current history offset. +If @var{direction} is less than 0, then the search is through +previous entries, otherwise through subsequent entries. +If @var{string} is found, then +the current history index is set to that history entry, and the value +returned is the offset in the line of the entry where +@var{string} was found. Otherwise, nothing is changed, and a -1 is +returned. +@end deftypefun + +@deftypefun int history_search_prefix (const char *string, int direction) +Search the history for @var{string}, starting at the current history +offset. The search is anchored: matching lines must begin with +@var{string}. If @var{direction} is less than 0, then the search is +through previous entries, otherwise through subsequent entries. +If @var{string} is found, then the +current history index is set to that entry, and the return value is 0. +Otherwise, nothing is changed, and a -1 is returned. +@end deftypefun + +@deftypefun int history_search_pos (const char *string, int direction, int pos) +Search for @var{string} in the history list, starting at @var{pos}, an +absolute index into the list. If @var{direction} is negative, the search +proceeds backward from @var{pos}, otherwise forward. Returns the absolute +index of the history element where @var{string} was found, or -1 otherwise. +@end deftypefun + +@node Managing the History File +@subsection Managing the History File + +The History library can read the history from and write it to a file. +This section documents the functions for managing a history file. + +@deftypefun int read_history (const char *filename) +Add the contents of @var{filename} to the history list, a line at a time. +If @var{filename} is @code{NULL}, then read from @file{~/.history}. +Returns 0 if successful, or @code{errno} if not. +@end deftypefun + +@deftypefun int read_history_range (const char *filename, int from, int to) +Read a range of lines from @var{filename}, adding them to the history list. +Start reading at line @var{from} and end at @var{to}. +If @var{from} is zero, start at the beginning. If @var{to} is less than +@var{from}, then read until the end of the file. If @var{filename} is +@code{NULL}, then read from @file{~/.history}. Returns 0 if successful, +or @code{errno} if not. +@end deftypefun + +@deftypefun int write_history (const char *filename) +Write the current history to @var{filename}, overwriting @var{filename} +if necessary. +If @var{filename} is @code{NULL}, then write the history list to +@file{~/.history}. +Returns 0 on success, or @code{errno} on a read or write error. +@end deftypefun + +@deftypefun int append_history (int nelements, const char *filename) +Append the last @var{nelements} of the history list to @var{filename}. +If @var{filename} is @code{NULL}, then append to @file{~/.history}. +Returns 0 on success, or @code{errno} on a read or write error. +@end deftypefun + +@deftypefun int history_truncate_file (const char *filename, int nlines) +Truncate the history file @var{filename}, leaving only the last +@var{nlines} lines. +If @var{filename} is @code{NULL}, then @file{~/.history} is truncated. +Returns 0 on success, or @code{errno} on failure. +@end deftypefun + +@node History Expansion +@subsection History Expansion + +These functions implement history expansion. + +@deftypefun int history_expand (char *string, char **output) +Expand @var{string}, placing the result into @var{output}, a pointer +to a string (@pxref{History Interaction}). Returns: +@table @code +@item 0 +If no expansions took place (or, if the only change in +the text was the removal of escape characters preceding the history expansion +character); +@item 1 +if expansions did take place; +@item -1 +if there was an error in expansion; +@item 2 +if the returned line should be displayed, but not executed, +as with the @code{:p} modifier (@pxref{Modifiers}). +@end table + +If an error occurred in expansion, then @var{output} contains a descriptive +error message. +@end deftypefun + +@deftypefun {char *} get_history_event (const char *string, int *cindex, int qchar) +Returns the text of the history event beginning at @var{string} + +@var{*cindex}. @var{*cindex} is modified to point to after the event +specifier. At function entry, @var{cindex} points to the index into +@var{string} where the history event specification begins. @var{qchar} +is a character that is allowed to end the event specification in addition +to the ``normal'' terminating characters. +@end deftypefun + +@deftypefun {char **} history_tokenize (const char *string) +Return an array of tokens parsed out of @var{string}, much as the +shell might. The tokens are split on the characters in the +@var{history_word_delimiters} variable, +and shell quoting conventions are obeyed. +@end deftypefun + +@deftypefun {char *} history_arg_extract (int first, int last, const char *string) +Extract a string segment consisting of the @var{first} through @var{last} +arguments present in @var{string}. Arguments are split using +@code{history_tokenize}. +@end deftypefun + +@node History Variables +@section History Variables + +This section describes the externally-visible variables exported by +the @sc{gnu} History Library. + +@deftypevar int history_base +The logical offset of the first entry in the history list. +@end deftypevar + +@deftypevar int history_length +The number of entries currently stored in the history list. +@end deftypevar + +@deftypevar int history_max_entries +The maximum number of history entries. This must be changed using +@code{stifle_history()}. +@end deftypevar + +@deftypevar int history_write_timestamps +If non-zero, timestamps are written to the history file, so they can be +preserved between sessions. The default value is 0, meaning that +timestamps are not saved. + +The current timestamp format uses the value of @var{history_comment_char} +to delimit timestamp entries in the history file. If that variable does +not have a value (the default), timestamps will not be written. +@end deftypevar + +@deftypevar char history_expansion_char +The character that introduces a history event. The default is @samp{!}. +Setting this to 0 inhibits history expansion. +@end deftypevar + +@deftypevar char history_subst_char +The character that invokes word substitution if found at the start of +a line. The default is @samp{^}. +@end deftypevar + +@deftypevar char history_comment_char +During tokenization, if this character is seen as the first character +of a word, then it and all subsequent characters up to a newline are +ignored, suppressing history expansion for the remainder of the line. +This is disabled by default. +@end deftypevar + +@deftypevar {char *} history_word_delimiters +The characters that separate tokens for @code{history_tokenize()}. +The default value is @code{" \t\n()<>;&|"}. +@end deftypevar + +@deftypevar {char *} history_search_delimiter_chars +The list of additional characters which can delimit a history search +string, in addition to space, TAB, @samp{:} and @samp{?} in the case of +a substring search. The default is empty. +@end deftypevar + +@deftypevar {char *} history_no_expand_chars +The list of characters which inhibit history expansion if found immediately +following @var{history_expansion_char}. The default is space, tab, newline, +carriage return, and @samp{=}. +@end deftypevar + +@deftypevar int history_quotes_inhibit_expansion +If non-zero, single-quoted words are not scanned for the history expansion +character. The default value is 0. +@end deftypevar + +@deftypevar {rl_linebuf_func_t *} history_inhibit_expansion_function +This should be set to the address of a function that takes two arguments: +a @code{char *} (@var{string}) +and an @code{int} index into that string (@var{i}). +It should return a non-zero value if the history expansion starting at +@var{string[i]} should not be performed; zero if the expansion should +be done. +It is intended for use by applications like Bash that use the history +expansion character for additional purposes. +By default, this variable is set to @code{NULL}. +@end deftypevar + +@node History Programming Example +@section History Programming Example + +The following program demonstrates simple use of the @sc{gnu} History Library. + +@smallexample +#include +#include + +main (argc, argv) + int argc; + char **argv; +@{ + char line[1024], *t; + int len, done = 0; + + line[0] = 0; + + using_history (); + while (!done) + @{ + printf ("history$ "); + fflush (stdout); + t = fgets (line, sizeof (line) - 1, stdin); + if (t && *t) + @{ + len = strlen (t); + if (t[len - 1] == '\n') + t[len - 1] = '\0'; + @} + + if (!t) + strcpy (line, "quit"); + + if (line[0]) + @{ + char *expansion; + int result; + + result = history_expand (line, &expansion); + if (result) + fprintf (stderr, "%s\n", expansion); + + if (result < 0 || result == 2) + @{ + free (expansion); + continue; + @} + + add_history (expansion); + strncpy (line, expansion, sizeof (line) - 1); + free (expansion); + @} + + if (strcmp (line, "quit") == 0) + done = 1; + else if (strcmp (line, "save") == 0) + write_history ("history_file"); + else if (strcmp (line, "read") == 0) + read_history ("history_file"); + else if (strcmp (line, "list") == 0) + @{ + register HIST_ENTRY **the_list; + register int i; + + the_list = history_list (); + if (the_list) + for (i = 0; the_list[i]; i++) + printf ("%d: %s\n", i + history_base, the_list[i]->line); + @} + else if (strncmp (line, "delete", 6) == 0) + @{ + int which; + if ((sscanf (line + 6, "%d", &which)) == 1) + @{ + HIST_ENTRY *entry = remove_history (which); + if (!entry) + fprintf (stderr, "No such entry %d\n", which); + else + @{ + free (entry->line); + free (entry); + @} + @} + else + @{ + fprintf (stderr, "non-numeric arg given to `delete'\n"); + @} + @} + @} +@} +@end smallexample diff --git a/lib/readline/doc/hsuser.texi b/lib/readline/doc/hsuser.texi new file mode 100644 index 0000000..69a5016 --- /dev/null +++ b/lib/readline/doc/hsuser.texi @@ -0,0 +1,475 @@ +@ignore +This file documents the user interface to the GNU History library. + +Copyright (C) 1988--2014 Free Software Foundation, Inc. +Authored by Brian Fox and Chet Ramey. + +Permission is granted to make and distribute verbatim copies of this manual +provided the copyright notice and this permission notice are preserved on +all copies. + +Permission is granted to process this file through Tex and print the +results, provided the printed document carries copying permission notice +identical to this one except for the removal of this paragraph (this +paragraph not being relevant to the printed manual). + +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided also that the +GNU Copyright statement is available to the distributee, and provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions. +@end ignore + +@node Using History Interactively +@chapter Using History Interactively + +@ifclear BashFeatures +@defcodeindex bt +@end ifclear + +@ifset BashFeatures +This chapter describes how to use the @sc{gnu} History Library +interactively, from a user's standpoint. +It should be considered a user's guide. +For information on using the @sc{gnu} History Library in other programs, +see the @sc{gnu} Readline Library Manual. +@end ifset +@ifclear BashFeatures +This chapter describes how to use the @sc{gnu} History Library interactively, +from a user's standpoint. It should be considered a user's guide. For +information on using the @sc{gnu} History Library in your own programs, +@pxref{Programming with GNU History}. +@end ifclear + +@ifset BashFeatures +@menu +* Bash History Facilities:: How Bash lets you manipulate your command + history. +* Bash History Builtins:: The Bash builtin commands that manipulate + the command history. +* History Interaction:: What it feels like using History as a user. +@end menu +@end ifset +@ifclear BashFeatures +@menu +* History Interaction:: What it feels like using History as a user. +@end menu +@end ifclear + +@ifset BashFeatures +@node Bash History Facilities +@section Bash History Facilities +@cindex command history +@cindex history list + +When the @option{-o history} option to the @code{set} builtin +is enabled (@pxref{The Set Builtin}), +the shell provides access to the @dfn{command history}, +the list of commands previously typed. +The value of the @env{HISTSIZE} shell variable is used as the +number of commands to save in a history list. +The text of the last @env{$HISTSIZE} +commands (default 500) is saved. +The shell stores each command in the history list prior to +parameter and variable expansion +but after history expansion is performed, subject to the +values of the shell variables +@env{HISTIGNORE} and @env{HISTCONTROL}. + +When the shell starts up, the history is initialized from the +file named by the @env{HISTFILE} variable (default @file{~/.bash_history}). +The file named by the value of @env{HISTFILE} is truncated, if +necessary, to contain no more than the number of lines specified by +the value of the @env{HISTFILESIZE} variable. +When a shell with history enabled exits, the last +@env{$HISTSIZE} lines are copied from the history list to the file +named by @env{$HISTFILE}. +If the @code{histappend} shell option is set (@pxref{Bash Builtins}), +the lines are appended to the history file, +otherwise the history file is overwritten. +If @env{HISTFILE} +is unset, or if the history file is unwritable, the history is not saved. +After saving the history, the history file is truncated +to contain no more than @env{$HISTFILESIZE} lines. +If @env{HISTFILESIZE} is unset, or set to null, a non-numeric value, or +a numeric value less than zero, the history file is not truncated. + +If the @env{HISTTIMEFORMAT} is set, the time stamp information +associated with each history entry is written to the history file, +marked with the history comment character. +When the history file is read, lines beginning with the history +comment character followed immediately by a digit are interpreted +as timestamps for the previous history line. + +The builtin command @code{fc} may be used to list or edit and re-execute +a portion of the history list. +The @code{history} builtin may be used to display or modify the history +list and manipulate the history file. +When using command-line editing, search commands +are available in each editing mode that provide access to the +history list (@pxref{Commands For History}). + +The shell allows control over which commands are saved on the history +list. The @env{HISTCONTROL} and @env{HISTIGNORE} +variables may be set to cause the shell to save only a subset of the +commands entered. +The @code{cmdhist} +shell option, if enabled, causes the shell to attempt to save each +line of a multi-line command in the same history entry, adding +semicolons where necessary to preserve syntactic correctness. +The @code{lithist} +shell option causes the shell to save the command with embedded newlines +instead of semicolons. +The @code{shopt} builtin is used to set these options. +@xref{Bash Builtins}, for a description of @code{shopt}. + +@node Bash History Builtins +@section Bash History Builtins +@cindex history builtins + +Bash provides two builtin commands which manipulate the +history list and history file. + +@table @code + +@item fc +@btindex fc +@example +@code{fc [-e @var{ename}] [-lnr] [@var{first}] [@var{last}]} +@code{fc -s [@var{pat}=@var{rep}] [@var{command}]} +@end example + +The first form selects a range of commands from @var{first} to +@var{last} from the history list and displays or edits and re-executes +them. +Both @var{first} and +@var{last} may be specified as a string (to locate the most recent +command beginning with that string) or as a number (an index into the +history list, where a negative number is used as an offset from the +current command number). If @var{last} is not specified it is set to +@var{first}. If @var{first} is not specified it is set to the previous +command for editing and @minus{}16 for listing. If the @option{-l} flag is +given, the commands are listed on standard output. The @option{-n} flag +suppresses the command numbers when listing. The @option{-r} flag +reverses the order of the listing. Otherwise, the editor given by +@var{ename} is invoked on a file containing those commands. If +@var{ename} is not given, the value of the following variable expansion +is used: @code{$@{FCEDIT:-$@{EDITOR:-vi@}@}}. This says to use the +value of the @env{FCEDIT} variable if set, or the value of the +@env{EDITOR} variable if that is set, or @code{vi} if neither is set. +When editing is complete, the edited commands are echoed and executed. + +In the second form, @var{command} is re-executed after each instance +of @var{pat} in the selected command is replaced by @var{rep}. +@var{command} is intepreted the same as @var{first} above. + +A useful alias to use with the @code{fc} command is @code{r='fc -s'}, so +that typing @samp{r cc} runs the last command beginning with @code{cc} +and typing @samp{r} re-executes the last command (@pxref{Aliases}). + +@item history +@btindex history +@example +history [@var{n}] +history -c +history -d @var{offset} +history [-anrw] [@var{filename}] +history -ps @var{arg} +@end example + +With no options, display the history list with line numbers. +Lines prefixed with a @samp{*} have been modified. +An argument of @var{n} lists only the last @var{n} lines. +If the shell variable @env{HISTTIMEFORMAT} is set and not null, +it is used as a format string for @var{strftime} to display +the time stamp associated with each displayed history entry. +No intervening blank is printed between the formatted time stamp +and the history line. + +Options, if supplied, have the following meanings: + +@table @code +@item -c +Clear the history list. This may be combined +with the other options to replace the history list completely. + +@item -d @var{offset} +Delete the history entry at position @var{offset}. +@var{offset} should be specified as it appears when the history is +displayed. + +@item -a +Append the new +history lines (history lines entered since the beginning of the +current Bash session) to the history file. + +@item -n +Append the history lines not already read from the history file +to the current history list. These are lines appended to the history +file since the beginning of the current Bash session. + +@item -r +Read the history file and append its contents to +the history list. + +@item -w +Write out the current history list to the history file. + +@item -p +Perform history substitution on the @var{arg}s and display the result +on the standard output, without storing the results in the history list. + +@item -s +The @var{arg}s are added to the end of +the history list as a single entry. + +@end table + +When any of the @option{-w}, @option{-r}, @option{-a}, or @option{-n} options is +used, if @var{filename} +is given, then it is used as the history file. If not, then +the value of the @env{HISTFILE} variable is used. + +@end table +@end ifset + +@node History Interaction +@section History Expansion +@cindex history expansion + +The History library provides a history expansion feature that is similar +to the history expansion provided by @code{csh}. This section +describes the syntax used to manipulate the history information. + +History expansions introduce words from the history list into +the input stream, making it easy to repeat commands, insert the +arguments to a previous command into the current input line, or +fix errors in previous commands quickly. + +History expansion takes place in two parts. The first is to determine +which line from the history list should be used during substitution. +The second is to select portions of that line for inclusion into the +current one. The line selected from the history is called the +@dfn{event}, and the portions of that line that are acted upon are +called @dfn{words}. Various @dfn{modifiers} are available to manipulate +the selected words. The line is broken into words in the same fashion +that Bash does, so that several words +surrounded by quotes are considered one word. +History expansions are introduced by the appearance of the +history expansion character, which is @samp{!} by default. +@ifset BashFeatures +Only @samp{\} and @samp{'} may be used to escape the history expansion +character. +@end ifset + +@ifset BashFeatures +Several shell options settable with the @code{shopt} +builtin (@pxref{Bash Builtins}) may be used to tailor +the behavior of history expansion. If the +@code{histverify} shell option is enabled, and Readline +is being used, history substitutions are not immediately passed to +the shell parser. +Instead, the expanded line is reloaded into the Readline +editing buffer for further modification. +If Readline is being used, and the @code{histreedit} +shell option is enabled, a failed history expansion will be +reloaded into the Readline editing buffer for correction. +The @option{-p} option to the @code{history} builtin command +may be used to see what a history expansion will do before using it. +The @option{-s} option to the @code{history} builtin may be used to +add commands to the end of the history list without actually executing +them, so that they are available for subsequent recall. +This is most useful in conjunction with Readline. + +The shell allows control of the various characters used by the +history expansion mechanism with the @code{histchars} variable, +as explained above (@pxref{Bash Variables}). The shell uses +the history comment character to mark history timestamps when +writing the history file. +@end ifset + +@menu +* Event Designators:: How to specify which history line to use. +* Word Designators:: Specifying which words are of interest. +* Modifiers:: Modifying the results of substitution. +@end menu + +@node Event Designators +@subsection Event Designators +@cindex event designators + +An event designator is a reference to a command line entry in the +history list. +Unless the reference is absolute, events are relative to the current +position in the history list. +@cindex history events + +@table @asis + +@item @code{!} +@ifset BashFeatures +Start a history substitution, except when followed by a space, tab, +the end of the line, @samp{=} or @samp{(} (when the +@code{extglob} shell option is enabled using the @code{shopt} builtin). +@end ifset +@ifclear BashFeatures +Start a history substitution, except when followed by a space, tab, +the end of the line, or @samp{=}. +@end ifclear + +@item @code{!@var{n}} +Refer to command line @var{n}. + +@item @code{!-@var{n}} +Refer to the command @var{n} lines back. + +@item @code{!!} +Refer to the previous command. This is a synonym for @samp{!-1}. + +@item @code{!@var{string}} +Refer to the most recent command +preceding the current position in the history list +starting with @var{string}. + +@item @code{!?@var{string}[?]} +Refer to the most recent command +preceding the current position in the history list +containing @var{string}. +The trailing +@samp{?} may be omitted if the @var{string} is followed immediately by +a newline. + +@item @code{^@var{string1}^@var{string2}^} +Quick Substitution. Repeat the last command, replacing @var{string1} +with @var{string2}. Equivalent to +@code{!!:s/@var{string1}/@var{string2}/}. + +@item @code{!#} +The entire command line typed so far. + +@end table + +@node Word Designators +@subsection Word Designators + +Word designators are used to select desired words from the event. +A @samp{:} separates the event specification from the word designator. It +may be omitted if the word designator begins with a @samp{^}, @samp{$}, +@samp{*}, @samp{-}, or @samp{%}. Words are numbered from the beginning +of the line, with the first word being denoted by 0 (zero). Words are +inserted into the current line separated by single spaces. + +@need 0.75 +For example, + +@table @code +@item !! +designates the preceding command. When you type this, the preceding +command is repeated in toto. + +@item !!:$ +designates the last argument of the preceding command. This may be +shortened to @code{!$}. + +@item !fi:2 +designates the second argument of the most recent command starting with +the letters @code{fi}. +@end table + +@need 0.75 +Here are the word designators: + +@table @code + +@item 0 (zero) +The @code{0}th word. For many applications, this is the command word. + +@item @var{n} +The @var{n}th word. + +@item ^ +The first argument; that is, word 1. + +@item $ +The last argument. + +@item % +The word matched by the most recent @samp{?@var{string}?} search. + +@item @var{x}-@var{y} +A range of words; @samp{-@var{y}} abbreviates @samp{0-@var{y}}. + +@item * +All of the words, except the @code{0}th. This is a synonym for @samp{1-$}. +It is not an error to use @samp{*} if there is just one word in the event; +the empty string is returned in that case. + +@item @var{x}* +Abbreviates @samp{@var{x}-$} + +@item @var{x}- +Abbreviates @samp{@var{x}-$} like @samp{@var{x}*}, but omits the last word. + +@end table + +If a word designator is supplied without an event specification, the +previous command is used as the event. + +@node Modifiers +@subsection Modifiers + +After the optional word designator, you can add a sequence of one or more +of the following modifiers, each preceded by a @samp{:}. + +@table @code + +@item h +Remove a trailing pathname component, leaving only the head. + +@item t +Remove all leading pathname components, leaving the tail. + +@item r +Remove a trailing suffix of the form @samp{.@var{suffix}}, leaving +the basename. + +@item e +Remove all but the trailing suffix. + +@item p +Print the new command but do not execute it. + +@ifset BashFeatures +@item q +Quote the substituted words, escaping further substitutions. + +@item x +Quote the substituted words as with @samp{q}, +but break into words at spaces, tabs, and newlines. +@end ifset + +@item s/@var{old}/@var{new}/ +Substitute @var{new} for the first occurrence of @var{old} in the +event line. Any delimiter may be used in place of @samp{/}. +The delimiter may be quoted in @var{old} and @var{new} +with a single backslash. If @samp{&} appears in @var{new}, +it is replaced by @var{old}. A single backslash will quote +the @samp{&}. The final delimiter is optional if it is the last +character on the input line. + +@item & +Repeat the previous substitution. + +@item g +@itemx a +Cause changes to be applied over the entire event line. Used in +conjunction with @samp{s}, as in @code{gs/@var{old}/@var{new}/}, +or with @samp{&}. + +@item G +Apply the following @samp{s} modifier once to each word in the event. + +@end table diff --git a/lib/readline/doc/rlman.texi b/lib/readline/doc/rlman.texi new file mode 100644 index 0000000..17a8292 --- /dev/null +++ b/lib/readline/doc/rlman.texi @@ -0,0 +1,84 @@ +\input texinfo @c -*-texinfo-*- +@comment %**start of header (This is for running Texinfo on a region.) +@setfilename readline.info +@settitle GNU Readline Library +@include version.texi + +@comment %**end of header (This is for running Texinfo on a region.) +@synindex vr fn + +@copying +This manual describes the GNU Readline Library +(version @value{VERSION}, @value{UPDATED}), a library which aids in the +consistency of user interface across discrete programs which provide +a command line interface. + +Copyright @copyright{} 1988--2014 Free Software Foundation, Inc. + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 or +any later version published by the Free Software Foundation; with no +Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. +A copy of the license is included in the section entitled +``GNU Free Documentation License''. + +@end quotation +@end copying + +@dircategory Libraries +@direntry +* Readline: (readline). The GNU readline library API. +@end direntry + +@titlepage +@title GNU Readline Library +@subtitle Edition @value{EDITION}, for @code{Readline Library} Version @value{VERSION}. +@subtitle @value{UPDATED-MONTH} +@author Chet Ramey, Case Western Reserve University +@author Brian Fox, Free Software Foundation + +@page +@vskip 0pt plus 1filll +@insertcopying + +@end titlepage + +@contents + +@ifnottex +@node Top +@top GNU Readline Library + +This document describes the GNU Readline Library, a utility which aids +in the consistency of user interface across discrete programs which +provide a command line interface. +The Readline home page is @url{http://www.gnu.org/software/readline/}. + +@menu +* Command Line Editing:: GNU Readline User's Manual. +* Programming with GNU Readline:: GNU Readline Programmer's Manual. +* GNU Free Documentation License:: License for copying this manual. +* Concept Index:: Index of concepts described in this manual. +* Function and Variable Index:: Index of externally visible functions + and variables. +@end menu +@end ifnottex + +@include rluser.texi +@include rltech.texi + +@node GNU Free Documentation License +@appendix GNU Free Documentation License + +@include fdl.texi + +@node Concept Index +@unnumbered Concept Index +@printindex cp + +@node Function and Variable Index +@unnumbered Function and Variable Index +@printindex fn + +@bye diff --git a/lib/readline/doc/rltech.texi b/lib/readline/doc/rltech.texi new file mode 100644 index 0000000..40de49c --- /dev/null +++ b/lib/readline/doc/rltech.texi @@ -0,0 +1,2590 @@ +@comment %**start of header (This is for running Texinfo on a region.) +@setfilename rltech.info +@comment %**end of header (This is for running Texinfo on a region.) + +@ifinfo +This document describes the GNU Readline Library, a utility for aiding +in the consistency of user interface across discrete programs that need +to provide a command line interface. + +Copyright (C) 1988--2014 Free Software Foundation, Inc. + +Permission is granted to make and distribute verbatim copies of +this manual provided the copyright notice and this permission notice +pare preserved on all copies. + +@ignore +Permission is granted to process this file through TeX and print the +results, provided the printed document carries copying permission +notice identical to this one except for the removal of this paragraph +(this paragraph not being relevant to the printed manual). +@end ignore + +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided that the entire +resulting derived work is distributed under the terms of a permission +notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions, +except that this permission notice may be stated in a translation approved +by the Foundation. +@end ifinfo + +@node Programming with GNU Readline +@chapter Programming with GNU Readline + +This chapter describes the interface between the @sc{gnu} Readline Library and +other programs. If you are a programmer, and you wish to include the +features found in @sc{gnu} Readline +such as completion, line editing, and interactive history manipulation +in your own programs, this section is for you. + +@menu +* Basic Behavior:: Using the default behavior of Readline. +* Custom Functions:: Adding your own functions to Readline. +* Readline Variables:: Variables accessible to custom + functions. +* Readline Convenience Functions:: Functions which Readline supplies to + aid in writing your own custom + functions. +* Readline Signal Handling:: How Readline behaves when it receives signals. +* Custom Completers:: Supplanting or supplementing Readline's + completion functions. +@end menu + +@node Basic Behavior +@section Basic Behavior + +Many programs provide a command line interface, such as @code{mail}, +@code{ftp}, and @code{sh}. For such programs, the default behaviour of +Readline is sufficient. This section describes how to use Readline in +the simplest way possible, perhaps to replace calls in your code to +@code{gets()} or @code{fgets()}. + +@findex readline +@cindex readline, function + +The function @code{readline()} prints a prompt @var{prompt} +and then reads and returns a single line of text from the user. +If @var{prompt} is @code{NULL} or the empty string, no prompt is displayed. +The line @code{readline} returns is allocated with @code{malloc()}; +the caller should @code{free()} the line when it has finished with it. +The declaration for @code{readline} in ANSI C is + +@example +@code{char *readline (const char *@var{prompt});} +@end example + +@noindent +So, one might say +@example +@code{char *line = readline ("Enter a line: ");} +@end example +@noindent +in order to read a line of text from the user. +The line returned has the final newline removed, so only the +text remains. + +If @code{readline} encounters an @code{EOF} while reading the line, and the +line is empty at that point, then @code{(char *)NULL} is returned. +Otherwise, the line is ended just as if a newline had been typed. + +If you want the user to be able to get at the line later, (with +@key{C-p} for example), you must call @code{add_history()} to save the +line away in a @dfn{history} list of such lines. + +@example +@code{add_history (line)}; +@end example + +@noindent +For full details on the GNU History Library, see the associated manual. + +It is preferable to avoid saving empty lines on the history list, since +users rarely have a burning need to reuse a blank line. Here is +a function which usefully replaces the standard @code{gets()} library +function, and has the advantage of no static buffer to overflow: + +@example +/* A static variable for holding the line. */ +static char *line_read = (char *)NULL; + +/* Read a string, and return a pointer to it. + Returns NULL on EOF. */ +char * +rl_gets () +@{ + /* If the buffer has already been allocated, + return the memory to the free pool. */ + if (line_read) + @{ + free (line_read); + line_read = (char *)NULL; + @} + + /* Get a line from the user. */ + line_read = readline (""); + + /* If the line has any text in it, + save it on the history. */ + if (line_read && *line_read) + add_history (line_read); + + return (line_read); +@} +@end example + +This function gives the user the default behaviour of @key{TAB} +completion: completion on file names. If you do not want Readline to +complete on filenames, you can change the binding of the @key{TAB} key +with @code{rl_bind_key()}. + +@example +@code{int rl_bind_key (int @var{key}, rl_command_func_t *@var{function});} +@end example + +@code{rl_bind_key()} takes two arguments: @var{key} is the character that +you want to bind, and @var{function} is the address of the function to +call when @var{key} is pressed. Binding @key{TAB} to @code{rl_insert()} +makes @key{TAB} insert itself. +@code{rl_bind_key()} returns non-zero if @var{key} is not a valid +ASCII character code (between 0 and 255). + +Thus, to disable the default @key{TAB} behavior, the following suffices: +@example +@code{rl_bind_key ('\t', rl_insert);} +@end example + +This code should be executed once at the start of your program; you +might write a function called @code{initialize_readline()} which +performs this and other desired initializations, such as installing +custom completers (@pxref{Custom Completers}). + +@node Custom Functions +@section Custom Functions + +Readline provides many functions for manipulating the text of +the line, but it isn't possible to anticipate the needs of all +programs. This section describes the various functions and variables +defined within the Readline library which allow a user program to add +customized functionality to Readline. + +Before declaring any functions that customize Readline's behavior, or +using any functionality Readline provides in other code, an +application writer should include the file @code{} +in any file that uses Readline's features. Since some of the definitions +in @code{readline.h} use the @code{stdio} library, the file +@code{} should be included before @code{readline.h}. + +@code{readline.h} defines a C preprocessor variable that should +be treated as an integer, @code{RL_READLINE_VERSION}, which may +be used to conditionally compile application code depending on +the installed Readline version. The value is a hexadecimal +encoding of the major and minor version numbers of the library, +of the form 0x@var{MMmm}. @var{MM} is the two-digit major +version number; @var{mm} is the two-digit minor version number. +For Readline 4.2, for example, the value of +@code{RL_READLINE_VERSION} would be @code{0x0402}. + +@menu +* Readline Typedefs:: C declarations to make code readable. +* Function Writing:: Variables and calling conventions. +@end menu + +@node Readline Typedefs +@subsection Readline Typedefs + +For readability, we declare a number of new object types, all pointers +to functions. + +The reason for declaring these new types is to make it easier to write +code describing pointers to C functions with appropriately prototyped +arguments and return values. + +For instance, say we want to declare a variable @var{func} as a pointer +to a function which takes two @code{int} arguments and returns an +@code{int} (this is the type of all of the Readline bindable functions). +Instead of the classic C declaration + +@code{int (*func)();} + +@noindent +or the ANSI-C style declaration + +@code{int (*func)(int, int);} + +@noindent +we may write + +@code{rl_command_func_t *func;} + +The full list of function pointer types available is + +@table @code +@item typedef int rl_command_func_t (int, int); + +@item typedef char *rl_compentry_func_t (const char *, int); + +@item typedef char **rl_completion_func_t (const char *, int, int); + +@item typedef char *rl_quote_func_t (char *, int, char *); + +@item typedef char *rl_dequote_func_t (char *, int); + +@item typedef int rl_compignore_func_t (char **); + +@item typedef void rl_compdisp_func_t (char **, int, int); + +@item typedef int rl_hook_func_t (void); + +@item typedef int rl_getc_func_t (FILE *); + +@item typedef int rl_linebuf_func_t (char *, int); + +@item typedef int rl_intfunc_t (int); +@item #define rl_ivoidfunc_t rl_hook_func_t +@item typedef int rl_icpfunc_t (char *); +@item typedef int rl_icppfunc_t (char **); + +@item typedef void rl_voidfunc_t (void); +@item typedef void rl_vintfunc_t (int); +@item typedef void rl_vcpfunc_t (char *); +@item typedef void rl_vcppfunc_t (char **); + +@end table + +@node Function Writing +@subsection Writing a New Function + +In order to write new functions for Readline, you need to know the +calling conventions for keyboard-invoked functions, and the names of the +variables that describe the current state of the line read so far. + +The calling sequence for a command @code{foo} looks like + +@example +@code{int foo (int count, int key)} +@end example + +@noindent +where @var{count} is the numeric argument (or 1 if defaulted) and +@var{key} is the key that invoked this function. + +It is completely up to the function as to what should be done with the +numeric argument. Some functions use it as a repeat count, some +as a flag, and others to choose alternate behavior (refreshing the current +line as opposed to refreshing the screen, for example). Some choose to +ignore it. In general, if a +function uses the numeric argument as a repeat count, it should be able +to do something useful with both negative and positive arguments. +At the very least, it should be aware that it can be passed a +negative argument. + +A command function should return 0 if its action completes successfully, +and a non-zero value if some error occurs. +This is the convention obeyed by all of the builtin Readline bindable +command functions. + +@node Readline Variables +@section Readline Variables + +These variables are available to function writers. + +@deftypevar {char *} rl_line_buffer +This is the line gathered so far. You are welcome to modify the +contents of the line, but see @ref{Allowing Undoing}. The +function @code{rl_extend_line_buffer} is available to increase +the memory allocated to @code{rl_line_buffer}. +@end deftypevar + +@deftypevar int rl_point +The offset of the current cursor position in @code{rl_line_buffer} +(the @emph{point}). +@end deftypevar + +@deftypevar int rl_end +The number of characters present in @code{rl_line_buffer}. When +@code{rl_point} is at the end of the line, @code{rl_point} and +@code{rl_end} are equal. +@end deftypevar + +@deftypevar int rl_mark +The @var{mark} (saved position) in the current line. If set, the mark +and point define a @emph{region}. +@end deftypevar + +@deftypevar int rl_done +Setting this to a non-zero value causes Readline to return the current +line immediately. +@end deftypevar + +@deftypevar int rl_num_chars_to_read +Setting this to a positive value before calling @code{readline()} causes +Readline to return after accepting that many characters, rather +than reading up to a character bound to @code{accept-line}. +@end deftypevar + +@deftypevar int rl_pending_input +Setting this to a value makes it the next keystroke read. This is a +way to stuff a single character into the input stream. +@end deftypevar + +@deftypevar int rl_dispatching +Set to a non-zero value if a function is being called from a key binding; +zero otherwise. Application functions can test this to discover whether +they were called directly or by Readline's dispatching mechanism. +@end deftypevar + +@deftypevar int rl_erase_empty_line +Setting this to a non-zero value causes Readline to completely erase +the current line, including any prompt, any time a newline is typed as +the only character on an otherwise-empty line. The cursor is moved to +the beginning of the newly-blank line. +@end deftypevar + +@deftypevar {char *} rl_prompt +The prompt Readline uses. This is set from the argument to +@code{readline()}, and should not be assigned to directly. +The @code{rl_set_prompt()} function (@pxref{Redisplay}) may +be used to modify the prompt string after calling @code{readline()}. +@end deftypevar + +@deftypevar {char *} rl_display_prompt +The string displayed as the prompt. This is usually identical to +@var{rl_prompt}, but may be changed temporarily by functions that +use the prompt string as a message area, such as incremental search. +@end deftypevar + +@deftypevar int rl_already_prompted +If an application wishes to display the prompt itself, rather than have +Readline do it the first time @code{readline()} is called, it should set +this variable to a non-zero value after displaying the prompt. +The prompt must also be passed as the argument to @code{readline()} so +the redisplay functions can update the display properly. +The calling application is responsible for managing the value; Readline +never sets it. +@end deftypevar + +@deftypevar {const char *} rl_library_version +The version number of this revision of the library. +@end deftypevar + +@deftypevar int rl_readline_version +An integer encoding the current version of the library. The encoding is +of the form 0x@var{MMmm}, where @var{MM} is the two-digit major version +number, and @var{mm} is the two-digit minor version number. +For example, for Readline-4.2, @code{rl_readline_version} would have the +value 0x0402. +@end deftypevar + +@deftypevar {int} rl_gnu_readline_p +Always set to 1, denoting that this is @sc{gnu} readline rather than some +emulation. +@end deftypevar + +@deftypevar {const char *} rl_terminal_name +The terminal type, used for initialization. If not set by the application, +Readline sets this to the value of the @env{TERM} environment variable +the first time it is called. +@end deftypevar + +@deftypevar {const char *} rl_readline_name +This variable is set to a unique name by each application using Readline. +The value allows conditional parsing of the inputrc file +(@pxref{Conditional Init Constructs}). +@end deftypevar + +@deftypevar {FILE *} rl_instream +The stdio stream from which Readline reads input. +If @code{NULL}, Readline defaults to @var{stdin}. +@end deftypevar + +@deftypevar {FILE *} rl_outstream +The stdio stream to which Readline performs output. +If @code{NULL}, Readline defaults to @var{stdout}. +@end deftypevar + +@deftypevar int rl_prefer_env_winsize +If non-zero, Readline gives values found in the @env{LINES} and +@env{COLUMNS} environment variables greater precedence than values fetched +from the kernel when computing the screen dimensions. +@end deftypevar + +@deftypevar {rl_command_func_t *} rl_last_func +The address of the last command function Readline executed. May be used to +test whether or not a function is being executed twice in succession, for +example. +@end deftypevar + +@deftypevar {rl_hook_func_t *} rl_startup_hook +If non-zero, this is the address of a function to call just +before @code{readline} prints the first prompt. +@end deftypevar + +@deftypevar {rl_hook_func_t *} rl_pre_input_hook +If non-zero, this is the address of a function to call after +the first prompt has been printed and just before @code{readline} +starts reading input characters. +@end deftypevar + +@deftypevar {rl_hook_func_t *} rl_event_hook +If non-zero, this is the address of a function to call periodically +when Readline is waiting for terminal input. +By default, this will be called at most ten times a second if there +is no keyboard input. +@end deftypevar + +@deftypevar {rl_getc_func_t *} rl_getc_function +If non-zero, Readline will call indirectly through this pointer +to get a character from the input stream. By default, it is set to +@code{rl_getc}, the default Readline character input function +(@pxref{Character Input}). +In general, an application that sets @var{rl_getc_function} should consider +setting @var{rl_input_available_hook} as well. +@end deftypevar + +@deftypevar {rl_hook_func_t *} rl_signal_event_hook +If non-zero, this is the address of a function to call if a read system +call is interrupted when Readline is reading terminal input. +@end deftypevar + +@deftypevar {rl_hook_func_t *} rl_input_available_hook +If non-zero, Readline will use this function's return value when it needs +to determine whether or not there is available input on the current input +source. +The default hook checks @code{rl_instream}; if an application is using a +different input source, it should set the hook appropriately. +Readline queries for available input when implementing intra-key-sequence +timeouts during input and incremental searches. +This may use an application-specific timeout before returning a value; +Readline uses the value passed to @code{rl_set_keyboard_input_timeout()} +or the value of the user-settable @var{keyseq-timeout} variable. +This is designed for use by applications using Readline's callback interface +(@pxref{Alternate Interface}), which may not use the traditional +@code{read(2)} and file descriptor interface, or other applications using +a different input mechanism. +If an application uses an input mechanism or hook that can potentially exceed +the value of @var{keyseq-timeout}, it should increase the timeout or set +this hook appropriately even when not using the callback interface. +In general, an application that sets @var{rl_getc_function} should consider +setting @var{rl_input_available_hook} as well. +@end deftypevar + +@deftypevar {rl_voidfunc_t *} rl_redisplay_function +If non-zero, Readline will call indirectly through this pointer +to update the display with the current contents of the editing buffer. +By default, it is set to @code{rl_redisplay}, the default Readline +redisplay function (@pxref{Redisplay}). +@end deftypevar + +@deftypevar {rl_vintfunc_t *} rl_prep_term_function +If non-zero, Readline will call indirectly through this pointer +to initialize the terminal. The function takes a single argument, an +@code{int} flag that says whether or not to use eight-bit characters. +By default, this is set to @code{rl_prep_terminal} +(@pxref{Terminal Management}). +@end deftypevar + +@deftypevar {rl_voidfunc_t *} rl_deprep_term_function +If non-zero, Readline will call indirectly through this pointer +to reset the terminal. This function should undo the effects of +@code{rl_prep_term_function}. +By default, this is set to @code{rl_deprep_terminal} +(@pxref{Terminal Management}). +@end deftypevar + +@deftypevar {Keymap} rl_executing_keymap +This variable is set to the keymap (@pxref{Keymaps}) in which the +currently executing readline function was found. +@end deftypevar + +@deftypevar {Keymap} rl_binding_keymap +This variable is set to the keymap (@pxref{Keymaps}) in which the +last key binding occurred. +@end deftypevar + +@deftypevar {char *} rl_executing_macro +This variable is set to the text of any currently-executing macro. +@end deftypevar + +@deftypevar int rl_executing_key +The key that caused the dispatch to the currently-executing Readline function. +@end deftypevar + +@deftypevar {char *} rl_executing_keyseq +The full key sequence that caused the dispatch to the currently-executing +Readline function. +@end deftypevar + +@deftypevar int rl_key_sequence_length +The number of characters in @var{rl_executing_keyseq}. +@end deftypevar + +@deftypevar {int} rl_readline_state +A variable with bit values that encapsulate the current Readline state. +A bit is set with the @code{RL_SETSTATE} macro, and unset with the +@code{RL_UNSETSTATE} macro. Use the @code{RL_ISSTATE} macro to test +whether a particular state bit is set. Current state bits include: + +@table @code +@item RL_STATE_NONE +Readline has not yet been called, nor has it begun to initialize. +@item RL_STATE_INITIALIZING +Readline is initializing its internal data structures. +@item RL_STATE_INITIALIZED +Readline has completed its initialization. +@item RL_STATE_TERMPREPPED +Readline has modified the terminal modes to do its own input and redisplay. +@item RL_STATE_READCMD +Readline is reading a command from the keyboard. +@item RL_STATE_METANEXT +Readline is reading more input after reading the meta-prefix character. +@item RL_STATE_DISPATCHING +Readline is dispatching to a command. +@item RL_STATE_MOREINPUT +Readline is reading more input while executing an editing command. +@item RL_STATE_ISEARCH +Readline is performing an incremental history search. +@item RL_STATE_NSEARCH +Readline is performing a non-incremental history search. +@item RL_STATE_SEARCH +Readline is searching backward or forward through the history for a string. +@item RL_STATE_NUMERICARG +Readline is reading a numeric argument. +@item RL_STATE_MACROINPUT +Readline is currently getting its input from a previously-defined keyboard +macro. +@item RL_STATE_MACRODEF +Readline is currently reading characters defining a keyboard macro. +@item RL_STATE_OVERWRITE +Readline is in overwrite mode. +@item RL_STATE_COMPLETING +Readline is performing word completion. +@item RL_STATE_SIGHANDLER +Readline is currently executing the readline signal handler. +@item RL_STATE_UNDOING +Readline is performing an undo. +@item RL_STATE_INPUTPENDING +Readline has input pending due to a call to @code{rl_execute_next()}. +@item RL_STATE_TTYCSAVED +Readline has saved the values of the terminal's special characters. +@item RL_STATE_CALLBACK +Readline is currently using the alternate (callback) interface +(@pxref{Alternate Interface}). +@item RL_STATE_VIMOTION +Readline is reading the argument to a vi-mode "motion" command. +@item RL_STATE_MULTIKEY +Readline is reading a multiple-keystroke command. +@item RL_STATE_VICMDONCE +Readline has entered vi command (movement) mode at least one time during +the current call to @code{readline()}. +@item RL_STATE_DONE +Readline has read a key sequence bound to @code{accept-line} +and is about to return the line to the caller. +@end table + +@end deftypevar + +@deftypevar {int} rl_explicit_arg +Set to a non-zero value if an explicit numeric argument was specified by +the user. Only valid in a bindable command function. +@end deftypevar + +@deftypevar {int} rl_numeric_arg +Set to the value of any numeric argument explicitly specified by the user +before executing the current Readline function. Only valid in a bindable +command function. +@end deftypevar + +@deftypevar {int} rl_editing_mode +Set to a value denoting Readline's current editing mode. A value of +@var{1} means Readline is currently in emacs mode; @var{0} +means that vi mode is active. +@end deftypevar + + +@node Readline Convenience Functions +@section Readline Convenience Functions + +@menu +* Function Naming:: How to give a function you write a name. +* Keymaps:: Making keymaps. +* Binding Keys:: Changing Keymaps. +* Associating Function Names and Bindings:: Translate function names to + key sequences. +* Allowing Undoing:: How to make your functions undoable. +* Redisplay:: Functions to control line display. +* Modifying Text:: Functions to modify @code{rl_line_buffer}. +* Character Input:: Functions to read keyboard input. +* Terminal Management:: Functions to manage terminal settings. +* Utility Functions:: Generally useful functions and hooks. +* Miscellaneous Functions:: Functions that don't fall into any category. +* Alternate Interface:: Using Readline in a `callback' fashion. +* A Readline Example:: An example Readline function. +* Alternate Interface Example:: An example program using the alternate interface. +@end menu + +@node Function Naming +@subsection Naming a Function + +The user can dynamically change the bindings of keys while using +Readline. This is done by representing the function with a descriptive +name. The user is able to type the descriptive name when referring to +the function. Thus, in an init file, one might find + +@example +Meta-Rubout: backward-kill-word +@end example + +This binds the keystroke @key{Meta-Rubout} to the function +@emph{descriptively} named @code{backward-kill-word}. You, as the +programmer, should bind the functions you write to descriptive names as +well. Readline provides a function for doing that: + +@deftypefun int rl_add_defun (const char *name, rl_command_func_t *function, int key) +Add @var{name} to the list of named functions. Make @var{function} be +the function that gets called. If @var{key} is not -1, then bind it to +@var{function} using @code{rl_bind_key()}. +@end deftypefun + +Using this function alone is sufficient for most applications. +It is the recommended way to add a few functions to the default +functions that Readline has built in. +If you need to do something other than adding a function to Readline, +you may need to use the underlying functions described below. + +@node Keymaps +@subsection Selecting a Keymap + +Key bindings take place on a @dfn{keymap}. The keymap is the +association between the keys that the user types and the functions that +get run. You can make your own keymaps, copy existing keymaps, and tell +Readline which keymap to use. + +@deftypefun Keymap rl_make_bare_keymap (void) +Returns a new, empty keymap. The space for the keymap is allocated with +@code{malloc()}; the caller should free it by calling +@code{rl_free_keymap()} when done. +@end deftypefun + +@deftypefun Keymap rl_copy_keymap (Keymap map) +Return a new keymap which is a copy of @var{map}. +@end deftypefun + +@deftypefun Keymap rl_make_keymap (void) +Return a new keymap with the printing characters bound to rl_insert, +the lowercase Meta characters bound to run their equivalents, and +the Meta digits bound to produce numeric arguments. +@end deftypefun + +@deftypefun void rl_discard_keymap (Keymap keymap) +Free the storage associated with the data in @var{keymap}. +The caller should free @var{keymap}. +@end deftypefun + +@deftypefun void rl_free_keymap (Keymap keymap) +Free all storage associated with @var{keymap}. This calls +@code{rl_discard_keymap} to free subordindate keymaps and macros. +@end deftypefun + +Readline has several internal keymaps. These functions allow you to +change which keymap is active. + +@deftypefun Keymap rl_get_keymap (void) +Returns the currently active keymap. +@end deftypefun + +@deftypefun void rl_set_keymap (Keymap keymap) +Makes @var{keymap} the currently active keymap. +@end deftypefun + +@deftypefun Keymap rl_get_keymap_by_name (const char *name) +Return the keymap matching @var{name}. @var{name} is one which would +be supplied in a @code{set keymap} inputrc line (@pxref{Readline Init File}). +@end deftypefun + +@deftypefun {char *} rl_get_keymap_name (Keymap keymap) +Return the name matching @var{keymap}. @var{name} is one which would +be supplied in a @code{set keymap} inputrc line (@pxref{Readline Init File}). +@end deftypefun + +@node Binding Keys +@subsection Binding Keys + +Key sequences are associate with functions through the keymap. +Readline has several internal keymaps: @code{emacs_standard_keymap}, +@code{emacs_meta_keymap}, @code{emacs_ctlx_keymap}, +@code{vi_movement_keymap}, and @code{vi_insertion_keymap}. +@code{emacs_standard_keymap} is the default, and the examples in +this manual assume that. + +Since @code{readline()} installs a set of default key bindings the first +time it is called, there is always the danger that a custom binding +installed before the first call to @code{readline()} will be overridden. +An alternate mechanism is to install custom key bindings in an +initialization function assigned to the @code{rl_startup_hook} variable +(@pxref{Readline Variables}). + +These functions manage key bindings. + +@deftypefun int rl_bind_key (int key, rl_command_func_t *function) +Binds @var{key} to @var{function} in the currently active keymap. +Returns non-zero in the case of an invalid @var{key}. +@end deftypefun + +@deftypefun int rl_bind_key_in_map (int key, rl_command_func_t *function, Keymap map) +Bind @var{key} to @var{function} in @var{map}. +Returns non-zero in the case of an invalid @var{key}. +@end deftypefun + +@deftypefun int rl_bind_key_if_unbound (int key, rl_command_func_t *function) +Binds @var{key} to @var{function} if it is not already bound in the +currently active keymap. +Returns non-zero in the case of an invalid @var{key} or if @var{key} is +already bound. +@end deftypefun + +@deftypefun int rl_bind_key_if_unbound_in_map (int key, rl_command_func_t *function, Keymap map) +Binds @var{key} to @var{function} if it is not already bound in @var{map}. +Returns non-zero in the case of an invalid @var{key} or if @var{key} is +already bound. +@end deftypefun + +@deftypefun int rl_unbind_key (int key) +Bind @var{key} to the null function in the currently active keymap. +Returns non-zero in case of error. +@end deftypefun + +@deftypefun int rl_unbind_key_in_map (int key, Keymap map) +Bind @var{key} to the null function in @var{map}. +Returns non-zero in case of error. +@end deftypefun + +@deftypefun int rl_unbind_function_in_map (rl_command_func_t *function, Keymap map) +Unbind all keys that execute @var{function} in @var{map}. +@end deftypefun + +@deftypefun int rl_unbind_command_in_map (const char *command, Keymap map) +Unbind all keys that are bound to @var{command} in @var{map}. +@end deftypefun + +@deftypefun int rl_bind_keyseq (const char *keyseq, rl_command_func_t *function) +Bind the key sequence represented by the string @var{keyseq} to the function +@var{function}, beginning in the current keymap. +This makes new keymaps as necessary. +The return value is non-zero if @var{keyseq} is invalid. +@end deftypefun + +@deftypefun int rl_bind_keyseq_in_map (const char *keyseq, rl_command_func_t *function, Keymap map) +Bind the key sequence represented by the string @var{keyseq} to the function +@var{function}. This makes new keymaps as necessary. +Initial bindings are performed in @var{map}. +The return value is non-zero if @var{keyseq} is invalid. +@end deftypefun + +@deftypefun int rl_set_key (const char *keyseq, rl_command_func_t *function, Keymap map) +Equivalent to @code{rl_bind_keyseq_in_map}. +@end deftypefun + +@deftypefun int rl_bind_keyseq_if_unbound (const char *keyseq, rl_command_func_t *function) +Binds @var{keyseq} to @var{function} if it is not already bound in the +currently active keymap. +Returns non-zero in the case of an invalid @var{keyseq} or if @var{keyseq} is +already bound. +@end deftypefun + +@deftypefun int rl_bind_keyseq_if_unbound_in_map (const char *keyseq, rl_command_func_t *function, Keymap map) +Binds @var{keyseq} to @var{function} if it is not already bound in @var{map}. +Returns non-zero in the case of an invalid @var{keyseq} or if @var{keyseq} is +already bound. +@end deftypefun + +@deftypefun int rl_generic_bind (int type, const char *keyseq, char *data, Keymap map) +Bind the key sequence represented by the string @var{keyseq} to the arbitrary +pointer @var{data}. @var{type} says what kind of data is pointed to by +@var{data}; this can be a function (@code{ISFUNC}), a macro +(@code{ISMACR}), or a keymap (@code{ISKMAP}). This makes new keymaps as +necessary. The initial keymap in which to do bindings is @var{map}. +@end deftypefun + +@deftypefun int rl_parse_and_bind (char *line) +Parse @var{line} as if it had been read from the @code{inputrc} file and +perform any key bindings and variable assignments found +(@pxref{Readline Init File}). +@end deftypefun + +@deftypefun int rl_read_init_file (const char *filename) +Read keybindings and variable assignments from @var{filename} +(@pxref{Readline Init File}). +@end deftypefun + +@node Associating Function Names and Bindings +@subsection Associating Function Names and Bindings + +These functions allow you to find out what keys invoke named functions +and the functions invoked by a particular key sequence. You may also +associate a new function name with an arbitrary function. + +@deftypefun {rl_command_func_t *} rl_named_function (const char *name) +Return the function with name @var{name}. +@end deftypefun + +@deftypefun {rl_command_func_t *} rl_function_of_keyseq (const char *keyseq, Keymap map, int *type) +Return the function invoked by @var{keyseq} in keymap @var{map}. +If @var{map} is @code{NULL}, the current keymap is used. If @var{type} is +not @code{NULL}, the type of the object is returned in the @code{int} variable +it points to (one of @code{ISFUNC}, @code{ISKMAP}, or @code{ISMACR}). +@end deftypefun + +@deftypefun {char **} rl_invoking_keyseqs (rl_command_func_t *function) +Return an array of strings representing the key sequences used to +invoke @var{function} in the current keymap. +@end deftypefun + +@deftypefun {char **} rl_invoking_keyseqs_in_map (rl_command_func_t *function, Keymap map) +Return an array of strings representing the key sequences used to +invoke @var{function} in the keymap @var{map}. +@end deftypefun + +@deftypefun void rl_function_dumper (int readable) +Print the readline function names and the key sequences currently +bound to them to @code{rl_outstream}. If @var{readable} is non-zero, +the list is formatted in such a way that it can be made part of an +@code{inputrc} file and re-read. +@end deftypefun + +@deftypefun void rl_list_funmap_names (void) +Print the names of all bindable Readline functions to @code{rl_outstream}. +@end deftypefun + +@deftypefun {const char **} rl_funmap_names (void) +Return a NULL terminated array of known function names. The array is +sorted. The array itself is allocated, but not the strings inside. You +should free the array, but not the pointers, using @code{free} or +@code{rl_free} when you are done. +@end deftypefun + +@deftypefun int rl_add_funmap_entry (const char *name, rl_command_func_t *function) +Add @var{name} to the list of bindable Readline command names, and make +@var{function} the function to be called when @var{name} is invoked. +@end deftypefun + +@node Allowing Undoing +@subsection Allowing Undoing + +Supporting the undo command is a painless thing, and makes your +functions much more useful. It is certainly easy to try +something if you know you can undo it. + +If your function simply inserts text once, or deletes text once, and +uses @code{rl_insert_text()} or @code{rl_delete_text()} to do it, then +undoing is already done for you automatically. + +If you do multiple insertions or multiple deletions, or any combination +of these operations, you should group them together into one operation. +This is done with @code{rl_begin_undo_group()} and +@code{rl_end_undo_group()}. + +The types of events that can be undone are: + +@smallexample +enum undo_code @{ UNDO_DELETE, UNDO_INSERT, UNDO_BEGIN, UNDO_END @}; +@end smallexample + +Notice that @code{UNDO_DELETE} means to insert some text, and +@code{UNDO_INSERT} means to delete some text. That is, the undo code +tells what to undo, not how to undo it. @code{UNDO_BEGIN} and +@code{UNDO_END} are tags added by @code{rl_begin_undo_group()} and +@code{rl_end_undo_group()}. + +@deftypefun int rl_begin_undo_group (void) +Begins saving undo information in a group construct. The undo +information usually comes from calls to @code{rl_insert_text()} and +@code{rl_delete_text()}, but could be the result of calls to +@code{rl_add_undo()}. +@end deftypefun + +@deftypefun int rl_end_undo_group (void) +Closes the current undo group started with @code{rl_begin_undo_group +()}. There should be one call to @code{rl_end_undo_group()} +for each call to @code{rl_begin_undo_group()}. +@end deftypefun + +@deftypefun void rl_add_undo (enum undo_code what, int start, int end, char *text) +Remember how to undo an event (according to @var{what}). The affected +text runs from @var{start} to @var{end}, and encompasses @var{text}. +@end deftypefun + +@deftypefun void rl_free_undo_list (void) +Free the existing undo list. +@end deftypefun + +@deftypefun int rl_do_undo (void) +Undo the first thing on the undo list. Returns @code{0} if there was +nothing to undo, non-zero if something was undone. +@end deftypefun + +Finally, if you neither insert nor delete text, but directly modify the +existing text (e.g., change its case), call @code{rl_modifying()} +once, just before you modify the text. You must supply the indices of +the text range that you are going to modify. + +@deftypefun int rl_modifying (int start, int end) +Tell Readline to save the text between @var{start} and @var{end} as a +single undo unit. It is assumed that you will subsequently modify +that text. +@end deftypefun + +@node Redisplay +@subsection Redisplay + +@deftypefun void rl_redisplay (void) +Change what's displayed on the screen to reflect the current contents +of @code{rl_line_buffer}. +@end deftypefun + +@deftypefun int rl_forced_update_display (void) +Force the line to be updated and redisplayed, whether or not +Readline thinks the screen display is correct. +@end deftypefun + +@deftypefun int rl_on_new_line (void) +Tell the update functions that we have moved onto a new (empty) line, +usually after outputting a newline. +@end deftypefun + +@deftypefun int rl_on_new_line_with_prompt (void) +Tell the update functions that we have moved onto a new line, with +@var{rl_prompt} already displayed. +This could be used by applications that want to output the prompt string +themselves, but still need Readline to know the prompt string length for +redisplay. +It should be used after setting @var{rl_already_prompted}. +@end deftypefun + +@deftypefun int rl_reset_line_state (void) +Reset the display state to a clean state and redisplay the current line +starting on a new line. +@end deftypefun + +@deftypefun int rl_crlf (void) +Move the cursor to the start of the next screen line. +@end deftypefun + +@deftypefun int rl_show_char (int c) +Display character @var{c} on @code{rl_outstream}. +If Readline has not been set to display meta characters directly, this +will convert meta characters to a meta-prefixed key sequence. +This is intended for use by applications which wish to do their own +redisplay. +@end deftypefun + +@deftypefun int rl_message (const char *, @dots{}) +The arguments are a format string as would be supplied to @code{printf}, +possibly containing conversion specifications such as @samp{%d}, and +any additional arguments necessary to satisfy the conversion specifications. +The resulting string is displayed in the @dfn{echo area}. The echo area +is also used to display numeric arguments and search strings. +You should call @code{rl_save_prompt} to save the prompt information +before calling this function. +@end deftypefun + +@deftypefun int rl_clear_message (void) +Clear the message in the echo area. If the prompt was saved with a call to +@code{rl_save_prompt} before the last call to @code{rl_message}, +call @code{rl_restore_prompt} before calling this function. +@end deftypefun + +@deftypefun void rl_save_prompt (void) +Save the local Readline prompt display state in preparation for +displaying a new message in the message area with @code{rl_message()}. +@end deftypefun + +@deftypefun void rl_restore_prompt (void) +Restore the local Readline prompt display state saved by the most +recent call to @code{rl_save_prompt}. +if @code{rl_save_prompt} was called to save the prompt before a call +to @code{rl_message}, this function should be called before the +corresponding call to @code{rl_clear_message}. +@end deftypefun + +@deftypefun int rl_expand_prompt (char *prompt) +Expand any special character sequences in @var{prompt} and set up the +local Readline prompt redisplay variables. +This function is called by @code{readline()}. It may also be called to +expand the primary prompt if the @code{rl_on_new_line_with_prompt()} +function or @code{rl_already_prompted} variable is used. +It returns the number of visible characters on the last line of the +(possibly multi-line) prompt. +Applications may indicate that the prompt contains characters that take +up no physical screen space when displayed by bracketing a sequence of +such characters with the special markers @code{RL_PROMPT_START_IGNORE} +and @code{RL_PROMPT_END_IGNORE} (declared in @file{readline.h}. This may +be used to embed terminal-specific escape sequences in prompts. +@end deftypefun + +@deftypefun int rl_set_prompt (const char *prompt) +Make Readline use @var{prompt} for subsequent redisplay. This calls +@code{rl_expand_prompt()} to expand the prompt and sets @code{rl_prompt} +to the result. +@end deftypefun + +@node Modifying Text +@subsection Modifying Text + +@deftypefun int rl_insert_text (const char *text) +Insert @var{text} into the line at the current cursor position. +Returns the number of characters inserted. +@end deftypefun + +@deftypefun int rl_delete_text (int start, int end) +Delete the text between @var{start} and @var{end} in the current line. +Returns the number of characters deleted. +@end deftypefun + +@deftypefun {char *} rl_copy_text (int start, int end) +Return a copy of the text between @var{start} and @var{end} in +the current line. +@end deftypefun + +@deftypefun int rl_kill_text (int start, int end) +Copy the text between @var{start} and @var{end} in the current line +to the kill ring, appending or prepending to the last kill if the +last command was a kill command. The text is deleted. +If @var{start} is less than @var{end}, +the text is appended, otherwise prepended. If the last command was +not a kill, a new kill ring slot is used. +@end deftypefun + +@deftypefun int rl_push_macro_input (char *macro) +Cause @var{macro} to be inserted into the line, as if it had been invoked +by a key bound to a macro. Not especially useful; use +@code{rl_insert_text()} instead. +@end deftypefun + +@node Character Input +@subsection Character Input + +@deftypefun int rl_read_key (void) +Return the next character available from Readline's current input stream. +This handles input inserted into +the input stream via @var{rl_pending_input} (@pxref{Readline Variables}) +and @code{rl_stuff_char()}, macros, and characters read from the keyboard. +While waiting for input, this function will call any function assigned to +the @code{rl_event_hook} variable. +@end deftypefun + +@deftypefun int rl_getc (FILE *stream) +Return the next character available from @var{stream}, which is assumed to +be the keyboard. +@end deftypefun + +@deftypefun int rl_stuff_char (int c) +Insert @var{c} into the Readline input stream. It will be "read" +before Readline attempts to read characters from the terminal with +@code{rl_read_key()}. Up to 512 characters may be pushed back. +@code{rl_stuff_char} returns 1 if the character was successfully inserted; +0 otherwise. +@end deftypefun + +@deftypefun int rl_execute_next (int c) +Make @var{c} be the next command to be executed when @code{rl_read_key()} +is called. This sets @var{rl_pending_input}. +@end deftypefun + +@deftypefun int rl_clear_pending_input (void) +Unset @var{rl_pending_input}, effectively negating the effect of any +previous call to @code{rl_execute_next()}. This works only if the +pending input has not already been read with @code{rl_read_key()}. +@end deftypefun + +@deftypefun int rl_set_keyboard_input_timeout (int u) +While waiting for keyboard input in @code{rl_read_key()}, Readline will +wait for @var{u} microseconds for input before calling any function +assigned to @code{rl_event_hook}. @var{u} must be greater than or equal +to zero (a zero-length timeout is equivalent to a poll). +The default waiting period is one-tenth of a second. +Returns the old timeout value. +@end deftypefun + +@node Terminal Management +@subsection Terminal Management + +@deftypefun void rl_prep_terminal (int meta_flag) +Modify the terminal settings for Readline's use, so @code{readline()} +can read a single character at a time from the keyboard. +The @var{meta_flag} argument should be non-zero if Readline should +read eight-bit input. +@end deftypefun + +@deftypefun void rl_deprep_terminal (void) +Undo the effects of @code{rl_prep_terminal()}, leaving the terminal in +the state in which it was before the most recent call to +@code{rl_prep_terminal()}. +@end deftypefun + +@deftypefun void rl_tty_set_default_bindings (Keymap kmap) +Read the operating system's terminal editing characters (as would be +displayed by @code{stty}) to their Readline equivalents. +The bindings are performed in @var{kmap}. +@end deftypefun + +@deftypefun void rl_tty_unset_default_bindings (Keymap kmap) +Reset the bindings manipulated by @code{rl_tty_set_default_bindings} so +that the terminal editing characters are bound to @code{rl_insert}. +The bindings are performed in @var{kmap}. +@end deftypefun + +@deftypefun int rl_reset_terminal (const char *terminal_name) +Reinitialize Readline's idea of the terminal settings using +@var{terminal_name} as the terminal type (e.g., @code{vt100}). +If @var{terminal_name} is @code{NULL}, the value of the @code{TERM} +environment variable is used. +@end deftypefun + +@node Utility Functions +@subsection Utility Functions + +@deftypefun int rl_save_state (struct readline_state *sp) +Save a snapshot of Readline's internal state to @var{sp}. +The contents of the @var{readline_state} structure are documented +in @file{readline.h}. +The caller is responsible for allocating the structure. +@end deftypefun + +@deftypefun int rl_restore_state (struct readline_state *sp) +Restore Readline's internal state to that stored in @var{sp}, which must +have been saved by a call to @code{rl_save_state}. +The contents of the @var{readline_state} structure are documented +in @file{readline.h}. +The caller is responsible for freeing the structure. +@end deftypefun + +@deftypefun void rl_free (void *mem) +Deallocate the memory pointed to by @var{mem}. @var{mem} must have been +allocated by @code{malloc}. +@end deftypefun + +@deftypefun void rl_replace_line (const char *text, int clear_undo) +Replace the contents of @code{rl_line_buffer} with @var{text}. +The point and mark are preserved, if possible. +If @var{clear_undo} is non-zero, the undo list associated with the +current line is cleared. +@end deftypefun + +@deftypefun void rl_extend_line_buffer (int len) +Ensure that @code{rl_line_buffer} has enough space to hold @var{len} +characters, possibly reallocating it if necessary. +@end deftypefun + +@deftypefun int rl_initialize (void) +Initialize or re-initialize Readline's internal state. +It's not strictly necessary to call this; @code{readline()} calls it before +reading any input. +@end deftypefun + +@deftypefun int rl_ding (void) +Ring the terminal bell, obeying the setting of @code{bell-style}. +@end deftypefun + +@deftypefun int rl_alphabetic (int c) +Return 1 if @var{c} is an alphabetic character. +@end deftypefun + +@deftypefun void rl_display_match_list (char **matches, int len, int max) +A convenience function for displaying a list of strings in +columnar format on Readline's output stream. @code{matches} is the list +of strings, in argv format, such as a list of completion matches. +@code{len} is the number of strings in @code{matches}, and @code{max} +is the length of the longest string in @code{matches}. This function uses +the setting of @code{print-completions-horizontally} to select how the +matches are displayed (@pxref{Readline Init File Syntax}). +When displaying completions, this function sets the number of columns used +for display to the value of @code{completion-display-width}, the value of +the environment variable @env{COLUMNS}, or the screen width, in that order. +@end deftypefun + +The following are implemented as macros, defined in @code{chardefs.h}. +Applications should refrain from using them. + +@deftypefun int _rl_uppercase_p (int c) +Return 1 if @var{c} is an uppercase alphabetic character. +@end deftypefun + +@deftypefun int _rl_lowercase_p (int c) +Return 1 if @var{c} is a lowercase alphabetic character. +@end deftypefun + +@deftypefun int _rl_digit_p (int c) +Return 1 if @var{c} is a numeric character. +@end deftypefun + +@deftypefun int _rl_to_upper (int c) +If @var{c} is a lowercase alphabetic character, return the corresponding +uppercase character. +@end deftypefun + +@deftypefun int _rl_to_lower (int c) +If @var{c} is an uppercase alphabetic character, return the corresponding +lowercase character. +@end deftypefun + +@deftypefun int _rl_digit_value (int c) +If @var{c} is a number, return the value it represents. +@end deftypefun + +@node Miscellaneous Functions +@subsection Miscellaneous Functions + +@deftypefun int rl_macro_bind (const char *keyseq, const char *macro, Keymap map) +Bind the key sequence @var{keyseq} to invoke the macro @var{macro}. +The binding is performed in @var{map}. When @var{keyseq} is invoked, the +@var{macro} will be inserted into the line. This function is deprecated; +use @code{rl_generic_bind()} instead. +@end deftypefun + +@deftypefun void rl_macro_dumper (int readable) +Print the key sequences bound to macros and their values, using +the current keymap, to @code{rl_outstream}. +If @var{readable} is non-zero, the list is formatted in such a way +that it can be made part of an @code{inputrc} file and re-read. +@end deftypefun + +@deftypefun int rl_variable_bind (const char *variable, const char *value) +Make the Readline variable @var{variable} have @var{value}. +This behaves as if the readline command +@samp{set @var{variable} @var{value}} had been executed in an @code{inputrc} +file (@pxref{Readline Init File Syntax}). +@end deftypefun + +@deftypefun {char *} rl_variable_value (const char *variable) +Return a string representing the value of the Readline variable @var{variable}. +For boolean variables, this string is either @samp{on} or @samp{off}. +@end deftypefun + +@deftypefun void rl_variable_dumper (int readable) +Print the readline variable names and their current values +to @code{rl_outstream}. +If @var{readable} is non-zero, the list is formatted in such a way +that it can be made part of an @code{inputrc} file and re-read. +@end deftypefun + +@deftypefun int rl_set_paren_blink_timeout (int u) +Set the time interval (in microseconds) that Readline waits when showing +a balancing character when @code{blink-matching-paren} has been enabled. +@end deftypefun + +@deftypefun {char *} rl_get_termcap (const char *cap) +Retrieve the string value of the termcap capability @var{cap}. +Readline fetches the termcap entry for the current terminal name and +uses those capabilities to move around the screen line and perform other +terminal-specific operations, like erasing a line. Readline does not +use all of a terminal's capabilities, and this function will return +values for only those capabilities Readline uses. +@end deftypefun + +@deftypefun {void} rl_clear_history (void) +Clear the history list by deleting all of the entries, in the same manner +as the History library's @code{clear_history()} function. +This differs from @code{clear_history} because it frees private data +Readline saves in the history list. +@end deftypefun + +@node Alternate Interface +@subsection Alternate Interface + +An alternate interface is available to plain @code{readline()}. Some +applications need to interleave keyboard I/O with file, device, or +window system I/O, typically by using a main loop to @code{select()} +on various file descriptors. To accommodate this need, readline can +also be invoked as a `callback' function from an event loop. There +are functions available to make this easy. + +@deftypefun void rl_callback_handler_install (const char *prompt, rl_vcpfunc_t *lhandler) +Set up the terminal for readline I/O and display the initial +expanded value of @var{prompt}. Save the value of @var{lhandler} to +use as a handler function to call when a complete line of input has been +entered. +The handler function receives the text of the line as an argument. +@end deftypefun + +@deftypefun void rl_callback_read_char (void) +Whenever an application determines that keyboard input is available, it +should call @code{rl_callback_read_char()}, which will read the next +character from the current input source. +If that character completes the line, @code{rl_callback_read_char} will +invoke the @var{lhandler} function installed by +@code{rl_callback_handler_install} to process the line. +Before calling the @var{lhandler} function, the terminal settings are +reset to the values they had before calling +@code{rl_callback_handler_install}. +If the @var{lhandler} function returns, +and the line handler remains installed, +the terminal settings are modified for Readline's use again. +@code{EOF} is indicated by calling @var{lhandler} with a +@code{NULL} line. +@end deftypefun + +@deftypefun void rl_callback_handler_remove (void) +Restore the terminal to its initial state and remove the line handler. +This may be called from within a callback as well as independently. +If the @var{lhandler} installed by @code{rl_callback_handler_install} +does not exit the program, either this function or the function referred +to by the value of @code{rl_deprep_term_function} should be called before +the program exits to reset the terminal settings. +@end deftypefun + +@node A Readline Example +@subsection A Readline Example + +Here is a function which changes lowercase characters to their uppercase +equivalents, and uppercase characters to lowercase. If +this function was bound to @samp{M-c}, then typing @samp{M-c} would +change the case of the character under point. Typing @samp{M-1 0 M-c} +would change the case of the following 10 characters, leaving the cursor on +the last character changed. + +@example +/* Invert the case of the COUNT following characters. */ +int +invert_case_line (count, key) + int count, key; +@{ + register int start, end, i; + + start = rl_point; + + if (rl_point >= rl_end) + return (0); + + if (count < 0) + @{ + direction = -1; + count = -count; + @} + else + direction = 1; + + /* Find the end of the range to modify. */ + end = start + (count * direction); + + /* Force it to be within range. */ + if (end > rl_end) + end = rl_end; + else if (end < 0) + end = 0; + + if (start == end) + return (0); + + if (start > end) + @{ + int temp = start; + start = end; + end = temp; + @} + + /* Tell readline that we are modifying the line, + so it will save the undo information. */ + rl_modifying (start, end); + + for (i = start; i != end; i++) + @{ + if (_rl_uppercase_p (rl_line_buffer[i])) + rl_line_buffer[i] = _rl_to_lower (rl_line_buffer[i]); + else if (_rl_lowercase_p (rl_line_buffer[i])) + rl_line_buffer[i] = _rl_to_upper (rl_line_buffer[i]); + @} + /* Move point to on top of the last character changed. */ + rl_point = (direction == 1) ? end - 1 : start; + return (0); +@} +@end example + +@node Alternate Interface Example +@subsection Alternate Interface Example + +Here is a complete program that illustrates Readline's alternate interface. +It reads lines from the terminal and displays them, providing the +standard history and TAB completion functions. +It understands the EOF character or "exit" to exit the program. + +@example +/* Standard include files. stdio.h is required. */ +#include +#include + +/* Used for select(2) */ +#include +#include + +#include + +/* Standard readline include files. */ +#include +#include + +static void cb_linehandler (char *); + +int running; +const char *prompt = "rltest$ "; + +/* Callback function called for each line when accept-line executed, EOF + seen, or EOF character read. This sets a flag and returns; it could + also call exit(3). */ +static void +cb_linehandler (char *line) +@{ + /* Can use ^D (stty eof) or `exit' to exit. */ + if (line == NULL || strcmp (line, "exit") == 0) + @{ + if (line == 0) + printf ("\n"); + printf ("exit\n"); + /* This function needs to be called to reset the terminal settings, + and calling it from the line handler keeps one extra prompt from + being displayed. */ + rl_callback_handler_remove (); + + running = 0; + @} + else + @{ + if (*line) + add_history (line); + printf ("input line: %s\n", line); + free (line); + @} +@} + +int +main (int c, char **v) +@{ + fd_set fds; + int r; + + /* Install the line handler. */ + rl_callback_handler_install (prompt, cb_linehandler); + + /* Enter a simple event loop. This waits until something is available + to read on readline's input stream (defaults to standard input) and + calls the builtin character read callback to read it. It does not + have to modify the user's terminal settings. */ + running = 1; + while (running) + @{ + FD_ZERO (&fds); + FD_SET (fileno (rl_instream), &fds); + + r = select (FD_SETSIZE, &fds, NULL, NULL, NULL); + if (r < 0) + @{ + perror ("rltest: select"); + rl_callback_handler_remove (); + break; + @} + + if (FD_ISSET (fileno (rl_instream), &fds)) + rl_callback_read_char (); + @} + + printf ("rltest: Event loop has exited\n"); + return 0; +@} +@end example + +@node Readline Signal Handling +@section Readline Signal Handling + +Signals are asynchronous events sent to a process by the Unix kernel, +sometimes on behalf of another process. They are intended to indicate +exceptional events, like a user pressing the interrupt key on his terminal, +or a network connection being broken. There is a class of signals that can +be sent to the process currently reading input from the keyboard. Since +Readline changes the terminal attributes when it is called, it needs to +perform special processing when such a signal is received in order to +restore the terminal to a sane state, or provide application writers with +functions to do so manually. + +Readline contains an internal signal handler that is installed for a +number of signals (@code{SIGINT}, @code{SIGQUIT}, @code{SIGTERM}, +@code{SIGHUP}, +@code{SIGALRM}, @code{SIGTSTP}, @code{SIGTTIN}, and @code{SIGTTOU}). +When one of these signals is received, the signal handler +will reset the terminal attributes to those that were in effect before +@code{readline()} was called, reset the signal handling to what it was +before @code{readline()} was called, and resend the signal to the calling +application. +If and when the calling application's signal handler returns, Readline +will reinitialize the terminal and continue to accept input. +When a @code{SIGINT} is received, the Readline signal handler performs +some additional work, which will cause any partially-entered line to be +aborted (see the description of @code{rl_free_line_state()} below). + +There is an additional Readline signal handler, for @code{SIGWINCH}, which +the kernel sends to a process whenever the terminal's size changes (for +example, if a user resizes an @code{xterm}). The Readline @code{SIGWINCH} +handler updates Readline's internal screen size information, and then calls +any @code{SIGWINCH} signal handler the calling application has installed. +Readline calls the application's @code{SIGWINCH} signal handler without +resetting the terminal to its original state. If the application's signal +handler does more than update its idea of the terminal size and return (for +example, a @code{longjmp} back to a main processing loop), it @emph{must} +call @code{rl_cleanup_after_signal()} (described below), to restore the +terminal state. + +Readline provides two variables that allow application writers to +control whether or not it will catch certain signals and act on them +when they are received. It is important that applications change the +values of these variables only when calling @code{readline()}, not in +a signal handler, so Readline's internal signal state is not corrupted. + +@deftypevar int rl_catch_signals +If this variable is non-zero, Readline will install signal handlers for +@code{SIGINT}, @code{SIGQUIT}, @code{SIGTERM}, @code{SIGHUP}, @code{SIGALRM}, +@code{SIGTSTP}, @code{SIGTTIN}, and @code{SIGTTOU}. + +The default value of @code{rl_catch_signals} is 1. +@end deftypevar + +@deftypevar int rl_catch_sigwinch +If this variable is set to a non-zero value, +Readline will install a signal handler for @code{SIGWINCH}. + +The default value of @code{rl_catch_sigwinch} is 1. +@end deftypevar + +@deftypevar int rl_change_environment +If this variable is set to a non-zero value, +and Readline is handling @code{SIGWINCH}, Readline will modify the +@var{LINES} and @var{COLUMNS} environment variables upon receipt of a +@code{SIGWINCH} + +The default value of @code{rl_change_environment} is 1. +@end deftypevar + +If an application does not wish to have Readline catch any signals, or +to handle signals other than those Readline catches (@code{SIGHUP}, +for example), +Readline provides convenience functions to do the necessary terminal +and internal state cleanup upon receipt of a signal. + +@deftypefun void rl_cleanup_after_signal (void) +This function will reset the state of the terminal to what it was before +@code{readline()} was called, and remove the Readline signal handlers for +all signals, depending on the values of @code{rl_catch_signals} and +@code{rl_catch_sigwinch}. +@end deftypefun + +@deftypefun void rl_free_line_state (void) +This will free any partial state associated with the current input line +(undo information, any partial history entry, any partially-entered +keyboard macro, and any partially-entered numeric argument). This +should be called before @code{rl_cleanup_after_signal()}. The +Readline signal handler for @code{SIGINT} calls this to abort the +current input line. +@end deftypefun + +@deftypefun void rl_reset_after_signal (void) +This will reinitialize the terminal and reinstall any Readline signal +handlers, depending on the values of @code{rl_catch_signals} and +@code{rl_catch_sigwinch}. +@end deftypefun + +If an application does not wish Readline to catch @code{SIGWINCH}, it may +call @code{rl_resize_terminal()} or @code{rl_set_screen_size()} to force +Readline to update its idea of the terminal size when a @code{SIGWINCH} +is received. + +@deftypefun void rl_echo_signal_char (int sig) +If an application wishes to install its own signal handlers, but still +have readline display characters that generate signals, calling this +function with @var{sig} set to @code{SIGINT}, @code{SIGQUIT}, or +@code{SIGTSTP} will display the character generating that signal. +@end deftypefun + +@deftypefun void rl_resize_terminal (void) +Update Readline's internal screen size by reading values from the kernel. +@end deftypefun + +@deftypefun void rl_set_screen_size (int rows, int cols) +Set Readline's idea of the terminal size to @var{rows} rows and +@var{cols} columns. If either @var{rows} or @var{columns} is less than +or equal to 0, Readline's idea of that terminal dimension is unchanged. +@end deftypefun + +If an application does not want to install a @code{SIGWINCH} handler, but +is still interested in the screen dimensions, Readline's idea of the screen +size may be queried. + +@deftypefun void rl_get_screen_size (int *rows, int *cols) +Return Readline's idea of the terminal's size in the +variables pointed to by the arguments. +@end deftypefun + +@deftypefun void rl_reset_screen_size (void) +Cause Readline to reobtain the screen size and recalculate its dimensions. +@end deftypefun + +The following functions install and remove Readline's signal handlers. + +@deftypefun int rl_set_signals (void) +Install Readline's signal handler for @code{SIGINT}, @code{SIGQUIT}, +@code{SIGTERM}, @code{SIGHUP}, @code{SIGALRM}, @code{SIGTSTP}, @code{SIGTTIN}, +@code{SIGTTOU}, and @code{SIGWINCH}, depending on the values of +@code{rl_catch_signals} and @code{rl_catch_sigwinch}. +@end deftypefun + +@deftypefun int rl_clear_signals (void) +Remove all of the Readline signal handlers installed by +@code{rl_set_signals()}. +@end deftypefun + +@node Custom Completers +@section Custom Completers +@cindex application-specific completion functions + +Typically, a program that reads commands from the user has a way of +disambiguating commands and data. If your program is one of these, then +it can provide completion for commands, data, or both. +The following sections describe how your program and Readline +cooperate to provide this service. + +@menu +* How Completing Works:: The logic used to do completion. +* Completion Functions:: Functions provided by Readline. +* Completion Variables:: Variables which control completion. +* A Short Completion Example:: An example of writing completer subroutines. +@end menu + +@node How Completing Works +@subsection How Completing Works + +In order to complete some text, the full list of possible completions +must be available. That is, it is not possible to accurately +expand a partial word without knowing all of the possible words +which make sense in that context. The Readline library provides +the user interface to completion, and two of the most common +completion functions: filename and username. For completing other types +of text, you must write your own completion function. This section +describes exactly what such functions must do, and provides an example. + +There are three major functions used to perform completion: + +@enumerate +@item +The user-interface function @code{rl_complete()}. This function is +called with the same arguments as other bindable Readline functions: +@var{count} and @var{invoking_key}. +It isolates the word to be completed and calls +@code{rl_completion_matches()} to generate a list of possible completions. +It then either lists the possible completions, inserts the possible +completions, or actually performs the +completion, depending on which behavior is desired. + +@item +The internal function @code{rl_completion_matches()} uses an +application-supplied @dfn{generator} function to generate the list of +possible matches, and then returns the array of these matches. +The caller should place the address of its generator function in +@code{rl_completion_entry_function}. + +@item +The generator function is called repeatedly from +@code{rl_completion_matches()}, returning a string each time. The +arguments to the generator function are @var{text} and @var{state}. +@var{text} is the partial word to be completed. @var{state} is zero the +first time the function is called, allowing the generator to perform +any necessary initialization, and a positive non-zero integer for +each subsequent call. The generator function returns +@code{(char *)NULL} to inform @code{rl_completion_matches()} that there are +no more possibilities left. Usually the generator function computes the +list of possible completions when @var{state} is zero, and returns them +one at a time on subsequent calls. Each string the generator function +returns as a match must be allocated with @code{malloc()}; Readline +frees the strings when it has finished with them. +Such a generator function is referred to as an +@dfn{application-specific completion function}. + +@end enumerate + +@deftypefun int rl_complete (int ignore, int invoking_key) +Complete the word at or before point. You have supplied the function +that does the initial simple matching selection algorithm (see +@code{rl_completion_matches()}). The default is to do filename completion. +@end deftypefun + +@deftypevar {rl_compentry_func_t *} rl_completion_entry_function +This is a pointer to the generator function for +@code{rl_completion_matches()}. +If the value of @code{rl_completion_entry_function} is +@code{NULL} then the default filename generator +function, @code{rl_filename_completion_function()}, is used. +An @dfn{application-specific completion function} is a function whose +address is assigned to @code{rl_completion_entry_function} and whose +return values are used to generate possible completions. +@end deftypevar + +@node Completion Functions +@subsection Completion Functions + +Here is the complete list of callable completion functions present in +Readline. + +@deftypefun int rl_complete_internal (int what_to_do) +Complete the word at or before point. @var{what_to_do} says what to do +with the completion. A value of @samp{?} means list the possible +completions. @samp{TAB} means do standard completion. @samp{*} means +insert all of the possible completions. @samp{!} means to display +all of the possible completions, if there is more than one, as well as +performing partial completion. @samp{@@} is similar to @samp{!}, but +possible completions are not listed if the possible completions share +a common prefix. +@end deftypefun + +@deftypefun int rl_complete (int ignore, int invoking_key) +Complete the word at or before point. You have supplied the function +that does the initial simple matching selection algorithm (see +@code{rl_completion_matches()} and @code{rl_completion_entry_function}). +The default is to do filename +completion. This calls @code{rl_complete_internal()} with an +argument depending on @var{invoking_key}. +@end deftypefun + +@deftypefun int rl_possible_completions (int count, int invoking_key) +List the possible completions. See description of @code{rl_complete +()}. This calls @code{rl_complete_internal()} with an argument of +@samp{?}. +@end deftypefun + +@deftypefun int rl_insert_completions (int count, int invoking_key) +Insert the list of possible completions into the line, deleting the +partially-completed word. See description of @code{rl_complete()}. +This calls @code{rl_complete_internal()} with an argument of @samp{*}. +@end deftypefun + +@deftypefun int rl_completion_mode (rl_command_func_t *cfunc) +Returns the appropriate value to pass to @code{rl_complete_internal()} +depending on whether @var{cfunc} was called twice in succession and +the values of the @code{show-all-if-ambiguous} and +@code{show-all-if-unmodified} variables. +Application-specific completion functions may use this function to present +the same interface as @code{rl_complete()}. +@end deftypefun + +@deftypefun {char **} rl_completion_matches (const char *text, rl_compentry_func_t *entry_func) +Returns an array of strings which is a list of completions for +@var{text}. If there are no completions, returns @code{NULL}. +The first entry in the returned array is the substitution for @var{text}. +The remaining entries are the possible completions. The array is +terminated with a @code{NULL} pointer. + +@var{entry_func} is a function of two args, and returns a +@code{char *}. The first argument is @var{text}. The second is a +state argument; it is zero on the first call, and non-zero on subsequent +calls. @var{entry_func} returns a @code{NULL} pointer to the caller +when there are no more matches. +@end deftypefun + +@deftypefun {char *} rl_filename_completion_function (const char *text, int state) +A generator function for filename completion in the general case. +@var{text} is a partial filename. +The Bash source is a useful reference for writing application-specific +completion functions (the Bash completion functions call this and other +Readline functions). +@end deftypefun + +@deftypefun {char *} rl_username_completion_function (const char *text, int state) +A completion generator for usernames. @var{text} contains a partial +username preceded by a random character (usually @samp{~}). As with all +completion generators, @var{state} is zero on the first call and non-zero +for subsequent calls. +@end deftypefun + +@node Completion Variables +@subsection Completion Variables + +@deftypevar {rl_compentry_func_t *} rl_completion_entry_function +A pointer to the generator function for @code{rl_completion_matches()}. +@code{NULL} means to use @code{rl_filename_completion_function()}, +the default filename completer. +@end deftypevar + +@deftypevar {rl_completion_func_t *} rl_attempted_completion_function +A pointer to an alternative function to create matches. +The function is called with @var{text}, @var{start}, and @var{end}. +@var{start} and @var{end} are indices in @code{rl_line_buffer} defining +the boundaries of @var{text}, which is a character string. +If this function exists and returns @code{NULL}, or if this variable is +set to @code{NULL}, then @code{rl_complete()} will call the value of +@code{rl_completion_entry_function} to generate matches, otherwise the +array of strings returned will be used. +If this function sets the @code{rl_attempted_completion_over} +variable to a non-zero value, Readline will not perform its default +completion even if this function returns no matches. +@end deftypevar + +@deftypevar {rl_quote_func_t *} rl_filename_quoting_function +A pointer to a function that will quote a filename in an +application-specific fashion. This is called if filename completion is being +attempted and one of the characters in @code{rl_filename_quote_characters} +appears in a completed filename. The function is called with +@var{text}, @var{match_type}, and @var{quote_pointer}. The @var{text} +is the filename to be quoted. The @var{match_type} is either +@code{SINGLE_MATCH}, if there is only one completion match, or +@code{MULT_MATCH}. Some functions use this to decide whether or not to +insert a closing quote character. The @var{quote_pointer} is a pointer +to any opening quote character the user typed. Some functions choose +to reset this character. +@end deftypevar + +@deftypevar {rl_dequote_func_t *} rl_filename_dequoting_function +A pointer to a function that will remove application-specific quoting +characters from a filename before completion is attempted, so those +characters do not interfere with matching the text against names in +the filesystem. It is called with @var{text}, the text of the word +to be dequoted, and @var{quote_char}, which is the quoting character +that delimits the filename (usually @samp{'} or @samp{"}). If +@var{quote_char} is zero, the filename was not in an embedded string. +@end deftypevar + +@deftypevar {rl_linebuf_func_t *} rl_char_is_quoted_p +A pointer to a function to call that determines whether or not a specific +character in the line buffer is quoted, according to whatever quoting +mechanism the program calling Readline uses. The function is called with +two arguments: @var{text}, the text of the line, and @var{index}, the +index of the character in the line. It is used to decide whether a +character found in @code{rl_completer_word_break_characters} should be +used to break words for the completer. +@end deftypevar + +@deftypevar {rl_compignore_func_t *} rl_ignore_some_completions_function +This function, if defined, is called by the completer when real filename +completion is done, after all the matching names have been generated. +It is passed a @code{NULL} terminated array of matches. +The first element (@code{matches[0]}) is the +maximal substring common to all matches. This function can +re-arrange the list of matches as required, but each element deleted +from the array must be freed. +@end deftypevar + +@deftypevar {rl_icppfunc_t *} rl_directory_completion_hook +This function, if defined, is allowed to modify the directory portion +of filenames Readline completes. +It could be used to expand symbolic links or shell variables in pathnames. +It is called with the address of a string (the current directory name) as an +argument, and may modify that string. +If the string is replaced with a new string, the old value should be freed. +Any modified directory name should have a trailing slash. +The modified value will be used as part of the completion, replacing +the directory portion of the pathname the user typed. +At the least, even if no other expansion is performed, this function should +remove any quote characters from the directory name, because its result will +be passed directly to @code{opendir()}. + +The directory completion hook returns an integer that should be non-zero if +the function modifies its directory argument. +The function should not modify the directory argument if it returns 0. +@end deftypevar + +@deftypevar {rl_icppfunc_t *} rl_directory_rewrite_hook; +If non-zero, this is the address of a function to call when completing +a directory name. This function takes the address of the directory name +to be modified as an argument. Unlike @code{rl_directory_completion_hook}, +it only modifies the directory name used in @code{opendir}, not what is +displayed when the possible completions are printed or inserted. It is +called before rl_directory_completion_hook. +At the least, even if no other expansion is performed, this function should +remove any quote characters from the directory name, because its result will +be passed directly to @code{opendir()}. + +The directory rewrite hook returns an integer that should be non-zero if +the function modfies its directory argument. +The function should not modify the directory argument if it returns 0. +@end deftypevar + +@deftypevar {rl_icppfunc_t *} rl_filename_stat_hook +If non-zero, this is the address of a function for the completer to +call before deciding which character to append to a completed name. +This function modifies its filename name argument, and the modified value +is passed to @code{stat()} to determine the file's type and characteristics. +This function does not need to remove quote characters from the filename. + +The stat hook returns an integer that should be non-zero if +the function modfies its directory argument. +The function should not modify the directory argument if it returns 0. +@end deftypevar + +@deftypevar {rl_dequote_func_t *} rl_filename_rewrite_hook +If non-zero, this is the address of a function called when reading +directory entries from the filesystem for completion and comparing +them to the partial word to be completed. The function should +perform any necessary application or system-specific conversion on +the filename, such as converting between character sets or converting +from a filesystem format to a character input format. +The function takes two arguments: @var{fname}, the filename to be converted, +and @var{fnlen}, its length in bytes. +It must either return its first argument (if no conversion takes place) +or the converted filename in newly-allocated memory. The converted +form is used to compare against the word to be completed, and, if it +matches, is added to the list of matches. Readline will free the +allocated string. +@end deftypevar + +@deftypevar {rl_compdisp_func_t *} rl_completion_display_matches_hook +If non-zero, then this is the address of a function to call when +completing a word would normally display the list of possible matches. +This function is called in lieu of Readline displaying the list. +It takes three arguments: +(@code{char **}@var{matches}, @code{int} @var{num_matches}, @code{int} @var{max_length}) +where @var{matches} is the array of matching strings, +@var{num_matches} is the number of strings in that array, and +@var{max_length} is the length of the longest string in that array. +Readline provides a convenience function, @code{rl_display_match_list}, +that takes care of doing the display to Readline's output stream. That +function may be called from this hook. +@end deftypevar + +@deftypevar {const char *} rl_basic_word_break_characters +The basic list of characters that signal a break between words for the +completer routine. The default value of this variable is the characters +which break words for completion in Bash: +@code{" \t\n\"\\'`@@$><=;|&@{("}. +@end deftypevar + +@deftypevar {const char *} rl_basic_quote_characters +A list of quote characters which can cause a word break. +@end deftypevar + +@deftypevar {const char *} rl_completer_word_break_characters +The list of characters that signal a break between words for +@code{rl_complete_internal()}. The default list is the value of +@code{rl_basic_word_break_characters}. +@end deftypevar + +@deftypevar {rl_cpvfunc_t *} rl_completion_word_break_hook +If non-zero, this is the address of a function to call when Readline is +deciding where to separate words for word completion. It should return +a character string like @code{rl_completer_word_break_characters} to be +used to perform the current completion. The function may choose to set +@code{rl_completer_word_break_characters} itself. If the function +returns @code{NULL}, @code{rl_completer_word_break_characters} is used. +@end deftypevar + +@deftypevar {const char *} rl_completer_quote_characters +A list of characters which can be used to quote a substring of the line. +Completion occurs on the entire substring, and within the substring +@code{rl_completer_word_break_characters} are treated as any other character, +unless they also appear within this list. +@end deftypevar + +@deftypevar {const char *} rl_filename_quote_characters +A list of characters that cause a filename to be quoted by the completer +when they appear in a completed filename. The default is the null string. +@end deftypevar + +@deftypevar {const char *} rl_special_prefixes +The list of characters that are word break characters, but should be +left in @var{text} when it is passed to the completion function. +Programs can use this to help determine what kind of completing to do. +For instance, Bash sets this variable to "$@@" so that it can complete +shell variables and hostnames. +@end deftypevar + +@deftypevar int rl_completion_query_items +Up to this many items will be displayed in response to a +possible-completions call. After that, readline asks the user if she is sure +she wants to see them all. The default value is 100. A negative value +indicates that Readline should never ask the user. +@end deftypevar + +@deftypevar {int} rl_completion_append_character +When a single completion alternative matches at the end of the command +line, this character is appended to the inserted completion text. The +default is a space character (@samp{ }). Setting this to the null +character (@samp{\0}) prevents anything being appended automatically. +This can be changed in application-specific completion functions to +provide the ``most sensible word separator character'' according to +an application-specific command line syntax specification. +@end deftypevar + +@deftypevar int rl_completion_suppress_append +If non-zero, @var{rl_completion_append_character} is not appended to +matches at the end of the command line, as described above. +It is set to 0 before any application-specific completion function +is called, and may only be changed within such a function. +@end deftypevar + +@deftypevar int rl_completion_quote_character +When Readline is completing quoted text, as delimited by one of the +characters in @var{rl_completer_quote_characters}, it sets this variable +to the quoting character found. +This is set before any application-specific completion function is called. +@end deftypevar + +@deftypevar int rl_completion_suppress_quote +If non-zero, Readline does not append a matching quote character when +performing completion on a quoted string. +It is set to 0 before any application-specific completion function +is called, and may only be changed within such a function. +@end deftypevar + +@deftypevar int rl_completion_found_quote +When Readline is completing quoted text, it sets this variable +to a non-zero value if the word being completed contains or is delimited +by any quoting characters, including backslashes. +This is set before any application-specific completion function is called. +@end deftypevar + +@deftypevar int rl_completion_mark_symlink_dirs +If non-zero, a slash will be appended to completed filenames that are +symbolic links to directory names, subject to the value of the +user-settable @var{mark-directories} variable. +This variable exists so that application-specific completion functions +can override the user's global preference (set via the +@var{mark-symlinked-directories} Readline variable) if appropriate. +This variable is set to the user's preference before any +application-specific completion function is called, so unless that +function modifies the value, the user's preferences are honored. +@end deftypevar + +@deftypevar int rl_ignore_completion_duplicates +If non-zero, then duplicates in the matches are removed. +The default is 1. +@end deftypevar + +@deftypevar int rl_filename_completion_desired +Non-zero means that the results of the matches are to be treated as +filenames. This is @emph{always} zero when completion is attempted, +and can only be changed +within an application-specific completion function. If it is set to a +non-zero value by such a function, directory names have a slash appended +and Readline attempts to quote completed filenames if they contain any +characters in @code{rl_filename_quote_characters} and +@code{rl_filename_quoting_desired} is set to a non-zero value. +@end deftypevar + +@deftypevar int rl_filename_quoting_desired +Non-zero means that the results of the matches are to be quoted using +double quotes (or an application-specific quoting mechanism) if the +completed filename contains any characters in +@code{rl_filename_quote_chars}. This is @emph{always} non-zero +when completion is attempted, and can only be changed within an +application-specific completion function. +The quoting is effected via a call to the function pointed to +by @code{rl_filename_quoting_function}. +@end deftypevar + +@deftypevar int rl_attempted_completion_over +If an application-specific completion function assigned to +@code{rl_attempted_completion_function} sets this variable to a non-zero +value, Readline will not perform its default filename completion even +if the application's completion function returns no matches. +It should be set only by an application's completion function. +@end deftypevar + +@deftypevar int rl_sort_completion_matches +If an application sets this variable to 0, Readline will not sort the +list of completions (which implies that it cannot remove any duplicate +completions). The default value is 1, which means that Readline will +sort the completions and, depending on the value of +@code{rl_ignore_completion_duplicates}, will attempt to remove duplicate +matches. +@end deftypevar + +@deftypevar int rl_completion_type +Set to a character describing the type of completion Readline is currently +attempting; see the description of @code{rl_complete_internal()} +(@pxref{Completion Functions}) for the list of characters. +This is set to the appropriate value before any application-specific +completion function is called, allowing such functions to present +the same interface as @code{rl_complete()}. +@end deftypevar + +@deftypevar int rl_completion_invoking_key +Set to the final character in the key sequence that invoked one of the +completion functions that call @code{rl_complete_internal()}. This is +set to the appropriate value before any application-specific completion +function is called. +@end deftypevar + +@deftypevar int rl_inhibit_completion +If this variable is non-zero, completion is inhibited. The completion +character will be inserted as any other bound to @code{self-insert}. +@end deftypevar + +@node A Short Completion Example +@subsection A Short Completion Example + +Here is a small application demonstrating the use of the GNU Readline +library. It is called @code{fileman}, and the source code resides in +@file{examples/fileman.c}. This sample application provides +completion of command names, line editing features, and access to the +history list. + +@page +@smallexample +/* fileman.c -- A tiny application which demonstrates how to use the + GNU Readline library. This application interactively allows users + to manipulate files and their modes. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#ifdef HAVE_SYS_FILE_H +# include +#endif +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#include +#include +#include + +#if defined (HAVE_STRING_H) +# include +#else /* !HAVE_STRING_H */ +# include +#endif /* !HAVE_STRING_H */ + +#ifdef HAVE_STDLIB_H +# include +#endif + +#include + +#include +#include + +extern char *xmalloc PARAMS((size_t)); + +/* The names of functions that actually do the manipulation. */ +int com_list PARAMS((char *)); +int com_view PARAMS((char *)); +int com_rename PARAMS((char *)); +int com_stat PARAMS((char *)); +int com_pwd PARAMS((char *)); +int com_delete PARAMS((char *)); +int com_help PARAMS((char *)); +int com_cd PARAMS((char *)); +int com_quit PARAMS((char *)); + +/* A structure which contains information on the commands this program + can understand. */ + +typedef struct @{ + char *name; /* User printable name of the function. */ + rl_icpfunc_t *func; /* Function to call to do the job. */ + char *doc; /* Documentation for this function. */ +@} COMMAND; + +COMMAND commands[] = @{ + @{ "cd", com_cd, "Change to directory DIR" @}, + @{ "delete", com_delete, "Delete FILE" @}, + @{ "help", com_help, "Display this text" @}, + @{ "?", com_help, "Synonym for `help'" @}, + @{ "list", com_list, "List files in DIR" @}, + @{ "ls", com_list, "Synonym for `list'" @}, + @{ "pwd", com_pwd, "Print the current working directory" @}, + @{ "quit", com_quit, "Quit using Fileman" @}, + @{ "rename", com_rename, "Rename FILE to NEWNAME" @}, + @{ "stat", com_stat, "Print out statistics on FILE" @}, + @{ "view", com_view, "View the contents of FILE" @}, + @{ (char *)NULL, (rl_icpfunc_t *)NULL, (char *)NULL @} +@}; + +/* Forward declarations. */ +char *stripwhite (); +COMMAND *find_command (); + +/* The name of this program, as taken from argv[0]. */ +char *progname; + +/* When non-zero, this global means the user is done using this program. */ +int done; + +char * +dupstr (s) + char *s; +@{ + char *r; + + r = xmalloc (strlen (s) + 1); + strcpy (r, s); + return (r); +@} + +main (argc, argv) + int argc; + char **argv; +@{ + char *line, *s; + + progname = argv[0]; + + initialize_readline (); /* Bind our completer. */ + + /* Loop reading and executing lines until the user quits. */ + for ( ; done == 0; ) + @{ + line = readline ("FileMan: "); + + if (!line) + break; + + /* Remove leading and trailing whitespace from the line. + Then, if there is anything left, add it to the history list + and execute it. */ + s = stripwhite (line); + + if (*s) + @{ + add_history (s); + execute_line (s); + @} + + free (line); + @} + exit (0); +@} + +/* Execute a command line. */ +int +execute_line (line) + char *line; +@{ + register int i; + COMMAND *command; + char *word; + + /* Isolate the command word. */ + i = 0; + while (line[i] && whitespace (line[i])) + i++; + word = line + i; + + while (line[i] && !whitespace (line[i])) + i++; + + if (line[i]) + line[i++] = '\0'; + + command = find_command (word); + + if (!command) + @{ + fprintf (stderr, "%s: No such command for FileMan.\n", word); + return (-1); + @} + + /* Get argument to command, if any. */ + while (whitespace (line[i])) + i++; + + word = line + i; + + /* Call the function. */ + return ((*(command->func)) (word)); +@} + +/* Look up NAME as the name of a command, and return a pointer to that + command. Return a NULL pointer if NAME isn't a command name. */ +COMMAND * +find_command (name) + char *name; +@{ + register int i; + + for (i = 0; commands[i].name; i++) + if (strcmp (name, commands[i].name) == 0) + return (&commands[i]); + + return ((COMMAND *)NULL); +@} + +/* Strip whitespace from the start and end of STRING. Return a pointer + into STRING. */ +char * +stripwhite (string) + char *string; +@{ + register char *s, *t; + + for (s = string; whitespace (*s); s++) + ; + + if (*s == 0) + return (s); + + t = s + strlen (s) - 1; + while (t > s && whitespace (*t)) + t--; + *++t = '\0'; + + return s; +@} + +/* **************************************************************** */ +/* */ +/* Interface to Readline Completion */ +/* */ +/* **************************************************************** */ + +char *command_generator PARAMS((const char *, int)); +char **fileman_completion PARAMS((const char *, int, int)); + +/* Tell the GNU Readline library how to complete. We want to try to complete + on command names if this is the first word in the line, or on filenames + if not. */ +initialize_readline () +@{ + /* Allow conditional parsing of the ~/.inputrc file. */ + rl_readline_name = "FileMan"; + + /* Tell the completer that we want a crack first. */ + rl_attempted_completion_function = fileman_completion; +@} + +/* Attempt to complete on the contents of TEXT. START and END bound the + region of rl_line_buffer that contains the word to complete. TEXT is + the word to complete. We can use the entire contents of rl_line_buffer + in case we want to do some simple parsing. Return the array of matches, + or NULL if there aren't any. */ +char ** +fileman_completion (text, start, end) + const char *text; + int start, end; +@{ + char **matches; + + matches = (char **)NULL; + + /* If this word is at the start of the line, then it is a command + to complete. Otherwise it is the name of a file in the current + directory. */ + if (start == 0) + matches = rl_completion_matches (text, command_generator); + + return (matches); +@} + +/* Generator function for command completion. STATE lets us know whether + to start from scratch; without any state (i.e. STATE == 0), then we + start at the top of the list. */ +char * +command_generator (text, state) + const char *text; + int state; +@{ + static int list_index, len; + char *name; + + /* If this is a new word to complete, initialize now. This includes + saving the length of TEXT for efficiency, and initializing the index + variable to 0. */ + if (!state) + @{ + list_index = 0; + len = strlen (text); + @} + + /* Return the next name which partially matches from the command list. */ + while (name = commands[list_index].name) + @{ + list_index++; + + if (strncmp (name, text, len) == 0) + return (dupstr(name)); + @} + + /* If no names matched, then return NULL. */ + return ((char *)NULL); +@} + +/* **************************************************************** */ +/* */ +/* FileMan Commands */ +/* */ +/* **************************************************************** */ + +/* String to pass to system (). This is for the LIST, VIEW and RENAME + commands. */ +static char syscom[1024]; + +/* List the file(s) named in arg. */ +com_list (arg) + char *arg; +@{ + if (!arg) + arg = ""; + + sprintf (syscom, "ls -FClg %s", arg); + return (system (syscom)); +@} + +com_view (arg) + char *arg; +@{ + if (!valid_argument ("view", arg)) + return 1; + +#if defined (__MSDOS__) + /* more.com doesn't grok slashes in pathnames */ + sprintf (syscom, "less %s", arg); +#else + sprintf (syscom, "more %s", arg); +#endif + return (system (syscom)); +@} + +com_rename (arg) + char *arg; +@{ + too_dangerous ("rename"); + return (1); +@} + +com_stat (arg) + char *arg; +@{ + struct stat finfo; + + if (!valid_argument ("stat", arg)) + return (1); + + if (stat (arg, &finfo) == -1) + @{ + perror (arg); + return (1); + @} + + printf ("Statistics for `%s':\n", arg); + + printf ("%s has %d link%s, and is %d byte%s in length.\n", + arg, + finfo.st_nlink, + (finfo.st_nlink == 1) ? "" : "s", + finfo.st_size, + (finfo.st_size == 1) ? "" : "s"); + printf ("Inode Last Change at: %s", ctime (&finfo.st_ctime)); + printf (" Last access at: %s", ctime (&finfo.st_atime)); + printf (" Last modified at: %s", ctime (&finfo.st_mtime)); + return (0); +@} + +com_delete (arg) + char *arg; +@{ + too_dangerous ("delete"); + return (1); +@} + +/* Print out help for ARG, or for all of the commands if ARG is + not present. */ +com_help (arg) + char *arg; +@{ + register int i; + int printed = 0; + + for (i = 0; commands[i].name; i++) + @{ + if (!*arg || (strcmp (arg, commands[i].name) == 0)) + @{ + printf ("%s\t\t%s.\n", commands[i].name, commands[i].doc); + printed++; + @} + @} + + if (!printed) + @{ + printf ("No commands match `%s'. Possibilties are:\n", arg); + + for (i = 0; commands[i].name; i++) + @{ + /* Print in six columns. */ + if (printed == 6) + @{ + printed = 0; + printf ("\n"); + @} + + printf ("%s\t", commands[i].name); + printed++; + @} + + if (printed) + printf ("\n"); + @} + return (0); +@} + +/* Change to the directory ARG. */ +com_cd (arg) + char *arg; +@{ + if (chdir (arg) == -1) + @{ + perror (arg); + return 1; + @} + + com_pwd (""); + return (0); +@} + +/* Print out the current working directory. */ +com_pwd (ignore) + char *ignore; +@{ + char dir[1024], *s; + + s = getcwd (dir, sizeof(dir) - 1); + if (s == 0) + @{ + printf ("Error getting pwd: %s\n", dir); + return 1; + @} + + printf ("Current directory is %s\n", dir); + return 0; +@} + +/* The user wishes to quit using this program. Just set DONE non-zero. */ +com_quit (arg) + char *arg; +@{ + done = 1; + return (0); +@} + +/* Function which tells you that you can't do this. */ +too_dangerous (caller) + char *caller; +@{ + fprintf (stderr, + "%s: Too dangerous for me to distribute. Write it yourself.\n", + caller); +@} + +/* Return non-zero if ARG is a valid argument for CALLER, else print + an error message and return zero. */ +int +valid_argument (caller, arg) + char *caller, *arg; +@{ + if (!arg || !*arg) + @{ + fprintf (stderr, "%s: Argument required.\n", caller); + return (0); + @} + + return (1); +@} +@end smallexample diff --git a/lib/readline/doc/rluser.texi b/lib/readline/doc/rluser.texi new file mode 100644 index 0000000..0af6c02 --- /dev/null +++ b/lib/readline/doc/rluser.texi @@ -0,0 +1,2229 @@ +@comment %**start of header (This is for running Texinfo on a region.) +@setfilename rluser.info +@comment %**end of header (This is for running Texinfo on a region.) + +@ignore +This file documents the end user interface to the GNU command line +editing features. It is to be an appendix to manuals for programs which +use these features. There is a document entitled "readline.texinfo" +which contains both end-user and programmer documentation for the +GNU Readline Library. + +Copyright (C) 1988--2014 Free Software Foundation, Inc. + +Authored by Brian Fox and Chet Ramey. + +Permission is granted to process this file through Tex and print the +results, provided the printed document carries copying permission notice +identical to this one except for the removal of this paragraph (this +paragraph not being relevant to the printed manual). + +Permission is granted to make and distribute verbatim copies of this manual +provided the copyright notice and this permission notice are preserved on +all copies. + +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided also that the +GNU Copyright statement is available to the distributee, and provided that +the entire resulting derived work is distributed under the terms of a +permission notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions. +@end ignore + +@comment If you are including this manual as an appendix, then set the +@comment variable readline-appendix. + +@ifclear BashFeatures +@defcodeindex bt +@end ifclear + +@node Command Line Editing +@chapter Command Line Editing + +This chapter describes the basic features of the @sc{gnu} +command line editing interface. +@ifset BashFeatures +Command line editing is provided by the Readline library, which is +used by several different programs, including Bash. +Command line editing is enabled by default when using an interactive shell, +unless the @option{--noediting} option is supplied at shell invocation. +Line editing is also used when using the @option{-e} option to the +@code{read} builtin command (@pxref{Bash Builtins}). +By default, the line editing commands are similar to those of Emacs. +A vi-style line editing interface is also available. +Line editing can be enabled at any time using the @option{-o emacs} or +@option{-o vi} options to the @code{set} builtin command +(@pxref{The Set Builtin}), or disabled using the @option{+o emacs} or +@option{+o vi} options to @code{set}. +@end ifset + +@menu +* Introduction and Notation:: Notation used in this text. +* Readline Interaction:: The minimum set of commands for editing a line. +* Readline Init File:: Customizing Readline from a user's view. +* Bindable Readline Commands:: A description of most of the Readline commands + available for binding +* Readline vi Mode:: A short description of how to make Readline + behave like the vi editor. +@ifset BashFeatures +* Programmable Completion:: How to specify the possible completions for + a specific command. +* Programmable Completion Builtins:: Builtin commands to specify how to + complete arguments for a particular command. +* A Programmable Completion Example:: An example shell function for + generating possible completions. +@end ifset +@end menu + +@node Introduction and Notation +@section Introduction to Line Editing + +The following paragraphs describe the notation used to represent +keystrokes. + +The text @kbd{C-k} is read as `Control-K' and describes the character +produced when the @key{k} key is pressed while the Control key +is depressed. + +The text @kbd{M-k} is read as `Meta-K' and describes the character +produced when the Meta key (if you have one) is depressed, and the @key{k} +key is pressed. +The Meta key is labeled @key{ALT} on many keyboards. +On keyboards with two keys labeled @key{ALT} (usually to either side of +the space bar), the @key{ALT} on the left side is generally set to +work as a Meta key. +The @key{ALT} key on the right may also be configured to work as a +Meta key or may be configured as some other modifier, such as a +Compose key for typing accented characters. + +If you do not have a Meta or @key{ALT} key, or another key working as +a Meta key, the identical keystroke can be generated by typing @key{ESC} +@emph{first}, and then typing @key{k}. +Either process is known as @dfn{metafying} the @key{k} key. + +The text @kbd{M-C-k} is read as `Meta-Control-k' and describes the +character produced by @dfn{metafying} @kbd{C-k}. + +In addition, several keys have their own names. Specifically, +@key{DEL}, @key{ESC}, @key{LFD}, @key{SPC}, @key{RET}, and @key{TAB} all +stand for themselves when seen in this text, or in an init file +(@pxref{Readline Init File}). +If your keyboard lacks a @key{LFD} key, typing @key{C-j} will +produce the desired character. +The @key{RET} key may be labeled @key{Return} or @key{Enter} on +some keyboards. + +@node Readline Interaction +@section Readline Interaction +@cindex interaction, readline + +Often during an interactive session you type in a long line of text, +only to notice that the first word on the line is misspelled. The +Readline library gives you a set of commands for manipulating the text +as you type it in, allowing you to just fix your typo, and not forcing +you to retype the majority of the line. Using these editing commands, +you move the cursor to the place that needs correction, and delete or +insert the text of the corrections. Then, when you are satisfied with +the line, you simply press @key{RET}. You do not have to be at the +end of the line to press @key{RET}; the entire line is accepted +regardless of the location of the cursor within the line. + +@menu +* Readline Bare Essentials:: The least you need to know about Readline. +* Readline Movement Commands:: Moving about the input line. +* Readline Killing Commands:: How to delete text, and how to get it back! +* Readline Arguments:: Giving numeric arguments to commands. +* Searching:: Searching through previous lines. +@end menu + +@node Readline Bare Essentials +@subsection Readline Bare Essentials +@cindex notation, readline +@cindex command editing +@cindex editing command lines + +In order to enter characters into the line, simply type them. The typed +character appears where the cursor was, and then the cursor moves one +space to the right. If you mistype a character, you can use your +erase character to back up and delete the mistyped character. + +Sometimes you may mistype a character, and +not notice the error until you have typed several other characters. In +that case, you can type @kbd{C-b} to move the cursor to the left, and then +correct your mistake. Afterwards, you can move the cursor to the right +with @kbd{C-f}. + +When you add text in the middle of a line, you will notice that characters +to the right of the cursor are `pushed over' to make room for the text +that you have inserted. Likewise, when you delete text behind the cursor, +characters to the right of the cursor are `pulled back' to fill in the +blank space created by the removal of the text. A list of the bare +essentials for editing the text of an input line follows. + +@table @asis +@item @kbd{C-b} +Move back one character. +@item @kbd{C-f} +Move forward one character. +@item @key{DEL} or @key{Backspace} +Delete the character to the left of the cursor. +@item @kbd{C-d} +Delete the character underneath the cursor. +@item @w{Printing characters} +Insert the character into the line at the cursor. +@item @kbd{C-_} or @kbd{C-x C-u} +Undo the last editing command. You can undo all the way back to an +empty line. +@end table + +@noindent +(Depending on your configuration, the @key{Backspace} key be set to +delete the character to the left of the cursor and the @key{DEL} key set +to delete the character underneath the cursor, like @kbd{C-d}, rather +than the character to the left of the cursor.) + +@node Readline Movement Commands +@subsection Readline Movement Commands + + +The above table describes the most basic keystrokes that you need +in order to do editing of the input line. For your convenience, many +other commands have been added in addition to @kbd{C-b}, @kbd{C-f}, +@kbd{C-d}, and @key{DEL}. Here are some commands for moving more rapidly +about the line. + +@table @kbd +@item C-a +Move to the start of the line. +@item C-e +Move to the end of the line. +@item M-f +Move forward a word, where a word is composed of letters and digits. +@item M-b +Move backward a word. +@item C-l +Clear the screen, reprinting the current line at the top. +@end table + +Notice how @kbd{C-f} moves forward a character, while @kbd{M-f} moves +forward a word. It is a loose convention that control keystrokes +operate on characters while meta keystrokes operate on words. + +@node Readline Killing Commands +@subsection Readline Killing Commands + +@cindex killing text +@cindex yanking text + +@dfn{Killing} text means to delete the text from the line, but to save +it away for later use, usually by @dfn{yanking} (re-inserting) +it back into the line. +(`Cut' and `paste' are more recent jargon for `kill' and `yank'.) + +If the description for a command says that it `kills' text, then you can +be sure that you can get the text back in a different (or the same) +place later. + +When you use a kill command, the text is saved in a @dfn{kill-ring}. +Any number of consecutive kills save all of the killed text together, so +that when you yank it back, you get it all. The kill +ring is not line specific; the text that you killed on a previously +typed line is available to be yanked back later, when you are typing +another line. +@cindex kill ring + +Here is the list of commands for killing text. + +@table @kbd +@item C-k +Kill the text from the current cursor position to the end of the line. + +@item M-d +Kill from the cursor to the end of the current word, or, if between +words, to the end of the next word. +Word boundaries are the same as those used by @kbd{M-f}. + +@item M-@key{DEL} +Kill from the cursor the start of the current word, or, if between +words, to the start of the previous word. +Word boundaries are the same as those used by @kbd{M-b}. + +@item C-w +Kill from the cursor to the previous whitespace. This is different than +@kbd{M-@key{DEL}} because the word boundaries differ. + +@end table + +Here is how to @dfn{yank} the text back into the line. Yanking +means to copy the most-recently-killed text from the kill buffer. + +@table @kbd +@item C-y +Yank the most recently killed text back into the buffer at the cursor. + +@item M-y +Rotate the kill-ring, and yank the new top. You can only do this if +the prior command is @kbd{C-y} or @kbd{M-y}. +@end table + +@node Readline Arguments +@subsection Readline Arguments + +You can pass numeric arguments to Readline commands. Sometimes the +argument acts as a repeat count, other times it is the @i{sign} of the +argument that is significant. If you pass a negative argument to a +command which normally acts in a forward direction, that command will +act in a backward direction. For example, to kill text back to the +start of the line, you might type @samp{M-- C-k}. + +The general way to pass numeric arguments to a command is to type meta +digits before the command. If the first `digit' typed is a minus +sign (@samp{-}), then the sign of the argument will be negative. Once +you have typed one meta digit to get the argument started, you can type +the remainder of the digits, and then the command. For example, to give +the @kbd{C-d} command an argument of 10, you could type @samp{M-1 0 C-d}, +which will delete the next ten characters on the input line. + +@node Searching +@subsection Searching for Commands in the History + +Readline provides commands for searching through the command history +@ifset BashFeatures +(@pxref{Bash History Facilities}) +@end ifset +for lines containing a specified string. +There are two search modes: @dfn{incremental} and @dfn{non-incremental}. + +Incremental searches begin before the user has finished typing the +search string. +As each character of the search string is typed, Readline displays +the next entry from the history matching the string typed so far. +An incremental search requires only as many characters as needed to +find the desired history entry. +To search backward in the history for a particular string, type +@kbd{C-r}. Typing @kbd{C-s} searches forward through the history. +The characters present in the value of the @code{isearch-terminators} variable +are used to terminate an incremental search. +If that variable has not been assigned a value, the @key{ESC} and +@kbd{C-J} characters will terminate an incremental search. +@kbd{C-g} will abort an incremental search and restore the original line. +When the search is terminated, the history entry containing the +search string becomes the current line. + +To find other matching entries in the history list, type @kbd{C-r} or +@kbd{C-s} as appropriate. +This will search backward or forward in the history for the next +entry matching the search string typed so far. +Any other key sequence bound to a Readline command will terminate +the search and execute that command. +For instance, a @key{RET} will terminate the search and accept +the line, thereby executing the command from the history list. +A movement command will terminate the search, make the last line found +the current line, and begin editing. + +Readline remembers the last incremental search string. If two +@kbd{C-r}s are typed without any intervening characters defining a new +search string, any remembered search string is used. + +Non-incremental searches read the entire search string before starting +to search for matching history lines. The search string may be +typed by the user or be part of the contents of the current line. + +@node Readline Init File +@section Readline Init File +@cindex initialization file, readline + +Although the Readline library comes with a set of Emacs-like +keybindings installed by default, it is possible to use a different set +of keybindings. +Any user can customize programs that use Readline by putting +commands in an @dfn{inputrc} file, conventionally in his home directory. +The name of this +@ifset BashFeatures +file is taken from the value of the shell variable @env{INPUTRC}. If +@end ifset +@ifclear BashFeatures +file is taken from the value of the environment variable @env{INPUTRC}. If +@end ifclear +that variable is unset, the default is @file{~/.inputrc}. If that +file does not exist or cannot be read, the ultimate default is +@file{/etc/inputrc}. + +When a program which uses the Readline library starts up, the +init file is read, and the key bindings are set. + +In addition, the @code{C-x C-r} command re-reads this init file, thus +incorporating any changes that you might have made to it. + +@menu +* Readline Init File Syntax:: Syntax for the commands in the inputrc file. + +* Conditional Init Constructs:: Conditional key bindings in the inputrc file. + +* Sample Init File:: An example inputrc file. +@end menu + +@node Readline Init File Syntax +@subsection Readline Init File Syntax + +There are only a few basic constructs allowed in the +Readline init file. Blank lines are ignored. +Lines beginning with a @samp{#} are comments. +Lines beginning with a @samp{$} indicate conditional +constructs (@pxref{Conditional Init Constructs}). Other lines +denote variable settings and key bindings. + +@table @asis +@item Variable Settings +You can modify the run-time behavior of Readline by +altering the values of variables in Readline +using the @code{set} command within the init file. +The syntax is simple: + +@example +set @var{variable} @var{value} +@end example + +@noindent +Here, for example, is how to +change from the default Emacs-like key binding to use +@code{vi} line editing commands: + +@example +set editing-mode vi +@end example + +Variable names and values, where appropriate, are recognized without regard +to case. Unrecognized variable names are ignored. + +Boolean variables (those that can be set to on or off) are set to on if +the value is null or empty, @var{on} (case-insensitive), or 1. Any other +value results in the variable being set to off. + +@ifset BashFeatures +The @w{@code{bind -V}} command lists the current Readline variable names +and values. @xref{Bash Builtins}. +@end ifset + +A great deal of run-time behavior is changeable with the following +variables. + +@cindex variables, readline +@table @code + +@item bell-style +@vindex bell-style +Controls what happens when Readline wants to ring the terminal bell. +If set to @samp{none}, Readline never rings the bell. If set to +@samp{visible}, Readline uses a visible bell if one is available. +If set to @samp{audible} (the default), Readline attempts to ring +the terminal's bell. + +@item bind-tty-special-chars +@vindex bind-tty-special-chars +If set to @samp{on}, Readline attempts to bind the control characters +treated specially by the kernel's terminal driver to their Readline +equivalents. + +@item colored-stats +@vindex colored-stats +If set to @samp{on}, Readline displays possible completions using different +colors to indicate their file type. +The color definitions are taken from the value of the @env{LS_COLORS} +environment variable. +The default is @samp{off}. + +@item comment-begin +@vindex comment-begin +The string to insert at the beginning of the line when the +@code{insert-comment} command is executed. The default value +is @code{"#"}. + +@item completion-display-width +@vindex completion-display-width +The number of screen columns used to display possible matches +when performing completion. +The value is ignored if it is less than 0 or greater than the terminal +screen width. +A value of 0 will cause matches to be displayed one per line. +The default value is -1. + +@item completion-ignore-case +@vindex completion-ignore-case +If set to @samp{on}, Readline performs filename matching and completion +in a case-insensitive fashion. +The default value is @samp{off}. + +@item completion-map-case +@vindex completion-map-case +If set to @samp{on}, and @var{completion-ignore-case} is enabled, Readline +treats hyphens (@samp{-}) and underscores (@samp{_}) as equivalent when +performing case-insensitive filename matching and completion. + +@item completion-prefix-display-length +@vindex completion-prefix-display-length +The length in characters of the common prefix of a list of possible +completions that is displayed without modification. When set to a +value greater than zero, common prefixes longer than this value are +replaced with an ellipsis when displaying possible completions. + +@item completion-query-items +@vindex completion-query-items +The number of possible completions that determines when the user is +asked whether the list of possibilities should be displayed. +If the number of possible completions is greater than this value, +Readline will ask the user whether or not he wishes to view +them; otherwise, they are simply listed. +This variable must be set to an integer value greater than or equal to 0. +A negative value means Readline should never ask. +The default limit is @code{100}. + +@item convert-meta +@vindex convert-meta +If set to @samp{on}, Readline will convert characters with the +eighth bit set to an @sc{ascii} key sequence by stripping the eighth +bit and prefixing an @key{ESC} character, converting them to a +meta-prefixed key sequence. The default value is @samp{on}. + +@item disable-completion +@vindex disable-completion +If set to @samp{On}, Readline will inhibit word completion. +Completion characters will be inserted into the line as if they had +been mapped to @code{self-insert}. The default is @samp{off}. + +@item editing-mode +@vindex editing-mode +The @code{editing-mode} variable controls which default set of +key bindings is used. By default, Readline starts up in Emacs editing +mode, where the keystrokes are most similar to Emacs. This variable can be +set to either @samp{emacs} or @samp{vi}. + +@item echo-control-characters +When set to @samp{on}, on operating systems that indicate they support it, +readline echoes a character corresponding to a signal generated from the +keyboard. The default is @samp{on}. + +@item enable-keypad +@vindex enable-keypad +When set to @samp{on}, Readline will try to enable the application +keypad when it is called. Some systems need this to enable the +arrow keys. The default is @samp{off}. + +@item enable-meta-key +When set to @samp{on}, Readline will try to enable any meta modifier +key the terminal claims to support when it is called. On many terminals, +the meta key is used to send eight-bit characters. +The default is @samp{on}. + +@item expand-tilde +@vindex expand-tilde +If set to @samp{on}, tilde expansion is performed when Readline +attempts word completion. The default is @samp{off}. + +@item history-preserve-point +@vindex history-preserve-point +If set to @samp{on}, the history code attempts to place the point (the +current cursor position) at the +same location on each history line retrieved with @code{previous-history} +or @code{next-history}. The default is @samp{off}. + +@item history-size +@vindex history-size +Set the maximum number of history entries saved in the history list. +If set to zero, any existing history entries are deleted and no new entries +are saved. +If set to a value less than zero, the number of history entries is not +limited. +By default, the number of history entries is not limited. + +@item horizontal-scroll-mode +@vindex horizontal-scroll-mode +This variable can be set to either @samp{on} or @samp{off}. Setting it +to @samp{on} means that the text of the lines being edited will scroll +horizontally on a single screen line when they are longer than the width +of the screen, instead of wrapping onto a new screen line. By default, +this variable is set to @samp{off}. + +@item input-meta +@vindex input-meta +@vindex meta-flag +If set to @samp{on}, Readline will enable eight-bit input (it +will not clear the eighth bit in the characters it reads), +regardless of what the terminal claims it can support. The +default value is @samp{off}. The name @code{meta-flag} is a +synonym for this variable. + +@item isearch-terminators +@vindex isearch-terminators +The string of characters that should terminate an incremental search without +subsequently executing the character as a command (@pxref{Searching}). +If this variable has not been given a value, the characters @key{ESC} and +@kbd{C-J} will terminate an incremental search. + +@item keymap +@vindex keymap +Sets Readline's idea of the current keymap for key binding commands. +Acceptable @code{keymap} names are +@code{emacs}, +@code{emacs-standard}, +@code{emacs-meta}, +@code{emacs-ctlx}, +@code{vi}, +@code{vi-move}, +@code{vi-command}, and +@code{vi-insert}. +@code{vi} is equivalent to @code{vi-command}; @code{emacs} is +equivalent to @code{emacs-standard}. The default value is @code{emacs}. +The value of the @code{editing-mode} variable also affects the +default keymap. + +@item keyseq-timeout +Specifies the duration Readline will wait for a character when reading an +ambiguous key sequence (one that can form a complete key sequence using +the input read so far, or can take additional input to complete a longer +key sequence). +If no input is received within the timeout, Readline will use the shorter +but complete key sequence. +Readline uses this value to determine whether or not input is +available on the current input source (@code{rl_instream} by default). +The value is specified in milliseconds, so a value of 1000 means that +Readline will wait one second for additional input. +If this variable is set to a value less than or equal to zero, or to a +non-numeric value, Readline will wait until another key is pressed to +decide which key sequence to complete. +The default value is @code{500}. + +@item mark-directories +If set to @samp{on}, completed directory names have a slash +appended. The default is @samp{on}. + +@item mark-modified-lines +@vindex mark-modified-lines +This variable, when set to @samp{on}, causes Readline to display an +asterisk (@samp{*}) at the start of history lines which have been modified. +This variable is @samp{off} by default. + +@item mark-symlinked-directories +@vindex mark-symlinked-directories +If set to @samp{on}, completed names which are symbolic links +to directories have a slash appended (subject to the value of +@code{mark-directories}). +The default is @samp{off}. + +@item match-hidden-files +@vindex match-hidden-files +This variable, when set to @samp{on}, causes Readline to match files whose +names begin with a @samp{.} (hidden files) when performing filename +completion. +If set to @samp{off}, the leading @samp{.} must be +supplied by the user in the filename to be completed. +This variable is @samp{on} by default. + +@item menu-complete-display-prefix +@vindex menu-complete-display-prefix +If set to @samp{on}, menu completion displays the common prefix of the +list of possible completions (which may be empty) before cycling through +the list. The default is @samp{off}. + +@item output-meta +@vindex output-meta +If set to @samp{on}, Readline will display characters with the +eighth bit set directly rather than as a meta-prefixed escape +sequence. The default is @samp{off}. + +@item page-completions +@vindex page-completions +If set to @samp{on}, Readline uses an internal @code{more}-like pager +to display a screenful of possible completions at a time. +This variable is @samp{on} by default. + +@item print-completions-horizontally +If set to @samp{on}, Readline will display completions with matches +sorted horizontally in alphabetical order, rather than down the screen. +The default is @samp{off}. + +@item revert-all-at-newline +@vindex revert-all-at-newline +If set to @samp{on}, Readline will undo all changes to history lines +before returning when @code{accept-line} is executed. By default, +history lines may be modified and retain individual undo lists across +calls to @code{readline}. The default is @samp{off}. + +@item show-all-if-ambiguous +@vindex show-all-if-ambiguous +This alters the default behavior of the completion functions. If +set to @samp{on}, +words which have more than one possible completion cause the +matches to be listed immediately instead of ringing the bell. +The default value is @samp{off}. + +@item show-all-if-unmodified +@vindex show-all-if-unmodified +This alters the default behavior of the completion functions in +a fashion similar to @var{show-all-if-ambiguous}. +If set to @samp{on}, +words which have more than one possible completion without any +possible partial completion (the possible completions don't share +a common prefix) cause the matches to be listed immediately instead +of ringing the bell. +The default value is @samp{off}. + +@item show-mode-in-prompt +@vindex show-mode-in-prompt +If set to @samp{on}, add a character to the beginning of the prompt +indicating the editing mode: emacs (@samp{@@}), vi command (@samp{:}), +or vi insertion (@samp{+}). +The default value is @samp{off}. + +@item skip-completed-text +@vindex skip-completed-text +If set to @samp{on}, this alters the default completion behavior when +inserting a single match into the line. It's only active when +performing completion in the middle of a word. If enabled, readline +does not insert characters from the completion that match characters +after point in the word being completed, so portions of the word +following the cursor are not duplicated. +For instance, if this is enabled, attempting completion when the cursor +is after the @samp{e} in @samp{Makefile} will result in @samp{Makefile} +rather than @samp{Makefilefile}, assuming there is a single possible +completion. +The default value is @samp{off}. + +@item visible-stats +@vindex visible-stats +If set to @samp{on}, a character denoting a file's type +is appended to the filename when listing possible +completions. The default is @samp{off}. + +@end table + +@item Key Bindings +The syntax for controlling key bindings in the init file is +simple. First you need to find the name of the command that you +want to change. The following sections contain tables of the command +name, the default keybinding, if any, and a short description of what +the command does. + +Once you know the name of the command, simply place on a line +in the init file the name of the key +you wish to bind the command to, a colon, and then the name of the +command. +There can be no space between the key name and the colon -- that will be +interpreted as part of the key name. +The name of the key can be expressed in different ways, depending on +what you find most comfortable. + +In addition to command names, readline allows keys to be bound +to a string that is inserted when the key is pressed (a @var{macro}). + +@ifset BashFeatures +The @w{@code{bind -p}} command displays Readline function names and +bindings in a format that can put directly into an initialization file. +@xref{Bash Builtins}. +@end ifset + +@table @asis +@item @w{@var{keyname}: @var{function-name} or @var{macro}} +@var{keyname} is the name of a key spelled out in English. For example: +@example +Control-u: universal-argument +Meta-Rubout: backward-kill-word +Control-o: "> output" +@end example + +In the above example, @kbd{C-u} is bound to the function +@code{universal-argument}, +@kbd{M-DEL} is bound to the function @code{backward-kill-word}, and +@kbd{C-o} is bound to run the macro +expressed on the right hand side (that is, to insert the text +@samp{> output} into the line). + +A number of symbolic character names are recognized while +processing this key binding syntax: +@var{DEL}, +@var{ESC}, +@var{ESCAPE}, +@var{LFD}, +@var{NEWLINE}, +@var{RET}, +@var{RETURN}, +@var{RUBOUT}, +@var{SPACE}, +@var{SPC}, +and +@var{TAB}. + +@item @w{"@var{keyseq}": @var{function-name} or @var{macro}} +@var{keyseq} differs from @var{keyname} above in that strings +denoting an entire key sequence can be specified, by placing +the key sequence in double quotes. Some @sc{gnu} Emacs style key +escapes can be used, as in the following example, but the +special character names are not recognized. + +@example +"\C-u": universal-argument +"\C-x\C-r": re-read-init-file +"\e[11~": "Function Key 1" +@end example + +In the above example, @kbd{C-u} is again bound to the function +@code{universal-argument} (just as it was in the first example), +@samp{@kbd{C-x} @kbd{C-r}} is bound to the function @code{re-read-init-file}, +and @samp{@key{ESC} @key{[} @key{1} @key{1} @key{~}} is bound to insert +the text @samp{Function Key 1}. + +@end table + +The following @sc{gnu} Emacs style escape sequences are available when +specifying key sequences: + +@table @code +@item @kbd{\C-} +control prefix +@item @kbd{\M-} +meta prefix +@item @kbd{\e} +an escape character +@item @kbd{\\} +backslash +@item @kbd{\"} +@key{"}, a double quotation mark +@item @kbd{\'} +@key{'}, a single quote or apostrophe +@end table + +In addition to the @sc{gnu} Emacs style escape sequences, a second +set of backslash escapes is available: + +@table @code +@item \a +alert (bell) +@item \b +backspace +@item \d +delete +@item \f +form feed +@item \n +newline +@item \r +carriage return +@item \t +horizontal tab +@item \v +vertical tab +@item \@var{nnn} +the eight-bit character whose value is the octal value @var{nnn} +(one to three digits) +@item \x@var{HH} +the eight-bit character whose value is the hexadecimal value @var{HH} +(one or two hex digits) +@end table + +When entering the text of a macro, single or double quotes must +be used to indicate a macro definition. +Unquoted text is assumed to be a function name. +In the macro body, the backslash escapes described above are expanded. +Backslash will quote any other character in the macro text, +including @samp{"} and @samp{'}. +For example, the following binding will make @samp{@kbd{C-x} \} +insert a single @samp{\} into the line: +@example +"\C-x\\": "\\" +@end example + +@end table + +@node Conditional Init Constructs +@subsection Conditional Init Constructs + +Readline implements a facility similar in spirit to the conditional +compilation features of the C preprocessor which allows key +bindings and variable settings to be performed as the result +of tests. There are four parser directives used. + +@table @code +@item $if +The @code{$if} construct allows bindings to be made based on the +editing mode, the terminal being used, or the application using +Readline. The text of the test extends to the end of the line; +no characters are required to isolate it. + +@table @code +@item mode +The @code{mode=} form of the @code{$if} directive is used to test +whether Readline is in @code{emacs} or @code{vi} mode. +This may be used in conjunction +with the @samp{set keymap} command, for instance, to set bindings in +the @code{emacs-standard} and @code{emacs-ctlx} keymaps only if +Readline is starting out in @code{emacs} mode. + +@item term +The @code{term=} form may be used to include terminal-specific +key bindings, perhaps to bind the key sequences output by the +terminal's function keys. The word on the right side of the +@samp{=} is tested against both the full name of the terminal and +the portion of the terminal name before the first @samp{-}. This +allows @code{sun} to match both @code{sun} and @code{sun-cmd}, +for instance. + +@item application +The @var{application} construct is used to include +application-specific settings. Each program using the Readline +library sets the @var{application name}, and you can test for +a particular value. +This could be used to bind key sequences to functions useful for +a specific program. For instance, the following command adds a +key sequence that quotes the current or previous word in Bash: +@example +$if Bash +# Quote the current or previous word +"\C-xq": "\eb\"\ef\"" +$endif +@end example +@end table + +@item $endif +This command, as seen in the previous example, terminates an +@code{$if} command. + +@item $else +Commands in this branch of the @code{$if} directive are executed if +the test fails. + +@item $include +This directive takes a single filename as an argument and reads commands +and bindings from that file. +For example, the following directive reads from @file{/etc/inputrc}: +@example +$include /etc/inputrc +@end example +@end table + +@node Sample Init File +@subsection Sample Init File + +Here is an example of an @var{inputrc} file. This illustrates key +binding, variable assignment, and conditional syntax. + +@example +@page +# This file controls the behaviour of line input editing for +# programs that use the GNU Readline library. Existing +# programs include FTP, Bash, and GDB. +# +# You can re-read the inputrc file with C-x C-r. +# Lines beginning with '#' are comments. +# +# First, include any system-wide bindings and variable +# assignments from /etc/Inputrc +$include /etc/Inputrc + +# +# Set various bindings for emacs mode. + +set editing-mode emacs + +$if mode=emacs + +Meta-Control-h: backward-kill-word Text after the function name is ignored + +# +# Arrow keys in keypad mode +# +#"\M-OD": backward-char +#"\M-OC": forward-char +#"\M-OA": previous-history +#"\M-OB": next-history +# +# Arrow keys in ANSI mode +# +"\M-[D": backward-char +"\M-[C": forward-char +"\M-[A": previous-history +"\M-[B": next-history +# +# Arrow keys in 8 bit keypad mode +# +#"\M-\C-OD": backward-char +#"\M-\C-OC": forward-char +#"\M-\C-OA": previous-history +#"\M-\C-OB": next-history +# +# Arrow keys in 8 bit ANSI mode +# +#"\M-\C-[D": backward-char +#"\M-\C-[C": forward-char +#"\M-\C-[A": previous-history +#"\M-\C-[B": next-history + +C-q: quoted-insert + +$endif + +# An old-style binding. This happens to be the default. +TAB: complete + +# Macros that are convenient for shell interaction +$if Bash +# edit the path +"\C-xp": "PATH=$@{PATH@}\e\C-e\C-a\ef\C-f" +# prepare to type a quoted word -- +# insert open and close double quotes +# and move to just after the open quote +"\C-x\"": "\"\"\C-b" +# insert a backslash (testing backslash escapes +# in sequences and macros) +"\C-x\\": "\\" +# Quote the current or previous word +"\C-xq": "\eb\"\ef\"" +# Add a binding to refresh the line, which is unbound +"\C-xr": redraw-current-line +# Edit variable on current line. +"\M-\C-v": "\C-a\C-k$\C-y\M-\C-e\C-a\C-y=" +$endif + +# use a visible bell if one is available +set bell-style visible + +# don't strip characters to 7 bits when reading +set input-meta on + +# allow iso-latin1 characters to be inserted rather +# than converted to prefix-meta sequences +set convert-meta off + +# display characters with the eighth bit set directly +# rather than as meta-prefixed characters +set output-meta on + +# if there are more than 150 possible completions for +# a word, ask the user if he wants to see all of them +set completion-query-items 150 + +# For FTP +$if Ftp +"\C-xg": "get \M-?" +"\C-xt": "put \M-?" +"\M-.": yank-last-arg +$endif +@end example + +@node Bindable Readline Commands +@section Bindable Readline Commands + +@menu +* Commands For Moving:: Moving about the line. +* Commands For History:: Getting at previous lines. +* Commands For Text:: Commands for changing text. +* Commands For Killing:: Commands for killing and yanking. +* Numeric Arguments:: Specifying numeric arguments, repeat counts. +* Commands For Completion:: Getting Readline to do the typing for you. +* Keyboard Macros:: Saving and re-executing typed characters +* Miscellaneous Commands:: Other miscellaneous commands. +@end menu + +This section describes Readline commands that may be bound to key +sequences. +@ifset BashFeatures +You can list your key bindings by executing +@w{@code{bind -P}} or, for a more terse format, suitable for an +@var{inputrc} file, @w{@code{bind -p}}. (@xref{Bash Builtins}.) +@end ifset +Command names without an accompanying key sequence are unbound by default. + +In the following descriptions, @dfn{point} refers to the current cursor +position, and @dfn{mark} refers to a cursor position saved by the +@code{set-mark} command. +The text between the point and mark is referred to as the @dfn{region}. + +@node Commands For Moving +@subsection Commands For Moving +@ftable @code +@item beginning-of-line (C-a) +Move to the start of the current line. + +@item end-of-line (C-e) +Move to the end of the line. + +@item forward-char (C-f) +Move forward a character. + +@item backward-char (C-b) +Move back a character. + +@item forward-word (M-f) +Move forward to the end of the next word. +Words are composed of letters and digits. + +@item backward-word (M-b) +Move back to the start of the current or previous word. +Words are composed of letters and digits. + +@ifset BashFeatures +@item shell-forward-word () +Move forward to the end of the next word. +Words are delimited by non-quoted shell metacharacters. + +@item shell-backward-word () +Move back to the start of the current or previous word. +Words are delimited by non-quoted shell metacharacters. +@end ifset + +@item clear-screen (C-l) +Clear the screen and redraw the current line, +leaving the current line at the top of the screen. + +@item redraw-current-line () +Refresh the current line. By default, this is unbound. + +@end ftable + +@node Commands For History +@subsection Commands For Manipulating The History + +@ftable @code +@item accept-line (Newline or Return) +@ifset BashFeatures +Accept the line regardless of where the cursor is. +If this line is +non-empty, add it to the history list according to the setting of +the @env{HISTCONTROL} and @env{HISTIGNORE} variables. +If this line is a modified history line, then restore the history line +to its original state. +@end ifset +@ifclear BashFeatures +Accept the line regardless of where the cursor is. +If this line is +non-empty, it may be added to the history list for future recall with +@code{add_history()}. +If this line is a modified history line, the history line is restored +to its original state. +@end ifclear + +@item previous-history (C-p) +Move `back' through the history list, fetching the previous command. + +@item next-history (C-n) +Move `forward' through the history list, fetching the next command. + +@item beginning-of-history (M-<) +Move to the first line in the history. + +@item end-of-history (M->) +Move to the end of the input history, i.e., the line currently +being entered. + +@item reverse-search-history (C-r) +Search backward starting at the current line and moving `up' through +the history as necessary. This is an incremental search. + +@item forward-search-history (C-s) +Search forward starting at the current line and moving `down' through +the the history as necessary. This is an incremental search. + +@item non-incremental-reverse-search-history (M-p) +Search backward starting at the current line and moving `up' +through the history as necessary using a non-incremental search +for a string supplied by the user. + +@item non-incremental-forward-search-history (M-n) +Search forward starting at the current line and moving `down' +through the the history as necessary using a non-incremental search +for a string supplied by the user. + +@item history-search-forward () +Search forward through the history for the string of characters +between the start of the current line and the point. +The search string must match at the beginning of a history line. +This is a non-incremental search. +By default, this command is unbound. + +@item history-search-backward () +Search backward through the history for the string of characters +between the start of the current line and the point. +The search string must match at the beginning of a history line. +This is a non-incremental search. +By default, this command is unbound. + +@item history-substr-search-forward () +Search forward through the history for the string of characters +between the start of the current line and the point. +The search string may match anywhere in a history line. +This is a non-incremental search. +By default, this command is unbound. + +@item history-substr-search-backward () +Search backward through the history for the string of characters +between the start of the current line and the point. +The search string may match anywhere in a history line. +This is a non-incremental search. +By default, this command is unbound. + +@item yank-nth-arg (M-C-y) +Insert the first argument to the previous command (usually +the second word on the previous line) at point. +With an argument @var{n}, +insert the @var{n}th word from the previous command (the words +in the previous command begin with word 0). A negative argument +inserts the @var{n}th word from the end of the previous command. +Once the argument @var{n} is computed, the argument is extracted +as if the @samp{!@var{n}} history expansion had been specified. + +@item yank-last-arg (M-. or M-_) +Insert last argument to the previous command (the last word of the +previous history entry). +With a numeric argument, behave exactly like @code{yank-nth-arg}. +Successive calls to @code{yank-last-arg} move back through the history +list, inserting the last word (or the word specified by the argument to +the first call) of each line in turn. +Any numeric argument supplied to these successive calls determines +the direction to move through the history. A negative argument switches +the direction through the history (back or forward). +The history expansion facilities are used to extract the last argument, +as if the @samp{!$} history expansion had been specified. + +@end ftable + +@node Commands For Text +@subsection Commands For Changing Text + +@ftable @code + +@item @i{end-of-file} (usually C-d) +The character indicating end-of-file as set, for example, by +@code{stty}. If this character is read when there are no characters +on the line, and point is at the beginning of the line, Readline +interprets it as the end of input and returns @sc{eof}. + +@item delete-char (C-d) +Delete the character at point. If this function is bound to the +same character as the tty @sc{eof} character, as @kbd{C-d} +commonly is, see above for the effects. + +@item backward-delete-char (Rubout) +Delete the character behind the cursor. A numeric argument means +to kill the characters instead of deleting them. + +@item forward-backward-delete-char () +Delete the character under the cursor, unless the cursor is at the +end of the line, in which case the character behind the cursor is +deleted. By default, this is not bound to a key. + +@item quoted-insert (C-q or C-v) +Add the next character typed to the line verbatim. This is +how to insert key sequences like @kbd{C-q}, for example. + +@ifclear BashFeatures +@item tab-insert (M-@key{TAB}) +Insert a tab character. +@end ifclear + +@item self-insert (a, b, A, 1, !, @dots{}) +Insert yourself. + +@item transpose-chars (C-t) +Drag the character before the cursor forward over +the character at the cursor, moving the +cursor forward as well. If the insertion point +is at the end of the line, then this +transposes the last two characters of the line. +Negative arguments have no effect. + +@item transpose-words (M-t) +Drag the word before point past the word after point, +moving point past that word as well. +If the insertion point is at the end of the line, this transposes +the last two words on the line. + +@item upcase-word (M-u) +Uppercase the current (or following) word. With a negative argument, +uppercase the previous word, but do not move the cursor. + +@item downcase-word (M-l) +Lowercase the current (or following) word. With a negative argument, +lowercase the previous word, but do not move the cursor. + +@item capitalize-word (M-c) +Capitalize the current (or following) word. With a negative argument, +capitalize the previous word, but do not move the cursor. + +@item overwrite-mode () +Toggle overwrite mode. With an explicit positive numeric argument, +switches to overwrite mode. With an explicit non-positive numeric +argument, switches to insert mode. This command affects only +@code{emacs} mode; @code{vi} mode does overwrite differently. +Each call to @code{readline()} starts in insert mode. + +In overwrite mode, characters bound to @code{self-insert} replace +the text at point rather than pushing the text to the right. +Characters bound to @code{backward-delete-char} replace the character +before point with a space. + +By default, this command is unbound. + +@end ftable + +@node Commands For Killing +@subsection Killing And Yanking + +@ftable @code + +@item kill-line (C-k) +Kill the text from point to the end of the line. + +@item backward-kill-line (C-x Rubout) +Kill backward to the beginning of the line. + +@item unix-line-discard (C-u) +Kill backward from the cursor to the beginning of the current line. + +@item kill-whole-line () +Kill all characters on the current line, no matter where point is. +By default, this is unbound. + +@item kill-word (M-d) +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as @code{forward-word}. + +@item backward-kill-word (M-@key{DEL}) +Kill the word behind point. +Word boundaries are the same as @code{backward-word}. + +@ifset BashFeatures +@item shell-kill-word () +Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as @code{shell-forward-word}. + +@item shell-backward-kill-word () +Kill the word behind point. +Word boundaries are the same as @code{shell-backward-word}. +@end ifset + +@item unix-word-rubout (C-w) +Kill the word behind point, using white space as a word boundary. +The killed text is saved on the kill-ring. + +@item unix-filename-rubout () +Kill the word behind point, using white space and the slash character +as the word boundaries. +The killed text is saved on the kill-ring. + +@item delete-horizontal-space () +Delete all spaces and tabs around point. By default, this is unbound. + +@item kill-region () +Kill the text in the current region. +By default, this command is unbound. + +@item copy-region-as-kill () +Copy the text in the region to the kill buffer, so it can be yanked +right away. By default, this command is unbound. + +@item copy-backward-word () +Copy the word before point to the kill buffer. +The word boundaries are the same as @code{backward-word}. +By default, this command is unbound. + +@item copy-forward-word () +Copy the word following point to the kill buffer. +The word boundaries are the same as @code{forward-word}. +By default, this command is unbound. + +@item yank (C-y) +Yank the top of the kill ring into the buffer at point. + +@item yank-pop (M-y) +Rotate the kill-ring, and yank the new top. You can only do this if +the prior command is @code{yank} or @code{yank-pop}. +@end ftable + +@node Numeric Arguments +@subsection Specifying Numeric Arguments +@ftable @code + +@item digit-argument (@kbd{M-0}, @kbd{M-1}, @dots{} @kbd{M--}) +Add this digit to the argument already accumulating, or start a new +argument. @kbd{M--} starts a negative argument. + +@item universal-argument () +This is another way to specify an argument. +If this command is followed by one or more digits, optionally with a +leading minus sign, those digits define the argument. +If the command is followed by digits, executing @code{universal-argument} +again ends the numeric argument, but is otherwise ignored. +As a special case, if this command is immediately followed by a +character that is neither a digit or minus sign, the argument count +for the next command is multiplied by four. +The argument count is initially one, so executing this function the +first time makes the argument count four, a second time makes the +argument count sixteen, and so on. +By default, this is not bound to a key. +@end ftable + +@node Commands For Completion +@subsection Letting Readline Type For You + +@ftable @code +@item complete (@key{TAB}) +Attempt to perform completion on the text before point. +The actual completion performed is application-specific. +@ifset BashFeatures +Bash attempts completion treating the text as a variable (if the +text begins with @samp{$}), username (if the text begins with +@samp{~}), hostname (if the text begins with @samp{@@}), or +command (including aliases and functions) in turn. If none +of these produces a match, filename completion is attempted. +@end ifset +@ifclear BashFeatures +The default is filename completion. +@end ifclear + +@item possible-completions (M-?) +List the possible completions of the text before point. +When displaying completions, Readline sets the number of columns used +for display to the value of @code{completion-display-width}, the value of +the environment variable @env{COLUMNS}, or the screen width, in that order. + +@item insert-completions (M-*) +Insert all completions of the text before point that would have +been generated by @code{possible-completions}. + +@item menu-complete () +Similar to @code{complete}, but replaces the word to be completed +with a single match from the list of possible completions. +Repeated execution of @code{menu-complete} steps through the list +of possible completions, inserting each match in turn. +At the end of the list of completions, the bell is rung +(subject to the setting of @code{bell-style}) +and the original text is restored. +An argument of @var{n} moves @var{n} positions forward in the list +of matches; a negative argument may be used to move backward +through the list. +This command is intended to be bound to @key{TAB}, but is unbound +by default. + +@item menu-complete-backward () +Identical to @code{menu-complete}, but moves backward through the list +of possible completions, as if @code{menu-complete} had been given a +negative argument. + +@item delete-char-or-list () +Deletes the character under the cursor if not at the beginning or +end of the line (like @code{delete-char}). +If at the end of the line, behaves identically to +@code{possible-completions}. +This command is unbound by default. + +@ifset BashFeatures +@item complete-filename (M-/) +Attempt filename completion on the text before point. + +@item possible-filename-completions (C-x /) +List the possible completions of the text before point, +treating it as a filename. + +@item complete-username (M-~) +Attempt completion on the text before point, treating +it as a username. + +@item possible-username-completions (C-x ~) +List the possible completions of the text before point, +treating it as a username. + +@item complete-variable (M-$) +Attempt completion on the text before point, treating +it as a shell variable. + +@item possible-variable-completions (C-x $) +List the possible completions of the text before point, +treating it as a shell variable. + +@item complete-hostname (M-@@) +Attempt completion on the text before point, treating +it as a hostname. + +@item possible-hostname-completions (C-x @@) +List the possible completions of the text before point, +treating it as a hostname. + +@item complete-command (M-!) +Attempt completion on the text before point, treating +it as a command name. Command completion attempts to +match the text against aliases, reserved words, shell +functions, shell builtins, and finally executable filenames, +in that order. + +@item possible-command-completions (C-x !) +List the possible completions of the text before point, +treating it as a command name. + +@item dynamic-complete-history (M-@key{TAB}) +Attempt completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. + +@item dabbrev-expand () +Attempt menu completion on the text before point, comparing +the text against lines from the history list for possible +completion matches. + +@item complete-into-braces (M-@{) +Perform filename completion and insert the list of possible completions +enclosed within braces so the list is available to the shell +(@pxref{Brace Expansion}). + +@end ifset +@end ftable + +@node Keyboard Macros +@subsection Keyboard Macros +@ftable @code + +@item start-kbd-macro (C-x () +Begin saving the characters typed into the current keyboard macro. + +@item end-kbd-macro (C-x )) +Stop saving the characters typed into the current keyboard macro +and save the definition. + +@item call-last-kbd-macro (C-x e) +Re-execute the last keyboard macro defined, by making the characters +in the macro appear as if typed at the keyboard. + +@item print-last-kbd-macro () +Print the last keboard macro defined in a format suitable for the +@var{inputrc} file. + +@end ftable + +@node Miscellaneous Commands +@subsection Some Miscellaneous Commands +@ftable @code + +@item re-read-init-file (C-x C-r) +Read in the contents of the @var{inputrc} file, and incorporate +any bindings or variable assignments found there. + +@item abort (C-g) +Abort the current editing command and +ring the terminal's bell (subject to the setting of +@code{bell-style}). + +@item do-uppercase-version (M-a, M-b, M-@var{x}, @dots{}) +If the metafied character @var{x} is lowercase, run the command +that is bound to the corresponding uppercase character. + +@item prefix-meta (@key{ESC}) +Metafy the next character typed. This is for keyboards +without a meta key. Typing @samp{@key{ESC} f} is equivalent to typing +@kbd{M-f}. + +@item undo (C-_ or C-x C-u) +Incremental undo, separately remembered for each line. + +@item revert-line (M-r) +Undo all changes made to this line. This is like executing the @code{undo} +command enough times to get back to the beginning. + +@ifset BashFeatures +@item tilde-expand (M-&) +@end ifset +@ifclear BashFeatures +@item tilde-expand (M-~) +@end ifclear +Perform tilde expansion on the current word. + +@item set-mark (C-@@) +Set the mark to the point. If a +numeric argument is supplied, the mark is set to that position. + +@item exchange-point-and-mark (C-x C-x) +Swap the point with the mark. The current cursor position is set to +the saved position, and the old cursor position is saved as the mark. + +@item character-search (C-]) +A character is read and point is moved to the next occurrence of that +character. A negative count searches for previous occurrences. + +@item character-search-backward (M-C-]) +A character is read and point is moved to the previous occurrence +of that character. A negative count searches for subsequent +occurrences. + +@item skip-csi-sequence () +Read enough characters to consume a multi-key sequence such as those +defined for keys like Home and End. Such sequences begin with a +Control Sequence Indicator (CSI), usually ESC-[. If this sequence is +bound to "\e[", keys producing such sequences will have no effect +unless explicitly bound to a readline command, instead of inserting +stray characters into the editing buffer. This is unbound by default, +but usually bound to ESC-[. + +@item insert-comment (M-#) +Without a numeric argument, the value of the @code{comment-begin} +variable is inserted at the beginning of the current line. +If a numeric argument is supplied, this command acts as a toggle: if +the characters at the beginning of the line do not match the value +of @code{comment-begin}, the value is inserted, otherwise +the characters in @code{comment-begin} are deleted from the beginning of +the line. +In either case, the line is accepted as if a newline had been typed. +@ifset BashFeatures +The default value of @code{comment-begin} causes this command +to make the current line a shell comment. +If a numeric argument causes the comment character to be removed, the line +will be executed by the shell. +@end ifset + +@item dump-functions () +Print all of the functions and their key bindings to the +Readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an @var{inputrc} file. This command is unbound by default. + +@item dump-variables () +Print all of the settable variables and their values to the +Readline output stream. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an @var{inputrc} file. This command is unbound by default. + +@item dump-macros () +Print all of the Readline key sequences bound to macros and the +strings they output. If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an @var{inputrc} file. This command is unbound by default. + +@ifset BashFeatures +@item glob-complete-word (M-g) +The word before point is treated as a pattern for pathname expansion, +with an asterisk implicitly appended. This pattern is used to +generate a list of matching file names for possible completions. + +@item glob-expand-word (C-x *) +The word before point is treated as a pattern for pathname expansion, +and the list of matching file names is inserted, replacing the word. +If a numeric argument is supplied, a @samp{*} is appended before +pathname expansion. + +@item glob-list-expansions (C-x g) +The list of expansions that would have been generated by +@code{glob-expand-word} is displayed, and the line is redrawn. +If a numeric argument is supplied, a @samp{*} is appended before +pathname expansion. + +@item display-shell-version (C-x C-v) +Display version information about the current instance of Bash. + +@item shell-expand-line (M-C-e) +Expand the line as the shell does. +This performs alias and history expansion as well as all of the shell +word expansions (@pxref{Shell Expansions}). + +@item history-expand-line (M-^) +Perform history expansion on the current line. + +@item magic-space () +Perform history expansion on the current line and insert a space +(@pxref{History Interaction}). + +@item alias-expand-line () +Perform alias expansion on the current line (@pxref{Aliases}). + +@item history-and-alias-expand-line () +Perform history and alias expansion on the current line. + +@item insert-last-argument (M-. or M-_) +A synonym for @code{yank-last-arg}. + +@item operate-and-get-next (C-o) +Accept the current line for execution and fetch the next line +relative to the current line from the history for editing. Any +argument is ignored. + +@item edit-and-execute-command (C-xC-e) +Invoke an editor on the current command line, and execute the result as shell +commands. +Bash attempts to invoke +@code{$VISUAL}, @code{$EDITOR}, and @code{emacs} +as the editor, in that order. + +@end ifset + +@ifclear BashFeatures +@item emacs-editing-mode (C-e) +When in @code{vi} command mode, this causes a switch to @code{emacs} +editing mode. + +@item vi-editing-mode (M-C-j) +When in @code{emacs} editing mode, this causes a switch to @code{vi} +editing mode. + +@end ifclear + +@end ftable + +@node Readline vi Mode +@section Readline vi Mode + +While the Readline library does not have a full set of @code{vi} +editing functions, it does contain enough to allow simple editing +of the line. The Readline @code{vi} mode behaves as specified in +the @sc{posix} standard. + +@ifset BashFeatures +In order to switch interactively between @code{emacs} and @code{vi} +editing modes, use the @samp{set -o emacs} and @samp{set -o vi} +commands (@pxref{The Set Builtin}). +@end ifset +@ifclear BashFeatures +In order to switch interactively between @code{emacs} and @code{vi} +editing modes, use the command @kbd{M-C-j} (bound to emacs-editing-mode +when in @code{vi} mode and to vi-editing-mode in @code{emacs} mode). +@end ifclear +The Readline default is @code{emacs} mode. + +When you enter a line in @code{vi} mode, you are already placed in +`insertion' mode, as if you had typed an @samp{i}. Pressing @key{ESC} +switches you into `command' mode, where you can edit the text of the +line with the standard @code{vi} movement keys, move to previous +history lines with @samp{k} and subsequent lines with @samp{j}, and +so forth. + +@ifset BashFeatures +@node Programmable Completion +@section Programmable Completion +@cindex programmable completion + +When word completion is attempted for an argument to a command for +which a completion specification (a @var{compspec}) has been defined +using the @code{complete} builtin (@pxref{Programmable Completion Builtins}), +the programmable completion facilities are invoked. + +First, the command name is identified. +If a compspec has been defined for that command, the +compspec is used to generate the list of possible completions for the word. +If the command word is the empty string (completion attempted at the +beginning of an empty line), any compspec defined with +the @option{-E} option to @code{complete} is used. +If the command word is a full pathname, a compspec for the full +pathname is searched for first. +If no compspec is found for the full pathname, an attempt is made to +find a compspec for the portion following the final slash. +If those searches do not result in a compspec, any compspec defined with +the @option{-D} option to @code{complete} is used as the default. + +Once a compspec has been found, it is used to generate the list of +matching words. +If a compspec is not found, the default Bash completion +described above (@pxref{Commands For Completion}) is performed. + +First, the actions specified by the compspec are used. +Only matches which are prefixed by the word being completed are +returned. +When the @option{-f} or @option{-d} option is used for filename or +directory name completion, the shell variable @env{FIGNORE} is +used to filter the matches. +@xref{Bash Variables}, for a description of @env{FIGNORE}. + +Any completions specified by a filename expansion pattern to the +@option{-G} option are generated next. +The words generated by the pattern need not match the word being completed. +The @env{GLOBIGNORE} shell variable is not used to filter the matches, +but the @env{FIGNORE} shell variable is used. + +Next, the string specified as the argument to the @option{-W} option +is considered. +The string is first split using the characters in the @env{IFS} +special variable as delimiters. +Shell quoting is honored. +Each word is then expanded using +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, and arithmetic expansion, +as described above (@pxref{Shell Expansions}). +The results are split using the rules described above +(@pxref{Word Splitting}). +The results of the expansion are prefix-matched against the word being +completed, and the matching words become the possible completions. + +After these matches have been generated, any shell function or command +specified with the @option{-F} and @option{-C} options is invoked. +When the command or function is invoked, the @env{COMP_LINE}, +@env{COMP_POINT}, @env{COMP_KEY}, and @env{COMP_TYPE} variables are +assigned values as described above (@pxref{Bash Variables}). +If a shell function is being invoked, the @env{COMP_WORDS} and +@env{COMP_CWORD} variables are also set. +When the function or command is invoked, the first argument ($1) is the +name of the command whose arguments are being completed, the +second argument ($2) is the word being completed, and the third argument +($3) is the word preceding the word being completed on the current command +line. +No filtering of the generated completions against the word being completed +is performed; the function or command has complete freedom in generating +the matches. + +Any function specified with @option{-F} is invoked first. +The function may use any of the shell facilities, including the +@code{compgen} and @code{compopt} builtins described below +(@pxref{Programmable Completion Builtins}), to generate the matches. +It must put the possible completions in the @env{COMPREPLY} array +variable, one per array element. + +Next, any command specified with the @option{-C} option is invoked +in an environment equivalent to command substitution. +It should print a list of completions, one per line, to +the standard output. +Backslash may be used to escape a newline, if necessary. + +After all of the possible completions are generated, any filter +specified with the @option{-X} option is applied to the list. +The filter is a pattern as used for pathname expansion; a @samp{&} +in the pattern is replaced with the text of the word being completed. +A literal @samp{&} may be escaped with a backslash; the backslash +is removed before attempting a match. +Any completion that matches the pattern will be removed from the list. +A leading @samp{!} negates the pattern; in this case any completion +not matching the pattern will be removed. + +Finally, any prefix and suffix specified with the @option{-P} and @option{-S} +options are added to each member of the completion list, and the result is +returned to the Readline completion code as the list of possible +completions. + +If the previously-applied actions do not generate any matches, and the +@option{-o dirnames} option was supplied to @code{complete} when the +compspec was defined, directory name completion is attempted. + +If the @option{-o plusdirs} option was supplied to @code{complete} when +the compspec was defined, directory name completion is attempted and any +matches are added to the results of the other actions. + +By default, if a compspec is found, whatever it generates is returned to +the completion code as the full set of possible completions. +The default Bash completions are not attempted, and the Readline default +of filename completion is disabled. +If the @option{-o bashdefault} option was supplied to @code{complete} when +the compspec was defined, the default Bash completions are attempted +if the compspec generates no matches. +If the @option{-o default} option was supplied to @code{complete} when the +compspec was defined, Readline's default completion will be performed +if the compspec (and, if attempted, the default Bash completions) +generate no matches. + +When a compspec indicates that directory name completion is desired, +the programmable completion functions force Readline to append a slash +to completed names which are symbolic links to directories, subject to +the value of the @var{mark-directories} Readline variable, regardless +of the setting of the @var{mark-symlinked-directories} Readline variable. + +There is some support for dynamically modifying completions. This is +most useful when used in combination with a default completion specified +with @option{-D}. It's possible for shell functions executed as completion +handlers to indicate that completion should be retried by returning an +exit status of 124. If a shell function returns 124, and changes +the compspec associated with the command on which completion is being +attempted (supplied as the first argument when the function is executed), +programmable completion restarts from the beginning, with an +attempt to find a new compspec for that command. This allows a set of +completions to be built dynamically as completion is attempted, rather than +being loaded all at once. + +For instance, assuming that there is a library of compspecs, each kept in a +file corresponding to the name of the command, the following default +completion function would load completions dynamically: + +@example +_completion_loader() +@{ + . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124 +@} +complete -D -F _completion_loader -o bashdefault -o default +@end example + +@node Programmable Completion Builtins +@section Programmable Completion Builtins +@cindex completion builtins + +Three builtin commands are available to manipulate the programmable completion +facilities: one to specify how the arguments to a particular command are to +be completed, and two to modify the completion as it is happening. + +@table @code +@item compgen +@btindex compgen +@example +@code{compgen [@var{option}] [@var{word}]} +@end example + +Generate possible completion matches for @var{word} according to +the @var{option}s, which may be any option accepted by the +@code{complete} +builtin with the exception of @option{-p} and @option{-r}, and write +the matches to the standard output. +When using the @option{-F} or @option{-C} options, the various shell variables +set by the programmable completion facilities, while available, will not +have useful values. + +The matches will be generated in the same way as if the programmable +completion code had generated them directly from a completion specification +with the same flags. +If @var{word} is specified, only those completions matching @var{word} +will be displayed. + +The return value is true unless an invalid option is supplied, or no +matches were generated. + +@item complete +@btindex complete +@example +@code{complete [-abcdefgjksuv] [-o @var{comp-option}] [-DE] [-A @var{action}] [-G @var{globpat}] [-W @var{wordlist}] +[-F @var{function}] [-C @var{command}] [-X @var{filterpat}] +[-P @var{prefix}] [-S @var{suffix}] @var{name} [@var{name} @dots{}]} +@code{complete -pr [-DE] [@var{name} @dots{}]} +@end example + +Specify how arguments to each @var{name} should be completed. +If the @option{-p} option is supplied, or if no options are supplied, existing +completion specifications are printed in a way that allows them to be +reused as input. +The @option{-r} option removes a completion specification for +each @var{name}, or, if no @var{name}s are supplied, all +completion specifications. +The @option{-D} option indicates that the remaining options and actions should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The @option{-E} option indicates that the remaining options and actions should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. + +The process of applying these completion specifications when word completion +is attempted is described above (@pxref{Programmable Completion}). The +@option{-D} option takes precedence over @option{-E}. + +Other options, if specified, have the following meanings. +The arguments to the @option{-G}, @option{-W}, and @option{-X} options +(and, if necessary, the @option{-P} and @option{-S} options) +should be quoted to protect them from expansion before the +@code{complete} builtin is invoked. + + +@table @code +@item -o @var{comp-option} +The @var{comp-option} controls several aspects of the compspec's behavior +beyond the simple generation of completions. +@var{comp-option} may be one of: + +@table @code + +@item bashdefault +Perform the rest of the default Bash completions if the compspec +generates no matches. + +@item default +Use Readline's default filename completion if the compspec generates +no matches. + +@item dirnames +Perform directory name completion if the compspec generates no matches. + +@item filenames +Tell Readline that the compspec generates filenames, so it can perform any +filename-specific processing (like adding a slash to directory names +quoting special characters, or suppressing trailing spaces). +This option is intended to be used with shell functions specified +with @option{-F}. + +@item noquote +Tell Readline not to quote the completed words if they are filenames +(quoting filenames is the default). + +@item nospace +Tell Readline not to append a space (the default) to words completed at +the end of the line. + +@item plusdirs +After any matches defined by the compspec are generated, +directory name completion is attempted and any +matches are added to the results of the other actions. + +@end table + +@item -A @var{action} +The @var{action} may be one of the following to generate a list of possible +completions: + +@table @code +@item alias +Alias names. May also be specified as @option{-a}. + +@item arrayvar +Array variable names. + +@item binding +Readline key binding names (@pxref{Bindable Readline Commands}). + +@item builtin +Names of shell builtin commands. May also be specified as @option{-b}. + +@item command +Command names. May also be specified as @option{-c}. + +@item directory +Directory names. May also be specified as @option{-d}. + +@item disabled +Names of disabled shell builtins. + +@item enabled +Names of enabled shell builtins. + +@item export +Names of exported shell variables. May also be specified as @option{-e}. + +@item file +File names. May also be specified as @option{-f}. + +@item function +Names of shell functions. + +@item group +Group names. May also be specified as @option{-g}. + +@item helptopic +Help topics as accepted by the @code{help} builtin (@pxref{Bash Builtins}). + +@item hostname +Hostnames, as taken from the file specified by the +@env{HOSTFILE} shell variable (@pxref{Bash Variables}). + +@item job +Job names, if job control is active. May also be specified as @option{-j}. + +@item keyword +Shell reserved words. May also be specified as @option{-k}. + +@item running +Names of running jobs, if job control is active. + +@item service +Service names. May also be specified as @option{-s}. + +@item setopt +Valid arguments for the @option{-o} option to the @code{set} builtin +(@pxref{The Set Builtin}). + +@item shopt +Shell option names as accepted by the @code{shopt} builtin +(@pxref{Bash Builtins}). + +@item signal +Signal names. + +@item stopped +Names of stopped jobs, if job control is active. + +@item user +User names. May also be specified as @option{-u}. + +@item variable +Names of all shell variables. May also be specified as @option{-v}. +@end table + +@item -C @var{command} +@var{command} is executed in a subshell environment, and its output is +used as the possible completions. + +@item -F @var{function} +The shell function @var{function} is executed in the current shell +environment. +When it is executed, $1 is the name of the command whose arguments are +being completed, $2 is the word being completed, and $3 is the word +preceding the word being completed, as described above +(@pxref{Programmable Completion}). +When it finishes, the possible completions are retrieved from the value +of the @env{COMPREPLY} array variable. + +@item -G @var{globpat} +The filename expansion pattern @var{globpat} is expanded to generate +the possible completions. + +@item -P @var{prefix} +@var{prefix} is added at the beginning of each possible completion +after all other options have been applied. + +@item -S @var{suffix} +@var{suffix} is appended to each possible completion +after all other options have been applied. + +@item -W @var{wordlist} +The @var{wordlist} is split using the characters in the +@env{IFS} special variable as delimiters, and each resultant word +is expanded. +The possible completions are the members of the resultant list which +match the word being completed. + +@item -X @var{filterpat} +@var{filterpat} is a pattern as used for filename expansion. +It is applied to the list of possible completions generated by the +preceding options and arguments, and each completion matching +@var{filterpat} is removed from the list. +A leading @samp{!} in @var{filterpat} negates the pattern; in this +case, any completion not matching @var{filterpat} is removed. +@end table + +The return value is true unless an invalid option is supplied, an option +other than @option{-p} or @option{-r} is supplied without a @var{name} +argument, an attempt is made to remove a completion specification for +a @var{name} for which no specification exists, or +an error occurs adding a completion specification. + +@item compopt +@btindex compopt +@example +@code{compopt} [-o @var{option}] [-DE] [+o @var{option}] [@var{name}] +@end example +Modify completion options for each @var{name} according to the +@var{option}s, or for the currently-executing completion if no @var{name}s +are supplied. +If no @var{option}s are given, display the completion options for each +@var{name} or the current completion. +The possible values of @var{option} are those valid for the @code{complete} +builtin described above. +The @option{-D} option indicates that the remaining options should +apply to the ``default'' command completion; that is, completion attempted +on a command for which no completion has previously been defined. +The @option{-E} option indicates that the remaining options should +apply to ``empty'' command completion; that is, completion attempted on a +blank line. + +The @option{-D} option takes precedence over @option{-E}. + +The return value is true unless an invalid option is supplied, an attempt +is made to modify the options for a @var{name} for which no completion +specification exists, or an output error occurs. + +@end table + +@node A Programmable Completion Example +@section A Programmable Completion Example + +The most common way to obtain additional completion functionality beyond +the default actions @code{complete} and @code{compgen} provide is to use +a shell function and bind it to a particular command using @code{complete -F}. + +The following function provides completions for the @code{cd} builtin. +It is a reasonably good example of what shell functions must do when +used for completion. This function uses the word passsed as @code{$2} +to determine the directory name to complete. You can also use the +@code{COMP_WORDS} array variable; the current word is indexed by the +@code{COMP_CWORD} variable. + +The function relies on the @code{complete} and @code{compgen} builtins +to do much of the work, adding only the things that the Bash @code{cd} +does beyond accepting basic directory names: +tilde expansion (@pxref{Tilde Expansion}), +searching directories in @var{$CDPATH}, which is described above +(@pxref{Bourne Shell Builtins}), +and basic support for the @code{cdable_vars} shell option +(@pxref{The Shopt Builtin}). +@code{_comp_cd} modifies the value of @var{IFS} so that it contains only +a newline to accommodate file names containing spaces and tabs -- +@code{compgen} prints the possible completions it generates one per line. + +Possible completions go into the @var{COMPREPLY} array variable, one +completion per array element. The programmable completion system retrieves +the completions from there when the function returns. + +@example +# A completion function for the cd builtin +# based on the cd completion function from the bash_completion package +_comp_cd() +@{ + local IFS=$' \t\n' # normalize IFS + local cur _skipdot _cdpath + local i j k + + # Tilde expansion, with side effect of expanding tilde to full pathname + case "$2" in + \~*) eval cur="$2" ;; + *) cur=$2 ;; + esac + + # no cdpath or absolute pathname -- straight directory completion + if [[ -z "$@{CDPATH:-@}" ]] || [[ "$cur" == @@(./*|../*|/*) ]]; then + # compgen prints paths one per line; could also use while loop + IFS=$'\n' + COMPREPLY=( $(compgen -d -- "$cur") ) + IFS=$' \t\n' + # CDPATH+directories in the current directory if not in CDPATH + else + IFS=$'\n' + _skipdot=false + # preprocess CDPATH to convert null directory names to . + _cdpath=$@{CDPATH/#:/.:@} + _cdpath=$@{_cdpath//::/:.:@} + _cdpath=$@{_cdpath/%:/:.@} + for i in $@{_cdpath//:/$'\n'@}; do + if [[ $i -ef . ]]; then _skipdot=true; fi + k="$@{#COMPREPLY[@@]@}" + for j in $( compgen -d -- "$i/$cur" ); do + COMPREPLY[k++]=$@{j#$i/@} # cut off directory + done + done + $_skipdot || COMPREPLY+=( $(compgen -d -- "$cur") ) + IFS=$' \t\n' + fi + + # variable names if appropriate shell option set and no completions + if shopt -q cdable_vars && [[ $@{#COMPREPLY[@@]@} -eq 0 ]]; then + COMPREPLY=( $(compgen -v -- "$cur") ) + fi + + return 0 +@} +@end example + +We install the completion function using the @option{-F} option to +@code{complete}: + +@example +# Tell readline to quote appropriate and append slashes to directories; +# use the bash default completion for other arguments +complete -o filenames -o nospace -o bashdefault -F _comp_cd cd +@end example + +@noindent +Since we'd like Bash and Readline to take care of some +of the other details for us, we use several other options to tell Bash +and Readline what to do. The @option{-o filenames} option tells Readline +that the possible completions should be treated as filenames, and quoted +appropriately. That option will also cause Readline to append a slash to +filenames it can determine are directories (which is why we might want to +extend @code{_comp_cd} to append a slash if we're using directories found +via @var{CDPATH}: Readline can't tell those completions are directories). +The @option{-o nospace} option tells Readline to not append a space +character to the directory name, in case we want to append to it. +The @option{-o bashdefault} option brings in the rest of the "Bash default" +completions -- possible completion that Bash adds to the default Readline +set. These include things like command name completion, variable completion +for words beginning with @samp{@{}, completions containing pathname +expansion patterns (@pxref{Filename Expansion}), and so on. + +Once installed using @code{complete}, @code{_comp_cd} will be called every +time we attempt word completion for a @code{cd} command. + +Many more examples -- an extensive collection of completions for most of +the common GNU, Unix, and Linux commands -- are available as part of the +bash_completion project. This is installed by default on many GNU/Linux +distributions. Originally written by Ian Macdonald, the project now lives +at @url{http://bash-completion.alioth.debian.org/}. There are ports for +other systems such as Solaris and Mac OS X. + +An older version of the bash_completion package is distributed with bash +in the @file{examples/complete} subdirectory. + +@end ifset diff --git a/lib/readline/doc/rluserman.texi b/lib/readline/doc/rluserman.texi new file mode 100644 index 0000000..ba6b0ad --- /dev/null +++ b/lib/readline/doc/rluserman.texi @@ -0,0 +1,70 @@ +\input texinfo @c -*-texinfo-*- +@comment %**start of header (This is for running Texinfo on a region.) +@setfilename rluserman.info +@settitle GNU Readline Library +@include version.texi + +@comment %**end of header (This is for running Texinfo on a region.) + +@copying +This manual describes the end user interface of the GNU Readline Library +(version @value{VERSION}, @value{UPDATED}), a library which aids in the +consistency of user interface across discrete programs which provide +a command line interface. + +Copyright @copyright{} 1988--2014 Free Software Foundation, Inc. + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 or +any later version published by the Free Software Foundation; with no +Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. +A copy of the license is included in the section entitled +``GNU Free Documentation License''. + +@end quotation +@end copying + +@dircategory Libraries +@direntry +* RLuserman: (rluserman). The GNU readline library User's Manual. +@end direntry + +@titlepage +@title GNU Readline Library User Interface +@subtitle Edition @value{EDITION}, for @code{Readline Library} Version @value{VERSION}. +@subtitle @value{UPDATED-MONTH} +@author Chet Ramey, Case Western Reserve University +@author Brian Fox, Free Software Foundation + +@page +@vskip 0pt plus 1filll +@insertcopying + +@end titlepage + +@contents + +@ifnottex +@node Top +@top GNU Readline Library + +This document describes the end user interface of the GNU Readline Library, +a utility which aids in the consistency of user interface across discrete +programs which provide a command line interface. +The Readline home page is @url{http://www.gnu.org/software/readline/}. + +@menu +* Command Line Editing:: GNU Readline User's Manual. +* GNU Free Documentation License:: License for copying this manual. +@end menu +@end ifnottex + +@include rluser.texi + +@node GNU Free Documentation License +@appendix GNU Free Documentation License + +@include fdl.texi + +@bye diff --git a/lib/readline/doc/version.texi b/lib/readline/doc/version.texi new file mode 100644 index 0000000..70b6658 --- /dev/null +++ b/lib/readline/doc/version.texi @@ -0,0 +1,10 @@ +@ignore +Copyright (C) 1988-2014 Free Software Foundation, Inc. +@end ignore + +@set EDITION 6.3 +@set VERSION 6.3 +@set UPDATED 6 January 2014 +@set UPDATED-MONTH January 2014 + +@set LASTCHANGE Mon Jan 6 16:26:51 EST 2014 diff --git a/lib/readline/emacs_keymap.c b/lib/readline/emacs_keymap.c new file mode 100644 index 0000000..cb6e140 --- /dev/null +++ b/lib/readline/emacs_keymap.c @@ -0,0 +1,872 @@ +/* emacs_keymap.c -- the keymap for emacs_mode in readline (). */ + +/* Copyright (C) 1987-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if !defined (BUFSIZ) +#include +#endif /* !BUFSIZ */ + +#include "readline.h" + +/* An array of function pointers, one for each possible key. + If the type byte is ISKMAP, then the pointer is the address of + a keymap. */ + +KEYMAP_ENTRY_ARRAY emacs_standard_keymap = { + + /* Control keys. */ + { ISFUNC, rl_set_mark }, /* Control-@ */ + { ISFUNC, rl_beg_of_line }, /* Control-a */ + { ISFUNC, rl_backward_char }, /* Control-b */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-c */ + { ISFUNC, rl_delete }, /* Control-d */ + { ISFUNC, rl_end_of_line }, /* Control-e */ + { ISFUNC, rl_forward_char }, /* Control-f */ + { ISFUNC, rl_abort }, /* Control-g */ + { ISFUNC, rl_rubout }, /* Control-h */ + { ISFUNC, rl_complete }, /* Control-i */ + { ISFUNC, rl_newline }, /* Control-j */ + { ISFUNC, rl_kill_line }, /* Control-k */ + { ISFUNC, rl_clear_screen }, /* Control-l */ + { ISFUNC, rl_newline }, /* Control-m */ + { ISFUNC, rl_get_next_history }, /* Control-n */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-o */ + { ISFUNC, rl_get_previous_history }, /* Control-p */ + { ISFUNC, rl_quoted_insert }, /* Control-q */ + { ISFUNC, rl_reverse_search_history }, /* Control-r */ + { ISFUNC, rl_forward_search_history }, /* Control-s */ + { ISFUNC, rl_transpose_chars }, /* Control-t */ + { ISFUNC, rl_unix_line_discard }, /* Control-u */ + { ISFUNC, rl_quoted_insert }, /* Control-v */ + { ISFUNC, rl_unix_word_rubout }, /* Control-w */ + { ISKMAP, (rl_command_func_t *)emacs_ctlx_keymap }, /* Control-x */ + { ISFUNC, rl_yank }, /* Control-y */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-z */ + { ISKMAP, (rl_command_func_t *)emacs_meta_keymap }, /* Control-[ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-\ */ + { ISFUNC, rl_char_search }, /* Control-] */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-^ */ + { ISFUNC, rl_undo_command }, /* Control-_ */ + + /* The start of printing characters. */ + { ISFUNC, rl_insert }, /* SPACE */ + { ISFUNC, rl_insert }, /* ! */ + { ISFUNC, rl_insert }, /* " */ + { ISFUNC, rl_insert }, /* # */ + { ISFUNC, rl_insert }, /* $ */ + { ISFUNC, rl_insert }, /* % */ + { ISFUNC, rl_insert }, /* & */ + { ISFUNC, rl_insert }, /* ' */ + { ISFUNC, rl_insert }, /* ( */ + { ISFUNC, rl_insert }, /* ) */ + { ISFUNC, rl_insert }, /* * */ + { ISFUNC, rl_insert }, /* + */ + { ISFUNC, rl_insert }, /* , */ + { ISFUNC, rl_insert }, /* - */ + { ISFUNC, rl_insert }, /* . */ + { ISFUNC, rl_insert }, /* / */ + + /* Regular digits. */ + { ISFUNC, rl_insert }, /* 0 */ + { ISFUNC, rl_insert }, /* 1 */ + { ISFUNC, rl_insert }, /* 2 */ + { ISFUNC, rl_insert }, /* 3 */ + { ISFUNC, rl_insert }, /* 4 */ + { ISFUNC, rl_insert }, /* 5 */ + { ISFUNC, rl_insert }, /* 6 */ + { ISFUNC, rl_insert }, /* 7 */ + { ISFUNC, rl_insert }, /* 8 */ + { ISFUNC, rl_insert }, /* 9 */ + + /* A little more punctuation. */ + { ISFUNC, rl_insert }, /* : */ + { ISFUNC, rl_insert }, /* ; */ + { ISFUNC, rl_insert }, /* < */ + { ISFUNC, rl_insert }, /* = */ + { ISFUNC, rl_insert }, /* > */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* @ */ + + /* Uppercase alphabet. */ + { ISFUNC, rl_insert }, /* A */ + { ISFUNC, rl_insert }, /* B */ + { ISFUNC, rl_insert }, /* C */ + { ISFUNC, rl_insert }, /* D */ + { ISFUNC, rl_insert }, /* E */ + { ISFUNC, rl_insert }, /* F */ + { ISFUNC, rl_insert }, /* G */ + { ISFUNC, rl_insert }, /* H */ + { ISFUNC, rl_insert }, /* I */ + { ISFUNC, rl_insert }, /* J */ + { ISFUNC, rl_insert }, /* K */ + { ISFUNC, rl_insert }, /* L */ + { ISFUNC, rl_insert }, /* M */ + { ISFUNC, rl_insert }, /* N */ + { ISFUNC, rl_insert }, /* O */ + { ISFUNC, rl_insert }, /* P */ + { ISFUNC, rl_insert }, /* Q */ + { ISFUNC, rl_insert }, /* R */ + { ISFUNC, rl_insert }, /* S */ + { ISFUNC, rl_insert }, /* T */ + { ISFUNC, rl_insert }, /* U */ + { ISFUNC, rl_insert }, /* V */ + { ISFUNC, rl_insert }, /* W */ + { ISFUNC, rl_insert }, /* X */ + { ISFUNC, rl_insert }, /* Y */ + { ISFUNC, rl_insert }, /* Z */ + + /* Some more punctuation. */ + { ISFUNC, rl_insert }, /* [ */ + { ISFUNC, rl_insert }, /* \ */ + { ISFUNC, rl_insert }, /* ] */ + { ISFUNC, rl_insert }, /* ^ */ + { ISFUNC, rl_insert }, /* _ */ + { ISFUNC, rl_insert }, /* ` */ + + /* Lowercase alphabet. */ + { ISFUNC, rl_insert }, /* a */ + { ISFUNC, rl_insert }, /* b */ + { ISFUNC, rl_insert }, /* c */ + { ISFUNC, rl_insert }, /* d */ + { ISFUNC, rl_insert }, /* e */ + { ISFUNC, rl_insert }, /* f */ + { ISFUNC, rl_insert }, /* g */ + { ISFUNC, rl_insert }, /* h */ + { ISFUNC, rl_insert }, /* i */ + { ISFUNC, rl_insert }, /* j */ + { ISFUNC, rl_insert }, /* k */ + { ISFUNC, rl_insert }, /* l */ + { ISFUNC, rl_insert }, /* m */ + { ISFUNC, rl_insert }, /* n */ + { ISFUNC, rl_insert }, /* o */ + { ISFUNC, rl_insert }, /* p */ + { ISFUNC, rl_insert }, /* q */ + { ISFUNC, rl_insert }, /* r */ + { ISFUNC, rl_insert }, /* s */ + { ISFUNC, rl_insert }, /* t */ + { ISFUNC, rl_insert }, /* u */ + { ISFUNC, rl_insert }, /* v */ + { ISFUNC, rl_insert }, /* w */ + { ISFUNC, rl_insert }, /* x */ + { ISFUNC, rl_insert }, /* y */ + { ISFUNC, rl_insert }, /* z */ + + /* Final punctuation. */ + { ISFUNC, rl_insert }, /* { */ + { ISFUNC, rl_insert }, /* | */ + { ISFUNC, rl_insert }, /* } */ + { ISFUNC, rl_insert }, /* ~ */ + { ISFUNC, rl_rubout }, /* RUBOUT */ + +#if KEYMAP_SIZE > 128 + /* Pure 8-bit characters (128 - 159). + These might be used in some + character sets. */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + + /* ISO Latin-1 characters (160 - 255) */ + { ISFUNC, rl_insert }, /* No-break space */ + { ISFUNC, rl_insert }, /* Inverted exclamation mark */ + { ISFUNC, rl_insert }, /* Cent sign */ + { ISFUNC, rl_insert }, /* Pound sign */ + { ISFUNC, rl_insert }, /* Currency sign */ + { ISFUNC, rl_insert }, /* Yen sign */ + { ISFUNC, rl_insert }, /* Broken bar */ + { ISFUNC, rl_insert }, /* Section sign */ + { ISFUNC, rl_insert }, /* Diaeresis */ + { ISFUNC, rl_insert }, /* Copyright sign */ + { ISFUNC, rl_insert }, /* Feminine ordinal indicator */ + { ISFUNC, rl_insert }, /* Left pointing double angle quotation mark */ + { ISFUNC, rl_insert }, /* Not sign */ + { ISFUNC, rl_insert }, /* Soft hyphen */ + { ISFUNC, rl_insert }, /* Registered sign */ + { ISFUNC, rl_insert }, /* Macron */ + { ISFUNC, rl_insert }, /* Degree sign */ + { ISFUNC, rl_insert }, /* Plus-minus sign */ + { ISFUNC, rl_insert }, /* Superscript two */ + { ISFUNC, rl_insert }, /* Superscript three */ + { ISFUNC, rl_insert }, /* Acute accent */ + { ISFUNC, rl_insert }, /* Micro sign */ + { ISFUNC, rl_insert }, /* Pilcrow sign */ + { ISFUNC, rl_insert }, /* Middle dot */ + { ISFUNC, rl_insert }, /* Cedilla */ + { ISFUNC, rl_insert }, /* Superscript one */ + { ISFUNC, rl_insert }, /* Masculine ordinal indicator */ + { ISFUNC, rl_insert }, /* Right pointing double angle quotation mark */ + { ISFUNC, rl_insert }, /* Vulgar fraction one quarter */ + { ISFUNC, rl_insert }, /* Vulgar fraction one half */ + { ISFUNC, rl_insert }, /* Vulgar fraction three quarters */ + { ISFUNC, rl_insert }, /* Inverted questionk mark */ + { ISFUNC, rl_insert }, /* Latin capital letter a with grave */ + { ISFUNC, rl_insert }, /* Latin capital letter a with acute */ + { ISFUNC, rl_insert }, /* Latin capital letter a with circumflex */ + { ISFUNC, rl_insert }, /* Latin capital letter a with tilde */ + { ISFUNC, rl_insert }, /* Latin capital letter a with diaeresis */ + { ISFUNC, rl_insert }, /* Latin capital letter a with ring above */ + { ISFUNC, rl_insert }, /* Latin capital letter ae */ + { ISFUNC, rl_insert }, /* Latin capital letter c with cedilla */ + { ISFUNC, rl_insert }, /* Latin capital letter e with grave */ + { ISFUNC, rl_insert }, /* Latin capital letter e with acute */ + { ISFUNC, rl_insert }, /* Latin capital letter e with circumflex */ + { ISFUNC, rl_insert }, /* Latin capital letter e with diaeresis */ + { ISFUNC, rl_insert }, /* Latin capital letter i with grave */ + { ISFUNC, rl_insert }, /* Latin capital letter i with acute */ + { ISFUNC, rl_insert }, /* Latin capital letter i with circumflex */ + { ISFUNC, rl_insert }, /* Latin capital letter i with diaeresis */ + { ISFUNC, rl_insert }, /* Latin capital letter eth (Icelandic) */ + { ISFUNC, rl_insert }, /* Latin capital letter n with tilde */ + { ISFUNC, rl_insert }, /* Latin capital letter o with grave */ + { ISFUNC, rl_insert }, /* Latin capital letter o with acute */ + { ISFUNC, rl_insert }, /* Latin capital letter o with circumflex */ + { ISFUNC, rl_insert }, /* Latin capital letter o with tilde */ + { ISFUNC, rl_insert }, /* Latin capital letter o with diaeresis */ + { ISFUNC, rl_insert }, /* Multiplication sign */ + { ISFUNC, rl_insert }, /* Latin capital letter o with stroke */ + { ISFUNC, rl_insert }, /* Latin capital letter u with grave */ + { ISFUNC, rl_insert }, /* Latin capital letter u with acute */ + { ISFUNC, rl_insert }, /* Latin capital letter u with circumflex */ + { ISFUNC, rl_insert }, /* Latin capital letter u with diaeresis */ + { ISFUNC, rl_insert }, /* Latin capital letter Y with acute */ + { ISFUNC, rl_insert }, /* Latin capital letter thorn (Icelandic) */ + { ISFUNC, rl_insert }, /* Latin small letter sharp s (German) */ + { ISFUNC, rl_insert }, /* Latin small letter a with grave */ + { ISFUNC, rl_insert }, /* Latin small letter a with acute */ + { ISFUNC, rl_insert }, /* Latin small letter a with circumflex */ + { ISFUNC, rl_insert }, /* Latin small letter a with tilde */ + { ISFUNC, rl_insert }, /* Latin small letter a with diaeresis */ + { ISFUNC, rl_insert }, /* Latin small letter a with ring above */ + { ISFUNC, rl_insert }, /* Latin small letter ae */ + { ISFUNC, rl_insert }, /* Latin small letter c with cedilla */ + { ISFUNC, rl_insert }, /* Latin small letter e with grave */ + { ISFUNC, rl_insert }, /* Latin small letter e with acute */ + { ISFUNC, rl_insert }, /* Latin small letter e with circumflex */ + { ISFUNC, rl_insert }, /* Latin small letter e with diaeresis */ + { ISFUNC, rl_insert }, /* Latin small letter i with grave */ + { ISFUNC, rl_insert }, /* Latin small letter i with acute */ + { ISFUNC, rl_insert }, /* Latin small letter i with circumflex */ + { ISFUNC, rl_insert }, /* Latin small letter i with diaeresis */ + { ISFUNC, rl_insert }, /* Latin small letter eth (Icelandic) */ + { ISFUNC, rl_insert }, /* Latin small letter n with tilde */ + { ISFUNC, rl_insert }, /* Latin small letter o with grave */ + { ISFUNC, rl_insert }, /* Latin small letter o with acute */ + { ISFUNC, rl_insert }, /* Latin small letter o with circumflex */ + { ISFUNC, rl_insert }, /* Latin small letter o with tilde */ + { ISFUNC, rl_insert }, /* Latin small letter o with diaeresis */ + { ISFUNC, rl_insert }, /* Division sign */ + { ISFUNC, rl_insert }, /* Latin small letter o with stroke */ + { ISFUNC, rl_insert }, /* Latin small letter u with grave */ + { ISFUNC, rl_insert }, /* Latin small letter u with acute */ + { ISFUNC, rl_insert }, /* Latin small letter u with circumflex */ + { ISFUNC, rl_insert }, /* Latin small letter u with diaeresis */ + { ISFUNC, rl_insert }, /* Latin small letter y with acute */ + { ISFUNC, rl_insert }, /* Latin small letter thorn (Icelandic) */ + { ISFUNC, rl_insert } /* Latin small letter y with diaeresis */ +#endif /* KEYMAP_SIZE > 128 */ +}; + +KEYMAP_ENTRY_ARRAY emacs_meta_keymap = { + + /* Meta keys. Just like above, but the high bit is set. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-@ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-a */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-b */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-c */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-d */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-e */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-f */ + { ISFUNC, rl_abort }, /* Meta-Control-g */ + { ISFUNC, rl_backward_kill_word }, /* Meta-Control-h */ + { ISFUNC, rl_tab_insert }, /* Meta-Control-i */ + { ISFUNC, rl_vi_editing_mode }, /* Meta-Control-j */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-k */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-l */ + { ISFUNC, rl_vi_editing_mode }, /* Meta-Control-m */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-n */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-o */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-p */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-q */ + { ISFUNC, rl_revert_line }, /* Meta-Control-r */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-s */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-t */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-u */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-v */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-w */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-x */ + { ISFUNC, rl_yank_nth_arg }, /* Meta-Control-y */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-z */ + + { ISFUNC, rl_complete }, /* Meta-Control-[ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-\ */ + { ISFUNC, rl_backward_char_search }, /* Meta-Control-] */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-^ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-_ */ + + /* The start of printing characters. */ + { ISFUNC, rl_set_mark }, /* Meta-SPACE */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-! */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-" */ + { ISFUNC, rl_insert_comment }, /* Meta-# */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-$ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-% */ + { ISFUNC, rl_tilde_expand }, /* Meta-& */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-' */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-( */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-) */ + { ISFUNC, rl_insert_completions }, /* Meta-* */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-+ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-, */ + { ISFUNC, rl_digit_argument }, /* Meta-- */ + { ISFUNC, rl_yank_last_arg}, /* Meta-. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-/ */ + + /* Regular digits. */ + { ISFUNC, rl_digit_argument }, /* Meta-0 */ + { ISFUNC, rl_digit_argument }, /* Meta-1 */ + { ISFUNC, rl_digit_argument }, /* Meta-2 */ + { ISFUNC, rl_digit_argument }, /* Meta-3 */ + { ISFUNC, rl_digit_argument }, /* Meta-4 */ + { ISFUNC, rl_digit_argument }, /* Meta-5 */ + { ISFUNC, rl_digit_argument }, /* Meta-6 */ + { ISFUNC, rl_digit_argument }, /* Meta-7 */ + { ISFUNC, rl_digit_argument }, /* Meta-8 */ + { ISFUNC, rl_digit_argument }, /* Meta-9 */ + + /* A little more punctuation. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-: */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-; */ + { ISFUNC, rl_beginning_of_history }, /* Meta-< */ + { ISFUNC, rl_possible_completions }, /* Meta-= */ + { ISFUNC, rl_end_of_history }, /* Meta-> */ + { ISFUNC, rl_possible_completions }, /* Meta-? */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-@ */ + + /* Uppercase alphabet. */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-A */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-B */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-C */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-D */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-E */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-F */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-G */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-H */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-I */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-J */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-K */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-L */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-M */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-N */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-O */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-P */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-Q */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-R */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-S */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-T */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-U */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-V */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-W */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-X */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-Y */ + { ISFUNC, rl_do_lowercase_version }, /* Meta-Z */ + + /* Some more punctuation. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-[ */ /* was rl_arrow_keys */ + { ISFUNC, rl_delete_horizontal_space }, /* Meta-\ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-] */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-^ */ + { ISFUNC, rl_yank_last_arg }, /* Meta-_ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-` */ + + /* Lowercase alphabet. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-a */ + { ISFUNC, rl_backward_word }, /* Meta-b */ + { ISFUNC, rl_capitalize_word }, /* Meta-c */ + { ISFUNC, rl_kill_word }, /* Meta-d */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-e */ + { ISFUNC, rl_forward_word }, /* Meta-f */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-g */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-h */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-i */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-j */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-k */ + { ISFUNC, rl_downcase_word }, /* Meta-l */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-m */ + { ISFUNC, rl_noninc_forward_search }, /* Meta-n */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-o */ /* was rl_arrow_keys */ + { ISFUNC, rl_noninc_reverse_search }, /* Meta-p */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-q */ + { ISFUNC, rl_revert_line }, /* Meta-r */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-s */ + { ISFUNC, rl_transpose_words }, /* Meta-t */ + { ISFUNC, rl_upcase_word }, /* Meta-u */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-v */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-w */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-x */ + { ISFUNC, rl_yank_pop }, /* Meta-y */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-z */ + + /* Final punctuation. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-{ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-| */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-} */ + { ISFUNC, rl_tilde_expand }, /* Meta-~ */ + { ISFUNC, rl_backward_kill_word }, /* Meta-rubout */ + +#if KEYMAP_SIZE > 128 + /* Undefined keys. */ + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 } +#endif /* KEYMAP_SIZE > 128 */ +}; + +KEYMAP_ENTRY_ARRAY emacs_ctlx_keymap = { + + /* Control keys. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-@ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-a */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-b */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-c */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-d */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-e */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-f */ + { ISFUNC, rl_abort }, /* Control-g */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-h */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-i */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-j */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-k */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-l */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-m */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-n */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-o */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-p */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-q */ + { ISFUNC, rl_re_read_init_file }, /* Control-r */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-s */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-t */ + { ISFUNC, rl_undo_command }, /* Control-u */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-v */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-w */ + { ISFUNC, rl_exchange_point_and_mark }, /* Control-x */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-y */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-z */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-[ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-\ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-] */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-^ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-_ */ + + /* The start of printing characters. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* SPACE */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ! */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* " */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* # */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* $ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* % */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* & */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ' */ + { ISFUNC, rl_start_kbd_macro }, /* ( */ + { ISFUNC, rl_end_kbd_macro }, /* ) */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* * */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* + */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* , */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* - */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* . */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* / */ + + /* Regular digits. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* 0 */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* 1 */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* 2 */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* 3 */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* 4 */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* 5 */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* 6 */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* 7 */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* 8 */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* 9 */ + + /* A little more punctuation. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* : */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ; */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* < */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* = */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* > */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ? */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* @ */ + + /* Uppercase alphabet. */ + { ISFUNC, rl_do_lowercase_version }, /* A */ + { ISFUNC, rl_do_lowercase_version }, /* B */ + { ISFUNC, rl_do_lowercase_version }, /* C */ + { ISFUNC, rl_do_lowercase_version }, /* D */ + { ISFUNC, rl_do_lowercase_version }, /* E */ + { ISFUNC, rl_do_lowercase_version }, /* F */ + { ISFUNC, rl_do_lowercase_version }, /* G */ + { ISFUNC, rl_do_lowercase_version }, /* H */ + { ISFUNC, rl_do_lowercase_version }, /* I */ + { ISFUNC, rl_do_lowercase_version }, /* J */ + { ISFUNC, rl_do_lowercase_version }, /* K */ + { ISFUNC, rl_do_lowercase_version }, /* L */ + { ISFUNC, rl_do_lowercase_version }, /* M */ + { ISFUNC, rl_do_lowercase_version }, /* N */ + { ISFUNC, rl_do_lowercase_version }, /* O */ + { ISFUNC, rl_do_lowercase_version }, /* P */ + { ISFUNC, rl_do_lowercase_version }, /* Q */ + { ISFUNC, rl_do_lowercase_version }, /* R */ + { ISFUNC, rl_do_lowercase_version }, /* S */ + { ISFUNC, rl_do_lowercase_version }, /* T */ + { ISFUNC, rl_do_lowercase_version }, /* U */ + { ISFUNC, rl_do_lowercase_version }, /* V */ + { ISFUNC, rl_do_lowercase_version }, /* W */ + { ISFUNC, rl_do_lowercase_version }, /* X */ + { ISFUNC, rl_do_lowercase_version }, /* Y */ + { ISFUNC, rl_do_lowercase_version }, /* Z */ + + /* Some more punctuation. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* [ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* \ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ] */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ^ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* _ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ` */ + + /* Lowercase alphabet. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* a */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* b */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* c */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* d */ + { ISFUNC, rl_call_last_kbd_macro }, /* e */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* f */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* g */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* h */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* i */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* j */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* k */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* l */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* m */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* n */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* o */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* p */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* q */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* r */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* s */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* t */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* u */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* v */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* w */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* x */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* y */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* z */ + + /* Final punctuation. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* { */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* | */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* } */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ~ */ + { ISFUNC, rl_backward_kill_line }, /* RUBOUT */ + +#if KEYMAP_SIZE > 128 + /* Undefined keys. */ + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 } +#endif /* KEYMAP_SIZE > 128 */ +}; diff --git a/lib/readline/examples/Inputrc b/lib/readline/examples/Inputrc new file mode 100644 index 0000000..a358bc4 --- /dev/null +++ b/lib/readline/examples/Inputrc @@ -0,0 +1,81 @@ +# My ~/.inputrc file is in -*- text -*- for easy editing with Emacs. +# +# Notice the various bindings which are conditionalized depending +# on which program is running, or what terminal is active. +# + +# Copyright (C) 1989-2009 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# In all programs, all terminals, make sure this is bound. +"\C-x\C-r": re-read-init-file + +# Hp terminals (and some others) have ugly default behaviour for C-h. +"\C-h": backward-delete-char +"\e\C-h": backward-kill-word +"\C-xd": dump-functions + +# In xterm windows, make the arrow keys do the right thing. +$if TERM=xterm +"\e[A": previous-history +"\e[B": next-history +"\e[C": forward-char +"\e[D": backward-char + +# alternate arrow key prefix +"\eOA": previous-history +"\eOB": next-history +"\eOC": forward-char +"\eOD": backward-char + +# Under Xterm in Bash, we bind local Function keys to do something useful. +$if Bash +"\e[11~": "Function Key 1" +"\e[12~": "Function Key 2" +"\e[13~": "Function Key 3" +"\e[14~": "Function Key 4" +"\e[15~": "Function Key 5" + +# I know the following escape sequence numbers are 1 greater than +# the function key. Don't ask me why, I didn't design the xterm terminal. +"\e[17~": "Function Key 6" +"\e[18~": "Function Key 7" +"\e[19~": "Function Key 8" +"\e[20~": "Function Key 9" +"\e[21~": "Function Key 10" +$endif +$endif + +# For Bash, all terminals, add some Bash specific hacks. +$if Bash +"\C-xv": show-bash-version +"\C-x\C-e": shell-expand-line + +# Here is one for editing my path. +"\C-xp": "$PATH\C-x\C-e\C-e\"\C-aPATH=\":\C-b" + +# Make C-x r read my mail in emacs. +# "\C-xr": "emacs -f rmail\C-j" +$endif + +# For FTP, different hacks: +$if Ftp +"\C-xg": "get \M-?" +"\C-xt": "put \M-?" +"\M-.": yank-last-arg +$endif + +" ": self-insert diff --git a/lib/readline/examples/Makefile b/lib/readline/examples/Makefile new file mode 100644 index 0000000..2df2240 --- /dev/null +++ b/lib/readline/examples/Makefile @@ -0,0 +1,44 @@ +# This is the Makefile for the examples subdirectory of readline. -*- text -*- +# +# Copyright (C) 1994 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +EXECUTABLES = fileman rltest rl +CFLAGS = -g -I../.. -I.. -DREADLINE_LIBRARY +LDFLAGS = -g -L.. + +.c.o: + $(CC) $(CFLAGS) -c $< + +all: $(EXECUTABLES) + + +rl: rl.o + $(CC) $(LDFLAGS) -o $@ rl.o -lreadline -ltermcap + +fileman: fileman.o + $(CC) $(LDFLAGS) -o $@ fileman.o -lreadline -ltermcap + +rltest: rltest.o + $(CC) $(LDFLAGS) -o $@ rltest.o -lreadline -ltermcap + +rlcat: rlcat.o + $(CC) $(LDFLAGS) -o $@ rlcat.o -lreadline -ltermcap + +fileman.o: fileman.c +rltest.o: rltest.c +rl.o: rl.c +rlcat.o: rlcat.c diff --git a/lib/readline/examples/excallback.c b/lib/readline/examples/excallback.c new file mode 100644 index 0000000..4206acf --- /dev/null +++ b/lib/readline/examples/excallback.c @@ -0,0 +1,196 @@ +/* +From: Jeff Solomon +Date: Fri, 9 Apr 1999 10:13:27 -0700 (PDT) +To: chet@po.cwru.edu +Subject: new readline example +Message-ID: <14094.12094.527305.199695@mrclean.Stanford.EDU> + +Chet, + +I've been using readline 4.0. Specifically, I've been using the perl +version Term::ReadLine::Gnu. It works great. + +Anyway, I've been playing around the alternate interface and I wanted +to contribute a little C program, callback.c, to you that you could +use as an example of the alternate interface in the /examples +directory of the readline distribution. + +My example shows how, using the alternate interface, you can +interactively change the prompt (which is very nice imo). Also, I +point out that you must roll your own terminal setting when using the +alternate interface because readline depreps (using your parlance) the +terminal while in the user callback. I try to demostrate what I mean +with an example. I've included the program below. + +To compile, I just put the program in the examples directory and made +the appropriate changes to the EXECUTABLES and OBJECTS line and added +an additional target 'callback'. + +I compiled on my Sun Solaris2.6 box using Sun's cc. + +Let me know what you think. + +Jeff +*/ +/* +Copyright (C) 1999 Jeff Solomon +*/ + +#if defined (HAVE_CONFIG_H) +#include +#endif + +#include + +#ifdef HAVE_UNISTD_H +#include +#endif +#include + +#include +#include /* xxx - should make this more general */ + +#ifdef READLINE_LIBRARY +# include "readline.h" +#else +# include +#endif + +#ifndef STDIN_FILENO +# define STDIN_FILENO 0 +#endif + +/* This little examples demonstrates the alternate interface to using readline. + * In the alternate interface, the user maintains control over program flow and + * only calls readline when STDIN is readable. Using the alternate interface, + * you can do anything else while still using readline (like talking to a + * network or another program) without blocking. + * + * Specifically, this program highlights two importants features of the + * alternate interface. The first is the ability to interactively change the + * prompt, which can't be done using the regular interface since rl_prompt is + * read-only. + * + * The second feature really highlights a subtle point when using the alternate + * interface. That is, readline will not alter the terminal when inside your + * callback handler. So let's so, your callback executes a user command that + * takes a non-trivial amount of time to complete (seconds). While your + * executing the command, the user continues to type keystrokes and expects them + * to be re-echoed on the new prompt when it returns. Unfortunately, the default + * terminal configuration doesn't do this. After the prompt returns, the user + * must hit one additional keystroke and then will see all of his previous + * keystrokes. To illustrate this, compile and run this program. Type "sleep" at + * the prompt and then type "bar" before the prompt returns (you have 3 + * seconds). Notice how "bar" is re-echoed on the prompt after the prompt + * returns? This is what you expect to happen. Now comment out the 4 lines below + * the line that says COMMENT LINE BELOW. Recompile and rerun the program and do + * the same thing. When the prompt returns, you should not see "bar". Now type + * "f", see how "barf" magically appears? This behavior is un-expected and not + * desired. + */ + +void process_line(char *line); +int change_prompt(void); +char *get_prompt(void); + +int prompt = 1; +char prompt_buf[40], line_buf[256]; +tcflag_t old_lflag; +cc_t old_vtime; +struct termios term; + +int +main() +{ + fd_set fds; + + /* Adjust the terminal slightly before the handler is installed. Disable + * canonical mode processing and set the input character time flag to be + * non-blocking. + */ + if( tcgetattr(STDIN_FILENO, &term) < 0 ) { + perror("tcgetattr"); + exit(1); + } + old_lflag = term.c_lflag; + old_vtime = term.c_cc[VTIME]; + term.c_lflag &= ~ICANON; + term.c_cc[VTIME] = 1; + /* COMMENT LINE BELOW - see above */ + if( tcsetattr(STDIN_FILENO, TCSANOW, &term) < 0 ) { + perror("tcsetattr"); + exit(1); + } + + rl_add_defun("change-prompt", change_prompt, CTRL('t')); + rl_callback_handler_install(get_prompt(), process_line); + + while(1) { + FD_ZERO(&fds); + FD_SET(fileno(stdin), &fds); + + if( select(FD_SETSIZE, &fds, NULL, NULL, NULL) < 0) { + perror("select"); + exit(1); + } + + if( FD_ISSET(fileno(stdin), &fds) ) { + rl_callback_read_char(); + } + } +} + +void +process_line(char *line) +{ + if( line == NULL ) { + fprintf(stderr, "\n", line); + + /* reset the old terminal setting before exiting */ + term.c_lflag = old_lflag; + term.c_cc[VTIME] = old_vtime; + if( tcsetattr(STDIN_FILENO, TCSANOW, &term) < 0 ) { + perror("tcsetattr"); + exit(1); + } + exit(0); + } + + if( strcmp(line, "sleep") == 0 ) { + sleep(3); + } else { + fprintf(stderr, "|%s|\n", line); + } + + free (line); +} + +int +change_prompt(void) +{ + /* toggle the prompt variable */ + prompt = !prompt; + + /* save away the current contents of the line */ + strcpy(line_buf, rl_line_buffer); + + /* install a new handler which will change the prompt and erase the current line */ + rl_callback_handler_install(get_prompt(), process_line); + + /* insert the old text on the new line */ + rl_insert_text(line_buf); + + /* redraw the current line - this is an undocumented function. It invokes the + * redraw-current-line command. + */ + rl_refresh_line(0, 0); +} + +char * +get_prompt(void) +{ + /* The prompts can even be different lengths! */ + sprintf(prompt_buf, "%s", + prompt ? "Hit ctrl-t to toggle prompt> " : "Pretty cool huh?> "); + return prompt_buf; +} diff --git a/lib/readline/examples/fileman.c b/lib/readline/examples/fileman.c new file mode 100644 index 0000000..f7eed8a --- /dev/null +++ b/lib/readline/examples/fileman.c @@ -0,0 +1,488 @@ +/* fileman.c - file manager example for readline library. */ + +/* Copyright (C) 1987-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library for + reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +/* fileman.c -- A tiny application which demonstrates how to use the + GNU Readline library. This application interactively allows users + to manipulate files and their modes. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#ifdef HAVE_SYS_FILE_H +# include +#endif +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#include +#include +#include + +#if defined (HAVE_STRING_H) +# include +#else /* !HAVE_STRING_H */ +# include +#endif /* !HAVE_STRING_H */ + +#ifdef HAVE_STDLIB_H +# include +#endif + +#include + +#ifdef READLINE_LIBRARY +# include "readline.h" +# include "history.h" +#else +# include +# include +#endif + +extern char *xmalloc PARAMS((size_t)); + +/* The names of functions that actually do the manipulation. */ +int com_list PARAMS((char *)); +int com_view PARAMS((char *)); +int com_rename PARAMS((char *)); +int com_stat PARAMS((char *)); +int com_pwd PARAMS((char *)); +int com_delete PARAMS((char *)); +int com_help PARAMS((char *)); +int com_cd PARAMS((char *)); +int com_quit PARAMS((char *)); + +/* A structure which contains information on the commands this program + can understand. */ + +typedef struct { + char *name; /* User printable name of the function. */ + rl_icpfunc_t *func; /* Function to call to do the job. */ + char *doc; /* Documentation for this function. */ +} COMMAND; + +COMMAND commands[] = { + { "cd", com_cd, "Change to directory DIR" }, + { "delete", com_delete, "Delete FILE" }, + { "help", com_help, "Display this text" }, + { "?", com_help, "Synonym for `help'" }, + { "list", com_list, "List files in DIR" }, + { "ls", com_list, "Synonym for `list'" }, + { "pwd", com_pwd, "Print the current working directory" }, + { "quit", com_quit, "Quit using Fileman" }, + { "rename", com_rename, "Rename FILE to NEWNAME" }, + { "stat", com_stat, "Print out statistics on FILE" }, + { "view", com_view, "View the contents of FILE" }, + { (char *)NULL, (rl_icpfunc_t *)NULL, (char *)NULL } +}; + +/* Forward declarations. */ +char *stripwhite (); +COMMAND *find_command (); + +/* The name of this program, as taken from argv[0]. */ +char *progname; + +/* When non-zero, this global means the user is done using this program. */ +int done; + +char * +dupstr (s) + char *s; +{ + char *r; + + r = xmalloc (strlen (s) + 1); + strcpy (r, s); + return (r); +} + +main (argc, argv) + int argc; + char **argv; +{ + char *line, *s; + + progname = argv[0]; + + initialize_readline (); /* Bind our completer. */ + + /* Loop reading and executing lines until the user quits. */ + for ( ; done == 0; ) + { + line = readline ("FileMan: "); + + if (!line) + break; + + /* Remove leading and trailing whitespace from the line. + Then, if there is anything left, add it to the history list + and execute it. */ + s = stripwhite (line); + + if (*s) + { + add_history (s); + execute_line (s); + } + + free (line); + } + exit (0); +} + +/* Execute a command line. */ +int +execute_line (line) + char *line; +{ + register int i; + COMMAND *command; + char *word; + + /* Isolate the command word. */ + i = 0; + while (line[i] && whitespace (line[i])) + i++; + word = line + i; + + while (line[i] && !whitespace (line[i])) + i++; + + if (line[i]) + line[i++] = '\0'; + + command = find_command (word); + + if (!command) + { + fprintf (stderr, "%s: No such command for FileMan.\n", word); + return (-1); + } + + /* Get argument to command, if any. */ + while (whitespace (line[i])) + i++; + + word = line + i; + + /* Call the function. */ + return ((*(command->func)) (word)); +} + +/* Look up NAME as the name of a command, and return a pointer to that + command. Return a NULL pointer if NAME isn't a command name. */ +COMMAND * +find_command (name) + char *name; +{ + register int i; + + for (i = 0; commands[i].name; i++) + if (strcmp (name, commands[i].name) == 0) + return (&commands[i]); + + return ((COMMAND *)NULL); +} + +/* Strip whitespace from the start and end of STRING. Return a pointer + into STRING. */ +char * +stripwhite (string) + char *string; +{ + register char *s, *t; + + for (s = string; whitespace (*s); s++) + ; + + if (*s == 0) + return (s); + + t = s + strlen (s) - 1; + while (t > s && whitespace (*t)) + t--; + *++t = '\0'; + + return s; +} + +/* **************************************************************** */ +/* */ +/* Interface to Readline Completion */ +/* */ +/* **************************************************************** */ + +char *command_generator PARAMS((const char *, int)); +char **fileman_completion PARAMS((const char *, int, int)); + +/* Tell the GNU Readline library how to complete. We want to try to complete + on command names if this is the first word in the line, or on filenames + if not. */ +initialize_readline () +{ + /* Allow conditional parsing of the ~/.inputrc file. */ + rl_readline_name = "FileMan"; + + /* Tell the completer that we want a crack first. */ + rl_attempted_completion_function = fileman_completion; +} + +/* Attempt to complete on the contents of TEXT. START and END bound the + region of rl_line_buffer that contains the word to complete. TEXT is + the word to complete. We can use the entire contents of rl_line_buffer + in case we want to do some simple parsing. Return the array of matches, + or NULL if there aren't any. */ +char ** +fileman_completion (text, start, end) + const char *text; + int start, end; +{ + char **matches; + + matches = (char **)NULL; + + /* If this word is at the start of the line, then it is a command + to complete. Otherwise it is the name of a file in the current + directory. */ + if (start == 0) + matches = rl_completion_matches (text, command_generator); + + return (matches); +} + +/* Generator function for command completion. STATE lets us know whether + to start from scratch; without any state (i.e. STATE == 0), then we + start at the top of the list. */ +char * +command_generator (text, state) + const char *text; + int state; +{ + static int list_index, len; + char *name; + + /* If this is a new word to complete, initialize now. This includes + saving the length of TEXT for efficiency, and initializing the index + variable to 0. */ + if (!state) + { + list_index = 0; + len = strlen (text); + } + + /* Return the next name which partially matches from the command list. */ + while (name = commands[list_index].name) + { + list_index++; + + if (strncmp (name, text, len) == 0) + return (dupstr(name)); + } + + /* If no names matched, then return NULL. */ + return ((char *)NULL); +} + +/* **************************************************************** */ +/* */ +/* FileMan Commands */ +/* */ +/* **************************************************************** */ + +/* String to pass to system (). This is for the LIST, VIEW and RENAME + commands. */ +static char syscom[1024]; + +/* List the file(s) named in arg. */ +com_list (arg) + char *arg; +{ + if (!arg) + arg = ""; + + sprintf (syscom, "ls -FClg %s", arg); + return (system (syscom)); +} + +com_view (arg) + char *arg; +{ + if (!valid_argument ("view", arg)) + return 1; + +#if defined (__MSDOS__) + /* more.com doesn't grok slashes in pathnames */ + sprintf (syscom, "less %s", arg); +#else + sprintf (syscom, "more %s", arg); +#endif + return (system (syscom)); +} + +com_rename (arg) + char *arg; +{ + too_dangerous ("rename"); + return (1); +} + +com_stat (arg) + char *arg; +{ + struct stat finfo; + + if (!valid_argument ("stat", arg)) + return (1); + + if (stat (arg, &finfo) == -1) + { + perror (arg); + return (1); + } + + printf ("Statistics for `%s':\n", arg); + + printf ("%s has %d link%s, and is %d byte%s in length.\n", + arg, + finfo.st_nlink, + (finfo.st_nlink == 1) ? "" : "s", + finfo.st_size, + (finfo.st_size == 1) ? "" : "s"); + printf ("Inode Last Change at: %s", ctime (&finfo.st_ctime)); + printf (" Last access at: %s", ctime (&finfo.st_atime)); + printf (" Last modified at: %s", ctime (&finfo.st_mtime)); + return (0); +} + +com_delete (arg) + char *arg; +{ + too_dangerous ("delete"); + return (1); +} + +/* Print out help for ARG, or for all of the commands if ARG is + not present. */ +com_help (arg) + char *arg; +{ + register int i; + int printed = 0; + + for (i = 0; commands[i].name; i++) + { + if (!*arg || (strcmp (arg, commands[i].name) == 0)) + { + printf ("%s\t\t%s.\n", commands[i].name, commands[i].doc); + printed++; + } + } + + if (!printed) + { + printf ("No commands match `%s'. Possibilties are:\n", arg); + + for (i = 0; commands[i].name; i++) + { + /* Print in six columns. */ + if (printed == 6) + { + printed = 0; + printf ("\n"); + } + + printf ("%s\t", commands[i].name); + printed++; + } + + if (printed) + printf ("\n"); + } + return (0); +} + +/* Change to the directory ARG. */ +com_cd (arg) + char *arg; +{ + if (chdir (arg) == -1) + { + perror (arg); + return 1; + } + + com_pwd (""); + return (0); +} + +/* Print out the current working directory. */ +com_pwd (ignore) + char *ignore; +{ + char dir[1024], *s; + + s = getcwd (dir, sizeof(dir) - 1); + if (s == 0) + { + printf ("Error getting pwd: %s\n", dir); + return 1; + } + + printf ("Current directory is %s\n", dir); + return 0; +} + +/* The user wishes to quit using this program. Just set DONE non-zero. */ +com_quit (arg) + char *arg; +{ + done = 1; + return (0); +} + +/* Function which tells you that you can't do this. */ +too_dangerous (caller) + char *caller; +{ + fprintf (stderr, + "%s: Too dangerous for me to distribute. Write it yourself.\n", + caller); +} + +/* Return non-zero if ARG is a valid argument for CALLER, else print + an error message and return zero. */ +int +valid_argument (caller, arg) + char *caller, *arg; +{ + if (!arg || !*arg) + { + fprintf (stderr, "%s: Argument required.\n", caller); + return (0); + } + + return (1); +} diff --git a/lib/readline/examples/histexamp.c b/lib/readline/examples/histexamp.c new file mode 100644 index 0000000..3b43674 --- /dev/null +++ b/lib/readline/examples/histexamp.c @@ -0,0 +1,125 @@ +/* histexamp.c - history library example program. */ + +/* Copyright (C) 1987-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library for + reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#include + +#ifdef READLINE_LIBRARY +# include "history.h" +#else +# include +#endif + +#include + +main (argc, argv) + int argc; + char **argv; +{ + char line[1024], *t; + int len, done; + + line[0] = 0; + done = 0; + + using_history (); + while (!done) + { + printf ("history$ "); + fflush (stdout); + t = fgets (line, sizeof (line) - 1, stdin); + if (t && *t) + { + len = strlen (t); + if (t[len - 1] == '\n') + t[len - 1] = '\0'; + } + + if (!t) + strcpy (line, "quit"); + + if (line[0]) + { + char *expansion; + int result; + + using_history (); + + result = history_expand (line, &expansion); + if (result) + fprintf (stderr, "%s\n", expansion); + + if (result < 0 || result == 2) + { + free (expansion); + continue; + } + + add_history (expansion); + strncpy (line, expansion, sizeof (line) - 1); + free (expansion); + } + + if (strcmp (line, "quit") == 0) + done = 1; + else if (strcmp (line, "save") == 0) + write_history ("history_file"); + else if (strcmp (line, "read") == 0) + read_history ("history_file"); + else if (strcmp (line, "list") == 0) + { + register HIST_ENTRY **the_list; + register int i; + time_t tt; + char timestr[128]; + + the_list = history_list (); + if (the_list) + for (i = 0; the_list[i]; i++) + { + tt = history_get_time (the_list[i]); + if (tt) + strftime (timestr, sizeof (timestr), "%a %R", localtime(&tt)); + else + strcpy (timestr, "??"); + printf ("%d: %s: %s\n", i + history_base, timestr, the_list[i]->line); + } + } + else if (strncmp (line, "delete", 6) == 0) + { + int which; + if ((sscanf (line + 6, "%d", &which)) == 1) + { + HIST_ENTRY *entry = remove_history (which); + if (!entry) + fprintf (stderr, "No such entry %d\n", which); + else + { + free (entry->line); + free (entry); + } + } + else + { + fprintf (stderr, "non-numeric arg given to `delete'\n"); + } + } + } +} diff --git a/lib/readline/examples/manexamp.c b/lib/readline/examples/manexamp.c new file mode 100644 index 0000000..351c628 --- /dev/null +++ b/lib/readline/examples/manexamp.c @@ -0,0 +1,111 @@ +/* manexamp.c -- The examples which appear in the documentation are here. */ + +/* Copyright (C) 1987-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library for + reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#include +#include + +/* **************************************************************** */ +/* */ +/* How to Emulate gets () */ +/* */ +/* **************************************************************** */ + +/* A static variable for holding the line. */ +static char *line_read = (char *)NULL; + +/* Read a string, and return a pointer to it. Returns NULL on EOF. */ +char * +rl_gets () +{ + /* If the buffer has already been allocated, return the memory + to the free pool. */ + if (line_read) + { + free (line_read); + line_read = (char *)NULL; + } + + /* Get a line from the user. */ + line_read = readline (""); + + /* If the line has any text in it, save it on the history. */ + if (line_read && *line_read) + add_history (line_read); + + return (line_read); +} + +/* **************************************************************** */ +/* */ +/* Writing a Function to be Called by Readline. */ +/* */ +/* **************************************************************** */ + +/* Invert the case of the COUNT following characters. */ +invert_case_line (count, key) + int count, key; +{ + register int start, end; + + start = rl_point; + + if (count < 0) + { + direction = -1; + count = -count; + } + else + direction = 1; + + /* Find the end of the range to modify. */ + end = start + (count * direction); + + /* Force it to be within range. */ + if (end > rl_end) + end = rl_end; + else if (end < 0) + end = -1; + + if (start > end) + { + int temp = start; + start = end; + end = temp; + } + + if (start == end) + return; + + /* Tell readline that we are modifying the line, so save the undo + information. */ + rl_modifying (start, end); + + for (; start != end; start += direction) + { + if (_rl_uppercase_p (rl_line_buffer[start])) + rl_line_buffer[start] = _rl_to_lower (rl_line_buffer[start]); + else if (_rl_lowercase_p (rl_line_buffer[start])) + rl_line_buffer[start] = _rl_to_upper (rl_line_buffer[start]); + } + + /* Move point to on top of the last character changed. */ + rl_point = end - direction; +} diff --git a/lib/readline/examples/rl-callbacktest.c b/lib/readline/examples/rl-callbacktest.c new file mode 100644 index 0000000..a7e451c --- /dev/null +++ b/lib/readline/examples/rl-callbacktest.c @@ -0,0 +1,81 @@ +/* Standard include files. stdio.h is required. */ +#include +#include + +/* Used for select(2) */ +#include +#include + +#include + +/* Standard readline include files. */ +#include +#include + +static void cb_linehandler (char *); + +int running; +const char *prompt = "rltest$ "; + +/* Callback function called for each line when accept-line executed, EOF + seen, or EOF character read. This sets a flag and returns; it could + also call exit(3). */ +static void +cb_linehandler (char *line) +{ + /* Can use ^D (stty eof) or `exit' to exit. */ + if (line == NULL || strcmp (line, "exit") == 0) + { + if (line == 0) + printf ("\n"); + printf ("exit\n"); + /* This function needs to be called to reset the terminal settings, + and calling it from the line handler keeps one extra prompt from + being displayed. */ + rl_callback_handler_remove (); + + running = 0; + } + else + { + if (*line) + add_history (line); + printf ("input line: %s\n", line); + free (line); + } +} + +int +main (int c, char **v) +{ + fd_set fds; + int r; + + /* Install the line handler. */ + rl_callback_handler_install (prompt, cb_linehandler); + + /* Enter a simple event loop. This waits until something is available + to read on readline's input stream (defaults to standard input) and + calls the builtin character read callback to read it. It does not + have to modify the user's terminal settings. */ + running = 1; + while (running) + { + FD_ZERO (&fds); + FD_SET (fileno (rl_instream), &fds); + + r = select (FD_SETSIZE, &fds, NULL, NULL, NULL); + if (r < 0) + { + perror ("rltest: select"); + rl_callback_handler_remove (); + break; + } + + if (FD_ISSET (fileno (rl_instream), &fds)) + rl_callback_read_char (); + } + + printf ("rltest: Event loop has exited\n"); + return 0; +} diff --git a/lib/readline/examples/rl.c b/lib/readline/examples/rl.c new file mode 100644 index 0000000..845a4b1 --- /dev/null +++ b/lib/readline/examples/rl.c @@ -0,0 +1,157 @@ +/* + * rl - command-line interface to read a line from the standard input + * (or another fd) using readline. + * + * usage: rl [-p prompt] [-u unit] [-d default] [-n nchars] + */ + +/* Copyright (C) 1987-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library for + reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include +#include + +#ifdef HAVE_STDLIB_H +# include +#else +extern void exit(); +#endif + +#if defined (READLINE_LIBRARY) +# include "posixstat.h" +# include "readline.h" +# include "history.h" +#else +# include +# include +# include +#endif + +extern int optind; +extern char *optarg; + +#if !defined (strchr) && !defined (__STDC__) +extern char *strrchr(); +#endif + +static char *progname; +static char *deftext; + +static int +set_deftext () +{ + if (deftext) + { + rl_insert_text (deftext); + deftext = (char *)NULL; + rl_startup_hook = (rl_hook_func_t *)NULL; + } + return 0; +} + +static void +usage() +{ + fprintf (stderr, "%s: usage: %s [-p prompt] [-u unit] [-d default] [-n nchars]\n", + progname, progname); +} + +int +main (argc, argv) + int argc; + char **argv; +{ + char *temp, *prompt; + struct stat sb; + int opt, fd, nch; + FILE *ifp; + + progname = strrchr(argv[0], '/'); + if (progname == 0) + progname = argv[0]; + else + progname++; + + /* defaults */ + prompt = "readline$ "; + fd = nch = 0; + deftext = (char *)0; + + while ((opt = getopt(argc, argv, "p:u:d:n:")) != EOF) + { + switch (opt) + { + case 'p': + prompt = optarg; + break; + case 'u': + fd = atoi(optarg); + if (fd < 0) + { + fprintf (stderr, "%s: bad file descriptor `%s'\n", progname, optarg); + exit (2); + } + break; + case 'd': + deftext = optarg; + break; + case 'n': + nch = atoi(optarg); + if (nch < 0) + { + fprintf (stderr, "%s: bad value for -n: `%s'\n", progname, optarg); + exit (2); + } + break; + default: + usage (); + exit (2); + } + } + + if (fd != 0) + { + if (fstat (fd, &sb) < 0) + { + fprintf (stderr, "%s: %d: bad file descriptor\n", progname, fd); + exit (1); + } + ifp = fdopen (fd, "r"); + rl_instream = ifp; + } + + if (deftext && *deftext) + rl_startup_hook = set_deftext; + + if (nch > 0) + rl_num_chars_to_read = nch; + + temp = readline (prompt); + + /* Test for EOF. */ + if (temp == 0) + exit (1); + + printf ("%s\n", temp); + exit (0); +} diff --git a/lib/readline/examples/rlcat.c b/lib/readline/examples/rlcat.c new file mode 100644 index 0000000..fa9e06f --- /dev/null +++ b/lib/readline/examples/rlcat.c @@ -0,0 +1,179 @@ +/* + * rlcat - cat(1) using readline + * + * usage: rlcat + */ + +/* Copyright (C) 1987-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library for + reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#ifdef HAVE_UNISTD_H +# include +#endif + +#include +#include "posixstat.h" + +#include +#include +#include +#include + +#ifdef HAVE_STDLIB_H +# include +#else +extern void exit(); +#endif + +#ifndef errno +extern int errno; +#endif + +#if defined (READLINE_LIBRARY) +# include "readline.h" +# include "history.h" +#else +# include +# include +#endif + +extern int optind; +extern char *optarg; + +static int stdcat(); + +static char *progname; +static int vflag; + +static void +usage() +{ + fprintf (stderr, "%s: usage: %s [-vEVN] [filename]\n", progname, progname); +} + +int +main (argc, argv) + int argc; + char **argv; +{ + char *temp; + int opt, Vflag, Nflag; + + progname = strrchr(argv[0], '/'); + if (progname == 0) + progname = argv[0]; + else + progname++; + + vflag = Vflag = Nflag = 0; + while ((opt = getopt(argc, argv, "vEVN")) != EOF) + { + switch (opt) + { + case 'v': + vflag = 1; + break; + case 'V': + Vflag = 1; + break; + case 'E': + Vflag = 0; + break; + case 'N': + Nflag = 1; + break; + default: + usage (); + exit (2); + } + } + + argc -= optind; + argv += optind; + + if (isatty(0) == 0 || argc || Nflag) + return stdcat(argc, argv); + + rl_variable_bind ("editing-mode", Vflag ? "vi" : "emacs"); + while (temp = readline ("")) + { + if (*temp) + add_history (temp); + printf ("%s\n", temp); + } + + return (ferror (stdout)); +} + +static int +fcopy(fp) + FILE *fp; +{ + int c; + char *x; + + while ((c = getc(fp)) != EOF) + { + if (vflag && isascii ((unsigned char)c) && isprint((unsigned char)c) == 0) + { + x = rl_untranslate_keyseq (c); + if (fputs (x, stdout) != 0) + return 1; + } + else if (putchar (c) == EOF) + return 1; + } + return (ferror (stdout)); +} + +int +stdcat (argc, argv) + int argc; + char **argv; +{ + int i, fd, r; + char *s; + FILE *fp; + + if (argc == 0) + return (fcopy(stdin)); + + for (i = 0, r = 1; i < argc; i++) + { + if (*argv[i] == '-' && argv[i][1] == 0) + fp = stdin; + else + { + fp = fopen (argv[i], "r"); + if (fp == 0) + { + fprintf (stderr, "%s: %s: cannot open: %s\n", progname, argv[i], strerror(errno)); + continue; + } + } + r = fcopy (fp); + if (fp != stdin) + fclose(fp); + } + return r; +} diff --git a/lib/readline/examples/rltest.c b/lib/readline/examples/rltest.c new file mode 100644 index 0000000..78e2608 --- /dev/null +++ b/lib/readline/examples/rltest.c @@ -0,0 +1,92 @@ +/* **************************************************************** */ +/* */ +/* Testing Readline */ +/* */ +/* **************************************************************** */ + +/* Copyright (C) 1987-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library for + reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if defined (HAVE_CONFIG_H) +#include +#endif + +#include +#include + +#ifdef HAVE_STDLIB_H +# include +#else +extern void exit(); +#endif + +#ifdef READLINE_LIBRARY +# include "readline.h" +# include "history.h" +#else +# include +# include +#endif + +extern HIST_ENTRY **history_list (); + +main () +{ + char *temp, *prompt; + int done; + + temp = (char *)NULL; + prompt = "readline$ "; + done = 0; + + while (!done) + { + temp = readline (prompt); + + /* Test for EOF. */ + if (!temp) + exit (1); + + /* If there is anything on the line, print it and remember it. */ + if (*temp) + { + fprintf (stderr, "%s\r\n", temp); + add_history (temp); + } + + /* Check for `command' that we handle. */ + if (strcmp (temp, "quit") == 0) + done = 1; + + if (strcmp (temp, "list") == 0) + { + HIST_ENTRY **list; + register int i; + + list = history_list (); + if (list) + { + for (i = 0; list[i]; i++) + fprintf (stderr, "%d: %s\r\n", i, list[i]->line); + } + } + free (temp); + } + exit (0); +} diff --git a/lib/readline/funmap.c b/lib/readline/funmap.c new file mode 100644 index 0000000..363507b --- /dev/null +++ b/lib/readline/funmap.c @@ -0,0 +1,266 @@ +/* funmap.c -- attach names to functions. */ + +/* Copyright (C) 1987-2010 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#if !defined (BUFSIZ) +#include +#endif /* BUFSIZ */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include "rlconf.h" +#include "readline.h" + +#include "xmalloc.h" + +#ifdef __STDC__ +typedef int QSFUNC (const void *, const void *); +#else +typedef int QSFUNC (); +#endif + +extern int _rl_qsort_string_compare PARAMS((char **, char **)); + +FUNMAP **funmap; +static int funmap_size; +static int funmap_entry; + +/* After initializing the function map, this is the index of the first + program specific function. */ +int funmap_program_specific_entry_start; + +static const FUNMAP default_funmap[] = { + { "abort", rl_abort }, + { "accept-line", rl_newline }, + { "arrow-key-prefix", rl_arrow_keys }, + { "backward-byte", rl_backward_byte }, + { "backward-char", rl_backward_char }, + { "backward-delete-char", rl_rubout }, + { "backward-kill-line", rl_backward_kill_line }, + { "backward-kill-word", rl_backward_kill_word }, + { "backward-word", rl_backward_word }, + { "beginning-of-history", rl_beginning_of_history }, + { "beginning-of-line", rl_beg_of_line }, + { "call-last-kbd-macro", rl_call_last_kbd_macro }, + { "capitalize-word", rl_capitalize_word }, + { "character-search", rl_char_search }, + { "character-search-backward", rl_backward_char_search }, + { "clear-screen", rl_clear_screen }, + { "complete", rl_complete }, + { "copy-backward-word", rl_copy_backward_word }, + { "copy-forward-word", rl_copy_forward_word }, + { "copy-region-as-kill", rl_copy_region_to_kill }, + { "delete-char", rl_delete }, + { "delete-char-or-list", rl_delete_or_show_completions }, + { "delete-horizontal-space", rl_delete_horizontal_space }, + { "digit-argument", rl_digit_argument }, + { "do-lowercase-version", rl_do_lowercase_version }, + { "downcase-word", rl_downcase_word }, + { "dump-functions", rl_dump_functions }, + { "dump-macros", rl_dump_macros }, + { "dump-variables", rl_dump_variables }, + { "emacs-editing-mode", rl_emacs_editing_mode }, + { "end-kbd-macro", rl_end_kbd_macro }, + { "end-of-history", rl_end_of_history }, + { "end-of-line", rl_end_of_line }, + { "exchange-point-and-mark", rl_exchange_point_and_mark }, + { "forward-backward-delete-char", rl_rubout_or_delete }, + { "forward-byte", rl_forward_byte }, + { "forward-char", rl_forward_char }, + { "forward-search-history", rl_forward_search_history }, + { "forward-word", rl_forward_word }, + { "history-search-backward", rl_history_search_backward }, + { "history-search-forward", rl_history_search_forward }, + { "history-substring-search-backward", rl_history_substr_search_backward }, + { "history-substring-search-forward", rl_history_substr_search_forward }, + { "insert-comment", rl_insert_comment }, + { "insert-completions", rl_insert_completions }, + { "kill-whole-line", rl_kill_full_line }, + { "kill-line", rl_kill_line }, + { "kill-region", rl_kill_region }, + { "kill-word", rl_kill_word }, + { "menu-complete", rl_menu_complete }, + { "menu-complete-backward", rl_backward_menu_complete }, + { "next-history", rl_get_next_history }, + { "non-incremental-forward-search-history", rl_noninc_forward_search }, + { "non-incremental-reverse-search-history", rl_noninc_reverse_search }, + { "non-incremental-forward-search-history-again", rl_noninc_forward_search_again }, + { "non-incremental-reverse-search-history-again", rl_noninc_reverse_search_again }, + { "old-menu-complete", rl_old_menu_complete }, + { "overwrite-mode", rl_overwrite_mode }, +#ifdef __CYGWIN__ + { "paste-from-clipboard", rl_paste_from_clipboard }, +#endif + { "possible-completions", rl_possible_completions }, + { "previous-history", rl_get_previous_history }, + { "print-last-kbd-macro", rl_print_last_kbd_macro }, + { "quoted-insert", rl_quoted_insert }, + { "re-read-init-file", rl_re_read_init_file }, + { "redraw-current-line", rl_refresh_line}, + { "reverse-search-history", rl_reverse_search_history }, + { "revert-line", rl_revert_line }, + { "self-insert", rl_insert }, + { "set-mark", rl_set_mark }, + { "skip-csi-sequence", rl_skip_csi_sequence }, + { "start-kbd-macro", rl_start_kbd_macro }, + { "tab-insert", rl_tab_insert }, + { "tilde-expand", rl_tilde_expand }, + { "transpose-chars", rl_transpose_chars }, + { "transpose-words", rl_transpose_words }, + { "tty-status", rl_tty_status }, + { "undo", rl_undo_command }, + { "universal-argument", rl_universal_argument }, + { "unix-filename-rubout", rl_unix_filename_rubout }, + { "unix-line-discard", rl_unix_line_discard }, + { "unix-word-rubout", rl_unix_word_rubout }, + { "upcase-word", rl_upcase_word }, + { "yank", rl_yank }, + { "yank-last-arg", rl_yank_last_arg }, + { "yank-nth-arg", rl_yank_nth_arg }, + { "yank-pop", rl_yank_pop }, + +#if defined (VI_MODE) + { "vi-append-eol", rl_vi_append_eol }, + { "vi-append-mode", rl_vi_append_mode }, + { "vi-arg-digit", rl_vi_arg_digit }, + { "vi-back-to-indent", rl_vi_back_to_indent }, + { "vi-backward-bigword", rl_vi_bWord }, + { "vi-backward-word", rl_vi_bword }, + { "vi-bWord", rl_vi_bWord }, + { "vi-bword", rl_vi_bword }, + { "vi-change-case", rl_vi_change_case }, + { "vi-change-char", rl_vi_change_char }, + { "vi-change-to", rl_vi_change_to }, + { "vi-char-search", rl_vi_char_search }, + { "vi-column", rl_vi_column }, + { "vi-complete", rl_vi_complete }, + { "vi-delete", rl_vi_delete }, + { "vi-delete-to", rl_vi_delete_to }, + { "vi-eWord", rl_vi_eWord }, + { "vi-editing-mode", rl_vi_editing_mode }, + { "vi-end-bigword", rl_vi_eWord }, + { "vi-end-word", rl_vi_end_word }, + { "vi-eof-maybe", rl_vi_eof_maybe }, + { "vi-eword", rl_vi_eword }, + { "vi-fWord", rl_vi_fWord }, + { "vi-fetch-history", rl_vi_fetch_history }, + { "vi-first-print", rl_vi_first_print }, + { "vi-forward-bigword", rl_vi_fWord }, + { "vi-forward-word", rl_vi_fword }, + { "vi-fword", rl_vi_fword }, + { "vi-goto-mark", rl_vi_goto_mark }, + { "vi-insert-beg", rl_vi_insert_beg }, + { "vi-insertion-mode", rl_vi_insertion_mode }, + { "vi-match", rl_vi_match }, + { "vi-movement-mode", rl_vi_movement_mode }, + { "vi-next-word", rl_vi_next_word }, + { "vi-overstrike", rl_vi_overstrike }, + { "vi-overstrike-delete", rl_vi_overstrike_delete }, + { "vi-prev-word", rl_vi_prev_word }, + { "vi-put", rl_vi_put }, + { "vi-redo", rl_vi_redo }, + { "vi-replace", rl_vi_replace }, + { "vi-rubout", rl_vi_rubout }, + { "vi-search", rl_vi_search }, + { "vi-search-again", rl_vi_search_again }, + { "vi-set-mark", rl_vi_set_mark }, + { "vi-subst", rl_vi_subst }, + { "vi-tilde-expand", rl_vi_tilde_expand }, + { "vi-yank-arg", rl_vi_yank_arg }, + { "vi-yank-to", rl_vi_yank_to }, +#endif /* VI_MODE */ + + {(char *)NULL, (rl_command_func_t *)NULL } +}; + +int +rl_add_funmap_entry (name, function) + const char *name; + rl_command_func_t *function; +{ + if (funmap_entry + 2 >= funmap_size) + { + funmap_size += 64; + funmap = (FUNMAP **)xrealloc (funmap, funmap_size * sizeof (FUNMAP *)); + } + + funmap[funmap_entry] = (FUNMAP *)xmalloc (sizeof (FUNMAP)); + funmap[funmap_entry]->name = name; + funmap[funmap_entry]->function = function; + + funmap[++funmap_entry] = (FUNMAP *)NULL; + return funmap_entry; +} + +static int funmap_initialized; + +/* Make the funmap contain all of the default entries. */ +void +rl_initialize_funmap () +{ + register int i; + + if (funmap_initialized) + return; + + for (i = 0; default_funmap[i].name; i++) + rl_add_funmap_entry (default_funmap[i].name, default_funmap[i].function); + + funmap_initialized = 1; + funmap_program_specific_entry_start = i; +} + +/* Produce a NULL terminated array of known function names. The array + is sorted. The array itself is allocated, but not the strings inside. + You should free () the array when you done, but not the pointers. */ +const char ** +rl_funmap_names () +{ + const char **result; + int result_size, result_index; + + /* Make sure that the function map has been initialized. */ + rl_initialize_funmap (); + + for (result_index = result_size = 0, result = (const char **)NULL; funmap[result_index]; result_index++) + { + if (result_index + 2 > result_size) + { + result_size += 20; + result = (const char **)xrealloc (result, result_size * sizeof (char *)); + } + + result[result_index] = funmap[result_index]->name; + result[result_index + 1] = (char *)NULL; + } + + qsort (result, result_index, sizeof (char *), (QSFUNC *)_rl_qsort_string_compare); + return (result); +} diff --git a/lib/readline/histexpand.c b/lib/readline/histexpand.c new file mode 100644 index 0000000..4899b9d --- /dev/null +++ b/lib/readline/histexpand.c @@ -0,0 +1,1658 @@ +/* histexpand.c -- history expansion. */ + +/* Copyright (C) 1989-2012 Free Software Foundation, Inc. + + This file contains the GNU History Library (History), a set of + routines for managing the text of previously typed lines. + + History is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + History is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with History. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#if defined (HAVE_UNISTD_H) +# ifndef _MINIX +# include +# endif +# include +#endif + +#include "rlmbutil.h" + +#include "history.h" +#include "histlib.h" + +#include "rlshell.h" +#include "xmalloc.h" + +#define HISTORY_WORD_DELIMITERS " \t\n;&()|<>" +#define HISTORY_QUOTE_CHARACTERS "\"'`" + +#define slashify_in_quotes "\\`\"$" + +typedef int _hist_search_func_t PARAMS((const char *, int)); + +static char error_pointer; + +static char *subst_lhs; +static char *subst_rhs; +static int subst_lhs_len; +static int subst_rhs_len; + +static char *get_history_word_specifier PARAMS((char *, char *, int *)); +static int history_tokenize_word PARAMS((const char *, int)); +static char **history_tokenize_internal PARAMS((const char *, int, int *)); +static char *history_substring PARAMS((const char *, int, int)); +static void freewords PARAMS((char **, int)); +static char *history_find_word PARAMS((char *, int)); + +static char *quote_breaks PARAMS((char *)); + +/* Variables exported by this file. */ +/* The character that represents the start of a history expansion + request. This is usually `!'. */ +char history_expansion_char = '!'; + +/* The character that invokes word substitution if found at the start of + a line. This is usually `^'. */ +char history_subst_char = '^'; + +/* During tokenization, if this character is seen as the first character + of a word, then it, and all subsequent characters upto a newline are + ignored. For a Bourne shell, this should be '#'. Bash special cases + the interactive comment character to not be a comment delimiter. */ +char history_comment_char = '\0'; + +/* The list of characters which inhibit the expansion of text if found + immediately following history_expansion_char. */ +char *history_no_expand_chars = " \t\n\r="; + +/* If set to a non-zero value, single quotes inhibit history expansion. + The default is 0. */ +int history_quotes_inhibit_expansion = 0; + +/* Used to split words by history_tokenize_internal. */ +char *history_word_delimiters = HISTORY_WORD_DELIMITERS; + +/* If set, this points to a function that is called to verify that a + particular history expansion should be performed. */ +rl_linebuf_func_t *history_inhibit_expansion_function; + +/* **************************************************************** */ +/* */ +/* History Expansion */ +/* */ +/* **************************************************************** */ + +/* Hairy history expansion on text, not tokens. This is of general + use, and thus belongs in this library. */ + +/* The last string searched for by a !?string? search. */ +static char *search_string; + +/* The last string matched by a !?string? search. */ +static char *search_match; + +/* Return the event specified at TEXT + OFFSET modifying OFFSET to + point to after the event specifier. Just a pointer to the history + line is returned; NULL is returned in the event of a bad specifier. + You pass STRING with *INDEX equal to the history_expansion_char that + begins this specification. + DELIMITING_QUOTE is a character that is allowed to end the string + specification for what to search for in addition to the normal + characters `:', ` ', `\t', `\n', and sometimes `?'. + So you might call this function like: + line = get_history_event ("!echo:p", &index, 0); */ +char * +get_history_event (string, caller_index, delimiting_quote) + const char *string; + int *caller_index; + int delimiting_quote; +{ + register int i; + register char c; + HIST_ENTRY *entry; + int which, sign, local_index, substring_okay; + _hist_search_func_t *search_func; + char *temp; + + /* The event can be specified in a number of ways. + + !! the previous command + !n command line N + !-n current command-line minus N + !str the most recent command starting with STR + !?str[?] + the most recent command containing STR + + All values N are determined via HISTORY_BASE. */ + + i = *caller_index; + + if (string[i] != history_expansion_char) + return ((char *)NULL); + + /* Move on to the specification. */ + i++; + + sign = 1; + substring_okay = 0; + +#define RETURN_ENTRY(e, w) \ + return ((e = history_get (w)) ? e->line : (char *)NULL) + + /* Handle !! case. */ + if (string[i] == history_expansion_char) + { + i++; + which = history_base + (history_length - 1); + *caller_index = i; + RETURN_ENTRY (entry, which); + } + + /* Hack case of numeric line specification. */ + if (string[i] == '-') + { + sign = -1; + i++; + } + + if (_rl_digit_p (string[i])) + { + /* Get the extent of the digits and compute the value. */ + for (which = 0; _rl_digit_p (string[i]); i++) + which = (which * 10) + _rl_digit_value (string[i]); + + *caller_index = i; + + if (sign < 0) + which = (history_length + history_base) - which; + + RETURN_ENTRY (entry, which); + } + + /* This must be something to search for. If the spec begins with + a '?', then the string may be anywhere on the line. Otherwise, + the string must be found at the start of a line. */ + if (string[i] == '?') + { + substring_okay++; + i++; + } + + /* Only a closing `?' or a newline delimit a substring search string. */ + for (local_index = i; c = string[i]; i++) + { +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + int v; + mbstate_t ps; + + memset (&ps, 0, sizeof (mbstate_t)); + /* These produce warnings because we're passing a const string to a + function that takes a non-const string. */ + _rl_adjust_point ((char *)string, i, &ps); + if ((v = _rl_get_char_len ((char *)string + i, &ps)) > 1) + { + i += v - 1; + continue; + } + } + +#endif /* HANDLE_MULTIBYTE */ + if ((!substring_okay && (whitespace (c) || c == ':' || + (history_search_delimiter_chars && member (c, history_search_delimiter_chars)) || + string[i] == delimiting_quote)) || + string[i] == '\n' || + (substring_okay && string[i] == '?')) + break; + } + + which = i - local_index; + temp = (char *)xmalloc (1 + which); + if (which) + strncpy (temp, string + local_index, which); + temp[which] = '\0'; + + if (substring_okay && string[i] == '?') + i++; + + *caller_index = i; + +#define FAIL_SEARCH() \ + do { \ + history_offset = history_length; xfree (temp) ; return (char *)NULL; \ + } while (0) + + /* If there is no search string, try to use the previous search string, + if one exists. If not, fail immediately. */ + if (*temp == '\0' && substring_okay) + { + if (search_string) + { + xfree (temp); + temp = savestring (search_string); + } + else + FAIL_SEARCH (); + } + + search_func = substring_okay ? history_search : history_search_prefix; + while (1) + { + local_index = (*search_func) (temp, -1); + + if (local_index < 0) + FAIL_SEARCH (); + + if (local_index == 0 || substring_okay) + { + entry = current_history (); + if (entry == 0) + FAIL_SEARCH (); + history_offset = history_length; + + /* If this was a substring search, then remember the + string that we matched for word substitution. */ + if (substring_okay) + { + FREE (search_string); + search_string = temp; + + FREE (search_match); + search_match = history_find_word (entry->line, local_index); + } + else + xfree (temp); + + return (entry->line); + } + + if (history_offset) + history_offset--; + else + FAIL_SEARCH (); + } +#undef FAIL_SEARCH +#undef RETURN_ENTRY +} + +/* Function for extracting single-quoted strings. Used for inhibiting + history expansion within single quotes. */ + +/* Extract the contents of STRING as if it is enclosed in single quotes. + SINDEX, when passed in, is the offset of the character immediately + following the opening single quote; on exit, SINDEX is left pointing + to the closing single quote. FLAGS currently used to allow backslash + to escape a single quote (e.g., for bash $'...'). */ +static void +hist_string_extract_single_quoted (string, sindex, flags) + char *string; + int *sindex, flags; +{ + register int i; + + for (i = *sindex; string[i] && string[i] != '\''; i++) + { + if ((flags & 1) && string[i] == '\\' && string[i+1]) + i++; + } + + *sindex = i; +} + +static char * +quote_breaks (s) + char *s; +{ + register char *p, *r; + char *ret; + int len = 3; + + for (p = s; p && *p; p++, len++) + { + if (*p == '\'') + len += 3; + else if (whitespace (*p) || *p == '\n') + len += 2; + } + + r = ret = (char *)xmalloc (len); + *r++ = '\''; + for (p = s; p && *p; ) + { + if (*p == '\'') + { + *r++ = '\''; + *r++ = '\\'; + *r++ = '\''; + *r++ = '\''; + p++; + } + else if (whitespace (*p) || *p == '\n') + { + *r++ = '\''; + *r++ = *p++; + *r++ = '\''; + } + else + *r++ = *p++; + } + *r++ = '\''; + *r = '\0'; + return ret; +} + +static char * +hist_error(s, start, current, errtype) + char *s; + int start, current, errtype; +{ + char *temp; + const char *emsg; + int ll, elen; + + ll = current - start; + + switch (errtype) + { + case EVENT_NOT_FOUND: + emsg = "event not found"; + elen = 15; + break; + case BAD_WORD_SPEC: + emsg = "bad word specifier"; + elen = 18; + break; + case SUBST_FAILED: + emsg = "substitution failed"; + elen = 19; + break; + case BAD_MODIFIER: + emsg = "unrecognized history modifier"; + elen = 29; + break; + case NO_PREV_SUBST: + emsg = "no previous substitution"; + elen = 24; + break; + default: + emsg = "unknown expansion error"; + elen = 23; + break; + } + + temp = (char *)xmalloc (ll + elen + 3); + strncpy (temp, s + start, ll); + temp[ll] = ':'; + temp[ll + 1] = ' '; + strcpy (temp + ll + 2, emsg); + return (temp); +} + +/* Get a history substitution string from STR starting at *IPTR + and return it. The length is returned in LENPTR. + + A backslash can quote the delimiter. If the string is the + empty string, the previous pattern is used. If there is + no previous pattern for the lhs, the last history search + string is used. + + If IS_RHS is 1, we ignore empty strings and set the pattern + to "" anyway. subst_lhs is not changed if the lhs is empty; + subst_rhs is allowed to be set to the empty string. */ + +static char * +get_subst_pattern (str, iptr, delimiter, is_rhs, lenptr) + char *str; + int *iptr, delimiter, is_rhs, *lenptr; +{ + register int si, i, j, k; + char *s; +#if defined (HANDLE_MULTIBYTE) + mbstate_t ps; +#endif + + s = (char *)NULL; + i = *iptr; + +#if defined (HANDLE_MULTIBYTE) + memset (&ps, 0, sizeof (mbstate_t)); + _rl_adjust_point (str, i, &ps); +#endif + + for (si = i; str[si] && str[si] != delimiter; si++) +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + int v; + if ((v = _rl_get_char_len (str + si, &ps)) > 1) + si += v - 1; + else if (str[si] == '\\' && str[si + 1] == delimiter) + si++; + } + else +#endif /* HANDLE_MULTIBYTE */ + if (str[si] == '\\' && str[si + 1] == delimiter) + si++; + + if (si > i || is_rhs) + { + s = (char *)xmalloc (si - i + 1); + for (j = 0, k = i; k < si; j++, k++) + { + /* Remove a backslash quoting the search string delimiter. */ + if (str[k] == '\\' && str[k + 1] == delimiter) + k++; + s[j] = str[k]; + } + s[j] = '\0'; + if (lenptr) + *lenptr = j; + } + + i = si; + if (str[i]) + i++; + *iptr = i; + + return s; +} + +static void +postproc_subst_rhs () +{ + char *new; + int i, j, new_size; + + new = (char *)xmalloc (new_size = subst_rhs_len + subst_lhs_len); + for (i = j = 0; i < subst_rhs_len; i++) + { + if (subst_rhs[i] == '&') + { + if (j + subst_lhs_len >= new_size) + new = (char *)xrealloc (new, (new_size = new_size * 2 + subst_lhs_len)); + strcpy (new + j, subst_lhs); + j += subst_lhs_len; + } + else + { + /* a single backslash protects the `&' from lhs interpolation */ + if (subst_rhs[i] == '\\' && subst_rhs[i + 1] == '&') + i++; + if (j >= new_size) + new = (char *)xrealloc (new, new_size *= 2); + new[j++] = subst_rhs[i]; + } + } + new[j] = '\0'; + xfree (subst_rhs); + subst_rhs = new; + subst_rhs_len = j; +} + +/* Expand the bulk of a history specifier starting at STRING[START]. + Returns 0 if everything is OK, -1 if an error occurred, and 1 + if the `p' modifier was supplied and the caller should just print + the returned string. Returns the new index into string in + *END_INDEX_PTR, and the expanded specifier in *RET_STRING. */ +static int +history_expand_internal (string, start, qc, end_index_ptr, ret_string, current_line) + char *string; + int start, qc, *end_index_ptr; + char **ret_string; + char *current_line; /* for !# */ +{ + int i, n, starting_index; + int substitute_globally, subst_bywords, want_quotes, print_only; + char *event, *temp, *result, *tstr, *t, c, *word_spec; + int result_len; +#if defined (HANDLE_MULTIBYTE) + mbstate_t ps; + + memset (&ps, 0, sizeof (mbstate_t)); +#endif + + result = (char *)xmalloc (result_len = 128); + + i = start; + + /* If it is followed by something that starts a word specifier, + then !! is implied as the event specifier. */ + + if (member (string[i + 1], ":$*%^")) + { + char fake_s[3]; + int fake_i = 0; + i++; + fake_s[0] = fake_s[1] = history_expansion_char; + fake_s[2] = '\0'; + event = get_history_event (fake_s, &fake_i, 0); + } + else if (string[i + 1] == '#') + { + i += 2; + event = current_line; + } + else + event = get_history_event (string, &i, qc); + + if (event == 0) + { + *ret_string = hist_error (string, start, i, EVENT_NOT_FOUND); + xfree (result); + return (-1); + } + + /* If a word specifier is found, then do what that requires. */ + starting_index = i; + word_spec = get_history_word_specifier (string, event, &i); + + /* There is no such thing as a `malformed word specifier'. However, + it is possible for a specifier that has no match. In that case, + we complain. */ + if (word_spec == (char *)&error_pointer) + { + *ret_string = hist_error (string, starting_index, i, BAD_WORD_SPEC); + xfree (result); + return (-1); + } + + /* If no word specifier, than the thing of interest was the event. */ + temp = word_spec ? savestring (word_spec) : savestring (event); + FREE (word_spec); + + /* Perhaps there are other modifiers involved. Do what they say. */ + want_quotes = substitute_globally = subst_bywords = print_only = 0; + starting_index = i; + + while (string[i] == ':') + { + c = string[i + 1]; + + if (c == 'g' || c == 'a') + { + substitute_globally = 1; + i++; + c = string[i + 1]; + } + else if (c == 'G') + { + subst_bywords = 1; + i++; + c = string[i + 1]; + } + + switch (c) + { + default: + *ret_string = hist_error (string, i+1, i+2, BAD_MODIFIER); + xfree (result); + xfree (temp); + return -1; + + case 'q': + want_quotes = 'q'; + break; + + case 'x': + want_quotes = 'x'; + break; + + /* :p means make this the last executed line. So we + return an error state after adding this line to the + history. */ + case 'p': + print_only++; + break; + + /* :t discards all but the last part of the pathname. */ + case 't': + tstr = strrchr (temp, '/'); + if (tstr) + { + tstr++; + t = savestring (tstr); + xfree (temp); + temp = t; + } + break; + + /* :h discards the last part of a pathname. */ + case 'h': + tstr = strrchr (temp, '/'); + if (tstr) + *tstr = '\0'; + break; + + /* :r discards the suffix. */ + case 'r': + tstr = strrchr (temp, '.'); + if (tstr) + *tstr = '\0'; + break; + + /* :e discards everything but the suffix. */ + case 'e': + tstr = strrchr (temp, '.'); + if (tstr) + { + t = savestring (tstr); + xfree (temp); + temp = t; + } + break; + + /* :s/this/that substitutes `that' for the first + occurrence of `this'. :gs/this/that substitutes `that' + for each occurrence of `this'. :& repeats the last + substitution. :g& repeats the last substitution + globally. */ + + case '&': + case 's': + { + char *new_event; + int delimiter, failed, si, l_temp, ws, we; + + if (c == 's') + { + if (i + 2 < (int)strlen (string)) + { +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + _rl_adjust_point (string, i + 2, &ps); + if (_rl_get_char_len (string + i + 2, &ps) > 1) + delimiter = 0; + else + delimiter = string[i + 2]; + } + else +#endif /* HANDLE_MULTIBYTE */ + delimiter = string[i + 2]; + } + else + break; /* no search delimiter */ + + i += 3; + + t = get_subst_pattern (string, &i, delimiter, 0, &subst_lhs_len); + /* An empty substitution lhs with no previous substitution + uses the last search string as the lhs. */ + if (t) + { + FREE (subst_lhs); + subst_lhs = t; + } + else if (!subst_lhs) + { + if (search_string && *search_string) + { + subst_lhs = savestring (search_string); + subst_lhs_len = strlen (subst_lhs); + } + else + { + subst_lhs = (char *) NULL; + subst_lhs_len = 0; + } + } + + FREE (subst_rhs); + subst_rhs = get_subst_pattern (string, &i, delimiter, 1, &subst_rhs_len); + + /* If `&' appears in the rhs, it's supposed to be replaced + with the lhs. */ + if (member ('&', subst_rhs)) + postproc_subst_rhs (); + } + else + i += 2; + + /* If there is no lhs, the substitution can't succeed. */ + if (subst_lhs_len == 0) + { + *ret_string = hist_error (string, starting_index, i, NO_PREV_SUBST); + xfree (result); + xfree (temp); + return -1; + } + + l_temp = strlen (temp); + /* Ignore impossible cases. */ + if (subst_lhs_len > l_temp) + { + *ret_string = hist_error (string, starting_index, i, SUBST_FAILED); + xfree (result); + xfree (temp); + return (-1); + } + + /* Find the first occurrence of THIS in TEMP. */ + /* Substitute SUBST_RHS for SUBST_LHS in TEMP. There are three + cases to consider: + + 1. substitute_globally == subst_bywords == 0 + 2. substitute_globally == 1 && subst_bywords == 0 + 3. substitute_globally == 0 && subst_bywords == 1 + + In the first case, we substitute for the first occurrence only. + In the second case, we substitute for every occurrence. + In the third case, we tokenize into words and substitute the + first occurrence of each word. */ + + si = we = 0; + for (failed = 1; (si + subst_lhs_len) <= l_temp; si++) + { + /* First skip whitespace and find word boundaries if + we're past the end of the word boundary we found + the last time. */ + if (subst_bywords && si > we) + { + for (; temp[si] && whitespace (temp[si]); si++) + ; + ws = si; + we = history_tokenize_word (temp, si); + } + + if (STREQN (temp+si, subst_lhs, subst_lhs_len)) + { + int len = subst_rhs_len - subst_lhs_len + l_temp; + new_event = (char *)xmalloc (1 + len); + strncpy (new_event, temp, si); + strncpy (new_event + si, subst_rhs, subst_rhs_len); + strncpy (new_event + si + subst_rhs_len, + temp + si + subst_lhs_len, + l_temp - (si + subst_lhs_len)); + new_event[len] = '\0'; + xfree (temp); + temp = new_event; + + failed = 0; + + if (substitute_globally) + { + /* Reported to fix a bug that causes it to skip every + other match when matching a single character. Was + si += subst_rhs_len previously. */ + si += subst_rhs_len - 1; + l_temp = strlen (temp); + substitute_globally++; + continue; + } + else if (subst_bywords) + { + si = we; + l_temp = strlen (temp); + continue; + } + else + break; + } + } + + if (substitute_globally > 1) + { + substitute_globally = 0; + continue; /* don't want to increment i */ + } + + if (failed == 0) + continue; /* don't want to increment i */ + + *ret_string = hist_error (string, starting_index, i, SUBST_FAILED); + xfree (result); + xfree (temp); + return (-1); + } + } + i += 2; + } + /* Done with modifiers. */ + /* Believe it or not, we have to back the pointer up by one. */ + --i; + + if (want_quotes) + { + char *x; + + if (want_quotes == 'q') + x = sh_single_quote (temp); + else if (want_quotes == 'x') + x = quote_breaks (temp); + else + x = savestring (temp); + + xfree (temp); + temp = x; + } + + n = strlen (temp); + if (n >= result_len) + result = (char *)xrealloc (result, n + 2); + strcpy (result, temp); + xfree (temp); + + *end_index_ptr = i; + *ret_string = result; + return (print_only); +} + +/* Expand the string STRING, placing the result into OUTPUT, a pointer + to a string. Returns: + + -1) If there was an error in expansion. + 0) If no expansions took place (or, if the only change in + the text was the de-slashifying of the history expansion + character) + 1) If expansions did take place + 2) If the `p' modifier was given and the caller should print the result + + If an error ocurred in expansion, then OUTPUT contains a descriptive + error message. */ + +#define ADD_STRING(s) \ + do \ + { \ + int sl = strlen (s); \ + j += sl; \ + if (j >= result_len) \ + { \ + while (j >= result_len) \ + result_len += 128; \ + result = (char *)xrealloc (result, result_len); \ + } \ + strcpy (result + j - sl, s); \ + } \ + while (0) + +#define ADD_CHAR(c) \ + do \ + { \ + if (j >= result_len - 1) \ + result = (char *)xrealloc (result, result_len += 64); \ + result[j++] = c; \ + result[j] = '\0'; \ + } \ + while (0) + +int +history_expand (hstring, output) + char *hstring; + char **output; +{ + register int j; + int i, r, l, passc, cc, modified, eindex, only_printing, dquote, squote, flag; + char *string; + + /* The output string, and its length. */ + int result_len; + char *result; + +#if defined (HANDLE_MULTIBYTE) + char mb[MB_LEN_MAX]; + mbstate_t ps; +#endif + + /* Used when adding the string. */ + char *temp; + + if (output == 0) + return 0; + + /* Setting the history expansion character to 0 inhibits all + history expansion. */ + if (history_expansion_char == 0) + { + *output = savestring (hstring); + return (0); + } + + /* Prepare the buffer for printing error messages. */ + result = (char *)xmalloc (result_len = 256); + result[0] = '\0'; + + only_printing = modified = 0; + l = strlen (hstring); + + /* Grovel the string. Only backslash and single quotes can quote the + history escape character. We also handle arg specifiers. */ + + /* Before we grovel forever, see if the history_expansion_char appears + anywhere within the text. */ + + /* The quick substitution character is a history expansion all right. That + is to say, "^this^that^" is equivalent to "!!:s^this^that^", and in fact, + that is the substitution that we do. */ + if (hstring[0] == history_subst_char) + { + string = (char *)xmalloc (l + 5); + + string[0] = string[1] = history_expansion_char; + string[2] = ':'; + string[3] = 's'; + strcpy (string + 4, hstring); + l += 4; + } + else + { +#if defined (HANDLE_MULTIBYTE) + memset (&ps, 0, sizeof (mbstate_t)); +#endif + + string = hstring; + /* If not quick substitution, still maybe have to do expansion. */ + + /* `!' followed by one of the characters in history_no_expand_chars + is NOT an expansion. */ + for (i = dquote = squote = 0; string[i]; i++) + { +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + int v; + v = _rl_get_char_len (string + i, &ps); + if (v > 1) + { + i += v - 1; + continue; + } + } +#endif /* HANDLE_MULTIBYTE */ + + cc = string[i + 1]; + /* The history_comment_char, if set, appearing at the beginning + of a word signifies that the rest of the line should not have + history expansion performed on it. + Skip the rest of the line and break out of the loop. */ + if (history_comment_char && string[i] == history_comment_char && + (i == 0 || member (string[i - 1], history_word_delimiters))) + { + while (string[i]) + i++; + break; + } + else if (string[i] == history_expansion_char) + { + if (cc == 0 || member (cc, history_no_expand_chars)) + continue; + /* DQUOTE won't be set unless history_quotes_inhibit_expansion + is set. The idea here is to treat double-quoted strings the + same as the word outside double quotes; in effect making the + double quote part of history_no_expand_chars when DQUOTE is + set. */ + else if (dquote && cc == '"') + continue; + /* If the calling application has set + history_inhibit_expansion_function to a function that checks + for special cases that should not be history expanded, + call the function and skip the expansion if it returns a + non-zero value. */ + else if (history_inhibit_expansion_function && + (*history_inhibit_expansion_function) (string, i)) + continue; + else + break; + } + /* Shell-like quoting: allow backslashes to quote double quotes + inside a double-quoted string. */ + else if (dquote && string[i] == '\\' && cc == '"') + i++; + /* More shell-like quoting: if we're paying attention to single + quotes and letting them quote the history expansion character, + then we need to pay attention to double quotes, because single + quotes are not special inside double-quoted strings. */ + else if (history_quotes_inhibit_expansion && string[i] == '"') + { + dquote = 1 - dquote; + } + else if (dquote == 0 && history_quotes_inhibit_expansion && string[i] == '\'') + { + /* If this is bash, single quotes inhibit history expansion. */ + flag = (i > 0 && string[i - 1] == '$'); + i++; + hist_string_extract_single_quoted (string, &i, flag); + } + else if (history_quotes_inhibit_expansion && string[i] == '\\') + { + /* If this is bash, allow backslashes to quote single + quotes and the history expansion character. */ + if (cc == '\'' || cc == history_expansion_char) + i++; + } + + } + + if (string[i] != history_expansion_char) + { + xfree (result); + *output = savestring (string); + return (0); + } + } + + /* Extract and perform the substitution. */ + for (passc = dquote = squote = i = j = 0; i < l; i++) + { + int qc, tchar = string[i]; + + if (passc) + { + passc = 0; + ADD_CHAR (tchar); + continue; + } + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + int k, c; + + c = tchar; + memset (mb, 0, sizeof (mb)); + for (k = 0; k < MB_LEN_MAX; k++) + { + mb[k] = (char)c; + memset (&ps, 0, sizeof (mbstate_t)); + if (_rl_get_char_len (mb, &ps) == -2) + c = string[++i]; + else + break; + } + if (strlen (mb) > 1) + { + ADD_STRING (mb); + continue; + } + } +#endif /* HANDLE_MULTIBYTE */ + + if (tchar == history_expansion_char) + tchar = -3; + else if (tchar == history_comment_char) + tchar = -2; + + switch (tchar) + { + default: + ADD_CHAR (string[i]); + break; + + case '\\': + passc++; + ADD_CHAR (tchar); + break; + + case '"': + dquote = 1 - dquote; + ADD_CHAR (tchar); + break; + + case '\'': + { + /* If history_quotes_inhibit_expansion is set, single quotes + inhibit history expansion, otherwise they are treated like + double quotes. */ + if (squote) + { + squote = 0; + ADD_CHAR (tchar); + } + else if (dquote == 0 && history_quotes_inhibit_expansion) + { + int quote, slen; + + flag = (i > 0 && string[i - 1] == '$'); + quote = i++; + hist_string_extract_single_quoted (string, &i, flag); + + slen = i - quote + 2; + temp = (char *)xmalloc (slen); + strncpy (temp, string + quote, slen); + temp[slen - 1] = '\0'; + ADD_STRING (temp); + xfree (temp); + } + else if (dquote == 0 && squote == 0 && history_quotes_inhibit_expansion == 0) + { + squote = 1; + ADD_CHAR (string[i]); + } + else + ADD_CHAR (string[i]); + break; + } + + case -2: /* history_comment_char */ + if (i == 0 || member (string[i - 1], history_word_delimiters)) + { + temp = (char *)xmalloc (l - i + 1); + strcpy (temp, string + i); + ADD_STRING (temp); + xfree (temp); + i = l; + } + else + ADD_CHAR (string[i]); + break; + + case -3: /* history_expansion_char */ + cc = string[i + 1]; + + /* If the history_expansion_char is followed by one of the + characters in history_no_expand_chars, then it is not a + candidate for expansion of any kind. */ + if (cc == 0 || member (cc, history_no_expand_chars) || + (dquote && cc == '"') || + (history_inhibit_expansion_function && (*history_inhibit_expansion_function) (string, i))) + { + ADD_CHAR (string[i]); + break; + } + +#if defined (NO_BANG_HASH_MODIFIERS) + /* There is something that is listed as a `word specifier' in csh + documentation which means `the expanded text to this point'. + That is not a word specifier, it is an event specifier. If we + don't want to allow modifiers with `!#', just stick the current + output line in again. */ + if (cc == '#') + { + if (result) + { + temp = (char *)xmalloc (1 + strlen (result)); + strcpy (temp, result); + ADD_STRING (temp); + xfree (temp); + } + i++; + break; + } +#endif + qc = squote ? '\'' : (dquote ? '"' : 0); + r = history_expand_internal (string, i, qc, &eindex, &temp, result); + if (r < 0) + { + *output = temp; + xfree (result); + if (string != hstring) + xfree (string); + return -1; + } + else + { + if (temp) + { + modified++; + if (*temp) + ADD_STRING (temp); + xfree (temp); + } + only_printing = r == 1; + i = eindex; + } + break; + } + } + + *output = result; + if (string != hstring) + xfree (string); + + if (only_printing) + { +#if 0 + add_history (result); +#endif + return (2); + } + + return (modified != 0); +} + +/* Return a consed string which is the word specified in SPEC, and found + in FROM. NULL is returned if there is no spec. The address of + ERROR_POINTER is returned if the word specified cannot be found. + CALLER_INDEX is the offset in SPEC to start looking; it is updated + to point to just after the last character parsed. */ +static char * +get_history_word_specifier (spec, from, caller_index) + char *spec, *from; + int *caller_index; +{ + register int i = *caller_index; + int first, last; + int expecting_word_spec = 0; + char *result; + + /* The range of words to return doesn't exist yet. */ + first = last = 0; + result = (char *)NULL; + + /* If we found a colon, then this *must* be a word specification. If + it isn't, then it is an error. */ + if (spec[i] == ':') + { + i++; + expecting_word_spec++; + } + + /* Handle special cases first. */ + + /* `%' is the word last searched for. */ + if (spec[i] == '%') + { + *caller_index = i + 1; + return (search_match ? savestring (search_match) : savestring ("")); + } + + /* `*' matches all of the arguments, but not the command. */ + if (spec[i] == '*') + { + *caller_index = i + 1; + result = history_arg_extract (1, '$', from); + return (result ? result : savestring ("")); + } + + /* `$' is last arg. */ + if (spec[i] == '$') + { + *caller_index = i + 1; + return (history_arg_extract ('$', '$', from)); + } + + /* Try to get FIRST and LAST figured out. */ + + if (spec[i] == '-') + first = 0; + else if (spec[i] == '^') + { + first = 1; + i++; + } + else if (_rl_digit_p (spec[i]) && expecting_word_spec) + { + for (first = 0; _rl_digit_p (spec[i]); i++) + first = (first * 10) + _rl_digit_value (spec[i]); + } + else + return ((char *)NULL); /* no valid `first' for word specifier */ + + if (spec[i] == '^' || spec[i] == '*') + { + last = (spec[i] == '^') ? 1 : '$'; /* x* abbreviates x-$ */ + i++; + } + else if (spec[i] != '-') + last = first; + else + { + i++; + + if (_rl_digit_p (spec[i])) + { + for (last = 0; _rl_digit_p (spec[i]); i++) + last = (last * 10) + _rl_digit_value (spec[i]); + } + else if (spec[i] == '$') + { + i++; + last = '$'; + } +#if 0 + else if (!spec[i] || spec[i] == ':') + /* check against `:' because there could be a modifier separator */ +#else + else + /* csh seems to allow anything to terminate the word spec here, + leaving it as an abbreviation. */ +#endif + last = -1; /* x- abbreviates x-$ omitting word `$' */ + } + + *caller_index = i; + + if (last >= first || last == '$' || last < 0) + result = history_arg_extract (first, last, from); + + return (result ? result : (char *)&error_pointer); +} + +/* Extract the args specified, starting at FIRST, and ending at LAST. + The args are taken from STRING. If either FIRST or LAST is < 0, + then make that arg count from the right (subtract from the number of + tokens, so that FIRST = -1 means the next to last token on the line). + If LAST is `$' the last arg from STRING is used. */ +char * +history_arg_extract (first, last, string) + int first, last; + const char *string; +{ + register int i, len; + char *result; + int size, offset; + char **list; + + /* XXX - think about making history_tokenize return a struct array, + each struct in array being a string and a length to avoid the + calls to strlen below. */ + if ((list = history_tokenize (string)) == NULL) + return ((char *)NULL); + + for (len = 0; list[len]; len++) + ; + + if (last < 0) + last = len + last - 1; + + if (first < 0) + first = len + first - 1; + + if (last == '$') + last = len - 1; + + if (first == '$') + first = len - 1; + + last++; + + if (first >= len || last > len || first < 0 || last < 0 || first > last) + result = ((char *)NULL); + else + { + for (size = 0, i = first; i < last; i++) + size += strlen (list[i]) + 1; + result = (char *)xmalloc (size + 1); + result[0] = '\0'; + + for (i = first, offset = 0; i < last; i++) + { + strcpy (result + offset, list[i]); + offset += strlen (list[i]); + if (i + 1 < last) + { + result[offset++] = ' '; + result[offset] = 0; + } + } + } + + for (i = 0; i < len; i++) + xfree (list[i]); + xfree (list); + + return (result); +} + +static int +history_tokenize_word (string, ind) + const char *string; + int ind; +{ + register int i; + int delimiter, nestdelim, delimopen; + + i = ind; + delimiter = nestdelim = 0; + + if (member (string[i], "()\n")) + { + i++; + return i; + } + + if (member (string[i], "<>;&|$")) + { + int peek = string[i + 1]; + + if (peek == string[i] && peek != '$') + { + if (peek == '<' && string[i + 2] == '-') + i++; + else if (peek == '<' && string[i + 2] == '<') + i++; + i += 2; + return i; + } + else if ((peek == '&' && (string[i] == '>' || string[i] == '<')) || + (peek == '>' && string[i] == '&')) + { + i += 2; + return i; + } + /* XXX - separated out for later -- bash-4.2 */ + else if ((peek == '(' && (string[i] == '>' || string[i] == '<')) || /* ) */ + (peek == '(' && string[i] == '$')) /*)*/ + { + i += 2; + delimopen = '('; + delimiter = ')'; + nestdelim = 1; + goto get_word; + } +#if 0 + else if (peek == '\'' && string[i] == '$') + { + i += 2; /* XXX */ + return i; + } +#endif + + if (string[i] != '$') + { + i++; + return i; + } + } + + /* same code also used for $(...)/<(...)/>(...) above */ + if (member (string[i], "!@?+*")) + { + int peek = string[i + 1]; + + if (peek == '(') /*)*/ + { + /* Shell extended globbing patterns */ + i += 2; + delimopen = '('; + delimiter = ')'; /* XXX - not perfect */ + nestdelim = 1; + } + } + +get_word: + /* Get word from string + i; */ + + if (delimiter == 0 && member (string[i], HISTORY_QUOTE_CHARACTERS)) + delimiter = string[i++]; + + for (; string[i]; i++) + { + if (string[i] == '\\' && string[i + 1] == '\n') + { + i++; + continue; + } + + if (string[i] == '\\' && delimiter != '\'' && + (delimiter != '"' || member (string[i], slashify_in_quotes))) + { + i++; + continue; + } + + /* delimiter must be set and set to something other than a quote if + nestdelim is set, so these tests are safe. */ + if (nestdelim && string[i] == delimopen) + { + nestdelim++; + continue; + } + if (nestdelim && string[i] == delimiter) + { + nestdelim--; + if (nestdelim == 0) + delimiter = 0; + continue; + } + + if (delimiter && string[i] == delimiter) + { + delimiter = 0; + continue; + } + + if (delimiter == 0 && (member (string[i], history_word_delimiters))) + break; + + if (delimiter == 0 && member (string[i], HISTORY_QUOTE_CHARACTERS)) + delimiter = string[i]; + } + + return i; +} + +static char * +history_substring (string, start, end) + const char *string; + int start, end; +{ + register int len; + register char *result; + + len = end - start; + result = (char *)xmalloc (len + 1); + strncpy (result, string + start, len); + result[len] = '\0'; + return result; +} + +/* Parse STRING into tokens and return an array of strings. If WIND is + not -1 and INDP is not null, we also want the word surrounding index + WIND. The position in the returned array of strings is returned in + *INDP. */ +static char ** +history_tokenize_internal (string, wind, indp) + const char *string; + int wind, *indp; +{ + char **result; + register int i, start, result_index, size; + + /* If we're searching for a string that's not part of a word (e.g., " "), + make sure we set *INDP to a reasonable value. */ + if (indp && wind != -1) + *indp = -1; + + /* Get a token, and stuff it into RESULT. The tokens are split + exactly where the shell would split them. */ + for (i = result_index = size = 0, result = (char **)NULL; string[i]; ) + { + /* Skip leading whitespace. */ + for (; string[i] && whitespace (string[i]); i++) + ; + if (string[i] == 0 || string[i] == history_comment_char) + return (result); + + start = i; + + i = history_tokenize_word (string, start); + + /* If we have a non-whitespace delimiter character (which would not be + skipped by the loop above), use it and any adjacent delimiters to + make a separate field. Any adjacent white space will be skipped the + next time through the loop. */ + if (i == start && history_word_delimiters) + { + i++; + while (string[i] && member (string[i], history_word_delimiters)) + i++; + } + + /* If we are looking for the word in which the character at a + particular index falls, remember it. */ + if (indp && wind != -1 && wind >= start && wind < i) + *indp = result_index; + + if (result_index + 2 >= size) + result = (char **)xrealloc (result, ((size += 10) * sizeof (char *))); + + result[result_index++] = history_substring (string, start, i); + result[result_index] = (char *)NULL; + } + + return (result); +} + +/* Return an array of tokens, much as the shell might. The tokens are + parsed out of STRING. */ +char ** +history_tokenize (string) + const char *string; +{ + return (history_tokenize_internal (string, -1, (int *)NULL)); +} + +/* Free members of WORDS from START to an empty string */ +static void +freewords (words, start) + char **words; + int start; +{ + register int i; + + for (i = start; words[i]; i++) + xfree (words[i]); +} + +/* Find and return the word which contains the character at index IND + in the history line LINE. Used to save the word matched by the + last history !?string? search. */ +static char * +history_find_word (line, ind) + char *line; + int ind; +{ + char **words, *s; + int i, wind; + + words = history_tokenize_internal (line, ind, &wind); + if (wind == -1 || words == 0) + { + if (words) + freewords (words, 0); + FREE (words); + return ((char *)NULL); + } + s = words[wind]; + for (i = 0; i < wind; i++) + xfree (words[i]); + freewords (words, wind + 1); + xfree (words); + return s; +} diff --git a/lib/readline/histfile.c b/lib/readline/histfile.c new file mode 100644 index 0000000..bb74315 --- /dev/null +++ b/lib/readline/histfile.c @@ -0,0 +1,584 @@ +/* histfile.c - functions to manipulate the history file. */ + +/* Copyright (C) 1989-2010 Free Software Foundation, Inc. + + This file contains the GNU History Library (History), a set of + routines for managing the text of previously typed lines. + + History is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + History is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with History. If not, see . +*/ + +/* The goal is to make the implementation transparent, so that you + don't have to know what data types are used, just what functions + you can call. I think I have done that. */ + +#define READLINE_LIBRARY + +#if defined (__TANDEM) +# include +#endif + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include + +#include +#if ! defined (_MINIX) && defined (HAVE_SYS_FILE_H) +# include +#endif +#include "posixstat.h" +#include + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include + +#if defined (__EMX__) +# undef HAVE_MMAP +#endif + +#ifdef HISTORY_USE_MMAP +# include + +# ifdef MAP_FILE +# define MAP_RFLAGS (MAP_FILE|MAP_PRIVATE) +# define MAP_WFLAGS (MAP_FILE|MAP_SHARED) +# else +# define MAP_RFLAGS MAP_PRIVATE +# define MAP_WFLAGS MAP_SHARED +# endif + +# ifndef MAP_FAILED +# define MAP_FAILED ((void *)-1) +# endif + +#endif /* HISTORY_USE_MMAP */ + +/* If we're compiling for __EMX__ (OS/2) or __CYGWIN__ (cygwin32 environment + on win 95/98/nt), we want to open files with O_BINARY mode so that there + is no \n -> \r\n conversion performed. On other systems, we don't want to + mess around with O_BINARY at all, so we ensure that it's defined to 0. */ +#if defined (__EMX__) || defined (__CYGWIN__) +# ifndef O_BINARY +# define O_BINARY 0 +# endif +#else /* !__EMX__ && !__CYGWIN__ */ +# undef O_BINARY +# define O_BINARY 0 +#endif /* !__EMX__ && !__CYGWIN__ */ + +#include +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +#include "history.h" +#include "histlib.h" + +#include "rlshell.h" +#include "xmalloc.h" + +/* If non-zero, we write timestamps to the history file in history_do_write() */ +int history_write_timestamps = 0; + +/* Does S look like the beginning of a history timestamp entry? Placeholder + for more extensive tests. */ +#define HIST_TIMESTAMP_START(s) (*(s) == history_comment_char && isdigit ((s)[1]) ) + +/* Return the string that should be used in the place of this + filename. This only matters when you don't specify the + filename to read_history (), or write_history (). */ +static char * +history_filename (filename) + const char *filename; +{ + char *return_val; + const char *home; + int home_len; + + return_val = filename ? savestring (filename) : (char *)NULL; + + if (return_val) + return (return_val); + + home = sh_get_env_value ("HOME"); + + if (home == 0) + return (NULL); + else + home_len = strlen (home); + + return_val = (char *)xmalloc (2 + home_len + 8); /* strlen(".history") == 8 */ + strcpy (return_val, home); + return_val[home_len] = '/'; +#if defined (__MSDOS__) + strcpy (return_val + home_len + 1, "_history"); +#else + strcpy (return_val + home_len + 1, ".history"); +#endif + + return (return_val); +} + +static char * +history_backupfile (filename) + const char *filename; +{ + char *ret; + size_t len; + + len = strlen (filename); + ret = xmalloc (len + 2); + strcpy (ret, filename); + ret[len] = '-'; + ret[len+1] = '\0'; + return ret; +} + +/* Add the contents of FILENAME to the history list, a line at a time. + If FILENAME is NULL, then read from ~/.history. Returns 0 if + successful, or errno if not. */ +int +read_history (filename) + const char *filename; +{ + return (read_history_range (filename, 0, -1)); +} + +/* Read a range of lines from FILENAME, adding them to the history list. + Start reading at the FROM'th line and end at the TO'th. If FROM + is zero, start at the beginning. If TO is less than FROM, read + until the end of the file. If FILENAME is NULL, then read from + ~/.history. Returns 0 if successful, or errno if not. */ +int +read_history_range (filename, from, to) + const char *filename; + int from, to; +{ + register char *line_start, *line_end, *p; + char *input, *buffer, *bufend, *last_ts; + int file, current_line, chars_read; + struct stat finfo; + size_t file_size; +#if defined (EFBIG) + int overflow_errno = EFBIG; +#elif defined (EOVERFLOW) + int overflow_errno = EOVERFLOW; +#else + int overflow_errno = EIO; +#endif + + buffer = last_ts = (char *)NULL; + input = history_filename (filename); + file = input ? open (input, O_RDONLY|O_BINARY, 0666) : -1; + + if ((file < 0) || (fstat (file, &finfo) == -1)) + goto error_and_exit; + + file_size = (size_t)finfo.st_size; + + /* check for overflow on very large files */ + if (file_size != finfo.st_size || file_size + 1 < file_size) + { + errno = overflow_errno; + goto error_and_exit; + } + +#ifdef HISTORY_USE_MMAP + /* We map read/write and private so we can change newlines to NULs without + affecting the underlying object. */ + buffer = (char *)mmap (0, file_size, PROT_READ|PROT_WRITE, MAP_RFLAGS, file, 0); + if ((void *)buffer == MAP_FAILED) + { + errno = overflow_errno; + goto error_and_exit; + } + chars_read = file_size; +#else + buffer = (char *)malloc (file_size + 1); + if (buffer == 0) + { + errno = overflow_errno; + goto error_and_exit; + } + + chars_read = read (file, buffer, file_size); +#endif + if (chars_read < 0) + { + error_and_exit: + if (errno != 0) + chars_read = errno; + else + chars_read = EIO; + if (file >= 0) + close (file); + + FREE (input); +#ifndef HISTORY_USE_MMAP + FREE (buffer); +#endif + + return (chars_read); + } + + close (file); + + /* Set TO to larger than end of file if negative. */ + if (to < 0) + to = chars_read; + + /* Start at beginning of file, work to end. */ + bufend = buffer + chars_read; + current_line = 0; + + /* Skip lines until we are at FROM. */ + for (line_start = line_end = buffer; line_end < bufend && current_line < from; line_end++) + if (*line_end == '\n') + { + p = line_end + 1; + /* If we see something we think is a timestamp, continue with this + line. We should check more extensively here... */ + if (HIST_TIMESTAMP_START(p) == 0) + current_line++; + line_start = p; + } + + /* If there are lines left to gobble, then gobble them now. */ + for (line_end = line_start; line_end < bufend; line_end++) + if (*line_end == '\n') + { + /* Change to allow Windows-like \r\n end of line delimiter. */ + if (line_end > line_start && line_end[-1] == '\r') + line_end[-1] = '\0'; + else + *line_end = '\0'; + + if (*line_start) + { + if (HIST_TIMESTAMP_START(line_start) == 0) + { + add_history (line_start); + if (last_ts) + { + add_history_time (last_ts); + last_ts = NULL; + } + } + else + { + last_ts = line_start; + current_line--; + } + } + + current_line++; + + if (current_line >= to) + break; + + line_start = line_end + 1; + } + + FREE (input); +#ifndef HISTORY_USE_MMAP + FREE (buffer); +#else + munmap (buffer, file_size); +#endif + + return (0); +} + +/* Truncate the history file FNAME, leaving only LINES trailing lines. + If FNAME is NULL, then use ~/.history. Returns 0 on success, errno + on failure. */ +int +history_truncate_file (fname, lines) + const char *fname; + int lines; +{ + char *buffer, *filename, *bp, *bp1; /* bp1 == bp+1 */ + int file, chars_read, rv; + struct stat finfo; + size_t file_size; + + buffer = (char *)NULL; + filename = history_filename (fname); + file = filename ? open (filename, O_RDONLY|O_BINARY, 0666) : -1; + rv = 0; + + /* Don't try to truncate non-regular files. */ + if (file == -1 || fstat (file, &finfo) == -1) + { + rv = errno; + if (file != -1) + close (file); + goto truncate_exit; + } + + if (S_ISREG (finfo.st_mode) == 0) + { + close (file); +#ifdef EFTYPE + rv = EFTYPE; +#else + rv = EINVAL; +#endif + goto truncate_exit; + } + + file_size = (size_t)finfo.st_size; + + /* check for overflow on very large files */ + if (file_size != finfo.st_size || file_size + 1 < file_size) + { + close (file); +#if defined (EFBIG) + rv = errno = EFBIG; +#elif defined (EOVERFLOW) + rv = errno = EOVERFLOW; +#else + rv = errno = EINVAL; +#endif + goto truncate_exit; + } + + buffer = (char *)malloc (file_size + 1); + if (buffer == 0) + { + close (file); + goto truncate_exit; + } + + chars_read = read (file, buffer, file_size); + close (file); + + if (chars_read <= 0) + { + rv = (chars_read < 0) ? errno : 0; + goto truncate_exit; + } + + /* Count backwards from the end of buffer until we have passed + LINES lines. bp1 is set funny initially. But since bp[1] can't + be a comment character (since it's off the end) and *bp can't be + both a newline and the history comment character, it should be OK. */ + for (bp1 = bp = buffer + chars_read - 1; lines && bp > buffer; bp--) + { + if (*bp == '\n' && HIST_TIMESTAMP_START(bp1) == 0) + lines--; + bp1 = bp; + } + + /* If this is the first line, then the file contains exactly the + number of lines we want to truncate to, so we don't need to do + anything. It's the first line if we don't find a newline between + the current value of i and 0. Otherwise, write from the start of + this line until the end of the buffer. */ + for ( ; bp > buffer; bp--) + { + if (*bp == '\n' && HIST_TIMESTAMP_START(bp1) == 0) + { + bp++; + break; + } + bp1 = bp; + } + + /* Write only if there are more lines in the file than we want to + truncate to. */ + if (bp > buffer && ((file = open (filename, O_WRONLY|O_TRUNC|O_BINARY, 0600)) != -1)) + { + if (write (file, bp, chars_read - (bp - buffer)) < 0) + rv = errno; + +#if defined (__BEOS__) + /* BeOS ignores O_TRUNC. */ + ftruncate (file, chars_read - (bp - buffer)); +#endif + + if (close (file) < 0 && rv == 0) + rv = errno; + } + + truncate_exit: + + FREE (buffer); + + xfree (filename); + return rv; +} + +/* Workhorse function for writing history. Writes NELEMENT entries + from the history list to FILENAME. OVERWRITE is non-zero if you + wish to replace FILENAME with the entries. */ +static int +history_do_write (filename, nelements, overwrite) + const char *filename; + int nelements, overwrite; +{ + register int i; + char *output, *bakname; + int file, mode, rv; +#ifdef HISTORY_USE_MMAP + size_t cursize; + + mode = overwrite ? O_RDWR|O_CREAT|O_TRUNC|O_BINARY : O_RDWR|O_APPEND|O_BINARY; +#else + mode = overwrite ? O_WRONLY|O_CREAT|O_TRUNC|O_BINARY : O_WRONLY|O_APPEND|O_BINARY; +#endif + output = history_filename (filename); + bakname = (overwrite && output) ? history_backupfile (output) : 0; + + if (output && bakname) + rename (output, bakname); + + file = output ? open (output, mode, 0600) : -1; + rv = 0; + + if (file == -1) + { + rv = errno; + if (output && bakname) + rename (bakname, output); + FREE (output); + FREE (bakname); + return (rv); + } + +#ifdef HISTORY_USE_MMAP + cursize = overwrite ? 0 : lseek (file, 0, SEEK_END); +#endif + + if (nelements > history_length) + nelements = history_length; + + /* Build a buffer of all the lines to write, and write them in one syscall. + Suggested by Peter Ho (peter@robosts.oxford.ac.uk). */ + { + HIST_ENTRY **the_history; /* local */ + register int j; + int buffer_size; + char *buffer; + + the_history = history_list (); + /* Calculate the total number of bytes to write. */ + for (buffer_size = 0, i = history_length - nelements; i < history_length; i++) +#if 0 + buffer_size += 2 + HISTENT_BYTES (the_history[i]); +#else + { + if (history_write_timestamps && the_history[i]->timestamp && the_history[i]->timestamp[0]) + buffer_size += strlen (the_history[i]->timestamp) + 1; + buffer_size += strlen (the_history[i]->line) + 1; + } +#endif + + /* Allocate the buffer, and fill it. */ +#ifdef HISTORY_USE_MMAP + if (ftruncate (file, buffer_size+cursize) == -1) + goto mmap_error; + buffer = (char *)mmap (0, buffer_size, PROT_READ|PROT_WRITE, MAP_WFLAGS, file, cursize); + if ((void *)buffer == MAP_FAILED) + { +mmap_error: + rv = errno; + close (file); + if (output && bakname) + rename (bakname, output); + FREE (output); + FREE (bakname); + return rv; + } +#else + buffer = (char *)malloc (buffer_size); + if (buffer == 0) + { + rv = errno; + close (file); + if (output && bakname) + rename (bakname, output); + FREE (output); + FREE (bakname); + return rv; + } +#endif + + for (j = 0, i = history_length - nelements; i < history_length; i++) + { + if (history_write_timestamps && the_history[i]->timestamp && the_history[i]->timestamp[0]) + { + strcpy (buffer + j, the_history[i]->timestamp); + j += strlen (the_history[i]->timestamp); + buffer[j++] = '\n'; + } + strcpy (buffer + j, the_history[i]->line); + j += strlen (the_history[i]->line); + buffer[j++] = '\n'; + } + +#ifdef HISTORY_USE_MMAP + if (msync (buffer, buffer_size, 0) != 0 || munmap (buffer, buffer_size) != 0) + rv = errno; +#else + if (write (file, buffer, buffer_size) < 0) + rv = errno; + xfree (buffer); +#endif + } + + if (close (file) < 0 && rv == 0) + rv = errno; + + if (rv != 0 && output && bakname) + rename (bakname, output); + else if (rv == 0 && bakname) + unlink (bakname); + + FREE (output); + FREE (bakname); + + return (rv); +} + +/* Append NELEMENT entries to FILENAME. The entries appended are from + the end of the list minus NELEMENTs up to the end of the list. */ +int +append_history (nelements, filename) + int nelements; + const char *filename; +{ + return (history_do_write (filename, nelements, HISTORY_APPEND)); +} + +/* Overwrite FILENAME with the current history. If FILENAME is NULL, + then write the history list to ~/.history. Values returned + are as in read_history ().*/ +int +write_history (filename) + const char *filename; +{ + return (history_do_write (filename, history_length, HISTORY_OVERWRITE)); +} diff --git a/lib/readline/histlib.h b/lib/readline/histlib.h new file mode 100644 index 0000000..c938a10 --- /dev/null +++ b/lib/readline/histlib.h @@ -0,0 +1,82 @@ +/* histlib.h -- internal definitions for the history library. */ + +/* Copyright (C) 1989-2009 Free Software Foundation, Inc. + + This file contains the GNU History Library (History), a set of + routines for managing the text of previously typed lines. + + History is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + History is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with History. If not, see . +*/ + +#if !defined (_HISTLIB_H_) +#define _HISTLIB_H_ + +#if defined (HAVE_STRING_H) +# include +#else +# include +#endif /* !HAVE_STRING_H */ + +#if !defined (STREQ) +#define STREQ(a, b) (((a)[0] == (b)[0]) && (strcmp ((a), (b)) == 0)) +#define STREQN(a, b, n) (((n) == 0) ? (1) \ + : ((a)[0] == (b)[0]) && (strncmp ((a), (b), (n)) == 0)) +#endif + +#ifndef savestring +#define savestring(x) strcpy (xmalloc (1 + strlen (x)), (x)) +#endif + +#ifndef whitespace +#define whitespace(c) (((c) == ' ') || ((c) == '\t')) +#endif + +#ifndef _rl_digit_p +#define _rl_digit_p(c) ((c) >= '0' && (c) <= '9') +#endif + +#ifndef _rl_digit_value +#define _rl_digit_value(c) ((c) - '0') +#endif + +#ifndef member +# ifndef strchr +extern char *strchr (); +# endif +#define member(c, s) ((c) ? ((char *)strchr ((s), (c)) != (char *)NULL) : 0) +#endif + +#ifndef FREE +# define FREE(x) if (x) free (x) +#endif + +/* Possible history errors passed to hist_error. */ +#define EVENT_NOT_FOUND 0 +#define BAD_WORD_SPEC 1 +#define SUBST_FAILED 2 +#define BAD_MODIFIER 3 +#define NO_PREV_SUBST 4 + +/* Possible definitions for history starting point specification. */ +#define ANCHORED_SEARCH 1 +#define NON_ANCHORED_SEARCH 0 + +/* Possible definitions for what style of writing the history file we want. */ +#define HISTORY_APPEND 0 +#define HISTORY_OVERWRITE 1 + +/* Some variable definitions shared across history source files. */ +extern int history_offset; + +#endif /* !_HISTLIB_H_ */ diff --git a/lib/readline/history.c b/lib/readline/history.c new file mode 100644 index 0000000..1181e7c --- /dev/null +++ b/lib/readline/history.c @@ -0,0 +1,519 @@ +/* history.c -- standalone history library */ + +/* Copyright (C) 1989-2011 Free Software Foundation, Inc. + + This file contains the GNU History Library (History), a set of + routines for managing the text of previously typed lines. + + History is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + History is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with History. If not, see . +*/ + +/* The goal is to make the implementation transparent, so that you + don't have to know what data types are used, just what functions + you can call. I think I have done that. */ +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "history.h" +#include "histlib.h" + +#include "xmalloc.h" + +/* The number of slots to increase the_history by. */ +#define DEFAULT_HISTORY_GROW_SIZE 50 + +static char *hist_inittime PARAMS((void)); + +/* **************************************************************** */ +/* */ +/* History Functions */ +/* */ +/* **************************************************************** */ + +/* An array of HIST_ENTRY. This is where we store the history. */ +static HIST_ENTRY **the_history = (HIST_ENTRY **)NULL; + +/* Non-zero means that we have enforced a limit on the amount of + history that we save. */ +static int history_stifled; + +/* The current number of slots allocated to the input_history. */ +static int history_size; + +/* If HISTORY_STIFLED is non-zero, then this is the maximum number of + entries to remember. */ +int history_max_entries; +int max_input_history; /* backwards compatibility */ + +/* The current location of the interactive history pointer. Just makes + life easier for outside callers. */ +int history_offset; + +/* The number of strings currently stored in the history list. */ +int history_length; + +/* The logical `base' of the history array. It defaults to 1. */ +int history_base = 1; + +/* Return the current HISTORY_STATE of the history. */ +HISTORY_STATE * +history_get_history_state () +{ + HISTORY_STATE *state; + + state = (HISTORY_STATE *)xmalloc (sizeof (HISTORY_STATE)); + state->entries = the_history; + state->offset = history_offset; + state->length = history_length; + state->size = history_size; + state->flags = 0; + if (history_stifled) + state->flags |= HS_STIFLED; + + return (state); +} + +/* Set the state of the current history array to STATE. */ +void +history_set_history_state (state) + HISTORY_STATE *state; +{ + the_history = state->entries; + history_offset = state->offset; + history_length = state->length; + history_size = state->size; + if (state->flags & HS_STIFLED) + history_stifled = 1; +} + +/* Begin a session in which the history functions might be used. This + initializes interactive variables. */ +void +using_history () +{ + history_offset = history_length; +} + +/* Return the number of bytes that the primary history entries are using. + This just adds up the lengths of the_history->lines and the associated + timestamps. */ +int +history_total_bytes () +{ + register int i, result; + + for (i = result = 0; the_history && the_history[i]; i++) + result += HISTENT_BYTES (the_history[i]); + + return (result); +} + +/* Returns the magic number which says what history element we are + looking at now. In this implementation, it returns history_offset. */ +int +where_history () +{ + return (history_offset); +} + +/* Make the current history item be the one at POS, an absolute index. + Returns zero if POS is out of range, else non-zero. */ +int +history_set_pos (pos) + int pos; +{ + if (pos > history_length || pos < 0 || !the_history) + return (0); + history_offset = pos; + return (1); +} + +/* Return the current history array. The caller has to be careful, since this + is the actual array of data, and could be bashed or made corrupt easily. + The array is terminated with a NULL pointer. */ +HIST_ENTRY ** +history_list () +{ + return (the_history); +} + +/* Return the history entry at the current position, as determined by + history_offset. If there is no entry there, return a NULL pointer. */ +HIST_ENTRY * +current_history () +{ + return ((history_offset == history_length) || the_history == 0) + ? (HIST_ENTRY *)NULL + : the_history[history_offset]; +} + +/* Back up history_offset to the previous history entry, and return + a pointer to that entry. If there is no previous entry then return + a NULL pointer. */ +HIST_ENTRY * +previous_history () +{ + return history_offset ? the_history[--history_offset] : (HIST_ENTRY *)NULL; +} + +/* Move history_offset forward to the next history entry, and return + a pointer to that entry. If there is no next entry then return a + NULL pointer. */ +HIST_ENTRY * +next_history () +{ + return (history_offset == history_length) ? (HIST_ENTRY *)NULL : the_history[++history_offset]; +} + +/* Return the history entry which is logically at OFFSET in the history array. + OFFSET is relative to history_base. */ +HIST_ENTRY * +history_get (offset) + int offset; +{ + int local_index; + + local_index = offset - history_base; + return (local_index >= history_length || local_index < 0 || the_history == 0) + ? (HIST_ENTRY *)NULL + : the_history[local_index]; +} + +HIST_ENTRY * +alloc_history_entry (string, ts) + char *string; + char *ts; +{ + HIST_ENTRY *temp; + + temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY)); + + temp->line = string ? savestring (string) : string; + temp->data = (char *)NULL; + temp->timestamp = ts; + + return temp; +} + +time_t +history_get_time (hist) + HIST_ENTRY *hist; +{ + char *ts; + time_t t; + + if (hist == 0 || hist->timestamp == 0) + return 0; + ts = hist->timestamp; + if (ts[0] != history_comment_char) + return 0; + t = (time_t) strtol (ts + 1, (char **)NULL, 10); /* XXX - should use strtol() here */ + return t; +} + +static char * +hist_inittime () +{ + time_t t; + char ts[64], *ret; + + t = (time_t) time ((time_t *)0); +#if defined (HAVE_VSNPRINTF) /* assume snprintf if vsnprintf exists */ + snprintf (ts, sizeof (ts) - 1, "X%lu", (unsigned long) t); +#else + sprintf (ts, "X%lu", (unsigned long) t); +#endif + ret = savestring (ts); + ret[0] = history_comment_char; + + return ret; +} + +/* Place STRING at the end of the history list. The data field + is set to NULL. */ +void +add_history (string) + const char *string; +{ + HIST_ENTRY *temp; + + if (history_stifled && (history_length == history_max_entries)) + { + register int i; + + /* If the history is stifled, and history_length is zero, + and it equals history_max_entries, we don't save items. */ + if (history_length == 0) + return; + + /* If there is something in the slot, then remove it. */ + if (the_history[0]) + (void) free_history_entry (the_history[0]); + + /* Copy the rest of the entries, moving down one slot. */ + for (i = 0; i < history_length; i++) + the_history[i] = the_history[i + 1]; + + history_base++; + } + else + { + if (history_size == 0) + { + history_size = DEFAULT_HISTORY_GROW_SIZE; + the_history = (HIST_ENTRY **)xmalloc (history_size * sizeof (HIST_ENTRY *)); + history_length = 1; + } + else + { + if (history_length == (history_size - 1)) + { + history_size += DEFAULT_HISTORY_GROW_SIZE; + the_history = (HIST_ENTRY **) + xrealloc (the_history, history_size * sizeof (HIST_ENTRY *)); + } + history_length++; + } + } + + temp = alloc_history_entry (string, hist_inittime ()); + + the_history[history_length] = (HIST_ENTRY *)NULL; + the_history[history_length - 1] = temp; +} + +/* Change the time stamp of the most recent history entry to STRING. */ +void +add_history_time (string) + const char *string; +{ + HIST_ENTRY *hs; + + if (string == 0 || history_length < 1) + return; + hs = the_history[history_length - 1]; + FREE (hs->timestamp); + hs->timestamp = savestring (string); +} + +/* Free HIST and return the data so the calling application can free it + if necessary and desired. */ +histdata_t +free_history_entry (hist) + HIST_ENTRY *hist; +{ + histdata_t x; + + if (hist == 0) + return ((histdata_t) 0); + FREE (hist->line); + FREE (hist->timestamp); + x = hist->data; + xfree (hist); + return (x); +} + +HIST_ENTRY * +copy_history_entry (hist) + HIST_ENTRY *hist; +{ + HIST_ENTRY *ret; + char *ts; + + if (hist == 0) + return hist; + + ret = alloc_history_entry (hist->line, (char *)NULL); + + ts = hist->timestamp ? savestring (hist->timestamp) : hist->timestamp; + ret->timestamp = ts; + + ret->data = hist->data; + + return ret; +} + +/* Make the history entry at WHICH have LINE and DATA. This returns + the old entry so you can dispose of the data. In the case of an + invalid WHICH, a NULL pointer is returned. */ +HIST_ENTRY * +replace_history_entry (which, line, data) + int which; + const char *line; + histdata_t data; +{ + HIST_ENTRY *temp, *old_value; + + if (which < 0 || which >= history_length) + return ((HIST_ENTRY *)NULL); + + temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY)); + old_value = the_history[which]; + + temp->line = savestring (line); + temp->data = data; + temp->timestamp = savestring (old_value->timestamp); + the_history[which] = temp; + + return (old_value); +} + +/* Replace the DATA in the specified history entries, replacing OLD with + NEW. WHICH says which one(s) to replace: WHICH == -1 means to replace + all of the history entries where entry->data == OLD; WHICH == -2 means + to replace the `newest' history entry where entry->data == OLD; and + WHICH >= 0 means to replace that particular history entry's data, as + long as it matches OLD. */ +void +replace_history_data (which, old, new) + int which; + histdata_t *old, *new; +{ + HIST_ENTRY *entry; + register int i, last; + + if (which < -2 || which >= history_length || history_length == 0 || the_history == 0) + return; + + if (which >= 0) + { + entry = the_history[which]; + if (entry && entry->data == old) + entry->data = new; + return; + } + + last = -1; + for (i = 0; i < history_length; i++) + { + entry = the_history[i]; + if (entry == 0) + continue; + if (entry->data == old) + { + last = i; + if (which == -1) + entry->data = new; + } + } + if (which == -2 && last >= 0) + { + entry = the_history[last]; + entry->data = new; /* XXX - we don't check entry->old */ + } +} + +/* Remove history element WHICH from the history. The removed + element is returned to you so you can free the line, data, + and containing structure. */ +HIST_ENTRY * +remove_history (which) + int which; +{ + HIST_ENTRY *return_value; + register int i; + + if (which < 0 || which >= history_length || history_length == 0 || the_history == 0) + return ((HIST_ENTRY *)NULL); + + return_value = the_history[which]; + + for (i = which; i < history_length; i++) + the_history[i] = the_history[i + 1]; + + history_length--; + + return (return_value); +} + +/* Stifle the history list, remembering only MAX number of lines. */ +void +stifle_history (max) + int max; +{ + register int i, j; + + if (max < 0) + max = 0; + + if (history_length > max) + { + /* This loses because we cannot free the data. */ + for (i = 0, j = history_length - max; i < j; i++) + free_history_entry (the_history[i]); + + history_base = i; + for (j = 0, i = history_length - max; j < max; i++, j++) + the_history[j] = the_history[i]; + the_history[j] = (HIST_ENTRY *)NULL; + history_length = j; + } + + history_stifled = 1; + max_input_history = history_max_entries = max; +} + +/* Stop stifling the history. This returns the previous maximum + number of history entries. The value is positive if the history + was stifled, negative if it wasn't. */ +int +unstifle_history () +{ + if (history_stifled) + { + history_stifled = 0; + return (history_max_entries); + } + else + return (-history_max_entries); +} + +int +history_is_stifled () +{ + return (history_stifled); +} + +void +clear_history () +{ + register int i; + + /* This loses because we cannot free the data. */ + for (i = 0; i < history_length; i++) + { + free_history_entry (the_history[i]); + the_history[i] = (HIST_ENTRY *)NULL; + } + + history_offset = history_length = 0; +} diff --git a/lib/readline/history.h b/lib/readline/history.h new file mode 100644 index 0000000..c8af47e --- /dev/null +++ b/lib/readline/history.h @@ -0,0 +1,266 @@ +/* history.h -- the names of functions that you can call in history. */ + +/* Copyright (C) 1989-2009 Free Software Foundation, Inc. + + This file contains the GNU History Library (History), a set of + routines for managing the text of previously typed lines. + + History is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + History is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with History. If not, see . +*/ + +#ifndef _HISTORY_H_ +#define _HISTORY_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include /* XXX - for history timestamp code */ + +#if defined READLINE_LIBRARY +# include "rlstdc.h" +# include "rltypedefs.h" +#else +# include +# include +#endif + +#ifdef __STDC__ +typedef void *histdata_t; +#else +typedef char *histdata_t; +#endif + +/* The structure used to store a history entry. */ +typedef struct _hist_entry { + char *line; + char *timestamp; /* char * rather than time_t for read/write */ + histdata_t data; +} HIST_ENTRY; + +/* Size of the history-library-managed space in history entry HS. */ +#define HISTENT_BYTES(hs) (strlen ((hs)->line) + strlen ((hs)->timestamp)) + +/* A structure used to pass the current state of the history stuff around. */ +typedef struct _hist_state { + HIST_ENTRY **entries; /* Pointer to the entries themselves. */ + int offset; /* The location pointer within this array. */ + int length; /* Number of elements within this array. */ + int size; /* Number of slots allocated to this array. */ + int flags; +} HISTORY_STATE; + +/* Flag values for the `flags' member of HISTORY_STATE. */ +#define HS_STIFLED 0x01 + +/* Initialization and state management. */ + +/* Begin a session in which the history functions might be used. This + just initializes the interactive variables. */ +extern void using_history PARAMS((void)); + +/* Return the current HISTORY_STATE of the history. */ +extern HISTORY_STATE *history_get_history_state PARAMS((void)); + +/* Set the state of the current history array to STATE. */ +extern void history_set_history_state PARAMS((HISTORY_STATE *)); + +/* Manage the history list. */ + +/* Place STRING at the end of the history list. + The associated data field (if any) is set to NULL. */ +extern void add_history PARAMS((const char *)); + +/* Change the timestamp associated with the most recent history entry to + STRING. */ +extern void add_history_time PARAMS((const char *)); + +/* A reasonably useless function, only here for completeness. WHICH + is the magic number that tells us which element to delete. The + elements are numbered from 0. */ +extern HIST_ENTRY *remove_history PARAMS((int)); + +/* Free the history entry H and return any application-specific data + associated with it. */ +extern histdata_t free_history_entry PARAMS((HIST_ENTRY *)); + +/* Make the history entry at WHICH have LINE and DATA. This returns + the old entry so you can dispose of the data. In the case of an + invalid WHICH, a NULL pointer is returned. */ +extern HIST_ENTRY *replace_history_entry PARAMS((int, const char *, histdata_t)); + +/* Clear the history list and start over. */ +extern void clear_history PARAMS((void)); + +/* Stifle the history list, remembering only MAX number of entries. */ +extern void stifle_history PARAMS((int)); + +/* Stop stifling the history. This returns the previous amount the + history was stifled by. The value is positive if the history was + stifled, negative if it wasn't. */ +extern int unstifle_history PARAMS((void)); + +/* Return 1 if the history is stifled, 0 if it is not. */ +extern int history_is_stifled PARAMS((void)); + +/* Information about the history list. */ + +/* Return a NULL terminated array of HIST_ENTRY which is the current input + history. Element 0 of this list is the beginning of time. If there + is no history, return NULL. */ +extern HIST_ENTRY **history_list PARAMS((void)); + +/* Returns the number which says what history element we are now + looking at. */ +extern int where_history PARAMS((void)); + +/* Return the history entry at the current position, as determined by + history_offset. If there is no entry there, return a NULL pointer. */ +extern HIST_ENTRY *current_history PARAMS((void)); + +/* Return the history entry which is logically at OFFSET in the history + array. OFFSET is relative to history_base. */ +extern HIST_ENTRY *history_get PARAMS((int)); + +/* Return the timestamp associated with the HIST_ENTRY * passed as an + argument */ +extern time_t history_get_time PARAMS((HIST_ENTRY *)); + +/* Return the number of bytes that the primary history entries are using. + This just adds up the lengths of the_history->lines. */ +extern int history_total_bytes PARAMS((void)); + +/* Moving around the history list. */ + +/* Set the position in the history list to POS. */ +extern int history_set_pos PARAMS((int)); + +/* Back up history_offset to the previous history entry, and return + a pointer to that entry. If there is no previous entry, return + a NULL pointer. */ +extern HIST_ENTRY *previous_history PARAMS((void)); + +/* Move history_offset forward to the next item in the input_history, + and return the a pointer to that entry. If there is no next entry, + return a NULL pointer. */ +extern HIST_ENTRY *next_history PARAMS((void)); + +/* Searching the history list. */ + +/* Search the history for STRING, starting at history_offset. + If DIRECTION < 0, then the search is through previous entries, + else through subsequent. If the string is found, then + current_history () is the history entry, and the value of this function + is the offset in the line of that history entry that the string was + found in. Otherwise, nothing is changed, and a -1 is returned. */ +extern int history_search PARAMS((const char *, int)); + +/* Search the history for STRING, starting at history_offset. + The search is anchored: matching lines must begin with string. + DIRECTION is as in history_search(). */ +extern int history_search_prefix PARAMS((const char *, int)); + +/* Search for STRING in the history list, starting at POS, an + absolute index into the list. DIR, if negative, says to search + backwards from POS, else forwards. + Returns the absolute index of the history element where STRING + was found, or -1 otherwise. */ +extern int history_search_pos PARAMS((const char *, int, int)); + +/* Managing the history file. */ + +/* Add the contents of FILENAME to the history list, a line at a time. + If FILENAME is NULL, then read from ~/.history. Returns 0 if + successful, or errno if not. */ +extern int read_history PARAMS((const char *)); + +/* Read a range of lines from FILENAME, adding them to the history list. + Start reading at the FROM'th line and end at the TO'th. If FROM + is zero, start at the beginning. If TO is less than FROM, read + until the end of the file. If FILENAME is NULL, then read from + ~/.history. Returns 0 if successful, or errno if not. */ +extern int read_history_range PARAMS((const char *, int, int)); + +/* Write the current history to FILENAME. If FILENAME is NULL, + then write the history list to ~/.history. Values returned + are as in read_history (). */ +extern int write_history PARAMS((const char *)); + +/* Append NELEMENT entries to FILENAME. The entries appended are from + the end of the list minus NELEMENTs up to the end of the list. */ +extern int append_history PARAMS((int, const char *)); + +/* Truncate the history file, leaving only the last NLINES lines. */ +extern int history_truncate_file PARAMS((const char *, int)); + +/* History expansion. */ + +/* Expand the string STRING, placing the result into OUTPUT, a pointer + to a string. Returns: + + 0) If no expansions took place (or, if the only change in + the text was the de-slashifying of the history expansion + character) + 1) If expansions did take place + -1) If there was an error in expansion. + 2) If the returned line should just be printed. + + If an error occurred in expansion, then OUTPUT contains a descriptive + error message. */ +extern int history_expand PARAMS((char *, char **)); + +/* Extract a string segment consisting of the FIRST through LAST + arguments present in STRING. Arguments are broken up as in + the shell. */ +extern char *history_arg_extract PARAMS((int, int, const char *)); + +/* Return the text of the history event beginning at the current + offset into STRING. Pass STRING with *INDEX equal to the + history_expansion_char that begins this specification. + DELIMITING_QUOTE is a character that is allowed to end the string + specification for what to search for in addition to the normal + characters `:', ` ', `\t', `\n', and sometimes `?'. */ +extern char *get_history_event PARAMS((const char *, int *, int)); + +/* Return an array of tokens, much as the shell might. The tokens are + parsed out of STRING. */ +extern char **history_tokenize PARAMS((const char *)); + +/* Exported history variables. */ +extern int history_base; +extern int history_length; +extern int history_max_entries; +extern char history_expansion_char; +extern char history_subst_char; +extern char *history_word_delimiters; +extern char history_comment_char; +extern char *history_no_expand_chars; +extern char *history_search_delimiter_chars; +extern int history_quotes_inhibit_expansion; + +extern int history_write_timestamps; + +/* Backwards compatibility */ +extern int max_input_history; + +/* If set, this function is called to decide whether or not a particular + history expansion should be treated as a special case for the calling + application and not expanded. */ +extern rl_linebuf_func_t *history_inhibit_expansion_function; + +#ifdef __cplusplus +} +#endif + +#endif /* !_HISTORY_H_ */ diff --git a/lib/readline/histsearch.c b/lib/readline/histsearch.c new file mode 100644 index 0000000..1ad55d2 --- /dev/null +++ b/lib/readline/histsearch.c @@ -0,0 +1,194 @@ +/* histsearch.c -- searching the history list. */ + +/* Copyright (C) 1989, 1992-2009 Free Software Foundation, Inc. + + This file contains the GNU History Library (History), a set of + routines for managing the text of previously typed lines. + + History is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + History is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with History. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "history.h" +#include "histlib.h" + +/* The list of alternate characters that can delimit a history search + string. */ +char *history_search_delimiter_chars = (char *)NULL; + +static int history_search_internal PARAMS((const char *, int, int)); + +/* Search the history for STRING, starting at history_offset. + If DIRECTION < 0, then the search is through previous entries, else + through subsequent. If ANCHORED is non-zero, the string must + appear at the beginning of a history line, otherwise, the string + may appear anywhere in the line. If the string is found, then + current_history () is the history entry, and the value of this + function is the offset in the line of that history entry that the + string was found in. Otherwise, nothing is changed, and a -1 is + returned. */ + +static int +history_search_internal (string, direction, anchored) + const char *string; + int direction, anchored; +{ + register int i, reverse; + register char *line; + register int line_index; + int string_len; + HIST_ENTRY **the_history; /* local */ + + i = history_offset; + reverse = (direction < 0); + + /* Take care of trivial cases first. */ + if (string == 0 || *string == '\0') + return (-1); + + if (!history_length || ((i >= history_length) && !reverse)) + return (-1); + + if (reverse && (i >= history_length)) + i = history_length - 1; + +#define NEXT_LINE() do { if (reverse) i--; else i++; } while (0) + + the_history = history_list (); + string_len = strlen (string); + while (1) + { + /* Search each line in the history list for STRING. */ + + /* At limit for direction? */ + if ((reverse && i < 0) || (!reverse && i == history_length)) + return (-1); + + line = the_history[i]->line; + line_index = strlen (line); + + /* If STRING is longer than line, no match. */ + if (string_len > line_index) + { + NEXT_LINE (); + continue; + } + + /* Handle anchored searches first. */ + if (anchored == ANCHORED_SEARCH) + { + if (STREQN (string, line, string_len)) + { + history_offset = i; + return (0); + } + + NEXT_LINE (); + continue; + } + + /* Do substring search. */ + if (reverse) + { + line_index -= string_len; + + while (line_index >= 0) + { + if (STREQN (string, line + line_index, string_len)) + { + history_offset = i; + return (line_index); + } + line_index--; + } + } + else + { + register int limit; + + limit = line_index - string_len + 1; + line_index = 0; + + while (line_index < limit) + { + if (STREQN (string, line + line_index, string_len)) + { + history_offset = i; + return (line_index); + } + line_index++; + } + } + NEXT_LINE (); + } +} + +/* Do a non-anchored search for STRING through the history in DIRECTION. */ +int +history_search (string, direction) + const char *string; + int direction; +{ + return (history_search_internal (string, direction, NON_ANCHORED_SEARCH)); +} + +/* Do an anchored search for string through the history in DIRECTION. */ +int +history_search_prefix (string, direction) + const char *string; + int direction; +{ + return (history_search_internal (string, direction, ANCHORED_SEARCH)); +} + +/* Search for STRING in the history list. DIR is < 0 for searching + backwards. POS is an absolute index into the history list at + which point to begin searching. */ +int +history_search_pos (string, dir, pos) + const char *string; + int dir, pos; +{ + int ret, old; + + old = where_history (); + history_set_pos (pos); + if (history_search (string, dir) == -1) + { + history_set_pos (old); + return (-1); + } + ret = where_history (); + history_set_pos (old); + return ret; +} diff --git a/lib/readline/input.c b/lib/readline/input.c new file mode 100644 index 0000000..f3f6d59 --- /dev/null +++ b/lib/readline/input.c @@ -0,0 +1,633 @@ +/* input.c -- character input functions for readline. */ + +/* Copyright (C) 1994-2013 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (__TANDEM) +# include +#endif + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include +#include +#if defined (HAVE_SYS_FILE_H) +# include +#endif /* HAVE_SYS_FILE_H */ + +#if defined (HAVE_UNISTD_H) +# include +#endif /* HAVE_UNISTD_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include + +#include "posixselect.h" + +#if defined (FIONREAD_IN_SYS_IOCTL) +# include +#endif + +#include +#include + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" +#include "rlmbutil.h" + +/* Some standard library routines. */ +#include "readline.h" + +#include "rlprivate.h" +#include "rlshell.h" +#include "xmalloc.h" + +/* What kind of non-blocking I/O do we have? */ +#if !defined (O_NDELAY) && defined (O_NONBLOCK) +# define O_NDELAY O_NONBLOCK /* Posix style */ +#endif + +/* Non-null means it is a pointer to a function to run while waiting for + character input. */ +rl_hook_func_t *rl_event_hook = (rl_hook_func_t *)NULL; + +/* A function to call if a read(2) is interrupted by a signal. */ +rl_hook_func_t *rl_signal_event_hook = (rl_hook_func_t *)NULL; + +/* A function to replace _rl_input_available for applications using the + callback interface. */ +rl_hook_func_t *rl_input_available_hook = (rl_hook_func_t *)NULL; + +rl_getc_func_t *rl_getc_function = rl_getc; + +static int _keyboard_input_timeout = 100000; /* 0.1 seconds; it's in usec */ + +static int ibuffer_space PARAMS((void)); +static int rl_get_char PARAMS((int *)); +static int rl_gather_tyi PARAMS((void)); + +/* **************************************************************** */ +/* */ +/* Character Input Buffering */ +/* */ +/* **************************************************************** */ + +static int pop_index, push_index; +static unsigned char ibuffer[512]; +static int ibuffer_len = sizeof (ibuffer) - 1; + +#define any_typein (push_index != pop_index) + +int +_rl_any_typein () +{ + return any_typein; +} + +int +_rl_pushed_input_available () +{ + return (push_index != pop_index); +} + +/* Return the amount of space available in the buffer for stuffing + characters. */ +static int +ibuffer_space () +{ + if (pop_index > push_index) + return (pop_index - push_index - 1); + else + return (ibuffer_len - (push_index - pop_index)); +} + +/* Get a key from the buffer of characters to be read. + Return the key in KEY. + Result is non-zero if there was a key, or 0 if there wasn't. */ +static int +rl_get_char (key) + int *key; +{ + if (push_index == pop_index) + return (0); + + *key = ibuffer[pop_index++]; +#if 0 + if (pop_index >= ibuffer_len) +#else + if (pop_index > ibuffer_len) +#endif + pop_index = 0; + + return (1); +} + +/* Stuff KEY into the *front* of the input buffer. + Returns non-zero if successful, zero if there is + no space left in the buffer. */ +int +_rl_unget_char (key) + int key; +{ + if (ibuffer_space ()) + { + pop_index--; + if (pop_index < 0) + pop_index = ibuffer_len; + ibuffer[pop_index] = key; + return (1); + } + return (0); +} + +/* If a character is available to be read, then read it and stuff it into + IBUFFER. Otherwise, just return. Returns number of characters read + (0 if none available) and -1 on error (EIO). */ +static int +rl_gather_tyi () +{ + int tty; + register int tem, result; + int chars_avail, k; + char input; +#if defined(HAVE_SELECT) + fd_set readfds, exceptfds; + struct timeval timeout; +#endif + + chars_avail = 0; + tty = fileno (rl_instream); + +#if defined (HAVE_SELECT) + FD_ZERO (&readfds); + FD_ZERO (&exceptfds); + FD_SET (tty, &readfds); + FD_SET (tty, &exceptfds); + USEC_TO_TIMEVAL (_keyboard_input_timeout, timeout); + result = select (tty + 1, &readfds, (fd_set *)NULL, &exceptfds, &timeout); + if (result <= 0) + return 0; /* Nothing to read. */ +#endif + + result = -1; +#if defined (FIONREAD) + errno = 0; + result = ioctl (tty, FIONREAD, &chars_avail); + if (result == -1 && errno == EIO) + return -1; +#endif + +#if defined (O_NDELAY) + if (result == -1) + { + tem = fcntl (tty, F_GETFL, 0); + + fcntl (tty, F_SETFL, (tem | O_NDELAY)); + chars_avail = read (tty, &input, 1); + + fcntl (tty, F_SETFL, tem); + if (chars_avail == -1 && errno == EAGAIN) + return 0; + if (chars_avail == 0) /* EOF */ + { + rl_stuff_char (EOF); + return (0); + } + } +#endif /* O_NDELAY */ + +#if defined (__MINGW32__) + /* Use getch/_kbhit to check for available console input, in the same way + that we read it normally. */ + chars_avail = isatty (tty) ? _kbhit () : 0; + result = 0; +#endif + + /* If there's nothing available, don't waste time trying to read + something. */ + if (chars_avail <= 0) + return 0; + + tem = ibuffer_space (); + + if (chars_avail > tem) + chars_avail = tem; + + /* One cannot read all of the available input. I can only read a single + character at a time, or else programs which require input can be + thwarted. If the buffer is larger than one character, I lose. + Damn! */ + if (tem < ibuffer_len) + chars_avail = 0; + + if (result != -1) + { + while (chars_avail--) + { + RL_CHECK_SIGNALS (); + k = (*rl_getc_function) (rl_instream); + if (rl_stuff_char (k) == 0) + break; /* some problem; no more room */ + if (k == NEWLINE || k == RETURN) + break; + } + } + else + { + if (chars_avail) + rl_stuff_char (input); + } + + return 1; +} + +int +rl_set_keyboard_input_timeout (u) + int u; +{ + int o; + + o = _keyboard_input_timeout; + if (u >= 0) + _keyboard_input_timeout = u; + return (o); +} + +/* Is there input available to be read on the readline input file + descriptor? Only works if the system has select(2) or FIONREAD. + Uses the value of _keyboard_input_timeout as the timeout; if another + readline function wants to specify a timeout and not leave it up to + the user, it should use _rl_input_queued(timeout_value_in_microseconds) + instead. */ +int +_rl_input_available () +{ +#if defined(HAVE_SELECT) + fd_set readfds, exceptfds; + struct timeval timeout; +#endif +#if !defined (HAVE_SELECT) && defined(FIONREAD) + int chars_avail; +#endif + int tty; + + if (rl_input_available_hook) + return (*rl_input_available_hook) (); + + tty = fileno (rl_instream); + +#if defined (HAVE_SELECT) + FD_ZERO (&readfds); + FD_ZERO (&exceptfds); + FD_SET (tty, &readfds); + FD_SET (tty, &exceptfds); + timeout.tv_sec = 0; + timeout.tv_usec = _keyboard_input_timeout; + return (select (tty + 1, &readfds, (fd_set *)NULL, &exceptfds, &timeout) > 0); +#else + +#if defined (FIONREAD) + if (ioctl (tty, FIONREAD, &chars_avail) == 0) + return (chars_avail); +#endif + +#endif + +#if defined (__MINGW32__) + if (isatty (tty)) + return (_kbhit ()); +#endif + + return 0; +} + +int +_rl_input_queued (t) + int t; +{ + int old_timeout, r; + + old_timeout = rl_set_keyboard_input_timeout (t); + r = _rl_input_available (); + rl_set_keyboard_input_timeout (old_timeout); + return r; +} + +void +_rl_insert_typein (c) + int c; +{ + int key, t, i; + char *string; + + i = key = 0; + string = (char *)xmalloc (ibuffer_len + 1); + string[i++] = (char) c; + + while ((t = rl_get_char (&key)) && + _rl_keymap[key].type == ISFUNC && + _rl_keymap[key].function == rl_insert) + string[i++] = key; + + if (t) + _rl_unget_char (key); + + string[i] = '\0'; + rl_insert_text (string); + xfree (string); +} + +/* Add KEY to the buffer of characters to be read. Returns 1 if the + character was stuffed correctly; 0 otherwise. */ +int +rl_stuff_char (key) + int key; +{ + if (ibuffer_space () == 0) + return 0; + + if (key == EOF) + { + key = NEWLINE; + rl_pending_input = EOF; + RL_SETSTATE (RL_STATE_INPUTPENDING); + } + ibuffer[push_index++] = key; +#if 0 + if (push_index >= ibuffer_len) +#else + if (push_index > ibuffer_len) +#endif + push_index = 0; + + return 1; +} + +/* Make C be the next command to be executed. */ +int +rl_execute_next (c) + int c; +{ + rl_pending_input = c; + RL_SETSTATE (RL_STATE_INPUTPENDING); + return 0; +} + +/* Clear any pending input pushed with rl_execute_next() */ +int +rl_clear_pending_input () +{ + rl_pending_input = 0; + RL_UNSETSTATE (RL_STATE_INPUTPENDING); + return 0; +} + +/* **************************************************************** */ +/* */ +/* Character Input */ +/* */ +/* **************************************************************** */ + +/* Read a key, including pending input. */ +int +rl_read_key () +{ + int c, r; + + if (rl_pending_input) + { + c = rl_pending_input; + rl_clear_pending_input (); + } + else + { + /* If input is coming from a macro, then use that. */ + if (c = _rl_next_macro_key ()) + return (c); + + /* If the user has an event function, then call it periodically. */ + if (rl_event_hook) + { + while (rl_event_hook) + { + if (rl_get_char (&c) != 0) + break; + + if ((r = rl_gather_tyi ()) < 0) /* XXX - EIO */ + { + rl_done = 1; + return ('\n'); + } + else if (r > 0) /* read something */ + continue; + + RL_CHECK_SIGNALS (); + if (rl_done) /* XXX - experimental */ + return ('\n'); + (*rl_event_hook) (); + } + } + else + { + if (rl_get_char (&c) == 0) + c = (*rl_getc_function) (rl_instream); +/* fprintf(stderr, "rl_read_key: calling RL_CHECK_SIGNALS: _rl_caught_signal = %d", _rl_caught_signal); */ + RL_CHECK_SIGNALS (); + } + } + + return (c); +} + +int +rl_getc (stream) + FILE *stream; +{ + int result; + unsigned char c; + + while (1) + { + RL_CHECK_SIGNALS (); + + /* We know at this point that _rl_caught_signal == 0 */ + +#if defined (__MINGW32__) + if (isatty (fileno (stream))) + return (getch ()); +#endif + result = read (fileno (stream), &c, sizeof (unsigned char)); + + if (result == sizeof (unsigned char)) + return (c); + + /* If zero characters are returned, then the file that we are + reading from is empty! Return EOF in that case. */ + if (result == 0) + return (EOF); + +#if defined (__BEOS__) + if (errno == EINTR) + continue; +#endif + +#if defined (EWOULDBLOCK) +# define X_EWOULDBLOCK EWOULDBLOCK +#else +# define X_EWOULDBLOCK -99 +#endif + +#if defined (EAGAIN) +# define X_EAGAIN EAGAIN +#else +# define X_EAGAIN -99 +#endif + + if (errno == X_EWOULDBLOCK || errno == X_EAGAIN) + { + if (sh_unset_nodelay_mode (fileno (stream)) < 0) + return (EOF); + continue; + } + +#undef X_EWOULDBLOCK +#undef X_EAGAIN + +/* fprintf(stderr, "rl_getc: result = %d errno = %d\n", result, errno); */ + + /* If the error that we received was EINTR, then try again, + this is simply an interrupted system call to read (). We allow + the read to be interrupted if we caught SIGHUP or SIGTERM (but + not SIGINT; let the signal handler deal with that), but if the + application sets an event hook, call it for other signals. + Otherwise (not EINTR), some error occurred, also signifying EOF. */ + if (errno != EINTR) + return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF); + else if (_rl_caught_signal == SIGHUP || _rl_caught_signal == SIGTERM) + return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF); + /* keyboard-generated signals of interest */ + else if (_rl_caught_signal == SIGINT || _rl_caught_signal == SIGQUIT) + RL_CHECK_SIGNALS (); + /* non-keyboard-generated signals of interest */ + else if (_rl_caught_signal == SIGALRM +#if defined (SIGVTALRM) + || _rl_caught_signal == SIGVTALRM +#endif + ) + RL_CHECK_SIGNALS (); + + if (rl_signal_event_hook) + (*rl_signal_event_hook) (); + } +} + +#if defined (HANDLE_MULTIBYTE) +/* read multibyte char */ +int +_rl_read_mbchar (mbchar, size) + char *mbchar; + int size; +{ + int mb_len, c; + size_t mbchar_bytes_length; + wchar_t wc; + mbstate_t ps, ps_back; + + memset(&ps, 0, sizeof (mbstate_t)); + memset(&ps_back, 0, sizeof (mbstate_t)); + + mb_len = 0; + while (mb_len < size) + { + RL_SETSTATE(RL_STATE_MOREINPUT); + c = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + + if (c < 0) + break; + + mbchar[mb_len++] = c; + + mbchar_bytes_length = mbrtowc (&wc, mbchar, mb_len, &ps); + if (mbchar_bytes_length == (size_t)(-1)) + break; /* invalid byte sequence for the current locale */ + else if (mbchar_bytes_length == (size_t)(-2)) + { + /* shorted bytes */ + ps = ps_back; + continue; + } + else if (mbchar_bytes_length == 0) + { + mbchar[0] = '\0'; /* null wide character */ + mb_len = 1; + break; + } + else if (mbchar_bytes_length > (size_t)(0)) + break; + } + + return mb_len; +} + +/* Read a multibyte-character string whose first character is FIRST into + the buffer MB of length MLEN. Returns the last character read, which + may be FIRST. Used by the search functions, among others. Very similar + to _rl_read_mbchar. */ +int +_rl_read_mbstring (first, mb, mlen) + int first; + char *mb; + int mlen; +{ + int i, c; + mbstate_t ps; + + c = first; + memset (mb, 0, mlen); + for (i = 0; c >= 0 && i < mlen; i++) + { + mb[i] = (char)c; + memset (&ps, 0, sizeof (mbstate_t)); + if (_rl_get_char_len (mb, &ps) == -2) + { + /* Read more for multibyte character */ + RL_SETSTATE (RL_STATE_MOREINPUT); + c = rl_read_key (); + RL_UNSETSTATE (RL_STATE_MOREINPUT); + } + else + break; + } + return c; +} +#endif /* HANDLE_MULTIBYTE */ diff --git a/lib/readline/isearch.c b/lib/readline/isearch.c new file mode 100644 index 0000000..6f6a7a6 --- /dev/null +++ b/lib/readline/isearch.c @@ -0,0 +1,789 @@ +/* isearch.c - incremental searching */ + +/* **************************************************************** */ +/* */ +/* I-Search and Searching */ +/* */ +/* **************************************************************** */ + +/* Copyright (C) 1987-2012 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif + +#include "rldefs.h" +#include "rlmbutil.h" + +#include "readline.h" +#include "history.h" + +#include "rlprivate.h" +#include "xmalloc.h" + +/* Variables exported to other files in the readline library. */ +char *_rl_isearch_terminators = (char *)NULL; + +_rl_search_cxt *_rl_iscxt = 0; + +/* Variables imported from other files in the readline library. */ +extern HIST_ENTRY *_rl_saved_line_for_history; + +static int rl_search_history PARAMS((int, int)); + +static _rl_search_cxt *_rl_isearch_init PARAMS((int)); +static void _rl_isearch_fini PARAMS((_rl_search_cxt *)); +static int _rl_isearch_cleanup PARAMS((_rl_search_cxt *, int)); + +/* Last line found by the current incremental search, so we don't `find' + identical lines many times in a row. Now part of isearch context. */ +/* static char *prev_line_found; */ + +/* Last search string and its length. */ +static char *last_isearch_string; +static int last_isearch_string_len; + +static char * const default_isearch_terminators = "\033\012"; + +_rl_search_cxt * +_rl_scxt_alloc (type, flags) + int type, flags; +{ + _rl_search_cxt *cxt; + + cxt = (_rl_search_cxt *)xmalloc (sizeof (_rl_search_cxt)); + + cxt->type = type; + cxt->sflags = flags; + + cxt->search_string = 0; + cxt->search_string_size = cxt->search_string_index = 0; + + cxt->lines = 0; + cxt->allocated_line = 0; + cxt->hlen = cxt->hindex = 0; + + cxt->save_point = rl_point; + cxt->save_mark = rl_mark; + cxt->save_line = where_history (); + cxt->last_found_line = cxt->save_line; + cxt->prev_line_found = 0; + + cxt->save_undo_list = 0; + + cxt->keymap = _rl_keymap; + cxt->okeymap = _rl_keymap; + + cxt->history_pos = 0; + cxt->direction = 0; + + cxt->prevc = cxt->lastc = 0; + + cxt->sline = 0; + cxt->sline_len = cxt->sline_index = 0; + + cxt->search_terminators = 0; + + return cxt; +} + +void +_rl_scxt_dispose (cxt, flags) + _rl_search_cxt *cxt; + int flags; +{ + FREE (cxt->search_string); + FREE (cxt->allocated_line); + FREE (cxt->lines); + + xfree (cxt); +} + +/* Search backwards through the history looking for a string which is typed + interactively. Start with the current line. */ +int +rl_reverse_search_history (sign, key) + int sign, key; +{ + return (rl_search_history (-sign, key)); +} + +/* Search forwards through the history looking for a string which is typed + interactively. Start with the current line. */ +int +rl_forward_search_history (sign, key) + int sign, key; +{ + return (rl_search_history (sign, key)); +} + +/* Display the current state of the search in the echo-area. + SEARCH_STRING contains the string that is being searched for, + DIRECTION is zero for forward, or non-zero for reverse, + WHERE is the history list number of the current line. If it is + -1, then this line is the starting one. */ +static void +rl_display_search (search_string, flags, where) + char *search_string; + int flags, where; +{ + char *message; + int msglen, searchlen; + + searchlen = (search_string && *search_string) ? strlen (search_string) : 0; + + message = (char *)xmalloc (searchlen + 64); + msglen = 0; + +#if defined (NOTDEF) + if (where != -1) + { + sprintf (message, "[%d]", where + history_base); + msglen = strlen (message); + } +#endif /* NOTDEF */ + + message[msglen++] = '('; + + if (flags & SF_FAILED) + { + strcpy (message + msglen, "failed "); + msglen += 7; + } + + if (flags & SF_REVERSE) + { + strcpy (message + msglen, "reverse-"); + msglen += 8; + } + + strcpy (message + msglen, "i-search)`"); + msglen += 10; + + if (search_string) + { + strcpy (message + msglen, search_string); + msglen += searchlen; + } + + strcpy (message + msglen, "': "); + + rl_message ("%s", message); + xfree (message); + (*rl_redisplay_function) (); +} + +static _rl_search_cxt * +_rl_isearch_init (direction) + int direction; +{ + _rl_search_cxt *cxt; + register int i; + HIST_ENTRY **hlist; + + cxt = _rl_scxt_alloc (RL_SEARCH_ISEARCH, 0); + if (direction < 0) + cxt->sflags |= SF_REVERSE; + + cxt->search_terminators = _rl_isearch_terminators ? _rl_isearch_terminators + : default_isearch_terminators; + + /* Create an array of pointers to the lines that we want to search. */ + hlist = history_list (); + rl_maybe_replace_line (); + i = 0; + if (hlist) + for (i = 0; hlist[i]; i++); + + /* Allocate space for this many lines, +1 for the current input line, + and remember those lines. */ + cxt->lines = (char **)xmalloc ((1 + (cxt->hlen = i)) * sizeof (char *)); + for (i = 0; i < cxt->hlen; i++) + cxt->lines[i] = hlist[i]->line; + + if (_rl_saved_line_for_history) + cxt->lines[i] = _rl_saved_line_for_history->line; + else + { + /* Keep track of this so we can free it. */ + cxt->allocated_line = (char *)xmalloc (1 + strlen (rl_line_buffer)); + strcpy (cxt->allocated_line, &rl_line_buffer[0]); + cxt->lines[i] = cxt->allocated_line; + } + + cxt->hlen++; + + /* The line where we start the search. */ + cxt->history_pos = cxt->save_line; + + rl_save_prompt (); + + /* Initialize search parameters. */ + cxt->search_string = (char *)xmalloc (cxt->search_string_size = 128); + cxt->search_string[cxt->search_string_index = 0] = '\0'; + + /* Normalize DIRECTION into 1 or -1. */ + cxt->direction = (direction >= 0) ? 1 : -1; + + cxt->sline = rl_line_buffer; + cxt->sline_len = strlen (cxt->sline); + cxt->sline_index = rl_point; + + _rl_iscxt = cxt; /* save globally */ + + return cxt; +} + +static void +_rl_isearch_fini (cxt) + _rl_search_cxt *cxt; +{ + /* First put back the original state. */ + strcpy (rl_line_buffer, cxt->lines[cxt->save_line]); + + rl_restore_prompt (); + + /* Save the search string for possible later use. */ + FREE (last_isearch_string); + last_isearch_string = cxt->search_string; + last_isearch_string_len = cxt->search_string_index; + cxt->search_string = 0; + + if (cxt->last_found_line < cxt->save_line) + rl_get_previous_history (cxt->save_line - cxt->last_found_line, 0); + else + rl_get_next_history (cxt->last_found_line - cxt->save_line, 0); + + /* If the string was not found, put point at the end of the last matching + line. If last_found_line == orig_line, we didn't find any matching + history lines at all, so put point back in its original position. */ + if (cxt->sline_index < 0) + { + if (cxt->last_found_line == cxt->save_line) + cxt->sline_index = cxt->save_point; + else + cxt->sline_index = strlen (rl_line_buffer); + rl_mark = cxt->save_mark; + } + + rl_point = cxt->sline_index; + /* Don't worry about where to put the mark here; rl_get_previous_history + and rl_get_next_history take care of it. */ + + rl_clear_message (); +} + +int +_rl_search_getchar (cxt) + _rl_search_cxt *cxt; +{ + int c; + + /* Read a key and decide how to proceed. */ + RL_SETSTATE(RL_STATE_MOREINPUT); + c = cxt->lastc = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + +#if defined (HANDLE_MULTIBYTE) + /* This ends up with C (and LASTC) being set to the last byte of the + multibyte character. In most cases c == lastc == mb[0] */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + c = cxt->lastc = _rl_read_mbstring (cxt->lastc, cxt->mb, MB_LEN_MAX); +#endif + + RL_CHECK_SIGNALS (); + return c; +} + +#define ENDSRCH_CHAR(c) \ + ((CTRL_CHAR (c) || META_CHAR (c) || (c) == RUBOUT) && ((c) != CTRL ('G'))) + +/* Process just-read character C according to isearch context CXT. Return + -1 if the caller should just free the context and return, 0 if we should + break out of the loop, and 1 if we should continue to read characters. */ +int +_rl_isearch_dispatch (cxt, c) + _rl_search_cxt *cxt; + int c; +{ + int n, wstart, wlen, limit, cval; + rl_command_func_t *f; + + f = (rl_command_func_t *)NULL; + + if (c < 0) + { + cxt->sflags |= SF_FAILED; + cxt->history_pos = cxt->last_found_line; + return -1; + } + + /* If we are moving into a new keymap, modify cxt->keymap and go on. + This can be a problem if c == ESC and we want to terminate the + incremental search, so we check */ + if (c >= 0 && cxt->keymap[c].type == ISKMAP && strchr (cxt->search_terminators, cxt->lastc) == 0) + { + /* _rl_keyseq_timeout specified in milliseconds; _rl_input_queued + takes microseconds, so multiply by 1000. If we don't get any + additional input and this keymap shadows another function, process + that key as if it was all we read. */ + if (_rl_keyseq_timeout > 0 && + RL_ISSTATE (RL_STATE_CALLBACK) == 0 && + RL_ISSTATE (RL_STATE_INPUTPENDING) == 0 && + _rl_pushed_input_available () == 0 && + ((Keymap)(cxt->keymap[c].function))[ANYOTHERKEY].function && + _rl_input_queued (_rl_keyseq_timeout*1000) == 0) + goto add_character; + + cxt->okeymap = cxt->keymap; + cxt->keymap = FUNCTION_TO_KEYMAP (cxt->keymap, c); + cxt->sflags |= SF_CHGKMAP; + /* XXX - we should probably save this sequence, so we can do + something useful if this doesn't end up mapping to a command we + interpret here. Right now we just save the most recent character + that caused the index into a new keymap. */ + cxt->prevc = c; +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + if (cxt->mb[1] == 0) + { + cxt->pmb[0] = c; /* XXX should be == cxt->mb[0] */ + cxt->pmb[1] = '\0'; + } + else + memcpy (cxt->pmb, cxt->mb, sizeof (cxt->pmb)); + } +#endif + return 1; + } + +add_character: + + /* Translate the keys we do something with to opcodes. */ + if (c >= 0 && cxt->keymap[c].type == ISFUNC) + { + f = cxt->keymap[c].function; + + if (f == rl_reverse_search_history) + cxt->lastc = (cxt->sflags & SF_REVERSE) ? -1 : -2; + else if (f == rl_forward_search_history) + cxt->lastc = (cxt->sflags & SF_REVERSE) ? -2 : -1; + else if (f == rl_rubout) + cxt->lastc = -3; + else if (c == CTRL ('G') || f == rl_abort) + cxt->lastc = -4; + else if (c == CTRL ('W') || f == rl_unix_word_rubout) /* XXX */ + cxt->lastc = -5; + else if (c == CTRL ('Y') || f == rl_yank) /* XXX */ + cxt->lastc = -6; + } + + /* If we changed the keymap earlier while translating a key sequence into + a command, restore it now that we've succeeded. */ + if (cxt->sflags & SF_CHGKMAP) + { + cxt->keymap = cxt->okeymap; + cxt->sflags &= ~SF_CHGKMAP; + /* If we indexed into a new keymap, but didn't map to a command that + affects the search (lastc > 0), and the character that mapped to a + new keymap would have ended the search (ENDSRCH_CHAR(cxt->prevc)), + handle that now as if the previous char would have ended the search + and we would have read the current character. */ + /* XXX - should we check cxt->mb? */ + if (cxt->lastc > 0 && ENDSRCH_CHAR (cxt->prevc)) + { + rl_stuff_char (cxt->lastc); + rl_execute_next (cxt->prevc); + /* XXX - do we insert everything in cxt->pmb? */ + return (0); + } + /* Otherwise, if the current character is mapped to self-insert or + nothing (i.e., not an editing command), and the previous character + was a keymap index, then we need to insert both the previous + character and the current character into the search string. */ + else if (cxt->lastc > 0 && cxt->prevc > 0 && + cxt->keymap[cxt->prevc].type == ISKMAP && + (f == 0 || f == rl_insert)) + { + /* Make lastc be the next character read */ + /* XXX - do we insert everything in cxt->mb? */ + rl_execute_next (cxt->lastc); + /* Dispatch on the previous character (insert into search string) */ + cxt->lastc = cxt->prevc; +#if defined (HANDLE_MULTIBYTE) + /* Have to overwrite cxt->mb here because dispatch uses it below */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + if (cxt->pmb[1] == 0) + { + cxt->mb[0] = cxt->lastc; /* == cxt->prevc */ + cxt->mb[1] = '\0'; + } + else + memcpy (cxt->mb, cxt->pmb, sizeof (cxt->mb)); + } +#endif + cxt->prevc = 0; + } + else if (cxt->lastc > 0 && cxt->prevc > 0 && f && f != rl_insert) + { + rl_stuff_char (cxt->lastc); + rl_execute_next (cxt->prevc); + /* XXX - do we insert everything in cxt->pmb? */ + return (0); + } + } + + /* The characters in isearch_terminators (set from the user-settable + variable isearch-terminators) are used to terminate the search but + not subsequently execute the character as a command. The default + value is "\033\012" (ESC and C-J). */ + if (cxt->lastc > 0 && strchr (cxt->search_terminators, cxt->lastc)) + { + /* ESC still terminates the search, but if there is pending + input or if input arrives within 0.1 seconds (on systems + with select(2)) it is used as a prefix character + with rl_execute_next. WATCH OUT FOR THIS! This is intended + to allow the arrow keys to be used like ^F and ^B are used + to terminate the search and execute the movement command. + XXX - since _rl_input_available depends on the application- + settable keyboard timeout value, this could alternatively + use _rl_input_queued(100000) */ + if (cxt->lastc == ESC && (_rl_pushed_input_available () || _rl_input_available ())) + rl_execute_next (ESC); + return (0); + } + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + if (cxt->lastc >= 0 && (cxt->mb[0] && cxt->mb[1] == '\0') && ENDSRCH_CHAR (cxt->lastc)) + { + /* This sets rl_pending_input to LASTC; it will be picked up the next + time rl_read_key is called. */ + rl_execute_next (cxt->lastc); + return (0); + } + } + else +#endif + if (cxt->lastc >= 0 && ENDSRCH_CHAR (cxt->lastc)) + { + /* This sets rl_pending_input to LASTC; it will be picked up the next + time rl_read_key is called. */ + rl_execute_next (cxt->lastc); + return (0); + } + + /* Now dispatch on the character. `Opcodes' affect the search string or + state. Other characters are added to the string. */ + switch (cxt->lastc) + { + /* search again */ + case -1: + if (cxt->search_string_index == 0) + { + if (last_isearch_string) + { + cxt->search_string_size = 64 + last_isearch_string_len; + cxt->search_string = (char *)xrealloc (cxt->search_string, cxt->search_string_size); + strcpy (cxt->search_string, last_isearch_string); + cxt->search_string_index = last_isearch_string_len; + rl_display_search (cxt->search_string, cxt->sflags, -1); + break; + } + return (1); + } + else if (cxt->sflags & SF_REVERSE) + cxt->sline_index--; + else if (cxt->sline_index != cxt->sline_len) + cxt->sline_index++; + else + rl_ding (); + break; + + /* switch directions */ + case -2: + cxt->direction = -cxt->direction; + if (cxt->direction < 0) + cxt->sflags |= SF_REVERSE; + else + cxt->sflags &= ~SF_REVERSE; + break; + + /* delete character from search string. */ + case -3: /* C-H, DEL */ + /* This is tricky. To do this right, we need to keep a + stack of search positions for the current search, with + sentinels marking the beginning and end. But this will + do until we have a real isearch-undo. */ + if (cxt->search_string_index == 0) + rl_ding (); + else + cxt->search_string[--cxt->search_string_index] = '\0'; + break; + + case -4: /* C-G, abort */ + rl_replace_line (cxt->lines[cxt->save_line], 0); + rl_point = cxt->save_point; + rl_mark = cxt->save_mark; + rl_restore_prompt(); + rl_clear_message (); + + return -1; + + case -5: /* C-W */ + /* skip over portion of line we already matched and yank word */ + wstart = rl_point + cxt->search_string_index; + if (wstart >= rl_end) + { + rl_ding (); + break; + } + + /* if not in a word, move to one. */ + cval = _rl_char_value (rl_line_buffer, wstart); + if (_rl_walphabetic (cval) == 0) + { + rl_ding (); + break; + } + n = MB_NEXTCHAR (rl_line_buffer, wstart, 1, MB_FIND_NONZERO);; + while (n < rl_end) + { + cval = _rl_char_value (rl_line_buffer, n); + if (_rl_walphabetic (cval) == 0) + break; + n = MB_NEXTCHAR (rl_line_buffer, n, 1, MB_FIND_NONZERO);; + } + wlen = n - wstart + 1; + if (cxt->search_string_index + wlen + 1 >= cxt->search_string_size) + { + cxt->search_string_size += wlen + 1; + cxt->search_string = (char *)xrealloc (cxt->search_string, cxt->search_string_size); + } + for (; wstart < n; wstart++) + cxt->search_string[cxt->search_string_index++] = rl_line_buffer[wstart]; + cxt->search_string[cxt->search_string_index] = '\0'; + break; + + case -6: /* C-Y */ + /* skip over portion of line we already matched and yank rest */ + wstart = rl_point + cxt->search_string_index; + if (wstart >= rl_end) + { + rl_ding (); + break; + } + n = rl_end - wstart + 1; + if (cxt->search_string_index + n + 1 >= cxt->search_string_size) + { + cxt->search_string_size += n + 1; + cxt->search_string = (char *)xrealloc (cxt->search_string, cxt->search_string_size); + } + for (n = wstart; n < rl_end; n++) + cxt->search_string[cxt->search_string_index++] = rl_line_buffer[n]; + cxt->search_string[cxt->search_string_index] = '\0'; + break; + + /* Add character to search string and continue search. */ + default: + if (cxt->search_string_index + 2 >= cxt->search_string_size) + { + cxt->search_string_size += 128; + cxt->search_string = (char *)xrealloc (cxt->search_string, cxt->search_string_size); + } +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + int j, l; + + if (cxt->mb[0] == 0 || cxt->mb[1] == 0) + cxt->search_string[cxt->search_string_index++] = cxt->mb[0]; + else + for (j = 0, l = RL_STRLEN (cxt->mb); j < l; ) + cxt->search_string[cxt->search_string_index++] = cxt->mb[j++]; + } + else +#endif + cxt->search_string[cxt->search_string_index++] = cxt->lastc; /* XXX - was c instead of lastc */ + cxt->search_string[cxt->search_string_index] = '\0'; + break; + } + + for (cxt->sflags &= ~(SF_FOUND|SF_FAILED);; ) + { + limit = cxt->sline_len - cxt->search_string_index + 1; + + /* Search the current line. */ + while ((cxt->sflags & SF_REVERSE) ? (cxt->sline_index >= 0) : (cxt->sline_index < limit)) + { + if (STREQN (cxt->search_string, cxt->sline + cxt->sline_index, cxt->search_string_index)) + { + cxt->sflags |= SF_FOUND; + break; + } + else + cxt->sline_index += cxt->direction; + } + if (cxt->sflags & SF_FOUND) + break; + + /* Move to the next line, but skip new copies of the line + we just found and lines shorter than the string we're + searching for. */ + do + { + /* Move to the next line. */ + cxt->history_pos += cxt->direction; + + /* At limit for direction? */ + if ((cxt->sflags & SF_REVERSE) ? (cxt->history_pos < 0) : (cxt->history_pos == cxt->hlen)) + { + cxt->sflags |= SF_FAILED; + break; + } + + /* We will need these later. */ + cxt->sline = cxt->lines[cxt->history_pos]; + cxt->sline_len = strlen (cxt->sline); + } + while ((cxt->prev_line_found && STREQ (cxt->prev_line_found, cxt->lines[cxt->history_pos])) || + (cxt->search_string_index > cxt->sline_len)); + + if (cxt->sflags & SF_FAILED) + break; + + /* Now set up the line for searching... */ + cxt->sline_index = (cxt->sflags & SF_REVERSE) ? cxt->sline_len - cxt->search_string_index : 0; + } + + if (cxt->sflags & SF_FAILED) + { + /* We cannot find the search string. Ding the bell. */ + rl_ding (); + cxt->history_pos = cxt->last_found_line; + rl_display_search (cxt->search_string, cxt->sflags, (cxt->history_pos == cxt->save_line) ? -1 : cxt->history_pos); + return 1; + } + + /* We have found the search string. Just display it. But don't + actually move there in the history list until the user accepts + the location. */ + if (cxt->sflags & SF_FOUND) + { + cxt->prev_line_found = cxt->lines[cxt->history_pos]; + rl_replace_line (cxt->lines[cxt->history_pos], 0); + rl_point = cxt->sline_index; + cxt->last_found_line = cxt->history_pos; + rl_display_search (cxt->search_string, cxt->sflags, (cxt->history_pos == cxt->save_line) ? -1 : cxt->history_pos); + } + + return 1; +} + +static int +_rl_isearch_cleanup (cxt, r) + _rl_search_cxt *cxt; + int r; +{ + if (r >= 0) + _rl_isearch_fini (cxt); + _rl_scxt_dispose (cxt, 0); + _rl_iscxt = 0; + + RL_UNSETSTATE(RL_STATE_ISEARCH); + + return (r != 0); +} + +/* Search through the history looking for an interactively typed string. + This is analogous to i-search. We start the search in the current line. + DIRECTION is which direction to search; >= 0 means forward, < 0 means + backwards. */ +static int +rl_search_history (direction, invoking_key) + int direction, invoking_key; +{ + _rl_search_cxt *cxt; /* local for now, but saved globally */ + int c, r; + + RL_SETSTATE(RL_STATE_ISEARCH); + cxt = _rl_isearch_init (direction); + + rl_display_search (cxt->search_string, cxt->sflags, -1); + + /* If we are using the callback interface, all we do is set up here and + return. The key is that we leave RL_STATE_ISEARCH set. */ + if (RL_ISSTATE (RL_STATE_CALLBACK)) + return (0); + + r = -1; + for (;;) + { + c = _rl_search_getchar (cxt); + /* We might want to handle EOF here (c == 0) */ + r = _rl_isearch_dispatch (cxt, cxt->lastc); + if (r <= 0) + break; + } + + /* The searching is over. The user may have found the string that she + was looking for, or else she may have exited a failing search. If + LINE_INDEX is -1, then that shows that the string searched for was + not found. We use this to determine where to place rl_point. */ + return (_rl_isearch_cleanup (cxt, r)); +} + +#if defined (READLINE_CALLBACKS) +/* Called from the callback functions when we are ready to read a key. The + callback functions know to call this because RL_ISSTATE(RL_STATE_ISEARCH). + If _rl_isearch_dispatch finishes searching, this function is responsible + for turning off RL_STATE_ISEARCH, which it does using _rl_isearch_cleanup. */ +int +_rl_isearch_callback (cxt) + _rl_search_cxt *cxt; +{ + int c, r; + + c = _rl_search_getchar (cxt); + /* We might want to handle EOF here */ + r = _rl_isearch_dispatch (cxt, cxt->lastc); + + return (r <= 0) ? _rl_isearch_cleanup (cxt, r) : 0; +} +#endif diff --git a/lib/readline/keymaps.c b/lib/readline/keymaps.c new file mode 100644 index 0000000..58661e2 --- /dev/null +++ b/lib/readline/keymaps.c @@ -0,0 +1,162 @@ +/* keymaps.c -- Functions and keymaps for the GNU Readline library. */ + +/* Copyright (C) 1988,1989-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include /* for FILE * definition for readline.h */ + +#include "readline.h" +#include "rlconf.h" + +#include "emacs_keymap.c" + +#if defined (VI_MODE) +#include "vi_keymap.c" +#endif + +#include "xmalloc.h" + +/* **************************************************************** */ +/* */ +/* Functions for manipulating Keymaps. */ +/* */ +/* **************************************************************** */ + + +/* Return a new, empty keymap. + Free it with free() when you are done. */ +Keymap +rl_make_bare_keymap () +{ + register int i; + Keymap keymap; + + keymap = (Keymap)xmalloc (KEYMAP_SIZE * sizeof (KEYMAP_ENTRY)); + for (i = 0; i < KEYMAP_SIZE; i++) + { + keymap[i].type = ISFUNC; + keymap[i].function = (rl_command_func_t *)NULL; + } + +#if 0 + for (i = 'A'; i < ('Z' + 1); i++) + { + keymap[i].type = ISFUNC; + keymap[i].function = rl_do_lowercase_version; + } +#endif + + return (keymap); +} + +/* Return a new keymap which is a copy of MAP. Just copies pointers, does + not copy text of macros or descend into child keymaps. */ +Keymap +rl_copy_keymap (map) + Keymap map; +{ + register int i; + Keymap temp; + + temp = rl_make_bare_keymap (); + for (i = 0; i < KEYMAP_SIZE; i++) + { + temp[i].type = map[i].type; + temp[i].function = map[i].function; + } + return (temp); +} + +/* Return a new keymap with the printing characters bound to rl_insert, + the uppercase Meta characters bound to run their lowercase equivalents, + and the Meta digits bound to produce numeric arguments. */ +Keymap +rl_make_keymap () +{ + register int i; + Keymap newmap; + + newmap = rl_make_bare_keymap (); + + /* All ASCII printing characters are self-inserting. */ + for (i = ' '; i < 127; i++) + newmap[i].function = rl_insert; + + newmap[TAB].function = rl_insert; + newmap[RUBOUT].function = rl_rubout; /* RUBOUT == 127 */ + newmap[CTRL('H')].function = rl_rubout; + +#if KEYMAP_SIZE > 128 + /* Printing characters in ISO Latin-1 and some 8-bit character sets. */ + for (i = 128; i < 256; i++) + newmap[i].function = rl_insert; +#endif /* KEYMAP_SIZE > 128 */ + + return (newmap); +} + +/* Free the storage associated with MAP. */ +void +rl_discard_keymap (map) + Keymap map; +{ + int i; + + if (map == 0) + return; + + for (i = 0; i < KEYMAP_SIZE; i++) + { + switch (map[i].type) + { + case ISFUNC: + break; + + case ISKMAP: + rl_discard_keymap ((Keymap)map[i].function); + xfree ((char *)map[i].function); + break; + + case ISMACR: + xfree ((char *)map[i].function); + break; + } + } +} + +/* Convenience function that discards, then frees, MAP. */ +void +rl_free_keymap (map) + Keymap map; +{ + rl_discard_keymap (map); + xfree ((char *)map); +} diff --git a/lib/readline/keymaps.h b/lib/readline/keymaps.h new file mode 100644 index 0000000..af8d5d9 --- /dev/null +++ b/lib/readline/keymaps.h @@ -0,0 +1,97 @@ +/* keymaps.h -- Manipulation of readline keymaps. */ + +/* Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#ifndef _KEYMAPS_H_ +#define _KEYMAPS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (READLINE_LIBRARY) +# include "rlstdc.h" +# include "chardefs.h" +# include "rltypedefs.h" +#else +# include +# include +# include +#endif + +/* A keymap contains one entry for each key in the ASCII set. + Each entry consists of a type and a pointer. + FUNCTION is the address of a function to run, or the + address of a keymap to indirect through. + TYPE says which kind of thing FUNCTION is. */ +typedef struct _keymap_entry { + char type; + rl_command_func_t *function; +} KEYMAP_ENTRY; + +/* This must be large enough to hold bindings for all of the characters + in a desired character set (e.g, 128 for ASCII, 256 for ISO Latin-x, + and so on) plus one for subsequence matching. */ +#define KEYMAP_SIZE 257 +#define ANYOTHERKEY KEYMAP_SIZE-1 + +typedef KEYMAP_ENTRY KEYMAP_ENTRY_ARRAY[KEYMAP_SIZE]; +typedef KEYMAP_ENTRY *Keymap; + +/* The values that TYPE can have in a keymap entry. */ +#define ISFUNC 0 +#define ISKMAP 1 +#define ISMACR 2 + +extern KEYMAP_ENTRY_ARRAY emacs_standard_keymap, emacs_meta_keymap, emacs_ctlx_keymap; +extern KEYMAP_ENTRY_ARRAY vi_insertion_keymap, vi_movement_keymap; + +/* Return a new, empty keymap. + Free it with free() when you are done. */ +extern Keymap rl_make_bare_keymap PARAMS((void)); + +/* Return a new keymap which is a copy of MAP. */ +extern Keymap rl_copy_keymap PARAMS((Keymap)); + +/* Return a new keymap with the printing characters bound to rl_insert, + the lowercase Meta characters bound to run their equivalents, and + the Meta digits bound to produce numeric arguments. */ +extern Keymap rl_make_keymap PARAMS((void)); + +/* Free the storage associated with a keymap. */ +extern void rl_discard_keymap PARAMS((Keymap)); + +/* These functions actually appear in bind.c */ + +/* Return the keymap corresponding to a given name. Names look like + `emacs' or `emacs-meta' or `vi-insert'. */ +extern Keymap rl_get_keymap_by_name PARAMS((const char *)); + +/* Return the current keymap. */ +extern Keymap rl_get_keymap PARAMS((void)); + +/* Set the current keymap to MAP. */ +extern void rl_set_keymap PARAMS((Keymap)); + +#ifdef __cplusplus +} +#endif + +#endif /* _KEYMAPS_H_ */ diff --git a/lib/readline/kill.c b/lib/readline/kill.c new file mode 100644 index 0000000..1a78783 --- /dev/null +++ b/lib/readline/kill.c @@ -0,0 +1,694 @@ +/* kill.c -- kill ring management. */ + +/* Copyright (C) 1994 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include + +#if defined (HAVE_UNISTD_H) +# include /* for _POSIX_VERSION */ +#endif /* HAVE_UNISTD_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" + +/* Some standard library routines. */ +#include "readline.h" +#include "history.h" + +#include "rlprivate.h" +#include "xmalloc.h" + +/* **************************************************************** */ +/* */ +/* Killing Mechanism */ +/* */ +/* **************************************************************** */ + +/* What we assume for a max number of kills. */ +#define DEFAULT_MAX_KILLS 10 + +/* The real variable to look at to find out when to flush kills. */ +static int rl_max_kills = DEFAULT_MAX_KILLS; + +/* Where to store killed text. */ +static char **rl_kill_ring = (char **)NULL; + +/* Where we are in the kill ring. */ +static int rl_kill_index; + +/* How many slots we have in the kill ring. */ +static int rl_kill_ring_length; + +static int _rl_copy_to_kill_ring PARAMS((char *, int)); +static int region_kill_internal PARAMS((int)); +static int _rl_copy_word_as_kill PARAMS((int, int)); +static int rl_yank_nth_arg_internal PARAMS((int, int, int)); + +/* How to say that you only want to save a certain amount + of kill material. */ +int +rl_set_retained_kills (num) + int num; +{ + return 0; +} + +/* Add TEXT to the kill ring, allocating a new kill ring slot as necessary. + This uses TEXT directly, so the caller must not free it. If APPEND is + non-zero, and the last command was a kill, the text is appended to the + current kill ring slot, otherwise prepended. */ +static int +_rl_copy_to_kill_ring (text, append) + char *text; + int append; +{ + char *old, *new; + int slot; + + /* First, find the slot to work with. */ + if (_rl_last_command_was_kill == 0) + { + /* Get a new slot. */ + if (rl_kill_ring == 0) + { + /* If we don't have any defined, then make one. */ + rl_kill_ring = (char **) + xmalloc (((rl_kill_ring_length = 1) + 1) * sizeof (char *)); + rl_kill_ring[slot = 0] = (char *)NULL; + } + else + { + /* We have to add a new slot on the end, unless we have + exceeded the max limit for remembering kills. */ + slot = rl_kill_ring_length; + if (slot == rl_max_kills) + { + register int i; + xfree (rl_kill_ring[0]); + for (i = 0; i < slot; i++) + rl_kill_ring[i] = rl_kill_ring[i + 1]; + } + else + { + slot = rl_kill_ring_length += 1; + rl_kill_ring = (char **)xrealloc (rl_kill_ring, slot * sizeof (char *)); + } + rl_kill_ring[--slot] = (char *)NULL; + } + } + else + slot = rl_kill_ring_length - 1; + + /* If the last command was a kill, prepend or append. */ + if (_rl_last_command_was_kill && rl_editing_mode != vi_mode) + { + old = rl_kill_ring[slot]; + new = (char *)xmalloc (1 + strlen (old) + strlen (text)); + + if (append) + { + strcpy (new, old); + strcat (new, text); + } + else + { + strcpy (new, text); + strcat (new, old); + } + xfree (old); + xfree (text); + rl_kill_ring[slot] = new; + } + else + rl_kill_ring[slot] = text; + + rl_kill_index = slot; + return 0; +} + +/* The way to kill something. This appends or prepends to the last + kill, if the last command was a kill command. if FROM is less + than TO, then the text is appended, otherwise prepended. If the + last command was not a kill command, then a new slot is made for + this kill. */ +int +rl_kill_text (from, to) + int from, to; +{ + char *text; + + /* Is there anything to kill? */ + if (from == to) + { + _rl_last_command_was_kill++; + return 0; + } + + text = rl_copy_text (from, to); + + /* Delete the copied text from the line. */ + rl_delete_text (from, to); + + _rl_copy_to_kill_ring (text, from < to); + + _rl_last_command_was_kill++; + return 0; +} + +/* Now REMEMBER! In order to do prepending or appending correctly, kill + commands always make rl_point's original position be the FROM argument, + and rl_point's extent be the TO argument. */ + +/* **************************************************************** */ +/* */ +/* Killing Commands */ +/* */ +/* **************************************************************** */ + +/* Delete the word at point, saving the text in the kill ring. */ +int +rl_kill_word (count, key) + int count, key; +{ + int orig_point; + + if (count < 0) + return (rl_backward_kill_word (-count, key)); + else + { + orig_point = rl_point; + rl_forward_word (count, key); + + if (rl_point != orig_point) + rl_kill_text (orig_point, rl_point); + + rl_point = orig_point; + if (rl_editing_mode == emacs_mode) + rl_mark = rl_point; + } + return 0; +} + +/* Rubout the word before point, placing it on the kill ring. */ +int +rl_backward_kill_word (count, ignore) + int count, ignore; +{ + int orig_point; + + if (count < 0) + return (rl_kill_word (-count, ignore)); + else + { + orig_point = rl_point; + rl_backward_word (count, ignore); + + if (rl_point != orig_point) + rl_kill_text (orig_point, rl_point); + + if (rl_editing_mode == emacs_mode) + rl_mark = rl_point; + } + return 0; +} + +/* Kill from here to the end of the line. If DIRECTION is negative, kill + back to the line start instead. */ +int +rl_kill_line (direction, ignore) + int direction, ignore; +{ + int orig_point; + + if (direction < 0) + return (rl_backward_kill_line (1, ignore)); + else + { + orig_point = rl_point; + rl_end_of_line (1, ignore); + if (orig_point != rl_point) + rl_kill_text (orig_point, rl_point); + rl_point = orig_point; + if (rl_editing_mode == emacs_mode) + rl_mark = rl_point; + } + return 0; +} + +/* Kill backwards to the start of the line. If DIRECTION is negative, kill + forwards to the line end instead. */ +int +rl_backward_kill_line (direction, ignore) + int direction, ignore; +{ + int orig_point; + + if (direction < 0) + return (rl_kill_line (1, ignore)); + else + { + if (!rl_point) + rl_ding (); + else + { + orig_point = rl_point; + rl_beg_of_line (1, ignore); + if (rl_point != orig_point) + rl_kill_text (orig_point, rl_point); + if (rl_editing_mode == emacs_mode) + rl_mark = rl_point; + } + } + return 0; +} + +/* Kill the whole line, no matter where point is. */ +int +rl_kill_full_line (count, ignore) + int count, ignore; +{ + rl_begin_undo_group (); + rl_point = 0; + rl_kill_text (rl_point, rl_end); + rl_mark = 0; + rl_end_undo_group (); + return 0; +} + +/* The next two functions mimic unix line editing behaviour, except they + save the deleted text on the kill ring. This is safer than not saving + it, and since we have a ring, nobody should get screwed. */ + +/* This does what C-w does in Unix. We can't prevent people from + using behaviour that they expect. */ +int +rl_unix_word_rubout (count, key) + int count, key; +{ + int orig_point; + + if (rl_point == 0) + rl_ding (); + else + { + orig_point = rl_point; + if (count <= 0) + count = 1; + + while (count--) + { + while (rl_point && whitespace (rl_line_buffer[rl_point - 1])) + rl_point--; + + while (rl_point && (whitespace (rl_line_buffer[rl_point - 1]) == 0)) + rl_point--; + } + + rl_kill_text (orig_point, rl_point); + if (rl_editing_mode == emacs_mode) + rl_mark = rl_point; + } + + return 0; +} + +/* This deletes one filename component in a Unix pathname. That is, it + deletes backward to directory separator (`/') or whitespace. */ +int +rl_unix_filename_rubout (count, key) + int count, key; +{ + int orig_point, c; + + if (rl_point == 0) + rl_ding (); + else + { + orig_point = rl_point; + if (count <= 0) + count = 1; + + while (count--) + { + c = rl_line_buffer[rl_point - 1]; + while (rl_point && (whitespace (c) || c == '/')) + { + rl_point--; + c = rl_line_buffer[rl_point - 1]; + } + + while (rl_point && (whitespace (c) == 0) && c != '/') + { + rl_point--; + c = rl_line_buffer[rl_point - 1]; + } + } + + rl_kill_text (orig_point, rl_point); + if (rl_editing_mode == emacs_mode) + rl_mark = rl_point; + } + + return 0; +} + +/* Here is C-u doing what Unix does. You don't *have* to use these + key-bindings. We have a choice of killing the entire line, or + killing from where we are to the start of the line. We choose the + latter, because if you are a Unix weenie, then you haven't backspaced + into the line at all, and if you aren't, then you know what you are + doing. */ +int +rl_unix_line_discard (count, key) + int count, key; +{ + if (rl_point == 0) + rl_ding (); + else + { + rl_kill_text (rl_point, 0); + rl_point = 0; + if (rl_editing_mode == emacs_mode) + rl_mark = rl_point; + } + return 0; +} + +/* Copy the text in the `region' to the kill ring. If DELETE is non-zero, + delete the text from the line as well. */ +static int +region_kill_internal (delete) + int delete; +{ + char *text; + + if (rl_mark != rl_point) + { + text = rl_copy_text (rl_point, rl_mark); + if (delete) + rl_delete_text (rl_point, rl_mark); + _rl_copy_to_kill_ring (text, rl_point < rl_mark); + } + + _rl_last_command_was_kill++; + return 0; +} + +/* Copy the text in the region to the kill ring. */ +int +rl_copy_region_to_kill (count, ignore) + int count, ignore; +{ + return (region_kill_internal (0)); +} + +/* Kill the text between the point and mark. */ +int +rl_kill_region (count, ignore) + int count, ignore; +{ + int r, npoint; + + npoint = (rl_point < rl_mark) ? rl_point : rl_mark; + r = region_kill_internal (1); + _rl_fix_point (1); + rl_point = npoint; + return r; +} + +/* Copy COUNT words to the kill ring. DIR says which direction we look + to find the words. */ +static int +_rl_copy_word_as_kill (count, dir) + int count, dir; +{ + int om, op, r; + + om = rl_mark; + op = rl_point; + + if (dir > 0) + rl_forward_word (count, 0); + else + rl_backward_word (count, 0); + + rl_mark = rl_point; + + if (dir > 0) + rl_backward_word (count, 0); + else + rl_forward_word (count, 0); + + r = region_kill_internal (0); + + rl_mark = om; + rl_point = op; + + return r; +} + +int +rl_copy_forward_word (count, key) + int count, key; +{ + if (count < 0) + return (rl_copy_backward_word (-count, key)); + + return (_rl_copy_word_as_kill (count, 1)); +} + +int +rl_copy_backward_word (count, key) + int count, key; +{ + if (count < 0) + return (rl_copy_forward_word (-count, key)); + + return (_rl_copy_word_as_kill (count, -1)); +} + +/* Yank back the last killed text. This ignores arguments. */ +int +rl_yank (count, ignore) + int count, ignore; +{ + if (rl_kill_ring == 0) + { + _rl_abort_internal (); + return -1; + } + + _rl_set_mark_at_pos (rl_point); + rl_insert_text (rl_kill_ring[rl_kill_index]); + return 0; +} + +/* If the last command was yank, or yank_pop, and the text just + before point is identical to the current kill item, then + delete that text from the line, rotate the index down, and + yank back some other text. */ +int +rl_yank_pop (count, key) + int count, key; +{ + int l, n; + + if (((rl_last_func != rl_yank_pop) && (rl_last_func != rl_yank)) || + !rl_kill_ring) + { + _rl_abort_internal (); + return -1; + } + + l = strlen (rl_kill_ring[rl_kill_index]); + n = rl_point - l; + if (n >= 0 && STREQN (rl_line_buffer + n, rl_kill_ring[rl_kill_index], l)) + { + rl_delete_text (n, rl_point); + rl_point = n; + rl_kill_index--; + if (rl_kill_index < 0) + rl_kill_index = rl_kill_ring_length - 1; + rl_yank (1, 0); + return 0; + } + else + { + _rl_abort_internal (); + return -1; + } +} + +/* Yank the COUNTh argument from the previous history line, skipping + HISTORY_SKIP lines before looking for the `previous line'. */ +static int +rl_yank_nth_arg_internal (count, ignore, history_skip) + int count, ignore, history_skip; +{ + register HIST_ENTRY *entry; + char *arg; + int i, pos; + + pos = where_history (); + + if (history_skip) + { + for (i = 0; i < history_skip; i++) + entry = previous_history (); + } + + entry = previous_history (); + + history_set_pos (pos); + + if (entry == 0) + { + rl_ding (); + return -1; + } + + arg = history_arg_extract (count, count, entry->line); + if (!arg || !*arg) + { + rl_ding (); + FREE (arg); + return -1; + } + + rl_begin_undo_group (); + + _rl_set_mark_at_pos (rl_point); + +#if defined (VI_MODE) + /* Vi mode always inserts a space before yanking the argument, and it + inserts it right *after* rl_point. */ + if (rl_editing_mode == vi_mode) + { + rl_vi_append_mode (1, ignore); + rl_insert_text (" "); + } +#endif /* VI_MODE */ + + rl_insert_text (arg); + xfree (arg); + + rl_end_undo_group (); + return 0; +} + +/* Yank the COUNTth argument from the previous history line. */ +int +rl_yank_nth_arg (count, ignore) + int count, ignore; +{ + return (rl_yank_nth_arg_internal (count, ignore, 0)); +} + +/* Yank the last argument from the previous history line. This `knows' + how rl_yank_nth_arg treats a count of `$'. With an argument, this + behaves the same as rl_yank_nth_arg. */ +int +rl_yank_last_arg (count, key) + int count, key; +{ + static int history_skip = 0; + static int explicit_arg_p = 0; + static int count_passed = 1; + static int direction = 1; + static int undo_needed = 0; + int retval; + + if (rl_last_func != rl_yank_last_arg) + { + history_skip = 0; + explicit_arg_p = rl_explicit_arg; + count_passed = count; + direction = 1; + } + else + { + if (undo_needed) + rl_do_undo (); + if (count < 0) /* XXX - was < 1 */ + direction = -direction; + history_skip += direction; + if (history_skip < 0) + history_skip = 0; + } + + if (explicit_arg_p) + retval = rl_yank_nth_arg_internal (count_passed, key, history_skip); + else + retval = rl_yank_nth_arg_internal ('$', key, history_skip); + + undo_needed = retval == 0; + return retval; +} + +/* A special paste command for users of Cygnus's cygwin32. */ +#if defined (__CYGWIN__) +#include + +int +rl_paste_from_clipboard (count, key) + int count, key; +{ + char *data, *ptr; + int len; + + if (OpenClipboard (NULL) == 0) + return (0); + + data = (char *)GetClipboardData (CF_TEXT); + if (data) + { + ptr = strchr (data, '\r'); + if (ptr) + { + len = ptr - data; + ptr = (char *)xmalloc (len + 1); + ptr[len] = '\0'; + strncpy (ptr, data, len); + } + else + ptr = data; + _rl_set_mark_at_pos (rl_point); + rl_insert_text (ptr); + if (ptr != data) + xfree (ptr); + CloseClipboard (); + } + return (0); +} +#endif /* __CYGWIN__ */ diff --git a/lib/readline/macro.c b/lib/readline/macro.c new file mode 100644 index 0000000..b99a1a6 --- /dev/null +++ b/lib/readline/macro.c @@ -0,0 +1,307 @@ +/* macro.c -- keyboard macros for readline. */ + +/* Copyright (C) 1994-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include + +#if defined (HAVE_UNISTD_H) +# include /* for _POSIX_VERSION */ +#endif /* HAVE_UNISTD_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" + +/* Some standard library routines. */ +#include "readline.h" +#include "history.h" + +#include "rlprivate.h" +#include "xmalloc.h" + +/* **************************************************************** */ +/* */ +/* Hacking Keyboard Macros */ +/* */ +/* **************************************************************** */ + +/* The currently executing macro string. If this is non-zero, + then it is a malloc ()'ed string where input is coming from. */ +char *rl_executing_macro = (char *)NULL; + +/* The offset in the above string to the next character to be read. */ +static int executing_macro_index; + +/* The current macro string being built. Characters get stuffed + in here by add_macro_char (). */ +static char *current_macro = (char *)NULL; + +/* The size of the buffer allocated to current_macro. */ +static int current_macro_size; + +/* The index at which characters are being added to current_macro. */ +static int current_macro_index; + +/* A structure used to save nested macro strings. + It is a linked list of string/index for each saved macro. */ +struct saved_macro { + struct saved_macro *next; + char *string; + int sindex; +}; + +/* The list of saved macros. */ +static struct saved_macro *macro_list = (struct saved_macro *)NULL; + +/* Set up to read subsequent input from STRING. + STRING is free ()'ed when we are done with it. */ +void +_rl_with_macro_input (string) + char *string; +{ + _rl_push_executing_macro (); + rl_executing_macro = string; + executing_macro_index = 0; + RL_SETSTATE(RL_STATE_MACROINPUT); +} + +/* Return the next character available from a macro, or 0 if + there are no macro characters. */ +int +_rl_next_macro_key () +{ + int c; + + if (rl_executing_macro == 0) + return (0); + + if (rl_executing_macro[executing_macro_index] == 0) + { + _rl_pop_executing_macro (); + return (_rl_next_macro_key ()); + } + +#if defined (READLINE_CALLBACKS) + c = rl_executing_macro[executing_macro_index++]; + if (RL_ISSTATE (RL_STATE_CALLBACK) && RL_ISSTATE (RL_STATE_READCMD|RL_STATE_MOREINPUT) && rl_executing_macro[executing_macro_index] == 0) + _rl_pop_executing_macro (); + return c; +#else + return (rl_executing_macro[executing_macro_index++]); +#endif +} + +int +_rl_prev_macro_key () +{ + if (rl_executing_macro == 0) + return (0); + + if (executing_macro_index == 0) + return (0); + + executing_macro_index--; + return (rl_executing_macro[executing_macro_index]); +} + +/* Save the currently executing macro on a stack of saved macros. */ +void +_rl_push_executing_macro () +{ + struct saved_macro *saver; + + saver = (struct saved_macro *)xmalloc (sizeof (struct saved_macro)); + saver->next = macro_list; + saver->sindex = executing_macro_index; + saver->string = rl_executing_macro; + + macro_list = saver; +} + +/* Discard the current macro, replacing it with the one + on the top of the stack of saved macros. */ +void +_rl_pop_executing_macro () +{ + struct saved_macro *macro; + + FREE (rl_executing_macro); + rl_executing_macro = (char *)NULL; + executing_macro_index = 0; + + if (macro_list) + { + macro = macro_list; + rl_executing_macro = macro_list->string; + executing_macro_index = macro_list->sindex; + macro_list = macro_list->next; + xfree (macro); + } + + if (rl_executing_macro == 0) + RL_UNSETSTATE(RL_STATE_MACROINPUT); +} + +/* Add a character to the macro being built. */ +void +_rl_add_macro_char (c) + int c; +{ + if (current_macro_index + 1 >= current_macro_size) + { + if (current_macro == 0) + current_macro = (char *)xmalloc (current_macro_size = 25); + else + current_macro = (char *)xrealloc (current_macro, current_macro_size += 25); + } + + current_macro[current_macro_index++] = c; + current_macro[current_macro_index] = '\0'; +} + +void +_rl_kill_kbd_macro () +{ + if (current_macro) + { + xfree (current_macro); + current_macro = (char *) NULL; + } + current_macro_size = current_macro_index = 0; + + FREE (rl_executing_macro); + rl_executing_macro = (char *) NULL; + executing_macro_index = 0; + + RL_UNSETSTATE(RL_STATE_MACRODEF); +} + +/* Begin defining a keyboard macro. + Keystrokes are recorded as they are executed. + End the definition with rl_end_kbd_macro (). + If a numeric argument was explicitly typed, then append this + definition to the end of the existing macro, and start by + re-executing the existing macro. */ +int +rl_start_kbd_macro (ignore1, ignore2) + int ignore1, ignore2; +{ + if (RL_ISSTATE (RL_STATE_MACRODEF)) + { + _rl_abort_internal (); + return -1; + } + + if (rl_explicit_arg) + { + if (current_macro) + _rl_with_macro_input (savestring (current_macro)); + } + else + current_macro_index = 0; + + RL_SETSTATE(RL_STATE_MACRODEF); + return 0; +} + +/* Stop defining a keyboard macro. + A numeric argument says to execute the macro right now, + that many times, counting the definition as the first time. */ +int +rl_end_kbd_macro (count, ignore) + int count, ignore; +{ + if (RL_ISSTATE (RL_STATE_MACRODEF) == 0) + { + _rl_abort_internal (); + return -1; + } + + current_macro_index -= rl_key_sequence_length; + current_macro[current_macro_index] = '\0'; + + RL_UNSETSTATE(RL_STATE_MACRODEF); + + return (rl_call_last_kbd_macro (--count, 0)); +} + +/* Execute the most recently defined keyboard macro. + COUNT says how many times to execute it. */ +int +rl_call_last_kbd_macro (count, ignore) + int count, ignore; +{ + if (current_macro == 0) + _rl_abort_internal (); + + if (RL_ISSTATE (RL_STATE_MACRODEF)) + { + rl_ding (); /* no recursive macros */ + current_macro[--current_macro_index] = '\0'; /* erase this char */ + return 0; + } + + while (count--) + _rl_with_macro_input (savestring (current_macro)); + return 0; +} + +int +rl_print_last_kbd_macro (count, ignore) + int count, ignore; +{ + char *m; + + if (current_macro == 0) + { + rl_ding (); + return 0; + } + m = _rl_untranslate_macro_value (current_macro, 1); + rl_crlf (); + printf ("%s", m); + fflush (stdout); + rl_crlf (); + FREE (m); + rl_forced_update_display (); + rl_display_fixed = 1; + + return 0; +} + +void +rl_push_macro_input (macro) + char *macro; +{ + _rl_with_macro_input (macro); +} diff --git a/lib/readline/mbutil.c b/lib/readline/mbutil.c new file mode 100644 index 0000000..b036e0c --- /dev/null +++ b/lib/readline/mbutil.c @@ -0,0 +1,378 @@ +/* mbutil.c -- readline multibyte character utility functions */ + +/* Copyright (C) 2001-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include +#include +#include "posixjmp.h" + +#if defined (HAVE_UNISTD_H) +# include /* for _POSIX_VERSION */ +#endif /* HAVE_UNISTD_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include +#include + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" +#include "rlmbutil.h" + +#if defined (TIOCSTAT_IN_SYS_IOCTL) +# include +#endif /* TIOCSTAT_IN_SYS_IOCTL */ + +/* Some standard library routines. */ +#include "readline.h" + +#include "rlprivate.h" +#include "xmalloc.h" + +/* Declared here so it can be shared between the readline and history + libraries. */ +#if defined (HANDLE_MULTIBYTE) +int rl_byte_oriented = 0; +#else +int rl_byte_oriented = 1; +#endif + +/* Ditto */ +int _rl_utf8locale = 0; + +/* **************************************************************** */ +/* */ +/* Multibyte Character Utility Functions */ +/* */ +/* **************************************************************** */ + +#if defined(HANDLE_MULTIBYTE) + +static int +_rl_find_next_mbchar_internal (string, seed, count, find_non_zero) + char *string; + int seed, count, find_non_zero; +{ + size_t tmp, len; + mbstate_t ps; + int point; + wchar_t wc; + + tmp = 0; + + memset(&ps, 0, sizeof (mbstate_t)); + if (seed < 0) + seed = 0; + if (count <= 0) + return seed; + + point = seed + _rl_adjust_point (string, seed, &ps); + /* if this is true, means that seed was not pointing to a byte indicating + the beginning of a multibyte character. Correct the point and consume + one char. */ + if (seed < point) + count--; + + while (count > 0) + { + len = strlen (string + point); + if (len == 0) + break; + tmp = mbrtowc (&wc, string+point, len, &ps); + if (MB_INVALIDCH ((size_t)tmp)) + { + /* invalid bytes. assume a byte represents a character */ + point++; + count--; + /* reset states. */ + memset(&ps, 0, sizeof(mbstate_t)); + } + else if (MB_NULLWCH (tmp)) + break; /* found wide '\0' */ + else + { + /* valid bytes */ + point += tmp; + if (find_non_zero) + { + if (WCWIDTH (wc) == 0) + continue; + else + count--; + } + else + count--; + } + } + + if (find_non_zero) + { + tmp = mbrtowc (&wc, string + point, strlen (string + point), &ps); + while (MB_NULLWCH (tmp) == 0 && MB_INVALIDCH (tmp) == 0 && WCWIDTH (wc) == 0) + { + point += tmp; + tmp = mbrtowc (&wc, string + point, strlen (string + point), &ps); + } + } + + return point; +} + +static int +_rl_find_prev_mbchar_internal (string, seed, find_non_zero) + char *string; + int seed, find_non_zero; +{ + mbstate_t ps; + int prev, non_zero_prev, point, length; + size_t tmp; + wchar_t wc; + + memset(&ps, 0, sizeof(mbstate_t)); + length = strlen(string); + + if (seed < 0) + return 0; + else if (length < seed) + return length; + + prev = non_zero_prev = point = 0; + while (point < seed) + { + tmp = mbrtowc (&wc, string + point, length - point, &ps); + if (MB_INVALIDCH ((size_t)tmp)) + { + /* in this case, bytes are invalid or shorted to compose + multibyte char, so assume that the first byte represents + a single character anyway. */ + tmp = 1; + /* clear the state of the byte sequence, because + in this case effect of mbstate is undefined */ + memset(&ps, 0, sizeof (mbstate_t)); + + /* Since we're assuming that this byte represents a single + non-zero-width character, don't forget about it. */ + prev = point; + } + else if (MB_NULLWCH (tmp)) + break; /* Found '\0' char. Can this happen? */ + else + { + if (find_non_zero) + { + if (WCWIDTH (wc) != 0) + prev = point; + } + else + prev = point; + } + + point += tmp; + } + + return prev; +} + +/* return the number of bytes parsed from the multibyte sequence starting + at src, if a non-L'\0' wide character was recognized. It returns 0, + if a L'\0' wide character was recognized. It returns (size_t)(-1), + if an invalid multibyte sequence was encountered. It returns (size_t)(-2) + if it couldn't parse a complete multibyte character. */ +int +_rl_get_char_len (src, ps) + char *src; + mbstate_t *ps; +{ + size_t tmp; + + tmp = mbrlen((const char *)src, (size_t)strlen (src), ps); + if (tmp == (size_t)(-2)) + { + /* shorted to compose multibyte char */ + if (ps) + memset (ps, 0, sizeof(mbstate_t)); + return -2; + } + else if (tmp == (size_t)(-1)) + { + /* invalid to compose multibyte char */ + /* initialize the conversion state */ + if (ps) + memset (ps, 0, sizeof(mbstate_t)); + return -1; + } + else if (tmp == (size_t)0) + return 0; + else + return (int)tmp; +} + +/* compare the specified two characters. If the characters matched, + return 1. Otherwise return 0. */ +int +_rl_compare_chars (buf1, pos1, ps1, buf2, pos2, ps2) + char *buf1; + int pos1; + mbstate_t *ps1; + char *buf2; + int pos2; + mbstate_t *ps2; +{ + int i, w1, w2; + + if ((w1 = _rl_get_char_len (&buf1[pos1], ps1)) <= 0 || + (w2 = _rl_get_char_len (&buf2[pos2], ps2)) <= 0 || + (w1 != w2) || + (buf1[pos1] != buf2[pos2])) + return 0; + + for (i = 1; i < w1; i++) + if (buf1[pos1+i] != buf2[pos2+i]) + return 0; + + return 1; +} + +/* adjust pointed byte and find mbstate of the point of string. + adjusted point will be point <= adjusted_point, and returns + differences of the byte(adjusted_point - point). + if point is invalied (point < 0 || more than string length), + it returns -1 */ +int +_rl_adjust_point (string, point, ps) + char *string; + int point; + mbstate_t *ps; +{ + size_t tmp = 0; + int length; + int pos = 0; + + length = strlen(string); + if (point < 0) + return -1; + if (length < point) + return -1; + + while (pos < point) + { + tmp = mbrlen (string + pos, length - pos, ps); + if (MB_INVALIDCH ((size_t)tmp)) + { + /* in this case, bytes are invalid or shorted to compose + multibyte char, so assume that the first byte represents + a single character anyway. */ + pos++; + /* clear the state of the byte sequence, because + in this case effect of mbstate is undefined */ + if (ps) + memset (ps, 0, sizeof (mbstate_t)); + } + else if (MB_NULLWCH (tmp)) + pos++; + else + pos += tmp; + } + + return (pos - point); +} + +int +_rl_is_mbchar_matched (string, seed, end, mbchar, length) + char *string; + int seed, end; + char *mbchar; + int length; +{ + int i; + + if ((end - seed) < length) + return 0; + + for (i = 0; i < length; i++) + if (string[seed + i] != mbchar[i]) + return 0; + return 1; +} + +wchar_t +_rl_char_value (buf, ind) + char *buf; + int ind; +{ + size_t tmp; + wchar_t wc; + mbstate_t ps; + int l; + + if (MB_LEN_MAX == 1 || rl_byte_oriented) + return ((wchar_t) buf[ind]); + l = strlen (buf); + if (ind >= l - 1) + return ((wchar_t) buf[ind]); + memset (&ps, 0, sizeof (mbstate_t)); + tmp = mbrtowc (&wc, buf + ind, l - ind, &ps); + if (MB_INVALIDCH (tmp) || MB_NULLWCH (tmp)) + return ((wchar_t) buf[ind]); + return wc; +} +#endif /* HANDLE_MULTIBYTE */ + +/* Find next `count' characters started byte point of the specified seed. + If flags is MB_FIND_NONZERO, we look for non-zero-width multibyte + characters. */ +#undef _rl_find_next_mbchar +int +_rl_find_next_mbchar (string, seed, count, flags) + char *string; + int seed, count, flags; +{ +#if defined (HANDLE_MULTIBYTE) + return _rl_find_next_mbchar_internal (string, seed, count, flags); +#else + return (seed + count); +#endif +} + +/* Find previous character started byte point of the specified seed. + Returned point will be point <= seed. If flags is MB_FIND_NONZERO, + we look for non-zero-width multibyte characters. */ +#undef _rl_find_prev_mbchar +int +_rl_find_prev_mbchar (string, seed, flags) + char *string; + int seed, flags; +{ +#if defined (HANDLE_MULTIBYTE) + return _rl_find_prev_mbchar_internal (string, seed, flags); +#else + return ((seed == 0) ? seed : seed - 1); +#endif +} diff --git a/lib/readline/misc.c b/lib/readline/misc.c new file mode 100644 index 0000000..a890cda --- /dev/null +++ b/lib/readline/misc.c @@ -0,0 +1,692 @@ +/* misc.c -- miscellaneous bindable readline functions. */ + +/* Copyright (C) 1987-2012 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# include +#endif /* HAVE_UNISTD_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#if defined (HAVE_LOCALE_H) +# include +#endif + +#include + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" +#include "rlmbutil.h" + +/* Some standard library routines. */ +#include "readline.h" +#include "history.h" + +#include "rlprivate.h" +#include "rlshell.h" +#include "xmalloc.h" + +static int rl_digit_loop PARAMS((void)); +static void _rl_history_set_point PARAMS((void)); + +extern int history_offset; + +/* Forward declarations used in this file */ +void _rl_free_history_entry PARAMS((HIST_ENTRY *)); + +/* If non-zero, rl_get_previous_history and rl_get_next_history attempt + to preserve the value of rl_point from line to line. */ +int _rl_history_preserve_point = 0; + +_rl_arg_cxt _rl_argcxt; + +/* Saved target point for when _rl_history_preserve_point is set. Special + value of -1 means that point is at the end of the line. */ +int _rl_history_saved_point = -1; + +/* **************************************************************** */ +/* */ +/* Numeric Arguments */ +/* */ +/* **************************************************************** */ + +int +_rl_arg_overflow () +{ + if (rl_numeric_arg > 1000000) + { + _rl_argcxt = 0; + rl_explicit_arg = rl_numeric_arg = 0; + rl_ding (); + rl_restore_prompt (); + rl_clear_message (); + RL_UNSETSTATE(RL_STATE_NUMERICARG); + return 1; + } + return 0; +} + +void +_rl_arg_init () +{ + rl_save_prompt (); + _rl_argcxt = 0; + RL_SETSTATE(RL_STATE_NUMERICARG); +} + +int +_rl_arg_getchar () +{ + int c; + + rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg); + RL_SETSTATE(RL_STATE_MOREINPUT); + c = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + + return c; +} + +/* Process C as part of the current numeric argument. Return -1 if the + argument should be aborted, 0 if we should not read any more chars, and + 1 if we should continue to read chars. */ +int +_rl_arg_dispatch (cxt, c) + _rl_arg_cxt cxt; + int c; +{ + int key, r; + + key = c; + + /* If we see a key bound to `universal-argument' after seeing digits, + it ends the argument but is otherwise ignored. */ + if (_rl_keymap[c].type == ISFUNC && _rl_keymap[c].function == rl_universal_argument) + { + if ((cxt & NUM_SAWDIGITS) == 0) + { + rl_numeric_arg *= 4; + return 1; + } + else if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + _rl_argcxt |= NUM_READONE; + return 0; /* XXX */ + } + else + { + RL_SETSTATE(RL_STATE_MOREINPUT); + key = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + rl_restore_prompt (); + rl_clear_message (); + RL_UNSETSTATE(RL_STATE_NUMERICARG); + if (key < 0) + return -1; + return (_rl_dispatch (key, _rl_keymap)); + } + } + + c = UNMETA (c); + + if (_rl_digit_p (c)) + { + r = _rl_digit_value (c); + rl_numeric_arg = rl_explicit_arg ? (rl_numeric_arg * 10) + r : r; + rl_explicit_arg = 1; + _rl_argcxt |= NUM_SAWDIGITS; + } + else if (c == '-' && rl_explicit_arg == 0) + { + rl_numeric_arg = 1; + _rl_argcxt |= NUM_SAWMINUS; + rl_arg_sign = -1; + } + else + { + /* Make M-- command equivalent to M--1 command. */ + if ((_rl_argcxt & NUM_SAWMINUS) && rl_numeric_arg == 1 && rl_explicit_arg == 0) + rl_explicit_arg = 1; + rl_restore_prompt (); + rl_clear_message (); + RL_UNSETSTATE(RL_STATE_NUMERICARG); + + r = _rl_dispatch (key, _rl_keymap); + if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + /* At worst, this will cause an extra redisplay. Otherwise, + we have to wait until the next character comes in. */ + if (rl_done == 0) + (*rl_redisplay_function) (); + r = 0; + } + return r; + } + + return 1; +} + +/* Handle C-u style numeric args, as well as M--, and M-digits. */ +static int +rl_digit_loop () +{ + int c, r; + + while (1) + { + if (_rl_arg_overflow ()) + return 1; + + c = _rl_arg_getchar (); + + if (c < 0) + { + _rl_abort_internal (); + return -1; + } + + r = _rl_arg_dispatch (_rl_argcxt, c); + if (r <= 0 || (RL_ISSTATE (RL_STATE_NUMERICARG) == 0)) + break; + } + + return r; +} + +/* Create a default argument. */ +void +_rl_reset_argument () +{ + rl_numeric_arg = rl_arg_sign = 1; + rl_explicit_arg = 0; + _rl_argcxt = 0; +} + +/* Start a numeric argument with initial value KEY */ +int +rl_digit_argument (ignore, key) + int ignore, key; +{ + _rl_arg_init (); + if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + _rl_arg_dispatch (_rl_argcxt, key); + rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg); + return 0; + } + else + { + rl_execute_next (key); + return (rl_digit_loop ()); + } +} + +/* C-u, universal argument. Multiply the current argument by 4. + Read a key. If the key has nothing to do with arguments, then + dispatch on it. If the key is the abort character then abort. */ +int +rl_universal_argument (count, key) + int count, key; +{ + _rl_arg_init (); + rl_numeric_arg *= 4; + + return (RL_ISSTATE (RL_STATE_CALLBACK) ? 0 : rl_digit_loop ()); +} + +int +_rl_arg_callback (cxt) + _rl_arg_cxt cxt; +{ + int c, r; + + c = _rl_arg_getchar (); + + if (_rl_argcxt & NUM_READONE) + { + _rl_argcxt &= ~NUM_READONE; + rl_restore_prompt (); + rl_clear_message (); + RL_UNSETSTATE(RL_STATE_NUMERICARG); + rl_execute_next (c); + return 0; + } + + r = _rl_arg_dispatch (cxt, c); + return (r != 1); +} + +/* What to do when you abort reading an argument. */ +int +rl_discard_argument () +{ + rl_ding (); + rl_clear_message (); + _rl_reset_argument (); + + return 0; +} + +/* **************************************************************** */ +/* */ +/* History Utilities */ +/* */ +/* **************************************************************** */ + +/* We already have a history library, and that is what we use to control + the history features of readline. This is our local interface to + the history mechanism. */ + +/* While we are editing the history, this is the saved + version of the original line. */ +HIST_ENTRY *_rl_saved_line_for_history = (HIST_ENTRY *)NULL; + +/* Set the history pointer back to the last entry in the history. */ +void +_rl_start_using_history () +{ + using_history (); + if (_rl_saved_line_for_history) + _rl_free_history_entry (_rl_saved_line_for_history); + + _rl_saved_line_for_history = (HIST_ENTRY *)NULL; +} + +/* Free the contents (and containing structure) of a HIST_ENTRY. */ +void +_rl_free_history_entry (entry) + HIST_ENTRY *entry; +{ + if (entry == 0) + return; + + FREE (entry->line); + FREE (entry->timestamp); + + xfree (entry); +} + +/* Perhaps put back the current line if it has changed. */ +int +rl_maybe_replace_line () +{ + HIST_ENTRY *temp; + + temp = current_history (); + /* If the current line has changed, save the changes. */ + if (temp && ((UNDO_LIST *)(temp->data) != rl_undo_list)) + { + temp = replace_history_entry (where_history (), rl_line_buffer, (histdata_t)rl_undo_list); + xfree (temp->line); + FREE (temp->timestamp); + xfree (temp); + } + return 0; +} + +/* Restore the _rl_saved_line_for_history if there is one. */ +int +rl_maybe_unsave_line () +{ + if (_rl_saved_line_for_history) + { + /* Can't call with `1' because rl_undo_list might point to an undo + list from a history entry, as in rl_replace_from_history() below. */ + rl_replace_line (_rl_saved_line_for_history->line, 0); + rl_undo_list = (UNDO_LIST *)_rl_saved_line_for_history->data; + _rl_free_history_entry (_rl_saved_line_for_history); + _rl_saved_line_for_history = (HIST_ENTRY *)NULL; + rl_point = rl_end; /* rl_replace_line sets rl_end */ + } + else + rl_ding (); + return 0; +} + +/* Save the current line in _rl_saved_line_for_history. */ +int +rl_maybe_save_line () +{ + if (_rl_saved_line_for_history == 0) + { + _rl_saved_line_for_history = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY)); + _rl_saved_line_for_history->line = savestring (rl_line_buffer); + _rl_saved_line_for_history->timestamp = (char *)NULL; + _rl_saved_line_for_history->data = (char *)rl_undo_list; + } + + return 0; +} + +int +_rl_free_saved_history_line () +{ + if (_rl_saved_line_for_history) + { + _rl_free_history_entry (_rl_saved_line_for_history); + _rl_saved_line_for_history = (HIST_ENTRY *)NULL; + } + return 0; +} + +static void +_rl_history_set_point () +{ + rl_point = (_rl_history_preserve_point && _rl_history_saved_point != -1) + ? _rl_history_saved_point + : rl_end; + if (rl_point > rl_end) + rl_point = rl_end; + +#if defined (VI_MODE) + if (rl_editing_mode == vi_mode && _rl_keymap != vi_insertion_keymap) + rl_point = 0; +#endif /* VI_MODE */ + + if (rl_editing_mode == emacs_mode) + rl_mark = (rl_point == rl_end ? 0 : rl_end); +} + +void +rl_replace_from_history (entry, flags) + HIST_ENTRY *entry; + int flags; /* currently unused */ +{ + /* Can't call with `1' because rl_undo_list might point to an undo list + from a history entry, just like we're setting up here. */ + rl_replace_line (entry->line, 0); + rl_undo_list = (UNDO_LIST *)entry->data; + rl_point = rl_end; + rl_mark = 0; + +#if defined (VI_MODE) + if (rl_editing_mode == vi_mode) + { + rl_point = 0; + rl_mark = rl_end; + } +#endif +} + +/* Process and free undo lists attached to each history entry prior to the + current entry, inclusive, reverting each line to its saved state. This + is destructive, and state about the current line is lost. This is not + intended to be called while actively editing, and the current line is + not assumed to have been added to the history list. */ +void +_rl_revert_all_lines () +{ + int hpos; + HIST_ENTRY *entry; + UNDO_LIST *ul, *saved_undo_list; + char *lbuf; + + lbuf = savestring (rl_line_buffer); + saved_undo_list = rl_undo_list; + hpos = where_history (); + + entry = (hpos == history_length) ? previous_history () : current_history (); + while (entry) + { + if (ul = (UNDO_LIST *)entry->data) + { + if (ul == saved_undo_list) + saved_undo_list = 0; + /* Set up rl_line_buffer and other variables from history entry */ + rl_replace_from_history (entry, 0); /* entry->line is now current */ + entry->data = 0; /* entry->data is now current undo list */ + /* Undo all changes to this history entry */ + while (rl_undo_list) + rl_do_undo (); + /* And copy the reverted line back to the history entry, preserving + the timestamp. */ + FREE (entry->line); + entry->line = savestring (rl_line_buffer); + } + entry = previous_history (); + } + + /* Restore history state */ + rl_undo_list = saved_undo_list; /* may have been set to null */ + history_set_pos (hpos); + + /* reset the line buffer */ + rl_replace_line (lbuf, 0); + _rl_set_the_line (); + + /* and clean up */ + xfree (lbuf); +} + +/* Free the history list, including private readline data and take care + of pointer aliases to history data. Resets rl_undo_list if it points + to an UNDO_LIST * saved as some history entry's data member. This + should not be called while editing is active. */ +void +rl_clear_history () +{ + HIST_ENTRY **hlist, *hent; + register int i; + UNDO_LIST *ul, *saved_undo_list; + + saved_undo_list = rl_undo_list; + hlist = history_list (); /* direct pointer, not copy */ + + for (i = 0; i < history_length; i++) + { + hent = hlist[i]; + if (ul = (UNDO_LIST *)hent->data) + { + if (ul == saved_undo_list) + saved_undo_list = 0; + _rl_free_undo_list (ul); + hent->data = 0; + } + _rl_free_history_entry (hent); + } + + history_offset = history_length = 0; + rl_undo_list = saved_undo_list; /* should be NULL */ +} + +/* **************************************************************** */ +/* */ +/* History Commands */ +/* */ +/* **************************************************************** */ + +/* Meta-< goes to the start of the history. */ +int +rl_beginning_of_history (count, key) + int count, key; +{ + return (rl_get_previous_history (1 + where_history (), key)); +} + +/* Meta-> goes to the end of the history. (The current line). */ +int +rl_end_of_history (count, key) + int count, key; +{ + rl_maybe_replace_line (); + using_history (); + rl_maybe_unsave_line (); + return 0; +} + +/* Move down to the next history line. */ +int +rl_get_next_history (count, key) + int count, key; +{ + HIST_ENTRY *temp; + + if (count < 0) + return (rl_get_previous_history (-count, key)); + + if (count == 0) + return 0; + + rl_maybe_replace_line (); + + /* either not saved by rl_newline or at end of line, so set appropriately. */ + if (_rl_history_saved_point == -1 && (rl_point || rl_end)) + _rl_history_saved_point = (rl_point == rl_end) ? -1 : rl_point; + + temp = (HIST_ENTRY *)NULL; + while (count) + { + temp = next_history (); + if (!temp) + break; + --count; + } + + if (temp == 0) + rl_maybe_unsave_line (); + else + { + rl_replace_from_history (temp, 0); + _rl_history_set_point (); + } + return 0; +} + +/* Get the previous item out of our interactive history, making it the current + line. If there is no previous history, just ding. */ +int +rl_get_previous_history (count, key) + int count, key; +{ + HIST_ENTRY *old_temp, *temp; + + if (count < 0) + return (rl_get_next_history (-count, key)); + + if (count == 0) + return 0; + + /* either not saved by rl_newline or at end of line, so set appropriately. */ + if (_rl_history_saved_point == -1 && (rl_point || rl_end)) + _rl_history_saved_point = (rl_point == rl_end) ? -1 : rl_point; + + /* If we don't have a line saved, then save this one. */ + rl_maybe_save_line (); + + /* If the current line has changed, save the changes. */ + rl_maybe_replace_line (); + + temp = old_temp = (HIST_ENTRY *)NULL; + while (count) + { + temp = previous_history (); + if (temp == 0) + break; + + old_temp = temp; + --count; + } + + /* If there was a large argument, and we moved back to the start of the + history, that is not an error. So use the last value found. */ + if (!temp && old_temp) + temp = old_temp; + + if (temp == 0) + rl_ding (); + else + { + rl_replace_from_history (temp, 0); + _rl_history_set_point (); + } + + return 0; +} + +/* **************************************************************** */ +/* */ +/* Editing Modes */ +/* */ +/* **************************************************************** */ +/* How to toggle back and forth between editing modes. */ +int +rl_vi_editing_mode (count, key) + int count, key; +{ +#if defined (VI_MODE) + _rl_set_insert_mode (RL_IM_INSERT, 1); /* vi mode ignores insert mode */ + rl_editing_mode = vi_mode; + rl_vi_insert_mode (1, key); +#endif /* VI_MODE */ + + return 0; +} + +int +rl_emacs_editing_mode (count, key) + int count, key; +{ + rl_editing_mode = emacs_mode; + _rl_set_insert_mode (RL_IM_INSERT, 1); /* emacs mode default is insert mode */ + _rl_keymap = emacs_standard_keymap; + + if (_rl_show_mode_in_prompt) + _rl_reset_prompt (); + + return 0; +} + +/* Function for the rest of the library to use to set insert/overwrite mode. */ +void +_rl_set_insert_mode (im, force) + int im, force; +{ +#ifdef CURSOR_MODE + _rl_set_cursor (im, force); +#endif + + rl_insert_mode = im; +} + +/* Toggle overwrite mode. A positive explicit argument selects overwrite + mode. A negative or zero explicit argument selects insert mode. */ +int +rl_overwrite_mode (count, key) + int count, key; +{ + if (rl_explicit_arg == 0) + _rl_set_insert_mode (rl_insert_mode ^ 1, 0); + else if (count > 0) + _rl_set_insert_mode (RL_IM_OVERWRITE, 0); + else + _rl_set_insert_mode (RL_IM_INSERT, 0); + + return 0; +} diff --git a/lib/readline/nls.c b/lib/readline/nls.c new file mode 100644 index 0000000..d3b3634 --- /dev/null +++ b/lib/readline/nls.c @@ -0,0 +1,281 @@ +/* nls.c -- skeletal internationalization code. */ + +/* Copyright (C) 1996-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif /* HAVE_UNISTD_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#if defined (HAVE_LOCALE_H) +# include +#endif + +#if defined (HAVE_LANGINFO_CODESET) +# include +#endif + +#include + +#include "rldefs.h" +#include "readline.h" +#include "rlshell.h" +#include "rlprivate.h" + +static int utf8locale PARAMS((char *)); + +#if !defined (HAVE_SETLOCALE) +/* A list of legal values for the LANG or LC_CTYPE environment variables. + If a locale name in this list is the value for the LC_ALL, LC_CTYPE, + or LANG environment variable (using the first of those with a value), + readline eight-bit mode is enabled. */ +static char *legal_lang_values[] = +{ + "iso88591", + "iso88592", + "iso88593", + "iso88594", + "iso88595", + "iso88596", + "iso88597", + "iso88598", + "iso88599", + "iso885910", + "koi8r", + 0 +}; + +static char *normalize_codeset PARAMS((char *)); +#endif /* !HAVE_SETLOCALE */ + +static char *find_codeset PARAMS((char *, size_t *)); + +static char *_rl_get_locale_var PARAMS((const char *)); + +static char * +_rl_get_locale_var (v) + const char *v; +{ + char *lspec; + + lspec = sh_get_env_value ("LC_ALL"); + if (lspec == 0 || *lspec == 0) + lspec = sh_get_env_value (v); + if (lspec == 0 || *lspec == 0) + lspec = sh_get_env_value ("LANG"); + + return lspec; +} + +static int +utf8locale (lspec) + char *lspec; +{ + char *cp; + size_t len; + +#if HAVE_LANGINFO_CODESET + cp = nl_langinfo (CODESET); + return (STREQ (cp, "UTF-8") || STREQ (cp, "utf8")); +#else + cp = find_codeset (lspec, &len); + + if (cp == 0 || len < 4 || len > 5) + return 0; + return ((len == 5) ? strncmp (cp, "UTF-8", len) == 0 : strncmp (cp, "utf8", 4) == 0); +#endif +} + +/* Check for LC_ALL, LC_CTYPE, and LANG and use the first with a value + to decide the defaults for 8-bit character input and output. Returns + 1 if we set eight-bit mode. */ +int +_rl_init_eightbit () +{ +/* If we have setlocale(3), just check the current LC_CTYPE category + value, and go into eight-bit mode if it's not C or POSIX. */ +#if defined (HAVE_SETLOCALE) + char *lspec, *t; + + /* Set the LC_CTYPE locale category from environment variables. */ + lspec = _rl_get_locale_var ("LC_CTYPE"); + /* Since _rl_get_locale_var queries the right environment variables, + we query the current locale settings with setlocale(), and, if + that doesn't return anything, we set lspec to the empty string to + force the subsequent call to setlocale() to define the `native' + environment. */ + if (lspec == 0 || *lspec == 0) + lspec = setlocale (LC_CTYPE, (char *)NULL); + if (lspec == 0) + lspec = ""; + t = setlocale (LC_CTYPE, lspec); + + if (t && *t) + _rl_utf8locale = utf8locale (t); + + if (t && *t && (t[0] != 'C' || t[1]) && (STREQ (t, "POSIX") == 0)) + { + _rl_meta_flag = 1; + _rl_convert_meta_chars_to_ascii = 0; + _rl_output_meta_chars = 1; + return (1); + } + else + return (0); + +#else /* !HAVE_SETLOCALE */ + char *lspec, *t; + int i; + + /* We don't have setlocale. Finesse it. Check the environment for the + appropriate variables and set eight-bit mode if they have the right + values. */ + lspec = _rl_get_locale_var ("LC_CTYPE"); + + if (lspec == 0 || (t = normalize_codeset (lspec)) == 0) + return (0); + for (i = 0; t && legal_lang_values[i]; i++) + if (STREQ (t, legal_lang_values[i])) + { + _rl_meta_flag = 1; + _rl_convert_meta_chars_to_ascii = 0; + _rl_output_meta_chars = 1; + break; + } + xfree (t); + return (legal_lang_values[i] ? 1 : 0); + +#endif /* !HAVE_SETLOCALE */ +} + +#if !defined (HAVE_SETLOCALE) +static char * +normalize_codeset (codeset) + char *codeset; +{ + size_t namelen, i; + int len, all_digits; + char *wp, *retval; + + codeset = find_codeset (codeset, &namelen); + + if (codeset == 0) + return (codeset); + + all_digits = 1; + for (len = 0, i = 0; i < namelen; i++) + { + if (ISALNUM ((unsigned char)codeset[i])) + { + len++; + all_digits &= _rl_digit_p (codeset[i]); + } + } + + retval = (char *)malloc ((all_digits ? 3 : 0) + len + 1); + if (retval == 0) + return ((char *)0); + + wp = retval; + /* Add `iso' to beginning of an all-digit codeset */ + if (all_digits) + { + *wp++ = 'i'; + *wp++ = 's'; + *wp++ = 'o'; + } + + for (i = 0; i < namelen; i++) + if (ISALPHA ((unsigned char)codeset[i])) + *wp++ = _rl_to_lower (codeset[i]); + else if (_rl_digit_p (codeset[i])) + *wp++ = codeset[i]; + *wp = '\0'; + + return retval; +} +#endif /* !HAVE_SETLOCALE */ + +/* Isolate codeset portion of locale specification. */ +static char * +find_codeset (name, lenp) + char *name; + size_t *lenp; +{ + char *cp, *language, *result; + + cp = language = name; + result = (char *)0; + + while (*cp && *cp != '_' && *cp != '@' && *cp != '+' && *cp != ',') + cp++; + + /* This does not make sense: language has to be specified. As + an exception we allow the variable to contain only the codeset + name. Perhaps there are funny codeset names. */ + if (language == cp) + { + *lenp = strlen (language); + result = language; + } + else + { + /* Next is the territory. */ + if (*cp == '_') + do + ++cp; + while (*cp && *cp != '.' && *cp != '@' && *cp != '+' && *cp != ',' && *cp != '_'); + + /* Now, finally, is the codeset. */ + result = cp; + if (*cp == '.') + do + ++cp; + while (*cp && *cp != '@'); + + if (cp - result > 2) + { + result++; + *lenp = cp - result; + } + else + { + *lenp = strlen (language); + result = language; + } + } + + return result; +} diff --git a/lib/readline/parens.c b/lib/readline/parens.c new file mode 100644 index 0000000..9c98488 --- /dev/null +++ b/lib/readline/parens.c @@ -0,0 +1,173 @@ +/* parens.c -- implementation of matching parentheses feature. */ + +/* Copyright (C) 1987, 1989, 1992-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (__TANDEM) +# include +#endif + +#include "rlconf.h" + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "posixselect.h" + +#if defined (HAVE_STRING_H) +# include +#else /* !HAVE_STRING_H */ +# include +#endif /* !HAVE_STRING_H */ + +#if !defined (strchr) && !defined (__STDC__) +extern char *strchr (), *strrchr (); +#endif /* !strchr && !__STDC__ */ + +#include "readline.h" +#include "rlprivate.h" + +static int find_matching_open PARAMS((char *, int, int)); + +/* Non-zero means try to blink the matching open parenthesis when the + close parenthesis is inserted. */ +#if defined (HAVE_SELECT) +int rl_blink_matching_paren = 1; +#else /* !HAVE_SELECT */ +int rl_blink_matching_paren = 0; +#endif /* !HAVE_SELECT */ + +static int _paren_blink_usec = 500000; + +/* Change emacs_standard_keymap to have bindings for paren matching when + ON_OR_OFF is 1, change them back to self_insert when ON_OR_OFF == 0. */ +void +_rl_enable_paren_matching (on_or_off) + int on_or_off; +{ + if (on_or_off) + { /* ([{ */ + rl_bind_key_in_map (')', rl_insert_close, emacs_standard_keymap); + rl_bind_key_in_map (']', rl_insert_close, emacs_standard_keymap); + rl_bind_key_in_map ('}', rl_insert_close, emacs_standard_keymap); + } + else + { /* ([{ */ + rl_bind_key_in_map (')', rl_insert, emacs_standard_keymap); + rl_bind_key_in_map (']', rl_insert, emacs_standard_keymap); + rl_bind_key_in_map ('}', rl_insert, emacs_standard_keymap); + } +} + +int +rl_set_paren_blink_timeout (u) + int u; +{ + int o; + + o = _paren_blink_usec; + if (u > 0) + _paren_blink_usec = u; + return (o); +} + +int +rl_insert_close (count, invoking_key) + int count, invoking_key; +{ + if (rl_explicit_arg || !rl_blink_matching_paren) + _rl_insert_char (count, invoking_key); + else + { +#if defined (HAVE_SELECT) + int orig_point, match_point, ready; + struct timeval timer; + fd_set readfds; + + _rl_insert_char (1, invoking_key); + (*rl_redisplay_function) (); + match_point = + find_matching_open (rl_line_buffer, rl_point - 2, invoking_key); + + /* Emacs might message or ring the bell here, but I don't. */ + if (match_point < 0) + return -1; + + FD_ZERO (&readfds); + FD_SET (fileno (rl_instream), &readfds); + USEC_TO_TIMEVAL (_paren_blink_usec, timer); + + orig_point = rl_point; + rl_point = match_point; + (*rl_redisplay_function) (); + ready = select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer); + rl_point = orig_point; +#else /* !HAVE_SELECT */ + _rl_insert_char (count, invoking_key); +#endif /* !HAVE_SELECT */ + } + return 0; +} + +static int +find_matching_open (string, from, closer) + char *string; + int from, closer; +{ + register int i; + int opener, level, delimiter; + + switch (closer) + { + case ']': opener = '['; break; + case '}': opener = '{'; break; + case ')': opener = '('; break; + default: + return (-1); + } + + level = 1; /* The closer passed in counts as 1. */ + delimiter = 0; /* Delimited state unknown. */ + + for (i = from; i > -1; i--) + { + if (delimiter && (string[i] == delimiter)) + delimiter = 0; + else if (rl_basic_quote_characters && strchr (rl_basic_quote_characters, string[i])) + delimiter = string[i]; + else if (!delimiter && (string[i] == closer)) + level++; + else if (!delimiter && (string[i] == opener)) + level--; + + if (!level) + break; + } + return (i); +} diff --git a/lib/readline/parse-colors.c b/lib/readline/parse-colors.c new file mode 100644 index 0000000..98b2e9d --- /dev/null +++ b/lib/readline/parse-colors.c @@ -0,0 +1,440 @@ +/* `dir', `vdir' and `ls' directory listing programs for GNU. + + Modified by Chet Ramey for Readline. + + Copyright (C) 1985, 1988, 1990-1991, 1995-2010, 2012 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Richard Stallman and David MacKenzie. */ + +/* Color support by Peter Anvin and Dennis + Flaherty based on original patches by + Greg Lee . */ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include + +// strdup() / strcpy() +#if defined (HAVE_STRING_H) +# include +#else /* !HAVE_STRING_H */ +# include +#endif /* !HAVE_STRING_H */ + +// abort() +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include "rldefs.h" // STREQ, savestring +#include "readline.h" +#include "rlprivate.h" +#include "rlshell.h" +#include "xmalloc.h" + +#include "colors.h" +#include "parse-colors.h" + +#if defined (COLOR_SUPPORT) + +static bool get_funky_string (char **dest, const char **src, bool equals_end, size_t *output_count); + +struct bin_str _rl_color_indicator[] = + { + { LEN_STR_PAIR ("\033[") }, // lc: Left of color sequence + { LEN_STR_PAIR ("m") }, // rc: Right of color sequence + { 0, NULL }, // ec: End color (replaces lc+no+rc) + { LEN_STR_PAIR ("0") }, // rs: Reset to ordinary colors + { 0, NULL }, // no: Normal + { 0, NULL }, // fi: File: default + { LEN_STR_PAIR ("01;34") }, // di: Directory: bright blue + { LEN_STR_PAIR ("01;36") }, // ln: Symlink: bright cyan + { LEN_STR_PAIR ("33") }, // pi: Pipe: yellow/brown + { LEN_STR_PAIR ("01;35") }, // so: Socket: bright magenta + { LEN_STR_PAIR ("01;33") }, // bd: Block device: bright yellow + { LEN_STR_PAIR ("01;33") }, // cd: Char device: bright yellow + { 0, NULL }, // mi: Missing file: undefined + { 0, NULL }, // or: Orphaned symlink: undefined + { LEN_STR_PAIR ("01;32") }, // ex: Executable: bright green + { LEN_STR_PAIR ("01;35") }, // do: Door: bright magenta + { LEN_STR_PAIR ("37;41") }, // su: setuid: white on red + { LEN_STR_PAIR ("30;43") }, // sg: setgid: black on yellow + { LEN_STR_PAIR ("37;44") }, // st: sticky: black on blue + { LEN_STR_PAIR ("34;42") }, // ow: other-writable: blue on green + { LEN_STR_PAIR ("30;42") }, // tw: ow w/ sticky: black on green + { LEN_STR_PAIR ("30;41") }, // ca: black on red + { 0, NULL }, // mh: disabled by default + { LEN_STR_PAIR ("\033[K") }, // cl: clear to end of line + }; + +/* Parse a string as part of the LS_COLORS variable; this may involve + decoding all kinds of escape characters. If equals_end is set an + unescaped equal sign ends the string, otherwise only a : or \0 + does. Set *OUTPUT_COUNT to the number of bytes output. Return + true if successful. + + The resulting string is *not* null-terminated, but may contain + embedded nulls. + + Note that both dest and src are char **; on return they point to + the first free byte after the array and the character that ended + the input string, respectively. */ + +static bool +get_funky_string (char **dest, const char **src, bool equals_end, size_t *output_count) { + char num; /* For numerical codes */ + size_t count; /* Something to count with */ + enum { + ST_GND, ST_BACKSLASH, ST_OCTAL, ST_HEX, ST_CARET, ST_END, ST_ERROR + } state; + const char *p; + char *q; + + p = *src; /* We don't want to double-indirect */ + q = *dest; /* the whole darn time. */ + + count = 0; /* No characters counted in yet. */ + num = 0; + + state = ST_GND; /* Start in ground state. */ + while (state < ST_END) + { + switch (state) + { + case ST_GND: /* Ground state (no escapes) */ + switch (*p) + { + case ':': + case '\0': + state = ST_END; /* End of string */ + break; + case '\\': + state = ST_BACKSLASH; /* Backslash scape sequence */ + ++p; + break; + case '^': + state = ST_CARET; /* Caret escape */ + ++p; + break; + case '=': + if (equals_end) + { + state = ST_END; /* End */ + break; + } + /* else fall through */ + default: + *(q++) = *(p++); + ++count; + break; + } + break; + + case ST_BACKSLASH: /* Backslash escaped character */ + switch (*p) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + state = ST_OCTAL; /* Octal sequence */ + num = *p - '0'; + break; + case 'x': + case 'X': + state = ST_HEX; /* Hex sequence */ + num = 0; + break; + case 'a': /* Bell */ + num = '\a'; + break; + case 'b': /* Backspace */ + num = '\b'; + break; + case 'e': /* Escape */ + num = 27; + break; + case 'f': /* Form feed */ + num = '\f'; + break; + case 'n': /* Newline */ + num = '\n'; + break; + case 'r': /* Carriage return */ + num = '\r'; + break; + case 't': /* Tab */ + num = '\t'; + break; + case 'v': /* Vtab */ + num = '\v'; + break; + case '?': /* Delete */ + num = 127; + break; + case '_': /* Space */ + num = ' '; + break; + case '\0': /* End of string */ + state = ST_ERROR; /* Error! */ + break; + default: /* Escaped character like \ ^ : = */ + num = *p; + break; + } + if (state == ST_BACKSLASH) + { + *(q++) = num; + ++count; + state = ST_GND; + } + ++p; + break; + + case ST_OCTAL: /* Octal sequence */ + if (*p < '0' || *p > '7') + { + *(q++) = num; + ++count; + state = ST_GND; + } + else + num = (num << 3) + (*(p++) - '0'); + break; + + case ST_HEX: /* Hex sequence */ + switch (*p) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + num = (num << 4) + (*(p++) - '0'); + break; + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + num = (num << 4) + (*(p++) - 'a') + 10; + break; + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + num = (num << 4) + (*(p++) - 'A') + 10; + break; + default: + *(q++) = num; + ++count; + state = ST_GND; + break; + } + break; + + case ST_CARET: /* Caret escape */ + state = ST_GND; /* Should be the next state... */ + if (*p >= '@' && *p <= '~') + { + *(q++) = *(p++) & 037; + ++count; + } + else if (*p == '?') + { + *(q++) = 127; + ++count; + } + else + state = ST_ERROR; + break; + + default: + /* should we ? */ + /* abort (); no, we should not */ + state = ST_ERROR; + break; + } + } + + *dest = q; + *src = p; + *output_count = count; + + return state != ST_ERROR; +} +#endif /* COLOR_SUPPORT */ + +void _rl_parse_colors() +{ +#if defined (COLOR_SUPPORT) + const char *p; /* Pointer to character being parsed */ + char *buf; /* color_buf buffer pointer */ + int state; /* State of parser */ + int ind_no; /* Indicator number */ + char label[3]; /* Indicator label */ + COLOR_EXT_TYPE *ext; /* Extension we are working on */ + + p = sh_get_env_value ("LS_COLORS"); + if (p == 0 || *p == '\0') + { + _rl_color_ext_list = NULL; + return; + } + + ext = NULL; + strcpy (label, "??"); + + /* This is an overly conservative estimate, but any possible + LS_COLORS string will *not* generate a color_buf longer than + itself, so it is a safe way of allocating a buffer in + advance. */ + buf = color_buf = savestring (p); + + state = 1; + while (state > 0) + { + switch (state) + { + case 1: /* First label character */ + switch (*p) + { + case ':': + ++p; + break; + + case '*': + /* Allocate new extension block and add to head of + linked list (this way a later definition will + override an earlier one, which can be useful for + having terminal-specific defs override global). */ + + ext = (COLOR_EXT_TYPE *)xmalloc (sizeof *ext); + ext->next = _rl_color_ext_list; + _rl_color_ext_list = ext; + + ++p; + ext->ext.string = buf; + + state = (get_funky_string (&buf, &p, true, &ext->ext.len) + ? 4 : -1); + break; + + case '\0': + state = 0; /* Done! */ + break; + + default: /* Assume it is file type label */ + label[0] = *(p++); + state = 2; + break; + } + break; + + case 2: /* Second label character */ + if (*p) + { + label[1] = *(p++); + state = 3; + } + else + state = -1; /* Error */ + break; + + case 3: /* Equal sign after indicator label */ + state = -1; /* Assume failure... */ + if (*(p++) == '=')/* It *should* be... */ + { + for (ind_no = 0; indicator_name[ind_no] != NULL; ++ind_no) + { + if (STREQ (label, indicator_name[ind_no])) + { + _rl_color_indicator[ind_no].string = buf; + state = (get_funky_string (&buf, &p, false, + &_rl_color_indicator[ind_no].len) + ? 1 : -1); + break; + } + } + if (state == -1) + { + _rl_errmsg ("LS_COLORS: unrecognized prefix: %s", label); + /* recover from an unrecognized prefix */ + while (p && *p && *p != ':') + p++; + if (p && *p == ':') + state = 1; + else if (p && *p == 0) + state = 0; + } + } + break; + + case 4: /* Equal sign after *.ext */ + if (*(p++) == '=') + { + ext->seq.string = buf; + state = (get_funky_string (&buf, &p, false, &ext->seq.len) + ? 1 : -1); + } + else + state = -1; + /* XXX - recover here as with an unrecognized prefix? */ + if (state == -1 && ext->ext.string) + _rl_errmsg ("LS_COLORS: syntax error: %s", ext->ext.string); + break; + } + } + + if (state < 0) + { + COLOR_EXT_TYPE *e; + COLOR_EXT_TYPE *e2; + + _rl_errmsg ("unparsable value for LS_COLORS environment variable"); + free (color_buf); + for (e = _rl_color_ext_list; e != NULL; /* empty */) + { + e2 = e; + e = e->next; + free (e2); + } + _rl_color_ext_list = NULL; + _rl_colored_stats = 0; /* can't have colored stats without colors */ + } +#else /* !COLOR_SUPPORT */ + ; +#endif /* !COLOR_SUPPORT */ +} diff --git a/lib/readline/parse-colors.h b/lib/readline/parse-colors.h new file mode 100644 index 0000000..aef86f7 --- /dev/null +++ b/lib/readline/parse-colors.h @@ -0,0 +1,46 @@ +/* `dir', `vdir' and `ls' directory listing programs for GNU. + + Modified by Chet Ramey for Readline. + + Copyright (C) 1985, 1988, 1990-1991, 1995-2010, 2012 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Richard Stallman and David MacKenzie. */ + +/* Color support by Peter Anvin and Dennis + Flaherty based on original patches by + Greg Lee . */ + +#ifndef _PARSE_COLORS_H_ +#define _PARSE_COLORS_H_ + +#include "readline.h" + +#define LEN_STR_PAIR(s) sizeof (s) - 1, s + +void _rl_parse_colors (void); + +static const char *const indicator_name[]= + { + "lc", "rc", "ec", "rs", "no", "fi", "di", "ln", "pi", "so", + "bd", "cd", "mi", "or", "ex", "do", "su", "sg", "st", + "ow", "tw", "ca", "mh", "cl", NULL + }; + +/* Buffer for color sequences */ +static char *color_buf; + +#endif /* !_PARSE_COLORS_H_ */ diff --git a/lib/readline/posixdir.h b/lib/readline/posixdir.h new file mode 100644 index 0000000..0921c5d --- /dev/null +++ b/lib/readline/posixdir.h @@ -0,0 +1,71 @@ +/* posixdir.h -- Posix directory reading includes and defines. */ + +/* Copyright (C) 1987,1991,2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* This file should be included instead of or . */ + +#if !defined (_POSIXDIR_H_) +#define _POSIXDIR_H_ + +#if defined (HAVE_DIRENT_H) +# include +# if defined (HAVE_STRUCT_DIRENT_D_NAMLEN) +# define D_NAMLEN(d) ((d)->d_namlen) +# else +# define D_NAMLEN(d) (strlen ((d)->d_name)) +# endif /* !HAVE_STRUCT_DIRENT_D_NAMLEN */ +#else +# if defined (HAVE_SYS_NDIR_H) +# include +# endif +# if defined (HAVE_SYS_DIR_H) +# include +# endif +# if defined (HAVE_NDIR_H) +# include +# endif +# if !defined (dirent) +# define dirent direct +# endif /* !dirent */ +# define D_NAMLEN(d) ((d)->d_namlen) +#endif /* !HAVE_DIRENT_H */ + +/* The bash code fairly consistenly uses d_fileno; make sure it's available */ +#if defined (HAVE_STRUCT_DIRENT_D_INO) && !defined (HAVE_STRUCT_DIRENT_D_FILENO) +# define d_fileno d_ino +#endif + +/* Posix does not require that the d_ino field be present, and some + systems do not provide it. */ +#if !defined (HAVE_STRUCT_DIRENT_D_INO) || defined (BROKEN_DIRENT_D_INO) +# define REAL_DIR_ENTRY(dp) 1 +#else +# define REAL_DIR_ENTRY(dp) (dp->d_ino != 0) +#endif /* _POSIX_SOURCE */ + +#if defined (HAVE_STRUCT_DIRENT_D_INO) && !defined (BROKEN_DIRENT_D_INO) +# define D_INO_AVAILABLE +#endif + +/* Signal the rest of the code that it can safely use dirent.d_fileno */ +#if defined (D_INO_AVAILABLE) || defined (HAVE_STRUCT_DIRENT_D_FILENO) +# define D_FILENO_AVAILABLE 1 +#endif + +#endif /* !_POSIXDIR_H_ */ diff --git a/lib/readline/posixjmp.h b/lib/readline/posixjmp.h new file mode 100644 index 0000000..98cf718 --- /dev/null +++ b/lib/readline/posixjmp.h @@ -0,0 +1,42 @@ +/* posixjmp.h -- wrapper for setjmp.h with changes for POSIX systems. */ + +/* Copyright (C) 1987,1991 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _POSIXJMP_H_ +#define _POSIXJMP_H_ + +#include + +/* This *must* be included *after* config.h */ + +#if defined (HAVE_POSIX_SIGSETJMP) +# define procenv_t sigjmp_buf +# if !defined (__OPENNT) +# undef setjmp +# define setjmp(x) sigsetjmp((x), 1) +# define setjmp_nosigs(x) sigsetjmp((x), 0) +# undef longjmp +# define longjmp(x, n) siglongjmp((x), (n)) +# endif /* !__OPENNT */ +#else +# define procenv_t jmp_buf +# define setjmp_nosigs setjmp +#endif + +#endif /* _POSIXJMP_H_ */ diff --git a/lib/readline/posixselect.h b/lib/readline/posixselect.h new file mode 100644 index 0000000..da6a1ac --- /dev/null +++ b/lib/readline/posixselect.h @@ -0,0 +1,47 @@ +/* posixselect.h -- wrapper for select(2) includes and definitions */ + +/* Copyright (C) 2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _POSIXSELECT_H_ +#define _POSIXSELECT_H_ + +#if defined (FD_SET) && !defined (HAVE_SELECT) +# define HAVE_SELECT 1 +#endif + +#if defined (HAVE_SELECT) +# if !defined (HAVE_SYS_SELECT_H) || !defined (M_UNIX) +# include +# endif +#endif /* HAVE_SELECT */ +#if defined (HAVE_SYS_SELECT_H) +# include +#endif + +#ifndef USEC_PER_SEC +# define USEC_PER_SEC 1000000 +#endif + +#define USEC_TO_TIMEVAL(us, tv) \ +do { \ + (tv).tv_sec = (us) / USEC_PER_SEC; \ + (tv).tv_usec = (us) % USEC_PER_SEC; \ +} while (0) + +#endif /* _POSIXSELECT_H_ */ diff --git a/lib/readline/posixstat.h b/lib/readline/posixstat.h new file mode 100644 index 0000000..3eb7f29 --- /dev/null +++ b/lib/readline/posixstat.h @@ -0,0 +1,142 @@ +/* posixstat.h -- Posix stat(2) definitions for systems that + don't have them. */ + +/* Copyright (C) 1987,1991 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* This file should be included instead of . + It relies on the local sys/stat.h to work though. */ +#if !defined (_POSIXSTAT_H_) +#define _POSIXSTAT_H_ + +#include + +#if defined (STAT_MACROS_BROKEN) +# undef S_ISBLK +# undef S_ISCHR +# undef S_ISDIR +# undef S_ISFIFO +# undef S_ISREG +# undef S_ISLNK +#endif /* STAT_MACROS_BROKEN */ + +/* These are guaranteed to work only on isc386 */ +#if !defined (S_IFDIR) && !defined (S_ISDIR) +# define S_IFDIR 0040000 +#endif /* !S_IFDIR && !S_ISDIR */ +#if !defined (S_IFMT) +# define S_IFMT 0170000 +#endif /* !S_IFMT */ + +/* Posix 1003.1 5.6.1.1 file types */ + +/* Some Posix-wannabe systems define _S_IF* macros instead of S_IF*, but + do not provide the S_IS* macros that Posix requires. */ + +#if defined (_S_IFMT) && !defined (S_IFMT) +#define S_IFMT _S_IFMT +#endif +#if defined (_S_IFIFO) && !defined (S_IFIFO) +#define S_IFIFO _S_IFIFO +#endif +#if defined (_S_IFCHR) && !defined (S_IFCHR) +#define S_IFCHR _S_IFCHR +#endif +#if defined (_S_IFDIR) && !defined (S_IFDIR) +#define S_IFDIR _S_IFDIR +#endif +#if defined (_S_IFBLK) && !defined (S_IFBLK) +#define S_IFBLK _S_IFBLK +#endif +#if defined (_S_IFREG) && !defined (S_IFREG) +#define S_IFREG _S_IFREG +#endif +#if defined (_S_IFLNK) && !defined (S_IFLNK) +#define S_IFLNK _S_IFLNK +#endif +#if defined (_S_IFSOCK) && !defined (S_IFSOCK) +#define S_IFSOCK _S_IFSOCK +#endif + +/* Test for each symbol individually and define the ones necessary (some + systems claiming Posix compatibility define some but not all). */ + +#if defined (S_IFBLK) && !defined (S_ISBLK) +#define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK) /* block device */ +#endif + +#if defined (S_IFCHR) && !defined (S_ISCHR) +#define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR) /* character device */ +#endif + +#if defined (S_IFDIR) && !defined (S_ISDIR) +#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) /* directory */ +#endif + +#if defined (S_IFREG) && !defined (S_ISREG) +#define S_ISREG(m) (((m)&S_IFMT) == S_IFREG) /* file */ +#endif + +#if defined (S_IFIFO) && !defined (S_ISFIFO) +#define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO) /* fifo - named pipe */ +#endif + +#if defined (S_IFLNK) && !defined (S_ISLNK) +#define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK) /* symbolic link */ +#endif + +#if defined (S_IFSOCK) && !defined (S_ISSOCK) +#define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK) /* socket */ +#endif + +/* + * POSIX 1003.1 5.6.1.2 File Modes + */ + +#if !defined (S_IRWXU) +# if !defined (S_IREAD) +# define S_IREAD 00400 +# define S_IWRITE 00200 +# define S_IEXEC 00100 +# endif /* S_IREAD */ + +# if !defined (S_IRUSR) +# define S_IRUSR S_IREAD /* read, owner */ +# define S_IWUSR S_IWRITE /* write, owner */ +# define S_IXUSR S_IEXEC /* execute, owner */ + +# define S_IRGRP (S_IREAD >> 3) /* read, group */ +# define S_IWGRP (S_IWRITE >> 3) /* write, group */ +# define S_IXGRP (S_IEXEC >> 3) /* execute, group */ + +# define S_IROTH (S_IREAD >> 6) /* read, other */ +# define S_IWOTH (S_IWRITE >> 6) /* write, other */ +# define S_IXOTH (S_IEXEC >> 6) /* execute, other */ +# endif /* !S_IRUSR */ + +# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) +# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) +# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) +#endif /* !S_IRWXU */ + +/* These are non-standard, but are used in builtins.c$symbolic_umask() */ +#define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH) +#define S_IWUGO (S_IWUSR | S_IWGRP | S_IWOTH) +#define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) + +#endif /* _POSIXSTAT_H_ */ diff --git a/lib/readline/readline.c b/lib/readline/readline.c new file mode 100644 index 0000000..abb29a0 --- /dev/null +++ b/lib/readline/readline.c @@ -0,0 +1,1364 @@ +/* readline.c -- a general facility for reading lines of input + with emacs style editing and completion. */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include +#include "posixstat.h" +#include +#if defined (HAVE_SYS_FILE_H) +# include +#endif /* HAVE_SYS_FILE_H */ + +#if defined (HAVE_UNISTD_H) +# include +#endif /* HAVE_UNISTD_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#if defined (HAVE_LOCALE_H) +# include +#endif + +#include +#include "posixjmp.h" +#include + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" +#include "rlmbutil.h" + +#if defined (__EMX__) +# define INCL_DOSPROCESS +# include +#endif /* __EMX__ */ + +/* Some standard library routines. */ +#include "readline.h" +#include "history.h" + +#include "rlprivate.h" +#include "rlshell.h" +#include "xmalloc.h" + +#ifndef RL_LIBRARY_VERSION +# define RL_LIBRARY_VERSION "5.1" +#endif + +#ifndef RL_READLINE_VERSION +# define RL_READLINE_VERSION 0x0501 +#endif + +extern void _rl_free_history_entry PARAMS((HIST_ENTRY *)); + +#if defined (COLOR_SUPPORT) +extern void _rl_parse_colors PARAMS((void)); /* XXX */ +#endif + + +/* Forward declarations used in this file. */ +static char *readline_internal PARAMS((void)); +static void readline_initialize_everything PARAMS((void)); + +static void bind_arrow_keys_internal PARAMS((Keymap)); +static void bind_arrow_keys PARAMS((void)); + +static void readline_default_bindings PARAMS((void)); +static void reset_default_bindings PARAMS((void)); + +static int _rl_subseq_result PARAMS((int, Keymap, int, int)); +static int _rl_subseq_getchar PARAMS((int)); + +/* **************************************************************** */ +/* */ +/* Line editing input utility */ +/* */ +/* **************************************************************** */ + +const char *rl_library_version = RL_LIBRARY_VERSION; + +int rl_readline_version = RL_READLINE_VERSION; + +/* True if this is `real' readline as opposed to some stub substitute. */ +int rl_gnu_readline_p = 1; + +/* A pointer to the keymap that is currently in use. + By default, it is the standard emacs keymap. */ +Keymap _rl_keymap = emacs_standard_keymap; + +/* The current style of editing. */ +int rl_editing_mode = emacs_mode; + +/* The current insert mode: input (the default) or overwrite */ +int rl_insert_mode = RL_IM_DEFAULT; + +/* Non-zero if we called this function from _rl_dispatch(). It's present + so functions can find out whether they were called from a key binding + or directly from an application. */ +int rl_dispatching; + +/* Non-zero if the previous command was a kill command. */ +int _rl_last_command_was_kill = 0; + +/* The current value of the numeric argument specified by the user. */ +int rl_numeric_arg = 1; + +/* Non-zero if an argument was typed. */ +int rl_explicit_arg = 0; + +/* Temporary value used while generating the argument. */ +int rl_arg_sign = 1; + +/* Non-zero means we have been called at least once before. */ +static int rl_initialized; + +#if 0 +/* If non-zero, this program is running in an EMACS buffer. */ +static int running_in_emacs; +#endif + +/* Flags word encapsulating the current readline state. */ +int rl_readline_state = RL_STATE_NONE; + +/* The current offset in the current input line. */ +int rl_point; + +/* Mark in the current input line. */ +int rl_mark; + +/* Length of the current input line. */ +int rl_end; + +/* Make this non-zero to return the current input_line. */ +int rl_done; + +/* The last function executed by readline. */ +rl_command_func_t *rl_last_func = (rl_command_func_t *)NULL; + +/* Top level environment for readline_internal (). */ +procenv_t _rl_top_level; + +/* The streams we interact with. */ +FILE *_rl_in_stream, *_rl_out_stream; + +/* The names of the streams that we do input and output to. */ +FILE *rl_instream = (FILE *)NULL; +FILE *rl_outstream = (FILE *)NULL; + +/* Non-zero means echo characters as they are read. Defaults to no echo; + set to 1 if there is a controlling terminal, we can get its attributes, + and the attributes include `echo'. Look at rltty.c:prepare_terminal_settings + for the code that sets it. */ +int _rl_echoing_p = 0; + +/* Current prompt. */ +char *rl_prompt = (char *)NULL; +int rl_visible_prompt_length = 0; + +/* Set to non-zero by calling application if it has already printed rl_prompt + and does not want readline to do it the first time. */ +int rl_already_prompted = 0; + +/* The number of characters read in order to type this complete command. */ +int rl_key_sequence_length = 0; + +/* If non-zero, then this is the address of a function to call just + before readline_internal_setup () prints the first prompt. */ +rl_hook_func_t *rl_startup_hook = (rl_hook_func_t *)NULL; + +/* If non-zero, this is the address of a function to call just before + readline_internal_setup () returns and readline_internal starts + reading input characters. */ +rl_hook_func_t *rl_pre_input_hook = (rl_hook_func_t *)NULL; + +/* What we use internally. You should always refer to RL_LINE_BUFFER. */ +static char *the_line; + +/* The character that can generate an EOF. Really read from + the terminal driver... just defaulted here. */ +int _rl_eof_char = CTRL ('D'); + +/* Non-zero makes this the next keystroke to read. */ +int rl_pending_input = 0; + +/* Pointer to a useful terminal name. */ +const char *rl_terminal_name = (const char *)NULL; + +/* Non-zero means to always use horizontal scrolling in line display. */ +int _rl_horizontal_scroll_mode = 0; + +/* Non-zero means to display an asterisk at the starts of history lines + which have been modified. */ +int _rl_mark_modified_lines = 0; + +/* The style of `bell' notification preferred. This can be set to NO_BELL, + AUDIBLE_BELL, or VISIBLE_BELL. */ +int _rl_bell_preference = AUDIBLE_BELL; + +/* String inserted into the line by rl_insert_comment (). */ +char *_rl_comment_begin; + +/* Keymap holding the function currently being executed. */ +Keymap rl_executing_keymap; + +/* Keymap we're currently using to dispatch. */ +Keymap _rl_dispatching_keymap; + +/* Non-zero means to erase entire line, including prompt, on empty input lines. */ +int rl_erase_empty_line = 0; + +/* Non-zero means to read only this many characters rather than up to a + character bound to accept-line. */ +int rl_num_chars_to_read; + +/* Line buffer and maintenance. */ +char *rl_line_buffer = (char *)NULL; +int rl_line_buffer_len = 0; + +/* Key sequence `contexts' */ +_rl_keyseq_cxt *_rl_kscxt = 0; + +int rl_executing_key; +char *rl_executing_keyseq = 0; +int _rl_executing_keyseq_size = 0; + +/* Timeout (specified in milliseconds) when reading characters making up an + ambiguous multiple-key sequence */ +int _rl_keyseq_timeout = 500; + +#define RESIZE_KEYSEQ_BUFFER() \ + do \ + { \ + if (rl_key_sequence_length + 2 >= _rl_executing_keyseq_size) \ + { \ + _rl_executing_keyseq_size += 16; \ + rl_executing_keyseq = xrealloc (rl_executing_keyseq, _rl_executing_keyseq_size); \ + } \ + } \ + while (0); + +/* Forward declarations used by the display, termcap, and history code. */ + +/* **************************************************************** */ +/* */ +/* `Forward' declarations */ +/* */ +/* **************************************************************** */ + +/* Non-zero means do not parse any lines other than comments and + parser directives. */ +unsigned char _rl_parsing_conditionalized_out = 0; + +/* Non-zero means to convert characters with the meta bit set to + escape-prefixed characters so we can indirect through + emacs_meta_keymap or vi_escape_keymap. */ +int _rl_convert_meta_chars_to_ascii = 1; + +/* Non-zero means to output characters with the meta bit set directly + rather than as a meta-prefixed escape sequence. */ +int _rl_output_meta_chars = 0; + +/* Non-zero means to look at the termios special characters and bind + them to equivalent readline functions at startup. */ +int _rl_bind_stty_chars = 1; + +/* Non-zero means to go through the history list at every newline (or + whenever rl_done is set and readline returns) and revert each line to + its initial state. */ +int _rl_revert_all_at_newline = 0; + +/* Non-zero means to honor the termios ECHOCTL bit and echo control + characters corresponding to keyboard-generated signals. */ +int _rl_echo_control_chars = 1; + +/* Non-zero means to prefix the displayed prompt with a character indicating + the editing mode: @ for emacs, : for vi-command, + for vi-insert. */ +int _rl_show_mode_in_prompt = 0; + +/* **************************************************************** */ +/* */ +/* Top Level Functions */ +/* */ +/* **************************************************************** */ + +/* Non-zero means treat 0200 bit in terminal input as Meta bit. */ +int _rl_meta_flag = 0; /* Forward declaration */ + +/* Set up the prompt and expand it. Called from readline() and + rl_callback_handler_install (). */ +int +rl_set_prompt (prompt) + const char *prompt; +{ + FREE (rl_prompt); + rl_prompt = prompt ? savestring (prompt) : (char *)NULL; + rl_display_prompt = rl_prompt ? rl_prompt : ""; + + rl_visible_prompt_length = rl_expand_prompt (rl_prompt); + return 0; +} + +/* Read a line of input. Prompt with PROMPT. An empty PROMPT means + none. A return value of NULL means that EOF was encountered. */ +char * +readline (prompt) + const char *prompt; +{ + char *value; +#if 0 + int in_callback; +#endif + + /* If we are at EOF return a NULL string. */ + if (rl_pending_input == EOF) + { + rl_clear_pending_input (); + return ((char *)NULL); + } + +#if 0 + /* If readline() is called after installing a callback handler, temporarily + turn off the callback state to avoid ensuing messiness. Patch supplied + by the gdb folks. XXX -- disabled. This can be fooled and readline + left in a strange state by a poorly-timed longjmp. */ + if (in_callback = RL_ISSTATE (RL_STATE_CALLBACK)) + RL_UNSETSTATE (RL_STATE_CALLBACK); +#endif + + rl_set_prompt (prompt); + + rl_initialize (); + if (rl_prep_term_function) + (*rl_prep_term_function) (_rl_meta_flag); + +#if defined (HANDLE_SIGNALS) + rl_set_signals (); +#endif + + value = readline_internal (); + if (rl_deprep_term_function) + (*rl_deprep_term_function) (); + +#if defined (HANDLE_SIGNALS) + rl_clear_signals (); +#endif + +#if 0 + if (in_callback) + RL_SETSTATE (RL_STATE_CALLBACK); +#endif + +#if HAVE_DECL_AUDIT_TTY && defined (ENABLE_TTY_AUDIT_SUPPORT) + if (value) + _rl_audit_tty (value); +#endif + + return (value); +} + +#if defined (READLINE_CALLBACKS) +# define STATIC_CALLBACK +#else +# define STATIC_CALLBACK static +#endif + +STATIC_CALLBACK void +readline_internal_setup () +{ + char *nprompt; + + _rl_in_stream = rl_instream; + _rl_out_stream = rl_outstream; + + /* Enable the meta key only for the duration of readline(), if this + terminal has one and the terminal has been initialized */ + if (_rl_enable_meta & RL_ISSTATE (RL_STATE_TERMPREPPED)) + _rl_enable_meta_key (); + + if (rl_startup_hook) + (*rl_startup_hook) (); + +#if defined (VI_MODE) + if (rl_editing_mode == vi_mode) + rl_vi_insertion_mode (1, 'i'); /* don't want to reset last */ +#endif /* VI_MODE */ + + /* If we're not echoing, we still want to at least print a prompt, because + rl_redisplay will not do it for us. If the calling application has a + custom redisplay function, though, let that function handle it. */ + if (_rl_echoing_p == 0 && rl_redisplay_function == rl_redisplay) + { + if (rl_prompt && rl_already_prompted == 0) + { + nprompt = _rl_strip_prompt (rl_prompt); + fprintf (_rl_out_stream, "%s", nprompt); + fflush (_rl_out_stream); + xfree (nprompt); + } + } + else + { + if (rl_prompt && rl_already_prompted) + rl_on_new_line_with_prompt (); + else + rl_on_new_line (); + (*rl_redisplay_function) (); + } + + if (rl_pre_input_hook) + (*rl_pre_input_hook) (); + + RL_CHECK_SIGNALS (); +} + +STATIC_CALLBACK char * +readline_internal_teardown (eof) + int eof; +{ + char *temp; + HIST_ENTRY *entry; + + RL_CHECK_SIGNALS (); + + /* Restore the original of this history line, iff the line that we + are editing was originally in the history, AND the line has changed. */ + entry = current_history (); + + if (entry && rl_undo_list) + { + temp = savestring (the_line); + rl_revert_line (1, 0); + entry = replace_history_entry (where_history (), the_line, (histdata_t)NULL); + _rl_free_history_entry (entry); + + strcpy (the_line, temp); + xfree (temp); + } + + if (_rl_revert_all_at_newline) + _rl_revert_all_lines (); + + /* At any rate, it is highly likely that this line has an undo list. Get + rid of it now. */ + if (rl_undo_list) + rl_free_undo_list (); + + /* Disable the meta key, if this terminal has one and we were told to use it. + The check whether or not we sent the enable string is in + _rl_disable_meta_key(); the flag is set in _rl_enable_meta_key */ + _rl_disable_meta_key (); + + /* Restore normal cursor, if available. */ + _rl_set_insert_mode (RL_IM_INSERT, 0); + + return (eof ? (char *)NULL : savestring (the_line)); +} + +void +_rl_internal_char_cleanup () +{ +#if defined (VI_MODE) + /* In vi mode, when you exit insert mode, the cursor moves back + over the previous character. We explicitly check for that here. */ + if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap) + rl_vi_check (); +#endif /* VI_MODE */ + + if (rl_num_chars_to_read && rl_end >= rl_num_chars_to_read) + { + (*rl_redisplay_function) (); + _rl_want_redisplay = 0; + rl_newline (1, '\n'); + } + + if (rl_done == 0) + { + (*rl_redisplay_function) (); + _rl_want_redisplay = 0; + } + + /* If the application writer has told us to erase the entire line if + the only character typed was something bound to rl_newline, do so. */ + if (rl_erase_empty_line && rl_done && rl_last_func == rl_newline && + rl_point == 0 && rl_end == 0) + _rl_erase_entire_line (); +} + +STATIC_CALLBACK int +#if defined (READLINE_CALLBACKS) +readline_internal_char () +#else +readline_internal_charloop () +#endif +{ + static int lastc, eof_found; + int c, code, lk; + + lastc = -1; + eof_found = 0; + +#if !defined (READLINE_CALLBACKS) + while (rl_done == 0) + { +#endif + lk = _rl_last_command_was_kill; + +#if defined (HAVE_POSIX_SIGSETJMP) + code = sigsetjmp (_rl_top_level, 0); +#else + code = setjmp (_rl_top_level); +#endif + + if (code) + { + (*rl_redisplay_function) (); + _rl_want_redisplay = 0; + /* If we get here, we're not being called from something dispatched + from _rl_callback_read_char(), which sets up its own value of + _rl_top_level (saving and restoring the old, of course), so + we can just return here. */ + if (RL_ISSTATE (RL_STATE_CALLBACK)) + return (0); + } + + if (rl_pending_input == 0) + { + /* Then initialize the argument and number of keys read. */ + _rl_reset_argument (); + rl_key_sequence_length = 0; + rl_executing_keyseq[0] = 0; + } + + RL_SETSTATE(RL_STATE_READCMD); + c = rl_read_key (); + RL_UNSETSTATE(RL_STATE_READCMD); + + /* look at input.c:rl_getc() for the circumstances under which this will + be returned; punt immediately on read error without converting it to + a newline; assume that rl_read_key has already called the signal + handler. */ + if (c == READERR) + { +#if defined (READLINE_CALLBACKS) + RL_SETSTATE(RL_STATE_DONE); + return (rl_done = 1); +#else + eof_found = 1; + break; +#endif + } + + /* EOF typed to a non-blank line is a . If we want to change this, + to force any existing line to be ignored when read(2) reads EOF, + for example, this is the place to change. */ + if (c == EOF && rl_end) + c = NEWLINE; + + /* The character _rl_eof_char typed to blank line, and not as the + previous character is interpreted as EOF. */ + if (((c == _rl_eof_char && lastc != c) || c == EOF) && !rl_end) + { +#if defined (READLINE_CALLBACKS) + RL_SETSTATE(RL_STATE_DONE); + return (rl_done = 1); +#else + eof_found = 1; + break; +#endif + } + + lastc = c; + _rl_dispatch ((unsigned char)c, _rl_keymap); + RL_CHECK_SIGNALS (); + + /* If there was no change in _rl_last_command_was_kill, then no kill + has taken place. Note that if input is pending we are reading + a prefix command, so nothing has changed yet. */ + if (rl_pending_input == 0 && lk == _rl_last_command_was_kill) + _rl_last_command_was_kill = 0; + + _rl_internal_char_cleanup (); + +#if defined (READLINE_CALLBACKS) + return 0; +#else + } + + return (eof_found); +#endif +} + +#if defined (READLINE_CALLBACKS) +static int +readline_internal_charloop () +{ + int eof = 1; + + while (rl_done == 0) + eof = readline_internal_char (); + return (eof); +} +#endif /* READLINE_CALLBACKS */ + +/* Read a line of input from the global rl_instream, doing output on + the global rl_outstream. + If rl_prompt is non-null, then that is our prompt. */ +static char * +readline_internal () +{ + int eof; + + readline_internal_setup (); + eof = readline_internal_charloop (); + return (readline_internal_teardown (eof)); +} + +void +_rl_init_line_state () +{ + rl_point = rl_end = rl_mark = 0; + the_line = rl_line_buffer; + the_line[0] = 0; +} + +void +_rl_set_the_line () +{ + the_line = rl_line_buffer; +} + +#if defined (READLINE_CALLBACKS) +_rl_keyseq_cxt * +_rl_keyseq_cxt_alloc () +{ + _rl_keyseq_cxt *cxt; + + cxt = (_rl_keyseq_cxt *)xmalloc (sizeof (_rl_keyseq_cxt)); + + cxt->flags = cxt->subseq_arg = cxt->subseq_retval = 0; + + cxt->okey = 0; + cxt->ocxt = _rl_kscxt; + cxt->childval = 42; /* sentinel value */ + + return cxt; +} + +void +_rl_keyseq_cxt_dispose (cxt) + _rl_keyseq_cxt *cxt; +{ + xfree (cxt); +} + +void +_rl_keyseq_chain_dispose () +{ + _rl_keyseq_cxt *cxt; + + while (_rl_kscxt) + { + cxt = _rl_kscxt; + _rl_kscxt = _rl_kscxt->ocxt; + _rl_keyseq_cxt_dispose (cxt); + } +} +#endif + +static int +_rl_subseq_getchar (key) + int key; +{ + int k; + + if (key == ESC) + RL_SETSTATE(RL_STATE_METANEXT); + RL_SETSTATE(RL_STATE_MOREINPUT); + k = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + if (key == ESC) + RL_UNSETSTATE(RL_STATE_METANEXT); + + return k; +} + +#if defined (READLINE_CALLBACKS) +int +_rl_dispatch_callback (cxt) + _rl_keyseq_cxt *cxt; +{ + int nkey, r; + + /* For now */ + /* The first time this context is used, we want to read input and dispatch + on it. When traversing the chain of contexts back `up', we want to use + the value from the next context down. We're simulating recursion using + a chain of contexts. */ + if ((cxt->flags & KSEQ_DISPATCHED) == 0) + { + nkey = _rl_subseq_getchar (cxt->okey); + if (nkey < 0) + { + _rl_abort_internal (); + return -1; + } + r = _rl_dispatch_subseq (nkey, cxt->dmap, cxt->subseq_arg); + cxt->flags |= KSEQ_DISPATCHED; + } + else + r = cxt->childval; + + /* For now */ + if (r != -3) /* don't do this if we indicate there will be other matches */ + r = _rl_subseq_result (r, cxt->oldmap, cxt->okey, (cxt->flags & KSEQ_SUBSEQ)); + + RL_CHECK_SIGNALS (); + /* We only treat values < 0 specially to simulate recursion. */ + if (r >= 0 || (r == -1 && (cxt->flags & KSEQ_SUBSEQ) == 0)) /* success! or failure! */ + { + _rl_keyseq_chain_dispose (); + RL_UNSETSTATE (RL_STATE_MULTIKEY); + return r; + } + + if (r != -3) /* magic value that says we added to the chain */ + _rl_kscxt = cxt->ocxt; + if (_rl_kscxt) + _rl_kscxt->childval = r; + if (r != -3) + _rl_keyseq_cxt_dispose (cxt); + + return r; +} +#endif /* READLINE_CALLBACKS */ + +/* Do the command associated with KEY in MAP. + If the associated command is really a keymap, then read + another key, and dispatch into that map. */ +int +_rl_dispatch (key, map) + register int key; + Keymap map; +{ + _rl_dispatching_keymap = map; + return _rl_dispatch_subseq (key, map, 0); +} + +int +_rl_dispatch_subseq (key, map, got_subseq) + register int key; + Keymap map; + int got_subseq; +{ + int r, newkey; + char *macro; + rl_command_func_t *func; +#if defined (READLINE_CALLBACKS) + _rl_keyseq_cxt *cxt; +#endif + + if (META_CHAR (key) && _rl_convert_meta_chars_to_ascii) + { + if (map[ESC].type == ISKMAP) + { + if (RL_ISSTATE (RL_STATE_MACRODEF)) + _rl_add_macro_char (ESC); + RESIZE_KEYSEQ_BUFFER (); + rl_executing_keyseq[rl_key_sequence_length++] = ESC; + map = FUNCTION_TO_KEYMAP (map, ESC); + key = UNMETA (key); + return (_rl_dispatch (key, map)); + } + else + rl_ding (); + return 0; + } + + if (RL_ISSTATE (RL_STATE_MACRODEF)) + _rl_add_macro_char (key); + + r = 0; + switch (map[key].type) + { + case ISFUNC: + func = map[key].function; + if (func) + { + /* Special case rl_do_lowercase_version (). */ + if (func == rl_do_lowercase_version) + /* Should we do anything special if key == ANYOTHERKEY? */ + return (_rl_dispatch (_rl_to_lower (key), map)); + + rl_executing_keymap = map; + rl_executing_key = key; + + RESIZE_KEYSEQ_BUFFER(); + rl_executing_keyseq[rl_key_sequence_length++] = key; + rl_executing_keyseq[rl_key_sequence_length] = '\0'; + + rl_dispatching = 1; + RL_SETSTATE(RL_STATE_DISPATCHING); + r = (*func) (rl_numeric_arg * rl_arg_sign, key); + RL_UNSETSTATE(RL_STATE_DISPATCHING); + rl_dispatching = 0; + + /* If we have input pending, then the last command was a prefix + command. Don't change the state of rl_last_func. Otherwise, + remember the last command executed in this variable. */ + if (rl_pending_input == 0 && map[key].function != rl_digit_argument) + rl_last_func = map[key].function; + + RL_CHECK_SIGNALS (); + } + else if (map[ANYOTHERKEY].function) + { + /* OK, there's no function bound in this map, but there is a + shadow function that was overridden when the current keymap + was created. Return -2 to note that. */ + if (RL_ISSTATE (RL_STATE_MACROINPUT)) + _rl_prev_macro_key (); + else + _rl_unget_char (key); + return -2; + } + else if (got_subseq) + { + /* Return -1 to note that we're in a subsequence, but we don't + have a matching key, nor was one overridden. This means + we need to back up the recursion chain and find the last + subsequence that is bound to a function. */ + if (RL_ISSTATE (RL_STATE_MACROINPUT)) + _rl_prev_macro_key (); + else + _rl_unget_char (key); + return -1; + } + else + { +#if defined (READLINE_CALLBACKS) + RL_UNSETSTATE (RL_STATE_MULTIKEY); + _rl_keyseq_chain_dispose (); +#endif + _rl_abort_internal (); + return -1; + } + break; + + case ISKMAP: + if (map[key].function != 0) + { +#if defined (VI_MODE) + /* The only way this test will be true is if a subsequence has been + bound starting with ESC, generally the arrow keys. What we do is + check whether there's input in the queue, which there generally + will be if an arrow key has been pressed, and, if there's not, + just dispatch to (what we assume is) rl_vi_movement_mode right + away. This is essentially an input test with a zero timeout (by + default) or a timeout determined by the value of `keyseq-timeout' */ + /* _rl_keyseq_timeout specified in milliseconds; _rl_input_queued + takes microseconds, so multiply by 1000 */ + if (rl_editing_mode == vi_mode && key == ESC && map == vi_insertion_keymap + && _rl_input_queued ((_rl_keyseq_timeout > 0) ? _rl_keyseq_timeout*1000 : 0) == 0) + return (_rl_dispatch (ANYOTHERKEY, FUNCTION_TO_KEYMAP (map, key))); +#endif + + RESIZE_KEYSEQ_BUFFER (); + rl_executing_keyseq[rl_key_sequence_length++] = key; + _rl_dispatching_keymap = FUNCTION_TO_KEYMAP (map, key); + + /* Allocate new context here. Use linked contexts (linked through + cxt->ocxt) to simulate recursion */ +#if defined (READLINE_CALLBACKS) + if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + /* Return 0 only the first time, to indicate success to + _rl_callback_read_char. The rest of the time, we're called + from _rl_dispatch_callback, so we return -3 to indicate + special handling is necessary. */ + r = RL_ISSTATE (RL_STATE_MULTIKEY) ? -3 : 0; + cxt = _rl_keyseq_cxt_alloc (); + + if (got_subseq) + cxt->flags |= KSEQ_SUBSEQ; + cxt->okey = key; + cxt->oldmap = map; + cxt->dmap = _rl_dispatching_keymap; + cxt->subseq_arg = got_subseq || cxt->dmap[ANYOTHERKEY].function; + + RL_SETSTATE (RL_STATE_MULTIKEY); + _rl_kscxt = cxt; + + return r; /* don't indicate immediate success */ + } +#endif + + /* Tentative inter-character timeout for potential multi-key + sequences? If no input within timeout, abort sequence and + act as if we got non-matching input. */ + /* _rl_keyseq_timeout specified in milliseconds; _rl_input_queued + takes microseconds, so multiply by 1000 */ + if (_rl_keyseq_timeout > 0 && + (RL_ISSTATE (RL_STATE_INPUTPENDING|RL_STATE_MACROINPUT) == 0) && + _rl_pushed_input_available () == 0 && + _rl_dispatching_keymap[ANYOTHERKEY].function && + _rl_input_queued (_rl_keyseq_timeout*1000) == 0) + return (_rl_subseq_result (-2, map, key, got_subseq)); + + newkey = _rl_subseq_getchar (key); + if (newkey < 0) + { + _rl_abort_internal (); + return -1; + } + + r = _rl_dispatch_subseq (newkey, _rl_dispatching_keymap, got_subseq || map[ANYOTHERKEY].function); + return _rl_subseq_result (r, map, key, got_subseq); + } + else + { + _rl_abort_internal (); + return -1; + } + break; + + case ISMACR: + if (map[key].function != 0) + { + rl_executing_keyseq[rl_key_sequence_length] = '\0'; + macro = savestring ((char *)map[key].function); + _rl_with_macro_input (macro); + return 0; + } + break; + } +#if defined (VI_MODE) + if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap && + key != ANYOTHERKEY && + _rl_dispatching_keymap == vi_movement_keymap && + _rl_vi_textmod_command (key)) + _rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign); +#endif + + return (r); +} + +static int +_rl_subseq_result (r, map, key, got_subseq) + int r; + Keymap map; + int key, got_subseq; +{ + Keymap m; + int type, nt; + rl_command_func_t *func, *nf; + + if (r == -2) + /* We didn't match anything, and the keymap we're indexed into + shadowed a function previously bound to that prefix. Call + the function. The recursive call to _rl_dispatch_subseq has + already taken care of pushing any necessary input back onto + the input queue with _rl_unget_char. */ + { + m = _rl_dispatching_keymap; + type = m[ANYOTHERKEY].type; + func = m[ANYOTHERKEY].function; + if (type == ISFUNC && func == rl_do_lowercase_version) + r = _rl_dispatch (_rl_to_lower (key), map); + else if (type == ISFUNC && func == rl_insert) + { + /* If the function that was shadowed was self-insert, we + somehow need a keymap with map[key].func == self-insert. + Let's use this one. */ + nt = m[key].type; + nf = m[key].function; + + m[key].type = type; + m[key].function = func; + r = _rl_dispatch (key, m); + m[key].type = nt; + m[key].function = nf; + } + else + r = _rl_dispatch (ANYOTHERKEY, m); + } + else if (r && map[ANYOTHERKEY].function) + { + /* We didn't match (r is probably -1), so return something to + tell the caller that it should try ANYOTHERKEY for an + overridden function. */ + if (RL_ISSTATE (RL_STATE_MACROINPUT)) + _rl_prev_macro_key (); + else + _rl_unget_char (key); + _rl_dispatching_keymap = map; + return -2; + } + else if (r && got_subseq) + { + /* OK, back up the chain. */ + if (RL_ISSTATE (RL_STATE_MACROINPUT)) + _rl_prev_macro_key (); + else + _rl_unget_char (key); + _rl_dispatching_keymap = map; + return -1; + } + + return r; +} + +/* **************************************************************** */ +/* */ +/* Initializations */ +/* */ +/* **************************************************************** */ + +/* Initialize readline (and terminal if not already). */ +int +rl_initialize () +{ + /* If we have never been called before, initialize the + terminal and data structures. */ + if (!rl_initialized) + { + RL_SETSTATE(RL_STATE_INITIALIZING); + readline_initialize_everything (); + RL_UNSETSTATE(RL_STATE_INITIALIZING); + rl_initialized++; + RL_SETSTATE(RL_STATE_INITIALIZED); + } + + /* Initialize the current line information. */ + _rl_init_line_state (); + + /* We aren't done yet. We haven't even gotten started yet! */ + rl_done = 0; + RL_UNSETSTATE(RL_STATE_DONE); + + /* Tell the history routines what is going on. */ + _rl_start_using_history (); + + /* Make the display buffer match the state of the line. */ + rl_reset_line_state (); + + /* No such function typed yet. */ + rl_last_func = (rl_command_func_t *)NULL; + + /* Parsing of key-bindings begins in an enabled state. */ + _rl_parsing_conditionalized_out = 0; + +#if defined (VI_MODE) + if (rl_editing_mode == vi_mode) + _rl_vi_initialize_line (); +#endif + + /* Each line starts in insert mode (the default). */ + _rl_set_insert_mode (RL_IM_DEFAULT, 1); + + return 0; +} + +#if 0 +#if defined (__EMX__) +static void +_emx_build_environ () +{ + TIB *tibp; + PIB *pibp; + char *t, **tp; + int c; + + DosGetInfoBlocks (&tibp, &pibp); + t = pibp->pib_pchenv; + for (c = 1; *t; c++) + t += strlen (t) + 1; + tp = environ = (char **)xmalloc ((c + 1) * sizeof (char *)); + t = pibp->pib_pchenv; + while (*t) + { + *tp++ = t; + t += strlen (t) + 1; + } + *tp = 0; +} +#endif /* __EMX__ */ +#endif + +/* Initialize the entire state of the world. */ +static void +readline_initialize_everything () +{ +#if 0 +#if defined (__EMX__) + if (environ == 0) + _emx_build_environ (); +#endif +#endif + +#if 0 + /* Find out if we are running in Emacs -- UNUSED. */ + running_in_emacs = sh_get_env_value ("EMACS") != (char *)0; +#endif + + /* Set up input and output if they are not already set up. */ + if (!rl_instream) + rl_instream = stdin; + + if (!rl_outstream) + rl_outstream = stdout; + + /* Bind _rl_in_stream and _rl_out_stream immediately. These values + may change, but they may also be used before readline_internal () + is called. */ + _rl_in_stream = rl_instream; + _rl_out_stream = rl_outstream; + + /* Allocate data structures. */ + if (rl_line_buffer == 0) + rl_line_buffer = (char *)xmalloc (rl_line_buffer_len = DEFAULT_BUFFER_SIZE); + + /* Initialize the terminal interface. */ + if (rl_terminal_name == 0) + rl_terminal_name = sh_get_env_value ("TERM"); + _rl_init_terminal_io (rl_terminal_name); + + /* Bind tty characters to readline functions. */ + readline_default_bindings (); + + /* Initialize the function names. */ + rl_initialize_funmap (); + + /* Decide whether we should automatically go into eight-bit mode. */ + _rl_init_eightbit (); + + /* Read in the init file. */ + rl_read_init_file ((char *)NULL); + + /* XXX */ + if (_rl_horizontal_scroll_mode && _rl_term_autowrap) + { + _rl_screenwidth--; + _rl_screenchars -= _rl_screenheight; + } + + /* Override the effect of any `set keymap' assignments in the + inputrc file. */ + rl_set_keymap_from_edit_mode (); + + /* Try to bind a common arrow key prefix, if not already bound. */ + bind_arrow_keys (); + + /* If the completion parser's default word break characters haven't + been set yet, then do so now. */ + if (rl_completer_word_break_characters == (char *)NULL) + rl_completer_word_break_characters = (char *)rl_basic_word_break_characters; + +#if defined (COLOR_SUPPORT) + if (_rl_colored_stats) + _rl_parse_colors (); +#endif + + rl_executing_keyseq = malloc (_rl_executing_keyseq_size = 16); + if (rl_executing_keyseq) + rl_executing_keyseq[0] = '\0'; +} + +/* If this system allows us to look at the values of the regular + input editing characters, then bind them to their readline + equivalents, iff the characters are not bound to keymaps. */ +static void +readline_default_bindings () +{ + if (_rl_bind_stty_chars) + rl_tty_set_default_bindings (_rl_keymap); +} + +/* Reset the default bindings for the terminal special characters we're + interested in back to rl_insert and read the new ones. */ +static void +reset_default_bindings () +{ + if (_rl_bind_stty_chars) + { + rl_tty_unset_default_bindings (_rl_keymap); + rl_tty_set_default_bindings (_rl_keymap); + } +} + +/* Bind some common arrow key sequences in MAP. */ +static void +bind_arrow_keys_internal (map) + Keymap map; +{ + Keymap xkeymap; + + xkeymap = _rl_keymap; + _rl_keymap = map; + +#if defined (__MSDOS__) + rl_bind_keyseq_if_unbound ("\033[0A", rl_get_previous_history); + rl_bind_keyseq_if_unbound ("\033[0B", rl_backward_char); + rl_bind_keyseq_if_unbound ("\033[0C", rl_forward_char); + rl_bind_keyseq_if_unbound ("\033[0D", rl_get_next_history); +#endif + + rl_bind_keyseq_if_unbound ("\033[A", rl_get_previous_history); + rl_bind_keyseq_if_unbound ("\033[B", rl_get_next_history); + rl_bind_keyseq_if_unbound ("\033[C", rl_forward_char); + rl_bind_keyseq_if_unbound ("\033[D", rl_backward_char); + rl_bind_keyseq_if_unbound ("\033[H", rl_beg_of_line); + rl_bind_keyseq_if_unbound ("\033[F", rl_end_of_line); + + rl_bind_keyseq_if_unbound ("\033OA", rl_get_previous_history); + rl_bind_keyseq_if_unbound ("\033OB", rl_get_next_history); + rl_bind_keyseq_if_unbound ("\033OC", rl_forward_char); + rl_bind_keyseq_if_unbound ("\033OD", rl_backward_char); + rl_bind_keyseq_if_unbound ("\033OH", rl_beg_of_line); + rl_bind_keyseq_if_unbound ("\033OF", rl_end_of_line); + +#if defined (__MINGW32__) + rl_bind_keyseq_if_unbound ("\340H", rl_get_previous_history); + rl_bind_keyseq_if_unbound ("\340P", rl_get_next_history); + rl_bind_keyseq_if_unbound ("\340M", rl_forward_char); + rl_bind_keyseq_if_unbound ("\340K", rl_backward_char); + rl_bind_keyseq_if_unbound ("\340G", rl_beg_of_line); + rl_bind_keyseq_if_unbound ("\340O", rl_end_of_line); + rl_bind_keyseq_if_unbound ("\340S", rl_delete); + rl_bind_keyseq_if_unbound ("\340R", rl_overwrite_mode); + + /* These may or may not work because of the embedded NUL. */ + rl_bind_keyseq_if_unbound ("\\000H", rl_get_previous_history); + rl_bind_keyseq_if_unbound ("\\000P", rl_get_next_history); + rl_bind_keyseq_if_unbound ("\\000M", rl_forward_char); + rl_bind_keyseq_if_unbound ("\\000K", rl_backward_char); + rl_bind_keyseq_if_unbound ("\\000G", rl_beg_of_line); + rl_bind_keyseq_if_unbound ("\\000O", rl_end_of_line); + rl_bind_keyseq_if_unbound ("\\000S", rl_delete); + rl_bind_keyseq_if_unbound ("\\000R", rl_overwrite_mode); +#endif + + _rl_keymap = xkeymap; +} + +/* Try and bind the common arrow key prefixes after giving termcap and + the inputrc file a chance to bind them and create `real' keymaps + for the arrow key prefix. */ +static void +bind_arrow_keys () +{ + bind_arrow_keys_internal (emacs_standard_keymap); + +#if defined (VI_MODE) + bind_arrow_keys_internal (vi_movement_keymap); + /* Unbind vi_movement_keymap[ESC] to allow users to repeatedly hit ESC + in vi command mode while still allowing the arrow keys to work. */ + if (vi_movement_keymap[ESC].type == ISKMAP) + rl_bind_keyseq_in_map ("\033", (rl_command_func_t *)NULL, vi_movement_keymap); + bind_arrow_keys_internal (vi_insertion_keymap); +#endif +} + +/* **************************************************************** */ +/* */ +/* Saving and Restoring Readline's state */ +/* */ +/* **************************************************************** */ + +int +rl_save_state (sp) + struct readline_state *sp; +{ + if (sp == 0) + return -1; + + sp->point = rl_point; + sp->end = rl_end; + sp->mark = rl_mark; + sp->buffer = rl_line_buffer; + sp->buflen = rl_line_buffer_len; + sp->ul = rl_undo_list; + sp->prompt = rl_prompt; + + sp->rlstate = rl_readline_state; + sp->done = rl_done; + sp->kmap = _rl_keymap; + + sp->lastfunc = rl_last_func; + sp->insmode = rl_insert_mode; + sp->edmode = rl_editing_mode; + sp->kseqlen = rl_key_sequence_length; + sp->inf = rl_instream; + sp->outf = rl_outstream; + sp->pendingin = rl_pending_input; + sp->macro = rl_executing_macro; + + sp->catchsigs = rl_catch_signals; + sp->catchsigwinch = rl_catch_sigwinch; + + return (0); +} + +int +rl_restore_state (sp) + struct readline_state *sp; +{ + if (sp == 0) + return -1; + + rl_point = sp->point; + rl_end = sp->end; + rl_mark = sp->mark; + the_line = rl_line_buffer = sp->buffer; + rl_line_buffer_len = sp->buflen; + rl_undo_list = sp->ul; + rl_prompt = sp->prompt; + + rl_readline_state = sp->rlstate; + rl_done = sp->done; + _rl_keymap = sp->kmap; + + rl_last_func = sp->lastfunc; + rl_insert_mode = sp->insmode; + rl_editing_mode = sp->edmode; + rl_key_sequence_length = sp->kseqlen; + rl_instream = sp->inf; + rl_outstream = sp->outf; + rl_pending_input = sp->pendingin; + rl_executing_macro = sp->macro; + + rl_catch_signals = sp->catchsigs; + rl_catch_sigwinch = sp->catchsigwinch; + + return (0); +} diff --git a/lib/readline/readline.h b/lib/readline/readline.h new file mode 100644 index 0000000..08dcd2b --- /dev/null +++ b/lib/readline/readline.h @@ -0,0 +1,923 @@ +/* Readline.h -- the names of functions callable from within readline. */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if !defined (_READLINE_H_) +#define _READLINE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined (READLINE_LIBRARY) +# include "rlstdc.h" +# include "rltypedefs.h" +# include "keymaps.h" +# include "tilde.h" +#else +# include +# include +# include +# include +#endif + +/* Hex-encoded Readline version number. */ +#define RL_READLINE_VERSION 0x0603 /* Readline 6.3 */ +#define RL_VERSION_MAJOR 6 +#define RL_VERSION_MINOR 3 + +/* Readline data structures. */ + +/* Maintaining the state of undo. We remember individual deletes and inserts + on a chain of things to do. */ + +/* The actions that undo knows how to undo. Notice that UNDO_DELETE means + to insert some text, and UNDO_INSERT means to delete some text. I.e., + the code tells undo what to undo, not how to undo it. */ +enum undo_code { UNDO_DELETE, UNDO_INSERT, UNDO_BEGIN, UNDO_END }; + +/* What an element of THE_UNDO_LIST looks like. */ +typedef struct undo_list { + struct undo_list *next; + int start, end; /* Where the change took place. */ + char *text; /* The text to insert, if undoing a delete. */ + enum undo_code what; /* Delete, Insert, Begin, End. */ +} UNDO_LIST; + +/* The current undo list for RL_LINE_BUFFER. */ +extern UNDO_LIST *rl_undo_list; + +/* The data structure for mapping textual names to code addresses. */ +typedef struct _funmap { + const char *name; + rl_command_func_t *function; +} FUNMAP; + +extern FUNMAP **funmap; + +/* **************************************************************** */ +/* */ +/* Functions available to bind to key sequences */ +/* */ +/* **************************************************************** */ + +/* Bindable commands for numeric arguments. */ +extern int rl_digit_argument PARAMS((int, int)); +extern int rl_universal_argument PARAMS((int, int)); + +/* Bindable commands for moving the cursor. */ +extern int rl_forward_byte PARAMS((int, int)); +extern int rl_forward_char PARAMS((int, int)); +extern int rl_forward PARAMS((int, int)); +extern int rl_backward_byte PARAMS((int, int)); +extern int rl_backward_char PARAMS((int, int)); +extern int rl_backward PARAMS((int, int)); +extern int rl_beg_of_line PARAMS((int, int)); +extern int rl_end_of_line PARAMS((int, int)); +extern int rl_forward_word PARAMS((int, int)); +extern int rl_backward_word PARAMS((int, int)); +extern int rl_refresh_line PARAMS((int, int)); +extern int rl_clear_screen PARAMS((int, int)); +extern int rl_skip_csi_sequence PARAMS((int, int)); +extern int rl_arrow_keys PARAMS((int, int)); + +/* Bindable commands for inserting and deleting text. */ +extern int rl_insert PARAMS((int, int)); +extern int rl_quoted_insert PARAMS((int, int)); +extern int rl_tab_insert PARAMS((int, int)); +extern int rl_newline PARAMS((int, int)); +extern int rl_do_lowercase_version PARAMS((int, int)); +extern int rl_rubout PARAMS((int, int)); +extern int rl_delete PARAMS((int, int)); +extern int rl_rubout_or_delete PARAMS((int, int)); +extern int rl_delete_horizontal_space PARAMS((int, int)); +extern int rl_delete_or_show_completions PARAMS((int, int)); +extern int rl_insert_comment PARAMS((int, int)); + +/* Bindable commands for changing case. */ +extern int rl_upcase_word PARAMS((int, int)); +extern int rl_downcase_word PARAMS((int, int)); +extern int rl_capitalize_word PARAMS((int, int)); + +/* Bindable commands for transposing characters and words. */ +extern int rl_transpose_words PARAMS((int, int)); +extern int rl_transpose_chars PARAMS((int, int)); + +/* Bindable commands for searching within a line. */ +extern int rl_char_search PARAMS((int, int)); +extern int rl_backward_char_search PARAMS((int, int)); + +/* Bindable commands for readline's interface to the command history. */ +extern int rl_beginning_of_history PARAMS((int, int)); +extern int rl_end_of_history PARAMS((int, int)); +extern int rl_get_next_history PARAMS((int, int)); +extern int rl_get_previous_history PARAMS((int, int)); + +/* Bindable commands for managing the mark and region. */ +extern int rl_set_mark PARAMS((int, int)); +extern int rl_exchange_point_and_mark PARAMS((int, int)); + +/* Bindable commands to set the editing mode (emacs or vi). */ +extern int rl_vi_editing_mode PARAMS((int, int)); +extern int rl_emacs_editing_mode PARAMS((int, int)); + +/* Bindable commands to change the insert mode (insert or overwrite) */ +extern int rl_overwrite_mode PARAMS((int, int)); + +/* Bindable commands for managing key bindings. */ +extern int rl_re_read_init_file PARAMS((int, int)); +extern int rl_dump_functions PARAMS((int, int)); +extern int rl_dump_macros PARAMS((int, int)); +extern int rl_dump_variables PARAMS((int, int)); + +/* Bindable commands for word completion. */ +extern int rl_complete PARAMS((int, int)); +extern int rl_possible_completions PARAMS((int, int)); +extern int rl_insert_completions PARAMS((int, int)); +extern int rl_old_menu_complete PARAMS((int, int)); +extern int rl_menu_complete PARAMS((int, int)); +extern int rl_backward_menu_complete PARAMS((int, int)); + +/* Bindable commands for killing and yanking text, and managing the kill ring. */ +extern int rl_kill_word PARAMS((int, int)); +extern int rl_backward_kill_word PARAMS((int, int)); +extern int rl_kill_line PARAMS((int, int)); +extern int rl_backward_kill_line PARAMS((int, int)); +extern int rl_kill_full_line PARAMS((int, int)); +extern int rl_unix_word_rubout PARAMS((int, int)); +extern int rl_unix_filename_rubout PARAMS((int, int)); +extern int rl_unix_line_discard PARAMS((int, int)); +extern int rl_copy_region_to_kill PARAMS((int, int)); +extern int rl_kill_region PARAMS((int, int)); +extern int rl_copy_forward_word PARAMS((int, int)); +extern int rl_copy_backward_word PARAMS((int, int)); +extern int rl_yank PARAMS((int, int)); +extern int rl_yank_pop PARAMS((int, int)); +extern int rl_yank_nth_arg PARAMS((int, int)); +extern int rl_yank_last_arg PARAMS((int, int)); +/* Not available unless __CYGWIN__ is defined. */ +#ifdef __CYGWIN__ +extern int rl_paste_from_clipboard PARAMS((int, int)); +#endif + +/* Bindable commands for incremental searching. */ +extern int rl_reverse_search_history PARAMS((int, int)); +extern int rl_forward_search_history PARAMS((int, int)); + +/* Bindable keyboard macro commands. */ +extern int rl_start_kbd_macro PARAMS((int, int)); +extern int rl_end_kbd_macro PARAMS((int, int)); +extern int rl_call_last_kbd_macro PARAMS((int, int)); +extern int rl_print_last_kbd_macro PARAMS((int, int)); + +/* Bindable undo commands. */ +extern int rl_revert_line PARAMS((int, int)); +extern int rl_undo_command PARAMS((int, int)); + +/* Bindable tilde expansion commands. */ +extern int rl_tilde_expand PARAMS((int, int)); + +/* Bindable terminal control commands. */ +extern int rl_restart_output PARAMS((int, int)); +extern int rl_stop_output PARAMS((int, int)); + +/* Miscellaneous bindable commands. */ +extern int rl_abort PARAMS((int, int)); +extern int rl_tty_status PARAMS((int, int)); + +/* Bindable commands for incremental and non-incremental history searching. */ +extern int rl_history_search_forward PARAMS((int, int)); +extern int rl_history_search_backward PARAMS((int, int)); +extern int rl_history_substr_search_forward PARAMS((int, int)); +extern int rl_history_substr_search_backward PARAMS((int, int)); +extern int rl_noninc_forward_search PARAMS((int, int)); +extern int rl_noninc_reverse_search PARAMS((int, int)); +extern int rl_noninc_forward_search_again PARAMS((int, int)); +extern int rl_noninc_reverse_search_again PARAMS((int, int)); + +/* Bindable command used when inserting a matching close character. */ +extern int rl_insert_close PARAMS((int, int)); + +/* Not available unless READLINE_CALLBACKS is defined. */ +extern void rl_callback_handler_install PARAMS((const char *, rl_vcpfunc_t *)); +extern void rl_callback_read_char PARAMS((void)); +extern void rl_callback_handler_remove PARAMS((void)); + +/* Things for vi mode. Not available unless readline is compiled -DVI_MODE. */ +/* VI-mode bindable commands. */ +extern int rl_vi_redo PARAMS((int, int)); +extern int rl_vi_undo PARAMS((int, int)); +extern int rl_vi_yank_arg PARAMS((int, int)); +extern int rl_vi_fetch_history PARAMS((int, int)); +extern int rl_vi_search_again PARAMS((int, int)); +extern int rl_vi_search PARAMS((int, int)); +extern int rl_vi_complete PARAMS((int, int)); +extern int rl_vi_tilde_expand PARAMS((int, int)); +extern int rl_vi_prev_word PARAMS((int, int)); +extern int rl_vi_next_word PARAMS((int, int)); +extern int rl_vi_end_word PARAMS((int, int)); +extern int rl_vi_insert_beg PARAMS((int, int)); +extern int rl_vi_append_mode PARAMS((int, int)); +extern int rl_vi_append_eol PARAMS((int, int)); +extern int rl_vi_eof_maybe PARAMS((int, int)); +extern int rl_vi_insertion_mode PARAMS((int, int)); +extern int rl_vi_insert_mode PARAMS((int, int)); +extern int rl_vi_movement_mode PARAMS((int, int)); +extern int rl_vi_arg_digit PARAMS((int, int)); +extern int rl_vi_change_case PARAMS((int, int)); +extern int rl_vi_put PARAMS((int, int)); +extern int rl_vi_column PARAMS((int, int)); +extern int rl_vi_delete_to PARAMS((int, int)); +extern int rl_vi_change_to PARAMS((int, int)); +extern int rl_vi_yank_to PARAMS((int, int)); +extern int rl_vi_rubout PARAMS((int, int)); +extern int rl_vi_delete PARAMS((int, int)); +extern int rl_vi_back_to_indent PARAMS((int, int)); +extern int rl_vi_first_print PARAMS((int, int)); +extern int rl_vi_char_search PARAMS((int, int)); +extern int rl_vi_match PARAMS((int, int)); +extern int rl_vi_change_char PARAMS((int, int)); +extern int rl_vi_subst PARAMS((int, int)); +extern int rl_vi_overstrike PARAMS((int, int)); +extern int rl_vi_overstrike_delete PARAMS((int, int)); +extern int rl_vi_replace PARAMS((int, int)); +extern int rl_vi_set_mark PARAMS((int, int)); +extern int rl_vi_goto_mark PARAMS((int, int)); + +/* VI-mode utility functions. */ +extern int rl_vi_check PARAMS((void)); +extern int rl_vi_domove PARAMS((int, int *)); +extern int rl_vi_bracktype PARAMS((int)); + +extern void rl_vi_start_inserting PARAMS((int, int, int)); + +/* VI-mode pseudo-bindable commands, used as utility functions. */ +extern int rl_vi_fWord PARAMS((int, int)); +extern int rl_vi_bWord PARAMS((int, int)); +extern int rl_vi_eWord PARAMS((int, int)); +extern int rl_vi_fword PARAMS((int, int)); +extern int rl_vi_bword PARAMS((int, int)); +extern int rl_vi_eword PARAMS((int, int)); + +/* **************************************************************** */ +/* */ +/* Well Published Functions */ +/* */ +/* **************************************************************** */ + +/* Readline functions. */ +/* Read a line of input. Prompt with PROMPT. A NULL PROMPT means none. */ +extern char *readline PARAMS((const char *)); + +extern int rl_set_prompt PARAMS((const char *)); +extern int rl_expand_prompt PARAMS((char *)); + +extern int rl_initialize PARAMS((void)); + +/* Undocumented; unused by readline */ +extern int rl_discard_argument PARAMS((void)); + +/* Utility functions to bind keys to readline commands. */ +extern int rl_add_defun PARAMS((const char *, rl_command_func_t *, int)); +extern int rl_bind_key PARAMS((int, rl_command_func_t *)); +extern int rl_bind_key_in_map PARAMS((int, rl_command_func_t *, Keymap)); +extern int rl_unbind_key PARAMS((int)); +extern int rl_unbind_key_in_map PARAMS((int, Keymap)); +extern int rl_bind_key_if_unbound PARAMS((int, rl_command_func_t *)); +extern int rl_bind_key_if_unbound_in_map PARAMS((int, rl_command_func_t *, Keymap)); +extern int rl_unbind_function_in_map PARAMS((rl_command_func_t *, Keymap)); +extern int rl_unbind_command_in_map PARAMS((const char *, Keymap)); +extern int rl_bind_keyseq PARAMS((const char *, rl_command_func_t *)); +extern int rl_bind_keyseq_in_map PARAMS((const char *, rl_command_func_t *, Keymap)); +extern int rl_bind_keyseq_if_unbound PARAMS((const char *, rl_command_func_t *)); +extern int rl_bind_keyseq_if_unbound_in_map PARAMS((const char *, rl_command_func_t *, Keymap)); +extern int rl_generic_bind PARAMS((int, const char *, char *, Keymap)); + +extern char *rl_variable_value PARAMS((const char *)); +extern int rl_variable_bind PARAMS((const char *, const char *)); + +/* Backwards compatibility, use rl_bind_keyseq_in_map instead. */ +extern int rl_set_key PARAMS((const char *, rl_command_func_t *, Keymap)); + +/* Backwards compatibility, use rl_generic_bind instead. */ +extern int rl_macro_bind PARAMS((const char *, const char *, Keymap)); + +/* Undocumented in the texinfo manual; not really useful to programs. */ +extern int rl_translate_keyseq PARAMS((const char *, char *, int *)); +extern char *rl_untranslate_keyseq PARAMS((int)); + +extern rl_command_func_t *rl_named_function PARAMS((const char *)); +extern rl_command_func_t *rl_function_of_keyseq PARAMS((const char *, Keymap, int *)); + +extern void rl_list_funmap_names PARAMS((void)); +extern char **rl_invoking_keyseqs_in_map PARAMS((rl_command_func_t *, Keymap)); +extern char **rl_invoking_keyseqs PARAMS((rl_command_func_t *)); + +extern void rl_function_dumper PARAMS((int)); +extern void rl_macro_dumper PARAMS((int)); +extern void rl_variable_dumper PARAMS((int)); + +extern int rl_read_init_file PARAMS((const char *)); +extern int rl_parse_and_bind PARAMS((char *)); + +/* Functions for manipulating keymaps. */ +extern Keymap rl_make_bare_keymap PARAMS((void)); +extern Keymap rl_copy_keymap PARAMS((Keymap)); +extern Keymap rl_make_keymap PARAMS((void)); +extern void rl_discard_keymap PARAMS((Keymap)); +extern void rl_free_keymap PARAMS((Keymap)); + +extern Keymap rl_get_keymap_by_name PARAMS((const char *)); +extern char *rl_get_keymap_name PARAMS((Keymap)); +extern void rl_set_keymap PARAMS((Keymap)); +extern Keymap rl_get_keymap PARAMS((void)); +/* Undocumented; used internally only. */ +extern void rl_set_keymap_from_edit_mode PARAMS((void)); +extern char *rl_get_keymap_name_from_edit_mode PARAMS((void)); + +/* Functions for manipulating the funmap, which maps command names to functions. */ +extern int rl_add_funmap_entry PARAMS((const char *, rl_command_func_t *)); +extern const char **rl_funmap_names PARAMS((void)); +/* Undocumented, only used internally -- there is only one funmap, and this + function may be called only once. */ +extern void rl_initialize_funmap PARAMS((void)); + +/* Utility functions for managing keyboard macros. */ +extern void rl_push_macro_input PARAMS((char *)); + +/* Functions for undoing, from undo.c */ +extern void rl_add_undo PARAMS((enum undo_code, int, int, char *)); +extern void rl_free_undo_list PARAMS((void)); +extern int rl_do_undo PARAMS((void)); +extern int rl_begin_undo_group PARAMS((void)); +extern int rl_end_undo_group PARAMS((void)); +extern int rl_modifying PARAMS((int, int)); + +/* Functions for redisplay. */ +extern void rl_redisplay PARAMS((void)); +extern int rl_on_new_line PARAMS((void)); +extern int rl_on_new_line_with_prompt PARAMS((void)); +extern int rl_forced_update_display PARAMS((void)); +extern int rl_clear_message PARAMS((void)); +extern int rl_reset_line_state PARAMS((void)); +extern int rl_crlf PARAMS((void)); + +#if defined (USE_VARARGS) && defined (PREFER_STDARG) +extern int rl_message (const char *, ...) __attribute__((__format__ (printf, 1, 2))); +#else +extern int rl_message (); +#endif + +extern int rl_show_char PARAMS((int)); + +/* Undocumented in texinfo manual. */ +extern int rl_character_len PARAMS((int, int)); + +/* Save and restore internal prompt redisplay information. */ +extern void rl_save_prompt PARAMS((void)); +extern void rl_restore_prompt PARAMS((void)); + +/* Modifying text. */ +extern void rl_replace_line PARAMS((const char *, int)); +extern int rl_insert_text PARAMS((const char *)); +extern int rl_delete_text PARAMS((int, int)); +extern int rl_kill_text PARAMS((int, int)); +extern char *rl_copy_text PARAMS((int, int)); + +/* Terminal and tty mode management. */ +extern void rl_prep_terminal PARAMS((int)); +extern void rl_deprep_terminal PARAMS((void)); +extern void rl_tty_set_default_bindings PARAMS((Keymap)); +extern void rl_tty_unset_default_bindings PARAMS((Keymap)); + +extern int rl_reset_terminal PARAMS((const char *)); +extern void rl_resize_terminal PARAMS((void)); +extern void rl_set_screen_size PARAMS((int, int)); +extern void rl_get_screen_size PARAMS((int *, int *)); +extern void rl_reset_screen_size PARAMS((void)); + +extern char *rl_get_termcap PARAMS((const char *)); + +/* Functions for character input. */ +extern int rl_stuff_char PARAMS((int)); +extern int rl_execute_next PARAMS((int)); +extern int rl_clear_pending_input PARAMS((void)); +extern int rl_read_key PARAMS((void)); +extern int rl_getc PARAMS((FILE *)); +extern int rl_set_keyboard_input_timeout PARAMS((int)); + +/* `Public' utility functions . */ +extern void rl_extend_line_buffer PARAMS((int)); +extern int rl_ding PARAMS((void)); +extern int rl_alphabetic PARAMS((int)); +extern void rl_free PARAMS((void *)); + +/* Readline signal handling, from signals.c */ +extern int rl_set_signals PARAMS((void)); +extern int rl_clear_signals PARAMS((void)); +extern void rl_cleanup_after_signal PARAMS((void)); +extern void rl_reset_after_signal PARAMS((void)); +extern void rl_free_line_state PARAMS((void)); + +extern void rl_echo_signal_char PARAMS((int)); + +extern int rl_set_paren_blink_timeout PARAMS((int)); + +/* History management functions. */ + +extern void rl_clear_history PARAMS((void)); + +/* Undocumented. */ +extern int rl_maybe_save_line PARAMS((void)); +extern int rl_maybe_unsave_line PARAMS((void)); +extern int rl_maybe_replace_line PARAMS((void)); + +/* Completion functions. */ +extern int rl_complete_internal PARAMS((int)); +extern void rl_display_match_list PARAMS((char **, int, int)); + +extern char **rl_completion_matches PARAMS((const char *, rl_compentry_func_t *)); +extern char *rl_username_completion_function PARAMS((const char *, int)); +extern char *rl_filename_completion_function PARAMS((const char *, int)); + +extern int rl_completion_mode PARAMS((rl_command_func_t *)); + +#if 0 +/* Backwards compatibility (compat.c). These will go away sometime. */ +extern void free_undo_list PARAMS((void)); +extern int maybe_save_line PARAMS((void)); +extern int maybe_unsave_line PARAMS((void)); +extern int maybe_replace_line PARAMS((void)); + +extern int ding PARAMS((void)); +extern int alphabetic PARAMS((int)); +extern int crlf PARAMS((void)); + +extern char **completion_matches PARAMS((char *, rl_compentry_func_t *)); +extern char *username_completion_function PARAMS((const char *, int)); +extern char *filename_completion_function PARAMS((const char *, int)); +#endif + +/* **************************************************************** */ +/* */ +/* Well Published Variables */ +/* */ +/* **************************************************************** */ + +/* The version of this incarnation of the readline library. */ +extern const char *rl_library_version; /* e.g., "4.2" */ +extern int rl_readline_version; /* e.g., 0x0402 */ + +/* True if this is real GNU readline. */ +extern int rl_gnu_readline_p; + +/* Flags word encapsulating the current readline state. */ +extern int rl_readline_state; + +/* Says which editing mode readline is currently using. 1 means emacs mode; + 0 means vi mode. */ +extern int rl_editing_mode; + +/* Insert or overwrite mode for emacs mode. 1 means insert mode; 0 means + overwrite mode. Reset to insert mode on each input line. */ +extern int rl_insert_mode; + +/* The name of the calling program. You should initialize this to + whatever was in argv[0]. It is used when parsing conditionals. */ +extern const char *rl_readline_name; + +/* The prompt readline uses. This is set from the argument to + readline (), and should not be assigned to directly. */ +extern char *rl_prompt; + +/* The prompt string that is actually displayed by rl_redisplay. Public so + applications can more easily supply their own redisplay functions. */ +extern char *rl_display_prompt; + +/* The line buffer that is in use. */ +extern char *rl_line_buffer; + +/* The location of point, and end. */ +extern int rl_point; +extern int rl_end; + +/* The mark, or saved cursor position. */ +extern int rl_mark; + +/* Flag to indicate that readline has finished with the current input + line and should return it. */ +extern int rl_done; + +/* If set to a character value, that will be the next keystroke read. */ +extern int rl_pending_input; + +/* Non-zero if we called this function from _rl_dispatch(). It's present + so functions can find out whether they were called from a key binding + or directly from an application. */ +extern int rl_dispatching; + +/* Non-zero if the user typed a numeric argument before executing the + current function. */ +extern int rl_explicit_arg; + +/* The current value of the numeric argument specified by the user. */ +extern int rl_numeric_arg; + +/* The address of the last command function Readline executed. */ +extern rl_command_func_t *rl_last_func; + +/* The name of the terminal to use. */ +extern const char *rl_terminal_name; + +/* The input and output streams. */ +extern FILE *rl_instream; +extern FILE *rl_outstream; + +/* If non-zero, Readline gives values of LINES and COLUMNS from the environment + greater precedence than values fetched from the kernel when computing the + screen dimensions. */ +extern int rl_prefer_env_winsize; + +/* If non-zero, then this is the address of a function to call just + before readline_internal () prints the first prompt. */ +extern rl_hook_func_t *rl_startup_hook; + +/* If non-zero, this is the address of a function to call just before + readline_internal_setup () returns and readline_internal starts + reading input characters. */ +extern rl_hook_func_t *rl_pre_input_hook; + +/* The address of a function to call periodically while Readline is + awaiting character input, or NULL, for no event handling. */ +extern rl_hook_func_t *rl_event_hook; + +/* The address of a function to call if a read is interrupted by a signal. */ +extern rl_hook_func_t *rl_signal_event_hook; + +/* The address of a function to call if Readline needs to know whether or not + there is data available from the current input source. */ +extern rl_hook_func_t *rl_input_available_hook; + +/* The address of the function to call to fetch a character from the current + Readline input stream */ +extern rl_getc_func_t *rl_getc_function; + +extern rl_voidfunc_t *rl_redisplay_function; + +extern rl_vintfunc_t *rl_prep_term_function; +extern rl_voidfunc_t *rl_deprep_term_function; + +/* Dispatch variables. */ +extern Keymap rl_executing_keymap; +extern Keymap rl_binding_keymap; + +extern int rl_executing_key; +extern char *rl_executing_keyseq; +extern int rl_key_sequence_length; + +/* Display variables. */ +/* If non-zero, readline will erase the entire line, including any prompt, + if the only thing typed on an otherwise-blank line is something bound to + rl_newline. */ +extern int rl_erase_empty_line; + +/* If non-zero, the application has already printed the prompt (rl_prompt) + before calling readline, so readline should not output it the first time + redisplay is done. */ +extern int rl_already_prompted; + +/* A non-zero value means to read only this many characters rather than + up to a character bound to accept-line. */ +extern int rl_num_chars_to_read; + +/* The text of a currently-executing keyboard macro. */ +extern char *rl_executing_macro; + +/* Variables to control readline signal handling. */ +/* If non-zero, readline will install its own signal handlers for + SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP, SIGTTIN, and SIGTTOU. */ +extern int rl_catch_signals; + +/* If non-zero, readline will install a signal handler for SIGWINCH + that also attempts to call any calling application's SIGWINCH signal + handler. Note that the terminal is not cleaned up before the + application's signal handler is called; use rl_cleanup_after_signal() + to do that. */ +extern int rl_catch_sigwinch; + +/* If non-zero, the readline SIGWINCH handler will modify LINES and + COLUMNS in the environment. */ +extern int rl_change_environment; + +/* Completion variables. */ +/* Pointer to the generator function for completion_matches (). + NULL means to use rl_filename_completion_function (), the default + filename completer. */ +extern rl_compentry_func_t *rl_completion_entry_function; + +/* Optional generator for menu completion. Default is + rl_completion_entry_function (rl_filename_completion_function). */ + extern rl_compentry_func_t *rl_menu_completion_entry_function; + +/* If rl_ignore_some_completions_function is non-NULL it is the address + of a function to call after all of the possible matches have been + generated, but before the actual completion is done to the input line. + The function is called with one argument; a NULL terminated array + of (char *). If your function removes any of the elements, they + must be free()'ed. */ +extern rl_compignore_func_t *rl_ignore_some_completions_function; + +/* Pointer to alternative function to create matches. + Function is called with TEXT, START, and END. + START and END are indices in RL_LINE_BUFFER saying what the boundaries + of TEXT are. + If this function exists and returns NULL then call the value of + rl_completion_entry_function to try to match, otherwise use the + array of strings returned. */ +extern rl_completion_func_t *rl_attempted_completion_function; + +/* The basic list of characters that signal a break between words for the + completer routine. The initial contents of this variable is what + breaks words in the shell, i.e. "n\"\\'`@$>". */ +extern const char *rl_basic_word_break_characters; + +/* The list of characters that signal a break between words for + rl_complete_internal. The default list is the contents of + rl_basic_word_break_characters. */ +extern /*const*/ char *rl_completer_word_break_characters; + +/* Hook function to allow an application to set the completion word + break characters before readline breaks up the line. Allows + position-dependent word break characters. */ +extern rl_cpvfunc_t *rl_completion_word_break_hook; + +/* List of characters which can be used to quote a substring of the line. + Completion occurs on the entire substring, and within the substring + rl_completer_word_break_characters are treated as any other character, + unless they also appear within this list. */ +extern const char *rl_completer_quote_characters; + +/* List of quote characters which cause a word break. */ +extern const char *rl_basic_quote_characters; + +/* List of characters that need to be quoted in filenames by the completer. */ +extern const char *rl_filename_quote_characters; + +/* List of characters that are word break characters, but should be left + in TEXT when it is passed to the completion function. The shell uses + this to help determine what kind of completing to do. */ +extern const char *rl_special_prefixes; + +/* If non-zero, then this is the address of a function to call when + completing on a directory name. The function is called with + the address of a string (the current directory name) as an arg. It + changes what is displayed when the possible completions are printed + or inserted. The directory completion hook should perform + any necessary dequoting. This function should return 1 if it modifies + the directory name pointer passed as an argument. If the directory + completion hook returns 0, it should not modify the directory name + pointer passed as an argument. */ +extern rl_icppfunc_t *rl_directory_completion_hook; + +/* If non-zero, this is the address of a function to call when completing + a directory name. This function takes the address of the directory name + to be modified as an argument. Unlike rl_directory_completion_hook, it + only modifies the directory name used in opendir(2), not what is displayed + when the possible completions are printed or inserted. If set, it takes + precedence over rl_directory_completion_hook. The directory rewrite + hook should perform any necessary dequoting. This function has the same + return value properties as the directory_completion_hook. + + I'm not happy with how this works yet, so it's undocumented. I'm trying + it in bash to see how well it goes. */ +extern rl_icppfunc_t *rl_directory_rewrite_hook; + +/* If non-zero, this is the address of a function for the completer to call + before deciding which character to append to a completed name. It should + modify the directory name passed as an argument if appropriate, and return + non-zero if it modifies the name. This should not worry about dequoting + the filename; that has already happened by the time it gets here. */ +extern rl_icppfunc_t *rl_filename_stat_hook; + +/* If non-zero, this is the address of a function to call when reading + directory entries from the filesystem for completion and comparing + them to the partial word to be completed. The function should + either return its first argument (if no conversion takes place) or + newly-allocated memory. This can, for instance, convert filenames + between character sets for comparison against what's typed at the + keyboard. The returned value is what is added to the list of + matches. The second argument is the length of the filename to be + converted. */ +extern rl_dequote_func_t *rl_filename_rewrite_hook; + +/* Backwards compatibility with previous versions of readline. */ +#define rl_symbolic_link_hook rl_directory_completion_hook + +/* If non-zero, then this is the address of a function to call when + completing a word would normally display the list of possible matches. + This function is called instead of actually doing the display. + It takes three arguments: (char **matches, int num_matches, int max_length) + where MATCHES is the array of strings that matched, NUM_MATCHES is the + number of strings in that array, and MAX_LENGTH is the length of the + longest string in that array. */ +extern rl_compdisp_func_t *rl_completion_display_matches_hook; + +/* Non-zero means that the results of the matches are to be treated + as filenames. This is ALWAYS zero on entry, and can only be changed + within a completion entry finder function. */ +extern int rl_filename_completion_desired; + +/* Non-zero means that the results of the matches are to be quoted using + double quotes (or an application-specific quoting mechanism) if the + filename contains any characters in rl_word_break_chars. This is + ALWAYS non-zero on entry, and can only be changed within a completion + entry finder function. */ +extern int rl_filename_quoting_desired; + +/* Set to a function to quote a filename in an application-specific fashion. + Called with the text to quote, the type of match found (single or multiple) + and a pointer to the quoting character to be used, which the function can + reset if desired. */ +extern rl_quote_func_t *rl_filename_quoting_function; + +/* Function to call to remove quoting characters from a filename. Called + before completion is attempted, so the embedded quotes do not interfere + with matching names in the file system. */ +extern rl_dequote_func_t *rl_filename_dequoting_function; + +/* Function to call to decide whether or not a word break character is + quoted. If a character is quoted, it does not break words for the + completer. */ +extern rl_linebuf_func_t *rl_char_is_quoted_p; + +/* Non-zero means to suppress normal filename completion after the + user-specified completion function has been called. */ +extern int rl_attempted_completion_over; + +/* Set to a character describing the type of completion being attempted by + rl_complete_internal; available for use by application completion + functions. */ +extern int rl_completion_type; + +/* Set to the last key used to invoke one of the completion functions */ +extern int rl_completion_invoking_key; + +/* Up to this many items will be displayed in response to a + possible-completions call. After that, we ask the user if she + is sure she wants to see them all. The default value is 100. */ +extern int rl_completion_query_items; + +/* Character appended to completed words when at the end of the line. The + default is a space. Nothing is added if this is '\0'. */ +extern int rl_completion_append_character; + +/* If set to non-zero by an application completion function, + rl_completion_append_character will not be appended. */ +extern int rl_completion_suppress_append; + +/* Set to any quote character readline thinks it finds before any application + completion function is called. */ +extern int rl_completion_quote_character; + +/* Set to a non-zero value if readline found quoting anywhere in the word to + be completed; set before any application completion function is called. */ +extern int rl_completion_found_quote; + +/* If non-zero, the completion functions don't append any closing quote. + This is set to 0 by rl_complete_internal and may be changed by an + application-specific completion function. */ +extern int rl_completion_suppress_quote; + +/* If non-zero, readline will sort the completion matches. On by default. */ +extern int rl_sort_completion_matches; + +/* If non-zero, a slash will be appended to completed filenames that are + symbolic links to directory names, subject to the value of the + mark-directories variable (which is user-settable). This exists so + that application completion functions can override the user's preference + (set via the mark-symlinked-directories variable) if appropriate. + It's set to the value of _rl_complete_mark_symlink_dirs in + rl_complete_internal before any application-specific completion + function is called, so without that function doing anything, the user's + preferences are honored. */ +extern int rl_completion_mark_symlink_dirs; + +/* If non-zero, then disallow duplicates in the matches. */ +extern int rl_ignore_completion_duplicates; + +/* If this is non-zero, completion is (temporarily) inhibited, and the + completion character will be inserted as any other. */ +extern int rl_inhibit_completion; + +/* Input error; can be returned by (*rl_getc_function) if readline is reading + a top-level command (RL_ISSTATE (RL_STATE_READCMD)). */ +#define READERR (-2) + +/* Definitions available for use by readline clients. */ +#define RL_PROMPT_START_IGNORE '\001' +#define RL_PROMPT_END_IGNORE '\002' + +/* Possible values for do_replace argument to rl_filename_quoting_function, + called by rl_complete_internal. */ +#define NO_MATCH 0 +#define SINGLE_MATCH 1 +#define MULT_MATCH 2 + +/* Possible state values for rl_readline_state */ +#define RL_STATE_NONE 0x000000 /* no state; before first call */ + +#define RL_STATE_INITIALIZING 0x0000001 /* initializing */ +#define RL_STATE_INITIALIZED 0x0000002 /* initialization done */ +#define RL_STATE_TERMPREPPED 0x0000004 /* terminal is prepped */ +#define RL_STATE_READCMD 0x0000008 /* reading a command key */ +#define RL_STATE_METANEXT 0x0000010 /* reading input after ESC */ +#define RL_STATE_DISPATCHING 0x0000020 /* dispatching to a command */ +#define RL_STATE_MOREINPUT 0x0000040 /* reading more input in a command function */ +#define RL_STATE_ISEARCH 0x0000080 /* doing incremental search */ +#define RL_STATE_NSEARCH 0x0000100 /* doing non-inc search */ +#define RL_STATE_SEARCH 0x0000200 /* doing a history search */ +#define RL_STATE_NUMERICARG 0x0000400 /* reading numeric argument */ +#define RL_STATE_MACROINPUT 0x0000800 /* getting input from a macro */ +#define RL_STATE_MACRODEF 0x0001000 /* defining keyboard macro */ +#define RL_STATE_OVERWRITE 0x0002000 /* overwrite mode */ +#define RL_STATE_COMPLETING 0x0004000 /* doing completion */ +#define RL_STATE_SIGHANDLER 0x0008000 /* in readline sighandler */ +#define RL_STATE_UNDOING 0x0010000 /* doing an undo */ +#define RL_STATE_INPUTPENDING 0x0020000 /* rl_execute_next called */ +#define RL_STATE_TTYCSAVED 0x0040000 /* tty special chars saved */ +#define RL_STATE_CALLBACK 0x0080000 /* using the callback interface */ +#define RL_STATE_VIMOTION 0x0100000 /* reading vi motion arg */ +#define RL_STATE_MULTIKEY 0x0200000 /* reading multiple-key command */ +#define RL_STATE_VICMDONCE 0x0400000 /* entered vi command mode at least once */ +#define RL_STATE_REDISPLAYING 0x0800000 /* updating terminal display */ + +#define RL_STATE_DONE 0x1000000 /* done; accepted line */ + +#define RL_SETSTATE(x) (rl_readline_state |= (x)) +#define RL_UNSETSTATE(x) (rl_readline_state &= ~(x)) +#define RL_ISSTATE(x) (rl_readline_state & (x)) + +struct readline_state { + /* line state */ + int point; + int end; + int mark; + char *buffer; + int buflen; + UNDO_LIST *ul; + char *prompt; + + /* global state */ + int rlstate; + int done; + Keymap kmap; + + /* input state */ + rl_command_func_t *lastfunc; + int insmode; + int edmode; + int kseqlen; + FILE *inf; + FILE *outf; + int pendingin; + char *macro; + + /* signal state */ + int catchsigs; + int catchsigwinch; + + /* search state */ + + /* completion state */ + + /* options state */ + + /* reserved for future expansion, so the struct size doesn't change */ + char reserved[64]; +}; + +extern int rl_save_state PARAMS((struct readline_state *)); +extern int rl_restore_state PARAMS((struct readline_state *)); + +#ifdef __cplusplus +} +#endif + +#endif /* _READLINE_H_ */ diff --git a/lib/readline/rlconf.h b/lib/readline/rlconf.h new file mode 100644 index 0000000..1a40afc --- /dev/null +++ b/lib/readline/rlconf.h @@ -0,0 +1,69 @@ +/* rlconf.h -- readline configuration definitions */ + +/* Copyright (C) 1992-2012 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if !defined (_RLCONF_H_) +#define _RLCONF_H_ + +/* Define this if you want the vi-mode editing available. */ +#define VI_MODE + +/* Define this to get an indication of file type when listing completions. */ +#define VISIBLE_STATS + +/* Define this to get support for colors when listing completions and in + other places. */ +#define COLOR_SUPPORT + +/* This definition is needed by readline.c, rltty.c, and signals.c. */ +/* If on, then readline handles signals in a way that doesn't suck. */ +#define HANDLE_SIGNALS + +/* Ugly but working hack for binding prefix meta. */ +#define PREFIX_META_HACK + +/* The next-to-last-ditch effort file name for a user-specific init file. */ +#define DEFAULT_INPUTRC "~/.inputrc" + +/* The ultimate last-ditch filenname for an init file -- system-wide. */ +#define SYS_INPUTRC "/etc/inputrc" + +/* If defined, expand tabs to spaces. */ +#define DISPLAY_TABS + +/* If defined, use the terminal escape sequence to move the cursor forward + over a character when updating the line rather than rewriting it. */ +/* #define HACK_TERMCAP_MOTION */ + +/* The string inserted by the `insert comment' command. */ +#define RL_COMMENT_BEGIN_DEFAULT "#" + +/* Define this if you want code that allows readline to be used in an + X `callback' style. */ +#define READLINE_CALLBACKS + +/* Define this if you want the cursor to indicate insert or overwrite mode. */ +/* #define CURSOR_MODE */ + +/* Define this if you want to enable code that talks to the Linux kernel + tty auditing system. */ +#define ENABLE_TTY_AUDIT_SUPPORT + +#endif /* _RLCONF_H_ */ diff --git a/lib/readline/rldefs.h b/lib/readline/rldefs.h new file mode 100644 index 0000000..dab1beb --- /dev/null +++ b/lib/readline/rldefs.h @@ -0,0 +1,166 @@ +/* rldefs.h -- an attempt to isolate some of the system-specific defines + for readline. This should be included after any files that define + system-specific constants like _POSIX_VERSION or USG. */ + +/* Copyright (C) 1987-2011 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if !defined (_RLDEFS_H_) +#define _RLDEFS_H_ + +#if defined (HAVE_CONFIG_H) +# include "config.h" +#endif + +#include "rlstdc.h" + +#if defined (STRCOLL_BROKEN) +# undef HAVE_STRCOLL +#endif + +#if defined (_POSIX_VERSION) && !defined (TERMIOS_MISSING) +# define TERMIOS_TTY_DRIVER +#else +# if defined (HAVE_TERMIO_H) +# define TERMIO_TTY_DRIVER +# else +# if !defined (__MINGW32__) +# define NEW_TTY_DRIVER +# else +# define NO_TTY_DRIVER +# endif +# endif +#endif + +/* Posix macro to check file in statbuf for directory-ness. + This requires that be included before this test. */ +#if defined (S_IFDIR) && !defined (S_ISDIR) +# define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) +#endif + +/* Decide which flavor of the header file describing the C library + string functions to include and include it. */ + +#if defined (HAVE_STRING_H) +# include +#else /* !HAVE_STRING_H */ +# include +#endif /* !HAVE_STRING_H */ + +#if !defined (strchr) && !defined (__STDC__) +extern char *strchr (), *strrchr (); +#endif /* !strchr && !__STDC__ */ + +#if defined (PREFER_STDARG) +# include +#else +# if defined (PREFER_VARARGS) +# include +# endif +#endif + +#if defined (HAVE_STRCASECMP) +#define _rl_stricmp strcasecmp +#define _rl_strnicmp strncasecmp +#else +extern int _rl_stricmp PARAMS((const char *, const char *)); +extern int _rl_strnicmp PARAMS((const char *, const char *, int)); +#endif + +#if defined (HAVE_STRPBRK) && !defined (HAVE_MULTIBYTE) +# define _rl_strpbrk(a,b) strpbrk((a),(b)) +#else +extern char *_rl_strpbrk PARAMS((const char *, const char *)); +#endif + +#if !defined (emacs_mode) +# define no_mode -1 +# define vi_mode 0 +# define emacs_mode 1 +#endif + +#if !defined (RL_IM_INSERT) +# define RL_IM_INSERT 1 +# define RL_IM_OVERWRITE 0 +# +# define RL_IM_DEFAULT RL_IM_INSERT +#endif + +/* If you cast map[key].function to type (Keymap) on a Cray, + the compiler takes the value of map[key].function and + divides it by 4 to convert between pointer types (pointers + to functions and pointers to structs are different sizes). + This is not what is wanted. */ +#if defined (CRAY) +# define FUNCTION_TO_KEYMAP(map, key) (Keymap)((int)map[key].function) +# define KEYMAP_TO_FUNCTION(data) (rl_command_func_t *)((int)(data)) +#else +# define FUNCTION_TO_KEYMAP(map, key) (Keymap)(map[key].function) +# define KEYMAP_TO_FUNCTION(data) (rl_command_func_t *)(data) +#endif + +#ifndef savestring +#define savestring(x) strcpy ((char *)xmalloc (1 + strlen (x)), (x)) +#endif + +/* Possible values for _rl_bell_preference. */ +#define NO_BELL 0 +#define AUDIBLE_BELL 1 +#define VISIBLE_BELL 2 + +/* Definitions used when searching the line for characters. */ +/* NOTE: it is necessary that opposite directions are inverses */ +#define FTO 1 /* forward to */ +#define BTO -1 /* backward to */ +#define FFIND 2 /* forward find */ +#define BFIND -2 /* backward find */ + +/* Possible values for the found_quote flags word used by the completion + functions. It says what kind of (shell-like) quoting we found anywhere + in the line. */ +#define RL_QF_SINGLE_QUOTE 0x01 +#define RL_QF_DOUBLE_QUOTE 0x02 +#define RL_QF_BACKSLASH 0x04 +#define RL_QF_OTHER_QUOTE 0x08 + +/* Default readline line buffer length. */ +#define DEFAULT_BUFFER_SIZE 256 + +#if !defined (STREQ) +#define STREQ(a, b) (((a)[0] == (b)[0]) && (strcmp ((a), (b)) == 0)) +#define STREQN(a, b, n) (((n) == 0) ? (1) \ + : ((a)[0] == (b)[0]) && (strncmp ((a), (b), (n)) == 0)) +#endif + +#if !defined (RL_STRLEN) +# define RL_STRLEN(s) (((s) && (s)[0]) ? ((s)[1] ? ((s)[2] ? strlen(s) : 2) : 1) : 0) +#endif + +#if !defined (FREE) +# define FREE(x) if (x) free (x) +#endif + +#if !defined (SWAP) +# define SWAP(s, e) do { int t; t = s; s = e; e = t; } while (0) +#endif + +/* CONFIGURATION SECTION */ +#include "rlconf.h" + +#endif /* !_RLDEFS_H_ */ diff --git a/lib/readline/rlmbutil.h b/lib/readline/rlmbutil.h new file mode 100644 index 0000000..06d85ab --- /dev/null +++ b/lib/readline/rlmbutil.h @@ -0,0 +1,163 @@ +/* rlmbutil.h -- utility functions for multibyte characters. */ + +/* Copyright (C) 2001-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if !defined (_RL_MBUTIL_H_) +#define _RL_MBUTIL_H_ + +#include "rlstdc.h" + +/************************************************/ +/* check multibyte capability for I18N code */ +/************************************************/ + +/* For platforms which support the ISO C amendement 1 functionality we + support user defined character classes. */ + /* Solaris 2.5 has a bug: must be included before . */ +#if defined (HAVE_WCTYPE_H) && defined (HAVE_WCHAR_H) && defined (HAVE_LOCALE_H) +# include +# include +# if defined (HAVE_ISWCTYPE) && \ + defined (HAVE_ISWLOWER) && \ + defined (HAVE_ISWUPPER) && \ + defined (HAVE_MBSRTOWCS) && \ + defined (HAVE_MBRTOWC) && \ + defined (HAVE_MBRLEN) && \ + defined (HAVE_TOWLOWER) && \ + defined (HAVE_TOWUPPER) && \ + defined (HAVE_WCHAR_T) && \ + defined (HAVE_WCWIDTH) + /* system is supposed to support XPG5 */ +# define HANDLE_MULTIBYTE 1 +# endif +#endif + +/* If we don't want multibyte chars even on a system that supports them, let + the configuring user turn multibyte support off. */ +#if defined (NO_MULTIBYTE_SUPPORT) +# undef HANDLE_MULTIBYTE +#endif + +/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */ +#if HANDLE_MULTIBYTE && !defined (HAVE_MBSTATE_T) +# define wcsrtombs(dest, src, len, ps) (wcsrtombs) (dest, src, len, 0) +# define mbsrtowcs(dest, src, len, ps) (mbsrtowcs) (dest, src, len, 0) +# define wcrtomb(s, wc, ps) (wcrtomb) (s, wc, 0) +# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) +# define mbrlen(s, n, ps) (mbrlen) (s, n, 0) +# define mbstate_t int +#endif + +/* Make sure MB_LEN_MAX is at least 16 on systems that claim to be able to + handle multibyte chars (some systems define MB_LEN_MAX as 1) */ +#ifdef HANDLE_MULTIBYTE +# include +# if defined(MB_LEN_MAX) && (MB_LEN_MAX < 16) +# undef MB_LEN_MAX +# endif +# if !defined (MB_LEN_MAX) +# define MB_LEN_MAX 16 +# endif +#endif + +/************************************************/ +/* end of multibyte capability checks for I18N */ +/************************************************/ + +/* + * Flags for _rl_find_prev_mbchar and _rl_find_next_mbchar: + * + * MB_FIND_ANY find any multibyte character + * MB_FIND_NONZERO find a non-zero-width multibyte character + */ + +#define MB_FIND_ANY 0x00 +#define MB_FIND_NONZERO 0x01 + +extern int _rl_find_prev_mbchar PARAMS((char *, int, int)); +extern int _rl_find_next_mbchar PARAMS((char *, int, int, int)); + +#ifdef HANDLE_MULTIBYTE + +extern int _rl_compare_chars PARAMS((char *, int, mbstate_t *, char *, int, mbstate_t *)); +extern int _rl_get_char_len PARAMS((char *, mbstate_t *)); +extern int _rl_adjust_point PARAMS((char *, int, mbstate_t *)); + +extern int _rl_read_mbchar PARAMS((char *, int)); +extern int _rl_read_mbstring PARAMS((int, char *, int)); + +extern int _rl_is_mbchar_matched PARAMS((char *, int, int, char *, int)); + +extern wchar_t _rl_char_value PARAMS((char *, int)); +extern int _rl_walphabetic PARAMS((wchar_t)); + +#define _rl_to_wupper(wc) (iswlower (wc) ? towupper (wc) : (wc)) +#define _rl_to_wlower(wc) (iswupper (wc) ? towlower (wc) : (wc)) + +#define MB_NEXTCHAR(b,s,c,f) \ + ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) \ + ? _rl_find_next_mbchar ((b), (s), (c), (f)) \ + : ((s) + (c))) +#define MB_PREVCHAR(b,s,f) \ + ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) \ + ? _rl_find_prev_mbchar ((b), (s), (f)) \ + : ((s) - 1)) + +#define MB_INVALIDCH(x) ((x) == (size_t)-1 || (x) == (size_t)-2) +#define MB_NULLWCH(x) ((x) == 0) + +/* Unicode combining characters range from U+0300 to U+036F */ +#define UNICODE_COMBINING_CHAR(x) ((x) >= 768 && (x) <= 879) + +#if defined (WCWIDTH_BROKEN) +# define WCWIDTH(wc) ((_rl_utf8locale && UNICODE_COMBINING_CHAR(wc)) ? 0 : wcwidth(wc)) +#else +# define WCWIDTH(wc) wcwidth(wc) +#endif + +#else /* !HANDLE_MULTIBYTE */ + +#undef MB_LEN_MAX +#undef MB_CUR_MAX + +#define MB_LEN_MAX 1 +#define MB_CUR_MAX 1 + +#define _rl_find_prev_mbchar(b, i, f) (((i) == 0) ? (i) : ((i) - 1)) +#define _rl_find_next_mbchar(b, i1, i2, f) ((i1) + (i2)) + +#define _rl_char_value(buf,ind) ((buf)[(ind)]) + +#define _rl_walphabetic(c) (rl_alphabetic (c)) + +#define _rl_to_wupper(c) (_rl_to_upper (c)) +#define _rl_to_wlower(c) (_rl_to_lower (c)) + +#define MB_NEXTCHAR(b,s,c,f) ((s) + (c)) +#define MB_PREVCHAR(b,s,f) ((s) - 1) + +#define MB_INVALIDCH(x) (0) +#define MB_NULLWCH(x) (0) + +#endif /* !HANDLE_MULTIBYTE */ + +extern int rl_byte_oriented; + +#endif /* _RL_MBUTIL_H_ */ diff --git a/lib/readline/rlprivate.h b/lib/readline/rlprivate.h new file mode 100644 index 0000000..14a370d --- /dev/null +++ b/lib/readline/rlprivate.h @@ -0,0 +1,535 @@ +/* rlprivate.h -- functions and variables global to the readline library, + but not intended for use by applications. */ + +/* Copyright (C) 1999-2012 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if !defined (_RL_PRIVATE_H_) +#define _RL_PRIVATE_H_ + +#include "rlconf.h" /* for VISIBLE_STATS */ +#include "rlstdc.h" +#include "posixjmp.h" /* defines procenv_t */ + +/************************************************************************* + * * + * Convenience definitions * + * * + *************************************************************************/ + +#define EMACS_MODE() (rl_editing_mode == emacs_mode) +#define VI_COMMAND_MODE() (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap) +#define VI_INSERT_MODE() (rl_editing_mode == vi_mode && _rl_keymap == vi_insertion_keymap) + +#define RL_CHECK_SIGNALS() \ + do { \ + if (_rl_caught_signal) _rl_signal_handler (_rl_caught_signal); \ + } while (0) + +#define RL_SIG_RECEIVED() (_rl_caught_signal != 0) +#define RL_SIGINT_RECEIVED() (_rl_caught_signal == SIGINT) + +#define CUSTOM_REDISPLAY_FUNC() (rl_redisplay_function != rl_redisplay) +#define CUSTOM_INPUT_FUNC() (rl_getc_function != rl_getc) + +/************************************************************************* + * * + * Global structs undocumented in texinfo manual and not in readline.h * + * * + *************************************************************************/ +/* search types */ +#define RL_SEARCH_ISEARCH 0x01 /* incremental search */ +#define RL_SEARCH_NSEARCH 0x02 /* non-incremental search */ +#define RL_SEARCH_CSEARCH 0x04 /* intra-line char search */ + +/* search flags */ +#define SF_REVERSE 0x01 +#define SF_FOUND 0x02 +#define SF_FAILED 0x04 +#define SF_CHGKMAP 0x08 + +typedef struct __rl_search_context +{ + int type; + int sflags; + + char *search_string; + int search_string_index; + int search_string_size; + + char **lines; + char *allocated_line; + int hlen; + int hindex; + + int save_point; + int save_mark; + int save_line; + int last_found_line; + char *prev_line_found; + + UNDO_LIST *save_undo_list; + + Keymap keymap; /* used when dispatching commands in search string */ + Keymap okeymap; /* original keymap */ + + int history_pos; + int direction; + + int prevc; + int lastc; +#if defined (HANDLE_MULTIBYTE) + char mb[MB_LEN_MAX]; + char pmb[MB_LEN_MAX]; +#endif + + char *sline; + int sline_len; + int sline_index; + + char *search_terminators; +} _rl_search_cxt; + +/* Callback data for reading numeric arguments */ +#define NUM_SAWMINUS 0x01 +#define NUM_SAWDIGITS 0x02 +#define NUM_READONE 0x04 + +typedef int _rl_arg_cxt; + +/* A context for reading key sequences longer than a single character when + using the callback interface. */ +#define KSEQ_DISPATCHED 0x01 +#define KSEQ_SUBSEQ 0x02 +#define KSEQ_RECURSIVE 0x04 + +typedef struct __rl_keyseq_context +{ + int flags; + int subseq_arg; + int subseq_retval; /* XXX */ + Keymap dmap; + + Keymap oldmap; + int okey; + struct __rl_keyseq_context *ocxt; + int childval; +} _rl_keyseq_cxt; + +/* vi-mode commands that use result of motion command to define boundaries */ +#define VIM_DELETE 0x01 +#define VIM_CHANGE 0x02 +#define VIM_YANK 0x04 + +/* various states for vi-mode commands that use motion commands. reflects + RL_READLINE_STATE */ +#define VMSTATE_READ 0x01 +#define VMSTATE_NUMARG 0x02 + +typedef struct __rl_vimotion_context +{ + int op; + int state; + int flags; /* reserved */ + _rl_arg_cxt ncxt; + int numeric_arg; + int start, end; /* rl_point, rl_end */ + int key, motion; /* initial key, motion command */ +} _rl_vimotion_cxt; + +/* fill in more as needed */ +/* `Generic' callback data and functions */ +typedef struct __rl_callback_generic_arg +{ + int count; + int i1, i2; + /* add here as needed */ +} _rl_callback_generic_arg; + +typedef int _rl_callback_func_t PARAMS((_rl_callback_generic_arg *)); + +typedef void _rl_sigcleanup_func_t PARAMS((int, void *)); + +/************************************************************************* + * * + * Global functions undocumented in texinfo manual and not in readline.h * + * * + *************************************************************************/ + +/************************************************************************* + * * + * Global variables undocumented in texinfo manual and not in readline.h * + * * + *************************************************************************/ + +/* complete.c */ +extern int rl_complete_with_tilde_expansion; +#if defined (VISIBLE_STATS) +extern int rl_visible_stats; +#endif /* VISIBLE_STATS */ +#if defined (COLOR_SUPPORT) +extern int _rl_colored_stats; +#endif + +/* readline.c */ +extern int rl_line_buffer_len; +extern int rl_arg_sign; +extern int rl_visible_prompt_length; +extern int rl_byte_oriented; + +/* display.c */ +extern int rl_display_fixed; + +/* parens.c */ +extern int rl_blink_matching_paren; + +/************************************************************************* + * * + * Global functions and variables unused and undocumented * + * * + *************************************************************************/ + +/* kill.c */ +extern int rl_set_retained_kills PARAMS((int)); + +/* terminal.c */ +extern void _rl_set_screen_size PARAMS((int, int)); + +/* undo.c */ +extern int _rl_fix_last_undo_of_type PARAMS((int, int, int)); + +/* util.c */ +extern char *_rl_savestring PARAMS((const char *)); + +/************************************************************************* + * * + * Functions and variables private to the readline library * + * * + *************************************************************************/ + +/* NOTE: Functions and variables prefixed with `_rl_' are + pseudo-global: they are global so they can be shared + between files in the readline library, but are not intended + to be visible to readline callers. */ + +/************************************************************************* + * Undocumented private functions * + *************************************************************************/ + +#if defined(READLINE_CALLBACKS) + +/* readline.c */ +extern void readline_internal_setup PARAMS((void)); +extern char *readline_internal_teardown PARAMS((int)); +extern int readline_internal_char PARAMS((void)); + +extern _rl_keyseq_cxt *_rl_keyseq_cxt_alloc PARAMS((void)); +extern void _rl_keyseq_cxt_dispose PARAMS((_rl_keyseq_cxt *)); +extern void _rl_keyseq_chain_dispose PARAMS((void)); + +extern int _rl_dispatch_callback PARAMS((_rl_keyseq_cxt *)); + +/* callback.c */ +extern _rl_callback_generic_arg *_rl_callback_data_alloc PARAMS((int)); +extern void _rl_callback_data_dispose PARAMS((_rl_callback_generic_arg *)); + +#endif /* READLINE_CALLBACKS */ + +/* bind.c */ +extern char *_rl_untranslate_macro_value PARAMS((char *, int)); + +/* complete.c */ +extern void _rl_reset_completion_state PARAMS((void)); +extern char _rl_find_completion_word PARAMS((int *, int *)); +extern void _rl_free_match_list PARAMS((char **)); + +/* display.c */ +extern char *_rl_strip_prompt PARAMS((char *)); +extern void _rl_reset_prompt PARAMS((void)); +extern void _rl_move_cursor_relative PARAMS((int, const char *)); +extern void _rl_move_vert PARAMS((int)); +extern void _rl_save_prompt PARAMS((void)); +extern void _rl_restore_prompt PARAMS((void)); +extern char *_rl_make_prompt_for_search PARAMS((int)); +extern void _rl_erase_at_end_of_line PARAMS((int)); +extern void _rl_clear_to_eol PARAMS((int)); +extern void _rl_clear_screen PARAMS((void)); +extern void _rl_update_final PARAMS((void)); +extern void _rl_redisplay_after_sigwinch PARAMS((void)); +extern void _rl_clean_up_for_exit PARAMS((void)); +extern void _rl_erase_entire_line PARAMS((void)); +extern int _rl_current_display_line PARAMS((void)); + +/* input.c */ +extern int _rl_any_typein PARAMS((void)); +extern int _rl_input_available PARAMS((void)); +extern int _rl_input_queued PARAMS((int)); +extern void _rl_insert_typein PARAMS((int)); +extern int _rl_unget_char PARAMS((int)); +extern int _rl_pushed_input_available PARAMS((void)); + +/* isearch.c */ +extern _rl_search_cxt *_rl_scxt_alloc PARAMS((int, int)); +extern void _rl_scxt_dispose PARAMS((_rl_search_cxt *, int)); + +extern int _rl_isearch_dispatch PARAMS((_rl_search_cxt *, int)); +extern int _rl_isearch_callback PARAMS((_rl_search_cxt *)); + +extern int _rl_search_getchar PARAMS((_rl_search_cxt *)); + +/* macro.c */ +extern void _rl_with_macro_input PARAMS((char *)); +extern int _rl_next_macro_key PARAMS((void)); +extern int _rl_prev_macro_key PARAMS((void)); +extern void _rl_push_executing_macro PARAMS((void)); +extern void _rl_pop_executing_macro PARAMS((void)); +extern void _rl_add_macro_char PARAMS((int)); +extern void _rl_kill_kbd_macro PARAMS((void)); + +/* misc.c */ +extern int _rl_arg_overflow PARAMS((void)); +extern void _rl_arg_init PARAMS((void)); +extern int _rl_arg_getchar PARAMS((void)); +extern int _rl_arg_callback PARAMS((_rl_arg_cxt)); +extern void _rl_reset_argument PARAMS((void)); + +extern void _rl_start_using_history PARAMS((void)); +extern int _rl_free_saved_history_line PARAMS((void)); +extern void _rl_set_insert_mode PARAMS((int, int)); + +extern void _rl_revert_all_lines PARAMS((void)); + +/* nls.c */ +extern int _rl_init_eightbit PARAMS((void)); + +/* parens.c */ +extern void _rl_enable_paren_matching PARAMS((int)); + +/* readline.c */ +extern void _rl_init_line_state PARAMS((void)); +extern void _rl_set_the_line PARAMS((void)); +extern int _rl_dispatch PARAMS((int, Keymap)); +extern int _rl_dispatch_subseq PARAMS((int, Keymap, int)); +extern void _rl_internal_char_cleanup PARAMS((void)); + +/* rltty.c */ +extern int _rl_disable_tty_signals PARAMS((void)); +extern int _rl_restore_tty_signals PARAMS((void)); + +/* search.c */ +extern int _rl_nsearch_callback PARAMS((_rl_search_cxt *)); + +/* signals.c */ +extern void _rl_signal_handler PARAMS((int)); + +extern void _rl_block_sigint PARAMS((void)); +extern void _rl_release_sigint PARAMS((void)); +extern void _rl_block_sigwinch PARAMS((void)); +extern void _rl_release_sigwinch PARAMS((void)); + +/* terminal.c */ +extern void _rl_get_screen_size PARAMS((int, int)); +extern void _rl_sigwinch_resize_terminal PARAMS((void)); +extern int _rl_init_terminal_io PARAMS((const char *)); +#ifdef _MINIX +extern void _rl_output_character_function PARAMS((int)); +#else +extern int _rl_output_character_function PARAMS((int)); +#endif +extern void _rl_output_some_chars PARAMS((const char *, int)); +extern int _rl_backspace PARAMS((int)); +extern void _rl_enable_meta_key PARAMS((void)); +extern void _rl_disable_meta_key PARAMS((void)); +extern void _rl_control_keypad PARAMS((int)); +extern void _rl_set_cursor PARAMS((int, int)); + +/* text.c */ +extern void _rl_fix_point PARAMS((int)); +extern int _rl_replace_text PARAMS((const char *, int, int)); +extern int _rl_forward_char_internal PARAMS((int)); +extern int _rl_insert_char PARAMS((int, int)); +extern int _rl_overwrite_char PARAMS((int, int)); +extern int _rl_overwrite_rubout PARAMS((int, int)); +extern int _rl_rubout_char PARAMS((int, int)); +#if defined (HANDLE_MULTIBYTE) +extern int _rl_char_search_internal PARAMS((int, int, char *, int)); +#else +extern int _rl_char_search_internal PARAMS((int, int, int)); +#endif +extern int _rl_set_mark_at_pos PARAMS((int)); + +/* undo.c */ +extern UNDO_LIST *_rl_copy_undo_entry PARAMS((UNDO_LIST *)); +extern UNDO_LIST *_rl_copy_undo_list PARAMS((UNDO_LIST *)); +extern void _rl_free_undo_list PARAMS((UNDO_LIST *)); + +/* util.c */ +#if defined (USE_VARARGS) && defined (PREFER_STDARG) +extern void _rl_ttymsg (const char *, ...) __attribute__((__format__ (printf, 1, 2))); +extern void _rl_errmsg (const char *, ...) __attribute__((__format__ (printf, 1, 2))); +extern void _rl_trace (const char *, ...) __attribute__((__format__ (printf, 1, 2))); +#else +extern void _rl_ttymsg (); +extern void _rl_errmsg (); +extern void _rl_trace (); +#endif +extern void _rl_audit_tty PARAMS((char *)); + +extern int _rl_tropen PARAMS((void)); + +extern int _rl_abort_internal PARAMS((void)); +extern int _rl_null_function PARAMS((int, int)); +extern char *_rl_strindex PARAMS((const char *, const char *)); +extern int _rl_qsort_string_compare PARAMS((char **, char **)); +extern int (_rl_uppercase_p) PARAMS((int)); +extern int (_rl_lowercase_p) PARAMS((int)); +extern int (_rl_pure_alphabetic) PARAMS((int)); +extern int (_rl_digit_p) PARAMS((int)); +extern int (_rl_to_lower) PARAMS((int)); +extern int (_rl_to_upper) PARAMS((int)); +extern int (_rl_digit_value) PARAMS((int)); + +/* vi_mode.c */ +extern void _rl_vi_initialize_line PARAMS((void)); +extern void _rl_vi_reset_last PARAMS((void)); +extern void _rl_vi_set_last PARAMS((int, int, int)); +extern int _rl_vi_textmod_command PARAMS((int)); +extern void _rl_vi_done_inserting PARAMS((void)); +extern int _rl_vi_domove_callback PARAMS((_rl_vimotion_cxt *)); + +/************************************************************************* + * Undocumented private variables * + *************************************************************************/ + +/* bind.c */ +extern const char * const _rl_possible_control_prefixes[]; +extern const char * const _rl_possible_meta_prefixes[]; + +/* callback.c */ +extern _rl_callback_func_t *_rl_callback_func; +extern _rl_callback_generic_arg *_rl_callback_data; + +/* complete.c */ +extern int _rl_complete_show_all; +extern int _rl_complete_show_unmodified; +extern int _rl_complete_mark_directories; +extern int _rl_complete_mark_symlink_dirs; +extern int _rl_completion_prefix_display_length; +extern int _rl_completion_columns; +extern int _rl_print_completions_horizontally; +extern int _rl_completion_case_fold; +extern int _rl_completion_case_map; +extern int _rl_match_hidden_files; +extern int _rl_page_completions; +extern int _rl_skip_completed_text; +extern int _rl_menu_complete_prefix_first; + +/* display.c */ +extern int _rl_vis_botlin; +extern int _rl_last_c_pos; +extern int _rl_suppress_redisplay; +extern int _rl_want_redisplay; + +/* isearch.c */ +extern char *_rl_isearch_terminators; + +extern _rl_search_cxt *_rl_iscxt; + +/* macro.c */ +extern char *_rl_executing_macro; + +/* misc.c */ +extern int _rl_history_preserve_point; +extern int _rl_history_saved_point; + +extern _rl_arg_cxt _rl_argcxt; + +/* nls.c */ +extern int _rl_utf8locale; + +/* readline.c */ +extern int _rl_echoing_p; +extern int _rl_horizontal_scroll_mode; +extern int _rl_mark_modified_lines; +extern int _rl_bell_preference; +extern int _rl_meta_flag; +extern int _rl_convert_meta_chars_to_ascii; +extern int _rl_output_meta_chars; +extern int _rl_bind_stty_chars; +extern int _rl_revert_all_at_newline; +extern int _rl_echo_control_chars; +extern int _rl_show_mode_in_prompt; +extern char *_rl_comment_begin; +extern unsigned char _rl_parsing_conditionalized_out; +extern Keymap _rl_keymap; +extern FILE *_rl_in_stream; +extern FILE *_rl_out_stream; +extern int _rl_last_command_was_kill; +extern int _rl_eof_char; +extern procenv_t _rl_top_level; +extern _rl_keyseq_cxt *_rl_kscxt; +extern int _rl_keyseq_timeout; + +extern int _rl_executing_keyseq_size; + +/* search.c */ +extern _rl_search_cxt *_rl_nscxt; + +/* signals.c */ +extern int _rl_interrupt_immediately; +extern int volatile _rl_caught_signal; + +extern _rl_sigcleanup_func_t *_rl_sigcleanup; +extern void *_rl_sigcleanarg; + +extern int _rl_echoctl; + +extern int _rl_intr_char; +extern int _rl_quit_char; +extern int _rl_susp_char; + +/* terminal.c */ +extern int _rl_enable_keypad; +extern int _rl_enable_meta; +extern char *_rl_term_clreol; +extern char *_rl_term_clrpag; +extern char *_rl_term_im; +extern char *_rl_term_ic; +extern char *_rl_term_ei; +extern char *_rl_term_DC; +extern char *_rl_term_up; +extern char *_rl_term_dc; +extern char *_rl_term_cr; +extern char *_rl_term_IC; +extern char *_rl_term_forward_char; +extern int _rl_screenheight; +extern int _rl_screenwidth; +extern int _rl_screenchars; +extern int _rl_terminal_can_insert; +extern int _rl_term_autowrap; + +/* undo.c */ +extern int _rl_doing_an_undo; +extern int _rl_undo_group_level; + +/* vi_mode.c */ +extern int _rl_vi_last_command; +extern _rl_vimotion_cxt *_rl_vimvcxt; + +#endif /* _RL_PRIVATE_H_ */ diff --git a/lib/readline/rlshell.h b/lib/readline/rlshell.h new file mode 100644 index 0000000..3e17d8b --- /dev/null +++ b/lib/readline/rlshell.h @@ -0,0 +1,33 @@ +/* rlshell.h -- utility functions normally provided by bash. */ + +/* Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if !defined (_RL_SHELL_H_) +#define _RL_SHELL_H_ + +#include "rlstdc.h" + +extern char *sh_single_quote PARAMS((char *)); +extern void sh_set_lines_and_columns PARAMS((int, int)); +extern char *sh_get_env_value PARAMS((const char *)); +extern char *sh_get_home_dir PARAMS((void)); +extern int sh_unset_nodelay_mode PARAMS((int)); + +#endif /* _RL_SHELL_H_ */ diff --git a/lib/readline/rlstdc.h b/lib/readline/rlstdc.h new file mode 100644 index 0000000..2aaa30b --- /dev/null +++ b/lib/readline/rlstdc.h @@ -0,0 +1,57 @@ +/* stdc.h -- macros to make source compile on both ANSI C and K&R C compilers. */ + +/* Copyright (C) 1993-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if !defined (_RL_STDC_H_) +#define _RL_STDC_H_ + +/* Adapted from BSD /usr/include/sys/cdefs.h. */ + +/* A function can be defined using prototypes and compile on both ANSI C + and traditional C compilers with something like this: + extern char *func PARAMS((char *, char *, int)); */ + +#if !defined (PARAMS) +# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus) +# define PARAMS(protos) protos +# else +# define PARAMS(protos) () +# endif +#endif + +#ifndef __attribute__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) +# define __attribute__(x) +# endif +#endif + +/* Moved from config.h.in because readline.h:rl_message depends on these + defines. */ +#if defined (__STDC__) && defined (HAVE_STDARG_H) +# define PREFER_STDARG +# define USE_VARARGS +#else +# if defined (HAVE_VARARGS_H) +# define PREFER_VARARGS +# define USE_VARARGS +# endif +#endif + +#endif /* !_RL_STDC_H_ */ diff --git a/lib/readline/rltty.c b/lib/readline/rltty.c new file mode 100644 index 0000000..908bae1 --- /dev/null +++ b/lib/readline/rltty.c @@ -0,0 +1,975 @@ +/* rltty.c -- functions to prepare and restore the terminal for readline's + use. */ + +/* Copyright (C) 1992-2005 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include +#include +#include +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif /* HAVE_UNISTD_H */ + +#include "rldefs.h" + +#if defined (GWINSZ_IN_SYS_IOCTL) +# include +#endif /* GWINSZ_IN_SYS_IOCTL */ + +#include "rltty.h" +#include "readline.h" +#include "rlprivate.h" + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +rl_vintfunc_t *rl_prep_term_function = rl_prep_terminal; +rl_voidfunc_t *rl_deprep_term_function = rl_deprep_terminal; + +static void set_winsize PARAMS((int)); + +/* **************************************************************** */ +/* */ +/* Saving and Restoring the TTY */ +/* */ +/* **************************************************************** */ + +/* Non-zero means that the terminal is in a prepped state. */ +static int terminal_prepped; + +static _RL_TTY_CHARS _rl_tty_chars, _rl_last_tty_chars; + +/* If non-zero, means that this process has called tcflow(fd, TCOOFF) + and output is suspended. */ +#if defined (__ksr1__) +static int ksrflow; +#endif + +/* Dummy call to force a backgrounded readline to stop before it tries + to get the tty settings. */ +static void +set_winsize (tty) + int tty; +{ +#if defined (TIOCGWINSZ) + struct winsize w; + + if (ioctl (tty, TIOCGWINSZ, &w) == 0) + (void) ioctl (tty, TIOCSWINSZ, &w); +#endif /* TIOCGWINSZ */ +} + +#if defined (NO_TTY_DRIVER) +/* Nothing */ +#elif defined (NEW_TTY_DRIVER) + +/* Values for the `flags' field of a struct bsdtty. This tells which + elements of the struct bsdtty have been fetched from the system and + are valid. */ +#define SGTTY_SET 0x01 +#define LFLAG_SET 0x02 +#define TCHARS_SET 0x04 +#define LTCHARS_SET 0x08 + +struct bsdtty { + struct sgttyb sgttyb; /* Basic BSD tty driver information. */ + int lflag; /* Local mode flags, like LPASS8. */ +#if defined (TIOCGETC) + struct tchars tchars; /* Terminal special characters, including ^S and ^Q. */ +#endif +#if defined (TIOCGLTC) + struct ltchars ltchars; /* 4.2 BSD editing characters */ +#endif + int flags; /* Bitmap saying which parts of the struct are valid. */ +}; + +#define TIOTYPE struct bsdtty + +static TIOTYPE otio; + +static void save_tty_chars PARAMS((TIOTYPE *)); +static int _get_tty_settings PARAMS((int, TIOTYPE *)); +static int get_tty_settings PARAMS((int, TIOTYPE *)); +static int _set_tty_settings PARAMS((int, TIOTYPE *)); +static int set_tty_settings PARAMS((int, TIOTYPE *)); + +static void prepare_terminal_settings PARAMS((int, TIOTYPE, TIOTYPE *)); + +static void set_special_char PARAMS((Keymap, TIOTYPE *, int, rl_command_func_t *)); + +static void +save_tty_chars (tiop) + TIOTYPE *tiop; +{ + _rl_last_tty_chars = _rl_tty_chars; + + if (tiop->flags & SGTTY_SET) + { + _rl_tty_chars.t_erase = tiop->sgttyb.sg_erase; + _rl_tty_chars.t_kill = tiop->sgttyb.sg_kill; + } + + if (tiop->flags & TCHARS_SET) + { + _rl_intr_char = _rl_tty_chars.t_intr = tiop->tchars.t_intrc; + _rl_quit_char = _rl_tty_chars.t_quit = tiop->tchars.t_quitc; + + _rl_tty_chars.t_start = tiop->tchars.t_startc; + _rl_tty_chars.t_stop = tiop->tchars.t_stopc; + _rl_tty_chars.t_eof = tiop->tchars.t_eofc; + _rl_tty_chars.t_eol = '\n'; + _rl_tty_chars.t_eol2 = tiop->tchars.t_brkc; + } + + if (tiop->flags & LTCHARS_SET) + { + _rl_susp_char = _rl_tty_chars.t_susp = tiop->ltchars.t_suspc; + + _rl_tty_chars.t_dsusp = tiop->ltchars.t_dsuspc; + _rl_tty_chars.t_reprint = tiop->ltchars.t_rprntc; + _rl_tty_chars.t_flush = tiop->ltchars.t_flushc; + _rl_tty_chars.t_werase = tiop->ltchars.t_werasc; + _rl_tty_chars.t_lnext = tiop->ltchars.t_lnextc; + } + + _rl_tty_chars.t_status = -1; +} + +static int +get_tty_settings (tty, tiop) + int tty; + TIOTYPE *tiop; +{ + set_winsize (tty); + + tiop->flags = tiop->lflag = 0; + + errno = 0; + if (ioctl (tty, TIOCGETP, &(tiop->sgttyb)) < 0) + return -1; + tiop->flags |= SGTTY_SET; + +#if defined (TIOCLGET) + if (ioctl (tty, TIOCLGET, &(tiop->lflag)) == 0) + tiop->flags |= LFLAG_SET; +#endif + +#if defined (TIOCGETC) + if (ioctl (tty, TIOCGETC, &(tiop->tchars)) == 0) + tiop->flags |= TCHARS_SET; +#endif + +#if defined (TIOCGLTC) + if (ioctl (tty, TIOCGLTC, &(tiop->ltchars)) == 0) + tiop->flags |= LTCHARS_SET; +#endif + + return 0; +} + +static int +set_tty_settings (tty, tiop) + int tty; + TIOTYPE *tiop; +{ + if (tiop->flags & SGTTY_SET) + { + ioctl (tty, TIOCSETN, &(tiop->sgttyb)); + tiop->flags &= ~SGTTY_SET; + } + _rl_echoing_p = 1; + +#if defined (TIOCLSET) + if (tiop->flags & LFLAG_SET) + { + ioctl (tty, TIOCLSET, &(tiop->lflag)); + tiop->flags &= ~LFLAG_SET; + } +#endif + +#if defined (TIOCSETC) + if (tiop->flags & TCHARS_SET) + { + ioctl (tty, TIOCSETC, &(tiop->tchars)); + tiop->flags &= ~TCHARS_SET; + } +#endif + +#if defined (TIOCSLTC) + if (tiop->flags & LTCHARS_SET) + { + ioctl (tty, TIOCSLTC, &(tiop->ltchars)); + tiop->flags &= ~LTCHARS_SET; + } +#endif + + return 0; +} + +static void +prepare_terminal_settings (meta_flag, oldtio, tiop) + int meta_flag; + TIOTYPE oldtio, *tiop; +{ + _rl_echoing_p = (oldtio.sgttyb.sg_flags & ECHO); + _rl_echoctl = (oldtio.sgttyb.sg_flags & ECHOCTL); + + /* Copy the original settings to the structure we're going to use for + our settings. */ + tiop->sgttyb = oldtio.sgttyb; + tiop->lflag = oldtio.lflag; +#if defined (TIOCGETC) + tiop->tchars = oldtio.tchars; +#endif +#if defined (TIOCGLTC) + tiop->ltchars = oldtio.ltchars; +#endif + tiop->flags = oldtio.flags; + + /* First, the basic settings to put us into character-at-a-time, no-echo + input mode. */ + tiop->sgttyb.sg_flags &= ~(ECHO | CRMOD); + tiop->sgttyb.sg_flags |= CBREAK; + + /* If this terminal doesn't care how the 8th bit is used, then we can + use it for the meta-key. If only one of even or odd parity is + specified, then the terminal is using parity, and we cannot. */ +#if !defined (ANYP) +# define ANYP (EVENP | ODDP) +#endif + if (((oldtio.sgttyb.sg_flags & ANYP) == ANYP) || + ((oldtio.sgttyb.sg_flags & ANYP) == 0)) + { + tiop->sgttyb.sg_flags |= ANYP; + + /* Hack on local mode flags if we can. */ +#if defined (TIOCLGET) +# if defined (LPASS8) + tiop->lflag |= LPASS8; +# endif /* LPASS8 */ +#endif /* TIOCLGET */ + } + +#if defined (TIOCGETC) +# if defined (USE_XON_XOFF) + /* Get rid of terminal output start and stop characters. */ + tiop->tchars.t_stopc = -1; /* C-s */ + tiop->tchars.t_startc = -1; /* C-q */ + + /* If there is an XON character, bind it to restart the output. */ + if (oldtio.tchars.t_startc != -1) + rl_bind_key (oldtio.tchars.t_startc, rl_restart_output); +# endif /* USE_XON_XOFF */ + + /* If there is an EOF char, bind _rl_eof_char to it. */ + if (oldtio.tchars.t_eofc != -1) + _rl_eof_char = oldtio.tchars.t_eofc; + +# if defined (NO_KILL_INTR) + /* Get rid of terminal-generated SIGQUIT and SIGINT. */ + tiop->tchars.t_quitc = -1; /* C-\ */ + tiop->tchars.t_intrc = -1; /* C-c */ +# endif /* NO_KILL_INTR */ +#endif /* TIOCGETC */ + +#if defined (TIOCGLTC) + /* Make the interrupt keys go away. Just enough to make people happy. */ + tiop->ltchars.t_dsuspc = -1; /* C-y */ + tiop->ltchars.t_lnextc = -1; /* C-v */ +#endif /* TIOCGLTC */ +} + +#else /* !defined (NEW_TTY_DRIVER) */ + +#if !defined (VMIN) +# define VMIN VEOF +#endif + +#if !defined (VTIME) +# define VTIME VEOL +#endif + +#if defined (TERMIOS_TTY_DRIVER) +# define TIOTYPE struct termios +# define DRAIN_OUTPUT(fd) tcdrain (fd) +# define GETATTR(tty, tiop) (tcgetattr (tty, tiop)) +# ifdef M_UNIX +# define SETATTR(tty, tiop) (tcsetattr (tty, TCSANOW, tiop)) +# else +# define SETATTR(tty, tiop) (tcsetattr (tty, TCSADRAIN, tiop)) +# endif /* !M_UNIX */ +#else +# define TIOTYPE struct termio +# define DRAIN_OUTPUT(fd) +# define GETATTR(tty, tiop) (ioctl (tty, TCGETA, tiop)) +# define SETATTR(tty, tiop) (ioctl (tty, TCSETAW, tiop)) +#endif /* !TERMIOS_TTY_DRIVER */ + +static TIOTYPE otio; + +static void save_tty_chars PARAMS((TIOTYPE *)); +static int _get_tty_settings PARAMS((int, TIOTYPE *)); +static int get_tty_settings PARAMS((int, TIOTYPE *)); +static int _set_tty_settings PARAMS((int, TIOTYPE *)); +static int set_tty_settings PARAMS((int, TIOTYPE *)); + +static void prepare_terminal_settings PARAMS((int, TIOTYPE, TIOTYPE *)); + +static void set_special_char PARAMS((Keymap, TIOTYPE *, int, rl_command_func_t *)); +static void _rl_bind_tty_special_chars PARAMS((Keymap, TIOTYPE)); + +#if defined (FLUSHO) +# define OUTPUT_BEING_FLUSHED(tp) (tp->c_lflag & FLUSHO) +#else +# define OUTPUT_BEING_FLUSHED(tp) 0 +#endif + +static void +save_tty_chars (tiop) + TIOTYPE *tiop; +{ + _rl_last_tty_chars = _rl_tty_chars; + + _rl_tty_chars.t_eof = tiop->c_cc[VEOF]; + _rl_tty_chars.t_eol = tiop->c_cc[VEOL]; +#ifdef VEOL2 + _rl_tty_chars.t_eol2 = tiop->c_cc[VEOL2]; +#endif + _rl_tty_chars.t_erase = tiop->c_cc[VERASE]; +#ifdef VWERASE + _rl_tty_chars.t_werase = tiop->c_cc[VWERASE]; +#endif + _rl_tty_chars.t_kill = tiop->c_cc[VKILL]; +#ifdef VREPRINT + _rl_tty_chars.t_reprint = tiop->c_cc[VREPRINT]; +#endif + _rl_intr_char = _rl_tty_chars.t_intr = tiop->c_cc[VINTR]; + _rl_quit_char = _rl_tty_chars.t_quit = tiop->c_cc[VQUIT]; +#ifdef VSUSP + _rl_susp_char = _rl_tty_chars.t_susp = tiop->c_cc[VSUSP]; +#endif +#ifdef VDSUSP + _rl_tty_chars.t_dsusp = tiop->c_cc[VDSUSP]; +#endif +#ifdef VSTART + _rl_tty_chars.t_start = tiop->c_cc[VSTART]; +#endif +#ifdef VSTOP + _rl_tty_chars.t_stop = tiop->c_cc[VSTOP]; +#endif +#ifdef VLNEXT + _rl_tty_chars.t_lnext = tiop->c_cc[VLNEXT]; +#endif +#ifdef VDISCARD + _rl_tty_chars.t_flush = tiop->c_cc[VDISCARD]; +#endif +#ifdef VSTATUS + _rl_tty_chars.t_status = tiop->c_cc[VSTATUS]; +#endif +} + +#if defined (_AIX) || defined (_AIX41) +/* Currently this is only used on AIX */ +static void +rltty_warning (msg) + char *msg; +{ + _rl_errmsg ("warning: %s", msg); +} +#endif + +#if defined (_AIX) +void +setopost(tp) +TIOTYPE *tp; +{ + if ((tp->c_oflag & OPOST) == 0) + { + _rl_errmsg ("warning: turning on OPOST for terminal\r"); + tp->c_oflag |= OPOST|ONLCR; + } +} +#endif + +static int +_get_tty_settings (tty, tiop) + int tty; + TIOTYPE *tiop; +{ + int ioctl_ret; + + while (1) + { + ioctl_ret = GETATTR (tty, tiop); + if (ioctl_ret < 0) + { + if (errno != EINTR) + return -1; + else + continue; + } + if (OUTPUT_BEING_FLUSHED (tiop)) + { +#if defined (FLUSHO) + _rl_errmsg ("warning: turning off output flushing"); + tiop->c_lflag &= ~FLUSHO; + break; +#else + continue; +#endif + } + break; + } + + return 0; +} + +static int +get_tty_settings (tty, tiop) + int tty; + TIOTYPE *tiop; +{ + set_winsize (tty); + + errno = 0; + if (_get_tty_settings (tty, tiop) < 0) + return -1; + +#if defined (_AIX) + setopost(tiop); +#endif + + return 0; +} + +static int +_set_tty_settings (tty, tiop) + int tty; + TIOTYPE *tiop; +{ + while (SETATTR (tty, tiop) < 0) + { + if (errno != EINTR) + return -1; + errno = 0; + } + return 0; +} + +static int +set_tty_settings (tty, tiop) + int tty; + TIOTYPE *tiop; +{ + if (_set_tty_settings (tty, tiop) < 0) + return -1; + +#if 0 + +#if defined (TERMIOS_TTY_DRIVER) +# if defined (__ksr1__) + if (ksrflow) + { + ksrflow = 0; + tcflow (tty, TCOON); + } +# else /* !ksr1 */ + tcflow (tty, TCOON); /* Simulate a ^Q. */ +# endif /* !ksr1 */ +#else + ioctl (tty, TCXONC, 1); /* Simulate a ^Q. */ +#endif /* !TERMIOS_TTY_DRIVER */ + +#endif /* 0 */ + + return 0; +} + +static void +prepare_terminal_settings (meta_flag, oldtio, tiop) + int meta_flag; + TIOTYPE oldtio, *tiop; +{ + _rl_echoing_p = (oldtio.c_lflag & ECHO); +#if defined (ECHOCTL) + _rl_echoctl = (oldtio.c_lflag & ECHOCTL); +#endif + + tiop->c_lflag &= ~(ICANON | ECHO); + + if ((unsigned char) oldtio.c_cc[VEOF] != (unsigned char) _POSIX_VDISABLE) + _rl_eof_char = oldtio.c_cc[VEOF]; + +#if defined (USE_XON_XOFF) +#if defined (IXANY) + tiop->c_iflag &= ~(IXON | IXANY); +#else + /* `strict' Posix systems do not define IXANY. */ + tiop->c_iflag &= ~IXON; +#endif /* IXANY */ +#endif /* USE_XON_XOFF */ + + /* Only turn this off if we are using all 8 bits. */ + if (((tiop->c_cflag & CSIZE) == CS8) || meta_flag) + tiop->c_iflag &= ~(ISTRIP | INPCK); + + /* Make sure we differentiate between CR and NL on input. */ + tiop->c_iflag &= ~(ICRNL | INLCR); + +#if !defined (HANDLE_SIGNALS) + tiop->c_lflag &= ~ISIG; +#else + tiop->c_lflag |= ISIG; +#endif + + tiop->c_cc[VMIN] = 1; + tiop->c_cc[VTIME] = 0; + +#if defined (FLUSHO) + if (OUTPUT_BEING_FLUSHED (tiop)) + { + tiop->c_lflag &= ~FLUSHO; + oldtio.c_lflag &= ~FLUSHO; + } +#endif + + /* Turn off characters that we need on Posix systems with job control, + just to be sure. This includes ^Y and ^V. This should not really + be necessary. */ +#if defined (TERMIOS_TTY_DRIVER) && defined (_POSIX_VDISABLE) + +#if defined (VLNEXT) + tiop->c_cc[VLNEXT] = _POSIX_VDISABLE; +#endif + +#if defined (VDSUSP) + tiop->c_cc[VDSUSP] = _POSIX_VDISABLE; +#endif + +#endif /* TERMIOS_TTY_DRIVER && _POSIX_VDISABLE */ +} +#endif /* !NEW_TTY_DRIVER */ + +/* Put the terminal in CBREAK mode so that we can detect key presses. */ +#if defined (NO_TTY_DRIVER) +void +rl_prep_terminal (meta_flag) + int meta_flag; +{ + _rl_echoing_p = 1; +} + +void +rl_deprep_terminal () +{ +} + +#else /* ! NO_TTY_DRIVER */ +void +rl_prep_terminal (meta_flag) + int meta_flag; +{ + int tty; + TIOTYPE tio; + + if (terminal_prepped) + return; + + /* Try to keep this function from being INTerrupted. */ + _rl_block_sigint (); + + tty = rl_instream ? fileno (rl_instream) : fileno (stdin); + + if (get_tty_settings (tty, &tio) < 0) + { +#if defined (ENOTSUP) + /* MacOS X and Linux, at least, lie about the value of errno if + tcgetattr fails. */ + if (errno == ENOTTY || errno == EINVAL || errno == ENOTSUP) +#else + if (errno == ENOTTY || errno == EINVAL) +#endif + _rl_echoing_p = 1; /* XXX */ + + _rl_release_sigint (); + return; + } + + otio = tio; + + if (_rl_bind_stty_chars) + { +#if defined (VI_MODE) + /* If editing in vi mode, make sure we restore the bindings in the + insertion keymap no matter what keymap we ended up in. */ + if (rl_editing_mode == vi_mode) + rl_tty_unset_default_bindings (vi_insertion_keymap); + else +#endif + rl_tty_unset_default_bindings (_rl_keymap); + } + save_tty_chars (&otio); + RL_SETSTATE(RL_STATE_TTYCSAVED); + if (_rl_bind_stty_chars) + { +#if defined (VI_MODE) + /* If editing in vi mode, make sure we set the bindings in the + insertion keymap no matter what keymap we ended up in. */ + if (rl_editing_mode == vi_mode) + _rl_bind_tty_special_chars (vi_insertion_keymap, tio); + else +#endif + _rl_bind_tty_special_chars (_rl_keymap, tio); + } + + prepare_terminal_settings (meta_flag, otio, &tio); + + if (set_tty_settings (tty, &tio) < 0) + { + _rl_release_sigint (); + return; + } + + if (_rl_enable_keypad) + _rl_control_keypad (1); + + fflush (rl_outstream); + terminal_prepped = 1; + RL_SETSTATE(RL_STATE_TERMPREPPED); + + _rl_release_sigint (); +} + +/* Restore the terminal's normal settings and modes. */ +void +rl_deprep_terminal () +{ + int tty; + + if (!terminal_prepped) + return; + + /* Try to keep this function from being interrupted. */ + _rl_block_sigint (); + + tty = rl_instream ? fileno (rl_instream) : fileno (stdin); + + if (_rl_enable_keypad) + _rl_control_keypad (0); + + fflush (rl_outstream); + + if (set_tty_settings (tty, &otio) < 0) + { + _rl_release_sigint (); + return; + } + + terminal_prepped = 0; + RL_UNSETSTATE(RL_STATE_TERMPREPPED); + + _rl_release_sigint (); +} +#endif /* !NO_TTY_DRIVER */ + +/* **************************************************************** */ +/* */ +/* Bogus Flow Control */ +/* */ +/* **************************************************************** */ + +int +rl_restart_output (count, key) + int count, key; +{ +#if defined (__MINGW32__) + return 0; +#else /* !__MING32__ */ + + int fildes = fileno (rl_outstream); +#if defined (TIOCSTART) +#if defined (apollo) + ioctl (&fildes, TIOCSTART, 0); +#else + ioctl (fildes, TIOCSTART, 0); +#endif /* apollo */ + +#else /* !TIOCSTART */ +# if defined (TERMIOS_TTY_DRIVER) +# if defined (__ksr1__) + if (ksrflow) + { + ksrflow = 0; + tcflow (fildes, TCOON); + } +# else /* !ksr1 */ + tcflow (fildes, TCOON); /* Simulate a ^Q. */ +# endif /* !ksr1 */ +# else /* !TERMIOS_TTY_DRIVER */ +# if defined (TCXONC) + ioctl (fildes, TCXONC, TCOON); +# endif /* TCXONC */ +# endif /* !TERMIOS_TTY_DRIVER */ +#endif /* !TIOCSTART */ + + return 0; +#endif /* !__MINGW32__ */ +} + +int +rl_stop_output (count, key) + int count, key; +{ +#if defined (__MINGW32__) + return 0; +#else + + int fildes = fileno (rl_instream); + +#if defined (TIOCSTOP) +# if defined (apollo) + ioctl (&fildes, TIOCSTOP, 0); +# else + ioctl (fildes, TIOCSTOP, 0); +# endif /* apollo */ +#else /* !TIOCSTOP */ +# if defined (TERMIOS_TTY_DRIVER) +# if defined (__ksr1__) + ksrflow = 1; +# endif /* ksr1 */ + tcflow (fildes, TCOOFF); +# else +# if defined (TCXONC) + ioctl (fildes, TCXONC, TCOON); +# endif /* TCXONC */ +# endif /* !TERMIOS_TTY_DRIVER */ +#endif /* !TIOCSTOP */ + + return 0; +#endif /* !__MINGW32__ */ +} + +/* **************************************************************** */ +/* */ +/* Default Key Bindings */ +/* */ +/* **************************************************************** */ + +#if !defined (NO_TTY_DRIVER) +#define SET_SPECIAL(sc, func) set_special_char(kmap, &ttybuff, sc, func) +#endif + +#if defined (NO_TTY_DRIVER) + +#define SET_SPECIAL(sc, func) +#define RESET_SPECIAL(c) + +#elif defined (NEW_TTY_DRIVER) +static void +set_special_char (kmap, tiop, sc, func) + Keymap kmap; + TIOTYPE *tiop; + int sc; + rl_command_func_t *func; +{ + if (sc != -1 && kmap[(unsigned char)sc].type == ISFUNC) + kmap[(unsigned char)sc].function = func; +} + +#define RESET_SPECIAL(c) \ + if (c != -1 && kmap[(unsigned char)c].type == ISFUNC) \ + kmap[(unsigned char)c].function = rl_insert; + +static void +_rl_bind_tty_special_chars (kmap, ttybuff) + Keymap kmap; + TIOTYPE ttybuff; +{ + if (ttybuff.flags & SGTTY_SET) + { + SET_SPECIAL (ttybuff.sgttyb.sg_erase, rl_rubout); + SET_SPECIAL (ttybuff.sgttyb.sg_kill, rl_unix_line_discard); + } + +# if defined (TIOCGLTC) + if (ttybuff.flags & LTCHARS_SET) + { + SET_SPECIAL (ttybuff.ltchars.t_werasc, rl_unix_word_rubout); + SET_SPECIAL (ttybuff.ltchars.t_lnextc, rl_quoted_insert); + } +# endif /* TIOCGLTC */ +} + +#else /* !NEW_TTY_DRIVER */ +static void +set_special_char (kmap, tiop, sc, func) + Keymap kmap; + TIOTYPE *tiop; + int sc; + rl_command_func_t *func; +{ + unsigned char uc; + + uc = tiop->c_cc[sc]; + if (uc != (unsigned char)_POSIX_VDISABLE && kmap[uc].type == ISFUNC) + kmap[uc].function = func; +} + +/* used later */ +#define RESET_SPECIAL(uc) \ + if (uc != (unsigned char)_POSIX_VDISABLE && kmap[uc].type == ISFUNC) \ + kmap[uc].function = rl_insert; + +static void +_rl_bind_tty_special_chars (kmap, ttybuff) + Keymap kmap; + TIOTYPE ttybuff; +{ + SET_SPECIAL (VERASE, rl_rubout); + SET_SPECIAL (VKILL, rl_unix_line_discard); + +# if defined (VLNEXT) && defined (TERMIOS_TTY_DRIVER) + SET_SPECIAL (VLNEXT, rl_quoted_insert); +# endif /* VLNEXT && TERMIOS_TTY_DRIVER */ + +# if defined (VWERASE) && defined (TERMIOS_TTY_DRIVER) + SET_SPECIAL (VWERASE, rl_unix_word_rubout); +# endif /* VWERASE && TERMIOS_TTY_DRIVER */ +} + +#endif /* !NEW_TTY_DRIVER */ + +/* Set the system's default editing characters to their readline equivalents + in KMAP. Should be static, now that we have rl_tty_set_default_bindings. */ +void +rltty_set_default_bindings (kmap) + Keymap kmap; +{ +#if !defined (NO_TTY_DRIVER) + TIOTYPE ttybuff; + int tty; + + tty = fileno (rl_instream); + + if (get_tty_settings (tty, &ttybuff) == 0) + _rl_bind_tty_special_chars (kmap, ttybuff); +#endif +} + +/* New public way to set the system default editing chars to their readline + equivalents. */ +void +rl_tty_set_default_bindings (kmap) + Keymap kmap; +{ + rltty_set_default_bindings (kmap); +} + +/* Rebind all of the tty special chars that readline worries about back + to self-insert. Call this before saving the current terminal special + chars with save_tty_chars(). This only works on POSIX termios or termio + systems. */ +void +rl_tty_unset_default_bindings (kmap) + Keymap kmap; +{ + /* Don't bother before we've saved the tty special chars at least once. */ + if (RL_ISSTATE(RL_STATE_TTYCSAVED) == 0) + return; + + RESET_SPECIAL (_rl_tty_chars.t_erase); + RESET_SPECIAL (_rl_tty_chars.t_kill); + +# if defined (VLNEXT) && defined (TERMIOS_TTY_DRIVER) + RESET_SPECIAL (_rl_tty_chars.t_lnext); +# endif /* VLNEXT && TERMIOS_TTY_DRIVER */ + +# if defined (VWERASE) && defined (TERMIOS_TTY_DRIVER) + RESET_SPECIAL (_rl_tty_chars.t_werase); +# endif /* VWERASE && TERMIOS_TTY_DRIVER */ +} + +#if defined (HANDLE_SIGNALS) + +#if defined (NEW_TTY_DRIVER) || defined (NO_TTY_DRIVER) +int +_rl_disable_tty_signals () +{ + return 0; +} + +int +_rl_restore_tty_signals () +{ + return 0; +} +#else + +static TIOTYPE sigstty, nosigstty; +static int tty_sigs_disabled = 0; + +int +_rl_disable_tty_signals () +{ + if (tty_sigs_disabled) + return 0; + + if (_get_tty_settings (fileno (rl_instream), &sigstty) < 0) + return -1; + + nosigstty = sigstty; + + nosigstty.c_lflag &= ~ISIG; + nosigstty.c_iflag &= ~IXON; + + if (_set_tty_settings (fileno (rl_instream), &nosigstty) < 0) + return (_set_tty_settings (fileno (rl_instream), &sigstty)); + + tty_sigs_disabled = 1; + return 0; +} + +int +_rl_restore_tty_signals () +{ + int r; + + if (tty_sigs_disabled == 0) + return 0; + + r = _set_tty_settings (fileno (rl_instream), &sigstty); + + if (r == 0) + tty_sigs_disabled = 0; + + return r; +} +#endif /* !NEW_TTY_DRIVER */ + +#endif /* HANDLE_SIGNALS */ diff --git a/lib/readline/rltty.h b/lib/readline/rltty.h new file mode 100644 index 0000000..5bcc946 --- /dev/null +++ b/lib/readline/rltty.h @@ -0,0 +1,80 @@ +/* rltty.h - tty driver-related definitions used by some library files. */ + +/* Copyright (C) 1995-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if !defined (_RLTTY_H_) +#define _RLTTY_H_ + +/* Posix systems use termios and the Posix signal functions. */ +#if defined (TERMIOS_TTY_DRIVER) +# include +#endif /* TERMIOS_TTY_DRIVER */ + +/* System V machines use termio. */ +#if defined (TERMIO_TTY_DRIVER) +# include +# if !defined (TCOON) +# define TCOON 1 +# endif +#endif /* TERMIO_TTY_DRIVER */ + +/* Other (BSD) machines use sgtty. */ +#if defined (NEW_TTY_DRIVER) +# include +#endif + +#include "rlwinsize.h" + +/* Define _POSIX_VDISABLE if we are not using the `new' tty driver and + it is not already defined. It is used both to determine if a + special character is disabled and to disable certain special + characters. Posix systems should set to 0, USG systems to -1. */ +#if !defined (NEW_TTY_DRIVER) && !defined (_POSIX_VDISABLE) +# if defined (_SVR4_VDISABLE) +# define _POSIX_VDISABLE _SVR4_VDISABLE +# else +# if defined (_POSIX_VERSION) +# define _POSIX_VDISABLE 0 +# else /* !_POSIX_VERSION */ +# define _POSIX_VDISABLE -1 +# endif /* !_POSIX_VERSION */ +# endif /* !_SVR4_DISABLE */ +#endif /* !NEW_TTY_DRIVER && !_POSIX_VDISABLE */ + +typedef struct _rl_tty_chars { + unsigned char t_eof; + unsigned char t_eol; + unsigned char t_eol2; + unsigned char t_erase; + unsigned char t_werase; + unsigned char t_kill; + unsigned char t_reprint; + unsigned char t_intr; + unsigned char t_quit; + unsigned char t_susp; + unsigned char t_dsusp; + unsigned char t_start; + unsigned char t_stop; + unsigned char t_lnext; + unsigned char t_flush; + unsigned char t_status; +} _RL_TTY_CHARS; + +#endif /* _RLTTY_H_ */ diff --git a/lib/readline/rltypedefs.h b/lib/readline/rltypedefs.h new file mode 100644 index 0000000..b113ee6 --- /dev/null +++ b/lib/readline/rltypedefs.h @@ -0,0 +1,81 @@ +/* rltypedefs.h -- Type declarations for readline functions. */ + +/* Copyright (C) 2000-2011 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#ifndef _RL_TYPEDEFS_H_ +#define _RL_TYPEDEFS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* New style. */ + +#if !defined (_RL_FUNCTION_TYPEDEF) +# define _RL_FUNCTION_TYPEDEF + +/* Bindable functions */ +typedef int rl_command_func_t PARAMS((int, int)); + +/* Typedefs for the completion system */ +typedef char *rl_compentry_func_t PARAMS((const char *, int)); +typedef char **rl_completion_func_t PARAMS((const char *, int, int)); + +typedef char *rl_quote_func_t PARAMS((char *, int, char *)); +typedef char *rl_dequote_func_t PARAMS((char *, int)); + +typedef int rl_compignore_func_t PARAMS((char **)); + +typedef void rl_compdisp_func_t PARAMS((char **, int, int)); + +/* Type for input and pre-read hook functions like rl_event_hook */ +typedef int rl_hook_func_t PARAMS((void)); + +/* Input function type */ +typedef int rl_getc_func_t PARAMS((FILE *)); + +/* Generic function that takes a character buffer (which could be the readline + line buffer) and an index into it (which could be rl_point) and returns + an int. */ +typedef int rl_linebuf_func_t PARAMS((char *, int)); + +/* `Generic' function pointer typedefs */ +typedef int rl_intfunc_t PARAMS((int)); +#define rl_ivoidfunc_t rl_hook_func_t +typedef int rl_icpfunc_t PARAMS((char *)); +typedef int rl_icppfunc_t PARAMS((char **)); + +typedef void rl_voidfunc_t PARAMS((void)); +typedef void rl_vintfunc_t PARAMS((int)); +typedef void rl_vcpfunc_t PARAMS((char *)); +typedef void rl_vcppfunc_t PARAMS((char **)); + +typedef char *rl_cpvfunc_t PARAMS((void)); +typedef char *rl_cpifunc_t PARAMS((int)); +typedef char *rl_cpcpfunc_t PARAMS((char *)); +typedef char *rl_cpcppfunc_t PARAMS((char **)); + +#endif /* _RL_FUNCTION_TYPEDEF */ + +#ifdef __cplusplus +} +#endif + +#endif /* _RL_TYPEDEFS_H_ */ diff --git a/lib/readline/rlwinsize.h b/lib/readline/rlwinsize.h new file mode 100644 index 0000000..d198fcf --- /dev/null +++ b/lib/readline/rlwinsize.h @@ -0,0 +1,58 @@ +/* rlwinsize.h -- an attempt to isolate some of the system-specific defines + for `struct winsize' and TIOCGWINSZ. */ + +/* Copyright (C) 1997-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if !defined (_RLWINSIZE_H_) +#define _RLWINSIZE_H_ + +#if defined (HAVE_CONFIG_H) +# include "config.h" +#endif + +/* Try to find the definitions of `struct winsize' and TIOGCWINSZ */ + +#if defined (GWINSZ_IN_SYS_IOCTL) && !defined (TIOCGWINSZ) +# include +#endif /* GWINSZ_IN_SYS_IOCTL && !TIOCGWINSZ */ + +#if defined (STRUCT_WINSIZE_IN_TERMIOS) && !defined (STRUCT_WINSIZE_IN_SYS_IOCTL) +# include +#endif /* STRUCT_WINSIZE_IN_TERMIOS && !STRUCT_WINSIZE_IN_SYS_IOCTL */ + +/* Not in either of the standard places, look around. */ +#if !defined (STRUCT_WINSIZE_IN_TERMIOS) && !defined (STRUCT_WINSIZE_IN_SYS_IOCTL) +# if defined (HAVE_SYS_STREAM_H) +# include +# endif /* HAVE_SYS_STREAM_H */ +# if defined (HAVE_SYS_PTEM_H) /* SVR4.2, at least, has it here */ +# include +# define _IO_PTEM_H /* work around SVR4.2 1.1.4 bug */ +# endif /* HAVE_SYS_PTEM_H */ +# if defined (HAVE_SYS_PTE_H) /* ??? */ +# include +# endif /* HAVE_SYS_PTE_H */ +#endif /* !STRUCT_WINSIZE_IN_TERMIOS && !STRUCT_WINSIZE_IN_SYS_IOCTL */ + +#if defined (M_UNIX) && !defined (_SCO_DS) && !defined (tcflow) +# define tcflow(fd, action) ioctl(fd, TCXONC, action) +#endif + +#endif /* _RL_WINSIZE_H */ diff --git a/lib/readline/savestring.c b/lib/readline/savestring.c new file mode 100644 index 0000000..af98538 --- /dev/null +++ b/lib/readline/savestring.c @@ -0,0 +1,41 @@ +/* savestring.c - function version of savestring for backwards compatibility */ + +/* Copyright (C) 1998,2003 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#include +#ifdef HAVE_STRING_H +# include +#endif +#include "xmalloc.h" + +/* Backwards compatibility, now that savestring has been removed from + all `public' readline header files. */ +char * +savestring (s) + const char *s; +{ + char *ret; + + ret = (char *)xmalloc (strlen (s) + 1); + strcpy (ret, s); + return ret; +} diff --git a/lib/readline/search.c b/lib/readline/search.c new file mode 100644 index 0000000..028c250 --- /dev/null +++ b/lib/readline/search.c @@ -0,0 +1,631 @@ +/* search.c - code for non-incremental searching in emacs and vi modes. */ + +/* Copyright (C) 1992-2013 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif + +#include "rldefs.h" +#include "rlmbutil.h" + +#include "readline.h" +#include "history.h" +#include "histlib.h" + +#include "rlprivate.h" +#include "xmalloc.h" + +#ifdef abs +# undef abs +#endif +#define abs(x) (((x) >= 0) ? (x) : -(x)) + +_rl_search_cxt *_rl_nscxt = 0; + +extern HIST_ENTRY *_rl_saved_line_for_history; + +/* Functions imported from the rest of the library. */ +extern int _rl_free_history_entry PARAMS((HIST_ENTRY *)); + +static char *noninc_search_string = (char *) NULL; +static int noninc_history_pos; + +static char *prev_line_found = (char *) NULL; + +static int rl_history_search_len; +static int rl_history_search_pos; +static int rl_history_search_flags; + +static char *history_search_string; +static int history_string_size; + +static void make_history_line_current PARAMS((HIST_ENTRY *)); +static int noninc_search_from_pos PARAMS((char *, int, int)); +static int noninc_dosearch PARAMS((char *, int)); +static int noninc_search PARAMS((int, int)); +static int rl_history_search_internal PARAMS((int, int)); +static void rl_history_search_reinit PARAMS((int)); + +static _rl_search_cxt *_rl_nsearch_init PARAMS((int, int)); +static int _rl_nsearch_cleanup PARAMS((_rl_search_cxt *, int)); +static void _rl_nsearch_abort PARAMS((_rl_search_cxt *)); +static int _rl_nsearch_dispatch PARAMS((_rl_search_cxt *, int)); + +/* Make the data from the history entry ENTRY be the contents of the + current line. This doesn't do anything with rl_point; the caller + must set it. */ +static void +make_history_line_current (entry) + HIST_ENTRY *entry; +{ + _rl_replace_text (entry->line, 0, rl_end); + _rl_fix_point (1); +#if defined (VI_MODE) + if (rl_editing_mode == vi_mode) + /* POSIX.2 says that the `U' command doesn't affect the copy of any + command lines to the edit line. We're going to implement that by + making the undo list start after the matching line is copied to the + current editing buffer. */ + rl_free_undo_list (); +#endif + + if (_rl_saved_line_for_history) + _rl_free_history_entry (_rl_saved_line_for_history); + _rl_saved_line_for_history = (HIST_ENTRY *)NULL; +} + +/* Search the history list for STRING starting at absolute history position + POS. If STRING begins with `^', the search must match STRING at the + beginning of a history line, otherwise a full substring match is performed + for STRING. DIR < 0 means to search backwards through the history list, + DIR >= 0 means to search forward. */ +static int +noninc_search_from_pos (string, pos, dir) + char *string; + int pos, dir; +{ + int ret, old; + + if (pos < 0) + return -1; + + old = where_history (); + if (history_set_pos (pos) == 0) + return -1; + + RL_SETSTATE(RL_STATE_SEARCH); + if (*string == '^') + ret = history_search_prefix (string + 1, dir); + else + ret = history_search (string, dir); + RL_UNSETSTATE(RL_STATE_SEARCH); + + if (ret != -1) + ret = where_history (); + + history_set_pos (old); + return (ret); +} + +/* Search for a line in the history containing STRING. If DIR is < 0, the + search is backwards through previous entries, else through subsequent + entries. Returns 1 if the search was successful, 0 otherwise. */ +static int +noninc_dosearch (string, dir) + char *string; + int dir; +{ + int oldpos, pos; + HIST_ENTRY *entry; + + if (string == 0 || *string == '\0' || noninc_history_pos < 0) + { + rl_ding (); + return 0; + } + + pos = noninc_search_from_pos (string, noninc_history_pos + dir, dir); + if (pos == -1) + { + /* Search failed, current history position unchanged. */ + rl_maybe_unsave_line (); + rl_clear_message (); + rl_point = 0; + rl_ding (); + return 0; + } + + noninc_history_pos = pos; + + oldpos = where_history (); + history_set_pos (noninc_history_pos); + entry = current_history (); /* will never be NULL after successful search */ + +#if defined (VI_MODE) + if (rl_editing_mode != vi_mode) +#endif + history_set_pos (oldpos); + + make_history_line_current (entry); + + rl_point = 0; + rl_mark = rl_end; + + rl_clear_message (); + return 1; +} + +static _rl_search_cxt * +_rl_nsearch_init (dir, pchar) + int dir, pchar; +{ + _rl_search_cxt *cxt; + char *p; + + cxt = _rl_scxt_alloc (RL_SEARCH_NSEARCH, 0); + if (dir < 0) + cxt->sflags |= SF_REVERSE; /* not strictly needed */ + + cxt->direction = dir; + cxt->history_pos = cxt->save_line; + + rl_maybe_save_line (); + + /* Clear the undo list, since reading the search string should create its + own undo list, and the whole list will end up being freed when we + finish reading the search string. */ + rl_undo_list = 0; + + /* Use the line buffer to read the search string. */ + rl_line_buffer[0] = 0; + rl_end = rl_point = 0; + + p = _rl_make_prompt_for_search (pchar ? pchar : ':'); + rl_message ("%s", p); + xfree (p); + + RL_SETSTATE(RL_STATE_NSEARCH); + + _rl_nscxt = cxt; + + return cxt; +} + +static int +_rl_nsearch_cleanup (cxt, r) + _rl_search_cxt *cxt; + int r; +{ + _rl_scxt_dispose (cxt, 0); + _rl_nscxt = 0; + + RL_UNSETSTATE(RL_STATE_NSEARCH); + + return (r != 1); +} + +static void +_rl_nsearch_abort (cxt) + _rl_search_cxt *cxt; +{ + rl_maybe_unsave_line (); + rl_clear_message (); + rl_point = cxt->save_point; + rl_mark = cxt->save_mark; + rl_restore_prompt (); + + RL_UNSETSTATE (RL_STATE_NSEARCH); +} + +/* Process just-read character C according to search context CXT. Return -1 + if the caller should abort the search, 0 if we should break out of the + loop, and 1 if we should continue to read characters. */ +static int +_rl_nsearch_dispatch (cxt, c) + _rl_search_cxt *cxt; + int c; +{ + switch (c) + { + case CTRL('W'): + rl_unix_word_rubout (1, c); + break; + + case CTRL('U'): + rl_unix_line_discard (1, c); + break; + + case RETURN: + case NEWLINE: + return 0; + + case CTRL('H'): + case RUBOUT: + if (rl_point == 0) + { + _rl_nsearch_abort (cxt); + return -1; + } + _rl_rubout_char (1, c); + break; + + case CTRL('C'): + case CTRL('G'): + rl_ding (); + _rl_nsearch_abort (cxt); + return -1; + + default: +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + rl_insert_text (cxt->mb); + else +#endif + _rl_insert_char (1, c); + break; + } + + (*rl_redisplay_function) (); + return 1; +} + +/* Perform one search according to CXT, using NONINC_SEARCH_STRING. Return + -1 if the search should be aborted, any other value means to clean up + using _rl_nsearch_cleanup (). Returns 1 if the search was successful, + 0 otherwise. */ +static int +_rl_nsearch_dosearch (cxt) + _rl_search_cxt *cxt; +{ + rl_mark = cxt->save_mark; + + /* If rl_point == 0, we want to re-use the previous search string and + start from the saved history position. If there's no previous search + string, punt. */ + if (rl_point == 0) + { + if (noninc_search_string == 0) + { + rl_ding (); + rl_restore_prompt (); + RL_UNSETSTATE (RL_STATE_NSEARCH); + return -1; + } + } + else + { + /* We want to start the search from the current history position. */ + noninc_history_pos = cxt->save_line; + FREE (noninc_search_string); + noninc_search_string = savestring (rl_line_buffer); + + /* If we don't want the subsequent undo list generated by the search + matching a history line to include the contents of the search string, + we need to clear rl_line_buffer here. For now, we just clear the + undo list generated by reading the search string. (If the search + fails, the old undo list will be restored by rl_maybe_unsave_line.) */ + rl_free_undo_list (); + } + + rl_restore_prompt (); + return (noninc_dosearch (noninc_search_string, cxt->direction)); +} + +/* Search non-interactively through the history list. DIR < 0 means to + search backwards through the history of previous commands; otherwise + the search is for commands subsequent to the current position in the + history list. PCHAR is the character to use for prompting when reading + the search string; if not specified (0), it defaults to `:'. */ +static int +noninc_search (dir, pchar) + int dir; + int pchar; +{ + _rl_search_cxt *cxt; + int c, r; + + cxt = _rl_nsearch_init (dir, pchar); + + if (RL_ISSTATE (RL_STATE_CALLBACK)) + return (0); + + /* Read the search string. */ + r = 0; + while (1) + { + c = _rl_search_getchar (cxt); + + if (c == 0) + break; + + r = _rl_nsearch_dispatch (cxt, c); + if (r < 0) + return 1; + else if (r == 0) + break; + } + + r = _rl_nsearch_dosearch (cxt); + return ((r >= 0) ? _rl_nsearch_cleanup (cxt, r) : (r != 1)); +} + +/* Search forward through the history list for a string. If the vi-mode + code calls this, KEY will be `?'. */ +int +rl_noninc_forward_search (count, key) + int count, key; +{ + return noninc_search (1, (key == '?') ? '?' : 0); +} + +/* Reverse search the history list for a string. If the vi-mode code + calls this, KEY will be `/'. */ +int +rl_noninc_reverse_search (count, key) + int count, key; +{ + return noninc_search (-1, (key == '/') ? '/' : 0); +} + +/* Search forward through the history list for the last string searched + for. If there is no saved search string, abort. */ +int +rl_noninc_forward_search_again (count, key) + int count, key; +{ + int r; + + if (!noninc_search_string) + { + rl_ding (); + return (-1); + } + r = noninc_dosearch (noninc_search_string, 1); + return (r != 1); +} + +/* Reverse search in the history list for the last string searched + for. If there is no saved search string, abort. */ +int +rl_noninc_reverse_search_again (count, key) + int count, key; +{ + int r; + + if (!noninc_search_string) + { + rl_ding (); + return (-1); + } + r = noninc_dosearch (noninc_search_string, -1); + return (r != 1); +} + +#if defined (READLINE_CALLBACKS) +int +_rl_nsearch_callback (cxt) + _rl_search_cxt *cxt; +{ + int c, r; + + c = _rl_search_getchar (cxt); + r = _rl_nsearch_dispatch (cxt, c); + if (r != 0) + return 1; + + r = _rl_nsearch_dosearch (cxt); + return ((r >= 0) ? _rl_nsearch_cleanup (cxt, r) : (r != 1)); +} +#endif + +static int +rl_history_search_internal (count, dir) + int count, dir; +{ + HIST_ENTRY *temp; + int ret, oldpos; + char *t; + + rl_maybe_save_line (); + temp = (HIST_ENTRY *)NULL; + + /* Search COUNT times through the history for a line matching + history_search_string. If history_search_string[0] == '^', the + line must match from the start; otherwise any substring can match. + When this loop finishes, TEMP, if non-null, is the history line to + copy into the line buffer. */ + while (count) + { + RL_CHECK_SIGNALS (); + ret = noninc_search_from_pos (history_search_string, rl_history_search_pos + dir, dir); + if (ret == -1) + break; + + /* Get the history entry we found. */ + rl_history_search_pos = ret; + oldpos = where_history (); + history_set_pos (rl_history_search_pos); + temp = current_history (); /* will never be NULL after successful search */ + history_set_pos (oldpos); + + /* Don't find multiple instances of the same line. */ + if (prev_line_found && STREQ (prev_line_found, temp->line)) + continue; + prev_line_found = temp->line; + count--; + } + + /* If we didn't find anything at all, return. */ + if (temp == 0) + { + rl_maybe_unsave_line (); + rl_ding (); + /* If you don't want the saved history line (last match) to show up + in the line buffer after the search fails, change the #if 0 to + #if 1 */ +#if 0 + if (rl_point > rl_history_search_len) + { + rl_point = rl_end = rl_history_search_len; + rl_line_buffer[rl_end] = '\0'; + rl_mark = 0; + } +#else + rl_point = rl_history_search_len; /* rl_maybe_unsave_line changes it */ + rl_mark = rl_end; +#endif + return 1; + } + + /* Copy the line we found into the current line buffer. */ + make_history_line_current (temp); + + if (rl_history_search_flags & ANCHORED_SEARCH) + rl_point = rl_history_search_len; /* easy case */ + else + { + t = strstr (rl_line_buffer, history_search_string); + rl_point = t ? (int)(t - rl_line_buffer) + rl_history_search_len : rl_end; + } + rl_mark = rl_end; + + return 0; +} + +static void +rl_history_search_reinit (flags) + int flags; +{ + int sind; + + rl_history_search_pos = where_history (); + rl_history_search_len = rl_point; + rl_history_search_flags = flags; + + prev_line_found = (char *)NULL; + if (rl_point) + { + /* Allocate enough space for anchored and non-anchored searches */ + if (rl_history_search_len >= history_string_size - 2) + { + history_string_size = rl_history_search_len + 2; + history_search_string = (char *)xrealloc (history_search_string, history_string_size); + } + sind = 0; + if (flags & ANCHORED_SEARCH) + history_search_string[sind++] = '^'; + strncpy (history_search_string + sind, rl_line_buffer, rl_point); + history_search_string[rl_point + sind] = '\0'; + } + _rl_free_saved_history_line (); +} + +/* Search forward in the history for the string of characters + from the start of the line to rl_point. This is a non-incremental + search. The search is anchored to the beginning of the history line. */ +int +rl_history_search_forward (count, ignore) + int count, ignore; +{ + if (count == 0) + return (0); + + if (rl_last_func != rl_history_search_forward && + rl_last_func != rl_history_search_backward) + rl_history_search_reinit (ANCHORED_SEARCH); + + if (rl_history_search_len == 0) + return (rl_get_next_history (count, ignore)); + return (rl_history_search_internal (abs (count), (count > 0) ? 1 : -1)); +} + +/* Search backward through the history for the string of characters + from the start of the line to rl_point. This is a non-incremental + search. */ +int +rl_history_search_backward (count, ignore) + int count, ignore; +{ + if (count == 0) + return (0); + + if (rl_last_func != rl_history_search_forward && + rl_last_func != rl_history_search_backward) + rl_history_search_reinit (ANCHORED_SEARCH); + + if (rl_history_search_len == 0) + return (rl_get_previous_history (count, ignore)); + return (rl_history_search_internal (abs (count), (count > 0) ? -1 : 1)); +} + +/* Search forward in the history for the string of characters + from the start of the line to rl_point. This is a non-incremental + search. The search succeeds if the search string is present anywhere + in the history line. */ +int +rl_history_substr_search_forward (count, ignore) + int count, ignore; +{ + if (count == 0) + return (0); + + if (rl_last_func != rl_history_substr_search_forward && + rl_last_func != rl_history_substr_search_backward) + rl_history_search_reinit (NON_ANCHORED_SEARCH); + + if (rl_history_search_len == 0) + return (rl_get_next_history (count, ignore)); + return (rl_history_search_internal (abs (count), (count > 0) ? 1 : -1)); +} + +/* Search backward through the history for the string of characters + from the start of the line to rl_point. This is a non-incremental + search. */ +int +rl_history_substr_search_backward (count, ignore) + int count, ignore; +{ + if (count == 0) + return (0); + + if (rl_last_func != rl_history_substr_search_forward && + rl_last_func != rl_history_substr_search_backward) + rl_history_search_reinit (NON_ANCHORED_SEARCH); + + if (rl_history_search_len == 0) + return (rl_get_previous_history (count, ignore)); + return (rl_history_search_internal (abs (count), (count > 0) ? -1 : 1)); +} diff --git a/lib/readline/shell.c b/lib/readline/shell.c new file mode 100644 index 0000000..6947295 --- /dev/null +++ b/lib/readline/shell.c @@ -0,0 +1,218 @@ +/* shell.c -- readline utility functions that are normally provided by + bash when readline is linked as part of the shell. */ + +/* Copyright (C) 1997-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif /* HAVE_UNISTD_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#if defined (HAVE_STRING_H) +# include +#else +# include +#endif /* !HAVE_STRING_H */ + +#if defined (HAVE_LIMITS_H) +# include +#endif + +#if defined (HAVE_FCNTL_H) +#include +#endif +#if defined (HAVE_PWD_H) +#include +#endif + +#include + +#include "rlstdc.h" +#include "rlshell.h" +#include "rldefs.h" + +#include "xmalloc.h" + +#if defined (HAVE_GETPWUID) && !defined (HAVE_GETPW_DECLS) +extern struct passwd *getpwuid PARAMS((uid_t)); +#endif /* HAVE_GETPWUID && !HAVE_GETPW_DECLS */ + +#ifndef NULL +# define NULL 0 +#endif + +#ifndef CHAR_BIT +# define CHAR_BIT 8 +#endif + +/* Nonzero if the integer type T is signed. */ +#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) + +/* Bound on length of the string representing an integer value of type T. + Subtract one for the sign bit if T is signed; + 302 / 1000 is log10 (2) rounded up; + add one for integer division truncation; + add one more for a minus sign if t is signed. */ +#define INT_STRLEN_BOUND(t) \ + ((sizeof (t) * CHAR_BIT - TYPE_SIGNED (t)) * 302 / 1000 \ + + 1 + TYPE_SIGNED (t)) + +/* All of these functions are resolved from bash if we are linking readline + as part of bash. */ + +/* Does shell-like quoting using single quotes. */ +char * +sh_single_quote (string) + char *string; +{ + register int c; + char *result, *r, *s; + + result = (char *)xmalloc (3 + (4 * strlen (string))); + r = result; + *r++ = '\''; + + for (s = string; s && (c = *s); s++) + { + *r++ = c; + + if (c == '\'') + { + *r++ = '\\'; /* insert escaped single quote */ + *r++ = '\''; + *r++ = '\''; /* start new quoted string */ + } + } + + *r++ = '\''; + *r = '\0'; + + return (result); +} + +/* Set the environment variables LINES and COLUMNS to lines and cols, + respectively. */ +static char setenv_buf[INT_STRLEN_BOUND (int) + 1]; +static char putenv_buf1[INT_STRLEN_BOUND (int) + 6 + 1]; /* sizeof("LINES=") == 6 */ +static char putenv_buf2[INT_STRLEN_BOUND (int) + 8 + 1]; /* sizeof("COLUMNS=") == 8 */ + +void +sh_set_lines_and_columns (lines, cols) + int lines, cols; +{ +#if defined (HAVE_SETENV) + sprintf (setenv_buf, "%d", lines); + setenv ("LINES", setenv_buf, 1); + + sprintf (setenv_buf, "%d", cols); + setenv ("COLUMNS", setenv_buf, 1); +#else /* !HAVE_SETENV */ +# if defined (HAVE_PUTENV) + sprintf (putenv_buf1, "LINES=%d", lines); + putenv (putenv_buf1); + + sprintf (putenv_buf2, "COLUMNS=%d", cols); + putenv (putenv_buf2); +# endif /* HAVE_PUTENV */ +#endif /* !HAVE_SETENV */ +} + +char * +sh_get_env_value (varname) + const char *varname; +{ + return ((char *)getenv (varname)); +} + +char * +sh_get_home_dir () +{ + static char *home_dir = (char *)NULL; + struct passwd *entry; + + if (home_dir) + return (home_dir); + + home_dir = (char *)NULL; +#if defined (HAVE_GETPWUID) +# if defined (__TANDEM) + entry = getpwnam (getlogin ()); +# else + entry = getpwuid (getuid ()); +# endif + if (entry) + home_dir = savestring (entry->pw_dir); +#endif + +#if defined (HAVE_GETPWENT) + endpwent (); /* some systems need this */ +#endif + + return (home_dir); +} + +#if !defined (O_NDELAY) +# if defined (FNDELAY) +# define O_NDELAY FNDELAY +# endif +#endif + +int +sh_unset_nodelay_mode (fd) + int fd; +{ +#if defined (HAVE_FCNTL) + int flags, bflags; + + if ((flags = fcntl (fd, F_GETFL, 0)) < 0) + return -1; + + bflags = 0; + +#ifdef O_NONBLOCK + bflags |= O_NONBLOCK; +#endif + +#ifdef O_NDELAY + bflags |= O_NDELAY; +#endif + + if (flags & bflags) + { + flags &= ~bflags; + return (fcntl (fd, F_SETFL, flags)); + } +#endif + + return 0; +} diff --git a/lib/readline/signals.c b/lib/readline/signals.c new file mode 100644 index 0000000..61f02f9 --- /dev/null +++ b/lib/readline/signals.c @@ -0,0 +1,709 @@ +/* signals.c -- signal handling support for readline. */ + +/* Copyright (C) 1987-2011 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include /* Just for NULL. Yuck. */ +#include +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif /* HAVE_UNISTD_H */ + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" + +#if defined (GWINSZ_IN_SYS_IOCTL) +# include +#endif /* GWINSZ_IN_SYS_IOCTL */ + +/* Some standard library routines. */ +#include "readline.h" +#include "history.h" + +#include "rlprivate.h" + +#if defined (HANDLE_SIGNALS) + +#if !defined (RETSIGTYPE) +# if defined (VOID_SIGHANDLER) +# define RETSIGTYPE void +# else +# define RETSIGTYPE int +# endif /* !VOID_SIGHANDLER */ +#endif /* !RETSIGTYPE */ + +#if defined (VOID_SIGHANDLER) +# define SIGHANDLER_RETURN return +#else +# define SIGHANDLER_RETURN return (0) +#endif + +/* This typedef is equivalent to the one for Function; it allows us + to say SigHandler *foo = signal (SIGKILL, SIG_IGN); */ +typedef RETSIGTYPE SigHandler (); + +#if defined (HAVE_POSIX_SIGNALS) +typedef struct sigaction sighandler_cxt; +# define rl_sigaction(s, nh, oh) sigaction(s, nh, oh) +#else +typedef struct { SigHandler *sa_handler; int sa_mask, sa_flags; } sighandler_cxt; +# define sigemptyset(m) +#endif /* !HAVE_POSIX_SIGNALS */ + +#ifndef SA_RESTART +# define SA_RESTART 0 +#endif + +static SigHandler *rl_set_sighandler PARAMS((int, SigHandler *, sighandler_cxt *)); +static void rl_maybe_set_sighandler PARAMS((int, SigHandler *, sighandler_cxt *)); +static void rl_maybe_restore_sighandler PARAMS((int, sighandler_cxt *)); + +static RETSIGTYPE rl_signal_handler PARAMS((int)); +static RETSIGTYPE _rl_handle_signal PARAMS((int)); + +/* Exported variables for use by applications. */ + +/* If non-zero, readline will install its own signal handlers for + SIGINT, SIGTERM, SIGHUP, SIGQUIT, SIGALRM, SIGTSTP, SIGTTIN, and SIGTTOU. */ +int rl_catch_signals = 1; + +/* If non-zero, readline will install a signal handler for SIGWINCH. */ +#ifdef SIGWINCH +int rl_catch_sigwinch = 1; +#else +int rl_catch_sigwinch = 0; /* for the readline state struct in readline.c */ +#endif + +/* Private variables. */ +int _rl_interrupt_immediately = 0; +int volatile _rl_caught_signal = 0; /* should be sig_atomic_t, but that requires including everywhere */ + +/* If non-zero, print characters corresponding to received signals as long as + the user has indicated his desire to do so (_rl_echo_control_chars). */ +int _rl_echoctl = 0; + +int _rl_intr_char = 0; +int _rl_quit_char = 0; +int _rl_susp_char = 0; + +static int signals_set_flag; +static int sigwinch_set_flag; + +/* **************************************************************** */ +/* */ +/* Signal Handling */ +/* */ +/* **************************************************************** */ + +static sighandler_cxt old_int, old_term, old_hup, old_alrm, old_quit; +#if defined (SIGTSTP) +static sighandler_cxt old_tstp, old_ttou, old_ttin; +#endif +#if defined (SIGWINCH) +static sighandler_cxt old_winch; +#endif + +_rl_sigcleanup_func_t *_rl_sigcleanup; +void *_rl_sigcleanarg; + +/* Readline signal handler functions. */ + +/* Called from RL_CHECK_SIGNALS() macro */ +RETSIGTYPE +_rl_signal_handler (sig) + int sig; +{ + _rl_caught_signal = 0; /* XXX */ + +#if defined (SIGWINCH) + if (sig == SIGWINCH) + { + rl_resize_terminal (); + /* XXX - experimental for now */ + /* Call a signal hook because though we called the original signal handler + in rl_sigwinch_handler below, we will not resend the signal to + ourselves. */ + if (rl_signal_event_hook) + (*rl_signal_event_hook) (); + } + else +#endif + _rl_handle_signal (sig); + + SIGHANDLER_RETURN; +} + +static RETSIGTYPE +rl_signal_handler (sig) + int sig; +{ + if (_rl_interrupt_immediately) + { + _rl_interrupt_immediately = 0; + _rl_handle_signal (sig); + } + else + _rl_caught_signal = sig; + + SIGHANDLER_RETURN; +} + +static RETSIGTYPE +_rl_handle_signal (sig) + int sig; +{ +#if defined (HAVE_POSIX_SIGNALS) + sigset_t set; +#else /* !HAVE_POSIX_SIGNALS */ +# if defined (HAVE_BSD_SIGNALS) + long omask; +# else /* !HAVE_BSD_SIGNALS */ + sighandler_cxt dummy_cxt; /* needed for rl_set_sighandler call */ +# endif /* !HAVE_BSD_SIGNALS */ +#endif /* !HAVE_POSIX_SIGNALS */ + + RL_SETSTATE(RL_STATE_SIGHANDLER); + +#if !defined (HAVE_BSD_SIGNALS) && !defined (HAVE_POSIX_SIGNALS) + /* Since the signal will not be blocked while we are in the signal + handler, ignore it until rl_clear_signals resets the catcher. */ +# if defined (SIGALRM) + if (sig == SIGINT || sig == SIGALRM) +# else + if (sig == SIGINT) +# endif + rl_set_sighandler (sig, SIG_IGN, &dummy_cxt); +#endif /* !HAVE_BSD_SIGNALS && !HAVE_POSIX_SIGNALS */ + + /* If there's a sig cleanup function registered, call it and `deregister' + the cleanup function to avoid multiple calls */ + if (_rl_sigcleanup) + { + (*_rl_sigcleanup) (sig, _rl_sigcleanarg); + _rl_sigcleanup = 0; + _rl_sigcleanarg = 0; + } + + switch (sig) + { + case SIGINT: + _rl_reset_completion_state (); + rl_free_line_state (); + /* FALLTHROUGH */ + + case SIGTERM: + case SIGHUP: +#if defined (SIGTSTP) + case SIGTSTP: + case SIGTTOU: + case SIGTTIN: +#endif /* SIGTSTP */ +#if defined (SIGALRM) + case SIGALRM: +#endif +#if defined (SIGQUIT) + case SIGQUIT: +#endif + rl_echo_signal_char (sig); + rl_cleanup_after_signal (); + +#if defined (HAVE_POSIX_SIGNALS) + sigemptyset (&set); + sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &set); + sigdelset (&set, sig); +#else /* !HAVE_POSIX_SIGNALS */ +# if defined (HAVE_BSD_SIGNALS) + omask = sigblock (0); +# endif /* HAVE_BSD_SIGNALS */ +#endif /* !HAVE_POSIX_SIGNALS */ + +#if defined (__EMX__) + signal (sig, SIG_ACK); +#endif + +#if defined (HAVE_KILL) + kill (getpid (), sig); +#else + raise (sig); /* assume we have raise */ +#endif + + /* Let the signal that we just sent through. */ +#if defined (HAVE_POSIX_SIGNALS) + sigprocmask (SIG_SETMASK, &set, (sigset_t *)NULL); +#else /* !HAVE_POSIX_SIGNALS */ +# if defined (HAVE_BSD_SIGNALS) + sigsetmask (omask & ~(sigmask (sig))); +# endif /* HAVE_BSD_SIGNALS */ +#endif /* !HAVE_POSIX_SIGNALS */ + + rl_reset_after_signal (); + } + + RL_UNSETSTATE(RL_STATE_SIGHANDLER); + SIGHANDLER_RETURN; +} + +#if defined (SIGWINCH) +static RETSIGTYPE +rl_sigwinch_handler (sig) + int sig; +{ + SigHandler *oh; + +#if defined (MUST_REINSTALL_SIGHANDLERS) + sighandler_cxt dummy_winch; + + /* We don't want to change old_winch -- it holds the state of SIGWINCH + disposition set by the calling application. We need this state + because we call the application's SIGWINCH handler after updating + our own idea of the screen size. */ + rl_set_sighandler (SIGWINCH, rl_sigwinch_handler, &dummy_winch); +#endif + + RL_SETSTATE(RL_STATE_SIGHANDLER); + _rl_caught_signal = sig; + + /* If another sigwinch handler has been installed, call it. */ + oh = (SigHandler *)old_winch.sa_handler; + if (oh && oh != (SigHandler *)SIG_IGN && oh != (SigHandler *)SIG_DFL) + (*oh) (sig); + + RL_UNSETSTATE(RL_STATE_SIGHANDLER); + SIGHANDLER_RETURN; +} +#endif /* SIGWINCH */ + +/* Functions to manage signal handling. */ + +#if !defined (HAVE_POSIX_SIGNALS) +static int +rl_sigaction (sig, nh, oh) + int sig; + sighandler_cxt *nh, *oh; +{ + oh->sa_handler = signal (sig, nh->sa_handler); + return 0; +} +#endif /* !HAVE_POSIX_SIGNALS */ + +/* Set up a readline-specific signal handler, saving the old signal + information in OHANDLER. Return the old signal handler, like + signal(). */ +static SigHandler * +rl_set_sighandler (sig, handler, ohandler) + int sig; + SigHandler *handler; + sighandler_cxt *ohandler; +{ + sighandler_cxt old_handler; +#if defined (HAVE_POSIX_SIGNALS) + struct sigaction act; + + act.sa_handler = handler; +# if defined (SIGWINCH) + act.sa_flags = (sig == SIGWINCH) ? SA_RESTART : 0; +# else + act.sa_flags = 0; +# endif /* SIGWINCH */ + sigemptyset (&act.sa_mask); + sigemptyset (&ohandler->sa_mask); + sigaction (sig, &act, &old_handler); +#else + old_handler.sa_handler = (SigHandler *)signal (sig, handler); +#endif /* !HAVE_POSIX_SIGNALS */ + + /* XXX -- assume we have memcpy */ + /* If rl_set_signals is called twice in a row, don't set the old handler to + rl_signal_handler, because that would cause infinite recursion. */ + if (handler != rl_signal_handler || old_handler.sa_handler != rl_signal_handler) + memcpy (ohandler, &old_handler, sizeof (sighandler_cxt)); + + return (ohandler->sa_handler); +} + +/* Set disposition of SIG to HANDLER, returning old state in OHANDLER. Don't + change disposition if OHANDLER indicates the signal was ignored. */ +static void +rl_maybe_set_sighandler (sig, handler, ohandler) + int sig; + SigHandler *handler; + sighandler_cxt *ohandler; +{ + sighandler_cxt dummy; + SigHandler *oh; + + sigemptyset (&dummy.sa_mask); + dummy.sa_flags = 0; + oh = rl_set_sighandler (sig, handler, ohandler); + if (oh == (SigHandler *)SIG_IGN) + rl_sigaction (sig, ohandler, &dummy); +} + +/* Set the disposition of SIG to HANDLER, if HANDLER->sa_handler indicates the + signal was not being ignored. MUST only be called for signals whose + disposition was changed using rl_maybe_set_sighandler or for which the + SIG_IGN check was performed inline (e.g., SIGALRM below). */ +static void +rl_maybe_restore_sighandler (sig, handler) + int sig; + sighandler_cxt *handler; +{ + sighandler_cxt dummy; + + sigemptyset (&dummy.sa_mask); + dummy.sa_flags = 0; + if (handler->sa_handler != SIG_IGN) + rl_sigaction (sig, handler, &dummy); +} + +int +rl_set_signals () +{ + sighandler_cxt dummy; + SigHandler *oh; +#if defined (HAVE_POSIX_SIGNALS) + static int sigmask_set = 0; + static sigset_t bset, oset; +#endif + +#if defined (HAVE_POSIX_SIGNALS) + if (rl_catch_signals && sigmask_set == 0) + { + sigemptyset (&bset); + + sigaddset (&bset, SIGINT); + sigaddset (&bset, SIGTERM); + sigaddset (&bset, SIGHUP); +#if defined (SIGQUIT) + sigaddset (&bset, SIGQUIT); +#endif +#if defined (SIGALRM) + sigaddset (&bset, SIGALRM); +#endif +#if defined (SIGTSTP) + sigaddset (&bset, SIGTSTP); +#endif +#if defined (SIGTTIN) + sigaddset (&bset, SIGTTIN); +#endif +#if defined (SIGTTOU) + sigaddset (&bset, SIGTTOU); +#endif + sigmask_set = 1; + } +#endif /* HAVE_POSIX_SIGNALS */ + + if (rl_catch_signals && signals_set_flag == 0) + { +#if defined (HAVE_POSIX_SIGNALS) + sigemptyset (&oset); + sigprocmask (SIG_BLOCK, &bset, &oset); +#endif + + rl_maybe_set_sighandler (SIGINT, rl_signal_handler, &old_int); + rl_maybe_set_sighandler (SIGTERM, rl_signal_handler, &old_term); + rl_maybe_set_sighandler (SIGHUP, rl_signal_handler, &old_hup); +#if defined (SIGQUIT) + rl_maybe_set_sighandler (SIGQUIT, rl_signal_handler, &old_quit); +#endif + +#if defined (SIGALRM) + oh = rl_set_sighandler (SIGALRM, rl_signal_handler, &old_alrm); + if (oh == (SigHandler *)SIG_IGN) + rl_sigaction (SIGALRM, &old_alrm, &dummy); +#if defined (HAVE_POSIX_SIGNALS) && defined (SA_RESTART) + /* If the application using readline has already installed a signal + handler with SA_RESTART, SIGALRM will cause reads to be restarted + automatically, so readline should just get out of the way. Since + we tested for SIG_IGN above, we can just test for SIG_DFL here. */ + if (oh != (SigHandler *)SIG_DFL && (old_alrm.sa_flags & SA_RESTART)) + rl_sigaction (SIGALRM, &old_alrm, &dummy); +#endif /* HAVE_POSIX_SIGNALS */ +#endif /* SIGALRM */ + +#if defined (SIGTSTP) + rl_maybe_set_sighandler (SIGTSTP, rl_signal_handler, &old_tstp); +#endif /* SIGTSTP */ + +#if defined (SIGTTOU) + rl_maybe_set_sighandler (SIGTTOU, rl_signal_handler, &old_ttou); +#endif /* SIGTTOU */ + +#if defined (SIGTTIN) + rl_maybe_set_sighandler (SIGTTIN, rl_signal_handler, &old_ttin); +#endif /* SIGTTIN */ + + signals_set_flag = 1; + +#if defined (HAVE_POSIX_SIGNALS) + sigprocmask (SIG_SETMASK, &oset, (sigset_t *)NULL); +#endif + } + +#if defined (SIGWINCH) + if (rl_catch_sigwinch && sigwinch_set_flag == 0) + { + rl_maybe_set_sighandler (SIGWINCH, rl_sigwinch_handler, &old_winch); + sigwinch_set_flag = 1; + } +#endif /* SIGWINCH */ + + return 0; +} + +int +rl_clear_signals () +{ + sighandler_cxt dummy; + + if (rl_catch_signals && signals_set_flag == 1) + { + sigemptyset (&dummy.sa_mask); + + /* Since rl_maybe_set_sighandler doesn't override a SIG_IGN handler, + we should in theory not have to restore a handler where + old_xxx.sa_handler == SIG_IGN. That's what rl_maybe_restore_sighandler + does. Fewer system calls should reduce readline's per-line + overhead */ + rl_maybe_restore_sighandler (SIGINT, &old_int); + rl_maybe_restore_sighandler (SIGTERM, &old_term); + rl_maybe_restore_sighandler (SIGHUP, &old_hup); +#if defined (SIGQUIT) + rl_maybe_restore_sighandler (SIGQUIT, &old_quit); +#endif +#if defined (SIGALRM) + rl_maybe_restore_sighandler (SIGALRM, &old_alrm); +#endif + +#if defined (SIGTSTP) + rl_maybe_restore_sighandler (SIGTSTP, &old_tstp); +#endif /* SIGTSTP */ + +#if defined (SIGTTOU) + rl_maybe_restore_sighandler (SIGTTOU, &old_ttou); +#endif /* SIGTTOU */ + +#if defined (SIGTTIN) + rl_maybe_restore_sighandler (SIGTTIN, &old_ttin); +#endif /* SIGTTIN */ + + signals_set_flag = 0; + } + +#if defined (SIGWINCH) + if (rl_catch_sigwinch && sigwinch_set_flag == 1) + { + sigemptyset (&dummy.sa_mask); + rl_sigaction (SIGWINCH, &old_winch, &dummy); + sigwinch_set_flag = 0; + } +#endif + + return 0; +} + +/* Clean up the terminal and readline state after catching a signal, before + resending it to the calling application. */ +void +rl_cleanup_after_signal () +{ + _rl_clean_up_for_exit (); + if (rl_deprep_term_function) + (*rl_deprep_term_function) (); + rl_clear_pending_input (); + rl_clear_signals (); +} + +/* Reset the terminal and readline state after a signal handler returns. */ +void +rl_reset_after_signal () +{ + if (rl_prep_term_function) + (*rl_prep_term_function) (_rl_meta_flag); + rl_set_signals (); +} + +/* Free up the readline variable line state for the current line (undo list, + any partial history entry, any keyboard macros in progress, and any + numeric arguments in process) after catching a signal, before calling + rl_cleanup_after_signal(). */ +void +rl_free_line_state () +{ + register HIST_ENTRY *entry; + + rl_free_undo_list (); + + entry = current_history (); + if (entry) + entry->data = (char *)NULL; + + _rl_kill_kbd_macro (); + rl_clear_message (); + _rl_reset_argument (); +} + +#endif /* HANDLE_SIGNALS */ + +/* **************************************************************** */ +/* */ +/* SIGINT Management */ +/* */ +/* **************************************************************** */ + +#if defined (HAVE_POSIX_SIGNALS) +static sigset_t sigint_set, sigint_oset; +static sigset_t sigwinch_set, sigwinch_oset; +#else /* !HAVE_POSIX_SIGNALS */ +# if defined (HAVE_BSD_SIGNALS) +static int sigint_oldmask; +static int sigwinch_oldmask; +# endif /* HAVE_BSD_SIGNALS */ +#endif /* !HAVE_POSIX_SIGNALS */ + +static int sigint_blocked; +static int sigwinch_blocked; + +/* Cause SIGINT to not be delivered until the corresponding call to + release_sigint(). */ +void +_rl_block_sigint () +{ + if (sigint_blocked) + return; + + sigint_blocked = 1; +} + +/* Allow SIGINT to be delivered. */ +void +_rl_release_sigint () +{ + if (sigint_blocked == 0) + return; + + sigint_blocked = 0; + RL_CHECK_SIGNALS (); +} + +/* Cause SIGWINCH to not be delivered until the corresponding call to + release_sigwinch(). */ +void +_rl_block_sigwinch () +{ + if (sigwinch_blocked) + return; + +#if defined (SIGWINCH) + +#if defined (HAVE_POSIX_SIGNALS) + sigemptyset (&sigwinch_set); + sigemptyset (&sigwinch_oset); + sigaddset (&sigwinch_set, SIGWINCH); + sigprocmask (SIG_BLOCK, &sigwinch_set, &sigwinch_oset); +#else /* !HAVE_POSIX_SIGNALS */ +# if defined (HAVE_BSD_SIGNALS) + sigwinch_oldmask = sigblock (sigmask (SIGWINCH)); +# else /* !HAVE_BSD_SIGNALS */ +# if defined (HAVE_USG_SIGHOLD) + sighold (SIGWINCH); +# endif /* HAVE_USG_SIGHOLD */ +# endif /* !HAVE_BSD_SIGNALS */ +#endif /* !HAVE_POSIX_SIGNALS */ + +#endif /* SIGWINCH */ + + sigwinch_blocked = 1; +} + +/* Allow SIGWINCH to be delivered. */ +void +_rl_release_sigwinch () +{ + if (sigwinch_blocked == 0) + return; + +#if defined (SIGWINCH) + +#if defined (HAVE_POSIX_SIGNALS) + sigprocmask (SIG_SETMASK, &sigwinch_oset, (sigset_t *)NULL); +#else +# if defined (HAVE_BSD_SIGNALS) + sigsetmask (sigwinch_oldmask); +# else /* !HAVE_BSD_SIGNALS */ +# if defined (HAVE_USG_SIGHOLD) + sigrelse (SIGWINCH); +# endif /* HAVE_USG_SIGHOLD */ +# endif /* !HAVE_BSD_SIGNALS */ +#endif /* !HAVE_POSIX_SIGNALS */ + +#endif /* SIGWINCH */ + + sigwinch_blocked = 0; +} + +/* **************************************************************** */ +/* */ +/* Echoing special control characters */ +/* */ +/* **************************************************************** */ +void +rl_echo_signal_char (sig) + int sig; +{ + char cstr[3]; + int cslen, c; + + if (_rl_echoctl == 0 || _rl_echo_control_chars == 0) + return; + + switch (sig) + { + case SIGINT: c = _rl_intr_char; break; +#if defined (SIGQUIT) + case SIGQUIT: c = _rl_quit_char; break; +#endif +#if defined (SIGTSTP) + case SIGTSTP: c = _rl_susp_char; break; +#endif + default: return; + } + + if (CTRL_CHAR (c) || c == RUBOUT) + { + cstr[0] = '^'; + cstr[1] = CTRL_CHAR (c) ? UNCTRL (c) : '?'; + cstr[cslen = 2] = '\0'; + } + else + { + cstr[0] = c; + cstr[cslen = 1] = '\0'; + } + + _rl_output_some_chars (cstr, cslen); +} diff --git a/lib/readline/tcap.h b/lib/readline/tcap.h new file mode 100644 index 0000000..9d09b7a --- /dev/null +++ b/lib/readline/tcap.h @@ -0,0 +1,58 @@ +/* tcap.h -- termcap library functions and variables. */ + +/* Copyright (C) 1996-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if !defined (_RLTCAP_H_) +#define _RLTCAP_H_ + +#if defined (HAVE_CONFIG_H) +# include "config.h" +#endif + +#if defined (HAVE_TERMCAP_H) +# if defined (__linux__) && !defined (SPEED_T_IN_SYS_TYPES) +# include "rltty.h" +# endif +# include +#else + +/* On Solaris2, sys/types.h #includes sys/reg.h, which #defines PC. + Unfortunately, PC is a global variable used by the termcap library. */ +#ifdef PC +# undef PC +#endif + +extern char PC; +extern char *UP, *BC; + +extern short ospeed; + +extern int tgetent (); +extern int tgetflag (); +extern int tgetnum (); +extern char *tgetstr (); + +extern int tputs (); + +extern char *tgoto (); + +#endif /* HAVE_TERMCAP_H */ + +#endif /* !_RLTCAP_H_ */ diff --git a/lib/readline/terminal.c b/lib/readline/terminal.c new file mode 100644 index 0000000..1212ec4 --- /dev/null +++ b/lib/readline/terminal.c @@ -0,0 +1,794 @@ +/* terminal.c -- controlling the terminal with termcap. */ + +/* Copyright (C) 1996-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include +#include "posixstat.h" +#include +#if defined (HAVE_SYS_FILE_H) +# include +#endif /* HAVE_SYS_FILE_H */ + +#if defined (HAVE_UNISTD_H) +# include +#endif /* HAVE_UNISTD_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#if defined (HAVE_LOCALE_H) +# include +#endif + +#include + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" + +#if defined (GWINSZ_IN_SYS_IOCTL) && !defined (TIOCGWINSZ) +# include +#endif /* GWINSZ_IN_SYS_IOCTL && !TIOCGWINSZ */ + +#ifdef __MSDOS__ +# include +#endif + +#include "rltty.h" +#include "tcap.h" + +/* Some standard library routines. */ +#include "readline.h" +#include "history.h" + +#include "rlprivate.h" +#include "rlshell.h" +#include "xmalloc.h" + +#if defined (__MINGW32__) +# include +# include + +static void _win_get_screensize PARAMS((int *, int *)); +#endif + +#if defined (__EMX__) +static void _emx_get_screensize PARAMS((int *, int *)); +#endif + +/* If the calling application sets this to a non-zero value, readline will + use the $LINES and $COLUMNS environment variables to set its idea of the + window size before interrogating the kernel. */ +int rl_prefer_env_winsize = 0; + +/* If this is non-zero, readline will set LINES and COLUMNS in the + environment when it handles SIGWINCH. */ +int rl_change_environment = 1; + +/* **************************************************************** */ +/* */ +/* Terminal and Termcap */ +/* */ +/* **************************************************************** */ + +#ifndef __MSDOS__ +static char *term_buffer = (char *)NULL; +static char *term_string_buffer = (char *)NULL; +#endif + +static int tcap_initialized; + +#if !defined (__linux__) && !defined (NCURSES_VERSION) +# if defined (__EMX__) || defined (NEED_EXTERN_PC) +extern +# endif /* __EMX__ || NEED_EXTERN_PC */ +char PC, *BC, *UP; +#endif /* !__linux__ && !NCURSES_VERSION */ + +/* Some strings to control terminal actions. These are output by tputs (). */ +char *_rl_term_clreol; +char *_rl_term_clrpag; +char *_rl_term_cr; +char *_rl_term_backspace; +char *_rl_term_goto; +char *_rl_term_pc; + +/* Non-zero if we determine that the terminal can do character insertion. */ +int _rl_terminal_can_insert = 0; + +/* How to insert characters. */ +char *_rl_term_im; +char *_rl_term_ei; +char *_rl_term_ic; +char *_rl_term_ip; +char *_rl_term_IC; + +/* How to delete characters. */ +char *_rl_term_dc; +char *_rl_term_DC; + +char *_rl_term_forward_char; + +/* How to go up a line. */ +char *_rl_term_up; + +/* A visible bell; char if the terminal can be made to flash the screen. */ +static char *_rl_visible_bell; + +/* Non-zero means the terminal can auto-wrap lines. */ +int _rl_term_autowrap = -1; + +/* Non-zero means that this terminal has a meta key. */ +static int term_has_meta; + +/* The sequences to write to turn on and off the meta key, if this + terminal has one. */ +static char *_rl_term_mm; +static char *_rl_term_mo; + +/* The key sequences output by the arrow keys, if this terminal has any. */ +static char *_rl_term_ku; +static char *_rl_term_kd; +static char *_rl_term_kr; +static char *_rl_term_kl; + +/* How to initialize and reset the arrow keys, if this terminal has any. */ +static char *_rl_term_ks; +static char *_rl_term_ke; + +/* The key sequences sent by the Home and End keys, if any. */ +static char *_rl_term_kh; +static char *_rl_term_kH; +static char *_rl_term_at7; /* @7 */ + +/* Delete key */ +static char *_rl_term_kD; + +/* Insert key */ +static char *_rl_term_kI; + +/* Cursor control */ +static char *_rl_term_vs; /* very visible */ +static char *_rl_term_ve; /* normal */ + +static void bind_termcap_arrow_keys PARAMS((Keymap)); + +/* Variables that hold the screen dimensions, used by the display code. */ +int _rl_screenwidth, _rl_screenheight, _rl_screenchars; + +/* Non-zero means the user wants to enable the keypad. */ +int _rl_enable_keypad; + +/* Non-zero means the user wants to enable a meta key. */ +int _rl_enable_meta = 1; + +#if defined (__EMX__) +static void +_emx_get_screensize (swp, shp) + int *swp, *shp; +{ + int sz[2]; + + _scrsize (sz); + + if (swp) + *swp = sz[0]; + if (shp) + *shp = sz[1]; +} +#endif + +#if defined (__MINGW32__) +static void +_win_get_screensize (swp, shp) + int *swp, *shp; +{ + HANDLE hConOut; + CONSOLE_SCREEN_BUFFER_INFO scr; + + hConOut = GetStdHandle (STD_OUTPUT_HANDLE); + if (hConOut != INVALID_HANDLE_VALUE) + { + if (GetConsoleScreenBufferInfo (hConOut, &scr)) + { + *swp = scr.dwSize.X; + *shp = scr.srWindow.Bottom - scr.srWindow.Top + 1; + } + } +} +#endif + +/* Get readline's idea of the screen size. TTY is a file descriptor open + to the terminal. If IGNORE_ENV is true, we do not pay attention to the + values of $LINES and $COLUMNS. The tests for TERM_STRING_BUFFER being + non-null serve to check whether or not we have initialized termcap. */ +void +_rl_get_screen_size (tty, ignore_env) + int tty, ignore_env; +{ + char *ss; +#if defined (TIOCGWINSZ) + struct winsize window_size; +#endif /* TIOCGWINSZ */ + int wr, wc; + + wr = wc = -1; +#if defined (TIOCGWINSZ) + if (ioctl (tty, TIOCGWINSZ, &window_size) == 0) + { + wc = (int) window_size.ws_col; + wr = (int) window_size.ws_row; + } +#endif /* TIOCGWINSZ */ + +#if defined (__EMX__) + _emx_get_screensize (&wc, &wr); +#elif defined (__MINGW32__) + _win_get_screensize (&wc, &wr); +#endif + + if (ignore_env || rl_prefer_env_winsize == 0) + { + _rl_screenwidth = wc; + _rl_screenheight = wr; + } + else + _rl_screenwidth = _rl_screenheight = -1; + + /* Environment variable COLUMNS overrides setting of "co" if IGNORE_ENV + is unset. If we prefer the environment, check it first before + assigning the value returned by the kernel. */ + if (_rl_screenwidth <= 0) + { + if (ignore_env == 0 && (ss = sh_get_env_value ("COLUMNS"))) + _rl_screenwidth = atoi (ss); + + if (_rl_screenwidth <= 0) + _rl_screenwidth = wc; + +#if defined (__DJGPP__) + if (_rl_screenwidth <= 0) + _rl_screenwidth = ScreenCols (); +#else + if (_rl_screenwidth <= 0 && term_string_buffer) + _rl_screenwidth = tgetnum ("co"); +#endif + } + + /* Environment variable LINES overrides setting of "li" if IGNORE_ENV + is unset. */ + if (_rl_screenheight <= 0) + { + if (ignore_env == 0 && (ss = sh_get_env_value ("LINES"))) + _rl_screenheight = atoi (ss); + + if (_rl_screenheight <= 0) + _rl_screenheight = wr; + +#if defined (__DJGPP__) + if (_rl_screenheight <= 0) + _rl_screenheight = ScreenRows (); +#else + if (_rl_screenheight <= 0 && term_string_buffer) + _rl_screenheight = tgetnum ("li"); +#endif + } + + /* If all else fails, default to 80x24 terminal. */ + if (_rl_screenwidth <= 1) + _rl_screenwidth = 80; + + if (_rl_screenheight <= 0) + _rl_screenheight = 24; + + /* If we're being compiled as part of bash, set the environment + variables $LINES and $COLUMNS to new values. Otherwise, just + do a pair of putenv () or setenv () calls. */ + if (rl_change_environment) + sh_set_lines_and_columns (_rl_screenheight, _rl_screenwidth); + + if (_rl_term_autowrap == 0) + _rl_screenwidth--; + + _rl_screenchars = _rl_screenwidth * _rl_screenheight; +} + +void +_rl_set_screen_size (rows, cols) + int rows, cols; +{ + if (_rl_term_autowrap == -1) + _rl_init_terminal_io (rl_terminal_name); + + if (rows > 0) + _rl_screenheight = rows; + if (cols > 0) + { + _rl_screenwidth = cols; + if (_rl_term_autowrap == 0) + _rl_screenwidth--; + } + + if (rows > 0 || cols > 0) + _rl_screenchars = _rl_screenwidth * _rl_screenheight; +} + +void +rl_set_screen_size (rows, cols) + int rows, cols; +{ + _rl_set_screen_size (rows, cols); +} + +void +rl_get_screen_size (rows, cols) + int *rows, *cols; +{ + if (rows) + *rows = _rl_screenheight; + if (cols) + *cols = _rl_screenwidth; +} + +void +rl_reset_screen_size () +{ + _rl_get_screen_size (fileno (rl_instream), 0); +} + +void +_rl_sigwinch_resize_terminal () +{ + _rl_get_screen_size (fileno (rl_instream), 1); +} + +void +rl_resize_terminal () +{ + _rl_get_screen_size (fileno (rl_instream), 1); + if (_rl_echoing_p) + { + if (CUSTOM_REDISPLAY_FUNC ()) + rl_forced_update_display (); + else if (RL_ISSTATE(RL_STATE_REDISPLAYING) == 0) + _rl_redisplay_after_sigwinch (); + } +} + +struct _tc_string { + const char * const tc_var; + char **tc_value; +}; + +/* This should be kept sorted, just in case we decide to change the + search algorithm to something smarter. */ +static const struct _tc_string tc_strings[] = +{ + { "@7", &_rl_term_at7 }, + { "DC", &_rl_term_DC }, + { "IC", &_rl_term_IC }, + { "ce", &_rl_term_clreol }, + { "cl", &_rl_term_clrpag }, + { "cr", &_rl_term_cr }, + { "dc", &_rl_term_dc }, + { "ei", &_rl_term_ei }, + { "ic", &_rl_term_ic }, + { "im", &_rl_term_im }, + { "kD", &_rl_term_kD }, /* delete */ + { "kH", &_rl_term_kH }, /* home down ?? */ + { "kI", &_rl_term_kI }, /* insert */ + { "kd", &_rl_term_kd }, + { "ke", &_rl_term_ke }, /* end keypad mode */ + { "kh", &_rl_term_kh }, /* home */ + { "kl", &_rl_term_kl }, + { "kr", &_rl_term_kr }, + { "ks", &_rl_term_ks }, /* start keypad mode */ + { "ku", &_rl_term_ku }, + { "le", &_rl_term_backspace }, + { "mm", &_rl_term_mm }, + { "mo", &_rl_term_mo }, + { "nd", &_rl_term_forward_char }, + { "pc", &_rl_term_pc }, + { "up", &_rl_term_up }, + { "vb", &_rl_visible_bell }, + { "vs", &_rl_term_vs }, + { "ve", &_rl_term_ve }, +}; + +#define NUM_TC_STRINGS (sizeof (tc_strings) / sizeof (struct _tc_string)) + +/* Read the desired terminal capability strings into BP. The capabilities + are described in the TC_STRINGS table. */ +static void +get_term_capabilities (bp) + char **bp; +{ +#if !defined (__DJGPP__) /* XXX - doesn't DJGPP have a termcap library? */ + register int i; + + for (i = 0; i < NUM_TC_STRINGS; i++) + *(tc_strings[i].tc_value) = tgetstr ((char *)tc_strings[i].tc_var, bp); +#endif + tcap_initialized = 1; +} + +int +_rl_init_terminal_io (terminal_name) + const char *terminal_name; +{ + const char *term; + char *buffer; + int tty, tgetent_ret; + + term = terminal_name ? terminal_name : sh_get_env_value ("TERM"); + _rl_term_clrpag = _rl_term_cr = _rl_term_clreol = (char *)NULL; + tty = rl_instream ? fileno (rl_instream) : 0; + + if (term == 0) + term = "dumb"; + +#ifdef __MSDOS__ + _rl_term_im = _rl_term_ei = _rl_term_ic = _rl_term_IC = (char *)NULL; + _rl_term_up = _rl_term_dc = _rl_term_DC = _rl_visible_bell = (char *)NULL; + _rl_term_ku = _rl_term_kd = _rl_term_kl = _rl_term_kr = (char *)NULL; + _rl_term_mm = _rl_term_mo = (char *)NULL; + _rl_terminal_can_insert = term_has_meta = _rl_term_autowrap = 0; + _rl_term_cr = "\r"; + _rl_term_clreol = _rl_term_clrpag = _rl_term_backspace = (char *)NULL; + _rl_term_goto = _rl_term_pc = _rl_term_ip = (char *)NULL; + _rl_term_ks = _rl_term_ke =_rl_term_vs = _rl_term_ve = (char *)NULL; + _rl_term_kh = _rl_term_kH = _rl_term_at7 = _rl_term_kI = (char *)NULL; +#if defined(HACK_TERMCAP_MOTION) + _rl_term_forward_char = (char *)NULL; +#endif + + _rl_get_screen_size (tty, 0); +#else /* !__MSDOS__ */ + /* I've separated this out for later work on not calling tgetent at all + if the calling application has supplied a custom redisplay function, + (and possibly if the application has supplied a custom input function). */ + if (CUSTOM_REDISPLAY_FUNC()) + { + tgetent_ret = -1; + } + else + { + if (term_string_buffer == 0) + term_string_buffer = (char *)xmalloc(2032); + + if (term_buffer == 0) + term_buffer = (char *)xmalloc(4080); + + buffer = term_string_buffer; + + tgetent_ret = tgetent (term_buffer, term); + } + + if (tgetent_ret <= 0) + { + FREE (term_string_buffer); + FREE (term_buffer); + buffer = term_buffer = term_string_buffer = (char *)NULL; + + _rl_term_autowrap = 0; /* used by _rl_get_screen_size */ + + /* Allow calling application to set default height and width, using + rl_set_screen_size */ + if (_rl_screenwidth <= 0 || _rl_screenheight <= 0) + { +#if defined (__EMX__) + _emx_get_screensize (&_rl_screenwidth, &_rl_screenheight); + _rl_screenwidth--; +#else /* !__EMX__ */ + _rl_get_screen_size (tty, 0); +#endif /* !__EMX__ */ + } + + /* Defaults. */ + if (_rl_screenwidth <= 0 || _rl_screenheight <= 0) + { + _rl_screenwidth = 79; + _rl_screenheight = 24; + } + + /* Everything below here is used by the redisplay code (tputs). */ + _rl_screenchars = _rl_screenwidth * _rl_screenheight; + _rl_term_cr = "\r"; + _rl_term_im = _rl_term_ei = _rl_term_ic = _rl_term_IC = (char *)NULL; + _rl_term_up = _rl_term_dc = _rl_term_DC = _rl_visible_bell = (char *)NULL; + _rl_term_ku = _rl_term_kd = _rl_term_kl = _rl_term_kr = (char *)NULL; + _rl_term_kh = _rl_term_kH = _rl_term_kI = _rl_term_kD = (char *)NULL; + _rl_term_ks = _rl_term_ke = _rl_term_at7 = (char *)NULL; + _rl_term_mm = _rl_term_mo = (char *)NULL; + _rl_term_ve = _rl_term_vs = (char *)NULL; + _rl_term_forward_char = (char *)NULL; + _rl_terminal_can_insert = term_has_meta = 0; + + /* Reasonable defaults for tgoto(). Readline currently only uses + tgoto if _rl_term_IC or _rl_term_DC is defined, but just in case we + change that later... */ + PC = '\0'; + BC = _rl_term_backspace = "\b"; + UP = _rl_term_up; + + return 0; + } + + get_term_capabilities (&buffer); + + /* Set up the variables that the termcap library expects the application + to provide. */ + PC = _rl_term_pc ? *_rl_term_pc : 0; + BC = _rl_term_backspace; + UP = _rl_term_up; + + if (!_rl_term_cr) + _rl_term_cr = "\r"; + + _rl_term_autowrap = tgetflag ("am") && tgetflag ("xn"); + + /* Allow calling application to set default height and width, using + rl_set_screen_size */ + if (_rl_screenwidth <= 0 || _rl_screenheight <= 0) + _rl_get_screen_size (tty, 0); + + /* "An application program can assume that the terminal can do + character insertion if *any one of* the capabilities `IC', + `im', `ic' or `ip' is provided." But we can't do anything if + only `ip' is provided, so... */ + _rl_terminal_can_insert = (_rl_term_IC || _rl_term_im || _rl_term_ic); + + /* Check to see if this terminal has a meta key and clear the capability + variables if there is none. */ + term_has_meta = tgetflag ("km") != 0; + if (term_has_meta == 0) + _rl_term_mm = _rl_term_mo = (char *)NULL; +#endif /* !__MSDOS__ */ + + /* Attempt to find and bind the arrow keys. Do not override already + bound keys in an overzealous attempt, however. */ + + bind_termcap_arrow_keys (emacs_standard_keymap); + +#if defined (VI_MODE) + bind_termcap_arrow_keys (vi_movement_keymap); + bind_termcap_arrow_keys (vi_insertion_keymap); +#endif /* VI_MODE */ + + return 0; +} + +/* Bind the arrow key sequences from the termcap description in MAP. */ +static void +bind_termcap_arrow_keys (map) + Keymap map; +{ + Keymap xkeymap; + + xkeymap = _rl_keymap; + _rl_keymap = map; + + rl_bind_keyseq_if_unbound (_rl_term_ku, rl_get_previous_history); + rl_bind_keyseq_if_unbound (_rl_term_kd, rl_get_next_history); + rl_bind_keyseq_if_unbound (_rl_term_kr, rl_forward_char); + rl_bind_keyseq_if_unbound (_rl_term_kl, rl_backward_char); + + rl_bind_keyseq_if_unbound (_rl_term_kh, rl_beg_of_line); /* Home */ + rl_bind_keyseq_if_unbound (_rl_term_at7, rl_end_of_line); /* End */ + + rl_bind_keyseq_if_unbound (_rl_term_kD, rl_delete); + + _rl_keymap = xkeymap; +} + +char * +rl_get_termcap (cap) + const char *cap; +{ + register int i; + + if (tcap_initialized == 0) + return ((char *)NULL); + for (i = 0; i < NUM_TC_STRINGS; i++) + { + if (tc_strings[i].tc_var[0] == cap[0] && strcmp (tc_strings[i].tc_var, cap) == 0) + return *(tc_strings[i].tc_value); + } + return ((char *)NULL); +} + +/* Re-initialize the terminal considering that the TERM/TERMCAP variable + has changed. */ +int +rl_reset_terminal (terminal_name) + const char *terminal_name; +{ + _rl_screenwidth = _rl_screenheight = 0; + _rl_init_terminal_io (terminal_name); + return 0; +} + +/* A function for the use of tputs () */ +#ifdef _MINIX +void +_rl_output_character_function (c) + int c; +{ + putc (c, _rl_out_stream); +} +#else /* !_MINIX */ +int +_rl_output_character_function (c) + int c; +{ + return putc (c, _rl_out_stream); +} +#endif /* !_MINIX */ + +/* Write COUNT characters from STRING to the output stream. */ +void +_rl_output_some_chars (string, count) + const char *string; + int count; +{ + fwrite (string, 1, count, _rl_out_stream); +} + +/* Move the cursor back. */ +int +_rl_backspace (count) + int count; +{ + register int i; + +#ifndef __MSDOS__ + if (_rl_term_backspace) + for (i = 0; i < count; i++) + tputs (_rl_term_backspace, 1, _rl_output_character_function); + else +#endif + for (i = 0; i < count; i++) + putc ('\b', _rl_out_stream); + return 0; +} + +/* Move to the start of the next line. */ +int +rl_crlf () +{ +#if defined (NEW_TTY_DRIVER) || defined (__MINT__) + if (_rl_term_cr) + tputs (_rl_term_cr, 1, _rl_output_character_function); +#endif /* NEW_TTY_DRIVER || __MINT__ */ + putc ('\n', _rl_out_stream); + return 0; +} + +/* Ring the terminal bell. */ +int +rl_ding () +{ + if (_rl_echoing_p) + { + switch (_rl_bell_preference) + { + case NO_BELL: + default: + break; + case VISIBLE_BELL: + if (_rl_visible_bell) + { +#ifdef __DJGPP__ + ScreenVisualBell (); +#else + tputs (_rl_visible_bell, 1, _rl_output_character_function); +#endif + break; + } + /* FALLTHROUGH */ + case AUDIBLE_BELL: + fprintf (stderr, "\007"); + fflush (stderr); + break; + } + return (0); + } + return (-1); +} + +/* **************************************************************** */ +/* */ +/* Controlling the Meta Key and Keypad */ +/* */ +/* **************************************************************** */ + +static int enabled_meta = 0; /* flag indicating we enabled meta mode */ + +void +_rl_enable_meta_key () +{ +#if !defined (__DJGPP__) + if (term_has_meta && _rl_term_mm) + { + tputs (_rl_term_mm, 1, _rl_output_character_function); + enabled_meta = 1; + } +#endif +} + +void +_rl_disable_meta_key () +{ +#if !defined (__DJGPP__) + if (term_has_meta && _rl_term_mo && enabled_meta) + { + tputs (_rl_term_mo, 1, _rl_output_character_function); + enabled_meta = 0; + } +#endif +} + +void +_rl_control_keypad (on) + int on; +{ +#if !defined (__DJGPP__) + if (on && _rl_term_ks) + tputs (_rl_term_ks, 1, _rl_output_character_function); + else if (!on && _rl_term_ke) + tputs (_rl_term_ke, 1, _rl_output_character_function); +#endif +} + +/* **************************************************************** */ +/* */ +/* Controlling the Cursor */ +/* */ +/* **************************************************************** */ + +/* Set the cursor appropriately depending on IM, which is one of the + insert modes (insert or overwrite). Insert mode gets the normal + cursor. Overwrite mode gets a very visible cursor. Only does + anything if we have both capabilities. */ +void +_rl_set_cursor (im, force) + int im, force; +{ +#ifndef __MSDOS__ + if (_rl_term_ve && _rl_term_vs) + { + if (force || im != rl_insert_mode) + { + if (im == RL_IM_OVERWRITE) + tputs (_rl_term_vs, 1, _rl_output_character_function); + else + tputs (_rl_term_ve, 1, _rl_output_character_function); + } + } +#endif +} diff --git a/lib/readline/text.c b/lib/readline/text.c new file mode 100644 index 0000000..f29adf8 --- /dev/null +++ b/lib/readline/text.c @@ -0,0 +1,1705 @@ +/* text.c -- text handling commands for readline. */ + +/* Copyright (C) 1987-2010 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# include +#endif /* HAVE_UNISTD_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#if defined (HAVE_LOCALE_H) +# include +#endif + +#include + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" +#include "rlmbutil.h" + +#if defined (__EMX__) +# define INCL_DOSPROCESS +# include +#endif /* __EMX__ */ + +/* Some standard library routines. */ +#include "readline.h" +#include "history.h" + +#include "rlprivate.h" +#include "rlshell.h" +#include "xmalloc.h" + +/* Forward declarations. */ +static int rl_change_case PARAMS((int, int)); +static int _rl_char_search PARAMS((int, int, int)); + +#if defined (READLINE_CALLBACKS) +static int _rl_insert_next_callback PARAMS((_rl_callback_generic_arg *)); +static int _rl_char_search_callback PARAMS((_rl_callback_generic_arg *)); +#endif + +/* The largest chunk of text that can be inserted in one call to + rl_insert_text. Text blocks larger than this are divided. */ +#define TEXT_COUNT_MAX 1024 + +/* **************************************************************** */ +/* */ +/* Insert and Delete */ +/* */ +/* **************************************************************** */ + +/* Insert a string of text into the line at point. This is the only + way that you should do insertion. _rl_insert_char () calls this + function. Returns the number of characters inserted. */ +int +rl_insert_text (string) + const char *string; +{ + register int i, l; + + l = (string && *string) ? strlen (string) : 0; + if (l == 0) + return 0; + + if (rl_end + l >= rl_line_buffer_len) + rl_extend_line_buffer (rl_end + l); + + for (i = rl_end; i >= rl_point; i--) + rl_line_buffer[i + l] = rl_line_buffer[i]; + strncpy (rl_line_buffer + rl_point, string, l); + + /* Remember how to undo this if we aren't undoing something. */ + if (_rl_doing_an_undo == 0) + { + /* If possible and desirable, concatenate the undos. */ + if ((l == 1) && + rl_undo_list && + (rl_undo_list->what == UNDO_INSERT) && + (rl_undo_list->end == rl_point) && + (rl_undo_list->end - rl_undo_list->start < 20)) + rl_undo_list->end++; + else + rl_add_undo (UNDO_INSERT, rl_point, rl_point + l, (char *)NULL); + } + rl_point += l; + rl_end += l; + rl_line_buffer[rl_end] = '\0'; + return l; +} + +/* Delete the string between FROM and TO. FROM is inclusive, TO is not. + Returns the number of characters deleted. */ +int +rl_delete_text (from, to) + int from, to; +{ + register char *text; + register int diff, i; + + /* Fix it if the caller is confused. */ + if (from > to) + SWAP (from, to); + + /* fix boundaries */ + if (to > rl_end) + { + to = rl_end; + if (from > to) + from = to; + } + if (from < 0) + from = 0; + + text = rl_copy_text (from, to); + + /* Some versions of strncpy() can't handle overlapping arguments. */ + diff = to - from; + for (i = from; i < rl_end - diff; i++) + rl_line_buffer[i] = rl_line_buffer[i + diff]; + + /* Remember how to undo this delete. */ + if (_rl_doing_an_undo == 0) + rl_add_undo (UNDO_DELETE, from, to, text); + else + xfree (text); + + rl_end -= diff; + rl_line_buffer[rl_end] = '\0'; + return (diff); +} + +/* Fix up point so that it is within the line boundaries after killing + text. If FIX_MARK_TOO is non-zero, the mark is forced within line + boundaries also. */ + +#define _RL_FIX_POINT(x) \ + do { \ + if (x > rl_end) \ + x = rl_end; \ + else if (x < 0) \ + x = 0; \ + } while (0) + +void +_rl_fix_point (fix_mark_too) + int fix_mark_too; +{ + _RL_FIX_POINT (rl_point); + if (fix_mark_too) + _RL_FIX_POINT (rl_mark); +} +#undef _RL_FIX_POINT + +/* Replace the contents of the line buffer between START and END with + TEXT. The operation is undoable. To replace the entire line in an + undoable mode, use _rl_replace_text(text, 0, rl_end); */ +int +_rl_replace_text (text, start, end) + const char *text; + int start, end; +{ + int n; + + n = 0; + rl_begin_undo_group (); + if (start <= end) + rl_delete_text (start, end + 1); + rl_point = start; + if (*text) + n = rl_insert_text (text); + rl_end_undo_group (); + + return n; +} + +/* Replace the current line buffer contents with TEXT. If CLEAR_UNDO is + non-zero, we free the current undo list. */ +void +rl_replace_line (text, clear_undo) + const char *text; + int clear_undo; +{ + int len; + + len = strlen (text); + if (len >= rl_line_buffer_len) + rl_extend_line_buffer (len); + strcpy (rl_line_buffer, text); + rl_end = len; + + if (clear_undo) + rl_free_undo_list (); + + _rl_fix_point (1); +} + +/* **************************************************************** */ +/* */ +/* Readline character functions */ +/* */ +/* **************************************************************** */ + +/* This is not a gap editor, just a stupid line input routine. No hair + is involved in writing any of the functions, and none should be. */ + +/* Note that: + + rl_end is the place in the string that we would place '\0'; + i.e., it is always safe to place '\0' there. + + rl_point is the place in the string where the cursor is. Sometimes + this is the same as rl_end. + + Any command that is called interactively receives two arguments. + The first is a count: the numeric arg passed to this command. + The second is the key which invoked this command. +*/ + +/* **************************************************************** */ +/* */ +/* Movement Commands */ +/* */ +/* **************************************************************** */ + +/* Note that if you `optimize' the display for these functions, you cannot + use said functions in other functions which do not do optimizing display. + I.e., you will have to update the data base for rl_redisplay, and you + might as well let rl_redisplay do that job. */ + +/* Move forward COUNT bytes. */ +int +rl_forward_byte (count, key) + int count, key; +{ + if (count < 0) + return (rl_backward_byte (-count, key)); + + if (count > 0) + { + int end, lend; + + end = rl_point + count; +#if defined (VI_MODE) + lend = rl_end > 0 ? rl_end - (VI_COMMAND_MODE()) : rl_end; +#else + lend = rl_end; +#endif + + if (end > lend) + { + rl_point = lend; + rl_ding (); + } + else + rl_point = end; + } + + if (rl_end < 0) + rl_end = 0; + + return 0; +} + +int +_rl_forward_char_internal (count) + int count; +{ + int point; + +#if defined (HANDLE_MULTIBYTE) + point = _rl_find_next_mbchar (rl_line_buffer, rl_point, count, MB_FIND_NONZERO); + +#if defined (VI_MODE) + if (point >= rl_end && VI_COMMAND_MODE()) + point = _rl_find_prev_mbchar (rl_line_buffer, rl_end, MB_FIND_NONZERO); +#endif + + if (rl_end < 0) + rl_end = 0; +#else + point = rl_point + count; + if (point > rl_end) + point = rl_end; +#endif + + return (point); +} + +#if defined (HANDLE_MULTIBYTE) +/* Move forward COUNT characters. */ +int +rl_forward_char (count, key) + int count, key; +{ + int point; + + if (MB_CUR_MAX == 1 || rl_byte_oriented) + return (rl_forward_byte (count, key)); + + if (count < 0) + return (rl_backward_char (-count, key)); + + if (count > 0) + { + if (rl_point == rl_end && EMACS_MODE()) + { + rl_ding (); + return 0; + } + + point = _rl_forward_char_internal (count); + + if (rl_point == point) + rl_ding (); + + rl_point = point; + } + + return 0; +} +#else /* !HANDLE_MULTIBYTE */ +int +rl_forward_char (count, key) + int count, key; +{ + return (rl_forward_byte (count, key)); +} +#endif /* !HANDLE_MULTIBYTE */ + +/* Backwards compatibility. */ +int +rl_forward (count, key) + int count, key; +{ + return (rl_forward_char (count, key)); +} + +/* Move backward COUNT bytes. */ +int +rl_backward_byte (count, key) + int count, key; +{ + if (count < 0) + return (rl_forward_byte (-count, key)); + + if (count > 0) + { + if (rl_point < count) + { + rl_point = 0; + rl_ding (); + } + else + rl_point -= count; + } + + if (rl_point < 0) + rl_point = 0; + + return 0; +} + +#if defined (HANDLE_MULTIBYTE) +/* Move backward COUNT characters. */ +int +rl_backward_char (count, key) + int count, key; +{ + int point; + + if (MB_CUR_MAX == 1 || rl_byte_oriented) + return (rl_backward_byte (count, key)); + + if (count < 0) + return (rl_forward_char (-count, key)); + + if (count > 0) + { + point = rl_point; + + while (count > 0 && point > 0) + { + point = _rl_find_prev_mbchar (rl_line_buffer, point, MB_FIND_NONZERO); + count--; + } + if (count > 0) + { + rl_point = 0; + rl_ding (); + } + else + rl_point = point; + } + + return 0; +} +#else +int +rl_backward_char (count, key) + int count, key; +{ + return (rl_backward_byte (count, key)); +} +#endif + +/* Backwards compatibility. */ +int +rl_backward (count, key) + int count, key; +{ + return (rl_backward_char (count, key)); +} + +/* Move to the beginning of the line. */ +int +rl_beg_of_line (count, key) + int count, key; +{ + rl_point = 0; + return 0; +} + +/* Move to the end of the line. */ +int +rl_end_of_line (count, key) + int count, key; +{ + rl_point = rl_end; + return 0; +} + +/* Move forward a word. We do what Emacs does. Handles multibyte chars. */ +int +rl_forward_word (count, key) + int count, key; +{ + int c; + + if (count < 0) + return (rl_backward_word (-count, key)); + + while (count) + { + if (rl_point == rl_end) + return 0; + + /* If we are not in a word, move forward until we are in one. + Then, move forward until we hit a non-alphabetic character. */ + c = _rl_char_value (rl_line_buffer, rl_point); + + if (_rl_walphabetic (c) == 0) + { + rl_point = MB_NEXTCHAR (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO); + while (rl_point < rl_end) + { + c = _rl_char_value (rl_line_buffer, rl_point); + if (_rl_walphabetic (c)) + break; + rl_point = MB_NEXTCHAR (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO); + } + } + + if (rl_point == rl_end) + return 0; + + rl_point = MB_NEXTCHAR (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO); + while (rl_point < rl_end) + { + c = _rl_char_value (rl_line_buffer, rl_point); + if (_rl_walphabetic (c) == 0) + break; + rl_point = MB_NEXTCHAR (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO); + } + + --count; + } + + return 0; +} + +/* Move backward a word. We do what Emacs does. Handles multibyte chars. */ +int +rl_backward_word (count, key) + int count, key; +{ + int c, p; + + if (count < 0) + return (rl_forward_word (-count, key)); + + while (count) + { + if (rl_point == 0) + return 0; + + /* Like rl_forward_word (), except that we look at the characters + just before point. */ + + p = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_NONZERO); + c = _rl_char_value (rl_line_buffer, p); + + if (_rl_walphabetic (c) == 0) + { + rl_point = p; + while (rl_point > 0) + { + p = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_NONZERO); + c = _rl_char_value (rl_line_buffer, p); + if (_rl_walphabetic (c)) + break; + rl_point = p; + } + } + + while (rl_point) + { + p = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_NONZERO); + c = _rl_char_value (rl_line_buffer, p); + if (_rl_walphabetic (c) == 0) + break; + else + rl_point = p; + } + + --count; + } + + return 0; +} + +/* Clear the current line. Numeric argument to C-l does this. */ +int +rl_refresh_line (ignore1, ignore2) + int ignore1, ignore2; +{ + int curr_line; + + curr_line = _rl_current_display_line (); + + _rl_move_vert (curr_line); + _rl_move_cursor_relative (0, rl_line_buffer); /* XXX is this right */ + + _rl_clear_to_eol (0); /* arg of 0 means to not use spaces */ + + rl_forced_update_display (); + rl_display_fixed = 1; + + return 0; +} + +/* C-l typed to a line without quoting clears the screen, and then reprints + the prompt and the current input line. Given a numeric arg, redraw only + the current line. */ +int +rl_clear_screen (count, key) + int count, key; +{ + if (rl_explicit_arg) + { + rl_refresh_line (count, key); + return 0; + } + + _rl_clear_screen (); /* calls termcap function to clear screen */ + rl_forced_update_display (); + rl_display_fixed = 1; + + return 0; +} + +int +rl_skip_csi_sequence (count, key) + int count, key; +{ + int ch; + + RL_SETSTATE (RL_STATE_MOREINPUT); + do + ch = rl_read_key (); + while (ch >= 0x20 && ch < 0x40); + RL_UNSETSTATE (RL_STATE_MOREINPUT); + + return 0; +} + +int +rl_arrow_keys (count, c) + int count, c; +{ + int ch; + + RL_SETSTATE(RL_STATE_MOREINPUT); + ch = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + + switch (_rl_to_upper (ch)) + { + case 'A': + rl_get_previous_history (count, ch); + break; + + case 'B': + rl_get_next_history (count, ch); + break; + + case 'C': + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + rl_forward_char (count, ch); + else + rl_forward_byte (count, ch); + break; + + case 'D': + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + rl_backward_char (count, ch); + else + rl_backward_byte (count, ch); + break; + + default: + rl_ding (); + } + + return 0; +} + +/* **************************************************************** */ +/* */ +/* Text commands */ +/* */ +/* **************************************************************** */ + +#ifdef HANDLE_MULTIBYTE +static char pending_bytes[MB_LEN_MAX]; +static int pending_bytes_length = 0; +static mbstate_t ps = {0}; +#endif + +/* Insert the character C at the current location, moving point forward. + If C introduces a multibyte sequence, we read the whole sequence and + then insert the multibyte char into the line buffer. */ +int +_rl_insert_char (count, c) + int count, c; +{ + register int i; + char *string; +#ifdef HANDLE_MULTIBYTE + int string_size; + char incoming[MB_LEN_MAX + 1]; + int incoming_length = 0; + mbstate_t ps_back; + static int stored_count = 0; +#endif + + if (count <= 0) + return 0; + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX == 1 || rl_byte_oriented) + { + incoming[0] = c; + incoming[1] = '\0'; + incoming_length = 1; + } + else + { + wchar_t wc; + size_t ret; + + if (stored_count <= 0) + stored_count = count; + else + count = stored_count; + + ps_back = ps; + pending_bytes[pending_bytes_length++] = c; + ret = mbrtowc (&wc, pending_bytes, pending_bytes_length, &ps); + + if (ret == (size_t)-2) + { + /* Bytes too short to compose character, try to wait for next byte. + Restore the state of the byte sequence, because in this case the + effect of mbstate is undefined. */ + ps = ps_back; + return 1; + } + else if (ret == (size_t)-1) + { + /* Invalid byte sequence for the current locale. Treat first byte + as a single character. */ + incoming[0] = pending_bytes[0]; + incoming[1] = '\0'; + incoming_length = 1; + pending_bytes_length--; + memmove (pending_bytes, pending_bytes + 1, pending_bytes_length); + /* Clear the state of the byte sequence, because in this case the + effect of mbstate is undefined. */ + memset (&ps, 0, sizeof (mbstate_t)); + } + else if (ret == (size_t)0) + { + incoming[0] = '\0'; + incoming_length = 0; + pending_bytes_length--; + /* Clear the state of the byte sequence, because in this case the + effect of mbstate is undefined. */ + memset (&ps, 0, sizeof (mbstate_t)); + } + else + { + /* We successfully read a single multibyte character. */ + memcpy (incoming, pending_bytes, pending_bytes_length); + incoming[pending_bytes_length] = '\0'; + incoming_length = pending_bytes_length; + pending_bytes_length = 0; + } + } +#endif /* HANDLE_MULTIBYTE */ + + /* If we can optimize, then do it. But don't let people crash + readline because of extra large arguments. */ + if (count > 1 && count <= TEXT_COUNT_MAX) + { +#if defined (HANDLE_MULTIBYTE) + string_size = count * incoming_length; + string = (char *)xmalloc (1 + string_size); + + i = 0; + while (i < string_size) + { + strncpy (string + i, incoming, incoming_length); + i += incoming_length; + } + incoming_length = 0; + stored_count = 0; +#else /* !HANDLE_MULTIBYTE */ + string = (char *)xmalloc (1 + count); + + for (i = 0; i < count; i++) + string[i] = c; +#endif /* !HANDLE_MULTIBYTE */ + + string[i] = '\0'; + rl_insert_text (string); + xfree (string); + + return 0; + } + + if (count > TEXT_COUNT_MAX) + { + int decreaser; +#if defined (HANDLE_MULTIBYTE) + string_size = incoming_length * TEXT_COUNT_MAX; + string = (char *)xmalloc (1 + string_size); + + i = 0; + while (i < string_size) + { + strncpy (string + i, incoming, incoming_length); + i += incoming_length; + } + + while (count) + { + decreaser = (count > TEXT_COUNT_MAX) ? TEXT_COUNT_MAX : count; + string[decreaser*incoming_length] = '\0'; + rl_insert_text (string); + count -= decreaser; + } + + xfree (string); + incoming_length = 0; + stored_count = 0; +#else /* !HANDLE_MULTIBYTE */ + char str[TEXT_COUNT_MAX+1]; + + for (i = 0; i < TEXT_COUNT_MAX; i++) + str[i] = c; + + while (count) + { + decreaser = (count > TEXT_COUNT_MAX ? TEXT_COUNT_MAX : count); + str[decreaser] = '\0'; + rl_insert_text (str); + count -= decreaser; + } +#endif /* !HANDLE_MULTIBYTE */ + + return 0; + } + + if (MB_CUR_MAX == 1 || rl_byte_oriented) + { + /* We are inserting a single character. + If there is pending input, then make a string of all of the + pending characters that are bound to rl_insert, and insert + them all. Don't do this if we're current reading input from + a macro. */ + if ((RL_ISSTATE (RL_STATE_MACROINPUT) == 0) && _rl_pushed_input_available ()) + _rl_insert_typein (c); + else + { + /* Inserting a single character. */ + char str[2]; + + str[1] = '\0'; + str[0] = c; + rl_insert_text (str); + } + } +#if defined (HANDLE_MULTIBYTE) + else + { + rl_insert_text (incoming); + stored_count = 0; + } +#endif + + return 0; +} + +/* Overwrite the character at point (or next COUNT characters) with C. + If C introduces a multibyte character sequence, read the entire sequence + before starting the overwrite loop. */ +int +_rl_overwrite_char (count, c) + int count, c; +{ + int i; +#if defined (HANDLE_MULTIBYTE) + char mbkey[MB_LEN_MAX]; + int k; + + /* Read an entire multibyte character sequence to insert COUNT times. */ + if (count > 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0) + k = _rl_read_mbstring (c, mbkey, MB_LEN_MAX); +#endif + + rl_begin_undo_group (); + + for (i = 0; i < count; i++) + { +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + rl_insert_text (mbkey); + else +#endif + _rl_insert_char (1, c); + + if (rl_point < rl_end) + rl_delete (1, c); + } + + rl_end_undo_group (); + + return 0; +} + +int +rl_insert (count, c) + int count, c; +{ + return (rl_insert_mode == RL_IM_INSERT ? _rl_insert_char (count, c) + : _rl_overwrite_char (count, c)); +} + +/* Insert the next typed character verbatim. */ +static int +_rl_insert_next (count) + int count; +{ + int c; + + RL_SETSTATE(RL_STATE_MOREINPUT); + c = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + + if (c < 0) + return -1; + + if (RL_ISSTATE (RL_STATE_MACRODEF)) + _rl_add_macro_char (c); + +#if defined (HANDLE_SIGNALS) + if (RL_ISSTATE (RL_STATE_CALLBACK) == 0) + _rl_restore_tty_signals (); +#endif + + return (_rl_insert_char (count, c)); +} + +#if defined (READLINE_CALLBACKS) +static int +_rl_insert_next_callback (data) + _rl_callback_generic_arg *data; +{ + int count; + + count = data->count; + + /* Deregister function, let rl_callback_read_char deallocate data */ + _rl_callback_func = 0; + _rl_want_redisplay = 1; + + return _rl_insert_next (count); +} +#endif + +int +rl_quoted_insert (count, key) + int count, key; +{ + /* Let's see...should the callback interface futz with signal handling? */ +#if defined (HANDLE_SIGNALS) + if (RL_ISSTATE (RL_STATE_CALLBACK) == 0) + _rl_disable_tty_signals (); +#endif + +#if defined (READLINE_CALLBACKS) + if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + _rl_callback_data = _rl_callback_data_alloc (count); + _rl_callback_func = _rl_insert_next_callback; + return (0); + } +#endif + + return _rl_insert_next (count); +} + +/* Insert a tab character. */ +int +rl_tab_insert (count, key) + int count, key; +{ + return (_rl_insert_char (count, '\t')); +} + +/* What to do when a NEWLINE is pressed. We accept the whole line. + KEY is the key that invoked this command. I guess it could have + meaning in the future. */ +int +rl_newline (count, key) + int count, key; +{ + rl_done = 1; + + if (_rl_history_preserve_point) + _rl_history_saved_point = (rl_point == rl_end) ? -1 : rl_point; + + RL_SETSTATE(RL_STATE_DONE); + +#if defined (VI_MODE) + if (rl_editing_mode == vi_mode) + { + _rl_vi_done_inserting (); + if (_rl_vi_textmod_command (_rl_vi_last_command) == 0) /* XXX */ + _rl_vi_reset_last (); + } +#endif /* VI_MODE */ + + /* If we've been asked to erase empty lines, suppress the final update, + since _rl_update_final calls rl_crlf(). */ + if (rl_erase_empty_line && rl_point == 0 && rl_end == 0) + return 0; + + if (_rl_echoing_p) + _rl_update_final (); + return 0; +} + +/* What to do for some uppercase characters, like meta characters, + and some characters appearing in emacs_ctlx_keymap. This function + is just a stub, you bind keys to it and the code in _rl_dispatch () + is special cased. */ +int +rl_do_lowercase_version (ignore1, ignore2) + int ignore1, ignore2; +{ + return 0; +} + +/* This is different from what vi does, so the code's not shared. Emacs + rubout in overwrite mode has one oddity: it replaces a control + character that's displayed as two characters (^X) with two spaces. */ +int +_rl_overwrite_rubout (count, key) + int count, key; +{ + int opoint; + int i, l; + + if (rl_point == 0) + { + rl_ding (); + return 1; + } + + opoint = rl_point; + + /* L == number of spaces to insert */ + for (i = l = 0; i < count; i++) + { + rl_backward_char (1, key); + l += rl_character_len (rl_line_buffer[rl_point], rl_point); /* not exactly right */ + } + + rl_begin_undo_group (); + + if (count > 1 || rl_explicit_arg) + rl_kill_text (opoint, rl_point); + else + rl_delete_text (opoint, rl_point); + + /* Emacs puts point at the beginning of the sequence of spaces. */ + if (rl_point < rl_end) + { + opoint = rl_point; + _rl_insert_char (l, ' '); + rl_point = opoint; + } + + rl_end_undo_group (); + + return 0; +} + +/* Rubout the character behind point. */ +int +rl_rubout (count, key) + int count, key; +{ + if (count < 0) + return (rl_delete (-count, key)); + + if (!rl_point) + { + rl_ding (); + return -1; + } + + if (rl_insert_mode == RL_IM_OVERWRITE) + return (_rl_overwrite_rubout (count, key)); + + return (_rl_rubout_char (count, key)); +} + +int +_rl_rubout_char (count, key) + int count, key; +{ + int orig_point; + unsigned char c; + + /* Duplicated code because this is called from other parts of the library. */ + if (count < 0) + return (rl_delete (-count, key)); + + if (rl_point == 0) + { + rl_ding (); + return -1; + } + + orig_point = rl_point; + if (count > 1 || rl_explicit_arg) + { + rl_backward_char (count, key); + rl_kill_text (orig_point, rl_point); + } + else if (MB_CUR_MAX == 1 || rl_byte_oriented) + { + c = rl_line_buffer[--rl_point]; + rl_delete_text (rl_point, orig_point); + /* The erase-at-end-of-line hack is of questionable merit now. */ + if (rl_point == rl_end && ISPRINT (c) && _rl_last_c_pos) + { + int l; + l = rl_character_len (c, rl_point); + _rl_erase_at_end_of_line (l); + } + } + else + { + rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_NONZERO); + rl_delete_text (rl_point, orig_point); + } + + return 0; +} + +/* Delete the character under the cursor. Given a numeric argument, + kill that many characters instead. */ +int +rl_delete (count, key) + int count, key; +{ + int xpoint; + + if (count < 0) + return (_rl_rubout_char (-count, key)); + + if (rl_point == rl_end) + { + rl_ding (); + return -1; + } + + if (count > 1 || rl_explicit_arg) + { + xpoint = rl_point; + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + rl_forward_char (count, key); + else + rl_forward_byte (count, key); + + rl_kill_text (xpoint, rl_point); + rl_point = xpoint; + } + else + { + xpoint = MB_NEXTCHAR (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO); + rl_delete_text (rl_point, xpoint); + } + return 0; +} + +/* Delete the character under the cursor, unless the insertion + point is at the end of the line, in which case the character + behind the cursor is deleted. COUNT is obeyed and may be used + to delete forward or backward that many characters. */ +int +rl_rubout_or_delete (count, key) + int count, key; +{ + if (rl_end != 0 && rl_point == rl_end) + return (_rl_rubout_char (count, key)); + else + return (rl_delete (count, key)); +} + +/* Delete all spaces and tabs around point. */ +int +rl_delete_horizontal_space (count, ignore) + int count, ignore; +{ + int start; + + while (rl_point && whitespace (rl_line_buffer[rl_point - 1])) + rl_point--; + + start = rl_point; + + while (rl_point < rl_end && whitespace (rl_line_buffer[rl_point])) + rl_point++; + + if (start != rl_point) + { + rl_delete_text (start, rl_point); + rl_point = start; + } + + if (rl_point < 0) + rl_point = 0; + + return 0; +} + +/* Like the tcsh editing function delete-char-or-list. The eof character + is caught before this is invoked, so this really does the same thing as + delete-char-or-list-or-eof, as long as it's bound to the eof character. */ +int +rl_delete_or_show_completions (count, key) + int count, key; +{ + if (rl_end != 0 && rl_point == rl_end) + return (rl_possible_completions (count, key)); + else + return (rl_delete (count, key)); +} + +#ifndef RL_COMMENT_BEGIN_DEFAULT +#define RL_COMMENT_BEGIN_DEFAULT "#" +#endif + +/* Turn the current line into a comment in shell history. + A K*rn shell style function. */ +int +rl_insert_comment (count, key) + int count, key; +{ + char *rl_comment_text; + int rl_comment_len; + + rl_beg_of_line (1, key); + rl_comment_text = _rl_comment_begin ? _rl_comment_begin : RL_COMMENT_BEGIN_DEFAULT; + + if (rl_explicit_arg == 0) + rl_insert_text (rl_comment_text); + else + { + rl_comment_len = strlen (rl_comment_text); + if (STREQN (rl_comment_text, rl_line_buffer, rl_comment_len)) + rl_delete_text (rl_point, rl_point + rl_comment_len); + else + rl_insert_text (rl_comment_text); + } + + (*rl_redisplay_function) (); + rl_newline (1, '\n'); + + return (0); +} + +/* **************************************************************** */ +/* */ +/* Changing Case */ +/* */ +/* **************************************************************** */ + +/* The three kinds of things that we know how to do. */ +#define UpCase 1 +#define DownCase 2 +#define CapCase 3 + +/* Uppercase the word at point. */ +int +rl_upcase_word (count, key) + int count, key; +{ + return (rl_change_case (count, UpCase)); +} + +/* Lowercase the word at point. */ +int +rl_downcase_word (count, key) + int count, key; +{ + return (rl_change_case (count, DownCase)); +} + +/* Upcase the first letter, downcase the rest. */ +int +rl_capitalize_word (count, key) + int count, key; +{ + return (rl_change_case (count, CapCase)); +} + +/* The meaty function. + Change the case of COUNT words, performing OP on them. + OP is one of UpCase, DownCase, or CapCase. + If a negative argument is given, leave point where it started, + otherwise, leave it where it moves to. */ +static int +rl_change_case (count, op) + int count, op; +{ + int start, next, end; + int inword, c, nc, nop; +#if defined (HANDLE_MULTIBYTE) + wchar_t wc, nwc; + char mb[MB_LEN_MAX+1]; + int mlen; + size_t m; + mbstate_t mps; +#endif + + start = rl_point; + rl_forward_word (count, 0); + end = rl_point; + + if (op != UpCase && op != DownCase && op != CapCase) + { + rl_ding (); + return -1; + } + + if (count < 0) + SWAP (start, end); + +#if defined (HANDLE_MULTIBYTE) + memset (&mps, 0, sizeof (mbstate_t)); +#endif + + /* We are going to modify some text, so let's prepare to undo it. */ + rl_modifying (start, end); + + inword = 0; + while (start < end) + { + c = _rl_char_value (rl_line_buffer, start); + /* This assumes that the upper and lower case versions are the same width. */ + next = MB_NEXTCHAR (rl_line_buffer, start, 1, MB_FIND_NONZERO); + + if (_rl_walphabetic (c) == 0) + { + inword = 0; + start = next; + continue; + } + + if (op == CapCase) + { + nop = inword ? DownCase : UpCase; + inword = 1; + } + else + nop = op; + if (MB_CUR_MAX == 1 || rl_byte_oriented || isascii (c)) + { + nc = (nop == UpCase) ? _rl_to_upper (c) : _rl_to_lower (c); + rl_line_buffer[start] = nc; + } +#if defined (HANDLE_MULTIBYTE) + else + { + m = mbrtowc (&wc, rl_line_buffer + start, end - start, &mps); + if (MB_INVALIDCH (m)) + wc = (wchar_t)rl_line_buffer[start]; + else if (MB_NULLWCH (m)) + wc = L'\0'; + nwc = (nop == UpCase) ? _rl_to_wupper (wc) : _rl_to_wlower (wc); + if (nwc != wc) /* just skip unchanged characters */ + { + mlen = wcrtomb (mb, nwc, &mps); + if (mlen > 0) + mb[mlen] = '\0'; + /* Assume the same width */ + strncpy (rl_line_buffer + start, mb, mlen); + } + } +#endif + + start = next; + } + + rl_point = end; + return 0; +} + +/* **************************************************************** */ +/* */ +/* Transposition */ +/* */ +/* **************************************************************** */ + +/* Transpose the words at point. If point is at the end of the line, + transpose the two words before point. */ +int +rl_transpose_words (count, key) + int count, key; +{ + char *word1, *word2; + int w1_beg, w1_end, w2_beg, w2_end; + int orig_point = rl_point; + + if (!count) + return 0; + + /* Find the two words. */ + rl_forward_word (count, key); + w2_end = rl_point; + rl_backward_word (1, key); + w2_beg = rl_point; + rl_backward_word (count, key); + w1_beg = rl_point; + rl_forward_word (1, key); + w1_end = rl_point; + + /* Do some check to make sure that there really are two words. */ + if ((w1_beg == w2_beg) || (w2_beg < w1_end)) + { + rl_ding (); + rl_point = orig_point; + return -1; + } + + /* Get the text of the words. */ + word1 = rl_copy_text (w1_beg, w1_end); + word2 = rl_copy_text (w2_beg, w2_end); + + /* We are about to do many insertions and deletions. Remember them + as one operation. */ + rl_begin_undo_group (); + + /* Do the stuff at word2 first, so that we don't have to worry + about word1 moving. */ + rl_point = w2_beg; + rl_delete_text (w2_beg, w2_end); + rl_insert_text (word1); + + rl_point = w1_beg; + rl_delete_text (w1_beg, w1_end); + rl_insert_text (word2); + + /* This is exactly correct since the text before this point has not + changed in length. */ + rl_point = w2_end; + + /* I think that does it. */ + rl_end_undo_group (); + xfree (word1); + xfree (word2); + + return 0; +} + +/* Transpose the characters at point. If point is at the end of the line, + then transpose the characters before point. */ +int +rl_transpose_chars (count, key) + int count, key; +{ +#if defined (HANDLE_MULTIBYTE) + char *dummy; + int i; +#else + char dummy[2]; +#endif + int char_length, prev_point; + + if (count == 0) + return 0; + + if (!rl_point || rl_end < 2) + { + rl_ding (); + return -1; + } + + rl_begin_undo_group (); + + if (rl_point == rl_end) + { + rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_NONZERO); + count = 1; + } + + prev_point = rl_point; + rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_NONZERO); + +#if defined (HANDLE_MULTIBYTE) + char_length = prev_point - rl_point; + dummy = (char *)xmalloc (char_length + 1); + for (i = 0; i < char_length; i++) + dummy[i] = rl_line_buffer[rl_point + i]; + dummy[i] = '\0'; +#else + dummy[0] = rl_line_buffer[rl_point]; + dummy[char_length = 1] = '\0'; +#endif + + rl_delete_text (rl_point, rl_point + char_length); + + rl_point = _rl_find_next_mbchar (rl_line_buffer, rl_point, count, MB_FIND_NONZERO); + + _rl_fix_point (0); + rl_insert_text (dummy); + rl_end_undo_group (); + +#if defined (HANDLE_MULTIBYTE) + xfree (dummy); +#endif + + return 0; +} + +/* **************************************************************** */ +/* */ +/* Character Searching */ +/* */ +/* **************************************************************** */ + +int +#if defined (HANDLE_MULTIBYTE) +_rl_char_search_internal (count, dir, smbchar, len) + int count, dir; + char *smbchar; + int len; +#else +_rl_char_search_internal (count, dir, schar) + int count, dir, schar; +#endif +{ + int pos, inc; +#if defined (HANDLE_MULTIBYTE) + int prepos; +#endif + + if (dir == 0) + return -1; + + pos = rl_point; + inc = (dir < 0) ? -1 : 1; + while (count) + { + if ((dir < 0 && pos <= 0) || (dir > 0 && pos >= rl_end)) + { + rl_ding (); + return -1; + } + +#if defined (HANDLE_MULTIBYTE) + pos = (inc > 0) ? _rl_find_next_mbchar (rl_line_buffer, pos, 1, MB_FIND_ANY) + : _rl_find_prev_mbchar (rl_line_buffer, pos, MB_FIND_ANY); +#else + pos += inc; +#endif + do + { +#if defined (HANDLE_MULTIBYTE) + if (_rl_is_mbchar_matched (rl_line_buffer, pos, rl_end, smbchar, len)) +#else + if (rl_line_buffer[pos] == schar) +#endif + { + count--; + if (dir < 0) + rl_point = (dir == BTO) ? _rl_find_next_mbchar (rl_line_buffer, pos, 1, MB_FIND_ANY) + : pos; + else + rl_point = (dir == FTO) ? _rl_find_prev_mbchar (rl_line_buffer, pos, MB_FIND_ANY) + : pos; + break; + } +#if defined (HANDLE_MULTIBYTE) + prepos = pos; +#endif + } +#if defined (HANDLE_MULTIBYTE) + while ((dir < 0) ? (pos = _rl_find_prev_mbchar (rl_line_buffer, pos, MB_FIND_ANY)) != prepos + : (pos = _rl_find_next_mbchar (rl_line_buffer, pos, 1, MB_FIND_ANY)) != prepos); +#else + while ((dir < 0) ? pos-- : ++pos < rl_end); +#endif + } + return (0); +} + +/* Search COUNT times for a character read from the current input stream. + FDIR is the direction to search if COUNT is non-negative; otherwise + the search goes in BDIR. So much is dependent on HANDLE_MULTIBYTE + that there are two separate versions of this function. */ +#if defined (HANDLE_MULTIBYTE) +static int +_rl_char_search (count, fdir, bdir) + int count, fdir, bdir; +{ + char mbchar[MB_LEN_MAX]; + int mb_len; + + mb_len = _rl_read_mbchar (mbchar, MB_LEN_MAX); + + if (mb_len <= 0) + return -1; + + if (count < 0) + return (_rl_char_search_internal (-count, bdir, mbchar, mb_len)); + else + return (_rl_char_search_internal (count, fdir, mbchar, mb_len)); +} +#else /* !HANDLE_MULTIBYTE */ +static int +_rl_char_search (count, fdir, bdir) + int count, fdir, bdir; +{ + int c; + + RL_SETSTATE(RL_STATE_MOREINPUT); + c = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + + if (c < 0) + return -1; + + if (count < 0) + return (_rl_char_search_internal (-count, bdir, c)); + else + return (_rl_char_search_internal (count, fdir, c)); +} +#endif /* !HANDLE_MULTIBYTE */ + +#if defined (READLINE_CALLBACKS) +static int +_rl_char_search_callback (data) + _rl_callback_generic_arg *data; +{ + _rl_callback_func = 0; + _rl_want_redisplay = 1; + + return (_rl_char_search (data->count, data->i1, data->i2)); +} +#endif + +int +rl_char_search (count, key) + int count, key; +{ +#if defined (READLINE_CALLBACKS) + if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + _rl_callback_data = _rl_callback_data_alloc (count); + _rl_callback_data->i1 = FFIND; + _rl_callback_data->i2 = BFIND; + _rl_callback_func = _rl_char_search_callback; + return (0); + } +#endif + + return (_rl_char_search (count, FFIND, BFIND)); +} + +int +rl_backward_char_search (count, key) + int count, key; +{ +#if defined (READLINE_CALLBACKS) + if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + _rl_callback_data = _rl_callback_data_alloc (count); + _rl_callback_data->i1 = BFIND; + _rl_callback_data->i2 = FFIND; + _rl_callback_func = _rl_char_search_callback; + return (0); + } +#endif + + return (_rl_char_search (count, BFIND, FFIND)); +} + +/* **************************************************************** */ +/* */ +/* The Mark and the Region. */ +/* */ +/* **************************************************************** */ + +/* Set the mark at POSITION. */ +int +_rl_set_mark_at_pos (position) + int position; +{ + if (position > rl_end) + return -1; + + rl_mark = position; + return 0; +} + +/* A bindable command to set the mark. */ +int +rl_set_mark (count, key) + int count, key; +{ + return (_rl_set_mark_at_pos (rl_explicit_arg ? count : rl_point)); +} + +/* Exchange the position of mark and point. */ +int +rl_exchange_point_and_mark (count, key) + int count, key; +{ + if (rl_mark > rl_end) + rl_mark = -1; + + if (rl_mark == -1) + { + rl_ding (); + return -1; + } + else + SWAP (rl_point, rl_mark); + + return 0; +} diff --git a/lib/readline/tilde.c b/lib/readline/tilde.c new file mode 100644 index 0000000..1c53a45 --- /dev/null +++ b/lib/readline/tilde.c @@ -0,0 +1,502 @@ +/* tilde.c -- Tilde expansion code (~/foo := $HOME/foo). */ + +/* Copyright (C) 1988-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#if defined (HAVE_STRING_H) +# include +#else /* !HAVE_STRING_H */ +# include +#endif /* !HAVE_STRING_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include +#if defined (HAVE_PWD_H) +#include +#endif + +#include "tilde.h" + +#if defined (TEST) || defined (STATIC_MALLOC) +static void *xmalloc (), *xrealloc (); +#else +# include "xmalloc.h" +#endif /* TEST || STATIC_MALLOC */ + +#if !defined (HAVE_GETPW_DECLS) +# if defined (HAVE_GETPWUID) +extern struct passwd *getpwuid PARAMS((uid_t)); +# endif +# if defined (HAVE_GETPWNAM) +extern struct passwd *getpwnam PARAMS((const char *)); +# endif +#endif /* !HAVE_GETPW_DECLS */ + +#if !defined (savestring) +#define savestring(x) strcpy ((char *)xmalloc (1 + strlen (x)), (x)) +#endif /* !savestring */ + +#if !defined (NULL) +# if defined (__STDC__) +# define NULL ((void *) 0) +# else +# define NULL 0x0 +# endif /* !__STDC__ */ +#endif /* !NULL */ + +/* If being compiled as part of bash, these will be satisfied from + variables.o. If being compiled as part of readline, they will + be satisfied from shell.o. */ +extern char *sh_get_home_dir PARAMS((void)); +extern char *sh_get_env_value PARAMS((const char *)); + +/* The default value of tilde_additional_prefixes. This is set to + whitespace preceding a tilde so that simple programs which do not + perform any word separation get desired behaviour. */ +static const char *default_prefixes[] = + { " ~", "\t~", (const char *)NULL }; + +/* The default value of tilde_additional_suffixes. This is set to + whitespace or newline so that simple programs which do not + perform any word separation get desired behaviour. */ +static const char *default_suffixes[] = + { " ", "\n", (const char *)NULL }; + +/* If non-null, this contains the address of a function that the application + wants called before trying the standard tilde expansions. The function + is called with the text sans tilde, and returns a malloc()'ed string + which is the expansion, or a NULL pointer if the expansion fails. */ +tilde_hook_func_t *tilde_expansion_preexpansion_hook = (tilde_hook_func_t *)NULL; + +/* If non-null, this contains the address of a function to call if the + standard meaning for expanding a tilde fails. The function is called + with the text (sans tilde, as in "foo"), and returns a malloc()'ed string + which is the expansion, or a NULL pointer if there is no expansion. */ +tilde_hook_func_t *tilde_expansion_failure_hook = (tilde_hook_func_t *)NULL; + +/* When non-null, this is a NULL terminated array of strings which + are duplicates for a tilde prefix. Bash uses this to expand + `=~' and `:~'. */ +char **tilde_additional_prefixes = (char **)default_prefixes; + +/* When non-null, this is a NULL terminated array of strings which match + the end of a username, instead of just "/". Bash sets this to + `:' and `=~'. */ +char **tilde_additional_suffixes = (char **)default_suffixes; + +static int tilde_find_prefix PARAMS((const char *, int *)); +static int tilde_find_suffix PARAMS((const char *)); +static char *isolate_tilde_prefix PARAMS((const char *, int *)); +static char *glue_prefix_and_suffix PARAMS((char *, const char *, int)); + +/* Find the start of a tilde expansion in STRING, and return the index of + the tilde which starts the expansion. Place the length of the text + which identified this tilde starter in LEN, excluding the tilde itself. */ +static int +tilde_find_prefix (string, len) + const char *string; + int *len; +{ + register int i, j, string_len; + register char **prefixes; + + prefixes = tilde_additional_prefixes; + + string_len = strlen (string); + *len = 0; + + if (*string == '\0' || *string == '~') + return (0); + + if (prefixes) + { + for (i = 0; i < string_len; i++) + { + for (j = 0; prefixes[j]; j++) + { + if (strncmp (string + i, prefixes[j], strlen (prefixes[j])) == 0) + { + *len = strlen (prefixes[j]) - 1; + return (i + *len); + } + } + } + } + return (string_len); +} + +/* Find the end of a tilde expansion in STRING, and return the index of + the character which ends the tilde definition. */ +static int +tilde_find_suffix (string) + const char *string; +{ + register int i, j, string_len; + register char **suffixes; + + suffixes = tilde_additional_suffixes; + string_len = strlen (string); + + for (i = 0; i < string_len; i++) + { +#if defined (__MSDOS__) + if (string[i] == '/' || string[i] == '\\' /* || !string[i] */) +#else + if (string[i] == '/' /* || !string[i] */) +#endif + break; + + for (j = 0; suffixes && suffixes[j]; j++) + { + if (strncmp (string + i, suffixes[j], strlen (suffixes[j])) == 0) + return (i); + } + } + return (i); +} + +/* Return a new string which is the result of tilde expanding STRING. */ +char * +tilde_expand (string) + const char *string; +{ + char *result; + int result_size, result_index; + + result_index = result_size = 0; + if (result = strchr (string, '~')) + result = (char *)xmalloc (result_size = (strlen (string) + 16)); + else + result = (char *)xmalloc (result_size = (strlen (string) + 1)); + + /* Scan through STRING expanding tildes as we come to them. */ + while (1) + { + register int start, end; + char *tilde_word, *expansion; + int len; + + /* Make START point to the tilde which starts the expansion. */ + start = tilde_find_prefix (string, &len); + + /* Copy the skipped text into the result. */ + if ((result_index + start + 1) > result_size) + result = (char *)xrealloc (result, 1 + (result_size += (start + 20))); + + strncpy (result + result_index, string, start); + result_index += start; + + /* Advance STRING to the starting tilde. */ + string += start; + + /* Make END be the index of one after the last character of the + username. */ + end = tilde_find_suffix (string); + + /* If both START and END are zero, we are all done. */ + if (!start && !end) + break; + + /* Expand the entire tilde word, and copy it into RESULT. */ + tilde_word = (char *)xmalloc (1 + end); + strncpy (tilde_word, string, end); + tilde_word[end] = '\0'; + string += end; + + expansion = tilde_expand_word (tilde_word); + xfree (tilde_word); + + len = strlen (expansion); +#ifdef __CYGWIN__ + /* Fix for Cygwin to prevent ~user/xxx from expanding to //xxx when + $HOME for `user' is /. On cygwin, // denotes a network drive. */ + if (len > 1 || *expansion != '/' || *string != '/') +#endif + { + if ((result_index + len + 1) > result_size) + result = (char *)xrealloc (result, 1 + (result_size += (len + 20))); + + strcpy (result + result_index, expansion); + result_index += len; + } + xfree (expansion); + } + + result[result_index] = '\0'; + + return (result); +} + +/* Take FNAME and return the tilde prefix we want expanded. If LENP is + non-null, the index of the end of the prefix into FNAME is returned in + the location it points to. */ +static char * +isolate_tilde_prefix (fname, lenp) + const char *fname; + int *lenp; +{ + char *ret; + int i; + + ret = (char *)xmalloc (strlen (fname)); +#if defined (__MSDOS__) + for (i = 1; fname[i] && fname[i] != '/' && fname[i] != '\\'; i++) +#else + for (i = 1; fname[i] && fname[i] != '/'; i++) +#endif + ret[i - 1] = fname[i]; + ret[i - 1] = '\0'; + if (lenp) + *lenp = i; + return ret; +} + +#if 0 +/* Public function to scan a string (FNAME) beginning with a tilde and find + the portion of the string that should be passed to the tilde expansion + function. Right now, it just calls tilde_find_suffix and allocates new + memory, but it can be expanded to do different things later. */ +char * +tilde_find_word (fname, flags, lenp) + const char *fname; + int flags, *lenp; +{ + int x; + char *r; + + x = tilde_find_suffix (fname); + if (x == 0) + { + r = savestring (fname); + if (lenp) + *lenp = 0; + } + else + { + r = (char *)xmalloc (1 + x); + strncpy (r, fname, x); + r[x] = '\0'; + if (lenp) + *lenp = x; + } + + return r; +} +#endif + +/* Return a string that is PREFIX concatenated with SUFFIX starting at + SUFFIND. */ +static char * +glue_prefix_and_suffix (prefix, suffix, suffind) + char *prefix; + const char *suffix; + int suffind; +{ + char *ret; + int plen, slen; + + plen = (prefix && *prefix) ? strlen (prefix) : 0; + slen = strlen (suffix + suffind); + ret = (char *)xmalloc (plen + slen + 1); + if (plen) + strcpy (ret, prefix); + strcpy (ret + plen, suffix + suffind); + return ret; +} + +/* Do the work of tilde expansion on FILENAME. FILENAME starts with a + tilde. If there is no expansion, call tilde_expansion_failure_hook. + This always returns a newly-allocated string, never static storage. */ +char * +tilde_expand_word (filename) + const char *filename; +{ + char *dirname, *expansion, *username; + int user_len; + struct passwd *user_entry; + + if (filename == 0) + return ((char *)NULL); + + if (*filename != '~') + return (savestring (filename)); + + /* A leading `~/' or a bare `~' is *always* translated to the value of + $HOME or the home directory of the current user, regardless of any + preexpansion hook. */ + if (filename[1] == '\0' || filename[1] == '/') + { + /* Prefix $HOME to the rest of the string. */ + expansion = sh_get_env_value ("HOME"); + + /* If there is no HOME variable, look up the directory in + the password database. */ + if (expansion == 0) + expansion = sh_get_home_dir (); + + return (glue_prefix_and_suffix (expansion, filename, 1)); + } + + username = isolate_tilde_prefix (filename, &user_len); + + if (tilde_expansion_preexpansion_hook) + { + expansion = (*tilde_expansion_preexpansion_hook) (username); + if (expansion) + { + dirname = glue_prefix_and_suffix (expansion, filename, user_len); + xfree (username); + xfree (expansion); + return (dirname); + } + } + + /* No preexpansion hook, or the preexpansion hook failed. Look in the + password database. */ + dirname = (char *)NULL; +#if defined (HAVE_GETPWNAM) + user_entry = getpwnam (username); +#else + user_entry = 0; +#endif + if (user_entry == 0) + { + /* If the calling program has a special syntax for expanding tildes, + and we couldn't find a standard expansion, then let them try. */ + if (tilde_expansion_failure_hook) + { + expansion = (*tilde_expansion_failure_hook) (username); + if (expansion) + { + dirname = glue_prefix_and_suffix (expansion, filename, user_len); + xfree (expansion); + } + } + /* If we don't have a failure hook, or if the failure hook did not + expand the tilde, return a copy of what we were passed. */ + if (dirname == 0) + dirname = savestring (filename); + } +#if defined (HAVE_GETPWENT) + else + dirname = glue_prefix_and_suffix (user_entry->pw_dir, filename, user_len); +#endif + + xfree (username); +#if defined (HAVE_GETPWENT) + endpwent (); +#endif + return (dirname); +} + + +#if defined (TEST) +#undef NULL +#include + +main (argc, argv) + int argc; + char **argv; +{ + char *result, line[512]; + int done = 0; + + while (!done) + { + printf ("~expand: "); + fflush (stdout); + + if (!gets (line)) + strcpy (line, "done"); + + if ((strcmp (line, "done") == 0) || + (strcmp (line, "quit") == 0) || + (strcmp (line, "exit") == 0)) + { + done = 1; + break; + } + + result = tilde_expand (line); + printf (" --> %s\n", result); + free (result); + } + exit (0); +} + +static void memory_error_and_abort (); + +static void * +xmalloc (bytes) + size_t bytes; +{ + void *temp = (char *)malloc (bytes); + + if (!temp) + memory_error_and_abort (); + return (temp); +} + +static void * +xrealloc (pointer, bytes) + void *pointer; + int bytes; +{ + void *temp; + + if (!pointer) + temp = malloc (bytes); + else + temp = realloc (pointer, bytes); + + if (!temp) + memory_error_and_abort (); + + return (temp); +} + +static void +memory_error_and_abort () +{ + fprintf (stderr, "readline: out of virtual memory\n"); + abort (); +} + +/* + * Local variables: + * compile-command: "gcc -g -DTEST -o tilde tilde.c" + * end: + */ +#endif /* TEST */ diff --git a/lib/readline/tilde.h b/lib/readline/tilde.h new file mode 100644 index 0000000..e26dd04 --- /dev/null +++ b/lib/readline/tilde.h @@ -0,0 +1,80 @@ +/* tilde.h: Externally available variables and function in libtilde.a. */ + +/* Copyright (C) 1992-2009 Free Software Foundation, Inc. + + This file contains the Readline Library (Readline), a set of + routines for providing Emacs style line input to programs that ask + for it. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if !defined (_TILDE_H_) +# define _TILDE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* A function can be defined using prototypes and compile on both ANSI C + and traditional C compilers with something like this: + extern char *func PARAMS((char *, char *, int)); */ + +#if !defined (PARAMS) +# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus) +# define PARAMS(protos) protos +# else +# define PARAMS(protos) () +# endif +#endif + +typedef char *tilde_hook_func_t PARAMS((char *)); + +/* If non-null, this contains the address of a function that the application + wants called before trying the standard tilde expansions. The function + is called with the text sans tilde, and returns a malloc()'ed string + which is the expansion, or a NULL pointer if the expansion fails. */ +extern tilde_hook_func_t *tilde_expansion_preexpansion_hook; + +/* If non-null, this contains the address of a function to call if the + standard meaning for expanding a tilde fails. The function is called + with the text (sans tilde, as in "foo"), and returns a malloc()'ed string + which is the expansion, or a NULL pointer if there is no expansion. */ +extern tilde_hook_func_t *tilde_expansion_failure_hook; + +/* When non-null, this is a NULL terminated array of strings which + are duplicates for a tilde prefix. Bash uses this to expand + `=~' and `:~'. */ +extern char **tilde_additional_prefixes; + +/* When non-null, this is a NULL terminated array of strings which match + the end of a username, instead of just "/". Bash sets this to + `:' and `=~'. */ +extern char **tilde_additional_suffixes; + +/* Return a new string which is the result of tilde expanding STRING. */ +extern char *tilde_expand PARAMS((const char *)); + +/* Do the work of tilde expansion on FILENAME. FILENAME starts with a + tilde. If there is no expansion, call tilde_expansion_failure_hook. */ +extern char *tilde_expand_word PARAMS((const char *)); + +/* Find the portion of the string beginning with ~ that should be expanded. */ +extern char *tilde_find_word PARAMS((const char *, int, int *)); + +#ifdef __cplusplus +} +#endif + +#endif /* _TILDE_H_ */ diff --git a/lib/readline/undo.c b/lib/readline/undo.c new file mode 100644 index 0000000..e9369b1 --- /dev/null +++ b/lib/readline/undo.c @@ -0,0 +1,354 @@ +/* readline.c -- a general facility for reading lines of input + with emacs style editing and completion. */ + +/* Copyright (C) 1987-2012 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include + +#if defined (HAVE_UNISTD_H) +# include /* for _POSIX_VERSION */ +#endif /* HAVE_UNISTD_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" + +/* Some standard library routines. */ +#include "readline.h" +#include "history.h" + +#include "rlprivate.h" +#include "xmalloc.h" + +extern void replace_history_data PARAMS((int, histdata_t *, histdata_t *)); + +/* Non-zero tells rl_delete_text and rl_insert_text to not add to + the undo list. */ +int _rl_doing_an_undo = 0; + +/* How many unclosed undo groups we currently have. */ +int _rl_undo_group_level = 0; + +/* The current undo list for THE_LINE. */ +UNDO_LIST *rl_undo_list = (UNDO_LIST *)NULL; + +/* **************************************************************** */ +/* */ +/* Undo, and Undoing */ +/* */ +/* **************************************************************** */ + +static UNDO_LIST * +alloc_undo_entry (what, start, end, text) + enum undo_code what; + int start, end; + char *text; +{ + UNDO_LIST *temp; + + temp = (UNDO_LIST *)xmalloc (sizeof (UNDO_LIST)); + temp->what = what; + temp->start = start; + temp->end = end; + temp->text = text; + + temp->next = (UNDO_LIST *)NULL; + return temp; +} + +/* Remember how to undo something. Concatenate some undos if that + seems right. */ +void +rl_add_undo (what, start, end, text) + enum undo_code what; + int start, end; + char *text; +{ + UNDO_LIST *temp; + + temp = alloc_undo_entry (what, start, end, text); + temp->next = rl_undo_list; + rl_undo_list = temp; +} + +/* Free an UNDO_LIST */ +void +_rl_free_undo_list (ul) + UNDO_LIST *ul; +{ + UNDO_LIST *release; + + while (ul) + { + release = ul; + ul = ul->next; + + if (release->what == UNDO_DELETE) + xfree (release->text); + + xfree (release); + } +} + +/* Free the existing undo list. */ +void +rl_free_undo_list () +{ + UNDO_LIST *release, *orig_list; + + orig_list = rl_undo_list; + _rl_free_undo_list (rl_undo_list); + rl_undo_list = (UNDO_LIST *)NULL; + replace_history_data (-1, (histdata_t *)orig_list, (histdata_t *)NULL); +} + +UNDO_LIST * +_rl_copy_undo_entry (entry) + UNDO_LIST *entry; +{ + UNDO_LIST *new; + + new = alloc_undo_entry (entry->what, entry->start, entry->end, (char *)NULL); + new->text = entry->text ? savestring (entry->text) : 0; + return new; +} + +UNDO_LIST * +_rl_copy_undo_list (head) + UNDO_LIST *head; +{ + UNDO_LIST *list, *new, *roving, *c; + + if (head == 0) + return head; + + list = head; + new = 0; + while (list) + { + c = _rl_copy_undo_entry (list); + if (new == 0) + roving = new = c; + else + { + roving->next = c; + roving = roving->next; + } + list = list->next; + } + + roving->next = 0; + return new; +} + +/* Undo the next thing in the list. Return 0 if there + is nothing to undo, or non-zero if there was. */ +int +rl_do_undo () +{ + UNDO_LIST *release; + int waiting_for_begin, start, end; + HIST_ENTRY *cur, *temp; + +#define TRANS(i) ((i) == -1 ? rl_point : ((i) == -2 ? rl_end : (i))) + + start = end = waiting_for_begin = 0; + do + { + if (rl_undo_list == 0) + return (0); + + _rl_doing_an_undo = 1; + RL_SETSTATE(RL_STATE_UNDOING); + + /* To better support vi-mode, a start or end value of -1 means + rl_point, and a value of -2 means rl_end. */ + if (rl_undo_list->what == UNDO_DELETE || rl_undo_list->what == UNDO_INSERT) + { + start = TRANS (rl_undo_list->start); + end = TRANS (rl_undo_list->end); + } + + switch (rl_undo_list->what) + { + /* Undoing deletes means inserting some text. */ + case UNDO_DELETE: + rl_point = start; + rl_insert_text (rl_undo_list->text); + xfree (rl_undo_list->text); + break; + + /* Undoing inserts means deleting some text. */ + case UNDO_INSERT: + rl_delete_text (start, end); + rl_point = start; + break; + + /* Undoing an END means undoing everything 'til we get to a BEGIN. */ + case UNDO_END: + waiting_for_begin++; + break; + + /* Undoing a BEGIN means that we are done with this group. */ + case UNDO_BEGIN: + if (waiting_for_begin) + waiting_for_begin--; + else + rl_ding (); + break; + } + + _rl_doing_an_undo = 0; + RL_UNSETSTATE(RL_STATE_UNDOING); + + release = rl_undo_list; + rl_undo_list = rl_undo_list->next; + + /* If we are editing a history entry, make sure the change is replicated + in the history entry's line */ + cur = current_history (); + if (cur && cur->data && (UNDO_LIST *)cur->data == release) + { + temp = replace_history_entry (where_history (), rl_line_buffer, (histdata_t)rl_undo_list); + xfree (temp->line); + FREE (temp->timestamp); + xfree (temp); + } + + replace_history_data (-1, (histdata_t *)release, (histdata_t *)rl_undo_list); + + xfree (release); + } + while (waiting_for_begin); + + return (1); +} +#undef TRANS + +int +_rl_fix_last_undo_of_type (type, start, end) + int type, start, end; +{ + UNDO_LIST *rl; + + for (rl = rl_undo_list; rl; rl = rl->next) + { + if (rl->what == type) + { + rl->start = start; + rl->end = end; + return 0; + } + } + return 1; +} + +/* Begin a group. Subsequent undos are undone as an atomic operation. */ +int +rl_begin_undo_group () +{ + rl_add_undo (UNDO_BEGIN, 0, 0, 0); + _rl_undo_group_level++; + return 0; +} + +/* End an undo group started with rl_begin_undo_group (). */ +int +rl_end_undo_group () +{ + rl_add_undo (UNDO_END, 0, 0, 0); + _rl_undo_group_level--; + return 0; +} + +/* Save an undo entry for the text from START to END. */ +int +rl_modifying (start, end) + int start, end; +{ + if (start > end) + { + SWAP (start, end); + } + + if (start != end) + { + char *temp = rl_copy_text (start, end); + rl_begin_undo_group (); + rl_add_undo (UNDO_DELETE, start, end, temp); + rl_add_undo (UNDO_INSERT, start, end, (char *)NULL); + rl_end_undo_group (); + } + return 0; +} + +/* Revert the current line to its previous state. */ +int +rl_revert_line (count, key) + int count, key; +{ + if (rl_undo_list == 0) + rl_ding (); + else + { + while (rl_undo_list) + rl_do_undo (); +#if defined (VI_MODE) + if (rl_editing_mode == vi_mode) + rl_point = rl_mark = 0; /* rl_end should be set correctly */ +#endif + } + + return 0; +} + +/* Do some undoing of things that were done. */ +int +rl_undo_command (count, key) + int count, key; +{ + if (count < 0) + return 0; /* Nothing to do. */ + + while (count) + { + if (rl_do_undo ()) + count--; + else + { + rl_ding (); + break; + } + } + return 0; +} diff --git a/lib/readline/util.c b/lib/readline/util.c new file mode 100644 index 0000000..fa3a667 --- /dev/null +++ b/lib/readline/util.c @@ -0,0 +1,591 @@ +/* util.c -- readline utility functions */ + +/* Copyright (C) 1987-2012 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include +#include +#include "posixjmp.h" + +#if defined (HAVE_UNISTD_H) +# include /* for _POSIX_VERSION */ +#endif /* HAVE_UNISTD_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include +#include + +/* System-specific feature definitions and include files. */ +#include "rldefs.h" +#include "rlmbutil.h" + +#if defined (TIOCSTAT_IN_SYS_IOCTL) +# include +#endif /* TIOCSTAT_IN_SYS_IOCTL */ + +/* Some standard library routines. */ +#include "readline.h" + +#include "rlprivate.h" +#include "xmalloc.h" + +/* **************************************************************** */ +/* */ +/* Utility Functions */ +/* */ +/* **************************************************************** */ + +/* Return 0 if C is not a member of the class of characters that belong + in words, or 1 if it is. */ + +int _rl_allow_pathname_alphabetic_chars = 0; +static const char * const pathname_alphabetic_chars = "/-_=~.#$"; + +int +rl_alphabetic (c) + int c; +{ + if (ALPHABETIC (c)) + return (1); + + return (_rl_allow_pathname_alphabetic_chars && + strchr (pathname_alphabetic_chars, c) != NULL); +} + +#if defined (HANDLE_MULTIBYTE) +int +_rl_walphabetic (wchar_t wc) +{ + int c; + + if (iswalnum (wc)) + return (1); + + c = wc & 0177; + return (_rl_allow_pathname_alphabetic_chars && + strchr (pathname_alphabetic_chars, c) != NULL); +} +#endif + +/* How to abort things. */ +int +_rl_abort_internal () +{ + rl_ding (); + rl_clear_message (); + _rl_reset_argument (); + rl_clear_pending_input (); + + RL_UNSETSTATE (RL_STATE_MACRODEF); + while (rl_executing_macro) + _rl_pop_executing_macro (); + + rl_last_func = (rl_command_func_t *)NULL; +#if defined (HAVE_POSIX_SIGSETJMP) + siglongjmp (_rl_top_level, 1); +#else + longjmp (_rl_top_level, 1); +#endif + return (0); +} + +int +rl_abort (count, key) + int count, key; +{ + return (_rl_abort_internal ()); +} + +int +_rl_null_function (count, key) + int count, key; +{ + return 0; +} + +int +rl_tty_status (count, key) + int count, key; +{ +#if defined (TIOCSTAT) + ioctl (1, TIOCSTAT, (char *)0); + rl_refresh_line (count, key); +#else + rl_ding (); +#endif + return 0; +} + +/* Return a copy of the string between FROM and TO. + FROM is inclusive, TO is not. */ +char * +rl_copy_text (from, to) + int from, to; +{ + register int length; + char *copy; + + /* Fix it if the caller is confused. */ + if (from > to) + SWAP (from, to); + + length = to - from; + copy = (char *)xmalloc (1 + length); + strncpy (copy, rl_line_buffer + from, length); + copy[length] = '\0'; + return (copy); +} + +/* Increase the size of RL_LINE_BUFFER until it has enough space to hold + LEN characters. */ +void +rl_extend_line_buffer (len) + int len; +{ + while (len >= rl_line_buffer_len) + { + rl_line_buffer_len += DEFAULT_BUFFER_SIZE; + rl_line_buffer = (char *)xrealloc (rl_line_buffer, rl_line_buffer_len); + } + + _rl_set_the_line (); +} + + +/* A function for simple tilde expansion. */ +int +rl_tilde_expand (ignore, key) + int ignore, key; +{ + register int start, end; + char *homedir, *temp; + int len; + + end = rl_point; + start = end - 1; + + if (rl_point == rl_end && rl_line_buffer[rl_point] == '~') + { + homedir = tilde_expand ("~"); + _rl_replace_text (homedir, start, end); + xfree (homedir); + return (0); + } + else if (rl_line_buffer[start] != '~') + { + for (; !whitespace (rl_line_buffer[start]) && start >= 0; start--) + ; + start++; + } + + end = start; + do + end++; + while (whitespace (rl_line_buffer[end]) == 0 && end < rl_end); + + if (whitespace (rl_line_buffer[end]) || end >= rl_end) + end--; + + /* If the first character of the current word is a tilde, perform + tilde expansion and insert the result. If not a tilde, do + nothing. */ + if (rl_line_buffer[start] == '~') + { + len = end - start + 1; + temp = (char *)xmalloc (len + 1); + strncpy (temp, rl_line_buffer + start, len); + temp[len] = '\0'; + homedir = tilde_expand (temp); + xfree (temp); + + _rl_replace_text (homedir, start, end); + xfree (homedir); + } + + return (0); +} + +#if defined (USE_VARARGS) +void +#if defined (PREFER_STDARG) +_rl_ttymsg (const char *format, ...) +#else +_rl_ttymsg (va_alist) + va_dcl +#endif +{ + va_list args; +#if defined (PREFER_VARARGS) + char *format; +#endif + +#if defined (PREFER_STDARG) + va_start (args, format); +#else + va_start (args); + format = va_arg (args, char *); +#endif + + fprintf (stderr, "readline: "); + vfprintf (stderr, format, args); + fprintf (stderr, "\n"); + fflush (stderr); + + va_end (args); + + rl_forced_update_display (); +} + +void +#if defined (PREFER_STDARG) +_rl_errmsg (const char *format, ...) +#else +_rl_errmsg (va_alist) + va_dcl +#endif +{ + va_list args; +#if defined (PREFER_VARARGS) + char *format; +#endif + +#if defined (PREFER_STDARG) + va_start (args, format); +#else + va_start (args); + format = va_arg (args, char *); +#endif + + fprintf (stderr, "readline: "); + vfprintf (stderr, format, args); + fprintf (stderr, "\n"); + fflush (stderr); + + va_end (args); +} + +#else /* !USE_VARARGS */ +void +_rl_ttymsg (format, arg1, arg2) + char *format; +{ + fprintf (stderr, "readline: "); + fprintf (stderr, format, arg1, arg2); + fprintf (stderr, "\n"); + + rl_forced_update_display (); +} + +void +_rl_errmsg (format, arg1, arg2) + char *format; +{ + fprintf (stderr, "readline: "); + fprintf (stderr, format, arg1, arg2); + fprintf (stderr, "\n"); +} +#endif /* !USE_VARARGS */ + +/* **************************************************************** */ +/* */ +/* String Utility Functions */ +/* */ +/* **************************************************************** */ + +/* Determine if s2 occurs in s1. If so, return a pointer to the + match in s1. The compare is case insensitive. */ +char * +_rl_strindex (s1, s2) + register const char *s1, *s2; +{ + register int i, l, len; + + for (i = 0, l = strlen (s2), len = strlen (s1); (len - i) >= l; i++) + if (_rl_strnicmp (s1 + i, s2, l) == 0) + return ((char *) (s1 + i)); + return ((char *)NULL); +} + +#ifndef HAVE_STRPBRK +/* Find the first occurrence in STRING1 of any character from STRING2. + Return a pointer to the character in STRING1. */ +char * +_rl_strpbrk (string1, string2) + const char *string1, *string2; +{ + register const char *scan; +#if defined (HANDLE_MULTIBYTE) + mbstate_t ps; + register int i, v; + + memset (&ps, 0, sizeof (mbstate_t)); +#endif + + for (; *string1; string1++) + { + for (scan = string2; *scan; scan++) + { + if (*string1 == *scan) + return ((char *)string1); + } +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + v = _rl_get_char_len (string1, &ps); + if (v > 1) + string1 += v - 1; /* -1 to account for auto-increment in loop */ + } +#endif + } + return ((char *)NULL); +} +#endif + +#if !defined (HAVE_STRCASECMP) +/* Compare at most COUNT characters from string1 to string2. Case + doesn't matter (strncasecmp). */ +int +_rl_strnicmp (string1, string2, count) + const char *string1; + const char *string2; + int count; +{ + register const char *s1; + register const char *s2; + register int d; + + if (count <= 0 || (string1 == string2)) + return 0; + + s1 = string1; + s2 = string2; + do + { + d = _rl_to_lower (*s1) - _rl_to_lower (*s2); /* XXX - cast to unsigned char? */ + if (d != 0) + return d; + if (*s1++ == '\0') + break; + s2++; + } + while (--count != 0); + + return (0); +} + +/* strcmp (), but caseless (strcasecmp). */ +int +_rl_stricmp (string1, string2) + const char *string1; + const char *string2; +{ + register const char *s1; + register const char *s2; + register int d; + + s1 = string1; + s2 = string2; + + if (s1 == s2) + return 0; + + while ((d = _rl_to_lower (*s1) - _rl_to_lower (*s2)) == 0) + { + if (*s1++ == '\0') + return 0; + s2++; + } + + return (d); +} +#endif /* !HAVE_STRCASECMP */ + +/* Stupid comparison routine for qsort () ing strings. */ +int +_rl_qsort_string_compare (s1, s2) + char **s1, **s2; +{ +#if defined (HAVE_STRCOLL) + return (strcoll (*s1, *s2)); +#else + int result; + + result = **s1 - **s2; + if (result == 0) + result = strcmp (*s1, *s2); + + return result; +#endif +} + +/* Function equivalents for the macros defined in chardefs.h. */ +#define FUNCTION_FOR_MACRO(f) int (f) (c) int c; { return f (c); } + +FUNCTION_FOR_MACRO (_rl_digit_p) +FUNCTION_FOR_MACRO (_rl_digit_value) +FUNCTION_FOR_MACRO (_rl_lowercase_p) +FUNCTION_FOR_MACRO (_rl_pure_alphabetic) +FUNCTION_FOR_MACRO (_rl_to_lower) +FUNCTION_FOR_MACRO (_rl_to_upper) +FUNCTION_FOR_MACRO (_rl_uppercase_p) + +/* A convenience function, to force memory deallocation to be performed + by readline. DLLs on Windows apparently require this. */ +void +rl_free (mem) + void *mem; +{ + if (mem) + free (mem); +} + +/* Backwards compatibility, now that savestring has been removed from + all `public' readline header files. */ +#undef _rl_savestring +char * +_rl_savestring (s) + const char *s; +{ + return (strcpy ((char *)xmalloc (1 + (int)strlen (s)), (s))); +} + +#if defined (USE_VARARGS) +static FILE *_rl_tracefp; + +void +#if defined (PREFER_STDARG) +_rl_trace (const char *format, ...) +#else +_rl_trace (va_alist) + va_dcl +#endif +{ + va_list args; +#if defined (PREFER_VARARGS) + char *format; +#endif + +#if defined (PREFER_STDARG) + va_start (args, format); +#else + va_start (args); + format = va_arg (args, char *); +#endif + + if (_rl_tracefp == 0) + _rl_tropen (); + vfprintf (_rl_tracefp, format, args); + fprintf (_rl_tracefp, "\n"); + fflush (_rl_tracefp); + + va_end (args); +} + +int +_rl_tropen () +{ + char fnbuf[128]; + + if (_rl_tracefp) + fclose (_rl_tracefp); + sprintf (fnbuf, "/var/tmp/rltrace.%ld", (long)getpid()); + unlink(fnbuf); + _rl_tracefp = fopen (fnbuf, "w+"); + return _rl_tracefp != 0; +} + +int +_rl_trclose () +{ + int r; + + r = fclose (_rl_tracefp); + _rl_tracefp = 0; + return r; +} + +void +_rl_settracefp (fp) + FILE *fp; +{ + _rl_tracefp = fp; +} +#endif + + +#if HAVE_DECL_AUDIT_USER_TTY && defined (ENABLE_TTY_AUDIT_SUPPORT) +#include +#include +#include + +/* Report STRING to the audit system. */ +void +_rl_audit_tty (string) + char *string; +{ + struct sockaddr_nl addr; + struct msghdr msg; + struct nlmsghdr nlm; + struct iovec iov[2]; + size_t size; + int fd; + + fd = socket (AF_NETLINK, SOCK_RAW, NETLINK_AUDIT); + if (fd < 0) + return; + size = strlen (string) + 1; + + nlm.nlmsg_len = NLMSG_LENGTH (size); + nlm.nlmsg_type = AUDIT_USER_TTY; + nlm.nlmsg_flags = NLM_F_REQUEST; + nlm.nlmsg_seq = 0; + nlm.nlmsg_pid = 0; + + iov[0].iov_base = &nlm; + iov[0].iov_len = sizeof (nlm); + iov[1].iov_base = string; + iov[1].iov_len = size; + + addr.nl_family = AF_NETLINK; + addr.nl_pid = 0; + addr.nl_groups = 0; + + msg.msg_name = &addr; + msg.msg_namelen = sizeof (addr); + msg.msg_iov = iov; + msg.msg_iovlen = 2; + msg.msg_control = NULL; + msg.msg_controllen = 0; + msg.msg_flags = 0; + + (void)sendmsg (fd, &msg, 0); + close (fd); +} +#endif diff --git a/lib/readline/vi_keymap.c b/lib/readline/vi_keymap.c new file mode 100644 index 0000000..60c925d --- /dev/null +++ b/lib/readline/vi_keymap.c @@ -0,0 +1,875 @@ +/* vi_keymap.c -- the keymap for vi_mode in readline (). */ + +/* Copyright (C) 1987-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if !defined (BUFSIZ) +#include +#endif /* !BUFSIZ */ + +#include "readline.h" + +#if 0 +extern KEYMAP_ENTRY_ARRAY vi_escape_keymap; +#endif + +/* The keymap arrays for handling vi mode. */ +KEYMAP_ENTRY_ARRAY vi_movement_keymap = { + /* The regular control keys come first. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-@ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-a */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-b */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-c */ + { ISFUNC, rl_vi_eof_maybe }, /* Control-d */ + { ISFUNC, rl_emacs_editing_mode }, /* Control-e */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-f */ + { ISFUNC, rl_abort }, /* Control-g */ + { ISFUNC, rl_backward_char }, /* Control-h */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-i */ + { ISFUNC, rl_newline }, /* Control-j */ + { ISFUNC, rl_kill_line }, /* Control-k */ + { ISFUNC, rl_clear_screen }, /* Control-l */ + { ISFUNC, rl_newline }, /* Control-m */ + { ISFUNC, rl_get_next_history }, /* Control-n */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-o */ + { ISFUNC, rl_get_previous_history }, /* Control-p */ + { ISFUNC, rl_quoted_insert }, /* Control-q */ + { ISFUNC, rl_reverse_search_history }, /* Control-r */ + { ISFUNC, rl_forward_search_history }, /* Control-s */ + { ISFUNC, rl_transpose_chars }, /* Control-t */ + { ISFUNC, rl_unix_line_discard }, /* Control-u */ + { ISFUNC, rl_quoted_insert }, /* Control-v */ + { ISFUNC, rl_unix_word_rubout }, /* Control-w */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-x */ + { ISFUNC, rl_yank }, /* Control-y */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-z */ + + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-[ */ /* vi_escape_keymap */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-\ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-] */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-^ */ + { ISFUNC, rl_vi_undo }, /* Control-_ */ + + /* The start of printing characters. */ + { ISFUNC, rl_forward_char }, /* SPACE */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ! */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* " */ + { ISFUNC, rl_insert_comment }, /* # */ + { ISFUNC, rl_end_of_line }, /* $ */ + { ISFUNC, rl_vi_match }, /* % */ + { ISFUNC, rl_vi_tilde_expand }, /* & */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ' */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ( */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ) */ + { ISFUNC, rl_vi_complete }, /* * */ + { ISFUNC, rl_get_next_history}, /* + */ + { ISFUNC, rl_vi_char_search }, /* , */ + { ISFUNC, rl_get_previous_history }, /* - */ + { ISFUNC, rl_vi_redo }, /* . */ + { ISFUNC, rl_vi_search }, /* / */ + + /* Regular digits. */ + { ISFUNC, rl_beg_of_line }, /* 0 */ + { ISFUNC, rl_vi_arg_digit }, /* 1 */ + { ISFUNC, rl_vi_arg_digit }, /* 2 */ + { ISFUNC, rl_vi_arg_digit }, /* 3 */ + { ISFUNC, rl_vi_arg_digit }, /* 4 */ + { ISFUNC, rl_vi_arg_digit }, /* 5 */ + { ISFUNC, rl_vi_arg_digit }, /* 6 */ + { ISFUNC, rl_vi_arg_digit }, /* 7 */ + { ISFUNC, rl_vi_arg_digit }, /* 8 */ + { ISFUNC, rl_vi_arg_digit }, /* 9 */ + + /* A little more punctuation. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* : */ + { ISFUNC, rl_vi_char_search }, /* ; */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* < */ + { ISFUNC, rl_vi_complete }, /* = */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* > */ + { ISFUNC, rl_vi_search }, /* ? */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* @ */ + + /* Uppercase alphabet. */ + { ISFUNC, rl_vi_append_eol }, /* A */ + { ISFUNC, rl_vi_prev_word}, /* B */ + { ISFUNC, rl_vi_change_to }, /* C */ + { ISFUNC, rl_vi_delete_to }, /* D */ + { ISFUNC, rl_vi_end_word }, /* E */ + { ISFUNC, rl_vi_char_search }, /* F */ + { ISFUNC, rl_vi_fetch_history }, /* G */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* H */ + { ISFUNC, rl_vi_insert_beg }, /* I */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* J */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* K */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* L */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* M */ + { ISFUNC, rl_vi_search_again }, /* N */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* O */ + { ISFUNC, rl_vi_put }, /* P */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Q */ + { ISFUNC, rl_vi_replace }, /* R */ + { ISFUNC, rl_vi_subst }, /* S */ + { ISFUNC, rl_vi_char_search }, /* T */ + { ISFUNC, rl_revert_line }, /* U */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* V */ + { ISFUNC, rl_vi_next_word }, /* W */ + { ISFUNC, rl_vi_rubout }, /* X */ + { ISFUNC, rl_vi_yank_to }, /* Y */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Z */ + + /* Some more punctuation. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* [ */ + { ISFUNC, rl_vi_complete }, /* \ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ] */ + { ISFUNC, rl_vi_first_print }, /* ^ */ + { ISFUNC, rl_vi_yank_arg }, /* _ */ + { ISFUNC, rl_vi_goto_mark }, /* ` */ + + /* Lowercase alphabet. */ + { ISFUNC, rl_vi_append_mode }, /* a */ + { ISFUNC, rl_vi_prev_word }, /* b */ + { ISFUNC, rl_vi_change_to }, /* c */ + { ISFUNC, rl_vi_delete_to }, /* d */ + { ISFUNC, rl_vi_end_word }, /* e */ + { ISFUNC, rl_vi_char_search }, /* f */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* g */ + { ISFUNC, rl_backward_char }, /* h */ + { ISFUNC, rl_vi_insert_mode }, /* i */ + { ISFUNC, rl_get_next_history }, /* j */ + { ISFUNC, rl_get_previous_history }, /* k */ + { ISFUNC, rl_forward_char }, /* l */ + { ISFUNC, rl_vi_set_mark }, /* m */ + { ISFUNC, rl_vi_search_again }, /* n */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* o */ + { ISFUNC, rl_vi_put }, /* p */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* q */ + { ISFUNC, rl_vi_change_char }, /* r */ + { ISFUNC, rl_vi_subst }, /* s */ + { ISFUNC, rl_vi_char_search }, /* t */ + { ISFUNC, rl_vi_undo }, /* u */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* v */ + { ISFUNC, rl_vi_next_word }, /* w */ + { ISFUNC, rl_vi_delete }, /* x */ + { ISFUNC, rl_vi_yank_to }, /* y */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* z */ + + /* Final punctuation. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* { */ + { ISFUNC, rl_vi_column }, /* | */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* } */ + { ISFUNC, rl_vi_change_case }, /* ~ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* RUBOUT */ + +#if KEYMAP_SIZE > 128 + /* Undefined keys. */ + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 } +#endif /* KEYMAP_SIZE > 128 */ +}; + +KEYMAP_ENTRY_ARRAY vi_insertion_keymap = { + /* The regular control keys come first. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-@ */ + { ISFUNC, rl_insert }, /* Control-a */ + { ISFUNC, rl_insert }, /* Control-b */ + { ISFUNC, rl_insert }, /* Control-c */ + { ISFUNC, rl_vi_eof_maybe }, /* Control-d */ + { ISFUNC, rl_insert }, /* Control-e */ + { ISFUNC, rl_insert }, /* Control-f */ + { ISFUNC, rl_insert }, /* Control-g */ + { ISFUNC, rl_rubout }, /* Control-h */ + { ISFUNC, rl_complete }, /* Control-i */ + { ISFUNC, rl_newline }, /* Control-j */ + { ISFUNC, rl_insert }, /* Control-k */ + { ISFUNC, rl_insert }, /* Control-l */ + { ISFUNC, rl_newline }, /* Control-m */ + { ISFUNC, rl_menu_complete}, /* Control-n */ + { ISFUNC, rl_insert }, /* Control-o */ + { ISFUNC, rl_backward_menu_complete }, /* Control-p */ + { ISFUNC, rl_insert }, /* Control-q */ + { ISFUNC, rl_reverse_search_history }, /* Control-r */ + { ISFUNC, rl_forward_search_history }, /* Control-s */ + { ISFUNC, rl_transpose_chars }, /* Control-t */ + { ISFUNC, rl_unix_line_discard }, /* Control-u */ + { ISFUNC, rl_quoted_insert }, /* Control-v */ + { ISFUNC, rl_unix_word_rubout }, /* Control-w */ + { ISFUNC, rl_insert }, /* Control-x */ + { ISFUNC, rl_yank }, /* Control-y */ + { ISFUNC, rl_insert }, /* Control-z */ + + { ISFUNC, rl_vi_movement_mode }, /* Control-[ */ + { ISFUNC, rl_insert }, /* Control-\ */ + { ISFUNC, rl_insert }, /* Control-] */ + { ISFUNC, rl_insert }, /* Control-^ */ + { ISFUNC, rl_vi_undo }, /* Control-_ */ + + /* The start of printing characters. */ + { ISFUNC, rl_insert }, /* SPACE */ + { ISFUNC, rl_insert }, /* ! */ + { ISFUNC, rl_insert }, /* " */ + { ISFUNC, rl_insert }, /* # */ + { ISFUNC, rl_insert }, /* $ */ + { ISFUNC, rl_insert }, /* % */ + { ISFUNC, rl_insert }, /* & */ + { ISFUNC, rl_insert }, /* ' */ + { ISFUNC, rl_insert }, /* ( */ + { ISFUNC, rl_insert }, /* ) */ + { ISFUNC, rl_insert }, /* * */ + { ISFUNC, rl_insert }, /* + */ + { ISFUNC, rl_insert }, /* , */ + { ISFUNC, rl_insert }, /* - */ + { ISFUNC, rl_insert }, /* . */ + { ISFUNC, rl_insert }, /* / */ + + /* Regular digits. */ + { ISFUNC, rl_insert }, /* 0 */ + { ISFUNC, rl_insert }, /* 1 */ + { ISFUNC, rl_insert }, /* 2 */ + { ISFUNC, rl_insert }, /* 3 */ + { ISFUNC, rl_insert }, /* 4 */ + { ISFUNC, rl_insert }, /* 5 */ + { ISFUNC, rl_insert }, /* 6 */ + { ISFUNC, rl_insert }, /* 7 */ + { ISFUNC, rl_insert }, /* 8 */ + { ISFUNC, rl_insert }, /* 9 */ + + /* A little more punctuation. */ + { ISFUNC, rl_insert }, /* : */ + { ISFUNC, rl_insert }, /* ; */ + { ISFUNC, rl_insert }, /* < */ + { ISFUNC, rl_insert }, /* = */ + { ISFUNC, rl_insert }, /* > */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* @ */ + + /* Uppercase alphabet. */ + { ISFUNC, rl_insert }, /* A */ + { ISFUNC, rl_insert }, /* B */ + { ISFUNC, rl_insert }, /* C */ + { ISFUNC, rl_insert }, /* D */ + { ISFUNC, rl_insert }, /* E */ + { ISFUNC, rl_insert }, /* F */ + { ISFUNC, rl_insert }, /* G */ + { ISFUNC, rl_insert }, /* H */ + { ISFUNC, rl_insert }, /* I */ + { ISFUNC, rl_insert }, /* J */ + { ISFUNC, rl_insert }, /* K */ + { ISFUNC, rl_insert }, /* L */ + { ISFUNC, rl_insert }, /* M */ + { ISFUNC, rl_insert }, /* N */ + { ISFUNC, rl_insert }, /* O */ + { ISFUNC, rl_insert }, /* P */ + { ISFUNC, rl_insert }, /* Q */ + { ISFUNC, rl_insert }, /* R */ + { ISFUNC, rl_insert }, /* S */ + { ISFUNC, rl_insert }, /* T */ + { ISFUNC, rl_insert }, /* U */ + { ISFUNC, rl_insert }, /* V */ + { ISFUNC, rl_insert }, /* W */ + { ISFUNC, rl_insert }, /* X */ + { ISFUNC, rl_insert }, /* Y */ + { ISFUNC, rl_insert }, /* Z */ + + /* Some more punctuation. */ + { ISFUNC, rl_insert }, /* [ */ + { ISFUNC, rl_insert }, /* \ */ + { ISFUNC, rl_insert }, /* ] */ + { ISFUNC, rl_insert }, /* ^ */ + { ISFUNC, rl_insert }, /* _ */ + { ISFUNC, rl_insert }, /* ` */ + + /* Lowercase alphabet. */ + { ISFUNC, rl_insert }, /* a */ + { ISFUNC, rl_insert }, /* b */ + { ISFUNC, rl_insert }, /* c */ + { ISFUNC, rl_insert }, /* d */ + { ISFUNC, rl_insert }, /* e */ + { ISFUNC, rl_insert }, /* f */ + { ISFUNC, rl_insert }, /* g */ + { ISFUNC, rl_insert }, /* h */ + { ISFUNC, rl_insert }, /* i */ + { ISFUNC, rl_insert }, /* j */ + { ISFUNC, rl_insert }, /* k */ + { ISFUNC, rl_insert }, /* l */ + { ISFUNC, rl_insert }, /* m */ + { ISFUNC, rl_insert }, /* n */ + { ISFUNC, rl_insert }, /* o */ + { ISFUNC, rl_insert }, /* p */ + { ISFUNC, rl_insert }, /* q */ + { ISFUNC, rl_insert }, /* r */ + { ISFUNC, rl_insert }, /* s */ + { ISFUNC, rl_insert }, /* t */ + { ISFUNC, rl_insert }, /* u */ + { ISFUNC, rl_insert }, /* v */ + { ISFUNC, rl_insert }, /* w */ + { ISFUNC, rl_insert }, /* x */ + { ISFUNC, rl_insert }, /* y */ + { ISFUNC, rl_insert }, /* z */ + + /* Final punctuation. */ + { ISFUNC, rl_insert }, /* { */ + { ISFUNC, rl_insert }, /* | */ + { ISFUNC, rl_insert }, /* } */ + { ISFUNC, rl_insert }, /* ~ */ + { ISFUNC, rl_rubout }, /* RUBOUT */ + +#if KEYMAP_SIZE > 128 + /* Pure 8-bit characters (128 - 159). + These might be used in some + character sets. */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + { ISFUNC, rl_insert }, /* ? */ + + /* ISO Latin-1 characters (160 - 255) */ + { ISFUNC, rl_insert }, /* No-break space */ + { ISFUNC, rl_insert }, /* Inverted exclamation mark */ + { ISFUNC, rl_insert }, /* Cent sign */ + { ISFUNC, rl_insert }, /* Pound sign */ + { ISFUNC, rl_insert }, /* Currency sign */ + { ISFUNC, rl_insert }, /* Yen sign */ + { ISFUNC, rl_insert }, /* Broken bar */ + { ISFUNC, rl_insert }, /* Section sign */ + { ISFUNC, rl_insert }, /* Diaeresis */ + { ISFUNC, rl_insert }, /* Copyright sign */ + { ISFUNC, rl_insert }, /* Feminine ordinal indicator */ + { ISFUNC, rl_insert }, /* Left pointing double angle quotation mark */ + { ISFUNC, rl_insert }, /* Not sign */ + { ISFUNC, rl_insert }, /* Soft hyphen */ + { ISFUNC, rl_insert }, /* Registered sign */ + { ISFUNC, rl_insert }, /* Macron */ + { ISFUNC, rl_insert }, /* Degree sign */ + { ISFUNC, rl_insert }, /* Plus-minus sign */ + { ISFUNC, rl_insert }, /* Superscript two */ + { ISFUNC, rl_insert }, /* Superscript three */ + { ISFUNC, rl_insert }, /* Acute accent */ + { ISFUNC, rl_insert }, /* Micro sign */ + { ISFUNC, rl_insert }, /* Pilcrow sign */ + { ISFUNC, rl_insert }, /* Middle dot */ + { ISFUNC, rl_insert }, /* Cedilla */ + { ISFUNC, rl_insert }, /* Superscript one */ + { ISFUNC, rl_insert }, /* Masculine ordinal indicator */ + { ISFUNC, rl_insert }, /* Right pointing double angle quotation mark */ + { ISFUNC, rl_insert }, /* Vulgar fraction one quarter */ + { ISFUNC, rl_insert }, /* Vulgar fraction one half */ + { ISFUNC, rl_insert }, /* Vulgar fraction three quarters */ + { ISFUNC, rl_insert }, /* Inverted questionk mark */ + { ISFUNC, rl_insert }, /* Latin capital letter a with grave */ + { ISFUNC, rl_insert }, /* Latin capital letter a with acute */ + { ISFUNC, rl_insert }, /* Latin capital letter a with circumflex */ + { ISFUNC, rl_insert }, /* Latin capital letter a with tilde */ + { ISFUNC, rl_insert }, /* Latin capital letter a with diaeresis */ + { ISFUNC, rl_insert }, /* Latin capital letter a with ring above */ + { ISFUNC, rl_insert }, /* Latin capital letter ae */ + { ISFUNC, rl_insert }, /* Latin capital letter c with cedilla */ + { ISFUNC, rl_insert }, /* Latin capital letter e with grave */ + { ISFUNC, rl_insert }, /* Latin capital letter e with acute */ + { ISFUNC, rl_insert }, /* Latin capital letter e with circumflex */ + { ISFUNC, rl_insert }, /* Latin capital letter e with diaeresis */ + { ISFUNC, rl_insert }, /* Latin capital letter i with grave */ + { ISFUNC, rl_insert }, /* Latin capital letter i with acute */ + { ISFUNC, rl_insert }, /* Latin capital letter i with circumflex */ + { ISFUNC, rl_insert }, /* Latin capital letter i with diaeresis */ + { ISFUNC, rl_insert }, /* Latin capital letter eth (Icelandic) */ + { ISFUNC, rl_insert }, /* Latin capital letter n with tilde */ + { ISFUNC, rl_insert }, /* Latin capital letter o with grave */ + { ISFUNC, rl_insert }, /* Latin capital letter o with acute */ + { ISFUNC, rl_insert }, /* Latin capital letter o with circumflex */ + { ISFUNC, rl_insert }, /* Latin capital letter o with tilde */ + { ISFUNC, rl_insert }, /* Latin capital letter o with diaeresis */ + { ISFUNC, rl_insert }, /* Multiplication sign */ + { ISFUNC, rl_insert }, /* Latin capital letter o with stroke */ + { ISFUNC, rl_insert }, /* Latin capital letter u with grave */ + { ISFUNC, rl_insert }, /* Latin capital letter u with acute */ + { ISFUNC, rl_insert }, /* Latin capital letter u with circumflex */ + { ISFUNC, rl_insert }, /* Latin capital letter u with diaeresis */ + { ISFUNC, rl_insert }, /* Latin capital letter Y with acute */ + { ISFUNC, rl_insert }, /* Latin capital letter thorn (Icelandic) */ + { ISFUNC, rl_insert }, /* Latin small letter sharp s (German) */ + { ISFUNC, rl_insert }, /* Latin small letter a with grave */ + { ISFUNC, rl_insert }, /* Latin small letter a with acute */ + { ISFUNC, rl_insert }, /* Latin small letter a with circumflex */ + { ISFUNC, rl_insert }, /* Latin small letter a with tilde */ + { ISFUNC, rl_insert }, /* Latin small letter a with diaeresis */ + { ISFUNC, rl_insert }, /* Latin small letter a with ring above */ + { ISFUNC, rl_insert }, /* Latin small letter ae */ + { ISFUNC, rl_insert }, /* Latin small letter c with cedilla */ + { ISFUNC, rl_insert }, /* Latin small letter e with grave */ + { ISFUNC, rl_insert }, /* Latin small letter e with acute */ + { ISFUNC, rl_insert }, /* Latin small letter e with circumflex */ + { ISFUNC, rl_insert }, /* Latin small letter e with diaeresis */ + { ISFUNC, rl_insert }, /* Latin small letter i with grave */ + { ISFUNC, rl_insert }, /* Latin small letter i with acute */ + { ISFUNC, rl_insert }, /* Latin small letter i with circumflex */ + { ISFUNC, rl_insert }, /* Latin small letter i with diaeresis */ + { ISFUNC, rl_insert }, /* Latin small letter eth (Icelandic) */ + { ISFUNC, rl_insert }, /* Latin small letter n with tilde */ + { ISFUNC, rl_insert }, /* Latin small letter o with grave */ + { ISFUNC, rl_insert }, /* Latin small letter o with acute */ + { ISFUNC, rl_insert }, /* Latin small letter o with circumflex */ + { ISFUNC, rl_insert }, /* Latin small letter o with tilde */ + { ISFUNC, rl_insert }, /* Latin small letter o with diaeresis */ + { ISFUNC, rl_insert }, /* Division sign */ + { ISFUNC, rl_insert }, /* Latin small letter o with stroke */ + { ISFUNC, rl_insert }, /* Latin small letter u with grave */ + { ISFUNC, rl_insert }, /* Latin small letter u with acute */ + { ISFUNC, rl_insert }, /* Latin small letter u with circumflex */ + { ISFUNC, rl_insert }, /* Latin small letter u with diaeresis */ + { ISFUNC, rl_insert }, /* Latin small letter y with acute */ + { ISFUNC, rl_insert }, /* Latin small letter thorn (Icelandic) */ + { ISFUNC, rl_insert } /* Latin small letter y with diaeresis */ +#endif /* KEYMAP_SIZE > 128 */ +}; + +/* Unused for the time being. */ +#if 0 +KEYMAP_ENTRY_ARRAY vi_escape_keymap = { + /* The regular control keys come first. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-@ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-a */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-b */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-c */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-d */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-e */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-f */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-g */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-h */ + { ISFUNC, rl_tab_insert}, /* Control-i */ + { ISFUNC, rl_emacs_editing_mode}, /* Control-j */ + { ISFUNC, rl_kill_line }, /* Control-k */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-l */ + { ISFUNC, rl_emacs_editing_mode}, /* Control-m */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-n */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-o */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-p */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-q */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-r */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-s */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-t */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-u */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-v */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-w */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-x */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-y */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-z */ + + { ISFUNC, rl_vi_movement_mode }, /* Control-[ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-\ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-] */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* Control-^ */ + { ISFUNC, rl_vi_undo }, /* Control-_ */ + + /* The start of printing characters. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* SPACE */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ! */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* " */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* # */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* $ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* % */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* & */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ' */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ( */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ) */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* * */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* + */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* , */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* - */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* . */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* / */ + + /* Regular digits. */ + { ISFUNC, rl_vi_arg_digit }, /* 0 */ + { ISFUNC, rl_vi_arg_digit }, /* 1 */ + { ISFUNC, rl_vi_arg_digit }, /* 2 */ + { ISFUNC, rl_vi_arg_digit }, /* 3 */ + { ISFUNC, rl_vi_arg_digit }, /* 4 */ + { ISFUNC, rl_vi_arg_digit }, /* 5 */ + { ISFUNC, rl_vi_arg_digit }, /* 6 */ + { ISFUNC, rl_vi_arg_digit }, /* 7 */ + { ISFUNC, rl_vi_arg_digit }, /* 8 */ + { ISFUNC, rl_vi_arg_digit }, /* 9 */ + + /* A little more punctuation. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* : */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ; */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* < */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* = */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* > */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ? */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* @ */ + + /* Uppercase alphabet. */ + { ISFUNC, rl_do_lowercase_version }, /* A */ + { ISFUNC, rl_do_lowercase_version }, /* B */ + { ISFUNC, rl_do_lowercase_version }, /* C */ + { ISFUNC, rl_do_lowercase_version }, /* D */ + { ISFUNC, rl_do_lowercase_version }, /* E */ + { ISFUNC, rl_do_lowercase_version }, /* F */ + { ISFUNC, rl_do_lowercase_version }, /* G */ + { ISFUNC, rl_do_lowercase_version }, /* H */ + { ISFUNC, rl_do_lowercase_version }, /* I */ + { ISFUNC, rl_do_lowercase_version }, /* J */ + { ISFUNC, rl_do_lowercase_version }, /* K */ + { ISFUNC, rl_do_lowercase_version }, /* L */ + { ISFUNC, rl_do_lowercase_version }, /* M */ + { ISFUNC, rl_do_lowercase_version }, /* N */ + { ISFUNC, rl_do_lowercase_version }, /* O */ + { ISFUNC, rl_do_lowercase_version }, /* P */ + { ISFUNC, rl_do_lowercase_version }, /* Q */ + { ISFUNC, rl_do_lowercase_version }, /* R */ + { ISFUNC, rl_do_lowercase_version }, /* S */ + { ISFUNC, rl_do_lowercase_version }, /* T */ + { ISFUNC, rl_do_lowercase_version }, /* U */ + { ISFUNC, rl_do_lowercase_version }, /* V */ + { ISFUNC, rl_do_lowercase_version }, /* W */ + { ISFUNC, rl_do_lowercase_version }, /* X */ + { ISFUNC, rl_do_lowercase_version }, /* Y */ + { ISFUNC, rl_do_lowercase_version }, /* Z */ + + /* Some more punctuation. */ + { ISFUNC, rl_arrow_keys }, /* [ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* \ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ] */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ^ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* _ */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ` */ + + /* Lowercase alphabet. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* a */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* b */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* c */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* d */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* e */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* f */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* g */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* h */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* i */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* j */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* k */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* l */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* m */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* n */ + { ISFUNC, rl_arrow_keys }, /* o */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* p */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* q */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* r */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* s */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* t */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* u */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* v */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* w */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* x */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* y */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* z */ + + /* Final punctuation. */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* { */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* | */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* } */ + { ISFUNC, (rl_command_func_t *)0x0 }, /* ~ */ + { ISFUNC, rl_backward_kill_word }, /* RUBOUT */ + +#if KEYMAP_SIZE > 128 + /* Undefined keys. */ + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 }, + { ISFUNC, (rl_command_func_t *)0x0 } +#endif /* KEYMAP_SIZE > 128 */ +}; +#endif diff --git a/lib/readline/vi_mode.c b/lib/readline/vi_mode.c new file mode 100644 index 0000000..0864192 --- /dev/null +++ b/lib/readline/vi_mode.c @@ -0,0 +1,2178 @@ +/* vi_mode.c -- A vi emulation mode for Bash. + Derived from code written by Jeff Sparkes (jsparkes@bnr.ca). */ + +/* Copyright (C) 1987-2012 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +/* **************************************************************** */ +/* */ +/* VI Emulation Mode */ +/* */ +/* **************************************************************** */ +#include "rlconf.h" + +#if defined (VI_MODE) + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include + +/* Some standard library routines. */ +#include "rldefs.h" +#include "rlmbutil.h" + +#include "readline.h" +#include "history.h" + +#include "rlprivate.h" +#include "xmalloc.h" + +#ifndef member +#define member(c, s) ((c) ? (char *)strchr ((s), (c)) != (char *)NULL : 0) +#endif + +int _rl_vi_last_command = 'i'; /* default `.' puts you in insert mode */ + +_rl_vimotion_cxt *_rl_vimvcxt = 0; + +/* Non-zero means enter insertion mode. */ +static int _rl_vi_doing_insert; + +/* Command keys which do movement for xxx_to commands. */ +static const char * const vi_motion = " hl^$0ftFT;,%wbeWBE|`"; + +/* Keymap used for vi replace characters. Created dynamically since + rarely used. */ +static Keymap vi_replace_map; + +/* The number of characters inserted in the last replace operation. */ +static int vi_replace_count; + +/* If non-zero, we have text inserted after a c[motion] command that put + us implicitly into insert mode. Some people want this text to be + attached to the command so that it is `redoable' with `.'. */ +static int vi_continued_command; +static char *vi_insert_buffer; +static int vi_insert_buffer_size; + +static int _rl_vi_last_repeat = 1; +static int _rl_vi_last_arg_sign = 1; +static int _rl_vi_last_motion; +#if defined (HANDLE_MULTIBYTE) +static char _rl_vi_last_search_mbchar[MB_LEN_MAX]; +static int _rl_vi_last_search_mblen; +#else +static int _rl_vi_last_search_char; +#endif +static int _rl_vi_last_replacement; + +static int _rl_vi_last_key_before_insert; + +static int vi_redoing; + +/* Text modification commands. These are the `redoable' commands. */ +static const char * const vi_textmod = "_*\\AaIiCcDdPpYyRrSsXx~"; + +/* Arrays for the saved marks. */ +static int vi_mark_chars['z' - 'a' + 1]; + +static void _rl_vi_replace_insert PARAMS((int)); +static void _rl_vi_save_replace PARAMS((void)); +static void _rl_vi_stuff_insert PARAMS((int)); +static void _rl_vi_save_insert PARAMS((UNDO_LIST *)); + +static void vi_save_insert_buffer PARAMS ((int, int)); + +static void _rl_vi_backup PARAMS((void)); + +static int _rl_vi_arg_dispatch PARAMS((int)); +static int rl_digit_loop1 PARAMS((void)); + +static int _rl_vi_set_mark PARAMS((void)); +static int _rl_vi_goto_mark PARAMS((void)); + +static void _rl_vi_append_forward PARAMS((int)); + +static int _rl_vi_callback_getchar PARAMS((char *, int)); + +#if defined (READLINE_CALLBACKS) +static int _rl_vi_callback_set_mark PARAMS((_rl_callback_generic_arg *)); +static int _rl_vi_callback_goto_mark PARAMS((_rl_callback_generic_arg *)); +static int _rl_vi_callback_change_char PARAMS((_rl_callback_generic_arg *)); +static int _rl_vi_callback_char_search PARAMS((_rl_callback_generic_arg *)); +#endif + +static int rl_domove_read_callback PARAMS((_rl_vimotion_cxt *)); +static int rl_domove_motion_callback PARAMS((_rl_vimotion_cxt *)); +static int rl_vi_domove_getchar PARAMS((_rl_vimotion_cxt *)); + +static int vi_change_dispatch PARAMS((_rl_vimotion_cxt *)); +static int vi_delete_dispatch PARAMS((_rl_vimotion_cxt *)); +static int vi_yank_dispatch PARAMS((_rl_vimotion_cxt *)); + +static int vidomove_dispatch PARAMS((_rl_vimotion_cxt *)); + +void +_rl_vi_initialize_line () +{ + register int i, n; + + n = sizeof (vi_mark_chars) / sizeof (vi_mark_chars[0]); + for (i = 0; i < n; i++) + vi_mark_chars[i] = -1; + + RL_UNSETSTATE(RL_STATE_VICMDONCE); +} + +void +_rl_vi_reset_last () +{ + _rl_vi_last_command = 'i'; + _rl_vi_last_repeat = 1; + _rl_vi_last_arg_sign = 1; + _rl_vi_last_motion = 0; +} + +void +_rl_vi_set_last (key, repeat, sign) + int key, repeat, sign; +{ + _rl_vi_last_command = key; + _rl_vi_last_repeat = repeat; + _rl_vi_last_arg_sign = sign; +} + +/* A convenience function that calls _rl_vi_set_last to save the last command + information and enters insertion mode. */ +void +rl_vi_start_inserting (key, repeat, sign) + int key, repeat, sign; +{ + _rl_vi_set_last (key, repeat, sign); + rl_vi_insertion_mode (1, key); +} + +/* Is the command C a VI mode text modification command? */ +int +_rl_vi_textmod_command (c) + int c; +{ + return (member (c, vi_textmod)); +} + +static void +_rl_vi_replace_insert (count) + int count; +{ + int nchars; + + nchars = strlen (vi_insert_buffer); + + rl_begin_undo_group (); + while (count--) + /* nchars-1 to compensate for _rl_replace_text using `end+1' in call + to rl_delete_text */ + _rl_replace_text (vi_insert_buffer, rl_point, rl_point+nchars-1); + rl_end_undo_group (); +} + +static void +_rl_vi_stuff_insert (count) + int count; +{ + rl_begin_undo_group (); + while (count--) + rl_insert_text (vi_insert_buffer); + rl_end_undo_group (); +} + +/* Bound to `.'. Called from command mode, so we know that we have to + redo a text modification command. The default for _rl_vi_last_command + puts you back into insert mode. */ +int +rl_vi_redo (count, c) + int count, c; +{ + int r; + + if (rl_explicit_arg == 0) + { + rl_numeric_arg = _rl_vi_last_repeat; + rl_arg_sign = _rl_vi_last_arg_sign; + } + + r = 0; + vi_redoing = 1; + /* If we're redoing an insert with `i', stuff in the inserted text + and do not go into insertion mode. */ + if (_rl_vi_last_command == 'i' && vi_insert_buffer && *vi_insert_buffer) + { + _rl_vi_stuff_insert (count); + /* And back up point over the last character inserted. */ + if (rl_point > 0) + _rl_vi_backup (); + } + else if (_rl_vi_last_command == 'R' && vi_insert_buffer && *vi_insert_buffer) + { + _rl_vi_replace_insert (count); + /* And back up point over the last character inserted. */ + if (rl_point > 0) + _rl_vi_backup (); + } + /* Ditto for redoing an insert with `I', but move to the beginning of the + line like the `I' command does. */ + else if (_rl_vi_last_command == 'I' && vi_insert_buffer && *vi_insert_buffer) + { + rl_beg_of_line (1, 'I'); + _rl_vi_stuff_insert (count); + if (rl_point > 0) + _rl_vi_backup (); + } + /* Ditto for redoing an insert with `a', but move forward a character first + like the `a' command does. */ + else if (_rl_vi_last_command == 'a' && vi_insert_buffer && *vi_insert_buffer) + { + _rl_vi_append_forward ('a'); + _rl_vi_stuff_insert (count); + if (rl_point > 0) + _rl_vi_backup (); + } + /* Ditto for redoing an insert with `A', but move to the end of the line + like the `A' command does. */ + else if (_rl_vi_last_command == 'A' && vi_insert_buffer && *vi_insert_buffer) + { + rl_end_of_line (1, 'A'); + _rl_vi_stuff_insert (count); + if (rl_point > 0) + _rl_vi_backup (); + } + else + r = _rl_dispatch (_rl_vi_last_command, _rl_keymap); + vi_redoing = 0; + + return (r); +} + +/* A placeholder for further expansion. */ +int +rl_vi_undo (count, key) + int count, key; +{ + return (rl_undo_command (count, key)); +} + +/* Yank the nth arg from the previous line into this line at point. */ +int +rl_vi_yank_arg (count, key) + int count, key; +{ + /* Readline thinks that the first word on a line is the 0th, while vi + thinks the first word on a line is the 1st. Compensate. */ + if (rl_explicit_arg) + rl_yank_nth_arg (count - 1, 0); + else + rl_yank_nth_arg ('$', 0); + + return (0); +} + +/* With an argument, move back that many history lines, else move to the + beginning of history. */ +int +rl_vi_fetch_history (count, c) + int count, c; +{ + int wanted; + + /* Giving an argument of n means we want the nth command in the history + file. The command number is interpreted the same way that the bash + `history' command does it -- that is, giving an argument count of 450 + to this command would get the command listed as number 450 in the + output of `history'. */ + if (rl_explicit_arg) + { + wanted = history_base + where_history () - count; + if (wanted <= 0) + rl_beginning_of_history (0, 0); + else + rl_get_previous_history (wanted, c); + } + else + rl_beginning_of_history (count, 0); + return (0); +} + +/* Search again for the last thing searched for. */ +int +rl_vi_search_again (count, key) + int count, key; +{ + switch (key) + { + case 'n': + rl_noninc_reverse_search_again (count, key); + break; + + case 'N': + rl_noninc_forward_search_again (count, key); + break; + } + return (0); +} + +/* Do a vi style search. */ +int +rl_vi_search (count, key) + int count, key; +{ + switch (key) + { + case '?': + _rl_free_saved_history_line (); + rl_noninc_forward_search (count, key); + break; + + case '/': + _rl_free_saved_history_line (); + rl_noninc_reverse_search (count, key); + break; + + default: + rl_ding (); + break; + } + return (0); +} + +/* Completion, from vi's point of view. */ +int +rl_vi_complete (ignore, key) + int ignore, key; +{ + if ((rl_point < rl_end) && (!whitespace (rl_line_buffer[rl_point]))) + { + if (!whitespace (rl_line_buffer[rl_point + 1])) + rl_vi_end_word (1, 'E'); + rl_point++; + } + + if (key == '*') + rl_complete_internal ('*'); /* Expansion and replacement. */ + else if (key == '=') + rl_complete_internal ('?'); /* List possible completions. */ + else if (key == '\\') + rl_complete_internal (TAB); /* Standard Readline completion. */ + else + rl_complete (0, key); + + if (key == '*' || key == '\\') + rl_vi_start_inserting (key, 1, rl_arg_sign); + + return (0); +} + +/* Tilde expansion for vi mode. */ +int +rl_vi_tilde_expand (ignore, key) + int ignore, key; +{ + rl_tilde_expand (0, key); + rl_vi_start_inserting (key, 1, rl_arg_sign); + return (0); +} + +/* Previous word in vi mode. */ +int +rl_vi_prev_word (count, key) + int count, key; +{ + if (count < 0) + return (rl_vi_next_word (-count, key)); + + if (rl_point == 0) + { + rl_ding (); + return (0); + } + + if (_rl_uppercase_p (key)) + rl_vi_bWord (count, key); + else + rl_vi_bword (count, key); + + return (0); +} + +/* Next word in vi mode. */ +int +rl_vi_next_word (count, key) + int count, key; +{ + if (count < 0) + return (rl_vi_prev_word (-count, key)); + + if (rl_point >= (rl_end - 1)) + { + rl_ding (); + return (0); + } + + if (_rl_uppercase_p (key)) + rl_vi_fWord (count, key); + else + rl_vi_fword (count, key); + return (0); +} + +/* Move to the end of the ?next? word. */ +int +rl_vi_end_word (count, key) + int count, key; +{ + if (count < 0) + { + rl_ding (); + return -1; + } + + if (_rl_uppercase_p (key)) + rl_vi_eWord (count, key); + else + rl_vi_eword (count, key); + return (0); +} + +/* Move forward a word the way that 'W' does. */ +int +rl_vi_fWord (count, ignore) + int count, ignore; +{ + while (count-- && rl_point < (rl_end - 1)) + { + /* Skip until whitespace. */ + while (!whitespace (rl_line_buffer[rl_point]) && rl_point < rl_end) + rl_point++; + + /* Now skip whitespace. */ + while (whitespace (rl_line_buffer[rl_point]) && rl_point < rl_end) + rl_point++; + } + return (0); +} + +int +rl_vi_bWord (count, ignore) + int count, ignore; +{ + while (count-- && rl_point > 0) + { + /* If we are at the start of a word, move back to whitespace so + we will go back to the start of the previous word. */ + if (!whitespace (rl_line_buffer[rl_point]) && + whitespace (rl_line_buffer[rl_point - 1])) + rl_point--; + + while (rl_point > 0 && whitespace (rl_line_buffer[rl_point])) + rl_point--; + + if (rl_point > 0) + { + while (--rl_point >= 0 && !whitespace (rl_line_buffer[rl_point])); + rl_point++; + } + } + return (0); +} + +int +rl_vi_eWord (count, ignore) + int count, ignore; +{ + while (count-- && rl_point < (rl_end - 1)) + { + if (!whitespace (rl_line_buffer[rl_point])) + rl_point++; + + /* Move to the next non-whitespace character (to the start of the + next word). */ + while (rl_point < rl_end && whitespace (rl_line_buffer[rl_point])) + rl_point++; + + if (rl_point && rl_point < rl_end) + { + /* Skip whitespace. */ + while (rl_point < rl_end && whitespace (rl_line_buffer[rl_point])) + rl_point++; + + /* Skip until whitespace. */ + while (rl_point < rl_end && !whitespace (rl_line_buffer[rl_point])) + rl_point++; + + /* Move back to the last character of the word. */ + rl_point--; + } + } + return (0); +} + +int +rl_vi_fword (count, ignore) + int count, ignore; +{ + while (count-- && rl_point < (rl_end - 1)) + { + /* Move to white space (really non-identifer). */ + if (_rl_isident (rl_line_buffer[rl_point])) + { + while (_rl_isident (rl_line_buffer[rl_point]) && rl_point < rl_end) + rl_point++; + } + else /* if (!whitespace (rl_line_buffer[rl_point])) */ + { + while (!_rl_isident (rl_line_buffer[rl_point]) && + !whitespace (rl_line_buffer[rl_point]) && rl_point < rl_end) + rl_point++; + } + + /* Move past whitespace. */ + while (whitespace (rl_line_buffer[rl_point]) && rl_point < rl_end) + rl_point++; + } + return (0); +} + +int +rl_vi_bword (count, ignore) + int count, ignore; +{ + while (count-- && rl_point > 0) + { + int last_is_ident; + + /* If we are at the start of a word, move back to whitespace + so we will go back to the start of the previous word. */ + if (!whitespace (rl_line_buffer[rl_point]) && + whitespace (rl_line_buffer[rl_point - 1])) + rl_point--; + + /* If this character and the previous character are `opposite', move + back so we don't get messed up by the rl_point++ down there in + the while loop. Without this code, words like `l;' screw up the + function. */ + last_is_ident = _rl_isident (rl_line_buffer[rl_point - 1]); + if ((_rl_isident (rl_line_buffer[rl_point]) && !last_is_ident) || + (!_rl_isident (rl_line_buffer[rl_point]) && last_is_ident)) + rl_point--; + + while (rl_point > 0 && whitespace (rl_line_buffer[rl_point])) + rl_point--; + + if (rl_point > 0) + { + if (_rl_isident (rl_line_buffer[rl_point])) + while (--rl_point >= 0 && _rl_isident (rl_line_buffer[rl_point])); + else + while (--rl_point >= 0 && !_rl_isident (rl_line_buffer[rl_point]) && + !whitespace (rl_line_buffer[rl_point])); + rl_point++; + } + } + return (0); +} + +int +rl_vi_eword (count, ignore) + int count, ignore; +{ + while (count-- && rl_point < rl_end - 1) + { + if (!whitespace (rl_line_buffer[rl_point])) + rl_point++; + + while (rl_point < rl_end && whitespace (rl_line_buffer[rl_point])) + rl_point++; + + if (rl_point < rl_end) + { + if (_rl_isident (rl_line_buffer[rl_point])) + while (++rl_point < rl_end && _rl_isident (rl_line_buffer[rl_point])); + else + while (++rl_point < rl_end && !_rl_isident (rl_line_buffer[rl_point]) + && !whitespace (rl_line_buffer[rl_point])); + } + rl_point--; + } + return (0); +} + +int +rl_vi_insert_beg (count, key) + int count, key; +{ + rl_beg_of_line (1, key); + rl_vi_insert_mode (1, key); + return (0); +} + +static void +_rl_vi_append_forward (key) + int key; +{ + int point; + + if (rl_point < rl_end) + { + if (MB_CUR_MAX == 1 || rl_byte_oriented) + rl_point++; + else + { + point = rl_point; +#if 0 + rl_forward_char (1, key); +#else + rl_point = _rl_forward_char_internal (1); +#endif + if (point == rl_point) + rl_point = rl_end; + } + } +} + +int +rl_vi_append_mode (count, key) + int count, key; +{ + _rl_vi_append_forward (key); + rl_vi_start_inserting (key, 1, rl_arg_sign); + return (0); +} + +int +rl_vi_append_eol (count, key) + int count, key; +{ + rl_end_of_line (1, key); + rl_vi_append_mode (1, key); + return (0); +} + +/* What to do in the case of C-d. */ +int +rl_vi_eof_maybe (count, c) + int count, c; +{ + return (rl_newline (1, '\n')); +} + +/* Insertion mode stuff. */ + +/* Switching from one mode to the other really just involves + switching keymaps. */ +int +rl_vi_insertion_mode (count, key) + int count, key; +{ + _rl_keymap = vi_insertion_keymap; + _rl_vi_last_key_before_insert = key; + if (_rl_show_mode_in_prompt) + _rl_reset_prompt (); + return (0); +} + +int +rl_vi_insert_mode (count, key) + int count, key; +{ + rl_vi_start_inserting (key, 1, rl_arg_sign); + return (0); +} + +static void +vi_save_insert_buffer (start, len) + int start, len; +{ + /* Same code as _rl_vi_save_insert below */ + if (len >= vi_insert_buffer_size) + { + vi_insert_buffer_size += (len + 32) - (len % 32); + vi_insert_buffer = (char *)xrealloc (vi_insert_buffer, vi_insert_buffer_size); + } + strncpy (vi_insert_buffer, rl_line_buffer + start, len - 1); + vi_insert_buffer[len-1] = '\0'; +} + +static void +_rl_vi_save_replace () +{ + int len, start, end; + UNDO_LIST *up; + + up = rl_undo_list; + if (up == 0 || up->what != UNDO_END || vi_replace_count <= 0) + { + if (vi_insert_buffer_size >= 1) + vi_insert_buffer[0] = '\0'; + return; + } + /* Let's try it the quick and easy way for now. This should essentially + accommodate every UNDO_INSERT and save the inserted text to + vi_insert_buffer */ + end = rl_point; + start = end - vi_replace_count + 1; + len = vi_replace_count + 1; + + vi_save_insert_buffer (start, len); +} + +static void +_rl_vi_save_insert (up) + UNDO_LIST *up; +{ + int len, start, end; + + if (up == 0 || up->what != UNDO_INSERT) + { + if (vi_insert_buffer_size >= 1) + vi_insert_buffer[0] = '\0'; + return; + } + + start = up->start; + end = up->end; + len = end - start + 1; + + vi_save_insert_buffer (start, len); +} + +void +_rl_vi_done_inserting () +{ + if (_rl_vi_doing_insert) + { + /* The `C', `s', and `S' commands set this. */ + rl_end_undo_group (); + /* Now, the text between rl_undo_list->next->start and + rl_undo_list->next->end is what was inserted while in insert + mode. It gets copied to VI_INSERT_BUFFER because it depends + on absolute indices into the line which may change (though they + probably will not). */ + _rl_vi_doing_insert = 0; + if (_rl_vi_last_key_before_insert == 'R') + _rl_vi_save_replace (); /* Half the battle */ + else + _rl_vi_save_insert (rl_undo_list->next); + vi_continued_command = 1; + } + else + { + if (rl_undo_list && (_rl_vi_last_key_before_insert == 'i' || + _rl_vi_last_key_before_insert == 'a' || + _rl_vi_last_key_before_insert == 'I' || + _rl_vi_last_key_before_insert == 'A')) + _rl_vi_save_insert (rl_undo_list); + /* XXX - Other keys probably need to be checked. */ + else if (_rl_vi_last_key_before_insert == 'C') + rl_end_undo_group (); + while (_rl_undo_group_level > 0) + rl_end_undo_group (); + vi_continued_command = 0; + } +} + +int +rl_vi_movement_mode (count, key) + int count, key; +{ + if (rl_point > 0) + rl_backward_char (1, key); + + _rl_keymap = vi_movement_keymap; + _rl_vi_done_inserting (); + + /* This is how POSIX.2 says `U' should behave -- everything up until the + first time you go into command mode should not be undone. */ + if (RL_ISSTATE (RL_STATE_VICMDONCE) == 0) + rl_free_undo_list (); + + if (_rl_show_mode_in_prompt) + _rl_reset_prompt (); + + RL_SETSTATE (RL_STATE_VICMDONCE); + return (0); +} + +int +rl_vi_arg_digit (count, c) + int count, c; +{ + if (c == '0' && rl_numeric_arg == 1 && !rl_explicit_arg) + return (rl_beg_of_line (1, c)); + else + return (rl_digit_argument (count, c)); +} + +/* Change the case of the next COUNT characters. */ +#if defined (HANDLE_MULTIBYTE) +static int +_rl_vi_change_mbchar_case (count) + int count; +{ + wchar_t wc; + char mb[MB_LEN_MAX+1]; + int mlen, p; + size_t m; + mbstate_t ps; + + memset (&ps, 0, sizeof (mbstate_t)); + if (_rl_adjust_point (rl_line_buffer, rl_point, &ps) > 0) + count--; + while (count-- && rl_point < rl_end) + { + m = mbrtowc (&wc, rl_line_buffer + rl_point, rl_end - rl_point, &ps); + if (MB_INVALIDCH (m)) + wc = (wchar_t)rl_line_buffer[rl_point]; + else if (MB_NULLWCH (m)) + wc = L'\0'; + if (iswupper (wc)) + wc = towlower (wc); + else if (iswlower (wc)) + wc = towupper (wc); + else + { + /* Just skip over chars neither upper nor lower case */ + rl_forward_char (1, 0); + continue; + } + + /* Vi is kind of strange here. */ + if (wc) + { + p = rl_point; + mlen = wcrtomb (mb, wc, &ps); + if (mlen >= 0) + mb[mlen] = '\0'; + rl_begin_undo_group (); + rl_vi_delete (1, 0); + if (rl_point < p) /* Did we retreat at EOL? */ + rl_point++; /* XXX - should we advance more than 1 for mbchar? */ + rl_insert_text (mb); + rl_end_undo_group (); + rl_vi_check (); + } + else + rl_forward_char (1, 0); + } + + return 0; +} +#endif + +int +rl_vi_change_case (count, ignore) + int count, ignore; +{ + int c, p; + + /* Don't try this on an empty line. */ + if (rl_point >= rl_end) + return (0); + + c = 0; +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + return (_rl_vi_change_mbchar_case (count)); +#endif + + while (count-- && rl_point < rl_end) + { + if (_rl_uppercase_p (rl_line_buffer[rl_point])) + c = _rl_to_lower (rl_line_buffer[rl_point]); + else if (_rl_lowercase_p (rl_line_buffer[rl_point])) + c = _rl_to_upper (rl_line_buffer[rl_point]); + else + { + /* Just skip over characters neither upper nor lower case. */ + rl_forward_char (1, c); + continue; + } + + /* Vi is kind of strange here. */ + if (c) + { + p = rl_point; + rl_begin_undo_group (); + rl_vi_delete (1, c); + if (rl_point < p) /* Did we retreat at EOL? */ + rl_point++; + _rl_insert_char (1, c); + rl_end_undo_group (); + rl_vi_check (); + } + else + rl_forward_char (1, c); + } + return (0); +} + +int +rl_vi_put (count, key) + int count, key; +{ + if (!_rl_uppercase_p (key) && (rl_point + 1 <= rl_end)) + rl_point = _rl_find_next_mbchar (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO); + + while (count--) + rl_yank (1, key); + + rl_backward_char (1, key); + return (0); +} + +static void +_rl_vi_backup () +{ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_NONZERO); + else + rl_point--; +} + +int +rl_vi_check () +{ + if (rl_point && rl_point == rl_end) + { + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_NONZERO); + else + rl_point--; + } + return (0); +} + +int +rl_vi_column (count, key) + int count, key; +{ + if (count > rl_end) + rl_end_of_line (1, key); + else + rl_point = count - 1; + return (0); +} + +/* Process C as part of the current numeric argument. Return -1 if the + argument should be aborted, 0 if we should not read any more chars, and + 1 if we should continue to read chars. */ +static int +_rl_vi_arg_dispatch (c) + int c; +{ + int key; + + key = c; + if (c >= 0 && _rl_keymap[c].type == ISFUNC && _rl_keymap[c].function == rl_universal_argument) + { + rl_numeric_arg *= 4; + return 1; + } + + c = UNMETA (c); + + if (_rl_digit_p (c)) + { + if (rl_explicit_arg) + rl_numeric_arg = (rl_numeric_arg * 10) + _rl_digit_value (c); + else + rl_numeric_arg = _rl_digit_value (c); + rl_explicit_arg = 1; + return 1; /* keep going */ + } + else + { + rl_clear_message (); + rl_stuff_char (key); + return 0; /* done */ + } +} + +/* A simplified loop for vi. Don't dispatch key at end. + Don't recognize minus sign? + Should this do rl_save_prompt/rl_restore_prompt? */ +static int +rl_digit_loop1 () +{ + int c, r; + + while (1) + { + if (_rl_arg_overflow ()) + return 1; + + c = _rl_arg_getchar (); + + r = _rl_vi_arg_dispatch (c); + if (r <= 0) + break; + } + + RL_UNSETSTATE(RL_STATE_NUMERICARG); + return (0); +} + +static void +_rl_mvcxt_init (m, op, key) + _rl_vimotion_cxt *m; + int op, key; +{ + m->op = op; + m->state = m->flags = 0; + m->ncxt = 0; + m->numeric_arg = -1; + m->start = rl_point; + m->end = rl_end; + m->key = key; + m->motion = -1; +} + +static _rl_vimotion_cxt * +_rl_mvcxt_alloc (op, key) + int op, key; +{ + _rl_vimotion_cxt *m; + + m = xmalloc (sizeof (_rl_vimotion_cxt)); + _rl_mvcxt_init (m, op, key); + return m; +} + +static void +_rl_mvcxt_dispose (m) + _rl_vimotion_cxt *m; +{ + xfree (m); +} + +static int +rl_domove_motion_callback (m) + _rl_vimotion_cxt *m; +{ + int c, save, r; + int old_end; + + _rl_vi_last_motion = c = m->motion; + + /* Append a blank character temporarily so that the motion routines + work right at the end of the line. */ + old_end = rl_end; + rl_line_buffer[rl_end++] = ' '; + rl_line_buffer[rl_end] = '\0'; + + _rl_dispatch (c, _rl_keymap); + + /* Remove the blank that we added. */ + rl_end = old_end; + rl_line_buffer[rl_end] = '\0'; + if (rl_point > rl_end) + rl_point = rl_end; + + /* No change in position means the command failed. */ + if (rl_mark == rl_point) + return (-1); + + /* rl_vi_f[wW]ord () leaves the cursor on the first character of the next + word. If we are not at the end of the line, and we are on a + non-whitespace character, move back one (presumably to whitespace). */ + if ((_rl_to_upper (c) == 'W') && rl_point < rl_end && rl_point > rl_mark && + !whitespace (rl_line_buffer[rl_point])) + rl_point--; + + /* If cw or cW, back up to the end of a word, so the behaviour of ce + or cE is the actual result. Brute-force, no subtlety. */ + if (m->key == 'c' && rl_point >= rl_mark && (_rl_to_upper (c) == 'W')) + { + /* Don't move farther back than where we started. */ + while (rl_point > rl_mark && whitespace (rl_line_buffer[rl_point])) + rl_point--; + + /* Posix.2 says that if cw or cW moves the cursor towards the end of + the line, the character under the cursor should be deleted. */ + if (rl_point == rl_mark) + rl_point++; + else + { + /* Move past the end of the word so that the kill doesn't + remove the last letter of the previous word. Only do this + if we are not at the end of the line. */ + if (rl_point >= 0 && rl_point < (rl_end - 1) && !whitespace (rl_line_buffer[rl_point])) + rl_point++; + } + } + + if (rl_mark < rl_point) + SWAP (rl_point, rl_mark); + +#if defined (READLINE_CALLBACKS) + if (RL_ISSTATE (RL_STATE_CALLBACK)) + (*rl_redisplay_function)(); /* make sure motion is displayed */ +#endif + + r = vidomove_dispatch (m); + + return (r); +} + +#define RL_VIMOVENUMARG() (RL_ISSTATE (RL_STATE_VIMOTION) && RL_ISSTATE (RL_STATE_NUMERICARG)) + +static int +rl_domove_read_callback (m) + _rl_vimotion_cxt *m; +{ + int c, save; + + c = m->motion; + + if (member (c, vi_motion)) + { +#if defined (READLINE_CALLBACKS) + /* If we just read a vi-mode motion command numeric argument, turn off + the `reading numeric arg' state */ + if (RL_ISSTATE (RL_STATE_CALLBACK) && RL_VIMOVENUMARG()) + RL_UNSETSTATE (RL_STATE_NUMERICARG); +#endif + /* Should do everything, including turning off RL_STATE_VIMOTION */ + return (rl_domove_motion_callback (m)); + } + else if (m->key == c && (m->key == 'd' || m->key == 'y' || m->key == 'c')) + { + rl_mark = rl_end; + rl_beg_of_line (1, c); + _rl_vi_last_motion = c; + RL_UNSETSTATE (RL_STATE_VIMOTION); + return (vidomove_dispatch (m)); + } +#if defined (READLINE_CALLBACKS) + /* XXX - these need to handle rl_universal_argument bindings */ + /* Reading vi motion char continuing numeric argument */ + else if (_rl_digit_p (c) && RL_ISSTATE (RL_STATE_CALLBACK) && RL_VIMOVENUMARG()) + { + return (_rl_vi_arg_dispatch (c)); + } + /* Readine vi motion char starting numeric argument */ + else if (_rl_digit_p (c) && RL_ISSTATE (RL_STATE_CALLBACK) && RL_ISSTATE (RL_STATE_VIMOTION) && (RL_ISSTATE (RL_STATE_NUMERICARG) == 0)) + { + RL_SETSTATE (RL_STATE_NUMERICARG); + return (_rl_vi_arg_dispatch (c)); + } +#endif + else if (_rl_digit_p (c)) + { + /* This code path taken when not in callback mode */ + save = rl_numeric_arg; + rl_numeric_arg = _rl_digit_value (c); + rl_explicit_arg = 1; + RL_SETSTATE (RL_STATE_NUMERICARG); + rl_digit_loop1 (); + rl_numeric_arg *= save; + c = rl_vi_domove_getchar (m); + if (c < 0) + { + m->motion = 0; + return -1; + } + m->motion = c; + return (rl_domove_motion_callback (m)); + } + else + { + RL_UNSETSTATE (RL_STATE_VIMOTION); + RL_UNSETSTATE (RL_STATE_NUMERICARG); + return (1); + } +} + +static int +rl_vi_domove_getchar (m) + _rl_vimotion_cxt *m; +{ + int c; + + RL_SETSTATE(RL_STATE_MOREINPUT); + c = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + + return c; +} + +#if defined (READLINE_CALLBACKS) +int +_rl_vi_domove_callback (m) + _rl_vimotion_cxt *m; +{ + int c, r; + + m->motion = c = rl_vi_domove_getchar (m); + /* XXX - what to do if this returns -1? Should we return 1 for eof to + callback code? */ + r = rl_domove_read_callback (m); + + return ((r == 0) ? r : 1); /* normalize return values */ +} +#endif + +/* This code path taken when not in callback mode. */ +int +rl_vi_domove (x, ignore) + int x, *ignore; +{ + int r; + _rl_vimotion_cxt *m; + + m = _rl_vimvcxt; + *ignore = m->motion = rl_vi_domove_getchar (m); + + if (m->motion < 0) + { + m->motion = 0; + return -1; + } + + return (rl_domove_read_callback (m)); +} + +static int +vi_delete_dispatch (m) + _rl_vimotion_cxt *m; +{ + /* These are the motion commands that do not require adjusting the + mark. */ + if (((strchr (" l|h^0bBFT`", m->motion) == 0) && (rl_point >= m->start)) && + (rl_mark < rl_end)) + rl_mark++; + + rl_kill_text (rl_point, rl_mark); + return (0); +} + +int +rl_vi_delete_to (count, key) + int count, key; +{ + int c, r; + + _rl_vimvcxt = _rl_mvcxt_alloc (VIM_DELETE, key); + _rl_vimvcxt->start = rl_point; + + rl_mark = rl_point; + if (_rl_uppercase_p (key)) + { + _rl_vimvcxt->motion = '$'; + r = rl_domove_motion_callback (_rl_vimvcxt); + } + else if (vi_redoing && _rl_vi_last_motion != 'd') /* `dd' is special */ + { + _rl_vimvcxt->motion = _rl_vi_last_motion; + r = rl_domove_motion_callback (_rl_vimvcxt); + } + else if (vi_redoing) /* handle redoing `dd' here */ + { + _rl_vimvcxt->motion = _rl_vi_last_motion; + rl_mark = rl_end; + rl_beg_of_line (1, key); + RL_UNSETSTATE (RL_STATE_VIMOTION); + r = vidomove_dispatch (_rl_vimvcxt); + } +#if defined (READLINE_CALLBACKS) + else if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + RL_SETSTATE (RL_STATE_VIMOTION); + return (0); + } +#endif + else + r = rl_vi_domove (key, &c); + + if (r < 0) + { + rl_ding (); + r = -1; + } + + _rl_mvcxt_dispose (_rl_vimvcxt); + _rl_vimvcxt = 0; + + return r; +} + +static int +vi_change_dispatch (m) + _rl_vimotion_cxt *m; +{ + /* These are the motion commands that do not require adjusting the + mark. c[wW] are handled by special-case code in rl_vi_domove(), + and already leave the mark at the correct location. */ + if (((strchr (" l|hwW^0bBFT`", m->motion) == 0) && (rl_point >= m->start)) && + (rl_mark < rl_end)) + rl_mark++; + + /* The cursor never moves with c[wW]. */ + if ((_rl_to_upper (m->motion) == 'W') && rl_point < m->start) + rl_point = m->start; + + if (vi_redoing) + { + if (vi_insert_buffer && *vi_insert_buffer) + rl_begin_undo_group (); + rl_delete_text (rl_point, rl_mark); + if (vi_insert_buffer && *vi_insert_buffer) + { + rl_insert_text (vi_insert_buffer); + rl_end_undo_group (); + } + } + else + { + rl_begin_undo_group (); /* to make the `u' command work */ + rl_kill_text (rl_point, rl_mark); + /* `C' does not save the text inserted for undoing or redoing. */ + if (_rl_uppercase_p (m->key) == 0) + _rl_vi_doing_insert = 1; + /* XXX -- TODO -- use m->numericarg? */ + rl_vi_start_inserting (m->key, rl_numeric_arg, rl_arg_sign); + } + + return (0); +} + +int +rl_vi_change_to (count, key) + int count, key; +{ + int c, r; + + _rl_vimvcxt = _rl_mvcxt_alloc (VIM_CHANGE, key); + _rl_vimvcxt->start = rl_point; + + rl_mark = rl_point; + if (_rl_uppercase_p (key)) + { + _rl_vimvcxt->motion = '$'; + r = rl_domove_motion_callback (_rl_vimvcxt); + } + else if (vi_redoing && _rl_vi_last_motion != 'c') /* `cc' is special */ + { + _rl_vimvcxt->motion = _rl_vi_last_motion; + r = rl_domove_motion_callback (_rl_vimvcxt); + } + else if (vi_redoing) /* handle redoing `cc' here */ + { + _rl_vimvcxt->motion = _rl_vi_last_motion; + rl_mark = rl_end; + rl_beg_of_line (1, key); + RL_UNSETSTATE (RL_STATE_VIMOTION); + r = vidomove_dispatch (_rl_vimvcxt); + } +#if defined (READLINE_CALLBACKS) + else if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + RL_SETSTATE (RL_STATE_VIMOTION); + return (0); + } +#endif + else + r = rl_vi_domove (key, &c); + + if (r < 0) + { + rl_ding (); + r = -1; /* normalize return value */ + } + + _rl_mvcxt_dispose (_rl_vimvcxt); + _rl_vimvcxt = 0; + + return r; +} + +static int +vi_yank_dispatch (m) + _rl_vimotion_cxt *m; +{ + /* These are the motion commands that do not require adjusting the + mark. */ + if (((strchr (" l|h^0%bBFT`", m->motion) == 0) && (rl_point >= m->start)) && + (rl_mark < rl_end)) + rl_mark++; + + rl_begin_undo_group (); + rl_kill_text (rl_point, rl_mark); + rl_end_undo_group (); + rl_do_undo (); + rl_point = m->start; + + return (0); +} + +int +rl_vi_yank_to (count, key) + int count, key; +{ + int c, r; + + _rl_vimvcxt = _rl_mvcxt_alloc (VIM_YANK, key); + _rl_vimvcxt->start = rl_point; + + rl_mark = rl_point; + if (_rl_uppercase_p (key)) + { + _rl_vimvcxt->motion = '$'; + r = rl_domove_motion_callback (_rl_vimvcxt); + } + else if (vi_redoing && _rl_vi_last_motion != 'y') /* `yy' is special */ + { + _rl_vimvcxt->motion = _rl_vi_last_motion; + r = rl_domove_motion_callback (_rl_vimvcxt); + } + else if (vi_redoing) /* handle redoing `yy' here */ + { + _rl_vimvcxt->motion = _rl_vi_last_motion; + rl_mark = rl_end; + rl_beg_of_line (1, key); + RL_UNSETSTATE (RL_STATE_VIMOTION); + r = vidomove_dispatch (_rl_vimvcxt); + } +#if defined (READLINE_CALLBACKS) + else if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + RL_SETSTATE (RL_STATE_VIMOTION); + return (0); + } +#endif + else + r = rl_vi_domove (key, &c); + + if (r < 0) + { + rl_ding (); + r = -1; + } + + _rl_mvcxt_dispose (_rl_vimvcxt); + _rl_vimvcxt = 0; + + return r; +} + +static int +vidomove_dispatch (m) + _rl_vimotion_cxt *m; +{ + int r; + + switch (m->op) + { + case VIM_DELETE: + r = vi_delete_dispatch (m); + break; + case VIM_CHANGE: + r = vi_change_dispatch (m); + break; + case VIM_YANK: + r = vi_yank_dispatch (m); + break; + default: + _rl_errmsg ("vidomove_dispatch: unknown operator %d", m->op); + r = 1; + break; + } + + RL_UNSETSTATE (RL_STATE_VIMOTION); + return r; +} + +int +rl_vi_rubout (count, key) + int count, key; +{ + int opoint; + + if (count < 0) + return (rl_vi_delete (-count, key)); + + if (rl_point == 0) + { + rl_ding (); + return -1; + } + + opoint = rl_point; + if (count > 1 && MB_CUR_MAX > 1 && rl_byte_oriented == 0) + rl_backward_char (count, key); + else if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_NONZERO); + else + rl_point -= count; + + if (rl_point < 0) + rl_point = 0; + + rl_kill_text (rl_point, opoint); + + return (0); +} + +int +rl_vi_delete (count, key) + int count, key; +{ + int end; + + if (count < 0) + return (rl_vi_rubout (-count, key)); + + if (rl_end == 0) + { + rl_ding (); + return -1; + } + + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + end = _rl_find_next_mbchar (rl_line_buffer, rl_point, count, MB_FIND_NONZERO); + else + end = rl_point + count; + + if (end >= rl_end) + end = rl_end; + + rl_kill_text (rl_point, end); + + if (rl_point > 0 && rl_point == rl_end) + rl_backward_char (1, key); + + return (0); +} + +int +rl_vi_back_to_indent (count, key) + int count, key; +{ + rl_beg_of_line (1, key); + while (rl_point < rl_end && whitespace (rl_line_buffer[rl_point])) + rl_point++; + return (0); +} + +int +rl_vi_first_print (count, key) + int count, key; +{ + return (rl_vi_back_to_indent (1, key)); +} + +static int _rl_cs_dir, _rl_cs_orig_dir; + +#if defined (READLINE_CALLBACKS) +static int +_rl_vi_callback_char_search (data) + _rl_callback_generic_arg *data; +{ + int c; +#if defined (HANDLE_MULTIBYTE) + c = _rl_vi_last_search_mblen = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX); +#else + RL_SETSTATE(RL_STATE_MOREINPUT); + c = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); +#endif + + if (c <= 0) + return -1; + +#if !defined (HANDLE_MULTIBYTE) + _rl_vi_last_search_char = c; +#endif + + _rl_callback_func = 0; + _rl_want_redisplay = 1; + +#if defined (HANDLE_MULTIBYTE) + return (_rl_char_search_internal (data->count, _rl_cs_dir, _rl_vi_last_search_mbchar, _rl_vi_last_search_mblen)); +#else + return (_rl_char_search_internal (data->count, _rl_cs_dir, _rl_vi_last_search_char)); +#endif +} +#endif + +int +rl_vi_char_search (count, key) + int count, key; +{ + int c; +#if defined (HANDLE_MULTIBYTE) + static char *target; + static int tlen; +#else + static char target; +#endif + + if (key == ';' || key == ',') + { + if (_rl_cs_orig_dir == 0) + return -1; +#if defined (HANDLE_MULTIBYTE) + if (_rl_vi_last_search_mblen == 0) + return -1; +#else + if (_rl_vi_last_search_char == 0) + return -1; +#endif + _rl_cs_dir = (key == ';') ? _rl_cs_orig_dir : -_rl_cs_orig_dir; + } + else + { + switch (key) + { + case 't': + _rl_cs_orig_dir = _rl_cs_dir = FTO; + break; + + case 'T': + _rl_cs_orig_dir = _rl_cs_dir = BTO; + break; + + case 'f': + _rl_cs_orig_dir = _rl_cs_dir = FFIND; + break; + + case 'F': + _rl_cs_orig_dir = _rl_cs_dir = BFIND; + break; + } + + if (vi_redoing) + { + /* set target and tlen below */ + } +#if defined (READLINE_CALLBACKS) + else if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + _rl_callback_data = _rl_callback_data_alloc (count); + _rl_callback_data->i1 = _rl_cs_dir; + _rl_callback_func = _rl_vi_callback_char_search; + return (0); + } +#endif + else + { +#if defined (HANDLE_MULTIBYTE) + c = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX); + if (c <= 0) + return -1; + _rl_vi_last_search_mblen = c; +#else + RL_SETSTATE(RL_STATE_MOREINPUT); + c = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + if (c < 0) + return -1; + _rl_vi_last_search_char = c; +#endif + } + } + +#if defined (HANDLE_MULTIBYTE) + target = _rl_vi_last_search_mbchar; + tlen = _rl_vi_last_search_mblen; +#else + target = _rl_vi_last_search_char; +#endif + +#if defined (HANDLE_MULTIBYTE) + return (_rl_char_search_internal (count, _rl_cs_dir, target, tlen)); +#else + return (_rl_char_search_internal (count, _rl_cs_dir, target)); +#endif +} + +/* Match brackets */ +int +rl_vi_match (ignore, key) + int ignore, key; +{ + int count = 1, brack, pos, tmp, pre; + + pos = rl_point; + if ((brack = rl_vi_bracktype (rl_line_buffer[rl_point])) == 0) + { + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + while ((brack = rl_vi_bracktype (rl_line_buffer[rl_point])) == 0) + { + pre = rl_point; + rl_forward_char (1, key); + if (pre == rl_point) + break; + } + } + else + while ((brack = rl_vi_bracktype (rl_line_buffer[rl_point])) == 0 && + rl_point < rl_end - 1) + rl_forward_char (1, key); + + if (brack <= 0) + { + rl_point = pos; + rl_ding (); + return -1; + } + } + + pos = rl_point; + + if (brack < 0) + { + while (count) + { + tmp = pos; + if (MB_CUR_MAX == 1 || rl_byte_oriented) + pos--; + else + { + pos = _rl_find_prev_mbchar (rl_line_buffer, pos, MB_FIND_ANY); + if (tmp == pos) + pos--; + } + if (pos >= 0) + { + int b = rl_vi_bracktype (rl_line_buffer[pos]); + if (b == -brack) + count--; + else if (b == brack) + count++; + } + else + { + rl_ding (); + return -1; + } + } + } + else + { /* brack > 0 */ + while (count) + { + if (MB_CUR_MAX == 1 || rl_byte_oriented) + pos++; + else + pos = _rl_find_next_mbchar (rl_line_buffer, pos, 1, MB_FIND_ANY); + + if (pos < rl_end) + { + int b = rl_vi_bracktype (rl_line_buffer[pos]); + if (b == -brack) + count--; + else if (b == brack) + count++; + } + else + { + rl_ding (); + return -1; + } + } + } + rl_point = pos; + return (0); +} + +int +rl_vi_bracktype (c) + int c; +{ + switch (c) + { + case '(': return 1; + case ')': return -1; + case '[': return 2; + case ']': return -2; + case '{': return 3; + case '}': return -3; + default: return 0; + } +} + +static int +_rl_vi_change_char (count, c, mb) + int count, c; + char *mb; +{ + int p; + + if (c == '\033' || c == CTRL ('C')) + return -1; + + rl_begin_undo_group (); + while (count-- && rl_point < rl_end) + { + p = rl_point; + rl_vi_delete (1, c); + if (rl_point < p) /* Did we retreat at EOL? */ + rl_point++; +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + rl_insert_text (mb); + else +#endif + _rl_insert_char (1, c); + } + + /* The cursor shall be left on the last character changed. */ + rl_backward_char (1, c); + + rl_end_undo_group (); + + return (0); +} + +static int +_rl_vi_callback_getchar (mb, mlen) + char *mb; + int mlen; +{ + int c; + + RL_SETSTATE(RL_STATE_MOREINPUT); + c = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + + if (c < 0) + return -1; + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + c = _rl_read_mbstring (c, mb, mlen); +#endif + + return c; +} + +#if defined (READLINE_CALLBACKS) +static int +_rl_vi_callback_change_char (data) + _rl_callback_generic_arg *data; +{ + int c; + char mb[MB_LEN_MAX]; + + _rl_vi_last_replacement = c = _rl_vi_callback_getchar (mb, MB_LEN_MAX); + + if (c < 0) + return -1; + + _rl_callback_func = 0; + _rl_want_redisplay = 1; + + return (_rl_vi_change_char (data->count, c, mb)); +} +#endif + +int +rl_vi_change_char (count, key) + int count, key; +{ + int c; + char mb[MB_LEN_MAX]; + + if (vi_redoing) + { + c = _rl_vi_last_replacement; + mb[0] = c; + mb[1] = '\0'; + } +#if defined (READLINE_CALLBACKS) + else if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + _rl_callback_data = _rl_callback_data_alloc (count); + _rl_callback_func = _rl_vi_callback_change_char; + return (0); + } +#endif + else + _rl_vi_last_replacement = c = _rl_vi_callback_getchar (mb, MB_LEN_MAX); + + if (c < 0) + return -1; + + return (_rl_vi_change_char (count, c, mb)); +} + +int +rl_vi_subst (count, key) + int count, key; +{ + /* If we are redoing, rl_vi_change_to will stuff the last motion char */ + if (vi_redoing == 0) + rl_stuff_char ((key == 'S') ? 'c' : 'l'); /* `S' == `cc', `s' == `cl' */ + + return (rl_vi_change_to (count, 'c')); +} + +int +rl_vi_overstrike (count, key) + int count, key; +{ + if (_rl_vi_doing_insert == 0) + { + _rl_vi_doing_insert = 1; + rl_begin_undo_group (); + } + + if (count > 0) + { + _rl_overwrite_char (count, key); + vi_replace_count += count; + } + + return (0); +} + +int +rl_vi_overstrike_delete (count, key) + int count, key; +{ + int i, s; + + for (i = 0; i < count; i++) + { + if (vi_replace_count == 0) + { + rl_ding (); + break; + } + s = rl_point; + + if (rl_do_undo ()) + vi_replace_count--; + + if (rl_point == s) + rl_backward_char (1, key); + } + + if (vi_replace_count == 0 && _rl_vi_doing_insert) + { + rl_end_undo_group (); + rl_do_undo (); + _rl_vi_doing_insert = 0; + } + return (0); +} + +int +rl_vi_replace (count, key) + int count, key; +{ + int i; + + vi_replace_count = 0; + + if (vi_replace_map == 0) + { + vi_replace_map = rl_make_bare_keymap (); + + for (i = 0; i < ' '; i++) + if (vi_insertion_keymap[i].type == ISFUNC) + vi_replace_map[i].function = vi_insertion_keymap[i].function; + + for (i = ' '; i < KEYMAP_SIZE; i++) + vi_replace_map[i].function = rl_vi_overstrike; + + vi_replace_map[RUBOUT].function = rl_vi_overstrike_delete; + + /* Make sure these are what we want. */ + vi_replace_map[ESC].function = rl_vi_movement_mode; + vi_replace_map[RETURN].function = rl_newline; + vi_replace_map[NEWLINE].function = rl_newline; + + /* If the normal vi insertion keymap has ^H bound to erase, do the + same here. Probably should remove the assignment to RUBOUT up + there, but I don't think it will make a difference in real life. */ + if (vi_insertion_keymap[CTRL ('H')].type == ISFUNC && + vi_insertion_keymap[CTRL ('H')].function == rl_rubout) + vi_replace_map[CTRL ('H')].function = rl_vi_overstrike_delete; + + } + + rl_vi_start_inserting (key, 1, rl_arg_sign); + + _rl_vi_last_key_before_insert = key; + _rl_keymap = vi_replace_map; + + return (0); +} + +#if 0 +/* Try to complete the word we are standing on or the word that ends with + the previous character. A space matches everything. Word delimiters are + space and ;. */ +int +rl_vi_possible_completions() +{ + int save_pos = rl_point; + + if (rl_line_buffer[rl_point] != ' ' && rl_line_buffer[rl_point] != ';') + { + while (rl_point < rl_end && rl_line_buffer[rl_point] != ' ' && + rl_line_buffer[rl_point] != ';') + rl_point++; + } + else if (rl_line_buffer[rl_point - 1] == ';') + { + rl_ding (); + return (0); + } + + rl_possible_completions (); + rl_point = save_pos; + + return (0); +} +#endif + +/* Functions to save and restore marks. */ +static int +_rl_vi_set_mark () +{ + int ch; + + RL_SETSTATE(RL_STATE_MOREINPUT); + ch = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + + if (ch < 0 || ch < 'a' || ch > 'z') /* make test against 0 explicit */ + { + rl_ding (); + return -1; + } + ch -= 'a'; + vi_mark_chars[ch] = rl_point; + return 0; +} + +#if defined (READLINE_CALLBACKS) +static int +_rl_vi_callback_set_mark (data) + _rl_callback_generic_arg *data; +{ + _rl_callback_func = 0; + _rl_want_redisplay = 1; + + return (_rl_vi_set_mark ()); +} +#endif + +int +rl_vi_set_mark (count, key) + int count, key; +{ +#if defined (READLINE_CALLBACKS) + if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + _rl_callback_data = 0; + _rl_callback_func = _rl_vi_callback_set_mark; + return (0); + } +#endif + + return (_rl_vi_set_mark ()); +} + +static int +_rl_vi_goto_mark () +{ + int ch; + + RL_SETSTATE(RL_STATE_MOREINPUT); + ch = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + + if (ch == '`') + { + rl_point = rl_mark; + return 0; + } + else if (ch < 0 || ch < 'a' || ch > 'z') /* make test against 0 explicit */ + { + rl_ding (); + return -1; + } + + ch -= 'a'; + if (vi_mark_chars[ch] == -1) + { + rl_ding (); + return -1; + } + rl_point = vi_mark_chars[ch]; + return 0; +} + +#if defined (READLINE_CALLBACKS) +static int +_rl_vi_callback_goto_mark (data) + _rl_callback_generic_arg *data; +{ + _rl_callback_func = 0; + _rl_want_redisplay = 1; + + return (_rl_vi_goto_mark ()); +} +#endif + +int +rl_vi_goto_mark (count, key) + int count, key; +{ +#if defined (READLINE_CALLBACKS) + if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + _rl_callback_data = 0; + _rl_callback_func = _rl_vi_callback_goto_mark; + return (0); + } +#endif + + return (_rl_vi_goto_mark ()); +} +#endif /* VI_MODE */ diff --git a/lib/readline/xfree.c b/lib/readline/xfree.c new file mode 100644 index 0000000..37a81e6 --- /dev/null +++ b/lib/readline/xfree.c @@ -0,0 +1,50 @@ +/* xfree.c -- safe version of free that ignores attempts to free NUL */ + +/* Copyright (C) 1991-2010 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +#include +#endif + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include "xmalloc.h" + +/* **************************************************************** */ +/* */ +/* Memory Deallocation. */ +/* */ +/* **************************************************************** */ + +/* Use this as the function to call when adding unwind protects so we + don't need to know what free() returns. */ +void +xfree (string) + PTR_T string; +{ + if (string) + free (string); +} diff --git a/lib/readline/xmalloc.c b/lib/readline/xmalloc.c new file mode 100644 index 0000000..c77d763 --- /dev/null +++ b/lib/readline/xmalloc.c @@ -0,0 +1,79 @@ +/* xmalloc.c -- safe versions of malloc and realloc */ + +/* Copyright (C) 1991-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#define READLINE_LIBRARY + +#if defined (HAVE_CONFIG_H) +#include +#endif + +#include + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include "xmalloc.h" + +/* **************************************************************** */ +/* */ +/* Memory Allocation and Deallocation. */ +/* */ +/* **************************************************************** */ + +static void +memory_error_and_abort (fname) + char *fname; +{ + fprintf (stderr, "%s: out of virtual memory\n", fname); + exit (2); +} + +/* Return a pointer to free()able block of memory large enough + to hold BYTES number of bytes. If the memory cannot be allocated, + print an error message and abort. */ +PTR_T +xmalloc (bytes) + size_t bytes; +{ + PTR_T temp; + + temp = malloc (bytes); + if (temp == 0) + memory_error_and_abort ("xmalloc"); + return (temp); +} + +PTR_T +xrealloc (pointer, bytes) + PTR_T pointer; + size_t bytes; +{ + PTR_T temp; + + temp = pointer ? realloc (pointer, bytes) : malloc (bytes); + + if (temp == 0) + memory_error_and_abort ("xrealloc"); + return (temp); +} diff --git a/lib/readline/xmalloc.h b/lib/readline/xmalloc.h new file mode 100644 index 0000000..f40d7a5 --- /dev/null +++ b/lib/readline/xmalloc.h @@ -0,0 +1,45 @@ +/* xmalloc.h -- memory allocation that aborts on errors. */ + +/* Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if !defined (_XMALLOC_H_) +#define _XMALLOC_H_ + +#if defined (READLINE_LIBRARY) +# include "rlstdc.h" +#else +# include +#endif + +#ifndef PTR_T + +#ifdef __STDC__ +# define PTR_T void * +#else +# define PTR_T char * +#endif + +#endif /* !PTR_T */ + +extern PTR_T xmalloc PARAMS((size_t)); +extern PTR_T xrealloc PARAMS((void *, size_t)); +extern void xfree PARAMS((void *)); + +#endif /* _XMALLOC_H_ */ diff --git a/lib/sh/Makefile.in b/lib/sh/Makefile.in new file mode 100644 index 0000000..36a8305 --- /dev/null +++ b/lib/sh/Makefile.in @@ -0,0 +1,571 @@ +# +# Makefile for the Bash library +# +# +# Copyright (C) 1998-2010 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +PACKAGE = @PACKAGE_NAME@ +VERSION = @PACKAGE_VERSION@ + +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_VERSION = @PACKAGE_VERSION@ + +srcdir = @srcdir@ +VPATH = .:@srcdir@ +topdir = @top_srcdir@ +BUILD_DIR = @BUILD_DIR@ + +LIBBUILD = ${BUILD_DIR}/lib + +BASHINCDIR = ${topdir}/include + +INTL_LIBSRC = ${topdir}/lib/intl +INTL_BUILDDIR = ${LIBBUILD}/intl +INTL_INC = @INTL_INC@ +LIBINTL_H = @LIBINTL_H@ + +datarootdir = @datarootdir@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ + +CC = @CC@ +RANLIB = @RANLIB@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +RM = rm -f +CP = cp +MV = mv + +SHELL = @MAKE_SHELL@ + +CFLAGS = @CFLAGS@ +LOCAL_CFLAGS = @LOCAL_CFLAGS@ ${DEBUG} +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ @LOCAL_LDFLAGS@ + +PROFILE_FLAGS = @PROFILE_FLAGS@ + +DEFS = @DEFS@ +LOCAL_DEFS = @LOCAL_DEFS@ + +INCLUDES = -I. -I../.. -I$(topdir) -I$(topdir)/lib -I$(BASHINCDIR) -I$(srcdir) $(INTL_INC) + +CCFLAGS = ${PROFILE_FLAGS} ${INCLUDES} $(DEFS) $(LOCAL_DEFS) $(LOCAL_CFLAGS) \ + $(CFLAGS) $(CPPFLAGS) + +GCC_LINT_FLAGS = -Wall -Wshadow -Wpointer-arith -Wcast-qual \ + -Wcast-align -Wstrict-prototypes -Wconversion \ + -Wmissing-prototypes -Wtraditional -Wredundant-decls -pedantic + +.c.o: + $(CC) -c $(CCFLAGS) $< + +# The name of the library target. +LIBRARY_NAME = libsh.a + +# The C code source files for this library. +CSOURCES = clktck.c clock.c getcwd.c getenv.c oslib.c setlinebuf.c \ + strcasecmp.c strerror.c strtod.c strtol.c strtoul.c \ + vprint.c itos.c rename.c zread.c zwrite.c shtty.c \ + inet_aton.c netconn.c netopen.c strpbrk.c timeval.c makepath.c \ + pathcanon.c pathphys.c tmpfile.c stringlist.c stringvec.c spell.c \ + shquote.c strtrans.c strcasestr.c snprintf.c mailstat.c \ + fmtulong.c fmtullong.c fmtumax.c shmatch.c strnlen.c \ + strtoll.c strtoull.c strtoimax.c strtoumax.c memset.c strstr.c \ + mktime.c strftime.c mbschr.c zcatfd.c zmapfd.c winsize.c eaccess.c \ + wcsdup.c fpurge.c zgetline.c mbscmp.c uconvert.c ufuncs.c \ + casemod.c dprintf.c input_avail.c mbscasecmp.c fnxform.c \ + strchrnul.c unicode.c wcswidth.c wcsnwidth.c shmbchar.c strdup.c + +# The header files for this library. +HSOURCES = + +# The object files contained in $(LIBRARY_NAME) +LIBOBJS = @LIBOBJS@ +OBJECTS = clktck.o clock.o getenv.o oslib.o setlinebuf.o strnlen.o \ + itos.o zread.o zwrite.o shtty.o shmatch.o eaccess.o \ + netconn.o netopen.o timeval.o makepath.o pathcanon.o \ + pathphys.o tmpfile.o stringlist.o stringvec.o spell.o shquote.o \ + strtrans.o snprintf.o mailstat.o fmtulong.o \ + fmtullong.o fmtumax.o zcatfd.o zmapfd.o winsize.o wcsdup.o \ + fpurge.o zgetline.o mbscmp.o uconvert.o ufuncs.o casemod.o \ + input_avail.o mbscasecmp.o fnxform.o unicode.o shmbchar.o \ + wcsnwidth.o ${LIBOBJS} + +SUPPORT = Makefile + +all: $(LIBRARY_NAME) + +$(LIBRARY_NAME): $(OBJECTS) + $(RM) $@ + $(AR) $(ARFLAGS) $@ $(OBJECTS) + -test -n "$(RANLIB)" && $(RANLIB) $@ + +force: + +# The rule for 'includes' is written funny so that the if statement +# always returns TRUE unless there really was an error installing the +# include files. +install: + +clean: + $(RM) $(OBJECTS) $(LIBRARY_NAME) + +realclean distclean maintainer-clean: clean + $(RM) Makefile + +mostlyclean: clean + +# Dependencies + +${BUILD_DIR}/version.h: ${BUILD_DIR}/config.h ${BUILD_DIR}/Makefile Makefile + -( cd ${BUILD_DIR} && ${MAKE} ${MFLAGS} version.h ) + +${BUILD_DIR}/pathnames.h: ${BUILD_DIR}/config.h ${BUILD_DIR}/Makefile Makefile + -( cd ${BUILD_DIR} && ${MAKE} ${MFLAGS} pathnames.h ) + +# rules for losing makes, like SunOS +casemod.o: casemod.c +clktck.o: clktck.c +clock.o: clock.c +eaccess.o: eaccess.c +dprintf.o: dprintf.c +fmtullong.o: fmtullong.c +fmtulong.o: fmtulong.c +fmtumax.o: fmtumax.c +fnxform.o: fnxform.c +fpurge.o: fpurge.c +getcwd.o: getcwd.c +getenv.o: getenv.c +inet_aton.o: inet_aton.c +input_avail.o: input_avail.c +itos.o: itos.c +mailstat.o: mailstat.c +makepath.o: makepath.c +mbscasecmp.o: mbscasecmp.c +mbscmp.o: mbscmp.c +memset.o: memset.c +mktime.o: mktime.c +netconn.o: netconn.c +netopen.o: netopen.c +oslib.o: oslib.c +pathcanon.o: pathcanon.c +pathphys.o: pathphys.c +rename.o: rename.c +setlinebuf.o: setlinebuf.c +shmbchar.o: shmbchar.c +shquote.o: shquote.c +shtty.o: shtty.c +snprintf.o: snprintf.c +spell.o: spell.c +strcasecmp.o: strcasecmp.c +strerror.o: strerror.c +strftime.o: strftime.c +strcasestr.o: strcasestr.c +stringlist.o: stringlist.c +stringvec.o: stringvec.c +strnlen.o: strnlen.c +strpbrk.o: strpbrk.c +strtod.o: strtod.c +strtoimax.o: strtoimax.c +strtol.o: strtol.c +strtoll.o: strtoll.c +strtoul.o: strtoul.c +strtoull.o: strtoull.c +strtoumax.o: strtoumax.c +strtrans.o: strtrans.c +times.o: times.c +timeval.o: timeval.c +tmpfile.o: tmpfile.c +uconvert.o: uconvert.c +ufuncs.o: ufuncs.c +vprint.o: vprint.c +wcsdup.o: wcsdup.c +wcsnwidth.o: wcsnwidth.c +wcswidth.o: wcswidth.c +mbschr.o: mbschr.c +zcatfd.o: zcatfd.c +zmapfd.o: zmapfd.c +zgetline.o: zgetline.c +zread.o: zread.c +zwrite.o: zwrite.c + +# dependencies for c files that include other c files +fmtullong.o: fmtulong.c +fmtumax.o: fmtulong.c +strtoll.o: strtol.c +strtoul.o: strtol.c +strtoull.o: strtol.c + +# all files in the library depend on config.h +casemod.o: ${BUILD_DIR}/config.h +clktck.o: ${BUILD_DIR}/config.h +clock.o: ${BUILD_DIR}/config.h +eaccess.o: ${BUILD_DIR}/config.h +dprintf.o: ${BUILD_DIR}/config.h +fmtullong.o: ${BUILD_DIR}/config.h +fmtulong.o: ${BUILD_DIR}/config.h +fmtumax.o: ${BUILD_DIR}/config.h +fnxform.o: ${BUILD_DIR}/config.h +fpurge.o: ${BUILD_DIR}/config.h +getcwd.o: ${BUILD_DIR}/config.h +getenv.o: ${BUILD_DIR}/config.h +inet_aton.o: ${BUILD_DIR}/config.h +input_avail.o: ${BUILD_DIR}/config.h +itos.o: ${BUILD_DIR}/config.h +mailstat.o: ${BUILD_DIR}/config.h +makepath.o: ${BUILD_DIR}/config.h +mbscasecmp.o: ${BUILD_DIR}/config.h +mbscmp.o: ${BUILD_DIR}/config.h +memset.o: ${BUILD_DIR}/config.h +mktime.o: ${BUILD_DIR}/config.h +netconn.o: ${BUILD_DIR}/config.h +netopen.o: ${BUILD_DIR}/config.h +oslib.o: ${BUILD_DIR}/config.h +pathcanon.o: ${BUILD_DIR}/config.h +pathphys.o: ${BUILD_DIR}/config.h +rename.o: ${BUILD_DIR}/config.h +setlinebuf.o: ${BUILD_DIR}/config.h +shmbchare.o: ${BUILD_DIR}/config.h +shquote.o: ${BUILD_DIR}/config.h +shtty.o: ${BUILD_DIR}/config.h +snprintf.o: ${BUILD_DIR}/config.h +spell.o: ${BUILD_DIR}/config.h +strcasecmp.o: ${BUILD_DIR}/config.h +strerror.o: ${BUILD_DIR}/config.h +strftime.o: ${BUILD_DIR}/config.h +strcasestr.o: ${BUILD_DIR}/config.h +stringlist.o: ${BUILD_DIR}/config.h +stringvec.o: ${BUILD_DIR}/config.h +strnlen.o: ${BUILD_DIR}/config.h +strpbrk.o: ${BUILD_DIR}/config.h +strtod.o: ${BUILD_DIR}/config.h +strtoimax.o: ${BUILD_DIR}/config.h +strtol.o: ${BUILD_DIR}/config.h +strtoll.o: ${BUILD_DIR}/config.h +strtoul.o: ${BUILD_DIR}/config.h +strtoull.o: ${BUILD_DIR}/config.h +strtoumax.o: ${BUILD_DIR}/config.h +strtrans.o: ${BUILD_DIR}/config.h +times.o: ${BUILD_DIR}/config.h +timeval.o: ${BUILD_DIR}/config.h +tmpfile.o: ${BUILD_DIR}/config.h +uconvert.o: ${BUILD_DIR}/config.h +ufuncs.o: ${BUILD_DIR}/config.h +vprint.o: ${BUILD_DIR}/config.h +wcsdup.o: ${BUILD_DIR}/config.h +wcsnwidth.o: ${BUILD_DIR}/config.h +wcswidth.o: ${BUILD_DIR}/config.h +mbschr.o: ${BUILD_DIR}/config.h +zcatfd.o: ${BUILD_DIR}/config.h +zgetline.o: ${BUILD_DIR}/config.h +zmapfd.o: ${BUILD_DIR}/config.h +zread.o: ${BUILD_DIR}/config.h +zwrite.o: ${BUILD_DIR}/config.h + +clktck.o: ${topdir}/bashtypes.h + +getcwd.o: ${topdir}/bashtypes.h ${topdir}/bashansi.h ${BASHINCDIR}/maxpath.h +getcwd.o: ${BASHINCDIR}/posixstat.h ${BASHINCDIR}/posixdir.h +getcwd.o: ${BASHINCDIR}/memalloc.h ${BASHINCDIR}/ansi_stdlib.h + +getenv.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h +getenv.o: ${topdir}/shell.h ${topdir}/syntax.h ${topdir}/bashjmp.h ${BASHINCDIR}/posixjmp.h +getenv.o: ${topdir}/command.h ${BASHINCDIR}/stdc.h ${topdir}/error.h +getenv.o: ${topdir}/general.h ${topdir}/bashtypes.h ${topdir}/variables.h ${topdir}/conftypes.h +getenv.o: ${topdir}/array.h ${topdir}/hashlib.h ${topdir}/quit.h +getenv.o: ${topdir}/unwind_prot.h ${topdir}/dispose_cmd.h +getenv.o: ${topdir}/make_cmd.h ${topdir}/subst.h ${topdir}/sig.h +getenv.o: ${BUILD_DIR}/pathnames.h ${topdir}/externs.h +#getenv.o: ${BUILD_DIR}/version.h + +inet_aton.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h +inet_aton.o: ${BASHINCDIR}/stdc.h + +itos.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h +itos.o: ${topdir}/shell.h ${topdir}/syntax.h ${topdir}/bashjmp.h ${BASHINCDIR}/posixjmp.h +itos.o: ${topdir}/command.h ${BASHINCDIR}/stdc.h ${topdir}/error.h +itos.o: ${topdir}/general.h ${topdir}/bashtypes.h ${topdir}/variables.h ${topdir}/conftypes.h +itos.o: ${topdir}/array.h ${topdir}/hashlib.h ${topdir}/quit.h +itos.o: ${topdir}/unwind_prot.h ${topdir}/dispose_cmd.h +itos.o: ${topdir}/make_cmd.h ${topdir}/subst.h ${topdir}/sig.h +itos.o: ${BUILD_DIR}/pathnames.h ${topdir}/externs.h +#itos.o: ${BUILD_DIR}/version.h + +makepath.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h +makepath.o: ${topdir}/shell.h ${topdir}/syntax.h ${topdir}/bashjmp.h ${BASHINCDIR}/posixjmp.h +makepath.o: ${topdir}/command.h ${BASHINCDIR}/stdc.h ${topdir}/error.h +makepath.o: ${topdir}/general.h ${topdir}/bashtypes.h ${topdir}/variables.h ${topdir}/conftypes.h +makepath.o: ${topdir}/array.h ${topdir}/hashlib.h ${topdir}/quit.h +makepath.o: ${topdir}/unwind_prot.h ${topdir}/dispose_cmd.h +makepath.o: ${topdir}/make_cmd.h ${topdir}/subst.h ${topdir}/sig.h +makepath.o: ${BUILD_DIR}/pathnames.h ${topdir}/externs.h +#makepath.o: ${BUILD_DIR}/version.h + +netconn.o: ${BASHINCDIR}/posixstat.h ${BASHINCDIR}/filecntl.h +netconn.o: ${topdir}/bashtypes.h + +netopen.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h ${topdir}/xmalloc.h +netopen.o: ${topdir}/shell.h ${topdir}/syntax.h ${topdir}/bashjmp.h ${BASHINCDIR}/posixjmp.h +netopen.o: ${topdir}/command.h ${BASHINCDIR}/stdc.h ${topdir}/error.h +netopen.o: ${topdir}/general.h ${topdir}/bashtypes.h ${topdir}/variables.h ${topdir}/conftypes.h +netopen.o: ${topdir}/array.h ${topdir}/hashlib.h ${topdir}/quit.h +netopen.o: ${topdir}/unwind_prot.h ${topdir}/dispose_cmd.h +netopen.o: ${topdir}/make_cmd.h ${topdir}/subst.h ${topdir}/sig.h +netopen.o: ${BUILD_DIR}/pathnames.h ${topdir}/externs.h +netopen.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h +#netopen.o: ${BUILD_DIR}/version.h + +oslib.o: ${topdir}/bashtypes.h ${topdir}/bashansi.h ${BASHINCDIR}/maxpath.h +oslib.o: ${topdir}/shell.h ${topdir}/syntax.h ${topdir}/bashjmp.h ${BASHINCDIR}/posixjmp.h +oslib.o: ${topdir}/command.h ${BASHINCDIR}/stdc.h ${topdir}/error.h +oslib.o: ${topdir}/general.h ${topdir}/bashtypes.h ${topdir}/variables.h ${topdir}/conftypes.h +oslib.o: ${topdir}/array.h ${topdir}/hashlib.h ${topdir}/quit.h +oslib.o: ${topdir}/unwind_prot.h ${topdir}/dispose_cmd.h +oslib.o: ${topdir}/make_cmd.h ${topdir}/subst.h ${topdir}/sig.h +oslib.o: ${BUILD_DIR}/pathnames.h ${topdir}/externs.h +oslib.o: ${BASHINCDIR}/posixstat.h ${BASHINCDIR}/filecntl.h +oslib.o: ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/chartypes.h +#oslib.o: ${BUILD_DIR}/version.h + +pathcanon.o: ${topdir}/bashtypes.h ${topdir}/bashansi.h ${BASHINCDIR}/maxpath.h +pathcanon.o: ${topdir}/shell.h ${topdir}/syntax.h ${topdir}/bashjmp.h ${BASHINCDIR}/posixjmp.h +pathcanon.o: ${topdir}/command.h ${BASHINCDIR}/stdc.h ${topdir}/error.h +pathcanon.o: ${topdir}/general.h ${topdir}/bashtypes.h ${topdir}/variables.h ${topdir}/conftypes.h +pathcanon.o: ${topdir}/array.h ${topdir}/hashlib.h ${topdir}/quit.h +pathcanon.o: ${topdir}/unwind_prot.h ${topdir}/dispose_cmd.h +pathcanon.o: ${topdir}/make_cmd.h ${topdir}/subst.h ${topdir}/sig.h +pathcanon.o: ${BUILD_DIR}/pathnames.h ${topdir}/externs.h +pathcanon.o: ${BASHINCDIR}/posixstat.h ${BASHINCDIR}/filecntl.h +pathcanon.o: ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/chartypes.h +#pathcanon.o: ${BUILD_DIR}/version.h + +pathphys.o: ${topdir}/bashtypes.h ${topdir}/bashansi.h ${BASHINCDIR}/maxpath.h +pathphys.o: ${topdir}/shell.h ${topdir}/syntax.h ${topdir}/bashjmp.h ${BASHINCDIR}/posixjmp.h +pathphys.o: ${topdir}/command.h ${BASHINCDIR}/stdc.h ${topdir}/error.h +pathphys.o: ${topdir}/general.h ${topdir}/bashtypes.h ${topdir}/variables.h ${topdir}/conftypes.h +pathphys.o: ${topdir}/array.h ${topdir}/hashlib.h ${topdir}/quit.h +pathphys.o: ${topdir}/unwind_prot.h ${topdir}/dispose_cmd.h +pathphys.o: ${topdir}/make_cmd.h ${topdir}/subst.h ${topdir}/sig.h +pathphys.o: ${BUILD_DIR}/pathnames.h ${topdir}/externs.h +pathphys.o: ${BASHINCDIR}/posixstat.h ${BASHINCDIR}/filecntl.h +pathphys.o: ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/chartypes.h +#pathphys.o: ${BUILD_DIR}/version.h + +rename.o: ${topdir}/bashtypes.h ${BASHINCDIR}/stdc.h +rename.o: ${BASHINCDIR}/posixstat.h + +setlinebuf.o: ${topdir}/xmalloc.h ${topdir}/bashansi.h +setlinebuf.o: ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/stdc.h + +eaccess.o: ${topdir}/bashtypes.h +eaccess.o: ${BASHINCDIR}/posixstat.h +eaccess.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h +eaccess.o: ${BASHINCDIR}/filecntl.h +eaccess.o: ${BASHINCDIR}/stdc.h +eaccess.o: ${topdir}/shell.h ${topdir}/syntax.h ${topdir}/bashjmp.h ${BASHINCDIR}/posixjmp.h +eaccess.o: ${topdir}/command.h ${BASHINCDIR}/stdc.h ${topdir}/error.h +eaccess.o: ${topdir}/general.h ${topdir}/bashtypes.h ${topdir}/variables.h ${topdir}/conftypes.h +eaccess.o: ${topdir}/array.h ${topdir}/hashlib.h ${topdir}/quit.h +eaccess.o: ${topdir}/unwind_prot.h ${topdir}/dispose_cmd.h +eaccess.o: ${topdir}/make_cmd.h ${topdir}/subst.h ${topdir}/sig.h +eaccess.o: ${BUILD_DIR}/pathnames.h ${topdir}/externs.h +#eaccess.o: ${BUILD_DIR}/version.h + +shquote.o: ${BASHINCDIR}/stdc.h ${topdir}/bashansi.h +shquote.o: ${BASHINCDIR}/ansi_stdlib.h ${topdir}/xmalloc.h + +shtty.o: ${BASHINCDIR}/shtty.h +shtty.o: ${BASHINCDIR}/stdc.h + +snprintf.o: ${BASHINCDIR}/stdc.h ${topdir}/bashansi.h ${topdir}/xmalloc.h +snprintf.o: ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/chartypes.h +snprintf.o: ${BASHINCDIR}/typemax.h + +spell.o: ${topdir}/bashtypes.h +spell.o: ${BASHINCDIR}/posixstat.h ${BASHINCDIR}/posixdir.h +spell.o: ${BASHINCDIR}/ansi_stdlib.h + +strcasecmp.o: ${BASHINCDIR}/stdc.h ${topdir}/bashansi.h +strcasecmp.o: ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/chartypes.h + +strerror.o: ${topdir}/bashtypes.h +strerror.o: ${topdir}/shell.h ${topdir}/syntax.h ${topdir}/bashjmp.h ${BASHINCDIR}/posixjmp.h +strerror.o: ${topdir}/command.h ${BASHINCDIR}/stdc.h ${topdir}/error.h +strerror.o: ${topdir}/general.h ${topdir}/bashtypes.h ${topdir}/variables.h ${topdir}/conftypes.h +strerror.o: ${topdir}/array.h ${topdir}/hashlib.h ${topdir}/quit.h +strerror.o: ${topdir}/unwind_prot.h ${topdir}/dispose_cmd.h +strerror.o: ${topdir}/make_cmd.h ${topdir}/subst.h ${topdir}/sig.h +strerror.o: ${BUILD_DIR}/pathnames.h ${topdir}/externs.h +#strerror.o: ${BUILD_DIR}/version.h + +strcasestr.o: ${BASHINCDIR}/stdc.h ${topdir}/bashansi.h +strcasestr.o: ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/chartypes.h + +stringlist.o: ${topdir}/bashansi.h +stringlist.o: ${topdir}/shell.h ${topdir}/syntax.h ${topdir}/bashjmp.h ${BASHINCDIR}/posixjmp.h +stringlist.o: ${topdir}/command.h ${BASHINCDIR}/stdc.h ${topdir}/error.h +stringlist.o: ${topdir}/general.h ${topdir}/bashtypes.h ${topdir}/variables.h ${topdir}/conftypes.h +stringlist.o: ${topdir}/array.h ${topdir}/hashlib.h ${topdir}/quit.h +stringlist.o: ${topdir}/unwind_prot.h ${topdir}/dispose_cmd.h +stringlist.o: ${topdir}/make_cmd.h ${topdir}/subst.h ${topdir}/sig.h +stringlist.o: ${BUILD_DIR}/pathnames.h ${topdir}/externs.h +#stringlist.o: ${BUILD_DIR}/version.h + +stringvec.o: ${topdir}/bashansi.h ${BASHINCDIR}/chartypes.h +stringvec.o: ${topdir}/shell.h ${topdir}/syntax.h ${topdir}/bashjmp.h ${BASHINCDIR}/posixjmp.h +stringvec.o: ${topdir}/command.h ${BASHINCDIR}/stdc.h ${topdir}/error.h +stringvec.o: ${topdir}/general.h ${topdir}/bashtypes.h ${topdir}/variables.h ${topdir}/conftypes.h +stringvec.o: ${topdir}/array.h ${topdir}/hashlib.h ${topdir}/quit.h +stringvec.o: ${topdir}/unwind_prot.h ${topdir}/dispose_cmd.h +stringvec.o: ${topdir}/make_cmd.h ${topdir}/subst.h ${topdir}/sig.h +stringvec.o: ${BUILD_DIR}/pathnames.h ${topdir}/externs.h +#stringvec.o: ${BUILD_DIR}/version.h + +strnlen.o: ${BASHINCDIR}/stdc.h + +strpbrk.o: ${BASHINCDIR}/stdc.h + +strtod.o: ${topdir}/bashansi.h +strtod.o: ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/chartypes.h + +strtoimax.o: ${BASHINCDIR}/stdc.h + +strtol.o: ${topdir}/bashansi.h +strtol.o: ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/chartypes.h +strtol.o: ${BASHINCDIR}/typemax.h + +strtoll.o: ${topdir}/bashansi.h +strtoll.o: ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/chartypes.h +strtoll.o: ${BASHINCDIR}/typemax.h + +strtoul.o: ${topdir}/bashansi.h +strtoul.o: ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/chartypes.h +strtoul.o: ${BASHINCDIR}/typemax.h + +strtoull.o: ${topdir}/bashansi.h +strtoull.o: ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/chartypes.h +strtoull.o: ${BASHINCDIR}/typemax.h + +strtoumax.o: ${BASHINCDIR}/stdc.h + +strtrans.o: ${topdir}/bashansi.h +strtrans.o: ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/chartypes.h +strtrans.o: ${topdir}/shell.h ${topdir}/syntax.h ${topdir}/bashjmp.h ${BASHINCDIR}/posixjmp.h +strtrans.o: ${topdir}/command.h ${BASHINCDIR}/stdc.h ${topdir}/error.h +strtrans.o: ${topdir}/general.h ${topdir}/bashtypes.h ${topdir}/variables.h ${topdir}/conftypes.h +strtrans.o: ${topdir}/array.h ${topdir}/hashlib.h ${topdir}/quit.h +strtrans.o: ${topdir}/unwind_prot.h ${topdir}/dispose_cmd.h +strtrans.o: ${topdir}/make_cmd.h ${topdir}/subst.h ${topdir}/sig.h +strtrans.o: ${BUILD_DIR}/pathnames.h ${topdir}/externs.h +#strtrans.o: ${BUILD_DIR}/version.h + +times.o: ${BASHINCDIR}/systimes.h +times.o: ${BASHINCDIR}/posixtime.h + +timeval.o: ${BASHINCDIR}/posixtime.h + +tmpfile.o: ${topdir}/bashtypes.h +tmpfile.o: ${BASHINCDIR}/posixstat.h +tmpfile.o: ${BASHINCDIR}/filecntl.h + +uconvert.o: ${topdir}/bashtypes.h + +ufuncs.o: ${topdir}/bashtypes.h + +clock.o: ${BASHINCDIR}/posixtime.h + +mailstat.o: ${topdir}/bashansi.h +mailstat.o: ${topdir}/bashtypes.h +mailstat.o: ${BASHINCDIR}/ansi_stdlib.h +mailstat.o: ${BASHINCDIR}/posixstat.h +mailstat.o: ${BASHINCDIR}/posixdir.h +mailstat.o: ${BASHINCDIR}/maxpath.h + +fmtulong.o: ${topdir}/bashansi.h +fmtulong.o: ${BASHINCDIR}/ansi_stdlib.h +fmtulong.o: ${BASHINCDIR}/chartypes.h +fmtulong.o: ${BASHINCDIR}/stdc.h +fmtulong.o: ${BASHINCDIR}/typemax.h +fmtulong.o: ${topdir}/bashintl.h ${LIBINTL_H} ${BASHINCDIR}/gettext.h + +fmtullong.o: ${topdir}/bashansi.h +fmtullong.o: ${BASHINCDIR}/ansi_stdlib.h +fmtullong.o: ${BASHINCDIR}/chartypes.h +fmtullong.o: ${BASHINCDIR}/stdc.h +fmtullong.o: ${BASHINCDIR}/typemax.h +fmtullong.o: ${topdir}/bashintl.h ${LIBINTL_H} ${BASHINCDIR}/gettext.h + +fmtumax.o: ${topdir}/bashansi.h +fmtumax.o: ${BASHINCDIR}/ansi_stdlib.h +fmtumax.o: ${BASHINCDIR}/chartypes.h +fmtumax.o: ${BASHINCDIR}/stdc.h +fmtumax.o: ${BASHINCDIR}/typemax.h +fmtumax.o: ${topdir}/bashintl.h ${LIBINTL_H} ${BASHINCDIR}/gettext.h + +wcsdup.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h +wcsdup.o: ${BASHINCDIR}/stdc.h +wcsdup.o: ${topdir}/xmalloc.h + +wcsnwidth.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h +wcsnwidth.o: ${BASHINCDIR}/stdc.h + +wcswidth.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h +wcswidth.o: ${BASHINCDIR}/stdc.h + +mbschr.o: ${topdir}/bashansi.h +mbschr.o: ${BASHINCDIR}/ansi_stdlib.h +mbschr.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h + +zgetline.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h +zgetline.o: ${BASHINCDIR}/stdc.h +zgetline.o: ${topdir}/xmalloc.h +zgetline.o: ${topdir}/bashtypes.h + +mbscasecmp.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h +mbscasecmp.o: ${BASHINCDIR}/stdc.h +mbscasecmp.o: ${topdir}/xmalloc.h + +mbscmp.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h +mbscmp.o: ${BASHINCDIR}/stdc.h +mbscmp.o: ${topdir}/xmalloc.h + +casemod.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h +casemod.o: ${BASHINCDIR}/stdc.h +casemod.o: ${topdir}/xmalloc.h +casemod.o: ${topdir}/bashtypes.h +casemod.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h +casemod.o: ${topdir}/bashintl.h ${LIBINTL_H} ${BASHINCDIR}/gettext.h + +dprintf.o: ${BASHINCDIR}/stdc.h + +input_avail.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h +input_avail.o: ${BASHINCDIR}/stdc.h +input_avail.o: ${topdir}/xmalloc.h ${BASHINCDIR}/posixselect.h + +mktime.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h +mktime.o: ${BASHINCDIR}/stdc.h + +fnxform.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h +fnxform.o: ${BASHINCDIR}/stdc.h +fnxform.o: ${topdir}/bashtypes.h +fnxform.o: ${topdir}/bashintl.h ${LIBINTL_H} ${BASHINCDIR}/gettext.h + +shmbchar.o: ${BASHINCDIR}/shmbchar.h diff --git a/lib/sh/casemod.c b/lib/sh/casemod.c new file mode 100644 index 0000000..bbcffa6 --- /dev/null +++ b/lib/sh/casemod.c @@ -0,0 +1,265 @@ +/* casemod.c -- functions to change case of strings */ + +/* Copyright (C) 2008,2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# include +#endif /* HAVE_UNISTD_H */ + +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include + +#define _to_wupper(wc) (iswlower (wc) ? towupper (wc) : (wc)) +#define _to_wlower(wc) (iswupper (wc) ? towlower (wc) : (wc)) + +#if !defined (HANDLE_MULTIBYTE) +# define cval(s, i) ((s)[(i)]) +# define iswalnum(c) (isalnum(c)) +# define TOGGLE(x) (ISUPPER (x) ? tolower (x) : (TOUPPER (x))) +#else +# define TOGGLE(x) (iswupper (x) ? towlower (x) : (_to_wupper(x))) +#endif + +/* These must agree with the defines in externs.h */ +#define CASE_NOOP 0x0000 +#define CASE_LOWER 0x0001 +#define CASE_UPPER 0x0002 +#define CASE_CAPITALIZE 0x0004 +#define CASE_UNCAP 0x0008 +#define CASE_TOGGLE 0x0010 +#define CASE_TOGGLEALL 0x0020 +#define CASE_UPFIRST 0x0040 +#define CASE_LOWFIRST 0x0080 + +#define CASE_USEWORDS 0x1000 /* modify behavior to act on words in passed string */ + +extern char *substring __P((char *, int, int)); + +#ifndef UCHAR_MAX +# define UCHAR_MAX TYPE_MAXIMUM(unsigned char) +#endif + +#if defined (HANDLE_MULTIBYTE) +static wchar_t +cval (s, i) + char *s; + int i; +{ + size_t tmp; + wchar_t wc; + int l; + mbstate_t mps; + + if (MB_CUR_MAX == 1 || is_basic (s[i])) + return ((wchar_t)s[i]); + l = strlen (s); + if (i >= (l - 1)) + return ((wchar_t)s[i]); + memset (&mps, 0, sizeof (mbstate_t)); + tmp = mbrtowc (&wc, s + i, l - i, &mps); + if (MB_INVALIDCH (tmp) || MB_NULLWCH (tmp)) + return ((wchar_t)s[i]); + return wc; +} +#endif + +/* Modify the case of characters in STRING matching PAT based on the value of + FLAGS. If PAT is null, modify the case of each character */ +char * +sh_modcase (string, pat, flags) + const char *string; + char *pat; + int flags; +{ + int start, next, end; + int inword, c, nc, nop, match, usewords; + char *ret, *s; + wchar_t wc; +#if defined (HANDLE_MULTIBYTE) + wchar_t nwc; + char mb[MB_LEN_MAX+1]; + int mlen; + size_t m; + mbstate_t state; +#endif + + if (string == 0 || *string == 0) + { + ret = (char *)xmalloc (1); + ret[0] = '\0'; + return ret; + } + +#if defined (HANDLE_MULTIBYTE) + memset (&state, 0, sizeof (mbstate_t)); +#endif + + start = 0; + end = strlen (string); + + ret = (char *)xmalloc (end + 1); + strcpy (ret, string); + + /* See if we are supposed to split on alphanumerics and operate on each word */ + usewords = (flags & CASE_USEWORDS); + flags &= ~CASE_USEWORDS; + + inword = 0; + while (start < end) + { + wc = cval (ret, start); + + if (iswalnum (wc) == 0) + { + inword = 0; +#if 0 + ADVANCE_CHAR (ret, end, start); + continue; +#endif + } + + if (pat) + { + next = start; + ADVANCE_CHAR (ret, end, next); + s = substring (ret, start, next); + match = strmatch (pat, s, FNM_EXTMATCH) != FNM_NOMATCH; + free (s); + if (match == 0) + { + start = next; + inword = 1; + continue; + } + } + + /* XXX - for now, the toggling operators work on the individual + words in the string, breaking on alphanumerics. Should I + leave the capitalization operators to do that also? */ + if (flags == CASE_CAPITALIZE) + { + if (usewords) + nop = inword ? CASE_LOWER : CASE_UPPER; + else + nop = (start > 0) ? CASE_LOWER : CASE_UPPER; + inword = 1; + } + else if (flags == CASE_UNCAP) + { + if (usewords) + nop = inword ? CASE_UPPER : CASE_LOWER; + else + nop = (start > 0) ? CASE_UPPER : CASE_LOWER; + inword = 1; + } + else if (flags == CASE_UPFIRST) + { + if (usewords) + nop = inword ? CASE_NOOP : CASE_UPPER; + else + nop = (start > 0) ? CASE_NOOP : CASE_UPPER; + inword = 1; + } + else if (flags == CASE_LOWFIRST) + { + if (usewords) + nop = inword ? CASE_NOOP : CASE_LOWER; + else + nop = (start > 0) ? CASE_NOOP : CASE_LOWER; + inword = 1; + } + else if (flags == CASE_TOGGLE) + { + nop = inword ? CASE_NOOP : CASE_TOGGLE; + inword = 1; + } + else + nop = flags; + + /* Need to check UCHAR_MAX since wc may have already been converted to a + wide character by cval() */ + if (MB_CUR_MAX == 1 || (wc <= UCHAR_MAX && is_basic ((int)wc))) + { +singlebyte: + switch (nop) + { + default: + case CASE_NOOP: nc = wc; break; + case CASE_UPPER: nc = TOUPPER (wc); break; + case CASE_LOWER: nc = TOLOWER (wc); break; + case CASE_TOGGLEALL: + case CASE_TOGGLE: nc = TOGGLE (wc); break; + } + ret[start] = nc; + } +#if defined (HANDLE_MULTIBYTE) + else + { + m = mbrtowc (&wc, string + start, end - start, &state); + if (MB_INVALIDCH (m)) + { + wc = (unsigned char)string[start]; + goto singlebyte; + } + else if (MB_NULLWCH (m)) + wc = L'\0'; + switch (nop) + { + default: + case CASE_NOOP: nwc = wc; break; + case CASE_UPPER: nwc = _to_wupper (wc); break; + case CASE_LOWER: nwc = _to_wlower (wc); break; + case CASE_TOGGLEALL: + case CASE_TOGGLE: nwc = TOGGLE (wc); break; + } + if (nwc != wc) /* just skip unchanged characters */ + { + mlen = wcrtomb (mb, nwc, &state); + if (mlen > 0) + mb[mlen] = '\0'; + /* Assume the same width */ + strncpy (ret + start, mb, mlen); + } + } +#endif + + /* This assumes that the upper and lower case versions are the same width. */ + ADVANCE_CHAR (ret, end, start); + } + + return ret; +} diff --git a/lib/sh/clktck.c b/lib/sh/clktck.c new file mode 100644 index 0000000..8b9b5b3 --- /dev/null +++ b/lib/sh/clktck.c @@ -0,0 +1,61 @@ +/* clktck.c - get the value of CLK_TCK. */ + +/* Copyright (C) 1997 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include +#if defined (HAVE_SYS_PARAM_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (HAVE_LIMITS_H) +# include +#endif + +#if !defined (HAVE_SYSCONF) || !defined (_SC_CLK_TCK) +# if !defined (CLK_TCK) +# if defined (HZ) +# define CLK_TCK HZ +# else +# define CLK_TCK 60 +# endif +# endif /* !CLK_TCK */ +#endif /* !HAVE_SYSCONF && !_SC_CLK_TCK */ + +long +get_clk_tck () +{ + static long retval = 0; + + if (retval != 0) + return (retval); + +#if defined (HAVE_SYSCONF) && defined (_SC_CLK_TCK) + retval = sysconf (_SC_CLK_TCK); +#else /* !SYSCONF || !_SC_CLK_TCK */ + retval = CLK_TCK; +#endif /* !SYSCONF || !_SC_CLK_TCK */ + + return (retval); +} diff --git a/lib/sh/clock.c b/lib/sh/clock.c new file mode 100644 index 0000000..84cdbc5 --- /dev/null +++ b/lib/sh/clock.c @@ -0,0 +1,81 @@ +/* clock.c - operations on struct tms and clock_t's */ + +/* Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HAVE_TIMES) + +#include +#include + +#if defined (HAVE_SYS_TIMES_H) +# include +#endif + +#include +#include + +extern long get_clk_tck __P((void)); + +void +clock_t_to_secs (t, sp, sfp) + clock_t t; + time_t *sp; + int *sfp; +{ + static long clk_tck = -1; + + if (clk_tck == -1) + clk_tck = get_clk_tck (); + + *sfp = t % clk_tck; + *sfp = (*sfp * 1000) / clk_tck; + + *sp = t / clk_tck; + + /* Sanity check */ + if (*sfp >= 1000) + { + *sp += 1; + *sfp -= 1000; + } +} + +/* Print the time defined by a clock_t (returned by the `times' and `time' + system calls) in a standard way to stdio stream FP. This is scaled in + terms of the value of CLK_TCK, which is what is returned by the + `times' call. */ +void +print_clock_t (fp, t) + FILE *fp; + clock_t t; +{ + time_t timestamp; + long minutes; + int seconds, seconds_fraction; + + clock_t_to_secs (t, ×tamp, &seconds_fraction); + + minutes = timestamp / 60; + seconds = timestamp % 60; + + fprintf (fp, "%ldm%d.%03ds", minutes, seconds, seconds_fraction); +} +#endif /* HAVE_TIMES */ diff --git a/lib/sh/dprintf.c b/lib/sh/dprintf.c new file mode 100644 index 0000000..b3b5d64 --- /dev/null +++ b/lib/sh/dprintf.c @@ -0,0 +1,70 @@ +/* dprintf -- printf to a file descriptor */ + +/* Copyright (C) 2008-2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (PREFER_STDARG) +# include +#else +# include +#endif + +#include + +int +#if defined (PREFER_STDARG) +dprintf(int fd, const char *format, ...) +#else +dprintf(fd, format, va_alist) + int fd; + const char *format; + va_dcl +#endif +{ + FILE *fp; + int fd2, rc, r2; + va_list args; + + if ((fd2 = dup(fd)) < 0) + return -1; + fp = fdopen (fd2, "w"); + if (fp == 0) + { + close (fd2); + return -1; + } + + SH_VA_START (args, format); + rc = vfprintf (fp, format, args); + fflush (fp); + va_end (args); + + r2 = fclose (fp); /* check here */ + + return rc; +} diff --git a/lib/sh/eaccess.c b/lib/sh/eaccess.c new file mode 100644 index 0000000..8132a9a --- /dev/null +++ b/lib/sh/eaccess.c @@ -0,0 +1,242 @@ +/* eaccess.c - eaccess replacement for the shell, plus other access functions. */ + +/* Copyright (C) 2006-2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include + +#include "bashtypes.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" + +#include +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +#if !defined (_POSIX_VERSION) && defined (HAVE_SYS_FILE_H) +# include +#endif /* !_POSIX_VERSION */ +#include "posixstat.h" +#include "filecntl.h" + +#include "shell.h" + +#if !defined (R_OK) +#define R_OK 4 +#define W_OK 2 +#define X_OK 1 +#define F_OK 0 +#endif /* R_OK */ + +static int path_is_devfd __P((const char *)); +static int sh_stataccess __P((char *, int)); +#if HAVE_DECL_SETREGID +static int sh_euidaccess __P((char *, int)); +#endif + +static int +path_is_devfd (path) + const char *path; +{ + if (path[0] == '/' && path[1] == 'd' && strncmp (path, "/dev/fd/", 8) == 0) + return 1; + else if (STREQN (path, "/dev/std", 8)) + { + if (STREQ (path+8, "in") || STREQ (path+8, "out") || STREQ (path+8, "err")) + return 1; + else + return 0; + } + else + return 0; +} + +/* A wrapper for stat () which disallows pathnames that are empty strings + and handles /dev/fd emulation on systems that don't have it. */ +int +sh_stat (path, finfo) + const char *path; + struct stat *finfo; +{ + static char *pbuf = 0; + + if (*path == '\0') + { + errno = ENOENT; + return (-1); + } + if (path[0] == '/' && path[1] == 'd' && strncmp (path, "/dev/fd/", 8) == 0) + { +#if !defined (HAVE_DEV_FD) + intmax_t fd; + int r; + + if (legal_number (path + 8, &fd) && fd == (int)fd) + { + r = fstat ((int)fd, finfo); + if (r == 0 || errno != EBADF) + return (r); + } + errno = ENOENT; + return (-1); +#else + /* If HAVE_DEV_FD is defined, DEV_FD_PREFIX is defined also, and has a + trailing slash. Make sure /dev/fd/xx really uses DEV_FD_PREFIX/xx. + On most systems, with the notable exception of linux, this is + effectively a no-op. */ + pbuf = xrealloc (pbuf, sizeof (DEV_FD_PREFIX) + strlen (path + 8)); + strcpy (pbuf, DEV_FD_PREFIX); + strcat (pbuf, path + 8); + return (stat (pbuf, finfo)); +#endif /* !HAVE_DEV_FD */ + } +#if !defined (HAVE_DEV_STDIN) + else if (STREQN (path, "/dev/std", 8)) + { + if (STREQ (path+8, "in")) + return (fstat (0, finfo)); + else if (STREQ (path+8, "out")) + return (fstat (1, finfo)); + else if (STREQ (path+8, "err")) + return (fstat (2, finfo)); + else + return (stat (path, finfo)); + } +#endif /* !HAVE_DEV_STDIN */ + return (stat (path, finfo)); +} + +/* Do the same thing access(2) does, but use the effective uid and gid, + and don't make the mistake of telling root that any file is + executable. This version uses stat(2). */ +static int +sh_stataccess (path, mode) + char *path; + int mode; +{ + struct stat st; + + if (sh_stat (path, &st) < 0) + return (-1); + + if (current_user.euid == 0) + { + /* Root can read or write any file. */ + if ((mode & X_OK) == 0) + return (0); + + /* Root can execute any file that has any one of the execute + bits set. */ + if (st.st_mode & S_IXUGO) + return (0); + } + + if (st.st_uid == current_user.euid) /* owner */ + mode <<= 6; + else if (group_member (st.st_gid)) + mode <<= 3; + + if (st.st_mode & mode) + return (0); + + errno = EACCES; + return (-1); +} + +#if HAVE_DECL_SETREGID +/* Version to call when uid != euid or gid != egid. We temporarily swap + the effective and real uid and gid as appropriate. */ +static int +sh_euidaccess (path, mode) + char *path; + int mode; +{ + int r, e; + + if (current_user.uid != current_user.euid) + setreuid (current_user.euid, current_user.uid); + if (current_user.gid != current_user.egid) + setregid (current_user.egid, current_user.gid); + + r = access (path, mode); + e = errno; + + if (current_user.uid != current_user.euid) + setreuid (current_user.uid, current_user.euid); + if (current_user.gid != current_user.egid) + setregid (current_user.gid, current_user.egid); + + errno = e; + return r; +} +#endif + +int +sh_eaccess (path, mode) + char *path; + int mode; +{ + int ret; + + if (path_is_devfd (path)) + return (sh_stataccess (path, mode)); + +#if (defined (HAVE_FACCESSAT) && defined (AT_EACCESS)) || defined (HAVE_EACCESS) +# if defined (HAVE_FACCESSAT) && defined (AT_EACCESS) + ret = faccessat (AT_FDCWD, path, mode, AT_EACCESS); +# else /* HAVE_EACCESS */ /* FreeBSD */ + ret = eaccess (path, mode); /* XXX -- not always correct for X_OK */ +# endif /* HAVE_EACCESS */ +# if defined (__FreeBSD__) || defined (SOLARIS) + if (ret == 0 && current_user.euid == 0 && mode == X_OK) + return (sh_stataccess (path, mode)); +# endif /* __FreeBSD__ || SOLARIS */ + return ret; +#elif defined (EFF_ONLY_OK) /* SVR4(?), SVR4.2 */ + return access (path, mode|EFF_ONLY_OK); +#else + if (mode == F_OK) + return (sh_stataccess (path, mode)); + +# if HAVE_DECL_SETREGID + if (current_user.uid != current_user.euid || current_user.gid != current_user.egid) + return (sh_euidaccess (path, mode)); +# endif + + if (current_user.uid == current_user.euid && current_user.gid == current_user.egid) + { + ret = access (path, mode); +#if defined (__FreeBSD__) || defined (SOLARIS) + if (ret == 0 && current_user.euid == 0 && mode == X_OK) + return (sh_stataccess (path, mode)); +#endif + return ret; + } + + return (sh_stataccess (path, mode)); +#endif +} diff --git a/lib/sh/fmtullong.c b/lib/sh/fmtullong.c new file mode 100644 index 0000000..97a1dc1 --- /dev/null +++ b/lib/sh/fmtullong.c @@ -0,0 +1,31 @@ +/* fmtullong.c - convert `long long int' to string */ + +/* Copyright (C) 2001-2002 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#ifdef HAVE_LONG_LONG + +#define LONG long long +#define UNSIGNED_LONG unsigned long long +#define fmtulong fmtullong + +#include "fmtulong.c" + +#endif diff --git a/lib/sh/fmtulong.c b/lib/sh/fmtulong.c new file mode 100644 index 0000000..0ccc22b --- /dev/null +++ b/lib/sh/fmtulong.c @@ -0,0 +1,191 @@ +/* fmtulong.c -- Convert unsigned long int to string. */ + +/* Copyright (C) 1998-2011 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (HAVE_LIMITS_H) +# include +#endif + +#include +#ifdef HAVE_STDDEF_H +# include +#endif + +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#include +#include + +#include + +#include "stdc.h" + +#include + +#ifndef errno +extern int errno; +#endif + +#define x_digs "0123456789abcdef" +#define X_digs "0123456789ABCDEF" + +/* XXX -- assumes uppercase letters, lowercase letters, and digits are + contiguous */ +#define FMTCHAR(x) \ + ((x) < 10) ? (x) + '0' \ + : (((x) < 36) ? (x) - 10 + 'a' \ + : (((x) < 62) ? (x) - 36 + 'A' \ + : (((x) == 62) ? '@' : '_'))) + +#ifndef FL_PREFIX +# define FL_PREFIX 0x01 /* add 0x, 0X, or 0 prefix as appropriate */ +# define FL_ADDBASE 0x02 /* add base# prefix to converted value */ +# define FL_HEXUPPER 0x04 /* use uppercase when converting to hex */ +# define FL_UNSIGNED 0x08 /* don't add any sign */ +#endif + +#ifndef LONG +# define LONG long +# define UNSIGNED_LONG unsigned long +#endif + +/* `unsigned long' (or unsigned long long) to string conversion for a given + base. The caller passes the output buffer and the size. This should + check for buffer underflow, but currently does not. */ +char * +fmtulong (ui, base, buf, len, flags) + UNSIGNED_LONG ui; + int base; + char *buf; + size_t len; + int flags; +{ + char *p; + int sign; + LONG si; + + if (base == 0) + base = 10; + + if (base < 2 || base > 64) + { +#if 1 + /* XXX - truncation possible with long translation */ + strncpy (buf, _("invalid base"), len - 1); + buf[len-1] = '\0'; + errno = EINVAL; + return (p = buf); +#else + base = 10; +#endif + } + + sign = 0; + if ((flags & FL_UNSIGNED) == 0 && (LONG)ui < 0) + { + ui = -ui; + sign = '-'; + } + + p = buf + len - 2; + p[1] = '\0'; + + /* handle common cases explicitly */ + switch (base) + { + case 10: + if (ui < 10) + { + *p-- = TOCHAR (ui); + break; + } + /* Favor signed arithmetic over unsigned arithmetic; it is faster on + many machines. */ + if ((LONG)ui < 0) + { + *p-- = TOCHAR (ui % 10); + si = ui / 10; + } + else + si = ui; + do + *p-- = TOCHAR (si % 10); + while (si /= 10); + break; + + case 8: + do + *p-- = TOCHAR (ui & 7); + while (ui >>= 3); + break; + + case 16: + do + *p-- = (flags & FL_HEXUPPER) ? X_digs[ui & 15] : x_digs[ui & 15]; + while (ui >>= 4); + break; + + case 2: + do + *p-- = TOCHAR (ui & 1); + while (ui >>= 1); + break; + + default: + do + *p-- = FMTCHAR (ui % base); + while (ui /= base); + break; + } + + if ((flags & FL_PREFIX) && (base == 8 || base == 16)) + { + if (base == 16) + { + *p-- = (flags & FL_HEXUPPER) ? 'X' : 'x'; + *p-- = '0'; + } + else if (p[1] != '0') + *p-- = '0'; + } + else if ((flags & FL_ADDBASE) && base != 10) + { + *p-- = '#'; + *p-- = TOCHAR (base % 10); + if (base > 10) + *p-- = TOCHAR (base / 10); + } + + if (sign) + *p-- = '-'; + + return (p + 1); +} diff --git a/lib/sh/fmtumax.c b/lib/sh/fmtumax.c new file mode 100644 index 0000000..f2786b5 --- /dev/null +++ b/lib/sh/fmtumax.c @@ -0,0 +1,27 @@ +/* fmtumax.c -- Convert uintmax_t to string. */ + +/* Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#define LONG intmax_t +#define UNSIGNED_LONG uintmax_t +#define fmtulong fmtumax + +#include "fmtulong.c" diff --git a/lib/sh/fnxform.c b/lib/sh/fnxform.c new file mode 100644 index 0000000..d7e1b5a --- /dev/null +++ b/lib/sh/fnxform.c @@ -0,0 +1,199 @@ +/* fnxform - use iconv(3) to transform strings to and from "filename" format */ + +/* Copyright (C) 2009-2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include +#if defined (HAVE_UNISTD_H) +# include +#endif +#include "bashansi.h" +#include +#include "bashtypes.h" + +#include "stdc.h" +#include "bashintl.h" +#include + +#if defined (HAVE_ICONV) +# include +#endif + +#if defined (HAVE_LOCALE_CHARSET) +extern const char *locale_charset __P((void)); +#else +extern char *get_locale_var __P((char *)); +#endif + +#if defined (HAVE_ICONV) +static iconv_t conv_fromfs = (iconv_t)-1; +static iconv_t conv_tofs = (iconv_t)-1; + +#define OUTLEN_MAX 4096 + +static char *outbuf = 0; +static size_t outlen = 0; + +static char *curencoding __P((void)); +static void init_tofs __P((void)); +static void init_fromfs __P((void)); + +static char * +curencoding () +{ + char *loc; +#if defined (HAVE_LOCALE_CHARSET) + loc = (char *)locale_charset (); + return loc; +#else + char *dot, *mod; + + loc = get_locale_var ("LC_CTYPE"); + if (loc == 0 || *loc == 0) + return ""; + dot = strchr (loc, '.'); + if (dot == 0) + return loc; + mod = strchr (dot, '@'); + if (mod) + *mod = '\0'; + return ++dot; +#endif +} + +static void +init_tofs () +{ + char *cur; + + cur = curencoding (); + conv_tofs = iconv_open ("UTF-8-MAC", cur); +} + +static void +init_fromfs () +{ + char *cur; + + cur = curencoding (); + conv_fromfs = iconv_open (cur, "UTF-8-MAC"); +} + +char * +fnx_tofs (string, len) + char *string; + size_t len; +{ +#ifdef MACOSX + ICONV_CONST char *inbuf; + char *tempbuf; + size_t templen; + + if (conv_tofs == (iconv_t)-1) + init_tofs (); + if (conv_tofs == (iconv_t)-1) + return string; + + /* Free and reallocate outbuf if it's *too* big */ + if (outlen >= OUTLEN_MAX && len < OUTLEN_MAX - 8) + { + free (outbuf); + outbuf = 0; + outlen = 0; + } + + inbuf = string; + if (outbuf == 0 || outlen < len + 8) + { + outlen = len + 8; + outbuf = outbuf ? xrealloc (outbuf, outlen + 1) : xmalloc (outlen + 1); + } + tempbuf = outbuf; + templen = outlen; + + iconv (conv_tofs, NULL, NULL, NULL, NULL); + + if (iconv (conv_tofs, &inbuf, &len, &tempbuf, &templen) == (size_t)-1) + return string; + + *tempbuf = '\0'; + return outbuf; +#else + return string; +#endif +} + +char * +fnx_fromfs (string, len) + char *string; + size_t len; +{ +#ifdef MACOSX + ICONV_CONST char *inbuf; + char *tempbuf; + size_t templen; + + if (conv_fromfs == (iconv_t)-1) + init_fromfs (); + if (conv_fromfs == (iconv_t)-1) + return string; + + /* Free and reallocate outbuf if it's *too* big */ + if (outlen >= OUTLEN_MAX && len < OUTLEN_MAX - 8) + { + free (outbuf); + outbuf = 0; + outlen = 0; + } + + inbuf = string; + if (outbuf == 0 || outlen < (len + 8)) + { + outlen = len + 8; + outbuf = outbuf ? xrealloc (outbuf, outlen + 1) : xmalloc (outlen + 1); + } + tempbuf = outbuf; + templen = outlen; + + iconv (conv_fromfs, NULL, NULL, NULL, NULL); + + if (iconv (conv_fromfs, &inbuf, &len, &tempbuf, &templen) == (size_t)-1) + return string; + + *tempbuf = '\0'; + return outbuf; +#else + return string; +#endif +} + +#else +char * +fnx_tofs (string) + char *string; +{ + return string; +} + +char * +fnx_fromfs (string) + char *string; +{ + return string; +} +#endif diff --git a/lib/sh/fpurge.c b/lib/sh/fpurge.c new file mode 100644 index 0000000..13e8c78 --- /dev/null +++ b/lib/sh/fpurge.c @@ -0,0 +1,232 @@ +/* fpurge - Flushing buffers of a FILE stream. */ + +/* Copyright (C) 2007-2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include "stdc.h" + +#include + +/* Specification. Same as in ../../externs.h. */ +#define NEED_FPURGE_DECL +#if HAVE_FPURGE +# define fpurge _bash_fpurge +#endif +extern int fpurge __P((FILE *stream)); + +#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7 */ +# include +#endif +#include + +/* Inline contents of gnulib:stdio-impl.h */ + +/* Many stdio implementations have the same logic and therefore can share + the same implementation of stdio extension API, except that some fields + have different naming conventions, or their access requires some casts. */ + +/* BSD stdio derived implementations. */ + +#if defined __NetBSD__ /* NetBSD */ +/* Get __NetBSD_Version__. */ +# include +#endif + +#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + +# if defined __DragonFly__ /* DragonFly */ + /* See . */ +# define fp_ ((struct { struct __FILE_public pub; \ + struct { unsigned char *_base; int _size; } _bf; \ + void *cookie; \ + void *_close; \ + void *_read; \ + void *_seek; \ + void *_write; \ + struct { unsigned char *_base; int _size; } _ub; \ + int _ur; \ + unsigned char _ubuf[3]; \ + unsigned char _nbuf[1]; \ + struct { unsigned char *_base; int _size; } _lb; \ + int _blksize; \ + fpos_t _offset; \ + /* More fields, not relevant here. */ \ + } *) fp) + /* See . */ +# define _p pub._p +# define _flags pub._flags +# define _r pub._r +# define _w pub._w +# else +# define fp_ fp +# endif + +# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ /* NetBSD >= 1.5ZA, OpenBSD */ + /* See + and */ + struct __sfileext + { + struct __sbuf _ub; /* ungetc buffer */ + /* More fields, not relevant here. */ + }; +# define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub +# else /* FreeBSD, NetBSD <= 1.5Z, DragonFly, MacOS X, Cygwin */ +# define fp_ub fp_->_ub +# endif + +# define HASUB(fp) (fp_ub._base != NULL) + +#endif + +/* SystemV derived implementations. */ + +#if defined _IOERR + +# if defined __sun && defined _LP64 /* Solaris/{SPARC,AMD64} 64-bit */ +# define fp_ ((struct { unsigned char *_ptr; \ + unsigned char *_base; \ + unsigned char *_end; \ + long _cnt; \ + int _file; \ + unsigned int _flag; \ + } *) fp) +# else +# define fp_ fp +# endif + +# if defined _SCO_DS /* OpenServer */ +# define _cnt __cnt +# define _ptr __ptr +# define _base __base +# define _flag __flag +# endif + +#endif + +int +fpurge (FILE *fp) +{ +#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7 */ + + __fpurge (fp); + /* The __fpurge function does not have a return value. */ + return 0; + +#elif HAVE_FPURGE /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin 1.7 */ + + /* Call the system's fpurge function. */ +# undef fpurge +# if !HAVE_DECL_FPURGE + extern int fpurge (FILE *); +# endif + int result = fpurge (fp); +# if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + if (result == 0) + /* Correct the invariants that fpurge broke. + on BSD systems says: + "The following always hold: if _flags & __SRD, _w is 0." + If this invariant is not fulfilled and the stream is read-write but + currently reading, subsequent putc or fputc calls will write directly + into the buffer, although they shouldn't be allowed to. */ + if ((fp_->_flags & __SRD) != 0) + fp_->_w = 0; +# endif + return result; + +#else + + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_IO_read_end = fp->_IO_read_ptr; + fp->_IO_write_ptr = fp->_IO_write_base; + /* Avoid memory leak when there is an active ungetc buffer. */ + if (fp->_IO_save_base != NULL) + { + free (fp->_IO_save_base); + fp->_IO_save_base = NULL; + } + return 0; +# elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + fp_->_p = fp_->_bf._base; + fp_->_r = 0; + fp_->_w = ((fp_->_flags & (__SLBF | __SNBF | __SRD)) == 0 /* fully buffered and not currently reading? */ + ? fp_->_bf._size + : 0); + /* Avoid memory leak when there is an active ungetc buffer. */ + if (fp_ub._base != NULL) + { + if (fp_ub._base != fp_->_ubuf) + free (fp_ub._base); + fp_ub._base = NULL; + } + return 0; +# elif defined __EMX__ /* emx+gcc */ + fp->_ptr = fp->_buffer; + fp->_rcount = 0; + fp->_wcount = 0; + fp->_ungetc_count = 0; + return 0; +# elif defined _IOERR || defined __TANDEM /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */ + fp->_ptr = fp->_base; + if (fp->_ptr != NULL) + fp->_cnt = 0; + return 0; +# elif defined __UCLIBC__ /* uClibc */ +# ifdef __STDIO_BUFFERS + if (fp->__modeflags & __FLAG_WRITING) + fp->__bufpos = fp->__bufstart; + else if (fp->__modeflags & (__FLAG_READONLY | __FLAG_READING)) + fp->__bufpos = fp->__bufread; +# endif + return 0; +# elif defined __QNX__ /* QNX */ + fp->_Rback = fp->_Back + sizeof (fp->_Back); + fp->_Rsave = NULL; + if (fp->_Mode & 0x2000 /* _MWRITE */) + /* fp->_Buf <= fp->_Next <= fp->_Wend */ + fp->_Next = fp->_Buf; + else + /* fp->_Buf <= fp->_Next <= fp->_Rend */ + fp->_Rend = fp->_Next; + return 0; +# elif defined __MINT__ /* Atari FreeMiNT */ + if (fp->__pushed_back) + { + fp->__bufp = fp->__pushback_bufp; + fp->__pushed_back = 0; + } + /* Preserve the current file position. */ + if (fp->__target != -1) + fp->__target += fp->__bufp - fp->__buffer; + fp->__bufp = fp->__buffer; + /* Nothing in the buffer, next getc is nontrivial. */ + fp->__get_limit = fp->__bufp; + /* Nothing in the buffer, next putc is nontrivial. */ + fp->__put_limit = fp->__buffer; + return 0; +# else +# warning "Please port gnulib fpurge.c to your platform! Look at the definitions of fflush, setvbuf and ungetc on your system, then report this to bug-gnulib." + return 0; +# endif + +#endif +} diff --git a/lib/sh/getcwd.c b/lib/sh/getcwd.c new file mode 100644 index 0000000..d7bd241 --- /dev/null +++ b/lib/sh/getcwd.c @@ -0,0 +1,356 @@ +/* getcwd.c -- get pathname of current directory */ + +/* Copyright (C) 1991 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if !defined (HAVE_GETCWD) + +#if !defined (__GNUC__) && !defined (HAVE_ALLOCA_H) && defined (_AIX) + #pragma alloca +#endif /* _AIX && RISC6000 && !__GNUC__ */ + +#if defined (__QNX__) +# undef HAVE_LSTAT +#endif + +#include +#include + +#if defined (HAVE_LIMITS_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include +#include +#include + +#include + +#if !defined (D_FILENO_AVAILABLE) +# include "command.h" +# include "general.h" +# include "externs.h" +#endif + +#include + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +#if !defined (HAVE_LSTAT) +# define lstat stat +#endif + +#if !defined (NULL) +# define NULL 0 +#endif + +/* If the d_fileno member of a struct dirent doesn't return anything useful, + we need to check inode number equivalence the hard way. Return 1 if + the inode corresponding to PATH/DIR is identical to THISINO. */ +#if !defined (D_FILENO_AVAILABLE) +static int +_path_checkino (dotp, name, thisino) + char *dotp; + char *name; + ino_t thisino; +{ + char *fullpath; + int r, e; + struct stat st; + + e = errno; + fullpath = sh_makepath (dotp, name, MP_RMDOT); + if (stat (fullpath, &st) < 0) + { + errno = e; + return 0; + } + free (fullpath); + errno = e; + return (st.st_ino == thisino); +} +#endif + +/* Get the pathname of the current working directory, + and put it in SIZE bytes of BUF. Returns NULL if the + directory couldn't be determined or SIZE was too small. + If successful, returns BUF. In GNU, if BUF is NULL, + an array is allocated with `malloc'; the array is SIZE + bytes long, unless SIZE <= 0, in which case it is as + big as necessary. */ +#if defined (__STDC__) +char * +getcwd (char *buf, size_t size) +#else /* !__STDC__ */ +char * +getcwd (buf, size) + char *buf; + size_t size; +#endif /* !__STDC__ */ +{ + static const char dots[] + = "../../../../../../../../../../../../../../../../../../../../../../../\ +../../../../../../../../../../../../../../../../../../../../../../../../../../\ +../../../../../../../../../../../../../../../../../../../../../../../../../.."; + const char *dotp, *dotlist; + size_t dotsize; + dev_t rootdev, thisdev; + ino_t rootino, thisino; + char path[PATH_MAX + 1]; + register char *pathp; + char *pathbuf; + size_t pathsize; + struct stat st; + int saved_errno; + + if (buf != NULL && size == 0) + { + errno = EINVAL; + return ((char *)NULL); + } + + pathsize = sizeof (path); + pathp = &path[pathsize]; + *--pathp = '\0'; + pathbuf = path; + + if (stat (".", &st) < 0) + return ((char *)NULL); + thisdev = st.st_dev; + thisino = st.st_ino; + + if (stat ("/", &st) < 0) + return ((char *)NULL); + rootdev = st.st_dev; + rootino = st.st_ino; + + saved_errno = 0; + + dotsize = sizeof (dots) - 1; + dotp = &dots[sizeof (dots)]; + dotlist = dots; + while (!(thisdev == rootdev && thisino == rootino)) + { + register DIR *dirstream; + register struct dirent *d; + dev_t dotdev; + ino_t dotino; + char mount_point; + int namlen; + + /* Look at the parent directory. */ + if (dotp == dotlist) + { + /* My, what a deep directory tree you have, Grandma. */ + char *new; + if (dotlist == dots) + { + new = (char *)malloc (dotsize * 2 + 1); + if (new == NULL) + goto lose; + memcpy (new, dots, dotsize); + } + else + { + new = (char *)realloc ((PTR_T) dotlist, dotsize * 2 + 1); + if (new == NULL) + goto lose; + } + memcpy (&new[dotsize], new, dotsize); + dotp = &new[dotsize]; + dotsize *= 2; + new[dotsize] = '\0'; + dotlist = new; + } + + dotp -= 3; + + /* Figure out if this directory is a mount point. */ + if (stat (dotp, &st) < 0) + goto lose; + dotdev = st.st_dev; + dotino = st.st_ino; + mount_point = dotdev != thisdev; + + /* Search for the last directory. */ + dirstream = opendir (dotp); + if (dirstream == NULL) + goto lose; + while ((d = readdir (dirstream)) != NULL) + { + if (d->d_name[0] == '.' && + (d->d_name[1] == '\0' || + (d->d_name[1] == '.' && d->d_name[2] == '\0'))) + continue; +#if defined (D_FILENO_AVAILABLE) + if (mount_point || d->d_fileno == thisino) +#else + if (mount_point || _path_checkino (dotp, d->d_name, thisino)) +#endif + { + char *name; + + namlen = D_NAMLEN(d); + name = (char *) + alloca (dotlist + dotsize - dotp + 1 + namlen + 1); + memcpy (name, dotp, dotlist + dotsize - dotp); + name[dotlist + dotsize - dotp] = '/'; + memcpy (&name[dotlist + dotsize - dotp + 1], + d->d_name, namlen + 1); + if (lstat (name, &st) < 0) + { +#if 0 + int save = errno; + (void) closedir (dirstream); + errno = save; + goto lose; +#else + saved_errno = errno; +#endif + } + if (st.st_dev == thisdev && st.st_ino == thisino) + break; + } + } + if (d == NULL) + { +#if 0 + int save = errno; +#else + int save = errno ? errno : saved_errno; +#endif + (void) closedir (dirstream); + errno = save; + goto lose; + } + else + { + size_t space; + + while ((space = pathp - pathbuf) <= namlen) + { + char *new; + + if (pathbuf == path) + { + new = (char *)malloc (pathsize * 2); + if (!new) + goto lose; + } + else + { + new = (char *)realloc ((PTR_T) pathbuf, (pathsize * 2)); + if (!new) + goto lose; + pathp = new + space; + } + (void) memcpy (new + pathsize + space, pathp, pathsize - space); + pathp = new + pathsize + space; + pathbuf = new; + pathsize *= 2; + } + + pathp -= namlen; + (void) memcpy (pathp, d->d_name, namlen); + *--pathp = '/'; + (void) closedir (dirstream); + } + + thisdev = dotdev; + thisino = dotino; + } + + if (pathp == &path[sizeof(path) - 1]) + *--pathp = '/'; + + if (dotlist != dots) + free ((PTR_T) dotlist); + + { + size_t len = pathbuf + pathsize - pathp; + if (buf == NULL && size <= 0) + size = len; + + if ((size_t) size < len) + { + errno = ERANGE; + goto lose2; + } + if (buf == NULL) + { + buf = (char *) malloc (size); + if (buf == NULL) + goto lose2; + } + + (void) memcpy((PTR_T) buf, (PTR_T) pathp, len); + } + + if (pathbuf != path) + free (pathbuf); + + return (buf); + + lose: + if ((dotlist != dots) && dotlist) + { + int e = errno; + free ((PTR_T) dotlist); + errno = e; + } + + lose2: + if ((pathbuf != path) && pathbuf) + { + int e = errno; + free ((PTR_T) pathbuf); + errno = e; + } + return ((char *)NULL); +} + +#if defined (TEST) +# include +main (argc, argv) + int argc; + char **argv; +{ + char b[PATH_MAX]; + + if (getcwd(b, sizeof(b))) + { + printf ("%s\n", b); + exit (0); + } + else + { + perror ("cwd: getcwd"); + exit (1); + } +} +#endif /* TEST */ +#endif /* !HAVE_GETCWD */ diff --git a/lib/sh/getenv.c b/lib/sh/getenv.c new file mode 100644 index 0000000..8b5e340 --- /dev/null +++ b/lib/sh/getenv.c @@ -0,0 +1,233 @@ +/* getenv.c - get environment variable value from the shell's variable + list. */ + +/* Copyright (C) 1997-2002 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (CAN_REDEFINE_GETENV) + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include +#include + +#ifndef errno +extern int errno; +#endif + +extern char **environ; + +/* We supply our own version of getenv () because we want library + routines to get the changed values of exported variables. */ + +/* The NeXT C library has getenv () defined and used in the same file. + This screws our scheme. However, Bash will run on the NeXT using + the C library getenv (), since right now the only environment variable + that we care about is HOME, and that is already defined. */ +static char *last_tempenv_value = (char *)NULL; + +char * +getenv (name) + const char *name; +{ + SHELL_VAR *var; + + if (name == 0 || *name == '\0') + return ((char *)NULL); + + var = find_tempenv_variable ((char *)name); + if (var) + { + FREE (last_tempenv_value); + + last_tempenv_value = value_cell (var) ? savestring (value_cell (var)) : (char *)NULL; + return (last_tempenv_value); + } + else if (shell_variables) + { + var = find_variable ((char *)name); + if (var && exported_p (var)) + return (value_cell (var)); + } + else + { + register int i, len; + + /* In some cases, s5r3 invokes getenv() before main(); BSD systems + using gprof also exhibit this behavior. This means that + shell_variables will be 0 when this is invoked. We look up the + variable in the real environment in that case. */ + + for (i = 0, len = strlen (name); environ[i]; i++) + { + if ((STREQN (environ[i], name, len)) && (environ[i][len] == '=')) + return (environ[i] + len + 1); + } + } + + return ((char *)NULL); +} + +/* Some versions of Unix use _getenv instead. */ +char * +_getenv (name) + const char *name; +{ + return (getenv (name)); +} + +/* SUSv3 says argument is a `char *'; BSD implementations disagree */ +int +putenv (str) +#ifndef HAVE_STD_PUTENV + const char *str; +#else + char *str; +#endif +{ + SHELL_VAR *var; + char *name, *value; + int offset; + + if (str == 0 || *str == '\0') + { + errno = EINVAL; + return -1; + } + + offset = assignment (str, 0); + if (str[offset] != '=') + { + errno = EINVAL; + return -1; + } + name = savestring (str); + name[offset] = 0; + + value = name + offset + 1; + + /* XXX - should we worry about readonly here? */ + var = bind_variable (name, value, 0); + if (var == 0) + { + errno = EINVAL; + return -1; + } + + VUNSETATTR (var, att_invisible); + VSETATTR (var, att_exported); + + return 0; +} + +#if 0 +int +_putenv (name) +#ifndef HAVE_STD_PUTENV + const char *name; +#else + char *name; +#endif +{ + return putenv (name); +} +#endif + +int +setenv (name, value, rewrite) + const char *name; + const char *value; + int rewrite; +{ + SHELL_VAR *var; + char *v; + + if (name == 0 || *name == '\0' || strchr (name, '=') != 0) + { + errno = EINVAL; + return -1; + } + + var = 0; + v = (char *)value; /* some compilers need explicit cast */ + /* XXX - should we worry about readonly here? */ + if (rewrite == 0) + var = find_variable (name); + + if (var == 0) + var = bind_variable (name, v, 0); + + if (var == 0) + return -1; + + VUNSETATTR (var, att_invisible); + VSETATTR (var, att_exported); + + return 0; +} + +#if 0 +int +_setenv (name, value, rewrite) + const char *name; + const char *value; + int rewrite; +{ + return setenv (name, value, rewrite); +} +#endif + +/* SUSv3 says unsetenv returns int; existing implementations (BSD) disagree. */ + +#ifdef HAVE_STD_UNSETENV +#define UNSETENV_RETURN(N) return(N) +#define UNSETENV_RETTYPE int +#else +#define UNSETENV_RETURN(N) return +#define UNSETENV_RETTYPE void +#endif + +UNSETENV_RETTYPE +unsetenv (name) + const char *name; +{ + if (name == 0 || *name == '\0' || strchr (name, '=') != 0) + { + errno = EINVAL; + UNSETENV_RETURN(-1); + } + + /* XXX - should we just remove the export attribute here? */ +#if 1 + unbind_variable (name); +#else + SHELL_VAR *v; + + v = find_variable (name); + if (v) + VUNSETATTR (v, att_exported); +#endif + + UNSETENV_RETURN(0); +} +#endif /* CAN_REDEFINE_GETENV */ diff --git a/lib/sh/inet_aton.c b/lib/sh/inet_aton.c new file mode 100644 index 0000000..e377178 --- /dev/null +++ b/lib/sh/inet_aton.c @@ -0,0 +1,214 @@ +/* inet_aton - convert string to numeric IP address */ + +/* Snagged from GNU C library, version 2.0.3. */ + +/* + * ++Copyright++ 1983, 1990, 1993 + * - + * Copyright (c) 1983, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * - + * Portions Copyright (c) 1993 by Digital Equipment Corporation. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies, and that + * the name of Digital Equipment Corporation not be used in advertising or + * publicity pertaining to distribution of the document or software without + * specific, written prior permission. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT + * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * - + * --Copyright-- + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93"; +static char rcsid[] = "$Id: inet_addr.c,v 1.5 1996/08/14 03:48:37 drepper Exp $"; +#endif /* LIBC_SCCS and not lint */ + +#include + +#if !defined (HAVE_INET_ATON) && defined (HAVE_NETWORK) && defined (HAVE_NETINET_IN_H) && defined (HAVE_ARPA_INET_H) + +#include +#if defined (HAVE_SYS_PARAM_H) +#include +#endif +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#include +#include +#include + +#ifndef INADDR_NONE +# define INADDR_NONE 0xffffffff +#endif + +/* these are compatibility routines, not needed on recent BSD releases */ + +#if 0 +/* Not used, not needed. */ +/* + * Ascii internet address interpretation routine. + * The value returned is in network order. + */ +u_long +inet_addr(cp) + register const char *cp; +{ + struct in_addr val; + + if (inet_aton(cp, &val)) + return (val.s_addr); + return (INADDR_NONE); +} +#endif + +/* + * Check whether "cp" is a valid ascii representation + * of an Internet address and convert to a binary address. + * Returns 1 if the address is valid, 0 if not. + * This replaces inet_addr, the return value from which + * cannot distinguish between failure and a local broadcast address. + */ +int +inet_aton(cp, addr) + register const char *cp; + struct in_addr *addr; +{ + register u_bits32_t val; + register int base, n; + register unsigned char c; + u_int parts[4]; + register u_int *pp = parts; + + c = *cp; + for (;;) { + /* + * Collect number up to ``.''. + * Values are specified as for C: + * 0x=hex, 0=octal, isdigit=decimal. + */ +#if 0 + if (!isdigit(c)) +#else + if (c != '0' && c != '1' && c != '2' && c != '3' && c != '4' && + c != '5' && c != '6' && c != '7' && c != '8' && c != '9') +#endif + return (0); + val = 0; base = 10; + if (c == '0') { + c = *++cp; + if (c == 'x' || c == 'X') + base = 16, c = *++cp; + else + base = 8; + } + for (;;) { + if (isascii(c) && isdigit(c)) { + val = (val * base) + (c - '0'); + c = *++cp; + } else if (base == 16 && isascii(c) && isxdigit(c)) { + val = (val << 4) | + (c + 10 - (islower(c) ? 'a' : 'A')); + c = *++cp; + } else + break; + } + if (c == '.') { + /* + * Internet format: + * a.b.c.d + * a.b.c (with c treated as 16 bits) + * a.b (with b treated as 24 bits) + */ + if (pp >= parts + 3) + return (0); + *pp++ = val; + c = *++cp; + } else + break; + } + /* + * Check for trailing characters. + */ + if (c != '\0' && (!isascii(c) || !isspace(c))) + return (0); + /* + * Concoct the address according to + * the number of parts specified. + */ + n = pp - parts + 1; + switch (n) { + + case 0: + return (0); /* initial nondigit */ + + case 1: /* a -- 32 bits */ + break; + + case 2: /* a.b -- 8.24 bits */ + if (val > 0xffffff) + return (0); + val |= parts[0] << 24; + break; + + case 3: /* a.b.c -- 8.8.16 bits */ + if (val > 0xffff) + return (0); + val |= (parts[0] << 24) | (parts[1] << 16); + break; + + case 4: /* a.b.c.d -- 8.8.8.8 bits */ + if (val > 0xff) + return (0); + val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); + break; + } + if (addr) + addr->s_addr = htonl(val); + return (1); +} + +#endif /* !HAVE_INET_ATON */ diff --git a/lib/sh/input_avail.c b/lib/sh/input_avail.c new file mode 100644 index 0000000..ac157a9 --- /dev/null +++ b/lib/sh/input_avail.c @@ -0,0 +1,98 @@ +/* input_avail.c -- check whether or not data is available for reading on a + specified file descriptor. */ + +/* Copyright (C) 2008,2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if defined (__TANDEM) +# include +#endif + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include +#include +#if defined (HAVE_SYS_FILE_H) +# include +#endif /* HAVE_SYS_FILE_H */ + +#if defined (HAVE_UNISTD_H) +# include +#endif /* HAVE_UNISTD_H */ + +#include "bashansi.h" + +#include "posixselect.h" + +#if defined (FIONREAD_IN_SYS_IOCTL) +# include +#endif + +#include +#include + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +#if !defined (O_NDELAY) && defined (O_NONBLOCK) +# define O_NDELAY O_NONBLOCK /* Posix style */ +#endif + +/* Return >= 1 if select/FIONREAD indicates data available for reading on + file descriptor FD; 0 if no data available. Return -1 on error. */ +int +input_avail (fd) + int fd; +{ + int result, chars_avail; +#if defined(HAVE_SELECT) + fd_set readfds, exceptfds; + struct timeval timeout; +#endif + + if (fd < 0) + return -1; + + chars_avail = 0; + +#if defined (HAVE_SELECT) + FD_ZERO (&readfds); + FD_ZERO (&exceptfds); + FD_SET (fd, &readfds); + FD_SET (fd, &exceptfds); + timeout.tv_sec = 0; + timeout.tv_usec = 0; + result = select (fd + 1, &readfds, (fd_set *)NULL, &exceptfds, &timeout); + return ((result <= 0) ? 0 : 1); + +#endif + + result = -1; +#if defined (FIONREAD) + errno = 0; + result = ioctl (fd, FIONREAD, &chars_avail); + if (result == -1 && errno == EIO) + return -1; + return (chars_avail); +#endif + + return 0; +} diff --git a/lib/sh/itos.c b/lib/sh/itos.c new file mode 100644 index 0000000..cd36ef3 --- /dev/null +++ b/lib/sh/itos.c @@ -0,0 +1,84 @@ +/* itos.c -- Convert integer to string. */ + +/* Copyright (C) 1998-2002 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include "shell.h" + +char * +inttostr (i, buf, len) + intmax_t i; + char *buf; + size_t len; +{ + return (fmtumax (i, 10, buf, len, 0)); +} + +/* Integer to string conversion. This conses the string; the + caller should free it. */ +char * +itos (i) + intmax_t i; +{ + char *p, lbuf[INT_STRLEN_BOUND(intmax_t) + 1]; + + p = fmtumax (i, 10, lbuf, sizeof(lbuf), 0); + return (savestring (p)); +} + +/* Integer to string conversion. This conses the string using strdup; + caller should free it and be prepared to deal with NULL return. */ +char * +mitos (i) + intmax_t i; +{ + char *p, lbuf[INT_STRLEN_BOUND(intmax_t) + 1]; + + p = fmtumax (i, 10, lbuf, sizeof(lbuf), 0); + return (strdup (p)); +} + +char * +uinttostr (i, buf, len) + uintmax_t i; + char *buf; + size_t len; +{ + return (fmtumax (i, 10, buf, len, FL_UNSIGNED)); +} + +/* Integer to string conversion. This conses the string; the + caller should free it. */ +char * +uitos (i) + uintmax_t i; +{ + char *p, lbuf[INT_STRLEN_BOUND(uintmax_t) + 1]; + + p = fmtumax (i, 10, lbuf, sizeof(lbuf), FL_UNSIGNED); + return (savestring (p)); +} diff --git a/lib/sh/mailstat.c b/lib/sh/mailstat.c new file mode 100644 index 0000000..79b431a --- /dev/null +++ b/lib/sh/mailstat.c @@ -0,0 +1,159 @@ +/* mailstat.c -- stat a mailbox file, handling maildir-type mail directories */ + +/* Copyright (C) 2001 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include +#include + +#include +#include +#include +#include + +#if defined (HAVE_SYS_PARAM_H) +# include +#endif + +#include + +/* + * Stat a file. If it's a maildir, check all messages + * in the maildir and present the grand total as a file. + * The fields in the 'struct stat' are from the mail directory. + * The following fields are emulated: + * + * st_nlink always 1, unless st_blocks is not present, in which case it's + * the total number of messages + * st_size total number of bytes in all files + * st_blocks total number of messages, if present in struct stat + * st_atime access time of newest file in maildir + * st_mtime modify time of newest file in maildir + * st_mode S_IFDIR changed to S_IFREG + * + * This is good enough for most mail-checking applications. + */ + +int +mailstat(path, st) + const char *path; + struct stat *st; +{ + static struct stat st_new_last, st_ret_last; + struct stat st_ret, st_tmp; + DIR *dd; + struct dirent *fn; + char dir[PATH_MAX * 2], file[PATH_MAX * 2]; + int i, l; + time_t atime, mtime; + + atime = mtime = 0; + + /* First see if it's a directory. */ + if ((i = stat(path, st)) != 0 || S_ISDIR(st->st_mode) == 0) + return i; + + if (strlen(path) > sizeof(dir) - 5) + { +#ifdef ENAMETOOLONG + errno = ENAMETOOLONG; +#else + errno = EINVAL; +#endif + return -1; + } + + st_ret = *st; + st_ret.st_nlink = 1; + st_ret.st_size = 0; +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + st_ret.st_blocks = 0; +#else + st_ret.st_nlink = 0; +#endif + st_ret.st_mode &= ~S_IFDIR; + st_ret.st_mode |= S_IFREG; + + /* See if cur/ is present */ + sprintf(dir, "%s/cur", path); + if (stat(dir, &st_tmp) || S_ISDIR(st_tmp.st_mode) == 0) + return 0; + st_ret.st_atime = st_tmp.st_atime; + + /* See if tmp/ is present */ + sprintf(dir, "%s/tmp", path); + if (stat(dir, &st_tmp) || S_ISDIR(st_tmp.st_mode) == 0) + return 0; + st_ret.st_mtime = st_tmp.st_mtime; + + /* And new/ */ + sprintf(dir, "%s/new", path); + if (stat(dir, &st_tmp) || S_ISDIR(st_tmp.st_mode) == 0) + return 0; + st_ret.st_mtime = st_tmp.st_mtime; + + /* Optimization - if new/ didn't change, nothing else did. */ + if (st_tmp.st_dev == st_new_last.st_dev && + st_tmp.st_ino == st_new_last.st_ino && + st_tmp.st_atime == st_new_last.st_atime && + st_tmp.st_mtime == st_new_last.st_mtime) + { + *st = st_ret_last; + return 0; + } + st_new_last = st_tmp; + + /* Loop over new/ and cur/ */ + for (i = 0; i < 2; i++) + { + sprintf(dir, "%s/%s", path, i ? "cur" : "new"); + sprintf(file, "%s/", dir); + l = strlen(file); + if ((dd = opendir(dir)) == NULL) + return 0; + while ((fn = readdir(dd)) != NULL) + { + if (fn->d_name[0] == '.' || strlen(fn->d_name) + l >= sizeof(file)) + continue; + strcpy(file + l, fn->d_name); + if (stat(file, &st_tmp) != 0) + continue; + st_ret.st_size += st_tmp.st_size; +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + st_ret.st_blocks++; +#else + st_ret.st_nlink++; +#endif + if (st_tmp.st_atime != st_tmp.st_mtime && st_tmp.st_atime > atime) + atime = st_tmp.st_atime; + if (st_tmp.st_mtime > mtime) + mtime = st_tmp.st_mtime; + } + closedir(dd); + } + +/* if (atime) */ /* Set atime even if cur/ is empty */ + st_ret.st_atime = atime; + if (mtime) + st_ret.st_mtime = mtime; + + *st = st_ret_last = st_ret; + return 0; +} diff --git a/lib/sh/makepath.c b/lib/sh/makepath.c new file mode 100644 index 0000000..ef01718 --- /dev/null +++ b/lib/sh/makepath.c @@ -0,0 +1,128 @@ +/* makepath.c - glue PATH and DIR together into a full pathname. */ + +/* Copyright (C) 1987, 1989, 1991 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include +#include "shell.h" + +#include + +#ifndef NULL +# define NULL 0 +#endif + +/* MAKE SURE THESE AGREE WITH ../../externs.h. */ + +#ifndef MP_DOTILDE +# define MP_DOTILDE 0x01 +# define MP_DOCWD 0x02 +# define MP_RMDOT 0x04 +# define MP_IGNDOT 0x08 +#endif + +extern char *get_working_directory __P((char *)); + +static char *nullpath = ""; + +/* Take PATH, an element from, e.g., $CDPATH, and DIR, a directory name, + and paste them together into PATH/DIR. Tilde expansion is performed on + PATH if (flags & MP_DOTILDE) is non-zero. If PATH is NULL or the empty + string, it is converted to the current directory. A full pathname is + used if (flags & MP_DOCWD) is non-zero, otherwise `./' is used. If + (flags & MP_RMDOT) is non-zero, any `./' is removed from the beginning + of DIR. If (flags & MP_IGNDOT) is non-zero, a PATH that is "." or "./" + is ignored. */ + +#define MAKEDOT() \ + do { \ + xpath = (char *)xmalloc (2); \ + xpath[0] = '.'; \ + xpath[1] = '\0'; \ + pathlen = 1; \ + } while (0) + +char * +sh_makepath (path, dir, flags) + const char *path, *dir; + int flags; +{ + int dirlen, pathlen; + char *ret, *xpath, *xdir, *r, *s; + + if (path == 0 || *path == '\0') + { + if (flags & MP_DOCWD) + { + xpath = get_working_directory ("sh_makepath"); + if (xpath == 0) + { + ret = get_string_value ("PWD"); + if (ret) + xpath = savestring (ret); + } + if (xpath == 0) + MAKEDOT(); + else + pathlen = strlen (xpath); + } + else + MAKEDOT(); + } + else if ((flags & MP_IGNDOT) && path[0] == '.' && (path[1] == '\0' || + (path[1] == '/' && path[2] == '\0'))) + { + xpath = nullpath; + pathlen = 0; + } + else + { + xpath = ((flags & MP_DOTILDE) && *path == '~') ? bash_tilde_expand (path, 0) : (char *)path; + pathlen = strlen (xpath); + } + + xdir = (char *)dir; + dirlen = strlen (xdir); + if ((flags & MP_RMDOT) && dir[0] == '.' && dir[1] == '/') + { + xdir += 2; + dirlen -= 2; + } + + r = ret = (char *)xmalloc (2 + dirlen + pathlen); + s = xpath; + while (*s) + *r++ = *s++; + if (s > xpath && s[-1] != '/') + *r++ = '/'; + s = xdir; + while (*r++ = *s++) + ; + if (xpath != path && xpath != nullpath) + free (xpath); + return (ret); +} diff --git a/lib/sh/mbscasecmp.c b/lib/sh/mbscasecmp.c new file mode 100644 index 0000000..3828164 --- /dev/null +++ b/lib/sh/mbscasecmp.c @@ -0,0 +1,78 @@ +/* mbscasecmp - case-insensitive multibyte string comparison. */ + +/* Copyright (C) 2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if !defined (HAVE_MBSCASECMP) && defined (HANDLE_MULTIBYTE) + +#include +#include +#include + +#include +#include + +/* Compare MBS1 and MBS2 without regard to case. */ +int +mbscasecmp (mbs1, mbs2) + const char *mbs1; + const char *mbs2; +{ + int len1, len2; + wchar_t c1, c2, l1, l2; + + len1 = len2 = 0; + /* Reset multibyte characters to their initial state. */ + (void) mblen ((char *) NULL, 0); + + do + { + len1 = mbtowc (&c1, mbs1, MB_CUR_MAX); + len2 = mbtowc (&c2, mbs2, MB_CUR_MAX); + + if (len1 == 0) + return len2 == 0 ? 0 : -1; + else if (len2 == 0) + return 1; + else if (len1 > 0 && len2 < 0) + return -1; + else if (len1 < 0 && len2 > 0) + return 1; + else if (len1 < 0 && len2 < 0) + { + len1 = strlen (mbs1); + len2 = strlen (mbs2); + return (len1 == len2 ? memcmp (mbs1, mbs2, len1) + : ((len1 < len2) ? (memcmp (mbs1, mbs2, len1) > 0 ? 1 : -1) + : (memcmp (mbs1, mbs2, len2) >= 0 ? 1 : -1))); + } + + l1 = towlower (c1); + l2 = towlower (c2); + + mbs1 += len1; + mbs2 += len2; + } + while (l1 == l2); + + return l1 - l2; +} + +#endif diff --git a/lib/sh/mbschr.c b/lib/sh/mbschr.c new file mode 100644 index 0000000..7730e46 --- /dev/null +++ b/lib/sh/mbschr.c @@ -0,0 +1,85 @@ +/* mbschr.c - strchr(3) that handles multibyte characters. */ + +/* Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#ifdef HAVE_STDLIB_H +# include +#endif + +#include "bashansi.h" +#include "shmbutil.h" + +extern int locale_mb_cur_max; + +#undef mbschr + +/* In some locales, the non-first byte of some multibyte characters have + the same value as some ascii character. Faced with these strings, a + legacy strchr() might return the wrong value. */ + +char * +#if defined (PROTOTYPES) +mbschr (const char *s, int c) +#else +mbschr (s, c) + const char *s; + int c; +#endif +{ +#if HANDLE_MULTIBYTE + char *pos; + mbstate_t state; + size_t strlength, mblength; + + /* The locale encodings with said weird property are BIG5, BIG5-HKSCS, + GBK, GB18030, SHIFT_JIS, and JOHAB. They exhibit the problem only + when c >= 0x30. We can therefore use the faster bytewise search if + c <= 0x30. */ + if ((unsigned char)c >= '0' && locale_mb_cur_max > 1) + { + pos = (char *)s; + memset (&state, '\0', sizeof(mbstate_t)); + strlength = strlen (s); + + while (strlength > 0) + { + if (is_basic (*pos)) + mblength = 1; + else + { + mblength = mbrlen (pos, strlength, &state); + if (mblength == (size_t)-2 || mblength == (size_t)-1 || mblength == (size_t)0) + mblength = 1; + } + + if (mblength == 1 && c == (unsigned char)*pos) + return pos; + + strlength -= mblength; + pos += mblength; + } + + return ((char *)NULL); + } + else +#endif + return (strchr (s, c)); +} diff --git a/lib/sh/mbscmp.c b/lib/sh/mbscmp.c new file mode 100644 index 0000000..e0eae5d --- /dev/null +++ b/lib/sh/mbscmp.c @@ -0,0 +1,72 @@ +/* mbscmp - multibyte string comparison. */ + +/* Copyright (C) 1995 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if !defined (HAVE_MBSCMP) && defined (HANDLE_MULTIBYTE) + +#include +#include +#include + +/* Compare MBS1 and MBS2. */ +int +mbscmp (mbs1, mbs2) + const char *mbs1; + const char *mbs2; +{ + int len1, len2; + wchar_t c1, c2; + + len1 = len2 = 0; + /* Reset multibyte characters to their initial state. */ + (void) mblen ((char *) NULL, 0); + + do + { + len1 = mbtowc (&c1, mbs1, MB_CUR_MAX); + len2 = mbtowc (&c2, mbs2, MB_CUR_MAX); + + if (len1 == 0) + return len2 == 0 ? 0 : -1; + else if (len2 == 0) + return 1; + else if (len1 > 0 && len2 < 0) + return -1; + else if (len1 < 0 && len2 > 0) + return 1; + else if (len1 < 0 && len2 < 0) + { + len1 = strlen (mbs1); + len2 = strlen (mbs2); + return (len1 == len2 ? memcmp (mbs1, mbs2, len1) + : ((len1 < len2) ? (memcmp (mbs1, mbs2, len1) > 0 ? 1 : -1) + : (memcmp (mbs1, mbs2, len2) >= 0 ? 1 : -1))); + } + + mbs1 += len1; + mbs2 += len2; + } + while (c1 == c2); + + return c1 - c2; +} + +#endif diff --git a/lib/sh/memset.c b/lib/sh/memset.c new file mode 100644 index 0000000..4ebc418 --- /dev/null +++ b/lib/sh/memset.c @@ -0,0 +1,29 @@ +/* memset.c -- set an area of memory to a given value */ + +/* Copyright (C) 1991-2002 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +char * +memset (char *str, int c, unsigned int len) +{ + register char *st = str; + + while (len-- > 0) + *st++ = c; + return str; +} diff --git a/lib/sh/mktime.c b/lib/sh/mktime.c new file mode 100644 index 0000000..7888ee1 --- /dev/null +++ b/lib/sh/mktime.c @@ -0,0 +1,423 @@ +/* mktime - convert struct tm to a time_t value */ + +/* Copyright (C) 1993-2002 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + Contributed by Paul Eggert (eggert@twinsun.com). + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ +/* Define this to have a standalone program to test this implementation of + mktime. */ +/* #define DEBUG 1 */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifdef _LIBC +# define HAVE_LIMITS_H 1 +# define HAVE_LOCALTIME_R 1 +# define STDC_HEADERS 1 +#endif + +/* Assume that leap seconds are possible, unless told otherwise. + If the host has a `zic' command with a `-L leapsecondfilename' option, + then it supports leap seconds; otherwise it probably doesn't. */ +#ifndef LEAP_SECONDS_POSSIBLE +#define LEAP_SECONDS_POSSIBLE 1 +#endif + +#ifndef VMS +#include /* Some systems define `time_t' here. */ +#endif +#include + +#if HAVE_LIMITS_H +#include +#endif + +#include "bashansi.h" + +#if DEBUG +#include +/* Make it work even if the system's libc has its own mktime routine. */ +#define mktime my_mktime +#endif /* DEBUG */ + +#ifndef __P +#if defined (__GNUC__) || (defined (__STDC__) && __STDC__) +#define __P(args) args +#else +#define __P(args) () +#endif /* GCC. */ +#endif /* Not __P. */ + +#ifndef CHAR_BIT +#define CHAR_BIT 8 +#endif + +#ifndef INT_MIN +#define INT_MIN (~0 << (sizeof (int) * CHAR_BIT - 1)) +#endif +#ifndef INT_MAX +#define INT_MAX (~0 - INT_MIN) +#endif + +#ifndef TIME_T_MIN +#define TIME_T_MIN (0 < (time_t) -1 ? (time_t) 0 \ + : ~ (time_t) 0 << (sizeof (time_t) * CHAR_BIT - 1)) +#endif +#ifndef TIME_T_MAX +#define TIME_T_MAX (~ (time_t) 0 - TIME_T_MIN) +#endif + +#define TM_YEAR_BASE 1900 +#define EPOCH_YEAR 1970 + +#ifndef __isleap +/* Nonzero if YEAR is a leap year (every 4 years, + except every 100th isn't, and every 400th is). */ +#define __isleap(year) \ + ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) +#endif + +/* How many days come before each month (0-12). */ +const unsigned short int __mon_yday[2][13] = + { + /* Normal years. */ + { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }, + /* Leap years. */ + { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } + }; + +static time_t ydhms_tm_diff __P ((int, int, int, int, int, const struct tm *)); +time_t __mktime_internal __P ((struct tm *, + struct tm *(*) (const time_t *, struct tm *), + time_t *)); + + +static struct tm *my_localtime_r __P ((const time_t *, struct tm *)); +static struct tm * +my_localtime_r (t, tp) + const time_t *t; + struct tm *tp; +{ + struct tm *l = localtime (t); + if (! l) + return 0; + *tp = *l; + return tp; +} + + +/* Yield the difference between (YEAR-YDAY HOUR:MIN:SEC) and (*TP), + measured in seconds, ignoring leap seconds. + YEAR uses the same numbering as TM->tm_year. + All values are in range, except possibly YEAR. + If overflow occurs, yield the low order bits of the correct answer. */ +static time_t +ydhms_tm_diff (year, yday, hour, min, sec, tp) + int year, yday, hour, min, sec; + const struct tm *tp; +{ + /* Compute intervening leap days correctly even if year is negative. + Take care to avoid int overflow. time_t overflow is OK, since + only the low order bits of the correct time_t answer are needed. + Don't convert to time_t until after all divisions are done, since + time_t might be unsigned. */ + int a4 = (year >> 2) + (TM_YEAR_BASE >> 2) - ! (year & 3); + int b4 = (tp->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (tp->tm_year & 3); + int a100 = a4 / 25 - (a4 % 25 < 0); + int b100 = b4 / 25 - (b4 % 25 < 0); + int a400 = a100 >> 2; + int b400 = b100 >> 2; + int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400); + time_t years = year - (time_t) tp->tm_year; + time_t days = (365 * years + intervening_leap_days + + (yday - tp->tm_yday)); + return (60 * (60 * (24 * days + (hour - tp->tm_hour)) + + (min - tp->tm_min)) + + (sec - tp->tm_sec)); +} + + +static time_t localtime_offset; + +/* Convert *TP to a time_t value. */ +time_t +mktime (tp) + struct tm *tp; +{ +#ifdef _LIBC + /* POSIX.1 8.1.1 requires that whenever mktime() is called, the + time zone names contained in the external variable `tzname' shall + be set as if the tzset() function had been called. */ + __tzset (); +#endif + + return __mktime_internal (tp, my_localtime_r, &localtime_offset); +} + +/* Convert *TP to a time_t value, inverting + the monotonic and mostly-unit-linear conversion function CONVERT. + Use *OFFSET to keep track of a guess at the offset of the result, + compared to what the result would be for UTC without leap seconds. + If *OFFSET's guess is correct, only one CONVERT call is needed. */ +time_t +__mktime_internal (tp, convert, offset) + struct tm *tp; + struct tm *(*convert) __P ((const time_t *, struct tm *)); + time_t *offset; +{ + time_t t, dt, t0; + struct tm tm; + + /* The maximum number of probes (calls to CONVERT) should be enough + to handle any combinations of time zone rule changes, solar time, + and leap seconds. Posix.1 prohibits leap seconds, but some hosts + have them anyway. */ + int remaining_probes = 4; + + /* Time requested. Copy it in case CONVERT modifies *TP; this can + occur if TP is localtime's returned value and CONVERT is localtime. */ + int sec = tp->tm_sec; + int min = tp->tm_min; + int hour = tp->tm_hour; + int mday = tp->tm_mday; + int mon = tp->tm_mon; + int year_requested = tp->tm_year; + int isdst = tp->tm_isdst; + + /* Ensure that mon is in range, and set year accordingly. */ + int mon_remainder = mon % 12; + int negative_mon_remainder = mon_remainder < 0; + int mon_years = mon / 12 - negative_mon_remainder; + int year = year_requested + mon_years; + + /* The other values need not be in range: + the remaining code handles minor overflows correctly, + assuming int and time_t arithmetic wraps around. + Major overflows are caught at the end. */ + + /* Calculate day of year from year, month, and day of month. + The result need not be in range. */ + int yday = ((__mon_yday[__isleap (year + TM_YEAR_BASE)] + [mon_remainder + 12 * negative_mon_remainder]) + + mday - 1); + +#if LEAP_SECONDS_POSSIBLE + /* Handle out-of-range seconds specially, + since ydhms_tm_diff assumes every minute has 60 seconds. */ + int sec_requested = sec; + if (sec < 0) + sec = 0; + if (59 < sec) + sec = 59; +#endif + + /* Invert CONVERT by probing. First assume the same offset as last time. + Then repeatedly use the error to improve the guess. */ + + tm.tm_year = EPOCH_YEAR - TM_YEAR_BASE; + tm.tm_yday = tm.tm_hour = tm.tm_min = tm.tm_sec = 0; + t0 = ydhms_tm_diff (year, yday, hour, min, sec, &tm); + + for (t = t0 + *offset; + (dt = ydhms_tm_diff (year, yday, hour, min, sec, (*convert) (&t, &tm))); + t += dt) + if (--remaining_probes == 0) + return -1; + + /* Check whether tm.tm_isdst has the requested value, if any. */ + if (0 <= isdst && 0 <= tm.tm_isdst) + { + int dst_diff = (isdst != 0) - (tm.tm_isdst != 0); + if (dst_diff) + { + /* Move two hours in the direction indicated by the disagreement, + probe some more, and switch to a new time if found. + The largest known fallback due to daylight savings is two hours: + once, in Newfoundland, 1988-10-30 02:00 -> 00:00. */ + time_t ot = t - 2 * 60 * 60 * dst_diff; + while (--remaining_probes != 0) + { + struct tm otm; + if (! (dt = ydhms_tm_diff (year, yday, hour, min, sec, + (*convert) (&ot, &otm)))) + { + t = ot; + tm = otm; + break; + } + if ((ot += dt) == t) + break; /* Avoid a redundant probe. */ + } + } + } + + *offset = t - t0; + +#if LEAP_SECONDS_POSSIBLE + if (sec_requested != tm.tm_sec) + { + /* Adjust time to reflect the tm_sec requested, not the normalized value. + Also, repair any damage from a false match due to a leap second. */ + t += sec_requested - sec + (sec == 0 && tm.tm_sec == 60); + (*convert) (&t, &tm); + } +#endif + + if (TIME_T_MAX / INT_MAX / 366 / 24 / 60 / 60 < 3) + { + /* time_t isn't large enough to rule out overflows in ydhms_tm_diff, + so check for major overflows. A gross check suffices, + since if t has overflowed, it is off by a multiple of + TIME_T_MAX - TIME_T_MIN + 1. So ignore any component of + the difference that is bounded by a small value. */ + + double dyear = (double) year_requested + mon_years - tm.tm_year; + double dday = 366 * dyear + mday; + double dsec = 60 * (60 * (24 * dday + hour) + min) + sec_requested; + + if (TIME_T_MAX / 3 - TIME_T_MIN / 3 < (dsec < 0 ? - dsec : dsec)) + return -1; + } + + *tp = tm; + return t; +} + +#ifdef weak_alias +weak_alias (mktime, timelocal) +#endif + +#if DEBUG + +static int +not_equal_tm (a, b) + struct tm *a; + struct tm *b; +{ + return ((a->tm_sec ^ b->tm_sec) + | (a->tm_min ^ b->tm_min) + | (a->tm_hour ^ b->tm_hour) + | (a->tm_mday ^ b->tm_mday) + | (a->tm_mon ^ b->tm_mon) + | (a->tm_year ^ b->tm_year) + | (a->tm_mday ^ b->tm_mday) + | (a->tm_yday ^ b->tm_yday) + | (a->tm_isdst ^ b->tm_isdst)); +} + +static void +print_tm (tp) + struct tm *tp; +{ + printf ("%04d-%02d-%02d %02d:%02d:%02d yday %03d wday %d isdst %d", + tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday, + tp->tm_hour, tp->tm_min, tp->tm_sec, + tp->tm_yday, tp->tm_wday, tp->tm_isdst); +} + +static int +check_result (tk, tmk, tl, tml) + time_t tk; + struct tm tmk; + time_t tl; + struct tm tml; +{ + if (tk != tl || not_equal_tm (&tmk, &tml)) + { + printf ("mktime ("); + print_tm (&tmk); + printf (")\nyields ("); + print_tm (&tml); + printf (") == %ld, should be %ld\n", (long) tl, (long) tk); + return 1; + } + + return 0; +} + +int +main (argc, argv) + int argc; + char **argv; +{ + int status = 0; + struct tm tm, tmk, tml; + time_t tk, tl; + char trailer; + + if ((argc == 3 || argc == 4) + && (sscanf (argv[1], "%d-%d-%d%c", + &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer) + == 3) + && (sscanf (argv[2], "%d:%d:%d%c", + &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer) + == 3)) + { + tm.tm_year -= TM_YEAR_BASE; + tm.tm_mon--; + tm.tm_isdst = argc == 3 ? -1 : atoi (argv[3]); + tmk = tm; + tl = mktime (&tmk); + tml = *localtime (&tl); + printf ("mktime returns %ld == ", (long) tl); + print_tm (&tmk); + printf ("\n"); + status = check_result (tl, tmk, tl, tml); + } + else if (argc == 4 || (argc == 5 && strcmp (argv[4], "-") == 0)) + { + time_t from = atol (argv[1]); + time_t by = atol (argv[2]); + time_t to = atol (argv[3]); + + if (argc == 4) + for (tl = from; tl <= to; tl += by) + { + tml = *localtime (&tl); + tmk = tml; + tk = mktime (&tmk); + status |= check_result (tk, tmk, tl, tml); + } + else + for (tl = from; tl <= to; tl += by) + { + /* Null benchmark. */ + tml = *localtime (&tl); + tmk = tml; + tk = tl; + status |= check_result (tk, tmk, tl, tml); + } + } + else + printf ("Usage:\ +\t%s YYYY-MM-DD HH:MM:SS [ISDST] # Test given time.\n\ +\t%s FROM BY TO # Test values FROM, FROM+BY, ..., TO.\n\ +\t%s FROM BY TO - # Do not test those values (for benchmark).\n", + argv[0], argv[0], argv[0]); + + return status; +} + +#endif /* DEBUG */ + +/* +Local Variables: +compile-command: "gcc -DDEBUG=1 -Wall -O -g mktime.c -o mktime" +End: +*/ diff --git a/lib/sh/netconn.c b/lib/sh/netconn.c new file mode 100644 index 0000000..36e5bf5 --- /dev/null +++ b/lib/sh/netconn.c @@ -0,0 +1,82 @@ +/* netconn.c -- is a particular file descriptor a network connection?. */ + +/* Copyright (C) 2002-2005 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include +#if ! defined(_MINIX) && defined (HAVE_SYS_FILE_H) +# include +#endif +#include +#include + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +/* The second and subsequent conditions must match those used to decide + whether or not to call getpeername() in isnetconn(). */ +#if defined (HAVE_SYS_SOCKET_H) && defined (HAVE_GETPEERNAME) && !defined (SVR4_2) +# include +#endif + +/* Is FD a socket or network connection? */ +int +isnetconn (fd) + int fd; +{ +#if defined (HAVE_GETPEERNAME) && !defined (SVR4_2) && !defined (__BEOS__) + int rv; + socklen_t l; + struct sockaddr sa; + + l = sizeof(sa); + rv = getpeername(fd, &sa, &l); + /* Posix.2 says getpeername can return these errors. */ + return ((rv < 0 && (errno == ENOTSOCK || errno == ENOTCONN || errno == EINVAL)) ? 0 : 1); +#else /* !HAVE_GETPEERNAME || SVR4_2 || __BEOS__ */ +# if defined (SVR4) || defined (SVR4_2) + /* Sockets on SVR4 and SVR4.2 are character special (streams) devices. */ + struct stat sb; + + if (isatty (fd)) + return (0); + if (fstat (fd, &sb) < 0) + return (0); +# if defined (S_ISFIFO) + if (S_ISFIFO (sb.st_mode)) + return (0); +# endif /* S_ISFIFO */ + return (S_ISCHR (sb.st_mode)); +# else /* !SVR4 && !SVR4_2 */ +# if defined (S_ISSOCK) && !defined (__BEOS__) + struct stat sb; + + if (fstat (fd, &sb) < 0) + return (0); + return (S_ISSOCK (sb.st_mode)); +# else /* !S_ISSOCK || __BEOS__ */ + return (0); +# endif /* !S_ISSOCK || __BEOS__ */ +# endif /* !SVR4 && !SVR4_2 */ +#endif /* !HAVE_GETPEERNAME || SVR4_2 || __BEOS__ */ +} diff --git a/lib/sh/netopen.c b/lib/sh/netopen.c new file mode 100644 index 0000000..736d413 --- /dev/null +++ b/lib/sh/netopen.c @@ -0,0 +1,350 @@ +/* + * netopen.c -- functions to make tcp/udp connections + * + * Chet Ramey + * chet@ins.CWRU.Edu + */ + +/* Copyright (C) 1987-2002 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HAVE_NETWORK) + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include + +#if defined (HAVE_SYS_SOCKET_H) +# include +#endif + +#if defined (HAVE_NETINET_IN_H) +# include +#endif + +#if defined (HAVE_NETDB_H) +# include +#endif + +#if defined (HAVE_ARPA_INET_H) +# include +#endif + +#include +#include + +#include + +#include +#include + +#ifndef errno +extern int errno; +#endif + +#if !defined (HAVE_INET_ATON) +extern int inet_aton __P((const char *, struct in_addr *)); +#endif + +#ifndef HAVE_GETADDRINFO +static int _getaddr __P((char *, struct in_addr *)); +static int _getserv __P((char *, int, unsigned short *)); +static int _netopen4 __P((char *, char *, int)); +#else /* HAVE_GETADDRINFO */ +static int _netopen6 __P((char *, char *, int)); +#endif + +static int _netopen __P((char *, char *, int)); + +#ifndef HAVE_GETADDRINFO +/* Stuff the internet address corresponding to HOST into AP, in network + byte order. Return 1 on success, 0 on failure. */ + +static int +_getaddr (host, ap) + char *host; + struct in_addr *ap; +{ + struct hostent *h; + int r; + + r = 0; + if (host[0] >= '0' && host[0] <= '9') + { + /* If the first character is a digit, guess that it's an + Internet address and return immediately if inet_aton succeeds. */ + r = inet_aton (host, ap); + if (r) + return r; + } +#if !defined (HAVE_GETHOSTBYNAME) + return 0; +#else + h = gethostbyname (host); + if (h && h->h_addr) + { + bcopy(h->h_addr, (char *)ap, h->h_length); + return 1; + } +#endif + return 0; + +} + +/* Return 1 if SERV is a valid port number and stuff the converted value into + PP in network byte order. */ +static int +_getserv (serv, proto, pp) + char *serv; + int proto; + unsigned short *pp; +{ + intmax_t l; + unsigned short s; + + if (legal_number (serv, &l)) + { + s = (unsigned short)(l & 0xFFFF); + if (s != l) + return (0); + s = htons (s); + if (pp) + *pp = s; + return 1; + } + else +#if defined (HAVE_GETSERVBYNAME) + { + struct servent *se; + + se = getservbyname (serv, (proto == 't') ? "tcp" : "udp"); + if (se == 0) + return 0; + if (pp) + *pp = se->s_port; /* ports returned in network byte order */ + return 1; + } +#else /* !HAVE_GETSERVBYNAME */ + return 0; +#endif /* !HAVE_GETSERVBYNAME */ +} + +/* + * Open a TCP or UDP connection to HOST on port SERV. Uses the + * traditional BSD mechanisms. Returns the connected socket or -1 on error. + */ +static int +_netopen4(host, serv, typ) + char *host, *serv; + int typ; +{ + struct in_addr ina; + struct sockaddr_in sin; + unsigned short p; + int s, e; + + if (_getaddr(host, &ina) == 0) + { + internal_error (_("%s: host unknown"), host); + errno = EINVAL; + return -1; + } + + if (_getserv(serv, typ, &p) == 0) + { + internal_error(_("%s: invalid service"), serv); + errno = EINVAL; + return -1; + } + + memset ((char *)&sin, 0, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_port = p; + sin.sin_addr = ina; + + s = socket(AF_INET, (typ == 't') ? SOCK_STREAM : SOCK_DGRAM, 0); + if (s < 0) + { + sys_error ("socket"); + return (-1); + } + + if (connect (s, (struct sockaddr *)&sin, sizeof (sin)) < 0) + { + e = errno; + sys_error("connect"); + close(s); + errno = e; + return (-1); + } + + return(s); +} +#endif /* ! HAVE_GETADDRINFO */ + +#ifdef HAVE_GETADDRINFO +/* + * Open a TCP or UDP connection to HOST on port SERV. Uses getaddrinfo(3) + * which provides support for IPv6. Returns the connected socket or -1 + * on error. + */ +static int +_netopen6 (host, serv, typ) + char *host, *serv; + int typ; +{ + int s, e; + struct addrinfo hints, *res, *res0; + int gerr; + + memset ((char *)&hints, 0, sizeof (hints)); + /* XXX -- if problems with IPv6, set to PF_INET for IPv4 only */ +#ifdef DEBUG /* PF_INET is the one that works for me */ + hints.ai_family = PF_INET; +#else + hints.ai_family = PF_UNSPEC; +#endif + hints.ai_socktype = (typ == 't') ? SOCK_STREAM : SOCK_DGRAM; + + gerr = getaddrinfo (host, serv, &hints, &res0); + if (gerr) + { + if (gerr == EAI_SERVICE) + internal_error ("%s: %s", serv, gai_strerror (gerr)); + else + internal_error ("%s: %s", host, gai_strerror (gerr)); + errno = EINVAL; + return -1; + } + + for (res = res0; res; res = res->ai_next) + { + if ((s = socket (res->ai_family, res->ai_socktype, res->ai_protocol)) < 0) + { + if (res->ai_next) + continue; + sys_error ("socket"); + freeaddrinfo (res0); + return -1; + } + if (connect (s, res->ai_addr, res->ai_addrlen) < 0) + { + if (res->ai_next) + { + close (s); + continue; + } + e = errno; + sys_error ("connect"); + close (s); + freeaddrinfo (res0); + errno = e; + return -1; + } + freeaddrinfo (res0); + break; + } + return s; +} +#endif /* HAVE_GETADDRINFO */ + +/* + * Open a TCP or UDP connection to HOST on port SERV. Uses getaddrinfo(3) + * if available, falling back to the traditional BSD mechanisms otherwise. + * Returns the connected socket or -1 on error. + */ +static int +_netopen(host, serv, typ) + char *host, *serv; + int typ; +{ +#ifdef HAVE_GETADDRINFO + return (_netopen6 (host, serv, typ)); +#else + return (_netopen4 (host, serv, typ)); +#endif +} + +/* + * Open a TCP or UDP connection given a path like `/dev/tcp/host/port' to + * host `host' on port `port' and return the connected socket. + */ +int +netopen (path) + char *path; +{ + char *np, *s, *t; + int fd; + + np = (char *)xmalloc (strlen (path) + 1); + strcpy (np, path); + + s = np + 9; + t = strchr (s, '/'); + if (t == 0) + { + internal_error (_("%s: bad network path specification"), path); + return -1; + } + *t++ = '\0'; + fd = _netopen (s, t, path[5]); + free (np); + + return fd; +} + +#if 0 +/* + * Open a TCP connection to host `host' on the port defined for service + * `serv' and return the connected socket. + */ +int +tcpopen (host, serv) + char *host, *serv; +{ + return (_netopen (host, serv, 't')); +} + +/* + * Open a UDP connection to host `host' on the port defined for service + * `serv' and return the connected socket. + */ +int +udpopen (host, serv) + char *host, *serv; +{ + return _netopen (host, serv, 'u'); +} +#endif + +#else /* !HAVE_NETWORK */ + +int +netopen (path) + char *path; +{ + internal_error (_("network operations not supported")); + return -1; +} + +#endif /* !HAVE_NETWORK */ diff --git a/lib/sh/oslib.c b/lib/sh/oslib.c new file mode 100644 index 0000000..b173b72 --- /dev/null +++ b/lib/sh/oslib.c @@ -0,0 +1,301 @@ +/* oslib.c - functions present only in some unix versions. */ + +/* Copyright (C) 1995,2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include +#if defined (HAVE_SYS_PARAM_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (HAVE_LIMITS_H) +# include +#endif + +#include +#include +#include + +#if !defined (HAVE_KILLPG) +# include +#endif + +#include +#include +#include + +#include + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +/* Make the functions strchr and strrchr if they do not exist. */ +#if !defined (HAVE_STRCHR) +char * +strchr (string, c) + char *string; + int c; +{ + register char *s; + + for (s = string; s && *s; s++) + if (*s == c) + return (s); + + return ((char *) NULL); +} + +char * +strrchr (string, c) + char *string; + int c; +{ + register char *s, *t; + + for (s = string, t = (char *)NULL; s && *s; s++) + if (*s == c) + t = s; + return (t); +} +#endif /* !HAVE_STRCHR */ + +#if !defined (HAVE_DUP2) || defined (DUP2_BROKEN) +/* Replacement for dup2 (), for those systems which either don't have it, + or supply one with broken behaviour. */ +int +dup2 (fd1, fd2) + int fd1, fd2; +{ + int saved_errno, r; + + /* If FD1 is not a valid file descriptor, then return immediately with + an error. */ + if (fcntl (fd1, F_GETFL, 0) == -1) + return (-1); + + if (fd2 < 0 || fd2 >= getdtablesize ()) + { + errno = EBADF; + return (-1); + } + + if (fd1 == fd2) + return (0); + + saved_errno = errno; + + (void) close (fd2); + r = fcntl (fd1, F_DUPFD, fd2); + + if (r >= 0) + errno = saved_errno; + else + if (errno == EINVAL) + errno = EBADF; + + /* Force the new file descriptor to remain open across exec () calls. */ + SET_OPEN_ON_EXEC (fd2); + return (r); +} +#endif /* !HAVE_DUP2 */ + +/* + * Return the total number of available file descriptors. + * + * On some systems, like 4.2BSD and its descendants, there is a system call + * that returns the size of the descriptor table: getdtablesize(). There are + * lots of ways to emulate this on non-BSD systems. + * + * On System V.3, this can be obtained via a call to ulimit: + * return (ulimit(4, 0L)); + * + * On other System V systems, NOFILE is defined in /usr/include/sys/param.h + * (this is what we assume below), so we can simply use it: + * return (NOFILE); + * + * On POSIX systems, there are specific functions for retrieving various + * configuration parameters: + * return (sysconf(_SC_OPEN_MAX)); + * + */ + +#if !defined (HAVE_GETDTABLESIZE) +int +getdtablesize () +{ +# if defined (_POSIX_VERSION) && defined (HAVE_SYSCONF) && defined (_SC_OPEN_MAX) + return (sysconf(_SC_OPEN_MAX)); /* Posix systems use sysconf */ +# else /* ! (_POSIX_VERSION && HAVE_SYSCONF && _SC_OPEN_MAX) */ +# if defined (ULIMIT_MAXFDS) + return (ulimit (4, 0L)); /* System V.3 systems use ulimit(4, 0L) */ +# else /* !ULIMIT_MAXFDS */ +# if defined (NOFILE) /* Other systems use NOFILE */ + return (NOFILE); +# else /* !NOFILE */ + return (20); /* XXX - traditional value is 20 */ +# endif /* !NOFILE */ +# endif /* !ULIMIT_MAXFDS */ +# endif /* ! (_POSIX_VERSION && _SC_OPEN_MAX) */ +} +#endif /* !HAVE_GETDTABLESIZE */ + +#if !defined (HAVE_BCOPY) +# if defined (bcopy) +# undef bcopy +# endif +void +bcopy (s,d,n) + char *d, *s; + int n; +{ + FASTCOPY (s, d, n); +} +#endif /* !HAVE_BCOPY */ + +#if !defined (HAVE_BZERO) +# if defined (bzero) +# undef bzero +# endif +void +bzero (s, n) + void *s; + size_t n; +{ + register int i; + register char *r; + + for (i = 0, r = s; i < n; i++) + *r++ = '\0'; +} +#endif + +#if !defined (HAVE_GETHOSTNAME) +# if defined (HAVE_UNAME) +# include +int +gethostname (name, namelen) + char *name; + int namelen; +{ + int i; + struct utsname ut; + + --namelen; + + uname (&ut); + i = strlen (ut.nodename) + 1; + strncpy (name, ut.nodename, i < namelen ? i : namelen); + name[namelen] = '\0'; + return (0); +} +# else /* !HAVE_UNAME */ +int +gethostname (name, namelen) + char *name; + int namelen; +{ + strncpy (name, "unknown", namelen); + name[namelen] = '\0'; + return 0; +} +# endif /* !HAVE_UNAME */ +#endif /* !HAVE_GETHOSTNAME */ + +#if !defined (HAVE_KILLPG) +int +killpg (pgrp, sig) + pid_t pgrp; + int sig; +{ + return (kill (-pgrp, sig)); +} +#endif /* !HAVE_KILLPG */ + +#if !defined (HAVE_MKFIFO) && defined (PROCESS_SUBSTITUTION) +int +mkfifo (path, mode) + char *path; + int mode; +{ +#if defined (S_IFIFO) + return (mknod (path, (mode | S_IFIFO), 0)); +#else /* !S_IFIFO */ + return (-1); +#endif /* !S_IFIFO */ +} +#endif /* !HAVE_MKFIFO && PROCESS_SUBSTITUTION */ + +#define DEFAULT_MAXGROUPS 64 + +int +getmaxgroups () +{ + static int maxgroups = -1; + + if (maxgroups > 0) + return maxgroups; + +#if defined (HAVE_SYSCONF) && defined (_SC_NGROUPS_MAX) + maxgroups = sysconf (_SC_NGROUPS_MAX); +#else +# if defined (NGROUPS_MAX) + maxgroups = NGROUPS_MAX; +# else /* !NGROUPS_MAX */ +# if defined (NGROUPS) + maxgroups = NGROUPS; +# else /* !NGROUPS */ + maxgroups = DEFAULT_MAXGROUPS; +# endif /* !NGROUPS */ +# endif /* !NGROUPS_MAX */ +#endif /* !HAVE_SYSCONF || !SC_NGROUPS_MAX */ + + if (maxgroups <= 0) + maxgroups = DEFAULT_MAXGROUPS; + + return maxgroups; +} + +long +getmaxchild () +{ + static long maxchild = -1L; + + if (maxchild > 0) + return maxchild; + +#if defined (HAVE_SYSCONF) && defined (_SC_CHILD_MAX) + maxchild = sysconf (_SC_CHILD_MAX); +#else +# if defined (CHILD_MAX) + maxchild = CHILD_MAX; +# else +# if defined (MAXUPRC) + maxchild = MAXUPRC; +# endif /* MAXUPRC */ +# endif /* CHILD_MAX */ +#endif /* !HAVE_SYSCONF || !_SC_CHILD_MAX */ + + return (maxchild); +} diff --git a/lib/sh/pathcanon.c b/lib/sh/pathcanon.c new file mode 100644 index 0000000..f19bd55 --- /dev/null +++ b/lib/sh/pathcanon.c @@ -0,0 +1,234 @@ +/* pathcanon.c -- canonicalize and manipulate pathnames. */ + +/* Copyright (C) 2000 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include +#if defined (HAVE_SYS_PARAM_H) +# include +#endif +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include +#include +#include +#include + +#include "shell.h" + +#if !defined (errno) +extern int errno; +#endif + +#if defined (__CYGWIN__) +#include + +static int +_is_cygdrive (path) + char *path; +{ + static char user[MAXPATHLEN]; + static char system[MAXPATHLEN]; + static int first_time = 1; + + /* If the path is the first part of a network path, treat it as + existing. */ + if (path[0] == '/' && path[1] == '/' && !strchr (path + 2, '/')) + return 1; + /* Otherwise check for /cygdrive prefix. */ + if (first_time) + { + char user_flags[MAXPATHLEN]; + char system_flags[MAXPATHLEN]; + /* Get the cygdrive info */ + cygwin_internal (CW_GET_CYGDRIVE_INFO, user, system, user_flags, system_flags); + first_time = 0; + } + return !strcasecmp (path, user) || !strcasecmp (path, system); +} +#endif /* __CYGWIN__ */ + +/* Return 1 if PATH corresponds to a directory. A function for debugging. */ +static int +_path_isdir (path) + char *path; +{ + int l; + struct stat sb; + + /* This should leave errno set to the correct value. */ + errno = 0; + l = stat (path, &sb) == 0 && S_ISDIR (sb.st_mode); +#if defined (__CYGWIN__) + if (l == 0) + l = _is_cygdrive (path); +#endif + return l; +} + +/* Canonicalize PATH, and return a new path. The new path differs from PATH + in that: + Multple `/'s are collapsed to a single `/'. + Leading `./'s and trailing `/.'s are removed. + Trailing `/'s are removed. + Non-leading `../'s and trailing `..'s are handled by removing + portions of the path. */ + +/* Look for ROOTEDPATH, PATHSEP, DIRSEP, and ISDIRSEP in ../../general.h */ + +#define DOUBLE_SLASH(p) ((p[0] == '/') && (p[1] == '/') && p[2] != '/') + +char * +sh_canonpath (path, flags) + char *path; + int flags; +{ + char stub_char; + char *result, *p, *q, *base, *dotdot; + int rooted, double_slash_path; + + /* The result cannot be larger than the input PATH. */ + result = (flags & PATH_NOALLOC) ? path : savestring (path); + + /* POSIX.2 says to leave a leading `//' alone. On cygwin, we skip over any + leading `x:' (dos drive name). */ + if (rooted = ROOTEDPATH(path)) + { + stub_char = DIRSEP; +#if defined (__CYGWIN__) + base = (ISALPHA((unsigned char)result[0]) && result[1] == ':') ? result + 3 : result + 1; +#else + base = result + 1; +#endif + double_slash_path = DOUBLE_SLASH (path); + base += double_slash_path; + } + else + { + stub_char = '.'; +#if defined (__CYGWIN__) + base = (ISALPHA((unsigned char)result[0]) && result[1] == ':') ? result + 2 : result; +#else + base = result; +#endif + double_slash_path = 0; + } + + /* + * invariants: + * base points to the portion of the path we want to modify + * p points at beginning of path element we're considering. + * q points just past the last path element we wrote (no slash). + * dotdot points just past the point where .. cannot backtrack + * any further (no slash). + */ + p = q = dotdot = base; + + while (*p) + { + if (ISDIRSEP(p[0])) /* null element */ + p++; + else if(p[0] == '.' && PATHSEP(p[1])) /* . and ./ */ + p += 1; /* don't count the separator in case it is nul */ + else if (p[0] == '.' && p[1] == '.' && PATHSEP(p[2])) /* .. and ../ */ + { + p += 2; /* skip `..' */ + if (q > dotdot) /* can backtrack */ + { + if (flags & PATH_CHECKDOTDOT) + { + char c; + + /* Make sure what we have so far corresponds to a valid + path before we chop some of it off. */ + c = *q; + *q = '\0'; + if (_path_isdir (result) == 0) + { + if ((flags & PATH_NOALLOC) == 0) + free (result); + return ((char *)NULL); + } + *q = c; + } + + while (--q > dotdot && ISDIRSEP(*q) == 0) + ; + } + else if (rooted == 0) + { + /* /.. is / but ./../ is .. */ + if (q != base) + *q++ = DIRSEP; + *q++ = '.'; + *q++ = '.'; + dotdot = q; + } + } + else /* real path element */ + { + /* add separator if not at start of work portion of result */ + if (q != base) + *q++ = DIRSEP; + while (*p && (ISDIRSEP(*p) == 0)) + *q++ = *p++; + /* Check here for a valid directory with _path_isdir. */ + if (flags & PATH_CHECKEXISTS) + { + char c; + + /* Make sure what we have so far corresponds to a valid + path before we chop some of it off. */ + c = *q; + *q = '\0'; + if (_path_isdir (result) == 0) + { + if ((flags & PATH_NOALLOC) == 0) + free (result); + return ((char *)NULL); + } + *q = c; + } + } + } + + /* Empty string is really ``.'' or `/', depending on what we started with. */ + if (q == result) + *q++ = stub_char; + *q = '\0'; + + /* If the result starts with `//', but the original path does not, we + can turn the // into /. Because of how we set `base', this should never + be true, but it's a sanity check. */ + if (DOUBLE_SLASH(result) && double_slash_path == 0) + { + if (result[2] == '\0') /* short-circuit for bare `//' */ + result[1] = '\0'; + else + strcpy (result, result + 1); + } + + return (result); +} diff --git a/lib/sh/pathphys.c b/lib/sh/pathphys.c new file mode 100644 index 0000000..26016b7 --- /dev/null +++ b/lib/sh/pathphys.c @@ -0,0 +1,296 @@ +/* pathphys.c -- return pathname with all symlinks expanded. */ + +/* Copyright (C) 2000 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include +#if defined (HAVE_SYS_PARAM_H) +# include +#endif +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include +#include +#include +#include + +#include "shell.h" + +#if !defined (MAXSYMLINKS) +# define MAXSYMLINKS 32 +#endif + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +extern char *get_working_directory __P((char *)); + +static int +_path_readlink (path, buf, bufsiz) + char *path; + char *buf; + int bufsiz; +{ +#ifdef HAVE_READLINK + return readlink (path, buf, bufsiz); +#else + errno = EINVAL; + return -1; +#endif +} + +/* Look for ROOTEDPATH, PATHSEP, DIRSEP, and ISDIRSEP in ../../general.h */ + +#define DOUBLE_SLASH(p) ((p[0] == '/') && (p[1] == '/') && p[2] != '/') + +/* + * Return PATH with all symlinks expanded in newly-allocated memory. + * This always gets an absolute pathname. + */ + +char * +sh_physpath (path, flags) + char *path; + int flags; +{ + char tbuf[PATH_MAX+1], linkbuf[PATH_MAX+1]; + char *result, *p, *q, *qsave, *qbase, *workpath; + int double_slash_path, linklen, nlink; + + linklen = strlen (path); + +#if 0 + /* First sanity check -- punt immediately if the name is too long. */ + if (linklen >= PATH_MAX) + return (savestring (path)); +#endif + + nlink = 0; + q = result = (char *)xmalloc (PATH_MAX + 1); + + /* Even if we get something longer than PATH_MAX, we might be able to + shorten it, so we try. */ + if (linklen >= PATH_MAX) + workpath = savestring (path); + else + { + workpath = (char *)xmalloc (PATH_MAX + 1); + strcpy (workpath, path); + } + + /* This always gets an absolute pathname. */ + + /* POSIX.2 says to leave a leading `//' alone. On cygwin, we skip over any + leading `x:' (dos drive name). */ +#if defined (__CYGWIN__) + qbase = (ISALPHA((unsigned char)workpath[0]) && workpath[1] == ':') ? workpath + 3 : workpath + 1; +#else + qbase = workpath + 1; +#endif + double_slash_path = DOUBLE_SLASH (workpath); + qbase += double_slash_path; + + for (p = workpath; p < qbase; ) + *q++ = *p++; + qbase = q; + + /* + * invariants: + * qbase points to the portion of the result path we want to modify + * p points at beginning of path element we're considering. + * q points just past the last path element we wrote (no slash). + * + * XXX -- need to fix error checking for too-long pathnames + */ + + while (*p) + { + if (ISDIRSEP(p[0])) /* null element */ + p++; + else if(p[0] == '.' && PATHSEP(p[1])) /* . and ./ */ + p += 1; /* don't count the separator in case it is nul */ + else if (p[0] == '.' && p[1] == '.' && PATHSEP(p[2])) /* .. and ../ */ + { + p += 2; /* skip `..' */ + if (q > qbase) + { + while (--q > qbase && ISDIRSEP(*q) == 0) + ; + } + } + else /* real path element */ + { + /* add separator if not at start of work portion of result */ + qsave = q; + if (q != qbase) + *q++ = DIRSEP; + while (*p && (ISDIRSEP(*p) == 0)) + { + if (q - result >= PATH_MAX) + { +#ifdef ENAMETOOLONG + errno = ENAMETOOLONG; +#else + errno = EINVAL; +#endif + goto error; + } + + *q++ = *p++; + } + + *q = '\0'; + + linklen = _path_readlink (result, linkbuf, PATH_MAX); + if (linklen < 0) /* if errno == EINVAL, it's not a symlink */ + { + if (errno != EINVAL) + goto error; + continue; + } + + /* It's a symlink, and the value is in LINKBUF. */ + nlink++; + if (nlink > MAXSYMLINKS) + { +#ifdef ELOOP + errno = ELOOP; +#else + errno = EINVAL; +#endif +error: + free (result); + free (workpath); + return ((char *)NULL); + } + + linkbuf[linklen] = '\0'; + + /* If the new path length would overrun PATH_MAX, punt now. */ + if ((strlen (p) + linklen + 2) >= PATH_MAX) + { +#ifdef ENAMETOOLONG + errno = ENAMETOOLONG; +#else + errno = EINVAL; +#endif + goto error; + } + + /* Form the new pathname by copying the link value to a temporary + buffer and appending the rest of `workpath'. Reset p to point + to the start of the rest of the path. If the link value is an + absolute pathname, reset p, q, and qbase. If not, reset p + and q. */ + strcpy (tbuf, linkbuf); + tbuf[linklen] = '/'; + strcpy (tbuf + linklen, p); + strcpy (workpath, tbuf); + + if (ABSPATH(linkbuf)) + { + q = result; + /* Duplicating some code here... */ +#if defined (__CYGWIN__) + qbase = (ISALPHA((unsigned char)workpath[0]) && workpath[1] == ':') ? workpath + 3 : workpath + 1; +#else + qbase = workpath + 1; +#endif + double_slash_path = DOUBLE_SLASH (workpath); + qbase += double_slash_path; + + for (p = workpath; p < qbase; ) + *q++ = *p++; + qbase = q; + } + else + { + p = workpath; + q = qsave; + } + } + } + + *q = '\0'; + free (workpath); + + /* If the result starts with `//', but the original path does not, we + can turn the // into /. Because of how we set `qbase', this should never + be true, but it's a sanity check. */ + if (DOUBLE_SLASH(result) && double_slash_path == 0) + { + if (result[2] == '\0') /* short-circuit for bare `//' */ + result[1] = '\0'; + else + strcpy (result, result + 1); + } + + return (result); +} + +char * +sh_realpath (pathname, resolved) + const char *pathname; + char *resolved; +{ + char *tdir, *wd; + + if (pathname == 0 || *pathname == '\0') + { + errno = (pathname == 0) ? EINVAL : ENOENT; + return ((char *)NULL); + } + + if (ABSPATH (pathname) == 0) + { + wd = get_working_directory ("sh_realpath"); + if (wd == 0) + return ((char *)NULL); + tdir = sh_makepath (wd, (char *)pathname, 0); + free (wd); + } + else + tdir = savestring (pathname); + + wd = sh_physpath (tdir, 0); + free (tdir); + + if (resolved == 0) + return (wd); + + if (wd) + { + strncpy (resolved, wd, PATH_MAX - 1); + resolved[PATH_MAX - 1] = '\0'; + free (wd); + return resolved; + } + else + { + resolved[0] = '\0'; + return wd; + } +} diff --git a/lib/sh/rename.c b/lib/sh/rename.c new file mode 100644 index 0000000..e410b5e --- /dev/null +++ b/lib/sh/rename.c @@ -0,0 +1,76 @@ +/* + * rename - rename a file + */ + +/* Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if !defined (HAVE_RENAME) + +#include +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif +#include + +#include + +#ifndef errno +extern int errno; +#endif + +int +rename (from, to) + const char *from, *to; +{ + struct stat fb, tb; + + if (stat (from, &fb) < 0) + return -1; + + if (stat (to, &tb) < 0) + { + if (errno != ENOENT) + return -1; + } + else + { + if (fb.st_dev == tb.st_dev && fb.st_ino == tb.st_ino) + return 0; /* same file */ + if (unlink (to) < 0 && errno != ENOENT) + return -1; + } + + if (link (from, to) < 0) + return (-1); + + if (unlink (from) < 0 && errno != ENOENT) + { + int e = errno; + unlink (to); + errno = e; + return (-1); + } + + return (0); +} +#endif /* !HAVE_RENAME */ diff --git a/lib/sh/setlinebuf.c b/lib/sh/setlinebuf.c new file mode 100644 index 0000000..6473ddf --- /dev/null +++ b/lib/sh/setlinebuf.c @@ -0,0 +1,63 @@ +/* setlinebuf.c - line-buffer a stdio stream. */ + +/* Copyright (C) 1997 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include + +#include + +#if defined (USING_BASH_MALLOC) +# define LBUF_BUFSIZE 1008 +#else +# define LBUF_BUFSIZE BUFSIZ +#endif + +/* Cause STREAM to buffer lines as opposed to characters or blocks. */ +int +sh_setlinebuf (stream) + FILE *stream; +{ + char *local_linebuf; + +#if !defined (HAVE_SETLINEBUF) && !defined (HAVE_SETVBUF) + return (0); +#endif + +#if defined (USING_BASH_MALLOC) + local_linebuf = (char *)xmalloc (LBUF_BUFSIZE); +#else + local_linebuf = (char *)NULL; +#endif + +#if defined (HAVE_SETVBUF) + +# if defined (SETVBUF_REVERSED) + return (setvbuf (stream, _IOLBF, local_linebuf, LBUF_BUFSIZE)); +# else /* !SETVBUF_REVERSED */ + return (setvbuf (stream, local_linebuf, _IOLBF, LBUF_BUFSIZE)); +# endif /* !SETVBUF_REVERSED */ +# else /* !HAVE_SETVBUF */ + + setlinebuf (stream); + return (0); + +#endif /* !HAVE_SETVBUF */ +} diff --git a/lib/sh/shmatch.c b/lib/sh/shmatch.c new file mode 100644 index 0000000..3abefed --- /dev/null +++ b/lib/sh/shmatch.c @@ -0,0 +1,120 @@ +/* + * shmatch.c -- shell interface to posix regular expression matching. + */ + +/* Copyright (C) 2003 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#if defined (HAVE_POSIX_REGEXP) + +#ifdef HAVE_UNISTD_H +# include +#endif + +#include "bashansi.h" + +#include +#include + +#include "shell.h" +#include "variables.h" +#include "externs.h" + +extern int glob_ignore_case, match_ignore_case; + +int +sh_regmatch (string, pattern, flags) + const char *string; + const char *pattern; + int flags; +{ + regex_t regex = { 0 }; + regmatch_t *matches; + int rflags; +#if defined (ARRAY_VARS) + SHELL_VAR *rematch; + ARRAY *amatch; + int subexp_ind; + char *subexp_str; + int subexp_len; +#endif + int result; + +#if defined (ARRAY_VARS) + rematch = (SHELL_VAR *)NULL; +#endif + + rflags = REG_EXTENDED; + if (glob_ignore_case || match_ignore_case) + rflags |= REG_ICASE; +#if !defined (ARRAY_VARS) + rflags |= REG_NOSUB; +#endif + + if (regcomp (®ex, pattern, rflags)) + return 2; /* flag for printing a warning here. */ + +#if defined (ARRAY_VARS) + matches = (regmatch_t *)malloc (sizeof (regmatch_t) * (regex.re_nsub + 1)); +#else + matches = NULL; +#endif + + if (regexec (®ex, string, regex.re_nsub + 1, matches, 0)) + result = EXECUTION_FAILURE; + else + result = EXECUTION_SUCCESS; /* match */ + +#if defined (ARRAY_VARS) + subexp_len = strlen (string) + 10; + subexp_str = malloc (subexp_len + 1); + + /* Store the parenthesized subexpressions in the array BASH_REMATCH. + Element 0 is the portion that matched the entire regexp. Element 1 + is the part that matched the first subexpression, and so on. */ + unbind_variable ("BASH_REMATCH"); + rematch = make_new_array_variable ("BASH_REMATCH"); + amatch = array_cell (rematch); + + if ((flags & SHMAT_SUBEXP) && result == EXECUTION_SUCCESS && subexp_str) + { + for (subexp_ind = 0; subexp_ind <= regex.re_nsub; subexp_ind++) + { + memset (subexp_str, 0, subexp_len); + strncpy (subexp_str, string + matches[subexp_ind].rm_so, + matches[subexp_ind].rm_eo - matches[subexp_ind].rm_so); + array_insert (amatch, subexp_ind, subexp_str); + } + } + + VSETATTR (rematch, att_readonly); + + free (subexp_str); + free (matches); +#endif /* ARRAY_VARS */ + + regfree (®ex); + + return result; +} + +#endif /* HAVE_POSIX_REGEXP */ diff --git a/lib/sh/shmbchar.c b/lib/sh/shmbchar.c new file mode 100644 index 0000000..042c9f1 --- /dev/null +++ b/lib/sh/shmbchar.c @@ -0,0 +1,113 @@ +/* Copyright (C) 2001, 2006, 2009, 2010, 2012 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + + +#include + +#if defined (HANDLE_MULTIBYTE) +#include +#include + +#include +#include + +#if IS_BASIC_ASCII + +/* Bit table of characters in the ISO C "basic character set". */ +const unsigned int is_basic_table [UCHAR_MAX / 32 + 1] = +{ + 0x00001a00, /* '\t' '\v' '\f' */ + 0xffffffef, /* ' '...'#' '%'...'?' */ + 0xfffffffe, /* 'A'...'Z' '[' '\\' ']' '^' '_' */ + 0x7ffffffe /* 'a'...'z' '{' '|' '}' '~' */ + /* The remaining bits are 0. */ +}; + +#endif /* IS_BASIC_ASCII */ + +size_t +mbstrlen (s) + const char *s; +{ + size_t clen, nc; + mbstate_t mbs = { 0 }, mbsbak = { 0 }; + int f; + + nc = 0; + while (*s && (clen = (f = is_basic (*s)) ? 1 : mbrlen(s, MB_CUR_MAX, &mbs)) != 0) + { + if (MB_INVALIDCH(clen)) + { + clen = 1; /* assume single byte */ + mbs = mbsbak; + } + + if (f == 0) + mbsbak = mbs; + + s += clen; + nc++; + } + return nc; +} + +/* Return pointer to first multibyte char in S, or NULL if none. */ +char * +mbsmbchar (s) + const char *s; +{ + char *t; + size_t clen; + mbstate_t mbs = { 0 }; + + for (t = (char *)s; *t; t++) + { + if (is_basic (*t)) + continue; + + clen = mbrlen (t, MB_CUR_MAX, &mbs); + + if (clen == 0) + return 0; + if (MB_INVALIDCH(clen)) + continue; + + if (clen > 1) + return t; + } + return 0; +} + +int +sh_mbsnlen(src, srclen, maxlen) + const char *src; + size_t srclen; + int maxlen; +{ + int count; + int sind; + DECLARE_MBSTATE; + + for (sind = count = 0; src[sind]; ) + { + count++; /* number of multibyte characters */ + ADVANCE_CHAR (src, srclen, sind); + if (sind > maxlen) + break; + } + + return count; +} +#endif diff --git a/lib/sh/shquote.c b/lib/sh/shquote.c new file mode 100644 index 0000000..fff4f81 --- /dev/null +++ b/lib/sh/shquote.c @@ -0,0 +1,327 @@ +/* shquote - functions to quote and dequote strings */ + +/* Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include + +#include "syntax.h" +#include + +/* Default set of characters that should be backslash-quoted in strings */ +static const char bstab[256] = + { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 0, 0, 0, 0, 0, /* TAB, NL */ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 1, 1, 1, 0, 1, 0, 1, 1, /* SPACE, !, DQUOTE, DOL, AMP, SQUOTE */ + 1, 1, 1, 0, 1, 0, 0, 0, /* LPAR, RPAR, STAR, COMMA */ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 0, 1, 1, /* SEMI, LESSTHAN, GREATERTHAN, QUEST */ + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 1, 0, /* LBRACK, BS, RBRACK, CARAT */ + + 1, 0, 0, 0, 0, 0, 0, 0, /* BACKQ */ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 0, 0, /* LBRACE, BAR, RBRACE */ + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + }; + +/* **************************************************************** */ +/* */ +/* Functions for quoting strings to be re-read as input */ +/* */ +/* **************************************************************** */ + +/* Return a new string which is the single-quoted version of STRING. + Used by alias and trap, among others. */ +char * +sh_single_quote (string) + const char *string; +{ + register int c; + char *result, *r; + const char *s; + + result = (char *)xmalloc (3 + (4 * strlen (string))); + r = result; + + if (string[0] == '\'' && string[1] == 0) + { + *r++ = '\\'; + *r++ = '\''; + *r++ = 0; + return result; + } + + *r++ = '\''; + + for (s = string; s && (c = *s); s++) + { + *r++ = c; + + if (c == '\'') + { + *r++ = '\\'; /* insert escaped single quote */ + *r++ = '\''; + *r++ = '\''; /* start new quoted string */ + } + } + + *r++ = '\''; + *r = '\0'; + + return (result); +} + +/* Quote STRING using double quotes. Return a new string. */ +char * +sh_double_quote (string) + const char *string; +{ + register unsigned char c; + char *result, *r; + const char *s; + + result = (char *)xmalloc (3 + (2 * strlen (string))); + r = result; + *r++ = '"'; + + for (s = string; s && (c = *s); s++) + { + /* Backslash-newline disappears within double quotes, so don't add one. */ + if ((sh_syntaxtab[c] & CBSDQUOTE) && c != '\n') + *r++ = '\\'; + else if (c == CTLESC || c == CTLNUL) + *r++ = CTLESC; /* could be '\\'? */ + + *r++ = c; + } + + *r++ = '"'; + *r = '\0'; + + return (result); +} + +/* Turn S into a simple double-quoted string. If FLAGS is non-zero, quote + double quote characters in S with backslashes. */ +char * +sh_mkdoublequoted (s, slen, flags) + const char *s; + int slen, flags; +{ + char *r, *ret; + int rlen; + + rlen = (flags == 0) ? slen + 3 : (2 * slen) + 1; + ret = r = (char *)xmalloc (rlen); + + *r++ = '"'; + while (*s) + { + if (flags && *s == '"') + *r++ = '\\'; + *r++ = *s++; + } + *r++ = '"'; + *r = '\0'; + + return ret; +} + +/* Remove backslashes that are quoting characters that are special between + double quotes. Return a new string. XXX - should this handle CTLESC + and CTLNUL? */ +char * +sh_un_double_quote (string) + char *string; +{ + register int c, pass_next; + char *result, *r, *s; + + r = result = (char *)xmalloc (strlen (string) + 1); + + for (pass_next = 0, s = string; s && (c = *s); s++) + { + if (pass_next) + { + *r++ = c; + pass_next = 0; + continue; + } + if (c == '\\' && (sh_syntaxtab[(unsigned char) s[1]] & CBSDQUOTE)) + { + pass_next = 1; + continue; + } + *r++ = c; + } + + *r = '\0'; + return result; +} + +/* Quote special characters in STRING using backslashes. Return a new + string. NOTE: if the string is to be further expanded, we need a + way to protect the CTLESC and CTLNUL characters. As I write this, + the current callers will never cause the string to be expanded without + going through the shell parser, which will protect the internal + quoting characters. TABLE, if set, points to a map of the ascii code + set with char needing to be backslash-quoted if table[char]==1. FLAGS, + if 1, causes tildes to be quoted as well. */ + +char * +sh_backslash_quote (string, table, flags) + char *string; + char *table; + int flags; +{ + int c; + char *result, *r, *s, *backslash_table; + + result = (char *)xmalloc (2 * strlen (string) + 1); + + backslash_table = table ? table : (char *)bstab; + for (r = result, s = string; s && (c = *s); s++) + { + if (backslash_table[c] == 1) + *r++ = '\\'; + else if (c == '#' && s == string) /* comment char */ + *r++ = '\\'; + else if ((flags&1) && c == '~' && (s == string || s[-1] == ':' || s[-1] == '=')) + /* Tildes are special at the start of a word or after a `:' or `=' + (technically unquoted, but it doesn't make a difference in practice) */ + *r++ = '\\'; + *r++ = c; + } + + *r = '\0'; + return (result); +} + +#if defined (PROMPT_STRING_DECODE) +/* Quote characters that get special treatment when in double quotes in STRING + using backslashes. Return a new string. */ +char * +sh_backslash_quote_for_double_quotes (string) + char *string; +{ + unsigned char c; + char *result, *r, *s; + + result = (char *)xmalloc (2 * strlen (string) + 1); + + for (r = result, s = string; s && (c = *s); s++) + { + if (sh_syntaxtab[c] & CBSDQUOTE) + *r++ = '\\'; + /* I should probably add flags for these to sh_syntaxtab[] */ + else if (c == CTLESC || c == CTLNUL) + *r++ = CTLESC; /* could be '\\'? */ + + *r++ = c; + } + + *r = '\0'; + return (result); +} +#endif /* PROMPT_STRING_DECODE */ + +int +sh_contains_shell_metas (string) + char *string; +{ + char *s; + + for (s = string; s && *s; s++) + { + switch (*s) + { + case ' ': case '\t': case '\n': /* IFS white space */ + case '\'': case '"': case '\\': /* quoting chars */ + case '|': case '&': case ';': /* shell metacharacters */ + case '(': case ')': case '<': case '>': + case '!': case '{': case '}': /* reserved words */ + case '*': case '[': case '?': case ']': /* globbing chars */ + case '^': + case '$': case '`': /* expansion chars */ + return (1); + case '~': /* tilde expansion */ + if (s == string || s[-1] == '=' || s[-1] == ':') + return (1); + break; + case '#': + if (s == string) /* comment char */ + return (1); + /* FALLTHROUGH */ + default: + break; + } + } + + return (0); +} + +int +sh_contains_quotes (string) + char *string; +{ + char *s; + + for (s = string; s && *s; s++) + { + if (*s == '\'' || *s == '"' || *s == '\\') + return 1; + } + return 0; +} diff --git a/lib/sh/shtty.c b/lib/sh/shtty.c new file mode 100644 index 0000000..0433f5e --- /dev/null +++ b/lib/sh/shtty.c @@ -0,0 +1,330 @@ +/* + * shtty.c -- abstract interface to the terminal, focusing on capabilities. + */ + +/* Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifdef HAVE_UNISTD_H +# include +#endif + +#include + +static TTYSTRUCT ttin, ttout; +static int ttsaved = 0; + +int +ttgetattr(fd, ttp) +int fd; +TTYSTRUCT *ttp; +{ +#ifdef TERMIOS_TTY_DRIVER + return tcgetattr(fd, ttp); +#else +# ifdef TERMIO_TTY_DRIVER + return ioctl(fd, TCGETA, ttp); +# else + return ioctl(fd, TIOCGETP, ttp); +# endif +#endif +} + +int +ttsetattr(fd, ttp) +int fd; +TTYSTRUCT *ttp; +{ +#ifdef TERMIOS_TTY_DRIVER + return tcsetattr(fd, TCSADRAIN, ttp); +#else +# ifdef TERMIO_TTY_DRIVER + return ioctl(fd, TCSETAW, ttp); +# else + return ioctl(fd, TIOCSETN, ttp); +# endif +#endif +} + +void +ttsave() +{ + if (ttsaved) + return; + ttgetattr (0, &ttin); + ttgetattr (1, &ttout); + ttsaved = 1; +} + +void +ttrestore() +{ + if (ttsaved == 0) + return; + ttsetattr (0, &ttin); + ttsetattr (1, &ttout); + ttsaved = 0; +} + +/* Retrieve the internally-saved attributes associated with tty fd FD. */ +TTYSTRUCT * +ttattr (fd) + int fd; +{ + if (ttsaved == 0) + return ((TTYSTRUCT *)0); + if (fd == 0) + return &ttin; + else if (fd == 1) + return &ttout; + else + return ((TTYSTRUCT *)0); +} + +/* + * Change attributes in ttp so that when it is installed using + * ttsetattr, the terminal will be in one-char-at-a-time mode. + */ +int +tt_setonechar(ttp) + TTYSTRUCT *ttp; +{ +#if defined (TERMIOS_TTY_DRIVER) || defined (TERMIO_TTY_DRIVER) + + /* XXX - might not want this -- it disables erase and kill processing. */ + ttp->c_lflag &= ~ICANON; + + ttp->c_lflag |= ISIG; +# ifdef IEXTEN + ttp->c_lflag |= IEXTEN; +# endif + + ttp->c_iflag |= ICRNL; /* make sure we get CR->NL on input */ + ttp->c_iflag &= ~INLCR; /* but no NL->CR */ + +# ifdef OPOST + ttp->c_oflag |= OPOST; +# endif +# ifdef ONLCR + ttp->c_oflag |= ONLCR; +# endif +# ifdef OCRNL + ttp->c_oflag &= ~OCRNL; +# endif +# ifdef ONOCR + ttp->c_oflag &= ~ONOCR; +# endif +# ifdef ONLRET + ttp->c_oflag &= ~ONLRET; +# endif + + ttp->c_cc[VMIN] = 1; + ttp->c_cc[VTIME] = 0; + +#else + + ttp->sg_flags |= CBREAK; + +#endif + + return 0; +} + +/* Set the tty associated with FD and TTP into one-character-at-a-time mode */ +int +ttfd_onechar (fd, ttp) + int fd; + TTYSTRUCT *ttp; +{ + if (tt_setonechar(ttp) < 0) + return -1; + return (ttsetattr (fd, ttp)); +} + +/* Set the terminal into one-character-at-a-time mode */ +int +ttonechar () +{ + TTYSTRUCT tt; + + if (ttsaved == 0) + return -1; + tt = ttin; + return (ttfd_onechar (0, &tt)); +} + +/* + * Change attributes in ttp so that when it is installed using + * ttsetattr, the terminal will be in no-echo mode. + */ +int +tt_setnoecho(ttp) + TTYSTRUCT *ttp; +{ +#if defined (TERMIOS_TTY_DRIVER) || defined (TERMIO_TTY_DRIVER) + ttp->c_lflag &= ~(ECHO|ECHOK|ECHONL); +#else + ttp->sg_flags &= ~ECHO; +#endif + + return 0; +} + +/* Set the tty associated with FD and TTP into no-echo mode */ +int +ttfd_noecho (fd, ttp) + int fd; + TTYSTRUCT *ttp; +{ + if (tt_setnoecho (ttp) < 0) + return -1; + return (ttsetattr (fd, ttp)); +} + +/* Set the terminal into no-echo mode */ +int +ttnoecho () +{ + TTYSTRUCT tt; + + if (ttsaved == 0) + return -1; + tt = ttin; + return (ttfd_noecho (0, &tt)); +} + +/* + * Change attributes in ttp so that when it is installed using + * ttsetattr, the terminal will be in eight-bit mode (pass8). + */ +int +tt_seteightbit (ttp) + TTYSTRUCT *ttp; +{ +#if defined (TERMIOS_TTY_DRIVER) || defined (TERMIO_TTY_DRIVER) + ttp->c_iflag &= ~ISTRIP; + ttp->c_cflag |= CS8; + ttp->c_cflag &= ~PARENB; +#else + ttp->sg_flags |= ANYP; +#endif + + return 0; +} + +/* Set the tty associated with FD and TTP into eight-bit mode */ +int +ttfd_eightbit (fd, ttp) + int fd; + TTYSTRUCT *ttp; +{ + if (tt_seteightbit (ttp) < 0) + return -1; + return (ttsetattr (fd, ttp)); +} + +/* Set the terminal into eight-bit mode */ +int +tteightbit () +{ + TTYSTRUCT tt; + + if (ttsaved == 0) + return -1; + tt = ttin; + return (ttfd_eightbit (0, &tt)); +} + +/* + * Change attributes in ttp so that when it is installed using + * ttsetattr, the terminal will be in non-canonical input mode. + */ +int +tt_setnocanon (ttp) + TTYSTRUCT *ttp; +{ +#if defined (TERMIOS_TTY_DRIVER) || defined (TERMIO_TTY_DRIVER) + ttp->c_lflag &= ~ICANON; +#endif + + return 0; +} + +/* Set the tty associated with FD and TTP into non-canonical mode */ +int +ttfd_nocanon (fd, ttp) + int fd; + TTYSTRUCT *ttp; +{ + if (tt_setnocanon (ttp) < 0) + return -1; + return (ttsetattr (fd, ttp)); +} + +/* Set the terminal into non-canonical mode */ +int +ttnocanon () +{ + TTYSTRUCT tt; + + if (ttsaved == 0) + return -1; + tt = ttin; + return (ttfd_nocanon (0, &tt)); +} + +/* + * Change attributes in ttp so that when it is installed using + * ttsetattr, the terminal will be in cbreak, no-echo mode. + */ +int +tt_setcbreak(ttp) + TTYSTRUCT *ttp; +{ + if (tt_setonechar (ttp) < 0) + return -1; + return (tt_setnoecho (ttp)); +} + +/* Set the tty associated with FD and TTP into cbreak (no-echo, + one-character-at-a-time) mode */ +int +ttfd_cbreak (fd, ttp) + int fd; + TTYSTRUCT *ttp; +{ + if (tt_setcbreak (ttp) < 0) + return -1; + return (ttsetattr (fd, ttp)); +} + +/* Set the terminal into cbreak (no-echo, one-character-at-a-time) mode */ +int +ttcbreak () +{ + TTYSTRUCT tt; + + if (ttsaved == 0) + return -1; + tt = ttin; + return (ttfd_cbreak (0, &tt)); +} diff --git a/lib/sh/snprintf.c b/lib/sh/snprintf.c new file mode 100644 index 0000000..87ca217 --- /dev/null +++ b/lib/sh/snprintf.c @@ -0,0 +1,2219 @@ +/* snprintf - formatted output to strings, with bounds checking and allocation */ + +/* + build a test version with + gcc -g -DDRIVER -I../.. -I../../include -o test-snprintf snprintf.c fmtu*long.o +*/ + +/* + Unix snprintf implementation. + derived from inetutils/libinetutils/snprintf.c Version 1.1 + + Copyright (C) 2001,2006,2010,2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . + + Original (pre-bash) Revision History: + + 1.1: + * added changes from Miles Bader + * corrected a bug with %f + * added support for %#g + * added more comments :-) + 1.0: + * supporting must ANSI syntaxic_sugars + 0.0: + * support %s %c %d + + THANKS(for the patches and ideas): + Miles Bader + Cyrille Rustom + Jacek Slabocewiz + Mike Parker(mouse) + +*/ + +/* + * Currently doesn't handle (and bash/readline doesn't use): + * * *M$ width, precision specifications + * * %N$ numbered argument conversions + * * support for `F' is imperfect with ldfallback(), since underlying + * printf may not handle it -- should ideally have another autoconf test + */ + +#define FLOATING_POINT + +#ifdef HAVE_CONFIG_H +# include +#endif + +/* GCC 4.2 on Snow Leopard doesn't like the snprintf prototype */ +#if defined(DEBUG) && !defined (MACOSX) +# undef HAVE_SNPRINTF +# undef HAVE_ASPRINTF + +# define HAVE_SNPRINTF 0 +# define HAVE_ASPRINTF 0 +#endif + +#if defined(DRIVER) && !defined(HAVE_CONFIG_H) +#define HAVE_LONG_LONG +#define HAVE_LONG_DOUBLE +#ifdef __linux__ +#define HAVE_PRINTF_A_FORMAT +#endif +#define HAVE_ISINF_IN_LIBC +#define HAVE_ISNAN_IN_LIBC +#define PREFER_STDARG +#define HAVE_STRINGIZE +#define HAVE_LIMITS_H +#define HAVE_STDDEF_H +#define HAVE_LOCALE_H +#define intmax_t long +#endif + +#if !HAVE_SNPRINTF || !HAVE_ASPRINTF + +#include + +#if defined(PREFER_STDARG) +# include +#else +# include +#endif + +#ifdef HAVE_LIMITS_H +# include +#endif +#include +#ifdef HAVE_STDDEF_H +# include +#endif +#include + +#ifdef HAVE_STDINT_H +# include +#endif + +#ifdef FLOATING_POINT +# include /* for manifest constants */ +# include /* for sprintf */ +#endif + +#include + +#ifdef HAVE_LOCALE_H +# include +#endif + +#include "stdc.h" +#include + +#ifndef DRIVER +# include "shell.h" +#else +# define FL_PREFIX 0x01 /* add 0x, 0X, or 0 prefix as appropriate */ +# define FL_ADDBASE 0x02 /* add base# prefix to converted value */ +# define FL_HEXUPPER 0x04 /* use uppercase when converting to hex */ +# define FL_UNSIGNED 0x08 /* don't add any sign */ +extern char *fmtulong __P((unsigned long int, int, char *, size_t, int)); +extern char *fmtullong __P((unsigned long long int, int, char *, size_t, int)); +#endif + +#ifndef FREE +# define FREE(x) if (x) free (x) +#endif + +/* Bound on length of the string representing an integer value of type T. + Subtract one for the sign bit if T is signed; + 302 / 1000 is log10 (2) rounded up; + add one for integer division truncation; + add one more for a minus sign if t is signed. */ +#define INT_STRLEN_BOUND(t) \ + ((sizeof (t) * CHAR_BIT - TYPE_SIGNED (t)) * 302 / 1000 \ + + 1 + TYPE_SIGNED (t)) + +/* conversion flags */ +#define PF_ALTFORM 0x00001 /* # */ +#define PF_HEXPREFIX 0x00002 /* 0[Xx] */ +#define PF_LADJUST 0x00004 /* - */ +#define PF_ZEROPAD 0x00008 /* 0 */ +#define PF_PLUS 0x00010 /* + */ +#define PF_SPACE 0x00020 /* ' ' */ +#define PF_THOUSANDS 0x00040 /* ' */ + +#define PF_DOT 0x00080 /* `.precision' */ +#define PF_STAR_P 0x00100 /* `*' after precision */ +#define PF_STAR_W 0x00200 /* `*' before or without precision */ + +/* length modifiers */ +#define PF_SIGNEDCHAR 0x00400 /* hh */ +#define PF_SHORTINT 0x00800 /* h */ +#define PF_LONGINT 0x01000 /* l */ +#define PF_LONGLONG 0x02000 /* ll */ +#define PF_LONGDBL 0x04000 /* L */ +#define PF_INTMAX_T 0x08000 /* j */ +#define PF_SIZE_T 0x10000 /* z */ +#define PF_PTRDIFF_T 0x20000 /* t */ + +#define PF_ALLOCBUF 0x40000 /* for asprintf, vasprintf */ + +#define PFM_SN 0x01 /* snprintf, vsnprintf */ +#define PFM_AS 0x02 /* asprintf, vasprintf */ + +#define ASBUFSIZE 128 + +#define x_digs "0123456789abcdef" +#define X_digs "0123456789ABCDEF" + +static char intbuf[INT_STRLEN_BOUND(unsigned long) + 1]; + +static int decpoint; +static int thoussep; +static char *grouping; + +/* + * For the FLOATING POINT FORMAT : + * the challenge was finding a way to + * manipulate the Real numbers without having + * to resort to mathematical function(it + * would require to link with -lm) and not + * going down to the bit pattern(not portable) + * + * so a number, a real is: + + real = integral + fraction + + integral = ... + a(2)*10^2 + a(1)*10^1 + a(0)*10^0 + fraction = b(1)*10^-1 + b(2)*10^-2 + ... + + where: + 0 <= a(i) => 9 + 0 <= b(i) => 9 + + from then it was simple math + */ + +/* + * size of the buffer for the integral part + * and the fraction part + */ +#define MAX_INT 99 + 1 /* 1 for the null */ +#define MAX_FRACT 307 + 1 + +/* + * These functions use static buffers to store the results, + * and so are not reentrant + */ +#define itoa(n) fmtulong(n, 10, intbuf, sizeof(intbuf), 0); +#define dtoa(n, p, f) numtoa(n, 10, p, f) + +#define SWAP_INT(a,b) {int t; t = (a); (a) = (b); (b) = t;} + +#define GETARG(type) (va_arg(args, type)) + +/* Macros that do proper sign extension and handle length modifiers. Used + for the integer conversion specifiers. */ +#define GETSIGNED(p) \ + (((p)->flags & PF_LONGINT) \ + ? GETARG (long) \ + : (((p)->flags & PF_SHORTINT) ? (long)(short)GETARG (int) \ + : (long)GETARG (int))) + +#define GETUNSIGNED(p) \ + (((p)->flags & PF_LONGINT) \ + ? GETARG (unsigned long) \ + : (((p)->flags & PF_SHORTINT) ? (unsigned long)(unsigned short)GETARG (int) \ + : (unsigned long)GETARG (unsigned int))) + + +#ifdef HAVE_LONG_DOUBLE +#define GETLDOUBLE(p) GETARG (long double) +#endif +#define GETDOUBLE(p) GETARG (double) + +#define SET_SIZE_FLAGS(p, type) \ + if (sizeof (type) > sizeof (int)) \ + (p)->flags |= PF_LONGINT; \ + if (sizeof (type) > sizeof (long)) \ + (p)->flags |= PF_LONGLONG; + +/* this struct holds everything we need */ +struct DATA +{ + int length; + char *base; /* needed for [v]asprintf */ + char *holder; + int counter; + const char *pf; + +/* FLAGS */ + int flags; + int justify; + int width, precision; + char pad; +}; + +/* the floating point stuff */ +#ifdef FLOATING_POINT +static double pow_10 __P((int)); +static int log_10 __P((double)); +static double integral __P((double, double *)); +static char *numtoa __P((double, int, int, char **)); +#endif + +static void init_data __P((struct DATA *, char *, size_t, const char *, int)); +static void init_conv_flag __P((struct DATA *)); + +/* for the format */ +#ifdef FLOATING_POINT +static void floating __P((struct DATA *, double)); +static void exponent __P((struct DATA *, double)); +#endif +static void number __P((struct DATA *, unsigned long, int)); +#ifdef HAVE_LONG_LONG +static void lnumber __P((struct DATA *, unsigned long long, int)); +#endif +static void pointer __P((struct DATA *, unsigned long)); +static void strings __P((struct DATA *, char *)); + +#ifdef FLOATING_POINT +# define FALLBACK_FMTSIZE 32 +# define FALLBACK_BASE 4096 +# define LFALLBACK_BASE 5120 +# ifdef HAVE_LONG_DOUBLE +static void ldfallback __P((struct DATA *, const char *, const char *, long double)); +# endif +static void dfallback __P((struct DATA *, const char *, const char *, double)); +#endif + +static char *groupnum __P((char *)); + +#if defined (HAVE_LONG_DOUBLE) +# define LONGDOUBLE long double +#else +# define LONGDOUBLE double +#endif + +#ifndef isnan + static inline int isnan_f (float x) { return x != x; } + static inline int isnan_d (double x) { return x != x; } + static inline int isnan_ld (LONGDOUBLE x) { return x != x; } + # define isnan(x) \ + (sizeof (x) == sizeof (LONGDOUBLE) ? isnan_ld (x) \ + : sizeof (x) == sizeof (double) ? isnan_d (x) \ + : isnan_f (x)) +#endif + +#ifndef isinf + static inline int isinf_f (float x) { return !isnan (x) && isnan (x - x); } + static inline int isinf_d (double x) { return !isnan (x) && isnan (x - x); } + static inline int isinf_ld (LONGDOUBLE x) { return !isnan (x) && isnan (x - x); } + # define isinf(x) \ + (sizeof (x) == sizeof (LONGDOUBLE) ? isinf_ld (x) \ + : sizeof (x) == sizeof (double) ? isinf_d (x) \ + : isinf_f (x)) +#endif + +#ifdef DRIVER +static void memory_error_and_abort (); +static void *xmalloc __P((size_t)); +static void *xrealloc __P((void *, size_t)); +static void xfree __P((void *)); +#else +# include +#endif + +/* those are defines specific to snprintf to hopefully + * make the code clearer :-) + */ +#define RIGHT 1 +#define LEFT 0 +#define NOT_FOUND -1 +#define FOUND 1 +#define MAX_FIELD 15 + +/* round off to the precision */ +#define ROUND(d, p) \ + (d < 0.) ? \ + d - pow_10(-(p)->precision) * 0.5 : \ + d + pow_10(-(p)->precision) * 0.5 + +/* set default precision */ +#define DEF_PREC(p) \ + if ((p)->precision == NOT_FOUND) \ + (p)->precision = 6 + +/* put a char. increment the number of chars written even if we've exceeded + the vsnprintf/snprintf buffer size (for the return value) */ +#define PUT_CHAR(c, p) \ + do \ + { \ + if (((p)->flags & PF_ALLOCBUF) && ((p)->counter >= (p)->length - 1)) \ + { \ + (p)->length += ASBUFSIZE; \ + (p)->base = (char *)xrealloc((p)->base, (p)->length); \ + (p)->holder = (p)->base + (p)->counter; /* in case reallocated */ \ + } \ + if ((p)->counter < (p)->length) \ + *(p)->holder++ = (c); \ + (p)->counter++; \ + } \ + while (0) + +/* Output a string. P->WIDTH has already been adjusted for padding. */ +#define PUT_STRING(string, len, p) \ + do \ + { \ + PAD_RIGHT (p); \ + while ((len)-- > 0) \ + { \ + PUT_CHAR (*(string), (p)); \ + (string)++; \ + } \ + PAD_LEFT (p); \ + } \ + while (0) + +#define PUT_PLUS(d, p, zero) \ + if (((p)->flags & PF_PLUS) && (d) > zero) \ + PUT_CHAR('+', p) + +#define PUT_SPACE(d, p, zero) \ + if (((p)->flags & PF_SPACE) && (d) > zero) \ + PUT_CHAR(' ', p) + +/* pad right */ +#define PAD_RIGHT(p) \ + if ((p)->width > 0 && (p)->justify != LEFT) \ + for (; (p)->width > 0; (p)->width--) \ + PUT_CHAR((p)->pad, p) + +/* pad left */ +#define PAD_LEFT(p) \ + if ((p)->width > 0 && (p)->justify == LEFT) \ + for (; (p)->width > 0; (p)->width--) \ + PUT_CHAR((p)->pad, p) + +/* pad with zeros from decimal precision */ +#define PAD_ZERO(p) \ + if ((p)->precision > 0) \ + for (; (p)->precision > 0; (p)->precision--) \ + PUT_CHAR('0', p) + +/* if width and prec. in the args */ +#define STAR_ARGS(p) \ + do { \ + if ((p)->flags & PF_STAR_W) \ + { \ + (p)->width = GETARG (int); \ + if ((p)->width < 0) \ + { \ + (p)->flags |= PF_LADJUST; \ + (p)->justify = LEFT; \ + (p)->width = -(p)->width; \ + } \ + } \ + if ((p)->flags & PF_STAR_P) \ + { \ + (p)->precision = GETARG (int); \ + if ((p)->precision < 0) \ + { \ + (p)->flags &= ~PF_STAR_P; \ + (p)->precision = NOT_FOUND; \ + } \ + } \ + } while (0) + +#if defined (HAVE_LOCALE_H) && defined (HAVE_LOCALECONV) +# define GETLOCALEDATA(d, t, g) \ + do \ + { \ + struct lconv *lv; \ + if ((d) == 0) { \ + (d) = '.'; (t) = -1; (g) = 0; /* defaults */ \ + lv = localeconv(); \ + if (lv) \ + { \ + if (lv->decimal_point && lv->decimal_point[0]) \ + (d) = lv->decimal_point[0]; \ + if (lv->thousands_sep && lv->thousands_sep[0]) \ + (t) = lv->thousands_sep[0]; \ + (g) = lv->grouping ? lv->grouping : ""; \ + if (*(g) == '\0' || *(g) == CHAR_MAX || (t) == -1) (g) = 0; \ + } \ + } \ + } \ + while (0); +#else +# define GETLOCALEDATA(d, t, g) \ + ( (d) = '.', (t) = ',', g = "\003" ) +#endif + +#ifdef FLOATING_POINT +/* + * Find the nth power of 10 + */ +static double +pow_10(n) + int n; +{ + double P; + + /* handle common cases with fast switch statement. */ + switch (n) + { + case -3: return .001; + case -2: return .01; + case -1: return .1; + case 0: return 1.; + case 1: return 10.; + case 2: return 100.; + case 3: return 1000.; + } + + if (n < 0) + { + P = .0001; + for (n += 4; n < 0; n++) + P /= 10.; + } + else + { + P = 10000.; + for (n -= 4; n > 0; n--) + P *= 10.; + } + + return P; +} + +/* + * Find the integral part of the log in base 10 + * Note: this not a real log10() + I just need and approximation(integerpart) of x in: + 10^x ~= r + * log_10(200) = 2; + * log_10(250) = 2; + * + * NOTE: do not call this with r == 0 -- an infinite loop results. + */ +static int +log_10(r) + double r; +{ + int i = 0; + double result = 1.; + + if (r < 0.) + r = -r; + + if (r < 1.) + { + while (result >= r) + { + result /= 10.; + i++; + } + return (-i); + } + else + { + while (result <= r) + { + result *= 10.; + i++; + } + return (i - 1); + } +} + +/* + * This function return the fraction part of a double + * and set in ip the integral part. + * In many ways it resemble the modf() found on most Un*x + */ +static double +integral(real, ip) + double real; + double *ip; +{ + int j; + double i, s, p; + double real_integral = 0.; + + /* take care of the obvious */ + /* equal to zero ? */ + if (real == 0.) + { + *ip = 0.; + return (0.); + } + + /* negative number ? */ + if (real < 0.) + real = -real; + + /* a fraction ? */ + if ( real < 1.) + { + *ip = 0.; + return real; + } + + /* the real work :-) */ + for (j = log_10(real); j >= 0; j--) + { + p = pow_10(j); + s = (real - real_integral)/p; + i = 0.; + while (i + 1. <= s) + i++; + real_integral += i*p; + } + *ip = real_integral; + return (real - real_integral); +} + +#define PRECISION 1.e-6 +/* + * return an ascii representation of the integral part of the number + * and set fract to be an ascii representation of the fraction part + * the container for the fraction and the integral part or statically + * declare with fix size + */ +static char * +numtoa(number, base, precision, fract) + double number; + int base, precision; + char **fract; +{ + register int i, j; + double ip, fp; /* integer and fraction part */ + double fraction; + int digits, sign; + static char integral_part[MAX_INT]; + static char fraction_part[MAX_FRACT]; + int ch; + + /* taking care of the obvious case: 0.0 */ + if (number == 0.) + { + integral_part[0] = '0'; + integral_part[1] = '\0'; + /* The fractional part has to take the precision into account */ + for (ch = 0; ch < precision-1; ch++) + fraction_part[ch] = '0'; + fraction_part[ch] = '0'; + fraction_part[ch+1] = '\0'; + if (fract) + *fract = fraction_part; + return integral_part; + } + + /* -0 is tricky */ + sign = (number == -0.) ? '-' : ((number < 0.) ? '-' : '+'); + digits = MAX_INT - 1; + + /* for negative numbers */ + if (sign == '-') + { + number = -number; + digits--; /* sign consume one digit */ + } + + fraction = integral(number, &ip); + number = ip; + + /* do the integral part */ + if (ip == 0.) + { + integral_part[0] = '0'; + i = 1; + } + else + { + for ( i = 0; i < digits && number != 0.; ++i) + { + number /= base; + fp = integral(number, &ip); + ch = (int)((fp + PRECISION)*base); /* force to round */ + integral_part[i] = (ch <= 9) ? ch + '0' : ch + 'a' - 10; + if (! ISXDIGIT((unsigned char)integral_part[i])) + break; /* bail out overflow !! */ + number = ip; + } + } + + /* Oh No !! out of bound, ho well fill it up ! */ + if (number != 0.) + for (i = 0; i < digits; ++i) + integral_part[i] = '9'; + + /* put the sign ? */ + if (sign == '-') + integral_part[i++] = '-'; + + integral_part[i] = '\0'; + + /* reverse every thing */ + for ( i--, j = 0; j < i; j++, i--) + SWAP_INT(integral_part[i], integral_part[j]); + + /* the fractional part */ + for (i=0, fp=fraction; precision > 0 && i < MAX_FRACT ; i++, precision--) + { + fraction_part[i] = (int)((fp + PRECISION)*10. + '0'); + if (! DIGIT(fraction_part[i])) /* underflow ? */ + break; + fp = (fp*10.0) - (double)(long)((fp + PRECISION)*10.); + } + fraction_part[i] = '\0'; + + if (fract != (char **)0) + *fract = fraction_part; + + return integral_part; +} +#endif + +/* for %d and friends, it puts in holder + * the representation with the right padding + */ +static void +number(p, d, base) + struct DATA *p; + unsigned long d; + int base; +{ + char *tmp, *t; + long sd; + int flags; + + /* An explicit precision turns off the zero-padding flag and sets the + pad character back to space. */ + if ((p->flags & PF_ZEROPAD) && p->precision >= 0 && (p->flags & PF_DOT)) + { + p->flags &= ~PF_ZEROPAD; + p->pad = ' '; + } + + sd = d; /* signed for ' ' padding in base 10 */ + flags = 0; + flags = (*p->pf == 'x' || *p->pf == 'X' || *p->pf == 'o' || *p->pf == 'u' || *p->pf == 'U') ? FL_UNSIGNED : 0; + if (*p->pf == 'X') + flags |= FL_HEXUPPER; + + tmp = fmtulong (d, base, intbuf, sizeof(intbuf), flags); + t = 0; + if ((p->flags & PF_THOUSANDS)) + { + GETLOCALEDATA(decpoint, thoussep, grouping); + if (grouping && (t = groupnum (tmp))) + tmp = t; + } + + /* need to add one for any `+', but we only add one in base 10 */ + p->width -= strlen(tmp) + (base == 10 && d > 0 && (p->flags & PF_PLUS)); + PAD_RIGHT(p); + + if ((p->flags & PF_DOT) && p->precision > 0) + { + p->precision -= strlen(tmp); + PAD_ZERO(p); + } + + switch (base) + { + case 10: + PUT_PLUS(sd, p, 0); + PUT_SPACE(sd, p, 0); + break; + case 8: + if (p->flags & PF_ALTFORM) + PUT_CHAR('0', p); + break; + case 16: + if (p->flags & PF_ALTFORM) + { + PUT_CHAR('0', p); + PUT_CHAR(*p->pf, p); + } + break; + } + + while (*tmp) + { + PUT_CHAR(*tmp, p); + tmp++; + } + + PAD_LEFT(p); + FREE (t); +} + +#ifdef HAVE_LONG_LONG +/* + * identical to number() but works for `long long' + */ +static void +lnumber(p, d, base) + struct DATA *p; + unsigned long long d; + int base; +{ + char *tmp, *t; + long long sd; + int flags; + + /* An explicit precision turns off the zero-padding flag and sets the + pad character back to space. */ + if ((p->flags & PF_ZEROPAD) && p->precision >= 0 && (p->flags & PF_DOT)) + { + p->flags &= ~PF_ZEROPAD; + p->pad = ' '; + } + + sd = d; /* signed for ' ' padding in base 10 */ + flags = (*p->pf == 'x' || *p->pf == 'X' || *p->pf == 'o' || *p->pf == 'u' || *p->pf == 'U') ? FL_UNSIGNED : 0; + if (*p->pf == 'X') + flags |= FL_HEXUPPER; + + tmp = fmtullong (d, base, intbuf, sizeof(intbuf), flags); + t = 0; + if ((p->flags & PF_THOUSANDS)) + { + GETLOCALEDATA(decpoint, thoussep, grouping); + if (grouping && (t = groupnum (tmp))) + tmp = t; + } + + /* need to add one for any `+', but we only add one in base 10 */ + p->width -= strlen(tmp) + (base == 10 && d > 0 && (p->flags & PF_PLUS)); + PAD_RIGHT(p); + + if ((p->flags & PF_DOT) && p->precision > 0) + { + p->precision -= strlen(tmp); + PAD_ZERO(p); + } + + switch (base) + { + case 10: + PUT_PLUS(sd, p, 0); + PUT_SPACE(sd, p, 0); + break; + case 8: + if (p->flags & PF_ALTFORM) + PUT_CHAR('0', p); + break; + case 16: + if (p->flags & PF_ALTFORM) + { + PUT_CHAR('0', p); + PUT_CHAR(*p->pf, p); + } + break; + } + + while (*tmp) + { + PUT_CHAR(*tmp, p); + tmp++; + } + + PAD_LEFT(p); + FREE (t); +} +#endif + +static void +pointer(p, d) + struct DATA *p; + unsigned long d; +{ + char *tmp; + + tmp = fmtulong(d, 16, intbuf, sizeof(intbuf), 0); + p->width -= strlen(tmp); + PAD_RIGHT(p); + + /* prefix '0x' for pointers */ + PUT_CHAR('0', p); + PUT_CHAR('x', p); + + while (*tmp) + { + PUT_CHAR(*tmp, p); + tmp++; + } + + PAD_LEFT(p); +} + +/* %s strings */ +static void +strings(p, tmp) + struct DATA *p; + char *tmp; +{ + size_t len; + + len = strlen(tmp); + if (p->precision != NOT_FOUND) /* the smallest number */ + len = (len < p->precision ? len : p->precision); + p->width -= len; + + PUT_STRING (tmp, len, p); +} + +#if HANDLE_MULTIBYTE +/* %ls wide-character strings */ +static void +wstrings(p, tmp) + struct DATA *p; + wchar_t *tmp; +{ + size_t len; + mbstate_t mbs; + char *os; + const wchar_t *ws; + + memset (&mbs, '\0', sizeof (mbstate_t)); + ws = (const wchar_t *)tmp; + + os = (char *)NULL; + if (p->precision != NOT_FOUND) + { + os = (char *)xmalloc (p->precision + 1); + len = wcsrtombs (os, &ws, p->precision, &mbs); + } + else + { + len = wcsrtombs (NULL, &ws, 0, &mbs); + if (len != (size_t)-1) + { + memset (&mbs, '\0', sizeof (mbstate_t)); + os = (char *)xmalloc (len + 1); + (void)wcsrtombs (os, &ws, len + 1, &mbs); + } + } + if (len == (size_t)-1) + { + /* invalid multibyte sequence; bail now. */ + FREE (os); + return; + } + + p->width -= len; + PUT_STRING (os, len, p); + free (os); +} + +static void +wchars (p, wc) + struct DATA *p; + wint_t wc; +{ + char *lbuf, *l; + mbstate_t mbs; + size_t len; + + lbuf = (char *)malloc (MB_CUR_MAX+1); + if (lbuf == 0) + return; + memset (&mbs, '\0', sizeof (mbstate_t)); + len = wcrtomb (lbuf, wc, &mbs); + if (len == (size_t)-1) + /* conversion failed; bail now. */ + return; + p->width -= len; + l = lbuf; + PUT_STRING (l, len, p); + free (lbuf); +} +#endif /* HANDLE_MULTIBYTE */ + +#ifdef FLOATING_POINT + +/* Check for [+-]infinity and NaN. If MODE == 1, we check for Infinity, else + (mode == 2) we check for NaN. This does the necessary printing. Returns + 1 if Inf or Nan, 0 if not. */ +static int +chkinfnan(p, d, mode) + struct DATA *p; + double d; + int mode; /* == 1 for inf, == 2 for nan */ +{ + int i; + char *tmp; + char *big, *small; + + i = (mode == 1) ? isinf(d) : isnan(d); + if (i == 0) + return 0; + big = (mode == 1) ? "INF" : "NAN"; + small = (mode == 1) ? "inf" : "nan"; + + tmp = (*p->pf == 'F' || *p->pf == 'G' || *p->pf == 'E') ? big : small; + + if (i < 0) + PUT_CHAR('-', p); + + while (*tmp) + { + PUT_CHAR (*tmp, p); + tmp++; + } + + return 1; +} + +/* %f %F %g %G floating point representation */ +static void +floating(p, d) + struct DATA *p; + double d; +{ + char *tmp, *tmp2, *t; + int i; + + if (d != 0 && (chkinfnan(p, d, 1) || chkinfnan(p, d, 2))) + return; /* already printed nan or inf */ + + GETLOCALEDATA(decpoint, thoussep, grouping); + DEF_PREC(p); + d = ROUND(d, p); + tmp = dtoa(d, p->precision, &tmp2); + t = 0; + if ((p->flags & PF_THOUSANDS) && grouping && (t = groupnum (tmp))) + tmp = t; + + if ((*p->pf == 'g' || *p->pf == 'G') && (p->flags & PF_ALTFORM) == 0) + { + /* smash the trailing zeros unless altform */ + for (i = strlen(tmp2) - 1; i >= 0 && tmp2[i] == '0'; i--) + tmp2[i] = '\0'; + if (tmp2[0] == '\0') + p->precision = 0; + } + + /* calculate the padding. 1 for the dot */ + p->width = p->width - + /* XXX - should this be d>0. && (p->flags & PF_PLUS) ? */ +#if 0 + ((d > 0. && p->justify == RIGHT) ? 1:0) - +#else + ((d > 0. && (p->flags & PF_PLUS)) ? 1:0) - +#endif + ((p->flags & PF_SPACE) ? 1:0) - + strlen(tmp) - p->precision - + ((p->precision != 0 || (p->flags & PF_ALTFORM)) ? 1 : 0); /* radix char */ + + if (p->pad == ' ') + { + PAD_RIGHT(p); + PUT_PLUS(d, p, 0.); + } + else + { + if (*tmp == '-') + PUT_CHAR(*tmp++, p); + PUT_PLUS(d, p, 0.); + PAD_RIGHT(p); + } + PUT_SPACE(d, p, 0.); + + while (*tmp) + { + PUT_CHAR(*tmp, p); /* the integral */ + tmp++; + } + FREE (t); + + if (p->precision != 0 || (p->flags & PF_ALTFORM)) + PUT_CHAR(decpoint, p); /* put the '.' */ + + for (; *tmp2; tmp2++) + PUT_CHAR(*tmp2, p); /* the fraction */ + + PAD_LEFT(p); +} + +/* %e %E %g %G exponent representation */ +static void +exponent(p, d) + struct DATA *p; + double d; +{ + char *tmp, *tmp2; + int j, i; + + if (d != 0 && (chkinfnan(p, d, 1) || chkinfnan(p, d, 2))) + return; /* already printed nan or inf */ + + GETLOCALEDATA(decpoint, thoussep, grouping); + DEF_PREC(p); + if (d == 0.) + j = 0; + else + { + j = log_10(d); + d = d / pow_10(j); /* get the Mantissa */ + d = ROUND(d, p); + } + tmp = dtoa(d, p->precision, &tmp2); + + /* 1 for unit, 1 for the '.', 1 for 'e|E', + * 1 for '+|-', 2 for 'exp' (but no `.' if precision == 0 */ + /* calculate how much padding need */ + p->width = p->width - + /* XXX - should this be d>0. && (p->flags & PF_PLUS) ? */ +#if 0 + ((d > 0. && p->justify == RIGHT) ? 1:0) - +#else + ((d > 0. && (p->flags & PF_PLUS)) ? 1:0) - +#endif + (p->precision != 0 || (p->flags & PF_ALTFORM)) - + ((p->flags & PF_SPACE) ? 1:0) - p->precision - 5; + + if (p->pad == ' ') + { + PAD_RIGHT(p); + PUT_PLUS(d, p, 0.); + } + else + { + if (*tmp == '-') + PUT_CHAR(*tmp++, p); + PUT_PLUS(d, p, 0.); + PAD_RIGHT(p); + } + PUT_SPACE(d, p, 0.); + + while (*tmp) + { + PUT_CHAR(*tmp, p); + tmp++; + } + + if (p->precision != 0 || (p->flags & PF_ALTFORM)) + PUT_CHAR(decpoint, p); /* the '.' */ + + if ((*p->pf == 'g' || *p->pf == 'G') && (p->flags & PF_ALTFORM) == 0) + /* smash the trailing zeros unless altform */ + for (i = strlen(tmp2) - 1; i >= 0 && tmp2[i] == '0'; i--) + tmp2[i] = '\0'; + + for (; *tmp2; tmp2++) + PUT_CHAR(*tmp2, p); /* the fraction */ + + /* the exponent put the 'e|E' */ + if (*p->pf == 'g' || *p->pf == 'e') + PUT_CHAR('e', p); + else + PUT_CHAR('E', p); + + /* the sign of the exp */ + if (j >= 0) + PUT_CHAR('+', p); + else + { + PUT_CHAR('-', p); + j = -j; + } + + tmp = itoa(j); + /* pad out to at least two spaces. pad with `0' if the exponent is a + single digit. */ + if (j <= 9) + PUT_CHAR('0', p); + + /* the exponent */ + while (*tmp) + { + PUT_CHAR(*tmp, p); + tmp++; + } + + PAD_LEFT(p); +} +#endif + +/* Return a new string with the digits in S grouped according to the locale's + grouping info and thousands separator. If no grouping should be performed, + this returns NULL; the caller needs to check for it. */ +static char * +groupnum (s) + char *s; +{ + char *se, *ret, *re, *g; + int len, slen; + + if (grouping == 0 || *grouping <= 0 || *grouping == CHAR_MAX) + return ((char *)NULL); + + /* find min grouping to size returned string */ + for (len = *grouping, g = grouping; *g; g++) + if (*g > 0 && *g < len) + len = *g; + + slen = strlen (s); + len = slen / len + 1; + ret = (char *)xmalloc (slen + len + 1); + re = ret + slen + len; + *re = '\0'; + + g = grouping; + se = s + slen; + len = *g; + + while (se > s) + { + *--re = *--se; + + /* handle `-' inserted by numtoa() and the fmtu* family here. */ + if (se > s && se[-1] == '-') + continue; + + /* begin new group. */ + if (--len == 0 && se > s) + { + *--re = thoussep; + len = *++g; /* was g++, but that uses first char twice (glibc bug, too) */ + if (*g == '\0') + len = *--g; /* use previous grouping */ + else if (*g == CHAR_MAX) + { + do + *--re = *--se; + while (se > s); + break; + } + } + } + + if (re > ret) +#ifdef HAVE_MEMMOVE + memmove (ret, re, strlen (re) + 1); +#else + strcpy (ret, re); +#endif + + return ret; +} + +/* initialize the conversion specifiers */ +static void +init_conv_flag (p) + struct DATA *p; +{ + p->flags &= PF_ALLOCBUF; /* preserve PF_ALLOCBUF flag */ + p->precision = p->width = NOT_FOUND; + p->justify = NOT_FOUND; + p->pad = ' '; +} + +static void +init_data (p, string, length, format, mode) + struct DATA *p; + char *string; + size_t length; + const char *format; + int mode; +{ + p->length = length - 1; /* leave room for '\0' */ + p->holder = p->base = string; + p->pf = format; + p->counter = 0; + p->flags = (mode == PFM_AS) ? PF_ALLOCBUF : 0; +} + +static int +#if defined (__STDC__) +vsnprintf_internal(struct DATA *data, char *string, size_t length, const char *format, va_list args) +#else +vsnprintf_internal(data, string, length, format, args) + struct DATA *data; + char *string; + size_t length; + const char *format; + va_list args; +#endif +{ + double d; /* temporary holder */ +#ifdef HAVE_LONG_DOUBLE + long double ld; /* for later */ +#endif + unsigned long ul; +#ifdef HAVE_LONG_LONG + unsigned long long ull; +#endif + int state, i, c, n; + char *s; +#if HANDLE_MULTIBYTE + wchar_t *ws; + wint_t wc; +#endif + const char *convstart; + int negprec; + + /* Sanity check, the string length must be >= 0. C99 actually says that + LENGTH can be zero here, in the case of snprintf/vsnprintf (it's never + 0 in the case of asprintf/vasprintf), and the return value is the number + of characters that would have been written. */ + if (length < 0) + return -1; + + if (format == 0) + return 0; + + /* Reset these for each call because the locale might have changed. */ + decpoint = thoussep = 0; + grouping = 0; + + negprec = 0; + for (; c = *(data->pf); data->pf++) + { + if (c != '%') + { + PUT_CHAR (c, data); + continue; + } + + convstart = data->pf; + init_conv_flag (data); /* initialise format flags */ + + state = 1; + for (state = 1; state && *data->pf; ) + { + c = *(++data->pf); + /* fmtend = data->pf */ +#if defined (FLOATING_POINT) && defined (HAVE_LONG_DOUBLE) + if (data->flags & PF_LONGDBL) + { + switch (c) + { + case 'f': case 'F': + case 'e': case 'E': + case 'g': case 'G': +# ifdef HAVE_PRINTF_A_FORMAT + case 'a': case 'A': +# endif + STAR_ARGS (data); + ld = GETLDOUBLE (data); + ldfallback (data, convstart, data->pf, ld); + goto conv_break; + } + } +#endif /* FLOATING_POINT && HAVE_LONG_DOUBLE */ + + switch (c) + { + /* Parse format flags */ + case '\0': /* a NULL here ? ? bail out */ + *data->holder = '\0'; + return data->counter; + break; + case '#': + data->flags |= PF_ALTFORM; + continue; + case '*': + if (data->flags & PF_DOT) + data->flags |= PF_STAR_P; + else + data->flags |= PF_STAR_W; + continue; + case '-': + if ((data->flags & PF_DOT) == 0) + { + data->flags |= PF_LADJUST; + data->justify = LEFT; + } + else + negprec = 1; + continue; + case ' ': + if ((data->flags & PF_PLUS) == 0) + data->flags |= PF_SPACE; + continue; + case '+': + if ((data->flags & PF_DOT) == 0) + { + data->flags |= PF_PLUS; + if ((data->flags & PF_LADJUST) == 0) + data->justify = RIGHT; + } + continue; + case '\'': + data->flags |= PF_THOUSANDS; + continue; + + case '0': + /* If we're not specifying precision (in which case we've seen + a `.') and we're not performing left-adjustment (in which + case the `0' is ignored), a `0' is taken as the zero-padding + flag. */ + if ((data->flags & (PF_DOT|PF_LADJUST)) == 0) + { + data->flags |= PF_ZEROPAD; + data->pad = '0'; + continue; + } + case '1': case '2': case '3': + case '4': case '5': case '6': + case '7': case '8': case '9': + n = 0; + do + { + n = n * 10 + TODIGIT(c); + c = *(++data->pf); + } + while (DIGIT(c)); + data->pf--; /* went too far */ + if (n < 0) + n = 0; + if (data->flags & PF_DOT) + data->precision = negprec ? NOT_FOUND : n; + else + data->width = n; + continue; + + /* optional precision */ + case '.': + data->flags |= PF_DOT; + data->precision = 0; + continue; + + /* length modifiers */ + case 'h': + data->flags |= (data->flags & PF_SHORTINT) ? PF_SIGNEDCHAR : PF_SHORTINT; + continue; + case 'l': + data->flags |= (data->flags & PF_LONGINT) ? PF_LONGLONG : PF_LONGINT; + continue; + case 'L': + data->flags |= PF_LONGDBL; + continue; + case 'q': + data->flags |= PF_LONGLONG; + continue; + case 'j': + data->flags |= PF_INTMAX_T; + SET_SIZE_FLAGS(data, intmax_t); + continue; + case 'z': + data->flags |= PF_SIZE_T; + SET_SIZE_FLAGS(data, size_t); + continue; + case 't': + data->flags |= PF_PTRDIFF_T; + SET_SIZE_FLAGS(data, ptrdiff_t); + continue; + + /* Conversion specifiers */ +#ifdef FLOATING_POINT + case 'f': /* float, double */ + case 'F': + STAR_ARGS(data); + d = GETDOUBLE(data); + floating(data, d); +conv_break: + state = 0; + break; + case 'g': + case 'G': + STAR_ARGS(data); + DEF_PREC(data); + d = GETDOUBLE(data); + i = (d != 0.) ? log_10(d) : -1; + /* + * for '%g|%G' ANSI: use f if exponent + * is in the range or [-4,p] exclusively + * else use %e|%E + */ + if (-4 < i && i < data->precision) + { + /* reset precision */ + data->precision -= i + 1; + floating(data, d); + } + else + { + /* reduce precision by 1 because of leading digit before + decimal point in e format, unless specified as 0. */ + if (data->precision > 0) + data->precision--; + exponent(data, d); + } + state = 0; + break; + case 'e': + case 'E': /* Exponent double */ + STAR_ARGS(data); + d = GETDOUBLE(data); + exponent(data, d); + state = 0; + break; +# ifdef HAVE_PRINTF_A_FORMAT + case 'a': + case 'A': + STAR_ARGS(data); + d = GETDOUBLE(data); + dfallback(data, convstart, data->pf, d); + state = 0; + break; +# endif /* HAVE_PRINTF_A_FORMAT */ +#endif /* FLOATING_POINT */ + case 'U': + data->flags |= PF_LONGINT; + /* FALLTHROUGH */ + case 'u': + STAR_ARGS(data); +#ifdef HAVE_LONG_LONG + if (data->flags & PF_LONGLONG) + { + ull = GETARG (unsigned long long); + lnumber(data, ull, 10); + } + else +#endif + { + ul = GETUNSIGNED(data); + number(data, ul, 10); + } + state = 0; + break; + case 'D': + data->flags |= PF_LONGINT; + /* FALLTHROUGH */ + case 'd': /* decimal */ + case 'i': + STAR_ARGS(data); +#ifdef HAVE_LONG_LONG + if (data->flags & PF_LONGLONG) + { + ull = GETARG (long long); + lnumber(data, ull, 10); + } + else +#endif + { + ul = GETSIGNED(data); + number(data, ul, 10); + } + state = 0; + break; + case 'o': /* octal */ + STAR_ARGS(data); +#ifdef HAVE_LONG_LONG + if (data->flags & PF_LONGLONG) + { + ull = GETARG (unsigned long long); + lnumber(data, ull, 8); + } + else +#endif + { + ul = GETUNSIGNED(data); + number(data, ul, 8); + } + state = 0; + break; + case 'x': + case 'X': /* hexadecimal */ + STAR_ARGS(data); +#ifdef HAVE_LONG_LONG + if (data->flags & PF_LONGLONG) + { + ull = GETARG (unsigned long long); + lnumber(data, ull, 16); + } + else +#endif + { + ul = GETUNSIGNED(data); + number(data, ul, 16); + } + state = 0; + break; + case 'p': + STAR_ARGS(data); + ul = (unsigned long)GETARG (void *); + pointer(data, ul); + state = 0; + break; +#if HANDLE_MULTIBYTE + case 'C': + data->flags |= PF_LONGINT; + /* FALLTHROUGH */ +#endif + case 'c': /* character */ + STAR_ARGS(data); +#if HANDLE_MULTIBYTE + if (data->flags & PF_LONGINT) + { + wc = GETARG (wint_t); + wchars (data, wc); + } + else +#endif + { + ul = GETARG (int); + PUT_CHAR(ul, data); + } + state = 0; + break; +#if HANDLE_MULTIBYTE + case 'S': + data->flags |= PF_LONGINT; + /* FALLTHROUGH */ +#endif + case 's': /* string */ + STAR_ARGS(data); +#if HANDLE_MULTIBYTE + if (data->flags & PF_LONGINT) + { + ws = GETARG (wchar_t *); + wstrings (data, ws); + } + else +#endif + { + s = GETARG (char *); + strings(data, s); + } + state = 0; + break; + case 'n': +#ifdef HAVE_LONG_LONG + if (data->flags & PF_LONGLONG) + *(GETARG (long long *)) = data->counter; + else +#endif + if (data->flags & PF_LONGINT) + *(GETARG (long *)) = data->counter; + else if (data->flags & PF_SHORTINT) + *(GETARG (short *)) = data->counter; + else + *(GETARG (int *)) = data->counter; + state = 0; + break; + case '%': /* nothing just % */ + PUT_CHAR('%', data); + state = 0; + break; + default: + /* is this an error ? maybe bail out */ + state = 0; + break; + } /* end switch */ + } /* end of `%' for loop */ + } /* end of format string for loop */ + + if (data->length >= 0) + *data->holder = '\0'; /* the end ye ! */ + + return data->counter; +} + +#if defined (FLOATING_POINT) && defined (HAVE_LONG_DOUBLE) +/* + * Printing floating point numbers accurately is an art. I'm not good + * at it. Fall back to sprintf for long double formats. + */ +static void +ldfallback (data, fs, fe, ld) + struct DATA *data; + const char *fs, *fe; + long double ld; +{ + register char *x; + char fmtbuf[FALLBACK_FMTSIZE], *obuf; + int fl; + + fl = LFALLBACK_BASE + (data->precision < 6 ? 6 : data->precision) + 2; + obuf = (char *)xmalloc (fl); + fl = fe - fs + 1; + strncpy (fmtbuf, fs, fl); + fmtbuf[fl] = '\0'; + + if ((data->flags & PF_STAR_W) && (data->flags & PF_STAR_P)) + sprintf (obuf, fmtbuf, data->width, data->precision, ld); + else if (data->flags & PF_STAR_W) + sprintf (obuf, fmtbuf, data->width, ld); + else if (data->flags & PF_STAR_P) + sprintf (obuf, fmtbuf, data->precision, ld); + else + sprintf (obuf, fmtbuf, ld); + + for (x = obuf; *x; x++) + PUT_CHAR (*x, data); + xfree (obuf); +} +#endif /* FLOATING_POINT && HAVE_LONG_DOUBLE */ + +#ifdef FLOATING_POINT +/* Used for %a, %A if the libc printf supports them. */ +static void +dfallback (data, fs, fe, d) + struct DATA *data; + const char *fs, *fe; + double d; +{ + register char *x; + char fmtbuf[FALLBACK_FMTSIZE], obuf[FALLBACK_BASE]; + int fl; + + fl = fe - fs + 1; + strncpy (fmtbuf, fs, fl); + fmtbuf[fl] = '\0'; + + if ((data->flags & PF_STAR_W) && (data->flags & PF_STAR_P)) + sprintf (obuf, fmtbuf, data->width, data->precision, d); + else if (data->flags & PF_STAR_W) + sprintf (obuf, fmtbuf, data->width, d); + else if (data->flags & PF_STAR_P) + sprintf (obuf, fmtbuf, data->precision, d); + else + sprintf (obuf, fmtbuf, d); + + for (x = obuf; *x; x++) + PUT_CHAR (*x, data); +} +#endif /* FLOATING_POINT */ + +#if !HAVE_SNPRINTF + +int +#if defined (__STDC__) +vsnprintf(char *string, size_t length, const char *format, va_list args) +#else +vsnprintf(string, length, format, args) + char *string; + size_t length; + const char *format; + va_list args; +#endif +{ + struct DATA data; + + if (string == 0 && length != 0) + return 0; + init_data (&data, string, length, format, PFM_SN); + return (vsnprintf_internal(&data, string, length, format, args)); +} + +int +#if defined(PREFER_STDARG) +snprintf(char *string, size_t length, const char * format, ...) +#else +snprintf(string, length, format, va_alist) + char *string; + size_t length; + const char *format; + va_dcl +#endif +{ + struct DATA data; + int rval; + va_list args; + + SH_VA_START(args, format); + + if (string == 0 && length != 0) + return 0; + init_data (&data, string, length, format, PFM_SN); + rval = vsnprintf_internal (&data, string, length, format, args); + + va_end(args); + + return rval; +} + +#endif /* HAVE_SNPRINTF */ + +#if !HAVE_ASPRINTF + +int +#if defined (__STDC__) +vasprintf(char **stringp, const char *format, va_list args) +#else +vasprintf(stringp, format, args) + char **stringp; + const char *format; + va_list args; +#endif +{ + struct DATA data; + char *string; + int r; + + string = (char *)xmalloc(ASBUFSIZE); + init_data (&data, string, ASBUFSIZE, format, PFM_AS); + r = vsnprintf_internal(&data, string, ASBUFSIZE, format, args); + *stringp = data.base; /* not string in case reallocated */ + return r; +} + +int +#if defined(PREFER_STDARG) +asprintf(char **stringp, const char * format, ...) +#else +asprintf(stringp, format, va_alist) + char **stringp; + const char *format; + va_dcl +#endif +{ + int rval; + va_list args; + + SH_VA_START(args, format); + + rval = vasprintf (stringp, format, args); + + va_end(args); + + return rval; +} + +#endif /* !HAVE_ASPRINTF */ + +#endif /* !HAVE_SNPRINTF || !HAVE_ASPRINTF */ + +#ifdef DRIVER + +static void +memory_error_and_abort () +{ + write (2, "out of virtual memory\n", 22); + abort (); +} + +static void * +xmalloc(bytes) + size_t bytes; +{ + void *ret; + + ret = malloc(bytes); + if (ret == 0) + memory_error_and_abort (); + return ret; +} + +static void * +xrealloc (pointer, bytes) + void *pointer; + size_t bytes; +{ + void *ret; + + ret = pointer ? realloc(pointer, bytes) : malloc(bytes); + if (ret == 0) + memory_error_and_abort (); + return ret; +} + +static void +xfree(x) + void *x; +{ + if (x) + free (x); +} + +/* set of small tests for snprintf() */ +main() +{ + char holder[100]; + char *h; + int i, si, ai; + +#ifdef HAVE_LOCALE_H + setlocale(LC_ALL, ""); +#endif + +#if 1 + si = snprintf((char *)NULL, 0, "abcde\n"); + printf("snprintf returns %d with NULL first argument and size of 0\n", si); + si = snprintf(holder, 0, "abcde\n"); + printf("snprintf returns %d with non-NULL first argument and size of 0\n", si); + si = snprintf((char *)NULL, 16, "abcde\n"); + printf("snprintf returns %d with NULL first argument and non-zero size\n", si); + +/* + printf("Suite of test for snprintf:\n"); + printf("a_format\n"); + printf("printf() format\n"); + printf("snprintf() format\n\n"); +*/ +/* Checking the field widths */ + + printf("/%%ld %%ld/, 336, 336\n"); + snprintf(holder, sizeof holder, "/%ld %ld/\n", 336, 336); + asprintf(&h, "/%ld %ld/\n", 336, 336); + printf("/%ld %ld/\n", 336, 336); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%d/, 336\n"); + snprintf(holder, sizeof holder, "/%d/\n", 336); + asprintf(&h, "/%d/\n", 336); + printf("/%d/\n", 336); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%2d/, 336\n"); + snprintf(holder, sizeof holder, "/%2d/\n", 336); + asprintf(&h, "/%2d/\n", 336); + printf("/%2d/\n", 336); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%10d/, 336\n"); + snprintf(holder, sizeof holder, "/%10d/\n", 336); + asprintf(&h, "/%10d/\n", 336); + printf("/%10d/\n", 336); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%-10d/, 336\n"); + snprintf(holder, sizeof holder, "/%-10d/\n", 336); + asprintf(&h, "/%-10d/\n", 336); + printf("/%-10d/\n", 336); + printf("%s", holder); + printf("%s\n", h); + + +/* floating points */ + + printf("/%%f/, 1234.56\n"); + snprintf(holder, sizeof holder, "/%f/\n", 1234.56); + asprintf(&h, "/%f/\n", 1234.56); + printf("/%f/\n", 1234.56); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%e/, 1234.56\n"); + snprintf(holder, sizeof holder, "/%e/\n", 1234.56); + asprintf(&h, "/%e/\n", 1234.56); + printf("/%e/\n", 1234.56); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%4.2f/, 1234.56\n"); + snprintf(holder, sizeof holder, "/%4.2f/\n", 1234.56); + asprintf(&h, "/%4.2f/\n", 1234.56); + printf("/%4.2f/\n", 1234.56); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%3.1f/, 1234.56\n"); + snprintf(holder, sizeof holder, "/%3.1f/\n", 1234.56); + asprintf(&h, "/%3.1f/\n", 1234.56); + printf("/%3.1f/\n", 1234.56); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%10.3f/, 1234.56\n"); + snprintf(holder, sizeof holder, "/%10.3f/\n", 1234.56); + asprintf(&h, "/%10.3f/\n", 1234.56); + printf("/%10.3f/\n", 1234.56); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%10.3e/, 1234.56\n"); + snprintf(holder, sizeof holder, "/%10.3e/\n", 1234.56); + asprintf(&h, "/%10.3e/\n", 1234.56); + printf("/%10.3e/\n", 1234.56); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%+4.2f/, 1234.56\n"); + snprintf(holder, sizeof holder, "/%+4.2f/\n", 1234.56); + asprintf(&h, "/%+4.2f/\n", 1234.56); + printf("/%+4.2f/\n", 1234.56); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%010.2f/, 1234.56\n"); + snprintf(holder, sizeof holder, "/%010.2f/\n", 1234.56); + asprintf(&h, "/%010.2f/\n", 1234.56); + printf("/%010.2f/\n", 1234.56); + printf("%s", holder); + printf("%s\n", h); + +#define BLURB "Outstanding acting !" +/* strings precisions */ + + printf("/%%2s/, \"%s\"\n", BLURB); + snprintf(holder, sizeof holder, "/%2s/\n", BLURB); + asprintf(&h, "/%2s/\n", BLURB); + printf("/%2s/\n", BLURB); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%22s/ %s\n", BLURB); + snprintf(holder, sizeof holder, "/%22s/\n", BLURB); + asprintf(&h, "/%22s/\n", BLURB); + printf("/%22s/\n", BLURB); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%22.5s/ %s\n", BLURB); + snprintf(holder, sizeof holder, "/%22.5s/\n", BLURB); + asprintf(&h, "/%22.5s/\n", BLURB); + printf("/%22.5s/\n", BLURB); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%-22.5s/ %s\n", BLURB); + snprintf(holder, sizeof holder, "/%-22.5s/\n", BLURB); + asprintf(&h, "/%-22.5s/\n", BLURB); + printf("/%-22.5s/\n", BLURB); + printf("%s", holder); + printf("%s\n", h); + +/* see some flags */ + + printf("%%x %%X %%#x, 31, 31, 31\n"); + snprintf(holder, sizeof holder, "%x %X %#x\n", 31, 31, 31); + asprintf(&h, "%x %X %#x\n", 31, 31, 31); + printf("%x %X %#x\n", 31, 31, 31); + printf("%s", holder); + printf("%s\n", h); + + printf("**%%d**%% d**%% d**, 42, 42, -42\n"); + snprintf(holder, sizeof holder, "**%d**% d**% d**\n", 42, 42, -42); + asprintf(&h, "**%d**% d**% d**\n", 42, 42, -42); + printf("**%d**% d**% d**\n", 42, 42, -42); + printf("%s", holder); + printf("%s\n", h); + +/* other flags */ + + printf("/%%g/, 31.4\n"); + snprintf(holder, sizeof holder, "/%g/\n", 31.4); + asprintf(&h, "/%g/\n", 31.4); + printf("/%g/\n", 31.4); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%.6g/, 31.4\n"); + snprintf(holder, sizeof holder, "/%.6g/\n", 31.4); + asprintf(&h, "/%.6g/\n", 31.4); + printf("/%.6g/\n", 31.4); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%.1G/, 31.4\n"); + snprintf(holder, sizeof holder, "/%.1G/\n", 31.4); + asprintf(&h, "/%.1G/\n", 31.4); + printf("/%.1G/\n", 31.4); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%.1G/, 3100000000.4\n"); + snprintf(holder, sizeof holder, "/%.1G/\n", 3100000000.4); + asprintf(&h, "/%.1G/\n", 3100000000.4); + printf("/%.1G/\n", 3100000000.4); + printf("%s", holder); + printf("%s\n", h); + + printf("abc%%n\n"); + printf("abc%n", &i); printf("%d\n", i); + snprintf(holder, sizeof holder, "abc%n", &i); + printf("%s", holder); printf("%d\n\n", i); + asprintf(&h, "abc%n", &i); + printf("%s", h); printf("%d\n\n", i); + + printf("%%*.*s --> 10.10\n"); + snprintf(holder, sizeof holder, "%*.*s\n", 10, 10, BLURB); + asprintf(&h, "%*.*s\n", 10, 10, BLURB); + printf("%*.*s\n", 10, 10, BLURB); + printf("%s", holder); + printf("%s\n", h); + + printf("%%%%%%%%\n"); + snprintf(holder, sizeof holder, "%%%%\n"); + asprintf(&h, "%%%%\n"); + printf("%%%%\n"); + printf("%s", holder); + printf("%s\n", h); + +#define BIG "Hello this is a too big string for the buffer" +/* printf("A buffer to small of 10, trying to put this:\n");*/ + printf("<%%>, %s\n", BIG); + i = snprintf(holder, 10, "%s\n", BIG); + i = asprintf(&h, "%s", BIG); + printf("<%s>\n", BIG); + printf("<%s>\n", holder); + printf("<%s>\n\n", h); + + printf ("<%%p> vsnprintf\n"); + i = snprintf(holder, 100, "%p", vsnprintf); + i = asprintf(&h, "%p", vsnprintf); + printf("<%p>\n", vsnprintf); + printf("<%s>\n", holder); + printf("<%s>\n\n", h); + + printf ("<%%lu> LONG_MAX+1\n"); + i = snprintf(holder, 100, "%lu", (unsigned long)(LONG_MAX)+1); + i = asprintf(&h, "%lu", (unsigned long)(LONG_MAX)+1); + printf("<%lu>\n", (unsigned long)(LONG_MAX)+1); + printf("<%s>\n", holder); + printf("<%s>\n\n", h); + +#ifdef HAVE_LONG_LONG + printf ("<%%llu> LLONG_MAX+1\n"); + i = snprintf(holder, 100, "%llu", (unsigned long long)(LLONG_MAX)+1); + i = asprintf(&h, "%llu", (unsigned long long)(LLONG_MAX)+1); + printf("<%llu>\n", (unsigned long long)(LLONG_MAX)+1); + printf("<%s>\n", holder); + printf("<%s>\n\n", h); +#endif + +#ifdef HAVE_LONG_DOUBLE + printf ("<%%6.2LE> 42.42\n"); + i = snprintf(holder, 100, "%6.2LE", (long double)42.42); + i = asprintf(&h, "%6.2LE", (long double)42.42); + printf ("<%6.2LE>\n", (long double)42.42); + printf ("<%s>\n", holder); + printf ("<%s>\n\n", h); +#endif + +#ifdef HAVE_PRINTF_A_FORMAT + printf ("<%%6.2A> 42.42\n"); + i = snprintf(holder, 100, "%6.2A", 42.42); + i = asprintf(&h, "%6.2A", 42.42); + printf ("<%6.2A>\n", 42.42); + printf ("<%s>\n", holder); + printf ("<%s>\n\n", h); + + printf ("<%%6.2LA> 42.42\n"); + i = snprintf(holder, 100, "%6.2LA", (long double)42.42); + i = asprintf(&h, "%6.2LA", (long double)42.42); + printf ("<%6.2LA>\n", (long double)42.42); + printf ("<%s>\n", holder); + printf ("<%s>\n\n", h); +#endif + + printf ("<%%.10240f> DBL_MAX\n"); + si = snprintf(holder, 100, "%.10240f", DBL_MAX); + ai = asprintf(&h, "%.10240f", DBL_MAX); + printf ("<%.10240f>\n", DBL_MAX); + printf ("<%d> <%s>\n", si, holder); + printf ("<%d> <%s>\n\n", ai, h); + + printf ("<%%.10240Lf> LDBL_MAX\n"); + si = snprintf(holder, 100, "%.10240Lf", (long double)LDBL_MAX); + ai = asprintf(&h, "%.10240Lf", (long double)LDBL_MAX); + printf ("<%.10240Lf>\n", (long double)LDBL_MAX); + printf ("<%d> <%s>\n", si, holder); + printf ("<%d> <%s>\n\n", ai, h); + + /* huh? */ + printf("/%%g/, 421.2345\n"); + snprintf(holder, sizeof holder, "/%g/\n", 421.2345); + asprintf(&h, "/%g/\n", 421.2345); + printf("/%g/\n", 421.2345); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%g/, 4214.2345\n"); + snprintf(holder, sizeof holder, "/%g/\n", 4214.2345); + asprintf(&h, "/%g/\n", 4214.2345); + printf("/%g/\n", 4214.2345); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%.5g/, 4214.2345\n"); + snprintf(holder, sizeof holder, "/%.5g/\n", 4214.2345); + asprintf(&h, "/%.5g/\n", 4214.2345); + printf("/%.5g/\n", 4214.2345); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%.4g/, 4214.2345\n"); + snprintf(holder, sizeof holder, "/%.4g/\n", 4214.2345); + asprintf(&h, "/%.4g/\n", 4214.2345); + printf("/%.4g/\n", 4214.2345); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%'ld %%'ld/, 12345, 1234567\n"); + snprintf(holder, sizeof holder, "/%'ld %'ld/\n", 12345, 1234567); + asprintf(&h, "/%'ld %'ld/\n", 12345, 1234567); + printf("/%'ld %'ld/\n", 12345, 1234567); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%'ld %%'ld/, 336, 3336\n"); + snprintf(holder, sizeof holder, "/%'ld %'ld/\n", 336, 3336); + asprintf(&h, "/%'ld %'ld/\n", 336, 3336); + printf("/%'ld %'ld/\n", 336, 3336); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%'ld %%'ld/, -42786, -142786\n"); + snprintf(holder, sizeof holder, "/%'ld %'ld/\n", -42786, -142786); + asprintf(&h, "/%'ld %'ld/\n", -42786, -142786); + printf("/%'ld %'ld/\n", -42786, -142786); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%'f %%'f/, 421.2345, 421234.56789\n"); + snprintf(holder, sizeof holder, "/%'f %'f/\n", 421.2345, 421234.56789); + asprintf(&h, "/%'f %'f/\n", 421.2345, 421234.56789); + printf("/%'f %'f/\n", 421.2345, 421234.56789); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%'f %%'f/, -421.2345, -421234.56789\n"); + snprintf(holder, sizeof holder, "/%'f %'f/\n", -421.2345, -421234.56789); + asprintf(&h, "/%'f %'f/\n", -421.2345, -421234.56789); + printf("/%'f %'f/\n", -421.2345, -421234.56789); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%'g %%'g/, 421.2345, 421234.56789\n"); + snprintf(holder, sizeof holder, "/%'g %'g/\n", 421.2345, 421234.56789); + asprintf(&h, "/%'g %'g/\n", 421.2345, 421234.56789); + printf("/%'g %'g/\n", 421.2345, 421234.56789); + printf("%s", holder); + printf("%s\n", h); + + printf("/%%'g %%'g/, -421.2345, -421234.56789\n"); + snprintf(holder, sizeof holder, "/%'g %'g/\n", -421.2345, -421234.56789); + asprintf(&h, "/%'g %'g/\n", -421.2345, -421234.56789); + printf("/%'g %'g/\n", -421.2345, -421234.56789); + printf("%s", holder); + printf("%s\n", h); +#endif + + printf("/%%'g/, 4213455.8392\n"); + snprintf(holder, sizeof holder, "/%'g/\n", 4213455.8392); + asprintf(&h, "/%'g/\n", 4213455.8392); + printf("/%'g/\n", 4213455.8392); + printf("%s", holder); + printf("%s\n", h); + + exit (0); +} +#endif diff --git a/lib/sh/spell.c b/lib/sh/spell.c new file mode 100644 index 0000000..da78690 --- /dev/null +++ b/lib/sh/spell.c @@ -0,0 +1,212 @@ +/* spell.c -- spelling correction for pathnames. */ + +/* Copyright (C) 2000 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include +#include +#include +#if defined (HAVE_SYS_PARAM_H) +#include +#endif + +#include + +#include +#include +#include + +static int mindist __P((char *, char *, char *)); +static int spdist __P((char *, char *)); + +/* + * `spname' and its helpers are inspired by the code in "The UNIX + * Programming Environment", Kernighan & Pike, Prentice-Hall 1984, + * pages 209 - 213. + */ + +/* + * `spname' -- return a correctly spelled filename + * + * int spname(char * oldname, char * newname) + * Returns: -1 if no reasonable match found + * 0 if exact match found + * 1 if corrected + * Stores corrected name in `newname'. + */ +int +spname(oldname, newname) + char *oldname; + char *newname; +{ + char *op, *np, *p; + char guess[PATH_MAX + 1], best[PATH_MAX + 1]; + + op = oldname; + np = newname; + for (;;) + { + while (*op == '/') /* Skip slashes */ + *np++ = *op++; + *np = '\0'; + + if (*op == '\0') /* Exact or corrected */ + { + /* `.' is rarely the right thing. */ + if (oldname[1] == '\0' && newname[1] == '\0' && + oldname[0] != '.' && newname[0] == '.') + return -1; + return strcmp(oldname, newname) != 0; + } + + /* Copy next component into guess */ + for (p = guess; *op != '/' && *op != '\0'; op++) + if (p < guess + PATH_MAX) + *p++ = *op; + *p = '\0'; + + if (mindist(newname, guess, best) >= 3) + return -1; /* Hopeless */ + + /* + * Add to end of newname + */ + for (p = best; *np = *p++; np++) + ; + } +} + +/* + * Search directory for a guess + */ +static int +mindist(dir, guess, best) + char *dir; + char *guess; + char *best; +{ + DIR *fd; + struct dirent *dp; + int dist, x; + + dist = 3; /* Worst distance */ + if (*dir == '\0') + dir = "."; + + if ((fd = opendir(dir)) == NULL) + return dist; + + while ((dp = readdir(fd)) != NULL) + { + /* + * Look for a better guess. If the new guess is as + * good as the current one, we take it. This way, + * any single character match will be a better match + * than ".". + */ + x = spdist(dp->d_name, guess); + if (x <= dist && x != 3) + { + strcpy(best, dp->d_name); + dist = x; + if (dist == 0) /* Exact match */ + break; + } + } + (void)closedir(fd); + + /* Don't return `.' */ + if (best[0] == '.' && best[1] == '\0') + dist = 3; + return dist; +} + +/* + * `spdist' -- return the "distance" between two names. + * + * int spname(char * oldname, char * newname) + * Returns: 0 if strings are identical + * 1 if two characters are transposed + * 2 if one character is wrong, added or deleted + * 3 otherwise + */ +static int +spdist(cur, new) + char *cur, *new; +{ + while (*cur == *new) + { + if (*cur == '\0') + return 0; /* Exact match */ + cur++; + new++; + } + + if (*cur) + { + if (*new) + { + if (cur[1] && new[1] && cur[0] == new[1] && cur[1] == new[0] && strcmp (cur + 2, new + 2) == 0) + return 1; /* Transposition */ + + if (strcmp (cur + 1, new + 1) == 0) + return 2; /* One character mismatch */ + } + + if (strcmp(&cur[1], &new[0]) == 0) + return 2; /* Extra character */ + } + + if (*new && strcmp(cur, new + 1) == 0) + return 2; /* Missing character */ + + return 3; +} + +char * +dirspell (dirname) + char *dirname; +{ + int n; + char *guess; + + n = (strlen (dirname) * 3 + 1) / 2 + 1; + guess = (char *)malloc (n); + if (guess == 0) + return 0; + + switch (spname (dirname, guess)) + { + case -1: + default: + free (guess); + return (char *)NULL; + case 0: + case 1: + return guess; + } +} diff --git a/lib/sh/strcasecmp.c b/lib/sh/strcasecmp.c new file mode 100644 index 0000000..5542f71 --- /dev/null +++ b/lib/sh/strcasecmp.c @@ -0,0 +1,84 @@ +/* strcasecmp.c - functions for case-insensitive string comparison. */ + +/* Copyright (C) 1995 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if !defined (HAVE_STRCASECMP) + +#include +#include +#include + +/* Compare at most COUNT characters from string1 to string2. Case + doesn't matter. */ +int +strncasecmp (string1, string2, count) + const char *string1; + const char *string2; + int count; +{ + register const char *s1; + register const char *s2; + register int r; + + if (count <= 0 || (string1 == string2)) + return 0; + + s1 = string1; + s2 = string2; + do + { + if ((r = TOLOWER ((unsigned char) *s1) - TOLOWER ((unsigned char) *s2)) != 0) + return r; + if (*s1++ == '\0') + break; + s2++; + } + while (--count != 0); + + return (0); +} + +/* strcmp (), but caseless. */ +int +strcasecmp (string1, string2) + const char *string1; + const char *string2; +{ + register const char *s1; + register const char *s2; + register int r; + + s1 = string1; + s2 = string2; + + if (s1 == s2) + return (0); + + while ((r = TOLOWER ((unsigned char)*s1) - TOLOWER ((unsigned char)*s2)) == 0) + { + if (*s1++ == '\0') + return 0; + s2++; + } + + return (r); +} +#endif /* !HAVE_STRCASECMP */ diff --git a/lib/sh/strcasestr.c b/lib/sh/strcasestr.c new file mode 100644 index 0000000..c819b3e --- /dev/null +++ b/lib/sh/strcasestr.c @@ -0,0 +1,46 @@ +/* strcasestr.c - Find if one string appears as a substring of another string, + without regard to case. */ + +/* Copyright (C) 2000 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include +#include + +#include + +/* Determine if s2 occurs in s1. If so, return a pointer to the + match in s1. The compare is case insensitive. This is a + case-insensitive strstr(3). */ +char * +strcasestr (s1, s2) + const char *s1; + const char *s2; +{ + register int i, l, len, c; + + c = TOLOWER ((unsigned char)s2[0]); + len = strlen (s1); + l = strlen (s2); + for (i = 0; (len - i) >= l; i++) + if ((TOLOWER ((unsigned char)s1[i]) == c) && (strncasecmp (s1 + i, s2, l) == 0)) + return ((char *)s1 + i); + return ((char *)0); +} diff --git a/lib/sh/strchrnul.c b/lib/sh/strchrnul.c new file mode 100644 index 0000000..00cb88c --- /dev/null +++ b/lib/sh/strchrnul.c @@ -0,0 +1,35 @@ +/* Searching in a string. + Copyright (C) 2012 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +#include + +/* Specification. */ +#include + +/* Find the first occurrence of C in S or the final NUL byte. */ +char * +strchrnul (s, c_in) + const char *s; + int c_in; +{ + char c; + register char *s1; + + for (c = c_in, s1 = (char *)s; s1 && *s1 && *s1 != c; s1++) + ; + return (s1); +} diff --git a/lib/sh/strdup.c b/lib/sh/strdup.c new file mode 100644 index 0000000..90fa353 --- /dev/null +++ b/lib/sh/strdup.c @@ -0,0 +1,42 @@ +/* strdup - return a copy of a string in newly-allocated memory. */ + +/* Copyright (C) 2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + + +#include + +/* Get specification. */ +#include +#include + +/* Duplicate S, returning an identical malloc'd string. */ +char * +strdup (s) + const char *s; +{ + size_t len; + void *new; + + len = strlen (s) + 1; + if ((new = malloc (len)) == NULL) + return NULL; + + memcpy (new, s, len); + return ((char *)new); +} diff --git a/lib/sh/strerror.c b/lib/sh/strerror.c new file mode 100644 index 0000000..bf63926 --- /dev/null +++ b/lib/sh/strerror.c @@ -0,0 +1,74 @@ +/* strerror.c - string corresponding to a particular value of errno. */ + +/* Copyright (C) 1995 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if !defined (HAVE_STRERROR) + +#include +#if defined (HAVE_SYS_PARAM_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include + +#include + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +/* Return a string corresponding to the error number E. From + the ANSI C spec. */ +#if defined (strerror) +# undef strerror +#endif + +static char *errbase = "Unknown system error "; + +char * +strerror (e) + int e; +{ + static char emsg[40]; +#if defined (HAVE_SYS_ERRLIST) + extern int sys_nerr; + extern char *sys_errlist[]; + + if (e > 0 && e < sys_nerr) + return (sys_errlist[e]); + else +#endif /* HAVE_SYS_ERRLIST */ + { + char *z; + + z = itos (e); + strcpy (emsg, errbase); + strcat (emsg, z); + free (z); + return (&emsg[0]); + } +} +#endif /* HAVE_STRERROR */ diff --git a/lib/sh/strftime.c b/lib/sh/strftime.c new file mode 100644 index 0000000..0ababc1 --- /dev/null +++ b/lib/sh/strftime.c @@ -0,0 +1,1006 @@ +/* strftime - formatted time and date to a string */ +/* + * Modified slightly by Chet Ramey for inclusion in Bash + */ +/* + * strftime.c + * + * Public-domain implementation of ISO C library routine. + * + * If you can't do prototypes, get GCC. + * + * The C99 standard now specifies just about all of the formats + * that were additional in the earlier versions of this file. + * + * For extensions from SunOS, add SUNOS_EXT. + * For extensions from HP/UX, add HPUX_EXT. + * For VMS dates, add VMS_EXT. + * For complete POSIX semantics, add POSIX_SEMANTICS. + * + * The code for %c, %x, and %X follows the C99 specification for + * the "C" locale. + * + * This version ignores LOCALE information. + * It also doesn't worry about multi-byte characters. + * So there. + * + * Arnold Robbins + * January, February, March, 1991 + * Updated March, April 1992 + * Updated April, 1993 + * Updated February, 1994 + * Updated May, 1994 + * Updated January, 1995 + * Updated September, 1995 + * Updated January, 1996 + * Updated July, 1997 + * Updated October, 1999 + * Updated September, 2000 + * Updated December, 2001 + * Updated January, 2011 + * Updated April, 2012 + * + * Fixes from ado@elsie.nci.nih.gov, + * February 1991, May 1992 + * Fixes from Tor Lillqvist tml@tik.vtt.fi, + * May 1993 + * Further fixes from ado@elsie.nci.nih.gov, + * February 1994 + * %z code from chip@chinacat.unicom.com, + * Applied September 1995 + * %V code fixed (again) and %G, %g added, + * January 1996 + * %v code fixed, better configuration, + * July 1997 + * Moved to C99 specification. + * September 2000 + * Fixes from Tanaka Akira + * December 2001 + */ +#include + +#include +#include +#include + +#if defined(TM_IN_SYS_TIME) +#include +#include +#endif + +#include +#include + +/* defaults: season to taste */ +#define SUNOS_EXT 1 /* stuff in SunOS strftime routine */ +#define VMS_EXT 1 /* include %v for VMS date format */ +#define HPUX_EXT 1 /* non-conflicting stuff in HP-UX date */ +#define POSIX_SEMANTICS 1 /* call tzset() if TZ changes */ +#define POSIX_2008 1 /* flag and fw for C, F, G, Y formats */ + +#undef strchr /* avoid AIX weirdness */ + +#if defined (SHELL) +extern char *get_string_value (const char *); +#endif + +extern void tzset(void); +static int weeknumber(const struct tm *timeptr, int firstweekday); +static int iso8601wknum(const struct tm *timeptr); + +#ifndef inline +#ifdef __GNUC__ +#define inline __inline__ +#else +#define inline /**/ +#endif +#endif + +#define range(low, item, hi) max(low, min(item, hi)) + +/* Whew! This stuff is a mess. */ +#if !defined(OS2) && !defined(MSDOS) && !defined(__CYGWIN__) && defined(HAVE_TZNAME) +extern char *tzname[2]; +extern int daylight; +#if defined(SOLARIS) || defined(mips) || defined (M_UNIX) +extern long int timezone, altzone; +#else +# if defined (HPUX) || defined(__hpux) +extern long int timezone; +# else +# if !defined(__CYGWIN__) +extern int timezone, altzone; +# endif +# endif +#endif +#endif + +#undef min /* just in case */ + +/* min --- return minimum of two numbers */ + +static inline int +min(int a, int b) +{ + return (a < b ? a : b); +} + +#undef max /* also, just in case */ + +/* max --- return maximum of two numbers */ + +static inline int +max(int a, int b) +{ + return (a > b ? a : b); +} + +#ifdef POSIX_2008 +/* iso_8601_2000_year --- format a year per ISO 8601:2000 as in 1003.1 */ + +static void +iso_8601_2000_year(char *buf, int year, size_t fw) +{ + int extra; + char sign = '\0'; + + if (year >= -9999 && year <= 9999) { + sprintf(buf, "%0*d", (int) fw, year); + return; + } + + /* now things get weird */ + if (year > 9999) { + sign = '+'; + } else { + sign = '-'; + year = -year; + } + + extra = year / 10000; + year %= 10000; + sprintf(buf, "%c_%04d_%d", sign, extra, year); +} +#endif /* POSIX_2008 */ + +/* strftime --- produce formatted time */ + +size_t +strftime(char *s, size_t maxsize, const char *format, const struct tm *timeptr) +{ + char *endp = s + maxsize; + char *start = s; + auto char tbuf[100]; + long off; + int i, w; + long y; + static short first = 1; +#ifdef POSIX_SEMANTICS + static char *savetz = NULL; + static int savetzlen = 0; + char *tz; +#endif /* POSIX_SEMANTICS */ +#ifndef HAVE_TM_ZONE +#ifndef HAVE_TM_NAME +#ifndef HAVE_TZNAME +#ifndef __CYGWIN__ + extern char *timezone(); + struct timeval tv; + struct timezone zone; +#endif /* __CYGWIN__ */ +#endif /* HAVE_TZNAME */ +#endif /* HAVE_TM_NAME */ +#endif /* HAVE_TM_ZONE */ +#ifdef POSIX_2008 + int pad; + size_t fw; + char flag; +#endif /* POSIX_2008 */ + + /* various tables, useful in North America */ + static const char *days_a[] = { + "Sun", "Mon", "Tue", "Wed", + "Thu", "Fri", "Sat", + }; + static const char *days_l[] = { + "Sunday", "Monday", "Tuesday", "Wednesday", + "Thursday", "Friday", "Saturday", + }; + static const char *months_a[] = { + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", + }; + static const char *months_l[] = { + "January", "February", "March", "April", + "May", "June", "July", "August", "September", + "October", "November", "December", + }; + static const char *ampm[] = { "AM", "PM", }; + + if (s == NULL || format == NULL || timeptr == NULL || maxsize == 0) + return 0; + + /* quick check if we even need to bother */ + if (strchr(format, '%') == NULL && strlen(format) + 1 >= maxsize) + return 0; + +#ifndef POSIX_SEMANTICS + if (first) { + tzset(); + first = 0; + } +#else /* POSIX_SEMANTICS */ +#if defined (SHELL) + tz = get_string_value ("TZ"); +#else + tz = getenv("TZ"); +#endif + if (first) { + if (tz != NULL) { + int tzlen = strlen(tz); + + savetz = (char *) malloc(tzlen + 1); + if (savetz != NULL) { + savetzlen = tzlen + 1; + strcpy(savetz, tz); + } + } + tzset(); + first = 0; + } + /* if we have a saved TZ, and it is different, recapture and reset */ + if (tz && savetz && (tz[0] != savetz[0] || strcmp(tz, savetz) != 0)) { + i = strlen(tz) + 1; + if (i > savetzlen) { + savetz = (char *) realloc(savetz, i); + if (savetz) { + savetzlen = i; + strcpy(savetz, tz); + } + } else + strcpy(savetz, tz); + tzset(); + } +#endif /* POSIX_SEMANTICS */ + + for (; *format && s < endp - 1; format++) { + tbuf[0] = '\0'; + if (*format != '%') { + *s++ = *format; + continue; + } +#ifdef POSIX_2008 + pad = '\0'; + fw = 0; + flag = '\0'; + switch (*++format) { + case '+': + flag = '+'; + /* fall through */ + case '0': + pad = '0'; + format++; + break; + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + break; + + default: + format--; + goto again; + } + for (; isdigit(*format); format++) { + fw = fw * 10 + (*format - '0'); + } + format--; +#endif /* POSIX_2008 */ + + again: + switch (*++format) { + case '\0': + *s++ = '%'; + goto out; + + case '%': + *s++ = '%'; + continue; + + case 'a': /* abbreviated weekday name */ + if (timeptr->tm_wday < 0 || timeptr->tm_wday > 6) + strcpy(tbuf, "?"); + else + strcpy(tbuf, days_a[timeptr->tm_wday]); + break; + + case 'A': /* full weekday name */ + if (timeptr->tm_wday < 0 || timeptr->tm_wday > 6) + strcpy(tbuf, "?"); + else + strcpy(tbuf, days_l[timeptr->tm_wday]); + break; + + case 'b': /* abbreviated month name */ + short_month: + if (timeptr->tm_mon < 0 || timeptr->tm_mon > 11) + strcpy(tbuf, "?"); + else + strcpy(tbuf, months_a[timeptr->tm_mon]); + break; + + case 'B': /* full month name */ + if (timeptr->tm_mon < 0 || timeptr->tm_mon > 11) + strcpy(tbuf, "?"); + else + strcpy(tbuf, months_l[timeptr->tm_mon]); + break; + + case 'c': /* appropriate date and time representation */ + /* + * This used to be: + * + * strftime(tbuf, sizeof tbuf, "%a %b %e %H:%M:%S %Y", timeptr); + * + * Now, per the ISO 1999 C standard, it this: + */ + strftime(tbuf, sizeof tbuf, "%A %B %d %T %Y", timeptr); + break; + + case 'C': +#ifdef POSIX_2008 + if (pad != '\0' && fw > 0) { + size_t min_fw = (flag ? 3 : 2); + + fw = max(fw, min_fw); + sprintf(tbuf, flag + ? "%+0*ld" + : "%0*ld", (int) fw, + (timeptr->tm_year + 1900L) / 100); + } else +#endif /* POSIX_2008 */ + century: + sprintf(tbuf, "%02ld", (timeptr->tm_year + 1900L) / 100); + break; + + case 'd': /* day of the month, 01 - 31 */ + i = range(1, timeptr->tm_mday, 31); + sprintf(tbuf, "%02d", i); + break; + + case 'D': /* date as %m/%d/%y */ + strftime(tbuf, sizeof tbuf, "%m/%d/%y", timeptr); + break; + + case 'e': /* day of month, blank padded */ + sprintf(tbuf, "%2d", range(1, timeptr->tm_mday, 31)); + break; + + case 'E': + /* POSIX (now C99) locale extensions, ignored for now */ + goto again; + + case 'F': /* ISO 8601 date representation */ + { +#ifdef POSIX_2008 + /* + * Field width for %F is for the whole thing. + * It must be at least 10. + */ + char m_d[10]; + strftime(m_d, sizeof m_d, "-%m-%d", timeptr); + size_t min_fw = 10; + + if (pad != '\0' && fw > 0) { + fw = max(fw, min_fw); + } else { + fw = min_fw; + } + + fw -= 6; /* -XX-XX at end are invariant */ + + iso_8601_2000_year(tbuf, timeptr->tm_year + 1900, fw); + strcat(tbuf, m_d); +#else + strftime(tbuf, sizeof tbuf, "%Y-%m-%d", timeptr); +#endif /* POSIX_2008 */ + } + break; + + case 'g': + case 'G': + /* + * Year of ISO week. + * + * If it's December but the ISO week number is one, + * that week is in next year. + * If it's January but the ISO week number is 52 or + * 53, that week is in last year. + * Otherwise, it's this year. + */ + w = iso8601wknum(timeptr); + if (timeptr->tm_mon == 11 && w == 1) + y = 1900L + timeptr->tm_year + 1; + else if (timeptr->tm_mon == 0 && w >= 52) + y = 1900L + timeptr->tm_year - 1; + else + y = 1900L + timeptr->tm_year; + + if (*format == 'G') { +#ifdef POSIX_2008 + if (pad != '\0' && fw > 0) { + size_t min_fw = 4; + + fw = max(fw, min_fw); + sprintf(tbuf, flag + ? "%+0*ld" + : "%0*ld", (int) fw, + y); + } else +#endif /* POSIX_2008 */ + sprintf(tbuf, "%ld", y); + } + else + sprintf(tbuf, "%02ld", y % 100); + break; + + case 'h': /* abbreviated month name */ + goto short_month; + + case 'H': /* hour, 24-hour clock, 00 - 23 */ + i = range(0, timeptr->tm_hour, 23); + sprintf(tbuf, "%02d", i); + break; + + case 'I': /* hour, 12-hour clock, 01 - 12 */ + i = range(0, timeptr->tm_hour, 23); + if (i == 0) + i = 12; + else if (i > 12) + i -= 12; + sprintf(tbuf, "%02d", i); + break; + + case 'j': /* day of the year, 001 - 366 */ + sprintf(tbuf, "%03d", timeptr->tm_yday + 1); + break; + + case 'm': /* month, 01 - 12 */ + i = range(0, timeptr->tm_mon, 11); + sprintf(tbuf, "%02d", i + 1); + break; + + case 'M': /* minute, 00 - 59 */ + i = range(0, timeptr->tm_min, 59); + sprintf(tbuf, "%02d", i); + break; + + case 'n': /* same as \n */ + tbuf[0] = '\n'; + tbuf[1] = '\0'; + break; + + case 'O': + /* POSIX (now C99) locale extensions, ignored for now */ + goto again; + + case 'p': /* am or pm based on 12-hour clock */ + i = range(0, timeptr->tm_hour, 23); + if (i < 12) + strcpy(tbuf, ampm[0]); + else + strcpy(tbuf, ampm[1]); + break; + + case 'r': /* time as %I:%M:%S %p */ + strftime(tbuf, sizeof tbuf, "%I:%M:%S %p", timeptr); + break; + + case 'R': /* time as %H:%M */ + strftime(tbuf, sizeof tbuf, "%H:%M", timeptr); + break; + +#if defined(HAVE_MKTIME) + case 's': /* time as seconds since the Epoch */ + { + struct tm non_const_timeptr; + + non_const_timeptr = *timeptr; + sprintf(tbuf, "%ld", mktime(& non_const_timeptr)); + break; + } +#endif /* defined(HAVE_MKTIME) */ + + case 'S': /* second, 00 - 60 */ + i = range(0, timeptr->tm_sec, 60); + sprintf(tbuf, "%02d", i); + break; + + case 't': /* same as \t */ + tbuf[0] = '\t'; + tbuf[1] = '\0'; + break; + + case 'T': /* time as %H:%M:%S */ + the_time: + strftime(tbuf, sizeof tbuf, "%H:%M:%S", timeptr); + break; + + case 'u': + /* ISO 8601: Weekday as a decimal number [1 (Monday) - 7] */ + sprintf(tbuf, "%d", timeptr->tm_wday == 0 ? 7 : + timeptr->tm_wday); + break; + + case 'U': /* week of year, Sunday is first day of week */ + sprintf(tbuf, "%02d", weeknumber(timeptr, 0)); + break; + + case 'V': /* week of year according ISO 8601 */ + sprintf(tbuf, "%02d", iso8601wknum(timeptr)); + break; + + case 'w': /* weekday, Sunday == 0, 0 - 6 */ + i = range(0, timeptr->tm_wday, 6); + sprintf(tbuf, "%d", i); + break; + + case 'W': /* week of year, Monday is first day of week */ + sprintf(tbuf, "%02d", weeknumber(timeptr, 1)); + break; + + case 'x': /* appropriate date representation */ + strftime(tbuf, sizeof tbuf, "%A %B %d %Y", timeptr); + break; + + case 'X': /* appropriate time representation */ + goto the_time; + break; + + case 'y': /* year without a century, 00 - 99 */ + year: + i = timeptr->tm_year % 100; + sprintf(tbuf, "%02d", i); + break; + + case 'Y': /* year with century */ +#ifdef POSIX_2008 + if (pad != '\0' && fw > 0) { + size_t min_fw = 4; + + fw = max(fw, min_fw); + sprintf(tbuf, flag + ? "%+0*ld" + : "%0*ld", (int) fw, + 1900L + timeptr->tm_year); + } else +#endif /* POSIX_2008 */ + sprintf(tbuf, "%ld", 1900L + timeptr->tm_year); + break; + + /* + * From: Chip Rosenthal + * Date: Sun, 19 Mar 1995 00:33:29 -0600 (CST) + * + * Warning: the %z [code] is implemented by inspecting the + * timezone name conditional compile settings, and + * inferring a method to get timezone offsets. I've tried + * this code on a couple of machines, but I don't doubt + * there is some system out there that won't like it. + * Maybe the easiest thing to do would be to bracket this + * with an #ifdef that can turn it off. The %z feature + * would be an admittedly obscure one that most folks can + * live without, but it would be a great help to those of + * us that muck around with various message processors. + */ + case 'z': /* time zone offset east of GMT e.g. -0600 */ + if (timeptr->tm_isdst < 0) + break; +#ifdef HAVE_TM_NAME + /* + * Systems with tm_name probably have tm_tzadj as + * secs west of GMT. Convert to mins east of GMT. + */ + off = -timeptr->tm_tzadj / 60; +#else /* !HAVE_TM_NAME */ +#ifdef HAVE_TM_ZONE + /* + * Systems with tm_zone probably have tm_gmtoff as + * secs east of GMT. Convert to mins east of GMT. + */ + off = timeptr->tm_gmtoff / 60; +#else /* !HAVE_TM_ZONE */ +#if HAVE_TZNAME + /* + * Systems with tzname[] probably have timezone as + * secs west of GMT. Convert to mins east of GMT. + */ +# if defined(__hpux) || defined (HPUX) || defined(__CYGWIN__) + off = -timezone / 60; +# else + /* ADR: 4 August 2001, fixed this per gazelle@interaccess.com */ + off = -(daylight ? altzone : timezone) / 60; +# endif +#else /* !HAVE_TZNAME */ + gettimeofday(& tv, & zone); + off = -zone.tz_minuteswest; +#endif /* !HAVE_TZNAME */ +#endif /* !HAVE_TM_ZONE */ +#endif /* !HAVE_TM_NAME */ + if (off < 0) { + tbuf[0] = '-'; + off = -off; + } else { + tbuf[0] = '+'; + } + sprintf(tbuf+1, "%02ld%02ld", off/60, off%60); + break; + + case 'Z': /* time zone name or abbrevation */ +#ifdef HAVE_TZNAME + i = (daylight && timeptr->tm_isdst > 0); /* 0 or 1 */ + strcpy(tbuf, tzname[i]); +#else +#ifdef HAVE_TM_ZONE + strcpy(tbuf, timeptr->tm_zone); +#else +#ifdef HAVE_TM_NAME + strcpy(tbuf, timeptr->tm_name); +#else + gettimeofday(& tv, & zone); + strcpy(tbuf, timezone(zone.tz_minuteswest, + timeptr->tm_isdst > 0)); +#endif /* HAVE_TM_NAME */ +#endif /* HAVE_TM_ZONE */ +#endif /* HAVE_TZNAME */ + break; + +#ifdef SUNOS_EXT + case 'k': /* hour, 24-hour clock, blank pad */ + sprintf(tbuf, "%2d", range(0, timeptr->tm_hour, 23)); + break; + + case 'l': /* hour, 12-hour clock, 1 - 12, blank pad */ + i = range(0, timeptr->tm_hour, 23); + if (i == 0) + i = 12; + else if (i > 12) + i -= 12; + sprintf(tbuf, "%2d", i); + break; +#endif + +#ifdef HPUX_EXT + case 'N': /* Emperor/Era name */ + /* this is essentially the same as the century */ + goto century; /* %C */ + + case 'o': /* Emperor/Era year */ + goto year; /* %y */ +#endif /* HPUX_EXT */ + + +#ifdef VMS_EXT + case 'v': /* date as dd-bbb-YYYY */ + sprintf(tbuf, "%2d-%3.3s-%4ld", + range(1, timeptr->tm_mday, 31), + months_a[range(0, timeptr->tm_mon, 11)], + timeptr->tm_year + 1900L); + for (i = 3; i < 6; i++) + if (islower(tbuf[i])) + tbuf[i] = toupper(tbuf[i]); + break; +#endif + + default: + tbuf[0] = '%'; + tbuf[1] = *format; + tbuf[2] = '\0'; + break; + } + i = strlen(tbuf); + if (i) { + if (s + i < endp - 1) { + strcpy(s, tbuf); + s += i; + } else + return 0; + } + } +out: + if (s < endp && *format == '\0') { + *s = '\0'; + return (s - start); + } else + return 0; +} + +/* isleap --- is a year a leap year? */ + +static int +isleap(long year) +{ + return ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0); +} + + +/* iso8601wknum --- compute week number according to ISO 8601 */ + +static int +iso8601wknum(const struct tm *timeptr) +{ + /* + * From 1003.2: + * If the week (Monday to Sunday) containing January 1 + * has four or more days in the new year, then it is week 1; + * otherwise it is the highest numbered week of the previous + * year (52 or 53), and the next week is week 1. + * + * ADR: This means if Jan 1 was Monday through Thursday, + * it was week 1, otherwise week 52 or 53. + * + * XPG4 erroneously included POSIX.2 rationale text in the + * main body of the standard. Thus it requires week 53. + */ + + int weeknum, jan1day, diff; + + /* get week number, Monday as first day of the week */ + weeknum = weeknumber(timeptr, 1); + + /* + * With thanks and tip of the hatlo to tml@tik.vtt.fi + * + * What day of the week does January 1 fall on? + * We know that + * (timeptr->tm_yday - jan1.tm_yday) MOD 7 == + * (timeptr->tm_wday - jan1.tm_wday) MOD 7 + * and that + * jan1.tm_yday == 0 + * and that + * timeptr->tm_wday MOD 7 == timeptr->tm_wday + * from which it follows that. . . + */ + jan1day = timeptr->tm_wday - (timeptr->tm_yday % 7); + if (jan1day < 0) + jan1day += 7; + + /* + * If Jan 1 was a Monday through Thursday, it was in + * week 1. Otherwise it was last year's highest week, which is + * this year's week 0. + * + * What does that mean? + * If Jan 1 was Monday, the week number is exactly right, it can + * never be 0. + * If it was Tuesday through Thursday, the weeknumber is one + * less than it should be, so we add one. + * Otherwise, Friday, Saturday or Sunday, the week number is + * OK, but if it is 0, it needs to be 52 or 53. + */ + switch (jan1day) { + case 1: /* Monday */ + break; + case 2: /* Tuesday */ + case 3: /* Wednesday */ + case 4: /* Thursday */ + weeknum++; + break; + case 5: /* Friday */ + case 6: /* Saturday */ + case 0: /* Sunday */ + if (weeknum == 0) { +#ifdef USE_BROKEN_XPG4 + /* XPG4 (as of March 1994) says 53 unconditionally */ + weeknum = 53; +#else + /* get week number of last week of last year */ + struct tm dec31ly; /* 12/31 last year */ + dec31ly = *timeptr; + dec31ly.tm_year--; + dec31ly.tm_mon = 11; + dec31ly.tm_mday = 31; + dec31ly.tm_wday = (jan1day == 0) ? 6 : jan1day - 1; + dec31ly.tm_yday = 364 + isleap(dec31ly.tm_year + 1900L); + weeknum = iso8601wknum(& dec31ly); +#endif + } + break; + } + + if (timeptr->tm_mon == 11) { + /* + * The last week of the year + * can be in week 1 of next year. + * Sigh. + * + * This can only happen if + * M T W + * 29 30 31 + * 30 31 + * 31 + */ + int wday, mday; + + wday = timeptr->tm_wday; + mday = timeptr->tm_mday; + if ( (wday == 1 && (mday >= 29 && mday <= 31)) + || (wday == 2 && (mday == 30 || mday == 31)) + || (wday == 3 && mday == 31)) + weeknum = 1; + } + + return weeknum; +} + +/* weeknumber --- figure how many weeks into the year */ + +/* With thanks and tip of the hatlo to ado@elsie.nci.nih.gov */ + +static int +weeknumber(const struct tm *timeptr, int firstweekday) +{ + int wday = timeptr->tm_wday; + int ret; + + if (firstweekday == 1) { + if (wday == 0) /* sunday */ + wday = 6; + else + wday--; + } + ret = ((timeptr->tm_yday + 7 - wday) / 7); + if (ret < 0) + ret = 0; + return ret; +} + +#if 0 +/* ADR --- I'm loathe to mess with ado's code ... */ + +Date: Wed, 24 Apr 91 20:54:08 MDT +From: Michal Jaegermann +To: arnold@audiofax.com + +Hi Arnold, +in a process of fixing of strftime() in libraries on Atari ST I grabbed +some pieces of code from your own strftime. When doing that it came +to mind that your weeknumber() function compiles a little bit nicer +in the following form: +/* + * firstweekday is 0 if starting in Sunday, non-zero if in Monday + */ +{ + return (timeptr->tm_yday - timeptr->tm_wday + + (firstweekday ? (timeptr->tm_wday ? 8 : 1) : 7)) / 7; +} +How nicer it depends on a compiler, of course, but always a tiny bit. + + Cheers, + Michal + ntomczak@vm.ucs.ualberta.ca +#endif + +#ifdef TEST_STRFTIME + +/* + * NAME: + * tst + * + * SYNOPSIS: + * tst + * + * DESCRIPTION: + * "tst" is a test driver for the function "strftime". + * + * OPTIONS: + * None. + * + * AUTHOR: + * Karl Vogel + * Control Data Systems, Inc. + * vogelke@c-17igp.wpafb.af.mil + * + * BUGS: + * None noticed yet. + * + * COMPILE: + * cc -o tst -DTEST_STRFTIME strftime.c + */ + +/* ADR: I reformatted this to my liking, and deleted some unneeded code. */ + +#ifndef NULL +#include +#endif +#include +#include + +#define MAXTIME 132 + +/* + * Array of time formats. + */ + +static char *array[] = +{ + "(%%A) full weekday name, var length (Sunday..Saturday) %A", + "(%%B) full month name, var length (January..December) %B", + "(%%C) Century %C", + "(%%D) date (%%m/%%d/%%y) %D", + "(%%E) Locale extensions (ignored) %E", + "(%%F) full month name, var length (January..December) %F", + "(%%H) hour (24-hour clock, 00..23) %H", + "(%%I) hour (12-hour clock, 01..12) %I", + "(%%M) minute (00..59) %M", + "(%%N) Emporer/Era Name %N", + "(%%O) Locale extensions (ignored) %O", + "(%%R) time, 24-hour (%%H:%%M) %R", + "(%%S) second (00..60) %S", + "(%%T) time, 24-hour (%%H:%%M:%%S) %T", + "(%%U) week of year, Sunday as first day of week (00..53) %U", + "(%%V) week of year according to ISO 8601 %V", + "(%%W) week of year, Monday as first day of week (00..53) %W", + "(%%X) appropriate locale time representation (%H:%M:%S) %X", + "(%%Y) year with century (1970...) %Y", + "(%%Z) timezone (EDT), or blank if timezone not determinable %Z", + "(%%a) locale's abbreviated weekday name (Sun..Sat) %a", + "(%%b) locale's abbreviated month name (Jan..Dec) %b", + "(%%c) full date (Sat Nov 4 12:02:33 1989)%n%t%t%t %c", + "(%%d) day of the month (01..31) %d", + "(%%e) day of the month, blank-padded ( 1..31) %e", + "(%%h) should be same as (%%b) %h", + "(%%j) day of the year (001..366) %j", + "(%%k) hour, 24-hour clock, blank pad ( 0..23) %k", + "(%%l) hour, 12-hour clock, blank pad ( 0..12) %l", + "(%%m) month (01..12) %m", + "(%%o) Emporer/Era Year %o", + "(%%p) locale's AM or PM based on 12-hour clock %p", + "(%%r) time, 12-hour (same as %%I:%%M:%%S %%p) %r", + "(%%u) ISO 8601: Weekday as decimal number [1 (Monday) - 7] %u", + "(%%v) VMS date (dd-bbb-YYYY) %v", + "(%%w) day of week (0..6, Sunday == 0) %w", + "(%%x) appropriate locale date representation %x", + "(%%y) last two digits of year (00..99) %y", + "(%%z) timezone offset east of GMT as HHMM (e.g. -0500) %z", + (char *) NULL +}; + +/* main routine. */ + +int +main(argc, argv) +int argc; +char **argv; +{ + long time(); + + char *next; + char string[MAXTIME]; + + int k; + int length; + + struct tm *tm; + + long clock; + + /* Call the function. */ + + clock = time((long *) 0); + tm = localtime(&clock); + + for (k = 0; next = array[k]; k++) { + length = strftime(string, MAXTIME, next, tm); + printf("%s\n", string); + } + + exit(0); +} +#endif /* TEST_STRFTIME */ diff --git a/lib/sh/stringlist.c b/lib/sh/stringlist.c new file mode 100644 index 0000000..b0c272a --- /dev/null +++ b/lib/sh/stringlist.c @@ -0,0 +1,297 @@ +/* stringlist.c - functions to handle a generic `list of strings' structure */ + +/* Copyright (C) 2000-2002 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include + +#include "shell.h" + +#ifdef STRDUP +# undef STRDUP +#endif +#define STRDUP(x) ((x) ? savestring (x) : (char *)NULL) + +/* Allocate a new STRINGLIST, with room for N strings. */ + +STRINGLIST * +strlist_create (n) + int n; +{ + STRINGLIST *ret; + register int i; + + ret = (STRINGLIST *)xmalloc (sizeof (STRINGLIST)); + if (n) + { + ret->list = strvec_create (n+1); + ret->list_size = n; + for (i = 0; i < n; i++) + ret->list[i] = (char *)NULL; + } + else + { + ret->list = (char **)NULL; + ret->list_size = 0; + } + ret->list_len = 0; + return ret; +} + +STRINGLIST * +strlist_resize (sl, n) + STRINGLIST *sl; + int n; +{ + register int i; + + if (sl == 0) + return (sl = strlist_create (n)); + + if (n > sl->list_size) + { + sl->list = strvec_resize (sl->list, n + 1); + for (i = sl->list_size; i <= n; i++) + sl->list[i] = (char *)NULL; + sl->list_size = n; + } + return sl; +} + +void +strlist_flush (sl) + STRINGLIST *sl; +{ + if (sl == 0 || sl->list == 0) + return; + strvec_flush (sl->list); + sl->list_len = 0; +} + +void +strlist_dispose (sl) + STRINGLIST *sl; +{ + if (sl == 0) + return; + if (sl->list) + strvec_dispose (sl->list); + free (sl); +} + +int +strlist_remove (sl, s) + STRINGLIST *sl; + char *s; +{ + int r; + + if (sl == 0 || sl->list == 0 || sl->list_len == 0) + return 0; + + r = strvec_remove (sl->list, s); + if (r) + sl->list_len--; + return r; +} + +STRINGLIST * +strlist_copy (sl) + STRINGLIST *sl; +{ + STRINGLIST *new; + register int i; + + if (sl == 0) + return ((STRINGLIST *)0); + new = strlist_create (sl->list_size); + /* I'd like to use strvec_copy, but that doesn't copy everything. */ + if (sl->list) + { + for (i = 0; i < sl->list_size; i++) + new->list[i] = STRDUP (sl->list[i]); + } + new->list_size = sl->list_size; + new->list_len = sl->list_len; + /* just being careful */ + if (new->list) + new->list[new->list_len] = (char *)NULL; + return new; +} + +/* Return a new STRINGLIST with everything from M1 and M2. */ + +STRINGLIST * +strlist_merge (m1, m2) + STRINGLIST *m1, *m2; +{ + STRINGLIST *sl; + int i, n, l1, l2; + + l1 = m1 ? m1->list_len : 0; + l2 = m2 ? m2->list_len : 0; + + sl = strlist_create (l1 + l2 + 1); + for (i = n = 0; i < l1; i++, n++) + sl->list[n] = STRDUP (m1->list[i]); + for (i = 0; i < l2; i++, n++) + sl->list[n] = STRDUP (m2->list[i]); + sl->list_len = n; + sl->list[n] = (char *)NULL; + return (sl); +} + +/* Make STRINGLIST M1 contain everything in M1 and M2. */ +STRINGLIST * +strlist_append (m1, m2) + STRINGLIST *m1, *m2; +{ + register int i, n, len1, len2; + + if (m1 == 0) + return (m2 ? strlist_copy (m2) : (STRINGLIST *)0); + + len1 = m1->list_len; + len2 = m2 ? m2->list_len : 0; + + if (len2) + { + m1 = strlist_resize (m1, len1 + len2 + 1); + for (i = 0, n = len1; i < len2; i++, n++) + m1->list[n] = STRDUP (m2->list[i]); + m1->list[n] = (char *)NULL; + m1->list_len = n; + } + + return m1; +} + +STRINGLIST * +strlist_prefix_suffix (sl, prefix, suffix) + STRINGLIST *sl; + char *prefix, *suffix; +{ + int plen, slen, tlen, llen, i; + char *t; + + if (sl == 0 || sl->list == 0 || sl->list_len == 0) + return sl; + + plen = STRLEN (prefix); + slen = STRLEN (suffix); + + if (plen == 0 && slen == 0) + return (sl); + + for (i = 0; i < sl->list_len; i++) + { + llen = STRLEN (sl->list[i]); + tlen = plen + llen + slen + 1; + t = (char *)xmalloc (tlen + 1); + if (plen) + strcpy (t, prefix); + strcpy (t + plen, sl->list[i]); + if (slen) + strcpy (t + plen + llen, suffix); + free (sl->list[i]); + sl->list[i] = t; + } + + return (sl); +} + +void +strlist_print (sl, prefix) + STRINGLIST *sl; + char *prefix; +{ + register int i; + + if (sl == 0) + return; + for (i = 0; i < sl->list_len; i++) + printf ("%s%s\n", prefix ? prefix : "", sl->list[i]); +} + +void +strlist_walk (sl, func) + STRINGLIST *sl; + sh_strlist_map_func_t *func; +{ + register int i; + + if (sl == 0) + return; + for (i = 0; i < sl->list_len; i++) + if ((*func)(sl->list[i]) < 0) + break; +} + +void +strlist_sort (sl) + STRINGLIST *sl; +{ + if (sl == 0 || sl->list_len == 0 || sl->list == 0) + return; + strvec_sort (sl->list); +} + +STRINGLIST * +strlist_from_word_list (list, alloc, starting_index, ip) + WORD_LIST *list; + int alloc, starting_index, *ip; +{ + STRINGLIST *ret; + int slen, len; + + if (list == 0) + { + if (ip) + *ip = 0; + return ((STRINGLIST *)0); + } + slen = list_length (list); + ret = (STRINGLIST *)xmalloc (sizeof (STRINGLIST)); + ret->list = strvec_from_word_list (list, alloc, starting_index, &len); + ret->list_size = slen + starting_index; + ret->list_len = len; + if (ip) + *ip = len; + return ret; +} + +WORD_LIST * +strlist_to_word_list (sl, alloc, starting_index) + STRINGLIST *sl; + int alloc, starting_index; +{ + WORD_LIST *list; + + if (sl == 0 || sl->list == 0) + return ((WORD_LIST *)NULL); + + list = strvec_to_word_list (sl->list, alloc, starting_index); + return list; +} diff --git a/lib/sh/stringvec.c b/lib/sh/stringvec.c new file mode 100644 index 0000000..3bb4ab7 --- /dev/null +++ b/lib/sh/stringvec.c @@ -0,0 +1,248 @@ +/* stringvec.c - functions for managing arrays of strings. */ + +/* Copyright (C) 2000-2002 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include +#include + +#include "shell.h" + +/* Allocate an array of strings with room for N members. */ +char ** +strvec_create (n) + int n; +{ + return ((char **)xmalloc ((n) * sizeof (char *))); +} + +/* Allocate an array of strings with room for N members. */ +char ** +strvec_mcreate (n) + int n; +{ + return ((char **)malloc ((n) * sizeof (char *))); +} + +char ** +strvec_resize (array, nsize) + char **array; + int nsize; +{ + return ((char **)xrealloc (array, nsize * sizeof (char *))); +} + +char ** +strvec_mresize (array, nsize) + char **array; + int nsize; +{ + return ((char **)realloc (array, nsize * sizeof (char *))); +} + +/* Return the length of ARRAY, a NULL terminated array of char *. */ +int +strvec_len (array) + char **array; +{ + register int i; + + for (i = 0; array[i]; i++); + return (i); +} + +/* Free the contents of ARRAY, a NULL terminated array of char *. */ +void +strvec_flush (array) + char **array; +{ + register int i; + + if (array == 0) + return; + + for (i = 0; array[i]; i++) + free (array[i]); +} + +void +strvec_dispose (array) + char **array; +{ + if (array == 0) + return; + + strvec_flush (array); + free (array); +} + +int +strvec_remove (array, name) + char **array, *name; +{ + register int i, j; + char *x; + + if (array == 0) + return 0; + + for (i = 0; array[i]; i++) + if (STREQ (name, array[i])) + { + x = array[i]; + for (j = i; array[j]; j++) + array[j] = array[j + 1]; + free (x); + return 1; + } + return 0; +} + +#ifdef INCLUDE_UNUSED +/* Find NAME in ARRAY. Return the index of NAME, or -1 if not present. + ARRAY should be NULL terminated. */ +int +strvec_search (array, name) + char **array, *name; +{ + int i; + + for (i = 0; array[i]; i++) + if (STREQ (name, array[i])) + return (i); + + return (-1); +} +#endif + +/* Allocate and return a new copy of ARRAY and its contents. */ +char ** +strvec_copy (array) + char **array; +{ + register int i; + int len; + char **ret; + + len = strvec_len (array); + + ret = (char **)xmalloc ((len + 1) * sizeof (char *)); + for (i = 0; array[i]; i++) + ret[i] = savestring (array[i]); + ret[i] = (char *)NULL; + + return (ret); +} + +/* Comparison routine for use with qsort() on arrays of strings. Uses + strcoll(3) if available, otherwise it uses strcmp(3). */ +int +strvec_strcmp (s1, s2) + register char **s1, **s2; +{ +#if defined (HAVE_STRCOLL) + return (strcoll (*s1, *s2)); +#else /* !HAVE_STRCOLL */ + int result; + + if ((result = **s1 - **s2) == 0) + result = strcmp (*s1, *s2); + + return (result); +#endif /* !HAVE_STRCOLL */ +} + +/* Sort ARRAY, a null terminated array of pointers to strings. */ +void +strvec_sort (array) + char **array; +{ + qsort (array, strvec_len (array), sizeof (char *), (QSFUNC *)strvec_strcmp); +} + +/* Cons up a new array of words. The words are taken from LIST, + which is a WORD_LIST *. If ALLOC is true, everything is malloc'ed, + so you should free everything in this array when you are done. + The array is NULL terminated. If IP is non-null, it gets the + number of words in the returned array. STARTING_INDEX says where + to start filling in the returned array; it can be used to reserve + space at the beginning of the array. */ + +char ** +strvec_from_word_list (list, alloc, starting_index, ip) + WORD_LIST *list; + int alloc, starting_index, *ip; +{ + int count; + char **array; + + count = list_length (list); + array = (char **)xmalloc ((1 + count + starting_index) * sizeof (char *)); + + for (count = 0; count < starting_index; count++) + array[count] = (char *)NULL; + for (count = starting_index; list; count++, list = list->next) + array[count] = alloc ? savestring (list->word->word) : list->word->word; + array[count] = (char *)NULL; + + if (ip) + *ip = count; + return (array); +} + +/* Convert an array of strings into the form used internally by the shell. + ALLOC means to allocate new storage for each WORD_DESC in the returned + list rather than copy the values in ARRAY. STARTING_INDEX says where + in ARRAY to begin. */ + +WORD_LIST * +strvec_to_word_list (array, alloc, starting_index) + char **array; + int alloc, starting_index; +{ + WORD_LIST *list; + WORD_DESC *w; + int i, count; + + if (array == 0 || array[0] == 0) + return (WORD_LIST *)NULL; + + for (count = 0; array[count]; count++) + ; + + for (i = starting_index, list = (WORD_LIST *)NULL; i < count; i++) + { + w = make_bare_word (alloc ? array[i] : ""); + if (alloc == 0) + { + free (w->word); + w->word = array[i]; + } + list = make_word_list (w, list); + } + return (REVERSE_LIST (list, WORD_LIST *)); +} diff --git a/lib/sh/strnlen.c b/lib/sh/strnlen.c new file mode 100644 index 0000000..10414d3 --- /dev/null +++ b/lib/sh/strnlen.c @@ -0,0 +1,49 @@ +/* strnlen - return length of passed string, with length limit */ + +/* Copyright (C) 2004 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#if !defined (HAVE_STRNLEN) + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include + +/* Find the length of S, but scan at most MAXLEN characters. If no '\0' + terminator is found within the first MAXLEN characters, return MAXLEN. */ +size_t +strnlen (s, maxlen) + register const char *s; + size_t maxlen; +{ + register const char *e; + size_t n; + + for (e = s, n = 0; *e && n < maxlen; e++, n++) + ; + return n; +} +#endif diff --git a/lib/sh/strpbrk.c b/lib/sh/strpbrk.c new file mode 100644 index 0000000..8cce830 --- /dev/null +++ b/lib/sh/strpbrk.c @@ -0,0 +1,49 @@ +/* strpbrk.c - locate multiple characters in a string */ + +/* Copyright (C) 1991, 1994 Free Software Foundation, Inc. + + NOTE: The canonical source of this file is maintained with the GNU C Library. + Bugs can be reported to bug-glibc@prep.ai.mit.edu. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#if !defined (HAVE_STRPBRK) + +#include + +/* Find the first occurrence in S of any character in ACCEPT. */ +char * +strpbrk (s, accept) + register const char *s; + register const char *accept; +{ + while (*s != '\0') + { + const char *a = accept; + while (*a != '\0') + if (*a++ == *s) + return (char *) s; + ++s; + } + + return 0; +} +#endif diff --git a/lib/sh/strstr.c b/lib/sh/strstr.c new file mode 100644 index 0000000..c43b05e --- /dev/null +++ b/lib/sh/strstr.c @@ -0,0 +1,125 @@ +/* strstr - find a substring within a string */ + +/* Copyright (C) 1994, 1999 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* + * My personal strstr() implementation that beats most other algorithms. + * Until someone tells me otherwise, I assume that this is the + * fastest implementation of strstr() in C. + * I deliberately chose not to comment it. You should have at least + * as much fun trying to understand it, as I had to write it :-). + * + * Stephen R. van den Berg, berg@pool.informatik.rwth-aachen.de */ + +#if HAVE_CONFIG_H +# include +#endif + +#if defined _LIBC || defined HAVE_STRING_H +# include +#endif +#include + +typedef unsigned chartype; + +#undef strstr + +char * +strstr (const char *phaystack, const char *pneedle) +{ + register const unsigned char *haystack, *needle; + register chartype b, c; + + haystack = (const unsigned char *) phaystack; + needle = (const unsigned char *) pneedle; + + b = *needle; + if (b != '\0') + { + haystack--; /* possible ANSI violation */ + do + { + c = *++haystack; + if (c == '\0') + goto ret0; + } + while (c != b); + + c = *++needle; + if (c == '\0') + goto foundneedle; + ++needle; + goto jin; + + for (;;) + { + register chartype a; + register const unsigned char *rhaystack, *rneedle; + + do + { + a = *++haystack; + if (a == '\0') + goto ret0; + if (a == b) + break; + a = *++haystack; + if (a == '\0') + goto ret0; +shloop:; } + while (a != b); + +jin: a = *++haystack; + if (a == '\0') + goto ret0; + + if (a != c) + goto shloop; + + rhaystack = haystack-- + 1; + rneedle = needle; + a = *rneedle; + + if (*rhaystack == a) + do + { + if (a == '\0') + goto foundneedle; + ++rhaystack; + a = *++needle; + if (*rhaystack != a) + break; + if (a == '\0') + goto foundneedle; + ++rhaystack; + a = *++needle; + } + while (*rhaystack == a); + + needle = rneedle; /* took the register-poor approach */ + + if (a == '\0') + break; + } + } +foundneedle: + return (char*) haystack; +ret0: + return 0; +} diff --git a/lib/sh/strtod.c b/lib/sh/strtod.c new file mode 100644 index 0000000..851d99b --- /dev/null +++ b/lib/sh/strtod.c @@ -0,0 +1,201 @@ +/* strtod.c - convert string to double-precision floating-point value. */ + +/* Copyright (C) 1991, 1992 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if HAVE_CONFIG_H +# include +#endif + +#ifndef HAVE_STRTOD + +#include +#ifndef errno +extern int errno; +#endif + +#include +#include + +#if HAVE_FLOAT_H +# include +#else +# define DBL_MAX 1.7976931348623159e+308 +# define DBL_MIN 2.2250738585072010e-308 +#endif + +#include + +#ifndef NULL +# define NULL 0 +#endif + +#ifndef HUGE_VAL +# define HUGE_VAL HUGE +#endif + +/* Convert NPTR to a double. If ENDPTR is not NULL, a pointer to the + character after the last one used in the number is put in *ENDPTR. */ +double +strtod (nptr, endptr) + const char *nptr; + char **endptr; +{ + register const char *s; + short sign; + + /* The number so far. */ + double num; + + int got_dot; /* Found a decimal point. */ + int got_digit; /* Seen any digits. */ + + /* The exponent of the number. */ + long int exponent; + + if (nptr == NULL) + { + errno = EINVAL; + goto noconv; + } + + s = nptr; + + /* Eat whitespace. */ + while (ISSPACE ((unsigned char)*s)) + ++s; + + /* Get the sign. */ + sign = *s == '-' ? -1 : 1; + if (*s == '-' || *s == '+') + ++s; + + num = 0.0; + got_dot = 0; + got_digit = 0; + exponent = 0; + for (;; ++s) + { + if (DIGIT (*s)) + { + got_digit = 1; + + /* Make sure that multiplication by 10 will not overflow. */ + if (num > DBL_MAX * 0.1) + /* The value of the digit doesn't matter, since we have already + gotten as many digits as can be represented in a `double'. + This doesn't necessarily mean the result will overflow. + The exponent may reduce it to within range. + + We just need to record that there was another + digit so that we can multiply by 10 later. */ + ++exponent; + else + num = (num * 10.0) + (*s - '0'); + + /* Keep track of the number of digits after the decimal point. + If we just divided by 10 here, we would lose precision. */ + if (got_dot) + --exponent; + } + else if (!got_dot && *s == '.') + /* Record that we have found the decimal point. */ + got_dot = 1; + else + /* Any other character terminates the number. */ + break; + } + + if (!got_digit) + goto noconv; + + if (TOLOWER ((unsigned char)*s) == 'e') + { + /* Get the exponent specified after the `e' or `E'. */ + int save = errno; + char *end; + long int exp; + + errno = 0; + ++s; + exp = strtol (s, &end, 10); + if (errno == ERANGE) + { + /* The exponent overflowed a `long int'. It is probably a safe + assumption that an exponent that cannot be represented by + a `long int' exceeds the limits of a `double'. */ + if (endptr != NULL) + *endptr = end; + if (exp < 0) + goto underflow; + else + goto overflow; + } + else if (end == s) + /* There was no exponent. Reset END to point to + the 'e' or 'E', so *ENDPTR will be set there. */ + end = (char *) s - 1; + errno = save; + s = end; + exponent += exp; + } + + if (endptr != NULL) + *endptr = (char *) s; + + if (num == 0.0) + return 0.0; + + /* Multiply NUM by 10 to the EXPONENT power, + checking for overflow and underflow. */ + + if (exponent < 0) + { + if (num < DBL_MIN * pow (10.0, (double) -exponent)) + goto underflow; + } + else if (exponent > 0) + { + if (num > DBL_MAX * pow (10.0, (double) -exponent)) + goto overflow; + } + + num *= pow (10.0, (double) exponent); + + return num * sign; + +overflow: + /* Return an overflow error. */ + errno = ERANGE; + return HUGE_VAL * sign; + +underflow: + /* Return an underflow error. */ + if (endptr != NULL) + *endptr = (char *) nptr; + errno = ERANGE; + return 0.0; + +noconv: + /* There was no number. */ + if (endptr != NULL) + *endptr = (char *) nptr; + return 0.0; +} + +#endif /* !HAVE_STRTOD */ diff --git a/lib/sh/strtoimax.c b/lib/sh/strtoimax.c new file mode 100644 index 0000000..a4170f0 --- /dev/null +++ b/lib/sh/strtoimax.c @@ -0,0 +1,113 @@ +/* strtoimax - convert string representation of a number into an intmax_t value. */ + +/* Copyright 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Written by Paul Eggert. Modified by Chet Ramey for Bash. */ + +#if HAVE_CONFIG_H +# include +#endif + +#if HAVE_INTTYPES_H +# include +#endif + +#if HAVE_STDINT_H +# include +#endif + +#if HAVE_STDLIB_H +# include +#endif + +#include + +/* Verify a requirement at compile-time (unlike assert, which is runtime). */ +#define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; } + +#ifndef HAVE_DECL_STRTOL +"this configure-time declaration test was not run" +#endif +#if !HAVE_DECL_STRTOL +extern long strtol __P((const char *, char **, int)); +#endif + +#ifndef HAVE_DECL_STRTOLL +"this configure-time declaration test was not run" +#endif +#if !HAVE_DECL_STRTOLL && HAVE_LONG_LONG +extern long long strtoll __P((const char *, char **, int)); +#endif + +#ifdef strtoimax +#undef strtoimax +#endif + +intmax_t +strtoimax (ptr, endptr, base) + const char *ptr; + char **endptr; + int base; +{ +#if HAVE_LONG_LONG + verify(size_is_that_of_long_or_long_long, + (sizeof (intmax_t) == sizeof (long) || + sizeof (intmax_t) == sizeof (long long))); + + if (sizeof (intmax_t) != sizeof (long)) + return (strtoll (ptr, endptr, base)); +#else + verify (size_is_that_of_long, sizeof (intmax_t) == sizeof (long)); +#endif + + return (strtol (ptr, endptr, base)); +} + +#ifdef TESTING +# include +int +main () +{ + char *p, *endptr; + intmax_t x; +#if HAVE_LONG_LONG + long long y; +#endif + long z; + + printf ("sizeof intmax_t: %d\n", sizeof (intmax_t)); + +#if HAVE_LONG_LONG + printf ("sizeof long long: %d\n", sizeof (long long)); +#endif + printf ("sizeof long: %d\n", sizeof (long)); + + x = strtoimax("42", &endptr, 10); +#if HAVE_LONG_LONG + y = strtoll("42", &endptr, 10); +#else + y = -1; +#endif + z = strtol("42", &endptr, 10); + + printf ("%lld %lld %ld\n", x, y, z); + + exit (0); +} +#endif diff --git a/lib/sh/strtol.c b/lib/sh/strtol.c new file mode 100644 index 0000000..8aa7478 --- /dev/null +++ b/lib/sh/strtol.c @@ -0,0 +1,259 @@ +/* strtol - convert string representation of a number into a long integer value. */ + +/* Copyright (C) 1991,92,94,95,96,97,98,99,2000,2001 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if !defined (HAVE_STRTOL) + +#include +#include + +#ifndef errno +extern int errno; +#endif + +#ifndef __set_errno +# define __set_errno(Val) errno = (Val) +#endif + +#ifdef HAVE_LIMITS_H +# include +#endif + +#include + +#include +#include + +#ifndef NULL +# define NULL 0 +#endif + +/* Nonzero if we are defining `strtoul' or `strtoull', operating on + unsigned integers. */ +#ifndef UNSIGNED +# define UNSIGNED 0 +# define INT LONG int +#else +# define INT unsigned LONG int +#endif + +#if UNSIGNED +# ifdef QUAD +# define strtol strtoull +# else +# define strtol strtoul +# endif +#else +# ifdef QUAD +# define strtol strtoll +# endif +#endif + +/* If QUAD is defined, we are defining `strtoll' or `strtoull', + operating on `long long ints. */ + +#ifdef QUAD +# define LONG long long +# define STRTOL_LONG_MIN LLONG_MIN +# define STRTOL_LONG_MAX LLONG_MAX +# define STRTOL_ULONG_MAX ULLONG_MAX +#else /* !QUAD */ +# define LONG long +# define STRTOL_LONG_MIN LONG_MIN +# define STRTOL_LONG_MAX LONG_MAX +# define STRTOL_ULONG_MAX ULONG_MAX +#endif + +/* Convert NPTR to an `unsigned long int' or `long int' in base BASE. + If BASE is 0 the base is determined by the presence of a leading + zero, indicating octal or a leading "0x" or "0X", indicating hexadecimal. + If BASE is < 2 or > 36, it is no longer reset to 10; EINVAL is returned. + If ENDPTR is not NULL, a pointer to the character after the last + one converted is stored in *ENDPTR. */ + +INT +strtol (nptr, endptr, base) + const char *nptr; + char **endptr; + int base; +{ + int negative; + register unsigned LONG int cutoff; + register unsigned int cutlim; + register unsigned LONG int i; + register const char *s; + register unsigned char c; + const char *save, *end; + int overflow; + + if (base < 0 || base == 1 || base > 36) + { + __set_errno (EINVAL); + return 0; + } + + save = s = nptr; + + /* Skip white space. */ + while (ISSPACE ((unsigned char)*s)) + ++s; + if (*s == '\0') + goto noconv; + + /* Check for a sign. */ + if (*s == '-' || *s == '+') + { + negative = (*s == '-'); + ++s; + } + else + negative = 0; + + /* Recognize number prefix and if BASE is zero, figure it out ourselves. */ + if (*s == '0') + { + if ((base == 0 || base == 16) && TOUPPER ((unsigned char) s[1]) == 'X') + { + s += 2; + base = 16; + } + else if (base == 0) + base = 8; + } + else if (base == 0) + base = 10; + + /* Save the pointer so we can check later if anything happened. */ + save = s; + + end = NULL; + + cutoff = STRTOL_ULONG_MAX / (unsigned LONG int) base; + cutlim = STRTOL_ULONG_MAX % (unsigned LONG int) base; + + overflow = 0; + i = 0; + c = *s; + if (sizeof (long int) != sizeof (LONG int)) + { + unsigned long int j = 0; + unsigned long int jmax = ULONG_MAX / base; + + for (;c != '\0'; c = *++s) + { + if (s == end) + break; + if (DIGIT (c)) + c -= '0'; + else if (ISALPHA (c)) + c = TOUPPER (c) - 'A' + 10; + else + break; + + if ((int) c >= base) + break; + /* Note that we never can have an overflow. */ + else if (j >= jmax) + { + /* We have an overflow. Now use the long representation. */ + i = (unsigned LONG int) j; + goto use_long; + } + else + j = j * (unsigned long int) base + c; + } + + i = (unsigned LONG int) j; + } + else + for (;c != '\0'; c = *++s) + { + if (s == end) + break; + if (DIGIT (c)) + c -= '0'; + else if (ISALPHA (c)) + c = TOUPPER (c) - 'A' + 10; + else + break; + if ((int) c >= base) + break; + /* Check for overflow. */ + if (i > cutoff || (i == cutoff && c > cutlim)) + overflow = 1; + else + { + use_long: + i *= (unsigned LONG int) base; + i += c; + } + } + + /* Check if anything actually happened. */ + if (s == save) + goto noconv; + + /* Store in ENDPTR the address of one character + past the last character we converted. */ + if (endptr != NULL) + *endptr = (char *) s; + +#if !UNSIGNED + /* Check for a value that is within the range of + `unsigned LONG int', but outside the range of `LONG int'. */ + if (overflow == 0 + && i > (negative + ? -((unsigned LONG int) (STRTOL_LONG_MIN + 1)) + 1 + : (unsigned LONG int) STRTOL_LONG_MAX)) + overflow = 1; +#endif + + if (overflow) + { + __set_errno (ERANGE); +#if UNSIGNED + return STRTOL_ULONG_MAX; +#else + return negative ? STRTOL_LONG_MIN : STRTOL_LONG_MAX; +#endif + } + + /* Return the result of the appropriate sign. */ + return negative ? -i : i; + +noconv: + /* We must handle a special case here: the base is 0 or 16 and the + first two characters are '0' and 'x', but the rest are no + hexadecimal digits. This is no error case. We return 0 and + ENDPTR points to the `x`. */ + if (endptr != NULL) + { + if (save - nptr >= 2 && TOUPPER ((unsigned char) save[-1]) == 'X' && save[-2] == '0') + *endptr = (char *) &save[-1]; + else + /* There was no number to convert. */ + *endptr = (char *) nptr; + } + + return 0L; +} + +#endif /* !HAVE_STRTOL */ diff --git a/lib/sh/strtoll.c b/lib/sh/strtoll.c new file mode 100644 index 0000000..f6060ee --- /dev/null +++ b/lib/sh/strtoll.c @@ -0,0 +1,30 @@ +/* strtoll - convert string representation of a number into a long long value. */ + +/* Copyright (C) 1997 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HAVE_LONG_LONG) && !defined (HAVE_STRTOLL) + +#define QUAD 1 +#undef HAVE_STRTOL + +#include "strtol.c" + +#endif /* HAVE_LONG_LONG && !HAVE_STRTOLL */ diff --git a/lib/sh/strtoul.c b/lib/sh/strtoul.c new file mode 100644 index 0000000..cbaa484 --- /dev/null +++ b/lib/sh/strtoul.c @@ -0,0 +1,30 @@ +/* strtoul - convert string representation of a number into an unsigned long value. */ + +/* Copyright (C) 1997 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#ifndef HAVE_STRTOUL + +#define UNSIGNED 1 +#undef HAVE_STRTOL + +#include + +#endif /* !HAVE_STRTOUL */ diff --git a/lib/sh/strtoull.c b/lib/sh/strtoull.c new file mode 100644 index 0000000..02ddebb --- /dev/null +++ b/lib/sh/strtoull.c @@ -0,0 +1,31 @@ +/* strtoull - convert string representation of a number into an unsigned long long value. */ + +/* Copyright (C) 1997 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HAVE_LONG_LONG) && !defined (HAVE_STRTOULL) + +#define QUAD 1 +#define UNSIGNED 1 +#undef HAVE_STRTOL + +#include "strtol.c" + +#endif /* HAVE_LONG_LONG && !HAVE_STRTOULL */ diff --git a/lib/sh/strtoumax.c b/lib/sh/strtoumax.c new file mode 100644 index 0000000..09423ad --- /dev/null +++ b/lib/sh/strtoumax.c @@ -0,0 +1,113 @@ +/* strtoumax - convert string representation of a number into an uintmax_t value. */ + +/* Copyright 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Written by Paul Eggert. Modified by Chet Ramey for Bash. */ + +#if HAVE_CONFIG_H +# include +#endif + +#if HAVE_INTTYPES_H +# include +#endif + +#if HAVE_STDINT_H +# include +#endif + +#if HAVE_STDLIB_H +# include +#endif + +#include + +/* Verify a requirement at compile-time (unlike assert, which is runtime). */ +#define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; } + +#ifndef HAVE_DECL_STRTOUL +"this configure-time declaration test was not run" +#endif +#if !HAVE_DECL_STRTOUL +extern unsigned long strtoul __P((const char *, char **, int)); +#endif + +#ifndef HAVE_DECL_STRTOULL +"this configure-time declaration test was not run" +#endif +#if !HAVE_DECL_STRTOULL && HAVE_UNSIGNED_LONG_LONG +extern unsigned long long strtoull __P((const char *, char **, int)); +#endif + +#ifdef strtoumax +#undef strtoumax +#endif + +uintmax_t +strtoumax (ptr, endptr, base) + const char *ptr; + char **endptr; + int base; +{ +#if HAVE_UNSIGNED_LONG_LONG + verify (size_is_that_of_unsigned_long_or_unsigned_long_long, + (sizeof (uintmax_t) == sizeof (unsigned long) || + sizeof (uintmax_t) == sizeof (unsigned long long))); + + if (sizeof (uintmax_t) != sizeof (unsigned long)) + return (strtoull (ptr, endptr, base)); +#else + verify (size_is_that_of_unsigned_long, sizeof (uintmax_t) == sizeof (unsigned long)); +#endif + + return (strtoul (ptr, endptr, base)); +} + +#ifdef TESTING +# include +int +main () +{ + char *p, *endptr; + uintmax_t x; +#if HAVE_UNSIGNED_LONG_LONG + unsigned long long y; +#endif + unsigned long z; + + printf ("sizeof uintmax_t: %d\n", sizeof (uintmax_t)); + +#if HAVE_UNSIGNED_LONG_LONG + printf ("sizeof unsigned long long: %d\n", sizeof (unsigned long long)); +#endif + printf ("sizeof unsigned long: %d\n", sizeof (unsigned long)); + + x = strtoumax("42", &endptr, 10); +#if HAVE_LONG_LONG + y = strtoull("42", &endptr, 10); +#else + y = 0; +#endif + z = strtoul("42", &endptr, 10); + + printf ("%llu %llu %lu\n", x, y, z); + + exit (0); +} +#endif diff --git a/lib/sh/strtrans.c b/lib/sh/strtrans.c new file mode 100644 index 0000000..ae88e69 --- /dev/null +++ b/lib/sh/strtrans.c @@ -0,0 +1,380 @@ +/* strtrans.c - Translate and untranslate strings with ANSI-C escape sequences. */ + +/* Copyright (C) 2000-2011 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include +#include + +#include "shell.h" + +#include "shmbchar.h" +#include "shmbutil.h" + +#ifdef ESC +#undef ESC +#endif +#define ESC '\033' /* ASCII */ + +/* Convert STRING by expanding the escape sequences specified by the + ANSI C standard. If SAWC is non-null, recognize `\c' and use that + as a string terminator. If we see \c, set *SAWC to 1 before + returning. LEN is the length of STRING. If (FLAGS&1) is non-zero, + that we're translating a string for `echo -e', and therefore should not + treat a single quote as a character that may be escaped with a backslash. + If (FLAGS&2) is non-zero, we're expanding for the parser and want to + quote CTLESC and CTLNUL with CTLESC. If (flags&4) is non-zero, we want + to remove the backslash before any unrecognized escape sequence. */ +char * +ansicstr (string, len, flags, sawc, rlen) + char *string; + int len, flags, *sawc, *rlen; +{ + int c, temp; + char *ret, *r, *s; + unsigned long v; + + if (string == 0 || *string == '\0') + return ((char *)NULL); + +#if defined (HANDLE_MULTIBYTE) + ret = (char *)xmalloc (4*len + 1); +#else + ret = (char *)xmalloc (2*len + 1); /* 2*len for possible CTLESC */ +#endif + for (r = ret, s = string; s && *s; ) + { + c = *s++; + if (c != '\\' || *s == '\0') + *r++ = c; + else + { + switch (c = *s++) + { +#if defined (__STDC__) + case 'a': c = '\a'; break; + case 'v': c = '\v'; break; +#else + case 'a': c = (int) 0x07; break; + case 'v': c = (int) 0x0B; break; +#endif + case 'b': c = '\b'; break; + case 'e': case 'E': /* ESC -- non-ANSI */ + c = ESC; break; + case 'f': c = '\f'; break; + case 'n': c = '\n'; break; + case 'r': c = '\r'; break; + case 't': c = '\t'; break; + case '1': case '2': case '3': + case '4': case '5': case '6': + case '7': +#if 1 + if (flags & 1) + { + *r++ = '\\'; + break; + } + /*FALLTHROUGH*/ +#endif + case '0': + /* If (FLAGS & 1), we're translating a string for echo -e (or + the equivalent xpg_echo option), so we obey the SUSv3/ + POSIX-2001 requirement and accept 0-3 octal digits after + a leading `0'. */ + temp = 2 + ((flags & 1) && (c == '0')); + for (c -= '0'; ISOCTAL (*s) && temp--; s++) + c = (c * 8) + OCTVALUE (*s); + c &= 0xFF; + break; + case 'x': /* Hex digit -- non-ANSI */ + if ((flags & 2) && *s == '{') + { + flags |= 16; /* internal flag value */ + s++; + } + /* Consume at least two hex characters */ + for (temp = 2, c = 0; ISXDIGIT ((unsigned char)*s) && temp--; s++) + c = (c * 16) + HEXVALUE (*s); + /* DGK says that after a `\x{' ksh93 consumes ISXDIGIT chars + until a non-xdigit or `}', so potentially more than two + chars are consumed. */ + if (flags & 16) + { + for ( ; ISXDIGIT ((unsigned char)*s); s++) + c = (c * 16) + HEXVALUE (*s); + flags &= ~16; + if (*s == '}') + s++; + } + /* \x followed by non-hex digits is passed through unchanged */ + else if (temp == 2) + { + *r++ = '\\'; + c = 'x'; + } + c &= 0xFF; + break; +#if defined (HANDLE_MULTIBYTE) + case 'u': + case 'U': + temp = (c == 'u') ? 4 : 8; /* \uNNNN \UNNNNNNNN */ + for (v = 0; ISXDIGIT ((unsigned char)*s) && temp--; s++) + v = (v * 16) + HEXVALUE (*s); + if (temp == ((c == 'u') ? 4 : 8)) + { + *r++ = '\\'; /* c remains unchanged */ + break; + } + else if (v <= 0x7f) /* <= 0x7f translates directly */ + { + c = v; + break; + } + else + { + temp = u32cconv (v, r); + r += temp; + continue; + } +#endif + case '\\': + break; + case '\'': case '"': case '?': + if (flags & 1) + *r++ = '\\'; + break; + case 'c': + if (sawc) + { + *sawc = 1; + *r = '\0'; + if (rlen) + *rlen = r - ret; + return ret; + } + else if ((flags & 1) == 0 && *s == 0) + ; /* pass \c through */ + else if ((flags & 1) == 0 && (c = *s)) + { + s++; + if ((flags & 2) && c == '\\' && c == *s) + s++; /* Posix requires $'\c\\' do backslash escaping */ + c = TOCTRL(c); + break; + } + /*FALLTHROUGH*/ + default: + if ((flags & 4) == 0) + *r++ = '\\'; + break; + } + if ((flags & 2) && (c == CTLESC || c == CTLNUL)) + *r++ = CTLESC; + *r++ = c; + } + } + *r = '\0'; + if (rlen) + *rlen = r - ret; + return ret; +} + +/* Take a string STR, possibly containing non-printing characters, and turn it + into a $'...' ANSI-C style quoted string. Returns a new string. */ +char * +ansic_quote (str, flags, rlen) + char *str; + int flags, *rlen; +{ + char *r, *ret, *s; + int l, rsize; + unsigned char c; + size_t clen; + int b; +#if defined (HANDLE_MULTIBYTE) + wchar_t wc; +#endif + + if (str == 0 || *str == 0) + return ((char *)0); + + l = strlen (str); + rsize = 4 * l + 4; + r = ret = (char *)xmalloc (rsize); + + *r++ = '$'; + *r++ = '\''; + + s = str; + + for (s = str; c = *s; s++) + { + b = l = 1; /* 1 == add backslash; 0 == no backslash */ + clen = 1; + + switch (c) + { + case ESC: c = 'E'; break; +#ifdef __STDC__ + case '\a': c = 'a'; break; + case '\v': c = 'v'; break; +#else + case 0x07: c = 'a'; break; + case 0x0b: c = 'v'; break; +#endif + + case '\b': c = 'b'; break; + case '\f': c = 'f'; break; + case '\n': c = 'n'; break; + case '\r': c = 'r'; break; + case '\t': c = 't'; break; + case '\\': + case '\'': + break; + default: +#if defined (HANDLE_MULTIBYTE) + b = is_basic (c); + /* XXX - clen comparison to 0 is dicey */ + if ((b == 0 && ((clen = mbrtowc (&wc, s, MB_CUR_MAX, 0)) < 0 || MB_INVALIDCH (clen) || iswprint (wc) == 0)) || + (b == 1 && ISPRINT (c) == 0)) +#else + if (ISPRINT (c) == 0) +#endif + { + *r++ = '\\'; + *r++ = TOCHAR ((c >> 6) & 07); + *r++ = TOCHAR ((c >> 3) & 07); + *r++ = TOCHAR (c & 07); + continue; + } + l = 0; + break; + } + if (b == 0 && clen == 0) + break; + + if (l) + *r++ = '\\'; + + if (clen == 1) + *r++ = c; + else + { + for (b = 0; b < (int)clen; b++) + *r++ = (unsigned char)s[b]; + s += clen - 1; /* -1 because of the increment above */ + } + } + + *r++ = '\''; + *r = '\0'; + if (rlen) + *rlen = r - ret; + return ret; +} + +#if defined (HANDLE_MULTIBYTE) +int +ansic_wshouldquote (string) + const char *string; +{ + const wchar_t *wcs; + wchar_t wcc; + + wchar_t *wcstr = NULL; + size_t slen; + + + slen = mbstowcs (wcstr, string, 0); + + if (slen == -1) + slen = 0; + wcstr = (wchar_t *)xmalloc (sizeof (wchar_t) * (slen + 1)); + mbstowcs (wcstr, string, slen + 1); + + for (wcs = wcstr; wcc = *wcs; wcs++) + if (iswprint(wcc) == 0) + { + free (wcstr); + return 1; + } + + free (wcstr); + return 0; +} +#endif + +/* return 1 if we need to quote with $'...' because of non-printing chars. */ +int +ansic_shouldquote (string) + const char *string; +{ + const char *s; + unsigned char c; + + if (string == 0) + return 0; + + for (s = string; c = *s; s++) + { +#if defined (HANDLE_MULTIBYTE) + if (is_basic (c) == 0) + return (ansic_wshouldquote (s)); +#endif + if (ISPRINT (c) == 0) + return 1; + } + + return 0; +} + +/* $'...' ANSI-C expand the portion of STRING between START and END and + return the result. The result cannot be longer than the input string. */ +char * +ansiexpand (string, start, end, lenp) + char *string; + int start, end, *lenp; +{ + char *temp, *t; + int len, tlen; + + temp = (char *)xmalloc (end - start + 1); + for (tlen = 0, len = start; len < end; ) + temp[tlen++] = string[len++]; + temp[tlen] = '\0'; + + if (*temp) + { + t = ansicstr (temp, tlen, 2, (int *)NULL, lenp); + free (temp); + return (t); + } + else + { + if (lenp) + *lenp = 0; + return (temp); + } +} diff --git a/lib/sh/times.c b/lib/sh/times.c new file mode 100644 index 0000000..47ddf57 --- /dev/null +++ b/lib/sh/times.c @@ -0,0 +1,77 @@ +/* times.c - times(3) library function */ + +/* Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if !defined (HAVE_TIMES) + +#include +#include +#include + +#if defined (HAVE_SYS_RESOURCE_H) && defined (HAVE_GETRUSAGE) +# include +#endif /* HAVE_SYS_RESOURCE_H && HAVE_GETRUSAGE */ + +extern long get_clk_tck __P((void)); + +#define CONVTCK(r) (r.tv_sec * clk_tck + r.tv_usec / (1000000 / clk_tck)) + +clock_t +times(tms) + struct tms *tms; +{ + clock_t rv; + static long clk_tck = -1; + +#if defined (HAVE_GETRUSAGE) + struct timeval tv; + struct rusage ru; + + if (clk_tck == -1) + clk_tck = get_clk_tck(); + + if (getrusage(RUSAGE_SELF, &ru) < 0) + return ((clock_t)-1); + tms->tms_utime = CONVTCK(ru.ru_utime); + tms->tms_stime = CONVTCK(ru.ru_stime); + + if (getrusage(RUSAGE_CHILDREN, &ru) < 0) + return ((clock_t)-1); + tms->tms_cutime = CONVTCK(ru.ru_utime); + tms->tms_cstime = CONVTCK(ru.ru_stime); + + if (gettimeofday(&tv, (struct timezone *) 0) < 0) + return ((clock_t)-1); + rv = (clock_t)(CONVTCK(tv)); +#else /* !HAVE_GETRUSAGE */ + if (clk_tck == -1) + clk_tck = get_clk_tck(); + + /* We can't do anything. */ + tms->tms_utime = tms->tms_stime = (clock_t)0; + tms->tms_cutime = tms->tms_cstime = (clock_t)0; + + rv = (clock_t)time((time_t *)0) * clk_tck; +# endif /* HAVE_GETRUSAGE */ + + return rv; +} +#endif /* !HAVE_TIMES */ diff --git a/lib/sh/timeval.c b/lib/sh/timeval.c new file mode 100644 index 0000000..7bd9df8 --- /dev/null +++ b/lib/sh/timeval.c @@ -0,0 +1,145 @@ +/* timeval.c - functions to perform operations on struct timevals */ + +/* Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HAVE_TIMEVAL) + +#include +#include + +#include + +struct timeval * +difftimeval (d, t1, t2) + struct timeval *d, *t1, *t2; +{ + d->tv_sec = t2->tv_sec - t1->tv_sec; + d->tv_usec = t2->tv_usec - t1->tv_usec; + if (d->tv_usec < 0) + { + d->tv_usec += 1000000; + d->tv_sec -= 1; + if (d->tv_sec < 0) /* ??? -- BSD/OS does this */ + { + d->tv_sec = 0; + d->tv_usec = 0; + } + } + return d; +} + +struct timeval * +addtimeval (d, t1, t2) + struct timeval *d, *t1, *t2; +{ + d->tv_sec = t1->tv_sec + t2->tv_sec; + d->tv_usec = t1->tv_usec + t2->tv_usec; + if (d->tv_usec >= 1000000) + { + d->tv_usec -= 1000000; + d->tv_sec += 1; + } + return d; +} + +/* Do "cpu = ((user + sys) * 10000) / real;" with timevals. + Barely-tested code from Deven T. Corzine . */ +int +timeval_to_cpu (rt, ut, st) + struct timeval *rt, *ut, *st; /* real, user, sys */ +{ + struct timeval t1, t2; + register int i; + + addtimeval (&t1, ut, st); + t2.tv_sec = rt->tv_sec; + t2.tv_usec = rt->tv_usec; + + for (i = 0; i < 6; i++) + { + if ((t1.tv_sec > 99999999) || (t2.tv_sec > 99999999)) + break; + t1.tv_sec *= 10; + t1.tv_sec += t1.tv_usec / 100000; + t1.tv_usec *= 10; + t1.tv_usec %= 1000000; + t2.tv_sec *= 10; + t2.tv_sec += t2.tv_usec / 100000; + t2.tv_usec *= 10; + t2.tv_usec %= 1000000; + } + for (i = 0; i < 4; i++) + { + if (t1.tv_sec < 100000000) + t1.tv_sec *= 10; + else + t2.tv_sec /= 10; + } + + return ((t2.tv_sec == 0) ? 0 : t1.tv_sec / t2.tv_sec); +} + +/* Convert a pointer to a struct timeval to seconds and thousandths of a + second, returning the values in *SP and *SFP, respectively. This does + rounding on the fractional part, not just truncation to three places. */ +void +timeval_to_secs (tvp, sp, sfp) + struct timeval *tvp; + time_t *sp; + int *sfp; +{ + int rest; + + *sp = tvp->tv_sec; + + *sfp = tvp->tv_usec % 1000000; /* pretty much a no-op */ + rest = *sfp % 1000; + *sfp = (*sfp * 1000) / 1000000; + if (rest >= 500) + *sfp += 1; + + /* Sanity check */ + if (*sfp >= 1000) + { + *sp += 1; + *sfp -= 1000; + } +} + +/* Print the contents of a struct timeval * in a standard way to stdio + stream FP. */ +void +print_timeval (fp, tvp) + FILE *fp; + struct timeval *tvp; +{ + time_t timestamp; + long minutes; + int seconds, seconds_fraction; + + timeval_to_secs (tvp, ×tamp, &seconds_fraction); + + minutes = timestamp / 60; + seconds = timestamp % 60; + + fprintf (fp, "%ldm%d.%03ds", minutes, seconds, seconds_fraction); +} +#endif /* HAVE_TIMEVAL */ diff --git a/lib/sh/tmpfile.c b/lib/sh/tmpfile.c new file mode 100644 index 0000000..c06ad65 --- /dev/null +++ b/lib/sh/tmpfile.c @@ -0,0 +1,222 @@ +/* + * tmpfile.c - functions to create and safely open temp files for the shell. + */ + +/* Copyright (C) 2000 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include +#include +#include +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include + +#include +#include + +#include + +#ifndef errno +extern int errno; +#endif + +#define BASEOPENFLAGS (O_CREAT | O_TRUNC | O_EXCL | O_BINARY) + +#define DEFAULT_TMPDIR "." /* bogus default, should be changed */ +#define DEFAULT_NAMEROOT "shtmp" + +extern pid_t dollar_dollar_pid; + +static char *get_sys_tmpdir __P((void)); +static char *get_tmpdir __P((int)); + +static char *sys_tmpdir = (char *)NULL; +static int ntmpfiles; +static int tmpnamelen = -1; +static unsigned long filenum = 1L; + +static char * +get_sys_tmpdir () +{ + if (sys_tmpdir) + return sys_tmpdir; + +#ifdef P_tmpdir + sys_tmpdir = P_tmpdir; + if (file_iswdir (sys_tmpdir)) + return sys_tmpdir; +#endif + + sys_tmpdir = "/tmp"; + if (file_iswdir (sys_tmpdir)) + return sys_tmpdir; + + sys_tmpdir = "/var/tmp"; + if (file_iswdir (sys_tmpdir)) + return sys_tmpdir; + + sys_tmpdir = "/usr/tmp"; + if (file_iswdir (sys_tmpdir)) + return sys_tmpdir; + + sys_tmpdir = DEFAULT_TMPDIR; + + return sys_tmpdir; +} + +static char * +get_tmpdir (flags) + int flags; +{ + char *tdir; + + tdir = (flags & MT_USETMPDIR) ? get_string_value ("TMPDIR") : (char *)NULL; + if (tdir && (file_iswdir (tdir) == 0 || strlen (tdir) > PATH_MAX)) + tdir = 0; + + if (tdir == 0) + tdir = get_sys_tmpdir (); + +#if defined (HAVE_PATHCONF) && defined (_PC_NAME_MAX) + if (tmpnamelen == -1) + tmpnamelen = pathconf (tdir, _PC_NAME_MAX); +#else + tmpnamelen = 0; +#endif + + return tdir; +} + +char * +sh_mktmpname (nameroot, flags) + char *nameroot; + int flags; +{ + char *filename, *tdir, *lroot; + struct stat sb; + int r, tdlen; + + filename = (char *)xmalloc (PATH_MAX + 1); + tdir = get_tmpdir (flags); + tdlen = strlen (tdir); + + lroot = nameroot ? nameroot : DEFAULT_NAMEROOT; + +#ifdef USE_MKTEMP + sprintf (filename, "%s/%s.XXXXXX", tdir, lroot); + if (mktemp (filename) == 0) + { + free (filename); + filename = NULL; + } +#else /* !USE_MKTEMP */ + while (1) + { + filenum = (filenum << 1) ^ + (unsigned long) time ((time_t *)0) ^ + (unsigned long) dollar_dollar_pid ^ + (unsigned long) ((flags & MT_USERANDOM) ? random () : ntmpfiles++); + sprintf (filename, "%s/%s-%lu", tdir, lroot, filenum); + if (tmpnamelen > 0 && tmpnamelen < 32) + filename[tdlen + 1 + tmpnamelen] = '\0'; +# ifdef HAVE_LSTAT + r = lstat (filename, &sb); +# else + r = stat (filename, &sb); +# endif + if (r < 0 && errno == ENOENT) + break; + } +#endif /* !USE_MKTEMP */ + + return filename; +} + +int +sh_mktmpfd (nameroot, flags, namep) + char *nameroot; + int flags; + char **namep; +{ + char *filename, *tdir, *lroot; + int fd, tdlen; + + filename = (char *)xmalloc (PATH_MAX + 1); + tdir = get_tmpdir (flags); + tdlen = strlen (tdir); + + lroot = nameroot ? nameroot : DEFAULT_NAMEROOT; + +#ifdef USE_MKSTEMP + sprintf (filename, "%s/%s.XXXXXX", tdir, lroot); + fd = mkstemp (filename); + if (fd < 0 || namep == 0) + { + free (filename); + filename = NULL; + } + if (namep) + *namep = filename; + return fd; +#else /* !USE_MKSTEMP */ + do + { + filenum = (filenum << 1) ^ + (unsigned long) time ((time_t *)0) ^ + (unsigned long) dollar_dollar_pid ^ + (unsigned long) ((flags & MT_USERANDOM) ? random () : ntmpfiles++); + sprintf (filename, "%s/%s-%lu", tdir, lroot, filenum); + if (tmpnamelen > 0 && tmpnamelen < 32) + filename[tdlen + 1 + tmpnamelen] = '\0'; + fd = open (filename, BASEOPENFLAGS | ((flags & MT_READWRITE) ? O_RDWR : O_WRONLY), 0600); + } + while (fd < 0 && errno == EEXIST); + + if (namep) + *namep = filename; + else + free (filename); + + return fd; +#endif /* !USE_MKSTEMP */ +} + +FILE * +sh_mktmpfp (nameroot, flags, namep) + char *nameroot; + int flags; + char **namep; +{ + int fd; + FILE *fp; + + fd = sh_mktmpfd (nameroot, flags, namep); + if (fd < 0) + return ((FILE *)NULL); + fp = fdopen (fd, (flags & MT_READWRITE) ? "w+" : "w"); + if (fp == 0) + close (fd); + return fp; +} diff --git a/lib/sh/uconvert.c b/lib/sh/uconvert.c new file mode 100644 index 0000000..3d656df --- /dev/null +++ b/lib/sh/uconvert.c @@ -0,0 +1,116 @@ +/* uconvert - convert string representations of decimal numbers into whole + number/fractional value pairs. */ + +/* Copyright (C) 2008,2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" + +#if defined (TIME_WITH_SYS_TIME) +# include +# include +#else +# if defined (HAVE_SYS_TIME_H) +# include +# else +# include +# endif +#endif + +#if defined (HAVE_UNISTD_H) +#include +#endif + +#include +#include "chartypes.h" + +#include "shell.h" +#include "builtins.h" + +#define DECIMAL '.' /* XXX - should use locale */ + +#define RETURN(x) \ +do { \ + if (ip) *ip = ipart * mult; \ + if (up) *up = upart; \ + return (x); \ +} while (0) + +/* + * An incredibly simplistic floating point converter. + */ +static int multiplier[7] = { 1, 100000, 10000, 1000, 100, 10, 1 }; + +/* Take a decimal number int-part[.[micro-part]] and convert it to the whole + and fractional portions. The fractional portion is returned in + millionths (micro); callers are responsible for multiplying appropriately. + Return 1 if value converted; 0 if invalid integer for either whole or + fractional parts. */ +int +uconvert(s, ip, up) + char *s; + long *ip, *up; +{ + int n, mult; + long ipart, upart; + char *p; + + ipart = upart = 0; + mult = 1; + + if (s && (*s == '-' || *s == '+')) + { + mult = (*s == '-') ? -1 : 1; + p = s + 1; + } + else + p = s; + + for ( ; p && *p; p++) + { + if (*p == DECIMAL) /* decimal point */ + break; + if (DIGIT(*p) == 0) + RETURN(0); + ipart = (ipart * 10) + (*p - '0'); + } + + if (p == 0 || *p == 0) /* callers ensure p can never be 0; this is to shut up clang */ + RETURN(1); + + if (*p == DECIMAL) + p++; + + /* Look for up to six digits past a decimal point. */ + for (n = 0; n < 6 && p[n]; n++) + { + if (DIGIT(p[n]) == 0) + RETURN(0); + upart = (upart * 10) + (p[n] - '0'); + } + + /* Now convert to millionths */ + upart *= multiplier[n]; + + if (n == 6 && p[6] >= '5' && p[6] <= '9') + upart++; /* round up 1 */ + + RETURN(1); +} diff --git a/lib/sh/ufuncs.c b/lib/sh/ufuncs.c new file mode 100644 index 0000000..ed526fe --- /dev/null +++ b/lib/sh/ufuncs.c @@ -0,0 +1,104 @@ +/* ufuncs - sleep and alarm functions that understand fractional values */ + +/* Copyright (C) 2008,2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" + +#if defined (TIME_WITH_SYS_TIME) +# include +# include +#else +# if defined (HAVE_SYS_TIME_H) +# include +# else +# include +# endif +#endif + +#if defined (HAVE_UNISTD_H) +#include +#endif + +/* A version of `alarm' using setitimer if it's available. */ + +#if defined (HAVE_SETITIMER) +unsigned int +falarm(secs, usecs) + unsigned int secs, usecs; +{ + struct itimerval it, oit; + + it.it_interval.tv_sec = 0; + it.it_interval.tv_usec = 0; + + it.it_value.tv_sec = secs; + it.it_value.tv_usec = usecs; + + if (setitimer(ITIMER_REAL, &it, &oit) < 0) + return (-1); /* XXX will be converted to unsigned */ + + /* Backwards compatibility with alarm(3) */ + if (oit.it_value.tv_usec) + oit.it_value.tv_sec++; + return (oit.it_value.tv_sec); +} +#else +int +falarm (secs, usecs) + unsigned int secs, usecs; +{ + if (secs == 0 && usecs == 0) + return (alarm (0)); + + if (secs == 0 || usecs >= 500000) + { + secs++; + usecs = 0; + } + return (alarm (secs)); +} +#endif /* !HAVE_SETITIMER */ + +/* A version of sleep using fractional seconds and select. I'd like to use + `usleep', but it's already taken */ + +#if defined (HAVE_TIMEVAL) && defined (HAVE_SELECT) +int +fsleep(sec, usec) + unsigned int sec, usec; +{ + struct timeval tv; + + tv.tv_sec = sec; + tv.tv_usec = usec; + + return select(0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &tv); +} +#else /* !HAVE_TIMEVAL || !HAVE_SELECT */ +int +fsleep(sec, usec) + long sec, usec; +{ + if (usec >= 500000) /* round */ + sec++; + return (sleep(sec)); +} +#endif /* !HAVE_TIMEVAL || !HAVE_SELECT */ diff --git a/lib/sh/unicode.c b/lib/sh/unicode.c new file mode 100644 index 0000000..9ee7147 --- /dev/null +++ b/lib/sh/unicode.c @@ -0,0 +1,341 @@ +/* unicode.c - functions to convert unicode characters */ + +/* Copyright (C) 2010-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HANDLE_MULTIBYTE) + +#include +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#include + +#if HAVE_ICONV +# include +#endif + +#include + +#ifndef USHORT_MAX +# ifdef USHRT_MAX +# define USHORT_MAX USHRT_MAX +# else +# define USHORT_MAX ((unsigned short) ~(unsigned short)0) +# endif +#endif + +#if !defined (STREQ) +# define STREQ(a, b) ((a)[0] == (b)[0] && strcmp ((a), (b)) == 0) +#endif /* !STREQ */ + +#if defined (HAVE_LOCALE_CHARSET) +extern const char *locale_charset __P((void)); +#else +extern char *get_locale_var __P((char *)); +#endif + +static int u32init = 0; +static int utf8locale = 0; +#if defined (HAVE_ICONV) +static iconv_t localconv; +#endif + +#ifndef HAVE_LOCALE_CHARSET +static char charsetbuf[40]; + +static char * +stub_charset () +{ + char *locale, *s, *t; + + locale = get_locale_var ("LC_CTYPE"); + if (locale == 0 || *locale == 0) + { + strcpy (charsetbuf, "ASCII"); + return charsetbuf; + } + s = strrchr (locale, '.'); + if (s) + { + strcpy (charsetbuf, s+1); + t = strchr (charsetbuf, '@'); + if (t) + *t = 0; + return charsetbuf; + } + strcpy (charsetbuf, locale); + return charsetbuf; +} +#endif + +void +u32reset () +{ +#if defined (HAVE_ICONV) + if (u32init && localconv != (iconv_t)-1) + { + iconv_close (localconv); + localconv = (iconv_t)-1; + } +#endif + u32init = 0; + utf8locale = 0; +} + +/* u32toascii ? */ +int +u32tochar (x, s) + unsigned long x; + char *s; +{ + int l; + + l = (x <= UCHAR_MAX) ? 1 : ((x <= USHORT_MAX) ? 2 : 4); + + if (x <= UCHAR_MAX) + s[0] = x & 0xFF; + else if (x <= USHORT_MAX) /* assume unsigned short = 16 bits */ + { + s[0] = (x >> 8) & 0xFF; + s[1] = x & 0xFF; + } + else + { + s[0] = (x >> 24) & 0xFF; + s[1] = (x >> 16) & 0xFF; + s[2] = (x >> 8) & 0xFF; + s[3] = x & 0xFF; + } + s[l] = '\0'; + return l; +} + +int +u32tocesc (wc, s) + u_bits32_t wc; + char *s; +{ + int l; + + if (wc < 0x10000) + l = sprintf (s, "\\u%04X", wc); + else + l = sprintf (s, "\\u%08X", wc); + return l; +} + +/* Convert unsigned 32-bit int to utf-8 character string */ +int +u32toutf8 (wc, s) + u_bits32_t wc; + char *s; +{ + int l; + + if (wc < 0x0080) + { + s[0] = (char)wc; + l = 1; + } + else if (wc < 0x0800) + { + s[0] = (wc >> 6) | 0xc0; + s[1] = (wc & 0x3f) | 0x80; + l = 2; + } + else if (wc < 0x10000) + { + /* Technically, we could return 0 here if 0xd800 <= wc <= 0x0dfff */ + s[0] = (wc >> 12) | 0xe0; + s[1] = ((wc >> 6) & 0x3f) | 0x80; + s[2] = (wc & 0x3f) | 0x80; + l = 3; + } + else if (wc < 0x200000) + { + s[0] = (wc >> 18) | 0xf0; + s[1] = ((wc >> 12) & 0x3f) | 0x80; + s[2] = ((wc >> 6) & 0x3f) | 0x80; + s[3] = (wc & 0x3f) | 0x80; + l = 4; + } + /* Strictly speaking, UTF-8 doesn't have characters longer than 4 bytes */ + else if (wc < 0x04000000) + { + s[0] = (wc >> 24) | 0xf8; + s[1] = ((wc >> 18) & 0x3f) | 0x80; + s[2] = ((wc >> 12) & 0x3f) | 0x80; + s[3] = ((wc >> 6) & 0x3f) | 0x80; + s[4] = (wc & 0x3f) | 0x80; + l = 5; + } + else if (wc < 0x080000000) + { + s[0] = (wc >> 30) | 0xf8; + s[1] = ((wc >> 24) & 0x3f) | 0x80; + s[2] = ((wc >> 18) & 0x3f) | 0x80; + s[3] = ((wc >> 12) & 0x3f) | 0x80; + s[4] = ((wc >> 6) & 0x3f) | 0x80; + s[5] = (wc & 0x3f) | 0x80; + l = 6; + } + else + l = 0; + + s[l] = '\0'; + return l; +} + +/* Convert a 32-bit unsigned int (unicode) to a UTF-16 string. Rarely used, + only if sizeof(wchar_t) == 2. */ +int +u32toutf16 (c, s) + u_bits32_t c; + unsigned short *s; +{ + int l; + + l = 0; + if (c < 0x0d800) + { + s[0] = (unsigned short) (c & 0xFFFF); + l = 1; + } + else if (c >= 0x0e000 && c <= 0x010ffff) + { + c -= 0x010000; + s[0] = (unsigned short)((c >> 10) + 0xd800); + s[1] = (unsigned short)((c & 0x3ff) + 0xdc00); + l = 2; + } + s[l] = 0; + return l; +} + +/* convert a single unicode-32 character into a multibyte string and put the + result in S, which must be large enough (at least MB_LEN_MAX bytes) */ +int +u32cconv (c, s) + unsigned long c; + char *s; +{ + wchar_t wc; + wchar_t ws[3]; + int n; +#if HAVE_ICONV + const char *charset; + char obuf[25], *optr; + size_t obytesleft; + const char *iptr; + size_t sn; +#endif + +#if __STDC_ISO_10646__ + wc = c; + if (sizeof (wchar_t) == 4 && c <= 0x7fffffff) + n = wctomb (s, wc); + else if (sizeof (wchar_t) == 2 && c <= 0x10ffff && u32toutf16 (c, ws)) + n = wcstombs (s, ws, MB_LEN_MAX); + else + n = -1; + if (n != -1) + return n; +#endif + +#if HAVE_NL_LANGINFO + codeset = nl_langinfo (CODESET); + if (STREQ (codeset, "UTF-8")) + { + n = u32toutf8 (c, s); + return n; + } +#endif + +#if HAVE_ICONV + /* this is mostly from coreutils-8.5/lib/unicodeio.c */ + if (u32init == 0) + { +# if HAVE_LOCALE_CHARSET + charset = locale_charset (); /* XXX - fix later */ +# else + charset = stub_charset (); +# endif + if (STREQ (charset, "UTF-8")) + utf8locale = 1; + else + { + localconv = iconv_open (charset, "UTF-8"); + if (localconv == (iconv_t)-1) + /* We assume ASCII when presented with an unknown encoding. */ + localconv = iconv_open ("ASCII", "UTF-8"); + } + u32init = 1; + } + + /* If we have a UTF-8 locale, convert to UTF-8 and return converted value. */ + n = u32toutf8 (c, s); + if (utf8locale) + return n; + + /* If the conversion is not supported, even the ASCII requested above, we + bail now. Currently we return the UTF-8 conversion. We could return + u32tocesc(). */ + if (localconv == (iconv_t)-1) + return n; + + optr = obuf; + obytesleft = sizeof (obuf); + iptr = s; + sn = n; + + iconv (localconv, NULL, NULL, NULL, NULL); + + if (iconv (localconv, (ICONV_CONST char **)&iptr, &sn, &optr, &obytesleft) == (size_t)-1) + { +#if 1 + /* You get ISO C99 escape sequences if iconv fails */ + n = u32tocesc (c, s); +#else + /* You get UTF-8 if iconv fails */ +#endif + return n; + } + + *optr = '\0'; + + /* number of chars to be copied is optr - obuf if we want to do bounds + checking */ + strcpy (s, obuf); + return (optr - obuf); +#endif /* HAVE_ICONV */ + + n = u32tocesc (c, s); /* fallback is ISO C99 escape sequences */ + return n; +} +#else +void +u32reset () +{ +} +#endif /* HANDLE_MULTIBYTE */ diff --git a/lib/sh/vprint.c b/lib/sh/vprint.c new file mode 100644 index 0000000..567fba3 --- /dev/null +++ b/lib/sh/vprint.c @@ -0,0 +1,85 @@ +/* vprint.c -- v[fs]printf() for 4.[23] BSD systems. */ + +/* Copyright (C) 1987,1989 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (USE_VFPRINTF_EMULATION) + +#include + +#if !defined (NULL) +# if defined (__STDC__) +# define NULL ((void *)0) +# else +# define NULL 0x0 +# endif /* __STDC__ */ +#endif /* !NULL */ + +/* + * Beware! Don't trust the value returned by either of these functions; it + * seems that pre-4.3-tahoe implementations of _doprnt () return the first + * argument, i.e. a char *. + */ +#include + +int +vfprintf (iop, fmt, ap) + FILE *iop; + char *fmt; + va_list ap; +{ + int len; + char localbuf[BUFSIZ]; + + if (iop->_flag & _IONBF) + { + iop->_flag &= ~_IONBF; + iop->_ptr = iop->_base = localbuf; + len = _doprnt (fmt, ap, iop); + (void) fflush (iop); + iop->_flag |= _IONBF; + iop->_base = NULL; + iop->_bufsiz = 0; + iop->_cnt = 0; + } + else + len = _doprnt (fmt, ap, iop); + return (ferror (iop) ? EOF : len); +} + +/* + * Ditto for vsprintf + */ +int +vsprintf (str, fmt, ap) + char *str, *fmt; + va_list ap; +{ + FILE f; + int len; + + f._flag = _IOWRT|_IOSTRG; + f._ptr = str; + f._cnt = 32767; + len = _doprnt (fmt, ap, &f); + *f._ptr = 0; + return (len); +} +#endif /* USE_VFPRINTF_EMULATION */ diff --git a/lib/sh/wcsdup.c b/lib/sh/wcsdup.c new file mode 100644 index 0000000..62a3c86 --- /dev/null +++ b/lib/sh/wcsdup.c @@ -0,0 +1,44 @@ +/* wcsdup.c - duplicate wide character string */ + +/* Copyright (C) 2006 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if !defined (HAVE_WCSDUP) && defined (HANDLE_MULTIBYTE) + +#include +#include +#include +#include + +wchar_t * +wcsdup (ws) + const wchar_t *ws; +{ + wchar_t *ret; + size_t len; + + len = wcslen (ws); + ret = xmalloc ((len + 1) * sizeof (wchar_t)); + if (ret == 0) + return ret; + + return (wcscpy (ret, ws)); +} +#endif /* !HAVE_WCSDUP && HANDLE_MULTIBYTE */ diff --git a/lib/sh/wcsnwidth.c b/lib/sh/wcsnwidth.c new file mode 100644 index 0000000..9c7e7cc --- /dev/null +++ b/lib/sh/wcsnwidth.c @@ -0,0 +1,56 @@ +/* wcsnwidth.c - compute display width of wide character string, up to max + specified width, return length. */ + +/* Copyright (C) 2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HANDLE_MULTIBYTE) + +#include +#include +#include + +/* Return the number of wide characters that will be displayed from wide string + PWCS. If the display width exceeds MAX, return the number of wide chars + from PWCS required to display MAX characters on the screen. */ +int +wcsnwidth(pwcs, n, max) + const wchar_t *pwcs; + size_t n, max; +{ + wchar_t wc, *ws; + int len, l; + + len = 0; + ws = (wchar_t *)pwcs; + while (n-- > 0 && (wc = *ws++) != L'\0') + { + l = wcwidth (wc); + if (l < 0) + return (-1); + else if (l == max - len) + return (ws - pwcs); + else if (l > max - len) + return (--ws - pwcs); + len += l; + } + return (ws - pwcs); +} +#endif diff --git a/lib/sh/wcswidth.c b/lib/sh/wcswidth.c new file mode 100644 index 0000000..1a30d9f --- /dev/null +++ b/lib/sh/wcswidth.c @@ -0,0 +1,46 @@ +/* wcswidth.c - compute display width of wide character string */ + +/* Copyright (C) 2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (HANDLE_MULTIBYTE) && !defined (HAVE_WCSWIDTH) + +#include +#include +#include + +int +wcswidth(pwcs, n) + const wchar_t *pwcs; + size_t n; +{ + wchar_t wc; + int len, l; + + len = 0; + while (n-- > 0 && (wc = *pwcs++) != L'\0') + { + if ((l = wcwidth(wc)) < 0) + return (-1); + len += l; + } + return (len); +} +#endif diff --git a/lib/sh/winsize.c b/lib/sh/winsize.c new file mode 100644 index 0000000..64a9858 --- /dev/null +++ b/lib/sh/winsize.c @@ -0,0 +1,96 @@ +/* winsize.c - handle window size changes and information. */ + +/* Copyright (C) 2005 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include + +#include "bashtypes.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include + +/* Try to find the definitions of `struct winsize' and TIOGCWINSZ */ + +#if defined (GWINSZ_IN_SYS_IOCTL) && !defined (TIOCGWINSZ) +# include +#endif /* GWINSZ_IN_SYS_IOCTL && !TIOCGWINSZ */ + +#if defined (STRUCT_WINSIZE_IN_TERMIOS) && !defined (STRUCT_WINSIZE_IN_SYS_IOCTL) +# include +#endif /* STRUCT_WINSIZE_IN_TERMIOS && !STRUCT_WINSIZE_IN_SYS_IOCTL */ + +/* Not in either of the standard places, look around. */ +#if !defined (STRUCT_WINSIZE_IN_TERMIOS) && !defined (STRUCT_WINSIZE_IN_SYS_IOCTL) +# if defined (HAVE_SYS_STREAM_H) +# include +# endif /* HAVE_SYS_STREAM_H */ +# if defined (HAVE_SYS_PTEM_H) /* SVR4.2, at least, has it here */ +# include +# define _IO_PTEM_H /* work around SVR4.2 1.1.4 bug */ +# endif /* HAVE_SYS_PTEM_H */ +# if defined (HAVE_SYS_PTE_H) /* ??? */ +# include +# endif /* HAVE_SYS_PTE_H */ +#endif /* !STRUCT_WINSIZE_IN_TERMIOS && !STRUCT_WINSIZE_IN_SYS_IOCTL */ + +#include + +/* Return the fd from which we are actually getting input. */ +#define input_tty() (shell_tty != -1) ? shell_tty : fileno (stderr) + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +extern int shell_tty; + +#if defined (READLINE) +extern void rl_set_screen_size __P((int, int)); +#endif +extern void sh_set_lines_and_columns __P((int, int)); + +void +get_new_window_size (from_sig, rp, cp) + int from_sig; + int *rp, *cp; +{ +#if defined (TIOCGWINSZ) + struct winsize win; + int tty; + + tty = input_tty (); + if (tty >= 0 && (ioctl (tty, TIOCGWINSZ, &win) == 0) && + win.ws_row > 0 && win.ws_col > 0) + { + sh_set_lines_and_columns (win.ws_row, win.ws_col); +#if defined (READLINE) + rl_set_screen_size (win.ws_row, win.ws_col); + if (rp) + *rp = win.ws_row; + if (cp) + *cp = win.ws_col; +#endif + } +#endif +} diff --git a/lib/sh/zcatfd.c b/lib/sh/zcatfd.c new file mode 100644 index 0000000..bdbcd91 --- /dev/null +++ b/lib/sh/zcatfd.c @@ -0,0 +1,70 @@ +/* zcatfd - copy contents of file descriptor to another */ + +/* Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include + +#include + +#if !defined (errno) +extern int errno; +#endif + +extern ssize_t zread __P((int, char *, size_t)); +extern int zwrite __P((int, char *, ssize_t)); + +/* Dump contents of file descriptor FD to OFD. FN is the filename for + error messages (not used right now). */ +int +zcatfd (fd, ofd, fn) + int fd, ofd; + char *fn; +{ + ssize_t nr; + int rval; + char lbuf[128]; + + rval = 0; + while (1) + { + nr = zread (fd, lbuf, sizeof (lbuf)); + if (nr == 0) + break; + else if (nr < 0) + { + rval = -1; + break; + } + else if (zwrite (ofd, lbuf, nr) < 0) + { + rval = -1; + break; + } + } + + return rval; +} diff --git a/lib/sh/zgetline.c b/lib/sh/zgetline.c new file mode 100644 index 0000000..9cef975 --- /dev/null +++ b/lib/sh/zgetline.c @@ -0,0 +1,121 @@ +/* zgetline - read a line of input from a specified file descriptor and return + a pointer to a newly-allocated buffer containing the data. */ + +/* Copyright (C) 2008,2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include "xmalloc.h" + +#if !defined (errno) +extern int errno; +#endif + +extern ssize_t zread __P((int, char *, size_t)); +extern ssize_t zreadc __P((int, char *)); +extern ssize_t zreadintr __P((int, char *, size_t)); +extern ssize_t zreadcintr __P((int, char *)); + +typedef ssize_t breadfunc_t __P((int, char *, size_t)); +typedef ssize_t creadfunc_t __P((int, char *)); + +/* Initial memory allocation for automatic growing buffer in zreadlinec */ +#define GET_LINE_INITIAL_ALLOCATION 16 + +/* Derived from GNU libc's getline. + The behavior is almost the same as getline. See man getline. + The differences are + (1) using file descriptor instead of FILE *, + (2) the order of arguments; the file descriptor comes the first, and + (3) the addition of third argument, UNBUFFERED_READ; this argument + controls whether get_line uses buffering or not to get a byte data + from FD. get_line uses zreadc if UNBUFFERED_READ is zero; and + uses zread if UNBUFFERED_READ is non-zero. + + Returns number of bytes read or -1 on error. */ + +ssize_t +zgetline (fd, lineptr, n, unbuffered_read) + int fd; + char **lineptr; + size_t *n; + int unbuffered_read; +{ + int nr, retval; + char *line, c; + + if (lineptr == 0 || n == 0 || (*lineptr == 0 && *n != 0)) + return -1; + + nr = 0; + line = *lineptr; + + while (1) + { + retval = unbuffered_read ? zread (fd, &c, 1) : zreadc(fd, &c); + + if (retval <= 0) + { + if (line && nr > 0) + line[nr] = '\0'; + break; + } + + if (nr + 2 >= *n) + { + size_t new_size; + + new_size = (*n == 0) ? GET_LINE_INITIAL_ALLOCATION : *n * 2; + line = (*n >= new_size) ? NULL : xrealloc (*lineptr, new_size); + + if (line) + { + *lineptr = line; + *n = new_size; + } + else + { + if (*n > 0) + { + (*lineptr)[*n - 1] = '\0'; + nr = *n - 2; + } + break; + } + } + + line[nr] = c; + nr++; + + if (c == '\n') + { + line[nr] = '\0'; + break; + } + } + + return nr - 1; +} diff --git a/lib/sh/zmapfd.c b/lib/sh/zmapfd.c new file mode 100644 index 0000000..e720892 --- /dev/null +++ b/lib/sh/zmapfd.c @@ -0,0 +1,89 @@ +/* zmapfd - read contents of file descriptor into a newly-allocated buffer */ + +/* Copyright (C) 2006 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include + +#include "bashansi.h" +#include "command.h" +#include "general.h" + +#if !defined (errno) +extern int errno; +#endif + +extern ssize_t zread __P((int, char *, size_t)); + +/* Dump contents of file descriptor FD to *OSTR. FN is the filename for + error messages (not used right now). */ +int +zmapfd (fd, ostr, fn) + int fd; + char **ostr; + char *fn; +{ + ssize_t nr; + int rval; + char lbuf[128]; + char *result; + int rsize, rind; + + rval = 0; + result = (char *)xmalloc (rsize = 64); + rind = 0; + + while (1) + { + nr = zread (fd, lbuf, sizeof (lbuf)); + if (nr == 0) + { + rval = rind; + break; + } + else if (nr < 0) + { + free (result); + if (ostr) + *ostr = (char *)NULL; + return -1; + } + + RESIZE_MALLOCED_BUFFER (result, rind, nr, rsize, 128); + memcpy (result+rind, lbuf, nr); + rind += nr; + } + + RESIZE_MALLOCED_BUFFER (result, rind, 1, rsize, 128); + result[rind] = '\0'; + + if (ostr) + *ostr = result; + else + free (result); + + return rval; +} diff --git a/lib/sh/zread.c b/lib/sh/zread.c new file mode 100644 index 0000000..868f970 --- /dev/null +++ b/lib/sh/zread.c @@ -0,0 +1,218 @@ +/* zread - read data from file descriptor into buffer with retries */ + +/* Copyright (C) 1999-2002 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include + +#if !defined (errno) +extern int errno; +#endif + +#ifndef SEEK_CUR +# define SEEK_CUR 1 +#endif + +extern void check_signals_and_traps (void); +extern int signal_is_trapped (int); + +/* Read LEN bytes from FD into BUF. Retry the read on EINTR. Any other + error causes the loop to break. */ +ssize_t +zread (fd, buf, len) + int fd; + char *buf; + size_t len; +{ + ssize_t r; + +#if 0 +#if defined (HAVE_SIGINTERRUPT) + if (signal_is_trapped (SIGCHLD)) + siginterrupt (SIGCHLD, 1); +#endif +#endif + + while ((r = read (fd, buf, len)) < 0 && errno == EINTR) + check_signals_and_traps (); /* XXX - should it be check_signals()? */ + +#if 0 +#if defined (HAVE_SIGINTERRUPT) + siginterrupt (SIGCHLD, 0); +#endif +#endif + + return r; +} + +/* Read LEN bytes from FD into BUF. Retry the read on EINTR, up to three + interrupts. Any other error causes the loop to break. */ + +#ifdef NUM_INTR +# undef NUM_INTR +#endif +#define NUM_INTR 3 + +ssize_t +zreadretry (fd, buf, len) + int fd; + char *buf; + size_t len; +{ + ssize_t r; + int nintr; + + for (nintr = 0; ; ) + { + r = read (fd, buf, len); + if (r >= 0) + return r; + if (r == -1 && errno == EINTR) + { + if (++nintr >= NUM_INTR) + return -1; + continue; + } + return r; + } +} + +/* Call read(2) and allow it to be interrupted. Just a stub for now. */ +ssize_t +zreadintr (fd, buf, len) + int fd; + char *buf; + size_t len; +{ + return (read (fd, buf, len)); +} + +/* Read one character from FD and return it in CP. Return values are as + in read(2). This does some local buffering to avoid many one-character + calls to read(2), like those the `read' builtin performs. */ + +static char lbuf[128]; +static size_t lind, lused; + +ssize_t +zreadc (fd, cp) + int fd; + char *cp; +{ + ssize_t nr; + + if (lind == lused || lused == 0) + { + nr = zread (fd, lbuf, sizeof (lbuf)); + lind = 0; + if (nr <= 0) + { + lused = 0; + return nr; + } + lused = nr; + } + if (cp) + *cp = lbuf[lind++]; + return 1; +} + +/* Don't mix calls to zreadc and zreadcintr in the same function, since they + use the same local buffer. */ +ssize_t +zreadcintr (fd, cp) + int fd; + char *cp; +{ + ssize_t nr; + + if (lind == lused || lused == 0) + { + nr = zreadintr (fd, lbuf, sizeof (lbuf)); + lind = 0; + if (nr <= 0) + { + lused = 0; + return nr; + } + lused = nr; + } + if (cp) + *cp = lbuf[lind++]; + return 1; +} + +/* Like zreadc, but read a specified number of characters at a time. Used + for `read -N'. */ +ssize_t +zreadn (fd, cp, len) + int fd; + char *cp; + size_t len; +{ + ssize_t nr; + + if (lind == lused || lused == 0) + { + if (len > sizeof (lbuf)) + len = sizeof (lbuf); + nr = zread (fd, lbuf, len); + lind = 0; + if (nr <= 0) + { + lused = 0; + return nr; + } + lused = nr; + } + if (cp) + *cp = lbuf[lind++]; + return 1; +} + +void +zreset () +{ + lind = lused = 0; +} + +/* Sync the seek pointer for FD so that the kernel's idea of the last char + read is the last char returned by zreadc. */ +void +zsyncfd (fd) + int fd; +{ + off_t off, r; + + off = lused - lind; + r = 0; + if (off > 0) + r = lseek (fd, -off, SEEK_CUR); + + if (r != -1) + lused = lind = 0; +} diff --git a/lib/sh/zwrite.c b/lib/sh/zwrite.c new file mode 100644 index 0000000..3240f4f --- /dev/null +++ b/lib/sh/zwrite.c @@ -0,0 +1,64 @@ +/* zwrite - write contents of buffer to file descriptor, retrying on error */ + +/* Copyright (C) 1999-2002 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include + +#if !defined (errno) +extern int errno; +#endif + +/* Write NB bytes from BUF to file descriptor FD, retrying the write if + it is interrupted. We retry three times if we get a zero-length + write. Any other signal causes this function to return prematurely. */ +int +zwrite (fd, buf, nb) + int fd; + char *buf; + size_t nb; +{ + int n, i, nt; + + for (n = nb, nt = 0;;) + { + i = write (fd, buf, n); + if (i > 0) + { + n -= i; + if (n <= 0) + return nb; + buf += i; + } + else if (i == 0) + { + if (++nt > 3) + return (nb - n); + } + else if (errno != EINTR) + return -1; + } +} diff --git a/lib/termcap/Makefile.in b/lib/termcap/Makefile.in new file mode 100644 index 0000000..aeee47f --- /dev/null +++ b/lib/termcap/Makefile.in @@ -0,0 +1,90 @@ +## -*- text -*- #################################################### +# # +# Makefile for termcap replacement libbrary. # +# # +#################################################################### + +# Copyright (C) 1996-2009 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +srcdir = @srcdir@ +VPATH = .:@srcdir@ +topdir = @top_srcdir@ +BUILD_DIR = @BUILD_DIR@ + +libdir = @libdir@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ + +CC = @CC@ +RANLIB = @RANLIB@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +RM = rm -f +CP = cp +MV = mv + +SHELL = @MAKE_SHELL@ + +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ + +DEFS = @DEFS@ + +INCLUDES = -I. -I../.. -I$(topdir) -I$(topdir)/lib -I$(srcdir) + +CCFLAGS = $(CFLAGS) $(DEFS) $(CPPFLAGS) ${INCLUDES} + +# Here is a rule for making .o files from .c files that doesn't force +# the type of the machine (like -sun3) into the flags. +.c.o: + $(CC) -c $(CCFLAGS) $< + +SOURCES = termcap.c tparam.c +OBJECTS = termcap.o tparam.o + +DOCUMENTATION = termcap.texinfo + +THINGS_TO_TAR = $(SOURCES) $(DOCUMENTATION) + +########################################################################## + +all: libtermcap.a + +libtermcap.a: $(OBJECTS) + $(RM) -f $@ + $(AR) $(ARFLAGS) $@ $(OBJECTS) + -test -n "$(RANLIB)" && $(RANLIB) $@ + +install: + +clean: + $(RM) *.o *.a *.log *.cp *.tp *.vr *.fn *.aux *.pg *.toc + +mostlyclean: clean + +distclean maintainer-clean: clean + $(RM) Makefile + +$(DESTDIR)$(libdir)/libtermcap.a: libtermcap.a + ${INSTALL_DATA} -c -m 644 libtermcap.a $@ + -test -n "$(RANLIB)" && $(RANLIB) -t $@ + +termcap.o: $(BUILD_DIR)/config.h +tparam.o: $(BUILD_DIR)/config.h +version.o: $(BUILD_DIR)/config.h diff --git a/lib/termcap/ltcap.h b/lib/termcap/ltcap.h new file mode 100644 index 0000000..a97f0d8 --- /dev/null +++ b/lib/termcap/ltcap.h @@ -0,0 +1,30 @@ +/* ltcap.h - Local declarations for termcap library. */ + +/* Copyright (C) 1999-2009 Free Software Foundation, Inc. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _LTCAP_H_ +#define _LTCAP_H_ 1 + +#if !defined (__APPLE__) +# define __private_extern__ +#endif + +#ifndef MAX_TGETENT_BUFSIZ +# define MAX_TGETENT_BUFSIZ 2048 +#endif + +#endif /* _LTCAP_H_ */ diff --git a/lib/termcap/termcap.c b/lib/termcap/termcap.c new file mode 100644 index 0000000..7311349 --- /dev/null +++ b/lib/termcap/termcap.c @@ -0,0 +1,815 @@ +/* termcap.c - Work-alike for termcap, plus extra features. */ + +/* Copyright (C) 1985, 1986, 1993,1994, 1995, 1998, 2001,2003,2005,2006,2008,2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Emacs config.h may rename various library functions such as malloc. */ +#ifdef HAVE_CONFIG_H + +#include + +/* Get the O_* definitions for open et al. */ +#if !defined (_MINIX) && defined (HAVE_SYS_FILE_H) +# include +#endif + +#include + +#ifdef HAVE_UNISTD_H +#include +#endif + +#ifdef HAVE_STDLIB_H +# include +#else +extern char *getenv (); +extern char *malloc (); +extern char *realloc (); +#endif + +#if defined (HAVE_STRING_H) +#include +#endif + +#if !defined (HAVE_BCOPY) && (defined (HAVE_STRING_H) || defined (STDC_HEADERS)) +# define bcopy(s, d, n) memcpy ((d), (s), (n)) +#endif + +#else /* not HAVE_CONFIG_H */ + +#ifdef STDC_HEADERS +#include +#include +#else +char *getenv (); +char *malloc (); +char *realloc (); +#endif + +/* Do this after the include, in case string.h prototypes bcopy. */ +#if (defined(HAVE_STRING_H) || defined(STDC_HEADERS)) && !defined(bcopy) +#define bcopy(s, d, n) memcpy ((d), (s), (n)) +#endif + +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef _POSIX_VERSION +#include +#endif + +#endif /* not HAVE_CONFIG_H */ + +#ifndef NULL +#define NULL (char *) 0 +#endif + +#ifndef O_RDONLY +#define O_RDONLY 0 +#endif + +/* BUFSIZE is the initial size allocated for the buffer + for reading the termcap file. + It is not a limit. + Make it large normally for speed. + Make it variable when debugging, so can exercise + increasing the space dynamically. */ + +#ifndef BUFSIZE +#ifdef DEBUG +#define BUFSIZE bufsize + +int bufsize = 128; +#else +#define BUFSIZE 2048 +#endif +#endif + +#include "ltcap.h" + +#ifndef TERMCAP_FILE +#define TERMCAP_FILE "/etc/termcap" +#endif + +#ifndef emacs +static void +memory_out () +{ + write (2, "virtual memory exhausted\n", 25); + exit (1); +} + +static char * +xmalloc (size) + unsigned size; +{ + register char *tem = malloc (size); + + if (!tem) + memory_out (); + return tem; +} + +static char * +xrealloc (ptr, size) + char *ptr; + unsigned size; +{ + register char *tem = realloc (ptr, size); + + if (!tem) + memory_out (); + return tem; +} +#endif /* not emacs */ + +/* Looking up capabilities in the entry already found. */ + +/* The pointer to the data made by tgetent is left here + for tgetnum, tgetflag and tgetstr to find. */ +static char *term_entry; + +static char *tgetst1 (); + +/* Search entry BP for capability CAP. + Return a pointer to the capability (in BP) if found, + 0 if not found. */ + +static char * +find_capability (bp, cap) + register char *bp, *cap; +{ + for (; *bp; bp++) + if (bp[0] == ':' + && bp[1] == cap[0] + && bp[2] == cap[1]) + return &bp[4]; + return NULL; +} + +__private_extern__ +int +tgetnum (cap) + char *cap; +{ + register char *ptr = find_capability (term_entry, cap); + if (!ptr || ptr[-1] != '#') + return -1; + return atoi (ptr); +} + +__private_extern__ +int +tgetflag (cap) + char *cap; +{ + register char *ptr = find_capability (term_entry, cap); + return ptr && ptr[-1] == ':'; +} + +/* Look up a string-valued capability CAP. + If AREA is non-null, it points to a pointer to a block in which + to store the string. That pointer is advanced over the space used. + If AREA is null, space is allocated with `malloc'. */ + +__private_extern__ +char * +tgetstr (cap, area) + char *cap; + char **area; +{ + register char *ptr = find_capability (term_entry, cap); + if (!ptr || (ptr[-1] != '=' && ptr[-1] != '~')) + return NULL; + return tgetst1 (ptr, area); +} + +/* Table, indexed by a character in range 0100 to 0140 with 0100 subtracted, + gives meaning of character following \, or a space if no special meaning. + Eight characters per line within the string. */ + +static char esctab[] + = " \007\010 \033\014 \ + \012 \ + \015 \011 \013 \ + "; + +/* PTR points to a string value inside a termcap entry. + Copy that value, processing \ and ^ abbreviations, + into the block that *AREA points to, + or to newly allocated storage if AREA is NULL. + Return the address to which we copied the value, + or NULL if PTR is NULL. */ + +static char * +tgetst1 (ptr, area) + char *ptr; + char **area; +{ + register char *p, *r; + register int c; + register int size; + char *ret; + register int c1; + + if (!ptr) + return NULL; + + /* `ret' gets address of where to store the string. */ + if (!area) + { + /* Compute size of block needed (may overestimate). */ + p = ptr; + while ((c = *p++) && c != ':' && c != '\n') + ; + ret = (char *) xmalloc (p - ptr + 1); + } + else + ret = *area; + + /* Copy the string value, stopping at null or colon. + Also process ^ and \ abbreviations. */ + p = ptr; + r = ret; + while ((c = *p++) && c != ':' && c != '\n') + { + if (c == '^') + { + c = *p++; + if (c == '?') + c = 0177; + else + c &= 037; + } + else if (c == '\\') + { + c = *p++; + if (c >= '0' && c <= '7') + { + c -= '0'; + size = 0; + + while (++size < 3 && (c1 = *p) >= '0' && c1 <= '7') + { + c *= 8; + c += c1 - '0'; + p++; + } + } + else if (c >= 0100 && c < 0200) + { + c1 = esctab[(c & ~040) - 0100]; + if (c1 != ' ') + c = c1; + } + } + *r++ = c; + } + *r = '\0'; + /* Update *AREA. */ + if (area) + *area = r + 1; + return ret; +} + +/* Outputting a string with padding. */ + +short ospeed; +/* If OSPEED is 0, we use this as the actual baud rate. */ +int tputs_baud_rate; +__private_extern__ char PC = '\0'; + +/* Actual baud rate if positive; + - baud rate / 100 if negative. */ + +static int speeds[] = + { +#ifdef VMS + 0, 50, 75, 110, 134, 150, -3, -6, -12, -18, + -20, -24, -36, -48, -72, -96, -192 +#else /* not VMS */ + 0, 50, 75, 110, 135, 150, -2, -3, -6, -12, + -18, -24, -48, -96, -192, -288, -384, -576, -1152 +#endif /* not VMS */ + }; + +__private_extern__ +void +tputs (str, nlines, outfun) + register char *str; + int nlines; + register int (*outfun) (); +{ + register int padcount = 0; + register int speed; + +#ifdef emacs + extern baud_rate; + speed = baud_rate; + /* For quite high speeds, convert to the smaller + units to avoid overflow. */ + if (speed > 10000) + speed = - speed / 100; +#else + if (ospeed == 0) + speed = tputs_baud_rate; + else if (ospeed > 0 && ospeed < (sizeof speeds / sizeof speeds[0])) + speed = speeds[ospeed]; + else + speed = 0; +#endif + + if (!str) + return; + + while (*str >= '0' && *str <= '9') + { + padcount += *str++ - '0'; + padcount *= 10; + } + if (*str == '.') + { + str++; + padcount += *str++ - '0'; + } + if (*str == '*') + { + str++; + padcount *= nlines; + } + while (*str) + (*outfun) (*str++); + + /* PADCOUNT is now in units of tenths of msec. + SPEED is measured in characters per 10 seconds + or in characters per .1 seconds (if negative). + We use the smaller units for larger speeds to avoid overflow. */ + padcount *= speed; + padcount += 500; + padcount /= 1000; + if (speed < 0) + padcount = -padcount; + else + { + padcount += 50; + padcount /= 100; + } + + while (padcount-- > 0) + (*outfun) (PC); +} + +/* Finding the termcap entry in the termcap data base. */ + +struct buffer + { + char *beg; + int size; + char *ptr; + int ateof; + int full; + }; + +/* Forward declarations of static functions. */ + +static int scan_file (); +static char *gobble_line (); +static int compare_contin (); +static int name_match (); + +#ifdef VMS + +#include +#include +#include + +static int +valid_filename_p (fn) + char *fn; +{ + struct FAB fab = cc$rms_fab; + struct NAM nam = cc$rms_nam; + char esa[NAM$C_MAXRSS]; + + fab.fab$l_fna = fn; + fab.fab$b_fns = strlen(fn); + fab.fab$l_nam = &nam; + fab.fab$l_fop = FAB$M_NAM; + + nam.nam$l_esa = esa; + nam.nam$b_ess = sizeof esa; + + return SYS$PARSE(&fab, 0, 0) == RMS$_NORMAL; +} + +#else /* !VMS */ + +#ifdef MSDOS /* MW, May 1993 */ +static int +valid_filename_p (fn) + char *fn; +{ + return *fn == '\\' || *fn == '/' || + (*fn >= 'A' && *fn <= 'z' && fn[1] == ':'); +} +#else +#define valid_filename_p(fn) (*(fn) == '/') +#endif + +#endif /* !VMS */ + +/* Find the termcap entry data for terminal type NAME + and store it in the block that BP points to. + Record its address for future use. + + If BP is null, space is dynamically allocated. + + Return -1 if there is some difficulty accessing the data base + of terminal types, + 0 if the data base is accessible but the type NAME is not defined + in it, and some other value otherwise. */ + +__private_extern__ +int +tgetent (bp, name) + char *bp, *name; +{ + register char *termcap_name; + register int fd; + struct buffer buf; + register char *bp1; + char *bp2; + char *term; + int malloc_size = 0; + register int c; + char *tcenv; /* TERMCAP value, if it contains :tc=. */ + char *indirect = NULL; /* Terminal type in :tc= in TERMCAP value. */ + int filep; + +#ifdef INTERNAL_TERMINAL + /* For the internal terminal we don't want to read any termcap file, + so fake it. */ + if (!strcmp (name, "internal")) + { + term = INTERNAL_TERMINAL; + if (!bp) + { + malloc_size = 1 + strlen (term); + bp = (char *) xmalloc (malloc_size); + } + strcpy (bp, term); + goto ret; + } +#endif /* INTERNAL_TERMINAL */ + + /* For compatibility with programs like `less' that want to + put data in the termcap buffer themselves as a fallback. */ + if (bp) + term_entry = bp; + + termcap_name = getenv ("TERMCAP"); + if (termcap_name && *termcap_name == '\0') + termcap_name = NULL; +#if 0 +#if defined (MSDOS) && !defined (TEST) + if (termcap_name && (*termcap_name == '\\' + || *termcap_name == '/' + || termcap_name[1] == ':')) + dostounix_filename(termcap_name); +#endif +#endif + + filep = termcap_name && valid_filename_p (termcap_name); + + /* If termcap_name is non-null and starts with / (in the un*x case, that is), + it is a file name to use instead of /etc/termcap. + If it is non-null and does not start with /, + it is the entry itself, but only if + the name the caller requested matches the TERM variable. */ + + if (termcap_name && !filep && !strcmp (name, getenv ("TERM"))) + { + indirect = tgetst1 (find_capability (termcap_name, "tc"), (char **) 0); + if (!indirect) + { + if (!bp) + bp = termcap_name; + else + strcpy (bp, termcap_name); + goto ret; + } + else + { /* It has tc=. Need to read /etc/termcap. */ + tcenv = termcap_name; + termcap_name = NULL; + } + } + + if (!termcap_name || !filep) + termcap_name = TERMCAP_FILE; + + /* Here we know we must search a file and termcap_name has its name. */ + +#ifdef MSDOS + fd = open (termcap_name, O_RDONLY|O_TEXT, 0); +#else + fd = open (termcap_name, O_RDONLY, 0); +#endif + if (fd < 0) + return -1; + + buf.size = BUFSIZE; + /* Add 1 to size to ensure room for terminating null. */ + buf.beg = (char *) xmalloc (buf.size + 1); + term = indirect ? indirect : name; + + if (!bp) + { + malloc_size = indirect ? strlen (tcenv) + 1 : buf.size; + bp = (char *) xmalloc (malloc_size); + } + bp1 = bp; + + if (indirect) + /* Copy the data from the environment variable. */ + { + strcpy (bp, tcenv); + bp1 += strlen (tcenv); + } + + while (term) + { + /* Scan the file, reading it via buf, till find start of main entry. */ + if (scan_file (term, fd, &buf) == 0) + { + close (fd); + free (buf.beg); + if (malloc_size) + free (bp); + return 0; + } + + /* Free old `term' if appropriate. */ + if (term != name) + free (term); + + /* If BP is malloc'd by us, make sure it is big enough. */ + if (malloc_size) + { + malloc_size = bp1 - bp + buf.size; + termcap_name = (char *) xrealloc (bp, malloc_size); + bp1 += termcap_name - bp; + bp = termcap_name; + } + + bp2 = bp1; + + /* Copy the line of the entry from buf into bp. */ + termcap_name = buf.ptr; + while ((*bp1++ = c = *termcap_name++) && c != '\n') + /* Drop out any \ newline sequence. */ + if (c == '\\' && *termcap_name == '\n') + { + bp1--; + termcap_name++; + } + *bp1 = '\0'; + + /* Does this entry refer to another terminal type's entry? + If something is found, copy it into heap and null-terminate it. */ + term = tgetst1 (find_capability (bp2, "tc"), (char **) 0); + } + + close (fd); + free (buf.beg); + + if (malloc_size) + bp = (char *) xrealloc (bp, bp1 - bp + 1); + + ret: + term_entry = bp; + return 1; +} + +/* Given file open on FD and buffer BUFP, + scan the file from the beginning until a line is found + that starts the entry for terminal type STR. + Return 1 if successful, with that line in BUFP, + or 0 if no entry is found in the file. */ + +static int +scan_file (str, fd, bufp) + char *str; + int fd; + register struct buffer *bufp; +{ + register char *end; + + bufp->ptr = bufp->beg; + bufp->full = 0; + bufp->ateof = 0; + *bufp->ptr = '\0'; + + lseek (fd, 0L, 0); + + while (!bufp->ateof) + { + /* Read a line into the buffer. */ + end = NULL; + do + { + /* if it is continued, append another line to it, + until a non-continued line ends. */ + end = gobble_line (fd, bufp, end); + } + while (!bufp->ateof && end[-2] == '\\'); + + if (*bufp->ptr != '#' + && name_match (bufp->ptr, str)) + return 1; + + /* Discard the line just processed. */ + bufp->ptr = end; + } + return 0; +} + +/* Return nonzero if NAME is one of the names specified + by termcap entry LINE. */ + +static int +name_match (line, name) + char *line, *name; +{ + register char *tem; + + if (!compare_contin (line, name)) + return 1; + /* This line starts an entry. Is it the right one? */ + for (tem = line; *tem && *tem != '\n' && *tem != ':'; tem++) + if (*tem == '|' && !compare_contin (tem + 1, name)) + return 1; + + return 0; +} + +static int +compare_contin (str1, str2) + register char *str1, *str2; +{ + register int c1, c2; + while (1) + { + c1 = *str1++; + c2 = *str2++; + while (c1 == '\\' && *str1 == '\n') + { + str1++; + while ((c1 = *str1++) == ' ' || c1 == '\t'); + } + if (c2 == '\0') + { + /* End of type being looked up. */ + if (c1 == '|' || c1 == ':') + /* If end of name in data base, we win. */ + return 0; + else + return 1; + } + else if (c1 != c2) + return 1; + } +} + +/* Make sure that the buffer <- BUFP contains a full line + of the file open on FD, starting at the place BUFP->ptr + points to. Can read more of the file, discard stuff before + BUFP->ptr, or make the buffer bigger. + + Return the pointer to after the newline ending the line, + or to the end of the file, if there is no newline to end it. + + Can also merge on continuation lines. If APPEND_END is + non-null, it points past the newline of a line that is + continued; we add another line onto it and regard the whole + thing as one line. The caller decides when a line is continued. */ + +static char * +gobble_line (fd, bufp, append_end) + int fd; + register struct buffer *bufp; + char *append_end; +{ + register char *end; + register int nread; + register char *buf = bufp->beg; + register char *tem; + + if (!append_end) + append_end = bufp->ptr; + + while (1) + { + end = append_end; + while (*end && *end != '\n') end++; + if (*end) + break; + if (bufp->ateof) + return buf + bufp->full; + if (bufp->ptr == buf) + { + if (bufp->full == bufp->size) + { + bufp->size *= 2; + /* Add 1 to size to ensure room for terminating null. */ + tem = (char *) xrealloc (buf, bufp->size + 1); + bufp->ptr = (bufp->ptr - buf) + tem; + append_end = (append_end - buf) + tem; + bufp->beg = buf = tem; + } + } + else + { + append_end -= bufp->ptr - buf; + bcopy (bufp->ptr, buf, bufp->full -= bufp->ptr - buf); + bufp->ptr = buf; + } + if (!(nread = read (fd, buf + bufp->full, bufp->size - bufp->full))) + bufp->ateof = 1; + bufp->full += nread; + buf[bufp->full] = '\0'; + } + return end + 1; +} + +#ifdef TEST + +#ifdef NULL +#undef NULL +#endif + +#include + +main (argc, argv) + int argc; + char **argv; +{ + char *term; + char *buf; + + term = argv[1]; + printf ("TERM: %s\n", term); + + buf = (char *) tgetent (0, term); + if ((int) buf <= 0) + { + printf ("No entry.\n"); + return 0; + } + + printf ("Entry: %s\n", buf); + + tprint ("cm"); + tprint ("AL"); + + printf ("co: %d\n", tgetnum ("co")); + printf ("am: %d\n", tgetflag ("am")); +} + +tprint (cap) + char *cap; +{ + char *x = tgetstr (cap, 0); + register char *y; + + printf ("%s: ", cap); + if (x) + { + for (y = x; *y; y++) + if (*y <= ' ' || *y == 0177) + printf ("\\%0o", *y); + else + putchar (*y); + free (x); + } + else + printf ("none"); + putchar ('\n'); +} + +#endif /* TEST */ diff --git a/lib/termcap/termcap.h b/lib/termcap/termcap.h new file mode 100644 index 0000000..5d71595 --- /dev/null +++ b/lib/termcap/termcap.h @@ -0,0 +1,63 @@ +/* termcap.h - public declarations for termcap library. */ + +/* Copyright (C) 1991, 1992, 1995, 2001, 2005, 2006, 2008,2009 Free Software Foundation, Inc. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _TERMCAP_H +#define _TERMCAP_H 1 + +#if __STDC__ + +extern int tgetent (char *buffer, const char *termtype); + +extern int tgetnum (const char *name); +extern int tgetflag (const char *name); +extern char *tgetstr (const char *name, char **area); + +extern char PC; +extern short ospeed; +extern void tputs (const char *string, int nlines, int (*outfun) (int)); + +extern char *tparam (const char *ctlstring, char *buffer, int size, ...); + +extern char *UP; +extern char *BC; + +extern char *tgoto (const char *cstring, int hpos, int vpos); + +#else /* not __STDC__ */ + +extern int tgetent (); + +extern int tgetnum (); +extern int tgetflag (); +extern char *tgetstr (); + +extern char PC; +extern short ospeed; + +extern void tputs (); + +extern char *tparam (); + +extern char *UP; +extern char *BC; + +extern char *tgoto (); + +#endif /* not __STDC__ */ + +#endif /* not _TERMCAP_H */ diff --git a/lib/termcap/tparam.c b/lib/termcap/tparam.c new file mode 100644 index 0000000..c4bff08 --- /dev/null +++ b/lib/termcap/tparam.c @@ -0,0 +1,345 @@ +/* tparam.c - merge parameters into a termcap entry string. */ + +/* Copyright (C) 1985, 1986, 1993,1994, 1995, 1998, 2001,2003,2005,2006,2008,2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Emacs config.h may rename various library functions such as malloc. */ +#ifdef HAVE_CONFIG_H +#include + +#ifdef HAVE_STDLIB_H +# include +#else +extern char *getenv (); +extern char *malloc (); +extern char *realloc (); +#endif + +#if defined (HAVE_STRING_H) +#include +#endif + +#if !defined (HAVE_BCOPY) && (defined (HAVE_STRING_H) || defined (STDC_HEADERS)) +# define bcopy(s, d, n) memcpy ((d), (s), (n)) +#endif + +#else /* not HAVE_CONFIG_H */ + +#if defined(HAVE_STRING_H) || defined(STDC_HEADERS) +#define bcopy(s, d, n) memcpy ((d), (s), (n)) +#endif + +#ifdef STDC_HEADERS +#include +#include +#else +char *malloc (); +char *realloc (); +#endif + +#endif /* not HAVE_CONFIG_H */ + +#include "ltcap.h" + +#ifndef NULL +#define NULL (char *) 0 +#endif + +#ifndef emacs +static void +memory_out () +{ + write (2, "virtual memory exhausted\n", 25); + exit (1); +} + +static char * +xmalloc (size) + unsigned size; +{ + register char *tem = malloc (size); + + if (!tem) + memory_out (); + return tem; +} + +static char * +xrealloc (ptr, size) + char *ptr; + unsigned size; +{ + register char *tem = realloc (ptr, size); + + if (!tem) + memory_out (); + return tem; +} +#endif /* not emacs */ + +/* Assuming STRING is the value of a termcap string entry + containing `%' constructs to expand parameters, + merge in parameter values and store result in block OUTSTRING points to. + LEN is the length of OUTSTRING. If more space is needed, + a block is allocated with `malloc'. + + The value returned is the address of the resulting string. + This may be OUTSTRING or may be the address of a block got with `malloc'. + In the latter case, the caller must free the block. + + The fourth and following args to tparam serve as the parameter values. */ + +static char *tparam1 (); + +/* VARARGS 2 */ +char * +tparam (string, outstring, len, arg0, arg1, arg2, arg3) + char *string; + char *outstring; + int len; + int arg0, arg1, arg2, arg3; +{ + int arg[4]; + + arg[0] = arg0; + arg[1] = arg1; + arg[2] = arg2; + arg[3] = arg3; + return tparam1 (string, outstring, len, NULL, NULL, arg); +} + +__private_extern__ char *BC; +__private_extern__ char *UP; + +static char tgoto_buf[50]; + +__private_extern__ +char * +tgoto (cm, hpos, vpos) + char *cm; + int hpos, vpos; +{ + int args[2]; + if (!cm) + return NULL; + args[0] = vpos; + args[1] = hpos; + return tparam1 (cm, tgoto_buf, 50, UP, BC, args); +} + +static char * +tparam1 (string, outstring, len, up, left, argp) + char *string; + char *outstring; + int len; + char *up, *left; + register int *argp; +{ + register int c; + register char *p = string; + register char *op = outstring; + char *outend; + int outlen = 0; + + register int tem; + int *old_argp = argp; + int doleft = 0; + int doup = 0; + + outend = outstring + len; + + while (1) + { + /* If the buffer might be too short, make it bigger. */ + if (op + 5 >= outend) + { + register char *new; + if (outlen == 0) + { + outlen = len + 40; + new = (char *) xmalloc (outlen); + outend += 40; + bcopy (outstring, new, op - outstring); + } + else + { + outend += outlen; + outlen *= 2; + new = (char *) xrealloc (outstring, outlen); + } + op += new - outstring; + outend += new - outstring; + outstring = new; + } + c = *p++; + if (!c) + break; + if (c == '%') + { + c = *p++; + tem = *argp; + switch (c) + { + case 'd': /* %d means output in decimal. */ + if (tem < 10) + goto onedigit; + if (tem < 100) + goto twodigit; + case '3': /* %3 means output in decimal, 3 digits. */ + if (tem > 999) + { + *op++ = tem / 1000 + '0'; + tem %= 1000; + } + *op++ = tem / 100 + '0'; + case '2': /* %2 means output in decimal, 2 digits. */ + twodigit: + tem %= 100; + *op++ = tem / 10 + '0'; + onedigit: + *op++ = tem % 10 + '0'; + argp++; + break; + + case 'C': + /* For c-100: print quotient of value by 96, if nonzero, + then do like %+. */ + if (tem >= 96) + { + *op++ = tem / 96; + tem %= 96; + } + case '+': /* %+x means add character code of char x. */ + tem += *p++; + case '.': /* %. means output as character. */ + if (left) + { + /* If want to forbid output of 0 and \n and \t, + and this is one of them, increment it. */ + while (tem == 0 || tem == '\n' || tem == '\t') + { + tem++; + if (argp == old_argp) + doup++, outend -= strlen (up); + else + doleft++, outend -= strlen (left); + } + } + *op++ = tem ? tem : 0200; + case 'f': /* %f means discard next arg. */ + argp++; + break; + + case 'b': /* %b means back up one arg (and re-use it). */ + argp--; + break; + + case 'r': /* %r means interchange following two args. */ + argp[0] = argp[1]; + argp[1] = tem; + old_argp++; + break; + + case '>': /* %>xy means if arg is > char code of x, */ + if (argp[0] > *p++) /* then add char code of y to the arg, */ + argp[0] += *p; /* and in any case don't output. */ + p++; /* Leave the arg to be output later. */ + break; + + case 'a': /* %a means arithmetic. */ + /* Next character says what operation. + Add or subtract either a constant or some other arg. */ + /* First following character is + to add or - to subtract + or = to assign. */ + /* Next following char is 'p' and an arg spec + (0100 plus position of that arg relative to this one) + or 'c' and a constant stored in a character. */ + tem = p[2] & 0177; + if (p[1] == 'p') + tem = argp[tem - 0100]; + if (p[0] == '-') + argp[0] -= tem; + else if (p[0] == '+') + argp[0] += tem; + else if (p[0] == '*') + argp[0] *= tem; + else if (p[0] == '/') + argp[0] /= tem; + else + argp[0] = tem; + + p += 3; + break; + + case 'i': /* %i means add one to arg, */ + argp[0] ++; /* and leave it to be output later. */ + argp[1] ++; /* Increment the following arg, too! */ + break; + + case '%': /* %% means output %; no arg. */ + goto ordinary; + + case 'n': /* %n means xor each of next two args with 140. */ + argp[0] ^= 0140; + argp[1] ^= 0140; + break; + + case 'm': /* %m means xor each of next two args with 177. */ + argp[0] ^= 0177; + argp[1] ^= 0177; + break; + + case 'B': /* %B means express arg as BCD char code. */ + argp[0] += 6 * (tem / 10); + break; + + case 'D': /* %D means weird Delta Data transformation. */ + argp[0] -= 2 * (tem % 16); + break; + } + } + else + /* Ordinary character in the argument string. */ + ordinary: + *op++ = c; + } + *op = 0; + while (doup-- > 0) + strcat (op, up); + while (doleft-- > 0) + strcat (op, left); + return outstring; +} + +#ifdef DEBUG + +main (argc, argv) + int argc; + char **argv; +{ + char buf[50]; + int args[3]; + args[0] = atoi (argv[2]); + args[1] = atoi (argv[3]); + args[2] = atoi (argv[4]); + tparam1 (argv[1], buf, "LEFT", "UP", args); + printf ("%s\n", buf); + return 0; +} + +#endif /* DEBUG */ diff --git a/lib/termcap/version.c b/lib/termcap/version.c new file mode 100644 index 0000000..cad57be --- /dev/null +++ b/lib/termcap/version.c @@ -0,0 +1,22 @@ +/* version.c - termcap library version information. */ + +/* Copyright (C) 1985-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Make the library identifiable with the RCS ident command. */ +static char *termcap_version_string = "\n$Version: GNU termcap 1.3 $\n"; diff --git a/lib/tilde/Makefile.in b/lib/tilde/Makefile.in new file mode 100644 index 0000000..d5506c5 --- /dev/null +++ b/lib/tilde/Makefile.in @@ -0,0 +1,126 @@ +## -*- text -*- #################################################### +# # +# Makefile for the GNU Tilde Library. # +# # +#################################################################### + +# Copyright (C) 1996-2009 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +srcdir = @srcdir@ +VPATH = .:@srcdir@ +topdir = @top_srcdir@ +BUILD_DIR = @BUILD_DIR@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ + +CC = @CC@ +RANLIB = @RANLIB@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +RM = rm +CP = cp +MV = mv + +SHELL = @MAKE_SHELL@ + +PROFILE_FLAGS = @PROFILE_FLAGS@ + +CFLAGS = @CFLAGS@ +LOCAL_CFLAGS = @LOCAL_CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ @LOCAL_LDFLAGS@ + +DEFS = @DEFS@ +LOCAL_DEFS = @LOCAL_DEFS@ + +BASHINCDIR = ${topdir}/include + +INCLUDES = -I. -I../.. -I$(topdir) -I${BASHINCDIR} -I$(topdir)/lib + +CCFLAGS = $(PROFILE_FLAGS) $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) \ + ${INCLUDES} $(LOCAL_CFLAGS) $(CFLAGS) + +.c.o: + $(CC) -c $(CCFLAGS) $< + +# The name of the library target. +LIBRARY_NAME = libtilde.a + +# The C code source files for this library. +CSOURCES = $(srcdir)/tilde.c + +# The header files for this library. +HSOURCES = $(srcdir)/tilde.h + +OBJECTS = tilde.o + +# The texinfo files which document this library. +DOCSOURCE = doc/tilde.texi +DOCOBJECT = doc/tilde.dvi +DOCSUPPORT = doc/Makefile +DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT) + +SUPPORT = Makefile ChangeLog $(DOCSUPPORT) + +SOURCES = $(CSOURCES) $(HSOURCES) $(DOCSOURCE) + +THINGS_TO_TAR = $(SOURCES) $(SUPPORT) + +###################################################################### + +all: $(LIBRARY_NAME) + +$(LIBRARY_NAME): $(OBJECTS) + $(RM) -f $@ + $(AR) $(ARFLAGS) $@ $(OBJECTS) + -test -n "$(RANLIB)" && $(RANLIB) $@ + +documentation: force + -(cd doc; $(MAKE) $(MFLAGS)) + +force: + +# The rule for 'includes' is written funny so that the if statement +# always returns TRUE unless there really was an error installing the +# include files. +install: + $(INSTALL_DATA) -c -m 644 $(LIBRARY_NAME) $(libdir)/$(LIBRARY_NAME) + -test -n "$(RANLIB)" && $(RANLIB) -t $(libdir)/$(LIBRARY_NAME) + +clean: + $(RM) -f $(OBJECTS) $(LIBRARY_NAME) + -( cd doc && $(MAKE) $(MFLAGS) $@ ) + +realclean distclean maintainer-clean: clean + -( cd doc && $(MAKE) $(MFLAGS) $@ ) + $(RM) -f Makefile + +mostlyclean: clean + -( cd doc && $(MAKE) $(MFLAGS) $@ ) + +###################################################################### +# # +# Dependencies for the object files which make up this library. # +# # +###################################################################### + +tilde.o: tilde.h $(BASHINCDIR)/ansi_stdlib.h +tilde.o: $(BUILD_DIR)/config.h + +# Rules for deficient makes, like SunOS and Solaris +tilde.o: tilde.c diff --git a/lib/tilde/README b/lib/tilde/README new file mode 100644 index 0000000..a8772f3 --- /dev/null +++ b/lib/tilde/README @@ -0,0 +1,5 @@ +If you're building this separately from bash or the readline library, add +$(srcdir)/shell.c to the CSOURCES variable and shell.o to the OBJECTS +variable in Makefile.in. (Not that this is very useful without readline +or bash.) + diff --git a/lib/tilde/shell.c b/lib/tilde/shell.c new file mode 100644 index 0000000..fafb861 --- /dev/null +++ b/lib/tilde/shell.c @@ -0,0 +1,80 @@ +/* shell.c -- tilde utility functions that are normally provided by + bash when readline is linked as part of the shell. */ + +/* Copyright (C) 1998-2009 Free Software Foundation, Inc. + + This file is part of the GNU Tilde Library. + + The GNU Tilde Library is free software: you can redistribute it and/or + modify it under the terms of the GNU General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + The GNU Tilde Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with the GNU Tilde Library. If not, see . +*/ + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif /* HAVE_UNISTD_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#if defined (HAVE_STRING_H) +# include +#else +# include +#endif /* !HAVE_STRING_H */ + +#include + +#if !defined (HAVE_GETPW_DECLS) +extern struct passwd *getpwuid (); +#endif /* !HAVE_GETPW_DECLS */ + +char * +get_env_value (varname) + char *varname; +{ + return ((char *)getenv (varname)); +} + +/* If we're not using $HOME, assume that the passwd file information won't + change while this shell instance is running. */ +char * +get_home_dir () +{ + static char *home_dir = (char *)NULL; + struct passwd *entry; + + if (home_dir) + return (home_dir); + +#if defined (HAVE_GETPWUID) + entry = getpwuid (getuid ()); + if (entry) + home_dir = savestring (entry->pw_dir); +#endif + +#if defined (HAVE_GETPWENT) + endpwent (); /* some systems need this */ +#endif + + return (home_dir); +} diff --git a/lib/tilde/tilde.c b/lib/tilde/tilde.c new file mode 100644 index 0000000..1c53a45 --- /dev/null +++ b/lib/tilde/tilde.c @@ -0,0 +1,502 @@ +/* tilde.c -- Tilde expansion code (~/foo := $HOME/foo). */ + +/* Copyright (C) 1988-2009 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library (Readline), a library + for reading lines of text with interactive input and history editing. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#if defined (HAVE_STRING_H) +# include +#else /* !HAVE_STRING_H */ +# include +#endif /* !HAVE_STRING_H */ + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include +#if defined (HAVE_PWD_H) +#include +#endif + +#include "tilde.h" + +#if defined (TEST) || defined (STATIC_MALLOC) +static void *xmalloc (), *xrealloc (); +#else +# include "xmalloc.h" +#endif /* TEST || STATIC_MALLOC */ + +#if !defined (HAVE_GETPW_DECLS) +# if defined (HAVE_GETPWUID) +extern struct passwd *getpwuid PARAMS((uid_t)); +# endif +# if defined (HAVE_GETPWNAM) +extern struct passwd *getpwnam PARAMS((const char *)); +# endif +#endif /* !HAVE_GETPW_DECLS */ + +#if !defined (savestring) +#define savestring(x) strcpy ((char *)xmalloc (1 + strlen (x)), (x)) +#endif /* !savestring */ + +#if !defined (NULL) +# if defined (__STDC__) +# define NULL ((void *) 0) +# else +# define NULL 0x0 +# endif /* !__STDC__ */ +#endif /* !NULL */ + +/* If being compiled as part of bash, these will be satisfied from + variables.o. If being compiled as part of readline, they will + be satisfied from shell.o. */ +extern char *sh_get_home_dir PARAMS((void)); +extern char *sh_get_env_value PARAMS((const char *)); + +/* The default value of tilde_additional_prefixes. This is set to + whitespace preceding a tilde so that simple programs which do not + perform any word separation get desired behaviour. */ +static const char *default_prefixes[] = + { " ~", "\t~", (const char *)NULL }; + +/* The default value of tilde_additional_suffixes. This is set to + whitespace or newline so that simple programs which do not + perform any word separation get desired behaviour. */ +static const char *default_suffixes[] = + { " ", "\n", (const char *)NULL }; + +/* If non-null, this contains the address of a function that the application + wants called before trying the standard tilde expansions. The function + is called with the text sans tilde, and returns a malloc()'ed string + which is the expansion, or a NULL pointer if the expansion fails. */ +tilde_hook_func_t *tilde_expansion_preexpansion_hook = (tilde_hook_func_t *)NULL; + +/* If non-null, this contains the address of a function to call if the + standard meaning for expanding a tilde fails. The function is called + with the text (sans tilde, as in "foo"), and returns a malloc()'ed string + which is the expansion, or a NULL pointer if there is no expansion. */ +tilde_hook_func_t *tilde_expansion_failure_hook = (tilde_hook_func_t *)NULL; + +/* When non-null, this is a NULL terminated array of strings which + are duplicates for a tilde prefix. Bash uses this to expand + `=~' and `:~'. */ +char **tilde_additional_prefixes = (char **)default_prefixes; + +/* When non-null, this is a NULL terminated array of strings which match + the end of a username, instead of just "/". Bash sets this to + `:' and `=~'. */ +char **tilde_additional_suffixes = (char **)default_suffixes; + +static int tilde_find_prefix PARAMS((const char *, int *)); +static int tilde_find_suffix PARAMS((const char *)); +static char *isolate_tilde_prefix PARAMS((const char *, int *)); +static char *glue_prefix_and_suffix PARAMS((char *, const char *, int)); + +/* Find the start of a tilde expansion in STRING, and return the index of + the tilde which starts the expansion. Place the length of the text + which identified this tilde starter in LEN, excluding the tilde itself. */ +static int +tilde_find_prefix (string, len) + const char *string; + int *len; +{ + register int i, j, string_len; + register char **prefixes; + + prefixes = tilde_additional_prefixes; + + string_len = strlen (string); + *len = 0; + + if (*string == '\0' || *string == '~') + return (0); + + if (prefixes) + { + for (i = 0; i < string_len; i++) + { + for (j = 0; prefixes[j]; j++) + { + if (strncmp (string + i, prefixes[j], strlen (prefixes[j])) == 0) + { + *len = strlen (prefixes[j]) - 1; + return (i + *len); + } + } + } + } + return (string_len); +} + +/* Find the end of a tilde expansion in STRING, and return the index of + the character which ends the tilde definition. */ +static int +tilde_find_suffix (string) + const char *string; +{ + register int i, j, string_len; + register char **suffixes; + + suffixes = tilde_additional_suffixes; + string_len = strlen (string); + + for (i = 0; i < string_len; i++) + { +#if defined (__MSDOS__) + if (string[i] == '/' || string[i] == '\\' /* || !string[i] */) +#else + if (string[i] == '/' /* || !string[i] */) +#endif + break; + + for (j = 0; suffixes && suffixes[j]; j++) + { + if (strncmp (string + i, suffixes[j], strlen (suffixes[j])) == 0) + return (i); + } + } + return (i); +} + +/* Return a new string which is the result of tilde expanding STRING. */ +char * +tilde_expand (string) + const char *string; +{ + char *result; + int result_size, result_index; + + result_index = result_size = 0; + if (result = strchr (string, '~')) + result = (char *)xmalloc (result_size = (strlen (string) + 16)); + else + result = (char *)xmalloc (result_size = (strlen (string) + 1)); + + /* Scan through STRING expanding tildes as we come to them. */ + while (1) + { + register int start, end; + char *tilde_word, *expansion; + int len; + + /* Make START point to the tilde which starts the expansion. */ + start = tilde_find_prefix (string, &len); + + /* Copy the skipped text into the result. */ + if ((result_index + start + 1) > result_size) + result = (char *)xrealloc (result, 1 + (result_size += (start + 20))); + + strncpy (result + result_index, string, start); + result_index += start; + + /* Advance STRING to the starting tilde. */ + string += start; + + /* Make END be the index of one after the last character of the + username. */ + end = tilde_find_suffix (string); + + /* If both START and END are zero, we are all done. */ + if (!start && !end) + break; + + /* Expand the entire tilde word, and copy it into RESULT. */ + tilde_word = (char *)xmalloc (1 + end); + strncpy (tilde_word, string, end); + tilde_word[end] = '\0'; + string += end; + + expansion = tilde_expand_word (tilde_word); + xfree (tilde_word); + + len = strlen (expansion); +#ifdef __CYGWIN__ + /* Fix for Cygwin to prevent ~user/xxx from expanding to //xxx when + $HOME for `user' is /. On cygwin, // denotes a network drive. */ + if (len > 1 || *expansion != '/' || *string != '/') +#endif + { + if ((result_index + len + 1) > result_size) + result = (char *)xrealloc (result, 1 + (result_size += (len + 20))); + + strcpy (result + result_index, expansion); + result_index += len; + } + xfree (expansion); + } + + result[result_index] = '\0'; + + return (result); +} + +/* Take FNAME and return the tilde prefix we want expanded. If LENP is + non-null, the index of the end of the prefix into FNAME is returned in + the location it points to. */ +static char * +isolate_tilde_prefix (fname, lenp) + const char *fname; + int *lenp; +{ + char *ret; + int i; + + ret = (char *)xmalloc (strlen (fname)); +#if defined (__MSDOS__) + for (i = 1; fname[i] && fname[i] != '/' && fname[i] != '\\'; i++) +#else + for (i = 1; fname[i] && fname[i] != '/'; i++) +#endif + ret[i - 1] = fname[i]; + ret[i - 1] = '\0'; + if (lenp) + *lenp = i; + return ret; +} + +#if 0 +/* Public function to scan a string (FNAME) beginning with a tilde and find + the portion of the string that should be passed to the tilde expansion + function. Right now, it just calls tilde_find_suffix and allocates new + memory, but it can be expanded to do different things later. */ +char * +tilde_find_word (fname, flags, lenp) + const char *fname; + int flags, *lenp; +{ + int x; + char *r; + + x = tilde_find_suffix (fname); + if (x == 0) + { + r = savestring (fname); + if (lenp) + *lenp = 0; + } + else + { + r = (char *)xmalloc (1 + x); + strncpy (r, fname, x); + r[x] = '\0'; + if (lenp) + *lenp = x; + } + + return r; +} +#endif + +/* Return a string that is PREFIX concatenated with SUFFIX starting at + SUFFIND. */ +static char * +glue_prefix_and_suffix (prefix, suffix, suffind) + char *prefix; + const char *suffix; + int suffind; +{ + char *ret; + int plen, slen; + + plen = (prefix && *prefix) ? strlen (prefix) : 0; + slen = strlen (suffix + suffind); + ret = (char *)xmalloc (plen + slen + 1); + if (plen) + strcpy (ret, prefix); + strcpy (ret + plen, suffix + suffind); + return ret; +} + +/* Do the work of tilde expansion on FILENAME. FILENAME starts with a + tilde. If there is no expansion, call tilde_expansion_failure_hook. + This always returns a newly-allocated string, never static storage. */ +char * +tilde_expand_word (filename) + const char *filename; +{ + char *dirname, *expansion, *username; + int user_len; + struct passwd *user_entry; + + if (filename == 0) + return ((char *)NULL); + + if (*filename != '~') + return (savestring (filename)); + + /* A leading `~/' or a bare `~' is *always* translated to the value of + $HOME or the home directory of the current user, regardless of any + preexpansion hook. */ + if (filename[1] == '\0' || filename[1] == '/') + { + /* Prefix $HOME to the rest of the string. */ + expansion = sh_get_env_value ("HOME"); + + /* If there is no HOME variable, look up the directory in + the password database. */ + if (expansion == 0) + expansion = sh_get_home_dir (); + + return (glue_prefix_and_suffix (expansion, filename, 1)); + } + + username = isolate_tilde_prefix (filename, &user_len); + + if (tilde_expansion_preexpansion_hook) + { + expansion = (*tilde_expansion_preexpansion_hook) (username); + if (expansion) + { + dirname = glue_prefix_and_suffix (expansion, filename, user_len); + xfree (username); + xfree (expansion); + return (dirname); + } + } + + /* No preexpansion hook, or the preexpansion hook failed. Look in the + password database. */ + dirname = (char *)NULL; +#if defined (HAVE_GETPWNAM) + user_entry = getpwnam (username); +#else + user_entry = 0; +#endif + if (user_entry == 0) + { + /* If the calling program has a special syntax for expanding tildes, + and we couldn't find a standard expansion, then let them try. */ + if (tilde_expansion_failure_hook) + { + expansion = (*tilde_expansion_failure_hook) (username); + if (expansion) + { + dirname = glue_prefix_and_suffix (expansion, filename, user_len); + xfree (expansion); + } + } + /* If we don't have a failure hook, or if the failure hook did not + expand the tilde, return a copy of what we were passed. */ + if (dirname == 0) + dirname = savestring (filename); + } +#if defined (HAVE_GETPWENT) + else + dirname = glue_prefix_and_suffix (user_entry->pw_dir, filename, user_len); +#endif + + xfree (username); +#if defined (HAVE_GETPWENT) + endpwent (); +#endif + return (dirname); +} + + +#if defined (TEST) +#undef NULL +#include + +main (argc, argv) + int argc; + char **argv; +{ + char *result, line[512]; + int done = 0; + + while (!done) + { + printf ("~expand: "); + fflush (stdout); + + if (!gets (line)) + strcpy (line, "done"); + + if ((strcmp (line, "done") == 0) || + (strcmp (line, "quit") == 0) || + (strcmp (line, "exit") == 0)) + { + done = 1; + break; + } + + result = tilde_expand (line); + printf (" --> %s\n", result); + free (result); + } + exit (0); +} + +static void memory_error_and_abort (); + +static void * +xmalloc (bytes) + size_t bytes; +{ + void *temp = (char *)malloc (bytes); + + if (!temp) + memory_error_and_abort (); + return (temp); +} + +static void * +xrealloc (pointer, bytes) + void *pointer; + int bytes; +{ + void *temp; + + if (!pointer) + temp = malloc (bytes); + else + temp = realloc (pointer, bytes); + + if (!temp) + memory_error_and_abort (); + + return (temp); +} + +static void +memory_error_and_abort () +{ + fprintf (stderr, "readline: out of virtual memory\n"); + abort (); +} + +/* + * Local variables: + * compile-command: "gcc -g -DTEST -o tilde tilde.c" + * end: + */ +#endif /* TEST */ diff --git a/lib/tilde/tilde.h b/lib/tilde/tilde.h new file mode 100644 index 0000000..e26dd04 --- /dev/null +++ b/lib/tilde/tilde.h @@ -0,0 +1,80 @@ +/* tilde.h: Externally available variables and function in libtilde.a. */ + +/* Copyright (C) 1992-2009 Free Software Foundation, Inc. + + This file contains the Readline Library (Readline), a set of + routines for providing Emacs style line input to programs that ask + for it. + + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Readline is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Readline. If not, see . +*/ + +#if !defined (_TILDE_H_) +# define _TILDE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* A function can be defined using prototypes and compile on both ANSI C + and traditional C compilers with something like this: + extern char *func PARAMS((char *, char *, int)); */ + +#if !defined (PARAMS) +# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus) +# define PARAMS(protos) protos +# else +# define PARAMS(protos) () +# endif +#endif + +typedef char *tilde_hook_func_t PARAMS((char *)); + +/* If non-null, this contains the address of a function that the application + wants called before trying the standard tilde expansions. The function + is called with the text sans tilde, and returns a malloc()'ed string + which is the expansion, or a NULL pointer if the expansion fails. */ +extern tilde_hook_func_t *tilde_expansion_preexpansion_hook; + +/* If non-null, this contains the address of a function to call if the + standard meaning for expanding a tilde fails. The function is called + with the text (sans tilde, as in "foo"), and returns a malloc()'ed string + which is the expansion, or a NULL pointer if there is no expansion. */ +extern tilde_hook_func_t *tilde_expansion_failure_hook; + +/* When non-null, this is a NULL terminated array of strings which + are duplicates for a tilde prefix. Bash uses this to expand + `=~' and `:~'. */ +extern char **tilde_additional_prefixes; + +/* When non-null, this is a NULL terminated array of strings which match + the end of a username, instead of just "/". Bash sets this to + `:' and `=~'. */ +extern char **tilde_additional_suffixes; + +/* Return a new string which is the result of tilde expanding STRING. */ +extern char *tilde_expand PARAMS((const char *)); + +/* Do the work of tilde expansion on FILENAME. FILENAME starts with a + tilde. If there is no expansion, call tilde_expansion_failure_hook. */ +extern char *tilde_expand_word PARAMS((const char *)); + +/* Find the portion of the string beginning with ~ that should be expanded. */ +extern char *tilde_find_word PARAMS((const char *, int, int *)); + +#ifdef __cplusplus +} +#endif + +#endif /* _TILDE_H_ */ diff --git a/list.c b/list.c new file mode 100644 index 0000000..88835f5 --- /dev/null +++ b/list.c @@ -0,0 +1,136 @@ +/* list.c - Functions for manipulating linked lists of objects. */ + +/* Copyright (C) 1996-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "shell.h" + +/* A global variable which acts as a sentinel for an `error' list return. */ +GENERIC_LIST global_error_list; + +#ifdef INCLUDE_UNUSED +/* Call FUNCTION on every member of LIST, a generic list. */ +void +list_walk (list, function) + GENERIC_LIST *list; + sh_glist_func_t *function; +{ + for ( ; list; list = list->next) + if ((*function) (list) < 0) + return; +} + +/* Call FUNCTION on every string in WORDS. */ +void +wlist_walk (words, function) + WORD_LIST *words; + sh_icpfunc_t *function; +{ + for ( ; words; words = words->next) + if ((*function) (words->word->word) < 0) + return; +} +#endif /* INCLUDE_UNUSED */ + +/* Reverse the chain of structures in LIST. Output the new head + of the chain. You should always assign the output value of this + function to something, or you will lose the chain. */ +GENERIC_LIST * +list_reverse (list) + GENERIC_LIST *list; +{ + register GENERIC_LIST *next, *prev; + + for (prev = (GENERIC_LIST *)NULL; list; ) + { + next = list->next; + list->next = prev; + prev = list; + list = next; + } + return (prev); +} + +/* Return the number of elements in LIST, a generic list. */ +int +list_length (list) + GENERIC_LIST *list; +{ + register int i; + + for (i = 0; list; list = list->next, i++); + return (i); +} + +/* Append TAIL to HEAD. Return the header of the list. */ +GENERIC_LIST * +list_append (head, tail) + GENERIC_LIST *head, *tail; +{ + register GENERIC_LIST *t_head; + + if (head == 0) + return (tail); + + for (t_head = head; t_head->next; t_head = t_head->next) + ; + t_head->next = tail; + return (head); +} + +#ifdef INCLUDE_UNUSED +/* Delete the element of LIST which satisfies the predicate function COMPARER. + Returns the element that was deleted, so you can dispose of it, or -1 if + the element wasn't found. COMPARER is called with the list element and + then ARG. Note that LIST contains the address of a variable which points + to the list. You might call this function like this: + + SHELL_VAR *elt = list_remove (&variable_list, check_var_has_name, "foo"); + dispose_variable (elt); +*/ +GENERIC_LIST * +list_remove (list, comparer, arg) + GENERIC_LIST **list; + Function *comparer; + char *arg; +{ + register GENERIC_LIST *prev, *temp; + + for (prev = (GENERIC_LIST *)NULL, temp = *list; temp; prev = temp, temp = temp->next) + { + if ((*comparer) (temp, arg)) + { + if (prev) + prev->next = temp->next; + else + *list = temp->next; + return (temp); + } + } + return ((GENERIC_LIST *)&global_error_list); +} +#endif diff --git a/locale.c b/locale.c new file mode 100644 index 0000000..8dabc7d --- /dev/null +++ b/locale.c @@ -0,0 +1,563 @@ +/* locale.c - Miscellaneous internationalization functions. */ + +/* Copyright (C) 1996-2009,2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if HAVE_LANGINFO_CODESET +# include +#endif + +#include "bashintl.h" +#include "bashansi.h" +#include +#include "chartypes.h" +#include + +#include "shell.h" +#include "input.h" /* For bash_input */ + +#ifndef errno +extern int errno; +#endif + +int locale_utf8locale; /* unused for now */ +int locale_mb_cur_max; /* value of MB_CUR_MAX for current locale (LC_CTYPE) */ + +extern int dump_translatable_strings, dump_po_strings; + +/* The current locale when the program begins */ +static char *default_locale; + +/* The current domain for textdomain(3). */ +static char *default_domain; +static char *default_dir; + +/* tracks the value of LC_ALL; used to override values for other locale + categories */ +static char *lc_all; + +/* tracks the value of LC_ALL; used to provide defaults for locale + categories */ +static char *lang; + +/* Called to reset all of the locale variables to their appropriate values + if (and only if) LC_ALL has not been assigned a value. */ +static int reset_locale_vars __P((void)); + +static void locale_setblanks __P((void)); +static int locale_isutf8 __P((char *)); + +/* Set the value of default_locale and make the current locale the + system default locale. This should be called very early in main(). */ +void +set_default_locale () +{ +#if defined (HAVE_SETLOCALE) + default_locale = setlocale (LC_ALL, ""); + if (default_locale) + default_locale = savestring (default_locale); +#endif /* HAVE_SETLOCALE */ + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + locale_mb_cur_max = MB_CUR_MAX; +} + +/* Set default values for LC_CTYPE, LC_COLLATE, LC_MESSAGES, LC_NUMERIC and + LC_TIME if they are not specified in the environment, but LC_ALL is. This + should be called from main() after parsing the environment. */ +void +set_default_locale_vars () +{ + char *val; + +#if defined (HAVE_SETLOCALE) + +# if defined (LC_CTYPE) + val = get_string_value ("LC_CTYPE"); + if (val == 0 && lc_all && *lc_all) + { + setlocale (LC_CTYPE, lc_all); + locale_setblanks (); + locale_mb_cur_max = MB_CUR_MAX; + u32reset (); + } +# endif + +# if defined (LC_COLLATE) + val = get_string_value ("LC_COLLATE"); + if (val == 0 && lc_all && *lc_all) + setlocale (LC_COLLATE, lc_all); +# endif /* LC_COLLATE */ + +# if defined (LC_MESSAGES) + val = get_string_value ("LC_MESSAGES"); + if (val == 0 && lc_all && *lc_all) + setlocale (LC_MESSAGES, lc_all); +# endif /* LC_MESSAGES */ + +# if defined (LC_NUMERIC) + val = get_string_value ("LC_NUMERIC"); + if (val == 0 && lc_all && *lc_all) + setlocale (LC_NUMERIC, lc_all); +# endif /* LC_NUMERIC */ + +# if defined (LC_TIME) + val = get_string_value ("LC_TIME"); + if (val == 0 && lc_all && *lc_all) + setlocale (LC_TIME, lc_all); +# endif /* LC_TIME */ + +#endif /* HAVE_SETLOCALE */ + + val = get_string_value ("TEXTDOMAIN"); + if (val && *val) + { + FREE (default_domain); + default_domain = savestring (val); + if (default_dir && *default_dir) + bindtextdomain (default_domain, default_dir); + } + + val = get_string_value ("TEXTDOMAINDIR"); + if (val && *val) + { + FREE (default_dir); + default_dir = savestring (val); + if (default_domain && *default_domain) + bindtextdomain (default_domain, default_dir); + } +} + +/* Set one of the locale categories (specified by VAR) to VALUE. Returns 1 + if successful, 0 otherwise. */ +int +set_locale_var (var, value) + char *var, *value; +{ + int r; + char *x; + + x = ""; + errno = 0; + if (var[0] == 'T' && var[10] == 0) /* TEXTDOMAIN */ + { + FREE (default_domain); + default_domain = value ? savestring (value) : (char *)NULL; + if (default_dir && *default_dir) + bindtextdomain (default_domain, default_dir); + return (1); + } + else if (var[0] == 'T') /* TEXTDOMAINDIR */ + { + FREE (default_dir); + default_dir = value ? savestring (value) : (char *)NULL; + if (default_domain && *default_domain) + bindtextdomain (default_domain, default_dir); + return (1); + } + + /* var[0] == 'L' && var[1] == 'C' && var[2] == '_' */ + + else if (var[3] == 'A') /* LC_ALL */ + { + FREE (lc_all); + if (value) + lc_all = savestring (value); + else + { + lc_all = (char *)xmalloc (1); + lc_all[0] = '\0'; + } +#if defined (HAVE_SETLOCALE) + r = *lc_all ? ((x = setlocale (LC_ALL, lc_all)) != 0) : reset_locale_vars (); + if (x == 0) + { + if (errno == 0) + internal_warning(_("setlocale: LC_ALL: cannot change locale (%s)"), lc_all); + else + internal_warning(_("setlocale: LC_ALL: cannot change locale (%s): %s"), lc_all, strerror (errno)); + } + locale_setblanks (); + locale_mb_cur_max = MB_CUR_MAX; + u32reset (); + return r; +#else + return (1); +#endif + } + +#if defined (HAVE_SETLOCALE) + else if (var[3] == 'C' && var[4] == 'T') /* LC_CTYPE */ + { +# if defined (LC_CTYPE) + if (lc_all == 0 || *lc_all == '\0') + { + x = setlocale (LC_CTYPE, get_locale_var ("LC_CTYPE")); + locale_setblanks (); + locale_mb_cur_max = MB_CUR_MAX; + u32reset (); + } +# endif + } + else if (var[3] == 'C' && var[4] == 'O') /* LC_COLLATE */ + { +# if defined (LC_COLLATE) + if (lc_all == 0 || *lc_all == '\0') + x = setlocale (LC_COLLATE, get_locale_var ("LC_COLLATE")); +# endif /* LC_COLLATE */ + } + else if (var[3] == 'M' && var[4] == 'E') /* LC_MESSAGES */ + { +# if defined (LC_MESSAGES) + if (lc_all == 0 || *lc_all == '\0') + x = setlocale (LC_MESSAGES, get_locale_var ("LC_MESSAGES")); +# endif /* LC_MESSAGES */ + } + else if (var[3] == 'N' && var[4] == 'U') /* LC_NUMERIC */ + { +# if defined (LC_NUMERIC) + if (lc_all == 0 || *lc_all == '\0') + x = setlocale (LC_NUMERIC, get_locale_var ("LC_NUMERIC")); +# endif /* LC_NUMERIC */ + } + else if (var[3] == 'T' && var[4] == 'I') /* LC_TIME */ + { +# if defined (LC_TIME) + if (lc_all == 0 || *lc_all == '\0') + x = setlocale (LC_TIME, get_locale_var ("LC_TIME")); +# endif /* LC_TIME */ + } +#endif /* HAVE_SETLOCALE */ + + if (x == 0) + { + if (errno == 0) + internal_warning(_("setlocale: %s: cannot change locale (%s)"), var, get_locale_var (var)); + else + internal_warning(_("setlocale: %s: cannot change locale (%s): %s"), var, get_locale_var (var), strerror (errno)); + } + + return (x != 0); +} + +/* Called when LANG is assigned a value. Tracks value in `lang'. Calls + reset_locale_vars() to reset any default values if LC_ALL is unset or + null. */ +int +set_lang (var, value) + char *var, *value; +{ + FREE (lang); + if (value) + lang = savestring (value); + else + { + lang = (char *)xmalloc (1); + lang[0] = '\0'; + } + + return ((lc_all == 0 || *lc_all == 0) ? reset_locale_vars () : 0); +} + +/* Set default values for LANG and LC_ALL. Default values for all other + locale-related variables depend on these. */ +void +set_default_lang () +{ + char *v; + + v = get_string_value ("LC_ALL"); + set_locale_var ("LC_ALL", v); + + v = get_string_value ("LANG"); + set_lang ("LANG", v); +} + +/* Get the value of one of the locale variables (LC_MESSAGES, LC_CTYPE). + The precedence is as POSIX.2 specifies: LC_ALL has precedence over + the specific locale variables, and LANG, if set, is used as the default. */ +char * +get_locale_var (var) + char *var; +{ + char *locale; + + locale = lc_all; + + if (locale == 0 || *locale == 0) + locale = get_string_value (var); /* XXX - mem leak? */ + if (locale == 0 || *locale == 0) + locale = lang; + if (locale == 0 || *locale == 0) +#if 0 + locale = default_locale; /* system-dependent; not really portable. should it be "C"? */ +#else + locale = ""; +#endif + return (locale); +} + +/* Called to reset all of the locale variables to their appropriate values + if (and only if) LC_ALL has not been assigned a value. DO NOT CALL THIS + IF LC_ALL HAS BEEN ASSIGNED A VALUE. */ +static int +reset_locale_vars () +{ + char *t; +#if defined (HAVE_SETLOCALE) + if (lang == 0 || *lang == '\0') + maybe_make_export_env (); /* trust that this will change environment for setlocale */ + if (setlocale (LC_ALL, lang ? lang : "") == 0) + return 0; + +# if defined (LC_CTYPE) + t = setlocale (LC_CTYPE, get_locale_var ("LC_CTYPE")); +# endif +# if defined (LC_COLLATE) + t = setlocale (LC_COLLATE, get_locale_var ("LC_COLLATE")); +# endif +# if defined (LC_MESSAGES) + t = setlocale (LC_MESSAGES, get_locale_var ("LC_MESSAGES")); +# endif +# if defined (LC_NUMERIC) + t = setlocale (LC_NUMERIC, get_locale_var ("LC_NUMERIC")); +# endif +# if defined (LC_TIME) + t = setlocale (LC_TIME, get_locale_var ("LC_TIME")); +# endif + + locale_setblanks (); + locale_mb_cur_max = MB_CUR_MAX; + u32reset (); + +#endif + return 1; +} + +/* Translate the contents of STRING, a $"..." quoted string, according + to the current locale. In the `C' or `POSIX' locale, or if gettext() + is not available, the passed string is returned unchanged. The + length of the translated string is returned in LENP, if non-null. */ +char * +localetrans (string, len, lenp) + char *string; + int len, *lenp; +{ + char *locale, *t; + char *translated; + int tlen; + + /* Don't try to translate null strings. */ + if (string == 0 || *string == 0) + { + if (lenp) + *lenp = 0; + return ((char *)NULL); + } + + locale = get_locale_var ("LC_MESSAGES"); + + /* If we don't have setlocale() or the current locale is `C' or `POSIX', + just return the string. If we don't have gettext(), there's no use + doing anything else. */ + if (locale == 0 || locale[0] == '\0' || + (locale[0] == 'C' && locale[1] == '\0') || STREQ (locale, "POSIX")) + { + t = (char *)xmalloc (len + 1); + strcpy (t, string); + if (lenp) + *lenp = len; + return (t); + } + + /* Now try to translate it. */ + if (default_domain && *default_domain) + translated = dgettext (default_domain, string); + else + translated = string; + + if (translated == string) /* gettext returns its argument if untranslatable */ + { + t = (char *)xmalloc (len + 1); + strcpy (t, string); + if (lenp) + *lenp = len; + } + else + { + tlen = strlen (translated); + t = (char *)xmalloc (tlen + 1); + strcpy (t, translated); + if (lenp) + *lenp = tlen; + } + return (t); +} + +/* Change a bash string into a string suitable for inclusion in a `po' file. + This backslash-escapes `"' and `\' and changes newlines into \\\n"\n". */ +char * +mk_msgstr (string, foundnlp) + char *string; + int *foundnlp; +{ + register int c, len; + char *result, *r, *s; + + for (len = 0, s = string; s && *s; s++) + { + len++; + if (*s == '"' || *s == '\\') + len++; + else if (*s == '\n') + len += 5; + } + + r = result = (char *)xmalloc (len + 3); + *r++ = '"'; + + for (s = string; s && (c = *s); s++) + { + if (c == '\n') /* -> \n"" */ + { + *r++ = '\\'; + *r++ = 'n'; + *r++ = '"'; + *r++ = '\n'; + *r++ = '"'; + if (foundnlp) + *foundnlp = 1; + continue; + } + if (c == '"' || c == '\\') + *r++ = '\\'; + *r++ = c; + } + + *r++ = '"'; + *r++ = '\0'; + + return result; +} + +/* $"..." -- Translate the portion of STRING between START and END + according to current locale using gettext (if available) and return + the result. The caller will take care of leaving the quotes intact. + The string will be left without the leading `$' by the caller. + If translation is performed, the translated string will be double-quoted + by the caller. The length of the translated string is returned in LENP, + if non-null. */ +char * +localeexpand (string, start, end, lineno, lenp) + char *string; + int start, end, lineno, *lenp; +{ + int len, tlen, foundnl; + char *temp, *t, *t2; + + temp = (char *)xmalloc (end - start + 1); + for (tlen = 0, len = start; len < end; ) + temp[tlen++] = string[len++]; + temp[tlen] = '\0'; + + /* If we're just dumping translatable strings, don't do anything with the + string itself, but if we're dumping in `po' file format, convert it into + a form more palatable to gettext(3) and friends by quoting `"' and `\' + with backslashes and converting into `\n""'. If we find a + newline in TEMP, we first output a `msgid ""' line and then the + translated string; otherwise we output the `msgid' and translated + string all on one line. */ + if (dump_translatable_strings) + { + if (dump_po_strings) + { + foundnl = 0; + t = mk_msgstr (temp, &foundnl); + t2 = foundnl ? "\"\"\n" : ""; + + printf ("#: %s:%d\nmsgid %s%s\nmsgstr \"\"\n", + yy_input_name (), lineno, t2, t); + free (t); + } + else + printf ("\"%s\"\n", temp); + + if (lenp) + *lenp = tlen; + return (temp); + } + else if (*temp) + { + t = localetrans (temp, tlen, &len); + free (temp); + if (lenp) + *lenp = len; + return (t); + } + else + { + if (lenp) + *lenp = 0; + return (temp); + } +} + +/* Set every character in the character class to be a shell break + character for the lexical analyzer when the locale changes. */ +static void +locale_setblanks () +{ + int x; + + for (x = 0; x < sh_syntabsiz; x++) + { + if (isblank (x)) + sh_syntaxtab[x] |= CSHBRK|CBLANK; + else if (member (x, shell_break_chars)) + { + sh_syntaxtab[x] |= CSHBRK; + sh_syntaxtab[x] &= ~CBLANK; + } + else + sh_syntaxtab[x] &= ~(CSHBRK|CBLANK); + } +} + +static int +locale_isutf8 (lspec) + char *lspec; +{ + char *cp; + +#if HAVE_LANGINFO_CODESET + cp = nl_langinfo (CODESET); + return (STREQ (cp, "UTF-8") || STREQ (cp, "utf8")); +#else + /* Take a shot */ + return (strstr (lspec, "UTF-8") || strstr (lspec, "utf8")); +#endif +} diff --git a/m4/stat-time.m4 b/m4/stat-time.m4 new file mode 100644 index 0000000..f5d67a1 --- /dev/null +++ b/m4/stat-time.m4 @@ -0,0 +1,61 @@ +# Checks for stat-related time functions. + +# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2012 Free Software +# Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. +dnl Modified by Chet Ramey for bash. + +# st_atim.tv_nsec - Linux, Solaris, Cygwin +# st_atimespec.tv_nsec - FreeBSD, NetBSD, if ! defined _POSIX_SOURCE +# st_atimensec - FreeBSD, NetBSD, if defined _POSIX_SOURCE +# st_atim.st__tim.tv_nsec - UnixWare (at least 2.1.2 through 7.1) + +# st_birthtimespec - FreeBSD, NetBSD (hidden on OpenBSD 3.9, anyway) +# st_birthtim - Cygwin 1.7.0+ + +AC_DEFUN([BASH_STAT_TIME], +[ + AC_REQUIRE([AC_C_INLINE]) + AC_CHECK_HEADERS_ONCE([sys/time.h]) + + AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec], + [AC_CACHE_CHECK([whether struct stat.st_atim is of type struct timespec], + [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[ + #include + #include + #if HAVE_SYS_TIME_H + # include + #endif + #include + struct timespec ts; + struct stat st; + ]], + [[ + st.st_atim = ts; + ]])], + [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes], + [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no])]) + if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then + AC_DEFINE([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC], [1], + [Define to 1 if the type of the st_atim member of a struct stat is + struct timespec.]) + fi], + [AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec], [], + [AC_CHECK_MEMBERS([struct stat.st_atimensec], [], + [AC_CHECK_MEMBERS([struct stat.st_atim.st__tim.tv_nsec], [], [], + [#include + #include ])], + [#include + #include ])], + [#include + #include ])], + [#include + #include ]) +]) diff --git a/m4/timespec.m4 b/m4/timespec.m4 new file mode 100644 index 0000000..3643b47 --- /dev/null +++ b/m4/timespec.m4 @@ -0,0 +1,71 @@ +# Configure checks for struct timespec + +# Copyright (C) 2000-2001, 2003-2007, 2009-2011, 2012 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Original written by Paul Eggert and Jim Meyering. +# Modified by Chet Ramey for bash + +dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared +dnl in time.h, sys/time.h, or pthread.h. + +AC_DEFUN([BASH_CHECK_TYPE_STRUCT_TIMESPEC], +[ + AC_CHECK_HEADERS_ONCE([sys/time.h]) + AC_CACHE_CHECK([for struct timespec in ], + [bash_cv_sys_struct_timespec_in_time_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], + [bash_cv_sys_struct_timespec_in_time_h=yes], + [bash_cv_sys_struct_timespec_in_time_h=no])]) + + HAVE_STRUCT_TIMESPEC=0 + TIME_H_DEFINES_STRUCT_TIMESPEC=0 + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 + PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0 + if test $bash_cv_sys_struct_timespec_in_time_h = yes; then + AC_DEFINE([HAVE_STRUCT_TIMESPEC]) + AC_DEFINE([TIME_H_DEFINES_STRUCT_TIMESPEC]) + TIME_H_DEFINES_STRUCT_TIMESPEC=1 + else + AC_CACHE_CHECK([for struct timespec in ], + [bash_cv_sys_struct_timespec_in_sys_time_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], + [bash_cv_sys_struct_timespec_in_sys_time_h=yes], + [bash_cv_sys_struct_timespec_in_sys_time_h=no])]) + if test $bash_cv_sys_struct_timespec_in_sys_time_h = yes; then + SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 + AC_DEFINE([HAVE_STRUCT_TIMESPEC]) + AC_DEFINE([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC]) + else + AC_CACHE_CHECK([for struct timespec in ], + [bash_cv_sys_struct_timespec_in_pthread_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], + [bash_cv_sys_struct_timespec_in_pthread_h=yes], + [bash_cv_sys_struct_timespec_in_pthread_h=no])]) + if test $bash_cv_sys_struct_timespec_in_pthread_h = yes; then + PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1 + AC_DEFINE([HAVE_STRUCT_TIMESPEC]) + AC_DEFINE([PTHREAD_H_DEFINES_STRUCT_TIMESPEC]) + fi + fi + fi + AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC]) + AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC]) + AC_SUBST([PTHREAD_H_DEFINES_STRUCT_TIMESPEC]) + +]) diff --git a/mailcheck.c b/mailcheck.c new file mode 100644 index 0000000..c04d0fe --- /dev/null +++ b/mailcheck.c @@ -0,0 +1,491 @@ +/* mailcheck.c -- The check is in the mail... */ + +/* Copyright (C) 1987-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include +#include "bashtypes.h" +#include "posixstat.h" +#if defined (HAVE_SYS_PARAM_H) +# include +#endif +#if defined (HAVE_UNISTD_H) +# include +#endif +#include "posixtime.h" +#include "bashansi.h" +#include "bashintl.h" + +#include "shell.h" +#include "execute_cmd.h" +#include "mailcheck.h" +#include + +/* Values for flags word in struct _fileinfo */ +#define MBOX_INITIALIZED 0x01 + +extern time_t shell_start_time; + +extern int mailstat __P((const char *, struct stat *)); + +typedef struct _fileinfo { + char *name; + char *msg; + time_t access_time; + time_t mod_time; + off_t file_size; + int flags; +} FILEINFO; + +/* The list of remembered mail files. */ +static FILEINFO **mailfiles = (FILEINFO **)NULL; + +/* Number of mail files that we have. */ +static int mailfiles_count; + +/* The last known time that mail was checked. */ +static time_t last_time_mail_checked = 0; + +/* Non-zero means warn if a mail file has been read since last checked. */ +int mail_warning; + +static int find_mail_file __P((char *)); +static void init_mail_file __P((int)); +static void update_mail_file __P((int)); +static int add_mail_file __P((char *, char *)); + +static FILEINFO *alloc_mail_file __P((char *, char *)); +static void dispose_mail_file __P((FILEINFO *)); + +static int file_mod_date_changed __P((int)); +static int file_access_date_changed __P((int)); +static int file_has_grown __P((int)); + +static char *parse_mailpath_spec __P((char *)); + +/* Returns non-zero if it is time to check mail. */ +int +time_to_check_mail () +{ + char *temp; + time_t now; + intmax_t seconds; + + temp = get_string_value ("MAILCHECK"); + + /* Negative number, or non-numbers (such as empty string) cause no + checking to take place. */ + if (temp == 0 || legal_number (temp, &seconds) == 0 || seconds < 0) + return (0); + + now = NOW; + /* Time to check if MAILCHECK is explicitly set to zero, or if enough + time has passed since the last check. */ + return (seconds == 0 || ((now - last_time_mail_checked) >= seconds)); +} + +/* Okay, we have checked the mail. Perhaps I should make this function + go away. */ +void +reset_mail_timer () +{ + last_time_mail_checked = NOW; +} + +/* Locate a file in the list. Return index of + entry, or -1 if not found. */ +static int +find_mail_file (file) + char *file; +{ + register int i; + + for (i = 0; i < mailfiles_count; i++) + if (STREQ (mailfiles[i]->name, file)) + return i; + + return -1; +} + +#define RESET_MAIL_FILE(i) \ + do \ + { \ + mailfiles[i]->access_time = mailfiles[i]->mod_time = 0; \ + mailfiles[i]->file_size = 0; \ + mailfiles[i]->flags = 0; \ + } \ + while (0) + +#define UPDATE_MAIL_FILE(i, finfo) \ + do \ + { \ + mailfiles[i]->access_time = finfo.st_atime; \ + mailfiles[i]->mod_time = finfo.st_mtime; \ + mailfiles[i]->file_size = finfo.st_size; \ + mailfiles[i]->flags |= MBOX_INITIALIZED; \ + } \ + while (0) + +static void +init_mail_file (i) + int i; +{ + mailfiles[i]->access_time = mailfiles[i]->mod_time = last_time_mail_checked ? last_time_mail_checked : shell_start_time; + mailfiles[i]->file_size = 0; + mailfiles[i]->flags = 0; +} + +static void +update_mail_file (i) + int i; +{ + char *file; + struct stat finfo; + + file = mailfiles[i]->name; + if (mailstat (file, &finfo) == 0) + UPDATE_MAIL_FILE (i, finfo); + else + RESET_MAIL_FILE (i); +} + +/* Add this file to the list of remembered files and return its index + in the list of mail files. */ +static int +add_mail_file (file, msg) + char *file, *msg; +{ + struct stat finfo; + char *filename; + int i; + + filename = full_pathname (file); + i = find_mail_file (filename); + if (i >= 0) + { + if (mailstat (filename, &finfo) == 0) + UPDATE_MAIL_FILE (i, finfo); + + free (filename); + return i; + } + + i = mailfiles_count++; + mailfiles = (FILEINFO **)xrealloc + (mailfiles, mailfiles_count * sizeof (FILEINFO *)); + + mailfiles[i] = alloc_mail_file (filename, msg); + init_mail_file (i); + + return i; +} + +/* Reset the existing mail files access and modification times to zero. */ +void +reset_mail_files () +{ + register int i; + + for (i = 0; i < mailfiles_count; i++) + RESET_MAIL_FILE (i); +} + +static FILEINFO * +alloc_mail_file (filename, msg) + char *filename, *msg; +{ + FILEINFO *mf; + + mf = (FILEINFO *)xmalloc (sizeof (FILEINFO)); + mf->name = filename; + mf->msg = msg ? savestring (msg) : (char *)NULL; + mf->flags = 0; + + return mf; +} + +static void +dispose_mail_file (mf) + FILEINFO *mf; +{ + free (mf->name); + FREE (mf->msg); + free (mf); +} + +/* Free the information that we have about the remembered mail files. */ +void +free_mail_files () +{ + register int i; + + for (i = 0; i < mailfiles_count; i++) + dispose_mail_file (mailfiles[i]); + + if (mailfiles) + free (mailfiles); + + mailfiles_count = 0; + mailfiles = (FILEINFO **)NULL; +} + +void +init_mail_dates () +{ + if (mailfiles == 0) + remember_mail_dates (); +} + +/* Return non-zero if FILE's mod date has changed and it has not been + accessed since modified. If the size has dropped to zero, reset + the cached mail file info. */ +static int +file_mod_date_changed (i) + int i; +{ + time_t mtime; + struct stat finfo; + char *file; + + file = mailfiles[i]->name; + mtime = mailfiles[i]->mod_time; + + if (mailstat (file, &finfo) != 0) + return (0); + + if (finfo.st_size > 0) + return (mtime < finfo.st_mtime); + + if (finfo.st_size == 0 && mailfiles[i]->file_size > 0) + UPDATE_MAIL_FILE (i, finfo); + + return (0); +} + +/* Return non-zero if FILE's access date has changed. */ +static int +file_access_date_changed (i) + int i; +{ + time_t atime; + struct stat finfo; + char *file; + + file = mailfiles[i]->name; + atime = mailfiles[i]->access_time; + + if (mailstat (file, &finfo) != 0) + return (0); + + if (finfo.st_size > 0) + return (atime < finfo.st_atime); + + return (0); +} + +/* Return non-zero if FILE's size has increased. */ +static int +file_has_grown (i) + int i; +{ + off_t size; + struct stat finfo; + char *file; + + file = mailfiles[i]->name; + size = mailfiles[i]->file_size; + + return ((mailstat (file, &finfo) == 0) && (finfo.st_size > size)); +} + +/* Take an element from $MAILPATH and return the portion from + the first unquoted `?' or `%' to the end of the string. This is the + message to be printed when the file contents change. */ +static char * +parse_mailpath_spec (str) + char *str; +{ + char *s; + int pass_next; + + for (s = str, pass_next = 0; s && *s; s++) + { + if (pass_next) + { + pass_next = 0; + continue; + } + if (*s == '\\') + { + pass_next++; + continue; + } + if (*s == '?' || *s == '%') + return s; + } + return ((char *)NULL); +} + +char * +make_default_mailpath () +{ +#if defined (DEFAULT_MAIL_DIRECTORY) + char *mp; + + get_current_user_info (); + mp = (char *)xmalloc (2 + sizeof (DEFAULT_MAIL_DIRECTORY) + strlen (current_user.user_name)); + strcpy (mp, DEFAULT_MAIL_DIRECTORY); + mp[sizeof(DEFAULT_MAIL_DIRECTORY) - 1] = '/'; + strcpy (mp + sizeof (DEFAULT_MAIL_DIRECTORY), current_user.user_name); + return (mp); +#else + return ((char *)NULL); +#endif +} + +/* Remember the dates of the files specified by MAILPATH, or if there is + no MAILPATH, by the file specified in MAIL. If neither exists, use a + default value, which we randomly concoct from using Unix. */ + +void +remember_mail_dates () +{ + char *mailpaths; + char *mailfile, *mp; + int i = 0; + + mailpaths = get_string_value ("MAILPATH"); + + /* If no $MAILPATH, but $MAIL, use that as a single filename to check. */ + if (mailpaths == 0 && (mailpaths = get_string_value ("MAIL"))) + { + add_mail_file (mailpaths, (char *)NULL); + return; + } + + if (mailpaths == 0) + { + mailpaths = make_default_mailpath (); + if (mailpaths) + { + add_mail_file (mailpaths, (char *)NULL); + free (mailpaths); + } + return; + } + + while (mailfile = extract_colon_unit (mailpaths, &i)) + { + mp = parse_mailpath_spec (mailfile); + if (mp && *mp) + *mp++ = '\0'; + add_mail_file (mailfile, mp); + free (mailfile); + } +} + +/* check_mail () is useful for more than just checking mail. Since it has + the paranoids dream ability of telling you when someone has read your + mail, it can just as easily be used to tell you when someones .profile + file has been read, thus letting one know when someone else has logged + in. Pretty good, huh? */ + +/* Check for mail in some files. If the modification date of any + of the files in MAILPATH has changed since we last did a + remember_mail_dates () then mention that the user has mail. + Special hack: If the variable MAIL_WARNING is non-zero and the + mail file has been accessed since the last time we remembered, then + the message "The mail in has been read" is printed. */ +void +check_mail () +{ + char *current_mail_file, *message; + int i, use_user_notification; + char *dollar_underscore, *temp; + + dollar_underscore = get_string_value ("_"); + if (dollar_underscore) + dollar_underscore = savestring (dollar_underscore); + + for (i = 0; i < mailfiles_count; i++) + { + current_mail_file = mailfiles[i]->name; + + if (*current_mail_file == '\0') + continue; + + if (file_mod_date_changed (i)) + { + int file_is_bigger; + + use_user_notification = mailfiles[i]->msg != (char *)NULL; + message = mailfiles[i]->msg ? mailfiles[i]->msg : _("You have mail in $_"); + + bind_variable ("_", current_mail_file, 0); + +#define atime mailfiles[i]->access_time +#define mtime mailfiles[i]->mod_time + + /* Have to compute this before the call to update_mail_file, which + resets all the information. */ + file_is_bigger = file_has_grown (i); + + update_mail_file (i); + + /* If the user has just run a program which manipulates the + mail file, then don't bother explaining that the mail + file has been manipulated. Since some systems don't change + the access time to be equal to the modification time when + the mail in the file is manipulated, check the size also. If + the file has not grown, continue. */ + if ((atime >= mtime) && !file_is_bigger) + continue; + + /* If the mod time is later than the access time and the file + has grown, note the fact that this is *new* mail. */ + if (use_user_notification == 0 && (atime < mtime) && file_is_bigger) + message = _("You have new mail in $_"); +#undef atime +#undef mtime + + if (temp = expand_string_to_string (message, Q_DOUBLE_QUOTES)) + { + puts (temp); + free (temp); + } + else + putchar ('\n'); + } + + if (mail_warning && file_access_date_changed (i)) + { + update_mail_file (i); + printf (_("The mail in %s has been read\n"), current_mail_file); + } + } + + if (dollar_underscore) + { + bind_variable ("_", dollar_underscore, 0); + free (dollar_underscore); + } + else + unbind_variable ("_"); +} diff --git a/mailcheck.h b/mailcheck.h new file mode 100644 index 0000000..3ca8440 --- /dev/null +++ b/mailcheck.h @@ -0,0 +1,34 @@ +/* mailcheck.h -- variables and function declarations for mail checking. */ + +/* Copyright (C) 1987,1991,2001,2003,2005,2006,2008,2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_MAILCHECK_H_) +#define _MAILCHECK_H_ + +/* Functions from mailcheck.c */ +extern int time_to_check_mail __P((void)); +extern void reset_mail_timer __P((void)); +extern void reset_mail_files __P((void)); +extern void free_mail_files __P((void)); +extern char *make_default_mailpath __P((void)); +extern void remember_mail_dates __P((void)); +extern void init_mail_dates __P((void)); +extern void check_mail __P((void)); + +#endif /* _MAILCHECK_H */ diff --git a/make_cmd.c b/make_cmd.c new file mode 100644 index 0000000..3bc5408 --- /dev/null +++ b/make_cmd.c @@ -0,0 +1,891 @@ +/* make_cmd.c -- Functions for making instances of the various + parser constructs. */ + +/* Copyright (C) 1989-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include +#include "bashtypes.h" +#if !defined (_MINIX) && defined (HAVE_SYS_FILE_H) +# include +#endif +#include "filecntl.h" +#include "bashansi.h" +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashintl.h" + +#include "parser.h" +#include "syntax.h" +#include "command.h" +#include "general.h" +#include "error.h" +#include "flags.h" +#include "make_cmd.h" +#include "dispose_cmd.h" +#include "variables.h" +#include "subst.h" +#include "input.h" +#include "ocache.h" +#include "externs.h" + +#if defined (JOB_CONTROL) +#include "jobs.h" +#endif + +#include "shmbutil.h" + +extern int line_number, current_command_line_count, parser_state; +extern int last_command_exit_value; + +/* Object caching */ +sh_obj_cache_t wdcache = {0, 0, 0}; +sh_obj_cache_t wlcache = {0, 0, 0}; + +#define WDCACHESIZE 60 +#define WLCACHESIZE 60 + +static COMMAND *make_for_or_select __P((enum command_type, WORD_DESC *, WORD_LIST *, COMMAND *, int)); +#if defined (ARITH_FOR_COMMAND) +static WORD_LIST *make_arith_for_expr __P((char *)); +#endif +static COMMAND *make_until_or_while __P((enum command_type, COMMAND *, COMMAND *)); + +void +cmd_init () +{ + ocache_create (wdcache, WORD_DESC, WDCACHESIZE); + ocache_create (wlcache, WORD_LIST, WLCACHESIZE); +} + +WORD_DESC * +alloc_word_desc () +{ + WORD_DESC *temp; + + ocache_alloc (wdcache, WORD_DESC, temp); + temp->flags = 0; + temp->word = 0; + return temp; +} + +WORD_DESC * +make_bare_word (string) + const char *string; +{ + WORD_DESC *temp; + + temp = alloc_word_desc (); + + if (*string) + temp->word = savestring (string); + else + { + temp->word = (char *)xmalloc (1); + temp->word[0] = '\0'; + } + + return (temp); +} + +WORD_DESC * +make_word_flags (w, string) + WORD_DESC *w; + const char *string; +{ + register int i; + size_t slen; + DECLARE_MBSTATE; + + i = 0; + slen = strlen (string); + while (i < slen) + { + switch (string[i]) + { + case '$': + w->flags |= W_HASDOLLAR; + break; + case '\\': + break; /* continue the loop */ + case '\'': + case '`': + case '"': + w->flags |= W_QUOTED; + break; + } + + ADVANCE_CHAR (string, slen, i); + } + + return (w); +} + +WORD_DESC * +make_word (string) + const char *string; +{ + WORD_DESC *temp; + + temp = make_bare_word (string); + return (make_word_flags (temp, string)); +} + +WORD_DESC * +make_word_from_token (token) + int token; +{ + char tokenizer[2]; + + tokenizer[0] = token; + tokenizer[1] = '\0'; + + return (make_word (tokenizer)); +} + +WORD_LIST * +make_word_list (word, wlink) + WORD_DESC *word; + WORD_LIST *wlink; +{ + WORD_LIST *temp; + + ocache_alloc (wlcache, WORD_LIST, temp); + + temp->word = word; + temp->next = wlink; + return (temp); +} + +COMMAND * +make_command (type, pointer) + enum command_type type; + SIMPLE_COM *pointer; +{ + COMMAND *temp; + + temp = (COMMAND *)xmalloc (sizeof (COMMAND)); + temp->type = type; + temp->value.Simple = pointer; + temp->value.Simple->flags = temp->flags = 0; + temp->redirects = (REDIRECT *)NULL; + return (temp); +} + +COMMAND * +command_connect (com1, com2, connector) + COMMAND *com1, *com2; + int connector; +{ + CONNECTION *temp; + + temp = (CONNECTION *)xmalloc (sizeof (CONNECTION)); + temp->connector = connector; + temp->first = com1; + temp->second = com2; + return (make_command (cm_connection, (SIMPLE_COM *)temp)); +} + +static COMMAND * +make_for_or_select (type, name, map_list, action, lineno) + enum command_type type; + WORD_DESC *name; + WORD_LIST *map_list; + COMMAND *action; + int lineno; +{ + FOR_COM *temp; + + temp = (FOR_COM *)xmalloc (sizeof (FOR_COM)); + temp->flags = 0; + temp->name = name; + temp->line = lineno; + temp->map_list = map_list; + temp->action = action; + return (make_command (type, (SIMPLE_COM *)temp)); +} + +COMMAND * +make_for_command (name, map_list, action, lineno) + WORD_DESC *name; + WORD_LIST *map_list; + COMMAND *action; + int lineno; +{ + return (make_for_or_select (cm_for, name, map_list, action, lineno)); +} + +COMMAND * +make_select_command (name, map_list, action, lineno) + WORD_DESC *name; + WORD_LIST *map_list; + COMMAND *action; + int lineno; +{ +#if defined (SELECT_COMMAND) + return (make_for_or_select (cm_select, name, map_list, action, lineno)); +#else + last_command_exit_value = 2; + return ((COMMAND *)NULL); +#endif +} + +#if defined (ARITH_FOR_COMMAND) +static WORD_LIST * +make_arith_for_expr (s) + char *s; +{ + WORD_LIST *result; + WORD_DESC *wd; + + if (s == 0 || *s == '\0') + return ((WORD_LIST *)NULL); + wd = make_word (s); + wd->flags |= W_NOGLOB|W_NOSPLIT|W_QUOTED|W_DQUOTE; /* no word splitting or globbing */ + result = make_word_list (wd, (WORD_LIST *)NULL); + return result; +} +#endif + +/* Note that this function calls dispose_words on EXPRS, since it doesn't + use the word list directly. We free it here rather than at the caller + because no other function in this file requires that the caller free + any arguments. */ +COMMAND * +make_arith_for_command (exprs, action, lineno) + WORD_LIST *exprs; + COMMAND *action; + int lineno; +{ +#if defined (ARITH_FOR_COMMAND) + ARITH_FOR_COM *temp; + WORD_LIST *init, *test, *step; + char *s, *t, *start; + int nsemi, i; + + init = test = step = (WORD_LIST *)NULL; + /* Parse the string into the three component sub-expressions. */ + start = t = s = exprs->word->word; + for (nsemi = 0; ;) + { + /* skip whitespace at the start of each sub-expression. */ + while (whitespace (*s)) + s++; + start = s; + /* skip to the semicolon or EOS */ + i = skip_to_delim (start, 0, ";", SD_NOJMP); + s = start + i; + + t = (i > 0) ? substring (start, 0, i) : (char *)NULL; + + nsemi++; + switch (nsemi) + { + case 1: + init = make_arith_for_expr (t); + break; + case 2: + test = make_arith_for_expr (t); + break; + case 3: + step = make_arith_for_expr (t); + break; + } + + FREE (t); + if (*s == '\0') + break; + s++; /* skip over semicolon */ + } + + if (nsemi != 3) + { + if (nsemi < 3) + parser_error (lineno, _("syntax error: arithmetic expression required")); + else + parser_error (lineno, _("syntax error: `;' unexpected")); + parser_error (lineno, _("syntax error: `((%s))'"), exprs->word->word); + free (init); + free (test); + free (step); + last_command_exit_value = 2; + return ((COMMAND *)NULL); + } + + temp = (ARITH_FOR_COM *)xmalloc (sizeof (ARITH_FOR_COM)); + temp->flags = 0; + temp->line = lineno; + temp->init = init ? init : make_arith_for_expr ("1"); + temp->test = test ? test : make_arith_for_expr ("1"); + temp->step = step ? step : make_arith_for_expr ("1"); + temp->action = action; + + dispose_words (exprs); + return (make_command (cm_arith_for, (SIMPLE_COM *)temp)); +#else + dispose_words (exprs); + last_command_exit_value = 2; + return ((COMMAND *)NULL); +#endif /* ARITH_FOR_COMMAND */ +} + +COMMAND * +make_group_command (command) + COMMAND *command; +{ + GROUP_COM *temp; + + temp = (GROUP_COM *)xmalloc (sizeof (GROUP_COM)); + temp->command = command; + return (make_command (cm_group, (SIMPLE_COM *)temp)); +} + +COMMAND * +make_case_command (word, clauses, lineno) + WORD_DESC *word; + PATTERN_LIST *clauses; + int lineno; +{ + CASE_COM *temp; + + temp = (CASE_COM *)xmalloc (sizeof (CASE_COM)); + temp->flags = 0; + temp->line = lineno; + temp->word = word; + temp->clauses = REVERSE_LIST (clauses, PATTERN_LIST *); + return (make_command (cm_case, (SIMPLE_COM *)temp)); +} + +PATTERN_LIST * +make_pattern_list (patterns, action) + WORD_LIST *patterns; + COMMAND *action; +{ + PATTERN_LIST *temp; + + temp = (PATTERN_LIST *)xmalloc (sizeof (PATTERN_LIST)); + temp->patterns = REVERSE_LIST (patterns, WORD_LIST *); + temp->action = action; + temp->next = NULL; + temp->flags = 0; + return (temp); +} + +COMMAND * +make_if_command (test, true_case, false_case) + COMMAND *test, *true_case, *false_case; +{ + IF_COM *temp; + + temp = (IF_COM *)xmalloc (sizeof (IF_COM)); + temp->flags = 0; + temp->test = test; + temp->true_case = true_case; + temp->false_case = false_case; + return (make_command (cm_if, (SIMPLE_COM *)temp)); +} + +static COMMAND * +make_until_or_while (which, test, action) + enum command_type which; + COMMAND *test, *action; +{ + WHILE_COM *temp; + + temp = (WHILE_COM *)xmalloc (sizeof (WHILE_COM)); + temp->flags = 0; + temp->test = test; + temp->action = action; + return (make_command (which, (SIMPLE_COM *)temp)); +} + +COMMAND * +make_while_command (test, action) + COMMAND *test, *action; +{ + return (make_until_or_while (cm_while, test, action)); +} + +COMMAND * +make_until_command (test, action) + COMMAND *test, *action; +{ + return (make_until_or_while (cm_until, test, action)); +} + +COMMAND * +make_arith_command (exp) + WORD_LIST *exp; +{ +#if defined (DPAREN_ARITHMETIC) + COMMAND *command; + ARITH_COM *temp; + + command = (COMMAND *)xmalloc (sizeof (COMMAND)); + command->value.Arith = temp = (ARITH_COM *)xmalloc (sizeof (ARITH_COM)); + + temp->flags = 0; + temp->line = line_number; + temp->exp = exp; + + command->type = cm_arith; + command->redirects = (REDIRECT *)NULL; + command->flags = 0; + + return (command); +#else + last_command_exit_value = 2; + return ((COMMAND *)NULL); +#endif +} + +#if defined (COND_COMMAND) +struct cond_com * +make_cond_node (type, op, left, right) + int type; + WORD_DESC *op; + struct cond_com *left, *right; +{ + COND_COM *temp; + + temp = (COND_COM *)xmalloc (sizeof (COND_COM)); + temp->flags = 0; + temp->line = line_number; + temp->type = type; + temp->op = op; + temp->left = left; + temp->right = right; + + return (temp); +} +#endif + +COMMAND * +make_cond_command (cond_node) + COND_COM *cond_node; +{ +#if defined (COND_COMMAND) + COMMAND *command; + + command = (COMMAND *)xmalloc (sizeof (COMMAND)); + command->value.Cond = cond_node; + + command->type = cm_cond; + command->redirects = (REDIRECT *)NULL; + command->flags = 0; + command->line = cond_node ? cond_node->line : 0; + + return (command); +#else + last_command_exit_value = 2; + return ((COMMAND *)NULL); +#endif +} + +COMMAND * +make_bare_simple_command () +{ + COMMAND *command; + SIMPLE_COM *temp; + + command = (COMMAND *)xmalloc (sizeof (COMMAND)); + command->value.Simple = temp = (SIMPLE_COM *)xmalloc (sizeof (SIMPLE_COM)); + + temp->flags = 0; + temp->line = line_number; + temp->words = (WORD_LIST *)NULL; + temp->redirects = (REDIRECT *)NULL; + + command->type = cm_simple; + command->redirects = (REDIRECT *)NULL; + command->flags = 0; + + return (command); +} + +/* Return a command which is the connection of the word or redirection + in ELEMENT, and the command * or NULL in COMMAND. */ +COMMAND * +make_simple_command (element, command) + ELEMENT element; + COMMAND *command; +{ + /* If we are starting from scratch, then make the initial command + structure. Also note that we have to fill in all the slots, since + malloc doesn't return zeroed space. */ + if (command == 0) + { + command = make_bare_simple_command (); + parser_state |= PST_REDIRLIST; + } + + if (element.word) + { + command->value.Simple->words = make_word_list (element.word, command->value.Simple->words); + parser_state &= ~PST_REDIRLIST; + } + else if (element.redirect) + { + REDIRECT *r = element.redirect; + /* Due to the way <> is implemented, there may be more than a single + redirection in element.redirect. We just follow the chain as far + as it goes, and hook onto the end. */ + while (r->next) + r = r->next; + r->next = command->value.Simple->redirects; + command->value.Simple->redirects = element.redirect; + } + + return (command); +} + +/* Because we are Bourne compatible, we read the input for this + << or <<- redirection now, from wherever input is coming from. + We store the input read into a WORD_DESC. Replace the text of + the redirectee.word with the new input text. If <<- is on, + then remove leading TABS from each line. */ +void +make_here_document (temp, lineno) + REDIRECT *temp; + int lineno; +{ + int kill_leading, redir_len; + char *redir_word, *document, *full_line; + int document_index, document_size, delim_unquoted; + + if (temp->instruction != r_deblank_reading_until && + temp->instruction != r_reading_until) + { + internal_error (_("make_here_document: bad instruction type %d"), temp->instruction); + return; + } + + kill_leading = temp->instruction == r_deblank_reading_until; + + document = (char *)NULL; + document_index = document_size = 0; + + /* Quote removal is the only expansion performed on the delimiter + for here documents, making it an extremely special case. */ + redir_word = string_quote_removal (temp->redirectee.filename->word, 0); + + /* redirection_expand will return NULL if the expansion results in + multiple words or no words. Check for that here, and just abort + this here document if it does. */ + if (redir_word) + redir_len = strlen (redir_word); + else + { + temp->here_doc_eof = (char *)xmalloc (1); + temp->here_doc_eof[0] = '\0'; + goto document_done; + } + + free (temp->redirectee.filename->word); + temp->here_doc_eof = redir_word; + + /* Read lines from wherever lines are coming from. + For each line read, if kill_leading, then kill the + leading tab characters. + If the line matches redir_word exactly, then we have + manufactured the document. Otherwise, add the line to the + list of lines in the document. */ + + /* If the here-document delimiter was quoted, the lines should + be read verbatim from the input. If it was not quoted, we + need to perform backslash-quoted newline removal. */ + delim_unquoted = (temp->redirectee.filename->flags & W_QUOTED) == 0; + while (full_line = read_secondary_line (delim_unquoted)) + { + register char *line; + int len; + + line = full_line; + line_number++; + + /* If set -v is in effect, echo the line read. read_secondary_line/ + read_a_line leaves the newline at the end, so don't print another. */ + if (echo_input_at_read) + fprintf (stderr, "%s", line); + + if (kill_leading && *line) + { + /* Hack: To be compatible with some Bourne shells, we + check the word before stripping the whitespace. This + is a hack, though. */ + if (STREQN (line, redir_word, redir_len) && line[redir_len] == '\n') + goto document_done; + + while (*line == '\t') + line++; + } + + if (*line == 0) + continue; + + if (STREQN (line, redir_word, redir_len) && line[redir_len] == '\n') + goto document_done; + + len = strlen (line); + if (len + document_index >= document_size) + { + document_size = document_size ? 2 * (document_size + len) : len + 2; + document = (char *)xrealloc (document, document_size); + } + + /* len is guaranteed to be > 0 because of the check for line + being an empty string before the call to strlen. */ + FASTCOPY (line, document + document_index, len); + document_index += len; + } + + if (full_line == 0) + internal_warning (_("here-document at line %d delimited by end-of-file (wanted `%s')"), lineno, redir_word); + +document_done: + if (document) + document[document_index] = '\0'; + else + { + document = (char *)xmalloc (1); + document[0] = '\0'; + } + temp->redirectee.filename->word = document; +} + +/* Generate a REDIRECT from SOURCE, DEST, and INSTRUCTION. + INSTRUCTION is the instruction type, SOURCE is a file descriptor, + and DEST is a file descriptor or a WORD_DESC *. */ +REDIRECT * +make_redirection (source, instruction, dest_and_filename, flags) + REDIRECTEE source; + enum r_instruction instruction; + REDIRECTEE dest_and_filename; + int flags; +{ + REDIRECT *temp; + WORD_DESC *w; + int wlen; + intmax_t lfd; + + temp = (REDIRECT *)xmalloc (sizeof (REDIRECT)); + + /* First do the common cases. */ + temp->redirector = source; + temp->redirectee = dest_and_filename; + temp->instruction = instruction; + temp->flags = 0; + temp->rflags = flags; + temp->next = (REDIRECT *)NULL; + + switch (instruction) + { + + case r_output_direction: /* >foo */ + case r_output_force: /* >| foo */ + case r_err_and_out: /* &>filename */ + temp->flags = O_TRUNC | O_WRONLY | O_CREAT; + break; + + case r_appending_to: /* >>foo */ + case r_append_err_and_out: /* &>> filename */ + temp->flags = O_APPEND | O_WRONLY | O_CREAT; + break; + + case r_input_direction: /* flags = O_RDONLY; + break; + + case r_input_output: /* <>foo */ + temp->flags = O_RDWR | O_CREAT; + break; + + case r_deblank_reading_until: /* <<-foo */ + case r_reading_until: /* << foo */ + case r_reading_string: /* <<< foo */ + case r_close_this: /* <&- */ + case r_duplicating_input: /* 1<&2 */ + case r_duplicating_output: /* 1>&2 */ + break; + + /* the parser doesn't pass these. */ + case r_move_input: /* 1<&2- */ + case r_move_output: /* 1>&2- */ + case r_move_input_word: /* 1<&$foo- */ + case r_move_output_word: /* 1>&$foo- */ + break; + + /* The way the lexer works we have to do this here. */ + case r_duplicating_input_word: /* 1<&$foo */ + case r_duplicating_output_word: /* 1>&$foo */ + w = dest_and_filename.filename; + wlen = strlen (w->word) - 1; + if (w->word[wlen] == '-') /* Yuck */ + { + w->word[wlen] = '\0'; + if (all_digits (w->word) && legal_number (w->word, &lfd) && lfd == (int)lfd) + { + dispose_word (w); + temp->instruction = (instruction == r_duplicating_input_word) ? r_move_input : r_move_output; + temp->redirectee.dest = lfd; + } + else + temp->instruction = (instruction == r_duplicating_input_word) ? r_move_input_word : r_move_output_word; + } + + break; + + default: + programming_error (_("make_redirection: redirection instruction `%d' out of range"), instruction); + abort (); + break; + } + return (temp); +} + +COMMAND * +make_function_def (name, command, lineno, lstart) + WORD_DESC *name; + COMMAND *command; + int lineno, lstart; +{ + FUNCTION_DEF *temp; +#if defined (ARRAY_VARS) + SHELL_VAR *bash_source_v; + ARRAY *bash_source_a; +#endif + + temp = (FUNCTION_DEF *)xmalloc (sizeof (FUNCTION_DEF)); + temp->command = command; + temp->name = name; + temp->line = lineno; + temp->flags = 0; + command->line = lstart; + + /* Information used primarily for debugging. */ + temp->source_file = 0; +#if defined (ARRAY_VARS) + GET_ARRAY_FROM_VAR ("BASH_SOURCE", bash_source_v, bash_source_a); + if (bash_source_a && array_num_elements (bash_source_a) > 0) + temp->source_file = array_reference (bash_source_a, 0); +#endif +#if defined (DEBUGGER) + bind_function_def (name->word, temp); +#endif + + temp->source_file = temp->source_file ? savestring (temp->source_file) : 0; + return (make_command (cm_function_def, (SIMPLE_COM *)temp)); +} + +COMMAND * +make_subshell_command (command) + COMMAND *command; +{ + SUBSHELL_COM *temp; + + temp = (SUBSHELL_COM *)xmalloc (sizeof (SUBSHELL_COM)); + temp->command = command; + temp->flags = CMD_WANT_SUBSHELL; + return (make_command (cm_subshell, (SIMPLE_COM *)temp)); +} + +COMMAND * +make_coproc_command (name, command) + char *name; + COMMAND *command; +{ + COPROC_COM *temp; + + temp = (COPROC_COM *)xmalloc (sizeof (COPROC_COM)); + temp->name = savestring (name); + temp->command = command; + temp->flags = CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + return (make_command (cm_coproc, (SIMPLE_COM *)temp)); +} + +/* Reverse the word list and redirection list in the simple command + has just been parsed. It seems simpler to do this here the one + time then by any other method that I can think of. */ +COMMAND * +clean_simple_command (command) + COMMAND *command; +{ + if (command->type != cm_simple) + command_error ("clean_simple_command", CMDERR_BADTYPE, command->type, 0); + else + { + command->value.Simple->words = + REVERSE_LIST (command->value.Simple->words, WORD_LIST *); + command->value.Simple->redirects = + REVERSE_LIST (command->value.Simple->redirects, REDIRECT *); + } + + parser_state &= ~PST_REDIRLIST; + return (command); +} + +/* The Yacc grammar productions have a problem, in that they take a + list followed by an ampersand (`&') and do a simple command connection, + making the entire list effectively asynchronous, instead of just + the last command. This means that when the list is executed, all + the commands have stdin set to /dev/null when job control is not + active, instead of just the last. This is wrong, and needs fixing + up. This function takes the `&' and applies it to the last command + in the list. This is done only for lists connected by `;'; it makes + `;' bind `tighter' than `&'. */ +COMMAND * +connect_async_list (command, command2, connector) + COMMAND *command, *command2; + int connector; +{ + COMMAND *t, *t1, *t2; + + t1 = command; + t = command->value.Connection->second; + + if (!t || (command->flags & CMD_WANT_SUBSHELL) || + command->value.Connection->connector != ';') + { + t = command_connect (command, command2, connector); + return t; + } + + /* This is just defensive programming. The Yacc precedence rules + will generally hand this function a command where t points directly + to the command we want (e.g. given a ; b ; c ; d &, t1 will point + to the `a ; b ; c' list and t will be the `d'). We only want to do + this if the list is not being executed as a unit in the background + with `( ... )', so we have to check for CMD_WANT_SUBSHELL. That's + the only way to tell. */ + while (((t->flags & CMD_WANT_SUBSHELL) == 0) && t->type == cm_connection && + t->value.Connection->connector == ';') + { + t1 = t; + t = t->value.Connection->second; + } + /* Now we have t pointing to the last command in the list, and + t1->value.Connection->second == t. */ + t2 = command_connect (t, command2, connector); + t1->value.Connection->second = t2; + return command; +} diff --git a/make_cmd.h b/make_cmd.h new file mode 100644 index 0000000..f17774d --- /dev/null +++ b/make_cmd.h @@ -0,0 +1,70 @@ +/* make_cmd.h -- Declarations of functions found in make_cmd.c */ + +/* Copyright (C) 1993-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_MAKE_CMD_H_) +#define _MAKE_CMD_H_ + +#include "stdc.h" + +extern void cmd_init __P((void)); + +extern WORD_DESC *alloc_word_desc __P((void)); +extern WORD_DESC *make_bare_word __P((const char *)); +extern WORD_DESC *make_word_flags __P((WORD_DESC *, const char *)); +extern WORD_DESC *make_word __P((const char *)); +extern WORD_DESC *make_word_from_token __P((int)); + +extern WORD_LIST *make_word_list __P((WORD_DESC *, WORD_LIST *)); + +#define add_string_to_list(s, l) make_word_list (make_word(s), (l)) + +extern COMMAND *make_command __P((enum command_type, SIMPLE_COM *)); +extern COMMAND *command_connect __P((COMMAND *, COMMAND *, int)); +extern COMMAND *make_for_command __P((WORD_DESC *, WORD_LIST *, COMMAND *, int)); +extern COMMAND *make_group_command __P((COMMAND *)); +extern COMMAND *make_case_command __P((WORD_DESC *, PATTERN_LIST *, int)); +extern PATTERN_LIST *make_pattern_list __P((WORD_LIST *, COMMAND *)); +extern COMMAND *make_if_command __P((COMMAND *, COMMAND *, COMMAND *)); +extern COMMAND *make_while_command __P((COMMAND *, COMMAND *)); +extern COMMAND *make_until_command __P((COMMAND *, COMMAND *)); +extern COMMAND *make_bare_simple_command __P((void)); +extern COMMAND *make_simple_command __P((ELEMENT, COMMAND *)); +extern void make_here_document __P((REDIRECT *, int)); +extern REDIRECT *make_redirection __P((REDIRECTEE, enum r_instruction, REDIRECTEE, int)); +extern COMMAND *make_function_def __P((WORD_DESC *, COMMAND *, int, int)); +extern COMMAND *clean_simple_command __P((COMMAND *)); + +extern COMMAND *make_arith_command __P((WORD_LIST *)); + +extern COMMAND *make_select_command __P((WORD_DESC *, WORD_LIST *, COMMAND *, int)); + +#if defined (COND_COMMAND) +extern COND_COM *make_cond_node __P((int, WORD_DESC *, COND_COM *, COND_COM *)); +extern COMMAND *make_cond_command __P((COND_COM *)); +#endif + +extern COMMAND *make_arith_for_command __P((WORD_LIST *, COMMAND *, int)); + +extern COMMAND *make_subshell_command __P((COMMAND *)); +extern COMMAND *make_coproc_command __P((char *, COMMAND *)); + +extern COMMAND *connect_async_list __P((COMMAND *, COMMAND *, int)); + +#endif /* !_MAKE_CMD_H */ diff --git a/mksyntax.c b/mksyntax.c new file mode 100644 index 0000000..0385686 --- /dev/null +++ b/mksyntax.c @@ -0,0 +1,415 @@ +/* + * mksyntax.c - construct shell syntax table for fast char attribute lookup. + */ + +/* Copyright (C) 2000-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include +#include "bashansi.h" +#include "chartypes.h" +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#include "syntax.h" + +extern int optind; +extern char *optarg; + +#ifndef errno +extern int errno; +#endif + +#ifndef HAVE_STRERROR +extern char *strerror(); +#endif + +struct wordflag { + int flag; + char *fstr; +} wordflags[] = { + { CWORD, "CWORD" }, + { CSHMETA, "CSHMETA" }, + { CSHBRK, "CSHBRK" }, + { CBACKQ, "CBACKQ" }, + { CQUOTE, "CQUOTE" }, + { CSPECL, "CSPECL" }, + { CEXP, "CEXP" }, + { CBSDQUOTE, "CBSDQUOTE" }, + { CBSHDOC, "CBSHDOC" }, + { CGLOB, "CGLOB" }, + { CXGLOB, "CXGLOB" }, + { CXQUOTE, "CXQUOTE" }, + { CSPECVAR, "CSPECVAR" }, + { CSUBSTOP, "CSUBSTOP" }, + { CBLANK, "CBLANK" }, +}; + +#define N_WFLAGS (sizeof (wordflags) / sizeof (wordflags[0])) +#define SYNSIZE 256 + +int lsyntax[SYNSIZE]; +int debug; +char *progname; + +char preamble[] = "\ +/*\n\ + * This file was generated by mksyntax. DO NOT EDIT.\n\ + */\n\ +\n"; + +char includes[] = "\ +#include \"config.h\"\n\ +#include \"stdc.h\"\n\ +#include \"syntax.h\"\n\n"; + +static void +usage() +{ + fprintf (stderr, "%s: usage: %s [-d] [-o filename]\n", progname, progname); + exit (2); +} + +#ifdef INCLUDE_UNUSED +static int +getcflag (s) + char *s; +{ + int i; + + for (i = 0; i < N_WFLAGS; i++) + if (strcmp (s, wordflags[i].fstr) == 0) + return wordflags[i].flag; + return -1; +} +#endif + +static char * +cdesc (i) + int i; +{ + static char xbuf[16]; + + if (i == ' ') + return "SPC"; + else if (ISPRINT (i)) + { + xbuf[0] = i; + xbuf[1] = '\0'; + return (xbuf); + } + else if (i == CTLESC) + return "CTLESC"; + else if (i == CTLNUL) + return "CTLNUL"; + else if (i == '\033') /* ASCII */ + return "ESC"; + + xbuf[0] = '\\'; + xbuf[2] = '\0'; + + switch (i) + { +#ifdef __STDC__ + case '\a': xbuf[1] = 'a'; break; + case '\v': xbuf[1] = 'v'; break; +#else + case '\007': xbuf[1] = 'a'; break; + case 0x0B: xbuf[1] = 'v'; break; +#endif + case '\b': xbuf[1] = 'b'; break; + case '\f': xbuf[1] = 'f'; break; + case '\n': xbuf[1] = 'n'; break; + case '\r': xbuf[1] = 'r'; break; + case '\t': xbuf[1] = 't'; break; + default: sprintf (xbuf, "%d", i); break; + } + + return xbuf; +} + +static char * +getcstr (f) + int f; +{ + int i; + + for (i = 0; i < N_WFLAGS; i++) + if (f == wordflags[i].flag) + return (wordflags[i].fstr); + return ((char *)NULL); +} + +static void +addcstr (str, flag) + char *str; + int flag; +{ + char *s, *fstr; + unsigned char uc; + + for (s = str; s && *s; s++) + { + uc = *s; + + if (debug) + { + fstr = getcstr (flag); + fprintf(stderr, "added %s for character %s\n", fstr, cdesc(uc)); + } + + lsyntax[uc] |= flag; + } +} + +static void +addcchar (c, flag) + unsigned char c; + int flag; +{ + char *fstr; + + if (debug) + { + fstr = getcstr (flag); + fprintf (stderr, "added %s for character %s\n", fstr, cdesc(c)); + } + lsyntax[c] |= flag; +} + +static void +addblanks () +{ + register int i; + unsigned char uc; + + for (i = 0; i < SYNSIZE; i++) + { + uc = i; + /* Since we don't call setlocale(), this defaults to the "C" locale, and + the default blank characters will be space and tab. */ + if (isblank (uc)) + lsyntax[uc] |= CBLANK; + } +} + +/* load up the correct flag values in lsyntax */ +static void +load_lsyntax () +{ + /* shell metacharacters */ + addcstr (shell_meta_chars, CSHMETA); + + /* shell word break characters */ + addcstr (shell_break_chars, CSHBRK); + + addcchar ('`', CBACKQ); + + addcstr (shell_quote_chars, CQUOTE); + + addcchar (CTLESC, CSPECL); + addcchar (CTLNUL, CSPECL); + + addcstr (shell_exp_chars, CEXP); + + addcstr (slashify_in_quotes, CBSDQUOTE); + addcstr (slashify_in_here_document, CBSHDOC); + + addcstr (shell_glob_chars, CGLOB); + +#if defined (EXTENDED_GLOB) + addcstr (ext_glob_chars, CXGLOB); +#endif + + addcstr (shell_quote_chars, CXQUOTE); + addcchar ('\\', CXQUOTE); + + addcstr ("@*#?-$!", CSPECVAR); /* omits $0...$9 and $_ */ + + addcstr ("-=?+", CSUBSTOP); /* OP in ${paramOPword} */ + + addblanks (); +} + +static void +dump_lflags (fp, ind) + FILE *fp; + int ind; +{ + int xflags, first, i; + + xflags = lsyntax[ind]; + first = 1; + + if (xflags == 0) + fputs (wordflags[0].fstr, fp); + else + { + for (i = 1; i < N_WFLAGS; i++) + if (xflags & wordflags[i].flag) + { + if (first) + first = 0; + else + putc ('|', fp); + fputs (wordflags[i].fstr, fp); + } + } +} + +static void +wcomment (fp, i) + FILE *fp; + int i; +{ + fputs ("\t\t/* ", fp); + + fprintf (fp, "%s", cdesc(i)); + + fputs (" */", fp); +} + +static void +dump_lsyntax (fp) + FILE *fp; +{ + int i; + + fprintf (fp, "int sh_syntabsiz = %d;\n", SYNSIZE); + fprintf (fp, "int sh_syntaxtab[%d] = {\n", SYNSIZE); + + for (i = 0; i < SYNSIZE; i++) + { + putc ('\t', fp); + dump_lflags (fp, i); + putc (',', fp); + wcomment (fp, i); + putc ('\n', fp); + } + + fprintf (fp, "};\n"); +} + +int +main(argc, argv) + int argc; + char **argv; +{ + int opt, i; + char *filename; + FILE *fp; + + if ((progname = strrchr (argv[0], '/')) == 0) + progname = argv[0]; + else + progname++; + + filename = (char *)NULL; + debug = 0; + + while ((opt = getopt (argc, argv, "do:")) != EOF) + { + switch (opt) + { + case 'd': + debug = 1; + break; + case 'o': + filename = optarg; + break; + default: + usage(); + } + } + + argc -= optind; + argv += optind; + + if (filename) + { + fp = fopen (filename, "w"); + if (fp == 0) + { + fprintf (stderr, "%s: %s: cannot open: %s\n", progname, filename, strerror(errno)); + exit (1); + } + } + else + { + filename = "stdout"; + fp = stdout; + } + + + for (i = 0; i < SYNSIZE; i++) + lsyntax[i] = CWORD; + + load_lsyntax (); + + fprintf (fp, "%s\n", preamble); + fprintf (fp, "%s\n", includes); + + dump_lsyntax (fp); + + if (fp != stdout) + fclose (fp); + exit (0); +} + + +#if !defined (HAVE_STRERROR) + +#include +#if defined (HAVE_SYS_PARAM_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# include +#endif + +/* Return a string corresponding to the error number E. From + the ANSI C spec. */ +#if defined (strerror) +# undef strerror +#endif + +char * +strerror (e) + int e; +{ + static char emsg[40]; +#if defined (HAVE_SYS_ERRLIST) + extern int sys_nerr; + extern char *sys_errlist[]; + + if (e > 0 && e < sys_nerr) + return (sys_errlist[e]); + else +#endif /* HAVE_SYS_ERRLIST */ + { + sprintf (emsg, "Unknown system error %d", e); + return (&emsg[0]); + } +} +#endif /* HAVE_STRERROR */ diff --git a/nojobs.c b/nojobs.c new file mode 100644 index 0000000..0c9bd75 --- /dev/null +++ b/nojobs.c @@ -0,0 +1,974 @@ +/* nojobs.c - functions that make children, remember them, and handle their termination. */ + +/* This file works under BSD, System V, minix, and Posix systems. It does + not implement job control. */ + +/* Copyright (C) 1987-2011 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" +#include "filecntl.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include +#include + +#if defined (BUFFERED_INPUT) +# include "input.h" +#endif + +/* Need to include this up here for *_TTY_DRIVER definitions. */ +#include "shtty.h" + +#include "bashintl.h" + +#include "shell.h" +#include "jobs.h" +#include "execute_cmd.h" + +#include "builtins/builtext.h" /* for wait_builtin */ + +#define DEFAULT_CHILD_MAX 32 + +#if defined (_POSIX_VERSION) || !defined (HAVE_KILLPG) +# define killpg(pg, sig) kill(-(pg),(sig)) +#endif /* USG || _POSIX_VERSION */ + +#if !defined (HAVE_SIGINTERRUPT) && !defined (HAVE_POSIX_SIGNALS) +# define siginterrupt(sig, code) +#endif /* !HAVE_SIGINTERRUPT && !HAVE_POSIX_SIGNALS */ + +#if defined (HAVE_WAITPID) +# define WAITPID(pid, statusp, options) waitpid (pid, statusp, options) +#else +# define WAITPID(pid, statusp, options) wait (statusp) +#endif /* !HAVE_WAITPID */ + +/* Return the fd from which we are actually getting input. */ +#define input_tty() (shell_tty != -1) ? shell_tty : fileno (stderr) + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +extern int interactive, interactive_shell, login_shell; +extern int subshell_environment; +extern int last_command_exit_value, last_command_exit_signal; +extern int interrupt_immediately; +extern sh_builtin_func_t *this_shell_builtin; +#if defined (HAVE_POSIX_SIGNALS) +extern sigset_t top_level_mask; +#endif +extern procenv_t wait_intr_buf; +extern int wait_signal_received; + +volatile pid_t last_made_pid = NO_PID; +volatile pid_t last_asynchronous_pid = NO_PID; + +/* Call this when you start making children. */ +int already_making_children = 0; + +/* The controlling tty for this shell. */ +int shell_tty = -1; + +/* If this is non-zero, $LINES and $COLUMNS are reset after every process + exits from get_tty_state(). */ +int check_window_size = CHECKWINSIZE_DEFAULT; + +/* We don't have job control. */ +int job_control = 0; + +/* STATUS and FLAGS are only valid if pid != NO_PID + STATUS is only valid if (flags & PROC_RUNNING) == 0 */ +struct proc_status { + pid_t pid; + int status; /* Exit status of PID or 128 + fatal signal number */ + int flags; +}; + +/* Values for proc_status.flags */ +#define PROC_RUNNING 0x01 +#define PROC_NOTIFIED 0x02 +#define PROC_ASYNC 0x04 +#define PROC_SIGNALED 0x10 + +/* Return values from find_status_by_pid */ +#define PROC_BAD -1 +#define PROC_STILL_ALIVE -2 + +static struct proc_status *pid_list = (struct proc_status *)NULL; +static int pid_list_size; +static int wait_sigint_received; + +static long child_max = -1L; + +static void alloc_pid_list __P((void)); +static int find_proc_slot __P((void)); +static int find_index_by_pid __P((pid_t)); +static int find_status_by_pid __P((pid_t)); +static int process_exit_status __P((WAIT)); +static int find_termsig_by_pid __P((pid_t)); +static int get_termsig __P((WAIT)); +static void set_pid_status __P((pid_t, WAIT)); +static void set_pid_flags __P((pid_t, int)); +static void unset_pid_flags __P((pid_t, int)); +static int get_pid_flags __P((pid_t)); +static void add_pid __P((pid_t, int)); +static void mark_dead_jobs_as_notified __P((int)); + +static sighandler wait_sigint_handler __P((int)); +static char *j_strsignal __P((int)); + +#if defined (HAVE_WAITPID) +static void reap_zombie_children __P((void)); +#endif + +#if !defined (HAVE_SIGINTERRUPT) && defined (HAVE_POSIX_SIGNALS) +static int siginterrupt __P((int, int)); +#endif + +static void restore_sigint_handler __P((void)); + +/* Allocate new, or grow existing PID_LIST. */ +static void +alloc_pid_list () +{ + register int i; + int old = pid_list_size; + + pid_list_size += 10; + pid_list = (struct proc_status *)xrealloc (pid_list, pid_list_size * sizeof (struct proc_status)); + + /* None of the newly allocated slots have process id's yet. */ + for (i = old; i < pid_list_size; i++) + pid_list[i].pid = NO_PID; +} + +/* Return the offset within the PID_LIST array of an empty slot. This can + create new slots if all of the existing slots are taken. */ +static int +find_proc_slot () +{ + register int i; + + for (i = 0; i < pid_list_size; i++) + if (pid_list[i].pid == NO_PID) + return (i); + + if (i == pid_list_size) + alloc_pid_list (); + + return (i); +} + +/* Return the offset within the PID_LIST array of a slot containing PID, + or the value NO_PID if the pid wasn't found. */ +static int +find_index_by_pid (pid) + pid_t pid; +{ + register int i; + + for (i = 0; i < pid_list_size; i++) + if (pid_list[i].pid == pid) + return (i); + + return (NO_PID); +} + +/* Return the status of PID as looked up in the PID_LIST array. A + return value of PROC_BAD indicates that PID wasn't found. */ +static int +find_status_by_pid (pid) + pid_t pid; +{ + int i; + + i = find_index_by_pid (pid); + if (i == NO_PID) + return (PROC_BAD); + if (pid_list[i].flags & PROC_RUNNING) + return (PROC_STILL_ALIVE); + return (pid_list[i].status); +} + +static int +process_exit_status (status) + WAIT status; +{ + if (WIFSIGNALED (status)) + return (128 + WTERMSIG (status)); + else + return (WEXITSTATUS (status)); +} + +/* Return the status of PID as looked up in the PID_LIST array. A + return value of PROC_BAD indicates that PID wasn't found. */ +static int +find_termsig_by_pid (pid) + pid_t pid; +{ + int i; + + i = find_index_by_pid (pid); + if (i == NO_PID) + return (0); + if (pid_list[i].flags & PROC_RUNNING) + return (0); + return (get_termsig ((WAIT)pid_list[i].status)); +} + +/* Set LAST_COMMAND_EXIT_SIGNAL depending on STATUS. If STATUS is -1, look + up PID in the pid array and set LAST_COMMAND_EXIT_SIGNAL appropriately + depending on its flags and exit status. */ +static int +get_termsig (status) + WAIT status; +{ + if (WIFSTOPPED (status) == 0 && WIFSIGNALED (status)) + return (WTERMSIG (status)); + else + return (0); +} + +/* Give PID the status value STATUS in the PID_LIST array. */ +static void +set_pid_status (pid, status) + pid_t pid; + WAIT status; +{ + int slot; + +#if defined (COPROCESS_SUPPORT) + coproc_pidchk (pid, status); +#endif + + slot = find_index_by_pid (pid); + if (slot == NO_PID) + return; + + pid_list[slot].status = process_exit_status (status); + pid_list[slot].flags &= ~PROC_RUNNING; + if (WIFSIGNALED (status)) + pid_list[slot].flags |= PROC_SIGNALED; + /* If it's not a background process, mark it as notified so it gets + cleaned up. */ + if ((pid_list[slot].flags & PROC_ASYNC) == 0) + pid_list[slot].flags |= PROC_NOTIFIED; +} + +/* Give PID the flags FLAGS in the PID_LIST array. */ +static void +set_pid_flags (pid, flags) + pid_t pid; + int flags; +{ + int slot; + + slot = find_index_by_pid (pid); + if (slot == NO_PID) + return; + + pid_list[slot].flags |= flags; +} + +/* Unset FLAGS for PID in the pid list */ +static void +unset_pid_flags (pid, flags) + pid_t pid; + int flags; +{ + int slot; + + slot = find_index_by_pid (pid); + if (slot == NO_PID) + return; + + pid_list[slot].flags &= ~flags; +} + +/* Return the flags corresponding to PID in the PID_LIST array. */ +static int +get_pid_flags (pid) + pid_t pid; +{ + int slot; + + slot = find_index_by_pid (pid); + if (slot == NO_PID) + return 0; + + return (pid_list[slot].flags); +} + +static void +add_pid (pid, async) + pid_t pid; + int async; +{ + int slot; + + slot = find_proc_slot (); + + pid_list[slot].pid = pid; + pid_list[slot].status = -1; + pid_list[slot].flags = PROC_RUNNING; + if (async) + pid_list[slot].flags |= PROC_ASYNC; +} + +static void +mark_dead_jobs_as_notified (force) + int force; +{ + register int i, ndead; + + /* first, count the number of non-running async jobs if FORCE == 0 */ + for (i = ndead = 0; force == 0 && i < pid_list_size; i++) + { + if (pid_list[i].pid == NO_PID) + continue; + if (((pid_list[i].flags & PROC_RUNNING) == 0) && + (pid_list[i].flags & PROC_ASYNC)) + ndead++; + } + + if (child_max < 0) + child_max = getmaxchild (); + if (child_max < 0) + child_max = DEFAULT_CHILD_MAX; + + if (force == 0 && ndead <= child_max) + return; + + /* If FORCE == 0, we just mark as many non-running async jobs as notified + to bring us under the CHILD_MAX limit. */ + for (i = 0; i < pid_list_size; i++) + { + if (pid_list[i].pid == NO_PID) + continue; + if (((pid_list[i].flags & PROC_RUNNING) == 0) && + pid_list[i].pid != last_asynchronous_pid) + { + pid_list[i].flags |= PROC_NOTIFIED; + if (force == 0 && (pid_list[i].flags & PROC_ASYNC) && --ndead <= child_max) + break; + } + } +} + +/* Remove all dead, notified jobs from the pid_list. */ +int +cleanup_dead_jobs () +{ + register int i; + +#if defined (HAVE_WAITPID) + reap_zombie_children (); +#endif + + for (i = 0; i < pid_list_size; i++) + { + if ((pid_list[i].flags & PROC_RUNNING) == 0 && + (pid_list[i].flags & PROC_NOTIFIED)) + pid_list[i].pid = NO_PID; + } + +#if defined (COPROCESS_SUPPORT) + coproc_reap (); +#endif + + return 0; +} + +void +reap_dead_jobs () +{ + mark_dead_jobs_as_notified (0); + cleanup_dead_jobs (); +} + +/* Initialize the job control mechanism, and set up the tty stuff. */ +initialize_job_control (force) + int force; +{ + shell_tty = fileno (stderr); + + if (interactive) + get_tty_state (); +} + +/* Setup this shell to handle C-C, etc. */ +void +initialize_job_signals () +{ + set_signal_handler (SIGINT, sigint_sighandler); + + /* If this is a login shell we don't wish to be disturbed by + stop signals. */ + if (login_shell) + ignore_tty_job_signals (); +} + +#if defined (HAVE_WAITPID) +/* Collect the status of all zombie children so that their system + resources can be deallocated. */ +static void +reap_zombie_children () +{ +# if defined (WNOHANG) + pid_t pid; + WAIT status; + + CHECK_TERMSIG; + CHECK_WAIT_INTR; + while ((pid = waitpid (-1, (int *)&status, WNOHANG)) > 0) + set_pid_status (pid, status); +# endif /* WNOHANG */ + CHECK_TERMSIG; + CHECK_WAIT_INTR; +} +#endif /* WAITPID */ + +#if !defined (HAVE_SIGINTERRUPT) && defined (HAVE_POSIX_SIGNALS) + +#if !defined (SA_RESTART) +# define SA_RESTART 0 +#endif + +static int +siginterrupt (sig, flag) + int sig, flag; +{ + struct sigaction act; + + sigaction (sig, (struct sigaction *)NULL, &act); + + if (flag) + act.sa_flags &= ~SA_RESTART; + else + act.sa_flags |= SA_RESTART; + + return (sigaction (sig, &act, (struct sigaction *)NULL)); +} +#endif /* !HAVE_SIGINTERRUPT && HAVE_POSIX_SIGNALS */ + +/* Fork, handling errors. Returns the pid of the newly made child, or 0. + COMMAND is just for remembering the name of the command; we don't do + anything else with it. ASYNC_P says what to do with the tty. If + non-zero, then don't give it away. */ +pid_t +make_child (command, async_p) + char *command; + int async_p; +{ + pid_t pid; + int forksleep; + + /* Discard saved memory. */ + if (command) + free (command); + + start_pipeline (); + +#if defined (BUFFERED_INPUT) + /* If default_buffered_input is active, we are reading a script. If + the command is asynchronous, we have already duplicated /dev/null + as fd 0, but have not changed the buffered stream corresponding to + the old fd 0. We don't want to sync the stream in this case. */ + if (default_buffered_input != -1 && (!async_p || default_buffered_input > 0)) + sync_buffered_stream (default_buffered_input); +#endif /* BUFFERED_INPUT */ + + /* XXX - block SIGTERM here and unblock in child after fork resets the + set of pending signals? */ + RESET_SIGTERM; + + /* Create the child, handle severe errors. Retry on EAGAIN. */ + forksleep = 1; + while ((pid = fork ()) < 0 && errno == EAGAIN && forksleep < FORKSLEEP_MAX) + { + sys_error ("fork: retry"); + RESET_SIGTERM; + +#if defined (HAVE_WAITPID) + /* Posix systems with a non-blocking waitpid () system call available + get another chance after zombies are reaped. */ + reap_zombie_children (); + if (forksleep > 1 && sleep (forksleep) != 0) + break; +#else + if (sleep (forksleep) != 0) + break; +#endif /* HAVE_WAITPID */ + forksleep <<= 1; + } + + if (pid != 0) + RESET_SIGTERM; + + if (pid < 0) + { + sys_error ("fork"); + last_command_exit_value = EX_NOEXEC; + throw_to_top_level (); + } + + if (pid == 0) + { +#if defined (BUFFERED_INPUT) + unset_bash_input (0); +#endif /* BUFFERED_INPUT */ + +#if defined (HAVE_POSIX_SIGNALS) + /* Restore top-level signal mask. */ + sigprocmask (SIG_SETMASK, &top_level_mask, (sigset_t *)NULL); +#endif + +#if 0 + /* Ignore INT and QUIT in asynchronous children. */ + if (async_p) + last_asynchronous_pid = getpid (); +#endif + + default_tty_job_signals (); + } + else + { + /* In the parent. */ + + last_made_pid = pid; + + if (async_p) + last_asynchronous_pid = pid; + + add_pid (pid, async_p); + } + return (pid); +} + +void +ignore_tty_job_signals () +{ +#if defined (SIGTSTP) + set_signal_handler (SIGTSTP, SIG_IGN); + set_signal_handler (SIGTTIN, SIG_IGN); + set_signal_handler (SIGTTOU, SIG_IGN); +#endif +} + +void +default_tty_job_signals () +{ +#if defined (SIGTSTP) + set_signal_handler (SIGTSTP, SIG_DFL); + set_signal_handler (SIGTTIN, SIG_DFL); + set_signal_handler (SIGTTOU, SIG_DFL); +#endif +} + +/* Wait for a single pid (PID) and return its exit status. Called by + the wait builtin. */ +int +wait_for_single_pid (pid) + pid_t pid; +{ + pid_t got_pid; + WAIT status; + int pstatus, flags; + + pstatus = find_status_by_pid (pid); + + if (pstatus == PROC_BAD) + { + internal_error (_("wait: pid %ld is not a child of this shell"), (long)pid); + return (127); + } + + if (pstatus != PROC_STILL_ALIVE) + { + if (pstatus > 128) + last_command_exit_signal = find_termsig_by_pid (pid); + return (pstatus); + } + + siginterrupt (SIGINT, 1); + while ((got_pid = WAITPID (pid, &status, 0)) != pid) + { + CHECK_TERMSIG; + CHECK_WAIT_INTR; + if (got_pid < 0) + { + if (errno != EINTR && errno != ECHILD) + { + siginterrupt (SIGINT, 0); + sys_error ("wait"); + } + break; + } + else if (got_pid > 0) + set_pid_status (got_pid, status); + } + + if (got_pid > 0) + { + set_pid_status (got_pid, status); + set_pid_flags (got_pid, PROC_NOTIFIED); + } + + siginterrupt (SIGINT, 0); + QUIT; + + return (got_pid > 0 ? process_exit_status (status) : -1); +} + +/* Wait for all of the shell's children to exit. Called by the `wait' + builtin. */ +void +wait_for_background_pids () +{ + pid_t got_pid; + WAIT status; + + /* If we aren't using job control, we let the kernel take care of the + bookkeeping for us. wait () will return -1 and set errno to ECHILD + when there are no more unwaited-for child processes on both + 4.2 BSD-based and System V-based systems. */ + + siginterrupt (SIGINT, 1); + + /* Wait for ECHILD */ + while ((got_pid = WAITPID (-1, &status, 0)) != -1) + set_pid_status (got_pid, status); + + if (errno != EINTR && errno != ECHILD) + { + siginterrupt (SIGINT, 0); + sys_error("wait"); + } + + siginterrupt (SIGINT, 0); + QUIT; + + mark_dead_jobs_as_notified (1); + cleanup_dead_jobs (); +} + +/* Make OLD_SIGINT_HANDLER the SIGINT signal handler. */ +#define INVALID_SIGNAL_HANDLER (SigHandler *)wait_for_background_pids +static SigHandler *old_sigint_handler = INVALID_SIGNAL_HANDLER; + +static void +restore_sigint_handler () +{ + if (old_sigint_handler != INVALID_SIGNAL_HANDLER) + { + set_signal_handler (SIGINT, old_sigint_handler); + old_sigint_handler = INVALID_SIGNAL_HANDLER; + } +} + +/* Handle SIGINT while we are waiting for children in a script to exit. + All interrupts are effectively ignored by the shell, but allowed to + kill a running job. */ +static sighandler +wait_sigint_handler (sig) + int sig; +{ + SigHandler *sigint_handler; + + /* If we got a SIGINT while in `wait', and SIGINT is trapped, do + what POSIX.2 says (see builtins/wait.def for more info). */ + if (this_shell_builtin && this_shell_builtin == wait_builtin && + signal_is_trapped (SIGINT) && + ((sigint_handler = trap_to_sighandler (SIGINT)) == trap_handler)) + { + last_command_exit_value = 128+SIGINT; + restore_sigint_handler (); + interrupt_immediately = 0; + trap_handler (SIGINT); /* set pending_traps[SIGINT] */ + wait_signal_received = SIGINT; + SIGRETURN (0); + } + + if (interrupt_immediately) + { + last_command_exit_value = EXECUTION_FAILURE; + restore_sigint_handler (); + ADDINTERRUPT; + QUIT; + } + + wait_sigint_received = 1; + + SIGRETURN (0); +} + +static char * +j_strsignal (s) + int s; +{ + static char retcode_name_buffer[64] = { '\0' }; + char *x; + + x = strsignal (s); + if (x == 0) + { + x = retcode_name_buffer; + sprintf (x, "Signal %d", s); + } + return x; +} + +/* Wait for pid (one of our children) to terminate. This is called only + by the execution code in execute_cmd.c. */ +int +wait_for (pid) + pid_t pid; +{ + int return_val, pstatus; + pid_t got_pid; + WAIT status; + + pstatus = find_status_by_pid (pid); + + if (pstatus == PROC_BAD) + return (0); + + if (pstatus != PROC_STILL_ALIVE) + { + if (pstatus > 128) + last_command_exit_signal = find_termsig_by_pid (pid); + return (pstatus); + } + + /* If we are running a script, ignore SIGINT while we're waiting for + a child to exit. The loop below does some of this, but not all. */ + wait_sigint_received = 0; + if (interactive_shell == 0) + old_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler); + + while ((got_pid = WAITPID (-1, &status, 0)) != pid) /* XXX was pid now -1 */ + { + CHECK_TERMSIG; + CHECK_WAIT_INTR; + if (got_pid < 0 && errno == ECHILD) + { +#if !defined (_POSIX_VERSION) + status.w_termsig = status.w_retcode = 0; +#else + status = 0; +#endif /* _POSIX_VERSION */ + break; + } + else if (got_pid < 0 && errno != EINTR) + programming_error ("wait_for(%ld): %s", (long)pid, strerror(errno)); + else if (got_pid > 0) + set_pid_status (got_pid, status); + } + + if (got_pid > 0) + set_pid_status (got_pid, status); + +#if defined (HAVE_WAITPID) + if (got_pid >= 0) + reap_zombie_children (); +#endif /* HAVE_WAITPID */ + + CHECK_TERMSIG; + CHECK_WAIT_INTR; + + if (interactive_shell == 0) + { + SigHandler *temp_handler; + + temp_handler = old_sigint_handler; + restore_sigint_handler (); + + /* If the job exited because of SIGINT, make sure the shell acts as if + it had received one also. */ + if (WIFSIGNALED (status) && (WTERMSIG (status) == SIGINT)) + { + + if (maybe_call_trap_handler (SIGINT) == 0) + { + if (temp_handler == SIG_DFL) + termsig_handler (SIGINT); + else if (temp_handler != INVALID_SIGNAL_HANDLER && temp_handler != SIG_IGN) + (*temp_handler) (SIGINT); + } + } + } + + /* Default return value. */ + /* ``a full 8 bits of status is returned'' */ + return_val = process_exit_status (status); + last_command_exit_signal = get_termsig (status); + +#if defined (DONT_REPORT_SIGPIPE) && defined (DONT_REPORT_SIGTERM) +# define REPORTSIG(x) ((x) != SIGINT && (x) != SIGPIPE && (x) != SIGTERM) +#elif !defined (DONT_REPORT_SIGPIPE) && !defined (DONT_REPORT_SIGTERM) +# define REPORTSIG(x) ((x) != SIGINT) +#elif defined (DONT_REPORT_SIGPIPE) +# define REPORTSIG(x) ((x) != SIGINT && (x) != SIGPIPE) +#else +# define REPORTSIG(x) ((x) != SIGINT && (x) != SIGTERM) +#endif + + if ((WIFSTOPPED (status) == 0) && WIFSIGNALED (status) && REPORTSIG(WTERMSIG (status))) + { + fprintf (stderr, "%s", j_strsignal (WTERMSIG (status))); + if (WIFCORED (status)) + fprintf (stderr, _(" (core dumped)")); + fprintf (stderr, "\n"); + } + + if (interactive_shell && subshell_environment == 0) + { + if (WIFSIGNALED (status) || WIFSTOPPED (status)) + set_tty_state (); + else + get_tty_state (); + } + else if (interactive_shell == 0 && subshell_environment == 0 && check_window_size) + get_new_window_size (0, (int *)0, (int *)0); + + return (return_val); +} + +/* Send PID SIGNAL. Returns -1 on failure, 0 on success. If GROUP is non-zero, + or PID is less than -1, then kill the process group associated with PID. */ +int +kill_pid (pid, signal, group) + pid_t pid; + int signal, group; +{ + int result; + + if (pid < -1) + { + pid = -pid; + group = 1; + } + result = group ? killpg (pid, signal) : kill (pid, signal); + return (result); +} + +static TTYSTRUCT shell_tty_info; +static int got_tty_state; + +/* Fill the contents of shell_tty_info with the current tty info. */ +get_tty_state () +{ + int tty; + + tty = input_tty (); + if (tty != -1) + { + ttgetattr (tty, &shell_tty_info); + got_tty_state = 1; + if (check_window_size) + get_new_window_size (0, (int *)0, (int *)0); + } +} + +/* Make the current tty use the state in shell_tty_info. */ +int +set_tty_state () +{ + int tty; + + tty = input_tty (); + if (tty != -1) + { + if (got_tty_state == 0) + return 0; + ttsetattr (tty, &shell_tty_info); + } + return 0; +} + +/* Give the terminal to PGRP. */ +give_terminal_to (pgrp, force) + pid_t pgrp; + int force; +{ +} + +/* Stop a pipeline. */ +int +stop_pipeline (async, ignore) + int async; + COMMAND *ignore; +{ + already_making_children = 0; + return 0; +} + +void +start_pipeline () +{ + already_making_children = 1; +} + +void +stop_making_children () +{ + already_making_children = 0; +} + +int +get_job_by_pid (pid, block) + pid_t pid; + int block; +{ + int i; + + i = find_index_by_pid (pid); + return ((i == NO_PID) ? PROC_BAD : i); +} + +/* Print descriptive information about the job with leader pid PID. */ +void +describe_pid (pid) + pid_t pid; +{ + fprintf (stderr, "%ld\n", (long) pid); +} + +void +freeze_jobs_list () +{ +} + +void +unfreeze_jobs_list () +{ +} + +int +count_all_jobs () +{ + return 0; +} diff --git a/parse.y b/parse.y new file mode 100644 index 0000000..cd3cf1e --- /dev/null +++ b/parse.y @@ -0,0 +1,6229 @@ +/* parse.y - Yacc grammar for bash. */ + +/* Copyright (C) 1989-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +%{ +#include "config.h" + +#include "bashtypes.h" +#include "bashansi.h" + +#include "filecntl.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (HAVE_LOCALE_H) +# include +#endif + +#include +#include "chartypes.h" +#include + +#include "memalloc.h" + +#include "bashintl.h" + +#define NEED_STRFTIME_DECL /* used in externs.h */ + +#include "shell.h" +#include "typemax.h" /* SIZE_MAX if needed */ +#include "trap.h" +#include "flags.h" +#include "parser.h" +#include "mailcheck.h" +#include "test.h" +#include "builtins.h" +#include "builtins/common.h" +#include "builtins/builtext.h" + +#include "shmbutil.h" + +#if defined (READLINE) +# include "bashline.h" +# include +#endif /* READLINE */ + +#if defined (HISTORY) +# include "bashhist.h" +# include +#endif /* HISTORY */ + +#if defined (JOB_CONTROL) +# include "jobs.h" +#endif /* JOB_CONTROL */ + +#if defined (ALIAS) +# include "alias.h" +#else +typedef void *alias_t; +#endif /* ALIAS */ + +#if defined (PROMPT_STRING_DECODE) +# ifndef _MINIX +# include +# endif +# include +# if defined (TM_IN_SYS_TIME) +# include +# include +# endif /* TM_IN_SYS_TIME */ +# include "maxpath.h" +#endif /* PROMPT_STRING_DECODE */ + +#define RE_READ_TOKEN -99 +#define NO_EXPANSION -100 + +#ifdef DEBUG +# define YYDEBUG 1 +#else +# define YYDEBUG 0 +#endif + +#if defined (HANDLE_MULTIBYTE) +# define last_shell_getc_is_singlebyte \ + ((shell_input_line_index > 1) \ + ? shell_input_line_property[shell_input_line_index - 1] \ + : 1) +# define MBTEST(x) ((x) && last_shell_getc_is_singlebyte) +#else +# define last_shell_getc_is_singlebyte 1 +# define MBTEST(x) ((x)) +#endif + +#if defined (EXTENDED_GLOB) +extern int extended_glob; +#endif + +extern int eof_encountered; +extern int no_line_editing, running_under_emacs; +extern int current_command_number; +extern int sourcelevel, parse_and_execute_level; +extern int posixly_correct; +extern int last_command_exit_value; +extern pid_t last_command_subst_pid; +extern char *shell_name, *current_host_name; +extern char *dist_version; +extern int patch_level; +extern int dump_translatable_strings, dump_po_strings; +extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin; +#if defined (BUFFERED_INPUT) +extern int bash_input_fd_changed; +#endif + +extern int errno; +/* **************************************************************** */ +/* */ +/* "Forward" declarations */ +/* */ +/* **************************************************************** */ + +#ifdef DEBUG +static void debug_parser __P((int)); +#endif + +static int yy_getc __P((void)); +static int yy_ungetc __P((int)); + +#if defined (READLINE) +static int yy_readline_get __P((void)); +static int yy_readline_unget __P((int)); +#endif + +static int yy_string_get __P((void)); +static int yy_string_unget __P((int)); +static void rewind_input_string __P((void)); +static int yy_stream_get __P((void)); +static int yy_stream_unget __P((int)); + +static int shell_getc __P((int)); +static void shell_ungetc __P((int)); +static void discard_until __P((int)); + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) +static void push_string __P((char *, int, alias_t *)); +static void pop_string __P((void)); +static void free_string_list __P((void)); +#endif + +static char *read_a_line __P((int)); + +static int reserved_word_acceptable __P((int)); +static int yylex __P((void)); +static int alias_expand_token __P((char *)); +static int time_command_acceptable __P((void)); +static int special_case_tokens __P((char *)); +static int read_token __P((int)); +static char *parse_matched_pair __P((int, int, int, int *, int)); +static char *parse_comsub __P((int, int, int, int *, int)); +#if defined (ARRAY_VARS) +static char *parse_compound_assignment __P((int *)); +#endif +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) +static int parse_dparen __P((int)); +static int parse_arith_cmd __P((char **, int)); +#endif +#if defined (COND_COMMAND) +static void cond_error __P((void)); +static COND_COM *cond_expr __P((void)); +static COND_COM *cond_or __P((void)); +static COND_COM *cond_and __P((void)); +static COND_COM *cond_term __P((void)); +static int cond_skip_newlines __P((void)); +static COMMAND *parse_cond_command __P((void)); +#endif +#if defined (ARRAY_VARS) +static int token_is_assignment __P((char *, int)); +static int token_is_ident __P((char *, int)); +#endif +static int read_token_word __P((int)); +static void discard_parser_constructs __P((int)); + +static char *error_token_from_token __P((int)); +static char *error_token_from_text __P((void)); +static void print_offending_line __P((void)); +static void report_syntax_error __P((char *)); + +static void handle_eof_input_unit __P((void)); +static void prompt_again __P((void)); +#if 0 +static void reset_readline_prompt __P((void)); +#endif +static void print_prompt __P((void)); + +#if defined (HANDLE_MULTIBYTE) +static void set_line_mbstate __P((void)); +static char *shell_input_line_property = NULL; +#else +# define set_line_mbstate() +#endif + +extern int yyerror __P((const char *)); + +#ifdef DEBUG +extern int yydebug; +#endif + +/* Default prompt strings */ +char *primary_prompt = PPROMPT; +char *secondary_prompt = SPROMPT; + +/* PROMPT_STRING_POINTER points to one of these, never to an actual string. */ +char *ps1_prompt, *ps2_prompt; + +/* Handle on the current prompt string. Indirectly points through + ps1_ or ps2_prompt. */ +char **prompt_string_pointer = (char **)NULL; +char *current_prompt_string; + +/* Non-zero means we expand aliases in commands. */ +int expand_aliases = 0; + +/* If non-zero, the decoded prompt string undergoes parameter and + variable substitution, command substitution, arithmetic substitution, + string expansion, process substitution, and quote removal in + decode_prompt_string. */ +int promptvars = 1; + +/* If non-zero, $'...' and $"..." are expanded when they appear within + a ${...} expansion, even when the expansion appears within double + quotes. */ +int extended_quote = 1; + +/* The number of lines read from input while creating the current command. */ +int current_command_line_count; + +/* The number of lines in a command saved while we run parse_and_execute */ +int saved_command_line_count; + +/* The token that currently denotes the end of parse. */ +int shell_eof_token; + +/* The token currently being read. */ +int current_token; + +/* The current parser state. */ +int parser_state; + +/* Variables to manage the task of reading here documents, because we need to + defer the reading until after a complete command has been collected. */ +static REDIRECT *redir_stack[10]; +int need_here_doc; + +/* Where shell input comes from. History expansion is performed on each + line when the shell is interactive. */ +static char *shell_input_line = (char *)NULL; +static size_t shell_input_line_index; +static size_t shell_input_line_size; /* Amount allocated for shell_input_line. */ +static size_t shell_input_line_len; /* strlen (shell_input_line) */ + +/* Either zero or EOF. */ +static int shell_input_line_terminator; + +/* The line number in a script on which a function definition starts. */ +static int function_dstart; + +/* The line number in a script on which a function body starts. */ +static int function_bstart; + +/* The line number in a script at which an arithmetic for command starts. */ +static int arith_for_lineno; + +/* The decoded prompt string. Used if READLINE is not defined or if + editing is turned off. Analogous to current_readline_prompt. */ +static char *current_decoded_prompt; + +/* The last read token, or NULL. read_token () uses this for context + checking. */ +static int last_read_token; + +/* The token read prior to last_read_token. */ +static int token_before_that; + +/* The token read prior to token_before_that. */ +static int two_tokens_ago; + +static int global_extglob; + +/* The line number in a script where the word in a `case WORD', `select WORD' + or `for WORD' begins. This is a nested command maximum, since the array + index is decremented after a case, select, or for command is parsed. */ +#define MAX_CASE_NEST 128 +static int word_lineno[MAX_CASE_NEST]; +static int word_top = -1; + +/* If non-zero, it is the token that we want read_token to return + regardless of what text is (or isn't) present to be read. This + is reset by read_token. If token_to_read == WORD or + ASSIGNMENT_WORD, yylval.word should be set to word_desc_to_read. */ +static int token_to_read; +static WORD_DESC *word_desc_to_read; + +static REDIRECTEE source; +static REDIRECTEE redir; +%} + +%union { + WORD_DESC *word; /* the word that we read. */ + int number; /* the number that we read. */ + WORD_LIST *word_list; + COMMAND *command; + REDIRECT *redirect; + ELEMENT element; + PATTERN_LIST *pattern; +} + +/* Reserved words. Members of the first group are only recognized + in the case that they are preceded by a list_terminator. Members + of the second group are for [[...]] commands. Members of the + third group are recognized only under special circumstances. */ +%token IF THEN ELSE ELIF FI CASE ESAC FOR SELECT WHILE UNTIL DO DONE FUNCTION COPROC +%token COND_START COND_END COND_ERROR +%token IN BANG TIME TIMEOPT TIMEIGN + +/* More general tokens. yylex () knows how to make these. */ +%token WORD ASSIGNMENT_WORD REDIR_WORD +%token NUMBER +%token ARITH_CMD ARITH_FOR_EXPRS +%token COND_CMD +%token AND_AND OR_OR GREATER_GREATER LESS_LESS LESS_AND LESS_LESS_LESS +%token GREATER_AND SEMI_SEMI SEMI_AND SEMI_SEMI_AND +%token LESS_LESS_MINUS AND_GREATER AND_GREATER_GREATER LESS_GREATER +%token GREATER_BAR BAR_AND + +/* The types that the various syntactical units return. */ + +%type inputunit command pipeline pipeline_command +%type list list0 list1 compound_list simple_list simple_list1 +%type simple_command shell_command +%type for_command select_command case_command group_command +%type arith_command +%type cond_command +%type arith_for_command +%type coproc +%type function_def function_body if_command elif_clause subshell +%type redirection redirection_list +%type simple_command_element +%type word_list pattern +%type pattern_list case_clause_sequence case_clause +%type timespec +%type list_terminator + +%start inputunit + +%left '&' ';' '\n' yacc_EOF +%left AND_AND OR_OR +%right '|' BAR_AND +%% + +inputunit: simple_list simple_list_terminator + { + /* Case of regular command. Discard the error + safety net,and return the command just parsed. */ + global_command = $1; + eof_encountered = 0; + /* discard_parser_constructs (0); */ + if (parser_state & PST_CMDSUBST) + parser_state |= PST_EOFTOKEN; + YYACCEPT; + } + | '\n' + { + /* Case of regular command, but not a very + interesting one. Return a NULL command. */ + global_command = (COMMAND *)NULL; + if (parser_state & PST_CMDSUBST) + parser_state |= PST_EOFTOKEN; + YYACCEPT; + } + | error '\n' + { + /* Error during parsing. Return NULL command. */ + global_command = (COMMAND *)NULL; + eof_encountered = 0; + /* discard_parser_constructs (1); */ + if (interactive && parse_and_execute_level == 0) + { + YYACCEPT; + } + else + { + YYABORT; + } + } + | yacc_EOF + { + /* Case of EOF seen by itself. Do ignoreeof or + not. */ + global_command = (COMMAND *)NULL; + handle_eof_input_unit (); + YYACCEPT; + } + ; + +word_list: WORD + { $$ = make_word_list ($1, (WORD_LIST *)NULL); } + | word_list WORD + { $$ = make_word_list ($2, $1); } + ; + +redirection: '>' WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_output_direction, redir, 0); + } + | '<' WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_input_direction, redir, 0); + } + | NUMBER '>' WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_output_direction, redir, 0); + } + | NUMBER '<' WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_input_direction, redir, 0); + } + | REDIR_WORD '>' WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_output_direction, redir, REDIR_VARASSIGN); + } + | REDIR_WORD '<' WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_input_direction, redir, REDIR_VARASSIGN); + } + | GREATER_GREATER WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_appending_to, redir, 0); + } + | NUMBER GREATER_GREATER WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_appending_to, redir, 0); + } + | REDIR_WORD GREATER_GREATER WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_appending_to, redir, REDIR_VARASSIGN); + } + | GREATER_BAR WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_output_force, redir, 0); + } + | NUMBER GREATER_BAR WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_output_force, redir, 0); + } + | REDIR_WORD GREATER_BAR WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_output_force, redir, REDIR_VARASSIGN); + } + | LESS_GREATER WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_input_output, redir, 0); + } + | NUMBER LESS_GREATER WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_input_output, redir, 0); + } + | REDIR_WORD LESS_GREATER WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_input_output, redir, REDIR_VARASSIGN); + } + | LESS_LESS WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_reading_until, redir, 0); + redir_stack[need_here_doc++] = $$; + } + | NUMBER LESS_LESS WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_reading_until, redir, 0); + redir_stack[need_here_doc++] = $$; + } + | REDIR_WORD LESS_LESS WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN); + redir_stack[need_here_doc++] = $$; + } + | LESS_LESS_MINUS WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_deblank_reading_until, redir, 0); + redir_stack[need_here_doc++] = $$; + } + | NUMBER LESS_LESS_MINUS WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_deblank_reading_until, redir, 0); + redir_stack[need_here_doc++] = $$; + } + | REDIR_WORD LESS_LESS_MINUS WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN); + redir_stack[need_here_doc++] = $$; + } + | LESS_LESS_LESS WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_reading_string, redir, 0); + } + | NUMBER LESS_LESS_LESS WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_reading_string, redir, 0); + } + | REDIR_WORD LESS_LESS_LESS WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_reading_string, redir, REDIR_VARASSIGN); + } + | LESS_AND NUMBER + { + source.dest = 0; + redir.dest = $2; + $$ = make_redirection (source, r_duplicating_input, redir, 0); + } + | NUMBER LESS_AND NUMBER + { + source.dest = $1; + redir.dest = $3; + $$ = make_redirection (source, r_duplicating_input, redir, 0); + } + | REDIR_WORD LESS_AND NUMBER + { + source.filename = $1; + redir.dest = $3; + $$ = make_redirection (source, r_duplicating_input, redir, REDIR_VARASSIGN); + } + | GREATER_AND NUMBER + { + source.dest = 1; + redir.dest = $2; + $$ = make_redirection (source, r_duplicating_output, redir, 0); + } + | NUMBER GREATER_AND NUMBER + { + source.dest = $1; + redir.dest = $3; + $$ = make_redirection (source, r_duplicating_output, redir, 0); + } + | REDIR_WORD GREATER_AND NUMBER + { + source.filename = $1; + redir.dest = $3; + $$ = make_redirection (source, r_duplicating_output, redir, REDIR_VARASSIGN); + } + | LESS_AND WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_duplicating_input_word, redir, 0); + } + | NUMBER LESS_AND WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_duplicating_input_word, redir, 0); + } + | REDIR_WORD LESS_AND WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_duplicating_input_word, redir, REDIR_VARASSIGN); + } + | GREATER_AND WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_duplicating_output_word, redir, 0); + } + | NUMBER GREATER_AND WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_duplicating_output_word, redir, 0); + } + | REDIR_WORD GREATER_AND WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_duplicating_output_word, redir, REDIR_VARASSIGN); + } + | GREATER_AND '-' + { + source.dest = 1; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, 0); + } + | NUMBER GREATER_AND '-' + { + source.dest = $1; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, 0); + } + | REDIR_WORD GREATER_AND '-' + { + source.filename = $1; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, REDIR_VARASSIGN); + } + | LESS_AND '-' + { + source.dest = 0; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, 0); + } + | NUMBER LESS_AND '-' + { + source.dest = $1; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, 0); + } + | REDIR_WORD LESS_AND '-' + { + source.filename = $1; + redir.dest = 0; + $$ = make_redirection (source, r_close_this, redir, REDIR_VARASSIGN); + } + | AND_GREATER WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_err_and_out, redir, 0); + } + | AND_GREATER_GREATER WORD + { + source.dest = 1; + redir.filename = $2; + $$ = make_redirection (source, r_append_err_and_out, redir, 0); + } + ; + +simple_command_element: WORD + { $$.word = $1; $$.redirect = 0; } + | ASSIGNMENT_WORD + { $$.word = $1; $$.redirect = 0; } + | redirection + { $$.redirect = $1; $$.word = 0; } + ; + +redirection_list: redirection + { + $$ = $1; + } + | redirection_list redirection + { + register REDIRECT *t; + + for (t = $1; t->next; t = t->next) + ; + t->next = $2; + $$ = $1; + } + ; + +simple_command: simple_command_element + { $$ = make_simple_command ($1, (COMMAND *)NULL); } + | simple_command simple_command_element + { $$ = make_simple_command ($2, $1); } + ; + +command: simple_command + { $$ = clean_simple_command ($1); } + | shell_command + { $$ = $1; } + | shell_command redirection_list + { + COMMAND *tc; + + tc = $1; + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = $2; + } + else + tc->redirects = $2; + $$ = $1; + } + | function_def + { $$ = $1; } + | coproc + { $$ = $1; } + ; + +shell_command: for_command + { $$ = $1; } + | case_command + { $$ = $1; } + | WHILE compound_list DO compound_list DONE + { $$ = make_while_command ($2, $4); } + | UNTIL compound_list DO compound_list DONE + { $$ = make_until_command ($2, $4); } + | select_command + { $$ = $1; } + | if_command + { $$ = $1; } + | subshell + { $$ = $1; } + | group_command + { $$ = $1; } + | arith_command + { $$ = $1; } + | cond_command + { $$ = $1; } + | arith_for_command + { $$ = $1; } + ; + +for_command: FOR WORD newline_list DO compound_list DONE + { + $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD newline_list '{' compound_list '}' + { + $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD ';' newline_list DO compound_list DONE + { + $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD ';' newline_list '{' compound_list '}' + { + $$ = make_for_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD newline_list IN word_list list_terminator newline_list DO compound_list DONE + { + $$ = make_for_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD newline_list IN word_list list_terminator newline_list '{' compound_list '}' + { + $$ = make_for_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD newline_list IN list_terminator newline_list DO compound_list DONE + { + $$ = make_for_command ($2, (WORD_LIST *)NULL, $8, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | FOR WORD newline_list IN list_terminator newline_list '{' compound_list '}' + { + $$ = make_for_command ($2, (WORD_LIST *)NULL, $8, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + ; + +arith_for_command: FOR ARITH_FOR_EXPRS list_terminator newline_list DO compound_list DONE + { + $$ = make_arith_for_command ($2, $6, arith_for_lineno); + if (word_top > 0) word_top--; + } + | FOR ARITH_FOR_EXPRS list_terminator newline_list '{' compound_list '}' + { + $$ = make_arith_for_command ($2, $6, arith_for_lineno); + if (word_top > 0) word_top--; + } + | FOR ARITH_FOR_EXPRS DO compound_list DONE + { + $$ = make_arith_for_command ($2, $4, arith_for_lineno); + if (word_top > 0) word_top--; + } + | FOR ARITH_FOR_EXPRS '{' compound_list '}' + { + $$ = make_arith_for_command ($2, $4, arith_for_lineno); + if (word_top > 0) word_top--; + } + ; + +select_command: SELECT WORD newline_list DO list DONE + { + $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | SELECT WORD newline_list '{' list '}' + { + $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | SELECT WORD ';' newline_list DO list DONE + { + $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | SELECT WORD ';' newline_list '{' list '}' + { + $$ = make_select_command ($2, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), $6, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | SELECT WORD newline_list IN word_list list_terminator newline_list DO list DONE + { + $$ = make_select_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | SELECT WORD newline_list IN word_list list_terminator newline_list '{' list '}' + { + $$ = make_select_command ($2, REVERSE_LIST ($5, WORD_LIST *), $9, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + ; + +case_command: CASE WORD newline_list IN newline_list ESAC + { + $$ = make_case_command ($2, (PATTERN_LIST *)NULL, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | CASE WORD newline_list IN case_clause_sequence newline_list ESAC + { + $$ = make_case_command ($2, $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + | CASE WORD newline_list IN case_clause ESAC + { + $$ = make_case_command ($2, $5, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + ; + +function_def: WORD '(' ')' newline_list function_body + { $$ = make_function_def ($1, $5, function_dstart, function_bstart); } + + | FUNCTION WORD '(' ')' newline_list function_body + { $$ = make_function_def ($2, $6, function_dstart, function_bstart); } + + | FUNCTION WORD newline_list function_body + { $$ = make_function_def ($2, $4, function_dstart, function_bstart); } + ; + +function_body: shell_command + { $$ = $1; } + | shell_command redirection_list + { + COMMAND *tc; + + tc = $1; + /* According to Posix.2 3.9.5, redirections + specified after the body of a function should + be attached to the function and performed when + the function is executed, not as part of the + function definition command. */ + /* XXX - I don't think it matters, but we might + want to change this in the future to avoid + problems differentiating between a function + definition with a redirection and a function + definition containing a single command with a + redirection. The two are semantically equivalent, + though -- the only difference is in how the + command printing code displays the redirections. */ + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = $2; + } + else + tc->redirects = $2; + $$ = $1; + } + ; + +subshell: '(' compound_list ')' + { + $$ = make_subshell_command ($2); + $$->flags |= CMD_WANT_SUBSHELL; + } + ; + +coproc: COPROC shell_command + { + $$ = make_coproc_command ("COPROC", $2); + $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + | COPROC shell_command redirection_list + { + COMMAND *tc; + + tc = $2; + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = $3; + } + else + tc->redirects = $3; + $$ = make_coproc_command ("COPROC", $2); + $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + | COPROC WORD shell_command + { + $$ = make_coproc_command ($2->word, $3); + $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + | COPROC WORD shell_command redirection_list + { + COMMAND *tc; + + tc = $3; + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = $4; + } + else + tc->redirects = $4; + $$ = make_coproc_command ($2->word, $3); + $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + | COPROC simple_command + { + $$ = make_coproc_command ("COPROC", clean_simple_command ($2)); + $$->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + ; + +if_command: IF compound_list THEN compound_list FI + { $$ = make_if_command ($2, $4, (COMMAND *)NULL); } + | IF compound_list THEN compound_list ELSE compound_list FI + { $$ = make_if_command ($2, $4, $6); } + | IF compound_list THEN compound_list elif_clause FI + { $$ = make_if_command ($2, $4, $5); } + ; + + +group_command: '{' compound_list '}' + { $$ = make_group_command ($2); } + ; + +arith_command: ARITH_CMD + { $$ = make_arith_command ($1); } + ; + +cond_command: COND_START COND_CMD COND_END + { $$ = $2; } + ; + +elif_clause: ELIF compound_list THEN compound_list + { $$ = make_if_command ($2, $4, (COMMAND *)NULL); } + | ELIF compound_list THEN compound_list ELSE compound_list + { $$ = make_if_command ($2, $4, $6); } + | ELIF compound_list THEN compound_list elif_clause + { $$ = make_if_command ($2, $4, $5); } + ; + +case_clause: pattern_list + | case_clause_sequence pattern_list + { $2->next = $1; $$ = $2; } + ; + +pattern_list: newline_list pattern ')' compound_list + { $$ = make_pattern_list ($2, $4); } + | newline_list pattern ')' newline_list + { $$ = make_pattern_list ($2, (COMMAND *)NULL); } + | newline_list '(' pattern ')' compound_list + { $$ = make_pattern_list ($3, $5); } + | newline_list '(' pattern ')' newline_list + { $$ = make_pattern_list ($3, (COMMAND *)NULL); } + ; + +case_clause_sequence: pattern_list SEMI_SEMI + { $$ = $1; } + | case_clause_sequence pattern_list SEMI_SEMI + { $2->next = $1; $$ = $2; } + | pattern_list SEMI_AND + { $1->flags |= CASEPAT_FALLTHROUGH; $$ = $1; } + | case_clause_sequence pattern_list SEMI_AND + { $2->flags |= CASEPAT_FALLTHROUGH; $2->next = $1; $$ = $2; } + | pattern_list SEMI_SEMI_AND + { $1->flags |= CASEPAT_TESTNEXT; $$ = $1; } + | case_clause_sequence pattern_list SEMI_SEMI_AND + { $2->flags |= CASEPAT_TESTNEXT; $2->next = $1; $$ = $2; } + ; + +pattern: WORD + { $$ = make_word_list ($1, (WORD_LIST *)NULL); } + | pattern '|' WORD + { $$ = make_word_list ($3, $1); } + ; + +/* A list allows leading or trailing newlines and + newlines as operators (equivalent to semicolons). + It must end with a newline or semicolon. + Lists are used within commands such as if, for, while. */ + +list: newline_list list0 + { + $$ = $2; + if (need_here_doc) + gather_here_documents (); + } + ; + +compound_list: list + | newline_list list1 + { + $$ = $2; + } + ; + +list0: list1 '\n' newline_list + | list1 '&' newline_list + { + if ($1->type == cm_connection) + $$ = connect_async_list ($1, (COMMAND *)NULL, '&'); + else + $$ = command_connect ($1, (COMMAND *)NULL, '&'); + } + | list1 ';' newline_list + + ; + +list1: list1 AND_AND newline_list list1 + { $$ = command_connect ($1, $4, AND_AND); } + | list1 OR_OR newline_list list1 + { $$ = command_connect ($1, $4, OR_OR); } + | list1 '&' newline_list list1 + { + if ($1->type == cm_connection) + $$ = connect_async_list ($1, $4, '&'); + else + $$ = command_connect ($1, $4, '&'); + } + | list1 ';' newline_list list1 + { $$ = command_connect ($1, $4, ';'); } + | list1 '\n' newline_list list1 + { $$ = command_connect ($1, $4, ';'); } + | pipeline_command + { $$ = $1; } + ; + +simple_list_terminator: '\n' + | yacc_EOF + ; + +list_terminator:'\n' + { $$ = '\n'; } + | ';' + { $$ = ';'; } + | yacc_EOF + { $$ = yacc_EOF; } + ; + +newline_list: + | newline_list '\n' + ; + +/* A simple_list is a list that contains no significant newlines + and no leading or trailing newlines. Newlines are allowed + only following operators, where they are not significant. + + This is what an inputunit consists of. */ + +simple_list: simple_list1 + { + $$ = $1; + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = $1; + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + | simple_list1 '&' + { + if ($1->type == cm_connection) + $$ = connect_async_list ($1, (COMMAND *)NULL, '&'); + else + $$ = command_connect ($1, (COMMAND *)NULL, '&'); + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = $1; + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + | simple_list1 ';' + { + $$ = $1; + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = $1; + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + ; + +simple_list1: simple_list1 AND_AND newline_list simple_list1 + { $$ = command_connect ($1, $4, AND_AND); } + | simple_list1 OR_OR newline_list simple_list1 + { $$ = command_connect ($1, $4, OR_OR); } + | simple_list1 '&' simple_list1 + { + if ($1->type == cm_connection) + $$ = connect_async_list ($1, $3, '&'); + else + $$ = command_connect ($1, $3, '&'); + } + | simple_list1 ';' simple_list1 + { $$ = command_connect ($1, $3, ';'); } + + | pipeline_command + { $$ = $1; } + ; + +pipeline_command: pipeline + { $$ = $1; } + | BANG pipeline_command + { + if ($2) + $2->flags ^= CMD_INVERT_RETURN; /* toggle */ + $$ = $2; + } + | timespec pipeline_command + { + if ($2) + $2->flags |= $1; + $$ = $2; + } + | timespec list_terminator + { + ELEMENT x; + + /* Boy, this is unclean. `time' by itself can + time a null command. We cheat and push a + newline back if the list_terminator was a newline + to avoid the double-newline problem (one to + terminate this, one to terminate the command) */ + x.word = 0; + x.redirect = 0; + $$ = make_simple_command (x, (COMMAND *)NULL); + $$->flags |= $1; + /* XXX - let's cheat and push a newline back */ + if ($2 == '\n') + token_to_read = '\n'; + } + | BANG list_terminator + { + ELEMENT x; + + /* This is just as unclean. Posix says that `!' + by itself should be equivalent to `false'. + We cheat and push a + newline back if the list_terminator was a newline + to avoid the double-newline problem (one to + terminate this, one to terminate the command) */ + x.word = 0; + x.redirect = 0; + $$ = make_simple_command (x, (COMMAND *)NULL); + $$->flags |= CMD_INVERT_RETURN; + /* XXX - let's cheat and push a newline back */ + if ($2 == '\n') + token_to_read = '\n'; + } + ; + +pipeline: pipeline '|' newline_list pipeline + { $$ = command_connect ($1, $4, '|'); } + | pipeline BAR_AND newline_list pipeline + { + /* Make cmd1 |& cmd2 equivalent to cmd1 2>&1 | cmd2 */ + COMMAND *tc; + REDIRECTEE rd, sd; + REDIRECT *r; + + tc = $1->type == cm_simple ? (COMMAND *)$1->value.Simple : $1; + sd.dest = 2; + rd.dest = 1; + r = make_redirection (sd, r_duplicating_output, rd, 0); + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = r; + } + else + tc->redirects = r; + + $$ = command_connect ($1, $4, '|'); + } + | command + { $$ = $1; } + ; + +timespec: TIME + { $$ = CMD_TIME_PIPELINE; } + | TIME TIMEOPT + { $$ = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } + | TIME TIMEOPT TIMEIGN + { $$ = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } + ; +%% + +/* Initial size to allocate for tokens, and the + amount to grow them by. */ +#define TOKEN_DEFAULT_INITIAL_SIZE 496 +#define TOKEN_DEFAULT_GROW_SIZE 512 + +/* Should we call prompt_again? */ +#define SHOULD_PROMPT() \ + (interactive && (bash_input.type == st_stdin || bash_input.type == st_stream)) + +#if defined (ALIAS) +# define expanding_alias() (pushed_string_list && pushed_string_list->expander) +#else +# define expanding_alias() 0 +#endif + +/* Global var is non-zero when end of file has been reached. */ +int EOF_Reached = 0; + +#ifdef DEBUG +static void +debug_parser (i) + int i; +{ +#if YYDEBUG != 0 + yydebug = i; +#endif +} +#endif + +/* yy_getc () returns the next available character from input or EOF. + yy_ungetc (c) makes `c' the next character to read. + init_yy_io (get, unget, type, location) makes the function GET the + installed function for getting the next character, makes UNGET the + installed function for un-getting a character, sets the type of stream + (either string or file) from TYPE, and makes LOCATION point to where + the input is coming from. */ + +/* Unconditionally returns end-of-file. */ +int +return_EOF () +{ + return (EOF); +} + +/* Variable containing the current get and unget functions. + See ./input.h for a clearer description. */ +BASH_INPUT bash_input; + +/* Set all of the fields in BASH_INPUT to NULL. Free bash_input.name if it + is non-null, avoiding a memory leak. */ +void +initialize_bash_input () +{ + bash_input.type = st_none; + FREE (bash_input.name); + bash_input.name = (char *)NULL; + bash_input.location.file = (FILE *)NULL; + bash_input.location.string = (char *)NULL; + bash_input.getter = (sh_cget_func_t *)NULL; + bash_input.ungetter = (sh_cunget_func_t *)NULL; +} + +/* Set the contents of the current bash input stream from + GET, UNGET, TYPE, NAME, and LOCATION. */ +void +init_yy_io (get, unget, type, name, location) + sh_cget_func_t *get; + sh_cunget_func_t *unget; + enum stream_type type; + const char *name; + INPUT_STREAM location; +{ + bash_input.type = type; + FREE (bash_input.name); + bash_input.name = name ? savestring (name) : (char *)NULL; + + /* XXX */ +#if defined (CRAY) + memcpy((char *)&bash_input.location.string, (char *)&location.string, sizeof(location)); +#else + bash_input.location = location; +#endif + bash_input.getter = get; + bash_input.ungetter = unget; +} + +char * +yy_input_name () +{ + return (bash_input.name ? bash_input.name : "stdin"); +} + +/* Call this to get the next character of input. */ +static int +yy_getc () +{ + return (*(bash_input.getter)) (); +} + +/* Call this to unget C. That is, to make C the next character + to be read. */ +static int +yy_ungetc (c) + int c; +{ + return (*(bash_input.ungetter)) (c); +} + +#if defined (BUFFERED_INPUT) +#ifdef INCLUDE_UNUSED +int +input_file_descriptor () +{ + switch (bash_input.type) + { + case st_stream: + return (fileno (bash_input.location.file)); + case st_bstream: + return (bash_input.location.buffered_fd); + case st_stdin: + default: + return (fileno (stdin)); + } +} +#endif +#endif /* BUFFERED_INPUT */ + +/* **************************************************************** */ +/* */ +/* Let input be read from readline (). */ +/* */ +/* **************************************************************** */ + +#if defined (READLINE) +char *current_readline_prompt = (char *)NULL; +char *current_readline_line = (char *)NULL; +int current_readline_line_index = 0; + +static int +yy_readline_get () +{ + SigHandler *old_sigint; + int line_len; + unsigned char c; + + if (!current_readline_line) + { + if (!bash_readline_initialized) + initialize_readline (); + +#if defined (JOB_CONTROL) + if (job_control) + give_terminal_to (shell_pgrp, 0); +#endif /* JOB_CONTROL */ + + old_sigint = (SigHandler *)IMPOSSIBLE_TRAP_HANDLER; + if (signal_is_ignored (SIGINT) == 0) + { + /* interrupt_immediately++; */ + old_sigint = (SigHandler *)set_signal_handler (SIGINT, sigint_sighandler); + } + + current_readline_line = readline (current_readline_prompt ? + current_readline_prompt : ""); + + CHECK_TERMSIG; + if (signal_is_ignored (SIGINT) == 0) + { + /* interrupt_immediately--; */ + if (old_sigint != IMPOSSIBLE_TRAP_HANDLER) + set_signal_handler (SIGINT, old_sigint); + } + +#if 0 + /* Reset the prompt to the decoded value of prompt_string_pointer. */ + reset_readline_prompt (); +#endif + + if (current_readline_line == 0) + return (EOF); + + current_readline_line_index = 0; + line_len = strlen (current_readline_line); + + current_readline_line = (char *)xrealloc (current_readline_line, 2 + line_len); + current_readline_line[line_len++] = '\n'; + current_readline_line[line_len] = '\0'; + } + + if (current_readline_line[current_readline_line_index] == 0) + { + free (current_readline_line); + current_readline_line = (char *)NULL; + return (yy_readline_get ()); + } + else + { + c = current_readline_line[current_readline_line_index++]; + return (c); + } +} + +static int +yy_readline_unget (c) + int c; +{ + if (current_readline_line_index && current_readline_line) + current_readline_line[--current_readline_line_index] = c; + return (c); +} + +void +with_input_from_stdin () +{ + INPUT_STREAM location; + + if (bash_input.type != st_stdin && stream_on_stack (st_stdin) == 0) + { + location.string = current_readline_line; + init_yy_io (yy_readline_get, yy_readline_unget, + st_stdin, "readline stdin", location); + } +} + +#else /* !READLINE */ + +void +with_input_from_stdin () +{ + with_input_from_stream (stdin, "stdin"); +} +#endif /* !READLINE */ + +/* **************************************************************** */ +/* */ +/* Let input come from STRING. STRING is zero terminated. */ +/* */ +/* **************************************************************** */ + +static int +yy_string_get () +{ + register char *string; + register unsigned char c; + + string = bash_input.location.string; + + /* If the string doesn't exist, or is empty, EOF found. */ + if (string && *string) + { + c = *string++; + bash_input.location.string = string; + return (c); + } + else + return (EOF); +} + +static int +yy_string_unget (c) + int c; +{ + *(--bash_input.location.string) = c; + return (c); +} + +void +with_input_from_string (string, name) + char *string; + const char *name; +{ + INPUT_STREAM location; + + location.string = string; + init_yy_io (yy_string_get, yy_string_unget, st_string, name, location); +} + +/* Count the number of characters we've consumed from bash_input.location.string + and read into shell_input_line, but have not returned from shell_getc. + That is the true input location. Rewind bash_input.location.string by + that number of characters, so it points to the last character actually + consumed by the parser. */ +static void +rewind_input_string () +{ + int xchars; + + /* number of unconsumed characters in the input -- XXX need to take newlines + into account, e.g., $(...\n) */ + xchars = shell_input_line_len - shell_input_line_index; + if (bash_input.location.string[-1] == '\n') + xchars++; + + /* XXX - how to reflect bash_input.location.string back to string passed to + parse_and_execute or xparse_dolparen? xparse_dolparen needs to know how + far into the string we parsed. parse_and_execute knows where bash_input. + location.string is, and how far from orig_string that is -- that's the + number of characters the command consumed. */ + + /* bash_input.location.string - xchars should be where we parsed to */ + /* need to do more validation on xchars value for sanity -- test cases. */ + bash_input.location.string -= xchars; +} + +/* **************************************************************** */ +/* */ +/* Let input come from STREAM. */ +/* */ +/* **************************************************************** */ + +/* These two functions used to test the value of the HAVE_RESTARTABLE_SYSCALLS + define, and just use getc/ungetc if it was defined, but since bash + installs its signal handlers without the SA_RESTART flag, some signals + (like SIGCHLD, SIGWINCH, etc.) received during a read(2) will not cause + the read to be restarted. We need to restart it ourselves. */ + +static int +yy_stream_get () +{ + int result; + + result = EOF; + if (bash_input.location.file) + { +#if 0 + if (interactive) + interrupt_immediately++; +#endif + + /* XXX - don't need terminate_immediately; getc_with_restart checks + for terminating signals itself if read returns < 0 */ + result = getc_with_restart (bash_input.location.file); + +#if 0 + if (interactive) + interrupt_immediately--; +#endif + } + return (result); +} + +static int +yy_stream_unget (c) + int c; +{ + return (ungetc_with_restart (c, bash_input.location.file)); +} + +void +with_input_from_stream (stream, name) + FILE *stream; + const char *name; +{ + INPUT_STREAM location; + + location.file = stream; + init_yy_io (yy_stream_get, yy_stream_unget, st_stream, name, location); +} + +typedef struct stream_saver { + struct stream_saver *next; + BASH_INPUT bash_input; + int line; +#if defined (BUFFERED_INPUT) + BUFFERED_STREAM *bstream; +#endif /* BUFFERED_INPUT */ +} STREAM_SAVER; + +/* The globally known line number. */ +int line_number = 0; + +/* The line number offset set by assigning to LINENO. Not currently used. */ +int line_number_base = 0; + +#if defined (COND_COMMAND) +static int cond_lineno; +static int cond_token; +#endif + +STREAM_SAVER *stream_list = (STREAM_SAVER *)NULL; + +void +push_stream (reset_lineno) + int reset_lineno; +{ + STREAM_SAVER *saver = (STREAM_SAVER *)xmalloc (sizeof (STREAM_SAVER)); + + xbcopy ((char *)&bash_input, (char *)&(saver->bash_input), sizeof (BASH_INPUT)); + +#if defined (BUFFERED_INPUT) + saver->bstream = (BUFFERED_STREAM *)NULL; + /* If we have a buffered stream, clear out buffers[fd]. */ + if (bash_input.type == st_bstream && bash_input.location.buffered_fd >= 0) + saver->bstream = set_buffered_stream (bash_input.location.buffered_fd, + (BUFFERED_STREAM *)NULL); +#endif /* BUFFERED_INPUT */ + + saver->line = line_number; + bash_input.name = (char *)NULL; + saver->next = stream_list; + stream_list = saver; + EOF_Reached = 0; + if (reset_lineno) + line_number = 0; +} + +void +pop_stream () +{ + if (!stream_list) + EOF_Reached = 1; + else + { + STREAM_SAVER *saver = stream_list; + + EOF_Reached = 0; + stream_list = stream_list->next; + + init_yy_io (saver->bash_input.getter, + saver->bash_input.ungetter, + saver->bash_input.type, + saver->bash_input.name, + saver->bash_input.location); + +#if defined (BUFFERED_INPUT) + /* If we have a buffered stream, restore buffers[fd]. */ + /* If the input file descriptor was changed while this was on the + save stack, update the buffered fd to the new file descriptor and + re-establish the buffer <-> bash_input fd correspondence. */ + if (bash_input.type == st_bstream && bash_input.location.buffered_fd >= 0) + { + if (bash_input_fd_changed) + { + bash_input_fd_changed = 0; + if (default_buffered_input >= 0) + { + bash_input.location.buffered_fd = default_buffered_input; + saver->bstream->b_fd = default_buffered_input; + SET_CLOSE_ON_EXEC (default_buffered_input); + } + } + /* XXX could free buffered stream returned as result here. */ + set_buffered_stream (bash_input.location.buffered_fd, saver->bstream); + } +#endif /* BUFFERED_INPUT */ + + line_number = saver->line; + + FREE (saver->bash_input.name); + free (saver); + } +} + +/* Return 1 if a stream of type TYPE is saved on the stack. */ +int +stream_on_stack (type) + enum stream_type type; +{ + register STREAM_SAVER *s; + + for (s = stream_list; s; s = s->next) + if (s->bash_input.type == type) + return 1; + return 0; +} + +/* Save the current token state and return it in a malloced array. */ +int * +save_token_state () +{ + int *ret; + + ret = (int *)xmalloc (4 * sizeof (int)); + ret[0] = last_read_token; + ret[1] = token_before_that; + ret[2] = two_tokens_ago; + ret[3] = current_token; + return ret; +} + +void +restore_token_state (ts) + int *ts; +{ + if (ts == 0) + return; + last_read_token = ts[0]; + token_before_that = ts[1]; + two_tokens_ago = ts[2]; + current_token = ts[3]; +} + +/* + * This is used to inhibit alias expansion and reserved word recognition + * inside case statement pattern lists. A `case statement pattern list' is: + * + * everything between the `in' in a `case word in' and the next ')' + * or `esac' + * everything between a `;;' and the next `)' or `esac' + */ + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + +#define END_OF_ALIAS 0 + +/* + * Pseudo-global variables used in implementing token-wise alias expansion. + */ + +/* + * Pushing and popping strings. This works together with shell_getc to + * implement alias expansion on a per-token basis. + */ + +#define PSH_ALIAS 0x01 +#define PSH_DPAREN 0x02 +#define PSH_SOURCE 0x04 + +typedef struct string_saver { + struct string_saver *next; + int expand_alias; /* Value to set expand_alias to when string is popped. */ + char *saved_line; +#if defined (ALIAS) + alias_t *expander; /* alias that caused this line to be pushed. */ +#endif + size_t saved_line_size, saved_line_index; + int saved_line_terminator; + int flags; +} STRING_SAVER; + +STRING_SAVER *pushed_string_list = (STRING_SAVER *)NULL; + +/* + * Push the current shell_input_line onto a stack of such lines and make S + * the current input. Used when expanding aliases. EXPAND is used to set + * the value of expand_next_token when the string is popped, so that the + * word after the alias in the original line is handled correctly when the + * alias expands to multiple words. TOKEN is the token that was expanded + * into S; it is saved and used to prevent infinite recursive expansion. + */ +static void +push_string (s, expand, ap) + char *s; + int expand; + alias_t *ap; +{ + STRING_SAVER *temp = (STRING_SAVER *)xmalloc (sizeof (STRING_SAVER)); + + temp->expand_alias = expand; + temp->saved_line = shell_input_line; + temp->saved_line_size = shell_input_line_size; + temp->saved_line_index = shell_input_line_index; + temp->saved_line_terminator = shell_input_line_terminator; + temp->flags = 0; +#if defined (ALIAS) + temp->expander = ap; + if (ap) + temp->flags = PSH_ALIAS; +#endif + temp->next = pushed_string_list; + pushed_string_list = temp; + +#if defined (ALIAS) + if (ap) + ap->flags |= AL_BEINGEXPANDED; +#endif + + shell_input_line = s; + shell_input_line_size = STRLEN (s); + shell_input_line_index = 0; + shell_input_line_terminator = '\0'; +#if 0 + parser_state &= ~PST_ALEXPNEXT; /* XXX */ +#endif + + set_line_mbstate (); +} + +/* + * Make the top of the pushed_string stack be the current shell input. + * Only called when there is something on the stack. Called from shell_getc + * when it thinks it has consumed the string generated by an alias expansion + * and needs to return to the original input line. + */ +static void +pop_string () +{ + STRING_SAVER *t; + + FREE (shell_input_line); + shell_input_line = pushed_string_list->saved_line; + shell_input_line_index = pushed_string_list->saved_line_index; + shell_input_line_size = pushed_string_list->saved_line_size; + shell_input_line_terminator = pushed_string_list->saved_line_terminator; + + if (pushed_string_list->expand_alias) + parser_state |= PST_ALEXPNEXT; + else + parser_state &= ~PST_ALEXPNEXT; + + t = pushed_string_list; + pushed_string_list = pushed_string_list->next; + +#if defined (ALIAS) + if (t->expander) + t->expander->flags &= ~AL_BEINGEXPANDED; +#endif + + free ((char *)t); + + set_line_mbstate (); +} + +static void +free_string_list () +{ + register STRING_SAVER *t, *t1; + + for (t = pushed_string_list; t; ) + { + t1 = t->next; + FREE (t->saved_line); +#if defined (ALIAS) + if (t->expander) + t->expander->flags &= ~AL_BEINGEXPANDED; +#endif + free ((char *)t); + t = t1; + } + pushed_string_list = (STRING_SAVER *)NULL; +} + +#endif /* ALIAS || DPAREN_ARITHMETIC */ + +void +free_pushed_string_input () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + free_string_list (); +#endif +} + +int +parser_expanding_alias () +{ + return (expanding_alias ()); +} + +void +parser_save_alias () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + push_string ((char *)NULL, 0, (alias_t *)NULL); + pushed_string_list->flags = PSH_SOURCE; /* XXX - for now */ +#else + ; +#endif +} + +void +parser_restore_alias () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + if (pushed_string_list) + pop_string (); +#else + ; +#endif +} + +/* Return a line of text, taken from wherever yylex () reads input. + If there is no more input, then we return NULL. If REMOVE_QUOTED_NEWLINE + is non-zero, we remove unquoted \ pairs. This is used by + read_secondary_line to read here documents. */ +static char * +read_a_line (remove_quoted_newline) + int remove_quoted_newline; +{ + static char *line_buffer = (char *)NULL; + static int buffer_size = 0; + int indx, c, peekc, pass_next; + +#if defined (READLINE) + if (no_line_editing && SHOULD_PROMPT ()) +#else + if (SHOULD_PROMPT ()) +#endif + print_prompt (); + + pass_next = indx = 0; + while (1) + { + /* Allow immediate exit if interrupted during input. */ + QUIT; + + c = yy_getc (); + + /* Ignore null bytes in input. */ + if (c == 0) + { +#if 0 + internal_warning ("read_a_line: ignored null byte in input"); +#endif + continue; + } + + /* If there is no more input, then we return NULL. */ + if (c == EOF) + { + if (interactive && bash_input.type == st_stream) + clearerr (stdin); + if (indx == 0) + return ((char *)NULL); + c = '\n'; + } + + /* `+2' in case the final character in the buffer is a newline. */ + RESIZE_MALLOCED_BUFFER (line_buffer, indx, 2, buffer_size, 128); + + /* IF REMOVE_QUOTED_NEWLINES is non-zero, we are reading a + here document with an unquoted delimiter. In this case, + the line will be expanded as if it were in double quotes. + We allow a backslash to escape the next character, but we + need to treat the backslash specially only if a backslash + quoting a backslash-newline pair appears in the line. */ + if (pass_next) + { + line_buffer[indx++] = c; + pass_next = 0; + } + else if (c == '\\' && remove_quoted_newline) + { + QUIT; + peekc = yy_getc (); + if (peekc == '\n') + { + line_number++; + continue; /* Make the unquoted \ pair disappear. */ + } + else + { + yy_ungetc (peekc); + pass_next = 1; + line_buffer[indx++] = c; /* Preserve the backslash. */ + } + } + else + line_buffer[indx++] = c; + + if (c == '\n') + { + line_buffer[indx] = '\0'; + return (line_buffer); + } + } +} + +/* Return a line as in read_a_line (), but insure that the prompt is + the secondary prompt. This is used to read the lines of a here + document. REMOVE_QUOTED_NEWLINE is non-zero if we should remove + newlines quoted with backslashes while reading the line. It is + non-zero unless the delimiter of the here document was quoted. */ +char * +read_secondary_line (remove_quoted_newline) + int remove_quoted_newline; +{ + char *ret; + int n, c; + + prompt_string_pointer = &ps2_prompt; + if (SHOULD_PROMPT()) + prompt_again (); + ret = read_a_line (remove_quoted_newline); +#if defined (HISTORY) + if (ret && remember_on_history && (parser_state & PST_HEREDOC)) + { + /* To make adding the the here-document body right, we need to rely + on history_delimiting_chars() returning \n for the first line of + the here-document body and the null string for the second and + subsequent lines, so we avoid double newlines. + current_command_line_count == 2 for the first line of the body. */ + + current_command_line_count++; + maybe_add_history (ret); + } +#endif /* HISTORY */ + return ret; +} + +/* **************************************************************** */ +/* */ +/* YYLEX () */ +/* */ +/* **************************************************************** */ + +/* Reserved words. These are only recognized as the first word of a + command. */ +STRING_INT_ALIST word_token_alist[] = { + { "if", IF }, + { "then", THEN }, + { "else", ELSE }, + { "elif", ELIF }, + { "fi", FI }, + { "case", CASE }, + { "esac", ESAC }, + { "for", FOR }, +#if defined (SELECT_COMMAND) + { "select", SELECT }, +#endif + { "while", WHILE }, + { "until", UNTIL }, + { "do", DO }, + { "done", DONE }, + { "in", IN }, + { "function", FUNCTION }, +#if defined (COMMAND_TIMING) + { "time", TIME }, +#endif + { "{", '{' }, + { "}", '}' }, + { "!", BANG }, +#if defined (COND_COMMAND) + { "[[", COND_START }, + { "]]", COND_END }, +#endif +#if defined (COPROCESS_SUPPORT) + { "coproc", COPROC }, +#endif + { (char *)NULL, 0} +}; + +/* other tokens that can be returned by read_token() */ +STRING_INT_ALIST other_token_alist[] = { + /* Multiple-character tokens with special values */ + { "--", TIMEIGN }, + { "-p", TIMEOPT }, + { "&&", AND_AND }, + { "||", OR_OR }, + { ">>", GREATER_GREATER }, + { "<<", LESS_LESS }, + { "<&", LESS_AND }, + { ">&", GREATER_AND }, + { ";;", SEMI_SEMI }, + { ";&", SEMI_AND }, + { ";;&", SEMI_SEMI_AND }, + { "<<-", LESS_LESS_MINUS }, + { "<<<", LESS_LESS_LESS }, + { "&>", AND_GREATER }, + { "&>>", AND_GREATER_GREATER }, + { "<>", LESS_GREATER }, + { ">|", GREATER_BAR }, + { "|&", BAR_AND }, + { "EOF", yacc_EOF }, + /* Tokens whose value is the character itself */ + { ">", '>' }, + { "<", '<' }, + { "-", '-' }, + { "{", '{' }, + { "}", '}' }, + { ";", ';' }, + { "(", '(' }, + { ")", ')' }, + { "|", '|' }, + { "&", '&' }, + { "newline", '\n' }, + { (char *)NULL, 0} +}; + +/* others not listed here: + WORD look at yylval.word + ASSIGNMENT_WORD look at yylval.word + NUMBER look at yylval.number + ARITH_CMD look at yylval.word_list + ARITH_FOR_EXPRS look at yylval.word_list + COND_CMD look at yylval.command +*/ + +/* These are used by read_token_word, but appear up here so that shell_getc + can use them to decide when to add otherwise blank lines to the history. */ + +/* The primary delimiter stack. */ +struct dstack dstack = { (char *)NULL, 0, 0 }; + +/* A temporary delimiter stack to be used when decoding prompt strings. + This is needed because command substitutions in prompt strings (e.g., PS2) + can screw up the parser's quoting state. */ +static struct dstack temp_dstack = { (char *)NULL, 0, 0 }; + +/* Macro for accessing the top delimiter on the stack. Returns the + delimiter or zero if none. */ +#define current_delimiter(ds) \ + (ds.delimiter_depth ? ds.delimiters[ds.delimiter_depth - 1] : 0) + +#define push_delimiter(ds, character) \ + do \ + { \ + if (ds.delimiter_depth + 2 > ds.delimiter_space) \ + ds.delimiters = (char *)xrealloc \ + (ds.delimiters, (ds.delimiter_space += 10) * sizeof (char)); \ + ds.delimiters[ds.delimiter_depth] = character; \ + ds.delimiter_depth++; \ + } \ + while (0) + +#define pop_delimiter(ds) ds.delimiter_depth-- + +/* Return the next shell input character. This always reads characters + from shell_input_line; when that line is exhausted, it is time to + read the next line. This is called by read_token when the shell is + processing normal command input. */ + +/* This implements one-character lookahead/lookbehind across physical input + lines, to avoid something being lost because it's pushed back with + shell_ungetc when we're at the start of a line. */ +static int eol_ungetc_lookahead = 0; + +static int +shell_getc (remove_quoted_newline) + int remove_quoted_newline; +{ + register int i; + int c, truncating; + unsigned char uc; + + QUIT; + + if (sigwinch_received) + { + sigwinch_received = 0; + get_new_window_size (0, (int *)0, (int *)0); + } + + if (eol_ungetc_lookahead) + { + c = eol_ungetc_lookahead; + eol_ungetc_lookahead = 0; + return (c); + } + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* If shell_input_line[shell_input_line_index] == 0, but there is + something on the pushed list of strings, then we don't want to go + off and get another line. We let the code down below handle it. */ + + if (!shell_input_line || ((!shell_input_line[shell_input_line_index]) && + (pushed_string_list == (STRING_SAVER *)NULL))) +#else /* !ALIAS && !DPAREN_ARITHMETIC */ + if (!shell_input_line || !shell_input_line[shell_input_line_index]) +#endif /* !ALIAS && !DPAREN_ARITHMETIC */ + { + line_number++; + + /* Let's not let one really really long line blow up memory allocation */ + if (shell_input_line && shell_input_line_size >= 32768) + { + free (shell_input_line); + shell_input_line = 0; + shell_input_line_size = 0; + } + + restart_read: + + /* Allow immediate exit if interrupted during input. */ + QUIT; + + i = truncating = 0; + shell_input_line_terminator = 0; + + /* If the shell is interatctive, but not currently printing a prompt + (interactive_shell && interactive == 0), we don't want to print + notifies or cleanup the jobs -- we want to defer it until we do + print the next prompt. */ + if (interactive_shell == 0 || SHOULD_PROMPT()) + { +#if defined (JOB_CONTROL) + /* This can cause a problem when reading a command as the result + of a trap, when the trap is called from flush_child. This call + had better not cause jobs to disappear from the job table in + that case, or we will have big trouble. */ + notify_and_cleanup (); +#else /* !JOB_CONTROL */ + cleanup_dead_jobs (); +#endif /* !JOB_CONTROL */ + } + +#if defined (READLINE) + if (no_line_editing && SHOULD_PROMPT()) +#else + if (SHOULD_PROMPT()) +#endif + print_prompt (); + + if (bash_input.type == st_stream) + clearerr (stdin); + + while (1) + { + c = yy_getc (); + + /* Allow immediate exit if interrupted during input. */ + QUIT; + + if (c == '\0') + { +#if 0 + internal_warning ("shell_getc: ignored null byte in input"); +#endif + continue; + } + + /* Theoretical overflow */ + /* If we can't put 256 bytes more into the buffer, allocate + everything we can and fill it as full as we can. */ + /* XXX - we ignore rest of line using `truncating' flag */ + if (shell_input_line_size > (SIZE_MAX - 256)) + { + size_t n; + + n = SIZE_MAX - i; /* how much more can we put into the buffer? */ + if (n <= 2) /* we have to save 1 for the newline added below */ + { + if (truncating == 0) + internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%llu): line truncated", shell_input_line_size, SIZE_MAX); + shell_input_line[i] = '\0'; + truncating = 1; + } + if (shell_input_line_size < SIZE_MAX) + { + shell_input_line_size = SIZE_MAX; + shell_input_line = xrealloc (shell_input_line, shell_input_line_size); + } + } + else + RESIZE_MALLOCED_BUFFER (shell_input_line, i, 2, shell_input_line_size, 256); + + if (c == EOF) + { + if (bash_input.type == st_stream) + clearerr (stdin); + + if (i == 0) + shell_input_line_terminator = EOF; + + shell_input_line[i] = '\0'; + break; + } + + if (truncating == 0 || c == '\n') + shell_input_line[i++] = c; + + if (c == '\n') + { + shell_input_line[--i] = '\0'; + current_command_line_count++; + break; + } + } + + shell_input_line_index = 0; + shell_input_line_len = i; /* == strlen (shell_input_line) */ + + set_line_mbstate (); + +#if defined (HISTORY) + if (remember_on_history && shell_input_line && shell_input_line[0]) + { + char *expansions; +# if defined (BANG_HISTORY) + int old_hist; + + /* If the current delimiter is a single quote, we should not be + performing history expansion, even if we're on a different + line from the original single quote. */ + old_hist = history_expansion_inhibited; + if (current_delimiter (dstack) == '\'') + history_expansion_inhibited = 1; +# endif + expansions = pre_process_line (shell_input_line, 1, 1); +# if defined (BANG_HISTORY) + history_expansion_inhibited = old_hist; +# endif + if (expansions != shell_input_line) + { + free (shell_input_line); + shell_input_line = expansions; + shell_input_line_len = shell_input_line ? + strlen (shell_input_line) : 0; + if (shell_input_line_len == 0) + current_command_line_count--; + + /* We have to force the xrealloc below because we don't know + the true allocated size of shell_input_line anymore. */ + shell_input_line_size = shell_input_line_len; + + set_line_mbstate (); + } + } + /* Try to do something intelligent with blank lines encountered while + entering multi-line commands. XXX - this is grotesque */ + else if (remember_on_history && shell_input_line && + shell_input_line[0] == '\0' && + current_command_line_count > 1) + { + if (current_delimiter (dstack)) + /* We know shell_input_line[0] == 0 and we're reading some sort of + quoted string. This means we've got a line consisting of only + a newline in a quoted string. We want to make sure this line + gets added to the history. */ + maybe_add_history (shell_input_line); + else + { + char *hdcs; + hdcs = history_delimiting_chars (shell_input_line); + if (hdcs && hdcs[0] == ';') + maybe_add_history (shell_input_line); + } + } + +#endif /* HISTORY */ + + if (shell_input_line) + { + /* Lines that signify the end of the shell's input should not be + echoed. We should not echo lines while parsing command + substitutions with recursive calls into the parsing engine; those + should only be echoed once when we read the word. That is the + reason for the test against shell_eof_token, which is set to a + right paren when parsing the contents of command substitutions. */ + if (echo_input_at_read && (shell_input_line[0] || + shell_input_line_terminator != EOF) && + shell_eof_token == 0) + fprintf (stderr, "%s\n", shell_input_line); + } + else + { + shell_input_line_size = 0; + prompt_string_pointer = ¤t_prompt_string; + if (SHOULD_PROMPT ()) + prompt_again (); + goto restart_read; + } + + /* Add the newline to the end of this string, iff the string does + not already end in an EOF character. */ + if (shell_input_line_terminator != EOF) + { + if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size)) + shell_input_line = (char *)xrealloc (shell_input_line, + 1 + (shell_input_line_size += 2)); + + shell_input_line[shell_input_line_len] = '\n'; + shell_input_line[shell_input_line_len + 1] = '\0'; + + set_line_mbstate (); + } + } + +next_alias_char: + uc = shell_input_line[shell_input_line_index]; + + if (uc) + shell_input_line_index++; + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* If UC is NULL, we have reached the end of the current input string. If + pushed_string_list is non-empty, it's time to pop to the previous string + because we have fully consumed the result of the last alias expansion. + Do it transparently; just return the next character of the string popped + to. */ + /* If pushed_string_list != 0 but pushed_string_list->expander == 0 (not + currently tested) and the flags value is not PSH_SOURCE, we are not + parsing an alias, we have just saved one (push_string, when called by + the parse_dparen code) In this case, just go on as well. The PSH_SOURCE + case is handled below. */ +pop_alias: + if (uc == 0 && pushed_string_list && pushed_string_list->flags != PSH_SOURCE) + { + pop_string (); + uc = shell_input_line[shell_input_line_index]; + if (uc) + shell_input_line_index++; + } +#endif /* ALIAS || DPAREN_ARITHMETIC */ + + if MBTEST(uc == '\\' && remove_quoted_newline && shell_input_line[shell_input_line_index] == '\n') + { + if (SHOULD_PROMPT ()) + prompt_again (); + line_number++; + /* What do we do here if we're expanding an alias whose definition + includes an escaped newline? If that's the last character in the + alias expansion, we just pop the pushed string list (recall that + we inhibit the appending of a space in mk_alexpansion() if newline + is the last character). If it's not the last character, we need + to consume the quoted newline and move to the next character in + the expansion. */ +#if defined (ALIAS) + if (expanding_alias () && shell_input_line[shell_input_line_index+1] == '\0') + { + uc = 0; + goto pop_alias; + } + else if (expanding_alias () && shell_input_line[shell_input_line_index+1] != '\0') + { + shell_input_line_index++; /* skip newline */ + goto next_alias_char; /* and get next character */ + } + else +#endif + goto restart_read; + } + + if (uc == 0 && shell_input_line_terminator == EOF) + return ((shell_input_line_index != 0) ? '\n' : EOF); + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* We already know that we are not parsing an alias expansion because of the + check for expanding_alias() above. This knows how parse_and_execute + handles switching to st_string input while an alias is being expanded, + hence the check for pushed_string_list without pushed_string_list->expander + and the check for PSH_SOURCE as pushed_string_list->flags. + parse_and_execute and parse_string both change the input type to st_string + and place the string to be parsed and executed into location.string, so + we should not stop reading that until the pointer is '\0'. + The check for shell_input_line_terminator may be superfluous. + + This solves the problem of `.' inside a multi-line alias with embedded + newlines executing things out of order. */ + if (uc == 0 && bash_input.type == st_string && *bash_input.location.string && + pushed_string_list && pushed_string_list->flags == PSH_SOURCE && + shell_input_line_terminator == 0) + { + shell_input_line_index = 0; + goto restart_read; + } +#endif + + return (uc); +} + +/* Put C back into the input for the shell. This might need changes for + HANDLE_MULTIBYTE around EOLs. Since we (currently) never push back a + character different than we read, shell_input_line_property doesn't need + to change when manipulating shell_input_line. The define for + last_shell_getc_is_singlebyte should take care of it, though. */ +static void +shell_ungetc (c) + int c; +{ + if (shell_input_line && shell_input_line_index) + shell_input_line[--shell_input_line_index] = c; + else + eol_ungetc_lookahead = c; +} + +#ifdef INCLUDE_UNUSED +/* Back the input pointer up by one, effectively `ungetting' a character. */ +static void +shell_ungetchar () +{ + if (shell_input_line && shell_input_line_index) + shell_input_line_index--; +} +#endif + +/* Discard input until CHARACTER is seen, then push that character back + onto the input stream. */ +static void +discard_until (character) + int character; +{ + int c; + + while ((c = shell_getc (0)) != EOF && c != character) + ; + + if (c != EOF) + shell_ungetc (c); +} + +void +execute_variable_command (command, vname) + char *command, *vname; +{ + char *last_lastarg; + sh_parser_state_t ps; + + save_parser_state (&ps); + last_lastarg = get_string_value ("_"); + if (last_lastarg) + last_lastarg = savestring (last_lastarg); + + parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEVAL_NOHIST); + + restore_parser_state (&ps); + bind_variable ("_", last_lastarg, 0); + FREE (last_lastarg); + + if (token_to_read == '\n') /* reset_parser was called */ + token_to_read = 0; +} + +/* Place to remember the token. We try to keep the buffer + at a reasonable size, but it can grow. */ +static char *token = (char *)NULL; + +/* Current size of the token buffer. */ +static int token_buffer_size; + +/* Command to read_token () explaining what we want it to do. */ +#define READ 0 +#define RESET 1 +#define prompt_is_ps1 \ + (!prompt_string_pointer || prompt_string_pointer == &ps1_prompt) + +/* Function for yyparse to call. yylex keeps track of + the last two tokens read, and calls read_token. */ +static int +yylex () +{ + if (interactive && (current_token == 0 || current_token == '\n')) + { + /* Before we print a prompt, we might have to check mailboxes. + We do this only if it is time to do so. Notice that only here + is the mail alarm reset; nothing takes place in check_mail () + except the checking of mail. Please don't change this. */ + if (prompt_is_ps1 && parse_and_execute_level == 0 && time_to_check_mail ()) + { + check_mail (); + reset_mail_timer (); + } + + /* Avoid printing a prompt if we're not going to read anything, e.g. + after resetting the parser with read_token (RESET). */ + if (token_to_read == 0 && SHOULD_PROMPT ()) + prompt_again (); + } + + two_tokens_ago = token_before_that; + token_before_that = last_read_token; + last_read_token = current_token; + current_token = read_token (READ); + + if ((parser_state & PST_EOFTOKEN) && current_token == shell_eof_token) + { + current_token = yacc_EOF; + if (bash_input.type == st_string) + rewind_input_string (); + } + parser_state &= ~PST_EOFTOKEN; + + return (current_token); +} + +/* When non-zero, we have read the required tokens + which allow ESAC to be the next one read. */ +static int esacs_needed_count; + +void +gather_here_documents () +{ + int r; + + r = 0; + while (need_here_doc > 0) + { + parser_state |= PST_HEREDOC; + make_here_document (redir_stack[r++], line_number); + parser_state &= ~PST_HEREDOC; + need_here_doc--; + } +} + +/* When non-zero, an open-brace used to create a group is awaiting a close + brace partner. */ +static int open_brace_count; + +#define command_token_position(token) \ + (((token) == ASSIGNMENT_WORD) || (parser_state&PST_REDIRLIST) || \ + ((token) != SEMI_SEMI && (token) != SEMI_AND && (token) != SEMI_SEMI_AND && reserved_word_acceptable(token))) + +#define assignment_acceptable(token) \ + (command_token_position(token) && ((parser_state & PST_CASEPAT) == 0)) + +/* Check to see if TOKEN is a reserved word and return the token + value if it is. */ +#define CHECK_FOR_RESERVED_WORD(tok) \ + do { \ + if (!dollar_present && !quoted && \ + reserved_word_acceptable (last_read_token)) \ + { \ + int i; \ + for (i = 0; word_token_alist[i].word != (char *)NULL; i++) \ + if (STREQ (tok, word_token_alist[i].word)) \ + { \ + if ((parser_state & PST_CASEPAT) && (word_token_alist[i].token != ESAC)) \ + break; \ + if (word_token_alist[i].token == TIME && time_command_acceptable () == 0) \ + break; \ + if (word_token_alist[i].token == ESAC) \ + parser_state &= ~(PST_CASEPAT|PST_CASESTMT); \ + else if (word_token_alist[i].token == CASE) \ + parser_state |= PST_CASESTMT; \ + else if (word_token_alist[i].token == COND_END) \ + parser_state &= ~(PST_CONDCMD|PST_CONDEXPR); \ + else if (word_token_alist[i].token == COND_START) \ + parser_state |= PST_CONDCMD; \ + else if (word_token_alist[i].token == '{') \ + open_brace_count++; \ + else if (word_token_alist[i].token == '}' && open_brace_count) \ + open_brace_count--; \ + return (word_token_alist[i].token); \ + } \ + } \ + } while (0) + +#if defined (ALIAS) + + /* OK, we have a token. Let's try to alias expand it, if (and only if) + it's eligible. + + It is eligible for expansion if EXPAND_ALIASES is set, and + the token is unquoted and the last token read was a command + separator (or expand_next_token is set), and we are currently + processing an alias (pushed_string_list is non-empty) and this + token is not the same as the current or any previously + processed alias. + + Special cases that disqualify: + In a pattern list in a case statement (parser_state & PST_CASEPAT). */ + +static char * +mk_alexpansion (s) + char *s; +{ + int l; + char *r; + + l = strlen (s); + r = xmalloc (l + 2); + strcpy (r, s); + /* If the last character in the alias is a newline, don't add a trailing + space to the expansion. Works with shell_getc above. */ + if (r[l - 1] != ' ' && r[l - 1] != '\n') + r[l++] = ' '; + r[l] = '\0'; + return r; +} + +static int +alias_expand_token (tokstr) + char *tokstr; +{ + char *expanded; + alias_t *ap; + + if (((parser_state & PST_ALEXPNEXT) || command_token_position (last_read_token)) && + (parser_state & PST_CASEPAT) == 0) + { + ap = find_alias (tokstr); + + /* Currently expanding this token. */ + if (ap && (ap->flags & AL_BEINGEXPANDED)) + return (NO_EXPANSION); + + /* mk_alexpansion puts an extra space on the end of the alias expansion, + so the lookahead by the parser works right. If this gets changed, + make sure the code in shell_getc that deals with reaching the end of + an expanded alias is changed with it. */ + expanded = ap ? mk_alexpansion (ap->value) : (char *)NULL; + + if (expanded) + { + push_string (expanded, ap->flags & AL_EXPANDNEXT, ap); + return (RE_READ_TOKEN); + } + else + /* This is an eligible token that does not have an expansion. */ + return (NO_EXPANSION); + } + return (NO_EXPANSION); +} +#endif /* ALIAS */ + +static int +time_command_acceptable () +{ +#if defined (COMMAND_TIMING) + int i; + + if (posixly_correct && shell_compatibility_level > 41) + { + /* Quick check of the rest of the line to find the next token. If it + begins with a `-', Posix says to not return `time' as the token. + This was interp 267. */ + i = shell_input_line_index; + while (i < shell_input_line_len && (shell_input_line[i] == ' ' || shell_input_line[i] == '\t')) + i++; + if (shell_input_line[i] == '-') + return 0; + } + + switch (last_read_token) + { + case 0: + case ';': + case '\n': + case AND_AND: + case OR_OR: + case '&': + case DO: + case THEN: + case ELSE: + case '{': /* } */ + case '(': /* ) */ + case BANG: /* ! time pipeline */ + case TIME: /* time time pipeline */ + case TIMEOPT: /* time -p time pipeline */ + case TIMEIGN: /* time -p -- ... */ + return 1; + default: + return 0; + } +#else + return 0; +#endif /* COMMAND_TIMING */ +} + +/* Handle special cases of token recognition: + IN is recognized if the last token was WORD and the token + before that was FOR or CASE or SELECT. + + DO is recognized if the last token was WORD and the token + before that was FOR or SELECT. + + ESAC is recognized if the last token caused `esacs_needed_count' + to be set + + `{' is recognized if the last token as WORD and the token + before that was FUNCTION, or if we just parsed an arithmetic + `for' command. + + `}' is recognized if there is an unclosed `{' present. + + `-p' is returned as TIMEOPT if the last read token was TIME. + `--' is returned as TIMEIGN if the last read token was TIMEOPT. + + ']]' is returned as COND_END if the parser is currently parsing + a conditional expression ((parser_state & PST_CONDEXPR) != 0) + + `time' is returned as TIME if and only if it is immediately + preceded by one of `;', `\n', `||', `&&', or `&'. +*/ + +static int +special_case_tokens (tokstr) + char *tokstr; +{ + if ((last_read_token == WORD) && +#if defined (SELECT_COMMAND) + ((token_before_that == FOR) || (token_before_that == CASE) || (token_before_that == SELECT)) && +#else + ((token_before_that == FOR) || (token_before_that == CASE)) && +#endif + (tokstr[0] == 'i' && tokstr[1] == 'n' && tokstr[2] == 0)) + { + if (token_before_that == CASE) + { + parser_state |= PST_CASEPAT; + esacs_needed_count++; + } + return (IN); + } + + if (last_read_token == WORD && +#if defined (SELECT_COMMAND) + (token_before_that == FOR || token_before_that == SELECT) && +#else + (token_before_that == FOR) && +#endif + (tokstr[0] == 'd' && tokstr[1] == 'o' && tokstr[2] == '\0')) + return (DO); + + /* Ditto for ESAC in the CASE case. + Specifically, this handles "case word in esac", which is a legal + construct, certainly because someone will pass an empty arg to the + case construct, and we don't want it to barf. Of course, we should + insist that the case construct has at least one pattern in it, but + the designers disagree. */ + if (esacs_needed_count) + { + esacs_needed_count--; + if (STREQ (tokstr, "esac")) + { + parser_state &= ~PST_CASEPAT; + return (ESAC); + } + } + + /* The start of a shell function definition. */ + if (parser_state & PST_ALLOWOPNBRC) + { + parser_state &= ~PST_ALLOWOPNBRC; + if (tokstr[0] == '{' && tokstr[1] == '\0') /* } */ + { + open_brace_count++; + function_bstart = line_number; + return ('{'); /* } */ + } + } + + /* We allow a `do' after a for ((...)) without an intervening + list_terminator */ + if (last_read_token == ARITH_FOR_EXPRS && tokstr[0] == 'd' && tokstr[1] == 'o' && !tokstr[2]) + return (DO); + if (last_read_token == ARITH_FOR_EXPRS && tokstr[0] == '{' && tokstr[1] == '\0') /* } */ + { + open_brace_count++; + return ('{'); /* } */ + } + + if (open_brace_count && reserved_word_acceptable (last_read_token) && tokstr[0] == '}' && !tokstr[1]) + { + open_brace_count--; /* { */ + return ('}'); + } + +#if defined (COMMAND_TIMING) + /* Handle -p after `time'. */ + if (last_read_token == TIME && tokstr[0] == '-' && tokstr[1] == 'p' && !tokstr[2]) + return (TIMEOPT); + /* Handle -- after `time -p'. */ + if (last_read_token == TIMEOPT && tokstr[0] == '-' && tokstr[1] == '-' && !tokstr[2]) + return (TIMEIGN); +#endif + +#if defined (COND_COMMAND) /* [[ */ + if ((parser_state & PST_CONDEXPR) && tokstr[0] == ']' && tokstr[1] == ']' && tokstr[2] == '\0') + return (COND_END); +#endif + + return (-1); +} + +/* Called from shell.c when Control-C is typed at top level. Or + by the error rule at top level. */ +void +reset_parser () +{ + dstack.delimiter_depth = 0; /* No delimiters found so far. */ + open_brace_count = 0; + +#if defined (EXTENDED_GLOB) + /* Reset to global value of extended glob */ + if (parser_state & PST_EXTPAT) + extended_glob = global_extglob; +#endif + + parser_state = 0; + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + if (pushed_string_list) + free_string_list (); +#endif /* ALIAS || DPAREN_ARITHMETIC */ + + if (shell_input_line) + { + free (shell_input_line); + shell_input_line = (char *)NULL; + shell_input_line_size = shell_input_line_index = 0; + } + + FREE (word_desc_to_read); + word_desc_to_read = (WORD_DESC *)NULL; + + current_token = '\n'; /* XXX */ + last_read_token = '\n'; + token_to_read = '\n'; +} + +/* Read the next token. Command can be READ (normal operation) or + RESET (to normalize state). */ +static int +read_token (command) + int command; +{ + int character; /* Current character. */ + int peek_char; /* Temporary look-ahead character. */ + int result; /* The thing to return. */ + + if (command == RESET) + { + reset_parser (); + return ('\n'); + } + + if (token_to_read) + { + result = token_to_read; + if (token_to_read == WORD || token_to_read == ASSIGNMENT_WORD) + { + yylval.word = word_desc_to_read; + word_desc_to_read = (WORD_DESC *)NULL; + } + token_to_read = 0; + return (result); + } + +#if defined (COND_COMMAND) + if ((parser_state & (PST_CONDCMD|PST_CONDEXPR)) == PST_CONDCMD) + { + cond_lineno = line_number; + parser_state |= PST_CONDEXPR; + yylval.command = parse_cond_command (); + if (cond_token != COND_END) + { + cond_error (); + return (-1); + } + token_to_read = COND_END; + parser_state &= ~(PST_CONDEXPR|PST_CONDCMD); + return (COND_CMD); + } +#endif + +#if defined (ALIAS) + /* This is a place to jump back to once we have successfully expanded a + token with an alias and pushed the string with push_string () */ + re_read_token: +#endif /* ALIAS */ + + /* Read a single word from input. Start by skipping blanks. */ + while ((character = shell_getc (1)) != EOF && shellblank (character)) + ; + + if (character == EOF) + { + EOF_Reached = 1; + return (yacc_EOF); + } + + if MBTEST(character == '#' && (!interactive || interactive_comments)) + { + /* A comment. Discard until EOL or EOF, and then return a newline. */ + discard_until ('\n'); + shell_getc (0); + character = '\n'; /* this will take the next if statement and return. */ + } + + if (character == '\n') + { + /* If we're about to return an unquoted newline, we can go and collect + the text of any pending here document. */ + if (need_here_doc) + gather_here_documents (); + +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + parser_state &= ~PST_ASSIGNOK; + + return (character); + } + + if (parser_state & PST_REGEXP) + goto tokword; + + /* Shell meta-characters. */ + if MBTEST(shellmeta (character) && ((parser_state & PST_DBLPAREN) == 0)) + { +#if defined (ALIAS) + /* Turn off alias tokenization iff this character sequence would + not leave us ready to read a command. */ + if (character == '<' || character == '>') + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + parser_state &= ~PST_ASSIGNOK; + + peek_char = shell_getc (1); + if (character == peek_char) + { + switch (character) + { + case '<': + /* If '<' then we could be at "<<" or at "<<-". We have to + look ahead one more character. */ + peek_char = shell_getc (1); + if MBTEST(peek_char == '-') + return (LESS_LESS_MINUS); + else if MBTEST(peek_char == '<') + return (LESS_LESS_LESS); + else + { + shell_ungetc (peek_char); + return (LESS_LESS); + } + + case '>': + return (GREATER_GREATER); + + case ';': + parser_state |= PST_CASEPAT; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + peek_char = shell_getc (1); + if MBTEST(peek_char == '&') + return (SEMI_SEMI_AND); + else + { + shell_ungetc (peek_char); + return (SEMI_SEMI); + } + + case '&': + return (AND_AND); + + case '|': + return (OR_OR); + +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) + case '(': /* ) */ + result = parse_dparen (character); + if (result == -2) + break; + else + return result; +#endif + } + } + else if MBTEST(character == '<' && peek_char == '&') + return (LESS_AND); + else if MBTEST(character == '>' && peek_char == '&') + return (GREATER_AND); + else if MBTEST(character == '<' && peek_char == '>') + return (LESS_GREATER); + else if MBTEST(character == '>' && peek_char == '|') + return (GREATER_BAR); + else if MBTEST(character == '&' && peek_char == '>') + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '>') + return (AND_GREATER_GREATER); + else + { + shell_ungetc (peek_char); + return (AND_GREATER); + } + } + else if MBTEST(character == '|' && peek_char == '&') + return (BAR_AND); + else if MBTEST(character == ';' && peek_char == '&') + { + parser_state |= PST_CASEPAT; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + return (SEMI_AND); + } + + shell_ungetc (peek_char); + + /* If we look like we are reading the start of a function + definition, then let the reader know about it so that + we will do the right thing with `{'. */ + if MBTEST(character == ')' && last_read_token == '(' && token_before_that == WORD) + { + parser_state |= PST_ALLOWOPNBRC; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + function_dstart = line_number; + } + + /* case pattern lists may be preceded by an optional left paren. If + we're not trying to parse a case pattern list, the left paren + indicates a subshell. */ + if MBTEST(character == '(' && (parser_state & PST_CASEPAT) == 0) /* ) */ + parser_state |= PST_SUBSHELL; + /*(*/ + else if MBTEST((parser_state & PST_CASEPAT) && character == ')') + parser_state &= ~PST_CASEPAT; + /*(*/ + else if MBTEST((parser_state & PST_SUBSHELL) && character == ')') + parser_state &= ~PST_SUBSHELL; + +#if defined (PROCESS_SUBSTITUTION) + /* Check for the constructs which introduce process substitution. + Shells running in `posix mode' don't do process substitution. */ + if MBTEST(posixly_correct || ((character != '>' && character != '<') || peek_char != '(')) /*)*/ +#endif /* PROCESS_SUBSTITUTION */ + return (character); + } + + /* Hack <&- (close stdin) case. Also <&N- (dup and close). */ + if MBTEST(character == '-' && (last_read_token == LESS_AND || last_read_token == GREATER_AND)) + return (character); + +tokword: + /* Okay, if we got this far, we have to read a word. Read one, + and then check it against the known ones. */ + result = read_token_word (character); +#if defined (ALIAS) + if (result == RE_READ_TOKEN) + goto re_read_token; +#endif + return result; +} + +/* + * Match a $(...) or other grouping construct. This has to handle embedded + * quoted strings ('', ``, "") and nested constructs. It also must handle + * reprompting the user, if necessary, after reading a newline, and returning + * correct error values if it reads EOF. + */ +#define P_FIRSTCLOSE 0x0001 +#define P_ALLOWESC 0x0002 +#define P_DQUOTE 0x0004 +#define P_COMMAND 0x0008 /* parsing a command, so look for comments */ +#define P_BACKQUOTE 0x0010 /* parsing a backquoted command substitution */ +#define P_ARRAYSUB 0x0020 /* parsing a [...] array subscript for assignment */ +#define P_DOLBRACE 0x0040 /* parsing a ${...} construct */ + +/* Lexical state while parsing a grouping construct or $(...). */ +#define LEX_WASDOL 0x001 +#define LEX_CKCOMMENT 0x002 +#define LEX_INCOMMENT 0x004 +#define LEX_PASSNEXT 0x008 +#define LEX_RESWDOK 0x010 +#define LEX_CKCASE 0x020 +#define LEX_INCASE 0x040 +#define LEX_INHEREDOC 0x080 +#define LEX_HEREDELIM 0x100 /* reading here-doc delimiter */ +#define LEX_STRIPDOC 0x200 /* <<- strip tabs from here doc delim */ +#define LEX_INWORD 0x400 + +#define COMSUB_META(ch) ((ch) == ';' || (ch) == '&' || (ch) == '|') + +#define CHECK_NESTRET_ERROR() \ + do { \ + if (nestret == &matched_pair_error) \ + { \ + free (ret); \ + return &matched_pair_error; \ + } \ + } while (0) + +#define APPEND_NESTRET() \ + do { \ + if (nestlen) \ + { \ + RESIZE_MALLOCED_BUFFER (ret, retind, nestlen, retsize, 64); \ + strcpy (ret + retind, nestret); \ + retind += nestlen; \ + } \ + } while (0) + +static char matched_pair_error; + +static char * +parse_matched_pair (qc, open, close, lenp, flags) + int qc; /* `"' if this construct is within double quotes */ + int open, close; + int *lenp, flags; +{ + int count, ch, tflags; + int nestlen, ttranslen, start_lineno; + char *ret, *nestret, *ttrans; + int retind, retsize, rflags; + int dolbrace_state; + + dolbrace_state = (flags & P_DOLBRACE) ? DOLBRACE_PARAM : 0; + +/*itrace("parse_matched_pair[%d]: open = %c close = %c flags = %d", line_number, open, close, flags);*/ + count = 1; + tflags = 0; + + if ((flags & P_COMMAND) && qc != '`' && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0) + tflags |= LEX_CKCOMMENT; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ + rflags = (qc == '"') ? P_DQUOTE : (flags & P_DQUOTE); + + ret = (char *)xmalloc (retsize = 64); + retind = 0; + + start_lineno = line_number; + while (count) + { + ch = shell_getc (qc != '\'' && (tflags & (LEX_PASSNEXT)) == 0); + + if (ch == EOF) + { + free (ret); + parser_error (start_lineno, _("unexpected EOF while looking for matching `%c'"), close); + EOF_Reached = 1; /* XXX */ + return (&matched_pair_error); + } + + /* Possible reprompting. */ + if (ch == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* Don't bother counting parens or doing anything else if in a comment + or part of a case statement */ + if (tflags & LEX_INCOMMENT) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + if (ch == '\n') + tflags &= ~LEX_INCOMMENT; + + continue; + } + + /* Not exactly right yet, should handle shell metacharacters, too. If + any changes are made to this test, make analogous changes to subst.c: + extract_delimited_string(). */ + else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || shellblank (ret[retind - 1]))) + tflags |= LEX_INCOMMENT; + + if (tflags & LEX_PASSNEXT) /* last char was backslash */ + { + tflags &= ~LEX_PASSNEXT; + if (qc != '\'' && ch == '\n') /* double-quoted \ disappears. */ + { + if (retind > 0) + retind--; /* swallow previously-added backslash */ + continue; + } + + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + if MBTEST(ch == CTLESC) + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + /* If we're reparsing the input (e.g., from parse_string_to_word_list), + we've already prepended CTLESC to single-quoted results of $'...'. + We may want to do this for other CTLESC-quoted characters in + reparse, too. */ + else if MBTEST((parser_state & PST_REPARSE) && open == '\'' && (ch == CTLESC || ch == CTLNUL)) + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + continue; + } + else if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + else if MBTEST(ch == close) /* ending delimiter */ + count--; + /* handle nested ${...} specially. */ + else if MBTEST(open != close && (tflags & LEX_WASDOL) && open == '{' && ch == open) /* } */ + count++; + else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && ch == open) /* nested begin */ + count++; + + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + /* If we just read the ending character, don't bother continuing. */ + if (count == 0) + break; + + if (open == '\'') /* '' inside grouping construct */ + { + if MBTEST((flags & P_ALLOWESC) && ch == '\\') + tflags |= LEX_PASSNEXT; + continue; + } + + if MBTEST(ch == '\\') /* backslashes */ + tflags |= LEX_PASSNEXT; + + /* Based on which dolstate is currently in (param, op, or word), + decide what the op is. We're really only concerned if it's % or + #, so we can turn on a flag that says whether or not we should + treat single quotes as special when inside a double-quoted + ${...}. This logic must agree with subst.c:extract_dollar_brace_string + since they share the same defines. */ + /* FLAG POSIX INTERP 221 */ + if (flags & P_DOLBRACE) + { + /* ${param%[%]word} */ + if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '%' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param#[#]word} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '#' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param/[/]pat/rep} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '/' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE2; /* XXX */ + /* ${param^[^]pat} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '^' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param,[,]pat} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == ',' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && strchr ("#%^,~:-=?+/", ch) != 0) + dolbrace_state = DOLBRACE_OP; + else if MBTEST(dolbrace_state == DOLBRACE_OP && strchr ("#%^,~:-=?+/", ch) == 0) + dolbrace_state = DOLBRACE_WORD; + } + + /* The big hammer. Single quotes aren't special in double quotes. The + problem is that Posix used to say the single quotes are semi-special: + within a double-quoted ${...} construct "an even number of + unescaped double-quotes or single-quotes, if any, shall occur." */ + /* This was changed in Austin Group Interp 221 */ + if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'') + continue; + + /* Could also check open == '`' if we want to parse grouping constructs + inside old-style command substitution. */ + if (open != close) /* a grouping construct */ + { + if MBTEST(shellquote (ch)) + { + /* '', ``, or "" inside $(...) or other grouping construct. */ + push_delimiter (dstack, ch); + if MBTEST((tflags & LEX_WASDOL) && ch == '\'') /* $'...' inside group */ + nestret = parse_matched_pair (ch, ch, ch, &nestlen, P_ALLOWESC|rflags); + else + nestret = parse_matched_pair (ch, ch, ch, &nestlen, rflags); + pop_delimiter (dstack); + CHECK_NESTRET_ERROR (); + + if MBTEST((tflags & LEX_WASDOL) && ch == '\'' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Translate $'...' here. */ + ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen); + xfree (nestret); + + /* If we're parsing a double-quoted brace expansion and we are + not in a place where single quotes are treated specially, + make sure we single-quote the results of the ansi + expansion because quote removal should remove them later */ + /* FLAG POSIX INTERP 221 */ + if ((shell_compatibility_level > 42) && (rflags & P_DQUOTE) && (dolbrace_state == DOLBRACE_QUOTE2) && (flags & P_DOLBRACE)) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else if ((rflags & P_DQUOTE) == 0) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else + { + nestret = ttrans; + nestlen = ttranslen; + } + retind -= 2; /* back up before the $' */ + } + else if MBTEST((tflags & LEX_WASDOL) && ch == '"' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Locale expand $"..." here. */ + ttrans = localeexpand (nestret, 0, nestlen - 1, start_lineno, &ttranslen); + xfree (nestret); + + nestret = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + nestlen = ttranslen + 2; + retind -= 2; /* back up before the $" */ + } + + APPEND_NESTRET (); + FREE (nestret); + } + else if ((flags & P_ARRAYSUB) && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + goto parse_dollar_word; + } + /* Parse an old-style command substitution within double quotes as a + single word. */ + /* XXX - sh and ksh93 don't do this - XXX */ + else if MBTEST(open == '"' && ch == '`') + { + nestret = parse_matched_pair (0, '`', '`', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + else if MBTEST(open != '`' && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + /* check for $(), $[], or ${} inside quoted string. */ + { +parse_dollar_word: + if (open == ch) /* undo previous increment */ + count--; + if (ch == '(') /* ) */ + nestret = parse_comsub (0, '(', ')', &nestlen, (rflags|P_COMMAND) & ~P_DQUOTE); + else if (ch == '{') /* } */ + nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|P_DOLBRACE|rflags); + else if (ch == '[') /* ] */ + nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + if MBTEST(ch == '$') + tflags |= LEX_WASDOL; + else + tflags &= ~LEX_WASDOL; + } + + ret[retind] = '\0'; + if (lenp) + *lenp = retind; +/*itrace("parse_matched_pair[%d]: returning %s", line_number, ret);*/ + return ret; +} + +/* Parse a $(...) command substitution. This is messier than I'd like, and + reproduces a lot more of the token-reading code than I'd like. */ +static char * +parse_comsub (qc, open, close, lenp, flags) + int qc; /* `"' if this construct is within double quotes */ + int open, close; + int *lenp, flags; +{ + int count, ch, peekc, tflags, lex_rwlen, lex_wlen, lex_firstind; + int nestlen, ttranslen, start_lineno; + char *ret, *nestret, *ttrans, *heredelim; + int retind, retsize, rflags, hdlen; + + /* Posix interp 217 says arithmetic expressions have precedence, so + assume $(( introduces arithmetic expansion and parse accordingly. */ + peekc = shell_getc (0); + shell_ungetc (peekc); + if (peekc == '(') + return (parse_matched_pair (qc, open, close, lenp, 0)); + +/*itrace("parse_comsub: qc = `%c' open = %c close = %c", qc, open, close);*/ + count = 1; + tflags = LEX_RESWDOK; + + if ((flags & P_COMMAND) && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0) + tflags |= LEX_CKCASE; + if ((tflags & LEX_CKCASE) && (interactive == 0 || interactive_comments)) + tflags |= LEX_CKCOMMENT; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ + rflags = (flags & P_DQUOTE); + + ret = (char *)xmalloc (retsize = 64); + retind = 0; + + start_lineno = line_number; + lex_rwlen = lex_wlen = 0; + + heredelim = 0; + lex_firstind = -1; + + while (count) + { +comsub_readchar: + ch = shell_getc (qc != '\'' && (tflags & (LEX_INCOMMENT|LEX_PASSNEXT)) == 0); + + if (ch == EOF) + { +eof_error: + free (ret); + FREE (heredelim); + parser_error (start_lineno, _("unexpected EOF while looking for matching `%c'"), close); + EOF_Reached = 1; /* XXX */ + return (&matched_pair_error); + } + + /* If we hit the end of a line and are reading the contents of a here + document, and it's not the same line that the document starts on, + check for this line being the here doc delimiter. Otherwise, if + we're in a here document, mark the next character as the beginning + of a line. */ + if (ch == '\n') + { + if ((tflags & LEX_HEREDELIM) && heredelim) + { + tflags &= ~LEX_HEREDELIM; + tflags |= LEX_INHEREDOC; + lex_firstind = retind + 1; + } + else if (tflags & LEX_INHEREDOC) + { + int tind; + tind = lex_firstind; + while ((tflags & LEX_STRIPDOC) && ret[tind] == '\t') + tind++; + if (STREQN (ret + tind, heredelim, hdlen)) + { + tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC); +/*itrace("parse_comsub:%d: found here doc end `%s'", line_number, ret + tind);*/ + free (heredelim); + heredelim = 0; + lex_firstind = -1; + } + else + lex_firstind = retind + 1; + } + } + + /* Possible reprompting. */ + if (ch == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* XXX -- possibly allow here doc to be delimited by ending right + paren. */ + if ((tflags & LEX_INHEREDOC) && ch == close && count == 1) + { + int tind; +/*itrace("parse_comsub: in here doc, ch == close, retind - firstind = %d hdlen = %d retind = %d", retind-lex_firstind, hdlen, retind);*/ + tind = lex_firstind; + while ((tflags & LEX_STRIPDOC) && ret[tind] == '\t') + tind++; + if (retind-tind == hdlen && STREQN (ret + tind, heredelim, hdlen)) + { + tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC); +/*itrace("parse_comsub:%d: found here doc end `%s'", line_number, ret + tind);*/ + free (heredelim); + heredelim = 0; + lex_firstind = -1; + } + } + + /* Don't bother counting parens or doing anything else if in a comment */ + if (tflags & (LEX_INCOMMENT|LEX_INHEREDOC)) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + if ((tflags & LEX_INCOMMENT) && ch == '\n') + { +/*itrace("parse_comsub:%d: lex_incomment -> 0 ch = `%c'", line_number, ch);*/ + tflags &= ~LEX_INCOMMENT; + } + + continue; + } + + if (tflags & LEX_PASSNEXT) /* last char was backslash */ + { +/*itrace("parse_comsub:%d: lex_passnext -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + tflags &= ~LEX_PASSNEXT; + if (qc != '\'' && ch == '\n') /* double-quoted \ disappears. */ + { + if (retind > 0) + retind--; /* swallow previously-added backslash */ + continue; + } + + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + if MBTEST(ch == CTLESC) + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + + /* If this is a shell break character, we are not in a word. If not, + we either start or continue a word. */ + if MBTEST(shellbreak (ch)) + { + tflags &= ~LEX_INWORD; +/*itrace("parse_comsub:%d: lex_inword -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + } + else + { + if (tflags & LEX_INWORD) + { + lex_wlen++; +/*itrace("parse_comsub:%d: lex_inword == 1 ch = `%c' lex_wlen = %d (%d)", line_number, ch, lex_wlen, __LINE__);*/ + } + else + { +/*itrace("parse_comsub:%d: lex_inword -> 1 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + tflags |= LEX_INWORD; + lex_wlen = 0; + } + } + + /* Skip whitespace */ + if MBTEST(shellblank (ch) && (tflags & LEX_HEREDELIM) == 0 && lex_rwlen == 0) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + continue; + } + + /* Either we are looking for the start of the here-doc delimiter + (lex_firstind == -1) or we are reading one (lex_firstind >= 0). + If this character is a shell break character and we are reading + the delimiter, save it and note that we are now reading a here + document. If we've found the start of the delimiter, note it by + setting lex_firstind. Backslashes can quote shell metacharacters + in here-doc delimiters. */ + if (tflags & LEX_HEREDELIM) + { + if (lex_firstind == -1 && shellbreak (ch) == 0) + lex_firstind = retind; +#if 0 + else if (heredelim && (tflags & LEX_PASSNEXT) == 0 && ch == '\n') + { + tflags |= LEX_INHEREDOC; + tflags &= ~LEX_HEREDELIM; + lex_firstind = retind + 1; + } +#endif + else if (lex_firstind >= 0 && (tflags & LEX_PASSNEXT) == 0 && shellbreak (ch)) + { + if (heredelim == 0) + { + nestret = substring (ret, lex_firstind, retind); + heredelim = string_quote_removal (nestret, 0); + free (nestret); + hdlen = STRLEN(heredelim); +/*itrace("parse_comsub:%d: found here doc delimiter `%s' (%d)", line_number, heredelim, hdlen);*/ + } + if (ch == '\n') + { + tflags |= LEX_INHEREDOC; + tflags &= ~LEX_HEREDELIM; + lex_firstind = retind + 1; + } + else + lex_firstind = -1; + } + } + + /* Meta-characters that can introduce a reserved word. Not perfect yet. */ + if MBTEST((tflags & LEX_RESWDOK) == 0 && (tflags & LEX_CKCASE) && (tflags & LEX_INCOMMENT) == 0 && (shellmeta(ch) || ch == '\n')) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + peekc = shell_getc (1); + if (ch == peekc && (ch == '&' || ch == '|' || ch == ';')) /* two-character tokens */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; +/*itrace("parse_comsub:%d: set lex_reswordok = 1, ch = `%c'", line_number, ch);*/ + tflags |= LEX_RESWDOK; + lex_rwlen = 0; + continue; + } + else if (ch == '\n' || COMSUB_META(ch)) + { + shell_ungetc (peekc); +/*itrace("parse_comsub:%d: set lex_reswordok = 1, ch = `%c'", line_number, ch);*/ + tflags |= LEX_RESWDOK; + lex_rwlen = 0; + continue; + } + else if (ch == EOF) + goto eof_error; + else + { + /* `unget' the character we just added and fall through */ + retind--; + shell_ungetc (peekc); + } + } + + /* If we can read a reserved word, try to read one. */ + if (tflags & LEX_RESWDOK) + { + if MBTEST(islower (ch)) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + lex_rwlen++; + continue; + } + else if MBTEST(lex_rwlen == 4 && shellbreak (ch)) + { + if (STREQN (ret + retind - 4, "case", 4)) + { + tflags |= LEX_INCASE; +/*itrace("parse_comsub:%d: found `case', lex_incase -> 1 lex_reswdok -> 0", line_number);*/ + } + else if (STREQN (ret + retind - 4, "esac", 4)) + { + tflags &= ~LEX_INCASE; +/*itrace("parse_comsub:%d: found `esac', lex_incase -> 0 lex_reswdok -> 0", line_number);*/ + } + tflags &= ~LEX_RESWDOK; + } + else if MBTEST((tflags & LEX_CKCOMMENT) && ch == '#' && (lex_rwlen == 0 || ((tflags & LEX_INWORD) && lex_wlen == 0))) + ; /* don't modify LEX_RESWDOK if we're starting a comment */ + /* Allow `do' followed by space, tab, or newline to preserve the + RESWDOK flag, but reset the reserved word length counter so we + can read another one. */ + else if MBTEST(((tflags & LEX_INCASE) == 0) && + (isblank(ch) || ch == '\n') && + lex_rwlen == 2 && + STREQN (ret + retind - 2, "do", 2)) + { +/*itrace("parse_comsub:%d: lex_incase == 1 found `%c', found \"do\"", line_number, ch);*/ + lex_rwlen = 0; + } + else if MBTEST((tflags & LEX_INCASE) && ch != '\n') + /* If we can read a reserved word and we're in case, we're at the + point where we can read a new pattern list or an esac. We + handle the esac case above. If we read a newline, we want to + leave LEX_RESWDOK alone. If we read anything else, we want to + turn off LEX_RESWDOK, since we're going to read a pattern list. */ + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: lex_incase == 1 found `%c', lex_reswordok -> 0", line_number, ch);*/ + } + else if MBTEST(shellbreak (ch) == 0) + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/ + } +#if 0 + /* If we find a space or tab but have read something and it's not + `do', turn off the reserved-word-ok flag */ + else if MBTEST(isblank (ch) && lex_rwlen > 0) + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/ + } +#endif + } + + /* Might be the start of a here-doc delimiter */ + if MBTEST((tflags & LEX_INCOMMENT) == 0 && (tflags & LEX_CKCASE) && ch == '<') + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + peekc = shell_getc (1); + if (peekc == EOF) + goto eof_error; + if (peekc == ch) + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; + peekc = shell_getc (1); + if (peekc == EOF) + goto eof_error; + if (peekc == '-') + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; + tflags |= LEX_STRIPDOC; + } + else + shell_ungetc (peekc); + if (peekc != '<') + { + tflags |= LEX_HEREDELIM; + lex_firstind = -1; + } + continue; + } + else + ch = peekc; /* fall through and continue XXX */ + } + else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (((tflags & LEX_RESWDOK) && lex_rwlen == 0) || ((tflags & LEX_INWORD) && lex_wlen == 0))) + { +/*itrace("parse_comsub:%d: lex_incomment -> 1 (%d)", line_number, __LINE__);*/ + tflags |= LEX_INCOMMENT; + } + + if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } +#if 0 + else if MBTEST((tflags & LEX_INCASE) && ch == close && close == ')') + tflags &= ~LEX_INCASE; /* XXX */ +#endif + else if MBTEST(ch == close && (tflags & LEX_INCASE) == 0) /* ending delimiter */ + { + count--; +/*itrace("parse_comsub:%d: found close: count = %d", line_number, count);*/ + } + else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && (tflags & LEX_INCASE) == 0 && ch == open) /* nested begin */ + { + count++; +/*itrace("parse_comsub:%d: found open: count = %d", line_number, count);*/ + } + + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + /* If we just read the ending character, don't bother continuing. */ + if (count == 0) + break; + + if MBTEST(ch == '\\') /* backslashes */ + tflags |= LEX_PASSNEXT; + + if MBTEST(shellquote (ch)) + { + /* '', ``, or "" inside $(...). */ + push_delimiter (dstack, ch); + if MBTEST((tflags & LEX_WASDOL) && ch == '\'') /* $'...' inside group */ + nestret = parse_matched_pair (ch, ch, ch, &nestlen, P_ALLOWESC|rflags); + else + nestret = parse_matched_pair (ch, ch, ch, &nestlen, rflags); + pop_delimiter (dstack); + CHECK_NESTRET_ERROR (); + + if MBTEST((tflags & LEX_WASDOL) && ch == '\'' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Translate $'...' here. */ + ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen); + xfree (nestret); + + if ((rflags & P_DQUOTE) == 0) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else + { + nestret = ttrans; + nestlen = ttranslen; + } + retind -= 2; /* back up before the $' */ + } + else if MBTEST((tflags & LEX_WASDOL) && ch == '"' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Locale expand $"..." here. */ + ttrans = localeexpand (nestret, 0, nestlen - 1, start_lineno, &ttranslen); + xfree (nestret); + + nestret = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + nestlen = ttranslen + 2; + retind -= 2; /* back up before the $" */ + } + + APPEND_NESTRET (); + FREE (nestret); + } + else if MBTEST((tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + /* check for $(), $[], or ${} inside command substitution. */ + { + if ((tflags & LEX_INCASE) == 0 && open == ch) /* undo previous increment */ + count--; + if (ch == '(') /* ) */ + nestret = parse_comsub (0, '(', ')', &nestlen, (rflags|P_COMMAND) & ~P_DQUOTE); + else if (ch == '{') /* } */ + nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|P_DOLBRACE|rflags); + else if (ch == '[') /* ] */ + nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + if MBTEST(ch == '$') + tflags |= LEX_WASDOL; + else + tflags &= ~LEX_WASDOL; + } + + FREE (heredelim); + ret[retind] = '\0'; + if (lenp) + *lenp = retind; +/*itrace("parse_comsub:%d: returning `%s'", line_number, ret);*/ + return ret; +} + +/* Recursively call the parser to parse a $(...) command substitution. */ +char * +xparse_dolparen (base, string, indp, flags) + char *base; + char *string; + int *indp; + int flags; +{ + sh_parser_state_t ps; + sh_input_line_state_t ls; + int orig_ind, nc, sflags, orig_eof_token; + char *ret, *s, *ep, *ostring; + + /*yydebug = 1;*/ + orig_ind = *indp; + ostring = string; + +/*itrace("xparse_dolparen: size = %d shell_input_line = `%s'", shell_input_line_size, shell_input_line);*/ + sflags = SEVAL_NONINT|SEVAL_NOHIST|SEVAL_NOFREE; + if (flags & SX_NOLONGJMP) + sflags |= SEVAL_NOLONGJMP; + save_parser_state (&ps); + save_input_line_state (&ls); + orig_eof_token = shell_eof_token; + + /*(*/ + parser_state |= PST_CMDSUBST|PST_EOFTOKEN; /* allow instant ')' */ /*(*/ + shell_eof_token = ')'; + parse_string (string, "command substitution", sflags, &ep); + + shell_eof_token = orig_eof_token; + restore_parser_state (&ps); + reset_parser (); + /* reset_parser clears shell_input_line and associated variables */ + restore_input_line_state (&ls); + if (interactive) + token_to_read = 0; + + /* Need to find how many characters parse_and_execute consumed, update + *indp, if flags != 0, copy the portion of the string parsed into RET + and return it. If flags & 1 (EX_NOALLOC) we can return NULL. */ + + /*(*/ + if (ep[-1] != ')') + { +#if DEBUG + if (ep[-1] != '\n') + itrace("xparse_dolparen:%d: ep[-1] != RPAREN (%d), ep = `%s'", line_number, ep[-1], ep); +#endif + while (ep > ostring && ep[-1] == '\n') ep--; + } + + nc = ep - ostring; + *indp = ep - base - 1; + + /*(*/ +#if DEBUG + if (base[*indp] != ')') + itrace("xparse_dolparen:%d: base[%d] != RPAREN (%d), base = `%s'", line_number, *indp, base[*indp], base); +#endif + + if (flags & SX_NOALLOC) + return (char *)NULL; + + if (nc == 0) + { + ret = xmalloc (1); + ret[0] = '\0'; + } + else + ret = substring (ostring, 0, nc - 1); + + return ret; +} + +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) +/* Parse a double-paren construct. It can be either an arithmetic + command, an arithmetic `for' command, or a nested subshell. Returns + the parsed token, -1 on error, or -2 if we didn't do anything and + should just go on. */ +static int +parse_dparen (c) + int c; +{ + int cmdtyp, sline; + char *wval; + WORD_DESC *wd; + +#if defined (ARITH_FOR_COMMAND) + if (last_read_token == FOR) + { + arith_for_lineno = line_number; + cmdtyp = parse_arith_cmd (&wval, 0); + if (cmdtyp == 1) + { + wd = alloc_word_desc (); + wd->word = wval; + yylval.word_list = make_word_list (wd, (WORD_LIST *)NULL); + return (ARITH_FOR_EXPRS); + } + else + return -1; /* ERROR */ + } +#endif + +#if defined (DPAREN_ARITHMETIC) + if (reserved_word_acceptable (last_read_token)) + { + sline = line_number; + + cmdtyp = parse_arith_cmd (&wval, 0); + if (cmdtyp == 1) /* arithmetic command */ + { + wd = alloc_word_desc (); + wd->word = wval; + wd->flags = W_QUOTED|W_NOSPLIT|W_NOGLOB|W_DQUOTE; + yylval.word_list = make_word_list (wd, (WORD_LIST *)NULL); + return (ARITH_CMD); + } + else if (cmdtyp == 0) /* nested subshell */ + { + push_string (wval, 0, (alias_t *)NULL); + pushed_string_list->flags = PSH_DPAREN; + if ((parser_state & PST_CASEPAT) == 0) + parser_state |= PST_SUBSHELL; + return (c); + } + else /* ERROR */ + return -1; + } +#endif + + return -2; /* XXX */ +} + +/* We've seen a `(('. Look for the matching `))'. If we get it, return 1. + If not, assume it's a nested subshell for backwards compatibility and + return 0. In any case, put the characters we've consumed into a locally- + allocated buffer and make *ep point to that buffer. Return -1 on an + error, for example EOF. */ +static int +parse_arith_cmd (ep, adddq) + char **ep; + int adddq; +{ + int exp_lineno, rval, c; + char *ttok, *tokstr; + int ttoklen; + + exp_lineno = line_number; + ttok = parse_matched_pair (0, '(', ')', &ttoklen, 0); + rval = 1; + if (ttok == &matched_pair_error) + return -1; + /* Check that the next character is the closing right paren. If + not, this is a syntax error. ( */ + c = shell_getc (0); + if MBTEST(c != ')') + rval = 0; + + tokstr = (char *)xmalloc (ttoklen + 4); + + /* if ADDDQ != 0 then (( ... )) -> "..." */ + if (rval == 1 && adddq) /* arith cmd, add double quotes */ + { + tokstr[0] = '"'; + strncpy (tokstr + 1, ttok, ttoklen - 1); + tokstr[ttoklen] = '"'; + tokstr[ttoklen+1] = '\0'; + } + else if (rval == 1) /* arith cmd, don't add double quotes */ + { + strncpy (tokstr, ttok, ttoklen - 1); + tokstr[ttoklen-1] = '\0'; + } + else /* nested subshell */ + { + tokstr[0] = '('; + strncpy (tokstr + 1, ttok, ttoklen - 1); + tokstr[ttoklen] = ')'; + tokstr[ttoklen+1] = c; + tokstr[ttoklen+2] = '\0'; + } + + *ep = tokstr; + FREE (ttok); + return rval; +} +#endif /* DPAREN_ARITHMETIC || ARITH_FOR_COMMAND */ + +#if defined (COND_COMMAND) +static void +cond_error () +{ + char *etext; + + if (EOF_Reached && cond_token != COND_ERROR) /* [[ */ + parser_error (cond_lineno, _("unexpected EOF while looking for `]]'")); + else if (cond_token != COND_ERROR) + { + if (etext = error_token_from_token (cond_token)) + { + parser_error (cond_lineno, _("syntax error in conditional expression: unexpected token `%s'"), etext); + free (etext); + } + else + parser_error (cond_lineno, _("syntax error in conditional expression")); + } +} + +static COND_COM * +cond_expr () +{ + return (cond_or ()); +} + +static COND_COM * +cond_or () +{ + COND_COM *l, *r; + + l = cond_and (); + if (cond_token == OR_OR) + { + r = cond_or (); + l = make_cond_node (COND_OR, (WORD_DESC *)NULL, l, r); + } + return l; +} + +static COND_COM * +cond_and () +{ + COND_COM *l, *r; + + l = cond_term (); + if (cond_token == AND_AND) + { + r = cond_and (); + l = make_cond_node (COND_AND, (WORD_DESC *)NULL, l, r); + } + return l; +} + +static int +cond_skip_newlines () +{ + while ((cond_token = read_token (READ)) == '\n') + { + if (SHOULD_PROMPT ()) + prompt_again (); + } + return (cond_token); +} + +#define COND_RETURN_ERROR() \ + do { cond_token = COND_ERROR; return ((COND_COM *)NULL); } while (0) + +static COND_COM * +cond_term () +{ + WORD_DESC *op; + COND_COM *term, *tleft, *tright; + int tok, lineno; + char *etext; + + /* Read a token. It can be a left paren, a `!', a unary operator, or a + word that should be the first argument of a binary operator. Start by + skipping newlines, since this is a compound command. */ + tok = cond_skip_newlines (); + lineno = line_number; + if (tok == COND_END) + { + COND_RETURN_ERROR (); + } + else if (tok == '(') + { + term = cond_expr (); + if (cond_token != ')') + { + if (term) + dispose_cond_node (term); /* ( */ + if (etext = error_token_from_token (cond_token)) + { + parser_error (lineno, _("unexpected token `%s', expected `)'"), etext); + free (etext); + } + else + parser_error (lineno, _("expected `)'")); + COND_RETURN_ERROR (); + } + term = make_cond_node (COND_EXPR, (WORD_DESC *)NULL, term, (COND_COM *)NULL); + (void)cond_skip_newlines (); + } + else if (tok == BANG || (tok == WORD && (yylval.word->word[0] == '!' && yylval.word->word[1] == '\0'))) + { + if (tok == WORD) + dispose_word (yylval.word); /* not needed */ + term = cond_term (); + if (term) + term->flags |= CMD_INVERT_RETURN; + } + else if (tok == WORD && yylval.word->word[0] == '-' && yylval.word->word[2] == 0 && test_unop (yylval.word->word)) + { + op = yylval.word; + tok = read_token (READ); + if (tok == WORD) + { + tleft = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + term = make_cond_node (COND_UNARY, op, tleft, (COND_COM *)NULL); + } + else + { + dispose_word (op); + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected argument `%s' to conditional unary operator"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected argument to conditional unary operator")); + COND_RETURN_ERROR (); + } + + (void)cond_skip_newlines (); + } + else if (tok == WORD) /* left argument to binary operator */ + { + /* lhs */ + tleft = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + + /* binop */ + tok = read_token (READ); + if (tok == WORD && test_binop (yylval.word->word)) + { + op = yylval.word; + if (op->word[0] == '=' && (op->word[1] == '\0' || (op->word[1] == '=' && op->word[2] == '\0'))) + parser_state |= PST_EXTPAT; + else if (op->word[0] == '!' && op->word[1] == '=' && op->word[2] == '\0') + parser_state |= PST_EXTPAT; + } +#if defined (COND_REGEXP) + else if (tok == WORD && STREQ (yylval.word->word, "=~")) + { + op = yylval.word; + parser_state |= PST_REGEXP; + } +#endif + else if (tok == '<' || tok == '>') + op = make_word_from_token (tok); /* ( */ + /* There should be a check before blindly accepting the `)' that we have + seen the opening `('. */ + else if (tok == COND_END || tok == AND_AND || tok == OR_OR || tok == ')') + { + /* Special case. [[ x ]] is equivalent to [[ -n x ]], just like + the test command. Similarly for [[ x && expr ]] or + [[ x || expr ]] or [[ (x) ]]. */ + op = make_word ("-n"); + term = make_cond_node (COND_UNARY, op, tleft, (COND_COM *)NULL); + cond_token = tok; + return (term); + } + else + { + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected token `%s', conditional binary operator expected"), etext); + free (etext); + } + else + parser_error (line_number, _("conditional binary operator expected")); + dispose_cond_node (tleft); + COND_RETURN_ERROR (); + } + + /* rhs */ + if (parser_state & PST_EXTPAT) + extended_glob = 1; + tok = read_token (READ); + if (parser_state & PST_EXTPAT) + extended_glob = global_extglob; + parser_state &= ~(PST_REGEXP|PST_EXTPAT); + + if (tok == WORD) + { + tright = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + term = make_cond_node (COND_BINARY, op, tleft, tright); + } + else + { + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected argument `%s' to conditional binary operator"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected argument to conditional binary operator")); + dispose_cond_node (tleft); + dispose_word (op); + COND_RETURN_ERROR (); + } + + (void)cond_skip_newlines (); + } + else + { + if (tok < 256) + parser_error (line_number, _("unexpected token `%c' in conditional command"), tok); + else if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected token `%s' in conditional command"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected token %d in conditional command"), tok); + COND_RETURN_ERROR (); + } + return (term); +} + +/* This is kind of bogus -- we slip a mini recursive-descent parser in + here to handle the conditional statement syntax. */ +static COMMAND * +parse_cond_command () +{ + COND_COM *cexp; + + global_extglob = extended_glob; + cexp = cond_expr (); + return (make_cond_command (cexp)); +} +#endif + +#if defined (ARRAY_VARS) +/* When this is called, it's guaranteed that we don't care about anything + in t beyond i. We do save and restore the chars, though. */ +static int +token_is_assignment (t, i) + char *t; + int i; +{ + unsigned char c, c1; + int r; + + c = t[i]; c1 = t[i+1]; + t[i] = '='; t[i+1] = '\0'; + r = assignment (t, (parser_state & PST_COMPASSIGN) != 0); + t[i] = c; t[i+1] = c1; + return r; +} + +/* XXX - possible changes here for `+=' */ +static int +token_is_ident (t, i) + char *t; + int i; +{ + unsigned char c; + int r; + + c = t[i]; + t[i] = '\0'; + r = legal_identifier (t); + t[i] = c; + return r; +} +#endif + +static int +read_token_word (character) + int character; +{ + /* The value for YYLVAL when a WORD is read. */ + WORD_DESC *the_word; + + /* Index into the token that we are building. */ + int token_index; + + /* ALL_DIGITS becomes zero when we see a non-digit. */ + int all_digit_token; + + /* DOLLAR_PRESENT becomes non-zero if we see a `$'. */ + int dollar_present; + + /* COMPOUND_ASSIGNMENT becomes non-zero if we are parsing a compound + assignment. */ + int compound_assignment; + + /* QUOTED becomes non-zero if we see one of ("), ('), (`), or (\). */ + int quoted; + + /* Non-zero means to ignore the value of the next character, and just + to add it no matter what. */ + int pass_next_character; + + /* The current delimiting character. */ + int cd; + int result, peek_char; + char *ttok, *ttrans; + int ttoklen, ttranslen; + intmax_t lvalue; + + if (token_buffer_size < TOKEN_DEFAULT_INITIAL_SIZE) + token = (char *)xrealloc (token, token_buffer_size = TOKEN_DEFAULT_INITIAL_SIZE); + + token_index = 0; + all_digit_token = DIGIT (character); + dollar_present = quoted = pass_next_character = compound_assignment = 0; + + for (;;) + { + if (character == EOF) + goto got_token; + + if (pass_next_character) + { + pass_next_character = 0; + goto got_escaped_character; + } + + cd = current_delimiter (dstack); + + /* Handle backslashes. Quote lots of things when not inside of + double-quotes, quote some things inside of double-quotes. */ + if MBTEST(character == '\\') + { + peek_char = shell_getc (0); + + /* Backslash-newline is ignored in all cases except + when quoted with single quotes. */ + if (peek_char == '\n') + { + character = '\n'; + goto next_character; + } + else + { + shell_ungetc (peek_char); + + /* If the next character is to be quoted, note it now. */ + if (cd == 0 || cd == '`' || + (cd == '"' && peek_char >= 0 && (sh_syntaxtab[peek_char] & CBSDQUOTE))) + pass_next_character++; + + quoted = 1; + goto got_character; + } + } + + /* Parse a matched pair of quote characters. */ + if MBTEST(shellquote (character)) + { + push_delimiter (dstack, character); + ttok = parse_matched_pair (character, character, character, &ttoklen, (character == '`') ? P_COMMAND : 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + all_digit_token = 0; + quoted = 1; + dollar_present |= (character == '"' && strchr (ttok, '$') != 0); + FREE (ttok); + goto next_character; + } + +#ifdef COND_REGEXP + /* When parsing a regexp as a single word inside a conditional command, + we need to special-case characters special to both the shell and + regular expressions. Right now, that is only '(' and '|'. */ /*)*/ + if MBTEST((parser_state & PST_REGEXP) && (character == '(' || character == '|')) /*)*/ + { + if (character == '|') + goto got_character; + + push_delimiter (dstack, character); + ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = all_digit_token = 0; + goto next_character; + } +#endif /* COND_REGEXP */ + +#ifdef EXTENDED_GLOB + /* Parse a ksh-style extended pattern matching specification. */ + if MBTEST(extended_glob && PATTERN_CHAR (character)) + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '(') /* ) */ + { + push_delimiter (dstack, peek_char); + ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + token[token_index++] = peek_char; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = all_digit_token = 0; + goto next_character; + } + else + shell_ungetc (peek_char); + } +#endif /* EXTENDED_GLOB */ + + /* If the delimiter character is not single quote, parse some of + the shell expansions that must be read as a single word. */ + if (shellexp (character)) + { + peek_char = shell_getc (1); + /* $(...), <(...), >(...), $((...)), ${...}, and $[...] constructs */ + if MBTEST(peek_char == '(' || + ((peek_char == '{' || peek_char == '[') && character == '$')) /* ) ] } */ + { + if (peek_char == '{') /* } */ + ttok = parse_matched_pair (cd, '{', '}', &ttoklen, P_FIRSTCLOSE|P_DOLBRACE); + else if (peek_char == '(') /* ) */ + { + /* XXX - push and pop the `(' as a delimiter for use by + the command-oriented-history code. This way newlines + appearing in the $(...) string get added to the + history literally rather than causing a possibly- + incorrect `;' to be added. ) */ + push_delimiter (dstack, peek_char); + ttok = parse_comsub (cd, '(', ')', &ttoklen, P_COMMAND); + pop_delimiter (dstack); + } + else + ttok = parse_matched_pair (cd, '[', ']', &ttoklen, 0); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + token[token_index++] = peek_char; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = 1; + all_digit_token = 0; + goto next_character; + } + /* This handles $'...' and $"..." new-style quoted strings. */ + else if MBTEST(character == '$' && (peek_char == '\'' || peek_char == '"')) + { + int first_line; + + first_line = line_number; + push_delimiter (dstack, peek_char); + ttok = parse_matched_pair (peek_char, peek_char, peek_char, + &ttoklen, + (peek_char == '\'') ? P_ALLOWESC : 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; + if (peek_char == '\'') + { + ttrans = ansiexpand (ttok, 0, ttoklen - 1, &ttranslen); + free (ttok); + + /* Insert the single quotes and correctly quote any + embedded single quotes (allowed because P_ALLOWESC was + passed to parse_matched_pair). */ + ttok = sh_single_quote (ttrans); + free (ttrans); + ttranslen = strlen (ttok); + ttrans = ttok; + } + else + { + /* Try to locale-expand the converted string. */ + ttrans = localeexpand (ttok, 0, ttoklen - 1, first_line, &ttranslen); + free (ttok); + + /* Add the double quotes back */ + ttok = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + ttranslen += 2; + ttrans = ttok; + } + + RESIZE_MALLOCED_BUFFER (token, token_index, ttranslen + 1, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + strcpy (token + token_index, ttrans); + token_index += ttranslen; + FREE (ttrans); + quoted = 1; + all_digit_token = 0; + goto next_character; + } + /* This could eventually be extended to recognize all of the + shell's single-character parameter expansions, and set flags.*/ + else if MBTEST(character == '$' && peek_char == '$') + { + RESIZE_MALLOCED_BUFFER (token, token_index, 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = '$'; + token[token_index++] = peek_char; + dollar_present = 1; + all_digit_token = 0; + goto next_character; + } + else + shell_ungetc (peek_char); + } + +#if defined (ARRAY_VARS) + /* Identify possible array subscript assignment; match [...]. If + parser_state&PST_COMPASSIGN, we need to parse [sub]=words treating + `sub' as if it were enclosed in double quotes. */ + else if MBTEST(character == '[' && /* ] */ + ((token_index > 0 && assignment_acceptable (last_read_token) && token_is_ident (token, token_index)) || + (token_index == 0 && (parser_state&PST_COMPASSIGN)))) + { + ttok = parse_matched_pair (cd, '[', ']', &ttoklen, P_ARRAYSUB); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + all_digit_token = 0; + goto next_character; + } + /* Identify possible compound array variable assignment. */ + else if MBTEST(character == '=' && token_index > 0 && (assignment_acceptable (last_read_token) || (parser_state & PST_ASSIGNOK)) && token_is_assignment (token, token_index)) + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '(') /* ) */ + { + ttok = parse_compound_assignment (&ttoklen); + + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 4, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + + token[token_index++] = '='; + token[token_index++] = '('; + if (ttok) + { + strcpy (token + token_index, ttok); + token_index += ttoklen; + } + token[token_index++] = ')'; + FREE (ttok); + all_digit_token = 0; + compound_assignment = 1; +#if 1 + goto next_character; +#else + goto got_token; /* ksh93 seems to do this */ +#endif + } + else + shell_ungetc (peek_char); + } +#endif + + /* When not parsing a multi-character word construct, shell meta- + characters break words. */ + if MBTEST(shellbreak (character)) + { + shell_ungetc (character); + goto got_token; + } + +got_character: + + if (character == CTLESC || character == CTLNUL) + { + RESIZE_MALLOCED_BUFFER (token, token_index, 2, token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = CTLESC; + } + else +got_escaped_character: + RESIZE_MALLOCED_BUFFER (token, token_index, 1, token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + + token[token_index++] = character; + + all_digit_token &= DIGIT (character); + dollar_present |= character == '$'; + + next_character: + if (character == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* We want to remove quoted newlines (that is, a \ pair) + unless we are within single quotes or pass_next_character is + set (the shell equivalent of literal-next). */ + cd = current_delimiter (dstack); + character = shell_getc (cd != '\'' && pass_next_character == 0); + } /* end for (;;) */ + +got_token: + + /* Calls to RESIZE_MALLOCED_BUFFER ensure there is sufficient room. */ + token[token_index] = '\0'; + + /* Check to see what thing we should return. If the last_read_token + is a `<', or a `&', or the character which ended this token is + a '>' or '<', then, and ONLY then, is this input token a NUMBER. + Otherwise, it is just a word, and should be returned as such. */ + if MBTEST(all_digit_token && (character == '<' || character == '>' || + last_read_token == LESS_AND || + last_read_token == GREATER_AND)) + { + if (legal_number (token, &lvalue) && (int)lvalue == lvalue) + { + yylval.number = lvalue; + return (NUMBER); + } + } + + /* Check for special case tokens. */ + result = (last_shell_getc_is_singlebyte) ? special_case_tokens (token) : -1; + if (result >= 0) + return result; + +#if defined (ALIAS) + /* Posix.2 does not allow reserved words to be aliased, so check for all + of them, including special cases, before expanding the current token + as an alias. */ + if MBTEST(posixly_correct) + CHECK_FOR_RESERVED_WORD (token); + + /* Aliases are expanded iff EXPAND_ALIASES is non-zero, and quoting + inhibits alias expansion. */ + if (expand_aliases && quoted == 0) + { + result = alias_expand_token (token); + if (result == RE_READ_TOKEN) + return (RE_READ_TOKEN); + else if (result == NO_EXPANSION) + parser_state &= ~PST_ALEXPNEXT; + } + + /* If not in Posix.2 mode, check for reserved words after alias + expansion. */ + if MBTEST(posixly_correct == 0) +#endif + CHECK_FOR_RESERVED_WORD (token); + + the_word = (WORD_DESC *)xmalloc (sizeof (WORD_DESC)); + the_word->word = (char *)xmalloc (1 + token_index); + the_word->flags = 0; + strcpy (the_word->word, token); + if (dollar_present) + the_word->flags |= W_HASDOLLAR; + if (quoted) + the_word->flags |= W_QUOTED; /*(*/ + if (compound_assignment && token[token_index-1] == ')') + the_word->flags |= W_COMPASSIGN; + /* A word is an assignment if it appears at the beginning of a + simple command, or after another assignment word. This is + context-dependent, so it cannot be handled in the grammar. */ + if (assignment (token, (parser_state & PST_COMPASSIGN) != 0)) + { + the_word->flags |= W_ASSIGNMENT; + /* Don't perform word splitting on assignment statements. */ + if (assignment_acceptable (last_read_token) || (parser_state & PST_COMPASSIGN) != 0) + { + the_word->flags |= W_NOSPLIT; + if (parser_state & PST_COMPASSIGN) + the_word->flags |= W_NOGLOB; /* XXX - W_NOBRACE? */ + } + } + + if (command_token_position (last_read_token)) + { + struct builtin *b; + b = builtin_address_internal (token, 0); + if (b && (b->flags & ASSIGNMENT_BUILTIN)) + parser_state |= PST_ASSIGNOK; + else if (STREQ (token, "eval") || STREQ (token, "let")) + parser_state |= PST_ASSIGNOK; + } + + yylval.word = the_word; + + if (token[0] == '{' && token[token_index-1] == '}' && + (character == '<' || character == '>')) + { + /* can use token; already copied to the_word */ + token[token_index-1] = '\0'; +#if defined (ARRAY_VARS) + if (legal_identifier (token+1) || valid_array_reference (token+1)) +#else + if (legal_identifier (token+1)) +#endif + { + strcpy (the_word->word, token+1); +/*itrace("read_token_word: returning REDIR_WORD for %s", the_word->word);*/ + return (REDIR_WORD); + } + } + + result = ((the_word->flags & (W_ASSIGNMENT|W_NOSPLIT)) == (W_ASSIGNMENT|W_NOSPLIT)) + ? ASSIGNMENT_WORD : WORD; + + switch (last_read_token) + { + case FUNCTION: + parser_state |= PST_ALLOWOPNBRC; + function_dstart = line_number; + break; + case CASE: + case SELECT: + case FOR: + if (word_top < MAX_CASE_NEST) + word_top++; + word_lineno[word_top] = line_number; + break; + } + + return (result); +} + +/* Return 1 if TOKSYM is a token that after being read would allow + a reserved word to be seen, else 0. */ +static int +reserved_word_acceptable (toksym) + int toksym; +{ + switch (toksym) + { + case '\n': + case ';': + case '(': + case ')': + case '|': + case '&': + case '{': + case '}': /* XXX */ + case AND_AND: + case BANG: + case BAR_AND: + case DO: + case DONE: + case ELIF: + case ELSE: + case ESAC: + case FI: + case IF: + case OR_OR: + case SEMI_SEMI: + case SEMI_AND: + case SEMI_SEMI_AND: + case THEN: + case TIME: + case TIMEOPT: + case TIMEIGN: + case COPROC: + case UNTIL: + case WHILE: + case 0: + return 1; + default: +#if defined (COPROCESS_SUPPORT) + if (last_read_token == WORD && token_before_that == COPROC) + return 1; +#endif + if (last_read_token == WORD && token_before_that == FUNCTION) + return 1; + return 0; + } +} + +/* Return the index of TOKEN in the alist of reserved words, or -1 if + TOKEN is not a shell reserved word. */ +int +find_reserved_word (tokstr) + char *tokstr; +{ + int i; + for (i = 0; word_token_alist[i].word; i++) + if (STREQ (tokstr, word_token_alist[i].word)) + return i; + return -1; +} + +/* An interface to let the rest of the shell (primarily the completion + system) know what the parser is expecting. */ +int +parser_in_command_position () +{ + return (command_token_position (last_read_token)); +} + +#if 0 +#if defined (READLINE) +/* Called after each time readline is called. This insures that whatever + the new prompt string is gets propagated to readline's local prompt + variable. */ +static void +reset_readline_prompt () +{ + char *temp_prompt; + + if (prompt_string_pointer) + { + temp_prompt = (*prompt_string_pointer) + ? decode_prompt_string (*prompt_string_pointer) + : (char *)NULL; + + if (temp_prompt == 0) + { + temp_prompt = (char *)xmalloc (1); + temp_prompt[0] = '\0'; + } + + FREE (current_readline_prompt); + current_readline_prompt = temp_prompt; + } +} +#endif /* READLINE */ +#endif /* 0 */ + +#if defined (HISTORY) +/* A list of tokens which can be followed by newlines, but not by + semi-colons. When concatenating multiple lines of history, the + newline separator for such tokens is replaced with a space. */ +static const int no_semi_successors[] = { + '\n', '{', '(', ')', ';', '&', '|', + CASE, DO, ELSE, IF, SEMI_SEMI, SEMI_AND, SEMI_SEMI_AND, THEN, UNTIL, + WHILE, AND_AND, OR_OR, IN, + 0 +}; + +/* If we are not within a delimited expression, try to be smart + about which separators can be semi-colons and which must be + newlines. Returns the string that should be added into the + history entry. LINE is the line we're about to add; it helps + make some more intelligent decisions in certain cases. */ +char * +history_delimiting_chars (line) + const char *line; +{ + static int last_was_heredoc = 0; /* was the last entry the start of a here document? */ + register int i; + + if ((parser_state & PST_HEREDOC) == 0) + last_was_heredoc = 0; + + if (dstack.delimiter_depth != 0) + return ("\n"); + + /* We look for current_command_line_count == 2 because we are looking to + add the first line of the body of the here document (the second line + of the command). We also keep LAST_WAS_HEREDOC as a private sentinel + variable to note when we think we added the first line of a here doc + (the one with a "<<" somewhere in it) */ + if (parser_state & PST_HEREDOC) + { + if (last_was_heredoc) + { + last_was_heredoc = 0; + return "\n"; + } + return (current_command_line_count == 2 ? "\n" : ""); + } + + if (parser_state & PST_COMPASSIGN) + return (" "); + + /* First, handle some special cases. */ + /*(*/ + /* If we just read `()', assume it's a function definition, and don't + add a semicolon. If the token before the `)' was not `(', and we're + not in the midst of parsing a case statement, assume it's a + parenthesized command and add the semicolon. */ + /*)(*/ + if (token_before_that == ')') + { + if (two_tokens_ago == '(') /*)*/ /* function def */ + return " "; + /* This does not work for subshells inside case statement + command lists. It's a suboptimal solution. */ + else if (parser_state & PST_CASESTMT) /* case statement pattern */ + return " "; + else + return "; "; /* (...) subshell */ + } + else if (token_before_that == WORD && two_tokens_ago == FUNCTION) + return " "; /* function def using `function name' without `()' */ + + /* If we're not in a here document, but we think we're about to parse one, + and we would otherwise return a `;', return a newline to delimit the + line with the here-doc delimiter */ + else if ((parser_state & PST_HEREDOC) == 0 && current_command_line_count > 1 && last_read_token == '\n' && strstr (line, "<<")) + { + last_was_heredoc = 1; + return "\n"; + } + + else if (token_before_that == WORD && two_tokens_ago == FOR) + { + /* Tricky. `for i\nin ...' should not have a semicolon, but + `for i\ndo ...' should. We do what we can. */ + for (i = shell_input_line_index; whitespace (shell_input_line[i]); i++) + ; + if (shell_input_line[i] && shell_input_line[i] == 'i' && shell_input_line[i+1] == 'n') + return " "; + return ";"; + } + else if (two_tokens_ago == CASE && token_before_that == WORD && (parser_state & PST_CASESTMT)) + return " "; + + for (i = 0; no_semi_successors[i]; i++) + { + if (token_before_that == no_semi_successors[i]) + return (" "); + } + + return ("; "); +} +#endif /* HISTORY */ + +/* Issue a prompt, or prepare to issue a prompt when the next character + is read. */ +static void +prompt_again () +{ + char *temp_prompt; + + if (interactive == 0 || expanding_alias ()) /* XXX */ + return; + + ps1_prompt = get_string_value ("PS1"); + ps2_prompt = get_string_value ("PS2"); + + if (!prompt_string_pointer) + prompt_string_pointer = &ps1_prompt; + + temp_prompt = *prompt_string_pointer + ? decode_prompt_string (*prompt_string_pointer) + : (char *)NULL; + + if (temp_prompt == 0) + { + temp_prompt = (char *)xmalloc (1); + temp_prompt[0] = '\0'; + } + + current_prompt_string = *prompt_string_pointer; + prompt_string_pointer = &ps2_prompt; + +#if defined (READLINE) + if (!no_line_editing) + { + FREE (current_readline_prompt); + current_readline_prompt = temp_prompt; + } + else +#endif /* READLINE */ + { + FREE (current_decoded_prompt); + current_decoded_prompt = temp_prompt; + } +} + +int +get_current_prompt_level () +{ + return ((current_prompt_string && current_prompt_string == ps2_prompt) ? 2 : 1); +} + +void +set_current_prompt_level (x) + int x; +{ + prompt_string_pointer = (x == 2) ? &ps2_prompt : &ps1_prompt; + current_prompt_string = *prompt_string_pointer; +} + +static void +print_prompt () +{ + fprintf (stderr, "%s", current_decoded_prompt); + fflush (stderr); +} + +/* Return a string which will be printed as a prompt. The string + may contain special characters which are decoded as follows: + + \a bell (ascii 07) + \d the date in Day Mon Date format + \e escape (ascii 033) + \h the hostname up to the first `.' + \H the hostname + \j the number of active jobs + \l the basename of the shell's tty device name + \n CRLF + \r CR + \s the name of the shell + \t the time in 24-hour hh:mm:ss format + \T the time in 12-hour hh:mm:ss format + \@ the time in 12-hour hh:mm am/pm format + \A the time in 24-hour hh:mm format + \D{fmt} the result of passing FMT to strftime(3) + \u your username + \v the version of bash (e.g., 2.00) + \V the release of bash, version + patchlevel (e.g., 2.00.0) + \w the current working directory + \W the last element of $PWD + \! the history number of this command + \# the command number of this command + \$ a $ or a # if you are root + \nnn character code nnn in octal + \\ a backslash + \[ begin a sequence of non-printing chars + \] end a sequence of non-printing chars +*/ +#define PROMPT_GROWTH 48 +char * +decode_prompt_string (string) + char *string; +{ + WORD_LIST *list; + char *result, *t; + struct dstack save_dstack; + int last_exit_value, last_comsub_pid; +#if defined (PROMPT_STRING_DECODE) + int result_size, result_index; + int c, n, i; + char *temp, octal_string[4]; + struct tm *tm; + time_t the_time; + char timebuf[128]; + char *timefmt; + + result = (char *)xmalloc (result_size = PROMPT_GROWTH); + result[result_index = 0] = 0; + temp = (char *)NULL; + + while (c = *string++) + { + if (posixly_correct && c == '!') + { + if (*string == '!') + { + temp = savestring ("!"); + goto add_string; + } + else + { +#if !defined (HISTORY) + temp = savestring ("1"); +#else /* HISTORY */ + temp = itos (history_number ()); +#endif /* HISTORY */ + string--; /* add_string increments string again. */ + goto add_string; + } + } + if (c == '\\') + { + c = *string; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + strncpy (octal_string, string, 3); + octal_string[3] = '\0'; + + n = read_octal (octal_string); + temp = (char *)xmalloc (3); + + if (n == CTLESC || n == CTLNUL) + { + temp[0] = CTLESC; + temp[1] = n; + temp[2] = '\0'; + } + else if (n == -1) + { + temp[0] = '\\'; + temp[1] = '\0'; + } + else + { + temp[0] = n; + temp[1] = '\0'; + } + + for (c = 0; n != -1 && c < 3 && ISOCTAL (*string); c++) + string++; + + c = 0; /* tested at add_string: */ + goto add_string; + + case 'd': + case 't': + case 'T': + case '@': + case 'A': + /* Make the current time/date into a string. */ + (void) time (&the_time); +#if defined (HAVE_TZSET) + sv_tz ("TZ"); /* XXX -- just make sure */ +#endif + tm = localtime (&the_time); + + if (c == 'd') + n = strftime (timebuf, sizeof (timebuf), "%a %b %d", tm); + else if (c == 't') + n = strftime (timebuf, sizeof (timebuf), "%H:%M:%S", tm); + else if (c == 'T') + n = strftime (timebuf, sizeof (timebuf), "%I:%M:%S", tm); + else if (c == '@') + n = strftime (timebuf, sizeof (timebuf), "%I:%M %p", tm); + else if (c == 'A') + n = strftime (timebuf, sizeof (timebuf), "%H:%M", tm); + + if (n == 0) + timebuf[0] = '\0'; + else + timebuf[sizeof(timebuf) - 1] = '\0'; + + temp = savestring (timebuf); + goto add_string; + + case 'D': /* strftime format */ + if (string[1] != '{') /* } */ + goto not_escape; + + (void) time (&the_time); + tm = localtime (&the_time); + string += 2; /* skip { */ + timefmt = xmalloc (strlen (string) + 3); + for (t = timefmt; *string && *string != '}'; ) + *t++ = *string++; + *t = '\0'; + c = *string; /* tested at add_string */ + if (timefmt[0] == '\0') + { + timefmt[0] = '%'; + timefmt[1] = 'X'; /* locale-specific current time */ + timefmt[2] = '\0'; + } + n = strftime (timebuf, sizeof (timebuf), timefmt, tm); + free (timefmt); + + if (n == 0) + timebuf[0] = '\0'; + else + timebuf[sizeof(timebuf) - 1] = '\0'; + + if (promptvars || posixly_correct) + /* Make sure that expand_prompt_string is called with a + second argument of Q_DOUBLE_QUOTES if we use this + function here. */ + temp = sh_backslash_quote_for_double_quotes (timebuf); + else + temp = savestring (timebuf); + goto add_string; + + case 'n': + temp = (char *)xmalloc (3); + temp[0] = no_line_editing ? '\n' : '\r'; + temp[1] = no_line_editing ? '\0' : '\n'; + temp[2] = '\0'; + goto add_string; + + case 's': + temp = base_pathname (shell_name); + temp = savestring (temp); + goto add_string; + + case 'v': + case 'V': + temp = (char *)xmalloc (16); + if (c == 'v') + strcpy (temp, dist_version); + else + sprintf (temp, "%s.%d", dist_version, patch_level); + goto add_string; + + case 'w': + case 'W': + { + /* Use the value of PWD because it is much more efficient. */ + char t_string[PATH_MAX]; + int tlen; + + temp = get_string_value ("PWD"); + + if (temp == 0) + { + if (getcwd (t_string, sizeof(t_string)) == 0) + { + t_string[0] = '.'; + tlen = 1; + } + else + tlen = strlen (t_string); + } + else + { + tlen = sizeof (t_string) - 1; + strncpy (t_string, temp, tlen); + } + t_string[tlen] = '\0'; + +#if defined (MACOSX) + /* Convert from "fs" format to "input" format */ + temp = fnx_fromfs (t_string, strlen (t_string)); + if (temp != t_string) + strcpy (t_string, temp); +#endif + +#define ROOT_PATH(x) ((x)[0] == '/' && (x)[1] == 0) +#define DOUBLE_SLASH_ROOT(x) ((x)[0] == '/' && (x)[1] == '/' && (x)[2] == 0) + /* Abbreviate \W as ~ if $PWD == $HOME */ + if (c == 'W' && (((t = get_string_value ("HOME")) == 0) || STREQ (t, t_string) == 0)) + { + if (ROOT_PATH (t_string) == 0 && DOUBLE_SLASH_ROOT (t_string) == 0) + { + t = strrchr (t_string, '/'); + if (t) + memmove (t_string, t + 1, strlen (t)); /* strlen(t) to copy NULL */ + } + } +#undef ROOT_PATH +#undef DOUBLE_SLASH_ROOT + else + { + /* polite_directory_format is guaranteed to return a string + no longer than PATH_MAX - 1 characters. */ + temp = polite_directory_format (t_string); + if (temp != t_string) + strcpy (t_string, temp); + } + + temp = trim_pathname (t_string, PATH_MAX - 1); + /* If we're going to be expanding the prompt string later, + quote the directory name. */ + if (promptvars || posixly_correct) + /* Make sure that expand_prompt_string is called with a + second argument of Q_DOUBLE_QUOTES if we use this + function here. */ + temp = sh_backslash_quote_for_double_quotes (t_string); + else + temp = savestring (t_string); + + goto add_string; + } + + case 'u': + if (current_user.user_name == 0) + get_current_user_info (); + temp = savestring (current_user.user_name); + goto add_string; + + case 'h': + case 'H': + temp = savestring (current_host_name); + if (c == 'h' && (t = (char *)strchr (temp, '.'))) + *t = '\0'; + goto add_string; + + case '#': + temp = itos (current_command_number); + goto add_string; + + case '!': +#if !defined (HISTORY) + temp = savestring ("1"); +#else /* HISTORY */ + temp = itos (history_number ()); +#endif /* HISTORY */ + goto add_string; + + case '$': + t = temp = (char *)xmalloc (3); + if ((promptvars || posixly_correct) && (current_user.euid != 0)) + *t++ = '\\'; + *t++ = current_user.euid == 0 ? '#' : '$'; + *t = '\0'; + goto add_string; + + case 'j': + temp = itos (count_all_jobs ()); + goto add_string; + + case 'l': +#if defined (HAVE_TTYNAME) + temp = (char *)ttyname (fileno (stdin)); + t = temp ? base_pathname (temp) : "tty"; + temp = savestring (t); +#else + temp = savestring ("tty"); +#endif /* !HAVE_TTYNAME */ + goto add_string; + +#if defined (READLINE) + case '[': + case ']': + if (no_line_editing) + { + string++; + break; + } + temp = (char *)xmalloc (3); + n = (c == '[') ? RL_PROMPT_START_IGNORE : RL_PROMPT_END_IGNORE; + i = 0; + if (n == CTLESC || n == CTLNUL) + temp[i++] = CTLESC; + temp[i++] = n; + temp[i] = '\0'; + goto add_string; +#endif /* READLINE */ + + case '\\': + case 'a': + case 'e': + case 'r': + temp = (char *)xmalloc (2); + if (c == 'a') + temp[0] = '\07'; + else if (c == 'e') + temp[0] = '\033'; + else if (c == 'r') + temp[0] = '\r'; + else /* (c == '\\') */ + temp[0] = c; + temp[1] = '\0'; + goto add_string; + + default: +not_escape: + temp = (char *)xmalloc (3); + temp[0] = '\\'; + temp[1] = c; + temp[2] = '\0'; + + add_string: + if (c) + string++; + result = + sub_append_string (temp, result, &result_index, &result_size); + temp = (char *)NULL; /* Freed in sub_append_string (). */ + result[result_index] = '\0'; + break; + } + } + else + { + RESIZE_MALLOCED_BUFFER (result, result_index, 3, result_size, PROMPT_GROWTH); + result[result_index++] = c; + result[result_index] = '\0'; + } + } +#else /* !PROMPT_STRING_DECODE */ + result = savestring (string); +#endif /* !PROMPT_STRING_DECODE */ + + /* Save the delimiter stack and point `dstack' to temp space so any + command substitutions in the prompt string won't result in screwing + up the parser's quoting state. */ + save_dstack = dstack; + dstack = temp_dstack; + dstack.delimiter_depth = 0; + + /* Perform variable and parameter expansion and command substitution on + the prompt string. */ + if (promptvars || posixly_correct) + { + last_exit_value = last_command_exit_value; + last_comsub_pid = last_command_subst_pid; + list = expand_prompt_string (result, Q_DOUBLE_QUOTES, 0); + free (result); + result = string_list (list); + dispose_words (list); + last_command_exit_value = last_exit_value; + last_command_subst_pid = last_comsub_pid; + } + else + { + t = dequote_string (result); + free (result); + result = t; + } + + dstack = save_dstack; + + return (result); +} + +/************************************************ + * * + * ERROR HANDLING * + * * + ************************************************/ + +/* Report a syntax error, and restart the parser. Call here for fatal + errors. */ +int +yyerror (msg) + const char *msg; +{ + report_syntax_error ((char *)NULL); + reset_parser (); + return (0); +} + +static char * +error_token_from_token (tok) + int tok; +{ + char *t; + + if (t = find_token_in_alist (tok, word_token_alist, 0)) + return t; + + if (t = find_token_in_alist (tok, other_token_alist, 0)) + return t; + + t = (char *)NULL; + /* This stuff is dicy and needs closer inspection */ + switch (current_token) + { + case WORD: + case ASSIGNMENT_WORD: + if (yylval.word) + t = savestring (yylval.word->word); + break; + case NUMBER: + t = itos (yylval.number); + break; + case ARITH_CMD: + if (yylval.word_list) + t = string_list (yylval.word_list); + break; + case ARITH_FOR_EXPRS: + if (yylval.word_list) + t = string_list_internal (yylval.word_list, " ; "); + break; + case COND_CMD: + t = (char *)NULL; /* punt */ + break; + } + + return t; +} + +static char * +error_token_from_text () +{ + char *msg, *t; + int token_end, i; + + t = shell_input_line; + i = shell_input_line_index; + token_end = 0; + msg = (char *)NULL; + + if (i && t[i] == '\0') + i--; + + while (i && (whitespace (t[i]) || t[i] == '\n')) + i--; + + if (i) + token_end = i + 1; + + while (i && (member (t[i], " \n\t;|&") == 0)) + i--; + + while (i != token_end && (whitespace (t[i]) || t[i] == '\n')) + i++; + + /* Return our idea of the offending token. */ + if (token_end || (i == 0 && token_end == 0)) + { + if (token_end) + msg = substring (t, i, token_end); + else /* one-character token */ + { + msg = (char *)xmalloc (2); + msg[0] = t[i]; + msg[1] = '\0'; + } + } + + return (msg); +} + +static void +print_offending_line () +{ + char *msg; + int token_end; + + msg = savestring (shell_input_line); + token_end = strlen (msg); + while (token_end && msg[token_end - 1] == '\n') + msg[--token_end] = '\0'; + + parser_error (line_number, "`%s'", msg); + free (msg); +} + +/* Report a syntax error with line numbers, etc. + Call here for recoverable errors. If you have a message to print, + then place it in MESSAGE, otherwise pass NULL and this will figure + out an appropriate message for you. */ +static void +report_syntax_error (message) + char *message; +{ + char *msg, *p; + + if (message) + { + parser_error (line_number, "%s", message); + if (interactive && EOF_Reached) + EOF_Reached = 0; + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; + return; + } + + /* If the line of input we're reading is not null, try to find the + objectionable token. First, try to figure out what token the + parser's complaining about by looking at current_token. */ + if (current_token != 0 && EOF_Reached == 0 && (msg = error_token_from_token (current_token))) + { + if (ansic_shouldquote (msg)) + { + p = ansic_quote (msg, 0, NULL); + free (msg); + msg = p; + } + parser_error (line_number, _("syntax error near unexpected token `%s'"), msg); + free (msg); + + if (interactive == 0) + print_offending_line (); + + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; + return; + } + + /* If looking at the current token doesn't prove fruitful, try to find the + offending token by analyzing the text of the input line near the current + input line index and report what we find. */ + if (shell_input_line && *shell_input_line) + { + msg = error_token_from_text (); + if (msg) + { + parser_error (line_number, _("syntax error near `%s'"), msg); + free (msg); + } + + /* If not interactive, print the line containing the error. */ + if (interactive == 0) + print_offending_line (); + } + else + { + msg = EOF_Reached ? _("syntax error: unexpected end of file") : _("syntax error"); + parser_error (line_number, "%s", msg); + /* When the shell is interactive, this file uses EOF_Reached + only for error reporting. Other mechanisms are used to + decide whether or not to exit. */ + if (interactive && EOF_Reached) + EOF_Reached = 0; + } + + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; +} + +/* ??? Needed function. ??? We have to be able to discard the constructs + created during parsing. In the case of error, we want to return + allocated objects to the memory pool. In the case of no error, we want + to throw away the information about where the allocated objects live. + (dispose_command () will actually free the command.) */ +static void +discard_parser_constructs (error_p) + int error_p; +{ +} + +/************************************************ + * * + * EOF HANDLING * + * * + ************************************************/ + +/* Do that silly `type "bye" to exit' stuff. You know, "ignoreeof". */ + +/* A flag denoting whether or not ignoreeof is set. */ +int ignoreeof = 0; + +/* The number of times that we have encountered an EOF character without + another character intervening. When this gets above the limit, the + shell terminates. */ +int eof_encountered = 0; + +/* The limit for eof_encountered. */ +int eof_encountered_limit = 10; + +/* If we have EOF as the only input unit, this user wants to leave + the shell. If the shell is not interactive, then just leave. + Otherwise, if ignoreeof is set, and we haven't done this the + required number of times in a row, print a message. */ +static void +handle_eof_input_unit () +{ + if (interactive) + { + /* shell.c may use this to decide whether or not to write out the + history, among other things. We use it only for error reporting + in this file. */ + if (EOF_Reached) + EOF_Reached = 0; + + /* If the user wants to "ignore" eof, then let her do so, kind of. */ + if (ignoreeof) + { + if (eof_encountered < eof_encountered_limit) + { + fprintf (stderr, _("Use \"%s\" to leave the shell.\n"), + login_shell ? "logout" : "exit"); + eof_encountered++; + /* Reset the parsing state. */ + last_read_token = current_token = '\n'; + /* Reset the prompt string to be $PS1. */ + prompt_string_pointer = (char **)NULL; + prompt_again (); + return; + } + } + + /* In this case EOF should exit the shell. Do it now. */ + reset_parser (); + exit_builtin ((WORD_LIST *)NULL); + } + else + { + /* We don't write history files, etc., for non-interactive shells. */ + EOF_Reached = 1; + } +} + +/************************************************ + * * + * STRING PARSING FUNCTIONS * + * * + ************************************************/ + +/* It's very important that these two functions treat the characters + between ( and ) identically. */ + +static WORD_LIST parse_string_error; + +/* Take a string and run it through the shell parser, returning the + resultant word list. Used by compound array assignment. */ +WORD_LIST * +parse_string_to_word_list (s, flags, whom) + char *s; + int flags; + const char *whom; +{ + WORD_LIST *wl; + int tok, orig_current_token, orig_line_number, orig_input_terminator; + int orig_line_count; + int old_echo_input, old_expand_aliases; +#if defined (HISTORY) + int old_remember_on_history, old_history_expansion_inhibited; +#endif + +#if defined (HISTORY) + old_remember_on_history = remember_on_history; +# if defined (BANG_HISTORY) + old_history_expansion_inhibited = history_expansion_inhibited; +# endif + bash_history_disable (); +#endif + + orig_line_number = line_number; + orig_line_count = current_command_line_count; + orig_input_terminator = shell_input_line_terminator; + old_echo_input = echo_input_at_read; + old_expand_aliases = expand_aliases; + + push_stream (1); + last_read_token = WORD; /* WORD to allow reserved words here */ + current_command_line_count = 0; + echo_input_at_read = expand_aliases = 0; + + with_input_from_string (s, whom); + wl = (WORD_LIST *)NULL; + + if (flags & 1) + parser_state |= PST_COMPASSIGN|PST_REPARSE; + + while ((tok = read_token (READ)) != yacc_EOF) + { + if (tok == '\n' && *bash_input.location.string == '\0') + break; + if (tok == '\n') /* Allow newlines in compound assignments */ + continue; + if (tok != WORD && tok != ASSIGNMENT_WORD) + { + line_number = orig_line_number + line_number - 1; + orig_current_token = current_token; + current_token = tok; + yyerror (NULL); /* does the right thing */ + current_token = orig_current_token; + if (wl) + dispose_words (wl); + wl = &parse_string_error; + break; + } + wl = make_word_list (yylval.word, wl); + } + + last_read_token = '\n'; + pop_stream (); + +#if defined (HISTORY) + remember_on_history = old_remember_on_history; +# if defined (BANG_HISTORY) + history_expansion_inhibited = old_history_expansion_inhibited; +# endif /* BANG_HISTORY */ +#endif /* HISTORY */ + + echo_input_at_read = old_echo_input; + expand_aliases = old_expand_aliases; + + current_command_line_count = orig_line_count; + shell_input_line_terminator = orig_input_terminator; + + if (flags & 1) + parser_state &= ~(PST_COMPASSIGN|PST_REPARSE); + + if (wl == &parse_string_error) + { + last_command_exit_value = EXECUTION_FAILURE; + if (interactive_shell == 0 && posixly_correct) + jump_to_top_level (FORCE_EOF); + else + jump_to_top_level (DISCARD); + } + + return (REVERSE_LIST (wl, WORD_LIST *)); +} + +static char * +parse_compound_assignment (retlenp) + int *retlenp; +{ + WORD_LIST *wl, *rl; + int tok, orig_line_number, orig_token_size, orig_last_token, assignok; + char *saved_token, *ret; + + saved_token = token; + orig_token_size = token_buffer_size; + orig_line_number = line_number; + orig_last_token = last_read_token; + + last_read_token = WORD; /* WORD to allow reserved words here */ + + token = (char *)NULL; + token_buffer_size = 0; + + assignok = parser_state&PST_ASSIGNOK; /* XXX */ + + wl = (WORD_LIST *)NULL; /* ( */ + parser_state |= PST_COMPASSIGN; + + while ((tok = read_token (READ)) != ')') + { + if (tok == '\n') /* Allow newlines in compound assignments */ + { + if (SHOULD_PROMPT ()) + prompt_again (); + continue; + } + if (tok != WORD && tok != ASSIGNMENT_WORD) + { + current_token = tok; /* for error reporting */ + if (tok == yacc_EOF) /* ( */ + parser_error (orig_line_number, _("unexpected EOF while looking for matching `)'")); + else + yyerror(NULL); /* does the right thing */ + if (wl) + dispose_words (wl); + wl = &parse_string_error; + break; + } + wl = make_word_list (yylval.word, wl); + } + + FREE (token); + token = saved_token; + token_buffer_size = orig_token_size; + + parser_state &= ~PST_COMPASSIGN; + + if (wl == &parse_string_error) + { + last_command_exit_value = EXECUTION_FAILURE; + last_read_token = '\n'; /* XXX */ + if (interactive_shell == 0 && posixly_correct) + jump_to_top_level (FORCE_EOF); + else + jump_to_top_level (DISCARD); + } + + last_read_token = orig_last_token; /* XXX - was WORD? */ + + if (wl) + { + rl = REVERSE_LIST (wl, WORD_LIST *); + ret = string_list (rl); + dispose_words (rl); + } + else + ret = (char *)NULL; + + if (retlenp) + *retlenp = (ret && *ret) ? strlen (ret) : 0; + + if (assignok) + parser_state |= PST_ASSIGNOK; + + return ret; +} + +/************************************************ + * * + * SAVING AND RESTORING PARTIAL PARSE STATE * + * * + ************************************************/ + +sh_parser_state_t * +save_parser_state (ps) + sh_parser_state_t *ps; +{ + if (ps == 0) + ps = (sh_parser_state_t *)xmalloc (sizeof (sh_parser_state_t)); + if (ps == 0) + return ((sh_parser_state_t *)NULL); + + ps->parser_state = parser_state; + ps->token_state = save_token_state (); + + ps->input_line_terminator = shell_input_line_terminator; + ps->eof_encountered = eof_encountered; + + ps->prompt_string_pointer = prompt_string_pointer; + + ps->current_command_line_count = current_command_line_count; + +#if defined (HISTORY) + ps->remember_on_history = remember_on_history; +# if defined (BANG_HISTORY) + ps->history_expansion_inhibited = history_expansion_inhibited; +# endif +#endif + + ps->last_command_exit_value = last_command_exit_value; +#if defined (ARRAY_VARS) + ps->pipestatus = save_pipestatus_array (); +#endif + + ps->last_shell_builtin = last_shell_builtin; + ps->this_shell_builtin = this_shell_builtin; + + ps->expand_aliases = expand_aliases; + ps->echo_input_at_read = echo_input_at_read; + ps->need_here_doc = need_here_doc; + + ps->token = token; + ps->token_buffer_size = token_buffer_size; + /* Force reallocation on next call to read_token_word */ + token = 0; + token_buffer_size = 0; + + return (ps); +} + +void +restore_parser_state (ps) + sh_parser_state_t *ps; +{ + if (ps == 0) + return; + + parser_state = ps->parser_state; + if (ps->token_state) + { + restore_token_state (ps->token_state); + free (ps->token_state); + } + + shell_input_line_terminator = ps->input_line_terminator; + eof_encountered = ps->eof_encountered; + + prompt_string_pointer = ps->prompt_string_pointer; + + current_command_line_count = ps->current_command_line_count; + +#if defined (HISTORY) + remember_on_history = ps->remember_on_history; +# if defined (BANG_HISTORY) + history_expansion_inhibited = ps->history_expansion_inhibited; +# endif +#endif + + last_command_exit_value = ps->last_command_exit_value; +#if defined (ARRAY_VARS) + restore_pipestatus_array (ps->pipestatus); +#endif + + last_shell_builtin = ps->last_shell_builtin; + this_shell_builtin = ps->this_shell_builtin; + + expand_aliases = ps->expand_aliases; + echo_input_at_read = ps->echo_input_at_read; + need_here_doc = ps->need_here_doc; + + FREE (token); + token = ps->token; + token_buffer_size = ps->token_buffer_size; +} + +sh_input_line_state_t * +save_input_line_state (ls) + sh_input_line_state_t *ls; +{ + if (ls == 0) + ls = (sh_input_line_state_t *)xmalloc (sizeof (sh_input_line_state_t)); + if (ls == 0) + return ((sh_input_line_state_t *)NULL); + + ls->input_line = shell_input_line; + ls->input_line_size = shell_input_line_size; + ls->input_line_len = shell_input_line_len; + ls->input_line_index = shell_input_line_index; + + /* force reallocation */ + shell_input_line = 0; + shell_input_line_size = shell_input_line_len = shell_input_line_index = 0; + + return ls; +} + +void +restore_input_line_state (ls) + sh_input_line_state_t *ls; +{ + FREE (shell_input_line); + shell_input_line = ls->input_line; + shell_input_line_size = ls->input_line_size; + shell_input_line_len = ls->input_line_len; + shell_input_line_index = ls->input_line_index; + + set_line_mbstate (); +} + +/************************************************ + * * + * MULTIBYTE CHARACTER HANDLING * + * * + ************************************************/ + +#if defined (HANDLE_MULTIBYTE) +static void +set_line_mbstate () +{ + int c; + size_t i, previ, len; + mbstate_t mbs, prevs; + size_t mbclen; + + if (shell_input_line == NULL) + return; + len = strlen (shell_input_line); /* XXX - shell_input_line_len ? */ + FREE (shell_input_line_property); + shell_input_line_property = (char *)xmalloc (len + 1); + + memset (&prevs, '\0', sizeof (mbstate_t)); + for (i = previ = 0; i < len; i++) + { + mbs = prevs; + + c = shell_input_line[i]; + if (c == EOF) + { + size_t j; + for (j = i; j < len; j++) + shell_input_line_property[j] = 1; + break; + } + + mbclen = mbrlen (shell_input_line + previ, i - previ + 1, &mbs); + if (mbclen == 1 || mbclen == (size_t)-1) + { + mbclen = 1; + previ = i + 1; + } + else if (mbclen == (size_t)-2) + mbclen = 0; + else if (mbclen > 1) + { + mbclen = 0; + previ = i + 1; + prevs = mbs; + } + else + { + /* XXX - what to do if mbrlen returns 0? (null wide character) */ + size_t j; + for (j = i; j < len; j++) + shell_input_line_property[j] = 1; + break; + } + + shell_input_line_property[i] = mbclen; + } +} +#endif /* HANDLE_MULTIBYTE */ diff --git a/parser-built b/parser-built new file mode 100644 index 0000000..b280e40 --- /dev/null +++ b/parser-built @@ -0,0 +1,164 @@ +/* A Bison parser, made by GNU Bison 2.3. */ + +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + IF = 258, + THEN = 259, + ELSE = 260, + ELIF = 261, + FI = 262, + CASE = 263, + ESAC = 264, + FOR = 265, + SELECT = 266, + WHILE = 267, + UNTIL = 268, + DO = 269, + DONE = 270, + FUNCTION = 271, + COPROC = 272, + COND_START = 273, + COND_END = 274, + COND_ERROR = 275, + IN = 276, + BANG = 277, + TIME = 278, + TIMEOPT = 279, + TIMEIGN = 280, + WORD = 281, + ASSIGNMENT_WORD = 282, + REDIR_WORD = 283, + NUMBER = 284, + ARITH_CMD = 285, + ARITH_FOR_EXPRS = 286, + COND_CMD = 287, + AND_AND = 288, + OR_OR = 289, + GREATER_GREATER = 290, + LESS_LESS = 291, + LESS_AND = 292, + LESS_LESS_LESS = 293, + GREATER_AND = 294, + SEMI_SEMI = 295, + SEMI_AND = 296, + SEMI_SEMI_AND = 297, + LESS_LESS_MINUS = 298, + AND_GREATER = 299, + AND_GREATER_GREATER = 300, + LESS_GREATER = 301, + GREATER_BAR = 302, + BAR_AND = 303, + yacc_EOF = 304 + }; +#endif +/* Tokens. */ +#define IF 258 +#define THEN 259 +#define ELSE 260 +#define ELIF 261 +#define FI 262 +#define CASE 263 +#define ESAC 264 +#define FOR 265 +#define SELECT 266 +#define WHILE 267 +#define UNTIL 268 +#define DO 269 +#define DONE 270 +#define FUNCTION 271 +#define COPROC 272 +#define COND_START 273 +#define COND_END 274 +#define COND_ERROR 275 +#define IN 276 +#define BANG 277 +#define TIME 278 +#define TIMEOPT 279 +#define TIMEIGN 280 +#define WORD 281 +#define ASSIGNMENT_WORD 282 +#define REDIR_WORD 283 +#define NUMBER 284 +#define ARITH_CMD 285 +#define ARITH_FOR_EXPRS 286 +#define COND_CMD 287 +#define AND_AND 288 +#define OR_OR 289 +#define GREATER_GREATER 290 +#define LESS_LESS 291 +#define LESS_AND 292 +#define LESS_LESS_LESS 293 +#define GREATER_AND 294 +#define SEMI_SEMI 295 +#define SEMI_AND 296 +#define SEMI_SEMI_AND 297 +#define LESS_LESS_MINUS 298 +#define AND_GREATER 299 +#define AND_GREATER_GREATER 300 +#define LESS_GREATER 301 +#define GREATER_BAR 302 +#define BAR_AND 303 +#define yacc_EOF 304 + + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 324 "/usr/homes/chet/src/bash/src/parse.y" +{ + WORD_DESC *word; /* the word that we read. */ + int number; /* the number that we read. */ + WORD_LIST *word_list; + COMMAND *command; + REDIRECT *redirect; + ELEMENT element; + PATTERN_LIST *pattern; +} +/* Line 1529 of yacc.c. */ +#line 157 "y.tab.h" + YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + +extern YYSTYPE yylval; + diff --git a/parser.h b/parser.h new file mode 100644 index 0000000..8d396df --- /dev/null +++ b/parser.h @@ -0,0 +1,73 @@ +/* parser.h -- Everything you wanted to know about the parser, but were + afraid to ask. */ + +/* Copyright (C) 1995-2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PARSER_H_) +# define _PARSER_H_ + +# include "command.h" +# include "input.h" + +/* Possible states for the parser that require it to do special things. */ +#define PST_CASEPAT 0x000001 /* in a case pattern list */ +#define PST_ALEXPNEXT 0x000002 /* expand next word for aliases */ +#define PST_ALLOWOPNBRC 0x000004 /* allow open brace for function def */ +#define PST_NEEDCLOSBRC 0x000008 /* need close brace */ +#define PST_DBLPAREN 0x000010 /* double-paren parsing */ +#define PST_SUBSHELL 0x000020 /* ( ... ) subshell */ +#define PST_CMDSUBST 0x000040 /* $( ... ) command substitution */ +#define PST_CASESTMT 0x000080 /* parsing a case statement */ +#define PST_CONDCMD 0x000100 /* parsing a [[...]] command */ +#define PST_CONDEXPR 0x000200 /* parsing the guts of [[...]] */ +#define PST_ARITHFOR 0x000400 /* parsing an arithmetic for command - unused */ +#define PST_ALEXPAND 0x000800 /* OK to expand aliases - unused */ +#define PST_EXTPAT 0x001000 /* parsing an extended shell pattern */ +#define PST_COMPASSIGN 0x002000 /* parsing x=(...) compound assignment */ +#define PST_ASSIGNOK 0x004000 /* assignment statement ok in this context */ +#define PST_EOFTOKEN 0x008000 /* yylex checks against shell_eof_token */ +#define PST_REGEXP 0x010000 /* parsing an ERE/BRE as a single word */ +#define PST_HEREDOC 0x020000 /* reading body of here-document */ +#define PST_REPARSE 0x040000 /* re-parsing in parse_string_to_word_list */ +#define PST_REDIRLIST 0x080000 /* parsing a list of redirections preceding a simple command name */ + + +/* Definition of the delimiter stack. Needed by parse.y and bashhist.c. */ +struct dstack { +/* DELIMITERS is a stack of the nested delimiters that we have + encountered so far. */ + char *delimiters; + +/* Offset into the stack of delimiters. */ + int delimiter_depth; + +/* How many slots are allocated to DELIMITERS. */ + int delimiter_space; +}; + +/* States we can be in while scanning a ${...} expansion. Shared between + parse.y and subst.c */ +#define DOLBRACE_PARAM 0x01 +#define DOLBRACE_OP 0x02 +#define DOLBRACE_WORD 0x04 + +#define DOLBRACE_QUOTE 0x40 /* single quote is special in double quotes */ +#define DOLBRACE_QUOTE2 0x80 /* single quote is semi-special in double quotes */ + +#endif /* _PARSER_H_ */ diff --git a/patchlevel.h b/patchlevel.h new file mode 100644 index 0000000..e987c57 --- /dev/null +++ b/patchlevel.h @@ -0,0 +1,30 @@ +/* patchlevel.h -- current bash patch level */ + +/* Copyright (C) 2001-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATCHLEVEL_H_) +#define _PATCHLEVEL_H_ + +/* It's important that there be no other strings in this file that match the + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +#define PATCHLEVEL 25 + +#endif /* _PATCHLEVEL_H_ */ diff --git a/pathexp.c b/pathexp.c new file mode 100644 index 0000000..d7315e3 --- /dev/null +++ b/pathexp.c @@ -0,0 +1,609 @@ +/* pathexp.c -- The shell interface to the globbing library. */ + +/* Copyright (C) 1995-2014 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" + +#include "shell.h" +#include "pathexp.h" +#include "flags.h" + +#include "shmbutil.h" +#include "bashintl.h" + +#include + +static int glob_name_is_acceptable __P((const char *)); +static void ignore_globbed_names __P((char **, sh_ignore_func_t *)); +static char *split_ignorespec __P((char *, int *)); + +#if defined (USE_POSIX_GLOB_LIBRARY) +# include +typedef int posix_glob_errfunc_t __P((const char *, int)); +#else +# include +#endif + +/* Control whether * matches .files in globbing. */ +int glob_dot_filenames; + +/* Control whether the extended globbing features are enabled. */ +int extended_glob = EXTGLOB_DEFAULT; + +/* Control enabling special handling of `**' */ +int glob_star = 0; + +/* Return nonzero if STRING has any unquoted special globbing chars in it. */ +int +unquoted_glob_pattern_p (string) + register char *string; +{ + register int c; + char *send; + int open; + + DECLARE_MBSTATE; + + open = 0; + send = string + strlen (string); + + while (c = *string++) + { + switch (c) + { + case '?': + case '*': + return (1); + + case '[': + open++; + continue; + + case ']': + if (open) + return (1); + continue; + + case '+': + case '@': + case '!': + if (*string == '(') /*)*/ + return (1); + continue; + + case CTLESC: + case '\\': + if (*string++ == '\0') + return (0); + } + + /* Advance one fewer byte than an entire multibyte character to + account for the auto-increment in the loop above. */ +#ifdef HANDLE_MULTIBYTE + string--; + ADVANCE_CHAR_P (string, send - string); + string++; +#else + ADVANCE_CHAR_P (string, send - string); +#endif + } + return (0); +} + +/* Return 1 if C is a character that is `special' in a POSIX ERE and needs to + be quoted to match itself. */ +static inline int +ere_char (c) + int c; +{ + switch (c) + { + case '.': + case '[': + case '\\': + case '(': + case ')': + case '*': + case '+': + case '?': + case '{': + case '|': + case '^': + case '$': + return 1; + default: + return 0; + } + return (0); +} + +int +glob_char_p (s) + const char *s; +{ + switch (*s) + { + case '*': + case '[': + case ']': + case '?': + case '\\': + return 1; + case '+': + case '@': + case '!': + if (s[1] == '(') /*(*/ + return 1; + break; + } + return 0; +} + +/* PATHNAME can contain characters prefixed by CTLESC; this indicates + that the character is to be quoted. We quote it here in the style + that the glob library recognizes. If flags includes QGLOB_CVTNULL, + we change quoted null strings (pathname[0] == CTLNUL) into empty + strings (pathname[0] == 0). If this is called after quote removal + is performed, (flags & QGLOB_CVTNULL) should be 0; if called when quote + removal has not been done (for example, before attempting to match a + pattern while executing a case statement), flags should include + QGLOB_CVTNULL. If flags includes QGLOB_FILENAME, appropriate quoting + to match a filename should be performed. QGLOB_REGEXP means we're + quoting for a Posix ERE (for [[ string =~ pat ]]) and that requires + some special handling. */ +char * +quote_string_for_globbing (pathname, qflags) + const char *pathname; + int qflags; +{ + char *temp; + register int i, j; + int brack, cclass, collsym, equiv, c, last_was_backslash; + + temp = (char *)xmalloc (2 * strlen (pathname) + 1); + + if ((qflags & QGLOB_CVTNULL) && QUOTED_NULL (pathname)) + { + temp[0] = '\0'; + return temp; + } + + brack = cclass = collsym = equiv = last_was_backslash = 0; + for (i = j = 0; pathname[i]; i++) + { + /* Fix for CTLESC at the end of the string? */ + if (pathname[i] == CTLESC && pathname[i+1] == '\0') + { + temp[j++] = pathname[i++]; + break; + } + /* If we are parsing regexp, turn CTLESC CTLESC into CTLESC. It's not an + ERE special character, so we should just be able to pass it through. */ + else if ((qflags & QGLOB_REGEXP) && pathname[i] == CTLESC && pathname[i+1] == CTLESC) + { + i++; + temp[j++] = pathname[i]; + continue; + } + else if (pathname[i] == CTLESC) + { + if ((qflags & QGLOB_FILENAME) && pathname[i+1] == '/') + continue; + /* What to do if preceding char is backslash? */ + if (pathname[i+1] != CTLESC && (qflags & QGLOB_REGEXP) && ere_char (pathname[i+1]) == 0) + continue; + temp[j++] = '\\'; + i++; + if (pathname[i] == '\0') + break; + } + else if ((qflags & QGLOB_REGEXP) && (i == 0 || pathname[i-1] != CTLESC) && pathname[i] == '[') /*]*/ + { + brack = 1; + temp[j++] = pathname[i++]; /* open bracket */ + c = pathname[i++]; /* c == char after open bracket */ + do + { + if (c == 0) + goto endpat; + else if (c == CTLESC) + { + /* skip c, check for EOS, let assignment at end of loop */ + /* pathname[i] == backslash-escaped character */ + if (pathname[i] == 0) + goto endpat; + temp[j++] = pathname[i++]; + } + else if (c == '[' && pathname[i] == ':') + { + temp[j++] = c; + temp[j++] = pathname[i++]; + cclass = 1; + } + else if (cclass && c == ':' && pathname[i] == ']') + { + temp[j++] = c; + temp[j++] = pathname[i++]; + cclass = 0; + } + else if (c == '[' && pathname[i] == '=') + { + temp[j++] = c; + temp[j++] = pathname[i++]; + if (pathname[i] == ']') + temp[j++] = pathname[i++]; /* right brack can be in equiv */ + equiv = 1; + } + else if (equiv && c == '=' && pathname[i] == ']') + { + temp[j++] = c; + temp[j++] = pathname[i++]; + equiv = 0; + } + else if (c == '[' && pathname[i] == '.') + { + temp[j++] = c; + temp[j++] = pathname[i++]; + if (pathname[i] == ']') + temp[j++] = pathname[i++]; /* right brack can be in collsym */ + collsym = 1; + } + else if (collsym && c == '.' && pathname[i] == ']') + { + temp[j++] = c; + temp[j++] = pathname[i++]; + collsym = 0; + } + else + temp[j++] = c; + } + while ((c = pathname[i++]) != ']'); + temp[j++] = c; /* closing right bracket */ + i--; /* increment will happen above in loop */ + continue; /* skip double assignment below */ + } + else if (pathname[i] == '\\' && (qflags & QGLOB_REGEXP) == 0) + { + /* XXX - if not quoting regexp, use backslash as quote char. Should + we just pass it through without treating it as special? That is + what ksh93 seems to do. */ + + /* If we want to pass through backslash unaltered, comment out these + lines. */ + temp[j++] = '\\'; + + i++; + if (pathname[i] == '\0') + break; + } + else if (pathname[i] == '\\' && (qflags & QGLOB_REGEXP)) + last_was_backslash = 1; + temp[j++] = pathname[i]; + } +endpat: + temp[j] = '\0'; + + return (temp); +} + +char * +quote_globbing_chars (string) + char *string; +{ + size_t slen; + char *temp, *s, *t, *send; + DECLARE_MBSTATE; + + slen = strlen (string); + send = string + slen; + + temp = (char *)xmalloc (slen * 2 + 1); + for (t = temp, s = string; *s; ) + { + if (glob_char_p (s)) + *t++ = '\\'; + + /* Copy a single (possibly multibyte) character from s to t, + incrementing both. */ + COPY_CHAR_P (t, s, send); + } + *t = '\0'; + return temp; +} + +/* Call the glob library to do globbing on PATHNAME. */ +char ** +shell_glob_filename (pathname) + const char *pathname; +{ +#if defined (USE_POSIX_GLOB_LIBRARY) + register int i; + char *temp, **results; + glob_t filenames; + int glob_flags; + + temp = quote_string_for_globbing (pathname, QGLOB_FILENAME); + + filenames.gl_offs = 0; + +# if defined (GLOB_PERIOD) + glob_flags = glob_dot_filenames ? GLOB_PERIOD : 0; +# else + glob_flags = 0; +# endif /* !GLOB_PERIOD */ + + glob_flags |= (GLOB_ERR | GLOB_DOOFFS); + + i = glob (temp, glob_flags, (posix_glob_errfunc_t *)NULL, &filenames); + + free (temp); + + if (i == GLOB_NOSPACE || i == GLOB_ABORTED) + return ((char **)NULL); + else if (i == GLOB_NOMATCH) + filenames.gl_pathv = (char **)NULL; + else if (i != 0) /* other error codes not in POSIX.2 */ + filenames.gl_pathv = (char **)NULL; + + results = filenames.gl_pathv; + + if (results && ((GLOB_FAILED (results)) == 0)) + { + if (should_ignore_glob_matches ()) + ignore_glob_matches (results); + if (results && results[0]) + strvec_sort (results); + else + { + FREE (results); + results = (char **)NULL; + } + } + + return (results); + +#else /* !USE_POSIX_GLOB_LIBRARY */ + + char *temp, **results; + + noglob_dot_filenames = glob_dot_filenames == 0; + + temp = quote_string_for_globbing (pathname, QGLOB_FILENAME); + results = glob_filename (temp, glob_star ? GX_GLOBSTAR : 0); + free (temp); + + if (results && ((GLOB_FAILED (results)) == 0)) + { + if (should_ignore_glob_matches ()) + ignore_glob_matches (results); + if (results && results[0]) + strvec_sort (results); + else + { + FREE (results); + results = (char **)&glob_error_return; + } + } + + return (results); +#endif /* !USE_POSIX_GLOB_LIBRARY */ +} + +/* Stuff for GLOBIGNORE. */ + +static struct ignorevar globignore = +{ + "GLOBIGNORE", + (struct ign *)0, + 0, + (char *)0, + (sh_iv_item_func_t *)0, +}; + +/* Set up to ignore some glob matches because the value of GLOBIGNORE + has changed. If GLOBIGNORE is being unset, we also need to disable + the globbing of filenames beginning with a `.'. */ +void +setup_glob_ignore (name) + char *name; +{ + char *v; + + v = get_string_value (name); + setup_ignore_patterns (&globignore); + + if (globignore.num_ignores) + glob_dot_filenames = 1; + else if (v == 0) + glob_dot_filenames = 0; +} + +int +should_ignore_glob_matches () +{ + return globignore.num_ignores; +} + +/* Return 0 if NAME matches a pattern in the globignore.ignores list. */ +static int +glob_name_is_acceptable (name) + const char *name; +{ + struct ign *p; + int flags; + + /* . and .. are never matched */ + if (name[0] == '.' && (name[1] == '\0' || (name[1] == '.' && name[2] == '\0'))) + return (0); + + flags = FNM_PATHNAME | FNMATCH_EXTFLAG; + for (p = globignore.ignores; p->val; p++) + { + if (strmatch (p->val, (char *)name, flags) != FNM_NOMATCH) + return (0); + } + return (1); +} + +/* Internal function to test whether filenames in NAMES should be + ignored. NAME_FUNC is a pointer to a function to call with each + name. It returns non-zero if the name is acceptable to the particular + ignore function which called _ignore_names; zero if the name should + be removed from NAMES. */ + +static void +ignore_globbed_names (names, name_func) + char **names; + sh_ignore_func_t *name_func; +{ + char **newnames; + int n, i; + + for (i = 0; names[i]; i++) + ; + newnames = strvec_create (i + 1); + + for (n = i = 0; names[i]; i++) + { + if ((*name_func) (names[i])) + newnames[n++] = names[i]; + else + free (names[i]); + } + + newnames[n] = (char *)NULL; + + if (n == 0) + { + names[0] = (char *)NULL; + free (newnames); + return; + } + + /* Copy the acceptable names from NEWNAMES back to NAMES and set the + new array end. */ + for (n = 0; newnames[n]; n++) + names[n] = newnames[n]; + names[n] = (char *)NULL; + free (newnames); +} + +void +ignore_glob_matches (names) + char **names; +{ + if (globignore.num_ignores == 0) + return; + + ignore_globbed_names (names, glob_name_is_acceptable); +} + +static char * +split_ignorespec (s, ip) + char *s; + int *ip; +{ + char *t; + int n, i; + + if (s == 0) + return 0; + + i = *ip; + if (s[i] == 0) + return 0; + + n = skip_to_delim (s, i, ":", SD_NOJMP|SD_EXTGLOB); + t = substring (s, i, n); + + if (s[n] == ':') + n++; + *ip = n; + return t; +} + +void +setup_ignore_patterns (ivp) + struct ignorevar *ivp; +{ + int numitems, maxitems, ptr; + char *colon_bit, *this_ignoreval; + struct ign *p; + + this_ignoreval = get_string_value (ivp->varname); + + /* If nothing has changed then just exit now. */ + if ((this_ignoreval && ivp->last_ignoreval && STREQ (this_ignoreval, ivp->last_ignoreval)) || + (!this_ignoreval && !ivp->last_ignoreval)) + return; + + /* Oops. The ignore variable has changed. Re-parse it. */ + ivp->num_ignores = 0; + + if (ivp->ignores) + { + for (p = ivp->ignores; p->val; p++) + free(p->val); + free (ivp->ignores); + ivp->ignores = (struct ign *)NULL; + } + + if (ivp->last_ignoreval) + { + free (ivp->last_ignoreval); + ivp->last_ignoreval = (char *)NULL; + } + + if (this_ignoreval == 0 || *this_ignoreval == '\0') + return; + + ivp->last_ignoreval = savestring (this_ignoreval); + + numitems = maxitems = ptr = 0; + +#if 0 + while (colon_bit = extract_colon_unit (this_ignoreval, &ptr)) +#else + while (colon_bit = split_ignorespec (this_ignoreval, &ptr)) +#endif + { + if (numitems + 1 >= maxitems) + { + maxitems += 10; + ivp->ignores = (struct ign *)xrealloc (ivp->ignores, maxitems * sizeof (struct ign)); + } + ivp->ignores[numitems].val = colon_bit; + ivp->ignores[numitems].len = strlen (colon_bit); + ivp->ignores[numitems].flags = 0; + if (ivp->item_func) + (*ivp->item_func) (&ivp->ignores[numitems]); + numitems++; + } + ivp->ignores[numitems].val = (char *)NULL; + ivp->num_ignores = numitems; +} diff --git a/pathexp.h b/pathexp.h new file mode 100644 index 0000000..20d0baf --- /dev/null +++ b/pathexp.h @@ -0,0 +1,102 @@ +/* pathexp.h -- The shell interface to the globbing library. */ + +/* Copyright (C) 1987-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATHEXP_H_) +#define _PATHEXP_H_ + +#if defined (USE_POSIX_GLOB_LIBRARY) +# define GLOB_FAILED(glist) !(glist) +#else /* !USE_POSIX_GLOB_LIBRARY */ +# define GLOB_FAILED(glist) (glist) == (char **)&glob_error_return +extern int noglob_dot_filenames; +extern char *glob_error_return; +#endif /* !USE_POSIX_GLOB_LIBRARY */ + +/* Flag values for quote_string_for_globbing */ +#define QGLOB_CVTNULL 0x01 /* convert QUOTED_NULL strings to '\0' */ +#define QGLOB_FILENAME 0x02 /* do correct quoting for matching filenames */ +#define QGLOB_REGEXP 0x04 /* quote an ERE for regcomp/regexec */ + +#if defined (EXTENDED_GLOB) +/* Flags to OR with other flag args to strmatch() to enabled the extended + pattern matching. */ +# define FNMATCH_EXTFLAG (extended_glob ? FNM_EXTMATCH : 0) +#else +# define FNMATCH_EXTFLAG 0 +#endif /* !EXTENDED_GLOB */ + +#define FNMATCH_IGNCASE (match_ignore_case ? FNM_CASEFOLD : 0) + +extern int glob_dot_filenames; +extern int extended_glob; +extern int glob_star; +extern int match_ignore_case; /* doesn't really belong here */ + +extern int unquoted_glob_pattern_p __P((char *)); + +/* PATHNAME can contain characters prefixed by CTLESC; this indicates + that the character is to be quoted. We quote it here in the style + that the glob library recognizes. If flags includes QGLOB_CVTNULL, + we change quoted null strings (pathname[0] == CTLNUL) into empty + strings (pathname[0] == 0). If this is called after quote removal + is performed, (flags & QGLOB_CVTNULL) should be 0; if called when quote + removal has not been done (for example, before attempting to match a + pattern while executing a case statement), flags should include + QGLOB_CVTNULL. If flags includes QGLOB_FILENAME, appropriate quoting + to match a filename should be performed. */ +extern char *quote_string_for_globbing __P((const char *, int)); + +extern int glob_char_p __P((const char *)); +extern char *quote_globbing_chars __P((char *)); + +/* Call the glob library to do globbing on PATHNAME. */ +extern char **shell_glob_filename __P((const char *)); + +/* Filename completion ignore. Used to implement the "fignore" facility of + tcsh and GLOBIGNORE (like ksh-93 FIGNORE). + + It is passed a NULL-terminated array of (char *)'s that must be + free()'d if they are deleted. The first element (names[0]) is the + least-common-denominator string of the matching patterns (i.e. + u produces names[0] = "und", names[1] = "under.c", names[2] = + "undun.c", name[3] = NULL). */ + +struct ign { + char *val; + int len, flags; +}; + +typedef int sh_iv_item_func_t __P((struct ign *)); + +struct ignorevar { + char *varname; /* FIGNORE or GLOBIGNORE */ + struct ign *ignores; /* Store the ignore strings here */ + int num_ignores; /* How many are there? */ + char *last_ignoreval; /* Last value of variable - cached for speed */ + sh_iv_item_func_t *item_func; /* Called when each item is parsed from $`varname' */ +}; + +extern void setup_ignore_patterns __P((struct ignorevar *)); + +extern void setup_glob_ignore __P((char *)); +extern int should_ignore_glob_matches __P((void)); +extern void ignore_glob_matches __P((char **)); + +#endif diff --git a/pathnames.h.in b/pathnames.h.in new file mode 100644 index 0000000..38d0939 --- /dev/null +++ b/pathnames.h.in @@ -0,0 +1,33 @@ +/* pathnames.h -- absolute filenames that bash wants for various defaults. */ + +/* Copyright (C) 1987-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PATHNAMES_H_) +#define _PATHNAMES_H_ + +/* The default file for hostname completion. */ +#define DEFAULT_HOSTS_FILE "/etc/hosts" + +/* The default login shell startup file. */ +#define SYS_PROFILE "/etc/profile" + +/* The default location of the bash debugger initialization/startup file. */ +#define DEBUGGER_START_FILE "@DEBUGGER_START_FILE@" + +#endif /* _PATHNAMES_H */ diff --git a/pcomplete.c b/pcomplete.c new file mode 100644 index 0000000..70cbc98 --- /dev/null +++ b/pcomplete.c @@ -0,0 +1,1662 @@ +/* pcomplete.c - functions to generate lists of matches for programmable completion. */ + +/* Copyright (C) 1999-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (PROGRAMMABLE_COMPLETION) + +#include "bashtypes.h" +#include "posixstat.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include + +#if defined (PREFER_STDARG) +# include +#else +# include +#endif + +#include + +#include +#include "bashansi.h" +#include "bashintl.h" + +#include "shell.h" +#include "pcomplete.h" +#include "alias.h" +#include "bashline.h" +#include "execute_cmd.h" +#include "pathexp.h" + +#if defined (JOB_CONTROL) +# include "jobs.h" +#endif + +#if !defined (NSIG) +# include "trap.h" +#endif + +#include "shmbutil.h" + +#include "builtins.h" +#include "builtins/common.h" +#include "builtins/builtext.h" + +#include +#include + +#include +#include +#include + +#define PCOMP_RETRYFAIL 256 + +#ifdef STRDUP +# undef STRDUP +#endif +#define STRDUP(x) ((x) ? savestring (x) : (char *)NULL) + +typedef SHELL_VAR **SVFUNC (); + +#ifndef HAVE_STRPBRK +extern char *strpbrk __P((char *, char *)); +#endif + +extern int array_needs_making; +extern STRING_INT_ALIST word_token_alist[]; +extern char *signal_names[]; +extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin; + +#if defined (DEBUG) +#if defined (PREFER_STDARG) +static void debug_printf (const char *, ...) __attribute__((__format__ (printf, 1, 2))); +#endif +#endif /* DEBUG */ + +static int it_init_joblist __P((ITEMLIST *, int)); + +static int it_init_aliases __P((ITEMLIST *)); +static int it_init_arrayvars __P((ITEMLIST *)); +static int it_init_bindings __P((ITEMLIST *)); +static int it_init_builtins __P((ITEMLIST *)); +static int it_init_disabled __P((ITEMLIST *)); +static int it_init_enabled __P((ITEMLIST *)); +static int it_init_exported __P((ITEMLIST *)); +static int it_init_functions __P((ITEMLIST *)); +static int it_init_helptopics __P((ITEMLIST *)); +static int it_init_hostnames __P((ITEMLIST *)); +static int it_init_jobs __P((ITEMLIST *)); +static int it_init_running __P((ITEMLIST *)); +static int it_init_stopped __P((ITEMLIST *)); +static int it_init_keywords __P((ITEMLIST *)); +static int it_init_signals __P((ITEMLIST *)); +static int it_init_variables __P((ITEMLIST *)); +static int it_init_setopts __P((ITEMLIST *)); +static int it_init_shopts __P((ITEMLIST *)); + +static int shouldexp_filterpat __P((char *)); +static char *preproc_filterpat __P((char *, char *)); + +static void init_itemlist_from_varlist __P((ITEMLIST *, SVFUNC *)); + +static STRINGLIST *gen_matches_from_itemlist __P((ITEMLIST *, const char *)); +static STRINGLIST *gen_action_completions __P((COMPSPEC *, const char *)); +static STRINGLIST *gen_globpat_matches __P((COMPSPEC *, const char *)); +static STRINGLIST *gen_wordlist_matches __P((COMPSPEC *, const char *)); +static STRINGLIST *gen_shell_function_matches __P((COMPSPEC *, const char *, + const char *, + char *, int, WORD_LIST *, + int, int, int *)); +static STRINGLIST *gen_command_matches __P((COMPSPEC *, const char *, + const char *, + char *, int, WORD_LIST *, + int, int)); + +static STRINGLIST *gen_progcomp_completions __P((const char *, const char *, + const char *, + int, int, int *, int *, + COMPSPEC **)); + +static char *pcomp_filename_completion_function __P((const char *, int)); + +#if defined (ARRAY_VARS) +static SHELL_VAR *bind_comp_words __P((WORD_LIST *)); +#endif +static void bind_compfunc_variables __P((char *, int, WORD_LIST *, int, int)); +static void unbind_compfunc_variables __P((int)); +static WORD_LIST *build_arg_list __P((char *, const char *, const char *, WORD_LIST *, int)); +static WORD_LIST *command_line_to_word_list __P((char *, int, int, int *, int *)); + +#ifdef DEBUG +static int progcomp_debug = 0; +#endif + +int prog_completion_enabled = 1; + +/* These are used to manage the arrays of strings for possible completions. */ +ITEMLIST it_aliases = { 0, it_init_aliases, (STRINGLIST *)0 }; +ITEMLIST it_arrayvars = { LIST_DYNAMIC, it_init_arrayvars, (STRINGLIST *)0 }; +ITEMLIST it_bindings = { 0, it_init_bindings, (STRINGLIST *)0 }; +ITEMLIST it_builtins = { 0, it_init_builtins, (STRINGLIST *)0 }; +ITEMLIST it_commands = { LIST_DYNAMIC }; /* unused */ +ITEMLIST it_directories = { LIST_DYNAMIC }; /* unused */ +ITEMLIST it_disabled = { 0, it_init_disabled, (STRINGLIST *)0 }; +ITEMLIST it_enabled = { 0, it_init_enabled, (STRINGLIST *)0 }; +ITEMLIST it_exports = { LIST_DYNAMIC, it_init_exported, (STRINGLIST *)0 }; +ITEMLIST it_files = { LIST_DYNAMIC }; /* unused */ +ITEMLIST it_functions = { 0, it_init_functions, (STRINGLIST *)0 }; +ITEMLIST it_helptopics = { 0, it_init_helptopics, (STRINGLIST *)0 }; +ITEMLIST it_hostnames = { LIST_DYNAMIC, it_init_hostnames, (STRINGLIST *)0 }; +ITEMLIST it_groups = { LIST_DYNAMIC }; /* unused */ +ITEMLIST it_jobs = { LIST_DYNAMIC, it_init_jobs, (STRINGLIST *)0 }; +ITEMLIST it_keywords = { 0, it_init_keywords, (STRINGLIST *)0 }; +ITEMLIST it_running = { LIST_DYNAMIC, it_init_running, (STRINGLIST *)0 }; +ITEMLIST it_services = { LIST_DYNAMIC }; /* unused */ +ITEMLIST it_setopts = { 0, it_init_setopts, (STRINGLIST *)0 }; +ITEMLIST it_shopts = { 0, it_init_shopts, (STRINGLIST *)0 }; +ITEMLIST it_signals = { 0, it_init_signals, (STRINGLIST *)0 }; +ITEMLIST it_stopped = { LIST_DYNAMIC, it_init_stopped, (STRINGLIST *)0 }; +ITEMLIST it_users = { LIST_DYNAMIC }; /* unused */ +ITEMLIST it_variables = { LIST_DYNAMIC, it_init_variables, (STRINGLIST *)0 }; + +COMPSPEC *pcomp_curcs; +const char *pcomp_curcmd; +const char *pcomp_curtxt; + +#ifdef DEBUG +/* Debugging code */ +static void +#if defined (PREFER_STDARG) +debug_printf (const char *format, ...) +#else +debug_printf (format, va_alist) + const char *format; + va_dcl +#endif +{ + va_list args; + + if (progcomp_debug == 0) + return; + + SH_VA_START (args, format); + + fprintf (stdout, "DEBUG: "); + vfprintf (stdout, format, args); + fprintf (stdout, "\n"); + + rl_on_new_line (); + + va_end (args); +} +#endif + +/* Functions to manage the item lists */ + +void +set_itemlist_dirty (it) + ITEMLIST *it; +{ + it->flags |= LIST_DIRTY; +} + +void +initialize_itemlist (itp) + ITEMLIST *itp; +{ + (*itp->list_getter) (itp); + itp->flags |= LIST_INITIALIZED; + itp->flags &= ~LIST_DIRTY; +} + +void +clean_itemlist (itp) + ITEMLIST *itp; +{ + STRINGLIST *sl; + + sl = itp->slist; + if (sl) + { + if ((itp->flags & (LIST_DONTFREEMEMBERS|LIST_DONTFREE)) == 0) + strvec_flush (sl->list); + if ((itp->flags & LIST_DONTFREE) == 0) + free (sl->list); + free (sl); + } + itp->slist = (STRINGLIST *)NULL; + itp->flags &= ~(LIST_DONTFREE|LIST_DONTFREEMEMBERS|LIST_INITIALIZED|LIST_DIRTY); +} + + +static int +shouldexp_filterpat (s) + char *s; +{ + register char *p; + + for (p = s; p && *p; p++) + { + if (*p == '\\') + p++; + else if (*p == '&') + return 1; + } + return 0; +} + +/* Replace any instance of `&' in PAT with TEXT. Backslash may be used to + quote a `&' and inhibit substitution. Returns a new string. This just + calls stringlib.c:strcreplace(). */ +static char * +preproc_filterpat (pat, text) + char *pat; + char *text; +{ + char *ret; + + ret = strcreplace (pat, '&', text, 1); + return ret; +} + +/* Remove any match of FILTERPAT from SL. A `&' in FILTERPAT is replaced by + TEXT. A leading `!' in FILTERPAT negates the pattern; in this case + any member of SL->list that does *not* match will be removed. This returns + a new STRINGLIST with the matching members of SL *copied*. Any + non-matching members of SL->list are *freed*. */ +STRINGLIST * +filter_stringlist (sl, filterpat, text) + STRINGLIST *sl; + char *filterpat, *text; +{ + int i, m, not; + STRINGLIST *ret; + char *npat, *t; + + if (sl == 0 || sl->list == 0 || sl->list_len == 0) + return sl; + + npat = shouldexp_filterpat (filterpat) ? preproc_filterpat (filterpat, text) : filterpat; + + not = (npat[0] == '!'); + t = not ? npat + 1 : npat; + + ret = strlist_create (sl->list_size); + for (i = 0; i < sl->list_len; i++) + { + m = strmatch (t, sl->list[i], FNMATCH_EXTFLAG); + if ((not && m == FNM_NOMATCH) || (not == 0 && m != FNM_NOMATCH)) + free (sl->list[i]); + else + ret->list[ret->list_len++] = sl->list[i]; + } + + ret->list[ret->list_len] = (char *)NULL; + if (npat != filterpat) + free (npat); + + return ret; +} + +/* Turn an array of strings returned by rl_completion_matches into a STRINGLIST. + This understands how rl_completion_matches sets matches[0] (the lcd of the + strings in the list, unless it's the only match). */ +STRINGLIST * +completions_to_stringlist (matches) + char **matches; +{ + STRINGLIST *sl; + int mlen, i, n; + + mlen = (matches == 0) ? 0 : strvec_len (matches); + sl = strlist_create (mlen + 1); + + if (matches == 0 || matches[0] == 0) + return sl; + + if (matches[1] == 0) + { + sl->list[0] = STRDUP (matches[0]); + sl->list[sl->list_len = 1] = (char *)NULL; + return sl; + } + + for (i = 1, n = 0; i < mlen; i++, n++) + sl->list[n] = STRDUP (matches[i]); + sl->list_len = n; + sl->list[n] = (char *)NULL; + + return sl; +} + +/* Functions to manage the various ITEMLISTs that we populate internally. + The caller is responsible for setting ITP->flags correctly. */ + +static int +it_init_aliases (itp) + ITEMLIST *itp; +{ +#ifdef ALIAS + alias_t **alias_list; + register int i, n; + STRINGLIST *sl; + + alias_list = all_aliases (); + if (alias_list == 0) + { + itp->slist = (STRINGLIST *)NULL; + return 0; + } + for (n = 0; alias_list[n]; n++) + ; + sl = strlist_create (n+1); + for (i = 0; i < n; i++) + sl->list[i] = STRDUP (alias_list[i]->name); + sl->list[n] = (char *)NULL; + sl->list_size = sl->list_len = n; + itp->slist = sl; +#else + itp->slist = (STRINGLIST *)NULL; +#endif + free (alias_list); + return 1; +} + +static void +init_itemlist_from_varlist (itp, svfunc) + ITEMLIST *itp; + SVFUNC *svfunc; +{ + SHELL_VAR **vlist; + STRINGLIST *sl; + register int i, n; + + vlist = (*svfunc) (); + if (vlist == 0) + { + itp->slist = (STRINGLIST *)NULL; + return; + } + for (n = 0; vlist[n]; n++) + ; + sl = strlist_create (n+1); + for (i = 0; i < n; i++) + sl->list[i] = savestring (vlist[i]->name); + sl->list[sl->list_len = n] = (char *)NULL; + itp->slist = sl; +} + +static int +it_init_arrayvars (itp) + ITEMLIST *itp; +{ +#if defined (ARRAY_VARS) + init_itemlist_from_varlist (itp, all_array_variables); + return 1; +#else + return 0; +#endif +} + +static int +it_init_bindings (itp) + ITEMLIST *itp; +{ + char **blist; + STRINGLIST *sl; + + /* rl_funmap_names allocates blist, but not its members */ + blist = (char **)rl_funmap_names (); /* XXX fix const later */ + sl = strlist_create (0); + sl->list = blist; + sl->list_size = 0; + sl->list_len = strvec_len (sl->list); + itp->flags |= LIST_DONTFREEMEMBERS; + itp->slist = sl; + + return 0; +} + +static int +it_init_builtins (itp) + ITEMLIST *itp; +{ + STRINGLIST *sl; + register int i, n; + + sl = strlist_create (num_shell_builtins); + for (i = n = 0; i < num_shell_builtins; i++) + if (shell_builtins[i].function) + sl->list[n++] = shell_builtins[i].name; + sl->list[sl->list_len = n] = (char *)NULL; + itp->flags |= LIST_DONTFREEMEMBERS; + itp->slist = sl; + return 0; +} + +static int +it_init_enabled (itp) + ITEMLIST *itp; +{ + STRINGLIST *sl; + register int i, n; + + sl = strlist_create (num_shell_builtins); + for (i = n = 0; i < num_shell_builtins; i++) + { + if (shell_builtins[i].function && (shell_builtins[i].flags & BUILTIN_ENABLED)) + sl->list[n++] = shell_builtins[i].name; + } + sl->list[sl->list_len = n] = (char *)NULL; + itp->flags |= LIST_DONTFREEMEMBERS; + itp->slist = sl; + return 0; +} + +static int +it_init_disabled (itp) + ITEMLIST *itp; +{ + STRINGLIST *sl; + register int i, n; + + sl = strlist_create (num_shell_builtins); + for (i = n = 0; i < num_shell_builtins; i++) + { + if (shell_builtins[i].function && ((shell_builtins[i].flags & BUILTIN_ENABLED) == 0)) + sl->list[n++] = shell_builtins[i].name; + } + sl->list[sl->list_len = n] = (char *)NULL; + itp->flags |= LIST_DONTFREEMEMBERS; + itp->slist = sl; + return 0; +} + +static int +it_init_exported (itp) + ITEMLIST *itp; +{ + init_itemlist_from_varlist (itp, all_exported_variables); + return 0; +} + +static int +it_init_functions (itp) + ITEMLIST *itp; +{ + init_itemlist_from_varlist (itp, all_visible_functions); + return 0; +} + +/* Like it_init_builtins, but includes everything the help builtin looks at, + not just builtins with an active implementing function. */ +static int +it_init_helptopics (itp) + ITEMLIST *itp; +{ + STRINGLIST *sl; + register int i, n; + + sl = strlist_create (num_shell_builtins); + for (i = n = 0; i < num_shell_builtins; i++) + sl->list[n++] = shell_builtins[i].name; + sl->list[sl->list_len = n] = (char *)NULL; + itp->flags |= LIST_DONTFREEMEMBERS; + itp->slist = sl; + return 0; +} + +static int +it_init_hostnames (itp) + ITEMLIST *itp; +{ + STRINGLIST *sl; + + sl = strlist_create (0); + sl->list = get_hostname_list (); + sl->list_len = sl->list ? strvec_len (sl->list) : 0; + sl->list_size = sl->list_len; + itp->slist = sl; + itp->flags |= LIST_DONTFREEMEMBERS|LIST_DONTFREE; + return 0; +} + +static int +it_init_joblist (itp, jstate) + ITEMLIST *itp; + int jstate; +{ +#if defined (JOB_CONTROL) + STRINGLIST *sl; + register int i; + register PROCESS *p; + char *s, *t; + JOB *j; + JOB_STATE ws; /* wanted state */ + + ws = JNONE; + if (jstate == 0) + ws = JRUNNING; + else if (jstate == 1) + ws = JSTOPPED; + + sl = strlist_create (js.j_jobslots); + for (i = js.j_jobslots - 1; i >= 0; i--) + { + j = get_job_by_jid (i); + if (j == 0) + continue; + p = j->pipe; + if (jstate == -1 || JOBSTATE(i) == ws) + { + s = savestring (p->command); + t = strpbrk (s, " \t\n"); + if (t) + *t = '\0'; + sl->list[sl->list_len++] = s; + } + } + itp->slist = sl; +#else + itp->slist = (STRINGLIST *)NULL; +#endif + return 0; +} + +static int +it_init_jobs (itp) + ITEMLIST *itp; +{ + return (it_init_joblist (itp, -1)); +} + +static int +it_init_running (itp) + ITEMLIST *itp; +{ + return (it_init_joblist (itp, 0)); +} + +static int +it_init_stopped (itp) + ITEMLIST *itp; +{ + return (it_init_joblist (itp, 1)); +} + +static int +it_init_keywords (itp) + ITEMLIST *itp; +{ + STRINGLIST *sl; + register int i, n; + + for (n = 0; word_token_alist[n].word; n++) + ; + sl = strlist_create (n); + for (i = 0; i < n; i++) + sl->list[i] = word_token_alist[i].word; + sl->list[sl->list_len = i] = (char *)NULL; + itp->flags |= LIST_DONTFREEMEMBERS; + itp->slist = sl; + return 0; +} + +static int +it_init_signals (itp) + ITEMLIST *itp; +{ + STRINGLIST *sl; + + sl = strlist_create (0); + sl->list = signal_names; + sl->list_len = strvec_len (sl->list); + itp->flags |= LIST_DONTFREE; + itp->slist = sl; + return 0; +} + +static int +it_init_variables (itp) + ITEMLIST *itp; +{ + init_itemlist_from_varlist (itp, all_visible_variables); + return 0; +} + +static int +it_init_setopts (itp) + ITEMLIST *itp; +{ + STRINGLIST *sl; + + sl = strlist_create (0); + sl->list = get_minus_o_opts (); + sl->list_len = strvec_len (sl->list); + itp->slist = sl; + itp->flags |= LIST_DONTFREEMEMBERS; + return 0; +} + +static int +it_init_shopts (itp) + ITEMLIST *itp; +{ + STRINGLIST *sl; + + sl = strlist_create (0); + sl->list = get_shopt_options (); + sl->list_len = strvec_len (sl->list); + itp->slist = sl; + itp->flags |= LIST_DONTFREEMEMBERS; + return 0; +} + +/* Generate a list of all matches for TEXT using the STRINGLIST in itp->slist + as the list of possibilities. If the itemlist has been marked dirty or + it should be regenerated every time, destroy the old STRINGLIST and make a + new one before trying the match. TEXT is dequoted before attempting a + match. */ +static STRINGLIST * +gen_matches_from_itemlist (itp, text) + ITEMLIST *itp; + const char *text; +{ + STRINGLIST *ret, *sl; + int tlen, i, n; + char *ntxt; + + if ((itp->flags & (LIST_DIRTY|LIST_DYNAMIC)) || + (itp->flags & LIST_INITIALIZED) == 0) + { + if (itp->flags & (LIST_DIRTY|LIST_DYNAMIC)) + clean_itemlist (itp); + if ((itp->flags & LIST_INITIALIZED) == 0) + initialize_itemlist (itp); + } + if (itp->slist == 0) + return ((STRINGLIST *)NULL); + ret = strlist_create (itp->slist->list_len+1); + sl = itp->slist; + + ntxt = bash_dequote_text (text); + tlen = STRLEN (ntxt); + + for (i = n = 0; i < sl->list_len; i++) + { + if (tlen == 0 || STREQN (sl->list[i], ntxt, tlen)) + ret->list[n++] = STRDUP (sl->list[i]); + } + ret->list[ret->list_len = n] = (char *)NULL; + + FREE (ntxt); + return ret; +} + +/* A wrapper for rl_filename_completion_function that dequotes the filename + before attempting completions. */ +static char * +pcomp_filename_completion_function (text, state) + const char *text; + int state; +{ + static char *dfn; /* dequoted filename */ + int qc; + int iscompgen, iscompleting; + + if (state == 0) + { + FREE (dfn); + /* remove backslashes quoting special characters in filenames. */ + /* There are roughly three paths we can follow to get here: + 1. complete -f + 2. compgen -f "$word" from a completion function + 3. compgen -f "$word" from the command line + They all need to be handled. + + In the first two cases, readline will run the filename dequoting + function in rl_filename_completion_function if it found a filename + quoting character in the word to be completed + (rl_completion_found_quote). We run the dequoting function here + if we're running compgen, we're not completing, and the + rl_filename_completion_function won't dequote the filename + (rl_completion_found_quote == 0). */ + iscompgen = this_shell_builtin == compgen_builtin; + iscompleting = RL_ISSTATE (RL_STATE_COMPLETING); + if (iscompgen && iscompleting == 0 && rl_completion_found_quote == 0 + && rl_filename_dequoting_function) + { + /* Use rl_completion_quote_character because any single or + double quotes have been removed by the time TEXT makes it + here, and we don't want to remove backslashes inside + quoted strings. */ + dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character); + } + /* Intended to solve a mismatched assumption by bash-completion. If + the text to be completed is empty, but bash-completion turns it into + a quoted string ('') assuming that this code will dequote it before + calling readline, do the dequoting. */ + else if (iscompgen && iscompleting && + pcomp_curtxt && *pcomp_curtxt == 0 && + text && (*text == '\'' || *text == '"') && text[1] == text[0] && text[2] == 0 && + rl_filename_dequoting_function) + dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character); + /* Another mismatched assumption by bash-completion. If compgen is being + run as part of bash-completion, and the argument to compgen is not + the same as the word originally passed to the programmable completion + code, dequote the argument if it has quote characters. It's an + attempt to detect when bash-completion is quoting its filename + argument before calling compgen. */ + /* We could check whether gen_shell_function_matches is in the call + stack by checking whether the gen-shell-function-matches tag is in + the unwind-protect stack, but there's no function to do that yet. + We could simply check whether we're executing in a function by + checking variable_context, and may end up doing that. */ + else if (iscompgen && iscompleting && rl_filename_dequoting_function && + pcomp_curtxt && text && + STREQ (pcomp_curtxt, text) == 0 && + variable_context && + sh_contains_quotes (text)) /* guess */ + dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character); + else + dfn = savestring (text); + } + + return (rl_filename_completion_function (dfn, state)); +} + +#define GEN_COMPS(bmap, flag, it, text, glist, tlist) \ + do { \ + if (bmap & flag) \ + { \ + tlist = gen_matches_from_itemlist (it, text); \ + if (tlist) \ + { \ + glist = strlist_append (glist, tlist); \ + strlist_dispose (tlist); \ + } \ + } \ + } while (0) + +#define GEN_XCOMPS(bmap, flag, text, func, cmatches, glist, tlist) \ + do { \ + if (bmap & flag) \ + { \ + cmatches = rl_completion_matches (text, func); \ + tlist = completions_to_stringlist (cmatches); \ + glist = strlist_append (glist, tlist); \ + strvec_dispose (cmatches); \ + strlist_dispose (tlist); \ + } \ + } while (0) + +/* Functions to generate lists of matches from the actions member of CS. */ + +static STRINGLIST * +gen_action_completions (cs, text) + COMPSPEC *cs; + const char *text; +{ + STRINGLIST *ret, *tmatches; + char **cmatches; /* from rl_completion_matches ... */ + unsigned long flags; + int t; + + ret = tmatches = (STRINGLIST *)NULL; + flags = cs->actions; + + GEN_COMPS (flags, CA_ALIAS, &it_aliases, text, ret, tmatches); + GEN_COMPS (flags, CA_ARRAYVAR, &it_arrayvars, text, ret, tmatches); + GEN_COMPS (flags, CA_BINDING, &it_bindings, text, ret, tmatches); + GEN_COMPS (flags, CA_BUILTIN, &it_builtins, text, ret, tmatches); + GEN_COMPS (flags, CA_DISABLED, &it_disabled, text, ret, tmatches); + GEN_COMPS (flags, CA_ENABLED, &it_enabled, text, ret, tmatches); + GEN_COMPS (flags, CA_EXPORT, &it_exports, text, ret, tmatches); + GEN_COMPS (flags, CA_FUNCTION, &it_functions, text, ret, tmatches); + GEN_COMPS (flags, CA_HELPTOPIC, &it_helptopics, text, ret, tmatches); + GEN_COMPS (flags, CA_HOSTNAME, &it_hostnames, text, ret, tmatches); + GEN_COMPS (flags, CA_JOB, &it_jobs, text, ret, tmatches); + GEN_COMPS (flags, CA_KEYWORD, &it_keywords, text, ret, tmatches); + GEN_COMPS (flags, CA_RUNNING, &it_running, text, ret, tmatches); + GEN_COMPS (flags, CA_SETOPT, &it_setopts, text, ret, tmatches); + GEN_COMPS (flags, CA_SHOPT, &it_shopts, text, ret, tmatches); + GEN_COMPS (flags, CA_SIGNAL, &it_signals, text, ret, tmatches); + GEN_COMPS (flags, CA_STOPPED, &it_stopped, text, ret, tmatches); + GEN_COMPS (flags, CA_VARIABLE, &it_variables, text, ret, tmatches); + + GEN_XCOMPS(flags, CA_COMMAND, text, command_word_completion_function, cmatches, ret, tmatches); + GEN_XCOMPS(flags, CA_FILE, text, pcomp_filename_completion_function, cmatches, ret, tmatches); + GEN_XCOMPS(flags, CA_USER, text, rl_username_completion_function, cmatches, ret, tmatches); + GEN_XCOMPS(flags, CA_GROUP, text, bash_groupname_completion_function, cmatches, ret, tmatches); + GEN_XCOMPS(flags, CA_SERVICE, text, bash_servicename_completion_function, cmatches, ret, tmatches); + + /* And lastly, the special case for directories */ + if (flags & CA_DIRECTORY) + { + t = rl_filename_completion_desired; + rl_completion_mark_symlink_dirs = 1; /* override user preference */ + cmatches = bash_directory_completion_matches (text); + /* If we did not want filename completion before this, and there are + no matches, turn off rl_filename_completion_desired so whatever + matches we get are not treated as filenames (it gets turned on by + rl_filename_completion_function unconditionally). */ + if (t == 0 && cmatches == 0 && rl_filename_completion_desired == 1) + rl_filename_completion_desired = 0; + tmatches = completions_to_stringlist (cmatches); + ret = strlist_append (ret, tmatches); + strvec_dispose (cmatches); + strlist_dispose (tmatches); + } + + return ret; +} + +/* Generate a list of matches for CS->globpat. Unresolved: should this use + TEXT as a match prefix, or just go without? Currently, the code does not + use TEXT, just globs CS->globpat and returns the results. If we do decide + to use TEXT, we should call quote_string_for_globbing before the call to + glob_filename. */ +static STRINGLIST * +gen_globpat_matches (cs, text) + COMPSPEC *cs; + const char *text; +{ + STRINGLIST *sl; + + sl = strlist_create (0); + sl->list = glob_filename (cs->globpat, 0); + if (GLOB_FAILED (sl->list)) + sl->list = (char **)NULL; + if (sl->list) + sl->list_len = sl->list_size = strvec_len (sl->list); + return sl; +} + +/* Perform the shell word expansions on CS->words and return the results. + Again, this ignores TEXT. */ +static STRINGLIST * +gen_wordlist_matches (cs, text) + COMPSPEC *cs; + const char *text; +{ + WORD_LIST *l, *l2; + STRINGLIST *sl; + int nw, tlen; + char *ntxt; /* dequoted TEXT to use in comparisons */ + + if (cs->words == 0 || cs->words[0] == '\0') + return ((STRINGLIST *)NULL); + + /* This used to be a simple expand_string(cs->words, 0), but that won't + do -- there's no way to split a simple list into individual words + that way, since the shell semantics say that word splitting is done + only on the results of expansion. split_at_delims also handles embedded + quoted strings and preserves the quotes for the expand_words_shellexp + function call that follows. */ + /* XXX - this is where this function spends most of its time */ + l = split_at_delims (cs->words, strlen (cs->words), (char *)NULL, -1, 0, (int *)NULL, (int *)NULL); + if (l == 0) + return ((STRINGLIST *)NULL); + /* This will jump back to the top level if the expansion fails... */ + l2 = expand_words_shellexp (l); + dispose_words (l); + + nw = list_length (l2); + sl = strlist_create (nw + 1); + + ntxt = bash_dequote_text (text); + tlen = STRLEN (ntxt); + + for (nw = 0, l = l2; l; l = l->next) + { + if (tlen == 0 || STREQN (l->word->word, ntxt, tlen)) + sl->list[nw++] = STRDUP (l->word->word); + } + sl->list[sl->list_len = nw] = (char *)NULL; + + dispose_words (l2); + FREE (ntxt); + return sl; +} + +#ifdef ARRAY_VARS + +static SHELL_VAR * +bind_comp_words (lwords) + WORD_LIST *lwords; +{ + SHELL_VAR *v; + + v = find_variable ("COMP_WORDS"); + if (v == 0) + v = make_new_array_variable ("COMP_WORDS"); + if (readonly_p (v)) + VUNSETATTR (v, att_readonly); + if (array_p (v) == 0) + v = convert_var_to_array (v); + v = assign_array_var_from_word_list (v, lwords, 0); + + VUNSETATTR (v, att_invisible); + return v; +} +#endif /* ARRAY_VARS */ + +static void +bind_compfunc_variables (line, ind, lwords, cw, exported) + char *line; + int ind; + WORD_LIST *lwords; + int cw, exported; +{ + char ibuf[INT_STRLEN_BOUND(int) + 1]; + char *value; + SHELL_VAR *v; + size_t llen; + int c; + + /* Set the variables that the function expects while it executes. Maybe + these should be in the function environment (temporary_env). */ + v = bind_variable ("COMP_LINE", line, 0); + if (v && exported) + VSETATTR(v, att_exported); + + /* Post bash-4.2: COMP_POINT is characters instead of bytes. */ + c = line[ind]; + line[ind] = '\0'; + llen = MB_STRLEN (line); + line[ind] = c; + value = inttostr (llen, ibuf, sizeof(ibuf)); + v = bind_int_variable ("COMP_POINT", value); + if (v && exported) + VSETATTR(v, att_exported); + + value = inttostr (rl_completion_type, ibuf, sizeof (ibuf)); + v = bind_int_variable ("COMP_TYPE", value); + if (v && exported) + VSETATTR(v, att_exported); + + value = inttostr (rl_completion_invoking_key, ibuf, sizeof (ibuf)); + v = bind_int_variable ("COMP_KEY", value); + if (v && exported) + VSETATTR(v, att_exported); + + /* Since array variables can't be exported, we don't bother making the + array of words. */ + if (exported == 0) + { +#ifdef ARRAY_VARS + v = bind_comp_words (lwords); + value = inttostr (cw, ibuf, sizeof(ibuf)); + bind_int_variable ("COMP_CWORD", value); +#endif + } + else + array_needs_making = 1; +} + +static void +unbind_compfunc_variables (exported) + int exported; +{ + unbind_variable ("COMP_LINE"); + unbind_variable ("COMP_POINT"); + unbind_variable ("COMP_TYPE"); + unbind_variable ("COMP_KEY"); +#ifdef ARRAY_VARS + unbind_variable ("COMP_WORDS"); + unbind_variable ("COMP_CWORD"); +#endif + if (exported) + array_needs_making = 1; +} + +/* Build the list of words to pass to a function or external command + as arguments. When the function or command is invoked, + + $0 == function or command being invoked + $1 == command name + $2 == word to be completed (possibly null) + $3 == previous word + + Functions can access all of the words in the current command line + with the COMP_WORDS array. External commands cannot; they have to + make do with the COMP_LINE and COMP_POINT variables. */ + +static WORD_LIST * +build_arg_list (cmd, cname, text, lwords, ind) + char *cmd; + const char *cname; + const char *text; + WORD_LIST *lwords; + int ind; +{ + WORD_LIST *ret, *cl, *l; + WORD_DESC *w; + int i; + + ret = (WORD_LIST *)NULL; + w = make_word (cmd); + ret = make_word_list (w, (WORD_LIST *)NULL); /* $0 */ + + w = make_word (cname); /* $1 */ + cl = ret->next = make_word_list (w, (WORD_LIST *)NULL); + + w = make_word (text); + cl->next = make_word_list (w, (WORD_LIST *)NULL); /* $2 */ + cl = cl->next; + + /* Search lwords for current word */ + for (l = lwords, i = 1; l && i < ind-1; l = l->next, i++) + ; + w = (l && l->word) ? copy_word (l->word) : make_word (""); + cl->next = make_word_list (w, (WORD_LIST *)NULL); + + return ret; +} + +/* Build a command string with + $0 == cs->funcname (function to execute for completion list) + $1 == command name (command being completed) + $2 = word to be completed (possibly null) + $3 = previous word + and run in the current shell. The function should put its completion + list into the array variable COMPREPLY. We build a STRINGLIST + from the results and return it. + + Since the shell function should return its list of matches in an array + variable, this does nothing if arrays are not compiled into the shell. */ + +static STRINGLIST * +gen_shell_function_matches (cs, cmd, text, line, ind, lwords, nw, cw, foundp) + COMPSPEC *cs; + const char *cmd; + const char *text; + char *line; + int ind; + WORD_LIST *lwords; + int nw, cw; + int *foundp; +{ + char *funcname; + STRINGLIST *sl; + SHELL_VAR *f, *v; + WORD_LIST *cmdlist; + int fval, found; + sh_parser_state_t ps; + sh_parser_state_t * restrict pps; +#if defined (ARRAY_VARS) + ARRAY *a; +#endif + + found = 0; + if (foundp) + *foundp = found; + + funcname = cs->funcname; + f = find_function (funcname); + if (f == 0) + { + internal_error (_("completion: function `%s' not found"), funcname); + rl_ding (); + rl_on_new_line (); + return ((STRINGLIST *)NULL); + } + +#if !defined (ARRAY_VARS) + return ((STRINGLIST *)NULL); +#else + + /* We pass cw - 1 because command_line_to_word_list returns indices that are + 1-based, while bash arrays are 0-based. */ + bind_compfunc_variables (line, ind, lwords, cw - 1, 0); + + cmdlist = build_arg_list (funcname, cmd, text, lwords, cw); + + pps = &ps; + save_parser_state (pps); + begin_unwind_frame ("gen-shell-function-matches"); + add_unwind_protect (restore_parser_state, (char *)pps); + add_unwind_protect (dispose_words, (char *)cmdlist); + add_unwind_protect (unbind_compfunc_variables, (char *)0); + + fval = execute_shell_function (f, cmdlist); + + discard_unwind_frame ("gen-shell-function-matches"); + restore_parser_state (pps); + + found = fval != EX_NOTFOUND; + if (fval == EX_RETRYFAIL) + found |= PCOMP_RETRYFAIL; + if (foundp) + *foundp = found; + + /* Now clean up and destroy everything. */ + dispose_words (cmdlist); + unbind_compfunc_variables (0); + + /* The list of completions is returned in the array variable COMPREPLY. */ + v = find_variable ("COMPREPLY"); + if (v == 0) + return ((STRINGLIST *)NULL); + if (array_p (v) == 0) + v = convert_var_to_array (v); + + VUNSETATTR (v, att_invisible); + + a = array_cell (v); + if (found == 0 || (found & PCOMP_RETRYFAIL) || a == 0 || array_empty (a)) + sl = (STRINGLIST *)NULL; + else + { + /* XXX - should we filter the list of completions so only those matching + TEXT are returned? Right now, we do not. */ + sl = strlist_create (0); + sl->list = array_to_argv (a); + sl->list_len = sl->list_size = array_num_elements (a); + } + + /* XXX - should we unbind COMPREPLY here? */ + unbind_variable ("COMPREPLY"); + + return (sl); +#endif +} + +/* Build a command string with + $0 == cs->command (command to execute for completion list) + $1 == command name (command being completed) + $2 = word to be completed (possibly null) + $3 = previous word + and run in with command substitution. Parse the results, one word + per line, with backslashes allowed to escape newlines. Build a + STRINGLIST from the results and return it. */ + +static STRINGLIST * +gen_command_matches (cs, cmd, text, line, ind, lwords, nw, cw) + COMPSPEC *cs; + const char *cmd; + const char *text; + char *line; + int ind; + WORD_LIST *lwords; + int nw, cw; +{ + char *csbuf, *cscmd, *t; + int cmdlen, cmdsize, n, ws, we; + WORD_LIST *cmdlist, *cl; + WORD_DESC *tw; + STRINGLIST *sl; + + bind_compfunc_variables (line, ind, lwords, cw, 1); + cmdlist = build_arg_list (cs->command, cmd, text, lwords, cw); + + /* Estimate the size needed for the buffer. */ + n = strlen (cs->command); + cmdsize = n + 1; + for (cl = cmdlist->next; cl; cl = cl->next) + cmdsize += STRLEN (cl->word->word) + 3; + cmdsize += 2; + + /* allocate the string for the command and fill it in. */ + cscmd = (char *)xmalloc (cmdsize + 1); + + strcpy (cscmd, cs->command); /* $0 */ + cmdlen = n; + cscmd[cmdlen++] = ' '; + for (cl = cmdlist->next; cl; cl = cl->next) /* $1, $2, $3, ... */ + { + t = sh_single_quote (cl->word->word ? cl->word->word : ""); + n = strlen (t); + RESIZE_MALLOCED_BUFFER (cscmd, cmdlen, n + 2, cmdsize, 64); + strcpy (cscmd + cmdlen, t); + cmdlen += n; + if (cl->next) + cscmd[cmdlen++] = ' '; + free (t); + } + cscmd[cmdlen] = '\0'; + + tw = command_substitute (cscmd, 0); + csbuf = tw ? tw->word : (char *)NULL; + if (tw) + dispose_word_desc (tw); + + /* Now clean up and destroy everything. */ + dispose_words (cmdlist); + free (cscmd); + unbind_compfunc_variables (1); + + if (csbuf == 0 || *csbuf == '\0') + { + FREE (csbuf); + return ((STRINGLIST *)NULL); + } + + /* Now break CSBUF up at newlines, with backslash allowed to escape a + newline, and put the individual words into a STRINGLIST. */ + sl = strlist_create (16); + for (ws = 0; csbuf[ws]; ) + { + we = ws; + while (csbuf[we] && csbuf[we] != '\n') + { + if (csbuf[we] == '\\' && csbuf[we+1] == '\n') + we++; + we++; + } + t = substring (csbuf, ws, we); + if (sl->list_len >= sl->list_size - 1) + strlist_resize (sl, sl->list_size + 16); + sl->list[sl->list_len++] = t; + while (csbuf[we] == '\n') we++; + ws = we; + } + sl->list[sl->list_len] = (char *)NULL; + + free (csbuf); + return (sl); +} + +static WORD_LIST * +command_line_to_word_list (line, llen, sentinel, nwp, cwp) + char *line; + int llen, sentinel, *nwp, *cwp; +{ + WORD_LIST *ret; + char *delims; + +#if 0 + delims = "()<>;&| \t\n"; /* shell metacharacters break words */ +#else + delims = rl_completer_word_break_characters; +#endif + ret = split_at_delims (line, llen, delims, sentinel, SD_NOQUOTEDELIM, nwp, cwp); + return (ret); +} + +/* Evaluate COMPSPEC *cs and return all matches for WORD. */ + +STRINGLIST * +gen_compspec_completions (cs, cmd, word, start, end, foundp) + COMPSPEC *cs; + const char *cmd; + const char *word; + int start, end; + int *foundp; +{ + STRINGLIST *ret, *tmatches; + char *line; + int llen, nw, cw, found, foundf; + WORD_LIST *lwords; + WORD_DESC *lw; + COMPSPEC *tcs; + + found = 1; + +#ifdef DEBUG + debug_printf ("gen_compspec_completions (%s, %s, %d, %d)", cmd, word, start, end); + debug_printf ("gen_compspec_completions: %s -> %p", cmd, cs); +#endif + ret = gen_action_completions (cs, word); +#ifdef DEBUG + if (ret && progcomp_debug) + { + debug_printf ("gen_action_completions (%p, %s) -->", cs, word); + strlist_print (ret, "\t"); + rl_on_new_line (); + } +#endif + + /* Now we start generating completions based on the other members of CS. */ + if (cs->globpat) + { + tmatches = gen_globpat_matches (cs, word); + if (tmatches) + { +#ifdef DEBUG + if (progcomp_debug) + { + debug_printf ("gen_globpat_matches (%p, %s) -->", cs, word); + strlist_print (tmatches, "\t"); + rl_on_new_line (); + } +#endif + ret = strlist_append (ret, tmatches); + strlist_dispose (tmatches); + rl_filename_completion_desired = 1; + } + } + + if (cs->words) + { + tmatches = gen_wordlist_matches (cs, word); + if (tmatches) + { +#ifdef DEBUG + if (progcomp_debug) + { + debug_printf ("gen_wordlist_matches (%p, %s) -->", cs, word); + strlist_print (tmatches, "\t"); + rl_on_new_line (); + } +#endif + ret = strlist_append (ret, tmatches); + strlist_dispose (tmatches); + } + } + + lwords = (WORD_LIST *)NULL; + line = (char *)NULL; + if (cs->command || cs->funcname) + { + /* If we have a command or function to execute, we need to first break + the command line into individual words, find the number of words, + and find the word in the list containing the word to be completed. */ + line = substring (rl_line_buffer, start, end); + llen = end - start; + +#ifdef DEBUG + debug_printf ("command_line_to_word_list (%s, %d, %d, %p, %p)", + line, llen, rl_point - start, &nw, &cw); +#endif + lwords = command_line_to_word_list (line, llen, rl_point - start, &nw, &cw); + /* If we skipped a NULL word at the beginning of the line, add it back */ + if (lwords && lwords->word && cmd[0] == 0 && lwords->word->word[0] != 0) + { + lw = make_bare_word (cmd); + lwords = make_word_list (lw, lwords); + nw++; + cw++; + } +#ifdef DEBUG + if (lwords == 0 && llen > 0) + debug_printf ("ERROR: command_line_to_word_list returns NULL"); + else if (progcomp_debug) + { + debug_printf ("command_line_to_word_list -->"); + printf ("\t"); + print_word_list (lwords, "!"); + printf ("\n"); + fflush(stdout); + rl_on_new_line (); + } +#endif + } + + if (cs->funcname) + { + foundf = 0; + tmatches = gen_shell_function_matches (cs, cmd, word, line, rl_point - start, lwords, nw, cw, &foundf); + if (foundf != 0) + found = foundf; + if (tmatches) + { +#ifdef DEBUG + if (progcomp_debug) + { + debug_printf ("gen_shell_function_matches (%p, %s, %s, %p, %d, %d) -->", cs, cmd, word, lwords, nw, cw); + strlist_print (tmatches, "\t"); + rl_on_new_line (); + } +#endif + ret = strlist_append (ret, tmatches); + strlist_dispose (tmatches); + } + } + + if (cs->command) + { + tmatches = gen_command_matches (cs, cmd, word, line, rl_point - start, lwords, nw, cw); + if (tmatches) + { +#ifdef DEBUG + if (progcomp_debug) + { + debug_printf ("gen_command_matches (%p, %s, %s, %p, %d, %d) -->", cs, cmd, word, lwords, nw, cw); + strlist_print (tmatches, "\t"); + rl_on_new_line (); + } +#endif + ret = strlist_append (ret, tmatches); + strlist_dispose (tmatches); + } + } + + if (cs->command || cs->funcname) + { + if (lwords) + dispose_words (lwords); + FREE (line); + } + + if (foundp) + *foundp = found; + + if (found == 0 || (found & PCOMP_RETRYFAIL)) + { + strlist_dispose (ret); + return NULL; + } + + if (cs->filterpat) + { + tmatches = filter_stringlist (ret, cs->filterpat, word); +#ifdef DEBUG + if (progcomp_debug) + { + debug_printf ("filter_stringlist (%p, %s, %s) -->", ret, cs->filterpat, word); + strlist_print (tmatches, "\t"); + rl_on_new_line (); + } +#endif + if (ret && ret != tmatches) + { + FREE (ret->list); + free (ret); + } + ret = tmatches; + } + + if (cs->prefix || cs->suffix) + ret = strlist_prefix_suffix (ret, cs->prefix, cs->suffix); + + /* If no matches have been generated and the user has specified that + directory completion should be done as a default, call + gen_action_completions again to generate a list of matching directory + names. */ + if ((ret == 0 || ret->list_len == 0) && (cs->options & COPT_DIRNAMES)) + { + tcs = compspec_create (); + tcs->actions = CA_DIRECTORY; + FREE (ret); + ret = gen_action_completions (tcs, word); + compspec_dispose (tcs); + } + else if (cs->options & COPT_PLUSDIRS) + { + tcs = compspec_create (); + tcs->actions = CA_DIRECTORY; + tmatches = gen_action_completions (tcs, word); + ret = strlist_append (ret, tmatches); + strlist_dispose (tmatches); + compspec_dispose (tcs); + } + + return (ret); +} + +void +pcomp_set_readline_variables (flags, nval) + int flags, nval; +{ + /* If the user specified that the compspec returns filenames, make + sure that readline knows it. */ + if (flags & COPT_FILENAMES) + rl_filename_completion_desired = nval; + /* If the user doesn't want a space appended, tell readline. */ + if (flags & COPT_NOSPACE) + rl_completion_suppress_append = nval; + /* The value here is inverted, since the default is on and the `noquote' + option is supposed to turn it off */ + if (flags & COPT_NOQUOTE) + rl_filename_quoting_desired = 1 - nval; +} + +/* Set or unset FLAGS in the options word of the current compspec. + SET_OR_UNSET is 1 for setting, 0 for unsetting. */ +void +pcomp_set_compspec_options (cs, flags, set_or_unset) + COMPSPEC *cs; + int flags, set_or_unset; +{ + if (cs == 0 && ((cs = pcomp_curcs) == 0)) + return; + if (set_or_unset) + cs->options |= flags; + else + cs->options &= ~flags; +} + +static STRINGLIST * +gen_progcomp_completions (ocmd, cmd, word, start, end, foundp, retryp, lastcs) + const char *ocmd; + const char *cmd; + const char *word; + int start, end; + int *foundp, *retryp; + COMPSPEC **lastcs; +{ + COMPSPEC *cs, *oldcs; + const char *oldcmd, *oldtxt; + STRINGLIST *ret; + + cs = progcomp_search (ocmd); + + if (cs == 0 || cs == *lastcs) + { +#if 0 + if (foundp) + *foundp = 0; +#endif + return (NULL); + } + + if (*lastcs) + compspec_dispose (*lastcs); + cs->refcount++; /* XXX */ + *lastcs = cs; + + cs = compspec_copy (cs); + + oldcs = pcomp_curcs; + oldcmd = pcomp_curcmd; + oldtxt = pcomp_curtxt; + + pcomp_curcs = cs; + pcomp_curcmd = cmd; + pcomp_curtxt = word; + + ret = gen_compspec_completions (cs, cmd, word, start, end, foundp); + + pcomp_curcs = oldcs; + pcomp_curcmd = oldcmd; + pcomp_curtxt = oldtxt; + + /* We need to conditionally handle setting *retryp here */ + if (retryp) + *retryp = foundp && (*foundp & PCOMP_RETRYFAIL); + + if (foundp) + { + *foundp &= ~PCOMP_RETRYFAIL; + *foundp |= cs->options; + } + + compspec_dispose (cs); + return ret; +} + +/* The driver function for the programmable completion code. Returns a list + of matches for WORD, which is an argument to command CMD. START and END + bound the command currently being completed in rl_line_buffer. */ +char ** +programmable_completions (cmd, word, start, end, foundp) + const char *cmd; + const char *word; + int start, end, *foundp; +{ + COMPSPEC *cs, *lastcs; + STRINGLIST *ret; + char **rmatches, *t; + int found, retry, count; + + lastcs = 0; + found = count = 0; + + do + { + retry = 0; + + /* We look at the basename of CMD if the full command does not have + an associated COMPSPEC. */ + ret = gen_progcomp_completions (cmd, cmd, word, start, end, &found, &retry, &lastcs); + if (found == 0) + { + t = strrchr (cmd, '/'); + if (t && *(++t)) + ret = gen_progcomp_completions (t, cmd, word, start, end, &found, &retry, &lastcs); + } + + if (found == 0) + ret = gen_progcomp_completions (DEFAULTCMD, cmd, word, start, end, &found, &retry, &lastcs); + + count++; + + if (count > 32) + { + internal_warning ("programmable_completion: %s: possible retry loop", cmd); + break; + } + } + while (retry); + + if (ret) + { + rmatches = ret->list; + free (ret); + } + else + rmatches = (char **)NULL; + + if (foundp) + *foundp = found; + + if (lastcs) /* XXX - should be while? */ + compspec_dispose (lastcs); + + return (rmatches); +} + +#endif /* PROGRAMMABLE_COMPLETION */ diff --git a/pcomplete.h b/pcomplete.h new file mode 100644 index 0000000..67f6393 --- /dev/null +++ b/pcomplete.h @@ -0,0 +1,164 @@ +/* pcomplete.h - structure definitions and other stuff for programmable + completion. */ + +/* Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_PCOMPLETE_H_) +# define _PCOMPLETE_H_ + +#include "stdc.h" +#include "hashlib.h" + +typedef struct compspec { + int refcount; + unsigned long actions; + unsigned long options; + char *globpat; + char *words; + char *prefix; + char *suffix; + char *funcname; + char *command; + char *lcommand; + char *filterpat; +} COMPSPEC; + +/* Values for COMPSPEC actions. These are things the shell knows how to + build internally. */ +#define CA_ALIAS (1<<0) +#define CA_ARRAYVAR (1<<1) +#define CA_BINDING (1<<2) +#define CA_BUILTIN (1<<3) +#define CA_COMMAND (1<<4) +#define CA_DIRECTORY (1<<5) +#define CA_DISABLED (1<<6) +#define CA_ENABLED (1<<7) +#define CA_EXPORT (1<<8) +#define CA_FILE (1<<9) +#define CA_FUNCTION (1<<10) +#define CA_GROUP (1<<11) +#define CA_HELPTOPIC (1<<12) +#define CA_HOSTNAME (1<<13) +#define CA_JOB (1<<14) +#define CA_KEYWORD (1<<15) +#define CA_RUNNING (1<<16) +#define CA_SERVICE (1<<17) +#define CA_SETOPT (1<<18) +#define CA_SHOPT (1<<19) +#define CA_SIGNAL (1<<20) +#define CA_STOPPED (1<<21) +#define CA_USER (1<<22) +#define CA_VARIABLE (1<<23) + +/* Values for COMPSPEC options field. */ +#define COPT_RESERVED (1<<0) /* reserved for other use */ +#define COPT_DEFAULT (1<<1) +#define COPT_FILENAMES (1<<2) +#define COPT_DIRNAMES (1<<3) +#define COPT_NOQUOTE (1<<4) +#define COPT_NOSPACE (1<<5) +#define COPT_BASHDEFAULT (1<<6) +#define COPT_PLUSDIRS (1<<7) + +/* List of items is used by the code that implements the programmable + completions. */ +typedef struct _list_of_items { + int flags; + int (*list_getter) __P((struct _list_of_items *)); /* function to call to get the list */ + + STRINGLIST *slist; + + /* These may or may not be used. */ + STRINGLIST *genlist; /* for handing to the completion code one item at a time */ + int genindex; /* index of item last handed to completion code */ + +} ITEMLIST; + +/* Values for ITEMLIST -> flags */ +#define LIST_DYNAMIC 0x001 +#define LIST_DIRTY 0x002 +#define LIST_INITIALIZED 0x004 +#define LIST_MUSTSORT 0x008 +#define LIST_DONTFREE 0x010 +#define LIST_DONTFREEMEMBERS 0x020 + +#define EMPTYCMD "_EmptycmD_" +#define DEFAULTCMD "_DefaultCmD_" + +extern HASH_TABLE *prog_completes; +extern int prog_completion_enabled; + +/* Not all of these are used yet. */ +extern ITEMLIST it_aliases; +extern ITEMLIST it_arrayvars; +extern ITEMLIST it_bindings; +extern ITEMLIST it_builtins; +extern ITEMLIST it_commands; +extern ITEMLIST it_directories; +extern ITEMLIST it_disabled; +extern ITEMLIST it_enabled; +extern ITEMLIST it_exports; +extern ITEMLIST it_files; +extern ITEMLIST it_functions; +extern ITEMLIST it_groups; +extern ITEMLIST it_helptopics; +extern ITEMLIST it_hostnames; +extern ITEMLIST it_jobs; +extern ITEMLIST it_keywords; +extern ITEMLIST it_running; +extern ITEMLIST it_services; +extern ITEMLIST it_setopts; +extern ITEMLIST it_shopts; +extern ITEMLIST it_signals; +extern ITEMLIST it_stopped; +extern ITEMLIST it_users; +extern ITEMLIST it_variables; + +extern COMPSPEC *pcomp_curcs; +extern const char *pcomp_curcmd; + +/* Functions from pcomplib.c */ +extern COMPSPEC *compspec_create __P((void)); +extern void compspec_dispose __P((COMPSPEC *)); +extern COMPSPEC *compspec_copy __P((COMPSPEC *)); + +extern void progcomp_create __P((void)); +extern void progcomp_flush __P((void)); +extern void progcomp_dispose __P((void)); + +extern int progcomp_size __P((void)); + +extern int progcomp_insert __P((char *, COMPSPEC *)); +extern int progcomp_remove __P((char *)); + +extern COMPSPEC *progcomp_search __P((const char *)); + +extern void progcomp_walk __P((hash_wfunc *)); + +/* Functions from pcomplete.c */ +extern void set_itemlist_dirty __P((ITEMLIST *)); + +extern STRINGLIST *completions_to_stringlist __P((char **)); + +extern STRINGLIST *gen_compspec_completions __P((COMPSPEC *, const char *, const char *, int, int, int *)); +extern char **programmable_completions __P((const char *, const char *, int, int, int *)); + +extern void pcomp_set_readline_variables __P((int, int)); +extern void pcomp_set_compspec_options __P((COMPSPEC *, int, int)); +#endif /* _PCOMPLETE_H_ */ diff --git a/pcomplib.c b/pcomplib.c new file mode 100644 index 0000000..7361bb1 --- /dev/null +++ b/pcomplib.c @@ -0,0 +1,228 @@ +/* pcomplib.c - library functions for programmable completion. */ + +/* Copyright (C) 1999-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#if defined (PROGRAMMABLE_COMPLETION) + +#include "bashansi.h" +#include + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif +# include +#endif + +#include "bashintl.h" + +#include "shell.h" +#include "pcomplete.h" + +#define COMPLETE_HASH_BUCKETS 128 /* must be power of two */ + +#define STRDUP(x) ((x) ? savestring (x) : (char *)NULL) + +HASH_TABLE *prog_completes = (HASH_TABLE *)NULL; + +static void free_progcomp __P((PTR_T)); + +COMPSPEC * +compspec_create () +{ + COMPSPEC *ret; + + ret = (COMPSPEC *)xmalloc (sizeof (COMPSPEC)); + ret->refcount = 0; + + ret->actions = (unsigned long)0; + ret->options = (unsigned long)0; + + ret->globpat = (char *)NULL; + ret->words = (char *)NULL; + ret->prefix = (char *)NULL; + ret->suffix = (char *)NULL; + ret->funcname = (char *)NULL; + ret->command = (char *)NULL; + ret->lcommand = (char *)NULL; + ret->filterpat = (char *)NULL; + + return ret; +} + +void +compspec_dispose (cs) + COMPSPEC *cs; +{ + cs->refcount--; + if (cs->refcount == 0) + { + FREE (cs->globpat); + FREE (cs->words); + FREE (cs->prefix); + FREE (cs->suffix); + FREE (cs->funcname); + FREE (cs->command); + FREE (cs->lcommand); + FREE (cs->filterpat); + + free (cs); + } +} + +COMPSPEC * +compspec_copy (cs) + COMPSPEC *cs; +{ + COMPSPEC *new; + + new = (COMPSPEC *)xmalloc (sizeof (COMPSPEC)); + + new->refcount = cs->refcount; + new->actions = cs->actions; + new->options = cs->options; + + new->globpat = STRDUP (cs->globpat); + new->words = STRDUP (cs->words); + new->prefix = STRDUP (cs->prefix); + new->suffix = STRDUP (cs->suffix); + new->funcname = STRDUP (cs->funcname); + new->command = STRDUP (cs->command); + new->lcommand = STRDUP (cs->lcommand); + new->filterpat = STRDUP (cs->filterpat); + + return new; +} + +void +progcomp_create () +{ + if (prog_completes == 0) + prog_completes = hash_create (COMPLETE_HASH_BUCKETS); +} + +int +progcomp_size () +{ + return (HASH_ENTRIES (prog_completes)); +} + +static void +free_progcomp (data) + PTR_T data; +{ + COMPSPEC *cs; + + cs = (COMPSPEC *)data; + compspec_dispose (cs); +} + +void +progcomp_flush () +{ + if (prog_completes) + hash_flush (prog_completes, free_progcomp); +} + +void +progcomp_dispose () +{ + if (prog_completes) + hash_dispose (prog_completes); + prog_completes = (HASH_TABLE *)NULL; +} + +int +progcomp_remove (cmd) + char *cmd; +{ + register BUCKET_CONTENTS *item; + + if (prog_completes == 0) + return 1; + + item = hash_remove (cmd, prog_completes, 0); + if (item) + { + if (item->data) + free_progcomp (item->data); + free (item->key); + free (item); + return (1); + } + return (0); +} + +int +progcomp_insert (cmd, cs) + char *cmd; + COMPSPEC *cs; +{ + register BUCKET_CONTENTS *item; + + if (cs == NULL) + programming_error (_("progcomp_insert: %s: NULL COMPSPEC"), cmd); + + if (prog_completes == 0) + progcomp_create (); + + cs->refcount++; + item = hash_insert (cmd, prog_completes, 0); + if (item->data) + free_progcomp (item->data); + else + item->key = savestring (cmd); + item->data = cs; + + return 1; +} + +COMPSPEC * +progcomp_search (cmd) + const char *cmd; +{ + register BUCKET_CONTENTS *item; + COMPSPEC *cs; + + if (prog_completes == 0) + return ((COMPSPEC *)NULL); + + item = hash_search (cmd, prog_completes, 0); + + if (item == NULL) + return ((COMPSPEC *)NULL); + + cs = (COMPSPEC *)item->data; + + return (cs); +} + +void +progcomp_walk (pfunc) + hash_wfunc *pfunc; +{ + if (prog_completes == 0 || pfunc == 0 || HASH_ENTRIES (prog_completes) == 0) + return; + + hash_walk (prog_completes, pfunc); +} + +#endif /* PROGRAMMABLE_COMPLETION */ diff --git a/po/._bg.po b/po/._bg.po new file mode 100644 index 0000000000000000000000000000000000000000..8bfb9f72079a8c47393f08f27f901961f19cdd8f GIT binary patch literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103vVhH_m z8=`|@22i;anifVNA1W@IoS& +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU General Public +# License but which still want to provide support for the GNU gettext +# functionality. +# Please note that the actual code of GNU gettext is covered by the GNU +# General Public License and is *not* in the public domain. + +PACKAGE = @PACKAGE_NAME@ +VERSION = @PACKAGE_VERSION@ + +SHELL = /bin/sh +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ + +topdir = @top_srcdir@ +BUILD_DIR = @BUILD_DIR@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +datarootdir = @datarootdir@ +datadir = @datadir@ +localedir = @localedir@ + +gettextsrcdir = $(datadir)/gettext/po + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +mkinstalldirs = $(SHELL) $(MKINSTALLDIRS) + +GMSGFMT = @GMSGFMT@ +MSGFMT = @MSGFMT@ +XGETTEXT = @XGETTEXT@ +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +POFILES = @POFILES@ +GMOFILES = @GMOFILES@ +UPDATEPOFILES = @UPDATEPOFILES@ +DUMMYPOFILES = @DUMMYPOFILES@ +DISTFILES.common = Makefile.in.in remove-potcdate.sin \ +$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) +DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \ +$(POFILES) $(GMOFILES) \ +$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) + +POTFILES = \ + +CATALOGS = @CATALOGS@ + +# Makevars gets inserted here. (Don't remove this line!) + +.SUFFIXES: +.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-update + +.po.mo: + @echo "$(MSGFMT) -c -o $@ $<"; \ + $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ + +.po.gmo: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all: all-@USE_NLS@ + +all-yes: stamp-po +all-no: + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + test -z "$(CATALOGS)" || $(MAKE) $(CATALOGS) + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' + $(MAKE) $(MFLAGS) builtins.pot-update + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + + +install: install-exec install-data +install-exec: +install-data: install-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ + for file in $(DISTFILES.common) Makevars.template; do \ + $(INSTALL_DATA) $(srcdir)/$$file \ + $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + for file in Makevars; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi +install-data-no: all +install-data-yes: all + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ + fi; \ + done; \ + done + +install-strip: install + +installdirs: installdirs-exec installdirs-data +installdirs-exec: +installdirs-data: installdirs-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ + else \ + : ; \ + fi +installdirs-data-no: +installdirs-data-yes: + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done + +# Define this as empty until I found a useful application. +installcheck: + +uninstall: uninstall-exec uninstall-data +uninstall-exec: +uninstall-data: uninstall-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + for file in $(DISTFILES.common) Makevars.template; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi +uninstall-data-no: +uninstall-data-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ + done + +check: all + +info dvi ps pdf html tags TAGS ctags CTAGS ID: + +mostlyclean: + rm -f remove-potcdate.sed + rm -f stamp-poT + rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po + rm -fr *.o + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in POTFILES *.mo + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f stamp-po $(GMOFILES) + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: + $(MAKE) update-po + @$(MAKE) dist2 +# This is a separate target because 'update-po' must be executed before. +dist2: $(DISTFILES) + dists="$(DISTFILES)"; \ + if test "$(PACKAGE)" = "gettext-tools"; then \ + dists="$$dists Makevars.template"; \ + fi; \ + if test -f $(srcdir)/ChangeLog; then \ + dists="$$dists ChangeLog"; \ + fi; \ + for i in 0 1 2 3 4 5 6 7 8 9; do \ + if test -f $(srcdir)/ChangeLog.$$i; then \ + dists="$$dists ChangeLog.$$i"; \ + fi; \ + done; \ + if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ + for file in $$dists; do \ + if test -f $$file; then \ + cp -p $$file $(distdir); \ + else \ + cp -p $(srcdir)/$$file $(distdir); \ + fi; \ + done + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-gmo: Makefile $(GMOFILES) + @: + +Makefile: Makefile.in.in $(top_builddir)/config.status @POMAKEFILEDEPS@ $(srcdir)/Rules-builtins + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ + $(SHELL) ./config.status + +force: + +# Tell versions [3.59,3.63) of GNU make not to export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/po/Makevars b/po/Makevars new file mode 100644 index 0000000..84b2d95 --- /dev/null +++ b/po/Makevars @@ -0,0 +1,41 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = $(BUILD_DIR) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ -C + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Free Software Foundation, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-bash@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 0000000..2a8f369 --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,81 @@ +# List of source files containing translatable strings. +# Copyright (C) 2004 Free Software Foundation, Inc. + +arrayfunc.c +bashhist.c +bashline.c +braces.c +builtins/alias.def +builtins/bind.def +builtins/break.def +builtins/caller.def +builtins/cd.def +builtins/common.c +builtins/complete.def +builtins/declare.def +builtins/enable.def +builtins/evalfile.c +builtins/exec.def +builtins/exit.def +builtins/fc.def +builtins/fg_bg.def +builtins/getopt.c +builtins/hash.def +builtins/help.def +builtins/history.def +builtins/inlib.def +builtins/jobs.def +builtins/kill.def +builtins/let.def +builtins/mapfile.def +builtins/mkbuiltins.c +builtins/printf.def +builtins/pushd.def +builtins/read.def +builtins/return.def +builtins/set.def +builtins/setattr.def +builtins/shift.def +builtins/shopt.def +builtins/source.def +builtins/suspend.def +builtins/type.def +builtins/ulimit.def +builtins/umask.def +error.c +eval.c +execute_cmd.c +expr.c +general.c +input.c +jobs.c +lib/intl/os2compat.c +lib/malloc/malloc.c +lib/malloc/stats.c +lib/malloc/table.c +lib/malloc/watch.c +lib/sh/fmtulong.c +lib/sh/netopen.c +locale.c +mailcheck.c +make_cmd.c +nojobs.c +parse.y +pcomplete.c +pcomplib.c +print_cmd.c +redir.c +shell.c +sig.c +siglist.c +subst.c +test.c +trap.c +variables.c +version.c +version2.c +xmalloc.c + +# Apparently gettext's defaults cannot handle files that exist outside of the +# source directory, like in the build directory +#../builtins/builtins.c diff --git a/po/README b/po/README new file mode 100644 index 0000000..979884c --- /dev/null +++ b/po/README @@ -0,0 +1 @@ +This apparently requires GNU sed diff --git a/po/Rules-builtins b/po/Rules-builtins new file mode 100644 index 0000000..57df81c --- /dev/null +++ b/po/Rules-builtins @@ -0,0 +1,19 @@ +# +# Update the strings from the builtins' long docs. Must be called when +# bash.pot exists, in the middle of the bash.pot-update recipe +# +builtins.pot-update: $(top_builddir)/builtins/builtins.c + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_builddir)/builtins \ + $(XGETTEXT_OPTIONS) --omit-header \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --join-existing \ + builtins.c + +# This rule has no dependencies: we don't need to update builtins.pot at +# every "make" invocation, only create it when it is missing. +# Only "make builtins.pot-update" or "make dist" will force an update. +$(srcdir)/builtins.pot: + $(MAKE) builtins.pot-update + +xdist: + $(MAKE) update-po diff --git a/po/Rules-quot b/po/Rules-quot new file mode 100644 index 0000000..5f46d23 --- /dev/null +++ b/po/Rules-quot @@ -0,0 +1,42 @@ +# Special Makefile rules for English message catalogs with quotation marks. + +DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot + +.SUFFIXES: .insert-header .po-update-en + +en@quot.po-update: en@quot.po-update-en +en@boldquot.po-update: en@boldquot.po-update-en + +.insert-header.po-update-en: + @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ + if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + ll=`echo $$lang | sed -e 's/@.*//'`; \ + LC_ALL=C; export LC_ALL; \ + cd $(srcdir); \ + if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "creation of $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +en@quot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header + +en@boldquot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header + +mostlyclean: mostlyclean-quot +mostlyclean-quot: + rm -f *.insert-header diff --git a/po/af.gmo b/po/af.gmo new file mode 100644 index 0000000000000000000000000000000000000000..9bb144e8f0c6327910b225cecd348ced24aaea2d GIT binary patch literal 1244 zcmY+D%Z?jG6oxA#Tw(~Ikw}Py&`Bgi5URmFNrck`avh|BOlA}&*<^vr-N)^6x2vqG zYLCs57hr+d@eEnA2k{PwO&%ap#0#+CKkZ3Ej@SLC{TGOzdWzvK@E`C5_%HYdcN|GT{8qD@RA>r7bD*fzXA_OqFBC5h$Ox327VZ6rgb4O}E2 zR^1l7mfkfmZC#P9cPdvmebq*awsNLXx4q+TxX>>@QQJ$Ks9&lbnwSN{JvlSubLzgU zoj-IGlSyq<*q{0l72c)b8?uhl1i|Bkn?}WzOJ+$Nf)8q8nwBYfPn8siWCM*%WVIjs z6nW~MQa|7jky$PW6WZDw^zQN8hopC7WlMdtt)f2gIraAU4)iT?18se~yRNN4c1aJm zbe2(;<=GWIxI7p@QQzZ*6|c|r2GF~xv(G8Jm|q%xI@p5V9TSs22*$<6;L38^=M*e` z<9)=XUk&x)bUwX4Z|hA{Z2n-rf`O}AQ?Wi^Gt245IM~|2oUYnz=&qabrVrIinmL(q zZ+B;R`$d@`f}&HJv|&=zM``i%981rgWh(9 zFRiO`8jfu0buV2TN6s?!@eVc5W&YCs$4=A2LO@PJP=L6V_wbRCr(PbbYm5(}YtO22PzZ zGnt=Ldv3%vyAmGO9abR#C1dIlPZ(*U#U_?Ri2_T%E-qU1Ssl^-NgX00jPYny@c2(G KY}aNss{a70+A|aY literal 0 HcmV?d00001 diff --git a/po/af.po b/po/af.po new file mode 100644 index 0000000..bef026b --- /dev/null +++ b/po/af.po @@ -0,0 +1,4701 @@ +# bash +# Copyright (C) 2004 Free Software Foundation, Inc. +# Petri Jooste , 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: bash 2.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-02-11 11:19-0500\n" +"PO-Revision-Date: 2004-03-17 13:48+0200\n" +"Last-Translator: Petri Jooste \n" +"Language-Team: Afrikaans \n" +"Language: af\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: arrayfunc.c:51 +#, fuzzy +msgid "bad array subscript" +msgstr "Os/2 Biskaart Skikking" + +#: arrayfunc.c:356 builtins/declare.def:566 +#, c-format +msgid "%s: cannot convert indexed to associative array" +msgstr "" + +#: arrayfunc.c:539 +#, fuzzy, c-format +msgid "%s: invalid associative array key" +msgstr "%s: illegal option -- %c\n" + +#: arrayfunc.c:541 +#, c-format +msgid "%s: cannot assign to non-numeric index" +msgstr "" + +#: arrayfunc.c:586 +#, c-format +msgid "%s: %s: must use subscript when assigning associative array" +msgstr "" + +#: bashhist.c:388 +#, c-format +msgid "%s: cannot create: %s" +msgstr "%s: kan nie %s skep nie" + +#: bashline.c:3982 +msgid "bash_execute_unix_command: cannot find keymap for command" +msgstr "" + +#: bashline.c:4069 +#, c-format +msgid "%s: first non-whitespace character is not `\"'" +msgstr "" + +#: bashline.c:4098 +#, c-format +msgid "no closing `%c' in %s" +msgstr "" + +#: bashline.c:4132 +#, c-format +msgid "%s: missing colon separator" +msgstr "" + +#: braces.c:321 +#, c-format +msgid "brace expansion: cannot allocate memory for %s" +msgstr "" + +#: braces.c:413 +#, c-format +msgid "brace expansion: failed to allocate memory for %d elements" +msgstr "" + +#: braces.c:452 +#, c-format +msgid "brace expansion: failed to allocate memory for `%s'" +msgstr "" + +#: builtins/alias.def:132 +#, fuzzy, c-format +msgid "`%s': invalid alias name" +msgstr "%s: illegal option -- %c\n" + +#: builtins/bind.def:123 builtins/bind.def:126 +msgid "line editing not enabled" +msgstr "" + +#: builtins/bind.def:212 +#, c-format +msgid "`%s': invalid keymap name" +msgstr "" + +#: builtins/bind.def:251 +#, fuzzy, c-format +msgid "%s: cannot read: %s" +msgstr "%s: kan nie %s skep nie" + +#: builtins/bind.def:266 +#, fuzzy, c-format +msgid "`%s': cannot unbind" +msgstr "%s: bevel nie gevind nie" + +#: builtins/bind.def:304 builtins/bind.def:334 +#, fuzzy, c-format +msgid "`%s': unknown function name" +msgstr "%s: leesalleen-funksie" + +#: builtins/bind.def:312 +#, c-format +msgid "%s is not bound to any keys.\n" +msgstr "" + +#: builtins/bind.def:316 +#, c-format +msgid "%s can be invoked via " +msgstr "" + +#: builtins/break.def:77 builtins/break.def:117 +#, fuzzy +msgid "loop count" +msgstr "Afteken" + +#: builtins/break.def:137 +msgid "only meaningful in a `for', `while', or `until' loop" +msgstr "" + +#: builtins/caller.def:134 +msgid "" +"Returns the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns " +msgstr "" + +#: builtins/cd.def:319 +msgid "HOME not set" +msgstr "" + +#: builtins/cd.def:327 builtins/common.c:166 test.c:876 +#, fuzzy +msgid "too many arguments" +msgstr "te veel parameters" + +#: builtins/cd.def:338 +msgid "OLDPWD not set" +msgstr "" + +#: builtins/common.c:101 +#, fuzzy, c-format +msgid "line %d: " +msgstr "3d modus" + +#: builtins/common.c:139 error.c:265 +#, fuzzy, c-format +msgid "warning: " +msgstr "besig om te skryf" + +#: builtins/common.c:153 +#, c-format +msgid "%s: usage: " +msgstr "" + +#: builtins/common.c:191 shell.c:506 shell.c:788 +#, fuzzy, c-format +msgid "%s: option requires an argument" +msgstr "%s: option `%s' requires an argument\n" + +#: builtins/common.c:198 +#, c-format +msgid "%s: numeric argument required" +msgstr "" + +#: builtins/common.c:205 +#, fuzzy, c-format +msgid "%s: not found" +msgstr "%s: bevel nie gevind nie" + +#: builtins/common.c:214 shell.c:801 +#, fuzzy, c-format +msgid "%s: invalid option" +msgstr "%s: illegal option -- %c\n" + +#: builtins/common.c:221 +#, fuzzy, c-format +msgid "%s: invalid option name" +msgstr "%s: illegal option -- %c\n" + +#: builtins/common.c:228 general.c:235 general.c:240 +#, fuzzy, c-format +msgid "`%s': not a valid identifier" +msgstr "Die datum is nie geldige!" + +#: builtins/common.c:238 +#, fuzzy +msgid "invalid octal number" +msgstr "Die sein nommer wat was gevang het" + +#: builtins/common.c:240 +#, fuzzy +msgid "invalid hex number" +msgstr "Die sein nommer wat was gevang het" + +#: builtins/common.c:242 expr.c:1470 +#, fuzzy +msgid "invalid number" +msgstr "Die sein nommer wat was gevang het" + +#: builtins/common.c:250 +#, c-format +msgid "%s: invalid signal specification" +msgstr "" + +#: builtins/common.c:257 +#, c-format +msgid "`%s': not a pid or valid job spec" +msgstr "" + +#: builtins/common.c:264 error.c:488 +#, fuzzy, c-format +msgid "%s: readonly variable" +msgstr "Veranderlike boom" + +#: builtins/common.c:272 +#, c-format +msgid "%s: %s out of range" +msgstr "" + +#: builtins/common.c:272 builtins/common.c:274 +#, fuzzy +msgid "argument" +msgstr "argument verwag\n" + +#: builtins/common.c:274 +#, c-format +msgid "%s out of range" +msgstr "" + +#: builtins/common.c:282 +#, c-format +msgid "%s: no such job" +msgstr "" + +#: builtins/common.c:290 +#, fuzzy, c-format +msgid "%s: no job control" +msgstr "geen taakbeheer in hierdie dop nie" + +#: builtins/common.c:292 +#, fuzzy +msgid "no job control" +msgstr "geen taakbeheer in hierdie dop nie" + +#: builtins/common.c:302 +#, fuzzy, c-format +msgid "%s: restricted" +msgstr "Die bediener beëindig Die verbinding." + +#: builtins/common.c:304 +#, fuzzy +msgid "restricted" +msgstr "" +"\n" +"Bevel beëindig\n" + +#: builtins/common.c:312 +#, c-format +msgid "%s: not a shell builtin" +msgstr "" + +#: builtins/common.c:321 +#, fuzzy, c-format +msgid "write error: %s" +msgstr "pypfout: %s" + +#: builtins/common.c:329 +#, c-format +msgid "error setting terminal attributes: %s" +msgstr "" + +#: builtins/common.c:331 +#, c-format +msgid "error getting terminal attributes: %s" +msgstr "" + +#: builtins/common.c:563 +#, c-format +msgid "%s: error retrieving current directory: %s: %s\n" +msgstr "" + +#: builtins/common.c:629 builtins/common.c:631 +#, fuzzy, c-format +msgid "%s: ambiguous job spec" +msgstr "%s: dubbelsinnige herroetering" + +#: builtins/complete.def:277 +#, c-format +msgid "%s: invalid action name" +msgstr "" + +#: builtins/complete.def:450 builtins/complete.def:645 +#: builtins/complete.def:855 +#, c-format +msgid "%s: no completion specification" +msgstr "" + +#: builtins/complete.def:697 +msgid "warning: -F option may not work as you expect" +msgstr "" + +#: builtins/complete.def:699 +msgid "warning: -C option may not work as you expect" +msgstr "" + +#: builtins/complete.def:828 +msgid "not currently executing completion function" +msgstr "" + +#: builtins/declare.def:126 +msgid "can only be used in a function" +msgstr "" + +#: builtins/declare.def:315 builtins/declare.def:509 +#, c-format +msgid "%s: reference variable cannot be an array" +msgstr "" + +#: builtins/declare.def:324 +#, c-format +msgid "%s: nameref variable self references not allowed" +msgstr "" + +#: builtins/declare.def:398 +msgid "cannot use `-f' to make functions" +msgstr "" + +#: builtins/declare.def:410 execute_cmd.c:5361 +#, c-format +msgid "%s: readonly function" +msgstr "%s: leesalleen-funksie" + +#: builtins/declare.def:553 +#, fuzzy, c-format +msgid "%s: cannot destroy array variables in this way" +msgstr "Kan nie soek 'n handtekening in hierdie boodskap!" + +#: builtins/declare.def:560 builtins/read.def:733 +#, c-format +msgid "%s: cannot convert associative to indexed array" +msgstr "" + +#: builtins/enable.def:137 builtins/enable.def:145 +msgid "dynamic loading not available" +msgstr "" + +#: builtins/enable.def:312 +#, fuzzy, c-format +msgid "cannot open shared object %s: %s" +msgstr "Kan nie oopmaak vir skrip-afvoer nie: \"" + +#: builtins/enable.def:335 +#, c-format +msgid "cannot find %s in shared object %s: %s" +msgstr "" + +#: builtins/enable.def:459 +#, c-format +msgid "%s: not dynamically loaded" +msgstr "" + +#: builtins/enable.def:474 +#, fuzzy, c-format +msgid "%s: cannot delete: %s" +msgstr "%s: kan nie %s skep nie" + +#: builtins/evalfile.c:140 builtins/hash.def:171 execute_cmd.c:5208 +#: shell.c:1481 +#, c-format +msgid "%s: is a directory" +msgstr "%s: is 'n gids" + +#: builtins/evalfile.c:146 +#, fuzzy, c-format +msgid "%s: not a regular file" +msgstr "%s: kan nie 'n binêre lêer uitvoer nie" + +#: builtins/evalfile.c:155 +#, c-format +msgid "%s: file is too large" +msgstr "" + +#: builtins/evalfile.c:190 builtins/evalfile.c:208 shell.c:1491 +#, c-format +msgid "%s: cannot execute binary file" +msgstr "%s: kan nie 'n binêre lêer uitvoer nie" + +#: builtins/exec.def:154 builtins/exec.def:156 builtins/exec.def:228 +#, fuzzy, c-format +msgid "%s: cannot execute: %s" +msgstr "%s: kan nie %s skep nie" + +#: builtins/exit.def:65 +#, fuzzy, c-format +msgid "logout\n" +msgstr "Afteken" + +#: builtins/exit.def:88 +msgid "not login shell: use `exit'" +msgstr "" + +#: builtins/exit.def:120 +#, c-format +msgid "There are stopped jobs.\n" +msgstr "" + +#: builtins/exit.def:122 +#, c-format +msgid "There are running jobs.\n" +msgstr "" + +#: builtins/fc.def:262 +#, fuzzy +msgid "no command found" +msgstr "%s: bevel nie gevind nie" + +#: builtins/fc.def:320 builtins/fc.def:369 +msgid "history specification" +msgstr "" + +#: builtins/fc.def:390 +#, fuzzy, c-format +msgid "%s: cannot open temp file: %s" +msgstr "%s: kan nie %s skep nie" + +#: builtins/fg_bg.def:149 builtins/jobs.def:282 +msgid "current" +msgstr "" + +#: builtins/fg_bg.def:158 +#, c-format +msgid "job %d started without job control" +msgstr "" + +#: builtins/getopt.c:110 +#, fuzzy, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: illegal option -- %c\n" + +#: builtins/getopt.c:111 +#, fuzzy, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: option `%s' requires an argument\n" + +#: builtins/hash.def:92 +msgid "hashing disabled" +msgstr "" + +#: builtins/hash.def:138 +#, c-format +msgid "%s: hash table empty\n" +msgstr "" + +#: builtins/hash.def:245 +#, fuzzy, c-format +msgid "hits\tcommand\n" +msgstr "Bevelreël" + +#: builtins/help.def:130 +#, c-format +msgid "Shell commands matching keyword `" +msgid_plural "Shell commands matching keywords `" +msgstr[0] "" +msgstr[1] "" + +#: builtins/help.def:182 +#, c-format +msgid "" +"no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." +msgstr "" + +#: builtins/help.def:199 +#, fuzzy, c-format +msgid "%s: cannot open: %s" +msgstr "%s: kan nie %s skep nie" + +#: builtins/help.def:485 +#, c-format +msgid "" +"These shell commands are defined internally. Type `help' to see this list.\n" +"Type `help name' to find out more about the function `name'.\n" +"Use `info bash' to find out more about the shell in general.\n" +"Use `man -k' or `info' to find out more about commands not in this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" +msgstr "" + +#: builtins/history.def:154 +msgid "cannot use more than one of -anrw" +msgstr "" + +#: builtins/history.def:186 +msgid "history position" +msgstr "" + +#: builtins/history.def:366 +#, fuzzy, c-format +msgid "%s: history expansion failed" +msgstr "%s: heelgetal-uitdrukking is verwag\n" + +#: builtins/inlib.def:71 +#, fuzzy, c-format +msgid "%s: inlib failed" +msgstr "%s: heelgetal-uitdrukking is verwag\n" + +#: builtins/jobs.def:109 +msgid "no other options allowed with `-x'" +msgstr "" + +#: builtins/kill.def:200 +#, c-format +msgid "%s: arguments must be process or job IDs" +msgstr "" + +#: builtins/kill.def:263 +#, fuzzy +msgid "Unknown error" +msgstr "Onbekende fout %d" + +#: builtins/let.def:95 builtins/let.def:120 expr.c:583 expr.c:598 +#, fuzzy +msgid "expression expected" +msgstr "Bools uitdrukking verwag" + +#: builtins/mapfile.def:172 +#, fuzzy, c-format +msgid "%s: not an indexed array" +msgstr "Veranderlike boom" + +#: builtins/mapfile.def:259 builtins/read.def:302 +#, c-format +msgid "%s: invalid file descriptor specification" +msgstr "" + +#: builtins/mapfile.def:267 builtins/read.def:309 +#, c-format +msgid "%d: invalid file descriptor: %s" +msgstr "" + +#: builtins/mapfile.def:276 builtins/mapfile.def:314 +#, fuzzy, c-format +msgid "%s: invalid line count" +msgstr "%s: illegal option -- %c\n" + +#: builtins/mapfile.def:287 +#, fuzzy, c-format +msgid "%s: invalid array origin" +msgstr "%s: illegal option -- %c\n" + +#: builtins/mapfile.def:304 +#, fuzzy, c-format +msgid "%s: invalid callback quantum" +msgstr "Die sein nommer wat was gevang het" + +#: builtins/mapfile.def:336 +#, fuzzy +msgid "empty array variable name" +msgstr "Veranderlike boom" + +#: builtins/mapfile.def:357 +msgid "array variable support required" +msgstr "" + +#: builtins/printf.def:402 +#, c-format +msgid "`%s': missing format character" +msgstr "" + +#: builtins/printf.def:456 +#, fuzzy, c-format +msgid "`%c': invalid time format specification" +msgstr "%s: illegal option -- %c\n" + +#: builtins/printf.def:658 +#, c-format +msgid "`%c': invalid format character" +msgstr "" + +#: builtins/printf.def:684 +#, c-format +msgid "warning: %s: %s" +msgstr "" + +#: builtins/printf.def:768 +#, c-format +msgid "format parsing problem: %s" +msgstr "" + +#: builtins/printf.def:865 +msgid "missing hex digit for \\x" +msgstr "" + +#: builtins/printf.def:880 +#, c-format +msgid "missing unicode digit for \\%c" +msgstr "" + +#: builtins/pushd.def:195 +#, fuzzy +msgid "no other directory" +msgstr "boonste lêergids." + +#: builtins/pushd.def:354 +#, fuzzy, c-format +msgid "%s: invalid argument" +msgstr "%s: illegal option -- %c\n" + +#: builtins/pushd.def:468 +#, fuzzy +msgid "" +msgstr "Nuutste gebruik word werksaam gids" + +#: builtins/pushd.def:512 +msgid "directory stack empty" +msgstr "" + +#: builtins/pushd.def:514 +#, fuzzy +msgid "directory stack index" +msgstr "Stapel grootte verhoog" + +#: builtins/pushd.def:689 +msgid "" +"Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +"\tdirs when invoked without options, starting with zero." +msgstr "" + +#: builtins/pushd.def:711 +msgid "" +"Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" + +#: builtins/pushd.def:736 +msgid "" +"Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" + +#: builtins/read.def:275 +#, c-format +msgid "%s: invalid timeout specification" +msgstr "" + +#: builtins/read.def:678 +#, fuzzy, c-format +msgid "read error: %d: %s" +msgstr "pypfout: %s" + +#: builtins/return.def:75 +msgid "can only `return' from a function or sourced script" +msgstr "" + +#: builtins/set.def:782 +msgid "cannot simultaneously unset a function and a variable" +msgstr "" + +#: builtins/set.def:826 +#, fuzzy, c-format +msgid "%s: cannot unset" +msgstr "%s: kan nie %s skep nie" + +#: builtins/set.def:843 +#, fuzzy, c-format +msgid "%s: cannot unset: readonly %s" +msgstr "%s: kan nie %s skep nie" + +#: builtins/set.def:854 +#, fuzzy, c-format +msgid "%s: not an array variable" +msgstr "Veranderlike boom" + +#: builtins/setattr.def:187 +#, fuzzy, c-format +msgid "%s: not a function" +msgstr "%s: leesalleen-funksie" + +#: builtins/shift.def:71 builtins/shift.def:77 +#, fuzzy +msgid "shift count" +msgstr "Shift" + +#: builtins/shopt.def:279 +msgid "cannot set and unset shell options simultaneously" +msgstr "" + +#: builtins/shopt.def:346 +#, c-format +msgid "%s: invalid shell option name" +msgstr "" + +#: builtins/source.def:130 +msgid "filename argument required" +msgstr "" + +#: builtins/source.def:155 +#, fuzzy, c-format +msgid "%s: file not found" +msgstr "%s: bevel nie gevind nie" + +#: builtins/suspend.def:101 +msgid "cannot suspend" +msgstr "" + +#: builtins/suspend.def:111 +#, fuzzy +msgid "cannot suspend a login shell" +msgstr "Begin aanteken tolk" + +#: builtins/type.def:234 +#, c-format +msgid "%s is aliased to `%s'\n" +msgstr "" + +#: builtins/type.def:255 +#, c-format +msgid "%s is a shell keyword\n" +msgstr "" + +#: builtins/type.def:274 +#, fuzzy, c-format +msgid "%s is a function\n" +msgstr "%s: leesalleen-funksie" + +#: builtins/type.def:296 +#, c-format +msgid "%s is a shell builtin\n" +msgstr "" + +#: builtins/type.def:317 builtins/type.def:393 +#, c-format +msgid "%s is %s\n" +msgstr "" + +#: builtins/type.def:337 +#, c-format +msgid "%s is hashed (%s)\n" +msgstr "" + +#: builtins/ulimit.def:383 +#, c-format +msgid "%s: invalid limit argument" +msgstr "" + +#: builtins/ulimit.def:409 +#, fuzzy, c-format +msgid "`%c': bad command" +msgstr "%s: illegal option -- %c\n" + +#: builtins/ulimit.def:438 +#, fuzzy, c-format +msgid "%s: cannot get limit: %s" +msgstr "%s: kan nie %s skep nie" + +#: builtins/ulimit.def:464 +#, fuzzy +msgid "limit" +msgstr "Filter beperk:" + +#: builtins/ulimit.def:476 builtins/ulimit.def:776 +#, fuzzy, c-format +msgid "%s: cannot modify limit: %s" +msgstr "%s: kan nie %s skep nie" + +#: builtins/umask.def:114 +#, fuzzy +msgid "octal number" +msgstr "Die sein nommer wat was gevang het" + +#: builtins/umask.def:227 +#, c-format +msgid "`%c': invalid symbolic mode operator" +msgstr "" + +#: builtins/umask.def:282 +#, c-format +msgid "`%c': invalid symbolic mode character" +msgstr "" + +#: error.c:90 error.c:325 error.c:327 error.c:329 +msgid " line " +msgstr "" + +#: error.c:165 +#, fuzzy, c-format +msgid "last command: %s\n" +msgstr "Bevelreël" + +#: error.c:173 +#, c-format +msgid "Aborting..." +msgstr "" + +#: error.c:440 +#, fuzzy +msgid "unknown command error" +msgstr "Onbekende fout %d" + +#: error.c:441 +#, fuzzy +msgid "bad command type" +msgstr "bevelnaam" + +#: error.c:442 +#, fuzzy +msgid "bad connector" +msgstr "foutiewe verbinder`%d'" + +#: error.c:443 +#, fuzzy +msgid "bad jump" +msgstr "Spring na:" + +#: error.c:481 +#, fuzzy, c-format +msgid "%s: unbound variable" +msgstr "Veranderlike boom" + +#: eval.c:189 +#, c-format +msgid "\atimed out waiting for input: auto-logout\n" +msgstr "" + +#: execute_cmd.c:512 +#, c-format +msgid "cannot redirect standard input from /dev/null: %s" +msgstr "" + +#: execute_cmd.c:1233 +#, c-format +msgid "TIMEFORMAT: `%c': invalid format character" +msgstr "" + +#: execute_cmd.c:2287 +#, fuzzy +msgid "pipe error" +msgstr "pypfout: %s" + +#: execute_cmd.c:4386 +#, c-format +msgid "%s: maximum function nesting level exceeded (%d)" +msgstr "" + +#: execute_cmd.c:4884 +#, c-format +msgid "%s: restricted: cannot specify `/' in command names" +msgstr "" + +#: execute_cmd.c:4973 +#, c-format +msgid "%s: command not found" +msgstr "%s: bevel nie gevind nie" + +#: execute_cmd.c:5206 +#, c-format +msgid "%s: %s" +msgstr "" + +#: execute_cmd.c:5243 +#, fuzzy, c-format +msgid "%s: %s: bad interpreter" +msgstr "%s: is 'n gids" + +#: execute_cmd.c:5280 +#, fuzzy, c-format +msgid "%s: cannot execute binary file: %s" +msgstr "%s: kan nie 'n binêre lêer uitvoer nie" + +#: execute_cmd.c:5352 +#, c-format +msgid "`%s': is a special builtin" +msgstr "" + +#: execute_cmd.c:5404 +#, fuzzy, c-format +msgid "cannot duplicate fd %d to fd %d" +msgstr "kan nie fd %d na fd 0 dupliseer nie: %s" + +#: expr.c:259 +msgid "expression recursion level exceeded" +msgstr "" + +#: expr.c:283 +#, fuzzy +msgid "recursion stack underflow" +msgstr "Stapel grootte verhoog" + +#: expr.c:431 +#, fuzzy +msgid "syntax error in expression" +msgstr "Sintaks fout in patroon" + +#: expr.c:475 +msgid "attempted assignment to non-variable" +msgstr "" + +#: expr.c:495 expr.c:858 +#, fuzzy +msgid "division by 0" +msgstr "devisie by nul." + +#: expr.c:542 +msgid "bug: bad expassign token" +msgstr "" + +#: expr.c:595 +#, fuzzy +msgid "`:' expected for conditional expression" +msgstr "Soek die lêer vir 'n uitdrukking" + +#: expr.c:919 +msgid "exponent less than 0" +msgstr "" + +#: expr.c:976 +msgid "identifier expected after pre-increment or pre-decrement" +msgstr "" + +#: expr.c:1002 +#, fuzzy +msgid "missing `)'" +msgstr "Ontbrekende '>'" + +#: expr.c:1053 expr.c:1390 +#, fuzzy +msgid "syntax error: operand expected" +msgstr "Onverwagte einde van lêer tydens inlees van hulpbron." + +#: expr.c:1392 +msgid "syntax error: invalid arithmetic operator" +msgstr "" + +#: expr.c:1416 +#, fuzzy, c-format +msgid "%s%s%s: %s (error token is \"%s\")" +msgstr "" +"Hierdie is die fout boodskap van %1:\n" +"%2" + +#: expr.c:1474 +msgid "invalid arithmetic base" +msgstr "" + +#: expr.c:1494 +msgid "value too great for base" +msgstr "waarde te groot vir basis" + +#: expr.c:1543 +#, fuzzy, c-format +msgid "%s: expression error\n" +msgstr "%s: heelgetal-uitdrukking is verwag\n" + +#: general.c:62 +#, fuzzy +msgid "getcwd: cannot access parent directories" +msgstr "Kan nie die program uitvoer nie:" + +#: input.c:102 subst.c:5168 +#, fuzzy, c-format +msgid "cannot reset nodelay mode for fd %d" +msgstr "kan nie fd %d na fd 0 dupliseer nie: %s" + +#: input.c:271 +#, c-format +msgid "cannot allocate new file descriptor for bash input from fd %d" +msgstr "" + +#: input.c:279 +#, c-format +msgid "save_bash_input: buffer already exists for new fd %d" +msgstr "" + +#: jobs.c:471 +msgid "start_pipeline: pgrp pipe" +msgstr "" + +#: jobs.c:893 +#, c-format +msgid "forked pid %d appears in running job %d" +msgstr "" + +#: jobs.c:1012 +#, c-format +msgid "deleting stopped job %d with process group %ld" +msgstr "" + +#: jobs.c:1117 +#, c-format +msgid "add_process: process %5ld (%s) in the_pipeline" +msgstr "" + +#: jobs.c:1120 +#, c-format +msgid "add_process: pid %5ld (%s) marked as still alive" +msgstr "" + +#: jobs.c:1435 +#, fuzzy, c-format +msgid "describe_pid: %ld: no such pid" +msgstr "E108: Geen veranderlike: \"%s\"" + +#: jobs.c:1450 +#, fuzzy, c-format +msgid "Signal %d" +msgstr "Sein kwaliteit:" + +#: jobs.c:1464 jobs.c:1489 +msgid "Done" +msgstr "Klaar" + +#: jobs.c:1469 siglist.c:123 +#, fuzzy +msgid "Stopped" +msgstr "Op gehou" + +#: jobs.c:1473 +#, fuzzy, c-format +msgid "Stopped(%s)" +msgstr "Op gehou" + +#: jobs.c:1477 +#, fuzzy +msgid "Running" +msgstr "aktief" + +#: jobs.c:1491 +#, c-format +msgid "Done(%d)" +msgstr "Klaar(%d)" + +#: jobs.c:1493 +#, c-format +msgid "Exit %d" +msgstr "Verlaat %d" + +#: jobs.c:1496 +msgid "Unknown status" +msgstr "Onbekende status" + +#: jobs.c:1583 +#, fuzzy, c-format +msgid "(core dumped) " +msgstr "Kern Ontwikkelaar" + +#: jobs.c:1602 +#, fuzzy, c-format +msgid " (wd: %s)" +msgstr "Aktiveer nou dadelik" + +#: jobs.c:1819 +#, fuzzy, c-format +msgid "child setpgid (%ld to %ld)" +msgstr "Fout in die skryf van %s" + +#: jobs.c:2138 nojobs.c:605 +#, c-format +msgid "wait: pid %ld is not a child of this shell" +msgstr "" + +#: jobs.c:2385 +#, c-format +msgid "wait_for: No record of process %ld" +msgstr "" + +#: jobs.c:2694 +#, c-format +msgid "wait_for_job: job %d is stopped" +msgstr "" + +#: jobs.c:2986 +#, fuzzy, c-format +msgid "%s: job has terminated" +msgstr "Die bediener beëindig Die verbinding." + +#: jobs.c:2995 +#, c-format +msgid "%s: job %d already in background" +msgstr "" + +#: jobs.c:3220 +msgid "waitchld: turning on WNOHANG to avoid indefinite block" +msgstr "" + +#: jobs.c:3711 +#, fuzzy, c-format +msgid "%s: line %d: " +msgstr "3d modus" + +#: jobs.c:3725 nojobs.c:843 +#, fuzzy, c-format +msgid " (core dumped)" +msgstr "Kern Ontwikkelaar" + +#: jobs.c:3737 jobs.c:3750 +#, fuzzy, c-format +msgid "(wd now: %s)\n" +msgstr "Aktiveer nou dadelik" + +#: jobs.c:3782 +#, fuzzy +msgid "initialize_job_control: getpgrp failed" +msgstr "Inisialisering van OpenGL het misluk." + +#: jobs.c:3843 +msgid "initialize_job_control: line discipline" +msgstr "" + +#: jobs.c:3853 +#, fuzzy +msgid "initialize_job_control: setpgid" +msgstr "Inisialisering van OpenGL het misluk." + +#: jobs.c:3874 jobs.c:3883 +#, c-format +msgid "cannot set terminal process group (%d)" +msgstr "" + +#: jobs.c:3888 +msgid "no job control in this shell" +msgstr "geen taakbeheer in hierdie dop nie" + +#: lib/malloc/malloc.c:296 +#, c-format +msgid "malloc: failed assertion: %s\n" +msgstr "" + +#: lib/malloc/malloc.c:312 +#, c-format +msgid "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" +msgstr "" + +#: lib/malloc/malloc.c:313 +#, fuzzy +msgid "unknown" +msgstr "(onbekend)" + +#: lib/malloc/malloc.c:801 +msgid "malloc: block on free list clobbered" +msgstr "" + +#: lib/malloc/malloc.c:878 +msgid "free: called with already freed block argument" +msgstr "" + +#: lib/malloc/malloc.c:881 +msgid "free: called with unallocated block argument" +msgstr "" + +#: lib/malloc/malloc.c:900 +msgid "free: underflow detected; mh_nbytes out of range" +msgstr "" + +#: lib/malloc/malloc.c:906 +msgid "free: start and end chunk sizes differ" +msgstr "" + +#: lib/malloc/malloc.c:1005 +msgid "realloc: called with unallocated block argument" +msgstr "" + +#: lib/malloc/malloc.c:1020 +msgid "realloc: underflow detected; mh_nbytes out of range" +msgstr "" + +#: lib/malloc/malloc.c:1026 +msgid "realloc: start and end chunk sizes differ" +msgstr "" + +#: lib/malloc/table.c:194 +#, c-format +msgid "register_alloc: alloc table is full with FIND_ALLOC?\n" +msgstr "" + +#: lib/malloc/table.c:203 +#, c-format +msgid "register_alloc: %p already in table as allocated?\n" +msgstr "" + +#: lib/malloc/table.c:256 +#, c-format +msgid "register_free: %p already in table as free?\n" +msgstr "" + +#: lib/sh/fmtulong.c:102 +msgid "invalid base" +msgstr "" + +#: lib/sh/netopen.c:168 +#, fuzzy, c-format +msgid "%s: host unknown" +msgstr "onbekend" + +#: lib/sh/netopen.c:175 +#, c-format +msgid "%s: invalid service" +msgstr "" + +#: lib/sh/netopen.c:306 +#, c-format +msgid "%s: bad network path specification" +msgstr "" + +#: lib/sh/netopen.c:346 +msgid "network operations not supported" +msgstr "" + +#: locale.c:200 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s)" +msgstr "" + +#: locale.c:202 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s): %s" +msgstr "" + +#: locale.c:259 +#, c-format +msgid "setlocale: %s: cannot change locale (%s)" +msgstr "" + +#: locale.c:261 +#, c-format +msgid "setlocale: %s: cannot change locale (%s): %s" +msgstr "" + +#: mailcheck.c:439 +#, fuzzy +msgid "You have mail in $_" +msgstr "Bevestig Pos In" + +#: mailcheck.c:464 +#, fuzzy +msgid "You have new mail in $_" +msgstr "Wanneer nuwe pos arriveer in" + +#: mailcheck.c:480 +#, c-format +msgid "The mail in %s has been read\n" +msgstr "" + +#: make_cmd.c:323 +#, fuzzy +msgid "syntax error: arithmetic expression required" +msgstr "Sintaks fout in patroon" + +#: make_cmd.c:325 +#, fuzzy +msgid "syntax error: `;' unexpected" +msgstr "Onverwagte einde van lêer tydens inlees van hulpbron." + +#: make_cmd.c:326 +#, fuzzy, c-format +msgid "syntax error: `((%s))'" +msgstr "sintaksfout" + +#: make_cmd.c:578 +#, c-format +msgid "make_here_document: bad instruction type %d" +msgstr "" + +#: make_cmd.c:662 +#, c-format +msgid "here-document at line %d delimited by end-of-file (wanted `%s')" +msgstr "" + +#: make_cmd.c:759 +#, c-format +msgid "make_redirection: redirection instruction `%d' out of range" +msgstr "" + +#: parse.y:3278 parse.y:3561 +#, c-format +msgid "unexpected EOF while looking for matching `%c'" +msgstr "" + +#: parse.y:4170 +msgid "unexpected EOF while looking for `]]'" +msgstr "" + +#: parse.y:4175 +#, c-format +msgid "syntax error in conditional expression: unexpected token `%s'" +msgstr "" + +#: parse.y:4179 +#, fuzzy +msgid "syntax error in conditional expression" +msgstr "Sintaks fout in patroon" + +#: parse.y:4257 +#, c-format +msgid "unexpected token `%s', expected `)'" +msgstr "" + +#: parse.y:4261 +#, fuzzy +msgid "expected `)'" +msgstr "')' is verwag\n" + +#: parse.y:4289 +#, c-format +msgid "unexpected argument `%s' to conditional unary operator" +msgstr "" + +#: parse.y:4293 +msgid "unexpected argument to conditional unary operator" +msgstr "" + +#: parse.y:4339 +#, fuzzy, c-format +msgid "unexpected token `%s', conditional binary operator expected" +msgstr "%s: binêre operator is verwag\n" + +#: parse.y:4343 +#, fuzzy +msgid "conditional binary operator expected" +msgstr "%s: binêre operator is verwag\n" + +#: parse.y:4365 +#, c-format +msgid "unexpected argument `%s' to conditional binary operator" +msgstr "" + +#: parse.y:4369 +msgid "unexpected argument to conditional binary operator" +msgstr "" + +#: parse.y:4380 +#, fuzzy, c-format +msgid "unexpected token `%c' in conditional command" +msgstr "Soek die lêer vir 'n uitdrukking" + +#: parse.y:4383 +#, fuzzy, c-format +msgid "unexpected token `%s' in conditional command" +msgstr "Soek die lêer vir 'n uitdrukking" + +#: parse.y:4387 +#, fuzzy, c-format +msgid "unexpected token %d in conditional command" +msgstr "Soek die lêer vir 'n uitdrukking" + +#: parse.y:5737 +#, c-format +msgid "syntax error near unexpected token `%s'" +msgstr "" + +#: parse.y:5755 +#, fuzzy, c-format +msgid "syntax error near `%s'" +msgstr "Sintaks fout in patroon" + +#: parse.y:5765 +#, fuzzy +msgid "syntax error: unexpected end of file" +msgstr "Onverwagte einde van lêer tydens inlees van hulpbron." + +#: parse.y:5765 +msgid "syntax error" +msgstr "sintaksfout" + +#: parse.y:5827 +#, fuzzy, c-format +msgid "Use \"%s\" to leave the shell.\n" +msgstr "Gebruik Kaart na Los Tronk" + +#: parse.y:5989 +msgid "unexpected EOF while looking for matching `)'" +msgstr "" + +#: pcomplete.c:1094 +#, c-format +msgid "completion: function `%s' not found" +msgstr "" + +#: pcomplib.c:182 +#, c-format +msgid "progcomp_insert: %s: NULL COMPSPEC" +msgstr "" + +#: print_cmd.c:300 +#, c-format +msgid "print_command: bad connector `%d'" +msgstr "" + +#: print_cmd.c:373 +#, c-format +msgid "xtrace_set: %d: invalid file descriptor" +msgstr "" + +#: print_cmd.c:378 +msgid "xtrace_set: NULL file pointer" +msgstr "" + +#: print_cmd.c:382 +#, c-format +msgid "xtrace fd (%d) != fileno xtrace fp (%d)" +msgstr "" + +#: print_cmd.c:1518 +#, c-format +msgid "cprintf: `%c': invalid format character" +msgstr "" + +#: redir.c:123 redir.c:170 +msgid "file descriptor out of range" +msgstr "" + +#: redir.c:177 +#, fuzzy, c-format +msgid "%s: ambiguous redirect" +msgstr "%s: dubbelsinnige herroetering" + +#: redir.c:181 +#, fuzzy, c-format +msgid "%s: cannot overwrite existing file" +msgstr "Jy het gespesifiseer 'n bestaande lêer" + +#: redir.c:186 +#, c-format +msgid "%s: restricted: cannot redirect output" +msgstr "" + +#: redir.c:191 +#, c-format +msgid "cannot create temp file for here-document: %s" +msgstr "" + +#: redir.c:195 +#, fuzzy, c-format +msgid "%s: cannot assign fd to variable" +msgstr "Kan nie soek 'n handtekening in hierdie boodskap!" + +#: redir.c:582 +msgid "/dev/(tcp|udp)/host/port not supported without networking" +msgstr "" + +#: redir.c:861 redir.c:973 redir.c:1034 redir.c:1199 +#, fuzzy +msgid "redirection error: cannot duplicate fd" +msgstr "Pypfout.\n" + +#: shell.c:339 +msgid "could not find /tmp, please create!" +msgstr "" + +#: shell.c:343 +msgid "/tmp must be a valid directory name" +msgstr "" + +#: shell.c:890 +#, fuzzy, c-format +msgid "%c%c: invalid option" +msgstr "%s: illegal option -- %c\n" + +#: shell.c:1682 +msgid "I have no name!" +msgstr "Ek het nie 'n naam nie!" + +#: shell.c:1827 +#, fuzzy, c-format +msgid "GNU bash, version %s-(%s)\n" +msgstr "bedryfstelselkernweergawe" + +#: shell.c:1828 +#, c-format +msgid "" +"Usage:\t%s [GNU long option] [option] ...\n" +"\t%s [GNU long option] [option] script-file ...\n" +msgstr "" + +#: shell.c:1830 +#, fuzzy +msgid "GNU long options:\n" +msgstr "Gnu C Saamsteller Opsies" + +#: shell.c:1834 +#, fuzzy +msgid "Shell options:\n" +msgstr "opneem opsies" + +#: shell.c:1835 +msgid "\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n" +msgstr "" + +#: shell.c:1850 +#, fuzzy, c-format +msgid "\t-%s or -o option\n" +msgstr "" +"Gebruik so: %s LÊER \n" +" of: %s OPSIE\n" + +#: shell.c:1856 +#, c-format +msgid "Type `%s -c \"help set\"' for more information about shell options.\n" +msgstr "" + +#: shell.c:1857 +#, c-format +msgid "Type `%s -c help' for more information about shell builtin commands.\n" +msgstr "" + +#: shell.c:1858 +#, c-format +msgid "Use the `bashbug' command to report bugs.\n" +msgstr "" + +#: sig.c:691 +#, c-format +msgid "sigprocmask: %d: invalid operation" +msgstr "" + +#: siglist.c:48 +msgid "Bogus signal" +msgstr "Foutiewe sein" + +#: siglist.c:51 +#, fuzzy +msgid "Hangup" +msgstr "Ophang" + +#: siglist.c:55 +#, fuzzy +msgid "Interrupt" +msgstr "Interrupt" + +#: siglist.c:59 +#, fuzzy +msgid "Quit" +msgstr "Verlaat" + +#: siglist.c:63 +#, fuzzy +msgid "Illegal instruction" +msgstr "Sigill (onwettige instruksie)" + +#: siglist.c:67 +msgid "BPT trace/trap" +msgstr "" + +#: siglist.c:75 +#, fuzzy +msgid "ABORT instruction" +msgstr "Verwerking Instruksie" + +#: siglist.c:79 +#, fuzzy +msgid "EMT instruction" +msgstr "Verwerking Instruksie" + +#: siglist.c:83 +#, fuzzy +msgid "Floating point exception" +msgstr "wisselpuntgetaluitsondering" + +#: siglist.c:87 +#, fuzzy +msgid "Killed" +msgstr "Doodgemaak proses." + +#: siglist.c:91 +#, fuzzy +msgid "Bus error" +msgstr "Pypfout.\n" + +#: siglist.c:95 +#, fuzzy +msgid "Segmentation fault" +msgstr "Sigsegv (segmentasie oortreding)" + +#: siglist.c:99 +#, fuzzy +msgid "Bad system call" +msgstr "fork-stelselroep het gefaal" + +#: siglist.c:103 +#, fuzzy +msgid "Broken pipe" +msgstr "Sigpipe (gebroke pyp)" + +#: siglist.c:107 +#, fuzzy +msgid "Alarm clock" +msgstr "wêreld horlosie" + +#: siglist.c:111 +#, fuzzy +msgid "Terminated" +msgstr "Gedruk: %s" + +#: siglist.c:115 +#, fuzzy +msgid "Urgent IO condition" +msgstr "Ooreenstem enige kondisie" + +#: siglist.c:119 +#, fuzzy +msgid "Stopped (signal)" +msgstr "Sein kwaliteit:" + +#: siglist.c:127 +#, fuzzy +msgid "Continue" +msgstr "Gaan voort" + +#: siglist.c:135 +msgid "Child death or stop" +msgstr "" + +#: siglist.c:139 +#, fuzzy +msgid "Stopped (tty input)" +msgstr "Sigttin (tty invoer)" + +#: siglist.c:143 +#, fuzzy +msgid "Stopped (tty output)" +msgstr "Sigttou (tty uitset)" + +#: siglist.c:147 +#, fuzzy +msgid "I/O ready" +msgstr "Gereed." + +#: siglist.c:151 +#, fuzzy +msgid "CPU limit" +msgstr "Filter beperk:" + +#: siglist.c:155 +#, fuzzy +msgid "File limit" +msgstr "Filter beperk:" + +#: siglist.c:159 +#, fuzzy +msgid "Alarm (virtual)" +msgstr "virtuele werkskerms" + +#: siglist.c:163 +#, fuzzy +msgid "Alarm (profile)" +msgstr "Vee profiel uit..." + +#: siglist.c:167 +#, fuzzy +msgid "Window changed" +msgstr "Lêer Het verander" + +#: siglist.c:171 +#, fuzzy +msgid "Record lock" +msgstr "Sluit Lêers" + +#: siglist.c:175 +#, fuzzy +msgid "User signal 1" +msgstr "Gebruiker Sein 1" + +#: siglist.c:179 +#, fuzzy +msgid "User signal 2" +msgstr "Gebruiker Sein 1" + +#: siglist.c:183 +msgid "HFT input data pending" +msgstr "" + +#: siglist.c:187 +#, fuzzy +msgid "power failure imminent" +msgstr "Vaaling na Uitpak" + +#: siglist.c:191 +#, fuzzy +msgid "system crash imminent" +msgstr "Die Kde Omval Handteerder" + +#: siglist.c:195 +msgid "migrate process to another CPU" +msgstr "" + +#: siglist.c:199 +#, fuzzy +msgid "programming error" +msgstr "Pypfout.\n" + +#: siglist.c:203 +msgid "HFT monitor mode granted" +msgstr "" + +#: siglist.c:207 +msgid "HFT monitor mode retracted" +msgstr "" + +#: siglist.c:211 +msgid "HFT sound sequence has completed" +msgstr "" + +#: siglist.c:215 +msgid "Information request" +msgstr "" + +#: siglist.c:223 +#, fuzzy +msgid "Unknown Signal #" +msgstr "Sein kwaliteit:" + +#: siglist.c:225 +#, fuzzy, c-format +msgid "Unknown Signal #%d" +msgstr "Sein kwaliteit:" + +#: subst.c:1362 subst.c:1520 +#, fuzzy, c-format +msgid "bad substitution: no closing `%s' in %s" +msgstr "--Geen reëls in buffer--" + +#: subst.c:2847 +#, c-format +msgid "%s: cannot assign list to array member" +msgstr "" + +#: subst.c:5065 subst.c:5081 +#, fuzzy +msgid "cannot make pipe for process substitution" +msgstr "Woord Substitusie" + +#: subst.c:5113 +#, fuzzy +msgid "cannot make child for process substitution" +msgstr "Woord Substitusie" + +#: subst.c:5158 +#, fuzzy, c-format +msgid "cannot open named pipe %s for reading" +msgstr "Kan nie oopmaak vir skrip-afvoer nie: \"" + +#: subst.c:5160 +#, fuzzy, c-format +msgid "cannot open named pipe %s for writing" +msgstr "Kan nie oopmaak vir skrip-afvoer nie: \"" + +#: subst.c:5178 +#, fuzzy, c-format +msgid "cannot duplicate named pipe %s as fd %d" +msgstr "Kan nie oopmaak vir skrip-afvoer nie: \"" + +#: subst.c:5376 +#, fuzzy +msgid "cannot make pipe for command substitution" +msgstr "Woord Substitusie" + +#: subst.c:5414 +#, fuzzy +msgid "cannot make child for command substitution" +msgstr "Woord Substitusie" + +#: subst.c:5433 +msgid "command_substitute: cannot duplicate pipe as fd 1" +msgstr "" + +#: subst.c:5837 subst.c:8050 +#, c-format +msgid "%s: invalid variable name for name reference" +msgstr "" + +#: subst.c:6048 +#, c-format +msgid "%s: parameter null or not set" +msgstr "" + +#: subst.c:6320 subst.c:6335 +#, fuzzy, c-format +msgid "%s: substring expression < 0" +msgstr "ongeldige uitdrukking" + +#: subst.c:7506 +#, fuzzy, c-format +msgid "%s: bad substitution" +msgstr "Woord Substitusie" + +#: subst.c:7583 +#, fuzzy, c-format +msgid "$%s: cannot assign in this way" +msgstr "Kan nie soek 'n handtekening in hierdie boodskap!" + +#: subst.c:7917 +msgid "" +"future versions of the shell will force evaluation as an arithmetic " +"substitution" +msgstr "" + +#: subst.c:8421 +#, fuzzy, c-format +msgid "bad substitution: no closing \"`\" in %s" +msgstr "--Geen reëls in buffer--" + +#: subst.c:9322 +#, c-format +msgid "no match: %s" +msgstr "" + +#: test.c:147 +#, fuzzy +msgid "argument expected" +msgstr "argument verwag\n" + +#: test.c:156 +#, fuzzy, c-format +msgid "%s: integer expression expected" +msgstr "%s: heelgetal-uitdrukking is verwag\n" + +#: test.c:264 +#, fuzzy +msgid "`)' expected" +msgstr "')' is verwag\n" + +#: test.c:266 +#, fuzzy, c-format +msgid "`)' expected, found %s" +msgstr "')' is verwag, maar %s gevind\n" + +#: test.c:281 test.c:742 test.c:745 +#, fuzzy, c-format +msgid "%s: unary operator expected" +msgstr "%s: unitêre operator is verwag\n" + +#: test.c:468 test.c:785 +#, fuzzy, c-format +msgid "%s: binary operator expected" +msgstr "%s: binêre operator is verwag\n" + +#: test.c:860 +#, fuzzy +msgid "missing `]'" +msgstr "Ontbrekende '>'" + +#: trap.c:217 +#, fuzzy +msgid "invalid signal number" +msgstr "Die sein nommer wat was gevang het" + +#: trap.c:371 +#, c-format +msgid "run_pending_traps: bad value in trap_list[%d]: %p" +msgstr "" + +#: trap.c:375 +#, c-format +msgid "" +"run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" +msgstr "" + +#: trap.c:428 +#, c-format +msgid "trap_handler: bad signal %d" +msgstr "" + +#: variables.c:382 +#, c-format +msgid "error importing function definition for `%s'" +msgstr "" + +#: variables.c:780 +#, c-format +msgid "shell level (%d) too high, resetting to 1" +msgstr "" + +#: variables.c:1865 +#, c-format +msgid "%s: circular name reference" +msgstr "" + +#: variables.c:2228 +msgid "make_local_variable: no function context at current scope" +msgstr "" + +#: variables.c:2247 +#, fuzzy, c-format +msgid "%s: variable may not be assigned value" +msgstr "Kan nie soek 'n handtekening in hierdie boodskap!" + +#: variables.c:3646 +msgid "all_local_variables: no function context at current scope" +msgstr "" + +#: variables.c:3891 +#, c-format +msgid "%s has null exportstr" +msgstr "" + +#: variables.c:3896 variables.c:3905 +#, c-format +msgid "invalid character %d in exportstr for %s" +msgstr "" + +#: variables.c:3911 +#, c-format +msgid "no `=' in exportstr for %s" +msgstr "" + +#: variables.c:4344 +msgid "pop_var_context: head of shell_variables not a function context" +msgstr "" + +#: variables.c:4357 +msgid "pop_var_context: no global_variables context" +msgstr "" + +#: variables.c:4431 +msgid "pop_scope: head of shell_variables not a temporary environment scope" +msgstr "" + +#: variables.c:5257 +#, fuzzy, c-format +msgid "%s: %s: cannot open as FILE" +msgstr "%s: kan nie %s skep nie" + +#: variables.c:5262 +#, c-format +msgid "%s: %s: invalid value for trace file descriptor" +msgstr "" + +#: variables.c:5307 +#, c-format +msgid "%s: %s: compatibility value out of range" +msgstr "" + +#: version.c:46 +msgid "Copyright (C) 2013 Free Software Foundation, Inc." +msgstr "" + +#: version.c:47 version2.c:47 +msgid "" +"License GPLv3+: GNU GPL version 3 or later \n" +msgstr "" + +#: version.c:86 version2.c:86 +#, fuzzy, c-format +msgid "GNU bash, version %s (%s)\n" +msgstr "bedryfstelselkernweergawe" + +#: version.c:91 version2.c:91 +msgid "This is free software; you are free to change and redistribute it." +msgstr "" + +#: version.c:92 version2.c:92 +msgid "There is NO WARRANTY, to the extent permitted by law." +msgstr "" + +#: version2.c:46 +msgid "Copyright (C) 2012 Free Software Foundation, Inc." +msgstr "" + +#: xmalloc.c:91 +#, c-format +msgid "%s: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "" + +#: xmalloc.c:93 +#, fuzzy, c-format +msgid "%s: cannot allocate %lu bytes" +msgstr "%s: kan nie %s skep nie" + +#: xmalloc.c:163 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "" + +#: xmalloc.c:165 +#, fuzzy, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes" +msgstr "%s: kan nie %s skep nie" + +#: builtins.c:43 +#, fuzzy +msgid "alias [-p] [name[=value] ... ]" +msgstr "E418: Ongeldige waarde: %s" + +#: builtins.c:47 +#, fuzzy +msgid "unalias [-a] name [name ...]" +msgstr "Volle Naam:" + +#: builtins.c:51 +msgid "" +"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-" +"x keyseq:shell-command] [keyseq:readline-function or readline-command]" +msgstr "" + +#: builtins.c:54 +#, fuzzy +msgid "break [n]" +msgstr "Breek" + +#: builtins.c:56 +#, fuzzy +msgid "continue [n]" +msgstr "Gaan voort" + +#: builtins.c:58 +#, fuzzy +msgid "builtin [shell-builtin [arg ...]]" +msgstr "Ontfouting %1 (met arg %2 %3)" + +#: builtins.c:61 +#, fuzzy +msgid "caller [expr]" +msgstr "/Opsies/Toets" + +#: builtins.c:64 +#, fuzzy +msgid "cd [-L|[-P [-e]] [-@]] [dir]" +msgstr "init_cache_dir %s... " + +#: builtins.c:66 +#, fuzzy +msgid "pwd [-LP]" +msgstr "miniserv.pl is gestop\n" + +#: builtins.c:68 +msgid ":" +msgstr ":" + +#: builtins.c:70 +msgid "true" +msgstr "" + +#: builtins.c:72 +msgid "false" +msgstr "" + +#: builtins.c:74 +#, fuzzy +msgid "command [-pVv] command [arg ...]" +msgstr "Gebruik so: %s [OPSIE] [BEVEL [ARG]...]\n" + +#: builtins.c:76 +#, fuzzy +msgid "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" +msgstr "E418: Ongeldige waarde: %s" + +#: builtins.c:78 +#, fuzzy +msgid "typeset [-aAfFgilrtux] [-p] name[=value] ..." +msgstr "E418: Ongeldige waarde: %s" + +#: builtins.c:80 +#, fuzzy +msgid "local [option] name[=value] ..." +msgstr "Name=Plaaslike Netwerk" + +#: builtins.c:83 +#, fuzzy +msgid "echo [-neE] [arg ...]" +msgstr "Ontfouting %1 (met arg %2 %3)" + +#: builtins.c:87 +#, fuzzy +msgid "echo [-n] [arg ...]" +msgstr "Konfigureer Eggo" + +#: builtins.c:90 +#, fuzzy +msgid "enable [-a] [-dnps] [-f filename] [name ...]" +msgstr "Teruglus lêernaam:" + +#: builtins.c:92 +#, fuzzy +msgid "eval [arg ...]" +msgstr "Ontfouting %1 (met arg %2 %3)" + +#: builtins.c:94 +msgid "getopts optstring name [arg]" +msgstr "" + +#: builtins.c:96 +msgid "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" +msgstr "" + +#: builtins.c:98 +#, fuzzy +msgid "exit [n]" +msgstr "Verlaat" + +#: builtins.c:100 +#, fuzzy +msgid "logout [n]" +msgstr "Afteken" + +#: builtins.c:103 +msgid "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" +msgstr "" + +#: builtins.c:107 +#, fuzzy +msgid "fg [job_spec]" +msgstr "Kort Spesifikasie werkvoorbeeld" + +#: builtins.c:111 +#, fuzzy +msgid "bg [job_spec ...]" +msgstr "Kort Spesifikasie werkvoorbeeld" + +#: builtins.c:114 +#, fuzzy +msgid "hash [-lr] [-p pathname] [-dt] [name ...]" +msgstr "Teruglus lêernaam:" + +#: builtins.c:117 +#, fuzzy +msgid "help [-dms] [pattern ...]" +msgstr "enige patroon" + +#: builtins.c:121 +msgid "" +"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg " +"[arg...]" +msgstr "" + +#: builtins.c:125 +msgid "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" +msgstr "" + +#: builtins.c:129 +msgid "disown [-h] [-ar] [jobspec ...]" +msgstr "" + +#: builtins.c:132 +msgid "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l " +"[sigspec]" +msgstr "" + +#: builtins.c:134 +#, fuzzy +msgid "let arg [arg ...]" +msgstr "Kom ons begin!" + +#: builtins.c:136 +msgid "" +"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p " +"prompt] [-t timeout] [-u fd] [name ...]" +msgstr "" + +#: builtins.c:138 +#, fuzzy +msgid "return [n]" +msgstr "Terug Adres - 3/4 x 2\"" + +#: builtins.c:140 +#, fuzzy +msgid "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" +msgstr "Gebruik so: %s [OPSIE]... [-] [GEBRUIKER [ARG]...]\n" + +#: builtins.c:142 +#, fuzzy +msgid "unset [-f] [-v] [-n] [name ...]" +msgstr "Volle Naam:" + +#: builtins.c:144 +#, fuzzy +msgid "export [-fn] [name[=value] ...] or export -p" +msgstr "Bediener of domein naam:" + +#: builtins.c:146 +#, fuzzy +msgid "readonly [-aAf] [name[=value] ...] or readonly -p" +msgstr "Bediener of domein naam:" + +#: builtins.c:148 +#, fuzzy +msgid "shift [n]" +msgstr "Verlaat" + +#: builtins.c:150 +#, fuzzy +msgid "source filename [arguments]" +msgstr "Kies Lêernaam" + +#: builtins.c:152 +#, fuzzy +msgid ". filename [arguments]" +msgstr ". lêernaam" + +#: builtins.c:155 +#, fuzzy +msgid "suspend [-f]" +msgstr "|uitsit}\n" + +#: builtins.c:158 +#, fuzzy +msgid "test [expr]" +msgstr "/Opsies/Toets" + +#: builtins.c:160 +#, fuzzy +msgid "[ arg... ]" +msgstr "Arg %1" + +#: builtins.c:162 +#, fuzzy +msgid "times" +msgstr "Herhaal %1 times " + +#: builtins.c:164 +msgid "trap [-lp] [[arg] signal_spec ...]" +msgstr "" + +#: builtins.c:166 +#, fuzzy +msgid "type [-afptP] name [name ...]" +msgstr "Tipe die naam van die %1 speler." + +#: builtins.c:169 +#, fuzzy +msgid "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" +msgstr "Grootte beperk (Kb):" + +#: builtins.c:172 +#, fuzzy +msgid "umask [-p] [-S] [mode]" +msgstr "Belmetode" + +#: builtins.c:175 +#, fuzzy +msgid "wait [-n] [id ...]" +msgstr "Wag:" + +#: builtins.c:179 +#, fuzzy +msgid "wait [pid ...]" +msgstr "Wag:" + +#: builtins.c:182 +msgid "for NAME [in WORDS ... ] ; do COMMANDS; done" +msgstr "" + +#: builtins.c:184 +msgid "for (( exp1; exp2; exp3 )); do COMMANDS; done" +msgstr "" + +#: builtins.c:186 +msgid "select NAME [in WORDS ... ;] do COMMANDS; done" +msgstr "" + +#: builtins.c:188 +msgid "time [-p] pipeline" +msgstr "" + +#: builtins.c:190 +msgid "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" +msgstr "" + +#: builtins.c:192 +msgid "" +"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else " +"COMMANDS; ] fi" +msgstr "" + +#: builtins.c:194 +msgid "while COMMANDS; do COMMANDS; done" +msgstr "" + +#: builtins.c:196 +#, fuzzy +msgid "until COMMANDS; do COMMANDS; done" +msgstr "Bediener of domein naam:" + +#: builtins.c:198 +msgid "coproc [NAME] command [redirections]" +msgstr "" + +#: builtins.c:200 +#, fuzzy +msgid "function name { COMMANDS ; } or name () { COMMANDS ; }" +msgstr "Bediener of domein naam:" + +#: builtins.c:202 +#, fuzzy +msgid "{ COMMANDS ; }" +msgstr "Opdragte" + +#: builtins.c:204 +#, fuzzy +msgid "job_spec [&]" +msgstr "Kort Spesifikasie werkvoorbeeld" + +#: builtins.c:206 +#, fuzzy +msgid "(( expression ))" +msgstr "Bools uitdrukking verwag" + +#: builtins.c:208 +#, fuzzy +msgid "[[ expression ]]" +msgstr "Bools uitdrukking verwag" + +#: builtins.c:210 +msgid "variables - Names and meanings of some shell variables" +msgstr "" + +#: builtins.c:213 +#, fuzzy +msgid "pushd [-n] [+N | -N | dir]" +msgstr "Tydelike gids:" + +#: builtins.c:217 +msgid "popd [-n] [+N | -N]" +msgstr "" + +#: builtins.c:221 +msgid "dirs [-clpv] [+N] [-N]" +msgstr "" + +#: builtins.c:224 +#, fuzzy +msgid "shopt [-pqsu] [-o] [optname ...]" +msgstr "Volle Naam:" + +#: builtins.c:226 +msgid "printf [-v var] format [arguments]" +msgstr "" + +#: builtins.c:229 +msgid "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-" +"W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S " +"suffix] [name ...]" +msgstr "" + +#: builtins.c:233 +msgid "" +"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " +"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" +msgstr "" + +#: builtins.c:237 +#, fuzzy +msgid "compopt [-o|+o option] [-DE] [name ...]" +msgstr "Tipe die naam van die %1 speler." + +#: builtins.c:240 +msgid "" +"mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" + +#: builtins.c:242 +msgid "" +"readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" + +#: builtins.c:254 +msgid "" +"Define or display aliases.\n" +" \n" +" Without arguments, `alias' prints the list of aliases in the reusable\n" +" form `alias NAME=VALUE' on standard output.\n" +" \n" +" Otherwise, an alias is defined for each NAME whose VALUE is given.\n" +" A trailing space in VALUE causes the next word to be checked for\n" +" alias substitution when the alias is expanded.\n" +" \n" +" Options:\n" +" -p\tPrint all defined aliases in a reusable format\n" +" \n" +" Exit Status:\n" +" alias returns true unless a NAME is supplied for which no alias has " +"been\n" +" defined." +msgstr "" + +#: builtins.c:276 +msgid "" +"Remove each NAME from the list of defined aliases.\n" +" \n" +" Options:\n" +" -a\tremove all alias definitions.\n" +" \n" +" Return success unless a NAME is not an existing alias." +msgstr "" + +#: builtins.c:289 +msgid "" +"Set Readline key bindings and variables.\n" +" \n" +" Bind a key sequence to a Readline function or a macro, or set a\n" +" Readline variable. The non-option argument syntax is equivalent to\n" +" that found in ~/.inputrc, but must be passed as a single argument:\n" +" e.g., bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Options:\n" +" -m keymap Use KEYMAP as the keymap for the duration of this\n" +" command. Acceptable keymap names are emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" +"move,\n" +" vi-command, and vi-insert.\n" +" -l List names of functions.\n" +" -P List function names and bindings.\n" +" -p List functions and bindings in a form that can be\n" +" reused as input.\n" +" -S List key sequences that invoke macros and their " +"values\n" +" -s List key sequences that invoke macros and their " +"values\n" +" in a form that can be reused as input.\n" +" -V List variable names and values\n" +" -v List variable names and values in a form that can\n" +" be reused as input.\n" +" -q function-name Query about which keys invoke the named function.\n" +" -u function-name Unbind all keys which are bound to the named " +"function.\n" +" -r keyseq Remove the binding for KEYSEQ.\n" +" -f filename Read key bindings from FILENAME.\n" +" -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when\n" +" \t\t\t\tKEYSEQ is entered.\n" +" -X\t\t List key sequences bound with -x and associated commands\n" +" in a form that can be reused as input.\n" +" \n" +" Exit Status:\n" +" bind returns 0 unless an unrecognized option is given or an error occurs." +msgstr "" + +#: builtins.c:328 +msgid "" +"Exit for, while, or until loops.\n" +" \n" +" Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n" +" loops.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" + +#: builtins.c:340 +msgid "" +"Resume for, while, or until loops.\n" +" \n" +" Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n" +" If N is specified, resumes the Nth enclosing loop.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" + +#: builtins.c:352 +msgid "" +"Execute shell builtins.\n" +" \n" +" Execute SHELL-BUILTIN with arguments ARGs without performing command\n" +" lookup. This is useful when you wish to reimplement a shell builtin\n" +" as a shell function, but need to execute the builtin within the " +"function.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n" +" not a shell builtin.." +msgstr "" + +#: builtins.c:367 +msgid "" +"Return the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns \"$line $filename\". With EXPR, returns\n" +" \"$line $subroutine $filename\"; this extra information can be used to\n" +" provide a stack trace.\n" +" \n" +" The value of EXPR indicates how many call frames to go back before the\n" +" current one; the top frame is frame 0.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless the shell is not executing a shell function or EXPR\n" +" is invalid." +msgstr "" + +#: builtins.c:385 +msgid "" +"Change the shell working directory.\n" +" \n" +" Change the current directory to DIR. The default DIR is the value of " +"the\n" +" HOME shell variable.\n" +" \n" +" The variable CDPATH defines the search path for the directory " +"containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon " +"(:).\n" +" A null directory name is the same as the current directory. If DIR " +"begins\n" +" with a slash (/), then CDPATH is not used.\n" +" \n" +" If the directory is not found, and the shell option `cdable_vars' is " +"set,\n" +" the word is assumed to be a variable name. If that variable has a " +"value,\n" +" its value is used for DIR.\n" +" \n" +" Options:\n" +" -L\tforce symbolic links to be followed: resolve symbolic links in\n" +" \tDIR after processing instances of `..'\n" +" -P\tuse the physical directory structure without following symbolic\n" +" \tlinks: resolve symbolic links in DIR before processing instances\n" +" \tof `..'\n" +" -e\tif the -P option is supplied, and the current working directory\n" +" \tcannot be determined successfully, exit with a non-zero status\n" +" -@ on systems that support it, present a file with extended " +"attributes\n" +" as a directory containing the file attributes\n" +" \n" +" The default is to follow symbolic links, as if `-L' were specified.\n" +" `..' is processed by removing the immediately previous pathname " +"component\n" +" back to a slash or the beginning of DIR.\n" +" \n" +" Exit Status:\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully " +"when\n" +" -P is used; non-zero otherwise." +msgstr "" + +#: builtins.c:422 +msgid "" +"Print the name of the current working directory.\n" +" \n" +" Options:\n" +" -L\tprint the value of $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tprint the physical directory, without any symbolic links\n" +" \n" +" By default, `pwd' behaves as if `-L' were specified.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless an invalid option is given or the current directory\n" +" cannot be read." +msgstr "" + +#: builtins.c:439 +msgid "" +"Null command.\n" +" \n" +" No effect; the command does nothing.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" + +#: builtins.c:450 +msgid "" +"Return a successful result.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" + +#: builtins.c:459 +msgid "" +"Return an unsuccessful result.\n" +" \n" +" Exit Status:\n" +" Always fails." +msgstr "" + +#: builtins.c:468 +msgid "" +"Execute a simple command or display information about commands.\n" +" \n" +" Runs COMMAND with ARGS suppressing shell function lookup, or display\n" +" information about the specified COMMANDs. Can be used to invoke " +"commands\n" +" on disk when a function with the same name exists.\n" +" \n" +" Options:\n" +" -p\tuse a default value for PATH that is guaranteed to find all of\n" +" \tthe standard utilities\n" +" -v\tprint a description of COMMAND similar to the `type' builtin\n" +" -V\tprint a more verbose description of each COMMAND\n" +" \n" +" Exit Status:\n" +" Returns exit status of COMMAND, or failure if COMMAND is not found." +msgstr "" + +#: builtins.c:487 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Declare variables and give them attributes. If no NAMEs are given,\n" +" display the attributes and values of all variables.\n" +" \n" +" Options:\n" +" -f\trestrict action or display to function names and definitions\n" +" -F\trestrict display to function names only (plus line number and\n" +" \tsource file when debugging)\n" +" -g\tcreate global variables when used in a shell function; otherwise\n" +" \tignored\n" +" -p\tdisplay the attributes and value of each NAME\n" +" \n" +" Options which set attributes:\n" +" -a\tto make NAMEs indexed arrays (if supported)\n" +" -A\tto make NAMEs associative arrays (if supported)\n" +" -i\tto make NAMEs have the `integer' attribute\n" +" -l\tto convert NAMEs to lower case on assignment\n" +" -n\tmake NAME a reference to the variable named by its value\n" +" -r\tto make NAMEs readonly\n" +" -t\tto make NAMEs have the `trace' attribute\n" +" -u\tto convert NAMEs to upper case on assignment\n" +" -x\tto make NAMEs export\n" +" \n" +" Using `+' instead of `-' turns off the given attribute.\n" +" \n" +" Variables with the integer attribute have arithmetic evaluation (see\n" +" the `let' command) performed when the variable is assigned a value.\n" +" \n" +" When used in a function, `declare' makes NAMEs local, as with the " +"`local'\n" +" command. The `-g' option suppresses this behavior.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or a variable\n" +" assignment error occurs." +msgstr "" + +#: builtins.c:527 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Obsolete. See `help declare'." +msgstr "" + +#: builtins.c:535 +msgid "" +"Define local variables.\n" +" \n" +" Create a local variable called NAME, and give it VALUE. OPTION can\n" +" be any option accepted by `declare'.\n" +" \n" +" Local variables can only be used within a function; they are visible\n" +" only to the function where they are defined and its children.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied, a variable\n" +" assignment error occurs, or the shell is not executing a function." +msgstr "" + +#: builtins.c:552 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs, separated by a single space character and followed by " +"a\n" +" newline, on the standard output.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" -e\tenable interpretation of the following backslash escapes\n" +" -E\texplicitly suppress interpretation of backslash escapes\n" +" \n" +" `echo' interprets the following backslash-escaped characters:\n" +" \\a\talert (bell)\n" +" \\b\tbackspace\n" +" \\c\tsuppress further output\n" +" \\e\tescape character\n" +" \\E\tescape character\n" +" \\f\tform feed\n" +" \\n\tnew line\n" +" \\r\tcarriage return\n" +" \\t\thorizontal tab\n" +" \\v\tvertical tab\n" +" \\\\\tbackslash\n" +" \\0nnn\tthe character whose ASCII code is NNN (octal). NNN can be\n" +" \t0 to 3 octal digits\n" +" \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" +" \tcan be one or two hex digits\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" + +#: builtins.c:588 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs on the standard output followed by a newline.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" + +#: builtins.c:603 +msgid "" +"Enable and disable shell builtins.\n" +" \n" +" Enables and disables builtin shell commands. Disabling allows you to\n" +" execute a disk command which has the same name as a shell builtin\n" +" without using a full pathname.\n" +" \n" +" Options:\n" +" -a\tprint a list of builtins showing whether or not each is enabled\n" +" -n\tdisable each NAME or display a list of disabled builtins\n" +" -p\tprint the list of builtins in a reusable format\n" +" -s\tprint only the names of Posix `special' builtins\n" +" \n" +" Options controlling dynamic loading:\n" +" -f\tLoad builtin NAME from shared object FILENAME\n" +" -d\tRemove a builtin loaded with -f\n" +" \n" +" Without options, each NAME is enabled.\n" +" \n" +" To use the `test' found in $PATH instead of the shell builtin\n" +" version, type `enable -n test'.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not a shell builtin or an error occurs." +msgstr "" + +#: builtins.c:631 +msgid "" +"Execute arguments as a shell command.\n" +" \n" +" Combine ARGs into a single string, use the result as input to the " +"shell,\n" +" and execute the resulting commands.\n" +" \n" +" Exit Status:\n" +" Returns exit status of command or success if command is null." +msgstr "" + +#: builtins.c:643 +msgid "" +"Parse option arguments.\n" +" \n" +" Getopts is used by shell procedures to parse positional parameters\n" +" as options.\n" +" \n" +" OPTSTRING contains the option letters to be recognized; if a letter\n" +" is followed by a colon, the option is expected to have an argument,\n" +" which should be separated from it by white space.\n" +" \n" +" Each time it is invoked, getopts will place the next option in the\n" +" shell variable $name, initializing name if it does not exist, and\n" +" the index of the next argument to be processed into the shell\n" +" variable OPTIND. OPTIND is initialized to 1 each time the shell or\n" +" a shell script is invoked. When an option requires an argument,\n" +" getopts places that argument into the shell variable OPTARG.\n" +" \n" +" getopts reports errors in one of two ways. If the first character\n" +" of OPTSTRING is a colon, getopts uses silent error reporting. In\n" +" this mode, no error messages are printed. If an invalid option is\n" +" seen, getopts places the option character found into OPTARG. If a\n" +" required argument is not found, getopts places a ':' into NAME and\n" +" sets OPTARG to the option character found. If getopts is not in\n" +" silent mode, and an invalid option is seen, getopts places '?' into\n" +" NAME and unsets OPTARG. If a required argument is not found, a '?'\n" +" is placed in NAME, OPTARG is unset, and a diagnostic message is\n" +" printed.\n" +" \n" +" If the shell variable OPTERR has the value 0, getopts disables the\n" +" printing of error messages, even if the first character of\n" +" OPTSTRING is not a colon. OPTERR has the value 1 by default.\n" +" \n" +" Getopts normally parses the positional parameters ($0 - $9), but if\n" +" more arguments are given, they are parsed instead.\n" +" \n" +" Exit Status:\n" +" Returns success if an option is found; fails if the end of options is\n" +" encountered or an error occurs." +msgstr "" + +#: builtins.c:685 +msgid "" +"Replace the shell with the given command.\n" +" \n" +" Execute COMMAND, replacing this shell with the specified program.\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not " +"specified,\n" +" any redirections take effect in the current shell.\n" +" \n" +" Options:\n" +" -a name\tpass NAME as the zeroth argument to COMMAND\n" +" -c\t\texecute COMMAND with an empty environment\n" +" -l\t\tplace a dash in the zeroth argument to COMMAND\n" +" \n" +" If the command cannot be executed, a non-interactive shell exits, " +"unless\n" +" the shell option `execfail' is set.\n" +" \n" +" Exit Status:\n" +" Returns success unless COMMAND is not found or a redirection error " +"occurs." +msgstr "" + +#: builtins.c:706 +msgid "" +"Exit the shell.\n" +" \n" +" Exits the shell with a status of N. If N is omitted, the exit status\n" +" is that of the last command executed." +msgstr "" + +#: builtins.c:715 +msgid "" +"Exit a login shell.\n" +" \n" +" Exits a login shell with exit status N. Returns an error if not " +"executed\n" +" in a login shell." +msgstr "" + +#: builtins.c:725 +msgid "" +"Display or execute commands from the history list.\n" +" \n" +" fc is used to list or edit and re-execute commands from the history " +"list.\n" +" FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" +" string, which means the most recent command beginning with that\n" +" string.\n" +" \n" +" Options:\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then " +"EDITOR,\n" +" \t\tthen vi\n" +" -l \tlist lines instead of editing\n" +" -n\tomit line numbers when listing\n" +" -r\treverse the order of the lines (newest listed first)\n" +" \n" +" With the `fc -s [pat=rep ...] [command]' format, COMMAND is\n" +" re-executed after the substitution OLD=NEW is performed.\n" +" \n" +" A useful alias to use with this is r='fc -s', so that typing `r cc'\n" +" runs the last command beginning with `cc' and typing `r' re-executes\n" +" the last command.\n" +" \n" +" Exit Status:\n" +" Returns success or status of executed command; non-zero if an error " +"occurs." +msgstr "" + +#: builtins.c:755 +msgid "" +"Move job to the foreground.\n" +" \n" +" Place the job identified by JOB_SPEC in the foreground, making it the\n" +" current job. If JOB_SPEC is not present, the shell's notion of the\n" +" current job is used.\n" +" \n" +" Exit Status:\n" +" Status of command placed in foreground, or failure if an error occurs." +msgstr "" + +#: builtins.c:770 +msgid "" +"Move jobs to the background.\n" +" \n" +" Place the jobs identified by each JOB_SPEC in the background, as if " +"they\n" +" had been started with `&'. If JOB_SPEC is not present, the shell's " +"notion\n" +" of the current job is used.\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" + +#: builtins.c:784 +msgid "" +"Remember or display program locations.\n" +" \n" +" Determine and remember the full pathname of each command NAME. If\n" +" no arguments are given, information about remembered commands is " +"displayed.\n" +" \n" +" Options:\n" +" -d\t\tforget the remembered location of each NAME\n" +" -l\t\tdisplay in a format that may be reused as input\n" +" -p pathname\tuse PATHNAME as the full pathname of NAME\n" +" -r\t\tforget all remembered locations\n" +" -t\t\tprint the remembered location of each NAME, preceding\n" +" \t\teach location with the corresponding NAME if multiple\n" +" \t\tNAMEs are given\n" +" Arguments:\n" +" NAME\t\tEach NAME is searched for in $PATH and added to the list\n" +" \t\tof remembered commands.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not found or an invalid option is given." +msgstr "" + +#: builtins.c:809 +msgid "" +"Display information about builtin commands.\n" +" \n" +" Displays brief summaries of builtin commands. If PATTERN is\n" +" specified, gives detailed help on all commands matching PATTERN,\n" +" otherwise the list of help topics is printed.\n" +" \n" +" Options:\n" +" -d\toutput short description for each topic\n" +" -m\tdisplay usage in pseudo-manpage format\n" +" -s\toutput only a short usage synopsis for each topic matching\n" +" \tPATTERN\n" +" \n" +" Arguments:\n" +" PATTERN\tPattern specifiying a help topic\n" +" \n" +" Exit Status:\n" +" Returns success unless PATTERN is not found or an invalid option is " +"given." +msgstr "" + +#: builtins.c:833 +msgid "" +"Display or manipulate the history list.\n" +" \n" +" Display the history list with line numbers, prefixing each modified\n" +" entry with a `*'. An argument of N lists only the last N entries.\n" +" \n" +" Options:\n" +" -c\tclear the history list by deleting all of the entries\n" +" -d offset\tdelete the history entry at offset OFFSET.\n" +" \n" +" -a\tappend history lines from this session to the history file\n" +" -n\tread all history lines not already read from the history file\n" +" -r\tread the history file and append the contents to the history\n" +" \tlist\n" +" -w\twrite the current history to the history file\n" +" \tand append them to the history list\n" +" \n" +" -p\tperform history expansion on each ARG and display the result\n" +" \twithout storing it in the history list\n" +" -s\tappend the ARGs to the history list as a single entry\n" +" \n" +" If FILENAME is given, it is used as the history file. Otherwise,\n" +" if $HISTFILE has a value, that is used, else ~/.bash_history.\n" +" \n" +" If the $HISTTIMEFORMAT variable is set and not null, its value is used\n" +" as a format string for strftime(3) to print the time stamp associated\n" +" with each displayed history entry. No time stamps are printed " +"otherwise.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" + +#: builtins.c:869 +msgid "" +"Display status of jobs.\n" +" \n" +" Lists the active jobs. JOBSPEC restricts output to that job.\n" +" Without options, the status of all active jobs is displayed.\n" +" \n" +" Options:\n" +" -l\tlists process IDs in addition to the normal information\n" +" -n\tlists only processes that have changed status since the last\n" +" \tnotification\n" +" -p\tlists process IDs only\n" +" -r\trestrict output to running jobs\n" +" -s\trestrict output to stopped jobs\n" +" \n" +" If -x is supplied, COMMAND is run after all job specifications that\n" +" appear in ARGS have been replaced with the process ID of that job's\n" +" process group leader.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs.\n" +" If -x is used, returns the exit status of COMMAND." +msgstr "" + +#: builtins.c:896 +msgid "" +"Remove jobs from current shell.\n" +" \n" +" Removes each JOBSPEC argument from the table of active jobs. Without\n" +" any JOBSPECs, the shell uses its notion of the current job.\n" +" \n" +" Options:\n" +" -a\tremove all jobs if JOBSPEC is not supplied\n" +" -h\tmark each JOBSPEC so that SIGHUP is not sent to the job if the\n" +" \tshell receives a SIGHUP\n" +" -r\tremove only running jobs\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option or JOBSPEC is given." +msgstr "" + +#: builtins.c:915 +msgid "" +"Send a signal to a job.\n" +" \n" +" Send the processes identified by PID or JOBSPEC the signal named by\n" +" SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n" +" SIGTERM is assumed.\n" +" \n" +" Options:\n" +" -s sig\tSIG is a signal name\n" +" -n sig\tSIG is a signal number\n" +" -l\tlist the signal names; if arguments follow `-l' they are\n" +" \tassumed to be signal numbers for which names should be listed\n" +" \n" +" Kill is a shell builtin for two reasons: it allows job IDs to be used\n" +" instead of process IDs, and allows processes to be killed if the limit\n" +" on processes that you can create is reached.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" + +#: builtins.c:938 +msgid "" +"Evaluate arithmetic expressions.\n" +" \n" +" Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" +" fixed-width integers with no check for overflow, though division by 0\n" +" is trapped and flagged as an error. The following list of operators is\n" +" grouped into levels of equal-precedence operators. The levels are " +"listed\n" +" in order of decreasing precedence.\n" +" \n" +" \tid++, id--\tvariable post-increment, post-decrement\n" +" \t++id, --id\tvariable pre-increment, pre-decrement\n" +" \t-, +\t\tunary minus, plus\n" +" \t!, ~\t\tlogical and bitwise negation\n" +" \t**\t\texponentiation\n" +" \t*, /, %\t\tmultiplication, division, remainder\n" +" \t+, -\t\taddition, subtraction\n" +" \t<<, >>\t\tleft and right bitwise shifts\n" +" \t<=, >=, <, >\tcomparison\n" +" \t==, !=\t\tequality, inequality\n" +" \t&\t\tbitwise AND\n" +" \t^\t\tbitwise XOR\n" +" \t|\t\tbitwise OR\n" +" \t&&\t\tlogical AND\n" +" \t||\t\tlogical OR\n" +" \texpr ? expr : expr\n" +" \t\t\tconditional operator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tassignment\n" +" \n" +" Shell variables are allowed as operands. The name of the variable\n" +" is replaced by its value (coerced to a fixed-width integer) within\n" +" an expression. The variable need not have its integer attribute\n" +" turned on to be used in an expression.\n" +" \n" +" Operators are evaluated in order of precedence. Sub-expressions in\n" +" parentheses are evaluated first and may override the precedence\n" +" rules above.\n" +" \n" +" Exit Status:\n" +" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." +msgstr "" + +#: builtins.c:983 +msgid "" +"Read a line from the standard input and split it into fields.\n" +" \n" +" Reads a single line from the standard input, or from file descriptor FD\n" +" if the -u option is supplied. The line is split into fields as with " +"word\n" +" splitting, and the first word is assigned to the first NAME, the second\n" +" word to the second NAME, and so on, with any leftover words assigned to\n" +" the last NAME. Only the characters found in $IFS are recognized as " +"word\n" +" delimiters.\n" +" \n" +" If no NAMEs are supplied, the line read is stored in the REPLY " +"variable.\n" +" \n" +" Options:\n" +" -a array\tassign the words read to sequential indices of the array\n" +" \t\tvariable ARRAY, starting at zero\n" +" -d delim\tcontinue until the first character of DELIM is read, rather\n" +" \t\tthan newline\n" +" -e\t\tuse Readline to obtain the line in an interactive shell\n" +" -i text\tUse TEXT as the initial text for Readline\n" +" -n nchars\treturn after reading NCHARS characters rather than waiting\n" +" \t\tfor a newline, but honor a delimiter if fewer than NCHARS\n" +" \t\tcharacters are read before the delimiter\n" +" -N nchars\treturn only after reading exactly NCHARS characters, " +"unless\n" +" \t\tEOF is encountered or read times out, ignoring any delimiter\n" +" -p prompt\toutput the string PROMPT without a trailing newline before\n" +" \t\tattempting to read\n" +" -r\t\tdo not allow backslashes to escape any characters\n" +" -s\t\tdo not echo input coming from a terminal\n" +" -t timeout\ttime out and return failure if a complete line of input " +"is\n" +" \t\tnot read within TIMEOUT seconds. The value of the TMOUT\n" +" \t\tvariable is the default timeout. TIMEOUT may be a\n" +" \t\tfractional number. If TIMEOUT is 0, read returns immediately,\n" +" \t\twithout trying to read any data, returning success only if\n" +" \t\tinput is available on the specified file descriptor. The\n" +" \t\texit status is greater than 128 if the timeout is exceeded\n" +" -u fd\t\tread from file descriptor FD instead of the standard input\n" +" \n" +" Exit Status:\n" +" The return code is zero, unless end-of-file is encountered, read times " +"out\n" +" (in which case it's greater than 128), a variable assignment error " +"occurs,\n" +" or an invalid file descriptor is supplied as the argument to -u." +msgstr "" + +#: builtins.c:1028 +msgid "" +"Return from a shell function.\n" +" \n" +" Causes a function or sourced script to exit with the return value\n" +" specified by N. If N is omitted, the return status is that of the\n" +" last command executed within the function or script.\n" +" \n" +" Exit Status:\n" +" Returns N, or failure if the shell is not executing a function or script." +msgstr "" + +#: builtins.c:1041 +msgid "" +"Set or unset values of shell options and positional parameters.\n" +" \n" +" Change the value of shell attributes and positional parameters, or\n" +" display the names and values of shell variables.\n" +" \n" +" Options:\n" +" -a Mark variables which are modified or created for export.\n" +" -b Notify of job termination immediately.\n" +" -e Exit immediately if a command exits with a non-zero status.\n" +" -f Disable file name generation (globbing).\n" +" -h Remember the location of commands as they are looked up.\n" +" -k All assignment arguments are placed in the environment for a\n" +" command, not just those that precede the command name.\n" +" -m Job control is enabled.\n" +" -n Read commands but do not execute them.\n" +" -o option-name\n" +" Set the variable corresponding to option-name:\n" +" allexport same as -a\n" +" braceexpand same as -B\n" +" emacs use an emacs-style line editing interface\n" +" errexit same as -e\n" +" errtrace same as -E\n" +" functrace same as -T\n" +" hashall same as -h\n" +" histexpand same as -H\n" +" history enable command history\n" +" ignoreeof the shell will not exit upon reading EOF\n" +" interactive-comments\n" +" allow comments to appear in interactive commands\n" +" keyword same as -k\n" +" monitor same as -m\n" +" noclobber same as -C\n" +" noexec same as -n\n" +" noglob same as -f\n" +" nolog currently accepted but ignored\n" +" notify same as -b\n" +" nounset same as -u\n" +" onecmd same as -t\n" +" physical same as -P\n" +" pipefail the return value of a pipeline is the status of\n" +" the last command to exit with a non-zero status,\n" +" or zero if no command exited with a non-zero " +"status\n" +" posix change the behavior of bash where the default\n" +" operation differs from the Posix standard to\n" +" match the standard\n" +" privileged same as -p\n" +" verbose same as -v\n" +" vi use a vi-style line editing interface\n" +" xtrace same as -x\n" +" -p Turned on whenever the real and effective user ids do not match.\n" +" Disables processing of the $ENV file and importing of shell\n" +" functions. Turning this option off causes the effective uid and\n" +" gid to be set to the real uid and gid.\n" +" -t Exit after reading and executing one command.\n" +" -u Treat unset variables as an error when substituting.\n" +" -v Print shell input lines as they are read.\n" +" -x Print commands and their arguments as they are executed.\n" +" -B the shell will perform brace expansion\n" +" -C If set, disallow existing regular files to be overwritten\n" +" by redirection of output.\n" +" -E If set, the ERR trap is inherited by shell functions.\n" +" -H Enable ! style history substitution. This flag is on\n" +" by default when the shell is interactive.\n" +" -P If set, do not resolve symbolic links when executing commands\n" +" such as cd which change the current directory.\n" +" -T If set, the DEBUG trap is inherited by shell functions.\n" +" -- Assign any remaining arguments to the positional parameters.\n" +" If there are no remaining arguments, the positional parameters\n" +" are unset.\n" +" - Assign any remaining arguments to the positional parameters.\n" +" The -x and -v options are turned off.\n" +" \n" +" Using + rather than - causes these flags to be turned off. The\n" +" flags can also be used upon invocation of the shell. The current\n" +" set of flags may be found in $-. The remaining n ARGs are positional\n" +" parameters and are assigned, in order, to $1, $2, .. $n. If no\n" +" ARGs are given, all shell variables are printed.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given." +msgstr "" + +#: builtins.c:1126 +msgid "" +"Unset values and attributes of shell variables and functions.\n" +" \n" +" For each NAME, remove the corresponding variable or function.\n" +" \n" +" Options:\n" +" -f\ttreat each NAME as a shell function\n" +" -v\ttreat each NAME as a shell variable\n" +" -n\ttreat each NAME as a name reference and unset the variable itself\n" +" \trather than the variable it references\n" +" \n" +" Without options, unset first tries to unset a variable, and if that " +"fails,\n" +" tries to unset a function.\n" +" \n" +" Some variables cannot be unset; also see `readonly'.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a NAME is read-only." +msgstr "" + +#: builtins.c:1148 +msgid "" +"Set export attribute for shell variables.\n" +" \n" +" Marks each NAME for automatic export to the environment of subsequently\n" +" executed commands. If VALUE is supplied, assign VALUE before " +"exporting.\n" +" \n" +" Options:\n" +" -f\trefer to shell functions\n" +" -n\tremove the export property from each NAME\n" +" -p\tdisplay a list of all exported variables and functions\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" + +#: builtins.c:1167 +msgid "" +"Mark shell variables as unchangeable.\n" +" \n" +" Mark each NAME as read-only; the values of these NAMEs may not be\n" +" changed by subsequent assignment. If VALUE is supplied, assign VALUE\n" +" before marking as read-only.\n" +" \n" +" Options:\n" +" -a\trefer to indexed array variables\n" +" -A\trefer to associative array variables\n" +" -f\trefer to shell functions\n" +" -p\tdisplay a list of all readonly variables or functions, depending " +"on\n" +" whether or not the -f option is given\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" + +#: builtins.c:1189 +msgid "" +"Shift positional parameters.\n" +" \n" +" Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n" +" not given, it is assumed to be 1.\n" +" \n" +" Exit Status:\n" +" Returns success unless N is negative or greater than $#." +msgstr "" + +#: builtins.c:1201 builtins.c:1216 +msgid "" +"Execute commands from a file in the current shell.\n" +" \n" +" Read and execute commands from FILENAME in the current shell. The\n" +" entries in $PATH are used to find the directory containing FILENAME.\n" +" If any ARGUMENTS are supplied, they become the positional parameters\n" +" when FILENAME is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed in FILENAME; fails if\n" +" FILENAME cannot be read." +msgstr "" + +#: builtins.c:1232 +msgid "" +"Suspend shell execution.\n" +" \n" +" Suspend the execution of this shell until it receives a SIGCONT signal.\n" +" Unless forced, login shells cannot be suspended.\n" +" \n" +" Options:\n" +" -f\tforce the suspend, even if the shell is a login shell\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" + +#: builtins.c:1248 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" Exits with a status of 0 (true) or 1 (false) depending on\n" +" the evaluation of EXPR. Expressions may be unary or binary. Unary\n" +" expressions are often used to examine the status of a file. There\n" +" are string operators and numeric comparison operators as well.\n" +" \n" +" The behavior of test depends on the number of arguments. Read the\n" +" bash manual page for the complete specification.\n" +" \n" +" File operators:\n" +" \n" +" -a FILE True if file exists.\n" +" -b FILE True if file is block special.\n" +" -c FILE True if file is character special.\n" +" -d FILE True if file is a directory.\n" +" -e FILE True if file exists.\n" +" -f FILE True if file exists and is a regular file.\n" +" -g FILE True if file is set-group-id.\n" +" -h FILE True if file is a symbolic link.\n" +" -L FILE True if file is a symbolic link.\n" +" -k FILE True if file has its `sticky' bit set.\n" +" -p FILE True if file is a named pipe.\n" +" -r FILE True if file is readable by you.\n" +" -s FILE True if file exists and is not empty.\n" +" -S FILE True if file is a socket.\n" +" -t FD True if FD is opened on a terminal.\n" +" -u FILE True if the file is set-user-id.\n" +" -w FILE True if the file is writable by you.\n" +" -x FILE True if the file is executable by you.\n" +" -O FILE True if the file is effectively owned by you.\n" +" -G FILE True if the file is effectively owned by your group.\n" +" -N FILE True if the file has been modified since it was last " +"read.\n" +" \n" +" FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" +" modification date).\n" +" \n" +" FILE1 -ot FILE2 True if file1 is older than file2.\n" +" \n" +" FILE1 -ef FILE2 True if file1 is a hard link to file2.\n" +" \n" +" String operators:\n" +" \n" +" -z STRING True if string is empty.\n" +" \n" +" -n STRING\n" +" STRING True if string is not empty.\n" +" \n" +" STRING1 = STRING2\n" +" True if the strings are equal.\n" +" STRING1 != STRING2\n" +" True if the strings are not equal.\n" +" STRING1 < STRING2\n" +" True if STRING1 sorts before STRING2 " +"lexicographically.\n" +" STRING1 > STRING2\n" +" True if STRING1 sorts after STRING2 lexicographically.\n" +" \n" +" Other operators:\n" +" \n" +" -o OPTION True if the shell option OPTION is enabled.\n" +" -v VAR\t True if the shell variable VAR is set\n" +" -R VAR\t True if the shell variable VAR is set and is a name " +"reference.\n" +" ! EXPR True if expr is false.\n" +" EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n" +" EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n" +" \n" +" arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Arithmetic binary operators return true if ARG1 is equal, not-equal,\n" +" less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n" +" than ARG2.\n" +" \n" +" Exit Status:\n" +" Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n" +" false or an invalid argument is given." +msgstr "" + +#: builtins.c:1329 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" This is a synonym for the \"test\" builtin, but the last argument must\n" +" be a literal `]', to match the opening `['." +msgstr "" + +#: builtins.c:1338 +msgid "" +"Display process times.\n" +" \n" +" Prints the accumulated user and system times for the shell and all of " +"its\n" +" child processes.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" + +#: builtins.c:1350 +msgid "" +"Trap signals and other events.\n" +" \n" +" Defines and activates handlers to be run when the shell receives " +"signals\n" +" or other conditions.\n" +" \n" +" ARG is a command to be read and executed when the shell receives the\n" +" signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n" +" is supplied) or `-', each specified signal is reset to its original\n" +" value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" +" shell and by the commands it invokes.\n" +" \n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. " +"If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. " +"If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or " +"a\n" +" script run by the . or source builtins finishes executing. A " +"SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause " +"the\n" +" shell to exit when the -e option is enabled.\n" +" \n" +" If no arguments are supplied, trap prints the list of commands " +"associated\n" +" with each signal.\n" +" \n" +" Options:\n" +" -l\tprint a list of signal names and their corresponding numbers\n" +" -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" +" \n" +" Each SIGNAL_SPEC is either a signal name in or a signal " +"number.\n" +" Signal names are case insensitive and the SIG prefix is optional. A\n" +" signal may be sent to the shell with \"kill -signal $$\".\n" +" \n" +" Exit Status:\n" +" Returns success unless a SIGSPEC is invalid or an invalid option is " +"given." +msgstr "" + +#: builtins.c:1386 +msgid "" +"Display information about command type.\n" +" \n" +" For each NAME, indicate how it would be interpreted if used as a\n" +" command name.\n" +" \n" +" Options:\n" +" -a\tdisplay all locations containing an executable named NAME;\n" +" \tincludes aliases, builtins, and functions, if and only if\n" +" \tthe `-p' option is not also used\n" +" -f\tsuppress shell function lookup\n" +" -P\tforce a PATH search for each NAME, even if it is an alias,\n" +" \tbuiltin, or function, and returns the name of the disk file\n" +" \tthat would be executed\n" +" -p\treturns either the name of the disk file that would be executed,\n" +" \tor nothing if `type -t NAME' would not return `file'.\n" +" -t\toutput a single word which is one of `alias', `keyword',\n" +" \t`function', `builtin', `file' or `', if NAME is an alias, shell\n" +" \treserved word, shell function, shell builtin, disk file, or not\n" +" \tfound, respectively\n" +" \n" +" Arguments:\n" +" NAME\tCommand name to be interpreted.\n" +" \n" +" Exit Status:\n" +" Returns success if all of the NAMEs are found; fails if any are not " +"found." +msgstr "" + +#: builtins.c:1417 +msgid "" +"Modify shell resource limits.\n" +" \n" +" Provides control over the resources available to the shell and " +"processes\n" +" it creates, on systems that allow such control.\n" +" \n" +" Options:\n" +" -S\tuse the `soft' resource limit\n" +" -H\tuse the `hard' resource limit\n" +" -a\tall current limits are reported\n" +" -b\tthe socket buffer size\n" +" -c\tthe maximum size of core files created\n" +" -d\tthe maximum size of a process's data segment\n" +" -e\tthe maximum scheduling priority (`nice')\n" +" -f\tthe maximum size of files written by the shell and its children\n" +" -i\tthe maximum number of pending signals\n" +" -l\tthe maximum size a process may lock into memory\n" +" -m\tthe maximum resident set size\n" +" -n\tthe maximum number of open file descriptors\n" +" -p\tthe pipe buffer size\n" +" -q\tthe maximum number of bytes in POSIX message queues\n" +" -r\tthe maximum real-time scheduling priority\n" +" -s\tthe maximum stack size\n" +" -t\tthe maximum amount of cpu time in seconds\n" +" -u\tthe maximum number of user processes\n" +" -v\tthe size of virtual memory\n" +" -x\tthe maximum number of file locks\n" +" -T the maximum number of threads\n" +" \n" +" Not all options are available on all platforms.\n" +" \n" +" If LIMIT is given, it is the new value of the specified resource; the\n" +" special LIMIT values `soft', `hard', and `unlimited' stand for the\n" +" current soft limit, the current hard limit, and no limit, respectively.\n" +" Otherwise, the current value of the specified resource is printed. If\n" +" no option is given, then -f is assumed.\n" +" \n" +" Values are in 1024-byte increments, except for -t, which is in seconds,\n" +" -p, which is in increments of 512 bytes, and -u, which is an unscaled\n" +" number of processes.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1465 +msgid "" +"Display or set file mode mask.\n" +" \n" +" Sets the user file-creation mask to MODE. If MODE is omitted, prints\n" +" the current value of the mask.\n" +" \n" +" If MODE begins with a digit, it is interpreted as an octal number;\n" +" otherwise it is a symbolic mode string like that accepted by chmod(1).\n" +" \n" +" Options:\n" +" -p\tif MODE is omitted, output in a form that may be reused as input\n" +" -S\tmakes the output symbolic; otherwise an octal number is output\n" +" \n" +" Exit Status:\n" +" Returns success unless MODE is invalid or an invalid option is given." +msgstr "" + +#: builtins.c:1485 +msgid "" +"Wait for job completion and return exit status.\n" +" \n" +" Waits for each process identified by an ID, which may be a process ID or " +"a\n" +" job specification, and reports its termination status. If ID is not\n" +" given, waits for all currently active child processes, and the return\n" +" status is zero. If ID is a a job specification, waits for all " +"processes\n" +" in that job's pipeline.\n" +" \n" +" If the -n option is supplied, waits for the next job to terminate and\n" +" returns its exit status.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last ID; fails if ID is invalid or an invalid\n" +" option is given." +msgstr "" + +#: builtins.c:1506 +msgid "" +"Wait for process completion and return exit status.\n" +" \n" +" Waits for each process specified by a PID and reports its termination " +"status.\n" +" If PID is not given, waits for all currently active child processes,\n" +" and the return status is zero. PID must be a process ID.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last PID; fails if PID is invalid or an " +"invalid\n" +" option is given." +msgstr "" + +#: builtins.c:1521 +msgid "" +"Execute commands for each member in a list.\n" +" \n" +" The `for' loop executes a sequence of commands for each member in a\n" +" list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is\n" +" assumed. For each element in WORDS, NAME is set to that element, and\n" +" the COMMANDS are executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1535 +msgid "" +"Arithmetic for loop.\n" +" \n" +" Equivalent to\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n" +" omitted, it behaves as if it evaluates to 1.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1553 +msgid "" +"Select words from a list and execute commands.\n" +" \n" +" The WORDS are expanded, generating a list of words. The\n" +" set of expanded words is printed on the standard error, each\n" +" preceded by a number. If `in WORDS' is not present, `in \"$@\"'\n" +" is assumed. The PS3 prompt is then displayed and a line read\n" +" from the standard input. If the line consists of the number\n" +" corresponding to one of the displayed words, then NAME is set\n" +" to that word. If the line is empty, WORDS and the prompt are\n" +" redisplayed. If EOF is read, the command completes. Any other\n" +" value read causes NAME to be set to null. The line read is saved\n" +" in the variable REPLY. COMMANDS are executed after each selection\n" +" until a break command is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1574 +msgid "" +"Report time consumed by pipeline's execution.\n" +" \n" +" Execute PIPELINE and print a summary of the real time, user CPU time,\n" +" and system CPU time spent executing PIPELINE when it terminates.\n" +" \n" +" Options:\n" +" -p\tprint the timing summary in the portable Posix format\n" +" \n" +" The value of the TIMEFORMAT variable is used as the output format.\n" +" \n" +" Exit Status:\n" +" The return status is the return status of PIPELINE." +msgstr "" + +#: builtins.c:1591 +msgid "" +"Execute commands based on pattern matching.\n" +" \n" +" Selectively execute COMMANDS based upon WORD matching PATTERN. The\n" +" `|' is used to separate multiple patterns.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1603 +msgid "" +"Execute commands based on conditional.\n" +" \n" +" The `if COMMANDS' list is executed. If its exit status is zero, then " +"the\n" +" `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list " +"is\n" +" executed in turn, and if its exit status is zero, the corresponding\n" +" `then COMMANDS' list is executed and the if command completes. " +"Otherwise,\n" +" the `else COMMANDS' list is executed, if present. The exit status of " +"the\n" +" entire construct is the exit status of the last command executed, or " +"zero\n" +" if no condition tested true.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1620 +msgid "" +"Execute commands as long as a test succeeds.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `while' COMMANDS has an exit status of zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1632 +msgid "" +"Execute commands as long as a test does not succeed.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `until' COMMANDS has an exit status which is not zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1644 +msgid "" +"Create a coprocess named NAME.\n" +" \n" +" Execute COMMAND asynchronously, with the standard output and standard\n" +" input of the command connected via a pipe to file descriptors assigned\n" +" to indices 0 and 1 of an array variable NAME in the executing shell.\n" +" The default NAME is \"COPROC\".\n" +" \n" +" Exit Status:\n" +" Returns the exit status of COMMAND." +msgstr "" + +#: builtins.c:1658 +msgid "" +"Define shell function.\n" +" \n" +" Create a shell function named NAME. When invoked as a simple command,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is " +"invoked,\n" +" the arguments are passed to the function as $1...$n, and the function's\n" +" name is in $FUNCNAME.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is readonly." +msgstr "" + +#: builtins.c:1672 +msgid "" +"Group commands as a unit.\n" +" \n" +" Run a set of commands in a group. This is one way to redirect an\n" +" entire set of commands.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1684 +msgid "" +"Resume job in foreground.\n" +" \n" +" Equivalent to the JOB_SPEC argument to the `fg' command. Resume a\n" +" stopped or background job. JOB_SPEC can specify either a job name\n" +" or a job number. Following JOB_SPEC with a `&' places the job in\n" +" the background, as if the job specification had been supplied as an\n" +" argument to `bg'.\n" +" \n" +" Exit Status:\n" +" Returns the status of the resumed job." +msgstr "" + +#: builtins.c:1699 +msgid "" +"Evaluate arithmetic expression.\n" +" \n" +" The EXPRESSION is evaluated according to the rules for arithmetic\n" +" evaluation. Equivalent to \"let EXPRESSION\".\n" +" \n" +" Exit Status:\n" +" Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise." +msgstr "" + +#: builtins.c:1711 +msgid "" +"Execute conditional command.\n" +" \n" +" Returns a status of 0 or 1 depending on the evaluation of the " +"conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries " +"used\n" +" by the `test' builtin, and may be combined using the following " +"operators:\n" +" \n" +" ( EXPRESSION )\tReturns the value of EXPRESSION\n" +" ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" +" EXPR1 && EXPR2\tTrue if both EXPR1 and EXPR2 are true; else false\n" +" EXPR1 || EXPR2\tTrue if either EXPR1 or EXPR2 is true; else false\n" +" \n" +" When the `==' and `!=' operators are used, the string to the right of\n" +" the operator is used as a pattern and pattern matching is performed.\n" +" When the `=~' operator is used, the string to the right of the operator\n" +" is matched as a regular expression.\n" +" \n" +" The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n" +" determine the expression's value.\n" +" \n" +" Exit Status:\n" +" 0 or 1 depending on value of EXPRESSION." +msgstr "" + +#: builtins.c:1737 +msgid "" +"Common shell variable names and usage.\n" +" \n" +" BASH_VERSION\tVersion information for this Bash.\n" +" CDPATH\tA colon-separated list of directories to search\n" +" \t\tfor directories given as arguments to `cd'.\n" +" GLOBIGNORE\tA colon-separated list of patterns describing filenames to\n" +" \t\tbe ignored by pathname expansion.\n" +" HISTFILE\tThe name of the file where your command history is stored.\n" +" HISTFILESIZE\tThe maximum number of lines this file can contain.\n" +" HISTSIZE\tThe maximum number of history lines that a running\n" +" \t\tshell can access.\n" +" HOME\tThe complete pathname to your login directory.\n" +" HOSTNAME\tThe name of the current host.\n" +" HOSTTYPE\tThe type of CPU this version of Bash is running under.\n" +" IGNOREEOF\tControls the action of the shell on receipt of an EOF\n" +" \t\tcharacter as the sole input. If set, then the value\n" +" \t\tof it is the number of EOF characters that can be seen\n" +" \t\tin a row on an empty line before the shell will exit\n" +" \t\t(default 10). When unset, EOF signifies the end of input.\n" +" MACHTYPE\tA string describing the current system Bash is running on.\n" +" MAILCHECK\tHow often, in seconds, Bash checks for new mail.\n" +" MAILPATH\tA colon-separated list of filenames which Bash checks\n" +" \t\tfor new mail.\n" +" OSTYPE\tThe version of Unix this version of Bash is running on.\n" +" PATH\tA colon-separated list of directories to search when\n" +" \t\tlooking for commands.\n" +" PROMPT_COMMAND\tA command to be executed before the printing of each\n" +" \t\tprimary prompt.\n" +" PS1\t\tThe primary prompt string.\n" +" PS2\t\tThe secondary prompt string.\n" +" PWD\t\tThe full pathname of the current directory.\n" +" SHELLOPTS\tA colon-separated list of enabled shell options.\n" +" TERM\tThe name of the current terminal type.\n" +" TIMEFORMAT\tThe output format for timing statistics displayed by the\n" +" \t\t`time' reserved word.\n" +" auto_resume\tNon-null means a command word appearing on a line by\n" +" \t\titself is first looked for in the list of currently\n" +" \t\tstopped jobs. If found there, that job is foregrounded.\n" +" \t\tA value of `exact' means that the command word must\n" +" \t\texactly match a command in the list of stopped jobs. A\n" +" \t\tvalue of `substring' means that the command word must\n" +" \t\tmatch a substring of the job. Any other value means that\n" +" \t\tthe command must be a prefix of a stopped job.\n" +" histchars\tCharacters controlling history expansion and quick\n" +" \t\tsubstitution. The first character is the history\n" +" \t\tsubstitution character, usually `!'. The second is\n" +" \t\tthe `quick substitution' character, usually `^'. The\n" +" \t\tthird is the `history comment' character, usually `#'.\n" +" HISTIGNORE\tA colon-separated list of patterns used to decide which\n" +" \t\tcommands should be saved on the history list.\n" +msgstr "" + +#: builtins.c:1794 +msgid "" +"Add directories to stack.\n" +" \n" +" Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" + +#: builtins.c:1828 +msgid "" +"Remove directories from stack.\n" +" \n" +" Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" + +#: builtins.c:1858 +msgid "" +"Display directory stack.\n" +" \n" +" Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1887 +msgid "" +"Set and unset shell options.\n" +" \n" +" Change the setting of each shell option OPTNAME. Without any option\n" +" arguments, list all shell options with an indication of whether or not " +"each\n" +" is set.\n" +" \n" +" Options:\n" +" -o\trestrict OPTNAMEs to those defined for use with `set -o'\n" +" -p\tprint each shell option with an indication of its status\n" +" -q\tsuppress output\n" +" -s\tenable (set) each OPTNAME\n" +" -u\tdisable (unset) each OPTNAME\n" +" \n" +" Exit Status:\n" +" Returns success if OPTNAME is enabled; fails if an invalid option is\n" +" given or OPTNAME is disabled." +msgstr "" + +#: builtins.c:1908 +msgid "" +"Formats and prints ARGUMENTS under control of the FORMAT.\n" +" \n" +" Options:\n" +" -v var\tassign the output to shell variable VAR rather than\n" +" \t\tdisplay it on the standard output\n" +" \n" +" FORMAT is a character string which contains three types of objects: " +"plain\n" +" characters, which are simply copied to standard output; character " +"escape\n" +" sequences, which are converted and copied to the standard output; and\n" +" format specifications, each of which causes printing of the next " +"successive\n" +" argument.\n" +" \n" +" In addition to the standard format specifications described in " +"printf(1),\n" +" printf interprets:\n" +" \n" +" %b\texpand backslash escape sequences in the corresponding argument\n" +" %q\tquote the argument in a way that can be reused as shell input\n" +" %(fmt)T output the date-time string resulting from using FMT as a " +"format\n" +" string for strftime(3)\n" +" \n" +" The format is re-used as necessary to consume all of the arguments. If\n" +" there are fewer arguments than the format requires, extra format\n" +" specifications behave as if a zero value or null string, as " +"appropriate,\n" +" had been supplied.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a write or " +"assignment\n" +" error occurs." +msgstr "" + +#: builtins.c:1942 +msgid "" +"Specify how arguments are to be completed by Readline.\n" +" \n" +" For each NAME, specify how arguments are to be completed. If no " +"options\n" +" are supplied, existing completion specifications are printed in a way " +"that\n" +" allows them to be reused as input.\n" +" \n" +" Options:\n" +" -p\tprint existing completion specifications in a reusable format\n" +" -r\tremove a completion specification for each NAME, or, if no\n" +" \tNAMEs are supplied, all completion specifications\n" +" -D\tapply the completions and actions as the default for commands\n" +" \twithout any specific completion defined\n" +" -E\tapply the completions and actions to \"empty\" commands --\n" +" \tcompletion attempted on a blank line\n" +" \n" +" When completion is attempted, the actions are applied in the order the\n" +" uppercase-letter options are listed above. The -D option takes\n" +" precedence over -E.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1970 +msgid "" +"Display possible completions depending on the options.\n" +" \n" +" Intended to be used from within a shell function generating possible\n" +" completions. If the optional WORD argument is supplied, matches " +"against\n" +" WORD are generated.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1985 +msgid "" +"Modify or display completion options.\n" +" \n" +" Modify the completion options for each NAME, or, if no NAMEs are " +"supplied,\n" +" the completion currently being executed. If no OPTIONs are given, " +"print\n" +" the completion options for each NAME or the current completion " +"specification.\n" +" \n" +" Options:\n" +" \t-o option\tSet completion option OPTION for each NAME\n" +" \t-D\t\tChange options for the \"default\" command completion\n" +" \t-E\t\tChange options for the \"empty\" command completion\n" +" \n" +" Using `+o' instead of `-o' turns off the specified option.\n" +" \n" +" Arguments:\n" +" \n" +" Each NAME refers to a command for which a completion specification must\n" +" have previously been defined using the `complete' builtin. If no NAMEs\n" +" are supplied, compopt must be called by a function currently generating\n" +" completions, and the options for that currently-executing completion\n" +" generator are modified.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or NAME does not\n" +" have a completion specification defined." +msgstr "" + +#: builtins.c:2015 +msgid "" +"Read lines from the standard input into an indexed array variable.\n" +" \n" +" Read lines from the standard input into the indexed array variable " +"ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable " +"MAPFILE\n" +" is the default ARRAY.\n" +" \n" +" Options:\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are " +"copied.\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default " +"index is 0.\n" +" -s count \tDiscard the first COUNT lines read.\n" +" -t\t\tRemove a trailing newline from each line read.\n" +" -u fd\t\tRead lines from file descriptor FD instead of the standard " +"input.\n" +" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read.\n" +" -c quantum\tSpecify the number of lines read between each call to " +"CALLBACK.\n" +" \n" +" Arguments:\n" +" ARRAY\t\tArray variable name to use for file data.\n" +" \n" +" If -C is supplied without -c, the default quantum is 5000. When\n" +" CALLBACK is evaluated, it is supplied the index of the next array\n" +" element to be assigned and the line to be assigned to that element\n" +" as additional arguments.\n" +" \n" +" If not supplied with an explicit origin, mapfile will clear ARRAY " +"before\n" +" assigning to it.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or ARRAY is readonly " +"or\n" +" not an indexed array." +msgstr "" + +#: builtins.c:2049 +msgid "" +"Read lines from a file into an array variable.\n" +" \n" +" A synonym for `mapfile'." +msgstr "" + +#, fuzzy +#~ msgid "wait [pid]" +#~ msgstr "Wag:" + +#, fuzzy +#~ msgid " new current working directory." +#~ msgstr "Nuutste gebruik word werksaam gids" + +#~ msgid "top directory." +#~ msgstr "boonste lêergids." + +#, fuzzy +#~ msgid "Obsolete. See `declare'." +#~ msgstr "Verkeerde verklaring tipe" + +#, fuzzy +#~ msgid "Logout of a login shell." +#~ msgstr "Begin aanteken tolk" + +#~ msgid "Missing `}'" +#~ msgstr "Ontbrekende `}'" + +#~ msgid "brace_expand> " +#~ msgstr "krulhakie_uitbrei>" + +#~ msgid "Attempt to free unknown command type `%d'.\n" +#~ msgstr "Poging om onbekende beveltipe vry te maak `%d'.\n" + +#~ msgid "Report this to %s\n" +#~ msgstr "Meld dit aan by %s\n" + +#~ msgid "Stopping myself..." +#~ msgstr "Besig om myself te stop..." + +#~ msgid "Tell %s to fix this someday.\n" +#~ msgstr "Laat weet %s om dit eendag reg te maak.\n" + +#, fuzzy +#~ msgid "execute_command: bad command type `%d'" +#~ msgstr "Uitvoer 'n tolk opdrag lyn" + +#~ msgid "real\t" +#~ msgstr "regtig\t" + +#~ msgid "user\t" +#~ msgstr "gebruiker\t" + +#~ msgid "sys\t" +#~ msgstr "stelsel\t" + +#~ msgid "" +#~ "real\t0m0.00s\n" +#~ "user\t0m0.00s\n" +#~ "sys\t0m0.00s\n" +#~ msgstr "" +#~ "regtig\t0m0.00s\n" +#~ "gebruiker\t0m0.00s\n" +#~ "stelsel\t0m0.00s\n" + +#~ msgid "cannot duplicate fd %d to fd 1: %s" +#~ msgstr "kan nie fd %d na fd 1 dupliseer nie: %s" + +#, fuzzy +#~ msgid "%s: output redirection restricted" +#~ msgstr "gebruik tans beperkte dop %s" + +#, fuzzy +#~ msgid "Out of memory!" +#~ msgstr "Te min geheue." + +#, fuzzy +#~ msgid "You have already added item `%s'\n" +#~ msgstr "Jy alreeds het 'n groep genaamd %1." + +#, fuzzy +#~ msgid "You have entered %d (%d) items. The distribution is:\n" +#~ msgstr "Die wagwoord frase jy ingevoerde is ongeldige." + +#, fuzzy +#~ msgid "%s: bg background job?" +#~ msgstr "Druktaak gestuur." + +#, fuzzy +#~ msgid "cprintf: bad `%%' argument (%c)" +#~ msgstr "%s: option `%s' requires an argument\n" + +#, fuzzy +#~ msgid "option `%s' requires an argument" +#~ msgstr "%s: option `%s' requires an argument\n" + +#, fuzzy +#~ msgid "%s: unrecognized option" +#~ msgstr "%s: unrecognized option `%c%s'\n" + +#, fuzzy +#~ msgid "`-c' requires an argument" +#~ msgstr "%s: option `%s' requires an argument\n" + +#, fuzzy +#~ msgid "%s: bad array subscript" +#~ msgstr "Os/2 Biskaart Skikking" + +#, fuzzy +#~ msgid "reading" +#~ msgstr "besig om te lees" + +#, fuzzy +#~ msgid "$%c: unbound variable" +#~ msgstr "Veranderlike boom" + +#, fuzzy +#~ msgid "%s: bad arithmetic substitution" +#~ msgstr "&Sintetisering/Wiskundige + Menging" + +#, fuzzy +#~ msgid "-%s: binary operator expected" +#~ msgstr "%s: binêre operator is verwag\n" + +#, fuzzy +#~ msgid "%s[%s: bad subscript" +#~ msgstr "Slegte formule." + +#, fuzzy +#~ msgid "[%s: bad subscript" +#~ msgstr "Slegte formule." + +#, fuzzy +#~ msgid "option %c\n" +#~ msgstr "Opsie" + +#, fuzzy +#~ msgid "option a\n" +#~ msgstr "Opsie" + +#, fuzzy +#~ msgid "option b\n" +#~ msgstr "Opsie" + +#, fuzzy +#~ msgid "option c with value `%s'\n" +#~ msgstr "Opsie '%s' vereis 'n waarde." + +#, fuzzy +#~ msgid "non-option ARGV-elements: " +#~ msgstr "parameters wat nie opsies is nie word geïgnoreer" + +#, fuzzy +#~ msgid "%s: Unknown flag %s.\n" +#~ msgstr "onbekende vlag: " + +#, fuzzy +#~ msgid "Unknown directive `%s'" +#~ msgstr "Onbekende direktief" + +#, fuzzy +#~ msgid "%s requires an argument" +#~ msgstr "%s: option `%s' requires an argument\n" + +#, fuzzy +#~ msgid "%s found before $END" +#~ msgstr "Nee einde was gevind." + +#, fuzzy +#~ msgid "%s already has a function (%s)" +#~ msgstr "Proses %1 het alreeds verdwyn!" + +#, fuzzy +#~ msgid "%s already had a docname (%s)" +#~ msgstr "Alles is alreeds installeer" + +#, fuzzy +#~ msgid "%s already has short documentation (%s)" +#~ msgstr "Proses %1 het alreeds verdwyn!" + +#, fuzzy +#~ msgid "%s already has a %s definition" +#~ msgstr "Proses %1 het alreeds verdwyn!" + +#, fuzzy +#~ msgid "mkbuiltins: Out of virtual memory!\n" +#~ msgstr "GenericName=Virtuele Geheue Statistieke" + +#, fuzzy +#~ msgid "%[DIGITS | WORD] [&]" +#~ msgstr "Woord oorvloei" + +#, fuzzy +#~ msgid "Arguments we accept:" +#~ msgstr "Aanvaar karakter verstel:" + +#, fuzzy +#~ msgid " vi-command, and vi-insert." +#~ msgstr "Biep op kaart voeg by en verwydering" + +#, fuzzy +#~ msgid " -l List names of functions." +#~ msgstr "Verander Posisies/Name..." + +#, fuzzy +#~ msgid " reused as input." +#~ msgstr "Invoer Versterking Limiet" + +#, fuzzy +#~ msgid " -r keyseq Remove the binding for KEYSEQ." +#~ msgstr "Verwyder koekies vir domein." + +#, fuzzy +#~ msgid "break N levels." +#~ msgstr "6 nuwe vlakke" + +#, fuzzy +#~ msgid "to be followed." +#~ msgstr "Lêers na Wees Uitgepak" + +#, fuzzy +#~ msgid "The flags are:" +#~ msgstr "Linker Vlaggies" + +#, fuzzy +#~ msgid "name only." +#~ msgstr "Naam slegs" + +#, fuzzy +#~ msgid "\t\\a\talert (bell)" +#~ msgstr "stelsel klok" + +#, fuzzy +#~ msgid "\t\\c\tsuppress trailing newline" +#~ msgstr "Verwyder agterste spasies" + +#, fuzzy +#~ msgid "\t\\E\tescape character" +#~ msgstr "Ongeldige karakter <%s>" + +#, fuzzy +#~ msgid "\t\\f\tform feed" +#~ msgstr "Koevert Voer" + +#, fuzzy +#~ msgid "\t\\n\tnew line" +#~ msgstr "Lyn uit" + +#, fuzzy +#~ msgid "\t\\r\tcarriage return" +#~ msgstr "Terug Adres - 3/4 x 2\"" + +#, fuzzy +#~ msgid "\t\\t\thorizontal tab" +#~ msgstr "Oortjie Wydte:" + +#, fuzzy +#~ msgid "\t\\v\tvertical tab" +#~ msgstr "Oortjie Wydte:" + +#, fuzzy +#~ msgid "with the -E option." +#~ msgstr "%s: illegal option -- %c\n" + +#, fuzzy +#~ msgid "is set." +#~ msgstr "Nie stel" + +#, fuzzy +#~ msgid "string." +#~ msgstr "String" + +#, fuzzy +#~ msgid " mode, then vi." +#~ msgstr "-v\t\t\tVi modus (soos \"vi\")" + +#, fuzzy +#~ msgid "used." +#~ msgstr "gebruik word" + +#, fuzzy +#~ msgid "job is used." +#~ msgstr "Die naam '%1' is alreeds gebruik word" + +#, fuzzy +#~ msgid "anything in the history list." +#~ msgstr "Lêer Alreeds in Lys" + +#, fuzzy +#~ msgid "process group leader." +#~ msgstr "Proses groep Id" + +#, fuzzy +#~ msgid "\t-, +\t\tunary minus, plus" +#~ msgstr "Name=Qt Motif Plus" + +#, fuzzy +#~ msgid "\t*, /, %\t\tmultiplication, division, remainder" +#~ msgstr "devisie by nul." + +#, fuzzy +#~ msgid "\t&\t\tbitwise AND" +#~ msgstr "en etiket: " + +#, fuzzy +#~ msgid "\t^\t\tbitwise XOR" +#~ msgstr "operande Xor data" + +#, fuzzy +#~ msgid "\t|\t\tbitwise OR" +#~ msgstr " of meer" + +#, fuzzy +#~ msgid "\t&&\t\tlogical AND" +#~ msgstr "en etiket: " + +#, fuzzy +#~ msgid "\t||\t\tlogical OR" +#~ msgstr " of meer" + +#, fuzzy +#~ msgid "\texpr ? expr : expr" +#~ msgstr "ooreenstemmende inskrywings gewone uitdrukking." + +#, fuzzy +#~ msgid "\t\t\tconditional expression" +#~ msgstr "ongeldige uitdrukking" + +#, fuzzy +#~ msgid "rules above." +#~ msgstr "Boonste Redigeerder" + +#, fuzzy +#~ msgid " -m Job control is enabled." +#~ msgstr "Stop flikkerende (as flikkerende is geaktiveer)" + +#, fuzzy +#~ msgid " -o option-name" +#~ msgstr "Gebruik so: %s [OPSIE] NAAM...\n" + +#~ msgid " allexport same as -a" +#~ msgstr " allexport dieselfde as -a" + +#~ msgid " braceexpand same as -B" +#~ msgstr " braceexpand dieselfde as -B" + +#~ msgid " errexit same as -e" +#~ msgstr " errexit dieselfde as -e" + +#~ msgid " hashall same as -h" +#~ msgstr " hashall dieselfde as -h" + +#~ msgid " histexpand same as -H" +#~ msgstr " histexpand dieselfde as -H" + +#~ msgid " interactive-comments" +#~ msgstr " interaktiewe-kommentaar" + +#~ msgid " keyword same as -k" +#~ msgstr " keyword dieselfde as -k" + +#~ msgid " monitor same as -m" +#~ msgstr " monitor dieselfde as -m" + +#~ msgid " noclobber same as -C" +#~ msgstr " noclobber dieselfde as -C" + +#~ msgid " noexec same as -n" +#~ msgstr " noexec dieselfde as -n" + +#~ msgid " noglob same as -f" +#~ msgstr " noglob dieselfde as -f" + +#~ msgid " notify save as -b" +#~ msgstr " notify dieselfde as -b" + +#~ msgid " nounset same as -u" +#~ msgstr " nounset dieselfde as -u" + +#~ msgid " onecmd same as -t" +#~ msgstr " onecmd dieselfde as -t" + +#~ msgid " physical same as -P" +#~ msgstr " physical dieselfde as -P" + +#~ msgid " match the standard" +#~ msgstr " pas by die standaard" + +#~ msgid " privileged same as -p" +#~ msgstr " privileged dieselfde as -p" + +#~ msgid " verbose same as -v" +#~ msgstr " verbose dieselfde as -v" + +#~ msgid " xtrace same as -x" +#~ msgstr " xtrace dieselfde as -x" + +#~ msgid " by default." +#~ msgstr " by verstek." + +#, fuzzy +#~ msgid " by redirection of output." +#~ msgstr "eSound Uitsetinpropprogram %s" + +#~ msgid "see readonly." +#~ msgstr "sien leesalleen" + +#, fuzzy +#~ msgid "processing." +#~ msgstr "Verwerking..." + +#, fuzzy +#~ msgid "File operators:" +#~ msgstr "lêer assosiasies" + +#, fuzzy +#~ msgid " -d FILE True if file is a directory." +#~ msgstr "%1 is 'n gids, maar 'n lêer was verwag." + +#, fuzzy +#~ msgid " -e FILE True if file exists." +#~ msgstr "Verwyder, as bestaan, die _:kommentaar" + +#, fuzzy +#~ msgid " modification date) file2." +#~ msgstr "Begin na datum" + +#, fuzzy +#~ msgid "String operators:" +#~ msgstr "Soekstring" + +#, fuzzy +#~ msgid " -n STRING" +#~ msgstr "String" + +#, fuzzy +#~ msgid "Other operators:" +#~ msgstr "Ander weergawe (B):" + +#, fuzzy +#~ msgid "" +#~ "less-than, less-than-or-equal, greater-than, or greater-than-or-equal" +#~ msgstr "is grootter as of gelyk na" + +#, fuzzy +#~ msgid "than ARG2." +#~ msgstr "%1 vroeër as %2" + +#~ msgid "the shell." +#~ msgstr "die dop." + +#, fuzzy +#~ msgid "with \"kill -signal $$\"." +#~ msgstr "Stuur alle prosesse die KILL sein...\n" + +#, fuzzy +#~ msgid "or unfound, respectively." +#~ msgstr "Formule of gewig:" + +#, fuzzy +#~ msgid " -H\tuse the `hard' resource limit" +#~ msgstr "Minimum waarde is 'n hard beperk" + +#, fuzzy +#~ msgid " -m\tthe maximum resident set size" +#~ msgstr "Data inwoonend stel grootte in Kgrepe" + +#, fuzzy +#~ msgid " -p\tthe pipe buffer size" +#~ msgstr " Audio Buffer Grootte (antwoord tyd) " + +#, fuzzy +#~ msgid " -v\tthe size of virtual memory" +#~ msgstr "GenericName=Virtuele Geheue Statistieke" + +#, fuzzy +#~ msgid "processes." +#~ msgstr "Prosesse" + +#, fuzzy +#~ msgid "pipeline are waited for." +#~ msgstr "Die drukker vir wat werke word versoekte" + +#, fuzzy +#~ msgid "the COMMANDS are executed." +#~ msgstr "Stoor geskiedenis van uitgevoerde bevele." + +#, fuzzy +#~ msgid "function as $0 .. $n." +#~ msgstr "-L\t\t\tSelfde as -r" + +#, fuzzy +#~ msgid "entire set of commands." +#~ msgstr "%s outobevele vir \"%s\"" + +#, fuzzy +#~ msgid "BASH_VERSION The version numbers of this Bash." +#~ msgstr "Hierdie is hoe nommers sal wees vertoon." + +#, fuzzy +#~ msgid "\t\tshell can access." +#~ msgstr "Konfigureer internettoegang..." + +#, fuzzy +#~ msgid "\t\tfor new mail." +#~ msgstr "Nuwe Pos Inkennisstelling" + +#, fuzzy +#~ msgid "\t\tlooking for commands." +#~ msgstr "%s outobevele vir \"%s\"" + +#, fuzzy +#~ msgid "\t\tprimary prompt." +#~ msgstr "Konqueror: Por" + +#, fuzzy +#~ msgid "command_oriented_history" +#~ msgstr "Herstel/Herstel herroep Geskiedenis..." + +#, fuzzy +#~ msgid " a single history line." +#~ msgstr "/Skoopmodus/Lynskoop" + +#~ msgid "not each is set." +#~ msgstr "nie elkeen is gestel nie." diff --git a/po/bash.pot b/po/bash.pot new file mode 100644 index 0000000..1ef1208 --- /dev/null +++ b/po/bash.pot @@ -0,0 +1,4041 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-02-11 11:19-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: arrayfunc.c:51 +msgid "bad array subscript" +msgstr "" + +#: arrayfunc.c:356 builtins/declare.def:566 +#, c-format +msgid "%s: cannot convert indexed to associative array" +msgstr "" + +#: arrayfunc.c:539 +#, c-format +msgid "%s: invalid associative array key" +msgstr "" + +#: arrayfunc.c:541 +#, c-format +msgid "%s: cannot assign to non-numeric index" +msgstr "" + +#: arrayfunc.c:586 +#, c-format +msgid "%s: %s: must use subscript when assigning associative array" +msgstr "" + +#: bashhist.c:388 +#, c-format +msgid "%s: cannot create: %s" +msgstr "" + +#: bashline.c:3982 +msgid "bash_execute_unix_command: cannot find keymap for command" +msgstr "" + +#: bashline.c:4069 +#, c-format +msgid "%s: first non-whitespace character is not `\"'" +msgstr "" + +#: bashline.c:4098 +#, c-format +msgid "no closing `%c' in %s" +msgstr "" + +#: bashline.c:4132 +#, c-format +msgid "%s: missing colon separator" +msgstr "" + +#: braces.c:321 +#, c-format +msgid "brace expansion: cannot allocate memory for %s" +msgstr "" + +#: braces.c:413 +#, c-format +msgid "brace expansion: failed to allocate memory for %d elements" +msgstr "" + +#: braces.c:452 +#, c-format +msgid "brace expansion: failed to allocate memory for `%s'" +msgstr "" + +#: builtins/alias.def:132 +#, c-format +msgid "`%s': invalid alias name" +msgstr "" + +#: builtins/bind.def:123 builtins/bind.def:126 +msgid "line editing not enabled" +msgstr "" + +#: builtins/bind.def:212 +#, c-format +msgid "`%s': invalid keymap name" +msgstr "" + +#: builtins/bind.def:251 +#, c-format +msgid "%s: cannot read: %s" +msgstr "" + +#: builtins/bind.def:266 +#, c-format +msgid "`%s': cannot unbind" +msgstr "" + +#: builtins/bind.def:304 builtins/bind.def:334 +#, c-format +msgid "`%s': unknown function name" +msgstr "" + +#: builtins/bind.def:312 +#, c-format +msgid "%s is not bound to any keys.\n" +msgstr "" + +#: builtins/bind.def:316 +#, c-format +msgid "%s can be invoked via " +msgstr "" + +#: builtins/break.def:77 builtins/break.def:117 +msgid "loop count" +msgstr "" + +#: builtins/break.def:137 +msgid "only meaningful in a `for', `while', or `until' loop" +msgstr "" + +#: builtins/caller.def:134 +msgid "" +"Returns the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns " +msgstr "" + +#: builtins/cd.def:319 +msgid "HOME not set" +msgstr "" + +#: builtins/cd.def:327 builtins/common.c:166 test.c:876 +msgid "too many arguments" +msgstr "" + +#: builtins/cd.def:338 +msgid "OLDPWD not set" +msgstr "" + +#: builtins/common.c:101 +#, c-format +msgid "line %d: " +msgstr "" + +#: builtins/common.c:139 error.c:265 +#, c-format +msgid "warning: " +msgstr "" + +#: builtins/common.c:153 +#, c-format +msgid "%s: usage: " +msgstr "" + +#: builtins/common.c:191 shell.c:506 shell.c:788 +#, c-format +msgid "%s: option requires an argument" +msgstr "" + +#: builtins/common.c:198 +#, c-format +msgid "%s: numeric argument required" +msgstr "" + +#: builtins/common.c:205 +#, c-format +msgid "%s: not found" +msgstr "" + +#: builtins/common.c:214 shell.c:801 +#, c-format +msgid "%s: invalid option" +msgstr "" + +#: builtins/common.c:221 +#, c-format +msgid "%s: invalid option name" +msgstr "" + +#: builtins/common.c:228 general.c:235 general.c:240 +#, c-format +msgid "`%s': not a valid identifier" +msgstr "" + +#: builtins/common.c:238 +msgid "invalid octal number" +msgstr "" + +#: builtins/common.c:240 +msgid "invalid hex number" +msgstr "" + +#: builtins/common.c:242 expr.c:1470 +msgid "invalid number" +msgstr "" + +#: builtins/common.c:250 +#, c-format +msgid "%s: invalid signal specification" +msgstr "" + +#: builtins/common.c:257 +#, c-format +msgid "`%s': not a pid or valid job spec" +msgstr "" + +#: builtins/common.c:264 error.c:488 +#, c-format +msgid "%s: readonly variable" +msgstr "" + +#: builtins/common.c:272 +#, c-format +msgid "%s: %s out of range" +msgstr "" + +#: builtins/common.c:272 builtins/common.c:274 +msgid "argument" +msgstr "" + +#: builtins/common.c:274 +#, c-format +msgid "%s out of range" +msgstr "" + +#: builtins/common.c:282 +#, c-format +msgid "%s: no such job" +msgstr "" + +#: builtins/common.c:290 +#, c-format +msgid "%s: no job control" +msgstr "" + +#: builtins/common.c:292 +msgid "no job control" +msgstr "" + +#: builtins/common.c:302 +#, c-format +msgid "%s: restricted" +msgstr "" + +#: builtins/common.c:304 +msgid "restricted" +msgstr "" + +#: builtins/common.c:312 +#, c-format +msgid "%s: not a shell builtin" +msgstr "" + +#: builtins/common.c:321 +#, c-format +msgid "write error: %s" +msgstr "" + +#: builtins/common.c:329 +#, c-format +msgid "error setting terminal attributes: %s" +msgstr "" + +#: builtins/common.c:331 +#, c-format +msgid "error getting terminal attributes: %s" +msgstr "" + +#: builtins/common.c:563 +#, c-format +msgid "%s: error retrieving current directory: %s: %s\n" +msgstr "" + +#: builtins/common.c:629 builtins/common.c:631 +#, c-format +msgid "%s: ambiguous job spec" +msgstr "" + +#: builtins/complete.def:277 +#, c-format +msgid "%s: invalid action name" +msgstr "" + +#: builtins/complete.def:450 builtins/complete.def:645 +#: builtins/complete.def:855 +#, c-format +msgid "%s: no completion specification" +msgstr "" + +#: builtins/complete.def:697 +msgid "warning: -F option may not work as you expect" +msgstr "" + +#: builtins/complete.def:699 +msgid "warning: -C option may not work as you expect" +msgstr "" + +#: builtins/complete.def:828 +msgid "not currently executing completion function" +msgstr "" + +#: builtins/declare.def:126 +msgid "can only be used in a function" +msgstr "" + +#: builtins/declare.def:315 builtins/declare.def:509 +#, c-format +msgid "%s: reference variable cannot be an array" +msgstr "" + +#: builtins/declare.def:324 +#, c-format +msgid "%s: nameref variable self references not allowed" +msgstr "" + +#: builtins/declare.def:398 +msgid "cannot use `-f' to make functions" +msgstr "" + +#: builtins/declare.def:410 execute_cmd.c:5361 +#, c-format +msgid "%s: readonly function" +msgstr "" + +#: builtins/declare.def:553 +#, c-format +msgid "%s: cannot destroy array variables in this way" +msgstr "" + +#: builtins/declare.def:560 builtins/read.def:733 +#, c-format +msgid "%s: cannot convert associative to indexed array" +msgstr "" + +#: builtins/enable.def:137 builtins/enable.def:145 +msgid "dynamic loading not available" +msgstr "" + +#: builtins/enable.def:312 +#, c-format +msgid "cannot open shared object %s: %s" +msgstr "" + +#: builtins/enable.def:335 +#, c-format +msgid "cannot find %s in shared object %s: %s" +msgstr "" + +#: builtins/enable.def:459 +#, c-format +msgid "%s: not dynamically loaded" +msgstr "" + +#: builtins/enable.def:474 +#, c-format +msgid "%s: cannot delete: %s" +msgstr "" + +#: builtins/evalfile.c:140 builtins/hash.def:171 execute_cmd.c:5208 +#: shell.c:1481 +#, c-format +msgid "%s: is a directory" +msgstr "" + +#: builtins/evalfile.c:146 +#, c-format +msgid "%s: not a regular file" +msgstr "" + +#: builtins/evalfile.c:155 +#, c-format +msgid "%s: file is too large" +msgstr "" + +#: builtins/evalfile.c:190 builtins/evalfile.c:208 shell.c:1491 +#, c-format +msgid "%s: cannot execute binary file" +msgstr "" + +#: builtins/exec.def:154 builtins/exec.def:156 builtins/exec.def:228 +#, c-format +msgid "%s: cannot execute: %s" +msgstr "" + +#: builtins/exit.def:65 +#, c-format +msgid "logout\n" +msgstr "" + +#: builtins/exit.def:88 +msgid "not login shell: use `exit'" +msgstr "" + +#: builtins/exit.def:120 +#, c-format +msgid "There are stopped jobs.\n" +msgstr "" + +#: builtins/exit.def:122 +#, c-format +msgid "There are running jobs.\n" +msgstr "" + +#: builtins/fc.def:262 +msgid "no command found" +msgstr "" + +#: builtins/fc.def:320 builtins/fc.def:369 +msgid "history specification" +msgstr "" + +#: builtins/fc.def:390 +#, c-format +msgid "%s: cannot open temp file: %s" +msgstr "" + +#: builtins/fg_bg.def:149 builtins/jobs.def:282 +msgid "current" +msgstr "" + +#: builtins/fg_bg.def:158 +#, c-format +msgid "job %d started without job control" +msgstr "" + +#: builtins/getopt.c:110 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "" + +#: builtins/getopt.c:111 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "" + +#: builtins/hash.def:92 +msgid "hashing disabled" +msgstr "" + +#: builtins/hash.def:138 +#, c-format +msgid "%s: hash table empty\n" +msgstr "" + +#: builtins/hash.def:245 +#, c-format +msgid "hits\tcommand\n" +msgstr "" + +#: builtins/help.def:130 +#, c-format +msgid "Shell commands matching keyword `" +msgid_plural "Shell commands matching keywords `" +msgstr[0] "" +msgstr[1] "" + +#: builtins/help.def:182 +#, c-format +msgid "" +"no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." +msgstr "" + +#: builtins/help.def:199 +#, c-format +msgid "%s: cannot open: %s" +msgstr "" + +#: builtins/help.def:485 +#, c-format +msgid "" +"These shell commands are defined internally. Type `help' to see this list.\n" +"Type `help name' to find out more about the function `name'.\n" +"Use `info bash' to find out more about the shell in general.\n" +"Use `man -k' or `info' to find out more about commands not in this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" +msgstr "" + +#: builtins/history.def:154 +msgid "cannot use more than one of -anrw" +msgstr "" + +#: builtins/history.def:186 +msgid "history position" +msgstr "" + +#: builtins/history.def:366 +#, c-format +msgid "%s: history expansion failed" +msgstr "" + +#: builtins/inlib.def:71 +#, c-format +msgid "%s: inlib failed" +msgstr "" + +#: builtins/jobs.def:109 +msgid "no other options allowed with `-x'" +msgstr "" + +#: builtins/kill.def:200 +#, c-format +msgid "%s: arguments must be process or job IDs" +msgstr "" + +#: builtins/kill.def:263 +msgid "Unknown error" +msgstr "" + +#: builtins/let.def:95 builtins/let.def:120 expr.c:583 expr.c:598 +msgid "expression expected" +msgstr "" + +#: builtins/mapfile.def:172 +#, c-format +msgid "%s: not an indexed array" +msgstr "" + +#: builtins/mapfile.def:259 builtins/read.def:302 +#, c-format +msgid "%s: invalid file descriptor specification" +msgstr "" + +#: builtins/mapfile.def:267 builtins/read.def:309 +#, c-format +msgid "%d: invalid file descriptor: %s" +msgstr "" + +#: builtins/mapfile.def:276 builtins/mapfile.def:314 +#, c-format +msgid "%s: invalid line count" +msgstr "" + +#: builtins/mapfile.def:287 +#, c-format +msgid "%s: invalid array origin" +msgstr "" + +#: builtins/mapfile.def:304 +#, c-format +msgid "%s: invalid callback quantum" +msgstr "" + +#: builtins/mapfile.def:336 +msgid "empty array variable name" +msgstr "" + +#: builtins/mapfile.def:357 +msgid "array variable support required" +msgstr "" + +#: builtins/printf.def:402 +#, c-format +msgid "`%s': missing format character" +msgstr "" + +#: builtins/printf.def:456 +#, c-format +msgid "`%c': invalid time format specification" +msgstr "" + +#: builtins/printf.def:658 +#, c-format +msgid "`%c': invalid format character" +msgstr "" + +#: builtins/printf.def:684 +#, c-format +msgid "warning: %s: %s" +msgstr "" + +#: builtins/printf.def:768 +#, c-format +msgid "format parsing problem: %s" +msgstr "" + +#: builtins/printf.def:865 +msgid "missing hex digit for \\x" +msgstr "" + +#: builtins/printf.def:880 +#, c-format +msgid "missing unicode digit for \\%c" +msgstr "" + +#: builtins/pushd.def:195 +msgid "no other directory" +msgstr "" + +#: builtins/pushd.def:354 +#, c-format +msgid "%s: invalid argument" +msgstr "" + +#: builtins/pushd.def:468 +msgid "" +msgstr "" + +#: builtins/pushd.def:512 +msgid "directory stack empty" +msgstr "" + +#: builtins/pushd.def:514 +msgid "directory stack index" +msgstr "" + +#: builtins/pushd.def:689 +msgid "" +"Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +"\tdirs when invoked without options, starting with zero." +msgstr "" + +#: builtins/pushd.def:711 +msgid "" +"Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" + +#: builtins/pushd.def:736 +msgid "" +"Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" + +#: builtins/read.def:275 +#, c-format +msgid "%s: invalid timeout specification" +msgstr "" + +#: builtins/read.def:678 +#, c-format +msgid "read error: %d: %s" +msgstr "" + +#: builtins/return.def:75 +msgid "can only `return' from a function or sourced script" +msgstr "" + +#: builtins/set.def:782 +msgid "cannot simultaneously unset a function and a variable" +msgstr "" + +#: builtins/set.def:826 +#, c-format +msgid "%s: cannot unset" +msgstr "" + +#: builtins/set.def:843 +#, c-format +msgid "%s: cannot unset: readonly %s" +msgstr "" + +#: builtins/set.def:854 +#, c-format +msgid "%s: not an array variable" +msgstr "" + +#: builtins/setattr.def:187 +#, c-format +msgid "%s: not a function" +msgstr "" + +#: builtins/shift.def:71 builtins/shift.def:77 +msgid "shift count" +msgstr "" + +#: builtins/shopt.def:279 +msgid "cannot set and unset shell options simultaneously" +msgstr "" + +#: builtins/shopt.def:346 +#, c-format +msgid "%s: invalid shell option name" +msgstr "" + +#: builtins/source.def:130 +msgid "filename argument required" +msgstr "" + +#: builtins/source.def:155 +#, c-format +msgid "%s: file not found" +msgstr "" + +#: builtins/suspend.def:101 +msgid "cannot suspend" +msgstr "" + +#: builtins/suspend.def:111 +msgid "cannot suspend a login shell" +msgstr "" + +#: builtins/type.def:234 +#, c-format +msgid "%s is aliased to `%s'\n" +msgstr "" + +#: builtins/type.def:255 +#, c-format +msgid "%s is a shell keyword\n" +msgstr "" + +#: builtins/type.def:274 +#, c-format +msgid "%s is a function\n" +msgstr "" + +#: builtins/type.def:296 +#, c-format +msgid "%s is a shell builtin\n" +msgstr "" + +#: builtins/type.def:317 builtins/type.def:393 +#, c-format +msgid "%s is %s\n" +msgstr "" + +#: builtins/type.def:337 +#, c-format +msgid "%s is hashed (%s)\n" +msgstr "" + +#: builtins/ulimit.def:383 +#, c-format +msgid "%s: invalid limit argument" +msgstr "" + +#: builtins/ulimit.def:409 +#, c-format +msgid "`%c': bad command" +msgstr "" + +#: builtins/ulimit.def:438 +#, c-format +msgid "%s: cannot get limit: %s" +msgstr "" + +#: builtins/ulimit.def:464 +msgid "limit" +msgstr "" + +#: builtins/ulimit.def:476 builtins/ulimit.def:776 +#, c-format +msgid "%s: cannot modify limit: %s" +msgstr "" + +#: builtins/umask.def:114 +msgid "octal number" +msgstr "" + +#: builtins/umask.def:227 +#, c-format +msgid "`%c': invalid symbolic mode operator" +msgstr "" + +#: builtins/umask.def:282 +#, c-format +msgid "`%c': invalid symbolic mode character" +msgstr "" + +#: error.c:90 error.c:325 error.c:327 error.c:329 +msgid " line " +msgstr "" + +#: error.c:165 +#, c-format +msgid "last command: %s\n" +msgstr "" + +#: error.c:173 +#, c-format +msgid "Aborting..." +msgstr "" + +#: error.c:440 +msgid "unknown command error" +msgstr "" + +#: error.c:441 +msgid "bad command type" +msgstr "" + +#: error.c:442 +msgid "bad connector" +msgstr "" + +#: error.c:443 +msgid "bad jump" +msgstr "" + +#: error.c:481 +#, c-format +msgid "%s: unbound variable" +msgstr "" + +#: eval.c:189 +#, c-format +msgid "\atimed out waiting for input: auto-logout\n" +msgstr "" + +#: execute_cmd.c:512 +#, c-format +msgid "cannot redirect standard input from /dev/null: %s" +msgstr "" + +#: execute_cmd.c:1233 +#, c-format +msgid "TIMEFORMAT: `%c': invalid format character" +msgstr "" + +#: execute_cmd.c:2287 +msgid "pipe error" +msgstr "" + +#: execute_cmd.c:4386 +#, c-format +msgid "%s: maximum function nesting level exceeded (%d)" +msgstr "" + +#: execute_cmd.c:4884 +#, c-format +msgid "%s: restricted: cannot specify `/' in command names" +msgstr "" + +#: execute_cmd.c:4973 +#, c-format +msgid "%s: command not found" +msgstr "" + +#: execute_cmd.c:5206 +#, c-format +msgid "%s: %s" +msgstr "" + +#: execute_cmd.c:5243 +#, c-format +msgid "%s: %s: bad interpreter" +msgstr "" + +#: execute_cmd.c:5280 +#, c-format +msgid "%s: cannot execute binary file: %s" +msgstr "" + +#: execute_cmd.c:5352 +#, c-format +msgid "`%s': is a special builtin" +msgstr "" + +#: execute_cmd.c:5404 +#, c-format +msgid "cannot duplicate fd %d to fd %d" +msgstr "" + +#: expr.c:259 +msgid "expression recursion level exceeded" +msgstr "" + +#: expr.c:283 +msgid "recursion stack underflow" +msgstr "" + +#: expr.c:431 +msgid "syntax error in expression" +msgstr "" + +#: expr.c:475 +msgid "attempted assignment to non-variable" +msgstr "" + +#: expr.c:495 expr.c:858 +msgid "division by 0" +msgstr "" + +#: expr.c:542 +msgid "bug: bad expassign token" +msgstr "" + +#: expr.c:595 +msgid "`:' expected for conditional expression" +msgstr "" + +#: expr.c:919 +msgid "exponent less than 0" +msgstr "" + +#: expr.c:976 +msgid "identifier expected after pre-increment or pre-decrement" +msgstr "" + +#: expr.c:1002 +msgid "missing `)'" +msgstr "" + +#: expr.c:1053 expr.c:1390 +msgid "syntax error: operand expected" +msgstr "" + +#: expr.c:1392 +msgid "syntax error: invalid arithmetic operator" +msgstr "" + +#: expr.c:1416 +#, c-format +msgid "%s%s%s: %s (error token is \"%s\")" +msgstr "" + +#: expr.c:1474 +msgid "invalid arithmetic base" +msgstr "" + +#: expr.c:1494 +msgid "value too great for base" +msgstr "" + +#: expr.c:1543 +#, c-format +msgid "%s: expression error\n" +msgstr "" + +#: general.c:62 +msgid "getcwd: cannot access parent directories" +msgstr "" + +#: input.c:102 subst.c:5168 +#, c-format +msgid "cannot reset nodelay mode for fd %d" +msgstr "" + +#: input.c:271 +#, c-format +msgid "cannot allocate new file descriptor for bash input from fd %d" +msgstr "" + +#: input.c:279 +#, c-format +msgid "save_bash_input: buffer already exists for new fd %d" +msgstr "" + +#: jobs.c:471 +msgid "start_pipeline: pgrp pipe" +msgstr "" + +#: jobs.c:893 +#, c-format +msgid "forked pid %d appears in running job %d" +msgstr "" + +#: jobs.c:1012 +#, c-format +msgid "deleting stopped job %d with process group %ld" +msgstr "" + +#: jobs.c:1117 +#, c-format +msgid "add_process: process %5ld (%s) in the_pipeline" +msgstr "" + +#: jobs.c:1120 +#, c-format +msgid "add_process: pid %5ld (%s) marked as still alive" +msgstr "" + +#: jobs.c:1435 +#, c-format +msgid "describe_pid: %ld: no such pid" +msgstr "" + +#: jobs.c:1450 +#, c-format +msgid "Signal %d" +msgstr "" + +#: jobs.c:1464 jobs.c:1489 +msgid "Done" +msgstr "" + +#: jobs.c:1469 siglist.c:123 +msgid "Stopped" +msgstr "" + +#: jobs.c:1473 +#, c-format +msgid "Stopped(%s)" +msgstr "" + +#: jobs.c:1477 +msgid "Running" +msgstr "" + +#: jobs.c:1491 +#, c-format +msgid "Done(%d)" +msgstr "" + +#: jobs.c:1493 +#, c-format +msgid "Exit %d" +msgstr "" + +#: jobs.c:1496 +msgid "Unknown status" +msgstr "" + +#: jobs.c:1583 +#, c-format +msgid "(core dumped) " +msgstr "" + +#: jobs.c:1602 +#, c-format +msgid " (wd: %s)" +msgstr "" + +#: jobs.c:1819 +#, c-format +msgid "child setpgid (%ld to %ld)" +msgstr "" + +#: jobs.c:2138 nojobs.c:605 +#, c-format +msgid "wait: pid %ld is not a child of this shell" +msgstr "" + +#: jobs.c:2385 +#, c-format +msgid "wait_for: No record of process %ld" +msgstr "" + +#: jobs.c:2694 +#, c-format +msgid "wait_for_job: job %d is stopped" +msgstr "" + +#: jobs.c:2986 +#, c-format +msgid "%s: job has terminated" +msgstr "" + +#: jobs.c:2995 +#, c-format +msgid "%s: job %d already in background" +msgstr "" + +#: jobs.c:3220 +msgid "waitchld: turning on WNOHANG to avoid indefinite block" +msgstr "" + +#: jobs.c:3711 +#, c-format +msgid "%s: line %d: " +msgstr "" + +#: jobs.c:3725 nojobs.c:843 +#, c-format +msgid " (core dumped)" +msgstr "" + +#: jobs.c:3737 jobs.c:3750 +#, c-format +msgid "(wd now: %s)\n" +msgstr "" + +#: jobs.c:3782 +msgid "initialize_job_control: getpgrp failed" +msgstr "" + +#: jobs.c:3843 +msgid "initialize_job_control: line discipline" +msgstr "" + +#: jobs.c:3853 +msgid "initialize_job_control: setpgid" +msgstr "" + +#: jobs.c:3874 jobs.c:3883 +#, c-format +msgid "cannot set terminal process group (%d)" +msgstr "" + +#: jobs.c:3888 +msgid "no job control in this shell" +msgstr "" + +#: lib/malloc/malloc.c:296 +#, c-format +msgid "malloc: failed assertion: %s\n" +msgstr "" + +#: lib/malloc/malloc.c:312 +#, c-format +msgid "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" +msgstr "" + +#: lib/malloc/malloc.c:313 +msgid "unknown" +msgstr "" + +#: lib/malloc/malloc.c:801 +msgid "malloc: block on free list clobbered" +msgstr "" + +#: lib/malloc/malloc.c:878 +msgid "free: called with already freed block argument" +msgstr "" + +#: lib/malloc/malloc.c:881 +msgid "free: called with unallocated block argument" +msgstr "" + +#: lib/malloc/malloc.c:900 +msgid "free: underflow detected; mh_nbytes out of range" +msgstr "" + +#: lib/malloc/malloc.c:906 +msgid "free: start and end chunk sizes differ" +msgstr "" + +#: lib/malloc/malloc.c:1005 +msgid "realloc: called with unallocated block argument" +msgstr "" + +#: lib/malloc/malloc.c:1020 +msgid "realloc: underflow detected; mh_nbytes out of range" +msgstr "" + +#: lib/malloc/malloc.c:1026 +msgid "realloc: start and end chunk sizes differ" +msgstr "" + +#: lib/malloc/table.c:194 +#, c-format +msgid "register_alloc: alloc table is full with FIND_ALLOC?\n" +msgstr "" + +#: lib/malloc/table.c:203 +#, c-format +msgid "register_alloc: %p already in table as allocated?\n" +msgstr "" + +#: lib/malloc/table.c:256 +#, c-format +msgid "register_free: %p already in table as free?\n" +msgstr "" + +#: lib/sh/fmtulong.c:102 +msgid "invalid base" +msgstr "" + +#: lib/sh/netopen.c:168 +#, c-format +msgid "%s: host unknown" +msgstr "" + +#: lib/sh/netopen.c:175 +#, c-format +msgid "%s: invalid service" +msgstr "" + +#: lib/sh/netopen.c:306 +#, c-format +msgid "%s: bad network path specification" +msgstr "" + +#: lib/sh/netopen.c:346 +msgid "network operations not supported" +msgstr "" + +#: locale.c:200 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s)" +msgstr "" + +#: locale.c:202 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s): %s" +msgstr "" + +#: locale.c:259 +#, c-format +msgid "setlocale: %s: cannot change locale (%s)" +msgstr "" + +#: locale.c:261 +#, c-format +msgid "setlocale: %s: cannot change locale (%s): %s" +msgstr "" + +#: mailcheck.c:439 +msgid "You have mail in $_" +msgstr "" + +#: mailcheck.c:464 +msgid "You have new mail in $_" +msgstr "" + +#: mailcheck.c:480 +#, c-format +msgid "The mail in %s has been read\n" +msgstr "" + +#: make_cmd.c:323 +msgid "syntax error: arithmetic expression required" +msgstr "" + +#: make_cmd.c:325 +msgid "syntax error: `;' unexpected" +msgstr "" + +#: make_cmd.c:326 +#, c-format +msgid "syntax error: `((%s))'" +msgstr "" + +#: make_cmd.c:578 +#, c-format +msgid "make_here_document: bad instruction type %d" +msgstr "" + +#: make_cmd.c:662 +#, c-format +msgid "here-document at line %d delimited by end-of-file (wanted `%s')" +msgstr "" + +#: make_cmd.c:759 +#, c-format +msgid "make_redirection: redirection instruction `%d' out of range" +msgstr "" + +#: parse.y:3278 parse.y:3561 +#, c-format +msgid "unexpected EOF while looking for matching `%c'" +msgstr "" + +#: parse.y:4170 +msgid "unexpected EOF while looking for `]]'" +msgstr "" + +#: parse.y:4175 +#, c-format +msgid "syntax error in conditional expression: unexpected token `%s'" +msgstr "" + +#: parse.y:4179 +msgid "syntax error in conditional expression" +msgstr "" + +#: parse.y:4257 +#, c-format +msgid "unexpected token `%s', expected `)'" +msgstr "" + +#: parse.y:4261 +msgid "expected `)'" +msgstr "" + +#: parse.y:4289 +#, c-format +msgid "unexpected argument `%s' to conditional unary operator" +msgstr "" + +#: parse.y:4293 +msgid "unexpected argument to conditional unary operator" +msgstr "" + +#: parse.y:4339 +#, c-format +msgid "unexpected token `%s', conditional binary operator expected" +msgstr "" + +#: parse.y:4343 +msgid "conditional binary operator expected" +msgstr "" + +#: parse.y:4365 +#, c-format +msgid "unexpected argument `%s' to conditional binary operator" +msgstr "" + +#: parse.y:4369 +msgid "unexpected argument to conditional binary operator" +msgstr "" + +#: parse.y:4380 +#, c-format +msgid "unexpected token `%c' in conditional command" +msgstr "" + +#: parse.y:4383 +#, c-format +msgid "unexpected token `%s' in conditional command" +msgstr "" + +#: parse.y:4387 +#, c-format +msgid "unexpected token %d in conditional command" +msgstr "" + +#: parse.y:5737 +#, c-format +msgid "syntax error near unexpected token `%s'" +msgstr "" + +#: parse.y:5755 +#, c-format +msgid "syntax error near `%s'" +msgstr "" + +#: parse.y:5765 +msgid "syntax error: unexpected end of file" +msgstr "" + +#: parse.y:5765 +msgid "syntax error" +msgstr "" + +#: parse.y:5827 +#, c-format +msgid "Use \"%s\" to leave the shell.\n" +msgstr "" + +#: parse.y:5989 +msgid "unexpected EOF while looking for matching `)'" +msgstr "" + +#: pcomplete.c:1094 +#, c-format +msgid "completion: function `%s' not found" +msgstr "" + +#: pcomplib.c:182 +#, c-format +msgid "progcomp_insert: %s: NULL COMPSPEC" +msgstr "" + +#: print_cmd.c:300 +#, c-format +msgid "print_command: bad connector `%d'" +msgstr "" + +#: print_cmd.c:373 +#, c-format +msgid "xtrace_set: %d: invalid file descriptor" +msgstr "" + +#: print_cmd.c:378 +msgid "xtrace_set: NULL file pointer" +msgstr "" + +#: print_cmd.c:382 +#, c-format +msgid "xtrace fd (%d) != fileno xtrace fp (%d)" +msgstr "" + +#: print_cmd.c:1518 +#, c-format +msgid "cprintf: `%c': invalid format character" +msgstr "" + +#: redir.c:123 redir.c:170 +msgid "file descriptor out of range" +msgstr "" + +#: redir.c:177 +#, c-format +msgid "%s: ambiguous redirect" +msgstr "" + +#: redir.c:181 +#, c-format +msgid "%s: cannot overwrite existing file" +msgstr "" + +#: redir.c:186 +#, c-format +msgid "%s: restricted: cannot redirect output" +msgstr "" + +#: redir.c:191 +#, c-format +msgid "cannot create temp file for here-document: %s" +msgstr "" + +#: redir.c:195 +#, c-format +msgid "%s: cannot assign fd to variable" +msgstr "" + +#: redir.c:582 +msgid "/dev/(tcp|udp)/host/port not supported without networking" +msgstr "" + +#: redir.c:861 redir.c:973 redir.c:1034 redir.c:1199 +msgid "redirection error: cannot duplicate fd" +msgstr "" + +#: shell.c:339 +msgid "could not find /tmp, please create!" +msgstr "" + +#: shell.c:343 +msgid "/tmp must be a valid directory name" +msgstr "" + +#: shell.c:890 +#, c-format +msgid "%c%c: invalid option" +msgstr "" + +#: shell.c:1682 +msgid "I have no name!" +msgstr "" + +#: shell.c:1827 +#, c-format +msgid "GNU bash, version %s-(%s)\n" +msgstr "" + +#: shell.c:1828 +#, c-format +msgid "" +"Usage:\t%s [GNU long option] [option] ...\n" +"\t%s [GNU long option] [option] script-file ...\n" +msgstr "" + +#: shell.c:1830 +msgid "GNU long options:\n" +msgstr "" + +#: shell.c:1834 +msgid "Shell options:\n" +msgstr "" + +#: shell.c:1835 +msgid "\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n" +msgstr "" + +#: shell.c:1850 +#, c-format +msgid "\t-%s or -o option\n" +msgstr "" + +#: shell.c:1856 +#, c-format +msgid "Type `%s -c \"help set\"' for more information about shell options.\n" +msgstr "" + +#: shell.c:1857 +#, c-format +msgid "Type `%s -c help' for more information about shell builtin commands.\n" +msgstr "" + +#: shell.c:1858 +#, c-format +msgid "Use the `bashbug' command to report bugs.\n" +msgstr "" + +#: sig.c:691 +#, c-format +msgid "sigprocmask: %d: invalid operation" +msgstr "" + +#: siglist.c:48 +msgid "Bogus signal" +msgstr "" + +#: siglist.c:51 +msgid "Hangup" +msgstr "" + +#: siglist.c:55 +msgid "Interrupt" +msgstr "" + +#: siglist.c:59 +msgid "Quit" +msgstr "" + +#: siglist.c:63 +msgid "Illegal instruction" +msgstr "" + +#: siglist.c:67 +msgid "BPT trace/trap" +msgstr "" + +#: siglist.c:75 +msgid "ABORT instruction" +msgstr "" + +#: siglist.c:79 +msgid "EMT instruction" +msgstr "" + +#: siglist.c:83 +msgid "Floating point exception" +msgstr "" + +#: siglist.c:87 +msgid "Killed" +msgstr "" + +#: siglist.c:91 +msgid "Bus error" +msgstr "" + +#: siglist.c:95 +msgid "Segmentation fault" +msgstr "" + +#: siglist.c:99 +msgid "Bad system call" +msgstr "" + +#: siglist.c:103 +msgid "Broken pipe" +msgstr "" + +#: siglist.c:107 +msgid "Alarm clock" +msgstr "" + +#: siglist.c:111 +msgid "Terminated" +msgstr "" + +#: siglist.c:115 +msgid "Urgent IO condition" +msgstr "" + +#: siglist.c:119 +msgid "Stopped (signal)" +msgstr "" + +#: siglist.c:127 +msgid "Continue" +msgstr "" + +#: siglist.c:135 +msgid "Child death or stop" +msgstr "" + +#: siglist.c:139 +msgid "Stopped (tty input)" +msgstr "" + +#: siglist.c:143 +msgid "Stopped (tty output)" +msgstr "" + +#: siglist.c:147 +msgid "I/O ready" +msgstr "" + +#: siglist.c:151 +msgid "CPU limit" +msgstr "" + +#: siglist.c:155 +msgid "File limit" +msgstr "" + +#: siglist.c:159 +msgid "Alarm (virtual)" +msgstr "" + +#: siglist.c:163 +msgid "Alarm (profile)" +msgstr "" + +#: siglist.c:167 +msgid "Window changed" +msgstr "" + +#: siglist.c:171 +msgid "Record lock" +msgstr "" + +#: siglist.c:175 +msgid "User signal 1" +msgstr "" + +#: siglist.c:179 +msgid "User signal 2" +msgstr "" + +#: siglist.c:183 +msgid "HFT input data pending" +msgstr "" + +#: siglist.c:187 +msgid "power failure imminent" +msgstr "" + +#: siglist.c:191 +msgid "system crash imminent" +msgstr "" + +#: siglist.c:195 +msgid "migrate process to another CPU" +msgstr "" + +#: siglist.c:199 +msgid "programming error" +msgstr "" + +#: siglist.c:203 +msgid "HFT monitor mode granted" +msgstr "" + +#: siglist.c:207 +msgid "HFT monitor mode retracted" +msgstr "" + +#: siglist.c:211 +msgid "HFT sound sequence has completed" +msgstr "" + +#: siglist.c:215 +msgid "Information request" +msgstr "" + +#: siglist.c:223 +msgid "Unknown Signal #" +msgstr "" + +#: siglist.c:225 +#, c-format +msgid "Unknown Signal #%d" +msgstr "" + +#: subst.c:1362 subst.c:1520 +#, c-format +msgid "bad substitution: no closing `%s' in %s" +msgstr "" + +#: subst.c:2847 +#, c-format +msgid "%s: cannot assign list to array member" +msgstr "" + +#: subst.c:5065 subst.c:5081 +msgid "cannot make pipe for process substitution" +msgstr "" + +#: subst.c:5113 +msgid "cannot make child for process substitution" +msgstr "" + +#: subst.c:5158 +#, c-format +msgid "cannot open named pipe %s for reading" +msgstr "" + +#: subst.c:5160 +#, c-format +msgid "cannot open named pipe %s for writing" +msgstr "" + +#: subst.c:5178 +#, c-format +msgid "cannot duplicate named pipe %s as fd %d" +msgstr "" + +#: subst.c:5376 +msgid "cannot make pipe for command substitution" +msgstr "" + +#: subst.c:5414 +msgid "cannot make child for command substitution" +msgstr "" + +#: subst.c:5433 +msgid "command_substitute: cannot duplicate pipe as fd 1" +msgstr "" + +#: subst.c:5837 subst.c:8050 +#, c-format +msgid "%s: invalid variable name for name reference" +msgstr "" + +#: subst.c:6048 +#, c-format +msgid "%s: parameter null or not set" +msgstr "" + +#: subst.c:6320 subst.c:6335 +#, c-format +msgid "%s: substring expression < 0" +msgstr "" + +#: subst.c:7506 +#, c-format +msgid "%s: bad substitution" +msgstr "" + +#: subst.c:7583 +#, c-format +msgid "$%s: cannot assign in this way" +msgstr "" + +#: subst.c:7917 +msgid "" +"future versions of the shell will force evaluation as an arithmetic " +"substitution" +msgstr "" + +#: subst.c:8421 +#, c-format +msgid "bad substitution: no closing \"`\" in %s" +msgstr "" + +#: subst.c:9322 +#, c-format +msgid "no match: %s" +msgstr "" + +#: test.c:147 +msgid "argument expected" +msgstr "" + +#: test.c:156 +#, c-format +msgid "%s: integer expression expected" +msgstr "" + +#: test.c:264 +msgid "`)' expected" +msgstr "" + +#: test.c:266 +#, c-format +msgid "`)' expected, found %s" +msgstr "" + +#: test.c:281 test.c:742 test.c:745 +#, c-format +msgid "%s: unary operator expected" +msgstr "" + +#: test.c:468 test.c:785 +#, c-format +msgid "%s: binary operator expected" +msgstr "" + +#: test.c:860 +msgid "missing `]'" +msgstr "" + +#: trap.c:217 +msgid "invalid signal number" +msgstr "" + +#: trap.c:371 +#, c-format +msgid "run_pending_traps: bad value in trap_list[%d]: %p" +msgstr "" + +#: trap.c:375 +#, c-format +msgid "" +"run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" +msgstr "" + +#: trap.c:428 +#, c-format +msgid "trap_handler: bad signal %d" +msgstr "" + +#: variables.c:382 +#, c-format +msgid "error importing function definition for `%s'" +msgstr "" + +#: variables.c:780 +#, c-format +msgid "shell level (%d) too high, resetting to 1" +msgstr "" + +#: variables.c:1865 +#, c-format +msgid "%s: circular name reference" +msgstr "" + +#: variables.c:2228 +msgid "make_local_variable: no function context at current scope" +msgstr "" + +#: variables.c:2247 +#, c-format +msgid "%s: variable may not be assigned value" +msgstr "" + +#: variables.c:3646 +msgid "all_local_variables: no function context at current scope" +msgstr "" + +#: variables.c:3891 +#, c-format +msgid "%s has null exportstr" +msgstr "" + +#: variables.c:3896 variables.c:3905 +#, c-format +msgid "invalid character %d in exportstr for %s" +msgstr "" + +#: variables.c:3911 +#, c-format +msgid "no `=' in exportstr for %s" +msgstr "" + +#: variables.c:4344 +msgid "pop_var_context: head of shell_variables not a function context" +msgstr "" + +#: variables.c:4357 +msgid "pop_var_context: no global_variables context" +msgstr "" + +#: variables.c:4431 +msgid "pop_scope: head of shell_variables not a temporary environment scope" +msgstr "" + +#: variables.c:5257 +#, c-format +msgid "%s: %s: cannot open as FILE" +msgstr "" + +#: variables.c:5262 +#, c-format +msgid "%s: %s: invalid value for trace file descriptor" +msgstr "" + +#: variables.c:5307 +#, c-format +msgid "%s: %s: compatibility value out of range" +msgstr "" + +#: version.c:46 +msgid "Copyright (C) 2013 Free Software Foundation, Inc." +msgstr "" + +#: version.c:47 version2.c:47 +msgid "" +"License GPLv3+: GNU GPL version 3 or later \n" +msgstr "" + +#: version.c:86 version2.c:86 +#, c-format +msgid "GNU bash, version %s (%s)\n" +msgstr "" + +#: version.c:91 version2.c:91 +msgid "This is free software; you are free to change and redistribute it." +msgstr "" + +#: version.c:92 version2.c:92 +msgid "There is NO WARRANTY, to the extent permitted by law." +msgstr "" + +#: version2.c:46 +msgid "Copyright (C) 2012 Free Software Foundation, Inc." +msgstr "" + +#: xmalloc.c:91 +#, c-format +msgid "%s: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "" + +#: xmalloc.c:93 +#, c-format +msgid "%s: cannot allocate %lu bytes" +msgstr "" + +#: xmalloc.c:163 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "" + +#: xmalloc.c:165 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes" +msgstr "" + +#: builtins.c:43 +msgid "alias [-p] [name[=value] ... ]" +msgstr "" + +#: builtins.c:47 +msgid "unalias [-a] name [name ...]" +msgstr "" + +#: builtins.c:51 +msgid "" +"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-" +"x keyseq:shell-command] [keyseq:readline-function or readline-command]" +msgstr "" + +#: builtins.c:54 +msgid "break [n]" +msgstr "" + +#: builtins.c:56 +msgid "continue [n]" +msgstr "" + +#: builtins.c:58 +msgid "builtin [shell-builtin [arg ...]]" +msgstr "" + +#: builtins.c:61 +msgid "caller [expr]" +msgstr "" + +#: builtins.c:64 +msgid "cd [-L|[-P [-e]] [-@]] [dir]" +msgstr "" + +#: builtins.c:66 +msgid "pwd [-LP]" +msgstr "" + +#: builtins.c:68 +msgid ":" +msgstr "" + +#: builtins.c:70 +msgid "true" +msgstr "" + +#: builtins.c:72 +msgid "false" +msgstr "" + +#: builtins.c:74 +msgid "command [-pVv] command [arg ...]" +msgstr "" + +#: builtins.c:76 +msgid "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" +msgstr "" + +#: builtins.c:78 +msgid "typeset [-aAfFgilrtux] [-p] name[=value] ..." +msgstr "" + +#: builtins.c:80 +msgid "local [option] name[=value] ..." +msgstr "" + +#: builtins.c:83 +msgid "echo [-neE] [arg ...]" +msgstr "" + +#: builtins.c:87 +msgid "echo [-n] [arg ...]" +msgstr "" + +#: builtins.c:90 +msgid "enable [-a] [-dnps] [-f filename] [name ...]" +msgstr "" + +#: builtins.c:92 +msgid "eval [arg ...]" +msgstr "" + +#: builtins.c:94 +msgid "getopts optstring name [arg]" +msgstr "" + +#: builtins.c:96 +msgid "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" +msgstr "" + +#: builtins.c:98 +msgid "exit [n]" +msgstr "" + +#: builtins.c:100 +msgid "logout [n]" +msgstr "" + +#: builtins.c:103 +msgid "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" +msgstr "" + +#: builtins.c:107 +msgid "fg [job_spec]" +msgstr "" + +#: builtins.c:111 +msgid "bg [job_spec ...]" +msgstr "" + +#: builtins.c:114 +msgid "hash [-lr] [-p pathname] [-dt] [name ...]" +msgstr "" + +#: builtins.c:117 +msgid "help [-dms] [pattern ...]" +msgstr "" + +#: builtins.c:121 +msgid "" +"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg " +"[arg...]" +msgstr "" + +#: builtins.c:125 +msgid "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" +msgstr "" + +#: builtins.c:129 +msgid "disown [-h] [-ar] [jobspec ...]" +msgstr "" + +#: builtins.c:132 +msgid "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l " +"[sigspec]" +msgstr "" + +#: builtins.c:134 +msgid "let arg [arg ...]" +msgstr "" + +#: builtins.c:136 +msgid "" +"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p " +"prompt] [-t timeout] [-u fd] [name ...]" +msgstr "" + +#: builtins.c:138 +msgid "return [n]" +msgstr "" + +#: builtins.c:140 +msgid "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" +msgstr "" + +#: builtins.c:142 +msgid "unset [-f] [-v] [-n] [name ...]" +msgstr "" + +#: builtins.c:144 +msgid "export [-fn] [name[=value] ...] or export -p" +msgstr "" + +#: builtins.c:146 +msgid "readonly [-aAf] [name[=value] ...] or readonly -p" +msgstr "" + +#: builtins.c:148 +msgid "shift [n]" +msgstr "" + +#: builtins.c:150 +msgid "source filename [arguments]" +msgstr "" + +#: builtins.c:152 +msgid ". filename [arguments]" +msgstr "" + +#: builtins.c:155 +msgid "suspend [-f]" +msgstr "" + +#: builtins.c:158 +msgid "test [expr]" +msgstr "" + +#: builtins.c:160 +msgid "[ arg... ]" +msgstr "" + +#: builtins.c:162 +msgid "times" +msgstr "" + +#: builtins.c:164 +msgid "trap [-lp] [[arg] signal_spec ...]" +msgstr "" + +#: builtins.c:166 +msgid "type [-afptP] name [name ...]" +msgstr "" + +#: builtins.c:169 +msgid "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" +msgstr "" + +#: builtins.c:172 +msgid "umask [-p] [-S] [mode]" +msgstr "" + +#: builtins.c:175 +msgid "wait [-n] [id ...]" +msgstr "" + +#: builtins.c:179 +msgid "wait [pid ...]" +msgstr "" + +#: builtins.c:182 +msgid "for NAME [in WORDS ... ] ; do COMMANDS; done" +msgstr "" + +#: builtins.c:184 +msgid "for (( exp1; exp2; exp3 )); do COMMANDS; done" +msgstr "" + +#: builtins.c:186 +msgid "select NAME [in WORDS ... ;] do COMMANDS; done" +msgstr "" + +#: builtins.c:188 +msgid "time [-p] pipeline" +msgstr "" + +#: builtins.c:190 +msgid "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" +msgstr "" + +#: builtins.c:192 +msgid "" +"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else " +"COMMANDS; ] fi" +msgstr "" + +#: builtins.c:194 +msgid "while COMMANDS; do COMMANDS; done" +msgstr "" + +#: builtins.c:196 +msgid "until COMMANDS; do COMMANDS; done" +msgstr "" + +#: builtins.c:198 +msgid "coproc [NAME] command [redirections]" +msgstr "" + +#: builtins.c:200 +msgid "function name { COMMANDS ; } or name () { COMMANDS ; }" +msgstr "" + +#: builtins.c:202 +msgid "{ COMMANDS ; }" +msgstr "" + +#: builtins.c:204 +msgid "job_spec [&]" +msgstr "" + +#: builtins.c:206 +msgid "(( expression ))" +msgstr "" + +#: builtins.c:208 +msgid "[[ expression ]]" +msgstr "" + +#: builtins.c:210 +msgid "variables - Names and meanings of some shell variables" +msgstr "" + +#: builtins.c:213 +msgid "pushd [-n] [+N | -N | dir]" +msgstr "" + +#: builtins.c:217 +msgid "popd [-n] [+N | -N]" +msgstr "" + +#: builtins.c:221 +msgid "dirs [-clpv] [+N] [-N]" +msgstr "" + +#: builtins.c:224 +msgid "shopt [-pqsu] [-o] [optname ...]" +msgstr "" + +#: builtins.c:226 +msgid "printf [-v var] format [arguments]" +msgstr "" + +#: builtins.c:229 +msgid "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-" +"W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S " +"suffix] [name ...]" +msgstr "" + +#: builtins.c:233 +msgid "" +"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " +"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" +msgstr "" + +#: builtins.c:237 +msgid "compopt [-o|+o option] [-DE] [name ...]" +msgstr "" + +#: builtins.c:240 +msgid "" +"mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" + +#: builtins.c:242 +msgid "" +"readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" + +#: builtins.c:254 +msgid "" +"Define or display aliases.\n" +" \n" +" Without arguments, `alias' prints the list of aliases in the reusable\n" +" form `alias NAME=VALUE' on standard output.\n" +" \n" +" Otherwise, an alias is defined for each NAME whose VALUE is given.\n" +" A trailing space in VALUE causes the next word to be checked for\n" +" alias substitution when the alias is expanded.\n" +" \n" +" Options:\n" +" -p\tPrint all defined aliases in a reusable format\n" +" \n" +" Exit Status:\n" +" alias returns true unless a NAME is supplied for which no alias has " +"been\n" +" defined." +msgstr "" + +#: builtins.c:276 +msgid "" +"Remove each NAME from the list of defined aliases.\n" +" \n" +" Options:\n" +" -a\tremove all alias definitions.\n" +" \n" +" Return success unless a NAME is not an existing alias." +msgstr "" + +#: builtins.c:289 +msgid "" +"Set Readline key bindings and variables.\n" +" \n" +" Bind a key sequence to a Readline function or a macro, or set a\n" +" Readline variable. The non-option argument syntax is equivalent to\n" +" that found in ~/.inputrc, but must be passed as a single argument:\n" +" e.g., bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Options:\n" +" -m keymap Use KEYMAP as the keymap for the duration of this\n" +" command. Acceptable keymap names are emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" +"move,\n" +" vi-command, and vi-insert.\n" +" -l List names of functions.\n" +" -P List function names and bindings.\n" +" -p List functions and bindings in a form that can be\n" +" reused as input.\n" +" -S List key sequences that invoke macros and their " +"values\n" +" -s List key sequences that invoke macros and their " +"values\n" +" in a form that can be reused as input.\n" +" -V List variable names and values\n" +" -v List variable names and values in a form that can\n" +" be reused as input.\n" +" -q function-name Query about which keys invoke the named function.\n" +" -u function-name Unbind all keys which are bound to the named " +"function.\n" +" -r keyseq Remove the binding for KEYSEQ.\n" +" -f filename Read key bindings from FILENAME.\n" +" -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when\n" +" \t\t\t\tKEYSEQ is entered.\n" +" -X\t\t List key sequences bound with -x and associated commands\n" +" in a form that can be reused as input.\n" +" \n" +" Exit Status:\n" +" bind returns 0 unless an unrecognized option is given or an error occurs." +msgstr "" + +#: builtins.c:328 +msgid "" +"Exit for, while, or until loops.\n" +" \n" +" Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n" +" loops.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" + +#: builtins.c:340 +msgid "" +"Resume for, while, or until loops.\n" +" \n" +" Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n" +" If N is specified, resumes the Nth enclosing loop.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" + +#: builtins.c:352 +msgid "" +"Execute shell builtins.\n" +" \n" +" Execute SHELL-BUILTIN with arguments ARGs without performing command\n" +" lookup. This is useful when you wish to reimplement a shell builtin\n" +" as a shell function, but need to execute the builtin within the " +"function.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n" +" not a shell builtin.." +msgstr "" + +#: builtins.c:367 +msgid "" +"Return the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns \"$line $filename\". With EXPR, returns\n" +" \"$line $subroutine $filename\"; this extra information can be used to\n" +" provide a stack trace.\n" +" \n" +" The value of EXPR indicates how many call frames to go back before the\n" +" current one; the top frame is frame 0.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless the shell is not executing a shell function or EXPR\n" +" is invalid." +msgstr "" + +#: builtins.c:385 +msgid "" +"Change the shell working directory.\n" +" \n" +" Change the current directory to DIR. The default DIR is the value of " +"the\n" +" HOME shell variable.\n" +" \n" +" The variable CDPATH defines the search path for the directory " +"containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon " +"(:).\n" +" A null directory name is the same as the current directory. If DIR " +"begins\n" +" with a slash (/), then CDPATH is not used.\n" +" \n" +" If the directory is not found, and the shell option `cdable_vars' is " +"set,\n" +" the word is assumed to be a variable name. If that variable has a " +"value,\n" +" its value is used for DIR.\n" +" \n" +" Options:\n" +" -L\tforce symbolic links to be followed: resolve symbolic links in\n" +" \tDIR after processing instances of `..'\n" +" -P\tuse the physical directory structure without following symbolic\n" +" \tlinks: resolve symbolic links in DIR before processing instances\n" +" \tof `..'\n" +" -e\tif the -P option is supplied, and the current working directory\n" +" \tcannot be determined successfully, exit with a non-zero status\n" +" -@ on systems that support it, present a file with extended " +"attributes\n" +" as a directory containing the file attributes\n" +" \n" +" The default is to follow symbolic links, as if `-L' were specified.\n" +" `..' is processed by removing the immediately previous pathname " +"component\n" +" back to a slash or the beginning of DIR.\n" +" \n" +" Exit Status:\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully " +"when\n" +" -P is used; non-zero otherwise." +msgstr "" + +#: builtins.c:422 +msgid "" +"Print the name of the current working directory.\n" +" \n" +" Options:\n" +" -L\tprint the value of $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tprint the physical directory, without any symbolic links\n" +" \n" +" By default, `pwd' behaves as if `-L' were specified.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless an invalid option is given or the current directory\n" +" cannot be read." +msgstr "" + +#: builtins.c:439 +msgid "" +"Null command.\n" +" \n" +" No effect; the command does nothing.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" + +#: builtins.c:450 +msgid "" +"Return a successful result.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" + +#: builtins.c:459 +msgid "" +"Return an unsuccessful result.\n" +" \n" +" Exit Status:\n" +" Always fails." +msgstr "" + +#: builtins.c:468 +msgid "" +"Execute a simple command or display information about commands.\n" +" \n" +" Runs COMMAND with ARGS suppressing shell function lookup, or display\n" +" information about the specified COMMANDs. Can be used to invoke " +"commands\n" +" on disk when a function with the same name exists.\n" +" \n" +" Options:\n" +" -p\tuse a default value for PATH that is guaranteed to find all of\n" +" \tthe standard utilities\n" +" -v\tprint a description of COMMAND similar to the `type' builtin\n" +" -V\tprint a more verbose description of each COMMAND\n" +" \n" +" Exit Status:\n" +" Returns exit status of COMMAND, or failure if COMMAND is not found." +msgstr "" + +#: builtins.c:487 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Declare variables and give them attributes. If no NAMEs are given,\n" +" display the attributes and values of all variables.\n" +" \n" +" Options:\n" +" -f\trestrict action or display to function names and definitions\n" +" -F\trestrict display to function names only (plus line number and\n" +" \tsource file when debugging)\n" +" -g\tcreate global variables when used in a shell function; otherwise\n" +" \tignored\n" +" -p\tdisplay the attributes and value of each NAME\n" +" \n" +" Options which set attributes:\n" +" -a\tto make NAMEs indexed arrays (if supported)\n" +" -A\tto make NAMEs associative arrays (if supported)\n" +" -i\tto make NAMEs have the `integer' attribute\n" +" -l\tto convert NAMEs to lower case on assignment\n" +" -n\tmake NAME a reference to the variable named by its value\n" +" -r\tto make NAMEs readonly\n" +" -t\tto make NAMEs have the `trace' attribute\n" +" -u\tto convert NAMEs to upper case on assignment\n" +" -x\tto make NAMEs export\n" +" \n" +" Using `+' instead of `-' turns off the given attribute.\n" +" \n" +" Variables with the integer attribute have arithmetic evaluation (see\n" +" the `let' command) performed when the variable is assigned a value.\n" +" \n" +" When used in a function, `declare' makes NAMEs local, as with the " +"`local'\n" +" command. The `-g' option suppresses this behavior.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or a variable\n" +" assignment error occurs." +msgstr "" + +#: builtins.c:527 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Obsolete. See `help declare'." +msgstr "" + +#: builtins.c:535 +msgid "" +"Define local variables.\n" +" \n" +" Create a local variable called NAME, and give it VALUE. OPTION can\n" +" be any option accepted by `declare'.\n" +" \n" +" Local variables can only be used within a function; they are visible\n" +" only to the function where they are defined and its children.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied, a variable\n" +" assignment error occurs, or the shell is not executing a function." +msgstr "" + +#: builtins.c:552 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs, separated by a single space character and followed by " +"a\n" +" newline, on the standard output.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" -e\tenable interpretation of the following backslash escapes\n" +" -E\texplicitly suppress interpretation of backslash escapes\n" +" \n" +" `echo' interprets the following backslash-escaped characters:\n" +" \\a\talert (bell)\n" +" \\b\tbackspace\n" +" \\c\tsuppress further output\n" +" \\e\tescape character\n" +" \\E\tescape character\n" +" \\f\tform feed\n" +" \\n\tnew line\n" +" \\r\tcarriage return\n" +" \\t\thorizontal tab\n" +" \\v\tvertical tab\n" +" \\\\\tbackslash\n" +" \\0nnn\tthe character whose ASCII code is NNN (octal). NNN can be\n" +" \t0 to 3 octal digits\n" +" \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" +" \tcan be one or two hex digits\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" + +#: builtins.c:588 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs on the standard output followed by a newline.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" + +#: builtins.c:603 +msgid "" +"Enable and disable shell builtins.\n" +" \n" +" Enables and disables builtin shell commands. Disabling allows you to\n" +" execute a disk command which has the same name as a shell builtin\n" +" without using a full pathname.\n" +" \n" +" Options:\n" +" -a\tprint a list of builtins showing whether or not each is enabled\n" +" -n\tdisable each NAME or display a list of disabled builtins\n" +" -p\tprint the list of builtins in a reusable format\n" +" -s\tprint only the names of Posix `special' builtins\n" +" \n" +" Options controlling dynamic loading:\n" +" -f\tLoad builtin NAME from shared object FILENAME\n" +" -d\tRemove a builtin loaded with -f\n" +" \n" +" Without options, each NAME is enabled.\n" +" \n" +" To use the `test' found in $PATH instead of the shell builtin\n" +" version, type `enable -n test'.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not a shell builtin or an error occurs." +msgstr "" + +#: builtins.c:631 +msgid "" +"Execute arguments as a shell command.\n" +" \n" +" Combine ARGs into a single string, use the result as input to the " +"shell,\n" +" and execute the resulting commands.\n" +" \n" +" Exit Status:\n" +" Returns exit status of command or success if command is null." +msgstr "" + +#: builtins.c:643 +msgid "" +"Parse option arguments.\n" +" \n" +" Getopts is used by shell procedures to parse positional parameters\n" +" as options.\n" +" \n" +" OPTSTRING contains the option letters to be recognized; if a letter\n" +" is followed by a colon, the option is expected to have an argument,\n" +" which should be separated from it by white space.\n" +" \n" +" Each time it is invoked, getopts will place the next option in the\n" +" shell variable $name, initializing name if it does not exist, and\n" +" the index of the next argument to be processed into the shell\n" +" variable OPTIND. OPTIND is initialized to 1 each time the shell or\n" +" a shell script is invoked. When an option requires an argument,\n" +" getopts places that argument into the shell variable OPTARG.\n" +" \n" +" getopts reports errors in one of two ways. If the first character\n" +" of OPTSTRING is a colon, getopts uses silent error reporting. In\n" +" this mode, no error messages are printed. If an invalid option is\n" +" seen, getopts places the option character found into OPTARG. If a\n" +" required argument is not found, getopts places a ':' into NAME and\n" +" sets OPTARG to the option character found. If getopts is not in\n" +" silent mode, and an invalid option is seen, getopts places '?' into\n" +" NAME and unsets OPTARG. If a required argument is not found, a '?'\n" +" is placed in NAME, OPTARG is unset, and a diagnostic message is\n" +" printed.\n" +" \n" +" If the shell variable OPTERR has the value 0, getopts disables the\n" +" printing of error messages, even if the first character of\n" +" OPTSTRING is not a colon. OPTERR has the value 1 by default.\n" +" \n" +" Getopts normally parses the positional parameters ($0 - $9), but if\n" +" more arguments are given, they are parsed instead.\n" +" \n" +" Exit Status:\n" +" Returns success if an option is found; fails if the end of options is\n" +" encountered or an error occurs." +msgstr "" + +#: builtins.c:685 +msgid "" +"Replace the shell with the given command.\n" +" \n" +" Execute COMMAND, replacing this shell with the specified program.\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not " +"specified,\n" +" any redirections take effect in the current shell.\n" +" \n" +" Options:\n" +" -a name\tpass NAME as the zeroth argument to COMMAND\n" +" -c\t\texecute COMMAND with an empty environment\n" +" -l\t\tplace a dash in the zeroth argument to COMMAND\n" +" \n" +" If the command cannot be executed, a non-interactive shell exits, " +"unless\n" +" the shell option `execfail' is set.\n" +" \n" +" Exit Status:\n" +" Returns success unless COMMAND is not found or a redirection error " +"occurs." +msgstr "" + +#: builtins.c:706 +msgid "" +"Exit the shell.\n" +" \n" +" Exits the shell with a status of N. If N is omitted, the exit status\n" +" is that of the last command executed." +msgstr "" + +#: builtins.c:715 +msgid "" +"Exit a login shell.\n" +" \n" +" Exits a login shell with exit status N. Returns an error if not " +"executed\n" +" in a login shell." +msgstr "" + +#: builtins.c:725 +msgid "" +"Display or execute commands from the history list.\n" +" \n" +" fc is used to list or edit and re-execute commands from the history " +"list.\n" +" FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" +" string, which means the most recent command beginning with that\n" +" string.\n" +" \n" +" Options:\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then " +"EDITOR,\n" +" \t\tthen vi\n" +" -l \tlist lines instead of editing\n" +" -n\tomit line numbers when listing\n" +" -r\treverse the order of the lines (newest listed first)\n" +" \n" +" With the `fc -s [pat=rep ...] [command]' format, COMMAND is\n" +" re-executed after the substitution OLD=NEW is performed.\n" +" \n" +" A useful alias to use with this is r='fc -s', so that typing `r cc'\n" +" runs the last command beginning with `cc' and typing `r' re-executes\n" +" the last command.\n" +" \n" +" Exit Status:\n" +" Returns success or status of executed command; non-zero if an error " +"occurs." +msgstr "" + +#: builtins.c:755 +msgid "" +"Move job to the foreground.\n" +" \n" +" Place the job identified by JOB_SPEC in the foreground, making it the\n" +" current job. If JOB_SPEC is not present, the shell's notion of the\n" +" current job is used.\n" +" \n" +" Exit Status:\n" +" Status of command placed in foreground, or failure if an error occurs." +msgstr "" + +#: builtins.c:770 +msgid "" +"Move jobs to the background.\n" +" \n" +" Place the jobs identified by each JOB_SPEC in the background, as if " +"they\n" +" had been started with `&'. If JOB_SPEC is not present, the shell's " +"notion\n" +" of the current job is used.\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" + +#: builtins.c:784 +msgid "" +"Remember or display program locations.\n" +" \n" +" Determine and remember the full pathname of each command NAME. If\n" +" no arguments are given, information about remembered commands is " +"displayed.\n" +" \n" +" Options:\n" +" -d\t\tforget the remembered location of each NAME\n" +" -l\t\tdisplay in a format that may be reused as input\n" +" -p pathname\tuse PATHNAME as the full pathname of NAME\n" +" -r\t\tforget all remembered locations\n" +" -t\t\tprint the remembered location of each NAME, preceding\n" +" \t\teach location with the corresponding NAME if multiple\n" +" \t\tNAMEs are given\n" +" Arguments:\n" +" NAME\t\tEach NAME is searched for in $PATH and added to the list\n" +" \t\tof remembered commands.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not found or an invalid option is given." +msgstr "" + +#: builtins.c:809 +msgid "" +"Display information about builtin commands.\n" +" \n" +" Displays brief summaries of builtin commands. If PATTERN is\n" +" specified, gives detailed help on all commands matching PATTERN,\n" +" otherwise the list of help topics is printed.\n" +" \n" +" Options:\n" +" -d\toutput short description for each topic\n" +" -m\tdisplay usage in pseudo-manpage format\n" +" -s\toutput only a short usage synopsis for each topic matching\n" +" \tPATTERN\n" +" \n" +" Arguments:\n" +" PATTERN\tPattern specifiying a help topic\n" +" \n" +" Exit Status:\n" +" Returns success unless PATTERN is not found or an invalid option is " +"given." +msgstr "" + +#: builtins.c:833 +msgid "" +"Display or manipulate the history list.\n" +" \n" +" Display the history list with line numbers, prefixing each modified\n" +" entry with a `*'. An argument of N lists only the last N entries.\n" +" \n" +" Options:\n" +" -c\tclear the history list by deleting all of the entries\n" +" -d offset\tdelete the history entry at offset OFFSET.\n" +" \n" +" -a\tappend history lines from this session to the history file\n" +" -n\tread all history lines not already read from the history file\n" +" -r\tread the history file and append the contents to the history\n" +" \tlist\n" +" -w\twrite the current history to the history file\n" +" \tand append them to the history list\n" +" \n" +" -p\tperform history expansion on each ARG and display the result\n" +" \twithout storing it in the history list\n" +" -s\tappend the ARGs to the history list as a single entry\n" +" \n" +" If FILENAME is given, it is used as the history file. Otherwise,\n" +" if $HISTFILE has a value, that is used, else ~/.bash_history.\n" +" \n" +" If the $HISTTIMEFORMAT variable is set and not null, its value is used\n" +" as a format string for strftime(3) to print the time stamp associated\n" +" with each displayed history entry. No time stamps are printed " +"otherwise.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" + +#: builtins.c:869 +msgid "" +"Display status of jobs.\n" +" \n" +" Lists the active jobs. JOBSPEC restricts output to that job.\n" +" Without options, the status of all active jobs is displayed.\n" +" \n" +" Options:\n" +" -l\tlists process IDs in addition to the normal information\n" +" -n\tlists only processes that have changed status since the last\n" +" \tnotification\n" +" -p\tlists process IDs only\n" +" -r\trestrict output to running jobs\n" +" -s\trestrict output to stopped jobs\n" +" \n" +" If -x is supplied, COMMAND is run after all job specifications that\n" +" appear in ARGS have been replaced with the process ID of that job's\n" +" process group leader.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs.\n" +" If -x is used, returns the exit status of COMMAND." +msgstr "" + +#: builtins.c:896 +msgid "" +"Remove jobs from current shell.\n" +" \n" +" Removes each JOBSPEC argument from the table of active jobs. Without\n" +" any JOBSPECs, the shell uses its notion of the current job.\n" +" \n" +" Options:\n" +" -a\tremove all jobs if JOBSPEC is not supplied\n" +" -h\tmark each JOBSPEC so that SIGHUP is not sent to the job if the\n" +" \tshell receives a SIGHUP\n" +" -r\tremove only running jobs\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option or JOBSPEC is given." +msgstr "" + +#: builtins.c:915 +msgid "" +"Send a signal to a job.\n" +" \n" +" Send the processes identified by PID or JOBSPEC the signal named by\n" +" SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n" +" SIGTERM is assumed.\n" +" \n" +" Options:\n" +" -s sig\tSIG is a signal name\n" +" -n sig\tSIG is a signal number\n" +" -l\tlist the signal names; if arguments follow `-l' they are\n" +" \tassumed to be signal numbers for which names should be listed\n" +" \n" +" Kill is a shell builtin for two reasons: it allows job IDs to be used\n" +" instead of process IDs, and allows processes to be killed if the limit\n" +" on processes that you can create is reached.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" + +#: builtins.c:938 +msgid "" +"Evaluate arithmetic expressions.\n" +" \n" +" Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" +" fixed-width integers with no check for overflow, though division by 0\n" +" is trapped and flagged as an error. The following list of operators is\n" +" grouped into levels of equal-precedence operators. The levels are " +"listed\n" +" in order of decreasing precedence.\n" +" \n" +" \tid++, id--\tvariable post-increment, post-decrement\n" +" \t++id, --id\tvariable pre-increment, pre-decrement\n" +" \t-, +\t\tunary minus, plus\n" +" \t!, ~\t\tlogical and bitwise negation\n" +" \t**\t\texponentiation\n" +" \t*, /, %\t\tmultiplication, division, remainder\n" +" \t+, -\t\taddition, subtraction\n" +" \t<<, >>\t\tleft and right bitwise shifts\n" +" \t<=, >=, <, >\tcomparison\n" +" \t==, !=\t\tequality, inequality\n" +" \t&\t\tbitwise AND\n" +" \t^\t\tbitwise XOR\n" +" \t|\t\tbitwise OR\n" +" \t&&\t\tlogical AND\n" +" \t||\t\tlogical OR\n" +" \texpr ? expr : expr\n" +" \t\t\tconditional operator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tassignment\n" +" \n" +" Shell variables are allowed as operands. The name of the variable\n" +" is replaced by its value (coerced to a fixed-width integer) within\n" +" an expression. The variable need not have its integer attribute\n" +" turned on to be used in an expression.\n" +" \n" +" Operators are evaluated in order of precedence. Sub-expressions in\n" +" parentheses are evaluated first and may override the precedence\n" +" rules above.\n" +" \n" +" Exit Status:\n" +" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." +msgstr "" + +#: builtins.c:983 +msgid "" +"Read a line from the standard input and split it into fields.\n" +" \n" +" Reads a single line from the standard input, or from file descriptor FD\n" +" if the -u option is supplied. The line is split into fields as with " +"word\n" +" splitting, and the first word is assigned to the first NAME, the second\n" +" word to the second NAME, and so on, with any leftover words assigned to\n" +" the last NAME. Only the characters found in $IFS are recognized as " +"word\n" +" delimiters.\n" +" \n" +" If no NAMEs are supplied, the line read is stored in the REPLY " +"variable.\n" +" \n" +" Options:\n" +" -a array\tassign the words read to sequential indices of the array\n" +" \t\tvariable ARRAY, starting at zero\n" +" -d delim\tcontinue until the first character of DELIM is read, rather\n" +" \t\tthan newline\n" +" -e\t\tuse Readline to obtain the line in an interactive shell\n" +" -i text\tUse TEXT as the initial text for Readline\n" +" -n nchars\treturn after reading NCHARS characters rather than waiting\n" +" \t\tfor a newline, but honor a delimiter if fewer than NCHARS\n" +" \t\tcharacters are read before the delimiter\n" +" -N nchars\treturn only after reading exactly NCHARS characters, " +"unless\n" +" \t\tEOF is encountered or read times out, ignoring any delimiter\n" +" -p prompt\toutput the string PROMPT without a trailing newline before\n" +" \t\tattempting to read\n" +" -r\t\tdo not allow backslashes to escape any characters\n" +" -s\t\tdo not echo input coming from a terminal\n" +" -t timeout\ttime out and return failure if a complete line of input " +"is\n" +" \t\tnot read within TIMEOUT seconds. The value of the TMOUT\n" +" \t\tvariable is the default timeout. TIMEOUT may be a\n" +" \t\tfractional number. If TIMEOUT is 0, read returns immediately,\n" +" \t\twithout trying to read any data, returning success only if\n" +" \t\tinput is available on the specified file descriptor. The\n" +" \t\texit status is greater than 128 if the timeout is exceeded\n" +" -u fd\t\tread from file descriptor FD instead of the standard input\n" +" \n" +" Exit Status:\n" +" The return code is zero, unless end-of-file is encountered, read times " +"out\n" +" (in which case it's greater than 128), a variable assignment error " +"occurs,\n" +" or an invalid file descriptor is supplied as the argument to -u." +msgstr "" + +#: builtins.c:1028 +msgid "" +"Return from a shell function.\n" +" \n" +" Causes a function or sourced script to exit with the return value\n" +" specified by N. If N is omitted, the return status is that of the\n" +" last command executed within the function or script.\n" +" \n" +" Exit Status:\n" +" Returns N, or failure if the shell is not executing a function or script." +msgstr "" + +#: builtins.c:1041 +msgid "" +"Set or unset values of shell options and positional parameters.\n" +" \n" +" Change the value of shell attributes and positional parameters, or\n" +" display the names and values of shell variables.\n" +" \n" +" Options:\n" +" -a Mark variables which are modified or created for export.\n" +" -b Notify of job termination immediately.\n" +" -e Exit immediately if a command exits with a non-zero status.\n" +" -f Disable file name generation (globbing).\n" +" -h Remember the location of commands as they are looked up.\n" +" -k All assignment arguments are placed in the environment for a\n" +" command, not just those that precede the command name.\n" +" -m Job control is enabled.\n" +" -n Read commands but do not execute them.\n" +" -o option-name\n" +" Set the variable corresponding to option-name:\n" +" allexport same as -a\n" +" braceexpand same as -B\n" +" emacs use an emacs-style line editing interface\n" +" errexit same as -e\n" +" errtrace same as -E\n" +" functrace same as -T\n" +" hashall same as -h\n" +" histexpand same as -H\n" +" history enable command history\n" +" ignoreeof the shell will not exit upon reading EOF\n" +" interactive-comments\n" +" allow comments to appear in interactive commands\n" +" keyword same as -k\n" +" monitor same as -m\n" +" noclobber same as -C\n" +" noexec same as -n\n" +" noglob same as -f\n" +" nolog currently accepted but ignored\n" +" notify same as -b\n" +" nounset same as -u\n" +" onecmd same as -t\n" +" physical same as -P\n" +" pipefail the return value of a pipeline is the status of\n" +" the last command to exit with a non-zero status,\n" +" or zero if no command exited with a non-zero " +"status\n" +" posix change the behavior of bash where the default\n" +" operation differs from the Posix standard to\n" +" match the standard\n" +" privileged same as -p\n" +" verbose same as -v\n" +" vi use a vi-style line editing interface\n" +" xtrace same as -x\n" +" -p Turned on whenever the real and effective user ids do not match.\n" +" Disables processing of the $ENV file and importing of shell\n" +" functions. Turning this option off causes the effective uid and\n" +" gid to be set to the real uid and gid.\n" +" -t Exit after reading and executing one command.\n" +" -u Treat unset variables as an error when substituting.\n" +" -v Print shell input lines as they are read.\n" +" -x Print commands and their arguments as they are executed.\n" +" -B the shell will perform brace expansion\n" +" -C If set, disallow existing regular files to be overwritten\n" +" by redirection of output.\n" +" -E If set, the ERR trap is inherited by shell functions.\n" +" -H Enable ! style history substitution. This flag is on\n" +" by default when the shell is interactive.\n" +" -P If set, do not resolve symbolic links when executing commands\n" +" such as cd which change the current directory.\n" +" -T If set, the DEBUG trap is inherited by shell functions.\n" +" -- Assign any remaining arguments to the positional parameters.\n" +" If there are no remaining arguments, the positional parameters\n" +" are unset.\n" +" - Assign any remaining arguments to the positional parameters.\n" +" The -x and -v options are turned off.\n" +" \n" +" Using + rather than - causes these flags to be turned off. The\n" +" flags can also be used upon invocation of the shell. The current\n" +" set of flags may be found in $-. The remaining n ARGs are positional\n" +" parameters and are assigned, in order, to $1, $2, .. $n. If no\n" +" ARGs are given, all shell variables are printed.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given." +msgstr "" + +#: builtins.c:1126 +msgid "" +"Unset values and attributes of shell variables and functions.\n" +" \n" +" For each NAME, remove the corresponding variable or function.\n" +" \n" +" Options:\n" +" -f\ttreat each NAME as a shell function\n" +" -v\ttreat each NAME as a shell variable\n" +" -n\ttreat each NAME as a name reference and unset the variable itself\n" +" \trather than the variable it references\n" +" \n" +" Without options, unset first tries to unset a variable, and if that " +"fails,\n" +" tries to unset a function.\n" +" \n" +" Some variables cannot be unset; also see `readonly'.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a NAME is read-only." +msgstr "" + +#: builtins.c:1148 +msgid "" +"Set export attribute for shell variables.\n" +" \n" +" Marks each NAME for automatic export to the environment of subsequently\n" +" executed commands. If VALUE is supplied, assign VALUE before " +"exporting.\n" +" \n" +" Options:\n" +" -f\trefer to shell functions\n" +" -n\tremove the export property from each NAME\n" +" -p\tdisplay a list of all exported variables and functions\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" + +#: builtins.c:1167 +msgid "" +"Mark shell variables as unchangeable.\n" +" \n" +" Mark each NAME as read-only; the values of these NAMEs may not be\n" +" changed by subsequent assignment. If VALUE is supplied, assign VALUE\n" +" before marking as read-only.\n" +" \n" +" Options:\n" +" -a\trefer to indexed array variables\n" +" -A\trefer to associative array variables\n" +" -f\trefer to shell functions\n" +" -p\tdisplay a list of all readonly variables or functions, depending " +"on\n" +" whether or not the -f option is given\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" + +#: builtins.c:1189 +msgid "" +"Shift positional parameters.\n" +" \n" +" Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n" +" not given, it is assumed to be 1.\n" +" \n" +" Exit Status:\n" +" Returns success unless N is negative or greater than $#." +msgstr "" + +#: builtins.c:1201 builtins.c:1216 +msgid "" +"Execute commands from a file in the current shell.\n" +" \n" +" Read and execute commands from FILENAME in the current shell. The\n" +" entries in $PATH are used to find the directory containing FILENAME.\n" +" If any ARGUMENTS are supplied, they become the positional parameters\n" +" when FILENAME is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed in FILENAME; fails if\n" +" FILENAME cannot be read." +msgstr "" + +#: builtins.c:1232 +msgid "" +"Suspend shell execution.\n" +" \n" +" Suspend the execution of this shell until it receives a SIGCONT signal.\n" +" Unless forced, login shells cannot be suspended.\n" +" \n" +" Options:\n" +" -f\tforce the suspend, even if the shell is a login shell\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" + +#: builtins.c:1248 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" Exits with a status of 0 (true) or 1 (false) depending on\n" +" the evaluation of EXPR. Expressions may be unary or binary. Unary\n" +" expressions are often used to examine the status of a file. There\n" +" are string operators and numeric comparison operators as well.\n" +" \n" +" The behavior of test depends on the number of arguments. Read the\n" +" bash manual page for the complete specification.\n" +" \n" +" File operators:\n" +" \n" +" -a FILE True if file exists.\n" +" -b FILE True if file is block special.\n" +" -c FILE True if file is character special.\n" +" -d FILE True if file is a directory.\n" +" -e FILE True if file exists.\n" +" -f FILE True if file exists and is a regular file.\n" +" -g FILE True if file is set-group-id.\n" +" -h FILE True if file is a symbolic link.\n" +" -L FILE True if file is a symbolic link.\n" +" -k FILE True if file has its `sticky' bit set.\n" +" -p FILE True if file is a named pipe.\n" +" -r FILE True if file is readable by you.\n" +" -s FILE True if file exists and is not empty.\n" +" -S FILE True if file is a socket.\n" +" -t FD True if FD is opened on a terminal.\n" +" -u FILE True if the file is set-user-id.\n" +" -w FILE True if the file is writable by you.\n" +" -x FILE True if the file is executable by you.\n" +" -O FILE True if the file is effectively owned by you.\n" +" -G FILE True if the file is effectively owned by your group.\n" +" -N FILE True if the file has been modified since it was last " +"read.\n" +" \n" +" FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" +" modification date).\n" +" \n" +" FILE1 -ot FILE2 True if file1 is older than file2.\n" +" \n" +" FILE1 -ef FILE2 True if file1 is a hard link to file2.\n" +" \n" +" String operators:\n" +" \n" +" -z STRING True if string is empty.\n" +" \n" +" -n STRING\n" +" STRING True if string is not empty.\n" +" \n" +" STRING1 = STRING2\n" +" True if the strings are equal.\n" +" STRING1 != STRING2\n" +" True if the strings are not equal.\n" +" STRING1 < STRING2\n" +" True if STRING1 sorts before STRING2 " +"lexicographically.\n" +" STRING1 > STRING2\n" +" True if STRING1 sorts after STRING2 lexicographically.\n" +" \n" +" Other operators:\n" +" \n" +" -o OPTION True if the shell option OPTION is enabled.\n" +" -v VAR\t True if the shell variable VAR is set\n" +" -R VAR\t True if the shell variable VAR is set and is a name " +"reference.\n" +" ! EXPR True if expr is false.\n" +" EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n" +" EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n" +" \n" +" arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Arithmetic binary operators return true if ARG1 is equal, not-equal,\n" +" less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n" +" than ARG2.\n" +" \n" +" Exit Status:\n" +" Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n" +" false or an invalid argument is given." +msgstr "" + +#: builtins.c:1329 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" This is a synonym for the \"test\" builtin, but the last argument must\n" +" be a literal `]', to match the opening `['." +msgstr "" + +#: builtins.c:1338 +msgid "" +"Display process times.\n" +" \n" +" Prints the accumulated user and system times for the shell and all of " +"its\n" +" child processes.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" + +#: builtins.c:1350 +msgid "" +"Trap signals and other events.\n" +" \n" +" Defines and activates handlers to be run when the shell receives " +"signals\n" +" or other conditions.\n" +" \n" +" ARG is a command to be read and executed when the shell receives the\n" +" signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n" +" is supplied) or `-', each specified signal is reset to its original\n" +" value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" +" shell and by the commands it invokes.\n" +" \n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. " +"If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. " +"If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or " +"a\n" +" script run by the . or source builtins finishes executing. A " +"SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause " +"the\n" +" shell to exit when the -e option is enabled.\n" +" \n" +" If no arguments are supplied, trap prints the list of commands " +"associated\n" +" with each signal.\n" +" \n" +" Options:\n" +" -l\tprint a list of signal names and their corresponding numbers\n" +" -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" +" \n" +" Each SIGNAL_SPEC is either a signal name in or a signal " +"number.\n" +" Signal names are case insensitive and the SIG prefix is optional. A\n" +" signal may be sent to the shell with \"kill -signal $$\".\n" +" \n" +" Exit Status:\n" +" Returns success unless a SIGSPEC is invalid or an invalid option is " +"given." +msgstr "" + +#: builtins.c:1386 +msgid "" +"Display information about command type.\n" +" \n" +" For each NAME, indicate how it would be interpreted if used as a\n" +" command name.\n" +" \n" +" Options:\n" +" -a\tdisplay all locations containing an executable named NAME;\n" +" \tincludes aliases, builtins, and functions, if and only if\n" +" \tthe `-p' option is not also used\n" +" -f\tsuppress shell function lookup\n" +" -P\tforce a PATH search for each NAME, even if it is an alias,\n" +" \tbuiltin, or function, and returns the name of the disk file\n" +" \tthat would be executed\n" +" -p\treturns either the name of the disk file that would be executed,\n" +" \tor nothing if `type -t NAME' would not return `file'.\n" +" -t\toutput a single word which is one of `alias', `keyword',\n" +" \t`function', `builtin', `file' or `', if NAME is an alias, shell\n" +" \treserved word, shell function, shell builtin, disk file, or not\n" +" \tfound, respectively\n" +" \n" +" Arguments:\n" +" NAME\tCommand name to be interpreted.\n" +" \n" +" Exit Status:\n" +" Returns success if all of the NAMEs are found; fails if any are not " +"found." +msgstr "" + +#: builtins.c:1417 +msgid "" +"Modify shell resource limits.\n" +" \n" +" Provides control over the resources available to the shell and " +"processes\n" +" it creates, on systems that allow such control.\n" +" \n" +" Options:\n" +" -S\tuse the `soft' resource limit\n" +" -H\tuse the `hard' resource limit\n" +" -a\tall current limits are reported\n" +" -b\tthe socket buffer size\n" +" -c\tthe maximum size of core files created\n" +" -d\tthe maximum size of a process's data segment\n" +" -e\tthe maximum scheduling priority (`nice')\n" +" -f\tthe maximum size of files written by the shell and its children\n" +" -i\tthe maximum number of pending signals\n" +" -l\tthe maximum size a process may lock into memory\n" +" -m\tthe maximum resident set size\n" +" -n\tthe maximum number of open file descriptors\n" +" -p\tthe pipe buffer size\n" +" -q\tthe maximum number of bytes in POSIX message queues\n" +" -r\tthe maximum real-time scheduling priority\n" +" -s\tthe maximum stack size\n" +" -t\tthe maximum amount of cpu time in seconds\n" +" -u\tthe maximum number of user processes\n" +" -v\tthe size of virtual memory\n" +" -x\tthe maximum number of file locks\n" +" -T the maximum number of threads\n" +" \n" +" Not all options are available on all platforms.\n" +" \n" +" If LIMIT is given, it is the new value of the specified resource; the\n" +" special LIMIT values `soft', `hard', and `unlimited' stand for the\n" +" current soft limit, the current hard limit, and no limit, respectively.\n" +" Otherwise, the current value of the specified resource is printed. If\n" +" no option is given, then -f is assumed.\n" +" \n" +" Values are in 1024-byte increments, except for -t, which is in seconds,\n" +" -p, which is in increments of 512 bytes, and -u, which is an unscaled\n" +" number of processes.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1465 +msgid "" +"Display or set file mode mask.\n" +" \n" +" Sets the user file-creation mask to MODE. If MODE is omitted, prints\n" +" the current value of the mask.\n" +" \n" +" If MODE begins with a digit, it is interpreted as an octal number;\n" +" otherwise it is a symbolic mode string like that accepted by chmod(1).\n" +" \n" +" Options:\n" +" -p\tif MODE is omitted, output in a form that may be reused as input\n" +" -S\tmakes the output symbolic; otherwise an octal number is output\n" +" \n" +" Exit Status:\n" +" Returns success unless MODE is invalid or an invalid option is given." +msgstr "" + +#: builtins.c:1485 +msgid "" +"Wait for job completion and return exit status.\n" +" \n" +" Waits for each process identified by an ID, which may be a process ID or " +"a\n" +" job specification, and reports its termination status. If ID is not\n" +" given, waits for all currently active child processes, and the return\n" +" status is zero. If ID is a a job specification, waits for all " +"processes\n" +" in that job's pipeline.\n" +" \n" +" If the -n option is supplied, waits for the next job to terminate and\n" +" returns its exit status.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last ID; fails if ID is invalid or an invalid\n" +" option is given." +msgstr "" + +#: builtins.c:1506 +msgid "" +"Wait for process completion and return exit status.\n" +" \n" +" Waits for each process specified by a PID and reports its termination " +"status.\n" +" If PID is not given, waits for all currently active child processes,\n" +" and the return status is zero. PID must be a process ID.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last PID; fails if PID is invalid or an " +"invalid\n" +" option is given." +msgstr "" + +#: builtins.c:1521 +msgid "" +"Execute commands for each member in a list.\n" +" \n" +" The `for' loop executes a sequence of commands for each member in a\n" +" list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is\n" +" assumed. For each element in WORDS, NAME is set to that element, and\n" +" the COMMANDS are executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1535 +msgid "" +"Arithmetic for loop.\n" +" \n" +" Equivalent to\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n" +" omitted, it behaves as if it evaluates to 1.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1553 +msgid "" +"Select words from a list and execute commands.\n" +" \n" +" The WORDS are expanded, generating a list of words. The\n" +" set of expanded words is printed on the standard error, each\n" +" preceded by a number. If `in WORDS' is not present, `in \"$@\"'\n" +" is assumed. The PS3 prompt is then displayed and a line read\n" +" from the standard input. If the line consists of the number\n" +" corresponding to one of the displayed words, then NAME is set\n" +" to that word. If the line is empty, WORDS and the prompt are\n" +" redisplayed. If EOF is read, the command completes. Any other\n" +" value read causes NAME to be set to null. The line read is saved\n" +" in the variable REPLY. COMMANDS are executed after each selection\n" +" until a break command is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1574 +msgid "" +"Report time consumed by pipeline's execution.\n" +" \n" +" Execute PIPELINE and print a summary of the real time, user CPU time,\n" +" and system CPU time spent executing PIPELINE when it terminates.\n" +" \n" +" Options:\n" +" -p\tprint the timing summary in the portable Posix format\n" +" \n" +" The value of the TIMEFORMAT variable is used as the output format.\n" +" \n" +" Exit Status:\n" +" The return status is the return status of PIPELINE." +msgstr "" + +#: builtins.c:1591 +msgid "" +"Execute commands based on pattern matching.\n" +" \n" +" Selectively execute COMMANDS based upon WORD matching PATTERN. The\n" +" `|' is used to separate multiple patterns.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1603 +msgid "" +"Execute commands based on conditional.\n" +" \n" +" The `if COMMANDS' list is executed. If its exit status is zero, then " +"the\n" +" `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list " +"is\n" +" executed in turn, and if its exit status is zero, the corresponding\n" +" `then COMMANDS' list is executed and the if command completes. " +"Otherwise,\n" +" the `else COMMANDS' list is executed, if present. The exit status of " +"the\n" +" entire construct is the exit status of the last command executed, or " +"zero\n" +" if no condition tested true.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1620 +msgid "" +"Execute commands as long as a test succeeds.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `while' COMMANDS has an exit status of zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1632 +msgid "" +"Execute commands as long as a test does not succeed.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `until' COMMANDS has an exit status which is not zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1644 +msgid "" +"Create a coprocess named NAME.\n" +" \n" +" Execute COMMAND asynchronously, with the standard output and standard\n" +" input of the command connected via a pipe to file descriptors assigned\n" +" to indices 0 and 1 of an array variable NAME in the executing shell.\n" +" The default NAME is \"COPROC\".\n" +" \n" +" Exit Status:\n" +" Returns the exit status of COMMAND." +msgstr "" + +#: builtins.c:1658 +msgid "" +"Define shell function.\n" +" \n" +" Create a shell function named NAME. When invoked as a simple command,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is " +"invoked,\n" +" the arguments are passed to the function as $1...$n, and the function's\n" +" name is in $FUNCNAME.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is readonly." +msgstr "" + +#: builtins.c:1672 +msgid "" +"Group commands as a unit.\n" +" \n" +" Run a set of commands in a group. This is one way to redirect an\n" +" entire set of commands.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1684 +msgid "" +"Resume job in foreground.\n" +" \n" +" Equivalent to the JOB_SPEC argument to the `fg' command. Resume a\n" +" stopped or background job. JOB_SPEC can specify either a job name\n" +" or a job number. Following JOB_SPEC with a `&' places the job in\n" +" the background, as if the job specification had been supplied as an\n" +" argument to `bg'.\n" +" \n" +" Exit Status:\n" +" Returns the status of the resumed job." +msgstr "" + +#: builtins.c:1699 +msgid "" +"Evaluate arithmetic expression.\n" +" \n" +" The EXPRESSION is evaluated according to the rules for arithmetic\n" +" evaluation. Equivalent to \"let EXPRESSION\".\n" +" \n" +" Exit Status:\n" +" Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise." +msgstr "" + +#: builtins.c:1711 +msgid "" +"Execute conditional command.\n" +" \n" +" Returns a status of 0 or 1 depending on the evaluation of the " +"conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries " +"used\n" +" by the `test' builtin, and may be combined using the following " +"operators:\n" +" \n" +" ( EXPRESSION )\tReturns the value of EXPRESSION\n" +" ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" +" EXPR1 && EXPR2\tTrue if both EXPR1 and EXPR2 are true; else false\n" +" EXPR1 || EXPR2\tTrue if either EXPR1 or EXPR2 is true; else false\n" +" \n" +" When the `==' and `!=' operators are used, the string to the right of\n" +" the operator is used as a pattern and pattern matching is performed.\n" +" When the `=~' operator is used, the string to the right of the operator\n" +" is matched as a regular expression.\n" +" \n" +" The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n" +" determine the expression's value.\n" +" \n" +" Exit Status:\n" +" 0 or 1 depending on value of EXPRESSION." +msgstr "" + +#: builtins.c:1737 +msgid "" +"Common shell variable names and usage.\n" +" \n" +" BASH_VERSION\tVersion information for this Bash.\n" +" CDPATH\tA colon-separated list of directories to search\n" +" \t\tfor directories given as arguments to `cd'.\n" +" GLOBIGNORE\tA colon-separated list of patterns describing filenames to\n" +" \t\tbe ignored by pathname expansion.\n" +" HISTFILE\tThe name of the file where your command history is stored.\n" +" HISTFILESIZE\tThe maximum number of lines this file can contain.\n" +" HISTSIZE\tThe maximum number of history lines that a running\n" +" \t\tshell can access.\n" +" HOME\tThe complete pathname to your login directory.\n" +" HOSTNAME\tThe name of the current host.\n" +" HOSTTYPE\tThe type of CPU this version of Bash is running under.\n" +" IGNOREEOF\tControls the action of the shell on receipt of an EOF\n" +" \t\tcharacter as the sole input. If set, then the value\n" +" \t\tof it is the number of EOF characters that can be seen\n" +" \t\tin a row on an empty line before the shell will exit\n" +" \t\t(default 10). When unset, EOF signifies the end of input.\n" +" MACHTYPE\tA string describing the current system Bash is running on.\n" +" MAILCHECK\tHow often, in seconds, Bash checks for new mail.\n" +" MAILPATH\tA colon-separated list of filenames which Bash checks\n" +" \t\tfor new mail.\n" +" OSTYPE\tThe version of Unix this version of Bash is running on.\n" +" PATH\tA colon-separated list of directories to search when\n" +" \t\tlooking for commands.\n" +" PROMPT_COMMAND\tA command to be executed before the printing of each\n" +" \t\tprimary prompt.\n" +" PS1\t\tThe primary prompt string.\n" +" PS2\t\tThe secondary prompt string.\n" +" PWD\t\tThe full pathname of the current directory.\n" +" SHELLOPTS\tA colon-separated list of enabled shell options.\n" +" TERM\tThe name of the current terminal type.\n" +" TIMEFORMAT\tThe output format for timing statistics displayed by the\n" +" \t\t`time' reserved word.\n" +" auto_resume\tNon-null means a command word appearing on a line by\n" +" \t\titself is first looked for in the list of currently\n" +" \t\tstopped jobs. If found there, that job is foregrounded.\n" +" \t\tA value of `exact' means that the command word must\n" +" \t\texactly match a command in the list of stopped jobs. A\n" +" \t\tvalue of `substring' means that the command word must\n" +" \t\tmatch a substring of the job. Any other value means that\n" +" \t\tthe command must be a prefix of a stopped job.\n" +" histchars\tCharacters controlling history expansion and quick\n" +" \t\tsubstitution. The first character is the history\n" +" \t\tsubstitution character, usually `!'. The second is\n" +" \t\tthe `quick substitution' character, usually `^'. The\n" +" \t\tthird is the `history comment' character, usually `#'.\n" +" HISTIGNORE\tA colon-separated list of patterns used to decide which\n" +" \t\tcommands should be saved on the history list.\n" +msgstr "" + +#: builtins.c:1794 +msgid "" +"Add directories to stack.\n" +" \n" +" Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" + +#: builtins.c:1828 +msgid "" +"Remove directories from stack.\n" +" \n" +" Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" + +#: builtins.c:1858 +msgid "" +"Display directory stack.\n" +" \n" +" Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1887 +msgid "" +"Set and unset shell options.\n" +" \n" +" Change the setting of each shell option OPTNAME. Without any option\n" +" arguments, list all shell options with an indication of whether or not " +"each\n" +" is set.\n" +" \n" +" Options:\n" +" -o\trestrict OPTNAMEs to those defined for use with `set -o'\n" +" -p\tprint each shell option with an indication of its status\n" +" -q\tsuppress output\n" +" -s\tenable (set) each OPTNAME\n" +" -u\tdisable (unset) each OPTNAME\n" +" \n" +" Exit Status:\n" +" Returns success if OPTNAME is enabled; fails if an invalid option is\n" +" given or OPTNAME is disabled." +msgstr "" + +#: builtins.c:1908 +msgid "" +"Formats and prints ARGUMENTS under control of the FORMAT.\n" +" \n" +" Options:\n" +" -v var\tassign the output to shell variable VAR rather than\n" +" \t\tdisplay it on the standard output\n" +" \n" +" FORMAT is a character string which contains three types of objects: " +"plain\n" +" characters, which are simply copied to standard output; character " +"escape\n" +" sequences, which are converted and copied to the standard output; and\n" +" format specifications, each of which causes printing of the next " +"successive\n" +" argument.\n" +" \n" +" In addition to the standard format specifications described in " +"printf(1),\n" +" printf interprets:\n" +" \n" +" %b\texpand backslash escape sequences in the corresponding argument\n" +" %q\tquote the argument in a way that can be reused as shell input\n" +" %(fmt)T output the date-time string resulting from using FMT as a " +"format\n" +" string for strftime(3)\n" +" \n" +" The format is re-used as necessary to consume all of the arguments. If\n" +" there are fewer arguments than the format requires, extra format\n" +" specifications behave as if a zero value or null string, as " +"appropriate,\n" +" had been supplied.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a write or " +"assignment\n" +" error occurs." +msgstr "" + +#: builtins.c:1942 +msgid "" +"Specify how arguments are to be completed by Readline.\n" +" \n" +" For each NAME, specify how arguments are to be completed. If no " +"options\n" +" are supplied, existing completion specifications are printed in a way " +"that\n" +" allows them to be reused as input.\n" +" \n" +" Options:\n" +" -p\tprint existing completion specifications in a reusable format\n" +" -r\tremove a completion specification for each NAME, or, if no\n" +" \tNAMEs are supplied, all completion specifications\n" +" -D\tapply the completions and actions as the default for commands\n" +" \twithout any specific completion defined\n" +" -E\tapply the completions and actions to \"empty\" commands --\n" +" \tcompletion attempted on a blank line\n" +" \n" +" When completion is attempted, the actions are applied in the order the\n" +" uppercase-letter options are listed above. The -D option takes\n" +" precedence over -E.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1970 +msgid "" +"Display possible completions depending on the options.\n" +" \n" +" Intended to be used from within a shell function generating possible\n" +" completions. If the optional WORD argument is supplied, matches " +"against\n" +" WORD are generated.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1985 +msgid "" +"Modify or display completion options.\n" +" \n" +" Modify the completion options for each NAME, or, if no NAMEs are " +"supplied,\n" +" the completion currently being executed. If no OPTIONs are given, " +"print\n" +" the completion options for each NAME or the current completion " +"specification.\n" +" \n" +" Options:\n" +" \t-o option\tSet completion option OPTION for each NAME\n" +" \t-D\t\tChange options for the \"default\" command completion\n" +" \t-E\t\tChange options for the \"empty\" command completion\n" +" \n" +" Using `+o' instead of `-o' turns off the specified option.\n" +" \n" +" Arguments:\n" +" \n" +" Each NAME refers to a command for which a completion specification must\n" +" have previously been defined using the `complete' builtin. If no NAMEs\n" +" are supplied, compopt must be called by a function currently generating\n" +" completions, and the options for that currently-executing completion\n" +" generator are modified.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or NAME does not\n" +" have a completion specification defined." +msgstr "" + +#: builtins.c:2015 +msgid "" +"Read lines from the standard input into an indexed array variable.\n" +" \n" +" Read lines from the standard input into the indexed array variable " +"ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable " +"MAPFILE\n" +" is the default ARRAY.\n" +" \n" +" Options:\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are " +"copied.\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default " +"index is 0.\n" +" -s count \tDiscard the first COUNT lines read.\n" +" -t\t\tRemove a trailing newline from each line read.\n" +" -u fd\t\tRead lines from file descriptor FD instead of the standard " +"input.\n" +" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read.\n" +" -c quantum\tSpecify the number of lines read between each call to " +"CALLBACK.\n" +" \n" +" Arguments:\n" +" ARRAY\t\tArray variable name to use for file data.\n" +" \n" +" If -C is supplied without -c, the default quantum is 5000. When\n" +" CALLBACK is evaluated, it is supplied the index of the next array\n" +" element to be assigned and the line to be assigned to that element\n" +" as additional arguments.\n" +" \n" +" If not supplied with an explicit origin, mapfile will clear ARRAY " +"before\n" +" assigning to it.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or ARRAY is readonly " +"or\n" +" not an indexed array." +msgstr "" + +#: builtins.c:2049 +msgid "" +"Read lines from a file into an array variable.\n" +" \n" +" A synonym for `mapfile'." +msgstr "" diff --git a/po/bg.gmo b/po/bg.gmo new file mode 100644 index 0000000000000000000000000000000000000000..7721c82e864f2534d5ee41bdf1189bfbe5074f25 GIT binary patch literal 235979 zcmeFa2Y6jqmG^xlC4`$oO+p})8)L_IVz~uEuv3t2*;ZmpiY2E(h_0k7>BiE%$}KJ- zgbtw&CG_3~2n2>YFfgCuz%xOzPVNut{f>YS z4cG#e|5LzwfiDH`2>v5j1V05T-yef_1%CR(l2gIcz*XRRAXz6<;AZeSpvv)i za1;1zQ2B4%=r{l>-Wa$Hd?Kjwya5!yJ^+fITfwuy--AVPJvXO=7Y95DD&Lm|{0yk_ z|98NX?w2I6I5`s(->v|a-yu-+ya+r6d@HE(d=gZ?KLGCv-tPV${vM$2&jarSUJNSS zIH-7!1Wy8A1d5)wg!^v?{0(>)p5Ni@B?7PuT#I@`h3-~@ON@TuU*;A=tU|32_;;O9Y==ifk;$#+5V;p7MU{YFr9Pk@U57*KNcoN)iQpwf94 zD0)5%-W~h_cna8!(1`w1LFIEcC_1-+N_QNT96UNae;p`(ek9;GK=I+{pxV#95K4t# z10ov92q=C%0X!9a6)3*GA3P5H5~%Rs0#z@!KiAW_J1BZqfujFx5R#MKpqlm*z%KCh z;r-3vow>gSRJvaVzuA){-v)PrAAFGW<+yE*r-BN1Cb*r19sr8|>-+uvQ^Di8e=(?V zH-T#B?+EyQ@V}2vl8=L`-;ZCEB=1I%+zQ^F`xjh-P6A&U@JnEce2%#k*#Ik-Q6K23 z)mJ3RmE89|BuPFBoiDvINk(}-Q-aS&p&ura8JS<6?yuTaxGwz>qeUkh;=|18S$P5LZ zeO!{fgy%iaOp5RP~Nm{%gc_F$5{Md_- zS@PLWVh6Y%d*3dflFN61-=qMa0q?>6n{IOa zICvNCzYBf>{0(?Ac+2ZO-q%2d{{>hC@Aw9<$MxXtxIYgRAGU$2&rwkI_t1d#@ci+h z!ap4x1fL5&0e*ZByd!i~-$eVRK-a$&S*Lt2`v=knKlN^OGvSZ>N0+BMxP@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|qBTbv@!QbHz{5VIC>4sjWZRn5=N8CHn3ilu<}UvA z6_@g8t!4G$ruRDZ42sNr1hCZ7!7wJlg?W29?_2JDyhxsV zabw8?<2tfo`CFf5JMq@W_Rg|=u^VSO#GmI$Ge@lgNA=@+WQ+E8w68QAOF~Didnnt} T`@~9>fY!bnYiV, 2007, 2010, 2012, 2013, 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: bash 4.3-rc2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-01-23 16:04-0500\n" +"PO-Revision-Date: 2014-02-12 07:59+0200\n" +"Last-Translator: Alexander Shopov \n" +"Language-Team: Bulgarian \n" +"Language: bg\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: arrayfunc.c:51 +msgid "bad array subscript" +msgstr "грешен индекс на масив" + +#: arrayfunc.c:356 builtins/declare.def:566 +#, c-format +msgid "%s: cannot convert indexed to associative array" +msgstr "%s: масивът не може да бъде преобразуван към речник" + +#: arrayfunc.c:539 +#, c-format +msgid "%s: invalid associative array key" +msgstr "%s: грешно име на ключ в речник" + +#: arrayfunc.c:541 +#, c-format +msgid "%s: cannot assign to non-numeric index" +msgstr "%s: не може да се присвоява на нецифров индекс" + +#: arrayfunc.c:586 +#, c-format +msgid "%s: %s: must use subscript when assigning associative array" +msgstr "%s: %s: при присвояване към речник трябва да се използва индекс" + +#: bashhist.c:388 +#, c-format +msgid "%s: cannot create: %s" +msgstr "%s: не може да се създаде: %s" + +#: bashline.c:3971 +msgid "bash_execute_unix_command: cannot find keymap for command" +msgstr "" +"изпълнение на команда на Юникс от bash: не може да се открие подредбата на\n" +"функциите на клавишите за командата" + +#: bashline.c:4058 +#, c-format +msgid "%s: first non-whitespace character is not `\"'" +msgstr "%s: първият непразен знак не е „\"“" + +#: bashline.c:4087 +#, c-format +msgid "no closing `%c' in %s" +msgstr "в %2$s липсва затварящ знак „%1$c“" + +#: bashline.c:4121 +#, c-format +msgid "%s: missing colon separator" +msgstr "%s: разделителят „:“ липсва" + +#: braces.c:321 +#, c-format +msgid "brace expansion: cannot allocate memory for %s" +msgstr "заместване на изразите с фигурни скоби: не може да се задели памет за „%s“" + +#: braces.c:413 +#, c-format +msgid "brace expansion: failed to allocate memory for %d elements" +msgstr "заместване на изразите с фигурни скоби: не може да се задели памет за %d елемента" + +#: braces.c:452 +#, c-format +msgid "brace expansion: failed to allocate memory for `%s'" +msgstr "заместване на изразите с фигурни скоби: не може да се задели памет за „%s“" + +#: builtins/alias.def:132 +#, c-format +msgid "`%s': invalid alias name" +msgstr "„%s“: грешно име на синоним" + +#: builtins/bind.def:123 builtins/bind.def:126 +msgid "line editing not enabled" +msgstr "редактирането на командния ред не е включено" + +#: builtins/bind.def:212 +#, c-format +msgid "`%s': invalid keymap name" +msgstr "„%s“: грешно име на подредбата на функциите на клавишите" + +#: builtins/bind.def:251 +#, c-format +msgid "%s: cannot read: %s" +msgstr "%s: не може да се прочете: %s" + +#: builtins/bind.def:266 +#, c-format +msgid "`%s': cannot unbind" +msgstr "„%s“: не може да се премахне присвояване" + +#: builtins/bind.def:304 builtins/bind.def:334 +#, c-format +msgid "`%s': unknown function name" +msgstr "„%s“: име на непозната функция" + +#: builtins/bind.def:312 +#, c-format +msgid "%s is not bound to any keys.\n" +msgstr "%s не е зададена на никой клавиш.\n" + +#: builtins/bind.def:316 +#, c-format +msgid "%s can be invoked via " +msgstr "%s може да се извика чрез " + +#: builtins/break.def:77 builtins/break.def:117 +msgid "loop count" +msgstr "брой цикли" + +#: builtins/break.def:137 +msgid "only meaningful in a `for', `while', or `until' loop" +msgstr "валидно само за циклите с „for“, „while“ и „until“" + +#: builtins/caller.def:134 +msgid "" +"Returns the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns " +msgstr "" +"Връща контекста на текущото извикване на функция.\n" +" \n" +" Без ИЗРАЗ връща " + +#: builtins/cd.def:319 +msgid "HOME not set" +msgstr "Променливата „HOME“ не е зададена" + +#: builtins/cd.def:327 builtins/common.c:166 test.c:855 +msgid "too many arguments" +msgstr "прекалено много аргументи" + +#: builtins/cd.def:338 +msgid "OLDPWD not set" +msgstr "Променливата „OLDPWD“ не е зададена" + +#: builtins/common.c:101 +#, c-format +msgid "line %d: " +msgstr "ред %d: " + +#: builtins/common.c:139 error.c:265 +#, c-format +msgid "warning: " +msgstr "предупреждение: " + +#: builtins/common.c:153 +#, c-format +msgid "%s: usage: " +msgstr "%s: употреба: " + +#: builtins/common.c:191 shell.c:506 shell.c:788 +#, c-format +msgid "%s: option requires an argument" +msgstr "%s: опцията изисква аргумент" + +#: builtins/common.c:198 +#, c-format +msgid "%s: numeric argument required" +msgstr "%s: изисква се числов аргумент" + +#: builtins/common.c:205 +#, c-format +msgid "%s: not found" +msgstr "%s: не е открит" + +#: builtins/common.c:214 shell.c:801 +#, c-format +msgid "%s: invalid option" +msgstr "%s: грешна опция" + +#: builtins/common.c:221 +#, c-format +msgid "%s: invalid option name" +msgstr "%s: грешно име на опция" + +#: builtins/common.c:228 general.c:234 general.c:239 +#, c-format +msgid "`%s': not a valid identifier" +msgstr "„%s“: грешен идентификатор" + +#: builtins/common.c:238 +msgid "invalid octal number" +msgstr "грешно осмично число" + +#: builtins/common.c:240 +msgid "invalid hex number" +msgstr "грешно шестнайсетично число" + +#: builtins/common.c:242 expr.c:1470 +msgid "invalid number" +msgstr "грешно число" + +#: builtins/common.c:250 +#, c-format +msgid "%s: invalid signal specification" +msgstr "%s: грешно указване на сигнал" + +#: builtins/common.c:257 +#, c-format +msgid "`%s': not a pid or valid job spec" +msgstr "„%s“: грешен идентификатор на процес или задача" + +#: builtins/common.c:264 error.c:488 +#, c-format +msgid "%s: readonly variable" +msgstr "%s: променлива с права само за четене" + +#: builtins/common.c:272 +#, c-format +msgid "%s: %s out of range" +msgstr "%s: %s е извън допустимия диапазон" + +#: builtins/common.c:272 builtins/common.c:274 +msgid "argument" +msgstr "аргументът" + +#: builtins/common.c:274 +#, c-format +msgid "%s out of range" +msgstr "%s е извън допустимия диапазон" + +#: builtins/common.c:282 +#, c-format +msgid "%s: no such job" +msgstr "%s: няма такава задача" + +#: builtins/common.c:290 +#, c-format +msgid "%s: no job control" +msgstr "%s: няма управление на задачите" + +#: builtins/common.c:292 +msgid "no job control" +msgstr "няма управление на задачите" + +#: builtins/common.c:302 +#, c-format +msgid "%s: restricted" +msgstr "%s: ограничена обвивка" + +#: builtins/common.c:304 +msgid "restricted" +msgstr "ограничена обвивка" + +#: builtins/common.c:312 +#, c-format +msgid "%s: not a shell builtin" +msgstr "%s: не е команда вградена в обвивката" + +#: builtins/common.c:321 +#, c-format +msgid "write error: %s" +msgstr "грешка при запис: %s" + +#: builtins/common.c:329 +#, c-format +msgid "error setting terminal attributes: %s" +msgstr "грешка при задаване на атрибутите на терминала: %s" + +#: builtins/common.c:331 +#, c-format +msgid "error getting terminal attributes: %s" +msgstr "грешка при получаване на атрибутите на терминала: %s" + +#: builtins/common.c:563 +#, c-format +msgid "%s: error retrieving current directory: %s: %s\n" +msgstr "%s: грешка при получаване на текущата директория: %s: %s\n" + +#: builtins/common.c:629 builtins/common.c:631 +#, c-format +msgid "%s: ambiguous job spec" +msgstr "%s: нееднозначно указана задача" + +#: builtins/complete.def:277 +#, c-format +msgid "%s: invalid action name" +msgstr "%s: грешно име на действие" + +#: builtins/complete.def:450 builtins/complete.def:645 +#: builtins/complete.def:855 +#, c-format +msgid "%s: no completion specification" +msgstr "%s: не е указано дописване" + +#: builtins/complete.def:697 +msgid "warning: -F option may not work as you expect" +msgstr "предупреждение: опцията „-F“ може да не работи според очакванията ви" + +#: builtins/complete.def:699 +msgid "warning: -C option may not work as you expect" +msgstr "предупреждение: опцията „-C“ може да не работи според очакванията ви" + +#: builtins/complete.def:828 +msgid "not currently executing completion function" +msgstr "в момента не се изпълнява функция за дописване" + +#: builtins/declare.def:126 +msgid "can only be used in a function" +msgstr "може да се използва само във функция" + +#: builtins/declare.def:315 builtins/declare.def:509 +#, c-format +msgid "%s: reference variable cannot be an array" +msgstr "%s: променливата-указател не може да е масив" + +#: builtins/declare.def:324 +#, c-format +msgid "%s: nameref variable self references not allowed" +msgstr "%s: променливата-указател не може да сочи към себе си" + +#: builtins/declare.def:398 +msgid "cannot use `-f' to make functions" +msgstr "„-f“ не може да се използва за създаването на функции" + +#: builtins/declare.def:410 execute_cmd.c:5349 +#, c-format +msgid "%s: readonly function" +msgstr "%s: функция с права само за четене" + +#: builtins/declare.def:553 +#, c-format +msgid "%s: cannot destroy array variables in this way" +msgstr "%s: променливите за масиви не могат да се унищожават така" + +#: builtins/declare.def:560 builtins/read.def:733 +#, c-format +msgid "%s: cannot convert associative to indexed array" +msgstr "%s: речник не може да се преобразува в масив" + +#: builtins/enable.def:137 builtins/enable.def:145 +msgid "dynamic loading not available" +msgstr "липсва възможност за динамично зареждане" + +#: builtins/enable.def:312 +#, c-format +msgid "cannot open shared object %s: %s" +msgstr "споделеният обект „%s“ не може да бъде зареден: %s" + +#: builtins/enable.def:335 +#, c-format +msgid "cannot find %s in shared object %s: %s" +msgstr "„%s“ не може да се открие в споделения обект %s: %s" + +#: builtins/enable.def:459 +#, c-format +msgid "%s: not dynamically loaded" +msgstr "%s: не е зареден динамично" + +#: builtins/enable.def:474 +#, c-format +msgid "%s: cannot delete: %s" +msgstr "%s: не може да се изтрие: %s" + +#: builtins/evalfile.c:140 builtins/hash.def:171 execute_cmd.c:5196 +#: shell.c:1481 +#, c-format +msgid "%s: is a directory" +msgstr "%s: е директория" + +#: builtins/evalfile.c:146 +#, c-format +msgid "%s: not a regular file" +msgstr "%s: не е обикновен файл" + +#: builtins/evalfile.c:155 +#, c-format +msgid "%s: file is too large" +msgstr "%s: файлът е прекалено голям" + +#: builtins/evalfile.c:190 builtins/evalfile.c:208 shell.c:1491 +#, c-format +msgid "%s: cannot execute binary file" +msgstr "%s: двоичният файл не може да бъде изпълнен" + +#: builtins/exec.def:154 builtins/exec.def:156 builtins/exec.def:228 +#, c-format +msgid "%s: cannot execute: %s" +msgstr "%s: не може да се изпълни: %s" + +#: builtins/exit.def:65 +#, c-format +msgid "logout\n" +msgstr "изход\n" + +#: builtins/exit.def:88 +msgid "not login shell: use `exit'" +msgstr "това не е входна обвивка: използвайте „exit“" + +#: builtins/exit.def:120 +#, c-format +msgid "There are stopped jobs.\n" +msgstr "Има спрени задачи.\n" + +#: builtins/exit.def:122 +#, c-format +msgid "There are running jobs.\n" +msgstr "Има изпълнявани задачи.\n" + +#: builtins/fc.def:262 +msgid "no command found" +msgstr "не е открита команда" + +#: builtins/fc.def:320 builtins/fc.def:369 +msgid "history specification" +msgstr "указване на историята" + +#: builtins/fc.def:390 +#, c-format +msgid "%s: cannot open temp file: %s" +msgstr "%s: не може да се отвори временен файл: %s" + +#: builtins/fg_bg.def:149 builtins/jobs.def:282 +msgid "current" +msgstr "текуща" + +#: builtins/fg_bg.def:158 +#, c-format +msgid "job %d started without job control" +msgstr "задача %d е стартирана без управление на задачите" + +#: builtins/getopt.c:110 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: непозволена опция — %c\n" + +#: builtins/getopt.c:111 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: опцията изисква аргумент — %c\n" + +#: builtins/hash.def:92 +msgid "hashing disabled" +msgstr "хеширането е изключено" + +#: builtins/hash.def:138 +#, c-format +msgid "%s: hash table empty\n" +msgstr "%s: таблицата с хешове е празна\n" + +#: builtins/hash.def:245 +#, c-format +msgid "hits\tcommand\n" +msgstr "съвпад.\tкоманда\n" + +#: builtins/help.def:130 +#, c-format +msgid "Shell commands matching keyword `" +msgid_plural "Shell commands matching keywords `" +msgstr[0] "Команди на обвивката, които напасват на ключовата дума „" +msgstr[1] "Команди на обвивката, които напасват на ключовите думи „" + +#: builtins/help.def:182 +#, c-format +msgid "no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." +msgstr "" +"няма теми в помощта, които да отговарят на „%s“. Опитайте с\n" +"„help help“, „man -k %s“ или „info %s“." + +#: builtins/help.def:199 +#, c-format +msgid "%s: cannot open: %s" +msgstr "%s: не може да се отвори: %s" + +#: builtins/help.def:485 +#, c-format +msgid "" +"These shell commands are defined internally. Type `help' to see this list.\n" +"Type `help name' to find out more about the function `name'.\n" +"Use `info bash' to find out more about the shell in general.\n" +"Use `man -k' or `info' to find out more about commands not in this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" +msgstr "" +"Тези команди на интерпретатора са дефинирани вътрешно.\n" +"Напишете „help“, за да видите списъка.\n" +"Напишете „help ИМЕ_НА_ФУНКЦИЯ“ за повече информация за съответната функция.\n" +"Напишете „info bash“ за повече информация за обвивката като цяло.\n" +"Напишете „man -k“ или „info“ за повече информация за командите извън списъка.\n" +"\n" +"Знакът звездичка „*“ до името на команда означава, че тя е изключена.\n" +"\n" + +#: builtins/history.def:154 +msgid "cannot use more than one of -anrw" +msgstr "не може да се ползва едновременно повече от една от опциите „-anrw“" + +#: builtins/history.def:186 +msgid "history position" +msgstr "позиция в историята" + +#: builtins/history.def:366 +#, c-format +msgid "%s: history expansion failed" +msgstr "%s: неуспешно заместване чрез историята" + +#: builtins/inlib.def:71 +#, c-format +msgid "%s: inlib failed" +msgstr "%s: неуспешно извикване на inlib" + +#: builtins/jobs.def:109 +msgid "no other options allowed with `-x'" +msgstr "не е позволена друга опция с „-x“" + +#: builtins/kill.def:200 +#, c-format +msgid "%s: arguments must be process or job IDs" +msgstr "%s: аргументите трябва да са идентификатори на процеси или задачи" + +#: builtins/kill.def:263 +msgid "Unknown error" +msgstr "Неизвестна грешка" + +#: builtins/let.def:95 builtins/let.def:120 expr.c:583 expr.c:598 +msgid "expression expected" +msgstr "очаква се израз" + +#: builtins/mapfile.def:172 +#, c-format +msgid "%s: not an indexed array" +msgstr "%s: не е масив" + +#: builtins/mapfile.def:259 builtins/read.def:302 +#, c-format +msgid "%s: invalid file descriptor specification" +msgstr "%s: грешно указване на файловия дескриптор" + +#: builtins/mapfile.def:267 builtins/read.def:309 +#, c-format +msgid "%d: invalid file descriptor: %s" +msgstr "%d: грешен файлов дескриптор: %s" + +#: builtins/mapfile.def:276 builtins/mapfile.def:314 +#, c-format +msgid "%s: invalid line count" +msgstr "%s: грешен номер на ред" + +#: builtins/mapfile.def:287 +#, c-format +msgid "%s: invalid array origin" +msgstr "%s: грешен начален индекс за масив" + +#: builtins/mapfile.def:304 +#, c-format +msgid "%s: invalid callback quantum" +msgstr "%s: грешно количество редове за обработка" + +#: builtins/mapfile.def:336 +msgid "empty array variable name" +msgstr "празно име на променлива за масив" + +#: builtins/mapfile.def:357 +msgid "array variable support required" +msgstr "изисква се поддръжка на променливи за масиви" + +#: builtins/printf.def:402 +#, c-format +msgid "`%s': missing format character" +msgstr "„%s“: липсва форматиращ знак" + +#: builtins/printf.def:456 +#, c-format +msgid "`%c': invalid time format specification" +msgstr "„%c“: грешен формат на времето" + +#: builtins/printf.def:658 +#, c-format +msgid "`%c': invalid format character" +msgstr "„%c“: грешен форматиращ знак" + +#: builtins/printf.def:684 +#, c-format +msgid "warning: %s: %s" +msgstr "предупреждение: %s: %s" + +#: builtins/printf.def:768 +#, c-format +msgid "format parsing problem: %s" +msgstr "неуспешен анализ на форма̀та: %s" + +#: builtins/printf.def:865 +msgid "missing hex digit for \\x" +msgstr "липсва шестнадесетична цифра за \\x" + +#: builtins/printf.def:880 +#, c-format +msgid "missing unicode digit for \\%c" +msgstr "липсва цифра за Уникод за \\%c" + +#: builtins/pushd.def:195 +msgid "no other directory" +msgstr "няма друга директория" + +#: builtins/pushd.def:354 +#, c-format +msgid "%s: invalid argument" +msgstr "%s: грешен аргумент" + +#: builtins/pushd.def:468 +msgid "" +msgstr "«няма текуща директория»" + +#: builtins/pushd.def:512 +msgid "directory stack empty" +msgstr "стекът с директории е празен" + +#: builtins/pushd.def:514 +msgid "directory stack index" +msgstr "индекс за стека с директории" + +#: builtins/pushd.def:689 +msgid "" +"Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown by\n" +"\tdirs when invoked without options, starting with zero." +msgstr "" +"Извежда списъка с текущо запомнените директории. Списъкът се попълва чрез\n" +" командата „pushd“. Можете да вадите директории от списъка с командата\n" +" „popd“.\n" +"\n" +" Опции:\n" +" -c изчиства стека на директориите като изтрива всички елементи.\n" +" -l кара командата „dirs“ да извежда пълните имена на директориите,\n" +" а не съкратените със тилда „~“.\n" +" -p поредово отпечатване на стека на директориите.\n" +" -v поредово отпечатване на стека на директориите заедно с номера в\n" +" стека.\n" +"\n" +" Аргументи: \n" +" +N извежда N-тия елемент отляво в списъка отпечатан от командата „dirs“,\n" +" когато е стартирана без опции. Брои се от 0.\n" +"\n" +" -N извежда N-тия елемент отдясно в списъка отпечатан от командата „dirs“,\n" +" когато е стартирана без опции. Брои се от 0." + +#: builtins/pushd.def:711 +msgid "" +"Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Добавя директория в стека на директориите или превърта стека\n" +" като най-горна директория става текущата директория. Без\n" +" аргументи сменя най-горните две директории.\n" +" \n" +" Опции:\n" +" -n подтискане на нормалното преминаване към директория при добавянето на\n" +" директории към стека, така че се променя само той.\n" +"\n" +" Аргументи:\n" +" +N Превърта стека, така че N-тата директория (като се брои от лявата\n" +" страна на списъка, отпечатан от командата „dirs“ като се почва от 0)\n" +" да е най-отгоре.\n" +" \n" +" -N Превърта стека, така че N-тата директория (като се брои от дясната\n" +" страна на списъка, отпечатан от командата „dirs“ като се почва от 0)\n" +" да е най-отгоре.\n" +"\n" +" dir Добавя ДИР най-отгоре в стека на директориите, като я прави новата\n" +" текуща работна директория.\n" +" \n" +" Можете да изведете стека на директорията с командата „dirs“." + +#: builtins/pushd.def:736 +msgid "" +"Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Маха директории от стека с тях. Без аргументи премахва последната директория в\n" +" стека и влиза в новата последна директория.\n" +"\n" +" Опции:\n" +" -n подтискане на нормалното преминаване към директория при махането на\n" +" директория от стека — само той се променя.\n" +"\n" +" Аргументи:\n" +" +N премахва N-тия елемент като се брои отляво в списъка отпечатан от\n" +" командата „dirs“, като се брои от 0. Напр.: „popd +0“ премахва\n" +" първата директория, „popd +1“ - втората.\n" +"\n" +" -N премахва N-тия елемент като се брои отдясно в списъка отпечатан от\n" +" командата „dirs“, като се брои от 0. Напр.: „popd -0“ премахва\n" +" последната директория, „popd -1“ - предпоследната.\n" +"\n" +" Можете да изведете стека на директорията с командата „dirs“." + +#: builtins/read.def:275 +#, c-format +msgid "%s: invalid timeout specification" +msgstr "%s: грешно указване на изтичането на времето" + +#: builtins/read.def:678 +#, c-format +msgid "read error: %d: %s" +msgstr "грешка при четене: %d: %s" + +#: builtins/return.def:75 +msgid "can only `return' from a function or sourced script" +msgstr "„return“ е възможен само от функция или изпълнен в текущата обвивка скрипт" + +#: builtins/set.def:782 +msgid "cannot simultaneously unset a function and a variable" +msgstr "не може едновременно да се премахват задаванията на функция и променлива" + +#: builtins/set.def:826 +#, c-format +msgid "%s: cannot unset" +msgstr "%s: не може да се премахне" + +#: builtins/set.def:843 +#, c-format +msgid "%s: cannot unset: readonly %s" +msgstr "%s: не може да се премахне: %s е само за четене" + +#: builtins/set.def:854 +#, c-format +msgid "%s: not an array variable" +msgstr "%s: не е променлива за масив" + +#: builtins/setattr.def:187 +#, c-format +msgid "%s: not a function" +msgstr "%s: не е функция" + +#: builtins/shift.def:71 builtins/shift.def:77 +msgid "shift count" +msgstr "брой на преместванията" + +#: builtins/shopt.def:279 +msgid "cannot set and unset shell options simultaneously" +msgstr "не може едновременно да се задават и да се премахват опции на обвивката" + +#: builtins/shopt.def:346 +#, c-format +msgid "%s: invalid shell option name" +msgstr "%s: грешно име на опция на обвивката" + +#: builtins/source.def:130 +msgid "filename argument required" +msgstr "изисква се аргумент име на файл" + +#: builtins/source.def:155 +#, c-format +msgid "%s: file not found" +msgstr "%s: файлът не е открит" + +#: builtins/suspend.def:101 +msgid "cannot suspend" +msgstr "не може да бъде временно спряна" + +#: builtins/suspend.def:111 +msgid "cannot suspend a login shell" +msgstr "входната обвивка не може да бъде временно спряна" + +#: builtins/type.def:234 +#, c-format +msgid "%s is aliased to `%s'\n" +msgstr "%s е синоним на „%s“\n" + +#: builtins/type.def:255 +#, c-format +msgid "%s is a shell keyword\n" +msgstr "%s е ключова дума на обвивката\n" + +#: builtins/type.def:274 +#, c-format +msgid "%s is a function\n" +msgstr "%s е функция\n" + +#: builtins/type.def:296 +#, c-format +msgid "%s is a shell builtin\n" +msgstr "%s е вградена команда в обвивката\n" + +#: builtins/type.def:317 builtins/type.def:393 +#, c-format +msgid "%s is %s\n" +msgstr "%s е %s\n" + +#: builtins/type.def:337 +#, c-format +msgid "%s is hashed (%s)\n" +msgstr "%s е хеширан (%s)\n" + +#: builtins/ulimit.def:383 +#, c-format +msgid "%s: invalid limit argument" +msgstr "%s: грешен аргумент за ограничение" + +#: builtins/ulimit.def:409 +#, c-format +msgid "`%c': bad command" +msgstr "„%c“: грешна команда" + +#: builtins/ulimit.def:438 +#, c-format +msgid "%s: cannot get limit: %s" +msgstr "%s: ограничението не може да бъде получено: %s" + +#: builtins/ulimit.def:464 +msgid "limit" +msgstr "ограничение" + +#: builtins/ulimit.def:476 builtins/ulimit.def:776 +#, c-format +msgid "%s: cannot modify limit: %s" +msgstr "%s: ограничението не може да бъде променено: %s" + +#: builtins/umask.def:114 +msgid "octal number" +msgstr "осмично число" + +#: builtins/umask.def:227 +#, c-format +msgid "`%c': invalid symbolic mode operator" +msgstr "„%c“: неправилен оператор за описателен режим" + +#: builtins/umask.def:282 +#, c-format +msgid "`%c': invalid symbolic mode character" +msgstr "„%c“: неправилен знак за описателен режим" + +#: error.c:90 error.c:325 error.c:327 error.c:329 +msgid " line " +msgstr " ред " + +#: error.c:165 +#, c-format +msgid "last command: %s\n" +msgstr "последна команда: %s\n" + +#: error.c:173 +#, c-format +msgid "Aborting..." +msgstr "Преустановяване…" + +#: error.c:440 +msgid "unknown command error" +msgstr "неизвестна грешка в команда" + +#: error.c:441 +msgid "bad command type" +msgstr "грешен вид команда" + +#: error.c:442 +msgid "bad connector" +msgstr "грешна връзка" + +#: error.c:443 +msgid "bad jump" +msgstr "грешен преход" + +#: error.c:481 +#, c-format +msgid "%s: unbound variable" +msgstr "%s: променлива без стойност" + +#: eval.c:189 +#, c-format +msgid "\atimed out waiting for input: auto-logout\n" +msgstr "\aвремето за изчакване на вход изтече: следва автоматично излизане от системата\n" + +#: execute_cmd.c:512 +#, c-format +msgid "cannot redirect standard input from /dev/null: %s" +msgstr "стандартният вход не може да бъде пренасочен от „/dev/null“: %s" + +#: execute_cmd.c:1233 +#, c-format +msgid "TIMEFORMAT: `%c': invalid format character" +msgstr "в променливата $TIMEFORMAT: „%c“: грешен форматиращ знак" + +#: execute_cmd.c:2287 +msgid "pipe error" +msgstr "грешка в програмен канал" + +#: execute_cmd.c:4374 +#, c-format +msgid "%s: maximum function nesting level exceeded (%d)" +msgstr "%s: превишено е максималното ниво на влагане на функции (%d)" + +#: execute_cmd.c:4872 +#, c-format +msgid "%s: restricted: cannot specify `/' in command names" +msgstr "%s: ограничение: в имената на командите не може да присъства знакът „/“" + +#: execute_cmd.c:4961 +#, c-format +msgid "%s: command not found" +msgstr "%s: командата не е открита" + +#: execute_cmd.c:5194 +#, c-format +msgid "%s: %s" +msgstr "%s: %s" + +#: execute_cmd.c:5231 +#, c-format +msgid "%s: %s: bad interpreter" +msgstr "%s: %s: лош интерпретатор" + +#: execute_cmd.c:5268 +#, c-format +msgid "%s: cannot execute binary file: %s" +msgstr "%s: двоичният файл не може да бъде изпълнен: %s" + +#: execute_cmd.c:5340 +#, c-format +msgid "`%s': is a special builtin" +msgstr "„%s“ е вградена команда в обвивката" + +#: execute_cmd.c:5392 +#, c-format +msgid "cannot duplicate fd %d to fd %d" +msgstr "файловият дескриптор %d не може да се дублира като дескриптор %d" + +#: expr.c:259 +msgid "expression recursion level exceeded" +msgstr "максималният брой нива за рекурсия в израз бяха преминати" + +#: expr.c:283 +msgid "recursion stack underflow" +msgstr "отрицателно препълване на стека за рекурсии" + +#: expr.c:431 +msgid "syntax error in expression" +msgstr "синтактична грешка в израз" + +#: expr.c:475 +msgid "attempted assignment to non-variable" +msgstr "опит за присвояване на стойност на нещо, което не е променлива" + +#: expr.c:495 expr.c:858 +msgid "division by 0" +msgstr "деление на 0" + +#: expr.c:542 +msgid "bug: bad expassign token" +msgstr "програмна грешка: неправилна лексема за присвояване на израз" + +#: expr.c:595 +msgid "`:' expected for conditional expression" +msgstr "за условен израз се изисква „:“" + +#: expr.c:919 +msgid "exponent less than 0" +msgstr "степента е по-малка от 0" + +#: expr.c:976 +msgid "identifier expected after pre-increment or pre-decrement" +msgstr "очаква се идентификатор след предварително увеличаване или намаляване" + +#: expr.c:1002 +msgid "missing `)'" +msgstr "липсва „)“" + +#: expr.c:1053 expr.c:1390 +msgid "syntax error: operand expected" +msgstr "синтактична грешка: очаква се оператор" + +#: expr.c:1392 +msgid "syntax error: invalid arithmetic operator" +msgstr "синтактична грешка: грешен аритметичен оператор" + +#: expr.c:1416 +#, c-format +msgid "%s%s%s: %s (error token is \"%s\")" +msgstr "%s%s%s: %s (грешната лексема е „%s“)" + +#: expr.c:1474 +msgid "invalid arithmetic base" +msgstr "грешна аритметична основа на бройна система" + +#: expr.c:1494 +msgid "value too great for base" +msgstr "стойността е прекалено голяма за основата" + +#: expr.c:1543 +#, c-format +msgid "%s: expression error\n" +msgstr "%s: грешка в израза\n" + +#: general.c:61 +msgid "getcwd: cannot access parent directories" +msgstr "getcwd: няма достъп до родителските директории" + +#: input.c:102 subst.c:5168 +#, c-format +msgid "cannot reset nodelay mode for fd %d" +msgstr "не може да се изчисти режимът без забавяне на файловия дескриптор %d" + +#: input.c:269 +#, c-format +msgid "cannot allocate new file descriptor for bash input from fd %d" +msgstr "не може да се задели нов файлов дескриптор за вход на bash от дескриптор %d" + +#: input.c:277 +#, c-format +msgid "save_bash_input: buffer already exists for new fd %d" +msgstr "запазване на входа на bash: вече съществува буфер за новия файлов дескриптор %d" + +#: jobs.c:471 +msgid "start_pipeline: pgrp pipe" +msgstr "" +"стартиране на програмен канал: не може да се комуникира с водача на канала\n" +"(pgrp pipe)" + +#: jobs.c:893 +#, c-format +msgid "forked pid %d appears in running job %d" +msgstr "стартираният процес %d е в работещата задача %d" + +#: jobs.c:1012 +#, c-format +msgid "deleting stopped job %d with process group %ld" +msgstr "изтриване на спряната задача %d в групата процеси %ld" + +#: jobs.c:1117 +#, c-format +msgid "add_process: process %5ld (%s) in the_pipeline" +msgstr "добавяне на процес: процесът %5ld (%s) е в програмния канал" + +#: jobs.c:1120 +#, c-format +msgid "add_process: pid %5ld (%s) marked as still alive" +msgstr "добавяне на процес: процесът %5ld (%s) е отбелязан като още жив" + +#: jobs.c:1435 +#, c-format +msgid "describe_pid: %ld: no such pid" +msgstr "описателен идентификатор на процес: %ld: няма такъв идентификатор на процес" + +#: jobs.c:1450 +#, c-format +msgid "Signal %d" +msgstr "Сигнал %d" + +#: jobs.c:1464 jobs.c:1489 +msgid "Done" +msgstr "Завършен" + +#: jobs.c:1469 siglist.c:123 +msgid "Stopped" +msgstr "Спрян" + +#: jobs.c:1473 +#, c-format +msgid "Stopped(%s)" +msgstr "Спрян (%s)" + +#: jobs.c:1477 +msgid "Running" +msgstr "Изпълняван" + +#: jobs.c:1491 +#, c-format +msgid "Done(%d)" +msgstr "Завършен (%d)" + +#: jobs.c:1493 +#, c-format +msgid "Exit %d" +msgstr "Изход %d" + +#: jobs.c:1496 +msgid "Unknown status" +msgstr "Непознато състояние" + +#: jobs.c:1583 +#, c-format +msgid "(core dumped) " +msgstr "(паметта е разтоварена)" + +#: jobs.c:1602 +#, c-format +msgid " (wd: %s)" +msgstr " (wd: %s)" + +#: jobs.c:1819 +#, c-format +msgid "child setpgid (%ld to %ld)" +msgstr "дъщерният процес смени групата при изпълнение (от %ld на %ld)" + +#: jobs.c:2138 nojobs.c:605 +#, c-format +msgid "wait: pid %ld is not a child of this shell" +msgstr "изчакване: процесът с идентификатор %ld не е дъщерен на тази обвивка" + +#: jobs.c:2385 +#, c-format +msgid "wait_for: No record of process %ld" +msgstr "изчакване: липсват данни за процес с идентификатор %ld" + +#: jobs.c:2694 +#, c-format +msgid "wait_for_job: job %d is stopped" +msgstr "изчакване на задача: задачата %d е спряна" + +#: jobs.c:2986 +#, c-format +msgid "%s: job has terminated" +msgstr "%s: задачата е приключила" + +#: jobs.c:2995 +#, c-format +msgid "%s: job %d already in background" +msgstr "%s: задача %d вече е във фонов режим" + +#: jobs.c:3220 +msgid "waitchld: turning on WNOHANG to avoid indefinite block" +msgstr "" +"изчакване на дъщерен процес: включване на незабавното излизане от функцията\n" +"чрез WNOHANG, за да се избегне недефиниран блок" + +#: jobs.c:3711 +#, c-format +msgid "%s: line %d: " +msgstr "%s: ред %d: " + +#: jobs.c:3725 nojobs.c:843 +#, c-format +msgid " (core dumped)" +msgstr " (паметта е разтоварена)" + +#: jobs.c:3737 jobs.c:3750 +#, c-format +msgid "(wd now: %s)\n" +msgstr "(работната директория е: %s)\n" + +#: jobs.c:3782 +msgid "initialize_job_control: getpgrp failed" +msgstr "инициализация на контрола на задачите: неуспешно изпълнение на getpgrp" + +#: jobs.c:3843 +msgid "initialize_job_control: line discipline" +msgstr "инициализация на контрола на задачите: дисциплина на линията" + +#: jobs.c:3853 +msgid "initialize_job_control: setpgid" +msgstr "инициализация на контрола на задачите: задаване на група при изпълнение (setpgid)" + +#: jobs.c:3874 jobs.c:3883 +#, c-format +msgid "cannot set terminal process group (%d)" +msgstr "групата на процесите на терминала не може да бъде зададена (%d)" + +#: jobs.c:3888 +msgid "no job control in this shell" +msgstr "в тази обвивка няма управление на задачите" + +#: lib/malloc/malloc.c:296 +#, c-format +msgid "malloc: failed assertion: %s\n" +msgstr "заделяне на памет: грешно предположение: %s\n" + +#: lib/malloc/malloc.c:312 +#, c-format +msgid "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" +msgstr "" +"\r\n" +"заделяне на памет: %s:%d: предположението е отпечатано\r\n" + +#: lib/malloc/malloc.c:313 +msgid "unknown" +msgstr "непознат" + +#: lib/malloc/malloc.c:801 +msgid "malloc: block on free list clobbered" +msgstr "заделяне на памет: блок в списъка със свободни блокове е зает или неподходящ" + +#: lib/malloc/malloc.c:878 +msgid "free: called with already freed block argument" +msgstr "изчистване на памет: извикано е с блоков аргумент, който вече е изчистен" + +#: lib/malloc/malloc.c:881 +msgid "free: called with unallocated block argument" +msgstr "изчистване на памет: извикано е с незаделен блоков аргумент" + +#: lib/malloc/malloc.c:900 +msgid "free: underflow detected; mh_nbytes out of range" +msgstr "" +"изчистване на памет: открито е отрицателно препълване с mh_nbytes извън\n" +"допустимия диапазон" + +#: lib/malloc/malloc.c:906 +msgid "free: start and end chunk sizes differ" +msgstr "изчистване на памет: късовете на началната и крайната области се различават" + +#: lib/malloc/malloc.c:1005 +msgid "realloc: called with unallocated block argument" +msgstr "презаделяне: извикано е с аргумент с незаделен блок" + +#: lib/malloc/malloc.c:1020 +msgid "realloc: underflow detected; mh_nbytes out of range" +msgstr "" +"презаделяне: открито е отрицателно препълване с mh_nbytes извън допустимия\n" +"диапазон" + +#: lib/malloc/malloc.c:1026 +msgid "realloc: start and end chunk sizes differ" +msgstr "презаделяне: късовете на началната и крайната области се различават" + +#: lib/malloc/table.c:194 +#, c-format +msgid "register_alloc: alloc table is full with FIND_ALLOC?\n" +msgstr "регистриране на презаделяне: таблицата за заделянията е пълна с FIND_ALLOC?\n" + +#: lib/malloc/table.c:203 +#, c-format +msgid "register_alloc: %p already in table as allocated?\n" +msgstr "регистриране на презаделяне: %p вече е в таблицата като заделен?\n" + +#: lib/malloc/table.c:256 +#, c-format +msgid "register_free: %p already in table as free?\n" +msgstr "регистриране на свободни: %p вече е в таблицата като свободен?\n" + +#: lib/sh/fmtulong.c:102 +msgid "invalid base" +msgstr "грешна основа на бройна система" + +#: lib/sh/netopen.c:168 +#, c-format +msgid "%s: host unknown" +msgstr "%s: непознат хост" + +#: lib/sh/netopen.c:175 +#, c-format +msgid "%s: invalid service" +msgstr "%s: неправилна услуга" + +#: lib/sh/netopen.c:306 +#, c-format +msgid "%s: bad network path specification" +msgstr "%s: неправилно указан мрежов път" + +#: lib/sh/netopen.c:346 +msgid "network operations not supported" +msgstr "не се поддържат мрежови операции" + +#: locale.c:200 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s)" +msgstr "setlocale: LC_ALL: локалът не може да бъде сменен (%s)" + +#: locale.c:202 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s): %s" +msgstr "setlocale: LC_ALL: локалът не може да бъде сменен (%s): %s" + +#: locale.c:259 +#, c-format +msgid "setlocale: %s: cannot change locale (%s)" +msgstr "setlocale: %s: локалът не може да бъде сменен (%s)" + +#: locale.c:261 +#, c-format +msgid "setlocale: %s: cannot change locale (%s): %s" +msgstr "setlocale: %s: локалът не може да бъде сменен (%s): %s" + +#: mailcheck.c:439 +msgid "You have mail in $_" +msgstr "Имате поща в $_" + +#: mailcheck.c:464 +msgid "You have new mail in $_" +msgstr "Имате нова поща в $_" + +#: mailcheck.c:480 +#, c-format +msgid "The mail in %s has been read\n" +msgstr "Пощата в %s вече е прочетена\n" + +#: make_cmd.c:323 +msgid "syntax error: arithmetic expression required" +msgstr "синтактична грешка: изисква се аритметичен израз" + +#: make_cmd.c:325 +msgid "syntax error: `;' unexpected" +msgstr "синтактична грешка: неочакван знак „;“" + +#: make_cmd.c:326 +#, c-format +msgid "syntax error: `((%s))'" +msgstr "синтактична грешка: „((%s))“" + +#: make_cmd.c:578 +#, c-format +msgid "make_here_document: bad instruction type %d" +msgstr "вътрешен документ с „<<“: неправилен вид инструкция %d" + +#: make_cmd.c:662 +#, c-format +msgid "here-document at line %d delimited by end-of-file (wanted `%s')" +msgstr "вътрешният документ на ред %d е отделен със знак за нов ред (а трябва да е „%s“)" + +#: make_cmd.c:759 +#, c-format +msgid "make_redirection: redirection instruction `%d' out of range" +msgstr "пренасочване: инструкцията за пренасочване „%d“ е извън допустимия диапазон" + +#: parse.y:3273 parse.y:3556 +#, c-format +msgid "unexpected EOF while looking for matching `%c'" +msgstr "неочакван знак за край на файл „EOF“, а се очакваше съответстващ знак „%c“" + +#: parse.y:4163 +msgid "unexpected EOF while looking for `]]'" +msgstr "неочакван знак за край на файл „EOF“, а се очакваше „]]“" + +#: parse.y:4168 +#, c-format +msgid "syntax error in conditional expression: unexpected token `%s'" +msgstr "синтактична грешка в условен израз: неочаквана лексема „%s“" + +#: parse.y:4172 +msgid "syntax error in conditional expression" +msgstr "синтактична грешка в условен израз" + +#: parse.y:4250 +#, c-format +msgid "unexpected token `%s', expected `)'" +msgstr "неочаквана лексема „%s“, а се очакваше знакът „)“" + +#: parse.y:4254 +msgid "expected `)'" +msgstr "очакваше се „)“" + +#: parse.y:4282 +#, c-format +msgid "unexpected argument `%s' to conditional unary operator" +msgstr "неочакван аргумент „%s“ за унарен условен оператор" + +#: parse.y:4286 +msgid "unexpected argument to conditional unary operator" +msgstr "неочакван аргумент за унарен условен оператор" + +#: parse.y:4332 +#, c-format +msgid "unexpected token `%s', conditional binary operator expected" +msgstr "неочаквана лексема „%s“, очакваше се бинарен условен оператор" + +#: parse.y:4336 +msgid "conditional binary operator expected" +msgstr "очакваше се бинарен условен оператор" + +#: parse.y:4358 +#, c-format +msgid "unexpected argument `%s' to conditional binary operator" +msgstr "неочакван аргумент „%s“ за бинарен условен оператор" + +#: parse.y:4362 +msgid "unexpected argument to conditional binary operator" +msgstr "неочакван аргумент за бинарен условен оператор" + +#: parse.y:4373 +#, c-format +msgid "unexpected token `%c' in conditional command" +msgstr "неочаквана лексема „%c“ в условна команда" + +#: parse.y:4376 +#, c-format +msgid "unexpected token `%s' in conditional command" +msgstr "неочаквана лексема „%s“ в условна команда" + +#: parse.y:4380 +#, c-format +msgid "unexpected token %d in conditional command" +msgstr "неочаквана лексема %d в условна команда" + +#: parse.y:5730 +#, c-format +msgid "syntax error near unexpected token `%s'" +msgstr "синтактична грешка в близост до неочакваната лексема „%s“" + +#: parse.y:5748 +#, c-format +msgid "syntax error near `%s'" +msgstr "синтактична грешка в близост до „%s“" + +#: parse.y:5758 +msgid "syntax error: unexpected end of file" +msgstr "синтактична грешка: неочакван край на файл" + +#: parse.y:5758 +msgid "syntax error" +msgstr "синтактична грешка" + +#: parse.y:5820 +#, c-format +msgid "Use \"%s\" to leave the shell.\n" +msgstr "Използвайте „%s“, за да излезете от обвивката.\n" + +#: parse.y:5982 +msgid "unexpected EOF while looking for matching `)'" +msgstr "неочакван знак за край на файл „EOF“, очакваше се знакът „)“" + +#: pcomplete.c:1094 +#, c-format +msgid "completion: function `%s' not found" +msgstr "дописване: функцията „%s“ не е открита" + +#: pcomplib.c:182 +#, c-format +msgid "progcomp_insert: %s: NULL COMPSPEC" +msgstr "вмъкване на завършване на команда: %s указване на команда, което е NULL" + +#: print_cmd.c:300 +#, c-format +msgid "print_command: bad connector `%d'" +msgstr "команда за печат: лош конектор „%d“" + +#: print_cmd.c:373 +#, c-format +msgid "xtrace_set: %d: invalid file descriptor" +msgstr "xtrace_set: %d: грешен файлов дескриптор" + +#: print_cmd.c:378 +msgid "xtrace_set: NULL file pointer" +msgstr "xtrace_set: указател към файл – NULL" + +#: print_cmd.c:382 +#, c-format +msgid "xtrace fd (%d) != fileno xtrace fp (%d)" +msgstr "xtrace fd (%d) != fileno xtrace fp (%d)" + +#: print_cmd.c:1518 +#, c-format +msgid "cprintf: `%c': invalid format character" +msgstr "отпечатване: „%c“: неправилен форматиращ знак" + +#: redir.c:123 redir.c:170 +msgid "file descriptor out of range" +msgstr "файловият дескриптор е извън допустимия диапазон" + +#: redir.c:177 +#, c-format +msgid "%s: ambiguous redirect" +msgstr "%s: двусмислено пренасочване" + +#: redir.c:181 +#, c-format +msgid "%s: cannot overwrite existing file" +msgstr "%s: не може да се презапише съществуващ файл" + +#: redir.c:186 +#, c-format +msgid "%s: restricted: cannot redirect output" +msgstr "%s: поради ограничение изходът не може да се пренасочи" + +#: redir.c:191 +#, c-format +msgid "cannot create temp file for here-document: %s" +msgstr "не може да се създаде временен файл за вътрешен документ: %s" + +#: redir.c:195 +#, c-format +msgid "%s: cannot assign fd to variable" +msgstr "%s: на променлива не може да се присвои файлов дескриптор" + +#: redir.c:582 +msgid "/dev/(tcp|udp)/host/port not supported without networking" +msgstr "„/dev/(tcp|udp)/host/port“ не се поддържат, ако няма поддръжка на мрежа" + +#: redir.c:861 redir.c:973 redir.c:1034 redir.c:1199 +msgid "redirection error: cannot duplicate fd" +msgstr "грешка при пренасочване: файловият дескриптор не може да бъде дублиран" + +#: shell.c:339 +msgid "could not find /tmp, please create!" +msgstr "не е открита директорията „/tmp“. Създайте я!" + +#: shell.c:343 +msgid "/tmp must be a valid directory name" +msgstr "„/tmp“ трябва да е директория" + +#: shell.c:890 +#, c-format +msgid "%c%c: invalid option" +msgstr "%c%c: неправилна опция" + +#: shell.c:1682 +msgid "I have no name!" +msgstr "Не може да се получи името на текущия потребител!" + +#: shell.c:1827 +#, c-format +msgid "GNU bash, version %s-(%s)\n" +msgstr "GNU bash, версия %s-(%s)\n" + +#: shell.c:1828 +#, c-format +msgid "" +"Usage:\t%s [GNU long option] [option] ...\n" +"\t%s [GNU long option] [option] script-file ...\n" +msgstr "" +"Употреба: %s [дълга опция на GNU] [опция]…\n" +" %s [дълга опция на GNU] [опция] файл-скрипт…\n" + +#: shell.c:1830 +msgid "GNU long options:\n" +msgstr "Дълги опции на GNU:\n" + +#: shell.c:1834 +msgid "Shell options:\n" +msgstr "Опции на обвивката:\n" + +#: shell.c:1835 +msgid "\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n" +msgstr " -ilrsD или -c команда, или -O къса_опция (само при стартиране)\n" + +#: shell.c:1850 +#, c-format +msgid "\t-%s or -o option\n" +msgstr " -%s или -o опция\n" + +#: shell.c:1856 +#, c-format +msgid "Type `%s -c \"help set\"' for more information about shell options.\n" +msgstr "За повече информация за опциите на обвивката въведете „%s -c \"help set\"“.\n" + +#: shell.c:1857 +#, c-format +msgid "Type `%s -c help' for more information about shell builtin commands.\n" +msgstr "За повече информация за вградените в обвивката команди въведете „%s -c help“.\n" + +#: shell.c:1858 +#, c-format +msgid "Use the `bashbug' command to report bugs.\n" +msgstr "За да докладвате грешки, използвайте командата „bashbug“.\n" + +#: sig.c:691 +#, c-format +msgid "sigprocmask: %d: invalid operation" +msgstr "маска за обработката на сигнали: %d: грешна операция" + +#: siglist.c:48 +msgid "Bogus signal" +msgstr "Фалшив сигнал" + +#: siglist.c:51 +msgid "Hangup" +msgstr "Прекъсване на връзката" + +#: siglist.c:55 +msgid "Interrupt" +msgstr "Прекъсване" + +#: siglist.c:59 +msgid "Quit" +msgstr "Спиране" + +#: siglist.c:63 +msgid "Illegal instruction" +msgstr "Неправилна инструкция" + +#: siglist.c:67 +msgid "BPT trace/trap" +msgstr "Капан за авариен изход чрез BPT" + +#: siglist.c:75 +msgid "ABORT instruction" +msgstr "Инструкция за прекратяване" + +#: siglist.c:79 +msgid "EMT instruction" +msgstr "Капан с EMT" + +#: siglist.c:83 +msgid "Floating point exception" +msgstr "Изключение от плаваща запетая" + +#: siglist.c:87 +msgid "Killed" +msgstr "Убит" + +#: siglist.c:91 +msgid "Bus error" +msgstr "Грешка в шината" + +#: siglist.c:95 +msgid "Segmentation fault" +msgstr "Грешка в разделянето" + +#: siglist.c:99 +msgid "Bad system call" +msgstr "Грешно системно извикване" + +#: siglist.c:103 +msgid "Broken pipe" +msgstr "Прекъснат програмен канал" + +#: siglist.c:107 +msgid "Alarm clock" +msgstr "Аларма" + +#: siglist.c:111 +msgid "Terminated" +msgstr "Прекратен" + +#: siglist.c:115 +msgid "Urgent IO condition" +msgstr "Спешно вх./изх. състояние" + +#: siglist.c:119 +msgid "Stopped (signal)" +msgstr "Спрян (сигнал)" + +#: siglist.c:127 +msgid "Continue" +msgstr "Продължаване" + +#: siglist.c:135 +msgid "Child death or stop" +msgstr "Смърт или спиране на дъщерен процес" + +#: siglist.c:139 +msgid "Stopped (tty input)" +msgstr "Спиране (вход от tty)" + +#: siglist.c:143 +msgid "Stopped (tty output)" +msgstr "Спиране (изход към tty)" + +#: siglist.c:147 +msgid "I/O ready" +msgstr "Готовност за вх./изх." + +#: siglist.c:151 +msgid "CPU limit" +msgstr "Ограничение на процесора" + +#: siglist.c:155 +msgid "File limit" +msgstr "Ограничение на файловете" + +#: siglist.c:159 +msgid "Alarm (virtual)" +msgstr "Аларма (виртуална)" + +#: siglist.c:163 +msgid "Alarm (profile)" +msgstr "Аларма (по профил)" + +#: siglist.c:167 +msgid "Window changed" +msgstr "Прозорецът е преоразмерен" + +#: siglist.c:171 +msgid "Record lock" +msgstr "Заключен запис" + +#: siglist.c:175 +msgid "User signal 1" +msgstr "Потребителски сигнал 1" + +#: siglist.c:179 +msgid "User signal 2" +msgstr "Потребителски сигнал 2" + +#: siglist.c:183 +msgid "HFT input data pending" +msgstr "Идват данни по конзола HFT" + +#: siglist.c:187 +msgid "power failure imminent" +msgstr "Предстои спиране на захранването" + +#: siglist.c:191 +msgid "system crash imminent" +msgstr "Предстои забиване на системата" + +#: siglist.c:195 +msgid "migrate process to another CPU" +msgstr "Преместване на процеса на друг процесор" + +#: siglist.c:199 +msgid "programming error" +msgstr "Програмна грешка" + +#: siglist.c:203 +msgid "HFT monitor mode granted" +msgstr "Дадено право за управление чрез конзола HFT" + +#: siglist.c:207 +msgid "HFT monitor mode retracted" +msgstr "Отнето право за управление чрез конзола HFT" + +#: siglist.c:211 +msgid "HFT sound sequence has completed" +msgstr "Завършена звукова поредица през HFT" + +#: siglist.c:215 +msgid "Information request" +msgstr "Заявка за информация" + +#: siglist.c:223 +msgid "Unknown Signal #" +msgstr "Непознат сигнал #" + +#: siglist.c:225 +#, c-format +msgid "Unknown Signal #%d" +msgstr "Непознат сигнал #%d" + +#: subst.c:1362 subst.c:1520 +#, c-format +msgid "bad substitution: no closing `%s' in %s" +msgstr "лошо заместване: липсва затварящ знак „%s“ в %s" + +#: subst.c:2847 +#, c-format +msgid "%s: cannot assign list to array member" +msgstr "%s: на член от масив не може да се присвои списък" + +#: subst.c:5065 subst.c:5081 +msgid "cannot make pipe for process substitution" +msgstr "не може да се създаде програмен канал за заместване на процеси" + +#: subst.c:5113 +msgid "cannot make child for process substitution" +msgstr "не може да се създаде дъщерен процес за заместване на процеси" + +#: subst.c:5158 +#, c-format +msgid "cannot open named pipe %s for reading" +msgstr "именуваният програмен канал %s не може да се отвори за четене" + +#: subst.c:5160 +#, c-format +msgid "cannot open named pipe %s for writing" +msgstr "именуваният програмен канал %s не може да се отвори за запис" + +#: subst.c:5178 +#, c-format +msgid "cannot duplicate named pipe %s as fd %d" +msgstr "" +"именуваният програмен канал %s не може да се\n" +"дублира като файловия дескриптор %d" + +#: subst.c:5376 +msgid "cannot make pipe for command substitution" +msgstr "не може да се създаде програмен канал за заместване на команди" + +#: subst.c:5414 +msgid "cannot make child for command substitution" +msgstr "не може да се създаде дъщерен процес за заместване на команди" + +#: subst.c:5433 +msgid "command_substitute: cannot duplicate pipe as fd 1" +msgstr "заместване на команди: каналът не може да се дублира като fd 1" + +#: subst.c:5837 subst.c:8050 +#, c-format +msgid "%s: invalid variable name for name reference" +msgstr "%s: неправилно име за променлива-указател" + +#: subst.c:6048 +#, c-format +msgid "%s: parameter null or not set" +msgstr "%s: аргументът е „null“ или не е зададен" + +#: subst.c:6320 subst.c:6335 +#, c-format +msgid "%s: substring expression < 0" +msgstr "%s: изразът от подниза е < 0" + +#: subst.c:7506 +#, c-format +msgid "%s: bad substitution" +msgstr "%s: лошо заместване" + +#: subst.c:7583 +#, c-format +msgid "$%s: cannot assign in this way" +msgstr "$%s: не може да се задава по този начин" + +#: subst.c:7917 +msgid "future versions of the shell will force evaluation as an arithmetic substitution" +msgstr "" +"бъдещите версии на обвивката ще използват изчисляване като аритметично\n" +"заместване" + +#: subst.c:8421 +#, c-format +msgid "bad substitution: no closing \"`\" in %s" +msgstr "лошо заместване: липсва затварящ знак „`“ в %s" + +#: subst.c:9322 +#, c-format +msgid "no match: %s" +msgstr "няма съвпадение: %s" + +#: test.c:147 +msgid "argument expected" +msgstr "очаква се аргумент" + +#: test.c:156 +#, c-format +msgid "%s: integer expression expected" +msgstr "%s: очаква се целочислен израз" + +#: test.c:264 +msgid "`)' expected" +msgstr "очаква се „)“" + +#: test.c:266 +#, c-format +msgid "`)' expected, found %s" +msgstr "очаква се „)“, а е получено %s" + +#: test.c:281 test.c:721 test.c:724 +#, c-format +msgid "%s: unary operator expected" +msgstr "%s: очаква се унарен оператор" + +#: test.c:468 test.c:764 +#, c-format +msgid "%s: binary operator expected" +msgstr "%s: очаква се бинарен оператор" + +#: test.c:839 +msgid "missing `]'" +msgstr "липсва „]“" + +#: trap.c:217 +msgid "invalid signal number" +msgstr "неправилен номер на сигнал" + +#: trap.c:371 +#, c-format +msgid "run_pending_traps: bad value in trap_list[%d]: %p" +msgstr "" +"стартиране на предстоящите прихващания: неправилна стойност в\n" +"trap_list[%d]: %p" + +#: trap.c:375 +#, c-format +msgid "run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" +msgstr "" +"стартиране на предстоящите прихващания: обработката на сигнали е SIG_DFL.\n" +"%d (%s) е преизпратен на текущата обвивка" + +#: trap.c:428 +#, c-format +msgid "trap_handler: bad signal %d" +msgstr "обработка на прихващания: неправилен сигнал %d" + +#: variables.c:382 +#, c-format +msgid "error importing function definition for `%s'" +msgstr "грешка при внасянето на дефиницията на функция за „%s“" + +#: variables.c:780 +#, c-format +msgid "shell level (%d) too high, resetting to 1" +msgstr "нивото на обвивката (%d) е прекалено голямо. Задава се да е 1" + +#: variables.c:1865 +#, c-format +msgid "%s: circular name reference" +msgstr "%s: цикъл в променливите-указатели" + +#: variables.c:2228 +msgid "make_local_variable: no function context at current scope" +msgstr "" +"създаване на локална променлива: липсва контекст на функция в текущата област\n" +"на видимост" + +#: variables.c:2247 +#, c-format +msgid "%s: variable may not be assigned value" +msgstr "%s: на тази променлива не може да се присвои стойност" + +#: variables.c:3646 +msgid "all_local_variables: no function context at current scope" +msgstr "" +"всички локални променливи: липсва контекст на функция в текущата област на\n" +"видимост" + +#: variables.c:3891 +#, c-format +msgid "%s has null exportstr" +msgstr "%s: аргументът за низа за изнасяне не трябва да е „null“" + +#: variables.c:3896 variables.c:3905 +#, c-format +msgid "invalid character %d in exportstr for %s" +msgstr "неправилен знак на позиция %d в низа за изнасяне за %s" + +#: variables.c:3911 +#, c-format +msgid "no `=' in exportstr for %s" +msgstr "липсва „=“ в низа за изнасяне за %s" + +#: variables.c:4344 +msgid "pop_var_context: head of shell_variables not a function context" +msgstr "" +"изваждане на контекст на променливи: в началото на структурата за променливи на\n" +"обвивката (shell_variables) е нещо, което не е контекст на функция" + +#: variables.c:4357 +msgid "pop_var_context: no global_variables context" +msgstr "" +"изваждане на контекст на променливи: липсва контекст за глобални променливи\n" +"(global_variables)" + +#: variables.c:4431 +msgid "pop_scope: head of shell_variables not a temporary environment scope" +msgstr "" +"изваждане на област: в началото на структурата за променливи на обвивката\n" +"(shell_variables) е нещо, което не е временна област в обкръжението" + +#: variables.c:5257 +#, c-format +msgid "%s: %s: cannot open as FILE" +msgstr "%s: %s не може да се отвори като ФАЙЛ" + +#: variables.c:5262 +#, c-format +msgid "%s: %s: invalid value for trace file descriptor" +msgstr "%s: %s: грешен файлов дескриптор за файла за трасиране" + +#: variables.c:5307 +#, c-format +msgid "%s: %s: compatibility value out of range" +msgstr "%s: %s: е извън допустимия диапазон" + +#: version.c:46 +msgid "Copyright (C) 2013 Free Software Foundation, Inc." +msgstr "Авторски права (C) 2013 Free Software Foundation, Inc." + +#: version.c:47 version2.c:47 +msgid "License GPLv3+: GNU GPL version 3 or later \n" +msgstr "Лиценз GPLv3+: ОПЛ на GNU, версия 3 или по-висока \n" + +#: version.c:86 version2.c:86 +#, c-format +msgid "GNU bash, version %s (%s)\n" +msgstr "GNU bash, версия %s (%s)\n" + +#: version.c:91 version2.c:91 +msgid "This is free software; you are free to change and redistribute it." +msgstr "Това е свободен софтуер. Можете да го променяте и разпространявате." + +#: version.c:92 version2.c:92 +msgid "There is NO WARRANTY, to the extent permitted by law." +msgstr "Няма НИКАКВИ ГАРАНЦИИ до степента позволена от закона." + +#: version2.c:46 +msgid "Copyright (C) 2012 Free Software Foundation, Inc." +msgstr "Авторски права (C) 2012 Free Software Foundation, Inc." + +#: xmalloc.c:91 +#, c-format +msgid "%s: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "%s: не могат да се заделят %lu байта (заделени са %lu байта)" + +#: xmalloc.c:93 +#, c-format +msgid "%s: cannot allocate %lu bytes" +msgstr "%s: не могат да се заделят %lu байта" + +#: xmalloc.c:163 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "%s: %s:%d: не могат да се заделят %lu байта (заделени са %lu байта)" + +#: xmalloc.c:165 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes" +msgstr "%s: %s:%d: не могат да се заделят %lu байта" + +#: builtins.c:43 +msgid "alias [-p] [name[=value] ... ]" +msgstr "alias [-p] [ИМЕ[=СТОЙНОСТ]…]" + +#: builtins.c:47 +msgid "unalias [-a] name [name ...]" +msgstr "unalias [-a] ИМЕ [ИМЕ…]" + +#: builtins.c:51 +msgid "bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-x keyseq:shell-command] [keyseq:readline-function or readline-command]" +msgstr "" +"bind [-lpsvPSVX] [-m ПОДРЕДБА_НА_КЛАВИАТУРАТА] [-f ИМЕ_НА_ФАЙЛ]\n" +" [-q ИМЕ] [-u ИМЕ] [-r ПОСЛЕДОВАТЕЛНОСТ_ОТ_КЛАВИШИ]\n" +" [-x ПОСЛЕДОВАТЕЛНОСТ_ОТ_КЛАВИШИ:КОМАНДА_НА_ОБВИВКАТА]\n" +" [ПОСЛЕДОВАТЕЛНОСТ_ОТ_КЛАВИШИ:КОМАНДА_НА_ОБВИВКАТА или КОМАНДА_НА_READLINE]" + +#: builtins.c:54 +msgid "break [n]" +msgstr "break [БРОЙ]" + +#: builtins.c:56 +msgid "continue [n]" +msgstr "continue [БРОЙ]" + +#: builtins.c:58 +msgid "builtin [shell-builtin [arg ...]]" +msgstr "builtin [ВГРАДЕНА_КОМАНДА [АРГУМЕНТ…]]" + +#: builtins.c:61 +msgid "caller [expr]" +msgstr "caller [ИЗРАЗ]" + +#: builtins.c:64 +msgid "cd [-L|[-P [-e]] [-@]] [dir]" +msgstr "cd [-L|[-P [-e]] [-@]] [ДИРЕКТОРИЯ]" + +#: builtins.c:66 +msgid "pwd [-LP]" +msgstr "pwd [-LP]" + +#: builtins.c:68 +msgid ":" +msgstr ":" + +#: builtins.c:70 +msgid "true" +msgstr "true" + +#: builtins.c:72 +msgid "false" +msgstr "false" + +#: builtins.c:74 +msgid "command [-pVv] command [arg ...]" +msgstr "command [-pVv] команда [АРГУМЕНТ…]" + +#: builtins.c:76 +msgid "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" +msgstr "declare [-aAfFgilnrtux] [-p] [ИМЕ[=СТОЙНОСТ]…]" + +#: builtins.c:78 +msgid "typeset [-aAfFgilrtux] [-p] name[=value] ..." +msgstr "typeset [-aAfFgilrtux] [-p] [ИМЕ[=СТОЙНОСТ]…]" + +#: builtins.c:80 +msgid "local [option] name[=value] ..." +msgstr "local [ОПЦИЯ] ИМЕ[=СТОЙНОСТ]…" + +#: builtins.c:83 +msgid "echo [-neE] [arg ...]" +msgstr "echo [-neE] [АРГУМЕНТ…]" + +#: builtins.c:87 +msgid "echo [-n] [arg ...]" +msgstr "echo [-n] [АРГУМЕНТ…]" + +#: builtins.c:90 +msgid "enable [-a] [-dnps] [-f filename] [name ...]" +msgstr "enable [-a] [-dnps] [-f ФАЙЛ] [АРГУМЕНТ…]" + +#: builtins.c:92 +msgid "eval [arg ...]" +msgstr "eval [АРГУМЕНТ…]" + +#: builtins.c:94 +msgid "getopts optstring name [arg]" +msgstr "getopts НИЗ_С_ОПЦИИ ИМЕ [АРГУМЕНТ]" + +#: builtins.c:96 +msgid "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" +msgstr "exec [-cl] [-a ИМЕ] [КОМАНДА [АРГУМЕНТИ…]] [ПРЕНАСОЧВАНЕ…]" + +#: builtins.c:98 +msgid "exit [n]" +msgstr "exit [ЦИФРОВ_КОД]" + +#: builtins.c:100 +msgid "logout [n]" +msgstr "logout [ЦИФРОВ_КОД]" + +#: builtins.c:103 +msgid "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" +msgstr "fc [-e РЕДАКТОР] [-lnr] [ПЪРВИ] [ПОСЛЕДЕН] или fc -s [ШАБЛОН=ЗАМЕСТИТЕЛ…] [КОМАНДА]" + +#: builtins.c:107 +msgid "fg [job_spec]" +msgstr "fg [ЗАДАЧА]" + +#: builtins.c:111 +msgid "bg [job_spec ...]" +msgstr "bg [ЗАДАЧА…]" + +#: builtins.c:114 +msgid "hash [-lr] [-p pathname] [-dt] [name ...]" +msgstr "hash [-lr] [-p ПЪТ] [-dt] [ИМЕ…]" + +#: builtins.c:117 +msgid "help [-dms] [pattern ...]" +msgstr "help [-dms] [ШАБЛОН…]" + +#: builtins.c:121 +msgid "history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]" +msgstr "" +"history [-c] [-d ОТМЕСТВАНЕ] [БРОЙ] или \n" +"history -anrw [ИМЕ_НА_ФАЙЛ] или\n" +"history -ps АРГ [АРГ…]" + +#: builtins.c:125 +msgid "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" +msgstr "jobs [-lnprs] [ЗАДАЧА…] или jobs -x КОМАНДА [АРГУМЕНТИ]" + +#: builtins.c:129 +msgid "disown [-h] [-ar] [jobspec ...]" +msgstr "disown [-h] [-ar] [ЗАДАЧА…]" + +#: builtins.c:132 +msgid "kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]" +msgstr "" +"kill [-s СИГНАЛ | -n НОМЕР_НА_СИГНАЛ | -СИГНАЛ] ИДЕНТИФИКАТОР_НА_ПРОЦЕС\n" +" | ИДЕНТИФИКАТОР_НА_ЗАДАЧА…\n" +"или\n" +"kill -l [СИГНАЛ]" + +#: builtins.c:134 +msgid "let arg [arg ...]" +msgstr "let АРГУМЕНТ [АРГУМЕНТ…]" + +#: builtins.c:136 +msgid "read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]" +msgstr "" +"read [-ers] [-a МАСИВ] [-d РАЗДЕЛИТЕЛ] [-i ТЕКСТ] [-n БРОЙ_ЗНАЦИ]\n" +" [-N БРОЙ_ЗНАЦИ] [-p ПОДСКАЗКА] [-t БРОЙ_ЗНАЦИ] [-u ФАЙЛОВ_ДЕСКРИПТОР]\n" +" [ИМЕ…]" + +#: builtins.c:138 +msgid "return [n]" +msgstr "return [ЦИФРОВ_КОД]" + +#: builtins.c:140 +msgid "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" +msgstr "set [-abefhkmnptuvxBCHP] [-o ОПЦИЯ] [--] [АРГУМЕНТИ…]" + +#: builtins.c:142 +msgid "unset [-f] [-v] [-n] [name ...]" +msgstr "unset [-f] [-v] [-n] [ИМЕ…]" + +#: builtins.c:144 +msgid "export [-fn] [name[=value] ...] or export -p" +msgstr "export [-fn] [ИМЕ[=СТОЙНОСТ]…] или export -p" + +#: builtins.c:146 +msgid "readonly [-aAf] [name[=value] ...] or readonly -p" +msgstr "readonly [-aAf] [ИМЕ[=СТОЙНОСТ]…] или readonly -p" + +#: builtins.c:148 +msgid "shift [n]" +msgstr "shift [БРОЙ]" + +#: builtins.c:150 +msgid "source filename [arguments]" +msgstr "source ФАЙЛ [АРГУМЕНТИ]" + +#: builtins.c:152 +msgid ". filename [arguments]" +msgstr ". ФАЙЛ [аргументи]" + +#: builtins.c:155 +msgid "suspend [-f]" +msgstr "suspend [-f]" + +#: builtins.c:158 +msgid "test [expr]" +msgstr "test [ИЗРАЗ]" + +#: builtins.c:160 +msgid "[ arg... ]" +msgstr "[ АРГУМЕНТ…]" + +#: builtins.c:162 +msgid "times" +msgstr "times" + +#: builtins.c:164 +msgid "trap [-lp] [[arg] signal_spec ...]" +msgstr "trap [-lp] [[АРГУМЕНТ] СИГНАЛ…]" + +#: builtins.c:166 +msgid "type [-afptP] name [name ...]" +msgstr "type [-afptP] ИМЕ [ИМЕ…]" + +#: builtins.c:169 +msgid "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" +msgstr "ulimit [-SHabcdefilmnpqrstuvxT] [ОГРАНИЧЕНИЕ]" + +#: builtins.c:172 +msgid "umask [-p] [-S] [mode]" +msgstr "umask [-p] [-S] [МАСКА]" + +#: builtins.c:175 +msgid "wait [-n] [id ...]" +msgstr "wait [-n] [ИД…]" + +#: builtins.c:179 +msgid "wait [pid ...]" +msgstr "wait [ИД_ПР…]" + +#: builtins.c:182 +msgid "for NAME [in WORDS ... ] ; do COMMANDS; done" +msgstr "for ИМЕ [in ДУМИ…] ; do КОМАНДИ; done" + +#: builtins.c:184 +msgid "for (( exp1; exp2; exp3 )); do COMMANDS; done" +msgstr "for (( ИЗРАЗ_1; ИЗРАЗ_2; ИЗРАЗ_3 )); do КОМАНДИ; done" + +#: builtins.c:186 +msgid "select NAME [in WORDS ... ;] do COMMANDS; done" +msgstr "select ИМЕ [in ДУМИ…;] do КОМАНДИ; done" + +#: builtins.c:188 +msgid "time [-p] pipeline" +msgstr "time [-p] ПРОГРАМЕН_КАНАЛ" + +#: builtins.c:190 +msgid "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" +msgstr "case ДУМА in [ШАБЛОН [| ШАБЛОН]…) КОМАНДИ ;;]… esac" + +#: builtins.c:192 +msgid "if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else COMMANDS; ] fi" +msgstr "if КОМАНДИ; then КОМАНДИ; [ elif КОМАНДИ; then КОМАНДИ; ]… [ else КОМАНДИ; ] fi" + +#: builtins.c:194 +msgid "while COMMANDS; do COMMANDS; done" +msgstr "while КОМАНДИ; do КОМАНДИ; done" + +#: builtins.c:196 +msgid "until COMMANDS; do COMMANDS; done" +msgstr "until КОМАНДИ; do КОМАНДИ; done" + +#: builtins.c:198 +msgid "coproc [NAME] command [redirections]" +msgstr "coproc [ИМЕ] КОМАНДА [ПРЕНАСОЧВАНИЯ]" + +#: builtins.c:200 +msgid "function name { COMMANDS ; } or name () { COMMANDS ; }" +msgstr "function name { КОМАНДИ ; } или name () { КОМАНДИ ; }" + +#: builtins.c:202 +msgid "{ COMMANDS ; }" +msgstr "{ КОМАНДИ ; }" + +#: builtins.c:204 +msgid "job_spec [&]" +msgstr "%ЗАДАЧА [&]" + +#: builtins.c:206 +msgid "(( expression ))" +msgstr "(( ИЗРАЗ ))" + +#: builtins.c:208 +msgid "[[ expression ]]" +msgstr "[[ ИЗРАЗ ]]" + +#: builtins.c:210 +msgid "variables - Names and meanings of some shell variables" +msgstr "variables имена и значение на някои от променливите на обвивката" + +#: builtins.c:213 +msgid "pushd [-n] [+N | -N | dir]" +msgstr "pushd [-n] [+N | -N | ДИР]" + +#: builtins.c:217 +msgid "popd [-n] [+N | -N]" +msgstr "popd [-n] [+N | -N]" + +#: builtins.c:221 +msgid "dirs [-clpv] [+N] [-N]" +msgstr "dirs [-clpv] [+N] [-N]" + +#: builtins.c:224 +msgid "shopt [-pqsu] [-o] [optname ...]" +msgstr "shopt [-pqsu] [-o] [ОПЦИЯ…]" + +#: builtins.c:226 +msgid "printf [-v var] format [arguments]" +msgstr "printf [-v ПРОМЕНЛИВА] ФОРМАТ [АРГУМЕНТИ]" + +#: builtins.c:229 +msgid "complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [name ...]" +msgstr "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o ОПЦИЯ] [-A ДЕЙСТВИЕ]\n" +" [-G ШАБЛОН] [-W ДУМИ] [-F ФУНКЦИЯ] [-C КОМАНДА] [-X ФИЛТЪР]\n" +" [-P ПРЕДСТАВКА] [-S НАСТАВКА] [ИМЕ…]" + +#: builtins.c:233 +msgid "compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" +msgstr "" +"compgen [-abcdefgjksuv] [-o ОПЦИЯ] [-A ДЕЙСТВИЕ] [-G ШАБЛОН]\n" +" [-W ДУМИ] [-F ФУНКЦИЯ] [-C КОМАНДА] [-X ФИЛТЪР] [-P ПРЕДСТАВКА]\n" +" [-S НАСТАВКА] [ДУМА]" + +#: builtins.c:237 +msgid "compopt [-o|+o option] [-DE] [name ...]" +msgstr "compopt [-o|+o ОПЦИЯ] [-DE] [ИМЕ…]" + +#: builtins.c:240 +msgid "mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]" +msgstr "" +"mapfile [-n БРОЙ] [-O НАЧАЛО] [-s БРОЙ] [-t] [-u ФАЙЛ_ДЕСКР]\n" +" [-C ФУНКЦИЯ] [-c КВАНТ] [МАСИВ]" + +#: builtins.c:242 +msgid "readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]" +msgstr "" +"readarray [-n БРОЙ] [-O НАЧАЛО] [-s БРОЙ] [-t] [-u ФАЙЛ_ДЕСКР]\n" +" [-C ФУНКЦИЯ] [-c КВАНТ] [МАСИВ]" + +#: builtins.c:254 +msgid "" +"Define or display aliases.\n" +" \n" +" Without arguments, `alias' prints the list of aliases in the reusable\n" +" form `alias NAME=VALUE' on standard output.\n" +" \n" +" Otherwise, an alias is defined for each NAME whose VALUE is given.\n" +" A trailing space in VALUE causes the next word to be checked for\n" +" alias substitution when the alias is expanded.\n" +" \n" +" Options:\n" +" -p\tPrint all defined aliases in a reusable format\n" +" \n" +" Exit Status:\n" +" alias returns true unless a NAME is supplied for which no alias has been\n" +" defined." +msgstr "" +"Дефиниране или извеждане на синоними.\n" +"\n" +" „alias“ без аргументи или с опцията „-p“ отпечатва списъка със\n" +" синонимите във формат „ИМЕ=СТОЙНОСТ“ на стандартния изход.\n" +"\n" +" В противен случай за всяко ИМЕ, за което е зададена стойност, се\n" +" дефинира синоним. Интервал в края на СТОЙНОСТ-та предизвиква синонимно\n" +" заместване на следващата дума при заместването на синонима.\n" +"\n" +" Опции:\n" +" -p Извежда всички синоними във формат за последващо използване\n" +"\n" +" Изходен код:\n" +" alias връща 0, освен в случаите, когато се зададе ИМЕ, за което\n" +" не е дефиниран синоним." + +#: builtins.c:276 +msgid "" +"Remove each NAME from the list of defined aliases.\n" +" \n" +" Options:\n" +" -a\tremove all alias definitions.\n" +" \n" +" Return success unless a NAME is not an existing alias." +msgstr "" +"Премахване на ИМЕната от списъка с дефинираните синоними.\n" +"\n" +" Опции:\n" +" -a премахване на всички синоними.\n" +"\n" +" Изходен код:\n" +" Връща 0, освен в случаите, когато се зададе ИМЕ, за което\n" +" не е дефиниран синоним." + +#: builtins.c:289 +msgid "" +"Set Readline key bindings and variables.\n" +" \n" +" Bind a key sequence to a Readline function or a macro, or set a\n" +" Readline variable. The non-option argument syntax is equivalent to\n" +" that found in ~/.inputrc, but must be passed as a single argument:\n" +" e.g., bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Options:\n" +" -m keymap Use KEYMAP as the keymap for the duration of this\n" +" command. Acceptable keymap names are emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move,\n" +" vi-command, and vi-insert.\n" +" -l List names of functions.\n" +" -P List function names and bindings.\n" +" -p List functions and bindings in a form that can be\n" +" reused as input.\n" +" -S List key sequences that invoke macros and their values\n" +" -s List key sequences that invoke macros and their values\n" +" in a form that can be reused as input.\n" +" -V List variable names and values\n" +" -v List variable names and values in a form that can\n" +" be reused as input.\n" +" -q function-name Query about which keys invoke the named function.\n" +" -u function-name Unbind all keys which are bound to the named function.\n" +" -r keyseq Remove the binding for KEYSEQ.\n" +" -f filename Read key bindings from FILENAME.\n" +" -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when\n" +" \t\t\t\tKEYSEQ is entered.\n" +" -X\t\t List key sequences bound with -x and associated commands\n" +" in a form that can be reused as input.\n" +" \n" +" Exit Status:\n" +" bind returns 0 unless an unrecognized option is given or an error occurs." +msgstr "" +"Задаване на клавишни комбинации и променливи на readline.\n" +"\n" +" Присвояване на последователност от клавиши на функция или макрос от\n" +" readline или задаване на променлива на readline. Синтаксисът с\n" +" аргументи без опции е еквивалентен на този във файла „~/.inputrc“, но\n" +" трябва да се подаде като единствен аргумент. Напр:\n" +" bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +"\n" +" Опции:\n" +" -m ПОДРЕДБА \n" +" Използване на ПОДРЕДБАта като подредба на функциите на клавишите\n" +" докато командата се изпълнява. Валидни са следните имена:\n" +" „emacs“, „emacs-standard“, „emacs-meta“, „emacs-ctlx“, „vi“,\n" +" „vi-move“, „vi-command“ и „vi-insert“.\n" +" -l Списък с имената на функциите.\n" +" -P Списък с имената на функциите и присвояванията.\n" +" -p Списък с имената на функциите и присвояванията във вид, който може\n" +" да се използва за вход.\n" +" -S Списък с клавишните последователности, които извикват макроси и\n" +" стойностите им.\n" +" -s Списък с клавишните последователности, които извикват макроси и\n" +" стойностите им във вид, който може да се използва за вход.\n" +" -V Списък с имената на променливите и стойностите им.\n" +" -v Списък с имената на променливите и стойностите им във вид, който\n" +" може да се използва за вход.\n" +" -q ИМЕ_НА_ФУНКЦИЯ\n" +" Проверка кои клавиши извикват функцията с това име.\n" +" -u ИМЕ_НА_ФУНКЦИЯ\n" +" Премахване на присвояванията към всички клавиши на функцията с\n" +" това име.\n" +" -r КЛАВИШНА_ПОСЛЕДОВАТЕЛНОСТ\n" +" Премахване на присвоената функция от КЛАВИШНАта_ПОСЛЕДОВАТЕЛНОСТ.\n" +" -f ФАЙЛ\n" +" Прочитане на присвояванията на клавиши от ФАЙЛа.\n" +" -x КЛАВИШНА_ПОСЛЕДОВАТЕЛНОСТ:КОМАНДА_НА_ОБВИВКАТА\n" +" Изпълнение на КОМАНДАта_НА_ОБВИВКАТА при въвеждането на\n" +" КЛАВИШНАта_ПОСЛЕДОВАТЕЛНОСТ.\n" +" -X Извеждане на клавишните комбинации зададени с „-x“ и свързаните с тях\n" +" команди във форма, която може да се ползва и за вход\n" +"\n" +" Изходен код:\n" +" bind връща 0, освен когато е зададена непозната опция или възникне грешка." + +#: builtins.c:328 +msgid "" +"Exit for, while, or until loops.\n" +" \n" +" Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n" +" loops.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Изход от цикли чрез „for“, „while“ или „until“.\n" +" \n" +" Изход от цикли организирани чрез „for“, „while“ или „until“. Ако е зададен\n" +" БРОЙ се излиза от толкова на БРОЙ обхващащи цикли.\n" +" \n" +" Изходен код:\n" +" 0, освен ако е зададен БРОЙ, който е по-малък от 1." + +#: builtins.c:340 +msgid "" +"Resume for, while, or until loops.\n" +" \n" +" Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n" +" If N is specified, resumes the Nth enclosing loop.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Продължаване на цикъл чрез „for“, „while“ или „until“.\n" +"\n" +" Продължаване със следващата итерация от цикъл, организиран с „for“, „while“\n" +" или „until“. Ако е зададен БРОЙ, се продължава със следващата итерация\n" +" на обхващащия цикъл зададен с този БРОЙ.\n" +"\n" +" Изходен код:\n" +" 0, освен ако е зададен БРОЙ, който е по-малък от 1." + +#: builtins.c:352 +msgid "" +"Execute shell builtins.\n" +" \n" +" Execute SHELL-BUILTIN with arguments ARGs without performing command\n" +" lookup. This is useful when you wish to reimplement a shell builtin\n" +" as a shell function, but need to execute the builtin within the function.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n" +" not a shell builtin.." +msgstr "" +"Изпълнение на вградени команди.\n" +"\n" +" Изпълнение на ВГРАДЕНАта_КОМАНДА с АРГУМЕНТи, без да се търси нормална\n" +" команда. Това е полезно в случаите, когато искате да създадете вградена\n" +" команда като функция на обвивката, но във функцията искате да изпълните\n" +" вградената команда.\n" +"\n" +" Изходен код:\n" +" Връща изходния код на ВГРАДЕНАта_КОМАНДА или лъжа, ако извиканата \n" +" ВГРАДЕНА_КОМАНДА всъщност не е вградена команда." + +#: builtins.c:367 +msgid "" +"Return the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns \"$line $filename\". With EXPR, returns\n" +" \"$line $subroutine $filename\"; this extra information can be used to\n" +" provide a stack trace.\n" +" \n" +" The value of EXPR indicates how many call frames to go back before the\n" +" current one; the top frame is frame 0.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless the shell is not executing a shell function or EXPR\n" +" is invalid." +msgstr "" +"Връщане на контекста на текущото извикване на подпрограма.\n" +" \n" +" Без ИЗРАЗ връща „$line $filename“. С ИЗРАЗ връща\n" +" „$line $subroutine $filename“. Допълнителната информация може да се\n" +" използва за получаване на информация за състоянието на стека.\n" +" \n" +" Стойността на ИЗРАЗа показва за колко рамки спрямо текущата да се изведе\n" +" информация. Най-горната рамка е 0.\n" +" \n" +" Изходен код:\n" +" Връща 0, освен ако обвивката изпълнява функция дефинирана в обвивката или\n" +" ИЗРАЗът е грешен." + +#: builtins.c:385 +msgid "" +"Change the shell working directory.\n" +" \n" +" Change the current directory to DIR. The default DIR is the value of the\n" +" HOME shell variable.\n" +" \n" +" The variable CDPATH defines the search path for the directory containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon (:).\n" +" A null directory name is the same as the current directory. If DIR begins\n" +" with a slash (/), then CDPATH is not used.\n" +" \n" +" If the directory is not found, and the shell option `cdable_vars' is set,\n" +" the word is assumed to be a variable name. If that variable has a value,\n" +" its value is used for DIR.\n" +" \n" +" Options:\n" +" -L\tforce symbolic links to be followed: resolve symbolic links in\n" +" \tDIR after processing instances of `..'\n" +" -P\tuse the physical directory structure without following symbolic\n" +" \tlinks: resolve symbolic links in DIR before processing instances\n" +" \tof `..'\n" +" -e\tif the -P option is supplied, and the current working directory\n" +" \tcannot be determined successfully, exit with a non-zero status\n" +" -@ on systems that support it, present a file with extended attributes\n" +" as a directory containing the file attributes\n" +" \n" +" The default is to follow symbolic links, as if `-L' were specified.\n" +" `..' is processed by removing the immediately previous pathname component\n" +" back to a slash or the beginning of DIR.\n" +" \n" +" Exit Status:\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully when\n" +" -P is used; non-zero otherwise." +msgstr "" +"Смяна на работната директория на обвивката.\n" +"\n" +" Смяна на текущата директория да е ДИРЕКТОРИЯ. Променливата „HOME“ е\n" +" стандартната директория.\n" +"\n" +" Променливата „CDPATH“ определя пътя за търсене на директории, които могат да\n" +" съдържат ДИРЕКТОРИЯта. Директориите в „CDPATH“ са разделени с „:“. \n" +" Липсващо име на директория означава текущата директория, т.е. „.“. Ако името\n" +" на ДИРЕКТОРИЯта започва с наклонена черта „/“, „CDPATH“ не се ползва.\n" +"\n" +" Ако директорията не е открита, но е зададена опцията на обвивката\n" +" „cdable_vars“, то думата се пробва като име на променлива. Ако променливата\n" +" има стойност, то директорията се сменя към стойността на тази променлива.\n" +" \n" +" Опции:\n" +" -L налага следването на символните връзки. Символните връзки в\n" +" ДИРЕКТОРИЯта се обработват след указателите към горна директория „..“.\n" +" -P налага използването на фактическата подредба на директориите, вместо\n" +" да се следват символните връзки. Символните връзки в ДИРЕКТОРИЯта се\n" +" обработват след указателите към горна директория „..“.\n" +" -e ако е използвана опцията „-P“ и текущата директория не може да бъде\n" +" определена, командата завършва с ненулев изход.\n" +" -@ на системите с поддръжка на разширени атрибути файлът се представя\n" +" като директория, в която са атрибутите.\n" +"\n" +" Стандартно символните връзки се следват, все едно е зададена опцията „-L“\n" +"\n" +" Изходен код:\n" +" Връща 0 при смяна на директорията. Когато е зададена опцията „-P“, 0 се\n" +" връща при успешно задаване на променливата „PWD„. Във всички останали\n" +" случаи изходът е ненулев." + +#: builtins.c:422 +msgid "" +"Print the name of the current working directory.\n" +" \n" +" Options:\n" +" -L\tprint the value of $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tprint the physical directory, without any symbolic links\n" +" \n" +" By default, `pwd' behaves as if `-L' were specified.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless an invalid option is given or the current directory\n" +" cannot be read." +msgstr "" +"Извеждане на името на текущата работна директория.\n" +" \n" +" Опции:\n" +" -L извежда стойността на променливата „PWD“, ако тя съответства на\n" +" текущата директория\n" +" -P извежда физическата директория без символни връзки\n" +" \n" +" Стандартно поведението на „pwd“ без аргументи съответства на „-L“.\n" +" \n" +" Изходен код:\n" +" 0, освен ако е подадена неправилна опция или текущата директория не може да\n" +" бъде прочетена." + +#: builtins.c:439 +msgid "" +"Null command.\n" +" \n" +" No effect; the command does nothing.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Нулева команда.\n" +" \n" +" Без ефект — командата нищо не прави.\n" +" \n" +" Изходен код:\n" +" Винаги завършва успешно." + +#: builtins.c:450 +msgid "" +"Return a successful result.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Връщане на успешен резултат.\n" +" \n" +" Изходен код:\n" +" Винаги завършва успешно." + +#: builtins.c:459 +msgid "" +"Return an unsuccessful result.\n" +" \n" +" Exit Status:\n" +" Always fails." +msgstr "" +"Връщане на неуспешен резултат.\n" +" \n" +" Изходен код:\n" +" Винаги завършва неуспешно." + +#: builtins.c:468 +msgid "" +"Execute a simple command or display information about commands.\n" +" \n" +" Runs COMMAND with ARGS suppressing shell function lookup, or display\n" +" information about the specified COMMANDs. Can be used to invoke commands\n" +" on disk when a function with the same name exists.\n" +" \n" +" Options:\n" +" -p\tuse a default value for PATH that is guaranteed to find all of\n" +" \tthe standard utilities\n" +" -v\tprint a description of COMMAND similar to the `type' builtin\n" +" -V\tprint a more verbose description of each COMMAND\n" +" \n" +" Exit Status:\n" +" Returns exit status of COMMAND, or failure if COMMAND is not found." +msgstr "" +"Изпълнение на нормална команда или извеждане на информация за команди.\n" +" \n" +" Изпълнение на КОМАНДАта с АРГументи, без тя да се търси като функция на\n" +" обвивката, или извеждане на информация за указаните КОМАНДи. Може да се\n" +" използва за изпълнението на външни команди, дори когато съществува функция\n" +" със същото име.\n" +" \n" +" Опции:\n" +" -p използване на стандартна стойност на PATH. Така могат да се открият\n" +" всички стандартни инструменти\n" +" -v извежда описание на КОМАНДАта подобно на вградената команда „type“\n" +" -V извежда по пълно описание на всяка КОМАНДА\n" +" \n" +" Изходен код:\n" +" Връща изходния код на КОМАНДАта или грешка, ако такава не е открита." + +#: builtins.c:487 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Declare variables and give them attributes. If no NAMEs are given,\n" +" display the attributes and values of all variables.\n" +" \n" +" Options:\n" +" -f\trestrict action or display to function names and definitions\n" +" -F\trestrict display to function names only (plus line number and\n" +" \tsource file when debugging)\n" +" -g\tcreate global variables when used in a shell function; otherwise\n" +" \tignored\n" +" -p\tdisplay the attributes and value of each NAME\n" +" \n" +" Options which set attributes:\n" +" -a\tto make NAMEs indexed arrays (if supported)\n" +" -A\tto make NAMEs associative arrays (if supported)\n" +" -i\tto make NAMEs have the `integer' attribute\n" +" -l\tto convert NAMEs to lower case on assignment\n" +" -n\tmake NAME a reference to the variable named by its value\n" +" -r\tto make NAMEs readonly\n" +" -t\tto make NAMEs have the `trace' attribute\n" +" -u\tto convert NAMEs to upper case on assignment\n" +" -x\tto make NAMEs export\n" +" \n" +" Using `+' instead of `-' turns off the given attribute.\n" +" \n" +" Variables with the integer attribute have arithmetic evaluation (see\n" +" the `let' command) performed when the variable is assigned a value.\n" +" \n" +" When used in a function, `declare' makes NAMEs local, as with the `local'\n" +" command. The `-g' option suppresses this behavior.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or a variable\n" +" assignment error occurs." +msgstr "" +"Задаване на стойности на променливите и атрибутите.\n" +" \n" +" Деклариране на променливи и задаване на атрибутите им. Ако не са дадени\n" +" ИМЕна се изобразяват атрибутите и стойностите на всички променливи.\n" +" \n" +" Опции:\n" +" -f Ограничаване на действието или извеждането до имената и дефинициите\n" +" на функциите\n" +" -F Ограничаване на извеждането само до имената на функциите, заедно с\n" +" номерата на редовете и изходните файлове при изчистване на грешките\n" +" -g Създаване на глобална променлива, когато опцията е употребена във\n" +" функция. В противен случай се пренебрегва\n" +" -p Извеждане на атрибутите и стойността на всяко ИМЕ\n" +" \n" +" Опции за задаването на атрибути:\n" +" -a ИМЕната да са на индексирани масиви (ако се поддържат)\n" +" -A ИМЕната да са асоциативни масиви (ако се поддържат)\n" +" -i ИМЕната да са с атрибут „цяло число“\n" +" -l При присвояване на стойност тя да се преобразува в малки букви\n" +" -n ИМЕто да е указател към променливата с име, което е дадено от\n" +" стойността\n" +" -r ИМЕната да са само за четене\n" +" -t ИМЕната да са с атрибут за трасиране\n" +" -u При присвояване на стойност тя да се преобразува в главни букви\n" +" -x ИМЕната да се изнасят към средата\n" +" \n" +" При използването на „+“ вместо „-“ атрибутът се изключва.\n" +" \n" +" При присвояването на стойност на променлива със зададен атрибут за цяло\n" +" число се извършва аритметично изчисляване (вижте командата „let“).\n" +" the `let' command).\n" +" \n" +" Когато се използва във функция, командата „declare“ прави ИМЕната локални,\n" +" все едно се изпълнява командата „local“. Опцията „-g“ предотвратява това\n" +" поведение.\n" +" \n" +" Изходен код:\n" +" 0, освен ако е зададена неправилна опция или възникне грешка при задаването\n" +" на стойност на променлива." + +#: builtins.c:527 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Obsolete. See `help declare'." +msgstr "" +"Задаване на стойност и атрибути на променливи.\n" +" \n" +" Остаряло. Виж „help declare“." + +#: builtins.c:535 +msgid "" +"Define local variables.\n" +" \n" +" Create a local variable called NAME, and give it VALUE. OPTION can\n" +" be any option accepted by `declare'.\n" +" \n" +" Local variables can only be used within a function; they are visible\n" +" only to the function where they are defined and its children.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied, a variable\n" +" assignment error occurs, or the shell is not executing a function." +msgstr "" +"Дефиниране на локални променливи.\n" +" \n" +" Създаване на локална променлива с това ИМЕ и зададената СТОЙНОСТ. ОПЦИЯта\n" +" може да е всяка приемана от вградената команда „declare“.\n" +" \n" +" Локалните променливи могат да се използват само във функция. Те са видими\n" +" само в нея и нейните наследници.\n" +" \n" +" Изходен код:\n" +" 0, освен ако е зададена неправилна ОПЦИЯ, възникне грешка при задаването на\n" +" стойност на променлива, или в момента не се изпълнява функция." + +#: builtins.c:552 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs, separated by a single space character and followed by a\n" +" newline, on the standard output.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" -e\tenable interpretation of the following backslash escapes\n" +" -E\texplicitly suppress interpretation of backslash escapes\n" +" \n" +" `echo' interprets the following backslash-escaped characters:\n" +" \\a\talert (bell)\n" +" \\b\tbackspace\n" +" \\c\tsuppress further output\n" +" \\e\tescape character\n" +" \\E\tescape character\n" +" \\f\tform feed\n" +" \\n\tnew line\n" +" \\r\tcarriage return\n" +" \\t\thorizontal tab\n" +" \\v\tvertical tab\n" +" \\\\\tbackslash\n" +" \\0nnn\tthe character whose ASCII code is NNN (octal). NNN can be\n" +" \t0 to 3 octal digits\n" +" \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" +" \tcan be one or two hex digits\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Извеждане на аргументите на стандартния изход.\n" +"\n" +" Извеждане на АРГУМЕНТите на стандартния изход разделени с интервали и\n" +" последвани от нов ред.\n" +"\n" +" Опции:\n" +" -n не се извежда знак за нов ред.\n" +" -e включва се интерпретирането на знаците, изброени по-долу, екранирани\n" +" с обратна наклонена черта — „\\“\n" +" -Е изрично се спира интерпретирането на долните знаци\n" +"\n" +" „echo“ поддържа следните екранирани знаци:\n" +" \\a системен звънец\n" +" \\b триене назад\n" +" \\c пропускане на знака за нов ред\n" +" \\e знак за екраниране\n" +" \\E знак за екраниране\n" +" \\f знак „Завършване на формуляра“ (form feed)\n" +" \\n знак за нов ред\n" +" \\r знак „Връщане на каретката“ (carriage return)\n" +" \\t хоризонтална табулация\n" +" \\v вертикална табулация\n" +" \\\\ обратно наклонена черта\n" +" \\0nnn\n" +" знакът с код в ASCII NNN (в осмична бройна система). NNN може да се\n" +" състои от 1 до 3 осмични цифри.\n" +" \\xHH\n" +" знакът с код в ASCII HH (в шестнайсетична бройна система). HH може\n" +" да се състои от 1 до 2 шестнайсетични цифри.\n" +"\n" +" Изходен код:\n" +" Връща 0, освен ако не възникне грешка при извеждането." + +#: builtins.c:588 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs on the standard output followed by a newline.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Извеждане на аргументите на стандартния изход.\n" +" \n" +" Извеждане на АРГументите на стандартния изход последвани от знак за нов ред.\n" +" \n" +" Опции:\n" +" -n без извеждане на знак за нов ред\n" +" \n" +" Изходен код:\n" +" Връща 0, освен ако възникне грешка при извеждането." + +#: builtins.c:603 +msgid "" +"Enable and disable shell builtins.\n" +" \n" +" Enables and disables builtin shell commands. Disabling allows you to\n" +" execute a disk command which has the same name as a shell builtin\n" +" without using a full pathname.\n" +" \n" +" Options:\n" +" -a\tprint a list of builtins showing whether or not each is enabled\n" +" -n\tdisable each NAME or display a list of disabled builtins\n" +" -p\tprint the list of builtins in a reusable format\n" +" -s\tprint only the names of Posix `special' builtins\n" +" \n" +" Options controlling dynamic loading:\n" +" -f\tLoad builtin NAME from shared object FILENAME\n" +" -d\tRemove a builtin loaded with -f\n" +" \n" +" Without options, each NAME is enabled.\n" +" \n" +" To use the `test' found in $PATH instead of the shell builtin\n" +" version, type `enable -n test'.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not a shell builtin or an error occurs." +msgstr "" +"Включване и изключване на вградените в обвивката команди.\n" +" \n" +" Включване и изключване на командите вградени в обвивката. Изключването\n" +" позволява извикването на външна команда със същото име като вградена без\n" +" използването на пълното име с пътя.\n" +" \n" +" Опции:\n" +" -a Извеждане на списъка с вградените команди заедно с това дали са\n" +" включени или не\n" +" -n Изключване на вградените команди с посочените ИМЕна. Ако не са\n" +" дадени ИМЕна, се извежда списъкът с изключените вътрешни команди\n" +" -p Извеждане на списъка с вътрешни команди във формат, който може да\n" +" се ползва като вход\n" +" -s Извеждане само на имената на специалните вградени команди според\n" +" POSIX\n" +" \n" +" Опции за динамичното зареждане:\n" +" -f Зареждане на вградена команда с това ИМЕ от споделения обект в\n" +" посочения ФАЙЛ\n" +" -d Премахване на вътрешна команда заредена с „-f“\n" +" \n" +" Ако не са зададени опции, всяка от вътрешните команди с такова ИМЕ бива\n" +" включена.\n" +" \n" +" За да ползвате командата „test“, която се намира в пътя за изпълнение $PATH,\n" +" вместо вградения в обвивката вариант изпълнете: „enable -n test“.\n" +" \n" +" Изходен код:\n" +" 0, освен ако ИМЕто не е на вградена команда или не възникне грешка." + +#: builtins.c:631 +msgid "" +"Execute arguments as a shell command.\n" +" \n" +" Combine ARGs into a single string, use the result as input to the shell,\n" +" and execute the resulting commands.\n" +" \n" +" Exit Status:\n" +" Returns exit status of command or success if command is null." +msgstr "" +"Изпълнение на аргументите като команда на обвивката.\n" +" \n" +" Комбинира АРГументите в общ низ, който се подава като вход на обвивка,\n" +" която изпълнява получените команди.\n" +" \n" +" Изходен код:\n" +" Връща изходния код на командата или код за успех, ако командата е нулева." + +#: builtins.c:643 +msgid "" +"Parse option arguments.\n" +" \n" +" Getopts is used by shell procedures to parse positional parameters\n" +" as options.\n" +" \n" +" OPTSTRING contains the option letters to be recognized; if a letter\n" +" is followed by a colon, the option is expected to have an argument,\n" +" which should be separated from it by white space.\n" +" \n" +" Each time it is invoked, getopts will place the next option in the\n" +" shell variable $name, initializing name if it does not exist, and\n" +" the index of the next argument to be processed into the shell\n" +" variable OPTIND. OPTIND is initialized to 1 each time the shell or\n" +" a shell script is invoked. When an option requires an argument,\n" +" getopts places that argument into the shell variable OPTARG.\n" +" \n" +" getopts reports errors in one of two ways. If the first character\n" +" of OPTSTRING is a colon, getopts uses silent error reporting. In\n" +" this mode, no error messages are printed. If an invalid option is\n" +" seen, getopts places the option character found into OPTARG. If a\n" +" required argument is not found, getopts places a ':' into NAME and\n" +" sets OPTARG to the option character found. If getopts is not in\n" +" silent mode, and an invalid option is seen, getopts places '?' into\n" +" NAME and unsets OPTARG. If a required argument is not found, a '?'\n" +" is placed in NAME, OPTARG is unset, and a diagnostic message is\n" +" printed.\n" +" \n" +" If the shell variable OPTERR has the value 0, getopts disables the\n" +" printing of error messages, even if the first character of\n" +" OPTSTRING is not a colon. OPTERR has the value 1 by default.\n" +" \n" +" Getopts normally parses the positional parameters ($0 - $9), but if\n" +" more arguments are given, they are parsed instead.\n" +" \n" +" Exit Status:\n" +" Returns success if an option is found; fails if the end of options is\n" +" encountered or an error occurs." +msgstr "" +"Анализиране на опциите и аргументите.\n" +"\n" +" getopts се използва от процедурите на обвивката за анализа на позиционните\n" +" аргументи и опции.\n" +" \n" +" НИЗът_С_ОПЦИИ съдържа знаците, които трябва да се разпознават като опции.\n" +" Ако буквата е следвана от двоеточие, очаква се опцията да получава аргумент,\n" +" който да е разделен от нея с интервал(и).\n" +" \n" +" При всяко извикване „getopts“ поставя следващата опция в променливата на\n" +" обвивката „name“, като я инициализира, ако тя не съществува, а индексът на\n" +" следващия аргумент, който трябва да се обработи, в променливата на обвивката\n" +" „OPTIND“. „OPTIND“ се инициализира да е 1 при всяко извикване на обвивка\n" +" или скрипт. Когато опцията се нуждае от аргумент, той се поставя в\n" +" променливата на обвивката „OPTARG“.\n" +" \n" +" „getopts“ докладва грешки по един от два начина. Ако първият знак на\n" +" „OPTSTRING“ е двоеточие, „getopts“ използва тихо докладване. В този режим\n" +" не се извеждат никакви съобщения за грешка. Ако се срещне неправилна опция,\n" +" „getopts“ слага срещнатия знак за опция в „OPTARG“. Ако липсва задължителен\n" +" аргумент, „getopts“ слага „:“ в променливата „ИМЕ“, а в „OPTARG“ — срещнатия\n" +" знак за опция. Когато „getopts“ не е в режим на тихо докладване и се срещне\n" +" неправилна опция, в променливата „ИМЕ“ се слага „?“, а „OPTARG“ се премахва,\n" +" а ако липсва задължителен аргумент, допълнително се изписва диагностично\n" +" съобщение.\n" +" \n" +" Ако променливата на обвивката „OPTERR“ е със стойност 0, „getopts“ изключва\n" +" извеждането на диагностични съобщения, дори първият знак в „OPTSTRING“ да не\n" +" е двоеточие. По подразбиране „OPTERR“ е със стойност 1.\n" +" \n" +" „getopts“ по принцип анализира позиционните аргументи ($0 — $9), но ако са\n" +" дадени повече аргументи, те биват анализирани вместо това.\n" +"\n" +" Изходен код:\n" +" Връща 0 при откриването на опция. Връща друга стойност при стигането на\n" +" последната опция или при възникването на грешка." + +#: builtins.c:685 +msgid "" +"Replace the shell with the given command.\n" +" \n" +" Execute COMMAND, replacing this shell with the specified program.\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not specified,\n" +" any redirections take effect in the current shell.\n" +" \n" +" Options:\n" +" -a name\tpass NAME as the zeroth argument to COMMAND\n" +" -c\t\texecute COMMAND with an empty environment\n" +" -l\t\tplace a dash in the zeroth argument to COMMAND\n" +" \n" +" If the command cannot be executed, a non-interactive shell exits, unless\n" +" the shell option `execfail' is set.\n" +" \n" +" Exit Status:\n" +" Returns success unless COMMAND is not found or a redirection error occurs." +msgstr "" +"Заместване на обвивката с дадената команда.\n" +"\n" +" Изпълняване на КОМАНДАта, като тя замества текущата обвивка. АРГУМЕНТите\n" +" се подават на КОМАНДАта. Ако не е дадена КОМАНДА, пренасочванията се\n" +" извършват в текущата обвивка.\n" +"\n" +" Опции:\n" +" -a ИМЕ ИМЕ-то се подава като нулевия аргумент на КОМАНДАта\n" +" -c изпълняване на КОМАНДАта в нулева среда\n" +" -l поставяне на тире в нулевия аргумент на КОМАНДАта\n" +"\n" +" Ако КОМАНДАта не може да бъде изпълнена, трябва да съществува неинтерактивна\n" +" обвивка, освен ако не е зададена опцията на обвивката „execfail“.\n" +"\n" +" Изходен код:\n" +" 0, освен когато КОМАНДАта не е открита или възникне грешка при\n" +" пренасочването." + +#: builtins.c:706 +msgid "" +"Exit the shell.\n" +" \n" +" Exits the shell with a status of N. If N is omitted, the exit status\n" +" is that of the last command executed." +msgstr "" +"Изход от обвивката.\n" +" \n" +" Изход от обвивката с този ЦИФРОВ_КОД. Ако той е изпуснат, то изходният код\n" +" е този на последната изпълнена команда." + +#: builtins.c:715 +msgid "" +"Exit a login shell.\n" +" \n" +" Exits a login shell with exit status N. Returns an error if not executed\n" +" in a login shell." +msgstr "" +"Изход от входната обвивка.\n" +" \n" +" Изход от входната обвивка с този ЦИФРОВ_КОД. Връща грешка, ако е изпълнена\n" +" в обвивка, която не е входна." + +#: builtins.c:725 +msgid "" +"Display or execute commands from the history list.\n" +" \n" +" fc is used to list or edit and re-execute commands from the history list.\n" +" FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" +" string, which means the most recent command beginning with that\n" +" string.\n" +" \n" +" Options:\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then EDITOR,\n" +" \t\tthen vi\n" +" -l \tlist lines instead of editing\n" +" -n\tomit line numbers when listing\n" +" -r\treverse the order of the lines (newest listed first)\n" +" \n" +" With the `fc -s [pat=rep ...] [command]' format, COMMAND is\n" +" re-executed after the substitution OLD=NEW is performed.\n" +" \n" +" A useful alias to use with this is r='fc -s', so that typing `r cc'\n" +" runs the last command beginning with `cc' and typing `r' re-executes\n" +" the last command.\n" +" \n" +" Exit Status:\n" +" Returns success or status of executed command; non-zero if an error occurs." +msgstr "" +"Извеждане и/или изпълнение на команди от историята.\n" +"\n" +" fc се използва за изброяването или редактирането и повторното изпълнение на\n" +" команди от списъка на историята.\n" +" ПЪРВИ и ПОСЛЕДЕН са номера, които могат да указват допустимия диапазон. Ако\n" +" е зададен само ПЪРВИят аргумент, той задава низ, който е началото на\n" +" команда.\n" +" \n" +" Опции:\n" +" -e РЕДАКТОР\n" +" избор на текстов редактор, който да се използва. Стандартно е\n" +" указаният в променливата „FCEDIT“, след това се проверява „EDITOR“ и\n" +" в краен случай е „vi“.\n" +" -l редовете да се покажат вместо редактират.\n" +" -n номерата на редовете да не се отпечатват.\n" +" -r обратна подредба (отпред да е най-новият ред).\n" +" \n" +" При варианта „fc -s [ШАБЛОН=ЗАМЕСТИТЕЛ…] [КОМАНДА]“ командата се изпълнява, като\n" +" всяка поява на ШАБЛона се заменя със ЗАМЕСТителя.\n" +" \n" +" Удобен за използване синоним е „r='fc -s'“. По такъв начин, ако напишете\n" +" „r cc“, ще се изпълни последната команда, която започва с „cc“, а когато\n" +" се въведе само „r“, ще се изпълни последната команда.\n" +"\n" +" Изходен код:\n" +" Връща 0 или изхода от последната команда, който не е 0 в случай на грешка." + +#: builtins.c:755 +msgid "" +"Move job to the foreground.\n" +" \n" +" Place the job identified by JOB_SPEC in the foreground, making it the\n" +" current job. If JOB_SPEC is not present, the shell's notion of the\n" +" current job is used.\n" +" \n" +" Exit Status:\n" +" Status of command placed in foreground, or failure if an error occurs." +msgstr "" +"Задаване на задача да е текуща.\n" +"\n" +" Изважда ЗАДАЧА от фонов режим и я прави текуща задача. Ако липсва\n" +" аргумент ЗАДАЧА, се използва текущата задача според обвивката.\n" +"\n" +" Изходен код:\n" +" Изходът от командата, която е зададена да е текуща или грешка, ако при\n" +" поставянето на задачата от фонов към текущ режим възникне такава." + +#: builtins.c:770 +msgid "" +"Move jobs to the background.\n" +" \n" +" Place the jobs identified by each JOB_SPEC in the background, as if they\n" +" had been started with `&'. If JOB_SPEC is not present, the shell's notion\n" +" of the current job is used.\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Поставяне на задачи във фонов режим.\n" +"\n" +" Поставя всяка ЗАДАЧА във фонов режим, все едно е била стартирана с „&“.\n" +" Ако липсва аргумент ЗАДАЧА, се използва текущата задача според обвивката.\n" +"\n" +" Изходен код:\n" +" 0, освен ако управлението на задачи е изключено или възникне грешка." + +#: builtins.c:784 +msgid "" +"Remember or display program locations.\n" +" \n" +" Determine and remember the full pathname of each command NAME. If\n" +" no arguments are given, information about remembered commands is displayed.\n" +" \n" +" Options:\n" +" -d\t\tforget the remembered location of each NAME\n" +" -l\t\tdisplay in a format that may be reused as input\n" +" -p pathname\tuse PATHNAME as the full pathname of NAME\n" +" -r\t\tforget all remembered locations\n" +" -t\t\tprint the remembered location of each NAME, preceding\n" +" \t\teach location with the corresponding NAME if multiple\n" +" \t\tNAMEs are given\n" +" Arguments:\n" +" NAME\t\tEach NAME is searched for in $PATH and added to the list\n" +" \t\tof remembered commands.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not found or an invalid option is given." +msgstr "" +"Запомняне или извеждане на местоположенията на програми.\n" +" \n" +" Определяне и запомняне на пълното име с пътя на всяко ИМЕ. Ако не са дадени\n" +" аргументи, се извежда информация за всички запомнени команди.\n" +" \n" +" Опции:\n" +" -d Забравяне на запомненото местоположение на всички ИМЕна\n" +" -l Извеждане във формат за преизползване като вход\n" +" -p ПЪТ\n" +" Използване на посочения ПЪТ като пълен път за ИМЕто\n" +" -r Забравяне на всички запомнени местоположения\n" +" -t Извеждане на запомнените местоположения на всички ИМЕна. Ако е\n" +" посочено повече от едно ИМЕ, всяко местоположение се предшества от\n" +" ИМЕто\n" +" Аргументи:\n" +" ИМЕ Всяко име се търси в пътя за изпълнение „PATH“ и при намирането му\n" +" се добавя в списъка със запомнени команди.\n" +" \n" +" Изходен код:\n" +" 0, освен ако ИМЕто не бъде открито или е дадена неправилна опция." + +#: builtins.c:809 +msgid "" +"Display information about builtin commands.\n" +" \n" +" Displays brief summaries of builtin commands. If PATTERN is\n" +" specified, gives detailed help on all commands matching PATTERN,\n" +" otherwise the list of help topics is printed.\n" +" \n" +" Options:\n" +" -d\toutput short description for each topic\n" +" -m\tdisplay usage in pseudo-manpage format\n" +" -s\toutput only a short usage synopsis for each topic matching\n" +" \tPATTERN\n" +" \n" +" Arguments:\n" +" PATTERN\tPattern specifiying a help topic\n" +" \n" +" Exit Status:\n" +" Returns success unless PATTERN is not found or an invalid option is given." +msgstr "" +"Извеждане на информация за вградените команди.\n" +" \n" +" Извежда кратка информация за вградените команди. Ако е указан ШАБЛОН, се\n" +" извежда информация за напасващите команди. В противен случай се изважда\n" +" информация за всички команди.\n" +" \n" +" Опции:\n" +" -d Извеждане на кратко описание на всяка тема\n" +" -m Извеждане във формат наподобяващ страница от ръководствата\n" +" -s Извеждане само на кратко обобщение за използването на всяка команда,\n" +" съвпадаща с ШАБЛОНа\n" +" \n" +" Аргументи:\n" +" ШАБЛОН Шаблон за имената на командите, за които да се изведе информация\n" +" \n" +" Изходен код:\n" +" 0, освен ако никоя вградена команда не съвпада с шаблона или е дадена\n" +" неправилна опция." + +#: builtins.c:833 +msgid "" +"Display or manipulate the history list.\n" +" \n" +" Display the history list with line numbers, prefixing each modified\n" +" entry with a `*'. An argument of N lists only the last N entries.\n" +" \n" +" Options:\n" +" -c\tclear the history list by deleting all of the entries\n" +" -d offset\tdelete the history entry at offset OFFSET.\n" +" \n" +" -a\tappend history lines from this session to the history file\n" +" -n\tread all history lines not already read from the history file\n" +" -r\tread the history file and append the contents to the history\n" +" \tlist\n" +" -w\twrite the current history to the history file\n" +" \tand append them to the history list\n" +" \n" +" -p\tperform history expansion on each ARG and display the result\n" +" \twithout storing it in the history list\n" +" -s\tappend the ARGs to the history list as a single entry\n" +" \n" +" If FILENAME is given, it is used as the history file. Otherwise,\n" +" if $HISTFILE has a value, that is used, else ~/.bash_history.\n" +" \n" +" If the $HISTTIMEFORMAT variable is set and not null, its value is used\n" +" as a format string for strftime(3) to print the time stamp associated\n" +" with each displayed history entry. No time stamps are printed otherwise.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" +"Извеждане и управление на списъка на историята.\n" +"\n" +" Отпечатване на списъка на историята с номера на ред. Редовете, които са\n" +" отбелязани със знака „*“, са били променени. Аргументът N указва да се\n" +" извеждат само N на брой реда.\n" +"\n" +" Опции:\n" +" -c изчистване на списъка, като се изтриват всички елементи от него.\n" +" -d ПОЗИЦИЯ\n" +" изтрива елемента в историята намиращ се посочената ПОЗИЦИЯ.\n" +" -a добавя историята от текущата сесия към файла с историята.\n" +" -n прочитане на непрочетените редове от файла с историята.\n" +" -r прочитане на файла с историята и добавяне на съдържанието към текущата\n" +" история.\n" +" -w записване на текущата история във файла за историята.\n" +" -p извършване на историческо заместване за всеки АРГУМЕНТ, а резултатът да\n" +" се изведе, без нищо да се записва в историята на командите.\n" +" -s аргументите, които не са опции, се добавят като един елемент към файла с\n" +" историята.\n" +" \n" +" Ако аргументът ИМЕ_НА_ФАЙЛ е зададен, той се използва като файл за\n" +" историята. Ако той липсва, се използва файлът сочен в променливата на\n" +" средата „HISTFILE“. В противен случай се ползва „~/.bash_history“.\n" +" \n" +" Ако променливата „HISTTIMEFORMAT“ е зададена и не е „null“, стойността ѝ се\n" +" използва като форматиращия низ за функцията „strftime“, за да се отбелязва\n" +" времето свързано с всеки елемент от историята. В противен случай времето не\n" +" се записва.\n" +" \n" +" Изходен код:\n" +" 0. Ако възникне грешка или е подадена неправилна опция връща грешка." + +#: builtins.c:869 +msgid "" +"Display status of jobs.\n" +" \n" +" Lists the active jobs. JOBSPEC restricts output to that job.\n" +" Without options, the status of all active jobs is displayed.\n" +" \n" +" Options:\n" +" -l\tlists process IDs in addition to the normal information\n" +" -n\tlist only processes that have changed status since the last\n" +" \tnotification\n" +" -p\tlists process IDs only\n" +" -r\trestrict output to running jobs\n" +" -s\trestrict output to stopped jobs\n" +" \n" +" If -x is supplied, COMMAND is run after all job specifications that\n" +" appear in ARGS have been replaced with the process ID of that job's\n" +" process group leader.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs.\n" +" If -x is used, returns the exit status of COMMAND." +msgstr "" +"Извежда състоянието на задачите.\n" +"\n" +" Извежда списък с активните задачи. ЗАДАЧАта ограничава информацията до\n" +" себе си. Без опции се отпечатва състоянието на всички активни задачи.\n" +"\n" +" Опции:\n" +" -l включва и идентификатора на процесите заедно със стандартната\n" +" информация.\n" +" -n извеждат се само процесите с променено състояние от последното\n" +" извеждане на тази информация.\n" +" -p извежда само идентификаторите на процесите.\n" +" -r ограничаване на изхода само до работещите задачи.\n" +" -s ограничаване на изхода само до спрените задачи.\n" +"\n" +" Ако е зададена опцията „-x“, КОМАНДАта се изпълнява, след като всички\n" +" ЗАДАЧи, които се появяват като АРГУМЕНТи, се заменят с идентификатора на\n" +" водача на групата процеси.\n" +"\n" +" Изходен код:\n" +" 0, освен ако не е дадена неправилна опция или възникни грешка. Ако се\n" +" ползва „-x“, връща изходното състояние на КОМАНДАта." + +#: builtins.c:896 +msgid "" +"Remove jobs from current shell.\n" +" \n" +" Removes each JOBSPEC argument from the table of active jobs. Without\n" +" any JOBSPECs, the shell uses its notion of the current job.\n" +" \n" +" Options:\n" +" -a\tremove all jobs if JOBSPEC is not supplied\n" +" -h\tmark each JOBSPEC so that SIGHUP is not sent to the job if the\n" +" \tshell receives a SIGHUP\n" +" -r\tremove only running jobs\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option or JOBSPEC is given." +msgstr "" +"Премахване на ЗАДАЧи от текущата обвивка.\n" +" \n" +" Премахва всеки аргумент-задача от таблицата на активните задачи. Ако ЗАДАЧА\n" +" не е указана, се използва тази, която обвивката счита за текуща.\n" +" \n" +" Опции:\n" +" -a премахване на всички задачи, когато не е дадена ЗАДАЧА\n" +" -h предотвратяване на препращането на сигнал SIGHUP към задачата,\n" +" когато тази обвивка получи същия този сигнал\n" +" -r премахване само на стартираните задачи.\n" +" \n" +" Изходен код:\n" +" 0, освен когато е дадена неправилна опция или несъществуваща ЗАДАЧА." + +#: builtins.c:915 +msgid "" +"Send a signal to a job.\n" +" \n" +" Send the processes identified by PID or JOBSPEC the signal named by\n" +" SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n" +" SIGTERM is assumed.\n" +" \n" +" Options:\n" +" -s sig\tSIG is a signal name\n" +" -n sig\tSIG is a signal number\n" +" -l\tlist the signal names; if arguments follow `-l' they are\n" +" \tassumed to be signal numbers for which names should be listed\n" +" \n" +" Kill is a shell builtin for two reasons: it allows job IDs to be used\n" +" instead of process IDs, and allows processes to be killed if the limit\n" +" on processes that you can create is reached.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" +"Изпращане на сигнал към задача.\n" +"\n" +" Изпращане на СИГНАЛа на процеса с такъв ИДЕНТИФИКАТОР_НА_ПРОЦЕС (или\n" +" задачата с такъв ИДЕНТИФИКАТОР_НА_ЗАДАЧА). Ако сигнал с такова име или\n" +" номер не съществува, се използва SIGTERM.\n" +"\n" +" Опции:\n" +" -s СИГНАЛ\n" +" СИГНАЛ се интерпретира като име на сигнал\n" +" -n СИГНАЛ\n" +" СИГНАЛ се интерпретира като номер на сигнал\n" +" -l изброява имената на сигналите. Ако към командата са добавени\n" +" аргументи, те се интерпретират като номера на сигналите чиито имена\n" +" да се изброят.\n" +"\n" +" „kill“ е команда вградена в обвивката поради две причини: позволява да се\n" +" използват и идентификатори на задачи освен идентификатори на процеси, а и\n" +" ако сте пуснали максимално разрешения за вас брой процеси, няма да ви се\n" +" налага да пуснете още един процес, за да убиете друг.\n" +"\n" +" Изходен код:\n" +" 0. Ако възникне грешка или е подадена неправилна опция, връща грешка." + +#: builtins.c:938 +msgid "" +"Evaluate arithmetic expressions.\n" +" \n" +" Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" +" fixed-width integers with no check for overflow, though division by 0\n" +" is trapped and flagged as an error. The following list of operators is\n" +" grouped into levels of equal-precedence operators. The levels are listed\n" +" in order of decreasing precedence.\n" +" \n" +" \tid++, id--\tvariable post-increment, post-decrement\n" +" \t++id, --id\tvariable pre-increment, pre-decrement\n" +" \t-, +\t\tunary minus, plus\n" +" \t!, ~\t\tlogical and bitwise negation\n" +" \t**\t\texponentiation\n" +" \t*, /, %\t\tmultiplication, division, remainder\n" +" \t+, -\t\taddition, subtraction\n" +" \t<<, >>\t\tleft and right bitwise shifts\n" +" \t<=, >=, <, >\tcomparison\n" +" \t==, !=\t\tequality, inequality\n" +" \t&\t\tbitwise AND\n" +" \t^\t\tbitwise XOR\n" +" \t|\t\tbitwise OR\n" +" \t&&\t\tlogical AND\n" +" \t||\t\tlogical OR\n" +" \texpr ? expr : expr\n" +" \t\t\tconditional operator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tassignment\n" +" \n" +" Shell variables are allowed as operands. The name of the variable\n" +" is replaced by its value (coerced to a fixed-width integer) within\n" +" an expression. The variable need not have its integer attribute\n" +" turned on to be used in an expression.\n" +" \n" +" Operators are evaluated in order of precedence. Sub-expressions in\n" +" parentheses are evaluated first and may override the precedence\n" +" rules above.\n" +" \n" +" Exit Status:\n" +" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." +msgstr "" +"Изчисляване на аритметичен израз.\n" +"\n" +" Всеки АРГУМЕНТ е аритметичен израз, който се бъде изчислен. Изчисленията\n" +" се извършват в аритметика с целочислени стойности с постоянна широчина\n" +" без проверка за препълване. Делението на 0 се прихваща и се отбелязва\n" +" грешка. Следващият списък с оператори е разделен на групи според\n" +" приоритета на операциите. Подредбата е с намаляващ приоритет.\n" +" \n" +" id++, id-- последващо увеличаване/намаляване на променлива\n" +" ++id, --id предварително увеличаване/намаляване на променлива\n" +" -, + унарни минус, плюс\n" +" !, ~ логическо и побитово отрицания\n" +" ** вдигане на степен\n" +" *, /, % умножение, деление, целочислен остатък\n" +" +, - събиране, изваждане\n" +" <<, >> побитово местене наляво и надясно\n" +" <=, >=, <, > сравнение\n" +" ==, != равно, различно\n" +" & побитово И\n" +" ^ побитово изключващо ИЛИ\n" +" | побитово ИЛИ\n" +" && логическо И\n" +" || логическо ИЛИ\n" +" ИЗРАЗ ? ИЗРАЗ : ИЗРАЗ\n" +" условен оператор\n" +" =, *=, /=, %=, +=, -=, <<=, >>=, &=, ^=, |=\n" +" присвояване\n" +" \n" +" Разрешено е ползването на променливи на обвивката като операнди. Името на\n" +" променлива се замества с нейната стойност (която се преобразува до цяло\n" +" число с постоянна широчина) в израза. Не е необходимо променливата да е с\n" +" атрибут за целочисленост, за да се използва в израз.\n" +" \n" +" Операторите се изчисляват по приоритет. Подизразите в скоби се изчисляват\n" +" първи и могат да променят приоритета.\n" +" \n" +" Изходен код:\n" +" Ако последният АРГУМЕНТ се изчислява като 0, „let“ връща 1. В противен\n" +" случай — връща 0." + +#: builtins.c:983 +msgid "" +"Read a line from the standard input and split it into fields.\n" +" \n" +" Reads a single line from the standard input, or from file descriptor FD\n" +" if the -u option is supplied. The line is split into fields as with word\n" +" splitting, and the first word is assigned to the first NAME, the second\n" +" word to the second NAME, and so on, with any leftover words assigned to\n" +" the last NAME. Only the characters found in $IFS are recognized as word\n" +" delimiters.\n" +" \n" +" If no NAMEs are supplied, the line read is stored in the REPLY variable.\n" +" \n" +" Options:\n" +" -a array\tassign the words read to sequential indices of the array\n" +" \t\tvariable ARRAY, starting at zero\n" +" -d delim\tcontinue until the first character of DELIM is read, rather\n" +" \t\tthan newline\n" +" -e\t\tuse Readline to obtain the line in an interactive shell\n" +" -i text\tUse TEXT as the initial text for Readline\n" +" -n nchars\treturn after reading NCHARS characters rather than waiting\n" +" \t\tfor a newline, but honor a delimiter if fewer than NCHARS\n" +" \t\tcharacters are read before the delimiter\n" +" -N nchars\treturn only after reading exactly NCHARS characters, unless\n" +" \t\tEOF is encountered or read times out, ignoring any delimiter\n" +" -p prompt\toutput the string PROMPT without a trailing newline before\n" +" \t\tattempting to read\n" +" -r\t\tdo not allow backslashes to escape any characters\n" +" -s\t\tdo not echo input coming from a terminal\n" +" -t timeout\ttime out and return failure if a complete line of input is\n" +" \t\tnot read within TIMEOUT seconds. The value of the TMOUT\n" +" \t\tvariable is the default timeout. TIMEOUT may be a\n" +" \t\tfractional number. If TIMEOUT is 0, read returns immediately,\n" +" \t\twithout trying to read any data, returning success only if\n" +" \t\tinput is available on the specified file descriptor. The\n" +" \t\texit status is greater than 128 if the timeout is exceeded\n" +" -u fd\t\tread from file descriptor FD instead of the standard input\n" +" \n" +" Exit Status:\n" +" The return code is zero, unless end-of-file is encountered, read times out\n" +" (in which case it's greater than 128), a variable assignment error occurs,\n" +" or an invalid file descriptor is supplied as the argument to -u." +msgstr "" +"Изчитане на ред от стандартния вход и разделянето му по полета.\n" +"\n" +" От стандартния вход или от файловия дескриптор ФД, ако е използвана опцията\n" +" „-u“, се прочита един ред. Редът се разделя на полета — думи. Първата дума\n" +" се присвоява на първото ИМЕ, втората дума на второто ИМЕ и т.н., а на\n" +" последното ИМЕ се присвояват оставащите думи. Като разделители на думи се\n" +" използват само знаците указани в променливата „IFS“.\n" +"\n" +" Ако не са дадени ИМЕна, прочетеният ред се запазва в променливата „REPLY“.\n" +"\n" +" Опции:\n" +" -a прочетените думи се присвояват последователно на елементите на МАСИВа,\n" +" като индексът му започва от 0.\n" +" -d РАЗДелител\n" +" четенето продължава прочитането на първия знак, който присъства в\n" +" променливата „DELIM“, а не до минаването на нов ред.\n" +" -e за четене на реда се използва readline, когато обвивката е\n" +" интерактивна.\n" +" -i ТЕКСТ\n" +" за първоначален текст в readline се ползва ТЕКСТ\n" +" -n БРОЙ_ЗНАЦИ\n" +" четенето завършва след прочитането на този БРОЙ_ЗНАЦИ, не се чака за\n" +" нов ред. Разделител в рамките на този БРОЙ_ЗНАЦИ се зачита.\n" +" -N БРОЙ_ЗНАЦИ\n" +" четенето завършва с прочитането на точно този БРОЙ_ЗНАЦИ, освен ако\n" +" не се появи EOF или времето за изчакване на въвеждане не изтече.\n" +" Всички разделители се пренебрегват.\n" +" -p ПОДСКАЗКА\n" +" извежда низа ПОДСКАЗКА без минаване на нов ред, преди да започне\n" +" четенето на знаци от входа.\n" +" -r заместването на екранираните с „\\“ знаци се изключва.\n" +" -s входът от терминал не се отпечатва на екрана.\n" +" -t БРОЙ_СЕКУНДИ\n" +" задава интервал от този БРОЙ_СЕКУНДИ, в който трябва да се въведе цял\n" +" ред. В противен случай read завършва с грешка. Ако е зададена,\n" +" стойността на променливата „TMOUT“ обозначава времето, за което трябва\n" +" да се въведе редът. За БРОЙ_СЕКУНДИ може да се ползва и нецяло число.\n" +" Ако БРОЙ_СЕКУНДИ e 0, read незабавно завършва работа, без да се опитва\n" +" да чете данни и връща код 0, само ако от указания файлов дескриптор\n" +" могат да се прочетат данни.\n" +"\n" +" Изходен код:\n" +" 0, освен ако не се срещне знак за край на файл EOF, изтече време повече от\n" +" указаното в БРОЙ_СЕКУНДИ, при което кодът за изход е над 128, възникне\n" +" грешка при задаване на стойност на променлива или е зададен неправилен\n" +" файлов дескриптор като аргумент на -u." + +#: builtins.c:1028 +msgid "" +"Return from a shell function.\n" +" \n" +" Causes a function or sourced script to exit with the return value\n" +" specified by N. If N is omitted, the return status is that of the\n" +" last command executed within the function or script.\n" +" \n" +" Exit Status:\n" +" Returns N, or failure if the shell is not executing a function or script." +msgstr "" +"Връщане от функция на обвивката.\n" +"\n" +" Кара изпълняваната функция или скрипт да завършат работа със зададения\n" +" изходен ЦИФРОВ_КОД. Ако не е зададен ЦИФРОВ_КОД се използва изходния код на\n" +" последно изпълнената команда във функцията или скрипта.\n" +"\n" +" Изходен код:\n" +" Връща ЦИФРОВия_КОД или грешка, ако обвивката в момента не изпълнява функция\n" +" или скрипт." + +#: builtins.c:1041 +msgid "" +"Set or unset values of shell options and positional parameters.\n" +" \n" +" Change the value of shell attributes and positional parameters, or\n" +" display the names and values of shell variables.\n" +" \n" +" Options:\n" +" -a Mark variables which are modified or created for export.\n" +" -b Notify of job termination immediately.\n" +" -e Exit immediately if a command exits with a non-zero status.\n" +" -f Disable file name generation (globbing).\n" +" -h Remember the location of commands as they are looked up.\n" +" -k All assignment arguments are placed in the environment for a\n" +" command, not just those that precede the command name.\n" +" -m Job control is enabled.\n" +" -n Read commands but do not execute them.\n" +" -o option-name\n" +" Set the variable corresponding to option-name:\n" +" allexport same as -a\n" +" braceexpand same as -B\n" +" emacs use an emacs-style line editing interface\n" +" errexit same as -e\n" +" errtrace same as -E\n" +" functrace same as -T\n" +" hashall same as -h\n" +" histexpand same as -H\n" +" history enable command history\n" +" ignoreeof the shell will not exit upon reading EOF\n" +" interactive-comments\n" +" allow comments to appear in interactive commands\n" +" keyword same as -k\n" +" monitor same as -m\n" +" noclobber same as -C\n" +" noexec same as -n\n" +" noglob same as -f\n" +" nolog currently accepted but ignored\n" +" notify same as -b\n" +" nounset same as -u\n" +" onecmd same as -t\n" +" physical same as -P\n" +" pipefail the return value of a pipeline is the status of\n" +" the last command to exit with a non-zero status,\n" +" or zero if no command exited with a non-zero status\n" +" posix change the behavior of bash where the default\n" +" operation differs from the Posix standard to\n" +" match the standard\n" +" privileged same as -p\n" +" verbose same as -v\n" +" vi use a vi-style line editing interface\n" +" xtrace same as -x\n" +" -p Turned on whenever the real and effective user ids do not match.\n" +" Disables processing of the $ENV file and importing of shell\n" +" functions. Turning this option off causes the effective uid and\n" +" gid to be set to the real uid and gid.\n" +" -t Exit after reading and executing one command.\n" +" -u Treat unset variables as an error when substituting.\n" +" -v Print shell input lines as they are read.\n" +" -x Print commands and their arguments as they are executed.\n" +" -B the shell will perform brace expansion\n" +" -C If set, disallow existing regular files to be overwritten\n" +" by redirection of output.\n" +" -E If set, the ERR trap is inherited by shell functions.\n" +" -H Enable ! style history substitution. This flag is on\n" +" by default when the shell is interactive.\n" +" -P If set, do not resolve symbolic links when executing commands\n" +" such as cd which change the current directory.\n" +" -T If set, the DEBUG trap is inherited by shell functions.\n" +" -- Assign any remaining arguments to the positional parameters.\n" +" If there are no remaining arguments, the positional parameters\n" +" are unset.\n" +" - Assign any remaining arguments to the positional parameters.\n" +" The -x and -v options are turned off.\n" +" \n" +" Using + rather than - causes these flags to be turned off. The\n" +" flags can also be used upon invocation of the shell. The current\n" +" set of flags may be found in $-. The remaining n ARGs are positional\n" +" parameters and are assigned, in order, to $1, $2, .. $n. If no\n" +" ARGs are given, all shell variables are printed.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given." +msgstr "" +"Задаване или изтриване на позиционни параметри и опции на обвивката.\n" +"\n" +" Промяна на стойностите на позиционните параметри и опции на обвивката,\n" +" Извеждане на имената и стойностите на променливите на обвивката.\n" +"\n" +" Опции:\n" +" -a Отбелязване на променливите, които са създадени или променени, да\n" +" бъдат изнесени.\n" +" -b Незабавно известяване на спиране на задача.\n" +" -e Незабавен изход, ако команда приключи команда с код, който не е 0.\n" +" -f Изключване на генерирането на имена на файлове (чрез „*“, „?“ и т.н.).\n" +" -h Запомняне на местоположението на команди при търсенето им.\n" +" -k Всички аргументи за присвояване се поместват в средата на команда, не\n" +" само тези, които предхождат името на команда.\n" +" -m Включване на управлението на задачи.\n" +" -n Прочитане на команди, без да се изпълняват.\n" +" -o ИМЕ_НА_ОПЦИЯ\n" +" Задаване на променливата, която отговаря на ИМЕто_НА_ОПЦИЯ:\n" +" allexport същото като „-a“\n" +" braceexpand същото като „-B“\n" +" emacs интерфейс за редактиране подобен на „emacs“\n" +" errexit същото като „-e“\n" +" errtrace същото като „-E“\n" +" functrace същото като „-T“\n" +" hashall същото като „-h“\n" +" histexpand същото като „-H“\n" +" history включване на историята на командите\n" +" ignoreeof обвивката няма да излезе при откриване на знак за край\n" +" на файл „EOF“.\n" +" interactive-comments\n" +" позволяване на коментари в интерактивните команди\n" +" keyword същото като „-k“\n" +" monitor същото като „-m“\n" +" noclobber същото като „-C“\n" +" noexec същото като „-n“\n" +" noglob същото като „-f“\n" +" nolog тази опция се приема в момента, но се игнорира\n" +" notify същото като „-b“\n" +" nounset същото като „-u“\n" +" onecmd същото като „-t“\n" +" physical същото като „-P“\n" +" pipefail изходният код на програмния канал е този на последната\n" +" команда, която завършва с код различен от 0\n" +" posix промяна на поведението на „bash“ да отговаря по-добре\n" +" на стандарта POSIX\n" +" privileged същото като „-p“\n" +" verbose същото като „-v“\n" +" vi използване на интерфейс за редактиране подобен на „vi“\n" +" xtrace същото като „-x“\n" +" -p Опцията e включена, когато реалният и ефективният идентификатори на\n" +" процеси не съвпадат. Изключва обработката на файла посочен в\n" +" променливата „ENV“ и внасянето на функции на обвивката. Изключването\n" +" на тази опция води до това ефективните идентификатори за потребител и\n" +" група да станат равни на реалните.\n" +" -t Изход след прочитането и изпълнението на една команда.\n" +" -u Незададените променливи да се третират като грешки при заместването.\n" +" -v Отпечатване на входните редове към обвивката при прочитането им.\n" +" -x Отпечатване на командите и аргументите им при изпълнението им.\n" +" -B Обвивката ще извършва заместване на изразите с фигурни скоби.\n" +" -C Предотвратяване на презаписването на съществуващите обикновени файлове\n" +" чрез пренасочване на изхода.\n" +" -E Прихващането за „ERR“ да се наследява от функциите на обвивката.\n" +" -H Включване на заместването чрез историята с „!“. Стандартно тази опция\n" +" е налична само за интерактивните обвивки.\n" +" -P Да не се следват символните връзки при изпълнението на команди като\n" +" „cd“, които променят текущата директория.\n" +" -T Прихващането за „DEBUG“ да се наследява от функциите на обвивката.\n" +" -- Оставащите аргументи да се тълкуват като позиционни. Ако няма повече\n" +" аргументи, се изтриват съответните позиционни.\n" +" - Оставащите аргументи да се тълкуват като позиционни. Опциите „-x“ и\n" +" „-v“ са изключени.\n" +" \n" +" Използването на „+“ вместо „-“ изключва опциите. Тези опции могат да се\n" +" използват и при стартирането на обвивката. Текущото им състояние се намира\n" +" в променливата „-“ (получава се с „$-“). Останалите АРГументи са позиционни\n" +" и се присвояват съответно на променливите с имена „1“, „2“,… „n“ (получават\n" +" се с „$1“, „$2“,… „${n}“). Ако не са зададени АРГументи, се извеждат\n" +" всички променливи на средата.\n" +"\n" +" Изходен код:\n" +" 0, освен ако не е зададена неправилна опция." + +#: builtins.c:1126 +msgid "" +"Unset values and attributes of shell variables and functions.\n" +" \n" +" For each NAME, remove the corresponding variable or function.\n" +" \n" +" Options:\n" +" -f\ttreat each NAME as a shell function\n" +" -v\ttreat each NAME as a shell variable\n" +" -n\ttreat each NAME as a name reference and unset the variable itself\n" +" \trather than the variable it references\n" +" \n" +" Without options, unset first tries to unset a variable, and if that fails,\n" +" tries to unset a function.\n" +" \n" +" Some variables cannot be unset; also see `readonly'.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a NAME is read-only." +msgstr "" +"Изтриване на стойностите и атрибутите на променливите и функциите на обвивката.\n" +" \n" +" За всяко ИМЕ изтрива съответната променлива или функция.\n" +" \n" +" Опции:\n" +" -f всяко ИМЕ се тълкува като функция на обвивката\n" +" -v всяко ИМЕ се тълкува като променлива на обвивката\n" +" -n всяко ИМЕ се тълкува като променлива-указател — трие се самата\n" +" променлива, а не тази, към която тя сочи\n" +" \n" +" Ако не са подадени опции, командата unset първо се опитва да изтрие\n" +" променлива и след това функция с това ИМЕ.\n" +" \n" +" Някои променливи не могат да бъдат изтрити. Вижте вградената команда\n" +" „readonly“ (само за четене).\n" +" \n" +" Изходен код:\n" +" 0, освен ако е зададена неправилна опция или някое от ИМЕната е само за\n" +" четене." + +#: builtins.c:1148 +msgid "" +"Set export attribute for shell variables.\n" +" \n" +" Marks each NAME for automatic export to the environment of subsequently\n" +" executed commands. If VALUE is supplied, assign VALUE before exporting.\n" +" \n" +" Options:\n" +" -f\trefer to shell functions\n" +" -n\tremove the export property from each NAME\n" +" -p\tdisplay a list of all exported variables and functions\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" +"Задаване на атрибута за изнасяне на променливите на обвивката.\n" +" \n" +" Обозначава всяко едно от ИМЕната за изнасяне в средата на изпълнение на\n" +" последващо изпълнените команди. Ако е дадена СТОЙНОСТ, тя се присвоява на\n" +" ИМЕто преди изнасянето.\n" +" \n" +" Опции:\n" +" -f ИМЕто е на функция на обвивката\n" +" -n Премахване на атрибута за изнасяне от всяко от ИМЕната\n" +" -p Извеждане на списък с имената на всички променливи и функции за\n" +" изнасяне\n" +" \n" +" Аргументът „--“ прекъсва по нататъшната обработка на опции.\n" +" \n" +" Изходен код:\n" +" 0, освен ако е зададена неправилна опция или някое от ИМЕната е неправилно." + +#: builtins.c:1167 +msgid "" +"Mark shell variables as unchangeable.\n" +" \n" +" Mark each NAME as read-only; the values of these NAMEs may not be\n" +" changed by subsequent assignment. If VALUE is supplied, assign VALUE\n" +" before marking as read-only.\n" +" \n" +" Options:\n" +" -a\trefer to indexed array variables\n" +" -A\trefer to associative array variables\n" +" -f\trefer to shell functions\n" +" -p\tdisplay a list of all readonly variables or functions, depending on\n" +" whether or not the -f option is given\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" +"Задаване на променливи на обвивката като непроменливи константи.\n" +" \n" +" Отбелязване на всяко от ИМЕната само за четене. Тяхната стойност не може да\n" +" бъде променяна чрез последващо присвояване. Ако е дадена СТОЙНОСТ, тя се\n" +" задава на името преди задаването му като константно.\n" +" \n" +" Опции:\n" +" -a ИМЕната са на променливи-масиви\n" +" -A ИМЕната са на променливи-асоциативни масиви\n" +" -f ИМЕната са на функции на обвивката\n" +" -p Извеждане на имената на всички константни променливи или функции, в\n" +" зависимост дали е зададена опцията „-f“\n" +" \n" +" Аргументът „--“ прекъсва по нататъшната обработка на опции.\n" +" \n" +" Изходен код:\n" +" 0, освен ако е зададена неправилна опция или някое от ИМЕната е неправилно." + +#: builtins.c:1189 +msgid "" +"Shift positional parameters.\n" +" \n" +" Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n" +" not given, it is assumed to be 1.\n" +" \n" +" Exit Status:\n" +" Returns success unless N is negative or greater than $#." +msgstr "" +"Изместване на позиционните параметри.\n" +"\n" +" Преименуване на позиционните параметри „БРОЙ+1“, „БРОЙ+2“… на 1, 2…. Така\n" +" те стават достъпни не като ${БРОЙ+1}…, като „$1“…. Ако не е зададена\n" +" стойност БРОЙ, се използва 1.\n" +"\n" +" Изходен код:\n" +" 0, освен ако БРОят е отрицателно или по-голямо от стойността „$#“." + +#: builtins.c:1201 builtins.c:1216 +msgid "" +"Execute commands from a file in the current shell.\n" +" \n" +" Read and execute commands from FILENAME in the current shell. The\n" +" entries in $PATH are used to find the directory containing FILENAME.\n" +" If any ARGUMENTS are supplied, they become the positional parameters\n" +" when FILENAME is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed in FILENAME; fails if\n" +" FILENAME cannot be read." +msgstr "" +"Изпълняване на команди от файл в текущата обвивка\n" +"\n" +" Изчитане и изпълнение на командите от ФАЙЛа и изход. Директориите описани в\n" +" променливата „PATH“ се използват за изпълнението на командите от ФАЙЛа. Ако\n" +" са зададени АРГУМЕНТИ, те се превръщат в позиционни аргументи при\n" +" изпълнението на ФАЙЛа.\n" +"\n" +" Изходен код:\n" +" Връща състоянието на последно изпълнената команда във ФАЙЛа. Ако той не\n" +" може да бъде открит, изходът е грешка." + +#: builtins.c:1232 +msgid "" +"Suspend shell execution.\n" +" \n" +" Suspend the execution of this shell until it receives a SIGCONT signal.\n" +" Unless forced, login shells cannot be suspended.\n" +" \n" +" Options:\n" +" -f\tforce the suspend, even if the shell is a login shell\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Временно спиране на изпълнението на обвивката.\n" +" \n" +" Спиране на работата на тази обвивка докато обвивката не получи сигнал\n" +" SIGCONT. Освен ако изрично не се зададе опция, входните обвивки не могат да\n" +" бъдат спрени по този начин.\n" +" \n" +" Опции:\n" +" -f Задължително спиране, дори и ако обвивката е входяща\n" +" \n" +" Изходен код:\n" +" 0, освен ако не възникне грешка или управлението на задачи е изключено." + +#: builtins.c:1248 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" Exits with a status of 0 (true) or 1 (false) depending on\n" +" the evaluation of EXPR. Expressions may be unary or binary. Unary\n" +" expressions are often used to examine the status of a file. There\n" +" are string operators and numeric comparison operators as well.\n" +" \n" +" The behavior of test depends on the number of arguments. Read the\n" +" bash manual page for the complete specification.\n" +" \n" +" File operators:\n" +" \n" +" -a FILE True if file exists.\n" +" -b FILE True if file is block special.\n" +" -c FILE True if file is character special.\n" +" -d FILE True if file is a directory.\n" +" -e FILE True if file exists.\n" +" -f FILE True if file exists and is a regular file.\n" +" -g FILE True if file is set-group-id.\n" +" -h FILE True if file is a symbolic link.\n" +" -L FILE True if file is a symbolic link.\n" +" -k FILE True if file has its `sticky' bit set.\n" +" -p FILE True if file is a named pipe.\n" +" -r FILE True if file is readable by you.\n" +" -s FILE True if file exists and is not empty.\n" +" -S FILE True if file is a socket.\n" +" -t FD True if FD is opened on a terminal.\n" +" -u FILE True if the file is set-user-id.\n" +" -w FILE True if the file is writable by you.\n" +" -x FILE True if the file is executable by you.\n" +" -O FILE True if the file is effectively owned by you.\n" +" -G FILE True if the file is effectively owned by your group.\n" +" -N FILE True if the file has been modified since it was last read.\n" +" \n" +" FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" +" modification date).\n" +" \n" +" FILE1 -ot FILE2 True if file1 is older than file2.\n" +" \n" +" FILE1 -ef FILE2 True if file1 is a hard link to file2.\n" +" \n" +" String operators:\n" +" \n" +" -z STRING True if string is empty.\n" +" \n" +" -n STRING\n" +" STRING True if string is not empty.\n" +" \n" +" STRING1 = STRING2\n" +" True if the strings are equal.\n" +" STRING1 != STRING2\n" +" True if the strings are not equal.\n" +" STRING1 < STRING2\n" +" True if STRING1 sorts before STRING2 lexicographically.\n" +" STRING1 > STRING2\n" +" True if STRING1 sorts after STRING2 lexicographically.\n" +" \n" +" Other operators:\n" +" \n" +" -o OPTION True if the shell option OPTION is enabled.\n" +" -v VAR\t True if the shell variable VAR is set\n" +" -R VAR\t True if the shell variable VAR is set and is a name reference.\n" +" ! EXPR True if expr is false.\n" +" EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n" +" EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n" +" \n" +" arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Arithmetic binary operators return true if ARG1 is equal, not-equal,\n" +" less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n" +" than ARG2.\n" +" \n" +" Exit Status:\n" +" Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n" +" false or an invalid argument is given." +msgstr "" +"Изчисляване на условен израз.\n" +"\n" +" Изход с код 0 (истина) или 1 (лъжа) в зависимост от стойността на ИЗРАЗа.\n" +" Изразите могат да бъдат унарни или бинарни. Унарните най-често се използват\n" +" за проверка на състоянието на файл. Освен тях има и оператори за числови\n" +" сравнения и низови оператори.\n" +" \n" +" Поведението на тестовете зависи от броя на аргументите. За цялостно\n" +" описание прочетете страниците от ръководството на bash.\n" +"\n" +" Файлови оператори:\n" +" \n" +" -a ФАЙЛ Истина, ако ФАЙЛът съществува.\n" +" -b ФАЙЛ Истина, ако ФАЙЛът е блоково устройство.\n" +" -c ФАЙЛ Истина, ако ФАЙЛът е знаково устройство.\n" +" -d ФАЙЛ Истина, ако ФАЙЛът е директория.\n" +" -e ФАЙЛ Истина, ако ФАЙЛът съществува.\n" +" -f ФАЙЛ Истина, ако ФАЙЛът съществува и е обикновен файл.\n" +" -g ФАЙЛ Истина, ако ФАЙЛът е със зададен бит за смяна на група\n" +" при изпълнение.\n" +" -h ФАЙЛ Истина, ако ФАЙЛът е символна връзка.\n" +" -L ФАЙЛ Истина, ако ФАЙЛът е символна връзка.\n" +" -k ФАЙЛ Истина, ако ФАЙЛът е със зададен лепкав бит.\n" +" -p ФАЙЛ Истина, ако ФАЙЛът е именуван програмен канал.\n" +" -r ФАЙЛ Истина, ако ФАЙЛът може да бъде прочетен от вас.\n" +" -s ФАЙЛ Истина, ако ФАЙЛът може да бъде записван от вас.\n" +" -S ФАЙЛ Истина, ако ФАЙЛът е програмно гнездо.\n" +" -t ФДСК Истина, ако Файловият_ДеСКриптор е отворен на терминал.\n" +" -u ФАЙЛ Истина, ако ФАЙЛът е със зададен бит за смяна на потребител\n" +" при изпълнение.\n" +" -w ФАЙЛ Истина, ако ФАЙЛът може да бъде записван от вас.\n" +" -x ФАЙЛ Истина, ако ФАЙЛът може да бъде изпълняван от вас.\n" +" -O ФАЙЛ Истина, ако ФАЙЛът може да бъде ефективно притежаван от вас.\n" +" -G ФАЙЛ Истина, ако ФАЙЛът може да бъде ефективно притежаван от вашата\n" +" група.\n" +" -N ФАЙЛ Истина, ако ФАЙЛът е бил променян от последното му прочитане.\n" +" \n" +" ФАЙЛ_1 -nt ФАЙЛ_2 Истина, ако ФАЙЛ_1 е по-нов от ФАЙЛ_2 (според\n" +" датата на промяна).\n" +" ФАЙЛ_1 -ot ФАЙЛ_2 Истина, ако ФАЙЛ_1 е по-стар от ФАЙЛ_2 (според\n" +" датата на промяна). \n" +" ФАЙЛ_1 -ef ФАЙЛ_2 Истина, ако ФАЙЛ_1 е твърда връзка към ФАЙЛ_2.\n" +" \n" +" Низови оператори:\n" +" \n" +" -z НИЗ Истина, ако НИЗът е празен.\n" +" -n НИЗ Истина, ако НИЗът не е празен.\n" +" НИЗ Истина, ако НИЗът не е празен.\n" +" \n" +" НИЗ_1 = НИЗ_2 Истина, ако низовете са равни.\n" +" НИЗ_1 != НИЗ_2 Истина, ако низовете не са равни.\n" +" НИЗ_1 < НИЗ_2 Истина, ако НИЗ_1 е лексикографски преди НИЗ_2.\n" +" НИЗ_1 > НИЗ_2 Истина, ако НИЗ_1 е лексикографски след НИЗ_2.\n" +" \n" +" Други оператори:\n" +" \n" +" -o ОПЦИЯ Истина, ако ОПЦИЯта на обвивката е зададена.\n" +" -v ПРОМЕНЛИВА Истина, ако ПРОМЕНЛИВАта на обвивката е зададена.\n" +" -R ПРОМЕНЛИВА Истина, ако ПРОМЕНЛИВАта е зададена като променлива-\n" +" указател.\n" +" ! ИЗРАЗ Истина, ако ИЗРАЗът е лъжа.\n" +" ИЗРАЗ_1 -a ИЗРАЗ_2 Истина, ако и двата ИЗРАЗа са истина.\n" +" ИЗРАЗ_1 -o ИЗРАЗ_2 Истина, ако поне един от ИЗРАЗите е истина.\n" +" АРГ_1 ОПЕР АРГ_2 Аритметични тестове. Те връщат истина, ако се\n" +" изпълнява математическото условие на ОПЕРатора,\n" +" който е един от следните (значението е в скоби):\n" +" „-eq“ (=), „-ne“ (!=), „-lt“ (<), „-le“ (<=),\n" +" „-gt“ (>) , „-ge“ (>=).\n" +" \n" +" Аритметичните изрази завършват истинно, ако АРГумент_1 е съответно равен,\n" +" неравен, по-малък, по-малък или равен, по-голям, по-голям или равен на\n" +" АРГумент_2.\n" +" \n" +" Изходен код:\n" +" 0, ако ИЗРАЗът е верен. Грешка, когато ИЗРАЗът е неверен или е даден\n" +" неправилен аргумент." + +#: builtins.c:1329 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" This is a synonym for the \"test\" builtin, but the last argument must\n" +" be a literal `]', to match the opening `['." +msgstr "" +"Изчисляване на условен израз.\n" +"\n" +" Това е синоним на вградената команда „test“, но последният аргумент трябва\n" +" задължително да е знакът „]“, който да съответства на отварящата квадратна\n" +" скоба „[“." + +#: builtins.c:1338 +msgid "" +"Display process times.\n" +" \n" +" Prints the accumulated user and system times for the shell and all of its\n" +" child processes.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Извеждане на времето на работа на процесите.\n" +" \n" +" Отпечатва общото потребителско и системно време на работа на обвивката и\n" +" всичките ѝ дъщерни процеси.\n" +" \n" +" Изходен код:\n" +" Винаги 0." + +#: builtins.c:1350 +msgid "" +"Trap signals and other events.\n" +" \n" +" Defines and activates handlers to be run when the shell receives signals\n" +" or other conditions.\n" +" \n" +" ARG is a command to be read and executed when the shell receives the\n" +" signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n" +" is supplied) or `-', each specified signal is reset to its original\n" +" value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" +" shell and by the commands it invokes.\n" +" \n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or a\n" +" script run by the . or source builtins finishes executing. A SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause the\n" +" shell to exit when the -e option is enabled.\n" +" \n" +" If no arguments are supplied, trap prints the list of commands associated\n" +" with each signal.\n" +" \n" +" Options:\n" +" -l\tprint a list of signal names and their corresponding numbers\n" +" -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" +" \n" +" Each SIGNAL_SPEC is either a signal name in or a signal number.\n" +" Signal names are case insensitive and the SIG prefix is optional. A\n" +" signal may be sent to the shell with \"kill -signal $$\".\n" +" \n" +" Exit Status:\n" +" Returns success unless a SIGSPEC is invalid or an invalid option is given." +msgstr "" +"Прихващане на сигналите и другите събития.\n" +"\n" +" Дефинира и задейства функции за обработка, когато обвивката получи сигнал\n" +" или възникне друго събитие.\n" +"\n" +" Командата АРГУМЕНТ ще бъде прочетена и изпълнена, когато обвивката получи\n" +" УКАЗАНия_СИГНАЛ(и). Ако АРГУМЕНТът липсва (и се подава единичен\n" +" УКАЗАН_СИГНАЛ) или е „-“, то всеки УКАЗАН_СИГНАЛ се връща към първоначалната\n" +" си стойност. Ако АРГУМЕНТът е нулевият низ, всеки УКАЗАН_СИГНАЛ се\n" +" пренебрегва от обвивката и командите, които се стартират през нея.\n" +"\n" +" Ако УКАЗАНият_СИГНАЛ е „EXIT (0)“, то командата АРГУМЕНТ се изпълнява от\n" +" обвивката при изход. Ако УКАЗАНият_СИГНАЛ е „DEBUG“, АРГУМЕНТът се\n" +" изпълнява след всяка проста команда. Ако УКАЗАНият_СИГНАЛ е „RETURN“,\n" +" АРГУМЕНТът се изпълнява след всяко изпълнение на функция както и изпълнение\n" +" на скрипт чрез вградените команди „.“ и „source“. Ако УКАЗАНият_СИГНАЛ е\n" +" „ERR“, АРГУМЕНТът се изпълнява след всяка грешка, която би предизвикала\n" +" изход от обвивката при стартирането ѝ с опцията „-e“.\n" +"\n" +" Ако не са дадени аргументи, се отпечатват командите присвоени на всички\n" +" прихващания.\n" +" \n" +" Опции:\n" +" -l отпечатва списъка с имената на сигналите и съответстващите им номера.\n" +" -p извеждат се командите свързани с всеки УКАЗАН_СИГНАЛ.\n" +"\n" +" Всеки УКАЗАН_СИГНАЛ е или име на сигнал от файла „signal.h“ или номер на\n" +" сигнал.\n" +" Няма разлика между главни и малки букви в имената на сигнали, а представката\n" +" „SIG“ не е задължителна.\n" +" Сигнал може да бъде изпратен на обвивката с командата „kill -signal $$“.\n" +"\n" +" Изходен код:\n" +" 0, освен ако е зададен неправилен сигнал или опция." + +#: builtins.c:1386 +msgid "" +"Display information about command type.\n" +" \n" +" For each NAME, indicate how it would be interpreted if used as a\n" +" command name.\n" +" \n" +" Options:\n" +" -a\tdisplay all locations containing an executable named NAME;\n" +" \tincludes aliases, builtins, and functions, if and only if\n" +" \tthe `-p' option is not also used\n" +" -f\tsuppress shell function lookup\n" +" -P\tforce a PATH search for each NAME, even if it is an alias,\n" +" \tbuiltin, or function, and returns the name of the disk file\n" +" \tthat would be executed\n" +" -p\treturns either the name of the disk file that would be executed,\n" +" \tor nothing if `type -t NAME' would not return `file'.\n" +" -t\toutput a single word which is one of `alias', `keyword',\n" +" \t`function', `builtin', `file' or `', if NAME is an alias, shell\n" +" \treserved word, shell function, shell builtin, disk file, or not\n" +" \tfound, respectively\n" +" \n" +" Arguments:\n" +" NAME\tCommand name to be interpreted.\n" +" \n" +" Exit Status:\n" +" Returns success if all of the NAMEs are found; fails if any are not found." +msgstr "" +"Извеждане на информация за вида на командата подадена като аргумент.\n" +" \n" +" За всяко ИМЕ се извежда как ще се интерпретира, когато се използва като\n" +" команда.\n" +" \n" +" Опции:\n" +" -a Извеждане на всички местоположения, които съдържат изпълним файл с\n" +" това ИМЕ. Включва синонимите, вградените команди и функции на\n" +" обвивката, само когато не е използвана опцията „-p“\n" +" -f Без търсене във функциите дефинирани в обвивката\n" +" -P Търсене в пътя за изпълнение указан в PATH, дори и ако съществува\n" +" синоним, вградена команда или функция дефинирана в обвивката с това\n" +" ИМЕ\n" +" -p Връща или името на файла, който ще бъде изпълнен или нищо в\n" +" случаите, когато командата „type -t ИМЕ“ не би върнала „file“\n" +" -t Извеждане на една от думите „alias“ (синоним), „keyword“\n" +" (резервирана лексема в обвивката), „function“ (функция дефинирана в\n" +" обвивката), „builtin“ (вградена команда), „file“ (изпълним файл) или\n" +" „“, ако ИМЕто не е открито\n" +" \n" +" Аргументи:\n" +" ИМЕ Името, за което да се изведе информация.\n" +" \n" +" Изходен код:\n" +" 0, ако всички подадени ИМЕна са открити, неуспех, ако някое от тях липсва." + +#: builtins.c:1417 +msgid "" +"Modify shell resource limits.\n" +" \n" +" Provides control over the resources available to the shell and processes\n" +" it creates, on systems that allow such control.\n" +" \n" +" Options:\n" +" -S\tuse the `soft' resource limit\n" +" -H\tuse the `hard' resource limit\n" +" -a\tall current limits are reported\n" +" -b\tthe socket buffer size\n" +" -c\tthe maximum size of core files created\n" +" -d\tthe maximum size of a process's data segment\n" +" -e\tthe maximum scheduling priority (`nice')\n" +" -f\tthe maximum size of files written by the shell and its children\n" +" -i\tthe maximum number of pending signals\n" +" -l\tthe maximum size a process may lock into memory\n" +" -m\tthe maximum resident set size\n" +" -n\tthe maximum number of open file descriptors\n" +" -p\tthe pipe buffer size\n" +" -q\tthe maximum number of bytes in POSIX message queues\n" +" -r\tthe maximum real-time scheduling priority\n" +" -s\tthe maximum stack size\n" +" -t\tthe maximum amount of cpu time in seconds\n" +" -u\tthe maximum number of user processes\n" +" -v\tthe size of virtual memory\n" +" -x\tthe maximum number of file locks\n" +" -T the maximum number of threads\n" +" \n" +" Not all options are available on all platforms.\n" +" \n" +" If LIMIT is given, it is the new value of the specified resource; the\n" +" special LIMIT values `soft', `hard', and `unlimited' stand for the\n" +" current soft limit, the current hard limit, and no limit, respectively.\n" +" Otherwise, the current value of the specified resource is printed. If\n" +" no option is given, then -f is assumed.\n" +" \n" +" Values are in 1024-byte increments, except for -t, which is in seconds,\n" +" -p, which is in increments of 512 bytes, and -u, which is an unscaled\n" +" number of processes.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Промяна на ресурсите на обвивката.\n" +"\n" +" Командата осъществява контрол върху ресурсите, които са достъпни на\n" +" процесите стартирани през обвивката върху системите, които поддържат такова\n" +" управление.\n" +"\n" +" Опции:\n" +" -S използване на „мекото“ ограничение на ресурс\n" +" -H използване на „твърдото“ ограничение на ресурс\n" +" -a извеждат се всички текущи ограничения\n" +" -b размер на буфера за програмните гнезда\n" +" -c максималният размер на създадените файлове със съдържание на\n" +" паметта (core)\n" +" -d максималният размер на сегмента на процес за данни\n" +" -e максималният приоритет (nice)\n" +" -f максималният размер на файловете създадени от обвивката и дъщерните\n" +" ѝ процеси\n" +" -i максималният брой на изчакващите сигнали\n" +" -l максималният размер памет, която процес може да заключи\n" +" -m максималният постоянно зареден в паметта сегмент\n" +" -n максималният брой дескриптори на отворени файлове\n" +" -p размер на буфера за програмни канали\n" +" -q максималният брой байтове в опашките за съобщения по POSIX\n" +" -r максималният приоритет за реално време\n" +" -s максималният размер на стека\n" +" -t максималното процесорно време в секунди\n" +" -u максималният брой потребителски процеси\n" +" -v размерът на виртуалната памет\n" +" -x максималният брой заключвания на файлове\n" +" -x максималният брой нишки\n" +" \n" +" Не всички ограничения са налични на всички платформи.\n" +"\n" +" Ако е зададено ОГРАНИЧЕНИЕ, то това е новата стойност на указания ресурс.\n" +" Специалните стойности „soft“, „hard“ и „unlimited“ означават текущите меко,\n" +" твърдо и никакво ограничение съответно. В противен случай се извежда\n" +" текущата стойност на указания ресурс. Ако не е зададена опция, се приема,\n" +" че е зададена „-f“.\n" +"\n" +" Стойностите са в блокове от по 1024 байта, с изключение на:\n" +" ⁃ опцията „-t“, при която стойността е в секунди;\n" +" ⁃ опцията „-p“, при която блоковете са от по 512 байта;\n" +" ⁃ опцията „-u“, при която стойността е точният брой процеси.<\n" +"\n" +" Изходен код:\n" +" 0, освен ако не възникни грешка или е дадена неправилна опция." + +#: builtins.c:1465 +msgid "" +"Display or set file mode mask.\n" +" \n" +" Sets the user file-creation mask to MODE. If MODE is omitted, prints\n" +" the current value of the mask.\n" +" \n" +" If MODE begins with a digit, it is interpreted as an octal number;\n" +" otherwise it is a symbolic mode string like that accepted by chmod(1).\n" +" \n" +" Options:\n" +" -p\tif MODE is omitted, output in a form that may be reused as input\n" +" -S\tmakes the output symbolic; otherwise an octal number is output\n" +" \n" +" Exit Status:\n" +" Returns success unless MODE is invalid or an invalid option is given." +msgstr "" +"Извеждане или промяна на маската за достъпа до новосъздадени файлове.\n" +" \n" +" Задава МАСКАта за правата за достъп до новосъздадени файлове. Ако не е\n" +" зададена МАСКА, се извежда текущата ѝ стойност.\n" +" \n" +" Ако МАСКАта започва с цифра, тя се тълкува като осмично число. В противен\n" +" случай трябва да е низ, който би бил приет от командата chmod(1).\n" +" \n" +" Опции:\n" +" -p ако не е зададена МАСКА, изведеният низ може да бъде ползван за вход\n" +" -S изведената маска да е във вид на НИЗ. Без опцията изходът е осмично\n" +" число\n" +" \n" +" Изходен код:\n" +" 0, освен ако МАСКАта или някоя от зададените опции са неправилни." + +#: builtins.c:1485 +msgid "" +"Wait for job completion and return exit status.\n" +" \n" +" Waits for each process identified by an ID, which may be a process ID or a\n" +" job specification, and reports its termination status. If ID is not\n" +" given, waits for all currently active child processes, and the return\n" +" status is zero. If ID is a a job specification, waits for all processes\n" +" in that job's pipeline.\n" +" \n" +" If the -n option is supplied, waits for the next job to terminate and\n" +" returns its exit status.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last ID; fails if ID is invalid or an invalid\n" +" option is given." +msgstr "" +"Изчакване на завършването задача и връщане на изходния код.\n" +" \n" +" Изчакване на всички указани ИДентификатори, които могат да са номера на\n" +" процеси или указатели на задачи, и докладване на изходния код. Ако не е\n" +" зададен ИДентификатор, се изчакват всички активни дъщерни процеси, а\n" +" изходният код е 0. Ако ИДентификаторът е указател на задача, се изчакват\n" +" всички процеси в конвейера на задачата.\n" +"\n" +" Ако е зададена опцията „-n“ се изчаква края на работата на следващата задача\n" +" и се връща нейния код.\n" +" \n" +" Изходен код:\n" +" Връща изходния код на последната задача или процес. Ако е зададена\n" +" неправилна опция, връща грешка." + +#: builtins.c:1506 +msgid "" +"Wait for process completion and return exit status.\n" +" \n" +" Waits for each process specified by a PID and reports its termination status.\n" +" If PID is not given, waits for all currently active child processes,\n" +" and the return status is zero. PID must be a process ID.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last PID; fails if PID is invalid or an invalid\n" +" option is given." +msgstr "" +"Изчакване на указания процес и докладване за изходния код.\n" +"\n" +" Изчакване на всички указани процеси и докладване за изходния код. Ако не е\n" +" зададен ИДентификатор_ПРоцeс, всички текущо активни дъщерни процеси се\n" +" изчакват и изходният код е 0. ИДентификатор_ПРоцeс трябва да съответства на\n" +" някой процес.\n" +"\n" +" Изходен код:\n" +" Изходния код на процеса с последния идентификатор. Грешка, ако е даден\n" +" неправилен идентификатор или е дадена неправилна опция." + +#: builtins.c:1521 +msgid "" +"Execute commands for each member in a list.\n" +" \n" +" The `for' loop executes a sequence of commands for each member in a\n" +" list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is\n" +" assumed. For each element in WORDS, NAME is set to that element, and\n" +" the COMMANDS are executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Изпълнение на команда за всеки член в списък от елементи\n" +"\n" +" Цикълът „for“ изпълнява последователност от команди за всеки член в списък\n" +" от елементи. Ако блокът „в ДУМИ…“ не присъства, използва се „in \"$@\"“.\n" +" За всеки елемент в ДУМИте, ИМЕто се задава да е елементът и се изпълняват\n" +" КОМАНДИте.\n" +"\n" +" Изходен код:\n" +" Връща изходния код на последно изпълнената команда." + +#: builtins.c:1535 +msgid "" +"Arithmetic for loop.\n" +" \n" +" Equivalent to\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n" +" omitted, it behaves as if it evaluates to 1.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Аритметичен цикъл чрез „for“\n" +" Еквивалентно на:\n" +" (( ИЗРАЗ_1 ))\n" +" while (( ИЗРАЗ_2 )); do\n" +" КОМАНДИ\n" +" (( EXP_3 ))\n" +" done\n" +" ИЗРАЗ_1, ИЗРАЗ_2, и ИЗРАЗ_3 са аритметични изрази. Всеки изпуснат израз се\n" +" изчислява да е 1.\n" +"\n" +" Изходен код:\n" +" Връща изходния код на последно изпълнената команда." + +#: builtins.c:1553 +msgid "" +"Select words from a list and execute commands.\n" +" \n" +" The WORDS are expanded, generating a list of words. The\n" +" set of expanded words is printed on the standard error, each\n" +" preceded by a number. If `in WORDS' is not present, `in \"$@\"'\n" +" is assumed. The PS3 prompt is then displayed and a line read\n" +" from the standard input. If the line consists of the number\n" +" corresponding to one of the displayed words, then NAME is set\n" +" to that word. If the line is empty, WORDS and the prompt are\n" +" redisplayed. If EOF is read, the command completes. Any other\n" +" value read causes NAME to be set to null. The line read is saved\n" +" in the variable REPLY. COMMANDS are executed after each selection\n" +" until a break command is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Избор на думи от списък и изпълнение на команди.\n" +"\n" +" ДУМИте биват замествани, което води до създаването на списък с думи.\n" +" Наборът от заместените думи бива отпечатан на изхода за стандартната\n" +" грешка, като всяка от тях се предшества от номер. Ако клаузата „in ДУМИ“\n" +" липсва, използва се „in \"$@\"“. В такива случаи се отпечатва подсказката\n" +" „PS3“ и от стандартния вход се прочита ред. Ако редът се състои от номера,\n" +" който съответства на някоя от изведените думи, ИМЕто се задава да е тази\n" +" дума. Ако редът е празен, отново се отпечатват ДУМИте и подсказката. Ако\n" +" се прочете „EOF“, командата завършва. Всяка друга стойност присвоява „null“\n" +" на ИМЕ. Прочетеният ред се запазва в променливата REPLY. КОМАНДИте се\n" +" изпълняват след всеки избор до изпълняването на команда за прекъсване\n" +" (break).\n" +"\n" +" Изходен код:\n" +" Връща изходния код на последно изпълнената команда." + +#: builtins.c:1574 +msgid "" +"Report time consumed by pipeline's execution.\n" +" \n" +" Execute PIPELINE and print a summary of the real time, user CPU time,\n" +" and system CPU time spent executing PIPELINE when it terminates.\n" +" \n" +" Options:\n" +" -p\tprint the timing summary in the portable Posix format\n" +" \n" +" The value of the TIMEFORMAT variable is used as the output format.\n" +" \n" +" Exit Status:\n" +" The return status is the return status of PIPELINE." +msgstr "" +"Отпечатване на времето за изпълнение на програмен канал.\n" +"\n" +" Изпълнение на ПРОГРАМНия_КАНАЛ и отпечатване на обобщение за реалното,\n" +" потребителското и системно процесорни времена, които изпълнението на\n" +" ПРОГРАМНия_КАНАЛ отнема.\n" +"\n" +" Опции:\n" +" -p: извеждане на статистиката за времето във формат POSIX\n" +"\n" +" Стойността на променливата на средата „TIMEFORMAT“ определя изходния\n" +" формат.\n" +"\n" +" Изходен код:\n" +" Изходният код е този на ПРОГРАМНия_КАНАЛ." + +#: builtins.c:1591 +msgid "" +"Execute commands based on pattern matching.\n" +" \n" +" Selectively execute COMMANDS based upon WORD matching PATTERN. The\n" +" `|' is used to separate multiple patterns.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Изпълнение на команди на базата на напасване по шаблон.\n" +"\n" +" Избирателно се изпълняват КОМАНДИ на база ДУМА, която напасва на ШАБЛОН.\n" +" Шаблоните се разделят със знака „|“.\n" +"\n" +" Изходен код:\n" +" Изходният код е този на последно изпълнената команда." + +#: builtins.c:1603 +msgid "" +"Execute commands based on conditional.\n" +" \n" +" The `if COMMANDS' list is executed. If its exit status is zero, then the\n" +" `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list is\n" +" executed in turn, and if its exit status is zero, the corresponding\n" +" `then COMMANDS' list is executed and the if command completes. Otherwise,\n" +" the `else COMMANDS' list is executed, if present. The exit status of the\n" +" entire construct is the exit status of the last command executed, or zero\n" +" if no condition tested true.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Изпълнение на команда на базата на условие.\n" +"\n" +" Първо се изпълняват командите в блока „if КОМАНДИ“. Ако изходният код е 0,\n" +" то се изпълнява блокът „then КОМАНДИ“. В противен случай последователно се\n" +" изпълнява всеки блок „elif КОМАНДИ“ — ако изходният код е 0, то се изпълнява\n" +" съответния блок „then КОМАНДИ“, след което завършва изпълнението на целия\n" +" блок „if“.\n" +" Ако изходният код на никой от блоковете „if“ и „elif“ не е бил 0,\n" +" изпълнява се блока „else КОМАНДИ“, стига такъв да присъства. Изходният код\n" +" от цялата конструкция е този на последната изпълнена команда или е 0, ако\n" +" никое тестово условие, не се е оценило като истина.<\n" +"\n" +" Изходен код:\n" +" Изходният код е този на последно изпълнената команда." + +#: builtins.c:1620 +msgid "" +"Execute commands as long as a test succeeds.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `while' COMMANDS has an exit status of zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Изпълнение на команда докато определен тест е успешен.\n" +"\n" +" Заместване и изпълнение на КОМАНДИте докато последната команда в блока\n" +" „while“ е с изходен код, който е 0.\n" +"\n" +" Изходен код:\n" +" Изходният код е този на последно изпълнената команда." + +#: builtins.c:1632 +msgid "" +"Execute commands as long as a test does not succeed.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `until' COMMANDS has an exit status which is not zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Изпълнение на команда докато определен тест е неуспешен.\n" +"\n" +" Заместване и изпълнение на КОМАНДИте докато последната команда в блока\n" +" „until“ е с изходен код, който не е 0.\n" +"\n" +" Изходен код:\n" +" Изходният код е този на последно изпълнената команда." + +#: builtins.c:1644 +msgid "" +"Create a coprocess named NAME.\n" +" \n" +" Execute COMMAND asynchronously, with the standard output and standard\n" +" input of the command connected via a pipe to file descriptors assigned\n" +" to indices 0 and 1 of an array variable NAME in the executing shell.\n" +" The default NAME is \"COPROC\".\n" +" \n" +" Exit Status:\n" +" Returns the exit status of COMMAND." +msgstr "" +"Създаване на копроцес с даденото ИМЕ.\n" +" \n" +" Асинхронно изпълнение на КОМАНДАта, като стандартните вход и изход се\n" +" пренасочват от и към файловите дескриптори, които трябва да са с индекси\n" +" съответно 0 и 1 в променливата-масив ИМЕ в изпълняваната обвивка. Ако не е\n" +" дадено ИМЕ на променлива, стандартно се ползва „COPROC“.\n" +" \n" +" Изходен код:\n" +" Изходния код на КОМАНДАта." + +#: builtins.c:1658 +msgid "" +"Define shell function.\n" +" \n" +" Create a shell function named NAME. When invoked as a simple command,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is invoked,\n" +" the arguments are passed to the function as $1...$n, and the function's\n" +" name is in $FUNCNAME.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is readonly." +msgstr "" +"Дефиниране на функция на обвивката.\n" +" \n" +" Създаване на функция на обвивката със зададеното ИМЕ. Когато се извика като\n" +" обикновена команда, КОМАНДИте се изпълняват в контекста на извикващата\n" +" обвивка. При извикването на ИМЕто, аргументите подадени на функцията са\n" +" достъпни като $1,… , $9, а името на функцията е достъпно като $FUNCNAME.\n" +" \n" +" Изходен код:\n" +" 0, освен ако ИМЕто не е само за четене." + +#: builtins.c:1672 +msgid "" +"Group commands as a unit.\n" +" \n" +" Run a set of commands in a group. This is one way to redirect an\n" +" entire set of commands.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Изпълнение на група от команди.\n" +"\n" +" Изпълняване на цял набор от команди в група. Това е един от начините да се\n" +" пренасочи цял набор от команди.\n" +"\n" +" Изходен код:\n" +" Изходният код е този на последно изпълнената команда." + +#: builtins.c:1684 +msgid "" +"Resume job in foreground.\n" +" \n" +" Equivalent to the JOB_SPEC argument to the `fg' command. Resume a\n" +" stopped or background job. JOB_SPEC can specify either a job name\n" +" or a job number. Following JOB_SPEC with a `&' places the job in\n" +" the background, as if the job specification had been supplied as an\n" +" argument to `bg'.\n" +" \n" +" Exit Status:\n" +" Returns the status of the resumed job." +msgstr "" +"Възобновяване на заден фон на изпълнението на задача\n" +"\n" +" Еквивалентно на аргумента ЗАДАЧА на командата „fg“. Възобновява спряна\n" +" задача или такава на заден фон. ЗАДАЧАта може да указва или име, или\n" +" номер на задача. Ако след ЗАДАЧАта се въведе знакът „&“, задачата\n" +" се изпълнява във фонов режим, все едно е била подадена като аргумент\n" +" на командата „bg“.\n" +"\n" +" Изходен код:\n" +" Изходният код е този възобновената задача." + +#: builtins.c:1699 +msgid "" +"Evaluate arithmetic expression.\n" +" \n" +" The EXPRESSION is evaluated according to the rules for arithmetic\n" +" evaluation. Equivalent to \"let EXPRESSION\".\n" +" \n" +" Exit Status:\n" +" Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise." +msgstr "" +"Изчисляване на аритметичен израз\n" +"\n" +" ИЗРАЗът се изчислява според правилата на аритметичното оценяване.\n" +" Еквивалентно на „let ИЗРАЗ“.\n" +"\n" +" Изходен код:\n" +" 1, ако резултатът на ИЗРАЗа е 0. В противен случай — 0." + +#: builtins.c:1711 +msgid "" +"Execute conditional command.\n" +" \n" +" Returns a status of 0 or 1 depending on the evaluation of the conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries used\n" +" by the `test' builtin, and may be combined using the following operators:\n" +" \n" +" ( EXPRESSION )\tReturns the value of EXPRESSION\n" +" ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" +" EXPR1 && EXPR2\tTrue if both EXPR1 and EXPR2 are true; else false\n" +" EXPR1 || EXPR2\tTrue if either EXPR1 or EXPR2 is true; else false\n" +" \n" +" When the `==' and `!=' operators are used, the string to the right of\n" +" the operator is used as a pattern and pattern matching is performed.\n" +" When the `=~' operator is used, the string to the right of the operator\n" +" is matched as a regular expression.\n" +" \n" +" The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n" +" determine the expression's value.\n" +" \n" +" Exit Status:\n" +" 0 or 1 depending on value of EXPRESSION." +msgstr "" +"Изпълнение на команда-условие\n" +"\n" +" Връща състояние 0 или 1 в зависимост от оценката на условния ИЗРАЗ.\n" +" Изразите са съставени от същите примитиви, както вградената команда „test“\n" +" и могат да се съчетават чрез следните оператори:\n" +" \n" +" ( ИЗРАЗ ) Връща стойността на ИЗРАЗа\n" +" ! ИЗРАЗ Истина, ако ИЗРАЗ се оценя на лъжа, в останалите случаи е лъжа\n" +" ИЗРАЗ_1 && ИЗРАЗ_2\n" +" Истина, ако едновременно ИЗРАЗ_1 и ИЗРАЗ_2 са истина, в\n" +" останалите случаи е лъжа.\n" +" ИЗРАЗ_1 || ИЗРАЗ_2\n" +" Истина, ако поне единият от ИЗРАЗ_1 и ИЗРАЗ_2 е истина, в\n" +" останалите случаи е лъжа.\n" +" \n" +" Когато се използват операторите „==“ и „!=“, низът от дясната страна на\n" +" оператора се използва като шаблон и се извършва напасване. Когато се ползва\n" +" операторът „=~“, изразът от дясната му страна се тълкува като регулярен\n" +" израз.\n" +"\n" +" Операторите „&&“ и „||“ не оценят ИЗРАЗ_2, ако ИЗРАЗ_1 е достатъчен за\n" +" определяне на стойността на израза.\n" +"\n" +" Изходен код:\n" +" 0 или едно според стойността на ИЗРАЗа." + +#: builtins.c:1737 +msgid "" +"Common shell variable names and usage.\n" +" \n" +" BASH_VERSION\tVersion information for this Bash.\n" +" CDPATH\tA colon-separated list of directories to search\n" +" \t\tfor directories given as arguments to `cd'.\n" +" GLOBIGNORE\tA colon-separated list of patterns describing filenames to\n" +" \t\tbe ignored by pathname expansion.\n" +" HISTFILE\tThe name of the file where your command history is stored.\n" +" HISTFILESIZE\tThe maximum number of lines this file can contain.\n" +" HISTSIZE\tThe maximum number of history lines that a running\n" +" \t\tshell can access.\n" +" HOME\tThe complete pathname to your login directory.\n" +" HOSTNAME\tThe name of the current host.\n" +" HOSTTYPE\tThe type of CPU this version of Bash is running under.\n" +" IGNOREEOF\tControls the action of the shell on receipt of an EOF\n" +" \t\tcharacter as the sole input. If set, then the value\n" +" \t\tof it is the number of EOF characters that can be seen\n" +" \t\tin a row on an empty line before the shell will exit\n" +" \t\t(default 10). When unset, EOF signifies the end of input.\n" +" MACHTYPE\tA string describing the current system Bash is running on.\n" +" MAILCHECK\tHow often, in seconds, Bash checks for new mail.\n" +" MAILPATH\tA colon-separated list of filenames which Bash checks\n" +" \t\tfor new mail.\n" +" OSTYPE\tThe version of Unix this version of Bash is running on.\n" +" PATH\tA colon-separated list of directories to search when\n" +" \t\tlooking for commands.\n" +" PROMPT_COMMAND\tA command to be executed before the printing of each\n" +" \t\tprimary prompt.\n" +" PS1\t\tThe primary prompt string.\n" +" PS2\t\tThe secondary prompt string.\n" +" PWD\t\tThe full pathname of the current directory.\n" +" SHELLOPTS\tA colon-separated list of enabled shell options.\n" +" TERM\tThe name of the current terminal type.\n" +" TIMEFORMAT\tThe output format for timing statistics displayed by the\n" +" \t\t`time' reserved word.\n" +" auto_resume\tNon-null means a command word appearing on a line by\n" +" \t\titself is first looked for in the list of currently\n" +" \t\tstopped jobs. If found there, that job is foregrounded.\n" +" \t\tA value of `exact' means that the command word must\n" +" \t\texactly match a command in the list of stopped jobs. A\n" +" \t\tvalue of `substring' means that the command word must\n" +" \t\tmatch a substring of the job. Any other value means that\n" +" \t\tthe command must be a prefix of a stopped job.\n" +" histchars\tCharacters controlling history expansion and quick\n" +" \t\tsubstitution. The first character is the history\n" +" \t\tsubstitution character, usually `!'. The second is\n" +" \t\tthe `quick substitution' character, usually `^'. The\n" +" \t\tthird is the `history comment' character, usually `#'.\n" +" HISTIGNORE\tA colon-separated list of patterns used to decide which\n" +" \t\tcommands should be saved on the history list.\n" +msgstr "" +"Често използване промени на обвивката\n" +"\n" +" BASH_VERSION Информация за версията на bash\n" +" CDPATH Списък с директории разделени с двоеточие, които да се\n" +" търсят като аргументи за командата „cd“\n" +" GLOBIGNORE Списък с шаблони на файлови имена, разделени с двоеточие,\n" +" които да се игнорират от заместването на пътя\n" +" HISTFILE Името на файла, в който се съхранява историята на командите\n" +" HISTFILESIZE Максималният брой редове, които горният файл може да съдържа\n" +" HISTSIZE Максималният брой редове, които една работеща обвивка може\n" +" да достъпи\n" +" HOME Пълният път до домашната ви директория\n" +" HOSTNAME Името на текущата машина\n" +" HOSTTYPE Видът на процесора, под който работи текущата обвивка\n" +" IGNOREEOF Управлява действието на обвивката при срещането на единичен\n" +" знак за край на файл „EOF“. Ако променливата е зададена, тя\n" +" указва броя на знаците „EOF“, който могат да се срещнат\n" +" самостоятелно на един ред, преди обвивката да завърши работа\n" +" и излезе (стандартно е 10). Когато променливата не е\n" +" зададена, един „EOF“ означава край на входящите данни\n" +" MACHTYPE Низ, който описва текущата система, на която работи bash\n" +" MAILCHECK Колко често bash да проверява за нови писма (в секунди)\n" +" MAILPATH Списък с файлове, които bash проверява за нови писма\n" +" OSTYPE Версията на Юникс, на която работи bash\n" +" PATH Списък с директории, които да се претърсват за команди\n" +" PROMPT_COMMAND Команда, която да се изпълнява преди отпечатването на\n" +" основната подсказка на командния ред\n" +" PS1 Низ за основната подсказка\n" +" PS2 Низ за втората подсказка\n" +" PWD Пълният път и име на текущата директория\n" +" SHELLOPTS Списък с включените опции на обвивката, разделени с\n" +" двоеточие\n" +" TERM Името на текущия вид терминал\n" +" TIMEFORMAT Изходният формат за статистиката за времето за изпълнение на\n" +" команда, който се използва от запазената дума „time“\n" +" auto_resume Стойност, която не е „null“, означава, че командна дума,\n" +" която се появява самостоятелно на ред, първо се проверява в\n" +" списъка с текущо спрените задачи. Ако бъде открита там,\n" +" задачата се пуска и се слага на преден план. Стойност\n" +" „exact“ (строго съвпадение) означава, че командната дума,\n" +" трябва точно да съвпада с името на команда в списъка със\n" +" спрени задачи. Стойност „substring“ (съвпадение на подниз)\n" +" означава, че командната дума трябва да е подниз на задачата.\n" +" Всяка друга стойност означава, че командата думата трябва да\n" +" е началото на спряна задача\n" +" histchars Знаци, които определят бързото заместване и това по история.\n" +" Първият знак е за заместването по история, обикновено е „!“.\n" +" Вторият е за бързото заместване, обикновено е „^“. Третият\n" +" е за коментарите в историята, обикновено е „#“\n" +" HISTIGNORE Списък с шаблони, разделени с двоеточие, които указват кои\n" +" команди да не се запазват в историята\n" + +# CONTINUE +#: builtins.c:1794 +msgid "" +"Add directories to stack.\n" +" \n" +" Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" +"Добавяне на директории в стека.\n" +"\n" +" Добавя директория в стека на директориите или превърта стека\n" +" като най-горна директория става текущата директория. Без\n" +" аргументи сменя най-горните две директории.\n" +"\n" +" -n подтискане на нормалното преминаване към директория при изваждането на\n" +" директория към стека, така че се променя само той.\n" +"\n" +" Аргументи:\n" +" +N Превърта стека, така че N-тата директория (като се брои от лявата \n" +" страна на списъка, изведен от командата „dirs“ като се почва от 0)\n" +" да е най-отгоре.\n" +"\n" +" -N Превърта стека, така че N-тата директория (като се брои от дясната\n" +" страна на списъка, изведен от командата „dirs“ като се почва от 0)\n" +" да е най-отгоре.\n" +"\n" +"\n" +" dir Добавя ДИРекторията най-отгоре в стека, като я прави новата текуща\n" +" работна директория.\n" +"\n" +" Можете да изведете стека на директорията с командата „dirs“.\n" +"\n" +" Изходен код:\n" +" 0, освен ако е подаден неправилен аргумент или не може да се премине към\n" +" съответната директория." + +#: builtins.c:1828 +msgid "" +"Remove directories from stack.\n" +" \n" +" Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" +"Изваждане на директории от стека.\n" +"\n" +" Маха директории от стека с тях. Без аргументи премахва последната директория\n" +" в стека и влиза в новата последна директория.\n" +"\n" +" Опции:\n" +" -n подтискане на нормалното преминаване към директория при изваждането на\n" +" директория към стека, така че се променя само той.\n" +"\n" +" Аргументи:\n" +" \n" +" +N премахва N-тия елемент като се брои отляво в списъка изведен от\n" +" командата „dirs“, като се брои от 0. Напр.: „popd +0“ премахва\n" +" първата директория, „popd +1“ - втората.\n" +"\n" +" -N премахва N-тия елемент като се брои отдясно в списъка изведен от\n" +" командата „dirs“, като се брои от 0. Напр.: „popd -0“ премахва\n" +" последната директория, „popd -1“ - предпоследната.\n" +"\n" +" Стекът с директориите се визуализира с командата „dirs“.\n" +"\n" +" Изходен код:\n" +" 0, освен ако е подаден неправилен аргумент или не може да се премине към\n" +" съответната директория." + +#: builtins.c:1858 +msgid "" +"Display directory stack.\n" +" \n" +" Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Извеждане на стека на директориите.\n" +"\n" +" Отпечатва списъка с текущо запомнените директории. Списъкът се попълва чрез\n" +" командата „pushd“. Можете да вадите директории от стека с командата\n" +" „popd“.\n" +" \n" +" Опции:\n" +" -c изчистване на стека на директориите като изтрива всички елементи\n" +" -l извеждане на пълните имена на директориите, а не съкратените спрямо\n" +" домашната директория имена („/homes/pesho/bin“, а не „~/bin“)\n" +" -p поредово отпечатване без поредния номер в стека\n" +" -v поредово отпечатване заедно с поредния номер в стека\n" +"\n" +" Аргументи: \n" +" +N извежда N-тия елемент отляво в списъка отпечатан от командата „dirs“,\n" +" когато е стартирана без опции. Брои се от 0.\n" +" -N извежда N-тия елемент отдясно в списъка отпечатан от командата „dirs“,\n" +" когато е стартирана без опции. Брои се от 0.\n" +"\n" +" Изходен код:\n" +" 0, освен ако е дадена неправилна опция или възникне грешка." + +#: builtins.c:1887 +msgid "" +"Set and unset shell options.\n" +" \n" +" Change the setting of each shell option OPTNAME. Without any option\n" +" arguments, list all shell options with an indication of whether or not each\n" +" is set.\n" +" \n" +" Options:\n" +" -o\trestrict OPTNAMEs to those defined for use with `set -o'\n" +" -p\tprint each shell option with an indication of its status\n" +" -q\tsuppress output\n" +" -s\tenable (set) each OPTNAME\n" +" -u\tdisable (unset) each OPTNAME\n" +" \n" +" Exit Status:\n" +" Returns success if OPTNAME is enabled; fails if an invalid option is\n" +" given or OPTNAME is disabled." +msgstr "" +"Включване и изключване на опции на обвивката.\n" +" \n" +" Превключване на състоянието на всяка от дадените ОПЦИи на обвивката. Ако не\n" +" не са зададени аргументи-ОПЦИи, се извежда списък от всички опции, като се\n" +" указва за всяка дали и включена или не.\n" +" \n" +" Опции:\n" +" -o ограничаване на опциите до определените за използване със „set -o“\n" +" -p извеждане на всяка опция с означение дали е включена или не\n" +" -q без извеждане на информация\n" +" -s включване на всяка от ОПЦИИте\n" +" -u изключване на всяка от ОПЦИИте\n" +" \n" +" Изходен код:\n" +" 0, ако ОПЦИЯта е включена, грешка, ако е зададена неправилна или изключена\n" +" ОПЦИЯ." + +#: builtins.c:1908 +msgid "" +"Formats and prints ARGUMENTS under control of the FORMAT.\n" +" \n" +" Options:\n" +" -v var\tassign the output to shell variable VAR rather than\n" +" \t\tdisplay it on the standard output\n" +" \n" +" FORMAT is a character string which contains three types of objects: plain\n" +" characters, which are simply copied to standard output; character escape\n" +" sequences, which are converted and copied to the standard output; and\n" +" format specifications, each of which causes printing of the next successive\n" +" argument.\n" +" \n" +" In addition to the standard format specifications described in printf(1),\n" +" printf interprets:\n" +" \n" +" %b\texpand backslash escape sequences in the corresponding argument\n" +" %q\tquote the argument in a way that can be reused as shell input\n" +" %(fmt)T output the date-time string resulting from using FMT as a format\n" +" string for strftime(3)\n" +" \n" +" The format is re-used as necessary to consume all of the arguments. If\n" +" there are fewer arguments than the format requires, extra format\n" +" specifications behave as if a zero value or null string, as appropriate,\n" +" had been supplied.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a write or assignment\n" +" error occurs." +msgstr "" +"Форматиране и отпечатване на АРГУМЕНТИте според управлението на ФОРМАТа.\n" +"\n" +" Опции:\n" +" -v ПРОМЕНЛИВА изходът се поставя в ПРОМЕНЛИВАта на обвивката, вместо да\n" +" се извежда на стандартния изход.\n" +"\n" +" ФОРМАТът е последователност от знаци, която съдържа три вида обекти:\n" +" ⁃ обикновени знаци, които биват отпечатани директно на стандартния изход;\n" +" ⁃ екраниращи знакови последователности, които биват преобразувани и\n" +" отпечатани на стандартния изход;\n" +" ⁃ форматиращи знакови последователности, всяка от които предизвиква\n" +" отпечатването на следващ аргумент.\n" +"\n" +" Освен стандартните форматирания описани в ръководството на printf(1), printf\n" +" приема и следните инструкции:\n" +" %b предизвиква заместването на екраниранията с обратно наклонени\n" +" черти в съответния аргумент\n" +" %q предизвиква цитирането на аргумента, така че да може да бъде\n" +" използван като вход за обвивката\n" +" %(fmt) отпечатване на низа при третиране на аргумента като дата и време\n" +" според strftime(3)\n" +"\n" +" Форматът се преизползва до приемането на всички аргументи. Ако има по-\n" +" малко аргументи от посочените във формата, поведението на допълнителните е\n" +" все една е подаден за аргумент нулева стойност или празен низ.\n" +"\n" +" Изходен код:\n" +" 0, освен ако не е дадена неправилна опция или възникне грешка при\n" +" извеждането на резултата или при присвояването на стойността." + +#: builtins.c:1942 +msgid "" +"Specify how arguments are to be completed by Readline.\n" +" \n" +" For each NAME, specify how arguments are to be completed. If no options\n" +" are supplied, existing completion specifications are printed in a way that\n" +" allows them to be reused as input.\n" +" \n" +" Options:\n" +" -p\tprint existing completion specifications in a reusable format\n" +" -r\tremove a completion specification for each NAME, or, if no\n" +" \tNAMEs are supplied, all completion specifications\n" +" -D\tapply the completions and actions as the default for commands\n" +" \twithout any specific completion defined\n" +" -E\tapply the completions and actions to \"empty\" commands --\n" +" \tcompletion attempted on a blank line\n" +" \n" +" When completion is attempted, the actions are applied in the order the\n" +" uppercase-letter options are listed above. The -D option takes\n" +" precedence over -E.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Указване на начина на автоматичното дописване на аргументите от Readline.\n" +" \n" +" За всяко ИМЕ се извежда начина за дописване на аргументите. Ако не са\n" +" дадени никакви опции, се извеждат текущите инструкции за автоматично\n" +" дописване във формат, който може да се използва за вход.\n" +" \n" +" Опции:\n" +" -p Извеждане на текущите инструкции за автоматично дописване във формат,\n" +" който може да се използва за вход\n" +" -r Премахване на инструкциите за автоматично дописване на всяко ИМЕ,а\n" +" когато такова не е указано — всички инструкции\n" +" -D Прилагане на дописванията и действията като стандартните за командите,\n" +" без никакви специфични инструкции\n" +" -E Прилагане на дописванията и действията като тези на „празната“\n" +" команда — когато все още нищо не е написано на командния ред\n" +" \n" +" При извършване на автоматично дописване, действията се прилагат в реда на\n" +" опциите с главна буква дадени по-горе. Опцията „-D“ е с по-висок приоритет\n" +" от „-E“.\n" +" \n" +" Изходен код:\n" +" 0, освен когато е дадена неправилна опция или възникне грешка." + +#: builtins.c:1970 +msgid "" +"Display possible completions depending on the options.\n" +" \n" +" Intended to be used from within a shell function generating possible\n" +" completions. If the optional WORD argument is supplied, matches against\n" +" WORD are generated.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Извеждане на възможните дописвания.\n" +"\n" +" Целта е да се ползва в рамките функция на обвивката, която генерира\n" +" възможните дописвания. Ако е зададен незадължителният аргумент ДУМА,\n" +" генерират се напасванията с него.\n" +"\n" +" Изходен код:\n" +" 0, освен ако е дадена неправилна опция или възникне грешка." + +#: builtins.c:1985 +msgid "" +"Modify or display completion options.\n" +" \n" +" Modify the completion options for each NAME, or, if no NAMEs are supplied,\n" +" the completion currently being executed. If no OPTIONs are given, print\n" +" the completion options for each NAME or the current completion specification.\n" +" \n" +" Options:\n" +" \t-o option\tSet completion option OPTION for each NAME\n" +" \t-D\t\tChange options for the \"default\" command completion\n" +" \t-E\t\tChange options for the \"empty\" command completion\n" +" \n" +" Using `+o' instead of `-o' turns off the specified option.\n" +" \n" +" Arguments:\n" +" \n" +" Each NAME refers to a command for which a completion specification must\n" +" have previously been defined using the `complete' builtin. If no NAMEs\n" +" are supplied, compopt must be called by a function currently generating\n" +" completions, and the options for that currently-executing completion\n" +" generator are modified.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or NAME does not\n" +" have a completion specification defined." +msgstr "" +"Променяне или извеждане на опциите за дописване.\n" +" \n" +" Променяне на опциите дописване за всяко ИМЕ, или когато не са указани\n" +" ИМЕна — дописването, което се изпълнява в момента. Ако не са зададени\n" +" ОПЦИи, извеждане на на опциите за дописване за всяко име или за текущо\n" +" изпълняваното дописване.\n" +" \n" +" Опции:\n" +" \t-o ОПЦИЯ\n" +" Задаване ОПЦИЯта за дописване за всяко зададено ИМЕ\n" +" \t-D Задаване на опциите за „стандартното“ дописване на команда\n" +" \t-E Задаване на опциите за дописването на „празната“ команда\n" +" \n" +" Използването на „+o“ вместо „-o“ изключва дадената опция.\n" +" \n" +" Аргументи:\n" +" \n" +" Всяко ИМЕ указва команда, за която трябва предварително да е зададена\n" +" спецификация за дописване чрез вградената команда „complete“. Ако не са\n" +" зададени ИМЕна, командата „compopt“ трябва да бъде изпълнена от функция,\n" +" която генерира спецификациите за дописване. В този случай опциите за текущо\n" +" изпълнявания генератор на дописвания се променят.\n" +" \n" +" Изходен код:\n" +" 0, освен когато е дадена неправилна опция или липсват инструкции към ИМЕто\n" +" за автоматично дописване." + +#: builtins.c:2015 +msgid "" +"Read lines from the standard input into an indexed array variable.\n" +" \n" +" Read lines from the standard input into the indexed array variable ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable MAPFILE\n" +" is the default ARRAY.\n" +" \n" +" Options:\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are copied.\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default index is 0.\n" +" -s count \tDiscard the first COUNT lines read.\n" +" -t\t\tRemove a trailing newline from each line read.\n" +" -u fd\t\tRead lines from file descriptor FD instead of the standard input.\n" +" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read.\n" +" -c quantum\tSpecify the number of lines read between each call to CALLBACK.\n" +" \n" +" Arguments:\n" +" ARRAY\t\tArray variable name to use for file data.\n" +" \n" +" If -C is supplied without -c, the default quantum is 5000. When\n" +" CALLBACK is evaluated, it is supplied the index of the next array\n" +" element to be assigned and the line to be assigned to that element\n" +" as additional arguments.\n" +" \n" +" If not supplied with an explicit origin, mapfile will clear ARRAY before\n" +" assigning to it.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or ARRAY is readonly or\n" +" not an indexed array." +msgstr "" +"Изчитане на редове от стандартния вход и запазване в променлива — индексиран\n" +" низ.\n" +" \n" +" Прочитане на редове от стандартния вход, които след това се запазват в\n" +" променливата МАСИВ. Когато е дадена опцията „-u“, се чете от\n" +" ФАЙЛов_ДЕСКРиптор. Стандартното име на променливата-масив е MAPFILE.\n" +" \n" +" Опции:\n" +" -n МАКС_РЕДА Изчитане на не повече от МАКСимум РЕДа. Ако е 0, се\n" +" прочитат всички редове\n" +" -O НАЧАЛО Присвояването да започне при индекс НАЧАЛО в МАСИВа\n" +" Стандартната стойност е 0\n" +" -s БРОЙ_ПРОП Прескачане на първите БРОЙ за ПРОПускане прочетени реда\n" +" -t Премахване на последващия знак за нов ред от всеки ред\n" +" -u ФАЙЛов_ДЕСКРиптор\n" +" Изчитане на редовете от ФАЙЛов_ДЕСКРиптор, а не стандартния\n" +" вход\n" +" -C ФУНКЦИЯ Функция, която се извиква при изчитането на всеки БРОЙ_РЕДА\n" +" -c БРОЙ_РЕДА Редове, които да се изчетат преди да се извика ФУНКЦИЯта\n" +" \n" +" Аргументи:\n" +" МАСИВ Име на променливата-масив\n" +" \n" +" Ако опцията „-C“ е зададена без „-c“, стандартния БРОЙ_РЕДА е 5000. При\n" +" извикването на ФУНКЦИЯта за аргументи ѝ се подават индекса на следващия\n" +" елемент от масива и реда, който се счита за стойност.\n" +" \n" +" Ако не е дадено изрично НАЧАЛО, командата „mapfile“ изчиства МАСИВа, преди\n" +" да започне присвояването към него.\n" +" \n" +" Изходен код:\n" +" Връща 0, освен ако е дадена неправилна опция или ако МАСИВът е променлива\n" +" само за четене или не е индексиран масив." + +#: builtins.c:2049 +msgid "" +"Read lines from a file into an array variable.\n" +" \n" +" A synonym for `mapfile'." +msgstr "" +"Прочитане на редове от файл и поставяне в променлива – масив.\n" +" \n" +" Синоним на „mapfile“." diff --git a/po/boldquot.sed b/po/boldquot.sed new file mode 100644 index 0000000..4b937aa --- /dev/null +++ b/po/boldquot.sed @@ -0,0 +1,10 @@ +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g +s/“/“/g +s/”/”/g +s/‘/‘/g +s/’/’/g diff --git a/po/ca.gmo b/po/ca.gmo new file mode 100644 index 0000000000000000000000000000000000000000..ef3ef376f4eabb582da1e744ea0254d5fca4d48f GIT binary patch literal 9739 zcma)>ZEPjiS;tS_Na8|CQqmVl;p`^vwVS=W_9hEiZ_>M7$7!9!UdQ%s8jR~5-x*)e z?%bKX^WwGBMBzgt6^eKfga{}IwS=e&A9!g|ltQHnDwQI&QYA#G3au*fp^$z+zz5Ve z;`cu@b6=cI+R;A#-*e`?Jm+~k&oldPw_X37;dvUm1G@ftV_pPby^%jWA00F1Ht<)# zw}KxBe-?ZR{3-BDpyquOd=L2j3h#W2F}Krx7}WR+Rr?w6=V(6%YTeI(ZwJ2!z8m}| zsChrA@NGYC%ssRxLG7~v{tWmesQrHz6kjiaKLNf1UITs+ycPTs_>0JX?_R18~jsH{C^dcUjD1XAAp*FGeQ?%?*YaC1EA(_ zf|AQ+@F@5csB^qj;me@xT9a(xQq$mUa^ z&i%Kb{vpUe^SP@3YoPR?O<>!+6;wRA1;hl+6sU8Y z1~u+6kS)w6$Un2kAIbB#L5=(4s{I$B=6?=U9Q!gTJNRGlI`FlseJxCjzqf!o&pn_8 zm%(xHGAMg_9+bR33+jCTTH&=!(zpgF|6K%izO@QtQ1bdHC_X<9${s!iN}rzwQMq{q z6#riVHU3+m_WK`D>%JXl)Op?w$}gMz;gxv=gcY*`Zi62Ix4{1dweAwikzKYyt^Xt_ zJNOuwfS(5M1@A)W{4`HgxCctk&x5kJKL@qW-+{90uY>ZhS3#Zsd!X#&kS+OJ0%b=L zD7*g%C_euRl%IbE)cO7eybt^yD7oHCr{wemsQtD<>HTR?a{U;nbzT6c!Ow#_=YNCJ z?@fnGzHbFj(0(td`4>RhK@2_$J_nuzzYW5=xdSE7fcJw<@Cqn-zX0M&<};wy`$rJd zG1tJX&UFW<{T~6P*9%quB~a)1eNb|L5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100644 index 0000000..3ccc638 --- /dev/null +++ b/po/ca.po @@ -0,0 +1,6614 @@ +# Catalan messages for the GNU bash-2.0 +# Copyright (C) 2002, 2003 Free Software Foundation, Inc. +# Montxo Vicente i Sempere , 2003. +# Jordi Mas i Hern?ndez , 2004 (correccions). +# +msgid "" +msgstr "" +"Project-Id-Version: bash-2.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-02-11 11:19-0500\n" +"PO-Revision-Date: 2003-12-28 19:59+0100\n" +"Last-Translator: Montxo Vicente i Sempere \n" +"Language-Team: Catalan \n" +"Language: ca\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: arrayfunc.c:51 +msgid "bad array subscript" +msgstr "la matriu est? mal composta" + +#: arrayfunc.c:356 builtins/declare.def:566 +#, c-format +msgid "%s: cannot convert indexed to associative array" +msgstr "" + +#: arrayfunc.c:539 +#, fuzzy, c-format +msgid "%s: invalid associative array key" +msgstr "%c%c: opci? inv?lida" + +#: arrayfunc.c:541 +#, c-format +msgid "%s: cannot assign to non-numeric index" +msgstr "%s: no es pot assignar a un ?ndex que no ?s num?ric" + +#: arrayfunc.c:586 +#, c-format +msgid "%s: %s: must use subscript when assigning associative array" +msgstr "" + +#: bashhist.c:388 +#, c-format +msgid "%s: cannot create: %s" +msgstr "%s: no es pot crear: %s" + +#: bashline.c:3982 +msgid "bash_execute_unix_command: cannot find keymap for command" +msgstr "" + +#: bashline.c:4069 +#, c-format +msgid "%s: first non-whitespace character is not `\"'" +msgstr "" + +#: bashline.c:4098 +#, c-format +msgid "no closing `%c' in %s" +msgstr "" + +#: bashline.c:4132 +#, c-format +msgid "%s: missing colon separator" +msgstr "" + +#: braces.c:321 +#, c-format +msgid "brace expansion: cannot allocate memory for %s" +msgstr "" + +#: braces.c:413 +#, c-format +msgid "brace expansion: failed to allocate memory for %d elements" +msgstr "" + +#: braces.c:452 +#, c-format +msgid "brace expansion: failed to allocate memory for `%s'" +msgstr "" + +#: builtins/alias.def:132 +#, fuzzy, c-format +msgid "`%s': invalid alias name" +msgstr "%c%c: opci? inv?lida" + +#: builtins/bind.def:123 builtins/bind.def:126 +msgid "line editing not enabled" +msgstr "" + +#: builtins/bind.def:212 +#, c-format +msgid "`%s': invalid keymap name" +msgstr "" + +#: builtins/bind.def:251 +#, fuzzy, c-format +msgid "%s: cannot read: %s" +msgstr "%s: no es pot crear: %s" + +#: builtins/bind.def:266 +#, fuzzy, c-format +msgid "`%s': cannot unbind" +msgstr "%s: no s'ha trobat l'ordre" + +#: builtins/bind.def:304 builtins/bind.def:334 +#, fuzzy, c-format +msgid "`%s': unknown function name" +msgstr "%s: funci? nom?s de lectura" + +#: builtins/bind.def:312 +#, c-format +msgid "%s is not bound to any keys.\n" +msgstr "" + +#: builtins/bind.def:316 +#, c-format +msgid "%s can be invoked via " +msgstr "" + +#: builtins/break.def:77 builtins/break.def:117 +#, fuzzy +msgid "loop count" +msgstr "fi de sessi?" + +#: builtins/break.def:137 +msgid "only meaningful in a `for', `while', or `until' loop" +msgstr "" + +#: builtins/caller.def:134 +msgid "" +"Returns the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns " +msgstr "" + +#: builtins/cd.def:319 +msgid "HOME not set" +msgstr "" + +#: builtins/cd.def:327 builtins/common.c:166 test.c:876 +msgid "too many arguments" +msgstr "nombre excessiu de par?metres" + +#: builtins/cd.def:338 +msgid "OLDPWD not set" +msgstr "" + +#: builtins/common.c:101 +#, fuzzy, c-format +msgid "line %d: " +msgstr "encaix %3d:" + +#: builtins/common.c:139 error.c:265 +#, fuzzy, c-format +msgid "warning: " +msgstr "s'est? escrivint" + +#: builtins/common.c:153 +#, c-format +msgid "%s: usage: " +msgstr "" + +#: builtins/common.c:191 shell.c:506 shell.c:788 +#, fuzzy, c-format +msgid "%s: option requires an argument" +msgstr "cal un par?metre per a l'opci?: -" + +#: builtins/common.c:198 +#, c-format +msgid "%s: numeric argument required" +msgstr "" + +#: builtins/common.c:205 +#, fuzzy, c-format +msgid "%s: not found" +msgstr "%s: no s'ha trobat l'ordre" + +#: builtins/common.c:214 shell.c:801 +#, fuzzy, c-format +msgid "%s: invalid option" +msgstr "%c%c: opci? inv?lida" + +#: builtins/common.c:221 +#, fuzzy, c-format +msgid "%s: invalid option name" +msgstr "%c%c: opci? inv?lida" + +#: builtins/common.c:228 general.c:235 general.c:240 +#, fuzzy, c-format +msgid "`%s': not a valid identifier" +msgstr "'%s' no ?s un identificador v?lid" + +#: builtins/common.c:238 +#, fuzzy +msgid "invalid octal number" +msgstr "n?mero inv?lid de senyal" + +#: builtins/common.c:240 +#, fuzzy +msgid "invalid hex number" +msgstr "n?mero inv?lid de senyal" + +#: builtins/common.c:242 expr.c:1470 +#, fuzzy +msgid "invalid number" +msgstr "n?mero inv?lid de senyal" + +#: builtins/common.c:250 +#, c-format +msgid "%s: invalid signal specification" +msgstr "" + +#: builtins/common.c:257 +#, c-format +msgid "`%s': not a pid or valid job spec" +msgstr "" + +#: builtins/common.c:264 error.c:488 +#, c-format +msgid "%s: readonly variable" +msgstr "%s: ?s una variable nom?s de lectura" + +#: builtins/common.c:272 +#, c-format +msgid "%s: %s out of range" +msgstr "" + +#: builtins/common.c:272 builtins/common.c:274 +#, fuzzy +msgid "argument" +msgstr "s'esperava un par?metre" + +#: builtins/common.c:274 +#, c-format +msgid "%s out of range" +msgstr "" + +#: builtins/common.c:282 +#, c-format +msgid "%s: no such job" +msgstr "" + +#: builtins/common.c:290 +#, fuzzy, c-format +msgid "%s: no job control" +msgstr "no hi ha cap tasca de control dins d'aquest int?rpret" + +#: builtins/common.c:292 +#, fuzzy +msgid "no job control" +msgstr "no hi ha cap tasca de control dins d'aquest int?rpret" + +#: builtins/common.c:302 +#, fuzzy, c-format +msgid "%s: restricted" +msgstr "%s: s'ha finalitzat la tasca" + +#: builtins/common.c:304 +#, fuzzy +msgid "restricted" +msgstr "Terminat" + +#: builtins/common.c:312 +#, c-format +msgid "%s: not a shell builtin" +msgstr "" + +#: builtins/common.c:321 +#, fuzzy, c-format +msgid "write error: %s" +msgstr "error del conducte: %s" + +#: builtins/common.c:329 +#, c-format +msgid "error setting terminal attributes: %s" +msgstr "" + +#: builtins/common.c:331 +#, c-format +msgid "error getting terminal attributes: %s" +msgstr "" + +#: builtins/common.c:563 +#, c-format +msgid "%s: error retrieving current directory: %s: %s\n" +msgstr "" + +#: builtins/common.c:629 builtins/common.c:631 +#, fuzzy, c-format +msgid "%s: ambiguous job spec" +msgstr "%s: Redirecci? ambigua" + +#: builtins/complete.def:277 +#, c-format +msgid "%s: invalid action name" +msgstr "" + +#: builtins/complete.def:450 builtins/complete.def:645 +#: builtins/complete.def:855 +#, c-format +msgid "%s: no completion specification" +msgstr "" + +#: builtins/complete.def:697 +msgid "warning: -F option may not work as you expect" +msgstr "" + +#: builtins/complete.def:699 +msgid "warning: -C option may not work as you expect" +msgstr "" + +#: builtins/complete.def:828 +msgid "not currently executing completion function" +msgstr "" + +#: builtins/declare.def:126 +#, fuzzy +msgid "can only be used in a function" +msgstr "" +"servir LOCAL dins d'una funci?; a?? restringir? la magnitud visible de la" + +#: builtins/declare.def:315 builtins/declare.def:509 +#, c-format +msgid "%s: reference variable cannot be an array" +msgstr "" + +#: builtins/declare.def:324 +#, c-format +msgid "%s: nameref variable self references not allowed" +msgstr "" + +#: builtins/declare.def:398 +msgid "cannot use `-f' to make functions" +msgstr "" + +#: builtins/declare.def:410 execute_cmd.c:5361 +#, c-format +msgid "%s: readonly function" +msgstr "%s: funci? nom?s de lectura" + +#: builtins/declare.def:553 +#, fuzzy, c-format +msgid "%s: cannot destroy array variables in this way" +msgstr "$%s: no es pot assignar d'aquesta manera" + +#: builtins/declare.def:560 builtins/read.def:733 +#, c-format +msgid "%s: cannot convert associative to indexed array" +msgstr "" + +#: builtins/enable.def:137 builtins/enable.def:145 +msgid "dynamic loading not available" +msgstr "" + +#: builtins/enable.def:312 +#, fuzzy, c-format +msgid "cannot open shared object %s: %s" +msgstr "no es pot obrir el conducte anomenat %s per a %s: %s" + +#: builtins/enable.def:335 +#, c-format +msgid "cannot find %s in shared object %s: %s" +msgstr "" + +#: builtins/enable.def:459 +#, c-format +msgid "%s: not dynamically loaded" +msgstr "" + +#: builtins/enable.def:474 +#, fuzzy, c-format +msgid "%s: cannot delete: %s" +msgstr "%s: no es pot crear: %s" + +#: builtins/evalfile.c:140 builtins/hash.def:171 execute_cmd.c:5208 +#: shell.c:1481 +#, c-format +msgid "%s: is a directory" +msgstr "%s: ?s un directori" + +#: builtins/evalfile.c:146 +#, fuzzy, c-format +msgid "%s: not a regular file" +msgstr "%s: no es pot executar el fitxer binari" + +#: builtins/evalfile.c:155 +#, c-format +msgid "%s: file is too large" +msgstr "" + +#: builtins/evalfile.c:190 builtins/evalfile.c:208 shell.c:1491 +#, c-format +msgid "%s: cannot execute binary file" +msgstr "%s: no es pot executar el fitxer binari" + +#: builtins/exec.def:154 builtins/exec.def:156 builtins/exec.def:228 +#, fuzzy, c-format +msgid "%s: cannot execute: %s" +msgstr "%s: no es pot crear: %s" + +#: builtins/exit.def:65 +#, fuzzy, c-format +msgid "logout\n" +msgstr "fi de sessi?" + +#: builtins/exit.def:88 +msgid "not login shell: use `exit'" +msgstr "" + +#: builtins/exit.def:120 +#, c-format +msgid "There are stopped jobs.\n" +msgstr "" + +#: builtins/exit.def:122 +#, c-format +msgid "There are running jobs.\n" +msgstr "" + +#: builtins/fc.def:262 +#, fuzzy +msgid "no command found" +msgstr "%s: no s'ha trobat l'ordre" + +#: builtins/fc.def:320 builtins/fc.def:369 +msgid "history specification" +msgstr "" + +#: builtins/fc.def:390 +#, fuzzy, c-format +msgid "%s: cannot open temp file: %s" +msgstr "%s: no es pot crear: %s" + +#: builtins/fg_bg.def:149 builtins/jobs.def:282 +msgid "current" +msgstr "" + +#: builtins/fg_bg.def:158 +#, c-format +msgid "job %d started without job control" +msgstr "" + +#: builtins/getopt.c:110 +#, fuzzy, c-format +msgid "%s: illegal option -- %c\n" +msgstr "opci? ilžlegal: -" + +#: builtins/getopt.c:111 +#, fuzzy, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "cal un par?metre per a l'opci?: -" + +#: builtins/hash.def:92 +msgid "hashing disabled" +msgstr "" + +#: builtins/hash.def:138 +#, c-format +msgid "%s: hash table empty\n" +msgstr "" + +#: builtins/hash.def:245 +#, fuzzy, c-format +msgid "hits\tcommand\n" +msgstr "si s'escriu \"r\" s'executar? la darrera ordre." + +#: builtins/help.def:130 +#, c-format +msgid "Shell commands matching keyword `" +msgid_plural "Shell commands matching keywords `" +msgstr[0] "" +msgstr[1] "" + +#: builtins/help.def:182 +#, c-format +msgid "" +"no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." +msgstr "" + +#: builtins/help.def:199 +#, fuzzy, c-format +msgid "%s: cannot open: %s" +msgstr "%s: no es pot crear: %s" + +#: builtins/help.def:485 +#, c-format +msgid "" +"These shell commands are defined internally. Type `help' to see this list.\n" +"Type `help name' to find out more about the function `name'.\n" +"Use `info bash' to find out more about the shell in general.\n" +"Use `man -k' or `info' to find out more about commands not in this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" +msgstr "" + +#: builtins/history.def:154 +msgid "cannot use more than one of -anrw" +msgstr "" + +#: builtins/history.def:186 +msgid "history position" +msgstr "" + +#: builtins/history.def:366 +#, fuzzy, c-format +msgid "%s: history expansion failed" +msgstr "%s: s'esperava una expressi? de nombre enter" + +#: builtins/inlib.def:71 +#, fuzzy, c-format +msgid "%s: inlib failed" +msgstr "%s: s'esperava una expressi? de nombre enter" + +#: builtins/jobs.def:109 +msgid "no other options allowed with `-x'" +msgstr "" + +#: builtins/kill.def:200 +#, c-format +msgid "%s: arguments must be process or job IDs" +msgstr "" + +#: builtins/kill.def:263 +#, fuzzy +msgid "Unknown error" +msgstr "Error desconegut %d" + +#: builtins/let.def:95 builtins/let.def:120 expr.c:583 expr.c:598 +msgid "expression expected" +msgstr "s'esperava una expressi?" + +#: builtins/mapfile.def:172 +#, fuzzy, c-format +msgid "%s: not an indexed array" +msgstr "%s: variable sense vincle" + +#: builtins/mapfile.def:259 builtins/read.def:302 +#, c-format +msgid "%s: invalid file descriptor specification" +msgstr "" + +#: builtins/mapfile.def:267 builtins/read.def:309 +#, c-format +msgid "%d: invalid file descriptor: %s" +msgstr "" + +#: builtins/mapfile.def:276 builtins/mapfile.def:314 +#, fuzzy, c-format +msgid "%s: invalid line count" +msgstr "%c%c: opci? inv?lida" + +#: builtins/mapfile.def:287 +#, fuzzy, c-format +msgid "%s: invalid array origin" +msgstr "%c%c: opci? inv?lida" + +#: builtins/mapfile.def:304 +#, fuzzy, c-format +msgid "%s: invalid callback quantum" +msgstr "n?mero inv?lid de senyal" + +#: builtins/mapfile.def:336 +#, fuzzy +msgid "empty array variable name" +msgstr "%s: variable sense vincle" + +#: builtins/mapfile.def:357 +msgid "array variable support required" +msgstr "" + +#: builtins/printf.def:402 +#, c-format +msgid "`%s': missing format character" +msgstr "" + +#: builtins/printf.def:456 +#, fuzzy, c-format +msgid "`%c': invalid time format specification" +msgstr "%c%c: opci? inv?lida" + +#: builtins/printf.def:658 +#, c-format +msgid "`%c': invalid format character" +msgstr "" + +#: builtins/printf.def:684 +#, c-format +msgid "warning: %s: %s" +msgstr "" + +#: builtins/printf.def:768 +#, c-format +msgid "format parsing problem: %s" +msgstr "" + +#: builtins/printf.def:865 +msgid "missing hex digit for \\x" +msgstr "" + +#: builtins/printf.def:880 +#, c-format +msgid "missing unicode digit for \\%c" +msgstr "" + +#: builtins/pushd.def:195 +#, fuzzy +msgid "no other directory" +msgstr "seguent entrada de la pila (o sia, la nova primera entrada)." + +#: builtins/pushd.def:354 +#, fuzzy, c-format +msgid "%s: invalid argument" +msgstr "%c%c: opci? inv?lida" + +#: builtins/pushd.def:468 +#, fuzzy +msgid "" +msgstr "\taquest ser? el nou directori actual de treball." + +#: builtins/pushd.def:512 +msgid "directory stack empty" +msgstr "" + +#: builtins/pushd.def:514 +#, fuzzy +msgid "directory stack index" +msgstr "S'ha desbordat la base de la pila." + +#: builtins/pushd.def:689 +msgid "" +"Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +"\tdirs when invoked without options, starting with zero." +msgstr "" + +#: builtins/pushd.def:711 +msgid "" +"Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" + +#: builtins/pushd.def:736 +msgid "" +"Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" + +#: builtins/read.def:275 +#, c-format +msgid "%s: invalid timeout specification" +msgstr "" + +#: builtins/read.def:678 +#, fuzzy, c-format +msgid "read error: %d: %s" +msgstr "error del conducte: %s" + +#: builtins/return.def:75 +msgid "can only `return' from a function or sourced script" +msgstr "" + +#: builtins/set.def:782 +#, fuzzy +msgid "cannot simultaneously unset a function and a variable" +msgstr "" +"servir LOCAL dins d'una funci?; a?? restringir? la magnitud visible de la" + +#: builtins/set.def:826 +#, fuzzy, c-format +msgid "%s: cannot unset" +msgstr "%s: no es pot crear: %s" + +#: builtins/set.def:843 +#, fuzzy, c-format +msgid "%s: cannot unset: readonly %s" +msgstr "%s: no es pot crear: %s" + +#: builtins/set.def:854 +#, fuzzy, c-format +msgid "%s: not an array variable" +msgstr "%s: variable sense vincle" + +#: builtins/setattr.def:187 +#, fuzzy, c-format +msgid "%s: not a function" +msgstr "%s: funci? nom?s de lectura" + +#: builtins/shift.def:71 builtins/shift.def:77 +#, fuzzy +msgid "shift count" +msgstr "shift [n]" + +#: builtins/shopt.def:279 +msgid "cannot set and unset shell options simultaneously" +msgstr "" + +#: builtins/shopt.def:346 +#, c-format +msgid "%s: invalid shell option name" +msgstr "" + +#: builtins/source.def:130 +msgid "filename argument required" +msgstr "" + +#: builtins/source.def:155 +#, fuzzy, c-format +msgid "%s: file not found" +msgstr "%s: no s'ha trobat l'ordre" + +#: builtins/suspend.def:101 +msgid "cannot suspend" +msgstr "" + +#: builtins/suspend.def:111 +#, fuzzy +msgid "cannot suspend a login shell" +msgstr "Finalitzar una sessi? de l'int?rpret d'ordres." + +#: builtins/type.def:234 +#, c-format +msgid "%s is aliased to `%s'\n" +msgstr "" + +#: builtins/type.def:255 +#, c-format +msgid "%s is a shell keyword\n" +msgstr "" + +#: builtins/type.def:274 +#, fuzzy, c-format +msgid "%s is a function\n" +msgstr "%s: funci? nom?s de lectura" + +#: builtins/type.def:296 +#, c-format +msgid "%s is a shell builtin\n" +msgstr "" + +#: builtins/type.def:317 builtins/type.def:393 +#, c-format +msgid "%s is %s\n" +msgstr "" + +#: builtins/type.def:337 +#, c-format +msgid "%s is hashed (%s)\n" +msgstr "" + +#: builtins/ulimit.def:383 +#, c-format +msgid "%s: invalid limit argument" +msgstr "" + +#: builtins/ulimit.def:409 +#, fuzzy, c-format +msgid "`%c': bad command" +msgstr "%c%c: opci? inv?lida" + +#: builtins/ulimit.def:438 +#, fuzzy, c-format +msgid "%s: cannot get limit: %s" +msgstr "%s: no es pot crear: %s" + +#: builtins/ulimit.def:464 +#, fuzzy +msgid "limit" +msgstr "L?mit de la UCP" + +#: builtins/ulimit.def:476 builtins/ulimit.def:776 +#, fuzzy, c-format +msgid "%s: cannot modify limit: %s" +msgstr "%s: no es pot crear: %s" + +#: builtins/umask.def:114 +#, fuzzy +msgid "octal number" +msgstr "n?mero inv?lid de senyal" + +#: builtins/umask.def:227 +#, c-format +msgid "`%c': invalid symbolic mode operator" +msgstr "" + +#: builtins/umask.def:282 +#, c-format +msgid "`%c': invalid symbolic mode character" +msgstr "" + +#: error.c:90 error.c:325 error.c:327 error.c:329 +msgid " line " +msgstr "" + +#: error.c:165 +#, fuzzy, c-format +msgid "last command: %s\n" +msgstr "si s'escriu \"r\" s'executar? la darrera ordre." + +#: error.c:173 +#, c-format +msgid "Aborting..." +msgstr "" + +#: error.c:440 +#, fuzzy +msgid "unknown command error" +msgstr "Error desconegut %d" + +#: error.c:441 +#, fuzzy +msgid "bad command type" +msgstr "un nom d'una ordre." + +#: error.c:442 +#, fuzzy +msgid "bad connector" +msgstr "connector inv?lid '%d'" + +#: error.c:443 +#, fuzzy +msgid "bad jump" +msgstr "Salt incorrecte %d" + +#: error.c:481 +#, c-format +msgid "%s: unbound variable" +msgstr "%s: variable sense vincle" + +#: eval.c:189 +#, fuzzy, c-format +msgid "\atimed out waiting for input: auto-logout\n" +msgstr "" +"%c ha excedit el temps d'espera per una entrada: fi autom?tica de sessi?\n" + +#: execute_cmd.c:512 +#, c-format +msgid "cannot redirect standard input from /dev/null: %s" +msgstr "" + +#: execute_cmd.c:1233 +#, c-format +msgid "TIMEFORMAT: `%c': invalid format character" +msgstr "" + +#: execute_cmd.c:2287 +#, fuzzy +msgid "pipe error" +msgstr "error del conducte: %s" + +#: execute_cmd.c:4386 +#, c-format +msgid "%s: maximum function nesting level exceeded (%d)" +msgstr "" + +#: execute_cmd.c:4884 +#, c-format +msgid "%s: restricted: cannot specify `/' in command names" +msgstr "%s: restringit: no es pot especificar '/' en noms d'ordres" + +#: execute_cmd.c:4973 +#, c-format +msgid "%s: command not found" +msgstr "%s: no s'ha trobat l'ordre" + +#: execute_cmd.c:5206 +#, c-format +msgid "%s: %s" +msgstr "" + +#: execute_cmd.c:5243 +#, fuzzy, c-format +msgid "%s: %s: bad interpreter" +msgstr "%s: ?s un directori" + +#: execute_cmd.c:5280 +#, fuzzy, c-format +msgid "%s: cannot execute binary file: %s" +msgstr "%s: no es pot executar el fitxer binari" + +#: execute_cmd.c:5352 +#, c-format +msgid "`%s': is a special builtin" +msgstr "" + +#: execute_cmd.c:5404 +#, fuzzy, c-format +msgid "cannot duplicate fd %d to fd %d" +msgstr "" +"no es pot copiar per duplicat el descriptor del fitxer df %d cap a df 0: %s" + +#: expr.c:259 +msgid "expression recursion level exceeded" +msgstr "s'ha excedit el nivell de recursivitat de l'expressi?" + +#: expr.c:283 +#, fuzzy +msgid "recursion stack underflow" +msgstr "S'ha desbordat la base de la pila." + +#: expr.c:431 +msgid "syntax error in expression" +msgstr "error de sintaxi a l'expressi?" + +#: expr.c:475 +msgid "attempted assignment to non-variable" +msgstr "s'ha intentat assignar una variable inexistent" + +#: expr.c:495 expr.c:858 +msgid "division by 0" +msgstr "divisi? per 0" + +#: expr.c:542 +#, fuzzy +msgid "bug: bad expassign token" +msgstr "error de programaci?: pas incorrecte del senyal %d per a expassing()." + +#: expr.c:595 +msgid "`:' expected for conditional expression" +msgstr "s'esperava ':' per a l'expressi? condicional" + +#: expr.c:919 +msgid "exponent less than 0" +msgstr "" + +#: expr.c:976 +msgid "identifier expected after pre-increment or pre-decrement" +msgstr "" + +#: expr.c:1002 +msgid "missing `)'" +msgstr "falta algun ')'" + +#: expr.c:1053 expr.c:1390 +#, fuzzy +msgid "syntax error: operand expected" +msgstr "error de sintaxi: s'ha arribat inesperadament a la fi del fitxer" + +#: expr.c:1392 +msgid "syntax error: invalid arithmetic operator" +msgstr "" + +#: expr.c:1416 +#, fuzzy, c-format +msgid "%s%s%s: %s (error token is \"%s\")" +msgstr "%s: %s: %s (la prova d'error ?s \"%s\")\n" + +#: expr.c:1474 +msgid "invalid arithmetic base" +msgstr "" + +#: expr.c:1494 +msgid "value too great for base" +msgstr "valor massa gran per a la base de numeraci?" + +#: expr.c:1543 +#, fuzzy, c-format +msgid "%s: expression error\n" +msgstr "%s: s'esperava una expressi? de nombre enter" + +#: general.c:62 +#, fuzzy +msgid "getcwd: cannot access parent directories" +msgstr "getwd: no s'ha pogut accedir als directoris pares" + +#: input.c:102 subst.c:5168 +#, fuzzy, c-format +msgid "cannot reset nodelay mode for fd %d" +msgstr "" +"no es pot copiar per duplicat el descriptor del fitxer df %d cap a df 0: %s" + +#: input.c:271 +#, fuzzy, c-format +msgid "cannot allocate new file descriptor for bash input from fd %d" +msgstr "" +"no s'ha pogut assignar una nova descripci? de fitxer per a l'entrada de " +"bash\n" +"a partir del descriptor de fitxer %d: %s" + +#: input.c:279 +#, fuzzy, c-format +msgid "save_bash_input: buffer already exists for new fd %d" +msgstr "" +"check_bash_input: ja hi existeix mem?ria interm?dia per a la nova\n" +"descripci? de fitxer %d" + +#: jobs.c:471 +msgid "start_pipeline: pgrp pipe" +msgstr "" + +#: jobs.c:893 +#, c-format +msgid "forked pid %d appears in running job %d" +msgstr "" + +#: jobs.c:1012 +#, c-format +msgid "deleting stopped job %d with process group %ld" +msgstr "" + +#: jobs.c:1117 +#, c-format +msgid "add_process: process %5ld (%s) in the_pipeline" +msgstr "" + +#: jobs.c:1120 +#, c-format +msgid "add_process: pid %5ld (%s) marked as still alive" +msgstr "" + +#: jobs.c:1435 +#, fuzzy, c-format +msgid "describe_pid: %ld: no such pid" +msgstr "describe_pid: L'identificador de proc?s (pid) no existeix (%d)!\n" + +#: jobs.c:1450 +#, fuzzy, c-format +msgid "Signal %d" +msgstr "Senyal desconeguda #%d" + +#: jobs.c:1464 jobs.c:1489 +msgid "Done" +msgstr "Fet" + +#: jobs.c:1469 siglist.c:123 +msgid "Stopped" +msgstr "Aturat" + +#: jobs.c:1473 +#, fuzzy, c-format +msgid "Stopped(%s)" +msgstr "Aturat" + +#: jobs.c:1477 +msgid "Running" +msgstr "S'est? executant" + +#: jobs.c:1491 +#, c-format +msgid "Done(%d)" +msgstr "Fet (%d)" + +#: jobs.c:1493 +#, c-format +msgid "Exit %d" +msgstr "Fi d'execuci? amb l'estat %d" + +#: jobs.c:1496 +msgid "Unknown status" +msgstr "Estat desconegut" + +#: jobs.c:1583 +#, c-format +msgid "(core dumped) " +msgstr "(la imatge del nucli ha estat bolcada) " + +#: jobs.c:1602 +#, fuzzy, c-format +msgid " (wd: %s)" +msgstr "(wd ara: %s)\n" + +#: jobs.c:1819 +#, fuzzy, c-format +msgid "child setpgid (%ld to %ld)" +msgstr "error en l'execuci? de setpgid (%d a %d) en el proc?s fill %d: %s\n" + +#: jobs.c:2138 nojobs.c:605 +#, fuzzy, c-format +msgid "wait: pid %ld is not a child of this shell" +msgstr "" +"wait: l'identificador del proc?s (pid) %d no ?s un fill d'aquest int?rpret" + +#: jobs.c:2385 +#, c-format +msgid "wait_for: No record of process %ld" +msgstr "" + +#: jobs.c:2694 +#, c-format +msgid "wait_for_job: job %d is stopped" +msgstr "" + +#: jobs.c:2986 +#, c-format +msgid "%s: job has terminated" +msgstr "%s: s'ha finalitzat la tasca" + +#: jobs.c:2995 +#, c-format +msgid "%s: job %d already in background" +msgstr "" + +#: jobs.c:3220 +msgid "waitchld: turning on WNOHANG to avoid indefinite block" +msgstr "" + +#: jobs.c:3711 +#, fuzzy, c-format +msgid "%s: line %d: " +msgstr "encaix %3d:" + +#: jobs.c:3725 nojobs.c:843 +#, c-format +msgid " (core dumped)" +msgstr " (bolcat de la imatge del nucli)" + +#: jobs.c:3737 jobs.c:3750 +#, c-format +msgid "(wd now: %s)\n" +msgstr "(wd ara: %s)\n" + +#: jobs.c:3782 +#, fuzzy +msgid "initialize_job_control: getpgrp failed" +msgstr "initialize_jobs: getpgrp ha fallat: %s" + +#: jobs.c:3843 +#, fuzzy +msgid "initialize_job_control: line discipline" +msgstr "initialize_jobs: disciplina de l?nia: %s" + +#: jobs.c:3853 +#, fuzzy +msgid "initialize_job_control: setpgid" +msgstr "initialize_jobs: getpgrp ha fallat: %s" + +#: jobs.c:3874 jobs.c:3883 +#, c-format +msgid "cannot set terminal process group (%d)" +msgstr "" + +#: jobs.c:3888 +msgid "no job control in this shell" +msgstr "no hi ha cap tasca de control dins d'aquest int?rpret" + +#: lib/malloc/malloc.c:296 +#, c-format +msgid "malloc: failed assertion: %s\n" +msgstr "" + +#: lib/malloc/malloc.c:312 +#, c-format +msgid "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" +msgstr "" + +#: lib/malloc/malloc.c:313 +#, fuzzy +msgid "unknown" +msgstr "" + +#: lib/malloc/malloc.c:801 +msgid "malloc: block on free list clobbered" +msgstr "" + +#: lib/malloc/malloc.c:878 +msgid "free: called with already freed block argument" +msgstr "" + +#: lib/malloc/malloc.c:881 +msgid "free: called with unallocated block argument" +msgstr "" + +#: lib/malloc/malloc.c:900 +msgid "free: underflow detected; mh_nbytes out of range" +msgstr "" + +#: lib/malloc/malloc.c:906 +msgid "free: start and end chunk sizes differ" +msgstr "" + +#: lib/malloc/malloc.c:1005 +msgid "realloc: called with unallocated block argument" +msgstr "" + +#: lib/malloc/malloc.c:1020 +msgid "realloc: underflow detected; mh_nbytes out of range" +msgstr "" + +#: lib/malloc/malloc.c:1026 +msgid "realloc: start and end chunk sizes differ" +msgstr "" + +#: lib/malloc/table.c:194 +#, c-format +msgid "register_alloc: alloc table is full with FIND_ALLOC?\n" +msgstr "" + +#: lib/malloc/table.c:203 +#, c-format +msgid "register_alloc: %p already in table as allocated?\n" +msgstr "" + +#: lib/malloc/table.c:256 +#, c-format +msgid "register_free: %p already in table as free?\n" +msgstr "" + +#: lib/sh/fmtulong.c:102 +msgid "invalid base" +msgstr "" + +#: lib/sh/netopen.c:168 +#, fuzzy, c-format +msgid "%s: host unknown" +msgstr "desconegut" + +#: lib/sh/netopen.c:175 +#, c-format +msgid "%s: invalid service" +msgstr "" + +#: lib/sh/netopen.c:306 +#, c-format +msgid "%s: bad network path specification" +msgstr "" + +#: lib/sh/netopen.c:346 +msgid "network operations not supported" +msgstr "" + +#: locale.c:200 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s)" +msgstr "" + +#: locale.c:202 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s): %s" +msgstr "" + +#: locale.c:259 +#, fuzzy, c-format +msgid "setlocale: %s: cannot change locale (%s)" +msgstr "xrealloc: no es poden reassignar %lu octets (%lu octets reassignats)" + +#: locale.c:261 +#, fuzzy, c-format +msgid "setlocale: %s: cannot change locale (%s): %s" +msgstr "xrealloc: no es poden reassignar %lu octets (%lu octets reassignats)" + +#: mailcheck.c:439 +msgid "You have mail in $_" +msgstr "Teniu correu en $_" + +#: mailcheck.c:464 +msgid "You have new mail in $_" +msgstr "Teniu correu nou en $_" + +#: mailcheck.c:480 +#, c-format +msgid "The mail in %s has been read\n" +msgstr "S'ha llegit el correu a %s\n" + +#: make_cmd.c:323 +#, fuzzy +msgid "syntax error: arithmetic expression required" +msgstr "error de sintaxi a l'expressi?" + +#: make_cmd.c:325 +#, fuzzy +msgid "syntax error: `;' unexpected" +msgstr "error de sintaxi: s'ha arribat inesperadament a la fi del fitxer" + +#: make_cmd.c:326 +#, fuzzy, c-format +msgid "syntax error: `((%s))'" +msgstr "error de sintaxi" + +#: make_cmd.c:578 +#, c-format +msgid "make_here_document: bad instruction type %d" +msgstr "make_here_document: el tipus d'instrucci? %d ?s incorrecte" + +#: make_cmd.c:662 +#, c-format +msgid "here-document at line %d delimited by end-of-file (wanted `%s')" +msgstr "" + +#: make_cmd.c:759 +#, c-format +msgid "make_redirection: redirection instruction `%d' out of range" +msgstr "" + +#: parse.y:3278 parse.y:3561 +#, fuzzy, c-format +msgid "unexpected EOF while looking for matching `%c'" +msgstr "" +"s'ha arribat inesperadament a la fi del fitxer (EOF) mentre\n" +"es buscava per '%c'" + +#: parse.y:4170 +#, fuzzy +msgid "unexpected EOF while looking for `]]'" +msgstr "" +"s'ha arribat inesperadament a la fi del fitxer (EOF) mentre\n" +"es buscava per '%c'" + +#: parse.y:4175 +#, fuzzy, c-format +msgid "syntax error in conditional expression: unexpected token `%s'" +msgstr "hi ha un error inesperat de sintaxi prop del senyal '%s'" + +#: parse.y:4179 +#, fuzzy +msgid "syntax error in conditional expression" +msgstr "error de sintaxi a l'expressi?" + +#: parse.y:4257 +#, c-format +msgid "unexpected token `%s', expected `)'" +msgstr "" + +#: parse.y:4261 +#, fuzzy +msgid "expected `)'" +msgstr "s'esperava ')'" + +#: parse.y:4289 +#, c-format +msgid "unexpected argument `%s' to conditional unary operator" +msgstr "" + +#: parse.y:4293 +msgid "unexpected argument to conditional unary operator" +msgstr "" + +#: parse.y:4339 +#, fuzzy, c-format +msgid "unexpected token `%s', conditional binary operator expected" +msgstr "%s: s'esperava un operador binari" + +#: parse.y:4343 +#, fuzzy +msgid "conditional binary operator expected" +msgstr "%s: s'esperava un operador binari" + +#: parse.y:4365 +#, c-format +msgid "unexpected argument `%s' to conditional binary operator" +msgstr "" + +#: parse.y:4369 +msgid "unexpected argument to conditional binary operator" +msgstr "" + +#: parse.y:4380 +#, fuzzy, c-format +msgid "unexpected token `%c' in conditional command" +msgstr "s'esperava ':' per a l'expressi? condicional" + +#: parse.y:4383 +#, fuzzy, c-format +msgid "unexpected token `%s' in conditional command" +msgstr "s'esperava ':' per a l'expressi? condicional" + +#: parse.y:4387 +#, fuzzy, c-format +msgid "unexpected token %d in conditional command" +msgstr "s'esperava ':' per a l'expressi? condicional" + +#: parse.y:5737 +#, c-format +msgid "syntax error near unexpected token `%s'" +msgstr "hi ha un error inesperat de sintaxi prop del senyal '%s'" + +#: parse.y:5755 +#, fuzzy, c-format +msgid "syntax error near `%s'" +msgstr "hi ha un error inesperat de sintaxi prop del senyal '%s'" + +#: parse.y:5765 +msgid "syntax error: unexpected end of file" +msgstr "error de sintaxi: s'ha arribat inesperadament a la fi del fitxer" + +#: parse.y:5765 +msgid "syntax error" +msgstr "error de sintaxi" + +#: parse.y:5827 +#, c-format +msgid "Use \"%s\" to leave the shell.\n" +msgstr "Utilitzeu ?%s? per a eixir de l'int?rpret d'ordres.\n" + +#: parse.y:5989 +#, fuzzy +msgid "unexpected EOF while looking for matching `)'" +msgstr "" +"s'ha arribat inesperadament a la fi del fitxer (EOF) mentre\n" +"es buscava per '%c'" + +#: pcomplete.c:1094 +#, c-format +msgid "completion: function `%s' not found" +msgstr "" + +#: pcomplib.c:182 +#, c-format +msgid "progcomp_insert: %s: NULL COMPSPEC" +msgstr "" + +#: print_cmd.c:300 +#, c-format +msgid "print_command: bad connector `%d'" +msgstr "print_command: el connector '%d' ?s incorrecte" + +#: print_cmd.c:373 +#, c-format +msgid "xtrace_set: %d: invalid file descriptor" +msgstr "" + +#: print_cmd.c:378 +msgid "xtrace_set: NULL file pointer" +msgstr "" + +#: print_cmd.c:382 +#, c-format +msgid "xtrace fd (%d) != fileno xtrace fp (%d)" +msgstr "" + +#: print_cmd.c:1518 +#, c-format +msgid "cprintf: `%c': invalid format character" +msgstr "" + +#: redir.c:123 redir.c:170 +msgid "file descriptor out of range" +msgstr "" + +#: redir.c:177 +#, fuzzy, c-format +msgid "%s: ambiguous redirect" +msgstr "%s: Redirecci? ambigua" + +# No acabe d'entendre el significat de l'original "clobber" +#: redir.c:181 +#, fuzzy, c-format +msgid "%s: cannot overwrite existing file" +msgstr "%s: No s'ha pogut sobreescriure el fitxer existent" + +#: redir.c:186 +#, fuzzy, c-format +msgid "%s: restricted: cannot redirect output" +msgstr "%s: restringit: no es pot especificar '/' en noms d'ordres" + +#: redir.c:191 +#, fuzzy, c-format +msgid "cannot create temp file for here-document: %s" +msgstr "no es pot establir un conducte per a la substituci? del proc?s: %s" + +#: redir.c:195 +#, fuzzy, c-format +msgid "%s: cannot assign fd to variable" +msgstr "%s: no es pot assignar la llista a un element de la matriu" + +#: redir.c:582 +msgid "/dev/(tcp|udp)/host/port not supported without networking" +msgstr "" + +#: redir.c:861 redir.c:973 redir.c:1034 redir.c:1199 +#, fuzzy +msgid "redirection error: cannot duplicate fd" +msgstr "error de redirecci?" + +#: shell.c:339 +msgid "could not find /tmp, please create!" +msgstr "" + +#: shell.c:343 +msgid "/tmp must be a valid directory name" +msgstr "" + +#: shell.c:890 +#, fuzzy, c-format +msgid "%c%c: invalid option" +msgstr "%c%c: opci? inv?lida" + +#: shell.c:1682 +msgid "I have no name!" +msgstr "No tinc cap nom d'usuari!" + +#: shell.c:1827 +#, fuzzy, c-format +msgid "GNU bash, version %s-(%s)\n" +msgstr "GNU %s, versi? %s\n" + +#: shell.c:1828 +#, c-format +msgid "" +"Usage:\t%s [GNU long option] [option] ...\n" +"\t%s [GNU long option] [option] script-file ...\n" +msgstr "" +"Sintaxi:\t%s [opci?-format-llarg GNU] [opci?] ...\n" +"\t%s [opci?-format-llarg GNU] [opci?] fitxer_de_seq??ncies ...\n" + +#: shell.c:1830 +msgid "GNU long options:\n" +msgstr "opcions de formes llargues de GNU:\n" + +#: shell.c:1834 +msgid "Shell options:\n" +msgstr "Opcions de l'int?rpret d'ordres:\n" + +#: shell.c:1835 +#, fuzzy +msgid "\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n" +msgstr "\t-irsD o -c ordre\t\t(nom?s per a invocar)\n" + +#: shell.c:1850 +#, c-format +msgid "\t-%s or -o option\n" +msgstr "\t-%s o -o opci?\n" + +#: shell.c:1856 +#, c-format +msgid "Type `%s -c \"help set\"' for more information about shell options.\n" +msgstr "" +"Per a obtindre m?s informaci? sobre les opcions de l'int?rpret\n" +"d'ordres, teclegeu ?%s -c \"help set\"?.\n" + +#: shell.c:1857 +#, c-format +msgid "Type `%s -c help' for more information about shell builtin commands.\n" +msgstr "" +"Per a obtindre m?s informaci? sobre les ordres integrades de l'int?rpret,\n" +"teclegeu '%s -c help' .\n" + +#: shell.c:1858 +#, c-format +msgid "Use the `bashbug' command to report bugs.\n" +msgstr "" + +#: sig.c:691 +#, c-format +msgid "sigprocmask: %d: invalid operation" +msgstr "" + +#: siglist.c:48 +msgid "Bogus signal" +msgstr "Senyal falsa" + +#: siglist.c:51 +msgid "Hangup" +msgstr "Penjar" + +#: siglist.c:55 +msgid "Interrupt" +msgstr "Interrumpeix" + +#: siglist.c:59 +msgid "Quit" +msgstr "Eixir" + +#: siglist.c:63 +msgid "Illegal instruction" +msgstr "Instrucci? ilžlegal" + +#: siglist.c:67 +msgid "BPT trace/trap" +msgstr "BPT rastrejament/captura" + +#: siglist.c:75 +msgid "ABORT instruction" +msgstr "Instrucci? d'avortament (ABORT)" + +#: siglist.c:79 +msgid "EMT instruction" +msgstr "Instrucci? per a emular una captura EMT" + +#: siglist.c:83 +msgid "Floating point exception" +msgstr "Excepci? en operaci? amb coma flotant" + +#: siglist.c:87 +msgid "Killed" +msgstr "Finalitzat" + +#: siglist.c:91 +msgid "Bus error" +msgstr "Error de bus" + +#: siglist.c:95 +msgid "Segmentation fault" +msgstr "Violaci? de segment" + +#: siglist.c:99 +msgid "Bad system call" +msgstr "Crida inv?lida del sistema" + +#: siglist.c:103 +msgid "Broken pipe" +msgstr "Conducte trencat" + +#: siglist.c:107 +msgid "Alarm clock" +msgstr "Temporitzador" + +#: siglist.c:111 +#, fuzzy +msgid "Terminated" +msgstr "" +"opci? incorrecta, la funci? getopts() introdueix el signe '?' dins de\n" +"la variable NAME i esborra la variable OPTARG. Si no es troba una \n" +"opci? necess?ria, s'introdueix el signe '?' en la variable NAME, \n" +"s'esborra la variable OPTARG, i s'imprimir? un missatge de\n" +"diagn?stic." + +#: siglist.c:115 +msgid "Urgent IO condition" +msgstr "Condici? urgent d'Entrada/Eixida (En/Ei)" + +#: siglist.c:119 +msgid "Stopped (signal)" +msgstr "Aturat (senyal)" + +#: siglist.c:127 +msgid "Continue" +msgstr "Continua" + +#: siglist.c:135 +msgid "Child death or stop" +msgstr "S'ha mort o s'ha aturat el proc?s fill" + +#: siglist.c:139 +msgid "Stopped (tty input)" +msgstr "Aturat (entrada per terminal)" + +#: siglist.c:143 +msgid "Stopped (tty output)" +msgstr "Aturat (eixida per terminal)" + +#: siglist.c:147 +msgid "I/O ready" +msgstr "Entrada/Eixida preparades" + +#: siglist.c:151 +msgid "CPU limit" +msgstr "L?mit de la UCP" + +#: siglist.c:155 +msgid "File limit" +msgstr "L?mit de la grand?ria del fitxer" + +#: siglist.c:159 +msgid "Alarm (virtual)" +msgstr "Alarma (virtual)" + +#: siglist.c:163 +msgid "Alarm (profile)" +msgstr "Alarma (entorn)" + +#: siglist.c:167 +msgid "Window changed" +msgstr "S'ha canviat la finestra" + +#: siglist.c:171 +msgid "Record lock" +msgstr "Bloqueig de gravaci?" + +#: siglist.c:175 +msgid "User signal 1" +msgstr "Senyal 1 definida per l'usuari" + +#: siglist.c:179 +msgid "User signal 2" +msgstr "Senyal 2 definida per l'usuari" + +#: siglist.c:183 +msgid "HFT input data pending" +msgstr "pendent de l'entrada de dades HFT" + +#: siglist.c:187 +msgid "power failure imminent" +msgstr "fallida imminent d'energia" + +#: siglist.c:191 +msgid "system crash imminent" +msgstr "fallida imminent del sistema" + +#: siglist.c:195 +msgid "migrate process to another CPU" +msgstr "proc?s de migraci? cap a un altre UPC en curs" + +#: siglist.c:199 +msgid "programming error" +msgstr "error de programaci?" + +#: siglist.c:203 +msgid "HFT monitor mode granted" +msgstr "S'ha concedit el mode de monitor HFT" + +#: siglist.c:207 +msgid "HFT monitor mode retracted" +msgstr "S'ha rebutjat el mode de monitor HFT" + +#: siglist.c:211 +msgid "HFT sound sequence has completed" +msgstr "S'ha completat la seq??ncia de so HFT" + +#: siglist.c:215 +msgid "Information request" +msgstr "" + +#: siglist.c:223 +msgid "Unknown Signal #" +msgstr "Senyal desconeguda #" + +#: siglist.c:225 +#, c-format +msgid "Unknown Signal #%d" +msgstr "Senyal desconeguda #%d" + +#: subst.c:1362 subst.c:1520 +#, fuzzy, c-format +msgid "bad substitution: no closing `%s' in %s" +msgstr "substituci? inv?lida: no existeix '%s' en %s" + +#: subst.c:2847 +#, c-format +msgid "%s: cannot assign list to array member" +msgstr "%s: no es pot assignar la llista a un element de la matriu" + +#: subst.c:5065 subst.c:5081 +#, fuzzy +msgid "cannot make pipe for process substitution" +msgstr "no es pot establir un conducte per a la substituci? del proc?s: %s" + +#: subst.c:5113 +#, fuzzy +msgid "cannot make child for process substitution" +msgstr "no es pot establir un proc?s fill per a la substituci? del proc?s: %s" + +#: subst.c:5158 +#, fuzzy, c-format +msgid "cannot open named pipe %s for reading" +msgstr "no es pot obrir el conducte anomenat %s per a %s: %s" + +#: subst.c:5160 +#, fuzzy, c-format +msgid "cannot open named pipe %s for writing" +msgstr "no es pot obrir el conducte anomenat %s per a %s: %s" + +#: subst.c:5178 +#, fuzzy, c-format +msgid "cannot duplicate named pipe %s as fd %d" +msgstr "" +"no es pot duplicar el conducte anomenat %s\n" +"com a descripci? de fitxer %d: %s" + +#: subst.c:5376 +#, fuzzy +msgid "cannot make pipe for command substitution" +msgstr "no es poden establir conductes per a la substituci? de l'ordre: %s" + +#: subst.c:5414 +#, fuzzy +msgid "cannot make child for command substitution" +msgstr "no es pot crear un proc?s fill per a la substituci? del proc?s: %s" + +#: subst.c:5433 +#, fuzzy +msgid "command_substitute: cannot duplicate pipe as fd 1" +msgstr "" +"command_substitute(): el coducte no es pot duplicar\n" +"com a descripci? de fitxer 1: %s" + +#: subst.c:5837 subst.c:8050 +#, c-format +msgid "%s: invalid variable name for name reference" +msgstr "" + +#: subst.c:6048 +#, c-format +msgid "%s: parameter null or not set" +msgstr "%s: par?metre nul o no ajustat" + +#: subst.c:6320 subst.c:6335 +#, c-format +msgid "%s: substring expression < 0" +msgstr "%s: la sub-cadena de l'expressi? ?s < 0" + +#: subst.c:7506 +#, c-format +msgid "%s: bad substitution" +msgstr "%s: substituci? inv?lida" + +#: subst.c:7583 +#, c-format +msgid "$%s: cannot assign in this way" +msgstr "$%s: no es pot assignar d'aquesta manera" + +#: subst.c:7917 +msgid "" +"future versions of the shell will force evaluation as an arithmetic " +"substitution" +msgstr "" + +#: subst.c:8421 +#, fuzzy, c-format +msgid "bad substitution: no closing \"`\" in %s" +msgstr "substituci? inv?lida: no existeix '%s' en %s" + +#: subst.c:9322 +#, c-format +msgid "no match: %s" +msgstr "" + +#: test.c:147 +msgid "argument expected" +msgstr "s'esperava un par?metre" + +#: test.c:156 +#, c-format +msgid "%s: integer expression expected" +msgstr "%s: s'esperava una expressi? de nombre enter" + +#: test.c:264 +msgid "`)' expected" +msgstr "s'esperava ')'" + +#: test.c:266 +#, c-format +msgid "`)' expected, found %s" +msgstr "mentre es buscava ?)?, s'ha trobat %s" + +#: test.c:281 test.c:742 test.c:745 +#, c-format +msgid "%s: unary operator expected" +msgstr "%s: s'esperava un operador unari" + +#: test.c:468 test.c:785 +#, c-format +msgid "%s: binary operator expected" +msgstr "%s: s'esperava un operador binari" + +#: test.c:860 +msgid "missing `]'" +msgstr "s'ha perdut algun ']'" + +#: trap.c:217 +#, fuzzy +msgid "invalid signal number" +msgstr "n?mero inv?lid de senyal" + +#: trap.c:371 +#, c-format +msgid "run_pending_traps: bad value in trap_list[%d]: %p" +msgstr "" + +#: trap.c:375 +#, c-format +msgid "" +"run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" +msgstr "" + +#: trap.c:428 +#, fuzzy, c-format +msgid "trap_handler: bad signal %d" +msgstr "trap_handler: Senyal inv?lida %d" + +#: variables.c:382 +#, c-format +msgid "error importing function definition for `%s'" +msgstr "'%s': error en importar la definici? de la funci?" + +#: variables.c:780 +#, c-format +msgid "shell level (%d) too high, resetting to 1" +msgstr "" + +#: variables.c:1865 +#, c-format +msgid "%s: circular name reference" +msgstr "" + +#: variables.c:2228 +msgid "make_local_variable: no function context at current scope" +msgstr "" + +#: variables.c:2247 +#, fuzzy, c-format +msgid "%s: variable may not be assigned value" +msgstr "%s: no es pot assignar la llista a un element de la matriu" + +#: variables.c:3646 +msgid "all_local_variables: no function context at current scope" +msgstr "" + +#: variables.c:3891 +#, fuzzy, c-format +msgid "%s has null exportstr" +msgstr "%s: par?metre nul o no ajustat" + +#: variables.c:3896 variables.c:3905 +#, c-format +msgid "invalid character %d in exportstr for %s" +msgstr "" + +#: variables.c:3911 +#, c-format +msgid "no `=' in exportstr for %s" +msgstr "" + +#: variables.c:4344 +msgid "pop_var_context: head of shell_variables not a function context" +msgstr "" + +#: variables.c:4357 +msgid "pop_var_context: no global_variables context" +msgstr "" + +#: variables.c:4431 +msgid "pop_scope: head of shell_variables not a temporary environment scope" +msgstr "" + +#: variables.c:5257 +#, fuzzy, c-format +msgid "%s: %s: cannot open as FILE" +msgstr "%s: no es pot crear: %s" + +#: variables.c:5262 +#, c-format +msgid "%s: %s: invalid value for trace file descriptor" +msgstr "" + +#: variables.c:5307 +#, c-format +msgid "%s: %s: compatibility value out of range" +msgstr "" + +#: version.c:46 +msgid "Copyright (C) 2013 Free Software Foundation, Inc." +msgstr "" + +#: version.c:47 version2.c:47 +msgid "" +"License GPLv3+: GNU GPL version 3 or later \n" +msgstr "" + +#: version.c:86 version2.c:86 +#, fuzzy, c-format +msgid "GNU bash, version %s (%s)\n" +msgstr "GNU %s, versi? %s\n" + +#: version.c:91 version2.c:91 +msgid "This is free software; you are free to change and redistribute it." +msgstr "" + +#: version.c:92 version2.c:92 +msgid "There is NO WARRANTY, to the extent permitted by law." +msgstr "" + +#: version2.c:46 +msgid "Copyright (C) 2012 Free Software Foundation, Inc." +msgstr "" + +#: xmalloc.c:91 +#, fuzzy, c-format +msgid "%s: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "xmalloc: no es poden assignar %lu octets (%lu octets assignats)" + +#: xmalloc.c:93 +#, fuzzy, c-format +msgid "%s: cannot allocate %lu bytes" +msgstr "xmalloc: no es poden assignar %lu octets (%lu octets assignats)" + +#: xmalloc.c:163 +#, fuzzy, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "xmalloc: no es poden assignar %lu octets (%lu octets assignats)" + +#: xmalloc.c:165 +#, fuzzy, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes" +msgstr "xmalloc: no es poden assignar %lu octets (%lu octets assignats)" + +#: builtins.c:43 +msgid "alias [-p] [name[=value] ... ]" +msgstr "alias [-p] [nom[=valor] ... ]" + +#: builtins.c:47 +#, fuzzy +msgid "unalias [-a] name [name ...]" +msgstr "unalias [-a] [nom ...]" + +#: builtins.c:51 +#, fuzzy +msgid "" +"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-" +"x keyseq:shell-command] [keyseq:readline-function or readline-command]" +msgstr "" +"bind [-lpvsPVS] [-m keymap] [-f fitxer] [-q nom] [-r keyseq] [keyseq:funci?-" +"readline] " + +#: builtins.c:54 +msgid "break [n]" +msgstr "break [n]" + +#: builtins.c:56 +msgid "continue [n]" +msgstr "continue [n]" + +#: builtins.c:58 +msgid "builtin [shell-builtin [arg ...]]" +msgstr "builtin [ordre-interna [arg ...]]" + +#: builtins.c:61 +#, fuzzy +msgid "caller [expr]" +msgstr "test [expressi?]" + +#: builtins.c:64 +#, fuzzy +msgid "cd [-L|[-P [-e]] [-@]] [dir]" +msgstr "cd [-PL] [directori]" + +#: builtins.c:66 +#, fuzzy +msgid "pwd [-LP]" +msgstr "pwd [-PL]" + +#: builtins.c:68 +msgid ":" +msgstr ":" + +#: builtins.c:70 +msgid "true" +msgstr "" + +#: builtins.c:72 +msgid "false" +msgstr "" + +#: builtins.c:74 +msgid "command [-pVv] command [arg ...]" +msgstr "command [-pVv] ordre [par?metre ...]" + +#: builtins.c:76 +#, fuzzy +msgid "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" +msgstr "declare [-afFrxi] [-p] nom[=valor] ..." + +#: builtins.c:78 +#, fuzzy +msgid "typeset [-aAfFgilrtux] [-p] name[=value] ..." +msgstr "typeset [-afFrxi] [-p] nom[=valor] ..." + +#: builtins.c:80 +#, fuzzy +msgid "local [option] name[=value] ..." +msgstr "local nom[=valor] ..." + +#: builtins.c:83 +msgid "echo [-neE] [arg ...]" +msgstr "echo [-neE] [par?metre ...]" + +#: builtins.c:87 +msgid "echo [-n] [arg ...]" +msgstr "echo [-n] [par?metre ...]" + +#: builtins.c:90 +#, fuzzy +msgid "enable [-a] [-dnps] [-f filename] [name ...]" +msgstr "enable [-pnds] [-a] [-f fitxer] [nom ...]" + +#: builtins.c:92 +msgid "eval [arg ...]" +msgstr "eval [par?metre ...]" + +#: builtins.c:94 +msgid "getopts optstring name [arg]" +msgstr "getopts cadena_opcions nom [par?metre]" + +#: builtins.c:96 +#, fuzzy +msgid "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" +msgstr "exec [-cl] [-a nom] fitxer [redireccionament ...]" + +#: builtins.c:98 +msgid "exit [n]" +msgstr "exit [n]" + +#: builtins.c:100 +#, fuzzy +msgid "logout [n]" +msgstr "fi de sessi?" + +#: builtins.c:103 +#, fuzzy +msgid "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" +msgstr "" +"fc [-e nom_e] [-nlr] [primer] [darrer]\n" +"o\n" +"fc -s [patr?=rep] [ordre]" + +#: builtins.c:107 +msgid "fg [job_spec]" +msgstr "fg [id_tasca]" + +#: builtins.c:111 +#, fuzzy +msgid "bg [job_spec ...]" +msgstr "bg [id_tasca]" + +#: builtins.c:114 +#, fuzzy +msgid "hash [-lr] [-p pathname] [-dt] [name ...]" +msgstr "hash [-r] [-p cam?] [nom ...]" + +#: builtins.c:117 +#, fuzzy +msgid "help [-dms] [pattern ...]" +msgstr "help [patr? ...]" + +#: builtins.c:121 +#, fuzzy +msgid "" +"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg " +"[arg...]" +msgstr "" +"history [-c] [n]\n" +"o\n" +"history -awrn [fitxer]\n" +"o\n" +"history -ps par?metre [par?metre...]" + +#: builtins.c:125 +msgid "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" +msgstr "" +"jobs [-lnprs] [id_tasca ...]\n" +"o\n" +"jobs -x ordre [par?metres]" + +#: builtins.c:129 +#, fuzzy +msgid "disown [-h] [-ar] [jobspec ...]" +msgstr "disown [id_tasca ...]" + +#: builtins.c:132 +#, fuzzy +msgid "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l " +"[sigspec]" +msgstr "" +"kill [-s id_senyal | -n n?m_senyal | -id_senyal] [id_proc?s | tasca]...\n" +"o\n" +"kill -l [id_senyal]" + +#: builtins.c:134 +msgid "let arg [arg ...]" +msgstr "let par?metres [par?metres ...]" + +#: builtins.c:136 +msgid "" +"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p " +"prompt] [-t timeout] [-u fd] [name ...]" +msgstr "" + +#: builtins.c:138 +msgid "return [n]" +msgstr "return [n]" + +#: builtins.c:140 +#, fuzzy +msgid "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" +msgstr "set [--abefhkmnptuvxBCHP] [-o opci?] [par?metres ...]" + +#: builtins.c:142 +#, fuzzy +msgid "unset [-f] [-v] [-n] [name ...]" +msgstr "unset [-f] [-v] [nom ...]" + +#: builtins.c:144 +#, fuzzy +msgid "export [-fn] [name[=value] ...] or export -p" +msgstr "" +"export [-nf] [nom ...]\n" +"o\n" +"export -p" + +#: builtins.c:146 +#, fuzzy +msgid "readonly [-aAf] [name[=value] ...] or readonly -p" +msgstr "" +"readonly [-anf] [nom ...]\n" +"o\n" +"readonly -p" + +#: builtins.c:148 +#, fuzzy +msgid "shift [n]" +msgstr "exit [n]" + +#: builtins.c:150 +#, fuzzy +msgid "source filename [arguments]" +msgstr "nom del fitxer d'origen" + +#: builtins.c:152 +#, fuzzy +msgid ". filename [arguments]" +msgstr ". nom del fitxer" + +#: builtins.c:155 +msgid "suspend [-f]" +msgstr "suspend [-f]" + +#: builtins.c:158 +msgid "test [expr]" +msgstr "test [expressi?]" + +#: builtins.c:160 +msgid "[ arg... ]" +msgstr "[ par?metres... ]" + +#: builtins.c:162 +msgid "times" +msgstr "times" + +#: builtins.c:164 +#, fuzzy +msgid "trap [-lp] [[arg] signal_spec ...]" +msgstr "" +"trap [par?metres] [id_senyal], o \n" +"trap -l" + +#: builtins.c:166 +#, fuzzy +msgid "type [-afptP] name [name ...]" +msgstr "type [-apt] nom [nom ...]" + +#: builtins.c:169 +#, fuzzy +msgid "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" +msgstr "ulimit [-SHacdfmstpnuv] [l?mit]" + +#: builtins.c:172 +#, fuzzy +msgid "umask [-p] [-S] [mode]" +msgstr "umask [-S] [mode]" + +#: builtins.c:175 +#, fuzzy +msgid "wait [-n] [id ...]" +msgstr "wait [n]" + +#: builtins.c:179 +#, fuzzy +msgid "wait [pid ...]" +msgstr "wait [n]" + +#: builtins.c:182 +#, fuzzy +msgid "for NAME [in WORDS ... ] ; do COMMANDS; done" +msgstr "for NOM [in PARAULES ... ;] do ORDRES; done" + +#: builtins.c:184 +#, fuzzy +msgid "for (( exp1; exp2; exp3 )); do COMMANDS; done" +msgstr "for NOM [in PARAULES ... ;] do ORDRES; done" + +#: builtins.c:186 +msgid "select NAME [in WORDS ... ;] do COMMANDS; done" +msgstr "select NOM [in PARAULES ... ;] do ORDRES; done" + +#: builtins.c:188 +msgid "time [-p] pipeline" +msgstr "" + +#: builtins.c:190 +msgid "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" +msgstr "case PARAULES in [PATR? [| PATR?]...) ORDRES ;;]... esac" + +#: builtins.c:192 +msgid "" +"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else " +"COMMANDS; ] fi" +msgstr "" +"if ORDRES; then ORDRES; [ elif ORDRES; then ORDRES; ]... [ else ORDRES; ] fi" + +#: builtins.c:194 +msgid "while COMMANDS; do COMMANDS; done" +msgstr "while ORDRES; do ORDRES; done" + +#: builtins.c:196 +msgid "until COMMANDS; do COMMANDS; done" +msgstr "until ORDRES; do ORDRES; done" + +#: builtins.c:198 +msgid "coproc [NAME] command [redirections]" +msgstr "" + +#: builtins.c:200 +#, fuzzy +msgid "function name { COMMANDS ; } or name () { COMMANDS ; }" +msgstr "function NOM { ORDRES ; } or NOM () { ORDRES ; }" + +#: builtins.c:202 +#, fuzzy +msgid "{ COMMANDS ; }" +msgstr "{ ORDRES }" + +#: builtins.c:204 +#, fuzzy +msgid "job_spec [&]" +msgstr "fg [id_tasca]" + +#: builtins.c:206 +#, fuzzy +msgid "(( expression ))" +msgstr "s'esperava una expressi?" + +#: builtins.c:208 +#, fuzzy +msgid "[[ expression ]]" +msgstr "s'esperava una expressi?" + +#: builtins.c:210 +#, fuzzy +msgid "variables - Names and meanings of some shell variables" +msgstr "Es permeten les variables de l'int?rpret d'ordres com a operands. El" + +#: builtins.c:213 +#, fuzzy +msgid "pushd [-n] [+N | -N | dir]" +msgstr "pushd [directori | +N | -N] [-n]" + +#: builtins.c:217 +#, fuzzy +msgid "popd [-n] [+N | -N]" +msgstr "popd [+N | -N] [-n]" + +#: builtins.c:221 +msgid "dirs [-clpv] [+N] [-N]" +msgstr "dirs [-clpv] [+N] [-N]" + +#: builtins.c:224 +#, fuzzy +msgid "shopt [-pqsu] [-o] [optname ...]" +msgstr "shopt [-pqsu] [-o opci?_format_llarg] nom_opci? [nom_opci?...]" + +#: builtins.c:226 +msgid "printf [-v var] format [arguments]" +msgstr "" + +#: builtins.c:229 +msgid "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-" +"W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S " +"suffix] [name ...]" +msgstr "" + +#: builtins.c:233 +msgid "" +"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " +"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" +msgstr "" + +#: builtins.c:237 +#, fuzzy +msgid "compopt [-o|+o option] [-DE] [name ...]" +msgstr "type [-apt] nom [nom ...]" + +#: builtins.c:240 +msgid "" +"mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" + +#: builtins.c:242 +msgid "" +"readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" + +#: builtins.c:254 +msgid "" +"Define or display aliases.\n" +" \n" +" Without arguments, `alias' prints the list of aliases in the reusable\n" +" form `alias NAME=VALUE' on standard output.\n" +" \n" +" Otherwise, an alias is defined for each NAME whose VALUE is given.\n" +" A trailing space in VALUE causes the next word to be checked for\n" +" alias substitution when the alias is expanded.\n" +" \n" +" Options:\n" +" -p\tPrint all defined aliases in a reusable format\n" +" \n" +" Exit Status:\n" +" alias returns true unless a NAME is supplied for which no alias has " +"been\n" +" defined." +msgstr "" + +#: builtins.c:276 +#, fuzzy +msgid "" +"Remove each NAME from the list of defined aliases.\n" +" \n" +" Options:\n" +" -a\tremove all alias definitions.\n" +" \n" +" Return success unless a NAME is not an existing alias." +msgstr "" +"Es treuen NOMs de la llista de les definicions d'?lies. Si s'especifica" + +#: builtins.c:289 +msgid "" +"Set Readline key bindings and variables.\n" +" \n" +" Bind a key sequence to a Readline function or a macro, or set a\n" +" Readline variable. The non-option argument syntax is equivalent to\n" +" that found in ~/.inputrc, but must be passed as a single argument:\n" +" e.g., bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Options:\n" +" -m keymap Use KEYMAP as the keymap for the duration of this\n" +" command. Acceptable keymap names are emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" +"move,\n" +" vi-command, and vi-insert.\n" +" -l List names of functions.\n" +" -P List function names and bindings.\n" +" -p List functions and bindings in a form that can be\n" +" reused as input.\n" +" -S List key sequences that invoke macros and their " +"values\n" +" -s List key sequences that invoke macros and their " +"values\n" +" in a form that can be reused as input.\n" +" -V List variable names and values\n" +" -v List variable names and values in a form that can\n" +" be reused as input.\n" +" -q function-name Query about which keys invoke the named function.\n" +" -u function-name Unbind all keys which are bound to the named " +"function.\n" +" -r keyseq Remove the binding for KEYSEQ.\n" +" -f filename Read key bindings from FILENAME.\n" +" -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when\n" +" \t\t\t\tKEYSEQ is entered.\n" +" -X\t\t List key sequences bound with -x and associated commands\n" +" in a form that can be reused as input.\n" +" \n" +" Exit Status:\n" +" bind returns 0 unless an unrecognized option is given or an error occurs." +msgstr "" + +#: builtins.c:328 +#, fuzzy +msgid "" +"Exit for, while, or until loops.\n" +" \n" +" Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n" +" loops.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "Repr?n la seg?ent iteraci? del bucle envoltant FOR, WHILE, o UNTIL." + +#: builtins.c:340 +#, fuzzy +msgid "" +"Resume for, while, or until loops.\n" +" \n" +" Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n" +" If N is specified, resumes the Nth enclosing loop.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "Repr?n la seg?ent iteraci? del bucle envoltant FOR, WHILE, o UNTIL." + +#: builtins.c:352 +msgid "" +"Execute shell builtins.\n" +" \n" +" Execute SHELL-BUILTIN with arguments ARGs without performing command\n" +" lookup. This is useful when you wish to reimplement a shell builtin\n" +" as a shell function, but need to execute the builtin within the " +"function.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n" +" not a shell builtin.." +msgstr "" + +#: builtins.c:367 +msgid "" +"Return the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns \"$line $filename\". With EXPR, returns\n" +" \"$line $subroutine $filename\"; this extra information can be used to\n" +" provide a stack trace.\n" +" \n" +" The value of EXPR indicates how many call frames to go back before the\n" +" current one; the top frame is frame 0.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless the shell is not executing a shell function or EXPR\n" +" is invalid." +msgstr "" + +#: builtins.c:385 +msgid "" +"Change the shell working directory.\n" +" \n" +" Change the current directory to DIR. The default DIR is the value of " +"the\n" +" HOME shell variable.\n" +" \n" +" The variable CDPATH defines the search path for the directory " +"containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon " +"(:).\n" +" A null directory name is the same as the current directory. If DIR " +"begins\n" +" with a slash (/), then CDPATH is not used.\n" +" \n" +" If the directory is not found, and the shell option `cdable_vars' is " +"set,\n" +" the word is assumed to be a variable name. If that variable has a " +"value,\n" +" its value is used for DIR.\n" +" \n" +" Options:\n" +" -L\tforce symbolic links to be followed: resolve symbolic links in\n" +" \tDIR after processing instances of `..'\n" +" -P\tuse the physical directory structure without following symbolic\n" +" \tlinks: resolve symbolic links in DIR before processing instances\n" +" \tof `..'\n" +" -e\tif the -P option is supplied, and the current working directory\n" +" \tcannot be determined successfully, exit with a non-zero status\n" +" -@ on systems that support it, present a file with extended " +"attributes\n" +" as a directory containing the file attributes\n" +" \n" +" The default is to follow symbolic links, as if `-L' were specified.\n" +" `..' is processed by removing the immediately previous pathname " +"component\n" +" back to a slash or the beginning of DIR.\n" +" \n" +" Exit Status:\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully " +"when\n" +" -P is used; non-zero otherwise." +msgstr "" + +#: builtins.c:422 +msgid "" +"Print the name of the current working directory.\n" +" \n" +" Options:\n" +" -L\tprint the value of $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tprint the physical directory, without any symbolic links\n" +" \n" +" By default, `pwd' behaves as if `-L' were specified.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless an invalid option is given or the current directory\n" +" cannot be read." +msgstr "" + +#: builtins.c:439 +#, fuzzy +msgid "" +"Null command.\n" +" \n" +" No effect; the command does nothing.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "Cap efecte; no es fa res. Es retorna amb el codi zero com a eixida." + +#: builtins.c:450 +msgid "" +"Return a successful result.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" + +#: builtins.c:459 +msgid "" +"Return an unsuccessful result.\n" +" \n" +" Exit Status:\n" +" Always fails." +msgstr "" + +#: builtins.c:468 +msgid "" +"Execute a simple command or display information about commands.\n" +" \n" +" Runs COMMAND with ARGS suppressing shell function lookup, or display\n" +" information about the specified COMMANDs. Can be used to invoke " +"commands\n" +" on disk when a function with the same name exists.\n" +" \n" +" Options:\n" +" -p\tuse a default value for PATH that is guaranteed to find all of\n" +" \tthe standard utilities\n" +" -v\tprint a description of COMMAND similar to the `type' builtin\n" +" -V\tprint a more verbose description of each COMMAND\n" +" \n" +" Exit Status:\n" +" Returns exit status of COMMAND, or failure if COMMAND is not found." +msgstr "" + +#: builtins.c:487 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Declare variables and give them attributes. If no NAMEs are given,\n" +" display the attributes and values of all variables.\n" +" \n" +" Options:\n" +" -f\trestrict action or display to function names and definitions\n" +" -F\trestrict display to function names only (plus line number and\n" +" \tsource file when debugging)\n" +" -g\tcreate global variables when used in a shell function; otherwise\n" +" \tignored\n" +" -p\tdisplay the attributes and value of each NAME\n" +" \n" +" Options which set attributes:\n" +" -a\tto make NAMEs indexed arrays (if supported)\n" +" -A\tto make NAMEs associative arrays (if supported)\n" +" -i\tto make NAMEs have the `integer' attribute\n" +" -l\tto convert NAMEs to lower case on assignment\n" +" -n\tmake NAME a reference to the variable named by its value\n" +" -r\tto make NAMEs readonly\n" +" -t\tto make NAMEs have the `trace' attribute\n" +" -u\tto convert NAMEs to upper case on assignment\n" +" -x\tto make NAMEs export\n" +" \n" +" Using `+' instead of `-' turns off the given attribute.\n" +" \n" +" Variables with the integer attribute have arithmetic evaluation (see\n" +" the `let' command) performed when the variable is assigned a value.\n" +" \n" +" When used in a function, `declare' makes NAMEs local, as with the " +"`local'\n" +" command. The `-g' option suppresses this behavior.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or a variable\n" +" assignment error occurs." +msgstr "" + +#: builtins.c:527 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Obsolete. See `help declare'." +msgstr "" + +#: builtins.c:535 +msgid "" +"Define local variables.\n" +" \n" +" Create a local variable called NAME, and give it VALUE. OPTION can\n" +" be any option accepted by `declare'.\n" +" \n" +" Local variables can only be used within a function; they are visible\n" +" only to the function where they are defined and its children.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied, a variable\n" +" assignment error occurs, or the shell is not executing a function." +msgstr "" + +#: builtins.c:552 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs, separated by a single space character and followed by " +"a\n" +" newline, on the standard output.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" -e\tenable interpretation of the following backslash escapes\n" +" -E\texplicitly suppress interpretation of backslash escapes\n" +" \n" +" `echo' interprets the following backslash-escaped characters:\n" +" \\a\talert (bell)\n" +" \\b\tbackspace\n" +" \\c\tsuppress further output\n" +" \\e\tescape character\n" +" \\E\tescape character\n" +" \\f\tform feed\n" +" \\n\tnew line\n" +" \\r\tcarriage return\n" +" \\t\thorizontal tab\n" +" \\v\tvertical tab\n" +" \\\\\tbackslash\n" +" \\0nnn\tthe character whose ASCII code is NNN (octal). NNN can be\n" +" \t0 to 3 octal digits\n" +" \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" +" \tcan be one or two hex digits\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" + +#: builtins.c:588 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs on the standard output followed by a newline.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" + +#: builtins.c:603 +msgid "" +"Enable and disable shell builtins.\n" +" \n" +" Enables and disables builtin shell commands. Disabling allows you to\n" +" execute a disk command which has the same name as a shell builtin\n" +" without using a full pathname.\n" +" \n" +" Options:\n" +" -a\tprint a list of builtins showing whether or not each is enabled\n" +" -n\tdisable each NAME or display a list of disabled builtins\n" +" -p\tprint the list of builtins in a reusable format\n" +" -s\tprint only the names of Posix `special' builtins\n" +" \n" +" Options controlling dynamic loading:\n" +" -f\tLoad builtin NAME from shared object FILENAME\n" +" -d\tRemove a builtin loaded with -f\n" +" \n" +" Without options, each NAME is enabled.\n" +" \n" +" To use the `test' found in $PATH instead of the shell builtin\n" +" version, type `enable -n test'.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not a shell builtin or an error occurs." +msgstr "" + +#: builtins.c:631 +msgid "" +"Execute arguments as a shell command.\n" +" \n" +" Combine ARGs into a single string, use the result as input to the " +"shell,\n" +" and execute the resulting commands.\n" +" \n" +" Exit Status:\n" +" Returns exit status of command or success if command is null." +msgstr "" + +#: builtins.c:643 +msgid "" +"Parse option arguments.\n" +" \n" +" Getopts is used by shell procedures to parse positional parameters\n" +" as options.\n" +" \n" +" OPTSTRING contains the option letters to be recognized; if a letter\n" +" is followed by a colon, the option is expected to have an argument,\n" +" which should be separated from it by white space.\n" +" \n" +" Each time it is invoked, getopts will place the next option in the\n" +" shell variable $name, initializing name if it does not exist, and\n" +" the index of the next argument to be processed into the shell\n" +" variable OPTIND. OPTIND is initialized to 1 each time the shell or\n" +" a shell script is invoked. When an option requires an argument,\n" +" getopts places that argument into the shell variable OPTARG.\n" +" \n" +" getopts reports errors in one of two ways. If the first character\n" +" of OPTSTRING is a colon, getopts uses silent error reporting. In\n" +" this mode, no error messages are printed. If an invalid option is\n" +" seen, getopts places the option character found into OPTARG. If a\n" +" required argument is not found, getopts places a ':' into NAME and\n" +" sets OPTARG to the option character found. If getopts is not in\n" +" silent mode, and an invalid option is seen, getopts places '?' into\n" +" NAME and unsets OPTARG. If a required argument is not found, a '?'\n" +" is placed in NAME, OPTARG is unset, and a diagnostic message is\n" +" printed.\n" +" \n" +" If the shell variable OPTERR has the value 0, getopts disables the\n" +" printing of error messages, even if the first character of\n" +" OPTSTRING is not a colon. OPTERR has the value 1 by default.\n" +" \n" +" Getopts normally parses the positional parameters ($0 - $9), but if\n" +" more arguments are given, they are parsed instead.\n" +" \n" +" Exit Status:\n" +" Returns success if an option is found; fails if the end of options is\n" +" encountered or an error occurs." +msgstr "" + +#: builtins.c:685 +msgid "" +"Replace the shell with the given command.\n" +" \n" +" Execute COMMAND, replacing this shell with the specified program.\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not " +"specified,\n" +" any redirections take effect in the current shell.\n" +" \n" +" Options:\n" +" -a name\tpass NAME as the zeroth argument to COMMAND\n" +" -c\t\texecute COMMAND with an empty environment\n" +" -l\t\tplace a dash in the zeroth argument to COMMAND\n" +" \n" +" If the command cannot be executed, a non-interactive shell exits, " +"unless\n" +" the shell option `execfail' is set.\n" +" \n" +" Exit Status:\n" +" Returns success unless COMMAND is not found or a redirection error " +"occurs." +msgstr "" + +#: builtins.c:706 +#, fuzzy +msgid "" +"Exit the shell.\n" +" \n" +" Exits the shell with a status of N. If N is omitted, the exit status\n" +" is that of the last command executed." +msgstr "Finalitza l'int?rpret d'ordres amb l'estat d'N. Si s'ometeix N," + +#: builtins.c:715 +msgid "" +"Exit a login shell.\n" +" \n" +" Exits a login shell with exit status N. Returns an error if not " +"executed\n" +" in a login shell." +msgstr "" + +#: builtins.c:725 +msgid "" +"Display or execute commands from the history list.\n" +" \n" +" fc is used to list or edit and re-execute commands from the history " +"list.\n" +" FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" +" string, which means the most recent command beginning with that\n" +" string.\n" +" \n" +" Options:\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then " +"EDITOR,\n" +" \t\tthen vi\n" +" -l \tlist lines instead of editing\n" +" -n\tomit line numbers when listing\n" +" -r\treverse the order of the lines (newest listed first)\n" +" \n" +" With the `fc -s [pat=rep ...] [command]' format, COMMAND is\n" +" re-executed after the substitution OLD=NEW is performed.\n" +" \n" +" A useful alias to use with this is r='fc -s', so that typing `r cc'\n" +" runs the last command beginning with `cc' and typing `r' re-executes\n" +" the last command.\n" +" \n" +" Exit Status:\n" +" Returns success or status of executed command; non-zero if an error " +"occurs." +msgstr "" + +#: builtins.c:755 +#, fuzzy +msgid "" +"Move job to the foreground.\n" +" \n" +" Place the job identified by JOB_SPEC in the foreground, making it the\n" +" current job. If JOB_SPEC is not present, the shell's notion of the\n" +" current job is used.\n" +" \n" +" Exit Status:\n" +" Status of command placed in foreground, or failure if an error occurs." +msgstr "Ubica la ID_TASCA en primer pla, i l'activa com a la tasca actual." + +#: builtins.c:770 +msgid "" +"Move jobs to the background.\n" +" \n" +" Place the jobs identified by each JOB_SPEC in the background, as if " +"they\n" +" had been started with `&'. If JOB_SPEC is not present, the shell's " +"notion\n" +" of the current job is used.\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" + +#: builtins.c:784 +msgid "" +"Remember or display program locations.\n" +" \n" +" Determine and remember the full pathname of each command NAME. If\n" +" no arguments are given, information about remembered commands is " +"displayed.\n" +" \n" +" Options:\n" +" -d\t\tforget the remembered location of each NAME\n" +" -l\t\tdisplay in a format that may be reused as input\n" +" -p pathname\tuse PATHNAME as the full pathname of NAME\n" +" -r\t\tforget all remembered locations\n" +" -t\t\tprint the remembered location of each NAME, preceding\n" +" \t\teach location with the corresponding NAME if multiple\n" +" \t\tNAMEs are given\n" +" Arguments:\n" +" NAME\t\tEach NAME is searched for in $PATH and added to the list\n" +" \t\tof remembered commands.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not found or an invalid option is given." +msgstr "" + +#: builtins.c:809 +msgid "" +"Display information about builtin commands.\n" +" \n" +" Displays brief summaries of builtin commands. If PATTERN is\n" +" specified, gives detailed help on all commands matching PATTERN,\n" +" otherwise the list of help topics is printed.\n" +" \n" +" Options:\n" +" -d\toutput short description for each topic\n" +" -m\tdisplay usage in pseudo-manpage format\n" +" -s\toutput only a short usage synopsis for each topic matching\n" +" \tPATTERN\n" +" \n" +" Arguments:\n" +" PATTERN\tPattern specifiying a help topic\n" +" \n" +" Exit Status:\n" +" Returns success unless PATTERN is not found or an invalid option is " +"given." +msgstr "" + +#: builtins.c:833 +msgid "" +"Display or manipulate the history list.\n" +" \n" +" Display the history list with line numbers, prefixing each modified\n" +" entry with a `*'. An argument of N lists only the last N entries.\n" +" \n" +" Options:\n" +" -c\tclear the history list by deleting all of the entries\n" +" -d offset\tdelete the history entry at offset OFFSET.\n" +" \n" +" -a\tappend history lines from this session to the history file\n" +" -n\tread all history lines not already read from the history file\n" +" -r\tread the history file and append the contents to the history\n" +" \tlist\n" +" -w\twrite the current history to the history file\n" +" \tand append them to the history list\n" +" \n" +" -p\tperform history expansion on each ARG and display the result\n" +" \twithout storing it in the history list\n" +" -s\tappend the ARGs to the history list as a single entry\n" +" \n" +" If FILENAME is given, it is used as the history file. Otherwise,\n" +" if $HISTFILE has a value, that is used, else ~/.bash_history.\n" +" \n" +" If the $HISTTIMEFORMAT variable is set and not null, its value is used\n" +" as a format string for strftime(3) to print the time stamp associated\n" +" with each displayed history entry. No time stamps are printed " +"otherwise.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" + +#: builtins.c:869 +msgid "" +"Display status of jobs.\n" +" \n" +" Lists the active jobs. JOBSPEC restricts output to that job.\n" +" Without options, the status of all active jobs is displayed.\n" +" \n" +" Options:\n" +" -l\tlists process IDs in addition to the normal information\n" +" -n\tlists only processes that have changed status since the last\n" +" \tnotification\n" +" -p\tlists process IDs only\n" +" -r\trestrict output to running jobs\n" +" -s\trestrict output to stopped jobs\n" +" \n" +" If -x is supplied, COMMAND is run after all job specifications that\n" +" appear in ARGS have been replaced with the process ID of that job's\n" +" process group leader.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs.\n" +" If -x is used, returns the exit status of COMMAND." +msgstr "" + +#: builtins.c:896 +msgid "" +"Remove jobs from current shell.\n" +" \n" +" Removes each JOBSPEC argument from the table of active jobs. Without\n" +" any JOBSPECs, the shell uses its notion of the current job.\n" +" \n" +" Options:\n" +" -a\tremove all jobs if JOBSPEC is not supplied\n" +" -h\tmark each JOBSPEC so that SIGHUP is not sent to the job if the\n" +" \tshell receives a SIGHUP\n" +" -r\tremove only running jobs\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option or JOBSPEC is given." +msgstr "" + +#: builtins.c:915 +msgid "" +"Send a signal to a job.\n" +" \n" +" Send the processes identified by PID or JOBSPEC the signal named by\n" +" SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n" +" SIGTERM is assumed.\n" +" \n" +" Options:\n" +" -s sig\tSIG is a signal name\n" +" -n sig\tSIG is a signal number\n" +" -l\tlist the signal names; if arguments follow `-l' they are\n" +" \tassumed to be signal numbers for which names should be listed\n" +" \n" +" Kill is a shell builtin for two reasons: it allows job IDs to be used\n" +" instead of process IDs, and allows processes to be killed if the limit\n" +" on processes that you can create is reached.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" + +#: builtins.c:938 +msgid "" +"Evaluate arithmetic expressions.\n" +" \n" +" Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" +" fixed-width integers with no check for overflow, though division by 0\n" +" is trapped and flagged as an error. The following list of operators is\n" +" grouped into levels of equal-precedence operators. The levels are " +"listed\n" +" in order of decreasing precedence.\n" +" \n" +" \tid++, id--\tvariable post-increment, post-decrement\n" +" \t++id, --id\tvariable pre-increment, pre-decrement\n" +" \t-, +\t\tunary minus, plus\n" +" \t!, ~\t\tlogical and bitwise negation\n" +" \t**\t\texponentiation\n" +" \t*, /, %\t\tmultiplication, division, remainder\n" +" \t+, -\t\taddition, subtraction\n" +" \t<<, >>\t\tleft and right bitwise shifts\n" +" \t<=, >=, <, >\tcomparison\n" +" \t==, !=\t\tequality, inequality\n" +" \t&\t\tbitwise AND\n" +" \t^\t\tbitwise XOR\n" +" \t|\t\tbitwise OR\n" +" \t&&\t\tlogical AND\n" +" \t||\t\tlogical OR\n" +" \texpr ? expr : expr\n" +" \t\t\tconditional operator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tassignment\n" +" \n" +" Shell variables are allowed as operands. The name of the variable\n" +" is replaced by its value (coerced to a fixed-width integer) within\n" +" an expression. The variable need not have its integer attribute\n" +" turned on to be used in an expression.\n" +" \n" +" Operators are evaluated in order of precedence. Sub-expressions in\n" +" parentheses are evaluated first and may override the precedence\n" +" rules above.\n" +" \n" +" Exit Status:\n" +" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." +msgstr "" + +#: builtins.c:983 +msgid "" +"Read a line from the standard input and split it into fields.\n" +" \n" +" Reads a single line from the standard input, or from file descriptor FD\n" +" if the -u option is supplied. The line is split into fields as with " +"word\n" +" splitting, and the first word is assigned to the first NAME, the second\n" +" word to the second NAME, and so on, with any leftover words assigned to\n" +" the last NAME. Only the characters found in $IFS are recognized as " +"word\n" +" delimiters.\n" +" \n" +" If no NAMEs are supplied, the line read is stored in the REPLY " +"variable.\n" +" \n" +" Options:\n" +" -a array\tassign the words read to sequential indices of the array\n" +" \t\tvariable ARRAY, starting at zero\n" +" -d delim\tcontinue until the first character of DELIM is read, rather\n" +" \t\tthan newline\n" +" -e\t\tuse Readline to obtain the line in an interactive shell\n" +" -i text\tUse TEXT as the initial text for Readline\n" +" -n nchars\treturn after reading NCHARS characters rather than waiting\n" +" \t\tfor a newline, but honor a delimiter if fewer than NCHARS\n" +" \t\tcharacters are read before the delimiter\n" +" -N nchars\treturn only after reading exactly NCHARS characters, " +"unless\n" +" \t\tEOF is encountered or read times out, ignoring any delimiter\n" +" -p prompt\toutput the string PROMPT without a trailing newline before\n" +" \t\tattempting to read\n" +" -r\t\tdo not allow backslashes to escape any characters\n" +" -s\t\tdo not echo input coming from a terminal\n" +" -t timeout\ttime out and return failure if a complete line of input " +"is\n" +" \t\tnot read within TIMEOUT seconds. The value of the TMOUT\n" +" \t\tvariable is the default timeout. TIMEOUT may be a\n" +" \t\tfractional number. If TIMEOUT is 0, read returns immediately,\n" +" \t\twithout trying to read any data, returning success only if\n" +" \t\tinput is available on the specified file descriptor. The\n" +" \t\texit status is greater than 128 if the timeout is exceeded\n" +" -u fd\t\tread from file descriptor FD instead of the standard input\n" +" \n" +" Exit Status:\n" +" The return code is zero, unless end-of-file is encountered, read times " +"out\n" +" (in which case it's greater than 128), a variable assignment error " +"occurs,\n" +" or an invalid file descriptor is supplied as the argument to -u." +msgstr "" + +#: builtins.c:1028 +msgid "" +"Return from a shell function.\n" +" \n" +" Causes a function or sourced script to exit with the return value\n" +" specified by N. If N is omitted, the return status is that of the\n" +" last command executed within the function or script.\n" +" \n" +" Exit Status:\n" +" Returns N, or failure if the shell is not executing a function or script." +msgstr "" + +#: builtins.c:1041 +msgid "" +"Set or unset values of shell options and positional parameters.\n" +" \n" +" Change the value of shell attributes and positional parameters, or\n" +" display the names and values of shell variables.\n" +" \n" +" Options:\n" +" -a Mark variables which are modified or created for export.\n" +" -b Notify of job termination immediately.\n" +" -e Exit immediately if a command exits with a non-zero status.\n" +" -f Disable file name generation (globbing).\n" +" -h Remember the location of commands as they are looked up.\n" +" -k All assignment arguments are placed in the environment for a\n" +" command, not just those that precede the command name.\n" +" -m Job control is enabled.\n" +" -n Read commands but do not execute them.\n" +" -o option-name\n" +" Set the variable corresponding to option-name:\n" +" allexport same as -a\n" +" braceexpand same as -B\n" +" emacs use an emacs-style line editing interface\n" +" errexit same as -e\n" +" errtrace same as -E\n" +" functrace same as -T\n" +" hashall same as -h\n" +" histexpand same as -H\n" +" history enable command history\n" +" ignoreeof the shell will not exit upon reading EOF\n" +" interactive-comments\n" +" allow comments to appear in interactive commands\n" +" keyword same as -k\n" +" monitor same as -m\n" +" noclobber same as -C\n" +" noexec same as -n\n" +" noglob same as -f\n" +" nolog currently accepted but ignored\n" +" notify same as -b\n" +" nounset same as -u\n" +" onecmd same as -t\n" +" physical same as -P\n" +" pipefail the return value of a pipeline is the status of\n" +" the last command to exit with a non-zero status,\n" +" or zero if no command exited with a non-zero " +"status\n" +" posix change the behavior of bash where the default\n" +" operation differs from the Posix standard to\n" +" match the standard\n" +" privileged same as -p\n" +" verbose same as -v\n" +" vi use a vi-style line editing interface\n" +" xtrace same as -x\n" +" -p Turned on whenever the real and effective user ids do not match.\n" +" Disables processing of the $ENV file and importing of shell\n" +" functions. Turning this option off causes the effective uid and\n" +" gid to be set to the real uid and gid.\n" +" -t Exit after reading and executing one command.\n" +" -u Treat unset variables as an error when substituting.\n" +" -v Print shell input lines as they are read.\n" +" -x Print commands and their arguments as they are executed.\n" +" -B the shell will perform brace expansion\n" +" -C If set, disallow existing regular files to be overwritten\n" +" by redirection of output.\n" +" -E If set, the ERR trap is inherited by shell functions.\n" +" -H Enable ! style history substitution. This flag is on\n" +" by default when the shell is interactive.\n" +" -P If set, do not resolve symbolic links when executing commands\n" +" such as cd which change the current directory.\n" +" -T If set, the DEBUG trap is inherited by shell functions.\n" +" -- Assign any remaining arguments to the positional parameters.\n" +" If there are no remaining arguments, the positional parameters\n" +" are unset.\n" +" - Assign any remaining arguments to the positional parameters.\n" +" The -x and -v options are turned off.\n" +" \n" +" Using + rather than - causes these flags to be turned off. The\n" +" flags can also be used upon invocation of the shell. The current\n" +" set of flags may be found in $-. The remaining n ARGs are positional\n" +" parameters and are assigned, in order, to $1, $2, .. $n. If no\n" +" ARGs are given, all shell variables are printed.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given." +msgstr "" + +#: builtins.c:1126 +msgid "" +"Unset values and attributes of shell variables and functions.\n" +" \n" +" For each NAME, remove the corresponding variable or function.\n" +" \n" +" Options:\n" +" -f\ttreat each NAME as a shell function\n" +" -v\ttreat each NAME as a shell variable\n" +" -n\ttreat each NAME as a name reference and unset the variable itself\n" +" \trather than the variable it references\n" +" \n" +" Without options, unset first tries to unset a variable, and if that " +"fails,\n" +" tries to unset a function.\n" +" \n" +" Some variables cannot be unset; also see `readonly'.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a NAME is read-only." +msgstr "" + +#: builtins.c:1148 +msgid "" +"Set export attribute for shell variables.\n" +" \n" +" Marks each NAME for automatic export to the environment of subsequently\n" +" executed commands. If VALUE is supplied, assign VALUE before " +"exporting.\n" +" \n" +" Options:\n" +" -f\trefer to shell functions\n" +" -n\tremove the export property from each NAME\n" +" -p\tdisplay a list of all exported variables and functions\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" + +#: builtins.c:1167 +msgid "" +"Mark shell variables as unchangeable.\n" +" \n" +" Mark each NAME as read-only; the values of these NAMEs may not be\n" +" changed by subsequent assignment. If VALUE is supplied, assign VALUE\n" +" before marking as read-only.\n" +" \n" +" Options:\n" +" -a\trefer to indexed array variables\n" +" -A\trefer to associative array variables\n" +" -f\trefer to shell functions\n" +" -p\tdisplay a list of all readonly variables or functions, depending " +"on\n" +" whether or not the -f option is given\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" + +#: builtins.c:1189 +msgid "" +"Shift positional parameters.\n" +" \n" +" Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n" +" not given, it is assumed to be 1.\n" +" \n" +" Exit Status:\n" +" Returns success unless N is negative or greater than $#." +msgstr "" + +#: builtins.c:1201 builtins.c:1216 +msgid "" +"Execute commands from a file in the current shell.\n" +" \n" +" Read and execute commands from FILENAME in the current shell. The\n" +" entries in $PATH are used to find the directory containing FILENAME.\n" +" If any ARGUMENTS are supplied, they become the positional parameters\n" +" when FILENAME is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed in FILENAME; fails if\n" +" FILENAME cannot be read." +msgstr "" + +#: builtins.c:1232 +msgid "" +"Suspend shell execution.\n" +" \n" +" Suspend the execution of this shell until it receives a SIGCONT signal.\n" +" Unless forced, login shells cannot be suspended.\n" +" \n" +" Options:\n" +" -f\tforce the suspend, even if the shell is a login shell\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" + +#: builtins.c:1248 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" Exits with a status of 0 (true) or 1 (false) depending on\n" +" the evaluation of EXPR. Expressions may be unary or binary. Unary\n" +" expressions are often used to examine the status of a file. There\n" +" are string operators and numeric comparison operators as well.\n" +" \n" +" The behavior of test depends on the number of arguments. Read the\n" +" bash manual page for the complete specification.\n" +" \n" +" File operators:\n" +" \n" +" -a FILE True if file exists.\n" +" -b FILE True if file is block special.\n" +" -c FILE True if file is character special.\n" +" -d FILE True if file is a directory.\n" +" -e FILE True if file exists.\n" +" -f FILE True if file exists and is a regular file.\n" +" -g FILE True if file is set-group-id.\n" +" -h FILE True if file is a symbolic link.\n" +" -L FILE True if file is a symbolic link.\n" +" -k FILE True if file has its `sticky' bit set.\n" +" -p FILE True if file is a named pipe.\n" +" -r FILE True if file is readable by you.\n" +" -s FILE True if file exists and is not empty.\n" +" -S FILE True if file is a socket.\n" +" -t FD True if FD is opened on a terminal.\n" +" -u FILE True if the file is set-user-id.\n" +" -w FILE True if the file is writable by you.\n" +" -x FILE True if the file is executable by you.\n" +" -O FILE True if the file is effectively owned by you.\n" +" -G FILE True if the file is effectively owned by your group.\n" +" -N FILE True if the file has been modified since it was last " +"read.\n" +" \n" +" FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" +" modification date).\n" +" \n" +" FILE1 -ot FILE2 True if file1 is older than file2.\n" +" \n" +" FILE1 -ef FILE2 True if file1 is a hard link to file2.\n" +" \n" +" String operators:\n" +" \n" +" -z STRING True if string is empty.\n" +" \n" +" -n STRING\n" +" STRING True if string is not empty.\n" +" \n" +" STRING1 = STRING2\n" +" True if the strings are equal.\n" +" STRING1 != STRING2\n" +" True if the strings are not equal.\n" +" STRING1 < STRING2\n" +" True if STRING1 sorts before STRING2 " +"lexicographically.\n" +" STRING1 > STRING2\n" +" True if STRING1 sorts after STRING2 lexicographically.\n" +" \n" +" Other operators:\n" +" \n" +" -o OPTION True if the shell option OPTION is enabled.\n" +" -v VAR\t True if the shell variable VAR is set\n" +" -R VAR\t True if the shell variable VAR is set and is a name " +"reference.\n" +" ! EXPR True if expr is false.\n" +" EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n" +" EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n" +" \n" +" arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Arithmetic binary operators return true if ARG1 is equal, not-equal,\n" +" less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n" +" than ARG2.\n" +" \n" +" Exit Status:\n" +" Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n" +" false or an invalid argument is given." +msgstr "" + +#: builtins.c:1329 +#, fuzzy +msgid "" +"Evaluate conditional expression.\n" +" \n" +" This is a synonym for the \"test\" builtin, but the last argument must\n" +" be a literal `]', to match the opening `['." +msgstr "" +"par?metre ha de ser el signe \"]\" perqu? es puga tancar l'expressi? que\n" +"comen?a pel signe \"[\"." + +#: builtins.c:1338 +msgid "" +"Display process times.\n" +" \n" +" Prints the accumulated user and system times for the shell and all of " +"its\n" +" child processes.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" + +#: builtins.c:1350 +msgid "" +"Trap signals and other events.\n" +" \n" +" Defines and activates handlers to be run when the shell receives " +"signals\n" +" or other conditions.\n" +" \n" +" ARG is a command to be read and executed when the shell receives the\n" +" signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n" +" is supplied) or `-', each specified signal is reset to its original\n" +" value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" +" shell and by the commands it invokes.\n" +" \n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. " +"If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. " +"If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or " +"a\n" +" script run by the . or source builtins finishes executing. A " +"SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause " +"the\n" +" shell to exit when the -e option is enabled.\n" +" \n" +" If no arguments are supplied, trap prints the list of commands " +"associated\n" +" with each signal.\n" +" \n" +" Options:\n" +" -l\tprint a list of signal names and their corresponding numbers\n" +" -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" +" \n" +" Each SIGNAL_SPEC is either a signal name in or a signal " +"number.\n" +" Signal names are case insensitive and the SIG prefix is optional. A\n" +" signal may be sent to the shell with \"kill -signal $$\".\n" +" \n" +" Exit Status:\n" +" Returns success unless a SIGSPEC is invalid or an invalid option is " +"given." +msgstr "" + +#: builtins.c:1386 +msgid "" +"Display information about command type.\n" +" \n" +" For each NAME, indicate how it would be interpreted if used as a\n" +" command name.\n" +" \n" +" Options:\n" +" -a\tdisplay all locations containing an executable named NAME;\n" +" \tincludes aliases, builtins, and functions, if and only if\n" +" \tthe `-p' option is not also used\n" +" -f\tsuppress shell function lookup\n" +" -P\tforce a PATH search for each NAME, even if it is an alias,\n" +" \tbuiltin, or function, and returns the name of the disk file\n" +" \tthat would be executed\n" +" -p\treturns either the name of the disk file that would be executed,\n" +" \tor nothing if `type -t NAME' would not return `file'.\n" +" -t\toutput a single word which is one of `alias', `keyword',\n" +" \t`function', `builtin', `file' or `', if NAME is an alias, shell\n" +" \treserved word, shell function, shell builtin, disk file, or not\n" +" \tfound, respectively\n" +" \n" +" Arguments:\n" +" NAME\tCommand name to be interpreted.\n" +" \n" +" Exit Status:\n" +" Returns success if all of the NAMEs are found; fails if any are not " +"found." +msgstr "" + +#: builtins.c:1417 +msgid "" +"Modify shell resource limits.\n" +" \n" +" Provides control over the resources available to the shell and " +"processes\n" +" it creates, on systems that allow such control.\n" +" \n" +" Options:\n" +" -S\tuse the `soft' resource limit\n" +" -H\tuse the `hard' resource limit\n" +" -a\tall current limits are reported\n" +" -b\tthe socket buffer size\n" +" -c\tthe maximum size of core files created\n" +" -d\tthe maximum size of a process's data segment\n" +" -e\tthe maximum scheduling priority (`nice')\n" +" -f\tthe maximum size of files written by the shell and its children\n" +" -i\tthe maximum number of pending signals\n" +" -l\tthe maximum size a process may lock into memory\n" +" -m\tthe maximum resident set size\n" +" -n\tthe maximum number of open file descriptors\n" +" -p\tthe pipe buffer size\n" +" -q\tthe maximum number of bytes in POSIX message queues\n" +" -r\tthe maximum real-time scheduling priority\n" +" -s\tthe maximum stack size\n" +" -t\tthe maximum amount of cpu time in seconds\n" +" -u\tthe maximum number of user processes\n" +" -v\tthe size of virtual memory\n" +" -x\tthe maximum number of file locks\n" +" -T the maximum number of threads\n" +" \n" +" Not all options are available on all platforms.\n" +" \n" +" If LIMIT is given, it is the new value of the specified resource; the\n" +" special LIMIT values `soft', `hard', and `unlimited' stand for the\n" +" current soft limit, the current hard limit, and no limit, respectively.\n" +" Otherwise, the current value of the specified resource is printed. If\n" +" no option is given, then -f is assumed.\n" +" \n" +" Values are in 1024-byte increments, except for -t, which is in seconds,\n" +" -p, which is in increments of 512 bytes, and -u, which is an unscaled\n" +" number of processes.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1465 +msgid "" +"Display or set file mode mask.\n" +" \n" +" Sets the user file-creation mask to MODE. If MODE is omitted, prints\n" +" the current value of the mask.\n" +" \n" +" If MODE begins with a digit, it is interpreted as an octal number;\n" +" otherwise it is a symbolic mode string like that accepted by chmod(1).\n" +" \n" +" Options:\n" +" -p\tif MODE is omitted, output in a form that may be reused as input\n" +" -S\tmakes the output symbolic; otherwise an octal number is output\n" +" \n" +" Exit Status:\n" +" Returns success unless MODE is invalid or an invalid option is given." +msgstr "" + +#: builtins.c:1485 +msgid "" +"Wait for job completion and return exit status.\n" +" \n" +" Waits for each process identified by an ID, which may be a process ID or " +"a\n" +" job specification, and reports its termination status. If ID is not\n" +" given, waits for all currently active child processes, and the return\n" +" status is zero. If ID is a a job specification, waits for all " +"processes\n" +" in that job's pipeline.\n" +" \n" +" If the -n option is supplied, waits for the next job to terminate and\n" +" returns its exit status.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last ID; fails if ID is invalid or an invalid\n" +" option is given." +msgstr "" + +#: builtins.c:1506 +msgid "" +"Wait for process completion and return exit status.\n" +" \n" +" Waits for each process specified by a PID and reports its termination " +"status.\n" +" If PID is not given, waits for all currently active child processes,\n" +" and the return status is zero. PID must be a process ID.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last PID; fails if PID is invalid or an " +"invalid\n" +" option is given." +msgstr "" + +#: builtins.c:1521 +msgid "" +"Execute commands for each member in a list.\n" +" \n" +" The `for' loop executes a sequence of commands for each member in a\n" +" list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is\n" +" assumed. For each element in WORDS, NAME is set to that element, and\n" +" the COMMANDS are executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1535 +msgid "" +"Arithmetic for loop.\n" +" \n" +" Equivalent to\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n" +" omitted, it behaves as if it evaluates to 1.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1553 +msgid "" +"Select words from a list and execute commands.\n" +" \n" +" The WORDS are expanded, generating a list of words. The\n" +" set of expanded words is printed on the standard error, each\n" +" preceded by a number. If `in WORDS' is not present, `in \"$@\"'\n" +" is assumed. The PS3 prompt is then displayed and a line read\n" +" from the standard input. If the line consists of the number\n" +" corresponding to one of the displayed words, then NAME is set\n" +" to that word. If the line is empty, WORDS and the prompt are\n" +" redisplayed. If EOF is read, the command completes. Any other\n" +" value read causes NAME to be set to null. The line read is saved\n" +" in the variable REPLY. COMMANDS are executed after each selection\n" +" until a break command is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1574 +msgid "" +"Report time consumed by pipeline's execution.\n" +" \n" +" Execute PIPELINE and print a summary of the real time, user CPU time,\n" +" and system CPU time spent executing PIPELINE when it terminates.\n" +" \n" +" Options:\n" +" -p\tprint the timing summary in the portable Posix format\n" +" \n" +" The value of the TIMEFORMAT variable is used as the output format.\n" +" \n" +" Exit Status:\n" +" The return status is the return status of PIPELINE." +msgstr "" + +#: builtins.c:1591 +#, fuzzy +msgid "" +"Execute commands based on pattern matching.\n" +" \n" +" Selectively execute COMMANDS based upon WORD matching PATTERN. The\n" +" `|' is used to separate multiple patterns.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "Executa selectivament les ordres especificades en ORDRES seguint una " + +#: builtins.c:1603 +msgid "" +"Execute commands based on conditional.\n" +" \n" +" The `if COMMANDS' list is executed. If its exit status is zero, then " +"the\n" +" `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list " +"is\n" +" executed in turn, and if its exit status is zero, the corresponding\n" +" `then COMMANDS' list is executed and the if command completes. " +"Otherwise,\n" +" the `else COMMANDS' list is executed, if present. The exit status of " +"the\n" +" entire construct is the exit status of the last command executed, or " +"zero\n" +" if no condition tested true.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1620 +#, fuzzy +msgid "" +"Execute commands as long as a test succeeds.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `while' COMMANDS has an exit status of zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Expandeix i executa les ordres especificades en ORDRES i els executa\n" +"de tal manera que la darrera ordre" + +#: builtins.c:1632 +#, fuzzy +msgid "" +"Execute commands as long as a test does not succeed.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `until' COMMANDS has an exit status which is not zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Expandeix i executa les ordres especificades en ORDRES i els executa\n" +"de tal manera que la darrera ordre" + +#: builtins.c:1644 +msgid "" +"Create a coprocess named NAME.\n" +" \n" +" Execute COMMAND asynchronously, with the standard output and standard\n" +" input of the command connected via a pipe to file descriptors assigned\n" +" to indices 0 and 1 of an array variable NAME in the executing shell.\n" +" The default NAME is \"COPROC\".\n" +" \n" +" Exit Status:\n" +" Returns the exit status of COMMAND." +msgstr "" + +#: builtins.c:1658 +msgid "" +"Define shell function.\n" +" \n" +" Create a shell function named NAME. When invoked as a simple command,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is " +"invoked,\n" +" the arguments are passed to the function as $1...$n, and the function's\n" +" name is in $FUNCNAME.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is readonly." +msgstr "" + +#: builtins.c:1672 +#, fuzzy +msgid "" +"Group commands as a unit.\n" +" \n" +" Run a set of commands in a group. This is one way to redirect an\n" +" entire set of commands.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "Executa un conjunt d'ordres en un grup. A?? ?s una manera de" + +#: builtins.c:1684 +msgid "" +"Resume job in foreground.\n" +" \n" +" Equivalent to the JOB_SPEC argument to the `fg' command. Resume a\n" +" stopped or background job. JOB_SPEC can specify either a job name\n" +" or a job number. Following JOB_SPEC with a `&' places the job in\n" +" the background, as if the job specification had been supplied as an\n" +" argument to `bg'.\n" +" \n" +" Exit Status:\n" +" Returns the status of the resumed job." +msgstr "" + +#: builtins.c:1699 +msgid "" +"Evaluate arithmetic expression.\n" +" \n" +" The EXPRESSION is evaluated according to the rules for arithmetic\n" +" evaluation. Equivalent to \"let EXPRESSION\".\n" +" \n" +" Exit Status:\n" +" Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise." +msgstr "" + +#: builtins.c:1711 +msgid "" +"Execute conditional command.\n" +" \n" +" Returns a status of 0 or 1 depending on the evaluation of the " +"conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries " +"used\n" +" by the `test' builtin, and may be combined using the following " +"operators:\n" +" \n" +" ( EXPRESSION )\tReturns the value of EXPRESSION\n" +" ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" +" EXPR1 && EXPR2\tTrue if both EXPR1 and EXPR2 are true; else false\n" +" EXPR1 || EXPR2\tTrue if either EXPR1 or EXPR2 is true; else false\n" +" \n" +" When the `==' and `!=' operators are used, the string to the right of\n" +" the operator is used as a pattern and pattern matching is performed.\n" +" When the `=~' operator is used, the string to the right of the operator\n" +" is matched as a regular expression.\n" +" \n" +" The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n" +" determine the expression's value.\n" +" \n" +" Exit Status:\n" +" 0 or 1 depending on value of EXPRESSION." +msgstr "" + +#: builtins.c:1737 +msgid "" +"Common shell variable names and usage.\n" +" \n" +" BASH_VERSION\tVersion information for this Bash.\n" +" CDPATH\tA colon-separated list of directories to search\n" +" \t\tfor directories given as arguments to `cd'.\n" +" GLOBIGNORE\tA colon-separated list of patterns describing filenames to\n" +" \t\tbe ignored by pathname expansion.\n" +" HISTFILE\tThe name of the file where your command history is stored.\n" +" HISTFILESIZE\tThe maximum number of lines this file can contain.\n" +" HISTSIZE\tThe maximum number of history lines that a running\n" +" \t\tshell can access.\n" +" HOME\tThe complete pathname to your login directory.\n" +" HOSTNAME\tThe name of the current host.\n" +" HOSTTYPE\tThe type of CPU this version of Bash is running under.\n" +" IGNOREEOF\tControls the action of the shell on receipt of an EOF\n" +" \t\tcharacter as the sole input. If set, then the value\n" +" \t\tof it is the number of EOF characters that can be seen\n" +" \t\tin a row on an empty line before the shell will exit\n" +" \t\t(default 10). When unset, EOF signifies the end of input.\n" +" MACHTYPE\tA string describing the current system Bash is running on.\n" +" MAILCHECK\tHow often, in seconds, Bash checks for new mail.\n" +" MAILPATH\tA colon-separated list of filenames which Bash checks\n" +" \t\tfor new mail.\n" +" OSTYPE\tThe version of Unix this version of Bash is running on.\n" +" PATH\tA colon-separated list of directories to search when\n" +" \t\tlooking for commands.\n" +" PROMPT_COMMAND\tA command to be executed before the printing of each\n" +" \t\tprimary prompt.\n" +" PS1\t\tThe primary prompt string.\n" +" PS2\t\tThe secondary prompt string.\n" +" PWD\t\tThe full pathname of the current directory.\n" +" SHELLOPTS\tA colon-separated list of enabled shell options.\n" +" TERM\tThe name of the current terminal type.\n" +" TIMEFORMAT\tThe output format for timing statistics displayed by the\n" +" \t\t`time' reserved word.\n" +" auto_resume\tNon-null means a command word appearing on a line by\n" +" \t\titself is first looked for in the list of currently\n" +" \t\tstopped jobs. If found there, that job is foregrounded.\n" +" \t\tA value of `exact' means that the command word must\n" +" \t\texactly match a command in the list of stopped jobs. A\n" +" \t\tvalue of `substring' means that the command word must\n" +" \t\tmatch a substring of the job. Any other value means that\n" +" \t\tthe command must be a prefix of a stopped job.\n" +" histchars\tCharacters controlling history expansion and quick\n" +" \t\tsubstitution. The first character is the history\n" +" \t\tsubstitution character, usually `!'. The second is\n" +" \t\tthe `quick substitution' character, usually `^'. The\n" +" \t\tthird is the `history comment' character, usually `#'.\n" +" HISTIGNORE\tA colon-separated list of patterns used to decide which\n" +" \t\tcommands should be saved on the history list.\n" +msgstr "" + +#: builtins.c:1794 +msgid "" +"Add directories to stack.\n" +" \n" +" Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" + +#: builtins.c:1828 +msgid "" +"Remove directories from stack.\n" +" \n" +" Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" + +#: builtins.c:1858 +msgid "" +"Display directory stack.\n" +" \n" +" Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1887 +msgid "" +"Set and unset shell options.\n" +" \n" +" Change the setting of each shell option OPTNAME. Without any option\n" +" arguments, list all shell options with an indication of whether or not " +"each\n" +" is set.\n" +" \n" +" Options:\n" +" -o\trestrict OPTNAMEs to those defined for use with `set -o'\n" +" -p\tprint each shell option with an indication of its status\n" +" -q\tsuppress output\n" +" -s\tenable (set) each OPTNAME\n" +" -u\tdisable (unset) each OPTNAME\n" +" \n" +" Exit Status:\n" +" Returns success if OPTNAME is enabled; fails if an invalid option is\n" +" given or OPTNAME is disabled." +msgstr "" + +#: builtins.c:1908 +msgid "" +"Formats and prints ARGUMENTS under control of the FORMAT.\n" +" \n" +" Options:\n" +" -v var\tassign the output to shell variable VAR rather than\n" +" \t\tdisplay it on the standard output\n" +" \n" +" FORMAT is a character string which contains three types of objects: " +"plain\n" +" characters, which are simply copied to standard output; character " +"escape\n" +" sequences, which are converted and copied to the standard output; and\n" +" format specifications, each of which causes printing of the next " +"successive\n" +" argument.\n" +" \n" +" In addition to the standard format specifications described in " +"printf(1),\n" +" printf interprets:\n" +" \n" +" %b\texpand backslash escape sequences in the corresponding argument\n" +" %q\tquote the argument in a way that can be reused as shell input\n" +" %(fmt)T output the date-time string resulting from using FMT as a " +"format\n" +" string for strftime(3)\n" +" \n" +" The format is re-used as necessary to consume all of the arguments. If\n" +" there are fewer arguments than the format requires, extra format\n" +" specifications behave as if a zero value or null string, as " +"appropriate,\n" +" had been supplied.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a write or " +"assignment\n" +" error occurs." +msgstr "" + +#: builtins.c:1942 +msgid "" +"Specify how arguments are to be completed by Readline.\n" +" \n" +" For each NAME, specify how arguments are to be completed. If no " +"options\n" +" are supplied, existing completion specifications are printed in a way " +"that\n" +" allows them to be reused as input.\n" +" \n" +" Options:\n" +" -p\tprint existing completion specifications in a reusable format\n" +" -r\tremove a completion specification for each NAME, or, if no\n" +" \tNAMEs are supplied, all completion specifications\n" +" -D\tapply the completions and actions as the default for commands\n" +" \twithout any specific completion defined\n" +" -E\tapply the completions and actions to \"empty\" commands --\n" +" \tcompletion attempted on a blank line\n" +" \n" +" When completion is attempted, the actions are applied in the order the\n" +" uppercase-letter options are listed above. The -D option takes\n" +" precedence over -E.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1970 +msgid "" +"Display possible completions depending on the options.\n" +" \n" +" Intended to be used from within a shell function generating possible\n" +" completions. If the optional WORD argument is supplied, matches " +"against\n" +" WORD are generated.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1985 +msgid "" +"Modify or display completion options.\n" +" \n" +" Modify the completion options for each NAME, or, if no NAMEs are " +"supplied,\n" +" the completion currently being executed. If no OPTIONs are given, " +"print\n" +" the completion options for each NAME or the current completion " +"specification.\n" +" \n" +" Options:\n" +" \t-o option\tSet completion option OPTION for each NAME\n" +" \t-D\t\tChange options for the \"default\" command completion\n" +" \t-E\t\tChange options for the \"empty\" command completion\n" +" \n" +" Using `+o' instead of `-o' turns off the specified option.\n" +" \n" +" Arguments:\n" +" \n" +" Each NAME refers to a command for which a completion specification must\n" +" have previously been defined using the `complete' builtin. If no NAMEs\n" +" are supplied, compopt must be called by a function currently generating\n" +" completions, and the options for that currently-executing completion\n" +" generator are modified.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or NAME does not\n" +" have a completion specification defined." +msgstr "" + +#: builtins.c:2015 +msgid "" +"Read lines from the standard input into an indexed array variable.\n" +" \n" +" Read lines from the standard input into the indexed array variable " +"ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable " +"MAPFILE\n" +" is the default ARRAY.\n" +" \n" +" Options:\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are " +"copied.\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default " +"index is 0.\n" +" -s count \tDiscard the first COUNT lines read.\n" +" -t\t\tRemove a trailing newline from each line read.\n" +" -u fd\t\tRead lines from file descriptor FD instead of the standard " +"input.\n" +" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read.\n" +" -c quantum\tSpecify the number of lines read between each call to " +"CALLBACK.\n" +" \n" +" Arguments:\n" +" ARRAY\t\tArray variable name to use for file data.\n" +" \n" +" If -C is supplied without -c, the default quantum is 5000. When\n" +" CALLBACK is evaluated, it is supplied the index of the next array\n" +" element to be assigned and the line to be assigned to that element\n" +" as additional arguments.\n" +" \n" +" If not supplied with an explicit origin, mapfile will clear ARRAY " +"before\n" +" assigning to it.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or ARRAY is readonly " +"or\n" +" not an indexed array." +msgstr "" + +#: builtins.c:2049 +msgid "" +"Read lines from a file into an array variable.\n" +" \n" +" A synonym for `mapfile'." +msgstr "" + +#, fuzzy +#~ msgid "wait [pid]" +#~ msgstr "wait [n]" + +#~ msgid "xrealloc: cannot reallocate %lu bytes (%lu bytes allocated)" +#~ msgstr "" +#~ "xrealloc: no es poden reassignar %lu octets (%lu octets reassignats)" + +#, fuzzy +#~ msgid "xrealloc: cannot allocate %lu bytes" +#~ msgstr "" +#~ "xrealloc: no es poden reassignar %lu octets (%lu octets reassignats)" + +#, fuzzy +#~ msgid "xrealloc: %s:%d: cannot reallocate %lu bytes (%lu bytes allocated)" +#~ msgstr "" +#~ "xrealloc: no es poden reassignar %lu octets (%lu octets reassignats)" + +#~ msgid "Display the list of currently remembered directories. Directories" +#~ msgstr "" +#~ "Mostra la llista dels directoris actualment recordats. Els directoris " + +#~ msgid "find their way onto the list with the `pushd' command; you can get" +#~ msgstr "troben el seu cam? en la llista amb l'ordre ?pushd?; podeu anar cap" + +#~ msgid "back up through the list with the `popd' command." +#~ msgstr "endarrere a trav?s de la llista amb l'ordre ?popd?." + +#~ msgid "" +#~ "The -l flag specifies that `dirs' should not print shorthand versions" +#~ msgstr "" +#~ "Si s'especifica el senyalador \"-l\" no es mostrar? la forma abreviada" + +#~ msgid "" +#~ "of directories which are relative to your home directory. This means" +#~ msgstr "dels directoris que estiguen relacionats amb el vostre directori" + +#~ msgid "that `~/bin' might be displayed as `/homes/bfox/bin'. The -v flag" +#~ msgstr "d'usuari. Aix? vol dir que ?~/bin? pot ser exhibit com" + +#~ msgid "causes `dirs' to print the directory stack with one entry per line," +#~ msgstr "" +#~ "?/home/bfox/bin?. Amb el senyalador \"-v\" l'ordre ?dirs? mostrar? la" + +#~ msgid "" +#~ "prepending the directory name with its position in the stack. The -p" +#~ msgstr "" +#~ "pila de directoris amb una l?nia per a cada entrada, afegint el nom de" + +#~ msgid "flag does the same thing, but the stack position is not prepended." +#~ msgstr "directori amb la seua posici? en la pila. Amb el senyalador \"-p\"" + +#~ msgid "" +#~ "The -c flag clears the directory stack by deleting all of the elements." +#~ msgstr "" +#~ "esdevindr? el mateix, per? no mostrar? les posicions. El senyalador\n" +#~ "\"-c\" buidar? la pila de directoris esborrant tots els seus elements." + +#, fuzzy +#~ msgid "" +#~ "+N displays the Nth entry counting from the left of the list shown by" +#~ msgstr "" +#~ "+N\texhibeix l'entrada N?sima comptant des de l'esquerra de la llista " + +#, fuzzy +#~ msgid " dirs when invoked without options, starting with zero." +#~ msgstr "" +#~ "\tmostrada per ?dirs? quan se l'invoca sense opcions, comen?ant per\n" +#~ "\tzero." + +#, fuzzy +#~ msgid "" +#~ "-N displays the Nth entry counting from the right of the list shown by" +#~ msgstr "" +#~ "-N\texhibeix l'entrada N?sima comptant des de la dreta de la llista " + +#~ msgid "Adds a directory to the top of the directory stack, or rotates" +#~ msgstr "" +#~ "Afegeix un directori en el principi de la pila de dicrectoris, o gira " + +#~ msgid "the stack, making the new top of the stack the current working" +#~ msgstr "" +#~ "la pila fent que el primer directori de la pila siga l'actual. Sense" + +#~ msgid "directory. With no arguments, exchanges the top two directories." +#~ msgstr "cap par?metre, intercanvia els dos primers directoris." + +#, fuzzy +#~ msgid "+N Rotates the stack so that the Nth directory (counting" +#~ msgstr "" +#~ "+N\tGira la pila de tal manera que el directori N?sim (comptant des de" + +#, fuzzy +#~ msgid " from the left of the list shown by `dirs', starting with" +#~ msgstr "\tl'esquerra de la llista mostrada per \"dirs\") ?s al principi." + +#, fuzzy +#~ msgid " zero) is at the top." +#~ msgstr "\tla dreta) ?s el primer." + +#, fuzzy +#~ msgid "-N Rotates the stack so that the Nth directory (counting" +#~ msgstr "" +#~ "-N\tGira la pila de tal manera que el directori N?sim (comptant des de " + +#, fuzzy +#~ msgid " from the right of the list shown by `dirs', starting with" +#~ msgstr "\tl'esquerra de la llista mostrada per \"dirs\") ?s al principi." + +#, fuzzy +#~ msgid "-n suppress the normal change of directory when adding directories" +#~ msgstr "" +#~ "-n\tsuprimeix el canvi normal de directori quan se'n afegeix a la pila, " + +#, fuzzy +#~ msgid " to the stack, so only the stack is manipulated." +#~ msgstr "\tde tal manera que nom?s es manipula la pila." + +#, fuzzy +#~ msgid "dir adds DIR to the directory stack at the top, making it the" +#~ msgstr "" +#~ "dir\tafegeix DIR a la pila de directoris al principi, de tal manera que " + +#, fuzzy +#~ msgid " new current working directory." +#~ msgstr "\taquest ser? el nou directori actual de treball." + +#~ msgid "You can see the directory stack with the `dirs' command." +#~ msgstr "Podeu comprovar la pila de directori amb l'ordre ?dirs?." + +#~ msgid "Removes entries from the directory stack. With no arguments," +#~ msgstr "Esborra entrades de la pila de directoris. Sense cap par?metre," + +#~ msgid "removes the top directory from the stack, and cd's to the new" +#~ msgstr "esborra el primer directori de la pila, i canvia el directori a la" + +#~ msgid "top directory." +#~ msgstr "seguent entrada de la pila (o sia, la nova primera entrada)." + +#, fuzzy +#~ msgid "+N removes the Nth entry counting from the left of the list" +#~ msgstr "+N\ttreu l'entrada N?sima comptant des de l'esquerra de la llista" + +#, fuzzy +#~ msgid " shown by `dirs', starting with zero. For example: `popd +0'" +#~ msgstr "\tmostrada per ?dirs?, comen?ant per zero. Per exemple: ?popd +0?" + +#, fuzzy +#~ msgid " removes the first directory, `popd +1' the second." +#~ msgstr "\ttreu el primer directori, ?popd +1? el segon, etc..." + +#, fuzzy +#~ msgid "-N removes the Nth entry counting from the right of the list" +#~ msgstr "-N\ttreu l'entrada N?sima comptant des de la dreta de la llista" + +#, fuzzy +#~ msgid " shown by `dirs', starting with zero. For example: `popd -0'" +#~ msgstr "" +#~ "\tmostrada per ?dirs?, comen?ant per zero. Per exemple: ?popd -0? treu" + +#, fuzzy +#~ msgid " removes the last directory, `popd -1' the next to last." +#~ msgstr "\tel darrer directori, ?popd -1? treu el pen?ltim, etc..." + +#, fuzzy +#~ msgid "" +#~ "-n suppress the normal change of directory when removing directories" +#~ msgstr "" +#~ "-n\tsuprimeix el canvi normal de directori quan es treu cap directori " + +#, fuzzy +#~ msgid " from the stack, so only the stack is manipulated." +#~ msgstr "\tde la pila, de tal manera que nom?s es manipula la pila." + +#, fuzzy +#~ msgid "" +#~ "Exit from within a FOR, WHILE or UNTIL loop. If N is specified,\n" +#~ " break N levels." +#~ msgstr "Ix d'un bucle FOR, WHILE o UNTIL." + +#~ msgid "Obsolete. See `declare'." +#~ msgstr "Obsoleta. Llegiu ?declare?." + +#~ msgid "" +#~ "Output the ARGs. If -n is specified, the trailing newline is suppressed." +#~ msgstr "" +#~ "Mostra els PAR?METREs. Si especifiqueu -n, se suprimir? el car?cter\n" +#~ "d'inici de l?nia." + +#~ msgid "" +#~ "Read ARGs as input to the shell and execute the resulting command(s)." +#~ msgstr "" +#~ "Llegeix els PAR?METRES a l'entrada de l'int?rpret d'ordres i executa les\n" +#~ "ordres resultants." + +#~ msgid "Logout of a login shell." +#~ msgstr "Finalitzar una sessi? de l'int?rpret d'ordres." + +#, fuzzy +#~ msgid "" +#~ "Causes a function to exit with the return value specified by N. If N\n" +#~ " is omitted, the return status is that of the last command." +#~ msgstr "" +#~ "Provoca l'eixida d'una funci? amb un valor de retorn especificat per" + +#, fuzzy +#~ msgid "" +#~ "The positional parameters from $N+1 ... are renamed to $1 ... If N is\n" +#~ " not given, it is assumed to be 1." +#~ msgstr "" +#~ "Es reanomenen els par?metres posicionals des de $N+1 ... com a $1 ... " + +#, fuzzy +#~ msgid "" +#~ "Print the accumulated user and system times for processes run from\n" +#~ " the shell." +#~ msgstr "" +#~ "Mostra el temps acumulat per l'usuari i pel sistema d'haver executat " + +#~ msgid "Missing `}'" +#~ msgstr "S'ha perdut '}'" + +#~ msgid "brace_expand> " +#~ msgstr "clau_expansi?> " + +# Ac? vaig tindre dubtes sobre quina paraula fer servir +# per al terme "command". Mirant-me el diccionari auxiliar +# de Sebasti? Pla i Sanz, traductor del KDE, vaig trobar-ne tres +# de traduccions: ordre, comandament, i comanda. I vaig triar +# la paraula "comanda". +# +# No obstant aix?, no s? si la paraula "command" pot traduir-se +# tamb? amb els altres termes depenent del context. Reviseu +# sobre el terme "comanda". +# Mtx (12/10/2002). +# +# Llegint al TERMCAT, la paraula "comanda" no apareix enlloc. Al glossari +# de termes del Softcatal? si hi apareix. Encara no ho tinc clar. Mentre +# m'informe una mica m?s, per?, ho deixar? com a "ordre", tal com ho +# heu fet fins ara. El problema que t? el TERMCAT, a la meua opini?, ?s +# que s'apropa massa a l'espanyol. No en tinc res en contra d'aquesta +# llengua, per? algunes traduccions en catal?, per exemple, basant-se +# en l'espanyol, em semblen poc naturals, i n'he trobat d'altres basats +# en el franc?s que s? me'n semblen m?s naturals. +# Mtx (15/10/2002) +#~ msgid "Attempt to free unknown command type `%d'.\n" +#~ msgstr "Intenteu lliurar l'ordre de mena desconeguda '%d'.\n" + +#~ msgid "Report this to %s\n" +#~ msgstr "Informeu d'aix? a %s\n" + +#~ msgid "Stopping myself..." +#~ msgstr "Aturant-me..." + +#~ msgid "Tell %s to fix this someday.\n" +#~ msgstr "Digueu a %s que solucione aix? algun dia.\n" + +#~ msgid "execute_command: bad command type `%d'" +#~ msgstr "ordre_execuci?: el tipus d'ordre ?s inv?lid '%d'" + +#~ msgid "real\t" +#~ msgstr "real\t" + +#~ msgid "user\t" +#~ msgstr "usuari\t" + +#~ msgid "sys\t" +#~ msgstr "sistema\t" + +#~ msgid "" +#~ "real\t0m0.00s\n" +#~ "user\t0m0.00s\n" +#~ "sys\t0m0.00s\n" +#~ msgstr "" +#~ "real\t0m0.00s\n" +#~ "usuari\t0m0.00s\n" +#~ "sistema\t0m0.00s\n" + +#~ msgid "cannot duplicate fd %d to fd 1: %s" +#~ msgstr "" +#~ "no es pot copiar per duplicat el descriptor del fitxer df %d cap a df 1: " +#~ "%s" + +#~ msgid "%s: output redirection restricted" +#~ msgstr "%s: redirecci? d'eixida restringida" + +#~ msgid "Out of memory!" +#~ msgstr "Mem?ria esgotada!" + +#~ msgid "You have already added item `%s'\n" +#~ msgstr "Ja hi heu afegit l'element: '%s'\n" + +#~ msgid "You have entered %d (%d) items. The distribution is:\n" +#~ msgstr "Heu introdu?t %d (%d) elements. La distribuci? ?s:\n" + +#~ msgid "%s: bg background job?" +#~ msgstr "%s: suggeriment: voleu executar 'bg' en segon pla?" + +#~ msgid "" +#~ "Redirection instruction from yyparse () '%d' is\n" +#~ "out of range in make_redirection ()." +#~ msgstr "" +#~ "La instrucci? de redirecci? de la funci? yyparse () '%d' ?s fora\n" +#~ "de l'interval en la funci? make_redirection()." + +#~ msgid "clean_simple_command () got a command with type %d." +#~ msgstr "clean_simple_command () heu rebut un ordre del tipus %d." + +#~ msgid "got errno %d while waiting for %d" +#~ msgstr "s'ha rebut l'error %d mentre s'esperava per %d" + +#~ msgid "syntax error near unexpected token `%c'" +#~ msgstr "hi ha un error inesperat de sintaxi a prop del senyal '%c'" + +#~ msgid "print_command: bad command type `%d'" +#~ msgstr "print_command: tipus d'ordre inv?lid '%d'" + +#~ msgid "cprintf: bad `%%' argument (%c)" +#~ msgstr "crintf: el par?metre '%%' de l'opci? %c ?s inv?lid" + +#~ msgid "option `%s' requires an argument" +#~ msgstr "l'opci? '%s' requereix un par?metre" + +#~ msgid "%s: unrecognized option" +#~ msgstr "%s: l'opci? no ?s reconeguda" + +#~ msgid "`-c' requires an argument" +#~ msgstr "'-c' requereix un par?metre" + +#~ msgid "%s: cannot execute directories" +#~ msgstr "%s: no es poden executar els directoris" + +#~ msgid "Bad code in sig.c: sigprocmask" +#~ msgstr "Codi incorrecte a la rutina sig.c: sigprocmask" + +#~ msgid "bad substitution: no ending `}' in %s" +#~ msgstr "substituci? inv?lida: no s'ha tancat %s amb cap '}'" + +#~ msgid "%s: bad array subscript" +#~ msgstr "%s: la composici? de la matriu no ?s v?lida" + +#~ msgid "can't make pipes for process substitution: %s" +#~ msgstr "no es poden establir conductes per a la substituci? del proc?s: %s" + +#~ msgid "reading" +#~ msgstr "s'est? llegint" + +#~ msgid "process substitution" +#~ msgstr "proc?s de substituci? en curs" + +#~ msgid "command substitution" +#~ msgstr "substituci? de l'ordre" + +#~ msgid "Can't reopen pipe to command substitution (fd %d): %s" +#~ msgstr "" +#~ "El conducte no es pot reobrir per a substituir\n" +#~ "l'ordre (descripci? de fitxer%d): %s" + +#~ msgid "$%c: unbound variable" +#~ msgstr "$%c: variable sense vincle" + +#~ msgid "%s: bad arithmetic substitution" +#~ msgstr "%s: substituci? aritm?tica inv?lida" + +#~ msgid "-%s: binary operator expected" +#~ msgstr "-%s: s'esperava un operador binari" + +#~ msgid "%s[%s: bad subscript" +#~ msgstr "%s[%s: sub-?ndex inv?lid" + +#~ msgid "[%s: bad subscript" +#~ msgstr "[%s: sub-?ndex inv?lid" + +#~ msgid "digits occur in two different argv-elements.\n" +#~ msgstr "les xifres apareixen dins de dos par?metres diferents.\n" + +#~ msgid "option %c\n" +#~ msgstr "opci? %c\n" + +#~ msgid "option a\n" +#~ msgstr "opci? a\n" + +#~ msgid "option b\n" +#~ msgstr "opci? b\n" + +#~ msgid "option c with value `%s'\n" +#~ msgstr "opci? c amb el valor ?%s?\n" + +#~ msgid "?? sh_getopt returned character code 0%o ??\n" +#~ msgstr "sh_getopt() retorn? 0%o com a codi de car?cter??\n" + +#~ msgid "non-option ARGV-elements: " +#~ msgstr "elements d'ARGV que no s?n opcions: " + +#~ msgid "%s: Unknown flag %s.\n" +#~ msgstr "%s: Senyalador desconegut %s.\n" + +#~ msgid "Unknown directive `%s'" +#~ msgstr "Directiva desconeguda ?%s?" + +#~ msgid "%s requires an argument" +#~ msgstr "%s cal un par?metre" + +#~ msgid "%s must be inside of a $BUILTIN block" +#~ msgstr "%s ha d'estar dins d'un bloc $BUILTIN" + +#~ msgid "%s found before $END" +#~ msgstr "%s trobat abans de $END" + +#~ msgid "%s already has a function (%s)" +#~ msgstr "%s ja cont? la funci? definida: %s" + +#~ msgid "%s already had a docname (%s)" +#~ msgstr "%s ja t? un nom de document (%s)" + +#~ msgid "%s already has short documentation (%s)" +#~ msgstr "%s ja t? una documentaci? r?pida (%s)" + +#~ msgid "%s already has a %s definition" +#~ msgstr "%s ja t? una definici? %s" + +#~ msgid "mkbuiltins: Out of virtual memory!\n" +#~ msgstr "mkbuiltins(): S'ha esgotat la mem?ria virtual!\n" + +# Tot i que no he trobat cap traducci? t?cnica oficial al TERMCAT +# crec que la traducci? de "prompt" com a "apuntador" ?s prou +# ilustratiu i significatiu per al context, no?. +#~ msgid "read [-r] [-p prompt] [-a array] [-e] [name ...]" +#~ msgstr "read [-r] [-p apuntador] [-a matriu] [-e] [nom ...]" + +#~ msgid "%[DIGITS | WORD] [&]" +#~ msgstr "%[XIFRES | PARAULES] [&]" + +#~ msgid "variables - Some variable names and meanings" +#~ msgstr "variables - Algunes variables i els seus significats" + +#~ msgid "`alias' with no arguments or with the -p option prints the list" +#~ msgstr "" +#~ "Si 'alias' no porta arguments o porta l'opci? -p es mostra la llista" + +#~ msgid "of aliases in the form alias NAME=VALUE on standard output." +#~ msgstr "d'?lies en la forma 'alias NOM=VALOR' en l'eixida per defecte." + +#~ msgid "Otherwise, an alias is defined for each NAME whose VALUE is given." +#~ msgstr "" +#~ "Altrament, es defineix un ?lies per cada NOM que en d?na el seu VALOR." + +#~ msgid "A trailing space in VALUE causes the next word to be checked for" +#~ msgstr "" +#~ "Un salt de l?nia dins del VALOR for?a la substituci? de la seg?ent " +#~ "paraula per" + +#~ msgid "alias substitution when the alias is expanded. Alias returns" +#~ msgstr "substituci? de l'?lies quan aquest s'hi expandeix. L'?lies torna" + +#~ msgid "true unless a NAME is given for which no alias has been defined." +#~ msgstr "" +#~ "cert almenys que es d?ne un NOM pel qual no s'haja estat definit cap ?" +#~ "lies." + +#~ msgid "then remove all alias definitions." +#~ msgstr "l'opci? -a, aleshores se suprimeixen totes les definicions." + +#~ msgid "Bind a key sequence to a Readline function, or to a macro. The" +#~ msgstr "" +#~ "Vincula una seq??ncia de tecles cap una funci? de lectura, o a una macro." + +#~ msgid "syntax is equivalent to that found in ~/.inputrc, but must be" +#~ msgstr "" +#~ "La sintaxi ?s equivalent al que es troba a ~/.inputrc, per? ha s'ha de fer" + +#~ msgid "" +#~ "passed as a single argument: bind '\"\\C-x\\C-r\": re-read-init-file'." +#~ msgstr "" +#~ "el pas com a ?nic par?metre: bind '\"\\C-x\\C-r\": re-read-init-file'." + +#~ msgid "Arguments we accept:" +#~ msgstr "Els par?metres acceptats s?n:" + +#~ msgid "" +#~ " -m keymap Use `keymap' as the keymap for the duration of this" +#~ msgstr "" +#~ " -m mapa_tecles Fa servir 'keymap' com el mapa de car?cters " +#~ "durant" + +#~ msgid " command. Acceptable keymap names are emacs," +#~ msgstr "" +#~ " l'execuci? d'aquest ordre. S'accepten els noms emacs," + +#~ msgid "" +#~ " emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move," +#~ msgstr "" +#~ " emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move," + +#~ msgid " vi-command, and vi-insert." +#~ msgstr " vi-command, i vi-insert." + +#~ msgid " -l List names of functions." +#~ msgstr " -l Mostra la llista de noms de les funcions." + +#~ msgid " -P List function names and bindings." +#~ msgstr "" +#~ " -P Mostra la llista de noms i vincles de les funcions." + +#~ msgid "" +#~ " -p List functions and bindings in a form that can be" +#~ msgstr "" +#~ " -p Mostra la llista de funcions i vincles d'una manera" + +#~ msgid " reused as input." +#~ msgstr "" +#~ " que puga ser reutilitzada com a entrada de dades." + +#~ msgid " -r keyseq Remove the binding for KEYSEQ." +#~ msgstr "" +#~ " -r seq??ncia_tecles Treu els vincles de la seq??ncia de tecles." + +#~ msgid " -f filename Read key bindings from FILENAME." +#~ msgstr " -f fitxer Llegeix les assignacions de tecles d'un fitxer." + +#~ msgid "" +#~ " -q function-name Query about which keys invoke the named function." +#~ msgstr "" +#~ " -q nom_funci? Consultar quines tecles invoquen la funci? demanada." + +#~ msgid " -V List variable names and values" +#~ msgstr "" +#~ " -V Mostra la llista de noms i valors de les variables." + +#~ msgid "" +#~ " -v List variable names and values in a form that can" +#~ msgstr "" +#~ " -v Mostra la llista de noms i valors de variables de " +#~ "manera" + +#~ msgid " be reused as input." +#~ msgstr "" +#~ " que puga ser reutilitzada com a entrada de dades." + +#~ msgid "" +#~ " -S List key sequences that invoke macros and their " +#~ "values" +#~ msgstr "" +#~ " -S Mostra la llista de seq??ncies de tecles que criden\n" +#~ " macros i els seus valors." + +#~ msgid "" +#~ " -s List key sequences that invoke macros and their " +#~ "values in" +#~ msgstr "" +#~ " -s Mostra la llista de seq??ncies de tecles que criden" + +#~ msgid " a form that can be reused as input." +#~ msgstr "" +#~ " macros i els seus valors de manera que puga ser\n" +#~ " reutilitzada com a entrada de dades." + +#~ msgid "break N levels." +#~ msgstr "Si s'especifica N, s'ix despr?s de N iteracions." + +#~ msgid "If N is specified, resume at the N-th enclosing loop." +#~ msgstr "Si s'especifica N, es repr?n el bucle al N-?sim cicle." + +#~ msgid "Run a shell builtin. This is useful when you wish to rename a" +#~ msgstr "" +#~ "Executa una ordre integrada de l'int?rpret. Aix? ?s ?til quan desitgeu" + +#~ msgid "shell builtin to be a function, but need the functionality of the" +#~ msgstr "" +#~ "renomenar una ordre integrada de l'int?rpret perqu? siga una funci?, per?" + +#~ msgid "builtin within the function itself." +#~ msgstr "cal la funcionalitat de l'ordre integrada dins de la pr?pia funci?." + +#~ msgid "Change the current directory to DIR. The variable $HOME is the" +#~ msgstr "Fa servir DIR com el directori actual. La variable $HOME ?s el" + +#~ msgid "default DIR. The variable $CDPATH defines the search path for" +#~ msgstr "" +#~ "valor per defecte de DIR. La variable $CDPATH defineix el cam? de recerca" + +#~ msgid "the directory containing DIR. Alternative directory names in CDPATH" +#~ msgstr "" +#~ "per al directori que cont? DIR. Els noms de directoris alternatius que " +#~ "hi ha" + +#~ msgid "are separated by a colon (:). A null directory name is the same as" +#~ msgstr "" +#~ "en CDPATH s?n separats per dos punts. Un nom buit de directori ?s el " +#~ "mateix" + +#~ msgid "the current directory, i.e. `.'. If DIR begins with a slash (/)," +#~ msgstr "" +#~ "que el directori actual, p.e. ?.?. Si es comen?a en DIR amb una barra " +#~ "(/)," + +#~ msgid "then $CDPATH is not used. If the directory is not found, and the" +#~ msgstr "" +#~ "aleshores no es fa servir $CDPATH. Si no es troba el directori, i l'opci?" + +#~ msgid "shell option `cdable_vars' is set, then try the word as a variable" +#~ msgstr "" +#~ "de l'int?rpret ?cdable_vars? ?s activa, aleshores intenta fer servir la" + +#~ msgid "name. If that variable has a value, then cd to the value of that" +#~ msgstr "" +#~ "paraula com a nom de variable. Si aquesta variable ja tenia un valor," + +#~ msgid "" +#~ "variable. The -P option says to use the physical directory structure" +#~ msgstr "aleshores es canvia al directori d'aquest valor. L'opci? -P indica" + +#~ msgid "" +#~ "instead of following symbolic links; the -L option forces symbolic links" +#~ msgstr "" +#~ "l'emprament de l'estructura f?sica del directori en voltes d'enlla?os" + +#~ msgid "to be followed." +#~ msgstr "simb?lics; l'opci? -L for?a el seguiment d'enlla?os simb?lics." + +#~ msgid "Print the current working directory. With the -P option, pwd prints" +#~ msgstr "" +#~ "Mostra el directori actual de treball. Amb l'opci? -P, pwd mostra el" + +#~ msgid "the physical directory, without any symbolic links; the -L option" +#~ msgstr "" +#~ "directori f?sic, sense cap enlla? simb?lic; l'opci? -L fa que pwd seguisca" + +#~ msgid "makes pwd follow symbolic links." +#~ msgstr "els enlla?os simb?lics." + +#~ msgid "" +#~ "Runs COMMAND with ARGS ignoring shell functions. If you have a shell" +#~ msgstr "" +#~ "Executa ORDRE amb PAR?METRES ignorant les funcions de l'int?rpret. Si " +#~ "teniu" + +#~ msgid "function called `ls', and you wish to call the command `ls', you can" +#~ msgstr "" +#~ "una funci? de l'int?rpret anomenat ?ls?, i desitgeu cridar l'ordre ?ls?," + +#~ msgid "" +#~ "say \"command ls\". If the -p option is given, a default value is used" +#~ msgstr "" +#~ "podeu escriure ?command ls?. Si doneu l'opci? -p, es far? servir un valor" + +#~ msgid "" +#~ "for PATH that is guaranteed to find all of the standard utilities. If" +#~ msgstr "" +#~ "per defecte per al PATH, que garanteix la cerca de les eines est?ndard. " +#~ "Si hi" + +#~ msgid "" +#~ "the -V or -v option is given, a string is printed describing COMMAND." +#~ msgstr "" +#~ "indiqueu l'opci? -V o -v, es mostrar? una cadena de text descrivint " +#~ "l'ORDRE." + +#~ msgid "The -V option produces a more verbose description." +#~ msgstr "L'opci? -V produeix una descripci? m?s acurada." + +#~ msgid "Declare variables and/or give them attributes. If no NAMEs are" +#~ msgstr "" +#~ "Es declara les variables i/o se'ls d?na atributs. Si no es proporcionen " +#~ "NOMS," + +#~ msgid "given, then display the values of variables instead. The -p option" +#~ msgstr "" +#~ "aleshores mostra els valors de les variables. L'opci? -p mostrar? els" + +#~ msgid "will display the attributes and values of each NAME." +#~ msgstr "atributs i valors de cada NOM." + +#~ msgid "The flags are:" +#~ msgstr "Els senyaladors s?n:" + +#~ msgid " -a\tto make NAMEs arrays (if supported)" +#~ msgstr " -a\tper a fer matrius de NOMS (si n'?s suportat)" + +#~ msgid " -f\tto select from among function names only" +#~ msgstr " -f\ttriar nom?s entre els noms de les funcions" + +#~ msgid " -F\tto display function names without definitions" +#~ msgstr " -F\tmostrar noms de funcions ometent les seues definicions" + +#~ msgid " -r\tto make NAMEs readonly" +#~ msgstr " -r\tblocar l'acc?s d'escriptura de les variables NOMs" + +#~ msgid " -x\tto make NAMEs export" +#~ msgstr " -x\texportar les variables de NOMs" + +#~ msgid " -i\tto make NAMEs have the `integer' attribute set" +#~ msgstr " -i\tactivar l'atribut num?ric enter les variables NOMs" + +#~ msgid "Variables with the integer attribute have arithmetic evaluation (see" +#~ msgstr "" +#~ "Les variables que tinguen l'atribut num?ric enter tenen feta l'evaluaci?" + +#~ msgid "`let') done when the variable is assigned to." +#~ msgstr "aritm?tica (mirar ?let?) quan se'ls assigna la variable." + +#~ msgid "When displaying values of variables, -f displays a function's name" +#~ msgstr "" +#~ "Quan es mostra els valors de les variables, amb -f es mostra un nom de " +#~ "funci?" + +#~ msgid "and definition. The -F option restricts the display to function" +#~ msgstr "" +#~ "i la definici?. Amb l'opci? -F es limita nom?s en mostrar el nom de la" + +#~ msgid "name only." +#~ msgstr "funci?." + +#~ msgid "" +#~ "Using `+' instead of `-' turns off the given attribute instead. When" +#~ msgstr "" +#~ "Emprant \"+\" en voltes de \"-\" desactiva l'atribut especificat. Quan ?s" + +#~ msgid "used in a function, makes NAMEs local, as with the `local' command." +#~ msgstr "" +#~ "emprat en una funci?, converteix NOMs en variables locals, igual com es " +#~ "fa\n" +#~ "amb l'ordre ?local?." + +#~ msgid "Create a local variable called NAME, and give it VALUE. LOCAL" +#~ msgstr "" +#~ "Es crea una variable local anomenat NOM, i el d?na un VALOR. Nom?s es " +#~ "pot fer" + +#~ msgid "have a visible scope restricted to that function and its children." +#~ msgstr "variable NOM nom?s per a aquesta funci? i per als seus fills." + +#~ msgid "Output the ARGs. If -n is specified, the trailing newline is" +#~ msgstr "" +#~ "Mostra els PAR?METREs. Si especifiqueu -n, s'eliminar? el car?cter de " +#~ "salt" + +#~ msgid "suppressed. If the -e option is given, interpretation of the" +#~ msgstr "" +#~ "de l?nia. Si especifiqueu l'opci? -e, s'activar? la interpretaci? de les" + +#~ msgid "following backslash-escaped characters is turned on:" +#~ msgstr "seq??ncies d'escapada (barra inclinada inversa):" + +#~ msgid "\t\\a\talert (bell)" +#~ msgstr "\t\\a\talerta (camponada)" + +#~ msgid "\t\\b\tbackspace" +#~ msgstr "\t\\b\tesborrar cap enrere" + +#~ msgid "\t\\c\tsuppress trailing newline" +#~ msgstr "\t\\c\tsuprimeix el car?cter de salt de l?nia" + +#~ msgid "\t\\E\tescape character" +#~ msgstr "\t\\E\tcar?cter d'escapada" + +#~ msgid "\t\\f\tform feed" +#~ msgstr "\t\\f\talimentaci? manual de paper" + +#~ msgid "\t\\n\tnew line" +#~ msgstr "\t\\n\tl?nia nova" + +#~ msgid "\t\\r\tcarriage return" +#~ msgstr "\t\\r\ttecla de retorn de carro" + +#~ msgid "\t\\t\thorizontal tab" +#~ msgstr "\t\\t\tpestanya horitzontal" + +#~ msgid "\t\\v\tvertical tab" +#~ msgstr "\t\\v\tpestanya vertical" + +#~ msgid "\t\\\\\tbackslash" +#~ msgstr "\t\\\\\tbarra invertida" + +#~ msgid "\t\\num\tthe character whose ASCII code is NUM (octal)." +#~ msgstr "\t\\num\tcar?cter del qual codi ASCII ?s NUM (octal)." + +#~ msgid "" +#~ "You can explicitly turn off the interpretation of the above characters" +#~ msgstr "" +#~ "Podeu desactivar expl?citament la interpretaci? dels car?cters esmentats " +#~ "amb" + +#~ msgid "with the -E option." +#~ msgstr "l'opci? -E." + +#~ msgid "Enable and disable builtin shell commands. This allows" +#~ msgstr "" +#~ "Activa i desactiva les ordres integrades de l'int?rpret d'ordres. A?? us" + +#~ msgid "you to use a disk command which has the same name as a shell" +#~ msgstr "" +#~ "permet fer servir una ordre de disc que tinga el mateix nom d'una ordre " +#~ "interna" + +#~ msgid "builtin. If -n is used, the NAMEs become disabled; otherwise" +#~ msgstr "" +#~ "de l'int?rpret d'ordres. Si utilitzeu -n, els NOMs es desactiven; " +#~ "altrament" + +#~ msgid "NAMEs are enabled. For example, to use the `test' found on your" +#~ msgstr "" +#~ "s'activarien els NOMs. Per exemple, per a fer servir l'ordre ?test? del " +#~ "cam?" + +#~ msgid "path instead of the shell builtin version, type `enable -n test'." +#~ msgstr "" +#~ "d'acc?s (PATH) en voltes de la versi? integrada de l'int?rpret d'ordres," + +#~ msgid "On systems supporting dynamic loading, the -f option may be used" +#~ msgstr "" +#~ "teclegeu ?enable -n test?. En sistemes que suporten c?rrega din?mica, " +#~ "l'opci?" + +#~ msgid "to load new builtins from the shared object FILENAME. The -d" +#~ msgstr "" +#~ "-f es pot fer servir per a carregar noves ordres predefinides de l'objecte" + +#~ msgid "option will delete a builtin previously loaded with -f. If no" +#~ msgstr "" +#~ "de FITXER compartit. L'opci? -d esborrar? una ordre integrada carregada " + +#~ msgid "non-option names are given, or the -p option is supplied, a list" +#~ msgstr "" +#~ "pr?viament amb -f. Si no s'especifica cap opci?, o s'especifica l'opci? -" +#~ "p, es" + +#~ msgid "of builtins is printed. The -a option means to print every builtin" +#~ msgstr "" +#~ "mostra una llista d'ordres predefinides. L'opci? -a implica mostrar cada" + +#~ msgid "with an indication of whether or not it is enabled. The -s option" +#~ msgstr "" +#~ "ordre integrada amb una indicaci? de si est? activa o no. L'opci? -s " +#~ "impedeix" + +#~ msgid "restricts the output to the Posix.2 `special' builtins. The -n" +#~ msgstr "" +#~ "l'eixida de les ordres predefinides \"especials\" Posix.2. L'opci? -n " +#~ "mostra" + +#~ msgid "option displays a list of all disabled builtins." +#~ msgstr "una llista de totes les funcions internes desactivades." + +#~ msgid "Getopts is used by shell procedures to parse positional parameters." +#~ msgstr "" +#~ "La funci? getopts() ?s utilitzada pels procediments de l'int?rpret " +#~ "d'ordres\n" +#~ "per a analitzar par?metres posicionals." + +#~ msgid "OPTSTRING contains the option letters to be recognized; if a letter" +#~ msgstr "" +#~ "La variable OPTSTRING cont? les opcions de forma curta per a ser " +#~ "reconegudes;" + +#~ msgid "is followed by a colon, the option is expected to have an argument," +#~ msgstr "" +#~ "si una lletra ?s seguida per dos punts, s'ha de donar un par?metre que " +#~ "hauria" + +#~ msgid "which should be separated from it by white space." +#~ msgstr "d'estar separat per un espai en blanc." + +#~ msgid "Each time it is invoked, getopts will place the next option in the" +#~ msgstr "" +#~ "Cada vegada que se'l invoca, ?getops? posar? la seg?ent opci? en la " +#~ "variable" + +#~ msgid "shell variable $name, initializing name if it does not exist, and" +#~ msgstr "" +#~ "$name de l'int?rpret d'ordres, creant-lo si no existeix, i l'?ndex del " +#~ "seg?ent" + +#~ msgid "the index of the next argument to be processed into the shell" +#~ msgstr "" +#~ "par?metre per a processar-se dins de la variable OPTIND de l'int?rpret" + +#~ msgid "variable OPTIND. OPTIND is initialized to 1 each time the shell or" +#~ msgstr "" +#~ "d'ordres. OPTIND s'inicia amb 1 cada vegada que s'invoca l'int?rpret " +#~ "d'ordres" + +#~ msgid "a shell script is invoked. When an option requires an argument," +#~ msgstr "" +#~ "o una seq??ncia d'ordres. Quan una opci? requereix un par?metre, la funci?" + +#~ msgid "getopts places that argument into the shell variable OPTARG." +#~ msgstr "" +#~ "getopts() colžloca aquest par?metre dins de la variable OPTARG de l'int?" +#~ "rpret." + +#~ msgid "getopts reports errors in one of two ways. If the first character" +#~ msgstr "" +#~ "La funci? getopts() comunica errors en una de les dues maneres. Si el" + +#~ msgid "of OPTSTRING is a colon, getopts uses silent error reporting. In" +#~ msgstr "primer car?cter de la variable OPSTRING ?s el signe ':', la funci?" + +#~ msgid "this mode, no error messages are printed. If an illegal option is" +#~ msgstr "" +#~ "getopts() corre silenciosament. D'aquesta manera, no s'imprimir? cap" + +#~ msgid "seen, getopts places the option character found into OPTARG. If a" +#~ msgstr "missatge d'error. Si es troba una opci? incorrecta, la funci?" + +#~ msgid "required argument is not found, getopts places a ':' into NAME and" +#~ msgstr "colžloca aquesta opci? de forma curta dins de la variable OPTARG " + +#~ msgid "sets OPTARG to the option character found. If getopts is not in" +#~ msgstr "" +#~ "si no es troba un patr?metre esperat, la funci? getopts() introdueix" + +#~ msgid "silent mode, and an illegal option is seen, getopts places '?' into" +#~ msgstr "el signe ':' dins de la variable NAME i estableix el valor de la" + +#~ msgid "NAME and unsets OPTARG. If a required option is not found, a '?'" +#~ msgstr "" +#~ "variable OPTARG amb l'opci? de forma curta que s'hi haja trobada. Si" + +#~ msgid "is placed in NAME, OPTARG is unset, and a diagnostic message is" +#~ msgstr "la funci? getopts() no est? en mode silenci?s, i s'ha trobat una" + +#~ msgid "If the shell variable OPTERR has the value 0, getopts disables the" +#~ msgstr "Si la variable OPTERR de l'int?rpret d'ordres t? un valor nul, la" + +#~ msgid "printing of error messages, even if the first character of" +#~ msgstr "" +#~ "funci? getopts() desactiva la impressi? dels missatges d'error, tot i" + +#~ msgid "OPTSTRING is not a colon. OPTERR has the value 1 by default." +#~ msgstr "" +#~ "que el primer car?cter de OPSTRING no siga el signe ':'. La variable\n" +#~ "OPTERR t? el valor 1 com a defecte." + +#~ msgid "Getopts normally parses the positional parameters ($0 - $9), but if" +#~ msgstr "La funci? getopts() normalment analitza els par?metres posicionals" + +#~ msgid "more arguments are given, they are parsed instead." +#~ msgstr "" +#~ "($0-$9), per? si se'n d?na m?s arguments, se'ls analitza en voltes\n" +#~ "dels posicionals." + +#~ msgid "Exec FILE, replacing this shell with the specified program." +#~ msgstr "" +#~ "Executa el FITXER, reempla?ant aquest int?rpret d'ordres pel programa." + +#~ msgid "If FILE is not specified, the redirections take effect in this" +#~ msgstr "" +#~ "especificat. Si no s'especifica FITXER, els redre?aments tindran efecte" + +#~ msgid "shell. If the first argument is `-l', then place a dash in the" +#~ msgstr "en aquest int?rpret d'ordres. Si el primer par?metre ?s \"-l\"," + +#~ msgid "zeroth arg passed to FILE, as login does. If the `-c' option" +#~ msgstr "aleshores es reempla?a el par?metre 0 pel signe \"-\" referenciat a" + +#~ msgid "is supplied, FILE is executed with a null environment. The `-a'" +#~ msgstr "" +#~ "FITXER, com aix? es fa en l'inici de sessi?. Si s'especifica l'opci? \"-c" +#~ "\"," + +#~ msgid "option means to make set argv[0] of the executed process to NAME." +#~ msgstr "" +#~ "s'executa FITXER en un entorn nul. L'opci? \"-a\" estableix que el\n" +#~ "proc?s executat portar? aquest NOM." + +#~ msgid "If the file cannot be executed and the shell is not interactive," +#~ msgstr "Si no es pot executar el fitxer i l'int?rpret d'ordres no ?s" + +#~ msgid "then the shell exits, unless the variable \"no_exit_on_failed_exec\"" +#~ msgstr "interactiu, aleshores l'int?rpret finalitza la seua execuci?, a" + +#~ msgid "is set." +#~ msgstr "menys que s'inicialitze la variable \"no_exit_on_failed_exec\"." + +#~ msgid "is that of the last command executed." +#~ msgstr "l'estat d'eixida ?s el darrer ordre executat." + +#~ msgid "" +#~ "FIRST and LAST can be numbers specifying the range, or FIRST can be a" +#~ msgstr "PRIMER i ?LTIM poden ser n?meros que especifiquen el rang, o PRIMER" + +#~ msgid "string, which means the most recent command beginning with that" +#~ msgstr "" +#~ "pot ser una cadena, que representa l'ordre m?s recent el qual comen?a" + +#~ msgid "string." +#~ msgstr "amb eixa cadena." + +#~ msgid "" +#~ " -e ENAME selects which editor to use. Default is FCEDIT, then EDITOR," +#~ msgstr "" +#~ " -e ENAME tria quin editor emprar. FCEDIT ?s per defecte, despr?s ?s" + +#~ msgid "" +#~ " then the editor which corresponds to the current readline editing" +#~ msgstr "" +#~ " EDITOR, despr?s l'editor que correspon amb l'actual editor del " + +#~ msgid " mode, then vi." +#~ msgstr " mode de l?nia d'ordre, i per ?ltim ?vi?." + +#~ msgid " -l means list lines instead of editing." +#~ msgstr " -l mostra les l?nies en voltes d'editar-les." + +#~ msgid " -n means no line numbers listed." +#~ msgstr " -n no es mostraran els n?meros de l?nia." + +#~ msgid "" +#~ " -r means reverse the order of the lines (making it newest listed " +#~ "first)." +#~ msgstr "" +#~ " -r inverteix l'ordre de les l?nies (els m?s recents es llisten primer)." + +#~ msgid "With the `fc -s [pat=rep ...] [command]' format, the command is" +#~ msgstr "" +#~ "Amb el format ?fc -s [pat=rep ...] [command]?, es reexecuta l'ordre " + +#~ msgid "re-executed after the substitution OLD=NEW is performed." +#~ msgstr "despr?s de que es realitze la substituci? de ANTIC per NOU." + +#~ msgid "A useful alias to use with this is r='fc -s', so that typing `r cc'" +#~ msgstr "Un ?lies ?til per a usar-lo amb aix? ?s r='fc -s', per tant si" + +#~ msgid "runs the last command beginning with `cc' and typing `r' re-executes" +#~ msgstr "s'escriu ?r cc? s'executar? la darrera ordre que comen?a per ?cc? i" + +#~ msgid "JOB_SPEC is not present, the shell's notion of the current job is" +#~ msgstr "Si no s'especifica ID_TASCA, s'aplicaran els atributs d'execuci? de" + +#~ msgid "used." +#~ msgstr "l'int?rpret d'ordres de la tasca actual." + +#~ msgid "Place JOB_SPEC in the background, as if it had been started with" +#~ msgstr "Ubica ID_TASCA en segon pla, com si s'haguera iniciat amb \"&\"." + +#~ msgid "`&'. If JOB_SPEC is not present, the shell's notion of the current" +#~ msgstr "Si no s'especifica ID_TASCA, s'aplicaran els atributs d'execuci? de" + +#~ msgid "job is used." +#~ msgstr "l'int?rpret d'ordres de la tasca actual." + +#~ msgid "For each NAME, the full pathname of the command is determined and" +#~ msgstr "Per a cada NOM, es determina i es recorda el nom del cam? d'acc?s" + +#~ msgid "remembered. If the -p option is supplied, PATHNAME is used as the" +#~ msgstr "complet de l'ordre. Si s'especifica l'opci? -p , es fa servir" + +#~ msgid "full pathname of NAME, and no path search is performed. The -r" +#~ msgstr "CAM?_ACC?S com el nom del cam? complet de NOM, i no es realitzar?" + +#~ msgid "option causes the shell to forget all remembered locations. If no" +#~ msgstr "cap cerca de camins. L'opci? -r fa que l'int?rpret d'ordres oblide" + +#~ msgid "" +#~ "arguments are given, information about remembered commands is displayed." +#~ msgstr "" +#~ "totes les ubicacions del cam? d'acc?s. Si no s'hi d?na arguments, es\n" +#~ "mostrar? informaci? sobre els camins d'acc?s triats per les ordres." + +#~ msgid "Display helpful information about builtin commands. If PATTERN is" +#~ msgstr "Mostra informaci? d'utilitat sobre les ordres integrades. Si" + +#~ msgid "specified, gives detailed help on all commands matching PATTERN," +#~ msgstr "s'especifica PLANTILLA, s'hi d?na ajuda detallada sobre totes les" + +#~ msgid "otherwise a list of the builtins is printed." +#~ msgstr "" +#~ "ordres que coincidisquen amb PLANTILLA, altrament s'hi mostrar? una\n" +#~ "llista de les ordres integrades." + +#~ msgid "Display the history list with line numbers. Lines listed with" +#~ msgstr "Mostra el llistat de l'hist?ric de manera numerada. Les l?nies qu?" + +#~ msgid "with a `*' have been modified. Argument of N says to list only" +#~ msgstr "" +#~ "han sigut modificades s?n llistades amb el signe \"*\". El par?metre" + +#~ msgid "the last N lines. The -c option causes the history list to be" +#~ msgstr "" +#~ "N mostra les darreres N l?nies. L'opci? -c fa que es buide l'hist?ric" + +#~ msgid "" +#~ "cleared by deleting all of the entries. The `-w' option writes out the" +#~ msgstr "" +#~ "esborrant totes les seues entrades. L'opci? \"-w\" escriu l'hist?ric" + +#~ msgid "" +#~ "current history to the history file; `-r' means to read the file and" +#~ msgstr "" +#~ "actual al fitxer d'hist?ric; d'altra banda, l'opci? \"-r\" llegeix el" + +#~ msgid "append the contents to the history list instead. `-a' means" +#~ msgstr "" +#~ "fitxer i afegeix els continguts a l'hist?ric. L'opci? \"-a\" afegeix" + +#~ msgid "to append history lines from this session to the history file." +#~ msgstr "les l?nies de l'hist?ric d'aquesta sessi? al fitxer de l'hist?ric." + +#~ msgid "Argument `-n' means to read all history lines not already read" +#~ msgstr "" +#~ "Amb el par?metre \"-n\" es llegeix totes les l?nies de l'hist?ric que" + +#~ msgid "from the history file and append them to the history list. If" +#~ msgstr "encara no hagen sigut llegides del fitxer d'hist?ric i l'afegeix a" + +#~ msgid "FILENAME is given, then that is used as the history file else" +#~ msgstr "la llista de l'hist?ric. Si s'especifica FITXER, aquest es far?" + +#~ msgid "if $HISTFILE has a value, that is used, else ~/.bash_history." +#~ msgstr "" +#~ "servir com el fitxer d'hist?ric, altrament s'utilitzar? el valor de\n" +#~ "$HISTFILE, si en t?, i sin? es mirar? en ~/.bash_history." + +#~ msgid "If the -s option is supplied, the non-option ARGs are appended to" +#~ msgstr "Si s'especifica l'opci? \"-s\", els PAR?METRES que no s?n opcions" + +#~ msgid "the history list as a single entry. The -p option means to perform" +#~ msgstr "" +#~ "seran afegits a l'hist?ric com una entrada ?nica. Amb l'opci? \"-p\"" + +#~ msgid "" +#~ "history expansion on each ARG and display the result, without storing" +#~ msgstr "" +#~ "es realitza una expansi? de l'hist?ric en cada PAR?METRE i mostra el " + +#~ msgid "anything in the history list." +#~ msgstr "resultat, sense al?ar res en l'hist?ric." + +#~ msgid "Lists the active jobs. The -l option lists process id's in addition" +#~ msgstr "Llista les tasques actives. Amb l'opci? \"-l\" es llista els" + +#~ msgid "to the normal information; the -p option lists process id's only." +#~ msgstr "" +#~ "identificadors de proc?s a m?s de la informaci? normal; amb l'opci? \n" +#~ "\"-p\" es llista nom?s els identificadors de proc?s." + +#~ msgid "" +#~ "If -n is given, only processes that have changed status since the last" +#~ msgstr "Si s'especifica \"-n\", nom?s s'imprimeixen els processos que hagen" + +#~ msgid "" +#~ "notification are printed. JOBSPEC restricts output to that job. The" +#~ msgstr "" +#~ "canviat el seu estat despr?s del seu darrer av?s.\n" +#~ "ID_TASCA restringeix que es mostre una tasca particular." + +#~ msgid "-r and -s options restrict output to running and stopped jobs only," +#~ msgstr "" +#~ "Amb les opcions \"-r\" i \"-s\" es restringeix nom?s la impressi? de" + +#~ msgid "respectively. Without options, the status of all active jobs is" +#~ msgstr "les tasques actives i aturades, respectivamente. Sense cap opci?," + +#~ msgid "" +#~ "printed. If -x is given, COMMAND is run after all job specifications" +#~ msgstr "" +#~ "es mostren l'estat de totes les tasques actives Si s'especifica\n" +#~ "\"-X\" s'executa ORDRE despr?s de que totes les especificacions de" + +#~ msgid "" +#~ "that appear in ARGS have been replaced with the process ID of that job's" +#~ msgstr "" +#~ "tasca que apareixen en PAR?METRES hagen sigut reempla?ades pel proc?s" + +#~ msgid "process group leader." +#~ msgstr "ID del proc?s de la tasca mestressa del grup." + +#~ msgid "Removes each JOBSPEC argument from the table of active jobs." +#~ msgstr "" +#~ "Suprimeix cada par?metre de ID_TASCA de la taula de tasques actives." + +#~ msgid "Send the processes named by PID (or JOB) the signal SIGSPEC. If" +#~ msgstr "" +#~ "Envia el SENYAL als processos especificats pel seu PID o pel seu nom" + +#~ msgid "" +#~ "SIGSPEC is not present, then SIGTERM is assumed. An argument of `-l'" +#~ msgstr "de tasca. Si no s'especifica el SENYAL, aleshores s'assumeix" + +#~ msgid "lists the signal names; if arguments follow `-l' they are assumed to" +#~ msgstr "SIGTERM. Amb un par?metre de \"-l\" es llista els noms de les" + +#~ msgid "be signal numbers for which names should be listed. Kill is a shell" +#~ msgstr "" +#~ "senyals; si hi ha un par?metre despr?s de l'opci? \"-l\", es mostra\n" +#~ "el valor num?ric del n?mero de senyal. L'ordre ?kill? ?s " + +#~ msgid "builtin for two reasons: it allows job IDs to be used instead of" +#~ msgstr "integrada de l'int?rpret per dues raons: permet fer servir els" + +#~ msgid "process IDs, and, if you have reached the limit on processes that" +#~ msgstr "" +#~ "identificadors de tasca en voltes dels identificadors de proc?s i, si" + +#~ msgid "" +#~ "you can create, you don't have to start a process to kill another one." +#~ msgstr "" +#~ "no heu excedit el l?mit de processos que pots crear-hi, no heu\n" +#~ "d'iniciar un altre proc?s per a finalitzar un altre." + +#~ msgid "Each ARG is an arithmetic expression to be evaluated. Evaluation" +#~ msgstr "Cada PARAMETRE ?s una expressi? aritm?tica per a avaluar-se." + +#~ msgid "is done in long integers with no check for overflow, though division" +#~ msgstr "" +#~ "L'avaluaci? es fa amb enters long sense control de sobreeiximent, si" + +#~ msgid "by 0 is trapped and flagged as an error. The following list of" +#~ msgstr "" +#~ "b? la divisi? per 0 ?s capturada i marcada com un error. La seg?ent" + +#~ msgid "operators is grouped into levels of equal-precedence operators." +#~ msgstr "llista d'operadors s'agrupa dins del mateix nivell de preced?ncia." + +#~ msgid "The levels are listed in order of decreasing precedence." +#~ msgstr "La llista dels nivells est? ordenada de manera decreixent." + +#~ msgid "\t-, +\t\tunary minus, plus" +#~ msgstr "\t-, +\t\tunari minus, m?s" + +#~ msgid "\t!, ~\t\tlogical and bitwise negation" +#~ msgstr "\t!, ~\t\tnegaci? l?gica i bin?ria" + +#~ msgid "\t*, /, %\t\tmultiplication, division, remainder" +#~ msgstr "\t*, /, %\t\tmultiplicaci?, divisi?, restant" + +#~ msgid "\t+, -\t\taddition, subtraction" +#~ msgstr "\t+, -\t\taddici?, substracci?" + +#~ msgid "\t<<, >>\t\tleft and right bitwise shifts" +#~ msgstr "\t<<, >>\t\tdecalaments bin?ries dreta i esquerra" + +#~ msgid "\t<=, >=, <, >\tcomparison" +#~ msgstr "\t<=, >=, <, >\tcomparaci?" + +#~ msgid "\t==, !=\t\tequality, inequality" +#~ msgstr "\t==, !=\t\tequival?ncia, inequival?ncia" + +#~ msgid "\t&\t\tbitwise AND" +#~ msgstr "\t&\t\tAND binari" + +#~ msgid "\t^\t\tbitwise XOR" +#~ msgstr "\t^\t\tXOR binari" + +#~ msgid "\t|\t\tbitwise OR" +#~ msgstr "\t|\t\tOR binari" + +#~ msgid "\t&&\t\tlogical AND" +#~ msgstr "\t&&\t\tAND l?gic" + +#~ msgid "\t||\t\tlogical OR" +#~ msgstr "\t||\t\tOR l?gic" + +#~ msgid "\texpr ? expr : expr" +#~ msgstr "\texpr ? expr : expr" + +#~ msgid "\t\t\tconditional expression" +#~ msgstr "\t\t\texpressi? condicional" + +#~ msgid "\t=, *=, /=, %=," +#~ msgstr "\t=, *=, /=, %=," + +#~ msgid "\t+=, -=, <<=, >>=," +#~ msgstr "\t+=, -=, <<=, >>=," + +#~ msgid "\t&=, ^=, |=\tassignment" +#~ msgstr "\t&=, ^=, |=\tassignaci?" + +#~ msgid "is replaced by its value (coerced to a long integer) within" +#~ msgstr "" +#~ "nom de la variable ?s reempla?at pel seu valor (convertit for?osament" + +#~ msgid "an expression. The variable need not have its integer attribute" +#~ msgstr "" +#~ "en un enter long) dins d'una expressi?. No cal que la variable tinga" + +#~ msgid "turned on to be used in an expression." +#~ msgstr "" +#~ "activada el seu atribut d'enter per ser utilitzada en una expressi?." + +#~ msgid "Operators are evaluated in order of precedence. Sub-expressions in" +#~ msgstr "" +#~ "S'avaluen els operadors per ordre de preced?ncia. Les subexpressions" + +#~ msgid "parentheses are evaluated first and may override the precedence" +#~ msgstr "qu? que es troben dins dels par?ntesis s?n avaluades primer i poden" + +#~ msgid "rules above." +#~ msgstr "saltar-se les regles de preced?ncies esmentades." + +#~ msgid "If the last ARG evaluates to 0, let returns 1; 0 is returned" +#~ msgstr "Si el darrer PARAMETRE avalua a 0, let retorna 1; altrament, es" + +#~ msgid "otherwise." +#~ msgstr "retorna 1." + +#~ msgid "One line is read from the standard input, and the first word is" +#~ msgstr "" +#~ "Es llegeix una l?nia des de l'entrada de dades est?ndard, i s'assigna" + +#~ msgid "" +#~ "assigned to the first NAME, the second word to the second NAME, and so" +#~ msgstr "la primera paraula al primer NOM, la segona paraula al segon NOM, i" + +#~ msgid "" +#~ "on, with leftover words assigned to the last NAME. Only the characters" +#~ msgstr "aix? successivament, assignant-se les ?ltimes paraules als ?ltims" + +#~ msgid "found in $IFS are recognized as word delimiters. The return code is" +#~ msgstr "NOMs. Nom?s es reconeixen com a delimitadors els car?cters que es" + +#~ msgid "" +#~ "zero, unless end-of-file is encountered. If no NAMEs are supplied, the" +#~ msgstr "" +#~ "troben en $IFS. El codi de retorn ?s zero, mentre no es trobe el fi" + +#~ msgid "" +#~ "line read is stored in the REPLY variable. If the -r option is given," +#~ msgstr "" +#~ "de fitxer (EOF). Si no s'especifica NOMs, s'al?a la l?nia llegida en" + +#~ msgid "this signifies `raw' input, and backslash escaping is disabled. If" +#~ msgstr "" +#~ "la variable REPLY. Si s'especifica l'opci? \"-r\", aix? vol dir que es" + +#~ msgid "the `-p' option is supplied, the string supplied as an argument is" +#~ msgstr "" +#~ "tracta d'una entrada de dades directa (\"raw data\"), i es desactiva la" + +#~ msgid "" +#~ "output without a trailing newline before attempting to read. If -a is" +#~ msgstr "" +#~ "barra invertida d'escapada. Si s'especifica l'opci? \"-p\", la cadena" + +#~ msgid "" +#~ "supplied, the words read are assigned to sequential indices of ARRAY," +#~ msgstr "especificada com a par?metre es mostra sense salts de l?nia abans" + +#~ msgid "starting at zero. If -e is supplied and the shell is interactive," +#~ msgstr "" +#~ "d'intentar llegir-la. Si s'especifica l'opci? \"-a\", s'assignen les" + +#~ msgid "readline is used to obtain the line." +#~ msgstr "" +#~ "paraules llegides a ?n ?ndex seq?encial de MATRIU, incialitzant a\n" +#~ "zero. Si s'especifica l'opci? \"-e\" i l'int?rpret d'ordres ?s\n" +#~ "interactiu, es fa servir \"readline\" per a obtindre la l?nia." + +#~ msgid "is omitted, the return status is that of the last command." +#~ msgstr "N. Si s'omet N, l'estat del retorn ?s el de la darrera ordre." + +#~ msgid " -a Mark variables which are modified or created for export." +#~ msgstr "" +#~ " -a Marca les variables modificades o creades per a exportar-les." + +#~ msgid " -b Notify of job termination immediately." +#~ msgstr " -b Avisa immediatament de la finalitzaci? d'una tasca." + +#~ msgid " -e Exit immediately if a command exits with a non-zero status." +#~ msgstr "" +#~ " -e Ix immediatament si una ordre ix amb un estat distint de zero." + +#~ msgid " -f Disable file name generation (globbing)." +#~ msgstr " -f Desactiva la generaci? de noms de fitxer (globbing)." + +#~ msgid " -h Remember the location of commands as they are looked up." +#~ msgstr " -h Recorda la ubicaci? de les ordres quan siguen buscades." + +#~ msgid "" +#~ " -i Force the shell to be an \"interactive\" one. Interactive shells" +#~ msgstr "" +#~ " -i For?a l'int?rpret d'ordres el mode \"interactiu\". Aquest mode" + +#~ msgid " always read `~/.bashrc' on startup." +#~ msgstr " llegeix sempre ?~/.bashrc? en iniciar-se." + +#~ msgid " -k All assignment arguments are placed in the environment for a" +#~ msgstr "" +#~ " -k Ubica totes les assignacions de par?metres en l'entorn per una" + +#~ msgid " command, not just those that precede the command name." +#~ msgstr "" +#~ " ordre, no tan sols aquells que precedeix del nom de l'ordre." + +#~ msgid " -m Job control is enabled." +#~ msgstr " -m Activa el control de tasques." + +#~ msgid " -n Read commands but do not execute them." +#~ msgstr " -n Llegeix les ordres per? no els executa." + +#~ msgid " -o option-name" +#~ msgstr " -o nom-opci?" + +#~ msgid " Set the variable corresponding to option-name:" +#~ msgstr " Especifiqueu la variable corresponent per a nom-opci?:" + +#~ msgid " allexport same as -a" +#~ msgstr " allexport el mateix que -a" + +#~ msgid " braceexpand same as -B" +#~ msgstr " braceexpand el mateix que -B" + +#~ msgid " emacs use an emacs-style line editing interface" +#~ msgstr "" +#~ " emacs utilitza una interfa? d'edici? de l?nia de\n" +#~ " l'estil d'emacs." + +#~ msgid " errexit same as -e" +#~ msgstr " errexit el mateix que -e" + +#~ msgid " hashall same as -h" +#~ msgstr " hashall el mateix que -h" + +#~ msgid " histexpand same as -H" +#~ msgstr " histexpand el mateix que -H" + +#~ msgid " ignoreeof the shell will not exit upon reading EOF" +#~ msgstr "" +#~ " ignoreeof l'int?rpret d'ordres no terminar? fins llegir\n" +#~ " el fi de fitxer (EOF)." + +#~ msgid " interactive-comments" +#~ msgstr " interactive-comments" + +#~ msgid "" +#~ " allow comments to appear in interactive commands" +#~ msgstr "" +#~ " permet mostrar-se comentaris en les ordres\n" +#~ " interactives" + +#~ msgid " keyword same as -k" +#~ msgstr " keyword el mateix que -k" + +#~ msgid " monitor same as -m" +#~ msgstr " monitor el mateix que -m" + +#~ msgid " noclobber same as -C" +#~ msgstr " noclobber el mateix que -C" + +#~ msgid " noexec same as -n" +#~ msgstr " noexec el mateix que -n" + +#~ msgid " noglob same as -f" +#~ msgstr " noglob el mateix que -f" + +#~ msgid " notify save as -b" +#~ msgstr " notify el mateix que -b" + +#~ msgid " nounset same as -u" +#~ msgstr " nounset el mateix que -u" + +#~ msgid " onecmd same as -t" +#~ msgstr " onecmd el mateix que -t" + +#~ msgid " physical same as -P" +#~ msgstr " physical el mateix que -P" + +#~ msgid "" +#~ " posix change the behavior of bash where the default" +#~ msgstr "" +#~ " posix canvia el comportament de bash en l'operaci?" + +#~ msgid "" +#~ " operation differs from the 1003.2 standard to" +#~ msgstr " per defecte de l'est?ndard 1003.2 per a" + +#~ msgid " match the standard" +#~ msgstr " coincidir amb l'est?ndard" + +#~ msgid " privileged same as -p" +#~ msgstr " privileged el mateix que -p" + +#~ msgid " verbose same as -v" +#~ msgstr " verbose el mateix que -v" + +#~ msgid " vi use a vi-style line editing interface" +#~ msgstr "" +#~ " vi utilitza una intefa? d'edici? de l?nia de\n" +#~ " l'estil de ?vi?" + +#~ msgid " xtrace same as -x" +#~ msgstr " xtrace el mateix que -x" + +#~ msgid "" +#~ " -p Turned on whenever the real and effective user ids do not match." +#~ msgstr "" +#~ " -p S'activa quan no coincideixen els identificadors d'usuari real \n" +#~ " i efectiu." + +#~ msgid " Disables processing of the $ENV file and importing of shell" +#~ msgstr " Desactiva el proc?s del fitxer $ENV i la importaci? de les" + +#~ msgid "" +#~ " functions. Turning this option off causes the effective uid and" +#~ msgstr " funcions de l'int?rpret d'ordres. Si es desactiva aquesta" + +#~ msgid " gid to be set to the real uid and gid." +#~ msgstr "" +#~ " opci?, s'estableix l'identificador d'usuari (uid) i\n" +#~ " l'identificador de grup (gid) efectius per l'uid i gid reals." + +#~ msgid " -t Exit after reading and executing one command." +#~ msgstr " -t Ix despr?s de llegir i executar una ordre." + +#~ msgid " -u Treat unset variables as an error when substituting." +#~ msgstr "" +#~ " -u Considerar les variables no inicialitzades com un error quan\n" +#~ " se substitu?sca." + +#~ msgid " -v Print shell input lines as they are read." +#~ msgstr "" +#~ " -v Imprimeix les l?nies d'entrada de dades de l'int?rpret\n" +#~ " d'ordres mentre es llegeixen." + +#~ msgid " -x Print commands and their arguments as they are executed." +#~ msgstr "" +#~ " -x Imprimeix les ordres i els seus par?metres mentre s'executen." + +#~ msgid " -B the shell will perform brace expansion" +#~ msgstr " -B l'int?rpret d'ordres realitzar? una expansi? de claus." + +#~ msgid " -H Enable ! style history substitution. This flag is on" +#~ msgstr " -H Activa l'estil ! en la substituci? de l'hist?ric. Aquest" + +#~ msgid " by default." +#~ msgstr " senyalador est? marcat per defecte." + +#~ msgid " -C If set, disallow existing regular files to be overwritten" +#~ msgstr " -C Evita que els fitxers regulars siguen sobreescrits per la" + +#~ msgid " by redirection of output." +#~ msgstr " redirecci? de l'eixida de dades." + +#~ msgid " -P If set, do not follow symbolic links when executing commands" +#~ msgstr "" +#~ " -P No rastreja els enlla?os simb?lics quan s'executa ordres com " + +#~ msgid " such as cd which change the current directory." +#~ msgstr " per exemple cd que canvia el directori actual." + +#~ msgid "Using + rather than - causes these flags to be turned off. The" +#~ msgstr "" +#~ "Si feu servir el signe \"+\" en voltes del signe \"-\" desmarcareu els\n" +#~ "senyaladors. Tamb? es poden utilitzar els senyaladors des de la" + +#~ msgid "flags can also be used upon invocation of the shell. The current" +#~ msgstr "invocaci? de l'int?rpret d'ordres. Es pot trobar la configuraci?" + +#~ msgid "" +#~ "set of flags may be found in $-. The remaining n ARGs are positional" +#~ msgstr "actual dels senyaladors en $-. Els restants PAR?METRES n s?n" + +#~ msgid "parameters and are assigned, in order, to $1, $2, .. $n. If no" +#~ msgstr "" +#~ "par?metres posicionals i estan assignats, en ordre, a $1, $2, ... $n." + +#~ msgid "ARGs are given, all shell variables are printed." +#~ msgstr "" +#~ "Si no s'especifiquen els PAR?METRES, es mostraran totes les variables de\n" +#~ "l'int?rpret d'ordres." + +#~ msgid "For each NAME, remove the corresponding variable or function. Given" +#~ msgstr "" +#~ "Esborra la variable o funci? corresponent per a cada NOM. Amb l'opci? " + +#~ msgid "the `-v', unset will only act on variables. Given the `-f' flag," +#~ msgstr "" +#~ "\"-v\", ?unset? opera nom?s en les variables. Amb el senyalador \"-f\"," + +#~ msgid "unset will only act on functions. With neither flag, unset first" +#~ msgstr "nom?s en funcions. Amb cap dels dos senyaladors, ?unset? primer" + +#~ msgid "tries to unset a variable, and if that fails, then tries to unset a" +#~ msgstr "" +#~ "intentar? eliminar una variable, i si en falla, aleshores ho intenta" + +#~ msgid "" +#~ "function. Some variables (such as PATH and IFS) cannot be unset; also" +#~ msgstr "" +#~ "amb una funci?. Algunes variables (aix? com CAMI_ACCES i IFS) no es" + +#~ msgid "see readonly." +#~ msgstr "poden esborrar (veure l'opci? \"readonly\")." + +#~ msgid "NAMEs are marked for automatic export to the environment of" +#~ msgstr "" +#~ "S'assenyalen els NOMs per a exportar-los autom?ticament a l'entorn de " + +#~ msgid "subsequently executed commands. If the -f option is given," +#~ msgstr "" +#~ "les ordres executades subseq?entment. Si s'especifica l'opci? \"-f\", " + +#~ msgid "the NAMEs refer to functions. If no NAMEs are given, or if `-p'" +#~ msgstr "" +#~ "els NOMs fan refer?ncia a les funcions. Si no s'especifica NOMs, o si " + +#~ msgid "is given, a list of all names that are exported in this shell is" +#~ msgstr "" +#~ "s'especifica \"-p\", es mostra una llista de tots els noms exportats cap " + +#~ msgid "printed. An argument of `-n' says to remove the export property" +#~ msgstr "aquest int?rpret d'ordres. Amb \"-n\" s'esborra les propietats " + +#~ msgid "from subsequent NAMEs. An argument of `--' disables further option" +#~ msgstr "d'exportaci? per als NOMs subseq?ents. Amb \"--\" s'atura el " + +#~ msgid "processing." +#~ msgstr "tractament subseq?ent de les opcions." + +#~ msgid "" +#~ "The given NAMEs are marked readonly and the values of these NAMEs may" +#~ msgstr "" +#~ "Els NOMs especificats es marquen amb l'atribut de nom?s lectura, els" + +#~ msgid "not be changed by subsequent assignment. If the -f option is given," +#~ msgstr "" +#~ "valors dels quals no poden ser canviats per assignacions subseq?ents." + +#~ msgid "then functions corresponding to the NAMEs are so marked. If no" +#~ msgstr "" +#~ "Si s'especifica l'opci? \"-f\", aleshores les funcions corresponents als" + +#~ msgid "" +#~ "arguments are given, or if `-p' is given, a list of all readonly names" +#~ msgstr "NOMs tamb? se'n marquen. Si no s'especifica par?metres, o si" + +#~ msgid "" +#~ "is printed. An argument of `-n' says to remove the readonly property" +#~ msgstr "" +#~ "s'especifica \"-p\", es mostra una llista de tots els noms amb l'atribut" + +#~ msgid "from subsequent NAMEs. The `-a' option means to treat each NAME as" +#~ msgstr "de nom?s lectura. Amb l'opci? \"-n\" s'esborra l'atribut de nom?s" + +#~ msgid "an array variable. An argument of `--' disables further option" +#~ msgstr "" +#~ "lectura pels NOMs subseq?ents. Amb \"-a\" tracta cada NOM com una\n" +#~ "variable de matriu. Amb el par?metre \"--\" s'atura el tractament\n" +#~ "subseq?ent de les opcions." + +#~ msgid "not given, it is assumed to be 1." +#~ msgstr "Si no s'especifica N, s'assumeix el valor com a 1." + +#~ msgid "Read and execute commands from FILENAME and return. The pathnames" +#~ msgstr "Llegeix i executa ordres de FITXER i retorna. Es fan servir els" + +#~ msgid "in $PATH are used to find the directory containing FILENAME." +#~ msgstr "camins d'acc?s de $PATH per a trobar el directori que cont? FITXER." + +#~ msgid "Suspend the execution of this shell until it receives a SIGCONT" +#~ msgstr "" +#~ "Susp?n l'execuci? d'aquest int?rpret d'ordres fins que reba una senyal" + +#~ msgid "signal. The `-f' if specified says not to complain about this" +#~ msgstr "" +#~ "SIGCONT. Si s'especifica \"-f\" no es mostrar? cap missatge d'av?s de" + +#~ msgid "being a login shell if it is; just suspend anyway." +#~ msgstr "" +#~ "si l'int?rpret ?s un d'inici de sessi? (shell login); simplement ho susp?" +#~ "n de\n" +#~ "qualsevol manera." + +#~ msgid "Exits with a status of 0 (trueness) or 1 (falseness) depending on" +#~ msgstr "Ix amb l'estat de 0 (cert) o 1 (fals) depenent de l'avaluaci? de " + +#~ msgid "the evaluation of EXPR. Expressions may be unary or binary. Unary" +#~ msgstr "l'EXPRESSIO. Les expressions poden ser un?ries o bin?ries. Les" + +#~ msgid "expressions are often used to examine the status of a file. There" +#~ msgstr "" +#~ "expressions un?ries sovint es fan servir per a examinar l'estat d'un" + +#~ msgid "are string operators as well, and numeric comparison operators." +#~ msgstr "fitxer. Tamb? hi ha operadors de cadenes i de comparaci? num?rica." + +#~ msgid "File operators:" +#~ msgstr "Operadors de fitxer:" + +#~ msgid " -b FILE True if file is block special." +#~ msgstr " -b FITXER Cert si el fitxer ?s un bloc especial." + +#~ msgid " -c FILE True if file is character special." +#~ msgstr " -c FITXER Cert si el fitxer ?s un car?cter especial." + +#~ msgid " -d FILE True if file is a directory." +#~ msgstr " -d FITXER Cert si el fitxer ?s un directori." + +#~ msgid " -e FILE True if file exists." +#~ msgstr " -e FITXER Cert si el fitxer existeix." + +#~ msgid " -f FILE True if file exists and is a regular file." +#~ msgstr "" +#~ " -f FITXER Cert si el fitxer existeix i ?s un fitxer normal." + +#~ msgid " -g FILE True if file is set-group-id." +#~ msgstr " -g FITXER Cert si el fitxer ?s set-group-id." + +#~ msgid " -h FILE True if file is a symbolic link. Use \"-L\"." +#~ msgstr "" +#~ " -h FITXER Cert si el fitxer ?s un enlla? simb?lic.\n" +#~ " Utilitzeu \"-L\"." + +#~ msgid " -L FILE True if file is a symbolic link." +#~ msgstr " -L FITXER Cert si el fitxer ?s un enlla? simb?lic." + +#~ msgid " -k FILE True if file has its \"sticky\" bit set." +#~ msgstr "" +#~ " -k FITXER Cert si el fitxer t? activat el seu bit \"sticky\"." + +#~ msgid " -p FILE True if file is a named pipe." +#~ msgstr " -p FITXER Cert si el fitxer ?s un conducte anomenat." + +#~ msgid " -r FILE True if file is readable by you." +#~ msgstr " -r FITXER Cert si podeu llegir el fitxer." + +#~ msgid " -s FILE True if file exists and is not empty." +#~ msgstr " -s FITXER Cert si el fitxer existeix i no ?s buit." + +#~ msgid " -S FILE True if file is a socket." +#~ msgstr " -S FITXER Cert si el fitxer ?s un s?col." + +#~ msgid " -t FD True if FD is opened on a terminal." +#~ msgstr " -t FD Cert si FD ?s obert en una terminal." + +#~ msgid " -u FILE True if the file is set-user-id." +#~ msgstr " -u FITXER Cert si el fitxer ?s set-user-id." + +#~ msgid " -w FILE True if the file is writable by you." +#~ msgstr " -w FITXER Cert si podeu escriure el fitxer." + +#~ msgid " -x FILE True if the file is executable by you." +#~ msgstr " -w FITXER Cert si podeu escriure el fitxer." + +#~ msgid " -O FILE True if the file is effectively owned by you." +#~ msgstr " -O FITXER Cert si sou el propietari del fitxer." + +#~ msgid "" +#~ " -G FILE True if the file is effectively owned by your group." +#~ msgstr " -G FITXER Cert si sou del grup propietari del fitxer." + +#~ msgid " FILE1 -nt FILE2 True if file1 is newer than (according to" +#~ msgstr "" +#~ " FITXER1 -nt FITXER2\n" +#~ " Cert si fitxer1 ?s tan recent com fitxer2" + +#~ msgid " modification date) file2." +#~ msgstr " (d'acord amb les dates d'?ltima modificaci?)." + +#~ msgid " FILE1 -ot FILE2 True if file1 is older than file2." +#~ msgstr "" +#~ " FITXER1 -ot FITXER2\n" +#~ " Cert si fitxer1 ?s tan antic com fitxer2." + +#~ msgid " FILE1 -ef FILE2 True if file1 is a hard link to file2." +#~ msgstr "" +#~ " FITXER1 -ef FITXER2\n" +#~ " Cert si fitxer 1 ?s un enlla? fort cap a fitxer2." + +#~ msgid "String operators:" +#~ msgstr "Operadors de cadena:" + +#~ msgid " -z STRING True if string is empty." +#~ msgstr " -z CADENA Cert si la cadena ?s bu?da." + +#~ msgid " -n STRING" +#~ msgstr " -n CADENA" + +#~ msgid " STRING True if string is not empty." +#~ msgstr " CADENA Cert si la cadena no ?s bu?da." + +#~ msgid " STRING1 = STRING2" +#~ msgstr " CADENA1 = CADENA2" + +#~ msgid " True if the strings are equal." +#~ msgstr " Cert si les cadenes s?n iguals." + +#~ msgid " STRING1 != STRING2" +#~ msgstr " CADENA1 != CADENA2" + +#~ msgid " True if the strings are not equal." +#~ msgstr " Cert si les cadenes s?n diferents." + +#~ msgid " STRING1 < STRING2" +#~ msgstr " CADENA1 < CADENA2" + +#~ msgid "" +#~ " True if STRING1 sorts before STRING2 lexicographically" +#~ msgstr "" +#~ " Cert si CADENA1 precedeix alfab?ticament CADENA2." + +#~ msgid " STRING1 > STRING2" +#~ msgstr " CADENA1 > CADENA2" + +#~ msgid "" +#~ " True if STRING1 sorts after STRING2 lexicographically" +#~ msgstr "" +#~ " Cert si CADENA1 poscedeix alfab?ticament CADENA2." + +#~ msgid "Other operators:" +#~ msgstr "Altres operadors:" + +#~ msgid " ! EXPR True if expr is false." +#~ msgstr " ! EXPR Cert si l'expressi? ?s falsa." + +#~ msgid " EXPR1 -a EXPR2 True if both expr1 AND expr2 are true." +#~ msgstr " EXPR1 -a EXPR2 Cert si ambdues expressions s?n certes." + +#~ msgid " EXPR1 -o EXPR2 True if either expr1 OR expr2 is true." +#~ msgstr " EXPR1 -o EXPR2 Cert si cap d'ambdues expresi?ns s?n certes." + +#~ msgid " arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne," +#~ msgstr " arg1 OP arg2 C?lcul aritm?tic. OP ?s una de les seg?ents" + +#~ msgid " -lt, -le, -gt, or -ge." +#~ msgstr " opcions: -eq, -ne, -lt, -le, -gt, or -ge." + +#~ msgid "Arithmetic binary operators return true if ARG1 is equal, not-equal," +#~ msgstr "Els operadors aritm?tics binaris retornen un valor de cert si " + +#~ msgid "" +#~ "less-than, less-than-or-equal, greater-than, or greater-than-or-equal" +#~ msgstr "" +#~ "PARAMETRE1 ?s 'igual', 'diferent', 'menys que', 'menys o igual que'," + +#~ msgid "than ARG2." +#~ msgstr "'m?s que', o 'm?s o igual que', el PARAMETRE2." + +#~ msgid "This is a synonym for the \"test\" builtin, but the last" +#~ msgstr "Es tracta del sin?nim de l'ordre integrada ?test?, per? el darrer " + +#~ msgid "the shell." +#~ msgstr "processos des de l'int?rpret d'ordres." + +#~ msgid "The command ARG is to be read and executed when the shell receives" +#~ msgstr "L'ordre especificada en PARAMETRE s'ha de llegir i executar quan" + +#~ msgid "signal(s) SIGNAL_SPEC. If ARG is absent all specified signals are" +#~ msgstr "l'int?rpret d'ordres rep alguna senyal de SIGNAL_SPEC. Si s'omet" + +#~ msgid "reset to their original values. If ARG is the null string each" +#~ msgstr "PARAMETRE s'inicialitzen totes les senyals especificades als seus" + +#~ msgid "SIGNAL_SPEC is ignored by the shell and by the commands it invokes." +#~ msgstr "corresponents valors originals Si el PARAMETRE ?s una cadena buida" + +#~ msgid "If SIGNAL_SPEC is EXIT (0) the command ARG is executed on exit from" +#~ msgstr "" +#~ "l'int?rpret, i les ordres que els invoquen, ignoren cada SIGNAL_SPEC." + +#~ msgid "the shell. If SIGNAL_SPEC is DEBUG, ARG is executed after every" +#~ msgstr "Si s'especifica SIGNAL_SPEC com EXIT(0), s'executa l'ordre" + +#~ msgid "command. If ARG is `-p' then the trap commands associated with" +#~ msgstr "" +#~ "especificada en PARAMETRE despr?s de la finalitzaci? de la sessi? de\n" +#~ "l'int?rpret d'ordres. Si s'especifica DEBUG en SIGNAL_SPEC, s'executa" + +#~ msgid "each SIGNAL_SPEC are displayed. If no arguments are supplied or if" +#~ msgstr "" +#~ "l'ordre especificada en PARAMETRE despr?s de la finalitzaci? de la\n" +#~ "sessi? de l'int?rpret d'ordres. Si s'especifica \"-p\" en PARAMETRE" + +#~ msgid "only `-p' is given, trap prints the list of commands associated with" +#~ msgstr "" +#~ "aleshores es mostren les ordres de ?trap? associades amb cadascuna de\n" +#~ "les especificacions del SENYAL. Si no s'especifica cap par?metre," + +#~ msgid "" +#~ "each signal number. SIGNAL_SPEC is either a signal name in " +#~ msgstr "" +#~ "?trap? mostra una llista d'ordres associades amb cadascun dels n?meros\n" +#~ "de senyal. L'especificaci? del SENYAL pot ser b? un nom de senyal" + +#~ msgid "" +#~ "or a signal number. `trap -l' prints a list of signal names and their" +#~ msgstr "" +#~ "especificat en , b? tindre un valor num?ric. L'ordre ?trap\n" +#~ "-l? mostra una llista dels noms de senyal i els seus corresponents" + +#~ msgid "corresponding numbers. Note that a signal can be sent to the shell" +#~ msgstr "n?meros. Observeu que una senyal pot ser lliurada a l'int?rpret" + +#~ msgid "with \"kill -signal $$\"." +#~ msgstr "d'ordres amb ?kill -signal $$?." + +#~ msgid "For each NAME, indicate how it would be interpreted if used as a" +#~ msgstr "" +#~ "Per a cada NOM, indica com s'hauria d'interpretar si es fa servir com " + +#~ msgid "If the -t option is used, returns a single word which is one of" +#~ msgstr "" +#~ "Si es fa servir l'opci? \"-t\", retorna una paraula ?nica que pot ser" + +#~ msgid "" +#~ "`alias', `keyword', `function', `builtin', `file' or `', if NAME is an" +#~ msgstr "" +#~ "\"alias\", \"keyword\", \"function\", \"builtin\", \"file\" o \"\", si un " +#~ "NOM ?s" + +#~ msgid "" +#~ "alias, shell reserved word, shell function, shell builtin, disk file," +#~ msgstr "" +#~ "un ?lies, una paraula reservada, una funci?, una ordre integrada, un" + +#~ msgid "or unfound, respectively." +#~ msgstr "fitxer del disc o no trobat, respectivament." + +#~ msgid "If the -p flag is used, either returns the name of the disk file" +#~ msgstr "" +#~ "Si es fa servir l'opci? \"-p\", o b? retorna el nom del fitxer del disc" + +#~ msgid "that would be executed, or nothing if -t would not return `file'." +#~ msgstr "" +#~ "que es podria executar, o b? no retorna res si l'opci? \"-t\" no\n" +#~ "retornara \"file\"." + +#~ msgid "If the -a flag is used, displays all of the places that contain an" +#~ msgstr "" +#~ "Si es fa servir el senyalador \"-a\", mostra totes les ubicacions que" + +#~ msgid "" +#~ "executable named `file'. This includes aliases and functions, if and" +#~ msgstr "" +#~ "contenen un executable anomenat \"file\". Aix? inclou per a ?lies i" + +#~ msgid "only if the -p flag is not also used." +#~ msgstr "" +#~ "funcions si, i nom?s si, el senyalador \"-p\" tampoc no es fa servir." + +#~ msgid "Type accepts -all, -path, and -type in place of -a, -p, and -t," +#~ msgstr "" +#~ "L'ordre integrada ?type? accepta que s'especifique \"-all\", \"-path\", i" + +#~ msgid "respectively." +#~ msgstr "" +#~ "\"-type\", per a les opcions de \"-a\", \"-p\", i \"-t\", respectivament." + +#~ msgid "Ulimit provides control over the resources available to processes" +#~ msgstr "L'ordre integrada ?ulimit? inclou el control sobre els recursos" + +#~ msgid "started by the shell, on systems that allow such control. If an" +#~ msgstr "disponibles als processos iniciats per l'int?rpret, en sistemes que" + +#~ msgid "option is given, it is interpreted as follows:" +#~ msgstr "" +#~ "ho permeten. Si s'especifica una opci?, ser? especificada com\n" +#~ "segueix:" + +#~ msgid " -S\tuse the `soft' resource limit" +#~ msgstr " -S\tutilitza el l?mit dels recursos l?gics" + +#~ msgid " -H\tuse the `hard' resource limit" +#~ msgstr " -H\tutilitza el l?mit dels recursos de maquinari" + +#~ msgid " -a\tall current limits are reported" +#~ msgstr " -a\tmostra tots els l?mits actuals" + +#~ msgid " -c\tthe maximum size of core files created" +#~ msgstr "" +#~ " -c\tlimita la grand?ria m?xima dels fitxers de bolcat de mem?ria" + +#~ msgid " -d\tthe maximum size of a process's data segment" +#~ msgstr " -d\tlimita la grand?ria m?xima d'un segment de proc?s de dades" + +#~ msgid " -m\tthe maximum resident set size" +#~ msgstr " -m\tlimita la grand?ria m?xima d'una variable resident" + +#~ msgid " -s\tthe maximum stack size" +#~ msgstr " -s\tlimita la grand?ria m?xima de la pila" + +#~ msgid " -t\tthe maximum amount of cpu time in seconds" +#~ msgstr " -t\tlimita el temps m?xim d'an?lisi per la UCP en segons" + +#~ msgid " -f\tthe maximum size of files created by the shell" +#~ msgstr " -f\tlimita la grand?ria d'un fitxer creat per l'int?rpret" + +#~ msgid " -p\tthe pipe buffer size" +#~ msgstr " -p\tlimita la grand?ria de la mem?ria interm?dia d'un conducte" + +#~ msgid " -n\tthe maximum number of open file descriptors" +#~ msgstr " -n\tlimita el nombre m?xim utilitzable de descriptors de fitxer" + +#~ msgid " -u\tthe maximum number of user processes" +#~ msgstr " -u\tlimita el nombre m?xim de processos per usuari" + +#~ msgid " -v\tthe size of virtual memory" +#~ msgstr " -v\tlimita la grand?ria de la mem?ria virtual" + +#~ msgid "If LIMIT is given, it is the new value of the specified resource." +#~ msgstr "Si s'especifica LIMIT, aquest ser? el nou valor del recurs " + +#~ msgid "Otherwise, the current value of the specified resource is printed." +#~ msgstr "especificat. Altrament, mostra el valor actual del recurs" + +#~ msgid "If no option is given, then -f is assumed. Values are in 1k" +#~ msgstr "especificat. Si no s'especifica cap opci?, aleshores s'assumeix" + +#~ msgid "increments, except for -t, which is in seconds, -p, which is in" +#~ msgstr "" +#~ "l'opci? \"-f\". Els valors s'especifiquen en increments de 1k, tret del" + +#~ msgid "increments of 512 bytes, and -u, which is an unscaled number of" +#~ msgstr "" +#~ "cas de l'opci? \"-t\", que es en segons, de l'opci? \"-p\", que es tracta" + +#~ msgid "processes." +#~ msgstr "" +#~ "d'increments de 512 octets, i de l'opci? \"-u\", que ?s un recompte\n" +#~ "num?ric de processos." + +#~ msgid "" +#~ "The user file-creation mask is set to MODE. If MODE is omitted, or if" +#~ msgstr "" +#~ "La m?scara dels modes d'acc?s durant la creaci? d'un fitxer ?s MODE." + +#~ msgid "" +#~ "`-S' is supplied, the current value of the mask is printed. The `-S'" +#~ msgstr "" +#~ "Si s'omet MODE, o si s'especifica l'opci? \"-S\", es mostra el valor" + +#~ msgid "" +#~ "option makes the output symbolic; otherwise an octal number is output." +#~ msgstr "" +#~ "actual de la m?scara. Amb l'opci? \"-S\" es mostra de manera simb?lica;" + +#~ msgid "If MODE begins with a digit, it is interpreted as an octal number," +#~ msgstr "" +#~ "d'altra manera l'eixida de dades ?s n?meros octals. Si MODE comen?a" + +#~ msgid "" +#~ "otherwise it is a symbolic mode string like that accepted by chmod(1)." +#~ msgstr "" +#~ "per un d?git, aquest ser? interpretat com un n?mero octal, altrament" + +#~ msgid "" +#~ "Wait for the specified process and report its termination status. If" +#~ msgstr "s'accepten els valors simb?lics de ?chmod? (veure ?man?, secci? 1)." + +#~ msgid "N is not given, all currently active child processes are waited for," +#~ msgstr "Espera la fi d'execuci? d'un proc?s especificat i informa el seu" + +#~ msgid "and the return code is zero. N may be a process ID or a job" +#~ msgstr "" +#~ "estat de fi d'execuci?. Si no s'especifica N, s'espera per tots els" + +#~ msgid "specification; if a job spec is given, all processes in the job's" +#~ msgstr "" +#~ "processos fills actuals, i el codi de retorn ?s zero. La variable N" + +#~ msgid "pipeline are waited for." +#~ msgstr "" +#~ "pot ser un IDentificador de proc?s o l'especificaci? d'una tasca; si\n" +#~ "s'especifica una especificaci? de tasca, s'esperen per tots els\n" +#~ "processos dels conductes." + +#~ msgid "and the return code is zero. N is a process ID; if it is not given," +#~ msgstr "i el codi de retorn ?s zero. El par?metre N ?s un IDentificador de" + +#~ msgid "all child processes of the shell are waited for." +#~ msgstr "" +#~ "proc?s; si aquest no s'hi especifica, s'espera per tots els processos\n" +#~ "fills de l'int?rpret d'ordres." + +#~ msgid "The `for' loop executes a sequence of commands for each member in a" +#~ msgstr "" +#~ "L'ordre de repetici? ?for? executa una seq??ncia d'ordres per a cada" + +#~ msgid "" +#~ "list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is" +#~ msgstr "" +#~ "item de la llista. Si no s'especifica l'expressi? \"in WORDS...;\"," + +#~ msgid "" +#~ "assumed. For each element in WORDS, NAME is set to that element, and" +#~ msgstr "" +#~ "aleshores es fa servir el contingut de \"$@\". Per a cada element que" + +#~ msgid "the COMMANDS are executed." +#~ msgstr "" +#~ "hi ha en PARAULES, s'inicialitza NOM a aquest element, i s'executen\n" +#~ "les ORDRES." + +#~ msgid "The WORDS are expanded, generating a list of words. The" +#~ msgstr "S'expandeix les PARAULES, generant-se una llista de paraules. Es" + +#~ msgid "set of expanded words is printed on the standard error, each" +#~ msgstr "mostra el conjunt de les paraules expandides per l'eixida d'error" + +#~ msgid "preceded by a number. If `in WORDS' is not present, `in \"$@\"'" +#~ msgstr "" +#~ "est?ndard, precedit d'un n?mero. Si no s'especifica l'expressi? \"in" + +#~ msgid "is assumed. The PS3 prompt is then displayed and a line read" +#~ msgstr "WORDS\", es fa servir el contingut de \"$@\". Aleshores s'exhibeix" + +#~ msgid "from the standard input. If the line consists of the number" +#~ msgstr "l'indicador de PS3 i es llegeix la l?nia des de l'entrada de dades" + +#~ msgid "corresponding to one of the displayed words, then NAME is set" +#~ msgstr "" +#~ "est?ndard. Si la l?nia consisteix d'un n?mero corresponent a una de" + +#~ msgid "to that word. If the line is empty, WORDS and the prompt are" +#~ msgstr "les paraules exhibides, aleshores el valor de la variable NOM" + +#~ msgid "redisplayed. If EOF is read, the command completes. Any other" +#~ msgstr "" +#~ "s'inicialitza amb aquesta paraula. Si la l?nia ?s buida, la variable" + +#~ msgid "value read causes NAME to be set to null. The line read is saved" +#~ msgstr "" +#~ "PARAULES i l'indicador s'exhibeixen una altra vegada. Si es detecta" + +#~ msgid "in the variable REPLY. COMMANDS are executed after each selection" +#~ msgstr "" +#~ "un la fi del fitxer (EOF), l'ordre termina. Si es llegeix qualsevol" + +#~ msgid "until a break or return command is executed." +#~ msgstr "" +#~ "altre valor, s'inicialitzar? el valor de NOM com nul. La l?nia\n" +#~ "llegida s'al?a en la variable REPLY. Les ordres al?ades en el\n" +#~ "par?metre ORDRES s'executa despr?s de cada selecci? fins que s'execute\n" +#~ "una ordre de ?break? o ?return?." + +#~ msgid "`|' is used to separate multiple patterns." +#~ msgstr "" +#~ "concord?ncia del valor en PARAULA amb del valor en PATRO. Es fa\n" +#~ "servir el signe \"|\" per a separar m?ltiples patrons." + +#~ msgid "" +#~ "The if COMMANDS are executed. If the exit status is zero, then the then" +#~ msgstr "S'executen els ORDRES ?if?. Si l'estat d'eixida ?s zero, aleshores" + +#~ msgid "" +#~ "COMMANDS are executed. Otherwise, each of the elif COMMANDS are executed" +#~ msgstr "" +#~ "s'executen les ORDRES ?then?. Altrament, s'executen cadascun de les" + +#~ msgid "" +#~ "in turn, and if the exit status is zero, the corresponding then COMMANDS" +#~ msgstr "ORDRES de ?elif?, i si l'estat d'eixida ?s zero, les corresponents" + +#~ msgid "" +#~ "are executed and the if command completes. Otherwise, the else COMMANDS" +#~ msgstr "ORDRES de ?else? s'executen, si n'hi han. L'estat d'eixida ?s el" + +#~ msgid "" +#~ "are executed, if present. The exit status is the exit status of the last" +#~ msgstr "corresponent de la darrera ordre executada, o zero si no hi ha cap" + +#~ msgid "command executed, or zero if no condition tested true." +#~ msgstr "condici? resolta com a certa." + +#~ msgid "`while' COMMANDS has an exit status of zero." +#~ msgstr "de la instrucci? ?while? tinga un estat d'eixida igual a zero." + +#~ msgid "`until' COMMANDS has an exit status which is not zero." +#~ msgstr "de la instrucci? ?until? tinga un estat d'eixida que no siga zero." + +#~ msgid "Create a simple command invoked by NAME which runs COMMANDS." +#~ msgstr "Crea una ordre simple invocada pel NOM que executa ORDRES. Els " + +#~ msgid "Arguments on the command line along with NAME are passed to the" +#~ msgstr "" +#~ "par?metres especificats al llarg de la l?nia de l'ordre es passen a la" + +#~ msgid "function as $0 .. $n." +#~ msgstr "funci? com a $0 ... $n." + +#~ msgid "entire set of commands." +#~ msgstr "redireccionar un conjunt sencer d'ordres." + +#~ msgid "This is similar to the `fg' command. Resume a stopped or background" +#~ msgstr "A?? ?s semblant amb qu? passa amb l'ordre ?fg?. Repr?n una tasca " + +#~ msgid "job. If you specifiy DIGITS, then that job is used. If you specify" +#~ msgstr "" +#~ "aturada o ubicada en segon pla. Si especifiqueu DIGITS, aleshores es" + +#~ msgid "" +#~ "WORD, then the job whose name begins with WORD is used. Following the" +#~ msgstr "fa servir aquesta tasca. Si especifiqueu PARAULES, aleshores es fa" + +#~ msgid "job specification with a `&' places the job in the background." +#~ msgstr "" +#~ "servir la tasca, el nom de la qual comence pel valor en PARAULA. Si\n" +#~ "s'especifica la tasca comen?ant pel signe \"&\" s'ubica la tasca en\n" +#~ "segon pla." + +#~ msgid "BASH_VERSION The version numbers of this Bash." +#~ msgstr "BASH_VERSION Cont? la versi? de Bash." + +#~ msgid "CDPATH A colon separated list of directories to search" +#~ msgstr "CDPATH Cont? una llista de directoris, separats" + +#~ msgid "\t\twhen the argument to `cd' is not found in the current" +#~ msgstr "" +#~ " pel signe de dos punts, per a cercar quan el par?metre" + +#~ msgid "\t\tdirectory." +#~ msgstr "" +#~ " especificat per a l'ordre ?cd? no es troba en el\n" +#~ " directori actual." + +#~ msgid "" +#~ "HISTFILE The name of the file where your command history is stored." +#~ msgstr "" +#~ "HISTFILE Cont? el nom del fitxer on ?s al?ada l'hist?ric\n" +#~ " d'ordres executades." + +#~ msgid "HISTFILESIZE The maximum number of lines this file can contain." +#~ msgstr "" +#~ "HISTFILESIZE Cont? el nombre m?xim de l?nies que un fitxer pot \n" +#~ " contindre." + +#~ msgid "HISTSIZE The maximum number of history lines that a running" +#~ msgstr "HISTSIZE Cont? el nombre m?xim de l?nies de l'hist?ric que " + +#~ msgid "\t\tshell can access." +#~ msgstr " l'int?rpret d'ordres pot accedir." + +#~ msgid "HOME The complete pathname to your login directory." +#~ msgstr "" +#~ "HOME Cont? el nom cam? d'acc?s cap el directori de la\n" +#~ " vostra sessi? d'usuari." + +#~ msgid "" +#~ "HOSTTYPE The type of CPU this version of Bash is running under." +#~ msgstr "" +#~ "HOSTTYPE Cont? la mena de CPU sota la qual aquesta versi?\n" +#~ " de bash est? corrent." + +#~ msgid "" +#~ "IGNOREEOF Controls the action of the shell on receipt of an EOF" +#~ msgstr "" +#~ "IGNOREOEOF Controla l'acci? de l'int?rpret d'ordres quan rep un" + +#~ msgid "\t\tcharacter as the sole input. If set, then the value" +#~ msgstr " car?cter de fi de fitxer (EOF) com a ?nica entrada." + +#~ msgid "\t\tof it is the number of EOF characters that can be seen" +#~ msgstr " Si s'activa, aleshores el seu valor ?s el nombre de" + +#~ msgid "\t\tin a row on an empty line before the shell will exit" +#~ msgstr "" +#~ " car?cters EOF que pot ser mostrat en un afilera d'una" + +#~ msgid "\t\t(default 10). When unset, EOF signifies the end of input." +#~ msgstr "" +#~ " l?nia bu?da despr?s de que l'int?rpret eixir? (per\n" +#~ " omissi? el valor ?s 10). Quan ?s desactivat, EOF vol\n" +#~ " dir que s'ha finalitzat l'entrada de dades." + +#~ msgid "MAILCHECK\tHow often, in seconds, Bash checks for new mail." +#~ msgstr "" +#~ "MAILCHECK Cont? el temps, en segons, pel qual bash cada vegada \n" +#~ " comprova si hi ha nou correu." + +#~ msgid "MAILPATH\tA colon-separated list of filenames which Bash checks" +#~ msgstr "MAILPATH Cont? una llista de noms de fitxers, separats pel " + +#~ msgid "\t\tfor new mail." +#~ msgstr " signe \":\", on Bash comprova si hi ha correu nou." + +#~ msgid "OSTYPE\t\tThe version of Unix this version of Bash is running on." +#~ msgstr "" +#~ "OSTYPE Cont? la versi? d'Unix sota la qual aquesta versi? de \n" +#~ " Bash est? corrent." + +#~ msgid "PATH A colon-separated list of directories to search when" +#~ msgstr "PATH Cont? una llista de directoris, separats pel signe " + +#~ msgid "\t\tlooking for commands." +#~ msgstr " \":\", per on es recorrer? quan es busca una ordre." + +#~ msgid "PROMPT_COMMAND A command to be executed before the printing of each" +#~ msgstr "" +#~ "PROMPT_COMMAND Cont? l'ordre que s'executar? despr?s de mostrar-se " + +#~ msgid "\t\tprimary prompt." +#~ msgstr " cada indicador primari." + +#~ msgid "PS1 The primary prompt string." +#~ msgstr "PS1 Cont? la cadena de l'indicador primari." + +#~ msgid "PS2 The secondary prompt string." +#~ msgstr "PS2 Cont? la cadena de l'indicador secundari." + +#~ msgid "TERM The name of the current terminal type." +#~ msgstr "TERM Cont? el nom de la mena de terminal actual." + +#~ msgid "auto_resume Non-null means a command word appearing on a line by" +#~ msgstr "auto_resume Cont? el nom de l'ordre que es buscar? primer d'una" + +#~ msgid "\t\titself is first looked for in the list of currently" +#~ msgstr "" +#~ " llista de tasques actualment aturades. Si se'n troba," + +#~ msgid "\t\tstopped jobs. If found there, that job is foregrounded." +#~ msgstr "" +#~ " aquesta tasca s'ubicar? en primer pla. Amb el valor" + +#~ msgid "\t\tA value of `exact' means that the command word must" +#~ msgstr " de \"exact\" el nom de l'ordre ha de coincidir" + +#~ msgid "\t\texactly match a command in the list of stopped jobs. A" +#~ msgstr " exactament una ordre qu? es trobe a la llista de" + +#~ msgid "\t\tvalue of `substring' means that the command word must" +#~ msgstr " tasques aturades. Amb \"substring\", la paraula de" + +#~ msgid "\t\tmatch a substring of the job. Any other value means that" +#~ msgstr "" +#~ " l'ordre ha de coincidir parcialment amb el nom de la" + +#~ msgid "\t\tthe command must be a prefix of a stopped job." +#~ msgstr "" +#~ " tasca (una subcadena d'aquesta). Altrament, amb\n" +#~ " qualsevol altre valor la paraula de l'ordre ha de\n" +#~ " coincidir amb un prefix de la tasca aturada." + +#~ msgid "command_oriented_history" +#~ msgstr "command_oriented_history" + +#~ msgid "" +#~ " Non-null means to save multiple-line commands together on" +#~ msgstr "" +#~ " Si no ?s buit, s'al?ar? juntament les ordres escrites" + +#~ msgid " a single history line." +#~ msgstr "" +#~ " en m?ltiples l?nies en una sola l?nia de l'hist?ric." + +#~ msgid "histchars Characters controlling history expansion and quick" +#~ msgstr "histchars Cont? els car?cters que controlen l'expansi? de " + +#~ msgid "\t\tsubstitution. The first character is the history" +#~ msgstr " l'hist?ric i la substituci? r?pida. El primer" + +#~ msgid "\t\tsubstitution character, usually `!'. The second is" +#~ msgstr " car?cter ?s el de substituci? de l'hist?ric," + +#~ msgid "\t\tthe `quick substitution' character, usually `^'. The" +#~ msgstr " normalment \"!\". El segon ?s el de \"substituci?" + +#~ msgid "\t\tthird is the `history comment' character, usually `#'." +#~ msgstr "" +#~ " r?pida\", normalment \"^\". El tercer ?s el de\n" +#~ " \"comentari de l'hist?ric\", normalment \"#\"." + +#~ msgid "HISTCONTROL\tSet to a value of `ignorespace', it means don't enter" +#~ msgstr "HISTCONTROL Si s'hi especifica \"ignorespace\", no s'introduir?" + +#~ msgid "\t\tlines which begin with a space or tab on the history" +#~ msgstr "" +#~ " l?nies que comencen amb un espai o de tabulaci? en la" + +#~ msgid "\t\tlist. Set to a value of `ignoredups', it means don't" +#~ msgstr "" +#~ " llista de l'hist?ric. Si s'activa amb \"ignoredups\"," + +#~ msgid "\t\tenter lines which match the last entered line. Set to" +#~ msgstr "" +#~ " no s'introduir? l?nies que concidisquen amb la darrera" + +#~ msgid "\t\t`ignoreboth' means to combine the two options. Unset," +#~ msgstr "" +#~ " l?nia executada. Amb \"ignoreboth\" s'actuar? amb els" + +#~ msgid "\t\tor set to any other value than those above means to save" +#~ msgstr " dos criteris anteriors alhora. Desactivada, o" + +#~ msgid "\t\tall lines on the history list." +#~ msgstr "" +#~ " especificant-se qualsevol altre valor, que no siga un\n" +#~ " dels esmentats anteriorment, al?a totes les l?nies a\n" +#~ " la llista de l'hist?ric." + +#~ msgid "Toggle the values of variables controlling optional behavior." +#~ msgstr "" +#~ "Commuta els valors de les variables, controlant els comportaments \n" +#~ "opcionals." + +#~ msgid "The -s flag means to enable (set) each OPTNAME; the -u flag" +#~ msgstr "" +#~ "El senyalador ?-s? activa cada variable de OPTNAME; el senyalador \"-u\" " + +#~ msgid "unsets each OPTNAME. The -q flag suppresses output; the exit" +#~ msgstr "desactiva cada OPTNAME. El senyalador \"-q\" suprimeix l'eixida de" + +#~ msgid "status indicates whether each OPTNAME is set or unset. The -o" +#~ msgstr "dades; l'estat d'eixida indica si cada OPTNAME ?s activat o no." + +#~ msgid "option restricts the OPTNAMEs to those defined for use with" +#~ msgstr "L'opci? \"o\" restringeix els OPTNAMEs d'aquells definits per a" + +#~ msgid "`set -o'. With no options, or with the -p option, a list of all" +#~ msgstr "utilitzar-ho amb l'ordre ?set -o?. Sense cap opci?, o amb l'opci?" + +#~ msgid "settable options is displayed, with an indication of whether or" +#~ msgstr "" +#~ "\"-p\", s'exhibeix una llista de totes les opcions activables, amb una" + +#~ msgid "not each is set." +#~ msgstr "indicaci? si ja ho ?s o no." diff --git a/po/cs.gmo b/po/cs.gmo new file mode 100644 index 0000000000000000000000000000000000000000..e52fb51332372b1afd664b9985153988397fc98e GIT binary patch literal 173589 zcmeFa378yLb@yE}c%cmho5k!WNS;E?^8F>M0PtQ!xOrxIeaW9g_ z7zk^?A(+kVgs>U{1Y!vLz7v+PWAmNbU^C|Fj@W)^Zrrewg4hEbCmGAWd-vg@r zKMi>78A$?*lY4>U+k-*nR|Q4SQ^31}F9TJccY@0IX7JA7FF}Pr;Y`0D08iw85LCFm zpyJJfcLkpUik_E-`_Bga0eB~#{|`6-p7a0@e?F-4?gN!>6TAobxN!d>Q1$x{p!ohN z@Gju@K+*l*;1cjI5A<{%0IuSG7`!L=NbqFvxuEiYJ$N_p{h-SC6;S2)37CSnKg-h_ z09SLr8&te&LA}2oRC;d!?*M)TL==)Qfa1e(5Ayq^py(b36~6^auAUg~pA9OVSA(MG zz2H5-o58z-KL!6kp!}-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+Hcv|xBKp!_O)*(Wmr%l$dcr|ymTDs5@t$8 z^DFKavs@6h2ov`~F+1uXHo0m&Kv|0bZ+iF1H?xIpJpVY>X#=bWgcTsT14ry;_qa0~ zFbB|K6rU(KhYJ!MS%FrIsJN&xhUjprya4GZ5X)#+M+>nqPHDNHD zQ)X`Bm8P#LSW+F~sa-Us@V}GCn}o zB*@v1f89&VznEgM++>CuZ{8r<#lnPWn%}Pr;xUG(en)Bq)Y5CF(}1<5Jr{E5!{JgZ zUDQ-?+cFvLO*)CET1m}M_@OR=5-b$wo%r(CmjlxnzyN+}GVx&JE&J~hi85Y!iGmz{ zGWhX#f>`-cL;$s`zC6 zbVx|KZ`{wMQ&^|B>iDaMPBR-~y|s4fuika($JOqd_ z3&DQwteeGqI#DkkbzoCm$m=7VL4y4WO1|_f_8^M8zBzu*E2MD zqJGR<(@@F}k#!a3m62GVP)n(ScY`KT{GnLiWN+?Rv+j{h$V4ij^_65^mA~1$dHwR< zrNA`mkq=Zb9{u z2Rn1cy%B?qJ^>||5}uqt!Y8jgf+-YU0T)iL*;j?F*vvgaJ5CScui?;s@v&S!VEN0# oi9IR2MH?#8s1-;vQ37B5;Am(5TA3#@`~LjV8( literal 0 HcmV?d00001 diff --git a/po/cs.po b/po/cs.po new file mode 100644 index 0000000..0e3c3ba --- /dev/null +++ b/po/cs.po @@ -0,0 +1,6332 @@ +# Czech tranlation for bash. +# Copyright (C) 2008 Free Software Foundation, Inc. +# This file is distributed under the same license as the bash package. +# Petr Pisar , 2008, 2009, 2010, 2011, 2012, 2013, 2014. +# +# alias → alias +# subscript → podskript +# subroutine → podprogram +# completion options → možnosti doplňování +# shell option → přepínač shellu (shopt) +# Názvy signálu a stavů procesu by měly souhlasit se signal(7). +msgid "" +msgstr "" +"Project-Id-Version: bash 4.3-rc2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-02-11 11:19-0500\n" +"PO-Revision-Date: 2014-01-30 19:29+0100\n" +"Last-Translator: Petr Pisar \n" +"Language-Team: Czech \n" +"Language: cs\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#: arrayfunc.c:51 +msgid "bad array subscript" +msgstr "chybný podskript pole" + +#: arrayfunc.c:356 builtins/declare.def:566 +#, c-format +msgid "%s: cannot convert indexed to associative array" +msgstr "%s: číslované pole nezle převést na pole asociativní" + +#: arrayfunc.c:539 +#, c-format +msgid "%s: invalid associative array key" +msgstr "%s: neplatný klíč asociativního pole" + +#: arrayfunc.c:541 +#, c-format +msgid "%s: cannot assign to non-numeric index" +msgstr "%s: přes nečíselný indexu nelze dosadit" + +#: arrayfunc.c:586 +#, c-format +msgid "%s: %s: must use subscript when assigning associative array" +msgstr "%s: %s: při přiřazovaní asociativního pole se musí použít podskript" + +#: bashhist.c:388 +#, c-format +msgid "%s: cannot create: %s" +msgstr "%s: nelze vytvořit: %s" + +#: bashline.c:3982 +msgid "bash_execute_unix_command: cannot find keymap for command" +msgstr "bash_execute_unix_command: pro příkaz nelze nalézt klávesovou mapu " + +#: bashline.c:4069 +#, c-format +msgid "%s: first non-whitespace character is not `\"'" +msgstr "%s: první nebílý znak není „\"“" + +#: bashline.c:4098 +#, c-format +msgid "no closing `%c' in %s" +msgstr "ne zavírající „%c“ v %s" + +#: bashline.c:4132 +#, c-format +msgid "%s: missing colon separator" +msgstr "%s: chybí dvojtečkový oddělovač" + +#: braces.c:321 +#, c-format +msgid "brace expansion: cannot allocate memory for %s" +msgstr "závorková expanze: nelze alokovat paměť pro %s" + +# TODO: pluralize +#: braces.c:413 +#, c-format +msgid "brace expansion: failed to allocate memory for %d elements" +msgstr "závorková expanze: alokace paměti pro %d prvků selhala" + +#: braces.c:452 +#, c-format +msgid "brace expansion: failed to allocate memory for `%s'" +msgstr "závorková expanze: alokace paměti pro „%s“ selhala" + +#: builtins/alias.def:132 +#, c-format +msgid "`%s': invalid alias name" +msgstr "„%s“: chybný název aliasu" + +#: builtins/bind.def:123 builtins/bind.def:126 +msgid "line editing not enabled" +msgstr "upravování řádku není povoleno" + +#: builtins/bind.def:212 +#, c-format +msgid "`%s': invalid keymap name" +msgstr "„%s“: chybný název klávesové mapy" + +#: builtins/bind.def:251 +#, c-format +msgid "%s: cannot read: %s" +msgstr "%s: nelze číst: %s" + +#: builtins/bind.def:266 +#, c-format +msgid "`%s': cannot unbind" +msgstr "„%s“: nelze zruÅ¡it vazbu" + +#: builtins/bind.def:304 builtins/bind.def:334 +#, c-format +msgid "`%s': unknown function name" +msgstr "„%s“: neznámé jméno funkce" + +#: builtins/bind.def:312 +#, c-format +msgid "%s is not bound to any keys.\n" +msgstr "%s není svázán s žádnou klávesou.\n" + +#: builtins/bind.def:316 +#, c-format +msgid "%s can be invoked via " +msgstr "%s lze vyvolat přes " + +#: builtins/break.def:77 builtins/break.def:117 +msgid "loop count" +msgstr "počet smyček" + +#: builtins/break.def:137 +msgid "only meaningful in a `for', `while', or `until' loop" +msgstr "má smysl jen ve smyčkách „for“, „while“ nebo „until“" + +#: builtins/caller.def:134 +msgid "" +"Returns the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns " +msgstr "" +"Vrátí kontext aktuálního volání podprogramu.\n" +" \n" +" Bez VÝRAZU vrátí " + +#: builtins/cd.def:319 +msgid "HOME not set" +msgstr "není nestavena HOME" + +#: builtins/cd.def:327 builtins/common.c:166 test.c:876 +msgid "too many arguments" +msgstr "příliÅ¡ mnoho argumentů" + +#: builtins/cd.def:338 +msgid "OLDPWD not set" +msgstr "není nastaveno OLDPWD" + +#: builtins/common.c:101 +#, c-format +msgid "line %d: " +msgstr "řádek %d: " + +#: builtins/common.c:139 error.c:265 +#, c-format +msgid "warning: " +msgstr "varování: " + +#: builtins/common.c:153 +#, c-format +msgid "%s: usage: " +msgstr "%s: užití: " + +#: builtins/common.c:191 shell.c:506 shell.c:788 +#, c-format +msgid "%s: option requires an argument" +msgstr "%s: přepínač vyžaduje argument" + +#: builtins/common.c:198 +#, c-format +msgid "%s: numeric argument required" +msgstr "%s: vyžadován číselný argument" + +#: builtins/common.c:205 +#, c-format +msgid "%s: not found" +msgstr "%s: nenalezeno" + +#: builtins/common.c:214 shell.c:801 +#, c-format +msgid "%s: invalid option" +msgstr "%s: chybný přepínač" + +#: builtins/common.c:221 +#, c-format +msgid "%s: invalid option name" +msgstr "%s: chybný název přepínače" + +#: builtins/common.c:228 general.c:235 general.c:240 +#, c-format +msgid "`%s': not a valid identifier" +msgstr "„%s“: není platným identifikátorem" + +#: builtins/common.c:238 +msgid "invalid octal number" +msgstr "neplatné osmičkové číslo" + +#: builtins/common.c:240 +msgid "invalid hex number" +msgstr "chybné Å¡estnáctkové číslo" + +#: builtins/common.c:242 expr.c:1470 +msgid "invalid number" +msgstr "chybné číslo" + +#: builtins/common.c:250 +#, c-format +msgid "%s: invalid signal specification" +msgstr "%s: chybné určení signálu" + +#: builtins/common.c:257 +#, c-format +msgid "`%s': not a pid or valid job spec" +msgstr "„%s“: není PID ani platným označením úlohy" + +#: builtins/common.c:264 error.c:488 +#, c-format +msgid "%s: readonly variable" +msgstr "%s: proměnná pouze pro čtení" + +#: builtins/common.c:272 +#, c-format +msgid "%s: %s out of range" +msgstr "%s: %s mimo rozsah" + +#: builtins/common.c:272 builtins/common.c:274 +msgid "argument" +msgstr "argument" + +#: builtins/common.c:274 +#, c-format +msgid "%s out of range" +msgstr "%s mimo rozsah" + +#: builtins/common.c:282 +#, c-format +msgid "%s: no such job" +msgstr "%s: žádná taková úloha" + +#: builtins/common.c:290 +#, c-format +msgid "%s: no job control" +msgstr "%s: žádné řízení úloh" + +#: builtins/common.c:292 +msgid "no job control" +msgstr "žádné řízení úloh" + +#: builtins/common.c:302 +#, c-format +msgid "%s: restricted" +msgstr "%s: omezeno" + +#: builtins/common.c:304 +msgid "restricted" +msgstr "omezeno" + +#: builtins/common.c:312 +#, c-format +msgid "%s: not a shell builtin" +msgstr "%s: není vestavěným příkazem shellu" + +#: builtins/common.c:321 +#, c-format +msgid "write error: %s" +msgstr "chyba zápisu: %s" + +#: builtins/common.c:329 +#, c-format +msgid "error setting terminal attributes: %s" +msgstr "chyba při nastavování vlastností terminálu: %s" + +#: builtins/common.c:331 +#, c-format +msgid "error getting terminal attributes: %s" +msgstr "chyba při získávání vlastností terminálu: %s" + +#: builtins/common.c:563 +#, c-format +msgid "%s: error retrieving current directory: %s: %s\n" +msgstr "%s: chyba při zjišťování současného adresáře: %s: %s\n" + +#: builtins/common.c:629 builtins/common.c:631 +#, c-format +msgid "%s: ambiguous job spec" +msgstr "%s: nejednoznačné určení úlohy" + +#: builtins/complete.def:277 +#, c-format +msgid "%s: invalid action name" +msgstr "%s: neplatný název akce" + +#: builtins/complete.def:450 builtins/complete.def:645 +#: builtins/complete.def:855 +#, c-format +msgid "%s: no completion specification" +msgstr "%s: žádné doplňování neurčeno" + +#: builtins/complete.def:697 +msgid "warning: -F option may not work as you expect" +msgstr "varování: přepínač -F možná nebude dělat, co jste čekali" + +#: builtins/complete.def:699 +msgid "warning: -C option may not work as you expect" +msgstr "varování: přepínač -C možná nebude dělat, co jste čekali" + +#: builtins/complete.def:828 +msgid "not currently executing completion function" +msgstr "doplňovací funkce se právě nevykonává" + +#: builtins/declare.def:126 +msgid "can only be used in a function" +msgstr "může být použito jen ve funkci" + +#: builtins/declare.def:315 builtins/declare.def:509 +#, c-format +msgid "%s: reference variable cannot be an array" +msgstr "%s: proměnná s odkazem nemůže být polem" + +#: builtins/declare.def:324 +#, c-format +msgid "%s: nameref variable self references not allowed" +msgstr "%s: proměnná s odkazem na název nemůže odkazovat sama na sebe" + +#: builtins/declare.def:398 +msgid "cannot use `-f' to make functions" +msgstr "„-f“ nezle použít na výrobu funkce" + +#: builtins/declare.def:410 execute_cmd.c:5361 +#, c-format +msgid "%s: readonly function" +msgstr "%s: funkce jen pro čtení" + +#: builtins/declare.def:553 +#, c-format +msgid "%s: cannot destroy array variables in this way" +msgstr "%s: takto nelze likvidovat pole" + +#: builtins/declare.def:560 builtins/read.def:733 +#, c-format +msgid "%s: cannot convert associative to indexed array" +msgstr "%s: asociativní pole nelze převést na číslované pole" + +#: builtins/enable.def:137 builtins/enable.def:145 +msgid "dynamic loading not available" +msgstr "dynamické nahrávání není dostupné" + +#: builtins/enable.def:312 +#, c-format +msgid "cannot open shared object %s: %s" +msgstr "sdílený objekt %s nelze otevřít: %s" + +#: builtins/enable.def:335 +#, c-format +msgid "cannot find %s in shared object %s: %s" +msgstr "ve sdílením objektu %2$s nelze nalézt %1$s: %3$s" + +#: builtins/enable.def:459 +#, c-format +msgid "%s: not dynamically loaded" +msgstr "%s: není dynamicky nahráno" + +#: builtins/enable.def:474 +#, c-format +msgid "%s: cannot delete: %s" +msgstr "%s: nelze smazat: %s" + +#: builtins/evalfile.c:140 builtins/hash.def:171 execute_cmd.c:5208 +#: shell.c:1481 +#, c-format +msgid "%s: is a directory" +msgstr "%s: je adresářem" + +#: builtins/evalfile.c:146 +#, c-format +msgid "%s: not a regular file" +msgstr "%s: není obyčejný soubor" + +#: builtins/evalfile.c:155 +#, c-format +msgid "%s: file is too large" +msgstr "%s: soubor je příliÅ¡ velký" + +#: builtins/evalfile.c:190 builtins/evalfile.c:208 shell.c:1491 +#, c-format +msgid "%s: cannot execute binary file" +msgstr "%s: binární soubor nelze spustit" + +#: builtins/exec.def:154 builtins/exec.def:156 builtins/exec.def:228 +#, c-format +msgid "%s: cannot execute: %s" +msgstr "%s: nelze provést: %s" + +# XXX: Toto je zpráva interaktivního shellu při příkazu exit informující +# o odhlášení +#: builtins/exit.def:65 +#, c-format +msgid "logout\n" +msgstr "odhlášení\n" + +#: builtins/exit.def:88 +msgid "not login shell: use `exit'" +msgstr "toto není login shell: použijte „exit“" + +#: builtins/exit.def:120 +#, c-format +msgid "There are stopped jobs.\n" +msgstr "Jsou zde pozastavené úlohy.\n" + +#: builtins/exit.def:122 +#, c-format +msgid "There are running jobs.\n" +msgstr "Jsou zde běžící úlohy.\n" + +#: builtins/fc.def:262 +msgid "no command found" +msgstr "žádný příkaz nenalezen" + +#: builtins/fc.def:320 builtins/fc.def:369 +msgid "history specification" +msgstr "určení historie" + +#: builtins/fc.def:390 +#, c-format +msgid "%s: cannot open temp file: %s" +msgstr "%s: dočasný soubor nelze otevřít: %s" + +#: builtins/fg_bg.def:149 builtins/jobs.def:282 +msgid "current" +msgstr "současný" + +#: builtins/fg_bg.def:158 +#, c-format +msgid "job %d started without job control" +msgstr "úloha %d spuÅ¡těna bez správy úloh" + +#: builtins/getopt.c:110 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: chybný přepínač – %c\n" + +#: builtins/getopt.c:111 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: přepínač vyžaduje argument – %c\n" + +#: builtins/hash.def:92 +msgid "hashing disabled" +msgstr "hashování zakázáno" + +#: builtins/hash.def:138 +#, c-format +msgid "%s: hash table empty\n" +msgstr "%s: tabulka hashů je prázdná\n" + +#: builtins/hash.def:245 +#, c-format +msgid "hits\tcommand\n" +msgstr "zásahů\tpříkaz\n" + +#: builtins/help.def:130 +#, c-format +msgid "Shell commands matching keyword `" +msgid_plural "Shell commands matching keywords `" +msgstr[0] "Příkazy shellu shodující se s klíčovým slovem „" +msgstr[1] "Příkazy shellu shodující se s klíčovými slovy „" +msgstr[2] "Příkazy shellu shodující se s klíčovými slovy „" + +#: builtins/help.def:182 +#, c-format +msgid "" +"no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." +msgstr "" +"žádné téma nápovědy se nehodí pro „%s“. Zkuste „help help“ nebo „man -k %s“ " +"nebo „info %s“." + +#: builtins/help.def:199 +#, c-format +msgid "%s: cannot open: %s" +msgstr "%s: nelze otevřít: %s" + +#: builtins/help.def:485 +#, c-format +msgid "" +"These shell commands are defined internally. Type `help' to see this list.\n" +"Type `help name' to find out more about the function `name'.\n" +"Use `info bash' to find out more about the shell in general.\n" +"Use `man -k' or `info' to find out more about commands not in this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" +msgstr "" +"Tyto příkazy shellu jsou vnitřně definovány. NapiÅ¡te „help“, abyste získali\n" +"tento seznam. Podrobnosti o funkci „název“ získáte příkazem „help název“.\n" +"Příkazem „info bash“ získáte obecné informace o tomto shellu.\n" +"Použijte „man -k“ nebo „info“, chcete-li zjistit více o příkazech, které\n" +"na tomto seznamu nejsou.\n" +"\n" +"Hvězdička (*) vedle jména znamená, že příkaz je zakázán.\n" +"\n" + +#: builtins/history.def:154 +msgid "cannot use more than one of -anrw" +msgstr "nelze použít více jak jeden z -anrw" + +#: builtins/history.def:186 +msgid "history position" +msgstr "místo v historii" + +#: builtins/history.def:366 +#, c-format +msgid "%s: history expansion failed" +msgstr "%s: expanze historie selhala" + +#: builtins/inlib.def:71 +#, c-format +msgid "%s: inlib failed" +msgstr "%s: inlib selhala" + +#: builtins/jobs.def:109 +msgid "no other options allowed with `-x'" +msgstr "s „-x“ nejsou dovoleny další přepínače" + +#: builtins/kill.def:200 +#, c-format +msgid "%s: arguments must be process or job IDs" +msgstr "%s: argumenty musí být proces nebo identifikátor úlohy" + +#: builtins/kill.def:263 +msgid "Unknown error" +msgstr "Neznámá chyba" + +#: builtins/let.def:95 builtins/let.def:120 expr.c:583 expr.c:598 +msgid "expression expected" +msgstr "očekáván výraz" + +#: builtins/mapfile.def:172 +#, c-format +msgid "%s: not an indexed array" +msgstr "%s: není (proměnnou typu) indexované pole" + +#: builtins/mapfile.def:259 builtins/read.def:302 +#, c-format +msgid "%s: invalid file descriptor specification" +msgstr "%s: chybné určení deskriptoru souboru" + +#: builtins/mapfile.def:267 builtins/read.def:309 +#, c-format +msgid "%d: invalid file descriptor: %s" +msgstr "%d: neplatný deskriptor souboru: %s" + +#: builtins/mapfile.def:276 builtins/mapfile.def:314 +#, c-format +msgid "%s: invalid line count" +msgstr "%s: chybný počet řádků" + +#: builtins/mapfile.def:287 +#, c-format +msgid "%s: invalid array origin" +msgstr "%s: chybný počátek pole" + +#: builtins/mapfile.def:304 +#, c-format +msgid "%s: invalid callback quantum" +msgstr "%s: neplatné množství mezi voláními" + +#: builtins/mapfile.def:336 +msgid "empty array variable name" +msgstr "prázdný název proměnné typu pole" + +#: builtins/mapfile.def:357 +msgid "array variable support required" +msgstr "je vyžadována podpora proměnných typu pole" + +#: builtins/printf.def:402 +#, c-format +msgid "`%s': missing format character" +msgstr "„%s“: postrádám formátovací znak" + +#: builtins/printf.def:456 +#, c-format +msgid "`%c': invalid time format specification" +msgstr "„%c“: chybné určení časového limitu" + +#: builtins/printf.def:658 +#, c-format +msgid "`%c': invalid format character" +msgstr "„%c“: neplatný formátovací znak" + +#: builtins/printf.def:684 +#, c-format +msgid "warning: %s: %s" +msgstr "varování: %s: %s" + +#: builtins/printf.def:768 +#, c-format +msgid "format parsing problem: %s" +msgstr "potíže s rozebráním formátovacího řetězce: %s" + +#: builtins/printf.def:865 +msgid "missing hex digit for \\x" +msgstr "u \\x chybí Å¡estnáctková číslovka" + +#: builtins/printf.def:880 +#, c-format +msgid "missing unicode digit for \\%c" +msgstr "u \\%c chybí unikódová číslovka" + +#: builtins/pushd.def:195 +msgid "no other directory" +msgstr "žádný další adresář" + +#: builtins/pushd.def:354 +#, c-format +msgid "%s: invalid argument" +msgstr "%s: chybný argument" + +#: builtins/pushd.def:468 +msgid "" +msgstr "<žádný aktuální adresář>" + +#: builtins/pushd.def:512 +msgid "directory stack empty" +msgstr "prázdný zásobník adresářů" + +#: builtins/pushd.def:514 +msgid "directory stack index" +msgstr "pořadí v zásobníku adresářů" + +#: builtins/pushd.def:689 +msgid "" +"Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +"\tdirs when invoked without options, starting with zero." +msgstr "" +"Zobrazí seznam právě zapamatovaných adresářů. Adresáře si najdou svoji\n" +" cestu na seznam příkazem „pushd“ a procházet seznamem zpět lze příkazem\n" +" „popd“.\n" +" \n" +" Přepínače:\n" +" -c\tvyprázdní zásobník adresářů tím, že smaže vÅ¡echny jeho prvky\n" +" -l\tnevypisuje adresáře relativní vaÅ¡emu domovskému adresáři pomocí\n" +" \tvlnkové předpony\n" +" -p\tvypíše zásobník adresářů stylem jedna položka na jeden řádek\n" +" -v\tvypíše zásobník adresářů stylem jedna položka na jeden řádek\n" +" \tuvozená svojí pozicí na zásobníku\n" +" \n" +" Argumenty:\n" +" +N\tZobrazí N. položku počítáno zleva na seznamu, který zobrazuje\n" +" \tdirs, když je vyvolán bez přepínačů, počínaje nulou.\n" +" \n" +" -N\tZobrazí N. položku počítáno zprava na seznamu, který zobrazuje\n" +" \tdirs, když je vyvolán bez přepínačů, počínaje nulou." + +#: builtins/pushd.def:711 +msgid "" +"Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Přidá adresář na vrchol zásobníku adresářů nebo zásobník zrotuje tak,\n" +" že nový vrchol zásobníku se stane současným pracovním adresářem. Bez\n" +" argumentů prohodí dva vrchní adresáře.\n" +" \n" +" Přepínače:\n" +" -n\tPotlačí obvyklou změnu adresáře, když se na zásobník přidávají\n" +" \tadresáře, takže změněn bude pouze zásobník.\n" +" \n" +" Argumenty:\n" +" +N\tZrotuje zásobník tak, že N. adresář (počítáno zleva na seznamu\n" +" \tzobrazovaném pomocí „dirs“, počínaje nulou) se dostane na vrchol.\n" +" \n" +" -N\tZrotuje zásobník tak, že N. adresář (počítáno zprava na seznamu\n" +" \tzobrazovaném pomocí „dirs“, počínaje nulou) se dostane na vrchol.\n" +" \n" +" ADRESÁŘ\n" +" \tPřidá ADRESÁŘ na vrchol zásobníku adresářů a učiní jej novým\n" +" \tsoučasným pracovním adresářem.\n" +" \n" +" Zásobník adresářů si můžete prohlédnout příkazem „dirs“." + +#: builtins/pushd.def:736 +msgid "" +"Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Odstraní položku ze zásobníku adresářů. Bez argumentů odstraní adresář\n" +" z vrcholu zásobníku a přepne se do nového vrcholového adresáře.\n" +" \n" +" Přepínače:\n" +" -n\tPotlačí obvyklou změnu adresáře, když se ze zásobníku odebírají\n" +" \tadresáře, takže změněn bude pouze zásobník.\n" +" \n" +" Argumenty:\n" +" +N\tOdstraní N. položku počítáno zleva na seznamu zobrazovaném pomocí\n" +" \t„dirs“, počínaje nulou. Na příklad: „popd +0“ odstraní první\n" +" \tadresář, „popd -1“ druhý.\n" +" \n" +" -N\tOdstraní N. položku počítáno zprava na seznamu zobrazovaném " +"pomocí\n" +" \t„dirs“, počínaje nulou. Na příklad: „popd -0“ odstraní poslední\n" +" \tadresář, „popd -1“ další vedle posledního.\n" +" \n" +" Zásobník adresářů si můžete prohlédnout příkazem „dirs“." + +#: builtins/read.def:275 +#, c-format +msgid "%s: invalid timeout specification" +msgstr "%s: chybné určení časového limitu" + +#: builtins/read.def:678 +#, c-format +msgid "read error: %d: %s" +msgstr "chyba čtení: %d: %s" + +#: builtins/return.def:75 +msgid "can only `return' from a function or sourced script" +msgstr "„return“ lze provést jen z funkce nebo skriptu načteného přes „source“" + +#: builtins/set.def:782 +msgid "cannot simultaneously unset a function and a variable" +msgstr "funkci i proměnnou nelze ruÅ¡it současně" + +#: builtins/set.def:826 +#, c-format +msgid "%s: cannot unset" +msgstr "%s: nelze zruÅ¡it" + +#: builtins/set.def:843 +#, c-format +msgid "%s: cannot unset: readonly %s" +msgstr "%s: nelze zruÅ¡it: %s jen pro čtení" + +#: builtins/set.def:854 +#, c-format +msgid "%s: not an array variable" +msgstr "%s: není (proměnnou typu) pole" + +#: builtins/setattr.def:187 +#, c-format +msgid "%s: not a function" +msgstr "%s: není funkcí" + +#: builtins/shift.def:71 builtins/shift.def:77 +msgid "shift count" +msgstr "počet shiftů" + +#: builtins/shopt.def:279 +msgid "cannot set and unset shell options simultaneously" +msgstr "přepínač shellu nelze zároveň nastavit a zruÅ¡it" + +#: builtins/shopt.def:346 +#, c-format +msgid "%s: invalid shell option name" +msgstr "%s: chybný název přepínače shellu" + +#: builtins/source.def:130 +msgid "filename argument required" +msgstr "vyžadován argument s názvem souboru" + +#: builtins/source.def:155 +#, c-format +msgid "%s: file not found" +msgstr "%s: soubor nenalezen" + +#: builtins/suspend.def:101 +msgid "cannot suspend" +msgstr "nelze pozastavit" + +#: builtins/suspend.def:111 +msgid "cannot suspend a login shell" +msgstr "login shell nelze pozastavit" + +#: builtins/type.def:234 +#, c-format +msgid "%s is aliased to `%s'\n" +msgstr "%s je alias na „%s“\n" + +#: builtins/type.def:255 +#, c-format +msgid "%s is a shell keyword\n" +msgstr "%s je klíčové slovo shellu\n" + +#: builtins/type.def:274 +#, c-format +msgid "%s is a function\n" +msgstr "%s je funkce\n" + +#: builtins/type.def:296 +#, c-format +msgid "%s is a shell builtin\n" +msgstr "%s je součást shellu\n" + +#: builtins/type.def:317 builtins/type.def:393 +#, c-format +msgid "%s is %s\n" +msgstr "%s je %s\n" + +#: builtins/type.def:337 +#, c-format +msgid "%s is hashed (%s)\n" +msgstr "%s je zahashován (%s)\n" + +#: builtins/ulimit.def:383 +#, c-format +msgid "%s: invalid limit argument" +msgstr "%s: chybný argument s limitou" + +#: builtins/ulimit.def:409 +#, c-format +msgid "`%c': bad command" +msgstr "„%c“: chybný příkaz" + +#: builtins/ulimit.def:438 +#, c-format +msgid "%s: cannot get limit: %s" +msgstr "%s: limit nelze zjistit: %s" + +#: builtins/ulimit.def:464 +msgid "limit" +msgstr "limit" + +#: builtins/ulimit.def:476 builtins/ulimit.def:776 +#, c-format +msgid "%s: cannot modify limit: %s" +msgstr "%s: limit nelze změnit: %s" + +#: builtins/umask.def:114 +msgid "octal number" +msgstr "osmičkové číslo" + +#: builtins/umask.def:227 +#, c-format +msgid "`%c': invalid symbolic mode operator" +msgstr "„%c“: chybný operátor symbolických práv" + +#: builtins/umask.def:282 +#, c-format +msgid "`%c': invalid symbolic mode character" +msgstr "„%c“: chybný znak symbolický práv " + +#: error.c:90 error.c:325 error.c:327 error.c:329 +msgid " line " +msgstr " řádek " + +#: error.c:165 +#, c-format +msgid "last command: %s\n" +msgstr "poslední příkaz: %s\n" + +#: error.c:173 +#, c-format +msgid "Aborting..." +msgstr "Ukončuji…" + +#: error.c:440 +msgid "unknown command error" +msgstr "chyba neznámého příkazu" + +#: error.c:441 +msgid "bad command type" +msgstr "chybný druh příkazu" + +#: error.c:442 +msgid "bad connector" +msgstr "chybný konektor" + +#: error.c:443 +msgid "bad jump" +msgstr "chybný skok" + +#: error.c:481 +#, c-format +msgid "%s: unbound variable" +msgstr "%s: nevázaná proměnná" + +#: eval.c:189 +#, c-format +msgid "\atimed out waiting for input: auto-logout\n" +msgstr "\ačasový limit pro čekání na vstup vyprÅ¡el: automatické odhlášení\n" + +#: execute_cmd.c:512 +#, c-format +msgid "cannot redirect standard input from /dev/null: %s" +msgstr "standardní vstup nelze přesměrovat z /dev/null: %s" + +#: execute_cmd.c:1233 +#, c-format +msgid "TIMEFORMAT: `%c': invalid format character" +msgstr "TIMEFORMAT: „%c“: chybný formátovací znak" + +#: execute_cmd.c:2287 +msgid "pipe error" +msgstr "chyba v rouře" + +#: execute_cmd.c:4386 +#, c-format +msgid "%s: maximum function nesting level exceeded (%d)" +msgstr "%s: maximální úroveň zanoření funkcí byla překročena (%d)" + +#: execute_cmd.c:4884 +#, c-format +msgid "%s: restricted: cannot specify `/' in command names" +msgstr "%s: omezeno: v názvu příkazu nesmí být „/“" + +#: execute_cmd.c:4973 +#, c-format +msgid "%s: command not found" +msgstr "%s: příkaz nenalezen" + +#: execute_cmd.c:5206 +#, c-format +msgid "%s: %s" +msgstr "%s: %s" + +#: execute_cmd.c:5243 +#, c-format +msgid "%s: %s: bad interpreter" +msgstr "%s: %s: chybný interpretr" + +#: execute_cmd.c:5280 +#, c-format +msgid "%s: cannot execute binary file: %s" +msgstr "%s: binární soubor nelze spustit: %s" + +#: execute_cmd.c:5352 +#, c-format +msgid "`%s': is a special builtin" +msgstr "„%s“: je zvláštní vestavěný příkaz shellu" + +#: execute_cmd.c:5404 +#, c-format +msgid "cannot duplicate fd %d to fd %d" +msgstr "deskriptor souboru %d nelze duplikovat na deskriptor %d" + +#: expr.c:259 +msgid "expression recursion level exceeded" +msgstr "úroveň rekurze výrazu byla překročena" + +#: expr.c:283 +msgid "recursion stack underflow" +msgstr "zásobník rekurze podtekl" + +#: expr.c:431 +msgid "syntax error in expression" +msgstr "syntaktická chyba ve výrazu" + +#: expr.c:475 +msgid "attempted assignment to non-variable" +msgstr "pokus o přiřazení do ne-proměnné" + +#: expr.c:495 expr.c:858 +msgid "division by 0" +msgstr "dělení nulou" + +#: expr.c:542 +msgid "bug: bad expassign token" +msgstr "chyba: chybný expassing token" + +#: expr.c:595 +msgid "`:' expected for conditional expression" +msgstr "v podmíněném výrazu očekávána „:“" + +#: expr.c:919 +msgid "exponent less than 0" +msgstr "mocnitel menší než 0" + +#: expr.c:976 +msgid "identifier expected after pre-increment or pre-decrement" +msgstr "po přednostním zvýšení nebo snížení očekáván identifikátor" + +#: expr.c:1002 +msgid "missing `)'" +msgstr "postrádám „)“" + +#: expr.c:1053 expr.c:1390 +msgid "syntax error: operand expected" +msgstr "syntaktická chyba: očekáván operand" + +#: expr.c:1392 +msgid "syntax error: invalid arithmetic operator" +msgstr "syntaktická chyba: chybný aritmetický operátor" + +#: expr.c:1416 +#, c-format +msgid "%s%s%s: %s (error token is \"%s\")" +msgstr "%s%s%s: %s (chybný token je „%s“)" + +#: expr.c:1474 +msgid "invalid arithmetic base" +msgstr "chybný aritmetický základ" + +#: expr.c:1494 +msgid "value too great for base" +msgstr "hodnot je pro základ příliÅ¡ velká" + +#: expr.c:1543 +#, c-format +msgid "%s: expression error\n" +msgstr "%s: chyba výrazu\n" + +#: general.c:62 +msgid "getcwd: cannot access parent directories" +msgstr "getcwd: rodičovské adresáře nejsou přístupné" + +#: input.c:102 subst.c:5168 +#, c-format +msgid "cannot reset nodelay mode for fd %d" +msgstr "na deskriptoru %d nelze resetovat režim nodelay" + +#: input.c:271 +#, c-format +msgid "cannot allocate new file descriptor for bash input from fd %d" +msgstr "nový deskriptor souboru pro vstup bashe z deskr. %d nelze alokovat" + +#: input.c:279 +#, c-format +msgid "save_bash_input: buffer already exists for new fd %d" +msgstr "save_bash_input: buffer již pro nový deskriptor %d existuje" + +#: jobs.c:471 +msgid "start_pipeline: pgrp pipe" +msgstr "start_pipeline: pgrp roury" + +#: jobs.c:893 +#, c-format +msgid "forked pid %d appears in running job %d" +msgstr "forknutý PID %d se objevil v běžící úloze %d" + +#: jobs.c:1012 +#, c-format +msgid "deleting stopped job %d with process group %ld" +msgstr "mažu pozastavenou úlohu %d se skupinou procesů %ld" + +#: jobs.c:1117 +#, c-format +msgid "add_process: process %5ld (%s) in the_pipeline" +msgstr "add_process: proces %5ld (%s) do the_pipeline" + +#: jobs.c:1120 +#, c-format +msgid "add_process: pid %5ld (%s) marked as still alive" +msgstr "add_process: PID %5ld (%s) označen za stále živého" + +#: jobs.c:1435 +#, c-format +msgid "describe_pid: %ld: no such pid" +msgstr "describe_pid: %ld: žádný takový PID" + +#: jobs.c:1450 +#, c-format +msgid "Signal %d" +msgstr "Signál %d" + +# XXX: (úloha) dokončna. Používat ženský rod i unásledujících. Jedná se +# o výpis úloh. +#: jobs.c:1464 jobs.c:1489 +msgid "Done" +msgstr "Dokončena" + +#: jobs.c:1469 siglist.c:123 +msgid "Stopped" +msgstr "Pozastavena" + +#: jobs.c:1473 +#, c-format +msgid "Stopped(%s)" +msgstr "Pozastavena (%s)" + +#: jobs.c:1477 +msgid "Running" +msgstr "Běží" + +#: jobs.c:1491 +#, c-format +msgid "Done(%d)" +msgstr "Dokončena (%d)" + +#: jobs.c:1493 +#, c-format +msgid "Exit %d" +msgstr "Ukončena %d" + +#: jobs.c:1496 +msgid "Unknown status" +msgstr "Stav neznámý" + +#: jobs.c:1583 +#, c-format +msgid "(core dumped) " +msgstr "(core dumped [obraz paměti uložen]) " + +#: jobs.c:1602 +#, c-format +msgid " (wd: %s)" +msgstr " (cwd: %s)" + +#: jobs.c:1819 +#, c-format +msgid "child setpgid (%ld to %ld)" +msgstr "setpgid na potomku (z %ld na %ld)" + +#: jobs.c:2138 nojobs.c:605 +#, c-format +msgid "wait: pid %ld is not a child of this shell" +msgstr "wait: PID %ld není potomkem tohoto shellu" + +#: jobs.c:2385 +#, c-format +msgid "wait_for: No record of process %ld" +msgstr "wait_for: Žádný záznam o procesu %ld" + +#: jobs.c:2694 +#, c-format +msgid "wait_for_job: job %d is stopped" +msgstr "wait_for_job: úloha %d je pozastavena" + +#: jobs.c:2986 +#, c-format +msgid "%s: job has terminated" +msgstr "%s: úloha skončila" + +#: jobs.c:2995 +#, c-format +msgid "%s: job %d already in background" +msgstr "%s: úloha %d je již na pozadí" + +#: jobs.c:3220 +msgid "waitchld: turning on WNOHANG to avoid indefinite block" +msgstr "waitchld: zapíná se WNOHANG, aby se zabránilo neurčitému zablokování" + +#: jobs.c:3711 +#, c-format +msgid "%s: line %d: " +msgstr "%s: řádek %d: " + +#: jobs.c:3725 nojobs.c:843 +#, c-format +msgid " (core dumped)" +msgstr " (core dumped [obraz paměti uložen])" + +#: jobs.c:3737 jobs.c:3750 +#, c-format +msgid "(wd now: %s)\n" +msgstr "(cwd nyní: %s)\n" + +#: jobs.c:3782 +msgid "initialize_job_control: getpgrp failed" +msgstr "initialize_job_control: getpgrp selhalo" + +#: jobs.c:3843 +msgid "initialize_job_control: line discipline" +msgstr "initialize_job_control: disciplína linky" + +#: jobs.c:3853 +msgid "initialize_job_control: setpgid" +msgstr "initialize_job_control: setpgid" + +#: jobs.c:3874 jobs.c:3883 +#, c-format +msgid "cannot set terminal process group (%d)" +msgstr "nelze nastavit skupinu procesů terminálu (%d)" + +#: jobs.c:3888 +msgid "no job control in this shell" +msgstr "žádná správa úloh v tomto shellu" + +#: lib/malloc/malloc.c:296 +#, c-format +msgid "malloc: failed assertion: %s\n" +msgstr "malloc: předpoklad nesplněn: %s\n" + +#: lib/malloc/malloc.c:312 +#, c-format +msgid "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" +msgstr "" +"\r\n" +"malloc: %s:%d: zbabraný předpoklad\r\n" + +#: lib/malloc/malloc.c:313 +msgid "unknown" +msgstr "není známo" + +#: lib/malloc/malloc.c:801 +msgid "malloc: block on free list clobbered" +msgstr "malloc: blok v seznamu uvolněných zbit" + +#: lib/malloc/malloc.c:878 +msgid "free: called with already freed block argument" +msgstr "free: zavoláno s argumentem již uvolněného bloku" + +#: lib/malloc/malloc.c:881 +msgid "free: called with unallocated block argument" +msgstr "free: zavoláno s argumentem nenaalokovaného bloku" + +#: lib/malloc/malloc.c:900 +msgid "free: underflow detected; mh_nbytes out of range" +msgstr "free: zjiÅ¡těno podtečení, mh_nbytes mimo rozsah" + +#: lib/malloc/malloc.c:906 +msgid "free: start and end chunk sizes differ" +msgstr "free: velikosti počátečního a koncového kusu se liší" + +#: lib/malloc/malloc.c:1005 +msgid "realloc: called with unallocated block argument" +msgstr "realloc: zavoláno s argumentem nenaalokovaného bloku" + +#: lib/malloc/malloc.c:1020 +msgid "realloc: underflow detected; mh_nbytes out of range" +msgstr "realloc: zjiÅ¡těno podtečení, mh_nbytes mimo rozsah" + +#: lib/malloc/malloc.c:1026 +msgid "realloc: start and end chunk sizes differ" +msgstr "realloc: velikosti počátečního a koncového kusu se liší" + +#: lib/malloc/table.c:194 +#, c-format +msgid "register_alloc: alloc table is full with FIND_ALLOC?\n" +msgstr "register_alloc: tabulka alokací je plná FIND_ALLOC?\n" + +#: lib/malloc/table.c:203 +#, c-format +msgid "register_alloc: %p already in table as allocated?\n" +msgstr "register_alloc: %p již obsažen v tabulce jako alokovaný?\n" + +#: lib/malloc/table.c:256 +#, c-format +msgid "register_free: %p already in table as free?\n" +msgstr "register_free: %p již obsažen v tabulce jako volný?\n" + +#: lib/sh/fmtulong.c:102 +msgid "invalid base" +msgstr "chybný základ" + +#: lib/sh/netopen.c:168 +#, c-format +msgid "%s: host unknown" +msgstr "%s: stroj není znám" + +#: lib/sh/netopen.c:175 +#, c-format +msgid "%s: invalid service" +msgstr "%s: chybná služba" + +#: lib/sh/netopen.c:306 +#, c-format +msgid "%s: bad network path specification" +msgstr "%s: chybné určení síťové cesty" + +#: lib/sh/netopen.c:346 +msgid "network operations not supported" +msgstr "síťové operace nejsou podporovány" + +#: locale.c:200 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s)" +msgstr "setlocale: LC_ALL: národní prostředí nelze změnit (%s)" + +#: locale.c:202 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s): %s" +msgstr "setlocale: LC_ALL: národní prostředí nelze změnit (%s): %s" + +#: locale.c:259 +#, c-format +msgid "setlocale: %s: cannot change locale (%s)" +msgstr "setlocale: %s: národní prostředí nelze změnit (%s)" + +#: locale.c:261 +#, c-format +msgid "setlocale: %s: cannot change locale (%s): %s" +msgstr "setlocale: %s: národní prostředí nelze změnit (%s): %s" + +#: mailcheck.c:439 +msgid "You have mail in $_" +msgstr "V $_ máte poÅ¡tu" + +#: mailcheck.c:464 +msgid "You have new mail in $_" +msgstr "V $_ máte novou poÅ¡tu" + +#: mailcheck.c:480 +#, c-format +msgid "The mail in %s has been read\n" +msgstr "PoÅ¡ta v %s je přečtená\n" + +#: make_cmd.c:323 +msgid "syntax error: arithmetic expression required" +msgstr "chyba syntaxe: vyžadován aritmetický výraz" + +#: make_cmd.c:325 +msgid "syntax error: `;' unexpected" +msgstr "chyba syntaxe: neočekávaný „;“" + +#: make_cmd.c:326 +#, c-format +msgid "syntax error: `((%s))'" +msgstr "chyba syntaxe: „((%s))“" + +#: make_cmd.c:578 +#, c-format +msgid "make_here_document: bad instruction type %d" +msgstr "make_here_document: chybný druh instrukce %d" + +#: make_cmd.c:662 +#, c-format +msgid "here-document at line %d delimited by end-of-file (wanted `%s')" +msgstr "„here“ dokument na řádku %d ukončen koncem souboru (požadováno „%s“)" + +#: make_cmd.c:759 +#, c-format +msgid "make_redirection: redirection instruction `%d' out of range" +msgstr "make_redirection: instrukce přesměrování „%d“ mimo rozsah" + +#: parse.y:3278 parse.y:3561 +#, c-format +msgid "unexpected EOF while looking for matching `%c'" +msgstr "neočekávaný konec souboru při hledání znaku odpovídajícímu „%c“" + +#: parse.y:4170 +msgid "unexpected EOF while looking for `]]'" +msgstr "neočekávaný konec souboru při hledání „]]“" + +# XXX: Condional means condition (adj.) probably. Can English distinguish +# between the condition (podmínkový) and the code branch (podmíněný)? Check +# for all "conditional" string occurences. +#: parse.y:4175 +#, c-format +msgid "syntax error in conditional expression: unexpected token `%s'" +msgstr "chyba syntaxe ve výrazu podmínky: neočekávaný token „%s“" + +#: parse.y:4179 +msgid "syntax error in conditional expression" +msgstr "chyba syntaxe ve výrazu podmínky" + +#: parse.y:4257 +#, c-format +msgid "unexpected token `%s', expected `)'" +msgstr "neočekávaný token „%s“, očekávána „)“" + +#: parse.y:4261 +msgid "expected `)'" +msgstr "očekávána „)“" + +#: parse.y:4289 +#, c-format +msgid "unexpected argument `%s' to conditional unary operator" +msgstr "neočekávaný argument „%s“ u podmínkového unárního operátoru" + +#: parse.y:4293 +msgid "unexpected argument to conditional unary operator" +msgstr "neočekávaný argument u podmínkového unárního operátoru" + +#: parse.y:4339 +#, c-format +msgid "unexpected token `%s', conditional binary operator expected" +msgstr "neočekávaný token „%s“, očekáván podmínkový binární operátor" + +#: parse.y:4343 +msgid "conditional binary operator expected" +msgstr "očekáván podmínkový binární operátor" + +#: parse.y:4365 +#, c-format +msgid "unexpected argument `%s' to conditional binary operator" +msgstr "neočekávaný argument „%s„ u podmínkového binárního operátoru" + +#: parse.y:4369 +msgid "unexpected argument to conditional binary operator" +msgstr "neočekávaný argument u podmínkového binárního operátoru" + +#: parse.y:4380 +#, c-format +msgid "unexpected token `%c' in conditional command" +msgstr "neočekávaný token „%c“ v podmínkovém příkazu" + +#: parse.y:4383 +#, c-format +msgid "unexpected token `%s' in conditional command" +msgstr "neočekávaný token „%s“ v podmínkovém příkazu" + +#: parse.y:4387 +#, c-format +msgid "unexpected token %d in conditional command" +msgstr "neočekávaný token %d v podmínkovém příkazu" + +#: parse.y:5737 +#, c-format +msgid "syntax error near unexpected token `%s'" +msgstr "chyba syntaxe poblíž neočekávaného tokenu „%s“" + +#: parse.y:5755 +#, c-format +msgid "syntax error near `%s'" +msgstr "chyba syntaxe poblíž „%s“" + +#: parse.y:5765 +msgid "syntax error: unexpected end of file" +msgstr "chyba syntaxe: nenadálý konec souboru" + +#: parse.y:5765 +msgid "syntax error" +msgstr "chyba syntaxe" + +#: parse.y:5827 +#, c-format +msgid "Use \"%s\" to leave the shell.\n" +msgstr "Shell lze ukončit příkazem „%s“.\n" + +#: parse.y:5989 +msgid "unexpected EOF while looking for matching `)'" +msgstr "nenadálý konec souboru při hledání odpovídající „)“" + +#: pcomplete.c:1094 +#, c-format +msgid "completion: function `%s' not found" +msgstr "doplňování: funkce „%s“ nenalezena" + +#: pcomplib.c:182 +#, c-format +msgid "progcomp_insert: %s: NULL COMPSPEC" +msgstr "progcomp_insert: %s: NULLOVÝ COMPSPEC" + +#: print_cmd.c:300 +#, c-format +msgid "print_command: bad connector `%d'" +msgstr "print_command: chybná propojka „%d“" + +#: print_cmd.c:373 +#, c-format +msgid "xtrace_set: %d: invalid file descriptor" +msgstr "xtrace_set: %d: neplatný deskriptor souboru" + +#: print_cmd.c:378 +msgid "xtrace_set: NULL file pointer" +msgstr "xtrace_set: nullový ukazatel na souboru" + +# fd, fp a fileno jsou identifikátory v kódu +#: print_cmd.c:382 +#, c-format +msgid "xtrace fd (%d) != fileno xtrace fp (%d)" +msgstr "xtrace: fd (%d) != fileno fp (%d)" + +#: print_cmd.c:1518 +#, c-format +msgid "cprintf: `%c': invalid format character" +msgstr "cprintf: „%c“: chybný formátovací znak" + +#: redir.c:123 redir.c:170 +msgid "file descriptor out of range" +msgstr "deskriptor souboru mimo rozsah" + +#: redir.c:177 +#, c-format +msgid "%s: ambiguous redirect" +msgstr "%s: nejednoznačné přesměrování" + +#: redir.c:181 +#, c-format +msgid "%s: cannot overwrite existing file" +msgstr "%s: existující soubor nelze přepsat" + +#: redir.c:186 +#, c-format +msgid "%s: restricted: cannot redirect output" +msgstr "%s: omezeno: výstup nelze přesměrovat" + +#: redir.c:191 +#, c-format +msgid "cannot create temp file for here-document: %s" +msgstr "pro „here“ dokument nelze vytvořit dočasný soubor: %s" + +#: redir.c:195 +#, c-format +msgid "%s: cannot assign fd to variable" +msgstr "%s: deskriptor souboru nelze přiřadit do proměnné" + +#: redir.c:582 +msgid "/dev/(tcp|udp)/host/port not supported without networking" +msgstr "/dev/(tcp|udp)/host/port není bez síťování podporováno" + +#: redir.c:861 redir.c:973 redir.c:1034 redir.c:1199 +msgid "redirection error: cannot duplicate fd" +msgstr "chyba přesměrování: deskriptor souboru nelze duplikovat" + +#: shell.c:339 +msgid "could not find /tmp, please create!" +msgstr "nelze nalézt /tmp, vytvořte jej, prosím!" + +#: shell.c:343 +msgid "/tmp must be a valid directory name" +msgstr "/tmp musí být platným názvem pro adresář" + +#: shell.c:890 +#, c-format +msgid "%c%c: invalid option" +msgstr "%c%c: chybný přepínač" + +#: shell.c:1682 +msgid "I have no name!" +msgstr "Nemám žádné jméno!" + +#: shell.c:1827 +#, c-format +msgid "GNU bash, version %s-(%s)\n" +msgstr "GNU bash, verze %s-(%s)\n" + +#: shell.c:1828 +#, c-format +msgid "" +"Usage:\t%s [GNU long option] [option] ...\n" +"\t%s [GNU long option] [option] script-file ...\n" +msgstr "" +"Použití:\t%s [Dlouhý GNU přepínač] [přepínač]…\n" +"\t%s [Dlouhý GNU přepínač] [přepínač] skriptový_soubor…\n" + +#: shell.c:1830 +msgid "GNU long options:\n" +msgstr "Dlouhé GNU přepínače:\n" + +#: shell.c:1834 +msgid "Shell options:\n" +msgstr "Přepínače shellu:\n" + +#: shell.c:1835 +msgid "\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n" +msgstr "\t-ilrsD nebo -c příkaz nebo -O shopt_přepínač\t(pouze při vyvolání)\n" + +#: shell.c:1850 +#, c-format +msgid "\t-%s or -o option\n" +msgstr "\t-%s nebo -o přepínač\n" + +#: shell.c:1856 +#, c-format +msgid "Type `%s -c \"help set\"' for more information about shell options.\n" +msgstr "" +"Podrobnosti o přepínačích shellu získáte tím, že napíšete „%s -c \"help set" +"\"“.\n" + +#: shell.c:1857 +#, c-format +msgid "Type `%s -c help' for more information about shell builtin commands.\n" +msgstr "" +"Podrobnosti o příkazech vestavěných do shellu získáte tím, že\n" +"napiÅ¡te „%s -c help“.\n" + +#: shell.c:1858 +#, c-format +msgid "Use the `bashbug' command to report bugs.\n" +msgstr "Chyby nahlásíte příkazem „bashbug“.\n" + +#: sig.c:691 +#, c-format +msgid "sigprocmask: %d: invalid operation" +msgstr "sigprocmask: %d: neplatná operace" + +#: siglist.c:48 +msgid "Bogus signal" +msgstr "FaleÅ¡ný signál" + +# Překlady názvů signálů převzaty (s mírnými úpravami) z české překladu +# manuálové stránky signal(7). +#: siglist.c:51 +msgid "Hangup" +msgstr "Linka terminálu zavěšena" + +#: siglist.c:55 +msgid "Interrupt" +msgstr "PřeruÅ¡ení" + +#: siglist.c:59 +msgid "Quit" +msgstr "Ukončení" + +#: siglist.c:63 +msgid "Illegal instruction" +msgstr "Neplatná instrukce" + +#: siglist.c:67 +msgid "BPT trace/trap" +msgstr "PřeruÅ¡ení při ladění" + +#: siglist.c:75 +msgid "ABORT instruction" +msgstr "Ukončení funkcí abort()" + +#: siglist.c:79 +msgid "EMT instruction" +msgstr "Instrukce EMT" + +#: siglist.c:83 +msgid "Floating point exception" +msgstr "Výjimka při práci s pohyblivou řádovou čárkou" + +#: siglist.c:87 +msgid "Killed" +msgstr "Zabit" + +#: siglist.c:91 +msgid "Bus error" +msgstr "Chyba sběrnice" + +#: siglist.c:95 +msgid "Segmentation fault" +msgstr "Chyba segmentace" + +#: siglist.c:99 +msgid "Bad system call" +msgstr "Å patné volání systému" + +#: siglist.c:103 +msgid "Broken pipe" +msgstr "Z roury nikdo nečte" + +#: siglist.c:107 +msgid "Alarm clock" +msgstr "Signál časovače" + +#: siglist.c:111 +msgid "Terminated" +msgstr "Ukončit" + +#: siglist.c:115 +msgid "Urgent IO condition" +msgstr "Čekají urgentní I/O data" + +#: siglist.c:119 +msgid "Stopped (signal)" +msgstr "Pozastaveno (signálem)" + +#: siglist.c:127 +msgid "Continue" +msgstr "Pokračovat" + +#: siglist.c:135 +msgid "Child death or stop" +msgstr "Potomek byl pozastaven nebo zemřel" + +#: siglist.c:139 +msgid "Stopped (tty input)" +msgstr "Pozastaveno (vstupem TTY)" + +#: siglist.c:143 +msgid "Stopped (tty output)" +msgstr "Pozastaveno (výstupem na TTY)" + +#: siglist.c:147 +msgid "I/O ready" +msgstr "I/O je připraveno" + +#: siglist.c:151 +msgid "CPU limit" +msgstr "Dosažen limit procesorového času" + +#: siglist.c:155 +msgid "File limit" +msgstr "Dosažen limit velikosti souboru" + +#: siglist.c:159 +msgid "Alarm (virtual)" +msgstr "Časovač (virtuální)" + +#: siglist.c:163 +msgid "Alarm (profile)" +msgstr "Časovač (profilovací)" + +#: siglist.c:167 +msgid "Window changed" +msgstr "Změna okna" + +# XXX: SIGLOST +#: siglist.c:171 +msgid "Record lock" +msgstr "Zámek záznamu" + +#: siglist.c:175 +msgid "User signal 1" +msgstr "Uživatelský signal 1" + +#: siglist.c:179 +msgid "User signal 2" +msgstr "Uživatelský signál 2" + +# FIXME: HFT znamená High Frequency Timer? Zkontrolovat i další výskyty +#: siglist.c:183 +msgid "HFT input data pending" +msgstr "vstupní data HFT čekají" + +#: siglist.c:187 +msgid "power failure imminent" +msgstr "hrozí selhání napájení" + +#: siglist.c:191 +msgid "system crash imminent" +msgstr "hrozí selhání systému" + +#: siglist.c:195 +msgid "migrate process to another CPU" +msgstr "přesunout proces na jiný procesor" + +#: siglist.c:199 +msgid "programming error" +msgstr "chyba programování" + +#: siglist.c:203 +msgid "HFT monitor mode granted" +msgstr "Režim HFT sledování přidělen" + +#: siglist.c:207 +msgid "HFT monitor mode retracted" +msgstr "Režim HFT sledování odebrán" + +#: siglist.c:211 +msgid "HFT sound sequence has completed" +msgstr "HFT zvuková posloupnost byla dokončena" + +#: siglist.c:215 +msgid "Information request" +msgstr "Požadavek o informaci" + +#: siglist.c:223 +msgid "Unknown Signal #" +msgstr "Neznámé číslo signálu" + +#: siglist.c:225 +#, c-format +msgid "Unknown Signal #%d" +msgstr "Neznámý signál č. %d" + +#: subst.c:1362 subst.c:1520 +#, c-format +msgid "bad substitution: no closing `%s' in %s" +msgstr "chybná substituce: v %2$s chybí uzavírací „%1$s“" + +#: subst.c:2847 +#, c-format +msgid "%s: cannot assign list to array member" +msgstr "%s: seznam nelze přiřadit do prvku pole" + +#: subst.c:5065 subst.c:5081 +msgid "cannot make pipe for process substitution" +msgstr "nelze vyrobit rouru za účelem substituce procesu" + +#: subst.c:5113 +msgid "cannot make child for process substitution" +msgstr "nelze vytvořit potomka za účelem substituce procesu" + +#: subst.c:5158 +#, c-format +msgid "cannot open named pipe %s for reading" +msgstr "pojmenovanou rouru %s nelze otevřít pro čtení" + +#: subst.c:5160 +#, c-format +msgid "cannot open named pipe %s for writing" +msgstr "pojmenovanou rouru %s nelze otevřít pro zápis" + +#: subst.c:5178 +#, c-format +msgid "cannot duplicate named pipe %s as fd %d" +msgstr "pojmenovanou rouru %s nelze zdvojit jako deskriptor %d" + +#: subst.c:5376 +msgid "cannot make pipe for command substitution" +msgstr "nelze vytvořit rouru pro substituci příkazu" + +#: subst.c:5414 +msgid "cannot make child for command substitution" +msgstr "nelze vytvořit potomka pro substituci příkazu" + +#: subst.c:5433 +msgid "command_substitute: cannot duplicate pipe as fd 1" +msgstr "command_substitute: rouru nelze zdvojit jako deskriptor 1" + +#: subst.c:5837 subst.c:8050 +#, c-format +msgid "%s: invalid variable name for name reference" +msgstr "%s: neplatný název proměnné pro odkaz na název" + +#: subst.c:6048 +#, c-format +msgid "%s: parameter null or not set" +msgstr "%s: parametr null nebo nenastaven" + +#: subst.c:6320 subst.c:6335 +#, c-format +msgid "%s: substring expression < 0" +msgstr "%s: výraz podřetězce < 0" + +#: subst.c:7506 +#, c-format +msgid "%s: bad substitution" +msgstr "%s: chybná substituce" + +#: subst.c:7583 +#, c-format +msgid "$%s: cannot assign in this way" +msgstr "$%s: takto nelze přiřazovat" + +#: subst.c:7917 +msgid "" +"future versions of the shell will force evaluation as an arithmetic " +"substitution" +msgstr "" +"budoucá verze tohoto shellu budou vynucovat vyhodnocení jako aritmetickou " +"substituci" + +#: subst.c:8421 +#, c-format +msgid "bad substitution: no closing \"`\" in %s" +msgstr "chybná substituce: v %s chybí uzavírací „`“" + +#: subst.c:9322 +#, c-format +msgid "no match: %s" +msgstr "žádná shoda: %s" + +#: test.c:147 +msgid "argument expected" +msgstr "očekáván argument" + +#: test.c:156 +#, c-format +msgid "%s: integer expression expected" +msgstr "%s: očekáván celočíselný výraz" + +#: test.c:264 +msgid "`)' expected" +msgstr "očekávána „)“" + +#: test.c:266 +#, c-format +msgid "`)' expected, found %s" +msgstr "očekávána „)“, nalezeno %s" + +#: test.c:281 test.c:742 test.c:745 +#, c-format +msgid "%s: unary operator expected" +msgstr "%s: očekáván unární operátor" + +#: test.c:468 test.c:785 +#, c-format +msgid "%s: binary operator expected" +msgstr "%s: očekáván binární operátor" + +#: test.c:860 +msgid "missing `]'" +msgstr "postrádám „]“" + +#: trap.c:217 +msgid "invalid signal number" +msgstr "neplatné číslo signálu" + +#: trap.c:371 +#, c-format +msgid "run_pending_traps: bad value in trap_list[%d]: %p" +msgstr "run_pending_traps: chybná hodnota v trap_list[%d]: %p" + +#: trap.c:375 +#, c-format +msgid "" +"run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" +msgstr "run_pending_traps: obsluha signálu je SIG_DFL, přeposílám %d (%s) sobě" + +#: trap.c:428 +#, c-format +msgid "trap_handler: bad signal %d" +msgstr "trap_handler: chybný signál %d" + +#: variables.c:382 +#, c-format +msgid "error importing function definition for `%s'" +msgstr "chyba při importu definice „%s“" + +#: variables.c:780 +#, c-format +msgid "shell level (%d) too high, resetting to 1" +msgstr "úroveň shellu (%d) příliÅ¡ vysoká, resetuji na 1" + +#: variables.c:1865 +#, c-format +msgid "%s: circular name reference" +msgstr "%s: kruhový odkaz na název" + +#: variables.c:2228 +msgid "make_local_variable: no function context at current scope" +msgstr "make_local_variable: žádný kontext funkce v aktuálním rozsahu" + +#: variables.c:2247 +#, c-format +msgid "%s: variable may not be assigned value" +msgstr "%s: hodnotu nelze do proměnné přiřadit" + +#: variables.c:3646 +msgid "all_local_variables: no function context at current scope" +msgstr "all_local_variables: žádný kontext funkce v aktuálním rozsahu" + +#: variables.c:3891 +#, c-format +msgid "%s has null exportstr" +msgstr "%s: má nullový exportstr" + +#: variables.c:3896 variables.c:3905 +#, c-format +msgid "invalid character %d in exportstr for %s" +msgstr "neplatný znak %d v exportstr pro %s" + +#: variables.c:3911 +#, c-format +msgid "no `=' in exportstr for %s" +msgstr "v exportstr pro %s chybí „=“" + +#: variables.c:4344 +msgid "pop_var_context: head of shell_variables not a function context" +msgstr "pop_var_context: hlava shell_variables není kontextem funkce" + +#: variables.c:4357 +msgid "pop_var_context: no global_variables context" +msgstr "pop_var_context: chybí kontext global_variables" + +#: variables.c:4431 +msgid "pop_scope: head of shell_variables not a temporary environment scope" +msgstr "pop_scope: hlava shell_variables není dočasným rozsahem prostředí" + +#: variables.c:5257 +#, c-format +msgid "%s: %s: cannot open as FILE" +msgstr "%s: %s: nelze otevřít jako SOUBOR" + +#: variables.c:5262 +#, c-format +msgid "%s: %s: invalid value for trace file descriptor" +msgstr "%s: %s: neplatná hodnota pro deskriptor trasovacího souboru" + +#: variables.c:5307 +#, c-format +msgid "%s: %s: compatibility value out of range" +msgstr "%s: %s: hodnota kompatibility je mimo rozsah" + +#: version.c:46 +msgid "Copyright (C) 2013 Free Software Foundation, Inc." +msgstr "Copyright © 2013 Free Software Foundation, Inc." + +#: version.c:47 version2.c:47 +msgid "" +"License GPLv3+: GNU GPL version 3 or later \n" +msgstr "" +"Licence GPLv3+: GNU GPL verze 3 nebo novější \n" + +#: version.c:86 version2.c:86 +#, c-format +msgid "GNU bash, version %s (%s)\n" +msgstr "GNU bash, verze %s (%s)\n" + +#: version.c:91 version2.c:91 +msgid "This is free software; you are free to change and redistribute it." +msgstr "Toto je svobodné programové vybavení: máte právo jej měnit a šířit." + +#: version.c:92 version2.c:92 +msgid "There is NO WARRANTY, to the extent permitted by law." +msgstr "VEÅ KERÉ ZÁRUKY chybí, jak jen zákon dovoluje." + +#: version2.c:46 +msgid "Copyright (C) 2012 Free Software Foundation, Inc." +msgstr "Copyright © 2012 Free Software Foundation, Inc." + +#: xmalloc.c:91 +#, c-format +msgid "%s: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "%s: nelze alokovat %'lu bajtů (alokováno %'lu bajtů)" + +#: xmalloc.c:93 +#, c-format +msgid "%s: cannot allocate %lu bytes" +msgstr "%s: nezle alokovat %'lu bajtů" + +#: xmalloc.c:163 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "%s: %s:%d: nelze alokovat %'lu bajtů (alokováno %'lu bajtů)" + +#: xmalloc.c:165 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes" +msgstr "%s: %s:%d: nelze alokovat %'lu bajtů" + +#: builtins.c:43 +msgid "alias [-p] [name[=value] ... ]" +msgstr "alias [-p] [název[=hodnota] …]" + +#: builtins.c:47 +msgid "unalias [-a] name [name ...]" +msgstr "unalias [-a] název [název…]" + +#: builtins.c:51 +msgid "" +"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-" +"x keyseq:shell-command] [keyseq:readline-function or readline-command]" +msgstr "" +"bind [-lpsvPSVX] [-m klávmapa] [-f soubor] [-q název] [-u název] [-r " +"klávposl] [-x klávposl:příkaz-shellu] [klávposl:readline-funkce nebo " +"readline-příkaz]" + +#: builtins.c:54 +msgid "break [n]" +msgstr "break [n]" + +#: builtins.c:56 +msgid "continue [n]" +msgstr "continue [n]" + +#: builtins.c:58 +msgid "builtin [shell-builtin [arg ...]]" +msgstr "builtin [vestavěný-příkaz-shellu [argument…]]" + +#: builtins.c:61 +msgid "caller [expr]" +msgstr "caller [výraz]" + +#: builtins.c:64 +msgid "cd [-L|[-P [-e]] [-@]] [dir]" +msgstr "cd [-L|[-P [-e]] [-@]] [adresář]" + +#: builtins.c:66 +msgid "pwd [-LP]" +msgstr "pwd [-LP]" + +#: builtins.c:68 +msgid ":" +msgstr ":" + +#: builtins.c:70 +msgid "true" +msgstr "true" + +#: builtins.c:72 +msgid "false" +msgstr "false" + +#: builtins.c:74 +msgid "command [-pVv] command [arg ...]" +msgstr "command [-pVv] příkaz [argument…]" + +#: builtins.c:76 +msgid "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" +msgstr "declare [-aAfFgilnrtux] [-p] [název[=hodnota]…]" + +#: builtins.c:78 +msgid "typeset [-aAfFgilrtux] [-p] name[=value] ..." +msgstr "typeset [-aAfFgilrtux] [-p] název[=hodnota]…" + +#: builtins.c:80 +msgid "local [option] name[=value] ..." +msgstr "local [přepínač] název[=hodnota]…" + +#: builtins.c:83 +msgid "echo [-neE] [arg ...]" +msgstr "echo [-neE] [argument…]" + +#: builtins.c:87 +msgid "echo [-n] [arg ...]" +msgstr "echo [-n] [argument…]" + +#: builtins.c:90 +msgid "enable [-a] [-dnps] [-f filename] [name ...]" +msgstr "enable [-a] [-dnps] [-f soubor] [název…]" + +#: builtins.c:92 +msgid "eval [arg ...]" +msgstr "eval [argument…]" + +#: builtins.c:94 +msgid "getopts optstring name [arg]" +msgstr "getopts optstring name [argument]" + +#: builtins.c:96 +msgid "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" +msgstr "exec [-cl] [-a název] [příkaz [argument…]] [přesměrování…]" + +#: builtins.c:98 +msgid "exit [n]" +msgstr "exit [n]" + +#: builtins.c:100 +msgid "logout [n]" +msgstr "logout [n]" + +#: builtins.c:103 +msgid "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" +msgstr "" +"fc [-e enázev] [-lnr] [první] [poslední] nebo fc -s [vzor=náhrada] [příkaz]" + +#: builtins.c:107 +msgid "fg [job_spec]" +msgstr "fg [úloha]" + +#: builtins.c:111 +msgid "bg [job_spec ...]" +msgstr "bg [úloha…]" + +#: builtins.c:114 +msgid "hash [-lr] [-p pathname] [-dt] [name ...]" +msgstr "hash [-lr] [-p název_cesty] [-dt] [název…]" + +#: builtins.c:117 +msgid "help [-dms] [pattern ...]" +msgstr "help [-dms] [vzorek…]" + +#: builtins.c:121 +msgid "" +"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg " +"[arg...]" +msgstr "" +"history [-c] [-d pozice] [n] nebo history -anrw [jméno_souboru] nebo history " +"-ps argument [argument…]" + +#: builtins.c:125 +msgid "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" +msgstr "jobs [-lnprs] [úloha…] nebo jobs -x příkaz [argumenty]" + +#: builtins.c:129 +msgid "disown [-h] [-ar] [jobspec ...]" +msgstr "disown [-h] [-ar] [úloha…]" + +#: builtins.c:132 +msgid "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l " +"[sigspec]" +msgstr "" +"kill [-s sigspec | -n číssig | -sigspec] pid | úloha… nebo kill -l [sigspec]" + +#: builtins.c:134 +msgid "let arg [arg ...]" +msgstr "let argument [argument…]" + +#: builtins.c:136 +msgid "" +"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p " +"prompt] [-t timeout] [-u fd] [name ...]" +msgstr "" +"read [-ers] [-a pole] [-d oddělovač] [-i text] [-n p_znaků] [-N p_znaků] [-p " +"výzva] [-t limit] [-u fd] [jméno…]" + +#: builtins.c:138 +msgid "return [n]" +msgstr "return [n]" + +#: builtins.c:140 +msgid "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" +msgstr "set [-abefhkmnptuvxBCHP] [-o název_přepínače] [--] [argument…]" + +#: builtins.c:142 +msgid "unset [-f] [-v] [-n] [name ...]" +msgstr "unset [-f] [-v] [-n] [jméno…]" + +#: builtins.c:144 +msgid "export [-fn] [name[=value] ...] or export -p" +msgstr "export [-fn] [název[=hodnota]…] nebo export -p" + +#: builtins.c:146 +msgid "readonly [-aAf] [name[=value] ...] or readonly -p" +msgstr "readonly [-aAf] [název[=hodnota]…] nebo readonly -p" + +#: builtins.c:148 +msgid "shift [n]" +msgstr "shift [n]" + +#: builtins.c:150 +msgid "source filename [arguments]" +msgstr "source název_souboru [argumenty]" + +#: builtins.c:152 +msgid ". filename [arguments]" +msgstr ". název_souboru [argumenty]" + +#: builtins.c:155 +msgid "suspend [-f]" +msgstr "suspend [-f]" + +#: builtins.c:158 +msgid "test [expr]" +msgstr "test [výraz]" + +#: builtins.c:160 +msgid "[ arg... ]" +msgstr "[ argument… ]" + +#: builtins.c:162 +msgid "times" +msgstr "times" + +#: builtins.c:164 +msgid "trap [-lp] [[arg] signal_spec ...]" +msgstr "trap [-lp] [[argument] signal_spec…]" + +#: builtins.c:166 +msgid "type [-afptP] name [name ...]" +msgstr "type [-afptP] název [název…]" + +#: builtins.c:169 +msgid "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" +msgstr "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" + +#: builtins.c:172 +msgid "umask [-p] [-S] [mode]" +msgstr "umask [-p] [-S] [mód]" + +#: builtins.c:175 +msgid "wait [-n] [id ...]" +msgstr "wait [-n] [id…]" + +#: builtins.c:179 +msgid "wait [pid ...]" +msgstr "wait [pid…]" + +#: builtins.c:182 +msgid "for NAME [in WORDS ... ] ; do COMMANDS; done" +msgstr "for NÁZEV [in SLOVECH…] ; do PŘÍKAZY; done" + +#: builtins.c:184 +msgid "for (( exp1; exp2; exp3 )); do COMMANDS; done" +msgstr "for (( výr1; výr2; výr3 )); do PŘÍKAZY; done" + +#: builtins.c:186 +msgid "select NAME [in WORDS ... ;] do COMMANDS; done" +msgstr "select NÁZEV [in SLOVA…;] do PŘÍKAZY; done" + +#: builtins.c:188 +msgid "time [-p] pipeline" +msgstr "time [-p] kolona" + +#: builtins.c:190 +msgid "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" +msgstr "case SLOVO in [VZOR [| VZOR]…) PŘÍKAZY ;;]… esac" + +#: builtins.c:192 +msgid "" +"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else " +"COMMANDS; ] fi" +msgstr "" +"if PŘÍKAZY; then PŘÍKAZY; [ elif PŘÍKAZY; then PŘÍKAZY; ]… [ else PŘÍKAZY; ] " +"fi" + +#: builtins.c:194 +msgid "while COMMANDS; do COMMANDS; done" +msgstr "while PŘÍKAZY; do PŘÍKAZY; done" + +#: builtins.c:196 +msgid "until COMMANDS; do COMMANDS; done" +msgstr "until PŘÍKAZY; do PŘÍKAZY; done" + +#: builtins.c:198 +msgid "coproc [NAME] command [redirections]" +msgstr "command [NÁZEV] příkaz [přesměrování]" + +#: builtins.c:200 +msgid "function name { COMMANDS ; } or name () { COMMANDS ; }" +msgstr "function jméno { PŘÍKAZY ; } nebo jméno () { PŘÍKAZY ; }" + +#: builtins.c:202 +msgid "{ COMMANDS ; }" +msgstr "{ PŘÍKAZY ; }" + +#: builtins.c:204 +msgid "job_spec [&]" +msgstr "úloha [&]" + +#: builtins.c:206 +msgid "(( expression ))" +msgstr "(( výraz ))" + +#: builtins.c:208 +msgid "[[ expression ]]" +msgstr "[[ výraz ]]" + +# XXX: "variable" je literál na seznamy vestavěných příkazů +#: builtins.c:210 +msgid "variables - Names and meanings of some shell variables" +msgstr "variables – názvy a významy některých proměnných shellu" + +#: builtins.c:213 +msgid "pushd [-n] [+N | -N | dir]" +msgstr "pushd [-n] [+N | -N | adresář]" + +#: builtins.c:217 +msgid "popd [-n] [+N | -N]" +msgstr "popd [-n] [+N | -N]" + +#: builtins.c:221 +msgid "dirs [-clpv] [+N] [-N]" +msgstr "dirs [-clpv] [+N] [-N]" + +#: builtins.c:224 +msgid "shopt [-pqsu] [-o] [optname ...]" +msgstr "shopt [-pqsu] [-o] [název_volby…]" + +#: builtins.c:226 +msgid "printf [-v var] format [arguments]" +msgstr "printf [-v proměnná] formát [argumenty]" + +#: builtins.c:229 +msgid "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-" +"W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S " +"suffix] [name ...]" +msgstr "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o přepínač] [-A akce] [-G globvzor] [-" +"W seznam_slov] [-F funkce] [-C příkaz] [-X filtrvzor] [-P předpona] [-S " +"přípona] [název…]" + +#: builtins.c:233 +msgid "" +"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " +"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" +msgstr "" +"compgen [-abcdefgjksuv] [-o přepínač] [-A akce] [-G globvzor] [-W " +"seznam_slov] [-F funkce] [-C příkaz] [-X filtrvzor] [-P předpona] [-S " +"přípona] [slovo]" + +#: builtins.c:237 +msgid "compopt [-o|+o option] [-DE] [name ...]" +msgstr "compopt [-o|+o možnost] [-DE] [název…]" + +#: builtins.c:240 +msgid "" +"mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" +"mapfile [-n počet] [-O počátek] [-s počet] [-t] [-u fd] [-C volání] [-c " +"množství] [pole]" + +#: builtins.c:242 +msgid "" +"readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" +"readarray [-n počet] [-O počátek] [-s počet] [-t] [-u fd] [-C volání] [-c " +"množství] [pole]" + +#: builtins.c:254 +msgid "" +"Define or display aliases.\n" +" \n" +" Without arguments, `alias' prints the list of aliases in the reusable\n" +" form `alias NAME=VALUE' on standard output.\n" +" \n" +" Otherwise, an alias is defined for each NAME whose VALUE is given.\n" +" A trailing space in VALUE causes the next word to be checked for\n" +" alias substitution when the alias is expanded.\n" +" \n" +" Options:\n" +" -p\tPrint all defined aliases in a reusable format\n" +" \n" +" Exit Status:\n" +" alias returns true unless a NAME is supplied for which no alias has " +"been\n" +" defined." +msgstr "" +"Definuje nebo zobrazí aliasy.\n" +" \n" +" „alias“ bez argumentů vypíše na standardní výstup seznam aliasů ve " +"znovu\n" +" použitelném formátu NÁZEV=HODNOTA.\n" +" \n" +" Jinak bude definován alias pro každý NÁZEV, který má zadanou HODNOTU.\n" +" Závěrečná mezera v HODNOTĚ způsobí, že při expanzi bude následující " +"slovo\n" +" zkontrolováno na substituci aliasů.\n" +" \n" +" Přepínače:\n" +" -p\tVypíše vÅ¡echny definované aliasy ve znovu použitelném formátu\n" +" \n" +" Návratový kód:\n" +" alias vrátí pravdu, pokud nebyl zadán NÁZEV, pro který není žádný alias\n" +" definován." + +#: builtins.c:276 +msgid "" +"Remove each NAME from the list of defined aliases.\n" +" \n" +" Options:\n" +" -a\tremove all alias definitions.\n" +" \n" +" Return success unless a NAME is not an existing alias." +msgstr "" +"Odstraní každý NÁZEV ze seznamů definovaných aliasů.\n" +" \n" +" Přepínače:\n" +" -a\todstraní vÅ¡echny definice aliasů. \n" +" Vrací úspěch, pokud NÁZEV není neexistující alias." + +#: builtins.c:289 +msgid "" +"Set Readline key bindings and variables.\n" +" \n" +" Bind a key sequence to a Readline function or a macro, or set a\n" +" Readline variable. The non-option argument syntax is equivalent to\n" +" that found in ~/.inputrc, but must be passed as a single argument:\n" +" e.g., bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Options:\n" +" -m keymap Use KEYMAP as the keymap for the duration of this\n" +" command. Acceptable keymap names are emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" +"move,\n" +" vi-command, and vi-insert.\n" +" -l List names of functions.\n" +" -P List function names and bindings.\n" +" -p List functions and bindings in a form that can be\n" +" reused as input.\n" +" -S List key sequences that invoke macros and their " +"values\n" +" -s List key sequences that invoke macros and their " +"values\n" +" in a form that can be reused as input.\n" +" -V List variable names and values\n" +" -v List variable names and values in a form that can\n" +" be reused as input.\n" +" -q function-name Query about which keys invoke the named function.\n" +" -u function-name Unbind all keys which are bound to the named " +"function.\n" +" -r keyseq Remove the binding for KEYSEQ.\n" +" -f filename Read key bindings from FILENAME.\n" +" -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when\n" +" \t\t\t\tKEYSEQ is entered.\n" +" -X\t\t List key sequences bound with -x and associated commands\n" +" in a form that can be reused as input.\n" +" \n" +" Exit Status:\n" +" bind returns 0 unless an unrecognized option is given or an error occurs." +msgstr "" +"Nastaví klávesové zkratky a proměnné Readline.\n" +" \n" +" Naváže posloupnost kláves na Readline funkci nebo makro nebo nastaví\n" +" Readline proměnnou. Syntaxe nepřepínačových argumentů je shodná se\n" +" syntaxí ~/.inputrc, ale musí být zadána jako jediný argument:\n" +" např. bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Přepínače:\n" +" -m klávmapa Použije KLÁVMAPU jako klávesovou mapu pro trvání\n" +" tohoto příkazu. Možné klávesové mapy jsou emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" +"move,\n" +" vi-command a vi-insert.\n" +" -l Vypíše seznam názvů funkcí.\n" +" -P Vypíše seznam názvů funkcí a klávesových vazeb.\n" +" -p Vypíše seznam funkcí a klávesových vazeb ve " +"formátu,\n" +" který lze použít jako vstup.\n" +" -S Vypíše seznam posloupností kláves,\n" +" které vyvolávají makra, a jejich hodnoty.\n" +" -s Vypíše seznam posloupností kláves,\n" +" která vyvolávají makra, a jejich hodnoty ve " +"formátu,\n" +" který lze použít jako vstup.\n" +" -V Vypíše seznam názvů proměnných a hodnot.\n" +" -v Vypíše seznam názvů proměnných a hodnot ve " +"formátu,\n" +" který lze použít jako vstup.\n" +" -q název-funkce Dotáže se, které klávesy vyvolají zadanou funkci.\n" +" -u název-funkce Zruší vÅ¡echny vazby na klávesy, které jsou " +"napojeny\n" +" na zadanou funkci.\n" +" -r klávposl Odstraní vazbu na KLÁVPOSL.\n" +" -f soubor Načte vazby kláves ze SOUBORU.\n" +" -x klávposl:příkaz-shellu\n" +" Způsobí, že bude vykonán PŘÍKAZ-SHELLU, když bude\n" +" zadána KLÁVPOSL.\n" +" -X Vypíše posloupnosti kláves a příkazy přidružené " +"přes\n" +" přepínač -x ve formátu, který lze použít jako " +"vstup.\n" +" \n" +" Návratový kód:\n" +" bind vrací 0, pokud není zadán nerozpoznaný přepínač nebo nedojde " +"k chybě." + +#: builtins.c:328 +msgid "" +"Exit for, while, or until loops.\n" +" \n" +" Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n" +" loops.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Ukončí smyčku for, whle nebo until.\n" +" \n" +" Ukončí smyčku FOR, WHILE nebo UNTIL. Je-li zadáno N, ukončí N\n" +" obklopujících smyček.\n" +" \n" +" Návratový kód:\n" +" Návratový kód je 0, pokud N je větší nebo rovno 1." + +#: builtins.c:340 +msgid "" +"Resume for, while, or until loops.\n" +" \n" +" Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n" +" If N is specified, resumes the Nth enclosing loop.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Obnoví smyčku for, while nebo until.\n" +" \n" +" Přejde k další iteraci obklopující smyčky FOR, WHILE nebo UNTIL.\n" +" Je-li zadáno N, bude tak učiněno v N. obklopující smyčce. \n" +" Návratový kód:\n" +" Návratový kód je 0, pokud N je větší nebo rovno 1." + +#: builtins.c:352 +msgid "" +"Execute shell builtins.\n" +" \n" +" Execute SHELL-BUILTIN with arguments ARGs without performing command\n" +" lookup. This is useful when you wish to reimplement a shell builtin\n" +" as a shell function, but need to execute the builtin within the " +"function.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n" +" not a shell builtin.." +msgstr "" +"Provede vestavěný příkaz shellu.\n" +" \n" +" Provede VESTAVĚNÝ-PŘÍKAZ-SHELLU s argumenty ARGUMENTY, aniž by se " +"uplatnilo\n" +" vyhledávání příkazu. Toto se hodí, když si přejete reimplementovat\n" +" vestavěný příkaz shellu jako funkci shellu, avÅ¡ak potřebujete spustit\n" +" vestavěný příkaz uvnitř této funkce.\n" +" \n" +" Návratový kód:\n" +" Vrací návratový kód VESTAVĚNÉHO-PŘÍKAZU-SHELLU, nebo nepravdu, pokud\n" +" VESTAVĚNÝ-PŘÍKAZ-SHELLU není vestavěným příkazem shellu." + +#: builtins.c:367 +msgid "" +"Return the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns \"$line $filename\". With EXPR, returns\n" +" \"$line $subroutine $filename\"; this extra information can be used to\n" +" provide a stack trace.\n" +" \n" +" The value of EXPR indicates how many call frames to go back before the\n" +" current one; the top frame is frame 0.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless the shell is not executing a shell function or EXPR\n" +" is invalid." +msgstr "" +"Vrátí kontext aktuálního podprogramu.\n" +" \n" +" Bez VÝRAZU vrátí „$řádek $název_souboru“. S VÝRAZEM vrátí\n" +" „$řádek $podprogram $název_souboru“; tuto zvláštní informaci lze\n" +" využít pro výpis zásobníku volání.\n" +" \n" +" Hodnota VÝRAZU určuje, kolik rámců volání se má zpětně projít od toho\n" +" současného; vrcholový rámec má číslo 0.\n" +" \n" +" Návratový kód:\n" +" Vrací 0, pokud shell provádí shellovou funkci a VÝRAZ je platný." + +#: builtins.c:385 +msgid "" +"Change the shell working directory.\n" +" \n" +" Change the current directory to DIR. The default DIR is the value of " +"the\n" +" HOME shell variable.\n" +" \n" +" The variable CDPATH defines the search path for the directory " +"containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon " +"(:).\n" +" A null directory name is the same as the current directory. If DIR " +"begins\n" +" with a slash (/), then CDPATH is not used.\n" +" \n" +" If the directory is not found, and the shell option `cdable_vars' is " +"set,\n" +" the word is assumed to be a variable name. If that variable has a " +"value,\n" +" its value is used for DIR.\n" +" \n" +" Options:\n" +" -L\tforce symbolic links to be followed: resolve symbolic links in\n" +" \tDIR after processing instances of `..'\n" +" -P\tuse the physical directory structure without following symbolic\n" +" \tlinks: resolve symbolic links in DIR before processing instances\n" +" \tof `..'\n" +" -e\tif the -P option is supplied, and the current working directory\n" +" \tcannot be determined successfully, exit with a non-zero status\n" +" -@ on systems that support it, present a file with extended " +"attributes\n" +" as a directory containing the file attributes\n" +" \n" +" The default is to follow symbolic links, as if `-L' were specified.\n" +" `..' is processed by removing the immediately previous pathname " +"component\n" +" back to a slash or the beginning of DIR.\n" +" \n" +" Exit Status:\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully " +"when\n" +" -P is used; non-zero otherwise." +msgstr "" +"Změní pracovní adresář shellu.\n" +" \n" +" Změní aktuální adresář na ADR. Implicitní ADR je hodnota proměnné " +"shellu\n" +" HOME.\n" +" \n" +" Proměnná CDPATH definuje vyhledávací cestu pro adresář obsahující ADR.\n" +" Názvy náhradních adresářů v CDPATH se oddělují dvojtečkou (:). Prázdný\n" +" název adresáře je stejný jako aktuální adresář. Začíná-li ADR na " +"lomítko\n" +" (/), nebude CDPATH použita.\n" +" \n" +" Nebude-li adresář nalezen a přepínač shellu „cdable_vars“ bude " +"nastaven,\n" +" pak se dané slovo zkusí jakožto název proměnné. Má-li taková proměnná\n" +" hodnotu, pak její hodnota se použije jako ADR.\n" +" \n" +" Přepínače:\n" +" -L\tvynutí následování symbolických odkazů: vyhodnotí symbolické\n" +" \todkazy v ADR po zpracování vÅ¡ech výskytů „..“\n" +" -P\tnařizuje použít fyzickou adresářovou strukturu namísto\n" +" \tnásledování symbolických odkazů: vyhodnotí symbolické odkazy v ADR\n" +" \tpřed zpracováním vÅ¡ech výskytů „..“\n" +" -e\tje-li zadán přepínač -P a současný pracovní adresář nelze\n" +" \tzdárně zjistit, skončí s nenulovým návratovým kódem\n" +" -@ na systémech, které to podporují, vydává soubor s rozšířenými\n" +" atributy jako adresář obsahující atributy souboru\n" +" \n" +" Symbolické odkazy se implicitně následují, jako by bylo zadáno „-L“.\n" +" „..“ se zpracovávají tak, že se odstraní bezprostředně předcházející\n" +" část cesty až k lomítku nebo začátku ADR.\n" +" \n" +" Návratový kód:\n" +" Vrací 0, byl-li adresář změněn a, byl-li zadán -P, $PWD byla úspěšně\n" +" nastavena. Jinak vrací nenulovou hodnotu." + +#: builtins.c:422 +msgid "" +"Print the name of the current working directory.\n" +" \n" +" Options:\n" +" -L\tprint the value of $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tprint the physical directory, without any symbolic links\n" +" \n" +" By default, `pwd' behaves as if `-L' were specified.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless an invalid option is given or the current directory\n" +" cannot be read." +msgstr "" +"Vypíše název současného pracovního adresáře.\n" +" \n" +" Přepínače:\n" +" -L\tvypíše hodnotu $PWD, pokud pojmenovává současný pracovní\n" +" \tadresář\n" +" -P\tvypíše fyzický adresář prostý vÅ¡ech symbolických odkazů\n" +" \n" +" Implicitně se „pwd“ chová, jako by bylo zadáno „-L“.\n" +" \n" +" Návratový kód:\n" +" Vrací 0, nebyl-li zadán neplatný přepínač a mohl-li být současný\n" +" adresář přečten." + +#: builtins.c:439 +msgid "" +"Null command.\n" +" \n" +" No effect; the command does nothing.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Prázdný příkaz.\n" +" \n" +" Žádný účinek, tento příkaz nic nedělá.\n" +" \n" +" Návratový kód:\n" +" Vždy uspěje." + +#: builtins.c:450 +msgid "" +"Return a successful result.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Vrátí výsledek úspěchu.\n" +" \n" +" Návratový kód:\n" +" Vždy uspěje." + +#: builtins.c:459 +msgid "" +"Return an unsuccessful result.\n" +" \n" +" Exit Status:\n" +" Always fails." +msgstr "" +"Vrátí výsledek neúspěchu.\n" +" \n" +" Návratový kód:\n" +" Vždy selže." + +#: builtins.c:468 +msgid "" +"Execute a simple command or display information about commands.\n" +" \n" +" Runs COMMAND with ARGS suppressing shell function lookup, or display\n" +" information about the specified COMMANDs. Can be used to invoke " +"commands\n" +" on disk when a function with the same name exists.\n" +" \n" +" Options:\n" +" -p\tuse a default value for PATH that is guaranteed to find all of\n" +" \tthe standard utilities\n" +" -v\tprint a description of COMMAND similar to the `type' builtin\n" +" -V\tprint a more verbose description of each COMMAND\n" +" \n" +" Exit Status:\n" +" Returns exit status of COMMAND, or failure if COMMAND is not found." +msgstr "" +"Provede jednoduchý příkaz nebo zobrazí podrobnosti o příkazech.\n" +" \n" +" Spustí PŘÍKAZ s ARGUMENTY ignoruje funkce shellu, nebo zobrazí " +"informace\n" +" o zadaných PŘÍKAZECH. Lze využít, když je třeba vyvolat příkazy " +"z disku,\n" +" přičemž existuje funkce stejného jména.\n" +" \n" +" Přepínače:\n" +" -p\tpro PATH bude použita implicitní hodnota, která zaručuje,\n" +" \tže budou nalezeny vÅ¡echny standardní nástroje\n" +" -v\tzobrazí popis PŘÍKAZU podobný vestavěnému příkazu „type“\n" +" -V\tzobrazí podrobnější popis každého PŘÍKAZU\n" +" \n" +" Návratový kód:\n" +" Vrací návratový kód PŘÍKAZU, nebo selže, nebyl–li příkaz nalezen." + +#: builtins.c:487 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Declare variables and give them attributes. If no NAMEs are given,\n" +" display the attributes and values of all variables.\n" +" \n" +" Options:\n" +" -f\trestrict action or display to function names and definitions\n" +" -F\trestrict display to function names only (plus line number and\n" +" \tsource file when debugging)\n" +" -g\tcreate global variables when used in a shell function; otherwise\n" +" \tignored\n" +" -p\tdisplay the attributes and value of each NAME\n" +" \n" +" Options which set attributes:\n" +" -a\tto make NAMEs indexed arrays (if supported)\n" +" -A\tto make NAMEs associative arrays (if supported)\n" +" -i\tto make NAMEs have the `integer' attribute\n" +" -l\tto convert NAMEs to lower case on assignment\n" +" -n\tmake NAME a reference to the variable named by its value\n" +" -r\tto make NAMEs readonly\n" +" -t\tto make NAMEs have the `trace' attribute\n" +" -u\tto convert NAMEs to upper case on assignment\n" +" -x\tto make NAMEs export\n" +" \n" +" Using `+' instead of `-' turns off the given attribute.\n" +" \n" +" Variables with the integer attribute have arithmetic evaluation (see\n" +" the `let' command) performed when the variable is assigned a value.\n" +" \n" +" When used in a function, `declare' makes NAMEs local, as with the " +"`local'\n" +" command. The `-g' option suppresses this behavior.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or a variable\n" +" assignment error occurs." +msgstr "" +"Nastaví hodnoty a atributy proměnných.\n" +" \n" +" Deklaruje proměnné a nastaví jim atributy. Nejsou-li zadány NÁZVY,\n" +" zobrazí atributy a hodnoty vÅ¡ech proměnných.\n" +" \n" +" Přepínače:\n" +" -f\tomezí akci nebo výpis na názvy funkcí a deklarace\n" +" -F\tomezí výpis jen na názvy funkcí (a číslo řádku a název\n" +" \tzdrojového souboru, je-li zapnuto ladění)\n" +" -g\tvytváří globální proměnné, je-li voláno z funkce shellu,\n" +" \tjinak ignorováno\n" +" -p\tzobrazí atributy a hodnotu každého NÁZVU\n" +" \n" +" Přepínače, které nastavují atributy:\n" +" -a\tučiní NÁZVY číslovanými poli (je-li podporováno)\n" +" -A\tučiní NÁZVY asociativními poli (je-li podporováno)\n" +" -i\tpřiřadí NÁZVÅ®M atribut „integer“ (číslo)\n" +" -l\tpřevede NÁZVY na malá písmena v době přiřazení\n" +" -n\tučiní NÁZEV odkazem na proměnnou pojmenovanou podle své hodnoty\n" +" -r\tučiní NÁZVY jen pro čtení\n" +" -t\tpřiřadí NÁZVÅ®M atribut „trace“ (sledování)\n" +" -u\tpřevede NÁZVY na velká písmena v době přiřazení\n" +" -x\tvyexportuje NÁZVY\n" +" \n" +" Pomocí „+“ namísto „-“ daný atribut vypnete.\n" +" \n" +" Proměnné s atributem integer jsou aritmeticky vyhodnoceny (vizte příkaz\n" +" „let“), jakmile je do proměnné přiřazeno.\n" +" \n" +" Je-li použito uvnitř funkce, učiní „declare“ NÁZVY lokálními stejně " +"jako\n" +" příkaz „local“. Přepínač „-g“ toto chování potlačí.\n" +" \n" +" Návratový kód:\n" +" Vrací úspěch, pokud nebyl zadán neplatný přepínač a nedoÅ¡lo k chybě při\n" +" přiřazování do proměnné." + +#: builtins.c:527 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Obsolete. See `help declare'." +msgstr "" +"Nastaví hodnoty a atributy proměnných\n" +" \n" +" Příkaz je zastaralý. Vizte „help declare“." + +#: builtins.c:535 +msgid "" +"Define local variables.\n" +" \n" +" Create a local variable called NAME, and give it VALUE. OPTION can\n" +" be any option accepted by `declare'.\n" +" \n" +" Local variables can only be used within a function; they are visible\n" +" only to the function where they are defined and its children.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied, a variable\n" +" assignment error occurs, or the shell is not executing a function." +msgstr "" +"Definuje lokální proměnné.\n" +" \n" +" Vytvoří lokální proměnnou pojmenovanou NÁZEV a přiřadí jí HODNOTU. " +"PŘEPÍNAČ\n" +" smí být jakýkoliv přepínač přípustný u „declare“.\n" +" \n" +" Lokální proměnné lze použít jen uvnitř funkcí, budou viditelné jen " +"v dané\n" +" funkci a jejich potomcích.\n" +" \n" +" Návratový kód:\n" +" Vrací úspěch, nebyl-li zadán neplatný přepínač, nenastala-li chyba při\n" +" přiřazování do proměnné a vykonává-li shell funkci." + +#: builtins.c:552 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs, separated by a single space character and followed by " +"a\n" +" newline, on the standard output.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" -e\tenable interpretation of the following backslash escapes\n" +" -E\texplicitly suppress interpretation of backslash escapes\n" +" \n" +" `echo' interprets the following backslash-escaped characters:\n" +" \\a\talert (bell)\n" +" \\b\tbackspace\n" +" \\c\tsuppress further output\n" +" \\e\tescape character\n" +" \\E\tescape character\n" +" \\f\tform feed\n" +" \\n\tnew line\n" +" \\r\tcarriage return\n" +" \\t\thorizontal tab\n" +" \\v\tvertical tab\n" +" \\\\\tbackslash\n" +" \\0nnn\tthe character whose ASCII code is NNN (octal). NNN can be\n" +" \t0 to 3 octal digits\n" +" \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" +" \tcan be one or two hex digits\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Vypíše své argumenty na standardní výstup.\n" +" \n" +" Zobrazí své ARGUMENTY oddělené jednou mezerou a zakončené novým řádkem\n" +" na standardní výstup.\n" +" \n" +" Přepínače:\n" +" -n\tnepřipojuje nový řádek\n" +" -e\tzapne interpretování následujících znaků uvozených zpětným " +"lomítkem\n" +" -E\texplicitně potlačí interpretování znaků uvozených zpětným " +"lomítkem\n" +" \n" +" „echo“ interpretuje následující znaky uvozené zpětným lomítkem:\n" +" \\a\tpoplach (zvonek)\n" +" \\b\tbackspace\n" +" \\c\tpotlačí další výstup\n" +" \\e\tznak escapu\n" +" \\E\tznak escapu\n" +" \\f\tposun formuláře (form feed)\n" +" \\n\tnový řádek\n" +" \\r\tnávrat vozíku\n" +" \\t\tvodorovný tabulátor\n" +" \\v\tsvislý tabulátor\n" +" \\\\\tzpětné lomítko\n" +" \\0nnn\tznak, jehož ASCII kód je NNN (osmičkově). NNN smí být\n" +" \t0 až 3 osmičkové číslice\n" +" \\xHH\tosmibitový znak, jehož hodnota je HH (Å¡estnáctkově). HH smí\n" +" \tbýt jedna nebo dvě Å¡estnáctkové číslice\n" +" \n" +" Návratový kód:\n" +" Vrací úspěch, nedojde-li k chybě zápisu na výstup." + +#: builtins.c:588 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs on the standard output followed by a newline.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Vypíše argumenty na standardní výstup.\n" +" \n" +" Na standardním výstupu zobrazí ARGUMENTY následované odřádkováním.\n" +" \n" +" Přepínače:\n" +" -n\tneodřádkovává\n" +" \n" +" Vrací úspěch, nedojte-li k chybě zápisu na výstup." + +#: builtins.c:603 +msgid "" +"Enable and disable shell builtins.\n" +" \n" +" Enables and disables builtin shell commands. Disabling allows you to\n" +" execute a disk command which has the same name as a shell builtin\n" +" without using a full pathname.\n" +" \n" +" Options:\n" +" -a\tprint a list of builtins showing whether or not each is enabled\n" +" -n\tdisable each NAME or display a list of disabled builtins\n" +" -p\tprint the list of builtins in a reusable format\n" +" -s\tprint only the names of Posix `special' builtins\n" +" \n" +" Options controlling dynamic loading:\n" +" -f\tLoad builtin NAME from shared object FILENAME\n" +" -d\tRemove a builtin loaded with -f\n" +" \n" +" Without options, each NAME is enabled.\n" +" \n" +" To use the `test' found in $PATH instead of the shell builtin\n" +" version, type `enable -n test'.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not a shell builtin or an error occurs." +msgstr "" +"Povoluje a zakazuje vestavěné příkazy shellu.\n" +" \n" +" Povoluje a zakazuje vestavěné příkazy shellu. Zakázání vám umožní\n" +" spustit program z disku, který má stejné jméno jako vestavěný příkaz\n" +" shellu, aniž byste museli zadávat celou cestu.\n" +" \n" +" Přepínače:\n" +" -a\tvypíše seznam vestavěných příkazů a vyznačí, který je a který " +"není\n" +" \tpovolen\n" +" -n\tzakáže každý NÁZEV nebo zobrazí seznam zakázaných vestavěných\n" +" \tpříkazů\n" +" -p\tvypíše seznam vestavěných příkazů ve znovu použitelné podobě\n" +" -s\tvypíše pouze názvy posixových „speciálních“ vestavěných příkazů\n" +" \n" +" Přepínače řídící dynamické nahrávání:\n" +" -f\tZavede vestavěný příkaz NÁZEV ze sdíleného objektu NÁZEV_SOUBORU\n" +" -d\tOdstraní vestavění příkaz zavedený pomocí –f\n" +" \n" +" Bez přepínačů povolí vÅ¡echny NÁZVY.\n" +" \n" +" Abyste používali „test“ z $PATH namísto verze vestavěné do shellu,\n" +" napiÅ¡te „enable -n test“.\n" +" \n" +" Návratový kód:\n" +" Vrací úspěch, je-li NÁZEV vestavěným příkazem shellu a nevyskytne-li\n" +" se chyba." + +#: builtins.c:631 +msgid "" +"Execute arguments as a shell command.\n" +" \n" +" Combine ARGs into a single string, use the result as input to the " +"shell,\n" +" and execute the resulting commands.\n" +" \n" +" Exit Status:\n" +" Returns exit status of command or success if command is null." +msgstr "" +"Spustí argumenty jako příkaz shellu.\n" +" \n" +" ARGUMENTY sloučí do jediného řetězce, použije jej jako vstup shellu\n" +" a vykoná výsledné příkazy.\n" +" Návratový kód:\n" +" Vrátí návratový kód příkazu, nebo úspěch, byl-li příkaz prázdný." + +#: builtins.c:643 +msgid "" +"Parse option arguments.\n" +" \n" +" Getopts is used by shell procedures to parse positional parameters\n" +" as options.\n" +" \n" +" OPTSTRING contains the option letters to be recognized; if a letter\n" +" is followed by a colon, the option is expected to have an argument,\n" +" which should be separated from it by white space.\n" +" \n" +" Each time it is invoked, getopts will place the next option in the\n" +" shell variable $name, initializing name if it does not exist, and\n" +" the index of the next argument to be processed into the shell\n" +" variable OPTIND. OPTIND is initialized to 1 each time the shell or\n" +" a shell script is invoked. When an option requires an argument,\n" +" getopts places that argument into the shell variable OPTARG.\n" +" \n" +" getopts reports errors in one of two ways. If the first character\n" +" of OPTSTRING is a colon, getopts uses silent error reporting. In\n" +" this mode, no error messages are printed. If an invalid option is\n" +" seen, getopts places the option character found into OPTARG. If a\n" +" required argument is not found, getopts places a ':' into NAME and\n" +" sets OPTARG to the option character found. If getopts is not in\n" +" silent mode, and an invalid option is seen, getopts places '?' into\n" +" NAME and unsets OPTARG. If a required argument is not found, a '?'\n" +" is placed in NAME, OPTARG is unset, and a diagnostic message is\n" +" printed.\n" +" \n" +" If the shell variable OPTERR has the value 0, getopts disables the\n" +" printing of error messages, even if the first character of\n" +" OPTSTRING is not a colon. OPTERR has the value 1 by default.\n" +" \n" +" Getopts normally parses the positional parameters ($0 - $9), but if\n" +" more arguments are given, they are parsed instead.\n" +" \n" +" Exit Status:\n" +" Returns success if an option is found; fails if the end of options is\n" +" encountered or an error occurs." +msgstr "" +"Rozebere přepínačové argumenty.\n" +" \n" +" Getopts se používá v shellových procedurách na rozebrání pozičních\n" +" parametrů jakožto přepínačů.\n" +" \n" +" OPTSTRING obsahuje písmena přepínačů, které mají být rozeznány, Je-li\n" +" písmeno následováno dvojtečkou, po přepínači se očekává argument, který\n" +" by měl být od přepínače oddělen bílým místem.\n" +" \n" +" Pokaždé když je getopts zavolán, je následující přepínač umístěn do\n" +" proměnné $name (proměnná je inicializována, neexistuje-li) a pořadí\n" +" dalšího argumentu, který čeká na zpracování, do proměnné shellu OPTIND.\n" +" OPTIND je inicializována na 1 vždy, když je zavolán shell nebo shellový\n" +" skript. Pokud přepínač vyžaduje argument, getopts umístí tento argument\n" +" do proměnné shellu OPTARG.\n" +" \n" +" getopts hlásí chyby jedním ze dvou způsobů. Pokud prvním znakem " +"OPTSTRING\n" +" je dvojtečka, getopts hlásí chyby tichým způsobem. V tomto režimu žádné\n" +" chybové zprávy nejsou vypisovány. Když se narazí na neplatný přepínač,\n" +" getopts umístí tento znak do OPTARG. Pokud není nalezen povinný " +"argument,\n" +" getopts umístí „:“ do NAME a OPTARG nastaví na znak nalezeného " +"přepínače.\n" +" Pokud getopts nepracuje v tomto tichém režimu a je nalezen neplatný\n" +" přepínač, getopts umístí „?“ do NAME a zruší OPTARG. Když nenajde " +"povinný\n" +" argument, je do NAME zapsán „?“, OPTARG zruÅ¡en a vytiÅ¡těna diagnostická\n" +" zpráva.\n" +" \n" +" Pokud proměnná shellu OPTERR má hodnotu 0, getopts vypne vypisování\n" +" chybových zpráv, dokonce i když první znak OPTSTRING není dvojtečka.\n" +" Implicitní hodnota OPTERR je 1.\n" +" \n" +" Normálně getopts zpracovává poziční parametry ($0–$9), avÅ¡ak následuje-" +"li\n" +" getopts více argumentů, budou rozebrány tyto namísto pozičních.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, byl-li nalezen nějaký přepínač. Neúspěch vrátí, když " +"dojde\n" +" na konec přepínačů nebo nastane-li chyba." + +#: builtins.c:685 +msgid "" +"Replace the shell with the given command.\n" +" \n" +" Execute COMMAND, replacing this shell with the specified program.\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not " +"specified,\n" +" any redirections take effect in the current shell.\n" +" \n" +" Options:\n" +" -a name\tpass NAME as the zeroth argument to COMMAND\n" +" -c\t\texecute COMMAND with an empty environment\n" +" -l\t\tplace a dash in the zeroth argument to COMMAND\n" +" \n" +" If the command cannot be executed, a non-interactive shell exits, " +"unless\n" +" the shell option `execfail' is set.\n" +" \n" +" Exit Status:\n" +" Returns success unless COMMAND is not found or a redirection error " +"occurs." +msgstr "" +"Nahradí shell zadaným příkazem.\n" +" \n" +" Vykoná PŘÍKAZ, přičemž nahradí tento shell zadaným programem. " +"ARGUMENTY\n" +" se stanou argumenty PŘÍKAZU. Není-li PŘÍKAZ zadán, přesměrování " +"zapůsobí\n" +" v tomto shellu.\n" +" \n" +" Přepínače:\n" +" -a název\tpředá název jakožto nultý argument PŘÍKAZU\n" +" -c\t\tspustí PŘÍKAZ s prázdným prostředím\n" +" -t\t\tdo nultého argumentu PŘÍKAZU umístí pomlčku\n" +" \n" +" Pokud příkaz nemůže být proveden, neinteraktivní shell bude ukončen,\n" +" pokud přepínač shellu „execfail“ není nastaven.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud byl PŘÍKAZ nalezen a nedoÅ¡lo k chybě přesměrování." + +#: builtins.c:706 +msgid "" +"Exit the shell.\n" +" \n" +" Exits the shell with a status of N. If N is omitted, the exit status\n" +" is that of the last command executed." +msgstr "" +"Ukončí shell.\n" +" \n" +" Ukončí tento shell se stavem N. Bez N bude návratový kód roven kódu\n" +" posledně prováděného příkazu." + +#: builtins.c:715 +msgid "" +"Exit a login shell.\n" +" \n" +" Exits a login shell with exit status N. Returns an error if not " +"executed\n" +" in a login shell." +msgstr "" +"Ukončí přihlaÅ¡ovací shell.\n" +" \n" +" Ukončí přihlaÅ¡ovací (login) shell se stavem N. Nebyl-li příkaz zavolán\n" +" z přihlaÅ¡ovacího shellu, vrátí chybu." + +#: builtins.c:725 +msgid "" +"Display or execute commands from the history list.\n" +" \n" +" fc is used to list or edit and re-execute commands from the history " +"list.\n" +" FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" +" string, which means the most recent command beginning with that\n" +" string.\n" +" \n" +" Options:\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then " +"EDITOR,\n" +" \t\tthen vi\n" +" -l \tlist lines instead of editing\n" +" -n\tomit line numbers when listing\n" +" -r\treverse the order of the lines (newest listed first)\n" +" \n" +" With the `fc -s [pat=rep ...] [command]' format, COMMAND is\n" +" re-executed after the substitution OLD=NEW is performed.\n" +" \n" +" A useful alias to use with this is r='fc -s', so that typing `r cc'\n" +" runs the last command beginning with `cc' and typing `r' re-executes\n" +" the last command.\n" +" \n" +" Exit Status:\n" +" Returns success or status of executed command; non-zero if an error " +"occurs." +msgstr "" +"Zobrazí nebo vykoná příkazy ze seznamu historie.\n" +" \n" +" fc se používá na vypsání, úpravu a znovu provedení příkazů ze seznamu\n" +" historie. PRVNÍ a POSLEDNÍ mohou být čísla určující rozsah nebo PRVNÍ " +"může být\n" +" řetězec, což určuje nejnovější příkaz začínající na zadaný řetězec.\n" +" \n" +" Přepínače:\n" +" -e ENÁZEV\tvybere editor. Implicitní je FCEDIT, pak EDITOR, pak vi.\n" +" -l\tvypisuje řádky namísto jejich upravování\n" +" -n\tvypne číslování řádků při jejich vypisování\n" +" -r\tobrátí pořadí řádků (nejnovější budou první)\n" +" \n" +" Forma příkazu „fc -s [vzor=náhrada… [příkaz]“ znamená, že PŘÍKAZ bude\n" +" po nahrazení STARÝ=NOVÝ znovu vykonán.\n" +" \n" +" Užitečný alias je r='fc -s', takže napsání „r cc“ spustí poslední " +"příkaz\n" +" začínající na „cc“ a zadání „r“ znovu spustí poslední příkaz.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch nebo kód provedeného příkazu. Nenulový kód, vyskytne-li se\n" +" chyba." + +#: builtins.c:755 +msgid "" +"Move job to the foreground.\n" +" \n" +" Place the job identified by JOB_SPEC in the foreground, making it the\n" +" current job. If JOB_SPEC is not present, the shell's notion of the\n" +" current job is used.\n" +" \n" +" Exit Status:\n" +" Status of command placed in foreground, or failure if an error occurs." +msgstr "" +"Přepne úlohu na popředí.\n" +" \n" +" Přesune úlohu určenou pomocí ÚLOHA na popředí a učiní ji aktuální " +"úlohou.\n" +" Není-li ÚLOHA zadána, použije se úloha, o které si shell myslí, že je\n" +" aktuální.\n" +" \n" +" Návratový kód:\n" +" Kód úlohy přesunuté do popředí, nebo doÅ¡lo-li k chybě, kód selhání." + +#: builtins.c:770 +msgid "" +"Move jobs to the background.\n" +" \n" +" Place the jobs identified by each JOB_SPEC in the background, as if " +"they\n" +" had been started with `&'. If JOB_SPEC is not present, the shell's " +"notion\n" +" of the current job is used.\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Přesune úlohy do pozadí.\n" +" \n" +" Přepne každou úlohu určenou pomocí ÚLOHA na pozadí, jako by byla\n" +" spuÅ¡těna s „&“. Ne-li ÚLOHA uvedena, použije se úloha, o které si shell\n" +" myslí, že je aktuální.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud je správa úloh zapnuta a nedoÅ¡lo-li k nějaké chybě." + +#: builtins.c:784 +msgid "" +"Remember or display program locations.\n" +" \n" +" Determine and remember the full pathname of each command NAME. If\n" +" no arguments are given, information about remembered commands is " +"displayed.\n" +" \n" +" Options:\n" +" -d\t\tforget the remembered location of each NAME\n" +" -l\t\tdisplay in a format that may be reused as input\n" +" -p pathname\tuse PATHNAME as the full pathname of NAME\n" +" -r\t\tforget all remembered locations\n" +" -t\t\tprint the remembered location of each NAME, preceding\n" +" \t\teach location with the corresponding NAME if multiple\n" +" \t\tNAMEs are given\n" +" Arguments:\n" +" NAME\t\tEach NAME is searched for in $PATH and added to the list\n" +" \t\tof remembered commands.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not found or an invalid option is given." +msgstr "" +"Zapamatuje si nebo zobrazí umístění programu.\n" +" \n" +" Pro každý NÁZEV je určena plná cesta k příkazu a je zapamatována. Nejsou-" +"li\n" +" zadány žádné argumenty, budou vypsány informace o zapamatovaných " +"příkazech.\n" +" \n" +" Přepínače:\n" +" -d\t\tzapomene zapamatovaná umístění každého NÁZVU\n" +" -l\t\tvypíše v takové podobě, kterou lze opět použít jako vstup\n" +" -p cesta\tpoužije NÁZEV_CESTY jako plnou cestu k NÁZVU\n" +" -r\t\tzapomene vÅ¡echna zapamatovaná umístění\n" +" -t\t\tvypíše zapamatované umístění každého NÁZVU a každému umístění\n" +" \t\tpředepíše odpovídající NÁZEV, bylo zadáno více NÁZVÅ®\n" +" Argumenty:\n" +" NÁZEV\t\tKaždý NÁZEV je vyhledán v $PATH a přidán do seznamu\n" +" \t\tzapamatovaných příkazů.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud byl NÁZEV nalezen a nebyl-li zadán neplatný přepínač." + +#: builtins.c:809 +msgid "" +"Display information about builtin commands.\n" +" \n" +" Displays brief summaries of builtin commands. If PATTERN is\n" +" specified, gives detailed help on all commands matching PATTERN,\n" +" otherwise the list of help topics is printed.\n" +" \n" +" Options:\n" +" -d\toutput short description for each topic\n" +" -m\tdisplay usage in pseudo-manpage format\n" +" -s\toutput only a short usage synopsis for each topic matching\n" +" \tPATTERN\n" +" \n" +" Arguments:\n" +" PATTERN\tPattern specifiying a help topic\n" +" \n" +" Exit Status:\n" +" Returns success unless PATTERN is not found or an invalid option is " +"given." +msgstr "" +"Zobrazí podrobnosti o vestavěných příkazech.\n" +" \n" +" Zobrazí stručný souhrn vestavěných příkazů. Je-li zadán VZOREK,\n" +" vrátí podrobnou nápovědu ke vÅ¡em příkazům odpovídajícím VZORKU, jinak " +"je\n" +" vytiÅ¡těn seznam syntaxe vestavěných příkazů.\n" +" \n" +" Přepínače:\n" +" -d\tvypíše krátké pojednání na každé téma\n" +" -m\tzobrazí použití v jakoby manuálovém formátu\n" +" -s\tvypíše pouze krátký popis použití o každém příkazu odpovídajícímu\n" +" \tVZORKU\n" +" \n" +" Argumenty:\n" +" VZOREK\tVzorek určující téma nápovědy\n" +" \n" +" Návratový kód:\n" +" Vrací úspěch, pokud byl nalezen VZOREK a nebyl zadán neplatný přepínač." + +# FIXME: bash-4.0-pre1: Orphaned line between -w and -p option. It belongs to -n. +#: builtins.c:833 +msgid "" +"Display or manipulate the history list.\n" +" \n" +" Display the history list with line numbers, prefixing each modified\n" +" entry with a `*'. An argument of N lists only the last N entries.\n" +" \n" +" Options:\n" +" -c\tclear the history list by deleting all of the entries\n" +" -d offset\tdelete the history entry at offset OFFSET.\n" +" \n" +" -a\tappend history lines from this session to the history file\n" +" -n\tread all history lines not already read from the history file\n" +" -r\tread the history file and append the contents to the history\n" +" \tlist\n" +" -w\twrite the current history to the history file\n" +" \tand append them to the history list\n" +" \n" +" -p\tperform history expansion on each ARG and display the result\n" +" \twithout storing it in the history list\n" +" -s\tappend the ARGs to the history list as a single entry\n" +" \n" +" If FILENAME is given, it is used as the history file. Otherwise,\n" +" if $HISTFILE has a value, that is used, else ~/.bash_history.\n" +" \n" +" If the $HISTTIMEFORMAT variable is set and not null, its value is used\n" +" as a format string for strftime(3) to print the time stamp associated\n" +" with each displayed history entry. No time stamps are printed " +"otherwise.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" +"Zobrazí nebo upraví seznam historie.\n" +" \n" +" Zobrazí seznam historie s očíslovanými řádky. Řádky vypsané s „*“ byly\n" +" změněny. Argument N říká, že se vypíše pouze posledních N řádek.\n" +" \n" +" Přepínače:\n" +" -c\tvyprázdní seznam historie smazáním vÅ¡ech položek\n" +" -d pozice\tsmaže ze seznamu historie položku na pozici POZICE\n" +" \n" +" -a\tpřipojí řádky historie z této relace do souboru historie\n" +" -n\tnačte vÅ¡echny řádky historie, které jeÅ¡tě nebyly načteny,\n" +" \tze souboru historie a připojí je do seznamu historie\n" +" -r\tnačte soubor historie a obsah připojí do seznamu historie\n" +" -w\tzapíše současnou historii do souboru historie\n" +" \n" +" -p\tprovede expanzi historie na každém ARGUMENTU a výsledek zobrazí,\n" +" \taniž by cokoliv uložil do seznamu historie\n" +" -s\tpřipojí ARGUMENTY do seznamu historie jako jednu položku\n" +" \n" +" Je-li zadán JMÉNO_SOUBORU, tak ten je použit jako soubor historie. " +"Jinak\n" +" pokud $HISTFILE má hodnotu, tato je použita, jinak ~/.bash_history.\n" +" \n" +" Je-li proměnná $HISTTIMEFORMAT nastavena a není-li prázdná, její " +"hodnota\n" +" se použije jako formátovací řetězec pro strftime(3) při výpisu časových\n" +" razítek spojených s každou položkou historie. Jinak žádná časová " +"razítka\n" +" nebudou vypisována. \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud nebyl zadán neplatný přepínač a nedoÅ¡lo k chybě." + +#: builtins.c:869 +#, fuzzy +msgid "" +"Display status of jobs.\n" +" \n" +" Lists the active jobs. JOBSPEC restricts output to that job.\n" +" Without options, the status of all active jobs is displayed.\n" +" \n" +" Options:\n" +" -l\tlists process IDs in addition to the normal information\n" +" -n\tlists only processes that have changed status since the last\n" +" \tnotification\n" +" -p\tlists process IDs only\n" +" -r\trestrict output to running jobs\n" +" -s\trestrict output to stopped jobs\n" +" \n" +" If -x is supplied, COMMAND is run after all job specifications that\n" +" appear in ARGS have been replaced with the process ID of that job's\n" +" process group leader.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs.\n" +" If -x is used, returns the exit status of COMMAND." +msgstr "" +"Zobrazí stav úloh.\n" +" \n" +" Vypíše aktivní úlohy. ÚLOHA omezuje výstup na danou úlohu. Bez uvedení\n" +" přepínačů bude vypsán stav vÅ¡ech aktivních úloh.\n" +" \n" +" Přepínače:\n" +" -l\tvypíše navíc ID procesů\n" +" -n\tvypíše pouze procesy, které od minulého oznámení změnily stav\n" +" -p\tvypíše pouze ID procesů\n" +" -r\tzúží výstup jen na běžící úlohy\n" +" -s\tzúží výstup jen na pozastavené úlohy\n" +" \n" +" Je-li použito -x, bude spuÅ¡těn příkaz, jakmile vÅ¡echny úlohy uvedené " +"mezi\n" +" ARGUMENTY budou nahrazeny ID procesu, který je vedoucím skupiny dané " +"úlohy.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud nebyl zadán neplatný přepínač a nevyskytla se " +"chyba.\n" +" Byl-ly použit přepínač -x, vrátí návratový kód PŘÍKAZU." + +#: builtins.c:896 +msgid "" +"Remove jobs from current shell.\n" +" \n" +" Removes each JOBSPEC argument from the table of active jobs. Without\n" +" any JOBSPECs, the shell uses its notion of the current job.\n" +" \n" +" Options:\n" +" -a\tremove all jobs if JOBSPEC is not supplied\n" +" -h\tmark each JOBSPEC so that SIGHUP is not sent to the job if the\n" +" \tshell receives a SIGHUP\n" +" -r\tremove only running jobs\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option or JOBSPEC is given." +msgstr "" +"Odstraní úlohy ze současného shellu.\n" +" \n" +" Z tabulky aktivních úloh odebere každou ÚLOHU. Nebudou-li ÚLOHY zadány,\n" +" shell použije vlastní představu o současné úloze.\n" +" \n" +" Přepínače:\n" +" -a\todstraní vÅ¡echny úlohy, pokud nebyla žádná ÚLOHA určena\n" +" -h\toznačí každou ÚLOHU tak, že jí nebude zaslán SIGHUP, až shell sám\n" +" \tobdrží tento signál\n" +" -r\todstraní jen běžící úlohy\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud nebyl zadán neplatný přepínač nebo ÚLOHA." + +#: builtins.c:915 +msgid "" +"Send a signal to a job.\n" +" \n" +" Send the processes identified by PID or JOBSPEC the signal named by\n" +" SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n" +" SIGTERM is assumed.\n" +" \n" +" Options:\n" +" -s sig\tSIG is a signal name\n" +" -n sig\tSIG is a signal number\n" +" -l\tlist the signal names; if arguments follow `-l' they are\n" +" \tassumed to be signal numbers for which names should be listed\n" +" \n" +" Kill is a shell builtin for two reasons: it allows job IDs to be used\n" +" instead of process IDs, and allows processes to be killed if the limit\n" +" on processes that you can create is reached.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" +"ZaÅ¡le signál úloze.\n" +" \n" +" ZaÅ¡le procesu určeném PID (nebo ÚLOHOU) signál zadaný pomocí SIGSPEC\n" +" nebo ČÍSSIG. Není-li SIGSPEC ani ČÍSSIG zadán, pak se předpokládá " +"SIGTERM.\n" +" \n" +" Přepínače:\n" +" -s sig\tSIG je název signálu\n" +" -n sig\tSIG je číslo signálu\n" +" -l\tvypíše čísla signálů; pokud „-l“ následují argumenty, má\n" +" \tse za to, že se jedná o čísla signálů, pro které se mají vyspat\n" +" \tjejich názvy.\n" +" \n" +" Kill je vestavěný příkaz shellu ze dvou důvodů: umožňuje použít\n" +" identifikátory úloh namísto ID procesů a umožní zabíjet procesy i poté,\n" +" co jste dosáhli limitu počtu procesů, které smíte vytvořit.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud nebyl zadán neplatný přepínač a nedoÅ¡lo k chybě." + +#: builtins.c:938 +msgid "" +"Evaluate arithmetic expressions.\n" +" \n" +" Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" +" fixed-width integers with no check for overflow, though division by 0\n" +" is trapped and flagged as an error. The following list of operators is\n" +" grouped into levels of equal-precedence operators. The levels are " +"listed\n" +" in order of decreasing precedence.\n" +" \n" +" \tid++, id--\tvariable post-increment, post-decrement\n" +" \t++id, --id\tvariable pre-increment, pre-decrement\n" +" \t-, +\t\tunary minus, plus\n" +" \t!, ~\t\tlogical and bitwise negation\n" +" \t**\t\texponentiation\n" +" \t*, /, %\t\tmultiplication, division, remainder\n" +" \t+, -\t\taddition, subtraction\n" +" \t<<, >>\t\tleft and right bitwise shifts\n" +" \t<=, >=, <, >\tcomparison\n" +" \t==, !=\t\tequality, inequality\n" +" \t&\t\tbitwise AND\n" +" \t^\t\tbitwise XOR\n" +" \t|\t\tbitwise OR\n" +" \t&&\t\tlogical AND\n" +" \t||\t\tlogical OR\n" +" \texpr ? expr : expr\n" +" \t\t\tconditional operator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tassignment\n" +" \n" +" Shell variables are allowed as operands. The name of the variable\n" +" is replaced by its value (coerced to a fixed-width integer) within\n" +" an expression. The variable need not have its integer attribute\n" +" turned on to be used in an expression.\n" +" \n" +" Operators are evaluated in order of precedence. Sub-expressions in\n" +" parentheses are evaluated first and may override the precedence\n" +" rules above.\n" +" \n" +" Exit Status:\n" +" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." +msgstr "" +"Vyhodnotí aritmetický výraz.\n" +" \n" +" Vyhodnotí každý ARGUMENT jako aritmetický výraz. Vyhodnocení je\n" +" prováděno v celých číslech o pevné šířce bez kontrol přetečení, avÅ¡ak\n" +" dělení 0 je zachyceno a označeno za chybu. Následující seznam operátorů\n" +" je rozdělen do skupin podle úrovní přednosti. Skupiny jsou seřazeny\n" +" v sestupném pořadí přednosti.\n" +" \n" +" \tid++, id--\tnásledné zvýšení, snížení proměnné\n" +" \t++id, --id\tpřednostní zvýšení, snížení proměnné\n" +" \t-, +\t\tunární mínus, plus\n" +" \t!, ~\t\tlogická a bitová negace\n" +" \t**\t\tumocnění\n" +" \t*, /, %\t\tnásobení, dělení, zbytková třída\n" +" \t+, -\t\tsčítání, odečítání\n" +" \t<<, >>\t\tlevý a pravý bitový posun\n" +" \t<=, >=, <, >\tporovnání\n" +" \t==, !=\t\trovnost, nerovnost\n" +" \t&\t\tbitové a zároveň (AND)\n" +" \t^\t\tbitové vylučující nebo (XOR)\n" +" \t|\t\tbitové nebo (OR)\n" +" \t&&\t\tlogické a zároveň (AND)\n" +" \t||\t\tlogické nebo (OR)\n" +" \tVÝRAZ ? VÝRAZ : VÝRAZ\n" +" \t\t\tpodmíněný operátor\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tpřiřazení\n" +" \n" +" Proměnné shellu jsou povolené operandy. Název proměnné je uvnitř výrazu\n" +" nahrazen její hodnotou (s automatickým převodem na celé číslo pevné " +"šířky).\n" +" Proměnná nemusí mít atribut integer (číslo) zapnutý, aby byla " +"použitelná\n" +" ve výrazu.\n" +" \n" +" Operátory se vyhodnocují v pořadí přednosti. Podvýrazy v závorkách jsou\n" +" vyhodnoceny přednostně a smí přebít pravidla přednosti uvedená výše.\n" +" \n" +" Návratový kód:\n" +" Pokud poslední ARGUMENT je vyhodnocen na 0, let vrátí 1. Jinak je\n" +" navrácena 0." + +#: builtins.c:983 +msgid "" +"Read a line from the standard input and split it into fields.\n" +" \n" +" Reads a single line from the standard input, or from file descriptor FD\n" +" if the -u option is supplied. The line is split into fields as with " +"word\n" +" splitting, and the first word is assigned to the first NAME, the second\n" +" word to the second NAME, and so on, with any leftover words assigned to\n" +" the last NAME. Only the characters found in $IFS are recognized as " +"word\n" +" delimiters.\n" +" \n" +" If no NAMEs are supplied, the line read is stored in the REPLY " +"variable.\n" +" \n" +" Options:\n" +" -a array\tassign the words read to sequential indices of the array\n" +" \t\tvariable ARRAY, starting at zero\n" +" -d delim\tcontinue until the first character of DELIM is read, rather\n" +" \t\tthan newline\n" +" -e\t\tuse Readline to obtain the line in an interactive shell\n" +" -i text\tUse TEXT as the initial text for Readline\n" +" -n nchars\treturn after reading NCHARS characters rather than waiting\n" +" \t\tfor a newline, but honor a delimiter if fewer than NCHARS\n" +" \t\tcharacters are read before the delimiter\n" +" -N nchars\treturn only after reading exactly NCHARS characters, " +"unless\n" +" \t\tEOF is encountered or read times out, ignoring any delimiter\n" +" -p prompt\toutput the string PROMPT without a trailing newline before\n" +" \t\tattempting to read\n" +" -r\t\tdo not allow backslashes to escape any characters\n" +" -s\t\tdo not echo input coming from a terminal\n" +" -t timeout\ttime out and return failure if a complete line of input " +"is\n" +" \t\tnot read within TIMEOUT seconds. The value of the TMOUT\n" +" \t\tvariable is the default timeout. TIMEOUT may be a\n" +" \t\tfractional number. If TIMEOUT is 0, read returns immediately,\n" +" \t\twithout trying to read any data, returning success only if\n" +" \t\tinput is available on the specified file descriptor. The\n" +" \t\texit status is greater than 128 if the timeout is exceeded\n" +" -u fd\t\tread from file descriptor FD instead of the standard input\n" +" \n" +" Exit Status:\n" +" The return code is zero, unless end-of-file is encountered, read times " +"out\n" +" (in which case it's greater than 128), a variable assignment error " +"occurs,\n" +" or an invalid file descriptor is supplied as the argument to -u." +msgstr "" +"Načte ze standardního vstupu jeden řádek a rozdělí jej na položky.\n" +" \n" +" Ze standardního vstupu, nebo deskriptoru souboru FD, je-li zadán\n" +" přepínač -u, je načten jeden řádek. Řádek se rozdělí na části jako při\n" +" dělení na slova a první slovo je přiřazeno do prvního JMÉNA, druhé " +"slovo\n" +" do druhého JMÉNA a tak dále, přičemž přebývající slova se přiřadí do\n" +" posledního JMÉNA. Pouze znaky uvedené v $IFS jsou považovány za\n" +" oddělovače slov.\n" +" \n" +" Nejsou-li uvedena žádná JMÉNA, načtený řádek bude uložen do proměnné " +"REPLY.\n" +" \n" +" Přepínače:\n" +" -a pole\tnačtená slova budou přiřazena do postupných prvků POLE\n" +" \t\tpočínaje indexem nula\n" +" -d oddělovač\tpokračuje, dokud není načten první znak ODDĚLOVAČE\n" +" \t\tnamísto nového řádku\n" +" -e\t\tv interaktivním shellu bude řádek načten pomocí Readline\n" +" -i text\tpoužije TEXT jako prvotní text pro Readline\n" +" -n p_znaků\tvrátí řízení po načtení P_ZNAKÅ® znaků, místo čekání na\n" +" \t\tnový řádek, avÅ¡ak respektuje oddělovač, je-li méně než P_ZNAKÅ®\n" +" -N p_znaků\tvrátí řízení pouze po načtení přesně P_ZNAKÅ® znaků,\n" +" \t\tpokud se neobjeví konec souboru nebo nevyprší limit,\n" +" \t\tignoruje jakýkoliv oddělovač\n" +" -p výzva\tvypíše řetězec VÝZVA bez závěrečného nového řádku dříve,\n" +" \t\tnež se zahájí načítání\n" +" -r\t\tnepovolí zpětná lomítka pro escapování jakýchkoliv znaků\n" +" -s\t\tvstup pocházející z terminálu nebude zobrazován\n" +" -t limit\tumožní vyprÅ¡ení časového limitu a vrácení chyby, pokud\n" +" \t\tnebude načten celý řádek do LIMIT sekund. Hodnota proměnné\n" +" \t\tTMOUT představuje implicitní limit. LIMIT smí být desetinné\n" +" \t\tčíslo. Je-li LIMIT 0, read okamžitě skončí, aniž by zkusil\n" +" \t\tnačíst jakákoliv data, a vrátí úspěch, jen bude-li na zadaném\n" +" \t\tdeskriptoru souboru připraven vstup. Návratový kód bude větší než\n" +" \t\t128, pokud časový limit bude překročen.\n" +" -u fd\t\tčte z deskriptoru souboru FD namísto standardního vstupu\n" +" \n" +" Návratový kód:\n" +" Návratový kód je nula, pokud se nenarazí na konec souboru, časový limit\n" +" pro čtení nevyprší (pak je větší než 128), nedojde k chybě při\n" +" přiřazování do proměnné, nebo není poskytnut neplatný deskriptor " +"souboru\n" +" jako argument -u." + +#: builtins.c:1028 +msgid "" +"Return from a shell function.\n" +" \n" +" Causes a function or sourced script to exit with the return value\n" +" specified by N. If N is omitted, the return status is that of the\n" +" last command executed within the function or script.\n" +" \n" +" Exit Status:\n" +" Returns N, or failure if the shell is not executing a function or script." +msgstr "" +"Návrat z shellové funkce.\n" +" \n" +" Způsobí ukončení funkce nebo skriptu načteného přes „source“ " +"s návratovou\n" +" hodnotou určenou N. Je-li N vynecháno, návratový kód bude roven " +"poslednímu\n" +" příkazu vykonanému uvnitř dotyčné funkce nebo skriptu.\n" +" \n" +" Návratová hodnota:\n" +" Vrátí N, nebo selže, pokud shell neprovádí funkci nebo skript." + +#: builtins.c:1041 +msgid "" +"Set or unset values of shell options and positional parameters.\n" +" \n" +" Change the value of shell attributes and positional parameters, or\n" +" display the names and values of shell variables.\n" +" \n" +" Options:\n" +" -a Mark variables which are modified or created for export.\n" +" -b Notify of job termination immediately.\n" +" -e Exit immediately if a command exits with a non-zero status.\n" +" -f Disable file name generation (globbing).\n" +" -h Remember the location of commands as they are looked up.\n" +" -k All assignment arguments are placed in the environment for a\n" +" command, not just those that precede the command name.\n" +" -m Job control is enabled.\n" +" -n Read commands but do not execute them.\n" +" -o option-name\n" +" Set the variable corresponding to option-name:\n" +" allexport same as -a\n" +" braceexpand same as -B\n" +" emacs use an emacs-style line editing interface\n" +" errexit same as -e\n" +" errtrace same as -E\n" +" functrace same as -T\n" +" hashall same as -h\n" +" histexpand same as -H\n" +" history enable command history\n" +" ignoreeof the shell will not exit upon reading EOF\n" +" interactive-comments\n" +" allow comments to appear in interactive commands\n" +" keyword same as -k\n" +" monitor same as -m\n" +" noclobber same as -C\n" +" noexec same as -n\n" +" noglob same as -f\n" +" nolog currently accepted but ignored\n" +" notify same as -b\n" +" nounset same as -u\n" +" onecmd same as -t\n" +" physical same as -P\n" +" pipefail the return value of a pipeline is the status of\n" +" the last command to exit with a non-zero status,\n" +" or zero if no command exited with a non-zero " +"status\n" +" posix change the behavior of bash where the default\n" +" operation differs from the Posix standard to\n" +" match the standard\n" +" privileged same as -p\n" +" verbose same as -v\n" +" vi use a vi-style line editing interface\n" +" xtrace same as -x\n" +" -p Turned on whenever the real and effective user ids do not match.\n" +" Disables processing of the $ENV file and importing of shell\n" +" functions. Turning this option off causes the effective uid and\n" +" gid to be set to the real uid and gid.\n" +" -t Exit after reading and executing one command.\n" +" -u Treat unset variables as an error when substituting.\n" +" -v Print shell input lines as they are read.\n" +" -x Print commands and their arguments as they are executed.\n" +" -B the shell will perform brace expansion\n" +" -C If set, disallow existing regular files to be overwritten\n" +" by redirection of output.\n" +" -E If set, the ERR trap is inherited by shell functions.\n" +" -H Enable ! style history substitution. This flag is on\n" +" by default when the shell is interactive.\n" +" -P If set, do not resolve symbolic links when executing commands\n" +" such as cd which change the current directory.\n" +" -T If set, the DEBUG trap is inherited by shell functions.\n" +" -- Assign any remaining arguments to the positional parameters.\n" +" If there are no remaining arguments, the positional parameters\n" +" are unset.\n" +" - Assign any remaining arguments to the positional parameters.\n" +" The -x and -v options are turned off.\n" +" \n" +" Using + rather than - causes these flags to be turned off. The\n" +" flags can also be used upon invocation of the shell. The current\n" +" set of flags may be found in $-. The remaining n ARGs are positional\n" +" parameters and are assigned, in order, to $1, $2, .. $n. If no\n" +" ARGs are given, all shell variables are printed.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given." +msgstr "" +"Nastaví nebo zruší hodnoty přepínačů shellu a pozičních parametrů.\n" +" \n" +" Změní hodnoty atributům shellu a pozičním parametrům, nebo zobrazí " +"názvy\n" +" a hodnoty proměnných shellu.\n" +" \n" +" Přepínače:\n" +" -a Označí měněné nebo vytvářené proměnné pro export.\n" +" -b Neprodleně oznámí ukončení úlohy.\n" +" -e Neprodleně skončí, pokud nějaký příkaz skončí s nenulovým kódem.\n" +" -f Zakáže vytváření jmen souborů (globbing).\n" +" -h Zapamatuje si umístění příkazů tehdy, když jsou vyhledány.\n" +" -k VÅ¡echny přiřazovací argumenty budou umístěny do prostředí\n" +" příkazu. Nejenom ty, co předchází název příkazu.\n" +" -m Správa úloh je zapnuta.\n" +" -n Příkazy načte, ale neprovede je.\n" +" -o NÁZEV_PŘEPÍNAČE\n" +" Nastaví proměnnou odpovídající NÁZVU_PŘEPÍNAČE:\n" +" allexport stejné jako -a\n" +" braceexpand stejné jako -B\n" +" emacs použije emacsový způsob editace na řádku\n" +" errexit stejné jako -e\n" +" errtrace stejné jako -E\n" +" functrace stejné jako -T\n" +" hashall stejné jako -h\n" +" histexpand stejné jako -H\n" +" history zapne historii příkazů\n" +" ignoreeof shell neskončí, když načte EOF (konec souboru)\n" +" interactive-comments\n" +" povolí, aby se v interaktivních příkazech\n" +" objevovaly komentáře\n" +" keyword stejné jako -k\n" +" monitor stejné jako -m\n" +" noclobber stejné jako -C\n" +" noexec stejné jako -n\n" +" noglob stejné jako -f\n" +" nolog v současnosti přijímáno, ale ignorováno\n" +" notify stejné jako -b\n" +" nounset stejné jako -u\n" +" onecmd stejné jako -t\n" +" physical stejné jako -P\n" +" pipefail návratová hodnota kolony je status posledního\n" +" příkazu, který skončil s nenulovým kódem.\n" +" Návratová hodnota je nula, pokud žádný z příkazů\n" +" neskončil s nenulovým kódem.\n" +" posix změní chování bashe tam, kde implicitní chování\n" +" se liší od standardu 1003.2, tak, aby bylo\n" +" v souladu se standardem\n" +" privileged stejné jako -p\n" +" verbose stejné jako -v\n" +" vi použije vi způsob editace na řádku\n" +" xtrace stejné jako -x\n" +" -p Zapnuto, kdykoliv reálné a efektivní ID uživatele se neshodují.\n" +" Vypne zpracování souboru $ENV a importování shellových funkcí.\n" +" Vypnutí tohoto přepínače způsobí, že efektivní UID a GID budou\n" +" nastavena na reálná UID a GID.\n" +" -t Skončí po načtení a provedení jednoho příkazu.\n" +" -u Při substituci považuje nenastavené proměnné za chybu.\n" +" -v Vstupní řádky shellu se budou vypisovat tak, jak budou načítány.\n" +" -x Vypisuje příkazy a jejich argumenty tak, jak jsou spouÅ¡těny.\n" +" -B Shell bude provádět závorkovou (brace) expanzi.\n" +" -C Je-li nastaveno, zakáže přepsání již existujících běžných souborů\n" +" při přesměrování výstupu.\n" +" -E Je-li nastaveno, trap ERR (zachytávání chyb) bude děděn do\n" +" funkcí shellu.\n" +" -H Zapne ! způsob nahrazování historie. Tento příznak je automaticky\n" +" zapnut při interaktivním shellu.\n" +" -P Je-li nastaveno, nebudou vyhodnocovány symbolické odkazy při\n" +" provádění příkazů jako změna pracovního adresáře pomocí „cd“.\n" +" -T Je-li nastaveno, trap DEBUG (obsluha ladění) bude děděna do\n" +" funkcí shellu.\n" +" -- Přiřadí jakékoliv zbývající argumenty do pozičních parametrů.\n" +" Neexistují-li žádné zbývající argumenty, poziční parametry budou\n" +" odstraněny.\n" +" - Přiřadí jakékoliv zbývající argumenty do pozičních parametrů.\n" +" Přepínače -x a -v budou vypnuty.\n" +" \n" +" Použití + místo - způsobí, že tyto příznaky budou vypnuty. Příznaky lze " +"též\n" +" použít při volání shellu. Aktuální množinu příznaků je možno nalézt " +"v $-.\n" +" Přebývajících n ARGUMENTÅ® jsou poziční parametry a budou přiřazeny,\n" +" v pořadí, do $1, $2, … $n. Nejsou-li zadány žádné ARGUMENTY, budou\n" +" vytiÅ¡těny vÅ¡echny proměnné shellu.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud nebyl zadán neplatný argument." + +#: builtins.c:1126 +msgid "" +"Unset values and attributes of shell variables and functions.\n" +" \n" +" For each NAME, remove the corresponding variable or function.\n" +" \n" +" Options:\n" +" -f\ttreat each NAME as a shell function\n" +" -v\ttreat each NAME as a shell variable\n" +" -n\ttreat each NAME as a name reference and unset the variable itself\n" +" \trather than the variable it references\n" +" \n" +" Without options, unset first tries to unset a variable, and if that " +"fails,\n" +" tries to unset a function.\n" +" \n" +" Some variables cannot be unset; also see `readonly'.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a NAME is read-only." +msgstr "" +"Odstraňuje hodnoty a atributy proměnných a funkcí shellu.\n" +" \n" +" Pro každé JMÉNO odstraní odpovídající proměnnou nebo funkci.\n" +" \n" +" Přepínače:\n" +" -f\tpovažuje každé JMÉNO za funkci shellu\n" +" -v\tpovažuje každé JMÉNO za proměnnou shellu\n" +" -n\tpovažuje každé JMÉNO za odkaz na název a odstraní proměnnou samu\n" +" \tnamísto proměnné, na kterou odkazuje\n" +" \n" +" Bez těchto dvou příznaků unset nejprve zkusí zruÅ¡it proměnnou a pokud " +"toto\n" +" selže, tak zkusí zruÅ¡it funkci.\n" +" \n" +" Některé proměnné nelze odstranit. Vizte příkaz „readonly“.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud nebyl zadán neplatný přepínač a JMÉNO není jen pro\n" +" čtení." + +#: builtins.c:1148 +msgid "" +"Set export attribute for shell variables.\n" +" \n" +" Marks each NAME for automatic export to the environment of subsequently\n" +" executed commands. If VALUE is supplied, assign VALUE before " +"exporting.\n" +" \n" +" Options:\n" +" -f\trefer to shell functions\n" +" -n\tremove the export property from each NAME\n" +" -p\tdisplay a list of all exported variables and functions\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" +"Nastaví atribut exportovat proměnné shellu.\n" +" \n" +" Každý NÁZEV je označen pro automatické exportování do prostředí " +"následně\n" +" prováděných příkazů. Je-li zadána HODNOTA, před exportem přiřadí " +"HODNOTU.\n" +" \n" +" Přepínače:\n" +" -f\tvztahuje se na funkce shellu\n" +" -n\todstraní vlastnost exportovat každému NÁZVU\n" +" -p\tzobrazí seznam vÅ¡ech exportovaných proměnných a funkcí\n" +" \n" +" Argument „--“ zakazuje zpracování dalších přepínačů.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud nebyl zadán neplatný přepínač nebo NÁZEV." + +#: builtins.c:1167 +msgid "" +"Mark shell variables as unchangeable.\n" +" \n" +" Mark each NAME as read-only; the values of these NAMEs may not be\n" +" changed by subsequent assignment. If VALUE is supplied, assign VALUE\n" +" before marking as read-only.\n" +" \n" +" Options:\n" +" -a\trefer to indexed array variables\n" +" -A\trefer to associative array variables\n" +" -f\trefer to shell functions\n" +" -p\tdisplay a list of all readonly variables or functions, depending " +"on\n" +" whether or not the -f option is given\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" +"Označí proměnné shellu za nezměnitelné.\n" +" \n" +" Označí každý NÁZEV jako jen pro čtení, hodnoty těchto NÁZVÅ® nebude " +"možné\n" +" změnit následným přiřazením. Je-li zadána HODNOTA, před označením za " +"jen\n" +" pro čtení přiřadí HODNOTU.\n" +" \n" +" Přepínače:\n" +" -a\tvztahuje se na proměnné typu číslované pole\n" +" -A\tvztahuje se na proměnné typu asociativní pole\n" +" -f\tvztahuje se funkce shellu\n" +" -p\tzobrazí seznam vÅ¡ech proměnných nebo funkcí jen pro čtení\n" +" \tv závislosti podle toho, zda-li byl zadán přepínač -f\n" +" \n" +" Argument „--“ zakáže zpracování dalších přepínačů.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud nebyl zadán neplatný přepínač nebo NÁZEV." + +#: builtins.c:1189 +msgid "" +"Shift positional parameters.\n" +" \n" +" Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n" +" not given, it is assumed to be 1.\n" +" \n" +" Exit Status:\n" +" Returns success unless N is negative or greater than $#." +msgstr "" +"Posune poziční parametry.\n" +" \n" +" Přejmenuje poziční parametry $N+1, $N+2, … na $1, $2, …\n" +" Není-li zadáno N, předpokládá se 1.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud N není záporný a není větší než $#." + +#: builtins.c:1201 builtins.c:1216 +msgid "" +"Execute commands from a file in the current shell.\n" +" \n" +" Read and execute commands from FILENAME in the current shell. The\n" +" entries in $PATH are used to find the directory containing FILENAME.\n" +" If any ARGUMENTS are supplied, they become the positional parameters\n" +" when FILENAME is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed in FILENAME; fails if\n" +" FILENAME cannot be read." +msgstr "" +"Vykoná příkazy obsažené ze souboru v současném shellu.\n" +" \n" +" Načte a provede příkazy z NÁZEV_SOUBORU v tomto shellu. Položky v $PATH\n" +" jsou použity pro nalezení adresáře obsahujícího NÁZEV_SOUBORU. Jsou-li\n" +" zadány nějaké ARGUMENTY, stanou se pozičními parametry při běhu\n" +" NÁZVU_SOUBORU.\n" +" \n" +" Návratový kód:\n" +" Vrací návratový kód posledního provedeného příkazu z NÁZVU_SOUBORU.\n" +" Selže, pokud NÁZEV_SOUBORU nelze načíst." + +#: builtins.c:1232 +msgid "" +"Suspend shell execution.\n" +" \n" +" Suspend the execution of this shell until it receives a SIGCONT signal.\n" +" Unless forced, login shells cannot be suspended.\n" +" \n" +" Options:\n" +" -f\tforce the suspend, even if the shell is a login shell\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Pozastaví běh shellu.\n" +" \n" +" Pozastaví provádění tohoto shellu do doby, něž bude obdržen signál\n" +" SIGCONT. Není-li vynuceno, přihlaÅ¡ovací shell nelze pozastavit.\n" +" \n" +" Přepínače:\n" +" -f\tvynutí pozastavení, i když se jedná o přihlaÅ¡ovací (login) shellu\n" +" \n" +" Návratový kód:\n" +" Vrací úspěch, pokud je správa úloh zapnuta a nevyskytla se chyba." + +#: builtins.c:1248 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" Exits with a status of 0 (true) or 1 (false) depending on\n" +" the evaluation of EXPR. Expressions may be unary or binary. Unary\n" +" expressions are often used to examine the status of a file. There\n" +" are string operators and numeric comparison operators as well.\n" +" \n" +" The behavior of test depends on the number of arguments. Read the\n" +" bash manual page for the complete specification.\n" +" \n" +" File operators:\n" +" \n" +" -a FILE True if file exists.\n" +" -b FILE True if file is block special.\n" +" -c FILE True if file is character special.\n" +" -d FILE True if file is a directory.\n" +" -e FILE True if file exists.\n" +" -f FILE True if file exists and is a regular file.\n" +" -g FILE True if file is set-group-id.\n" +" -h FILE True if file is a symbolic link.\n" +" -L FILE True if file is a symbolic link.\n" +" -k FILE True if file has its `sticky' bit set.\n" +" -p FILE True if file is a named pipe.\n" +" -r FILE True if file is readable by you.\n" +" -s FILE True if file exists and is not empty.\n" +" -S FILE True if file is a socket.\n" +" -t FD True if FD is opened on a terminal.\n" +" -u FILE True if the file is set-user-id.\n" +" -w FILE True if the file is writable by you.\n" +" -x FILE True if the file is executable by you.\n" +" -O FILE True if the file is effectively owned by you.\n" +" -G FILE True if the file is effectively owned by your group.\n" +" -N FILE True if the file has been modified since it was last " +"read.\n" +" \n" +" FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" +" modification date).\n" +" \n" +" FILE1 -ot FILE2 True if file1 is older than file2.\n" +" \n" +" FILE1 -ef FILE2 True if file1 is a hard link to file2.\n" +" \n" +" String operators:\n" +" \n" +" -z STRING True if string is empty.\n" +" \n" +" -n STRING\n" +" STRING True if string is not empty.\n" +" \n" +" STRING1 = STRING2\n" +" True if the strings are equal.\n" +" STRING1 != STRING2\n" +" True if the strings are not equal.\n" +" STRING1 < STRING2\n" +" True if STRING1 sorts before STRING2 " +"lexicographically.\n" +" STRING1 > STRING2\n" +" True if STRING1 sorts after STRING2 lexicographically.\n" +" \n" +" Other operators:\n" +" \n" +" -o OPTION True if the shell option OPTION is enabled.\n" +" -v VAR\t True if the shell variable VAR is set\n" +" -R VAR\t True if the shell variable VAR is set and is a name " +"reference.\n" +" ! EXPR True if expr is false.\n" +" EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n" +" EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n" +" \n" +" arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Arithmetic binary operators return true if ARG1 is equal, not-equal,\n" +" less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n" +" than ARG2.\n" +" \n" +" Exit Status:\n" +" Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n" +" false or an invalid argument is given." +msgstr "" +"Vyhodnotí podmínkový výraz.\n" +" \n" +" Skončí s kódem 0 (pravda) nebo 1 (nepravda) podle vyhodnocení VÝRAZU.\n" +" Výraz smí být unární nebo binární. Unární výrazy se často používají pro\n" +" zjiÅ¡tění stavu souboru. Rovněž jsou k dispozici řetězcové operátory a\n" +" operátory číselného porovnání.\n" +" \n" +" Chování testu závisí na počtu argumentů. Úplnou specifikaci si lze\n" +" přečíst v manuálové stránce bashe.\n" +" \n" +" Souborové operátory:\n" +" \n" +" -a SOUBOR Pravda, pokud soubor existuje.\n" +" -b SOUBOR Pravda, pokud soubor je blokovým zařízením.\n" +" -c SOUBOR Pravda, pokud soubor je znakovým zařízením.\n" +" -d SOUBOR Pravda, pokud soubor je adresářem.\n" +" -e SOUBOR Pravda, pokud soubor existuje.\n" +" -f SOUBOR Pravda, pokud soubor existuje a je to běžný soubor.\n" +" -g SOUBOR Pravda, pokud soubor je SGID.\n" +" -h SOUBOR Pravda, pokud soubor je symbolickým odkazem.\n" +" -L SOUBOR Pravda, pokud soubor je symbolickým odkazem.\n" +" -k SOUBOR Pravda, pokud soubor má nastavený „sticky“ bit.\n" +" -p SOUBOR Pravda, pokud soubor je pojmenovanou rourou.\n" +" -r SOUBOR Pravda, pokud soubor je vámi čitelný.\n" +" -s SOUBOR Pravda, pokud soubor existuje a je neprázdný.\n" +" -S SOUBOR Pravda, pokud soubor je socketem.\n" +" -t FD Pravda, pokud FD (deskriptor souboru) je otevřený na\n" +" terminálu.\n" +" -u SOUBOR Pravda, pokud soubor je SUID.\n" +" -w SOUBOR Pravda, pokud soubor je vámi zapisovatelný.\n" +" -x SOUBOR Pravda, pokud soubor je vámi spustitelný.\n" +" -O SOUBOR Pravda, pokud soubor je vámi efektivně vlastněn.\n" +" -G SOUBOR Pravda, pokud soubor je efektivně vlastněn vaší\n" +" skupinou.\n" +" -N SOUBOR Pravda, pokud soubor byl změněn po posledním čtení.\n" +" \n" +" SOUBOR1 -nt SOUBOR2\n" +" Pravda, pokud je SOUBOR1 novější než SOUBOR2 (podle " +"času\n" +" změny obsahu).\n" +" \n" +" SOUBOR1 -ot SOUBOR2\n" +" Pravda, pokud SOUBOR1 je starší než SOUBOR2.\n" +" \n" +" SOUBOR1 -ef SOUBOR2\n" +" Pravda, pokud SOUBOR1 je pevným odkazem na SOUBOR2.\n" +" \n" +" Řetězcové operátory:\n" +" \n" +" -z ŘETĚZEC Pravda, pokud ŘETĚZEC je prázdný.\n" +" \n" +" -n ŘETĚZEC\n" +" ŘETĚZEC Pravda, pokud ŘETĚZEC není prázdný.\n" +" \n" +" ŘETĚZEC1 = ŘETĚZEC2\n" +" Pravda, pokud jsou řetězce shodné.\n" +" ŘETĚZEC1 != ŘETĚZEC2\n" +" Pravda, pokud se řetězce neshodují.\n" +" ŘETĚZEC1 < ŘETĚZEC2\n" +" Pravda, pokud se ŘETĚZEC1 řadí lexikograficky před\n" +" ŘETĚZEC2.\n" +" ŘETĚZEC1 > ŘETĚZEC2\n" +" Pravda, pokud se ŘETĚZEC1 řadí lexikograficky za\n" +" ŘETĚZEC2.\n" +" \n" +" Další operátory:\n" +" \n" +" -o PŘEPÍNAČ Pravda, pokud je přepínač shellu PŘEPÍNAČ zapnut.\n" +" -v PROMĚNNÁ Pravda, pokud je proměnná shellu PROMĚNNÁ nastavena\n" +" -R PROMĚNNÁ Pravda, pokud je proměnná shellu PROMĚNNÁ nastavena a\n" +" jedná se odkaz na název.\n" +" ! VÝRAZ Pravda, pokud je VÝRAZ nepravdivý.\n" +" VÝRAZ1 -a VÝRAZ2\n" +" Pravda, pokud oba VÝRAZ1 I VÝRAZ2 jsou pravdivé.\n" +" VÝRAZ1 -o VÝRAZ2\n" +" Pravda, pokud VÝRAZ1 NEBO VÝRAZ2 je pravdivý.\n" +" \n" +" ARGUMENT1 OP ARGUMENT2\n" +" Aritmetické testy. OP je jeden z -eq, -ne, -lt,\n" +" -le, -gt nebo -ge.\n" +" \n" +" Aritmetické binární operátory vracejí pravdu, pokud ARGUMENT1 je roven,\n" +" neroven, menší než, menší než nebo roven, větší než, větší než nebo\n" +" roven ARGUMENTU2. \n" +" Návratový kód:\n" +" Vrací úspěch, je-li VÝRAZ vyhodnocen jako pravdivý. Selže, je-li VÝRAZ\n" +" vyhodnocen jako nepravdivý nebo je-li zadán neplatný argument." + +#: builtins.c:1329 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" This is a synonym for the \"test\" builtin, but the last argument must\n" +" be a literal `]', to match the opening `['." +msgstr "" +"Vyhodnotí podmínkový výraz.\n" +" \n" +" Toto je synonymum pro vestavěný příkaz „test“, až na to, že poslední\n" +" argument musí být doslovně „]“, aby se shodoval s otevírající „[“." + +#: builtins.c:1338 +msgid "" +"Display process times.\n" +" \n" +" Prints the accumulated user and system times for the shell and all of " +"its\n" +" child processes.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Zobrazí časy procesu.\n" +" \n" +" Vypíše celkovou dobu procesu shellu a vÅ¡ech jeho potomků, kterou " +"strávili\n" +" v uživatelském a jaderném (system) prostoru.\n" +" \n" +" Návratový kód:\n" +" Vždy uspěje." + +#: builtins.c:1350 +msgid "" +"Trap signals and other events.\n" +" \n" +" Defines and activates handlers to be run when the shell receives " +"signals\n" +" or other conditions.\n" +" \n" +" ARG is a command to be read and executed when the shell receives the\n" +" signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n" +" is supplied) or `-', each specified signal is reset to its original\n" +" value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" +" shell and by the commands it invokes.\n" +" \n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. " +"If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. " +"If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or " +"a\n" +" script run by the . or source builtins finishes executing. A " +"SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause " +"the\n" +" shell to exit when the -e option is enabled.\n" +" \n" +" If no arguments are supplied, trap prints the list of commands " +"associated\n" +" with each signal.\n" +" \n" +" Options:\n" +" -l\tprint a list of signal names and their corresponding numbers\n" +" -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" +" \n" +" Each SIGNAL_SPEC is either a signal name in or a signal " +"number.\n" +" Signal names are case insensitive and the SIG prefix is optional. A\n" +" signal may be sent to the shell with \"kill -signal $$\".\n" +" \n" +" Exit Status:\n" +" Returns success unless a SIGSPEC is invalid or an invalid option is " +"given." +msgstr "" +"Zachytávání signálů a jiných událostí.\n" +" \n" +" Definuje a aktivuje obsluhy, které budou spuÅ¡těny, když shell obdrží\n" +" signály nebo nastanou určité podmínky.\n" +" \n" +" Příkaz ARGUMENT bude načten a proveden, až shell obdrží signál(y)\n" +" SIGNAL_SPEC. Pokud ARGUMENT chybí (a je zadán jeden SIGNAL_SPEC) nebo " +"je\n" +" „-“, každý určený signál bude přenastaven zpět na svoji původní " +"hodnotu.\n" +" Je-li ARGUMENT prázdný řetězec, každý SIGNAL_SPEC bude shellem a " +"příkazy\n" +" z něj spuÅ¡těnými ignorován.\n" +" \n" +" Je-li SIGNAL_SPEC „EXIT (0)“, bude ARGUMENT proveden při ukončování " +"tohoto\n" +" shellu. Je-li SIGNAL_SPEC „DEBUG“, bude ARGUMENT proveden před každým\n" +" jednoduchým příkazem. Je-li SIGNAL_SPEC „RETURN“, bude ARGUMENT " +"proveden\n" +" vždy, když skončí běh funkce shellu nebo skriptu spuÅ¡těného přes\n" +" vestavěný příkaz „.“ nebo „source“. SIGNAL_SPEC „ERR“ znamená, že\n" +" ARGUMENT bude proveden pokaždé, když by selhání příkazu způsobilo\n" +" ukončení shellu (je-li zapnut přepínač -e).\n" +" \n" +" Nejsou-li poskytnuty žádné argumenty, trap vypíše seznam příkazů " +"navázaných\n" +" na vÅ¡echny signály.\n" +" \n" +" Přepínače:\n" +" -l\tvypíše seznam jmen signálů a jim odpovídajících čísel\n" +" -p\tzobrazí příkazy navázané na každý SIGNAL_SPEC\n" +" \n" +" Každý SIGNAL_SPEC je buďto jméno signálu ze , nebo číslo " +"signálu.\n" +" U jmen signálů nezáleží na velikosti písmen a předpona SIG je " +"nepovinná.\n" +" Aktuálnímu shellu lze zaslat signál pomocí „kill -signal $$“.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud SIGSPEC a zadané přepínače jsou platné." + +#: builtins.c:1386 +msgid "" +"Display information about command type.\n" +" \n" +" For each NAME, indicate how it would be interpreted if used as a\n" +" command name.\n" +" \n" +" Options:\n" +" -a\tdisplay all locations containing an executable named NAME;\n" +" \tincludes aliases, builtins, and functions, if and only if\n" +" \tthe `-p' option is not also used\n" +" -f\tsuppress shell function lookup\n" +" -P\tforce a PATH search for each NAME, even if it is an alias,\n" +" \tbuiltin, or function, and returns the name of the disk file\n" +" \tthat would be executed\n" +" -p\treturns either the name of the disk file that would be executed,\n" +" \tor nothing if `type -t NAME' would not return `file'.\n" +" -t\toutput a single word which is one of `alias', `keyword',\n" +" \t`function', `builtin', `file' or `', if NAME is an alias, shell\n" +" \treserved word, shell function, shell builtin, disk file, or not\n" +" \tfound, respectively\n" +" \n" +" Arguments:\n" +" NAME\tCommand name to be interpreted.\n" +" \n" +" Exit Status:\n" +" Returns success if all of the NAMEs are found; fails if any are not " +"found." +msgstr "" +"Zobrazí informace o typu příkazu.\n" +" \n" +" O každém NÁZVU řekne, jak by byl interpretován, kdyby byl použit jako\n" +" název příkazu.\n" +" \n" +" Přepínače\n" +" -a\tzobrazí vÅ¡echna místa, kde se nalézá spustitelný program\n" +" \tpojmenovaný NÁZEV. To zahrnuje aliasy, vestavěné příkazy a funkce\n" +" \tjen a pouze tehdy, když není rovněž použit přepínač -p.\n" +" -f\tpotlačí hledání mezi funkcemi shellu\n" +" -P\tvynutí prohledání PATH na každý NÁZEV, dokonce i když se\n" +" \tjedná o alias, vestavěný příkaz nebo funkci, a vrátí název\n" +" \tsouboru na disku, který by byl spuÅ¡těn\n" +" -p\tbuď vrátí jméno souboru na disku, který by byl spuÅ¡těn,\n" +" \tnebo nic, pokud „type -t NÁZEV“ by nevrátil „file“ (soubor)\n" +" -t\tvypíše jedno slovo z těchto: „alias“, „keyword“, „function“,\n" +" \t„builtin“, „file“ nebo „“, je-li NÁZEV alias, klíčové slovo\n" +" \tshellu, shellová funkce, vestavěný příkaz shellu, soubor na\n" +" \tdisku nebo nenalezený příkaz\n" +" \n" +" Argumenty:\n" +" NÁZEV\tNázev příkazu určený k výkladu.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud vÅ¡echny NÁZVY byly nalezeny. Selže, pokud některé\n" +" nalezeny nebyly." + +#: builtins.c:1417 +msgid "" +"Modify shell resource limits.\n" +" \n" +" Provides control over the resources available to the shell and " +"processes\n" +" it creates, on systems that allow such control.\n" +" \n" +" Options:\n" +" -S\tuse the `soft' resource limit\n" +" -H\tuse the `hard' resource limit\n" +" -a\tall current limits are reported\n" +" -b\tthe socket buffer size\n" +" -c\tthe maximum size of core files created\n" +" -d\tthe maximum size of a process's data segment\n" +" -e\tthe maximum scheduling priority (`nice')\n" +" -f\tthe maximum size of files written by the shell and its children\n" +" -i\tthe maximum number of pending signals\n" +" -l\tthe maximum size a process may lock into memory\n" +" -m\tthe maximum resident set size\n" +" -n\tthe maximum number of open file descriptors\n" +" -p\tthe pipe buffer size\n" +" -q\tthe maximum number of bytes in POSIX message queues\n" +" -r\tthe maximum real-time scheduling priority\n" +" -s\tthe maximum stack size\n" +" -t\tthe maximum amount of cpu time in seconds\n" +" -u\tthe maximum number of user processes\n" +" -v\tthe size of virtual memory\n" +" -x\tthe maximum number of file locks\n" +" -T the maximum number of threads\n" +" \n" +" Not all options are available on all platforms.\n" +" \n" +" If LIMIT is given, it is the new value of the specified resource; the\n" +" special LIMIT values `soft', `hard', and `unlimited' stand for the\n" +" current soft limit, the current hard limit, and no limit, respectively.\n" +" Otherwise, the current value of the specified resource is printed. If\n" +" no option is given, then -f is assumed.\n" +" \n" +" Values are in 1024-byte increments, except for -t, which is in seconds,\n" +" -p, which is in increments of 512 bytes, and -u, which is an unscaled\n" +" number of processes.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Upravuje omezení (limity) zdrojů shellu.\n" +" \n" +" Poskytuje kontrolu nad zdroji dostupnými shellu a procesům z něj\n" +" spuÅ¡těných (na systémech, které takovou kontrolu umožňují).\n" +" \n" +" Přepínače:\n" +" -S\tpoužije se „měkké“ (soft) omezení zdroje\n" +" -H\tpoužije se „tvrdé“ (hard) omezení zdroje\n" +" -a\tnahlásí vÅ¡echna současná omezení (limity)\n" +" -b\tvelikost vyrovnávací paměti socketů\n" +" -c\tmaximální velikost vytvářených core souborů (výpis paměti " +"programu)\n" +" -d\tmaximální velikost datového segmentu procesu\n" +" -e\tmaximální plánovací priorita („nice“)\n" +" -f\tmaximální velikost souborů zapsaných shellem a jeho potomky\n" +" -i\tmaximální počet čekajících signálů\n" +" -l\tmaximální velikost paměti, kterou může proces zamknout\n" +" -m\tmaximální velikost rezidentní paměti (resident set size)\n" +" -n\tmaximální počet otevřených deskriptorů souboru\n" +" -p\tvelikost vyrovnávací paměti rour\n" +" -q\tmaximální počet bajtů ve frontě posixových zpráv\n" +" -r\tmaximální priorita plánování v reálném čase\n" +" -s\tmaximální velikost zásobníku\n" +" -t\tmaximální množství procesorového času v sekundách\n" +" -u\tmaximální počet procesů uživatele\n" +" -v\tvelikost virtuální paměti\n" +" -x\tmaximální počet zámků na souborech\n" +" -T\tmaximální počet vláken\n" +" \n" +" Ne vÅ¡echny přepínače jsou dostupné na vÅ¡ech platformách.\n" +" \n" +" Je-li zadán LIMIT, jedná se o novou hodnotu daného zdroje. Zvláštní\n" +" hodnoty LIMITU „soft“, „hard“ a „unlimited“ znamenají současný měkký\n" +" limit, současný tvrdý limit a žádný limit. V opačném případě bude\n" +" zobrazena současná hodnota limitu daného zdroje. Není-li zadán žádný\n" +" přepínač, pak se předpokládá -f.\n" +" \n" +" Hodnoty jsou v násobcích 1024 bajtů, kromě -t, která je v sekundách,\n" +" -p, která je v násobcích 512 bajtů, a -u, což je absolutní počet " +"procesů.\n" +" \n" +" Návratová hodnota:\n" +" Vrací úspěch, pokud nebyl zadán neplatný přepínač a nevyskytla se chyba." + +#: builtins.c:1465 +msgid "" +"Display or set file mode mask.\n" +" \n" +" Sets the user file-creation mask to MODE. If MODE is omitted, prints\n" +" the current value of the mask.\n" +" \n" +" If MODE begins with a digit, it is interpreted as an octal number;\n" +" otherwise it is a symbolic mode string like that accepted by chmod(1).\n" +" \n" +" Options:\n" +" -p\tif MODE is omitted, output in a form that may be reused as input\n" +" -S\tmakes the output symbolic; otherwise an octal number is output\n" +" \n" +" Exit Status:\n" +" Returns success unless MODE is invalid or an invalid option is given." +msgstr "" +"Zobrazí nebo nastaví uživatelskou masku práv.\n" +" \n" +" Nastaví Uživatelskou masku práv vytvářených souborů na MÓD. Je-li\n" +" MÓD vynechán, bude vytiÅ¡těna současná hodnota masky.\n" +" \n" +" Začíná-li MÓD číslicí, bude interpretován jako osmičkové číslo, jinak\n" +" jako řetězec symbolického zápisu práv tak, jak jej chápe chmod(1).\n" +" \n" +" Přepínače:\n" +" -p\tje-li MÓD vynechán, bude výstup v podobě, kterou lze použít\n" +" \tjako vstup\n" +" -S\tučiní výstup symbolický, jinak bude výstupem osmičkové číslo\n" +" \n" +" Návratový kód\n" +" Vrátí úspěch, pokud nebyl zadán neplatný MÓD nebo přepínač." + +#: builtins.c:1485 +msgid "" +"Wait for job completion and return exit status.\n" +" \n" +" Waits for each process identified by an ID, which may be a process ID or " +"a\n" +" job specification, and reports its termination status. If ID is not\n" +" given, waits for all currently active child processes, and the return\n" +" status is zero. If ID is a a job specification, waits for all " +"processes\n" +" in that job's pipeline.\n" +" \n" +" If the -n option is supplied, waits for the next job to terminate and\n" +" returns its exit status.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last ID; fails if ID is invalid or an invalid\n" +" option is given." +msgstr "" +"Počká na dokončení úlohy a vrátí její návratový kód.\n" +" \n" +" Počká na každý proces určený ID, což může být ID procesu nebo " +"identifikace\n" +" úlohy, a nahlásí jeho návratový kód. Není-li ID zadáno, počká na " +"vÅ¡echny\n" +" právě aktivní dětské procesy a návratovým kódem bude nula. Je-li ID\n" +" identifikátorem úlohy, počká na vÅ¡echny procesy z kolony dané úlohy.\n" +" \n" +" Je-li zadán přepínač -n, počká na ukončení další úlohy a vrátí její\n" +" návratový kód.\n" +" \n" +" Návratový kód:\n" +" Vrátí kód posledního ID. Selže, pokud ID není platný nebo byl zadán\n" +" neplatný přepínač." + +#: builtins.c:1506 +msgid "" +"Wait for process completion and return exit status.\n" +" \n" +" Waits for each process specified by a PID and reports its termination " +"status.\n" +" If PID is not given, waits for all currently active child processes,\n" +" and the return status is zero. PID must be a process ID.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last PID; fails if PID is invalid or an " +"invalid\n" +" option is given." +msgstr "" +"Počká na dokončení procesu a vrátí jeho návratový kód.\n" +" \n" +" Počká na každý proces určený PID a nahlásí jeho návratový kód. Není-li\n" +" PID zadán, bude se čekat na vÅ¡echny právě aktivní procesy potomků a\n" +" návratová hodnota bude nula. PID musí být ID procesu.\n" +" \n" +" Návratový kód:\n" +" Vrátí kód posledního PID. Selže, pokud PID není platný nebo byl zadán\n" +" neplatný přepínač." + +#: builtins.c:1521 +msgid "" +"Execute commands for each member in a list.\n" +" \n" +" The `for' loop executes a sequence of commands for each member in a\n" +" list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is\n" +" assumed. For each element in WORDS, NAME is set to that element, and\n" +" the COMMANDS are executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Pro každý prvek seznamu vykoná příkazy.\n" +" \n" +" Smyčka „for“ provede posloupnost příkazů pro každý prvek v seznamu " +"položek.\n" +" Pokud „in SLOVECH…;“ není přítomno, pak se předpokládá „in \"$@\"“. " +"NÁZEV\n" +" bude postupně nastaven na každý prvek ve SLOVECH a PŘÍKAZY budou " +"provedeny.\n" +" \n" +" Návratový kód:\n" +" Vrátí kód naposledy provedeného příkazu." + +#: builtins.c:1535 +msgid "" +"Arithmetic for loop.\n" +" \n" +" Equivalent to\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n" +" omitted, it behaves as if it evaluates to 1.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Aritmetická smyčka for.\n" +" \n" +" Ekvivalentní k\n" +" \t(( VÝR1 ))\n" +" \twhile (( VÝR2 )); do\n" +" \t\tPŘÍKAZY\n" +" \t\t(( VÝR3 ))\n" +" \tdone\n" +" VÝR1, VÝR2 a VÝR3 jsou aritmetické výrazy. Chybí-li některý výraz,\n" +" chová se, jako by byl vyhodnocen na 1. \n" +" Návratový kód:\n" +" Vrátí kód naposledy vykonaného příkazu." + +#: builtins.c:1553 +msgid "" +"Select words from a list and execute commands.\n" +" \n" +" The WORDS are expanded, generating a list of words. The\n" +" set of expanded words is printed on the standard error, each\n" +" preceded by a number. If `in WORDS' is not present, `in \"$@\"'\n" +" is assumed. The PS3 prompt is then displayed and a line read\n" +" from the standard input. If the line consists of the number\n" +" corresponding to one of the displayed words, then NAME is set\n" +" to that word. If the line is empty, WORDS and the prompt are\n" +" redisplayed. If EOF is read, the command completes. Any other\n" +" value read causes NAME to be set to null. The line read is saved\n" +" in the variable REPLY. COMMANDS are executed after each selection\n" +" until a break command is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Vybere slova ze seznamu a vykoná příkazy.\n" +" \n" +" SLOVA jsou expandována a vytvoří seznam slov. Množina expandovaných " +"slov\n" +" je vytiÅ¡těna na standardní chybový výstup, každé předchází číslo. Není-" +"li\n" +" „in SLOVA“ přítomno, předpokládá se „in \"$@\"“. Pak je zobrazena výzva " +"PS3\n" +" a jeden řádek načten ze standardního vstupu. Pokud je řádek tvořen " +"číslem\n" +" odpovídajícím jednomu ze zobrazených slov, pak NÁZEV bude nastaven na " +"toto\n" +" slovo. Pokud je řádek prázdný, SLOVA a výzva budou znovu zobrazeny. Je-" +"li\n" +" načten EOF (konec souboru), příkaz končí. Načtení jakékoliv jiné " +"hodnoty\n" +" nastaví NÁZEV na prázdný řetězec. Načtený řádek bude uložen do proměnné\n" +" REPLY. Po každém výběru budou provedeny PŘÍKAZY, dokud nebude vykonán\n" +" příkaz „break“.\n" +" \n" +" Návratový kód:\n" +" Vrátí kód naposledy prováděného příkazu." + +#: builtins.c:1574 +msgid "" +"Report time consumed by pipeline's execution.\n" +" \n" +" Execute PIPELINE and print a summary of the real time, user CPU time,\n" +" and system CPU time spent executing PIPELINE when it terminates.\n" +" \n" +" Options:\n" +" -p\tprint the timing summary in the portable Posix format\n" +" \n" +" The value of the TIMEFORMAT variable is used as the output format.\n" +" \n" +" Exit Status:\n" +" The return status is the return status of PIPELINE." +msgstr "" +"Nahlásí čas spotřebovaný prováděním kolony.\n" +" \n" +" Vykoná KOLONU a zobrazí přehled reálného času, uživatelského\n" +" procesorového času a systémového procesorového času stráveného " +"prováděním\n" +" KOLONY poté, co skončí.\n" +" \n" +" Přepínače:\n" +" -p\tzobrazí přehled časů v přenositelném posixovém formátu\n" +" \n" +" Hodnota proměnné TIMEFORMAT se použije jako specifikace výstupního " +"formátu.\n" +" \n" +" Návratový kód:\n" +" Návratová hodnota je návratová hodnota KOLONY." + +#: builtins.c:1591 +msgid "" +"Execute commands based on pattern matching.\n" +" \n" +" Selectively execute COMMANDS based upon WORD matching PATTERN. The\n" +" `|' is used to separate multiple patterns.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Provede příkazy podle shody se vzorem.\n" +" \n" +" Výběrově provede PŘÍKAZY na základě shody SLOVA se VZOREM. Znak „|“\n" +" se používá na oddělení násobných VZORÅ®.\n" +" \n" +" Návratový kód:\n" +" Vrátí kód naposledy provedeného příkazu." + +#: builtins.c:1603 +msgid "" +"Execute commands based on conditional.\n" +" \n" +" The `if COMMANDS' list is executed. If its exit status is zero, then " +"the\n" +" `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list " +"is\n" +" executed in turn, and if its exit status is zero, the corresponding\n" +" `then COMMANDS' list is executed and the if command completes. " +"Otherwise,\n" +" the `else COMMANDS' list is executed, if present. The exit status of " +"the\n" +" entire construct is the exit status of the last command executed, or " +"zero\n" +" if no condition tested true.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Vykoná příkazy na základě splnění podmínky.\n" +" \n" +" Provede seznam „if PŘÍKAZŮ“. Bude-li jeho návratový kód nula, pak bude\n" +" proveden seznam „then PŘÍKAZŮ“. Jinak bude proveden popořadě každý " +"seznam\n" +" „elif PŘÍKAZŮ“ a bude-li jeho návratový kód nula, odpovídající seznam\n" +" „then PŘÍKAZŮ“ bude proveden a příkaz if skončí. V opačném případě bude\n" +" proveden seznam „else PŘÍKAZŮ“, pokud existuje. Návratová hodnota celé\n" +" konstrukce je návratovou hodnotou posledního provedeného příkazu nebo " +"nula,\n" +" pokud žádná z testovaných podmínek není pravdivá.\n" +" \n" +" Návratový kód:\n" +" Vrátí kód naposledy provedeného příkazu." + +#: builtins.c:1620 +msgid "" +"Execute commands as long as a test succeeds.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `while' COMMANDS has an exit status of zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Vykonává příkazy, dokud test úspěšně prochází.\n" +" \n" +" Expanduje a provádí PŘÍKAZY tak dlouho, dokud poslední příkaz ve " +"„while“\n" +" PŘÍKAZECH má nulový návratový kód.\n" +" \n" +" Návratový kód:\n" +" Vrátí kód naposledy provedeného příkazu." + +#: builtins.c:1632 +msgid "" +"Execute commands as long as a test does not succeed.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `until' COMMANDS has an exit status which is not zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Vykonává příkazy, dokud test končí neúspěšně.\n" +" \n" +" Expanduje a provádí PŘÍKAZY tak dlouho, dokud poslední příkaz ve " +"„until“\n" +" PŘÍKAZECH má nenulový návratový kód. \n" +" Návratový kód:\n" +" Vrátí kód naposledy provedeného příkazu." + +#: builtins.c:1644 +msgid "" +"Create a coprocess named NAME.\n" +" \n" +" Execute COMMAND asynchronously, with the standard output and standard\n" +" input of the command connected via a pipe to file descriptors assigned\n" +" to indices 0 and 1 of an array variable NAME in the executing shell.\n" +" The default NAME is \"COPROC\".\n" +" \n" +" Exit Status:\n" +" Returns the exit status of COMMAND." +msgstr "" +"Vytvoří koproces pojmenovaný NÁZEV.\n" +" \n" +" Vykoná PŘÍKAZ asynchronně, přičemž jeho standardní výstup a standardní\n" +" vstup budou napojeny rourou na souborové deskriptory uvedené v poli " +"NÁZEV\n" +" tohoto shellu pod indexem 0 a 1. Implicitní NÁZEV je „COPROC“.\n" +" \n" +" Návratový kód:\n" +" Vrátí návratový kód PŘÍKAZU." + +#: builtins.c:1658 +msgid "" +"Define shell function.\n" +" \n" +" Create a shell function named NAME. When invoked as a simple command,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is " +"invoked,\n" +" the arguments are passed to the function as $1...$n, and the function's\n" +" name is in $FUNCNAME.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is readonly." +msgstr "" +"Definuje funkci shellu.\n" +" \n" +" Vytvoří shellovou funkci pojmenovanou NÁZEV. Volána jakožto jednoduchý\n" +" příkaz spustí PŘÍKAZY v kontextu volajícího shellu. Je-li vyvolán " +"NÁZEV,\n" +" budou funkci předány argumenty jako $1…$n a název funkce bude umístěn " +"do\n" +" $FUNCNAME.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud NÁZEV není jen pro čtení." + +#: builtins.c:1672 +msgid "" +"Group commands as a unit.\n" +" \n" +" Run a set of commands in a group. This is one way to redirect an\n" +" entire set of commands.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Seskupí příkazy do jednotky.\n" +" \n" +" Spustí množinu příkazů v jedné skupině. Toto je jeden ze způsobů,\n" +" jak přesměrovat celou množinu příkazů. \n" +" Návratový kód:\n" +" Vrátí kód naposledy spuÅ¡těného příkazu." + +#: builtins.c:1684 +msgid "" +"Resume job in foreground.\n" +" \n" +" Equivalent to the JOB_SPEC argument to the `fg' command. Resume a\n" +" stopped or background job. JOB_SPEC can specify either a job name\n" +" or a job number. Following JOB_SPEC with a `&' places the job in\n" +" the background, as if the job specification had been supplied as an\n" +" argument to `bg'.\n" +" \n" +" Exit Status:\n" +" Returns the status of the resumed job." +msgstr "" +"Obnoví úlohu do popředí.\n" +" \n" +" Ekvivalent k argumentu ÚLOHA příkazu „fg“. Obnoví pozastavenou úlohu\n" +" nebo úlohu na pozadí. ÚLOHA může určovat buď název úlohy, nebo číslo " +"úlohy.\n" +" Přidání „&“ za ÚLOHU přesune úlohu na pozadí, jako by identifikátor " +"úlohy\n" +" byl argumentem příkazu „bg“.\n" +" \n" +" Návratový kód:\n" +" Vrátí kód obnovené úlohy." + +#: builtins.c:1699 +msgid "" +"Evaluate arithmetic expression.\n" +" \n" +" The EXPRESSION is evaluated according to the rules for arithmetic\n" +" evaluation. Equivalent to \"let EXPRESSION\".\n" +" \n" +" Exit Status:\n" +" Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise." +msgstr "" +"Vyhodnotí aritmetický výraz.\n" +" \n" +" VÝRAZ bude vyhodnocen podle pravidel aritmetického vyhodnocování.\n" +" Ekvivalentní k „let VÝRAZ“.\n" +" \n" +" Návratový kód:\n" +" Vrátí 1, pokud se VÝRAZ vyhodnotí na 0. Jinak vrátí 0." + +# XXX: „coniditional command“ znamená podmínka, výraz podmínky. Nikoliv +# příkaz, který by byl vykonán na základě splnění jiné podmínky. Tj. překlad +# „podmíněný příkaz“ je chybný. +# Toto je nápověda k vestavěnému příkazu „[“. +#: builtins.c:1711 +msgid "" +"Execute conditional command.\n" +" \n" +" Returns a status of 0 or 1 depending on the evaluation of the " +"conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries " +"used\n" +" by the `test' builtin, and may be combined using the following " +"operators:\n" +" \n" +" ( EXPRESSION )\tReturns the value of EXPRESSION\n" +" ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" +" EXPR1 && EXPR2\tTrue if both EXPR1 and EXPR2 are true; else false\n" +" EXPR1 || EXPR2\tTrue if either EXPR1 or EXPR2 is true; else false\n" +" \n" +" When the `==' and `!=' operators are used, the string to the right of\n" +" the operator is used as a pattern and pattern matching is performed.\n" +" When the `=~' operator is used, the string to the right of the operator\n" +" is matched as a regular expression.\n" +" \n" +" The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n" +" determine the expression's value.\n" +" \n" +" Exit Status:\n" +" 0 or 1 depending on value of EXPRESSION." +msgstr "" +"Vykoná podmínkový příkaz.\n" +" \n" +" Vrátí status 0 nebo 1 podle vyhodnocení výrazu podmínky VÝRAZ. Výrazy\n" +" se skládají ze stejných primitiv jako u vestavěného příkazu „test“ a\n" +" mohou být kombinovány za pomoci následujících operátorů:\n" +" \n" +" ( VÝRAZ )\tVrátí hodnotu VÝRAZU\n" +" ! VÝRAZ\t\tPravda, pokud VÝRAZ je nepravdivý; jinak nepravda\n" +" VÝR1 && VÝR2\tPravda, pokud oba VÝR1 i VÝR2 jsou pravdivé;\n" +" \t\tjinak nepravda\n" +" VÝR1 || VÝR2\tPravda, pokud VÝR1 nebo VÝR2 je pravdivý; jinak " +"nepravda\n" +" \n" +" Jsou-li použity operátory „==“ a „!=“, řetězec napravo od operátoru je\n" +" použit jako vzor a bude uplatněno porovnávání proti vzoru. Je-li použit\n" +" operátor „=~, řetězec napravo do operátoru je uvažován jako regulární\n" +" výraz.\n" +" \n" +" Operátory && a || nevyhodnocují VÝR2, pokud VÝR1 je dostatečný na " +"určení\n" +" hodnoty výrazu.\n" +" \n" +" Návratový kód:\n" +" 0 nebo 1 podle hodnoty VÝRAZU." + +#: builtins.c:1737 +msgid "" +"Common shell variable names and usage.\n" +" \n" +" BASH_VERSION\tVersion information for this Bash.\n" +" CDPATH\tA colon-separated list of directories to search\n" +" \t\tfor directories given as arguments to `cd'.\n" +" GLOBIGNORE\tA colon-separated list of patterns describing filenames to\n" +" \t\tbe ignored by pathname expansion.\n" +" HISTFILE\tThe name of the file where your command history is stored.\n" +" HISTFILESIZE\tThe maximum number of lines this file can contain.\n" +" HISTSIZE\tThe maximum number of history lines that a running\n" +" \t\tshell can access.\n" +" HOME\tThe complete pathname to your login directory.\n" +" HOSTNAME\tThe name of the current host.\n" +" HOSTTYPE\tThe type of CPU this version of Bash is running under.\n" +" IGNOREEOF\tControls the action of the shell on receipt of an EOF\n" +" \t\tcharacter as the sole input. If set, then the value\n" +" \t\tof it is the number of EOF characters that can be seen\n" +" \t\tin a row on an empty line before the shell will exit\n" +" \t\t(default 10). When unset, EOF signifies the end of input.\n" +" MACHTYPE\tA string describing the current system Bash is running on.\n" +" MAILCHECK\tHow often, in seconds, Bash checks for new mail.\n" +" MAILPATH\tA colon-separated list of filenames which Bash checks\n" +" \t\tfor new mail.\n" +" OSTYPE\tThe version of Unix this version of Bash is running on.\n" +" PATH\tA colon-separated list of directories to search when\n" +" \t\tlooking for commands.\n" +" PROMPT_COMMAND\tA command to be executed before the printing of each\n" +" \t\tprimary prompt.\n" +" PS1\t\tThe primary prompt string.\n" +" PS2\t\tThe secondary prompt string.\n" +" PWD\t\tThe full pathname of the current directory.\n" +" SHELLOPTS\tA colon-separated list of enabled shell options.\n" +" TERM\tThe name of the current terminal type.\n" +" TIMEFORMAT\tThe output format for timing statistics displayed by the\n" +" \t\t`time' reserved word.\n" +" auto_resume\tNon-null means a command word appearing on a line by\n" +" \t\titself is first looked for in the list of currently\n" +" \t\tstopped jobs. If found there, that job is foregrounded.\n" +" \t\tA value of `exact' means that the command word must\n" +" \t\texactly match a command in the list of stopped jobs. A\n" +" \t\tvalue of `substring' means that the command word must\n" +" \t\tmatch a substring of the job. Any other value means that\n" +" \t\tthe command must be a prefix of a stopped job.\n" +" histchars\tCharacters controlling history expansion and quick\n" +" \t\tsubstitution. The first character is the history\n" +" \t\tsubstitution character, usually `!'. The second is\n" +" \t\tthe `quick substitution' character, usually `^'. The\n" +" \t\tthird is the `history comment' character, usually `#'.\n" +" HISTIGNORE\tA colon-separated list of patterns used to decide which\n" +" \t\tcommands should be saved on the history list.\n" +msgstr "" +"Názvu běžných proměnných shellu a jejich význam.\n" +" \n" +" BASH_VERSION\tInformace o verzi tohoto Bashe.\n" +" CDPATH\tDvojtečkou oddělený seznam adresářů, který se prohledává\n" +" \t\tna adresáře zadané jako argumenty u „cd“.\n" +" GLOBIGNORE\tDvojtečkou oddělený seznam vzorů popisujících jména " +"souborů,\n" +" \t\tkterá budou ignorována při expanzi cest.\n" +" HISTFILE\tJméno souboru, kde je uložena historie vaÅ¡ich příkazů.\n" +" HISTFILESIZE\tMaximální počet řádků, které tento soubor smí obsahovat.\n" +" HISTSIZE\tMaximální počet řádků historie, které jsou dostupné uvnitř\n" +" \t\tběžícího shellu.\n" +" HOME\tCelá cesta do vaÅ¡eho domovského adresáře.\n" +" HOSTNAME\tJméno současného stroje.\n" +" HOSTTYPE\tDruh CPU, na které tento Bash běží.\n" +" IGNOREEOF\tŘídí reakci shellu na přijetí znaku EOF (konec souboru)\n" +" \t\tpři samotném vstupu. Je-li nastaveno, pak její hodnota udává\n" +" \t\tpočet znaků EOF, které mohou bezprostředně následovat na prázdném\n" +" \t\třádku, dříve než shell skončí (implicitní hodnota je 10). Není-li\n" +" \t\tnastaveno, EOF značí konec vstupu.\n" +" MACHTYPE\tŘetězec popisující systém, na kterém tento Bash běží.\n" +" MAILCHECK\tJak často, v sekundách, kontroluje Bash novou poÅ¡tu.\n" +" MAILPATH\tDvojtečkou oddělený seznam názvů souborů, které Bash\n" +" \t\tkontroluje na novou poÅ¡tu.\n" +" OSTYPE\tVerze Unixu, na kterém tento Bash běží.\n" +" PATH\tDvojtečkou oddělený seznam adresářů, které jsou prohledávány\n" +" \t\tna příkazy.\n" +" PROMPT_COMMAND\tPříkaz, který je proveden před vytiÅ¡těním každé\n" +" \t\tprimární výzvy shellu.\n" +" PS1\t\tŘetězec prvotní výzvy shellu.\n" +" PS2\t\tŘetězec druhotné výzvy shellu.\n" +" PWD\t\tCelé jméno cesty do aktuálního adresáře.\n" +" SHELLOPTS\tDvojtečkou oddělený seznam zapnutých přepínačů shellu.\n" +" TERM\tNázev druhu současného terminálu.\n" +" TIMEFORMAT\tVýstupní formát časové statistiky zobrazované vyhrazeným\n" +" \t\tslovem „time“.\n" +" auto_resume\tNeprázdná hodnota znamená, že slovo příkazu objevující se\n" +" \t\tna řádce automaticky je nejprve vyhledáno v seznamu\n" +" \t\tprávě pozastavených úloh. Je-li tam nalezeno, daná úloha bude\n" +" \t\tpřepnuta na popředí. Hodnota „exact“ znamená, že slovo příkazu\n" +" \t\tse musí přesně shodovat s příkazem v seznamu pozastavených úloh.\n" +" \t\tHodnota „substring“ znamená, že slovo příkazu se musí shodovat\n" +" \t\ts podřetězcem úlohy. Jakákoliv jiná hodnota znamená, že příkaz\n" +" \t\tmusí být předponou pozastavené úlohy.\n" +" histchars\tZnaky řídící expanzi historie a rychlé nahrazování.\n" +" \t\tPrvní znak je znak nahrazení historie, obvykle „!“. Druhý je\n" +" \t\tznak „rychlého nahrazování“, obvykle „^“. Třetí je znak\n" +" \t\t„komentáře historie“, obvykle „#“.\n" +" HISTIGNORE\tDvojtečkou oddělený seznam vzorů používaný na\n" +" \t\trozliÅ¡ení, které příkazy by měly být uloženy do seznamu\n" +" \t\thistorie.\n" + +#: builtins.c:1794 +msgid "" +"Add directories to stack.\n" +" \n" +" Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" +"Přidá adresáře do zásobníku.\n" +" \n" +" Přidá adresář na vrchol zásobníku adresářů nebo zásobník zrotuje tak,\n" +" že nový vrchol zásobníku se stane současným pracovním adresářem. Bez\n" +" argumentů prohodí dva vrchní adresáře.\n" +" \n" +" Přepínače:\n" +" -n\tPotlačí obvyklou změnu adresáře, když se na zásobník přidávají\n" +" \tadresáře, takže změněn bude pouze zásobník.\n" +" \n" +" Argumenty:\n" +" +N\tZrotuje zásobník tak, že N. adresář (počítáno zleva na seznamu\n" +" \tzobrazovaném pomocí „dirs“, počínaje nulou) se dostane na vrchol.\n" +" \n" +" -N\tZrotuje zásobník tak, že N. adresář (počítáno zprava na seznamu\n" +" \tzobrazovaném pomocí „dirs“, počínaje nulou) se dostane na vrchol.\n" +" \n" +" adresář\n" +" \tPřidá ADRESÁŘ na vrchol zásobníku adresářů a učiní jej novým\n" +" \tsoučasným pracovním adresářem.\n" +" \n" +" Zásobník adresářů si můžete prohlédnout příkazem „dirs“.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud nebyl zadán neplatný argument a změna adresáře\n" +" neselhala." + +#: builtins.c:1828 +msgid "" +"Remove directories from stack.\n" +" \n" +" Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" +"Odebere adresáře ze zásobníku.\n" +" \n" +" Odstraní položky ze zásobníku adresářů. Bez argumentů odstraní adresář\n" +" z vrcholu zásobníku a přepne do nového adresáře na vrchu zásobníku.\n" +" \n" +" Přepínače:\n" +" -n\tPotlačí obvyklou změnu adresáře, když se ze zásobníku odebírají\n" +" \tadresáře, takže změněn bude pouze zásobník.\n" +" \n" +" Argumenty:\n" +" +N\tOdstraní N. položku počítáno zleva na seznamu zobrazovaném\n" +" \tpomocí „dirs“, počínaje nulou. Na příklad: „popd +0“ odstraní\n" +" první adresář, „popd -1“ druhý.\n" +" \n" +" -N\tOdstraní N. položku počítáno zprava na seznamu zobrazovaném\n" +" \tpomocí „dirs“, počínaje nulou. Na příklad: „popd -0“ odstraní\n" +" poslední adresář, „popd -1“ další vedle posledního.\n" +" \n" +" Zásobník adresářů si můžete prohlédnout příkazem „dirs“.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud nebyl zadán neplatný argument nebo neselhala změna\n" +" adresáře." + +#: builtins.c:1858 +msgid "" +"Display directory stack.\n" +" \n" +" Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Zobrazí zásobník adresářů.\n" +" \n" +" Zobrazí seznam právě pamatovaných adresářů. Adresáře si najdou cestu\n" +" na seznam příkazem „pushd“ a procházet seznamem zpět lze příkazem " +"„popd“.\n" +" \n" +" Přepínače:\n" +" -c\tvyprázdní zásobník adresářů tím, že smaže vÅ¡echny jeho prvky\n" +" -l\tnevypíše vlnkou zkrácené verze adresářů, které jsou relativní\n" +" \tvaÅ¡emu domovskému adresáři\n" +" -p\tvypíše zásobník adresářů po jedné položce na řádek\n" +" -v\tvypíše zásobník adresářů po jedné položce na řádek, přičemž\n" +" \tnázvu adresáře předřadí jeho umístění na zásobníku\n" +" \n" +" Argumenty:\n" +" +N\tzobrazí N. položku počítáno zleva na seznamu, který zobrazuje\n" +" \tdirs, když je vyvolán bez přepínačů, počínaje nulou.\n" +" \n" +" -N\tzobrazí N. položku počítáno zprava na seznamu, který zobrazuje\n" +" \tdirs, když je vyvolán bez přepínačů, počínaje nulou. \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud nebyl zadán neplatný přepínač a nevyskytla se chyba." + +#: builtins.c:1887 +msgid "" +"Set and unset shell options.\n" +" \n" +" Change the setting of each shell option OPTNAME. Without any option\n" +" arguments, list all shell options with an indication of whether or not " +"each\n" +" is set.\n" +" \n" +" Options:\n" +" -o\trestrict OPTNAMEs to those defined for use with `set -o'\n" +" -p\tprint each shell option with an indication of its status\n" +" -q\tsuppress output\n" +" -s\tenable (set) each OPTNAME\n" +" -u\tdisable (unset) each OPTNAME\n" +" \n" +" Exit Status:\n" +" Returns success if OPTNAME is enabled; fails if an invalid option is\n" +" given or OPTNAME is disabled." +msgstr "" +"Zapne nebo vypne volby (přepínače) shellu.\n" +" \n" +" Změní nastavení každého přepínače shellu NÁZEV_VOLBY. Bez přepínačových\n" +" argumentů vypíše seznam vÅ¡ech přepínačů shellu s příznakem, zda je, " +"nebo\n" +" není nastaven.\n" +" Přepínače:\n" +" -o\tomezí NÁZVY_VOLEB na ty, které jsou definovány pro použití\n" +" \ts „set -o“\n" +" -p\tvypíše každou volbu shellu s určením jejího stavu\n" +" -q\tpotlačí výstup\n" +" -s\tzapne [set] každý NÁZEV_VOLBY\n" +" -u\tvypne [unset] každý NÁZEV_VOLBY\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, je-li NÁZEV_VOLBY zapnut. Selže, byl-li zadán neplatný\n" +" přepínač nebo je-li NÁZEV_VOLBY vypnut." + +#: builtins.c:1908 +msgid "" +"Formats and prints ARGUMENTS under control of the FORMAT.\n" +" \n" +" Options:\n" +" -v var\tassign the output to shell variable VAR rather than\n" +" \t\tdisplay it on the standard output\n" +" \n" +" FORMAT is a character string which contains three types of objects: " +"plain\n" +" characters, which are simply copied to standard output; character " +"escape\n" +" sequences, which are converted and copied to the standard output; and\n" +" format specifications, each of which causes printing of the next " +"successive\n" +" argument.\n" +" \n" +" In addition to the standard format specifications described in " +"printf(1),\n" +" printf interprets:\n" +" \n" +" %b\texpand backslash escape sequences in the corresponding argument\n" +" %q\tquote the argument in a way that can be reused as shell input\n" +" %(fmt)T output the date-time string resulting from using FMT as a " +"format\n" +" string for strftime(3)\n" +" \n" +" The format is re-used as necessary to consume all of the arguments. If\n" +" there are fewer arguments than the format requires, extra format\n" +" specifications behave as if a zero value or null string, as " +"appropriate,\n" +" had been supplied.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a write or " +"assignment\n" +" error occurs." +msgstr "" +"Naformátuje a vypíše ARGUMENTY podle definice FORMÁTU.\n" +" \n" +" Přepínače:\n" +" -v proměnná\tvýstup umístí do proměnné shellu PROMĚNNÁ namísto\n" +" \t\todeslání na standardní výstup.\n" +" \n" +" FORMÁT je řetězec znaků, který obsahuje tři druhy objektů: obyčejné " +"znaky,\n" +" které jsou prostě zkopírovány na standardní výstup, posloupnosti " +"escapových\n" +" znaků, které jsou zkonvertovány a zkopírovány na standardní výstup a\n" +" formátovací definice, z nichž každá způsobí vytiÅ¡tění dalšího " +"argumentu.\n" +" \n" +" Tento printf interpretuje vedle standardních formátovacích definic\n" +" popsaných v printf(1) též:\n" +" \n" +" %b\texpanduje posloupnosti escapované zpětným lomítkem\n" +" \t\tv odpovídajícím argumentu\n" +" %q\toescapuje argument takovým způsobem, že jej bude možné\n" +" \t\tpoužít jako vstup shellu\n" +" %(FORMÁT)T\tvypíše řetězec data-času tak, jako by to byl výstup\n" +" \t\tfunkce strftime(3) s formátovacím řetězcem FORMÁT\n" +" \n" +" FORMÁT lze znovu použít podle potřeby ke zpracování vÅ¡ech argumentů. Je-" +"li\n" +" zde méně argumentů, než FORMÁT vyžaduje, nadbytečné formátovací znaky\n" +" se budou chovat, jako by nulová hodnota nebo nulový řetězec, jak je " +"třeba,\n" +" byly zadány.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud nebyl zadán neplatný přepínač a nedoÅ¡lo k chybě\n" +" zápisu nebo přiřazení." + +#: builtins.c:1942 +msgid "" +"Specify how arguments are to be completed by Readline.\n" +" \n" +" For each NAME, specify how arguments are to be completed. If no " +"options\n" +" are supplied, existing completion specifications are printed in a way " +"that\n" +" allows them to be reused as input.\n" +" \n" +" Options:\n" +" -p\tprint existing completion specifications in a reusable format\n" +" -r\tremove a completion specification for each NAME, or, if no\n" +" \tNAMEs are supplied, all completion specifications\n" +" -D\tapply the completions and actions as the default for commands\n" +" \twithout any specific completion defined\n" +" -E\tapply the completions and actions to \"empty\" commands --\n" +" \tcompletion attempted on a blank line\n" +" \n" +" When completion is attempted, the actions are applied in the order the\n" +" uppercase-letter options are listed above. The -D option takes\n" +" precedence over -E.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Určuje, jak budou argumenty doplňovány pomocí knihovny Readline.\n" +" \n" +" Pro každý NÁZEV udává, jak se budou doplňovat argumenty. Nejsou-li\n" +" zadány žádné přepínače, budou vypsány existující pravidla doplňování\n" +" v podobě vhodné pro jejich znovu užití jako vstup.\n" +" \n" +" Přepínače:\n" +" -p\tvypíše existující pravidla doplňování v znovu použitelném tvaru\n" +" -r\todstraní pro každý NÁZEV doplňovací pravidlo, nebo není-li zadán\n" +" \tžádný NÁZEV, zruší vÅ¡echna pravidla\n" +" -D\tpoužije pravidla doplňování a akce jako implicitní pro příkazy,\n" +" \tkteré nemají žádné určité pravidlo doplňování definováno\n" +" -E\tpoužije pravidla doplňování á akce na „prázdné“ příkazy –\n" +" \tpravidla doplňování se uplatní na prázdný řádek\n" +" \n" +" Použije-li se doplňování, akce se uplatní v pořadí, v jakém jsou " +"vypsány\n" +" přepínače psané velkými písmeny výše. Přepínač -D má přednost před\n" +" přepínačem -E.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud nebyl zadán neplatný přepínač a nevyskytla se chyba." + +#: builtins.c:1970 +msgid "" +"Display possible completions depending on the options.\n" +" \n" +" Intended to be used from within a shell function generating possible\n" +" completions. If the optional WORD argument is supplied, matches " +"against\n" +" WORD are generated.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Zobrazí možná doplnění v závislosti na přepínačích.\n" +" \n" +" Je zamýšleno pro použití uvnitř shellových funkcí generujících možná\n" +" doplnění. Je-li poskytnut volitelný argument SLOVO, budou vygenerovány\n" +" shody se SLOVEM.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud nebyl zadán neplatný přepínač a nevyskytla se chyba." + +#: builtins.c:1985 +msgid "" +"Modify or display completion options.\n" +" \n" +" Modify the completion options for each NAME, or, if no NAMEs are " +"supplied,\n" +" the completion currently being executed. If no OPTIONs are given, " +"print\n" +" the completion options for each NAME or the current completion " +"specification.\n" +" \n" +" Options:\n" +" \t-o option\tSet completion option OPTION for each NAME\n" +" \t-D\t\tChange options for the \"default\" command completion\n" +" \t-E\t\tChange options for the \"empty\" command completion\n" +" \n" +" Using `+o' instead of `-o' turns off the specified option.\n" +" \n" +" Arguments:\n" +" \n" +" Each NAME refers to a command for which a completion specification must\n" +" have previously been defined using the `complete' builtin. If no NAMEs\n" +" are supplied, compopt must be called by a function currently generating\n" +" completions, and the options for that currently-executing completion\n" +" generator are modified.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or NAME does not\n" +" have a completion specification defined." +msgstr "" +"Upraví nebo zobrazí možnosti doplňování.\n" +" \n" +" Pozmění možnosti doplňování každého NÁZVU, nebo, není-li zadán žádný\n" +" NÁZEV, právě prováděného doplňování. Nejsou-li zadány žádné MOŽNOSTI,\n" +" vypíše možnosti doplňování každého NÁZVU nebo definic právě prováděného\n" +" doplňování.\n" +" \n" +" Přepínače:\n" +" \t-o možnost\tNastaví možnost doplňování MOŽNOST každému NÁZVU\n" +" \t-D\t\tZmění možnosti doplňování „implicitnímu“ příkazu\n" +" \t-E\t\tZmění možnosti doplňování „prázdnému“ příkazu\n" +" \n" +" Pomocí „+o“ namísto „-o“ zadanou možnost vypnete.\n" +" \n" +" Argumenty:\n" +" Každý NÁZEV odkazuje na příkaz, pro který musí být předem definováno\n" +" pravidlo (definice) doplňování pomocí vestavěného příkazu „complete“.\n" +" Nejsou-li zadány žádné NÁZVY, musí být compopt volán funkcí, která " +"právě\n" +" generuje doplňování. Změněny pak budou možnosti tohoto právě " +"prováděného\n" +" generátoru doplňování.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud nebyl zadán neplatný přepínač a NÁZEV měl " +"definováno\n" +" pravidlo doplňování." + +#: builtins.c:2015 +msgid "" +"Read lines from the standard input into an indexed array variable.\n" +" \n" +" Read lines from the standard input into the indexed array variable " +"ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable " +"MAPFILE\n" +" is the default ARRAY.\n" +" \n" +" Options:\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are " +"copied.\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default " +"index is 0.\n" +" -s count \tDiscard the first COUNT lines read.\n" +" -t\t\tRemove a trailing newline from each line read.\n" +" -u fd\t\tRead lines from file descriptor FD instead of the standard " +"input.\n" +" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read.\n" +" -c quantum\tSpecify the number of lines read between each call to " +"CALLBACK.\n" +" \n" +" Arguments:\n" +" ARRAY\t\tArray variable name to use for file data.\n" +" \n" +" If -C is supplied without -c, the default quantum is 5000. When\n" +" CALLBACK is evaluated, it is supplied the index of the next array\n" +" element to be assigned and the line to be assigned to that element\n" +" as additional arguments.\n" +" \n" +" If not supplied with an explicit origin, mapfile will clear ARRAY " +"before\n" +" assigning to it.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or ARRAY is readonly " +"or\n" +" not an indexed array." +msgstr "" +"Načte řádky ze standardního vstupu do proměnné typu indexované pole.\n" +" \n" +" Načte řádky ze standardního vstupu nebo z deskriptoru souboru FD, byl-" +"li\n" +" zadán přepínač -u, do proměnné POLE, která je typu indexované pole.\n" +" Implicitním POLEM je proměnná MAPFILE.\n" +" \n" +" Přepínače:\n" +" -n počet\tZkopíruje nejvýše POČET řádků. Je-li POČET 0,\n" +" \t\tzkopíruje vÅ¡echny řádky.\n" +" -O počátek\tPřiřazování do POLE začne na indexu POČÁTEK.\n" +" \t\tImplicitní index je 0.\n" +" -s počet\tZahodí prvních POČET načtených řádků.\n" +" -t\t\tOdstraní znak konce řádku z každého načteného řádku.\n" +" -u fd\t\tŘádky čte z deskriptoru souboru FD namísto ze\n" +" \t\tstandardního vstupu.\n" +" -C volání\tVyhodnotí VOLÁNÍ pokaždé, když je načteno MNOŽSTVÍ\n" +" \t\třádků.\n" +" -c množství\tUdává počet řádků, které je třeba přečíst, mezi\n" +" \t\tkaždým zavoláním VOLÁNÍ.\n" +" \n" +" Argumenty:\n" +" POLE\t\tNázev proměnné typu pole, do které budou přiřazena data.\n" +" \n" +" Je-li uvedeno -C bez -c, implicitní množství bude 5000. Vyhodnocovanému\n" +" VOLÁNÍ budou jako dodatečné argumenty předány index prvku pole, do\n" +" kterého se má vzápětí přiřazovat, a řádek, který má být přiřazen do\n" +" tohoto prvku.\n" +" \n" +" Nebude-li explicitně udán počátek, mapfile vyprázdní POLE před tím,\n" +" než do něj začne přiřazovat.\n" +" \n" +" Návratový kód:\n" +" Vrátí úspěch, pokud nebyl zadán neplatný přepínač, POLE nebylo jen pro\n" +" čtení a bylo indexovaným polem." + +#: builtins.c:2049 +msgid "" +"Read lines from a file into an array variable.\n" +" \n" +" A synonym for `mapfile'." +msgstr "" +"Načte řádky ze souboru do proměnné typu pole.\n" +" \n" +" Synonymum pro „mapfile“." + +#~ msgid "Copyright (C) 2009 Free Software Foundation, Inc.\n" +#~ msgstr "Copyright © 2009 Free Software Foundation, Inc.\n" + +#~ msgid "" +#~ "License GPLv2+: GNU GPL version 2 or later \n" +#~ msgstr "" +#~ "Licence GPLv2+: GNU GPL verze 2 nebo novější \n" + +#~ msgid "" +#~ ". With EXPR, returns\n" +#~ " " +#~ msgstr "" +#~ ". S VÝRAZEM vrátí\n" +#~ " " + +#~ msgid "" +#~ "; this extra information can be used to\n" +#~ " provide a stack trace.\n" +#~ " \n" +#~ " The value of EXPR indicates how many call frames to go back before " +#~ "the\n" +#~ " current one; the top frame is frame 0." +#~ msgstr "" +#~ "; tato dodatečná informace může být\n" +#~ " použita jako výpis zásobníku volání.\n" +#~ " \n" +#~ " Hodnota VÝRAZU určuje, kolik rámců volání jít zpět před současný,\n" +#~ " vrcholový rámec je rámce 0." + +#~ msgid "xrealloc: cannot reallocate %lu bytes (%lu bytes allocated)" +#~ msgstr "xrealloc: nelze přealokovat %'lu bajtů (%'lu bajtů alokováno)" + +#~ msgid "xrealloc: cannot allocate %lu bytes" +#~ msgstr "xrealloc: nelze alokovat %'lu bajtů" + +#~ msgid "xrealloc: %s:%d: cannot reallocate %lu bytes (%lu bytes allocated)" +#~ msgstr "" +#~ "xrealloc: %s:%d: nelze přealokovat %'lu bajtů (%'lu bajtů alokováno)" + +#~ msgid " " +#~ msgstr " " + +#~ msgid "Without EXPR, returns returns \"$line $filename\". With EXPR," +#~ msgstr "Bez VÝRAZU vrací „$line $filename“. S VÝRAZEM " + +#~ msgid "returns \"$line $subroutine $filename\"; this extra information" +#~ msgstr "vrací „$line $subroutine $filename“. Tyto údaje" + +#~ msgid "can be used used to provide a stack trace." +#~ msgstr "lze využít při výpisu zásobníku volání." + +#~ msgid "" +#~ "The value of EXPR indicates how many call frames to go back before the" +#~ msgstr "Hodnota VÝRAZ značí, kolik rámců volání se má jít zpět před" + +#~ msgid "current one; the top frame is frame 0." +#~ msgstr "současný rámec, vrcholový rámec má číslo 0." + +#~ msgid "%s: invalid number" +#~ msgstr "%s: chybné číslo" + +#~ msgid "Shell commands matching keywords `" +#~ msgstr "Příkazy shellu shodující se s klíčovými slovy „" + +#~ msgid "Display the list of currently remembered directories. Directories" +#~ msgstr "Zobrazí seznam právě zapamatovaných adresářů. Adresáře" + +#~ msgid "find their way onto the list with the `pushd' command; you can get" +#~ msgstr "se na seznam umisÅ¥ují příkazem „pushd“, předchozí stav seznamu lze" + +#~ msgid "back up through the list with the `popd' command." +#~ msgstr "vrátit příkazem „popd“." + +#~ msgid "" +#~ "The -l flag specifies that `dirs' should not print shorthand versions" +#~ msgstr "Příznak -l značí, že „dirs“ nemá vypisovat zkrácené verze adresářů," + +#~ msgid "" +#~ "of directories which are relative to your home directory. This means" +#~ msgstr "které leží pod vaším domovským adresářem. To znamená, že „~/bin“" + +#~ msgid "that `~/bin' might be displayed as `/homes/bfox/bin'. The -v flag" +#~ msgstr "smí být zobrazen jako „/homes/bfox/bin“. Příznak -v způsobí, že" + +#~ msgid "causes `dirs' to print the directory stack with one entry per line," +#~ msgstr "" +#~ "„dirs“ vypíše zásobník adresářů záznam po záznamu na samostatné řádky" + +#~ msgid "" +#~ "prepending the directory name with its position in the stack. The -p" +#~ msgstr "a před název adresáře uvede jeho pořadí v zásobníku. Příznak -p" + +#~ msgid "flag does the same thing, but the stack position is not prepended." +#~ msgstr "dělá to samé, ale bez informace o umístění na zásobníku." + +#~ msgid "" +#~ "The -c flag clears the directory stack by deleting all of the elements." +#~ msgstr "Příznak -c vyprázdní zásobník smazáním vÅ¡em prvků." + +#~ msgid "" +#~ "+N displays the Nth entry counting from the left of the list shown by" +#~ msgstr "+N zobrazí N. položku počítáno zleva na seznamu, který by ukázal" + +#~ msgid " dirs when invoked without options, starting with zero." +#~ msgstr " příkaz dirs bez jakýchkoliv přepínačů, počítáno od nuly." + +#~ msgid "" +#~ "-N displays the Nth entry counting from the right of the list shown by" +#~ msgstr "-N zobrazí N. položku počítáno zprava na seznamu, který by ukázal" + +#~ msgid "Adds a directory to the top of the directory stack, or rotates" +#~ msgstr "" +#~ "Přidá adresář na vrchol zásobníku adresářů, nebo rotuje zásobník tak," + +#~ msgid "the stack, making the new top of the stack the current working" +#~ msgstr "že nový vrchol zásobníku se stane pracovním adresářem." + +#~ msgid "directory. With no arguments, exchanges the top two directories." +#~ msgstr "Bez argumentů prohodí horní dva adresáře." + +#~ msgid "+N Rotates the stack so that the Nth directory (counting" +#~ msgstr "+N Zrotuje zásobník tak, že N. adresář (počítáno" + +#~ msgid " from the left of the list shown by `dirs', starting with" +#~ msgstr " zleva seznamu, který by ukázal „dirs“, počínaje od" + +#~ msgid " zero) is at the top." +#~ msgstr " nuly) se dostane na vrchol." + +#~ msgid "-N Rotates the stack so that the Nth directory (counting" +#~ msgstr "-N Zrotuje zásobník tak, že N. adresář (počítáno" + +#~ msgid " from the right of the list shown by `dirs', starting with" +#~ msgstr " zprava seznamu, který by ukázal „dirs“, počínaje od" + +#~ msgid "-n suppress the normal change of directory when adding directories" +#~ msgstr "" +#~ "-n potlačí obvyklou změnu pracovního adresáře při přidávání adresářů" + +#~ msgid " to the stack, so only the stack is manipulated." +#~ msgstr " na zásobník, takže se změní jen obsah zásobníku." + +#~ msgid "dir adds DIR to the directory stack at the top, making it the" +#~ msgstr "adr přidá ADR na vrchol zásobníku adresářů a učiní jej" + +#~ msgid " new current working directory." +#~ msgstr " novým pracovním adresářem." + +#~ msgid "You can see the directory stack with the `dirs' command." +#~ msgstr "Zásobník adresářů si lze prohlédnout příkazem „dirs“." + +#~ msgid "Removes entries from the directory stack. With no arguments," +#~ msgstr "Odstraní položky ze zásobníku adresářů. Bez argumentů" + +#~ msgid "removes the top directory from the stack, and cd's to the new" +#~ msgstr "odstraní adresář z vrcholu zásobníku a přepne se do nového" + +#~ msgid "top directory." +#~ msgstr "vrcholového adresáře." + +#~ msgid "+N removes the Nth entry counting from the left of the list" +#~ msgstr "+N odstraní N. položku počítáno zleva na seznamu," + +#~ msgid " shown by `dirs', starting with zero. For example: `popd +0'" +#~ msgstr " který by ukázal „dirs“, počínaje nulou. Například „popd +0“" + +#~ msgid " removes the first directory, `popd +1' the second." +#~ msgstr " odstraní první adresář, „popd +1“ druhý." + +#~ msgid "-N removes the Nth entry counting from the right of the list" +#~ msgstr "-N odstraní N. položku počítáno zprava na seznamu," + +#~ msgid " shown by `dirs', starting with zero. For example: `popd -0'" +#~ msgstr " který by ukázal „dirs“, počínaje nulou. Například: „popd -0“" + +#~ msgid " removes the last directory, `popd -1' the next to last." +#~ msgstr " odstraní poslední adresář, “popd -1“ předposlední." + +#~ msgid "" +#~ "-n suppress the normal change of directory when removing directories" +#~ msgstr "" +#~ "-n potlačí obvyklou změnu pracovního adresáře při odebírání adresářů" + +#~ msgid " from the stack, so only the stack is manipulated." +#~ msgstr " ze zásobníku, takže pouze zásobník dozná změny." + +#~ msgid "allocated" +#~ msgstr "alokováno" + +#~ msgid "freed" +#~ msgstr "uvolněno" + +#~ msgid "requesting resize" +#~ msgstr "požadující velikost" + +#~ msgid "just resized" +#~ msgstr "právě změněna velikost" + +#~ msgid "bug: unknown operation" +#~ msgstr "chyba: neznámá operace" + +#~ msgid "malloc: watch alert: %p %s " +#~ msgstr "malloc: výstraha sledování: %p %s" + +#~ msgid "" +#~ "Exit from within a FOR, WHILE or UNTIL loop. If N is specified,\n" +#~ " break N levels." +#~ msgstr "" +#~ "Ukončí smyčku FOR, WHILE nebo UNTIL. Je-li zadáno N, ukončí N úrovní." + +#~ msgid "" +#~ "Run a shell builtin. This is useful when you wish to rename a\n" +#~ " shell builtin to be a function, but need the functionality of the\n" +#~ " builtin within the function itself." +#~ msgstr "" +#~ "Spustí vestavěný příkaz shellu. Toto se hodí, přejete-li si přejmenovat\n" +#~ " vestavěný příkaz na funkci, avÅ¡ak funkcionalitu vestavěného příkazu\n" +#~ " potřebujete v téže funkci." + +#~ msgid "" +#~ "Print the current working directory. With the -P option, pwd prints\n" +#~ " the physical directory, without any symbolic links; the -L option\n" +#~ " makes pwd follow symbolic links." +#~ msgstr "" +#~ "Vypíše současný pracovní adresář. S přepínačem -P vypíše pwd fyzický\n" +#~ " adresář prostý vÅ¡ech symbolický odkazů; přepínač -L přinutí pwd\n" +#~ " následovat symbolické odkazy." + +#~ msgid "Return a successful result." +#~ msgstr "Vrací výsledek úspěchu." + +#~ msgid "" +#~ "Runs COMMAND with ARGS ignoring shell functions. If you have a shell\n" +#~ " function called `ls', and you wish to call the command `ls', you can\n" +#~ " say \"command ls\". If the -p option is given, a default value is " +#~ "used\n" +#~ " for PATH that is guaranteed to find all of the standard utilities. " +#~ "If\n" +#~ " the -V or -v option is given, a string is printed describing " +#~ "COMMAND.\n" +#~ " The -V option produces a more verbose description." +#~ msgstr "" +#~ "Spustí PŘÍKAZ s ARGUMENTY ignoruje funkce shellu. Máte-li shellovou\n" +#~ " funkci pojmenovanou „ls“, a chcete-li zavolat příkaz „ls“, použijte\n" +#~ " „command ls“. Je-li zadán přepínač -p, bude pro PATH použita " +#~ "implicitní\n" +#~ " hodnota, která zaručuje, že budou nalezeny vÅ¡echny standardní " +#~ "nástroje.\n" +#~ " Je-li zadán přepínač -V nebo -v, bude vytiÅ¡těn řetězec popisující " +#~ "PŘÍKAZ.\n" +#~ " Přepínač -V produkuje podrobnější popis." + +#~ msgid "" +#~ "Declare variables and/or give them attributes. If no NAMEs are\n" +#~ " given, then display the values of variables instead. The -p option\n" +#~ " will display the attributes and values of each NAME.\n" +#~ " \n" +#~ " The flags are:\n" +#~ " \n" +#~ " -a\tto make NAMEs arrays (if supported)\n" +#~ " -f\tto select from among function names only\n" +#~ " -F\tto display function names (and line number and source file name " +#~ "if\n" +#~ " \tdebugging) without definitions\n" +#~ " -i\tto make NAMEs have the `integer' attribute\n" +#~ " -r\tto make NAMEs readonly\n" +#~ " -t\tto make NAMEs have the `trace' attribute\n" +#~ " -x\tto make NAMEs export\n" +#~ " \n" +#~ " Variables with the integer attribute have arithmetic evaluation (see\n" +#~ " `let') done when the variable is assigned to.\n" +#~ " \n" +#~ " When displaying values of variables, -f displays a function's name\n" +#~ " and definition. The -F option restricts the display to function\n" +#~ " name only.\n" +#~ " \n" +#~ " Using `+' instead of `-' turns off the given attribute instead. " +#~ "When\n" +#~ " used in a function, makes NAMEs local, as with the `local' command." +#~ msgstr "" +#~ "Deklaruje proměnné a/nebo jim nastaví atributy. Nejsou-li zadány NÁZVY,\n" +#~ " tak místo toho zobrazí hodnoty proměnných. Přepínač -p zobrazí " +#~ "atributy\n" +#~ " a hodnoty pro každý NÁZEV.\n" +#~ " \n" +#~ " Příznaky jsou:\n" +#~ " \n" +#~ " -a\tučiní NÁZVY poli (je-li podporováno)\n" +#~ " -f\tvybírá pouze mezi názvy funkcí\n" +#~ " -F\tzobrazí názvy funkcí (a číslo řádku a název zdrojového " +#~ "souboru,\n" +#~ " \tje-li zapnuto ladění) bez definic\n" +#~ " -i\tpřiřadí NÁZVÅ®M atribut „integer“ (číslo)\n" +#~ " -r\tučiní NÁZVY jen pro čtení\n" +#~ " -t\tpřiřadí NÁZVÅ®M atribut „trace“ (sledování)\n" +#~ " -x\tvyexportuje NÁZVY\n" +#~ " \n" +#~ " Proměnné s atributem integer jsou aritmeticky vyhodnoceny (vizte " +#~ "„let“),\n" +#~ " když je do proměnné přiřazováno.\n" +#~ " \n" +#~ " Při zobrazování hodnot proměnných -f zobrazí názvy a definice " +#~ "funkcí.\n" +#~ " Přepínač -F omezí výpis jen na názvy funkcí.\n" +#~ " \n" +#~ " Pomocí „+“ namísto „-“ daný atribut odeberete. Je-li použito uvnitř\n" +#~ " funkce, učiní NÁZVY lokální stejně jako příkaz „local“." + +#~ msgid "Obsolete. See `declare'." +#~ msgstr "Zastaralé. Vizte „declare“." + +#~ msgid "" +#~ "Create a local variable called NAME, and give it VALUE. LOCAL\n" +#~ " can only be used within a function; it makes the variable NAME\n" +#~ " have a visible scope restricted to that function and its children." +#~ msgstr "" +#~ "Vytvoří lokální proměnnou pojmenovanou NÁZEV a přiřadí jí HODNOTU.\n" +#~ " LOCAL smí být použito jen uvnitř funkcí. Učiní proměnnou NÁZEV " +#~ "viditelnou\n" +#~ " jen v dané funkci a jejích potomcích." + +#~ msgid "" +#~ "Output the ARGs. If -n is specified, the trailing newline is suppressed." +#~ msgstr "" +#~ "Vypíše ARGUMENTY. Je-li zadáni -n, závěrečný konec řádku bude potlačen." + +#~ msgid "" +#~ "Enable and disable builtin shell commands. This allows\n" +#~ " you to use a disk command which has the same name as a shell\n" +#~ " builtin without specifying a full pathname. If -n is used, the\n" +#~ " NAMEs become disabled; otherwise NAMEs are enabled. For example,\n" +#~ " to use the `test' found in $PATH instead of the shell builtin\n" +#~ " version, type `enable -n test'. On systems supporting dynamic\n" +#~ " loading, the -f option may be used to load new builtins from the\n" +#~ " shared object FILENAME. The -d option will delete a builtin\n" +#~ " previously loaded with -f. If no non-option names are given, or\n" +#~ " the -p option is supplied, a list of builtins is printed. The\n" +#~ " -a option means to print every builtin with an indication of whether\n" +#~ " or not it is enabled. The -s option restricts the output to the " +#~ "POSIX.2\n" +#~ " `special' builtins. The -n option displays a list of all disabled " +#~ "builtins." +#~ msgstr "" +#~ "Povolí nebo zakáže vestavěný příkaz shellu. To vám umožňuje použít\n" +#~ " příkaz z disku, který má stejné jméno jako vestavěný příkaz shellu, " +#~ "aniž\n" +#~ " byste museli zadávat celou cestu. Je-li použito -n, NÁZVY se stanou\n" +#~ " zakázanými, jinak budou povoleny. Například „test“ z PATH namísto " +#~ "verze\n" +#~ " vestavěné do shellu lze používat tak, že napíšete „enable -n test“. " +#~ "Na\n" +#~ " systémech podporujících dynamické zavádění přepínač -f může být " +#~ "použit\n" +#~ " pro zavedení nových vestavěných příkazů ze sdíleného objektu " +#~ "NÁZEV_SOUBORU.\n" +#~ " Přepínač -d odstraní vestavěný příkaz zavedený přes -f. Není-li " +#~ "zadán\n" +#~ " žádný přepínač nebo je-li zadán přepínač -p, bude vypsán seznam " +#~ "vestavěných\n" +#~ " příkazů. Přepínač -a znamená, že budou vypsány vÅ¡echny vestavěné " +#~ "příkazy a\n" +#~ " u každého bude vyznačeno, zda je povolen nebo zakázán. Přepínač -s " +#~ "omezí\n" +#~ " výpis na příkazy uvedené v POSIX.2. Přepínač -n zobrazí seznam vÅ¡ech\n" +#~ " zakázaných vestavěných příkazů." + +#~ msgid "" +#~ "Read ARGs as input to the shell and execute the resulting command(s)." +#~ msgstr "Načte ARGUMENTY jako vstup shellu a výsledný příkaz(y) provede." + +#~ msgid "" +#~ "Exec FILE, replacing this shell with the specified program.\n" +#~ " If FILE is not specified, the redirections take effect in this\n" +#~ " shell. If the first argument is `-l', then place a dash in the\n" +#~ " zeroth arg passed to FILE, as login does. If the `-c' option\n" +#~ " is supplied, FILE is executed with a null environment. The `-a'\n" +#~ " option means to make set argv[0] of the executed process to NAME.\n" +#~ " If the file cannot be executed and the shell is not interactive,\n" +#~ " then the shell exits, unless the shell option `execfail' is set." +#~ msgstr "" +#~ "Provede SOUBOR, přičemž nahradí tento shell zadaným programem.\n" +#~ " Není-li SOUBOR zadán, přesměrování zapůsobí v tomto shellu. Je-li " +#~ "prvním\n" +#~ " argumentem „-l“, bude do nultého argumentu SOUBORU umístěna pomlčka " +#~ "tak,\n" +#~ " jak to dělá login. Je-li zadán přepínač „-c“, bude SOUBOR spuÅ¡těn\n" +#~ " s prázdným prostředím. Přepínač „-a“ znamená, že argv[0] prováděného\n" +#~ " procesu bude nastaven na NÁZEV. Pokud soubor nemůže být proveden a " +#~ "shell\n" +#~ " není interaktivní, pak shell bude ukončen, pokud přepínač shellu\n" +#~ " „execfail“ není nastaven." + +#~ msgid "Logout of a login shell." +#~ msgstr "Odhlásí z přihlaÅ¡ovacího (login) shellu." + +#~ msgid "" +#~ "For each NAME, the full pathname of the command is determined and\n" +#~ " remembered. If the -p option is supplied, PATHNAME is used as the\n" +#~ " full pathname of NAME, and no path search is performed. The -r\n" +#~ " option causes the shell to forget all remembered locations. The -d\n" +#~ " option causes the shell to forget the remembered location of each " +#~ "NAME.\n" +#~ " If the -t option is supplied the full pathname to which each NAME\n" +#~ " corresponds is printed. If multiple NAME arguments are supplied " +#~ "with\n" +#~ " -t, the NAME is printed before the hashed full pathname. The -l " +#~ "option\n" +#~ " causes output to be displayed in a format that may be reused as " +#~ "input.\n" +#~ " If no arguments are given, information about remembered commands is " +#~ "displayed." +#~ msgstr "" +#~ "Pro každý NÁZEV je určena plná cesta k příkazu a je zapamatována.\n" +#~ " Za použití přepínače -p se vezme NÁZEV_CESTY za plnou cestu k NÁZVU " +#~ "a\n" +#~ " žádné vyhledávání cesty se nekoná. Přepínač -r způsobí, že shell " +#~ "zapomene\n" +#~ " vÅ¡echny zapamatovaná umístění. Přepínač -d způsobí, že shell " +#~ "zapomene\n" +#~ " zapamatovaná umístění každého NÁZVU. Je-li zadán přepínač -t, bude " +#~ "vypsána\n" +#~ " plná cesta ke každému NÁZVU. Je-li s -t zadáno více NÁZVÅ®, NÁZEV " +#~ "bude\n" +#~ " vypsán před uloženou celou cestou. Přepínač -l vytvoří takový " +#~ "výstup,\n" +#~ " který lze opět použít jako vstup. Nejsou-li zadány žádné argumenty,\n" +#~ " budou vypsány informace o zapamatovaných příkazech." + +#~ msgid "" +#~ "Display helpful information about builtin commands. If PATTERN is\n" +#~ " specified, gives detailed help on all commands matching PATTERN,\n" +#~ " otherwise a list of the builtins is printed. The -s option\n" +#~ " restricts the output for each builtin command matching PATTERN to\n" +#~ " a short usage synopsis." +#~ msgstr "" +#~ "Zobrazí užitečné informace o vestavěných příkazech. Je-li zadán VZOREK,\n" +#~ " vrátí podrobnou nápovědu ke vÅ¡em příkazům odpovídajícím VZORKU, jinak " +#~ "je\n" +#~ " vytiÅ¡těn seznam vestavěných příkazů. Přepínač -s omezí výstup " +#~ "o každém\n" +#~ " vestavěném příkazu odpovídajícího VZORKU na stručný popis použití." + +#~ msgid "" +#~ "By default, removes each JOBSPEC argument from the table of active jobs.\n" +#~ " If the -h option is given, the job is not removed from the table, but " +#~ "is\n" +#~ " marked so that SIGHUP is not sent to the job if the shell receives a\n" +#~ " SIGHUP. The -a option, when JOBSPEC is not supplied, means to remove " +#~ "all\n" +#~ " jobs from the job table; the -r option means to remove only running " +#~ "jobs." +#~ msgstr "" +#~ "Implicitně odstraní každý argument ÚLOHA z tabulky aktivních úloh. Je-li\n" +#~ " zadán přepínač -h, úloha není odstraněna z tabulky, ale je označena " +#~ "tak.\n" +#~ " že úloze nebude zaslán SIGHUP, když shell obdrží SIGHUP. Přepínač -" +#~ "a,\n" +#~ " pokud není uvedena ÚLOHA, znamená, že vÅ¡echny úlohy budou odstraněny\n" +#~ " z tabulky úloh. Přepínač -r znamená, že pouze běžící úlohy budou\n" +#~ " odstraněny." + +#~ msgid "" +#~ "Causes a function to exit with the return value specified by N. If N\n" +#~ " is omitted, the return status is that of the last command." +#~ msgstr "" +#~ "Způsobí ukončení funkce s návratovou hodnotou uvedenou v N. Je-li\n" +#~ " N vynecháno, návratový kód je roven poslednímu příkazu." + +#~ msgid "" +#~ "For each NAME, remove the corresponding variable or function. Given\n" +#~ " the `-v', unset will only act on variables. Given the `-f' flag,\n" +#~ " unset will only act on functions. With neither flag, unset first\n" +#~ " tries to unset a variable, and if that fails, then tries to unset a\n" +#~ " function. Some variables cannot be unset; also see readonly." +#~ msgstr "" +#~ "Pro každé JMÉNO odstraní odpovídající proměnnou nebo funkci.\n" +#~ " Spolu s „-v“ bude unset fungovat jen na proměnné. S příznakem „-f“ " +#~ "bude\n" +#~ " unset fungovat jen na funkce. Bez těchto dvou příznaků unset nejprve " +#~ "zkusí\n" +#~ " zruÅ¡it proměnnou a pokud toto selže, tak zkusí zruÅ¡it funkci. " +#~ "Některé\n" +#~ " proměnné nelze odstranit. Taktéž vizte příkaz „readonly“." + +#~ msgid "" +#~ "NAMEs are marked for automatic export to the environment of\n" +#~ " subsequently executed commands. If the -f option is given,\n" +#~ " the NAMEs refer to functions. If no NAMEs are given, or if `-p'\n" +#~ " is given, a list of all names that are exported in this shell is\n" +#~ " printed. An argument of `-n' says to remove the export property\n" +#~ " from subsequent NAMEs. An argument of `--' disables further option\n" +#~ " processing." +#~ msgstr "" +#~ "NÁZVY jsou označeny pro automatické exportování do prostředí následně\n" +#~ " prováděných příkazů. Je-li zadán přepínač -f, NÁZVY se vztahují " +#~ "k funkcím.\n" +#~ " Nejsou-li zadány žádné NÁZVY nebo je-li zadáno „-p“, bude vytiÅ¡těn " +#~ "seznam\n" +#~ " vÅ¡ech názvů, které jsou v tomto shellu exportovány. Argument „-n“ " +#~ "nařizuje\n" +#~ " odstranit vlastnost exportovat z následujících NÁZVÅ®. Argument „--“\n" +#~ " zakazuje zpracování dalších přepínačů." + +#~ msgid "" +#~ "The given NAMEs are marked readonly and the values of these NAMEs may\n" +#~ " not be changed by subsequent assignment. If the -f option is given,\n" +#~ " then functions corresponding to the NAMEs are so marked. If no\n" +#~ " arguments are given, or if `-p' is given, a list of all readonly " +#~ "names\n" +#~ " is printed. The `-a' option means to treat each NAME as\n" +#~ " an array variable. An argument of `--' disables further option\n" +#~ " processing." +#~ msgstr "" +#~ "Zadané NÁZVY budou označeny jako jen pro čtení a hodnoty těchto NÁZVÅ®\n" +#~ " nebude možné změnit následným přiřazením. Je-li zadán přepínač -f, " +#~ "pak\n" +#~ " funkce těchto NÁZVÅ® budou takto označeny. Nejsou-li zadány žádné " +#~ "argumenty\n" +#~ " nebo je-li zadáno „-p“, bude vytiÅ¡těn seznam vÅ¡ech jmen jen pro " +#~ "čtení.\n" +#~ " Přepínač „-a“ znamená, že s každým NÁZVEM bude zacházeno jako " +#~ "s proměnnou\n" +#~ " typu pole. Argument „--“ zakáže zpracování dalších přepínačů." + +#~ msgid "" +#~ "The positional parameters from $N+1 ... are renamed to $1 ... If N is\n" +#~ " not given, it is assumed to be 1." +#~ msgstr "" +#~ "Poziční parametry budou přejmenovány z $N+1 na $1 atd. Není-li N zadáno,\n" +#~ " předpokládá se 1." + +#~ msgid "" +#~ "Suspend the execution of this shell until it receives a SIGCONT\n" +#~ " signal. The `-f' if specified says not to complain about this\n" +#~ " being a login shell if it is; just suspend anyway." +#~ msgstr "" +#~ "Pozastaví provádění tohoto shellu do doby, něž bude obdržen signál\n" +#~ " SIGCONT. „-f“, je-li zadán, potlačí stížnost na to, že se jedná\n" +#~ " o přihlaÅ¡ovací shell (pokud tomu tak je), a prostě pozastaví činnost." + +#~ msgid "" +#~ "Print the accumulated user and system times for processes run from\n" +#~ " the shell." +#~ msgstr "" +#~ "Vypíše celkovou dobu procesu spuÅ¡těného z shellu, kterou strávil\n" +#~ " v uživatelském a jaderném (system) prostoru." + +#~ msgid "" +#~ "For each NAME, indicate how it would be interpreted if used as a\n" +#~ " command name.\n" +#~ " \n" +#~ " If the -t option is used, `type' outputs a single word which is one " +#~ "of\n" +#~ " `alias', `keyword', `function', `builtin', `file' or `', if NAME is " +#~ "an\n" +#~ " alias, shell reserved word, shell function, shell builtin, disk " +#~ "file,\n" +#~ " or unfound, respectively.\n" +#~ " \n" +#~ " If the -p flag is used, `type' either returns the name of the disk\n" +#~ " file that would be executed, or nothing if `type -t NAME' would not\n" +#~ " return `file'.\n" +#~ " \n" +#~ " If the -a flag is used, `type' displays all of the places that " +#~ "contain\n" +#~ " an executable named `file'. This includes aliases, builtins, and\n" +#~ " functions, if and only if the -p flag is not also used.\n" +#~ " \n" +#~ " The -f flag suppresses shell function lookup.\n" +#~ " \n" +#~ " The -P flag forces a PATH search for each NAME, even if it is an " +#~ "alias,\n" +#~ " builtin, or function, and returns the name of the disk file that " +#~ "would\n" +#~ " be executed." +#~ msgstr "" +#~ "O každém NÁZVU řekne, jak by byl interpretován, kdyby byl použit jako\n" +#~ " název příkazu.\n" +#~ " \n" +#~ " Je-li použit přepínač -t, „type“ vypíše jedno slovo z těchto: " +#~ "„alias“,\n" +#~ " „keyword“, „function“, „builtin“, „file“ nebo „“, je-li NÁZEV alias,\n" +#~ " klíčové slovo shellu, shellová funkce, vestavěný příkaz shellu, " +#~ "soubor\n" +#~ " na disku nebo nenalezený soubor.\n" +#~ " \n" +#~ " Je-li použit přepínač -p, „type“ buď vrátí jméno souboru na disku, " +#~ "který\n" +#~ " by byl spuÅ¡těn, nebo nic, pokud „type -t NÁZEV“ by nevrátil „file“.\n" +#~ " \n" +#~ " Je-li použit přepínač -a, „type“ zobrazí vÅ¡echna místa, kde se " +#~ "nalézá\n" +#~ " spustitelný program pojmenovaný „soubor“. To zahrnuje aliasy, " +#~ "vestavěné\n" +#~ " příkazy a funkce jen a pouze tehdy, když není rovněž použit přepínač -" +#~ "p.\n" +#~ " \n" +#~ " Přepínač -f potlačí hledání mezi funkcemi shellu.\n" +#~ " \n" +#~ " Přepínač -P vynutí prohledání PATH na každý NÁZEV, dokonce i když se\n" +#~ " jedná o alias, vestavěný příkaz nebo funkci, a vrátí název souboru " +#~ "na\n" +#~ " disku, který by byl spuÅ¡těn." + +#~ msgid "" +#~ "The user file-creation mask is set to MODE. If MODE is omitted, or if\n" +#~ " `-S' is supplied, the current value of the mask is printed. The `-" +#~ "S'\n" +#~ " option makes the output symbolic; otherwise an octal number is " +#~ "output.\n" +#~ " If `-p' is supplied, and MODE is omitted, the output is in a form\n" +#~ " that may be used as input. If MODE begins with a digit, it is\n" +#~ " interpreted as an octal number, otherwise it is a symbolic mode " +#~ "string\n" +#~ " like that accepted by chmod(1)." +#~ msgstr "" +#~ "Uživatelská maska práv vytvářených souborů je nastavena na MÓD. Je-li\n" +#~ " MÓD vynechán nebo je-li uvedeno „-S“, bude vytiÅ¡těna současná " +#~ "hodnota\n" +#~ " masky. Přepínač „-S“ učiní výstup symbolický, jinak bude výstupem\n" +#~ " osmičkové číslo. Je-li zadáno „-p“ a MÓD je vynechán, bude výstup ve\n" +#~ " formátu, který lze použít jako vstup. Začíná-li MÓD číslicí, bude\n" +#~ " interpretován jako osmičkové číslo, jinak jako řetězec symbolického " +#~ "zápisu\n" +#~ " práv tak, jak jej chápe chmod(1)." + +#~ msgid "" +#~ "Wait for the specified process and report its termination status. If\n" +#~ " N is not given, all currently active child processes are waited for,\n" +#~ " and the return code is zero. N is a process ID; if it is not given,\n" +#~ " all child processes of the shell are waited for." +#~ msgstr "" +#~ "Počká na zadaný proces a nahlásí jeho návratový kód. Není-li N zadáno,\n" +#~ " bude se čekat na vÅ¡echny právě aktivní procesy potomků a návratová " +#~ "hodnota\n" +#~ " bude nula. N je ID procesu. Není-li zadáno, bude se čekat na vÅ¡echny\n" +#~ " procesy potomků tohoto shellu." + +#~ msgid "" +#~ "Create a simple command invoked by NAME which runs COMMANDS.\n" +#~ " Arguments on the command line along with NAME are passed to the\n" +#~ " function as $0 .. $n." +#~ msgstr "" +#~ "Vytvoří jednoduchý příkaz volaný JMÉNEM, který spustí PŘÍKAZY. Argumenty\n" +#~ " z příkazové řádky spolu se JMÉNEM budou předány do funkce jako $0…$n." + +#~ msgid "" +#~ "Toggle the values of variables controlling optional behavior.\n" +#~ " The -s flag means to enable (set) each OPTNAME; the -u flag\n" +#~ " unsets each OPTNAME. The -q flag suppresses output; the exit\n" +#~ " status indicates whether each OPTNAME is set or unset. The -o\n" +#~ " option restricts the OPTNAMEs to those defined for use with\n" +#~ " `set -o'. With no options, or with the -p option, a list of all\n" +#~ " settable options is displayed, with an indication of whether or\n" +#~ " not each is set." +#~ msgstr "" +#~ "Přepne hodnoty proměnných řídící volitelné chování. Přepínač -s znamená,\n" +#~ " že se každý NÁZEV_VOLBY zapne (nastaví). Přepínač -u každý " +#~ "NÁZEV_VOLBY\n" +#~ " vypne. Přepínač -q potlačí výstup. Zda je nebo není nastaven každý\n" +#~ " NÁZEV_VOLBY, indikuje návratový kód. Přepínač -o omezí NÁZVY_VOLEB na " +#~ "ty,\n" +#~ " které jsou definovány pro použití s „set -o“. Bez přepínačů nebo\n" +#~ " s přepínačem -p je zobrazen seznam vÅ¡ech nastavitelných voleb včetně\n" +#~ " indikace, zda je každá nastavena." + +#~ msgid "" +#~ "For each NAME, specify how arguments are to be completed.\n" +#~ " If the -p option is supplied, or if no options are supplied, " +#~ "existing\n" +#~ " completion specifications are printed in a way that allows them to " +#~ "be\n" +#~ " reused as input. The -r option removes a completion specification " +#~ "for\n" +#~ " each NAME, or, if no NAMEs are supplied, all completion " +#~ "specifications." +#~ msgstr "" +#~ "U každého NÁZVU sdělí, jak budou argumenty doplněny. Je-li zadán\n" +#~ " přepínač -p nebo není-li zadán přepínač žádný, budou existující " +#~ "definice\n" +#~ " doplňování vytiÅ¡těny tak. že je bude možné znovu použít jako vstup.\n" +#~ " Přepínač -r odstraní definici doplnění pro každý NÁZEV nebo chybí-li " +#~ "NÁZVY,\n" +#~ " odstraní vÅ¡echny definice." diff --git a/po/da.gmo b/po/da.gmo new file mode 100644 index 0000000000000000000000000000000000000000..24a3ccd0c4133240d94f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eG?ltps+qz$j6Msg66V@2IYBM)Xgsb)ITo!y{A@|MV z!9avT1P(^$@^%?VSZ=g|yrrq|C4So7{#EGjDxv=g_;dCC8LBy@WnPU7nWAZiy86a%ls=&3{C-aOaKaD%X zjXENngcS}#6o6YrwCP_fy$dB1zoQE$80Iy#@}}@)8OgehH9sGB{TqgzJZpHTSSJ0k zZ0#S5`rW)XACCy+wU>BrAq#tV)nv7f?Hf{TWO2H<+wmye-V(zNRp}+FrZkq3-F>}7 zS9|u}K!L`0rVq#5b`z_ZQAEl^;bgFInf-(p?fL;P@e;2O69*&fxOFp=c>q$9S*{KT zqB9?KNhGHG@ZcWZ*~RkZ%A#4h(T*X1 z)K6PacRM-29J66qS*Od6+*7igaeiyZJu~^QnE=Gt)W^6m<8 z-(${|g<>x0*4e9Wh3^a38`ZaW;2a(R#Umx?E%wSz-#c^8n=^%ofaqR-nh16_pa0#h zwLb1TiMCM4A;F*k)*}+Z_CDX*dh$ivE6kCrCPL)UI8*sxk>NVGm|a|)>?z#?Iwkc3^Luqk{>^oIluO8x{QusZm^I?6q7?>oJb%|d7`lCP)y z0yHE{^#pHFR|yJLuUxl0y;$tSy2E%FlD)OZ8Yd(Ch88`ke75+(yOIFI0uEW= z8$|!BxLwiw&FS^;W|TL<+P0VdPM(Q92}qcz1#Re;OJFGUs z|8_@6fpXDw!n&)E8`T9$b^)bv`x<8 z(F$5e%Q!%?Qe|LW9AJBcEV0bpPVZ$4b-+)m*#Y0ZJO^XuOM#czrX}otgzN1@B$EfH^ry zLeE%hLVk;j`RYy=SGuLw`iNP)%N%Nd{qU7muqp;roC z!96L~dxK53ETbnFSkV2SB|O`I0a#=kpdMq#DP@{^ tn<@k6h5j%n6NAiuf<#pEPu8_)#%sDix^Z{w`_~>upY&tpam_*ae*yS`7h(Va literal 0 HcmV?d00001 diff --git a/po/da.po b/po/da.po new file mode 100644 index 0000000..07807bf --- /dev/null +++ b/po/da.po @@ -0,0 +1,5795 @@ +# Danish translation of bash. +# Copyright (C) 2008 Free Software Foundation, Inc. +# This file is distributed under the same license as the bash package. +# +# Kenneth Nielsen , 2009-2011. +# +# Oversættelseskonventioner: +# keymap -> tastetildeling +# child -> underproces +# +msgid "" +msgstr "" +"Project-Id-Version: bash 4.2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-02-11 11:19-0500\n" +"PO-Revision-Date: 2011-03-18 01:36+0100\n" +"Last-Translator: Kenneth Nielsen \n" +"Language-Team: Danish \n" +"Language: da\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +# Den er jeg altsÃ¥ ikke helt sikker pÃ¥ +#: arrayfunc.c:51 +msgid "bad array subscript" +msgstr "ugyldigt arrayindeks" + +#: arrayfunc.c:356 builtins/declare.def:566 +#, c-format +msgid "%s: cannot convert indexed to associative array" +msgstr "%s: kan ikke konvertere indekseret til associativt array" + +#: arrayfunc.c:539 +#, c-format +msgid "%s: invalid associative array key" +msgstr "%s: ugyldig nøgle til associativt array" + +#: arrayfunc.c:541 +#, c-format +msgid "%s: cannot assign to non-numeric index" +msgstr "%s: kan ikke tildele til ikkenumerisk indeks" + +#: arrayfunc.c:586 +#, c-format +msgid "%s: %s: must use subscript when assigning associative array" +msgstr "%s: %s: et indeks skal bruges ved tildeling til associativt array" + +#: bashhist.c:388 +#, c-format +msgid "%s: cannot create: %s" +msgstr "%s: kan ikke oprette %s" + +#: bashline.c:3982 +msgid "bash_execute_unix_command: cannot find keymap for command" +msgstr "bash_execute_unix_command: kan ikke finde tastetildeling for kommando" + +#: bashline.c:4069 +#, c-format +msgid "%s: first non-whitespace character is not `\"'" +msgstr "%s: første ikke-blank-tegn er ikke '\"'" + +# Kønnet her er et gæt, hvis det er parenteser eller anførselstegn passer det +# FEJLRAPPORT +#: bashline.c:4098 +#, c-format +msgid "no closing `%c' in %s" +msgstr "ingen afsluttende \"%c\" i %s" + +#: bashline.c:4132 +#, c-format +msgid "%s: missing colon separator" +msgstr "%s: manglende kolonseparator" + +#: braces.c:321 +#, c-format +msgid "brace expansion: cannot allocate memory for %s" +msgstr "" + +#: braces.c:413 +#, c-format +msgid "brace expansion: failed to allocate memory for %d elements" +msgstr "" + +#: braces.c:452 +#, c-format +msgid "brace expansion: failed to allocate memory for `%s'" +msgstr "" + +#: builtins/alias.def:132 +#, fuzzy, c-format +msgid "`%s': invalid alias name" +msgstr "\"%s\": ugyldigt tastetildelingsnavn" + +#: builtins/bind.def:123 builtins/bind.def:126 +msgid "line editing not enabled" +msgstr "linjeredigering ikke slÃ¥et til" + +#: builtins/bind.def:212 +#, c-format +msgid "`%s': invalid keymap name" +msgstr "\"%s\": ugyldigt tastetildelingsnavn" + +#: builtins/bind.def:251 +#, c-format +msgid "%s: cannot read: %s" +msgstr "%s: kan ikke læse: %s" + +#: builtins/bind.def:266 +#, c-format +msgid "`%s': cannot unbind" +msgstr "\"%s\": kan ikke løsne" + +#: builtins/bind.def:304 builtins/bind.def:334 +#, c-format +msgid "`%s': unknown function name" +msgstr "\"%s\": ukendt funktionsnavn" + +#: builtins/bind.def:312 +#, c-format +msgid "%s is not bound to any keys.\n" +msgstr "%s er ikke bundet til nogen taster.\n" + +#: builtins/bind.def:316 +#, c-format +msgid "%s can be invoked via " +msgstr "%s kan kaldes via " + +#: builtins/break.def:77 builtins/break.def:117 +msgid "loop count" +msgstr "løkketæller" + +#: builtins/break.def:137 +msgid "only meaningful in a `for', `while', or `until' loop" +msgstr "kun meningsfuld i en \"for\"-, \"while\"- eller \"until\"-løkke" + +#: builtins/caller.def:134 +msgid "" +"Returns the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns " +msgstr "" +"Returnerer konteksten af det nuværende underrutinekald.\n" +" \n" +" NÃ¥r UDTRYK udelades returneres " + +#: builtins/cd.def:319 +msgid "HOME not set" +msgstr "HOME ikke indstillet" + +#: builtins/cd.def:327 builtins/common.c:166 test.c:876 +msgid "too many arguments" +msgstr "for mange argumenter" + +#: builtins/cd.def:338 +msgid "OLDPWD not set" +msgstr "OLDPWD ikke indstillet" + +#: builtins/common.c:101 +#, c-format +msgid "line %d: " +msgstr "linje %d: " + +#: builtins/common.c:139 error.c:265 +#, c-format +msgid "warning: " +msgstr "advarsel: " + +#: builtins/common.c:153 +#, c-format +msgid "%s: usage: " +msgstr "%s: brug: " + +#: builtins/common.c:191 shell.c:506 shell.c:788 +#, c-format +msgid "%s: option requires an argument" +msgstr "%s: tilvalg kræver et argument" + +#: builtins/common.c:198 +#, c-format +msgid "%s: numeric argument required" +msgstr "%s: numerisk argument pÃ¥krævet" + +#: builtins/common.c:205 +#, c-format +msgid "%s: not found" +msgstr "%s: ikke fundet" + +#: builtins/common.c:214 shell.c:801 +#, c-format +msgid "%s: invalid option" +msgstr "%s: ugyldigt tilvalg" + +#: builtins/common.c:221 +#, c-format +msgid "%s: invalid option name" +msgstr "%s: ugyldigt tilvalgsnavn" + +#: builtins/common.c:228 general.c:235 general.c:240 +#, c-format +msgid "`%s': not a valid identifier" +msgstr "\"%s\": ikke et gyldigt identificeringsnavn" + +#: builtins/common.c:238 +msgid "invalid octal number" +msgstr "ugyldigt oktaltal" + +#: builtins/common.c:240 +msgid "invalid hex number" +msgstr "ugyldigt heksadecimalt tal" + +#: builtins/common.c:242 expr.c:1470 +msgid "invalid number" +msgstr "ugyldigt tal" + +#: builtins/common.c:250 +#, c-format +msgid "%s: invalid signal specification" +msgstr "%s: ugyldig signalspecifikation" + +#: builtins/common.c:257 +#, c-format +msgid "`%s': not a pid or valid job spec" +msgstr "\"%s\": ikke en pid eller gyldig job-spec" + +#: builtins/common.c:264 error.c:488 +#, c-format +msgid "%s: readonly variable" +msgstr "%s: skrivebeskyttet variabel" + +#: builtins/common.c:272 +#, c-format +msgid "%s: %s out of range" +msgstr "%s: %s udenfor rækkevidde" + +#: builtins/common.c:272 builtins/common.c:274 +msgid "argument" +msgstr "argument" + +#: builtins/common.c:274 +#, c-format +msgid "%s out of range" +msgstr "%s udenfor rækkevidde" + +#: builtins/common.c:282 +#, c-format +msgid "%s: no such job" +msgstr "%s: intet sÃ¥dant job" + +#: builtins/common.c:290 +#, c-format +msgid "%s: no job control" +msgstr "%s: ingen jobkontrol" + +#: builtins/common.c:292 +msgid "no job control" +msgstr "ingen jobkontrol" + +#: builtins/common.c:302 +#, c-format +msgid "%s: restricted" +msgstr "%s: begrænset" + +#: builtins/common.c:304 +msgid "restricted" +msgstr "begrænset" + +#: builtins/common.c:312 +#, c-format +msgid "%s: not a shell builtin" +msgstr "%s: ikke indbygget i skallen" + +#: builtins/common.c:321 +#, c-format +msgid "write error: %s" +msgstr "skrivefejl: %s" + +#: builtins/common.c:329 +#, c-format +msgid "error setting terminal attributes: %s" +msgstr "fejl ved indstilling af terminalattribut: %s" + +#: builtins/common.c:331 +#, c-format +msgid "error getting terminal attributes: %s" +msgstr "fejl ved indhentning af terminalattribut: %s" + +#: builtins/common.c:563 +#, c-format +msgid "%s: error retrieving current directory: %s: %s\n" +msgstr "%s: fejl ved indhentning af nuværende mappe: %s: %s\n" + +#: builtins/common.c:629 builtins/common.c:631 +#, c-format +msgid "%s: ambiguous job spec" +msgstr "%s: tvetydig job-spec" + +#: builtins/complete.def:277 +#, c-format +msgid "%s: invalid action name" +msgstr "%s: ugyldigt handlingsnavn" + +#: builtins/complete.def:450 builtins/complete.def:645 +#: builtins/complete.def:855 +#, c-format +msgid "%s: no completion specification" +msgstr "%s: ingen fuldførselsspecifikation" + +#: builtins/complete.def:697 +msgid "warning: -F option may not work as you expect" +msgstr "advarsel: tilvalget -F vil mÃ¥ske ikke virke, som du forventer" + +#: builtins/complete.def:699 +msgid "warning: -C option may not work as you expect" +msgstr "advarsel: tilvalget -C vil mÃ¥ske ikke virke, som du forventer" + +#: builtins/complete.def:828 +msgid "not currently executing completion function" +msgstr "ikke i gang med at eksekvere fuldførelsesfunktion" + +#: builtins/declare.def:126 +msgid "can only be used in a function" +msgstr "kan kun bruges i en funktion" + +#: builtins/declare.def:315 builtins/declare.def:509 +#, c-format +msgid "%s: reference variable cannot be an array" +msgstr "" + +#: builtins/declare.def:324 +#, c-format +msgid "%s: nameref variable self references not allowed" +msgstr "" + +#: builtins/declare.def:398 +msgid "cannot use `-f' to make functions" +msgstr "kan ikke bruge \"-f\" til at lave funktioner" + +#: builtins/declare.def:410 execute_cmd.c:5361 +#, c-format +msgid "%s: readonly function" +msgstr "%s: skrivebeskyttet funktion" + +#: builtins/declare.def:553 +#, c-format +msgid "%s: cannot destroy array variables in this way" +msgstr "%s: kan ikke destruere arrayvariabel pÃ¥ denne mÃ¥de" + +#: builtins/declare.def:560 builtins/read.def:733 +#, c-format +msgid "%s: cannot convert associative to indexed array" +msgstr "%s: kan ikke konvertere associativt til indekseret array" + +#: builtins/enable.def:137 builtins/enable.def:145 +msgid "dynamic loading not available" +msgstr "dynamisk indlæsning ikke tilgængelig" + +#: builtins/enable.def:312 +#, c-format +msgid "cannot open shared object %s: %s" +msgstr "kan ikke Ã¥bne delt objekt %s: %s" + +#: builtins/enable.def:335 +#, c-format +msgid "cannot find %s in shared object %s: %s" +msgstr "kan ikke finde %s i delt objekt %s: %s" + +#: builtins/enable.def:459 +#, c-format +msgid "%s: not dynamically loaded" +msgstr "%s: ikke dynamisk indlæst" + +#: builtins/enable.def:474 +#, c-format +msgid "%s: cannot delete: %s" +msgstr "%s: kan ikke slette: %s" + +#: builtins/evalfile.c:140 builtins/hash.def:171 execute_cmd.c:5208 +#: shell.c:1481 +#, c-format +msgid "%s: is a directory" +msgstr "%s: er en mappe" + +#: builtins/evalfile.c:146 +#, c-format +msgid "%s: not a regular file" +msgstr "%s: ikke en regulær fil" + +#: builtins/evalfile.c:155 +#, c-format +msgid "%s: file is too large" +msgstr "%s: fil er for stor" + +#: builtins/evalfile.c:190 builtins/evalfile.c:208 shell.c:1491 +#, c-format +msgid "%s: cannot execute binary file" +msgstr "%s: kan ikke eksekvere binær fil" + +#: builtins/exec.def:154 builtins/exec.def:156 builtins/exec.def:228 +#, c-format +msgid "%s: cannot execute: %s" +msgstr "%s: kan ikke eksekvere: %s" + +#: builtins/exit.def:65 +#, c-format +msgid "logout\n" +msgstr "log ud\n" + +#: builtins/exit.def:88 +msgid "not login shell: use `exit'" +msgstr "ikke en logind-skal: brug \"exit\"" + +#: builtins/exit.def:120 +#, c-format +msgid "There are stopped jobs.\n" +msgstr "Der er stoppede job.\n" + +#: builtins/exit.def:122 +#, c-format +msgid "There are running jobs.\n" +msgstr "Der er kørende job.\n" + +#: builtins/fc.def:262 +msgid "no command found" +msgstr "ingen kommando fundet" + +#: builtins/fc.def:320 builtins/fc.def:369 +msgid "history specification" +msgstr "historikspecifikation" + +#: builtins/fc.def:390 +#, c-format +msgid "%s: cannot open temp file: %s" +msgstr "%s: kan ikke Ã¥bne midl. fil: %s" + +#: builtins/fg_bg.def:149 builtins/jobs.def:282 +msgid "current" +msgstr "nuværende" + +#: builtins/fg_bg.def:158 +#, c-format +msgid "job %d started without job control" +msgstr "job %d startet uden jobkontrol" + +#: builtins/getopt.c:110 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: ugyldigt tilvalg -- %c\n" + +#: builtins/getopt.c:111 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: et argument er pÃ¥krævet til tilvalget -- %c\n" + +#: builtins/hash.def:92 +msgid "hashing disabled" +msgstr "hashing slÃ¥et fra" + +#: builtins/hash.def:138 +#, c-format +msgid "%s: hash table empty\n" +msgstr "%s: hash-tabel tom\n" + +#: builtins/hash.def:245 +#, c-format +msgid "hits\tcommand\n" +msgstr "hits\tkommando\n" + +# Jeg antager at det sidste ` er det første af et sæt af anførselstegn og +# det er derfor oversat til " +#: builtins/help.def:130 +#, c-format +msgid "Shell commands matching keyword `" +msgid_plural "Shell commands matching keywords `" +msgstr[0] "Skalkommandoer som matcher nøgleordet \"" +msgstr[1] "Skal-kommandoer som matcher nøgleordene \"" + +#: builtins/help.def:182 +#, c-format +msgid "" +"no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." +msgstr "" +"ingen hjælpeemner matcher \"%s\". Prøv \"help help\" eller \"man -k %s\" " +"eller \"info %s\"." + +#: builtins/help.def:199 +#, c-format +msgid "%s: cannot open: %s" +msgstr "%s: kan ikke Ã¥bne: %s" + +#: builtins/help.def:485 +#, c-format +msgid "" +"These shell commands are defined internally. Type `help' to see this list.\n" +"Type `help name' to find out more about the function `name'.\n" +"Use `info bash' to find out more about the shell in general.\n" +"Use `man -k' or `info' to find out more about commands not in this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" +msgstr "" +"Disse skalkommandoer er defineret internt. Skriv \"help\" for at se denne " +"liste.\n" +"Skriv \"help navn\" for at finde ud af mere om kommandoen \"navn\".\n" +"Brug \"info bash\" for at fÃ¥ mere generel information om skallen.\n" +"Brug \"man -k\" eller \"info\" for at finde ud af mere om kommandoer som " +"ikke er \n" +"pÃ¥ listen.\n" +"\n" +"En stjerne (*) ved siden af et navn betyder at kommandoen er slÃ¥et fra.\n" +"\n" + +#: builtins/history.def:154 +msgid "cannot use more than one of -anrw" +msgstr "kan ikke bruge mere end en af -anrw" + +#: builtins/history.def:186 +msgid "history position" +msgstr "historikposition" + +#: builtins/history.def:366 +#, c-format +msgid "%s: history expansion failed" +msgstr "%s: historikudvidelse fejlede" + +#: builtins/inlib.def:71 +#, c-format +msgid "%s: inlib failed" +msgstr "%s: inlib fejlede" + +#: builtins/jobs.def:109 +msgid "no other options allowed with `-x'" +msgstr "ingen andre tilvalg er tilladt sammen med \"-x\"" + +#: builtins/kill.def:200 +#, c-format +msgid "%s: arguments must be process or job IDs" +msgstr "%s: argumenter skal være processer eller job-id'er" + +#: builtins/kill.def:263 +msgid "Unknown error" +msgstr "Ukendt fejl" + +#: builtins/let.def:95 builtins/let.def:120 expr.c:583 expr.c:598 +msgid "expression expected" +msgstr "forventede et udtryk" + +#: builtins/mapfile.def:172 +#, fuzzy, c-format +msgid "%s: not an indexed array" +msgstr "%s: ikke en arrayvariabel" + +#: builtins/mapfile.def:259 builtins/read.def:302 +#, c-format +msgid "%s: invalid file descriptor specification" +msgstr "%s: ugyldig filbeskrivelsesspecifikation" + +#: builtins/mapfile.def:267 builtins/read.def:309 +#, c-format +msgid "%d: invalid file descriptor: %s" +msgstr "%d: ugyldig filbeskrivelse: %s" + +# -c Specify the number of lines read between each call to callback. +#: builtins/mapfile.def:276 builtins/mapfile.def:314 +#, c-format +msgid "%s: invalid line count" +msgstr "%s: ugyldigt antal linjer" + +#: builtins/mapfile.def:287 +#, c-format +msgid "%s: invalid array origin" +msgstr "%s: ugyldig array-startindeks" + +#: builtins/mapfile.def:304 +#, c-format +msgid "%s: invalid callback quantum" +msgstr "%s: ugyldigt tilbagekaldskvantum" + +#: builtins/mapfile.def:336 +msgid "empty array variable name" +msgstr "tomt arrayvariabelnavn" + +#: builtins/mapfile.def:357 +msgid "array variable support required" +msgstr "understøttelse af arrayvariabel pÃ¥krævet" + +#: builtins/printf.def:402 +#, c-format +msgid "`%s': missing format character" +msgstr "\"%s\": manglende formattegn" + +#: builtins/printf.def:456 +#, fuzzy, c-format +msgid "`%c': invalid time format specification" +msgstr "%s: ugyldig specifikation af tidsudløb" + +#: builtins/printf.def:658 +#, c-format +msgid "`%c': invalid format character" +msgstr "\"%c\": ugyldigt formattegn" + +#: builtins/printf.def:684 +#, c-format +msgid "warning: %s: %s" +msgstr "advarsel: %s: %s" + +#: builtins/printf.def:768 +#, c-format +msgid "format parsing problem: %s" +msgstr "" + +#: builtins/printf.def:865 +msgid "missing hex digit for \\x" +msgstr "manglende heksciffer for \\x" + +#: builtins/printf.def:880 +#, fuzzy, c-format +msgid "missing unicode digit for \\%c" +msgstr "manglende heksciffer for \\x" + +#: builtins/pushd.def:195 +msgid "no other directory" +msgstr "ingen anden mappe" + +#: builtins/pushd.def:354 +#, fuzzy, c-format +msgid "%s: invalid argument" +msgstr "%s: ugyldigt grænseargument" + +#: builtins/pushd.def:468 +msgid "" +msgstr "" + +#: builtins/pushd.def:512 +msgid "directory stack empty" +msgstr "mappestak tom" + +#: builtins/pushd.def:514 +msgid "directory stack index" +msgstr "mappestakindeks" + +#: builtins/pushd.def:689 +msgid "" +"Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +"\tdirs when invoked without options, starting with zero." +msgstr "" +"Viser listen af huskede mapper. Mapper tilføjes til listen med\n" +" \"pushd\"-kommandoen. Du kan komme tilbage i listen med \"popd\"-\n" +" kommandoen.\n" +"\n" +" Valgmuligheder:\n" +" -c\tryd mappestakken ved at slette alle elementerne\n" +" -l\tvis ikke \"tildepræfiksede\" versioner af mapper relativt\n" +" til din hjemmemappe\n" +" -p\tvis mappestakken med et element per linje\n" +" -v\tvis mappestakken med et element per linje, præfikset med\n" +" med dets position i stakken\n" +" \n" +" Argumenter:\n" +" +N\tViser det N'te element, talt fra venstre af og vist mappevis\n" +" nÃ¥r der ikke angives nogle valgmuligheder, startende fra 0.\n" +" \n" +" -N\tViser det N'te element, talt fra venstre af og vist mappevis\n" +" nÃ¥r der ikke angives nogle valgmuligheder, startende fra 0." + +# Jeg tror der er en fejl i den engelske, fejlrapport +#: builtins/pushd.def:711 +#, fuzzy +msgid "" +"Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Tilføjer en mappe til toppen af mappestakken, eller roterer stakken\n" +" sÃ¥ledes at den nye top bliver den aktuelle mappe. Uden\n" +" argumenter ombyttes de to øverste mapper.\n" +" \n" +" Valgmuligheder:\n" +" -n\tUndertrykker det normale mappeskift ved tilføjelse\n" +" \taf mapper til stakken, sÃ¥ledes at kun stakken manipuleres.\n" +" \n" +" Argumenter:\n" +" +N\tRoterer stakken sÃ¥ledes at det N'te element (talt\n" +" \tfra venstre af listen som vist af \"dirs\", startende med nul)\n" +" \tbliver placeret i toppen.\n" +" \n" +" -N\tRoterer stakken sÃ¥ledes at det N'te element (talt\n" +" \tfra højre af listen som vist af \"dirs\", startende med nul)\n" +" \tbliver placeret i toppen.\n" +" \n" +" dir\tTilføjer DIR til toppen af mappestakken, sÃ¥ledes at den\n" +" \tbliver den nye aktive mappe.\n" +" \n" +"Den indbyggede funktion \"dirs\" viser mappestakken." + +#: builtins/pushd.def:736 +msgid "" +"Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Fjerner en mappe fra toppen af mappestakken. Uden argumenter fjernes\n" +" den øverste mappe fra stakken og der skiftes til den nye øverste mappe.\n" +" \n" +" Valgmuligheder:\n" +" -n\tUndertrykker det normale mappeskift ved fjernelse\n" +" \taf mapper fra stakken, sÃ¥ledes at kun stakken manipuleres.\n" +" \n" +" Argumenter:\n" +" +N\tFjerner det N'te element, talt fra venstre af listen\n" +" \tsom vist af \"dirs\", startende med nul. F.eks: vil \"popd +0\"\n" +" \tfjerne det øverste argument og \"popd +1\" det andet.\n" +" \n" +" -N\tFjerner det N'te element, talt fra højre af listen\n" +" \tsom vist af \"dirs\", startende med nul. F.eks: vil \"popd -0\"\n" +" \tfjerne det sidste argument og \"popd -1\" det andetsidste.\n" +" \n" +"Den indbyggede funktion \"dirs\" viser mappestakken." + +#: builtins/read.def:275 +#, c-format +msgid "%s: invalid timeout specification" +msgstr "%s: ugyldig specifikation af tidsudløb" + +#: builtins/read.def:678 +#, c-format +msgid "read error: %d: %s" +msgstr "læsefejl: %d: %s" + +#: builtins/return.def:75 +msgid "can only `return' from a function or sourced script" +msgstr "kan kun udføre \"return\" fra en funktion eller indlæst skript" + +#: builtins/set.def:782 +msgid "cannot simultaneously unset a function and a variable" +msgstr "kan ikke fjerne en funktion og en variabel samtidig" + +#: builtins/set.def:826 +#, c-format +msgid "%s: cannot unset" +msgstr "%s: kan ikke fjerne" + +#: builtins/set.def:843 +#, c-format +msgid "%s: cannot unset: readonly %s" +msgstr "%s: kan ikke fjerne: skrivebeskyttet %s" + +#: builtins/set.def:854 +#, c-format +msgid "%s: not an array variable" +msgstr "%s: ikke en arrayvariabel" + +#: builtins/setattr.def:187 +#, c-format +msgid "%s: not a function" +msgstr "%s: ikke en funktion" + +#: builtins/shift.def:71 builtins/shift.def:77 +msgid "shift count" +msgstr "skifttæller" + +#: builtins/shopt.def:279 +msgid "cannot set and unset shell options simultaneously" +msgstr "kan ikke indstille og fjerne skaltilvalg samtidig" + +#: builtins/shopt.def:346 +#, c-format +msgid "%s: invalid shell option name" +msgstr "%s: ugyldigt navn for skaltilvalg" + +#: builtins/source.def:130 +msgid "filename argument required" +msgstr "filnavnsargument pÃ¥krævet" + +#: builtins/source.def:155 +#, c-format +msgid "%s: file not found" +msgstr "%s: fil ikke fundet" + +#: builtins/suspend.def:101 +msgid "cannot suspend" +msgstr "kan ikke sætte i hvile" + +#: builtins/suspend.def:111 +msgid "cannot suspend a login shell" +msgstr "kan ikke sætte en logindskal i hvile" + +#: builtins/type.def:234 +#, c-format +msgid "%s is aliased to `%s'\n" +msgstr "%s er aliasset til \"%s\"\n" + +#: builtins/type.def:255 +#, c-format +msgid "%s is a shell keyword\n" +msgstr "%s er et skalnøgleord\n" + +#: builtins/type.def:274 +#, c-format +msgid "%s is a function\n" +msgstr "%s er en funktion\n" + +#: builtins/type.def:296 +#, c-format +msgid "%s is a shell builtin\n" +msgstr "%s er indbygget i skallen\n" + +#: builtins/type.def:317 builtins/type.def:393 +#, c-format +msgid "%s is %s\n" +msgstr "%s er %s\n" + +#: builtins/type.def:337 +#, c-format +msgid "%s is hashed (%s)\n" +msgstr "%s er hashet (%s)\n" + +#: builtins/ulimit.def:383 +#, c-format +msgid "%s: invalid limit argument" +msgstr "%s: ugyldigt grænseargument" + +#: builtins/ulimit.def:409 +#, c-format +msgid "`%c': bad command" +msgstr "\"%c\": ugyldig kommando" + +#: builtins/ulimit.def:438 +#, c-format +msgid "%s: cannot get limit: %s" +msgstr "%s: kan ikke indhente grænse: %s" + +#: builtins/ulimit.def:464 +msgid "limit" +msgstr "grænse" + +#: builtins/ulimit.def:476 builtins/ulimit.def:776 +#, c-format +msgid "%s: cannot modify limit: %s" +msgstr "%s: kan ikke modificere grænse: %s" + +#: builtins/umask.def:114 +msgid "octal number" +msgstr "oktalt tal" + +#: builtins/umask.def:227 +#, c-format +msgid "`%c': invalid symbolic mode operator" +msgstr "\"%c\": ugyldig symbolsk tilstandsoperator" + +#: builtins/umask.def:282 +#, c-format +msgid "`%c': invalid symbolic mode character" +msgstr "\"%c\": ugyldigt symbolsk tilstandstegn" + +#: error.c:90 error.c:325 error.c:327 error.c:329 +msgid " line " +msgstr " linje " + +#: error.c:165 +#, c-format +msgid "last command: %s\n" +msgstr "sidste kommando: %s\n" + +#: error.c:173 +#, c-format +msgid "Aborting..." +msgstr "Afbryder..." + +#: error.c:440 +msgid "unknown command error" +msgstr "ukendt kommandofejl" + +#: error.c:441 +msgid "bad command type" +msgstr "ugyldig kommandotype" + +#: error.c:442 +msgid "bad connector" +msgstr "dÃ¥rligt mellemled" + +#: error.c:443 +msgid "bad jump" +msgstr "dÃ¥rligt hop" + +#: error.c:481 +#, c-format +msgid "%s: unbound variable" +msgstr "%s: ubundet variabel" + +#: eval.c:189 +#, c-format +msgid "\atimed out waiting for input: auto-logout\n" +msgstr "\atidsudløb mens der ventedes pÃ¥ input: auto-logud\n" + +#: execute_cmd.c:512 +#, c-format +msgid "cannot redirect standard input from /dev/null: %s" +msgstr "kan ikke videresende standardinput fra /dev/null: %s" + +#: execute_cmd.c:1233 +#, c-format +msgid "TIMEFORMAT: `%c': invalid format character" +msgstr "TIMEFORMAT: \"%c\": ugyldigt formateringstegn" + +#: execute_cmd.c:2287 +msgid "pipe error" +msgstr "datakanalfejl (pipe error)" + +#: execute_cmd.c:4386 +#, c-format +msgid "%s: maximum function nesting level exceeded (%d)" +msgstr "" + +#: execute_cmd.c:4884 +#, c-format +msgid "%s: restricted: cannot specify `/' in command names" +msgstr "%s: begrænset: kan ikke specificere \"/\" i kommandonavne" + +#: execute_cmd.c:4973 +#, c-format +msgid "%s: command not found" +msgstr "%s: kommando ikke fundet" + +#: execute_cmd.c:5206 +#, c-format +msgid "%s: %s" +msgstr "" + +#: execute_cmd.c:5243 +#, c-format +msgid "%s: %s: bad interpreter" +msgstr "%s: %s: dÃ¥rlig fortolker" + +#: execute_cmd.c:5280 +#, fuzzy, c-format +msgid "%s: cannot execute binary file: %s" +msgstr "%s: kan ikke eksekvere binær fil" + +#: execute_cmd.c:5352 +#, fuzzy, c-format +msgid "`%s': is a special builtin" +msgstr "%s er indbygget i skallen\n" + +# Process Substitution +# Process substitution is supported on systems that support named pipes +# (FIFOs) or the /dev/fd method of naming open files. It takes the form +# of <(list) or >(list). The process list is run with its input or out‐ +# put connected to a FIFO or some file in /dev/fd. The name of this file +# is passed as an argument to the current command as the result of the +# expansion. If the >(list) form is used, writing to the file will pro‐ +# vide input for list. If the <(list) form is used, the file passed as +# an argument should be read to obtain the output of list. +#: execute_cmd.c:5404 +#, c-format +msgid "cannot duplicate fd %d to fd %d" +msgstr "kan ikke duplikere fd %d til fd %d" + +#: expr.c:259 +msgid "expression recursion level exceeded" +msgstr "grænse for rekursion af udtryk overskredet" + +#: expr.c:283 +msgid "recursion stack underflow" +msgstr "underløb i rekursionsstak" + +#: expr.c:431 +msgid "syntax error in expression" +msgstr "syntaksfejl i udtryk" + +#: expr.c:475 +msgid "attempted assignment to non-variable" +msgstr "forsøgte tildeling til ikke-variabel" + +#: expr.c:495 expr.c:858 +msgid "division by 0" +msgstr "division med 0" + +# denne her streng er dÃ¥rlig pÃ¥ sÃ¥ mange mÃ¥der at det fatter man slet ikke. Skal bug oversætter og hvad er expassign. Jeg laver et bud og har fejlmeldt den +#: expr.c:542 +msgid "bug: bad expassign token" +msgstr "bug: dÃ¥rligt expassign-udtryk" + +#: expr.c:595 +msgid "`:' expected for conditional expression" +msgstr "\":\" forventet for betingede udtryk" + +#: expr.c:919 +msgid "exponent less than 0" +msgstr "eksponent mindre end 0" + +#: expr.c:976 +msgid "identifier expected after pre-increment or pre-decrement" +msgstr "identifikator forventet efter præforøgelse eller -formindskelse" + +#: expr.c:1002 +msgid "missing `)'" +msgstr "manglende \")\"" + +#: expr.c:1053 expr.c:1390 +msgid "syntax error: operand expected" +msgstr "syntaksfejl: operand forventet" + +#: expr.c:1392 +msgid "syntax error: invalid arithmetic operator" +msgstr "syntaksfejl: ugyldig aritmetisk operator" + +#: expr.c:1416 +#, c-format +msgid "%s%s%s: %s (error token is \"%s\")" +msgstr "%s%s%s: %s (fejlelement er \"%s\")" + +#: expr.c:1474 +msgid "invalid arithmetic base" +msgstr "ugyldig aritmetisk grundtal" + +#: expr.c:1494 +msgid "value too great for base" +msgstr "værdi for stor til grundtal" + +#: expr.c:1543 +#, c-format +msgid "%s: expression error\n" +msgstr "%s: fejl i udtryk\n" + +#: general.c:62 +msgid "getcwd: cannot access parent directories" +msgstr "getcwd: kan ikke tilgÃ¥ overliggende mapper" + +# Har ladet nodelay stÃ¥, idet jeg gætter pÃ¥ at det er et navn +#: input.c:102 subst.c:5168 +#, c-format +msgid "cannot reset nodelay mode for fd %d" +msgstr "kan ikke nulstille \"nodelay\"-tilstand for fd %d" + +#: input.c:271 +#, c-format +msgid "cannot allocate new file descriptor for bash input from fd %d" +msgstr "kan ikke allokere ny fildeskriptor til bash-input fra fd %d" + +#: input.c:279 +#, c-format +msgid "save_bash_input: buffer already exists for new fd %d" +msgstr "save_bash_input: buffer eksisterer allerede til ny fd %d" + +# ?? +#: jobs.c:471 +msgid "start_pipeline: pgrp pipe" +msgstr "start_pipeline: pgrp-datakanal (pipe)" + +#: jobs.c:893 +#, c-format +msgid "forked pid %d appears in running job %d" +msgstr "forgrenet pid %d figurerer i kørende job %d" + +#: jobs.c:1012 +#, c-format +msgid "deleting stopped job %d with process group %ld" +msgstr "sletter stoppet job %d med procesgruppe %ld" + +# ?? +#: jobs.c:1117 +#, c-format +msgid "add_process: process %5ld (%s) in the_pipeline" +msgstr "add_process: proces %5ld (%s) i the_pipeline" + +#: jobs.c:1120 +#, c-format +msgid "add_process: pid %5ld (%s) marked as still alive" +msgstr "add_process: pid %5ld (%s) markeret som stadig i live" + +#: jobs.c:1435 +#, c-format +msgid "describe_pid: %ld: no such pid" +msgstr "describe_pid: %ld: ingen process med det pid" + +#: jobs.c:1450 +#, c-format +msgid "Signal %d" +msgstr "Signal %d" + +#: jobs.c:1464 jobs.c:1489 +msgid "Done" +msgstr "Færdig" + +#: jobs.c:1469 siglist.c:123 +msgid "Stopped" +msgstr "Stoppet" + +#: jobs.c:1473 +#, c-format +msgid "Stopped(%s)" +msgstr "Stoppet(%s)" + +#: jobs.c:1477 +msgid "Running" +msgstr "Kører" + +#: jobs.c:1491 +#, c-format +msgid "Done(%d)" +msgstr "Færdig(%d)" + +#: jobs.c:1493 +#, c-format +msgid "Exit %d" +msgstr "Afslut %d" + +#: jobs.c:1496 +msgid "Unknown status" +msgstr "Ukendt status" + +#: jobs.c:1583 +#, c-format +msgid "(core dumped) " +msgstr "(smed kerne) " + +#: jobs.c:1602 +#, c-format +msgid " (wd: %s)" +msgstr " (wd: %s)" + +#: jobs.c:1819 +#, c-format +msgid "child setpgid (%ld to %ld)" +msgstr "underproces setpgid (%ld til %ld)" + +#: jobs.c:2138 nojobs.c:605 +#, c-format +msgid "wait: pid %ld is not a child of this shell" +msgstr "wait: pid %ld er ikke en underproces af denne skal" + +#: jobs.c:2385 +#, c-format +msgid "wait_for: No record of process %ld" +msgstr "wait_for: Ingen optegnelse af proces %ld" + +#: jobs.c:2694 +#, c-format +msgid "wait_for_job: job %d is stopped" +msgstr "wait_for_job: job %d er stoppet" + +#: jobs.c:2986 +#, c-format +msgid "%s: job has terminated" +msgstr "%s: job er afbrudt" + +#: jobs.c:2995 +#, c-format +msgid "%s: job %d already in background" +msgstr "%s: job %d er allerede i baggrunden" + +#: jobs.c:3220 +msgid "waitchld: turning on WNOHANG to avoid indefinite block" +msgstr "" + +#: jobs.c:3711 +#, c-format +msgid "%s: line %d: " +msgstr "%s: linje %d: " + +#: jobs.c:3725 nojobs.c:843 +#, c-format +msgid " (core dumped)" +msgstr " (smed kerne)" + +#: jobs.c:3737 jobs.c:3750 +#, c-format +msgid "(wd now: %s)\n" +msgstr "(wd nu: %s)\n" + +#: jobs.c:3782 +msgid "initialize_job_control: getpgrp failed" +msgstr "initialize_job_control: getpgrp fejlede" + +#: jobs.c:3843 +msgid "initialize_job_control: line discipline" +msgstr "initialize_job_control: linjedisciplin" + +#: jobs.c:3853 +msgid "initialize_job_control: setpgid" +msgstr "initialize_job_control: setpgid" + +#: jobs.c:3874 jobs.c:3883 +#, c-format +msgid "cannot set terminal process group (%d)" +msgstr "kan ikke indstille terminal-procesgruppe (%d)" + +#: jobs.c:3888 +msgid "no job control in this shell" +msgstr "ingen jobkontrol i denne skal" + +#: lib/malloc/malloc.c:296 +#, c-format +msgid "malloc: failed assertion: %s\n" +msgstr "malloc: forfejlet hævdelse: %s\n" + +#: lib/malloc/malloc.c:312 +#, c-format +msgid "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" +msgstr "" +"\r\n" +"malloc: %s:%d: hævdelse forkludret\r\n" + +#: lib/malloc/malloc.c:313 +msgid "unknown" +msgstr "ukendt" + +#: lib/malloc/malloc.c:801 +msgid "malloc: block on free list clobbered" +msgstr "malloc: blok i fri liste tværet ud" + +#: lib/malloc/malloc.c:878 +msgid "free: called with already freed block argument" +msgstr "free: kaldt med blokargument som allerede er fri" + +#: lib/malloc/malloc.c:881 +msgid "free: called with unallocated block argument" +msgstr "free: kaldt med ikke-allokeret blokargument" + +#: lib/malloc/malloc.c:900 +msgid "free: underflow detected; mh_nbytes out of range" +msgstr "free: underløb detekteret, mh_nbytes uden for interval" + +#: lib/malloc/malloc.c:906 +msgid "free: start and end chunk sizes differ" +msgstr "free: størrelse pÃ¥ start- og slut-bid afviger" + +#: lib/malloc/malloc.c:1005 +msgid "realloc: called with unallocated block argument" +msgstr "realloc: kaldt med ikke-allokeret blokargument" + +#: lib/malloc/malloc.c:1020 +msgid "realloc: underflow detected; mh_nbytes out of range" +msgstr "realloc: underløb detekteret, mh_nbytes uden for interval" + +#: lib/malloc/malloc.c:1026 +msgid "realloc: start and end chunk sizes differ" +msgstr "realloc: størrelse pÃ¥ start- og slut-bid afviger" + +#: lib/malloc/table.c:194 +#, c-format +msgid "register_alloc: alloc table is full with FIND_ALLOC?\n" +msgstr "register_alloc: alloc-tabel er fyldt med FIND_ALLOC?\n" + +#: lib/malloc/table.c:203 +#, c-format +msgid "register_alloc: %p already in table as allocated?\n" +msgstr "register_alloc: %p allerede i tabel som allokeret?\n" + +#: lib/malloc/table.c:256 +#, c-format +msgid "register_free: %p already in table as free?\n" +msgstr "register_free: %p allerede i tabel som fri?\n" + +#: lib/sh/fmtulong.c:102 +msgid "invalid base" +msgstr "ugyldig base" + +#: lib/sh/netopen.c:168 +#, c-format +msgid "%s: host unknown" +msgstr "%s: vært ukendt" + +#: lib/sh/netopen.c:175 +#, c-format +msgid "%s: invalid service" +msgstr "%s: ugyldig tjeneste" + +#: lib/sh/netopen.c:306 +#, c-format +msgid "%s: bad network path specification" +msgstr "%s: dÃ¥rlig specifikation for netværkssti" + +#: lib/sh/netopen.c:346 +msgid "network operations not supported" +msgstr "netværksoperation ikke understøttet" + +#: locale.c:200 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s)" +msgstr "" + +#: locale.c:202 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s): %s" +msgstr "" + +#: locale.c:259 +#, fuzzy, c-format +msgid "setlocale: %s: cannot change locale (%s)" +msgstr "xrealloc: %s:%d: kan ikke allokere %lu bytes" + +#: locale.c:261 +#, fuzzy, c-format +msgid "setlocale: %s: cannot change locale (%s): %s" +msgstr "xrealloc: %s:%d: kan ikke allokere %lu bytes" + +#: mailcheck.c:439 +msgid "You have mail in $_" +msgstr "Du har post i $_" + +#: mailcheck.c:464 +msgid "You have new mail in $_" +msgstr "Du har ny post i $_" + +#: mailcheck.c:480 +#, c-format +msgid "The mail in %s has been read\n" +msgstr "Posten i %s er blevet læst\n" + +#: make_cmd.c:323 +msgid "syntax error: arithmetic expression required" +msgstr "syntaksfejl: aritmetisk udtryk pÃ¥krævet" + +#: make_cmd.c:325 +msgid "syntax error: `;' unexpected" +msgstr "syntaksfejl: \";\" uventet" + +#: make_cmd.c:326 +#, c-format +msgid "syntax error: `((%s))'" +msgstr "syntaksfejl: \"((%s))\"" + +#: make_cmd.c:578 +#, c-format +msgid "make_here_document: bad instruction type %d" +msgstr "make_here_document: dÃ¥rlig instruktionstype %d" + +#: make_cmd.c:662 +#, c-format +msgid "here-document at line %d delimited by end-of-file (wanted `%s')" +msgstr "" +"here-document ved linje %d er adskilt af slut-pÃ¥-linje (ønskede \"%s\")" + +#: make_cmd.c:759 +#, c-format +msgid "make_redirection: redirection instruction `%d' out of range" +msgstr "make_direction: videresendelsesinstruktion \"%d\" uden for interval" + +#: parse.y:3278 parse.y:3561 +#, c-format +msgid "unexpected EOF while looking for matching `%c'" +msgstr "uventet EOF mens der ledtes efter samhørende \"%c\"" + +#: parse.y:4170 +msgid "unexpected EOF while looking for `]]'" +msgstr "uventet EOF mens der ledtes efter \"]]\"" + +# word A sequence of characters considered as a single unit by the +# shell. Also known as a token. +# Jeg har valgt udtryk +#: parse.y:4175 +#, c-format +msgid "syntax error in conditional expression: unexpected token `%s'" +msgstr "syntaksfejl i betingelsesudtryk: uventet element \"%s\"" + +#: parse.y:4179 +msgid "syntax error in conditional expression" +msgstr "syntaksfejl i betingelsesudtryk" + +# word A sequence of characters considered as a single unit by the +# shell. Also known as a token. +#: parse.y:4257 +#, c-format +msgid "unexpected token `%s', expected `)'" +msgstr "uventet element \"%s\", forventede \")\"" + +#: parse.y:4261 +msgid "expected `)'" +msgstr "forventede \")\"" + +#: parse.y:4289 +#, c-format +msgid "unexpected argument `%s' to conditional unary operator" +msgstr "uventet argument \"%s\" til unær betingelsesoperator" + +#: parse.y:4293 +msgid "unexpected argument to conditional unary operator" +msgstr "uventet argument til unær betingelsesoperator" + +#: parse.y:4339 +#, c-format +msgid "unexpected token `%s', conditional binary operator expected" +msgstr "uventet udtryk \"%s\", ventede binær betingelsesoperator" + +#: parse.y:4343 +msgid "conditional binary operator expected" +msgstr "ventedet binær betingelsesoperator" + +#: parse.y:4365 +#, c-format +msgid "unexpected argument `%s' to conditional binary operator" +msgstr "uventet argument \"%s\" til binær betingelsesoperator" + +#: parse.y:4369 +msgid "unexpected argument to conditional binary operator" +msgstr "uventet argument til binær betingelsesoperator" + +#: parse.y:4380 +#, c-format +msgid "unexpected token `%c' in conditional command" +msgstr "uventet udtryk \"%c\" i betingelseskommando" + +#: parse.y:4383 +#, c-format +msgid "unexpected token `%s' in conditional command" +msgstr "uventet udtryk \"%s\" i betingelseskommando" + +#: parse.y:4387 +#, c-format +msgid "unexpected token %d in conditional command" +msgstr "uventet udtryk \"%d\" i betingelseskommando" + +#: parse.y:5737 +#, c-format +msgid "syntax error near unexpected token `%s'" +msgstr "syntaksfejl nær uventet udtryk \"%s\"" + +#: parse.y:5755 +#, c-format +msgid "syntax error near `%s'" +msgstr "syntaksfejl nær \"%s\"" + +#: parse.y:5765 +msgid "syntax error: unexpected end of file" +msgstr "syntaksfejl: uventet slutning pÃ¥ fil" + +#: parse.y:5765 +msgid "syntax error" +msgstr "syntaksfejl" + +#: parse.y:5827 +#, c-format +msgid "Use \"%s\" to leave the shell.\n" +msgstr "Brug \"%s\" for at forlade skallen.\n" + +#: parse.y:5989 +msgid "unexpected EOF while looking for matching `)'" +msgstr "uventet EOF mens der ledtes efter samhørende \")\"" + +#: pcomplete.c:1094 +#, c-format +msgid "completion: function `%s' not found" +msgstr "completion: funktion \"%s\" ikke fundet" + +#: pcomplib.c:182 +#, c-format +msgid "progcomp_insert: %s: NULL COMPSPEC" +msgstr "progcomp_insert: %s: NULL COMPSPEC" + +#: print_cmd.c:300 +#, c-format +msgid "print_command: bad connector `%d'" +msgstr "print_command: dÃ¥rligt mellemled \"%d\"" + +#: print_cmd.c:373 +#, fuzzy, c-format +msgid "xtrace_set: %d: invalid file descriptor" +msgstr "%d: ugyldig filbeskrivelse: %s" + +#: print_cmd.c:378 +msgid "xtrace_set: NULL file pointer" +msgstr "" + +#: print_cmd.c:382 +#, c-format +msgid "xtrace fd (%d) != fileno xtrace fp (%d)" +msgstr "" + +#: print_cmd.c:1518 +#, c-format +msgid "cprintf: `%c': invalid format character" +msgstr "cprintf: \"%c\": ugyldigt formateringstegn" + +#: redir.c:123 redir.c:170 +msgid "file descriptor out of range" +msgstr "fil-deskriptor uden for interval" + +#: redir.c:177 +#, c-format +msgid "%s: ambiguous redirect" +msgstr "%s: tvetydig videresendelse" + +#: redir.c:181 +#, c-format +msgid "%s: cannot overwrite existing file" +msgstr "%s: kan ikke overskrive eksisterende fil" + +#: redir.c:186 +#, c-format +msgid "%s: restricted: cannot redirect output" +msgstr "%s: begrænset: kan ikke videresende output" + +#: redir.c:191 +#, c-format +msgid "cannot create temp file for here-document: %s" +msgstr "kan ikke danne midlertidig fil til here-dokument: %s" + +#: redir.c:195 +#, fuzzy, c-format +msgid "%s: cannot assign fd to variable" +msgstr "%s: kan ikke tildele liste til arrayelementer" + +#: redir.c:582 +msgid "/dev/(tcp|udp)/host/port not supported without networking" +msgstr "/dev/(tcp|udp)/vært/port ikke understøttet uden netværk" + +#: redir.c:861 redir.c:973 redir.c:1034 redir.c:1199 +msgid "redirection error: cannot duplicate fd" +msgstr "videresendelsesfejl: kan ikke duplikere fd" + +#: shell.c:339 +msgid "could not find /tmp, please create!" +msgstr "kan ikke finde /tmp, opret venligst mappen!" + +#: shell.c:343 +msgid "/tmp must be a valid directory name" +msgstr "/tmp skal være et gyldigt mappenavn" + +#: shell.c:890 +#, c-format +msgid "%c%c: invalid option" +msgstr "%c%c: ugyldigt tilvalg" + +#: shell.c:1682 +msgid "I have no name!" +msgstr "Jeg har ikke noget navn!" + +#: shell.c:1827 +#, c-format +msgid "GNU bash, version %s-(%s)\n" +msgstr "GNU bash, version %s-(%s)\n" + +#: shell.c:1828 +#, c-format +msgid "" +"Usage:\t%s [GNU long option] [option] ...\n" +"\t%s [GNU long option] [option] script-file ...\n" +msgstr "" +"Brug:\t%s [langt GNU-tilvalg] [tilvalg] ...\n" +"\t%s [langt GNU-tilvalg] [tilvalg] skript-fil ...\n" + +#: shell.c:1830 +msgid "GNU long options:\n" +msgstr "Lange GNU-tilvalg:\n" + +#: shell.c:1834 +msgid "Shell options:\n" +msgstr "Skal-tilvalg:\n" + +#: shell.c:1835 +#, fuzzy +msgid "\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n" +msgstr "\t-irsD eller -c kommando eller -O shopt_option\t\t(kun programkald)\n" + +#: shell.c:1850 +#, c-format +msgid "\t-%s or -o option\n" +msgstr "\tTilvalg -%s eller -o\n" + +#: shell.c:1856 +#, c-format +msgid "Type `%s -c \"help set\"' for more information about shell options.\n" +msgstr "" +"Skriv \"%s -c \"help set\"\" for at fÃ¥ mere information om skaltilvalg.\n" + +#: shell.c:1857 +#, c-format +msgid "Type `%s -c help' for more information about shell builtin commands.\n" +msgstr "" +"Skriv \"%s -c help\" for at fÃ¥ mere information om indbyggede " +"skalkommandoer.\n" + +#: shell.c:1858 +#, c-format +msgid "Use the `bashbug' command to report bugs.\n" +msgstr "Brug kommandoen \"bashbug\" til at rapportere fejl.\n" + +#: sig.c:691 +#, c-format +msgid "sigprocmask: %d: invalid operation" +msgstr "sigprocmask: %d: ugyldig handling" + +#: siglist.c:48 +msgid "Bogus signal" +msgstr "Falsk signal" + +#: siglist.c:51 +msgid "Hangup" +msgstr "Læg pÃ¥" + +#: siglist.c:55 +msgid "Interrupt" +msgstr "Afbryd" + +#: siglist.c:59 +msgid "Quit" +msgstr "Afslut" + +#: siglist.c:63 +msgid "Illegal instruction" +msgstr "Ugyldig instruktion" + +#: siglist.c:67 +msgid "BPT trace/trap" +msgstr "BPT-spor/fang" + +#: siglist.c:75 +msgid "ABORT instruction" +msgstr "ABORT-instruktion" + +#: siglist.c:79 +msgid "EMT instruction" +msgstr "EMT-instruktion" + +#: siglist.c:83 +msgid "Floating point exception" +msgstr "Kommatalsundtagelse" + +#: siglist.c:87 +msgid "Killed" +msgstr "SlÃ¥et ihjel" + +#: siglist.c:91 +msgid "Bus error" +msgstr "Bus-fejl" + +#: siglist.c:95 +msgid "Segmentation fault" +msgstr "Segmenteringsfejl" + +#: siglist.c:99 +msgid "Bad system call" +msgstr "Ugyldigt systemkald" + +#: siglist.c:103 +msgid "Broken pipe" +msgstr "Ødelagt datakanal" + +#: siglist.c:107 +msgid "Alarm clock" +msgstr "Alarmklokke" + +#: siglist.c:111 +msgid "Terminated" +msgstr "Afsluttet" + +#: siglist.c:115 +msgid "Urgent IO condition" +msgstr "Presserende IO-forhold" + +#: siglist.c:119 +msgid "Stopped (signal)" +msgstr "Stoppet (signal)" + +#: siglist.c:127 +msgid "Continue" +msgstr "Fortsæt" + +#: siglist.c:135 +msgid "Child death or stop" +msgstr "Død eller stop af underproces" + +#: siglist.c:139 +msgid "Stopped (tty input)" +msgstr "Stoppet (tty-input)" + +#: siglist.c:143 +msgid "Stopped (tty output)" +msgstr "Stoppet (tty-output)" + +#: siglist.c:147 +msgid "I/O ready" +msgstr "I/O klar" + +#: siglist.c:151 +msgid "CPU limit" +msgstr "CPU-grænse" + +#: siglist.c:155 +msgid "File limit" +msgstr "Filgrænse" + +#: siglist.c:159 +msgid "Alarm (virtual)" +msgstr "Alarm (virtuel)" + +#: siglist.c:163 +msgid "Alarm (profile)" +msgstr "Alarm (profil)" + +#: siglist.c:167 +msgid "Window changed" +msgstr "Vindue ændret" + +# I fejlrapport for at fÃ¥ meningen +#: siglist.c:171 +msgid "Record lock" +msgstr "Optag lÃ¥s" + +#: siglist.c:175 +msgid "User signal 1" +msgstr "Brugersignal 1" + +#: siglist.c:179 +msgid "User signal 2" +msgstr "Brugersignal 2" + +# Fejlrapport +#: siglist.c:183 +msgid "HFT input data pending" +msgstr "HFT-inputdata afventer" + +#: siglist.c:187 +msgid "power failure imminent" +msgstr "strømsvigt nært forestÃ¥ende" + +#: siglist.c:191 +msgid "system crash imminent" +msgstr "systemnedbrud nært forestÃ¥ende" + +#: siglist.c:195 +msgid "migrate process to another CPU" +msgstr "flyt proces til en anden CPU" + +#: siglist.c:199 +msgid "programming error" +msgstr "programmeringsfejl" + +#: siglist.c:203 +msgid "HFT monitor mode granted" +msgstr "HFT-skærmtilstand tildelt" + +#: siglist.c:207 +msgid "HFT monitor mode retracted" +msgstr "HFT-skærmtilstand trukket tilbage" + +#: siglist.c:211 +msgid "HFT sound sequence has completed" +msgstr "HFT-lydsekvens er afsluttet" + +#: siglist.c:215 +msgid "Information request" +msgstr "Informationsforespørgsel" + +#: siglist.c:223 +msgid "Unknown Signal #" +msgstr "Ukendt signal #" + +#: siglist.c:225 +#, c-format +msgid "Unknown Signal #%d" +msgstr "Ukendt signal #%d" + +#: subst.c:1362 subst.c:1520 +#, c-format +msgid "bad substitution: no closing `%s' in %s" +msgstr "dÃ¥rlig udskiftning: ingen lukkende \"%s\" i %s" + +#: subst.c:2847 +#, c-format +msgid "%s: cannot assign list to array member" +msgstr "%s: kan ikke tildele liste til arrayelementer" + +#: subst.c:5065 subst.c:5081 +msgid "cannot make pipe for process substitution" +msgstr "kan ikke lave datakanal (pipe) til procesudskiftning" + +#: subst.c:5113 +msgid "cannot make child for process substitution" +msgstr "kan ikke danne underproces til procesudskiftning" + +#: subst.c:5158 +#, c-format +msgid "cannot open named pipe %s for reading" +msgstr "kan ikke Ã¥bne navngiven datakanal (pipe) %s til læsning" + +#: subst.c:5160 +#, c-format +msgid "cannot open named pipe %s for writing" +msgstr "kan ikke Ã¥bne navngiven datakanal (pipe) %s til skrivning" + +#: subst.c:5178 +#, c-format +msgid "cannot duplicate named pipe %s as fd %d" +msgstr "kan ikke duplikere navngiven datakanal (pipe) %s som %d" + +#: subst.c:5376 +msgid "cannot make pipe for command substitution" +msgstr "kan ikke danne datakanal (pipe) til kommandoudskiftning" + +#: subst.c:5414 +msgid "cannot make child for command substitution" +msgstr "kan ikke danne underproces til kommandoudskiftning" + +#: subst.c:5433 +msgid "command_substitute: cannot duplicate pipe as fd 1" +msgstr "command_substitute: kan ikke duplikere datakanal (pipe) som fd 1" + +#: subst.c:5837 subst.c:8050 +#, fuzzy, c-format +msgid "%s: invalid variable name for name reference" +msgstr "%d: ugyldig filbeskrivelse: %s" + +#: subst.c:6048 +#, c-format +msgid "%s: parameter null or not set" +msgstr "%s: parameter null eller ikke indstillet" + +#: subst.c:6320 subst.c:6335 +#, c-format +msgid "%s: substring expression < 0" +msgstr "%s: understreng-udtryk < 0" + +#: subst.c:7506 +#, c-format +msgid "%s: bad substitution" +msgstr "%s: dÃ¥rlig udskiftning" + +#: subst.c:7583 +#, c-format +msgid "$%s: cannot assign in this way" +msgstr "$%s: kan ikke tildele pÃ¥ denne mÃ¥de" + +#: subst.c:7917 +msgid "" +"future versions of the shell will force evaluation as an arithmetic " +"substitution" +msgstr "" + +#: subst.c:8421 +#, c-format +msgid "bad substitution: no closing \"`\" in %s" +msgstr "dÃ¥rlig udskiftning: ingen lukkende \"`\" i %s" + +#: subst.c:9322 +#, c-format +msgid "no match: %s" +msgstr "intet match: %s" + +#: test.c:147 +msgid "argument expected" +msgstr "argument forventet" + +#: test.c:156 +#, c-format +msgid "%s: integer expression expected" +msgstr "%s: heltalsudtryk forventet" + +#: test.c:264 +msgid "`)' expected" +msgstr "\")\" forventet" + +#: test.c:266 +#, c-format +msgid "`)' expected, found %s" +msgstr "\")\" forventet, fandt %s" + +#: test.c:281 test.c:742 test.c:745 +#, c-format +msgid "%s: unary operator expected" +msgstr "%s: unær operator forventet" + +#: test.c:468 test.c:785 +#, c-format +msgid "%s: binary operator expected" +msgstr "%s: binær operator forventet" + +#: test.c:860 +msgid "missing `]'" +msgstr "manglende \"]\"" + +#: trap.c:217 +msgid "invalid signal number" +msgstr "ugyldigt signalnummer" + +#: trap.c:371 +#, c-format +msgid "run_pending_traps: bad value in trap_list[%d]: %p" +msgstr "run_pending_traps: dÃ¥rlig værdi i trap_list[%d]: %p" + +#: trap.c:375 +#, c-format +msgid "" +"run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" +msgstr "" +"run_pending_traps: signalhÃ¥ndtering er SIG_DFL, gensender %d (%s) til mig " +"selv" + +#: trap.c:428 +#, c-format +msgid "trap_handler: bad signal %d" +msgstr "trap_handler: ugyldigt signal %d" + +#: variables.c:382 +#, c-format +msgid "error importing function definition for `%s'" +msgstr "fejl under importering af funktionsdefinition for \"%s\"" + +#: variables.c:780 +#, c-format +msgid "shell level (%d) too high, resetting to 1" +msgstr "skalniveau (%d) for højt, genindstiller til 1" + +#: variables.c:1865 +#, fuzzy, c-format +msgid "%s: circular name reference" +msgstr "%d: ugyldig filbeskrivelse: %s" + +#: variables.c:2228 +msgid "make_local_variable: no function context at current scope" +msgstr "make_local_variable: ingen funktionskontekst ved nuværende navneomrÃ¥de" + +#: variables.c:2247 +#, fuzzy, c-format +msgid "%s: variable may not be assigned value" +msgstr "%s: kan ikke tildele liste til arrayelementer" + +#: variables.c:3646 +msgid "all_local_variables: no function context at current scope" +msgstr "all_local_variables: ingen funktionskontekst ved nuværende navneomrÃ¥de" + +#: variables.c:3891 +#, fuzzy, c-format +msgid "%s has null exportstr" +msgstr "%s: parameter null eller ikke indstillet" + +#: variables.c:3896 variables.c:3905 +#, c-format +msgid "invalid character %d in exportstr for %s" +msgstr "ugyldigt tegn %d i exportstr for %s" + +#: variables.c:3911 +#, c-format +msgid "no `=' in exportstr for %s" +msgstr "intet \"=\" i exportstr for %s" + +#: variables.c:4344 +msgid "pop_var_context: head of shell_variables not a function context" +msgstr "pop_var_context: hoved af shell_variables er ikke en funktionskontekst" + +#: variables.c:4357 +msgid "pop_var_context: no global_variables context" +msgstr "pop_var_context: ingen global_variables-kontekst" + +#: variables.c:4431 +msgid "pop_scope: head of shell_variables not a temporary environment scope" +msgstr "" +"pop_scope: hoved af shell_variables er ikke et midlertidigt miljønavnerum" + +#: variables.c:5257 +#, fuzzy, c-format +msgid "%s: %s: cannot open as FILE" +msgstr "%s: kan ikke Ã¥bne: %s" + +#: variables.c:5262 +#, fuzzy, c-format +msgid "%s: %s: invalid value for trace file descriptor" +msgstr "%d: ugyldig filbeskrivelse: %s" + +#: variables.c:5307 +#, fuzzy, c-format +msgid "%s: %s: compatibility value out of range" +msgstr "%s: %s udenfor rækkevidde" + +#: version.c:46 +#, fuzzy +msgid "Copyright (C) 2013 Free Software Foundation, Inc." +msgstr "Ophavsret (C) 2009 Free Software Foundation, Inc." + +#: version.c:47 version2.c:47 +msgid "" +"License GPLv3+: GNU GPL version 3 or later \n" +msgstr "" +"Licens GPLv3+: GNU GPL version 3 eller senere \n" + +#: version.c:86 version2.c:86 +#, c-format +msgid "GNU bash, version %s (%s)\n" +msgstr "GNU bash, version %s (%s)\n" + +#: version.c:91 version2.c:91 +#, fuzzy +msgid "This is free software; you are free to change and redistribute it." +msgstr "Dette er fri software; du kan frit ændre eller redistribuere det.\n" + +#: version.c:92 version2.c:92 +#, fuzzy +msgid "There is NO WARRANTY, to the extent permitted by law." +msgstr "Der er INGEN GARANTI i det omfang loven tillader.\n" + +#: version2.c:46 +#, fuzzy +msgid "Copyright (C) 2012 Free Software Foundation, Inc." +msgstr "Ophavsret (C) 2009 Free Software Foundation, Inc." + +#: xmalloc.c:91 +#, fuzzy, c-format +msgid "%s: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "xmalloc: kan ikke allokere %lu bytes (%lu bytes allokeret)" + +#: xmalloc.c:93 +#, fuzzy, c-format +msgid "%s: cannot allocate %lu bytes" +msgstr "xmalloc: kan ikke allokere %lu bytes" + +#: xmalloc.c:163 +#, fuzzy, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "xmalloc: %s:%d: kan ikke allokere %lu bytes (%lu bytes allokeret)" + +#: xmalloc.c:165 +#, fuzzy, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes" +msgstr "xmalloc: %s:%d: kan ikke allokere %lu bytes" + +#: builtins.c:43 +msgid "alias [-p] [name[=value] ... ]" +msgstr "alias [-p] [navn[=værdi] ... ]" + +#: builtins.c:47 +msgid "unalias [-a] name [name ...]" +msgstr "unalias [-a] navn [navn ...]" + +#: builtins.c:51 +#, fuzzy +msgid "" +"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-" +"x keyseq:shell-command] [keyseq:readline-function or readline-command]" +msgstr "" +"bind [-lpvsPVS] [-m tastetildeling] [-f filnavn] [-q navn] [-u navn] [-r " +"nøglesek] [-x nøglesek:skalkommando] [nøglesek:readline-funktion eller " +"readline-kommando]" + +#: builtins.c:54 +msgid "break [n]" +msgstr "break [n]" + +#: builtins.c:56 +msgid "continue [n]" +msgstr "continue [n]" + +#: builtins.c:58 +msgid "builtin [shell-builtin [arg ...]]" +msgstr "builtin [shell-builtin [arg ...]]" + +#: builtins.c:61 +msgid "caller [expr]" +msgstr "caller [expr]" + +#: builtins.c:64 +#, fuzzy +msgid "cd [-L|[-P [-e]] [-@]] [dir]" +msgstr "cd [-L|-P] [mappe]" + +#: builtins.c:66 +msgid "pwd [-LP]" +msgstr "pwd [-LP]" + +#: builtins.c:68 +msgid ":" +msgstr ":" + +#: builtins.c:70 +msgid "true" +msgstr "true" + +#: builtins.c:72 +msgid "false" +msgstr "false" + +#: builtins.c:74 +msgid "command [-pVv] command [arg ...]" +msgstr "command [-pVv] kommando [arg ...]" + +#: builtins.c:76 +#, fuzzy +msgid "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" +msgstr "declare [-aAfFilrtux] [-p] [navn[=værdi] ...]" + +#: builtins.c:78 +#, fuzzy +msgid "typeset [-aAfFgilrtux] [-p] name[=value] ..." +msgstr "typeset [-aAfFilrtux] [-p] navn[=værdi] ..." + +#: builtins.c:80 +msgid "local [option] name[=value] ..." +msgstr "local [tilvalg] navn[=værdi] ..." + +#: builtins.c:83 +msgid "echo [-neE] [arg ...]" +msgstr "echo [-neE] [arg ...]" + +#: builtins.c:87 +msgid "echo [-n] [arg ...]" +msgstr "echo [-n] [arg ...]" + +#: builtins.c:90 +msgid "enable [-a] [-dnps] [-f filename] [name ...]" +msgstr "enable [-a] [-dnps] [-f filnavn] [navn ...]" + +#: builtins.c:92 +msgid "eval [arg ...]" +msgstr "eval [arg ...]" + +#: builtins.c:94 +msgid "getopts optstring name [arg]" +msgstr "getopts tilvalgsstreng navn [arg]" + +#: builtins.c:96 +msgid "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" +msgstr "exec [-cl] [-a navn] [kommando [argumenter ...]] [videresendelse ...]" + +#: builtins.c:98 +msgid "exit [n]" +msgstr "exit [n]" + +#: builtins.c:100 +msgid "logout [n]" +msgstr "logout [n]" + +# pat=rep betyder højst sandsynligt mønster=regulært udtryk, men jeg kan ikke finde pÃ¥ nogen 3-bogstavsudtryk som jeg man bruge for de to ting, som jeg synes er let forstÃ¥elige derfor har jeg ladet dem stÃ¥ +#: builtins.c:103 +msgid "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" +msgstr "" +"fc [-e ename] [-lnr] [første] [sidste] eller fc -s [pat=rep] [kommando]" + +#: builtins.c:107 +msgid "fg [job_spec]" +msgstr "fg [job_spec]" + +#: builtins.c:111 +msgid "bg [job_spec ...]" +msgstr "bg [job_spec ...]" + +#: builtins.c:114 +msgid "hash [-lr] [-p pathname] [-dt] [name ...]" +msgstr "hash [-lr] [-p stinavn] [-dt] [navn ...]" + +#: builtins.c:117 +#, fuzzy +msgid "help [-dms] [pattern ...]" +msgstr "help [-ds] [mønster ...]" + +#: builtins.c:121 +msgid "" +"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg " +"[arg...]" +msgstr "" +"history [-c] [-d forskydning] [n] eller history -anrw [filnavn] eller " +"history -ps arg [arg...]" + +#: builtins.c:125 +msgid "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" +msgstr "jobs [-lnprs] [jobspec ...] eller jobs -x kommando [arger]" + +#: builtins.c:129 +msgid "disown [-h] [-ar] [jobspec ...]" +msgstr "disown [-h] [-ar] [jobspec ...]" + +#: builtins.c:132 +msgid "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l " +"[sigspec]" +msgstr "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... eller kill -l " +"[sigspec]" + +#: builtins.c:134 +msgid "let arg [arg ...]" +msgstr "let arg [arg ...]" + +#: builtins.c:136 +#, fuzzy +msgid "" +"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p " +"prompt] [-t timeout] [-u fd] [name ...]" +msgstr "" +"read [-ers] [-a array] [-d adskil] [-i tekst] [-n ntegn] [-p prompt] [-t " +"tidsgrænse] [-u fd] [navn ...]" + +#: builtins.c:138 +msgid "return [n]" +msgstr "return [n]" + +#: builtins.c:140 +#, fuzzy +msgid "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" +msgstr "set [--abefhkmnptuvxBCHP] [-o tilvalgsnavn] [arg ...]" + +#: builtins.c:142 +#, fuzzy +msgid "unset [-f] [-v] [-n] [name ...]" +msgstr "unset [-f] [-v] [navn ...]" + +#: builtins.c:144 +msgid "export [-fn] [name[=value] ...] or export -p" +msgstr "export [-fn] [navn[=værdi] ...] eller export -p" + +#: builtins.c:146 +#, fuzzy +msgid "readonly [-aAf] [name[=value] ...] or readonly -p" +msgstr "readonly [-af] [navn[=værdi] ...] eller readonly -p" + +#: builtins.c:148 +msgid "shift [n]" +msgstr "shift [n]" + +#: builtins.c:150 +msgid "source filename [arguments]" +msgstr "source filnavn [argumenter]" + +#: builtins.c:152 +msgid ". filename [arguments]" +msgstr ". filnavn [argumenter]" + +#: builtins.c:155 +msgid "suspend [-f]" +msgstr "suspend [-f]" + +#: builtins.c:158 +msgid "test [expr]" +msgstr "test [udtryk]" + +#: builtins.c:160 +msgid "[ arg... ]" +msgstr "[ arg... ]" + +#: builtins.c:162 +msgid "times" +msgstr "times" + +#: builtins.c:164 +msgid "trap [-lp] [[arg] signal_spec ...]" +msgstr "trap [-lp] [[arg] signal_spec ...]" + +#: builtins.c:166 +msgid "type [-afptP] name [name ...]" +msgstr "type [-afptP] navn [navn ...]" + +#: builtins.c:169 +#, fuzzy +msgid "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" +msgstr "ulimit [-SHacdefilmnpqrstuvx] [grænse]" + +#: builtins.c:172 +msgid "umask [-p] [-S] [mode]" +msgstr "umask [-p] [-S] [tilstand]" + +#: builtins.c:175 +#, fuzzy +msgid "wait [-n] [id ...]" +msgstr "wait [id]" + +#: builtins.c:179 +#, fuzzy +msgid "wait [pid ...]" +msgstr "wait [id]" + +#: builtins.c:182 +msgid "for NAME [in WORDS ... ] ; do COMMANDS; done" +msgstr "for NAVN [in ORD ... ] ; do KOMMANDOER; done" + +#: builtins.c:184 +msgid "for (( exp1; exp2; exp3 )); do COMMANDS; done" +msgstr "for (( udtryk1; udtryk2; udtryk3 )); do KOMMANDOER; done" + +#: builtins.c:186 +msgid "select NAME [in WORDS ... ;] do COMMANDS; done" +msgstr "select NAVN [in ORD ... ;] do KOMMANDOER; done" + +#: builtins.c:188 +msgid "time [-p] pipeline" +msgstr "time [-p] datakanal" + +#: builtins.c:190 +msgid "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" +msgstr "case ORD in [MØNSTER [| MØNSTER]...) KOMMANDOER ;;]... esac" + +#: builtins.c:192 +msgid "" +"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else " +"COMMANDS; ] fi" +msgstr "" +"if KOMMANDOER; then KOMMANDOER; [ elif KOMMANDOER; then KOMMANDOER; ]... " +"[ else KOMMANDOER; ] fi" + +#: builtins.c:194 +msgid "while COMMANDS; do COMMANDS; done" +msgstr "while KOMMANDOER; do KOMMANDOER; done" + +#: builtins.c:196 +msgid "until COMMANDS; do COMMANDS; done" +msgstr "until KOMMANDOER; do KOMMANDOER; done" + +#: builtins.c:198 +msgid "coproc [NAME] command [redirections]" +msgstr "coproc [NAVN] kommando [videresendelser]" + +#: builtins.c:200 +msgid "function name { COMMANDS ; } or name () { COMMANDS ; }" +msgstr "function navn { KOMMANDOER ; } eller navn () { KOMMANDOER ; }" + +#: builtins.c:202 +msgid "{ COMMANDS ; }" +msgstr "{ KOMMANDOER ; }" + +#: builtins.c:204 +msgid "job_spec [&]" +msgstr "job_spec [&]" + +#: builtins.c:206 +msgid "(( expression ))" +msgstr "(( udtryk ))" + +#: builtins.c:208 +msgid "[[ expression ]]" +msgstr "[[ udtryk ]]" + +#: builtins.c:210 +msgid "variables - Names and meanings of some shell variables" +msgstr "variables - Navn og betydning af nogle skalvariable" + +#: builtins.c:213 +msgid "pushd [-n] [+N | -N | dir]" +msgstr "pushd [-n] [+N | -N | mappe]" + +#: builtins.c:217 +msgid "popd [-n] [+N | -N]" +msgstr "popd [-n] [+N | -N]" + +#: builtins.c:221 +msgid "dirs [-clpv] [+N] [-N]" +msgstr "dirs [-clpv] [+N] [-N]" + +#: builtins.c:224 +msgid "shopt [-pqsu] [-o] [optname ...]" +msgstr "shopt [-pqsu] [-o] [indstnavn ...]" + +#: builtins.c:226 +msgid "printf [-v var] format [arguments]" +msgstr "printf [-v var] format [argumenter]" + +#: builtins.c:229 +#, fuzzy +msgid "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-" +"W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S " +"suffix] [name ...]" +msgstr "" +"complete [-abcdefgjksuv] [-pr] [-o valgmuligheder] [-A handling] [-G " +"globmønst] [-W ordliste] [-F funktion] [-C kommando] [-X filtermønst] [-P " +"præfiks] [-S suffiks] [navn ...]" + +#: builtins.c:233 +msgid "" +"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " +"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" +msgstr "" +"compgen [-abcdefgjksuv] [-o valgmuligheder] [-A handling] [-G globmønst] [-" +"W ordliste] [-F funktion] [-C kommando] [-X filtermønst] [-P præfiks] [-S " +"suffiks] [ord]" + +#: builtins.c:237 +#, fuzzy +msgid "compopt [-o|+o option] [-DE] [name ...]" +msgstr "compopt [-o|+o valgmulighed] [navn ...]" + +#: builtins.c:240 +msgid "" +"mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" +"mapfile [-n antal] [-O oprindelse] [-s antal] [-t] [-u fd] [-C tilbagekald] " +"[-c kvantum] [array]" + +#: builtins.c:242 +msgid "" +"readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" +"readarray [-n antal] [-O oprindelse] [-s antal] [-t] [-u fd] [-C " +"tilbagekald] [-c kvantum] [array]" + +#: builtins.c:254 +msgid "" +"Define or display aliases.\n" +" \n" +" Without arguments, `alias' prints the list of aliases in the reusable\n" +" form `alias NAME=VALUE' on standard output.\n" +" \n" +" Otherwise, an alias is defined for each NAME whose VALUE is given.\n" +" A trailing space in VALUE causes the next word to be checked for\n" +" alias substitution when the alias is expanded.\n" +" \n" +" Options:\n" +" -p\tPrint all defined aliases in a reusable format\n" +" \n" +" Exit Status:\n" +" alias returns true unless a NAME is supplied for which no alias has " +"been\n" +" defined." +msgstr "" +"Definer eller vis aliasser.\n" +" \n" +" Uden argumenter vil \"alias\" udskrive en liste af aliasser pÃ¥ den\n" +" genanvendelige form alias NAVN=VÆRDI til standardoutput.\n" +" \n" +" Ellers vil der blive defineret et alias for hvert NAVN, som der er an-\n" +" givet en VÆRDI til. Et efterfølgende mellemrum i VÆRDI vil medføre,\n" +" at det næste ord vil blive kontrolleret for alias-udskiftning, nÃ¥r\n" +" aliasset udvides.\n" +" \n" +" Tilvalg:\n" +" -p\tUdskriver alle definerede aliasser i et genanvendelig format\n" +" \n" +" Afslutningsstatus:\n" +" alias returnerer sand med mindre der gives et NAVN som der ikke er\n" +" defineret noget alias for." + +#: builtins.c:276 +msgid "" +"Remove each NAME from the list of defined aliases.\n" +" \n" +" Options:\n" +" -a\tremove all alias definitions.\n" +" \n" +" Return success unless a NAME is not an existing alias." +msgstr "" +"Fjern hvert NAVN fra listen af definerede aliasser.\n" +" \n" +" Tilvalg:\n" +" -a\tfjern alle aliasdefinitioner.\n" +" \n" +" Returner succes med mindre et NAVN ikke er et eksisterende alias." + +#: builtins.c:289 +#, fuzzy +msgid "" +"Set Readline key bindings and variables.\n" +" \n" +" Bind a key sequence to a Readline function or a macro, or set a\n" +" Readline variable. The non-option argument syntax is equivalent to\n" +" that found in ~/.inputrc, but must be passed as a single argument:\n" +" e.g., bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Options:\n" +" -m keymap Use KEYMAP as the keymap for the duration of this\n" +" command. Acceptable keymap names are emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" +"move,\n" +" vi-command, and vi-insert.\n" +" -l List names of functions.\n" +" -P List function names and bindings.\n" +" -p List functions and bindings in a form that can be\n" +" reused as input.\n" +" -S List key sequences that invoke macros and their " +"values\n" +" -s List key sequences that invoke macros and their " +"values\n" +" in a form that can be reused as input.\n" +" -V List variable names and values\n" +" -v List variable names and values in a form that can\n" +" be reused as input.\n" +" -q function-name Query about which keys invoke the named function.\n" +" -u function-name Unbind all keys which are bound to the named " +"function.\n" +" -r keyseq Remove the binding for KEYSEQ.\n" +" -f filename Read key bindings from FILENAME.\n" +" -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when\n" +" \t\t\t\tKEYSEQ is entered.\n" +" -X\t\t List key sequences bound with -x and associated commands\n" +" in a form that can be reused as input.\n" +" \n" +" Exit Status:\n" +" bind returns 0 unless an unrecognized option is given or an error occurs." +msgstr "" +"Indstil Readline-tastebindinger og variable.\n" +"\n" +" Bind en tastsekvens til en Readline-funktion eller en makro, eller " +"indstil\n" +" en Readline-variabel. Syntaksen uden tilvalg er ækvivalent til den som\n" +" bruges i ~/.inputrc, men skal gives som et enkelt argument:\n" +" f.eks. bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Tilvalg:\n" +" -m tastetildel Brug TASTETILDEL som tastetildeling for hele \n" +" varigheden af denne kommando. Accepterede " +"tastetildel-\n" +" ingsnavne er emacs, emacs-standard, emacs-meta,\n" +" emacs-ctlx, vi, vi-move, vi-command og vi-insert.\n" +" -l Vis liste af funktioner.\n" +" -P Vis liste af funktionsnavne og bindinger.\n" +" -p Vis liste af funktionsnavne og bindinger pÃ¥ en " +"form\n" +" som kan genbruges som input.\n" +" -S Vis tastesekvenser som udfører makroer og deres " +"værdier\n" +" -s Vis tastesekvenser som udfører makroer og deres " +"værdier\n" +" pÃ¥ en form som kan genbruges som inddata.<\n" +" -V Vis variabelnavne og -værdier\n" +" -v Vis variabelnavne og -værdier pÃ¥ en form som kan \n" +" genbruges som inddata.\n" +" -q funktionsnavn Forespørg hvilke taster der udfører den navngivne \n" +" funktion.\n" +" -u funktionsnavn Løsn alle taster som er bundet til den navngivne\n" +" funktion.\n" +" -r tastesekv Fjern bindingen for TASTESEKV.\n" +" -f filnavn Indlæs tastetildeling fra FILNAVN.\n" +" -x tastesekv:skalkommando\tMedfører at SKALKOMMANDO udføres nÃ¥r \n" +" \t\t\t\tTASTESEKV trykkes.\n" +" \n" +" Afslutningsstatus:\n" +" bind returnerer 0 med mindre et ugenkendt tilvalg angives, eller hvis " +"der\n" +" opstÃ¥r en fejl." + +#: builtins.c:328 +msgid "" +"Exit for, while, or until loops.\n" +" \n" +" Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n" +" loops.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Afslut for-, while- eller until-løkker.\n" +" \n" +" Afslut en FOR, WHILE eller UNTIL-løkke. Hvis N er angivet, afbrydes N\n" +" indlejrede løkker.\n" +" \n" +" Afslutningsstatus:\n" +" Afslutningsstatussen er 0 med mindre N ikke er større end eller lig med " +"1." + +#: builtins.c:340 +msgid "" +"Resume for, while, or until loops.\n" +" \n" +" Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n" +" If N is specified, resumes the Nth enclosing loop.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Genoptag for-, while- eller until-løkke.\n" +" \n" +" Genoptager den næste iteration af den omsluttende FOR-, WHILE- eller \n" +" UNTIL-løkke. Hvis N er angivet, genoptages fra den N'te indesluttende " +"løkke.\n" +" \n" +" Afslutningsstatus:\n" +" Afslutningsstatussen er 0 med mindre N ikke er større end eller lig med " +"1." + +#: builtins.c:352 +msgid "" +"Execute shell builtins.\n" +" \n" +" Execute SHELL-BUILTIN with arguments ARGs without performing command\n" +" lookup. This is useful when you wish to reimplement a shell builtin\n" +" as a shell function, but need to execute the builtin within the " +"function.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n" +" not a shell builtin.." +msgstr "" +"Eksekver en skal-indbygget funktion.\n" +" \n" +" Eksekver en SKAL-INDBYGGET med argumenterne ARGer uden at udføre " +"kommando-\n" +" opslag. Dette er nyttigt, hvis du ønsker et reimplementere en skal-\n" +" indbygget som en skalfunktion, men har brug for at eksekvere den " +"indbyggede\n" +" inden i funktionen.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer afslutningsstatussen for den SKAL-INDBYGGEDE, eller falsk " +"hvis\n" +" SKAL-INDBYGGET ikke er en skal-indbygget.." + +#: builtins.c:367 +msgid "" +"Return the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns \"$line $filename\". With EXPR, returns\n" +" \"$line $subroutine $filename\"; this extra information can be used to\n" +" provide a stack trace.\n" +" \n" +" The value of EXPR indicates how many call frames to go back before the\n" +" current one; the top frame is frame 0.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless the shell is not executing a shell function or EXPR\n" +" is invalid." +msgstr "" +"Returnerer konteksten af det nuværende underrutinekald.\n" +"\n" +" Uden UDTRYK returneres \"$line $filename\". Med UDTRYK returneres\n" +" \"$line $subroutine $filename\". Den ekstra information\n" +" kan bruges til at give at stakspor.\n" +"\n" +" Værdien af UDTRYK angiver hvor mange kalderammer der skal gÃ¥s tilbage\n" +" fra den nuværende. Toprammen er ramme 0.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer 0 med mindre skallen ikke eksekverer en skalfunktion eller " +"hvis\n" +" UDTRYK er ugyldigt." + +#: builtins.c:385 +#, fuzzy +msgid "" +"Change the shell working directory.\n" +" \n" +" Change the current directory to DIR. The default DIR is the value of " +"the\n" +" HOME shell variable.\n" +" \n" +" The variable CDPATH defines the search path for the directory " +"containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon " +"(:).\n" +" A null directory name is the same as the current directory. If DIR " +"begins\n" +" with a slash (/), then CDPATH is not used.\n" +" \n" +" If the directory is not found, and the shell option `cdable_vars' is " +"set,\n" +" the word is assumed to be a variable name. If that variable has a " +"value,\n" +" its value is used for DIR.\n" +" \n" +" Options:\n" +" -L\tforce symbolic links to be followed: resolve symbolic links in\n" +" \tDIR after processing instances of `..'\n" +" -P\tuse the physical directory structure without following symbolic\n" +" \tlinks: resolve symbolic links in DIR before processing instances\n" +" \tof `..'\n" +" -e\tif the -P option is supplied, and the current working directory\n" +" \tcannot be determined successfully, exit with a non-zero status\n" +" -@ on systems that support it, present a file with extended " +"attributes\n" +" as a directory containing the file attributes\n" +" \n" +" The default is to follow symbolic links, as if `-L' were specified.\n" +" `..' is processed by removing the immediately previous pathname " +"component\n" +" back to a slash or the beginning of DIR.\n" +" \n" +" Exit Status:\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully " +"when\n" +" -P is used; non-zero otherwise." +msgstr "" +"Ændrer skallens aktuelle mappe.\n" +" \n" +" Ændrer den nuværende mappe til MAPPE. Variablen HOME er standardmappen.\n" +" Variablen CDPATH definerer søgestien for mappen som indeholder DIR.\n" +" \n" +" Variablen CDPATH definerer søgestien for den mappe som indeholder " +"MAPPE.\n" +" Alternative mappenavne i CDPATH er separeret af et kolon (:). Et\n" +" null-mappenavn er det samme som den nuværende mappe. Hvis MAPPE " +"begynder\n" +" med en skrÃ¥streg (/) bruges CDPATH ikke.\n" +"\n" +" Hvis mappen ikke findes og skalvariablen \"cdabel_vars\" er indstillet,\n" +" vil det blive antaget at ordet er et variabelnavn. Hvis variablen har " +"en\n" +" værdi, sÃ¥ bruges denne som MAPPE.\n" +"\n" +" Tilvalg:\n" +" -L\tgennemtving at symbolske lænker følges\n" +" -P\tbrug den fysiske mappestruktur uden at følge symbolske lænker\n" +" \n" +" Som standard følges symbolske lænker, som om \"-L\" var valgt.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer 0 hvis mappen ændres, ellers noget forskellig fra 0." + +#: builtins.c:422 +msgid "" +"Print the name of the current working directory.\n" +" \n" +" Options:\n" +" -L\tprint the value of $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tprint the physical directory, without any symbolic links\n" +" \n" +" By default, `pwd' behaves as if `-L' were specified.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless an invalid option is given or the current directory\n" +" cannot be read." +msgstr "" +"Udskriver navnet for den aktuelle mappe.\n" +" \n" +" Tilvalg:\n" +" -L\tudskriv værdien af $PWD hvis den indeholder den aktuelle mappe\n" +" -P\tudskriv den fysiske mappe uden nogen symbolske lænker\n" +" \n" +" Som standard vil \"pwd\" opføre sig som om \"-L\" var angivet.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer 0 med mindre der er angivet et ugyldigt tilvalg, eller hvis " +"den\n" +" aktuelle mappe ikke kan læses." + +#: builtins.c:439 +msgid "" +"Null command.\n" +" \n" +" No effect; the command does nothing.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Null-kommando.\n" +" \n" +" Ingen effekt, kommandoen gør intet.\n" +" \n" +" Afslutningsstatus:\n" +" Afsluttes altid succesfuldt." + +#: builtins.c:450 +msgid "" +"Return a successful result.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Returnerer et succesfuldt resultat.\n" +" \n" +" Afslutningsstatus:\n" +" Afsluttes altid succesfuldt." + +#: builtins.c:459 +msgid "" +"Return an unsuccessful result.\n" +" \n" +" Exit Status:\n" +" Always fails." +msgstr "" +"Returnerer et mislykket resultat.\n" +" \n" +" Afslutningsstatus:\n" +" Afsluttes altid mislykket." + +#: builtins.c:468 +msgid "" +"Execute a simple command or display information about commands.\n" +" \n" +" Runs COMMAND with ARGS suppressing shell function lookup, or display\n" +" information about the specified COMMANDs. Can be used to invoke " +"commands\n" +" on disk when a function with the same name exists.\n" +" \n" +" Options:\n" +" -p\tuse a default value for PATH that is guaranteed to find all of\n" +" \tthe standard utilities\n" +" -v\tprint a description of COMMAND similar to the `type' builtin\n" +" -V\tprint a more verbose description of each COMMAND\n" +" \n" +" Exit Status:\n" +" Returns exit status of COMMAND, or failure if COMMAND is not found." +msgstr "" +"Eksekverer en simpel kommando eller viser information om kommandoer.\n" +" \n" +" Kører KOMMANDO med ARGer med undertrykkelse af skalfunktionsopslag, " +"eller\n" +" vis information om de angivne KOMMANDOER. Kan bruges til at køre " +"kommandoer\n" +" fra disken, nÃ¥r en funktion af samme navn eksisterer.\n" +" \n" +" Tilvalg:\n" +" -p\tbrug en standardværdi for PATH som med garanti vil finde alle\n" +" \tstandardværktøjerne\n" +" -v\tudskriv en beskrivelse af KOMMANDO, i stil med den skal-\n" +" \tindbyggede \"type\"\n" +" -V\tUdskriv en større beskrivelse af hver kommando\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer afslutningsstatus fra KOMMANDO eller mislykket hvis KOMMANDO\n" +" ikke findes." + +#: builtins.c:487 +#, fuzzy +msgid "" +"Set variable values and attributes.\n" +" \n" +" Declare variables and give them attributes. If no NAMEs are given,\n" +" display the attributes and values of all variables.\n" +" \n" +" Options:\n" +" -f\trestrict action or display to function names and definitions\n" +" -F\trestrict display to function names only (plus line number and\n" +" \tsource file when debugging)\n" +" -g\tcreate global variables when used in a shell function; otherwise\n" +" \tignored\n" +" -p\tdisplay the attributes and value of each NAME\n" +" \n" +" Options which set attributes:\n" +" -a\tto make NAMEs indexed arrays (if supported)\n" +" -A\tto make NAMEs associative arrays (if supported)\n" +" -i\tto make NAMEs have the `integer' attribute\n" +" -l\tto convert NAMEs to lower case on assignment\n" +" -n\tmake NAME a reference to the variable named by its value\n" +" -r\tto make NAMEs readonly\n" +" -t\tto make NAMEs have the `trace' attribute\n" +" -u\tto convert NAMEs to upper case on assignment\n" +" -x\tto make NAMEs export\n" +" \n" +" Using `+' instead of `-' turns off the given attribute.\n" +" \n" +" Variables with the integer attribute have arithmetic evaluation (see\n" +" the `let' command) performed when the variable is assigned a value.\n" +" \n" +" When used in a function, `declare' makes NAMEs local, as with the " +"`local'\n" +" command. The `-g' option suppresses this behavior.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or a variable\n" +" assignment error occurs." +msgstr "" +"Indstil variabelværdier og -attributter\n" +" \n" +" Erklær variable og giv dem attributter. Hvis der ikke angives nogen " +"NAVNE,\n" +" sÃ¥ angives attributter og værdier for alle variable.\n" +" \n" +" Tilvalg:\n" +" -f\tbegræns handling eller visning til funktionsnavne og\n" +" \tdefinitioner\n" +" -F\tbegræns visning til funktionsnavne (inklusive linjenummer og\n" +" \tkildekodefil under fejlsøgning)\n" +" -p\tvis attributter og værdi for hvert NAVN\n" +" \n" +" Tilvalg som indstiller attributter:\n" +" -a\tfor at gøre NAVNE til indekserede arrays (hvis understøttet)\n" +" -A\tfor at gøre NAVNE til associerede arrays (hvis understøttet)\n" +" -i\tfor at give NAVNE \"integer\"-attributten\n" +" -l\tkonverter NAVNE til smÃ¥ bogstaver ved tildeling\n" +" -t\tfor at give NAVNE \"trace\"-attributten\n" +" -u\tkonverter NAVNE til store bogstaver ved tildeling\n" +" -x\tfor at eksportere NAVNE\n" +" \n" +" Brug \"+\" i stedet for \"-\" for at slÃ¥ den pÃ¥gældende attribut fra.\n" +" \n" +" Der vil blive udført en aritmetisk evaluering (se \"let\"-kommandoen) " +"af \n" +" variable med integer-attributten, nÃ¥r de tildeles en værdi.\n" +" \n" +" NÃ¥r de bliver brugt i en funktion, kan \"declare\" bruges til at gøre " +"NAVNE\n" +" lokale, ligesom med \"local\"-kommandoen.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre der angives et ugyldigt tilvalg, eller " +"hvis\n" +" der opstÃ¥r en fejl." + +#: builtins.c:527 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Obsolete. See `help declare'." +msgstr "" +"Indstil variabelværdier og -attributter.\n" +" \n" +" Forældet. Læs i \"help declare\"." + +#: builtins.c:535 +#, fuzzy +msgid "" +"Define local variables.\n" +" \n" +" Create a local variable called NAME, and give it VALUE. OPTION can\n" +" be any option accepted by `declare'.\n" +" \n" +" Local variables can only be used within a function; they are visible\n" +" only to the function where they are defined and its children.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied, a variable\n" +" assignment error occurs, or the shell is not executing a function." +msgstr "" +"Definer lokale variable.\n" +" \n" +" Opret en lokal variabel med navnet NAVN og tildel den en værdi. TILVALG " +"kan\n" +" være alle tilvalg som accepteres af \"declare\".\n" +" \n" +" Lokale variable kan kun bruges inden i en funktion; de er kun synlige, " +"for\n" +" den funktion de er defineret i og dens underfunktioner.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre der angives et ugyldigt tilvalg, hvis der\n" +" opstÃ¥r en fejl, eller hvis skallen ikke eksekverer en funktion." + +#: builtins.c:552 +#, fuzzy +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs, separated by a single space character and followed by " +"a\n" +" newline, on the standard output.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" -e\tenable interpretation of the following backslash escapes\n" +" -E\texplicitly suppress interpretation of backslash escapes\n" +" \n" +" `echo' interprets the following backslash-escaped characters:\n" +" \\a\talert (bell)\n" +" \\b\tbackspace\n" +" \\c\tsuppress further output\n" +" \\e\tescape character\n" +" \\E\tescape character\n" +" \\f\tform feed\n" +" \\n\tnew line\n" +" \\r\tcarriage return\n" +" \\t\thorizontal tab\n" +" \\v\tvertical tab\n" +" \\\\\tbackslash\n" +" \\0nnn\tthe character whose ASCII code is NNN (octal). NNN can be\n" +" \t0 to 3 octal digits\n" +" \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" +" \tcan be one or two hex digits\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Skriv argumenter til standardoutput.\n" +" \n" +" Vis ARGer fra standardoutput, efterfulgt af et nylinjetegn.\n" +" \n" +" Tilvalg:\n" +" -n vedhæft ikke nylinjetegn\n" +" -e aktiver fortolkning af de følgende undvigesekvenser med\n" +" omvendt skrÃ¥streg\n" +" -E\tundertryk eksplicit fortolkningen af undvigesekvenser med\n" +" \tomvendt skrÃ¥streg\n" +"\n" +" \"echo\" fortolker følgende undvigesekvenser med omvendt skrÃ¥streg\n" +" \\a\talarm (klokke)\n" +" \\b\ttilbageryk (backspace)\n" +" \\c\tundertryk yderligere output\n" +" \\e\tescape-tegn\n" +" \\f\tsideskift (form feed)\n" +" \\n\tny linje\n" +" \\r\tlinjeskift (carrige return)\n" +" \\t\thorisontalt tab\n" +" \\v\tvertikalt tab\n" +" \\\\\tomvendt skrÃ¥streg\n" +" \\0nnn\tdet tegn hvis ASCII-kode er NNN (oktalt). NNN kan have 0-3\n" +" \toktale cifre\n" +" \\xHH\tdet 8 bit tegn hvis værdi er HH (heksadecimalt). HH kan have\n" +" \tet eller to heksadecimale cifre\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre der opstÃ¥r en skrivefejl." + +#: builtins.c:588 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs on the standard output followed by a newline.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Skriv argumenter til standardoutput.\n" +" \n" +" Vis ARGer til standard output, efterfulgt af et nylinjetegn.\n" +" \n" +" Tilvalg:\n" +" -n\tvedhæft ikke et nylinjetegn\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre der opstÃ¥r en skrivefejl." + +#: builtins.c:603 +msgid "" +"Enable and disable shell builtins.\n" +" \n" +" Enables and disables builtin shell commands. Disabling allows you to\n" +" execute a disk command which has the same name as a shell builtin\n" +" without using a full pathname.\n" +" \n" +" Options:\n" +" -a\tprint a list of builtins showing whether or not each is enabled\n" +" -n\tdisable each NAME or display a list of disabled builtins\n" +" -p\tprint the list of builtins in a reusable format\n" +" -s\tprint only the names of Posix `special' builtins\n" +" \n" +" Options controlling dynamic loading:\n" +" -f\tLoad builtin NAME from shared object FILENAME\n" +" -d\tRemove a builtin loaded with -f\n" +" \n" +" Without options, each NAME is enabled.\n" +" \n" +" To use the `test' found in $PATH instead of the shell builtin\n" +" version, type `enable -n test'.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not a shell builtin or an error occurs." +msgstr "" +"Aktiver og deaktiver skal-indbyggede.\n" +" \n" +" Aktiverer og deaktiverer indbyggede skalkommandoer. Deaktivering " +"tillader\n" +" dig at udføre diskkommandoer, som har det sammen navn som en skal-" +"indbygget\n" +" uden at bruge et fuldt stinavn.\n" +" \n" +" Tilvalg:\n" +" -a\tudskriver en liste over indbyggede, uanset om de er slÃ¥et til\n" +" -n\tdeaktiver hvert NAVN eller vis en liste af deaktiverede funk-\n" +" \ttioner\n" +" -p\tudskriv en liste over indbyggede i et genanvendeligt format\n" +" -s\tudskriv kun navne for \"specielle\" Posix-indbyggede\n" +" \n" +" Tilvalg som kontrollerer dynamisk indlæsning:\n" +" -f\tIndlæs indbygget NAVN fra det delte objekt FILNAVN\n" +" -d\tFjern en indbygget indlæst med -f\n" +" \n" +" Uden tilvalg bliver hvert NAVN aktiveret. \n" +" \n" +" Skriv \"enable -n test\" for at bruge den \"test\" som findes i $PATH, i " +"stedet\n" +" for den indbyggede version.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre NAVN ikke er en skal-indbygget eller hvis\n" +" der opstÃ¥r en fejl." + +#: builtins.c:631 +msgid "" +"Execute arguments as a shell command.\n" +" \n" +" Combine ARGs into a single string, use the result as input to the " +"shell,\n" +" and execute the resulting commands.\n" +" \n" +" Exit Status:\n" +" Returns exit status of command or success if command is null." +msgstr "" +"Eksekver argumenter som en skalkommando.\n" +" \n" +" Kombinerer ARGer til en enkelt streng, brug resultatet som input til " +"skallen\n" +" og udfør den resulterende kommando.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer kommandoens afslutningsstatus eller succes hvis kommandoen " +"er\n" +" null." + +#: builtins.c:643 +msgid "" +"Parse option arguments.\n" +" \n" +" Getopts is used by shell procedures to parse positional parameters\n" +" as options.\n" +" \n" +" OPTSTRING contains the option letters to be recognized; if a letter\n" +" is followed by a colon, the option is expected to have an argument,\n" +" which should be separated from it by white space.\n" +" \n" +" Each time it is invoked, getopts will place the next option in the\n" +" shell variable $name, initializing name if it does not exist, and\n" +" the index of the next argument to be processed into the shell\n" +" variable OPTIND. OPTIND is initialized to 1 each time the shell or\n" +" a shell script is invoked. When an option requires an argument,\n" +" getopts places that argument into the shell variable OPTARG.\n" +" \n" +" getopts reports errors in one of two ways. If the first character\n" +" of OPTSTRING is a colon, getopts uses silent error reporting. In\n" +" this mode, no error messages are printed. If an invalid option is\n" +" seen, getopts places the option character found into OPTARG. If a\n" +" required argument is not found, getopts places a ':' into NAME and\n" +" sets OPTARG to the option character found. If getopts is not in\n" +" silent mode, and an invalid option is seen, getopts places '?' into\n" +" NAME and unsets OPTARG. If a required argument is not found, a '?'\n" +" is placed in NAME, OPTARG is unset, and a diagnostic message is\n" +" printed.\n" +" \n" +" If the shell variable OPTERR has the value 0, getopts disables the\n" +" printing of error messages, even if the first character of\n" +" OPTSTRING is not a colon. OPTERR has the value 1 by default.\n" +" \n" +" Getopts normally parses the positional parameters ($0 - $9), but if\n" +" more arguments are given, they are parsed instead.\n" +" \n" +" Exit Status:\n" +" Returns success if an option is found; fails if the end of options is\n" +" encountered or an error occurs." +msgstr "" +"Fortolkning af tilvalgsargumenter\n" +" \n" +" Getopts bruges af skalprocedurer til at tolke positionsparametre og\n" +" tilvalg.\n" +" \n" +" OPTSTRING indeholder de tilvalg, som skal genkendes. Hvis et bogstav\n" +" følges af et kolon, forventes det at tilvalget har et argument, som\n" +" skal adskilles fra tilvalget med et mellemrum.\n" +" \n" +" Hver gang getopts kaldes, vil den placere det næste tilvalg i skal-\n" +" variablen $name, og initialisere $name, hvis den ikke eksisterer, og\n" +" putte indekset for det næste argument, som skal behandles, ind i\n" +" skalvariablen OPTIND. OPTIND initialiseres til 1 hver gang skallen\n" +" eller et skalskript kaldes. Hvis tilvalget kræver et argument, vil\n" +" getopts placere argumentet i skalvariablen OPTARG.\n" +" \n" +" getopts rapporterer fejl pÃ¥ en af to forskellige mÃ¥der. Hvis det\n" +" første tegn i OPTSTRENG er et kolon, vil getopts bruge stille fejl-\n" +" rapportering. I denne tilstand vil fejlbeskeder ikke blive\n" +" udskrevet. Hvis der angives et ugyldigt tilvalg, vil getopts placere\n" +" tilvalgstegnet i OPTARG. Hvis et pÃ¥krævet argument ikke bliver\n" +" fundet, vil getopts placere et \":\" i NAVN og sætte OPTARG til det\n" +" fundne tilvalgstegn. Hvis getopts ikke er i stille tilstand og der\n" +" angives et ugyldigt tilvalg, vil getopts placere \"?\" i NAVN og\n" +" fjerne (unset) OPTARG. Hvis et pÃ¥krævet argument ikke findes, vil\n" +" der blive placeret et \"?\" i NAVN og OPTARG vil blive fjernet\n" +" (unset) og en diagnosebesked vil blive udskrevet.\n" +" \n" +" Hvis skalvariablen OPTERR har værdien 0, vil udskrivningen af fejl-\n" +" beskeder blive slÃ¥et fra i getopts, ogsÃ¥ selv om det første tegn i\n" +" OPTSTRING ikke er et kolon. OPTERR har værdien 1 som standard.\n" +" \n" +" Normalt vil getopts tolke de positionelle parametre ($0 - $9), men\n" +" hvis der angives flere argumenter end dette, vil de blive tolket i\n" +" stedet for.\n" +" \n" +" Afslutningsstatus\n" +" Returnerer succes hvis et tilvalg findes, fejler hvis afslutningen\n" +" af tilvalgene nÃ¥s eller hvis der opstÃ¥r en fejl." + +#: builtins.c:685 +msgid "" +"Replace the shell with the given command.\n" +" \n" +" Execute COMMAND, replacing this shell with the specified program.\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not " +"specified,\n" +" any redirections take effect in the current shell.\n" +" \n" +" Options:\n" +" -a name\tpass NAME as the zeroth argument to COMMAND\n" +" -c\t\texecute COMMAND with an empty environment\n" +" -l\t\tplace a dash in the zeroth argument to COMMAND\n" +" \n" +" If the command cannot be executed, a non-interactive shell exits, " +"unless\n" +" the shell option `execfail' is set.\n" +" \n" +" Exit Status:\n" +" Returns success unless COMMAND is not found or a redirection error " +"occurs." +msgstr "" +"Erstat skallen med den angivne kommando.\n" +" \n" +" Eksekver KOMMANDO og erstat derved skallen med det angivne program.\n" +" ARGUMENTER bliver argumenter til KOMMANDO. Hvis KOMMANDO ikke angives " +"vil\n" +" alle omdirigeringer træde i kraft i den aktuelle skal.\n" +" \n" +" Tilvalg:\n" +" -a\tnavn\tangiv NAVN som det nulte argument til KOMMANDO\n" +" -c\t\teksekver KOMMANDO i et tomt miljø\n" +" -l\t\tbrug en bindestreg som det nulte argument til KOMMANDO\n" +" \n" +" Hvis kommandoen ikke kan eksekveres, vil ikke-interaktive skaller " +"afsluttes,\n" +" med mindre skal-tilvalget \"execfail\" angives\n" +" \n" +" Afslutningsstatus:\n" +" Afsluttes succesfuldt med mindre KOMMANDO ikke kan findes, eller hvis " +"der\n" +" opstÃ¥r en omdirigeringsfejl." + +#: builtins.c:706 +msgid "" +"Exit the shell.\n" +" \n" +" Exits the shell with a status of N. If N is omitted, the exit status\n" +" is that of the last command executed." +msgstr "" +"Afslut skallen.\n" +" \n" +" Afslut skallen med status N. Hvis N udelades vil afslutningsstatus\n" +" blive den samme som sidst eksekverede kommando." + +#: builtins.c:715 +msgid "" +"Exit a login shell.\n" +" \n" +" Exits a login shell with exit status N. Returns an error if not " +"executed\n" +" in a login shell." +msgstr "" +"Afslut en logindskal.\n" +" \n" +" Afslutter en logindskal med afslutningsstatus N. Returnerer en fejl, " +"hvis\n" +" den ikke eksekveres i en logindskal." + +#: builtins.c:725 +msgid "" +"Display or execute commands from the history list.\n" +" \n" +" fc is used to list or edit and re-execute commands from the history " +"list.\n" +" FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" +" string, which means the most recent command beginning with that\n" +" string.\n" +" \n" +" Options:\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then " +"EDITOR,\n" +" \t\tthen vi\n" +" -l \tlist lines instead of editing\n" +" -n\tomit line numbers when listing\n" +" -r\treverse the order of the lines (newest listed first)\n" +" \n" +" With the `fc -s [pat=rep ...] [command]' format, COMMAND is\n" +" re-executed after the substitution OLD=NEW is performed.\n" +" \n" +" A useful alias to use with this is r='fc -s', so that typing `r cc'\n" +" runs the last command beginning with `cc' and typing `r' re-executes\n" +" the last command.\n" +" \n" +" Exit Status:\n" +" Returns success or status of executed command; non-zero if an error " +"occurs." +msgstr "" +"Vis og eksekver kommandoer fra historiklisten.\n" +" \n" +" fc bruges til at vise, redigere og geneksekvere kommandoer fra " +"historikken.\n" +" FØRSTE og SIDSTE kan være numre som specificerer et interval, eller " +"FØRSTE\n" +" kan være en streng, hvilket vil resultere i den nyeste kommando som\n" +" begynder med den streng.\n" +" \n" +" Tilvalg: \n" +" -e ENAVN\tvælger hvilket tekstredigeringsprogram, der vil bliver " +"brugt.\n" +" Forvalget er FCEDIT, herefter EDITOR og til sidst \"vi\".\n" +" -l \tbetyder vis linjer i stedet for at redigere dem.\n" +" -n\tbetyder at linjenumre ikke vises.\n" +" -r\tbetyder at rækkefølgen af linjer vendes (sÃ¥ nye er først).\n" +" \n" +" Med \"fc -s [pat=rep ...] [command]\"-formatet vil kommandoen blive " +"gen-\n" +" eksekveret efter substitutionen GAMMEL=NY er foretaget.\n" +" \n" +" Et nyttigt alias er r=\\\"fc -s\\\", som vil medføre at den sidste " +"kommando\n" +" der begynder med \\\"cc\\\" vil afvikles, nÃ¥r der skrives \\\"r cc\\\", " +"og at\n" +" den seneste kommando afvikles, nÃ¥r der skrives \\\"r\\\".\n" +"\n" +" Afslutningsstatus.\n" +" Returnerer succes eller status af den eksekverede kommando, ikke-nul " +"hvis\n" +" der opstod en fejl." + +#: builtins.c:755 +msgid "" +"Move job to the foreground.\n" +" \n" +" Place the job identified by JOB_SPEC in the foreground, making it the\n" +" current job. If JOB_SPEC is not present, the shell's notion of the\n" +" current job is used.\n" +" \n" +" Exit Status:\n" +" Status of command placed in foreground, or failure if an error occurs." +msgstr "" +"Flyt jobs til forgrunden.\n" +" \n" +" Placer JOB_SPEC i forgrunden og gør det til det aktuelle job. Hvis\n" +" JOB_SPEC ikke findes, vil skallens opfattelse af, hvad der er det " +"nuværende\n" +" job, blive brugt.\n" +" \n" +" Afslutningsstatus:\n" +" Status af den kommando der placeres i forgrunden eller mislykket hvis " +"der\n" +" opstÃ¥r fejl." + +#: builtins.c:770 +msgid "" +"Move jobs to the background.\n" +" \n" +" Place the jobs identified by each JOB_SPEC in the background, as if " +"they\n" +" had been started with `&'. If JOB_SPEC is not present, the shell's " +"notion\n" +" of the current job is used.\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Flyt jobs til baggrunden\n" +" \n" +" Placer hvert enkelt JOB_SPEC i baggrunden, som om de var startet med \n" +" \"&\". Hvis JOB_SPEC ikke findes, vil skallen opfattelse af, hvad der " +"er\n" +" det nuværende job, blive brugt.\n" +" \n" +" Afslutningsstatus:\n" +" Afsluttes succesfuldt medmindre jobkontrol ikke er slÃ¥et til, eller " +"hvis\n" +" der opstÃ¥r en fejl." + +#: builtins.c:784 +#, fuzzy +msgid "" +"Remember or display program locations.\n" +" \n" +" Determine and remember the full pathname of each command NAME. If\n" +" no arguments are given, information about remembered commands is " +"displayed.\n" +" \n" +" Options:\n" +" -d\t\tforget the remembered location of each NAME\n" +" -l\t\tdisplay in a format that may be reused as input\n" +" -p pathname\tuse PATHNAME as the full pathname of NAME\n" +" -r\t\tforget all remembered locations\n" +" -t\t\tprint the remembered location of each NAME, preceding\n" +" \t\teach location with the corresponding NAME if multiple\n" +" \t\tNAMEs are given\n" +" Arguments:\n" +" NAME\t\tEach NAME is searched for in $PATH and added to the list\n" +" \t\tof remembered commands.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not found or an invalid option is given." +msgstr "" +"Husk og vis programplaceringer.\n" +" \n" +" Afgør og husker det fulde stinavn for hver kommando-NAVN. Hvis der ikke\n" +" gives noget argument, vil information om huskede kommandoer blive vist.\n" +" \n" +" Tilvalg:\n" +" -d\t\tglem den huskede placering for hvert NAVN\n" +" -l\t\tvis i et format som kan genanvendes\n" +" -p stinavn\tbrug STINAVN som det fulde stinavn for NAVN\n" +" -r\t\tglem alle huskede placeringer\n" +" -t\t\tudskriv den huskede placering for hvert NAVN, med NAVNet\n" +" \t\tudskrevet foran placeringen hvis flere NAVNe er angivet.\n" +" Argumenter:\n" +" NAVN\t\tDer søges efter hvert navn i $PATH og de tilføjes til\n" +" \t\tlisten af huskede kommandoer.\n" +" \n" +" Afslutningsstatus:\n" +" Afsluttes succesfuldt med mindre NAVN ikke kan findes, eller hvis der " +"angives\n" +" et ugyldig tilvalg." + +#: builtins.c:809 +msgid "" +"Display information about builtin commands.\n" +" \n" +" Displays brief summaries of builtin commands. If PATTERN is\n" +" specified, gives detailed help on all commands matching PATTERN,\n" +" otherwise the list of help topics is printed.\n" +" \n" +" Options:\n" +" -d\toutput short description for each topic\n" +" -m\tdisplay usage in pseudo-manpage format\n" +" -s\toutput only a short usage synopsis for each topic matching\n" +" \tPATTERN\n" +" \n" +" Arguments:\n" +" PATTERN\tPattern specifiying a help topic\n" +" \n" +" Exit Status:\n" +" Returns success unless PATTERN is not found or an invalid option is " +"given." +msgstr "" +"Vis information om indbyggede kommandoer.\n" +" \n" +" Viser korte sammendrag om indbyggede kommandoer. Hvis MØNSTER er " +"angivet,\n" +" vil der blive givet en detaljeret hjælp, om alle de kommandoer som " +"matcher\n" +" MØNSTER, ellers vil der blive udskrevet en liste over hjælpeemner.\n" +" \n" +" Tilvalg:\n" +" -d\tudskriver kort beskrivelse for hvert emne\n" +" -m\tviser brugsinformation i pseudo-mansideformat\n" +" -s\tvis kun en kort synopsis for hvert emne som matcher MØNSTER\n" +" \n" +" Argumenter:\n" +" MØNSTER\tMønster som specificerer et hjælpeemne\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre MØNSTER ikke kan findes, eller hvis der\n" +" angives et ugyldigt tilvalg." + +#: builtins.c:833 +msgid "" +"Display or manipulate the history list.\n" +" \n" +" Display the history list with line numbers, prefixing each modified\n" +" entry with a `*'. An argument of N lists only the last N entries.\n" +" \n" +" Options:\n" +" -c\tclear the history list by deleting all of the entries\n" +" -d offset\tdelete the history entry at offset OFFSET.\n" +" \n" +" -a\tappend history lines from this session to the history file\n" +" -n\tread all history lines not already read from the history file\n" +" -r\tread the history file and append the contents to the history\n" +" \tlist\n" +" -w\twrite the current history to the history file\n" +" \tand append them to the history list\n" +" \n" +" -p\tperform history expansion on each ARG and display the result\n" +" \twithout storing it in the history list\n" +" -s\tappend the ARGs to the history list as a single entry\n" +" \n" +" If FILENAME is given, it is used as the history file. Otherwise,\n" +" if $HISTFILE has a value, that is used, else ~/.bash_history.\n" +" \n" +" If the $HISTTIMEFORMAT variable is set and not null, its value is used\n" +" as a format string for strftime(3) to print the time stamp associated\n" +" with each displayed history entry. No time stamps are printed " +"otherwise.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" +"Vis eller manipuler med historiklisten.\n" +"\n" +" Vis historikken med linjenumre. Linjer som vises med \"*\" er blevet\n" +" ændret. Argumentet N gør at kun de N sidste linjer bliver vist.\n" +" \n" +" Tilvalg:\n" +" -c\trydder historiklisten ved at slette alle elementer i den.\n" +" -d forskydning\tsletter historik-elementet ved position FORSKYDNING.\n" +" -a\tvedhæfter historiklinjer fra denne session til historikfilen.\n" +" -n\tindlæser alle linjer fra historikfilen, som ikke allerede er\n" +" \tindlæst\n" +" -r\tindlæser historikfilen og føjer dens indhold til historiklisten\n" +" -w\tskriver den nuværende historik til historikfilen og vedhæft dem\n" +" \ttil historiklisten\n" +" \n" +" -p\tudfør en historikudvidelse pÃ¥ hvert enkelt ARG og udskriv\n" +" \tresultatet uden at tilføje det til historikken\n" +" -s\tvedhæft ARGer til historiklisten som et enkelt element\n" +" \n" +" Hvis FILENAVN er angivet, vil den blive brugt som historikfil,\n" +" ellers vil $HISTFILE blive brugt, hvis den har en værdi og ellers\n" +" vil ~/.bash_history blive brugt.\n" +" \n" +" Hvis variablen $HISTTIMEFORMAT er indstillet og ikke er \"null\", vil " +"dens\n" +" værdi blive brugt som formatstreng til strftime(3) til formatering af\n" +" tidspunkt for hvert historikelement. Ellers vil ingen tidsstempler " +"blive\n" +" skrevet.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre der er angivet et ugyldig tilvalg, eller " +"hvis\n" +" der opstÃ¥r en fejl." + +#: builtins.c:869 +#, fuzzy +msgid "" +"Display status of jobs.\n" +" \n" +" Lists the active jobs. JOBSPEC restricts output to that job.\n" +" Without options, the status of all active jobs is displayed.\n" +" \n" +" Options:\n" +" -l\tlists process IDs in addition to the normal information\n" +" -n\tlists only processes that have changed status since the last\n" +" \tnotification\n" +" -p\tlists process IDs only\n" +" -r\trestrict output to running jobs\n" +" -s\trestrict output to stopped jobs\n" +" \n" +" If -x is supplied, COMMAND is run after all job specifications that\n" +" appear in ARGS have been replaced with the process ID of that job's\n" +" process group leader.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs.\n" +" If -x is used, returns the exit status of COMMAND." +msgstr "" +"Viser status af jobs.\n" +" \n" +" Viser de aktive jobs. JOBSPEC begrænser output til dette job. Uden " +"tilvalg\n" +" vil status for alle aktive jobs blive vist.\n" +" \n" +" Tilvalg:\n" +" \n" +" -l\tvis ogsÃ¥ proces-id'er ud over den normale information\n" +" -n\tviser kun de processer, som har ændret status siden sidste\n" +" \tpÃ¥mindelse\n" +" -p\tviser udelukkende proces-id'er\n" +" -r\tbegrænser uddata til kørende jobs\n" +" -s\tbegrænser uddata til stoppede jobs\n" +" \n" +" Hvis -x er givet, vil KOMMANDO blive kørt efter at alle " +"jobspecifikationer\n" +" som stÃ¥r i ARGer er blevet erstattet med proces-id'et for dette jobs " +"proces-\n" +" gruppeleder.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre et ugyldigt tilvalg er angivet, eller hvis " +"der\n" +" opstÃ¥r en fejl. Hvis -x bruges returneres afslutningsstatus for KOMMANDO." + +#: builtins.c:896 +msgid "" +"Remove jobs from current shell.\n" +" \n" +" Removes each JOBSPEC argument from the table of active jobs. Without\n" +" any JOBSPECs, the shell uses its notion of the current job.\n" +" \n" +" Options:\n" +" -a\tremove all jobs if JOBSPEC is not supplied\n" +" -h\tmark each JOBSPEC so that SIGHUP is not sent to the job if the\n" +" \tshell receives a SIGHUP\n" +" -r\tremove only running jobs\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option or JOBSPEC is given." +msgstr "" +"Fjern jobs fra den aktuelle skal.\n" +" \n" +" Fjerner hvert JOBSPEC-argument, fra tabellen over aktive jobs. Hvis der " +"ikke\n" +" angives nogen JOBSPEC bruges skallens opfattelse af det aktuelle job.\n" +" \n" +" Tilvalg:\n" +" -a\tfjern alle jobs hvis JOBSPEC ikke er angivet\n" +" -h\tmarker hvert JOBSPEC sÃ¥ledes at SIGHUP ikke sendes til jobbet\n" +" \thvis skallen modtager SIGHUP\n" +" -r\tfjern kun kørende jobs\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre et ugyldigt tilvalg eller JOBSPEC angives." + +#: builtins.c:915 +msgid "" +"Send a signal to a job.\n" +" \n" +" Send the processes identified by PID or JOBSPEC the signal named by\n" +" SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n" +" SIGTERM is assumed.\n" +" \n" +" Options:\n" +" -s sig\tSIG is a signal name\n" +" -n sig\tSIG is a signal number\n" +" -l\tlist the signal names; if arguments follow `-l' they are\n" +" \tassumed to be signal numbers for which names should be listed\n" +" \n" +" Kill is a shell builtin for two reasons: it allows job IDs to be used\n" +" instead of process IDs, and allows processes to be killed if the limit\n" +" on processes that you can create is reached.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" +"Send et signal til et job.\n" +" \n" +" Send signalet SIGSPEC eller SIGNUM til processen, som er angivet ved " +"PID\n" +" eller JOBSPEC. Hvis hverken SIGSPEC eller SIGNUM er angivet antages " +"SIGTERM.\n" +" \n" +" -s sig\tSIG er et signalnavn\n" +" -n sig\tSIG er et signalnummer\n" +" -l\tudskriver signalnavnene. Hvis der stÃ¥r argumenter efter \"-l\",\n" +" \tantages det, at de er signalnumre hvis tilhørende signalnavne skal\n" +" udskrives.\n" +" \n" +" Der er to grunde til at kill er en indbygget skal-kommando: Det " +"tillader\n" +" at der kan bruges job-id'er i stedet for proces-id'er og tillader at " +"stoppe\n" +" processer, selvom du har nÃ¥et grænsen for, hvor mange processer du\n" +" kan oprette.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre et ugyldigt tilvalg er angivet, eller hvis " +"der\n" +" opstÃ¥r en fejl." + +#: builtins.c:938 +#, fuzzy +msgid "" +"Evaluate arithmetic expressions.\n" +" \n" +" Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" +" fixed-width integers with no check for overflow, though division by 0\n" +" is trapped and flagged as an error. The following list of operators is\n" +" grouped into levels of equal-precedence operators. The levels are " +"listed\n" +" in order of decreasing precedence.\n" +" \n" +" \tid++, id--\tvariable post-increment, post-decrement\n" +" \t++id, --id\tvariable pre-increment, pre-decrement\n" +" \t-, +\t\tunary minus, plus\n" +" \t!, ~\t\tlogical and bitwise negation\n" +" \t**\t\texponentiation\n" +" \t*, /, %\t\tmultiplication, division, remainder\n" +" \t+, -\t\taddition, subtraction\n" +" \t<<, >>\t\tleft and right bitwise shifts\n" +" \t<=, >=, <, >\tcomparison\n" +" \t==, !=\t\tequality, inequality\n" +" \t&\t\tbitwise AND\n" +" \t^\t\tbitwise XOR\n" +" \t|\t\tbitwise OR\n" +" \t&&\t\tlogical AND\n" +" \t||\t\tlogical OR\n" +" \texpr ? expr : expr\n" +" \t\t\tconditional operator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tassignment\n" +" \n" +" Shell variables are allowed as operands. The name of the variable\n" +" is replaced by its value (coerced to a fixed-width integer) within\n" +" an expression. The variable need not have its integer attribute\n" +" turned on to be used in an expression.\n" +" \n" +" Operators are evaluated in order of precedence. Sub-expressions in\n" +" parentheses are evaluated first and may override the precedence\n" +" rules above.\n" +" \n" +" Exit Status:\n" +" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." +msgstr "" +"Evaluer aritmetiske udtryk.\n" +" \n" +" Hvert ARG er et aritmetisk udtryk som skal evalueres. Evalueringen\n" +" bliver foretaget i heltal med fast-bredde, uden check for overløb,\n" +" dog vil division med 0 blive fanget og markeret som en fejl. Den\n" +" følgende liste af operatorer er vist i grupper med samme evaluerings-\n" +" prioritet. Grupperne er vist med faldende prioritet.\n" +" \n" +" \tid++, id--\tpost-forøgelse og -formindskelse af variabel\n" +" \t++id, --id\tpræ-forøgelse og -formindskelse af variabel\n" +" \t-, +\t\tunær minus og plus\n" +" \t!, ~\t\tlogisk og bitvis negation\n" +" \t**\t\teksponentiering\n" +" \t*, /, %\t\tmultiplikation, division, rest\n" +" \t+, -\t\taddition, subtraktion\n" +" \t<<, >>\t\tvenstre og højre bitvis skift\n" +" \t<=, >=, <, >\tsammenligning\n" +" \t==, !=\t\tlighed, ulighed\n" +" \t&\t\tbitvis AND (OG)\n" +" \t^\t\tbitvis XOR (EKSKLUSIVT ELLER)\n" +" \t|\t\tbitvis OR (ELLER)\n" +" \t&&\t\tlogisk AND (OG)\n" +" \t||\t\tlogisk OR (ELLER)\n" +" \texpr ? expr : expr\n" +" \t\t\tbetingelsesoperator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\ttildeling\n" +" \n" +" Skalvariable er tilladt som operander. Variablens navn vil blive\n" +" erstattet af dens værdi (tilpasset sÃ¥ den er et heltal med fast-bredde)\n" +" indeni udtrykket. Variablen skal have sin heltals-attribut slÃ¥et til\n" +" for, at den kan bruges i et udtryk.\n" +" \n" +" Operatorer vil blive evalueret efter prioritet. Underoperatorer i\n" +" parenteser bliver evalueret først og kan tilsidesætte de ovenstÃ¥ende\n" +" prioriteter.\n" +" \n" +" Afslutningsstatus:\n" +" Hvis det sidste ARG evalueres til 0, vil \"let\" returnere 1, ellers\n" +" returneres 0." + +#: builtins.c:983 +#, fuzzy +msgid "" +"Read a line from the standard input and split it into fields.\n" +" \n" +" Reads a single line from the standard input, or from file descriptor FD\n" +" if the -u option is supplied. The line is split into fields as with " +"word\n" +" splitting, and the first word is assigned to the first NAME, the second\n" +" word to the second NAME, and so on, with any leftover words assigned to\n" +" the last NAME. Only the characters found in $IFS are recognized as " +"word\n" +" delimiters.\n" +" \n" +" If no NAMEs are supplied, the line read is stored in the REPLY " +"variable.\n" +" \n" +" Options:\n" +" -a array\tassign the words read to sequential indices of the array\n" +" \t\tvariable ARRAY, starting at zero\n" +" -d delim\tcontinue until the first character of DELIM is read, rather\n" +" \t\tthan newline\n" +" -e\t\tuse Readline to obtain the line in an interactive shell\n" +" -i text\tUse TEXT as the initial text for Readline\n" +" -n nchars\treturn after reading NCHARS characters rather than waiting\n" +" \t\tfor a newline, but honor a delimiter if fewer than NCHARS\n" +" \t\tcharacters are read before the delimiter\n" +" -N nchars\treturn only after reading exactly NCHARS characters, " +"unless\n" +" \t\tEOF is encountered or read times out, ignoring any delimiter\n" +" -p prompt\toutput the string PROMPT without a trailing newline before\n" +" \t\tattempting to read\n" +" -r\t\tdo not allow backslashes to escape any characters\n" +" -s\t\tdo not echo input coming from a terminal\n" +" -t timeout\ttime out and return failure if a complete line of input " +"is\n" +" \t\tnot read within TIMEOUT seconds. The value of the TMOUT\n" +" \t\tvariable is the default timeout. TIMEOUT may be a\n" +" \t\tfractional number. If TIMEOUT is 0, read returns immediately,\n" +" \t\twithout trying to read any data, returning success only if\n" +" \t\tinput is available on the specified file descriptor. The\n" +" \t\texit status is greater than 128 if the timeout is exceeded\n" +" -u fd\t\tread from file descriptor FD instead of the standard input\n" +" \n" +" Exit Status:\n" +" The return code is zero, unless end-of-file is encountered, read times " +"out\n" +" (in which case it's greater than 128), a variable assignment error " +"occurs,\n" +" or an invalid file descriptor is supplied as the argument to -u." +msgstr "" +"Læs en linje fra standardinput og del den op i felter.\n" +" \n" +" En linje vil blive læst fra standardinput, eller fra fildeskriptor FD " +"hvis\n" +" tilvalget -u er givet. Linjen vil blive delt ind i felter som med ord-\n" +" opdeling Det første ord blive tildelt det første NAVN, det andet ord " +"til \n" +" det andet NAVN osv. og de tilbageblivende ord vil blive tildelt det " +"sidste\n" +" NAVN. Kun de tegn som findes i $IFS vil blive genkendt som " +"ordadskillere.\n" +"\n" +" Hvis der ikke er angivet nogle NAVNe, vil linjen blive gemt i REPLY-\n" +" variablen.\n" +"\n" +" Tilvalg:\n" +" -a array\tde indlæste ord blive tildelt fortløbende indeks i\n" +" \t\tARRAY startende ved 0\n" +" -d adskil\tfortsæt indtil det første tegn i ADSKIL bliver læst, i " +"stedet\n" +" \t\tfor ved nylinjetegn\n" +" -e\tbrug Readline til at indhente linje fra en interaktiv skal\n" +" -i tekst\tBrug TEKST som den indledende tekst til Readline\n" +" -n ntegn\treturnerer efter at have læst NTEGN tegn i stedet for at " +"vente\n" +" \t\tpÃ¥ et nylinjetegn\n" +" -p prompt\tudskriv strengen PROMPT, uden et nylinjetegn, før der " +"forsøges pÃ¥\n" +" \t\tat læse\n" +" -r\ttillad ikke at omvendte skrÃ¥streger undviger tegn\n" +" -s\tudskriv (echo) ikke input som kommer fra en terminal\n" +" -t tidsgrænse\tindstil tidsudløb og returner fejl, hvis der ikke kan\n" +" \t\t\tlæses en komplet linje indenfor TIDSGRÆNSE sekunder.\n" +" \t\t\tVærdien af variablen TMOUT er standardtidsudløbet.\n" +" \t\t\tTIDSGRÆNSE kan være et kommatal. Hvis TIDSGRÆNSE er 0,\n" +" \t\t\tvil read kun returnere succes hvis der er input\n" +" \t\t\ttilgængelig ved den angivne fildeskriptor. Fejlstatus\n" +" \t\t\tvil være større end 128 hvis tidsudløb indtræffer.\n" +" -u fd\tlæs fra fildeskriptoren FD i stedet for standardinput\n" +" \n" +" Afslutningsstatus:\n" +" Returkoden vil være nul, med mindre slut-pÃ¥-fil nÃ¥s, tidsudløb " +"indtræffer,\n" +" eller hvis en ugyldig fildeskriptor gives som argument til -u." + +#: builtins.c:1028 +msgid "" +"Return from a shell function.\n" +" \n" +" Causes a function or sourced script to exit with the return value\n" +" specified by N. If N is omitted, the return status is that of the\n" +" last command executed within the function or script.\n" +" \n" +" Exit Status:\n" +" Returns N, or failure if the shell is not executing a function or script." +msgstr "" +"Returner fra en skalfunktion.\n" +" \n" +" Gør at en funktion eller et kildeskript afslutter med en returværdi, som " +"er\n" +" angivet med N. Hvis N udelades, vil returstatussen være den samme som " +"værdien\n" +" fra sidste kommande, som blev eksekveret inde i funktionen eller " +"skriptet.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer N, eller fejl hvis skallen ikke er i færd med at eksekvere " +"en\n" +" funktion eller et skript." + +#: builtins.c:1041 +#, fuzzy +msgid "" +"Set or unset values of shell options and positional parameters.\n" +" \n" +" Change the value of shell attributes and positional parameters, or\n" +" display the names and values of shell variables.\n" +" \n" +" Options:\n" +" -a Mark variables which are modified or created for export.\n" +" -b Notify of job termination immediately.\n" +" -e Exit immediately if a command exits with a non-zero status.\n" +" -f Disable file name generation (globbing).\n" +" -h Remember the location of commands as they are looked up.\n" +" -k All assignment arguments are placed in the environment for a\n" +" command, not just those that precede the command name.\n" +" -m Job control is enabled.\n" +" -n Read commands but do not execute them.\n" +" -o option-name\n" +" Set the variable corresponding to option-name:\n" +" allexport same as -a\n" +" braceexpand same as -B\n" +" emacs use an emacs-style line editing interface\n" +" errexit same as -e\n" +" errtrace same as -E\n" +" functrace same as -T\n" +" hashall same as -h\n" +" histexpand same as -H\n" +" history enable command history\n" +" ignoreeof the shell will not exit upon reading EOF\n" +" interactive-comments\n" +" allow comments to appear in interactive commands\n" +" keyword same as -k\n" +" monitor same as -m\n" +" noclobber same as -C\n" +" noexec same as -n\n" +" noglob same as -f\n" +" nolog currently accepted but ignored\n" +" notify same as -b\n" +" nounset same as -u\n" +" onecmd same as -t\n" +" physical same as -P\n" +" pipefail the return value of a pipeline is the status of\n" +" the last command to exit with a non-zero status,\n" +" or zero if no command exited with a non-zero " +"status\n" +" posix change the behavior of bash where the default\n" +" operation differs from the Posix standard to\n" +" match the standard\n" +" privileged same as -p\n" +" verbose same as -v\n" +" vi use a vi-style line editing interface\n" +" xtrace same as -x\n" +" -p Turned on whenever the real and effective user ids do not match.\n" +" Disables processing of the $ENV file and importing of shell\n" +" functions. Turning this option off causes the effective uid and\n" +" gid to be set to the real uid and gid.\n" +" -t Exit after reading and executing one command.\n" +" -u Treat unset variables as an error when substituting.\n" +" -v Print shell input lines as they are read.\n" +" -x Print commands and their arguments as they are executed.\n" +" -B the shell will perform brace expansion\n" +" -C If set, disallow existing regular files to be overwritten\n" +" by redirection of output.\n" +" -E If set, the ERR trap is inherited by shell functions.\n" +" -H Enable ! style history substitution. This flag is on\n" +" by default when the shell is interactive.\n" +" -P If set, do not resolve symbolic links when executing commands\n" +" such as cd which change the current directory.\n" +" -T If set, the DEBUG trap is inherited by shell functions.\n" +" -- Assign any remaining arguments to the positional parameters.\n" +" If there are no remaining arguments, the positional parameters\n" +" are unset.\n" +" - Assign any remaining arguments to the positional parameters.\n" +" The -x and -v options are turned off.\n" +" \n" +" Using + rather than - causes these flags to be turned off. The\n" +" flags can also be used upon invocation of the shell. The current\n" +" set of flags may be found in $-. The remaining n ARGs are positional\n" +" parameters and are assigned, in order, to $1, $2, .. $n. If no\n" +" ARGs are given, all shell variables are printed.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given." +msgstr "" +"Indstiller eller afinitialiserer (unset) skaltilvalg og positionsparametre.\n" +" \n" +" Ændr værdien af skalattributter og positionsparametre, eller vis navne " +"og\n" +" værdier af skalvariable.\n" +"\n" +" Tilvalg:\n" +" -a Marker variable som er ændret eller oprettet til eksport.\n" +" -b Underret om jobafslutning øjeblikkeligt.\n" +" -e Afslut øjeblikkeligt hvis en kommando afslutter med en\n" +" afslutningsstatus som ikke er nul.\n" +" -f SlÃ¥ filnavngenerering fra (globbing).\n" +" -h Husk kommandoers positionen mens de slÃ¥s op.\n" +" -k Overfør alle opgavens argumenter til kommandoens miljø, ikke kun " +"de\n" +" som kommer før kommandonavnet.\n" +" -m SlÃ¥ jobkontrol til.\n" +" -n Læs kommandoer men eksekver dem ikke.\n" +" -o tilvalgsnavn\n" +" Indstil variablen sÃ¥ den passer til tilvalgsnavn:\n" +" allexport samme som -a\n" +" braceexpand samme som -B\n" +" emacs brug en linjeredigerings-grænseflade som i emacs\n" +" errexit samme som -e\n" +" errtrace samme som -E\n" +" functrace samme som -T\n" +" hashall samme som -h\n" +" histexpand samme som -H\n" +" history slÃ¥ kommandohistorik til\n" +" ignoreeof skallen vil ikke afslutte ved læsning af\n" +" slut-pÃ¥-fil (EOF)\n" +" interactive-comments\n" +" vis ogsÃ¥ kommentarerer ved interaktive " +"kommandoer\n" +" keyword samme som -k\n" +" monitor samme som -m\n" +" noclobber samme som -C\n" +" noexec samme som -n\n" +" noglob samme som -f\n" +" nolog accepteres pÃ¥ nuværende tidspunkt men har ingen\n" +" virkning\n" +" notify samme som -b\n" +" nounset samme som -u\n" +" onecmd samme som -t\n" +" physical samme som -P\n" +" pipefail returværdien af en datakanal (pipeline) er\n" +" status af den sidste kommando, som afsluttedes " +"med en\n" +" status som er forskellig fra nul, eller nul hvis\n" +" ingen kommando afsluttedes med en status " +"forskellig\n" +" fra nul\n" +" posix ændrer den mÃ¥de bash opfører sig pÃ¥ de steder " +"hvor\n" +" opførslen afviger fra 1003.2-standarden sÃ¥ledes " +"at\n" +" standarden følges\n" +" privileged samme som -p\n" +" verbose samme som -v\n" +" vi brug en linjeredigerings-grænseflade som i \"vi" +"\"\n" +" xtrace samme som -x\n" +" -p SlÃ¥et til nÃ¥r den reelle og den faktiske brugers id'er ikke er " +"ens.\n" +" Deaktiverer behandling af $ENV-filen og import af skalfunktioner.\n" +" Deaktivering af denne valgmulighed vil sætte de faktiske\n" +" uid og gid til de reelle uid og gid.\n" +" -t Afslut efter af have læst og eksekveret en kommando.\n" +" -u Behandl afinitialiserede (unset) variable som en fejl ved " +"substitution.\n" +" -v Udskriv skal-inputlinjer nÃ¥r de læses.\n" +" -x Udskriv kommandoer og deres argumenter nÃ¥r de eksekveres.\n" +" -B Lad skallen udføre klammeudvidelse\n" +" -C Med dette tilvalg vil det ikke tillades at eksisterende regulære " +"filer\n" +" overskrives pga. videreførsel af output.\n" +" -E Med dette tilvalg vil ERR-fælden (trap) arves af skalfunktioner.\n" +" -H Aktiver !-stilhistoriksubstitution. Dette flag er aktiveret som\n" +" standard, nÃ¥r skallen er interaktiv.\n" +" -P Med dette tilvalg følges symbolske lænker ikke ved eksekvering af\n" +" kommandoer, som f.eks. cd, der ændrer den aktuelle mappe.\n" +" -T Med dette tilvalg vil DEBUG-fælden (trap) arves af " +"skalfunktioner.\n" +" - Tildel alle tilbageblevne argumenter til positionsparametrene.\n" +" Tilvalgene -x og -v er slÃ¥et fra.\n" +" \n" +" Bruges + i stedet for - vil disse flag blive slÃ¥et fra. Flagene kan " +"ogsÃ¥\n" +" bruges ved kald af skallen. Flagene det aktuelt er i brug kan findes i " +"$-.\n" +" De tilbageblevne n ARGer er positionsparametre og vil blive tildelt i " +"række-\n" +" følge til $1, $2, .. $n. Hvis der ikke angives nogen ARGer, vil alle " +"skal-\n" +" variable blive udskrevet.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre der angives et ugyldigt tilvalg." + +#: builtins.c:1126 +#, fuzzy +msgid "" +"Unset values and attributes of shell variables and functions.\n" +" \n" +" For each NAME, remove the corresponding variable or function.\n" +" \n" +" Options:\n" +" -f\ttreat each NAME as a shell function\n" +" -v\ttreat each NAME as a shell variable\n" +" -n\ttreat each NAME as a name reference and unset the variable itself\n" +" \trather than the variable it references\n" +" \n" +" Without options, unset first tries to unset a variable, and if that " +"fails,\n" +" tries to unset a function.\n" +" \n" +" Some variables cannot be unset; also see `readonly'.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a NAME is read-only." +msgstr "" +"Afinitialiserer (unset) værdier og attributter for skalvariable og " +"funktioner.\n" +" \n" +" Fjerner den tilsvarende variabel eller funktion for hvert NAVN.\n" +" \n" +" Tilvalg:\n" +" -f\tbehandl ethvert NAVN som en skalfunktion\n" +" -v\tbehandl ethvert NAVN som en skalvariable\n" +" \n" +" Uden tilvalg vil unset først prøve at afinitialisere en variabel og " +"hvis\n" +" det mislykkes, vil den prøve med en funktion.\n" +" \n" +" Nogle variable kan ikke afinitialiseres; læs under \"readonly\".\n" +" \n" +" Afslutningstatus:\n" +" Returnerer succes med mindre der gives et ugyldigt tilvalg eller hvis " +"et\n" +" givent navn er skrivebeskyttet." + +#: builtins.c:1148 +msgid "" +"Set export attribute for shell variables.\n" +" \n" +" Marks each NAME for automatic export to the environment of subsequently\n" +" executed commands. If VALUE is supplied, assign VALUE before " +"exporting.\n" +" \n" +" Options:\n" +" -f\trefer to shell functions\n" +" -n\tremove the export property from each NAME\n" +" -p\tdisplay a list of all exported variables and functions\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" +"Indstil eksportattributten for skalvariable.\n" +" \n" +" Marker hvert NAVN til automatisk eksport til miljøet for de kommandoer " +"som\n" +" eksekveres efterfølgende. Hvis VÆRDI er angivet, vil den blive tildelt\n" +" variablen før eksportering.\n" +" \n" +" Tilvalg:\n" +" -f\treferer til skalfunktioner\n" +" -n\tfjern eksportegenskaben fra hvert NAVN\n" +" -p\tvis en liste over alle eksporterede variable og funktioner\n" +" \n" +" Argumentet \"--\" slÃ¥r al efterfølgende behandling fra.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre der angives et ugyldigt tilvalg eller hvis\n" +" NAVN er ugyldig." + +#: builtins.c:1167 +#, fuzzy +msgid "" +"Mark shell variables as unchangeable.\n" +" \n" +" Mark each NAME as read-only; the values of these NAMEs may not be\n" +" changed by subsequent assignment. If VALUE is supplied, assign VALUE\n" +" before marking as read-only.\n" +" \n" +" Options:\n" +" -a\trefer to indexed array variables\n" +" -A\trefer to associative array variables\n" +" -f\trefer to shell functions\n" +" -p\tdisplay a list of all readonly variables or functions, depending " +"on\n" +" whether or not the -f option is given\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" +"Marker skalvariable som skrivebeskyttet.\n" +" \n" +" Marker hvert NAVN som skrivebeskyttet. Værdierne af disse navne kan\n" +" herefter ikke ændres ved efterfølgende tildeling. Hvis VÆRDI angives, " +"vil\n" +" denne blive tildelt variablen, før den markeres som skrivebeskyttet.\n" +" \n" +" Tilvalg:\n" +" -a\treferer til indekserede arrays\n" +" -A\treferer til associative arrayvariable\n" +" -f\treferer til skalfunktioner\n" +" -p\tvis en liste af alle skrivebeskyttede variable og funktioner\n" +" \n" +" Argumentet \"--\" slÃ¥r al efterfølgende fra.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre der angives et ugyldigt tilvalg eller hvis\n" +" NAVN er ugyldigt." + +#: builtins.c:1189 +msgid "" +"Shift positional parameters.\n" +" \n" +" Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n" +" not given, it is assumed to be 1.\n" +" \n" +" Exit Status:\n" +" Returns success unless N is negative or greater than $#." +msgstr "" +"Skift positionsparametre.\n" +" \n" +" Omdøb positionsparametrene $N+1,$N+2 ... til $1,$2 ... Hvis N ikke " +"angives,\n" +" antages værdien 1.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre N er negativ eller større end $#." + +#: builtins.c:1201 builtins.c:1216 +msgid "" +"Execute commands from a file in the current shell.\n" +" \n" +" Read and execute commands from FILENAME in the current shell. The\n" +" entries in $PATH are used to find the directory containing FILENAME.\n" +" If any ARGUMENTS are supplied, they become the positional parameters\n" +" when FILENAME is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed in FILENAME; fails if\n" +" FILENAME cannot be read." +msgstr "" +"Eksekver kommandoer fra en fil i den aktuelle skal.\n" +" \n" +" Læs og eksekver kommandoer fra FILNAVN i den aktuelle skal. Elementerne " +"i\n" +" $PATH bruges til at finde den mappe som FILNAVN ligger i. Hvis der " +"angives\n" +" ARGUMENTER, omdannes de til positionsparametre nÃ¥r FILNAVN eksekveres.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer status fra den sidst eksekverede kommando i FILNAVN; fejler " +"hvis\n" +" FILNAVN ikke kan læses." + +#: builtins.c:1232 +msgid "" +"Suspend shell execution.\n" +" \n" +" Suspend the execution of this shell until it receives a SIGCONT signal.\n" +" Unless forced, login shells cannot be suspended.\n" +" \n" +" Options:\n" +" -f\tforce the suspend, even if the shell is a login shell\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Suspender skaleksekvering.\n" +" \n" +" Suspender eksekvering af denne skal indtil den modtager et SIGCONT-" +"signal.\n" +" Med mindre det gennemtvinges, kan en logindskal ikke suspenderes.\n" +" \n" +" Tilvalg:\n" +" -f\tgennemtving suspendering selvom skallen er en logindskal\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre jobkontrol ikke er slÃ¥et til, eller hvis " +"der\n" +" opstÃ¥r en fejl." + +#: builtins.c:1248 +#, fuzzy +msgid "" +"Evaluate conditional expression.\n" +" \n" +" Exits with a status of 0 (true) or 1 (false) depending on\n" +" the evaluation of EXPR. Expressions may be unary or binary. Unary\n" +" expressions are often used to examine the status of a file. There\n" +" are string operators and numeric comparison operators as well.\n" +" \n" +" The behavior of test depends on the number of arguments. Read the\n" +" bash manual page for the complete specification.\n" +" \n" +" File operators:\n" +" \n" +" -a FILE True if file exists.\n" +" -b FILE True if file is block special.\n" +" -c FILE True if file is character special.\n" +" -d FILE True if file is a directory.\n" +" -e FILE True if file exists.\n" +" -f FILE True if file exists and is a regular file.\n" +" -g FILE True if file is set-group-id.\n" +" -h FILE True if file is a symbolic link.\n" +" -L FILE True if file is a symbolic link.\n" +" -k FILE True if file has its `sticky' bit set.\n" +" -p FILE True if file is a named pipe.\n" +" -r FILE True if file is readable by you.\n" +" -s FILE True if file exists and is not empty.\n" +" -S FILE True if file is a socket.\n" +" -t FD True if FD is opened on a terminal.\n" +" -u FILE True if the file is set-user-id.\n" +" -w FILE True if the file is writable by you.\n" +" -x FILE True if the file is executable by you.\n" +" -O FILE True if the file is effectively owned by you.\n" +" -G FILE True if the file is effectively owned by your group.\n" +" -N FILE True if the file has been modified since it was last " +"read.\n" +" \n" +" FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" +" modification date).\n" +" \n" +" FILE1 -ot FILE2 True if file1 is older than file2.\n" +" \n" +" FILE1 -ef FILE2 True if file1 is a hard link to file2.\n" +" \n" +" String operators:\n" +" \n" +" -z STRING True if string is empty.\n" +" \n" +" -n STRING\n" +" STRING True if string is not empty.\n" +" \n" +" STRING1 = STRING2\n" +" True if the strings are equal.\n" +" STRING1 != STRING2\n" +" True if the strings are not equal.\n" +" STRING1 < STRING2\n" +" True if STRING1 sorts before STRING2 " +"lexicographically.\n" +" STRING1 > STRING2\n" +" True if STRING1 sorts after STRING2 lexicographically.\n" +" \n" +" Other operators:\n" +" \n" +" -o OPTION True if the shell option OPTION is enabled.\n" +" -v VAR\t True if the shell variable VAR is set\n" +" -R VAR\t True if the shell variable VAR is set and is a name " +"reference.\n" +" ! EXPR True if expr is false.\n" +" EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n" +" EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n" +" \n" +" arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Arithmetic binary operators return true if ARG1 is equal, not-equal,\n" +" less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n" +" than ARG2.\n" +" \n" +" Exit Status:\n" +" Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n" +" false or an invalid argument is given." +msgstr "" +"Evaluer betingelsesudtryk.\n" +" \n" +" Afslutter med status 0 (sand) eller 1 (falsk) afhængigt af evalueringen " +"af\n" +" UDTRYK. Udtrykket kan være unært eller binært. Unære udtryk bruges ofte " +"til\n" +" at undersøge filers status. Der findes ogsÃ¥ strengoperatorer sÃ¥vel som\n" +" operatorer til numeriske sammenligninger.\n" +" \n" +" Filoperatorer:\n" +" \n" +" -a FIL Sand hvis filen eksisterer.\n" +" -b FIL Sand hvis filen er blokspeciel.\n" +" -c FIL Sand hvis filen er tegnspecial.\n" +" -d FIL Sand hvis filen er en mappe.\n" +" -e FIL Sand hvis filen eksisterer.\n" +" -f FIL Sand hvis filen eksisterer og er en regulær fil.\n" +" -g FIL Sand hvis filen er sæt-gruppe-id.\n" +" -h FIL Sand hvis filen er en symbolsk lænke.\n" +" -L FIL Sand hvis filen er en symbolsk lænke.\n" +" -k FIL Sand hvis filens klæbebit (sticky bit) er indstillet.\n" +" -p FIL Sand hvis filen er en navngiven datakanal (pipe).\n" +" -r FIL Sand hvis du kan læse filen.\n" +" -s FIL Sand hvis filen eksisterer og ikke er tom.\n" +" -S FIL Sand hvis filen er en sokkel.\n" +" -t FD Sand hvis FD blev Ã¥bnet pÃ¥ en terminal.\n" +" -u FIL Sand hvis filen er sæt-bruger-id.\n" +" -w FIL Sand hvis du kan skrive til filen.\n" +" -x FIL Sand hvis du kan eksekvere filen.\n" +" -O FIL Sand hvis filen effektivt er ejet af dig.\n" +" -G FIL Sand hvis filen effektivt er ejet af din gruppe.\n" +" -N FIL Sand hvis filen er blevet ændret siden den sidst blev " +"læst.\n" +" \n" +" FIL1 -nt FIL2 Sand hvis fil1 er nyere end fil2 (ifølge " +"modificerings-\n" +" datoen)\n" +" \n" +" FIL1 -ot FIL2 Sand hvis fil1 er ældre en fil2.\n" +" \n" +" FIL1 -ef FIL2 Sand hvis fil1 er en hÃ¥rd lænke til fil2.\n" +" \n" +" Strengoperatorer:\n" +" \n" +" -z STRENG Sand hvis strengen er tom.\n" +" \n" +" -n STRENG\n" +" STRENG Sand hvis strengen ikke er tom.\n" +" \n" +" STRENG1 = STRENG2\n" +" Sand hvis strengene er ens.\n" +" STRENG1 != STRENG2\n" +" Sand hvis strengene ikke er ens.\n" +" STRENG1 < STRENG2\n" +" Sand hvis STRENG1 sorteres før STRENG2 leksikografisk.\n" +" STRENG1 > STRENG2\n" +" Sand hvis STRENG1 sorteres efter STRENG2 " +"leksikografisk.\n" +" \n" +" Andre operatorer:\n" +" \n" +" -o TILVALG Sand hvis skaltilvalget TILVALG er slÃ¥et til.\n" +" ! UDTRYK Sand hvis udtryk er falsk.\n" +" UDTR1 -a UDTR2 Sand hvis bÃ¥de udtr1 og udtr2 er sande.\n" +" UDTR1 -o UDTR2 Sand hvis enten udtr1 eller udtr2 er sand.\n" +" \n" +" arg1 OP arg2 Aritmetiske tests. OP er en af følgende: -eq, -ne,\n" +" -lt, -le, -gt, eller -ge.\n" +" \n" +" Binære aritmetiske operatorer returnerer sand hvis ARG1 er henholdsvis " +"lig,\n" +" ikke-lig, mindre-end, mindre-end-eller-lig, større-end, større-end-eller-" +"lig\n" +" ARG2.\n" +"\n" +" Afslutningsstatus:\n" +" Returnerer succes hvis UDTRYK evalueres til sand, og fejler hvis UDTRYK\n" +" evalueres til falsk eller hvis der gives et ugyldigt argument." + +#: builtins.c:1329 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" This is a synonym for the \"test\" builtin, but the last argument must\n" +" be a literal `]', to match the opening `['." +msgstr "" +"Evaluer betingelsesudtryk.\n" +" \n" +" Dette er et synonym for den indbyggede funktion \"test\", dog skal det " +"sidste\n" +" argument skal være \"]\", for at den passer til den Ã¥bnende \"[\"." + +#: builtins.c:1338 +msgid "" +"Display process times.\n" +" \n" +" Prints the accumulated user and system times for the shell and all of " +"its\n" +" child processes.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Vis procestid.\n" +" \n" +" Udskriver den akkumulerede bruger- og systemtid for skallen og alle " +"dens\n" +" underprocesser.\n" +" \n" +" Afslutningsstatus:\n" +" Lykkes altid." + +#: builtins.c:1350 +#, fuzzy +msgid "" +"Trap signals and other events.\n" +" \n" +" Defines and activates handlers to be run when the shell receives " +"signals\n" +" or other conditions.\n" +" \n" +" ARG is a command to be read and executed when the shell receives the\n" +" signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n" +" is supplied) or `-', each specified signal is reset to its original\n" +" value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" +" shell and by the commands it invokes.\n" +" \n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. " +"If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. " +"If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or " +"a\n" +" script run by the . or source builtins finishes executing. A " +"SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause " +"the\n" +" shell to exit when the -e option is enabled.\n" +" \n" +" If no arguments are supplied, trap prints the list of commands " +"associated\n" +" with each signal.\n" +" \n" +" Options:\n" +" -l\tprint a list of signal names and their corresponding numbers\n" +" -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" +" \n" +" Each SIGNAL_SPEC is either a signal name in or a signal " +"number.\n" +" Signal names are case insensitive and the SIG prefix is optional. A\n" +" signal may be sent to the shell with \"kill -signal $$\".\n" +" \n" +" Exit Status:\n" +" Returns success unless a SIGSPEC is invalid or an invalid option is " +"given." +msgstr "" +"Indfanger signaler og andre begivenheder.\n" +" \n" +" Definerer og aktiverer hÃ¥ndteringsenheder, som skal køres nÃ¥r skallen\n" +" modtager signaler eller under andre omstændigheder.\n" +" \n" +" ARG er en kommando som skal læses og eksekveres, nÃ¥r skallen modtager\n" +" signalet SIGNAL_SPEC. Hvis ARG ikke er angivet (og hvis der angives en\n" +" enkelt SIGNAL_SPEC) eller \"-\", vil hvert angivet signal blive " +"nulstillet\n" +" til dets oprindelige værdi. Hvis ARG er null-strengen, vil hvert\n" +" SIGNAL_SPEC bliver ignoreret af skallen og af de kommandoer som den\n" +" starter.\n" +" \n" +" Hvis en SIGNAL_SPEC er EXIT (0), vil ARG blive eksekveret ved " +"afslutning\n" +" af skallen. Hvis SIGNAL_SPEC er DEBUG, vil ARG blive eksekveret før " +"hver\n" +" simpel kommando.\n" +" \n" +" Hvis der ikke er angivet nogen argumenter, vil trap udskrive en liste " +"af\n" +" kommandoer som er associeret med hvert signal.\n" +" \n" +" Tilvalg:\n" +" -l\tudskriver en liste af signalnavne og deres tilhørende numre\n" +" -p\tvis de trap-kommandoer som er associeret med hvert SIGNAL_SPEC\n" +" \n" +" Hver SIGNAL_SPEC er enten et signalnavn i eller et signal-\n" +" nummer. Signalnavne er ikke versalfølsomme og præfikset SIG er " +"valgfrit.\n" +" Et signal kan sendes til skallen med \"kill -signal $$\".\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre SIGSPEC er ugyldig eller hvis der er " +"angivet\n" +" et ugyldigt tilvalg." + +#: builtins.c:1386 +msgid "" +"Display information about command type.\n" +" \n" +" For each NAME, indicate how it would be interpreted if used as a\n" +" command name.\n" +" \n" +" Options:\n" +" -a\tdisplay all locations containing an executable named NAME;\n" +" \tincludes aliases, builtins, and functions, if and only if\n" +" \tthe `-p' option is not also used\n" +" -f\tsuppress shell function lookup\n" +" -P\tforce a PATH search for each NAME, even if it is an alias,\n" +" \tbuiltin, or function, and returns the name of the disk file\n" +" \tthat would be executed\n" +" -p\treturns either the name of the disk file that would be executed,\n" +" \tor nothing if `type -t NAME' would not return `file'.\n" +" -t\toutput a single word which is one of `alias', `keyword',\n" +" \t`function', `builtin', `file' or `', if NAME is an alias, shell\n" +" \treserved word, shell function, shell builtin, disk file, or not\n" +" \tfound, respectively\n" +" \n" +" Arguments:\n" +" NAME\tCommand name to be interpreted.\n" +" \n" +" Exit Status:\n" +" Returns success if all of the NAMEs are found; fails if any are not " +"found." +msgstr "" +"Vis information om kommandoers type.\n" +" \n" +" Oplys for hvert NAVN, hvordan det ville blive tolket, hvis det blev " +"brugt\n" +" som en kommando.\n" +" \n" +" Tilvalg:\n" +" -a\tvis alle placeringer som indeholder en eksekverbar ved navn NAVN;\n" +" \tinkluder aliasser, indbyggede og funktioner, hvis og kun hvis " +"tilvalget\n" +" \t\"-p\" ikke ogsÃ¥ bruges\n" +" -f\tundertryk søgning efter skalfunktioner\n" +" -P\tgennemtving en stisøgning for hvert NAVN, selvom det er et\n" +" \talias, en indbygget eller en funktion og returner samme navne som den\n" +" \tdiskfil der ville blive eksekveret\n" +" -p\treturnerer enten navnet pÃ¥ den diskfil, som ville blive\n" +" \teksekveret, eller ingenting hvis \"type -t NAVN\" ikke ville have\n" +" \treturneret \"file\".\n" +" -t\treturner et enkelt ord, enten \"alias\", \"keyword\", \"function" +"\",\n" +" \t\"builtin\", \"file\" eller \"\", hvis NAVN er henholdsvis et alias,\n" +" skalreserveret ord, skalfunktion, skalindbygget, diskfil eller ikke " +"blev\n" +" fundet.\n" +" \n" +" Argumenter:\n" +" NAVN\tNavnet pÃ¥ den kommando der skal fortolkes.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes hvis alle NAVNe kan findes, og fejler hvis bare et " +"enkelt\n" +" ikke findes." + +#: builtins.c:1417 +#, fuzzy +msgid "" +"Modify shell resource limits.\n" +" \n" +" Provides control over the resources available to the shell and " +"processes\n" +" it creates, on systems that allow such control.\n" +" \n" +" Options:\n" +" -S\tuse the `soft' resource limit\n" +" -H\tuse the `hard' resource limit\n" +" -a\tall current limits are reported\n" +" -b\tthe socket buffer size\n" +" -c\tthe maximum size of core files created\n" +" -d\tthe maximum size of a process's data segment\n" +" -e\tthe maximum scheduling priority (`nice')\n" +" -f\tthe maximum size of files written by the shell and its children\n" +" -i\tthe maximum number of pending signals\n" +" -l\tthe maximum size a process may lock into memory\n" +" -m\tthe maximum resident set size\n" +" -n\tthe maximum number of open file descriptors\n" +" -p\tthe pipe buffer size\n" +" -q\tthe maximum number of bytes in POSIX message queues\n" +" -r\tthe maximum real-time scheduling priority\n" +" -s\tthe maximum stack size\n" +" -t\tthe maximum amount of cpu time in seconds\n" +" -u\tthe maximum number of user processes\n" +" -v\tthe size of virtual memory\n" +" -x\tthe maximum number of file locks\n" +" -T the maximum number of threads\n" +" \n" +" Not all options are available on all platforms.\n" +" \n" +" If LIMIT is given, it is the new value of the specified resource; the\n" +" special LIMIT values `soft', `hard', and `unlimited' stand for the\n" +" current soft limit, the current hard limit, and no limit, respectively.\n" +" Otherwise, the current value of the specified resource is printed. If\n" +" no option is given, then -f is assumed.\n" +" \n" +" Values are in 1024-byte increments, except for -t, which is in seconds,\n" +" -p, which is in increments of 512 bytes, and -u, which is an unscaled\n" +" number of processes.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Modificer grænser for skalressourcer.\n" +" \n" +" Giver kontrol over de ressourcer som er tilgængelige for skallen og de\n" +" processer den starter pÃ¥ systemer som tillader den slags kontrol.\n" +" \n" +" Tilvalg:\n" +" -S\tbrug den \"bløde\" ressourcegrænse\n" +" -H\tbrug den \"hÃ¥rde\" ressourcegrænse\n" +" -a\talle aktuelle grænser rapporteres\n" +" -b\tstørrelse af sokkelbuffer\n" +" -c\tmaksimale størrelse af oprettede kernefiler\n" +" -d\tmaksimale størrelse af en proces' datasegment\n" +" -e\tmaksimale planlægningsprioritet (`nice')\n" +" -f\tmaksimale størrelse af filer skrevet af skallen og dens\n" +" \tunderprocesser\n" +" -i\tmaksimale antal af ventende signaler\n" +" -l\tmaksimale størrelse en proces mÃ¥ lÃ¥se i hukommelse\n" +" -m\tmaksimale indstillede omrÃ¥de (resident size)\n" +" -n\tmaksimale antal Ã¥bne fildeskriptorer\n" +" -p\tbufferstørrelse for datakanal (pipe)\n" +" -q\tmaksimale antal bytes i POSIX-beskedkøer\n" +" -r\tmaksimale realtids-planlægningsprioritet\n" +" -s\tmaksimal stakstørrelse\n" +" -t\tmaksimale mængde cpu-tid i sekunder\n" +" -u\tmaksimale antal brugerprocesser\n" +" -v\tstørrelsen af virtuel hukommelse\n" +" -x\tmaksimale antal fillÃ¥se\n" +" \n" +" Hvis GRÆNSE angives, er det den nye grænse for den specificerede " +"ressource\n" +" De specielle grænser, \"soft\", hard\" og \"unlimited\" stÃ¥r for " +"henholdsvis den\n" +" aktuelle bløde grænse, hÃ¥rde grænse og ingen grænse. Ellers vil den\n" +" aktuelle grænse for den specificerede ressource blive udskrevet. Hvis " +"der\n" +" ikke angives noget tilvalg, antages \"-f\".\n" +" \n" +" Værdier angives i forøgelser af 1024 bytes, bortset fra -t som er i " +"sekunder,\n" +" -p som er i forøgelser af 512 bytes og -u som er et uskaleret antal af\n" +" processer.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre der angives et ugyldigt tilvalg, eller hvis " +"der\n" +" opstÃ¥r en fejl." + +#: builtins.c:1465 +msgid "" +"Display or set file mode mask.\n" +" \n" +" Sets the user file-creation mask to MODE. If MODE is omitted, prints\n" +" the current value of the mask.\n" +" \n" +" If MODE begins with a digit, it is interpreted as an octal number;\n" +" otherwise it is a symbolic mode string like that accepted by chmod(1).\n" +" \n" +" Options:\n" +" -p\tif MODE is omitted, output in a form that may be reused as input\n" +" -S\tmakes the output symbolic; otherwise an octal number is output\n" +" \n" +" Exit Status:\n" +" Returns success unless MODE is invalid or an invalid option is given." +msgstr "" +"Vis eller indstil filmasketilstand.\n" +" \n" +" Indstiller brugeres filoprettelsesmaske til TILSTAND. Hvis TILSTAND " +"udelades,\n" +" udskrives den nuværende værdi af masken.\n" +" \n" +" Hvis TILSTAND begynder med et ciffer, bliver det fortolket som et " +"oktalt\n" +" tal, ellers er det en symbolsk tilstandsstreng, ligesom dem der angives\n" +" til chmod(1).\n" +" \n" +" Tilvalg:\n" +" -p\thvis TILSTAND udelades, udskrives der i en form der kan bruges\n" +" \tsom input\n" +" -S\tgør outputtet symbolsk, eller vil output være et oktalt tal\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre TILSTAND er ugyldig, eller hvis et " +"ugyldigt\n" +" tilvalg angives." + +#: builtins.c:1485 +#, fuzzy +msgid "" +"Wait for job completion and return exit status.\n" +" \n" +" Waits for each process identified by an ID, which may be a process ID or " +"a\n" +" job specification, and reports its termination status. If ID is not\n" +" given, waits for all currently active child processes, and the return\n" +" status is zero. If ID is a a job specification, waits for all " +"processes\n" +" in that job's pipeline.\n" +" \n" +" If the -n option is supplied, waits for the next job to terminate and\n" +" returns its exit status.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last ID; fails if ID is invalid or an invalid\n" +" option is given." +msgstr "" +"Vent pÃ¥ færdiggørelse af job og returner afslutningsstatus.\n" +" \n" +" Venter pÃ¥ processen ID. ID kan enten være et proces-id eller en job-\n" +" specifikation, og rapporterer dets afslutningstatus. Hvis ID ikke " +"angives\n" +" ventes pÃ¥ alle aktuelle underprocesser og afslutningsstatussen vil være " +"0.\n" +" Hvis ID er en jobspecifikation ventes pÃ¥ alle processer i dette jobs\n" +" datakanal (pipe).\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer status af ID, fejler hvis ID er ugyldigt eller hvis der " +"angives\n" +" et ugyldigt tilvalg." + +#: builtins.c:1506 +#, fuzzy +msgid "" +"Wait for process completion and return exit status.\n" +" \n" +" Waits for each process specified by a PID and reports its termination " +"status.\n" +" If PID is not given, waits for all currently active child processes,\n" +" and the return status is zero. PID must be a process ID.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last PID; fails if PID is invalid or an " +"invalid\n" +" option is given." +msgstr "" +"Venter pÃ¥ færdiggørelse af proces og returnerer dens afslutningsstatus.\n" +" \n" +" Venter pÃ¥ den angivne proces og rapporterer dens afslutningsstatus. " +"Hvis\n" +" der ikke angives noget PID ventes pÃ¥ alle aktuelle underprocesser og\n" +" afslutningsstatussen er 0. PID skal være et proces-id.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer statussen for ID, fejler hvis ID er ugyldig eller hvis der\n" +" angives et ugyldigt tilvalg." + +#: builtins.c:1521 +msgid "" +"Execute commands for each member in a list.\n" +" \n" +" The `for' loop executes a sequence of commands for each member in a\n" +" list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is\n" +" assumed. For each element in WORDS, NAME is set to that element, and\n" +" the COMMANDS are executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Eksekver kommandoer hvor hvert element i en liste.\n" +" \n" +" \"for\"-løkken eksekverer en sekvens af kommandoer for hvert element i " +"en\n" +" angivet liste af elementer. Hvis \"in ORD ...;\" ikke er tilstede, sÃ¥ " +"antages\n" +" \"in \"$@\"\". For hvert element i ORD, vil NAVN blive sat til det " +"element og\n" +" KOMMANDOER vil blive eksekveret.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer statussen for den sidst eksekverede kommando." + +#: builtins.c:1535 +msgid "" +"Arithmetic for loop.\n" +" \n" +" Equivalent to\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n" +" omitted, it behaves as if it evaluates to 1.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Aritmetisk for-løkke.\n" +" \n" +" Ækvivalent til\n" +" \t(( UDTRYK ))\n" +" \twhile (( UDTRYK )); do\n" +" \t\tKOMMANDOER\n" +" \t\t(( UDTRYK3 ))\n" +" \tdone\n" +" UDTRYK1, UDTRYK2 og UDTRYK3 er aritmetisk udtryk. Hvis et af udtrykkene\n" +" mangler, vil resultatet være som om det evalueredes til 1.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer afslutningsstatussen for den sidst eksekverede kommando." + +#: builtins.c:1553 +msgid "" +"Select words from a list and execute commands.\n" +" \n" +" The WORDS are expanded, generating a list of words. The\n" +" set of expanded words is printed on the standard error, each\n" +" preceded by a number. If `in WORDS' is not present, `in \"$@\"'\n" +" is assumed. The PS3 prompt is then displayed and a line read\n" +" from the standard input. If the line consists of the number\n" +" corresponding to one of the displayed words, then NAME is set\n" +" to that word. If the line is empty, WORDS and the prompt are\n" +" redisplayed. If EOF is read, the command completes. Any other\n" +" value read causes NAME to be set to null. The line read is saved\n" +" in the variable REPLY. COMMANDS are executed after each selection\n" +" until a break command is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Vælg ord fra en liste og eksekver kommandoer.\n" +" \n" +" ORD vil blive udvidet, sÃ¥ledes at der genereres en liste af ord. Denne\n" +" liste af udvidede ord vil blive skrevet til standardfejl, hvert af dem\n" +" med at nummer hæftet foran. Hvis \"in ORD\" ikke er angivet, antages " +"\"in $@\".\n" +" Derefter vil en PS3-prompt blive vist og der vil blive læst en linje " +"fra\n" +" standardinput. Hvis linje bestÃ¥r af et tal, som svarer til et af de\n" +" viste ord, sÃ¥ vil NAVN blive sat til det ord. Hvis linjen er tom, vil " +"ORD\n" +" og prompten blive vist igen. Hvis EOF bliver læst afsluttes kommandoen.\n" +" Hvis der læses en hvilken som helst anden værdi, vil NAVN blive sat til\n" +" null. Den læste linje vil bliver gemt i variablen REPLY. KOMMANDOER vil\n" +" blive eksekveret efter hvert valg indtil en break-kommando eksekveres.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer statussen fra den sidst eksekverede kommando." + +#: builtins.c:1574 +msgid "" +"Report time consumed by pipeline's execution.\n" +" \n" +" Execute PIPELINE and print a summary of the real time, user CPU time,\n" +" and system CPU time spent executing PIPELINE when it terminates.\n" +" \n" +" Options:\n" +" -p\tprint the timing summary in the portable Posix format\n" +" \n" +" The value of the TIMEFORMAT variable is used as the output format.\n" +" \n" +" Exit Status:\n" +" The return status is the return status of PIPELINE." +msgstr "" +"Rapporterer tid brugt ved en datakanals (pipe) eksekvering.\n" +" \n" +" Eksekverer DATAKANAL og udskriv den brugte realtid, bruger-CPU-tid\n" +" og system-CPU-tid, nÃ¥r den er færdig.\n" +" \n" +" Tilvalg:\n" +" -p\tudskriver timingssammendrag i det flytbare (portable)\n" +" POSIX-format\n" +" \n" +" Værdien af variablen TIMEFORMAT bruges som outputformatet.\n" +" \n" +" Afslutningsstatus:\n" +" Afslutningsstatus er afslutningsstatus for DATAKANAL." + +#: builtins.c:1591 +msgid "" +"Execute commands based on pattern matching.\n" +" \n" +" Selectively execute COMMANDS based upon WORD matching PATTERN. The\n" +" `|' is used to separate multiple patterns.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Eksekver kommandoer baseret pÃ¥ mønstersammenligning.\n" +" \n" +" Eksekver selektivt KOMMANDOER nÃ¥r ORD passer til MØNSTER. \"|\" bruges " +"til at\n" +" adskille flere mønstre.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer statussen fra den sidst eksekverede kommando." + +#: builtins.c:1603 +msgid "" +"Execute commands based on conditional.\n" +" \n" +" The `if COMMANDS' list is executed. If its exit status is zero, then " +"the\n" +" `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list " +"is\n" +" executed in turn, and if its exit status is zero, the corresponding\n" +" `then COMMANDS' list is executed and the if command completes. " +"Otherwise,\n" +" the `else COMMANDS' list is executed, if present. The exit status of " +"the\n" +" entire construct is the exit status of the last command executed, or " +"zero\n" +" if no condition tested true.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Eksekverer kommandoer baseret pÃ¥ betingelse.\n" +" \n" +" Listen \"if KOMMANDOER\" bliver eksekveret. Hvis dens afslutningsstatus " +"er\n" +" nul, sÃ¥ vil listen \"then KOMMANDOER\" blive eksekveret. Ellers vil " +"hver\n" +" \"elif KOMMANDOER\"-liste blive eksekveret og hvis de returnerer nul " +"vil\n" +" deres tilhørende \"then KOMMANDER\"-liste blive eksekveret og if-" +"kommandoen\n" +" fuldføres. Ellers vil \"else KOMMANDOER\"-listen blive eksekveret, hvis " +"en\n" +" sÃ¥dan findes. Afslutningsstatus for hele strukturen er afslutnings-\n" +" statussen for den sidste kommando, eller nul hvis ingen betingelse var\n" +" sand.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer statussen fra den sidst eksekverede kommando." + +#: builtins.c:1620 +msgid "" +"Execute commands as long as a test succeeds.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `while' COMMANDS has an exit status of zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Eksekver kommandoer sÃ¥ længe en test evaluerer til sad.\n" +" \n" +" Udvid og eksekver KOMMANDOER sÃ¥ længe den sidste kommando i \"while\"\n" +" KOMMANDOER har en afslutningsstatus pÃ¥ nul.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer statussen fra den sidst eksekverede kommando." + +#: builtins.c:1632 +msgid "" +"Execute commands as long as a test does not succeed.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `until' COMMANDS has an exit status which is not zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Eksekver kommandoer sÃ¥ længe en test ikke evaluerer til falsk.\n" +" \n" +" Udvid og eksekver KOMMANDOER sÃ¥ længe den sidste kommando i \"untill\"\n" +" KOMMANDOER har en afslutningsstatus som ikke er nul.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer statussen fra den sidst eksekverede kommando." + +#: builtins.c:1644 +msgid "" +"Create a coprocess named NAME.\n" +" \n" +" Execute COMMAND asynchronously, with the standard output and standard\n" +" input of the command connected via a pipe to file descriptors assigned\n" +" to indices 0 and 1 of an array variable NAME in the executing shell.\n" +" The default NAME is \"COPROC\".\n" +" \n" +" Exit Status:\n" +" Returns the exit status of COMMAND." +msgstr "" +"Opret en coproces ved navn NAVN.\n" +" \n" +" Eksekver KOMMANDO asynkront, med standardoutput og standardinput\n" +" for kommandoen forbundet via en datakanal (pipe), til fildeskriptorerne\n" +" tildelt til indeks 0 og 1 i en arrayvariabel NAVN i den eksekverende " +"skal.\n" +" Standardnavnet NAVN er \"COPROC\".\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer afslutningsstatussen for KOMMANDO." + +#: builtins.c:1658 +msgid "" +"Define shell function.\n" +" \n" +" Create a shell function named NAME. When invoked as a simple command,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is " +"invoked,\n" +" the arguments are passed to the function as $1...$n, and the function's\n" +" name is in $FUNCNAME.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is readonly." +msgstr "" +"Definer skalfunktion.\n" +" \n" +" Opret en skalfunktion ved navn NAVN. NÃ¥r den køres som en simpel " +"kommando,\n" +" NAVN kører KOMMANDOer i den kaldende skals kontekst. NÃ¥r NAVN kaldes, " +"bliver\n" +" argumenter sendt videre som $1..$n, og funktionens navn som $FUNCNAME.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre NAVN er skrivebeskyttet." + +#: builtins.c:1672 +msgid "" +"Group commands as a unit.\n" +" \n" +" Run a set of commands in a group. This is one way to redirect an\n" +" entire set of commands.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Grupper kommandoer som en enhed.\n" +" \n" +" Kør et sæt af kommandoer i en gruppe. Dette er en mÃ¥de at videresende\n" +" et sæt af kommandoer pÃ¥.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer statussen fra den sidst eksekverede kommando." + +#: builtins.c:1684 +msgid "" +"Resume job in foreground.\n" +" \n" +" Equivalent to the JOB_SPEC argument to the `fg' command. Resume a\n" +" stopped or background job. JOB_SPEC can specify either a job name\n" +" or a job number. Following JOB_SPEC with a `&' places the job in\n" +" the background, as if the job specification had been supplied as an\n" +" argument to `bg'.\n" +" \n" +" Exit Status:\n" +" Returns the status of the resumed job." +msgstr "" +"Genoptag job i forgrunden.\n" +" \n" +" Ækvivalent til JOB_SPEC-argumentet til \"fg\"-kommandoen. Genoptag et " +"stoppet\n" +" job eller et job som ligger i baggrunden. JOB_SPEC kan specificere enten " +"et\n" +" jobnavn eller et jobnummer. Hvis JOB_SPEC efterfølges af en \"&\", vil " +"jobbet\n" +" blive placeret i baggrunden, som om jobspecifikationen var givet som et\n" +" argument til \"bg\".\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer statussen af det genoptagede job." + +#: builtins.c:1699 +msgid "" +"Evaluate arithmetic expression.\n" +" \n" +" The EXPRESSION is evaluated according to the rules for arithmetic\n" +" evaluation. Equivalent to \"let EXPRESSION\".\n" +" \n" +" Exit Status:\n" +" Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise." +msgstr "" +"Evaluer aritmetisk udtryk.\n" +" \n" +" UDTRYK evalueres ifølge reglerne for aritmetisk evaluering. Ækvivalent " +"til\n" +" \"let UDTRYK\".\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer 1 hvis udtrykket evalueres til 0, ellers returneres 0." + +#: builtins.c:1711 +msgid "" +"Execute conditional command.\n" +" \n" +" Returns a status of 0 or 1 depending on the evaluation of the " +"conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries " +"used\n" +" by the `test' builtin, and may be combined using the following " +"operators:\n" +" \n" +" ( EXPRESSION )\tReturns the value of EXPRESSION\n" +" ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" +" EXPR1 && EXPR2\tTrue if both EXPR1 and EXPR2 are true; else false\n" +" EXPR1 || EXPR2\tTrue if either EXPR1 or EXPR2 is true; else false\n" +" \n" +" When the `==' and `!=' operators are used, the string to the right of\n" +" the operator is used as a pattern and pattern matching is performed.\n" +" When the `=~' operator is used, the string to the right of the operator\n" +" is matched as a regular expression.\n" +" \n" +" The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n" +" determine the expression's value.\n" +" \n" +" Exit Status:\n" +" 0 or 1 depending on value of EXPRESSION." +msgstr "" +"Eksekver betingelseskommando.\n" +" \n" +" Returnerer status 0 eller 1 afhængigt af evalueringen af betingelses-\n" +" udtrykket UDTRYK. Udtryk bestÃ¥r af de samme primære elementer som " +"bliver\n" +" brugt i den indbyggede funktion \"test\" og kan kombineres ved brug af " +"følgende\n" +" operatorer:\n" +" \n" +" ( UDTRYK )\tReturnerer værdien af UDTRYK\n" +" ! UDTRYK\t\tSand hvis UDTRYK er falsk, ellers falsk\n" +" UDTR1 && UDTR2\tSand hvis bÃ¥de UDTR1 og UDTR2 er sande, ellers falsk\n" +" UDTR1 && UDTR2\tSand hvis enten UDTR1 eller UDTR2 er sand, ellers " +"falsk\n" +" \n" +" NÃ¥r operatorerne \"==\" og \"!=\" bruges, vil strengen til højre for " +"operatoren\n" +" blive brugt som et mønster og der vil blive udført strengmatching. NÃ¥r\n" +" operatoren \"=~\" bliver brugt, vil strengen til højre for operatoren " +"blive\n" +" matchet som et regulært udtryk.\n" +" \n" +" Operatorerne && og || vil ikke evaluere UDTR2, hvis UDTR1 er nok til at\n" +" afgøre udtrykkets værdi.\n" +"\n" +" Afslutningsstatus:\n" +" 0 eller 1 afhængigt af udtrykkets værdi." + +#: builtins.c:1737 +msgid "" +"Common shell variable names and usage.\n" +" \n" +" BASH_VERSION\tVersion information for this Bash.\n" +" CDPATH\tA colon-separated list of directories to search\n" +" \t\tfor directories given as arguments to `cd'.\n" +" GLOBIGNORE\tA colon-separated list of patterns describing filenames to\n" +" \t\tbe ignored by pathname expansion.\n" +" HISTFILE\tThe name of the file where your command history is stored.\n" +" HISTFILESIZE\tThe maximum number of lines this file can contain.\n" +" HISTSIZE\tThe maximum number of history lines that a running\n" +" \t\tshell can access.\n" +" HOME\tThe complete pathname to your login directory.\n" +" HOSTNAME\tThe name of the current host.\n" +" HOSTTYPE\tThe type of CPU this version of Bash is running under.\n" +" IGNOREEOF\tControls the action of the shell on receipt of an EOF\n" +" \t\tcharacter as the sole input. If set, then the value\n" +" \t\tof it is the number of EOF characters that can be seen\n" +" \t\tin a row on an empty line before the shell will exit\n" +" \t\t(default 10). When unset, EOF signifies the end of input.\n" +" MACHTYPE\tA string describing the current system Bash is running on.\n" +" MAILCHECK\tHow often, in seconds, Bash checks for new mail.\n" +" MAILPATH\tA colon-separated list of filenames which Bash checks\n" +" \t\tfor new mail.\n" +" OSTYPE\tThe version of Unix this version of Bash is running on.\n" +" PATH\tA colon-separated list of directories to search when\n" +" \t\tlooking for commands.\n" +" PROMPT_COMMAND\tA command to be executed before the printing of each\n" +" \t\tprimary prompt.\n" +" PS1\t\tThe primary prompt string.\n" +" PS2\t\tThe secondary prompt string.\n" +" PWD\t\tThe full pathname of the current directory.\n" +" SHELLOPTS\tA colon-separated list of enabled shell options.\n" +" TERM\tThe name of the current terminal type.\n" +" TIMEFORMAT\tThe output format for timing statistics displayed by the\n" +" \t\t`time' reserved word.\n" +" auto_resume\tNon-null means a command word appearing on a line by\n" +" \t\titself is first looked for in the list of currently\n" +" \t\tstopped jobs. If found there, that job is foregrounded.\n" +" \t\tA value of `exact' means that the command word must\n" +" \t\texactly match a command in the list of stopped jobs. A\n" +" \t\tvalue of `substring' means that the command word must\n" +" \t\tmatch a substring of the job. Any other value means that\n" +" \t\tthe command must be a prefix of a stopped job.\n" +" histchars\tCharacters controlling history expansion and quick\n" +" \t\tsubstitution. The first character is the history\n" +" \t\tsubstitution character, usually `!'. The second is\n" +" \t\tthe `quick substitution' character, usually `^'. The\n" +" \t\tthird is the `history comment' character, usually `#'.\n" +" HISTIGNORE\tA colon-separated list of patterns used to decide which\n" +" \t\tcommands should be saved on the history list.\n" +msgstr "" +"Navnene pÃ¥ almindelige skalvariable og deres brug.\n" +" \n" +" BASH_VERSION\tVersionsinformation for denne Bash.\n" +" CDPATH\tEn kolonsepareret liste af mapper som kan gennemsøges for at\n" +" \t\tfinde mapper som er givet som argument til cd.\n" +" GLOBIGNORE\tEn kolonsepareret liste af mønstre som beskriver filnavne " +"som\n" +" \t\tskal ignoreres ved stinavnsudvidelse.\n" +" HISTFILE\tNavnet pÃ¥ den fil hvori din kommandohistorik gemmes.\n" +" HISTFILESIZE\tDet maksimale antal linjer denne fil kan indeholde.\n" +" HISTSIZE\tDet maksimale antal linjer som en kørende skal kan tilgÃ¥.\n" +" HOME\tDet komplette stinavn til din logindmappe.\n" +" HOSTNAME\tNavnet pÃ¥ den aktuelle vært.\n" +" HOSTTYPE\tDen type af CPU som denne version af Bash kører under.\n" +" IGNOREEOF\tKontrollerer skallens handlinger hvis den modtager et EOF-" +"tegn\n" +" \t\tsom eneste input. Hvis den er indstillet, angiver den det antal\n" +" \t\tEOF-tegn som skal følge lige efter hinanden pÃ¥ en tom linje,\n" +" \t\tfør skallen afslutter (standardværdien er 10). Hvis den ikke er\n" +" indstillet vil EOF betyde slutningen af input.\n" +" MACHTYPE\tEn streng som beskriver det aktuelle system som Bash kører " +"pÃ¥.\n" +" MAILCHECK\tHvor ofte Bash tjekker for ny post, i sekunder.\n" +" MAILPATH\tEn kolonsepareret liste af filnavne som Bash tjekker for ny\n" +" \t\tpost.\n" +" OSTYPE\tDen version af Unix som denne version af Bash kører pÃ¥.\n" +" PATH\tEn kolonsepareret liste af mapper som der søges i efter " +"kommandoer.\n" +" PROMPT_COMMAND\tEn kommando som skal eksekveres før hver primære prompt\n" +" \t\tudskrives.\n" +" PS1\t\tStreng for den primære prompt.\n" +" PS2\t\tStreng for den sekundære prompt.\n" +" PWD\t\tDet fulde stinavn for den aktuelle mappe.\n" +" SHELLOPTS\tEn kolonsepareret liste af aktiverede skaltilvalg.\n" +" TERM\tNavnet pÃ¥ den aktuelle skaltype.\n" +" TIMEFORMAT\tOutputformatet for timingstatistik som vises ved hjælp af " +"det\n" +" \t\treserverede ord \"time\".\n" +" auto_resume\tIkke-null betyder at for et kommandoord, som optræder for " +"sig selv\n" +" \t\tpÃ¥ en linje, vil der først blive kigget efter det i listen over\n" +" \t\taktuelt stoppede jobs. Hvis det findes der, vil dette job blive\n" +" bragt i forgrunden. Værdien \"exact\" betyder at " +"kommandoordet\n" +" skal matche et ord fra listen over stoppede jobs præcist.\n" +" Værdien \"substring\" betyder at kommandoordet skal matche " +"en\n" +" delstreng af jobbet. Enhver anden værdi betyder at " +"kommandoen\n" +" skal være et præfiks for et stoppet job.\n" +" histchars\tTegn som kontrollerer historikudvidelse og hurtig " +"substitution\n" +" \t\ti historik. Det første tegn er historik-substitutionstegnet, som\n" +" regel \"!\". Det andet tegn er hurtigsubstitutionstegnet, " +"som\n" +" \t\tregel \"^\". Det tredje tegn er historik-kommentartegnet, som\n" +" \t\tregel \"#\".\n" +" HISTIGNORE\tEn kolonsepareret liste af mønstre som bliver brugt til at\n" +" \t\tbestemme hvilke kommandoer der skal gemmes i historikken.\n" + +#: builtins.c:1794 +msgid "" +"Add directories to stack.\n" +" \n" +" Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" +"Tilføjer mapper til stakken.\n" +" \n" +" Tilføjer en mappe til toppen af stakken, eller roterer stakken, sÃ¥ledes\n" +" at den nye top af stakken bliver den aktuelle mappe. Uden argumenter\n" +" ombyttes de to øverste mapper.\n" +" \n" +" Tilvalg:\n" +" -n\tUndertrykker det mappeskift der normalt følger med tilføjelse\n" +" \taf mapper til stakken, sÃ¥ledes at kun stakken ændres.\n" +" \n" +" Argumenter:\n" +" +N\tRoterer stakken sÃ¥ledes at den N'te mappe (talt fra venstre i\n" +" \tlisten som vises af \"dirs\", startende med nul) vil blive placeret i\n" +" \ttoppen.\n" +" \n" +" -N\tRoterer stakken sÃ¥ledes at den N'te mappe (talt fra højre i\n" +" \tlisten som vises af \"dirs\", startende med nul) vil blive placeret i\n" +" \ttoppen.\n" +" \n" +" mappe\tTilføjer MAPPE til toppen af mappestakken, sÃ¥ledes at den\n" +" \tbliver den aktuelle mappe.\n" +" \n" +" Den indbyggede \"dirs\" viser mappestakken.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre der angives et ugyldigt tilvalg, eller " +"hvis\n" +" mappeskiftet mislykkes." + +#: builtins.c:1828 +msgid "" +"Remove directories from stack.\n" +" \n" +" Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" +"Fjerner mapper fra stakken.\n" +" \n" +" Fjerner en mappe fra stakken. Uden argumenter fjernes den øverste mappe " +"fra\n" +" stakken og der skiftes til den nye aktuelle mappe.\n" +" \n" +" Tilvalg:\n" +" -n\tUndertrykker det mappeskift der normalt følger med fjernelse\n" +" \taf mapper fra stakken, sÃ¥ledes at kun stakken ændres.\n" +" \n" +" Argumenter:\n" +" +N\tFjerner den N'te mappe, talt fra venstre i listen som vises af\n" +" \t\"dirs\", startende med nul. F.eks: vil \"popd +0\" fjerne den første " +"mappe\n" +" \tog \"popd +1\" den anden.\n" +" \n" +" -N\tFjerner den N'te mappe, talt fra højre i listen som vises af\n" +" \t\"dirs\", startende med nul. F.eks: vil \"popd -0\" fjerne den sidste " +"mappe\n" +" \tog \"popd -1\" den andensidste.\n" +" \n" +" Den indbyggede \"dirs\" viser mappestakken.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre der angives et ugyldigt tilvalg, eller " +"hvis\n" +" mappeskiftet mislykkes." + +#: builtins.c:1858 +msgid "" +"Display directory stack.\n" +" \n" +" Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Vis mappestakken.\n" +" \n" +" Vis listen af huskede mapper. Mapper tilføjes denne liste ved hjælp\n" +" af \"pushd\"-kommandoen. Du kan komme tilbage gennem listen med \"popd" +"\"-\n" +" kommandoen.\n" +" \n" +" Tilvalg:\n" +" -c\tryd mappestakken ved at slette alle dens elementer\n" +" -l\tudskriv ikke mapper relativt til din hjemmemappe med et\n" +" foranstillet tildetegn\n" +" -p\tudskriv mappestakken med et element per linje\n" +" -v\tudskriv mappestakken med et element per linje, med dets\n" +" \tposition i stakken foranstillet\n" +" \n" +" Argumenter:\n" +" +N\tViser det N'te element, talt fra venstre i listen som den vises\n" +" af \"dirs\" kørt uden argumenter, talt fra nul.\n" +" -N\tViser det N'te element, talt fra højre i listen som den vises af\n" +" \t\"dirs\" kørt uden argumenter, talt fra nul.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre der angives et ugyldigt tilvalg, eller hvis " +"der\n" +" opstÃ¥r en fejl." + +#: builtins.c:1887 +msgid "" +"Set and unset shell options.\n" +" \n" +" Change the setting of each shell option OPTNAME. Without any option\n" +" arguments, list all shell options with an indication of whether or not " +"each\n" +" is set.\n" +" \n" +" Options:\n" +" -o\trestrict OPTNAMEs to those defined for use with `set -o'\n" +" -p\tprint each shell option with an indication of its status\n" +" -q\tsuppress output\n" +" -s\tenable (set) each OPTNAME\n" +" -u\tdisable (unset) each OPTNAME\n" +" \n" +" Exit Status:\n" +" Returns success if OPTNAME is enabled; fails if an invalid option is\n" +" given or OPTNAME is disabled." +msgstr "" +"Indstil og afindstil (unset) skalvariable.\n" +" \n" +" Ændr indstillinger for hver skalvariabel INDSTNAVN. Uden argumenter " +"vises\n" +" en liste af skalvariable, sammen med information om hvorvidt de er\n" +" indstillet.\n" +" \n" +" Tilvalg:\n" +" -o\tbegræns INDSTNAVN til dem som er defineret til brug med \"set -o" +"\"\n" +" -p\tudskriv alle skalvariable sammen med en indikation af deres\n" +" \tstatus\n" +" -q\tundertryk output\n" +" -s\taktiver (set) hvert INDSTNAVN\n" +" -u\tdeaktiver (unset) hvert INDSTNAVN\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes hvis INDSTNAVN er aktiveret; fejler hvis der angives " +"et\n" +" ugyldigt tilvalg eller hvis INDSTNAVN er deaktiveret." + +#: builtins.c:1908 +#, fuzzy +msgid "" +"Formats and prints ARGUMENTS under control of the FORMAT.\n" +" \n" +" Options:\n" +" -v var\tassign the output to shell variable VAR rather than\n" +" \t\tdisplay it on the standard output\n" +" \n" +" FORMAT is a character string which contains three types of objects: " +"plain\n" +" characters, which are simply copied to standard output; character " +"escape\n" +" sequences, which are converted and copied to the standard output; and\n" +" format specifications, each of which causes printing of the next " +"successive\n" +" argument.\n" +" \n" +" In addition to the standard format specifications described in " +"printf(1),\n" +" printf interprets:\n" +" \n" +" %b\texpand backslash escape sequences in the corresponding argument\n" +" %q\tquote the argument in a way that can be reused as shell input\n" +" %(fmt)T output the date-time string resulting from using FMT as a " +"format\n" +" string for strftime(3)\n" +" \n" +" The format is re-used as necessary to consume all of the arguments. If\n" +" there are fewer arguments than the format requires, extra format\n" +" specifications behave as if a zero value or null string, as " +"appropriate,\n" +" had been supplied.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a write or " +"assignment\n" +" error occurs." +msgstr "" +"Formaterer og udskriver ARGUMENTER formateret efter FORMAT.\n" +" \n" +" Tilvalg:\n" +" -v var\tsend output til skalvariablen VAR i stedet for at vise det " +"via\n" +" \t\tstandardoutput\n" +" \n" +" FORMAT er en tegnstreng som indeholder 3 typer af objekter: Almindelige " +"tegn,\n" +" som kopieres til standardoutput som de er; undvigetegn, som konverteres " +"og\n" +" kopieres til standardoutput; og formatspecifikationer, som hver især " +"fører\n" +" til udskrivningen af det næste argument.\n" +" \n" +" Ud over de standardformatspecifikationer som er beskrevet i printf(1) " +"og\n" +" printf(3), fortolker printf ogsÃ¥ følgende:\n" +" \n" +" %b\tudvid undvigesekvenser med omvendt skrÃ¥streg i det tilsvarende\n" +" \targument\n" +" %q\tciter argumenter pÃ¥ en mÃ¥de sÃ¥ de kan genbruges som skalinput\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre der angives et ugyldigt tilvalg, eller " +"hvis\n" +" der opstÃ¥r en skrive- eller tildelingsfejl." + +#: builtins.c:1942 +#, fuzzy +msgid "" +"Specify how arguments are to be completed by Readline.\n" +" \n" +" For each NAME, specify how arguments are to be completed. If no " +"options\n" +" are supplied, existing completion specifications are printed in a way " +"that\n" +" allows them to be reused as input.\n" +" \n" +" Options:\n" +" -p\tprint existing completion specifications in a reusable format\n" +" -r\tremove a completion specification for each NAME, or, if no\n" +" \tNAMEs are supplied, all completion specifications\n" +" -D\tapply the completions and actions as the default for commands\n" +" \twithout any specific completion defined\n" +" -E\tapply the completions and actions to \"empty\" commands --\n" +" \tcompletion attempted on a blank line\n" +" \n" +" When completion is attempted, the actions are applied in the order the\n" +" uppercase-letter options are listed above. The -D option takes\n" +" precedence over -E.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Specificer hvordan argumenter fuldføres af Readline.\n" +" \n" +" Specificer hvordan argumenter skal fuldføres for hvert NAVN. Hvis der\n" +" ikke er angivet nogen tilvalg, vil de eksisterende fuldførsels-\n" +" specifikationer blive udskrevet pÃ¥ en form der tillader dem at blive\n" +" genbrugt som input.\n" +" \n" +" Tilvalg:\n" +" -p\tudskriv eksisterende fuldførselsspecifikationer i et format\n" +" \tsom kan genbruges\n" +" -r\tfjern en fuldførselsspecifikation for hvert NAVN, eller,\n" +" \thvis der ikke er angivet nogle NAVNe, alle fuldførselsspecifikationer\n" +" \n" +" NÃ¥r fuldførsel forsøges, vil handlinger blive anvendt i den rækkefølge,\n" +" som de tilvalg som har store bogstaver, stÃ¥r i.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre der angives et ugyldigt tilvalg, eller " +"hvis\n" +" der opstÃ¥r en fejl." + +#: builtins.c:1970 +msgid "" +"Display possible completions depending on the options.\n" +" \n" +" Intended to be used from within a shell function generating possible\n" +" completions. If the optional WORD argument is supplied, matches " +"against\n" +" WORD are generated.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Vis mulige fuldførsler afhængigt af indstillingerne.\n" +" \n" +" Beregnet til brug i skalfunktioner som genererer de mulige " +"fuldførelser.\n" +" Hvis det valgfrie ORD angives, vil der blive genereret fuldførsler som\n" +" matcher ORD.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre der angives et ugyldigt tilvalg, eller " +"hvis\n" +" der opstÃ¥r en fejl." + +# Fejlrapport +#: builtins.c:1985 +#, fuzzy +msgid "" +"Modify or display completion options.\n" +" \n" +" Modify the completion options for each NAME, or, if no NAMEs are " +"supplied,\n" +" the completion currently being executed. If no OPTIONs are given, " +"print\n" +" the completion options for each NAME or the current completion " +"specification.\n" +" \n" +" Options:\n" +" \t-o option\tSet completion option OPTION for each NAME\n" +" \t-D\t\tChange options for the \"default\" command completion\n" +" \t-E\t\tChange options for the \"empty\" command completion\n" +" \n" +" Using `+o' instead of `-o' turns off the specified option.\n" +" \n" +" Arguments:\n" +" \n" +" Each NAME refers to a command for which a completion specification must\n" +" have previously been defined using the `complete' builtin. If no NAMEs\n" +" are supplied, compopt must be called by a function currently generating\n" +" completions, and the options for that currently-executing completion\n" +" generator are modified.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or NAME does not\n" +" have a completion specification defined." +msgstr "" +"Ændr eller vis indstillinger for fuldførsel.\n" +" \n" +" Ændr fuldførselsindstillinger for hvert NAVN, eller, hvis der ikke er\n" +" angivet nogle NAVNe, fuldførslen der bliver eksekveret nu. Hvis der " +"ikke\n" +" er angivet nogle tilvalg, vil fuldførslen for hvert navn eller den\n" +" aktuelle fuldførsel blive udskrevet.\n" +" \n" +" Tilvalg:\n" +" \t-o indstilling\tIndstil fuldførselsindstillingen INDSTILLING for\n" +" \t\t\thvert NAVN.\n" +" Ved brug af \"+o\" i stedet for \"-o\" vil den specificerede indstilling " +"blive\n" +" slÃ¥et fra.\n" +" \n" +" Argumenter:\n" +" \n" +" Hvert NAVN refererer til en kommando, for hvilken der tidligere er " +"blevet\n" +" angivet en fuldførselsspecifikation med den indbyggede \"complete\". " +"Hvis\n" +" der ikke er angivet nogle NAVNe, sÃ¥ skal compopt kaldes af den funktion " +"som\n" +" genererer fuldførsler nu og sÃ¥ vil indstillingerne for den aktuelt\n" +" kørende fuldførselsgenerator blive modificeret.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre der angives et ugyldigt tilvalg, eller " +"hvis\n" +" der ikke er defineret en fuldførselsspecifikation for NAVN." + +#: builtins.c:2015 +#, fuzzy +msgid "" +"Read lines from the standard input into an indexed array variable.\n" +" \n" +" Read lines from the standard input into the indexed array variable " +"ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable " +"MAPFILE\n" +" is the default ARRAY.\n" +" \n" +" Options:\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are " +"copied.\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default " +"index is 0.\n" +" -s count \tDiscard the first COUNT lines read.\n" +" -t\t\tRemove a trailing newline from each line read.\n" +" -u fd\t\tRead lines from file descriptor FD instead of the standard " +"input.\n" +" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read.\n" +" -c quantum\tSpecify the number of lines read between each call to " +"CALLBACK.\n" +" \n" +" Arguments:\n" +" ARRAY\t\tArray variable name to use for file data.\n" +" \n" +" If -C is supplied without -c, the default quantum is 5000. When\n" +" CALLBACK is evaluated, it is supplied the index of the next array\n" +" element to be assigned and the line to be assigned to that element\n" +" as additional arguments.\n" +" \n" +" If not supplied with an explicit origin, mapfile will clear ARRAY " +"before\n" +" assigning to it.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or ARRAY is readonly " +"or\n" +" not an indexed array." +msgstr "" +"Læs linjer ind i en arrayvariabel fra standardinput.\n" +" \n" +" Læs linjer ind i en arrayvariabel ARRAY fra standardinput, eller fra en\n" +" fildeskriptor FD, hvis tilvalget -u er givet. Variablen MAPFIL er " +"forvalgt\n" +" som ARRAY.\n" +" \n" +" Tilvalg:\n" +" -n antal\tKopier højst ANTAL linjer. Hvis ANTAL er 0 kopieres alle " +"linjer.\n" +" -O start\tBegynd at skrive til ARRAY ved indeks START. Standardværdien " +"er\n" +" \t0.\n" +" -s antal\tSmid de første ANTAL læste linjer væk.\n" +" -t \tFjern et efterfølgende nylinjetegn fra slutningen af hver linje.\n" +" -u fd\tLæs linjer fra fildeskriptoren FD i stedet for fra standard-\n" +" \t\tinput.\n" +" -C tilbagekald\tEvaluer TILBAGEKALD hver gang KVANTUM linjer er læst.\n" +" -c kvantum\tSpecificer antallet af linjer imellem hvert kald til\n" +" \t\t\tTILBAGEKALD\n" +" \n" +" Argumenter:\n" +" ARRAY\t\tNavn for arrayvariabel som skal bruges til fildata.\n" +" \n" +" Hvis -C er angivet uden -c er standardkvantum 5000. NÃ¥r TILBAGEKALD\n" +" kaldes, vil den fÃ¥ det næste arrayindeks, som vil blive brugt som et " +"ekstra\n" +" argument.\n" +" \n" +" Med mindre et startpunkt i arrayet eksplicit angives, vil mapfile rydde\n" +" ARRAY, inden skrivning til den pÃ¥begyndes.\n" +" \n" +" Afslutningsstatus:\n" +" Returnerer succes med mindre der angives at ugyldigt tilvalg, eller " +"hvis\n" +" ARRAY er skrivebeskyttet." + +#: builtins.c:2049 +msgid "" +"Read lines from a file into an array variable.\n" +" \n" +" A synonym for `mapfile'." +msgstr "" +"Læs linjer fra en fil ind i en arrayvariabel.\n" +" \n" +" Et synonym for \"mapfile\"." + +#, fuzzy +#~ msgid "Copyright (C) 2009 Free Software Foundation, Inc.\n" +#~ msgstr "Ophavsret (C) 2009 Free Software Foundation, Inc." + +#, fuzzy +#~ msgid "" +#~ "License GPLv2+: GNU GPL version 2 or later \n" +#~ msgstr "" +#~ "Licens GPLv3+: GNU GPL version 3 eller senere \n" + +#~ msgid "wait [pid]" +#~ msgstr "wait [pid]" + +#~ msgid "xrealloc: cannot reallocate %lu bytes (%lu bytes allocated)" +#~ msgstr "xrealloc: kan ikke allokere %lu bytes (%lu bytes allokeret)" + +#~ msgid "xrealloc: cannot allocate %lu bytes" +#~ msgstr "xrealloc: kan ikke allokere %lu bytes" + +#~ msgid "xrealloc: %s:%d: cannot reallocate %lu bytes (%lu bytes allocated)" +#~ msgstr "" +#~ "xrealloc: %s:%d: kan ikke reallokere %lu bytes (%lu bytes allokeret)" diff --git a/po/de.gmo b/po/de.gmo new file mode 100644 index 0000000000000000000000000000000000000000..c381b93af1fe487de6a0e244dcf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EJjeh5 literal 0 HcmV?d00001 diff --git a/po/de.po b/po/de.po new file mode 100644 index 0000000..0d28040 --- /dev/null +++ b/po/de.po @@ -0,0 +1,4778 @@ +# German language file for GNU Bash 4.3 +# Copyright (C) 2011 Free Software Foundation, Inc. +# This file is distributed under the same license as the bash package. +# Nils Naumann , 1996-2013. +msgid "" +msgstr "" +"Project-Id-Version: bash 4.3-rc2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-02-11 11:19-0500\n" +"PO-Revision-Date: 2014-02-02 18:23+0100\n" +"Last-Translator: Nils Naumann \n" +"Language-Team: German \n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8-bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: arrayfunc.c:51 +msgid "bad array subscript" +msgstr "Falscher Feldbezeichner." + +#: arrayfunc.c:356 builtins/declare.def:566 +#, c-format +msgid "%s: cannot convert indexed to associative array" +msgstr "%s: Kann nicht das indizierte in ein assoziatives Array umwandeln." + +#: arrayfunc.c:539 +#, c-format +msgid "%s: invalid associative array key" +msgstr "%s: Ungültiger Schlüssel für das assoziative Array." + +#: arrayfunc.c:541 +#, c-format +msgid "%s: cannot assign to non-numeric index" +msgstr "%s: Kann nicht auf einen nicht-numerischen Index zuweisen." + +#: arrayfunc.c:586 +#, c-format +msgid "%s: %s: must use subscript when assigning associative array" +msgstr "" +"%s: %s: Ein Feldbezeicher wird zum Zuweisen eines assoziativen Arrays " +"benötigt." + +#: bashhist.c:388 +#, c-format +msgid "%s: cannot create: %s" +msgstr "%s: Kann die Datei %s nicht erzeugen." + +#: bashline.c:3982 +msgid "bash_execute_unix_command: cannot find keymap for command" +msgstr "" +"bash_execute_unix_command: Kann nicht die Tastenzuordnung für das Kommando " +"finden." + +#: bashline.c:4069 +#, c-format +msgid "%s: first non-whitespace character is not `\"'" +msgstr " %s: Das erste Zeichen ist nicht `\\'." + +#: bashline.c:4098 +#, c-format +msgid "no closing `%c' in %s" +msgstr "fehlende schließende `%c' in %s." + +#: bashline.c:4132 +#, c-format +msgid "%s: missing colon separator" +msgstr "%s: Fehlender Doppelpunkt." + +#: braces.c:321 +#, c-format +msgid "brace expansion: cannot allocate memory for %s" +msgstr "" + +#: braces.c:413 +#, c-format +msgid "brace expansion: failed to allocate memory for %d elements" +msgstr "" + +#: braces.c:452 +#, c-format +msgid "brace expansion: failed to allocate memory for `%s'" +msgstr "" + +#: builtins/alias.def:132 +#, c-format +msgid "`%s': invalid alias name" +msgstr "`%s': Ungültiger Alias Name." + +#: builtins/bind.def:123 builtins/bind.def:126 +msgid "line editing not enabled" +msgstr "Zeileneditierung ist nicht aktiviert." + +#: builtins/bind.def:212 +#, c-format +msgid "`%s': invalid keymap name" +msgstr "`%s': Ungültiger KEYMAP Name." + +#: builtins/bind.def:251 +#, c-format +msgid "%s: cannot read: %s" +msgstr "%s: Nicht lesbar: %s" + +#: builtins/bind.def:266 +#, c-format +msgid "`%s': cannot unbind" +msgstr "`%s': Bindung kann nicht gelöst werden." + +#: builtins/bind.def:304 builtins/bind.def:334 +#, c-format +msgid "`%s': unknown function name" +msgstr "%s: Unbekannter Funktionsname." + +#: builtins/bind.def:312 +#, c-format +msgid "%s is not bound to any keys.\n" +msgstr "%s ist keiner Taste zugeordnet.\n" + +#: builtins/bind.def:316 +#, c-format +msgid "%s can be invoked via " +msgstr "%s kann aufgerufen werden durch " + +#: builtins/break.def:77 builtins/break.def:117 +msgid "loop count" +msgstr "Schleifen Zähler" + +#: builtins/break.def:137 +msgid "only meaningful in a `for', `while', or `until' loop" +msgstr "nur in einer `for', `while' oder `until' Schleife sinnvoll." + +# Problem mit Extraktion des Strings +#: builtins/caller.def:134 +msgid "" +"Returns the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns " +msgstr "" + +#: builtins/cd.def:319 +msgid "HOME not set" +msgstr "HOME ist nicht zugewiesen." + +#: builtins/cd.def:327 builtins/common.c:166 test.c:876 +msgid "too many arguments" +msgstr "Zu viele Argumente." + +#: builtins/cd.def:338 +msgid "OLDPWD not set" +msgstr "OLDPWD ist nicht zugewiesen." + +# Debug Ausgabe +#: builtins/common.c:101 +#, c-format +msgid "line %d: " +msgstr "Zeile %d: " + +#: builtins/common.c:139 error.c:265 +#, c-format +msgid "warning: " +msgstr "Warnung: " + +#: builtins/common.c:153 +#, c-format +msgid "%s: usage: " +msgstr "%s: Gebrauch: " + +#: builtins/common.c:191 shell.c:506 shell.c:788 +#, c-format +msgid "%s: option requires an argument" +msgstr "%s: Ein numerischer Paremeter ist erforderlich." + +#: builtins/common.c:198 +#, c-format +msgid "%s: numeric argument required" +msgstr "%s: Ein numerischer Parameter ist erforderlich." + +#: builtins/common.c:205 +#, c-format +msgid "%s: not found" +msgstr "%s: Nicht gefunden." + +#: builtins/common.c:214 shell.c:801 +#, c-format +msgid "%s: invalid option" +msgstr "%s: Ungültige Option" + +#: builtins/common.c:221 +#, c-format +msgid "%s: invalid option name" +msgstr "%s: Ungültiger Optionsname." + +#: builtins/common.c:228 general.c:235 general.c:240 +#, c-format +msgid "`%s': not a valid identifier" +msgstr "`%s': Ist kein gültiger Bezeichner." + +#: builtins/common.c:238 +msgid "invalid octal number" +msgstr "Ungültige Oktalzahl." + +#: builtins/common.c:240 +msgid "invalid hex number" +msgstr "Ungültige hexadezimale Zahl." + +#: builtins/common.c:242 expr.c:1470 +msgid "invalid number" +msgstr "Ungültige Zahl." + +#: builtins/common.c:250 +#, c-format +msgid "%s: invalid signal specification" +msgstr "%s: Ungültige Signalbezeichnung." + +#: builtins/common.c:257 +#, c-format +msgid "`%s': not a pid or valid job spec" +msgstr "`%s': Ist keine gültige Prozess- oder Jobbezeichnung." + +#: builtins/common.c:264 error.c:488 +#, c-format +msgid "%s: readonly variable" +msgstr "%s: Schreibgeschützte Variable." + +#: builtins/common.c:272 +#, c-format +msgid "%s: %s out of range" +msgstr "%s: %s ist außerhalb des Gültigkeitsbereiches." + +#: builtins/common.c:272 builtins/common.c:274 +msgid "argument" +msgstr "Argument" + +#: builtins/common.c:274 +#, c-format +msgid "%s out of range" +msgstr "%s ist außerhalb des Gültigkeitsbereiches." + +#: builtins/common.c:282 +#, c-format +msgid "%s: no such job" +msgstr "%s: Kein solcher Job." + +#: builtins/common.c:290 +#, c-format +msgid "%s: no job control" +msgstr "%s: Keine Job Steuerung in dieser Shell." + +#: builtins/common.c:292 +msgid "no job control" +msgstr "Keine Job Steuerung in dieser Shell." + +#: builtins/common.c:302 +#, c-format +msgid "%s: restricted" +msgstr "%s: gesperrt" + +#: builtins/common.c:304 +msgid "restricted" +msgstr "gesperrt" + +#: builtins/common.c:312 +#, c-format +msgid "%s: not a shell builtin" +msgstr "%s: Ist kein Shell Kommando." + +#: builtins/common.c:321 +#, c-format +msgid "write error: %s" +msgstr "Schreibfehler: %s." + +#: builtins/common.c:329 +#, c-format +msgid "error setting terminal attributes: %s" +msgstr "Fehler beim Setzen der Terminalattribute: %s" + +#: builtins/common.c:331 +#, c-format +msgid "error getting terminal attributes: %s" +msgstr "Fehler beim Ermitteln der Terminalattribute: %s" + +#: builtins/common.c:563 +#, c-format +msgid "%s: error retrieving current directory: %s: %s\n" +msgstr "%s: Kann das aktuelle Verzeichnis nicht wiederfinden: %s: %s\n" + +#: builtins/common.c:629 builtins/common.c:631 +#, c-format +msgid "%s: ambiguous job spec" +msgstr "%s: Mehrdeutige Job Bezeichnung." + +#: builtins/complete.def:277 +#, c-format +msgid "%s: invalid action name" +msgstr "%s: Ungültige Methode." + +#: builtins/complete.def:450 builtins/complete.def:645 +#: builtins/complete.def:855 +#, c-format +msgid "%s: no completion specification" +msgstr "%s: Keine Komplettierung angegeben." + +#: builtins/complete.def:697 +msgid "warning: -F option may not work as you expect" +msgstr "Warnung: Die -F Option könnte unerwartete Ergebnisse liefern." + +#: builtins/complete.def:699 +msgid "warning: -C option may not work as you expect" +msgstr "Warnung: Die -C Option könnte unerwartete Ergebnisse liefern." + +#: builtins/complete.def:828 +msgid "not currently executing completion function" +msgstr "Gegenwärtig wird keine Komplettierungsfunktion ausgeführt." + +#: builtins/declare.def:126 +msgid "can only be used in a function" +msgstr "kann nur innerhalb einer Funktion benutzt werden." + +#: builtins/declare.def:315 builtins/declare.def:509 +#, c-format +msgid "%s: reference variable cannot be an array" +msgstr "" + +#: builtins/declare.def:324 +#, c-format +msgid "%s: nameref variable self references not allowed" +msgstr "" + +#: builtins/declare.def:398 +msgid "cannot use `-f' to make functions" +msgstr "Mit `-f' können keine Funktionen erzeugt werden." + +#: builtins/declare.def:410 execute_cmd.c:5361 +#, c-format +msgid "%s: readonly function" +msgstr "%s: Schreibgeschützte Funktion." + +#: builtins/declare.def:553 +#, c-format +msgid "%s: cannot destroy array variables in this way" +msgstr "%s: Kann Feldvariablen nicht auf diese Art löschen." + +#: builtins/declare.def:560 builtins/read.def:733 +#, c-format +msgid "%s: cannot convert associative to indexed array" +msgstr "" +"%s: Konvertieren von assoziativen in indizierte Arrays ist nicht möglich." + +#: builtins/enable.def:137 builtins/enable.def:145 +msgid "dynamic loading not available" +msgstr "Dynamisches Laden ist nicht verfügbar." + +#: builtins/enable.def:312 +#, c-format +msgid "cannot open shared object %s: %s" +msgstr "Kann die dynamische Bibiliothek nicht laden %s: %s" + +#: builtins/enable.def:335 +#, c-format +msgid "cannot find %s in shared object %s: %s" +msgstr "Kann %s nicht in der dynamischen Bibiliothek finden %s: %s" + +#: builtins/enable.def:459 +#, c-format +msgid "%s: not dynamically loaded" +msgstr "%s: Ist nicht dynamisch geladen." + +#: builtins/enable.def:474 +#, c-format +msgid "%s: cannot delete: %s" +msgstr "%s: Kann nicht löschen: %s" + +#: builtins/evalfile.c:140 builtins/hash.def:171 execute_cmd.c:5208 +#: shell.c:1481 +#, c-format +msgid "%s: is a directory" +msgstr "%s: ist ein Verzeichnis." + +#: builtins/evalfile.c:146 +#, c-format +msgid "%s: not a regular file" +msgstr "%s: Ist keine normale Datei." + +#: builtins/evalfile.c:155 +#, c-format +msgid "%s: file is too large" +msgstr "%s: Die Datei ist zu groß." + +#: builtins/evalfile.c:190 builtins/evalfile.c:208 shell.c:1491 +#, c-format +msgid "%s: cannot execute binary file" +msgstr "%s: Kann die Datei nicht ausführen." + +#: builtins/exec.def:154 builtins/exec.def:156 builtins/exec.def:228 +#, c-format +msgid "%s: cannot execute: %s" +msgstr "%s: Kann nicht ausführen: %s" + +#: builtins/exit.def:65 +#, c-format +msgid "logout\n" +msgstr "Abgemeldet\n" + +#: builtins/exit.def:88 +msgid "not login shell: use `exit'" +msgstr "Keine Login Shell: Mit `exit' abmelden!" + +#: builtins/exit.def:120 +#, c-format +msgid "There are stopped jobs.\n" +msgstr "Es gibt noch angehaltene Prozesse.\n" + +#: builtins/exit.def:122 +#, c-format +msgid "There are running jobs.\n" +msgstr "Es gibt noch laufende Prozesse.\n" + +#: builtins/fc.def:262 +msgid "no command found" +msgstr "Kein Kommando gefunden." + +#: builtins/fc.def:320 builtins/fc.def:369 +msgid "history specification" +msgstr "" + +#: builtins/fc.def:390 +#, c-format +msgid "%s: cannot open temp file: %s" +msgstr "%s: Kann die tempräre Datei nicht öffnen: %s" + +#: builtins/fg_bg.def:149 builtins/jobs.def:282 +msgid "current" +msgstr "gegenwärtig" + +#: builtins/fg_bg.def:158 +#, c-format +msgid "job %d started without job control" +msgstr "Job %d wurde ohne Jobsteuerung gestartet." + +#: builtins/getopt.c:110 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: Ungültige Option -- %c\n" + +#: builtins/getopt.c:111 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: Diese Option erfordert ein Argument -- %c\n" + +#: builtins/hash.def:92 +msgid "hashing disabled" +msgstr "Hashing deaktiviert." + +#: builtins/hash.def:138 +#, c-format +msgid "%s: hash table empty\n" +msgstr "%s: Die Hashtabelle ist leer.\n" + +#: builtins/hash.def:245 +#, c-format +msgid "hits\tcommand\n" +msgstr "Treffer\tBefehl\n" + +#: builtins/help.def:130 +#, c-format +msgid "Shell commands matching keyword `" +msgid_plural "Shell commands matching keywords `" +msgstr[0] "Shell Kommandos auf die das Schlüsselwort zutrifft `" +msgstr[1] "Shell Kommandos auf die die Schlüsselwörter zutreffen `" + +#: builtins/help.def:182 +#, c-format +msgid "" +"no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." +msgstr "" +"Auf `%s' trifft kein Hilfethema zu. Probieren Sie `help help', `man -k %s' " +"oder `info %s'." + +#: builtins/help.def:199 +#, c-format +msgid "%s: cannot open: %s" +msgstr "%s: Kann die Datei nicht öffnen: %s" + +#: builtins/help.def:485 +#, c-format +msgid "" +"These shell commands are defined internally. Type `help' to see this list.\n" +"Type `help name' to find out more about the function `name'.\n" +"Use `info bash' to find out more about the shell in general.\n" +"Use `man -k' or `info' to find out more about commands not in this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" +msgstr "" +"Die Shell Kommandos sind intern definiert. Mit `help' kann eine Liste\n" +"angesehen werden. Durch `help Name' wird eine Beschreibung der\n" +"Funktion `Name' angezeigt. Die Dokumentation ist mit `info bash'\n" +"einsehbar. Detaillierte Beschreibungen der Shellkommandos sind mit\n" +"`man -k' oder `info' abrufbar.\n" +"\n" +"Ein Stern (*) neben dem Namen kennzeichnet deaktivierte Kommandos.\n" +"\n" + +#: builtins/history.def:154 +msgid "cannot use more than one of -anrw" +msgstr "Es darf nur eine Option aus -anrw angegeben werden." + +#: builtins/history.def:186 +msgid "history position" +msgstr "Kommandostapelposition." + +#: builtins/history.def:366 +#, c-format +msgid "%s: history expansion failed" +msgstr "%s: Kommandoersetzung gescheitert." + +#: builtins/inlib.def:71 +#, c-format +msgid "%s: inlib failed" +msgstr "%s: inlib gescheitert." + +#: builtins/jobs.def:109 +msgid "no other options allowed with `-x'" +msgstr "Keine weiteren Optionen mit `-x' erlaubt." + +#: builtins/kill.def:200 +#, c-format +msgid "%s: arguments must be process or job IDs" +msgstr "%s: Die Argumente müssen Prozess- oder Jobbezeichnungen sein." + +#: builtins/kill.def:263 +msgid "Unknown error" +msgstr "Unbekannter Fehler." + +#: builtins/let.def:95 builtins/let.def:120 expr.c:583 expr.c:598 +msgid "expression expected" +msgstr "Ausdruck erwartet." + +#: builtins/mapfile.def:172 +#, c-format +msgid "%s: not an indexed array" +msgstr "%s: Ist kein indiziertes Array." + +#: builtins/mapfile.def:259 builtins/read.def:302 +#, c-format +msgid "%s: invalid file descriptor specification" +msgstr "%s: Ungültige Datei-Deskriptor Angabe." + +#: builtins/mapfile.def:267 builtins/read.def:309 +#, c-format +msgid "%d: invalid file descriptor: %s" +msgstr "%d: Ungültiger Datei-Deskriptor: %s" + +#: builtins/mapfile.def:276 builtins/mapfile.def:314 +#, c-format +msgid "%s: invalid line count" +msgstr "%s: Ungültige Zeilenanzahlangabe." + +#: builtins/mapfile.def:287 +#, c-format +msgid "%s: invalid array origin" +msgstr "%s: Ungültiger Zeilenindex für den Array Beginn." + +#: builtins/mapfile.def:304 +#, c-format +msgid "%s: invalid callback quantum" +msgstr "" + +#: builtins/mapfile.def:336 +msgid "empty array variable name" +msgstr "Fehlender Name für die Array Variable." + +#: builtins/mapfile.def:357 +msgid "array variable support required" +msgstr "Die Array Variablen Unterstützung ist in dieser Shell nicht vorhanden." + +#: builtins/printf.def:402 +#, c-format +msgid "`%s': missing format character" +msgstr "`%s': Fehlendes Formatierungszeichen." + +#: builtins/printf.def:456 +#, c-format +msgid "`%c': invalid time format specification" +msgstr "`%c': Ungültige Zeitformatangabe." + +#: builtins/printf.def:658 +#, c-format +msgid "`%c': invalid format character" +msgstr "`%c': Ungültiges Formatierungszeichen." + +#: builtins/printf.def:684 +#, c-format +msgid "warning: %s: %s" +msgstr "Warnung: %s: %s" + +#: builtins/printf.def:768 +#, c-format +msgid "format parsing problem: %s" +msgstr "" + +#: builtins/printf.def:865 +msgid "missing hex digit for \\x" +msgstr "Fehlende hexadezimale Ziffer nach \\x." + +#: builtins/printf.def:880 +#, c-format +msgid "missing unicode digit for \\%c" +msgstr "Fehlendes Unicode Zeichen für \\%c." + +#: builtins/pushd.def:195 +msgid "no other directory" +msgstr "kein anderes Verzeichnis" + +#: builtins/pushd.def:354 +#, c-format +msgid "%s: invalid argument" +msgstr "%s: Ungültiges Argument." + +#: builtins/pushd.def:468 +msgid "" +msgstr "" + +#: builtins/pushd.def:512 +msgid "directory stack empty" +msgstr "Der Verzeichnisstapel ist leer." + +#: builtins/pushd.def:514 +msgid "directory stack index" +msgstr "Verzeichnisstapelindex" + +#: builtins/pushd.def:689 +msgid "" +"Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +"\tdirs when invoked without options, starting with zero." +msgstr "" +"Zeigt die Liste der gegenwärtig gespeicherten Verzeichnisse an. Durch\n" +" das »pushd« Kommando werden die Verzeichnisse auf den Stapel gelegt\n" +" und können durch das »popd« Kommando wieder vom Stapel entfernt\n" +" werden.\n" +"\n" +" Optionen:\n" +"\t-c\tVerzeichnisstapel durch Löschen aller Einträge bereinigen.\n" +"\t-l\tDas Heimatverzeichnis wird nicht mit vorangestellter Tilde\n" +"\tausgegeben\n" +"\t-p\tDen Verzeichnisstapel zeilenweise ausgeben.\n" +"\t-v\tDen Verzeichnisstapel zeilenweise mit vorangestellter\n" +"\tPositionsnummer auseben.\n" +"\n" +" Argumente:\n" +"\t+N\tZeigt den N'ten Eintrag von links an, der von »dirs« ausgegeben\n" +"\twird, wenn es ohne Optionen aufgerufen wird, beginnend mit Null.\n" +"\t-N\tZeigt den N'ten Eintrag von rechts an, der von »dirs« ausgegeben\n" +"\twird, wenn es ohne Optionen aufgerufen wird, beginnend mit Null." + +#: builtins/pushd.def:711 +msgid "" +"Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Legt ein Verzeichniseintrag auf den Verzeichnisstapel ab oder rotiert\n" +"den Stapel so, dass das aktuelle Verzeichnis oben liegt. Ohne Argumente\n" +"werden die beiden oberen Einträge vertauscht.\n" +"\n" +" Optionen: \n" +" -n\tVermeidet das Wechseln des Verzeichnisses, so dass\n" +"\tnur der Verzeichnisstapel geändert wird.\n" +"\n" +" Argumente:\n" +" +N\tRotiert den Verzeichnisstapel, dass das N-te Verzeichnis\n" +"\tvon links, das von `dirs' angezeigt wird, nach oben kommt. Die Zählung\n" +"\tbeginnt dabei mit Null.\n" +"\n" +" -N\tRotiert den Verzeichnisstapel, dass das N-te Verzeichnis\n" +"\tvon rechts, das von `dirs' angezeigt wird, nach oben kommt. Die \n" +"\tZählung beginnt dabei mit Null.\n" +"\n" +" dir\tLegt DIR auf den Verzeichnisstapel und wechselt in dieses\n" +" Verzeichnis.\n" +" \n" +" Das `dirs' Kommando zeigt den Verueichnisstapel an." + +#: builtins/pushd.def:736 +msgid "" +"Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Erntfernt Einträge vom Stapel. Ohne Argumente wird der oberste Eintrag\n" +" gelöscht und anschließend in das das neue oben liegede Verzeichnis\n" +" gewechselt.\n" +" \n" +" Optionen:\n" +" -n\tVermeidet das Wechseln des Verzeichnisses, so dass\n" +"\tnur der Verzeichnisstapel geändert wird.\n" +" \n" +" Argumente:\n" +" +N\tEntfernt den N-ten Eintrag von links, der von `dirs'\n" +"\tangezeigt wird. Dabei beginnt die Zählung von Null. So\n" +"\tentfernt z.B. `popd +0' den ersten und `popd +1' den zweiten\n" +"\tEintrag.\n" +" \n" +" -N\tEntfernt den N-ten Eintrag von rechts, der von `dirs'\n" +"\tangezeigt wird. Dabei beginnt die Zählung von Null. So\n" +"\tentfernt z.B. `popd -0' den letzten und `popd +1' den vorletzten\n" +"\tEintrag.\n" +" \n" +" Das `dirs' Kommando zeigt den Verzeichnisstapel an." + +#: builtins/read.def:275 +#, c-format +msgid "%s: invalid timeout specification" +msgstr "%s: Ungültige Wartezeitangebe." + +#: builtins/read.def:678 +#, c-format +msgid "read error: %d: %s" +msgstr "Lesefehler: %d: %s" + +#: builtins/return.def:75 +msgid "can only `return' from a function or sourced script" +msgstr "" +"»Return« ist nur aus einer Funktion oder einem mit »source« ausgefühten " +"Skript möglich." + +#: builtins/set.def:782 +msgid "cannot simultaneously unset a function and a variable" +msgstr "" +"Gleichzeitiges `unset' einer Funktion und einer Variable ist nicht möglich." + +#: builtins/set.def:826 +#, c-format +msgid "%s: cannot unset" +msgstr "%s: `unset' nicht möglich." + +#: builtins/set.def:843 +#, c-format +msgid "%s: cannot unset: readonly %s" +msgstr "%s: `unset' nicht möglich: Schreibgeschützt %s" + +#: builtins/set.def:854 +#, c-format +msgid "%s: not an array variable" +msgstr "%s: Ist keine Feldvariable." + +#: builtins/setattr.def:187 +#, c-format +msgid "%s: not a function" +msgstr "%s: Ist keine Funktion." + +#: builtins/shift.def:71 builtins/shift.def:77 +msgid "shift count" +msgstr "Verschiebezähler" + +#: builtins/shopt.def:279 +msgid "cannot set and unset shell options simultaneously" +msgstr "Kann nicht Shell Optinen gleichzeitig aktivieren und deaktivieren." + +#: builtins/shopt.def:346 +#, c-format +msgid "%s: invalid shell option name" +msgstr "%s: Ungültiger Shell Optionen Name." + +#: builtins/source.def:130 +msgid "filename argument required" +msgstr "Ein Dateiname wird as Argument benötigt." + +#: builtins/source.def:155 +#, c-format +msgid "%s: file not found" +msgstr "%s: Datei nicht gefunden." + +#: builtins/suspend.def:101 +msgid "cannot suspend" +msgstr "Kann die Shell nicht unterbrechen." + +# logout +#: builtins/suspend.def:111 +msgid "cannot suspend a login shell" +msgstr "Kann die Loginshell nicht unterbrechen." + +#: builtins/type.def:234 +#, c-format +msgid "%s is aliased to `%s'\n" +msgstr "%s ist ein Alias von `%s'.\n" + +#: builtins/type.def:255 +#, c-format +msgid "%s is a shell keyword\n" +msgstr "%s Ist ein reserviertes Schlüsselwort der Shell.\n" + +#: builtins/type.def:274 +#, c-format +msgid "%s is a function\n" +msgstr "%s ist eine Funktion.\n" + +#: builtins/type.def:296 +#, c-format +msgid "%s is a shell builtin\n" +msgstr "%s ist eine von der Shell mitgelieferte Funktion.\n" + +#: builtins/type.def:317 builtins/type.def:393 +#, c-format +msgid "%s is %s\n" +msgstr "%s ist %s\n" + +#: builtins/type.def:337 +#, c-format +msgid "%s is hashed (%s)\n" +msgstr "" + +#: builtins/ulimit.def:383 +#, c-format +msgid "%s: invalid limit argument" +msgstr "%s: Ungültiges Grenzwertargument." + +#: builtins/ulimit.def:409 +#, c-format +msgid "`%c': bad command" +msgstr "`%c': Falsches Kommando." + +#: builtins/ulimit.def:438 +#, c-format +msgid "%s: cannot get limit: %s" +msgstr "%s: Kann die nicht Grenze setzen: %s" + +#: builtins/ulimit.def:464 +msgid "limit" +msgstr "Grenze" + +#: builtins/ulimit.def:476 builtins/ulimit.def:776 +#, c-format +msgid "%s: cannot modify limit: %s" +msgstr "%s: Kann die Grenze nicht ändern: %s" + +#: builtins/umask.def:114 +msgid "octal number" +msgstr "Oktalzahl" + +#: builtins/umask.def:227 +#, c-format +msgid "`%c': invalid symbolic mode operator" +msgstr "`%c': Ungültiger Operator für den symbolischen Modus." + +#: builtins/umask.def:282 +#, c-format +msgid "`%c': invalid symbolic mode character" +msgstr "`%c': Ungültiges Zeichen im symbolischen Modus." + +#: error.c:90 error.c:325 error.c:327 error.c:329 +msgid " line " +msgstr " Zeile " + +#: error.c:165 +#, c-format +msgid "last command: %s\n" +msgstr "Letztes Kommando: %s\n" + +#: error.c:173 +#, c-format +msgid "Aborting..." +msgstr "Abbruch..." + +#: error.c:440 +msgid "unknown command error" +msgstr "Unbekanntes Kommando" + +#: error.c:441 +msgid "bad command type" +msgstr "" + +# Programmierfehler +#: error.c:442 +msgid "bad connector" +msgstr "" + +#: error.c:443 +msgid "bad jump" +msgstr "Falscher Sprung" + +#: error.c:481 +#, c-format +msgid "%s: unbound variable" +msgstr "%s ist nicht gesetzt." + +#: eval.c:189 +#, c-format +msgid "\atimed out waiting for input: auto-logout\n" +msgstr "\aZu lange keine Eingabe: Automatisch ausgeloggt.\n" + +#: execute_cmd.c:512 +#, c-format +msgid "cannot redirect standard input from /dev/null: %s" +msgstr "Kann nicht die Standardeingabe von /dev/null umleiten: %s" + +#: execute_cmd.c:1233 +#, c-format +msgid "TIMEFORMAT: `%c': invalid format character" +msgstr "TIMEFORMAT: `%c': Ungültiges Formatzeichen." + +#: execute_cmd.c:2287 +msgid "pipe error" +msgstr "Pipe-Fehler" + +#: execute_cmd.c:4386 +#, c-format +msgid "%s: maximum function nesting level exceeded (%d)" +msgstr "" + +#: execute_cmd.c:4884 +#, c-format +msgid "%s: restricted: cannot specify `/' in command names" +msgstr "%s: Verboten: `/' ist in Kommandonamen unzulässig." + +#: execute_cmd.c:4973 +#, c-format +msgid "%s: command not found" +msgstr "%s: Kommando nicht gefunden." + +#: execute_cmd.c:5206 +#, c-format +msgid "%s: %s" +msgstr "%s: %s" + +#: execute_cmd.c:5243 +#, c-format +msgid "%s: %s: bad interpreter" +msgstr "%s: %s: Defekter Interpreter" + +#: execute_cmd.c:5280 +#, c-format +msgid "%s: cannot execute binary file: %s" +msgstr "%s: Kann die Binärdatei nicht ausführen: %s" + +#: execute_cmd.c:5352 +#, c-format +msgid "`%s': is a special builtin" +msgstr "`%s' ist eine spezielle eingebaute Funktion." + +#: execute_cmd.c:5404 +#, c-format +msgid "cannot duplicate fd %d to fd %d" +msgstr "Kann fd %d nicht auf fd %d verdoppeln." + +#: expr.c:259 +msgid "expression recursion level exceeded" +msgstr "Zu viele Rekursionen in Ausdruck." + +#: expr.c:283 +msgid "recursion stack underflow" +msgstr "Rekursionsstapel leer." + +#: expr.c:431 +msgid "syntax error in expression" +msgstr "Syntaxfehler im Ausdruck." + +#: expr.c:475 +msgid "attempted assignment to non-variable" +msgstr "Versuchte Zuweisung zu keiner Variablen." + +#: expr.c:495 expr.c:858 +msgid "division by 0" +msgstr "Division durch 0." + +#: expr.c:542 +msgid "bug: bad expassign token" +msgstr "Fehler: Falscher Zuweisungsoperator." + +#: expr.c:595 +msgid "`:' expected for conditional expression" +msgstr "`:' für ein bedingten Ausdruck erwaret." + +#: expr.c:919 +msgid "exponent less than 0" +msgstr "Der Exponent ist kleiner als 0." + +#: expr.c:976 +msgid "identifier expected after pre-increment or pre-decrement" +msgstr "" +"Nach einem Präinkrement oder Prädekrement wird ein Bezeichner erwartet." + +#: expr.c:1002 +msgid "missing `)'" +msgstr "Fehlende `)'" + +#: expr.c:1053 expr.c:1390 +msgid "syntax error: operand expected" +msgstr "Syntax Fehler: Operator erwartet." + +#: expr.c:1392 +msgid "syntax error: invalid arithmetic operator" +msgstr "Syntaxfehler: Ungültiger arithmetischer Operator." + +#: expr.c:1416 +#, c-format +msgid "%s%s%s: %s (error token is \"%s\")" +msgstr "%s%s%s: %s (Fehlerverursachendes Zeichen ist \\\"%s\\\")." + +#: expr.c:1474 +msgid "invalid arithmetic base" +msgstr "Ungültige Basis." + +#: expr.c:1494 +msgid "value too great for base" +msgstr "Der Wert ist für die aktuelle Basis zu groß." + +#: expr.c:1543 +#, c-format +msgid "%s: expression error\n" +msgstr "%s: Fehler im Ausdruck.\n" + +#: general.c:62 +msgid "getcwd: cannot access parent directories" +msgstr "getwd: Kann auf das übergeordnete Verzeichnis nicht zugreifen." + +#: input.c:102 subst.c:5168 +#, c-format +msgid "cannot reset nodelay mode for fd %d" +msgstr "Konnte den No-Delay Modus für fd %d nicht wieder herstellen." + +#: input.c:271 +#, c-format +msgid "cannot allocate new file descriptor for bash input from fd %d" +msgstr "Kann keinen neuen Filedeskriptor für die Eingabe von fd %d zuweisen." + +# Debug Ausgabe +#: input.c:279 +#, c-format +msgid "save_bash_input: buffer already exists for new fd %d" +msgstr "save_bash_input: Es existiert bereits ein Puffer für den neuen fd %d." + +#: jobs.c:471 +msgid "start_pipeline: pgrp pipe" +msgstr "start_pipeline: pgrp pipe" + +#: jobs.c:893 +#, c-format +msgid "forked pid %d appears in running job %d" +msgstr "Die geforkte PID %d erscheint im laufenden Prozess %d." + +#: jobs.c:1012 +#, c-format +msgid "deleting stopped job %d with process group %ld" +msgstr "Lösche den gestoppten Prozess %d der Prozessgruppe %ld." + +#: jobs.c:1117 +#, c-format +msgid "add_process: process %5ld (%s) in the_pipeline" +msgstr "" + +#: jobs.c:1120 +#, c-format +msgid "add_process: pid %5ld (%s) marked as still alive" +msgstr "" + +# Programmierfehler +#: jobs.c:1435 +#, c-format +msgid "describe_pid: %ld: no such pid" +msgstr "describe_pid: %ld: Prozeßnummer existiert nicht." + +#: jobs.c:1450 +#, c-format +msgid "Signal %d" +msgstr "Signal %d" + +#: jobs.c:1464 jobs.c:1489 +msgid "Done" +msgstr "Fertig" + +#: jobs.c:1469 siglist.c:123 +msgid "Stopped" +msgstr "Angehalten" + +#: jobs.c:1473 +#, c-format +msgid "Stopped(%s)" +msgstr "Angehalten(%s)" + +#: jobs.c:1477 +msgid "Running" +msgstr "Läuft" + +#: jobs.c:1491 +#, c-format +msgid "Done(%d)" +msgstr "Fertig(%d)" + +#: jobs.c:1493 +#, c-format +msgid "Exit %d" +msgstr "Exit %d" + +#: jobs.c:1496 +msgid "Unknown status" +msgstr "Unbekannter Status" + +#: jobs.c:1583 +#, c-format +msgid "(core dumped) " +msgstr "(Speicherabzug geschrieben) " + +#: jobs.c:1602 +#, c-format +msgid " (wd: %s)" +msgstr " (wd: %s)" + +# interner Fehler +#: jobs.c:1819 +#, c-format +msgid "child setpgid (%ld to %ld)" +msgstr "" + +#: jobs.c:2138 nojobs.c:605 +#, c-format +msgid "wait: pid %ld is not a child of this shell" +msgstr "wait: Prozeß %ld wurde nicht von dieser Shell gestartet." + +#: jobs.c:2385 +#, c-format +msgid "wait_for: No record of process %ld" +msgstr "" + +#: jobs.c:2694 +#, c-format +msgid "wait_for_job: job %d is stopped" +msgstr "" + +#: jobs.c:2986 +#, c-format +msgid "%s: job has terminated" +msgstr "%s: Programm ist beendet." + +#: jobs.c:2995 +#, c-format +msgid "%s: job %d already in background" +msgstr "" + +#: jobs.c:3220 +msgid "waitchld: turning on WNOHANG to avoid indefinite block" +msgstr "" + +# Debug Ausgabe +#: jobs.c:3711 +#, c-format +msgid "%s: line %d: " +msgstr "%s: Zeile %d: " + +#: jobs.c:3725 nojobs.c:843 +#, c-format +msgid " (core dumped)" +msgstr " (Speicherabzug geschrieben)" + +#: jobs.c:3737 jobs.c:3750 +#, c-format +msgid "(wd now: %s)\n" +msgstr "(gegenwärtiges Arbeitsverzeichnis ist: %s)\n" + +# interner Fehler +#: jobs.c:3782 +msgid "initialize_job_control: getpgrp failed" +msgstr "initialize_jobs: getpgrp war nicht erfolgreich." + +# interner Fehler +#: jobs.c:3843 +msgid "initialize_job_control: line discipline" +msgstr "initialize_job_control: line discipline" + +# interner Fehler +#: jobs.c:3853 +msgid "initialize_job_control: setpgid" +msgstr "initialize_job_control: setpgid" + +#: jobs.c:3874 jobs.c:3883 +#, c-format +msgid "cannot set terminal process group (%d)" +msgstr "Kann die Prozessgruppe des Terminals nicht setzen (%d)." + +#: jobs.c:3888 +msgid "no job control in this shell" +msgstr "Keine Job Steuerung in dieser Shell." + +#: lib/malloc/malloc.c:296 +#, c-format +msgid "malloc: failed assertion: %s\n" +msgstr "malloc: Speicherzusicherung gescheitert: %s.\n" + +#: lib/malloc/malloc.c:312 +#, c-format +msgid "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" +msgstr "" +"\\r\n" +"malloc: %s:%d: Speicherzusicherung verpfuscht\\r\n" + +#: lib/malloc/malloc.c:313 +msgid "unknown" +msgstr "Unbekannt" + +#: lib/malloc/malloc.c:801 +msgid "malloc: block on free list clobbered" +msgstr "" +"Malloc: Ein frei gekennzeichneter Speicherbereich wurde überschrieben." + +#: lib/malloc/malloc.c:878 +msgid "free: called with already freed block argument" +msgstr "free: Wurde für bereits freigegebenen Speicherbereich aufgerufen." + +#: lib/malloc/malloc.c:881 +msgid "free: called with unallocated block argument" +msgstr "free: Wurde für nicht zugeordneten Speicherbereich aufgerufen." + +#: lib/malloc/malloc.c:900 +msgid "free: underflow detected; mh_nbytes out of range" +msgstr "free: Underflow erkannt; mh_nbytes außerhalb des Gültigkeitsbereichs." + +#: lib/malloc/malloc.c:906 +msgid "free: start and end chunk sizes differ" +msgstr "free: Beginn und Ende Segmentgrößen sind unterschiedlich." + +#: lib/malloc/malloc.c:1005 +msgid "realloc: called with unallocated block argument" +msgstr "realloc: Mit nicht zugewiesenen Argument aufgerufen." + +#: lib/malloc/malloc.c:1020 +msgid "realloc: underflow detected; mh_nbytes out of range" +msgstr "" +"realloc: Underflow erkannt; mh_nbytes außerhalb des Gültigkeitsbereichs." + +#: lib/malloc/malloc.c:1026 +msgid "realloc: start and end chunk sizes differ" +msgstr "realloc: Beginn und Ende Segmentgrößen sind unterschiedlich.<" + +#: lib/malloc/table.c:194 +#, c-format +msgid "register_alloc: alloc table is full with FIND_ALLOC?\n" +msgstr "" +"register_alloc: Speicherzuordnungstabelle ist mit FIND_ALLOC gefüllt?\n" + +#: lib/malloc/table.c:203 +#, c-format +msgid "register_alloc: %p already in table as allocated?\n" +msgstr "" +"register_alloc: %p ist bereits in der Speicherzuordnungstabelle als belegt " +"gekennzeichnet?\n" + +#: lib/malloc/table.c:256 +#, c-format +msgid "register_free: %p already in table as free?\n" +msgstr "" +"register_free: %p ist bereits in der Speicherzuordnungstabelle als frei " +"gekennzeichnet?\n" + +#: lib/sh/fmtulong.c:102 +msgid "invalid base" +msgstr "Ungültige Basis" + +#: lib/sh/netopen.c:168 +#, c-format +msgid "%s: host unknown" +msgstr "%s: Unbekannter Host." + +#: lib/sh/netopen.c:175 +#, c-format +msgid "%s: invalid service" +msgstr "%s: unbekannter Dienst." + +#: lib/sh/netopen.c:306 +#, c-format +msgid "%s: bad network path specification" +msgstr "%s: Fehlerhafte Netzwerkspfadangabe." + +#: lib/sh/netopen.c:346 +msgid "network operations not supported" +msgstr "Der Netzwerkbetrieb ist nicht unterstützt." + +#: locale.c:200 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s)" +msgstr "setlocale: LC_ALL: Kann die Locale nicht ändern (%s)." + +#: locale.c:202 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s): %s" +msgstr "setlocale: LC_ALL: Kann die Locale nicht ändern (%s): %s" + +#: locale.c:259 +#, c-format +msgid "setlocale: %s: cannot change locale (%s)" +msgstr "setlocale: %s: Kann die Standorteinstellungen nicht ändern (%s)." + +#: locale.c:261 +#, c-format +msgid "setlocale: %s: cannot change locale (%s): %s" +msgstr "setlocale: %s: Kann nicht die Locale ändern (%s): %s" + +# Du oder Sie? +#: mailcheck.c:439 +msgid "You have mail in $_" +msgstr "Sie haben Post in $_." + +#: mailcheck.c:464 +msgid "You have new mail in $_" +msgstr "Sie haben neue Post in $_." + +#: mailcheck.c:480 +#, c-format +msgid "The mail in %s has been read\n" +msgstr "Die Post in %s wurde bereits gelesen.\n" + +#: make_cmd.c:323 +msgid "syntax error: arithmetic expression required" +msgstr "Syntaxfehler: Es wird ein arithmetischer Ausdruck benötigt." + +#: make_cmd.c:325 +msgid "syntax error: `;' unexpected" +msgstr "Syntax Fehler: unerwartetes `;'." + +#: make_cmd.c:326 +#, c-format +msgid "syntax error: `((%s))'" +msgstr "Syntax Fehler: `((%s))'." + +# interner Fehler +#: make_cmd.c:578 +#, c-format +msgid "make_here_document: bad instruction type %d" +msgstr "make_here_document: Falscher Befehlstyp %d." + +#: make_cmd.c:662 +#, c-format +msgid "here-document at line %d delimited by end-of-file (wanted `%s')" +msgstr "" +"Das in der Zeile %d beginnende Here-Dokument geht bis zum Dateiende " +"(erwartet wird `%s')." + +#: make_cmd.c:759 +#, c-format +msgid "make_redirection: redirection instruction `%d' out of range" +msgstr "" + +#: parse.y:3278 parse.y:3561 +#, c-format +msgid "unexpected EOF while looking for matching `%c'" +msgstr "Dateiende beim Suchen nach `%c' erreicht." + +#: parse.y:4170 +msgid "unexpected EOF while looking for `]]'" +msgstr "Dateiende beim Suchen nach `]]' erreicht." + +#: parse.y:4175 +#, c-format +msgid "syntax error in conditional expression: unexpected token `%s'" +msgstr "Syntaxfehler im bedingten Ausdruck: Unerwartetes Zeichen `%s'." + +#: parse.y:4179 +msgid "syntax error in conditional expression" +msgstr "Syntaxfehler im bedingen Ausdruck." + +#: parse.y:4257 +#, c-format +msgid "unexpected token `%s', expected `)'" +msgstr "Unerwartetes Zeichen: `%s' anstatt von `)'" + +#: parse.y:4261 +msgid "expected `)'" +msgstr "`)' erwartet." + +#: parse.y:4289 +#, c-format +msgid "unexpected argument `%s' to conditional unary operator" +msgstr "" + +#: parse.y:4293 +msgid "unexpected argument to conditional unary operator" +msgstr "" + +#: parse.y:4339 +#, c-format +msgid "unexpected token `%s', conditional binary operator expected" +msgstr "" + +#: parse.y:4343 +msgid "conditional binary operator expected" +msgstr "" + +#: parse.y:4365 +#, c-format +msgid "unexpected argument `%s' to conditional binary operator" +msgstr "" + +#: parse.y:4369 +msgid "unexpected argument to conditional binary operator" +msgstr "" + +#: parse.y:4380 +#, c-format +msgid "unexpected token `%c' in conditional command" +msgstr "" + +#: parse.y:4383 +#, c-format +msgid "unexpected token `%s' in conditional command" +msgstr "" + +#: parse.y:4387 +#, c-format +msgid "unexpected token %d in conditional command" +msgstr "" + +#: parse.y:5737 +#, c-format +msgid "syntax error near unexpected token `%s'" +msgstr "Syntaxfehler beim unerwarteten Wort `%s'" + +#: parse.y:5755 +#, c-format +msgid "syntax error near `%s'" +msgstr "Syntaxfehler beim unerwarteten Wort `%s'" + +#: parse.y:5765 +msgid "syntax error: unexpected end of file" +msgstr "Syntax Fehler: Unerwartetes Dateiende." + +#: parse.y:5765 +msgid "syntax error" +msgstr "Syntax Fehler" + +# Du oder Sie? +#: parse.y:5827 +#, c-format +msgid "Use \"%s\" to leave the shell.\n" +msgstr "Benutze \"%s\" um die Shell zu verlassen.\n" + +#: parse.y:5989 +msgid "unexpected EOF while looking for matching `)'" +msgstr "Dateiende beim Suchen nach passender `)' erreicht." + +#: pcomplete.c:1094 +#, c-format +msgid "completion: function `%s' not found" +msgstr "" + +#: pcomplib.c:182 +#, c-format +msgid "progcomp_insert: %s: NULL COMPSPEC" +msgstr "" + +#: print_cmd.c:300 +#, c-format +msgid "print_command: bad connector `%d'" +msgstr "print_command: Falsches Verbindungszeichen `%d'." + +#: print_cmd.c:373 +#, c-format +msgid "xtrace_set: %d: invalid file descriptor" +msgstr "xtrace_set: %d: Ungültige Dateibeschreibung." + +#: print_cmd.c:378 +msgid "xtrace_set: NULL file pointer" +msgstr "" + +#: print_cmd.c:382 +#, c-format +msgid "xtrace fd (%d) != fileno xtrace fp (%d)" +msgstr "" + +#: print_cmd.c:1518 +#, c-format +msgid "cprintf: `%c': invalid format character" +msgstr "" + +#: redir.c:123 redir.c:170 +msgid "file descriptor out of range" +msgstr "" + +#: redir.c:177 +#, c-format +msgid "%s: ambiguous redirect" +msgstr "%s: Mehrdeutige Umlenkung." + +#: redir.c:181 +#, c-format +msgid "%s: cannot overwrite existing file" +msgstr "%s: Kann existierende Datei nicht überschreiben." + +#: redir.c:186 +#, c-format +msgid "%s: restricted: cannot redirect output" +msgstr "%s: Gesperrt: Die Ausgabe darf nicht umgeleitet werden." + +#: redir.c:191 +#, c-format +msgid "cannot create temp file for here-document: %s" +msgstr "" + +#: redir.c:195 +#, c-format +msgid "%s: cannot assign fd to variable" +msgstr "%s: Kann fd keiner Variable zuweisen." + +#: redir.c:582 +msgid "/dev/(tcp|udp)/host/port not supported without networking" +msgstr "/dev/(tcp|udp)/host/port Wird ohne Netzwerk nicht unterstützt" + +#: redir.c:861 redir.c:973 redir.c:1034 redir.c:1199 +msgid "redirection error: cannot duplicate fd" +msgstr "" + +#: shell.c:339 +msgid "could not find /tmp, please create!" +msgstr "Konnte das /tmp Verzeichnis nicht finden, bitte anlegen." + +#: shell.c:343 +msgid "/tmp must be a valid directory name" +msgstr "/tmp muß ein gültiger Verzeichnisname sein." + +#: shell.c:890 +#, c-format +msgid "%c%c: invalid option" +msgstr "%c%c: Ungültige Option" + +#: shell.c:1682 +msgid "I have no name!" +msgstr "Ich habe keinen Benutzernamen!" + +#: shell.c:1827 +#, c-format +msgid "GNU bash, version %s-(%s)\n" +msgstr "GNU bash, Version %s-(%s)\n" + +#: shell.c:1828 +#, c-format +msgid "" +"Usage:\t%s [GNU long option] [option] ...\n" +"\t%s [GNU long option] [option] script-file ...\n" +msgstr "" +"Benutzung:\t%s [Lange GNU Option] [Option] ...\n" +"\t\t%s [Lange GNU Option] [Option] Script-Datei ...\n" + +#: shell.c:1830 +msgid "GNU long options:\n" +msgstr "Lange GNU Optionen:\n" + +#: shell.c:1834 +msgid "Shell options:\n" +msgstr "Shell-Optionen:\n" + +#: shell.c:1835 +msgid "\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n" +msgstr "" +"\t-ilrsD oder -c Kommando\toder -O shopt_option (Nur Aufruf)\n" + +#: shell.c:1850 +#, c-format +msgid "\t-%s or -o option\n" +msgstr "\t-%s oder Option -o\n" + +#: shell.c:1856 +#, c-format +msgid "Type `%s -c \"help set\"' for more information about shell options.\n" +msgstr "`%s -c \"help set\"' für mehr Informationen über Shell-Optionen.\n" + +#: shell.c:1857 +#, c-format +msgid "Type `%s -c help' for more information about shell builtin commands.\n" +msgstr "`%s -c help' für mehr Information über Shell-Kommandos.\n" + +#: shell.c:1858 +#, c-format +msgid "Use the `bashbug' command to report bugs.\n" +msgstr "Mit dem `bashbug' Kommando können Fehler gemeldet werden.\n" + +#: sig.c:691 +#, c-format +msgid "sigprocmask: %d: invalid operation" +msgstr "sigprocmask: %d: Ungültige Operation" + +#: siglist.c:48 +msgid "Bogus signal" +msgstr "Falsches Signal." + +#: siglist.c:51 +msgid "Hangup" +msgstr "Aufgelegt" + +#: siglist.c:55 +msgid "Interrupt" +msgstr "Unterbrochen (Interrupt)" + +#: siglist.c:59 +msgid "Quit" +msgstr "Quit" + +#: siglist.c:63 +msgid "Illegal instruction" +msgstr "Ungültige Anweisung." + +#: siglist.c:67 +msgid "BPT trace/trap" +msgstr "Verfolgen/anhalten abfangen (Trace/breakpoint trap)" + +#: siglist.c:75 +msgid "ABORT instruction" +msgstr "Abbruchkommando" + +#: siglist.c:79 +msgid "EMT instruction" +msgstr "EMT abfangen (EMT trap)" + +#: siglist.c:83 +msgid "Floating point exception" +msgstr "Gleitkommafehler" + +#: siglist.c:87 +msgid "Killed" +msgstr "Abgebrochen (Killed)" + +#: siglist.c:91 +msgid "Bus error" +msgstr "Bus-Fehler" + +#: siglist.c:95 +msgid "Segmentation fault" +msgstr "Adressierungsfehler" + +#: siglist.c:99 +msgid "Bad system call" +msgstr "Falscher Systemaufruf" + +#: siglist.c:103 +msgid "Broken pipe" +msgstr "Unterbrochene Pipe" + +#: siglist.c:107 +msgid "Alarm clock" +msgstr "Wecker" + +#: siglist.c:111 +msgid "Terminated" +msgstr "Abgebrochen (Terminated)" + +#: siglist.c:115 +msgid "Urgent IO condition" +msgstr "Dringende IO-Bedingung" + +#: siglist.c:119 +msgid "Stopped (signal)" +msgstr "Angehalten (Signal)" + +#: siglist.c:127 +msgid "Continue" +msgstr "Prozeßbearbeitung wieder aufgenommen." + +#: siglist.c:135 +msgid "Child death or stop" +msgstr "Kindprozeß abgebrochen oder gestoppt." + +#: siglist.c:139 +msgid "Stopped (tty input)" +msgstr "Angehalten (Terminaleingabe)" + +#: siglist.c:143 +msgid "Stopped (tty output)" +msgstr "Angehalten (Terminalausgabe)" + +#: siglist.c:147 +msgid "I/O ready" +msgstr "E/A fertig" + +#: siglist.c:151 +msgid "CPU limit" +msgstr "Rechenzeitgrenze" + +#: siglist.c:155 +msgid "File limit" +msgstr "Grenze für Dateigröße" + +#: siglist.c:159 +msgid "Alarm (virtual)" +msgstr "Alarm (Virtuell)" + +#: siglist.c:163 +msgid "Alarm (profile)" +msgstr "Alarm (Profil)" + +#: siglist.c:167 +msgid "Window changed" +msgstr "Fenster geändert." + +#: siglist.c:171 +msgid "Record lock" +msgstr "Datei blockiert." + +#: siglist.c:175 +msgid "User signal 1" +msgstr "Nutzersignal 1" + +#: siglist.c:179 +msgid "User signal 2" +msgstr "Nutzersignal 2" + +#: siglist.c:183 +msgid "HFT input data pending" +msgstr "HFT Eingabedaten ausstehend." + +#: siglist.c:187 +msgid "power failure imminent" +msgstr "Spannungsausfall steht bevor." + +#: siglist.c:191 +msgid "system crash imminent" +msgstr "Systemausfall steht bevor." + +#: siglist.c:195 +msgid "migrate process to another CPU" +msgstr "Verlege den Prozeß auf einen anderen Prozessor." + +#: siglist.c:199 +msgid "programming error" +msgstr "Programmierfehler" + +#: siglist.c:203 +msgid "HFT monitor mode granted" +msgstr "HFT-Monitormodus erlaubt." + +#: siglist.c:207 +msgid "HFT monitor mode retracted" +msgstr "HFT-Monitormodus abgeschaltet." + +#: siglist.c:211 +msgid "HFT sound sequence has completed" +msgstr "HFT-Tonfolge beendet." + +#: siglist.c:215 +msgid "Information request" +msgstr "Informationsanforderung" + +#: siglist.c:223 +msgid "Unknown Signal #" +msgstr "Unbekannte Signalnummer." + +#: siglist.c:225 +#, c-format +msgid "Unknown Signal #%d" +msgstr "Unbekanntes Signal Nr.: %d." + +#: subst.c:1362 subst.c:1520 +#, c-format +msgid "bad substitution: no closing `%s' in %s" +msgstr "Falsche Ersetzung: Keine schließende `%s' in `%s' enthalten." + +#: subst.c:2847 +#, c-format +msgid "%s: cannot assign list to array member" +msgstr "%s: Kann einem Feldelement keine Liste zuweisen." + +#: subst.c:5065 subst.c:5081 +msgid "cannot make pipe for process substitution" +msgstr "Kann keine Pipe für die Prozeßersetzung erzeugen." + +#: subst.c:5113 +msgid "cannot make child for process substitution" +msgstr "Kann den Kindsprozess für die Prozeßersetzung nicht erzeugen." + +#: subst.c:5158 +#, c-format +msgid "cannot open named pipe %s for reading" +msgstr "Kann nicht die benannte Pipe %s zum lesen öffnen." + +#: subst.c:5160 +#, c-format +msgid "cannot open named pipe %s for writing" +msgstr "Kann nicht die benannte Pipe %s zum schreiben öffnen." + +#: subst.c:5178 +#, c-format +msgid "cannot duplicate named pipe %s as fd %d" +msgstr "Kann die benannte Pipe %s nicht auf fd %d." + +#: subst.c:5376 +msgid "cannot make pipe for command substitution" +msgstr "Kann keine Pipes für Kommandoersetzung erzeugen." + +#: subst.c:5414 +msgid "cannot make child for command substitution" +msgstr "Kann keinen Unterprozess für die Kommandoersetzung erzeugen." + +# interner Fehler +#: subst.c:5433 +msgid "command_substitute: cannot duplicate pipe as fd 1" +msgstr "Kommandoersetzung: Kann Pipe nicht als fd 1 duplizieren." + +#: subst.c:5837 subst.c:8050 +#, c-format +msgid "%s: invalid variable name for name reference" +msgstr "" + +#: subst.c:6048 +#, c-format +msgid "%s: parameter null or not set" +msgstr "%s: Parameter ist Null oder nicht gesetzt." + +# interner Fehler +#: subst.c:6320 subst.c:6335 +#, c-format +msgid "%s: substring expression < 0" +msgstr "%s: Teilstring-Ausdruck < 0." + +#: subst.c:7506 +#, c-format +msgid "%s: bad substitution" +msgstr "%s: Falsche Variablenersetzung." + +#: subst.c:7583 +#, c-format +msgid "$%s: cannot assign in this way" +msgstr "$%s: Kann so nicht zuweisen." + +#: subst.c:7917 +msgid "" +"future versions of the shell will force evaluation as an arithmetic " +"substitution" +msgstr "" +"Zukünftige Versionen dieser Shell werden das Auswerten arithmetischer " +"Ersetzungen erzwingen." + +#: subst.c:8421 +#, c-format +msgid "bad substitution: no closing \"`\" in %s" +msgstr "Falsche Ersetzung: Keine schließende \"`\" in %s." + +#: subst.c:9322 +#, c-format +msgid "no match: %s" +msgstr "Keine Entsprechung: %s" + +#: test.c:147 +msgid "argument expected" +msgstr "Argument erwartet." + +#: test.c:156 +#, c-format +msgid "%s: integer expression expected" +msgstr "%s: Ganzzahliger Ausdruck erwartet." + +#: test.c:264 +msgid "`)' expected" +msgstr "`)' erwartet." + +#: test.c:266 +#, c-format +msgid "`)' expected, found %s" +msgstr "`)' erwartet, %s gefunden." + +#: test.c:281 test.c:742 test.c:745 +#, c-format +msgid "%s: unary operator expected" +msgstr "%s: Einstelliger (unärer) Operator erwartet." + +#: test.c:468 test.c:785 +#, c-format +msgid "%s: binary operator expected" +msgstr "%s: Zweistelliger (binärer) Operator erwartet." + +#: test.c:860 +msgid "missing `]'" +msgstr "Fehlende `]'" + +#: trap.c:217 +msgid "invalid signal number" +msgstr "Ungültige Signalnummer." + +#: trap.c:371 +#, c-format +msgid "run_pending_traps: bad value in trap_list[%d]: %p" +msgstr "" + +#: trap.c:375 +#, c-format +msgid "" +"run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" +msgstr "" + +# Programmierfehler +#: trap.c:428 +#, c-format +msgid "trap_handler: bad signal %d" +msgstr "trap_handler: Falsches Signal %d." + +#: variables.c:382 +#, c-format +msgid "error importing function definition for `%s'" +msgstr "Fehler beim Importieren der Funktionsdefinition für `%s'." + +#: variables.c:780 +#, c-format +msgid "shell level (%d) too high, resetting to 1" +msgstr "" + +#: variables.c:1865 +#, c-format +msgid "%s: circular name reference" +msgstr "" + +#: variables.c:2228 +msgid "make_local_variable: no function context at current scope" +msgstr "" + +#: variables.c:2247 +#, c-format +msgid "%s: variable may not be assigned value" +msgstr "%s: Der Variable könnte kein Wert zugewiesen sein." + +#: variables.c:3646 +msgid "all_local_variables: no function context at current scope" +msgstr "" + +#: variables.c:3891 +#, c-format +msgid "%s has null exportstr" +msgstr "" + +#: variables.c:3896 variables.c:3905 +#, c-format +msgid "invalid character %d in exportstr for %s" +msgstr "" + +#: variables.c:3911 +#, c-format +msgid "no `=' in exportstr for %s" +msgstr "" + +#: variables.c:4344 +msgid "pop_var_context: head of shell_variables not a function context" +msgstr "" + +#: variables.c:4357 +msgid "pop_var_context: no global_variables context" +msgstr "" + +#: variables.c:4431 +msgid "pop_scope: head of shell_variables not a temporary environment scope" +msgstr "" + +#: variables.c:5257 +#, c-format +msgid "%s: %s: cannot open as FILE" +msgstr "%s: %s: Kann nicht als Datei geöffnet werden." + +#: variables.c:5262 +#, c-format +msgid "%s: %s: invalid value for trace file descriptor" +msgstr "" + +#: variables.c:5307 +#, c-format +msgid "%s: %s: compatibility value out of range" +msgstr "%s: %s: Kompatibilitätswert außerhalb des Gültigkeitsbereiches." + +#: version.c:46 +msgid "Copyright (C) 2013 Free Software Foundation, Inc." +msgstr "Copyright (C) 2013 Free Software Foundation, Inc." + +#: version.c:47 version2.c:47 +msgid "" +"License GPLv3+: GNU GPL version 3 or later \n" +msgstr "" +"Lizenz GPLv3+: GNU GPL Version 3 oder jünger \n" + +#: version.c:86 version2.c:86 +#, c-format +msgid "GNU bash, version %s (%s)\n" +msgstr "GNU bash, Version %s (%s)\n" + +#: version.c:91 version2.c:91 +msgid "This is free software; you are free to change and redistribute it." +msgstr "Dies ist freie Software. Sie darf verändert und verteilt werden." + +#: version.c:92 version2.c:92 +msgid "There is NO WARRANTY, to the extent permitted by law." +msgstr "" +"Für den größtmöglichen gesetzlich zulässigen Umfang wird jede Haftung " +"ausgeschlossen." + +#: version2.c:46 +msgid "Copyright (C) 2012 Free Software Foundation, Inc." +msgstr "Copyright (C) 2012 Free Software Foundation, Inc." + +#: xmalloc.c:91 +#, c-format +msgid "%s: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "%s: Konnte nicht %lu Bytes reservieren (%lu bytes reserviert)." + +#: xmalloc.c:93 +#, c-format +msgid "%s: cannot allocate %lu bytes" +msgstr "%s: Konnte nicht %lu Bytes reservieren." + +#: xmalloc.c:163 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "%s: %s:%d: Konnte nicht %lu Bytes reservieren (%lu bytes reserviert)." + +#: xmalloc.c:165 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes" +msgstr "%s: %s:%d: Konnte nicht %lu Bytes reservieren." + +#: builtins.c:43 +msgid "alias [-p] [name[=value] ... ]" +msgstr "alias [-p] [Name[=Wert] ... ]" + +#: builtins.c:47 +msgid "unalias [-a] name [name ...]" +msgstr "unalias [-a] Name [Name ...]" + +#: builtins.c:51 +msgid "" +"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-" +"x keyseq:shell-command] [keyseq:readline-function or readline-command]" +msgstr "" +"bind [-lpsvPSVX] [-m Tastaturtabelle] [-f Dateiname] [-q Name] [-u\n" +"Name] [-r Tastenfolge] [-x Tastenfolge:Shell Kommando] [Tastenfolge:readline " +"Funktion oder Kommando]" + +#: builtins.c:54 +msgid "break [n]" +msgstr "break [n]" + +#: builtins.c:56 +msgid "continue [n]" +msgstr "continue [n]" + +#: builtins.c:58 +msgid "builtin [shell-builtin [arg ...]]" +msgstr "builtin [Shellkommando [Argument ...]]" + +#: builtins.c:61 +msgid "caller [expr]" +msgstr "caller [Ausdruck]" + +#: builtins.c:64 +msgid "cd [-L|[-P [-e]] [-@]] [dir]" +msgstr "cd [-L|[-P [-e]] [-@]] [Verzeichnis]" + +#: builtins.c:66 +msgid "pwd [-LP]" +msgstr "pwd [-LP]" + +#: builtins.c:68 +msgid ":" +msgstr ":" + +#: builtins.c:70 +msgid "true" +msgstr "true" + +#: builtins.c:72 +msgid "false" +msgstr "false" + +#: builtins.c:74 +msgid "command [-pVv] command [arg ...]" +msgstr "command [-pVv] Kommando [Argument ...]" + +#: builtins.c:76 +msgid "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" +msgstr "declare [-aAfFgilrntux] [-p] Variable[=Wert] ..." + +# +#: builtins.c:78 +msgid "typeset [-aAfFgilrtux] [-p] name[=value] ..." +msgstr "typeset [-aAfFgilrtux] [-p] Name[=Wert] ..." + +#: builtins.c:80 +msgid "local [option] name[=value] ..." +msgstr "local [Option] Name[=Wert] ..." + +#: builtins.c:83 +msgid "echo [-neE] [arg ...]" +msgstr "echo [-neE] [Argument ...]" + +#: builtins.c:87 +msgid "echo [-n] [arg ...]" +msgstr "echo [-n] [Argument ...]" + +#: builtins.c:90 +msgid "enable [-a] [-dnps] [-f filename] [name ...]" +msgstr "enable [-a] [-dnps] [-f Dateiname] [Name ...]" + +#: builtins.c:92 +msgid "eval [arg ...]" +msgstr "eval [Argument ...]" + +#: builtins.c:94 +msgid "getopts optstring name [arg]" +msgstr "getopts Optionen Variable [Argumente]" + +#: builtins.c:96 +msgid "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" +msgstr "exec [-cl] [-a Name] [Kommando [Argumente ...]] [Umleitung ...]" + +#: builtins.c:98 +msgid "exit [n]" +msgstr "exit [n]" + +#: builtins.c:100 +msgid "logout [n]" +msgstr "logout [n]" + +#: builtins.c:103 +msgid "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" +msgstr "" +"fc [-e Editor] [-lnr] [Anfang] [Ende] oder fc -s [Muster=Ersetzung] " +"[Kommando]" + +#: builtins.c:107 +msgid "fg [job_spec]" +msgstr "fg [Jobbezeichnung]" + +#: builtins.c:111 +msgid "bg [job_spec ...]" +msgstr "bg [Jobbezeichnung ...]" + +#: builtins.c:114 +msgid "hash [-lr] [-p pathname] [-dt] [name ...]" +msgstr "hash [-lr] [-p Pfadname] [-dt] [Name ...]" + +#: builtins.c:117 +msgid "help [-dms] [pattern ...]" +msgstr "help [-dms] [Muster ...]" + +#: builtins.c:121 +msgid "" +"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg " +"[arg...]" +msgstr "" +"history [-c] [-d Offset] [n] oder history -anrw [Dateiname] oder history -ps " +"Argument [Argument...]" + +#: builtins.c:125 +msgid "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" +msgstr "jobs [-lnprs] [Jobbez. ...] or jobs -x Kommando [Arg]" + +#: builtins.c:129 +msgid "disown [-h] [-ar] [jobspec ...]" +msgstr "disown [-h] [-ar] [Jobbezeichnung ...]" + +#: builtins.c:132 +msgid "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l " +"[sigspec]" +msgstr "" +"kill [-s Signalname | -n Signalnummer | -Signalname] [pid | job] ... oder " +"kill -l [Signalname]" + +#: builtins.c:134 +msgid "let arg [arg ...]" +msgstr "let Argument [Argument ...]" + +#: builtins.c:136 +msgid "" +"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p " +"prompt] [-t timeout] [-u fd] [name ...]" +msgstr "" +"read [-ers] [-a Feld] [-d Begrenzer] [-i Text] [-n Zeichenanzahl] [-N " +"Zeichenanzahl] [-p Prompt] [-t Zeitlimit] [-u fd] [Name ...]" + +#: builtins.c:138 +msgid "return [n]" +msgstr "return [n]" + +#: builtins.c:140 +msgid "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" +msgstr "set [-abefhkmnptuvxBCHP] [-o Option] [--] [Argument ...]" + +#: builtins.c:142 +msgid "unset [-f] [-v] [-n] [name ...]" +msgstr "unset [-f] [-v] [-n] [NAME ...]" + +#: builtins.c:144 +msgid "export [-fn] [name[=value] ...] or export -p" +msgstr "export [-fn] [Name[=Wert] ...] oder export -p" + +#: builtins.c:146 +msgid "readonly [-aAf] [name[=value] ...] or readonly -p" +msgstr "readonly [-aAf] [Name[=Wert] ...] oder readonly -p" + +#: builtins.c:148 +msgid "shift [n]" +msgstr "shift [n]" + +#: builtins.c:150 +msgid "source filename [arguments]" +msgstr "source Dateiname [Argumente]" + +#: builtins.c:152 +msgid ". filename [arguments]" +msgstr ". Dateiname [Argumente]" + +#: builtins.c:155 +msgid "suspend [-f]" +msgstr "suspend [-f]" + +#: builtins.c:158 +msgid "test [expr]" +msgstr "test [Ausdruck]" + +#: builtins.c:160 +msgid "[ arg... ]" +msgstr "[ Argument... ]" + +#: builtins.c:162 +msgid "times" +msgstr "times" + +#: builtins.c:164 +msgid "trap [-lp] [[arg] signal_spec ...]" +msgstr "trap [-lp] [[Argument] Signalbezeichnung ...]" + +#: builtins.c:166 +msgid "type [-afptP] name [name ...]" +msgstr "type [-afptP] Name [Name ...]" + +#: builtins.c:169 +msgid "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" +msgstr "ulimit [-SHabcdefilmnpqrstuvxT] [Grenzwert]" + +#: builtins.c:172 +msgid "umask [-p] [-S] [mode]" +msgstr "umask [-p] [-S] [Modus]" + +#: builtins.c:175 +msgid "wait [-n] [id ...]" +msgstr "wait [-n] [id ...]" + +#: builtins.c:179 +msgid "wait [pid ...]" +msgstr "wait [pid ...]" + +#: builtins.c:182 +msgid "for NAME [in WORDS ... ] ; do COMMANDS; done" +msgstr "for Name [in Wortliste ... ] ; do Kommandos; done" + +#: builtins.c:184 +msgid "for (( exp1; exp2; exp3 )); do COMMANDS; done" +msgstr "for (( Ausdr1; Ausdr2; Ausdr3 )); do Kommandos; done" + +#: builtins.c:186 +msgid "select NAME [in WORDS ... ;] do COMMANDS; done" +msgstr "select Name [in Wortliste ... ;] do Kommandos; done" + +#: builtins.c:188 +msgid "time [-p] pipeline" +msgstr "time [-p] Pipeline" + +#: builtins.c:190 +msgid "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" +msgstr "case Wort in [Muster [| Muster]...) Kommandos ;;]... esac" + +#: builtins.c:192 +msgid "" +"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else " +"COMMANDS; ] fi" +msgstr "" +"if Kommandos; then Kommandos; [ elif Kommandos; then Kommandos; ]... [ else " +"Kommandos; ] fi" + +#: builtins.c:194 +msgid "while COMMANDS; do COMMANDS; done" +msgstr "while Kommandos; do Kommandos; done" + +#: builtins.c:196 +msgid "until COMMANDS; do COMMANDS; done" +msgstr "until Kommandos; do Kommandos; done" + +#: builtins.c:198 +msgid "coproc [NAME] command [redirections]" +msgstr "coproc [Name] Kommando [Umleitungen]" + +#: builtins.c:200 +msgid "function name { COMMANDS ; } or name () { COMMANDS ; }" +msgstr "function Name { Kommandos ; } oder Name () { Kommandos ; }" + +#: builtins.c:202 +msgid "{ COMMANDS ; }" +msgstr "{ Kommandos ; }" + +#: builtins.c:204 +msgid "job_spec [&]" +msgstr "Jobbezeichnung [&]" + +#: builtins.c:206 +msgid "(( expression ))" +msgstr "(( Ausdruck ))" + +#: builtins.c:208 +msgid "[[ expression ]]" +msgstr "[[ Ausdruck ]]" + +#: builtins.c:210 +msgid "variables - Names and meanings of some shell variables" +msgstr "variables - Namen und Bedeutung einiger Shell Variablen" + +#: builtins.c:213 +msgid "pushd [-n] [+N | -N | dir]" +msgstr "pushd [-n] [+N | -N | Verzeichnis]" + +#: builtins.c:217 +msgid "popd [-n] [+N | -N]" +msgstr "popd [-n] [+N | -N]" + +#: builtins.c:221 +msgid "dirs [-clpv] [+N] [-N]" +msgstr "dirs [-clpv] [+N] [-N]" + +#: builtins.c:224 +msgid "shopt [-pqsu] [-o] [optname ...]" +msgstr "shopt [-pqsu] [-o] [Optionsname ...]" + +#: builtins.c:226 +msgid "printf [-v var] format [arguments]" +msgstr "printf [-v var] Format [Argumente]" + +#: builtins.c:229 +msgid "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-" +"W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S " +"suffix] [name ...]" +msgstr "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o Option] [-A Aktion] [-G Suchmuster] " +"[-W Wortliste] [-F Funktion] [-C Kommando] [-X Filtermuster] [-P Prefix] [-" +"S Suffix] [Name ...]" + +#: builtins.c:233 +msgid "" +"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " +"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" +msgstr "" +"compgen [-abcdefgjksuv] [-o Option] [-A Aktion] [-G Suchmuster] [-W " +"Wortliste] [-F Funktion] [-C Kommando] [-X Filtermuster] [-P Prefix] [-S " +"Suffix] [Wort]" + +#: builtins.c:237 +msgid "compopt [-o|+o option] [-DE] [name ...]" +msgstr "compopt [-o|+o Option] [-DE] [Name ...]" + +#: builtins.c:240 +msgid "" +"mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" +"mapfile [-n Anzahl] [-O Quelle] [-s Anzahl] [-t] [-u fd] [-C Callback] [-c " +"Menge] [Feldvariable]" + +#: builtins.c:242 +msgid "" +"readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" +"readarray [-n Anzahl] [-O Quelle] [-s Anzahl] [-t] [-u fd] [-C Callback] [-c " +"Menge] [Feldvariable]" + +# alias +#: builtins.c:254 +msgid "" +"Define or display aliases.\n" +" \n" +" Without arguments, `alias' prints the list of aliases in the reusable\n" +" form `alias NAME=VALUE' on standard output.\n" +" \n" +" Otherwise, an alias is defined for each NAME whose VALUE is given.\n" +" A trailing space in VALUE causes the next word to be checked for\n" +" alias substitution when the alias is expanded.\n" +" \n" +" Options:\n" +" -p\tPrint all defined aliases in a reusable format\n" +" \n" +" Exit Status:\n" +" alias returns true unless a NAME is supplied for which no alias has " +"been\n" +" defined." +msgstr "" +"Definiert Aliase oder zeigt sie an.\n" +" \n" +" Ohne Argumente wird die Liste der Aliase (Synonyme) in der Form\n" +" `alias Name=Wert' auf die Standardausgabe ausgegeben.\n" +"\n" +" Sonst wird ein Alias für jeden angegebenen Namen definiert, für\n" +" den ein Wert angegeben wurde. Wenn `Wert' mit einem Leerzeichen\n" +" abschließt, dann wird auch das folgende Wort auf Aliase überprüft.\n" +"\n" +" Optionen:\n" +" -p\tGibt alle definierten Aliase aus.\n" +" \n" +" Rückgabewert:\n" +" Meldet Erfolg, außer wenn `Name' nicht existiert." + +# unalias +#: builtins.c:276 +msgid "" +"Remove each NAME from the list of defined aliases.\n" +" \n" +" Options:\n" +" -a\tremove all alias definitions.\n" +" \n" +" Return success unless a NAME is not an existing alias." +msgstr "" +"Entferne jeden angegebenen Namen von der Aliasliste.\n" +" \n" +" Optionen:\n" +" -a\tEnferne alle Alias Definitionen.\n" +" \n" +" Gibt immer 0 zurück wenn der Alias existierte." + +# bind +#: builtins.c:289 +msgid "" +"Set Readline key bindings and variables.\n" +" \n" +" Bind a key sequence to a Readline function or a macro, or set a\n" +" Readline variable. The non-option argument syntax is equivalent to\n" +" that found in ~/.inputrc, but must be passed as a single argument:\n" +" e.g., bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Options:\n" +" -m keymap Use KEYMAP as the keymap for the duration of this\n" +" command. Acceptable keymap names are emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" +"move,\n" +" vi-command, and vi-insert.\n" +" -l List names of functions.\n" +" -P List function names and bindings.\n" +" -p List functions and bindings in a form that can be\n" +" reused as input.\n" +" -S List key sequences that invoke macros and their " +"values\n" +" -s List key sequences that invoke macros and their " +"values\n" +" in a form that can be reused as input.\n" +" -V List variable names and values\n" +" -v List variable names and values in a form that can\n" +" be reused as input.\n" +" -q function-name Query about which keys invoke the named function.\n" +" -u function-name Unbind all keys which are bound to the named " +"function.\n" +" -r keyseq Remove the binding for KEYSEQ.\n" +" -f filename Read key bindings from FILENAME.\n" +" -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when\n" +" \t\t\t\tKEYSEQ is entered.\n" +" -X\t\t List key sequences bound with -x and associated commands\n" +" in a form that can be reused as input.\n" +" \n" +" Exit Status:\n" +" bind returns 0 unless an unrecognized option is given or an error occurs." +msgstr "" +"Konfiguriert Readline Tastenzuordnungen und Variablen.\n" +" \n" +" Weist eine Tastensequenz einer Readline Funktion oder einem Makro\n" +" zu oder setzt eine Readline Variable. Der Argument syntax ist zu\n" +" den Einträgen in ~/.inputrc äquivalent, aber sie müssen als\n" +" einzelnes Argument übergeben werden. Z.B: bind '\"\\C-x\\C-r\":\n" +" re-read-init-file'.\n" +" \n" +" Optionen:\n" +" -m Keymap Benutzt KEYMAP as Tastaturbelegung für die " +"Laufzeit\n" +" dieses Kommandos. Gültige Keymap Namen sind: " +"emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" +"move,\n" +" vi-command und vi-insert.\n" +" -l Listet Funktionsnamen auf.\n" +" -P Listet Funktionsnamen und Tastenzuordnungen auf.\n" +" -p Listet Funktionsnamen und Tastenzuordnungen so " +"auf,\n" +" dass sie direkt als Eingabe verwendet werden " +"können.\n" +" -S Listet Tastenfolgen und deren Werte auf, die " +"Makros \n" +" aufrufen.\n" +" -s Listet Tastenfolgen und deren Werte auf, die " +"Makros \n" +" aufrufen, dass sie als Eingabe wiederverwendet " +"werden\n" +" können.\n" +" -V Listet Variablennamen und Werte auf.\n" +" -v Listet Variablennamen und Werte so auf, dass sie " +"als\n" +" Eingabe verwendet werden können.\n" +" -q Funktionsname Sucht die Tastenfolgen, welche die angegebene\n" +" Funktion aufrufen.\n" +" -u Funktionsname Entfernt alle der Funktion zugeordneten " +"Tastenfolgen.\n" +" -r Tastenfolge Entfernt die Zuweisungen der angegebeben " +"Tastenfolge.\n" +" -f Dateiname Liest die Tastenzuordnungen aus der angegebenen " +"Datei.\n" +" -x Tastenfolge:Shellkommando\tWeist der Tastenfolge das " +"Shellkommando\n" +" \t\t\t\t\tzu.\n" +" -X Listet mit -x erzeugte\n" +" Tastenfolgen und deren Werte\n" +" auf, die Makros aufrufen, dass\n" +" sie als Eingabe wiederverwendet " +"werden\n" +" können.\n" +" \n" +" Rückgabewert: \n" +" Bind gibt 0 zurück, wenn keine unerkannte Option angegeben wurde\n" +" oder ein Fehler eintrat." + +# break +#: builtins.c:328 +msgid "" +"Exit for, while, or until loops.\n" +" \n" +" Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n" +" loops.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Beendet for, while oder until Schleifen.\n" +" \n" +" Break beendet eine »for«, »while« oder »until« Schleife. Wenn »n«\n" +" angegeben ist, werden entsprechend viele geschachtelte Schleifen\n" +" beendet.\n" +" \n" +" Rückgabewert:\n" +" Der Rückgabewert ist 0, außer »n« ist nicht größer oder gleich 1." + +# continue +#: builtins.c:340 +msgid "" +"Resume for, while, or until loops.\n" +" \n" +" Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n" +" If N is specified, resumes the Nth enclosing loop.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Springt zum Schleifenanfang von for, while, oder until Schleifen.\n" +" \n" +" Springt zum Schleifenanfang der aktuellen »for«, »while« oder »until«\n" +" Schleife. Wenn »n« angegeben ist, wird zum Beginn der »n«-ten\n" +" übergeordneten Schleife gesprungen.\n" +" \n" +" Rückgabewert:\n" +" Der Rückgabewert ist 0, außer wenn »n« nicht größer oder gleich 1 ist." + +# builtin +#: builtins.c:352 +msgid "" +"Execute shell builtins.\n" +" \n" +" Execute SHELL-BUILTIN with arguments ARGs without performing command\n" +" lookup. This is useful when you wish to reimplement a shell builtin\n" +" as a shell function, but need to execute the builtin within the " +"function.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n" +" not a shell builtin.." +msgstr "" +"Führt eine in der Shell definierts Kommando aus.\n" +" \n" +" Führt eine in der Shell definertes Kommando aus. Dies ist dann\n" +" nützlich, wenn es mit gleichem Namen als Funktion reimplementiert\n" +" werden soll, aber die Funktionalität des eingebauten Kommandos\n" +" innerhalb der neuen Funktion benötigt wird.\n" +" \n" +" Rückgabewert: \n" +" Der Rückgabewert des aufgerufenen Kommandos oder »falsch«, wenn\n" +" dieses nicht existiert." + +# caller +#: builtins.c:367 +msgid "" +"Return the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns \"$line $filename\". With EXPR, returns\n" +" \"$line $subroutine $filename\"; this extra information can be used to\n" +" provide a stack trace.\n" +" \n" +" The value of EXPR indicates how many call frames to go back before the\n" +" current one; the top frame is frame 0.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless the shell is not executing a shell function or EXPR\n" +" is invalid." +msgstr "" + +# cd +#: builtins.c:385 +msgid "" +"Change the shell working directory.\n" +" \n" +" Change the current directory to DIR. The default DIR is the value of " +"the\n" +" HOME shell variable.\n" +" \n" +" The variable CDPATH defines the search path for the directory " +"containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon " +"(:).\n" +" A null directory name is the same as the current directory. If DIR " +"begins\n" +" with a slash (/), then CDPATH is not used.\n" +" \n" +" If the directory is not found, and the shell option `cdable_vars' is " +"set,\n" +" the word is assumed to be a variable name. If that variable has a " +"value,\n" +" its value is used for DIR.\n" +" \n" +" Options:\n" +" -L\tforce symbolic links to be followed: resolve symbolic links in\n" +" \tDIR after processing instances of `..'\n" +" -P\tuse the physical directory structure without following symbolic\n" +" \tlinks: resolve symbolic links in DIR before processing instances\n" +" \tof `..'\n" +" -e\tif the -P option is supplied, and the current working directory\n" +" \tcannot be determined successfully, exit with a non-zero status\n" +" -@ on systems that support it, present a file with extended " +"attributes\n" +" as a directory containing the file attributes\n" +" \n" +" The default is to follow symbolic links, as if `-L' were specified.\n" +" `..' is processed by removing the immediately previous pathname " +"component\n" +" back to a slash or the beginning of DIR.\n" +" \n" +" Exit Status:\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully " +"when\n" +" -P is used; non-zero otherwise." +msgstr "" +"Wechselt das Arbeitsverzeichnis.\n" +" \n" +" Wechselt in das angegebene Abeitsverzeichnis. Ohne Angabe eines\n" +" Verzeichnisses wird in das Heimatverzeichnis gewechselt.\n" +" \n" +" Die Variable CDPATH gibt eine Liste von Orten an, in denen nach\n" +" dem angegebeben Verzeichnisnamen gesucht wird. Die Pfadnamen\n" +" werden durch Doppelpunkte »:« getrennt. Ein leerer Pfadname\n" +" bezeichnet das aktuelle Verzeichnis. Wenn ein vollständiger\n" +" Pfadname angegeben ist, wird der CDPATH nicht durchsucht.\n" +" \n" +" Wenn kein entsprechendes Verzeichnis gefunden wurde und die Shell\n" +" Option `cdable_vars' gesetzt ist, dann wird angenommen, dass der\n" +" Verzeichnisname einen Variablennamen enthält. Wenn diese ein Wert\n" +" besitzt, wird dieser als Verzeichnisname verwendet.\n" +" \n" +" Optionen:\n" +" -L\tErzwingt das symbolischen Verweisen gefolgt wird.\n" +" Symbolische Links im aktuellen Verzeichnis werden nach\n" +" dem übergeordneten Verzeichnis aufgelöst.\n" +" -P\tSymbolische Verweise werden ignoriert. Symbolische\n" +" Links im aktuellen Verzeichnis werden vor dem\n" +" übergeordneten Verzeichnis aufgelöst.\n" +" -e\tWenn mit der »-P« das aktuelle Arbeitsverzeichns nicht\n" +" ermittelt werden kann, wird ein Rückgabwert ungleich 0\n" +" geliefert.\n" +" -@ Wenn es das System Unterstützt wird eine Datei mit \n" +" erweiterten Attributen als ein Verzeichnis angezeigt,\n" +" welches die erweiterten Attribute enthält.\n" +" \n" +" Standardmäßig wird symbolischen Verweisen gefolgt (Option -L).\n" +" Das übergeordnete Verzeichnis wird ermittelt, indem der\n" +" Dateiname am letzten Schrägstrich gekürzt wird oder es wird der\n" +" Anfang von DIR verwendet.\n" +" \n" +" Rückgabewert: \n" +" Der Rückgabewert ist 0, wenn das Verzeichnis gewechselt wurde,\n" +" sonst ungleich 0.\n" +" Mit den Optionen »-P -e« wird ein Rückgabewert ungleich 0 auch\n" +" dann gesetzt, wenn das neue aktuelle Verzeichnis nicht ermittelt\n" +" werden konnte." + +# pwd +#: builtins.c:422 +msgid "" +"Print the name of the current working directory.\n" +" \n" +" Options:\n" +" -L\tprint the value of $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tprint the physical directory, without any symbolic links\n" +" \n" +" By default, `pwd' behaves as if `-L' were specified.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless an invalid option is given or the current directory\n" +" cannot be read." +msgstr "" +"Gibt den Namen des aktuellen Arbeitsverzeichnisses aus.\n" +" \n" +" Optionen:\n" +" -L\tGibt den Inhalt der Variable $PWD aus.\n" +" -P\tGibt den physischen Verzeichnispfad aus, ohne\n" +" symbolische Verweise.\n" +" \n" +" Standardmäßig wird immer die Option »-L« gesetzt.\n" +" \n" +" Rückgabewert:\n" +" Ist 0 außer wenn eine ungültige Option angegeben oder das aktuelle\n" +" Verzeichnis nicht lesbar ist." + +# colon +#: builtins.c:439 +msgid "" +"Null command.\n" +" \n" +" No effect; the command does nothing.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Leeranweisung.\n" +"\n" +" Leeranweisung; das Kommando hat keine Wirkung.\n" +"\n" +" Rückgabewert:\n" +" Das Kommando ist immer »wahr«." + +# true +#: builtins.c:450 +msgid "" +"Return a successful result.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Gibt »wahr« zurück.\n" +" \n" +" Rückgabewert:\n" +" Immer »wahr«." + +#: builtins.c:459 +msgid "" +"Return an unsuccessful result.\n" +" \n" +" Exit Status:\n" +" Always fails." +msgstr "" +"Gibt »falsch« zurück.\n" +" \n" +" Rückgabewert:\n" +" Immer »falsch«." + +# command +#: builtins.c:468 +msgid "" +"Execute a simple command or display information about commands.\n" +" \n" +" Runs COMMAND with ARGS suppressing shell function lookup, or display\n" +" information about the specified COMMANDs. Can be used to invoke " +"commands\n" +" on disk when a function with the same name exists.\n" +" \n" +" Options:\n" +" -p\tuse a default value for PATH that is guaranteed to find all of\n" +" \tthe standard utilities\n" +" -v\tprint a description of COMMAND similar to the `type' builtin\n" +" -V\tprint a more verbose description of each COMMAND\n" +" \n" +" Exit Status:\n" +" Returns exit status of COMMAND, or failure if COMMAND is not found." +msgstr "" +"Führt ein einfaches Kommando aus oder zeigt Informationen über Kommandos " +"an.\n" +"\n" +" Führt das Kommando mit den angegebeneb Argumenten aus, ohne\n" +" Shell-Funktion nachzuschlagen oder zeigt Informationen über die\n" +" Kommandos an. Dadurch können auch dann Kommandos ausgeführt\n" +" werden, wenn eine Shell-Funktion gleichen Namens existiert.\n" +" \n" +" Optionen:\n" +" -p\tStandardwert für PATH verwenden. Dies garantiert, dass alle\n" +" \t\tStandard-Dienstprogramme gefunden werden.\n" +" -v\tBeschreibung des Kommandos ausgeben.\n" +" \t\tÄhnlich dem eingebauten Kommando »type«.\n" +" -V\tEine ausführlichere Beschreibung jedes Kommandos ausgeben.\n" +" \n" +" Rückgabewert:\n" +" Gibt den Rückgabewert des Kommandos zurück, oder eine Fehlermeldung, " +"wenn\n" +" das Kommando nicht gefunden wird." + +# declare +#: builtins.c:487 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Declare variables and give them attributes. If no NAMEs are given,\n" +" display the attributes and values of all variables.\n" +" \n" +" Options:\n" +" -f\trestrict action or display to function names and definitions\n" +" -F\trestrict display to function names only (plus line number and\n" +" \tsource file when debugging)\n" +" -g\tcreate global variables when used in a shell function; otherwise\n" +" \tignored\n" +" -p\tdisplay the attributes and value of each NAME\n" +" \n" +" Options which set attributes:\n" +" -a\tto make NAMEs indexed arrays (if supported)\n" +" -A\tto make NAMEs associative arrays (if supported)\n" +" -i\tto make NAMEs have the `integer' attribute\n" +" -l\tto convert NAMEs to lower case on assignment\n" +" -n\tmake NAME a reference to the variable named by its value\n" +" -r\tto make NAMEs readonly\n" +" -t\tto make NAMEs have the `trace' attribute\n" +" -u\tto convert NAMEs to upper case on assignment\n" +" -x\tto make NAMEs export\n" +" \n" +" Using `+' instead of `-' turns off the given attribute.\n" +" \n" +" Variables with the integer attribute have arithmetic evaluation (see\n" +" the `let' command) performed when the variable is assigned a value.\n" +" \n" +" When used in a function, `declare' makes NAMEs local, as with the " +"`local'\n" +" command. The `-g' option suppresses this behavior.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or a variable\n" +" assignment error occurs." +msgstr "" +"Setzt Variablenwerte und deren Attribute.\n" +" \n" +" Deklariert Variablen und weist ihnen Attribute zu. Wenn keine\n" +" Namen angegeben sind, werden die Attribute und Werte aller\n" +" Variablen ausgegeben.\n" +" \n" +" Optionen:\n" +" -f\tZeigt nur Funktionsnamen und Definitionen an.\n" +" -F\tZeigt nur Funktionsnamen an (inklusive Zeilennummer\n" +" \t\tund Quelldatei beim debuggen).\n" +" -g\tDeklariert innerhalb ener Shellfunktion globale\n" +" Variablen; wird sonst ignoriert.\n" +" -p\tZeigt die Attribute und Werte jeder angegebenen\n" +" Variable an.\n" +" \n" +" Attribute setzen:\n" +" -a\tDeklariert ein indiziertes Feld (wenn unterstützt).\n" +" -A\tDeklariert ein assoziatives Feld (wenn unterstützt).\n" +" -i\tDeklariert eine Integer Variable.\n" +" -l\tKonvertiert die Variabennmamen in Kleinbuchstaben.\n" +" -r\tDeklariert nur lesbare Variablen.\n" +" -t\tWeist das »trace« Attibut zu.\n" +" -u\tKonvertiert die Variablennamen in Großbuchstaben.\n" +" -x\tExportiert die Variablen über die aktuelle Shell\n" +" Umgebung hinaus.\n" +" \n" +" Das Voranstellen von »+« anstelle von »-« schaltet die gegebenen\n" +" Attribute ab.\n" +" \n" +" Für Integer Variablen werden bei der Zuweisung arithmetische\n" +" Berechnungen durchgeführt (siehe `help let').\n" +" \n" +" Innerhalb einer Funktion werden lokale Variablen erzeugt. Die\n" +" Option »-g« unterdrückt dieses Verhalten.\n" +" \n" +" Rückgabewert:\n" +" Gibt »Erfolg« zurück, außer eine ungültige Option wurde angegeben,\n" +" oder ein Fehler trat auf." + +#: builtins.c:527 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Obsolete. See `help declare'." +msgstr "" +"Setzt Variablen Werte und Eigenschaften\n" +"\n" +" Veraltet. Siehe `help declare'." + +#: builtins.c:535 +msgid "" +"Define local variables.\n" +" \n" +" Create a local variable called NAME, and give it VALUE. OPTION can\n" +" be any option accepted by `declare'.\n" +" \n" +" Local variables can only be used within a function; they are visible\n" +" only to the function where they are defined and its children.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied, a variable\n" +" assignment error occurs, or the shell is not executing a function." +msgstr "" +"Definiert lokale Variablen.\n" +" \n" +" Erzeugt eine Lokale Variable NAME und weist ihr den Wert VALUE zu.\n" +" OPTION kann eine beliebige von `declare' akzeptierte Option sein.\n" +"\n" +" Lokale Variablen können nur innerhalb einer Funktion benutzt\n" +" werden. Sie sind nur in der sie erzeugenden Funktion und ihren\n" +" Kindern sichtbar.\n" +" \n" +" Rückgabewert: \n" +" Liefert 0 außer bei Angabe einer ungültigen Option, einer\n" +" fehlerhaften Variablenzuweisung oder dem Aufruf außerhalb einer\n" +" Funktion." + +# echo +#: builtins.c:552 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs, separated by a single space character and followed by " +"a\n" +" newline, on the standard output.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" -e\tenable interpretation of the following backslash escapes\n" +" -E\texplicitly suppress interpretation of backslash escapes\n" +" \n" +" `echo' interprets the following backslash-escaped characters:\n" +" \\a\talert (bell)\n" +" \\b\tbackspace\n" +" \\c\tsuppress further output\n" +" \\e\tescape character\n" +" \\E\tescape character\n" +" \\f\tform feed\n" +" \\n\tnew line\n" +" \\r\tcarriage return\n" +" \\t\thorizontal tab\n" +" \\v\tvertical tab\n" +" \\\\\tbackslash\n" +" \\0nnn\tthe character whose ASCII code is NNN (octal). NNN can be\n" +" \t0 to 3 octal digits\n" +" \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" +" \tcan be one or two hex digits\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Ausgabe der Argumente auf die Standardausgabe.\n" +" \n" +" Zeigt die Argumente auf der Standardausgabe gefolgt von einem\n" +" Zeilenumbruch an.\n" +" \n" +" Optionen:\n" +" -n\tKeinen Zeilenumbruch anfügen\n" +" -e\tInterpretation der folgenden Escape-Sequenzen zulassen\n" +" -E\tKeine Interpretation der Escape-Sequenzen.\n" +" \n" +" »echo« interpretiert die folgenden Escape-Sequenzen:\n" +" \\a\tAlarm (Glocke)\n" +" \\b\tRücktaste (Backspace)\n" +" \\c\tweitere Ausgabe unterdrücken\n" +" \\e\tEscape-Zeichen\n" +" \\E Escape Zeichen\n" +" \\f\tSeitenvorschub\n" +" \\n\tZeilenvorschub\n" +" \\r\tWagenrücklauf\n" +" \\t\tHorizontaler Tabulator\n" +" \\v\tVertikaler Tabulator\n" +" \\\\ umgekehrter Schrägstrich (Backslash)\n" +" \\0nnn\tZeichen mit dem ASCII-Code »NNN« (oktal). »NNN« kann null\n" +" \t\tbis drei oktale Ziffern haben.\n" +" \\xHH\tAcht-Bit-Zeichen mit dem Wert »HH« (hexadezimal). »HH«\n" +" \t\tkann ein oder zwei hexadezimale Ziffern haben.\n" +" \n" +" Rückgabewert:\n" +" Gibt »Erfolg« zurück, außer ein Ausgabefehler tritt auf." + +#: builtins.c:588 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs on the standard output followed by a newline.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" + +# enable +#: builtins.c:603 +msgid "" +"Enable and disable shell builtins.\n" +" \n" +" Enables and disables builtin shell commands. Disabling allows you to\n" +" execute a disk command which has the same name as a shell builtin\n" +" without using a full pathname.\n" +" \n" +" Options:\n" +" -a\tprint a list of builtins showing whether or not each is enabled\n" +" -n\tdisable each NAME or display a list of disabled builtins\n" +" -p\tprint the list of builtins in a reusable format\n" +" -s\tprint only the names of Posix `special' builtins\n" +" \n" +" Options controlling dynamic loading:\n" +" -f\tLoad builtin NAME from shared object FILENAME\n" +" -d\tRemove a builtin loaded with -f\n" +" \n" +" Without options, each NAME is enabled.\n" +" \n" +" To use the `test' found in $PATH instead of the shell builtin\n" +" version, type `enable -n test'.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not a shell builtin or an error occurs." +msgstr "" +"Eingebaute Shell-Kommandos aktivieren und deaktivieren.\n" +" \n" +" Aktiviert und deaktiviert eingebaute Shell-Kommandos. Die Deaktivierung\n" +" erlaubt Ihnen, eigene Kommandos mit demselben Namen wie die eingebauten\n" +" Kommandos zu nutzen, ohne den kompletten Pfad angeben zu müssen.\n" +" \n" +" Optionen:\n" +" -a\tGibt eine Liste der eingebauten Kommandos aus inklusive der\n" +" \t\tInformation, ob sie aktiv sind oder nicht.\n" +"\n" +" -n\tdeaktiviert jedes angegebene Kommando oder gibt eine\n" +" Liste der deaktivierten eingebauten Kommandos aus.\n" +" -p\tGibt eine Liste der eingebauten Kommandos in einem\n" +" \t\twiederverwendbaren Format aus.\n" +" -s\tGibt nur die Namen der »speziellen« in POSIX eingebauten\n" +" \t\tKommandos aus.\n" +" \n" +" Optionen zum Beeinflussen des dynamischen Ladens:\n" +" -f\tLade eingebautes Kommando aus der angegebenen Datei.\n" +" -d\tEntfernt ein mit »-f« geladenes Kommando.\n" +" \n" +" Ohne Optionen wird jedes angegebe Kommando aktiviert.\n" +" \n" +" Um das unter $PATH liegende Kommando »test« anstelle der eingebauten\n" +" Version zu nutzen, geben Sie »enable -n test« ein.\n" +" \n" +" Rückgabewert:\n" +" Gibt »Erfolg« zurück, außer NAME ist kein eingebautes Kommando \n" +" oder ein Fehler tritt auf." + +#: builtins.c:631 +msgid "" +"Execute arguments as a shell command.\n" +" \n" +" Combine ARGs into a single string, use the result as input to the " +"shell,\n" +" and execute the resulting commands.\n" +" \n" +" Exit Status:\n" +" Returns exit status of command or success if command is null." +msgstr "" +"Führe die Argumente als Shell Kommando aus.\n" +" \n" +" Fügt die Argumente zu einer Zeichenkette zusammen und verwendet\n" +" das Ergebnis als Eingebe in eine Shell, welche die enthaltenen\n" +" Kommandos ausführt.\n" +" \n" +" Rückgabewert:\n" +" Der Status des Kommandoe oder Erfolg wenn das Kommando leer war." + +# getopts +#: builtins.c:643 +msgid "" +"Parse option arguments.\n" +" \n" +" Getopts is used by shell procedures to parse positional parameters\n" +" as options.\n" +" \n" +" OPTSTRING contains the option letters to be recognized; if a letter\n" +" is followed by a colon, the option is expected to have an argument,\n" +" which should be separated from it by white space.\n" +" \n" +" Each time it is invoked, getopts will place the next option in the\n" +" shell variable $name, initializing name if it does not exist, and\n" +" the index of the next argument to be processed into the shell\n" +" variable OPTIND. OPTIND is initialized to 1 each time the shell or\n" +" a shell script is invoked. When an option requires an argument,\n" +" getopts places that argument into the shell variable OPTARG.\n" +" \n" +" getopts reports errors in one of two ways. If the first character\n" +" of OPTSTRING is a colon, getopts uses silent error reporting. In\n" +" this mode, no error messages are printed. If an invalid option is\n" +" seen, getopts places the option character found into OPTARG. If a\n" +" required argument is not found, getopts places a ':' into NAME and\n" +" sets OPTARG to the option character found. If getopts is not in\n" +" silent mode, and an invalid option is seen, getopts places '?' into\n" +" NAME and unsets OPTARG. If a required argument is not found, a '?'\n" +" is placed in NAME, OPTARG is unset, and a diagnostic message is\n" +" printed.\n" +" \n" +" If the shell variable OPTERR has the value 0, getopts disables the\n" +" printing of error messages, even if the first character of\n" +" OPTSTRING is not a colon. OPTERR has the value 1 by default.\n" +" \n" +" Getopts normally parses the positional parameters ($0 - $9), but if\n" +" more arguments are given, they are parsed instead.\n" +" \n" +" Exit Status:\n" +" Returns success if an option is found; fails if the end of options is\n" +" encountered or an error occurs." +msgstr "" +"Analysieren von Optionsargumenten.\n" +" \n" +" Getopts wird von Shell-Prozeduren verwendet, um die\n" +" Kommandozeilenoptionen auszuwerten.\n" +" \n" +" \"Optionen\" enthält die auszuwertenden Buchstaben. Ein Doppelpunkt\n" +" nach dem Buchstaben zeigt an, dass ein Argument erwartet wird,\n" +" welches durch ein Leerzeichen von der Option getrennt ist.\n" +" \n" +" Bei jedem Aufruf von »getopts« wird die nächste Option der\n" +" $Variable zugewiesen. Diese wird angelegt, falls sie noch\n" +" nicht existiert. Weiterhin wird der Indes Index des nächsten zu\n" +" verarbeitenden Arguments der Shell-Variablen OPTIND\n" +" zugewiesen. OPTIND wird bei jedem Aufruf einer Shell oder eines\n" +" Shell-Skripts mit 1 initialisiert. Wenn eine Option ein Argument\n" +" benötigt, wird dieses OPTARG zugewiesen.\n" +" \n" +" Für Fehlermeldungen gibt es zwei Varianten. Wenn das erste\n" +" Zeichen des Optionsstrings ein Doppelpunkt ist, wird der stille\n" +" Fehlermodus von »getopts« verwendet. In diesem Modus wird keine\n" +" Fehlermeldung ausgegeben. Wenn eine ungültige Option erkannt wird,\n" +" wird das gefundene Optionenzeichen OPTARG zugewiesen. Wenn ein\n" +" benötigtes Argument fehlt, wird ein »:« der Variable zugewiesen\n" +" und OPTARG auf das gefundene Optionenzeichen gesetzt. Im anderen\n" +" Fehlermodus wird ein »?« der Variable zugewiesen, OPTARG geleert\n" +" und eine Fehlermeldung ausgegeben.\n" +" \n" +" Wenn die Shell-Variable OPTERR den Wert »0« hat, werden durch getopts \n" +" keine Fehlermeldungen ausgegeben, auch wenn das erste Zeichen \n" +" von OPTSTRING kein Doppelpunkt ist. OPTERR hat den Vorgabewert »1«.\n" +" \n" +" Getopts analysiert normalerweise die von der Position abhängigen\n" +" Parameter ($0 - $9). Aber wenn mehr Argumente angegeben sind,\n" +" werden stattdessen diese analysiert.\n" +" \n" +" Rückgabewert:\n" +" Gibt »Erfolg« zurück wenn eine Option gefunden wird und\n" +" »gescheitert«, wenn das Ende der Optionen erreicht oder ein Fehler\n" +" aufgetreten ist." + +# exec +#: builtins.c:685 +msgid "" +"Replace the shell with the given command.\n" +" \n" +" Execute COMMAND, replacing this shell with the specified program.\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not " +"specified,\n" +" any redirections take effect in the current shell.\n" +" \n" +" Options:\n" +" -a name\tpass NAME as the zeroth argument to COMMAND\n" +" -c\t\texecute COMMAND with an empty environment\n" +" -l\t\tplace a dash in the zeroth argument to COMMAND\n" +" \n" +" If the command cannot be executed, a non-interactive shell exits, " +"unless\n" +" the shell option `execfail' is set.\n" +" \n" +" Exit Status:\n" +" Returns success unless COMMAND is not found or a redirection error " +"occurs." +msgstr "" +"Ersetzt die Shell durch das angegebene Kommando.\n" +" \n" +" Führt das angebebene Kommando einschließlich dessen Optionen aus\n" +" und ersetzt durch dieses die Shell. Wenn kein Kommando angegeben\n" +" ist, wirken alle Weiterleitungen für die aktuellen Shell.\n" +" \n" +" Optionen:\n" +" -a Name\tSetzt den Namen als nulltes Argument für das Kommando.\n" +" -c\tFührt das Kommando in einer leeren Umgebung aus.\n" +" -l\tSetzt einen Strich als nulltes Argument für das Kommando.\n" +" \n" +" Wenn das Kommando nicht ausgeführt werden kann, wird eine nicht\n" +" interaktive Shell beendet, außer die Shell-Option »execfail« ist\n" +" gesetzt.\n" +" \n" +" Rückgabewert:\n" +" Gibt »Erfolg« zurück, außer das Kommando wurde nicht gefunden oder\n" +" ein Weiterleitungsfehler trat auf." + +# exit +#: builtins.c:706 +msgid "" +"Exit the shell.\n" +" \n" +" Exits the shell with a status of N. If N is omitted, the exit status\n" +" is that of the last command executed." +msgstr "" +"Beendet die aktuelle Shell.\n" +"\n" +" Beendt die die aktuelle Shell mit dem Rückgabewert N. Wenn N nicht " +"angegeben ist,\n" +" wird der Rückgabewert des letzten ausgeführten Kommandos übernommen." + +# logout +#: builtins.c:715 +msgid "" +"Exit a login shell.\n" +" \n" +" Exits a login shell with exit status N. Returns an error if not " +"executed\n" +" in a login shell." +msgstr "" +" Beendet eine Login-Shell.\n" +" \n" +" Beendet eine Login-Shell mit dem Rückgabewert »n«. Wenn logout\n" +" nicht von einer Login-Shell aus ausgeführt wurde, wird ein Fehler\n" +" zurückgegeben." + +# fc +#: builtins.c:725 +msgid "" +"Display or execute commands from the history list.\n" +" \n" +" fc is used to list or edit and re-execute commands from the history " +"list.\n" +" FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" +" string, which means the most recent command beginning with that\n" +" string.\n" +" \n" +" Options:\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then " +"EDITOR,\n" +" \t\tthen vi\n" +" -l \tlist lines instead of editing\n" +" -n\tomit line numbers when listing\n" +" -r\treverse the order of the lines (newest listed first)\n" +" \n" +" With the `fc -s [pat=rep ...] [command]' format, COMMAND is\n" +" re-executed after the substitution OLD=NEW is performed.\n" +" \n" +" A useful alias to use with this is r='fc -s', so that typing `r cc'\n" +" runs the last command beginning with `cc' and typing `r' re-executes\n" +" the last command.\n" +" \n" +" Exit Status:\n" +" Returns success or status of executed command; non-zero if an error " +"occurs." +msgstr "" + +#: builtins.c:755 +msgid "" +"Move job to the foreground.\n" +" \n" +" Place the job identified by JOB_SPEC in the foreground, making it the\n" +" current job. If JOB_SPEC is not present, the shell's notion of the\n" +" current job is used.\n" +" \n" +" Exit Status:\n" +" Status of command placed in foreground, or failure if an error occurs." +msgstr "" +"Bringt einen Job in den Vordergrund.\n" +" \n" +" Bringt den mit JOB_SPEC bezeichneten Prozess als aktuellen Job\n" +" in den Vordergrund. Wenn JOB_SPEC nicht angegeben ist, wird\n" +" der zuletzt angehaltene Job verwendet.\n" +" \n" +" Rückgabewert:\n" +" Status des in den Vordergrund geholten Jobs oder Fehler." + +#: builtins.c:770 +msgid "" +"Move jobs to the background.\n" +" \n" +" Place the jobs identified by each JOB_SPEC in the background, as if " +"they\n" +" had been started with `&'. If JOB_SPEC is not present, the shell's " +"notion\n" +" of the current job is used.\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Bringt einen Job in den Hintergrund.\n" +" \n" +" Bringt den mit JOB_SPEC bezeichneten Job in den Hintergrund,\n" +" als ob er mit »&« gestartet wurde.\n" +" \n" +" Rückgabewert:\n" +" Immer Erfolg, außer wenn die Jobsteuerung nicht verfügbar ist\n" +" oder ein Fehler auftritt." + +#: builtins.c:784 +msgid "" +"Remember or display program locations.\n" +" \n" +" Determine and remember the full pathname of each command NAME. If\n" +" no arguments are given, information about remembered commands is " +"displayed.\n" +" \n" +" Options:\n" +" -d\t\tforget the remembered location of each NAME\n" +" -l\t\tdisplay in a format that may be reused as input\n" +" -p pathname\tuse PATHNAME as the full pathname of NAME\n" +" -r\t\tforget all remembered locations\n" +" -t\t\tprint the remembered location of each NAME, preceding\n" +" \t\teach location with the corresponding NAME if multiple\n" +" \t\tNAMEs are given\n" +" Arguments:\n" +" NAME\t\tEach NAME is searched for in $PATH and added to the list\n" +" \t\tof remembered commands.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not found or an invalid option is given." +msgstr "" + +#: builtins.c:809 +msgid "" +"Display information about builtin commands.\n" +" \n" +" Displays brief summaries of builtin commands. If PATTERN is\n" +" specified, gives detailed help on all commands matching PATTERN,\n" +" otherwise the list of help topics is printed.\n" +" \n" +" Options:\n" +" -d\toutput short description for each topic\n" +" -m\tdisplay usage in pseudo-manpage format\n" +" -s\toutput only a short usage synopsis for each topic matching\n" +" \tPATTERN\n" +" \n" +" Arguments:\n" +" PATTERN\tPattern specifiying a help topic\n" +" \n" +" Exit Status:\n" +" Returns success unless PATTERN is not found or an invalid option is " +"given." +msgstr "" + +#: builtins.c:833 +msgid "" +"Display or manipulate the history list.\n" +" \n" +" Display the history list with line numbers, prefixing each modified\n" +" entry with a `*'. An argument of N lists only the last N entries.\n" +" \n" +" Options:\n" +" -c\tclear the history list by deleting all of the entries\n" +" -d offset\tdelete the history entry at offset OFFSET.\n" +" \n" +" -a\tappend history lines from this session to the history file\n" +" -n\tread all history lines not already read from the history file\n" +" -r\tread the history file and append the contents to the history\n" +" \tlist\n" +" -w\twrite the current history to the history file\n" +" \tand append them to the history list\n" +" \n" +" -p\tperform history expansion on each ARG and display the result\n" +" \twithout storing it in the history list\n" +" -s\tappend the ARGs to the history list as a single entry\n" +" \n" +" If FILENAME is given, it is used as the history file. Otherwise,\n" +" if $HISTFILE has a value, that is used, else ~/.bash_history.\n" +" \n" +" If the $HISTTIMEFORMAT variable is set and not null, its value is used\n" +" as a format string for strftime(3) to print the time stamp associated\n" +" with each displayed history entry. No time stamps are printed " +"otherwise.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" + +#: builtins.c:869 +msgid "" +"Display status of jobs.\n" +" \n" +" Lists the active jobs. JOBSPEC restricts output to that job.\n" +" Without options, the status of all active jobs is displayed.\n" +" \n" +" Options:\n" +" -l\tlists process IDs in addition to the normal information\n" +" -n\tlists only processes that have changed status since the last\n" +" \tnotification\n" +" -p\tlists process IDs only\n" +" -r\trestrict output to running jobs\n" +" -s\trestrict output to stopped jobs\n" +" \n" +" If -x is supplied, COMMAND is run after all job specifications that\n" +" appear in ARGS have been replaced with the process ID of that job's\n" +" process group leader.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs.\n" +" If -x is used, returns the exit status of COMMAND." +msgstr "" + +#: builtins.c:896 +msgid "" +"Remove jobs from current shell.\n" +" \n" +" Removes each JOBSPEC argument from the table of active jobs. Without\n" +" any JOBSPECs, the shell uses its notion of the current job.\n" +" \n" +" Options:\n" +" -a\tremove all jobs if JOBSPEC is not supplied\n" +" -h\tmark each JOBSPEC so that SIGHUP is not sent to the job if the\n" +" \tshell receives a SIGHUP\n" +" -r\tremove only running jobs\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option or JOBSPEC is given." +msgstr "" + +#: builtins.c:915 +msgid "" +"Send a signal to a job.\n" +" \n" +" Send the processes identified by PID or JOBSPEC the signal named by\n" +" SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n" +" SIGTERM is assumed.\n" +" \n" +" Options:\n" +" -s sig\tSIG is a signal name\n" +" -n sig\tSIG is a signal number\n" +" -l\tlist the signal names; if arguments follow `-l' they are\n" +" \tassumed to be signal numbers for which names should be listed\n" +" \n" +" Kill is a shell builtin for two reasons: it allows job IDs to be used\n" +" instead of process IDs, and allows processes to be killed if the limit\n" +" on processes that you can create is reached.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" + +#: builtins.c:938 +msgid "" +"Evaluate arithmetic expressions.\n" +" \n" +" Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" +" fixed-width integers with no check for overflow, though division by 0\n" +" is trapped and flagged as an error. The following list of operators is\n" +" grouped into levels of equal-precedence operators. The levels are " +"listed\n" +" in order of decreasing precedence.\n" +" \n" +" \tid++, id--\tvariable post-increment, post-decrement\n" +" \t++id, --id\tvariable pre-increment, pre-decrement\n" +" \t-, +\t\tunary minus, plus\n" +" \t!, ~\t\tlogical and bitwise negation\n" +" \t**\t\texponentiation\n" +" \t*, /, %\t\tmultiplication, division, remainder\n" +" \t+, -\t\taddition, subtraction\n" +" \t<<, >>\t\tleft and right bitwise shifts\n" +" \t<=, >=, <, >\tcomparison\n" +" \t==, !=\t\tequality, inequality\n" +" \t&\t\tbitwise AND\n" +" \t^\t\tbitwise XOR\n" +" \t|\t\tbitwise OR\n" +" \t&&\t\tlogical AND\n" +" \t||\t\tlogical OR\n" +" \texpr ? expr : expr\n" +" \t\t\tconditional operator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tassignment\n" +" \n" +" Shell variables are allowed as operands. The name of the variable\n" +" is replaced by its value (coerced to a fixed-width integer) within\n" +" an expression. The variable need not have its integer attribute\n" +" turned on to be used in an expression.\n" +" \n" +" Operators are evaluated in order of precedence. Sub-expressions in\n" +" parentheses are evaluated first and may override the precedence\n" +" rules above.\n" +" \n" +" Exit Status:\n" +" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." +msgstr "" + +#: builtins.c:983 +msgid "" +"Read a line from the standard input and split it into fields.\n" +" \n" +" Reads a single line from the standard input, or from file descriptor FD\n" +" if the -u option is supplied. The line is split into fields as with " +"word\n" +" splitting, and the first word is assigned to the first NAME, the second\n" +" word to the second NAME, and so on, with any leftover words assigned to\n" +" the last NAME. Only the characters found in $IFS are recognized as " +"word\n" +" delimiters.\n" +" \n" +" If no NAMEs are supplied, the line read is stored in the REPLY " +"variable.\n" +" \n" +" Options:\n" +" -a array\tassign the words read to sequential indices of the array\n" +" \t\tvariable ARRAY, starting at zero\n" +" -d delim\tcontinue until the first character of DELIM is read, rather\n" +" \t\tthan newline\n" +" -e\t\tuse Readline to obtain the line in an interactive shell\n" +" -i text\tUse TEXT as the initial text for Readline\n" +" -n nchars\treturn after reading NCHARS characters rather than waiting\n" +" \t\tfor a newline, but honor a delimiter if fewer than NCHARS\n" +" \t\tcharacters are read before the delimiter\n" +" -N nchars\treturn only after reading exactly NCHARS characters, " +"unless\n" +" \t\tEOF is encountered or read times out, ignoring any delimiter\n" +" -p prompt\toutput the string PROMPT without a trailing newline before\n" +" \t\tattempting to read\n" +" -r\t\tdo not allow backslashes to escape any characters\n" +" -s\t\tdo not echo input coming from a terminal\n" +" -t timeout\ttime out and return failure if a complete line of input " +"is\n" +" \t\tnot read within TIMEOUT seconds. The value of the TMOUT\n" +" \t\tvariable is the default timeout. TIMEOUT may be a\n" +" \t\tfractional number. If TIMEOUT is 0, read returns immediately,\n" +" \t\twithout trying to read any data, returning success only if\n" +" \t\tinput is available on the specified file descriptor. The\n" +" \t\texit status is greater than 128 if the timeout is exceeded\n" +" -u fd\t\tread from file descriptor FD instead of the standard input\n" +" \n" +" Exit Status:\n" +" The return code is zero, unless end-of-file is encountered, read times " +"out\n" +" (in which case it's greater than 128), a variable assignment error " +"occurs,\n" +" or an invalid file descriptor is supplied as the argument to -u." +msgstr "" + +#: builtins.c:1028 +msgid "" +"Return from a shell function.\n" +" \n" +" Causes a function or sourced script to exit with the return value\n" +" specified by N. If N is omitted, the return status is that of the\n" +" last command executed within the function or script.\n" +" \n" +" Exit Status:\n" +" Returns N, or failure if the shell is not executing a function or script." +msgstr "" + +#: builtins.c:1041 +msgid "" +"Set or unset values of shell options and positional parameters.\n" +" \n" +" Change the value of shell attributes and positional parameters, or\n" +" display the names and values of shell variables.\n" +" \n" +" Options:\n" +" -a Mark variables which are modified or created for export.\n" +" -b Notify of job termination immediately.\n" +" -e Exit immediately if a command exits with a non-zero status.\n" +" -f Disable file name generation (globbing).\n" +" -h Remember the location of commands as they are looked up.\n" +" -k All assignment arguments are placed in the environment for a\n" +" command, not just those that precede the command name.\n" +" -m Job control is enabled.\n" +" -n Read commands but do not execute them.\n" +" -o option-name\n" +" Set the variable corresponding to option-name:\n" +" allexport same as -a\n" +" braceexpand same as -B\n" +" emacs use an emacs-style line editing interface\n" +" errexit same as -e\n" +" errtrace same as -E\n" +" functrace same as -T\n" +" hashall same as -h\n" +" histexpand same as -H\n" +" history enable command history\n" +" ignoreeof the shell will not exit upon reading EOF\n" +" interactive-comments\n" +" allow comments to appear in interactive commands\n" +" keyword same as -k\n" +" monitor same as -m\n" +" noclobber same as -C\n" +" noexec same as -n\n" +" noglob same as -f\n" +" nolog currently accepted but ignored\n" +" notify same as -b\n" +" nounset same as -u\n" +" onecmd same as -t\n" +" physical same as -P\n" +" pipefail the return value of a pipeline is the status of\n" +" the last command to exit with a non-zero status,\n" +" or zero if no command exited with a non-zero " +"status\n" +" posix change the behavior of bash where the default\n" +" operation differs from the Posix standard to\n" +" match the standard\n" +" privileged same as -p\n" +" verbose same as -v\n" +" vi use a vi-style line editing interface\n" +" xtrace same as -x\n" +" -p Turned on whenever the real and effective user ids do not match.\n" +" Disables processing of the $ENV file and importing of shell\n" +" functions. Turning this option off causes the effective uid and\n" +" gid to be set to the real uid and gid.\n" +" -t Exit after reading and executing one command.\n" +" -u Treat unset variables as an error when substituting.\n" +" -v Print shell input lines as they are read.\n" +" -x Print commands and their arguments as they are executed.\n" +" -B the shell will perform brace expansion\n" +" -C If set, disallow existing regular files to be overwritten\n" +" by redirection of output.\n" +" -E If set, the ERR trap is inherited by shell functions.\n" +" -H Enable ! style history substitution. This flag is on\n" +" by default when the shell is interactive.\n" +" -P If set, do not resolve symbolic links when executing commands\n" +" such as cd which change the current directory.\n" +" -T If set, the DEBUG trap is inherited by shell functions.\n" +" -- Assign any remaining arguments to the positional parameters.\n" +" If there are no remaining arguments, the positional parameters\n" +" are unset.\n" +" - Assign any remaining arguments to the positional parameters.\n" +" The -x and -v options are turned off.\n" +" \n" +" Using + rather than - causes these flags to be turned off. The\n" +" flags can also be used upon invocation of the shell. The current\n" +" set of flags may be found in $-. The remaining n ARGs are positional\n" +" parameters and are assigned, in order, to $1, $2, .. $n. If no\n" +" ARGs are given, all shell variables are printed.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given." +msgstr "" + +#: builtins.c:1126 +msgid "" +"Unset values and attributes of shell variables and functions.\n" +" \n" +" For each NAME, remove the corresponding variable or function.\n" +" \n" +" Options:\n" +" -f\ttreat each NAME as a shell function\n" +" -v\ttreat each NAME as a shell variable\n" +" -n\ttreat each NAME as a name reference and unset the variable itself\n" +" \trather than the variable it references\n" +" \n" +" Without options, unset first tries to unset a variable, and if that " +"fails,\n" +" tries to unset a function.\n" +" \n" +" Some variables cannot be unset; also see `readonly'.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a NAME is read-only." +msgstr "" + +#: builtins.c:1148 +msgid "" +"Set export attribute for shell variables.\n" +" \n" +" Marks each NAME for automatic export to the environment of subsequently\n" +" executed commands. If VALUE is supplied, assign VALUE before " +"exporting.\n" +" \n" +" Options:\n" +" -f\trefer to shell functions\n" +" -n\tremove the export property from each NAME\n" +" -p\tdisplay a list of all exported variables and functions\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" + +#: builtins.c:1167 +msgid "" +"Mark shell variables as unchangeable.\n" +" \n" +" Mark each NAME as read-only; the values of these NAMEs may not be\n" +" changed by subsequent assignment. If VALUE is supplied, assign VALUE\n" +" before marking as read-only.\n" +" \n" +" Options:\n" +" -a\trefer to indexed array variables\n" +" -A\trefer to associative array variables\n" +" -f\trefer to shell functions\n" +" -p\tdisplay a list of all readonly variables or functions, depending " +"on\n" +" whether or not the -f option is given\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" + +#: builtins.c:1189 +msgid "" +"Shift positional parameters.\n" +" \n" +" Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n" +" not given, it is assumed to be 1.\n" +" \n" +" Exit Status:\n" +" Returns success unless N is negative or greater than $#." +msgstr "" + +#: builtins.c:1201 builtins.c:1216 +msgid "" +"Execute commands from a file in the current shell.\n" +" \n" +" Read and execute commands from FILENAME in the current shell. The\n" +" entries in $PATH are used to find the directory containing FILENAME.\n" +" If any ARGUMENTS are supplied, they become the positional parameters\n" +" when FILENAME is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed in FILENAME; fails if\n" +" FILENAME cannot be read." +msgstr "" + +#: builtins.c:1232 +msgid "" +"Suspend shell execution.\n" +" \n" +" Suspend the execution of this shell until it receives a SIGCONT signal.\n" +" Unless forced, login shells cannot be suspended.\n" +" \n" +" Options:\n" +" -f\tforce the suspend, even if the shell is a login shell\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" + +#: builtins.c:1248 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" Exits with a status of 0 (true) or 1 (false) depending on\n" +" the evaluation of EXPR. Expressions may be unary or binary. Unary\n" +" expressions are often used to examine the status of a file. There\n" +" are string operators and numeric comparison operators as well.\n" +" \n" +" The behavior of test depends on the number of arguments. Read the\n" +" bash manual page for the complete specification.\n" +" \n" +" File operators:\n" +" \n" +" -a FILE True if file exists.\n" +" -b FILE True if file is block special.\n" +" -c FILE True if file is character special.\n" +" -d FILE True if file is a directory.\n" +" -e FILE True if file exists.\n" +" -f FILE True if file exists and is a regular file.\n" +" -g FILE True if file is set-group-id.\n" +" -h FILE True if file is a symbolic link.\n" +" -L FILE True if file is a symbolic link.\n" +" -k FILE True if file has its `sticky' bit set.\n" +" -p FILE True if file is a named pipe.\n" +" -r FILE True if file is readable by you.\n" +" -s FILE True if file exists and is not empty.\n" +" -S FILE True if file is a socket.\n" +" -t FD True if FD is opened on a terminal.\n" +" -u FILE True if the file is set-user-id.\n" +" -w FILE True if the file is writable by you.\n" +" -x FILE True if the file is executable by you.\n" +" -O FILE True if the file is effectively owned by you.\n" +" -G FILE True if the file is effectively owned by your group.\n" +" -N FILE True if the file has been modified since it was last " +"read.\n" +" \n" +" FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" +" modification date).\n" +" \n" +" FILE1 -ot FILE2 True if file1 is older than file2.\n" +" \n" +" FILE1 -ef FILE2 True if file1 is a hard link to file2.\n" +" \n" +" String operators:\n" +" \n" +" -z STRING True if string is empty.\n" +" \n" +" -n STRING\n" +" STRING True if string is not empty.\n" +" \n" +" STRING1 = STRING2\n" +" True if the strings are equal.\n" +" STRING1 != STRING2\n" +" True if the strings are not equal.\n" +" STRING1 < STRING2\n" +" True if STRING1 sorts before STRING2 " +"lexicographically.\n" +" STRING1 > STRING2\n" +" True if STRING1 sorts after STRING2 lexicographically.\n" +" \n" +" Other operators:\n" +" \n" +" -o OPTION True if the shell option OPTION is enabled.\n" +" -v VAR\t True if the shell variable VAR is set\n" +" -R VAR\t True if the shell variable VAR is set and is a name " +"reference.\n" +" ! EXPR True if expr is false.\n" +" EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n" +" EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n" +" \n" +" arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Arithmetic binary operators return true if ARG1 is equal, not-equal,\n" +" less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n" +" than ARG2.\n" +" \n" +" Exit Status:\n" +" Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n" +" false or an invalid argument is given." +msgstr "" + +# [ +#: builtins.c:1329 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" This is a synonym for the \"test\" builtin, but the last argument must\n" +" be a literal `]', to match the opening `['." +msgstr "" +"Wertet einen bedingen Ausdruck aus.\n" +" \n" +" Dieses Kommando entspricht dem »test« Kommando. Jedoch muss das\n" +" letzte Argument ein »]« sein, welches die öffnende Klammer »[«\n" +" schließt." + +# times +#: builtins.c:1338 +msgid "" +"Display process times.\n" +" \n" +" Prints the accumulated user and system times for the shell and all of " +"its\n" +" child processes.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Zeigt den Zeitverbrauch an.\n" +" \n" +" Gibt den kumulierte Nutzer- und Sysemzeitverbrauch der Shell und\n" +" aller von ihr gestarteten Prozesse aus.\n" +" \n" +" Rückgabewert:\n" +" Immer 0." + +#: builtins.c:1350 +msgid "" +"Trap signals and other events.\n" +" \n" +" Defines and activates handlers to be run when the shell receives " +"signals\n" +" or other conditions.\n" +" \n" +" ARG is a command to be read and executed when the shell receives the\n" +" signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n" +" is supplied) or `-', each specified signal is reset to its original\n" +" value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" +" shell and by the commands it invokes.\n" +" \n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. " +"If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. " +"If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or " +"a\n" +" script run by the . or source builtins finishes executing. A " +"SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause " +"the\n" +" shell to exit when the -e option is enabled.\n" +" \n" +" If no arguments are supplied, trap prints the list of commands " +"associated\n" +" with each signal.\n" +" \n" +" Options:\n" +" -l\tprint a list of signal names and their corresponding numbers\n" +" -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" +" \n" +" Each SIGNAL_SPEC is either a signal name in or a signal " +"number.\n" +" Signal names are case insensitive and the SIG prefix is optional. A\n" +" signal may be sent to the shell with \"kill -signal $$\".\n" +" \n" +" Exit Status:\n" +" Returns success unless a SIGSPEC is invalid or an invalid option is " +"given." +msgstr "" + +#: builtins.c:1386 +msgid "" +"Display information about command type.\n" +" \n" +" For each NAME, indicate how it would be interpreted if used as a\n" +" command name.\n" +" \n" +" Options:\n" +" -a\tdisplay all locations containing an executable named NAME;\n" +" \tincludes aliases, builtins, and functions, if and only if\n" +" \tthe `-p' option is not also used\n" +" -f\tsuppress shell function lookup\n" +" -P\tforce a PATH search for each NAME, even if it is an alias,\n" +" \tbuiltin, or function, and returns the name of the disk file\n" +" \tthat would be executed\n" +" -p\treturns either the name of the disk file that would be executed,\n" +" \tor nothing if `type -t NAME' would not return `file'.\n" +" -t\toutput a single word which is one of `alias', `keyword',\n" +" \t`function', `builtin', `file' or `', if NAME is an alias, shell\n" +" \treserved word, shell function, shell builtin, disk file, or not\n" +" \tfound, respectively\n" +" \n" +" Arguments:\n" +" NAME\tCommand name to be interpreted.\n" +" \n" +" Exit Status:\n" +" Returns success if all of the NAMEs are found; fails if any are not " +"found." +msgstr "" + +#: builtins.c:1417 +msgid "" +"Modify shell resource limits.\n" +" \n" +" Provides control over the resources available to the shell and " +"processes\n" +" it creates, on systems that allow such control.\n" +" \n" +" Options:\n" +" -S\tuse the `soft' resource limit\n" +" -H\tuse the `hard' resource limit\n" +" -a\tall current limits are reported\n" +" -b\tthe socket buffer size\n" +" -c\tthe maximum size of core files created\n" +" -d\tthe maximum size of a process's data segment\n" +" -e\tthe maximum scheduling priority (`nice')\n" +" -f\tthe maximum size of files written by the shell and its children\n" +" -i\tthe maximum number of pending signals\n" +" -l\tthe maximum size a process may lock into memory\n" +" -m\tthe maximum resident set size\n" +" -n\tthe maximum number of open file descriptors\n" +" -p\tthe pipe buffer size\n" +" -q\tthe maximum number of bytes in POSIX message queues\n" +" -r\tthe maximum real-time scheduling priority\n" +" -s\tthe maximum stack size\n" +" -t\tthe maximum amount of cpu time in seconds\n" +" -u\tthe maximum number of user processes\n" +" -v\tthe size of virtual memory\n" +" -x\tthe maximum number of file locks\n" +" -T the maximum number of threads\n" +" \n" +" Not all options are available on all platforms.\n" +" \n" +" If LIMIT is given, it is the new value of the specified resource; the\n" +" special LIMIT values `soft', `hard', and `unlimited' stand for the\n" +" current soft limit, the current hard limit, and no limit, respectively.\n" +" Otherwise, the current value of the specified resource is printed. If\n" +" no option is given, then -f is assumed.\n" +" \n" +" Values are in 1024-byte increments, except for -t, which is in seconds,\n" +" -p, which is in increments of 512 bytes, and -u, which is an unscaled\n" +" number of processes.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1465 +msgid "" +"Display or set file mode mask.\n" +" \n" +" Sets the user file-creation mask to MODE. If MODE is omitted, prints\n" +" the current value of the mask.\n" +" \n" +" If MODE begins with a digit, it is interpreted as an octal number;\n" +" otherwise it is a symbolic mode string like that accepted by chmod(1).\n" +" \n" +" Options:\n" +" -p\tif MODE is omitted, output in a form that may be reused as input\n" +" -S\tmakes the output symbolic; otherwise an octal number is output\n" +" \n" +" Exit Status:\n" +" Returns success unless MODE is invalid or an invalid option is given." +msgstr "" + +#: builtins.c:1485 +msgid "" +"Wait for job completion and return exit status.\n" +" \n" +" Waits for each process identified by an ID, which may be a process ID or " +"a\n" +" job specification, and reports its termination status. If ID is not\n" +" given, waits for all currently active child processes, and the return\n" +" status is zero. If ID is a a job specification, waits for all " +"processes\n" +" in that job's pipeline.\n" +" \n" +" If the -n option is supplied, waits for the next job to terminate and\n" +" returns its exit status.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last ID; fails if ID is invalid or an invalid\n" +" option is given." +msgstr "" + +#: builtins.c:1506 +msgid "" +"Wait for process completion and return exit status.\n" +" \n" +" Waits for each process specified by a PID and reports its termination " +"status.\n" +" If PID is not given, waits for all currently active child processes,\n" +" and the return status is zero. PID must be a process ID.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last PID; fails if PID is invalid or an " +"invalid\n" +" option is given." +msgstr "" + +#: builtins.c:1521 +msgid "" +"Execute commands for each member in a list.\n" +" \n" +" The `for' loop executes a sequence of commands for each member in a\n" +" list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is\n" +" assumed. For each element in WORDS, NAME is set to that element, and\n" +" the COMMANDS are executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1535 +msgid "" +"Arithmetic for loop.\n" +" \n" +" Equivalent to\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n" +" omitted, it behaves as if it evaluates to 1.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1553 +msgid "" +"Select words from a list and execute commands.\n" +" \n" +" The WORDS are expanded, generating a list of words. The\n" +" set of expanded words is printed on the standard error, each\n" +" preceded by a number. If `in WORDS' is not present, `in \"$@\"'\n" +" is assumed. The PS3 prompt is then displayed and a line read\n" +" from the standard input. If the line consists of the number\n" +" corresponding to one of the displayed words, then NAME is set\n" +" to that word. If the line is empty, WORDS and the prompt are\n" +" redisplayed. If EOF is read, the command completes. Any other\n" +" value read causes NAME to be set to null. The line read is saved\n" +" in the variable REPLY. COMMANDS are executed after each selection\n" +" until a break command is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1574 +msgid "" +"Report time consumed by pipeline's execution.\n" +" \n" +" Execute PIPELINE and print a summary of the real time, user CPU time,\n" +" and system CPU time spent executing PIPELINE when it terminates.\n" +" \n" +" Options:\n" +" -p\tprint the timing summary in the portable Posix format\n" +" \n" +" The value of the TIMEFORMAT variable is used as the output format.\n" +" \n" +" Exit Status:\n" +" The return status is the return status of PIPELINE." +msgstr "" + +#: builtins.c:1591 +msgid "" +"Execute commands based on pattern matching.\n" +" \n" +" Selectively execute COMMANDS based upon WORD matching PATTERN. The\n" +" `|' is used to separate multiple patterns.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1603 +msgid "" +"Execute commands based on conditional.\n" +" \n" +" The `if COMMANDS' list is executed. If its exit status is zero, then " +"the\n" +" `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list " +"is\n" +" executed in turn, and if its exit status is zero, the corresponding\n" +" `then COMMANDS' list is executed and the if command completes. " +"Otherwise,\n" +" the `else COMMANDS' list is executed, if present. The exit status of " +"the\n" +" entire construct is the exit status of the last command executed, or " +"zero\n" +" if no condition tested true.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1620 +msgid "" +"Execute commands as long as a test succeeds.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `while' COMMANDS has an exit status of zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1632 +msgid "" +"Execute commands as long as a test does not succeed.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `until' COMMANDS has an exit status which is not zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1644 +msgid "" +"Create a coprocess named NAME.\n" +" \n" +" Execute COMMAND asynchronously, with the standard output and standard\n" +" input of the command connected via a pipe to file descriptors assigned\n" +" to indices 0 and 1 of an array variable NAME in the executing shell.\n" +" The default NAME is \"COPROC\".\n" +" \n" +" Exit Status:\n" +" Returns the exit status of COMMAND." +msgstr "" + +#: builtins.c:1658 +msgid "" +"Define shell function.\n" +" \n" +" Create a shell function named NAME. When invoked as a simple command,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is " +"invoked,\n" +" the arguments are passed to the function as $1...$n, and the function's\n" +" name is in $FUNCNAME.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is readonly." +msgstr "" + +#: builtins.c:1672 +msgid "" +"Group commands as a unit.\n" +" \n" +" Run a set of commands in a group. This is one way to redirect an\n" +" entire set of commands.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1684 +msgid "" +"Resume job in foreground.\n" +" \n" +" Equivalent to the JOB_SPEC argument to the `fg' command. Resume a\n" +" stopped or background job. JOB_SPEC can specify either a job name\n" +" or a job number. Following JOB_SPEC with a `&' places the job in\n" +" the background, as if the job specification had been supplied as an\n" +" argument to `bg'.\n" +" \n" +" Exit Status:\n" +" Returns the status of the resumed job." +msgstr "" + +# (( )) +#: builtins.c:1699 +msgid "" +"Evaluate arithmetic expression.\n" +" \n" +" The EXPRESSION is evaluated according to the rules for arithmetic\n" +" evaluation. Equivalent to \"let EXPRESSION\".\n" +" \n" +" Exit Status:\n" +" Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise." +msgstr "" +"Wertet arithmetische Ausdrücke aus.\n" +"\n" +" Der Ausdruck wird nach den Regeln für arithmetische\n" +" Berechnungen ausgewertet. Diese Schreibweise entspricht \"let\n" +" Ausdruck\".\n" +"\n" +" Rückgabewert: \n" +" Gibt »1« zurück, wenn die Auswertung des letzten Arguments Null\n" +" ergibt, sonst »0«." + +#: builtins.c:1711 +msgid "" +"Execute conditional command.\n" +" \n" +" Returns a status of 0 or 1 depending on the evaluation of the " +"conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries " +"used\n" +" by the `test' builtin, and may be combined using the following " +"operators:\n" +" \n" +" ( EXPRESSION )\tReturns the value of EXPRESSION\n" +" ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" +" EXPR1 && EXPR2\tTrue if both EXPR1 and EXPR2 are true; else false\n" +" EXPR1 || EXPR2\tTrue if either EXPR1 or EXPR2 is true; else false\n" +" \n" +" When the `==' and `!=' operators are used, the string to the right of\n" +" the operator is used as a pattern and pattern matching is performed.\n" +" When the `=~' operator is used, the string to the right of the operator\n" +" is matched as a regular expression.\n" +" \n" +" The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n" +" determine the expression's value.\n" +" \n" +" Exit Status:\n" +" 0 or 1 depending on value of EXPRESSION." +msgstr "" + +# variable_help +#: builtins.c:1737 +msgid "" +"Common shell variable names and usage.\n" +" \n" +" BASH_VERSION\tVersion information for this Bash.\n" +" CDPATH\tA colon-separated list of directories to search\n" +" \t\tfor directories given as arguments to `cd'.\n" +" GLOBIGNORE\tA colon-separated list of patterns describing filenames to\n" +" \t\tbe ignored by pathname expansion.\n" +" HISTFILE\tThe name of the file where your command history is stored.\n" +" HISTFILESIZE\tThe maximum number of lines this file can contain.\n" +" HISTSIZE\tThe maximum number of history lines that a running\n" +" \t\tshell can access.\n" +" HOME\tThe complete pathname to your login directory.\n" +" HOSTNAME\tThe name of the current host.\n" +" HOSTTYPE\tThe type of CPU this version of Bash is running under.\n" +" IGNOREEOF\tControls the action of the shell on receipt of an EOF\n" +" \t\tcharacter as the sole input. If set, then the value\n" +" \t\tof it is the number of EOF characters that can be seen\n" +" \t\tin a row on an empty line before the shell will exit\n" +" \t\t(default 10). When unset, EOF signifies the end of input.\n" +" MACHTYPE\tA string describing the current system Bash is running on.\n" +" MAILCHECK\tHow often, in seconds, Bash checks for new mail.\n" +" MAILPATH\tA colon-separated list of filenames which Bash checks\n" +" \t\tfor new mail.\n" +" OSTYPE\tThe version of Unix this version of Bash is running on.\n" +" PATH\tA colon-separated list of directories to search when\n" +" \t\tlooking for commands.\n" +" PROMPT_COMMAND\tA command to be executed before the printing of each\n" +" \t\tprimary prompt.\n" +" PS1\t\tThe primary prompt string.\n" +" PS2\t\tThe secondary prompt string.\n" +" PWD\t\tThe full pathname of the current directory.\n" +" SHELLOPTS\tA colon-separated list of enabled shell options.\n" +" TERM\tThe name of the current terminal type.\n" +" TIMEFORMAT\tThe output format for timing statistics displayed by the\n" +" \t\t`time' reserved word.\n" +" auto_resume\tNon-null means a command word appearing on a line by\n" +" \t\titself is first looked for in the list of currently\n" +" \t\tstopped jobs. If found there, that job is foregrounded.\n" +" \t\tA value of `exact' means that the command word must\n" +" \t\texactly match a command in the list of stopped jobs. A\n" +" \t\tvalue of `substring' means that the command word must\n" +" \t\tmatch a substring of the job. Any other value means that\n" +" \t\tthe command must be a prefix of a stopped job.\n" +" histchars\tCharacters controlling history expansion and quick\n" +" \t\tsubstitution. The first character is the history\n" +" \t\tsubstitution character, usually `!'. The second is\n" +" \t\tthe `quick substitution' character, usually `^'. The\n" +" \t\tthird is the `history comment' character, usually `#'.\n" +" HISTIGNORE\tA colon-separated list of patterns used to decide which\n" +" \t\tcommands should be saved on the history list.\n" +msgstr "" +" BASH_VERSION\tVersionsnummer der Bash.\n" +" CDPATH\tEine durch Doppelpunkte getrennte Liste von\n" +" Verzeichnissen, die durchsucht werden, wenn das\n" +" Argument von `cd' nicht im aktuellen Verzeichnis\n" +" gefunden wird.\n" +" GLOBIGNORE Eine durch Doppelpunkte getrennte Liste von\n" +" Dateinamenmustern, die für die Dateinamensergänzung\n" +" ignoriert werden.\n" +" HISTFILE\tDatei, die den Kommandozeilenspeicher enthält.\n" +" HISTFILESIZE\tMaximale Zeilenanzahl, dieser Datei.\n" +" HISTSIZE\tMaximale Anzahl von Zeilen, auf die der\n" +" Historymechanismus der Shell zurückgreifen kann.\n" +" HOME\tHeimatverzeichnis des aktuellen Benutzers.\n" +" HOSTNAME Der aktuelle Rechnername.\n" +" HOSTTYPE\tCPU-Typ des aktuellen Rechners.\n" +" IGNOREEOF\tLegt die Reaktion der Shell auf ein EOF-Zeichen fest.\n" +" Wenn die Variable eine ganze Zahl enthält, wird diese\n" +" Anzahl EOF Zeichen (Ctrl-D) abgewartet, bis die Shell\n" +" verlassen wird. Der Vorgabewert ist 10. Ist IGNOREEOF\n" +" nicht gesetzt, signalisiert EOF das Ende der Eingabe.\n" +" MACHTYPE Eine Zeichenkette die das aktuell laufende System " +"beschreibt.\n" +" MAILCHECK\tZeit in s, nach der nach E-Mail gesehen wird.\n" +" MAILPATH\tEine durch Doppelpunkt getrennte Liste von Dateinamen,\n" +" die nach E-Mail durchsucht werden.\n" +" OSTYPE\tUnix Version, auf der die Bash gegenwärtig läuft.\n" +" PATH\tDurch Doppelpunkt getrennte Liste von Verzeichnissen,\n" +" die nach Kommandos durchsucht werden.\n" +" PROMPT_COMMAND\tKommando, das vor der Anzeige einer primären\n" +" Eingabeaufforderung (PS1) ausgeführt wird.\n" +" PS1 Zeichenkette, die die primäre\n" +" Eingabeaufforderung enthält.\n" +" PS2 Zeichenkette, die die sekundäre\n" +" Eingabeaufforderung enthält.\n" +" PWD Der vollständige aktuelle Verzeichnisname.\n" +" SHELLOPTS Durch Doppelpunkt getrennte Liste der aktiven\n" +" Shell Optionen.\n" +" TERM\tName des aktuellen Terminaltyps.\n" +" auto_resume Ein Wert ungleich Null bewirkt, daß ein einzelnes\n" +" Kommando auf einer Zeile zunächst in der Liste\n" +" gegenwärtig gestoppter Jobs gesucht und dieser in den\n" +" Vordergrund geholt wird. `exact' bewirkt, daß das\n" +" Kommando genau dem Kommando in der Liste der\n" +" gestoppten Jobs entsprechen muß. Wenn die Variable den\n" +" Wert `substring' enthält, muß das Kommando einem\n" +" Substring der Jobbezeichnung entsprechen. Bei einem\n" +" anderen Wert müssen die ersten Zeichen übereinstimmen.\n" +" histchars Zeichen, die die Befehlswiederholung und die\n" +" Schnellersetzung steuern. An erster Stelle steht\n" +" das Befehlswiederholungszeichen (normalerweise\n" +" `!'); an zweiter das `Schnell-Ersetzen-Zeichen'\n" +" (normalerweise `^'). Das dritte Zeichen ist das\n" +" `Kommentarzeichen' (normalerweise `#').\n" +" HISTIGNORE Eine durch Doppelpunkt getrennte Liste von\n" +" Mustern, welche die in der\n" +" Befehlswiederholungsliste zu speichernden\n" +" Kommandos angibt.\n" + +# pushd +#: builtins.c:1794 +msgid "" +"Add directories to stack.\n" +" \n" +" Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" +"Fügt ein Verzeichnis dem Stapel hinzu.\n" +"\n" +" Legt ein Verzeichnisnamen auf den Verzeichnisstapel oder rotiert\n" +" diesen so,daß das Arbeitsverzeichnis auf der Spitze des Stapels\n" +" liegt. Ohne angegebene Argumente werden die obersten zwei\n" +" Verzeichnisse auf dem Stapel getauscht.\n" +"\n" +" Optionen:\n" +" -n\tunterdrückt das Wechseln in das Verzeichnis beim Hinzufügen\n" +" zum Stapel, so daß nur der Stapel verändert wird.\n" +"\n" +" Argumente:\n" +" +N\tRotiert den Stapel so, daß das N'te Verzeichnis\n" +" (angezeigt von `dirs',gezählt von links) sich an der Spitze des\n" +" Stapels befindet.\n" +"\n" +" -N\tRotiert den Stapel so, daß das N'te Verzeichnis (angezeigt von\n" +" -`dirs',gezählt von rechts) sich an der Spitze des Stapels\n" +" -befindet.\n" +" \n" +"\n" +" DIR\tLegt DIR auf die Spitze des Verzeichnisstapels und wechselt " +"dorthin.\n" +"\n" +" Der Verzeichnisstapel kann mit dem Kommando `dirs' angezeigt\n" +" werden.\n" +"\n" +" Rückgabewert: \n" +" Gibt Erfolg zurück, außer wenn ein ungültiges Argument angegeben\n" +" wurde oder der Verzeichniswechsel nicht erfolgreich war." + +# popd +#: builtins.c:1828 +msgid "" +"Remove directories from stack.\n" +" \n" +" Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" +"Entfernt Einträge vom Verzeichnisstapel.\n" +"\n" +" Entfernt Einträge vom Verzeichnisstapel. Ohne Argumente wird die\n" +" Spitze des Stapels entfernt und in das Verzeichnis gewechselt, das\n" +" dann an der Spitze steht.\n" +"\n" +" Optionen:\n" +" -n\tEntfernt nur den Verzeichniseintrag und wechselt nicht\n" +" \tdas Verzeichnis.\n" +" \n" +" Argumente:\n" +" +N\tEntfernt den N-ten Eintrag von links, gezählt von \t\n" +" Null, aus der von »dirs« anzeigten Liste. Beispielsweise\n" +" entfernen »popd +0« den ersten und »popd +1« den zweiten\n" +" Verzeichniseintrag.\n" +"\n" +" -N\tEntfernt den N-ten Eintrag von rechts, gezählt von Null,\n" +" \taus der von »dirs« angeigten Liste. Beispielsweise entfernen\n" +" »popd -0« den letzten und »popd -1« den vorletzten\n" +" Verzeichniseintrag.\n" +"\n" +" Mit »dirs« kann der Verzeichnisstapel angezeigt werden.\n" +"\n" +" Rückgabewert:\n" +" Gibt 0 zurück, außer wenn ein ungültiges Argument angegeben\n" +" wurde oder der Verzeichniswechsel nicht erfolgreich war." + +# dirs +#: builtins.c:1858 +msgid "" +"Display directory stack.\n" +" \n" +" Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Zeigt den Verzeichnisstapel an.\n" +"\n" +" Zeigt die Liste der gegenwärtig gespeicherten Verzeichnisse.\n" +" Diese werden mit dem `pushd' Kommando eingetragen und mit dem\n" +" `popd' Kommando ausgelesen.\n" +"\n" +" Optionen:\n" +" -c Löscht den Verzeichnisstapel.\n" +" -l Keine Abkürzung für das Heimatverzeichnis durch die\n" +" Tilde (~).\n" +" -p Ausgabe von einem Eintrag pro Zeile.\n" +" -v Ausgabe von einem Eintrag pro Zeile mit Angabe der\n" +" Position im Stapel<\n" +"\n" +" Argumente:\n" +" +N Gibt das N'te Element von links der Liste aus, die\n" +" ohne Argumente ausgegeben wird. Die Zählung beginnt\n" +" bei 0.\n" +" -N Gibt das N'te Element von rechts der Liste aus, die\n" +" ohne Argumente ausgegeben wird. Die Zählung beginnt\n" +" bei 0.\n" +"\n" +" Rückgabewert:\n" +" Gibt Erfolg zurück, außer bei einer ungültigen Option oder wenn\n" +" ein Fehler auftritt." + +#: builtins.c:1887 +msgid "" +"Set and unset shell options.\n" +" \n" +" Change the setting of each shell option OPTNAME. Without any option\n" +" arguments, list all shell options with an indication of whether or not " +"each\n" +" is set.\n" +" \n" +" Options:\n" +" -o\trestrict OPTNAMEs to those defined for use with `set -o'\n" +" -p\tprint each shell option with an indication of its status\n" +" -q\tsuppress output\n" +" -s\tenable (set) each OPTNAME\n" +" -u\tdisable (unset) each OPTNAME\n" +" \n" +" Exit Status:\n" +" Returns success if OPTNAME is enabled; fails if an invalid option is\n" +" given or OPTNAME is disabled." +msgstr "" +"Setzt oder löscht Shell Optionen.\n" +"\n" +" Ändert die in `Optionsname' genannten Shell Optionen. Ohne\n" +" Argumente wird eine Liste der Shell Optionen un deren Stati\n" +" ausgegeben.\n" +"\n" +" Optionen:\n" +" -o Beschränkt die Optionsmanen auf die, welche mit \n" +" `set -o' definiert werden müssen.\n" +" -p Gibt alle Shelloptionen und deren Stati aus.\n" +" -q Unterdrückt Ausgaben.\n" +" -s Setzt jede Option in `Optionsname.'\n" +" -u Deaktiviert jede Option in `Optionsname'.\n" +"\n" +" Rückgabewert:\n" +" Gibt Erfolg zurück, wenn eine Option gesetzt worden ist. Wenn\n" +" eine ungültige Option angegeben wurde oder eine Option deaktiviert\n" +" worden ist, wird Fehler zurückgegeben." + +# formatf +#: builtins.c:1908 +msgid "" +"Formats and prints ARGUMENTS under control of the FORMAT.\n" +" \n" +" Options:\n" +" -v var\tassign the output to shell variable VAR rather than\n" +" \t\tdisplay it on the standard output\n" +" \n" +" FORMAT is a character string which contains three types of objects: " +"plain\n" +" characters, which are simply copied to standard output; character " +"escape\n" +" sequences, which are converted and copied to the standard output; and\n" +" format specifications, each of which causes printing of the next " +"successive\n" +" argument.\n" +" \n" +" In addition to the standard format specifications described in " +"printf(1),\n" +" printf interprets:\n" +" \n" +" %b\texpand backslash escape sequences in the corresponding argument\n" +" %q\tquote the argument in a way that can be reused as shell input\n" +" %(fmt)T output the date-time string resulting from using FMT as a " +"format\n" +" string for strftime(3)\n" +" \n" +" The format is re-used as necessary to consume all of the arguments. If\n" +" there are fewer arguments than the format requires, extra format\n" +" specifications behave as if a zero value or null string, as " +"appropriate,\n" +" had been supplied.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a write or " +"assignment\n" +" error occurs." +msgstr "" + +#: builtins.c:1942 +msgid "" +"Specify how arguments are to be completed by Readline.\n" +" \n" +" For each NAME, specify how arguments are to be completed. If no " +"options\n" +" are supplied, existing completion specifications are printed in a way " +"that\n" +" allows them to be reused as input.\n" +" \n" +" Options:\n" +" -p\tprint existing completion specifications in a reusable format\n" +" -r\tremove a completion specification for each NAME, or, if no\n" +" \tNAMEs are supplied, all completion specifications\n" +" -D\tapply the completions and actions as the default for commands\n" +" \twithout any specific completion defined\n" +" -E\tapply the completions and actions to \"empty\" commands --\n" +" \tcompletion attempted on a blank line\n" +" \n" +" When completion is attempted, the actions are applied in the order the\n" +" uppercase-letter options are listed above. The -D option takes\n" +" precedence over -E.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1970 +msgid "" +"Display possible completions depending on the options.\n" +" \n" +" Intended to be used from within a shell function generating possible\n" +" completions. If the optional WORD argument is supplied, matches " +"against\n" +" WORD are generated.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1985 +msgid "" +"Modify or display completion options.\n" +" \n" +" Modify the completion options for each NAME, or, if no NAMEs are " +"supplied,\n" +" the completion currently being executed. If no OPTIONs are given, " +"print\n" +" the completion options for each NAME or the current completion " +"specification.\n" +" \n" +" Options:\n" +" \t-o option\tSet completion option OPTION for each NAME\n" +" \t-D\t\tChange options for the \"default\" command completion\n" +" \t-E\t\tChange options for the \"empty\" command completion\n" +" \n" +" Using `+o' instead of `-o' turns off the specified option.\n" +" \n" +" Arguments:\n" +" \n" +" Each NAME refers to a command for which a completion specification must\n" +" have previously been defined using the `complete' builtin. If no NAMEs\n" +" are supplied, compopt must be called by a function currently generating\n" +" completions, and the options for that currently-executing completion\n" +" generator are modified.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or NAME does not\n" +" have a completion specification defined." +msgstr "" + +# mapfile +#: builtins.c:2015 +msgid "" +"Read lines from the standard input into an indexed array variable.\n" +" \n" +" Read lines from the standard input into the indexed array variable " +"ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable " +"MAPFILE\n" +" is the default ARRAY.\n" +" \n" +" Options:\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are " +"copied.\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default " +"index is 0.\n" +" -s count \tDiscard the first COUNT lines read.\n" +" -t\t\tRemove a trailing newline from each line read.\n" +" -u fd\t\tRead lines from file descriptor FD instead of the standard " +"input.\n" +" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read.\n" +" -c quantum\tSpecify the number of lines read between each call to " +"CALLBACK.\n" +" \n" +" Arguments:\n" +" ARRAY\t\tArray variable name to use for file data.\n" +" \n" +" If -C is supplied without -c, the default quantum is 5000. When\n" +" CALLBACK is evaluated, it is supplied the index of the next array\n" +" element to be assigned and the line to be assigned to that element\n" +" as additional arguments.\n" +" \n" +" If not supplied with an explicit origin, mapfile will clear ARRAY " +"before\n" +" assigning to it.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or ARRAY is readonly " +"or\n" +" not an indexed array." +msgstr "" + +# readarray +#: builtins.c:2049 +msgid "" +"Read lines from a file into an array variable.\n" +" \n" +" A synonym for `mapfile'." +msgstr "" +"Liest Zeilen einer Datei in eine Array Variable.\n" +"\n" +" Ist ein Synonym für `mapfile'." diff --git a/po/el.gmo b/po/el.gmo new file mode 100644 index 0000000000000000000000000000000000000000..8ea8d43fb4a5e287865d5e6815446008d476c62a GIT binary patch literal 37185 zcmeI437j0ob^jX&b1YzPFqdfrLK0|J7hqT+K|-p%C@^N;P=apHfjf8xY(Fv&m8_xGy0r{~y} z6g&BoeEuWV{<^x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vNjqVm;>rjiY%qAywaRrs6vjD^XJ`HJ;N zmiCN(o@vwtTx`eDX}Ii={9`TB?T-4>rIc!J_`ueA3T#ejQ@llLSPN(XGU8Zj`-Gm1=DW>n*Z1`+Po7KA8>K0G*IS+~1!A)=cFv@ez z)nYBhfq$mmq+4Mqyf3Y;M8NVN@5w4$S>JoYgxNb4&Jo}hIh!yL zhPkhV&yK+J#x;nHD`KR_Ui_1ge6|25B5RL5Hh+xdFmJc8ew$B}9A-61DxwdU9A*`6 zgFz~+$NTIdOd0jY$F1yLc`oazmxnYTqSK0-VA^!2#I@m(0d)Ll{PYRjHzN`~{Y%DK z6I=OXBkTd*pU3x5&^%()Hq!FM+Zc?4mZ;DCn7xK*!olhmtKGz>M=j#nJUDoh4L3r! zJwpMPY%CK zwh>AA2%0AG^a4{I#LZ5)fx>X!g+ufnM8Rw*F0ja?vS{8sq%Y2(lDKd38BJx;9G+up znphA28#GXgN6gkN)Wwf4a!L=yJ!`!DZ}LeRXIt72m%dSBxNzB|%2FyG>x0}QQ z#a1X247kfD3211m?ilNab|8g3gy_MTy1T(? z*4wf7p{&eD>_0j7aF&6W0{!gY#-Rx#T*{6mPhXN z13z3Ms%J@@j}BU-!6Ip7EHYpZK&t`kzkg0;%NPZ}s?>84{~CtsnjK&+PwtQv+8# z16$VUZNBWIS+}VRMAPcK(PoeoxR*hS9#`HScn@4FRlPzbv*RBv<~5~>F8b~JiHbOq z63<(Pd`U=8k2rVIFDC8HEksgEtF, 2013. +msgid "" +msgstr "" +"Project-Id-Version: bash-4.3-pre2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-02-11 11:19-0500\n" +"PO-Revision-Date: 2013-11-15 10:37+0200\n" +"Last-Translator: Lefteris Dimitroulakis \n" +"Language-Team: Greek \n" +"Language: el\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 1.5\n" + +#: arrayfunc.c:51 +msgid "bad array subscript" +msgstr "" + +#: arrayfunc.c:356 builtins/declare.def:566 +#, c-format +msgid "%s: cannot convert indexed to associative array" +msgstr "" + +#: arrayfunc.c:539 +#, c-format +msgid "%s: invalid associative array key" +msgstr "" + +#: arrayfunc.c:541 +#, c-format +msgid "%s: cannot assign to non-numeric index" +msgstr "" + +#: arrayfunc.c:586 +#, c-format +msgid "%s: %s: must use subscript when assigning associative array" +msgstr "" + +#: bashhist.c:388 +#, c-format +msgid "%s: cannot create: %s" +msgstr "%s: αδυναμία δημιουργίας: %s" + +#: bashline.c:3982 +msgid "bash_execute_unix_command: cannot find keymap for command" +msgstr "bash_execute_unix_command: δεν μπορώ να βρω keymap για εντολή" + +#: bashline.c:4069 +#, c-format +msgid "%s: first non-whitespace character is not `\"'" +msgstr "%s: ο πρώτος μη-λευκό διάστημα χαρακτήρας δεν είναι «\"»" + +#: bashline.c:4098 +#, c-format +msgid "no closing `%c' in %s" +msgstr "" + +#: bashline.c:4132 +#, c-format +msgid "%s: missing colon separator" +msgstr "" + +#: braces.c:321 +#, c-format +msgid "brace expansion: cannot allocate memory for %s" +msgstr "" + +#: braces.c:413 +#, c-format +msgid "brace expansion: failed to allocate memory for %d elements" +msgstr "" + +#: braces.c:452 +#, c-format +msgid "brace expansion: failed to allocate memory for `%s'" +msgstr "" + +#: builtins/alias.def:132 +#, c-format +msgid "`%s': invalid alias name" +msgstr "«%s»: μη έγκυρο ψευδώνημο" + +#: builtins/bind.def:123 builtins/bind.def:126 +msgid "line editing not enabled" +msgstr "μη ενεργοποιημένο line editing" + +#: builtins/bind.def:212 +#, c-format +msgid "`%s': invalid keymap name" +msgstr "«%s»: μη έγκυρο όνομα keymap" + +#: builtins/bind.def:251 +#, c-format +msgid "%s: cannot read: %s" +msgstr "%s: αδυναμία ανάγνωσης: %s" + +#: builtins/bind.def:266 +#, c-format +msgid "`%s': cannot unbind" +msgstr "«%s»: αδυναμία αποσύνδεσης" + +#: builtins/bind.def:304 builtins/bind.def:334 +#, c-format +msgid "`%s': unknown function name" +msgstr "«%s»: άγνωστο όνομα συνάρτησης" + +#: builtins/bind.def:312 +#, c-format +msgid "%s is not bound to any keys.\n" +msgstr "%s δεν έχει συνδεθεί με κανένα πλήκτρο.\n" + +#: builtins/bind.def:316 +#, c-format +msgid "%s can be invoked via " +msgstr "%s μπορεί να κληθεί μέσω " + +#: builtins/break.def:77 builtins/break.def:117 +msgid "loop count" +msgstr "αριθμός βρόχων" + +#: builtins/break.def:137 +msgid "only meaningful in a `for', `while', or `until' loop" +msgstr "έχει μόνο νόημα σε ένα βρόχο «for», «while», ή «until»" + +#: builtins/caller.def:134 +msgid "" +"Returns the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns " +msgstr "" + +#: builtins/cd.def:319 +msgid "HOME not set" +msgstr "HOME δεν έχει οριστεί" + +#: builtins/cd.def:327 builtins/common.c:166 test.c:876 +msgid "too many arguments" +msgstr "πάρα πολλά ορίσματα" + +#: builtins/cd.def:338 +msgid "OLDPWD not set" +msgstr "OLDPWD δεν έχει οριστεί" + +#: builtins/common.c:101 +#, c-format +msgid "line %d: " +msgstr "γραμμή %d: " + +#: builtins/common.c:139 error.c:265 +#, c-format +msgid "warning: " +msgstr "προειδοποίηση: " + +#: builtins/common.c:153 +#, c-format +msgid "%s: usage: " +msgstr "%s: χρήση: " + +#: builtins/common.c:191 shell.c:506 shell.c:788 +#, c-format +msgid "%s: option requires an argument" +msgstr "%s: η επιλογή απαιτεί όρισμα" + +#: builtins/common.c:198 +#, c-format +msgid "%s: numeric argument required" +msgstr "%s: απαιτείται αριθμητικό όρισμα" + +#: builtins/common.c:205 +#, c-format +msgid "%s: not found" +msgstr "%s: δεν βρέθηκε" + +#: builtins/common.c:214 shell.c:801 +#, c-format +msgid "%s: invalid option" +msgstr "%s: μη έγκυρη επιλογή" + +#: builtins/common.c:221 +#, c-format +msgid "%s: invalid option name" +msgstr "%s: μη έγκυρο όνομα επιλογής" + +#: builtins/common.c:228 general.c:235 general.c:240 +#, c-format +msgid "`%s': not a valid identifier" +msgstr "" + +#: builtins/common.c:238 +msgid "invalid octal number" +msgstr "μη έγκυρος οκταδικός αριθμός" + +#: builtins/common.c:240 +msgid "invalid hex number" +msgstr "μη έγκυρος εξαδικός αριθμός" + +#: builtins/common.c:242 expr.c:1470 +msgid "invalid number" +msgstr "μη έγκυρος αριθμός" + +#: builtins/common.c:250 +#, c-format +msgid "%s: invalid signal specification" +msgstr "%s: μη έγκυρη προδιαγραφή σήματος" + +#: builtins/common.c:257 +#, c-format +msgid "`%s': not a pid or valid job spec" +msgstr "«%s»: όχι pid ή έγκυρο job spec" + +#: builtins/common.c:264 error.c:488 +#, c-format +msgid "%s: readonly variable" +msgstr "%s: μεταβλητή μόνο για ανάγνωση" + +#: builtins/common.c:272 +#, c-format +msgid "%s: %s out of range" +msgstr "%s: %s εκτός ορίων" + +#: builtins/common.c:272 builtins/common.c:274 +msgid "argument" +msgstr "όρισμα" + +#: builtins/common.c:274 +#, c-format +msgid "%s out of range" +msgstr "%s εκτός ορίων" + +#: builtins/common.c:282 +#, c-format +msgid "%s: no such job" +msgstr "%s: δεν υπάρχει τέτοια εργασία" + +#: builtins/common.c:290 +#, c-format +msgid "%s: no job control" +msgstr "" + +#: builtins/common.c:292 +msgid "no job control" +msgstr "" + +#: builtins/common.c:302 +#, c-format +msgid "%s: restricted" +msgstr "" + +#: builtins/common.c:304 +msgid "restricted" +msgstr "" + +#: builtins/common.c:312 +#, c-format +msgid "%s: not a shell builtin" +msgstr "" + +#: builtins/common.c:321 +#, c-format +msgid "write error: %s" +msgstr "σφάλμα εγγραφής: %s" + +#: builtins/common.c:329 +#, c-format +msgid "error setting terminal attributes: %s" +msgstr "" + +#: builtins/common.c:331 +#, c-format +msgid "error getting terminal attributes: %s" +msgstr "" + +#: builtins/common.c:563 +#, c-format +msgid "%s: error retrieving current directory: %s: %s\n" +msgstr "" + +#: builtins/common.c:629 builtins/common.c:631 +#, c-format +msgid "%s: ambiguous job spec" +msgstr "%s: ασαφείς προδιαγραφές εργασίας" + +#: builtins/complete.def:277 +#, c-format +msgid "%s: invalid action name" +msgstr "%s: μη έγκυρο όνομα ενέργειας" + +#: builtins/complete.def:450 builtins/complete.def:645 +#: builtins/complete.def:855 +#, c-format +msgid "%s: no completion specification" +msgstr "%s: δεν υπάρχει προδιαγραφή συμπλήρωσης" + +#: builtins/complete.def:697 +msgid "warning: -F option may not work as you expect" +msgstr "προειδοποίηση: η επιλογή -F μπορεί να μη δουλέψει όπως περιμένεις" + +#: builtins/complete.def:699 +msgid "warning: -C option may not work as you expect" +msgstr "προειδοποίηση: η επιλογή -C ίσως δεν δουλέψει όπως αναμένετε" + +#: builtins/complete.def:828 +msgid "not currently executing completion function" +msgstr "" + +#: builtins/declare.def:126 +msgid "can only be used in a function" +msgstr "μπορεί να χρησιμοποιηθεί μόνο μέσα σε συνάρτηση" + +#: builtins/declare.def:315 builtins/declare.def:509 +#, c-format +msgid "%s: reference variable cannot be an array" +msgstr "" + +#: builtins/declare.def:324 +#, c-format +msgid "%s: nameref variable self references not allowed" +msgstr "" + +#: builtins/declare.def:398 +msgid "cannot use `-f' to make functions" +msgstr "" +"η επιλογή «-f» δεν μπορεί να χρησιμοποιηθεί για τη δημιουργία συναρτήσεων" + +#: builtins/declare.def:410 execute_cmd.c:5361 +#, c-format +msgid "%s: readonly function" +msgstr "%s: συνάρτηση μόνο για ανάγνωση" + +#: builtins/declare.def:553 +#, c-format +msgid "%s: cannot destroy array variables in this way" +msgstr "" + +#: builtins/declare.def:560 builtins/read.def:733 +#, c-format +msgid "%s: cannot convert associative to indexed array" +msgstr "" + +#: builtins/enable.def:137 builtins/enable.def:145 +msgid "dynamic loading not available" +msgstr "δυναμική φόρτωση μη διαθέσημη" + +#: builtins/enable.def:312 +#, c-format +msgid "cannot open shared object %s: %s" +msgstr "αδυναμία ανοίγματος κοινόχρηστου αντικειμένου %s: %s" + +#: builtins/enable.def:335 +#, c-format +msgid "cannot find %s in shared object %s: %s" +msgstr "αδυναμία εύρεσης %s στο κοινόχρηστο αντικείμενο %s: %s" + +#: builtins/enable.def:459 +#, c-format +msgid "%s: not dynamically loaded" +msgstr "%s: δεν φορτώθηκε δυναμικά" + +#: builtins/enable.def:474 +#, c-format +msgid "%s: cannot delete: %s" +msgstr "%s: αδυναμία διαγραφής: %s" + +#: builtins/evalfile.c:140 builtins/hash.def:171 execute_cmd.c:5208 +#: shell.c:1481 +#, c-format +msgid "%s: is a directory" +msgstr "%s: είναι κατάλογος" + +#: builtins/evalfile.c:146 +#, c-format +msgid "%s: not a regular file" +msgstr "%s: όχι κανονικό αρχείο" + +#: builtins/evalfile.c:155 +#, c-format +msgid "%s: file is too large" +msgstr "%s: αρχείο πολύ μεγάλο" + +#: builtins/evalfile.c:190 builtins/evalfile.c:208 shell.c:1491 +#, c-format +msgid "%s: cannot execute binary file" +msgstr "%s: αδυναμία εκτέλεσης δυαδικού αρχείου" + +#: builtins/exec.def:154 builtins/exec.def:156 builtins/exec.def:228 +#, c-format +msgid "%s: cannot execute: %s" +msgstr "%s: αδυναμία εκτέλεσης: %s" + +#: builtins/exit.def:65 +#, c-format +msgid "logout\n" +msgstr "logout\n" + +#: builtins/exit.def:88 +msgid "not login shell: use `exit'" +msgstr "όχι login shell: χρησιμοποίησε «exit»" + +#: builtins/exit.def:120 +#, c-format +msgid "There are stopped jobs.\n" +msgstr "Υπάρχουν σταματημένες εργασίες.\n" + +#: builtins/exit.def:122 +#, c-format +msgid "There are running jobs.\n" +msgstr "Υπάρχουν εργασίες που τρέχουν.\n" + +#: builtins/fc.def:262 +msgid "no command found" +msgstr "δεν βρέθηκε εντολή" + +#: builtins/fc.def:320 builtins/fc.def:369 +msgid "history specification" +msgstr "history specification" + +#: builtins/fc.def:390 +#, c-format +msgid "%s: cannot open temp file: %s" +msgstr "%s: αδυναμία ανοίγματος προσωρινού αρχείου: %s" + +#: builtins/fg_bg.def:149 builtins/jobs.def:282 +msgid "current" +msgstr "τρέχων" + +#: builtins/fg_bg.def:158 +#, c-format +msgid "job %d started without job control" +msgstr "" + +#: builtins/getopt.c:110 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: μη επιτρεπόμενη επιλογή -- %c\n" + +#: builtins/getopt.c:111 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: η επιλογή απαιτεί ένα όρισμα -- %c\n" + +#: builtins/hash.def:92 +msgid "hashing disabled" +msgstr "" + +#: builtins/hash.def:138 +#, c-format +msgid "%s: hash table empty\n" +msgstr "" + +#: builtins/hash.def:245 +#, c-format +msgid "hits\tcommand\n" +msgstr "hits\tcommand\n" + +#: builtins/help.def:130 +#, c-format +msgid "Shell commands matching keyword `" +msgid_plural "Shell commands matching keywords `" +msgstr[0] "Εντολές κελύφους που ταιριάζουν στη λέξη-κλειδί `" +msgstr[1] "Εντολές κελύφους που ταιριάζουν στις λέξεις-κλειδί" + +#: builtins/help.def:182 +#, c-format +msgid "" +"no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." +msgstr "" +"ουδεμία βοήθεια ταιριάζει με «%s». Δοκιμάστε «help help» ή «man -k %s» ή " +"«info %s»." + +#: builtins/help.def:199 +#, c-format +msgid "%s: cannot open: %s" +msgstr "%s: αδυναμία ανοίγματος: %s" + +#: builtins/help.def:485 +#, c-format +msgid "" +"These shell commands are defined internally. Type `help' to see this list.\n" +"Type `help name' to find out more about the function `name'.\n" +"Use `info bash' to find out more about the shell in general.\n" +"Use `man -k' or `info' to find out more about commands not in this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" +msgstr "" + +#: builtins/history.def:154 +msgid "cannot use more than one of -anrw" +msgstr "δεν μπορώ να χρησιμοποιήσω περισσότερες της μιας από τις -anrw" + +#: builtins/history.def:186 +msgid "history position" +msgstr "θέση στο ιστορικό" + +#: builtins/history.def:366 +#, c-format +msgid "%s: history expansion failed" +msgstr "" + +#: builtins/inlib.def:71 +#, c-format +msgid "%s: inlib failed" +msgstr "%s: αποτυχία inlib" + +#: builtins/jobs.def:109 +msgid "no other options allowed with `-x'" +msgstr "δεν επιτρέπονται άλλες επιλογές με την «-x»" + +#: builtins/kill.def:200 +#, c-format +msgid "%s: arguments must be process or job IDs" +msgstr "%s: ορίσματα πρέπει να είναι ID διεργασιών ή εργασιών" + +#: builtins/kill.def:263 +msgid "Unknown error" +msgstr "Άγνωστο σφάλμα" + +#: builtins/let.def:95 builtins/let.def:120 expr.c:583 expr.c:598 +msgid "expression expected" +msgstr "αναμενόταν έκφραση" + +#: builtins/mapfile.def:172 +#, c-format +msgid "%s: not an indexed array" +msgstr "%s: μη δικτοδοτημένος πίνακας" + +#: builtins/mapfile.def:259 builtins/read.def:302 +#, c-format +msgid "%s: invalid file descriptor specification" +msgstr "%s: μη έγκυρη προδιαγραφή περιγραφέα αρχείου" + +#: builtins/mapfile.def:267 builtins/read.def:309 +#, c-format +msgid "%d: invalid file descriptor: %s" +msgstr "%d: μη έγκυρος περιγραφέας αρχείου: %s" + +#: builtins/mapfile.def:276 builtins/mapfile.def:314 +#, c-format +msgid "%s: invalid line count" +msgstr "%s: μη έγκυρος αριθμός γραμμής" + +#: builtins/mapfile.def:287 +#, c-format +msgid "%s: invalid array origin" +msgstr "" + +#: builtins/mapfile.def:304 +#, c-format +msgid "%s: invalid callback quantum" +msgstr "" + +#: builtins/mapfile.def:336 +msgid "empty array variable name" +msgstr "" + +#: builtins/mapfile.def:357 +msgid "array variable support required" +msgstr "απαιτείται υποστήριξη μεταβλητής πίνακος" + +#: builtins/printf.def:402 +#, c-format +msgid "`%s': missing format character" +msgstr "«%s»: απουσία χαρακτήρα φορμαρίσματος " + +#: builtins/printf.def:456 +#, c-format +msgid "`%c': invalid time format specification" +msgstr "«%c»: μη έγκυρη προδιαγραφή για φορμά χρόνου" + +#: builtins/printf.def:658 +#, c-format +msgid "`%c': invalid format character" +msgstr "«%c»: μη έγκυρος χαρακτήρας φορμαρίσματος" + +#: builtins/printf.def:684 +#, c-format +msgid "warning: %s: %s" +msgstr "προειδοποίηση: %s: %s" + +#: builtins/printf.def:768 +#, c-format +msgid "format parsing problem: %s" +msgstr "" + +#: builtins/printf.def:865 +msgid "missing hex digit for \\x" +msgstr "απουσία hex ψηφίου για \\x" + +#: builtins/printf.def:880 +#, c-format +msgid "missing unicode digit for \\%c" +msgstr "απουσία ψηφίου unicode για \\%c" + +#: builtins/pushd.def:195 +msgid "no other directory" +msgstr "όχι άλλος κατάλογος" + +#: builtins/pushd.def:354 +#, c-format +msgid "%s: invalid argument" +msgstr "%s: μη έγκυρο όρισμα" + +#: builtins/pushd.def:468 +msgid "" +msgstr "<όχι τρέχων κατάλογος>" + +#: builtins/pushd.def:512 +msgid "directory stack empty" +msgstr "κενή στίβα καταλόγου" + +#: builtins/pushd.def:514 +msgid "directory stack index" +msgstr "δείκτης στοίβας καταλόγου" + +#: builtins/pushd.def:689 +msgid "" +"Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +"\tdirs when invoked without options, starting with zero." +msgstr "" + +#: builtins/pushd.def:711 +msgid "" +"Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" + +#: builtins/pushd.def:736 +msgid "" +"Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" + +#: builtins/read.def:275 +#, c-format +msgid "%s: invalid timeout specification" +msgstr "" + +#: builtins/read.def:678 +#, c-format +msgid "read error: %d: %s" +msgstr "σφάλμα ανάγνωσης: %d: %s" + +#: builtins/return.def:75 +msgid "can only `return' from a function or sourced script" +msgstr "" + +#: builtins/set.def:782 +msgid "cannot simultaneously unset a function and a variable" +msgstr "«unset» δεν μπορεί να εφαρμοστεί συγχρόνως σε συνάρτηση και μεταβλητή" + +#: builtins/set.def:826 +#, c-format +msgid "%s: cannot unset" +msgstr "%s: αδυναμία «unset»" + +#: builtins/set.def:843 +#, c-format +msgid "%s: cannot unset: readonly %s" +msgstr "%s: αδυναμία unset: %s μόνο για ανάγνωση" + +#: builtins/set.def:854 +#, c-format +msgid "%s: not an array variable" +msgstr "%s: δεν είναι μεταβλητή πίνακα" + +#: builtins/setattr.def:187 +#, c-format +msgid "%s: not a function" +msgstr "%s: δεν είναι συνάρτηση" + +#: builtins/shift.def:71 builtins/shift.def:77 +msgid "shift count" +msgstr "" + +#: builtins/shopt.def:279 +msgid "cannot set and unset shell options simultaneously" +msgstr "" +"οι επιλογές κελύφους δεν είναι δυνατόν συγχρόνως να ενεργοποιηθούν και " +"απενεργοποιηθούν" + +#: builtins/shopt.def:346 +#, c-format +msgid "%s: invalid shell option name" +msgstr "%s: μη έγκυρο όνομα επιλογής" + +#: builtins/source.def:130 +msgid "filename argument required" +msgstr "απαιτείται όνομα αρχείου για όρισμα" + +#: builtins/source.def:155 +#, c-format +msgid "%s: file not found" +msgstr "%s: αρχείο δεν βρέθηκε" + +#: builtins/suspend.def:101 +msgid "cannot suspend" +msgstr "" + +#: builtins/suspend.def:111 +msgid "cannot suspend a login shell" +msgstr "" + +#: builtins/type.def:234 +#, c-format +msgid "%s is aliased to `%s'\n" +msgstr "%s είναι ψευδώνημο του «%s»\n" + +#: builtins/type.def:255 +#, c-format +msgid "%s is a shell keyword\n" +msgstr "%s αποτελεί δεσμευμένη λέξη του κελύφους\n" + +#: builtins/type.def:274 +#, c-format +msgid "%s is a function\n" +msgstr "%s είναι συνάρτηση\n" + +#: builtins/type.def:296 +#, c-format +msgid "%s is a shell builtin\n" +msgstr "" + +#: builtins/type.def:317 builtins/type.def:393 +#, c-format +msgid "%s is %s\n" +msgstr "%s είναι %s\n" + +#: builtins/type.def:337 +#, c-format +msgid "%s is hashed (%s)\n" +msgstr "" + +#: builtins/ulimit.def:383 +#, c-format +msgid "%s: invalid limit argument" +msgstr "%s: μη έγκυρο όρισμα ορίου" + +#: builtins/ulimit.def:409 +#, c-format +msgid "`%c': bad command" +msgstr "«%c»: λάθος διαταγή" + +#: builtins/ulimit.def:438 +#, c-format +msgid "%s: cannot get limit: %s" +msgstr "" + +#: builtins/ulimit.def:464 +msgid "limit" +msgstr "όριο" + +#: builtins/ulimit.def:476 builtins/ulimit.def:776 +#, c-format +msgid "%s: cannot modify limit: %s" +msgstr "%s: αδυναμία μεταβολής ορίου: %s" + +#: builtins/umask.def:114 +msgid "octal number" +msgstr "οκταδικός αριθμός" + +#: builtins/umask.def:227 +#, c-format +msgid "`%c': invalid symbolic mode operator" +msgstr "" + +#: builtins/umask.def:282 +#, c-format +msgid "`%c': invalid symbolic mode character" +msgstr "" + +#: error.c:90 error.c:325 error.c:327 error.c:329 +msgid " line " +msgstr " γραμμή " + +#: error.c:165 +#, c-format +msgid "last command: %s\n" +msgstr "τελευταία εντολή: %s\n" + +#: error.c:173 +#, c-format +msgid "Aborting..." +msgstr "" + +#: error.c:440 +msgid "unknown command error" +msgstr "άγνωστο σφάλμα εντολής" + +#: error.c:441 +msgid "bad command type" +msgstr "" + +#: error.c:442 +msgid "bad connector" +msgstr "" + +#: error.c:443 +msgid "bad jump" +msgstr "" + +#: error.c:481 +#, c-format +msgid "%s: unbound variable" +msgstr "" + +#: eval.c:189 +#, c-format +msgid "\atimed out waiting for input: auto-logout\n" +msgstr "\aη αναμονή για δεδομένα έληξε: αυτόματη αποσύνδεση\n" + +#: execute_cmd.c:512 +#, c-format +msgid "cannot redirect standard input from /dev/null: %s" +msgstr "αδυναμία ανακατεύθυνσης τυπικής εισόδου από /dev/null: %s" + +#: execute_cmd.c:1233 +#, c-format +msgid "TIMEFORMAT: `%c': invalid format character" +msgstr "TIMEFORMAT: «%c»: μη έγκυρος χαρακτήρας μορφοποίησης" + +#: execute_cmd.c:2287 +msgid "pipe error" +msgstr "pipe error" + +#: execute_cmd.c:4386 +#, c-format +msgid "%s: maximum function nesting level exceeded (%d)" +msgstr "" + +#: execute_cmd.c:4884 +#, c-format +msgid "%s: restricted: cannot specify `/' in command names" +msgstr "%s: περιορισμός: δεν μπορεί να περιέχεται «/» σε όνομα εντολής" + +#: execute_cmd.c:4973 +#, c-format +msgid "%s: command not found" +msgstr "%s: εντολή δεν βρέθηκε" + +#: execute_cmd.c:5206 +#, c-format +msgid "%s: %s" +msgstr "%s: %s" + +#: execute_cmd.c:5243 +#, c-format +msgid "%s: %s: bad interpreter" +msgstr "" + +#: execute_cmd.c:5280 +#, c-format +msgid "%s: cannot execute binary file: %s" +msgstr "%s: αδυναμία εκτέλεσης δυαδικού αρχείου: %s" + +#: execute_cmd.c:5352 +#, c-format +msgid "`%s': is a special builtin" +msgstr "«%s»: είναι ειδικό builtin" + +#: execute_cmd.c:5404 +#, c-format +msgid "cannot duplicate fd %d to fd %d" +msgstr "αδυναμία αντιγραφής του fd %d στον fd %d" + +#: expr.c:259 +msgid "expression recursion level exceeded" +msgstr "" + +#: expr.c:283 +msgid "recursion stack underflow" +msgstr "" + +#: expr.c:431 +msgid "syntax error in expression" +msgstr "συντακτικό σφάλμα στην έκφραση" + +#: expr.c:475 +msgid "attempted assignment to non-variable" +msgstr "απόπειρα ανάθεσης σε μη-μεταβλητή" + +#: expr.c:495 expr.c:858 +msgid "division by 0" +msgstr "διαίρεση διά 0" + +#: expr.c:542 +msgid "bug: bad expassign token" +msgstr "" + +#: expr.c:595 +msgid "`:' expected for conditional expression" +msgstr "" + +#: expr.c:919 +msgid "exponent less than 0" +msgstr "εκθέτης μικρότερος του 0" + +#: expr.c:976 +msgid "identifier expected after pre-increment or pre-decrement" +msgstr "" + +#: expr.c:1002 +msgid "missing `)'" +msgstr "λείπει «)»" + +#: expr.c:1053 expr.c:1390 +msgid "syntax error: operand expected" +msgstr "syntax error: αναμενόταν τελεστέος" + +#: expr.c:1392 +msgid "syntax error: invalid arithmetic operator" +msgstr "syntax error: μη έγκυρος αριθμητικός τελεστής" + +#: expr.c:1416 +#, c-format +msgid "%s%s%s: %s (error token is \"%s\")" +msgstr "%s%s%s: %s (το λανθασμένο σύμβολο είναι \"%s\")" + +#: expr.c:1474 +msgid "invalid arithmetic base" +msgstr "μη έγκυρη αριθμητική βάση" + +#: expr.c:1494 +msgid "value too great for base" +msgstr "τιμή πολύ μεγάλη για βάση" + +#: expr.c:1543 +#, c-format +msgid "%s: expression error\n" +msgstr "%s: σφάλμα έκφρασης\n" + +#: general.c:62 +msgid "getcwd: cannot access parent directories" +msgstr "getcwd: αδυναμία πρόσβασης στο γονικό κατάλογο" + +#: input.c:102 subst.c:5168 +#, c-format +msgid "cannot reset nodelay mode for fd %d" +msgstr "αδυναμία επανάταξης nodelay mode για fd %d" + +#: input.c:271 +#, c-format +msgid "cannot allocate new file descriptor for bash input from fd %d" +msgstr "" +"αδυναμία εκχώρησης νέου περιγραφέα αρχείου για είσοδο του bash από fd %d" + +#: input.c:279 +#, c-format +msgid "save_bash_input: buffer already exists for new fd %d" +msgstr "" + +#: jobs.c:471 +msgid "start_pipeline: pgrp pipe" +msgstr "start_pipeline: pgrp pipe" + +#: jobs.c:893 +#, c-format +msgid "forked pid %d appears in running job %d" +msgstr "" + +#: jobs.c:1012 +#, c-format +msgid "deleting stopped job %d with process group %ld" +msgstr "" + +#: jobs.c:1117 +#, c-format +msgid "add_process: process %5ld (%s) in the_pipeline" +msgstr "" + +#: jobs.c:1120 +#, c-format +msgid "add_process: pid %5ld (%s) marked as still alive" +msgstr "" + +#: jobs.c:1435 +#, c-format +msgid "describe_pid: %ld: no such pid" +msgstr "describe_pid: %ld: δεν υπάρχει τέτοιο pid" + +#: jobs.c:1450 +#, c-format +msgid "Signal %d" +msgstr "Σήμα %d" + +#: jobs.c:1464 jobs.c:1489 +msgid "Done" +msgstr "Done" + +#: jobs.c:1469 siglist.c:123 +msgid "Stopped" +msgstr "σταματημένο" + +#: jobs.c:1473 +#, c-format +msgid "Stopped(%s)" +msgstr "σταματημένο(%s)" + +#: jobs.c:1477 +msgid "Running" +msgstr "" + +#: jobs.c:1491 +#, c-format +msgid "Done(%d)" +msgstr "Done(%d)" + +#: jobs.c:1493 +#, c-format +msgid "Exit %d" +msgstr "Έξοδος %d" + +#: jobs.c:1496 +msgid "Unknown status" +msgstr "Άγνωστη κατάσταση" + +#: jobs.c:1583 +#, c-format +msgid "(core dumped) " +msgstr "(core dumped) " + +#: jobs.c:1602 +#, c-format +msgid " (wd: %s)" +msgstr " (wd: %s)" + +#: jobs.c:1819 +#, c-format +msgid "child setpgid (%ld to %ld)" +msgstr "child setpgid (%ld to %ld)" + +#: jobs.c:2138 nojobs.c:605 +#, c-format +msgid "wait: pid %ld is not a child of this shell" +msgstr "wait: διεργασία %ld δεν αποτελεί θυγατρική αυτού του κελύφους" + +#: jobs.c:2385 +#, c-format +msgid "wait_for: No record of process %ld" +msgstr "wait_for: Δεν υπάρχουν στοιχεία για διεργασία %ld" + +#: jobs.c:2694 +#, c-format +msgid "wait_for_job: job %d is stopped" +msgstr "wait_for_job: η εργασία %d είναι σταματημένη" + +#: jobs.c:2986 +#, c-format +msgid "%s: job has terminated" +msgstr "%s: η εργασία τερματίστηκε" + +#: jobs.c:2995 +#, c-format +msgid "%s: job %d already in background" +msgstr "%s: εργασία %d ήδη στο παρασκήνιο" + +#: jobs.c:3220 +msgid "waitchld: turning on WNOHANG to avoid indefinite block" +msgstr "" + +#: jobs.c:3711 +#, c-format +msgid "%s: line %d: " +msgstr "%s: γραμμή %d: " + +#: jobs.c:3725 nojobs.c:843 +#, c-format +msgid " (core dumped)" +msgstr " (core dumped)" + +#: jobs.c:3737 jobs.c:3750 +#, c-format +msgid "(wd now: %s)\n" +msgstr "(τώρα wd: %s)\n" + +#: jobs.c:3782 +msgid "initialize_job_control: getpgrp failed" +msgstr "initialize_job_control: αποτυχία getpgrp" + +#: jobs.c:3843 +msgid "initialize_job_control: line discipline" +msgstr "" + +#: jobs.c:3853 +msgid "initialize_job_control: setpgid" +msgstr "initialize_job_control: setpgid" + +#: jobs.c:3874 jobs.c:3883 +#, c-format +msgid "cannot set terminal process group (%d)" +msgstr "" + +#: jobs.c:3888 +msgid "no job control in this shell" +msgstr "δεν υπάρχει job control σ'αυτό το κέλυφος" + +#: lib/malloc/malloc.c:296 +#, c-format +msgid "malloc: failed assertion: %s\n" +msgstr "" + +#: lib/malloc/malloc.c:312 +#, c-format +msgid "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" +msgstr "" + +#: lib/malloc/malloc.c:313 +msgid "unknown" +msgstr "άγνωστο" + +#: lib/malloc/malloc.c:801 +msgid "malloc: block on free list clobbered" +msgstr "" + +#: lib/malloc/malloc.c:878 +msgid "free: called with already freed block argument" +msgstr "" + +#: lib/malloc/malloc.c:881 +msgid "free: called with unallocated block argument" +msgstr "" + +#: lib/malloc/malloc.c:900 +msgid "free: underflow detected; mh_nbytes out of range" +msgstr "" + +#: lib/malloc/malloc.c:906 +msgid "free: start and end chunk sizes differ" +msgstr "" + +#: lib/malloc/malloc.c:1005 +msgid "realloc: called with unallocated block argument" +msgstr "" + +#: lib/malloc/malloc.c:1020 +msgid "realloc: underflow detected; mh_nbytes out of range" +msgstr "" + +#: lib/malloc/malloc.c:1026 +msgid "realloc: start and end chunk sizes differ" +msgstr "" + +#: lib/malloc/table.c:194 +#, c-format +msgid "register_alloc: alloc table is full with FIND_ALLOC?\n" +msgstr "" + +#: lib/malloc/table.c:203 +#, c-format +msgid "register_alloc: %p already in table as allocated?\n" +msgstr "" + +#: lib/malloc/table.c:256 +#, c-format +msgid "register_free: %p already in table as free?\n" +msgstr "register_free: %p ήδη στον πίνακα ως ελεύθερος;\n" + +#: lib/sh/fmtulong.c:102 +msgid "invalid base" +msgstr "μη έγκυρη βάση" + +#: lib/sh/netopen.c:168 +#, c-format +msgid "%s: host unknown" +msgstr "%s: άγνωστος host" + +#: lib/sh/netopen.c:175 +#, c-format +msgid "%s: invalid service" +msgstr "%s: μη έγκυρη υπηρεσία" + +#: lib/sh/netopen.c:306 +#, c-format +msgid "%s: bad network path specification" +msgstr "" + +#: lib/sh/netopen.c:346 +msgid "network operations not supported" +msgstr "μη υποστηριζόμενες δικτιακές υπηρεσίες" + +#: locale.c:200 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s)" +msgstr "setlocale: LC_ALL: αδυναμία μεταβολής locale (%s)" + +#: locale.c:202 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s): %s" +msgstr "setlocale: LC_ALL: αδυναμία μεταβολής locale (%s): %s" + +#: locale.c:259 +#, c-format +msgid "setlocale: %s: cannot change locale (%s)" +msgstr "setlocale: %s: αδυναμία μεταβολής locale (%s)" + +#: locale.c:261 +#, c-format +msgid "setlocale: %s: cannot change locale (%s): %s" +msgstr "setlocale: %s: αδυναμία μεταβολής locale (%s): %s" + +#: mailcheck.c:439 +msgid "You have mail in $_" +msgstr "Έχεις μήνυμα στο $_" + +#: mailcheck.c:464 +msgid "You have new mail in $_" +msgstr "Έχεις νέο μήνυμα στο $_" + +#: mailcheck.c:480 +#, c-format +msgid "The mail in %s has been read\n" +msgstr "Το μήνυμα στο %s διαβάστηκε\n" + +#: make_cmd.c:323 +msgid "syntax error: arithmetic expression required" +msgstr "syntax error: απαιτείται αριθμητική έκφραση" + +#: make_cmd.c:325 +msgid "syntax error: `;' unexpected" +msgstr "συντακτικό σφάλμα: δεν αναμενόταν «;»" + +#: make_cmd.c:326 +#, c-format +msgid "syntax error: `((%s))'" +msgstr "συντακτικό σφάλμα: «((%s))»" + +#: make_cmd.c:578 +#, c-format +msgid "make_here_document: bad instruction type %d" +msgstr "" + +#: make_cmd.c:662 +#, c-format +msgid "here-document at line %d delimited by end-of-file (wanted `%s')" +msgstr "" + +#: make_cmd.c:759 +#, c-format +msgid "make_redirection: redirection instruction `%d' out of range" +msgstr "make_redirection: η οδηγία της ανακατεύθυνσης «%d» εκτός ορίων" + +#: parse.y:3278 parse.y:3561 +#, c-format +msgid "unexpected EOF while looking for matching `%c'" +msgstr "μη αναμενόμενο EOF κατά την αναζήτηση «%c»" + +#: parse.y:4170 +msgid "unexpected EOF while looking for `]]'" +msgstr "μη αναμενόμενο EOF ενώ έψαχνα για «]]»" + +#: parse.y:4175 +#, fuzzy, c-format +msgid "syntax error in conditional expression: unexpected token `%s'" +msgstr "syntax error in conditional expression: μη αναμενόμενο σύμβολο «%s»" + +#: parse.y:4179 +msgid "syntax error in conditional expression" +msgstr "" + +#: parse.y:4257 +#, c-format +msgid "unexpected token `%s', expected `)'" +msgstr "μη αναμενόμενο σύμβολο «%s», αναμενόταν «)»" + +#: parse.y:4261 +msgid "expected `)'" +msgstr "αναμενόταν «)»" + +#: parse.y:4289 +#, c-format +msgid "unexpected argument `%s' to conditional unary operator" +msgstr "" + +#: parse.y:4293 +msgid "unexpected argument to conditional unary operator" +msgstr "" + +#: parse.y:4339 +#, c-format +msgid "unexpected token `%s', conditional binary operator expected" +msgstr "" + +#: parse.y:4343 +msgid "conditional binary operator expected" +msgstr "" + +#: parse.y:4365 +#, c-format +msgid "unexpected argument `%s' to conditional binary operator" +msgstr "" + +#: parse.y:4369 +msgid "unexpected argument to conditional binary operator" +msgstr "" + +#: parse.y:4380 +#, c-format +msgid "unexpected token `%c' in conditional command" +msgstr "" + +#: parse.y:4383 +#, c-format +msgid "unexpected token `%s' in conditional command" +msgstr "" + +#: parse.y:4387 +#, c-format +msgid "unexpected token %d in conditional command" +msgstr "" + +#: parse.y:5737 +#, c-format +msgid "syntax error near unexpected token `%s'" +msgstr "συντακτικό σφάλμα κοντά στο μη αναμενόμενο σύμβολο «%s»" + +#: parse.y:5755 +#, c-format +msgid "syntax error near `%s'" +msgstr "συντακτικό σφάλμα κοντά σε «%s»" + +#: parse.y:5765 +msgid "syntax error: unexpected end of file" +msgstr "syntax error: μη αναμενόμενο τέλος αρχείου" + +#: parse.y:5765 +msgid "syntax error" +msgstr "συντακτικό σφάλμα" + +#: parse.y:5827 +#, c-format +msgid "Use \"%s\" to leave the shell.\n" +msgstr "Χρήση «%s» για έξοδο από το κέλυφος.\n" + +#: parse.y:5989 +msgid "unexpected EOF while looking for matching `)'" +msgstr "μη αναμενόμενο EOF ενώ έψαχνα «)»" + +#: pcomplete.c:1094 +#, c-format +msgid "completion: function `%s' not found" +msgstr "completion: η συνάρτηση «%s» δεν βρέθηκε" + +#: pcomplib.c:182 +#, c-format +msgid "progcomp_insert: %s: NULL COMPSPEC" +msgstr "progcomp_insert: %s: NULL COMPSPEC" + +#: print_cmd.c:300 +#, c-format +msgid "print_command: bad connector `%d'" +msgstr "" + +#: print_cmd.c:373 +#, c-format +msgid "xtrace_set: %d: invalid file descriptor" +msgstr "xtrace_set: %d: μη έγκυρος περιγραφέας αρχείου" + +#: print_cmd.c:378 +msgid "xtrace_set: NULL file pointer" +msgstr "xtrace_set: NULL file pointer" + +#: print_cmd.c:382 +#, c-format +msgid "xtrace fd (%d) != fileno xtrace fp (%d)" +msgstr "xtrace fd (%d) != fileno xtrace fp (%d)" + +#: print_cmd.c:1518 +#, c-format +msgid "cprintf: `%c': invalid format character" +msgstr "cprintf: «%c»: μη έγκυρη μορφή χαρακτήρα" + +#: redir.c:123 redir.c:170 +msgid "file descriptor out of range" +msgstr "περιγραφέας αρχείου εκτός ορίων" + +#: redir.c:177 +#, c-format +msgid "%s: ambiguous redirect" +msgstr "%s: ασαφής ανακατεύθυνση" + +#: redir.c:181 +#, c-format +msgid "%s: cannot overwrite existing file" +msgstr "%s: αδυναμία εγγραφής πάνω σε υπάρχον αρχείο" + +#: redir.c:186 +#, c-format +msgid "%s: restricted: cannot redirect output" +msgstr "%s: restricted: αδυναμία ανακατεύθυνσης εξόδου" + +#: redir.c:191 +#, c-format +msgid "cannot create temp file for here-document: %s" +msgstr "αδυναμία δημιουργίας προσωρινού αρχείου για here-document: %s" + +#: redir.c:195 +#, c-format +msgid "%s: cannot assign fd to variable" +msgstr "%s: αδυναμία ανάθεσης fd σε μεταβλητή" + +#: redir.c:582 +msgid "/dev/(tcp|udp)/host/port not supported without networking" +msgstr "/dev/(tcp|udp)/host/port δεν υποστηρίζεται χωρίς δικτύωση" + +#: redir.c:861 redir.c:973 redir.c:1034 redir.c:1199 +msgid "redirection error: cannot duplicate fd" +msgstr "" + +#: shell.c:339 +msgid "could not find /tmp, please create!" +msgstr "δεν μπόρεσα να βρω /tmp, παρακαλώ να τον δημιουργήσετε!" + +#: shell.c:343 +msgid "/tmp must be a valid directory name" +msgstr "/tmp πρέπει να είναι ένα έγκυρο όνομα αρχείου" + +#: shell.c:890 +#, c-format +msgid "%c%c: invalid option" +msgstr "%c%c: μη έγκυρη επιλογή" + +#: shell.c:1682 +msgid "I have no name!" +msgstr "Δεν έχω όνομα!" + +#: shell.c:1827 +#, c-format +msgid "GNU bash, version %s-(%s)\n" +msgstr "GNU bash, έκδοση %s-(%s)\n" + +#: shell.c:1828 +#, c-format +msgid "" +"Usage:\t%s [GNU long option] [option] ...\n" +"\t%s [GNU long option] [option] script-file ...\n" +msgstr "" +"Χρήση:\t%s [μακρά επιλογή GNU] [επιλογή] ...\n" +"\t%s [μακρά επιλογή GNU] [επιλοη] script-file ...\n" + +#: shell.c:1830 +msgid "GNU long options:\n" +msgstr "Μακρές επιλογές GNU:\n" + +#: shell.c:1834 +msgid "Shell options:\n" +msgstr "Επιλογές κελύφους:\n" + +#: shell.c:1835 +msgid "\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n" +msgstr "" + +#: shell.c:1850 +#, c-format +msgid "\t-%s or -o option\n" +msgstr "\t-%s ή επιλογή -o\n" + +#: shell.c:1856 +#, c-format +msgid "Type `%s -c \"help set\"' for more information about shell options.\n" +msgstr "" +"Πληκτρολόγησε «%s -c \"help set\"» για πληροφορίες επί των επιλογών " +"κελύφους.\n" + +#: shell.c:1857 +#, c-format +msgid "Type `%s -c help' for more information about shell builtin commands.\n" +msgstr "" +"Πληκτρολόγησε «%s -c help» για περισσότερες πληροφορίες σχετικά με τις " +"ενσωματομένες στο κέλυφος εντολές.\n" + +#: shell.c:1858 +#, c-format +msgid "Use the `bashbug' command to report bugs.\n" +msgstr "Χρησιμοποίησε την εντολή «bashbug» για αναφορά σφαλμάτων.\n" + +#: sig.c:691 +#, c-format +msgid "sigprocmask: %d: invalid operation" +msgstr "sigprocmask: %d: μη έγκυρη λειτουργία" + +#: siglist.c:48 +msgid "Bogus signal" +msgstr "" + +#: siglist.c:51 +msgid "Hangup" +msgstr "Hangup" + +#: siglist.c:55 +msgid "Interrupt" +msgstr "Διακοπή" + +#: siglist.c:59 +msgid "Quit" +msgstr "Quit" + +#: siglist.c:63 +msgid "Illegal instruction" +msgstr "Μη έγκυρη οδηγία" + +#: siglist.c:67 +msgid "BPT trace/trap" +msgstr "BPT trace/trap" + +#: siglist.c:75 +msgid "ABORT instruction" +msgstr "οδηγία ABORT" + +#: siglist.c:79 +msgid "EMT instruction" +msgstr "οδηγία EMT" + +#: siglist.c:83 +msgid "Floating point exception" +msgstr "Εξαίρεση κινητής υποδιαστολής" + +#: siglist.c:87 +msgid "Killed" +msgstr "" + +#: siglist.c:91 +msgid "Bus error" +msgstr "" + +#: siglist.c:95 +msgid "Segmentation fault" +msgstr "" + +#: siglist.c:99 +msgid "Bad system call" +msgstr "" + +#: siglist.c:103 +msgid "Broken pipe" +msgstr "" + +#: siglist.c:107 +msgid "Alarm clock" +msgstr "Ρολόι συναγερμού" + +#: siglist.c:111 +msgid "Terminated" +msgstr "" + +#: siglist.c:115 +msgid "Urgent IO condition" +msgstr "Επείγουσα κατάσταση IO" + +#: siglist.c:119 +msgid "Stopped (signal)" +msgstr "" + +#: siglist.c:127 +msgid "Continue" +msgstr "Συνέχεια" + +#: siglist.c:135 +msgid "Child death or stop" +msgstr "" + +#: siglist.c:139 +msgid "Stopped (tty input)" +msgstr "" + +#: siglist.c:143 +msgid "Stopped (tty output)" +msgstr "" + +#: siglist.c:147 +msgid "I/O ready" +msgstr "I/O ready" + +#: siglist.c:151 +msgid "CPU limit" +msgstr "όριο CPU" + +#: siglist.c:155 +msgid "File limit" +msgstr "Όριο αρχείου" + +#: siglist.c:159 +msgid "Alarm (virtual)" +msgstr "Alarm (virtual)" + +#: siglist.c:163 +msgid "Alarm (profile)" +msgstr "Alarm (profile)" + +#: siglist.c:167 +msgid "Window changed" +msgstr "Παράθυρο άλλαξε" + +#: siglist.c:171 +msgid "Record lock" +msgstr "" + +#: siglist.c:175 +msgid "User signal 1" +msgstr "" + +#: siglist.c:179 +msgid "User signal 2" +msgstr "" + +#: siglist.c:183 +msgid "HFT input data pending" +msgstr "Δεδομένα εισόδου HFT στην αναμονή" + +#: siglist.c:187 +msgid "power failure imminent" +msgstr "επικείμενη έλλειψη ρεύματος" + +#: siglist.c:191 +msgid "system crash imminent" +msgstr "επικείμενη πτώση συστήματος" + +#: siglist.c:195 +msgid "migrate process to another CPU" +msgstr "μετανάστευση διεργασίας σε άλλη CPU" + +#: siglist.c:199 +msgid "programming error" +msgstr "προγραμματιστικό σφάλμα" + +#: siglist.c:203 +msgid "HFT monitor mode granted" +msgstr "" + +#: siglist.c:207 +msgid "HFT monitor mode retracted" +msgstr "" + +#: siglist.c:211 +msgid "HFT sound sequence has completed" +msgstr "" + +#: siglist.c:215 +msgid "Information request" +msgstr "Αίτηση για πληροφορίες" + +#: siglist.c:223 +msgid "Unknown Signal #" +msgstr "Άγνωστο σήμα #" + +#: siglist.c:225 +#, c-format +msgid "Unknown Signal #%d" +msgstr "Άγνωστο σήμα #%d" + +#: subst.c:1362 subst.c:1520 +#, c-format +msgid "bad substitution: no closing `%s' in %s" +msgstr "" + +#: subst.c:2847 +#, c-format +msgid "%s: cannot assign list to array member" +msgstr "" + +#: subst.c:5065 subst.c:5081 +msgid "cannot make pipe for process substitution" +msgstr "" + +#: subst.c:5113 +msgid "cannot make child for process substitution" +msgstr "" + +#: subst.c:5158 +#, c-format +msgid "cannot open named pipe %s for reading" +msgstr "αδυναμία ανοίγματοε επώνυμης σωλήνας %s προς ανάγνωση" + +#: subst.c:5160 +#, c-format +msgid "cannot open named pipe %s for writing" +msgstr "αδυναμία ανοίγματος επώνυμης σωλήνας %s προς εγγραφή" + +#: subst.c:5178 +#, c-format +msgid "cannot duplicate named pipe %s as fd %d" +msgstr "" + +#: subst.c:5376 +msgid "cannot make pipe for command substitution" +msgstr "" + +#: subst.c:5414 +msgid "cannot make child for command substitution" +msgstr "" + +#: subst.c:5433 +msgid "command_substitute: cannot duplicate pipe as fd 1" +msgstr "" + +#: subst.c:5837 subst.c:8050 +#, c-format +msgid "%s: invalid variable name for name reference" +msgstr "" + +#: subst.c:6048 +#, c-format +msgid "%s: parameter null or not set" +msgstr "%s: παράμετρος κενή ή δεν έχει οριστεί" + +#: subst.c:6320 subst.c:6335 +#, c-format +msgid "%s: substring expression < 0" +msgstr "%s: έκφραση αρνητική < 0" + +#: subst.c:7506 +#, c-format +msgid "%s: bad substitution" +msgstr "%s: κακή αντικατάσταση" + +#: subst.c:7583 +#, c-format +msgid "$%s: cannot assign in this way" +msgstr "$%s: αδύνατη ανάθεση κατ' αυτόν τον τρόπο" + +#: subst.c:7917 +msgid "" +"future versions of the shell will force evaluation as an arithmetic " +"substitution" +msgstr "" + +#: subst.c:8421 +#, c-format +msgid "bad substitution: no closing \"`\" in %s" +msgstr "κακή αντικατάσταση: δεν υπάρχει «`» που κλείνει στο %s" + +#: subst.c:9322 +#, c-format +msgid "no match: %s" +msgstr "" + +#: test.c:147 +msgid "argument expected" +msgstr "αναμενόταν όρισμα" + +#: test.c:156 +#, c-format +msgid "%s: integer expression expected" +msgstr "%s: αναμενόταν ως έκφραση ακέραιος αριθμός" + +#: test.c:264 +msgid "`)' expected" +msgstr "αναμενόταν «)»" + +#: test.c:266 +#, c-format +msgid "`)' expected, found %s" +msgstr "σναμενόταν «)», βρέθηκε %s" + +#: test.c:281 test.c:742 test.c:745 +#, c-format +msgid "%s: unary operator expected" +msgstr "" + +#: test.c:468 test.c:785 +#, c-format +msgid "%s: binary operator expected" +msgstr "%s: αναμενόταν δυαδικός τελεστής" + +#: test.c:860 +msgid "missing `]'" +msgstr "απούσα «]»" + +#: trap.c:217 +msgid "invalid signal number" +msgstr "μη έγκυρος αριθμός σήματος" + +#: trap.c:371 +#, c-format +msgid "run_pending_traps: bad value in trap_list[%d]: %p" +msgstr "" + +#: trap.c:375 +#, c-format +msgid "" +"run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" +msgstr "" + +#: trap.c:428 +#, c-format +msgid "trap_handler: bad signal %d" +msgstr "trap_handler: κακό σήμα %d" + +#: variables.c:382 +#, c-format +msgid "error importing function definition for `%s'" +msgstr "" + +#: variables.c:780 +#, c-format +msgid "shell level (%d) too high, resetting to 1" +msgstr "επίπεδο κελύφους (%d) πολύ υψηλό, επαναφορά στο 1" + +#: variables.c:1865 +#, c-format +msgid "%s: circular name reference" +msgstr "" + +#: variables.c:2228 +msgid "make_local_variable: no function context at current scope" +msgstr "make_local_variable: no function context at current scope" + +#: variables.c:2247 +#, c-format +msgid "%s: variable may not be assigned value" +msgstr "" + +#: variables.c:3646 +msgid "all_local_variables: no function context at current scope" +msgstr "all_local_variables: no function context at current scope" + +#: variables.c:3891 +#, c-format +msgid "%s has null exportstr" +msgstr "%s έχει κενό exportstr" + +#: variables.c:3896 variables.c:3905 +#, c-format +msgid "invalid character %d in exportstr for %s" +msgstr "ο χαρακτήρας %d δεν έίναι έγκυρος στην exportstr για %s" + +#: variables.c:3911 +#, c-format +msgid "no `=' in exportstr for %s" +msgstr "απουσία «=» στην exportstr για %s" + +#: variables.c:4344 +msgid "pop_var_context: head of shell_variables not a function context" +msgstr "pop_var_context: head of shell_variables not a function context" + +#: variables.c:4357 +msgid "pop_var_context: no global_variables context" +msgstr "pop_var_context: no global_variables context" + +#: variables.c:4431 +msgid "pop_scope: head of shell_variables not a temporary environment scope" +msgstr "pop_scope: head of shell_variables not a temporary environment scope" + +#: variables.c:5257 +#, c-format +msgid "%s: %s: cannot open as FILE" +msgstr "%s: %s: αδυναμία ανοίγματος ως ΑΡΧΕΙΟ" + +#: variables.c:5262 +#, c-format +msgid "%s: %s: invalid value for trace file descriptor" +msgstr "" + +#: variables.c:5307 +#, c-format +msgid "%s: %s: compatibility value out of range" +msgstr "" + +#: version.c:46 +#, fuzzy +msgid "Copyright (C) 2013 Free Software Foundation, Inc." +msgstr "Copyright (C) 2012 Free Software Foundation, Inc." + +#: version.c:47 version2.c:47 +msgid "" +"License GPLv3+: GNU GPL version 3 or later \n" +msgstr "" +"License GPLv3+: GNU GPL έκδοση 3 ή νεώτερη \n" + +#: version.c:86 version2.c:86 +#, c-format +msgid "GNU bash, version %s (%s)\n" +msgstr "GNU bash, έκδοση %s (%s)\n" + +#: version.c:91 version2.c:91 +msgid "This is free software; you are free to change and redistribute it." +msgstr "This is free software; you are free to change and redistribute it." + +#: version.c:92 version2.c:92 +msgid "There is NO WARRANTY, to the extent permitted by law." +msgstr "There is NO WARRANTY, to the extent permitted by law." + +#: version2.c:46 +msgid "Copyright (C) 2012 Free Software Foundation, Inc." +msgstr "Copyright (C) 2012 Free Software Foundation, Inc." + +#: xmalloc.c:91 +#, c-format +msgid "%s: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "%s: αδυναμία εκχώρησης %lu bytes (%lu bytes εκχωρήθηκαν)" + +#: xmalloc.c:93 +#, c-format +msgid "%s: cannot allocate %lu bytes" +msgstr "%s: αδυναμία εκχώρησης %lu bytes" + +#: xmalloc.c:163 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "%s: %s:%d: αδυναμία εκχώρησης %lu bytes (%lu bytes εκχωρήθηκαν)" + +#: xmalloc.c:165 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes" +msgstr "%s: %s:%d: αδυναμία εκχώρησης %lu bytes" + +#: builtins.c:43 +msgid "alias [-p] [name[=value] ... ]" +msgstr "alias [-p] [name[=value] ... ]" + +#: builtins.c:47 +msgid "unalias [-a] name [name ...]" +msgstr "unalias [-a] name [name ...]" + +#: builtins.c:51 +msgid "" +"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-" +"x keyseq:shell-command] [keyseq:readline-function or readline-command]" +msgstr "" +"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-" +"x keyseq:shell-command] [keyseq:readline-function ή readline-command]" + +#: builtins.c:54 +msgid "break [n]" +msgstr "break [n]" + +#: builtins.c:56 +msgid "continue [n]" +msgstr "continue [n]" + +#: builtins.c:58 +msgid "builtin [shell-builtin [arg ...]]" +msgstr "builtin [shell-builtin [arg ...]]" + +#: builtins.c:61 +msgid "caller [expr]" +msgstr "caller [expr]" + +#: builtins.c:64 +#, fuzzy +msgid "cd [-L|[-P [-e]] [-@]] [dir]" +msgstr "cd [-L|[-P [-e]]] [dir]" + +#: builtins.c:66 +msgid "pwd [-LP]" +msgstr "pwd [-LP]" + +#: builtins.c:68 +msgid ":" +msgstr ":" + +#: builtins.c:70 +msgid "true" +msgstr "αληθής" + +#: builtins.c:72 +msgid "false" +msgstr "ψευδής" + +#: builtins.c:74 +msgid "command [-pVv] command [arg ...]" +msgstr "command [-pVv] command [arg ...]" + +#: builtins.c:76 +msgid "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" +msgstr "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" + +#: builtins.c:78 +msgid "typeset [-aAfFgilrtux] [-p] name[=value] ..." +msgstr "typeset [-aAfFgilrtux] [-p] name[=value] ..." + +#: builtins.c:80 +msgid "local [option] name[=value] ..." +msgstr "local [option] name[=value] ..." + +#: builtins.c:83 +msgid "echo [-neE] [arg ...]" +msgstr "echo [-neE] [arg ...]" + +#: builtins.c:87 +msgid "echo [-n] [arg ...]" +msgstr "echo [-n] [arg ...]" + +#: builtins.c:90 +msgid "enable [-a] [-dnps] [-f filename] [name ...]" +msgstr "enable [-a] [-dnps] [-f filename] [name ...]" + +#: builtins.c:92 +msgid "eval [arg ...]" +msgstr "eval [arg ...]" + +#: builtins.c:94 +msgid "getopts optstring name [arg]" +msgstr "getopts optstring name [arg]" + +#: builtins.c:96 +msgid "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" +msgstr "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" + +#: builtins.c:98 +msgid "exit [n]" +msgstr "exit [n]" + +#: builtins.c:100 +msgid "logout [n]" +msgstr "logout [n]" + +#: builtins.c:103 +msgid "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" +msgstr "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" + +#: builtins.c:107 +msgid "fg [job_spec]" +msgstr "fg [job_spec]" + +#: builtins.c:111 +msgid "bg [job_spec ...]" +msgstr "bg [job_spec ...]" + +#: builtins.c:114 +msgid "hash [-lr] [-p pathname] [-dt] [name ...]" +msgstr "hash [-lr] [-p pathname] [-dt] [name ...]" + +#: builtins.c:117 +msgid "help [-dms] [pattern ...]" +msgstr "help [-dms] [pattern ...]" + +#: builtins.c:121 +msgid "" +"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg " +"[arg...]" +msgstr "" +"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg " +"[arg...]" + +#: builtins.c:125 +msgid "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" +msgstr "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" + +#: builtins.c:129 +msgid "disown [-h] [-ar] [jobspec ...]" +msgstr "disown [-h] [-ar] [jobspec ...]" + +#: builtins.c:132 +msgid "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l " +"[sigspec]" +msgstr "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l " +"[sigspec]" + +#: builtins.c:134 +msgid "let arg [arg ...]" +msgstr "let arg [arg ...]" + +#: builtins.c:136 +msgid "" +"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p " +"prompt] [-t timeout] [-u fd] [name ...]" +msgstr "" +"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p " +"prompt] [-t timeout] [-u fd] [name ...]" + +#: builtins.c:138 +msgid "return [n]" +msgstr "return [n]" + +#: builtins.c:140 +msgid "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" +msgstr "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" + +#: builtins.c:142 +msgid "unset [-f] [-v] [-n] [name ...]" +msgstr "unset [-f] [-v] [-n] [name ...]" + +#: builtins.c:144 +msgid "export [-fn] [name[=value] ...] or export -p" +msgstr "export [-fn] [name[=value] ...] ή export -p" + +#: builtins.c:146 +msgid "readonly [-aAf] [name[=value] ...] or readonly -p" +msgstr "readonly [-aAf] [name[=value] ...] ή readonly -p" + +#: builtins.c:148 +msgid "shift [n]" +msgstr "shift [n]" + +#: builtins.c:150 +msgid "source filename [arguments]" +msgstr "source filename [arguments]" + +#: builtins.c:152 +msgid ". filename [arguments]" +msgstr ". όνομα αρχείου [ορίσματα]" + +#: builtins.c:155 +msgid "suspend [-f]" +msgstr "suspend [-f]" + +#: builtins.c:158 +msgid "test [expr]" +msgstr "test [expr]" + +#: builtins.c:160 +msgid "[ arg... ]" +msgstr "[ arg... ]" + +#: builtins.c:162 +msgid "times" +msgstr "times" + +#: builtins.c:164 +msgid "trap [-lp] [[arg] signal_spec ...]" +msgstr "trap [-lp] [[arg] signal_spec ...]" + +#: builtins.c:166 +msgid "type [-afptP] name [name ...]" +msgstr "type [-afptP] name [name ...]" + +#: builtins.c:169 +msgid "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" +msgstr "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" + +#: builtins.c:172 +msgid "umask [-p] [-S] [mode]" +msgstr "umask [-p] [-S] [mode]" + +#: builtins.c:175 +msgid "wait [-n] [id ...]" +msgstr "wait [-n] [id ...]" + +#: builtins.c:179 +msgid "wait [pid ...]" +msgstr "wait [pid ...]" + +#: builtins.c:182 +msgid "for NAME [in WORDS ... ] ; do COMMANDS; done" +msgstr "for NAME [in WORDS ... ] ; do COMMANDS; done" + +#: builtins.c:184 +msgid "for (( exp1; exp2; exp3 )); do COMMANDS; done" +msgstr "for (( exp1; exp2; exp3 )); do COMMANDS; done" + +#: builtins.c:186 +msgid "select NAME [in WORDS ... ;] do COMMANDS; done" +msgstr "select NAME [in WORDS ... ;] do COMMANDS; done" + +#: builtins.c:188 +msgid "time [-p] pipeline" +msgstr "time [-p] pipeline" + +#: builtins.c:190 +msgid "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" +msgstr "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" + +#: builtins.c:192 +msgid "" +"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else " +"COMMANDS; ] fi" +msgstr "" +"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else " +"COMMANDS; ] fi" + +#: builtins.c:194 +msgid "while COMMANDS; do COMMANDS; done" +msgstr "while COMMANDS; do COMMANDS; done" + +#: builtins.c:196 +msgid "until COMMANDS; do COMMANDS; done" +msgstr "until COMMANDS; do COMMANDS; done" + +#: builtins.c:198 +msgid "coproc [NAME] command [redirections]" +msgstr "coproc [NAME] command [redirections]" + +#: builtins.c:200 +msgid "function name { COMMANDS ; } or name () { COMMANDS ; }" +msgstr "function name { COMMANDS ; } ή name () { COMMANDS ; }" + +#: builtins.c:202 +msgid "{ COMMANDS ; }" +msgstr "{ COMMANDS ; }" + +#: builtins.c:204 +msgid "job_spec [&]" +msgstr "job_spec [&]" + +#: builtins.c:206 +msgid "(( expression ))" +msgstr "(( expression ))" + +#: builtins.c:208 +msgid "[[ expression ]]" +msgstr "[[ expression ]]" + +#: builtins.c:210 +msgid "variables - Names and meanings of some shell variables" +msgstr "variables - Ονόματα και σημασία ορισμένων μεταβλητών του κελύφους" + +#: builtins.c:213 +msgid "pushd [-n] [+N | -N | dir]" +msgstr "pushd [-n] [+N | -N | dir]" + +#: builtins.c:217 +msgid "popd [-n] [+N | -N]" +msgstr "popd [-n] [+N | -N]" + +#: builtins.c:221 +msgid "dirs [-clpv] [+N] [-N]" +msgstr "dirs [-clpv] [+N] [-N]" + +#: builtins.c:224 +msgid "shopt [-pqsu] [-o] [optname ...]" +msgstr "shopt [-pqsu] [-o] [optname ...]" + +#: builtins.c:226 +msgid "printf [-v var] format [arguments]" +msgstr "printf [-v var] format [ορίσματα]" + +#: builtins.c:229 +msgid "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-" +"W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S " +"suffix] [name ...]" +msgstr "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-" +"W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S " +"suffix] [name ...]" + +#: builtins.c:233 +msgid "" +"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " +"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" +msgstr "" +"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " +"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" + +#: builtins.c:237 +msgid "compopt [-o|+o option] [-DE] [name ...]" +msgstr "compopt [-o|+o option] [-DE] [name ...]" + +#: builtins.c:240 +msgid "" +"mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" +"mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" + +#: builtins.c:242 +msgid "" +"readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" +"readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" + +#: builtins.c:254 +msgid "" +"Define or display aliases.\n" +" \n" +" Without arguments, `alias' prints the list of aliases in the reusable\n" +" form `alias NAME=VALUE' on standard output.\n" +" \n" +" Otherwise, an alias is defined for each NAME whose VALUE is given.\n" +" A trailing space in VALUE causes the next word to be checked for\n" +" alias substitution when the alias is expanded.\n" +" \n" +" Options:\n" +" -p\tPrint all defined aliases in a reusable format\n" +" \n" +" Exit Status:\n" +" alias returns true unless a NAME is supplied for which no alias has " +"been\n" +" defined." +msgstr "" + +#: builtins.c:276 +msgid "" +"Remove each NAME from the list of defined aliases.\n" +" \n" +" Options:\n" +" -a\tremove all alias definitions.\n" +" \n" +" Return success unless a NAME is not an existing alias." +msgstr "" +"Αφαίρεση κάθε ΟΝΟΜΑτος από τη λίστα των καθορισμένων ψευδωνήμων.\n" +" \n" +" Επιλογές:\n" +" -a\tαφαίρεση όλων των ψευδωνήμων.\n" +" \n" +" Επιστρέφει επιτυχία εκτός αν το ΟΝΟΜΑ δεν είναι υπάρχον ψευδώνημο." + +#: builtins.c:289 +msgid "" +"Set Readline key bindings and variables.\n" +" \n" +" Bind a key sequence to a Readline function or a macro, or set a\n" +" Readline variable. The non-option argument syntax is equivalent to\n" +" that found in ~/.inputrc, but must be passed as a single argument:\n" +" e.g., bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Options:\n" +" -m keymap Use KEYMAP as the keymap for the duration of this\n" +" command. Acceptable keymap names are emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" +"move,\n" +" vi-command, and vi-insert.\n" +" -l List names of functions.\n" +" -P List function names and bindings.\n" +" -p List functions and bindings in a form that can be\n" +" reused as input.\n" +" -S List key sequences that invoke macros and their " +"values\n" +" -s List key sequences that invoke macros and their " +"values\n" +" in a form that can be reused as input.\n" +" -V List variable names and values\n" +" -v List variable names and values in a form that can\n" +" be reused as input.\n" +" -q function-name Query about which keys invoke the named function.\n" +" -u function-name Unbind all keys which are bound to the named " +"function.\n" +" -r keyseq Remove the binding for KEYSEQ.\n" +" -f filename Read key bindings from FILENAME.\n" +" -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when\n" +" \t\t\t\tKEYSEQ is entered.\n" +" -X\t\t List key sequences bound with -x and associated commands\n" +" in a form that can be reused as input.\n" +" \n" +" Exit Status:\n" +" bind returns 0 unless an unrecognized option is given or an error occurs." +msgstr "" + +#: builtins.c:328 +msgid "" +"Exit for, while, or until loops.\n" +" \n" +" Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n" +" loops.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" + +#: builtins.c:340 +msgid "" +"Resume for, while, or until loops.\n" +" \n" +" Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n" +" If N is specified, resumes the Nth enclosing loop.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" + +#: builtins.c:352 +msgid "" +"Execute shell builtins.\n" +" \n" +" Execute SHELL-BUILTIN with arguments ARGs without performing command\n" +" lookup. This is useful when you wish to reimplement a shell builtin\n" +" as a shell function, but need to execute the builtin within the " +"function.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n" +" not a shell builtin.." +msgstr "" + +#: builtins.c:367 +msgid "" +"Return the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns \"$line $filename\". With EXPR, returns\n" +" \"$line $subroutine $filename\"; this extra information can be used to\n" +" provide a stack trace.\n" +" \n" +" The value of EXPR indicates how many call frames to go back before the\n" +" current one; the top frame is frame 0.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless the shell is not executing a shell function or EXPR\n" +" is invalid." +msgstr "" + +#: builtins.c:385 +msgid "" +"Change the shell working directory.\n" +" \n" +" Change the current directory to DIR. The default DIR is the value of " +"the\n" +" HOME shell variable.\n" +" \n" +" The variable CDPATH defines the search path for the directory " +"containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon " +"(:).\n" +" A null directory name is the same as the current directory. If DIR " +"begins\n" +" with a slash (/), then CDPATH is not used.\n" +" \n" +" If the directory is not found, and the shell option `cdable_vars' is " +"set,\n" +" the word is assumed to be a variable name. If that variable has a " +"value,\n" +" its value is used for DIR.\n" +" \n" +" Options:\n" +" -L\tforce symbolic links to be followed: resolve symbolic links in\n" +" \tDIR after processing instances of `..'\n" +" -P\tuse the physical directory structure without following symbolic\n" +" \tlinks: resolve symbolic links in DIR before processing instances\n" +" \tof `..'\n" +" -e\tif the -P option is supplied, and the current working directory\n" +" \tcannot be determined successfully, exit with a non-zero status\n" +" -@ on systems that support it, present a file with extended " +"attributes\n" +" as a directory containing the file attributes\n" +" \n" +" The default is to follow symbolic links, as if `-L' were specified.\n" +" `..' is processed by removing the immediately previous pathname " +"component\n" +" back to a slash or the beginning of DIR.\n" +" \n" +" Exit Status:\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully " +"when\n" +" -P is used; non-zero otherwise." +msgstr "" + +#: builtins.c:422 +#, fuzzy +msgid "" +"Print the name of the current working directory.\n" +" \n" +" Options:\n" +" -L\tprint the value of $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tprint the physical directory, without any symbolic links\n" +" \n" +" By default, `pwd' behaves as if `-L' were specified.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless an invalid option is given or the current directory\n" +" cannot be read." +msgstr "" +"Εμφάνιση του ονόματος του τρέχοντος καταλόγου εργασίας.\n" +" \n" +" Επιλογές:\n" +" -L\tεμφάνιση της τιμής της $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tεμφάνιση του φυσικού καταλόγου, χωρίς συμβολικούς συνδέσμους\n" +" \n" +" Από προεπιλογή, η «pwd» συμπεριφέρεται σαν να είχε δωθεί «-L» .\n" +" \n" +" Κατάσταση εξόδου:\n" +" Επιστρέφει 0 εκτός αν δίνεται μη έγκυρη επιλογή ή ο τρέχων κατάλογος\n" +" δεν μπορεί να διαβαστεί." + +#: builtins.c:439 +msgid "" +"Null command.\n" +" \n" +" No effect; the command does nothing.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Εντολή Null.\n" +" \n" +" Κανένα αποτέλεσμα, η εντολή δεν κάνει τίποτα.\n" +" \n" +" Κατάσταση εξόδου:\n" +" Πάντα επιτυχία." + +#: builtins.c:450 +msgid "" +"Return a successful result.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" + +#: builtins.c:459 +msgid "" +"Return an unsuccessful result.\n" +" \n" +" Exit Status:\n" +" Always fails." +msgstr "" + +#: builtins.c:468 +msgid "" +"Execute a simple command or display information about commands.\n" +" \n" +" Runs COMMAND with ARGS suppressing shell function lookup, or display\n" +" information about the specified COMMANDs. Can be used to invoke " +"commands\n" +" on disk when a function with the same name exists.\n" +" \n" +" Options:\n" +" -p\tuse a default value for PATH that is guaranteed to find all of\n" +" \tthe standard utilities\n" +" -v\tprint a description of COMMAND similar to the `type' builtin\n" +" -V\tprint a more verbose description of each COMMAND\n" +" \n" +" Exit Status:\n" +" Returns exit status of COMMAND, or failure if COMMAND is not found." +msgstr "" + +#: builtins.c:487 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Declare variables and give them attributes. If no NAMEs are given,\n" +" display the attributes and values of all variables.\n" +" \n" +" Options:\n" +" -f\trestrict action or display to function names and definitions\n" +" -F\trestrict display to function names only (plus line number and\n" +" \tsource file when debugging)\n" +" -g\tcreate global variables when used in a shell function; otherwise\n" +" \tignored\n" +" -p\tdisplay the attributes and value of each NAME\n" +" \n" +" Options which set attributes:\n" +" -a\tto make NAMEs indexed arrays (if supported)\n" +" -A\tto make NAMEs associative arrays (if supported)\n" +" -i\tto make NAMEs have the `integer' attribute\n" +" -l\tto convert NAMEs to lower case on assignment\n" +" -n\tmake NAME a reference to the variable named by its value\n" +" -r\tto make NAMEs readonly\n" +" -t\tto make NAMEs have the `trace' attribute\n" +" -u\tto convert NAMEs to upper case on assignment\n" +" -x\tto make NAMEs export\n" +" \n" +" Using `+' instead of `-' turns off the given attribute.\n" +" \n" +" Variables with the integer attribute have arithmetic evaluation (see\n" +" the `let' command) performed when the variable is assigned a value.\n" +" \n" +" When used in a function, `declare' makes NAMEs local, as with the " +"`local'\n" +" command. The `-g' option suppresses this behavior.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or a variable\n" +" assignment error occurs." +msgstr "" + +#: builtins.c:527 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Obsolete. See `help declare'." +msgstr "" + +#: builtins.c:535 +msgid "" +"Define local variables.\n" +" \n" +" Create a local variable called NAME, and give it VALUE. OPTION can\n" +" be any option accepted by `declare'.\n" +" \n" +" Local variables can only be used within a function; they are visible\n" +" only to the function where they are defined and its children.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied, a variable\n" +" assignment error occurs, or the shell is not executing a function." +msgstr "" + +#: builtins.c:552 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs, separated by a single space character and followed by " +"a\n" +" newline, on the standard output.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" -e\tenable interpretation of the following backslash escapes\n" +" -E\texplicitly suppress interpretation of backslash escapes\n" +" \n" +" `echo' interprets the following backslash-escaped characters:\n" +" \\a\talert (bell)\n" +" \\b\tbackspace\n" +" \\c\tsuppress further output\n" +" \\e\tescape character\n" +" \\E\tescape character\n" +" \\f\tform feed\n" +" \\n\tnew line\n" +" \\r\tcarriage return\n" +" \\t\thorizontal tab\n" +" \\v\tvertical tab\n" +" \\\\\tbackslash\n" +" \\0nnn\tthe character whose ASCII code is NNN (octal). NNN can be\n" +" \t0 to 3 octal digits\n" +" \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" +" \tcan be one or two hex digits\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" + +#: builtins.c:588 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs on the standard output followed by a newline.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" + +#: builtins.c:603 +msgid "" +"Enable and disable shell builtins.\n" +" \n" +" Enables and disables builtin shell commands. Disabling allows you to\n" +" execute a disk command which has the same name as a shell builtin\n" +" without using a full pathname.\n" +" \n" +" Options:\n" +" -a\tprint a list of builtins showing whether or not each is enabled\n" +" -n\tdisable each NAME or display a list of disabled builtins\n" +" -p\tprint the list of builtins in a reusable format\n" +" -s\tprint only the names of Posix `special' builtins\n" +" \n" +" Options controlling dynamic loading:\n" +" -f\tLoad builtin NAME from shared object FILENAME\n" +" -d\tRemove a builtin loaded with -f\n" +" \n" +" Without options, each NAME is enabled.\n" +" \n" +" To use the `test' found in $PATH instead of the shell builtin\n" +" version, type `enable -n test'.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not a shell builtin or an error occurs." +msgstr "" + +#: builtins.c:631 +msgid "" +"Execute arguments as a shell command.\n" +" \n" +" Combine ARGs into a single string, use the result as input to the " +"shell,\n" +" and execute the resulting commands.\n" +" \n" +" Exit Status:\n" +" Returns exit status of command or success if command is null." +msgstr "" + +#: builtins.c:643 +msgid "" +"Parse option arguments.\n" +" \n" +" Getopts is used by shell procedures to parse positional parameters\n" +" as options.\n" +" \n" +" OPTSTRING contains the option letters to be recognized; if a letter\n" +" is followed by a colon, the option is expected to have an argument,\n" +" which should be separated from it by white space.\n" +" \n" +" Each time it is invoked, getopts will place the next option in the\n" +" shell variable $name, initializing name if it does not exist, and\n" +" the index of the next argument to be processed into the shell\n" +" variable OPTIND. OPTIND is initialized to 1 each time the shell or\n" +" a shell script is invoked. When an option requires an argument,\n" +" getopts places that argument into the shell variable OPTARG.\n" +" \n" +" getopts reports errors in one of two ways. If the first character\n" +" of OPTSTRING is a colon, getopts uses silent error reporting. In\n" +" this mode, no error messages are printed. If an invalid option is\n" +" seen, getopts places the option character found into OPTARG. If a\n" +" required argument is not found, getopts places a ':' into NAME and\n" +" sets OPTARG to the option character found. If getopts is not in\n" +" silent mode, and an invalid option is seen, getopts places '?' into\n" +" NAME and unsets OPTARG. If a required argument is not found, a '?'\n" +" is placed in NAME, OPTARG is unset, and a diagnostic message is\n" +" printed.\n" +" \n" +" If the shell variable OPTERR has the value 0, getopts disables the\n" +" printing of error messages, even if the first character of\n" +" OPTSTRING is not a colon. OPTERR has the value 1 by default.\n" +" \n" +" Getopts normally parses the positional parameters ($0 - $9), but if\n" +" more arguments are given, they are parsed instead.\n" +" \n" +" Exit Status:\n" +" Returns success if an option is found; fails if the end of options is\n" +" encountered or an error occurs." +msgstr "" + +#: builtins.c:685 +msgid "" +"Replace the shell with the given command.\n" +" \n" +" Execute COMMAND, replacing this shell with the specified program.\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not " +"specified,\n" +" any redirections take effect in the current shell.\n" +" \n" +" Options:\n" +" -a name\tpass NAME as the zeroth argument to COMMAND\n" +" -c\t\texecute COMMAND with an empty environment\n" +" -l\t\tplace a dash in the zeroth argument to COMMAND\n" +" \n" +" If the command cannot be executed, a non-interactive shell exits, " +"unless\n" +" the shell option `execfail' is set.\n" +" \n" +" Exit Status:\n" +" Returns success unless COMMAND is not found or a redirection error " +"occurs." +msgstr "" + +#: builtins.c:706 +msgid "" +"Exit the shell.\n" +" \n" +" Exits the shell with a status of N. If N is omitted, the exit status\n" +" is that of the last command executed." +msgstr "" + +#: builtins.c:715 +msgid "" +"Exit a login shell.\n" +" \n" +" Exits a login shell with exit status N. Returns an error if not " +"executed\n" +" in a login shell." +msgstr "" + +#: builtins.c:725 +msgid "" +"Display or execute commands from the history list.\n" +" \n" +" fc is used to list or edit and re-execute commands from the history " +"list.\n" +" FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" +" string, which means the most recent command beginning with that\n" +" string.\n" +" \n" +" Options:\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then " +"EDITOR,\n" +" \t\tthen vi\n" +" -l \tlist lines instead of editing\n" +" -n\tomit line numbers when listing\n" +" -r\treverse the order of the lines (newest listed first)\n" +" \n" +" With the `fc -s [pat=rep ...] [command]' format, COMMAND is\n" +" re-executed after the substitution OLD=NEW is performed.\n" +" \n" +" A useful alias to use with this is r='fc -s', so that typing `r cc'\n" +" runs the last command beginning with `cc' and typing `r' re-executes\n" +" the last command.\n" +" \n" +" Exit Status:\n" +" Returns success or status of executed command; non-zero if an error " +"occurs." +msgstr "" + +#: builtins.c:755 +msgid "" +"Move job to the foreground.\n" +" \n" +" Place the job identified by JOB_SPEC in the foreground, making it the\n" +" current job. If JOB_SPEC is not present, the shell's notion of the\n" +" current job is used.\n" +" \n" +" Exit Status:\n" +" Status of command placed in foreground, or failure if an error occurs." +msgstr "" + +#: builtins.c:770 +msgid "" +"Move jobs to the background.\n" +" \n" +" Place the jobs identified by each JOB_SPEC in the background, as if " +"they\n" +" had been started with `&'. If JOB_SPEC is not present, the shell's " +"notion\n" +" of the current job is used.\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" + +#: builtins.c:784 +msgid "" +"Remember or display program locations.\n" +" \n" +" Determine and remember the full pathname of each command NAME. If\n" +" no arguments are given, information about remembered commands is " +"displayed.\n" +" \n" +" Options:\n" +" -d\t\tforget the remembered location of each NAME\n" +" -l\t\tdisplay in a format that may be reused as input\n" +" -p pathname\tuse PATHNAME as the full pathname of NAME\n" +" -r\t\tforget all remembered locations\n" +" -t\t\tprint the remembered location of each NAME, preceding\n" +" \t\teach location with the corresponding NAME if multiple\n" +" \t\tNAMEs are given\n" +" Arguments:\n" +" NAME\t\tEach NAME is searched for in $PATH and added to the list\n" +" \t\tof remembered commands.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not found or an invalid option is given." +msgstr "" + +#: builtins.c:809 +msgid "" +"Display information about builtin commands.\n" +" \n" +" Displays brief summaries of builtin commands. If PATTERN is\n" +" specified, gives detailed help on all commands matching PATTERN,\n" +" otherwise the list of help topics is printed.\n" +" \n" +" Options:\n" +" -d\toutput short description for each topic\n" +" -m\tdisplay usage in pseudo-manpage format\n" +" -s\toutput only a short usage synopsis for each topic matching\n" +" \tPATTERN\n" +" \n" +" Arguments:\n" +" PATTERN\tPattern specifiying a help topic\n" +" \n" +" Exit Status:\n" +" Returns success unless PATTERN is not found or an invalid option is " +"given." +msgstr "" + +#: builtins.c:833 +msgid "" +"Display or manipulate the history list.\n" +" \n" +" Display the history list with line numbers, prefixing each modified\n" +" entry with a `*'. An argument of N lists only the last N entries.\n" +" \n" +" Options:\n" +" -c\tclear the history list by deleting all of the entries\n" +" -d offset\tdelete the history entry at offset OFFSET.\n" +" \n" +" -a\tappend history lines from this session to the history file\n" +" -n\tread all history lines not already read from the history file\n" +" -r\tread the history file and append the contents to the history\n" +" \tlist\n" +" -w\twrite the current history to the history file\n" +" \tand append them to the history list\n" +" \n" +" -p\tperform history expansion on each ARG and display the result\n" +" \twithout storing it in the history list\n" +" -s\tappend the ARGs to the history list as a single entry\n" +" \n" +" If FILENAME is given, it is used as the history file. Otherwise,\n" +" if $HISTFILE has a value, that is used, else ~/.bash_history.\n" +" \n" +" If the $HISTTIMEFORMAT variable is set and not null, its value is used\n" +" as a format string for strftime(3) to print the time stamp associated\n" +" with each displayed history entry. No time stamps are printed " +"otherwise.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" + +#: builtins.c:869 +msgid "" +"Display status of jobs.\n" +" \n" +" Lists the active jobs. JOBSPEC restricts output to that job.\n" +" Without options, the status of all active jobs is displayed.\n" +" \n" +" Options:\n" +" -l\tlists process IDs in addition to the normal information\n" +" -n\tlists only processes that have changed status since the last\n" +" \tnotification\n" +" -p\tlists process IDs only\n" +" -r\trestrict output to running jobs\n" +" -s\trestrict output to stopped jobs\n" +" \n" +" If -x is supplied, COMMAND is run after all job specifications that\n" +" appear in ARGS have been replaced with the process ID of that job's\n" +" process group leader.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs.\n" +" If -x is used, returns the exit status of COMMAND." +msgstr "" + +#: builtins.c:896 +msgid "" +"Remove jobs from current shell.\n" +" \n" +" Removes each JOBSPEC argument from the table of active jobs. Without\n" +" any JOBSPECs, the shell uses its notion of the current job.\n" +" \n" +" Options:\n" +" -a\tremove all jobs if JOBSPEC is not supplied\n" +" -h\tmark each JOBSPEC so that SIGHUP is not sent to the job if the\n" +" \tshell receives a SIGHUP\n" +" -r\tremove only running jobs\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option or JOBSPEC is given." +msgstr "" + +#: builtins.c:915 +msgid "" +"Send a signal to a job.\n" +" \n" +" Send the processes identified by PID or JOBSPEC the signal named by\n" +" SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n" +" SIGTERM is assumed.\n" +" \n" +" Options:\n" +" -s sig\tSIG is a signal name\n" +" -n sig\tSIG is a signal number\n" +" -l\tlist the signal names; if arguments follow `-l' they are\n" +" \tassumed to be signal numbers for which names should be listed\n" +" \n" +" Kill is a shell builtin for two reasons: it allows job IDs to be used\n" +" instead of process IDs, and allows processes to be killed if the limit\n" +" on processes that you can create is reached.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" + +#: builtins.c:938 +msgid "" +"Evaluate arithmetic expressions.\n" +" \n" +" Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" +" fixed-width integers with no check for overflow, though division by 0\n" +" is trapped and flagged as an error. The following list of operators is\n" +" grouped into levels of equal-precedence operators. The levels are " +"listed\n" +" in order of decreasing precedence.\n" +" \n" +" \tid++, id--\tvariable post-increment, post-decrement\n" +" \t++id, --id\tvariable pre-increment, pre-decrement\n" +" \t-, +\t\tunary minus, plus\n" +" \t!, ~\t\tlogical and bitwise negation\n" +" \t**\t\texponentiation\n" +" \t*, /, %\t\tmultiplication, division, remainder\n" +" \t+, -\t\taddition, subtraction\n" +" \t<<, >>\t\tleft and right bitwise shifts\n" +" \t<=, >=, <, >\tcomparison\n" +" \t==, !=\t\tequality, inequality\n" +" \t&\t\tbitwise AND\n" +" \t^\t\tbitwise XOR\n" +" \t|\t\tbitwise OR\n" +" \t&&\t\tlogical AND\n" +" \t||\t\tlogical OR\n" +" \texpr ? expr : expr\n" +" \t\t\tconditional operator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tassignment\n" +" \n" +" Shell variables are allowed as operands. The name of the variable\n" +" is replaced by its value (coerced to a fixed-width integer) within\n" +" an expression. The variable need not have its integer attribute\n" +" turned on to be used in an expression.\n" +" \n" +" Operators are evaluated in order of precedence. Sub-expressions in\n" +" parentheses are evaluated first and may override the precedence\n" +" rules above.\n" +" \n" +" Exit Status:\n" +" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." +msgstr "" + +#: builtins.c:983 +msgid "" +"Read a line from the standard input and split it into fields.\n" +" \n" +" Reads a single line from the standard input, or from file descriptor FD\n" +" if the -u option is supplied. The line is split into fields as with " +"word\n" +" splitting, and the first word is assigned to the first NAME, the second\n" +" word to the second NAME, and so on, with any leftover words assigned to\n" +" the last NAME. Only the characters found in $IFS are recognized as " +"word\n" +" delimiters.\n" +" \n" +" If no NAMEs are supplied, the line read is stored in the REPLY " +"variable.\n" +" \n" +" Options:\n" +" -a array\tassign the words read to sequential indices of the array\n" +" \t\tvariable ARRAY, starting at zero\n" +" -d delim\tcontinue until the first character of DELIM is read, rather\n" +" \t\tthan newline\n" +" -e\t\tuse Readline to obtain the line in an interactive shell\n" +" -i text\tUse TEXT as the initial text for Readline\n" +" -n nchars\treturn after reading NCHARS characters rather than waiting\n" +" \t\tfor a newline, but honor a delimiter if fewer than NCHARS\n" +" \t\tcharacters are read before the delimiter\n" +" -N nchars\treturn only after reading exactly NCHARS characters, " +"unless\n" +" \t\tEOF is encountered or read times out, ignoring any delimiter\n" +" -p prompt\toutput the string PROMPT without a trailing newline before\n" +" \t\tattempting to read\n" +" -r\t\tdo not allow backslashes to escape any characters\n" +" -s\t\tdo not echo input coming from a terminal\n" +" -t timeout\ttime out and return failure if a complete line of input " +"is\n" +" \t\tnot read within TIMEOUT seconds. The value of the TMOUT\n" +" \t\tvariable is the default timeout. TIMEOUT may be a\n" +" \t\tfractional number. If TIMEOUT is 0, read returns immediately,\n" +" \t\twithout trying to read any data, returning success only if\n" +" \t\tinput is available on the specified file descriptor. The\n" +" \t\texit status is greater than 128 if the timeout is exceeded\n" +" -u fd\t\tread from file descriptor FD instead of the standard input\n" +" \n" +" Exit Status:\n" +" The return code is zero, unless end-of-file is encountered, read times " +"out\n" +" (in which case it's greater than 128), a variable assignment error " +"occurs,\n" +" or an invalid file descriptor is supplied as the argument to -u." +msgstr "" + +#: builtins.c:1028 +msgid "" +"Return from a shell function.\n" +" \n" +" Causes a function or sourced script to exit with the return value\n" +" specified by N. If N is omitted, the return status is that of the\n" +" last command executed within the function or script.\n" +" \n" +" Exit Status:\n" +" Returns N, or failure if the shell is not executing a function or script." +msgstr "" + +#: builtins.c:1041 +msgid "" +"Set or unset values of shell options and positional parameters.\n" +" \n" +" Change the value of shell attributes and positional parameters, or\n" +" display the names and values of shell variables.\n" +" \n" +" Options:\n" +" -a Mark variables which are modified or created for export.\n" +" -b Notify of job termination immediately.\n" +" -e Exit immediately if a command exits with a non-zero status.\n" +" -f Disable file name generation (globbing).\n" +" -h Remember the location of commands as they are looked up.\n" +" -k All assignment arguments are placed in the environment for a\n" +" command, not just those that precede the command name.\n" +" -m Job control is enabled.\n" +" -n Read commands but do not execute them.\n" +" -o option-name\n" +" Set the variable corresponding to option-name:\n" +" allexport same as -a\n" +" braceexpand same as -B\n" +" emacs use an emacs-style line editing interface\n" +" errexit same as -e\n" +" errtrace same as -E\n" +" functrace same as -T\n" +" hashall same as -h\n" +" histexpand same as -H\n" +" history enable command history\n" +" ignoreeof the shell will not exit upon reading EOF\n" +" interactive-comments\n" +" allow comments to appear in interactive commands\n" +" keyword same as -k\n" +" monitor same as -m\n" +" noclobber same as -C\n" +" noexec same as -n\n" +" noglob same as -f\n" +" nolog currently accepted but ignored\n" +" notify same as -b\n" +" nounset same as -u\n" +" onecmd same as -t\n" +" physical same as -P\n" +" pipefail the return value of a pipeline is the status of\n" +" the last command to exit with a non-zero status,\n" +" or zero if no command exited with a non-zero " +"status\n" +" posix change the behavior of bash where the default\n" +" operation differs from the Posix standard to\n" +" match the standard\n" +" privileged same as -p\n" +" verbose same as -v\n" +" vi use a vi-style line editing interface\n" +" xtrace same as -x\n" +" -p Turned on whenever the real and effective user ids do not match.\n" +" Disables processing of the $ENV file and importing of shell\n" +" functions. Turning this option off causes the effective uid and\n" +" gid to be set to the real uid and gid.\n" +" -t Exit after reading and executing one command.\n" +" -u Treat unset variables as an error when substituting.\n" +" -v Print shell input lines as they are read.\n" +" -x Print commands and their arguments as they are executed.\n" +" -B the shell will perform brace expansion\n" +" -C If set, disallow existing regular files to be overwritten\n" +" by redirection of output.\n" +" -E If set, the ERR trap is inherited by shell functions.\n" +" -H Enable ! style history substitution. This flag is on\n" +" by default when the shell is interactive.\n" +" -P If set, do not resolve symbolic links when executing commands\n" +" such as cd which change the current directory.\n" +" -T If set, the DEBUG trap is inherited by shell functions.\n" +" -- Assign any remaining arguments to the positional parameters.\n" +" If there are no remaining arguments, the positional parameters\n" +" are unset.\n" +" - Assign any remaining arguments to the positional parameters.\n" +" The -x and -v options are turned off.\n" +" \n" +" Using + rather than - causes these flags to be turned off. The\n" +" flags can also be used upon invocation of the shell. The current\n" +" set of flags may be found in $-. The remaining n ARGs are positional\n" +" parameters and are assigned, in order, to $1, $2, .. $n. If no\n" +" ARGs are given, all shell variables are printed.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given." +msgstr "" + +#: builtins.c:1126 +msgid "" +"Unset values and attributes of shell variables and functions.\n" +" \n" +" For each NAME, remove the corresponding variable or function.\n" +" \n" +" Options:\n" +" -f\ttreat each NAME as a shell function\n" +" -v\ttreat each NAME as a shell variable\n" +" -n\ttreat each NAME as a name reference and unset the variable itself\n" +" \trather than the variable it references\n" +" \n" +" Without options, unset first tries to unset a variable, and if that " +"fails,\n" +" tries to unset a function.\n" +" \n" +" Some variables cannot be unset; also see `readonly'.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a NAME is read-only." +msgstr "" + +#: builtins.c:1148 +msgid "" +"Set export attribute for shell variables.\n" +" \n" +" Marks each NAME for automatic export to the environment of subsequently\n" +" executed commands. If VALUE is supplied, assign VALUE before " +"exporting.\n" +" \n" +" Options:\n" +" -f\trefer to shell functions\n" +" -n\tremove the export property from each NAME\n" +" -p\tdisplay a list of all exported variables and functions\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" + +#: builtins.c:1167 +msgid "" +"Mark shell variables as unchangeable.\n" +" \n" +" Mark each NAME as read-only; the values of these NAMEs may not be\n" +" changed by subsequent assignment. If VALUE is supplied, assign VALUE\n" +" before marking as read-only.\n" +" \n" +" Options:\n" +" -a\trefer to indexed array variables\n" +" -A\trefer to associative array variables\n" +" -f\trefer to shell functions\n" +" -p\tdisplay a list of all readonly variables or functions, depending " +"on\n" +" whether or not the -f option is given\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" + +#: builtins.c:1189 +msgid "" +"Shift positional parameters.\n" +" \n" +" Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n" +" not given, it is assumed to be 1.\n" +" \n" +" Exit Status:\n" +" Returns success unless N is negative or greater than $#." +msgstr "" + +#: builtins.c:1201 builtins.c:1216 +msgid "" +"Execute commands from a file in the current shell.\n" +" \n" +" Read and execute commands from FILENAME in the current shell. The\n" +" entries in $PATH are used to find the directory containing FILENAME.\n" +" If any ARGUMENTS are supplied, they become the positional parameters\n" +" when FILENAME is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed in FILENAME; fails if\n" +" FILENAME cannot be read." +msgstr "" + +#: builtins.c:1232 +msgid "" +"Suspend shell execution.\n" +" \n" +" Suspend the execution of this shell until it receives a SIGCONT signal.\n" +" Unless forced, login shells cannot be suspended.\n" +" \n" +" Options:\n" +" -f\tforce the suspend, even if the shell is a login shell\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" + +#: builtins.c:1248 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" Exits with a status of 0 (true) or 1 (false) depending on\n" +" the evaluation of EXPR. Expressions may be unary or binary. Unary\n" +" expressions are often used to examine the status of a file. There\n" +" are string operators and numeric comparison operators as well.\n" +" \n" +" The behavior of test depends on the number of arguments. Read the\n" +" bash manual page for the complete specification.\n" +" \n" +" File operators:\n" +" \n" +" -a FILE True if file exists.\n" +" -b FILE True if file is block special.\n" +" -c FILE True if file is character special.\n" +" -d FILE True if file is a directory.\n" +" -e FILE True if file exists.\n" +" -f FILE True if file exists and is a regular file.\n" +" -g FILE True if file is set-group-id.\n" +" -h FILE True if file is a symbolic link.\n" +" -L FILE True if file is a symbolic link.\n" +" -k FILE True if file has its `sticky' bit set.\n" +" -p FILE True if file is a named pipe.\n" +" -r FILE True if file is readable by you.\n" +" -s FILE True if file exists and is not empty.\n" +" -S FILE True if file is a socket.\n" +" -t FD True if FD is opened on a terminal.\n" +" -u FILE True if the file is set-user-id.\n" +" -w FILE True if the file is writable by you.\n" +" -x FILE True if the file is executable by you.\n" +" -O FILE True if the file is effectively owned by you.\n" +" -G FILE True if the file is effectively owned by your group.\n" +" -N FILE True if the file has been modified since it was last " +"read.\n" +" \n" +" FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" +" modification date).\n" +" \n" +" FILE1 -ot FILE2 True if file1 is older than file2.\n" +" \n" +" FILE1 -ef FILE2 True if file1 is a hard link to file2.\n" +" \n" +" String operators:\n" +" \n" +" -z STRING True if string is empty.\n" +" \n" +" -n STRING\n" +" STRING True if string is not empty.\n" +" \n" +" STRING1 = STRING2\n" +" True if the strings are equal.\n" +" STRING1 != STRING2\n" +" True if the strings are not equal.\n" +" STRING1 < STRING2\n" +" True if STRING1 sorts before STRING2 " +"lexicographically.\n" +" STRING1 > STRING2\n" +" True if STRING1 sorts after STRING2 lexicographically.\n" +" \n" +" Other operators:\n" +" \n" +" -o OPTION True if the shell option OPTION is enabled.\n" +" -v VAR\t True if the shell variable VAR is set\n" +" -R VAR\t True if the shell variable VAR is set and is a name " +"reference.\n" +" ! EXPR True if expr is false.\n" +" EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n" +" EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n" +" \n" +" arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Arithmetic binary operators return true if ARG1 is equal, not-equal,\n" +" less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n" +" than ARG2.\n" +" \n" +" Exit Status:\n" +" Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n" +" false or an invalid argument is given." +msgstr "" + +#: builtins.c:1329 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" This is a synonym for the \"test\" builtin, but the last argument must\n" +" be a literal `]', to match the opening `['." +msgstr "" + +#: builtins.c:1338 +msgid "" +"Display process times.\n" +" \n" +" Prints the accumulated user and system times for the shell and all of " +"its\n" +" child processes.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" + +#: builtins.c:1350 +msgid "" +"Trap signals and other events.\n" +" \n" +" Defines and activates handlers to be run when the shell receives " +"signals\n" +" or other conditions.\n" +" \n" +" ARG is a command to be read and executed when the shell receives the\n" +" signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n" +" is supplied) or `-', each specified signal is reset to its original\n" +" value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" +" shell and by the commands it invokes.\n" +" \n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. " +"If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. " +"If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or " +"a\n" +" script run by the . or source builtins finishes executing. A " +"SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause " +"the\n" +" shell to exit when the -e option is enabled.\n" +" \n" +" If no arguments are supplied, trap prints the list of commands " +"associated\n" +" with each signal.\n" +" \n" +" Options:\n" +" -l\tprint a list of signal names and their corresponding numbers\n" +" -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" +" \n" +" Each SIGNAL_SPEC is either a signal name in or a signal " +"number.\n" +" Signal names are case insensitive and the SIG prefix is optional. A\n" +" signal may be sent to the shell with \"kill -signal $$\".\n" +" \n" +" Exit Status:\n" +" Returns success unless a SIGSPEC is invalid or an invalid option is " +"given." +msgstr "" + +#: builtins.c:1386 +msgid "" +"Display information about command type.\n" +" \n" +" For each NAME, indicate how it would be interpreted if used as a\n" +" command name.\n" +" \n" +" Options:\n" +" -a\tdisplay all locations containing an executable named NAME;\n" +" \tincludes aliases, builtins, and functions, if and only if\n" +" \tthe `-p' option is not also used\n" +" -f\tsuppress shell function lookup\n" +" -P\tforce a PATH search for each NAME, even if it is an alias,\n" +" \tbuiltin, or function, and returns the name of the disk file\n" +" \tthat would be executed\n" +" -p\treturns either the name of the disk file that would be executed,\n" +" \tor nothing if `type -t NAME' would not return `file'.\n" +" -t\toutput a single word which is one of `alias', `keyword',\n" +" \t`function', `builtin', `file' or `', if NAME is an alias, shell\n" +" \treserved word, shell function, shell builtin, disk file, or not\n" +" \tfound, respectively\n" +" \n" +" Arguments:\n" +" NAME\tCommand name to be interpreted.\n" +" \n" +" Exit Status:\n" +" Returns success if all of the NAMEs are found; fails if any are not " +"found." +msgstr "" + +#: builtins.c:1417 +msgid "" +"Modify shell resource limits.\n" +" \n" +" Provides control over the resources available to the shell and " +"processes\n" +" it creates, on systems that allow such control.\n" +" \n" +" Options:\n" +" -S\tuse the `soft' resource limit\n" +" -H\tuse the `hard' resource limit\n" +" -a\tall current limits are reported\n" +" -b\tthe socket buffer size\n" +" -c\tthe maximum size of core files created\n" +" -d\tthe maximum size of a process's data segment\n" +" -e\tthe maximum scheduling priority (`nice')\n" +" -f\tthe maximum size of files written by the shell and its children\n" +" -i\tthe maximum number of pending signals\n" +" -l\tthe maximum size a process may lock into memory\n" +" -m\tthe maximum resident set size\n" +" -n\tthe maximum number of open file descriptors\n" +" -p\tthe pipe buffer size\n" +" -q\tthe maximum number of bytes in POSIX message queues\n" +" -r\tthe maximum real-time scheduling priority\n" +" -s\tthe maximum stack size\n" +" -t\tthe maximum amount of cpu time in seconds\n" +" -u\tthe maximum number of user processes\n" +" -v\tthe size of virtual memory\n" +" -x\tthe maximum number of file locks\n" +" -T the maximum number of threads\n" +" \n" +" Not all options are available on all platforms.\n" +" \n" +" If LIMIT is given, it is the new value of the specified resource; the\n" +" special LIMIT values `soft', `hard', and `unlimited' stand for the\n" +" current soft limit, the current hard limit, and no limit, respectively.\n" +" Otherwise, the current value of the specified resource is printed. If\n" +" no option is given, then -f is assumed.\n" +" \n" +" Values are in 1024-byte increments, except for -t, which is in seconds,\n" +" -p, which is in increments of 512 bytes, and -u, which is an unscaled\n" +" number of processes.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1465 +msgid "" +"Display or set file mode mask.\n" +" \n" +" Sets the user file-creation mask to MODE. If MODE is omitted, prints\n" +" the current value of the mask.\n" +" \n" +" If MODE begins with a digit, it is interpreted as an octal number;\n" +" otherwise it is a symbolic mode string like that accepted by chmod(1).\n" +" \n" +" Options:\n" +" -p\tif MODE is omitted, output in a form that may be reused as input\n" +" -S\tmakes the output symbolic; otherwise an octal number is output\n" +" \n" +" Exit Status:\n" +" Returns success unless MODE is invalid or an invalid option is given." +msgstr "" + +#: builtins.c:1485 +msgid "" +"Wait for job completion and return exit status.\n" +" \n" +" Waits for each process identified by an ID, which may be a process ID or " +"a\n" +" job specification, and reports its termination status. If ID is not\n" +" given, waits for all currently active child processes, and the return\n" +" status is zero. If ID is a a job specification, waits for all " +"processes\n" +" in that job's pipeline.\n" +" \n" +" If the -n option is supplied, waits for the next job to terminate and\n" +" returns its exit status.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last ID; fails if ID is invalid or an invalid\n" +" option is given." +msgstr "" + +#: builtins.c:1506 +msgid "" +"Wait for process completion and return exit status.\n" +" \n" +" Waits for each process specified by a PID and reports its termination " +"status.\n" +" If PID is not given, waits for all currently active child processes,\n" +" and the return status is zero. PID must be a process ID.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last PID; fails if PID is invalid or an " +"invalid\n" +" option is given." +msgstr "" + +#: builtins.c:1521 +msgid "" +"Execute commands for each member in a list.\n" +" \n" +" The `for' loop executes a sequence of commands for each member in a\n" +" list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is\n" +" assumed. For each element in WORDS, NAME is set to that element, and\n" +" the COMMANDS are executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1535 +msgid "" +"Arithmetic for loop.\n" +" \n" +" Equivalent to\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n" +" omitted, it behaves as if it evaluates to 1.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1553 +msgid "" +"Select words from a list and execute commands.\n" +" \n" +" The WORDS are expanded, generating a list of words. The\n" +" set of expanded words is printed on the standard error, each\n" +" preceded by a number. If `in WORDS' is not present, `in \"$@\"'\n" +" is assumed. The PS3 prompt is then displayed and a line read\n" +" from the standard input. If the line consists of the number\n" +" corresponding to one of the displayed words, then NAME is set\n" +" to that word. If the line is empty, WORDS and the prompt are\n" +" redisplayed. If EOF is read, the command completes. Any other\n" +" value read causes NAME to be set to null. The line read is saved\n" +" in the variable REPLY. COMMANDS are executed after each selection\n" +" until a break command is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1574 +msgid "" +"Report time consumed by pipeline's execution.\n" +" \n" +" Execute PIPELINE and print a summary of the real time, user CPU time,\n" +" and system CPU time spent executing PIPELINE when it terminates.\n" +" \n" +" Options:\n" +" -p\tprint the timing summary in the portable Posix format\n" +" \n" +" The value of the TIMEFORMAT variable is used as the output format.\n" +" \n" +" Exit Status:\n" +" The return status is the return status of PIPELINE." +msgstr "" + +#: builtins.c:1591 +msgid "" +"Execute commands based on pattern matching.\n" +" \n" +" Selectively execute COMMANDS based upon WORD matching PATTERN. The\n" +" `|' is used to separate multiple patterns.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1603 +msgid "" +"Execute commands based on conditional.\n" +" \n" +" The `if COMMANDS' list is executed. If its exit status is zero, then " +"the\n" +" `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list " +"is\n" +" executed in turn, and if its exit status is zero, the corresponding\n" +" `then COMMANDS' list is executed and the if command completes. " +"Otherwise,\n" +" the `else COMMANDS' list is executed, if present. The exit status of " +"the\n" +" entire construct is the exit status of the last command executed, or " +"zero\n" +" if no condition tested true.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1620 +msgid "" +"Execute commands as long as a test succeeds.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `while' COMMANDS has an exit status of zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1632 +msgid "" +"Execute commands as long as a test does not succeed.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `until' COMMANDS has an exit status which is not zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1644 +msgid "" +"Create a coprocess named NAME.\n" +" \n" +" Execute COMMAND asynchronously, with the standard output and standard\n" +" input of the command connected via a pipe to file descriptors assigned\n" +" to indices 0 and 1 of an array variable NAME in the executing shell.\n" +" The default NAME is \"COPROC\".\n" +" \n" +" Exit Status:\n" +" Returns the exit status of COMMAND." +msgstr "" + +#: builtins.c:1658 +msgid "" +"Define shell function.\n" +" \n" +" Create a shell function named NAME. When invoked as a simple command,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is " +"invoked,\n" +" the arguments are passed to the function as $1...$n, and the function's\n" +" name is in $FUNCNAME.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is readonly." +msgstr "" + +#: builtins.c:1672 +msgid "" +"Group commands as a unit.\n" +" \n" +" Run a set of commands in a group. This is one way to redirect an\n" +" entire set of commands.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1684 +msgid "" +"Resume job in foreground.\n" +" \n" +" Equivalent to the JOB_SPEC argument to the `fg' command. Resume a\n" +" stopped or background job. JOB_SPEC can specify either a job name\n" +" or a job number. Following JOB_SPEC with a `&' places the job in\n" +" the background, as if the job specification had been supplied as an\n" +" argument to `bg'.\n" +" \n" +" Exit Status:\n" +" Returns the status of the resumed job." +msgstr "" + +#: builtins.c:1699 +msgid "" +"Evaluate arithmetic expression.\n" +" \n" +" The EXPRESSION is evaluated according to the rules for arithmetic\n" +" evaluation. Equivalent to \"let EXPRESSION\".\n" +" \n" +" Exit Status:\n" +" Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise." +msgstr "" + +#: builtins.c:1711 +msgid "" +"Execute conditional command.\n" +" \n" +" Returns a status of 0 or 1 depending on the evaluation of the " +"conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries " +"used\n" +" by the `test' builtin, and may be combined using the following " +"operators:\n" +" \n" +" ( EXPRESSION )\tReturns the value of EXPRESSION\n" +" ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" +" EXPR1 && EXPR2\tTrue if both EXPR1 and EXPR2 are true; else false\n" +" EXPR1 || EXPR2\tTrue if either EXPR1 or EXPR2 is true; else false\n" +" \n" +" When the `==' and `!=' operators are used, the string to the right of\n" +" the operator is used as a pattern and pattern matching is performed.\n" +" When the `=~' operator is used, the string to the right of the operator\n" +" is matched as a regular expression.\n" +" \n" +" The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n" +" determine the expression's value.\n" +" \n" +" Exit Status:\n" +" 0 or 1 depending on value of EXPRESSION." +msgstr "" + +#: builtins.c:1737 +msgid "" +"Common shell variable names and usage.\n" +" \n" +" BASH_VERSION\tVersion information for this Bash.\n" +" CDPATH\tA colon-separated list of directories to search\n" +" \t\tfor directories given as arguments to `cd'.\n" +" GLOBIGNORE\tA colon-separated list of patterns describing filenames to\n" +" \t\tbe ignored by pathname expansion.\n" +" HISTFILE\tThe name of the file where your command history is stored.\n" +" HISTFILESIZE\tThe maximum number of lines this file can contain.\n" +" HISTSIZE\tThe maximum number of history lines that a running\n" +" \t\tshell can access.\n" +" HOME\tThe complete pathname to your login directory.\n" +" HOSTNAME\tThe name of the current host.\n" +" HOSTTYPE\tThe type of CPU this version of Bash is running under.\n" +" IGNOREEOF\tControls the action of the shell on receipt of an EOF\n" +" \t\tcharacter as the sole input. If set, then the value\n" +" \t\tof it is the number of EOF characters that can be seen\n" +" \t\tin a row on an empty line before the shell will exit\n" +" \t\t(default 10). When unset, EOF signifies the end of input.\n" +" MACHTYPE\tA string describing the current system Bash is running on.\n" +" MAILCHECK\tHow often, in seconds, Bash checks for new mail.\n" +" MAILPATH\tA colon-separated list of filenames which Bash checks\n" +" \t\tfor new mail.\n" +" OSTYPE\tThe version of Unix this version of Bash is running on.\n" +" PATH\tA colon-separated list of directories to search when\n" +" \t\tlooking for commands.\n" +" PROMPT_COMMAND\tA command to be executed before the printing of each\n" +" \t\tprimary prompt.\n" +" PS1\t\tThe primary prompt string.\n" +" PS2\t\tThe secondary prompt string.\n" +" PWD\t\tThe full pathname of the current directory.\n" +" SHELLOPTS\tA colon-separated list of enabled shell options.\n" +" TERM\tThe name of the current terminal type.\n" +" TIMEFORMAT\tThe output format for timing statistics displayed by the\n" +" \t\t`time' reserved word.\n" +" auto_resume\tNon-null means a command word appearing on a line by\n" +" \t\titself is first looked for in the list of currently\n" +" \t\tstopped jobs. If found there, that job is foregrounded.\n" +" \t\tA value of `exact' means that the command word must\n" +" \t\texactly match a command in the list of stopped jobs. A\n" +" \t\tvalue of `substring' means that the command word must\n" +" \t\tmatch a substring of the job. Any other value means that\n" +" \t\tthe command must be a prefix of a stopped job.\n" +" histchars\tCharacters controlling history expansion and quick\n" +" \t\tsubstitution. The first character is the history\n" +" \t\tsubstitution character, usually `!'. The second is\n" +" \t\tthe `quick substitution' character, usually `^'. The\n" +" \t\tthird is the `history comment' character, usually `#'.\n" +" HISTIGNORE\tA colon-separated list of patterns used to decide which\n" +" \t\tcommands should be saved on the history list.\n" +msgstr "" + +#: builtins.c:1794 +msgid "" +"Add directories to stack.\n" +" \n" +" Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" + +#: builtins.c:1828 +msgid "" +"Remove directories from stack.\n" +" \n" +" Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" + +#: builtins.c:1858 +msgid "" +"Display directory stack.\n" +" \n" +" Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1887 +msgid "" +"Set and unset shell options.\n" +" \n" +" Change the setting of each shell option OPTNAME. Without any option\n" +" arguments, list all shell options with an indication of whether or not " +"each\n" +" is set.\n" +" \n" +" Options:\n" +" -o\trestrict OPTNAMEs to those defined for use with `set -o'\n" +" -p\tprint each shell option with an indication of its status\n" +" -q\tsuppress output\n" +" -s\tenable (set) each OPTNAME\n" +" -u\tdisable (unset) each OPTNAME\n" +" \n" +" Exit Status:\n" +" Returns success if OPTNAME is enabled; fails if an invalid option is\n" +" given or OPTNAME is disabled." +msgstr "" + +#: builtins.c:1908 +msgid "" +"Formats and prints ARGUMENTS under control of the FORMAT.\n" +" \n" +" Options:\n" +" -v var\tassign the output to shell variable VAR rather than\n" +" \t\tdisplay it on the standard output\n" +" \n" +" FORMAT is a character string which contains three types of objects: " +"plain\n" +" characters, which are simply copied to standard output; character " +"escape\n" +" sequences, which are converted and copied to the standard output; and\n" +" format specifications, each of which causes printing of the next " +"successive\n" +" argument.\n" +" \n" +" In addition to the standard format specifications described in " +"printf(1),\n" +" printf interprets:\n" +" \n" +" %b\texpand backslash escape sequences in the corresponding argument\n" +" %q\tquote the argument in a way that can be reused as shell input\n" +" %(fmt)T output the date-time string resulting from using FMT as a " +"format\n" +" string for strftime(3)\n" +" \n" +" The format is re-used as necessary to consume all of the arguments. If\n" +" there are fewer arguments than the format requires, extra format\n" +" specifications behave as if a zero value or null string, as " +"appropriate,\n" +" had been supplied.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a write or " +"assignment\n" +" error occurs." +msgstr "" + +#: builtins.c:1942 +msgid "" +"Specify how arguments are to be completed by Readline.\n" +" \n" +" For each NAME, specify how arguments are to be completed. If no " +"options\n" +" are supplied, existing completion specifications are printed in a way " +"that\n" +" allows them to be reused as input.\n" +" \n" +" Options:\n" +" -p\tprint existing completion specifications in a reusable format\n" +" -r\tremove a completion specification for each NAME, or, if no\n" +" \tNAMEs are supplied, all completion specifications\n" +" -D\tapply the completions and actions as the default for commands\n" +" \twithout any specific completion defined\n" +" -E\tapply the completions and actions to \"empty\" commands --\n" +" \tcompletion attempted on a blank line\n" +" \n" +" When completion is attempted, the actions are applied in the order the\n" +" uppercase-letter options are listed above. The -D option takes\n" +" precedence over -E.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1970 +msgid "" +"Display possible completions depending on the options.\n" +" \n" +" Intended to be used from within a shell function generating possible\n" +" completions. If the optional WORD argument is supplied, matches " +"against\n" +" WORD are generated.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1985 +msgid "" +"Modify or display completion options.\n" +" \n" +" Modify the completion options for each NAME, or, if no NAMEs are " +"supplied,\n" +" the completion currently being executed. If no OPTIONs are given, " +"print\n" +" the completion options for each NAME or the current completion " +"specification.\n" +" \n" +" Options:\n" +" \t-o option\tSet completion option OPTION for each NAME\n" +" \t-D\t\tChange options for the \"default\" command completion\n" +" \t-E\t\tChange options for the \"empty\" command completion\n" +" \n" +" Using `+o' instead of `-o' turns off the specified option.\n" +" \n" +" Arguments:\n" +" \n" +" Each NAME refers to a command for which a completion specification must\n" +" have previously been defined using the `complete' builtin. If no NAMEs\n" +" are supplied, compopt must be called by a function currently generating\n" +" completions, and the options for that currently-executing completion\n" +" generator are modified.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or NAME does not\n" +" have a completion specification defined." +msgstr "" + +#: builtins.c:2015 +msgid "" +"Read lines from the standard input into an indexed array variable.\n" +" \n" +" Read lines from the standard input into the indexed array variable " +"ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable " +"MAPFILE\n" +" is the default ARRAY.\n" +" \n" +" Options:\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are " +"copied.\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default " +"index is 0.\n" +" -s count \tDiscard the first COUNT lines read.\n" +" -t\t\tRemove a trailing newline from each line read.\n" +" -u fd\t\tRead lines from file descriptor FD instead of the standard " +"input.\n" +" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read.\n" +" -c quantum\tSpecify the number of lines read between each call to " +"CALLBACK.\n" +" \n" +" Arguments:\n" +" ARRAY\t\tArray variable name to use for file data.\n" +" \n" +" If -C is supplied without -c, the default quantum is 5000. When\n" +" CALLBACK is evaluated, it is supplied the index of the next array\n" +" element to be assigned and the line to be assigned to that element\n" +" as additional arguments.\n" +" \n" +" If not supplied with an explicit origin, mapfile will clear ARRAY " +"before\n" +" assigning to it.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or ARRAY is readonly " +"or\n" +" not an indexed array." +msgstr "" + +#: builtins.c:2049 +msgid "" +"Read lines from a file into an array variable.\n" +" \n" +" A synonym for `mapfile'." +msgstr "" +"Ανάγνωση γραμμών από αρχείο σε μεταβλητή τύπου πίνακα.\n" +" \n" +" Συνώνημο του «mapfile»." diff --git a/po/en@boldquot.gmo b/po/en@boldquot.gmo new file mode 100644 index 0000000000000000000000000000000000000000..5dd2d584d20cf04281ade00909b9cc62653a9601 GIT binary patch literal 165724 zcmeFa2bdgJmG@neZR|ESCWA37Wm&Q$OQU3LK#n76WDS-yW6j92F~-v~(=*ekr+eH% z!FVxo!GtBVEb%2SahHV!mYmk)%#vO*CdY*(E$_m?|A$(6aF?XO_FyzX{ za3#1LoCHq>Zw7A%J_EcB_!96hz*m8H20sMe8~iGGSMc}XUBJ6+NRkq`1|;j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Gshb(U$g}+$-mHuAizfwNH{_p+1z!Pdw`q^uT+@7fG@ z)8)6?o)MSO`)Y@kLi3!xCevTddK6a<6gaI_18=!kyBs0SmNr9J_OG`LC1a{jz;LfpwUy)e_lQ11Qxl z4+Zc^gznz%9ViQyG-n@^hW+MfqYzhuL+8_^I~6*`9av(V)J)4@fs`+Ug|O6x6s%2B z&xl$$A`!PJtaD;tOx8HO7`IwuY%MrBySSYFSlr&d+1)?XIw?4u&+pS8JABBCum?dw z+d#Ol3OD3=W+m#1;&|fsNt+US-8IAqyPC%hYrdB_YDdMMXS71tI`A>Nnskephm7D{ zZ9PwTdhBHu1H`wm61j=MAm!|OzVHa~!9TquVWMUBTpZ2MXb@3Sto&+*q~?4Imup3; zmun3f6NZ)-BL$W6ZagMoN|)lu{7_o$4>2S{J+=Z3!`qvYp^Hgk%&wiobyYPK`(x0$ z8iYQhM8ijyI-oDB-D;$)A$eGf6@PuA#Zs-u_Vp^si=ycJCI;<~T45Q-N7&O#)r-Ufbw5!Jg%a;AwvV=;xD zR{b?k;$sX&fu&hLC+`hW92*`Lk4Ach7zX? z`GX7A!F*_orQox_%|XAan~@y$ysxM7O6H@68N4Znw~x&^#f1!^9?@e7dpO=P#{$=f z@{O(GJsh?QWQTzwx!^M_ybKIbmAoEyEp3firGi+Gy(bTLH!3^VR*-;YD{)dLHhoby zfV*u0#9u(87yMKBE;M}8igPaU*H#x>5TN_H$v`~_`_VEd1qt%4XRrd3FU?2YW! zii4Da6&v;S{OgHAT{;a%D-{^z^Z5P#>oF(B0Xf`W(J=+J9KGS#O<^TeYhr+;`Yk6* z)ZZW+;qxLzmZX->KAH(;S55~`LkvIt2HNjEkpKVy literal 0 HcmV?d00001 diff --git a/po/en@boldquot.header b/po/en@boldquot.header new file mode 100644 index 0000000..fedb6a0 --- /dev/null +++ b/po/en@boldquot.header @@ -0,0 +1,25 @@ +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# +# This catalog furthermore displays the text between the quotation marks in +# bold face, assuming the VT100/XTerm escape sequences. +# diff --git a/po/en@boldquot.po b/po/en@boldquot.po new file mode 100644 index 0000000..05e6b8b --- /dev/null +++ b/po/en@boldquot.po @@ -0,0 +1,5649 @@ +# English translations for GNU bash package. +# Copyright (C) 2014 Free Software Foundation, Inc. +# This file is distributed under the same license as the GNU bash package. +# Automatically generated, 2014. +# +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# +# This catalog furthermore displays the text between the quotation marks in +# bold face, assuming the VT100/XTerm escape sequences. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU bash 4.3-release\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-02-11 11:19-0500\n" +"PO-Revision-Date: 2014-02-11 11:19-0500\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: en\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: arrayfunc.c:51 +msgid "bad array subscript" +msgstr "bad array subscript" + +#: arrayfunc.c:356 builtins/declare.def:566 +#, c-format +msgid "%s: cannot convert indexed to associative array" +msgstr "%s: cannot convert indexed to associative array" + +#: arrayfunc.c:539 +#, c-format +msgid "%s: invalid associative array key" +msgstr "%s: invalid associative array key" + +#: arrayfunc.c:541 +#, c-format +msgid "%s: cannot assign to non-numeric index" +msgstr "%s: cannot assign to non-numeric index" + +#: arrayfunc.c:586 +#, c-format +msgid "%s: %s: must use subscript when assigning associative array" +msgstr "%s: %s: must use subscript when assigning associative array" + +#: bashhist.c:388 +#, c-format +msgid "%s: cannot create: %s" +msgstr "%s: cannot create: %s" + +#: bashline.c:3982 +msgid "bash_execute_unix_command: cannot find keymap for command" +msgstr "bash_execute_unix_command: cannot find keymap for command" + +#: bashline.c:4069 +#, c-format +msgid "%s: first non-whitespace character is not `\"'" +msgstr "%s: first non-whitespace character is not ‘\"’" + +#: bashline.c:4098 +#, c-format +msgid "no closing `%c' in %s" +msgstr "no closing ‘%c’ in %s" + +#: bashline.c:4132 +#, c-format +msgid "%s: missing colon separator" +msgstr "%s: missing colon separator" + +#: braces.c:321 +#, c-format +msgid "brace expansion: cannot allocate memory for %s" +msgstr "brace expansion: cannot allocate memory for %s" + +#: braces.c:413 +#, c-format +msgid "brace expansion: failed to allocate memory for %d elements" +msgstr "brace expansion: failed to allocate memory for %d elements" + +#: braces.c:452 +#, c-format +msgid "brace expansion: failed to allocate memory for `%s'" +msgstr "brace expansion: failed to allocate memory for ‘%s’" + +#: builtins/alias.def:132 +#, c-format +msgid "`%s': invalid alias name" +msgstr "‘%s’: invalid alias name" + +#: builtins/bind.def:123 builtins/bind.def:126 +msgid "line editing not enabled" +msgstr "line editing not enabled" + +#: builtins/bind.def:212 +#, c-format +msgid "`%s': invalid keymap name" +msgstr "‘%s’: invalid keymap name" + +#: builtins/bind.def:251 +#, c-format +msgid "%s: cannot read: %s" +msgstr "%s: cannot read: %s" + +#: builtins/bind.def:266 +#, c-format +msgid "`%s': cannot unbind" +msgstr "‘%s’: cannot unbind" + +#: builtins/bind.def:304 builtins/bind.def:334 +#, c-format +msgid "`%s': unknown function name" +msgstr "‘%s’: unknown function name" + +#: builtins/bind.def:312 +#, c-format +msgid "%s is not bound to any keys.\n" +msgstr "%s is not bound to any keys.\n" + +#: builtins/bind.def:316 +#, c-format +msgid "%s can be invoked via " +msgstr "%s can be invoked via " + +#: builtins/break.def:77 builtins/break.def:117 +msgid "loop count" +msgstr "loop count" + +#: builtins/break.def:137 +msgid "only meaningful in a `for', `while', or `until' loop" +msgstr "only meaningful in a ‘for’, ‘while’, or ‘until’ loop" + +#: builtins/caller.def:134 +msgid "" +"Returns the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns " +msgstr "" +"Returns the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns " + +#: builtins/cd.def:319 +msgid "HOME not set" +msgstr "HOME not set" + +#: builtins/cd.def:327 builtins/common.c:166 test.c:876 +msgid "too many arguments" +msgstr "too many arguments" + +#: builtins/cd.def:338 +msgid "OLDPWD not set" +msgstr "OLDPWD not set" + +#: builtins/common.c:101 +#, c-format +msgid "line %d: " +msgstr "line %d: " + +#: builtins/common.c:139 error.c:265 +#, c-format +msgid "warning: " +msgstr "warning: " + +#: builtins/common.c:153 +#, c-format +msgid "%s: usage: " +msgstr "%s: usage: " + +#: builtins/common.c:191 shell.c:506 shell.c:788 +#, c-format +msgid "%s: option requires an argument" +msgstr "%s: option requires an argument" + +#: builtins/common.c:198 +#, c-format +msgid "%s: numeric argument required" +msgstr "%s: numeric argument required" + +#: builtins/common.c:205 +#, c-format +msgid "%s: not found" +msgstr "%s: not found" + +#: builtins/common.c:214 shell.c:801 +#, c-format +msgid "%s: invalid option" +msgstr "%s: invalid option" + +#: builtins/common.c:221 +#, c-format +msgid "%s: invalid option name" +msgstr "%s: invalid option name" + +#: builtins/common.c:228 general.c:235 general.c:240 +#, c-format +msgid "`%s': not a valid identifier" +msgstr "‘%s’: not a valid identifier" + +#: builtins/common.c:238 +msgid "invalid octal number" +msgstr "invalid octal number" + +#: builtins/common.c:240 +msgid "invalid hex number" +msgstr "invalid hex number" + +#: builtins/common.c:242 expr.c:1470 +msgid "invalid number" +msgstr "invalid number" + +#: builtins/common.c:250 +#, c-format +msgid "%s: invalid signal specification" +msgstr "%s: invalid signal specification" + +#: builtins/common.c:257 +#, c-format +msgid "`%s': not a pid or valid job spec" +msgstr "‘%s’: not a pid or valid job spec" + +#: builtins/common.c:264 error.c:488 +#, c-format +msgid "%s: readonly variable" +msgstr "%s: readonly variable" + +#: builtins/common.c:272 +#, c-format +msgid "%s: %s out of range" +msgstr "%s: %s out of range" + +#: builtins/common.c:272 builtins/common.c:274 +msgid "argument" +msgstr "argument" + +#: builtins/common.c:274 +#, c-format +msgid "%s out of range" +msgstr "%s out of range" + +#: builtins/common.c:282 +#, c-format +msgid "%s: no such job" +msgstr "%s: no such job" + +#: builtins/common.c:290 +#, c-format +msgid "%s: no job control" +msgstr "%s: no job control" + +#: builtins/common.c:292 +msgid "no job control" +msgstr "no job control" + +#: builtins/common.c:302 +#, c-format +msgid "%s: restricted" +msgstr "%s: restricted" + +#: builtins/common.c:304 +msgid "restricted" +msgstr "restricted" + +#: builtins/common.c:312 +#, c-format +msgid "%s: not a shell builtin" +msgstr "%s: not a shell builtin" + +#: builtins/common.c:321 +#, c-format +msgid "write error: %s" +msgstr "write error: %s" + +#: builtins/common.c:329 +#, c-format +msgid "error setting terminal attributes: %s" +msgstr "error setting terminal attributes: %s" + +#: builtins/common.c:331 +#, c-format +msgid "error getting terminal attributes: %s" +msgstr "error getting terminal attributes: %s" + +#: builtins/common.c:563 +#, c-format +msgid "%s: error retrieving current directory: %s: %s\n" +msgstr "%s: error retrieving current directory: %s: %s\n" + +#: builtins/common.c:629 builtins/common.c:631 +#, c-format +msgid "%s: ambiguous job spec" +msgstr "%s: ambiguous job spec" + +#: builtins/complete.def:277 +#, c-format +msgid "%s: invalid action name" +msgstr "%s: invalid action name" + +#: builtins/complete.def:450 builtins/complete.def:645 +#: builtins/complete.def:855 +#, c-format +msgid "%s: no completion specification" +msgstr "%s: no completion specification" + +#: builtins/complete.def:697 +msgid "warning: -F option may not work as you expect" +msgstr "warning: -F option may not work as you expect" + +#: builtins/complete.def:699 +msgid "warning: -C option may not work as you expect" +msgstr "warning: -C option may not work as you expect" + +#: builtins/complete.def:828 +msgid "not currently executing completion function" +msgstr "not currently executing completion function" + +#: builtins/declare.def:126 +msgid "can only be used in a function" +msgstr "can only be used in a function" + +#: builtins/declare.def:315 builtins/declare.def:509 +#, c-format +msgid "%s: reference variable cannot be an array" +msgstr "%s: reference variable cannot be an array" + +#: builtins/declare.def:324 +#, c-format +msgid "%s: nameref variable self references not allowed" +msgstr "%s: nameref variable self references not allowed" + +#: builtins/declare.def:398 +msgid "cannot use `-f' to make functions" +msgstr "cannot use ‘-f’ to make functions" + +#: builtins/declare.def:410 execute_cmd.c:5361 +#, c-format +msgid "%s: readonly function" +msgstr "%s: readonly function" + +#: builtins/declare.def:553 +#, c-format +msgid "%s: cannot destroy array variables in this way" +msgstr "%s: cannot destroy array variables in this way" + +#: builtins/declare.def:560 builtins/read.def:733 +#, c-format +msgid "%s: cannot convert associative to indexed array" +msgstr "%s: cannot convert associative to indexed array" + +#: builtins/enable.def:137 builtins/enable.def:145 +msgid "dynamic loading not available" +msgstr "dynamic loading not available" + +#: builtins/enable.def:312 +#, c-format +msgid "cannot open shared object %s: %s" +msgstr "cannot open shared object %s: %s" + +#: builtins/enable.def:335 +#, c-format +msgid "cannot find %s in shared object %s: %s" +msgstr "cannot find %s in shared object %s: %s" + +#: builtins/enable.def:459 +#, c-format +msgid "%s: not dynamically loaded" +msgstr "%s: not dynamically loaded" + +#: builtins/enable.def:474 +#, c-format +msgid "%s: cannot delete: %s" +msgstr "%s: cannot delete: %s" + +#: builtins/evalfile.c:140 builtins/hash.def:171 execute_cmd.c:5208 +#: shell.c:1481 +#, c-format +msgid "%s: is a directory" +msgstr "%s: is a directory" + +#: builtins/evalfile.c:146 +#, c-format +msgid "%s: not a regular file" +msgstr "%s: not a regular file" + +#: builtins/evalfile.c:155 +#, c-format +msgid "%s: file is too large" +msgstr "%s: file is too large" + +#: builtins/evalfile.c:190 builtins/evalfile.c:208 shell.c:1491 +#, c-format +msgid "%s: cannot execute binary file" +msgstr "%s: cannot execute binary file" + +#: builtins/exec.def:154 builtins/exec.def:156 builtins/exec.def:228 +#, c-format +msgid "%s: cannot execute: %s" +msgstr "%s: cannot execute: %s" + +#: builtins/exit.def:65 +#, c-format +msgid "logout\n" +msgstr "logout\n" + +#: builtins/exit.def:88 +msgid "not login shell: use `exit'" +msgstr "not login shell: use ‘exit’" + +#: builtins/exit.def:120 +#, c-format +msgid "There are stopped jobs.\n" +msgstr "There are stopped jobs.\n" + +#: builtins/exit.def:122 +#, c-format +msgid "There are running jobs.\n" +msgstr "There are running jobs.\n" + +#: builtins/fc.def:262 +msgid "no command found" +msgstr "no command found" + +#: builtins/fc.def:320 builtins/fc.def:369 +msgid "history specification" +msgstr "history specification" + +#: builtins/fc.def:390 +#, c-format +msgid "%s: cannot open temp file: %s" +msgstr "%s: cannot open temp file: %s" + +#: builtins/fg_bg.def:149 builtins/jobs.def:282 +msgid "current" +msgstr "current" + +#: builtins/fg_bg.def:158 +#, c-format +msgid "job %d started without job control" +msgstr "job %d started without job control" + +#: builtins/getopt.c:110 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: illegal option -- %c\n" + +#: builtins/getopt.c:111 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: option requires an argument -- %c\n" + +#: builtins/hash.def:92 +msgid "hashing disabled" +msgstr "hashing disabled" + +#: builtins/hash.def:138 +#, c-format +msgid "%s: hash table empty\n" +msgstr "%s: hash table empty\n" + +#: builtins/hash.def:245 +#, c-format +msgid "hits\tcommand\n" +msgstr "hits\tcommand\n" + +#: builtins/help.def:130 +#, c-format +msgid "Shell commands matching keyword `" +msgid_plural "Shell commands matching keywords `" +msgstr[0] "Shell commands matching keyword `" +msgstr[1] "Shell commands matching keywords `" + +#: builtins/help.def:182 +#, c-format +msgid "" +"no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." +msgstr "" +"no help topics match ‘%s’. Try ‘help help’ or ‘man -k %s’ " +"or ‘info %s’." + +#: builtins/help.def:199 +#, c-format +msgid "%s: cannot open: %s" +msgstr "%s: cannot open: %s" + +#: builtins/help.def:485 +#, c-format +msgid "" +"These shell commands are defined internally. Type `help' to see this list.\n" +"Type `help name' to find out more about the function `name'.\n" +"Use `info bash' to find out more about the shell in general.\n" +"Use `man -k' or `info' to find out more about commands not in this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" +msgstr "" +"These shell commands are defined internally. Type ‘help’ to see this " +"list.\n" +"Type ‘help name’ to find out more about the function ‘name’.\n" +"Use ‘info bash’ to find out more about the shell in general.\n" +"Use ‘man -k’ or ‘info’ to find out more about commands not in " +"this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" + +#: builtins/history.def:154 +msgid "cannot use more than one of -anrw" +msgstr "cannot use more than one of -anrw" + +#: builtins/history.def:186 +msgid "history position" +msgstr "history position" + +#: builtins/history.def:366 +#, c-format +msgid "%s: history expansion failed" +msgstr "%s: history expansion failed" + +#: builtins/inlib.def:71 +#, c-format +msgid "%s: inlib failed" +msgstr "%s: inlib failed" + +#: builtins/jobs.def:109 +msgid "no other options allowed with `-x'" +msgstr "no other options allowed with ‘-x’" + +#: builtins/kill.def:200 +#, c-format +msgid "%s: arguments must be process or job IDs" +msgstr "%s: arguments must be process or job IDs" + +#: builtins/kill.def:263 +msgid "Unknown error" +msgstr "Unknown error" + +#: builtins/let.def:95 builtins/let.def:120 expr.c:583 expr.c:598 +msgid "expression expected" +msgstr "expression expected" + +#: builtins/mapfile.def:172 +#, c-format +msgid "%s: not an indexed array" +msgstr "%s: not an indexed array" + +#: builtins/mapfile.def:259 builtins/read.def:302 +#, c-format +msgid "%s: invalid file descriptor specification" +msgstr "%s: invalid file descriptor specification" + +#: builtins/mapfile.def:267 builtins/read.def:309 +#, c-format +msgid "%d: invalid file descriptor: %s" +msgstr "%d: invalid file descriptor: %s" + +#: builtins/mapfile.def:276 builtins/mapfile.def:314 +#, c-format +msgid "%s: invalid line count" +msgstr "%s: invalid line count" + +#: builtins/mapfile.def:287 +#, c-format +msgid "%s: invalid array origin" +msgstr "%s: invalid array origin" + +#: builtins/mapfile.def:304 +#, c-format +msgid "%s: invalid callback quantum" +msgstr "%s: invalid callback quantum" + +#: builtins/mapfile.def:336 +msgid "empty array variable name" +msgstr "empty array variable name" + +#: builtins/mapfile.def:357 +msgid "array variable support required" +msgstr "array variable support required" + +#: builtins/printf.def:402 +#, c-format +msgid "`%s': missing format character" +msgstr "‘%s’: missing format character" + +#: builtins/printf.def:456 +#, c-format +msgid "`%c': invalid time format specification" +msgstr "‘%c’: invalid time format specification" + +#: builtins/printf.def:658 +#, c-format +msgid "`%c': invalid format character" +msgstr "‘%c’: invalid format character" + +#: builtins/printf.def:684 +#, c-format +msgid "warning: %s: %s" +msgstr "warning: %s: %s" + +#: builtins/printf.def:768 +#, c-format +msgid "format parsing problem: %s" +msgstr "format parsing problem: %s" + +#: builtins/printf.def:865 +msgid "missing hex digit for \\x" +msgstr "missing hex digit for \\x" + +#: builtins/printf.def:880 +#, c-format +msgid "missing unicode digit for \\%c" +msgstr "missing unicode digit for \\%c" + +#: builtins/pushd.def:195 +msgid "no other directory" +msgstr "no other directory" + +#: builtins/pushd.def:354 +#, c-format +msgid "%s: invalid argument" +msgstr "%s: invalid argument" + +#: builtins/pushd.def:468 +msgid "" +msgstr "" + +#: builtins/pushd.def:512 +msgid "directory stack empty" +msgstr "directory stack empty" + +#: builtins/pushd.def:514 +msgid "directory stack index" +msgstr "directory stack index" + +#: builtins/pushd.def:689 +msgid "" +"Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +"\tdirs when invoked without options, starting with zero." +msgstr "" +"Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the ‘pushd’ command; you can " +"get\n" +" back up through the list with the ‘popd’ command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +"\tdirs when invoked without options, starting with zero." + +#: builtins/pushd.def:711 +msgid "" +"Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by ‘dirs’, starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by ‘dirs’, starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The ‘dirs’ builtin displays the directory stack." + +#: builtins/pushd.def:736 +msgid "" +"Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by ‘dirs’, starting with zero. For example: ‘popd " +"+0’\n" +" \tremoves the first directory, ‘popd +1’ the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by ‘dirs’, starting with zero. For example: ‘popd " +"-0’\n" +" \tremoves the last directory, ‘popd -1’ the next to last.\n" +" \n" +" The ‘dirs’ builtin displays the directory stack." + +#: builtins/read.def:275 +#, c-format +msgid "%s: invalid timeout specification" +msgstr "%s: invalid timeout specification" + +#: builtins/read.def:678 +#, c-format +msgid "read error: %d: %s" +msgstr "read error: %d: %s" + +#: builtins/return.def:75 +msgid "can only `return' from a function or sourced script" +msgstr "can only ‘return’ from a function or sourced script" + +#: builtins/set.def:782 +msgid "cannot simultaneously unset a function and a variable" +msgstr "cannot simultaneously unset a function and a variable" + +#: builtins/set.def:826 +#, c-format +msgid "%s: cannot unset" +msgstr "%s: cannot unset" + +#: builtins/set.def:843 +#, c-format +msgid "%s: cannot unset: readonly %s" +msgstr "%s: cannot unset: readonly %s" + +#: builtins/set.def:854 +#, c-format +msgid "%s: not an array variable" +msgstr "%s: not an array variable" + +#: builtins/setattr.def:187 +#, c-format +msgid "%s: not a function" +msgstr "%s: not a function" + +#: builtins/shift.def:71 builtins/shift.def:77 +msgid "shift count" +msgstr "shift count" + +#: builtins/shopt.def:279 +msgid "cannot set and unset shell options simultaneously" +msgstr "cannot set and unset shell options simultaneously" + +#: builtins/shopt.def:346 +#, c-format +msgid "%s: invalid shell option name" +msgstr "%s: invalid shell option name" + +#: builtins/source.def:130 +msgid "filename argument required" +msgstr "filename argument required" + +#: builtins/source.def:155 +#, c-format +msgid "%s: file not found" +msgstr "%s: file not found" + +#: builtins/suspend.def:101 +msgid "cannot suspend" +msgstr "cannot suspend" + +#: builtins/suspend.def:111 +msgid "cannot suspend a login shell" +msgstr "cannot suspend a login shell" + +#: builtins/type.def:234 +#, c-format +msgid "%s is aliased to `%s'\n" +msgstr "%s is aliased to ‘%s’\n" + +#: builtins/type.def:255 +#, c-format +msgid "%s is a shell keyword\n" +msgstr "%s is a shell keyword\n" + +#: builtins/type.def:274 +#, c-format +msgid "%s is a function\n" +msgstr "%s is a function\n" + +#: builtins/type.def:296 +#, c-format +msgid "%s is a shell builtin\n" +msgstr "%s is a shell builtin\n" + +#: builtins/type.def:317 builtins/type.def:393 +#, c-format +msgid "%s is %s\n" +msgstr "%s is %s\n" + +#: builtins/type.def:337 +#, c-format +msgid "%s is hashed (%s)\n" +msgstr "%s is hashed (%s)\n" + +#: builtins/ulimit.def:383 +#, c-format +msgid "%s: invalid limit argument" +msgstr "%s: invalid limit argument" + +#: builtins/ulimit.def:409 +#, c-format +msgid "`%c': bad command" +msgstr "‘%c’: bad command" + +#: builtins/ulimit.def:438 +#, c-format +msgid "%s: cannot get limit: %s" +msgstr "%s: cannot get limit: %s" + +#: builtins/ulimit.def:464 +msgid "limit" +msgstr "limit" + +#: builtins/ulimit.def:476 builtins/ulimit.def:776 +#, c-format +msgid "%s: cannot modify limit: %s" +msgstr "%s: cannot modify limit: %s" + +#: builtins/umask.def:114 +msgid "octal number" +msgstr "octal number" + +#: builtins/umask.def:227 +#, c-format +msgid "`%c': invalid symbolic mode operator" +msgstr "‘%c’: invalid symbolic mode operator" + +#: builtins/umask.def:282 +#, c-format +msgid "`%c': invalid symbolic mode character" +msgstr "‘%c’: invalid symbolic mode character" + +#: error.c:90 error.c:325 error.c:327 error.c:329 +msgid " line " +msgstr " line " + +#: error.c:165 +#, c-format +msgid "last command: %s\n" +msgstr "last command: %s\n" + +#: error.c:173 +#, c-format +msgid "Aborting..." +msgstr "Aborting..." + +#: error.c:440 +msgid "unknown command error" +msgstr "unknown command error" + +#: error.c:441 +msgid "bad command type" +msgstr "bad command type" + +#: error.c:442 +msgid "bad connector" +msgstr "bad connector" + +#: error.c:443 +msgid "bad jump" +msgstr "bad jump" + +#: error.c:481 +#, c-format +msgid "%s: unbound variable" +msgstr "%s: unbound variable" + +#: eval.c:189 +#, c-format +msgid "\atimed out waiting for input: auto-logout\n" +msgstr "\atimed out waiting for input: auto-logout\n" + +#: execute_cmd.c:512 +#, c-format +msgid "cannot redirect standard input from /dev/null: %s" +msgstr "cannot redirect standard input from /dev/null: %s" + +#: execute_cmd.c:1233 +#, c-format +msgid "TIMEFORMAT: `%c': invalid format character" +msgstr "TIMEFORMAT: ‘%c’: invalid format character" + +#: execute_cmd.c:2287 +msgid "pipe error" +msgstr "pipe error" + +#: execute_cmd.c:4386 +#, c-format +msgid "%s: maximum function nesting level exceeded (%d)" +msgstr "%s: maximum function nesting level exceeded (%d)" + +#: execute_cmd.c:4884 +#, c-format +msgid "%s: restricted: cannot specify `/' in command names" +msgstr "%s: restricted: cannot specify ‘/’ in command names" + +#: execute_cmd.c:4973 +#, c-format +msgid "%s: command not found" +msgstr "%s: command not found" + +#: execute_cmd.c:5206 +#, c-format +msgid "%s: %s" +msgstr "%s: %s" + +#: execute_cmd.c:5243 +#, c-format +msgid "%s: %s: bad interpreter" +msgstr "%s: %s: bad interpreter" + +#: execute_cmd.c:5280 +#, c-format +msgid "%s: cannot execute binary file: %s" +msgstr "%s: cannot execute binary file: %s" + +#: execute_cmd.c:5352 +#, c-format +msgid "`%s': is a special builtin" +msgstr "‘%s’: is a special builtin" + +#: execute_cmd.c:5404 +#, c-format +msgid "cannot duplicate fd %d to fd %d" +msgstr "cannot duplicate fd %d to fd %d" + +#: expr.c:259 +msgid "expression recursion level exceeded" +msgstr "expression recursion level exceeded" + +#: expr.c:283 +msgid "recursion stack underflow" +msgstr "recursion stack underflow" + +#: expr.c:431 +msgid "syntax error in expression" +msgstr "syntax error in expression" + +#: expr.c:475 +msgid "attempted assignment to non-variable" +msgstr "attempted assignment to non-variable" + +#: expr.c:495 expr.c:858 +msgid "division by 0" +msgstr "division by 0" + +#: expr.c:542 +msgid "bug: bad expassign token" +msgstr "bug: bad expassign token" + +#: expr.c:595 +msgid "`:' expected for conditional expression" +msgstr "‘:’ expected for conditional expression" + +#: expr.c:919 +msgid "exponent less than 0" +msgstr "exponent less than 0" + +#: expr.c:976 +msgid "identifier expected after pre-increment or pre-decrement" +msgstr "identifier expected after pre-increment or pre-decrement" + +#: expr.c:1002 +msgid "missing `)'" +msgstr "missing ‘)’" + +#: expr.c:1053 expr.c:1390 +msgid "syntax error: operand expected" +msgstr "syntax error: operand expected" + +#: expr.c:1392 +msgid "syntax error: invalid arithmetic operator" +msgstr "syntax error: invalid arithmetic operator" + +#: expr.c:1416 +#, c-format +msgid "%s%s%s: %s (error token is \"%s\")" +msgstr "%s%s%s: %s (error token is “%s”)" + +#: expr.c:1474 +msgid "invalid arithmetic base" +msgstr "invalid arithmetic base" + +#: expr.c:1494 +msgid "value too great for base" +msgstr "value too great for base" + +#: expr.c:1543 +#, c-format +msgid "%s: expression error\n" +msgstr "%s: expression error\n" + +#: general.c:62 +msgid "getcwd: cannot access parent directories" +msgstr "getcwd: cannot access parent directories" + +#: input.c:102 subst.c:5168 +#, c-format +msgid "cannot reset nodelay mode for fd %d" +msgstr "cannot reset nodelay mode for fd %d" + +#: input.c:271 +#, c-format +msgid "cannot allocate new file descriptor for bash input from fd %d" +msgstr "cannot allocate new file descriptor for bash input from fd %d" + +#: input.c:279 +#, c-format +msgid "save_bash_input: buffer already exists for new fd %d" +msgstr "save_bash_input: buffer already exists for new fd %d" + +#: jobs.c:471 +msgid "start_pipeline: pgrp pipe" +msgstr "start_pipeline: pgrp pipe" + +#: jobs.c:893 +#, c-format +msgid "forked pid %d appears in running job %d" +msgstr "forked pid %d appears in running job %d" + +#: jobs.c:1012 +#, c-format +msgid "deleting stopped job %d with process group %ld" +msgstr "deleting stopped job %d with process group %ld" + +#: jobs.c:1117 +#, c-format +msgid "add_process: process %5ld (%s) in the_pipeline" +msgstr "add_process: process %5ld (%s) in the_pipeline" + +#: jobs.c:1120 +#, c-format +msgid "add_process: pid %5ld (%s) marked as still alive" +msgstr "add_process: pid %5ld (%s) marked as still alive" + +#: jobs.c:1435 +#, c-format +msgid "describe_pid: %ld: no such pid" +msgstr "describe_pid: %ld: no such pid" + +#: jobs.c:1450 +#, c-format +msgid "Signal %d" +msgstr "Signal %d" + +#: jobs.c:1464 jobs.c:1489 +msgid "Done" +msgstr "Done" + +#: jobs.c:1469 siglist.c:123 +msgid "Stopped" +msgstr "Stopped" + +#: jobs.c:1473 +#, c-format +msgid "Stopped(%s)" +msgstr "Stopped(%s)" + +#: jobs.c:1477 +msgid "Running" +msgstr "Running" + +#: jobs.c:1491 +#, c-format +msgid "Done(%d)" +msgstr "Done(%d)" + +#: jobs.c:1493 +#, c-format +msgid "Exit %d" +msgstr "Exit %d" + +#: jobs.c:1496 +msgid "Unknown status" +msgstr "Unknown status" + +#: jobs.c:1583 +#, c-format +msgid "(core dumped) " +msgstr "(core dumped) " + +#: jobs.c:1602 +#, c-format +msgid " (wd: %s)" +msgstr " (wd: %s)" + +#: jobs.c:1819 +#, c-format +msgid "child setpgid (%ld to %ld)" +msgstr "child setpgid (%ld to %ld)" + +#: jobs.c:2138 nojobs.c:605 +#, c-format +msgid "wait: pid %ld is not a child of this shell" +msgstr "wait: pid %ld is not a child of this shell" + +#: jobs.c:2385 +#, c-format +msgid "wait_for: No record of process %ld" +msgstr "wait_for: No record of process %ld" + +#: jobs.c:2694 +#, c-format +msgid "wait_for_job: job %d is stopped" +msgstr "wait_for_job: job %d is stopped" + +#: jobs.c:2986 +#, c-format +msgid "%s: job has terminated" +msgstr "%s: job has terminated" + +#: jobs.c:2995 +#, c-format +msgid "%s: job %d already in background" +msgstr "%s: job %d already in background" + +#: jobs.c:3220 +msgid "waitchld: turning on WNOHANG to avoid indefinite block" +msgstr "waitchld: turning on WNOHANG to avoid indefinite block" + +#: jobs.c:3711 +#, c-format +msgid "%s: line %d: " +msgstr "%s: line %d: " + +#: jobs.c:3725 nojobs.c:843 +#, c-format +msgid " (core dumped)" +msgstr " (core dumped)" + +#: jobs.c:3737 jobs.c:3750 +#, c-format +msgid "(wd now: %s)\n" +msgstr "(wd now: %s)\n" + +#: jobs.c:3782 +msgid "initialize_job_control: getpgrp failed" +msgstr "initialize_job_control: getpgrp failed" + +#: jobs.c:3843 +msgid "initialize_job_control: line discipline" +msgstr "initialize_job_control: line discipline" + +#: jobs.c:3853 +msgid "initialize_job_control: setpgid" +msgstr "initialize_job_control: setpgid" + +#: jobs.c:3874 jobs.c:3883 +#, c-format +msgid "cannot set terminal process group (%d)" +msgstr "cannot set terminal process group (%d)" + +#: jobs.c:3888 +msgid "no job control in this shell" +msgstr "no job control in this shell" + +#: lib/malloc/malloc.c:296 +#, c-format +msgid "malloc: failed assertion: %s\n" +msgstr "malloc: failed assertion: %s\n" + +#: lib/malloc/malloc.c:312 +#, c-format +msgid "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" +msgstr "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" + +#: lib/malloc/malloc.c:313 +msgid "unknown" +msgstr "unknown" + +#: lib/malloc/malloc.c:801 +msgid "malloc: block on free list clobbered" +msgstr "malloc: block on free list clobbered" + +#: lib/malloc/malloc.c:878 +msgid "free: called with already freed block argument" +msgstr "free: called with already freed block argument" + +#: lib/malloc/malloc.c:881 +msgid "free: called with unallocated block argument" +msgstr "free: called with unallocated block argument" + +#: lib/malloc/malloc.c:900 +msgid "free: underflow detected; mh_nbytes out of range" +msgstr "free: underflow detected; mh_nbytes out of range" + +#: lib/malloc/malloc.c:906 +msgid "free: start and end chunk sizes differ" +msgstr "free: start and end chunk sizes differ" + +#: lib/malloc/malloc.c:1005 +msgid "realloc: called with unallocated block argument" +msgstr "realloc: called with unallocated block argument" + +#: lib/malloc/malloc.c:1020 +msgid "realloc: underflow detected; mh_nbytes out of range" +msgstr "realloc: underflow detected; mh_nbytes out of range" + +#: lib/malloc/malloc.c:1026 +msgid "realloc: start and end chunk sizes differ" +msgstr "realloc: start and end chunk sizes differ" + +#: lib/malloc/table.c:194 +#, c-format +msgid "register_alloc: alloc table is full with FIND_ALLOC?\n" +msgstr "register_alloc: alloc table is full with FIND_ALLOC?\n" + +#: lib/malloc/table.c:203 +#, c-format +msgid "register_alloc: %p already in table as allocated?\n" +msgstr "register_alloc: %p already in table as allocated?\n" + +#: lib/malloc/table.c:256 +#, c-format +msgid "register_free: %p already in table as free?\n" +msgstr "register_free: %p already in table as free?\n" + +#: lib/sh/fmtulong.c:102 +msgid "invalid base" +msgstr "invalid base" + +#: lib/sh/netopen.c:168 +#, c-format +msgid "%s: host unknown" +msgstr "%s: host unknown" + +#: lib/sh/netopen.c:175 +#, c-format +msgid "%s: invalid service" +msgstr "%s: invalid service" + +#: lib/sh/netopen.c:306 +#, c-format +msgid "%s: bad network path specification" +msgstr "%s: bad network path specification" + +#: lib/sh/netopen.c:346 +msgid "network operations not supported" +msgstr "network operations not supported" + +#: locale.c:200 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s)" +msgstr "setlocale: LC_ALL: cannot change locale (%s)" + +#: locale.c:202 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s): %s" +msgstr "setlocale: LC_ALL: cannot change locale (%s): %s" + +#: locale.c:259 +#, c-format +msgid "setlocale: %s: cannot change locale (%s)" +msgstr "setlocale: %s: cannot change locale (%s)" + +#: locale.c:261 +#, c-format +msgid "setlocale: %s: cannot change locale (%s): %s" +msgstr "setlocale: %s: cannot change locale (%s): %s" + +#: mailcheck.c:439 +msgid "You have mail in $_" +msgstr "You have mail in $_" + +#: mailcheck.c:464 +msgid "You have new mail in $_" +msgstr "You have new mail in $_" + +#: mailcheck.c:480 +#, c-format +msgid "The mail in %s has been read\n" +msgstr "The mail in %s has been read\n" + +#: make_cmd.c:323 +msgid "syntax error: arithmetic expression required" +msgstr "syntax error: arithmetic expression required" + +#: make_cmd.c:325 +msgid "syntax error: `;' unexpected" +msgstr "syntax error: ‘;’ unexpected" + +#: make_cmd.c:326 +#, c-format +msgid "syntax error: `((%s))'" +msgstr "syntax error: ‘((%s))’" + +#: make_cmd.c:578 +#, c-format +msgid "make_here_document: bad instruction type %d" +msgstr "make_here_document: bad instruction type %d" + +#: make_cmd.c:662 +#, c-format +msgid "here-document at line %d delimited by end-of-file (wanted `%s')" +msgstr "here-document at line %d delimited by end-of-file (wanted ‘%s’)" + +#: make_cmd.c:759 +#, c-format +msgid "make_redirection: redirection instruction `%d' out of range" +msgstr "make_redirection: redirection instruction ‘%d’ out of range" + +#: parse.y:3278 parse.y:3561 +#, c-format +msgid "unexpected EOF while looking for matching `%c'" +msgstr "unexpected EOF while looking for matching ‘%c’" + +#: parse.y:4170 +msgid "unexpected EOF while looking for `]]'" +msgstr "unexpected EOF while looking for ‘]]’" + +#: parse.y:4175 +#, c-format +msgid "syntax error in conditional expression: unexpected token `%s'" +msgstr "syntax error in conditional expression: unexpected token ‘%s’" + +#: parse.y:4179 +msgid "syntax error in conditional expression" +msgstr "syntax error in conditional expression" + +#: parse.y:4257 +#, c-format +msgid "unexpected token `%s', expected `)'" +msgstr "unexpected token ‘%s’, expected ‘)’" + +#: parse.y:4261 +msgid "expected `)'" +msgstr "expected ‘)’" + +#: parse.y:4289 +#, c-format +msgid "unexpected argument `%s' to conditional unary operator" +msgstr "unexpected argument ‘%s’ to conditional unary operator" + +#: parse.y:4293 +msgid "unexpected argument to conditional unary operator" +msgstr "unexpected argument to conditional unary operator" + +#: parse.y:4339 +#, c-format +msgid "unexpected token `%s', conditional binary operator expected" +msgstr "unexpected token ‘%s’, conditional binary operator expected" + +#: parse.y:4343 +msgid "conditional binary operator expected" +msgstr "conditional binary operator expected" + +#: parse.y:4365 +#, c-format +msgid "unexpected argument `%s' to conditional binary operator" +msgstr "unexpected argument ‘%s’ to conditional binary operator" + +#: parse.y:4369 +msgid "unexpected argument to conditional binary operator" +msgstr "unexpected argument to conditional binary operator" + +#: parse.y:4380 +#, c-format +msgid "unexpected token `%c' in conditional command" +msgstr "unexpected token ‘%c’ in conditional command" + +#: parse.y:4383 +#, c-format +msgid "unexpected token `%s' in conditional command" +msgstr "unexpected token ‘%s’ in conditional command" + +#: parse.y:4387 +#, c-format +msgid "unexpected token %d in conditional command" +msgstr "unexpected token %d in conditional command" + +#: parse.y:5737 +#, c-format +msgid "syntax error near unexpected token `%s'" +msgstr "syntax error near unexpected token ‘%s’" + +#: parse.y:5755 +#, c-format +msgid "syntax error near `%s'" +msgstr "syntax error near ‘%s’" + +#: parse.y:5765 +msgid "syntax error: unexpected end of file" +msgstr "syntax error: unexpected end of file" + +#: parse.y:5765 +msgid "syntax error" +msgstr "syntax error" + +#: parse.y:5827 +#, c-format +msgid "Use \"%s\" to leave the shell.\n" +msgstr "Use “%s” to leave the shell.\n" + +#: parse.y:5989 +msgid "unexpected EOF while looking for matching `)'" +msgstr "unexpected EOF while looking for matching ‘)’" + +#: pcomplete.c:1094 +#, c-format +msgid "completion: function `%s' not found" +msgstr "completion: function ‘%s’ not found" + +#: pcomplib.c:182 +#, c-format +msgid "progcomp_insert: %s: NULL COMPSPEC" +msgstr "progcomp_insert: %s: NULL COMPSPEC" + +#: print_cmd.c:300 +#, c-format +msgid "print_command: bad connector `%d'" +msgstr "print_command: bad connector ‘%d’" + +#: print_cmd.c:373 +#, c-format +msgid "xtrace_set: %d: invalid file descriptor" +msgstr "xtrace_set: %d: invalid file descriptor" + +#: print_cmd.c:378 +msgid "xtrace_set: NULL file pointer" +msgstr "xtrace_set: NULL file pointer" + +#: print_cmd.c:382 +#, c-format +msgid "xtrace fd (%d) != fileno xtrace fp (%d)" +msgstr "xtrace fd (%d) != fileno xtrace fp (%d)" + +#: print_cmd.c:1518 +#, c-format +msgid "cprintf: `%c': invalid format character" +msgstr "cprintf: ‘%c’: invalid format character" + +#: redir.c:123 redir.c:170 +msgid "file descriptor out of range" +msgstr "file descriptor out of range" + +#: redir.c:177 +#, c-format +msgid "%s: ambiguous redirect" +msgstr "%s: ambiguous redirect" + +#: redir.c:181 +#, c-format +msgid "%s: cannot overwrite existing file" +msgstr "%s: cannot overwrite existing file" + +#: redir.c:186 +#, c-format +msgid "%s: restricted: cannot redirect output" +msgstr "%s: restricted: cannot redirect output" + +#: redir.c:191 +#, c-format +msgid "cannot create temp file for here-document: %s" +msgstr "cannot create temp file for here-document: %s" + +#: redir.c:195 +#, c-format +msgid "%s: cannot assign fd to variable" +msgstr "%s: cannot assign fd to variable" + +#: redir.c:582 +msgid "/dev/(tcp|udp)/host/port not supported without networking" +msgstr "/dev/(tcp|udp)/host/port not supported without networking" + +#: redir.c:861 redir.c:973 redir.c:1034 redir.c:1199 +msgid "redirection error: cannot duplicate fd" +msgstr "redirection error: cannot duplicate fd" + +#: shell.c:339 +msgid "could not find /tmp, please create!" +msgstr "could not find /tmp, please create!" + +#: shell.c:343 +msgid "/tmp must be a valid directory name" +msgstr "/tmp must be a valid directory name" + +#: shell.c:890 +#, c-format +msgid "%c%c: invalid option" +msgstr "%c%c: invalid option" + +#: shell.c:1682 +msgid "I have no name!" +msgstr "I have no name!" + +#: shell.c:1827 +#, c-format +msgid "GNU bash, version %s-(%s)\n" +msgstr "GNU bash, version %s-(%s)\n" + +#: shell.c:1828 +#, c-format +msgid "" +"Usage:\t%s [GNU long option] [option] ...\n" +"\t%s [GNU long option] [option] script-file ...\n" +msgstr "" +"Usage:\t%s [GNU long option] [option] ...\n" +"\t%s [GNU long option] [option] script-file ...\n" + +#: shell.c:1830 +msgid "GNU long options:\n" +msgstr "GNU long options:\n" + +#: shell.c:1834 +msgid "Shell options:\n" +msgstr "Shell options:\n" + +#: shell.c:1835 +msgid "\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n" +msgstr "\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n" + +#: shell.c:1850 +#, c-format +msgid "\t-%s or -o option\n" +msgstr "\t-%s or -o option\n" + +#: shell.c:1856 +#, c-format +msgid "Type `%s -c \"help set\"' for more information about shell options.\n" +msgstr "" +"Type ‘%s -c “help set”’ for more information about shell " +"options.\n" + +#: shell.c:1857 +#, c-format +msgid "Type `%s -c help' for more information about shell builtin commands.\n" +msgstr "" +"Type ‘%s -c help’ for more information about shell builtin commands.\n" + +#: shell.c:1858 +#, c-format +msgid "Use the `bashbug' command to report bugs.\n" +msgstr "Use the ‘bashbug’ command to report bugs.\n" + +#: sig.c:691 +#, c-format +msgid "sigprocmask: %d: invalid operation" +msgstr "sigprocmask: %d: invalid operation" + +#: siglist.c:48 +msgid "Bogus signal" +msgstr "Bogus signal" + +#: siglist.c:51 +msgid "Hangup" +msgstr "Hangup" + +#: siglist.c:55 +msgid "Interrupt" +msgstr "Interrupt" + +#: siglist.c:59 +msgid "Quit" +msgstr "Quit" + +#: siglist.c:63 +msgid "Illegal instruction" +msgstr "Illegal instruction" + +#: siglist.c:67 +msgid "BPT trace/trap" +msgstr "BPT trace/trap" + +#: siglist.c:75 +msgid "ABORT instruction" +msgstr "ABORT instruction" + +#: siglist.c:79 +msgid "EMT instruction" +msgstr "EMT instruction" + +#: siglist.c:83 +msgid "Floating point exception" +msgstr "Floating point exception" + +#: siglist.c:87 +msgid "Killed" +msgstr "Killed" + +#: siglist.c:91 +msgid "Bus error" +msgstr "Bus error" + +#: siglist.c:95 +msgid "Segmentation fault" +msgstr "Segmentation fault" + +#: siglist.c:99 +msgid "Bad system call" +msgstr "Bad system call" + +#: siglist.c:103 +msgid "Broken pipe" +msgstr "Broken pipe" + +#: siglist.c:107 +msgid "Alarm clock" +msgstr "Alarm clock" + +#: siglist.c:111 +msgid "Terminated" +msgstr "Terminated" + +#: siglist.c:115 +msgid "Urgent IO condition" +msgstr "Urgent IO condition" + +#: siglist.c:119 +msgid "Stopped (signal)" +msgstr "Stopped (signal)" + +#: siglist.c:127 +msgid "Continue" +msgstr "Continue" + +#: siglist.c:135 +msgid "Child death or stop" +msgstr "Child death or stop" + +#: siglist.c:139 +msgid "Stopped (tty input)" +msgstr "Stopped (tty input)" + +#: siglist.c:143 +msgid "Stopped (tty output)" +msgstr "Stopped (tty output)" + +#: siglist.c:147 +msgid "I/O ready" +msgstr "I/O ready" + +#: siglist.c:151 +msgid "CPU limit" +msgstr "CPU limit" + +#: siglist.c:155 +msgid "File limit" +msgstr "File limit" + +#: siglist.c:159 +msgid "Alarm (virtual)" +msgstr "Alarm (virtual)" + +#: siglist.c:163 +msgid "Alarm (profile)" +msgstr "Alarm (profile)" + +#: siglist.c:167 +msgid "Window changed" +msgstr "Window changed" + +#: siglist.c:171 +msgid "Record lock" +msgstr "Record lock" + +#: siglist.c:175 +msgid "User signal 1" +msgstr "User signal 1" + +#: siglist.c:179 +msgid "User signal 2" +msgstr "User signal 2" + +#: siglist.c:183 +msgid "HFT input data pending" +msgstr "HFT input data pending" + +#: siglist.c:187 +msgid "power failure imminent" +msgstr "power failure imminent" + +#: siglist.c:191 +msgid "system crash imminent" +msgstr "system crash imminent" + +#: siglist.c:195 +msgid "migrate process to another CPU" +msgstr "migrate process to another CPU" + +#: siglist.c:199 +msgid "programming error" +msgstr "programming error" + +#: siglist.c:203 +msgid "HFT monitor mode granted" +msgstr "HFT monitor mode granted" + +#: siglist.c:207 +msgid "HFT monitor mode retracted" +msgstr "HFT monitor mode retracted" + +#: siglist.c:211 +msgid "HFT sound sequence has completed" +msgstr "HFT sound sequence has completed" + +#: siglist.c:215 +msgid "Information request" +msgstr "Information request" + +#: siglist.c:223 +msgid "Unknown Signal #" +msgstr "Unknown Signal #" + +#: siglist.c:225 +#, c-format +msgid "Unknown Signal #%d" +msgstr "Unknown Signal #%d" + +#: subst.c:1362 subst.c:1520 +#, c-format +msgid "bad substitution: no closing `%s' in %s" +msgstr "bad substitution: no closing ‘%s’ in %s" + +#: subst.c:2847 +#, c-format +msgid "%s: cannot assign list to array member" +msgstr "%s: cannot assign list to array member" + +#: subst.c:5065 subst.c:5081 +msgid "cannot make pipe for process substitution" +msgstr "cannot make pipe for process substitution" + +#: subst.c:5113 +msgid "cannot make child for process substitution" +msgstr "cannot make child for process substitution" + +#: subst.c:5158 +#, c-format +msgid "cannot open named pipe %s for reading" +msgstr "cannot open named pipe %s for reading" + +#: subst.c:5160 +#, c-format +msgid "cannot open named pipe %s for writing" +msgstr "cannot open named pipe %s for writing" + +#: subst.c:5178 +#, c-format +msgid "cannot duplicate named pipe %s as fd %d" +msgstr "cannot duplicate named pipe %s as fd %d" + +#: subst.c:5376 +msgid "cannot make pipe for command substitution" +msgstr "cannot make pipe for command substitution" + +#: subst.c:5414 +msgid "cannot make child for command substitution" +msgstr "cannot make child for command substitution" + +#: subst.c:5433 +msgid "command_substitute: cannot duplicate pipe as fd 1" +msgstr "command_substitute: cannot duplicate pipe as fd 1" + +#: subst.c:5837 subst.c:8050 +#, c-format +msgid "%s: invalid variable name for name reference" +msgstr "%s: invalid variable name for name reference" + +#: subst.c:6048 +#, c-format +msgid "%s: parameter null or not set" +msgstr "%s: parameter null or not set" + +#: subst.c:6320 subst.c:6335 +#, c-format +msgid "%s: substring expression < 0" +msgstr "%s: substring expression < 0" + +#: subst.c:7506 +#, c-format +msgid "%s: bad substitution" +msgstr "%s: bad substitution" + +#: subst.c:7583 +#, c-format +msgid "$%s: cannot assign in this way" +msgstr "$%s: cannot assign in this way" + +#: subst.c:7917 +msgid "" +"future versions of the shell will force evaluation as an arithmetic " +"substitution" +msgstr "" +"future versions of the shell will force evaluation as an arithmetic " +"substitution" + +#: subst.c:8421 +#, c-format +msgid "bad substitution: no closing \"`\" in %s" +msgstr "bad substitution: no closing “`” in %s" + +#: subst.c:9322 +#, c-format +msgid "no match: %s" +msgstr "no match: %s" + +#: test.c:147 +msgid "argument expected" +msgstr "argument expected" + +#: test.c:156 +#, c-format +msgid "%s: integer expression expected" +msgstr "%s: integer expression expected" + +#: test.c:264 +msgid "`)' expected" +msgstr "‘)’ expected" + +#: test.c:266 +#, c-format +msgid "`)' expected, found %s" +msgstr "‘)’ expected, found %s" + +#: test.c:281 test.c:742 test.c:745 +#, c-format +msgid "%s: unary operator expected" +msgstr "%s: unary operator expected" + +#: test.c:468 test.c:785 +#, c-format +msgid "%s: binary operator expected" +msgstr "%s: binary operator expected" + +#: test.c:860 +msgid "missing `]'" +msgstr "missing ‘]’" + +#: trap.c:217 +msgid "invalid signal number" +msgstr "invalid signal number" + +#: trap.c:371 +#, c-format +msgid "run_pending_traps: bad value in trap_list[%d]: %p" +msgstr "run_pending_traps: bad value in trap_list[%d]: %p" + +#: trap.c:375 +#, c-format +msgid "" +"run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" +msgstr "" +"run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" + +#: trap.c:428 +#, c-format +msgid "trap_handler: bad signal %d" +msgstr "trap_handler: bad signal %d" + +#: variables.c:382 +#, c-format +msgid "error importing function definition for `%s'" +msgstr "error importing function definition for ‘%s’" + +#: variables.c:780 +#, c-format +msgid "shell level (%d) too high, resetting to 1" +msgstr "shell level (%d) too high, resetting to 1" + +#: variables.c:1865 +#, c-format +msgid "%s: circular name reference" +msgstr "%s: circular name reference" + +#: variables.c:2228 +msgid "make_local_variable: no function context at current scope" +msgstr "make_local_variable: no function context at current scope" + +#: variables.c:2247 +#, c-format +msgid "%s: variable may not be assigned value" +msgstr "%s: variable may not be assigned value" + +#: variables.c:3646 +msgid "all_local_variables: no function context at current scope" +msgstr "all_local_variables: no function context at current scope" + +#: variables.c:3891 +#, c-format +msgid "%s has null exportstr" +msgstr "%s has null exportstr" + +#: variables.c:3896 variables.c:3905 +#, c-format +msgid "invalid character %d in exportstr for %s" +msgstr "invalid character %d in exportstr for %s" + +#: variables.c:3911 +#, c-format +msgid "no `=' in exportstr for %s" +msgstr "no ‘=’ in exportstr for %s" + +#: variables.c:4344 +msgid "pop_var_context: head of shell_variables not a function context" +msgstr "pop_var_context: head of shell_variables not a function context" + +#: variables.c:4357 +msgid "pop_var_context: no global_variables context" +msgstr "pop_var_context: no global_variables context" + +#: variables.c:4431 +msgid "pop_scope: head of shell_variables not a temporary environment scope" +msgstr "pop_scope: head of shell_variables not a temporary environment scope" + +#: variables.c:5257 +#, c-format +msgid "%s: %s: cannot open as FILE" +msgstr "%s: %s: cannot open as FILE" + +#: variables.c:5262 +#, c-format +msgid "%s: %s: invalid value for trace file descriptor" +msgstr "%s: %s: invalid value for trace file descriptor" + +#: variables.c:5307 +#, c-format +msgid "%s: %s: compatibility value out of range" +msgstr "%s: %s: compatibility value out of range" + +#: version.c:46 +msgid "Copyright (C) 2013 Free Software Foundation, Inc." +msgstr "Copyright (C) 2013 Free Software Foundation, Inc." + +#: version.c:47 version2.c:47 +msgid "" +"License GPLv3+: GNU GPL version 3 or later \n" +msgstr "" +"License GPLv3+: GNU GPL version 3 or later \n" + +#: version.c:86 version2.c:86 +#, c-format +msgid "GNU bash, version %s (%s)\n" +msgstr "GNU bash, version %s (%s)\n" + +#: version.c:91 version2.c:91 +msgid "This is free software; you are free to change and redistribute it." +msgstr "This is free software; you are free to change and redistribute it." + +#: version.c:92 version2.c:92 +msgid "There is NO WARRANTY, to the extent permitted by law." +msgstr "There is NO WARRANTY, to the extent permitted by law." + +#: version2.c:46 +msgid "Copyright (C) 2012 Free Software Foundation, Inc." +msgstr "Copyright (C) 2012 Free Software Foundation, Inc." + +#: xmalloc.c:91 +#, c-format +msgid "%s: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "%s: cannot allocate %lu bytes (%lu bytes allocated)" + +#: xmalloc.c:93 +#, c-format +msgid "%s: cannot allocate %lu bytes" +msgstr "%s: cannot allocate %lu bytes" + +#: xmalloc.c:163 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)" + +#: xmalloc.c:165 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes" +msgstr "%s: %s:%d: cannot allocate %lu bytes" + +#: builtins.c:43 +msgid "alias [-p] [name[=value] ... ]" +msgstr "alias [-p] [name[=value] ... ]" + +#: builtins.c:47 +msgid "unalias [-a] name [name ...]" +msgstr "unalias [-a] name [name ...]" + +#: builtins.c:51 +msgid "" +"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-" +"x keyseq:shell-command] [keyseq:readline-function or readline-command]" +msgstr "" +"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-" +"x keyseq:shell-command] [keyseq:readline-function or readline-command]" + +#: builtins.c:54 +msgid "break [n]" +msgstr "break [n]" + +#: builtins.c:56 +msgid "continue [n]" +msgstr "continue [n]" + +#: builtins.c:58 +msgid "builtin [shell-builtin [arg ...]]" +msgstr "builtin [shell-builtin [arg ...]]" + +#: builtins.c:61 +msgid "caller [expr]" +msgstr "caller [expr]" + +#: builtins.c:64 +msgid "cd [-L|[-P [-e]] [-@]] [dir]" +msgstr "cd [-L|[-P [-e]] [-@]] [dir]" + +#: builtins.c:66 +msgid "pwd [-LP]" +msgstr "pwd [-LP]" + +#: builtins.c:68 +msgid ":" +msgstr ":" + +#: builtins.c:70 +msgid "true" +msgstr "true" + +#: builtins.c:72 +msgid "false" +msgstr "false" + +#: builtins.c:74 +msgid "command [-pVv] command [arg ...]" +msgstr "command [-pVv] command [arg ...]" + +#: builtins.c:76 +msgid "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" +msgstr "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" + +#: builtins.c:78 +msgid "typeset [-aAfFgilrtux] [-p] name[=value] ..." +msgstr "typeset [-aAfFgilrtux] [-p] name[=value] ..." + +#: builtins.c:80 +msgid "local [option] name[=value] ..." +msgstr "local [option] name[=value] ..." + +#: builtins.c:83 +msgid "echo [-neE] [arg ...]" +msgstr "echo [-neE] [arg ...]" + +#: builtins.c:87 +msgid "echo [-n] [arg ...]" +msgstr "echo [-n] [arg ...]" + +#: builtins.c:90 +msgid "enable [-a] [-dnps] [-f filename] [name ...]" +msgstr "enable [-a] [-dnps] [-f filename] [name ...]" + +#: builtins.c:92 +msgid "eval [arg ...]" +msgstr "eval [arg ...]" + +#: builtins.c:94 +msgid "getopts optstring name [arg]" +msgstr "getopts optstring name [arg]" + +#: builtins.c:96 +msgid "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" +msgstr "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" + +#: builtins.c:98 +msgid "exit [n]" +msgstr "exit [n]" + +#: builtins.c:100 +msgid "logout [n]" +msgstr "logout [n]" + +#: builtins.c:103 +msgid "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" +msgstr "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" + +#: builtins.c:107 +msgid "fg [job_spec]" +msgstr "fg [job_spec]" + +#: builtins.c:111 +msgid "bg [job_spec ...]" +msgstr "bg [job_spec ...]" + +#: builtins.c:114 +msgid "hash [-lr] [-p pathname] [-dt] [name ...]" +msgstr "hash [-lr] [-p pathname] [-dt] [name ...]" + +#: builtins.c:117 +msgid "help [-dms] [pattern ...]" +msgstr "help [-dms] [pattern ...]" + +#: builtins.c:121 +msgid "" +"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg " +"[arg...]" +msgstr "" +"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg " +"[arg...]" + +#: builtins.c:125 +msgid "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" +msgstr "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" + +#: builtins.c:129 +msgid "disown [-h] [-ar] [jobspec ...]" +msgstr "disown [-h] [-ar] [jobspec ...]" + +#: builtins.c:132 +msgid "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l " +"[sigspec]" +msgstr "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l " +"[sigspec]" + +#: builtins.c:134 +msgid "let arg [arg ...]" +msgstr "let arg [arg ...]" + +#: builtins.c:136 +msgid "" +"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p " +"prompt] [-t timeout] [-u fd] [name ...]" +msgstr "" +"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p " +"prompt] [-t timeout] [-u fd] [name ...]" + +#: builtins.c:138 +msgid "return [n]" +msgstr "return [n]" + +#: builtins.c:140 +msgid "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" +msgstr "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" + +#: builtins.c:142 +msgid "unset [-f] [-v] [-n] [name ...]" +msgstr "unset [-f] [-v] [-n] [name ...]" + +#: builtins.c:144 +msgid "export [-fn] [name[=value] ...] or export -p" +msgstr "export [-fn] [name[=value] ...] or export -p" + +#: builtins.c:146 +msgid "readonly [-aAf] [name[=value] ...] or readonly -p" +msgstr "readonly [-aAf] [name[=value] ...] or readonly -p" + +#: builtins.c:148 +msgid "shift [n]" +msgstr "shift [n]" + +#: builtins.c:150 +msgid "source filename [arguments]" +msgstr "source filename [arguments]" + +#: builtins.c:152 +msgid ". filename [arguments]" +msgstr ". filename [arguments]" + +#: builtins.c:155 +msgid "suspend [-f]" +msgstr "suspend [-f]" + +#: builtins.c:158 +msgid "test [expr]" +msgstr "test [expr]" + +#: builtins.c:160 +msgid "[ arg... ]" +msgstr "[ arg... ]" + +#: builtins.c:162 +msgid "times" +msgstr "times" + +#: builtins.c:164 +msgid "trap [-lp] [[arg] signal_spec ...]" +msgstr "trap [-lp] [[arg] signal_spec ...]" + +#: builtins.c:166 +msgid "type [-afptP] name [name ...]" +msgstr "type [-afptP] name [name ...]" + +#: builtins.c:169 +msgid "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" +msgstr "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" + +#: builtins.c:172 +msgid "umask [-p] [-S] [mode]" +msgstr "umask [-p] [-S] [mode]" + +#: builtins.c:175 +msgid "wait [-n] [id ...]" +msgstr "wait [-n] [id ...]" + +#: builtins.c:179 +msgid "wait [pid ...]" +msgstr "wait [pid ...]" + +#: builtins.c:182 +msgid "for NAME [in WORDS ... ] ; do COMMANDS; done" +msgstr "for NAME [in WORDS ... ] ; do COMMANDS; done" + +#: builtins.c:184 +msgid "for (( exp1; exp2; exp3 )); do COMMANDS; done" +msgstr "for (( exp1; exp2; exp3 )); do COMMANDS; done" + +#: builtins.c:186 +msgid "select NAME [in WORDS ... ;] do COMMANDS; done" +msgstr "select NAME [in WORDS ... ;] do COMMANDS; done" + +#: builtins.c:188 +msgid "time [-p] pipeline" +msgstr "time [-p] pipeline" + +#: builtins.c:190 +msgid "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" +msgstr "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" + +#: builtins.c:192 +msgid "" +"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else " +"COMMANDS; ] fi" +msgstr "" +"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else " +"COMMANDS; ] fi" + +#: builtins.c:194 +msgid "while COMMANDS; do COMMANDS; done" +msgstr "while COMMANDS; do COMMANDS; done" + +#: builtins.c:196 +msgid "until COMMANDS; do COMMANDS; done" +msgstr "until COMMANDS; do COMMANDS; done" + +#: builtins.c:198 +msgid "coproc [NAME] command [redirections]" +msgstr "coproc [NAME] command [redirections]" + +#: builtins.c:200 +msgid "function name { COMMANDS ; } or name () { COMMANDS ; }" +msgstr "function name { COMMANDS ; } or name () { COMMANDS ; }" + +#: builtins.c:202 +msgid "{ COMMANDS ; }" +msgstr "{ COMMANDS ; }" + +#: builtins.c:204 +msgid "job_spec [&]" +msgstr "job_spec [&]" + +#: builtins.c:206 +msgid "(( expression ))" +msgstr "(( expression ))" + +#: builtins.c:208 +msgid "[[ expression ]]" +msgstr "[[ expression ]]" + +#: builtins.c:210 +msgid "variables - Names and meanings of some shell variables" +msgstr "variables - Names and meanings of some shell variables" + +#: builtins.c:213 +msgid "pushd [-n] [+N | -N | dir]" +msgstr "pushd [-n] [+N | -N | dir]" + +#: builtins.c:217 +msgid "popd [-n] [+N | -N]" +msgstr "popd [-n] [+N | -N]" + +#: builtins.c:221 +msgid "dirs [-clpv] [+N] [-N]" +msgstr "dirs [-clpv] [+N] [-N]" + +#: builtins.c:224 +msgid "shopt [-pqsu] [-o] [optname ...]" +msgstr "shopt [-pqsu] [-o] [optname ...]" + +#: builtins.c:226 +msgid "printf [-v var] format [arguments]" +msgstr "printf [-v var] format [arguments]" + +#: builtins.c:229 +msgid "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-" +"W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S " +"suffix] [name ...]" +msgstr "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-" +"W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S " +"suffix] [name ...]" + +#: builtins.c:233 +msgid "" +"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " +"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" +msgstr "" +"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " +"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" + +#: builtins.c:237 +msgid "compopt [-o|+o option] [-DE] [name ...]" +msgstr "compopt [-o|+o option] [-DE] [name ...]" + +#: builtins.c:240 +msgid "" +"mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" +"mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" + +#: builtins.c:242 +msgid "" +"readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" +"readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" + +#: builtins.c:254 +msgid "" +"Define or display aliases.\n" +" \n" +" Without arguments, `alias' prints the list of aliases in the reusable\n" +" form `alias NAME=VALUE' on standard output.\n" +" \n" +" Otherwise, an alias is defined for each NAME whose VALUE is given.\n" +" A trailing space in VALUE causes the next word to be checked for\n" +" alias substitution when the alias is expanded.\n" +" \n" +" Options:\n" +" -p\tPrint all defined aliases in a reusable format\n" +" \n" +" Exit Status:\n" +" alias returns true unless a NAME is supplied for which no alias has " +"been\n" +" defined." +msgstr "" +"Define or display aliases.\n" +" \n" +" Without arguments, ‘alias’ prints the list of aliases in the " +"reusable\n" +" form ‘alias NAME=VALUE’ on standard output.\n" +" \n" +" Otherwise, an alias is defined for each NAME whose VALUE is given.\n" +" A trailing space in VALUE causes the next word to be checked for\n" +" alias substitution when the alias is expanded.\n" +" \n" +" Options:\n" +" -p\tPrint all defined aliases in a reusable format\n" +" \n" +" Exit Status:\n" +" alias returns true unless a NAME is supplied for which no alias has " +"been\n" +" defined." + +#: builtins.c:276 +msgid "" +"Remove each NAME from the list of defined aliases.\n" +" \n" +" Options:\n" +" -a\tremove all alias definitions.\n" +" \n" +" Return success unless a NAME is not an existing alias." +msgstr "" +"Remove each NAME from the list of defined aliases.\n" +" \n" +" Options:\n" +" -a\tremove all alias definitions.\n" +" \n" +" Return success unless a NAME is not an existing alias." + +#: builtins.c:289 +msgid "" +"Set Readline key bindings and variables.\n" +" \n" +" Bind a key sequence to a Readline function or a macro, or set a\n" +" Readline variable. The non-option argument syntax is equivalent to\n" +" that found in ~/.inputrc, but must be passed as a single argument:\n" +" e.g., bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Options:\n" +" -m keymap Use KEYMAP as the keymap for the duration of this\n" +" command. Acceptable keymap names are emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" +"move,\n" +" vi-command, and vi-insert.\n" +" -l List names of functions.\n" +" -P List function names and bindings.\n" +" -p List functions and bindings in a form that can be\n" +" reused as input.\n" +" -S List key sequences that invoke macros and their " +"values\n" +" -s List key sequences that invoke macros and their " +"values\n" +" in a form that can be reused as input.\n" +" -V List variable names and values\n" +" -v List variable names and values in a form that can\n" +" be reused as input.\n" +" -q function-name Query about which keys invoke the named function.\n" +" -u function-name Unbind all keys which are bound to the named " +"function.\n" +" -r keyseq Remove the binding for KEYSEQ.\n" +" -f filename Read key bindings from FILENAME.\n" +" -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when\n" +" \t\t\t\tKEYSEQ is entered.\n" +" -X\t\t List key sequences bound with -x and associated commands\n" +" in a form that can be reused as input.\n" +" \n" +" Exit Status:\n" +" bind returns 0 unless an unrecognized option is given or an error occurs." +msgstr "" +"Set Readline key bindings and variables.\n" +" \n" +" Bind a key sequence to a Readline function or a macro, or set a\n" +" Readline variable. The non-option argument syntax is equivalent to\n" +" that found in ~/.inputrc, but must be passed as a single argument:\n" +" e.g., bind '“\\C-x\\C-r”: re-read-init-file'.\n" +" \n" +" Options:\n" +" -m keymap Use KEYMAP as the keymap for the duration of this\n" +" command. Acceptable keymap names are emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" +"move,\n" +" vi-command, and vi-insert.\n" +" -l List names of functions.\n" +" -P List function names and bindings.\n" +" -p List functions and bindings in a form that can be\n" +" reused as input.\n" +" -S List key sequences that invoke macros and their " +"values\n" +" -s List key sequences that invoke macros and their " +"values\n" +" in a form that can be reused as input.\n" +" -V List variable names and values\n" +" -v List variable names and values in a form that can\n" +" be reused as input.\n" +" -q function-name Query about which keys invoke the named function.\n" +" -u function-name Unbind all keys which are bound to the named " +"function.\n" +" -r keyseq Remove the binding for KEYSEQ.\n" +" -f filename Read key bindings from FILENAME.\n" +" -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when\n" +" \t\t\t\tKEYSEQ is entered.\n" +" -X\t\t List key sequences bound with -x and associated commands\n" +" in a form that can be reused as input.\n" +" \n" +" Exit Status:\n" +" bind returns 0 unless an unrecognized option is given or an error occurs." + +#: builtins.c:328 +msgid "" +"Exit for, while, or until loops.\n" +" \n" +" Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n" +" loops.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Exit for, while, or until loops.\n" +" \n" +" Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n" +" loops.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." + +#: builtins.c:340 +msgid "" +"Resume for, while, or until loops.\n" +" \n" +" Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n" +" If N is specified, resumes the Nth enclosing loop.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Resume for, while, or until loops.\n" +" \n" +" Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n" +" If N is specified, resumes the Nth enclosing loop.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." + +#: builtins.c:352 +msgid "" +"Execute shell builtins.\n" +" \n" +" Execute SHELL-BUILTIN with arguments ARGs without performing command\n" +" lookup. This is useful when you wish to reimplement a shell builtin\n" +" as a shell function, but need to execute the builtin within the " +"function.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n" +" not a shell builtin.." +msgstr "" +"Execute shell builtins.\n" +" \n" +" Execute SHELL-BUILTIN with arguments ARGs without performing command\n" +" lookup. This is useful when you wish to reimplement a shell builtin\n" +" as a shell function, but need to execute the builtin within the " +"function.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n" +" not a shell builtin.." + +#: builtins.c:367 +msgid "" +"Return the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns \"$line $filename\". With EXPR, returns\n" +" \"$line $subroutine $filename\"; this extra information can be used to\n" +" provide a stack trace.\n" +" \n" +" The value of EXPR indicates how many call frames to go back before the\n" +" current one; the top frame is frame 0.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless the shell is not executing a shell function or EXPR\n" +" is invalid." +msgstr "" +"Return the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns “$line $filename”. With EXPR, returns\n" +" “$line $subroutine $filename”; this extra information can be used " +"to\n" +" provide a stack trace.\n" +" \n" +" The value of EXPR indicates how many call frames to go back before the\n" +" current one; the top frame is frame 0.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless the shell is not executing a shell function or EXPR\n" +" is invalid." + +#: builtins.c:385 +msgid "" +"Change the shell working directory.\n" +" \n" +" Change the current directory to DIR. The default DIR is the value of " +"the\n" +" HOME shell variable.\n" +" \n" +" The variable CDPATH defines the search path for the directory " +"containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon " +"(:).\n" +" A null directory name is the same as the current directory. If DIR " +"begins\n" +" with a slash (/), then CDPATH is not used.\n" +" \n" +" If the directory is not found, and the shell option `cdable_vars' is " +"set,\n" +" the word is assumed to be a variable name. If that variable has a " +"value,\n" +" its value is used for DIR.\n" +" \n" +" Options:\n" +" -L\tforce symbolic links to be followed: resolve symbolic links in\n" +" \tDIR after processing instances of `..'\n" +" -P\tuse the physical directory structure without following symbolic\n" +" \tlinks: resolve symbolic links in DIR before processing instances\n" +" \tof `..'\n" +" -e\tif the -P option is supplied, and the current working directory\n" +" \tcannot be determined successfully, exit with a non-zero status\n" +" -@ on systems that support it, present a file with extended " +"attributes\n" +" as a directory containing the file attributes\n" +" \n" +" The default is to follow symbolic links, as if `-L' were specified.\n" +" `..' is processed by removing the immediately previous pathname " +"component\n" +" back to a slash or the beginning of DIR.\n" +" \n" +" Exit Status:\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully " +"when\n" +" -P is used; non-zero otherwise." +msgstr "" +"Change the shell working directory.\n" +" \n" +" Change the current directory to DIR. The default DIR is the value of " +"the\n" +" HOME shell variable.\n" +" \n" +" The variable CDPATH defines the search path for the directory " +"containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon " +"(:).\n" +" A null directory name is the same as the current directory. If DIR " +"begins\n" +" with a slash (/), then CDPATH is not used.\n" +" \n" +" If the directory is not found, and the shell option ‘cdable_vars’ " +"is set,\n" +" the word is assumed to be a variable name. If that variable has a " +"value,\n" +" its value is used for DIR.\n" +" \n" +" Options:\n" +" -L\tforce symbolic links to be followed: resolve symbolic links in\n" +" \tDIR after processing instances of ‘..’\n" +" -P\tuse the physical directory structure without following symbolic\n" +" \tlinks: resolve symbolic links in DIR before processing instances\n" +" \tof ‘..’\n" +" -e\tif the -P option is supplied, and the current working directory\n" +" \tcannot be determined successfully, exit with a non-zero status\n" +" -@ on systems that support it, present a file with extended " +"attributes\n" +" as a directory containing the file attributes\n" +" \n" +" The default is to follow symbolic links, as if ‘-L’ were " +"specified.\n" +" ‘..’ is processed by removing the immediately previous pathname " +"component\n" +" back to a slash or the beginning of DIR.\n" +" \n" +" Exit Status:\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully " +"when\n" +" -P is used; non-zero otherwise." + +#: builtins.c:422 +msgid "" +"Print the name of the current working directory.\n" +" \n" +" Options:\n" +" -L\tprint the value of $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tprint the physical directory, without any symbolic links\n" +" \n" +" By default, `pwd' behaves as if `-L' were specified.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless an invalid option is given or the current directory\n" +" cannot be read." +msgstr "" +"Print the name of the current working directory.\n" +" \n" +" Options:\n" +" -L\tprint the value of $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tprint the physical directory, without any symbolic links\n" +" \n" +" By default, ‘pwd’ behaves as if ‘-L’ were specified.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless an invalid option is given or the current directory\n" +" cannot be read." + +#: builtins.c:439 +msgid "" +"Null command.\n" +" \n" +" No effect; the command does nothing.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Null command.\n" +" \n" +" No effect; the command does nothing.\n" +" \n" +" Exit Status:\n" +" Always succeeds." + +#: builtins.c:450 +msgid "" +"Return a successful result.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Return a successful result.\n" +" \n" +" Exit Status:\n" +" Always succeeds." + +#: builtins.c:459 +msgid "" +"Return an unsuccessful result.\n" +" \n" +" Exit Status:\n" +" Always fails." +msgstr "" +"Return an unsuccessful result.\n" +" \n" +" Exit Status:\n" +" Always fails." + +#: builtins.c:468 +msgid "" +"Execute a simple command or display information about commands.\n" +" \n" +" Runs COMMAND with ARGS suppressing shell function lookup, or display\n" +" information about the specified COMMANDs. Can be used to invoke " +"commands\n" +" on disk when a function with the same name exists.\n" +" \n" +" Options:\n" +" -p\tuse a default value for PATH that is guaranteed to find all of\n" +" \tthe standard utilities\n" +" -v\tprint a description of COMMAND similar to the `type' builtin\n" +" -V\tprint a more verbose description of each COMMAND\n" +" \n" +" Exit Status:\n" +" Returns exit status of COMMAND, or failure if COMMAND is not found." +msgstr "" +"Execute a simple command or display information about commands.\n" +" \n" +" Runs COMMAND with ARGS suppressing shell function lookup, or display\n" +" information about the specified COMMANDs. Can be used to invoke " +"commands\n" +" on disk when a function with the same name exists.\n" +" \n" +" Options:\n" +" -p\tuse a default value for PATH that is guaranteed to find all of\n" +" \tthe standard utilities\n" +" -v\tprint a description of COMMAND similar to the ‘type’ " +"builtin\n" +" -V\tprint a more verbose description of each COMMAND\n" +" \n" +" Exit Status:\n" +" Returns exit status of COMMAND, or failure if COMMAND is not found." + +#: builtins.c:487 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Declare variables and give them attributes. If no NAMEs are given,\n" +" display the attributes and values of all variables.\n" +" \n" +" Options:\n" +" -f\trestrict action or display to function names and definitions\n" +" -F\trestrict display to function names only (plus line number and\n" +" \tsource file when debugging)\n" +" -g\tcreate global variables when used in a shell function; otherwise\n" +" \tignored\n" +" -p\tdisplay the attributes and value of each NAME\n" +" \n" +" Options which set attributes:\n" +" -a\tto make NAMEs indexed arrays (if supported)\n" +" -A\tto make NAMEs associative arrays (if supported)\n" +" -i\tto make NAMEs have the `integer' attribute\n" +" -l\tto convert NAMEs to lower case on assignment\n" +" -n\tmake NAME a reference to the variable named by its value\n" +" -r\tto make NAMEs readonly\n" +" -t\tto make NAMEs have the `trace' attribute\n" +" -u\tto convert NAMEs to upper case on assignment\n" +" -x\tto make NAMEs export\n" +" \n" +" Using `+' instead of `-' turns off the given attribute.\n" +" \n" +" Variables with the integer attribute have arithmetic evaluation (see\n" +" the `let' command) performed when the variable is assigned a value.\n" +" \n" +" When used in a function, `declare' makes NAMEs local, as with the " +"`local'\n" +" command. The `-g' option suppresses this behavior.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or a variable\n" +" assignment error occurs." +msgstr "" +"Set variable values and attributes.\n" +" \n" +" Declare variables and give them attributes. If no NAMEs are given,\n" +" display the attributes and values of all variables.\n" +" \n" +" Options:\n" +" -f\trestrict action or display to function names and definitions\n" +" -F\trestrict display to function names only (plus line number and\n" +" \tsource file when debugging)\n" +" -g\tcreate global variables when used in a shell function; otherwise\n" +" \tignored\n" +" -p\tdisplay the attributes and value of each NAME\n" +" \n" +" Options which set attributes:\n" +" -a\tto make NAMEs indexed arrays (if supported)\n" +" -A\tto make NAMEs associative arrays (if supported)\n" +" -i\tto make NAMEs have the ‘integer’ attribute\n" +" -l\tto convert NAMEs to lower case on assignment\n" +" -n\tmake NAME a reference to the variable named by its value\n" +" -r\tto make NAMEs readonly\n" +" -t\tto make NAMEs have the ‘trace’ attribute\n" +" -u\tto convert NAMEs to upper case on assignment\n" +" -x\tto make NAMEs export\n" +" \n" +" Using ‘+’ instead of ‘-’ turns off the given attribute.\n" +" \n" +" Variables with the integer attribute have arithmetic evaluation (see\n" +" the ‘let’ command) performed when the variable is assigned a " +"value.\n" +" \n" +" When used in a function, ‘declare’ makes NAMEs local, as with the " +"‘local’\n" +" command. The ‘-g’ option suppresses this behavior.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or a variable\n" +" assignment error occurs." + +#: builtins.c:527 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Obsolete. See `help declare'." +msgstr "" +"Set variable values and attributes.\n" +" \n" +" Obsolete. See ‘help declare’." + +#: builtins.c:535 +msgid "" +"Define local variables.\n" +" \n" +" Create a local variable called NAME, and give it VALUE. OPTION can\n" +" be any option accepted by `declare'.\n" +" \n" +" Local variables can only be used within a function; they are visible\n" +" only to the function where they are defined and its children.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied, a variable\n" +" assignment error occurs, or the shell is not executing a function." +msgstr "" +"Define local variables.\n" +" \n" +" Create a local variable called NAME, and give it VALUE. OPTION can\n" +" be any option accepted by ‘declare’.\n" +" \n" +" Local variables can only be used within a function; they are visible\n" +" only to the function where they are defined and its children.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied, a variable\n" +" assignment error occurs, or the shell is not executing a function." + +#: builtins.c:552 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs, separated by a single space character and followed by " +"a\n" +" newline, on the standard output.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" -e\tenable interpretation of the following backslash escapes\n" +" -E\texplicitly suppress interpretation of backslash escapes\n" +" \n" +" `echo' interprets the following backslash-escaped characters:\n" +" \\a\talert (bell)\n" +" \\b\tbackspace\n" +" \\c\tsuppress further output\n" +" \\e\tescape character\n" +" \\E\tescape character\n" +" \\f\tform feed\n" +" \\n\tnew line\n" +" \\r\tcarriage return\n" +" \\t\thorizontal tab\n" +" \\v\tvertical tab\n" +" \\\\\tbackslash\n" +" \\0nnn\tthe character whose ASCII code is NNN (octal). NNN can be\n" +" \t0 to 3 octal digits\n" +" \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" +" \tcan be one or two hex digits\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs, separated by a single space character and followed by " +"a\n" +" newline, on the standard output.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" -e\tenable interpretation of the following backslash escapes\n" +" -E\texplicitly suppress interpretation of backslash escapes\n" +" \n" +" ‘echo’ interprets the following backslash-escaped characters:\n" +" \\a\talert (bell)\n" +" \\b\tbackspace\n" +" \\c\tsuppress further output\n" +" \\e\tescape character\n" +" \\E\tescape character\n" +" \\f\tform feed\n" +" \\n\tnew line\n" +" \\r\tcarriage return\n" +" \\t\thorizontal tab\n" +" \\v\tvertical tab\n" +" \\\\\tbackslash\n" +" \\0nnn\tthe character whose ASCII code is NNN (octal). NNN can be\n" +" \t0 to 3 octal digits\n" +" \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" +" \tcan be one or two hex digits\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." + +#: builtins.c:588 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs on the standard output followed by a newline.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs on the standard output followed by a newline.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." + +#: builtins.c:603 +msgid "" +"Enable and disable shell builtins.\n" +" \n" +" Enables and disables builtin shell commands. Disabling allows you to\n" +" execute a disk command which has the same name as a shell builtin\n" +" without using a full pathname.\n" +" \n" +" Options:\n" +" -a\tprint a list of builtins showing whether or not each is enabled\n" +" -n\tdisable each NAME or display a list of disabled builtins\n" +" -p\tprint the list of builtins in a reusable format\n" +" -s\tprint only the names of Posix `special' builtins\n" +" \n" +" Options controlling dynamic loading:\n" +" -f\tLoad builtin NAME from shared object FILENAME\n" +" -d\tRemove a builtin loaded with -f\n" +" \n" +" Without options, each NAME is enabled.\n" +" \n" +" To use the `test' found in $PATH instead of the shell builtin\n" +" version, type `enable -n test'.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not a shell builtin or an error occurs." +msgstr "" +"Enable and disable shell builtins.\n" +" \n" +" Enables and disables builtin shell commands. Disabling allows you to\n" +" execute a disk command which has the same name as a shell builtin\n" +" without using a full pathname.\n" +" \n" +" Options:\n" +" -a\tprint a list of builtins showing whether or not each is enabled\n" +" -n\tdisable each NAME or display a list of disabled builtins\n" +" -p\tprint the list of builtins in a reusable format\n" +" -s\tprint only the names of Posix ‘special’ builtins\n" +" \n" +" Options controlling dynamic loading:\n" +" -f\tLoad builtin NAME from shared object FILENAME\n" +" -d\tRemove a builtin loaded with -f\n" +" \n" +" Without options, each NAME is enabled.\n" +" \n" +" To use the ‘test’ found in $PATH instead of the shell builtin\n" +" version, type ‘enable -n test’.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not a shell builtin or an error occurs." + +#: builtins.c:631 +msgid "" +"Execute arguments as a shell command.\n" +" \n" +" Combine ARGs into a single string, use the result as input to the " +"shell,\n" +" and execute the resulting commands.\n" +" \n" +" Exit Status:\n" +" Returns exit status of command or success if command is null." +msgstr "" +"Execute arguments as a shell command.\n" +" \n" +" Combine ARGs into a single string, use the result as input to the " +"shell,\n" +" and execute the resulting commands.\n" +" \n" +" Exit Status:\n" +" Returns exit status of command or success if command is null." + +#: builtins.c:643 +msgid "" +"Parse option arguments.\n" +" \n" +" Getopts is used by shell procedures to parse positional parameters\n" +" as options.\n" +" \n" +" OPTSTRING contains the option letters to be recognized; if a letter\n" +" is followed by a colon, the option is expected to have an argument,\n" +" which should be separated from it by white space.\n" +" \n" +" Each time it is invoked, getopts will place the next option in the\n" +" shell variable $name, initializing name if it does not exist, and\n" +" the index of the next argument to be processed into the shell\n" +" variable OPTIND. OPTIND is initialized to 1 each time the shell or\n" +" a shell script is invoked. When an option requires an argument,\n" +" getopts places that argument into the shell variable OPTARG.\n" +" \n" +" getopts reports errors in one of two ways. If the first character\n" +" of OPTSTRING is a colon, getopts uses silent error reporting. In\n" +" this mode, no error messages are printed. If an invalid option is\n" +" seen, getopts places the option character found into OPTARG. If a\n" +" required argument is not found, getopts places a ':' into NAME and\n" +" sets OPTARG to the option character found. If getopts is not in\n" +" silent mode, and an invalid option is seen, getopts places '?' into\n" +" NAME and unsets OPTARG. If a required argument is not found, a '?'\n" +" is placed in NAME, OPTARG is unset, and a diagnostic message is\n" +" printed.\n" +" \n" +" If the shell variable OPTERR has the value 0, getopts disables the\n" +" printing of error messages, even if the first character of\n" +" OPTSTRING is not a colon. OPTERR has the value 1 by default.\n" +" \n" +" Getopts normally parses the positional parameters ($0 - $9), but if\n" +" more arguments are given, they are parsed instead.\n" +" \n" +" Exit Status:\n" +" Returns success if an option is found; fails if the end of options is\n" +" encountered or an error occurs." +msgstr "" +"Parse option arguments.\n" +" \n" +" Getopts is used by shell procedures to parse positional parameters\n" +" as options.\n" +" \n" +" OPTSTRING contains the option letters to be recognized; if a letter\n" +" is followed by a colon, the option is expected to have an argument,\n" +" which should be separated from it by white space.\n" +" \n" +" Each time it is invoked, getopts will place the next option in the\n" +" shell variable $name, initializing name if it does not exist, and\n" +" the index of the next argument to be processed into the shell\n" +" variable OPTIND. OPTIND is initialized to 1 each time the shell or\n" +" a shell script is invoked. When an option requires an argument,\n" +" getopts places that argument into the shell variable OPTARG.\n" +" \n" +" getopts reports errors in one of two ways. If the first character\n" +" of OPTSTRING is a colon, getopts uses silent error reporting. In\n" +" this mode, no error messages are printed. If an invalid option is\n" +" seen, getopts places the option character found into OPTARG. If a\n" +" required argument is not found, getopts places a ‘:’ into NAME " +"and\n" +" sets OPTARG to the option character found. If getopts is not in\n" +" silent mode, and an invalid option is seen, getopts places ‘?’ " +"into\n" +" NAME and unsets OPTARG. If a required argument is not found, a ‘?" +"[0m’\n" +" is placed in NAME, OPTARG is unset, and a diagnostic message is\n" +" printed.\n" +" \n" +" If the shell variable OPTERR has the value 0, getopts disables the\n" +" printing of error messages, even if the first character of\n" +" OPTSTRING is not a colon. OPTERR has the value 1 by default.\n" +" \n" +" Getopts normally parses the positional parameters ($0 - $9), but if\n" +" more arguments are given, they are parsed instead.\n" +" \n" +" Exit Status:\n" +" Returns success if an option is found; fails if the end of options is\n" +" encountered or an error occurs." + +#: builtins.c:685 +msgid "" +"Replace the shell with the given command.\n" +" \n" +" Execute COMMAND, replacing this shell with the specified program.\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not " +"specified,\n" +" any redirections take effect in the current shell.\n" +" \n" +" Options:\n" +" -a name\tpass NAME as the zeroth argument to COMMAND\n" +" -c\t\texecute COMMAND with an empty environment\n" +" -l\t\tplace a dash in the zeroth argument to COMMAND\n" +" \n" +" If the command cannot be executed, a non-interactive shell exits, " +"unless\n" +" the shell option `execfail' is set.\n" +" \n" +" Exit Status:\n" +" Returns success unless COMMAND is not found or a redirection error " +"occurs." +msgstr "" +"Replace the shell with the given command.\n" +" \n" +" Execute COMMAND, replacing this shell with the specified program.\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not " +"specified,\n" +" any redirections take effect in the current shell.\n" +" \n" +" Options:\n" +" -a name\tpass NAME as the zeroth argument to COMMAND\n" +" -c\t\texecute COMMAND with an empty environment\n" +" -l\t\tplace a dash in the zeroth argument to COMMAND\n" +" \n" +" If the command cannot be executed, a non-interactive shell exits, " +"unless\n" +" the shell option ‘execfail’ is set.\n" +" \n" +" Exit Status:\n" +" Returns success unless COMMAND is not found or a redirection error " +"occurs." + +#: builtins.c:706 +msgid "" +"Exit the shell.\n" +" \n" +" Exits the shell with a status of N. If N is omitted, the exit status\n" +" is that of the last command executed." +msgstr "" +"Exit the shell.\n" +" \n" +" Exits the shell with a status of N. If N is omitted, the exit status\n" +" is that of the last command executed." + +#: builtins.c:715 +msgid "" +"Exit a login shell.\n" +" \n" +" Exits a login shell with exit status N. Returns an error if not " +"executed\n" +" in a login shell." +msgstr "" +"Exit a login shell.\n" +" \n" +" Exits a login shell with exit status N. Returns an error if not " +"executed\n" +" in a login shell." + +#: builtins.c:725 +msgid "" +"Display or execute commands from the history list.\n" +" \n" +" fc is used to list or edit and re-execute commands from the history " +"list.\n" +" FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" +" string, which means the most recent command beginning with that\n" +" string.\n" +" \n" +" Options:\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then " +"EDITOR,\n" +" \t\tthen vi\n" +" -l \tlist lines instead of editing\n" +" -n\tomit line numbers when listing\n" +" -r\treverse the order of the lines (newest listed first)\n" +" \n" +" With the `fc -s [pat=rep ...] [command]' format, COMMAND is\n" +" re-executed after the substitution OLD=NEW is performed.\n" +" \n" +" A useful alias to use with this is r='fc -s', so that typing `r cc'\n" +" runs the last command beginning with `cc' and typing `r' re-executes\n" +" the last command.\n" +" \n" +" Exit Status:\n" +" Returns success or status of executed command; non-zero if an error " +"occurs." +msgstr "" +"Display or execute commands from the history list.\n" +" \n" +" fc is used to list or edit and re-execute commands from the history " +"list.\n" +" FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" +" string, which means the most recent command beginning with that\n" +" string.\n" +" \n" +" Options:\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then " +"EDITOR,\n" +" \t\tthen vi\n" +" -l \tlist lines instead of editing\n" +" -n\tomit line numbers when listing\n" +" -r\treverse the order of the lines (newest listed first)\n" +" \n" +" With the ‘fc -s [pat=rep ...] [command]’ format, COMMAND is\n" +" re-executed after the substitution OLD=NEW is performed.\n" +" \n" +" A useful alias to use with this is r='fc -s', so that typing ‘r " +"cc’\n" +" runs the last command beginning with ‘cc’ and typing ‘r’ re-" +"executes\n" +" the last command.\n" +" \n" +" Exit Status:\n" +" Returns success or status of executed command; non-zero if an error " +"occurs." + +#: builtins.c:755 +msgid "" +"Move job to the foreground.\n" +" \n" +" Place the job identified by JOB_SPEC in the foreground, making it the\n" +" current job. If JOB_SPEC is not present, the shell's notion of the\n" +" current job is used.\n" +" \n" +" Exit Status:\n" +" Status of command placed in foreground, or failure if an error occurs." +msgstr "" +"Move job to the foreground.\n" +" \n" +" Place the job identified by JOB_SPEC in the foreground, making it the\n" +" current job. If JOB_SPEC is not present, the shell's notion of the\n" +" current job is used.\n" +" \n" +" Exit Status:\n" +" Status of command placed in foreground, or failure if an error occurs." + +#: builtins.c:770 +msgid "" +"Move jobs to the background.\n" +" \n" +" Place the jobs identified by each JOB_SPEC in the background, as if " +"they\n" +" had been started with `&'. If JOB_SPEC is not present, the shell's " +"notion\n" +" of the current job is used.\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Move jobs to the background.\n" +" \n" +" Place the jobs identified by each JOB_SPEC in the background, as if " +"they\n" +" had been started with ‘&’. If JOB_SPEC is not present, the " +"shell's notion\n" +" of the current job is used.\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." + +#: builtins.c:784 +msgid "" +"Remember or display program locations.\n" +" \n" +" Determine and remember the full pathname of each command NAME. If\n" +" no arguments are given, information about remembered commands is " +"displayed.\n" +" \n" +" Options:\n" +" -d\t\tforget the remembered location of each NAME\n" +" -l\t\tdisplay in a format that may be reused as input\n" +" -p pathname\tuse PATHNAME as the full pathname of NAME\n" +" -r\t\tforget all remembered locations\n" +" -t\t\tprint the remembered location of each NAME, preceding\n" +" \t\teach location with the corresponding NAME if multiple\n" +" \t\tNAMEs are given\n" +" Arguments:\n" +" NAME\t\tEach NAME is searched for in $PATH and added to the list\n" +" \t\tof remembered commands.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not found or an invalid option is given." +msgstr "" +"Remember or display program locations.\n" +" \n" +" Determine and remember the full pathname of each command NAME. If\n" +" no arguments are given, information about remembered commands is " +"displayed.\n" +" \n" +" Options:\n" +" -d\t\tforget the remembered location of each NAME\n" +" -l\t\tdisplay in a format that may be reused as input\n" +" -p pathname\tuse PATHNAME as the full pathname of NAME\n" +" -r\t\tforget all remembered locations\n" +" -t\t\tprint the remembered location of each NAME, preceding\n" +" \t\teach location with the corresponding NAME if multiple\n" +" \t\tNAMEs are given\n" +" Arguments:\n" +" NAME\t\tEach NAME is searched for in $PATH and added to the list\n" +" \t\tof remembered commands.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not found or an invalid option is given." + +#: builtins.c:809 +msgid "" +"Display information about builtin commands.\n" +" \n" +" Displays brief summaries of builtin commands. If PATTERN is\n" +" specified, gives detailed help on all commands matching PATTERN,\n" +" otherwise the list of help topics is printed.\n" +" \n" +" Options:\n" +" -d\toutput short description for each topic\n" +" -m\tdisplay usage in pseudo-manpage format\n" +" -s\toutput only a short usage synopsis for each topic matching\n" +" \tPATTERN\n" +" \n" +" Arguments:\n" +" PATTERN\tPattern specifiying a help topic\n" +" \n" +" Exit Status:\n" +" Returns success unless PATTERN is not found or an invalid option is " +"given." +msgstr "" +"Display information about builtin commands.\n" +" \n" +" Displays brief summaries of builtin commands. If PATTERN is\n" +" specified, gives detailed help on all commands matching PATTERN,\n" +" otherwise the list of help topics is printed.\n" +" \n" +" Options:\n" +" -d\toutput short description for each topic\n" +" -m\tdisplay usage in pseudo-manpage format\n" +" -s\toutput only a short usage synopsis for each topic matching\n" +" \tPATTERN\n" +" \n" +" Arguments:\n" +" PATTERN\tPattern specifiying a help topic\n" +" \n" +" Exit Status:\n" +" Returns success unless PATTERN is not found or an invalid option is " +"given." + +#: builtins.c:833 +msgid "" +"Display or manipulate the history list.\n" +" \n" +" Display the history list with line numbers, prefixing each modified\n" +" entry with a `*'. An argument of N lists only the last N entries.\n" +" \n" +" Options:\n" +" -c\tclear the history list by deleting all of the entries\n" +" -d offset\tdelete the history entry at offset OFFSET.\n" +" \n" +" -a\tappend history lines from this session to the history file\n" +" -n\tread all history lines not already read from the history file\n" +" -r\tread the history file and append the contents to the history\n" +" \tlist\n" +" -w\twrite the current history to the history file\n" +" \tand append them to the history list\n" +" \n" +" -p\tperform history expansion on each ARG and display the result\n" +" \twithout storing it in the history list\n" +" -s\tappend the ARGs to the history list as a single entry\n" +" \n" +" If FILENAME is given, it is used as the history file. Otherwise,\n" +" if $HISTFILE has a value, that is used, else ~/.bash_history.\n" +" \n" +" If the $HISTTIMEFORMAT variable is set and not null, its value is used\n" +" as a format string for strftime(3) to print the time stamp associated\n" +" with each displayed history entry. No time stamps are printed " +"otherwise.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" +"Display or manipulate the history list.\n" +" \n" +" Display the history list with line numbers, prefixing each modified\n" +" entry with a ‘*’. An argument of N lists only the last N " +"entries.\n" +" \n" +" Options:\n" +" -c\tclear the history list by deleting all of the entries\n" +" -d offset\tdelete the history entry at offset OFFSET.\n" +" \n" +" -a\tappend history lines from this session to the history file\n" +" -n\tread all history lines not already read from the history file\n" +" -r\tread the history file and append the contents to the history\n" +" \tlist\n" +" -w\twrite the current history to the history file\n" +" \tand append them to the history list\n" +" \n" +" -p\tperform history expansion on each ARG and display the result\n" +" \twithout storing it in the history list\n" +" -s\tappend the ARGs to the history list as a single entry\n" +" \n" +" If FILENAME is given, it is used as the history file. Otherwise,\n" +" if $HISTFILE has a value, that is used, else ~/.bash_history.\n" +" \n" +" If the $HISTTIMEFORMAT variable is set and not null, its value is used\n" +" as a format string for strftime(3) to print the time stamp associated\n" +" with each displayed history entry. No time stamps are printed " +"otherwise.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." + +#: builtins.c:869 +msgid "" +"Display status of jobs.\n" +" \n" +" Lists the active jobs. JOBSPEC restricts output to that job.\n" +" Without options, the status of all active jobs is displayed.\n" +" \n" +" Options:\n" +" -l\tlists process IDs in addition to the normal information\n" +" -n\tlists only processes that have changed status since the last\n" +" \tnotification\n" +" -p\tlists process IDs only\n" +" -r\trestrict output to running jobs\n" +" -s\trestrict output to stopped jobs\n" +" \n" +" If -x is supplied, COMMAND is run after all job specifications that\n" +" appear in ARGS have been replaced with the process ID of that job's\n" +" process group leader.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs.\n" +" If -x is used, returns the exit status of COMMAND." +msgstr "" +"Display status of jobs.\n" +" \n" +" Lists the active jobs. JOBSPEC restricts output to that job.\n" +" Without options, the status of all active jobs is displayed.\n" +" \n" +" Options:\n" +" -l\tlists process IDs in addition to the normal information\n" +" -n\tlists only processes that have changed status since the last\n" +" \tnotification\n" +" -p\tlists process IDs only\n" +" -r\trestrict output to running jobs\n" +" -s\trestrict output to stopped jobs\n" +" \n" +" If -x is supplied, COMMAND is run after all job specifications that\n" +" appear in ARGS have been replaced with the process ID of that job's\n" +" process group leader.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs.\n" +" If -x is used, returns the exit status of COMMAND." + +#: builtins.c:896 +msgid "" +"Remove jobs from current shell.\n" +" \n" +" Removes each JOBSPEC argument from the table of active jobs. Without\n" +" any JOBSPECs, the shell uses its notion of the current job.\n" +" \n" +" Options:\n" +" -a\tremove all jobs if JOBSPEC is not supplied\n" +" -h\tmark each JOBSPEC so that SIGHUP is not sent to the job if the\n" +" \tshell receives a SIGHUP\n" +" -r\tremove only running jobs\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option or JOBSPEC is given." +msgstr "" +"Remove jobs from current shell.\n" +" \n" +" Removes each JOBSPEC argument from the table of active jobs. Without\n" +" any JOBSPECs, the shell uses its notion of the current job.\n" +" \n" +" Options:\n" +" -a\tremove all jobs if JOBSPEC is not supplied\n" +" -h\tmark each JOBSPEC so that SIGHUP is not sent to the job if the\n" +" \tshell receives a SIGHUP\n" +" -r\tremove only running jobs\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option or JOBSPEC is given." + +#: builtins.c:915 +msgid "" +"Send a signal to a job.\n" +" \n" +" Send the processes identified by PID or JOBSPEC the signal named by\n" +" SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n" +" SIGTERM is assumed.\n" +" \n" +" Options:\n" +" -s sig\tSIG is a signal name\n" +" -n sig\tSIG is a signal number\n" +" -l\tlist the signal names; if arguments follow `-l' they are\n" +" \tassumed to be signal numbers for which names should be listed\n" +" \n" +" Kill is a shell builtin for two reasons: it allows job IDs to be used\n" +" instead of process IDs, and allows processes to be killed if the limit\n" +" on processes that you can create is reached.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" +"Send a signal to a job.\n" +" \n" +" Send the processes identified by PID or JOBSPEC the signal named by\n" +" SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n" +" SIGTERM is assumed.\n" +" \n" +" Options:\n" +" -s sig\tSIG is a signal name\n" +" -n sig\tSIG is a signal number\n" +" -l\tlist the signal names; if arguments follow ‘-l’ they are\n" +" \tassumed to be signal numbers for which names should be listed\n" +" \n" +" Kill is a shell builtin for two reasons: it allows job IDs to be used\n" +" instead of process IDs, and allows processes to be killed if the limit\n" +" on processes that you can create is reached.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." + +#: builtins.c:938 +msgid "" +"Evaluate arithmetic expressions.\n" +" \n" +" Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" +" fixed-width integers with no check for overflow, though division by 0\n" +" is trapped and flagged as an error. The following list of operators is\n" +" grouped into levels of equal-precedence operators. The levels are " +"listed\n" +" in order of decreasing precedence.\n" +" \n" +" \tid++, id--\tvariable post-increment, post-decrement\n" +" \t++id, --id\tvariable pre-increment, pre-decrement\n" +" \t-, +\t\tunary minus, plus\n" +" \t!, ~\t\tlogical and bitwise negation\n" +" \t**\t\texponentiation\n" +" \t*, /, %\t\tmultiplication, division, remainder\n" +" \t+, -\t\taddition, subtraction\n" +" \t<<, >>\t\tleft and right bitwise shifts\n" +" \t<=, >=, <, >\tcomparison\n" +" \t==, !=\t\tequality, inequality\n" +" \t&\t\tbitwise AND\n" +" \t^\t\tbitwise XOR\n" +" \t|\t\tbitwise OR\n" +" \t&&\t\tlogical AND\n" +" \t||\t\tlogical OR\n" +" \texpr ? expr : expr\n" +" \t\t\tconditional operator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tassignment\n" +" \n" +" Shell variables are allowed as operands. The name of the variable\n" +" is replaced by its value (coerced to a fixed-width integer) within\n" +" an expression. The variable need not have its integer attribute\n" +" turned on to be used in an expression.\n" +" \n" +" Operators are evaluated in order of precedence. Sub-expressions in\n" +" parentheses are evaluated first and may override the precedence\n" +" rules above.\n" +" \n" +" Exit Status:\n" +" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." +msgstr "" +"Evaluate arithmetic expressions.\n" +" \n" +" Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" +" fixed-width integers with no check for overflow, though division by 0\n" +" is trapped and flagged as an error. The following list of operators is\n" +" grouped into levels of equal-precedence operators. The levels are " +"listed\n" +" in order of decreasing precedence.\n" +" \n" +" \tid++, id--\tvariable post-increment, post-decrement\n" +" \t++id, --id\tvariable pre-increment, pre-decrement\n" +" \t-, +\t\tunary minus, plus\n" +" \t!, ~\t\tlogical and bitwise negation\n" +" \t**\t\texponentiation\n" +" \t*, /, %\t\tmultiplication, division, remainder\n" +" \t+, -\t\taddition, subtraction\n" +" \t<<, >>\t\tleft and right bitwise shifts\n" +" \t<=, >=, <, >\tcomparison\n" +" \t==, !=\t\tequality, inequality\n" +" \t&\t\tbitwise AND\n" +" \t^\t\tbitwise XOR\n" +" \t|\t\tbitwise OR\n" +" \t&&\t\tlogical AND\n" +" \t||\t\tlogical OR\n" +" \texpr ? expr : expr\n" +" \t\t\tconditional operator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tassignment\n" +" \n" +" Shell variables are allowed as operands. The name of the variable\n" +" is replaced by its value (coerced to a fixed-width integer) within\n" +" an expression. The variable need not have its integer attribute\n" +" turned on to be used in an expression.\n" +" \n" +" Operators are evaluated in order of precedence. Sub-expressions in\n" +" parentheses are evaluated first and may override the precedence\n" +" rules above.\n" +" \n" +" Exit Status:\n" +" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." + +#: builtins.c:983 +msgid "" +"Read a line from the standard input and split it into fields.\n" +" \n" +" Reads a single line from the standard input, or from file descriptor FD\n" +" if the -u option is supplied. The line is split into fields as with " +"word\n" +" splitting, and the first word is assigned to the first NAME, the second\n" +" word to the second NAME, and so on, with any leftover words assigned to\n" +" the last NAME. Only the characters found in $IFS are recognized as " +"word\n" +" delimiters.\n" +" \n" +" If no NAMEs are supplied, the line read is stored in the REPLY " +"variable.\n" +" \n" +" Options:\n" +" -a array\tassign the words read to sequential indices of the array\n" +" \t\tvariable ARRAY, starting at zero\n" +" -d delim\tcontinue until the first character of DELIM is read, rather\n" +" \t\tthan newline\n" +" -e\t\tuse Readline to obtain the line in an interactive shell\n" +" -i text\tUse TEXT as the initial text for Readline\n" +" -n nchars\treturn after reading NCHARS characters rather than waiting\n" +" \t\tfor a newline, but honor a delimiter if fewer than NCHARS\n" +" \t\tcharacters are read before the delimiter\n" +" -N nchars\treturn only after reading exactly NCHARS characters, " +"unless\n" +" \t\tEOF is encountered or read times out, ignoring any delimiter\n" +" -p prompt\toutput the string PROMPT without a trailing newline before\n" +" \t\tattempting to read\n" +" -r\t\tdo not allow backslashes to escape any characters\n" +" -s\t\tdo not echo input coming from a terminal\n" +" -t timeout\ttime out and return failure if a complete line of input " +"is\n" +" \t\tnot read within TIMEOUT seconds. The value of the TMOUT\n" +" \t\tvariable is the default timeout. TIMEOUT may be a\n" +" \t\tfractional number. If TIMEOUT is 0, read returns immediately,\n" +" \t\twithout trying to read any data, returning success only if\n" +" \t\tinput is available on the specified file descriptor. The\n" +" \t\texit status is greater than 128 if the timeout is exceeded\n" +" -u fd\t\tread from file descriptor FD instead of the standard input\n" +" \n" +" Exit Status:\n" +" The return code is zero, unless end-of-file is encountered, read times " +"out\n" +" (in which case it's greater than 128), a variable assignment error " +"occurs,\n" +" or an invalid file descriptor is supplied as the argument to -u." +msgstr "" +"Read a line from the standard input and split it into fields.\n" +" \n" +" Reads a single line from the standard input, or from file descriptor FD\n" +" if the -u option is supplied. The line is split into fields as with " +"word\n" +" splitting, and the first word is assigned to the first NAME, the second\n" +" word to the second NAME, and so on, with any leftover words assigned to\n" +" the last NAME. Only the characters found in $IFS are recognized as " +"word\n" +" delimiters.\n" +" \n" +" If no NAMEs are supplied, the line read is stored in the REPLY " +"variable.\n" +" \n" +" Options:\n" +" -a array\tassign the words read to sequential indices of the array\n" +" \t\tvariable ARRAY, starting at zero\n" +" -d delim\tcontinue until the first character of DELIM is read, rather\n" +" \t\tthan newline\n" +" -e\t\tuse Readline to obtain the line in an interactive shell\n" +" -i text\tUse TEXT as the initial text for Readline\n" +" -n nchars\treturn after reading NCHARS characters rather than waiting\n" +" \t\tfor a newline, but honor a delimiter if fewer than NCHARS\n" +" \t\tcharacters are read before the delimiter\n" +" -N nchars\treturn only after reading exactly NCHARS characters, " +"unless\n" +" \t\tEOF is encountered or read times out, ignoring any delimiter\n" +" -p prompt\toutput the string PROMPT without a trailing newline before\n" +" \t\tattempting to read\n" +" -r\t\tdo not allow backslashes to escape any characters\n" +" -s\t\tdo not echo input coming from a terminal\n" +" -t timeout\ttime out and return failure if a complete line of input " +"is\n" +" \t\tnot read within TIMEOUT seconds. The value of the TMOUT\n" +" \t\tvariable is the default timeout. TIMEOUT may be a\n" +" \t\tfractional number. If TIMEOUT is 0, read returns immediately,\n" +" \t\twithout trying to read any data, returning success only if\n" +" \t\tinput is available on the specified file descriptor. The\n" +" \t\texit status is greater than 128 if the timeout is exceeded\n" +" -u fd\t\tread from file descriptor FD instead of the standard input\n" +" \n" +" Exit Status:\n" +" The return code is zero, unless end-of-file is encountered, read times " +"out\n" +" (in which case it's greater than 128), a variable assignment error " +"occurs,\n" +" or an invalid file descriptor is supplied as the argument to -u." + +#: builtins.c:1028 +msgid "" +"Return from a shell function.\n" +" \n" +" Causes a function or sourced script to exit with the return value\n" +" specified by N. If N is omitted, the return status is that of the\n" +" last command executed within the function or script.\n" +" \n" +" Exit Status:\n" +" Returns N, or failure if the shell is not executing a function or script." +msgstr "" +"Return from a shell function.\n" +" \n" +" Causes a function or sourced script to exit with the return value\n" +" specified by N. If N is omitted, the return status is that of the\n" +" last command executed within the function or script.\n" +" \n" +" Exit Status:\n" +" Returns N, or failure if the shell is not executing a function or script." + +#: builtins.c:1041 +msgid "" +"Set or unset values of shell options and positional parameters.\n" +" \n" +" Change the value of shell attributes and positional parameters, or\n" +" display the names and values of shell variables.\n" +" \n" +" Options:\n" +" -a Mark variables which are modified or created for export.\n" +" -b Notify of job termination immediately.\n" +" -e Exit immediately if a command exits with a non-zero status.\n" +" -f Disable file name generation (globbing).\n" +" -h Remember the location of commands as they are looked up.\n" +" -k All assignment arguments are placed in the environment for a\n" +" command, not just those that precede the command name.\n" +" -m Job control is enabled.\n" +" -n Read commands but do not execute them.\n" +" -o option-name\n" +" Set the variable corresponding to option-name:\n" +" allexport same as -a\n" +" braceexpand same as -B\n" +" emacs use an emacs-style line editing interface\n" +" errexit same as -e\n" +" errtrace same as -E\n" +" functrace same as -T\n" +" hashall same as -h\n" +" histexpand same as -H\n" +" history enable command history\n" +" ignoreeof the shell will not exit upon reading EOF\n" +" interactive-comments\n" +" allow comments to appear in interactive commands\n" +" keyword same as -k\n" +" monitor same as -m\n" +" noclobber same as -C\n" +" noexec same as -n\n" +" noglob same as -f\n" +" nolog currently accepted but ignored\n" +" notify same as -b\n" +" nounset same as -u\n" +" onecmd same as -t\n" +" physical same as -P\n" +" pipefail the return value of a pipeline is the status of\n" +" the last command to exit with a non-zero status,\n" +" or zero if no command exited with a non-zero " +"status\n" +" posix change the behavior of bash where the default\n" +" operation differs from the Posix standard to\n" +" match the standard\n" +" privileged same as -p\n" +" verbose same as -v\n" +" vi use a vi-style line editing interface\n" +" xtrace same as -x\n" +" -p Turned on whenever the real and effective user ids do not match.\n" +" Disables processing of the $ENV file and importing of shell\n" +" functions. Turning this option off causes the effective uid and\n" +" gid to be set to the real uid and gid.\n" +" -t Exit after reading and executing one command.\n" +" -u Treat unset variables as an error when substituting.\n" +" -v Print shell input lines as they are read.\n" +" -x Print commands and their arguments as they are executed.\n" +" -B the shell will perform brace expansion\n" +" -C If set, disallow existing regular files to be overwritten\n" +" by redirection of output.\n" +" -E If set, the ERR trap is inherited by shell functions.\n" +" -H Enable ! style history substitution. This flag is on\n" +" by default when the shell is interactive.\n" +" -P If set, do not resolve symbolic links when executing commands\n" +" such as cd which change the current directory.\n" +" -T If set, the DEBUG trap is inherited by shell functions.\n" +" -- Assign any remaining arguments to the positional parameters.\n" +" If there are no remaining arguments, the positional parameters\n" +" are unset.\n" +" - Assign any remaining arguments to the positional parameters.\n" +" The -x and -v options are turned off.\n" +" \n" +" Using + rather than - causes these flags to be turned off. The\n" +" flags can also be used upon invocation of the shell. The current\n" +" set of flags may be found in $-. The remaining n ARGs are positional\n" +" parameters and are assigned, in order, to $1, $2, .. $n. If no\n" +" ARGs are given, all shell variables are printed.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given." +msgstr "" +"Set or unset values of shell options and positional parameters.\n" +" \n" +" Change the value of shell attributes and positional parameters, or\n" +" display the names and values of shell variables.\n" +" \n" +" Options:\n" +" -a Mark variables which are modified or created for export.\n" +" -b Notify of job termination immediately.\n" +" -e Exit immediately if a command exits with a non-zero status.\n" +" -f Disable file name generation (globbing).\n" +" -h Remember the location of commands as they are looked up.\n" +" -k All assignment arguments are placed in the environment for a\n" +" command, not just those that precede the command name.\n" +" -m Job control is enabled.\n" +" -n Read commands but do not execute them.\n" +" -o option-name\n" +" Set the variable corresponding to option-name:\n" +" allexport same as -a\n" +" braceexpand same as -B\n" +" emacs use an emacs-style line editing interface\n" +" errexit same as -e\n" +" errtrace same as -E\n" +" functrace same as -T\n" +" hashall same as -h\n" +" histexpand same as -H\n" +" history enable command history\n" +" ignoreeof the shell will not exit upon reading EOF\n" +" interactive-comments\n" +" allow comments to appear in interactive commands\n" +" keyword same as -k\n" +" monitor same as -m\n" +" noclobber same as -C\n" +" noexec same as -n\n" +" noglob same as -f\n" +" nolog currently accepted but ignored\n" +" notify same as -b\n" +" nounset same as -u\n" +" onecmd same as -t\n" +" physical same as -P\n" +" pipefail the return value of a pipeline is the status of\n" +" the last command to exit with a non-zero status,\n" +" or zero if no command exited with a non-zero " +"status\n" +" posix change the behavior of bash where the default\n" +" operation differs from the Posix standard to\n" +" match the standard\n" +" privileged same as -p\n" +" verbose same as -v\n" +" vi use a vi-style line editing interface\n" +" xtrace same as -x\n" +" -p Turned on whenever the real and effective user ids do not match.\n" +" Disables processing of the $ENV file and importing of shell\n" +" functions. Turning this option off causes the effective uid and\n" +" gid to be set to the real uid and gid.\n" +" -t Exit after reading and executing one command.\n" +" -u Treat unset variables as an error when substituting.\n" +" -v Print shell input lines as they are read.\n" +" -x Print commands and their arguments as they are executed.\n" +" -B the shell will perform brace expansion\n" +" -C If set, disallow existing regular files to be overwritten\n" +" by redirection of output.\n" +" -E If set, the ERR trap is inherited by shell functions.\n" +" -H Enable ! style history substitution. This flag is on\n" +" by default when the shell is interactive.\n" +" -P If set, do not resolve symbolic links when executing commands\n" +" such as cd which change the current directory.\n" +" -T If set, the DEBUG trap is inherited by shell functions.\n" +" -- Assign any remaining arguments to the positional parameters.\n" +" If there are no remaining arguments, the positional parameters\n" +" are unset.\n" +" - Assign any remaining arguments to the positional parameters.\n" +" The -x and -v options are turned off.\n" +" \n" +" Using + rather than - causes these flags to be turned off. The\n" +" flags can also be used upon invocation of the shell. The current\n" +" set of flags may be found in $-. The remaining n ARGs are positional\n" +" parameters and are assigned, in order, to $1, $2, .. $n. If no\n" +" ARGs are given, all shell variables are printed.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given." + +#: builtins.c:1126 +msgid "" +"Unset values and attributes of shell variables and functions.\n" +" \n" +" For each NAME, remove the corresponding variable or function.\n" +" \n" +" Options:\n" +" -f\ttreat each NAME as a shell function\n" +" -v\ttreat each NAME as a shell variable\n" +" -n\ttreat each NAME as a name reference and unset the variable itself\n" +" \trather than the variable it references\n" +" \n" +" Without options, unset first tries to unset a variable, and if that " +"fails,\n" +" tries to unset a function.\n" +" \n" +" Some variables cannot be unset; also see `readonly'.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a NAME is read-only." +msgstr "" +"Unset values and attributes of shell variables and functions.\n" +" \n" +" For each NAME, remove the corresponding variable or function.\n" +" \n" +" Options:\n" +" -f\ttreat each NAME as a shell function\n" +" -v\ttreat each NAME as a shell variable\n" +" -n\ttreat each NAME as a name reference and unset the variable itself\n" +" \trather than the variable it references\n" +" \n" +" Without options, unset first tries to unset a variable, and if that " +"fails,\n" +" tries to unset a function.\n" +" \n" +" Some variables cannot be unset; also see ‘readonly’.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a NAME is read-only." + +#: builtins.c:1148 +msgid "" +"Set export attribute for shell variables.\n" +" \n" +" Marks each NAME for automatic export to the environment of subsequently\n" +" executed commands. If VALUE is supplied, assign VALUE before " +"exporting.\n" +" \n" +" Options:\n" +" -f\trefer to shell functions\n" +" -n\tremove the export property from each NAME\n" +" -p\tdisplay a list of all exported variables and functions\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" +"Set export attribute for shell variables.\n" +" \n" +" Marks each NAME for automatic export to the environment of subsequently\n" +" executed commands. If VALUE is supplied, assign VALUE before " +"exporting.\n" +" \n" +" Options:\n" +" -f\trefer to shell functions\n" +" -n\tremove the export property from each NAME\n" +" -p\tdisplay a list of all exported variables and functions\n" +" \n" +" An argument of ‘--’ disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." + +#: builtins.c:1167 +msgid "" +"Mark shell variables as unchangeable.\n" +" \n" +" Mark each NAME as read-only; the values of these NAMEs may not be\n" +" changed by subsequent assignment. If VALUE is supplied, assign VALUE\n" +" before marking as read-only.\n" +" \n" +" Options:\n" +" -a\trefer to indexed array variables\n" +" -A\trefer to associative array variables\n" +" -f\trefer to shell functions\n" +" -p\tdisplay a list of all readonly variables or functions, depending " +"on\n" +" whether or not the -f option is given\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" +"Mark shell variables as unchangeable.\n" +" \n" +" Mark each NAME as read-only; the values of these NAMEs may not be\n" +" changed by subsequent assignment. If VALUE is supplied, assign VALUE\n" +" before marking as read-only.\n" +" \n" +" Options:\n" +" -a\trefer to indexed array variables\n" +" -A\trefer to associative array variables\n" +" -f\trefer to shell functions\n" +" -p\tdisplay a list of all readonly variables or functions, depending " +"on\n" +" whether or not the -f option is given\n" +" \n" +" An argument of ‘--’ disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." + +#: builtins.c:1189 +msgid "" +"Shift positional parameters.\n" +" \n" +" Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n" +" not given, it is assumed to be 1.\n" +" \n" +" Exit Status:\n" +" Returns success unless N is negative or greater than $#." +msgstr "" +"Shift positional parameters.\n" +" \n" +" Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n" +" not given, it is assumed to be 1.\n" +" \n" +" Exit Status:\n" +" Returns success unless N is negative or greater than $#." + +#: builtins.c:1201 builtins.c:1216 +msgid "" +"Execute commands from a file in the current shell.\n" +" \n" +" Read and execute commands from FILENAME in the current shell. The\n" +" entries in $PATH are used to find the directory containing FILENAME.\n" +" If any ARGUMENTS are supplied, they become the positional parameters\n" +" when FILENAME is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed in FILENAME; fails if\n" +" FILENAME cannot be read." +msgstr "" +"Execute commands from a file in the current shell.\n" +" \n" +" Read and execute commands from FILENAME in the current shell. The\n" +" entries in $PATH are used to find the directory containing FILENAME.\n" +" If any ARGUMENTS are supplied, they become the positional parameters\n" +" when FILENAME is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed in FILENAME; fails if\n" +" FILENAME cannot be read." + +#: builtins.c:1232 +msgid "" +"Suspend shell execution.\n" +" \n" +" Suspend the execution of this shell until it receives a SIGCONT signal.\n" +" Unless forced, login shells cannot be suspended.\n" +" \n" +" Options:\n" +" -f\tforce the suspend, even if the shell is a login shell\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Suspend shell execution.\n" +" \n" +" Suspend the execution of this shell until it receives a SIGCONT signal.\n" +" Unless forced, login shells cannot be suspended.\n" +" \n" +" Options:\n" +" -f\tforce the suspend, even if the shell is a login shell\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." + +#: builtins.c:1248 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" Exits with a status of 0 (true) or 1 (false) depending on\n" +" the evaluation of EXPR. Expressions may be unary or binary. Unary\n" +" expressions are often used to examine the status of a file. There\n" +" are string operators and numeric comparison operators as well.\n" +" \n" +" The behavior of test depends on the number of arguments. Read the\n" +" bash manual page for the complete specification.\n" +" \n" +" File operators:\n" +" \n" +" -a FILE True if file exists.\n" +" -b FILE True if file is block special.\n" +" -c FILE True if file is character special.\n" +" -d FILE True if file is a directory.\n" +" -e FILE True if file exists.\n" +" -f FILE True if file exists and is a regular file.\n" +" -g FILE True if file is set-group-id.\n" +" -h FILE True if file is a symbolic link.\n" +" -L FILE True if file is a symbolic link.\n" +" -k FILE True if file has its `sticky' bit set.\n" +" -p FILE True if file is a named pipe.\n" +" -r FILE True if file is readable by you.\n" +" -s FILE True if file exists and is not empty.\n" +" -S FILE True if file is a socket.\n" +" -t FD True if FD is opened on a terminal.\n" +" -u FILE True if the file is set-user-id.\n" +" -w FILE True if the file is writable by you.\n" +" -x FILE True if the file is executable by you.\n" +" -O FILE True if the file is effectively owned by you.\n" +" -G FILE True if the file is effectively owned by your group.\n" +" -N FILE True if the file has been modified since it was last " +"read.\n" +" \n" +" FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" +" modification date).\n" +" \n" +" FILE1 -ot FILE2 True if file1 is older than file2.\n" +" \n" +" FILE1 -ef FILE2 True if file1 is a hard link to file2.\n" +" \n" +" String operators:\n" +" \n" +" -z STRING True if string is empty.\n" +" \n" +" -n STRING\n" +" STRING True if string is not empty.\n" +" \n" +" STRING1 = STRING2\n" +" True if the strings are equal.\n" +" STRING1 != STRING2\n" +" True if the strings are not equal.\n" +" STRING1 < STRING2\n" +" True if STRING1 sorts before STRING2 " +"lexicographically.\n" +" STRING1 > STRING2\n" +" True if STRING1 sorts after STRING2 lexicographically.\n" +" \n" +" Other operators:\n" +" \n" +" -o OPTION True if the shell option OPTION is enabled.\n" +" -v VAR\t True if the shell variable VAR is set\n" +" -R VAR\t True if the shell variable VAR is set and is a name " +"reference.\n" +" ! EXPR True if expr is false.\n" +" EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n" +" EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n" +" \n" +" arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Arithmetic binary operators return true if ARG1 is equal, not-equal,\n" +" less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n" +" than ARG2.\n" +" \n" +" Exit Status:\n" +" Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n" +" false or an invalid argument is given." +msgstr "" +"Evaluate conditional expression.\n" +" \n" +" Exits with a status of 0 (true) or 1 (false) depending on\n" +" the evaluation of EXPR. Expressions may be unary or binary. Unary\n" +" expressions are often used to examine the status of a file. There\n" +" are string operators and numeric comparison operators as well.\n" +" \n" +" The behavior of test depends on the number of arguments. Read the\n" +" bash manual page for the complete specification.\n" +" \n" +" File operators:\n" +" \n" +" -a FILE True if file exists.\n" +" -b FILE True if file is block special.\n" +" -c FILE True if file is character special.\n" +" -d FILE True if file is a directory.\n" +" -e FILE True if file exists.\n" +" -f FILE True if file exists and is a regular file.\n" +" -g FILE True if file is set-group-id.\n" +" -h FILE True if file is a symbolic link.\n" +" -L FILE True if file is a symbolic link.\n" +" -k FILE True if file has its ‘sticky’ bit set.\n" +" -p FILE True if file is a named pipe.\n" +" -r FILE True if file is readable by you.\n" +" -s FILE True if file exists and is not empty.\n" +" -S FILE True if file is a socket.\n" +" -t FD True if FD is opened on a terminal.\n" +" -u FILE True if the file is set-user-id.\n" +" -w FILE True if the file is writable by you.\n" +" -x FILE True if the file is executable by you.\n" +" -O FILE True if the file is effectively owned by you.\n" +" -G FILE True if the file is effectively owned by your group.\n" +" -N FILE True if the file has been modified since it was last " +"read.\n" +" \n" +" FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" +" modification date).\n" +" \n" +" FILE1 -ot FILE2 True if file1 is older than file2.\n" +" \n" +" FILE1 -ef FILE2 True if file1 is a hard link to file2.\n" +" \n" +" String operators:\n" +" \n" +" -z STRING True if string is empty.\n" +" \n" +" -n STRING\n" +" STRING True if string is not empty.\n" +" \n" +" STRING1 = STRING2\n" +" True if the strings are equal.\n" +" STRING1 != STRING2\n" +" True if the strings are not equal.\n" +" STRING1 < STRING2\n" +" True if STRING1 sorts before STRING2 " +"lexicographically.\n" +" STRING1 > STRING2\n" +" True if STRING1 sorts after STRING2 lexicographically.\n" +" \n" +" Other operators:\n" +" \n" +" -o OPTION True if the shell option OPTION is enabled.\n" +" -v VAR\t True if the shell variable VAR is set\n" +" -R VAR\t True if the shell variable VAR is set and is a name " +"reference.\n" +" ! EXPR True if expr is false.\n" +" EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n" +" EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n" +" \n" +" arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Arithmetic binary operators return true if ARG1 is equal, not-equal,\n" +" less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n" +" than ARG2.\n" +" \n" +" Exit Status:\n" +" Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n" +" false or an invalid argument is given." + +#: builtins.c:1329 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" This is a synonym for the \"test\" builtin, but the last argument must\n" +" be a literal `]', to match the opening `['." +msgstr "" +"Evaluate conditional expression.\n" +" \n" +" This is a synonym for the “test” builtin, but the last argument " +"must\n" +" be a literal ‘]’, to match the opening ‘[’." + +#: builtins.c:1338 +msgid "" +"Display process times.\n" +" \n" +" Prints the accumulated user and system times for the shell and all of " +"its\n" +" child processes.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Display process times.\n" +" \n" +" Prints the accumulated user and system times for the shell and all of " +"its\n" +" child processes.\n" +" \n" +" Exit Status:\n" +" Always succeeds." + +#: builtins.c:1350 +msgid "" +"Trap signals and other events.\n" +" \n" +" Defines and activates handlers to be run when the shell receives " +"signals\n" +" or other conditions.\n" +" \n" +" ARG is a command to be read and executed when the shell receives the\n" +" signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n" +" is supplied) or `-', each specified signal is reset to its original\n" +" value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" +" shell and by the commands it invokes.\n" +" \n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. " +"If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. " +"If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or " +"a\n" +" script run by the . or source builtins finishes executing. A " +"SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause " +"the\n" +" shell to exit when the -e option is enabled.\n" +" \n" +" If no arguments are supplied, trap prints the list of commands " +"associated\n" +" with each signal.\n" +" \n" +" Options:\n" +" -l\tprint a list of signal names and their corresponding numbers\n" +" -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" +" \n" +" Each SIGNAL_SPEC is either a signal name in or a signal " +"number.\n" +" Signal names are case insensitive and the SIG prefix is optional. A\n" +" signal may be sent to the shell with \"kill -signal $$\".\n" +" \n" +" Exit Status:\n" +" Returns success unless a SIGSPEC is invalid or an invalid option is " +"given." +msgstr "" +"Trap signals and other events.\n" +" \n" +" Defines and activates handlers to be run when the shell receives " +"signals\n" +" or other conditions.\n" +" \n" +" ARG is a command to be read and executed when the shell receives the\n" +" signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n" +" is supplied) or ‘-’, each specified signal is reset to its " +"original\n" +" value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" +" shell and by the commands it invokes.\n" +" \n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. " +"If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. " +"If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or " +"a\n" +" script run by the . or source builtins finishes executing. A " +"SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause " +"the\n" +" shell to exit when the -e option is enabled.\n" +" \n" +" If no arguments are supplied, trap prints the list of commands " +"associated\n" +" with each signal.\n" +" \n" +" Options:\n" +" -l\tprint a list of signal names and their corresponding numbers\n" +" -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" +" \n" +" Each SIGNAL_SPEC is either a signal name in or a signal " +"number.\n" +" Signal names are case insensitive and the SIG prefix is optional. A\n" +" signal may be sent to the shell with “kill -signal $$”.\n" +" \n" +" Exit Status:\n" +" Returns success unless a SIGSPEC is invalid or an invalid option is " +"given." + +#: builtins.c:1386 +msgid "" +"Display information about command type.\n" +" \n" +" For each NAME, indicate how it would be interpreted if used as a\n" +" command name.\n" +" \n" +" Options:\n" +" -a\tdisplay all locations containing an executable named NAME;\n" +" \tincludes aliases, builtins, and functions, if and only if\n" +" \tthe `-p' option is not also used\n" +" -f\tsuppress shell function lookup\n" +" -P\tforce a PATH search for each NAME, even if it is an alias,\n" +" \tbuiltin, or function, and returns the name of the disk file\n" +" \tthat would be executed\n" +" -p\treturns either the name of the disk file that would be executed,\n" +" \tor nothing if `type -t NAME' would not return `file'.\n" +" -t\toutput a single word which is one of `alias', `keyword',\n" +" \t`function', `builtin', `file' or `', if NAME is an alias, shell\n" +" \treserved word, shell function, shell builtin, disk file, or not\n" +" \tfound, respectively\n" +" \n" +" Arguments:\n" +" NAME\tCommand name to be interpreted.\n" +" \n" +" Exit Status:\n" +" Returns success if all of the NAMEs are found; fails if any are not " +"found." +msgstr "" +"Display information about command type.\n" +" \n" +" For each NAME, indicate how it would be interpreted if used as a\n" +" command name.\n" +" \n" +" Options:\n" +" -a\tdisplay all locations containing an executable named NAME;\n" +" \tincludes aliases, builtins, and functions, if and only if\n" +" \tthe ‘-p’ option is not also used\n" +" -f\tsuppress shell function lookup\n" +" -P\tforce a PATH search for each NAME, even if it is an alias,\n" +" \tbuiltin, or function, and returns the name of the disk file\n" +" \tthat would be executed\n" +" -p\treturns either the name of the disk file that would be executed,\n" +" \tor nothing if ‘type -t NAME’ would not return ‘file’.\n" +" -t\toutput a single word which is one of ‘alias’, " +"‘keyword’,\n" +" \t‘function’, ‘builtin’, ‘file’ or ‘’, if NAME " +"is an alias, shell\n" +" \treserved word, shell function, shell builtin, disk file, or not\n" +" \tfound, respectively\n" +" \n" +" Arguments:\n" +" NAME\tCommand name to be interpreted.\n" +" \n" +" Exit Status:\n" +" Returns success if all of the NAMEs are found; fails if any are not " +"found." + +#: builtins.c:1417 +msgid "" +"Modify shell resource limits.\n" +" \n" +" Provides control over the resources available to the shell and " +"processes\n" +" it creates, on systems that allow such control.\n" +" \n" +" Options:\n" +" -S\tuse the `soft' resource limit\n" +" -H\tuse the `hard' resource limit\n" +" -a\tall current limits are reported\n" +" -b\tthe socket buffer size\n" +" -c\tthe maximum size of core files created\n" +" -d\tthe maximum size of a process's data segment\n" +" -e\tthe maximum scheduling priority (`nice')\n" +" -f\tthe maximum size of files written by the shell and its children\n" +" -i\tthe maximum number of pending signals\n" +" -l\tthe maximum size a process may lock into memory\n" +" -m\tthe maximum resident set size\n" +" -n\tthe maximum number of open file descriptors\n" +" -p\tthe pipe buffer size\n" +" -q\tthe maximum number of bytes in POSIX message queues\n" +" -r\tthe maximum real-time scheduling priority\n" +" -s\tthe maximum stack size\n" +" -t\tthe maximum amount of cpu time in seconds\n" +" -u\tthe maximum number of user processes\n" +" -v\tthe size of virtual memory\n" +" -x\tthe maximum number of file locks\n" +" -T the maximum number of threads\n" +" \n" +" Not all options are available on all platforms.\n" +" \n" +" If LIMIT is given, it is the new value of the specified resource; the\n" +" special LIMIT values `soft', `hard', and `unlimited' stand for the\n" +" current soft limit, the current hard limit, and no limit, respectively.\n" +" Otherwise, the current value of the specified resource is printed. If\n" +" no option is given, then -f is assumed.\n" +" \n" +" Values are in 1024-byte increments, except for -t, which is in seconds,\n" +" -p, which is in increments of 512 bytes, and -u, which is an unscaled\n" +" number of processes.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Modify shell resource limits.\n" +" \n" +" Provides control over the resources available to the shell and " +"processes\n" +" it creates, on systems that allow such control.\n" +" \n" +" Options:\n" +" -S\tuse the ‘soft’ resource limit\n" +" -H\tuse the ‘hard’ resource limit\n" +" -a\tall current limits are reported\n" +" -b\tthe socket buffer size\n" +" -c\tthe maximum size of core files created\n" +" -d\tthe maximum size of a process's data segment\n" +" -e\tthe maximum scheduling priority (‘nice’)\n" +" -f\tthe maximum size of files written by the shell and its children\n" +" -i\tthe maximum number of pending signals\n" +" -l\tthe maximum size a process may lock into memory\n" +" -m\tthe maximum resident set size\n" +" -n\tthe maximum number of open file descriptors\n" +" -p\tthe pipe buffer size\n" +" -q\tthe maximum number of bytes in POSIX message queues\n" +" -r\tthe maximum real-time scheduling priority\n" +" -s\tthe maximum stack size\n" +" -t\tthe maximum amount of cpu time in seconds\n" +" -u\tthe maximum number of user processes\n" +" -v\tthe size of virtual memory\n" +" -x\tthe maximum number of file locks\n" +" -T the maximum number of threads\n" +" \n" +" Not all options are available on all platforms.\n" +" \n" +" If LIMIT is given, it is the new value of the specified resource; the\n" +" special LIMIT values ‘soft’, ‘hard’, and ‘unlimited’ " +"stand for the\n" +" current soft limit, the current hard limit, and no limit, respectively.\n" +" Otherwise, the current value of the specified resource is printed. If\n" +" no option is given, then -f is assumed.\n" +" \n" +" Values are in 1024-byte increments, except for -t, which is in seconds,\n" +" -p, which is in increments of 512 bytes, and -u, which is an unscaled\n" +" number of processes.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." + +#: builtins.c:1465 +msgid "" +"Display or set file mode mask.\n" +" \n" +" Sets the user file-creation mask to MODE. If MODE is omitted, prints\n" +" the current value of the mask.\n" +" \n" +" If MODE begins with a digit, it is interpreted as an octal number;\n" +" otherwise it is a symbolic mode string like that accepted by chmod(1).\n" +" \n" +" Options:\n" +" -p\tif MODE is omitted, output in a form that may be reused as input\n" +" -S\tmakes the output symbolic; otherwise an octal number is output\n" +" \n" +" Exit Status:\n" +" Returns success unless MODE is invalid or an invalid option is given." +msgstr "" +"Display or set file mode mask.\n" +" \n" +" Sets the user file-creation mask to MODE. If MODE is omitted, prints\n" +" the current value of the mask.\n" +" \n" +" If MODE begins with a digit, it is interpreted as an octal number;\n" +" otherwise it is a symbolic mode string like that accepted by chmod(1).\n" +" \n" +" Options:\n" +" -p\tif MODE is omitted, output in a form that may be reused as input\n" +" -S\tmakes the output symbolic; otherwise an octal number is output\n" +" \n" +" Exit Status:\n" +" Returns success unless MODE is invalid or an invalid option is given." + +#: builtins.c:1485 +msgid "" +"Wait for job completion and return exit status.\n" +" \n" +" Waits for each process identified by an ID, which may be a process ID or " +"a\n" +" job specification, and reports its termination status. If ID is not\n" +" given, waits for all currently active child processes, and the return\n" +" status is zero. If ID is a a job specification, waits for all " +"processes\n" +" in that job's pipeline.\n" +" \n" +" If the -n option is supplied, waits for the next job to terminate and\n" +" returns its exit status.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last ID; fails if ID is invalid or an invalid\n" +" option is given." +msgstr "" +"Wait for job completion and return exit status.\n" +" \n" +" Waits for each process identified by an ID, which may be a process ID or " +"a\n" +" job specification, and reports its termination status. If ID is not\n" +" given, waits for all currently active child processes, and the return\n" +" status is zero. If ID is a a job specification, waits for all " +"processes\n" +" in that job's pipeline.\n" +" \n" +" If the -n option is supplied, waits for the next job to terminate and\n" +" returns its exit status.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last ID; fails if ID is invalid or an invalid\n" +" option is given." + +#: builtins.c:1506 +msgid "" +"Wait for process completion and return exit status.\n" +" \n" +" Waits for each process specified by a PID and reports its termination " +"status.\n" +" If PID is not given, waits for all currently active child processes,\n" +" and the return status is zero. PID must be a process ID.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last PID; fails if PID is invalid or an " +"invalid\n" +" option is given." +msgstr "" +"Wait for process completion and return exit status.\n" +" \n" +" Waits for each process specified by a PID and reports its termination " +"status.\n" +" If PID is not given, waits for all currently active child processes,\n" +" and the return status is zero. PID must be a process ID.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last PID; fails if PID is invalid or an " +"invalid\n" +" option is given." + +#: builtins.c:1521 +msgid "" +"Execute commands for each member in a list.\n" +" \n" +" The `for' loop executes a sequence of commands for each member in a\n" +" list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is\n" +" assumed. For each element in WORDS, NAME is set to that element, and\n" +" the COMMANDS are executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Execute commands for each member in a list.\n" +" \n" +" The ‘for’ loop executes a sequence of commands for each member in " +"a\n" +" list of items. If ‘in WORDS ...;’ is not present, then ‘in “" +"$@”’ is\n" +" assumed. For each element in WORDS, NAME is set to that element, and\n" +" the COMMANDS are executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." + +#: builtins.c:1535 +msgid "" +"Arithmetic for loop.\n" +" \n" +" Equivalent to\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n" +" omitted, it behaves as if it evaluates to 1.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Arithmetic for loop.\n" +" \n" +" Equivalent to\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n" +" omitted, it behaves as if it evaluates to 1.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." + +#: builtins.c:1553 +msgid "" +"Select words from a list and execute commands.\n" +" \n" +" The WORDS are expanded, generating a list of words. The\n" +" set of expanded words is printed on the standard error, each\n" +" preceded by a number. If `in WORDS' is not present, `in \"$@\"'\n" +" is assumed. The PS3 prompt is then displayed and a line read\n" +" from the standard input. If the line consists of the number\n" +" corresponding to one of the displayed words, then NAME is set\n" +" to that word. If the line is empty, WORDS and the prompt are\n" +" redisplayed. If EOF is read, the command completes. Any other\n" +" value read causes NAME to be set to null. The line read is saved\n" +" in the variable REPLY. COMMANDS are executed after each selection\n" +" until a break command is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Select words from a list and execute commands.\n" +" \n" +" The WORDS are expanded, generating a list of words. The\n" +" set of expanded words is printed on the standard error, each\n" +" preceded by a number. If ‘in WORDS’ is not present, ‘in “" +"$@”’\n" +" is assumed. The PS3 prompt is then displayed and a line read\n" +" from the standard input. If the line consists of the number\n" +" corresponding to one of the displayed words, then NAME is set\n" +" to that word. If the line is empty, WORDS and the prompt are\n" +" redisplayed. If EOF is read, the command completes. Any other\n" +" value read causes NAME to be set to null. The line read is saved\n" +" in the variable REPLY. COMMANDS are executed after each selection\n" +" until a break command is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." + +#: builtins.c:1574 +msgid "" +"Report time consumed by pipeline's execution.\n" +" \n" +" Execute PIPELINE and print a summary of the real time, user CPU time,\n" +" and system CPU time spent executing PIPELINE when it terminates.\n" +" \n" +" Options:\n" +" -p\tprint the timing summary in the portable Posix format\n" +" \n" +" The value of the TIMEFORMAT variable is used as the output format.\n" +" \n" +" Exit Status:\n" +" The return status is the return status of PIPELINE." +msgstr "" +"Report time consumed by pipeline's execution.\n" +" \n" +" Execute PIPELINE and print a summary of the real time, user CPU time,\n" +" and system CPU time spent executing PIPELINE when it terminates.\n" +" \n" +" Options:\n" +" -p\tprint the timing summary in the portable Posix format\n" +" \n" +" The value of the TIMEFORMAT variable is used as the output format.\n" +" \n" +" Exit Status:\n" +" The return status is the return status of PIPELINE." + +#: builtins.c:1591 +msgid "" +"Execute commands based on pattern matching.\n" +" \n" +" Selectively execute COMMANDS based upon WORD matching PATTERN. The\n" +" `|' is used to separate multiple patterns.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Execute commands based on pattern matching.\n" +" \n" +" Selectively execute COMMANDS based upon WORD matching PATTERN. The\n" +" ‘|’ is used to separate multiple patterns.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." + +#: builtins.c:1603 +msgid "" +"Execute commands based on conditional.\n" +" \n" +" The `if COMMANDS' list is executed. If its exit status is zero, then " +"the\n" +" `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list " +"is\n" +" executed in turn, and if its exit status is zero, the corresponding\n" +" `then COMMANDS' list is executed and the if command completes. " +"Otherwise,\n" +" the `else COMMANDS' list is executed, if present. The exit status of " +"the\n" +" entire construct is the exit status of the last command executed, or " +"zero\n" +" if no condition tested true.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Execute commands based on conditional.\n" +" \n" +" The ‘if COMMANDS’ list is executed. If its exit status is zero, " +"then the\n" +" ‘then COMMANDS’ list is executed. Otherwise, each ‘elif " +"COMMANDS’ list is\n" +" executed in turn, and if its exit status is zero, the corresponding\n" +" ‘then COMMANDS’ list is executed and the if command completes. " +"Otherwise,\n" +" the ‘else COMMANDS’ list is executed, if present. The exit status " +"of the\n" +" entire construct is the exit status of the last command executed, or " +"zero\n" +" if no condition tested true.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." + +#: builtins.c:1620 +msgid "" +"Execute commands as long as a test succeeds.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `while' COMMANDS has an exit status of zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Execute commands as long as a test succeeds.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" ‘while’ COMMANDS has an exit status of zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." + +#: builtins.c:1632 +msgid "" +"Execute commands as long as a test does not succeed.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `until' COMMANDS has an exit status which is not zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Execute commands as long as a test does not succeed.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" ‘until’ COMMANDS has an exit status which is not zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." + +#: builtins.c:1644 +msgid "" +"Create a coprocess named NAME.\n" +" \n" +" Execute COMMAND asynchronously, with the standard output and standard\n" +" input of the command connected via a pipe to file descriptors assigned\n" +" to indices 0 and 1 of an array variable NAME in the executing shell.\n" +" The default NAME is \"COPROC\".\n" +" \n" +" Exit Status:\n" +" Returns the exit status of COMMAND." +msgstr "" +"Create a coprocess named NAME.\n" +" \n" +" Execute COMMAND asynchronously, with the standard output and standard\n" +" input of the command connected via a pipe to file descriptors assigned\n" +" to indices 0 and 1 of an array variable NAME in the executing shell.\n" +" The default NAME is “COPROC”.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of COMMAND." + +#: builtins.c:1658 +msgid "" +"Define shell function.\n" +" \n" +" Create a shell function named NAME. When invoked as a simple command,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is " +"invoked,\n" +" the arguments are passed to the function as $1...$n, and the function's\n" +" name is in $FUNCNAME.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is readonly." +msgstr "" +"Define shell function.\n" +" \n" +" Create a shell function named NAME. When invoked as a simple command,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is " +"invoked,\n" +" the arguments are passed to the function as $1...$n, and the function's\n" +" name is in $FUNCNAME.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is readonly." + +#: builtins.c:1672 +msgid "" +"Group commands as a unit.\n" +" \n" +" Run a set of commands in a group. This is one way to redirect an\n" +" entire set of commands.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Group commands as a unit.\n" +" \n" +" Run a set of commands in a group. This is one way to redirect an\n" +" entire set of commands.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." + +#: builtins.c:1684 +msgid "" +"Resume job in foreground.\n" +" \n" +" Equivalent to the JOB_SPEC argument to the `fg' command. Resume a\n" +" stopped or background job. JOB_SPEC can specify either a job name\n" +" or a job number. Following JOB_SPEC with a `&' places the job in\n" +" the background, as if the job specification had been supplied as an\n" +" argument to `bg'.\n" +" \n" +" Exit Status:\n" +" Returns the status of the resumed job." +msgstr "" +"Resume job in foreground.\n" +" \n" +" Equivalent to the JOB_SPEC argument to the ‘fg’ command. Resume " +"a\n" +" stopped or background job. JOB_SPEC can specify either a job name\n" +" or a job number. Following JOB_SPEC with a ‘&’ places the job in\n" +" the background, as if the job specification had been supplied as an\n" +" argument to ‘bg’.\n" +" \n" +" Exit Status:\n" +" Returns the status of the resumed job." + +#: builtins.c:1699 +msgid "" +"Evaluate arithmetic expression.\n" +" \n" +" The EXPRESSION is evaluated according to the rules for arithmetic\n" +" evaluation. Equivalent to \"let EXPRESSION\".\n" +" \n" +" Exit Status:\n" +" Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise." +msgstr "" +"Evaluate arithmetic expression.\n" +" \n" +" The EXPRESSION is evaluated according to the rules for arithmetic\n" +" evaluation. Equivalent to “let EXPRESSION”.\n" +" \n" +" Exit Status:\n" +" Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise." + +#: builtins.c:1711 +msgid "" +"Execute conditional command.\n" +" \n" +" Returns a status of 0 or 1 depending on the evaluation of the " +"conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries " +"used\n" +" by the `test' builtin, and may be combined using the following " +"operators:\n" +" \n" +" ( EXPRESSION )\tReturns the value of EXPRESSION\n" +" ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" +" EXPR1 && EXPR2\tTrue if both EXPR1 and EXPR2 are true; else false\n" +" EXPR1 || EXPR2\tTrue if either EXPR1 or EXPR2 is true; else false\n" +" \n" +" When the `==' and `!=' operators are used, the string to the right of\n" +" the operator is used as a pattern and pattern matching is performed.\n" +" When the `=~' operator is used, the string to the right of the operator\n" +" is matched as a regular expression.\n" +" \n" +" The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n" +" determine the expression's value.\n" +" \n" +" Exit Status:\n" +" 0 or 1 depending on value of EXPRESSION." +msgstr "" +"Execute conditional command.\n" +" \n" +" Returns a status of 0 or 1 depending on the evaluation of the " +"conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries " +"used\n" +" by the ‘test’ builtin, and may be combined using the following " +"operators:\n" +" \n" +" ( EXPRESSION )\tReturns the value of EXPRESSION\n" +" ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" +" EXPR1 && EXPR2\tTrue if both EXPR1 and EXPR2 are true; else false\n" +" EXPR1 || EXPR2\tTrue if either EXPR1 or EXPR2 is true; else false\n" +" \n" +" When the ‘==’ and ‘!=’ operators are used, the string to the " +"right of\n" +" the operator is used as a pattern and pattern matching is performed.\n" +" When the ‘=~’ operator is used, the string to the right of the " +"operator\n" +" is matched as a regular expression.\n" +" \n" +" The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n" +" determine the expression's value.\n" +" \n" +" Exit Status:\n" +" 0 or 1 depending on value of EXPRESSION." + +#: builtins.c:1737 +msgid "" +"Common shell variable names and usage.\n" +" \n" +" BASH_VERSION\tVersion information for this Bash.\n" +" CDPATH\tA colon-separated list of directories to search\n" +" \t\tfor directories given as arguments to `cd'.\n" +" GLOBIGNORE\tA colon-separated list of patterns describing filenames to\n" +" \t\tbe ignored by pathname expansion.\n" +" HISTFILE\tThe name of the file where your command history is stored.\n" +" HISTFILESIZE\tThe maximum number of lines this file can contain.\n" +" HISTSIZE\tThe maximum number of history lines that a running\n" +" \t\tshell can access.\n" +" HOME\tThe complete pathname to your login directory.\n" +" HOSTNAME\tThe name of the current host.\n" +" HOSTTYPE\tThe type of CPU this version of Bash is running under.\n" +" IGNOREEOF\tControls the action of the shell on receipt of an EOF\n" +" \t\tcharacter as the sole input. If set, then the value\n" +" \t\tof it is the number of EOF characters that can be seen\n" +" \t\tin a row on an empty line before the shell will exit\n" +" \t\t(default 10). When unset, EOF signifies the end of input.\n" +" MACHTYPE\tA string describing the current system Bash is running on.\n" +" MAILCHECK\tHow often, in seconds, Bash checks for new mail.\n" +" MAILPATH\tA colon-separated list of filenames which Bash checks\n" +" \t\tfor new mail.\n" +" OSTYPE\tThe version of Unix this version of Bash is running on.\n" +" PATH\tA colon-separated list of directories to search when\n" +" \t\tlooking for commands.\n" +" PROMPT_COMMAND\tA command to be executed before the printing of each\n" +" \t\tprimary prompt.\n" +" PS1\t\tThe primary prompt string.\n" +" PS2\t\tThe secondary prompt string.\n" +" PWD\t\tThe full pathname of the current directory.\n" +" SHELLOPTS\tA colon-separated list of enabled shell options.\n" +" TERM\tThe name of the current terminal type.\n" +" TIMEFORMAT\tThe output format for timing statistics displayed by the\n" +" \t\t`time' reserved word.\n" +" auto_resume\tNon-null means a command word appearing on a line by\n" +" \t\titself is first looked for in the list of currently\n" +" \t\tstopped jobs. If found there, that job is foregrounded.\n" +" \t\tA value of `exact' means that the command word must\n" +" \t\texactly match a command in the list of stopped jobs. A\n" +" \t\tvalue of `substring' means that the command word must\n" +" \t\tmatch a substring of the job. Any other value means that\n" +" \t\tthe command must be a prefix of a stopped job.\n" +" histchars\tCharacters controlling history expansion and quick\n" +" \t\tsubstitution. The first character is the history\n" +" \t\tsubstitution character, usually `!'. The second is\n" +" \t\tthe `quick substitution' character, usually `^'. The\n" +" \t\tthird is the `history comment' character, usually `#'.\n" +" HISTIGNORE\tA colon-separated list of patterns used to decide which\n" +" \t\tcommands should be saved on the history list.\n" +msgstr "" +"Common shell variable names and usage.\n" +" \n" +" BASH_VERSION\tVersion information for this Bash.\n" +" CDPATH\tA colon-separated list of directories to search\n" +" \t\tfor directories given as arguments to ‘cd’.\n" +" GLOBIGNORE\tA colon-separated list of patterns describing filenames to\n" +" \t\tbe ignored by pathname expansion.\n" +" HISTFILE\tThe name of the file where your command history is stored.\n" +" HISTFILESIZE\tThe maximum number of lines this file can contain.\n" +" HISTSIZE\tThe maximum number of history lines that a running\n" +" \t\tshell can access.\n" +" HOME\tThe complete pathname to your login directory.\n" +" HOSTNAME\tThe name of the current host.\n" +" HOSTTYPE\tThe type of CPU this version of Bash is running under.\n" +" IGNOREEOF\tControls the action of the shell on receipt of an EOF\n" +" \t\tcharacter as the sole input. If set, then the value\n" +" \t\tof it is the number of EOF characters that can be seen\n" +" \t\tin a row on an empty line before the shell will exit\n" +" \t\t(default 10). When unset, EOF signifies the end of input.\n" +" MACHTYPE\tA string describing the current system Bash is running on.\n" +" MAILCHECK\tHow often, in seconds, Bash checks for new mail.\n" +" MAILPATH\tA colon-separated list of filenames which Bash checks\n" +" \t\tfor new mail.\n" +" OSTYPE\tThe version of Unix this version of Bash is running on.\n" +" PATH\tA colon-separated list of directories to search when\n" +" \t\tlooking for commands.\n" +" PROMPT_COMMAND\tA command to be executed before the printing of each\n" +" \t\tprimary prompt.\n" +" PS1\t\tThe primary prompt string.\n" +" PS2\t\tThe secondary prompt string.\n" +" PWD\t\tThe full pathname of the current directory.\n" +" SHELLOPTS\tA colon-separated list of enabled shell options.\n" +" TERM\tThe name of the current terminal type.\n" +" TIMEFORMAT\tThe output format for timing statistics displayed by the\n" +" \t\t‘time’ reserved word.\n" +" auto_resume\tNon-null means a command word appearing on a line by\n" +" \t\titself is first looked for in the list of currently\n" +" \t\tstopped jobs. If found there, that job is foregrounded.\n" +" \t\tA value of ‘exact’ means that the command word must\n" +" \t\texactly match a command in the list of stopped jobs. A\n" +" \t\tvalue of ‘substring’ means that the command word must\n" +" \t\tmatch a substring of the job. Any other value means that\n" +" \t\tthe command must be a prefix of a stopped job.\n" +" histchars\tCharacters controlling history expansion and quick\n" +" \t\tsubstitution. The first character is the history\n" +" \t\tsubstitution character, usually ‘!’. The second is\n" +" \t\tthe ‘quick substitution’ character, usually ‘^’. The\n" +" \t\tthird is the ‘history comment’ character, usually ‘#’.\n" +" HISTIGNORE\tA colon-separated list of patterns used to decide which\n" +" \t\tcommands should be saved on the history list.\n" + +#: builtins.c:1794 +msgid "" +"Add directories to stack.\n" +" \n" +" Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" +"Add directories to stack.\n" +" \n" +" Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by ‘dirs’, starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by ‘dirs’, starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The ‘dirs’ builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." + +#: builtins.c:1828 +msgid "" +"Remove directories from stack.\n" +" \n" +" Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" +"Remove directories from stack.\n" +" \n" +" Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by ‘dirs’, starting with zero. For example: ‘popd " +"+0’\n" +" \tremoves the first directory, ‘popd +1’ the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by ‘dirs’, starting with zero. For example: ‘popd " +"-0’\n" +" \tremoves the last directory, ‘popd -1’ the next to last.\n" +" \n" +" The ‘dirs’ builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." + +#: builtins.c:1858 +msgid "" +"Display directory stack.\n" +" \n" +" Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Display directory stack.\n" +" \n" +" Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the ‘pushd’ command; you can " +"get\n" +" back up through the list with the ‘popd’ command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." + +#: builtins.c:1887 +msgid "" +"Set and unset shell options.\n" +" \n" +" Change the setting of each shell option OPTNAME. Without any option\n" +" arguments, list all shell options with an indication of whether or not " +"each\n" +" is set.\n" +" \n" +" Options:\n" +" -o\trestrict OPTNAMEs to those defined for use with `set -o'\n" +" -p\tprint each shell option with an indication of its status\n" +" -q\tsuppress output\n" +" -s\tenable (set) each OPTNAME\n" +" -u\tdisable (unset) each OPTNAME\n" +" \n" +" Exit Status:\n" +" Returns success if OPTNAME is enabled; fails if an invalid option is\n" +" given or OPTNAME is disabled." +msgstr "" +"Set and unset shell options.\n" +" \n" +" Change the setting of each shell option OPTNAME. Without any option\n" +" arguments, list all shell options with an indication of whether or not " +"each\n" +" is set.\n" +" \n" +" Options:\n" +" -o\trestrict OPTNAMEs to those defined for use with ‘set -o’\n" +" -p\tprint each shell option with an indication of its status\n" +" -q\tsuppress output\n" +" -s\tenable (set) each OPTNAME\n" +" -u\tdisable (unset) each OPTNAME\n" +" \n" +" Exit Status:\n" +" Returns success if OPTNAME is enabled; fails if an invalid option is\n" +" given or OPTNAME is disabled." + +#: builtins.c:1908 +msgid "" +"Formats and prints ARGUMENTS under control of the FORMAT.\n" +" \n" +" Options:\n" +" -v var\tassign the output to shell variable VAR rather than\n" +" \t\tdisplay it on the standard output\n" +" \n" +" FORMAT is a character string which contains three types of objects: " +"plain\n" +" characters, which are simply copied to standard output; character " +"escape\n" +" sequences, which are converted and copied to the standard output; and\n" +" format specifications, each of which causes printing of the next " +"successive\n" +" argument.\n" +" \n" +" In addition to the standard format specifications described in " +"printf(1),\n" +" printf interprets:\n" +" \n" +" %b\texpand backslash escape sequences in the corresponding argument\n" +" %q\tquote the argument in a way that can be reused as shell input\n" +" %(fmt)T output the date-time string resulting from using FMT as a " +"format\n" +" string for strftime(3)\n" +" \n" +" The format is re-used as necessary to consume all of the arguments. If\n" +" there are fewer arguments than the format requires, extra format\n" +" specifications behave as if a zero value or null string, as " +"appropriate,\n" +" had been supplied.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a write or " +"assignment\n" +" error occurs." +msgstr "" +"Formats and prints ARGUMENTS under control of the FORMAT.\n" +" \n" +" Options:\n" +" -v var\tassign the output to shell variable VAR rather than\n" +" \t\tdisplay it on the standard output\n" +" \n" +" FORMAT is a character string which contains three types of objects: " +"plain\n" +" characters, which are simply copied to standard output; character " +"escape\n" +" sequences, which are converted and copied to the standard output; and\n" +" format specifications, each of which causes printing of the next " +"successive\n" +" argument.\n" +" \n" +" In addition to the standard format specifications described in " +"printf(1),\n" +" printf interprets:\n" +" \n" +" %b\texpand backslash escape sequences in the corresponding argument\n" +" %q\tquote the argument in a way that can be reused as shell input\n" +" %(fmt)T output the date-time string resulting from using FMT as a " +"format\n" +" string for strftime(3)\n" +" \n" +" The format is re-used as necessary to consume all of the arguments. If\n" +" there are fewer arguments than the format requires, extra format\n" +" specifications behave as if a zero value or null string, as " +"appropriate,\n" +" had been supplied.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a write or " +"assignment\n" +" error occurs." + +#: builtins.c:1942 +msgid "" +"Specify how arguments are to be completed by Readline.\n" +" \n" +" For each NAME, specify how arguments are to be completed. If no " +"options\n" +" are supplied, existing completion specifications are printed in a way " +"that\n" +" allows them to be reused as input.\n" +" \n" +" Options:\n" +" -p\tprint existing completion specifications in a reusable format\n" +" -r\tremove a completion specification for each NAME, or, if no\n" +" \tNAMEs are supplied, all completion specifications\n" +" -D\tapply the completions and actions as the default for commands\n" +" \twithout any specific completion defined\n" +" -E\tapply the completions and actions to \"empty\" commands --\n" +" \tcompletion attempted on a blank line\n" +" \n" +" When completion is attempted, the actions are applied in the order the\n" +" uppercase-letter options are listed above. The -D option takes\n" +" precedence over -E.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Specify how arguments are to be completed by Readline.\n" +" \n" +" For each NAME, specify how arguments are to be completed. If no " +"options\n" +" are supplied, existing completion specifications are printed in a way " +"that\n" +" allows them to be reused as input.\n" +" \n" +" Options:\n" +" -p\tprint existing completion specifications in a reusable format\n" +" -r\tremove a completion specification for each NAME, or, if no\n" +" \tNAMEs are supplied, all completion specifications\n" +" -D\tapply the completions and actions as the default for commands\n" +" \twithout any specific completion defined\n" +" -E\tapply the completions and actions to “empty” commands --\n" +" \tcompletion attempted on a blank line\n" +" \n" +" When completion is attempted, the actions are applied in the order the\n" +" uppercase-letter options are listed above. The -D option takes\n" +" precedence over -E.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." + +#: builtins.c:1970 +msgid "" +"Display possible completions depending on the options.\n" +" \n" +" Intended to be used from within a shell function generating possible\n" +" completions. If the optional WORD argument is supplied, matches " +"against\n" +" WORD are generated.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Display possible completions depending on the options.\n" +" \n" +" Intended to be used from within a shell function generating possible\n" +" completions. If the optional WORD argument is supplied, matches " +"against\n" +" WORD are generated.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." + +#: builtins.c:1985 +msgid "" +"Modify or display completion options.\n" +" \n" +" Modify the completion options for each NAME, or, if no NAMEs are " +"supplied,\n" +" the completion currently being executed. If no OPTIONs are given, " +"print\n" +" the completion options for each NAME or the current completion " +"specification.\n" +" \n" +" Options:\n" +" \t-o option\tSet completion option OPTION for each NAME\n" +" \t-D\t\tChange options for the \"default\" command completion\n" +" \t-E\t\tChange options for the \"empty\" command completion\n" +" \n" +" Using `+o' instead of `-o' turns off the specified option.\n" +" \n" +" Arguments:\n" +" \n" +" Each NAME refers to a command for which a completion specification must\n" +" have previously been defined using the `complete' builtin. If no NAMEs\n" +" are supplied, compopt must be called by a function currently generating\n" +" completions, and the options for that currently-executing completion\n" +" generator are modified.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or NAME does not\n" +" have a completion specification defined." +msgstr "" +"Modify or display completion options.\n" +" \n" +" Modify the completion options for each NAME, or, if no NAMEs are " +"supplied,\n" +" the completion currently being executed. If no OPTIONs are given, " +"print\n" +" the completion options for each NAME or the current completion " +"specification.\n" +" \n" +" Options:\n" +" \t-o option\tSet completion option OPTION for each NAME\n" +" \t-D\t\tChange options for the “default” command completion\n" +" \t-E\t\tChange options for the “empty” command completion\n" +" \n" +" Using ‘+o’ instead of ‘-o’ turns off the specified option.\n" +" \n" +" Arguments:\n" +" \n" +" Each NAME refers to a command for which a completion specification must\n" +" have previously been defined using the ‘complete’ builtin. If no " +"NAMEs\n" +" are supplied, compopt must be called by a function currently generating\n" +" completions, and the options for that currently-executing completion\n" +" generator are modified.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or NAME does not\n" +" have a completion specification defined." + +#: builtins.c:2015 +msgid "" +"Read lines from the standard input into an indexed array variable.\n" +" \n" +" Read lines from the standard input into the indexed array variable " +"ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable " +"MAPFILE\n" +" is the default ARRAY.\n" +" \n" +" Options:\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are " +"copied.\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default " +"index is 0.\n" +" -s count \tDiscard the first COUNT lines read.\n" +" -t\t\tRemove a trailing newline from each line read.\n" +" -u fd\t\tRead lines from file descriptor FD instead of the standard " +"input.\n" +" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read.\n" +" -c quantum\tSpecify the number of lines read between each call to " +"CALLBACK.\n" +" \n" +" Arguments:\n" +" ARRAY\t\tArray variable name to use for file data.\n" +" \n" +" If -C is supplied without -c, the default quantum is 5000. When\n" +" CALLBACK is evaluated, it is supplied the index of the next array\n" +" element to be assigned and the line to be assigned to that element\n" +" as additional arguments.\n" +" \n" +" If not supplied with an explicit origin, mapfile will clear ARRAY " +"before\n" +" assigning to it.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or ARRAY is readonly " +"or\n" +" not an indexed array." +msgstr "" +"Read lines from the standard input into an indexed array variable.\n" +" \n" +" Read lines from the standard input into the indexed array variable " +"ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable " +"MAPFILE\n" +" is the default ARRAY.\n" +" \n" +" Options:\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are " +"copied.\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default " +"index is 0.\n" +" -s count \tDiscard the first COUNT lines read.\n" +" -t\t\tRemove a trailing newline from each line read.\n" +" -u fd\t\tRead lines from file descriptor FD instead of the standard " +"input.\n" +" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read.\n" +" -c quantum\tSpecify the number of lines read between each call to " +"CALLBACK.\n" +" \n" +" Arguments:\n" +" ARRAY\t\tArray variable name to use for file data.\n" +" \n" +" If -C is supplied without -c, the default quantum is 5000. When\n" +" CALLBACK is evaluated, it is supplied the index of the next array\n" +" element to be assigned and the line to be assigned to that element\n" +" as additional arguments.\n" +" \n" +" If not supplied with an explicit origin, mapfile will clear ARRAY " +"before\n" +" assigning to it.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or ARRAY is readonly " +"or\n" +" not an indexed array." + +#: builtins.c:2049 +msgid "" +"Read lines from a file into an array variable.\n" +" \n" +" A synonym for `mapfile'." +msgstr "" +"Read lines from a file into an array variable.\n" +" \n" +" A synonym for ‘mapfile’." diff --git a/po/en@quot.gmo b/po/en@quot.gmo new file mode 100644 index 0000000000000000000000000000000000000000..322bbd64c4a286d1d4ee8ee55a62cfdf43335d99 GIT binary patch literal 164132 zcmeFa2bf$}dH+AV*x)gC0Api{fooZ^Buk@as$5sn%33V#uC*&yjCXc-c6ZS1%zBCn z7*j$sC7}~qoX|Uj1o+Vs69S>PgqBc33pEf3U^>6g_kGW~_s;CDBnUju|M~w|`|3OQ z-c#Q5p7*@xJ?|;^i>Dm->;iwA`wN9Lz?a^sQ20K-*Po@Qg~B&C6bk2n-vUnoPu*B3 zoDZ%BSAx^viQrA(pMcK-ZwtNzychUt@Ko>v;Jv{wf_DLb4W0&`wy97kg6lxCF5DN? z`%3~oBwzX8%D-=rLnc!*Q2&nQ_K&AT_@NVEU!~N?( z)$iYf;`N(;5 z<)G4e8z_1{4&Dv?CU{q{AE6Qb_W+g8{Xo&V15~<`pyc2&;rXjT@$;VpegPC8{s&b1 zxhF!Y@asWDqc8@FUrzw<0lpLzUvB|#4}J<%_%DO1mlMwSbnXU%cp4|4*RO{WSQc+Y}040e6A_c(L>4_B$N!0V>=&a3=}f9~AvJ4*L72 zf+unRB2eL84XT~LCEzXKZ;me%J_xFQKX_@O@D3Eo7r_&_fBxm@B=98xKLwV_=XO^h z8({TH>H|Hs_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>%0y}&MKmxP@R z@$$;n47aZ@FM_RT<)FT$0L}Wp&@LLYcylU{$>7ype-1s7J`K=OrPRuthjvTCFr_sr~cn| zu{l;HkyCw*=#wpOifE)aT~EO5Hw6NCI&Ga`M!vbPV|MXbUO6sbkkNUZShuzeJ>mAf z7q&^?{(oCLpPsgXAd2s~pMoBcDzzMX1yvOVAu2@yiB>&Sk%gKD5Ksaklz#jE-kY_( zb^-}iFOg%<{;_vvcIM6OE*~CY#LTmm(1=|e#-jt&wbO&Vy>bJlfU{KzPJ(9#@a|Pr z)o<<5fZmI)(aC-^LRJ})Xyob8n!BScok!8Zw$W<2AVF9mC$Dr7Gcx!Sp=%n zbUr)p^_1?yM%4G)*vj!J$pEEk3^j>7StvRZSeMy;(d7jn|Ivy9Bua^Wcs?S=4!pDs)<*gIW1$FjumG}2sua-xBmJ=({xTQNTQBxjVFGev@W6L zt{@)lX&l$Ac_new&h*I9@kR@TSp&~9w~{6hgQ<6; z-WlbT*CG@wk}4~kP*+(2;Y8q7{7m*Jkow8=9!U>2Y?)Y3vswsrxB!Pm)p2j;c9h`D zlf%IKFRoA{w|6sXk}vep&qrx4nSe~)-a6q&VJU6{A93g{_drhj9Vx!2P9?GZCS&bV z_Jp(^TsE>1zmn3ntBQ#+wd|0V>rvE3gi9(fiLvV0RP z%7z7(HTw^(^@=>*NQgbNQBRp-mp!g?O|(i6jho;M?%% zaCgWKUAW>8H*`$F97iqK=1>>{)tVS!rMb$<0L_0q|L`TzfPefFcDPX%Iv*tlvMs%J zunx66zyi%%9Ihg%))qtFU=Y*F_QLBAR_VB6^@AMzj=vRZvpetiq6Vp?v#(@=>5bD# JQy0rle*x{ffffJ& literal 0 HcmV?d00001 diff --git a/po/en@quot.header b/po/en@quot.header new file mode 100644 index 0000000..a9647fc --- /dev/null +++ b/po/en@quot.header @@ -0,0 +1,22 @@ +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# diff --git a/po/en@quot.po b/po/en@quot.po new file mode 100644 index 0000000..a0c939d --- /dev/null +++ b/po/en@quot.po @@ -0,0 +1,5611 @@ +# English translations for GNU bash package. +# Copyright (C) 2014 Free Software Foundation, Inc. +# This file is distributed under the same license as the GNU bash package. +# Automatically generated, 2014. +# +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU bash 4.3-release\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-02-11 11:19-0500\n" +"PO-Revision-Date: 2014-02-11 11:19-0500\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: en\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: arrayfunc.c:51 +msgid "bad array subscript" +msgstr "bad array subscript" + +#: arrayfunc.c:356 builtins/declare.def:566 +#, c-format +msgid "%s: cannot convert indexed to associative array" +msgstr "%s: cannot convert indexed to associative array" + +#: arrayfunc.c:539 +#, c-format +msgid "%s: invalid associative array key" +msgstr "%s: invalid associative array key" + +#: arrayfunc.c:541 +#, c-format +msgid "%s: cannot assign to non-numeric index" +msgstr "%s: cannot assign to non-numeric index" + +#: arrayfunc.c:586 +#, c-format +msgid "%s: %s: must use subscript when assigning associative array" +msgstr "%s: %s: must use subscript when assigning associative array" + +#: bashhist.c:388 +#, c-format +msgid "%s: cannot create: %s" +msgstr "%s: cannot create: %s" + +#: bashline.c:3982 +msgid "bash_execute_unix_command: cannot find keymap for command" +msgstr "bash_execute_unix_command: cannot find keymap for command" + +#: bashline.c:4069 +#, c-format +msgid "%s: first non-whitespace character is not `\"'" +msgstr "%s: first non-whitespace character is not ‘\"’" + +#: bashline.c:4098 +#, c-format +msgid "no closing `%c' in %s" +msgstr "no closing ‘%c’ in %s" + +#: bashline.c:4132 +#, c-format +msgid "%s: missing colon separator" +msgstr "%s: missing colon separator" + +#: braces.c:321 +#, c-format +msgid "brace expansion: cannot allocate memory for %s" +msgstr "brace expansion: cannot allocate memory for %s" + +#: braces.c:413 +#, c-format +msgid "brace expansion: failed to allocate memory for %d elements" +msgstr "brace expansion: failed to allocate memory for %d elements" + +#: braces.c:452 +#, c-format +msgid "brace expansion: failed to allocate memory for `%s'" +msgstr "brace expansion: failed to allocate memory for ‘%s’" + +#: builtins/alias.def:132 +#, c-format +msgid "`%s': invalid alias name" +msgstr "‘%s’: invalid alias name" + +#: builtins/bind.def:123 builtins/bind.def:126 +msgid "line editing not enabled" +msgstr "line editing not enabled" + +#: builtins/bind.def:212 +#, c-format +msgid "`%s': invalid keymap name" +msgstr "‘%s’: invalid keymap name" + +#: builtins/bind.def:251 +#, c-format +msgid "%s: cannot read: %s" +msgstr "%s: cannot read: %s" + +#: builtins/bind.def:266 +#, c-format +msgid "`%s': cannot unbind" +msgstr "‘%s’: cannot unbind" + +#: builtins/bind.def:304 builtins/bind.def:334 +#, c-format +msgid "`%s': unknown function name" +msgstr "‘%s’: unknown function name" + +#: builtins/bind.def:312 +#, c-format +msgid "%s is not bound to any keys.\n" +msgstr "%s is not bound to any keys.\n" + +#: builtins/bind.def:316 +#, c-format +msgid "%s can be invoked via " +msgstr "%s can be invoked via " + +#: builtins/break.def:77 builtins/break.def:117 +msgid "loop count" +msgstr "loop count" + +#: builtins/break.def:137 +msgid "only meaningful in a `for', `while', or `until' loop" +msgstr "only meaningful in a ‘for’, ‘while’, or ‘until’ loop" + +#: builtins/caller.def:134 +msgid "" +"Returns the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns " +msgstr "" +"Returns the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns " + +#: builtins/cd.def:319 +msgid "HOME not set" +msgstr "HOME not set" + +#: builtins/cd.def:327 builtins/common.c:166 test.c:876 +msgid "too many arguments" +msgstr "too many arguments" + +#: builtins/cd.def:338 +msgid "OLDPWD not set" +msgstr "OLDPWD not set" + +#: builtins/common.c:101 +#, c-format +msgid "line %d: " +msgstr "line %d: " + +#: builtins/common.c:139 error.c:265 +#, c-format +msgid "warning: " +msgstr "warning: " + +#: builtins/common.c:153 +#, c-format +msgid "%s: usage: " +msgstr "%s: usage: " + +#: builtins/common.c:191 shell.c:506 shell.c:788 +#, c-format +msgid "%s: option requires an argument" +msgstr "%s: option requires an argument" + +#: builtins/common.c:198 +#, c-format +msgid "%s: numeric argument required" +msgstr "%s: numeric argument required" + +#: builtins/common.c:205 +#, c-format +msgid "%s: not found" +msgstr "%s: not found" + +#: builtins/common.c:214 shell.c:801 +#, c-format +msgid "%s: invalid option" +msgstr "%s: invalid option" + +#: builtins/common.c:221 +#, c-format +msgid "%s: invalid option name" +msgstr "%s: invalid option name" + +#: builtins/common.c:228 general.c:235 general.c:240 +#, c-format +msgid "`%s': not a valid identifier" +msgstr "‘%s’: not a valid identifier" + +#: builtins/common.c:238 +msgid "invalid octal number" +msgstr "invalid octal number" + +#: builtins/common.c:240 +msgid "invalid hex number" +msgstr "invalid hex number" + +#: builtins/common.c:242 expr.c:1470 +msgid "invalid number" +msgstr "invalid number" + +#: builtins/common.c:250 +#, c-format +msgid "%s: invalid signal specification" +msgstr "%s: invalid signal specification" + +#: builtins/common.c:257 +#, c-format +msgid "`%s': not a pid or valid job spec" +msgstr "‘%s’: not a pid or valid job spec" + +#: builtins/common.c:264 error.c:488 +#, c-format +msgid "%s: readonly variable" +msgstr "%s: readonly variable" + +#: builtins/common.c:272 +#, c-format +msgid "%s: %s out of range" +msgstr "%s: %s out of range" + +#: builtins/common.c:272 builtins/common.c:274 +msgid "argument" +msgstr "argument" + +#: builtins/common.c:274 +#, c-format +msgid "%s out of range" +msgstr "%s out of range" + +#: builtins/common.c:282 +#, c-format +msgid "%s: no such job" +msgstr "%s: no such job" + +#: builtins/common.c:290 +#, c-format +msgid "%s: no job control" +msgstr "%s: no job control" + +#: builtins/common.c:292 +msgid "no job control" +msgstr "no job control" + +#: builtins/common.c:302 +#, c-format +msgid "%s: restricted" +msgstr "%s: restricted" + +#: builtins/common.c:304 +msgid "restricted" +msgstr "restricted" + +#: builtins/common.c:312 +#, c-format +msgid "%s: not a shell builtin" +msgstr "%s: not a shell builtin" + +#: builtins/common.c:321 +#, c-format +msgid "write error: %s" +msgstr "write error: %s" + +#: builtins/common.c:329 +#, c-format +msgid "error setting terminal attributes: %s" +msgstr "error setting terminal attributes: %s" + +#: builtins/common.c:331 +#, c-format +msgid "error getting terminal attributes: %s" +msgstr "error getting terminal attributes: %s" + +#: builtins/common.c:563 +#, c-format +msgid "%s: error retrieving current directory: %s: %s\n" +msgstr "%s: error retrieving current directory: %s: %s\n" + +#: builtins/common.c:629 builtins/common.c:631 +#, c-format +msgid "%s: ambiguous job spec" +msgstr "%s: ambiguous job spec" + +#: builtins/complete.def:277 +#, c-format +msgid "%s: invalid action name" +msgstr "%s: invalid action name" + +#: builtins/complete.def:450 builtins/complete.def:645 +#: builtins/complete.def:855 +#, c-format +msgid "%s: no completion specification" +msgstr "%s: no completion specification" + +#: builtins/complete.def:697 +msgid "warning: -F option may not work as you expect" +msgstr "warning: -F option may not work as you expect" + +#: builtins/complete.def:699 +msgid "warning: -C option may not work as you expect" +msgstr "warning: -C option may not work as you expect" + +#: builtins/complete.def:828 +msgid "not currently executing completion function" +msgstr "not currently executing completion function" + +#: builtins/declare.def:126 +msgid "can only be used in a function" +msgstr "can only be used in a function" + +#: builtins/declare.def:315 builtins/declare.def:509 +#, c-format +msgid "%s: reference variable cannot be an array" +msgstr "%s: reference variable cannot be an array" + +#: builtins/declare.def:324 +#, c-format +msgid "%s: nameref variable self references not allowed" +msgstr "%s: nameref variable self references not allowed" + +#: builtins/declare.def:398 +msgid "cannot use `-f' to make functions" +msgstr "cannot use ‘-f’ to make functions" + +#: builtins/declare.def:410 execute_cmd.c:5361 +#, c-format +msgid "%s: readonly function" +msgstr "%s: readonly function" + +#: builtins/declare.def:553 +#, c-format +msgid "%s: cannot destroy array variables in this way" +msgstr "%s: cannot destroy array variables in this way" + +#: builtins/declare.def:560 builtins/read.def:733 +#, c-format +msgid "%s: cannot convert associative to indexed array" +msgstr "%s: cannot convert associative to indexed array" + +#: builtins/enable.def:137 builtins/enable.def:145 +msgid "dynamic loading not available" +msgstr "dynamic loading not available" + +#: builtins/enable.def:312 +#, c-format +msgid "cannot open shared object %s: %s" +msgstr "cannot open shared object %s: %s" + +#: builtins/enable.def:335 +#, c-format +msgid "cannot find %s in shared object %s: %s" +msgstr "cannot find %s in shared object %s: %s" + +#: builtins/enable.def:459 +#, c-format +msgid "%s: not dynamically loaded" +msgstr "%s: not dynamically loaded" + +#: builtins/enable.def:474 +#, c-format +msgid "%s: cannot delete: %s" +msgstr "%s: cannot delete: %s" + +#: builtins/evalfile.c:140 builtins/hash.def:171 execute_cmd.c:5208 +#: shell.c:1481 +#, c-format +msgid "%s: is a directory" +msgstr "%s: is a directory" + +#: builtins/evalfile.c:146 +#, c-format +msgid "%s: not a regular file" +msgstr "%s: not a regular file" + +#: builtins/evalfile.c:155 +#, c-format +msgid "%s: file is too large" +msgstr "%s: file is too large" + +#: builtins/evalfile.c:190 builtins/evalfile.c:208 shell.c:1491 +#, c-format +msgid "%s: cannot execute binary file" +msgstr "%s: cannot execute binary file" + +#: builtins/exec.def:154 builtins/exec.def:156 builtins/exec.def:228 +#, c-format +msgid "%s: cannot execute: %s" +msgstr "%s: cannot execute: %s" + +#: builtins/exit.def:65 +#, c-format +msgid "logout\n" +msgstr "logout\n" + +#: builtins/exit.def:88 +msgid "not login shell: use `exit'" +msgstr "not login shell: use ‘exit’" + +#: builtins/exit.def:120 +#, c-format +msgid "There are stopped jobs.\n" +msgstr "There are stopped jobs.\n" + +#: builtins/exit.def:122 +#, c-format +msgid "There are running jobs.\n" +msgstr "There are running jobs.\n" + +#: builtins/fc.def:262 +msgid "no command found" +msgstr "no command found" + +#: builtins/fc.def:320 builtins/fc.def:369 +msgid "history specification" +msgstr "history specification" + +#: builtins/fc.def:390 +#, c-format +msgid "%s: cannot open temp file: %s" +msgstr "%s: cannot open temp file: %s" + +#: builtins/fg_bg.def:149 builtins/jobs.def:282 +msgid "current" +msgstr "current" + +#: builtins/fg_bg.def:158 +#, c-format +msgid "job %d started without job control" +msgstr "job %d started without job control" + +#: builtins/getopt.c:110 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: illegal option -- %c\n" + +#: builtins/getopt.c:111 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: option requires an argument -- %c\n" + +#: builtins/hash.def:92 +msgid "hashing disabled" +msgstr "hashing disabled" + +#: builtins/hash.def:138 +#, c-format +msgid "%s: hash table empty\n" +msgstr "%s: hash table empty\n" + +#: builtins/hash.def:245 +#, c-format +msgid "hits\tcommand\n" +msgstr "hits\tcommand\n" + +#: builtins/help.def:130 +#, c-format +msgid "Shell commands matching keyword `" +msgid_plural "Shell commands matching keywords `" +msgstr[0] "Shell commands matching keyword `" +msgstr[1] "Shell commands matching keywords `" + +#: builtins/help.def:182 +#, c-format +msgid "" +"no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." +msgstr "" +"no help topics match ‘%s’. Try ‘help help’ or ‘man -k %s’ or ‘info %s’." + +#: builtins/help.def:199 +#, c-format +msgid "%s: cannot open: %s" +msgstr "%s: cannot open: %s" + +#: builtins/help.def:485 +#, c-format +msgid "" +"These shell commands are defined internally. Type `help' to see this list.\n" +"Type `help name' to find out more about the function `name'.\n" +"Use `info bash' to find out more about the shell in general.\n" +"Use `man -k' or `info' to find out more about commands not in this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" +msgstr "" +"These shell commands are defined internally. Type ‘help’ to see this list.\n" +"Type ‘help name’ to find out more about the function ‘name’.\n" +"Use ‘info bash’ to find out more about the shell in general.\n" +"Use ‘man -k’ or ‘info’ to find out more about commands not in this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" + +#: builtins/history.def:154 +msgid "cannot use more than one of -anrw" +msgstr "cannot use more than one of -anrw" + +#: builtins/history.def:186 +msgid "history position" +msgstr "history position" + +#: builtins/history.def:366 +#, c-format +msgid "%s: history expansion failed" +msgstr "%s: history expansion failed" + +#: builtins/inlib.def:71 +#, c-format +msgid "%s: inlib failed" +msgstr "%s: inlib failed" + +#: builtins/jobs.def:109 +msgid "no other options allowed with `-x'" +msgstr "no other options allowed with ‘-x’" + +#: builtins/kill.def:200 +#, c-format +msgid "%s: arguments must be process or job IDs" +msgstr "%s: arguments must be process or job IDs" + +#: builtins/kill.def:263 +msgid "Unknown error" +msgstr "Unknown error" + +#: builtins/let.def:95 builtins/let.def:120 expr.c:583 expr.c:598 +msgid "expression expected" +msgstr "expression expected" + +#: builtins/mapfile.def:172 +#, c-format +msgid "%s: not an indexed array" +msgstr "%s: not an indexed array" + +#: builtins/mapfile.def:259 builtins/read.def:302 +#, c-format +msgid "%s: invalid file descriptor specification" +msgstr "%s: invalid file descriptor specification" + +#: builtins/mapfile.def:267 builtins/read.def:309 +#, c-format +msgid "%d: invalid file descriptor: %s" +msgstr "%d: invalid file descriptor: %s" + +#: builtins/mapfile.def:276 builtins/mapfile.def:314 +#, c-format +msgid "%s: invalid line count" +msgstr "%s: invalid line count" + +#: builtins/mapfile.def:287 +#, c-format +msgid "%s: invalid array origin" +msgstr "%s: invalid array origin" + +#: builtins/mapfile.def:304 +#, c-format +msgid "%s: invalid callback quantum" +msgstr "%s: invalid callback quantum" + +#: builtins/mapfile.def:336 +msgid "empty array variable name" +msgstr "empty array variable name" + +#: builtins/mapfile.def:357 +msgid "array variable support required" +msgstr "array variable support required" + +#: builtins/printf.def:402 +#, c-format +msgid "`%s': missing format character" +msgstr "‘%s’: missing format character" + +#: builtins/printf.def:456 +#, c-format +msgid "`%c': invalid time format specification" +msgstr "‘%c’: invalid time format specification" + +#: builtins/printf.def:658 +#, c-format +msgid "`%c': invalid format character" +msgstr "‘%c’: invalid format character" + +#: builtins/printf.def:684 +#, c-format +msgid "warning: %s: %s" +msgstr "warning: %s: %s" + +#: builtins/printf.def:768 +#, c-format +msgid "format parsing problem: %s" +msgstr "format parsing problem: %s" + +#: builtins/printf.def:865 +msgid "missing hex digit for \\x" +msgstr "missing hex digit for \\x" + +#: builtins/printf.def:880 +#, c-format +msgid "missing unicode digit for \\%c" +msgstr "missing unicode digit for \\%c" + +#: builtins/pushd.def:195 +msgid "no other directory" +msgstr "no other directory" + +#: builtins/pushd.def:354 +#, c-format +msgid "%s: invalid argument" +msgstr "%s: invalid argument" + +#: builtins/pushd.def:468 +msgid "" +msgstr "" + +#: builtins/pushd.def:512 +msgid "directory stack empty" +msgstr "directory stack empty" + +#: builtins/pushd.def:514 +msgid "directory stack index" +msgstr "directory stack index" + +#: builtins/pushd.def:689 +msgid "" +"Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +"\tdirs when invoked without options, starting with zero." +msgstr "" +"Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the ‘pushd’ command; you can get\n" +" back up through the list with the ‘popd’ command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +"\tdirs when invoked without options, starting with zero." + +#: builtins/pushd.def:711 +msgid "" +"Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by ‘dirs’, starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by ‘dirs’, starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The ‘dirs’ builtin displays the directory stack." + +#: builtins/pushd.def:736 +msgid "" +"Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by ‘dirs’, starting with zero. For example: ‘popd +0’\n" +" \tremoves the first directory, ‘popd +1’ the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by ‘dirs’, starting with zero. For example: ‘popd -0’\n" +" \tremoves the last directory, ‘popd -1’ the next to last.\n" +" \n" +" The ‘dirs’ builtin displays the directory stack." + +#: builtins/read.def:275 +#, c-format +msgid "%s: invalid timeout specification" +msgstr "%s: invalid timeout specification" + +#: builtins/read.def:678 +#, c-format +msgid "read error: %d: %s" +msgstr "read error: %d: %s" + +#: builtins/return.def:75 +msgid "can only `return' from a function or sourced script" +msgstr "can only ‘return’ from a function or sourced script" + +#: builtins/set.def:782 +msgid "cannot simultaneously unset a function and a variable" +msgstr "cannot simultaneously unset a function and a variable" + +#: builtins/set.def:826 +#, c-format +msgid "%s: cannot unset" +msgstr "%s: cannot unset" + +#: builtins/set.def:843 +#, c-format +msgid "%s: cannot unset: readonly %s" +msgstr "%s: cannot unset: readonly %s" + +#: builtins/set.def:854 +#, c-format +msgid "%s: not an array variable" +msgstr "%s: not an array variable" + +#: builtins/setattr.def:187 +#, c-format +msgid "%s: not a function" +msgstr "%s: not a function" + +#: builtins/shift.def:71 builtins/shift.def:77 +msgid "shift count" +msgstr "shift count" + +#: builtins/shopt.def:279 +msgid "cannot set and unset shell options simultaneously" +msgstr "cannot set and unset shell options simultaneously" + +#: builtins/shopt.def:346 +#, c-format +msgid "%s: invalid shell option name" +msgstr "%s: invalid shell option name" + +#: builtins/source.def:130 +msgid "filename argument required" +msgstr "filename argument required" + +#: builtins/source.def:155 +#, c-format +msgid "%s: file not found" +msgstr "%s: file not found" + +#: builtins/suspend.def:101 +msgid "cannot suspend" +msgstr "cannot suspend" + +#: builtins/suspend.def:111 +msgid "cannot suspend a login shell" +msgstr "cannot suspend a login shell" + +#: builtins/type.def:234 +#, c-format +msgid "%s is aliased to `%s'\n" +msgstr "%s is aliased to ‘%s’\n" + +#: builtins/type.def:255 +#, c-format +msgid "%s is a shell keyword\n" +msgstr "%s is a shell keyword\n" + +#: builtins/type.def:274 +#, c-format +msgid "%s is a function\n" +msgstr "%s is a function\n" + +#: builtins/type.def:296 +#, c-format +msgid "%s is a shell builtin\n" +msgstr "%s is a shell builtin\n" + +#: builtins/type.def:317 builtins/type.def:393 +#, c-format +msgid "%s is %s\n" +msgstr "%s is %s\n" + +#: builtins/type.def:337 +#, c-format +msgid "%s is hashed (%s)\n" +msgstr "%s is hashed (%s)\n" + +#: builtins/ulimit.def:383 +#, c-format +msgid "%s: invalid limit argument" +msgstr "%s: invalid limit argument" + +#: builtins/ulimit.def:409 +#, c-format +msgid "`%c': bad command" +msgstr "‘%c’: bad command" + +#: builtins/ulimit.def:438 +#, c-format +msgid "%s: cannot get limit: %s" +msgstr "%s: cannot get limit: %s" + +#: builtins/ulimit.def:464 +msgid "limit" +msgstr "limit" + +#: builtins/ulimit.def:476 builtins/ulimit.def:776 +#, c-format +msgid "%s: cannot modify limit: %s" +msgstr "%s: cannot modify limit: %s" + +#: builtins/umask.def:114 +msgid "octal number" +msgstr "octal number" + +#: builtins/umask.def:227 +#, c-format +msgid "`%c': invalid symbolic mode operator" +msgstr "‘%c’: invalid symbolic mode operator" + +#: builtins/umask.def:282 +#, c-format +msgid "`%c': invalid symbolic mode character" +msgstr "‘%c’: invalid symbolic mode character" + +#: error.c:90 error.c:325 error.c:327 error.c:329 +msgid " line " +msgstr " line " + +#: error.c:165 +#, c-format +msgid "last command: %s\n" +msgstr "last command: %s\n" + +#: error.c:173 +#, c-format +msgid "Aborting..." +msgstr "Aborting..." + +#: error.c:440 +msgid "unknown command error" +msgstr "unknown command error" + +#: error.c:441 +msgid "bad command type" +msgstr "bad command type" + +#: error.c:442 +msgid "bad connector" +msgstr "bad connector" + +#: error.c:443 +msgid "bad jump" +msgstr "bad jump" + +#: error.c:481 +#, c-format +msgid "%s: unbound variable" +msgstr "%s: unbound variable" + +#: eval.c:189 +#, c-format +msgid "\atimed out waiting for input: auto-logout\n" +msgstr "\atimed out waiting for input: auto-logout\n" + +#: execute_cmd.c:512 +#, c-format +msgid "cannot redirect standard input from /dev/null: %s" +msgstr "cannot redirect standard input from /dev/null: %s" + +#: execute_cmd.c:1233 +#, c-format +msgid "TIMEFORMAT: `%c': invalid format character" +msgstr "TIMEFORMAT: ‘%c’: invalid format character" + +#: execute_cmd.c:2287 +msgid "pipe error" +msgstr "pipe error" + +#: execute_cmd.c:4386 +#, c-format +msgid "%s: maximum function nesting level exceeded (%d)" +msgstr "%s: maximum function nesting level exceeded (%d)" + +#: execute_cmd.c:4884 +#, c-format +msgid "%s: restricted: cannot specify `/' in command names" +msgstr "%s: restricted: cannot specify ‘/’ in command names" + +#: execute_cmd.c:4973 +#, c-format +msgid "%s: command not found" +msgstr "%s: command not found" + +#: execute_cmd.c:5206 +#, c-format +msgid "%s: %s" +msgstr "%s: %s" + +#: execute_cmd.c:5243 +#, c-format +msgid "%s: %s: bad interpreter" +msgstr "%s: %s: bad interpreter" + +#: execute_cmd.c:5280 +#, c-format +msgid "%s: cannot execute binary file: %s" +msgstr "%s: cannot execute binary file: %s" + +#: execute_cmd.c:5352 +#, c-format +msgid "`%s': is a special builtin" +msgstr "‘%s’: is a special builtin" + +#: execute_cmd.c:5404 +#, c-format +msgid "cannot duplicate fd %d to fd %d" +msgstr "cannot duplicate fd %d to fd %d" + +#: expr.c:259 +msgid "expression recursion level exceeded" +msgstr "expression recursion level exceeded" + +#: expr.c:283 +msgid "recursion stack underflow" +msgstr "recursion stack underflow" + +#: expr.c:431 +msgid "syntax error in expression" +msgstr "syntax error in expression" + +#: expr.c:475 +msgid "attempted assignment to non-variable" +msgstr "attempted assignment to non-variable" + +#: expr.c:495 expr.c:858 +msgid "division by 0" +msgstr "division by 0" + +#: expr.c:542 +msgid "bug: bad expassign token" +msgstr "bug: bad expassign token" + +#: expr.c:595 +msgid "`:' expected for conditional expression" +msgstr "‘:’ expected for conditional expression" + +#: expr.c:919 +msgid "exponent less than 0" +msgstr "exponent less than 0" + +#: expr.c:976 +msgid "identifier expected after pre-increment or pre-decrement" +msgstr "identifier expected after pre-increment or pre-decrement" + +#: expr.c:1002 +msgid "missing `)'" +msgstr "missing ‘)’" + +#: expr.c:1053 expr.c:1390 +msgid "syntax error: operand expected" +msgstr "syntax error: operand expected" + +#: expr.c:1392 +msgid "syntax error: invalid arithmetic operator" +msgstr "syntax error: invalid arithmetic operator" + +#: expr.c:1416 +#, c-format +msgid "%s%s%s: %s (error token is \"%s\")" +msgstr "%s%s%s: %s (error token is “%s”)" + +#: expr.c:1474 +msgid "invalid arithmetic base" +msgstr "invalid arithmetic base" + +#: expr.c:1494 +msgid "value too great for base" +msgstr "value too great for base" + +#: expr.c:1543 +#, c-format +msgid "%s: expression error\n" +msgstr "%s: expression error\n" + +#: general.c:62 +msgid "getcwd: cannot access parent directories" +msgstr "getcwd: cannot access parent directories" + +#: input.c:102 subst.c:5168 +#, c-format +msgid "cannot reset nodelay mode for fd %d" +msgstr "cannot reset nodelay mode for fd %d" + +#: input.c:271 +#, c-format +msgid "cannot allocate new file descriptor for bash input from fd %d" +msgstr "cannot allocate new file descriptor for bash input from fd %d" + +#: input.c:279 +#, c-format +msgid "save_bash_input: buffer already exists for new fd %d" +msgstr "save_bash_input: buffer already exists for new fd %d" + +#: jobs.c:471 +msgid "start_pipeline: pgrp pipe" +msgstr "start_pipeline: pgrp pipe" + +#: jobs.c:893 +#, c-format +msgid "forked pid %d appears in running job %d" +msgstr "forked pid %d appears in running job %d" + +#: jobs.c:1012 +#, c-format +msgid "deleting stopped job %d with process group %ld" +msgstr "deleting stopped job %d with process group %ld" + +#: jobs.c:1117 +#, c-format +msgid "add_process: process %5ld (%s) in the_pipeline" +msgstr "add_process: process %5ld (%s) in the_pipeline" + +#: jobs.c:1120 +#, c-format +msgid "add_process: pid %5ld (%s) marked as still alive" +msgstr "add_process: pid %5ld (%s) marked as still alive" + +#: jobs.c:1435 +#, c-format +msgid "describe_pid: %ld: no such pid" +msgstr "describe_pid: %ld: no such pid" + +#: jobs.c:1450 +#, c-format +msgid "Signal %d" +msgstr "Signal %d" + +#: jobs.c:1464 jobs.c:1489 +msgid "Done" +msgstr "Done" + +#: jobs.c:1469 siglist.c:123 +msgid "Stopped" +msgstr "Stopped" + +#: jobs.c:1473 +#, c-format +msgid "Stopped(%s)" +msgstr "Stopped(%s)" + +#: jobs.c:1477 +msgid "Running" +msgstr "Running" + +#: jobs.c:1491 +#, c-format +msgid "Done(%d)" +msgstr "Done(%d)" + +#: jobs.c:1493 +#, c-format +msgid "Exit %d" +msgstr "Exit %d" + +#: jobs.c:1496 +msgid "Unknown status" +msgstr "Unknown status" + +#: jobs.c:1583 +#, c-format +msgid "(core dumped) " +msgstr "(core dumped) " + +#: jobs.c:1602 +#, c-format +msgid " (wd: %s)" +msgstr " (wd: %s)" + +#: jobs.c:1819 +#, c-format +msgid "child setpgid (%ld to %ld)" +msgstr "child setpgid (%ld to %ld)" + +#: jobs.c:2138 nojobs.c:605 +#, c-format +msgid "wait: pid %ld is not a child of this shell" +msgstr "wait: pid %ld is not a child of this shell" + +#: jobs.c:2385 +#, c-format +msgid "wait_for: No record of process %ld" +msgstr "wait_for: No record of process %ld" + +#: jobs.c:2694 +#, c-format +msgid "wait_for_job: job %d is stopped" +msgstr "wait_for_job: job %d is stopped" + +#: jobs.c:2986 +#, c-format +msgid "%s: job has terminated" +msgstr "%s: job has terminated" + +#: jobs.c:2995 +#, c-format +msgid "%s: job %d already in background" +msgstr "%s: job %d already in background" + +#: jobs.c:3220 +msgid "waitchld: turning on WNOHANG to avoid indefinite block" +msgstr "waitchld: turning on WNOHANG to avoid indefinite block" + +#: jobs.c:3711 +#, c-format +msgid "%s: line %d: " +msgstr "%s: line %d: " + +#: jobs.c:3725 nojobs.c:843 +#, c-format +msgid " (core dumped)" +msgstr " (core dumped)" + +#: jobs.c:3737 jobs.c:3750 +#, c-format +msgid "(wd now: %s)\n" +msgstr "(wd now: %s)\n" + +#: jobs.c:3782 +msgid "initialize_job_control: getpgrp failed" +msgstr "initialize_job_control: getpgrp failed" + +#: jobs.c:3843 +msgid "initialize_job_control: line discipline" +msgstr "initialize_job_control: line discipline" + +#: jobs.c:3853 +msgid "initialize_job_control: setpgid" +msgstr "initialize_job_control: setpgid" + +#: jobs.c:3874 jobs.c:3883 +#, c-format +msgid "cannot set terminal process group (%d)" +msgstr "cannot set terminal process group (%d)" + +#: jobs.c:3888 +msgid "no job control in this shell" +msgstr "no job control in this shell" + +#: lib/malloc/malloc.c:296 +#, c-format +msgid "malloc: failed assertion: %s\n" +msgstr "malloc: failed assertion: %s\n" + +#: lib/malloc/malloc.c:312 +#, c-format +msgid "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" +msgstr "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" + +#: lib/malloc/malloc.c:313 +msgid "unknown" +msgstr "unknown" + +#: lib/malloc/malloc.c:801 +msgid "malloc: block on free list clobbered" +msgstr "malloc: block on free list clobbered" + +#: lib/malloc/malloc.c:878 +msgid "free: called with already freed block argument" +msgstr "free: called with already freed block argument" + +#: lib/malloc/malloc.c:881 +msgid "free: called with unallocated block argument" +msgstr "free: called with unallocated block argument" + +#: lib/malloc/malloc.c:900 +msgid "free: underflow detected; mh_nbytes out of range" +msgstr "free: underflow detected; mh_nbytes out of range" + +#: lib/malloc/malloc.c:906 +msgid "free: start and end chunk sizes differ" +msgstr "free: start and end chunk sizes differ" + +#: lib/malloc/malloc.c:1005 +msgid "realloc: called with unallocated block argument" +msgstr "realloc: called with unallocated block argument" + +#: lib/malloc/malloc.c:1020 +msgid "realloc: underflow detected; mh_nbytes out of range" +msgstr "realloc: underflow detected; mh_nbytes out of range" + +#: lib/malloc/malloc.c:1026 +msgid "realloc: start and end chunk sizes differ" +msgstr "realloc: start and end chunk sizes differ" + +#: lib/malloc/table.c:194 +#, c-format +msgid "register_alloc: alloc table is full with FIND_ALLOC?\n" +msgstr "register_alloc: alloc table is full with FIND_ALLOC?\n" + +#: lib/malloc/table.c:203 +#, c-format +msgid "register_alloc: %p already in table as allocated?\n" +msgstr "register_alloc: %p already in table as allocated?\n" + +#: lib/malloc/table.c:256 +#, c-format +msgid "register_free: %p already in table as free?\n" +msgstr "register_free: %p already in table as free?\n" + +#: lib/sh/fmtulong.c:102 +msgid "invalid base" +msgstr "invalid base" + +#: lib/sh/netopen.c:168 +#, c-format +msgid "%s: host unknown" +msgstr "%s: host unknown" + +#: lib/sh/netopen.c:175 +#, c-format +msgid "%s: invalid service" +msgstr "%s: invalid service" + +#: lib/sh/netopen.c:306 +#, c-format +msgid "%s: bad network path specification" +msgstr "%s: bad network path specification" + +#: lib/sh/netopen.c:346 +msgid "network operations not supported" +msgstr "network operations not supported" + +#: locale.c:200 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s)" +msgstr "setlocale: LC_ALL: cannot change locale (%s)" + +#: locale.c:202 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s): %s" +msgstr "setlocale: LC_ALL: cannot change locale (%s): %s" + +#: locale.c:259 +#, c-format +msgid "setlocale: %s: cannot change locale (%s)" +msgstr "setlocale: %s: cannot change locale (%s)" + +#: locale.c:261 +#, c-format +msgid "setlocale: %s: cannot change locale (%s): %s" +msgstr "setlocale: %s: cannot change locale (%s): %s" + +#: mailcheck.c:439 +msgid "You have mail in $_" +msgstr "You have mail in $_" + +#: mailcheck.c:464 +msgid "You have new mail in $_" +msgstr "You have new mail in $_" + +#: mailcheck.c:480 +#, c-format +msgid "The mail in %s has been read\n" +msgstr "The mail in %s has been read\n" + +#: make_cmd.c:323 +msgid "syntax error: arithmetic expression required" +msgstr "syntax error: arithmetic expression required" + +#: make_cmd.c:325 +msgid "syntax error: `;' unexpected" +msgstr "syntax error: ‘;’ unexpected" + +#: make_cmd.c:326 +#, c-format +msgid "syntax error: `((%s))'" +msgstr "syntax error: ‘((%s))’" + +#: make_cmd.c:578 +#, c-format +msgid "make_here_document: bad instruction type %d" +msgstr "make_here_document: bad instruction type %d" + +#: make_cmd.c:662 +#, c-format +msgid "here-document at line %d delimited by end-of-file (wanted `%s')" +msgstr "here-document at line %d delimited by end-of-file (wanted ‘%s’)" + +#: make_cmd.c:759 +#, c-format +msgid "make_redirection: redirection instruction `%d' out of range" +msgstr "make_redirection: redirection instruction ‘%d’ out of range" + +#: parse.y:3278 parse.y:3561 +#, c-format +msgid "unexpected EOF while looking for matching `%c'" +msgstr "unexpected EOF while looking for matching ‘%c’" + +#: parse.y:4170 +msgid "unexpected EOF while looking for `]]'" +msgstr "unexpected EOF while looking for ‘]]’" + +#: parse.y:4175 +#, c-format +msgid "syntax error in conditional expression: unexpected token `%s'" +msgstr "syntax error in conditional expression: unexpected token ‘%s’" + +#: parse.y:4179 +msgid "syntax error in conditional expression" +msgstr "syntax error in conditional expression" + +#: parse.y:4257 +#, c-format +msgid "unexpected token `%s', expected `)'" +msgstr "unexpected token ‘%s’, expected ‘)’" + +#: parse.y:4261 +msgid "expected `)'" +msgstr "expected ‘)’" + +#: parse.y:4289 +#, c-format +msgid "unexpected argument `%s' to conditional unary operator" +msgstr "unexpected argument ‘%s’ to conditional unary operator" + +#: parse.y:4293 +msgid "unexpected argument to conditional unary operator" +msgstr "unexpected argument to conditional unary operator" + +#: parse.y:4339 +#, c-format +msgid "unexpected token `%s', conditional binary operator expected" +msgstr "unexpected token ‘%s’, conditional binary operator expected" + +#: parse.y:4343 +msgid "conditional binary operator expected" +msgstr "conditional binary operator expected" + +#: parse.y:4365 +#, c-format +msgid "unexpected argument `%s' to conditional binary operator" +msgstr "unexpected argument ‘%s’ to conditional binary operator" + +#: parse.y:4369 +msgid "unexpected argument to conditional binary operator" +msgstr "unexpected argument to conditional binary operator" + +#: parse.y:4380 +#, c-format +msgid "unexpected token `%c' in conditional command" +msgstr "unexpected token ‘%c’ in conditional command" + +#: parse.y:4383 +#, c-format +msgid "unexpected token `%s' in conditional command" +msgstr "unexpected token ‘%s’ in conditional command" + +#: parse.y:4387 +#, c-format +msgid "unexpected token %d in conditional command" +msgstr "unexpected token %d in conditional command" + +#: parse.y:5737 +#, c-format +msgid "syntax error near unexpected token `%s'" +msgstr "syntax error near unexpected token ‘%s’" + +#: parse.y:5755 +#, c-format +msgid "syntax error near `%s'" +msgstr "syntax error near ‘%s’" + +#: parse.y:5765 +msgid "syntax error: unexpected end of file" +msgstr "syntax error: unexpected end of file" + +#: parse.y:5765 +msgid "syntax error" +msgstr "syntax error" + +#: parse.y:5827 +#, c-format +msgid "Use \"%s\" to leave the shell.\n" +msgstr "Use “%s” to leave the shell.\n" + +#: parse.y:5989 +msgid "unexpected EOF while looking for matching `)'" +msgstr "unexpected EOF while looking for matching ‘)’" + +#: pcomplete.c:1094 +#, c-format +msgid "completion: function `%s' not found" +msgstr "completion: function ‘%s’ not found" + +#: pcomplib.c:182 +#, c-format +msgid "progcomp_insert: %s: NULL COMPSPEC" +msgstr "progcomp_insert: %s: NULL COMPSPEC" + +#: print_cmd.c:300 +#, c-format +msgid "print_command: bad connector `%d'" +msgstr "print_command: bad connector ‘%d’" + +#: print_cmd.c:373 +#, c-format +msgid "xtrace_set: %d: invalid file descriptor" +msgstr "xtrace_set: %d: invalid file descriptor" + +#: print_cmd.c:378 +msgid "xtrace_set: NULL file pointer" +msgstr "xtrace_set: NULL file pointer" + +#: print_cmd.c:382 +#, c-format +msgid "xtrace fd (%d) != fileno xtrace fp (%d)" +msgstr "xtrace fd (%d) != fileno xtrace fp (%d)" + +#: print_cmd.c:1518 +#, c-format +msgid "cprintf: `%c': invalid format character" +msgstr "cprintf: ‘%c’: invalid format character" + +#: redir.c:123 redir.c:170 +msgid "file descriptor out of range" +msgstr "file descriptor out of range" + +#: redir.c:177 +#, c-format +msgid "%s: ambiguous redirect" +msgstr "%s: ambiguous redirect" + +#: redir.c:181 +#, c-format +msgid "%s: cannot overwrite existing file" +msgstr "%s: cannot overwrite existing file" + +#: redir.c:186 +#, c-format +msgid "%s: restricted: cannot redirect output" +msgstr "%s: restricted: cannot redirect output" + +#: redir.c:191 +#, c-format +msgid "cannot create temp file for here-document: %s" +msgstr "cannot create temp file for here-document: %s" + +#: redir.c:195 +#, c-format +msgid "%s: cannot assign fd to variable" +msgstr "%s: cannot assign fd to variable" + +#: redir.c:582 +msgid "/dev/(tcp|udp)/host/port not supported without networking" +msgstr "/dev/(tcp|udp)/host/port not supported without networking" + +#: redir.c:861 redir.c:973 redir.c:1034 redir.c:1199 +msgid "redirection error: cannot duplicate fd" +msgstr "redirection error: cannot duplicate fd" + +#: shell.c:339 +msgid "could not find /tmp, please create!" +msgstr "could not find /tmp, please create!" + +#: shell.c:343 +msgid "/tmp must be a valid directory name" +msgstr "/tmp must be a valid directory name" + +#: shell.c:890 +#, c-format +msgid "%c%c: invalid option" +msgstr "%c%c: invalid option" + +#: shell.c:1682 +msgid "I have no name!" +msgstr "I have no name!" + +#: shell.c:1827 +#, c-format +msgid "GNU bash, version %s-(%s)\n" +msgstr "GNU bash, version %s-(%s)\n" + +#: shell.c:1828 +#, c-format +msgid "" +"Usage:\t%s [GNU long option] [option] ...\n" +"\t%s [GNU long option] [option] script-file ...\n" +msgstr "" +"Usage:\t%s [GNU long option] [option] ...\n" +"\t%s [GNU long option] [option] script-file ...\n" + +#: shell.c:1830 +msgid "GNU long options:\n" +msgstr "GNU long options:\n" + +#: shell.c:1834 +msgid "Shell options:\n" +msgstr "Shell options:\n" + +#: shell.c:1835 +msgid "\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n" +msgstr "\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n" + +#: shell.c:1850 +#, c-format +msgid "\t-%s or -o option\n" +msgstr "\t-%s or -o option\n" + +#: shell.c:1856 +#, c-format +msgid "Type `%s -c \"help set\"' for more information about shell options.\n" +msgstr "Type ‘%s -c “help set”’ for more information about shell options.\n" + +#: shell.c:1857 +#, c-format +msgid "Type `%s -c help' for more information about shell builtin commands.\n" +msgstr "Type ‘%s -c help’ for more information about shell builtin commands.\n" + +#: shell.c:1858 +#, c-format +msgid "Use the `bashbug' command to report bugs.\n" +msgstr "Use the ‘bashbug’ command to report bugs.\n" + +#: sig.c:691 +#, c-format +msgid "sigprocmask: %d: invalid operation" +msgstr "sigprocmask: %d: invalid operation" + +#: siglist.c:48 +msgid "Bogus signal" +msgstr "Bogus signal" + +#: siglist.c:51 +msgid "Hangup" +msgstr "Hangup" + +#: siglist.c:55 +msgid "Interrupt" +msgstr "Interrupt" + +#: siglist.c:59 +msgid "Quit" +msgstr "Quit" + +#: siglist.c:63 +msgid "Illegal instruction" +msgstr "Illegal instruction" + +#: siglist.c:67 +msgid "BPT trace/trap" +msgstr "BPT trace/trap" + +#: siglist.c:75 +msgid "ABORT instruction" +msgstr "ABORT instruction" + +#: siglist.c:79 +msgid "EMT instruction" +msgstr "EMT instruction" + +#: siglist.c:83 +msgid "Floating point exception" +msgstr "Floating point exception" + +#: siglist.c:87 +msgid "Killed" +msgstr "Killed" + +#: siglist.c:91 +msgid "Bus error" +msgstr "Bus error" + +#: siglist.c:95 +msgid "Segmentation fault" +msgstr "Segmentation fault" + +#: siglist.c:99 +msgid "Bad system call" +msgstr "Bad system call" + +#: siglist.c:103 +msgid "Broken pipe" +msgstr "Broken pipe" + +#: siglist.c:107 +msgid "Alarm clock" +msgstr "Alarm clock" + +#: siglist.c:111 +msgid "Terminated" +msgstr "Terminated" + +#: siglist.c:115 +msgid "Urgent IO condition" +msgstr "Urgent IO condition" + +#: siglist.c:119 +msgid "Stopped (signal)" +msgstr "Stopped (signal)" + +#: siglist.c:127 +msgid "Continue" +msgstr "Continue" + +#: siglist.c:135 +msgid "Child death or stop" +msgstr "Child death or stop" + +#: siglist.c:139 +msgid "Stopped (tty input)" +msgstr "Stopped (tty input)" + +#: siglist.c:143 +msgid "Stopped (tty output)" +msgstr "Stopped (tty output)" + +#: siglist.c:147 +msgid "I/O ready" +msgstr "I/O ready" + +#: siglist.c:151 +msgid "CPU limit" +msgstr "CPU limit" + +#: siglist.c:155 +msgid "File limit" +msgstr "File limit" + +#: siglist.c:159 +msgid "Alarm (virtual)" +msgstr "Alarm (virtual)" + +#: siglist.c:163 +msgid "Alarm (profile)" +msgstr "Alarm (profile)" + +#: siglist.c:167 +msgid "Window changed" +msgstr "Window changed" + +#: siglist.c:171 +msgid "Record lock" +msgstr "Record lock" + +#: siglist.c:175 +msgid "User signal 1" +msgstr "User signal 1" + +#: siglist.c:179 +msgid "User signal 2" +msgstr "User signal 2" + +#: siglist.c:183 +msgid "HFT input data pending" +msgstr "HFT input data pending" + +#: siglist.c:187 +msgid "power failure imminent" +msgstr "power failure imminent" + +#: siglist.c:191 +msgid "system crash imminent" +msgstr "system crash imminent" + +#: siglist.c:195 +msgid "migrate process to another CPU" +msgstr "migrate process to another CPU" + +#: siglist.c:199 +msgid "programming error" +msgstr "programming error" + +#: siglist.c:203 +msgid "HFT monitor mode granted" +msgstr "HFT monitor mode granted" + +#: siglist.c:207 +msgid "HFT monitor mode retracted" +msgstr "HFT monitor mode retracted" + +#: siglist.c:211 +msgid "HFT sound sequence has completed" +msgstr "HFT sound sequence has completed" + +#: siglist.c:215 +msgid "Information request" +msgstr "Information request" + +#: siglist.c:223 +msgid "Unknown Signal #" +msgstr "Unknown Signal #" + +#: siglist.c:225 +#, c-format +msgid "Unknown Signal #%d" +msgstr "Unknown Signal #%d" + +#: subst.c:1362 subst.c:1520 +#, c-format +msgid "bad substitution: no closing `%s' in %s" +msgstr "bad substitution: no closing ‘%s’ in %s" + +#: subst.c:2847 +#, c-format +msgid "%s: cannot assign list to array member" +msgstr "%s: cannot assign list to array member" + +#: subst.c:5065 subst.c:5081 +msgid "cannot make pipe for process substitution" +msgstr "cannot make pipe for process substitution" + +#: subst.c:5113 +msgid "cannot make child for process substitution" +msgstr "cannot make child for process substitution" + +#: subst.c:5158 +#, c-format +msgid "cannot open named pipe %s for reading" +msgstr "cannot open named pipe %s for reading" + +#: subst.c:5160 +#, c-format +msgid "cannot open named pipe %s for writing" +msgstr "cannot open named pipe %s for writing" + +#: subst.c:5178 +#, c-format +msgid "cannot duplicate named pipe %s as fd %d" +msgstr "cannot duplicate named pipe %s as fd %d" + +#: subst.c:5376 +msgid "cannot make pipe for command substitution" +msgstr "cannot make pipe for command substitution" + +#: subst.c:5414 +msgid "cannot make child for command substitution" +msgstr "cannot make child for command substitution" + +#: subst.c:5433 +msgid "command_substitute: cannot duplicate pipe as fd 1" +msgstr "command_substitute: cannot duplicate pipe as fd 1" + +#: subst.c:5837 subst.c:8050 +#, c-format +msgid "%s: invalid variable name for name reference" +msgstr "%s: invalid variable name for name reference" + +#: subst.c:6048 +#, c-format +msgid "%s: parameter null or not set" +msgstr "%s: parameter null or not set" + +#: subst.c:6320 subst.c:6335 +#, c-format +msgid "%s: substring expression < 0" +msgstr "%s: substring expression < 0" + +#: subst.c:7506 +#, c-format +msgid "%s: bad substitution" +msgstr "%s: bad substitution" + +#: subst.c:7583 +#, c-format +msgid "$%s: cannot assign in this way" +msgstr "$%s: cannot assign in this way" + +#: subst.c:7917 +msgid "" +"future versions of the shell will force evaluation as an arithmetic " +"substitution" +msgstr "" +"future versions of the shell will force evaluation as an arithmetic " +"substitution" + +#: subst.c:8421 +#, c-format +msgid "bad substitution: no closing \"`\" in %s" +msgstr "bad substitution: no closing “`” in %s" + +#: subst.c:9322 +#, c-format +msgid "no match: %s" +msgstr "no match: %s" + +#: test.c:147 +msgid "argument expected" +msgstr "argument expected" + +#: test.c:156 +#, c-format +msgid "%s: integer expression expected" +msgstr "%s: integer expression expected" + +#: test.c:264 +msgid "`)' expected" +msgstr "‘)’ expected" + +#: test.c:266 +#, c-format +msgid "`)' expected, found %s" +msgstr "‘)’ expected, found %s" + +#: test.c:281 test.c:742 test.c:745 +#, c-format +msgid "%s: unary operator expected" +msgstr "%s: unary operator expected" + +#: test.c:468 test.c:785 +#, c-format +msgid "%s: binary operator expected" +msgstr "%s: binary operator expected" + +#: test.c:860 +msgid "missing `]'" +msgstr "missing ‘]’" + +#: trap.c:217 +msgid "invalid signal number" +msgstr "invalid signal number" + +#: trap.c:371 +#, c-format +msgid "run_pending_traps: bad value in trap_list[%d]: %p" +msgstr "run_pending_traps: bad value in trap_list[%d]: %p" + +#: trap.c:375 +#, c-format +msgid "" +"run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" +msgstr "" +"run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" + +#: trap.c:428 +#, c-format +msgid "trap_handler: bad signal %d" +msgstr "trap_handler: bad signal %d" + +#: variables.c:382 +#, c-format +msgid "error importing function definition for `%s'" +msgstr "error importing function definition for ‘%s’" + +#: variables.c:780 +#, c-format +msgid "shell level (%d) too high, resetting to 1" +msgstr "shell level (%d) too high, resetting to 1" + +#: variables.c:1865 +#, c-format +msgid "%s: circular name reference" +msgstr "%s: circular name reference" + +#: variables.c:2228 +msgid "make_local_variable: no function context at current scope" +msgstr "make_local_variable: no function context at current scope" + +#: variables.c:2247 +#, c-format +msgid "%s: variable may not be assigned value" +msgstr "%s: variable may not be assigned value" + +#: variables.c:3646 +msgid "all_local_variables: no function context at current scope" +msgstr "all_local_variables: no function context at current scope" + +#: variables.c:3891 +#, c-format +msgid "%s has null exportstr" +msgstr "%s has null exportstr" + +#: variables.c:3896 variables.c:3905 +#, c-format +msgid "invalid character %d in exportstr for %s" +msgstr "invalid character %d in exportstr for %s" + +#: variables.c:3911 +#, c-format +msgid "no `=' in exportstr for %s" +msgstr "no ‘=’ in exportstr for %s" + +#: variables.c:4344 +msgid "pop_var_context: head of shell_variables not a function context" +msgstr "pop_var_context: head of shell_variables not a function context" + +#: variables.c:4357 +msgid "pop_var_context: no global_variables context" +msgstr "pop_var_context: no global_variables context" + +#: variables.c:4431 +msgid "pop_scope: head of shell_variables not a temporary environment scope" +msgstr "pop_scope: head of shell_variables not a temporary environment scope" + +#: variables.c:5257 +#, c-format +msgid "%s: %s: cannot open as FILE" +msgstr "%s: %s: cannot open as FILE" + +#: variables.c:5262 +#, c-format +msgid "%s: %s: invalid value for trace file descriptor" +msgstr "%s: %s: invalid value for trace file descriptor" + +#: variables.c:5307 +#, c-format +msgid "%s: %s: compatibility value out of range" +msgstr "%s: %s: compatibility value out of range" + +#: version.c:46 +msgid "Copyright (C) 2013 Free Software Foundation, Inc." +msgstr "Copyright (C) 2013 Free Software Foundation, Inc." + +#: version.c:47 version2.c:47 +msgid "" +"License GPLv3+: GNU GPL version 3 or later \n" +msgstr "" +"License GPLv3+: GNU GPL version 3 or later \n" + +#: version.c:86 version2.c:86 +#, c-format +msgid "GNU bash, version %s (%s)\n" +msgstr "GNU bash, version %s (%s)\n" + +#: version.c:91 version2.c:91 +msgid "This is free software; you are free to change and redistribute it." +msgstr "This is free software; you are free to change and redistribute it." + +#: version.c:92 version2.c:92 +msgid "There is NO WARRANTY, to the extent permitted by law." +msgstr "There is NO WARRANTY, to the extent permitted by law." + +#: version2.c:46 +msgid "Copyright (C) 2012 Free Software Foundation, Inc." +msgstr "Copyright (C) 2012 Free Software Foundation, Inc." + +#: xmalloc.c:91 +#, c-format +msgid "%s: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "%s: cannot allocate %lu bytes (%lu bytes allocated)" + +#: xmalloc.c:93 +#, c-format +msgid "%s: cannot allocate %lu bytes" +msgstr "%s: cannot allocate %lu bytes" + +#: xmalloc.c:163 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)" + +#: xmalloc.c:165 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes" +msgstr "%s: %s:%d: cannot allocate %lu bytes" + +#: builtins.c:43 +msgid "alias [-p] [name[=value] ... ]" +msgstr "alias [-p] [name[=value] ... ]" + +#: builtins.c:47 +msgid "unalias [-a] name [name ...]" +msgstr "unalias [-a] name [name ...]" + +#: builtins.c:51 +msgid "" +"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-" +"x keyseq:shell-command] [keyseq:readline-function or readline-command]" +msgstr "" +"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-" +"x keyseq:shell-command] [keyseq:readline-function or readline-command]" + +#: builtins.c:54 +msgid "break [n]" +msgstr "break [n]" + +#: builtins.c:56 +msgid "continue [n]" +msgstr "continue [n]" + +#: builtins.c:58 +msgid "builtin [shell-builtin [arg ...]]" +msgstr "builtin [shell-builtin [arg ...]]" + +#: builtins.c:61 +msgid "caller [expr]" +msgstr "caller [expr]" + +#: builtins.c:64 +msgid "cd [-L|[-P [-e]] [-@]] [dir]" +msgstr "cd [-L|[-P [-e]] [-@]] [dir]" + +#: builtins.c:66 +msgid "pwd [-LP]" +msgstr "pwd [-LP]" + +#: builtins.c:68 +msgid ":" +msgstr ":" + +#: builtins.c:70 +msgid "true" +msgstr "true" + +#: builtins.c:72 +msgid "false" +msgstr "false" + +#: builtins.c:74 +msgid "command [-pVv] command [arg ...]" +msgstr "command [-pVv] command [arg ...]" + +#: builtins.c:76 +msgid "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" +msgstr "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" + +#: builtins.c:78 +msgid "typeset [-aAfFgilrtux] [-p] name[=value] ..." +msgstr "typeset [-aAfFgilrtux] [-p] name[=value] ..." + +#: builtins.c:80 +msgid "local [option] name[=value] ..." +msgstr "local [option] name[=value] ..." + +#: builtins.c:83 +msgid "echo [-neE] [arg ...]" +msgstr "echo [-neE] [arg ...]" + +#: builtins.c:87 +msgid "echo [-n] [arg ...]" +msgstr "echo [-n] [arg ...]" + +#: builtins.c:90 +msgid "enable [-a] [-dnps] [-f filename] [name ...]" +msgstr "enable [-a] [-dnps] [-f filename] [name ...]" + +#: builtins.c:92 +msgid "eval [arg ...]" +msgstr "eval [arg ...]" + +#: builtins.c:94 +msgid "getopts optstring name [arg]" +msgstr "getopts optstring name [arg]" + +#: builtins.c:96 +msgid "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" +msgstr "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" + +#: builtins.c:98 +msgid "exit [n]" +msgstr "exit [n]" + +#: builtins.c:100 +msgid "logout [n]" +msgstr "logout [n]" + +#: builtins.c:103 +msgid "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" +msgstr "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" + +#: builtins.c:107 +msgid "fg [job_spec]" +msgstr "fg [job_spec]" + +#: builtins.c:111 +msgid "bg [job_spec ...]" +msgstr "bg [job_spec ...]" + +#: builtins.c:114 +msgid "hash [-lr] [-p pathname] [-dt] [name ...]" +msgstr "hash [-lr] [-p pathname] [-dt] [name ...]" + +#: builtins.c:117 +msgid "help [-dms] [pattern ...]" +msgstr "help [-dms] [pattern ...]" + +#: builtins.c:121 +msgid "" +"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg " +"[arg...]" +msgstr "" +"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg " +"[arg...]" + +#: builtins.c:125 +msgid "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" +msgstr "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" + +#: builtins.c:129 +msgid "disown [-h] [-ar] [jobspec ...]" +msgstr "disown [-h] [-ar] [jobspec ...]" + +#: builtins.c:132 +msgid "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l " +"[sigspec]" +msgstr "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l " +"[sigspec]" + +#: builtins.c:134 +msgid "let arg [arg ...]" +msgstr "let arg [arg ...]" + +#: builtins.c:136 +msgid "" +"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p " +"prompt] [-t timeout] [-u fd] [name ...]" +msgstr "" +"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p " +"prompt] [-t timeout] [-u fd] [name ...]" + +#: builtins.c:138 +msgid "return [n]" +msgstr "return [n]" + +#: builtins.c:140 +msgid "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" +msgstr "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" + +#: builtins.c:142 +msgid "unset [-f] [-v] [-n] [name ...]" +msgstr "unset [-f] [-v] [-n] [name ...]" + +#: builtins.c:144 +msgid "export [-fn] [name[=value] ...] or export -p" +msgstr "export [-fn] [name[=value] ...] or export -p" + +#: builtins.c:146 +msgid "readonly [-aAf] [name[=value] ...] or readonly -p" +msgstr "readonly [-aAf] [name[=value] ...] or readonly -p" + +#: builtins.c:148 +msgid "shift [n]" +msgstr "shift [n]" + +#: builtins.c:150 +msgid "source filename [arguments]" +msgstr "source filename [arguments]" + +#: builtins.c:152 +msgid ". filename [arguments]" +msgstr ". filename [arguments]" + +#: builtins.c:155 +msgid "suspend [-f]" +msgstr "suspend [-f]" + +#: builtins.c:158 +msgid "test [expr]" +msgstr "test [expr]" + +#: builtins.c:160 +msgid "[ arg... ]" +msgstr "[ arg... ]" + +#: builtins.c:162 +msgid "times" +msgstr "times" + +#: builtins.c:164 +msgid "trap [-lp] [[arg] signal_spec ...]" +msgstr "trap [-lp] [[arg] signal_spec ...]" + +#: builtins.c:166 +msgid "type [-afptP] name [name ...]" +msgstr "type [-afptP] name [name ...]" + +#: builtins.c:169 +msgid "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" +msgstr "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" + +#: builtins.c:172 +msgid "umask [-p] [-S] [mode]" +msgstr "umask [-p] [-S] [mode]" + +#: builtins.c:175 +msgid "wait [-n] [id ...]" +msgstr "wait [-n] [id ...]" + +#: builtins.c:179 +msgid "wait [pid ...]" +msgstr "wait [pid ...]" + +#: builtins.c:182 +msgid "for NAME [in WORDS ... ] ; do COMMANDS; done" +msgstr "for NAME [in WORDS ... ] ; do COMMANDS; done" + +#: builtins.c:184 +msgid "for (( exp1; exp2; exp3 )); do COMMANDS; done" +msgstr "for (( exp1; exp2; exp3 )); do COMMANDS; done" + +#: builtins.c:186 +msgid "select NAME [in WORDS ... ;] do COMMANDS; done" +msgstr "select NAME [in WORDS ... ;] do COMMANDS; done" + +#: builtins.c:188 +msgid "time [-p] pipeline" +msgstr "time [-p] pipeline" + +#: builtins.c:190 +msgid "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" +msgstr "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" + +#: builtins.c:192 +msgid "" +"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else " +"COMMANDS; ] fi" +msgstr "" +"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else " +"COMMANDS; ] fi" + +#: builtins.c:194 +msgid "while COMMANDS; do COMMANDS; done" +msgstr "while COMMANDS; do COMMANDS; done" + +#: builtins.c:196 +msgid "until COMMANDS; do COMMANDS; done" +msgstr "until COMMANDS; do COMMANDS; done" + +#: builtins.c:198 +msgid "coproc [NAME] command [redirections]" +msgstr "coproc [NAME] command [redirections]" + +#: builtins.c:200 +msgid "function name { COMMANDS ; } or name () { COMMANDS ; }" +msgstr "function name { COMMANDS ; } or name () { COMMANDS ; }" + +#: builtins.c:202 +msgid "{ COMMANDS ; }" +msgstr "{ COMMANDS ; }" + +#: builtins.c:204 +msgid "job_spec [&]" +msgstr "job_spec [&]" + +#: builtins.c:206 +msgid "(( expression ))" +msgstr "(( expression ))" + +#: builtins.c:208 +msgid "[[ expression ]]" +msgstr "[[ expression ]]" + +#: builtins.c:210 +msgid "variables - Names and meanings of some shell variables" +msgstr "variables - Names and meanings of some shell variables" + +#: builtins.c:213 +msgid "pushd [-n] [+N | -N | dir]" +msgstr "pushd [-n] [+N | -N | dir]" + +#: builtins.c:217 +msgid "popd [-n] [+N | -N]" +msgstr "popd [-n] [+N | -N]" + +#: builtins.c:221 +msgid "dirs [-clpv] [+N] [-N]" +msgstr "dirs [-clpv] [+N] [-N]" + +#: builtins.c:224 +msgid "shopt [-pqsu] [-o] [optname ...]" +msgstr "shopt [-pqsu] [-o] [optname ...]" + +#: builtins.c:226 +msgid "printf [-v var] format [arguments]" +msgstr "printf [-v var] format [arguments]" + +#: builtins.c:229 +msgid "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-" +"W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S " +"suffix] [name ...]" +msgstr "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-" +"W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S " +"suffix] [name ...]" + +#: builtins.c:233 +msgid "" +"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " +"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" +msgstr "" +"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " +"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" + +#: builtins.c:237 +msgid "compopt [-o|+o option] [-DE] [name ...]" +msgstr "compopt [-o|+o option] [-DE] [name ...]" + +#: builtins.c:240 +msgid "" +"mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" +"mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" + +#: builtins.c:242 +msgid "" +"readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" +"readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" + +#: builtins.c:254 +msgid "" +"Define or display aliases.\n" +" \n" +" Without arguments, `alias' prints the list of aliases in the reusable\n" +" form `alias NAME=VALUE' on standard output.\n" +" \n" +" Otherwise, an alias is defined for each NAME whose VALUE is given.\n" +" A trailing space in VALUE causes the next word to be checked for\n" +" alias substitution when the alias is expanded.\n" +" \n" +" Options:\n" +" -p\tPrint all defined aliases in a reusable format\n" +" \n" +" Exit Status:\n" +" alias returns true unless a NAME is supplied for which no alias has " +"been\n" +" defined." +msgstr "" +"Define or display aliases.\n" +" \n" +" Without arguments, ‘alias’ prints the list of aliases in the reusable\n" +" form ‘alias NAME=VALUE’ on standard output.\n" +" \n" +" Otherwise, an alias is defined for each NAME whose VALUE is given.\n" +" A trailing space in VALUE causes the next word to be checked for\n" +" alias substitution when the alias is expanded.\n" +" \n" +" Options:\n" +" -p\tPrint all defined aliases in a reusable format\n" +" \n" +" Exit Status:\n" +" alias returns true unless a NAME is supplied for which no alias has " +"been\n" +" defined." + +#: builtins.c:276 +msgid "" +"Remove each NAME from the list of defined aliases.\n" +" \n" +" Options:\n" +" -a\tremove all alias definitions.\n" +" \n" +" Return success unless a NAME is not an existing alias." +msgstr "" +"Remove each NAME from the list of defined aliases.\n" +" \n" +" Options:\n" +" -a\tremove all alias definitions.\n" +" \n" +" Return success unless a NAME is not an existing alias." + +#: builtins.c:289 +msgid "" +"Set Readline key bindings and variables.\n" +" \n" +" Bind a key sequence to a Readline function or a macro, or set a\n" +" Readline variable. The non-option argument syntax is equivalent to\n" +" that found in ~/.inputrc, but must be passed as a single argument:\n" +" e.g., bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Options:\n" +" -m keymap Use KEYMAP as the keymap for the duration of this\n" +" command. Acceptable keymap names are emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" +"move,\n" +" vi-command, and vi-insert.\n" +" -l List names of functions.\n" +" -P List function names and bindings.\n" +" -p List functions and bindings in a form that can be\n" +" reused as input.\n" +" -S List key sequences that invoke macros and their " +"values\n" +" -s List key sequences that invoke macros and their " +"values\n" +" in a form that can be reused as input.\n" +" -V List variable names and values\n" +" -v List variable names and values in a form that can\n" +" be reused as input.\n" +" -q function-name Query about which keys invoke the named function.\n" +" -u function-name Unbind all keys which are bound to the named " +"function.\n" +" -r keyseq Remove the binding for KEYSEQ.\n" +" -f filename Read key bindings from FILENAME.\n" +" -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when\n" +" \t\t\t\tKEYSEQ is entered.\n" +" -X\t\t List key sequences bound with -x and associated commands\n" +" in a form that can be reused as input.\n" +" \n" +" Exit Status:\n" +" bind returns 0 unless an unrecognized option is given or an error occurs." +msgstr "" +"Set Readline key bindings and variables.\n" +" \n" +" Bind a key sequence to a Readline function or a macro, or set a\n" +" Readline variable. The non-option argument syntax is equivalent to\n" +" that found in ~/.inputrc, but must be passed as a single argument:\n" +" e.g., bind '“\\C-x\\C-r”: re-read-init-file'.\n" +" \n" +" Options:\n" +" -m keymap Use KEYMAP as the keymap for the duration of this\n" +" command. Acceptable keymap names are emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" +"move,\n" +" vi-command, and vi-insert.\n" +" -l List names of functions.\n" +" -P List function names and bindings.\n" +" -p List functions and bindings in a form that can be\n" +" reused as input.\n" +" -S List key sequences that invoke macros and their " +"values\n" +" -s List key sequences that invoke macros and their " +"values\n" +" in a form that can be reused as input.\n" +" -V List variable names and values\n" +" -v List variable names and values in a form that can\n" +" be reused as input.\n" +" -q function-name Query about which keys invoke the named function.\n" +" -u function-name Unbind all keys which are bound to the named " +"function.\n" +" -r keyseq Remove the binding for KEYSEQ.\n" +" -f filename Read key bindings from FILENAME.\n" +" -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when\n" +" \t\t\t\tKEYSEQ is entered.\n" +" -X\t\t List key sequences bound with -x and associated commands\n" +" in a form that can be reused as input.\n" +" \n" +" Exit Status:\n" +" bind returns 0 unless an unrecognized option is given or an error occurs." + +#: builtins.c:328 +msgid "" +"Exit for, while, or until loops.\n" +" \n" +" Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n" +" loops.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Exit for, while, or until loops.\n" +" \n" +" Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n" +" loops.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." + +#: builtins.c:340 +msgid "" +"Resume for, while, or until loops.\n" +" \n" +" Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n" +" If N is specified, resumes the Nth enclosing loop.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Resume for, while, or until loops.\n" +" \n" +" Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n" +" If N is specified, resumes the Nth enclosing loop.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." + +#: builtins.c:352 +msgid "" +"Execute shell builtins.\n" +" \n" +" Execute SHELL-BUILTIN with arguments ARGs without performing command\n" +" lookup. This is useful when you wish to reimplement a shell builtin\n" +" as a shell function, but need to execute the builtin within the " +"function.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n" +" not a shell builtin.." +msgstr "" +"Execute shell builtins.\n" +" \n" +" Execute SHELL-BUILTIN with arguments ARGs without performing command\n" +" lookup. This is useful when you wish to reimplement a shell builtin\n" +" as a shell function, but need to execute the builtin within the " +"function.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n" +" not a shell builtin.." + +#: builtins.c:367 +msgid "" +"Return the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns \"$line $filename\". With EXPR, returns\n" +" \"$line $subroutine $filename\"; this extra information can be used to\n" +" provide a stack trace.\n" +" \n" +" The value of EXPR indicates how many call frames to go back before the\n" +" current one; the top frame is frame 0.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless the shell is not executing a shell function or EXPR\n" +" is invalid." +msgstr "" +"Return the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns “$line $filename”. With EXPR, returns\n" +" “$line $subroutine $filename”; this extra information can be used to\n" +" provide a stack trace.\n" +" \n" +" The value of EXPR indicates how many call frames to go back before the\n" +" current one; the top frame is frame 0.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless the shell is not executing a shell function or EXPR\n" +" is invalid." + +#: builtins.c:385 +msgid "" +"Change the shell working directory.\n" +" \n" +" Change the current directory to DIR. The default DIR is the value of " +"the\n" +" HOME shell variable.\n" +" \n" +" The variable CDPATH defines the search path for the directory " +"containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon " +"(:).\n" +" A null directory name is the same as the current directory. If DIR " +"begins\n" +" with a slash (/), then CDPATH is not used.\n" +" \n" +" If the directory is not found, and the shell option `cdable_vars' is " +"set,\n" +" the word is assumed to be a variable name. If that variable has a " +"value,\n" +" its value is used for DIR.\n" +" \n" +" Options:\n" +" -L\tforce symbolic links to be followed: resolve symbolic links in\n" +" \tDIR after processing instances of `..'\n" +" -P\tuse the physical directory structure without following symbolic\n" +" \tlinks: resolve symbolic links in DIR before processing instances\n" +" \tof `..'\n" +" -e\tif the -P option is supplied, and the current working directory\n" +" \tcannot be determined successfully, exit with a non-zero status\n" +" -@ on systems that support it, present a file with extended " +"attributes\n" +" as a directory containing the file attributes\n" +" \n" +" The default is to follow symbolic links, as if `-L' were specified.\n" +" `..' is processed by removing the immediately previous pathname " +"component\n" +" back to a slash or the beginning of DIR.\n" +" \n" +" Exit Status:\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully " +"when\n" +" -P is used; non-zero otherwise." +msgstr "" +"Change the shell working directory.\n" +" \n" +" Change the current directory to DIR. The default DIR is the value of " +"the\n" +" HOME shell variable.\n" +" \n" +" The variable CDPATH defines the search path for the directory " +"containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon " +"(:).\n" +" A null directory name is the same as the current directory. If DIR " +"begins\n" +" with a slash (/), then CDPATH is not used.\n" +" \n" +" If the directory is not found, and the shell option ‘cdable_vars’ is " +"set,\n" +" the word is assumed to be a variable name. If that variable has a " +"value,\n" +" its value is used for DIR.\n" +" \n" +" Options:\n" +" -L\tforce symbolic links to be followed: resolve symbolic links in\n" +" \tDIR after processing instances of ‘..’\n" +" -P\tuse the physical directory structure without following symbolic\n" +" \tlinks: resolve symbolic links in DIR before processing instances\n" +" \tof ‘..’\n" +" -e\tif the -P option is supplied, and the current working directory\n" +" \tcannot be determined successfully, exit with a non-zero status\n" +" -@ on systems that support it, present a file with extended " +"attributes\n" +" as a directory containing the file attributes\n" +" \n" +" The default is to follow symbolic links, as if ‘-L’ were specified.\n" +" ‘..’ is processed by removing the immediately previous pathname " +"component\n" +" back to a slash or the beginning of DIR.\n" +" \n" +" Exit Status:\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully " +"when\n" +" -P is used; non-zero otherwise." + +#: builtins.c:422 +msgid "" +"Print the name of the current working directory.\n" +" \n" +" Options:\n" +" -L\tprint the value of $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tprint the physical directory, without any symbolic links\n" +" \n" +" By default, `pwd' behaves as if `-L' were specified.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless an invalid option is given or the current directory\n" +" cannot be read." +msgstr "" +"Print the name of the current working directory.\n" +" \n" +" Options:\n" +" -L\tprint the value of $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tprint the physical directory, without any symbolic links\n" +" \n" +" By default, ‘pwd’ behaves as if ‘-L’ were specified.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless an invalid option is given or the current directory\n" +" cannot be read." + +#: builtins.c:439 +msgid "" +"Null command.\n" +" \n" +" No effect; the command does nothing.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Null command.\n" +" \n" +" No effect; the command does nothing.\n" +" \n" +" Exit Status:\n" +" Always succeeds." + +#: builtins.c:450 +msgid "" +"Return a successful result.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Return a successful result.\n" +" \n" +" Exit Status:\n" +" Always succeeds." + +#: builtins.c:459 +msgid "" +"Return an unsuccessful result.\n" +" \n" +" Exit Status:\n" +" Always fails." +msgstr "" +"Return an unsuccessful result.\n" +" \n" +" Exit Status:\n" +" Always fails." + +#: builtins.c:468 +msgid "" +"Execute a simple command or display information about commands.\n" +" \n" +" Runs COMMAND with ARGS suppressing shell function lookup, or display\n" +" information about the specified COMMANDs. Can be used to invoke " +"commands\n" +" on disk when a function with the same name exists.\n" +" \n" +" Options:\n" +" -p\tuse a default value for PATH that is guaranteed to find all of\n" +" \tthe standard utilities\n" +" -v\tprint a description of COMMAND similar to the `type' builtin\n" +" -V\tprint a more verbose description of each COMMAND\n" +" \n" +" Exit Status:\n" +" Returns exit status of COMMAND, or failure if COMMAND is not found." +msgstr "" +"Execute a simple command or display information about commands.\n" +" \n" +" Runs COMMAND with ARGS suppressing shell function lookup, or display\n" +" information about the specified COMMANDs. Can be used to invoke " +"commands\n" +" on disk when a function with the same name exists.\n" +" \n" +" Options:\n" +" -p\tuse a default value for PATH that is guaranteed to find all of\n" +" \tthe standard utilities\n" +" -v\tprint a description of COMMAND similar to the ‘type’ builtin\n" +" -V\tprint a more verbose description of each COMMAND\n" +" \n" +" Exit Status:\n" +" Returns exit status of COMMAND, or failure if COMMAND is not found." + +#: builtins.c:487 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Declare variables and give them attributes. If no NAMEs are given,\n" +" display the attributes and values of all variables.\n" +" \n" +" Options:\n" +" -f\trestrict action or display to function names and definitions\n" +" -F\trestrict display to function names only (plus line number and\n" +" \tsource file when debugging)\n" +" -g\tcreate global variables when used in a shell function; otherwise\n" +" \tignored\n" +" -p\tdisplay the attributes and value of each NAME\n" +" \n" +" Options which set attributes:\n" +" -a\tto make NAMEs indexed arrays (if supported)\n" +" -A\tto make NAMEs associative arrays (if supported)\n" +" -i\tto make NAMEs have the `integer' attribute\n" +" -l\tto convert NAMEs to lower case on assignment\n" +" -n\tmake NAME a reference to the variable named by its value\n" +" -r\tto make NAMEs readonly\n" +" -t\tto make NAMEs have the `trace' attribute\n" +" -u\tto convert NAMEs to upper case on assignment\n" +" -x\tto make NAMEs export\n" +" \n" +" Using `+' instead of `-' turns off the given attribute.\n" +" \n" +" Variables with the integer attribute have arithmetic evaluation (see\n" +" the `let' command) performed when the variable is assigned a value.\n" +" \n" +" When used in a function, `declare' makes NAMEs local, as with the " +"`local'\n" +" command. The `-g' option suppresses this behavior.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or a variable\n" +" assignment error occurs." +msgstr "" +"Set variable values and attributes.\n" +" \n" +" Declare variables and give them attributes. If no NAMEs are given,\n" +" display the attributes and values of all variables.\n" +" \n" +" Options:\n" +" -f\trestrict action or display to function names and definitions\n" +" -F\trestrict display to function names only (plus line number and\n" +" \tsource file when debugging)\n" +" -g\tcreate global variables when used in a shell function; otherwise\n" +" \tignored\n" +" -p\tdisplay the attributes and value of each NAME\n" +" \n" +" Options which set attributes:\n" +" -a\tto make NAMEs indexed arrays (if supported)\n" +" -A\tto make NAMEs associative arrays (if supported)\n" +" -i\tto make NAMEs have the ‘integer’ attribute\n" +" -l\tto convert NAMEs to lower case on assignment\n" +" -n\tmake NAME a reference to the variable named by its value\n" +" -r\tto make NAMEs readonly\n" +" -t\tto make NAMEs have the ‘trace’ attribute\n" +" -u\tto convert NAMEs to upper case on assignment\n" +" -x\tto make NAMEs export\n" +" \n" +" Using ‘+’ instead of ‘-’ turns off the given attribute.\n" +" \n" +" Variables with the integer attribute have arithmetic evaluation (see\n" +" the ‘let’ command) performed when the variable is assigned a value.\n" +" \n" +" When used in a function, ‘declare’ makes NAMEs local, as with the " +"‘local’\n" +" command. The ‘-g’ option suppresses this behavior.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or a variable\n" +" assignment error occurs." + +#: builtins.c:527 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Obsolete. See `help declare'." +msgstr "" +"Set variable values and attributes.\n" +" \n" +" Obsolete. See ‘help declare’." + +#: builtins.c:535 +msgid "" +"Define local variables.\n" +" \n" +" Create a local variable called NAME, and give it VALUE. OPTION can\n" +" be any option accepted by `declare'.\n" +" \n" +" Local variables can only be used within a function; they are visible\n" +" only to the function where they are defined and its children.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied, a variable\n" +" assignment error occurs, or the shell is not executing a function." +msgstr "" +"Define local variables.\n" +" \n" +" Create a local variable called NAME, and give it VALUE. OPTION can\n" +" be any option accepted by ‘declare’.\n" +" \n" +" Local variables can only be used within a function; they are visible\n" +" only to the function where they are defined and its children.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied, a variable\n" +" assignment error occurs, or the shell is not executing a function." + +#: builtins.c:552 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs, separated by a single space character and followed by " +"a\n" +" newline, on the standard output.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" -e\tenable interpretation of the following backslash escapes\n" +" -E\texplicitly suppress interpretation of backslash escapes\n" +" \n" +" `echo' interprets the following backslash-escaped characters:\n" +" \\a\talert (bell)\n" +" \\b\tbackspace\n" +" \\c\tsuppress further output\n" +" \\e\tescape character\n" +" \\E\tescape character\n" +" \\f\tform feed\n" +" \\n\tnew line\n" +" \\r\tcarriage return\n" +" \\t\thorizontal tab\n" +" \\v\tvertical tab\n" +" \\\\\tbackslash\n" +" \\0nnn\tthe character whose ASCII code is NNN (octal). NNN can be\n" +" \t0 to 3 octal digits\n" +" \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" +" \tcan be one or two hex digits\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs, separated by a single space character and followed by " +"a\n" +" newline, on the standard output.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" -e\tenable interpretation of the following backslash escapes\n" +" -E\texplicitly suppress interpretation of backslash escapes\n" +" \n" +" ‘echo’ interprets the following backslash-escaped characters:\n" +" \\a\talert (bell)\n" +" \\b\tbackspace\n" +" \\c\tsuppress further output\n" +" \\e\tescape character\n" +" \\E\tescape character\n" +" \\f\tform feed\n" +" \\n\tnew line\n" +" \\r\tcarriage return\n" +" \\t\thorizontal tab\n" +" \\v\tvertical tab\n" +" \\\\\tbackslash\n" +" \\0nnn\tthe character whose ASCII code is NNN (octal). NNN can be\n" +" \t0 to 3 octal digits\n" +" \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" +" \tcan be one or two hex digits\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." + +#: builtins.c:588 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs on the standard output followed by a newline.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs on the standard output followed by a newline.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." + +#: builtins.c:603 +msgid "" +"Enable and disable shell builtins.\n" +" \n" +" Enables and disables builtin shell commands. Disabling allows you to\n" +" execute a disk command which has the same name as a shell builtin\n" +" without using a full pathname.\n" +" \n" +" Options:\n" +" -a\tprint a list of builtins showing whether or not each is enabled\n" +" -n\tdisable each NAME or display a list of disabled builtins\n" +" -p\tprint the list of builtins in a reusable format\n" +" -s\tprint only the names of Posix `special' builtins\n" +" \n" +" Options controlling dynamic loading:\n" +" -f\tLoad builtin NAME from shared object FILENAME\n" +" -d\tRemove a builtin loaded with -f\n" +" \n" +" Without options, each NAME is enabled.\n" +" \n" +" To use the `test' found in $PATH instead of the shell builtin\n" +" version, type `enable -n test'.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not a shell builtin or an error occurs." +msgstr "" +"Enable and disable shell builtins.\n" +" \n" +" Enables and disables builtin shell commands. Disabling allows you to\n" +" execute a disk command which has the same name as a shell builtin\n" +" without using a full pathname.\n" +" \n" +" Options:\n" +" -a\tprint a list of builtins showing whether or not each is enabled\n" +" -n\tdisable each NAME or display a list of disabled builtins\n" +" -p\tprint the list of builtins in a reusable format\n" +" -s\tprint only the names of Posix ‘special’ builtins\n" +" \n" +" Options controlling dynamic loading:\n" +" -f\tLoad builtin NAME from shared object FILENAME\n" +" -d\tRemove a builtin loaded with -f\n" +" \n" +" Without options, each NAME is enabled.\n" +" \n" +" To use the ‘test’ found in $PATH instead of the shell builtin\n" +" version, type ‘enable -n test’.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not a shell builtin or an error occurs." + +#: builtins.c:631 +msgid "" +"Execute arguments as a shell command.\n" +" \n" +" Combine ARGs into a single string, use the result as input to the " +"shell,\n" +" and execute the resulting commands.\n" +" \n" +" Exit Status:\n" +" Returns exit status of command or success if command is null." +msgstr "" +"Execute arguments as a shell command.\n" +" \n" +" Combine ARGs into a single string, use the result as input to the " +"shell,\n" +" and execute the resulting commands.\n" +" \n" +" Exit Status:\n" +" Returns exit status of command or success if command is null." + +#: builtins.c:643 +msgid "" +"Parse option arguments.\n" +" \n" +" Getopts is used by shell procedures to parse positional parameters\n" +" as options.\n" +" \n" +" OPTSTRING contains the option letters to be recognized; if a letter\n" +" is followed by a colon, the option is expected to have an argument,\n" +" which should be separated from it by white space.\n" +" \n" +" Each time it is invoked, getopts will place the next option in the\n" +" shell variable $name, initializing name if it does not exist, and\n" +" the index of the next argument to be processed into the shell\n" +" variable OPTIND. OPTIND is initialized to 1 each time the shell or\n" +" a shell script is invoked. When an option requires an argument,\n" +" getopts places that argument into the shell variable OPTARG.\n" +" \n" +" getopts reports errors in one of two ways. If the first character\n" +" of OPTSTRING is a colon, getopts uses silent error reporting. In\n" +" this mode, no error messages are printed. If an invalid option is\n" +" seen, getopts places the option character found into OPTARG. If a\n" +" required argument is not found, getopts places a ':' into NAME and\n" +" sets OPTARG to the option character found. If getopts is not in\n" +" silent mode, and an invalid option is seen, getopts places '?' into\n" +" NAME and unsets OPTARG. If a required argument is not found, a '?'\n" +" is placed in NAME, OPTARG is unset, and a diagnostic message is\n" +" printed.\n" +" \n" +" If the shell variable OPTERR has the value 0, getopts disables the\n" +" printing of error messages, even if the first character of\n" +" OPTSTRING is not a colon. OPTERR has the value 1 by default.\n" +" \n" +" Getopts normally parses the positional parameters ($0 - $9), but if\n" +" more arguments are given, they are parsed instead.\n" +" \n" +" Exit Status:\n" +" Returns success if an option is found; fails if the end of options is\n" +" encountered or an error occurs." +msgstr "" +"Parse option arguments.\n" +" \n" +" Getopts is used by shell procedures to parse positional parameters\n" +" as options.\n" +" \n" +" OPTSTRING contains the option letters to be recognized; if a letter\n" +" is followed by a colon, the option is expected to have an argument,\n" +" which should be separated from it by white space.\n" +" \n" +" Each time it is invoked, getopts will place the next option in the\n" +" shell variable $name, initializing name if it does not exist, and\n" +" the index of the next argument to be processed into the shell\n" +" variable OPTIND. OPTIND is initialized to 1 each time the shell or\n" +" a shell script is invoked. When an option requires an argument,\n" +" getopts places that argument into the shell variable OPTARG.\n" +" \n" +" getopts reports errors in one of two ways. If the first character\n" +" of OPTSTRING is a colon, getopts uses silent error reporting. In\n" +" this mode, no error messages are printed. If an invalid option is\n" +" seen, getopts places the option character found into OPTARG. If a\n" +" required argument is not found, getopts places a ‘:’ into NAME and\n" +" sets OPTARG to the option character found. If getopts is not in\n" +" silent mode, and an invalid option is seen, getopts places ‘?’ into\n" +" NAME and unsets OPTARG. If a required argument is not found, a ‘?’\n" +" is placed in NAME, OPTARG is unset, and a diagnostic message is\n" +" printed.\n" +" \n" +" If the shell variable OPTERR has the value 0, getopts disables the\n" +" printing of error messages, even if the first character of\n" +" OPTSTRING is not a colon. OPTERR has the value 1 by default.\n" +" \n" +" Getopts normally parses the positional parameters ($0 - $9), but if\n" +" more arguments are given, they are parsed instead.\n" +" \n" +" Exit Status:\n" +" Returns success if an option is found; fails if the end of options is\n" +" encountered or an error occurs." + +#: builtins.c:685 +msgid "" +"Replace the shell with the given command.\n" +" \n" +" Execute COMMAND, replacing this shell with the specified program.\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not " +"specified,\n" +" any redirections take effect in the current shell.\n" +" \n" +" Options:\n" +" -a name\tpass NAME as the zeroth argument to COMMAND\n" +" -c\t\texecute COMMAND with an empty environment\n" +" -l\t\tplace a dash in the zeroth argument to COMMAND\n" +" \n" +" If the command cannot be executed, a non-interactive shell exits, " +"unless\n" +" the shell option `execfail' is set.\n" +" \n" +" Exit Status:\n" +" Returns success unless COMMAND is not found or a redirection error " +"occurs." +msgstr "" +"Replace the shell with the given command.\n" +" \n" +" Execute COMMAND, replacing this shell with the specified program.\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not " +"specified,\n" +" any redirections take effect in the current shell.\n" +" \n" +" Options:\n" +" -a name\tpass NAME as the zeroth argument to COMMAND\n" +" -c\t\texecute COMMAND with an empty environment\n" +" -l\t\tplace a dash in the zeroth argument to COMMAND\n" +" \n" +" If the command cannot be executed, a non-interactive shell exits, " +"unless\n" +" the shell option ‘execfail’ is set.\n" +" \n" +" Exit Status:\n" +" Returns success unless COMMAND is not found or a redirection error " +"occurs." + +#: builtins.c:706 +msgid "" +"Exit the shell.\n" +" \n" +" Exits the shell with a status of N. If N is omitted, the exit status\n" +" is that of the last command executed." +msgstr "" +"Exit the shell.\n" +" \n" +" Exits the shell with a status of N. If N is omitted, the exit status\n" +" is that of the last command executed." + +#: builtins.c:715 +msgid "" +"Exit a login shell.\n" +" \n" +" Exits a login shell with exit status N. Returns an error if not " +"executed\n" +" in a login shell." +msgstr "" +"Exit a login shell.\n" +" \n" +" Exits a login shell with exit status N. Returns an error if not " +"executed\n" +" in a login shell." + +#: builtins.c:725 +msgid "" +"Display or execute commands from the history list.\n" +" \n" +" fc is used to list or edit and re-execute commands from the history " +"list.\n" +" FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" +" string, which means the most recent command beginning with that\n" +" string.\n" +" \n" +" Options:\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then " +"EDITOR,\n" +" \t\tthen vi\n" +" -l \tlist lines instead of editing\n" +" -n\tomit line numbers when listing\n" +" -r\treverse the order of the lines (newest listed first)\n" +" \n" +" With the `fc -s [pat=rep ...] [command]' format, COMMAND is\n" +" re-executed after the substitution OLD=NEW is performed.\n" +" \n" +" A useful alias to use with this is r='fc -s', so that typing `r cc'\n" +" runs the last command beginning with `cc' and typing `r' re-executes\n" +" the last command.\n" +" \n" +" Exit Status:\n" +" Returns success or status of executed command; non-zero if an error " +"occurs." +msgstr "" +"Display or execute commands from the history list.\n" +" \n" +" fc is used to list or edit and re-execute commands from the history " +"list.\n" +" FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" +" string, which means the most recent command beginning with that\n" +" string.\n" +" \n" +" Options:\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then " +"EDITOR,\n" +" \t\tthen vi\n" +" -l \tlist lines instead of editing\n" +" -n\tomit line numbers when listing\n" +" -r\treverse the order of the lines (newest listed first)\n" +" \n" +" With the ‘fc -s [pat=rep ...] [command]’ format, COMMAND is\n" +" re-executed after the substitution OLD=NEW is performed.\n" +" \n" +" A useful alias to use with this is r='fc -s', so that typing ‘r cc’\n" +" runs the last command beginning with ‘cc’ and typing ‘r’ re-executes\n" +" the last command.\n" +" \n" +" Exit Status:\n" +" Returns success or status of executed command; non-zero if an error " +"occurs." + +#: builtins.c:755 +msgid "" +"Move job to the foreground.\n" +" \n" +" Place the job identified by JOB_SPEC in the foreground, making it the\n" +" current job. If JOB_SPEC is not present, the shell's notion of the\n" +" current job is used.\n" +" \n" +" Exit Status:\n" +" Status of command placed in foreground, or failure if an error occurs." +msgstr "" +"Move job to the foreground.\n" +" \n" +" Place the job identified by JOB_SPEC in the foreground, making it the\n" +" current job. If JOB_SPEC is not present, the shell's notion of the\n" +" current job is used.\n" +" \n" +" Exit Status:\n" +" Status of command placed in foreground, or failure if an error occurs." + +#: builtins.c:770 +msgid "" +"Move jobs to the background.\n" +" \n" +" Place the jobs identified by each JOB_SPEC in the background, as if " +"they\n" +" had been started with `&'. If JOB_SPEC is not present, the shell's " +"notion\n" +" of the current job is used.\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Move jobs to the background.\n" +" \n" +" Place the jobs identified by each JOB_SPEC in the background, as if " +"they\n" +" had been started with ‘&’. If JOB_SPEC is not present, the shell's " +"notion\n" +" of the current job is used.\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." + +#: builtins.c:784 +msgid "" +"Remember or display program locations.\n" +" \n" +" Determine and remember the full pathname of each command NAME. If\n" +" no arguments are given, information about remembered commands is " +"displayed.\n" +" \n" +" Options:\n" +" -d\t\tforget the remembered location of each NAME\n" +" -l\t\tdisplay in a format that may be reused as input\n" +" -p pathname\tuse PATHNAME as the full pathname of NAME\n" +" -r\t\tforget all remembered locations\n" +" -t\t\tprint the remembered location of each NAME, preceding\n" +" \t\teach location with the corresponding NAME if multiple\n" +" \t\tNAMEs are given\n" +" Arguments:\n" +" NAME\t\tEach NAME is searched for in $PATH and added to the list\n" +" \t\tof remembered commands.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not found or an invalid option is given." +msgstr "" +"Remember or display program locations.\n" +" \n" +" Determine and remember the full pathname of each command NAME. If\n" +" no arguments are given, information about remembered commands is " +"displayed.\n" +" \n" +" Options:\n" +" -d\t\tforget the remembered location of each NAME\n" +" -l\t\tdisplay in a format that may be reused as input\n" +" -p pathname\tuse PATHNAME as the full pathname of NAME\n" +" -r\t\tforget all remembered locations\n" +" -t\t\tprint the remembered location of each NAME, preceding\n" +" \t\teach location with the corresponding NAME if multiple\n" +" \t\tNAMEs are given\n" +" Arguments:\n" +" NAME\t\tEach NAME is searched for in $PATH and added to the list\n" +" \t\tof remembered commands.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not found or an invalid option is given." + +#: builtins.c:809 +msgid "" +"Display information about builtin commands.\n" +" \n" +" Displays brief summaries of builtin commands. If PATTERN is\n" +" specified, gives detailed help on all commands matching PATTERN,\n" +" otherwise the list of help topics is printed.\n" +" \n" +" Options:\n" +" -d\toutput short description for each topic\n" +" -m\tdisplay usage in pseudo-manpage format\n" +" -s\toutput only a short usage synopsis for each topic matching\n" +" \tPATTERN\n" +" \n" +" Arguments:\n" +" PATTERN\tPattern specifiying a help topic\n" +" \n" +" Exit Status:\n" +" Returns success unless PATTERN is not found or an invalid option is " +"given." +msgstr "" +"Display information about builtin commands.\n" +" \n" +" Displays brief summaries of builtin commands. If PATTERN is\n" +" specified, gives detailed help on all commands matching PATTERN,\n" +" otherwise the list of help topics is printed.\n" +" \n" +" Options:\n" +" -d\toutput short description for each topic\n" +" -m\tdisplay usage in pseudo-manpage format\n" +" -s\toutput only a short usage synopsis for each topic matching\n" +" \tPATTERN\n" +" \n" +" Arguments:\n" +" PATTERN\tPattern specifiying a help topic\n" +" \n" +" Exit Status:\n" +" Returns success unless PATTERN is not found or an invalid option is " +"given." + +#: builtins.c:833 +msgid "" +"Display or manipulate the history list.\n" +" \n" +" Display the history list with line numbers, prefixing each modified\n" +" entry with a `*'. An argument of N lists only the last N entries.\n" +" \n" +" Options:\n" +" -c\tclear the history list by deleting all of the entries\n" +" -d offset\tdelete the history entry at offset OFFSET.\n" +" \n" +" -a\tappend history lines from this session to the history file\n" +" -n\tread all history lines not already read from the history file\n" +" -r\tread the history file and append the contents to the history\n" +" \tlist\n" +" -w\twrite the current history to the history file\n" +" \tand append them to the history list\n" +" \n" +" -p\tperform history expansion on each ARG and display the result\n" +" \twithout storing it in the history list\n" +" -s\tappend the ARGs to the history list as a single entry\n" +" \n" +" If FILENAME is given, it is used as the history file. Otherwise,\n" +" if $HISTFILE has a value, that is used, else ~/.bash_history.\n" +" \n" +" If the $HISTTIMEFORMAT variable is set and not null, its value is used\n" +" as a format string for strftime(3) to print the time stamp associated\n" +" with each displayed history entry. No time stamps are printed " +"otherwise.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" +"Display or manipulate the history list.\n" +" \n" +" Display the history list with line numbers, prefixing each modified\n" +" entry with a ‘*’. An argument of N lists only the last N entries.\n" +" \n" +" Options:\n" +" -c\tclear the history list by deleting all of the entries\n" +" -d offset\tdelete the history entry at offset OFFSET.\n" +" \n" +" -a\tappend history lines from this session to the history file\n" +" -n\tread all history lines not already read from the history file\n" +" -r\tread the history file and append the contents to the history\n" +" \tlist\n" +" -w\twrite the current history to the history file\n" +" \tand append them to the history list\n" +" \n" +" -p\tperform history expansion on each ARG and display the result\n" +" \twithout storing it in the history list\n" +" -s\tappend the ARGs to the history list as a single entry\n" +" \n" +" If FILENAME is given, it is used as the history file. Otherwise,\n" +" if $HISTFILE has a value, that is used, else ~/.bash_history.\n" +" \n" +" If the $HISTTIMEFORMAT variable is set and not null, its value is used\n" +" as a format string for strftime(3) to print the time stamp associated\n" +" with each displayed history entry. No time stamps are printed " +"otherwise.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." + +#: builtins.c:869 +msgid "" +"Display status of jobs.\n" +" \n" +" Lists the active jobs. JOBSPEC restricts output to that job.\n" +" Without options, the status of all active jobs is displayed.\n" +" \n" +" Options:\n" +" -l\tlists process IDs in addition to the normal information\n" +" -n\tlists only processes that have changed status since the last\n" +" \tnotification\n" +" -p\tlists process IDs only\n" +" -r\trestrict output to running jobs\n" +" -s\trestrict output to stopped jobs\n" +" \n" +" If -x is supplied, COMMAND is run after all job specifications that\n" +" appear in ARGS have been replaced with the process ID of that job's\n" +" process group leader.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs.\n" +" If -x is used, returns the exit status of COMMAND." +msgstr "" +"Display status of jobs.\n" +" \n" +" Lists the active jobs. JOBSPEC restricts output to that job.\n" +" Without options, the status of all active jobs is displayed.\n" +" \n" +" Options:\n" +" -l\tlists process IDs in addition to the normal information\n" +" -n\tlists only processes that have changed status since the last\n" +" \tnotification\n" +" -p\tlists process IDs only\n" +" -r\trestrict output to running jobs\n" +" -s\trestrict output to stopped jobs\n" +" \n" +" If -x is supplied, COMMAND is run after all job specifications that\n" +" appear in ARGS have been replaced with the process ID of that job's\n" +" process group leader.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs.\n" +" If -x is used, returns the exit status of COMMAND." + +#: builtins.c:896 +msgid "" +"Remove jobs from current shell.\n" +" \n" +" Removes each JOBSPEC argument from the table of active jobs. Without\n" +" any JOBSPECs, the shell uses its notion of the current job.\n" +" \n" +" Options:\n" +" -a\tremove all jobs if JOBSPEC is not supplied\n" +" -h\tmark each JOBSPEC so that SIGHUP is not sent to the job if the\n" +" \tshell receives a SIGHUP\n" +" -r\tremove only running jobs\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option or JOBSPEC is given." +msgstr "" +"Remove jobs from current shell.\n" +" \n" +" Removes each JOBSPEC argument from the table of active jobs. Without\n" +" any JOBSPECs, the shell uses its notion of the current job.\n" +" \n" +" Options:\n" +" -a\tremove all jobs if JOBSPEC is not supplied\n" +" -h\tmark each JOBSPEC so that SIGHUP is not sent to the job if the\n" +" \tshell receives a SIGHUP\n" +" -r\tremove only running jobs\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option or JOBSPEC is given." + +#: builtins.c:915 +msgid "" +"Send a signal to a job.\n" +" \n" +" Send the processes identified by PID or JOBSPEC the signal named by\n" +" SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n" +" SIGTERM is assumed.\n" +" \n" +" Options:\n" +" -s sig\tSIG is a signal name\n" +" -n sig\tSIG is a signal number\n" +" -l\tlist the signal names; if arguments follow `-l' they are\n" +" \tassumed to be signal numbers for which names should be listed\n" +" \n" +" Kill is a shell builtin for two reasons: it allows job IDs to be used\n" +" instead of process IDs, and allows processes to be killed if the limit\n" +" on processes that you can create is reached.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" +"Send a signal to a job.\n" +" \n" +" Send the processes identified by PID or JOBSPEC the signal named by\n" +" SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n" +" SIGTERM is assumed.\n" +" \n" +" Options:\n" +" -s sig\tSIG is a signal name\n" +" -n sig\tSIG is a signal number\n" +" -l\tlist the signal names; if arguments follow ‘-l’ they are\n" +" \tassumed to be signal numbers for which names should be listed\n" +" \n" +" Kill is a shell builtin for two reasons: it allows job IDs to be used\n" +" instead of process IDs, and allows processes to be killed if the limit\n" +" on processes that you can create is reached.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." + +#: builtins.c:938 +msgid "" +"Evaluate arithmetic expressions.\n" +" \n" +" Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" +" fixed-width integers with no check for overflow, though division by 0\n" +" is trapped and flagged as an error. The following list of operators is\n" +" grouped into levels of equal-precedence operators. The levels are " +"listed\n" +" in order of decreasing precedence.\n" +" \n" +" \tid++, id--\tvariable post-increment, post-decrement\n" +" \t++id, --id\tvariable pre-increment, pre-decrement\n" +" \t-, +\t\tunary minus, plus\n" +" \t!, ~\t\tlogical and bitwise negation\n" +" \t**\t\texponentiation\n" +" \t*, /, %\t\tmultiplication, division, remainder\n" +" \t+, -\t\taddition, subtraction\n" +" \t<<, >>\t\tleft and right bitwise shifts\n" +" \t<=, >=, <, >\tcomparison\n" +" \t==, !=\t\tequality, inequality\n" +" \t&\t\tbitwise AND\n" +" \t^\t\tbitwise XOR\n" +" \t|\t\tbitwise OR\n" +" \t&&\t\tlogical AND\n" +" \t||\t\tlogical OR\n" +" \texpr ? expr : expr\n" +" \t\t\tconditional operator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tassignment\n" +" \n" +" Shell variables are allowed as operands. The name of the variable\n" +" is replaced by its value (coerced to a fixed-width integer) within\n" +" an expression. The variable need not have its integer attribute\n" +" turned on to be used in an expression.\n" +" \n" +" Operators are evaluated in order of precedence. Sub-expressions in\n" +" parentheses are evaluated first and may override the precedence\n" +" rules above.\n" +" \n" +" Exit Status:\n" +" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." +msgstr "" +"Evaluate arithmetic expressions.\n" +" \n" +" Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" +" fixed-width integers with no check for overflow, though division by 0\n" +" is trapped and flagged as an error. The following list of operators is\n" +" grouped into levels of equal-precedence operators. The levels are " +"listed\n" +" in order of decreasing precedence.\n" +" \n" +" \tid++, id--\tvariable post-increment, post-decrement\n" +" \t++id, --id\tvariable pre-increment, pre-decrement\n" +" \t-, +\t\tunary minus, plus\n" +" \t!, ~\t\tlogical and bitwise negation\n" +" \t**\t\texponentiation\n" +" \t*, /, %\t\tmultiplication, division, remainder\n" +" \t+, -\t\taddition, subtraction\n" +" \t<<, >>\t\tleft and right bitwise shifts\n" +" \t<=, >=, <, >\tcomparison\n" +" \t==, !=\t\tequality, inequality\n" +" \t&\t\tbitwise AND\n" +" \t^\t\tbitwise XOR\n" +" \t|\t\tbitwise OR\n" +" \t&&\t\tlogical AND\n" +" \t||\t\tlogical OR\n" +" \texpr ? expr : expr\n" +" \t\t\tconditional operator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tassignment\n" +" \n" +" Shell variables are allowed as operands. The name of the variable\n" +" is replaced by its value (coerced to a fixed-width integer) within\n" +" an expression. The variable need not have its integer attribute\n" +" turned on to be used in an expression.\n" +" \n" +" Operators are evaluated in order of precedence. Sub-expressions in\n" +" parentheses are evaluated first and may override the precedence\n" +" rules above.\n" +" \n" +" Exit Status:\n" +" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." + +#: builtins.c:983 +msgid "" +"Read a line from the standard input and split it into fields.\n" +" \n" +" Reads a single line from the standard input, or from file descriptor FD\n" +" if the -u option is supplied. The line is split into fields as with " +"word\n" +" splitting, and the first word is assigned to the first NAME, the second\n" +" word to the second NAME, and so on, with any leftover words assigned to\n" +" the last NAME. Only the characters found in $IFS are recognized as " +"word\n" +" delimiters.\n" +" \n" +" If no NAMEs are supplied, the line read is stored in the REPLY " +"variable.\n" +" \n" +" Options:\n" +" -a array\tassign the words read to sequential indices of the array\n" +" \t\tvariable ARRAY, starting at zero\n" +" -d delim\tcontinue until the first character of DELIM is read, rather\n" +" \t\tthan newline\n" +" -e\t\tuse Readline to obtain the line in an interactive shell\n" +" -i text\tUse TEXT as the initial text for Readline\n" +" -n nchars\treturn after reading NCHARS characters rather than waiting\n" +" \t\tfor a newline, but honor a delimiter if fewer than NCHARS\n" +" \t\tcharacters are read before the delimiter\n" +" -N nchars\treturn only after reading exactly NCHARS characters, " +"unless\n" +" \t\tEOF is encountered or read times out, ignoring any delimiter\n" +" -p prompt\toutput the string PROMPT without a trailing newline before\n" +" \t\tattempting to read\n" +" -r\t\tdo not allow backslashes to escape any characters\n" +" -s\t\tdo not echo input coming from a terminal\n" +" -t timeout\ttime out and return failure if a complete line of input " +"is\n" +" \t\tnot read within TIMEOUT seconds. The value of the TMOUT\n" +" \t\tvariable is the default timeout. TIMEOUT may be a\n" +" \t\tfractional number. If TIMEOUT is 0, read returns immediately,\n" +" \t\twithout trying to read any data, returning success only if\n" +" \t\tinput is available on the specified file descriptor. The\n" +" \t\texit status is greater than 128 if the timeout is exceeded\n" +" -u fd\t\tread from file descriptor FD instead of the standard input\n" +" \n" +" Exit Status:\n" +" The return code is zero, unless end-of-file is encountered, read times " +"out\n" +" (in which case it's greater than 128), a variable assignment error " +"occurs,\n" +" or an invalid file descriptor is supplied as the argument to -u." +msgstr "" +"Read a line from the standard input and split it into fields.\n" +" \n" +" Reads a single line from the standard input, or from file descriptor FD\n" +" if the -u option is supplied. The line is split into fields as with " +"word\n" +" splitting, and the first word is assigned to the first NAME, the second\n" +" word to the second NAME, and so on, with any leftover words assigned to\n" +" the last NAME. Only the characters found in $IFS are recognized as " +"word\n" +" delimiters.\n" +" \n" +" If no NAMEs are supplied, the line read is stored in the REPLY " +"variable.\n" +" \n" +" Options:\n" +" -a array\tassign the words read to sequential indices of the array\n" +" \t\tvariable ARRAY, starting at zero\n" +" -d delim\tcontinue until the first character of DELIM is read, rather\n" +" \t\tthan newline\n" +" -e\t\tuse Readline to obtain the line in an interactive shell\n" +" -i text\tUse TEXT as the initial text for Readline\n" +" -n nchars\treturn after reading NCHARS characters rather than waiting\n" +" \t\tfor a newline, but honor a delimiter if fewer than NCHARS\n" +" \t\tcharacters are read before the delimiter\n" +" -N nchars\treturn only after reading exactly NCHARS characters, " +"unless\n" +" \t\tEOF is encountered or read times out, ignoring any delimiter\n" +" -p prompt\toutput the string PROMPT without a trailing newline before\n" +" \t\tattempting to read\n" +" -r\t\tdo not allow backslashes to escape any characters\n" +" -s\t\tdo not echo input coming from a terminal\n" +" -t timeout\ttime out and return failure if a complete line of input " +"is\n" +" \t\tnot read within TIMEOUT seconds. The value of the TMOUT\n" +" \t\tvariable is the default timeout. TIMEOUT may be a\n" +" \t\tfractional number. If TIMEOUT is 0, read returns immediately,\n" +" \t\twithout trying to read any data, returning success only if\n" +" \t\tinput is available on the specified file descriptor. The\n" +" \t\texit status is greater than 128 if the timeout is exceeded\n" +" -u fd\t\tread from file descriptor FD instead of the standard input\n" +" \n" +" Exit Status:\n" +" The return code is zero, unless end-of-file is encountered, read times " +"out\n" +" (in which case it's greater than 128), a variable assignment error " +"occurs,\n" +" or an invalid file descriptor is supplied as the argument to -u." + +#: builtins.c:1028 +msgid "" +"Return from a shell function.\n" +" \n" +" Causes a function or sourced script to exit with the return value\n" +" specified by N. If N is omitted, the return status is that of the\n" +" last command executed within the function or script.\n" +" \n" +" Exit Status:\n" +" Returns N, or failure if the shell is not executing a function or script." +msgstr "" +"Return from a shell function.\n" +" \n" +" Causes a function or sourced script to exit with the return value\n" +" specified by N. If N is omitted, the return status is that of the\n" +" last command executed within the function or script.\n" +" \n" +" Exit Status:\n" +" Returns N, or failure if the shell is not executing a function or script." + +#: builtins.c:1041 +msgid "" +"Set or unset values of shell options and positional parameters.\n" +" \n" +" Change the value of shell attributes and positional parameters, or\n" +" display the names and values of shell variables.\n" +" \n" +" Options:\n" +" -a Mark variables which are modified or created for export.\n" +" -b Notify of job termination immediately.\n" +" -e Exit immediately if a command exits with a non-zero status.\n" +" -f Disable file name generation (globbing).\n" +" -h Remember the location of commands as they are looked up.\n" +" -k All assignment arguments are placed in the environment for a\n" +" command, not just those that precede the command name.\n" +" -m Job control is enabled.\n" +" -n Read commands but do not execute them.\n" +" -o option-name\n" +" Set the variable corresponding to option-name:\n" +" allexport same as -a\n" +" braceexpand same as -B\n" +" emacs use an emacs-style line editing interface\n" +" errexit same as -e\n" +" errtrace same as -E\n" +" functrace same as -T\n" +" hashall same as -h\n" +" histexpand same as -H\n" +" history enable command history\n" +" ignoreeof the shell will not exit upon reading EOF\n" +" interactive-comments\n" +" allow comments to appear in interactive commands\n" +" keyword same as -k\n" +" monitor same as -m\n" +" noclobber same as -C\n" +" noexec same as -n\n" +" noglob same as -f\n" +" nolog currently accepted but ignored\n" +" notify same as -b\n" +" nounset same as -u\n" +" onecmd same as -t\n" +" physical same as -P\n" +" pipefail the return value of a pipeline is the status of\n" +" the last command to exit with a non-zero status,\n" +" or zero if no command exited with a non-zero " +"status\n" +" posix change the behavior of bash where the default\n" +" operation differs from the Posix standard to\n" +" match the standard\n" +" privileged same as -p\n" +" verbose same as -v\n" +" vi use a vi-style line editing interface\n" +" xtrace same as -x\n" +" -p Turned on whenever the real and effective user ids do not match.\n" +" Disables processing of the $ENV file and importing of shell\n" +" functions. Turning this option off causes the effective uid and\n" +" gid to be set to the real uid and gid.\n" +" -t Exit after reading and executing one command.\n" +" -u Treat unset variables as an error when substituting.\n" +" -v Print shell input lines as they are read.\n" +" -x Print commands and their arguments as they are executed.\n" +" -B the shell will perform brace expansion\n" +" -C If set, disallow existing regular files to be overwritten\n" +" by redirection of output.\n" +" -E If set, the ERR trap is inherited by shell functions.\n" +" -H Enable ! style history substitution. This flag is on\n" +" by default when the shell is interactive.\n" +" -P If set, do not resolve symbolic links when executing commands\n" +" such as cd which change the current directory.\n" +" -T If set, the DEBUG trap is inherited by shell functions.\n" +" -- Assign any remaining arguments to the positional parameters.\n" +" If there are no remaining arguments, the positional parameters\n" +" are unset.\n" +" - Assign any remaining arguments to the positional parameters.\n" +" The -x and -v options are turned off.\n" +" \n" +" Using + rather than - causes these flags to be turned off. The\n" +" flags can also be used upon invocation of the shell. The current\n" +" set of flags may be found in $-. The remaining n ARGs are positional\n" +" parameters and are assigned, in order, to $1, $2, .. $n. If no\n" +" ARGs are given, all shell variables are printed.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given." +msgstr "" +"Set or unset values of shell options and positional parameters.\n" +" \n" +" Change the value of shell attributes and positional parameters, or\n" +" display the names and values of shell variables.\n" +" \n" +" Options:\n" +" -a Mark variables which are modified or created for export.\n" +" -b Notify of job termination immediately.\n" +" -e Exit immediately if a command exits with a non-zero status.\n" +" -f Disable file name generation (globbing).\n" +" -h Remember the location of commands as they are looked up.\n" +" -k All assignment arguments are placed in the environment for a\n" +" command, not just those that precede the command name.\n" +" -m Job control is enabled.\n" +" -n Read commands but do not execute them.\n" +" -o option-name\n" +" Set the variable corresponding to option-name:\n" +" allexport same as -a\n" +" braceexpand same as -B\n" +" emacs use an emacs-style line editing interface\n" +" errexit same as -e\n" +" errtrace same as -E\n" +" functrace same as -T\n" +" hashall same as -h\n" +" histexpand same as -H\n" +" history enable command history\n" +" ignoreeof the shell will not exit upon reading EOF\n" +" interactive-comments\n" +" allow comments to appear in interactive commands\n" +" keyword same as -k\n" +" monitor same as -m\n" +" noclobber same as -C\n" +" noexec same as -n\n" +" noglob same as -f\n" +" nolog currently accepted but ignored\n" +" notify same as -b\n" +" nounset same as -u\n" +" onecmd same as -t\n" +" physical same as -P\n" +" pipefail the return value of a pipeline is the status of\n" +" the last command to exit with a non-zero status,\n" +" or zero if no command exited with a non-zero " +"status\n" +" posix change the behavior of bash where the default\n" +" operation differs from the Posix standard to\n" +" match the standard\n" +" privileged same as -p\n" +" verbose same as -v\n" +" vi use a vi-style line editing interface\n" +" xtrace same as -x\n" +" -p Turned on whenever the real and effective user ids do not match.\n" +" Disables processing of the $ENV file and importing of shell\n" +" functions. Turning this option off causes the effective uid and\n" +" gid to be set to the real uid and gid.\n" +" -t Exit after reading and executing one command.\n" +" -u Treat unset variables as an error when substituting.\n" +" -v Print shell input lines as they are read.\n" +" -x Print commands and their arguments as they are executed.\n" +" -B the shell will perform brace expansion\n" +" -C If set, disallow existing regular files to be overwritten\n" +" by redirection of output.\n" +" -E If set, the ERR trap is inherited by shell functions.\n" +" -H Enable ! style history substitution. This flag is on\n" +" by default when the shell is interactive.\n" +" -P If set, do not resolve symbolic links when executing commands\n" +" such as cd which change the current directory.\n" +" -T If set, the DEBUG trap is inherited by shell functions.\n" +" -- Assign any remaining arguments to the positional parameters.\n" +" If there are no remaining arguments, the positional parameters\n" +" are unset.\n" +" - Assign any remaining arguments to the positional parameters.\n" +" The -x and -v options are turned off.\n" +" \n" +" Using + rather than - causes these flags to be turned off. The\n" +" flags can also be used upon invocation of the shell. The current\n" +" set of flags may be found in $-. The remaining n ARGs are positional\n" +" parameters and are assigned, in order, to $1, $2, .. $n. If no\n" +" ARGs are given, all shell variables are printed.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given." + +#: builtins.c:1126 +msgid "" +"Unset values and attributes of shell variables and functions.\n" +" \n" +" For each NAME, remove the corresponding variable or function.\n" +" \n" +" Options:\n" +" -f\ttreat each NAME as a shell function\n" +" -v\ttreat each NAME as a shell variable\n" +" -n\ttreat each NAME as a name reference and unset the variable itself\n" +" \trather than the variable it references\n" +" \n" +" Without options, unset first tries to unset a variable, and if that " +"fails,\n" +" tries to unset a function.\n" +" \n" +" Some variables cannot be unset; also see `readonly'.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a NAME is read-only." +msgstr "" +"Unset values and attributes of shell variables and functions.\n" +" \n" +" For each NAME, remove the corresponding variable or function.\n" +" \n" +" Options:\n" +" -f\ttreat each NAME as a shell function\n" +" -v\ttreat each NAME as a shell variable\n" +" -n\ttreat each NAME as a name reference and unset the variable itself\n" +" \trather than the variable it references\n" +" \n" +" Without options, unset first tries to unset a variable, and if that " +"fails,\n" +" tries to unset a function.\n" +" \n" +" Some variables cannot be unset; also see ‘readonly’.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a NAME is read-only." + +#: builtins.c:1148 +msgid "" +"Set export attribute for shell variables.\n" +" \n" +" Marks each NAME for automatic export to the environment of subsequently\n" +" executed commands. If VALUE is supplied, assign VALUE before " +"exporting.\n" +" \n" +" Options:\n" +" -f\trefer to shell functions\n" +" -n\tremove the export property from each NAME\n" +" -p\tdisplay a list of all exported variables and functions\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" +"Set export attribute for shell variables.\n" +" \n" +" Marks each NAME for automatic export to the environment of subsequently\n" +" executed commands. If VALUE is supplied, assign VALUE before " +"exporting.\n" +" \n" +" Options:\n" +" -f\trefer to shell functions\n" +" -n\tremove the export property from each NAME\n" +" -p\tdisplay a list of all exported variables and functions\n" +" \n" +" An argument of ‘--’ disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." + +#: builtins.c:1167 +msgid "" +"Mark shell variables as unchangeable.\n" +" \n" +" Mark each NAME as read-only; the values of these NAMEs may not be\n" +" changed by subsequent assignment. If VALUE is supplied, assign VALUE\n" +" before marking as read-only.\n" +" \n" +" Options:\n" +" -a\trefer to indexed array variables\n" +" -A\trefer to associative array variables\n" +" -f\trefer to shell functions\n" +" -p\tdisplay a list of all readonly variables or functions, depending " +"on\n" +" whether or not the -f option is given\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" +"Mark shell variables as unchangeable.\n" +" \n" +" Mark each NAME as read-only; the values of these NAMEs may not be\n" +" changed by subsequent assignment. If VALUE is supplied, assign VALUE\n" +" before marking as read-only.\n" +" \n" +" Options:\n" +" -a\trefer to indexed array variables\n" +" -A\trefer to associative array variables\n" +" -f\trefer to shell functions\n" +" -p\tdisplay a list of all readonly variables or functions, depending " +"on\n" +" whether or not the -f option is given\n" +" \n" +" An argument of ‘--’ disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." + +#: builtins.c:1189 +msgid "" +"Shift positional parameters.\n" +" \n" +" Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n" +" not given, it is assumed to be 1.\n" +" \n" +" Exit Status:\n" +" Returns success unless N is negative or greater than $#." +msgstr "" +"Shift positional parameters.\n" +" \n" +" Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n" +" not given, it is assumed to be 1.\n" +" \n" +" Exit Status:\n" +" Returns success unless N is negative or greater than $#." + +#: builtins.c:1201 builtins.c:1216 +msgid "" +"Execute commands from a file in the current shell.\n" +" \n" +" Read and execute commands from FILENAME in the current shell. The\n" +" entries in $PATH are used to find the directory containing FILENAME.\n" +" If any ARGUMENTS are supplied, they become the positional parameters\n" +" when FILENAME is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed in FILENAME; fails if\n" +" FILENAME cannot be read." +msgstr "" +"Execute commands from a file in the current shell.\n" +" \n" +" Read and execute commands from FILENAME in the current shell. The\n" +" entries in $PATH are used to find the directory containing FILENAME.\n" +" If any ARGUMENTS are supplied, they become the positional parameters\n" +" when FILENAME is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed in FILENAME; fails if\n" +" FILENAME cannot be read." + +#: builtins.c:1232 +msgid "" +"Suspend shell execution.\n" +" \n" +" Suspend the execution of this shell until it receives a SIGCONT signal.\n" +" Unless forced, login shells cannot be suspended.\n" +" \n" +" Options:\n" +" -f\tforce the suspend, even if the shell is a login shell\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Suspend shell execution.\n" +" \n" +" Suspend the execution of this shell until it receives a SIGCONT signal.\n" +" Unless forced, login shells cannot be suspended.\n" +" \n" +" Options:\n" +" -f\tforce the suspend, even if the shell is a login shell\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." + +#: builtins.c:1248 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" Exits with a status of 0 (true) or 1 (false) depending on\n" +" the evaluation of EXPR. Expressions may be unary or binary. Unary\n" +" expressions are often used to examine the status of a file. There\n" +" are string operators and numeric comparison operators as well.\n" +" \n" +" The behavior of test depends on the number of arguments. Read the\n" +" bash manual page for the complete specification.\n" +" \n" +" File operators:\n" +" \n" +" -a FILE True if file exists.\n" +" -b FILE True if file is block special.\n" +" -c FILE True if file is character special.\n" +" -d FILE True if file is a directory.\n" +" -e FILE True if file exists.\n" +" -f FILE True if file exists and is a regular file.\n" +" -g FILE True if file is set-group-id.\n" +" -h FILE True if file is a symbolic link.\n" +" -L FILE True if file is a symbolic link.\n" +" -k FILE True if file has its `sticky' bit set.\n" +" -p FILE True if file is a named pipe.\n" +" -r FILE True if file is readable by you.\n" +" -s FILE True if file exists and is not empty.\n" +" -S FILE True if file is a socket.\n" +" -t FD True if FD is opened on a terminal.\n" +" -u FILE True if the file is set-user-id.\n" +" -w FILE True if the file is writable by you.\n" +" -x FILE True if the file is executable by you.\n" +" -O FILE True if the file is effectively owned by you.\n" +" -G FILE True if the file is effectively owned by your group.\n" +" -N FILE True if the file has been modified since it was last " +"read.\n" +" \n" +" FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" +" modification date).\n" +" \n" +" FILE1 -ot FILE2 True if file1 is older than file2.\n" +" \n" +" FILE1 -ef FILE2 True if file1 is a hard link to file2.\n" +" \n" +" String operators:\n" +" \n" +" -z STRING True if string is empty.\n" +" \n" +" -n STRING\n" +" STRING True if string is not empty.\n" +" \n" +" STRING1 = STRING2\n" +" True if the strings are equal.\n" +" STRING1 != STRING2\n" +" True if the strings are not equal.\n" +" STRING1 < STRING2\n" +" True if STRING1 sorts before STRING2 " +"lexicographically.\n" +" STRING1 > STRING2\n" +" True if STRING1 sorts after STRING2 lexicographically.\n" +" \n" +" Other operators:\n" +" \n" +" -o OPTION True if the shell option OPTION is enabled.\n" +" -v VAR\t True if the shell variable VAR is set\n" +" -R VAR\t True if the shell variable VAR is set and is a name " +"reference.\n" +" ! EXPR True if expr is false.\n" +" EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n" +" EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n" +" \n" +" arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Arithmetic binary operators return true if ARG1 is equal, not-equal,\n" +" less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n" +" than ARG2.\n" +" \n" +" Exit Status:\n" +" Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n" +" false or an invalid argument is given." +msgstr "" +"Evaluate conditional expression.\n" +" \n" +" Exits with a status of 0 (true) or 1 (false) depending on\n" +" the evaluation of EXPR. Expressions may be unary or binary. Unary\n" +" expressions are often used to examine the status of a file. There\n" +" are string operators and numeric comparison operators as well.\n" +" \n" +" The behavior of test depends on the number of arguments. Read the\n" +" bash manual page for the complete specification.\n" +" \n" +" File operators:\n" +" \n" +" -a FILE True if file exists.\n" +" -b FILE True if file is block special.\n" +" -c FILE True if file is character special.\n" +" -d FILE True if file is a directory.\n" +" -e FILE True if file exists.\n" +" -f FILE True if file exists and is a regular file.\n" +" -g FILE True if file is set-group-id.\n" +" -h FILE True if file is a symbolic link.\n" +" -L FILE True if file is a symbolic link.\n" +" -k FILE True if file has its ‘sticky’ bit set.\n" +" -p FILE True if file is a named pipe.\n" +" -r FILE True if file is readable by you.\n" +" -s FILE True if file exists and is not empty.\n" +" -S FILE True if file is a socket.\n" +" -t FD True if FD is opened on a terminal.\n" +" -u FILE True if the file is set-user-id.\n" +" -w FILE True if the file is writable by you.\n" +" -x FILE True if the file is executable by you.\n" +" -O FILE True if the file is effectively owned by you.\n" +" -G FILE True if the file is effectively owned by your group.\n" +" -N FILE True if the file has been modified since it was last " +"read.\n" +" \n" +" FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" +" modification date).\n" +" \n" +" FILE1 -ot FILE2 True if file1 is older than file2.\n" +" \n" +" FILE1 -ef FILE2 True if file1 is a hard link to file2.\n" +" \n" +" String operators:\n" +" \n" +" -z STRING True if string is empty.\n" +" \n" +" -n STRING\n" +" STRING True if string is not empty.\n" +" \n" +" STRING1 = STRING2\n" +" True if the strings are equal.\n" +" STRING1 != STRING2\n" +" True if the strings are not equal.\n" +" STRING1 < STRING2\n" +" True if STRING1 sorts before STRING2 " +"lexicographically.\n" +" STRING1 > STRING2\n" +" True if STRING1 sorts after STRING2 lexicographically.\n" +" \n" +" Other operators:\n" +" \n" +" -o OPTION True if the shell option OPTION is enabled.\n" +" -v VAR\t True if the shell variable VAR is set\n" +" -R VAR\t True if the shell variable VAR is set and is a name " +"reference.\n" +" ! EXPR True if expr is false.\n" +" EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n" +" EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n" +" \n" +" arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Arithmetic binary operators return true if ARG1 is equal, not-equal,\n" +" less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n" +" than ARG2.\n" +" \n" +" Exit Status:\n" +" Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n" +" false or an invalid argument is given." + +#: builtins.c:1329 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" This is a synonym for the \"test\" builtin, but the last argument must\n" +" be a literal `]', to match the opening `['." +msgstr "" +"Evaluate conditional expression.\n" +" \n" +" This is a synonym for the “test” builtin, but the last argument must\n" +" be a literal ‘]’, to match the opening ‘[’." + +#: builtins.c:1338 +msgid "" +"Display process times.\n" +" \n" +" Prints the accumulated user and system times for the shell and all of " +"its\n" +" child processes.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Display process times.\n" +" \n" +" Prints the accumulated user and system times for the shell and all of " +"its\n" +" child processes.\n" +" \n" +" Exit Status:\n" +" Always succeeds." + +#: builtins.c:1350 +msgid "" +"Trap signals and other events.\n" +" \n" +" Defines and activates handlers to be run when the shell receives " +"signals\n" +" or other conditions.\n" +" \n" +" ARG is a command to be read and executed when the shell receives the\n" +" signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n" +" is supplied) or `-', each specified signal is reset to its original\n" +" value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" +" shell and by the commands it invokes.\n" +" \n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. " +"If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. " +"If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or " +"a\n" +" script run by the . or source builtins finishes executing. A " +"SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause " +"the\n" +" shell to exit when the -e option is enabled.\n" +" \n" +" If no arguments are supplied, trap prints the list of commands " +"associated\n" +" with each signal.\n" +" \n" +" Options:\n" +" -l\tprint a list of signal names and their corresponding numbers\n" +" -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" +" \n" +" Each SIGNAL_SPEC is either a signal name in or a signal " +"number.\n" +" Signal names are case insensitive and the SIG prefix is optional. A\n" +" signal may be sent to the shell with \"kill -signal $$\".\n" +" \n" +" Exit Status:\n" +" Returns success unless a SIGSPEC is invalid or an invalid option is " +"given." +msgstr "" +"Trap signals and other events.\n" +" \n" +" Defines and activates handlers to be run when the shell receives " +"signals\n" +" or other conditions.\n" +" \n" +" ARG is a command to be read and executed when the shell receives the\n" +" signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n" +" is supplied) or ‘-’, each specified signal is reset to its original\n" +" value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" +" shell and by the commands it invokes.\n" +" \n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. " +"If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. " +"If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or " +"a\n" +" script run by the . or source builtins finishes executing. A " +"SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause " +"the\n" +" shell to exit when the -e option is enabled.\n" +" \n" +" If no arguments are supplied, trap prints the list of commands " +"associated\n" +" with each signal.\n" +" \n" +" Options:\n" +" -l\tprint a list of signal names and their corresponding numbers\n" +" -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" +" \n" +" Each SIGNAL_SPEC is either a signal name in or a signal " +"number.\n" +" Signal names are case insensitive and the SIG prefix is optional. A\n" +" signal may be sent to the shell with “kill -signal $$”.\n" +" \n" +" Exit Status:\n" +" Returns success unless a SIGSPEC is invalid or an invalid option is " +"given." + +#: builtins.c:1386 +msgid "" +"Display information about command type.\n" +" \n" +" For each NAME, indicate how it would be interpreted if used as a\n" +" command name.\n" +" \n" +" Options:\n" +" -a\tdisplay all locations containing an executable named NAME;\n" +" \tincludes aliases, builtins, and functions, if and only if\n" +" \tthe `-p' option is not also used\n" +" -f\tsuppress shell function lookup\n" +" -P\tforce a PATH search for each NAME, even if it is an alias,\n" +" \tbuiltin, or function, and returns the name of the disk file\n" +" \tthat would be executed\n" +" -p\treturns either the name of the disk file that would be executed,\n" +" \tor nothing if `type -t NAME' would not return `file'.\n" +" -t\toutput a single word which is one of `alias', `keyword',\n" +" \t`function', `builtin', `file' or `', if NAME is an alias, shell\n" +" \treserved word, shell function, shell builtin, disk file, or not\n" +" \tfound, respectively\n" +" \n" +" Arguments:\n" +" NAME\tCommand name to be interpreted.\n" +" \n" +" Exit Status:\n" +" Returns success if all of the NAMEs are found; fails if any are not " +"found." +msgstr "" +"Display information about command type.\n" +" \n" +" For each NAME, indicate how it would be interpreted if used as a\n" +" command name.\n" +" \n" +" Options:\n" +" -a\tdisplay all locations containing an executable named NAME;\n" +" \tincludes aliases, builtins, and functions, if and only if\n" +" \tthe ‘-p’ option is not also used\n" +" -f\tsuppress shell function lookup\n" +" -P\tforce a PATH search for each NAME, even if it is an alias,\n" +" \tbuiltin, or function, and returns the name of the disk file\n" +" \tthat would be executed\n" +" -p\treturns either the name of the disk file that would be executed,\n" +" \tor nothing if ‘type -t NAME’ would not return ‘file’.\n" +" -t\toutput a single word which is one of ‘alias’, ‘keyword’,\n" +" \t‘function’, ‘builtin’, ‘file’ or ‘’, if NAME is an alias, shell\n" +" \treserved word, shell function, shell builtin, disk file, or not\n" +" \tfound, respectively\n" +" \n" +" Arguments:\n" +" NAME\tCommand name to be interpreted.\n" +" \n" +" Exit Status:\n" +" Returns success if all of the NAMEs are found; fails if any are not " +"found." + +#: builtins.c:1417 +msgid "" +"Modify shell resource limits.\n" +" \n" +" Provides control over the resources available to the shell and " +"processes\n" +" it creates, on systems that allow such control.\n" +" \n" +" Options:\n" +" -S\tuse the `soft' resource limit\n" +" -H\tuse the `hard' resource limit\n" +" -a\tall current limits are reported\n" +" -b\tthe socket buffer size\n" +" -c\tthe maximum size of core files created\n" +" -d\tthe maximum size of a process's data segment\n" +" -e\tthe maximum scheduling priority (`nice')\n" +" -f\tthe maximum size of files written by the shell and its children\n" +" -i\tthe maximum number of pending signals\n" +" -l\tthe maximum size a process may lock into memory\n" +" -m\tthe maximum resident set size\n" +" -n\tthe maximum number of open file descriptors\n" +" -p\tthe pipe buffer size\n" +" -q\tthe maximum number of bytes in POSIX message queues\n" +" -r\tthe maximum real-time scheduling priority\n" +" -s\tthe maximum stack size\n" +" -t\tthe maximum amount of cpu time in seconds\n" +" -u\tthe maximum number of user processes\n" +" -v\tthe size of virtual memory\n" +" -x\tthe maximum number of file locks\n" +" -T the maximum number of threads\n" +" \n" +" Not all options are available on all platforms.\n" +" \n" +" If LIMIT is given, it is the new value of the specified resource; the\n" +" special LIMIT values `soft', `hard', and `unlimited' stand for the\n" +" current soft limit, the current hard limit, and no limit, respectively.\n" +" Otherwise, the current value of the specified resource is printed. If\n" +" no option is given, then -f is assumed.\n" +" \n" +" Values are in 1024-byte increments, except for -t, which is in seconds,\n" +" -p, which is in increments of 512 bytes, and -u, which is an unscaled\n" +" number of processes.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Modify shell resource limits.\n" +" \n" +" Provides control over the resources available to the shell and " +"processes\n" +" it creates, on systems that allow such control.\n" +" \n" +" Options:\n" +" -S\tuse the ‘soft’ resource limit\n" +" -H\tuse the ‘hard’ resource limit\n" +" -a\tall current limits are reported\n" +" -b\tthe socket buffer size\n" +" -c\tthe maximum size of core files created\n" +" -d\tthe maximum size of a process's data segment\n" +" -e\tthe maximum scheduling priority (‘nice’)\n" +" -f\tthe maximum size of files written by the shell and its children\n" +" -i\tthe maximum number of pending signals\n" +" -l\tthe maximum size a process may lock into memory\n" +" -m\tthe maximum resident set size\n" +" -n\tthe maximum number of open file descriptors\n" +" -p\tthe pipe buffer size\n" +" -q\tthe maximum number of bytes in POSIX message queues\n" +" -r\tthe maximum real-time scheduling priority\n" +" -s\tthe maximum stack size\n" +" -t\tthe maximum amount of cpu time in seconds\n" +" -u\tthe maximum number of user processes\n" +" -v\tthe size of virtual memory\n" +" -x\tthe maximum number of file locks\n" +" -T the maximum number of threads\n" +" \n" +" Not all options are available on all platforms.\n" +" \n" +" If LIMIT is given, it is the new value of the specified resource; the\n" +" special LIMIT values ‘soft’, ‘hard’, and ‘unlimited’ stand for the\n" +" current soft limit, the current hard limit, and no limit, respectively.\n" +" Otherwise, the current value of the specified resource is printed. If\n" +" no option is given, then -f is assumed.\n" +" \n" +" Values are in 1024-byte increments, except for -t, which is in seconds,\n" +" -p, which is in increments of 512 bytes, and -u, which is an unscaled\n" +" number of processes.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." + +#: builtins.c:1465 +msgid "" +"Display or set file mode mask.\n" +" \n" +" Sets the user file-creation mask to MODE. If MODE is omitted, prints\n" +" the current value of the mask.\n" +" \n" +" If MODE begins with a digit, it is interpreted as an octal number;\n" +" otherwise it is a symbolic mode string like that accepted by chmod(1).\n" +" \n" +" Options:\n" +" -p\tif MODE is omitted, output in a form that may be reused as input\n" +" -S\tmakes the output symbolic; otherwise an octal number is output\n" +" \n" +" Exit Status:\n" +" Returns success unless MODE is invalid or an invalid option is given." +msgstr "" +"Display or set file mode mask.\n" +" \n" +" Sets the user file-creation mask to MODE. If MODE is omitted, prints\n" +" the current value of the mask.\n" +" \n" +" If MODE begins with a digit, it is interpreted as an octal number;\n" +" otherwise it is a symbolic mode string like that accepted by chmod(1).\n" +" \n" +" Options:\n" +" -p\tif MODE is omitted, output in a form that may be reused as input\n" +" -S\tmakes the output symbolic; otherwise an octal number is output\n" +" \n" +" Exit Status:\n" +" Returns success unless MODE is invalid or an invalid option is given." + +#: builtins.c:1485 +msgid "" +"Wait for job completion and return exit status.\n" +" \n" +" Waits for each process identified by an ID, which may be a process ID or " +"a\n" +" job specification, and reports its termination status. If ID is not\n" +" given, waits for all currently active child processes, and the return\n" +" status is zero. If ID is a a job specification, waits for all " +"processes\n" +" in that job's pipeline.\n" +" \n" +" If the -n option is supplied, waits for the next job to terminate and\n" +" returns its exit status.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last ID; fails if ID is invalid or an invalid\n" +" option is given." +msgstr "" +"Wait for job completion and return exit status.\n" +" \n" +" Waits for each process identified by an ID, which may be a process ID or " +"a\n" +" job specification, and reports its termination status. If ID is not\n" +" given, waits for all currently active child processes, and the return\n" +" status is zero. If ID is a a job specification, waits for all " +"processes\n" +" in that job's pipeline.\n" +" \n" +" If the -n option is supplied, waits for the next job to terminate and\n" +" returns its exit status.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last ID; fails if ID is invalid or an invalid\n" +" option is given." + +#: builtins.c:1506 +msgid "" +"Wait for process completion and return exit status.\n" +" \n" +" Waits for each process specified by a PID and reports its termination " +"status.\n" +" If PID is not given, waits for all currently active child processes,\n" +" and the return status is zero. PID must be a process ID.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last PID; fails if PID is invalid or an " +"invalid\n" +" option is given." +msgstr "" +"Wait for process completion and return exit status.\n" +" \n" +" Waits for each process specified by a PID and reports its termination " +"status.\n" +" If PID is not given, waits for all currently active child processes,\n" +" and the return status is zero. PID must be a process ID.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last PID; fails if PID is invalid or an " +"invalid\n" +" option is given." + +#: builtins.c:1521 +msgid "" +"Execute commands for each member in a list.\n" +" \n" +" The `for' loop executes a sequence of commands for each member in a\n" +" list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is\n" +" assumed. For each element in WORDS, NAME is set to that element, and\n" +" the COMMANDS are executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Execute commands for each member in a list.\n" +" \n" +" The ‘for’ loop executes a sequence of commands for each member in a\n" +" list of items. If ‘in WORDS ...;’ is not present, then ‘in “$@”’ is\n" +" assumed. For each element in WORDS, NAME is set to that element, and\n" +" the COMMANDS are executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." + +#: builtins.c:1535 +msgid "" +"Arithmetic for loop.\n" +" \n" +" Equivalent to\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n" +" omitted, it behaves as if it evaluates to 1.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Arithmetic for loop.\n" +" \n" +" Equivalent to\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n" +" omitted, it behaves as if it evaluates to 1.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." + +#: builtins.c:1553 +msgid "" +"Select words from a list and execute commands.\n" +" \n" +" The WORDS are expanded, generating a list of words. The\n" +" set of expanded words is printed on the standard error, each\n" +" preceded by a number. If `in WORDS' is not present, `in \"$@\"'\n" +" is assumed. The PS3 prompt is then displayed and a line read\n" +" from the standard input. If the line consists of the number\n" +" corresponding to one of the displayed words, then NAME is set\n" +" to that word. If the line is empty, WORDS and the prompt are\n" +" redisplayed. If EOF is read, the command completes. Any other\n" +" value read causes NAME to be set to null. The line read is saved\n" +" in the variable REPLY. COMMANDS are executed after each selection\n" +" until a break command is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Select words from a list and execute commands.\n" +" \n" +" The WORDS are expanded, generating a list of words. The\n" +" set of expanded words is printed on the standard error, each\n" +" preceded by a number. If ‘in WORDS’ is not present, ‘in “$@”’\n" +" is assumed. The PS3 prompt is then displayed and a line read\n" +" from the standard input. If the line consists of the number\n" +" corresponding to one of the displayed words, then NAME is set\n" +" to that word. If the line is empty, WORDS and the prompt are\n" +" redisplayed. If EOF is read, the command completes. Any other\n" +" value read causes NAME to be set to null. The line read is saved\n" +" in the variable REPLY. COMMANDS are executed after each selection\n" +" until a break command is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." + +#: builtins.c:1574 +msgid "" +"Report time consumed by pipeline's execution.\n" +" \n" +" Execute PIPELINE and print a summary of the real time, user CPU time,\n" +" and system CPU time spent executing PIPELINE when it terminates.\n" +" \n" +" Options:\n" +" -p\tprint the timing summary in the portable Posix format\n" +" \n" +" The value of the TIMEFORMAT variable is used as the output format.\n" +" \n" +" Exit Status:\n" +" The return status is the return status of PIPELINE." +msgstr "" +"Report time consumed by pipeline's execution.\n" +" \n" +" Execute PIPELINE and print a summary of the real time, user CPU time,\n" +" and system CPU time spent executing PIPELINE when it terminates.\n" +" \n" +" Options:\n" +" -p\tprint the timing summary in the portable Posix format\n" +" \n" +" The value of the TIMEFORMAT variable is used as the output format.\n" +" \n" +" Exit Status:\n" +" The return status is the return status of PIPELINE." + +#: builtins.c:1591 +msgid "" +"Execute commands based on pattern matching.\n" +" \n" +" Selectively execute COMMANDS based upon WORD matching PATTERN. The\n" +" `|' is used to separate multiple patterns.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Execute commands based on pattern matching.\n" +" \n" +" Selectively execute COMMANDS based upon WORD matching PATTERN. The\n" +" ‘|’ is used to separate multiple patterns.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." + +#: builtins.c:1603 +msgid "" +"Execute commands based on conditional.\n" +" \n" +" The `if COMMANDS' list is executed. If its exit status is zero, then " +"the\n" +" `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list " +"is\n" +" executed in turn, and if its exit status is zero, the corresponding\n" +" `then COMMANDS' list is executed and the if command completes. " +"Otherwise,\n" +" the `else COMMANDS' list is executed, if present. The exit status of " +"the\n" +" entire construct is the exit status of the last command executed, or " +"zero\n" +" if no condition tested true.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Execute commands based on conditional.\n" +" \n" +" The ‘if COMMANDS’ list is executed. If its exit status is zero, then " +"the\n" +" ‘then COMMANDS’ list is executed. Otherwise, each ‘elif COMMANDS’ list " +"is\n" +" executed in turn, and if its exit status is zero, the corresponding\n" +" ‘then COMMANDS’ list is executed and the if command completes. " +"Otherwise,\n" +" the ‘else COMMANDS’ list is executed, if present. The exit status of " +"the\n" +" entire construct is the exit status of the last command executed, or " +"zero\n" +" if no condition tested true.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." + +#: builtins.c:1620 +msgid "" +"Execute commands as long as a test succeeds.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `while' COMMANDS has an exit status of zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Execute commands as long as a test succeeds.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" ‘while’ COMMANDS has an exit status of zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." + +#: builtins.c:1632 +msgid "" +"Execute commands as long as a test does not succeed.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `until' COMMANDS has an exit status which is not zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Execute commands as long as a test does not succeed.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" ‘until’ COMMANDS has an exit status which is not zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." + +#: builtins.c:1644 +msgid "" +"Create a coprocess named NAME.\n" +" \n" +" Execute COMMAND asynchronously, with the standard output and standard\n" +" input of the command connected via a pipe to file descriptors assigned\n" +" to indices 0 and 1 of an array variable NAME in the executing shell.\n" +" The default NAME is \"COPROC\".\n" +" \n" +" Exit Status:\n" +" Returns the exit status of COMMAND." +msgstr "" +"Create a coprocess named NAME.\n" +" \n" +" Execute COMMAND asynchronously, with the standard output and standard\n" +" input of the command connected via a pipe to file descriptors assigned\n" +" to indices 0 and 1 of an array variable NAME in the executing shell.\n" +" The default NAME is “COPROC”.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of COMMAND." + +#: builtins.c:1658 +msgid "" +"Define shell function.\n" +" \n" +" Create a shell function named NAME. When invoked as a simple command,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is " +"invoked,\n" +" the arguments are passed to the function as $1...$n, and the function's\n" +" name is in $FUNCNAME.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is readonly." +msgstr "" +"Define shell function.\n" +" \n" +" Create a shell function named NAME. When invoked as a simple command,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is " +"invoked,\n" +" the arguments are passed to the function as $1...$n, and the function's\n" +" name is in $FUNCNAME.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is readonly." + +#: builtins.c:1672 +msgid "" +"Group commands as a unit.\n" +" \n" +" Run a set of commands in a group. This is one way to redirect an\n" +" entire set of commands.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Group commands as a unit.\n" +" \n" +" Run a set of commands in a group. This is one way to redirect an\n" +" entire set of commands.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." + +#: builtins.c:1684 +msgid "" +"Resume job in foreground.\n" +" \n" +" Equivalent to the JOB_SPEC argument to the `fg' command. Resume a\n" +" stopped or background job. JOB_SPEC can specify either a job name\n" +" or a job number. Following JOB_SPEC with a `&' places the job in\n" +" the background, as if the job specification had been supplied as an\n" +" argument to `bg'.\n" +" \n" +" Exit Status:\n" +" Returns the status of the resumed job." +msgstr "" +"Resume job in foreground.\n" +" \n" +" Equivalent to the JOB_SPEC argument to the ‘fg’ command. Resume a\n" +" stopped or background job. JOB_SPEC can specify either a job name\n" +" or a job number. Following JOB_SPEC with a ‘&’ places the job in\n" +" the background, as if the job specification had been supplied as an\n" +" argument to ‘bg’.\n" +" \n" +" Exit Status:\n" +" Returns the status of the resumed job." + +#: builtins.c:1699 +msgid "" +"Evaluate arithmetic expression.\n" +" \n" +" The EXPRESSION is evaluated according to the rules for arithmetic\n" +" evaluation. Equivalent to \"let EXPRESSION\".\n" +" \n" +" Exit Status:\n" +" Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise." +msgstr "" +"Evaluate arithmetic expression.\n" +" \n" +" The EXPRESSION is evaluated according to the rules for arithmetic\n" +" evaluation. Equivalent to “let EXPRESSION”.\n" +" \n" +" Exit Status:\n" +" Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise." + +#: builtins.c:1711 +msgid "" +"Execute conditional command.\n" +" \n" +" Returns a status of 0 or 1 depending on the evaluation of the " +"conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries " +"used\n" +" by the `test' builtin, and may be combined using the following " +"operators:\n" +" \n" +" ( EXPRESSION )\tReturns the value of EXPRESSION\n" +" ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" +" EXPR1 && EXPR2\tTrue if both EXPR1 and EXPR2 are true; else false\n" +" EXPR1 || EXPR2\tTrue if either EXPR1 or EXPR2 is true; else false\n" +" \n" +" When the `==' and `!=' operators are used, the string to the right of\n" +" the operator is used as a pattern and pattern matching is performed.\n" +" When the `=~' operator is used, the string to the right of the operator\n" +" is matched as a regular expression.\n" +" \n" +" The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n" +" determine the expression's value.\n" +" \n" +" Exit Status:\n" +" 0 or 1 depending on value of EXPRESSION." +msgstr "" +"Execute conditional command.\n" +" \n" +" Returns a status of 0 or 1 depending on the evaluation of the " +"conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries " +"used\n" +" by the ‘test’ builtin, and may be combined using the following " +"operators:\n" +" \n" +" ( EXPRESSION )\tReturns the value of EXPRESSION\n" +" ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" +" EXPR1 && EXPR2\tTrue if both EXPR1 and EXPR2 are true; else false\n" +" EXPR1 || EXPR2\tTrue if either EXPR1 or EXPR2 is true; else false\n" +" \n" +" When the ‘==’ and ‘!=’ operators are used, the string to the right of\n" +" the operator is used as a pattern and pattern matching is performed.\n" +" When the ‘=~’ operator is used, the string to the right of the operator\n" +" is matched as a regular expression.\n" +" \n" +" The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n" +" determine the expression's value.\n" +" \n" +" Exit Status:\n" +" 0 or 1 depending on value of EXPRESSION." + +#: builtins.c:1737 +msgid "" +"Common shell variable names and usage.\n" +" \n" +" BASH_VERSION\tVersion information for this Bash.\n" +" CDPATH\tA colon-separated list of directories to search\n" +" \t\tfor directories given as arguments to `cd'.\n" +" GLOBIGNORE\tA colon-separated list of patterns describing filenames to\n" +" \t\tbe ignored by pathname expansion.\n" +" HISTFILE\tThe name of the file where your command history is stored.\n" +" HISTFILESIZE\tThe maximum number of lines this file can contain.\n" +" HISTSIZE\tThe maximum number of history lines that a running\n" +" \t\tshell can access.\n" +" HOME\tThe complete pathname to your login directory.\n" +" HOSTNAME\tThe name of the current host.\n" +" HOSTTYPE\tThe type of CPU this version of Bash is running under.\n" +" IGNOREEOF\tControls the action of the shell on receipt of an EOF\n" +" \t\tcharacter as the sole input. If set, then the value\n" +" \t\tof it is the number of EOF characters that can be seen\n" +" \t\tin a row on an empty line before the shell will exit\n" +" \t\t(default 10). When unset, EOF signifies the end of input.\n" +" MACHTYPE\tA string describing the current system Bash is running on.\n" +" MAILCHECK\tHow often, in seconds, Bash checks for new mail.\n" +" MAILPATH\tA colon-separated list of filenames which Bash checks\n" +" \t\tfor new mail.\n" +" OSTYPE\tThe version of Unix this version of Bash is running on.\n" +" PATH\tA colon-separated list of directories to search when\n" +" \t\tlooking for commands.\n" +" PROMPT_COMMAND\tA command to be executed before the printing of each\n" +" \t\tprimary prompt.\n" +" PS1\t\tThe primary prompt string.\n" +" PS2\t\tThe secondary prompt string.\n" +" PWD\t\tThe full pathname of the current directory.\n" +" SHELLOPTS\tA colon-separated list of enabled shell options.\n" +" TERM\tThe name of the current terminal type.\n" +" TIMEFORMAT\tThe output format for timing statistics displayed by the\n" +" \t\t`time' reserved word.\n" +" auto_resume\tNon-null means a command word appearing on a line by\n" +" \t\titself is first looked for in the list of currently\n" +" \t\tstopped jobs. If found there, that job is foregrounded.\n" +" \t\tA value of `exact' means that the command word must\n" +" \t\texactly match a command in the list of stopped jobs. A\n" +" \t\tvalue of `substring' means that the command word must\n" +" \t\tmatch a substring of the job. Any other value means that\n" +" \t\tthe command must be a prefix of a stopped job.\n" +" histchars\tCharacters controlling history expansion and quick\n" +" \t\tsubstitution. The first character is the history\n" +" \t\tsubstitution character, usually `!'. The second is\n" +" \t\tthe `quick substitution' character, usually `^'. The\n" +" \t\tthird is the `history comment' character, usually `#'.\n" +" HISTIGNORE\tA colon-separated list of patterns used to decide which\n" +" \t\tcommands should be saved on the history list.\n" +msgstr "" +"Common shell variable names and usage.\n" +" \n" +" BASH_VERSION\tVersion information for this Bash.\n" +" CDPATH\tA colon-separated list of directories to search\n" +" \t\tfor directories given as arguments to ‘cd’.\n" +" GLOBIGNORE\tA colon-separated list of patterns describing filenames to\n" +" \t\tbe ignored by pathname expansion.\n" +" HISTFILE\tThe name of the file where your command history is stored.\n" +" HISTFILESIZE\tThe maximum number of lines this file can contain.\n" +" HISTSIZE\tThe maximum number of history lines that a running\n" +" \t\tshell can access.\n" +" HOME\tThe complete pathname to your login directory.\n" +" HOSTNAME\tThe name of the current host.\n" +" HOSTTYPE\tThe type of CPU this version of Bash is running under.\n" +" IGNOREEOF\tControls the action of the shell on receipt of an EOF\n" +" \t\tcharacter as the sole input. If set, then the value\n" +" \t\tof it is the number of EOF characters that can be seen\n" +" \t\tin a row on an empty line before the shell will exit\n" +" \t\t(default 10). When unset, EOF signifies the end of input.\n" +" MACHTYPE\tA string describing the current system Bash is running on.\n" +" MAILCHECK\tHow often, in seconds, Bash checks for new mail.\n" +" MAILPATH\tA colon-separated list of filenames which Bash checks\n" +" \t\tfor new mail.\n" +" OSTYPE\tThe version of Unix this version of Bash is running on.\n" +" PATH\tA colon-separated list of directories to search when\n" +" \t\tlooking for commands.\n" +" PROMPT_COMMAND\tA command to be executed before the printing of each\n" +" \t\tprimary prompt.\n" +" PS1\t\tThe primary prompt string.\n" +" PS2\t\tThe secondary prompt string.\n" +" PWD\t\tThe full pathname of the current directory.\n" +" SHELLOPTS\tA colon-separated list of enabled shell options.\n" +" TERM\tThe name of the current terminal type.\n" +" TIMEFORMAT\tThe output format for timing statistics displayed by the\n" +" \t\t‘time’ reserved word.\n" +" auto_resume\tNon-null means a command word appearing on a line by\n" +" \t\titself is first looked for in the list of currently\n" +" \t\tstopped jobs. If found there, that job is foregrounded.\n" +" \t\tA value of ‘exact’ means that the command word must\n" +" \t\texactly match a command in the list of stopped jobs. A\n" +" \t\tvalue of ‘substring’ means that the command word must\n" +" \t\tmatch a substring of the job. Any other value means that\n" +" \t\tthe command must be a prefix of a stopped job.\n" +" histchars\tCharacters controlling history expansion and quick\n" +" \t\tsubstitution. The first character is the history\n" +" \t\tsubstitution character, usually ‘!’. The second is\n" +" \t\tthe ‘quick substitution’ character, usually ‘^’. The\n" +" \t\tthird is the ‘history comment’ character, usually ‘#’.\n" +" HISTIGNORE\tA colon-separated list of patterns used to decide which\n" +" \t\tcommands should be saved on the history list.\n" + +#: builtins.c:1794 +msgid "" +"Add directories to stack.\n" +" \n" +" Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" +"Add directories to stack.\n" +" \n" +" Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by ‘dirs’, starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by ‘dirs’, starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The ‘dirs’ builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." + +#: builtins.c:1828 +msgid "" +"Remove directories from stack.\n" +" \n" +" Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" +"Remove directories from stack.\n" +" \n" +" Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by ‘dirs’, starting with zero. For example: ‘popd +0’\n" +" \tremoves the first directory, ‘popd +1’ the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by ‘dirs’, starting with zero. For example: ‘popd -0’\n" +" \tremoves the last directory, ‘popd -1’ the next to last.\n" +" \n" +" The ‘dirs’ builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." + +#: builtins.c:1858 +msgid "" +"Display directory stack.\n" +" \n" +" Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Display directory stack.\n" +" \n" +" Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the ‘pushd’ command; you can get\n" +" back up through the list with the ‘popd’ command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." + +#: builtins.c:1887 +msgid "" +"Set and unset shell options.\n" +" \n" +" Change the setting of each shell option OPTNAME. Without any option\n" +" arguments, list all shell options with an indication of whether or not " +"each\n" +" is set.\n" +" \n" +" Options:\n" +" -o\trestrict OPTNAMEs to those defined for use with `set -o'\n" +" -p\tprint each shell option with an indication of its status\n" +" -q\tsuppress output\n" +" -s\tenable (set) each OPTNAME\n" +" -u\tdisable (unset) each OPTNAME\n" +" \n" +" Exit Status:\n" +" Returns success if OPTNAME is enabled; fails if an invalid option is\n" +" given or OPTNAME is disabled." +msgstr "" +"Set and unset shell options.\n" +" \n" +" Change the setting of each shell option OPTNAME. Without any option\n" +" arguments, list all shell options with an indication of whether or not " +"each\n" +" is set.\n" +" \n" +" Options:\n" +" -o\trestrict OPTNAMEs to those defined for use with ‘set -o’\n" +" -p\tprint each shell option with an indication of its status\n" +" -q\tsuppress output\n" +" -s\tenable (set) each OPTNAME\n" +" -u\tdisable (unset) each OPTNAME\n" +" \n" +" Exit Status:\n" +" Returns success if OPTNAME is enabled; fails if an invalid option is\n" +" given or OPTNAME is disabled." + +#: builtins.c:1908 +msgid "" +"Formats and prints ARGUMENTS under control of the FORMAT.\n" +" \n" +" Options:\n" +" -v var\tassign the output to shell variable VAR rather than\n" +" \t\tdisplay it on the standard output\n" +" \n" +" FORMAT is a character string which contains three types of objects: " +"plain\n" +" characters, which are simply copied to standard output; character " +"escape\n" +" sequences, which are converted and copied to the standard output; and\n" +" format specifications, each of which causes printing of the next " +"successive\n" +" argument.\n" +" \n" +" In addition to the standard format specifications described in " +"printf(1),\n" +" printf interprets:\n" +" \n" +" %b\texpand backslash escape sequences in the corresponding argument\n" +" %q\tquote the argument in a way that can be reused as shell input\n" +" %(fmt)T output the date-time string resulting from using FMT as a " +"format\n" +" string for strftime(3)\n" +" \n" +" The format is re-used as necessary to consume all of the arguments. If\n" +" there are fewer arguments than the format requires, extra format\n" +" specifications behave as if a zero value or null string, as " +"appropriate,\n" +" had been supplied.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a write or " +"assignment\n" +" error occurs." +msgstr "" +"Formats and prints ARGUMENTS under control of the FORMAT.\n" +" \n" +" Options:\n" +" -v var\tassign the output to shell variable VAR rather than\n" +" \t\tdisplay it on the standard output\n" +" \n" +" FORMAT is a character string which contains three types of objects: " +"plain\n" +" characters, which are simply copied to standard output; character " +"escape\n" +" sequences, which are converted and copied to the standard output; and\n" +" format specifications, each of which causes printing of the next " +"successive\n" +" argument.\n" +" \n" +" In addition to the standard format specifications described in " +"printf(1),\n" +" printf interprets:\n" +" \n" +" %b\texpand backslash escape sequences in the corresponding argument\n" +" %q\tquote the argument in a way that can be reused as shell input\n" +" %(fmt)T output the date-time string resulting from using FMT as a " +"format\n" +" string for strftime(3)\n" +" \n" +" The format is re-used as necessary to consume all of the arguments. If\n" +" there are fewer arguments than the format requires, extra format\n" +" specifications behave as if a zero value or null string, as " +"appropriate,\n" +" had been supplied.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a write or " +"assignment\n" +" error occurs." + +#: builtins.c:1942 +msgid "" +"Specify how arguments are to be completed by Readline.\n" +" \n" +" For each NAME, specify how arguments are to be completed. If no " +"options\n" +" are supplied, existing completion specifications are printed in a way " +"that\n" +" allows them to be reused as input.\n" +" \n" +" Options:\n" +" -p\tprint existing completion specifications in a reusable format\n" +" -r\tremove a completion specification for each NAME, or, if no\n" +" \tNAMEs are supplied, all completion specifications\n" +" -D\tapply the completions and actions as the default for commands\n" +" \twithout any specific completion defined\n" +" -E\tapply the completions and actions to \"empty\" commands --\n" +" \tcompletion attempted on a blank line\n" +" \n" +" When completion is attempted, the actions are applied in the order the\n" +" uppercase-letter options are listed above. The -D option takes\n" +" precedence over -E.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Specify how arguments are to be completed by Readline.\n" +" \n" +" For each NAME, specify how arguments are to be completed. If no " +"options\n" +" are supplied, existing completion specifications are printed in a way " +"that\n" +" allows them to be reused as input.\n" +" \n" +" Options:\n" +" -p\tprint existing completion specifications in a reusable format\n" +" -r\tremove a completion specification for each NAME, or, if no\n" +" \tNAMEs are supplied, all completion specifications\n" +" -D\tapply the completions and actions as the default for commands\n" +" \twithout any specific completion defined\n" +" -E\tapply the completions and actions to “empty” commands --\n" +" \tcompletion attempted on a blank line\n" +" \n" +" When completion is attempted, the actions are applied in the order the\n" +" uppercase-letter options are listed above. The -D option takes\n" +" precedence over -E.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." + +#: builtins.c:1970 +msgid "" +"Display possible completions depending on the options.\n" +" \n" +" Intended to be used from within a shell function generating possible\n" +" completions. If the optional WORD argument is supplied, matches " +"against\n" +" WORD are generated.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Display possible completions depending on the options.\n" +" \n" +" Intended to be used from within a shell function generating possible\n" +" completions. If the optional WORD argument is supplied, matches " +"against\n" +" WORD are generated.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." + +#: builtins.c:1985 +msgid "" +"Modify or display completion options.\n" +" \n" +" Modify the completion options for each NAME, or, if no NAMEs are " +"supplied,\n" +" the completion currently being executed. If no OPTIONs are given, " +"print\n" +" the completion options for each NAME or the current completion " +"specification.\n" +" \n" +" Options:\n" +" \t-o option\tSet completion option OPTION for each NAME\n" +" \t-D\t\tChange options for the \"default\" command completion\n" +" \t-E\t\tChange options for the \"empty\" command completion\n" +" \n" +" Using `+o' instead of `-o' turns off the specified option.\n" +" \n" +" Arguments:\n" +" \n" +" Each NAME refers to a command for which a completion specification must\n" +" have previously been defined using the `complete' builtin. If no NAMEs\n" +" are supplied, compopt must be called by a function currently generating\n" +" completions, and the options for that currently-executing completion\n" +" generator are modified.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or NAME does not\n" +" have a completion specification defined." +msgstr "" +"Modify or display completion options.\n" +" \n" +" Modify the completion options for each NAME, or, if no NAMEs are " +"supplied,\n" +" the completion currently being executed. If no OPTIONs are given, " +"print\n" +" the completion options for each NAME or the current completion " +"specification.\n" +" \n" +" Options:\n" +" \t-o option\tSet completion option OPTION for each NAME\n" +" \t-D\t\tChange options for the “default” command completion\n" +" \t-E\t\tChange options for the “empty” command completion\n" +" \n" +" Using ‘+o’ instead of ‘-o’ turns off the specified option.\n" +" \n" +" Arguments:\n" +" \n" +" Each NAME refers to a command for which a completion specification must\n" +" have previously been defined using the ‘complete’ builtin. If no NAMEs\n" +" are supplied, compopt must be called by a function currently generating\n" +" completions, and the options for that currently-executing completion\n" +" generator are modified.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or NAME does not\n" +" have a completion specification defined." + +#: builtins.c:2015 +msgid "" +"Read lines from the standard input into an indexed array variable.\n" +" \n" +" Read lines from the standard input into the indexed array variable " +"ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable " +"MAPFILE\n" +" is the default ARRAY.\n" +" \n" +" Options:\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are " +"copied.\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default " +"index is 0.\n" +" -s count \tDiscard the first COUNT lines read.\n" +" -t\t\tRemove a trailing newline from each line read.\n" +" -u fd\t\tRead lines from file descriptor FD instead of the standard " +"input.\n" +" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read.\n" +" -c quantum\tSpecify the number of lines read between each call to " +"CALLBACK.\n" +" \n" +" Arguments:\n" +" ARRAY\t\tArray variable name to use for file data.\n" +" \n" +" If -C is supplied without -c, the default quantum is 5000. When\n" +" CALLBACK is evaluated, it is supplied the index of the next array\n" +" element to be assigned and the line to be assigned to that element\n" +" as additional arguments.\n" +" \n" +" If not supplied with an explicit origin, mapfile will clear ARRAY " +"before\n" +" assigning to it.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or ARRAY is readonly " +"or\n" +" not an indexed array." +msgstr "" +"Read lines from the standard input into an indexed array variable.\n" +" \n" +" Read lines from the standard input into the indexed array variable " +"ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable " +"MAPFILE\n" +" is the default ARRAY.\n" +" \n" +" Options:\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are " +"copied.\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default " +"index is 0.\n" +" -s count \tDiscard the first COUNT lines read.\n" +" -t\t\tRemove a trailing newline from each line read.\n" +" -u fd\t\tRead lines from file descriptor FD instead of the standard " +"input.\n" +" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read.\n" +" -c quantum\tSpecify the number of lines read between each call to " +"CALLBACK.\n" +" \n" +" Arguments:\n" +" ARRAY\t\tArray variable name to use for file data.\n" +" \n" +" If -C is supplied without -c, the default quantum is 5000. When\n" +" CALLBACK is evaluated, it is supplied the index of the next array\n" +" element to be assigned and the line to be assigned to that element\n" +" as additional arguments.\n" +" \n" +" If not supplied with an explicit origin, mapfile will clear ARRAY " +"before\n" +" assigning to it.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or ARRAY is readonly " +"or\n" +" not an indexed array." + +#: builtins.c:2049 +msgid "" +"Read lines from a file into an array variable.\n" +" \n" +" A synonym for `mapfile'." +msgstr "" +"Read lines from a file into an array variable.\n" +" \n" +" A synonym for ‘mapfile’." diff --git a/po/eo.gmo b/po/eo.gmo new file mode 100644 index 0000000000000000000000000000000000000000..4c35a7d6fbef66512a6aebfb37ab271452ed88cd GIT binary patch literal 161232 zcmeFa37A|*b@zQo*oHPXn9atRz_pMp39Gdk8(UuRNE%sVYeO^gf-#<+nVwOjp6+ok zlExSlHbeXZChQm-5+D!=1TZA*OV|P-fk0S8*vy`=1PFvRyubfBRrlWRnUMq`&+|R+ z$Jkf@zW3I8>eQ)Ir%u)V;ysUfZo=QXB}sCB@WuB?lJD#HgY+~>KD#DK9t?gCyeD|f z+9bIEJOx|^j)KR7bKu>;CxOR-&jud=-U{9ud@J}s@T1_#;P=4$fXA*&k`j0tNY=@6 zQ12faaA&|OsQhmL{{XxNygT?>Fa_TUD&H@H_X58To&x?1JPo|Z`XpHimO-*kE(gyC zZvs`1_ktV2Z-UBy=?2I1K*ie)E(Pa6)#t^a==BCr<@qRh7Wf@71ygR$00#r^1C{SB z0pAU({@)LH>_d_S5+|pDqT8jQ@~eR=&(pyBf-eJApLc-D_p{)=z@LB$fBe~gUj|R& zeh^f+J)q*vg7*QR2C6(S4fmf2_$~0BJpXU74Bq1$5C1Sw_1z09-4=K%_{4C38>sgE zD^PU*D0px18=%Vl3-EOC-VgP3&H-0(KLXwld@Oh}_ySP*zYaVFd@rc_{R^mid=E^) z6VCPY%HV45cY%s`1E}}6fJ*Q6;ECYhfv`gIDNuAc?mWL=3aZ>ApyIbd@zqV?{&}F% zc@?PgyazlL{4981@Q0wve^;1C`J4f&oDTt&?jBHl&1B$M%2k#1g095#ogKC$bf=Z`ECsldw3#$BQfD|>k5LDMb z2o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%LsPKOBDNS#4D!k&LCWC&-^DP#(yhI%!*;>2KHJSx-L;R+CGEo)GU7zK z_D9^(?-{ZHzA*)`5OE9w9|V-#k;}b%(sXpf&LivrkV^}<63@O}ENxHulS_R1R-T=} zBaSXn!&n4luIkdA2G2LCRMV{!f0jGH$`KGmRhX;CEw9dM7fakklnuvH)+0e17IXm^ zJ1eMvl|Z%@v+?OBvfx^Ptu`hF-hjO(d#%i9GGB}aSs8gSTOJ$dQ|Q5JH+wj_^E77d z-VoTC{jfe$ZN04X;re`P;`X=F+yZEL6wB&p)$>ZPUv^u06G5*D&gQenMzHq0vYDl+ zLvov|(U2YkQGAO;)p42u%M>t}z4ljU6frZ4z1`du^nHP00?WDV*}70Z^Q7}2B1Y@6 z4E#dxo=8+qr*mXCLU)QmgYbX|o>g5Mpkhvw)Y!E0}RojF=^aAqf;=#rD$vlRgH(&zF_MYrpGJmqO77*GqW4KscMm%2Gkvje!;t9 zV7<`#j09>LUJS=Fo{Rk@6Xkih9vDt)NlFqh{^h@6ugc#{WN}7>bqDuf*5Kq@V{G?| zdO`E44cbSCbjEJPt(K`)87a4wEz_o1HR9#ec58ZcI)FokNE$cL?S5}FDbM)SxYVz@~99bEOK4HO9v|8m@fJx#5y9dzvrr{2nLL5rjJxD>C0Ss*G}Ovq=Cu=e6QofhfA%pL^)+J`z< bBoL=s(Og<>;SW+G*|d1{$h6I{;@S8g^yRg5 literal 0 HcmV?d00001 diff --git a/po/eo.po b/po/eo.po new file mode 100644 index 0000000..c75a151 --- /dev/null +++ b/po/eo.po @@ -0,0 +1,5799 @@ +# Esperanto language file for GNU Bash. +# Copyright (C) 2011 Free Software Foundation, Inc. +# This file is distributed under the same license as the bash package. +# Sergio Pokrovskij , 1998, 2006, 2009, 2011, 2014. +# +# -*- eval: (po-consider-source-path "~/Documents/Eo/Work/i18n/bash-4.3-rc2/builtins"); -*- +# -*- eval: (po-consider-source-path "~/Documents/Eo/Work/i18n/bash-4.3-rc2"); -*- +# Stilaj notoj: +# La angulaj citiloj limigas «plurajn vortojn», +# 99-66 estas la citiloj de „unuvortaĵo‟ +# +# La mesaĝojn pri internaj eraroj (markitajn per XXX) probable malnecesas traduki. +# +# ---- Glosaro: +# associative array asocitabelo (info "(bash)Arrays") +# brace expansion vinkulmalvolvo +# callback retrovoko +# extended file attributes kromatributoj (de dosiero) +# to force ... per superforto +# granted jesigita +# here-document tuj-dokumento (info "(bash)Redirections") +# indexed array entjerindica tabelo (info "(bash)Arrays") +# positional parameter numerparametro ($1 ...) (info "(bash)Positional Parameters") +# resolve (symbolic links) elnodigi +# special builtin speciala komando (info "(coreutils)Special built-in utilities") +# substitution anstataÅ­igo (info "(bash)Shell Expansions") +# unset malvalorizi (variablon); malaktivigi, malŝalti (opcion, nomon) +msgid "" +msgstr "" +"Project-Id-Version: GNU bash 4.3-rc2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-02-11 11:19-0500\n" +"PO-Revision-Date: 2014-01-31 20:06+0700\n" +"Last-Translator: Sergio Pokrovskij \n" +"Language-Team: Esperanto \n" +"Language: eo\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: arrayfunc.c:51 +msgid "bad array subscript" +msgstr "Misa tabel-indico" + +#: arrayfunc.c:356 builtins/declare.def:566 +#, c-format +msgid "%s: cannot convert indexed to associative array" +msgstr "%s: Maleblas konverti entjerindican tabelon en asocitabelon" + +#: arrayfunc.c:539 +#, c-format +msgid "%s: invalid associative array key" +msgstr "%s: Misa asocitabela ŝlosilo" + +#: arrayfunc.c:541 +#, c-format +msgid "%s: cannot assign to non-numeric index" +msgstr "%s: Valorizato havu nombran indicon" + +#: arrayfunc.c:586 +#, c-format +msgid "%s: %s: must use subscript when assigning associative array" +msgstr "%s: %s: Valorizante per asocitabelo uzu indicon" + +#: bashhist.c:388 +#, c-format +msgid "%s: cannot create: %s" +msgstr "%s: Ne prosperis krei: %s" + +# XXX: internal_error +#: bashline.c:3982 +msgid "bash_execute_unix_command: cannot find keymap for command" +msgstr "bash_execute_unix_command: Mankas klavartabelo por komando" + +#: bashline.c:4069 +#, c-format +msgid "%s: first non-whitespace character is not `\"'" +msgstr "%s: La unua ne-blankspaca signo ne estas „\"‟" + +#: bashline.c:4098 +#, c-format +msgid "no closing `%c' in %s" +msgstr "Mankas ferma „%c‟ en %s" + +#: bashline.c:4132 +#, c-format +msgid "%s: missing colon separator" +msgstr "%s: Mankas disiga dupunkto" + +# XXX: internal_error +#: braces.c:321 +#, c-format +msgid "brace expansion: cannot allocate memory for %s" +msgstr "vinkulmalvolvo: Maleblas memorhavigo por %s" + +# XXX: internal_error +#: braces.c:413 +#, c-format +msgid "brace expansion: failed to allocate memory for %d elements" +msgstr "vinkulmalvolvo: Fiaskis memorhavigo por %d elementoj" + +# XXX: internal_error +#: braces.c:452 +#, c-format +msgid "brace expansion: failed to allocate memory for `%s'" +msgstr "vinkulmalvolvo: Fiaskis memorhavigo por %s" + +#: builtins/alias.def:132 +#, c-format +msgid "`%s': invalid alias name" +msgstr "%s: MaltaÅ­gas por uzi kiel alinomon" + +#: builtins/bind.def:123 builtins/bind.def:126 +msgid "line editing not enabled" +msgstr "liniredaktado ne estas ebligita" + +#: builtins/bind.def:212 +#, c-format +msgid "`%s': invalid keymap name" +msgstr "„%s‟: Misa nomo por klavartabelo" + +#: builtins/bind.def:251 +#, c-format +msgid "%s: cannot read: %s" +msgstr "%s: Ne eblas legi: %s" + +#: builtins/bind.def:266 +#, c-format +msgid "`%s': cannot unbind" +msgstr "%s: Ne eblas malligi" + +#: builtins/bind.def:304 builtins/bind.def:334 +#, c-format +msgid "`%s': unknown function name" +msgstr "%s: Nekonata funkcinomo" + +#: builtins/bind.def:312 +#, c-format +msgid "%s is not bound to any keys.\n" +msgstr "%s malhavas klavligon\n" + +#: builtins/bind.def:316 +#, c-format +msgid "%s can be invoked via " +msgstr "%s vokeblas per " + +#: builtins/break.def:77 builtins/break.def:117 +msgid "loop count" +msgstr "iteracinombrilo" + +#: builtins/break.def:137 +msgid "only meaningful in a `for', `while', or `until' loop" +msgstr "Sencas nur en iteracio „for‟, „while‟ aÅ­ „until‟" + +#: builtins/caller.def:134 +msgid "" +"Returns the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns " +msgstr "" +"Liveras la kuntekston de la kuranta procedurvoko.\n" +"\n" +" Sen ESPR liveras " + +#: builtins/cd.def:319 +msgid "HOME not set" +msgstr "HOME malhavas valoron" + +#: builtins/cd.def:327 builtins/common.c:166 test.c:876 +msgid "too many arguments" +msgstr "Tro multe da argumentoj" + +#: builtins/cd.def:338 +msgid "OLDPWD not set" +msgstr "OLDPWD malhavas valoron" + +#: builtins/common.c:101 +#, c-format +msgid "line %d: " +msgstr "linio %dª: " + +#: builtins/common.c:139 error.c:265 +#, c-format +msgid "warning: " +msgstr "Averto: " + +#: builtins/common.c:153 +#, c-format +msgid "%s: usage: " +msgstr "%s: Uzmaniero: " + +#: builtins/common.c:191 shell.c:506 shell.c:788 +#, c-format +msgid "%s: option requires an argument" +msgstr "%s: La opcio bezonas argumenton" + +#: builtins/common.c:198 +#, c-format +msgid "%s: numeric argument required" +msgstr "%s: Necesas nombra argumento" + +#: builtins/common.c:205 +#, c-format +msgid "%s: not found" +msgstr "%s: Ne trovita" + +#: builtins/common.c:214 shell.c:801 +#, c-format +msgid "%s: invalid option" +msgstr "%s: Misa opcio" + +#: builtins/common.c:221 +#, c-format +msgid "%s: invalid option name" +msgstr "%s: Misa opcinomo" + +#: builtins/common.c:228 general.c:235 general.c:240 +#, c-format +msgid "`%s': not a valid identifier" +msgstr "„%s‟ ne estas taÅ­ga nomo" + +#: builtins/common.c:238 +msgid "invalid octal number" +msgstr "Misa okuma nombro" + +#: builtins/common.c:240 +msgid "invalid hex number" +msgstr "Misa 16uma nombro" + +#: builtins/common.c:242 expr.c:1470 +msgid "invalid number" +msgstr "Misa nombro" + +#: builtins/common.c:250 +#, c-format +msgid "%s: invalid signal specification" +msgstr "%s: Misa signalindiko" + +#: builtins/common.c:257 +#, c-format +msgid "`%s': not a pid or valid job spec" +msgstr "„%s‟: Nek proceznumero, nek taÅ­ga laborindiko" + +#: builtins/common.c:264 error.c:488 +#, c-format +msgid "%s: readonly variable" +msgstr "%s: Nurlega variablo" + +#: builtins/common.c:272 +#, c-format +msgid "%s: %s out of range" +msgstr "%s: %s estas ekster sia variejo" + +#: builtins/common.c:272 builtins/common.c:274 +msgid "argument" +msgstr "argumento" + +#: builtins/common.c:274 +#, c-format +msgid "%s out of range" +msgstr "%s estas ekster sia variejo" + +#: builtins/common.c:282 +#, c-format +msgid "%s: no such job" +msgstr "%s: Ne estas tia laboro" + +#: builtins/common.c:290 +#, c-format +msgid "%s: no job control" +msgstr "%s: Ĉi tiu ŝelo ne disponigas laborregadon" + +#: builtins/common.c:292 +msgid "no job control" +msgstr "Laborregado ne disponeblas" + +#: builtins/common.c:302 +#, c-format +msgid "%s: restricted" +msgstr "%s: Limigita" + +#: builtins/common.c:304 +msgid "restricted" +msgstr "limigita" + +#: builtins/common.c:312 +#, c-format +msgid "%s: not a shell builtin" +msgstr "„%s‟ ne estas primitiva komando ŝela" + +#: builtins/common.c:321 +#, c-format +msgid "write error: %s" +msgstr "Eraro ĉe skribo: %s" + +#: builtins/common.c:329 +#, c-format +msgid "error setting terminal attributes: %s" +msgstr "Eraro ĉe agordado de terminalaj atributoj: %s" + +#: builtins/common.c:331 +#, c-format +msgid "error getting terminal attributes: %s" +msgstr "Eraro ĉe akiro de terminalaj atributoj: %s" + +#: builtins/common.c:563 +#, c-format +msgid "%s: error retrieving current directory: %s: %s\n" +msgstr "%s: Eraro ĉe provo determini la kurantan dosierujon: %s: %s\n" + +#: builtins/common.c:629 builtins/common.c:631 +#, c-format +msgid "%s: ambiguous job spec" +msgstr "%s: Ambigua laborindiko" + +#: builtins/complete.def:277 +#, c-format +msgid "%s: invalid action name" +msgstr "%s: Misa nomo de ago" + +#: builtins/complete.def:450 builtins/complete.def:645 +#: builtins/complete.def:855 +#, c-format +msgid "%s: no completion specification" +msgstr "%s: Kompletigo ne estas specifita" + +#: builtins/complete.def:697 +msgid "warning: -F option may not work as you expect" +msgstr "Averto: La opcio -F povas funkcii alie ol vi eble supozas" + +#: builtins/complete.def:699 +msgid "warning: -C option may not work as you expect" +msgstr "Averto: La opcio -C povas funkcii alie ol vi eble supozas" + +#: builtins/complete.def:828 +msgid "not currently executing completion function" +msgstr "Ni ne estas en plenumado de kompletiga funkcio" + +#: builtins/declare.def:126 +msgid "can only be used in a function" +msgstr "Uzeblas nur ene de funkcio" + +#: builtins/declare.def:315 builtins/declare.def:509 +#, c-format +msgid "%s: reference variable cannot be an array" +msgstr "%s: Referenca variablo ne povas esti tabelo" + +#: builtins/declare.def:324 +#, c-format +msgid "%s: nameref variable self references not allowed" +msgstr "%s: Nomreferenca variablo ne referencu sin mem" + +#: builtins/declare.def:398 +msgid "cannot use `-f' to make functions" +msgstr "„-f‟ ne estas uzebla por fari funkciojn" + +#: builtins/declare.def:410 execute_cmd.c:5361 +#, c-format +msgid "%s: readonly function" +msgstr "%s: Nurlega funkcio" + +#: builtins/declare.def:553 +#, c-format +msgid "%s: cannot destroy array variables in this way" +msgstr "%s: Ĉi tiel ne eblas neniigi tabelvariablojn" + +#: builtins/declare.def:560 builtins/read.def:733 +#, c-format +msgid "%s: cannot convert associative to indexed array" +msgstr "%s: Ne eblas konverti asocitabelon en entjerindican tabelon" + +#: builtins/enable.def:137 builtins/enable.def:145 +msgid "dynamic loading not available" +msgstr "Rultempa ŝargo ne disponeblas" + +#: builtins/enable.def:312 +#, c-format +msgid "cannot open shared object %s: %s" +msgstr "Ne malfermiĝis dinamika biblioteko %s: %s" + +#: builtins/enable.def:335 +#, c-format +msgid "cannot find %s in shared object %s: %s" +msgstr "Mankas %s en la dinamika biblioteko%s: %s" + +#: builtins/enable.def:459 +#, c-format +msgid "%s: not dynamically loaded" +msgstr "%s: Ne ŝargita dinamike" + +#: builtins/enable.def:474 +#, c-format +msgid "%s: cannot delete: %s" +msgstr "%s: Ne eblas forigi: %s" + +#: builtins/evalfile.c:140 builtins/hash.def:171 execute_cmd.c:5208 +#: shell.c:1481 +#, c-format +msgid "%s: is a directory" +msgstr "%s estas dosierujo" + +#: builtins/evalfile.c:146 +#, c-format +msgid "%s: not a regular file" +msgstr "%s: Ne ordinara dosiero" + +#: builtins/evalfile.c:155 +#, c-format +msgid "%s: file is too large" +msgstr "%s: Tro granda dosiero" + +#: builtins/evalfile.c:190 builtins/evalfile.c:208 shell.c:1491 +#, c-format +msgid "%s: cannot execute binary file" +msgstr "%s: Neplenumebla duuma dosiero" + +#: builtins/exec.def:154 builtins/exec.def:156 builtins/exec.def:228 +#, c-format +msgid "%s: cannot execute: %s" +msgstr "%s: Maleblas plenumi: %s" + +#: builtins/exit.def:65 +#, c-format +msgid "logout\n" +msgstr "adiaÅ­\n" + +#: builtins/exit.def:88 +msgid "not login shell: use `exit'" +msgstr "La ŝelo ne estas saluta; eliru per «exit»" + +#: builtins/exit.def:120 +#, c-format +msgid "There are stopped jobs.\n" +msgstr "Restas haltigitaj laboroj.\n" + +#: builtins/exit.def:122 +#, c-format +msgid "There are running jobs.\n" +msgstr "Restas rulataj laboroj.\n" + +#: builtins/fc.def:262 +msgid "no command found" +msgstr "Komando ne trovita" + +#: builtins/fc.def:320 builtins/fc.def:369 +msgid "history specification" +msgstr "Historia indiko" + +#: builtins/fc.def:390 +#, c-format +msgid "%s: cannot open temp file: %s" +msgstr "%s: Ne malfermiĝis labordosiero: %s" + +#: builtins/fg_bg.def:149 builtins/jobs.def:282 +msgid "current" +msgstr "kuranta" + +#: builtins/fg_bg.def:158 +#, c-format +msgid "job %d started without job control" +msgstr "La laboro %d estas lanĉita sen laborregado" + +#: builtins/getopt.c:110 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: Misa opcio -- %c\n" + +#: builtins/getopt.c:111 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: La opcio bezonas argumenton -- %c\n" + +#: builtins/hash.def:92 +msgid "hashing disabled" +msgstr "Nomkonservado (haketado, «hashing») estas malŝaltita" + +#: builtins/hash.def:138 +#, c-format +msgid "%s: hash table empty\n" +msgstr "%s: Hakettabelo estas malplena\n" + +#: builtins/hash.def:245 +#, c-format +msgid "hits\tcommand\n" +msgstr "Trafoj\tKomando\n" + +# ZZZ: aĉaj citiloj (fermita en la programo) +#: builtins/help.def:130 +#, c-format +msgid "Shell commands matching keyword `" +msgid_plural "Shell commands matching keywords `" +msgstr[0] "Ŝelaj komandoj kongruaj kun la ŝlosilvorto '" +msgstr[1] "Ŝelaj komandoj kongruaj kun la ŝlosilvortoj '" + +#: builtins/help.def:182 +#, c-format +msgid "" +"no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." +msgstr "" +"Helpaĵo pri „%s‟ malestas.\n" +"Provu «help help» aÅ­ «man -k %s» aÅ­ «info %s»." + +#: builtins/help.def:199 +#, c-format +msgid "%s: cannot open: %s" +msgstr "%s: Fiaskis malfermo de %s" + +#: builtins/help.def:485 +#, c-format +msgid "" +"These shell commands are defined internally. Type `help' to see this list.\n" +"Type `help name' to find out more about the function `name'.\n" +"Use `info bash' to find out more about the shell in general.\n" +"Use `man -k' or `info' to find out more about commands not in this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" +msgstr "" +"Jenaj komandoj estas enkonstruitaj. Tajpu „help‟ por eligi la liston.\n" +"Tajpu «help NOMO» por informoj pri la funkcio NOMO.\n" +"Uzu «info bash» por la ĝenerala informo pri la ŝelo.\n" +"Uzu «man -k» aÅ­ «info» por informo pri komandoj ĉi tie ne listigitaj.\n" +"\n" +"Steleto (*) tuj post nomo indikas, ke la komando estas malebligita.\n" +"\n" + +#: builtins/history.def:154 +msgid "cannot use more than one of -anrw" +msgstr "Ne pli ol unu el -anrw estas uzebla" + +#: builtins/history.def:186 +msgid "history position" +msgstr "pozicio en la historio" + +#: builtins/history.def:366 +#, c-format +msgid "%s: history expansion failed" +msgstr "%s: Historia malvolvo fiaskis" + +#: builtins/inlib.def:71 +#, c-format +msgid "%s: inlib failed" +msgstr "%s: inlib fiaskis" + +#: builtins/jobs.def:109 +msgid "no other options allowed with `-x'" +msgstr "La uzo de „-x‟ malebligas aliajn opciojn" + +#: builtins/kill.def:200 +#, c-format +msgid "%s: arguments must be process or job IDs" +msgstr "%s: Argumento estu proceznumero aÅ­ laborindiko" + +#: builtins/kill.def:263 +msgid "Unknown error" +msgstr "Nekonata eraro" + +#: builtins/let.def:95 builtins/let.def:120 expr.c:583 expr.c:598 +msgid "expression expected" +msgstr "Mankas esprimo" + +#: builtins/mapfile.def:172 +#, c-format +msgid "%s: not an indexed array" +msgstr "%s: ĝi ne estas entjerindica tabelo" + +#: builtins/mapfile.def:259 builtins/read.def:302 +#, c-format +msgid "%s: invalid file descriptor specification" +msgstr "%s: Misa indiko de dosiernumero" + +#: builtins/mapfile.def:267 builtins/read.def:309 +#, c-format +msgid "%d: invalid file descriptor: %s" +msgstr "%d: Misa dosiernumero: %s" + +#: builtins/mapfile.def:276 builtins/mapfile.def:314 +#, c-format +msgid "%s: invalid line count" +msgstr "%s: Misa lininombro" + +#: builtins/mapfile.def:287 +#, c-format +msgid "%s: invalid array origin" +msgstr "%s: Misa tabelbazo" + +# Supozeble callback => retrovoko ?? +#: builtins/mapfile.def:304 +#, c-format +msgid "%s: invalid callback quantum" +msgstr "%s: Misa kvanto ĉe retrovoko" + +#: builtins/mapfile.def:336 +msgid "empty array variable name" +msgstr "Mankas nomo de tabelvariablo" + +#: builtins/mapfile.def:357 +msgid "array variable support required" +msgstr "necesas subteno de tabelvariabloj" + +#: builtins/printf.def:402 +#, c-format +msgid "`%s': missing format character" +msgstr "„%s‟: Mankas formata signo" + +#: builtins/printf.def:456 +#, c-format +msgid "`%c': invalid time format specification" +msgstr "%c: Misa tempoformato" + +#: builtins/printf.def:658 +#, c-format +msgid "`%c': invalid format character" +msgstr "„%c‟: Misa signo formata" + +#: builtins/printf.def:684 +#, c-format +msgid "warning: %s: %s" +msgstr "Averto: %s: %s" + +# XXX: internal_error +#: builtins/printf.def:768 +#, c-format +msgid "format parsing problem: %s" +msgstr "Miso ĉe analizado de formato: %s" + +#: builtins/printf.def:865 +msgid "missing hex digit for \\x" +msgstr "Mankas 16uma cifero por \\x" + +#: builtins/printf.def:880 +#, c-format +msgid "missing unicode digit for \\%c" +msgstr "Post „%c‟ mankas unikoda cifero" + +#: builtins/pushd.def:195 +msgid "no other directory" +msgstr "Ne estas alia dosierujo" + +#: builtins/pushd.def:354 +#, c-format +msgid "%s: invalid argument" +msgstr "%s: MaltaÅ­ga argumento" + +#: builtins/pushd.def:468 +msgid "" +msgstr "" + +#: builtins/pushd.def:512 +msgid "directory stack empty" +msgstr "Dosierujstako malplenas" + +#: builtins/pushd.def:514 +msgid "directory stack index" +msgstr "indico de dosierujstako" + +# dirs [-clpv] [+N] [-N] +#: builtins/pushd.def:689 +msgid "" +"Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +"\tdirs when invoked without options, starting with zero." +msgstr "" +"Listigu la kurantan dosierujstakon. La dosierujoj trafas en\n" +" la stakon per la komando „pushd‟ kaj estas forigeblaj per la\n" +" komando „popd‟.\n" +"\n" +" Opcioj:\n" +" -c\tforviŝu la dosierujstakon (forigu ĉiujn erojn)\n" +" -l\tne uzu tildon en la dosierujnomoj bazitaj relative\n" +" \tal via hejma dosierujo\n" +" -p\teligu dosierujstakon lokante po unu eron sur linio\n" +" -v\teligu dosierujstakon lokante po unu eron sur linio,\n" +"\tprefiksante la dosierujnomon per ĝia numero en la stako\n" +"\n" +" Argumentoj:\n" +" +N\teligu la Nan eron nombrante de maldekstre en la listo eligebla\n" +"\tper „dirs‟ sen opcioj, numerante ekde 0.\n" +"\n" +" -N\teligu la Nan eron nombrante de dekstre en la listo eligebla\n" +"\tper „dirs‟ sen opcioj, numerante ekde 0." + +# pushd [dir | +N | -N] [-n] +#: builtins/pushd.def:711 +msgid "" +"Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Surstakigu dosierujon sur la stakon da dosierujoj, aÅ­ cikle ŝovu\n" +" la stakon tiel, ke la nova stakpinto iĝu la kuranta dosierujo.\n" +" Senargumente, permutu la du plej suprajn dosierujojn de la stako.\n" +"\n" +" Opcioj:\n" +" -n\tNe ŝanĝu la kurantan dosierujon surstakigante dosierujon sur\n" +" \tla stakon; do, nur la stakon ŝanĝu.\n" +"\n" +" +N\tCikle ŝovu la stakon tiel ke la Nª dosierujo (nombrante de\n" +" \tmaldekstre en la listo eligebla per „dirs‟, numerante de 0)\n" +" iĝu la pinta.\n" +"\n" +" -N\tCikle ŝovu la stakon tiel ke la Nª dosierujo (nombrante de\n" +" \tdekstre en la listo eligebla per „dirs‟, numerante de 0) iĝu\n" +" la pinta.\n" +"\n" +" dir\tsurstakigu la dosierujon dir kaj faru ĝin la nova kuranta\n" +" \tdosierujo labora.\n" +"\n" +" Vi povas vidigi la stakon da dosierujoj per la komando „dirs‟." + +# popd [+N | -N] [-n] +#: builtins/pushd.def:736 +msgid "" +"Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Elstakigu erojn el la stako de dosierujoj. Senargumente, forigu la\n" +" pintan dosierujon kaj iru (cd) en la novan pintan dosierujon.\n" +"\n" +"\n" +" Opcioj:\n" +" -n\tNe ŝanĝu la kurantan dosierujon demetante dosierujon el la\n" +"\tstako; do, nur la stakon ŝanĝu.\n" +"\n" +" Argumentoj:\n" +" +N\tforigu la Nan eron de maldekstre de la listo eligebla per\n" +"\t„dirs‟, numerante ekde 0. Ekz-e: «popd +0» forigas la plej\n" +"\tmaldekstran dosierujon; «popd +1», ĝian najbaron.\n" +"\n" +" -N\tforigu la Nan eron de dekstre de la listo eligebla per „dirs‟,\n" +"\tnumerante ekde 0. Ekz-e: «popd -0» forigas la lastan\n" +"\tdosierujon; «popd -1», la antaÅ­lastan.\n" +"\n" +" Vi povas vidigi la stakon da dosierujoj per la komando „dirs‟." + +#: builtins/read.def:275 +#, c-format +msgid "%s: invalid timeout specification" +msgstr "%s: Misa indiko de atendotempo" + +#: builtins/read.def:678 +#, c-format +msgid "read error: %d: %s" +msgstr "Lega (read) eraro: %d: %s" + +#: builtins/return.def:75 +msgid "can only `return' from a function or sourced script" +msgstr "" +"„return‟ sencas nur en funkcio aÅ­ punkte vokita („.‟, „source‟) skripto" + +#: builtins/set.def:782 +msgid "cannot simultaneously unset a function and a variable" +msgstr "Ne eblas samtempe malaktivigi funkcion kaj variablon" + +#: builtins/set.def:826 +#, c-format +msgid "%s: cannot unset" +msgstr "%s: Malaktivigo fiaskis" + +#: builtins/set.def:843 +#, c-format +msgid "%s: cannot unset: readonly %s" +msgstr "%s: Malaktivigo fiaskis: nurlega %s" + +#: builtins/set.def:854 +#, c-format +msgid "%s: not an array variable" +msgstr "%s: Ne tabela variablo" + +#: builtins/setattr.def:187 +#, c-format +msgid "%s: not a function" +msgstr "%s: Ne funkcio" + +#: builtins/shift.def:71 builtins/shift.def:77 +msgid "shift count" +msgstr "Nombrilo de „shift‟" + +#: builtins/shopt.def:279 +msgid "cannot set and unset shell options simultaneously" +msgstr "Maleblas samtempe ŝalti kaj malŝalti ŝelan opcion" + +#: builtins/shopt.def:346 +#, c-format +msgid "%s: invalid shell option name" +msgstr "%s: Misa nomo de ŝela opcio" + +#: builtins/source.def:130 +msgid "filename argument required" +msgstr "Necesas dosiernoma argumento" + +#: builtins/source.def:155 +#, c-format +msgid "%s: file not found" +msgstr "%s: Dosiero ne trovita" + +#: builtins/suspend.def:101 +msgid "cannot suspend" +msgstr "Ne eblas halteti" + +#: builtins/suspend.def:111 +msgid "cannot suspend a login shell" +msgstr "Ne eblas haltetigi salutan ŝelon" + +#: builtins/type.def:234 +#, c-format +msgid "%s is aliased to `%s'\n" +msgstr "„%s‟ alinomas jenon: «%s»\n" + +#: builtins/type.def:255 +#, c-format +msgid "%s is a shell keyword\n" +msgstr "„%s‟ estas ŝlosilvorto de la ŝelo\n" + +#: builtins/type.def:274 +#, c-format +msgid "%s is a function\n" +msgstr "%s estas funkcio\n" + +#: builtins/type.def:296 +#, c-format +msgid "%s is a shell builtin\n" +msgstr "„%s‟ estas primitiva komando de la ŝelo\n" + +#: builtins/type.def:317 builtins/type.def:393 +#, c-format +msgid "%s is %s\n" +msgstr "„%s‟ estas „%s‟\n" + +#: builtins/type.def:337 +#, c-format +msgid "%s is hashed (%s)\n" +msgstr "„%s‟ estas metita en hakettabelon (%s)\n" + +#: builtins/ulimit.def:383 +#, c-format +msgid "%s: invalid limit argument" +msgstr "%s: MaltaÅ­ga argumento por limo" + +#: builtins/ulimit.def:409 +#, c-format +msgid "`%c': bad command" +msgstr "„%c‟: Misa komando" + +#: builtins/ulimit.def:438 +#, c-format +msgid "%s: cannot get limit: %s" +msgstr "%s: Fiaskis provo legi limon: %s" + +#: builtins/ulimit.def:464 +msgid "limit" +msgstr "limo" + +#: builtins/ulimit.def:476 builtins/ulimit.def:776 +#, c-format +msgid "%s: cannot modify limit: %s" +msgstr "%s: Malprosperis ŝanĝi limon: %s" + +#: builtins/umask.def:114 +msgid "octal number" +msgstr "Okuma nombro" + +# Misa modifilo: «umask Z-w» aÅ­ «umask aZw» +#: builtins/umask.def:227 +#, c-format +msgid "`%c': invalid symbolic mode operator" +msgstr "„%c‟: MaltaÅ­ga simbolo por atingorajta modifilo" + +# Misa kategorio: ne [rw] ktp +#: builtins/umask.def:282 +#, c-format +msgid "`%c': invalid symbolic mode character" +msgstr "„%c‟: La signo ne estas simbolo de atingorajta kategorio" + +#: error.c:90 error.c:325 error.c:327 error.c:329 +msgid " line " +msgstr " linio " + +#: error.c:165 +#, c-format +msgid "last command: %s\n" +msgstr "La ĵusa komando: %s\n" + +#: error.c:173 +#, c-format +msgid "Aborting..." +msgstr "Ĉesigado ..." + +#: error.c:440 +msgid "unknown command error" +msgstr "Nekonata komand-eraro" + +#: error.c:441 +msgid "bad command type" +msgstr "Misa komandotipo" + +#: error.c:442 +msgid "bad connector" +msgstr "Misa stir-operacio" + +#: error.c:443 +msgid "bad jump" +msgstr "Misa salto" + +#: error.c:481 +#, c-format +msgid "%s: unbound variable" +msgstr "%s: Neligita variablo" + +#: eval.c:189 +#, c-format +msgid "\atimed out waiting for input: auto-logout\n" +msgstr "\aTro longe sen enigo: AÅ­tomata seancofino\n" + +# XXX: internal error: +#: execute_cmd.c:512 +#, c-format +msgid "cannot redirect standard input from /dev/null: %s" +msgstr "Fiaskis provo nomumi la disponaĵon «/dev/null» ĉefenigujo: %s" + +# XXX: internal error: +#: execute_cmd.c:1233 +#, c-format +msgid "TIMEFORMAT: `%c': invalid format character" +msgstr "TIMEFORMAT: „%c‟: Misa formatsigno" + +#: execute_cmd.c:2287 +msgid "pipe error" +msgstr "Eraro en dukto" + +#: execute_cmd.c:4386 +#, c-format +msgid "%s: maximum function nesting level exceeded (%d)" +msgstr "%s: La ingado de funkcioj superis sian maksimumon (%d)" + +#: execute_cmd.c:4884 +#, c-format +msgid "%s: restricted: cannot specify `/' in command names" +msgstr "%s: Malpermesitas uzi „/‟ en komandonomoj" + +#: execute_cmd.c:4973 +#, c-format +msgid "%s: command not found" +msgstr "%s: Komando ne trovita" + +# XXX: internal error: +#: execute_cmd.c:5206 +#, c-format +msgid "%s: %s" +msgstr "%s: %s" + +#: execute_cmd.c:5243 +#, c-format +msgid "%s: %s: bad interpreter" +msgstr "%s: %s: Misa interpretilo" + +#: execute_cmd.c:5280 +#, c-format +msgid "%s: cannot execute binary file: %s" +msgstr "%s: Neplenumebla duuma dosiero: %s" + +#: execute_cmd.c:5352 +#, c-format +msgid "`%s': is a special builtin" +msgstr "„%s‟ estas primitiva komando speciala" + +#: execute_cmd.c:5404 +#, c-format +msgid "cannot duplicate fd %d to fd %d" +msgstr "Ne eblas kunnomumi al dosiernumero %d la dosiernumeron %d" + +#: expr.c:259 +msgid "expression recursion level exceeded" +msgstr "Tro profunda rekursio en esprimo" + +#: expr.c:283 +msgid "recursion stack underflow" +msgstr "Rekursistako elĉerpita" + +#: expr.c:431 +msgid "syntax error in expression" +msgstr "Sintaksa eraro en esprimo" + +#: expr.c:475 +msgid "attempted assignment to non-variable" +msgstr "Provo valorizi ne-variablon" + +#: expr.c:495 expr.c:858 +msgid "division by 0" +msgstr "Divido per 0" + +#: expr.c:542 +msgid "bug: bad expassign token" +msgstr "CIMO: Misa operacisigno en kombinita valorizsimbolo" + +#: expr.c:595 +msgid "`:' expected for conditional expression" +msgstr "„:‟ mankas kondiĉa esprimo" + +#: expr.c:919 +msgid "exponent less than 0" +msgstr "Negativa eksponento" + +#: expr.c:976 +msgid "identifier expected after pre-increment or pre-decrement" +msgstr "Post antaÅ­kremento aperu nomo de variablo" + +#: expr.c:1002 +msgid "missing `)'" +msgstr "Mankas „)‟" + +#: expr.c:1053 expr.c:1390 +msgid "syntax error: operand expected" +msgstr "Sintaksa eraro: Mankas operando" + +#: expr.c:1392 +msgid "syntax error: invalid arithmetic operator" +msgstr "Sintaksa eraro: Misa operacisimbolo aritmetika" + +#: expr.c:1416 +#, c-format +msgid "%s%s%s: %s (error token is \"%s\")" +msgstr "%s%s%s: %s (misa simbolo estas „%s‟)" + +#: expr.c:1474 +msgid "invalid arithmetic base" +msgstr "MaltaÅ­ga bazo nombrosistema" + +#: expr.c:1494 +msgid "value too great for base" +msgstr "Tro granda valoro por bazo de nombrosistemo" + +#: expr.c:1543 +#, c-format +msgid "%s: expression error\n" +msgstr "%s: Misa esprimo\n" + +#: general.c:62 +msgid "getcwd: cannot access parent directories" +msgstr "getwd: Ne eblas atingi patrajn dosierujojn" + +#: input.c:102 subst.c:5168 +#, c-format +msgid "cannot reset nodelay mode for fd %d" +msgstr "Ne eblas reŝalti senprokrastan reĝimon por dosiernumero %d" + +#: input.c:271 +#, c-format +msgid "cannot allocate new file descriptor for bash input from fd %d" +msgstr "Maleblas disponigi novan dosiernumeron por Baŝa enigo el n-ro %d" + +#: input.c:279 +#, c-format +msgid "save_bash_input: buffer already exists for new fd %d" +msgstr "save_bash_input: La nova dosiernumero (fd %d) jam havas bufron" + +# ZZZ: sys_error (_("start_pipeline: pgrp pipe")); +#: jobs.c:471 +msgid "start_pipeline: pgrp pipe" +msgstr "start_pipeline: procezgrupo dukto" + +#: jobs.c:893 +#, c-format +msgid "forked pid %d appears in running job %d" +msgstr "Forke farita proceznumero %d aperas en rulata laboro %d" + +#: jobs.c:1012 +#, c-format +msgid "deleting stopped job %d with process group %ld" +msgstr "Haltigita laboro %d kun procezgrupo %ld estas forigata" + +# ifdef DEBUG ... internal_warning(): +#: jobs.c:1117 +#, c-format +msgid "add_process: process %5ld (%s) in the_pipeline" +msgstr "add_process: process %5ld (%s) in the_pipeline" + +# ifdef DEBUG ... internal_warning(): +#: jobs.c:1120 +#, c-format +msgid "add_process: pid %5ld (%s) marked as still alive" +msgstr "add_process: pid %5ld (%s) marked as still alive" + +#: jobs.c:1435 +#, c-format +msgid "describe_pid: %ld: no such pid" +msgstr "describe_pid: Ne estas tia proceznumero (%ld)!" + +#: jobs.c:1450 +#, c-format +msgid "Signal %d" +msgstr "Signalo %d" + +#: jobs.c:1464 jobs.c:1489 +msgid "Done" +msgstr "Farite" + +#: jobs.c:1469 siglist.c:123 +msgid "Stopped" +msgstr "Haltigita" + +#: jobs.c:1473 +#, c-format +msgid "Stopped(%s)" +msgstr "Haltigita(%s)" + +#: jobs.c:1477 +msgid "Running" +msgstr "Rulata" + +#: jobs.c:1491 +#, c-format +msgid "Done(%d)" +msgstr "Farite(%d)" + +#: jobs.c:1493 +#, c-format +msgid "Exit %d" +msgstr "Eliro %d" + +#: jobs.c:1496 +msgid "Unknown status" +msgstr "Nekonata stato" + +#: jobs.c:1583 +#, c-format +msgid "(core dumped) " +msgstr "(nekropsio elŝutita)" + +#: jobs.c:1602 +#, c-format +msgid " (wd: %s)" +msgstr " (labordosierujo: %s)" + +#: jobs.c:1819 +#, c-format +msgid "child setpgid (%ld to %ld)" +msgstr "provo atribui (setpgid) procezgrupon %2$ld de la procezido %1$ld" + +#: jobs.c:2138 nojobs.c:605 +#, c-format +msgid "wait: pid %ld is not a child of this shell" +msgstr "wait: La procezo %ld ne estas ido de ĉi tiu ŝelo" + +#: jobs.c:2385 +#, c-format +msgid "wait_for: No record of process %ld" +msgstr "wait_for: Malestas informoj pri procezo %ld" + +#: jobs.c:2694 +#, c-format +msgid "wait_for_job: job %d is stopped" +msgstr "wait_for_job: La laboro %d estas haltigita" + +#: jobs.c:2986 +#, c-format +msgid "%s: job has terminated" +msgstr "%s: La laboro finiĝis" + +#: jobs.c:2995 +#, c-format +msgid "%s: job %d already in background" +msgstr "%s: La laboro %d jam estas fona" + +# XXX: internal warning: +#: jobs.c:3220 +msgid "waitchld: turning on WNOHANG to avoid indefinite block" +msgstr "waitchld: WNOHANG iĝas ŝaltita por eviti nedifintan pendiĝon" + +#: jobs.c:3711 +#, c-format +msgid "%s: line %d: " +msgstr "%s: linio %dª: " + +#: jobs.c:3725 nojobs.c:843 +#, c-format +msgid " (core dumped)" +msgstr "(nekropsio elŝutita)" + +#: jobs.c:3737 jobs.c:3750 +#, c-format +msgid "(wd now: %s)\n" +msgstr "(nun labordosierujo estas: %s)\n" + +#: jobs.c:3782 +msgid "initialize_job_control: getpgrp failed" +msgstr "initialize_job_control: getpgrp fiaskis" + +#: jobs.c:3843 +msgid "initialize_job_control: line discipline" +msgstr "initialize_job_control: liniaranĝo" + +#: jobs.c:3853 +msgid "initialize_job_control: setpgid" +msgstr "initialize_job_control: setpgid()" + +#: jobs.c:3874 jobs.c:3883 +#, c-format +msgid "cannot set terminal process group (%d)" +msgstr "ne prosperis atribui grupon (%d) de terminala procezo" + +#: jobs.c:3888 +msgid "no job control in this shell" +msgstr "Ĉi tiu ŝelo ne disponigas laborregadon" + +#: lib/malloc/malloc.c:296 +#, c-format +msgid "malloc: failed assertion: %s\n" +msgstr "malloc: Malveras la aserto: %s\n" + +# XXX: debug? +#: lib/malloc/malloc.c:312 +#, c-format +msgid "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" +msgstr "" +"\r\n" +"malloc: %s:%d: aserto sufokita\r\n" + +# XXX: internal error +#: lib/malloc/malloc.c:313 +msgid "unknown" +msgstr "nekonata" + +# XXX: debug? +#: lib/malloc/malloc.c:801 +msgid "malloc: block on free list clobbered" +msgstr "malloc: Skribdifektita bloko en malokupa listo (free list)" + +# XXX: debug? +#: lib/malloc/malloc.c:878 +msgid "free: called with already freed block argument" +msgstr "free: La argumento montras blokon jam malokupitan" + +# XXX: debug? +#: lib/malloc/malloc.c:881 +msgid "free: called with unallocated block argument" +msgstr "free: La argumento ne montras generitan memoron" + +# XXX: debug? +#: lib/malloc/malloc.c:900 +msgid "free: underflow detected; mh_nbytes out of range" +msgstr "free: Okazis maltroo; mh_nbytes estas ekster sia variejo" + +# XXX: debug? +#: lib/malloc/malloc.c:906 +msgid "free: start and end chunk sizes differ" +msgstr "free: La ĉapa kaj vosta longoj de memorpeco ne estas egalaj" + +# XXX: debug? +#: lib/malloc/malloc.c:1005 +msgid "realloc: called with unallocated block argument" +msgstr "realloc: La argumento ne montras generitan memoron" + +# XXX: debug? +#: lib/malloc/malloc.c:1020 +msgid "realloc: underflow detected; mh_nbytes out of range" +msgstr "realloc: Okazis maltroo; mh_nbytes estas ekster sia variejo" + +# XXX: debug? +#: lib/malloc/malloc.c:1026 +msgid "realloc: start and end chunk sizes differ" +msgstr "realloc: La ĉapa kaj vosta longoj de memorpeco ne estas egalaj" + +# XXX: debug? +#: lib/malloc/table.c:194 +#, c-format +msgid "register_alloc: alloc table is full with FIND_ALLOC?\n" +msgstr "register_alloc: „alloc‟-tabelo elĉerpiĝis je FIND_ALLOC?\n" + +# XXX: debug? +#: lib/malloc/table.c:203 +#, c-format +msgid "register_alloc: %p already in table as allocated?\n" +msgstr "register_alloc: %p jam en la tabelo kvazaÅ­ kreita (?)\n" + +# XXX: debug? +#: lib/malloc/table.c:256 +#, c-format +msgid "register_free: %p already in table as free?\n" +msgstr "register_free: %p jam en la tabelo kvazaÅ­ malokupita (?)\n" + +#: lib/sh/fmtulong.c:102 +msgid "invalid base" +msgstr "Misa bazo nombrosistema" + +# XXX: internal error +#: lib/sh/netopen.c:168 +#, c-format +msgid "%s: host unknown" +msgstr "%s: Nekonata retnodo" + +# XXX: internal error +#: lib/sh/netopen.c:175 +#, c-format +msgid "%s: invalid service" +msgstr "%s: Misa servo-indiko" + +# XXX: internal error +#: lib/sh/netopen.c:306 +#, c-format +msgid "%s: bad network path specification" +msgstr "%s: Misa retvojo-indiko" + +# XXX: internal error +#: lib/sh/netopen.c:346 +msgid "network operations not supported" +msgstr "Reta funkciado ne disponeblas" + +# XXX: internal warning: +#: locale.c:200 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s)" +msgstr "setlocale: LC_ALL: Maleblas ŝanĝi lokaĵaron (%s)" + +# XXX: internal warning: +#: locale.c:202 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s): %s" +msgstr "setlocale: LC_ALL: Maleblas ŝanĝi lokaĵaron (%s): %s" + +# XXX: fatal_error +#: locale.c:259 +#, c-format +msgid "setlocale: %s: cannot change locale (%s)" +msgstr "setlocale: %s: ne eblas ŝanĝi la lokaĵaron (%s)" + +# XXX: fatal_error +#: locale.c:261 +#, c-format +msgid "setlocale: %s: cannot change locale (%s): %s" +msgstr "setlocale: %s: ne eblas ŝanĝi la lokaĵaron (%s): %s" + +#: mailcheck.c:439 +msgid "You have mail in $_" +msgstr "Vi havas poŝton en $_" + +#: mailcheck.c:464 +msgid "You have new mail in $_" +msgstr "Nova poŝto en $_" + +#: mailcheck.c:480 +#, c-format +msgid "The mail in %s has been read\n" +msgstr "La poŝto en %s estas jam legita\n" + +#: make_cmd.c:323 +msgid "syntax error: arithmetic expression required" +msgstr "Sintaksa eraro: Necesas aritmetika esprimo" + +#: make_cmd.c:325 +msgid "syntax error: `;' unexpected" +msgstr "Sintaksa eraro: Neatendita „;‟" + +#: make_cmd.c:326 +#, c-format +msgid "syntax error: `((%s))'" +msgstr "Sintaksa eraro: „((%s))‟" + +#: make_cmd.c:578 +#, c-format +msgid "make_here_document: bad instruction type %d" +msgstr "make_here_document: Misa ordontipo %d" + +# internal_warning(): +#: make_cmd.c:662 +#, c-format +msgid "here-document at line %d delimited by end-of-file (wanted `%s')" +msgstr "Tuj-dokumenton de linio %d limigas dosierfino (mankas „%s‟)" + +# XXX: programming_error +#: make_cmd.c:759 +#, c-format +msgid "make_redirection: redirection instruction `%d' out of range" +msgstr "make_redirection: Alidirektada komando „%d‟ ekster sia variejo" + +#: parse.y:3278 parse.y:3561 +#, c-format +msgid "unexpected EOF while looking for matching `%c'" +msgstr "Neatendita dosierfino dum serĉo de responda „%c‟" + +#: parse.y:4170 +msgid "unexpected EOF while looking for `]]'" +msgstr "Neatendita dosierfino dum serĉo de „]]‟" + +#: parse.y:4175 +#, c-format +msgid "syntax error in conditional expression: unexpected token `%s'" +msgstr "Sintaksa eraro en kondiĉa esprimo: Neatendita simbolo „%s‟" + +#: parse.y:4179 +msgid "syntax error in conditional expression" +msgstr "Sintaksa eraro en kondiĉa esprimo" + +#: parse.y:4257 +#, c-format +msgid "unexpected token `%s', expected `)'" +msgstr "Nekonvena simbolo „%s‟ anstataÅ­ „)‟" + +#: parse.y:4261 +msgid "expected `)'" +msgstr "Mankas „)‟" + +#: parse.y:4289 +#, c-format +msgid "unexpected argument `%s' to conditional unary operator" +msgstr "La argumento „%s‟ ne konvenas por unuloka kondiĉa operacisimbolo" + +#: parse.y:4293 +msgid "unexpected argument to conditional unary operator" +msgstr "MaltaÅ­ga argumento por unuloka kondiĉa operacisimbolo" + +#: parse.y:4339 +#, c-format +msgid "unexpected token `%s', conditional binary operator expected" +msgstr "Misa simbolo „%s‟ anstataÅ­ duloka kondiĉa operacisigno" + +#: parse.y:4343 +msgid "conditional binary operator expected" +msgstr "ĉi tie devas esti duloka kondiĉa operacisigno" + +#: parse.y:4365 +#, c-format +msgid "unexpected argument `%s' to conditional binary operator" +msgstr "La argumento „%s‟ ne konvenas por duloka kondiĉa operacisimbolo" + +#: parse.y:4369 +msgid "unexpected argument to conditional binary operator" +msgstr " +# caller [ESPRIMO] +#: builtins.c:367 +msgid "" +"Return the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns \"$line $filename\". With EXPR, returns\n" +" \"$line $subroutine $filename\"; this extra information can be used to\n" +" provide a stack trace.\n" +" \n" +" The value of EXPR indicates how many call frames to go back before the\n" +" current one; the top frame is frame 0.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless the shell is not executing a shell function or EXPR\n" +" is invalid." +msgstr "" +"Liveru la kuntekston de la kuranta procedurvoko\n" +"\n" +" Se ESPRIMO malestas, liveru «$line $filename». Se ESPRIMO\n" +" ĉeestas, liveru «$line $subroutine $filename»; ĉi tiu krominformo\n" +" uzeblas por vidigi la vok-stakon.\n" +"\n" +" La valoro de ESPRIMO indikas, kiom da vokkadroj retroiri disde la\n" +" kuranta; la pinta kadro havas la numeron 0.\n" +"\n" +" Elirstato:\n" +" Ĝi estas 0, kondiĉe ke la ŝelo plenumas ŝelfunkcion kaj la ESPRIMO\n" +" estas valida." + +# cd: +#: builtins.c:385 +msgid "" +"Change the shell working directory.\n" +" \n" +" Change the current directory to DIR. The default DIR is the value of " +"the\n" +" HOME shell variable.\n" +" \n" +" The variable CDPATH defines the search path for the directory " +"containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon " +"(:).\n" +" A null directory name is the same as the current directory. If DIR " +"begins\n" +" with a slash (/), then CDPATH is not used.\n" +" \n" +" If the directory is not found, and the shell option `cdable_vars' is " +"set,\n" +" the word is assumed to be a variable name. If that variable has a " +"value,\n" +" its value is used for DIR.\n" +" \n" +" Options:\n" +" -L\tforce symbolic links to be followed: resolve symbolic links in\n" +" \tDIR after processing instances of `..'\n" +" -P\tuse the physical directory structure without following symbolic\n" +" \tlinks: resolve symbolic links in DIR before processing instances\n" +" \tof `..'\n" +" -e\tif the -P option is supplied, and the current working directory\n" +" \tcannot be determined successfully, exit with a non-zero status\n" +" -@ on systems that support it, present a file with extended " +"attributes\n" +" as a directory containing the file attributes\n" +" \n" +" The default is to follow symbolic links, as if `-L' were specified.\n" +" `..' is processed by removing the immediately previous pathname " +"component\n" +" back to a slash or the beginning of DIR.\n" +" \n" +" Exit Status:\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully " +"when\n" +" -P is used; non-zero otherwise." +msgstr "" +"Ŝanĝu la kurantan laboran dosierujon de la ŝelo.\n" +"\n" +" La kuranta dosierujo iĝu DOSIERUJO -- aÅ­, se DOSIERUJO malestas,\n" +" la valoro de la variablo $HOME.\n" +"\n" +" La variablo $CDPATH difinas la serĉvojon por la dosierujo\n" +" entenanta DOSIERUJOn. En $CDPATH, dupunkto „:‟ apartigas\n" +" alternativajn dosierujojn, vakua dosierujnomo egalas la kurantan.\n" +" Se DOSIERUJO komenciĝas per „/‟, la variablo $CDPATH ne estas uzata.\n" +"\n" +" Se la dosierujo ne troviĝas, kaj la ŝela opcio „cdable_vars‟ estas\n" +" ŝaltita, la vorto estas interpretata kiel variablonomo. Se tiu\n" +" variablo havas valoron, tiu valoro estas uzata kiel DOSIERUJO.\n" +"\n" +" Opcioj:\n" +" -L\tlaÅ­u simbolajn Ligilojn: en DOSIERUJO, traktu la aperojn de\n" +"\t„..“ antaÅ­ ol elnodigi la simbolajn ligilojn\n" +" -P\tuzu la Fizikan strukturon de dosierujoj, elnodiginte simbolajn\n" +"\tligilojn de DOSIERUJO antaÅ­ ol trakti la aperojn de „..“\n" +" -e\teliru kun nenula elirstato se „-P‟ ĉeestas kaj la\n" +"\tkuranta dosierujo ne estas determinebla\n" +" -@\tse la operaciumo tion ebligas, prezentu dosieron posedantan\n" +"\tkromatributojn kiel dosierujon entenatan la dosieratributojn\n" +"\n" +" DefaÅ­lte la simbolaj ligiloj estas laÅ­ataj, kvazaÅ­ „-L‟ ĉeestus.\n" +" La traktado de „..“ konsistas en forigo de la ĵus-antaÅ­a vojnoma\n" +" ero retrodirekte ĝis la oblikvo „/“ aÅ­ la komenco de DOSIERUJO.\n" +"\n" +" Elirstato:\n" +" Ĝi estas 0, se la dosierujŝanĝo sukcesis, kaj se, ĉeeste de „-P‟,\n" +" $PWD sukcese valoriziĝis; nenulo aliokaze." + +# pwd [-LP] +#: builtins.c:422 +msgid "" +"Print the name of the current working directory.\n" +" \n" +" Options:\n" +" -L\tprint the value of $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tprint the physical directory, without any symbolic links\n" +" \n" +" By default, `pwd' behaves as if `-L' were specified.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless an invalid option is given or the current directory\n" +" cannot be read." +msgstr "" +"Eligu la nomon de kuranta labora dosierujo\n" +"\n" +" Opcioj:\n" +" -L eligu la valoron de $PWD, se ĝi indikas la kurantan laboran\n" +" dosierujon\n" +" -P eligu la nomon de la fizika dosierujo, sen eventualaj simbolaj\n" +" ligiloj\n" +"\n" +" DefaÅ­lte „pwd‟ kondutas tiel, kiel kun la opcio „-L‟.\n" +"\n" +" Elirstato:\n" +" 0, krom se aperas misa opcio aÅ­ la kuranta dosierujo estas\n" +" nelegebla." + +#: builtins.c:439 +msgid "" +"Null command.\n" +" \n" +" No effect; the command does nothing.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Malplena ordono\n" +"\n" +" Senefika: La komando nenion faras.\n" +"\n" +" Elirstato:\n" +" Ĉiam sukcesa." + +# true +#: builtins.c:450 +msgid "" +"Return a successful result.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Liveru sukcesan rezulton\n" +"\n" +" Elirstato:\n" +" Ĉiam sukcesa." + +# false: +#: builtins.c:459 +msgid "" +"Return an unsuccessful result.\n" +" \n" +" Exit Status:\n" +" Always fails." +msgstr "" +"Liveru fiaskon.\n" +"\n" +" Elirstato:\n" +" Ĉiam malsukcesa." + +# command [-pVv] command [arg ...] +# command [-pVv] KOMANDO [ARG ...] +#: builtins.c:468 +msgid "" +"Execute a simple command or display information about commands.\n" +" \n" +" Runs COMMAND with ARGS suppressing shell function lookup, or display\n" +" information about the specified COMMANDs. Can be used to invoke " +"commands\n" +" on disk when a function with the same name exists.\n" +" \n" +" Options:\n" +" -p\tuse a default value for PATH that is guaranteed to find all of\n" +" \tthe standard utilities\n" +" -v\tprint a description of COMMAND similar to the `type' builtin\n" +" -V\tprint a more verbose description of each COMMAND\n" +" \n" +" Exit Status:\n" +" Returns exit status of COMMAND, or failure if COMMAND is not found." +msgstr "" +"Plenumu simplan komandon aÅ­ vidigu informojn pri komandoj\n" +"\n" +" Plenumu KOMANDOn kun ARGoj sen atenti eventualajn ŝelfunkciojn\n" +" samnomajn; aÅ­ vidigu informojn pri indikitaj KOMANDOj. Uzeblas\n" +" por voki komandojn de disko malgraÅ­ la ekzisto de samnomaj\n" +" funkcioj.\n" +"\n" +" Opcioj:\n" +" -p Uzu la defaÅ­ltan valoron de la de la variablo $PATH (tio\n" +"\tebligas trovi ĉiujn normajn utilaĵojn)\n" +" -v\tEligu komandopriskribon laÅ­ la maniero de la primitivaĵo „type‟\n" +" -V\tEligu pli detalan priskribon de KOMANDO\n" +"\n" +" Elirstato:\n" +" Tiu de KOMANDO; aÅ­ malsukceso, se KOMANDO ne troveblas." + +# declare [-aAfFgilnrtux] [-p] [name[=value] ...] +# declare [-aAfFgilnrtux] [-p] [NOMO[=VALORO] ...] +#: builtins.c:487 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Declare variables and give them attributes. If no NAMEs are given,\n" +" display the attributes and values of all variables.\n" +" \n" +" Options:\n" +" -f\trestrict action or display to function names and definitions\n" +" -F\trestrict display to function names only (plus line number and\n" +" \tsource file when debugging)\n" +" -g\tcreate global variables when used in a shell function; otherwise\n" +" \tignored\n" +" -p\tdisplay the attributes and value of each NAME\n" +" \n" +" Options which set attributes:\n" +" -a\tto make NAMEs indexed arrays (if supported)\n" +" -A\tto make NAMEs associative arrays (if supported)\n" +" -i\tto make NAMEs have the `integer' attribute\n" +" -l\tto convert NAMEs to lower case on assignment\n" +" -n\tmake NAME a reference to the variable named by its value\n" +" -r\tto make NAMEs readonly\n" +" -t\tto make NAMEs have the `trace' attribute\n" +" -u\tto convert NAMEs to upper case on assignment\n" +" -x\tto make NAMEs export\n" +" \n" +" Using `+' instead of `-' turns off the given attribute.\n" +" \n" +" Variables with the integer attribute have arithmetic evaluation (see\n" +" the `let' command) performed when the variable is assigned a value.\n" +" \n" +" When used in a function, `declare' makes NAMEs local, as with the " +"`local'\n" +" command. The `-g' option suppresses this behavior.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or a variable\n" +" assignment error occurs." +msgstr "" +"Difinu valorojn aÅ­ atributojn de variabloj.\n" +"\n" +" Deklaru variablojn aÅ­ atribuu al ili atributojn.\tSe NOMOj\n" +" mankas, anstataÅ­e eligu la valoron de ĉiuj variabloj.\n" +"\n" +" Opcioj:\n" +" -f\tla ago aÅ­ eligo koncernu nur la funkciajn NOMOjn kaj difinojn\n" +" -F\teligu nur funkcinomojn (ĉe erarserĉo, ankaÅ­ lininumeron kaj\n" +"\tfontodosieran nomon) sen difinoj\n" +" -g se uzita en ŝelfunkcio, kreu mallokan variablon;\n" +" aliokaze, ignoru\n" +" -p\teligu la atributojn kaj la valorojn de ĉiu NOMO\n" +"\n" +" Opcioj atributdonaj:\n" +" -a\tla NOMOj estu entjerindicaj tabeloj (se realigite)\n" +" -A\tla NOMOj estu asocitabeloj (se realigite)\n" +" -i\thavigu al la variabloj NOMOj la atributon „integer‟ (entjera)\n" +" -l\tminuskligu la NOMOjn ĉe valorizo\n" +" -n NOMO estu referenco al variablo nomata per ĝia valoro\n" +" -r\tla variabloj NOMOj estu nurlegaj\n" +" -t\thavigu al la NOMOj la atributon „trace‟ (spurata)\n" +" -u\tmajuskligu la NOMOjn ĉe valorizo\n" +" -x\teksportu la variablojn NOMOj\n" +"\n" +" La uzo de „+‟ anstataÅ­ „-‟ malŝaltas la koncernan attributon.\n" +"\n" +" Por la variabloj posedantaj la atributon entjera, ĉe ĉiu valorizo\n" +" okazas aritmetika komputado (vd la komandon „let‟).\n" +" \n" +" Uzite en funkcio, „declare‟ faras la NOMOjn lokaj, samkiel la\n" +" komando „local‟. La opcio „-g‟ ĉi tiun efikon abolas.\n" +"\n" +" Eliistato:\n" +" Sukceso, krom se aperas misa opcio aÅ­ okazas eraro ĉe valorizo de " +"variablo." + +# typeset [-aAfFgilrtux] [-p] name[=value] ... +#: builtins.c:527 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Obsolete. See `help declare'." +msgstr "" +"Difinu atributojn kaj valorojn de variabloj\n" +"\n" +" Arkaika. Vd «help declare»." + +# local [option] name[=value] ... +# local [OPCIO] NOMO[=VALORO] ... +#: builtins.c:535 +msgid "" +"Define local variables.\n" +" \n" +" Create a local variable called NAME, and give it VALUE. OPTION can\n" +" be any option accepted by `declare'.\n" +" \n" +" Local variables can only be used within a function; they are visible\n" +" only to the function where they are defined and its children.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied, a variable\n" +" assignment error occurs, or the shell is not executing a function." +msgstr "" +"Difinu lokajn variablojn\n" +"\n" +" Kreu lokan variablon NOMO kaj ĝin valorizu per VALORO. OPCIO\n" +" povas esti ajna el la opcioj de „declare‟.\n" +"\n" +" Lokaj variabloj uzeblas nur ene de funkcio; ili estas videblaj nur\n" +" en la funkcio kie ili estas difinitaj kaj en ĝiaj idoj.\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se aperas misa opcio, okazas valoriza eraro, aÅ­ la\n" +" ŝelo ne estas plenumanta funkcion." + +# echo: +#: builtins.c:552 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs, separated by a single space character and followed by " +"a\n" +" newline, on the standard output.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" -e\tenable interpretation of the following backslash escapes\n" +" -E\texplicitly suppress interpretation of backslash escapes\n" +" \n" +" `echo' interprets the following backslash-escaped characters:\n" +" \\a\talert (bell)\n" +" \\b\tbackspace\n" +" \\c\tsuppress further output\n" +" \\e\tescape character\n" +" \\E\tescape character\n" +" \\f\tform feed\n" +" \\n\tnew line\n" +" \\r\tcarriage return\n" +" \\t\thorizontal tab\n" +" \\v\tvertical tab\n" +" \\\\\tbackslash\n" +" \\0nnn\tthe character whose ASCII code is NNN (octal). NNN can be\n" +" \t0 to 3 octal digits\n" +" \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" +" \tcan be one or two hex digits\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Eligu la argumentojn en la ĉefeligujon\n" +"\n" +" Eligu en la ĉefeligujon la ARGojn disigante ilin per po unu\n" +" spaceto, postmetu linirompon.\n" +"\n" +" Opcioj:\n" +" -n\tne aldonu la finan linirompon\n" +" -e\taktivigu interpretadon de la ĉi-subaj eskapaj deklivaĵoj\n" +" -E\tmalaktivigu interpretadon de la ĉi-subaj espapaj deklivaĵoj\n" +"\n" +" „echo‟ povas interpreti la sekvajn literojn prefiksitajn per\n" +" deklivo (per la signo „\\‟):\n" +"\t\\a\tpepo (sonsignalo)\n" +"\t\\b\tretropaŝo\n" +"\t\\c\tĉesigu pluan eligon\n" +"\t\\e\teskapsigno\n" +"\t\\E\teskapsigno\n" +"\t\\f\tpaĝ-avanco\n" +"\t\\n\tlinifino\n" +"\t\\r\tĉaretreveno\n" +"\t\\t\thorizontala tabo\n" +"\t\\v\tvertikala tabo\n" +"\t\\\\\tdeklivo „\\‟\n" +"\t\\0CCC\tla signo kies Askia kodono estas CCC (okume). CCC\n" +"\t\tpovas enteni 0, 1, 2 aÅ­ 3 okumajn ciferojn\n" +"\t\\xHH\tla signo kies 8-bita kodono estas HH (16-ume). HH\n" +"\t\tpovas enteni unu aÅ­ du 16-umajn ciferojn\n" +"\n" +" Elirstato:\n" +" Sukcesa, krom se okazas elig-eraro." + +# echo [-n] [ARG ...] +#: builtins.c:588 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs on the standard output followed by a newline.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Skribu argumentojn en la ĉefeligujon\n" +"\n" +" Eligu la ARGojn en la ĉefeligujon, aldonu linifinilon.\n" +"\n" +" Opcio:\n" +" -n Ne aldonu postan linifinilon\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se okazas skriberaro." + +# enable [-a] [-dnps] [-f filename] [name ...] +# enable [-a] [-dnps] [-f DOSIERNOMO] [NOMO ...] +#: builtins.c:603 +msgid "" +"Enable and disable shell builtins.\n" +" \n" +" Enables and disables builtin shell commands. Disabling allows you to\n" +" execute a disk command which has the same name as a shell builtin\n" +" without using a full pathname.\n" +" \n" +" Options:\n" +" -a\tprint a list of builtins showing whether or not each is enabled\n" +" -n\tdisable each NAME or display a list of disabled builtins\n" +" -p\tprint the list of builtins in a reusable format\n" +" -s\tprint only the names of Posix `special' builtins\n" +" \n" +" Options controlling dynamic loading:\n" +" -f\tLoad builtin NAME from shared object FILENAME\n" +" -d\tRemove a builtin loaded with -f\n" +" \n" +" Without options, each NAME is enabled.\n" +" \n" +" To use the `test' found in $PATH instead of the shell builtin\n" +" version, type `enable -n test'.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not a shell builtin or an error occurs." +msgstr "" +"Aktivigu aÅ­ malaktivigu primitivajn komandojn\n" +"\n" +" Aktivigu aÅ­ malaktivigu primitivajn ŝelkomandojn. Tio ebligas\n" +" uzi eksteran komandon, samnoman kun primitivaĵo, sen indiki\n" +" ĝian plenan vojon.\n" +"\n" +" Opcioj:\n" +" -a\tListigu la primitivaĵojn indikante, ĉu ili estas aktivaj\n" +" -n Malaktivigu la NOMOjn, aÅ­ listigu la malaktivajn primitivaĵojn\n" +" -p\tListigu primitivaĵojn en formo taÅ­ga por reuzo\n" +" -s Eligu nur la «specialajn» ŝelfunkciojn de Posix\n" +"\n" +" Opcioj regantaj dinamikan ŝargadon:\n" +" -f\tŜargu primitivaĵon NOMO el la dinamika biblioteko DOSIERNOMO\n" +" -d Forigu ŝelkomandon dinamike ŝargitan per -f\n" +"\n" +" Senopcie: Aktivigu ĉiujn NOMOjn\n" +"\n" +" Ekz-e por uzi la „test‟on troveblan en $PATH anstataÅ­ la\n" +" samnoman primitivan ŝelkomandon, diru: «enable -n test».\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se NOMO ne estas primitiva ŝelkomando aÅ­ okazis\n" +" eraro." + +# eval [ARG ...] +#: builtins.c:631 +msgid "" +"Execute arguments as a shell command.\n" +" \n" +" Combine ARGs into a single string, use the result as input to the " +"shell,\n" +" and execute the resulting commands.\n" +" \n" +" Exit Status:\n" +" Returns exit status of command or success if command is null." +msgstr "" +"Plenumu argumentojn kiel ŝelkomandon\n" +"\n" +" Kunmetu la ARGojn en unu ĉenon, uzu la rezulton kiel enigaĵon por\n" +" la ŝelo kaj plenumu la legita(j)n komando(j)n.\n" +"\n" +" Elirstato:\n" +" Tiu de la komandoĉeno; sukceso, se la komando estas vakua." + +# getopts optstring name [arg] => +# getopts OPCIĈENO NOMO [ARG] +#: builtins.c:643 +msgid "" +"Parse option arguments.\n" +" \n" +" Getopts is used by shell procedures to parse positional parameters\n" +" as options.\n" +" \n" +" OPTSTRING contains the option letters to be recognized; if a letter\n" +" is followed by a colon, the option is expected to have an argument,\n" +" which should be separated from it by white space.\n" +" \n" +" Each time it is invoked, getopts will place the next option in the\n" +" shell variable $name, initializing name if it does not exist, and\n" +" the index of the next argument to be processed into the shell\n" +" variable OPTIND. OPTIND is initialized to 1 each time the shell or\n" +" a shell script is invoked. When an option requires an argument,\n" +" getopts places that argument into the shell variable OPTARG.\n" +" \n" +" getopts reports errors in one of two ways. If the first character\n" +" of OPTSTRING is a colon, getopts uses silent error reporting. In\n" +" this mode, no error messages are printed. If an invalid option is\n" +" seen, getopts places the option character found into OPTARG. If a\n" +" required argument is not found, getopts places a ':' into NAME and\n" +" sets OPTARG to the option character found. If getopts is not in\n" +" silent mode, and an invalid option is seen, getopts places '?' into\n" +" NAME and unsets OPTARG. If a required argument is not found, a '?'\n" +" is placed in NAME, OPTARG is unset, and a diagnostic message is\n" +" printed.\n" +" \n" +" If the shell variable OPTERR has the value 0, getopts disables the\n" +" printing of error messages, even if the first character of\n" +" OPTSTRING is not a colon. OPTERR has the value 1 by default.\n" +" \n" +" Getopts normally parses the positional parameters ($0 - $9), but if\n" +" more arguments are given, they are parsed instead.\n" +" \n" +" Exit Status:\n" +" Returns success if an option is found; fails if the end of options is\n" +" encountered or an error occurs." +msgstr "" +"Analizu opciajn argumentojn\n" +"\n" +" La funkcion „getopts‟ uzas ŝelproceduroj por analizi opciformajn\n" +" numerparametrojn.\n" +"\n" +" La argumento OPCIĈENO entenas la rekonendajn opciliterojn; se\n" +" literon sekvas dupunkto, la opcio postulas argumenton, disde ĝi\n" +" apartigendan per blanka spaco.\n" +"\n" +" Ĉe ĉiu voko „getopts‟ liveros la vican opcion en la ŝelvariablon\n" +" $NOMO (estigante la variablon se ĝi ne ekzistas); kaj la indicon\n" +" de la sekve traktota argumento en la ŝelvariablon OPTIND. OPTIND\n" +" ricevas la komencan valoron 1 ĉe ĉiu voko de la ŝelo aÅ­ ŝela\n" +" skripto. Kiam opcio bezonas argumenton, „getopts‟ liveras tiun\n" +" argumenton en la ŝelvariablon OPTARG.\n" +"\n" +" La funkcio „getopts‟ raportas pri eraroj dumaniere. Se la unua\n" +" signo de OPCIĈENO estas dupunkto, „getopts‟ prisilentas\n" +" erarojn. En tiu reĝimo, nenia erarmesaĝo estas eligata.\n" +" Renkontinte misan opcion, „getopts‟ metas la trovitan opciliteron\n" +" en OPTARG. Se mankas bezonata argumento, la ŝelvariablo NOMO\n" +" ricevas la valoron ':', kaj la variablo OPTARG, la trovitan\n" +" opcion. Se „getopts‟ ne estas en silenta reĝimo kaj trovas\n" +" misan opcion, tiam NOMO ricevas la valoron '?' kaj OPTARG\n" +" senvaloriĝas. Se mankas bezonata opcio, NOMO ricevas la\n" +" valoron '?', OPTARG senvaloriĝas kaj erarmesaĝo estas eligata.\n" +"\n" +" Se la ŝelvariablo OPTERR havas la valoron 0, „getopts‟\n" +" malaktivigas la eligon de erarmesaĝoj, eĉ se la unua signo de\n" +" OPCIĈENO ne estas dupunkto. La apriora valoro de OPTERR estas 1.\n" +"\n" +" Normale „getopts‟ analizas la numerparametrojn ($0 - $9), sed se\n" +" estas pli da argumentoj, „getopts‟ anstataÅ­e analizas ilin.\n" +"\n" +" Elirstato:\n" +" Sukceso, se opcio estas trovita; malsukceso, se renkontiĝis\n" +" la fino de la opcioj aÅ­ okazis eraro." + +# exec [-cl] [-a name] [command [arguments ...]] [redirection ...] +# exec [-cl] [-a NOMO] [KOMANDO [ARGUMENTOJ ...]] [ALIDIREKTADO ...] +#: builtins.c:685 +msgid "" +"Replace the shell with the given command.\n" +" \n" +" Execute COMMAND, replacing this shell with the specified program.\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not " +"specified,\n" +" any redirections take effect in the current shell.\n" +" \n" +" Options:\n" +" -a name\tpass NAME as the zeroth argument to COMMAND\n" +" -c\t\texecute COMMAND with an empty environment\n" +" -l\t\tplace a dash in the zeroth argument to COMMAND\n" +" \n" +" If the command cannot be executed, a non-interactive shell exits, " +"unless\n" +" the shell option `execfail' is set.\n" +" \n" +" Exit Status:\n" +" Returns success unless COMMAND is not found or a redirection error " +"occurs." +msgstr "" +"AnstataÅ­igu la ŝelon je la donita komando\n" +"\n" +" Plenumu la KOMANDOn, anstataÅ­igante la ŝelon je la donita\n" +" programo. La ARGUMENTOj servas kiel argumentoj por KOMANDO.\n" +" Se KOMANDO ne estas indikita, la alidirektadoj okazu en \n" +" la kuranta ŝelo.\n" +"\n" +" Opcioj:\n" +" -a NOMO Pasigu NOMOn al KOMANDO kiel la argumenton argv[0]\n" +" -c\tLa plenumo de KOMANDO okazu en vakua medio\n" +" -l\tMetu minuson en la nulan argumenton pasigatan al KOMANDO\n" +"\n" +" Se la komandon ne eblas plenumi kaj la ŝelo ne estas dialoga, tiam\n" +" la ŝelo finiĝas, krom se la opcio „execfail‟ estas aktiva.\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se KOMANDO ne estas trovita aÅ­ okazis eraro pri\n" +" alirektado." + +# exit [n] +#: builtins.c:706 +msgid "" +"Exit the shell.\n" +" \n" +" Exits the shell with a status of N. If N is omitted, the exit status\n" +" is that of the last command executed." +msgstr "" +"Forlasu la ŝelon\n" +"\n" +" Forlasu la ŝelon kun elirstato N. Se N mankas, la elirstato\n" +" estas tiu de la plej ĵuse plenumita komando." + +# logout [N] +#: builtins.c:715 +msgid "" +"Exit a login shell.\n" +" \n" +" Exits a login shell with exit status N. Returns an error if not " +"executed\n" +" in a login shell." +msgstr "" +"AdiaÅ­, saluta ŝelo!\n" +"\n" +" Eliru el saluta ŝelo kun la elirstato N. Liveru malsukceson, se\n" +" plenumate ne en saluta ŝelo." + +# ZZZ: fc [-e ename] [-nlr] [first] [last] or +# fc -s [pat=rep] [command] => +# fc [-e REDAKTILO] [-lnr] [UNUA] [LASTA] aÅ­ +# fc -s [ŜABLONO=ANST] [KOMANDO] +#: builtins.c:725 +msgid "" +"Display or execute commands from the history list.\n" +" \n" +" fc is used to list or edit and re-execute commands from the history " +"list.\n" +" FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" +" string, which means the most recent command beginning with that\n" +" string.\n" +" \n" +" Options:\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then " +"EDITOR,\n" +" \t\tthen vi\n" +" -l \tlist lines instead of editing\n" +" -n\tomit line numbers when listing\n" +" -r\treverse the order of the lines (newest listed first)\n" +" \n" +" With the `fc -s [pat=rep ...] [command]' format, COMMAND is\n" +" re-executed after the substitution OLD=NEW is performed.\n" +" \n" +" A useful alias to use with this is r='fc -s', so that typing `r cc'\n" +" runs the last command beginning with `cc' and typing `r' re-executes\n" +" the last command.\n" +" \n" +" Exit Status:\n" +" Returns success or status of executed command; non-zero if an error " +"occurs." +msgstr "" +"Eligu aÅ­ plenumu komandojn el la historilisto\n" +"\n" +" „fc‟ servas por listigi aÅ­ redakti kaj replenumi komandojn el la\n" +" historilisto. UNUA kaj LASTA povas esti numeroj, indikantaj\n" +" intervalon da numeroj; aÅ­, se UNUA estas signoĉeno, ĝi indikas\n" +" la plej ĵusan komandon komenciĝantan per tiu signoĉeno.\n" +"\n" +" Opcioj:\n" +" -e REDAKTILO\tla uzota redaktilo. DefaÅ­lte FCEDIT, poste\n" +"\tEDITOR, poste „vi‟\n" +" -l\tnur eligu la liniojn sen redakti ilin\n" +" -n\teligu sennumere (nur la liniojn)\n" +" -r\tinversigu la ordon de la linioj (komencu per la plej ĵusaj).\n" +"\n" +" «fc -s [ŜABLONO=ANST ...] [KOMANDO]» plenumas la KOMANDOn en kiu\n" +" ĉiu apero de ŜABLONO estas la anstataÅ­igita je ANST.\n" +"\n" +" Oportuna alinomo por tio estas «alias r='fc -s'», tiel ke ekz-e per\n" +" «r cc» oni rulos la plej ĵusan komandon komenciĝantan per «cc», kaj\n" +" per «r» replenumigas la ĵusan komandon.\n" +"\n" +" Elisrstato:\n" +" Sukceso, aÅ­ la elirstato de la plenumita KOMANDO; nenulo, se okazis\n" +" eraro." + +# fg [job_spec] => fg [LABORINDIKO] +#: builtins.c:755 +msgid "" +"Move job to the foreground.\n" +" \n" +" Place the job identified by JOB_SPEC in the foreground, making it the\n" +" current job. If JOB_SPEC is not present, the shell's notion of the\n" +" current job is used.\n" +" \n" +" Exit Status:\n" +" Status of command placed in foreground, or failure if an error occurs." +msgstr "" +"Movu laboron en la dialogon\n" +"\n" +" Faru la laboron LABORINDIKO dialoga kaj la kuranta. Se\n" +" LABORINDIKO malestas, apliku la ŝelan koncepton pri la kuranta\n" +" laboro.\n" +"\n" +" Elirstato:\n" +" Tiu de la dialogigita komando; aÅ­ malsukceso, se okazis eraro." + +# bg [job_spec] => bg [LABORINDIKO] +#: builtins.c:770 +msgid "" +"Move jobs to the background.\n" +" \n" +" Place the jobs identified by each JOB_SPEC in the background, as if " +"they\n" +" had been started with `&'. If JOB_SPEC is not present, the shell's " +"notion\n" +" of the current job is used.\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Forŝovu laboron fonen\n" +"\n" +" Forŝovu la laboron LABORINDIKO en la fonon, faru ĝin kvazaÅ­\n" +" lanĉita kun „&‟. Se nenia laboro estas indikita, apliku la\n" +" ŝelan koncepton pri la kuranta laboro.\n" +"\n" +" Elirstato:\\n\"\n" +" Sukceso, kondiĉe ke laborregadon estas ŝaltita kaj ne okazis\n" +" eraro." + +# hash [-lr] [-p VOJNOMO] [-dt] [NOMO ...] +#: builtins.c:784 +msgid "" +"Remember or display program locations.\n" +" \n" +" Determine and remember the full pathname of each command NAME. If\n" +" no arguments are given, information about remembered commands is " +"displayed.\n" +" \n" +" Options:\n" +" -d\t\tforget the remembered location of each NAME\n" +" -l\t\tdisplay in a format that may be reused as input\n" +" -p pathname\tuse PATHNAME as the full pathname of NAME\n" +" -r\t\tforget all remembered locations\n" +" -t\t\tprint the remembered location of each NAME, preceding\n" +" \t\teach location with the corresponding NAME if multiple\n" +" \t\tNAMEs are given\n" +" Arguments:\n" +" NAME\t\tEach NAME is searched for in $PATH and added to the list\n" +" \t\tof remembered commands.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not found or an invalid option is given." +msgstr "" +"Registru aÅ­ vidigu vojnomojn de programoj\n" +"\n" +" Por ĉiu komando NOMO, trovu kaj registru en hakettabelo la\n" +" kompletan vojon al ties programo. Se nenia argumento estas\n" +" donita, eligu la informojn pri la memorataj komandoj.\n" +"\n" +" Opcioj:\n" +" -d Forgesu la registritajn vojojn por ĉiu NOMO\n" +" -l Eligu en formo reuzeblan por enigo\n" +" -p VOJNOMO\tuzu VOJNOMOn kiel kompletan vojon por la NOMO\n" +" -r Forgesu ĉiujn registritajn vojojn\n" +" -t Eligu la registritajn vojojn por ĉiu NOMO, mentante la NOMOn\n" +" titole antaÅ­ ĝia vojo se estas pluraj NOMOj\n" +"\n" +" Argumentoj:\n" +" NOMO Ĉiu NOMO estas serĉota en $PATH kaj registrota en la\n" +"\thakettabelo de registritaj komandoj\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se aperas netrovebla NOMO aÅ­ misa opcio." + +# help [-ds] [pattern ...] +# help [-ds] [ŜABLONO ...] +#: builtins.c:809 +msgid "" +"Display information about builtin commands.\n" +" \n" +" Displays brief summaries of builtin commands. If PATTERN is\n" +" specified, gives detailed help on all commands matching PATTERN,\n" +" otherwise the list of help topics is printed.\n" +" \n" +" Options:\n" +" -d\toutput short description for each topic\n" +" -m\tdisplay usage in pseudo-manpage format\n" +" -s\toutput only a short usage synopsis for each topic matching\n" +" \tPATTERN\n" +" \n" +" Arguments:\n" +" PATTERN\tPattern specifiying a help topic\n" +" \n" +" Exit Status:\n" +" Returns success unless PATTERN is not found or an invalid option is " +"given." +msgstr "" +"Vidigu informon pri prmitivaj komandoj\n" +"\n" +" Eligu mallongan resummon pri la primitivaj komandoj. Se ĉeestas\n" +" ŜABLONO, eligu detalan helpon pri ĉiuj komandoj kongruaj kun la\n" +" ŝablono; alie eligu nur liston da temoj.\n" +"\n" +" Opcioj:\n" +" -d\tEligu mallongajn priskribojn de ĉiuj temoj\n" +" -m\tVidigu uzmanieron en la „manpaĝa‟ stilo (kiel la komando „man‟)\n" +" -s\tEligu nur mallongan resumon pri ĉiu trovita kongruaĵo\n" +"\n" +" Argumentoj:\n" +" ŜABLONO Komenca signoĉeno de temtitolo\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se mankas kongruaĵoj por ŜABLONO, aÅ­ aperis\n" +" misa opcio." + +# ZZZ history [-c] [-d offset] [n] or +# history -awr [filename] or +# history -ps arg [arg...] => +# history [-c] [-d DEŜOVO] [n] aÅ­ +# history -awr [DOSIERNOMO] aÅ­ +# history -ps ARG [ARG...] +#: builtins.c:833 +msgid "" +"Display or manipulate the history list.\n" +" \n" +" Display the history list with line numbers, prefixing each modified\n" +" entry with a `*'. An argument of N lists only the last N entries.\n" +" \n" +" Options:\n" +" -c\tclear the history list by deleting all of the entries\n" +" -d offset\tdelete the history entry at offset OFFSET.\n" +" \n" +" -a\tappend history lines from this session to the history file\n" +" -n\tread all history lines not already read from the history file\n" +" -r\tread the history file and append the contents to the history\n" +" \tlist\n" +" -w\twrite the current history to the history file\n" +" \tand append them to the history list\n" +" \n" +" -p\tperform history expansion on each ARG and display the result\n" +" \twithout storing it in the history list\n" +" -s\tappend the ARGs to the history list as a single entry\n" +" \n" +" If FILENAME is given, it is used as the history file. Otherwise,\n" +" if $HISTFILE has a value, that is used, else ~/.bash_history.\n" +" \n" +" If the $HISTTIMEFORMAT variable is set and not null, its value is used\n" +" as a format string for strftime(3) to print the time stamp associated\n" +" with each displayed history entry. No time stamps are printed " +"otherwise.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" +"Eligu aÅ­ redaktu la historiliston.\n" +"\n" +" Eligu la liston de enigitaj komandoj kun lininumeroj. La ŝanĝitajn\n" +" liniojn marku per „*‟. Kun argumento n, eligu nur la ĵusajn\n" +" n liniojn.\n" +"\n" +" Opcioj:\n" +" -c forviŝu la tutan historion (forigu ĉiujn erojn el la listo)\n" +" -d forviŝu la linion kies numero estas DEŜOVO\n" +"\n" +" -a aldonu la historiliniojn de la kuranta seanco al la\n" +" historidosiero\n" +" -n legu ĉiujn ankoraÅ­ ne legitajn liniojn el la historidosiero\n" +" kaj aldonu ilin en la historiliston\n" +" -r legu la dosieron kaj aldonu ĝian enhavon al la kuranta\n" +" historilisto\n" +" -w konservu la kurantan historion en la historidosiero\n" +"\n" +" -p plenumu historian anstataÅ­igon por ĉiu el la argumentoj ARG\n" +" kaj eligu la rezulton sen konservi ion en la historilisto\n" +"\n" +" -s enŝovu la neopciajn argumentojn ARG en la historiliston\n" +" kiel unu apartan linion\n" +"\n" +" Se ĉeestas DOSIERNOMO, uzu ĝin kiel nomon de historidosiero;\n" +" alie, se la variablo $HISTFILE havas valoron, uzu ĉi tiun;\n" +" alie uzu «~/.bash_history».\n" +"\n" +" Se la variablo $HISTTIMEFORMAT havas valoron kaj se ĉi tiu ne\n" +" estas null, tiam ĝi servu kiel formata ĉeno en strftime(3) por\n" +" tempostampi ĉiun linion en eligaĵoj de historio. Aliokaze nenia\n" +" tempostampo estu eligata.\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se renkontiĝas mis opcio aÅ­ okazis eraro." + +# ZZZ jobs [-lnprs] [jobspec ...] or +# jobs -x command [args] => +# jobs [-lnprs] [LABORINDIKO ...] aÅ­ +# jobs -x KOMANDO [ARGS] +#: builtins.c:869 +#, fuzzy +msgid "" +"Display status of jobs.\n" +" \n" +" Lists the active jobs. JOBSPEC restricts output to that job.\n" +" Without options, the status of all active jobs is displayed.\n" +" \n" +" Options:\n" +" -l\tlists process IDs in addition to the normal information\n" +" -n\tlists only processes that have changed status since the last\n" +" \tnotification\n" +" -p\tlists process IDs only\n" +" -r\trestrict output to running jobs\n" +" -s\trestrict output to stopped jobs\n" +" \n" +" If -x is supplied, COMMAND is run after all job specifications that\n" +" appear in ARGS have been replaced with the process ID of that job's\n" +" process group leader.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs.\n" +" If -x is used, returns the exit status of COMMAND." +msgstr "" +"Montru la staton de laboroj\n" +"\n" +" Eligu liston da aktivaj laboroj. Se LABORINDIKO estas donita,\n" +" nur pri tiu laboro informu. Senopcie, montru la staton de ĉiuj\n" +" aktivaj laboroj.\n" +"\n" +" Opcioj:\n" +" -l eligu, krom la normalajn informojn, ankaÅ­ la proceznumerojn\n" +" -n listigu nur la procezojn kies stato ŝanĝiĝis post la lasta\n" +" informmendo\n" +" -p eligu nur la proceznumerojn\n" +" -r informu nur pri la laboroj aktivaj (rulataj)\n" +" -s informu nur pri la laboroj haltigitaj\n" +"\n" +" La opcio -x lanĉas la KOMANDOn, antaÅ­e ŝanĝinte ĉiujn\n" +" laborindikojn aperantajn en la argumentoj ARGS je la\n" +" proceznumero de la ĉefprocezo de la grupo.\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se enestas misa opcio aÅ­ okazis eraro.\n" +" Ĉe „-x‟, la elirstato de la KOMANDO." + +# disown [-h] [-ar] [jobspec ...] +#: builtins.c:896 +msgid "" +"Remove jobs from current shell.\n" +" \n" +" Removes each JOBSPEC argument from the table of active jobs. Without\n" +" any JOBSPECs, the shell uses its notion of the current job.\n" +" \n" +" Options:\n" +" -a\tremove all jobs if JOBSPEC is not supplied\n" +" -h\tmark each JOBSPEC so that SIGHUP is not sent to the job if the\n" +" \tshell receives a SIGHUP\n" +" -r\tremove only running jobs\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option or JOBSPEC is given." +msgstr "" +"Forigu laborojn el la kuranta ŝelo\n" +"\n" +" Forigu ĉiun laboron indikitan per argumento LABORINDIKO el\n" +" la tabelo de aktivaj laboroj. Se nenia laboro estas indikita,\n" +" apliku la ŝelan koncepton pri la kuranta laboro.\n" +"\n" +" Opcioj:\n" +" -a forigu ĉiujn laborojn el la labortabelo\n" +" -h anstataÅ­ forigi laboron el la tabelo, marku ĝin tiel, ke la\n" +" signalo SIGHUP ne estu plusendita al la laboro(j) kiam tian\n" +" signalon ricevas la ŝelo\n" +" -r forigu nur rulatajn laborojn\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se enestas misa opcio aÅ­ LABORINDIKO." + +# ZZZ: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or +# kill -l [sigspec] => +# kill [-s SIGSNOM | -n SIGNUM | -SIGNOM] PN | LABORINDIKO ... aÅ­ +# kill -l [SIGNOM] +#: builtins.c:915 +msgid "" +"Send a signal to a job.\n" +" \n" +" Send the processes identified by PID or JOBSPEC the signal named by\n" +" SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n" +" SIGTERM is assumed.\n" +" \n" +" Options:\n" +" -s sig\tSIG is a signal name\n" +" -n sig\tSIG is a signal number\n" +" -l\tlist the signal names; if arguments follow `-l' they are\n" +" \tassumed to be signal numbers for which names should be listed\n" +" \n" +" Kill is a shell builtin for two reasons: it allows job IDs to be used\n" +" instead of process IDs, and allows processes to be killed if the limit\n" +" on processes that you can create is reached.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" +"Sendu signalon al laboro\n" +"\n" +" Sendu al la procezoj, indikitaj per sia proceznumero PN (aÅ­\n" +" per la LABORINDIKO) la signalon SIGNOM aÅ­ SIGNUM. Se nek\n" +" SIGNUM nek SIGNOM enestas, sendu SIGTERM.\n" +"\n" +" Opcioj:\n" +" -s\tSIGNOM estas nomo de signalo\n" +" -n\tSIGNUM estas numero de signalo\n" +" -l listigu signalnomojn; la eventuale sekvantaj entjeraj\n" +" argumentoj estas signalnumeroj, ĉeeste de kiuj nur la al\n" +" ili respondaj signalnomoj estu eligataj.\n" +"\n" +" „kill‟ estas primitiva ŝelkomando pro du kaÅ­zoj:\n" +" unue, ĝi ebligas uzi laborindikojn anstataÅ­ proceznumerojn;\n" +" kaj due, se la maksimuma nombro de kreeblaj procezoj estas\n" +" atingita, ne necesas lanĉi kroman procezon por ĉesigi iun alian.\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se enestas misa opcio aÅ­ okazis eraro." + +# let arg [arg ...] +# let ARG [ARG ...] +#: builtins.c:938 +msgid "" +"Evaluate arithmetic expressions.\n" +" \n" +" Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" +" fixed-width integers with no check for overflow, though division by 0\n" +" is trapped and flagged as an error. The following list of operators is\n" +" grouped into levels of equal-precedence operators. The levels are " +"listed\n" +" in order of decreasing precedence.\n" +" \n" +" \tid++, id--\tvariable post-increment, post-decrement\n" +" \t++id, --id\tvariable pre-increment, pre-decrement\n" +" \t-, +\t\tunary minus, plus\n" +" \t!, ~\t\tlogical and bitwise negation\n" +" \t**\t\texponentiation\n" +" \t*, /, %\t\tmultiplication, division, remainder\n" +" \t+, -\t\taddition, subtraction\n" +" \t<<, >>\t\tleft and right bitwise shifts\n" +" \t<=, >=, <, >\tcomparison\n" +" \t==, !=\t\tequality, inequality\n" +" \t&\t\tbitwise AND\n" +" \t^\t\tbitwise XOR\n" +" \t|\t\tbitwise OR\n" +" \t&&\t\tlogical AND\n" +" \t||\t\tlogical OR\n" +" \texpr ? expr : expr\n" +" \t\t\tconditional operator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tassignment\n" +" \n" +" Shell variables are allowed as operands. The name of the variable\n" +" is replaced by its value (coerced to a fixed-width integer) within\n" +" an expression. The variable need not have its integer attribute\n" +" turned on to be used in an expression.\n" +" \n" +" Operators are evaluated in order of precedence. Sub-expressions in\n" +" parentheses are evaluated first and may override the precedence\n" +" rules above.\n" +" \n" +" Exit Status:\n" +" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." +msgstr "" +"Komputu aritmetikan esprimon\n" +"\n" +" Ĉiu arg estas komputenda aritmetika esprimo. La komputado uzas\n" +" fikslongajn entjerojn sen kontrolo pri trooj; tamen divido per 0\n" +" estas kaptata kaj raportata kiel eraro. En la sekvanta listo da\n" +" operacioj la samprioritataj operacisimboloj aperas kune. La\n" +" grupoj estas aranĝitaj laÅ­ malkresko de ligforto.\n" +"\n" +"\tnomo++, nomo--\tpostkrementoj de variablo\n" +"\t++nomo, --nomo\tantaÅ­krementoj de variablo\n" +"\t-, +\t\tunulokaj minus, plus\n" +"\t!, ~\t\tlogika kaj laÅ­bita negoj\n" +" ** potencigo\n" +"\t*, /, %\t\tmultipliko, divido, resto\n" +"\t+, -\t\tadicio, subtraho\n" +"\t<<, >>\t\tlaÅ­bitaj ŝovoj maldekstren kaj dekstren\n" +"\t<=, >=, <, >\tkomparaj operacioj\n" +"\t==, !=\t\tegalo, neegalo\n" +"\t&\t\tlaÅ­bita KAJ\n" +"\t^\t\tlaÅ­bita DISAŬ\n" +"\t|\t\tlaÅ­bita AŬ\n" +"\t&&\t\tlogika KAJ\n" +"\t||\t\tlogika AŬ\n" +"\tesprimo ? esprimo : esprimo\n" +"\t\t\tkondiĉa esprimo\n" +"\t=, *=, /=, %=,\n" +"\t+=, -=, <<=, >>=,\n" +"\t&=, ^=, |=\tvalorizoj\n" +"\n" +" Ŝelvariabloj uzeblas kiel operandoj. En esprimo la nomon de\n" +" variablo anstataÅ­as ĝia valoro (altipigita al fikslonga entjero).\n" +" Por tia uzo en esprimo variablo ne bezonas havi ŝaltita sian\n" +" atributon „entjera‟.\n" +"\n" +" La operacioj plenumiĝas laÅ­ la ligforto de siaj operacisignoj. La\n" +" enkrampigitaj subesprimoj plenumiĝas unue, kaj tio ebligas\n" +" ĉirkaÅ­iri la supre priskribitajn regulojn pri la ligfortoj.\n" +"\n" +" Elirstato:\n" +" Se la komputo de la lasta ARG donas 0, la komando „let‟\n" +" liveras 1; alie ĝi liveras 0." + +# read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] +# [-p prompt] [-t timeout] [-u fd] [name ...] +# read [-ers] [-a TABELO] [-d DISIG] [-i TEKSTO] [-n NSIGN] [-N NSIGN] +# [-p INVIT] [-t TLIM] [-u DN] [NOMO ...] +#: builtins.c:983 +msgid "" +"Read a line from the standard input and split it into fields.\n" +" \n" +" Reads a single line from the standard input, or from file descriptor FD\n" +" if the -u option is supplied. The line is split into fields as with " +"word\n" +" splitting, and the first word is assigned to the first NAME, the second\n" +" word to the second NAME, and so on, with any leftover words assigned to\n" +" the last NAME. Only the characters found in $IFS are recognized as " +"word\n" +" delimiters.\n" +" \n" +" If no NAMEs are supplied, the line read is stored in the REPLY " +"variable.\n" +" \n" +" Options:\n" +" -a array\tassign the words read to sequential indices of the array\n" +" \t\tvariable ARRAY, starting at zero\n" +" -d delim\tcontinue until the first character of DELIM is read, rather\n" +" \t\tthan newline\n" +" -e\t\tuse Readline to obtain the line in an interactive shell\n" +" -i text\tUse TEXT as the initial text for Readline\n" +" -n nchars\treturn after reading NCHARS characters rather than waiting\n" +" \t\tfor a newline, but honor a delimiter if fewer than NCHARS\n" +" \t\tcharacters are read before the delimiter\n" +" -N nchars\treturn only after reading exactly NCHARS characters, " +"unless\n" +" \t\tEOF is encountered or read times out, ignoring any delimiter\n" +" -p prompt\toutput the string PROMPT without a trailing newline before\n" +" \t\tattempting to read\n" +" -r\t\tdo not allow backslashes to escape any characters\n" +" -s\t\tdo not echo input coming from a terminal\n" +" -t timeout\ttime out and return failure if a complete line of input " +"is\n" +" \t\tnot read within TIMEOUT seconds. The value of the TMOUT\n" +" \t\tvariable is the default timeout. TIMEOUT may be a\n" +" \t\tfractional number. If TIMEOUT is 0, read returns immediately,\n" +" \t\twithout trying to read any data, returning success only if\n" +" \t\tinput is available on the specified file descriptor. The\n" +" \t\texit status is greater than 128 if the timeout is exceeded\n" +" -u fd\t\tread from file descriptor FD instead of the standard input\n" +" \n" +" Exit Status:\n" +" The return code is zero, unless end-of-file is encountered, read times " +"out\n" +" (in which case it's greater than 128), a variable assignment error " +"occurs,\n" +" or an invalid file descriptor is supplied as the argument to -u." +msgstr "" +"Legu linion el la ĉefenigujo kaj disigu ĝin en kampojn\n" +"\n" +" Legu unu linion el la ĉefenigujo, aÅ­ el la dosiero indikita\n" +" per dosiernumero DN, se la opcio -u estas donita. La linion\n" +" disigu en kampojn, kiel ĉe vortodisigo, kaj la unuan vorton ricevu\n" +" la unua argumento NOMO; la duan, la dua NOMO ktp; la lasta NOMO\n" +" ricevu ĉiujn restantajn vortojn. Nur la signoj troveblaj en la\n" +" variablo $IFS rolas kiel vortodisigiloj.\n" +"\n" +" Se nenia NOMO estas donita, konservu la legitan linion en la\n" +" variablo REPLY.\n" +"\n" +" Opcioj:\n" +" -a TABELO\tla legatajn vortojn konservu en la sinsekvaj anoj de\n" +"\t\tTABELO, komencante ekde la indico 0\n" +" -d DISIG\tlegu ĝis la unua signo de la disigilo DISIG (anstataÅ­\n" +"\t\tlegi ĝis linifino)\n" +" -e\t\tuzu Readline por akiri la linion en dialoga ŝelo\n" +" -i TEKSTO\tuzu TEKSTOn kiel komencan tekston por Readline\n" +" -n NSIGN\tĉesu leginte NSIGN da signoj (anstataÅ­ legi ĝis\n" +"\t\tlinifino), krom se disigilo aperas pli frue\n" +" -N NSIGN\tlegu ekzakte NSIGN da signoj (tra ĉiuj disigiloj), krom\n" +" se la dosierfino aÅ­ la tempolimo atingiĝos pli frue\n" +" -p INVIT\teligu la invitĉenon INVIT sen liniavanco antaÅ­ la\n" +"\t\tatendata enigo\n" +" -r\t\tla deklivo „\\‟ estu ordinara signo (ne eskapsigno)\n" +" -s\t\tsilentigu la eÄ¥on de la terminala enigo\n" +" -t TLIM\tla komando read ĉesiĝu kun fiaska elirstato se\n" +"\t\tkompleta linio da enigaĵo ne estas ricevita dum\t TLIM\n" +"\t\tda sekundoj. Se la variablo TMOUT havas valoron, ĉi\n" +"\t\ttiu estas uzata kiel defaÅ­lta atendolimo. TLIM povas\n" +"\t\testi frakcio. Se TLIM estas 0,\t read tuj finiĝas sen\n" +" provi ion legi, sed sukcesas nur se engaĵo pretas\n" +" ĉe la indikita dosiernumero. La elirstato estas pli\n" +" granda ol 128 se la atendotempo estas atingita\n" +" -u DN\tlegu per la dosiernunero DN anstataÅ­ el la ĉefenigujo\n" +"\n" +" Elirstato:\n" +" Ĝi estas 0, krom se renkontiĝas dosierfino, aÅ­ atendolimo estas\n" +" atingita (tiuokaze ĝi superas 128), aÅ­ okazas valoriza eraro, aÅ­\n" +" -u indikas nevalidan dosiernumeron." + +# return [n] +# return [N] +#: builtins.c:1028 +msgid "" +"Return from a shell function.\n" +" \n" +" Causes a function or sourced script to exit with the return value\n" +" specified by N. If N is omitted, the return status is that of the\n" +" last command executed within the function or script.\n" +" \n" +" Exit Status:\n" +" Returns N, or failure if the shell is not executing a function or script." +msgstr "" +"Revenu el ŝelfunkcio\n" +"\n" +" Igas la funkcion aÅ­ punkte vokitan („.‟, „source‟) skripton finiĝi\n" +" kaj liveri la donitan valoron N kiel elirstaton. Se N mankas,\n" +" la elirstato estas tiu de la ĵusa komando.\n" +"\n" +" Elirstato:\n" +" N, aÅ­ malsukceso se la ŝelo ne plenumas ŝelfunkcion aÅ­ skripton." + +# set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...] +# set [-abefhkmnptuvxBCHP] [-o OPCINOMO] [--] [ARG ...] +#: builtins.c:1041 +msgid "" +"Set or unset values of shell options and positional parameters.\n" +" \n" +" Change the value of shell attributes and positional parameters, or\n" +" display the names and values of shell variables.\n" +" \n" +" Options:\n" +" -a Mark variables which are modified or created for export.\n" +" -b Notify of job termination immediately.\n" +" -e Exit immediately if a command exits with a non-zero status.\n" +" -f Disable file name generation (globbing).\n" +" -h Remember the location of commands as they are looked up.\n" +" -k All assignment arguments are placed in the environment for a\n" +" command, not just those that precede the command name.\n" +" -m Job control is enabled.\n" +" -n Read commands but do not execute them.\n" +" -o option-name\n" +" Set the variable corresponding to option-name:\n" +" allexport same as -a\n" +" braceexpand same as -B\n" +" emacs use an emacs-style line editing interface\n" +" errexit same as -e\n" +" errtrace same as -E\n" +" functrace same as -T\n" +" hashall same as -h\n" +" histexpand same as -H\n" +" history enable command history\n" +" ignoreeof the shell will not exit upon reading EOF\n" +" interactive-comments\n" +" allow comments to appear in interactive commands\n" +" keyword same as -k\n" +" monitor same as -m\n" +" noclobber same as -C\n" +" noexec same as -n\n" +" noglob same as -f\n" +" nolog currently accepted but ignored\n" +" notify same as -b\n" +" nounset same as -u\n" +" onecmd same as -t\n" +" physical same as -P\n" +" pipefail the return value of a pipeline is the status of\n" +" the last command to exit with a non-zero status,\n" +" or zero if no command exited with a non-zero " +"status\n" +" posix change the behavior of bash where the default\n" +" operation differs from the Posix standard to\n" +" match the standard\n" +" privileged same as -p\n" +" verbose same as -v\n" +" vi use a vi-style line editing interface\n" +" xtrace same as -x\n" +" -p Turned on whenever the real and effective user ids do not match.\n" +" Disables processing of the $ENV file and importing of shell\n" +" functions. Turning this option off causes the effective uid and\n" +" gid to be set to the real uid and gid.\n" +" -t Exit after reading and executing one command.\n" +" -u Treat unset variables as an error when substituting.\n" +" -v Print shell input lines as they are read.\n" +" -x Print commands and their arguments as they are executed.\n" +" -B the shell will perform brace expansion\n" +" -C If set, disallow existing regular files to be overwritten\n" +" by redirection of output.\n" +" -E If set, the ERR trap is inherited by shell functions.\n" +" -H Enable ! style history substitution. This flag is on\n" +" by default when the shell is interactive.\n" +" -P If set, do not resolve symbolic links when executing commands\n" +" such as cd which change the current directory.\n" +" -T If set, the DEBUG trap is inherited by shell functions.\n" +" -- Assign any remaining arguments to the positional parameters.\n" +" If there are no remaining arguments, the positional parameters\n" +" are unset.\n" +" - Assign any remaining arguments to the positional parameters.\n" +" The -x and -v options are turned off.\n" +" \n" +" Using + rather than - causes these flags to be turned off. The\n" +" flags can also be used upon invocation of the shell. The current\n" +" set of flags may be found in $-. The remaining n ARGs are positional\n" +" parameters and are assigned, in order, to $1, $2, .. $n. If no\n" +" ARGs are given, all shell variables are printed.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given." +msgstr "" +"Donu aÅ­ forprenu valorojn de ŝelvariabloj kaj numerparametroj.\n" +"\n" +" Ŝanĝu la valoron de ŝelatributoj kaj numerparametroj, aÅ­ vidigu la\n" +" nomojn kaj valorojn de ŝelvariabloj.\n" +"\n" +" Opcioj:\n" +" -a\tMarku eksportendaj la variablojn ŝanĝitajn aÅ­ kreitajn\n" +" -b\tTuj sciigu pri finiĝo de fonaj laboroj\n" +" -e\tEliru tuj se ajna komando finiĝis kun elirstato alia ol 0\n" +" -f\tMalŝaltu generadon de dosiernomoj (globbing)\n" +" -h\tRegistru en hakettabelo la situon de komandoj serĉataj\n" +" -k\tĈiujn valorizojn en ajna parto de komandolinio rigardu\n" +"\tkiel valorizojn de ŝelvariabloj por la labormedio de la\n" +"\tkomando, ne nur la valorizojn antaÅ­ la komandonomo\n" +" -m\tAktivigu la laborregadon\n" +" -n\tLegu la komandojn sen plenumi ilin\n" +" -o OPCINOMO\n" +"\tAktivigu la variablon respondan al la OPCIONOMO:\n" +"\t allexport\tsamkiel -a\n" +"\t braceexpand\tsamkiel -B\n" +"\t emacs\tuzu emakseskan interfacon por liniredaktado\n" +"\t errexit\tsamkiel -e\n" +"\t errtrace\tsamkiel -E\n" +"\t functrace\tsamkiel -T\n" +"\t hashall\tsamkiel -h\n" +"\t histexpand\tsamkiel -H\n" +"\t history\tebligu komandohistorion\n" +"\t ignoreeof\tla ŝelo ne finiĝu leginte dosierfinilon\n" +"\t interactive-comments\n" +"\t\t\ttoleru komentojn en dialogaj komandoj\n" +"\t keyword\tsamkiel -k\n" +"\t monitor\tsamkiel -m\n" +"\t noclobber\tsamkiel -C\n" +"\t noexec\tsamkiel -n\n" +"\t noglob\tsamkiel -f\n" +"\t notify\tsamkiel -b\n" +"\t nounset\tsamkiel -u\n" +"\t onecmd\tsamkiel -t\n" +"\t physical\tsamkiel -P\n" +"\t pipefail\tla elirstato de dukto estu la elirstato\n" +"\t\t\tde la lasta komando finiĝinta nenule, aÅ­\n" +"\t\t\t0, se neniu komando alie finiĝis\n" +"\t posix\tŝanĝu la konduton de Baŝo ĉie kie ĝia defaÅ­lta\n" +"\t\t\tfunkciado devias disde Pozikso, tiel ke ĝi\n" +"\t\t\tkonformu al tiu normo\n" +"\t privileged\tsamkiel -p\n" +"\t verbose\tsamkiel -v\n" +"\t vi\t\tuzu vi-eskan interfacon por liniredaktado\n" +"\t xtrace\tsamkiel -x\n" +" -p\tPrivilegia reĝimo, aktiviĝas meme kiam la reala kaj efektiva\n" +"\tidentoj de la uzanto malkongruas. La dosiero $ENV ne estas\n" +"\ttraktata, nek la ŝelfunkcioj, importataj el la medio.\n" +"\tMalaktivigo de tiu opcio ŝanĝas la efektivajn uid kaj gid\n" +"\tlaÅ­ la realaj uid kaj gid\n" +" -t\tFinu la ŝelon leginte kaj plenuminte unu komandon\n" +" -u\tProvo anstataÅ­igi senvaloran variablon estu eraro\n" +" -v\tEligu la komandoliniojn legatajn\n" +" -x\tEligu la plenumotajn komandojn kaj iliajn argumentojn\n" +" -B\tLa ŝelo faru vinkulmalvolvon\n" +" -C\tSe aktiva, malebligu skribdifekti ekzistantajn ordinarajn\n" +"\tdosierojn per alidirektado de la eligo\n" +" -E\tSe aktiva, la ERR-kaptilon (ERR trap) heredas la ŝelaj\n" +"\tfunkcioj\n" +" -H\tEbligu atingi la historion !-stile. DefaÅ­lte la opcio estas\n" +"\taktiva en la dialogaj ŝeloj.\n" +" -P\tLa simbolaj ligiloj estu travideblaj ĉe plenumo de komandoj\n" +"\tkiuj ŝanĝas la kurantan dosierujon („cd‟ ktp uzu «fizikan»\n" +"\tinterpreton de vojnomo).\n" +" -T\tSe aktiva, la DEBUG-kaptilon (DEBUG trap) heredas la ŝelaj\n" +"\tfunkcioj\n" +" --\tLa restantajn argumentojn uzu por valorizi la numerparametrojn.\n" +"\tSe tiaj argumentoj mankas, malvalorizu la numerparametrojn.\n" +" -\tLa restantajn argumentojn uzu por valorizi la numerparametrojn.\n" +"\tLa opcioj -x kaj -v malaktiviĝas.\n" +"\n" +" Uzante la signon + anstataÅ­ - vi povas malŝalti la opcion. La\n" +" opciojn ankaÅ­ eblas uzi ĉe la voko de la ŝelo. La kuranta aro da\n" +" aktivaj opcioj troveblas en $-. La restantaj n argumentoj ARG\n" +" iĝas valoroj de la numervariabloj $1, $2 ... $n (en tiu ordo).\n" +" Senargumente, eligu ĉiujn ŝelvariablojn.\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se renkontiĝas misa opcio." + +# unset [-f] [-v] [name ...] +# unset [-f] [-v] [NOMO ...] +#: builtins.c:1126 +msgid "" +"Unset values and attributes of shell variables and functions.\n" +" \n" +" For each NAME, remove the corresponding variable or function.\n" +" \n" +" Options:\n" +" -f\ttreat each NAME as a shell function\n" +" -v\ttreat each NAME as a shell variable\n" +" -n\ttreat each NAME as a name reference and unset the variable itself\n" +" \trather than the variable it references\n" +" \n" +" Without options, unset first tries to unset a variable, and if that " +"fails,\n" +" tries to unset a function.\n" +" \n" +" Some variables cannot be unset; also see `readonly'.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a NAME is read-only." +msgstr "" +"Forviŝu valorojn kaj atributojn de ŝelaj funkcioj kaj variabloj\n" +"\n" +" Por ĉiu NOMO, forviŝu la respondan variablon aÅ­ funkcion.\n" +"\n" +" Opcioj:\n" +" -f\ttraktu ĉiun NOMOn kiel funkcion\n" +" -v traktu ĉiun NOMOn kiel variablon\n" +" -n traktu ĉiun NOMOn kiel nomreferencon, kaj senvalorigu ĝin mem\n" +" (kaj ne la referencatan variablon)\n" +" \n" +" Se neniu el la du opcioj estas indikita, „unset‟ unue provos\n" +" forviŝi variablon, kaj se tia ne troviĝos, funkcion.\n" +"\n" +" Iujn variablojn ne eblas forviŝi. Vd ankaÅ­ la helpon pri „readonly‟.\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se aperis misa opcio aÅ­ NOMO estas nurlega." + +# export [-fn] [name[=value] ...] or export -p +# export [-fn] [NOMO[=VALORO] ...] aÅ­ export -p +#: builtins.c:1148 +msgid "" +"Set export attribute for shell variables.\n" +" \n" +" Marks each NAME for automatic export to the environment of subsequently\n" +" executed commands. If VALUE is supplied, assign VALUE before " +"exporting.\n" +" \n" +" Options:\n" +" -f\trefer to shell functions\n" +" -n\tremove the export property from each NAME\n" +" -p\tdisplay a list of all exported variables and functions\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" +"Marku ŝelvariablojn kiel eksportajn\n" +"\n" +" Marku la NOMOjn por aÅ­tomata eksporto en la medion de la\n" +" plenumotaj komandoj. Se ĉeestas VALORO, uzu ĝin por valorizi\n" +" NOMOn antaÅ­ ol eksporti.\n" +"\n" +" Opcioj:\n" +" -f\ttemas pri ŝelfunkcioj\n" +" -n\tforviŝu la eksportomarkon de la NOMOj\n" +" -p\teligu la liston de ĉiuj eksportaj variabloj kaj funkcioj\n" +"\n" +" La opcio „--‟ ĉesigas pluan opcitraktadon.\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se aperis nevalida NOMO aÅ­ misa opcio." + +# readonly [-aAf] [name[=value] ...] or readonly -p +# readonly [-aAf] [NOMO[=VALORO] ...] aÅ­ readonly -p +#: builtins.c:1167 +msgid "" +"Mark shell variables as unchangeable.\n" +" \n" +" Mark each NAME as read-only; the values of these NAMEs may not be\n" +" changed by subsequent assignment. If VALUE is supplied, assign VALUE\n" +" before marking as read-only.\n" +" \n" +" Options:\n" +" -a\trefer to indexed array variables\n" +" -A\trefer to associative array variables\n" +" -f\trefer to shell functions\n" +" -p\tdisplay a list of all readonly variables or functions, depending " +"on\n" +" whether or not the -f option is given\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" +"Faru ŝelvariablojn neŝanĝeblaj\n" +"\n" +" La donitaj NOMOj iĝas nurlegaj kaj la valorojn de tiuj nomoj\n" +" ne povas ŝanĝi posta valorizo. Se ĉeestas VALORO, uzu ĝin por\n" +" valorizi la NOMOn antaÅ­ ol fari ĝin nurlega.\n" +"\n" +" Opcioj:\n" +" -a\ttemas pri entjerindica tabelo indikita per plursignifa NOMO\n" +" -A\ttemas pri la asocitabela signifo de plursignifa NOMO\n" +" -f\ttemas pri la ŝelfunkcia signifo de plursignifa NOMO\n" +" -p\teligu ĉiujn nurlegajn variablojn aÅ­ funkciojn, depende je\n" +" tio, ĉu la opcio „-f“ estas aldonita\n" +"\n" +" La opcio „--‟ ĉesigas pluan opcitraktadon.\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se aperas nevalida nomo aÅ­ misa opcio." + +# shift [n] +#: builtins.c:1189 +msgid "" +"Shift positional parameters.\n" +" \n" +" Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n" +" not given, it is assumed to be 1.\n" +" \n" +" Exit Status:\n" +" Returns success unless N is negative or greater than $#." +msgstr "" +"Ŝovu numerparametrojn\n" +"\n" +" La numerparametrojn $N+1, $N+2 ... renumeru al $1, $2 ...\n" +" Se N ne estas indikita, uzu 1 anstataÅ­e." + +# source filename [arguments] +# source DOSIERNOMO [ARGUMENTOJ] +#: builtins.c:1201 builtins.c:1216 +msgid "" +"Execute commands from a file in the current shell.\n" +" \n" +" Read and execute commands from FILENAME in the current shell. The\n" +" entries in $PATH are used to find the directory containing FILENAME.\n" +" If any ARGUMENTS are supplied, they become the positional parameters\n" +" when FILENAME is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed in FILENAME; fails if\n" +" FILENAME cannot be read." +msgstr "" +"Plenumu komandojn el dosiero en la kuranta ŝelo\n" +"\n" +" Legu kaj plenumu la komandojn el DOSIERNOMO en la kuranta ŝelo.\n" +" Uzu la vojojn el la variablo $PATH por trovi la dosierujon de\n" +" DOSIERNOMO. La eventualaj ARGUMENTOJ iĝas la numerparametroj por\n" +" plenumo de DOSIERNOMO.\n" +"\n" +" Elirstato:\n" +" Tiu de la komando laste plenumita en DOSIERNOMO; malsukceso, se\n" +" DOSIERNOMO ne legeblas." + +# suspend [-f] +#: builtins.c:1232 +msgid "" +"Suspend shell execution.\n" +" \n" +" Suspend the execution of this shell until it receives a SIGCONT signal.\n" +" Unless forced, login shells cannot be suspended.\n" +" \n" +" Options:\n" +" -f\tforce the suspend, even if the shell is a login shell\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Haltetigu la plenumon de la ŝelo\n" +"\n" +" Haltetigu la plenumon de la ŝelo ĝis ĝi ricevos la signalon SIGCONT.\n" +" Krom se per superforto, salutan ŝelon ne eblas haltetigi.\n" +"\n" +" Opcio:\n" +" -f\tSuperforte haltetu, eĉ se la ŝelo estas saluta ŝelo\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se laborregado estas malŝaltita aÅ­ okazis eraro." + +# test [expr] +# test [ESPRIMO] +#: builtins.c:1248 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" Exits with a status of 0 (true) or 1 (false) depending on\n" +" the evaluation of EXPR. Expressions may be unary or binary. Unary\n" +" expressions are often used to examine the status of a file. There\n" +" are string operators and numeric comparison operators as well.\n" +" \n" +" The behavior of test depends on the number of arguments. Read the\n" +" bash manual page for the complete specification.\n" +" \n" +" File operators:\n" +" \n" +" -a FILE True if file exists.\n" +" -b FILE True if file is block special.\n" +" -c FILE True if file is character special.\n" +" -d FILE True if file is a directory.\n" +" -e FILE True if file exists.\n" +" -f FILE True if file exists and is a regular file.\n" +" -g FILE True if file is set-group-id.\n" +" -h FILE True if file is a symbolic link.\n" +" -L FILE True if file is a symbolic link.\n" +" -k FILE True if file has its `sticky' bit set.\n" +" -p FILE True if file is a named pipe.\n" +" -r FILE True if file is readable by you.\n" +" -s FILE True if file exists and is not empty.\n" +" -S FILE True if file is a socket.\n" +" -t FD True if FD is opened on a terminal.\n" +" -u FILE True if the file is set-user-id.\n" +" -w FILE True if the file is writable by you.\n" +" -x FILE True if the file is executable by you.\n" +" -O FILE True if the file is effectively owned by you.\n" +" -G FILE True if the file is effectively owned by your group.\n" +" -N FILE True if the file has been modified since it was last " +"read.\n" +" \n" +" FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" +" modification date).\n" +" \n" +" FILE1 -ot FILE2 True if file1 is older than file2.\n" +" \n" +" FILE1 -ef FILE2 True if file1 is a hard link to file2.\n" +" \n" +" String operators:\n" +" \n" +" -z STRING True if string is empty.\n" +" \n" +" -n STRING\n" +" STRING True if string is not empty.\n" +" \n" +" STRING1 = STRING2\n" +" True if the strings are equal.\n" +" STRING1 != STRING2\n" +" True if the strings are not equal.\n" +" STRING1 < STRING2\n" +" True if STRING1 sorts before STRING2 " +"lexicographically.\n" +" STRING1 > STRING2\n" +" True if STRING1 sorts after STRING2 lexicographically.\n" +" \n" +" Other operators:\n" +" \n" +" -o OPTION True if the shell option OPTION is enabled.\n" +" -v VAR\t True if the shell variable VAR is set\n" +" -R VAR\t True if the shell variable VAR is set and is a name " +"reference.\n" +" ! EXPR True if expr is false.\n" +" EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n" +" EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n" +" \n" +" arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Arithmetic binary operators return true if ARG1 is equal, not-equal,\n" +" less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n" +" than ARG2.\n" +" \n" +" Exit Status:\n" +" Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n" +" false or an invalid argument is given." +msgstr "" +"Komputu kondiĉan esprimon\n" +"\n" +" Liveru elirstaton 0 (vera) aÅ­ 1 (malvera) laÅ­ la rezulto de\n" +" komputado de la ESPRIMO. La esprimoj povas esti unulokaj aÅ­\n" +" dulokaj. La unulokaj plejparte servas por determini la statuson\n" +" de dosiero. Krome, estas operacioj super ĉenoj kaj la\n" +" nombrokomparaj operacioj.\n" +"\n" +" La konduto de test-komando dependas je la kiomo de ĝiaj argumentoj.\n" +" Plenan priskribon donas «man bash».\n" +"\n" +" Operacioj super dosieroj:\n" +"\n" +"\t-a DOSIERO\tVera se DOSIERO ekzistas\n" +"\t-b DOSIERO\tVera se DOSIERO estas por bloka eneligo\n" +"\t-c DOSIERO\tVera se DOSIERO estas por bajta eneligo\n" +"\t-d DOSIERO\tVera se DOSIERO estas dosierujo\n" +"\t-e DOSIERO\tVera se DOSIERO ekzistas\n" +"\t-f DOSIERO\tVera se DOSIERO ekzistas kaj estas ordinara\n" +"\t-g DOSIERO\tVera se DOSIERO havas set-group-id = 1\n" +"\t-h DOSIERO\tVera se DOSIERO estas simbola ligilo\n" +"\t-L DOSIERO\tVera se DOSIERO estas simbola ligilo\n" +"\t-k DOSIERO\tVera se la DOSIERO havas sticky = 1\n" +"\t-p DOSIERO\tVera se DOSIERO estas nomhava dukto\n" +"\t-r DOSIERO\tVera se vi rajtas legi DOSIEROn\n" +"\t-s DOSIERO\tVera se DOSIERO ekzistas kaj longas pli ol 0\n" +"\t-S DOSIERO\tVera se DOSIERO estas kontaktingo („socket‟)\n" +"\t-t DNUMERO\tVera se la dosiero DNUMERO estas terminala\n" +"\t-u DOSIERO\tVera se DOSIERO havas set-user-id = 1\n" +"\t-w DOSIERO\tVera se vi rajtas skribi en DOSIEROn\n" +"\t-x DOSIERO\tVera se vi rajtas lanĉi DOSIEROn\n" +"\t-O DOSIERO\tVera se DOSIERO estas via dosiero\n" +"\t-G DOSIERO\tVera se DOSIERO apartenas al via grupo\n" +"\t-N DOSIERO\tVera se DOSIERO ŝanĝiĝis post la lasta lego\n" +"\n" +"\tD_RO1 -nt D_RO2\tVera se la dosiero D_RO1 estas pli freŝa\n" +"\t\t\t(laÅ­ la ŝanĝodato) ol la dosiero D_RO2\n" +"\tD_RO1 -ot D_RO2\tVera se D_RO1 estas malpli freŝas ol D_RO2\n" +"\tD_RO1 -ef D_RO2\tVera se D_RO1 estas rekta ligilo al D_RO2\n" +"\n" +" Operacioj super ĉenoj:\n" +"\n" +"\t-z ĈENO\t\tVera se ĈENO estas vakua\n" +"\t-n ĈENO\t\tVera se ĈENO ne estas vakua\n" +"\tĈENO\t\tVera se ĈENO ne estas vakua\n" +"\tĈENO1 = ĈENO2\tVera se la ĉenoj estas egalaj\n" +"\tĈENO1 != ĈENO2\tVera se la ĉenoj ne estas egalaj\n" +"\tĈENO1 < ĈENO2\tVera se ĈENO1 leksikografie antaÅ­as la\n" +"\t\t\tĉenon ĈENO2\n" +"\tĈENO1 > ĈENO2\tVera se ĈENO1 leksikografie sekvas la\n" +"\t\t\tĉenon ĈENO2\n" +"\n" +" Diversaj operacioj:\n" +"\n" +" -o OPCIO Vera se la ŝelopcio OPCIO estas ŝaltita\n" +" -v VAR Vera se la ŝelvariablo VAR havas valoron\n" +" -R VAR Vera se la ŝelvariablo VAR havas valoron kaj\n" +" estas nomreferenco\n" +"\t! ESPR\t\tVera se la esprimo ESPR estas malvera\n" +"\tESPR1 -a ESPR2\tVera se ambaÅ­ esprimoj estas veraj\n" +"\tESPR1 -o ESPR2\tVera se ajna el la esprimoj estas vera\n" +"\n" +"\targ1 KP arg2\tAritmetikaj komparoj. KP estas iu el la\n" +"\t\t\trilatoj -eq, -ne, -lt, -le, -gt, -ge\n" +"\n" +" La aritmetikaj komparoj liveras veron se arg1 estas respektive\n" +" egala, neegala, malplia ol, malplia aÅ­ egala al, plia ol,\n" +" plia aÅ­ egala al arg2.\n" +"\n" +" Elirstato:\n" +" Sukceso, se la rezulto de la komputo de ESPRIMO estas vero;\n" +" malsukceso, se la rezulto estas malvero aÅ­ renkontiĝas misa\n" +" argumento." + +# [ arg... ] +#: builtins.c:1329 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" This is a synonym for the \"test\" builtin, but the last argument must\n" +" be a literal `]', to match the opening `['." +msgstr "" +"Ĉi tiu estas sinonimo de la primitivo „test‟; tamen la lasta\n" +" argumento devas esti „]‟ fermanta la esprimon komencitan per „[‟." + +#: builtins.c:1338 +msgid "" +"Display process times.\n" +" \n" +" Prints the accumulated user and system times for the shell and all of " +"its\n" +" child processes.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Vidigu proceztempojn\n" +"\n" +" Eligu la tempojn akumulitajn de la uzanto kaj de la kerno\n" +" por la ŝelo kaj ĝiaj procezidoj.\n" +"\n" +" Elirstato:\n" +" Ĉiam sukcesa." + +# trap [-lp] [[arg] signal_spec ...] +# trap [-lp] [[ARG] SIGNALINDIKO ...] +#: builtins.c:1350 +msgid "" +"Trap signals and other events.\n" +" \n" +" Defines and activates handlers to be run when the shell receives " +"signals\n" +" or other conditions.\n" +" \n" +" ARG is a command to be read and executed when the shell receives the\n" +" signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n" +" is supplied) or `-', each specified signal is reset to its original\n" +" value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" +" shell and by the commands it invokes.\n" +" \n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. " +"If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. " +"If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or " +"a\n" +" script run by the . or source builtins finishes executing. A " +"SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause " +"the\n" +" shell to exit when the -e option is enabled.\n" +" \n" +" If no arguments are supplied, trap prints the list of commands " +"associated\n" +" with each signal.\n" +" \n" +" Options:\n" +" -l\tprint a list of signal names and their corresponding numbers\n" +" -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" +" \n" +" Each SIGNAL_SPEC is either a signal name in or a signal " +"number.\n" +" Signal names are case insensitive and the SIG prefix is optional. A\n" +" signal may be sent to the shell with \"kill -signal $$\".\n" +" \n" +" Exit Status:\n" +" Returns success unless a SIGSPEC is invalid or an invalid option is " +"given." +msgstr "" +"Kaptu signalojn kaj aliajn eventojn\n" +"\n" +" Difinu kaj aktivigu traktilojn plenumotajn kiam ŝelo ricevos\n" +" signalojn aÅ­ ĉe aliaj kondiĉoj.\n" +"\n" +" La komando ARG estas legota kaj plenumota kiam la ŝelo ricevos\n" +" signalon el SIGNALINDIKO. Se ARG malestas (kaj SIGNALINDIKO\n" +" konsistas el unu sola signalo) aÅ­ estas „-‟, ĉiuj indikitaj\n" +" signaloj rericevas sian komencan valoron. Se ARG estas vakua\n" +" ĉeno, la ŝelo mem kaj komandoj el ĝi vokitaj malatentos ĉiujn\n" +" signalojn de SIGNALINDIKO.\n" +"\n" +" Se inter la signaloj SIGNALINDIKO estas „EXIT‟ (aÅ­ 0), tiam ARG de\n" +" la komando plenumiĝos ĉe la eliro el la ŝelo. Se en SIGNALINDIKO\n" +" estas „DEBUG‟, ARG plenumiĝos post ĉiu komando. Se en\n" +" SIGNALINDIKO estas „RETURN“, ARG plenumiĝos ĉiufoje kiam finiĝas\n" +" skripto rulata per komando „.“ aÅ­ „source“. La SIGNALINDIKO „ERR“\n" +" igas ARGon plenumiĝi ĉiufoje kiam malsukceso de komando kaÅ­zus\n" +" eliron el la ŝelo havanta la opcion „-e“ ŝaltita.\n" +"\n" +" Senargumente trap listigas komandojn plenumotajn laÅ­ ĉiu signalo.\n" +"\n" +" Opcioj:\n" +" -l\tlistigu la signalnomojn kun la numeroj\n" +" -p vidigu la trap-komandojn por trakti ĉiun SIGNALINDIKOn\n" +"\n" +" Ĉiu SIGNALINDIKO estas aÅ­ signalnomo el , aÅ­\n" +" signalnumero. La signalnomoj estas usklecoblindaj, kaj la\n" +" prefikso „SIG‟ estas ellasebla. Signalon S oni povas sendi al la\n" +" ŝelo per la komando «kill -S $$».\n" +"\n" +" Elirstato:\n" +" Sukceso, kondiĉe ke SIGNALINDIKOj kaj la opcioj estas taÅ­gaj." + +# type [-afptP] name [name ...] +# type [-afptP] NOMO [NOMO ...] +#: builtins.c:1386 +msgid "" +"Display information about command type.\n" +" \n" +" For each NAME, indicate how it would be interpreted if used as a\n" +" command name.\n" +" \n" +" Options:\n" +" -a\tdisplay all locations containing an executable named NAME;\n" +" \tincludes aliases, builtins, and functions, if and only if\n" +" \tthe `-p' option is not also used\n" +" -f\tsuppress shell function lookup\n" +" -P\tforce a PATH search for each NAME, even if it is an alias,\n" +" \tbuiltin, or function, and returns the name of the disk file\n" +" \tthat would be executed\n" +" -p\treturns either the name of the disk file that would be executed,\n" +" \tor nothing if `type -t NAME' would not return `file'.\n" +" -t\toutput a single word which is one of `alias', `keyword',\n" +" \t`function', `builtin', `file' or `', if NAME is an alias, shell\n" +" \treserved word, shell function, shell builtin, disk file, or not\n" +" \tfound, respectively\n" +" \n" +" Arguments:\n" +" NAME\tCommand name to be interpreted.\n" +" \n" +" Exit Status:\n" +" Returns success if all of the NAMEs are found; fails if any are not " +"found." +msgstr "" +"Vidigu informon pri tipo de komando\n" +"\n" +" Por ĉiu NOMO, montru kion ĝi signifus en la pozicio de\n" +" komadonomo.\n" +"\n" +" Opcioj:\n" +" -a\tlistigu ĉiujn lokojn entenantajn plenumeblan dosieron\n" +" kun koncerna NOMO; la listo inkludas alinomojn kaj\n" +" funkciojn, se kaj nur se malestas la opcio „-p‟\n" +" -f ekskludas el la serĉo la ŝelfunkciojn\n" +" -P\tapliku vojserĉon laÅ­ PATH por ĉiu NOMO, eĉ se ekzistas tianoma\n" +" funkcio, primitiva komando aÅ­ alinomo, kaj liveru la nomon de\n" +" tiel plenumebla diskdosiero\n" +" -p\teligu la nomon de dosiero kiu iĝus plenumata;\n" +" aÅ­ nenion, se «type -t name» ne eligus „file‟\n" +" -t\teligu unu vorton, iun el la sekvaj:\n" +" „alias‟, „keyword‟, „function‟, „builtin‟, „file‟ aÅ­ „‟ --\n" +" se NOMO estas, respektive, alinomo, ŝela ŝlosilvorto,\n" +" ŝelfunkcio, ŝela primitivo, dosiero aÅ­ nenio konata\n" +"\n" +" Argumentoj:\n" +" NOMO Esplorenda komandonomo\n" +"\n" +" Elirstato:\n" +" Sukceso, se ĉiujn NOMOjn prosperis trovi; malsukceso, se estis\n" +" netrovitaj." + +# ulimit [-SHacdefilmnpqrstuvx] [limit] +# ulimit [-SHacdefilmnpqrstuvx] [LIMO] +#: builtins.c:1417 +msgid "" +"Modify shell resource limits.\n" +" \n" +" Provides control over the resources available to the shell and " +"processes\n" +" it creates, on systems that allow such control.\n" +" \n" +" Options:\n" +" -S\tuse the `soft' resource limit\n" +" -H\tuse the `hard' resource limit\n" +" -a\tall current limits are reported\n" +" -b\tthe socket buffer size\n" +" -c\tthe maximum size of core files created\n" +" -d\tthe maximum size of a process's data segment\n" +" -e\tthe maximum scheduling priority (`nice')\n" +" -f\tthe maximum size of files written by the shell and its children\n" +" -i\tthe maximum number of pending signals\n" +" -l\tthe maximum size a process may lock into memory\n" +" -m\tthe maximum resident set size\n" +" -n\tthe maximum number of open file descriptors\n" +" -p\tthe pipe buffer size\n" +" -q\tthe maximum number of bytes in POSIX message queues\n" +" -r\tthe maximum real-time scheduling priority\n" +" -s\tthe maximum stack size\n" +" -t\tthe maximum amount of cpu time in seconds\n" +" -u\tthe maximum number of user processes\n" +" -v\tthe size of virtual memory\n" +" -x\tthe maximum number of file locks\n" +" -T the maximum number of threads\n" +" \n" +" Not all options are available on all platforms.\n" +" \n" +" If LIMIT is given, it is the new value of the specified resource; the\n" +" special LIMIT values `soft', `hard', and `unlimited' stand for the\n" +" current soft limit, the current hard limit, and no limit, respectively.\n" +" Otherwise, the current value of the specified resource is printed. If\n" +" no option is given, then -f is assumed.\n" +" \n" +" Values are in 1024-byte increments, except for -t, which is in seconds,\n" +" -p, which is in increments of 512 bytes, and -u, which is an unscaled\n" +" number of processes.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Ŝanĝu risurcolimaĵojn de la ŝelo.\n" +"\n" +" La komando „ulimit‟ ebligas mastrumi la risurcojn disponeblajn al\n" +" la procezoj lanĉataj el la ŝelo (se la operaciumo ebligas tion).\n" +"\n" +" Opcioj:\n" +" -S ŝanĝebla („soft‟) limo\n" +" -H firma („hard‟) limo\n" +" -a eligu ĉiujn kurantajn risurcolimaĵojn\n" +" -b la kontaktoskatola bufrolongo\n" +" -c maksimuma longo de nekropsia dosiero („core‟)\n" +" -d maksimuma longo de datumsegmento de procezo\n" +" -e maksimuma viciga prioritato („nice‟)\n" +" -i maksimuma longo de pendaj signaloj\n" +" -f maksimuma longo de dosieroj skribataj de la ŝelo kaj ĝiaj idoj\n" +" -l maksimuma longo de ŝlosebla procezmemoro (mlock)\n" +" -m maksimuma longo de rezida procezmemoro\n" +" -n maksimuma nombro de malfermitaj dosiernumeroj\n" +" -p longo de dukta bufro (pipe)\n" +" -q maksimuma nombro da bajtoj en atendovicoj de Poziksaj mesaĝoj\n" +" -r maksimuma prioritato realtempa\n" +" -s maksimuma longo de stako\n" +" -t maksimuma tempo ĉefprocesora (en sekundoj)\n" +" -u maksimuma nombro de procezoj de la uzanto\n" +" -v longo de la virtuala memoro\n" +" -x maksimuma nombro de dosierŝlosoj\n" +" -T maksimuma nombro de fadenoj\n" +"\n" +" Ne ĉiuj opcioj disponeblas sur ĉiuj komputilaj platformoj.\n" +"\n" +" Se LIMO estas indikita, ĝia valoro limigas la koncernan risurcon;\n" +" la specialaj vortoj por LIMO: „soft‟, „hard‟, „unlimited‟\n" +" signifas, respektive: «la kuranta ŝanĝebla limo», «la kuranta\n" +" firma limo», «sen limo». Alie estas eligata la kuranta valoro de\n" +" la koncerna risurco. Manko de opcioj implicas -f.\n" +"\n" +" La valoroj estas en obloj de 1024 bajtoj, krom por la opcio -t,\n" +" kiu estas en sekundoj; por -p, kiu estas en obloj de 512 bajtoj;\n" +" kaj por -u, kiu estas sendimensia nombro de procezoj.\n" +"\n" +" Elirstato:\n" +" Sukceso, kondiĉe ke la opcioj estas taÅ­gaj kaj ne okazis eraro." + +# umask [-p] [-S] [mode] +# umask [-p] [-S] [REĜIMO] +#: builtins.c:1465 +msgid "" +"Display or set file mode mask.\n" +" \n" +" Sets the user file-creation mask to MODE. If MODE is omitted, prints\n" +" the current value of the mask.\n" +" \n" +" If MODE begins with a digit, it is interpreted as an octal number;\n" +" otherwise it is a symbolic mode string like that accepted by chmod(1).\n" +" \n" +" Options:\n" +" -p\tif MODE is omitted, output in a form that may be reused as input\n" +" -S\tmakes the output symbolic; otherwise an octal number is output\n" +" \n" +" Exit Status:\n" +" Returns success unless MODE is invalid or an invalid option is given." +msgstr "" +"Vidigu aÅ­ agordu dosierreĝiman maskon\n" +"\n" +" La dosierkrea masko de la uzanto havu la valoron de la argumento\n" +" REĜIMO. Se REĜIMO mankas, eligu la kurantan valoron de la masko.\n" +"\n" +" Se la argumento REĜIMO komenciĝas per cifero, ĝi estas\n" +" interpretata kiel okuma nombro; alie, kiel simbola signoĉeno\n" +" laÅ­ chmod(1).\n" +"\n" +" Opcioj:\n" +" -p\tse REĜIMO malestas, la eligaĵo havu formon taÅ­gan por enigo\n" +" -S\tla eligo estu simbola; alie ĝi estas okuma nombro\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se REĜIMO estas nevalida aÅ­ aperas misa opcio." + +# wait [-n] [id ...] +# wait [-n] [IND ...] +#: builtins.c:1485 +msgid "" +"Wait for job completion and return exit status.\n" +" \n" +" Waits for each process identified by an ID, which may be a process ID or " +"a\n" +" job specification, and reports its termination status. If ID is not\n" +" given, waits for all currently active child processes, and the return\n" +" status is zero. If ID is a a job specification, waits for all " +"processes\n" +" in that job's pipeline.\n" +" \n" +" If the -n option is supplied, waits for the next job to terminate and\n" +" returns its exit status.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last ID; fails if ID is invalid or an invalid\n" +" option is given." +msgstr "" +"Atendu ke laboroj finiĝu, kaj liveru elirstaton.\n" +"\n" +" Atendu finiĝon de ĉiu procezo indikita per IND (kiu povas esti\n" +" proceznumero aÅ­ laborindiko) kaj liveru ĝian elirstaton. Se IND\n" +" malestas, atendu ĉiujn aktivajn procezidojn, kaj liveru la \n" +" elirstaton 0. Se IND estas laborindiko, atendu ĉiujn procezojn en\n" +" la dukto de la laboro.\n" +"\n" +" Kun la opcio „-n“: atendi finiĝon de la sekva laboro kaj liveru\n" +" ĝian elirstaton.\n" +"\n" +" Elirstato:\n" +" Tiu de la lasta IND; malsukceso, se IND estas nevalida aÅ­ se\n" +" renkontiĝas nevalida opcio.<" + +# wait [pid ...] +# wait [PN ...] +#: builtins.c:1506 +msgid "" +"Wait for process completion and return exit status.\n" +" \n" +" Waits for each process specified by a PID and reports its termination " +"status.\n" +" If PID is not given, waits for all currently active child processes,\n" +" and the return status is zero. PID must be a process ID.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last PID; fails if PID is invalid or an " +"invalid\n" +" option is given." +msgstr "" +"Atendu ke procezoj finiĝu, kaj liveru elirstaton\n" +"\n" +" Atendu finiĝon de ĉiu indikita procezoj kaj liveru ĝian elirstaton.\n" +" Se PN malestas, atendu ĉiujn aktivajn procezidojn, kaj liveru la\n" +" elirstaton 0. PN devas esti proceznumero.\n" +"\n" +" Elirstato:\n" +" Tiu de la lasta PN; malsukceso, se PN estas nevalida aÅ­ se\n" +" renkontiĝas nevalida opcio." + +# for NAME [in WORDS ... ] ; do COMMANDS; done +# for NOMO [in VORTOJ ... ] ; do KOMANDOJ; done +#: builtins.c:1521 +msgid "" +"Execute commands for each member in a list.\n" +" \n" +" The `for' loop executes a sequence of commands for each member in a\n" +" list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is\n" +" assumed. For each element in WORDS, NAME is set to that element, and\n" +" the COMMANDS are executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Plenumu komandojn por ĉiu ero de listo\n" +"\n" +" La iteracio „for‟ plenumas la KOMANDOJn por ĉiu ero de sia listo.\n" +" Se la parto «in VORTOJ ...;» malestas, «in \"$@\"» estas uzata\n" +" anstataÅ­e. Por ĉiu el la VORTOJ, la NOMO estas valorizata per tiu\n" +" ero kaj la KOMANDOJ estas plenumataj.\n" +"\n" +" Elirstato:\n" +" Tiu de la laste plenumita komando." + +# for (( exp1; exp2; exp3 )); do COMMANDS; done +# for (( ESPR1; ESPR2; ESPR3 )); do KOMANDOJ; done +#: builtins.c:1535 +msgid "" +"Arithmetic for loop.\n" +" \n" +" Equivalent to\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n" +" omitted, it behaves as if it evaluates to 1.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Aritmetika iteracio\n" +"\n" +" Ekvivalentas al\n" +"\t(( ESPR1 ))\n" +"\twhile (( ESPR2 )); do\n" +"\t KOMANDOJ\n" +"\t (( ESPR3 ))\n" +"\tdone\n" +" kie ESPR1, ESPR2 kaj ESPR3 estas aritmetikaj esprimoj. Se iu el\n" +" ili malestas, 1 estas uzata anstataÅ­e.\n" +"\n" +" Elirstato:\n" +" Tiu de la laste plenumita komando." + +# select NAME [in WORDS ... ;] do COMMANDS; done +# select NONO [in VORTOJ ... ;] do KOMANDOJ; done +#: builtins.c:1553 +msgid "" +"Select words from a list and execute commands.\n" +" \n" +" The WORDS are expanded, generating a list of words. The\n" +" set of expanded words is printed on the standard error, each\n" +" preceded by a number. If `in WORDS' is not present, `in \"$@\"'\n" +" is assumed. The PS3 prompt is then displayed and a line read\n" +" from the standard input. If the line consists of the number\n" +" corresponding to one of the displayed words, then NAME is set\n" +" to that word. If the line is empty, WORDS and the prompt are\n" +" redisplayed. If EOF is read, the command completes. Any other\n" +" value read causes NAME to be set to null. The line read is saved\n" +" in the variable REPLY. COMMANDS are executed after each selection\n" +" until a break command is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Elektu vortojn el listo kaj plenumu komandojn\n" +"\n" +" Malvolvu VORTOJn, generante liston da vortoj. Tiujn vortojn eligu\n" +" en la ĉeferarujon, ĉiu antaÅ­ate de sia numero. Se „in VORTOJ‟\n" +" malestas, prenu anstataÅ­e la enhavon de \"$@\". Poste eligu la\n" +" inviton laÅ­ la variablo PS3 kaj legu linion el la ĉefenigujo. Se\n" +" la linio konsistas el numero responda al iu el la vortoj eligitaj,\n" +" la NOMO ricevu ĝin kiel sian valoron. Se la linio entenas nenion,\n" +" ripetu VORTOJn kaj la inviton. Ĉe la dosierfino la komando\n" +" finiĝas. Ajna alia enigaĵo vakuigas la variablon NOMO. La legita\n" +" linio konserviĝas en la variablo REPLY. Plenumu la KOMANDOJn post\n" +" ĉiu elekto, ĝis renkontiĝos komando de eliro (break).\n" +"\n" +" Elirstato:\n" +" Tiu de la laste plenumita komando." + +# time [-p] PIPELINE +# time [-p] DUKTO +#: builtins.c:1574 +msgid "" +"Report time consumed by pipeline's execution.\n" +" \n" +" Execute PIPELINE and print a summary of the real time, user CPU time,\n" +" and system CPU time spent executing PIPELINE when it terminates.\n" +" \n" +" Options:\n" +" -p\tprint the timing summary in the portable Posix format\n" +" \n" +" The value of the TIMEFORMAT variable is used as the output format.\n" +" \n" +" Exit Status:\n" +" The return status is the return status of PIPELINE." +msgstr "" +"Raportu tempon konsumitan de dukto\n" +"\n" +" Plenumu la DUKTOn kaj poste eligu tabelon el la reala tempo,\n" +" la ĉefprocesora tempo de la uzanto, kaj la ĉefprocesora tempo\n" +" sistema, konsumitaj por plenumi la DUKTOn, kiam ĝi finĝos.\n" +"\n" +" Opcio:\n" +" -p\tprezentu la tempojn laÅ­ la portebla Poziksa formo\n" +"\n" +" La variablo TIMEFORMAT difinas la formon de la eligaĵo.\n" +"\n" +" Elirstato:\n" +" Tiu de la DUKTO." + +# case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac +# case VORTO in [ŜABLONO [| ŜABLONO]...) KOMANDOJ ;;]... esac +#: builtins.c:1591 +msgid "" +"Execute commands based on pattern matching.\n" +" \n" +" Selectively execute COMMANDS based upon WORD matching PATTERN. The\n" +" `|' is used to separate multiple patterns.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Plenumu komandojn laÅ­ ŝablonkongruo \n" +"\n" +" Plenumu KOMANDOJn kondiĉe ke VORTO kongruas kun ŜABLONO.\n" +" La streko „|‟ servas por disigi ŝablonojn (se pluraj).\n" +"\n" +" Elirstato:\n" +" Tiu de la komando laste plenumita." + +# if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... +# [ else COMMANDS; ] fi +# if KOMANDOJ; then KOMANDOJ;[ elif KOMANDOJ; then KOMANDOJ; ]... +# [ else KOMANDOJ; ] fi +#: builtins.c:1603 +msgid "" +"Execute commands based on conditional.\n" +" \n" +" The `if COMMANDS' list is executed. If its exit status is zero, then " +"the\n" +" `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list " +"is\n" +" executed in turn, and if its exit status is zero, the corresponding\n" +" `then COMMANDS' list is executed and the if command completes. " +"Otherwise,\n" +" the `else COMMANDS' list is executed, if present. The exit status of " +"the\n" +" entire construct is the exit status of the last command executed, or " +"zero\n" +" if no condition tested true.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Plenumu komandojn depende je kondiĉo\n" +"\n" +" Plenumu la komandojn el «if KOMANDOJ». Se la elirstato estas 0,\n" +" tiam plenumu la komandojn el «then KOMANDOJ». Alie, laÅ­vice,\n" +" plenumu la komandoj el «elif KOMANDOJ», kaj se la elirstato\n" +" estas 0, plenumu la komandojn de ties «then KOMANDOJ», post kio\n" +" la komando „if‟ finiĝas. Alie plenumu la komandojn el\n" +" «else KOMANDOJ» (se tiaj enestas). La elirstato estas tiu de la\n" +" lasta komando plenumita, aÅ­ 0 se neniu el la kondiĉoj estis vera." + +# while COMMANDS; do COMMANDS; done +# while KOMANDOJ; do KOMANDOJ; done +#: builtins.c:1620 +msgid "" +"Execute commands as long as a test succeeds.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `while' COMMANDS has an exit status of zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Plenumadu komandojn dum testo sukcesas\n" +"\n" +" Ripete malvolvu kaj plenumu la KOMANDOJn dum la lasta el la\n" +" KOMANDOJ de la „while‟-parto liveras elirstaton 0.\n" +"\n" +" Elirstato:\n" +" Tiu de la komando laste plenumita. " + +# until COMMANDS; do COMMANDS; done +# until KOMANDOJ; do KOMANDOJ; done +#: builtins.c:1632 +msgid "" +"Execute commands as long as a test does not succeed.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `until' COMMANDS has an exit status which is not zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Plenumadu komandojn ĝis kiam testo sukcesos\n" +"\n" +" Ripete malvolvu kaj plenumu la komandojn dum la lasta el la\n" +" KOMANDOJ de la „until‟-parto liveras elirstaton alian ol 0.\n" +"\n" +" Elirstato:\n" +" Tiu de la komando laste plenumita." + +# coproc [NAME] command [redirections] +# coproc [NOMO] KOMANDO [ALIDIREKTADOJ] +#: builtins.c:1644 +msgid "" +"Create a coprocess named NAME.\n" +" \n" +" Execute COMMAND asynchronously, with the standard output and standard\n" +" input of the command connected via a pipe to file descriptors assigned\n" +" to indices 0 and 1 of an array variable NAME in the executing shell.\n" +" The default NAME is \"COPROC\".\n" +" \n" +" Exit Status:\n" +" Returns the exit status of COMMAND." +msgstr "" +"Kreu kunprocezon nomotan NOMO\n" +"\n" +" Plenumu KOMANDOn nesinkrone, konektinte per dukto ĝiajn ĉefelgujon\n" +" kaj ĉefengujon al la dosiernumeroj listigitaj en la tabelo NOMO de\n" +" la kuranta ŝelo ĉe la indicoj 0 kaj 1. La defaÅ­lta NOMO estas\n" +" „COPROC‟.\n" +"\n" +" Elirstato:\n" +" Tiu de KOMANDO." + +# function name { COMMANDS ; } or name () { COMMANDS ; } +# function NOMO { KOMANDOJ ; } aÅ­ NOMO () { KOMANDOJ ; } +#: builtins.c:1658 +msgid "" +"Define shell function.\n" +" \n" +" Create a shell function named NAME. When invoked as a simple command,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is " +"invoked,\n" +" the arguments are passed to the function as $1...$n, and the function's\n" +" name is in $FUNCNAME.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is readonly." +msgstr "" +"Difinu ŝelfunkcion\n" +"\n" +" Kreu ŝelfunkcion kun NOMO. Vokite kiel simpla komando, NOMO\n" +" plenumas la KOMANDOJn en la medio de la vokanta ŝelo. Ĉe voko de\n" +" NOMO la komandoliniajn argumentojn la funkcio ricevas en $0...$n,\n" +" kaj la funkcinomo registriĝas en $FUNCNAME.\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se NOMO estas nurlega." + +# grouping_braces: { COMMANDS ; } +# { KOMANDOJ ; } +#: builtins.c:1672 +msgid "" +"Group commands as a unit.\n" +" \n" +" Run a set of commands in a group. This is one way to redirect an\n" +" entire set of commands.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Arigu komandojn en komandan unuon\n" +"\n" +" Plenumu la komandojn grupe. Tiel eblas apliki alidirektadon al\n" +" tuta grupo da komandoj.\n" +"\n" +" Elirstato:\n" +" Tiu de la komando laste plenumita." + +# job_spec [&] +# LABORINDIKO [&] +#: builtins.c:1684 +msgid "" +"Resume job in foreground.\n" +" \n" +" Equivalent to the JOB_SPEC argument to the `fg' command. Resume a\n" +" stopped or background job. JOB_SPEC can specify either a job name\n" +" or a job number. Following JOB_SPEC with a `&' places the job in\n" +" the background, as if the job specification had been supplied as an\n" +" argument to `bg'.\n" +" \n" +" Exit Status:\n" +" Returns the status of the resumed job." +msgstr "" +"Reaktivigu laboron en la fono\n" +"\n" +" Samkiel la argumento LABORINDIKO en komando „fg‟. Reaktivigu\n" +" haltigitan aÅ­ fonan laboron. LABORINDIKO povas esti labornomo aÅ­\n" +" labornumero. Postmetita „&‟ sendas la laboron en la fonon,\n" +" samkiel se la komando „bg‟ estus aplikita al LABORINDIKO.\n" +"\n" +" Elirstato:\n" +" Tiu de la reakivigita laboro." + +# (( expression )) +# (( ESPRIMO )) +#: builtins.c:1699 +msgid "" +"Evaluate arithmetic expression.\n" +" \n" +" The EXPRESSION is evaluated according to the rules for arithmetic\n" +" evaluation. Equivalent to \"let EXPRESSION\".\n" +" \n" +" Exit Status:\n" +" Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise." +msgstr "" +"Komputu aritmetikan esprimon\n" +"\n" +" La esprimo EXPRESSION komputiĝas laÅ­ la aritmetikaj reguloj.\n" +" Ekvivalentas al «let EXPRESSION».\n" +"\n" +" Elirstato:\n" +" 1, se la rezulto de la ESPRIMO estas 0; 0 aliokaze." + +# [[ expression ]] +# [[ ESPRIMO ]] +#: builtins.c:1711 +msgid "" +"Execute conditional command.\n" +" \n" +" Returns a status of 0 or 1 depending on the evaluation of the " +"conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries " +"used\n" +" by the `test' builtin, and may be combined using the following " +"operators:\n" +" \n" +" ( EXPRESSION )\tReturns the value of EXPRESSION\n" +" ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" +" EXPR1 && EXPR2\tTrue if both EXPR1 and EXPR2 are true; else false\n" +" EXPR1 || EXPR2\tTrue if either EXPR1 or EXPR2 is true; else false\n" +" \n" +" When the `==' and `!=' operators are used, the string to the right of\n" +" the operator is used as a pattern and pattern matching is performed.\n" +" When the `=~' operator is used, the string to the right of the operator\n" +" is matched as a regular expression.\n" +" \n" +" The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n" +" determine the expression's value.\n" +" \n" +" Exit Status:\n" +" 0 or 1 depending on value of EXPRESSION." +msgstr "" +"Plenumu kondiĉkomandon\n" +"\n" +" Liveras elirstaton 0 aÅ­ 1 laÅ­ la rezulto de komputado de kondiĉa\n" +" ESPRIMO. Esprimoj konsistas el bazaj esprimoj, kiajn uzas la\n" +" primitivaĵo „test‟, kaj komponiĝas per sekvaj operacioj:\n" +"\n" +" ( ESPRIMO ) Liveras la valoron de ESPRIMO\n" +" ! ESPRIMO\t Vera, se ESPRIMO estas malvera; alie malvera\n" +" ESP1 && ESP2 Vera, se veras ambaÅ­ ESP1 kaj ESP2; alie malvera\n" +" ESP1 || ESP2 Vera, se veras ajna el ESP1 kaj ESP2; alie malvera\n" +"\n" +" En la operacioj „==‟ kaj „!=‟ la signoĉeno dekstre de la operacisigno\n" +" rolas kiel ŝablono, kongrueco al kiu estas testata. Ĉe la\n" +" operacio „=~‟ la ĉeno en la dekstra parto rolas kiel regulesprimo\n" +" por kongruectestado.\n" +"\n" +" En la operacioj && kaj || la duaj subesprimoj ESP2 ne estas\n" +" komputataj se ESP1 jam sufiĉas por determini la rezulton.\n" +"\n" +" Elirstato:\n" +" 0 aÅ­ 1, laÅ­ la valoro de ESPRIMO." + +# help var +# variables - Names and meanings of some shell variables +#: builtins.c:1737 +msgid "" +"Common shell variable names and usage.\n" +" \n" +" BASH_VERSION\tVersion information for this Bash.\n" +" CDPATH\tA colon-separated list of directories to search\n" +" \t\tfor directories given as arguments to `cd'.\n" +" GLOBIGNORE\tA colon-separated list of patterns describing filenames to\n" +" \t\tbe ignored by pathname expansion.\n" +" HISTFILE\tThe name of the file where your command history is stored.\n" +" HISTFILESIZE\tThe maximum number of lines this file can contain.\n" +" HISTSIZE\tThe maximum number of history lines that a running\n" +" \t\tshell can access.\n" +" HOME\tThe complete pathname to your login directory.\n" +" HOSTNAME\tThe name of the current host.\n" +" HOSTTYPE\tThe type of CPU this version of Bash is running under.\n" +" IGNOREEOF\tControls the action of the shell on receipt of an EOF\n" +" \t\tcharacter as the sole input. If set, then the value\n" +" \t\tof it is the number of EOF characters that can be seen\n" +" \t\tin a row on an empty line before the shell will exit\n" +" \t\t(default 10). When unset, EOF signifies the end of input.\n" +" MACHTYPE\tA string describing the current system Bash is running on.\n" +" MAILCHECK\tHow often, in seconds, Bash checks for new mail.\n" +" MAILPATH\tA colon-separated list of filenames which Bash checks\n" +" \t\tfor new mail.\n" +" OSTYPE\tThe version of Unix this version of Bash is running on.\n" +" PATH\tA colon-separated list of directories to search when\n" +" \t\tlooking for commands.\n" +" PROMPT_COMMAND\tA command to be executed before the printing of each\n" +" \t\tprimary prompt.\n" +" PS1\t\tThe primary prompt string.\n" +" PS2\t\tThe secondary prompt string.\n" +" PWD\t\tThe full pathname of the current directory.\n" +" SHELLOPTS\tA colon-separated list of enabled shell options.\n" +" TERM\tThe name of the current terminal type.\n" +" TIMEFORMAT\tThe output format for timing statistics displayed by the\n" +" \t\t`time' reserved word.\n" +" auto_resume\tNon-null means a command word appearing on a line by\n" +" \t\titself is first looked for in the list of currently\n" +" \t\tstopped jobs. If found there, that job is foregrounded.\n" +" \t\tA value of `exact' means that the command word must\n" +" \t\texactly match a command in the list of stopped jobs. A\n" +" \t\tvalue of `substring' means that the command word must\n" +" \t\tmatch a substring of the job. Any other value means that\n" +" \t\tthe command must be a prefix of a stopped job.\n" +" histchars\tCharacters controlling history expansion and quick\n" +" \t\tsubstitution. The first character is the history\n" +" \t\tsubstitution character, usually `!'. The second is\n" +" \t\tthe `quick substitution' character, usually `^'. The\n" +" \t\tthird is the `history comment' character, usually `#'.\n" +" HISTIGNORE\tA colon-separated list of patterns used to decide which\n" +" \t\tcommands should be saved on the history list.\n" +msgstr "" +"Nomoj kaj uzoj de komunaj ŝelvariabloj\n" +"\n" +" BASH_VERSION Informo pri la versio de ĉi tiu Baŝo\n" +" CDPATH\tListo da dosierujoj (disigitaj per dupunkto) en\n" +"\t\tkiuj argumenta dosierujo de „cd‟ estu serĉata\n" +" GLOBIGNORE\tListo da ŝablonoj (disigitaj per dupunkto) difinanta\n" +"\t\tdosiernomojn ignorendajn ĉe malvolvo de dosierindikoj\n" +" HISTFILE\tNomo de la dosiero por via komandohistorio\n" +" HISTFILESIZE Maksimuma nombro de linioj konserveblaj en HISTFILE\n" +" HISTSIZE\tMaksimuma nombro de linioj el komandohistorio\n" +"\t\tatingeblaj el plenumata ŝelo\n" +" HOME\tPlena dosierindiko pri via hejma dosierujo\n" +" HOSTNAME\tNomo de la rulanta komputilo\n" +" HOSTTYPE\tTipo de la ĉefprocesoro rulanta ĉi tiun Baŝon\n" +" IGNOREEOF\tDeterminas la konduton de la ŝelo kiam ĝi ricevas\n" +"\t\tdosierfinilon (^D, \\004) kiel nuran enigaĵon. Se ĝi\n" +"\t\tekzistas kaj havas nombran valoron, tiam ĉi tiu\n" +" indikas, kiom da sinsekvaj dosierfinilojn toleri\n" +"\t\tantaÅ­ ol la ŝelo finiĝu (defaÅ­lte, 10). Sen tia\n" +"\t\tvaloro, ^D signifas finon de enigo\n" +" MACHTYPE\tSignoĉeno priskribanta la komputsistemon rulantan\n" +"\t\tĉi tiun Baŝon\n" +" MAILCHECK\tKiom ofte (post kiom da sekundoj) Baŝo kontrolu\n" +"\t\tricevon de nova retpoŝta mesaĝo\n" +" MAILPATH\tListo da dosiernomoj (disigitaj per dupunkto) kiujn\n" +"\t\tBaŝo testu pri nova retpoŝtaĵo\n" +" OSTYPE\tVersio de Unikso sur kiu ĉi tiu Baŝo ruliĝas\n" +" PATH\tListo da dosierujoj (disigitaj per dupunkto) kie serĉi\n" +"\t\tkomandojn\n" +" PROMPT_COMMAND Komando plenumenda antaÅ­ ĉiu unuaranga invito\n" +" PS1\t\tSignoĉeno de la unuaranga invito\n" +" PS2\t\tSignoĉeno de la duaranga invito\n" +" PWD\t\tPlena dosierindiko de la kuranta dosierujo\n" +" SHELLOPTS\tListo da aktivaj ŝelaj opcioj (disigitaj per dupunktoj)\n" +" TERM\tTipo de la uzata terminalo\n" +" TIMEFORMAT\tFormato por eligi tempostatistikon per la komando „time‟\n" +" auto_resume\tSe ne vakua, indikas ke komandan vorton sole aperanta\n" +"\t\ten linio la ŝelo unue serĉu en la listo de haltetintaj\n" +"\t\tlaboroj. Se trovita tie, la laboro iĝu dialoga.\n" +"\t\tLa valoro „exact‟ postulas ekzaktan kongruon de la\n" +"\t\tkomanda vorto kun la komando el la laborlisto. La valoro\n" +"\t\t„substring‟ indikas ke la komanda vorto kongruu kun\n" +"\t\tsubĉeno de la laboro. Ĉia alia valoro indikas ke la\n" +"\t\tkomando estu komenca parto de la labornomo\n" +" histchars\tSignoj regantaj reuzon de komandohistorio kaj rapidan\n" +"\t\tanstataÅ­igon. Unue estas la reuziga signo, kutime „!‟.\n" +"\t\tDue estas la signo de „rapida anstataÅ­igo‟, kutime „^‟.\n" +"\t\tTrie estas la signo de „historia komentilo‟,\n" +"\t\tkutime „#‟\n" +" HISTIGNORE\tListo da ŝablonoj (disigitaj per dupunkto) difinanta\n" +"\t\tkiujn komandojn konservi en la historilisto\n" + +# pushd [-n] [+N | -N | dir] +# pushd [-n] [+N | -N | DOSIERUJO] +#: builtins.c:1794 +msgid "" +"Add directories to stack.\n" +" \n" +" Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" +"Surstakigu dosierujojn\n" +"\n" +" Surstakigu dosierujon sur la stakon da dosierujoj, aÅ­ cikle ŝovu\n" +" la stakon tiel, ke la nova stakpinto estu la kuranta dosierujo.\n" +" Senargumente, permutu la du plej suprajn dosierujojn de la stako.\n" +"\n" +" Opcio:\n" +" -n\tNe ŝanĝu la kurantan dosierujon (ne plenumu cd) surstakigante\n" +" dosierujon sur la stakon; do, nur la stakon ŝanĝu\n" +"\n" +" Argumentoj:\n" +" +N\tCikle ŝovu la stakon tiel ke la Nª dosierujo (nombrante de\n" +" \tmaldekstre en la listo eligebla per „dirs‟, numerante de 0)\n" +" iĝu la pinta\n" +"\n" +" -N\tCikle ŝovu la stakon tiel ke la Nª dosierujo (nombrante de\n" +" \tdekstre en la listo eligebla per „dirs‟, numerante de 0) iĝu\n" +" la pinta\n" +"\n" +" DOSIERUJO\n" +"\tsurstakigu la DOSIERUJOn kaj faru ĝin la nova kuranta\n" +" \tdosierujo labora\n" +"\n" +" Vi povas vidigi la stakon da dosierujoj per la komando „dirs‟.\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se aperas misa argumento aÅ­ se cd malsukcesas." + +# popd [-n] [+N | -N] +#: builtins.c:1828 +msgid "" +"Remove directories from stack.\n" +" \n" +" Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" +"Elstakigu dosierujojn\n" +"\n" +" Elstakigu erojn el la stako da dosierujoj. Senargumente, forigu\n" +" la pintan dosierujon kaj iru (cd) en la novan pintan dosierujon.\n" +"\n" +" Opcio:\n" +" -n\tNe ŝanĝu (cd) la kurantan dosierujon demetante dosierujon el\n" +" la stako; do, nur la stakon ŝanĝu\n" +"\n" +" Argumentoj:\n" +" +N\tForigu la N-an eron de maldekstre de la listo eligebla per\n" +"\t„dirs‟, numerante ekde 0. Ekz-e: «popd +0» forigas la plej\n" +"\tmaldekstran dosierujon; «popd +1», ĝian najbaron\n" +"\n" +" -N\tForigu la N-an eron de dekstre de la listo eligebla per\n" +" „dirs‟, numerante ekde 0. Ekz-e: «popd -0» forigas la lastan\n" +"\tdosierujon; «popd -1», la antaÅ­lastan\n" +"\n" +" Vi povas vidigi la stakon da dosierujoj per la komando „dirs‟.\n" +" Elirstato:\n" +" Sukceso, krom se aperas misa argumento aÅ­ se cd malsukcesas." + +# dirs [-clpv] [+N] [-N] +#: builtins.c:1858 +msgid "" +"Display directory stack.\n" +" \n" +" Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Listigu dosierujstakon\n" +"\n" +" Listigu la kurantan dosierujstakon. La dosierujoj trafas en la\n" +" stakon per la komando „pushd‟ kaj estas forigeblaj per la komando\n" +" „popd‟.\n" +"\n" +" Opcioj:\n" +" -c viŝu la dosierujstakon forigante el ĝi ĉiujn erojn\n" +" -l ne uzu mallongan formon de dosierujnomoj relative al via hejma\n" +" dosierujo\n" +" -p listigu dosierujstakon lokante po unu eron sur linio\n" +" -v listigu po unu eron de la dosierujstako en linio, metante\n" +" antaÅ­ la dosierujnomo ĝian numeron en la stako \n" +"\n" +" Argumentoj:\n" +" +N\teligu la N-an eron (numerante de maldekstre kaj ekde 0) de la\n" +" listo eligebla per senopcia „dirs‟\n" +"\n" +" -N\teligu la N-an eron (numerante de dekstre kaj ekde 0) en la\n" +" listo eligebla per senopcia „dirs‟\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se aperas misa opcio aÅ­ okazas eraro." + +# shopt [-pqsu] [-o] [optname ...] +# shopt [-pqsu] [-o] [OPCINOMO ...] +#: builtins.c:1887 +msgid "" +"Set and unset shell options.\n" +" \n" +" Change the setting of each shell option OPTNAME. Without any option\n" +" arguments, list all shell options with an indication of whether or not " +"each\n" +" is set.\n" +" \n" +" Options:\n" +" -o\trestrict OPTNAMEs to those defined for use with `set -o'\n" +" -p\tprint each shell option with an indication of its status\n" +" -q\tsuppress output\n" +" -s\tenable (set) each OPTNAME\n" +" -u\tdisable (unset) each OPTNAME\n" +" \n" +" Exit Status:\n" +" Returns success if OPTNAME is enabled; fails if an invalid option is\n" +" given or OPTNAME is disabled." +msgstr "" +"Ŝaltu kaj malŝaltu ŝelajn opciojn\n" +"\n" +" Ŝanĝu la staton de ĉiu el la OPCINOMOj. Sen opciaj argumentoj,\n" +" listigu ĉiujn ŝelajn opciojn, indikante pri ĉiu el ili, ĉu ĝi\n" +" estas ŝaltita.\n" +"\n" +" Opcioj:\n" +" -o limigu OPCINOMOJn je tiuj difinitaj por uzo per «set -o»\n" +" -p eligu ĉiun ŝelan opcion indikante ĉu ĝi estas ŝaltita\n" +" -q silentigu eligon\n" +" -s ŝaltu (aktivigu) ĉiun el la OPCINOMOj\n" +" -u malŝaltu (malaktivigu) ĉiun el la OPCINOMOj\n" +"\n" +" Elirstato:\n" +" Sukceso, se OPCINOMO estas ŝaltita; malsukceso, se aperas misa\n" +" opcio, aÅ­ se OPCINOMO estas malŝaltita." + +# printf [-v var] format [arguments] +# printf [-v VAR] FORMATO [ARGUMENTOJ] +#: builtins.c:1908 +msgid "" +"Formats and prints ARGUMENTS under control of the FORMAT.\n" +" \n" +" Options:\n" +" -v var\tassign the output to shell variable VAR rather than\n" +" \t\tdisplay it on the standard output\n" +" \n" +" FORMAT is a character string which contains three types of objects: " +"plain\n" +" characters, which are simply copied to standard output; character " +"escape\n" +" sequences, which are converted and copied to the standard output; and\n" +" format specifications, each of which causes printing of the next " +"successive\n" +" argument.\n" +" \n" +" In addition to the standard format specifications described in " +"printf(1),\n" +" printf interprets:\n" +" \n" +" %b\texpand backslash escape sequences in the corresponding argument\n" +" %q\tquote the argument in a way that can be reused as shell input\n" +" %(fmt)T output the date-time string resulting from using FMT as a " +"format\n" +" string for strftime(3)\n" +" \n" +" The format is re-used as necessary to consume all of the arguments. If\n" +" there are fewer arguments than the format requires, extra format\n" +" specifications behave as if a zero value or null string, as " +"appropriate,\n" +" had been supplied.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a write or " +"assignment\n" +" error occurs." +msgstr "" +"Aranĝu kaj eligu ARGUMENTOJn laÅ­ FORMATO.\n" +"\n" +" Opcio:\n" +" -v VAR eligu en ŝelvariablon VAR anstataÅ­ en la ĉefeligujon\n" +"\n" +" FORMATO estas signoĉeno entenanta 3 tipojn da objektoj:\n" +" ordinaraj signoj, simple kopiataj en la ĉefeligujon;\n" +" eskapsekvencoj por signo, konvertataj kaj kopiataj en la ĉefeligujon; \n" +" kaj formataj specifoj, ĉiu el kiuj kaÅ­zas eligon de vica argumento.\n" +"\n" +" Aldone al la normaj specifiloj laÅ­ „printf(1)‟, printf komprenas:\n" +"\n" +" „%b‟ igas malvolvi deklivajn (\\) eskapsekvencojn en sia argumento;\n" +" „%q‟ encitiligu la argumenton en formon taÅ­gan por ŝela re-enigo;\n" +" „%(fmt)T‟ servas por eligi data-tempan signoĉenon kiel farus\n" +" „strftime(3)‟ laÅ­ la formatoĉeno fmt.\n" +"\n" +" La formato estas iteracie reuzata kiom necesas por konsumi ĉiujn\n" +" argumentojn. Se estas malpli da argumentoj ol la formato\n" +" bezonas, la kromaj specifoj estas interpretataj tiel, kvazaÅ­ la\n" +" mankantaj argumentoj estus nuloj aÅ­ vakuaj signoĉenoj (laÅ­okaze).\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se aperas misa opcio aÅ­ okazas eraro pri skribo aÅ­\n" +" valorizo." + +# complete [-abcdefgjksuv] [-pr] [-DE] [-o OPCIO] [-A AGO] [-G GLOBŜAB] +# [-W VORTLISTO] [-F FUNKCIO] [-C KOMANDO] [-X FILTROŜAB] +# [-P PREFIKSO] [-S SUFIKSO] [NOMO ...] +#: builtins.c:1942 +msgid "" +"Specify how arguments are to be completed by Readline.\n" +" \n" +" For each NAME, specify how arguments are to be completed. If no " +"options\n" +" are supplied, existing completion specifications are printed in a way " +"that\n" +" allows them to be reused as input.\n" +" \n" +" Options:\n" +" -p\tprint existing completion specifications in a reusable format\n" +" -r\tremove a completion specification for each NAME, or, if no\n" +" \tNAMEs are supplied, all completion specifications\n" +" -D\tapply the completions and actions as the default for commands\n" +" \twithout any specific completion defined\n" +" -E\tapply the completions and actions to \"empty\" commands --\n" +" \tcompletion attempted on a blank line\n" +" \n" +" When completion is attempted, the actions are applied in the order the\n" +" uppercase-letter options are listed above. The -D option takes\n" +" precedence over -E.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Difinu, kiel Readline kompletigu argumentojn.\n" +"\n" +" Por ĉiu NOMO difinu, kiel la argumentoj estu kompletigotaj. Se\n" +" nenia opcio estas donita, eligu la aktualajn \n" +" kompletigoregulojn en formo reuzebla por enigo en la ŝelon.\n" +"\n" +" Opcioj:\n" +" -p\teligu kompletigoregulojn en formo uzebla por enigo en la ŝelon\n" +" -r\tforigu la kompletigoregulon por ĉiu NOMO, aÅ­, se nenia NOMO\n" +"\testas donita, ĉiujn kompletigoregulojn\n" +" -D apliku la indikitajn kompletigojn kaj agojn DefaÅ­lte por la\n" +" komandoj sen specifa kompletigo-difino\n" +" -E apliku la indikitajn kompletigojn kaj agojn al vakuaj (Empty)\n" +" komandoj (la kompletigoj provotaj en vakua komandolinio)\n" +"\n" +" Ĉe provo kompletigi la agoj aplikiĝas laÅ­ la ordo de majusklaj\n" +" opcioj en la ĉi-supre listo. La opcio -D superregas la opcion -E.\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se misa opcio estas donita, aÅ­ eraro okazis." + +# compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] +# [-W wordlist] [-P prefix] [-S suffix] [-X filterpat] +# [-F function] [-C command] [word] +# compgen [-abcdefgjksuv] [-o OPCIO] [-A AGO] [-G GLOBŜAB] +# [-W VORTLISTO] [-F FUNKCIO] [-C KOMANDO] [-X FILTROŜAB] +# [-P PREFIKSO] [-S SUFIKSO] [VORTO] +#: builtins.c:1970 +msgid "" +"Display possible completions depending on the options.\n" +" \n" +" Intended to be used from within a shell function generating possible\n" +" completions. If the optional WORD argument is supplied, matches " +"against\n" +" WORD are generated.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Montru la eblajn kompletigojn depende je la opcioj\n" +"\n" +" Destinita por uzo en ŝelfunkcio generanta eblajn kompletigojn. Se\n" +" la eventuala argumento VORTO estas donita, generu ĝiajn kongruaĵojn.\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se aperas misa opcio aÅ­ okazas eraro." + +# compopt [-o|+o OPCIO] [-DE] [NOMO ...] +#: builtins.c:1985 +msgid "" +"Modify or display completion options.\n" +" \n" +" Modify the completion options for each NAME, or, if no NAMEs are " +"supplied,\n" +" the completion currently being executed. If no OPTIONs are given, " +"print\n" +" the completion options for each NAME or the current completion " +"specification.\n" +" \n" +" Options:\n" +" \t-o option\tSet completion option OPTION for each NAME\n" +" \t-D\t\tChange options for the \"default\" command completion\n" +" \t-E\t\tChange options for the \"empty\" command completion\n" +" \n" +" Using `+o' instead of `-o' turns off the specified option.\n" +" \n" +" Arguments:\n" +" \n" +" Each NAME refers to a command for which a completion specification must\n" +" have previously been defined using the `complete' builtin. If no NAMEs\n" +" are supplied, compopt must be called by a function currently generating\n" +" completions, and the options for that currently-executing completion\n" +" generator are modified.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or NAME does not\n" +" have a completion specification defined." +msgstr "" +"Ŝanĝu aÅ­ vidigu opciojn pri kompletigo\n" +"\n" +" Ŝanĝu la kompletigajn opciojn por ĉiu NOMO, aÅ­ - se nenia NOMO\n" +" estas indikita - la nune plenumatan kompletigon. Se nenia OPCIO\n" +" estas donita, eligu la kompletigajn opciojn por ĉiu NOMO aÅ­ la\n" +" kurantan kompletigan regularon.\n" +"\n" +" Opcioj:\n" +" -o OPCIO Ŝaltu kompletigan OPCIOn por ĉiu NOMO\n" +" -D Ŝanĝu opciojn por la DefaÅ­lta komandokompletigo\n" +" -E Ŝanĝu opciojn por la vakua (Empty) komandokompletigo.\n" +"\n" +" Uzante «+o» anstataÅ­ «-o» oni malŝaltas la indikitan OPCIOn.\n" +"\n" +" Argumentoj:\n" +" Ĉiu NOMO indikas komandon, por kiu kompletiga regulo devas esti\n" +" jam difinita per la primitivaĵo „complete‟. Se nenia NOMO estas\n" +" donita, tiam la komandon compopt devas voki funkcio generanta, kaj\n" +" ĝuste la opcioj por ĉi tiu nune plenumata generilo de kompletigoj\n" +" estu ŝanĝitaj.\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se aperas misa opcio, aÅ­ por NOMO mankas difino de\n" +" kompletiga regulo." + +# mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] +# [-c quantum] [array] +# mapfile [-n NOMBRILO] [-O ORIGINO] [-s NOMBRILO] [-t] [-u DN] [-C RETROVOKO] +# [-c KVANTO] [TABELO] +#: builtins.c:2015 +msgid "" +"Read lines from the standard input into an indexed array variable.\n" +" \n" +" Read lines from the standard input into the indexed array variable " +"ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable " +"MAPFILE\n" +" is the default ARRAY.\n" +" \n" +" Options:\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are " +"copied.\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default " +"index is 0.\n" +" -s count \tDiscard the first COUNT lines read.\n" +" -t\t\tRemove a trailing newline from each line read.\n" +" -u fd\t\tRead lines from file descriptor FD instead of the standard " +"input.\n" +" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read.\n" +" -c quantum\tSpecify the number of lines read between each call to " +"CALLBACK.\n" +" \n" +" Arguments:\n" +" ARRAY\t\tArray variable name to use for file data.\n" +" \n" +" If -C is supplied without -c, the default quantum is 5000. When\n" +" CALLBACK is evaluated, it is supplied the index of the next array\n" +" element to be assigned and the line to be assigned to that element\n" +" as additional arguments.\n" +" \n" +" If not supplied with an explicit origin, mapfile will clear ARRAY " +"before\n" +" assigning to it.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or ARRAY is readonly " +"or\n" +" not an indexed array." +msgstr "" +"Legu liniojn el la ĉefenigujo en tabelvariablon\n" +"\n" +" Legu liniojn el la ĉefenigujo en la entjerindican variablon\n" +" TABELO, aÅ­ el la dosiernumero DN, se ĉeestas la opcio „-u‟.\n" +" DefaÅ­lte TABELO estas la variablo MAPFILE.\n" +"\n" +" Opcioj:\n" +" -n NOMBRILO Kopiu maksimume NOMBRILOn da linioj. Se NOMBRILO\n" +" estas 0, kopiu ĉiujn liniojn\n" +" -O ORIGINO Komencu valorizi la TABELOn ekde la indekso ORIGINO.\n" +" La defaÅ­lta origino estas 0.\n" +" -s NOMBRILO Ignoru NOMBRILOn da unuaj linioj\n" +" -t Forigu la vostan linifinilon el ĉiu legita linio\n" +" -u DN Legu per la dosiernunero DN anstataÅ­ el la ĉefenigujo\n" +" -C RETROVOKO Plenumu RETROVOKOn post ĉiu KVANTO da legitaj linioj\n" +" -c KVANTO\tPo kiom da linioj legi inter sinsekvaj RETROVOKOj\n" +"\n" +" Argumento:\n" +" TABELO\tNomo de tabelvariablo uzota por la legotaj datumoj\n" +"\n" +" Se „-C‟ aperas sen „-c‟, la defaÅ­lta kvanto estas 5000. Ĉe\n" +" komputo de RETROVOKO ĉi tiu ricevas la indicon de la sekva\n" +" valorizota tabelano kaj la en ĝin skribotan linion kiel kromajn\n" +" argumentojn.\n" +"\n" +" Se mankas malimplica ORIGINO, mapfile viŝos la TABELOn antaÅ­\n" +" valorizi ĝin.\n" +"\n" +" Elirstato:\n" +" Sukceso, krom se aperas misa opcio aÅ­ TABELO estas nurlega aÅ­\n" +" ĝi ne estas entjerindica tabelo." + +# readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] +# [-c quantum] [array] +#: builtins.c:2049 +msgid "" +"Read lines from a file into an array variable.\n" +" \n" +" A synonym for `mapfile'." +msgstr "" +"Legu liniojn el la ĉefenigujo en tabelvariablon\n" +"\n" +" Sinonimo de „mapfile‟." diff --git a/po/es.gmo b/po/es.gmo new file mode 100644 index 0000000000000000000000000000000000000000..4799cda2d2dbab451c61f0c3971228ff4ac943d4 GIT binary patch literal 122470 zcmeFa2Yg*umG*r^LXjbal7tQ?jvd>H<&qFc?3hHh<;296g(b%c##mR%a zIcL|k*Is+AwafY1T~7SlgumO~DoO4Qj@&6p-pTJLr+S(s*PWdtXMukS-UWOOxCDGR zxCs0Xct`MO;BCO)f%gS(y)sEo0hfUH11|ti1Fr;61!uut@NwXs!Ka7!FAMnAfS&}F z@Atv`fVY4rgLm&sk`!DHD&MW(UBMynZr}uXFYsD$HTYa`J@_F|ds489#yJ-!BtKEDK2jysX)x!@`=1;@ZM!AA#tHOT+Trvmn@@p`WfcnL^S z$zD+OdNQbT{3CdG@O_}l|7B45{RUM1PF?HeS^?^Q8+a#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)mirt+z|VXJ(N(@Gi5P`6&Ex zYD}iI7?zp%r+8a;xTC_y};y7uIze;61gIv#b;NxT~srK*x_sa3)TkMbM zyh+h) zcOPhD>%gnxHcMH;q|cW4As@~D8SmQ2L;TMcb3~1hGbv$*`Ut@feZexLduer93^8QT zcaHSlFL^YPbpI7U*))-JQL;yxc2@?8Z?sZ^-qjafz6yu`)6waR{bv!SYi6`RW3PtI!j1-AM* zVIb)(=3`efvr4Sxv&|F$NHs#u#8`HUn(02#USOxT(4IDDtsx0X|GtlR8GdxA;|FYu zZ7j2SOy;4Pyl=R0v^c8vuf45%91=>(ekeAv@e|#Xd?5bZ4py z0sK*EpVzD%0&}o-V}ng9T3#x%MVz)UnLj!m)t%yaPKLHe5~w_Wpt!DBcC+)S&HR?Q zFOZZJYbf9urMp?-#%=(@`QGU4+hga`o*kbdrPAscM8)((inZI%zIwiYaB_D3TAPlM z=PiQKxprH8OBRpkly%-55&3fyWQ1dRt!&wleso#sSOIa4u$F1hqC7q4`UO>OZQ_=_ z$8*I=s>gG&F5mOD>sQ&2>4@+abPamQ6a_cVmu`@R40GoYmm$x+GQQS3cgvu&Vq z_s)@&mQxoYrwSiw|VQfx@yCn}b(g<7(Qz^^vE~55r)fuvrsAj!ctDU?b-U|>MIHP>(kc{)$xBi?{j$^1YluV^>Y0pFES(R(P-s&sVN$+1j)Ir?lc1;k lQwS&iI@zDCR%;5Ye_q$)?XhA+Gk~n$)*i2}j%Ly|{|_AA7$^V$ literal 0 HcmV?d00001 diff --git a/po/es.po b/po/es.po new file mode 100644 index 0000000..f07cda7 --- /dev/null +++ b/po/es.po @@ -0,0 +1,8666 @@ +# Mensajes en español para GNU bash-4.2. +# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +# This file is distributed under the same license as the bash package. +# Cristian Othón Martínez Vera , 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU bash 4.2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-02-11 11:19-0500\n" +"PO-Revision-Date: 2011-08-14 11:55-0500\n" +"Last-Translator: Cristian Othón Martínez Vera \n" +"Language-Team: Spanish \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8-bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: arrayfunc.c:51 +msgid "bad array subscript" +msgstr "subíndice de matriz incorrecto" + +#: arrayfunc.c:356 builtins/declare.def:566 +#, c-format +msgid "%s: cannot convert indexed to associative array" +msgstr "%s: no se puede convertir la matriz de indizada a asociativa" + +#: arrayfunc.c:539 +#, c-format +msgid "%s: invalid associative array key" +msgstr "%s: índice de matriz asociativa inválido" + +#: arrayfunc.c:541 +#, c-format +msgid "%s: cannot assign to non-numeric index" +msgstr "%s: no se puede asignar a un índice que no es numérico" + +#: arrayfunc.c:586 +#, c-format +msgid "%s: %s: must use subscript when assigning associative array" +msgstr "%s: %s: se debe usar un subíndice al asignar a una matriz asociativa" + +#: bashhist.c:388 +#, c-format +msgid "%s: cannot create: %s" +msgstr "%s: no se puede crear: %s" + +#: bashline.c:3982 +msgid "bash_execute_unix_command: cannot find keymap for command" +msgstr "" +"bash_execute_unix_command: no se puede encontrar la combinación de teclas " +"para la orden" + +#: bashline.c:4069 +#, c-format +msgid "%s: first non-whitespace character is not `\"'" +msgstr "%s: el primer carácter que no es espacio en blanco no es `\"'" + +#: bashline.c:4098 +#, c-format +msgid "no closing `%c' in %s" +msgstr "no hay un `%c' que cierre en %s" + +#: bashline.c:4132 +#, c-format +msgid "%s: missing colon separator" +msgstr "%s: falta un `:' separador" + +#: braces.c:321 +#, c-format +msgid "brace expansion: cannot allocate memory for %s" +msgstr "" + +#: braces.c:413 +#, c-format +msgid "brace expansion: failed to allocate memory for %d elements" +msgstr "" + +#: braces.c:452 +#, c-format +msgid "brace expansion: failed to allocate memory for `%s'" +msgstr "" + +#: builtins/alias.def:132 +#, c-format +msgid "`%s': invalid alias name" +msgstr "`%s': nombre de alias inválido" + +#: builtins/bind.def:123 builtins/bind.def:126 +msgid "line editing not enabled" +msgstr "no se activó la edición de línea" + +#: builtins/bind.def:212 +#, c-format +msgid "`%s': invalid keymap name" +msgstr "`%s': nombre de combinación de teclas inválido" + +#: builtins/bind.def:251 +#, c-format +msgid "%s: cannot read: %s" +msgstr "%s: no se puede leer: %s" + +#: builtins/bind.def:266 +#, c-format +msgid "`%s': cannot unbind" +msgstr "%s: no se puede borrar la asignación" + +#: builtins/bind.def:304 builtins/bind.def:334 +#, c-format +msgid "`%s': unknown function name" +msgstr "`%s': nombre de función desconocido" + +#: builtins/bind.def:312 +#, c-format +msgid "%s is not bound to any keys.\n" +msgstr "%s no está asignado a ninguna tecla.\n" + +#: builtins/bind.def:316 +#, c-format +msgid "%s can be invoked via " +msgstr "%s se puede invocar a través de " + +#: builtins/break.def:77 builtins/break.def:117 +msgid "loop count" +msgstr "cuenta de ciclo" + +#: builtins/break.def:137 +msgid "only meaningful in a `for', `while', or `until' loop" +msgstr "sólo tiene significado en un ciclo `for', `while' o `until'" + +#: builtins/caller.def:134 +msgid "" +"Returns the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns " +msgstr "" +"Devuelve el contexto de la llamada a subrutina actual.\n" +" \n" +" Sin EXPR, devuelve " + +#: builtins/cd.def:319 +msgid "HOME not set" +msgstr "HOME no está definido" + +#: builtins/cd.def:327 builtins/common.c:166 test.c:876 +msgid "too many arguments" +msgstr "demasiados argumentos" + +#: builtins/cd.def:338 +msgid "OLDPWD not set" +msgstr "OLDPWD no está definido" + +#: builtins/common.c:101 +#, c-format +msgid "line %d: " +msgstr "línea %d: " + +#: builtins/common.c:139 error.c:265 +#, c-format +msgid "warning: " +msgstr "aviso: " + +#: builtins/common.c:153 +#, c-format +msgid "%s: usage: " +msgstr "%s: uso: " + +#: builtins/common.c:191 shell.c:506 shell.c:788 +#, c-format +msgid "%s: option requires an argument" +msgstr "%s: la opción requiere un argumento" + +#: builtins/common.c:198 +#, c-format +msgid "%s: numeric argument required" +msgstr "%s: se requiere un argumento numérico" + +#: builtins/common.c:205 +#, c-format +msgid "%s: not found" +msgstr "%s: no se encontró" + +#: builtins/common.c:214 shell.c:801 +#, c-format +msgid "%s: invalid option" +msgstr "%s: opción inválida" + +#: builtins/common.c:221 +#, c-format +msgid "%s: invalid option name" +msgstr "%s: nombre de opción inválido" + +#: builtins/common.c:228 general.c:235 general.c:240 +#, c-format +msgid "`%s': not a valid identifier" +msgstr "`%s': no es un identificador válido" + +#: builtins/common.c:238 +msgid "invalid octal number" +msgstr "número octal inválido" + +#: builtins/common.c:240 +msgid "invalid hex number" +msgstr "número hexadecimal inválido" + +#: builtins/common.c:242 expr.c:1470 +msgid "invalid number" +msgstr "número inválido" + +#: builtins/common.c:250 +#, c-format +msgid "%s: invalid signal specification" +msgstr "%s: especificación de señal inválida" + +#: builtins/common.c:257 +#, c-format +msgid "`%s': not a pid or valid job spec" +msgstr "`%s': no es un pid o una especificación válida de trabajo" + +#: builtins/common.c:264 error.c:488 +#, c-format +msgid "%s: readonly variable" +msgstr "%s: variable de sólo lectura" + +#: builtins/common.c:272 +#, c-format +msgid "%s: %s out of range" +msgstr "%s: %s fuera de rango" + +#: builtins/common.c:272 builtins/common.c:274 +msgid "argument" +msgstr "argumento" + +#: builtins/common.c:274 +#, c-format +msgid "%s out of range" +msgstr "%s fuera de rango" + +#: builtins/common.c:282 +#, c-format +msgid "%s: no such job" +msgstr "%s: no existe ese trabajo" + +#: builtins/common.c:290 +#, c-format +msgid "%s: no job control" +msgstr "%s: no hay control de trabajos" + +#: builtins/common.c:292 +msgid "no job control" +msgstr "no hay control de trabajos" + +#: builtins/common.c:302 +#, c-format +msgid "%s: restricted" +msgstr "%s: restringido" + +#: builtins/common.c:304 +msgid "restricted" +msgstr "restringido" + +#: builtins/common.c:312 +#, c-format +msgid "%s: not a shell builtin" +msgstr "%s: no es una orden interna del shell" + +#: builtins/common.c:321 +#, c-format +msgid "write error: %s" +msgstr "error de escritura: %s" + +#: builtins/common.c:329 +#, c-format +msgid "error setting terminal attributes: %s" +msgstr "error al establecer los atributos de la terminal: %s" + +#: builtins/common.c:331 +#, c-format +msgid "error getting terminal attributes: %s" +msgstr "error al obtener los atributos de la terminal: %s" + +#: builtins/common.c:563 +#, c-format +msgid "%s: error retrieving current directory: %s: %s\n" +msgstr "%s: error al obtener el directorio actual: %s: %s\n" + +#: builtins/common.c:629 builtins/common.c:631 +#, c-format +msgid "%s: ambiguous job spec" +msgstr "%s: especificación de trabajo ambigua" + +#: builtins/complete.def:277 +#, c-format +msgid "%s: invalid action name" +msgstr "%s: nombre de acción inválido" + +#: builtins/complete.def:450 builtins/complete.def:645 +#: builtins/complete.def:855 +#, c-format +msgid "%s: no completion specification" +msgstr "%s: no hay completado de especificación" + +#: builtins/complete.def:697 +msgid "warning: -F option may not work as you expect" +msgstr "aviso: es posible que la opción -F no funcione como se espera" + +#: builtins/complete.def:699 +msgid "warning: -C option may not work as you expect" +msgstr "aviso: es posible que la opción -C no funcione como se espera" + +#: builtins/complete.def:828 +msgid "not currently executing completion function" +msgstr "no se está ejecutando la función de completado" + +# sólo se puede usar. sv +# De acuerdo. cfuga +#: builtins/declare.def:126 +msgid "can only be used in a function" +msgstr "sólo se puede usar dentro de una función" + +#: builtins/declare.def:315 builtins/declare.def:509 +#, c-format +msgid "%s: reference variable cannot be an array" +msgstr "" + +#: builtins/declare.def:324 +#, c-format +msgid "%s: nameref variable self references not allowed" +msgstr "" + +#: builtins/declare.def:398 +msgid "cannot use `-f' to make functions" +msgstr "no se puede usar `-f' para hacer funciones" + +#: builtins/declare.def:410 execute_cmd.c:5361 +#, c-format +msgid "%s: readonly function" +msgstr "%s: función de sólo lectura" + +#: builtins/declare.def:553 +#, c-format +msgid "%s: cannot destroy array variables in this way" +msgstr "%s: no se pueden destruir variables de matriz de esta forma" + +#: builtins/declare.def:560 builtins/read.def:733 +#, c-format +msgid "%s: cannot convert associative to indexed array" +msgstr "%s: no se puede convertir una matriz asociativa a indizada" + +#: builtins/enable.def:137 builtins/enable.def:145 +msgid "dynamic loading not available" +msgstr "la carga dinámica no está disponible" + +#: builtins/enable.def:312 +#, c-format +msgid "cannot open shared object %s: %s" +msgstr "no se puede abrir el objeto compartido %s: %s" + +#: builtins/enable.def:335 +#, c-format +msgid "cannot find %s in shared object %s: %s" +msgstr "no se puede encontrar %s en el objeto compartido %s: %s" + +#: builtins/enable.def:459 +#, c-format +msgid "%s: not dynamically loaded" +msgstr "%s: no se cargó dinámicamente" + +#: builtins/enable.def:474 +#, c-format +msgid "%s: cannot delete: %s" +msgstr "%s: no se puede borrar: %s" + +#: builtins/evalfile.c:140 builtins/hash.def:171 execute_cmd.c:5208 +#: shell.c:1481 +#, c-format +msgid "%s: is a directory" +msgstr "%s: es un directorio" + +#: builtins/evalfile.c:146 +#, c-format +msgid "%s: not a regular file" +msgstr "%s: no es un fichero regular" + +#: builtins/evalfile.c:155 +#, c-format +msgid "%s: file is too large" +msgstr "%s: el fichero es demasiado grande" + +# file=fichero. archive=archivo. Si no, es imposible traducir tar. sv +# De acuerdo. Corregido en todo el fichero. cfuga +#: builtins/evalfile.c:190 builtins/evalfile.c:208 shell.c:1491 +#, c-format +msgid "%s: cannot execute binary file" +msgstr "%s: no se puede ejecutar el fichero binario" + +#: builtins/exec.def:154 builtins/exec.def:156 builtins/exec.def:228 +#, c-format +msgid "%s: cannot execute: %s" +msgstr "%s: no se puede ejecutar: %s" + +#: builtins/exit.def:65 +#, c-format +msgid "logout\n" +msgstr "logout\n" + +#: builtins/exit.def:88 +msgid "not login shell: use `exit'" +msgstr "no es un shell de entrada: use `exit'" + +#: builtins/exit.def:120 +#, c-format +msgid "There are stopped jobs.\n" +msgstr "Hay trabajos detenidos.\n" + +#: builtins/exit.def:122 +#, c-format +msgid "There are running jobs.\n" +msgstr "Hay trabajos en ejecución.\n" + +#: builtins/fc.def:262 +msgid "no command found" +msgstr "no se encontró la orden" + +#: builtins/fc.def:320 builtins/fc.def:369 +msgid "history specification" +msgstr "especificación de historia" + +#: builtins/fc.def:390 +#, c-format +msgid "%s: cannot open temp file: %s" +msgstr "%s: no se puede abrir el fichero temporal: %s" + +#: builtins/fg_bg.def:149 builtins/jobs.def:282 +msgid "current" +msgstr "actual" + +#: builtins/fg_bg.def:158 +#, c-format +msgid "job %d started without job control" +msgstr "el trabajo %d inició sin control de trabajo" + +#: builtins/getopt.c:110 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: opción ilegal -- %c\n" + +#: builtins/getopt.c:111 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: la opción requiere un argumento -- %c\n" + +#: builtins/hash.def:92 +msgid "hashing disabled" +msgstr "asociación desactivada" + +#: builtins/hash.def:138 +#, c-format +msgid "%s: hash table empty\n" +msgstr "%s: tabla de asociación vacía\n" + +#: builtins/hash.def:245 +#, c-format +msgid "hits\tcommand\n" +msgstr "coinc\torden\n" + +#: builtins/help.def:130 +#, c-format +msgid "Shell commands matching keyword `" +msgid_plural "Shell commands matching keywords `" +msgstr[0] "Orden del shell que coinciden con la palabra `" +msgstr[1] "Órdenes del shell que coinciden con la palabra `" + +#: builtins/help.def:182 +#, c-format +msgid "" +"no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." +msgstr "" +"no hay temas de ayuda que coincidan con `%s'. Pruebe `help help' o `man -k " +"%s' o `info %s'." + +#: builtins/help.def:199 +#, c-format +msgid "%s: cannot open: %s" +msgstr "%s: no se puede abrir: %s" + +#: builtins/help.def:485 +#, c-format +msgid "" +"These shell commands are defined internally. Type `help' to see this list.\n" +"Type `help name' to find out more about the function `name'.\n" +"Use `info bash' to find out more about the shell in general.\n" +"Use `man -k' or `info' to find out more about commands not in this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" +msgstr "" +"Estas órdenes del shell están definidas internamente. Teclee `help' para\n" +"ver esta lista.\n" +"Teclee `help nombre' para saber más sobre la función `nombre'.\n" +"Use `info bash' para saber más sobre el shell en general.\n" +"Use `man -k' o `info' para saber más sobre las órdenes que no están en\n" +"esta lista.\n" +"\n" +"Un asterisco (*) junto a un nombre significa que el comando está " +"desactivado.\n" +"\n" + +#: builtins/history.def:154 +msgid "cannot use more than one of -anrw" +msgstr "no se puede usar más de uno de -anrw" + +#: builtins/history.def:186 +msgid "history position" +msgstr "posición en la historia" + +#: builtins/history.def:366 +#, c-format +msgid "%s: history expansion failed" +msgstr "%s: falló la expansión de la historia" + +#: builtins/inlib.def:71 +#, c-format +msgid "%s: inlib failed" +msgstr "%s: falló inlib" + +#: builtins/jobs.def:109 +msgid "no other options allowed with `-x'" +msgstr "no se permiten otras opciones con `-x'" + +#: builtins/kill.def:200 +#, c-format +msgid "%s: arguments must be process or job IDs" +msgstr "%s: los argumentos deben ser procesos o IDs de trabajos" + +#: builtins/kill.def:263 +msgid "Unknown error" +msgstr "Error desconocido" + +#: builtins/let.def:95 builtins/let.def:120 expr.c:583 expr.c:598 +msgid "expression expected" +msgstr "se esperaba una expresión" + +#: builtins/mapfile.def:172 +#, c-format +msgid "%s: not an indexed array" +msgstr "%s: no es una matriz indizada" + +#: builtins/mapfile.def:259 builtins/read.def:302 +#, c-format +msgid "%s: invalid file descriptor specification" +msgstr "%s: especificación de descriptor de fichero inválida" + +#: builtins/mapfile.def:267 builtins/read.def:309 +#, c-format +msgid "%d: invalid file descriptor: %s" +msgstr "%d: descriptor de fichero inválido: %s" + +#: builtins/mapfile.def:276 builtins/mapfile.def:314 +#, c-format +msgid "%s: invalid line count" +msgstr "%s: cuenta de líneas inválida" + +#: builtins/mapfile.def:287 +#, c-format +msgid "%s: invalid array origin" +msgstr "%s: origen de matriz inválido" + +#: builtins/mapfile.def:304 +#, c-format +msgid "%s: invalid callback quantum" +msgstr "%s: quantum de llamada inválido" + +#: builtins/mapfile.def:336 +msgid "empty array variable name" +msgstr "nombre de variable de matriz vacío" + +#: builtins/mapfile.def:357 +msgid "array variable support required" +msgstr "se requiere el soporte de variable de matriz" + +#: builtins/printf.def:402 +#, c-format +msgid "`%s': missing format character" +msgstr "`%s': falta el carácter de formato" + +#: builtins/printf.def:456 +#, c-format +msgid "`%c': invalid time format specification" +msgstr "`%c': especificación de formato de tiempo inválida" + +#: builtins/printf.def:658 +#, c-format +msgid "`%c': invalid format character" +msgstr "`%c': carácter de formato inválido" + +#: builtins/printf.def:684 +#, c-format +msgid "warning: %s: %s" +msgstr "aviso: %s: %s" + +#: builtins/printf.def:768 +#, c-format +msgid "format parsing problem: %s" +msgstr "" + +#: builtins/printf.def:865 +msgid "missing hex digit for \\x" +msgstr "falta el dígito hexadecimal para \\x" + +#: builtins/printf.def:880 +#, c-format +msgid "missing unicode digit for \\%c" +msgstr "falta el dígito unicode para \\%c" + +#: builtins/pushd.def:195 +msgid "no other directory" +msgstr "no hay otro directorio" + +#: builtins/pushd.def:354 +#, fuzzy, c-format +msgid "%s: invalid argument" +msgstr "%s: límite de argumento inválido" + +#: builtins/pushd.def:468 +msgid "" +msgstr "" + +#: builtins/pushd.def:512 +msgid "directory stack empty" +msgstr "la pila de directorios está vacía" + +#: builtins/pushd.def:514 +msgid "directory stack index" +msgstr "índice de la pila de directorios" + +#: builtins/pushd.def:689 +msgid "" +"Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +"\tdirs when invoked without options, starting with zero." +msgstr "" +"Muestra la lista de directorios actualmente grabados. Los directorios\n" +" se guardan en la lista con la orden `pushd'; pueden ir saliendo de\n" +" la lista con la orden `popd'.\n" +" \n" +" Opciones:\n" +" -c\tlimpia la pila de directorios, eliminando todos los elementos\n" +" -l\tno muestra las versiones con prefijo de tilde de los directorios\n" +" \trelativos a su directorio inicial\n" +" -p\tmuestra la pila de directorios con una entrada por línea\n" +" -v\tmuestra la pila de directorios con una entrada por línea con\n" +" \tsu posición en la pila como prefijo\n" +" \n" +" Argumentos:\n" +" +N\tMuestra la N-ésima entrada contando desde la izquierda de\n" +" \tla lista mostrada por dirs cuando se llama sin opciones,\n" +" \tempezando desde cero.\n" +" \n" +" -N\tMuestra la N-ésima entrada contando desde la derecha de\n" +"\tla lista mostrada por dirs cuando se llama sin opciones,\n" +"\tempezando desde cero." + +#: builtins/pushd.def:711 +msgid "" +"Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Agrega un directorio al tope de la pila de directorios, o rota\n" +" la pila, haciendo que el nuevo tope de la pila sea el\n" +" directorio de trabajo actual. Sin argumentos, intercambia\n" +" los dos directorios del tope.\n" +" \n" +" Argumentos:\n" +" +N\tRota la pila para que el N-ésimo directorio (contando\n" +" \tde la izquierda de la lista mostrada por `dirs',\n" +" \tcomenzando desde cero) esté en el tope.\n" +" -N\tRota la pila para que el N-ésimo directorio (contando\n" +" \tde la derecha de la lista mostrada por `dirs',\n" +" \tcomenzando desde cero) esté en el tope.\n" +" \n" +" dir\tagrega DIR a la pila de directorios en el tope,\n" +" \thaciéndolo el nuevo directorio de trabajo actual.\n" +" \n" +" La orden interna `dirs' muestra la pila de directorios." + +#: builtins/pushd.def:736 +msgid "" +"Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Borra entradas de la pila de directorios. Sin argumentos, borra\n" +" directorio del tope de la pila, y cambia al nuevo directorio tope.\n" +" \n" +" Opciones:\n" +" -n\tsuprime el cambio normal de directorio cuando se borran\n" +" \tdirectorios de la pila, así sólo se manipula la pila.\n" +" \n" +" Argumentos:\n" +" +N\tBorra la N-ésima entrada contando de la izquierda de\n" +" \tla lista mostrada por `dirs', comenzando desde cero.\n" +" \tPor ejemplo: `popd +0' borra el primer directorio, `popd +1'\n" +" \tel segundo.\n" +" \n" +" -N\tBorra la N-ésima entrada contando de la derecha de\n" +" \tla lista mostrada por `dirs', comenzando desde cero.\n" +" \tPor ejemplo: `popd -0' borra el último directorio, `popd -1'\n" +" \tel penúltimo.\n" +" \n" +" La orden interna `dirs' muestra la pila de directorios." + +#: builtins/read.def:275 +#, c-format +msgid "%s: invalid timeout specification" +msgstr "%s: especificación de tiempo de expiración inválida" + +#: builtins/read.def:678 +#, c-format +msgid "read error: %d: %s" +msgstr "error de lectura: %d: %s" + +#: builtins/return.def:75 +msgid "can only `return' from a function or sourced script" +msgstr "" +"sólo se puede usar `return' en una función o un guión leído con `source'" + +#: builtins/set.def:782 +msgid "cannot simultaneously unset a function and a variable" +msgstr "no se puede borrar al mismo tiempo una función y una variable" + +#: builtins/set.def:826 +#, c-format +msgid "%s: cannot unset" +msgstr "%s: no se puede borrar" + +#: builtins/set.def:843 +#, c-format +msgid "%s: cannot unset: readonly %s" +msgstr "%s: no se puede borrar: %s es de solo lectura" + +#: builtins/set.def:854 +#, c-format +msgid "%s: not an array variable" +msgstr "%s: no es una variable de matriz" + +#: builtins/setattr.def:187 +#, c-format +msgid "%s: not a function" +msgstr "%s: no es una función" + +#: builtins/shift.def:71 builtins/shift.def:77 +msgid "shift count" +msgstr "cuenta de shift" + +#: builtins/shopt.def:279 +msgid "cannot set and unset shell options simultaneously" +msgstr "no se pueden activar y desactivar opciones del shell simultáneamente" + +#: builtins/shopt.def:346 +#, c-format +msgid "%s: invalid shell option name" +msgstr "%s: nombre de opción del shell inválido" + +#: builtins/source.def:130 +msgid "filename argument required" +msgstr "se requiere un argumento de nombre de fichero" + +#: builtins/source.def:155 +#, c-format +msgid "%s: file not found" +msgstr "%s: no se encontró el fichero" + +#: builtins/suspend.def:101 +msgid "cannot suspend" +msgstr "no se puede suspender" + +#: builtins/suspend.def:111 +msgid "cannot suspend a login shell" +msgstr "no se puede suspender un shell de entrada" + +#: builtins/type.def:234 +#, c-format +msgid "%s is aliased to `%s'\n" +msgstr "%s es un alias de `%s'\n" + +#: builtins/type.def:255 +#, c-format +msgid "%s is a shell keyword\n" +msgstr "%s es una palabra clave del shell\n" + +#: builtins/type.def:274 +#, c-format +msgid "%s is a function\n" +msgstr "%s: es una función\n" + +#: builtins/type.def:296 +#, c-format +msgid "%s is a shell builtin\n" +msgstr "%s es una orden interna del shell\n" + +#: builtins/type.def:317 builtins/type.def:393 +#, c-format +msgid "%s is %s\n" +msgstr "%s is %s\n" + +#: builtins/type.def:337 +#, c-format +msgid "%s is hashed (%s)\n" +msgstr "%s está asociado (%s)\n" + +#: builtins/ulimit.def:383 +#, c-format +msgid "%s: invalid limit argument" +msgstr "%s: límite de argumento inválido" + +#: builtins/ulimit.def:409 +#, c-format +msgid "`%c': bad command" +msgstr "`%c': orden errónea" + +#: builtins/ulimit.def:438 +#, c-format +msgid "%s: cannot get limit: %s" +msgstr "%s: no se puede obtener el límite: %s" + +#: builtins/ulimit.def:464 +msgid "limit" +msgstr "límite" + +#: builtins/ulimit.def:476 builtins/ulimit.def:776 +#, c-format +msgid "%s: cannot modify limit: %s" +msgstr "%s: no se puede modificar el límite: %s" + +#: builtins/umask.def:114 +msgid "octal number" +msgstr "número octal" + +#: builtins/umask.def:227 +#, c-format +msgid "`%c': invalid symbolic mode operator" +msgstr "`%c': operador de modo simbólico inválido" + +#: builtins/umask.def:282 +#, c-format +msgid "`%c': invalid symbolic mode character" +msgstr "`%c': carácter de modo simbólico inválido" + +#: error.c:90 error.c:325 error.c:327 error.c:329 +msgid " line " +msgstr " línea " + +#: error.c:165 +#, c-format +msgid "last command: %s\n" +msgstr "última orden: %s\n" + +#: error.c:173 +#, c-format +msgid "Aborting..." +msgstr "Abortando..." + +#: error.c:440 +msgid "unknown command error" +msgstr "error de orden desconocido" + +#: error.c:441 +msgid "bad command type" +msgstr "tipo de orden erróneo" + +#: error.c:442 +msgid "bad connector" +msgstr "conector erróneo" + +#: error.c:443 +msgid "bad jump" +msgstr "salto erróneo" + +#: error.c:481 +#, c-format +msgid "%s: unbound variable" +msgstr "%s: variable sin asignar" + +#: eval.c:189 +#, c-format +msgid "\atimed out waiting for input: auto-logout\n" +msgstr "\aha expirado mientras esperaba alguna entrada: auto-logout\n" + +#: execute_cmd.c:512 +#, c-format +msgid "cannot redirect standard input from /dev/null: %s" +msgstr "no se puede redirigir la salida estándar desde /dev/null: %s" + +#: execute_cmd.c:1233 +#, c-format +msgid "TIMEFORMAT: `%c': invalid format character" +msgstr "TIMEFORMAT: `%c': carácter de formato inválido" + +#: execute_cmd.c:2287 +msgid "pipe error" +msgstr "error de tubería" + +#: execute_cmd.c:4386 +#, c-format +msgid "%s: maximum function nesting level exceeded (%d)" +msgstr "" + +#: execute_cmd.c:4884 +#, c-format +msgid "%s: restricted: cannot specify `/' in command names" +msgstr "%s: restringido: no se puede especificar `/' en nombres de órdenes" + +#: execute_cmd.c:4973 +#, c-format +msgid "%s: command not found" +msgstr "%s: no se encontró la orden" + +#: execute_cmd.c:5206 +#, c-format +msgid "%s: %s" +msgstr "%s: %s" + +#: execute_cmd.c:5243 +#, c-format +msgid "%s: %s: bad interpreter" +msgstr "%s: %s: intérprete erróneo" + +# file=fichero. archive=archivo. Si no, es imposible traducir tar. sv +# De acuerdo. Corregido en todo el fichero. cfuga +#: execute_cmd.c:5280 +#, fuzzy, c-format +msgid "%s: cannot execute binary file: %s" +msgstr "%s: no se puede ejecutar el fichero binario" + +#: execute_cmd.c:5352 +#, fuzzy, c-format +msgid "`%s': is a special builtin" +msgstr "%s es una orden interna del shell\n" + +#: execute_cmd.c:5404 +#, c-format +msgid "cannot duplicate fd %d to fd %d" +msgstr "no se puede duplicar el df %d al df %d" + +#: expr.c:259 +msgid "expression recursion level exceeded" +msgstr "se ha excedido el nivel de recursión de la expresión" + +#: expr.c:283 +msgid "recursion stack underflow" +msgstr "desbordamiento de la base de la pila de recursión" + +#: expr.c:431 +msgid "syntax error in expression" +msgstr "error sintáctico en la expresión" + +#: expr.c:475 +msgid "attempted assignment to non-variable" +msgstr "se intentó asignar a algo que no es una variable" + +#: expr.c:495 expr.c:858 +msgid "division by 0" +msgstr "división por 0" + +# token en bison fue traducido como terminal. ¿Lo traducimos igual aquí +# o lo dejamos como 'unidad' o 'elemento'? cfuga +#: expr.c:542 +msgid "bug: bad expassign token" +msgstr "bicho: elemento de asignación de expresión erróneo" + +#: expr.c:595 +msgid "`:' expected for conditional expression" +msgstr "se esperaba `:' para la expresión condicional" + +#: expr.c:919 +msgid "exponent less than 0" +msgstr "exponente menor que 0" + +#: expr.c:976 +msgid "identifier expected after pre-increment or pre-decrement" +msgstr "" +"se esperaba un identificador después del pre-incremento o pre-decremento" + +# falta , singular em+ +# mmmh, puede faltar más de un paréntesis cfuga +# tiene razón Enrique, es singular. cfuga +#: expr.c:1002 +msgid "missing `)'" +msgstr "falta un `)'" + +#: expr.c:1053 expr.c:1390 +msgid "syntax error: operand expected" +msgstr "error sintáctico: se esperaba un operando" + +#: expr.c:1392 +msgid "syntax error: invalid arithmetic operator" +msgstr "error sintáctico: operador aritmético inválido" + +#: expr.c:1416 +#, c-format +msgid "%s%s%s: %s (error token is \"%s\")" +msgstr "%s%s%s: %s (el elemento de error es \"%s\")" + +#: expr.c:1474 +msgid "invalid arithmetic base" +msgstr "base aritmética inválida" + +#: expr.c:1494 +msgid "value too great for base" +msgstr "valor demasiado grande para la base" + +#: expr.c:1543 +#, c-format +msgid "%s: expression error\n" +msgstr "%s: error de expresión\n" + +#: general.c:62 +msgid "getcwd: cannot access parent directories" +msgstr "getcwd: no se puede acceder a los directorios padre" + +#: input.c:102 subst.c:5168 +#, c-format +msgid "cannot reset nodelay mode for fd %d" +msgstr "no se puede reestablecer el modo nodelay para el df %d" + +#: input.c:271 +#, c-format +msgid "cannot allocate new file descriptor for bash input from fd %d" +msgstr "" +"no se puede asignar un nuevo descriptor de fichero para la entrada de bash " +"desde el df %d" + +# buffer: espacio intermedio , alojamiento intermedio ( me gusta menos ) +# em+ +# almacenamiento intermedio. cfuga +#: input.c:279 +#, c-format +msgid "save_bash_input: buffer already exists for new fd %d" +msgstr "" +"save_bash_input: el almacenamiento intermedio ya existe para el nuevo df %d" + +#: jobs.c:471 +msgid "start_pipeline: pgrp pipe" +msgstr "start_pipeline: tubería de pgrp" + +#: jobs.c:893 +#, c-format +msgid "forked pid %d appears in running job %d" +msgstr "el pid `forked' %d aparece en el trabajo en ejecución %d" + +#: jobs.c:1012 +#, c-format +msgid "deleting stopped job %d with process group %ld" +msgstr "borrando el trabajo detenido %d con grupo de proceso %ld" + +#: jobs.c:1117 +#, c-format +msgid "add_process: process %5ld (%s) in the_pipeline" +msgstr "add_process: el proceso %5ld (%s) en the_pipeline" + +#: jobs.c:1120 +#, c-format +msgid "add_process: pid %5ld (%s) marked as still alive" +msgstr "add_process: pid %5ld (%s) se marca como vivo aún" + +# Cambiaría 'hay' por 'existe' em+ +#: jobs.c:1435 +#, c-format +msgid "describe_pid: %ld: no such pid" +msgstr "describe_pid: %ld: no existe tal pid" + +#: jobs.c:1450 +#, c-format +msgid "Signal %d" +msgstr "Señal %d" + +#: jobs.c:1464 jobs.c:1489 +msgid "Done" +msgstr "Hecho" + +#: jobs.c:1469 siglist.c:123 +msgid "Stopped" +msgstr "Detenido" + +#: jobs.c:1473 +#, c-format +msgid "Stopped(%s)" +msgstr "Detenido(%s)" + +#: jobs.c:1477 +msgid "Running" +msgstr "Ejecutando" + +#: jobs.c:1491 +#, c-format +msgid "Done(%d)" +msgstr "Hecho(%d)" + +#: jobs.c:1493 +#, c-format +msgid "Exit %d" +msgstr "Salida %d" + +#: jobs.c:1496 +msgid "Unknown status" +msgstr "Estado desconocido" + +#: jobs.c:1583 +#, c-format +msgid "(core dumped) " +msgstr "(`core' generado) " + +#: jobs.c:1602 +#, c-format +msgid " (wd: %s)" +msgstr " (dir ahora: %s)" + +#: jobs.c:1819 +#, c-format +msgid "child setpgid (%ld to %ld)" +msgstr "setpgid hijo (%ld a %ld)" + +#: jobs.c:2138 nojobs.c:605 +#, c-format +msgid "wait: pid %ld is not a child of this shell" +msgstr "wait: pid %ld no es un proceso hijo de este shell" + +#: jobs.c:2385 +#, c-format +msgid "wait_for: No record of process %ld" +msgstr "wait_for: No hay un registro del proceso %ld" + +#: jobs.c:2694 +#, c-format +msgid "wait_for_job: job %d is stopped" +msgstr "wait_for_job: el trabajo %d está detenido" + +#: jobs.c:2986 +#, c-format +msgid "%s: job has terminated" +msgstr "%s: el trabajo ha terminado" + +#: jobs.c:2995 +#, c-format +msgid "%s: job %d already in background" +msgstr "%s: el trabajo %d ya está en segundo plano" + +#: jobs.c:3220 +msgid "waitchld: turning on WNOHANG to avoid indefinite block" +msgstr "waitchld: se activa WNOHANG para evitar el bloque indefinido" + +#: jobs.c:3711 +#, c-format +msgid "%s: line %d: " +msgstr "%s: línea %d: " + +#: jobs.c:3725 nojobs.c:843 +#, c-format +msgid " (core dumped)" +msgstr " (`core' generado)" + +#: jobs.c:3737 jobs.c:3750 +#, c-format +msgid "(wd now: %s)\n" +msgstr "(dir ahora: %s)\n" + +#: jobs.c:3782 +msgid "initialize_job_control: getpgrp failed" +msgstr "initialize_jobs_control: falló getpgrp" + +#: jobs.c:3843 +msgid "initialize_job_control: line discipline" +msgstr "initialize_jobs_control: disciplina de línea" + +#: jobs.c:3853 +msgid "initialize_job_control: setpgid" +msgstr "initialize_jobs_control: setpgid" + +#: jobs.c:3874 jobs.c:3883 +#, c-format +msgid "cannot set terminal process group (%d)" +msgstr "no se puede establecer el grupo de proceso de terminal (%d)" + +#: jobs.c:3888 +msgid "no job control in this shell" +msgstr "no hay control de trabajos en este shell" + +#: lib/malloc/malloc.c:296 +#, c-format +msgid "malloc: failed assertion: %s\n" +msgstr "malloc: falló la aserción: %s\n" + +#: lib/malloc/malloc.c:312 +#, c-format +msgid "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" +msgstr "" +"\r\n" +"malloc: %s:%d: aserción arruinada\r\n" + +#: lib/malloc/malloc.c:313 +msgid "unknown" +msgstr "desconocido" + +#: lib/malloc/malloc.c:801 +msgid "malloc: block on free list clobbered" +msgstr "malloc: bloque en la lista libre sobreescrito" + +#: lib/malloc/malloc.c:878 +msgid "free: called with already freed block argument" +msgstr "free: se llamó con un argumento de bloque previamente liberado" + +#: lib/malloc/malloc.c:881 +msgid "free: called with unallocated block argument" +msgstr "free: se llamó con un argumento de bloque sin asignar" + +#: lib/malloc/malloc.c:900 +msgid "free: underflow detected; mh_nbytes out of range" +msgstr "" +"free: se detectó un desbordamiento por debajo; mh_nbytes fuera de rango" + +#: lib/malloc/malloc.c:906 +msgid "free: start and end chunk sizes differ" +msgstr "free: los tamaños de los pedazos de inicio y fin son diferentes" + +#: lib/malloc/malloc.c:1005 +msgid "realloc: called with unallocated block argument" +msgstr "realloc: se llamó con un argumento de bloque sin asignar" + +#: lib/malloc/malloc.c:1020 +msgid "realloc: underflow detected; mh_nbytes out of range" +msgstr "" +"realloc: se detectó un desbordamiento por debajo; mh_nbytes fuera de rango" + +#: lib/malloc/malloc.c:1026 +msgid "realloc: start and end chunk sizes differ" +msgstr "realloc: los tamaños de los pedazos de inicio y fin son diferentes" + +#: lib/malloc/table.c:194 +#, c-format +msgid "register_alloc: alloc table is full with FIND_ALLOC?\n" +msgstr "register_alloc: ¿la tabla alloc está llena con FIND_ALLOC?\n" + +#: lib/malloc/table.c:203 +#, c-format +msgid "register_alloc: %p already in table as allocated?\n" +msgstr "register_alloc: ¿%p ya está en la tabla como asignado?\n" + +#: lib/malloc/table.c:256 +#, c-format +msgid "register_free: %p already in table as free?\n" +msgstr "register_free: ¿%p ya está en la tabla como libre?\n" + +#: lib/sh/fmtulong.c:102 +msgid "invalid base" +msgstr "base inválida" + +#: lib/sh/netopen.c:168 +#, c-format +msgid "%s: host unknown" +msgstr "%s: anfitrión desconocido" + +#: lib/sh/netopen.c:175 +#, c-format +msgid "%s: invalid service" +msgstr "%s: servicio inválido" + +#: lib/sh/netopen.c:306 +#, c-format +msgid "%s: bad network path specification" +msgstr "%s: especificación de ruta de red errónea" + +#: lib/sh/netopen.c:346 +msgid "network operations not supported" +msgstr "no hay soporte para operaciones de red" + +#: locale.c:200 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s)" +msgstr "setlocale: LC_ALL: no se puede cambiar el local (%s)" + +#: locale.c:202 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s): %s" +msgstr "setlocale: LC_ALL: no se puede cambiar el local (%s): %s" + +#: locale.c:259 +#, c-format +msgid "setlocale: %s: cannot change locale (%s)" +msgstr "setlocale: %s: no se puede cambiar el local (%s)" + +#: locale.c:261 +#, c-format +msgid "setlocale: %s: cannot change locale (%s): %s" +msgstr "setlocale: %s: no se puede cambiar el local (%s): %s" + +#: mailcheck.c:439 +msgid "You have mail in $_" +msgstr "Tiene correo en $_" + +#: mailcheck.c:464 +msgid "You have new mail in $_" +msgstr "Tiene correo nuevo en $_" + +#: mailcheck.c:480 +#, c-format +msgid "The mail in %s has been read\n" +msgstr "El correo en %s fue leído\n" + +#: make_cmd.c:323 +msgid "syntax error: arithmetic expression required" +msgstr "error sintáctico: se requiere una expresión aritmética" + +#: make_cmd.c:325 +msgid "syntax error: `;' unexpected" +msgstr "error sintáctico: `;' inesperado" + +#: make_cmd.c:326 +#, c-format +msgid "syntax error: `((%s))'" +msgstr "error sintáctico: `((%s))'" + +#: make_cmd.c:578 +#, c-format +msgid "make_here_document: bad instruction type %d" +msgstr "make_here_document: tipo de instrucción %d erróneo" + +#: make_cmd.c:662 +#, c-format +msgid "here-document at line %d delimited by end-of-file (wanted `%s')" +msgstr "" +"el documento-aquí en la línea %d está delimitado por fin-de-fichero (se " +"esperaba `%s')" + +#: make_cmd.c:759 +#, c-format +msgid "make_redirection: redirection instruction `%d' out of range" +msgstr "" +"make_redirection: la instrucción de redirección `%d' está fuera de rango" + +#: parse.y:3278 parse.y:3561 +#, c-format +msgid "unexpected EOF while looking for matching `%c'" +msgstr "EOF inesperado mientras se buscaba un `%c' coincidente" + +#: parse.y:4170 +msgid "unexpected EOF while looking for `]]'" +msgstr "EOF inesperado mientras se buscaba `]]'" + +#: parse.y:4175 +#, c-format +msgid "syntax error in conditional expression: unexpected token `%s'" +msgstr "error sintáctico en la expresión condicional: elemento inesperado `%s'" + +#: parse.y:4179 +msgid "syntax error in conditional expression" +msgstr "error sintáctico en la expresión condicional" + +#: parse.y:4257 +#, c-format +msgid "unexpected token `%s', expected `)'" +msgstr "elemento inesperado `%s', se esperaba `)'" + +#: parse.y:4261 +msgid "expected `)'" +msgstr "se esperaba `)'" + +#: parse.y:4289 +#, c-format +msgid "unexpected argument `%s' to conditional unary operator" +msgstr "argumento inesperado `%s' para el operador unario condicional" + +#: parse.y:4293 +msgid "unexpected argument to conditional unary operator" +msgstr "argumento inesperado para el operador unario condicional" + +#: parse.y:4339 +#, c-format +msgid "unexpected token `%s', conditional binary operator expected" +msgstr "elemento inesperado `%s', se esperaba un operador binario condicional" + +#: parse.y:4343 +msgid "conditional binary operator expected" +msgstr "se esperaba un operador binario condicional" + +#: parse.y:4365 +#, c-format +msgid "unexpected argument `%s' to conditional binary operator" +msgstr "argumento inesperado `%s' para el operador binario condicional" + +#: parse.y:4369 +msgid "unexpected argument to conditional binary operator" +msgstr "argumento inesperado para el operador binario condicional" + +#: parse.y:4380 +#, c-format +msgid "unexpected token `%c' in conditional command" +msgstr "elemento inesperado `%c' en la orden condicional" + +#: parse.y:4383 +#, c-format +msgid "unexpected token `%s' in conditional command" +msgstr "elemento inesperado `%s' en la orden condicional" + +#: parse.y:4387 +#, c-format +msgid "unexpected token %d in conditional command" +msgstr "elemento inesperado %d en la orden condicional" + +# Token: elemento ? +# error sintáctico, no se esperaba el símbolo `%c' em+ +# No puedo tomar tal cual la corrección. El error puede no ser +# provocado por el símbolo. Simplemente estar cerca del mismo. cfuga +# Por consistencia con el siguiente, yo borraría la coma. sv +# Cierto. Coma borrada. cfuga +#: parse.y:5737 +#, c-format +msgid "syntax error near unexpected token `%s'" +msgstr "error sintáctico cerca del elemento inesperado `%s'" + +#: parse.y:5755 +#, c-format +msgid "syntax error near `%s'" +msgstr "error sintáctico cerca de `%s'" + +# Propongo cambio de orden: +# no se esperaba el final de la línea em+ +# Ojo, que end of file es fin de fichero, no de línea. sv +# Se hicieron ambos cambios. cfuga +#: parse.y:5765 +msgid "syntax error: unexpected end of file" +msgstr "error sintáctico: no se esperaba el final del fichero" + +#: parse.y:5765 +msgid "syntax error" +msgstr "error sintáctico" + +#: parse.y:5827 +#, c-format +msgid "Use \"%s\" to leave the shell.\n" +msgstr "Use \"%s\" para dejar el shell.\n" + +#: parse.y:5989 +msgid "unexpected EOF while looking for matching `)'" +msgstr "EOF inesperado mientras se buscaba un `)' coincidente" + +#: pcomplete.c:1094 +#, c-format +msgid "completion: function `%s' not found" +msgstr "completion: no se encuentra la función `%s'" + +#: pcomplib.c:182 +#, c-format +msgid "progcomp_insert: %s: NULL COMPSPEC" +msgstr "progcomp_insert: %s: COMPSPEC nulo" + +#: print_cmd.c:300 +#, c-format +msgid "print_command: bad connector `%d'" +msgstr "print_command: conector erróneo `%d'" + +#: print_cmd.c:373 +#, c-format +msgid "xtrace_set: %d: invalid file descriptor" +msgstr "xtrace_set: %d: descriptor de fichero inválido" + +#: print_cmd.c:378 +msgid "xtrace_set: NULL file pointer" +msgstr "xtrace_set: puntero a fichero NULL" + +#: print_cmd.c:382 +#, c-format +msgid "xtrace fd (%d) != fileno xtrace fp (%d)" +msgstr "xtrace fd (%d) != numfich xtrace fp (%d)" + +#: print_cmd.c:1518 +#, c-format +msgid "cprintf: `%c': invalid format character" +msgstr "cprintf: `%c': carácter de formato inválido" + +#: redir.c:123 redir.c:170 +msgid "file descriptor out of range" +msgstr "descriptor de fichero fuera de rango" + +#: redir.c:177 +#, c-format +msgid "%s: ambiguous redirect" +msgstr "%s: redireccionamiento ambiguo" + +#: redir.c:181 +#, c-format +msgid "%s: cannot overwrite existing file" +msgstr "%s: no se puede sobreescribir un fichero existente" + +#: redir.c:186 +#, c-format +msgid "%s: restricted: cannot redirect output" +msgstr "%s: restringido: no se puede redirigir la salida" + +#: redir.c:191 +#, c-format +msgid "cannot create temp file for here-document: %s" +msgstr "no se puede crear un fichero temporal para el documento-aquí: %s" + +#: redir.c:195 +#, c-format +msgid "%s: cannot assign fd to variable" +msgstr "%s: no se puede asignar el fd a la variable" + +#: redir.c:582 +msgid "/dev/(tcp|udp)/host/port not supported without networking" +msgstr "no se admite /dev/(tcp|udp)/anfitrion/puerto sin red" + +#: redir.c:861 redir.c:973 redir.c:1034 redir.c:1199 +msgid "redirection error: cannot duplicate fd" +msgstr "error de redirección: no se puede duplicar el df" + +#: shell.c:339 +msgid "could not find /tmp, please create!" +msgstr "¡no se puede encontrar /tmp, crear por favor!" + +#: shell.c:343 +msgid "/tmp must be a valid directory name" +msgstr "/tmp debe ser un nombre de directorio válido" + +#: shell.c:890 +#, c-format +msgid "%c%c: invalid option" +msgstr "%c%c: opción inválida" + +# Yo pondría "no tengo ningún nombre". sv +# Revisé el código fuente de bash. Es un mensaje de error cuando no se +# encuentra el nombre del usuario que ejecuta el shell. cfuga +#: shell.c:1682 +msgid "I have no name!" +msgstr "¡No tengo nombre de usuario!" + +#: shell.c:1827 +#, c-format +msgid "GNU bash, version %s-(%s)\n" +msgstr "GNU bash, versión %s-(%s)\n" + +# En la lista spanglish se discutió mucho sobre script, +# no sé en que quedó, ni puedo decirte ahora cómo lo hemos +# traducido en otras ocasiones. Sehll script lo henmos traducido +# como guión del shell , eso es seguro ... así que puede estar +# bien así , ya lo verán otros em+ +#: shell.c:1828 +#, c-format +msgid "" +"Usage:\t%s [GNU long option] [option] ...\n" +"\t%s [GNU long option] [option] script-file ...\n" +msgstr "" +"Modo de empleo:\t%s [opción GNU larga] [opción] ...\n" +"\t%s [opción GNU larga] [opción] guión-del-shell\n" + +#: shell.c:1830 +msgid "GNU long options:\n" +msgstr "Opciones GNU largas:\n" + +#: shell.c:1834 +msgid "Shell options:\n" +msgstr "Opciones del shell:\n" + +#: shell.c:1835 +#, fuzzy +msgid "\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n" +msgstr "\t-irsD o -c orden o -O opcion_shopt\t\t(sólo invocación)\n" + +#: shell.c:1850 +#, c-format +msgid "\t-%s or -o option\n" +msgstr "\t-%s o -o opción\n" + +#: shell.c:1856 +#, c-format +msgid "Type `%s -c \"help set\"' for more information about shell options.\n" +msgstr "" +"Teclee `%s -c \"help set\"' para más información sobre las opciones del " +"shell.\n" + +#: shell.c:1857 +#, c-format +msgid "Type `%s -c help' for more information about shell builtin commands.\n" +msgstr "" +"Teclee `%s -c help' para más información sobre las órdenes internas del " +"shell.\n" + +#: shell.c:1858 +#, c-format +msgid "Use the `bashbug' command to report bugs.\n" +msgstr "Use la orden `bashbug' para reportar bichos.\n" + +#: sig.c:691 +#, c-format +msgid "sigprocmask: %d: invalid operation" +msgstr "sigprocmask: %d: operación inválida" + +#: siglist.c:48 +msgid "Bogus signal" +msgstr "Señal ambigua" + +#: siglist.c:51 +msgid "Hangup" +msgstr "Colgar" + +#: siglist.c:55 +msgid "Interrupt" +msgstr "Interrumpir" + +#: siglist.c:59 +msgid "Quit" +msgstr "Salir" + +#: siglist.c:63 +msgid "Illegal instruction" +msgstr "Instrucción ilegal" + +#: siglist.c:67 +msgid "BPT trace/trap" +msgstr "BPT rastreo/captura" + +#: siglist.c:75 +msgid "ABORT instruction" +msgstr "instrucción ABORT" + +#: siglist.c:79 +msgid "EMT instruction" +msgstr "instrucción EMT" + +#: siglist.c:83 +msgid "Floating point exception" +msgstr "Excepción de coma flotante" + +#: siglist.c:87 +msgid "Killed" +msgstr "Matado" + +#: siglist.c:91 +msgid "Bus error" +msgstr "Error en el bus" + +#: siglist.c:95 +msgid "Segmentation fault" +msgstr "Violación de segmento" + +# llamada del sistema em+ +# Es una llamada a una función del sistema em+ +# De acuerdo, pero lo que está mal es la forma de invocar la +# llamada a la función del sistema, no la llamada en sí cfuga +#: siglist.c:99 +msgid "Bad system call" +msgstr "Llamada al sistema errónea" + +# (pipe) no, por favor. Esto ya está traducido en libc, así que a estas +# alturas, la gente ya debería saber qué es eso de la tubería. sv +# De acuerdo. cfuga +#: siglist.c:103 +msgid "Broken pipe" +msgstr "Tubería rota" + +#: siglist.c:107 +msgid "Alarm clock" +msgstr "Temporizador" + +#: siglist.c:111 +msgid "Terminated" +msgstr "Terminado" + +#: siglist.c:115 +msgid "Urgent IO condition" +msgstr "Condición de E/S urgente" + +#: siglist.c:119 +msgid "Stopped (signal)" +msgstr "Detenido (señal)" + +#: siglist.c:127 +msgid "Continue" +msgstr "Continúa" + +#: siglist.c:135 +msgid "Child death or stop" +msgstr "El proceso hijo ha muerto o está parado" + +#: siglist.c:139 +msgid "Stopped (tty input)" +msgstr "Detenido (entrada por terminal)" + +#: siglist.c:143 +msgid "Stopped (tty output)" +msgstr "Detenido (salida por terminal)" + +#: siglist.c:147 +msgid "I/O ready" +msgstr "E/S listas" + +#: siglist.c:151 +msgid "CPU limit" +msgstr "Límite de CPU" + +#: siglist.c:155 +msgid "File limit" +msgstr "Límite de ficheros" + +#: siglist.c:159 +msgid "Alarm (virtual)" +msgstr "Alarma (virtual)" + +#: siglist.c:163 +msgid "Alarm (profile)" +msgstr "Alarma (entorno)" + +#: siglist.c:167 +msgid "Window changed" +msgstr "Ventana cambiada" + +#: siglist.c:171 +msgid "Record lock" +msgstr "Bloqueo de grabación" + +#: siglist.c:175 +msgid "User signal 1" +msgstr "Señal de usuario 1" + +#: siglist.c:179 +msgid "User signal 2" +msgstr "Señal de usuario 2" + +#: siglist.c:183 +msgid "HFT input data pending" +msgstr "entrada de datos HFT pendiente" + +# falla: fallo em+ +# Suscribo lo anterior. falla suena muy raro. +# Yo lo pondría además al revés: fallo de energía inminente. sv +# Me gusta como lo sugieres. Cambio hecho. cfuga +#: siglist.c:187 +msgid "power failure imminent" +msgstr "fallo de energía inminente" + +#: siglist.c:191 +msgid "system crash imminent" +msgstr "caída del sistema inminente" + +#: siglist.c:195 +msgid "migrate process to another CPU" +msgstr "migrando el proceso a otra CPU" + +#: siglist.c:199 +msgid "programming error" +msgstr "error de programación" + +#: siglist.c:203 +msgid "HFT monitor mode granted" +msgstr "el modo monitor HFT ha sido concedido" + +#: siglist.c:207 +msgid "HFT monitor mode retracted" +msgstr "el modo monitor HTF ha sido retirado" + +#: siglist.c:211 +msgid "HFT sound sequence has completed" +msgstr "la secuencia de sonido HFT ha sido completado" + +#: siglist.c:215 +msgid "Information request" +msgstr "Solicitud de información" + +#: siglist.c:223 +msgid "Unknown Signal #" +msgstr "Señal Desconocida #" + +#: siglist.c:225 +#, c-format +msgid "Unknown Signal #%d" +msgstr "Señal Desconocida #%d" + +#: subst.c:1362 subst.c:1520 +#, c-format +msgid "bad substitution: no closing `%s' in %s" +msgstr "sustitución errónea: no hay un `%s' que cierre en %s" + +#: subst.c:2847 +#, c-format +msgid "%s: cannot assign list to array member" +msgstr "%s: no se puede asignar una lista a un miembro de la matriz" + +#: subst.c:5065 subst.c:5081 +msgid "cannot make pipe for process substitution" +msgstr "no se puede crear la tubería para la sustitución del proceso" + +#: subst.c:5113 +msgid "cannot make child for process substitution" +msgstr "no se puede crear un proceso hijo para la sustitución del proceso" + +#: subst.c:5158 +#, c-format +msgid "cannot open named pipe %s for reading" +msgstr "no se puede abrir la tubería llamada %s para lectura" + +#: subst.c:5160 +#, c-format +msgid "cannot open named pipe %s for writing" +msgstr "no se puede abrir la tubería llamada %s para escritura" + +#: subst.c:5178 +#, c-format +msgid "cannot duplicate named pipe %s as fd %d" +msgstr "no se puede duplicar la tubería llamada %s como df %d" + +#: subst.c:5376 +msgid "cannot make pipe for command substitution" +msgstr "no se pueden crear la tubería para la sustitución de la orden" + +#: subst.c:5414 +msgid "cannot make child for command substitution" +msgstr "no se puede crear un proceso hijo para la sustitución de la orden" + +#: subst.c:5433 +msgid "command_substitute: cannot duplicate pipe as fd 1" +msgstr "command_substitute: no se puede duplicar la tubería como df 1" + +#: subst.c:5837 subst.c:8050 +#, fuzzy, c-format +msgid "%s: invalid variable name for name reference" +msgstr "%s: %s: valor inválido para el descriptor de fichero de rastreo" + +#: subst.c:6048 +#, c-format +msgid "%s: parameter null or not set" +msgstr "%s: parámetro nulo o no establecido" + +#: subst.c:6320 subst.c:6335 +#, c-format +msgid "%s: substring expression < 0" +msgstr "%s: expresión de subcadena < 0" + +#: subst.c:7506 +#, c-format +msgid "%s: bad substitution" +msgstr "%s: sustitución errónea" + +#: subst.c:7583 +#, c-format +msgid "$%s: cannot assign in this way" +msgstr "$%s: no se puede asignar de esta forma" + +#: subst.c:7917 +msgid "" +"future versions of the shell will force evaluation as an arithmetic " +"substitution" +msgstr "" +"versiones futuras del intérprete obligarán la evaluación como una " +"sustitución aritmética" + +#: subst.c:8421 +#, c-format +msgid "bad substitution: no closing \"`\" in %s" +msgstr "sustitución errónea: no hay una \"`\" que cierre en %s" + +#: subst.c:9322 +#, c-format +msgid "no match: %s" +msgstr "no hay coincidencia: %s" + +#: test.c:147 +msgid "argument expected" +msgstr "se esperaba un argumento" + +#: test.c:156 +#, c-format +msgid "%s: integer expression expected" +msgstr "%s: se esperaba una expresión entera" + +#: test.c:264 +msgid "`)' expected" +msgstr "se esperaba `)'" + +#: test.c:266 +#, c-format +msgid "`)' expected, found %s" +msgstr "se esperaba `)', se encontró %s" + +#: test.c:281 test.c:742 test.c:745 +#, c-format +msgid "%s: unary operator expected" +msgstr "%s: se esperaba un operador unario" + +#: test.c:468 test.c:785 +#, c-format +msgid "%s: binary operator expected" +msgstr "%s: se esperaba un operador binario" + +# Singular em+ +# Puede faltar más de un ] cfuga +# Cierto, pero al menos uno seguro que falta. +# Yo creo que no hace falta el (n). sv +# Abreviando "falta [al menos] un `]'" saldría: "falta un `]'". +# ¿No es mejor "falta algún `]'"? cfuga +# Tiene razón Enrique: singular. cfuga +#: test.c:860 +msgid "missing `]'" +msgstr "falta un `]'" + +#: trap.c:217 +msgid "invalid signal number" +msgstr "número de señal inválido" + +#: trap.c:371 +#, c-format +msgid "run_pending_traps: bad value in trap_list[%d]: %p" +msgstr "run_pending_traps: valor erróneo en trap_list[%d]: %p" + +#: trap.c:375 +#, c-format +msgid "" +"run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" +msgstr "" +"run_pending_traps: el manejador de señal es SIG_DFL, reenviando %d (%s) a mí " +"mismo" + +#: trap.c:428 +#, c-format +msgid "trap_handler: bad signal %d" +msgstr "trap_handler: señal errónea %d" + +#: variables.c:382 +#, c-format +msgid "error importing function definition for `%s'" +msgstr "error al importar la definición de la función para `%s'" + +#: variables.c:780 +#, c-format +msgid "shell level (%d) too high, resetting to 1" +msgstr "el nivel de shell (%d) es demasiado alto, se reestablece a 1" + +#: variables.c:1865 +#, fuzzy, c-format +msgid "%s: circular name reference" +msgstr "%s: %s: valor inválido para el descriptor de fichero de rastreo" + +#: variables.c:2228 +msgid "make_local_variable: no function context at current scope" +msgstr "make_local_variable: no hay contexto de función en el ámbito actual" + +#: variables.c:2247 +#, fuzzy, c-format +msgid "%s: variable may not be assigned value" +msgstr "%s: no se puede asignar el fd a la variable" + +#: variables.c:3646 +msgid "all_local_variables: no function context at current scope" +msgstr "all_local_variables: no hay contexto de función en el ámbito actual" + +#: variables.c:3891 +#, c-format +msgid "%s has null exportstr" +msgstr "%s tiene exportstr nulo" + +#: variables.c:3896 variables.c:3905 +#, c-format +msgid "invalid character %d in exportstr for %s" +msgstr "carácter inválido %d en exportstr para %s" + +#: variables.c:3911 +#, c-format +msgid "no `=' in exportstr for %s" +msgstr "no hay `=' en exportstr para %s" + +#: variables.c:4344 +msgid "pop_var_context: head of shell_variables not a function context" +msgstr "" +"pop_var_context: la cabeza de shell_variables no es un contexto de función" + +#: variables.c:4357 +msgid "pop_var_context: no global_variables context" +msgstr "pop_var_context: no es un contexto global_variables" + +#: variables.c:4431 +msgid "pop_scope: head of shell_variables not a temporary environment scope" +msgstr "" +"pop_scope: la cabeza de shell_variables no es un ámbito de ambiente temporal" + +#: variables.c:5257 +#, c-format +msgid "%s: %s: cannot open as FILE" +msgstr "%s: %s: no se puede abrir como FICHERO" + +#: variables.c:5262 +#, c-format +msgid "%s: %s: invalid value for trace file descriptor" +msgstr "%s: %s: valor inválido para el descriptor de fichero de rastreo" + +#: variables.c:5307 +#, fuzzy, c-format +msgid "%s: %s: compatibility value out of range" +msgstr "%s: %s fuera de rango" + +#: version.c:46 +#, fuzzy +msgid "Copyright (C) 2013 Free Software Foundation, Inc." +msgstr "Copyright (C) 2011 Free Software Foundation, Inc." + +#: version.c:47 version2.c:47 +msgid "" +"License GPLv3+: GNU GPL version 3 or later \n" +msgstr "" +"Licencia GPLv3+: GPL de GNU versión 3 o posterior \n" + +#: version.c:86 version2.c:86 +#, c-format +msgid "GNU bash, version %s (%s)\n" +msgstr "GNU bash, versión %s (%s)\n" + +#: version.c:91 version2.c:91 +#, fuzzy +msgid "This is free software; you are free to change and redistribute it." +msgstr "" +"Esto es software libre; usted es libre de cambiarlo y redistribuirlo.\n" + +#: version.c:92 version2.c:92 +#, fuzzy +msgid "There is NO WARRANTY, to the extent permitted by law." +msgstr "NO hay GARANTÍA, a la extensión permitida por la ley.\n" + +#: version2.c:46 +#, fuzzy +msgid "Copyright (C) 2012 Free Software Foundation, Inc." +msgstr "Copyright (C) 2011 Free Software Foundation, Inc." + +#: xmalloc.c:91 +#, c-format +msgid "%s: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "%s: no se pueden asignar %lu bytes (%lu bytes asignados)" + +#: xmalloc.c:93 +#, c-format +msgid "%s: cannot allocate %lu bytes" +msgstr "%s: no se pueden asignar %lu bytes" + +#: xmalloc.c:163 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "%s: %s:%d: no se pueden asignar %lu bytes (%lu bytes asignados)" + +#: xmalloc.c:165 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes" +msgstr "%s: %s:%d: no se pueden asignar %lu bytes" + +#: builtins.c:43 +msgid "alias [-p] [name[=value] ... ]" +msgstr "alias [-p] [nombre[=valor] ... ]" + +#: builtins.c:47 +msgid "unalias [-a] name [name ...]" +msgstr "unalias [-a] nombre [nombre ...]" + +#: builtins.c:51 +#, fuzzy +msgid "" +"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-" +"x keyseq:shell-command] [keyseq:readline-function or readline-command]" +msgstr "" +"bind [-lpvsPVS] [-m comb_teclas] [-f fichero] [-q nombre] [-u nombre] [-r " +"secteclas] [-x secteclas:orden-shell] [secteclas:función-readline u orden-" +"readline]" + +#: builtins.c:54 +msgid "break [n]" +msgstr "break [n]" + +#: builtins.c:56 +msgid "continue [n]" +msgstr "continue [n]" + +#: builtins.c:58 +msgid "builtin [shell-builtin [arg ...]]" +msgstr "builtin [orden-interna-shell [arg ...]]" + +#: builtins.c:61 +msgid "caller [expr]" +msgstr "caller [expresión]" + +#: builtins.c:64 +#, fuzzy +msgid "cd [-L|[-P [-e]] [-@]] [dir]" +msgstr "cd [-L|[-P [-e]]] [directorio]" + +#: builtins.c:66 +msgid "pwd [-LP]" +msgstr "pwd [-LP]" + +#: builtins.c:68 +msgid ":" +msgstr ":" + +#: builtins.c:70 +msgid "true" +msgstr "true" + +#: builtins.c:72 +msgid "false" +msgstr "false" + +#: builtins.c:74 +msgid "command [-pVv] command [arg ...]" +msgstr "command [-pVv] orden [arg ...]" + +#: builtins.c:76 +#, fuzzy +msgid "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" +msgstr "declare [-aAfFgilrtux] [-p] nombre[=valor] ..." + +#: builtins.c:78 +msgid "typeset [-aAfFgilrtux] [-p] name[=value] ..." +msgstr "typeset [-aAfFgilrtux] [-p] nombre[=valor] ..." + +#: builtins.c:80 +msgid "local [option] name[=value] ..." +msgstr "local [opción] nombre[=valor] ..." + +#: builtins.c:83 +msgid "echo [-neE] [arg ...]" +msgstr "echo [-neE] [arg ...]" + +#: builtins.c:87 +msgid "echo [-n] [arg ...]" +msgstr "echo [-n] [arg ...]" + +#: builtins.c:90 +msgid "enable [-a] [-dnps] [-f filename] [name ...]" +msgstr "enable [-a] [-dnps] [-f fichero] [nombre ...]" + +#: builtins.c:92 +msgid "eval [arg ...]" +msgstr "eval [arg ...]" + +#: builtins.c:94 +msgid "getopts optstring name [arg]" +msgstr "getopts cadena_opciones nombre [arg]" + +#: builtins.c:96 +msgid "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" +msgstr "exec [-cl] [-a nombre] [orden [argumentos ...]] [redirección ...]" + +#: builtins.c:98 +msgid "exit [n]" +msgstr "exit [n]" + +#: builtins.c:100 +msgid "logout [n]" +msgstr "logout [n]" + +#: builtins.c:103 +msgid "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" +msgstr "fc [-e nombre_e] [-lnr] [primero] [último] ó fc -s [pat=rep] [orden]" + +#: builtins.c:107 +msgid "fg [job_spec]" +msgstr "fg [id_trabajo]" + +#: builtins.c:111 +msgid "bg [job_spec ...]" +msgstr "bg [id_trabajo ...]" + +#: builtins.c:114 +msgid "hash [-lr] [-p pathname] [-dt] [name ...]" +msgstr "hash [-lr] [-p ruta] [-dt] [nombre ...]" + +#: builtins.c:117 +msgid "help [-dms] [pattern ...]" +msgstr "help [-dms] [patrón ...]" + +#: builtins.c:121 +msgid "" +"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg " +"[arg...]" +msgstr "" +"history [-c] [-d despl] [n] ó history -anrw [fichero] ó history -ps arg " +"[arg...]" + +# jobspec no es sólo el pid del proceso, puede ser tambien +# el nombre de la orden que se creo con el proceso em+ +# por eso es idtrabajo, no pidtrabajo. De cualquier forma, no me agrada +# mucho. ¿Sugerencias? cfuga +#: builtins.c:125 +msgid "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" +msgstr "jobs [-lnprs] [idtrabajo ...] ó jobs -x orden [args]" + +# lo mismo em+ +#: builtins.c:129 +msgid "disown [-h] [-ar] [jobspec ...]" +msgstr "disown [-h] [-ar] [idtrabajo ...]" + +#: builtins.c:132 +msgid "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l " +"[sigspec]" +msgstr "" +"kill [-s id_señal | -n num_señal | -id_señal] pid | idtrabajo ... ó kill -l " +"[id_señal]" + +#: builtins.c:134 +msgid "let arg [arg ...]" +msgstr "let arg [arg ...]" + +#: builtins.c:136 +msgid "" +"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p " +"prompt] [-t timeout] [-u fd] [name ...]" +msgstr "" +"read [-ers] [-a matriz] [-d delim] [-i texto] [-n ncars] [-N ncars] [-p " +"prompt] [-t tiempo] [-u df] [nombre ...]" + +#: builtins.c:138 +msgid "return [n]" +msgstr "return [n]" + +#: builtins.c:140 +msgid "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" +msgstr "set [-abefhkmnptuvxBCHP] [-o nombre-opción] [--] [arg ...]" + +#: builtins.c:142 +#, fuzzy +msgid "unset [-f] [-v] [-n] [name ...]" +msgstr "unset [-f] [-v] [nombre ...]" + +#: builtins.c:144 +msgid "export [-fn] [name[=value] ...] or export -p" +msgstr "export [-fn] [nombre[=valor] ...] ó export -p" + +#: builtins.c:146 +msgid "readonly [-aAf] [name[=value] ...] or readonly -p" +msgstr "readonly [-aAf] [nombre[=valor] ...] ó readonly -p" + +#: builtins.c:148 +msgid "shift [n]" +msgstr "shift [n]" + +#: builtins.c:150 +msgid "source filename [arguments]" +msgstr "source fichero [argumentos]" + +#: builtins.c:152 +msgid ". filename [arguments]" +msgstr ". fichero [argumentos]" + +#: builtins.c:155 +msgid "suspend [-f]" +msgstr "suspend [-f]" + +#: builtins.c:158 +msgid "test [expr]" +msgstr "test [expresión]" + +#: builtins.c:160 +msgid "[ arg... ]" +msgstr "[ arg... ]" + +# Esto podría ser "veces". Mirar el contexto. sv +# No es veces. times es una orden interna del shell. cfuga +#: builtins.c:162 +msgid "times" +msgstr "times" + +#: builtins.c:164 +msgid "trap [-lp] [[arg] signal_spec ...]" +msgstr "trap [-lp] [[arg] id_señal ...]" + +#: builtins.c:166 +msgid "type [-afptP] name [name ...]" +msgstr "type [-afptP] nombre [nombre ...]" + +#: builtins.c:169 +#, fuzzy +msgid "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" +msgstr "ulimit [-SHacdefilmnpqrstuvx] [límite]" + +#: builtins.c:172 +msgid "umask [-p] [-S] [mode]" +msgstr "umask [-p] [-S] [modo]" + +#: builtins.c:175 +#, fuzzy +msgid "wait [-n] [id ...]" +msgstr "wait [id]" + +#: builtins.c:179 +#, fuzzy +msgid "wait [pid ...]" +msgstr "wait [id]" + +#: builtins.c:182 +msgid "for NAME [in WORDS ... ] ; do COMMANDS; done" +msgstr "for NOMBRE [in PALABRAS ... ] ; do ÓRDENES; done" + +#: builtins.c:184 +msgid "for (( exp1; exp2; exp3 )); do COMMANDS; done" +msgstr "for (( exp1; exp2; exp3 )); do ÓRDENES; done" + +#: builtins.c:186 +msgid "select NAME [in WORDS ... ;] do COMMANDS; done" +msgstr "select NOMBRE [in PALABRAS ... ;] do ÓRDENES; done" + +#: builtins.c:188 +msgid "time [-p] pipeline" +msgstr "time [-p] tubería" + +#: builtins.c:190 +msgid "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" +msgstr "case PALABRA in [PATRÓN [| PATRÓN]...) ÓRDENES ;;]... esac" + +#: builtins.c:192 +msgid "" +"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else " +"COMMANDS; ] fi" +msgstr "" +"if ÓRDENES; then ÓRDENES; [ elif ÓRDENES; then ÓRDENES; ]...[ else " +"ÓRDENES; ] fi" + +#: builtins.c:194 +msgid "while COMMANDS; do COMMANDS; done" +msgstr "while ÓRDENES; do ÓRDENES; done" + +#: builtins.c:196 +msgid "until COMMANDS; do COMMANDS; done" +msgstr "until ÓRDENES; do ÓRDENES; done" + +#: builtins.c:198 +msgid "coproc [NAME] command [redirections]" +msgstr "coproc [NOMBRE] orden [redirecciones]" + +#: builtins.c:200 +msgid "function name { COMMANDS ; } or name () { COMMANDS ; }" +msgstr "function nombre { ÓRDENES ; } ó nombre () { ÓRDENES ; }" + +#: builtins.c:202 +msgid "{ COMMANDS ; }" +msgstr "{ ÓRDENES ; }" + +#: builtins.c:204 +msgid "job_spec [&]" +msgstr "id_trabajo [&]" + +#: builtins.c:206 +msgid "(( expression ))" +msgstr "(( expresión ))" + +#: builtins.c:208 +msgid "[[ expression ]]" +msgstr "[[ expresión ]]" + +#: builtins.c:210 +msgid "variables - Names and meanings of some shell variables" +msgstr "variables - Nombres y significados de algunas variables de shell" + +#: builtins.c:213 +msgid "pushd [-n] [+N | -N | dir]" +msgstr "pushd [-n] [+N | -N | dir" + +#: builtins.c:217 +msgid "popd [-n] [+N | -N]" +msgstr "popd [-n] [+N | -N]" + +#: builtins.c:221 +msgid "dirs [-clpv] [+N] [-N]" +msgstr "dirs [-clpv] [+N] [-N]" + +#: builtins.c:224 +msgid "shopt [-pqsu] [-o] [optname ...]" +msgstr "shopt [-pqsu] [-o] [nombre_opción...]" + +#: builtins.c:226 +msgid "printf [-v var] format [arguments]" +msgstr "printf [-v var] formato [argumentos]" + +#: builtins.c:229 +msgid "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-" +"W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S " +"suffix] [name ...]" +msgstr "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o opción] [-A acción] [-G patglob] [-" +"W listapalabras] [-F función] [-C orden] [-X patfiltro] [-P prefijo] [-S " +"sufijo] [nombre ...]" + +#: builtins.c:233 +msgid "" +"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " +"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" +msgstr "" +"compgen [-abcdefgjksuv] [-o opción] [-A acción] [-G patglob] [-W " +"listapalabras] [-F función] [-C orden] [-X patfiltro] [-P prefijo] [-S " +"sufijo] [palabra]" + +#: builtins.c:237 +msgid "compopt [-o|+o option] [-DE] [name ...]" +msgstr "compopt [-o|+o opción] [-DE] [nombre ...]" + +#: builtins.c:240 +msgid "" +"mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" +"mapfile [-n cuenta] [-O origen] [-s cuenta] [-t] [-u df] [-C llamada] [-c " +"quantum] [matriz]" + +#: builtins.c:242 +msgid "" +"readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" +"readarray [-n cuenta] [-O origen] [-s cuenta] [-t] [-u df] [-C llamada] [-c " +"quantum] [matriz]" + +# Más en español sería: se define un alias por cada NOMBRE cuyo VALOR se da. sv +# Lo mismo de antes: el alias es expandido -> el alias se expande. sv +# no alias -> ningún alias. sv +# De acuerdo. cfuga +#: builtins.c:254 +msgid "" +"Define or display aliases.\n" +" \n" +" Without arguments, `alias' prints the list of aliases in the reusable\n" +" form `alias NAME=VALUE' on standard output.\n" +" \n" +" Otherwise, an alias is defined for each NAME whose VALUE is given.\n" +" A trailing space in VALUE causes the next word to be checked for\n" +" alias substitution when the alias is expanded.\n" +" \n" +" Options:\n" +" -p\tPrint all defined aliases in a reusable format\n" +" \n" +" Exit Status:\n" +" alias returns true unless a NAME is supplied for which no alias has " +"been\n" +" defined." +msgstr "" +"Define o muestra aliases.\n" +" \n" +" `alias' sin argumentos muestra la lista de aliases en la forma\n" +" reutilizable `alias NOMBRE=VALOR' en la salida estándar.\n" +" \n" +" De otra manera, se define un alias por cada NOMBRE cuyo VALOR se\n" +" proporcione. Un espacio final en VALOR causa que se revise\n" +" la siguiente palabra para sustitución de alias cuando se expande\n" +" el alias.\n" +" \n" +" Opciones:\n" +" -p\tMuestra todos los aliases definidos en un formato reusable\n" +" \n" +" Estado de salida:\n" +" alias devuelve verdadero a menos que se de un NOMBRE para el cual\n" +" no se haya definido ningún alias." + +#: builtins.c:276 +msgid "" +"Remove each NAME from the list of defined aliases.\n" +" \n" +" Options:\n" +" -a\tremove all alias definitions.\n" +" \n" +" Return success unless a NAME is not an existing alias." +msgstr "" +"Borra cada NOMBRE de la lista de alias definidos.\n" +" \n" +" Opciones:\n" +" -a\telimina todas las definiciones de alias.\n" +" Devuelve verdadero a menos que un NOMBRE no sea un alias existente." + +# lee 'la'... em+ +# Corregido. Además, es plural: lee las asignaciones... cfuga +#: builtins.c:289 +#, fuzzy +msgid "" +"Set Readline key bindings and variables.\n" +" \n" +" Bind a key sequence to a Readline function or a macro, or set a\n" +" Readline variable. The non-option argument syntax is equivalent to\n" +" that found in ~/.inputrc, but must be passed as a single argument:\n" +" e.g., bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Options:\n" +" -m keymap Use KEYMAP as the keymap for the duration of this\n" +" command. Acceptable keymap names are emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" +"move,\n" +" vi-command, and vi-insert.\n" +" -l List names of functions.\n" +" -P List function names and bindings.\n" +" -p List functions and bindings in a form that can be\n" +" reused as input.\n" +" -S List key sequences that invoke macros and their " +"values\n" +" -s List key sequences that invoke macros and their " +"values\n" +" in a form that can be reused as input.\n" +" -V List variable names and values\n" +" -v List variable names and values in a form that can\n" +" be reused as input.\n" +" -q function-name Query about which keys invoke the named function.\n" +" -u function-name Unbind all keys which are bound to the named " +"function.\n" +" -r keyseq Remove the binding for KEYSEQ.\n" +" -f filename Read key bindings from FILENAME.\n" +" -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when\n" +" \t\t\t\tKEYSEQ is entered.\n" +" -X\t\t List key sequences bound with -x and associated commands\n" +" in a form that can be reused as input.\n" +" \n" +" Exit Status:\n" +" bind returns 0 unless an unrecognized option is given or an error occurs." +msgstr "" +"Establece secuencias de teclas Readline y variables.\n" +"\n" +" Asigna una secuencia de teclas a una función Readline o a una macro, o\n" +" establece una variable Readline. La sintaxis de los argumentos que\n" +" no son opciones es equivalente a la que se encuentra en ~/.inputrc,\n" +" pero se debe pasar como un solo argumento:\n" +" p.e., bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Opciones:\n" +" \n" +" -m comb_teclas Usa COMB_TECLAS como la combinación de teclas por " +"la\n" +" duración de esta orden. Los nombres de " +"combinaciones\n" +" de teclas aceptables son emacs, emacs-standard,\n" +" emacs-meta, emacs-ctlx, vi, vi-move, vi-command y\n" +" vi-insert.\n" +" -l Enlista los nombres de las funciones.\n" +" -P Enlista los nombres de las funciones y " +"asignaciones.\n" +" -p Enlista las funciones y asignaciones en una forma " +"que\n" +" se puede reusar como entrada.\n" +" -S Enlista las secuencias de teclas que invocan " +"macros\n" +" y sus valores.\n" +" -s Enlista las secuencias de teclas que invocan " +"macros\n" +" y sus valores en una forma que se pueden reusar " +"como\n" +" entrada.\n" +" -V Enlista los nombres de variables y valores.\n" +" -v Enlista los nombres de variables y valores en una\n" +" forma que se pueden reusar como entrada.\n" +" -q nombre-funcion Pregunta qué teclas invocan la función nombrada.\n" +" -u nombre-función Borra todas las teclas que están ligadas a\n" +" la función nombrada.\n" +" -r secteclas Borra la asignación para la SECTECLAS.\n" +" -f fichero Lee las asignaciones de teclas del FICHERO.\n" +" -x secteclas:orden-shell\tCausa que se ejecute la ORDEN-SHELL cuando\n" +" \t\t\t\tse introduce la SECTECLAS.\n" +" \n" +" Estado de salida:\n" +" bind devuelve 0 a menos que se presente una opción desconocida o suceda\n" +" un error." + +#: builtins.c:328 +msgid "" +"Exit for, while, or until loops.\n" +" \n" +" Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n" +" loops.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Termina ciclos for, while o until.\n" +" \n" +" Termina un ciclo FOR, WHILE o UNTIL. Si se especifica N, termina\n" +" N ciclos anidados.\n" +" \n" +" Estado de salida:\n" +" El estado de salida es 0 a menos que N no sea mayor o igual a 1." + +#: builtins.c:340 +msgid "" +"Resume for, while, or until loops.\n" +" \n" +" Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n" +" If N is specified, resumes the Nth enclosing loop.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Continúa iteraciones for, while o until\n" +" \n" +" Continúa la siguiente iteración del ciclo FOR, WHILE o UNTIL\n" +" circundante. Si se especifica N, retoma en el N-ésimo ciclo " +"circundante.\n" +" \n" +" Estado de Salida:\n" +" El estado de salida es 0 a menos que N no sea mayor o igual a 1." + +#: builtins.c:352 +msgid "" +"Execute shell builtins.\n" +" \n" +" Execute SHELL-BUILTIN with arguments ARGs without performing command\n" +" lookup. This is useful when you wish to reimplement a shell builtin\n" +" as a shell function, but need to execute the builtin within the " +"function.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n" +" not a shell builtin.." +msgstr "" +"Ejecuta órdenes internas del shell\n" +" \n" +" Ejecuta la ORDEN-INTERNA-SHELL con los argumentos ARGs sin realizar\n" +" la búsqueda interna de órdenes. Esto es útil cuando desea " +"reimplementar\n" +" una orden interna del shell como una función de shell, pero necesita\n" +" ejecutar la orden interna dentro de la función.\n" +" \n" +" Estado de Salida:\n" +" Devuelve el estado de salida de la ORDEN-INTERNA-SHELL, o falso si la\n" +" ORDEN-INTERNA-SHELL no es una orden interna de shell." + +#: builtins.c:367 +msgid "" +"Return the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns \"$line $filename\". With EXPR, returns\n" +" \"$line $subroutine $filename\"; this extra information can be used to\n" +" provide a stack trace.\n" +" \n" +" The value of EXPR indicates how many call frames to go back before the\n" +" current one; the top frame is frame 0.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless the shell is not executing a shell function or EXPR\n" +" is invalid." +msgstr "" +"Devuelve el contexto de la llamada a subrutina actual.\n" +" \n" +" Sin EXPR, devuelve \"$linea $nombrefichero\". Con EXPR, devuelve\n" +" \"$linea $subrutina $nombrefichero\"; esta información adicional\n" +" se puede usar para proveer un volcado de pila.\n" +" \n" +" El valor de EXPR indica cuántos marcos de llamada se debe retroceder\n" +" antes del actual; el marco inicial es el marco 0.\n" +" \n" +" Estado de Salida:\n" +" Devuelve 0 a menos que el shell no esté ejecutando una función de shell\n" +" o EXPR sea inválida." + +# Slash lo venimos traduciendo por barra inclinada , y backslash +# por barra invertida em++ +# Corregido en toda la traducción. cfuga +#: builtins.c:385 +#, fuzzy +msgid "" +"Change the shell working directory.\n" +" \n" +" Change the current directory to DIR. The default DIR is the value of " +"the\n" +" HOME shell variable.\n" +" \n" +" The variable CDPATH defines the search path for the directory " +"containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon " +"(:).\n" +" A null directory name is the same as the current directory. If DIR " +"begins\n" +" with a slash (/), then CDPATH is not used.\n" +" \n" +" If the directory is not found, and the shell option `cdable_vars' is " +"set,\n" +" the word is assumed to be a variable name. If that variable has a " +"value,\n" +" its value is used for DIR.\n" +" \n" +" Options:\n" +" -L\tforce symbolic links to be followed: resolve symbolic links in\n" +" \tDIR after processing instances of `..'\n" +" -P\tuse the physical directory structure without following symbolic\n" +" \tlinks: resolve symbolic links in DIR before processing instances\n" +" \tof `..'\n" +" -e\tif the -P option is supplied, and the current working directory\n" +" \tcannot be determined successfully, exit with a non-zero status\n" +" -@ on systems that support it, present a file with extended " +"attributes\n" +" as a directory containing the file attributes\n" +" \n" +" The default is to follow symbolic links, as if `-L' were specified.\n" +" `..' is processed by removing the immediately previous pathname " +"component\n" +" back to a slash or the beginning of DIR.\n" +" \n" +" Exit Status:\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully " +"when\n" +" -P is used; non-zero otherwise." +msgstr "" +"Cambia el directorio de trabajo del shell.\n" +" \n" +" Cambia el directorio actual a DIR. DIR por defecto es el valor de la\n" +" variable de shell HOME.\n" +" \n" +" La variable CDPATH define la ruta de búsqueda por el directorio que\n" +" contiene DIR. Los nombres alternativos de directorio en CDPATH se\n" +" separan con dos puntos (:). Un nombre de directorio nulo es igual que\n" +" el directorio actual. Si DIR comienza con una barra inclinada (/),\n" +" entonces no se usa CDPATH.\n" +" \n" +" Si no se encuentra el directorio, y la opción del shell `cdable_vars'\n" +" está activa, entonces se trata la palabra como un nombre de variable.\n" +" Si esa variable tiene un valor, se utiliza su valor como DIR.\n" +" \n" +" Opciones:\n" +" -L\tfuerza a seguir los enlaces simbólicos\n" +" -P\tusa la estructura física de directorios sin seguir los enlaces\n" +" \tsimbólicos\n" +" -e\tsi se da la opción -P, y el directorio actual de trabajo no se\n" +" \tpuede determinar con éxito, termina con un estado diferente de cero.\n" +" \n" +" La acción por defecto es seguir los enlaces simbólicos, como si se\n" +" especificara `-L'.\n" +" \n" +" Estado de salida:\n" +" Devuelve 0 si se cambia el directorio, y si $PWD está definido con\n" +" éxito cuando se usa -P; de otra forma es diferente a cero." + +#: builtins.c:422 +msgid "" +"Print the name of the current working directory.\n" +" \n" +" Options:\n" +" -L\tprint the value of $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tprint the physical directory, without any symbolic links\n" +" \n" +" By default, `pwd' behaves as if `-L' were specified.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless an invalid option is given or the current directory\n" +" cannot be read." +msgstr "" +"Muestra el nombre del directorio de trabajo actual.\n" +" \n" +" Opciones:\n" +" -L\tmuestra el valor de $PWD si nombra al directorio de\n" +" \ttrabajo actual\n" +" -P\tmuestra el directorio físico, sin enlaces simbólicos\n" +" \n" +" Por defecto, `pwd' se comporta como si se especificara `-L'.\n" +" \n" +" Estado de Salida:\n" +" Devuelve 0 a menos que se de una opción inválida o no se pueda leer\n" +" el directorio actual." + +#: builtins.c:439 +msgid "" +"Null command.\n" +" \n" +" No effect; the command does nothing.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Orden nula.\n" +" \n" +" Sin efecto; la orden no hace nada.\n" +" \n" +" Estado de Salida:\n" +" Siempre con éxito." + +#: builtins.c:450 +msgid "" +"Return a successful result.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Devuelve un resultado con éxito.\n" +" \n" +" Estado de salida:\n" +" Siempre con éxito." + +#: builtins.c:459 +msgid "" +"Return an unsuccessful result.\n" +" \n" +" Exit Status:\n" +" Always fails." +msgstr "" +"Devuelve un resultado sin éxito.\n" +" \n" +" Estado de salida:\n" +" Siempre falla." + +#: builtins.c:468 +msgid "" +"Execute a simple command or display information about commands.\n" +" \n" +" Runs COMMAND with ARGS suppressing shell function lookup, or display\n" +" information about the specified COMMANDs. Can be used to invoke " +"commands\n" +" on disk when a function with the same name exists.\n" +" \n" +" Options:\n" +" -p\tuse a default value for PATH that is guaranteed to find all of\n" +" \tthe standard utilities\n" +" -v\tprint a description of COMMAND similar to the `type' builtin\n" +" -V\tprint a more verbose description of each COMMAND\n" +" \n" +" Exit Status:\n" +" Returns exit status of COMMAND, or failure if COMMAND is not found." +msgstr "" +"Ejecuta una orden simple o muestra información sobre órdenes.\n" +" \n" +" Ejecuta la ORDEN con ARGumentos, suprimiendo la búsqueda de funciones\n" +" de shell, o muestra información sobre las ÓRDENes especificadas. Se " +"puede\n" +" usar para invocar órdenes en disco cuando existe una función con el " +"mismo\n" +" nombre.\n" +" \n" +" Opciones:\n" +" -p\tusa un valor por defecto para PATH para garantizar que\n" +" \tencuentre todas las utilidades estándar\n" +" -v\tmuestra una descripción de la ORDEN similar a la orden\n" +" \tinterna `type'\n" +" -V\tmuestra una descripción más detallada de cada ORDEN\n" +" \n" +" Estado de Salida:\n" +" Devuelve el estado de salida de la ORDEN, o falla si no se encuentra\n" +" la ORDEN." + +#: builtins.c:487 +#, fuzzy +msgid "" +"Set variable values and attributes.\n" +" \n" +" Declare variables and give them attributes. If no NAMEs are given,\n" +" display the attributes and values of all variables.\n" +" \n" +" Options:\n" +" -f\trestrict action or display to function names and definitions\n" +" -F\trestrict display to function names only (plus line number and\n" +" \tsource file when debugging)\n" +" -g\tcreate global variables when used in a shell function; otherwise\n" +" \tignored\n" +" -p\tdisplay the attributes and value of each NAME\n" +" \n" +" Options which set attributes:\n" +" -a\tto make NAMEs indexed arrays (if supported)\n" +" -A\tto make NAMEs associative arrays (if supported)\n" +" -i\tto make NAMEs have the `integer' attribute\n" +" -l\tto convert NAMEs to lower case on assignment\n" +" -n\tmake NAME a reference to the variable named by its value\n" +" -r\tto make NAMEs readonly\n" +" -t\tto make NAMEs have the `trace' attribute\n" +" -u\tto convert NAMEs to upper case on assignment\n" +" -x\tto make NAMEs export\n" +" \n" +" Using `+' instead of `-' turns off the given attribute.\n" +" \n" +" Variables with the integer attribute have arithmetic evaluation (see\n" +" the `let' command) performed when the variable is assigned a value.\n" +" \n" +" When used in a function, `declare' makes NAMEs local, as with the " +"`local'\n" +" command. The `-g' option suppresses this behavior.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or a variable\n" +" assignment error occurs." +msgstr "" +"Establece valores de variable y atributos.\n" +" \n" +" Declara variables y les da atributos. Si no se da ningún NOMBRE,\n" +" muestra los atributos y valores de todas las variables.\n" +" \n" +" Opciones:\n" +" -f\trestringe la acción o muestra a nombres y definiciones\n" +" \tde funciones\n" +" -F\trestringe la muestra a nombres de funciones (con número de\n" +" \tlínea y fichero fuente al depurar)\n" +" -g\tcrea variables globales cuando se usa en una función de shell;\n" +" \tde otra forma se descarta\n" +" -p\tmuestra los atributos y valor de cada NOMBRE\n" +" \n" +" Opciones que establecen atributos:\n" +" -a\testablece NOMBREs como matrices indizadas (si se admiten)\n" +" -A\testablece NOMBREs como matrices asociativas (si se admiten)\n" +" -i\testablece NOMBREs con el atributo `integer'\n" +" -l\tconvierte NOMBREs a minúsculas en la asignación\n" +" -r\testablece NOMBREs como de sólo lectura\n" +" -t\testablece NOMBREs con el atributo `trace'\n" +" -u\tconvierte NOMBREs a mayúsculas en la asignación\n" +" -x\testablece NOMBREs para exportar\n" +" \n" +" Si usa `+' en lugar de `-' desactiva el atributo dado.\n" +" \n" +" Las variables con el atributo integer realizan evaluación aritmética\n" +" (vea la orden `let') cuando se asigna un valor a la variable.\n" +" \n" +" Cuando se usa en una función, `declare' hace locales a los NOMBREs,\n" +" como sucede con la orden `local'. La opción `-g' suprime esta\n" +" conducta.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que se de una opción inválida o\n" +" suceda un error." + +#: builtins.c:527 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Obsolete. See `help declare'." +msgstr "" +"Establece valores de variables y atributos.\n" +" \n" +" Obsoleto. Consulte `help declare'." + +#: builtins.c:535 +#, fuzzy +msgid "" +"Define local variables.\n" +" \n" +" Create a local variable called NAME, and give it VALUE. OPTION can\n" +" be any option accepted by `declare'.\n" +" \n" +" Local variables can only be used within a function; they are visible\n" +" only to the function where they are defined and its children.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied, a variable\n" +" assignment error occurs, or the shell is not executing a function." +msgstr "" +"Define variables locales.\n" +" \n" +" Crea una variable local llamada NOMBRE, y le da un VALOR. OPCIÓN puede\n" +" ser cualquier opción aceptada por `declare'.\n" +" \n" +" Las variables locales sólo se pueden usar en una función; son visibles\n" +" sólo en la función donde se definen y sus hijos.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que se de una opción inválida, suceda\n" +" un error, o el shell no esté ejecutando una función." + +#: builtins.c:552 +#, fuzzy +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs, separated by a single space character and followed by " +"a\n" +" newline, on the standard output.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" -e\tenable interpretation of the following backslash escapes\n" +" -E\texplicitly suppress interpretation of backslash escapes\n" +" \n" +" `echo' interprets the following backslash-escaped characters:\n" +" \\a\talert (bell)\n" +" \\b\tbackspace\n" +" \\c\tsuppress further output\n" +" \\e\tescape character\n" +" \\E\tescape character\n" +" \\f\tform feed\n" +" \\n\tnew line\n" +" \\r\tcarriage return\n" +" \\t\thorizontal tab\n" +" \\v\tvertical tab\n" +" \\\\\tbackslash\n" +" \\0nnn\tthe character whose ASCII code is NNN (octal). NNN can be\n" +" \t0 to 3 octal digits\n" +" \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" +" \tcan be one or two hex digits\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Escribe argumentos en la salida estándar.\n" +" \n" +" Muestra los ARGumentos en la salida estándar seguidos por un carácter\n" +" de fin de línea.\n" +" Opciones:\n" +" -n\tno agrega un carácter de fin de línea\n" +" -e\tactiva la interpretación de caracteres de escape de\n" +" \tde barra invertida\n" +" -E\tdesactiva explícitamente la interpretación de caracteres de\n" +" \tde escape de barra invertida\n" +" \n" +" `echo' interpreta los siguientes caracteres de escape de barra " +"invertida:\n" +" \\a\talerta (timbre)\n" +" \\b\tespacio hacia atrás\n" +" \\c\tsuprime toda salida a continuación\n" +" \\E\tcarácter de escape\n" +" \\f\talimentación de papel\n" +" \\n\tlínea nueva\n" +" \\r\tretorno de carro\n" +" \\t\ttabulador horizontal\n" +" \\v\ttabulador vertical\n" +" \\\\\tbarra invertida\n" +" \\0nnn\tel carácter cuyo código ASCII es NNN (octal). NNN puede ser\n" +" \tde 0 a 3 dígitos octales\n" +" \\xHH\tel carácter de ocho bits cuyo valor es HH (hexadecimal). HH\n" +" \tpuede ser de uno o dos dígitos hexadecimales\n" +" \n" +" Estado de salida:\n" +" Devuelve con éxito a menos que suceda un error de escritura." + +#: builtins.c:588 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs on the standard output followed by a newline.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Escribe argumentos en la salida estándar.\n" +" \n" +" Muestra los ARGumentos en la salida estándar seguidos por un carácter\n" +" de fin de línea.\n" +" Opciones:\n" +" -n\tno agrega un carácter de fin de línea\n" +" \n" +" Estado de salida:\n" +" Devuelve con éxito a menos que suceda un error de escritura." + +#: builtins.c:603 +msgid "" +"Enable and disable shell builtins.\n" +" \n" +" Enables and disables builtin shell commands. Disabling allows you to\n" +" execute a disk command which has the same name as a shell builtin\n" +" without using a full pathname.\n" +" \n" +" Options:\n" +" -a\tprint a list of builtins showing whether or not each is enabled\n" +" -n\tdisable each NAME or display a list of disabled builtins\n" +" -p\tprint the list of builtins in a reusable format\n" +" -s\tprint only the names of Posix `special' builtins\n" +" \n" +" Options controlling dynamic loading:\n" +" -f\tLoad builtin NAME from shared object FILENAME\n" +" -d\tRemove a builtin loaded with -f\n" +" \n" +" Without options, each NAME is enabled.\n" +" \n" +" To use the `test' found in $PATH instead of the shell builtin\n" +" version, type `enable -n test'.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not a shell builtin or an error occurs." +msgstr "" +"Activa y desactiva las órdenes internas del shell.\n" +" \n" +" Activa y desactiva las órdenes internas del shell. El desactivar le\n" +" permite ejecutar una orden del disco que tenga el mismo nombre que\n" +" la orden interna del shell, sin usar el nombre de ruta completo.\n" +" \n" +" Opciones:\n" +" -a\tmuestra la lista de órdenes internas indicando si están activas o " +"no\n" +" -n\tdesactiva cada NOMBRE o muestra la lista de órdenes internas\n" +" \tdesactivadas\n" +" -p\tmuestra la lista de órdenes internas en una forma reusable\n" +" -s\tmuestra sólo los nombres de las órdenes internas `especiales' " +"Posix\n" +" \n" +" Opciones que controlan la carga dinámica:\n" +" -f\tcarga la orden interna NOMBRE del objeto compartido FICHERO\n" +" -d\tborra una orden interna cargada con -f\n" +" \n" +" Sin opciones, se activa cada NOMBRE.\n" +" \n" +" Para usar `test' que se encuentra en $PATH en lugar de la orden interna\n" +" del shell, ejecute `enable -n test'.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que NOMBRE no sea una orden interna del " +"shell\n" +" o suceda un error." + +#: builtins.c:631 +msgid "" +"Execute arguments as a shell command.\n" +" \n" +" Combine ARGs into a single string, use the result as input to the " +"shell,\n" +" and execute the resulting commands.\n" +" \n" +" Exit Status:\n" +" Returns exit status of command or success if command is null." +msgstr "" +"Ejecuta argumentos como una orden de shell.\n" +" \n" +" Combina los ARGumentos en una sola cadena, usa el resultado como " +"entrada\n" +" para el shell, y ejecuta las órdenes resultantes.\n" +" \n" +" Estado de Salida:\n" +" Devuelve el estado de salida de la orden o éxito si la orden es nula." + +# "a ser reconocidas" no está en español. +# Yo pondría "las letras de opción que se reconocen". sv +# en una de dos formas -> en una de las dos formas siguientes em+ +# dar argumentos -> especificar em+ +# De acuerdo. cfuga +#: builtins.c:643 +msgid "" +"Parse option arguments.\n" +" \n" +" Getopts is used by shell procedures to parse positional parameters\n" +" as options.\n" +" \n" +" OPTSTRING contains the option letters to be recognized; if a letter\n" +" is followed by a colon, the option is expected to have an argument,\n" +" which should be separated from it by white space.\n" +" \n" +" Each time it is invoked, getopts will place the next option in the\n" +" shell variable $name, initializing name if it does not exist, and\n" +" the index of the next argument to be processed into the shell\n" +" variable OPTIND. OPTIND is initialized to 1 each time the shell or\n" +" a shell script is invoked. When an option requires an argument,\n" +" getopts places that argument into the shell variable OPTARG.\n" +" \n" +" getopts reports errors in one of two ways. If the first character\n" +" of OPTSTRING is a colon, getopts uses silent error reporting. In\n" +" this mode, no error messages are printed. If an invalid option is\n" +" seen, getopts places the option character found into OPTARG. If a\n" +" required argument is not found, getopts places a ':' into NAME and\n" +" sets OPTARG to the option character found. If getopts is not in\n" +" silent mode, and an invalid option is seen, getopts places '?' into\n" +" NAME and unsets OPTARG. If a required argument is not found, a '?'\n" +" is placed in NAME, OPTARG is unset, and a diagnostic message is\n" +" printed.\n" +" \n" +" If the shell variable OPTERR has the value 0, getopts disables the\n" +" printing of error messages, even if the first character of\n" +" OPTSTRING is not a colon. OPTERR has the value 1 by default.\n" +" \n" +" Getopts normally parses the positional parameters ($0 - $9), but if\n" +" more arguments are given, they are parsed instead.\n" +" \n" +" Exit Status:\n" +" Returns success if an option is found; fails if the end of options is\n" +" encountered or an error occurs." +msgstr "" +"Decodifica argumentos de opción.\n" +"\n" +" Getopts se usa en procedimientos del shell para decodificar parámetros\n" +" posicionales como opciones.\n" +" \n" +" CADENA_OPCIONES contiene las letras de opción para reconocer; si\n" +" una letra es seguida por dos puntos, se espera que la opción tenga\n" +" un argumento, del cual se debe separar con espacios en blanco.\n" +" \n" +" Cada vez que se invoca, getopts colocará la siguiente opción en la\n" +" variable de shell $nombre, inicializando nombre si no existe, y el\n" +" índice del siguiente argumento a ser procesado en la variable de\n" +" shell OPTIND. OPTIND se inicializa a 1 cada vez que se invoca el\n" +" shell, o un guión de shell. Cuando una opción requiere un argumento,\n" +" getopts coloca ese argumento en la variable de shell OPTARG.\n" +" \n" +" getopts reporta errores en una de las dos formas siguientes. Si\n" +" el primer carácter de OPTSTRING es dos puntos, getopts usa el\n" +" aviso de errores silencioso. En este modo, no se muestran\n" +" mensajes de error. Si se encuentra una opción inválida, getopts\n" +" coloca el carácter de opción encontrado en OPTARG. Si no se\n" +" encuentra el argumento necesario, getopts coloca ':' en NOMBRE y\n" +" define OPTARG con el carácter de opción encontrado. Si getopts no\n" +" está en modo silencioso, y se encuentra una opción inválida, getopts\n" +" coloca '?' en NOMBRE y borra OPTARG. Si no se encuentra un argumento\n" +" necesario, se coloca '?' en NOMBRE, se borra OPTARG, y se muestra\n" +" un mensaje de diagnóstico.\n" +" \n" +" Si la variable de shell OPTERR tiene el valor 0, getopts desactiva\n" +" la notificación de mensajes de error, aún si el primer carácter de\n" +" OPTSTRING no es ':'. OPTERR tiene el valor 1 por defecto.\n" +" \n" +" Getopts normalmente compara los parámetros de posición ($0 - $9),\n" +" pero si se especifican más argumentos, éstos se comparan en lugar\n" +" de los primeros.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito si se encuentra una opción; falla si se encuentra\n" +" el final de las opciones o sucede un error." + +#: builtins.c:685 +msgid "" +"Replace the shell with the given command.\n" +" \n" +" Execute COMMAND, replacing this shell with the specified program.\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not " +"specified,\n" +" any redirections take effect in the current shell.\n" +" \n" +" Options:\n" +" -a name\tpass NAME as the zeroth argument to COMMAND\n" +" -c\t\texecute COMMAND with an empty environment\n" +" -l\t\tplace a dash in the zeroth argument to COMMAND\n" +" \n" +" If the command cannot be executed, a non-interactive shell exits, " +"unless\n" +" the shell option `execfail' is set.\n" +" \n" +" Exit Status:\n" +" Returns success unless COMMAND is not found or a redirection error " +"occurs." +msgstr "" +"Reemplaza el shell con la orden dada.\n" +" \n" +" Ejecuta la ORDEN, reemplazando este shell con el programa especificado.\n" +" Los ARGUMENTOS se vuelven los argumentos de la ORDEN. Si no se\n" +" especifica la ORDEN, cualquir redirección toma efecto en el shell " +"actual.\n" +" \n" +" Opciones:\n" +" -a nombre\tpasa el NOMBRE como el argumento cero de la ORDEN\n" +" -c\t\tejecuta la ORDEN en un ambiente vacío\n" +" -l\t\tcoloca un guión en el argumento cero de la ORDEN\n" +" \n" +" Si la orden no se puede ejecutar, termina un shell no interactivo,\n" +" a menos que la opción de shell `execfail' esté activa.\n" +" \n" +" Estado de Salida:\n" +" Devuelve éxito a menos que no se encuentre la ORDEN o que suceda un\n" +" error de redirección." + +#: builtins.c:706 +msgid "" +"Exit the shell.\n" +" \n" +" Exits the shell with a status of N. If N is omitted, the exit status\n" +" is that of the last command executed." +msgstr "" +"Termina el shell.\n" +" \n" +" Termina el shell con un estado de N. Si se omite N, el estado de " +"salida\n" +" es el mismo de la última orden ejecutada." + +#: builtins.c:715 +msgid "" +"Exit a login shell.\n" +" \n" +" Exits a login shell with exit status N. Returns an error if not " +"executed\n" +" in a login shell." +msgstr "" +"Termina un shell de entrada.\n" +" \n" +" Termina un shell de entrada con un estado de salida de N. Devuelve un\n" +" error si no se ejecuta en un shell de entrada." + +#: builtins.c:725 +msgid "" +"Display or execute commands from the history list.\n" +" \n" +" fc is used to list or edit and re-execute commands from the history " +"list.\n" +" FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" +" string, which means the most recent command beginning with that\n" +" string.\n" +" \n" +" Options:\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then " +"EDITOR,\n" +" \t\tthen vi\n" +" -l \tlist lines instead of editing\n" +" -n\tomit line numbers when listing\n" +" -r\treverse the order of the lines (newest listed first)\n" +" \n" +" With the `fc -s [pat=rep ...] [command]' format, COMMAND is\n" +" re-executed after the substitution OLD=NEW is performed.\n" +" \n" +" A useful alias to use with this is r='fc -s', so that typing `r cc'\n" +" runs the last command beginning with `cc' and typing `r' re-executes\n" +" the last command.\n" +" \n" +" Exit Status:\n" +" Returns success or status of executed command; non-zero if an error " +"occurs." +msgstr "" +"Muestra o ejecuta órdenes de la lista de historia.\n" +" \n" +" fc se usa para listar o editar y reejecutar órdenes de la lista de\n" +" historia. PRIMERO y ÚLTIMO pueden ser números que especifican el " +"rango,\n" +" o PRIMERO puede ser una cadena, que significa la orden más reciente que\n" +" comience con esa cadena.\n" +" \n" +" -e NOMBRE_E selecciona el editor a usar. Por defecto es FCEDIT,\n" +" \t\tdespués EDITOR, después vi\n" +" -l lista líneas en lugar de editar\n" +" -n omite los números de línea al listar\n" +" -r inverte el orden de las líneas (muestra primero las más " +"recientes)\n" +" \n" +" Con el formato `fc -s [pat=rep ...] [orden]', la ORDEN se\n" +" ejecuta de nuevo después de realizar la sustitución ANT=NUEVO.\n" +" \n" +" Un alias útil para usar con esto es r='fc -s', así que al teclear\n" +" `r cc' ejecuta la última orden que comience con `cc' y al teclear\n" +" `r' re-ejecuta la última orden.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito o el estado de la orden ejecutada; si sucede un " +"error\n" +" es diferente de cero." + +#: builtins.c:755 +msgid "" +"Move job to the foreground.\n" +" \n" +" Place the job identified by JOB_SPEC in the foreground, making it the\n" +" current job. If JOB_SPEC is not present, the shell's notion of the\n" +" current job is used.\n" +" \n" +" Exit Status:\n" +" Status of command placed in foreground, or failure if an error occurs." +msgstr "" +"Mueve el trabajo al primer plano.\n" +" \n" +" Ubica al trabajo identificado con IDTRABAJO en el primer plano, y\n" +" lo hace el trabajo actual. Si IDTRABAJO no está presente, se usa\n" +" la noción del shell del trabajo actual.\n" +" \n" +" Estado de Salida:\n" +" El estado del comando ubicado en primer plano, o falla si sucede un " +"error." + +#: builtins.c:770 +msgid "" +"Move jobs to the background.\n" +" \n" +" Place the jobs identified by each JOB_SPEC in the background, as if " +"they\n" +" had been started with `&'. If JOB_SPEC is not present, the shell's " +"notion\n" +" of the current job is used.\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Mueve trabajos al segundo plano.\n" +" \n" +" Coloca los trabajos identificados por cada IDTRABAJO en segundo plano,\n" +" como si se hubieran iniciado con `&'. Si IDTRABAJO no está presente,\n" +" se usa la noción del shell del trabajo actual.\n" +" \n" +" Estado de Salida:\n" +" Devuelve éxito a menos que el control de trabajos no esté activado o\n" +" suceda un error." + +#: builtins.c:784 +#, fuzzy +msgid "" +"Remember or display program locations.\n" +" \n" +" Determine and remember the full pathname of each command NAME. If\n" +" no arguments are given, information about remembered commands is " +"displayed.\n" +" \n" +" Options:\n" +" -d\t\tforget the remembered location of each NAME\n" +" -l\t\tdisplay in a format that may be reused as input\n" +" -p pathname\tuse PATHNAME as the full pathname of NAME\n" +" -r\t\tforget all remembered locations\n" +" -t\t\tprint the remembered location of each NAME, preceding\n" +" \t\teach location with the corresponding NAME if multiple\n" +" \t\tNAMEs are given\n" +" Arguments:\n" +" NAME\t\tEach NAME is searched for in $PATH and added to the list\n" +" \t\tof remembered commands.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not found or an invalid option is given." +msgstr "" +"Almacena o muestra la ubicación de los programas.\n" +" \n" +" Determina y almacena la ruta completa de cada órden NOMBRE. Si\n" +" no se proporcionan argumentos, se muestra la información de las\n" +" órdenes almacenadas.\n" +" \n" +" Opciones:\n" +" -d\t\tolvida la ubicación almacenada de cada NOMBRE\n" +" -l\t\tmuestra en un formato que se puede reusar como entrada\n" +" -p ruta\tusa RUTA como la ruta completa de NOMBRE\n" +" -r\t\tolvida todas las ubicaciones almacenadas\n" +" -t\t\tmuestra la ubicación almacenada de cada NOMBRE,\n" +" \t\tcada ubicación con el NOMBRE correspondiente\n" +" \t\tse dan varios NOMBREs\n" +" Argumentos:\n" +" NOMBRE\t\tCada NOMBRE se busca en $PATH y se agrega a la lista\n" +" \t\tde órdenes almacenadas.\n" +" \n" +" Estado de Salida\n" +" Devuelve con éxito a menos que no se encuentre NOMBRE o se proporcione\n" +" una opción inválida." + +#: builtins.c:809 +msgid "" +"Display information about builtin commands.\n" +" \n" +" Displays brief summaries of builtin commands. If PATTERN is\n" +" specified, gives detailed help on all commands matching PATTERN,\n" +" otherwise the list of help topics is printed.\n" +" \n" +" Options:\n" +" -d\toutput short description for each topic\n" +" -m\tdisplay usage in pseudo-manpage format\n" +" -s\toutput only a short usage synopsis for each topic matching\n" +" \tPATTERN\n" +" \n" +" Arguments:\n" +" PATTERN\tPattern specifiying a help topic\n" +" \n" +" Exit Status:\n" +" Returns success unless PATTERN is not found or an invalid option is " +"given." +msgstr "" +"Muestra información sobre órdenes internas.\n" +" \n" +" Muestra un resumen breve de las órdenes internas. Si se especifica\n" +" un PATRÓN, da ayuda detallada sobre todas las órdenes que\n" +" coincidan con el PATRÓN, de otra forma se muestra la lista de\n" +" tópicos de ayuda.\n" +" \n" +" Opciones:\n" +" -d\tmuestra una descripción corta para cada tópico\n" +" -m\tmuestra el uso en un formato similar a página man\n" +" -s\tmuestra sólo una sinopsis breve de uso para cada tópico que\n" +" \tcoincida con el PATRÓN\n" +" \n" +" Argumentos:\n" +" PATRÓN\tPatrón que especifica un tópico de ayuda\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que no se encuentre PATRÓN o se proporcione\n" +" una opción inválida." + +#: builtins.c:833 +msgid "" +"Display or manipulate the history list.\n" +" \n" +" Display the history list with line numbers, prefixing each modified\n" +" entry with a `*'. An argument of N lists only the last N entries.\n" +" \n" +" Options:\n" +" -c\tclear the history list by deleting all of the entries\n" +" -d offset\tdelete the history entry at offset OFFSET.\n" +" \n" +" -a\tappend history lines from this session to the history file\n" +" -n\tread all history lines not already read from the history file\n" +" -r\tread the history file and append the contents to the history\n" +" \tlist\n" +" -w\twrite the current history to the history file\n" +" \tand append them to the history list\n" +" \n" +" -p\tperform history expansion on each ARG and display the result\n" +" \twithout storing it in the history list\n" +" -s\tappend the ARGs to the history list as a single entry\n" +" \n" +" If FILENAME is given, it is used as the history file. Otherwise,\n" +" if $HISTFILE has a value, that is used, else ~/.bash_history.\n" +" \n" +" If the $HISTTIMEFORMAT variable is set and not null, its value is used\n" +" as a format string for strftime(3) to print the time stamp associated\n" +" with each displayed history entry. No time stamps are printed " +"otherwise.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" +"Muestra o manipula la lista de la historia. \n" +" Muestra la lista de la historia con números de línea, mostrando\n" +" cada línea modificada con un `*' como prefijo. El argumento N\n" +" muestra solamente las últimas N entradas.\n" +" \n" +" Opciones:\n" +" -c\tborra la lista de historia eliminando todas las entradas\n" +" -d despl\tborra la entrada de la histora en la posición DESPL\n" +" \n" +" -a\tagrega las líneas de histora de esta sesión al fichero de " +"historia\n" +" -n\tlee todas las líneas de historia que no se han leído del fichero\n" +" \tde historia\n" +" -r\tlee el fichero de historia y agrega el contenido al fichero\n" +" \tde historia\n" +" -w\tescribe la historia actual en el fichero de historia\n" +" \n" +" -p\thace expansión de historia en cada ARGumento y muestra el\n" +" \tresultado, sin guardarlo en la lista de historia\n" +" -s\tagrega los ARGumentos a la lista de historia como\n" +" \tuna sola entrada\n" +" Si se proporciona FICHERO, entonces se usa como el fichero de\n" +" historia. Si no, si $HISTFILE tien un valor, éste se usa, en otro caso\n" +" ~/.bash_history.\n" +" \n" +" Si la variable $HISTTIMEFORMAT está definida y no es nula, se usa su\n" +" valor como una cadena de formato strftime(3) para mostrar la marca de\n" +" tiempo asociada con cada entrada de historia mostrada. No se muestra\n" +" ninguna marca de tiempo de otra forma." + +#: builtins.c:869 +#, fuzzy +msgid "" +"Display status of jobs.\n" +" \n" +" Lists the active jobs. JOBSPEC restricts output to that job.\n" +" Without options, the status of all active jobs is displayed.\n" +" \n" +" Options:\n" +" -l\tlists process IDs in addition to the normal information\n" +" -n\tlists only processes that have changed status since the last\n" +" \tnotification\n" +" -p\tlists process IDs only\n" +" -r\trestrict output to running jobs\n" +" -s\trestrict output to stopped jobs\n" +" \n" +" If -x is supplied, COMMAND is run after all job specifications that\n" +" appear in ARGS have been replaced with the process ID of that job's\n" +" process group leader.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs.\n" +" If -x is used, returns the exit status of COMMAND." +msgstr "" +"Muestra el estado de los trabajos.\n" +" \n" +" Muestra los trabajos activos. IDTRABAJO restringe la salida a\n" +" ese trabajo. Sin opciones, se muestra el estado de todos los trabajos\n" +" activos.\n" +" \n" +" Opciones:\n" +" -l\tmuestra los id's de los procesos, además de\n" +" \tla información normal\n" +" -n\tsolo muestra los procesos que han cambia de estado desde\n" +" \tla última notificación\n" +" -p\tsolo muestra los id's de los procesos -r\trestringe la salida " +"a los trabajos en ejecución\n" +" -s\trestringe la salida a los trabajos detenidos\n" +" \n" +" Si se especifica -x, la ORDEN se ejecuta después de que todas las\n" +" especificaciones de trabajo que aparecen en ARGS se han reemplazado\n" +" con el ID de proceso del líder del grupo de procesos de dicho trabajo.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que se de una opción inválida o suceda un\n" +" error. Si se usa -x, devuelve el estado de salida de la ORDEN." + +#: builtins.c:896 +msgid "" +"Remove jobs from current shell.\n" +" \n" +" Removes each JOBSPEC argument from the table of active jobs. Without\n" +" any JOBSPECs, the shell uses its notion of the current job.\n" +" \n" +" Options:\n" +" -a\tremove all jobs if JOBSPEC is not supplied\n" +" -h\tmark each JOBSPEC so that SIGHUP is not sent to the job if the\n" +" \tshell receives a SIGHUP\n" +" -r\tremove only running jobs\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option or JOBSPEC is given." +msgstr "" +"Borra trabajos del shell actual.\n" +" \n" +" Borra cada argumento IDTRABAJO de la tabla de trabajos activos. Sin\n" +" algún IDTRABAJO, el shell utiliza su noción del trabajo actual.\n" +" \n" +" Opciones:\n" +" -a\tborra todos los trabajos si no se proporciona IDTRABAJO\n" +" -h\tmarca cada IDTRABAJO para no se envíe SIGHUP al trabajo si\n" +" \tel shell recibe un SIGHUP\n" +" -r\tborra solo los trabajos en ejecución\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que se proporcionen una opción o un\n" +" IDTRABAJO inválidos." + +#: builtins.c:915 +msgid "" +"Send a signal to a job.\n" +" \n" +" Send the processes identified by PID or JOBSPEC the signal named by\n" +" SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n" +" SIGTERM is assumed.\n" +" \n" +" Options:\n" +" -s sig\tSIG is a signal name\n" +" -n sig\tSIG is a signal number\n" +" -l\tlist the signal names; if arguments follow `-l' they are\n" +" \tassumed to be signal numbers for which names should be listed\n" +" \n" +" Kill is a shell builtin for two reasons: it allows job IDs to be used\n" +" instead of process IDs, and allows processes to be killed if the limit\n" +" on processes that you can create is reached.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" +"Envía una señal a un trabajo.\n" +" \n" +" Envía a los procesos nombrados por PID (o IDTRABAJO) la señal ID_SEÑAL\n" +" o NUM_SEÑAL. Si no están presentes ni ID_SEÑAL o NUM_SEÑAL, se asume\n" +" SIGTERM.\n" +" \n" +" Opciones:\n" +" -s sig\tSIG es un nombre de señal\n" +" -n sig\tSIG es un número de señal\n" +" -l\tenlista los nombres de señales; si hay argumentos a continuación\n" +" \tde `-l', se asume que son números de señal para las cuales se debe\n" +" mostrar el nombre.\n" +" \n" +" Kill es una orden interna del shell por dos razones: permite que se\n" +" puedan usar IDs de trabajo en lugar de IDs de proceso, y permite matar\n" +" procesos si ha alcanzado el límite de procesos que puede crear.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que se de una opción inválida o suceda un " +"error." + +# "a ser evaluada" no está en español. sv +# Cierto. ¿Así está mejor? cfuga +# overflow -> desbordamiento o sobrepasamiento. nunca lo he visto +# traducido como sobreflujo. sv +# Corregido. cfuga +# No sé si existe precedencia en español, pero me suena fatal. +# Yo pondría simplemente "prioridad". sv +# Creo que si existe, pero tu sugerencia es mejor. cfuga +#: builtins.c:938 +msgid "" +"Evaluate arithmetic expressions.\n" +" \n" +" Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" +" fixed-width integers with no check for overflow, though division by 0\n" +" is trapped and flagged as an error. The following list of operators is\n" +" grouped into levels of equal-precedence operators. The levels are " +"listed\n" +" in order of decreasing precedence.\n" +" \n" +" \tid++, id--\tvariable post-increment, post-decrement\n" +" \t++id, --id\tvariable pre-increment, pre-decrement\n" +" \t-, +\t\tunary minus, plus\n" +" \t!, ~\t\tlogical and bitwise negation\n" +" \t**\t\texponentiation\n" +" \t*, /, %\t\tmultiplication, division, remainder\n" +" \t+, -\t\taddition, subtraction\n" +" \t<<, >>\t\tleft and right bitwise shifts\n" +" \t<=, >=, <, >\tcomparison\n" +" \t==, !=\t\tequality, inequality\n" +" \t&\t\tbitwise AND\n" +" \t^\t\tbitwise XOR\n" +" \t|\t\tbitwise OR\n" +" \t&&\t\tlogical AND\n" +" \t||\t\tlogical OR\n" +" \texpr ? expr : expr\n" +" \t\t\tconditional operator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tassignment\n" +" \n" +" Shell variables are allowed as operands. The name of the variable\n" +" is replaced by its value (coerced to a fixed-width integer) within\n" +" an expression. The variable need not have its integer attribute\n" +" turned on to be used in an expression.\n" +" \n" +" Operators are evaluated in order of precedence. Sub-expressions in\n" +" parentheses are evaluated first and may override the precedence\n" +" rules above.\n" +" \n" +" Exit Status:\n" +" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." +msgstr "" +"Evalúa expresiones aritméticas.\n" +" \n" +" Evalúa cada ARG como una expresión aritmética. La evaluación se hace\n" +" con enteros de longitud fija, sin revisar desbordamientos, aunque la\n" +" la división por 0 se captura y se marca como un error. La siguiente\n" +" lista de operadores está agrupada en niveles de operadores de la misma\n" +" prioridad. Se muestran los niveles en orden de prioridad decreciente.\n" +" \n" +" \tid++, id--\tpost-incremento, post-decremento de variable\n" +" \t++id, --id\tpre-incremento, pre-decremento de variable\n" +" \t-, +\t\tmenos, más unario\n" +" \t!, ~\t\tnegación lógica y basada en bits\n" +" \t**\t\texponenciación\n" +" \t*, /, %\t\tmultiplicación, división, residuo\n" +" \t+, -\t\tadición, sustracción\n" +" \t<<, >>\t\tdesplazamientos de bits izquierdo y derecho\n" +" \t<=, >=, <, >\tcomparación\n" +" \t==, !=\t\tequivalencia, inequivalencia\n" +" \t&\t\tAND de bits\n" +" \t^\t\tXOR de bits\n" +" \t|\t\tOR de bits\n" +" \t&&\t\tAND lógico\n" +" \t||\t\tOR lógico\n" +" \texpr ? expr : expr\n" +" \t\t\toperador condicional\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tasignación\n" +" \n" +" Se permiten las variables de shell como operandos. Se reemplaza\n" +" el nombre de la variable por su valor (coercionado a un entero\n" +" de longitud fija) dentro de una expresión. La variable no\n" +" necesita tener activado su atributo integer para ser usada en\n" +" una expresión.\n" +" \n" +" Los operadores se evalúan en orden de prioridad. Primero se\n" +" evalúan las sub-expresiones en paréntesis y pueden sobrepasar\n" +" las reglas de prioridad anteriores.\n" +" \n" +" Estado de salida:\n" +" Si el último ARGumento se evalúa como 0, let devuelve 1; de otra\n" +" forma, let devuelve 0." + +#: builtins.c:983 +#, fuzzy +msgid "" +"Read a line from the standard input and split it into fields.\n" +" \n" +" Reads a single line from the standard input, or from file descriptor FD\n" +" if the -u option is supplied. The line is split into fields as with " +"word\n" +" splitting, and the first word is assigned to the first NAME, the second\n" +" word to the second NAME, and so on, with any leftover words assigned to\n" +" the last NAME. Only the characters found in $IFS are recognized as " +"word\n" +" delimiters.\n" +" \n" +" If no NAMEs are supplied, the line read is stored in the REPLY " +"variable.\n" +" \n" +" Options:\n" +" -a array\tassign the words read to sequential indices of the array\n" +" \t\tvariable ARRAY, starting at zero\n" +" -d delim\tcontinue until the first character of DELIM is read, rather\n" +" \t\tthan newline\n" +" -e\t\tuse Readline to obtain the line in an interactive shell\n" +" -i text\tUse TEXT as the initial text for Readline\n" +" -n nchars\treturn after reading NCHARS characters rather than waiting\n" +" \t\tfor a newline, but honor a delimiter if fewer than NCHARS\n" +" \t\tcharacters are read before the delimiter\n" +" -N nchars\treturn only after reading exactly NCHARS characters, " +"unless\n" +" \t\tEOF is encountered or read times out, ignoring any delimiter\n" +" -p prompt\toutput the string PROMPT without a trailing newline before\n" +" \t\tattempting to read\n" +" -r\t\tdo not allow backslashes to escape any characters\n" +" -s\t\tdo not echo input coming from a terminal\n" +" -t timeout\ttime out and return failure if a complete line of input " +"is\n" +" \t\tnot read within TIMEOUT seconds. The value of the TMOUT\n" +" \t\tvariable is the default timeout. TIMEOUT may be a\n" +" \t\tfractional number. If TIMEOUT is 0, read returns immediately,\n" +" \t\twithout trying to read any data, returning success only if\n" +" \t\tinput is available on the specified file descriptor. The\n" +" \t\texit status is greater than 128 if the timeout is exceeded\n" +" -u fd\t\tread from file descriptor FD instead of the standard input\n" +" \n" +" Exit Status:\n" +" The return code is zero, unless end-of-file is encountered, read times " +"out\n" +" (in which case it's greater than 128), a variable assignment error " +"occurs,\n" +" or an invalid file descriptor is supplied as the argument to -u." +msgstr "" +"Lee una línea de la salida estándar y la divide en campos.\n" +" \n" +" Lee una sola línea de la entrada estándar, o del descriptor de\n" +" fichero FD si se proporciona la opción -u. La línea se divide en " +"campos\n" +" con separación de palabras, y la primera palabra se asigna al primer\n" +" NOMBRE, la segunda palabra al segundo NOMBRE, y así sucesivamente, con\n" +" las palabras restantes asignadas al último NOMBRE. Sólo los caracteres\n" +" que se encuentran en $IFS se reconocen como delimitadores de palabras.\n" +" \n" +" Si no se proporciona ningún NOMBRE, la línea leída se guarda en la\n" +" variable REPLY.\n" +" \n" +" Opciones:\n" +" -a matriz\tasigna las palabras leídas a índices secuenciales de\n" +" \tla variable de matriz MATRIZ, empezando en cero\n" +" -d delim\tcontinúa hasta que se lea el primer carácter de DELIM,\n" +" \t\ten lugar de línea nueva\n" +" -e\t\tusa Readline para obtener la línea en un shell interactivo\n" +" -i texto\tUsa el TEXTO como el texto inicial para Readline\n" +" -n ncars\tregresa después de leer NCARS caracteres en lugar de\n" +" \t\tesperar una línea nueva, pero honra a un delimitador si\n" +" \t\tse leen menos de NCARS caracteres antes del delimitador\n" +" -N ncars\tdevuelve sólo después de leer exactamente NCARS\n" +" \t\tcaracteres, a menos que se encuentre el fin del fichero\n" +" \t\to expire la lectura, descartando cualquier delimitador\n" +" -p prompt\tmuestra la cadena PROMPT sin un caractér de línea nueva\n" +" \t\tal final antes de intentar leer\n" +" -r\t\tno permite que las barras invertidas escapen caracteres\n" +" -s\t\tno muestra la salida que proviene de una terminal\n" +" -t tiempo\texpira y devuelve fallo si no se lee una línea completa\n" +" \t\tde entrada en TIEMPO segundos. El valor de la variable TMOUT\n" +" \t\tes el tiempo de expiración por defecto. TIEMPO puede ser un\n" +" \t\tnúmero fraccionario. Si TIEMPO es 0, read devuelve con éxito\n" +" \t\tsólo si hay entrada disponible en el descriptor de fichero\n" +" \t\tespecificado. El estado de salida es mayor que 128 si se excede\n" +" \t\tel tiempo de expiración.\n" +" -u df\t\tlee del descriptor de fichero DF en lugar de la entrada\n" +" \t\testándar \n" +" Estado de Salida:\n" +" El código de devolución es cero, a menos que se encuentre un final de\n" +" línea, el tiempo de read expire, o se proporcione un descriptor de\n" +" fichero inválido como el argumento de -u." + +#: builtins.c:1028 +msgid "" +"Return from a shell function.\n" +" \n" +" Causes a function or sourced script to exit with the return value\n" +" specified by N. If N is omitted, the return status is that of the\n" +" last command executed within the function or script.\n" +" \n" +" Exit Status:\n" +" Returns N, or failure if the shell is not executing a function or script." +msgstr "" +"Devuelve de una función de shell.\n" +" \n" +" Causa que una función o un guión leído termine con el valor de " +"devolución\n" +" especificado por N. Si se omite N, el estado de devolución es el de\n" +" la última orden ejecutada dentro de la función o guión.\n" +" \n" +" Estado de Salida:\n" +" Devuelve N, o falla si el shell no está ejecutando una función o un " +"guión." + +#: builtins.c:1041 +#, fuzzy +msgid "" +"Set or unset values of shell options and positional parameters.\n" +" \n" +" Change the value of shell attributes and positional parameters, or\n" +" display the names and values of shell variables.\n" +" \n" +" Options:\n" +" -a Mark variables which are modified or created for export.\n" +" -b Notify of job termination immediately.\n" +" -e Exit immediately if a command exits with a non-zero status.\n" +" -f Disable file name generation (globbing).\n" +" -h Remember the location of commands as they are looked up.\n" +" -k All assignment arguments are placed in the environment for a\n" +" command, not just those that precede the command name.\n" +" -m Job control is enabled.\n" +" -n Read commands but do not execute them.\n" +" -o option-name\n" +" Set the variable corresponding to option-name:\n" +" allexport same as -a\n" +" braceexpand same as -B\n" +" emacs use an emacs-style line editing interface\n" +" errexit same as -e\n" +" errtrace same as -E\n" +" functrace same as -T\n" +" hashall same as -h\n" +" histexpand same as -H\n" +" history enable command history\n" +" ignoreeof the shell will not exit upon reading EOF\n" +" interactive-comments\n" +" allow comments to appear in interactive commands\n" +" keyword same as -k\n" +" monitor same as -m\n" +" noclobber same as -C\n" +" noexec same as -n\n" +" noglob same as -f\n" +" nolog currently accepted but ignored\n" +" notify same as -b\n" +" nounset same as -u\n" +" onecmd same as -t\n" +" physical same as -P\n" +" pipefail the return value of a pipeline is the status of\n" +" the last command to exit with a non-zero status,\n" +" or zero if no command exited with a non-zero " +"status\n" +" posix change the behavior of bash where the default\n" +" operation differs from the Posix standard to\n" +" match the standard\n" +" privileged same as -p\n" +" verbose same as -v\n" +" vi use a vi-style line editing interface\n" +" xtrace same as -x\n" +" -p Turned on whenever the real and effective user ids do not match.\n" +" Disables processing of the $ENV file and importing of shell\n" +" functions. Turning this option off causes the effective uid and\n" +" gid to be set to the real uid and gid.\n" +" -t Exit after reading and executing one command.\n" +" -u Treat unset variables as an error when substituting.\n" +" -v Print shell input lines as they are read.\n" +" -x Print commands and their arguments as they are executed.\n" +" -B the shell will perform brace expansion\n" +" -C If set, disallow existing regular files to be overwritten\n" +" by redirection of output.\n" +" -E If set, the ERR trap is inherited by shell functions.\n" +" -H Enable ! style history substitution. This flag is on\n" +" by default when the shell is interactive.\n" +" -P If set, do not resolve symbolic links when executing commands\n" +" such as cd which change the current directory.\n" +" -T If set, the DEBUG trap is inherited by shell functions.\n" +" -- Assign any remaining arguments to the positional parameters.\n" +" If there are no remaining arguments, the positional parameters\n" +" are unset.\n" +" - Assign any remaining arguments to the positional parameters.\n" +" The -x and -v options are turned off.\n" +" \n" +" Using + rather than - causes these flags to be turned off. The\n" +" flags can also be used upon invocation of the shell. The current\n" +" set of flags may be found in $-. The remaining n ARGs are positional\n" +" parameters and are assigned, in order, to $1, $2, .. $n. If no\n" +" ARGs are given, all shell variables are printed.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given." +msgstr "" +"Establece o borra los valores de las opciones de shell y los parámetros\n" +"posicionales.\n" +" \n" +" Cambia el valor de los atributos de shell y los parámetros " +"posicionales,\n" +" o muestra los nombres y valores de las variables de shell.\n" +" \n" +" Opciones:\n" +" -a Marca las variables que se modifican o crean para exportación.\n" +" -b Notifica el término de trabajos inmediatamente.\n" +" -e Termina inmediatamente si una orden termina con un estado\n" +" diferente a cero.\n" +" -f Desactiva la generación de nombres de ficheros (englobamiento).\n" +" -h Recuerda la ubicación de las órdenes como se localizaron.\n" +" -k Todos los argumentos de asignación se colocan en el ambiente para " +"una\n" +" orden, no solo aquellos que preceden al nombre de la orden.\n" +" -m Activa el control de trabajos.\n" +" -n Lee órdenes pero no las ejecuta.\n" +" -o nombre-opcion\n" +" Establece la variable correspondiente a nombre-opcion:\n" +" allexport igual que -a\n" +" braceexpand igual que -B\n" +" emacs usa una interfaz de edición de línea estilo " +"emacs\n" +" errexit igual que -e\n" +" errtrace igual que -E\n" +" functrace igual que -T\n" +" hashall igual que -h\n" +" histexpand igual que -H\n" +" history activa la historia de órdenes\n" +" ignoreeof el shell no terminará después de leer EOF\n" +" interactive-comments\n" +" permite que haya comentarios en órdenes " +"interactivas\n" +" keyword igual que -k\n" +" monitor igual que -m\n" +" noclobber igual que -C\n" +" noexec igual que -n\n" +" noglob igual que -f\n" +" nolog actualmente se acepta pero se descarta\n" +" notify igual que -b\n" +" nounset igual que -u\n" +" onecmd igual que -t\n" +" physical igual que -P\n" +" pipefail el valor de devolución de una tubería es el " +"estado\n" +" del último comando en salir con un estado " +"diferente\n" +" de cero, o cero si ninguna orden termina con un\n" +" estado diferente de cero\n" +" posix cambia el comportamiento de bash donde la " +"operación\n" +" por defecto difiere del estándar Posix para que\n" +" coincida con el estándar\n" +" privileged igual que -p\n" +" verbose igual que -v\n" +" vi usa una interfaz de edición de línea estilo vi\n" +" xtrace igual que -x\n" +" -p Activo cuando los ids real y efectivo del usuario no coinciden.\n" +" Desactiva el procesamiento del fichero $ENV y la importación de\n" +" funciones de shell. Si se desactiva esta opción causa que el uid " +"y\n" +" el gid efectivos sean iguales al uid y el gid real.\n" +" -t Termina después de leer y ejecutar una orden.\n" +" -u Trata las variables sin definir como un error al sustituir.\n" +" -v Muestra las líneas de entrada del shell mientras se leen.\n" +" -x Muestra las órdenes y sus argumentos mientras se ejecutan.\n" +" -B el shell realizará expansión de llaves.\n" +" -C Si se activa, no permite que los ficheros regulares existentes\n" +" se sobreescriban por redirección de la salida.\n" +" -E Si se activa, las funciones del shell heredan la trampa ERR.\n" +" -H Activa el estilo de sustitución de historia ! . Esta opción está\n" +" activa por defecto cuando el shell es interactivo.\n" +" -P Si se activa, no sigue enlaces simbólicos cuando se ejecutan " +"órdenes\n" +" como cd, que cambian el directorio actual.\n" +" -T Si se activa, las funciones del shell heredan la trampa DEBUG.\n" +" -- Asigna cualquier argumento restante a los parámetros " +"posicionales.\n" +" Si no restan argumentos, se desactivan los parámetros " +"posicionales.\n" +" - Asigna cualquier argumento restante a los parámetros " +"posicionales.\n" +" Las opciones -x y -v se desactivan.\n" +" \n" +" Si se usa + en lugar de - causa que estas opciones se desactiven. Las\n" +" opciones también se pueden usar en la invocación del shell. El " +"conjunto\n" +" actual de opciones se puede encontrar en $-. Los n ARGs restantes son\n" +" parámetros posicionales que se asignan, en orden, a $1, $2, .. $n. Si " +"no\n" +" se proporciona ningún ARG, se muestran todas las variables del shell.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que se proporcione una opción inválida." + +#: builtins.c:1126 +#, fuzzy +msgid "" +"Unset values and attributes of shell variables and functions.\n" +" \n" +" For each NAME, remove the corresponding variable or function.\n" +" \n" +" Options:\n" +" -f\ttreat each NAME as a shell function\n" +" -v\ttreat each NAME as a shell variable\n" +" -n\ttreat each NAME as a name reference and unset the variable itself\n" +" \trather than the variable it references\n" +" \n" +" Without options, unset first tries to unset a variable, and if that " +"fails,\n" +" tries to unset a function.\n" +" \n" +" Some variables cannot be unset; also see `readonly'.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a NAME is read-only." +msgstr "" +"Desactiva valores y atributos de las variables y funciones del shell.\n" +" \n" +" Por cada NOMBRE, borra la función o variable correspondiente.\n" +" \n" +" Opciones:\n" +" -f\ttrata cada NOMBRE como una función de shell\n" +" -v\ttrata cada NOMBRE como una variable de shell\n" +" \n" +" Sin opciones, unset primero trata de borrar una variable, y si falla,\n" +" trata de borrar una función.\n" +" \n" +" Algunas variables no se pueden borrar; también consulte `readonly'.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que se proporcione una opción inválida o\n" +" un NOMBRE sea de sólo lectura." + +#: builtins.c:1148 +msgid "" +"Set export attribute for shell variables.\n" +" \n" +" Marks each NAME for automatic export to the environment of subsequently\n" +" executed commands. If VALUE is supplied, assign VALUE before " +"exporting.\n" +" \n" +" Options:\n" +" -f\trefer to shell functions\n" +" -n\tremove the export property from each NAME\n" +" -p\tdisplay a list of all exported variables and functions\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" +"Establece el atributo de exportación para las variables de shell.\n" +" \n" +" Marca cada NOMBRE para exportación automática al ambiente para las " +"órdenes\n" +" ejecutadas subsecuentemente. Si se proporciona un VALOR, se asigna el\n" +" VALOR antes de exportar.\n" +" \n" +" Opciones:\n" +" -f\tse refiere a funciones de shell\n" +" -n\tborra la propiedad de exportación para cada NOMBRE\n" +" -p\tmuestra una lista de todas las variables y funciones exportadas\n" +" \n" +" El argumento `--' desactiva el procesamiento posterior de opciones.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que se proporcione una opción inválida o que\n" +" NOMBRE sea inválido." + +#: builtins.c:1167 +#, fuzzy +msgid "" +"Mark shell variables as unchangeable.\n" +" \n" +" Mark each NAME as read-only; the values of these NAMEs may not be\n" +" changed by subsequent assignment. If VALUE is supplied, assign VALUE\n" +" before marking as read-only.\n" +" \n" +" Options:\n" +" -a\trefer to indexed array variables\n" +" -A\trefer to associative array variables\n" +" -f\trefer to shell functions\n" +" -p\tdisplay a list of all readonly variables or functions, depending " +"on\n" +" whether or not the -f option is given\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" +"Marca las variables de shell para evitar su modificación.\n" +" \n" +" Marca cada NOMBRE como de sólo lectura; los valores de esos NOMBREs\n" +" no se pueden modificar por asignaciones subsecuentes. Si se " +"proporciona\n" +" un VALOR, se asigna el VALOR antes de marcar como de sólo lectura.\n" +" \n" +" Opciones:\n" +" -a\tse refiere a variables de matriz indizada\n" +" -A\tse refiere a variables de matriz asociativa\n" +" -f\tse refiere a funciones de shell\n" +" -p\tmuestra una lista de todas las variables y funciones de sólo " +"lectura\n" +" \n" +" El argumento `--' desactiva el procesamiento posterior de opciones.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que se proporcione una opción inválida o\n" +" el NOMBRE sea inválido." + +#: builtins.c:1189 +msgid "" +"Shift positional parameters.\n" +" \n" +" Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n" +" not given, it is assumed to be 1.\n" +" \n" +" Exit Status:\n" +" Returns success unless N is negative or greater than $#." +msgstr "" +"Desplaza los parámetros posicionales.\n" +" \n" +" Renombra los parámetros posicionales $N+1,$N+2 ... a $1,$2 ... Si no\n" +" se proporciona N, se asume que es 1.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que N sea negativo o mayor que $#." + +#: builtins.c:1201 builtins.c:1216 +msgid "" +"Execute commands from a file in the current shell.\n" +" \n" +" Read and execute commands from FILENAME in the current shell. The\n" +" entries in $PATH are used to find the directory containing FILENAME.\n" +" If any ARGUMENTS are supplied, they become the positional parameters\n" +" when FILENAME is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed in FILENAME; fails if\n" +" FILENAME cannot be read." +msgstr "" +"Ejecuta órdenes de un fichero en el shell actual.\n" +" \n" +" Lee y ejecuta órdenes del FICHERO en el shell actual. Se utilizan las\n" +" entradas en $PATH para encontrar el directorio que contiene el FICHERO.\n" +" Si se proporciona ARGUMENTOS, se convierten en los parámetros " +"posicionales\n" +" cuando se ejecuta el FICHERO.\n" +" Estado de Salida:\n" +" Devuelve el estado de la última orden ejecutada del FICHERO; falla si\n" +" no se puede leer el FICHERO." + +#: builtins.c:1232 +msgid "" +"Suspend shell execution.\n" +" \n" +" Suspend the execution of this shell until it receives a SIGCONT signal.\n" +" Unless forced, login shells cannot be suspended.\n" +" \n" +" Options:\n" +" -f\tforce the suspend, even if the shell is a login shell\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Suspende la ejecución del shell.\n" +" \n" +" Suspende la ejecución de este shell hasta que recibe una señal SIGCONT.\n" +" Los shells de entrada no se pueden suspender, a menos que sean " +"forzados.\n" +" \n" +" Opciones:\n" +" -f\tfuerza la suspensión, aún si el shell es un shell de entrada\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que no esté activo el control de trabajos o\n" +" suceda un error." + +#: builtins.c:1248 +#, fuzzy +msgid "" +"Evaluate conditional expression.\n" +" \n" +" Exits with a status of 0 (true) or 1 (false) depending on\n" +" the evaluation of EXPR. Expressions may be unary or binary. Unary\n" +" expressions are often used to examine the status of a file. There\n" +" are string operators and numeric comparison operators as well.\n" +" \n" +" The behavior of test depends on the number of arguments. Read the\n" +" bash manual page for the complete specification.\n" +" \n" +" File operators:\n" +" \n" +" -a FILE True if file exists.\n" +" -b FILE True if file is block special.\n" +" -c FILE True if file is character special.\n" +" -d FILE True if file is a directory.\n" +" -e FILE True if file exists.\n" +" -f FILE True if file exists and is a regular file.\n" +" -g FILE True if file is set-group-id.\n" +" -h FILE True if file is a symbolic link.\n" +" -L FILE True if file is a symbolic link.\n" +" -k FILE True if file has its `sticky' bit set.\n" +" -p FILE True if file is a named pipe.\n" +" -r FILE True if file is readable by you.\n" +" -s FILE True if file exists and is not empty.\n" +" -S FILE True if file is a socket.\n" +" -t FD True if FD is opened on a terminal.\n" +" -u FILE True if the file is set-user-id.\n" +" -w FILE True if the file is writable by you.\n" +" -x FILE True if the file is executable by you.\n" +" -O FILE True if the file is effectively owned by you.\n" +" -G FILE True if the file is effectively owned by your group.\n" +" -N FILE True if the file has been modified since it was last " +"read.\n" +" \n" +" FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" +" modification date).\n" +" \n" +" FILE1 -ot FILE2 True if file1 is older than file2.\n" +" \n" +" FILE1 -ef FILE2 True if file1 is a hard link to file2.\n" +" \n" +" String operators:\n" +" \n" +" -z STRING True if string is empty.\n" +" \n" +" -n STRING\n" +" STRING True if string is not empty.\n" +" \n" +" STRING1 = STRING2\n" +" True if the strings are equal.\n" +" STRING1 != STRING2\n" +" True if the strings are not equal.\n" +" STRING1 < STRING2\n" +" True if STRING1 sorts before STRING2 " +"lexicographically.\n" +" STRING1 > STRING2\n" +" True if STRING1 sorts after STRING2 lexicographically.\n" +" \n" +" Other operators:\n" +" \n" +" -o OPTION True if the shell option OPTION is enabled.\n" +" -v VAR\t True if the shell variable VAR is set\n" +" -R VAR\t True if the shell variable VAR is set and is a name " +"reference.\n" +" ! EXPR True if expr is false.\n" +" EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n" +" EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n" +" \n" +" arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Arithmetic binary operators return true if ARG1 is equal, not-equal,\n" +" less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n" +" than ARG2.\n" +" \n" +" Exit Status:\n" +" Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n" +" false or an invalid argument is given." +msgstr "" +"Evalúa expresiones condicionales.\n" +" \n" +" Termina con un estado de 0 (verdadero) o 1 (falso) dependiendo de\n" +" la evaluación de EXPR. Las expresiones pueden ser unarias o binarias.\n" +" Las expresiones unarias se usan generalmente para examinar el estado\n" +" de un fichero. Hay también operadores de cadenas, y operadores de\n" +" comparación numérica.\n" +" \n" +" La conducta de test depende del número de arcumentos. Lea la página\n" +" de manual de bash para la especificación completa.\n" +" \n" +" Operadores de fichero:\n" +" \n" +" -a FICHERO Verdadero si el fichero existe.\n" +" -b FICHERO Verdadero si el fichero es especial de bloques.\n" +" -c FICHERO Verdadero si el fichero es especial de caracteres.\n" +" -d FICHERO Verdadero si el fichero es un directorio.\n" +" -e FICHERO Verdadero si el fichero existe.\n" +" -f FICHERO Verdadero si el fichero existe y es un fichero " +"regular.\n" +" -g FICHERO Verdadero si el fichero tiene activado el set-group-" +"id.\n" +" -h FICHERO Verdadero si el fichero es un enlace simbólico.\n" +" -L FICHERO Verdadero si el fichero es un enlace simbólico.\n" +" -k FICHERO Verdadero si el fichero tiene el bit `sticky' " +"activado.\n" +" -p FICHERO Verdadero si el fichero es una tubería nombrada.\n" +" -r FICHERO Verdadero si el fichero es legible para usted.\n" +" -s FICHERO Verdadero si el fichero existe y no está vacío.\n" +" -S FICHERO Verdadero si el fichero es un `socket'.\n" +" -t DF Verdadero si el DF está abierto en una terminal.\n" +" -u FICHERO Verdadero si el fichero tiene activado el set-user-id.\n" +" -w FICHERO Verdadero si usted puede escribir en el fichero.\n" +" -x FICHERO Verdadero si usted puede ejecutar el fichero.\n" +" -O FICHERO Verdadero si usted efectivamente posee el fichero.\n" +" -G FICHERO Verdadero si su grupo efectivamente posee el fichero.\n" +" -N FICHERO Verdadero si el fichero se modificó desde la última " +"lectura.\n" +" \n" +" FICH1 -nt FICH2 Verdadero si fich1 es más reciente que fich2\n" +" (de acuerdo a la fecha de modificación).\n" +" \n" +" FICH1 -ot FICH2 Verdadero si fich1 es más antiguo que fich2.\n" +" \n" +" FICH1 -ef FICH2 Verdadero si fich1 es un enlace duro a fich2.\n" +" \n" +" Operadores de cadenas:\n" +" \n" +" -z CADENA Verdadero si la cadena está vacía.\n" +" \n" +" -n CADENA\n" +" CADENA Verdadero si la cadena no está vacía.\n" +" \n" +" CADENA1 = CADENA2\n" +" Verdadero si las cadenas son iguales.\n" +" CADENA1 != CADENA2\n" +" Verdadero si las cadenas no son iguales.\n" +" CADENA1 < CADENA2\n" +" Verdadero si STRING1 se ordena antes que STRING2\n" +" lexicográficamente.\n" +" CADENA1 > CADENA2\n" +" Verdadero si STRING1 se ordena después que STRING2\n" +" lexicográficamente.\n" +" \n" +" Otros operadores:\n" +" \n" +" -o OPCIÓN Verdadero si la opción del shell OPCIÓN está activada.\n" +" -v VAR Verdadero si la variable de shell VAR está activada.\n" +" ! EXPR Verdadero si expr es falso.\n" +" EXPR1 -a EXPR2 Verdadero si expr1 Y expr2 are son verdaderas.\n" +" EXPR1 -o EXPR2 Verdadero si cualquiera de expr1 O expr2 es verdadera.\n" +" \n" +" arg1 OP arg2 Pruebas aritméticas. OP es uno de -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Los operadores binarios aritméticos devuelven verdadero si ARG1 es\n" +" igual, no igual, menor, menor o igual, mayor, mayor o igual que ARG2.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito si EXPR evalúa a verdadero; falla si EXPR evalúa a\n" +" falso o se proporciona un argumento inválido." + +#: builtins.c:1329 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" This is a synonym for the \"test\" builtin, but the last argument must\n" +" be a literal `]', to match the opening `['." +msgstr "" +"Evalúa una expresión condicional.\n" +" \n" +" Este es un sinónimo para la orden interna \"test\", pero el último\n" +" argumento debe ser un `]' literal, que coincida con el `[' inicial." + +#: builtins.c:1338 +msgid "" +"Display process times.\n" +" \n" +" Prints the accumulated user and system times for the shell and all of " +"its\n" +" child processes.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Muestra los tiempos de proceso.\n" +" \n" +" Muestra los tiempos de usuario y sistema acumulados por el shell y " +"todos\n" +" sus procesos hijos.\n" +" \n" +" Estado de salida:\n" +" Siempre con éxito." + +#: builtins.c:1350 +msgid "" +"Trap signals and other events.\n" +" \n" +" Defines and activates handlers to be run when the shell receives " +"signals\n" +" or other conditions.\n" +" \n" +" ARG is a command to be read and executed when the shell receives the\n" +" signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n" +" is supplied) or `-', each specified signal is reset to its original\n" +" value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" +" shell and by the commands it invokes.\n" +" \n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. " +"If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. " +"If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or " +"a\n" +" script run by the . or source builtins finishes executing. A " +"SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause " +"the\n" +" shell to exit when the -e option is enabled.\n" +" \n" +" If no arguments are supplied, trap prints the list of commands " +"associated\n" +" with each signal.\n" +" \n" +" Options:\n" +" -l\tprint a list of signal names and their corresponding numbers\n" +" -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" +" \n" +" Each SIGNAL_SPEC is either a signal name in or a signal " +"number.\n" +" Signal names are case insensitive and the SIG prefix is optional. A\n" +" signal may be sent to the shell with \"kill -signal $$\".\n" +" \n" +" Exit Status:\n" +" Returns success unless a SIGSPEC is invalid or an invalid option is " +"given." +msgstr "" +"Atrapa señales y otros eventos.\n" +" \n" +" Define y activa manejadores a ejecutar cuando el shell recibe señales\n" +" u otras condiciones.\n" +" \n" +" ARG es una orden para leer y ejecutar cuando el shell recibe la(s)\n" +" señal(es) ID_SEÑAL. Si ARG no está presente (y sólo se proporciona\n" +" una sola ID_SEÑAL) o se proporciona `-', cada señal especificada se\n" +" reestablece a su valor original. Si ARG es la cadena nula, el shell\n" +" y las órdenes que invoque ignoran cada ID_SEÑAL.\n" +" \n" +" Si una ID_SEÑAL es EXIT (0) se ejecuta la orden ARG al salir del\n" +" shell. Si una ID_SEÑAL es DEBUG, se ejecuta ARG después de cada\n" +" orden simple. Si una ID_SEÑAL es RETURN, se ejecuta ARG cada vez\n" +" que una función de shell o un guión ejecutado por las órdenes internas\n" +" . o source termina su ejecución. Una ID_SEÑAL de ERR significa que\n" +" se ejecuta ARG cada vez que la falla de una orden causa que el shell\n" +" termine cuando la opción -e está activada.\n" +" \n" +" Si no se proporcionan argumentos, trap muestra la lista de órdenes\n" +" asociadas con cada señal.\n" +" \n" +" Opciones:\n" +" -l\tmuestra una lista de nombres de señal con su número " +"correspondiente\n" +" -p\tmuestra las órdenes trap asociadas con cada ID_SEÑAL\n" +" \n" +" Cada ID_SEÑAL es un nombre de señal en o un número de señal.\n" +" Los nombres de señal no son sensibles a mayúsculas y minúsculas y el\n" +" prefijo SIG es opcional. Se puede enviar una señal al shell con\n" +" \"kill -signal $$\". \n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que una ID_SEÑAL sea inválida o se " +"proporcione\n" +" una opción inválida." + +# No he visto que este fichero incluya la posibilidad de traducir las +# palabras que muestra `type -t'. Por esta razón, se dejan en inglés. cfuga +#: builtins.c:1386 +msgid "" +"Display information about command type.\n" +" \n" +" For each NAME, indicate how it would be interpreted if used as a\n" +" command name.\n" +" \n" +" Options:\n" +" -a\tdisplay all locations containing an executable named NAME;\n" +" \tincludes aliases, builtins, and functions, if and only if\n" +" \tthe `-p' option is not also used\n" +" -f\tsuppress shell function lookup\n" +" -P\tforce a PATH search for each NAME, even if it is an alias,\n" +" \tbuiltin, or function, and returns the name of the disk file\n" +" \tthat would be executed\n" +" -p\treturns either the name of the disk file that would be executed,\n" +" \tor nothing if `type -t NAME' would not return `file'.\n" +" -t\toutput a single word which is one of `alias', `keyword',\n" +" \t`function', `builtin', `file' or `', if NAME is an alias, shell\n" +" \treserved word, shell function, shell builtin, disk file, or not\n" +" \tfound, respectively\n" +" \n" +" Arguments:\n" +" NAME\tCommand name to be interpreted.\n" +" \n" +" Exit Status:\n" +" Returns success if all of the NAMEs are found; fails if any are not " +"found." +msgstr "" +"Muestra información sobre el tipo de orden.\n" +" \n" +" Por cada NOMBRE, indica cómo se interpretaría si se usa como un nombre\n" +" de orden.\n" +" \n" +" Opciones:\n" +" -a\tmuestra todas las ubicaciones que contienen un ejecutable llamado\n" +" \tNOMBRE; incluye aliases, órdenes internas, y funciones, solo y solo " +"si\n" +" \tno se usó también la opción `-p'\n" +" -f\tsuprime la búsqueda de funciones de shell\n" +" -P\tfuerza una búsqueda en PATH por cada nombre, aún si hay un alias,\n" +" \torden interna, o función, y devuelve el nombre del fichero en el " +"disco\n" +" \tque se ejecutaría\n" +" -p\tdevuelve ya sea el nombre del fichero en disco que se ejecutaría,\n" +" \to nada si `type -t NOMBRE' no devuelve `fichero'.\n" +" -t\tmuestra una sola palabra, que es una de `alias', `keyword',\n" +" \t`function', `builtin', `file' o `', si el NOMBRE es un alias,\n" +" \tpalabra reservada del shell, función del shell, orden interna del\n" +" \tshell, fichero de disco, o no se encuentra, respectivamente.\n" +" \n" +" Argumentos:\n" +" NOMBRE\tNombre de orden a interpretar.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito si se encuentran todos los NOMBREs; falla si no se\n" +" encuentra alguno." + +#: builtins.c:1417 +#, fuzzy +msgid "" +"Modify shell resource limits.\n" +" \n" +" Provides control over the resources available to the shell and " +"processes\n" +" it creates, on systems that allow such control.\n" +" \n" +" Options:\n" +" -S\tuse the `soft' resource limit\n" +" -H\tuse the `hard' resource limit\n" +" -a\tall current limits are reported\n" +" -b\tthe socket buffer size\n" +" -c\tthe maximum size of core files created\n" +" -d\tthe maximum size of a process's data segment\n" +" -e\tthe maximum scheduling priority (`nice')\n" +" -f\tthe maximum size of files written by the shell and its children\n" +" -i\tthe maximum number of pending signals\n" +" -l\tthe maximum size a process may lock into memory\n" +" -m\tthe maximum resident set size\n" +" -n\tthe maximum number of open file descriptors\n" +" -p\tthe pipe buffer size\n" +" -q\tthe maximum number of bytes in POSIX message queues\n" +" -r\tthe maximum real-time scheduling priority\n" +" -s\tthe maximum stack size\n" +" -t\tthe maximum amount of cpu time in seconds\n" +" -u\tthe maximum number of user processes\n" +" -v\tthe size of virtual memory\n" +" -x\tthe maximum number of file locks\n" +" -T the maximum number of threads\n" +" \n" +" Not all options are available on all platforms.\n" +" \n" +" If LIMIT is given, it is the new value of the specified resource; the\n" +" special LIMIT values `soft', `hard', and `unlimited' stand for the\n" +" current soft limit, the current hard limit, and no limit, respectively.\n" +" Otherwise, the current value of the specified resource is printed. If\n" +" no option is given, then -f is assumed.\n" +" \n" +" Values are in 1024-byte increments, except for -t, which is in seconds,\n" +" -p, which is in increments of 512 bytes, and -u, which is an unscaled\n" +" number of processes.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Modifica los límites de recursos del shell.\n" +" \n" +" Provee control sobre los recursos disponibles para el shell y los\n" +" procesos que crea, en sistemas que permiten tal control.\n" +" \n" +" Opciones:\n" +" \n" +" -S\tusa el límite de recurso `soft'\n" +" -H\tusa el límite de recurso `hard'\n" +" -a\tmuestra todos los límites actuales\n" +" -b\tel tamaño del almacenamiento intermedio del `socket'\n" +" -c\tel tamaño máximo de los ficheros `core' creados\n" +" -d\tel tamaño máximo del segmento de datos de un proceso\n" +" -e\tla prioridad máxima de calendarización (`nice')\n" +" -f\tel tamaño máximo de los ficheros escritos por el shell y sus " +"hijos\n" +" -i\tel número máximo de señales pendientes\n" +" -l\tel tamaño máximo que un proceso puede bloquear en memoria\n" +" -m\tel tamaño máximo para las variables residentes\n" +" -n\tel número máximo de descriptores de fichero abiertos\n" +" -p\tel tamaño del almacenamiento intermedio para tuberías\n" +" -q\tel tamaño máximo de bytes en las colas de mensajes POSIX\n" +" -r\tla prioridad máxima de calendarización en tiempo real\n" +" -s\tel tamaño máximo de pila\n" +" -t\tla cantidad máxima de tiempo de cpu en segundos\n" +" -u\tel número máximo de procesos de usuario\n" +" -v\tel tamaño de la memoria virtual\n" +" -x\tel número máximo de bloqueos de ficheros\n" +" \n" +" Si se establece LÍMITE, éste es el nuevo valor del recurso " +"especificado;\n" +" los valores especiales de LÍMITE `soft', `hard' y `unlimited'\n" +" corresponden al límite suave actual, el límite duro actual, y\n" +" sin límite, respectivamente. De otra forma, se muestra el valor actual\n" +" de los recursos especificados. Si no se proporciona una opción, se\n" +" asume -f.\n" +" \n" +" Los valores son en incrementos de 1024 bytes, excepto para -t, el cual\n" +" es en segundos, -p, el cual es en incrementos de 512 bytes, y -u, el\n" +" cual es un número de procesos sin escala.\n" +" \n" +" Estado de salida:\n" +" Devuelve con éxito a menos que se proporcione una opción inválida o " +"suceda\n" +" un error." + +#: builtins.c:1465 +msgid "" +"Display or set file mode mask.\n" +" \n" +" Sets the user file-creation mask to MODE. If MODE is omitted, prints\n" +" the current value of the mask.\n" +" \n" +" If MODE begins with a digit, it is interpreted as an octal number;\n" +" otherwise it is a symbolic mode string like that accepted by chmod(1).\n" +" \n" +" Options:\n" +" -p\tif MODE is omitted, output in a form that may be reused as input\n" +" -S\tmakes the output symbolic; otherwise an octal number is output\n" +" \n" +" Exit Status:\n" +" Returns success unless MODE is invalid or an invalid option is given." +msgstr "" +"Muestra o establece la máscara de modo de ficheros.\n" +" \n" +" Establece la máscara de creación de ficheros del usuario a MODO. Si se\n" +" omite el MODO, muestra el valor actual de la máscara.\n" +" \n" +" Si el MODO empieza con un dígito, se interpreta como un número octal;\n" +" de otra forma es una cadena de modo simbólico como la que acepta chmod " +"(1).\n" +" \n" +" Opciones:\n" +" -p\tsi se omite el MODO, muestra en una forma reusable como entrada\n" +" -S\tsalida simbólica; de otra forma muestra el modo como número octal\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que el MODO sea inválido o se proporcione\n" +" una opción inválida." + +#: builtins.c:1485 +#, fuzzy +msgid "" +"Wait for job completion and return exit status.\n" +" \n" +" Waits for each process identified by an ID, which may be a process ID or " +"a\n" +" job specification, and reports its termination status. If ID is not\n" +" given, waits for all currently active child processes, and the return\n" +" status is zero. If ID is a a job specification, waits for all " +"processes\n" +" in that job's pipeline.\n" +" \n" +" If the -n option is supplied, waits for the next job to terminate and\n" +" returns its exit status.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last ID; fails if ID is invalid or an invalid\n" +" option is given." +msgstr "" +"Espera la terminación del trabajo y devuelve el estado de salida.\n" +" \n" +" Espera al proceso identificado por ID, el cual puede ser un ID de\n" +" proceso o una especificación de trabajo, y reporta su estado de salida.\n" +" Si no se proporciona un ID, espera a todos los procesos hijo activos,\n" +" y el estado de devolución es cero. Si ID es una especificación de\n" +" trabajo, espera a todos los procesos en la cola de trabajos.\n" +" \n" +" Estado de Salida:\n" +" Devuelve el estado de ID; falla si ID es inválido o se proporciona una\n" +" opción inválida." + +#: builtins.c:1506 +#, fuzzy +msgid "" +"Wait for process completion and return exit status.\n" +" \n" +" Waits for each process specified by a PID and reports its termination " +"status.\n" +" If PID is not given, waits for all currently active child processes,\n" +" and the return status is zero. PID must be a process ID.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last PID; fails if PID is invalid or an " +"invalid\n" +" option is given." +msgstr "" +"Espera la terminación del trabajo y devuelve el estado de salida.\n" +" \n" +" Espera al proceso especificado y reporta su estado de salida. Si\n" +" no se proporciona un PID, espera a todos los procesos hijo activos,\n" +" y el código de devolución es cero. PID debe ser un ID de proceso.\n" +" \n" +" Estado de Salida:\n" +" Devuelve el estado de ID; falla si ID es inválido o se proporciona una\n" +" opción inválida." + +#: builtins.c:1521 +msgid "" +"Execute commands for each member in a list.\n" +" \n" +" The `for' loop executes a sequence of commands for each member in a\n" +" list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is\n" +" assumed. For each element in WORDS, NAME is set to that element, and\n" +" the COMMANDS are executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Ejecuta órdenes por cada miembro en una lista.\n" +" \n" +" El ciclo `for' ejecuta una secuencia de órdenes para cada miembro en\n" +" una lista de elementos. Si `in PALABRAS ...;' no está presente,\n" +" entonces se asume `in \"$@\"'. Para cada elemento en PALABRAS,\n" +" se define NOMBRE como ese elemento, y se ejecutan las ÓRDENES.\n" +" \n" +" Estado de Salida:\n" +" Devuelve el estado de la última orden ejecutada." + +#: builtins.c:1535 +msgid "" +"Arithmetic for loop.\n" +" \n" +" Equivalent to\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n" +" omitted, it behaves as if it evaluates to 1.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Aritmética para un ciclo.\n" +" \n" +" Equivalente a\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tÓRDENES\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, y EXP3 son expresiones aritméticas. Si se omite\n" +" cualquier expresión, se comporta como si se evaluara a 1.\n" +" \n" +" Estado de Salida:\n" +" Devuelve el estado de la última orden ejecutada." + +#: builtins.c:1553 +msgid "" +"Select words from a list and execute commands.\n" +" \n" +" The WORDS are expanded, generating a list of words. The\n" +" set of expanded words is printed on the standard error, each\n" +" preceded by a number. If `in WORDS' is not present, `in \"$@\"'\n" +" is assumed. The PS3 prompt is then displayed and a line read\n" +" from the standard input. If the line consists of the number\n" +" corresponding to one of the displayed words, then NAME is set\n" +" to that word. If the line is empty, WORDS and the prompt are\n" +" redisplayed. If EOF is read, the command completes. Any other\n" +" value read causes NAME to be set to null. The line read is saved\n" +" in the variable REPLY. COMMANDS are executed after each selection\n" +" until a break command is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Selecciona palabras de una lista y ejecuta órdenes.\n" +" \n" +" Se expanden las PALABRAS, generando una lista de palabras. El\n" +" conjunto de palabras expandidas se muestra en la salida de error\n" +" estándar, cada una precedida por un número. Si `in PALABRAS' no\n" +" está presente, se asume `in \"$@\"'. Entonces se muestra el\n" +" prompt PS3 y se lee una línea de la entrada estándar. Si la\n" +" línea consiste en el número correspondiente a una de las palabras\n" +" mostradas, entonces se define NOMBRE como esa palabra. Si la\n" +" línea está vacía, PALABRAS y el prompt se muestran de nuevo. Si\n" +" se lee EOF, se completa la orden. Cualquier otro valor leído\n" +" causa que NOMBRE se defina como nulo. La línea leída se guarda\n" +" en la variable REPLY. Se ejecutan las ÓRDENES después de cada\n" +" selección hasta que se ejecuta una orden break.\n" +" \n" +" Estado de Salida:\n" +" Devuelve el estado de la última orden ejecutada." + +#: builtins.c:1574 +msgid "" +"Report time consumed by pipeline's execution.\n" +" \n" +" Execute PIPELINE and print a summary of the real time, user CPU time,\n" +" and system CPU time spent executing PIPELINE when it terminates.\n" +" \n" +" Options:\n" +" -p\tprint the timing summary in the portable Posix format\n" +" \n" +" The value of the TIMEFORMAT variable is used as the output format.\n" +" \n" +" Exit Status:\n" +" The return status is the return status of PIPELINE." +msgstr "" +"Reporta el tiempo consumido por la ejecución de la tubería.\n" +" \n" +" Ejecuta la TUBERÍA y muestra un resumen del tiempo real, el tiempo de\n" +" CPU del usuario, y el tiempo de CPU del sistema utilizado por\n" +" la ejecución de la TUBERÍA cuando termina.\n" +" \n" +" Opciones:\n" +" -p\tmuestra el resumen de tiempos en el formato Posix transportable\n" +" \n" +" Estado de Salida:\n" +" El estado de devolución es el estado de devolución de la TUBERÍA." + +#: builtins.c:1591 +msgid "" +"Execute commands based on pattern matching.\n" +" \n" +" Selectively execute COMMANDS based upon WORD matching PATTERN. The\n" +" `|' is used to separate multiple patterns.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Ejecuta órdenes en base a la coincidencia de patrones.\n" +" \n" +" Ejecuta ÓRDENES selectivamente basado en coincidencias de la PALABRA\n" +" con el PATRÓN. Se utiliza `|' para separar patrones múltiples.\n" +" \n" +" Estado de Salida:\n" +" Devuelve el estado de la última orden ejecutada." + +#: builtins.c:1603 +msgid "" +"Execute commands based on conditional.\n" +" \n" +" The `if COMMANDS' list is executed. If its exit status is zero, then " +"the\n" +" `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list " +"is\n" +" executed in turn, and if its exit status is zero, the corresponding\n" +" `then COMMANDS' list is executed and the if command completes. " +"Otherwise,\n" +" the `else COMMANDS' list is executed, if present. The exit status of " +"the\n" +" entire construct is the exit status of the last command executed, or " +"zero\n" +" if no condition tested true.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Ejecuta comandos en base a condicionales.\n" +" \n" +" Se ejecuta la lista `if ÓRDENES'. Si su estado de salida es cero,\n" +" entonces se ejecuta la lista `then ÓRDENES`. De otra forma, cada lista\n" +" `elif ÓRDENES' se ejecuta en su lugar, y si su estado de salida es " +"cero,\n" +" se ejecuta la lista `then ÓRDENES' correspondiente y se completa la\n" +" orden if. De otra forma, se ejecuta la lista `else ÓRDENES', si está\n" +" presente. El estado de salida de toda la construcción es el estado de\n" +" salida de la última orden ejecutada, o cero si ninguna condición " +"resultó\n" +" verdadera.\n" +" \n" +" Estado de Salida:\n" +" Devuelve el estado de la última orden ejecutada." + +#: builtins.c:1620 +msgid "" +"Execute commands as long as a test succeeds.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `while' COMMANDS has an exit status of zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Ejecuta órdenes mientras una prueba tenga éxito.\n" +" \n" +" Expande y ejecuta ÓRDENES mientras la orden final en las ÓRDENES\n" +" `while' tenga un estado de salida de cero.\n" +" \n" +" Estado de Salida:\n" +" Devuelve el estado de la última orden ejecutada." + +#: builtins.c:1632 +msgid "" +"Execute commands as long as a test does not succeed.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `until' COMMANDS has an exit status which is not zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Ejecuta órdenes mientras una prueba no tenga éxito.\n" +" \n" +" Expande y ejecuta ÓRDENES mientras la orden final en las ÓRDENES\n" +" `until' tengan un estado de salida que no sea cero.\n" +" \n" +" Estado de Salida:\n" +" Devuelve el estado de la última orden ejecutada." + +#: builtins.c:1644 +msgid "" +"Create a coprocess named NAME.\n" +" \n" +" Execute COMMAND asynchronously, with the standard output and standard\n" +" input of the command connected via a pipe to file descriptors assigned\n" +" to indices 0 and 1 of an array variable NAME in the executing shell.\n" +" The default NAME is \"COPROC\".\n" +" \n" +" Exit Status:\n" +" Returns the exit status of COMMAND." +msgstr "" +"Crea un coproceso llamado NOMBRE.\n" +" \n" +" Ejecuta la ORDEN asíncronamente, con la salida estándar y la entrada\n" +" estándar de la orden contectada a través de una tubería a los " +"descriptores\n" +" de fichero asignados a los índices 0 y 1 de una variable de matriz " +"NOMBRE\n" +" en el shell en ejecución. El nombre por defecto es \"COPROC\".\n" +" \n" +" Estado de Salida:\n" +" Devuelve el estado de salida de la ORDEN." + +#: builtins.c:1658 +msgid "" +"Define shell function.\n" +" \n" +" Create a shell function named NAME. When invoked as a simple command,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is " +"invoked,\n" +" the arguments are passed to the function as $1...$n, and the function's\n" +" name is in $FUNCNAME.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is readonly." +msgstr "" +"Define una función de shell.\n" +" \n" +" Crea una función de shell llamada NOMBRE. Cuando se invoca como una\n" +" orden simple, NOMBRE ejecuta ÓRDENES en el contexto del shell que lo\n" +" llamó. Cuando se invoca NOMBRE, los argumentos se pasan a la función\n" +" como $1...$n, y el nombre de la función está en $FUNCNAME.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que NOMBRE sea de sólo lectura" + +#: builtins.c:1672 +msgid "" +"Group commands as a unit.\n" +" \n" +" Run a set of commands in a group. This is one way to redirect an\n" +" entire set of commands.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Agrupa órdenes como una unidad.\n" +" \n" +" Ejecuta un conjunto de órdenes en un grupo. Esta es una forma de\n" +" redirigir un conjunto completo de órdenes.\n" +" \n" +" Estado de Salida:\n" +" Devuelve el estado de la última orden ejecutada." + +#: builtins.c:1684 +msgid "" +"Resume job in foreground.\n" +" \n" +" Equivalent to the JOB_SPEC argument to the `fg' command. Resume a\n" +" stopped or background job. JOB_SPEC can specify either a job name\n" +" or a job number. Following JOB_SPEC with a `&' places the job in\n" +" the background, as if the job specification had been supplied as an\n" +" argument to `bg'.\n" +" \n" +" Exit Status:\n" +" Returns the status of the resumed job." +msgstr "" +"Reinicia el trabajo en primer plano.\n" +" \n" +" Equivalente al argumento IDTRABAJO de la orden `fg'. Reinicia un\n" +" trabajo detenido o en segundo plano. IDTRABAJO puede especificar\n" +" un nombre de trabajo o un número de trabajo. Un `&' a continuación\n" +" de IDTRABAJO coloca al trabajo en segundo plano, como si la\n" +" especificación del trabajo se hubiera proporcionado como\n" +" un argumento de `bg'.\n" +" \n" +" Estado de Salida:\n" +" Devuelve el estado del trabajo reiniciado." + +#: builtins.c:1699 +msgid "" +"Evaluate arithmetic expression.\n" +" \n" +" The EXPRESSION is evaluated according to the rules for arithmetic\n" +" evaluation. Equivalent to \"let EXPRESSION\".\n" +" \n" +" Exit Status:\n" +" Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise." +msgstr "" +"Evalúa una expresión aritmética.\n" +" \n" +" Se evalua la EXPRESIÓN de acuerdo a las reglas de evaluación\n" +" aritmética. Equivalente a \"let EXPRESIÓN\".\n" +" \n" +" Estado de Salida:\n" +" Devuelve 1 si la EXPRESIÓN evalúa a 0; devuelve 0 de otra manera." + +#: builtins.c:1711 +msgid "" +"Execute conditional command.\n" +" \n" +" Returns a status of 0 or 1 depending on the evaluation of the " +"conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries " +"used\n" +" by the `test' builtin, and may be combined using the following " +"operators:\n" +" \n" +" ( EXPRESSION )\tReturns the value of EXPRESSION\n" +" ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" +" EXPR1 && EXPR2\tTrue if both EXPR1 and EXPR2 are true; else false\n" +" EXPR1 || EXPR2\tTrue if either EXPR1 or EXPR2 is true; else false\n" +" \n" +" When the `==' and `!=' operators are used, the string to the right of\n" +" the operator is used as a pattern and pattern matching is performed.\n" +" When the `=~' operator is used, the string to the right of the operator\n" +" is matched as a regular expression.\n" +" \n" +" The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n" +" determine the expression's value.\n" +" \n" +" Exit Status:\n" +" 0 or 1 depending on value of EXPRESSION." +msgstr "" +"Ejecuta una orden condicional.\n" +" \n" +" Devuelve un estado de 0 ó 1 dependiendo de la evaluación de la " +"expresión\n" +" condicional EXPRESIÓN. Las expresiones se componen de los mismos\n" +" elementos primarios usados por la orden interna `test', y se pueden\n" +" combinar usando los siguientes operadores:\n" +" \n" +" ( EXPRESIÓN )\tDevuelve el valor de la EXPRESIÓN\n" +" ! EXPRESIÓN\tVerdadero si la EXPRESIÓN es falsa; de otra forma es " +"falso\n" +" EXPR1 && EXPR2\tVerdadero si EXPR1 y EXPR2 son verdaderos; de\n" +" \t\totra forma es falso\n" +" \tEXPR1 || EXPR2\tVerdadero si EXPR1 o EXPR2 es verdadero; de\n" +" \t\totra forma es falso\n" +" \n" +" Cuando se usan los operadores `==' y `!=', se usa la cadena a la\n" +" derecha del operador como un patrón y se realiza una coincidencia de\n" +" patrones. Cuando se usa el operador `=~', la cadena a la derecha del\n" +" operador coincide como una expresión regular.\n" +" \n" +" Los operadores && y || no evalúan EXPR2 si EXPR1 es suficiente para\n" +" determinar el valor de una expresión. \n" +" Estado de Salida:\n" +" 0 o 1 dependiendo del valor de la EXPRESIÓN." + +#: builtins.c:1737 +msgid "" +"Common shell variable names and usage.\n" +" \n" +" BASH_VERSION\tVersion information for this Bash.\n" +" CDPATH\tA colon-separated list of directories to search\n" +" \t\tfor directories given as arguments to `cd'.\n" +" GLOBIGNORE\tA colon-separated list of patterns describing filenames to\n" +" \t\tbe ignored by pathname expansion.\n" +" HISTFILE\tThe name of the file where your command history is stored.\n" +" HISTFILESIZE\tThe maximum number of lines this file can contain.\n" +" HISTSIZE\tThe maximum number of history lines that a running\n" +" \t\tshell can access.\n" +" HOME\tThe complete pathname to your login directory.\n" +" HOSTNAME\tThe name of the current host.\n" +" HOSTTYPE\tThe type of CPU this version of Bash is running under.\n" +" IGNOREEOF\tControls the action of the shell on receipt of an EOF\n" +" \t\tcharacter as the sole input. If set, then the value\n" +" \t\tof it is the number of EOF characters that can be seen\n" +" \t\tin a row on an empty line before the shell will exit\n" +" \t\t(default 10). When unset, EOF signifies the end of input.\n" +" MACHTYPE\tA string describing the current system Bash is running on.\n" +" MAILCHECK\tHow often, in seconds, Bash checks for new mail.\n" +" MAILPATH\tA colon-separated list of filenames which Bash checks\n" +" \t\tfor new mail.\n" +" OSTYPE\tThe version of Unix this version of Bash is running on.\n" +" PATH\tA colon-separated list of directories to search when\n" +" \t\tlooking for commands.\n" +" PROMPT_COMMAND\tA command to be executed before the printing of each\n" +" \t\tprimary prompt.\n" +" PS1\t\tThe primary prompt string.\n" +" PS2\t\tThe secondary prompt string.\n" +" PWD\t\tThe full pathname of the current directory.\n" +" SHELLOPTS\tA colon-separated list of enabled shell options.\n" +" TERM\tThe name of the current terminal type.\n" +" TIMEFORMAT\tThe output format for timing statistics displayed by the\n" +" \t\t`time' reserved word.\n" +" auto_resume\tNon-null means a command word appearing on a line by\n" +" \t\titself is first looked for in the list of currently\n" +" \t\tstopped jobs. If found there, that job is foregrounded.\n" +" \t\tA value of `exact' means that the command word must\n" +" \t\texactly match a command in the list of stopped jobs. A\n" +" \t\tvalue of `substring' means that the command word must\n" +" \t\tmatch a substring of the job. Any other value means that\n" +" \t\tthe command must be a prefix of a stopped job.\n" +" histchars\tCharacters controlling history expansion and quick\n" +" \t\tsubstitution. The first character is the history\n" +" \t\tsubstitution character, usually `!'. The second is\n" +" \t\tthe `quick substitution' character, usually `^'. The\n" +" \t\tthird is the `history comment' character, usually `#'.\n" +" HISTIGNORE\tA colon-separated list of patterns used to decide which\n" +" \t\tcommands should be saved on the history list.\n" +msgstr "" +"Nombres de variables de shell comunes y su uso.\n" +" \n" +" BASH_VERSION\tInformación de versión para este Bash.\n" +" CDPATH\tUna lista de directorios separada por dos puntos\n" +" \t\tpara buscar directorios dados como argumentos para `cd'.\n" +" GLOBIGNORE\tUna lista de patrones separada por dos puntos\n" +" \t\tque describe nombres de fichero a ignorar por la expansión\n" +" \t\tde rutas de nombre.\n" +" HISTFILE\tEl nombre del fichero donde se almacena su historia\n" +" \t\tde órdenes.\n" +" HISTFILESIZE\tEl número máximo de líneas que puede contener\n" +" \t\teste fichero.\n" +" HISTSIZE\tEl número máximo de líneas de líneas de historia que\n" +" \t\tun shell en ejecución puede acceder.\n" +" HOME\tLa ruta completa a su directorio de entrada.\n" +" HOSTNAME\tEl nombre del anfitrión actual.\n" +" HOSTTYPE\tEl tipo de CPU bajo el cual se ejecuta esta versión de\n" +" \t\tBash.\n" +" IGNOREEOF\tControla la acción del shell al recibir un carácter\n" +" \t\tEOF como la única entrada. Si está definida, entonces su\n" +" \t\tvalor es el número de caracteres EOF que se deben leer de\n" +" \t\tforma consecutiva en una línea vacía antes de que el shell\n" +" \t\ttermine (por defecto 10). Cuando no está definida, EOF\n" +" \t\tsignifica el fin de la entrada.\n" +" MACHTYPE\tUna cadena que describe el sistema actual donde se\n" +" \t\tejecuta Bash.\n" +" MAILCHECK\tLa frecuencia, en segundos, que Bash busca correo nuevo.\n" +" MAILPATH\tUna lista de nombres de ficheros separada por dos puntos\n" +" \t\ten la cual Bash busca correo nuevo.\n" +" OSTYPE\tla versión de Unix en la que se ejecuta esta versión\n" +" \t\tde Bash.\n" +" PATH\tUna lista de directorios separada por dos puntos en la que\n" +" \t\tse buscan órdenes.\n" +" PROMPT_COMMAND\tUna orden a ejecutar antes de mostrar cada prompt\n" +" \t\tprimario.\n" +" PS1\t\tLa cadena primaria de prompt.\n" +" PS2\t\tLa cadena secundaria de prompt.\n" +" PWD\t\tLa ruta completa del directorio actual.\n" +" SHELLOPTS\tUna lista separada por dos puntos de las opciones\n" +" \t\tde shell activadas.\n" +" TERM\tEl nombre del tipo actual de terminal.\n" +" TIMEFORMAT\tEl formato de salida para las estadísticas de tiempo\n" +" \t\tmostradas por la palabra reservada `time'.\n" +" auto_resume\tSi no es nulo significa que una palabra de orden que\n" +" \t\taparece en una línea por sí sola se busca primero en la lista\n" +" \t\tactual de trabajos detenidos. Si se encuentra ahí, ese\n" +" \t\ttrabajo se coloca en primer plano. Un valor `exact' significa\n" +" \t\tque la palabra de orden debe coincidir exactamente con una\n" +" \t\torden en la lista de trabajos detenidos. Un valor `substring'\n" +" \t\tsignifica que la palabra de orden debe coincidir con una\n" +" \t\tsubcadena del trabajo. Cualquier otro valor significa que\n" +" \t\tla orden debe ser un prefijo de un trabajo detenido.\n" +" histchars\tLos caracteres que controlan la expansión de historia\n" +" \t\ty la sustitución rápida. El primer carácter es el\n" +" \t\tcarácter de sustitución de historia, generalmente `!'. El\n" +" \t\tsegundo es el carácter de `sustitución rápida', generalmente\n" +" \t\t`^'. El tercero es el carácter `comentario de historia',\n" +" \t\tgeneralmente `#'.\n" +" HISTIGNORE\tUna lista separada por dos puntos de patrones usados\n" +" \t\tpara decidir cuáles órdenes se deben guardar en la lista de\n" +" \t\thistoria.\n" + +#: builtins.c:1794 +msgid "" +"Add directories to stack.\n" +" \n" +" Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" +"Agrega directorios a la pila.\n" +" \n" +" Agrega un directorio al tope de la pila de directorios, o rota\n" +" la pila, haciendo que el nuevo tope de la pila sea el\n" +" directorio de trabajo actual. Sin argumentos, intercambia\n" +" los dos directorios del tope.\n" +" \n" +" Opciones:\n" +" -n\tsuprime el cambio normal de directorio cuando se agregan\n" +" \tdirectorios a la pila, así sólo se manipula la pila.\n" +" \n" +" Argumentos:\n" +" +N\tRota la pila para que el N-ésimo directorio (contando\n" +" \tde la izquierda de la lista mostrada por `dirs',comenzando\n" +" \tdesde cero) esté en el tope.\n" +" \n" +" -N\tRota la pila para que el N-ésimo directorio (contando\n" +" \tde la derecha de la lista mostrada por `dirs', comenzando\n" +" \tdesde cero) esté en el tope.\n" +" \n" +" dir\tagrega DIR a la pila de directorios en el tope,\n" +" \thaciéndolo el nuevo directorio de trabajo actual.\n" +" \n" +" La orden interna `dirs' muestra la pila de directorios.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que se proporcione un argumento inválido o\n" +" falle el cambio de directorio." + +#: builtins.c:1828 +msgid "" +"Remove directories from stack.\n" +" \n" +" Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" +"Borra directorios de la pila.\n" +" \n" +" Borra entradas de la pila de directorios. Sin argumentos,\n" +" borra el directorio del tope de la pila, y cambia al\n" +" nuevo directorio tope.\n" +" \n" +" Opciones:\n" +" -n\tsuprime el cambio normal de directorio cuando se borran\n" +" \tdirectorios de la pila, así sólo se manipula la pila.\n" +" \n" +" Argumentos:\n" +" \n" +" +N\tBorra la N-ésima entrada contando de la izquierda de\n" +" \tla lista mostrada por `dirs', comenzando desde cero.\n" +" \tPor ejemplo: `popd +0' borra el primer directorio, `popd +1'\n" +" \tel segundo.\n" +" \n" +" -N\tBorra la N-ésima entrada contando de la derecha de\n" +" \tla lista mostrada por `dirs', comenzando desde cero.\n" +" \tPor ejemplo: `popd -0' borra el último directorio, `popd -1'\n" +" \tel penúltimo.\n" +" \n" +" La orden interna `dirs' muestra el contenido de la pila.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que se proporcione un argumento inválido o\n" +" falle el cambio de directorio." + +#: builtins.c:1858 +msgid "" +"Display directory stack.\n" +" \n" +" Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Muestra la pila de directorios.\n" +" \n" +" Muestra la lista de directorios actualmente grabados. Los directorios\n" +" se guardan en la lista con la orden `pushd'; pueden ir saliendo de\n" +" la lista con la orden `popd'.\n" +" \n" +" Opciones:\n" +" \n" +" -c\tlimpia la pila de directorios, eliminando todos sus elementos.\n" +" -l\tno muestra versiones con prefijo de tilde de los directorios\n" +" \trelativos a su directorio inicial.\n" +" -p\tmuestra la pila de directorios con una entrada por línea\n" +" -v\tmuestra la pila de directorios con una entrada por línea con\n" +" \tsu posición en la pila como prefijo\n" +" \n" +" Argumentos: +N\tmuestra la N-ésima entrada contando desde la " +"izquierda de la lista\n" +" \tmostrada por dirs cuando se invoca sin opciones,\n" +" \tempezando de cero.\n" +" \n" +" -N\tmuestra la N-ésima entrada contando desde la derecha de la lista\n" +" \tmostrada por dirs cuando se invoca sin opciones,\n" +" \tempezando de cero.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito, a menos que se proporcione una opción inválida o\n" +" suceda un error." + +#: builtins.c:1887 +msgid "" +"Set and unset shell options.\n" +" \n" +" Change the setting of each shell option OPTNAME. Without any option\n" +" arguments, list all shell options with an indication of whether or not " +"each\n" +" is set.\n" +" \n" +" Options:\n" +" -o\trestrict OPTNAMEs to those defined for use with `set -o'\n" +" -p\tprint each shell option with an indication of its status\n" +" -q\tsuppress output\n" +" -s\tenable (set) each OPTNAME\n" +" -u\tdisable (unset) each OPTNAME\n" +" \n" +" Exit Status:\n" +" Returns success if OPTNAME is enabled; fails if an invalid option is\n" +" given or OPTNAME is disabled." +msgstr "" +"Activa y desactiva opciones de shell.\n" +" \n" +" Cambia la configuración de cada opción de shell NOMBRE_OPCIÓN. Sin\n" +" alguna opción como argumento, muestra todas las opciones de shell con\n" +" una indicación si está activa o no.\n" +" \n" +" Opciones:\n" +" -o\trestringe NOMBRE_OPCIÓN a aquellos definidos con `set -o'\n" +" -p\tmuestra cada opción de shell con un indicador de su estado\n" +" -q\tsuprime la salida\n" +" -s\tactiva (establece) cada NOMBRE_OPCIÓN\n" +" -u\tdesactiva (borra) cada NOMBRE_OPCIÓN\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito si se activa NOMBRE_OPCIÓN; falla si se proporciona\n" +" una opción inválida o NOMBRE_OPCIÓN está desactivado." + +#: builtins.c:1908 +#, fuzzy +msgid "" +"Formats and prints ARGUMENTS under control of the FORMAT.\n" +" \n" +" Options:\n" +" -v var\tassign the output to shell variable VAR rather than\n" +" \t\tdisplay it on the standard output\n" +" \n" +" FORMAT is a character string which contains three types of objects: " +"plain\n" +" characters, which are simply copied to standard output; character " +"escape\n" +" sequences, which are converted and copied to the standard output; and\n" +" format specifications, each of which causes printing of the next " +"successive\n" +" argument.\n" +" \n" +" In addition to the standard format specifications described in " +"printf(1),\n" +" printf interprets:\n" +" \n" +" %b\texpand backslash escape sequences in the corresponding argument\n" +" %q\tquote the argument in a way that can be reused as shell input\n" +" %(fmt)T output the date-time string resulting from using FMT as a " +"format\n" +" string for strftime(3)\n" +" \n" +" The format is re-used as necessary to consume all of the arguments. If\n" +" there are fewer arguments than the format requires, extra format\n" +" specifications behave as if a zero value or null string, as " +"appropriate,\n" +" had been supplied.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a write or " +"assignment\n" +" error occurs." +msgstr "" +"Da formato y muestra ARGUMENTOS bajo el control del FORMATO.\n" +" \n" +" Opciones:\n" +" -v var\tasigna la salida a la variable de shell VAR en lugar\n" +" \t\tde mostrarla en la salida estándar\n" +" \n" +" FORMATO es una cadena de caracteres la cual contiene tres tipos de\n" +" objetos: caracteres simples, los cuales solamente se copian a la salida\n" +" salida estándar; secuencias de escape de caracteres, las cuales\n" +" se convierten y se copian a la salida estándar; y especificaciones de\n" +" formato, cada una de las cuales causa la muestra del siguiente " +"argumento\n" +" consecutivo.\n" +" \n" +" Además de las especificaciones de formato estándar descritas en\n" +" printf(1) y printf(3), printf interpreta:\n" +" \n" +" %b\texpande las secuencias de escape de barra invertida en\n" +" el argumento correspondiente\n" +" %q\tcita el argumento de tal forma que se puede reusar como\n" +" entrada del shell.\n" +" %(fmt)T muestra la cadena fecha hora resultante de usar FMT como\n" +" una cadena de formato para strftime(3)\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que se proporcione una opción inválida o\n" +" suceda un error de escritura o de asignación." + +#: builtins.c:1942 +msgid "" +"Specify how arguments are to be completed by Readline.\n" +" \n" +" For each NAME, specify how arguments are to be completed. If no " +"options\n" +" are supplied, existing completion specifications are printed in a way " +"that\n" +" allows them to be reused as input.\n" +" \n" +" Options:\n" +" -p\tprint existing completion specifications in a reusable format\n" +" -r\tremove a completion specification for each NAME, or, if no\n" +" \tNAMEs are supplied, all completion specifications\n" +" -D\tapply the completions and actions as the default for commands\n" +" \twithout any specific completion defined\n" +" -E\tapply the completions and actions to \"empty\" commands --\n" +" \tcompletion attempted on a blank line\n" +" \n" +" When completion is attempted, the actions are applied in the order the\n" +" uppercase-letter options are listed above. The -D option takes\n" +" precedence over -E.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Especifica cuántos argumentos deben ser completados por Readline.\n" +" \n" +" Por cada NOMBRE, especifica cuántos argumentos se deben completar. Si\n" +" no se proporcionan opciones, se muestran las especificaciones de\n" +" completado existentes en una forma que permite que se reusen como " +"entrada.\n" +" \n" +" Opciones:\n" +" -p\tmuestra las especificaciones de completado existentes en formato\n" +" \treusable\n" +" -r\tborra una especificación de completado para cada NOMBRE,\n" +" \to, si no se proporcionan NOMBREs, todas las especificaciones\n" +" \tde completado\n" +" -D\taplica los completados y acciones por defecto para las órdenes\n" +" \tsin ninguna especificación de completado definida\n" +" -E\taplica los completados y acciones para órdenes \"vacías\" --\n" +" \tcuando se intenta completar en una línea en blanco\n" +" \n" +" Cuando se intenta el completado, las acciones se aplican en el orden en\n" +" que se enlistan las opciones de letra mayúscula antes indicadas. La\n" +" opción -D tiene precedencia sobre -E.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que se proporcione una opción inválida o\n" +" suceda un error." + +#: builtins.c:1970 +msgid "" +"Display possible completions depending on the options.\n" +" \n" +" Intended to be used from within a shell function generating possible\n" +" completions. If the optional WORD argument is supplied, matches " +"against\n" +" WORD are generated.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Muestra los posibles complementos dependiendo de las opciones.\n" +" \n" +" Sirve para usarse desde una función de shell que genere complementos\n" +" posibles. Si se proporciona el argumento opcional PALABRA, se generan\n" +" las coincidencias contra PALABRA.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que se proporcione una opción inválida o\n" +" suceda un error." + +#: builtins.c:1985 +msgid "" +"Modify or display completion options.\n" +" \n" +" Modify the completion options for each NAME, or, if no NAMEs are " +"supplied,\n" +" the completion currently being executed. If no OPTIONs are given, " +"print\n" +" the completion options for each NAME or the current completion " +"specification.\n" +" \n" +" Options:\n" +" \t-o option\tSet completion option OPTION for each NAME\n" +" \t-D\t\tChange options for the \"default\" command completion\n" +" \t-E\t\tChange options for the \"empty\" command completion\n" +" \n" +" Using `+o' instead of `-o' turns off the specified option.\n" +" \n" +" Arguments:\n" +" \n" +" Each NAME refers to a command for which a completion specification must\n" +" have previously been defined using the `complete' builtin. If no NAMEs\n" +" are supplied, compopt must be called by a function currently generating\n" +" completions, and the options for that currently-executing completion\n" +" generator are modified.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or NAME does not\n" +" have a completion specification defined." +msgstr "" +"Modifica o muestra las opciones de completado.\n" +" \n" +" Modifica las opciones de completado para cada NOMBRE, o, si no se\n" +" proporcionan NOMBREs, el completado actualmente en ejecución. Si no se\n" +" proporcionan OPCIONes, muestra las opciones de completado para cada\n" +" NOMBRE o la especificación de completado actual.\n" +" Opciones:\n" +" \t-o opción\tEstablece la opción de completado OPCIÓN\n" +" \t\tpara cada NOMBRE\n" +" \t-D\t\tCambia las opciones para el completado de orden \"por defecto\"\n" +" \t-E\t\tCambia las opciones para el completado de orden \"vacía\"\n" +" \n" +" Si usa `+o' en lugar de `-o' desactiva la opción especificada.\n" +" \n" +" Argumentos:\n" +" \n" +" Cada NOMBRE se refiere a una orden para la cual se definió previamente\n" +" una especificación de completado usando la orden interna `complete'.\n" +" Si no se proporcionan NOMBREs, se debe llamar a compopt desde una " +"función\n" +" que genere completados, y se modifican las opciones para ese generador\n" +" de completados en ejecución.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que se proporcione una opción inválida o\n" +" el NOMBRE no tenga una especificación de completado definida." + +#: builtins.c:2015 +msgid "" +"Read lines from the standard input into an indexed array variable.\n" +" \n" +" Read lines from the standard input into the indexed array variable " +"ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable " +"MAPFILE\n" +" is the default ARRAY.\n" +" \n" +" Options:\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are " +"copied.\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default " +"index is 0.\n" +" -s count \tDiscard the first COUNT lines read.\n" +" -t\t\tRemove a trailing newline from each line read.\n" +" -u fd\t\tRead lines from file descriptor FD instead of the standard " +"input.\n" +" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read.\n" +" -c quantum\tSpecify the number of lines read between each call to " +"CALLBACK.\n" +" \n" +" Arguments:\n" +" ARRAY\t\tArray variable name to use for file data.\n" +" \n" +" If -C is supplied without -c, the default quantum is 5000. When\n" +" CALLBACK is evaluated, it is supplied the index of the next array\n" +" element to be assigned and the line to be assigned to that element\n" +" as additional arguments.\n" +" \n" +" If not supplied with an explicit origin, mapfile will clear ARRAY " +"before\n" +" assigning to it.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or ARRAY is readonly " +"or\n" +" not an indexed array." +msgstr "" +"Lee líneas de un fichero y las guarda en una variable de matriz indizada.\n" +" \n" +" Lee líneas de la entrada estándar y las guarda en la variable de matriz\n" +" indizada MATRIZ, o desde el descriptor de fichero DF si se proporciona\n" +" la opción -u. La variable MAPFILE es la MATRIZ por defecto.\n" +" \n" +" Opciones:\n" +" -n cuenta\tCopia hasta CUENTA líneas. Si CUENTA es 0, se copian\n" +" \ttodas las líneas.\n" +" -O origen\tComienza a asignar a MATRIZ en el índice ORIGEN. El\n" +" \tíndice por defecto es 0.\n" +" -s cuenta \tDescarta las primeras CUENTA líneas leídas.\n" +" -t\t\tBorra la nueva línea final de cada línea leída.\n" +" -u df\t\tLee líneas del descriptor de fichero DF en lugar de la\n" +" \tentrada estándar.\n" +" -C llamada\tEvalúa LLAMADA cada vez que se leen QUANTUM líneas.\n" +" -c quantum\tEspecifica el número de líneas a leer entre cada\n" +" \tllamada a LLAMADA.\n" +" \n" +" Argumentos:\n" +" MATRIZ\t\tNombre de variable de matriz a usar para guardar datos.\n" +" \n" +" Si se proporciona -C sin -c, el quantum por defecto es 5000. Cuando\n" +" se evalúa LLAMADA, se proporciona el índice del siguiente elemento\n" +" de la matriz a asignar como un argumento adicional.\n" +" \n" +" Si no se proporciona un origen explícito, mapfile borrará la MATRIZ\n" +" antes de usarla para asignación.\n" +" \n" +" Estado de Salida:\n" +" Devuelve con éxito a menos que se proporcione una opción inválida o\n" +" la MATRIZ sea de sólo lectura o no sea una matriz indizada." + +#: builtins.c:2049 +msgid "" +"Read lines from a file into an array variable.\n" +" \n" +" A synonym for `mapfile'." +msgstr "" +"Lee líneas de un fichero en una variable de matriz.\n" +" \n" +" Un sinónimo de `mapfile'." + +#~ msgid "Copyright (C) 2009 Free Software Foundation, Inc.\n" +#~ msgstr "Copyright (C) 2009 Free Software Foundation, Inc.\n" + +#~ msgid "" +#~ "License GPLv2+: GNU GPL version 2 or later \n" +#~ msgstr "" +#~ "Licencia GPLv2+: GPL de GNU versión 2 o posterior \n" + +#~ msgid "wait [pid]" +#~ msgstr "wait [pid]" + +#~ msgid "" +#~ ". With EXPR, returns\n" +#~ " " +#~ msgstr "" +#~ ". Con EXPR, devuelve\n" +#~ " " + +#~ msgid "" +#~ "; this extra information can be used to\n" +#~ " provide a stack trace.\n" +#~ " \n" +#~ " The value of EXPR indicates how many call frames to go back before " +#~ "the\n" +#~ " current one; the top frame is frame 0." +#~ msgstr "" +#~ "; esta información adicional se puede usar para\n" +#~ " proveer un rastreo de pila.\n" +#~ " \n" +#~ " El valor de EXPR indica cuántos marcos de llamada retroceder antes " +#~ "del\n" +#~ " marco actual; el marco superior es el marco 0." + +#~ msgid "xrealloc: cannot reallocate %lu bytes (%lu bytes allocated)" +#~ msgstr "xrealloc: no se pueden reasignar %lu bytes (%lu bytes asignados)" + +#~ msgid "xrealloc: cannot allocate %lu bytes" +#~ msgstr "xrealloc: no se pueden reasignar %lu bytes" + +#~ msgid "xrealloc: %s:%d: cannot reallocate %lu bytes (%lu bytes allocated)" +#~ msgstr "" +#~ "xrealloc: %s:%d: no se pueden reasignar %lu bytes (%lu bytes asignados)" + +#~ msgid " " +#~ msgstr " " + +#~ msgid "Without EXPR, returns returns \"$line $filename\". With EXPR," +#~ msgstr "Sin EXPR, returns devuelve \"$linea $nombrefichero\". Con EXPR," + +#~ msgid "returns \"$line $subroutine $filename\"; this extra information" +#~ msgstr "devuelve \"$linea $subrutina $nombrefichero\"; esta información" + +#~ msgid "can be used used to provide a stack trace." +#~ msgstr "adicional se puede usar para proveer un volcado de pila." + +#~ msgid "" +#~ "The value of EXPR indicates how many call frames to go back before the" +#~ msgstr "" +#~ "El valor de EXPR indica cuántos marcos de llamada se debe retroceder" + +#~ msgid "current one; the top frame is frame 0." +#~ msgstr "antes del actual; el marco inicial es el marco 0." + +#~ msgid "%s: invalid number" +#~ msgstr "%s: número inválido" + +#~ msgid "Shell commands matching keywords `" +#~ msgstr "Órdenes del shell que coinciden con las palabras `" + +#~ msgid "Display the list of currently remembered directories. Directories" +#~ msgstr "" +#~ "Muestra la lista de directorios actualmente grabados. Los directorios" + +#~ msgid "find their way onto the list with the `pushd' command; you can get" +#~ msgstr "se guardan en la lista con la orden `pushd'; pueden ir saliendo de" + +#~ msgid "back up through the list with the `popd' command." +#~ msgstr "la lista con la orden `popd'." + +#~ msgid "" +#~ "The -l flag specifies that `dirs' should not print shorthand versions" +#~ msgstr "" +#~ "La opción -l especifica que `dirs' no debe mostrar versiones abreviadas" + +#~ msgid "" +#~ "of directories which are relative to your home directory. This means" +#~ msgstr "" +#~ "de los directorios que son relativos a su directorio inicial. Esto " +#~ "significa" + +#~ msgid "that `~/bin' might be displayed as `/homes/bfox/bin'. The -v flag" +#~ msgstr "que `~/bin' se mostrará como `/homes/bfox/bin'. La opción -v" + +#~ msgid "causes `dirs' to print the directory stack with one entry per line," +#~ msgstr "" +#~ "causa que `dirs' imprima la pila de directorios con una entrada por línea," + +#~ msgid "" +#~ "prepending the directory name with its position in the stack. The -p" +#~ msgstr "" +#~ "anteponiendo la posición en la pila al nombre del directorio. La opción" + +#~ msgid "flag does the same thing, but the stack position is not prepended." +#~ msgstr "-p hace lo mismo, pero no antepone la posición en la pila." + +#~ msgid "" +#~ "The -c flag clears the directory stack by deleting all of the elements." +#~ msgstr "" +#~ "La opción -c limpia la pila de directorios borrando todos sus elementos." + +#~ msgid "" +#~ "+N displays the Nth entry counting from the left of the list shown by" +#~ msgstr "" +#~ "+N muestra la N-ésima entrada contando desde la izquierda de la lista" + +#~ msgid " dirs when invoked without options, starting with zero." +#~ msgstr "" +#~ " mostrada por dirs cuando se invoca sin opciones, empezando de cero." + +#~ msgid "" +#~ "-N displays the Nth entry counting from the right of the list shown by" +#~ msgstr "" +#~ "-N muestra la N-ésima entrada contando desde la derecha de la lista" + +#~ msgid "Adds a directory to the top of the directory stack, or rotates" +#~ msgstr "Agrega un directorio al tope de la pila de directorios, o rota" + +#~ msgid "the stack, making the new top of the stack the current working" +#~ msgstr "la pila, haciendo que el nuevo tope de la pila sea el directorio de" + +#~ msgid "directory. With no arguments, exchanges the top two directories." +#~ msgstr "" +#~ "trabajo actual. Sin argumentos, intercambia los dos directorios del tope." + +#~ msgid "+N Rotates the stack so that the Nth directory (counting" +#~ msgstr "+N Rota la pila para que el N-ésimo directorio (contando" + +#~ msgid " from the left of the list shown by `dirs', starting with" +#~ msgstr "" +#~ " de la izquierda de la lista mostrada por `dirs', comenzando desde" + +#~ msgid " zero) is at the top." +#~ msgstr " cero) esté en el tope." + +#~ msgid "-N Rotates the stack so that the Nth directory (counting" +#~ msgstr "-N Rota la pila para que el N-ésimo directory (contando" + +#~ msgid " from the right of the list shown by `dirs', starting with" +#~ msgstr "" +#~ " de la derecha de la lista mostrada por `dirs', comenzando desde" + +#~ msgid "-n suppress the normal change of directory when adding directories" +#~ msgstr "" +#~ "-n suprime el cambio normal de directorio cuando se agregan directorios" + +#~ msgid " to the stack, so only the stack is manipulated." +#~ msgstr " a la pila, así sólo se manipula la pila." + +#~ msgid "dir adds DIR to the directory stack at the top, making it the" +#~ msgstr "dir agrega DIR a la pila de directorios en el tope, haciéndolo el" + +#~ msgid " new current working directory." +#~ msgstr " nuevo directorio de trabajo actual." + +#~ msgid "You can see the directory stack with the `dirs' command." +#~ msgstr "Puede ver la pila de directorios con la orden `dirs'." + +#~ msgid "Removes entries from the directory stack. With no arguments," +#~ msgstr "Borra entradas de la pila de directorios. Sin argumentos," + +#~ msgid "removes the top directory from the stack, and cd's to the new" +#~ msgstr "borra el directorio del tope de la pila, y cambia al nuevo" + +#~ msgid "top directory." +#~ msgstr "directorio tope." + +#~ msgid "+N removes the Nth entry counting from the left of the list" +#~ msgstr "" +#~ "+N borra la N-ésima entrada contando desde la izquierda de la lista" + +#~ msgid " shown by `dirs', starting with zero. For example: `popd +0'" +#~ msgstr "" +#~ " mostrada por `dirs', comenzando desde cero. Por ejemplo: `popd +0'" + +#~ msgid " removes the first directory, `popd +1' the second." +#~ msgstr " borra el primer directorio, `popd +1' el segundo." + +#~ msgid "-N removes the Nth entry counting from the right of the list" +#~ msgstr "-N borra la N-ésima entrada contando desde la derecha de la lista" + +#~ msgid " shown by `dirs', starting with zero. For example: `popd -0'" +#~ msgstr "" +#~ " mostrada por `dirs', comenzando desde cero. Por ejemplo: `popd -0'" + +#~ msgid " removes the last directory, `popd -1' the next to last." +#~ msgstr " borra el último directorio, `popd -1' el penúltimo." + +#~ msgid "" +#~ "-n suppress the normal change of directory when removing directories" +#~ msgstr "" +#~ "-n suprime el cambio normal de directorio cuando se borran directorios" + +#~ msgid " from the stack, so only the stack is manipulated." +#~ msgstr " de la pila, así sólo se manipula la pila." + +#~ msgid "allocated" +#~ msgstr "asignado" + +#~ msgid "freed" +#~ msgstr "liberado" + +#~ msgid "requesting resize" +#~ msgstr "solicitando cambio de tamaño" + +#~ msgid "just resized" +#~ msgstr "terminó cambio de tamaño" + +#~ msgid "bug: unknown operation" +#~ msgstr "bicho: operación desconocida" + +#~ msgid "malloc: watch alert: %p %s " +#~ msgstr "malloc: alerta de observación: %p %s " + +#~ msgid "" +#~ "Exit from within a FOR, WHILE or UNTIL loop. If N is specified,\n" +#~ " break N levels." +#~ msgstr "" +#~ "Sale de un ciclo FOR, WHILE o UNTIL. Si se especifica N,\n" +#~ " sale N niveles." + +#~ msgid "" +#~ "Run a shell builtin. This is useful when you wish to rename a\n" +#~ " shell builtin to be a function, but need the functionality of the\n" +#~ " builtin within the function itself." +#~ msgstr "" +#~ "Ejecuta una orden interna del shell. Esto es útil cuando desea " +#~ "renombrar\n" +#~ " una orden interna del shell para que sea una función, pero necesita\n" +#~ " la funcionalidad de la orden interna dentro de la misma función." + +#~ msgid "" +#~ "Print the current working directory. With the -P option, pwd prints\n" +#~ " the physical directory, without any symbolic links; the -L option\n" +#~ " makes pwd follow symbolic links." +#~ msgstr "" +#~ "Muestra el directorio de trabajo actual. Con la opción -P, pwd muestra\n" +#~ " el directorio físico, sin enlaces simbólicos; la opción -L hace que\n" +#~ " pwd siga los enlaces simbólicos." + +#~ msgid "Return a successful result." +#~ msgstr "Devuelve un resultado exitoso." + +# es usado -> se usa. sv +# es impresa -> se muestra una cadena em+ +# "Si se da la opción -V o -v,..." sv +# De acuerdo. cfuga +#~ msgid "" +#~ "Runs COMMAND with ARGS ignoring shell functions. If you have a shell\n" +#~ " function called `ls', and you wish to call the command `ls', you can\n" +#~ " say \"command ls\". If the -p option is given, a default value is " +#~ "used\n" +#~ " for PATH that is guaranteed to find all of the standard utilities. " +#~ "If\n" +#~ " the -V or -v option is given, a string is printed describing " +#~ "COMMAND.\n" +#~ " The -V option produces a more verbose description." +#~ msgstr "" +#~ "Ejecuta COMMAND con ARGS ignorando las funciones del shell. Si tiene " +#~ "una\n" +#~ " función de shell llamada `ls', y desea llamar a la orden `ls', puede\n" +#~ " decir \"command ls\". Si se da la opción -p, se usa un valor por\n" +#~ " defecto para PATH que garantiza encontrar todas las herramientas\n" +#~ " estándar. Si se da la opción -V o -v, se muestra una cadena que\n" +#~ " describe COMMAND. La opción -V produce una descripción más detallada." + +# apaga -> desactiva em+ +# Corregido en toda la traducción. cfuga +#~ msgid "" +#~ "Declare variables and/or give them attributes. If no NAMEs are\n" +#~ " given, then display the values of variables instead. The -p option\n" +#~ " will display the attributes and values of each NAME.\n" +#~ " \n" +#~ " The flags are:\n" +#~ " \n" +#~ " -a\tto make NAMEs arrays (if supported)\n" +#~ " -f\tto select from among function names only\n" +#~ " -F\tto display function names (and line number and source file name " +#~ "if\n" +#~ " \tdebugging) without definitions\n" +#~ " -i\tto make NAMEs have the `integer' attribute\n" +#~ " -r\tto make NAMEs readonly\n" +#~ " -t\tto make NAMEs have the `trace' attribute\n" +#~ " -x\tto make NAMEs export\n" +#~ " \n" +#~ " Variables with the integer attribute have arithmetic evaluation (see\n" +#~ " `let') done when the variable is assigned to.\n" +#~ " \n" +#~ " When displaying values of variables, -f displays a function's name\n" +#~ " and definition. The -F option restricts the display to function\n" +#~ " name only.\n" +#~ " \n" +#~ " Using `+' instead of `-' turns off the given attribute instead. " +#~ "When\n" +#~ " used in a function, makes NAMEs local, as with the `local' command." +#~ msgstr "" +#~ "Declara variables y/o les asigna atributos. Si no se propociona\n" +#~ " ningún NAME, entonces muestra los valores de las variables.\n" +#~ " La opción -p mostrará los atributos y valores de cada NAME.\n" +#~ " \n" +#~ " Las opciones son:\n" +#~ " \n" +#~ " -a\thace a los NAMEs matrices (si tiene soporte)\n" +#~ " -f\tselecciona solamente nombres de funciones\n" +#~ " -F\tmuestra nombres de funciones (y número de línea y nombre de\n" +#~ " \tfichero fuente si se está depurando) sin definiciones\n" +#~ " -i\tasigna a los NAMEs el atributo `integer'\n" +#~ " -r\thace a los NAMEs de sólo lectura\n" +#~ " -t\tasigna a los NAMEs el atributo `trace'\n" +#~ " -x\thace a los NAMEs exportables\n" +#~ " \n" +#~ " Las variables con el atributo integer se les evalúa aritméticamente\n" +#~ " (vea `let') cuando se asigna la variable.\n" +#~ " \n" +#~ " Cuando se muestran los valores de las variables, -f muestra\n" +#~ " el nombre de una función y su definición. La opción -F restringe\n" +#~ " a mostrar solamente el nombre de la función.\n" +#~ " \n" +#~ " Al usar `+' en lugar de `-' desactiva el atributo dado. Cuando se\n" +#~ " usa en una función, hace a los NAMEs locales, como sucede con la\n" +#~ " orden `local'." + +#~ msgid "Obsolete. See `declare'." +#~ msgstr "Obsoleto. Ver `declare'." + +# y le da -> y le asigna em+ +# sólo se puede usar. sv +# tenga un alcance visible -> sea visible solo para la función y sus los hijos em+ +# De acuerdo. cfuga +#~ msgid "" +#~ "Create a local variable called NAME, and give it VALUE. LOCAL\n" +#~ " can only be used within a function; it makes the variable NAME\n" +#~ " have a visible scope restricted to that function and its children." +#~ msgstr "" +#~ "Crea una variable local llamada NAME, y le asigna un VALUE. LOCAL\n" +#~ " sólo se puede usar dentro de una función; hace que la variable NAME\n" +#~ " solamente sea visible a esa función y sus hijos." + +#~ msgid "" +#~ "Output the ARGs. If -n is specified, the trailing newline is suppressed." +#~ msgstr "" +#~ "Muestra los ARGs. Si se especifica -n, se elimina el carácter\n" +#~ " de fin de línea." + +# se puede usar. sv +# Se muestra una lista de órdenes internas. sv +# Hay muchos más mensajes que están en "pasiva" que quedarían mejor en +# forma "reflexiva". No comento más y te dejo que los mires despacio. +# Gracias por la observación. cfuga +#~ msgid "" +#~ "Enable and disable builtin shell commands. This allows\n" +#~ " you to use a disk command which has the same name as a shell\n" +#~ " builtin without specifying a full pathname. If -n is used, the\n" +#~ " NAMEs become disabled; otherwise NAMEs are enabled. For example,\n" +#~ " to use the `test' found in $PATH instead of the shell builtin\n" +#~ " version, type `enable -n test'. On systems supporting dynamic\n" +#~ " loading, the -f option may be used to load new builtins from the\n" +#~ " shared object FILENAME. The -d option will delete a builtin\n" +#~ " previously loaded with -f. If no non-option names are given, or\n" +#~ " the -p option is supplied, a list of builtins is printed. The\n" +#~ " -a option means to print every builtin with an indication of whether\n" +#~ " or not it is enabled. The -s option restricts the output to the " +#~ "POSIX.2\n" +#~ " `special' builtins. The -n option displays a list of all disabled " +#~ "builtins." +#~ msgstr "" +#~ "Activa y desactiva las órdenes internas del shell. Esto le permite\n" +#~ " usar una orden del sistema que tenga el mismo nombre que una orden\n" +#~ " interna del shell sin especificar una ruta completa. Si se usa -n, " +#~ "los\n" +#~ " NAMEs se desactivan; de otra forma los NAMEs se activan. Por " +#~ "ejemplo,\n" +#~ " para usar `test' que se encuentra en $PATH en lugar de la versión " +#~ "interna\n" +#~ " del shell, teclee `enable -n test'. En sistemas que soportan\n" +#~ " carga dinámica, se puede usar la opción -f para cargar nuevas " +#~ "órdenes\n" +#~ " internas desde el objeto compartido FILENAME. La opción -d borrará " +#~ "una\n" +#~ " orden interna cargada previamente con -f. Si no se propocionan " +#~ "nombres\n" +#~ " que no sean opciones, o se especifica la opción -p, se muestra una " +#~ "lista\n" +#~ " de órdenes internas. La opción -a es para mostrar cada orden " +#~ "interna\n" +#~ " con una indicación si está o no activada. La opción -s restringe la\n" +#~ " salida a las órdenes internas `especiales' de POSIX.2. La opción -n\n" +#~ " muestra una lista de todas las órdenes internas desactivadas." + +#~ msgid "" +#~ "Read ARGs as input to the shell and execute the resulting command(s)." +#~ msgstr "" +#~ "Lee ARGs como entrada del shell y ejecuta el(los) comando(s) resultantes." + +#~ msgid "" +#~ "Exec FILE, replacing this shell with the specified program.\n" +#~ " If FILE is not specified, the redirections take effect in this\n" +#~ " shell. If the first argument is `-l', then place a dash in the\n" +#~ " zeroth arg passed to FILE, as login does. If the `-c' option\n" +#~ " is supplied, FILE is executed with a null environment. The `-a'\n" +#~ " option means to make set argv[0] of the executed process to NAME.\n" +#~ " If the file cannot be executed and the shell is not interactive,\n" +#~ " then the shell exits, unless the shell option `execfail' is set." +#~ msgstr "" +#~ "Ejecuta FILE, reemplazando este shell con el programa especificado.\n" +#~ " Si no se especifica FILE, las redirecciones toman efecto en este\n" +#~ " shell. Si el primer argumento es `-l' entonces coloca un guión\n" +#~ " en el argumento cero que pasa a FILE, como lo hace login. Si se\n" +#~ " proporciona la opción `-c', se ejecuta FILE con un ambiente nulo.\n" +#~ " La opción `-a' establece el argv[0] del proceso ejecutado a NOMBRE.\n" +#~ " Si no se puede ejecutar el fichero, y el shell no es intercativo,\n" +#~ " entonces el shell termina, a menos que esté activa la opción\n" +#~ " `execfail'." + +#~ msgid "Logout of a login shell." +#~ msgstr "Se desconecta de un shell de entrada." + +#~ msgid "" +#~ "For each NAME, the full pathname of the command is determined and\n" +#~ " remembered. If the -p option is supplied, PATHNAME is used as the\n" +#~ " full pathname of NAME, and no path search is performed. The -r\n" +#~ " option causes the shell to forget all remembered locations. The -d\n" +#~ " option causes the shell to forget the remembered location of each " +#~ "NAME.\n" +#~ " If the -t option is supplied the full pathname to which each NAME\n" +#~ " corresponds is printed. If multiple NAME arguments are supplied " +#~ "with\n" +#~ " -t, the NAME is printed before the hashed full pathname. The -l " +#~ "option\n" +#~ " causes output to be displayed in a format that may be reused as " +#~ "input.\n" +#~ " If no arguments are given, information about remembered commands is " +#~ "displayed." +#~ msgstr "" +#~ "Por cada NOMBRE, se determina la ruta completa de la orden y se graba.\n" +#~ " Si se especifica la opción -p, se usa PATHNAME como la ruta completa\n" +#~ " de NAME, y no se realiza la búsqueda de ruta. La opción -r hace que\n" +#~ " el shell olvide todas las ubicaciones grabadas. La opción -d hace " +#~ "que\n" +#~ " el shell olvide las ubicaciones grabadas de cada NAME. Si se\n" +#~ " proporciona la opción -t se muestra la ruta completa para cada NAME\n" +#~ " correspondiente. Si se proporcionan múltiples argumentos NAME con\n" +#~ " -t, NAME se muestra antes de la ruta completa. La opción -l hace\n" +#~ " que la salida se muestre en un formato que se puede reusar como\n" +#~ " entrada. Si no se proporcionan argumentos, se muestra la " +#~ "información\n" +#~ " de las órdenes grabadas." + +#~ msgid "" +#~ "Display helpful information about builtin commands. If PATTERN is\n" +#~ " specified, gives detailed help on all commands matching PATTERN,\n" +#~ " otherwise a list of the builtins is printed. The -s option\n" +#~ " restricts the output for each builtin command matching PATTERN to\n" +#~ " a short usage synopsis." +#~ msgstr "" +#~ "Muestra información útil sobre las órdenes internas del shell. Si se\n" +#~ " especifica un PATRÓN, proporciona ayuda detallada sobre todas las\n" +#~ " órdenes que coinciden con el PATRÓN, de otra forma se muestra una\n" +#~ " lista de las órdenes internas. La opción -s restringe la salida\n" +#~ " de cada orden interna que concida con el PATRÓN a una breve\n" +#~ " sinopsis de uso." + +#~ msgid "" +#~ "By default, removes each JOBSPEC argument from the table of active jobs.\n" +#~ " If the -h option is given, the job is not removed from the table, but " +#~ "is\n" +#~ " marked so that SIGHUP is not sent to the job if the shell receives a\n" +#~ " SIGHUP. The -a option, when JOBSPEC is not supplied, means to remove " +#~ "all\n" +#~ " jobs from the job table; the -r option means to remove only running " +#~ "jobs." +#~ msgstr "" +#~ "Por defecto, elimina cada argumento JOBSPEC de la tabla de trabajos " +#~ "activos.\n" +#~ " Si se especifica la opción -h, el trabajo no se elimina de la tabla,\n" +#~ " pero se marca de forma que no se envía SIGHUP al trabajo si el shell\n" +#~ " recibe un SIGHUP. La opción -a, cuando no se proporciona JOBSPEC, " +#~ "borra\n" +#~ " todos los trabajos de la tabla de trabajos; la opción -r borra sólo\n" +#~ " los trabajos activos." + +#~ msgid "" +#~ "Causes a function to exit with the return value specified by N. If N\n" +#~ " is omitted, the return status is that of the last command." +#~ msgstr "" +#~ "Causa la salida de una función con el valor de devolución especificado " +#~ "por N.\n" +#~ " Si se omite N, el estado de devolución será el de la última orden." + +#~ msgid "" +#~ "For each NAME, remove the corresponding variable or function. Given\n" +#~ " the `-v', unset will only act on variables. Given the `-f' flag,\n" +#~ " unset will only act on functions. With neither flag, unset first\n" +#~ " tries to unset a variable, and if that fails, then tries to unset a\n" +#~ " function. Some variables cannot be unset; also see readonly." +#~ msgstr "" +#~ "Para cada NAME, se borra la variable o función correspondiente. Al usar\n" +#~ " `-v', unset sólo actuará sobre variables. Al usar la opción `-f',\n" +#~ " unset sólo actuará sobre funciones. Sin ninguna opción, unset " +#~ "primero\n" +#~ " intenta borrar una variable, y si esto falla, entonces intenta " +#~ "borrar\n" +#~ " una función. Algunas variables no se pueden borrar; vea también " +#~ "readonly." + +#~ msgid "" +#~ "NAMEs are marked for automatic export to the environment of\n" +#~ " subsequently executed commands. If the -f option is given,\n" +#~ " the NAMEs refer to functions. If no NAMEs are given, or if `-p'\n" +#~ " is given, a list of all names that are exported in this shell is\n" +#~ " printed. An argument of `-n' says to remove the export property\n" +#~ " from subsequent NAMEs. An argument of `--' disables further option\n" +#~ " processing." +#~ msgstr "" +#~ "Se marcan NAMEs para exportación automática al ambiente de las\n" +#~ " órdenes ejecutadas subsecuentemente. Si se establece la opción -f,\n" +#~ " NAMEs se refieren a funciones. Si no se proporciona ningún NAME,\n" +#~ " o si se proporciona `-p', se muestra una lista de todos los nombres\n" +#~ " que se exportan en este shell. Un argumento `-n' indica eliminar\n" +#~ " la propiedad de exportación para los NAMEs subsecuentes. Un " +#~ "argumento\n" +#~ " `--' desactiva el procesamiento posterior de opciones." + +#~ msgid "" +#~ "The given NAMEs are marked readonly and the values of these NAMEs may\n" +#~ " not be changed by subsequent assignment. If the -f option is given,\n" +#~ " then functions corresponding to the NAMEs are so marked. If no\n" +#~ " arguments are given, or if `-p' is given, a list of all readonly " +#~ "names\n" +#~ " is printed. The `-a' option means to treat each NAME as\n" +#~ " an array variable. An argument of `--' disables further option\n" +#~ " processing." +#~ msgstr "" +#~ "Los NAMEs dados se marcan como sólo lectura y los valores de esos NAMEs\n" +#~ " no se pueden cambiar por asignaciones posteriores. Si se propociona\n" +#~ " la opción -f, entonces también se marcan las funciones que " +#~ "correspondan\n" +#~ " a los NAMEs. Si no se proporcionan argumentos, o si se especifica\n" +#~ " `-p', se muestra una lista de todos los nombres de sólo lectura.\n" +#~ " La opción `-a' trata cada NAME como una variable de matriz.\n" +#~ " Un argumento `--' desactiva opciones posteriores." + +#~ msgid "" +#~ "The positional parameters from $N+1 ... are renamed to $1 ... If N is\n" +#~ " not given, it is assumed to be 1." +#~ msgstr "" +#~ "Los parámetros posicionales de $N+1 ... se renombran a $1 ... Si no se\n" +#~ " proporciona N, se asume que es 1." + +#~ msgid "" +#~ "Suspend the execution of this shell until it receives a SIGCONT\n" +#~ " signal. The `-f' if specified says not to complain about this\n" +#~ " being a login shell if it is; just suspend anyway." +#~ msgstr "" +#~ "Suspende la ejecución de este shell hasta que recibe una señal\n" +#~ " SIGCONT. Si se especifica `-f' indica que no se queje si es\n" +#~ " un shell de login; y se suspende de cualquier forma." + +#~ msgid "" +#~ "Print the accumulated user and system times for processes run from\n" +#~ " the shell." +#~ msgstr "" +#~ "Muestra los tiempos de usuario y de sistema acumulados para los procesos\n" +#~ " ejecutados desde el shell." + +#~ msgid "" +#~ "For each NAME, indicate how it would be interpreted if used as a\n" +#~ " command name.\n" +#~ " \n" +#~ " If the -t option is used, `type' outputs a single word which is one " +#~ "of\n" +#~ " `alias', `keyword', `function', `builtin', `file' or `', if NAME is " +#~ "an\n" +#~ " alias, shell reserved word, shell function, shell builtin, disk " +#~ "file,\n" +#~ " or unfound, respectively.\n" +#~ " \n" +#~ " If the -p flag is used, `type' either returns the name of the disk\n" +#~ " file that would be executed, or nothing if `type -t NAME' would not\n" +#~ " return `file'.\n" +#~ " \n" +#~ " If the -a flag is used, `type' displays all of the places that " +#~ "contain\n" +#~ " an executable named `file'. This includes aliases, builtins, and\n" +#~ " functions, if and only if the -p flag is not also used.\n" +#~ " \n" +#~ " The -f flag suppresses shell function lookup.\n" +#~ " \n" +#~ " The -P flag forces a PATH search for each NAME, even if it is an " +#~ "alias,\n" +#~ " builtin, or function, and returns the name of the disk file that " +#~ "would\n" +#~ " be executed." +#~ msgstr "" +#~ "Para cada NAME, se indica cómo se interpretaría se se usara como\n" +#~ " el nombre de una orden.\n" +#~ " \n" +#~ " Si se usa la opción -t, `type' muestra una sola palabra que es una\n" +#~ " de `alias', `keyword', `function', `builtin', `file' ó `', si NAME\n" +#~ " es un alias, palabra reservada del shell, función del shell, orden\n" +#~ " interna del shell, fichero del disco, o no encontrado, " +#~ "respectivamente.\n" +#~ " \n" +#~ " Si se usa la opción -p, `type' devuelve el nombre del fichero del\n" +#~ " sistema que sería ejecutado, o nada, si `type -t NAME' no devuelve\n" +#~ " `file'.\n" +#~ " \n" +#~ " Si se usa la opción -a, `type' muestra todos los lugares que " +#~ "contienen\n" +#~ " un ejecutable llamado `file'. Esto incluye a aliases, órdenes\n" +#~ " internas, y funciones, si y solo si no se usa la opción -p.\n" +#~ " \n" +#~ " La opción -f suprime la búsqueda de funciones de shell.\n" +#~ " \n" +#~ " La opción -P fuerza una búsqueda en PATH por cada NAME, aún si es un\n" +#~ " alias, orden interna, o función, y devuelve el nombre del fichero " +#~ "del\n" +#~ " disco que se puede ejecutar." + +#~ msgid "" +#~ "The user file-creation mask is set to MODE. If MODE is omitted, or if\n" +#~ " `-S' is supplied, the current value of the mask is printed. The `-" +#~ "S'\n" +#~ " option makes the output symbolic; otherwise an octal number is " +#~ "output.\n" +#~ " If `-p' is supplied, and MODE is omitted, the output is in a form\n" +#~ " that may be used as input. If MODE begins with a digit, it is\n" +#~ " interpreted as an octal number, otherwise it is a symbolic mode " +#~ "string\n" +#~ " like that accepted by chmod(1)." +#~ msgstr "" +#~ "La máscara de creación de ficheros se establece a MODE. Si se omite " +#~ "MODE,\n" +#~ " o si se proporciona `-S', se muestra el valor actual de la máscara. " +#~ "La\n" +#~ " opción `-S' hace la salida simbólica; de otra forma la salida es un\n" +#~ " número octal. Si se proporciona `-p', y se omite MODE, la salida es\n" +#~ " en una forma que se puede usar como entrada. Si MODE empieza con un\n" +#~ " dígito, se interpreta como un número octal, de otra forma es una " +#~ "cadena\n" +#~ " de modo simbólico como la que acepta chmod(1)." + +#~ msgid "" +#~ "Wait for the specified process and report its termination status. If\n" +#~ " N is not given, all currently active child processes are waited for,\n" +#~ " and the return code is zero. N is a process ID; if it is not given,\n" +#~ " all child processes of the shell are waited for." +#~ msgstr "" +#~ "Espera al proceso especificado y reporta su estado final. Si no se\n" +#~ " proporciona N, espera a todos los procesos hijo activos actualmente,\n" +#~ " y el código de devolución es cero. N es un ID de proceso; si no se\n" +#~ " proporciona, se espera a todos los procesos hijo del shell." + +#~ msgid "" +#~ "Create a simple command invoked by NAME which runs COMMANDS.\n" +#~ " Arguments on the command line along with NAME are passed to the\n" +#~ " function as $0 .. $n." +#~ msgstr "" +#~ "Crea una orden simple invocada por NAME que ejecuta COMMMANDS.\n" +#~ " Se pasan a la función los argumentos en la línea de órdenes\n" +#~ " junto con NAME como $0 .. $n." + +#~ msgid "" +#~ "Toggle the values of variables controlling optional behavior.\n" +#~ " The -s flag means to enable (set) each OPTNAME; the -u flag\n" +#~ " unsets each OPTNAME. The -q flag suppresses output; the exit\n" +#~ " status indicates whether each OPTNAME is set or unset. The -o\n" +#~ " option restricts the OPTNAMEs to those defined for use with\n" +#~ " `set -o'. With no options, or with the -p option, a list of all\n" +#~ " settable options is displayed, with an indication of whether or\n" +#~ " not each is set." +#~ msgstr "" +#~ "Cambia los valores de las variables que controlan conductas opcionales.\n" +#~ " La opción -s activa (define) cada OPTNAME; la opción -u desactiva\n" +#~ " cada OPTNAME. La opción -q suprime la salida; el estado de salida\n" +#~ " indica si cada OPTNAME se definió o no. La opción -o restringe\n" +#~ " que OPTNAMEs sean aquéllos definidos para usarse con `set -o'.\n" +#~ " Sin opciones, o con la opción -p, se muestra una lista de todas\n" +#~ " las opciones definibles, con una indicación si están o no activas." + +#~ msgid "" +#~ "For each NAME, specify how arguments are to be completed.\n" +#~ " If the -p option is supplied, or if no options are supplied, " +#~ "existing\n" +#~ " completion specifications are printed in a way that allows them to " +#~ "be\n" +#~ " reused as input. The -r option removes a completion specification " +#~ "for\n" +#~ " each NAME, or, if no NAMEs are supplied, all completion " +#~ "specifications." +#~ msgstr "" +#~ "Por cada NAME, especifica cómo se deben completar los argumentos.\n" +#~ " Si se proporciona la opción -p, o si no se proporcionan opciones, se\n" +#~ " muestran las especificaciones existentes de completado en una forma\n" +#~ " que permite que se reusen como entrada. La opción -r borra una\n" +#~ " especificación de completado para cada NAME, o, si no se proporciona\n" +#~ " ningún NAMEs, todas las especificaciones de completado." + +#~ msgid "Missing `}'" +#~ msgstr "Faltan `}'" + +#~ msgid "brace_expand> " +#~ msgstr "expansión_llave> " + +# ¿ a qué se refiere ? em+ +# También podría ser la orden de tipo desconocido. sv +# Tiene razón Santiago. Las órdenes se guardan en matrices de caracteres +# en bash. Si bash intenta borrar uno de estos comandos y el tipo del dato +# NO es matriz de caracter, emitiría este mensaje. cfuga +#~ msgid "Attempt to free unknown command type `%d'.\n" +#~ msgstr "Intentando liberar la orden de tipo desconocido `%d'.\n" + +#~ msgid "Report this to %s\n" +#~ msgstr "Comunique esto a %s\n" + +#~ msgid "Stopping myself..." +#~ msgstr "Deteniéndome..." + +#~ msgid "Tell %s to fix this someday.\n" +#~ msgstr "Decir a %s que arregle esto algún día.\n" + +#~ msgid "execute_command: bad command type `%d'" +#~ msgstr "execute_command: tipo de orden erróneo `%d'" + +#~ msgid "real\t" +#~ msgstr "real\t" + +#~ msgid "user\t" +#~ msgstr "usuario\t" + +#~ msgid "sys\t" +#~ msgstr "sistema\t" + +#~ msgid "" +#~ "real\t0m0.00s\n" +#~ "user\t0m0.00s\n" +#~ "sys\t0m0.00s\n" +#~ msgstr "" +#~ "real\t0m0.00s\n" +#~ "usuario\t0m0.00s\n" +#~ "sistema\t0m0.00s\n" + +#~ msgid "cannot duplicate fd %d to fd 1: %s" +#~ msgstr "no se puede duplicar el df %d al df 1: %s" + +#~ msgid "%s: output redirection restricted" +#~ msgstr "%s: la redirección de salida está restringida" + +#~ msgid "Out of memory!" +#~ msgstr "¡Memoria agotada!" + +#~ msgid "You have already added item `%s'\n" +#~ msgstr "Ya se había añadido el elemento `%s'\n" + +# Han sido introducidos o quizá , Vd, introdujo em+ +#~ msgid "You have entered %d (%d) items. The distribution is:\n" +#~ msgstr "Introdujo %d (%d) elementos. La distribución es:\n" + +#~ msgid "%s: bg background job?" +#~ msgstr "%s: ¿bg trabajo en background?" + +#~ msgid "" +#~ "Redirection instruction from yyparse () '%d' is\n" +#~ "out of range in make_redirection ()." +#~ msgstr "" +#~ "La instrucción de redirección de yyparse () '%d' está fuera de rango en \n" +#~ "make_redirection ()." + +#~ msgid "clean_simple_command () got a command with type %d." +#~ msgstr "clean_simple_command () tiene una orden del tipo %d." + +#~ msgid "got errno %d while waiting for %d" +#~ msgstr "se obtuvo errno %d mientras esperaba a %d" + +# algo por el estilo em+ +#~ msgid "syntax error near unexpected token `%c'" +#~ msgstr "error sintáctico cerca del elemento inesperado `%c'" + +# Por consistencia con mensajes anteriores, sería erróneo (el tipo). sv +# De acuerdo. Corregido. cfuga +#~ msgid "print_command: bad command type `%d'" +#~ msgstr "print_command: tipo de dato de orden `%d' erróneo" + +#~ msgid "cprintf: bad `%%' argument (%c)" +#~ msgstr "cprintf: argumento `%%' erróneo (%c)" + +#~ msgid "option `%s' requires an argument" +#~ msgstr "la opción `%s' requiere un argumento" + +#~ msgid "%s: unrecognized option" +#~ msgstr "%s: la opción no es reconocida" + +#~ msgid "`-c' requires an argument" +#~ msgstr "`-c' requiere un argumento" + +#~ msgid "%s: cannot execute directories" +#~ msgstr "%s: no se pueden ejecutar directorios" + +#~ msgid "Bad code in sig.c: sigprocmask" +#~ msgstr "Código erróneo en sig.c: sigprocmask" + +#~ msgid "bad substitution: no ending `}' in %s" +#~ msgstr "sustitución errónea: no hay `}' final en %s" + +#~ msgid "%s: bad array subscript" +#~ msgstr "%s: subíndice de matriz erróneo" + +#~ msgid "can't make pipes for process substitution: %s" +#~ msgstr "" +#~ "no se pueden crear las tuberías (pipes) para la sustitución del proceso: " +#~ "%s" + +#~ msgid "reading" +#~ msgstr "leyendo" + +#~ msgid "writing" +#~ msgstr "escribiendo" + +# del proceso em+ +#~ msgid "process substitution" +#~ msgstr "sustitución de proceso" + +#~ msgid "command substitution" +#~ msgstr "sustitución de la orden" + +#~ msgid "Can't reopen pipe to command substitution (fd %d): %s" +#~ msgstr "" +#~ "No se puede reabrir la tubería para la sustitución de la orden (df %d): %s" + +#~ msgid "$%c: unbound variable" +#~ msgstr "$%c: variable desligada" + +#~ msgid "%s: bad arithmetic substitution" +#~ msgstr "%s: sustitución aritmética errónea" + +#~ msgid "-%s: binary operator expected" +#~ msgstr "-%s: se esperaba un operador binario" + +#~ msgid "%s[%s: bad subscript" +#~ msgstr "%s[%s: subíndice erróneo" + +#~ msgid "[%s: bad subscript" +#~ msgstr "[%s: subíndice erróneo" + +# Yo pondría "hay dígitos en dos elementos diferentes de argv". sv +# De acuerdo. cfuga +#~ msgid "digits occur in two different argv-elements.\n" +#~ msgstr "hay dígitos en dos elementos diferentes de argv.\n" + +#~ msgid "option %c\n" +#~ msgstr "opción %c\n" + +#~ msgid "option a\n" +#~ msgstr "opción a\n" + +#~ msgid "option b\n" +#~ msgstr "opción b\n" + +#~ msgid "option c with value `%s'\n" +#~ msgstr "opción c con el valor `%s'\n" + +#~ msgid "?? sh_getopt returned character code 0%o ??\n" +#~ msgstr "?? sh_getopt devolvió el código de carácter 0%o ??\n" + +#~ msgid "non-option ARGV-elements: " +#~ msgstr "elementos de ARGV que no son opciones: " + +#~ msgid "%s: Unknown flag %s.\n" +#~ msgstr "%s: Indicador desconocido %s.\n" + +#~ msgid "Unknown directive `%s'" +#~ msgstr "Directiva desconocida `%s'" + +#~ msgid "%s requires an argument" +#~ msgstr "%s requiere un argumento" + +#~ msgid "%s must be inside of a $BUILTIN block" +#~ msgstr "%s debe estar dentro de un bloque $BUILTIN" + +#~ msgid "%s found before $END" +#~ msgstr "%s encontrado antes de $END" + +#~ msgid "%s already has a function (%s)" +#~ msgstr "%s ya tiene una función (%s)" + +#~ msgid "%s already had a docname (%s)" +#~ msgstr "%s ya tiene un nombre de documento (%s)" + +#~ msgid "%s already has short documentation (%s)" +#~ msgstr "% ya tiene documentación corta (%s)" + +# Si traducimos con la gramática española, probablemente sería: +# ...una definición %s". sv +# De acuerdo. cfuga +#~ msgid "%s already has a %s definition" +#~ msgstr "%s ya tiene una definición %s" + +#~ msgid "mkbuiltins: Out of virtual memory!\n" +#~ msgstr "mkbuiltins: ¡Memoria agotada!\n" + +#~ msgid "read [-r] [-p prompt] [-a array] [-e] [name ...]" +#~ msgstr "read [-r] [-p prompt] [-a matriz] [-e] [nombre ...]" + +#~ msgid ". filename" +#~ msgstr ". fichero" + +#~ msgid "%[DIGITS | WORD] [&]" +#~ msgstr "%[DÍGITOS | PALABRAS] [&]" + +#~ msgid "variables - Some variable names and meanings" +#~ msgstr "variables - Algunos nombres de variables y sus significados" + +#~ msgid "`alias' with no arguments or with the -p option prints the list" +#~ msgstr "`alias' sin argumentos o con la opción -p muestra la lista" + +#~ msgid "of aliases in the form alias NAME=VALUE on standard output." +#~ msgstr "de aliases en la forma alias NOMBRE=VALOR por la entrada estándar." + +# Más en español sería: se define un alias por cada NOMBRE cuyo VALOR se da. sv +# De acuerdo. cfuga +#~ msgid "Otherwise, an alias is defined for each NAME whose VALUE is given." +#~ msgstr "" +#~ "De otra manera, se define un alias por cada NOMBRE cuyo VALOR se da." + +#~ msgid "A trailing space in VALUE causes the next word to be checked for" +#~ msgstr "" +#~ "Un espacio final en VALOR causa que la siguiente palabra sea revisada para" + +# Lo mismo de antes: el alias es expandido -> el alias se expande. sv +# De acuerdo. cfuga +#~ msgid "alias substitution when the alias is expanded. Alias returns" +#~ msgstr "la sustitución del alias cuando el alias se expande. Alias devuelve" + +# no alias -> ningún alias. sv +# De acuerdo. cfuga +#~ msgid "true unless a NAME is given for which no alias has been defined." +#~ msgstr "" +#~ "verdadero a menos que para un NOMBRE dado no se haya definido ningún " +#~ "alias." + +#~ msgid "then remove all alias definitions." +#~ msgstr "entonces borra todas las definiciones de alias." + +#~ msgid "Bind a key sequence to a Readline function, or to a macro. The" +#~ msgstr "" +#~ "Asigna una secuencia de teclas a una función Readline, o a una macro. La" + +#~ msgid "syntax is equivalent to that found in ~/.inputrc, but must be" +#~ msgstr "" +#~ "sintaxis es equivalente a la encontrada en ~/.inputrc, pero debe ser" + +#~ msgid "" +#~ "passed as a single argument: bind '\"\\C-x\\C-r\": re-read-init-file'." +#~ msgstr "" +#~ "pasada como un solo argumento: bind '\"\\C-x\\C-r\": re-read-init-file'." + +#~ msgid "Arguments we accept:" +#~ msgstr "Argumentos que se aceptan:" + +#~ msgid "" +#~ " -m keymap Use `keymap' as the keymap for the duration of this" +#~ msgstr "" +#~ " -m mapa_teclas Usa `mapa_teclas' como el mapa de teclas durante esta" + +#~ msgid " command. Acceptable keymap names are emacs," +#~ msgstr "" +#~ " orden. Los nombres de mapas de teclas aceptables son" + +#~ msgid "" +#~ " emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move," +#~ msgstr "" +#~ " emacs, emacs-standard, emacs-meta, emacs-ctlx, vi," + +#~ msgid " vi-command, and vi-insert." +#~ msgstr " vi-move, vi-command y vi-insert." + +#~ msgid " -l List names of functions." +#~ msgstr " -l Muestra los nombres de las funciones." + +#~ msgid " -P List function names and bindings." +#~ msgstr "" +#~ " -P Muestra los nombres de funciones y asignaciones." + +#~ msgid "" +#~ " -p List functions and bindings in a form that can be" +#~ msgstr "" +#~ " -p Muestra las funciones y asignaciones en un formato " +#~ "que" + +#~ msgid " reused as input." +#~ msgstr " puede reusarse como entrada." + +#~ msgid " -r keyseq Remove the binding for KEYSEQ." +#~ msgstr " -r sec_teclas Borra la asignación para SEC_TECLAS" + +# lee 'la'... em+ +#~ msgid " -f filename Read key bindings from FILENAME." +#~ msgstr " -f fichero Lee la asignación de teclas de FICHERO." + +#~ msgid "" +#~ " -q function-name Query about which keys invoke the named function." +#~ msgstr "" +#~ " -q nombre-función Pregunta sobre qué teclas invocan la función " +#~ "nombrada." + +#~ msgid " -V List variable names and values" +#~ msgstr " -V Muestra los nombres de variables y valores" + +#~ msgid "" +#~ " -v List variable names and values in a form that can" +#~ msgstr "" +#~ " -v Muestra los nombres de variables y valores de una " +#~ "forma que" + +#~ msgid " be reused as input." +#~ msgstr " puede reusarse como entrada." + +#~ msgid "" +#~ " -S List key sequences that invoke macros and their " +#~ "values" +#~ msgstr "" +#~ " -S Muestra las secuencias de teclas que invocan macros " +#~ "y sus\n" +#~ " valores" + +#~ msgid "" +#~ " -s List key sequences that invoke macros and their " +#~ "values in" +#~ msgstr "" +#~ " -s Muestra las secuencias de teclas que invocan macros " +#~ "y sus" + +#~ msgid " a form that can be reused as input." +#~ msgstr "" +#~ " valores en una forma que puede reusarse como entrada." + +#~ msgid "break N levels." +#~ msgstr "sale N niveles." + +#~ msgid "If N is specified, resume at the N-th enclosing loop." +#~ msgstr "Si se especifica N, retoma en el N-ésimo ciclo." + +#~ msgid "Run a shell builtin. This is useful when you wish to rename a" +#~ msgstr "Ejecuta un shell interno. Esto es útil cuando desea renombrar un" + +#~ msgid "shell builtin to be a function, but need the functionality of the" +#~ msgstr "" +#~ "shell interno para que sea una función, pero necesita la funcionalidad" + +#~ msgid "builtin within the function itself." +#~ msgstr "interna dentro de la misma función." + +#~ msgid "Change the current directory to DIR. The variable $HOME is the" +#~ msgstr "Cambia el directorio actual a DIR. La variable $HOME es el DIR" + +#~ msgid "default DIR. The variable $CDPATH defines the search path for" +#~ msgstr "por omisión. La variable $CDPATH define la ruta de búsqueda para" + +#~ msgid "the directory containing DIR. Alternative directory names in CDPATH" +#~ msgstr "" +#~ "el directorio que contiene DIR. Los nombres alternativos de directorio en" + +#~ msgid "are separated by a colon (:). A null directory name is the same as" +#~ msgstr "" +#~ "CDPATH son separados por dos puntos (:). Un nombre de directorio nulo es" + +# Slash lo venimos traduciendo por barra inclinada , y backslash +# por barra invertida em++ +#~ msgid "the current directory, i.e. `.'. If DIR begins with a slash (/)," +#~ msgstr "" +#~ "igual al directorio actual, p.e. `.'. Si DIR comienza con una barra " +#~ "inclinada" + +#~ msgid "then $CDPATH is not used. If the directory is not found, and the" +#~ msgstr "" +#~ "(/), entonces $CDPATH no se usa. Si el directorio no se encuentra, y" + +#~ msgid "shell option `cdable_vars' is set, then try the word as a variable" +#~ msgstr "" +#~ "la opción de shell `cdable_vars' está activa, entonces intenta la palabra" + +#~ msgid "name. If that variable has a value, then cd to the value of that" +#~ msgstr "" +#~ "como nombre de variable. Si esa variable tiene un valor, entonces se " +#~ "cambia al" + +#~ msgid "" +#~ "variable. The -P option says to use the physical directory structure" +#~ msgstr "" +#~ "valor de esa variable. La opción -P indica el uso de la estructura física" + +#~ msgid "" +#~ "instead of following symbolic links; the -L option forces symbolic links" +#~ msgstr "del directorio en lugar de seguir enlaces simbólicos; la opción -L" + +# forza -> fuerza? cfuga +#~ msgid "to be followed." +#~ msgstr "fuerza que los vínculos simbólicos sean seguidos." + +#~ msgid "Print the current working directory. With the -P option, pwd prints" +#~ msgstr "" +#~ "Imprime el directorio actual de trabajo. Con la opción -P, pwd imprime" + +#~ msgid "the physical directory, without any symbolic links; the -L option" +#~ msgstr "el directorio físico, sin ningún enlace simbólico; la opción -L" + +#~ msgid "makes pwd follow symbolic links." +#~ msgstr "hace que pwd siga los enlaces simbólicos." + +#~ msgid "" +#~ "Runs COMMAND with ARGS ignoring shell functions. If you have a shell" +#~ msgstr "Ejecuta ORDEN con ARGUMENTOS ignorando las funciones del shell. Si" + +#~ msgid "function called `ls', and you wish to call the command `ls', you can" +#~ msgstr "" +#~ "tiene una función de shell llamada `ls', y desea llamar a la orden `ls'," + +#~ msgid "" +#~ "say \"command ls\". If the -p option is given, a default value is used" +#~ msgstr "" +#~ "se puede decir \"command ls\". Si se especifica la opción -p, se usa un " +#~ "valor" + +# es usado -> se usa. sv +# De acuerdo. La corrección incluye también la línea anterior. cfuga +#~ msgid "" +#~ "for PATH that is guaranteed to find all of the standard utilities. If" +#~ msgstr "" +#~ "por omisión para PATH que garantiza encontrar todas las herramientas " +#~ "estándar." + +# es impresa -> se muestra una cadena em+ +# "Si se da la opcón -V o -v,..." sv +# De acuerdo. cfuga +#~ msgid "" +#~ "the -V or -v option is given, a string is printed describing COMMAND." +#~ msgstr "" +#~ "Si se da la opción -V o -v, se muestra una cadena describiendo la ORDEN." + +#~ msgid "The -V option produces a more verbose description." +#~ msgstr "La opción -V produce una descripción más completa." + +#~ msgid "Declare variables and/or give them attributes. If no NAMEs are" +#~ msgstr "" +#~ "Declara variables y/o les da atributos. Si no se proporcionan NOMBREs," + +#~ msgid "given, then display the values of variables instead. The -p option" +#~ msgstr "entonces muestra los valores de las variables. La opción -p" + +#~ msgid "will display the attributes and values of each NAME." +#~ msgstr "mostrará los atributos y valores de cada NOMBRE." + +#~ msgid "The flags are:" +#~ msgstr "Los indicadores son:" + +#~ msgid " -a\tto make NAMEs arrays (if supported)" +#~ msgstr " -a\thacer los NOMBREs matrices (si está soportado)" + +#~ msgid " -f\tto select from among function names only" +#~ msgstr " -f\tseleccionar sólo entre los nombres de funciones" + +#~ msgid " -F\tto display function names without definitions" +#~ msgstr " -F\tmostrar los nombres de funciones sin definiciones" + +#~ msgid " -r\tto make NAMEs readonly" +#~ msgstr " -r\thacer los NOMBREs de sólo lectura" + +#~ msgid " -x\tto make NAMEs export" +#~ msgstr " -x\thacer los NOMBREs exportables" + +#~ msgid " -i\tto make NAMEs have the `integer' attribute set" +#~ msgstr " -i\thacer que los NOMBREs tengan el atributo `entero' activado" + +#~ msgid "Variables with the integer attribute have arithmetic evaluation (see" +#~ msgstr "Las variables con el atributo entero tienen evaluación aritmética" + +#~ msgid "`let') done when the variable is assigned to." +#~ msgstr "(ver `let') cuando la variable es asignada." + +#~ msgid "When displaying values of variables, -f displays a function's name" +#~ msgstr "Cuando se muestran valores de variables, -f muestra el nombre y" + +#~ msgid "and definition. The -F option restricts the display to function" +#~ msgstr "la definición de la función. La opción -F evita que se muestre" + +#~ msgid "name only." +#~ msgstr "solamente el nombre de la función." + +# apaga -> desactiva em+ +#~ msgid "" +#~ "Using `+' instead of `-' turns off the given attribute instead. When" +#~ msgstr "" +#~ "Usar `+' en lugar de `-' desactiva el atributo dado. Cuando es usado" + +#~ msgid "used in a function, makes NAMEs local, as with the `local' command." +#~ msgstr "" +#~ "en una función, hace los NOMBREs locales, como con la orden `local'." + +# y le da -> y le asigna em+ +#~ msgid "Create a local variable called NAME, and give it VALUE. LOCAL" +#~ msgstr "Crea una variable local llamada NOMBRE, y le asigna un VALOR. LOCAL" + +# tenga un alcance visible -> sea visible solo para la función y sus los hijos em+ +#~ msgid "have a visible scope restricted to that function and its children." +#~ msgstr "tenga visible sólo para la función y sus hijos." + +#~ msgid "Output the ARGs. If -n is specified, the trailing newline is" +#~ msgstr "Muestra los ARGumentos. Si -n es especificado, el carácter final de" + +#~ msgid "suppressed. If the -e option is given, interpretation of the" +#~ msgstr "" +#~ "fin de línea es eliminado. Si se especifica la opción -e, se activa la" + +#~ msgid "following backslash-escaped characters is turned on:" +#~ msgstr "interpretación de estos caracteres de escape con barras invertidas:" + +#~ msgid "\t\\a\talert (bell)" +#~ msgstr "\t\\a\talerta (campana)" + +#~ msgid "\t\\b\tbackspace" +#~ msgstr "\t\\b\tespacio hacia atrás" + +#~ msgid "\t\\c\tsuppress trailing newline" +#~ msgstr "\t\\c\tsuprime el carácter de fin de línea restante" + +#~ msgid "\t\\E\tescape character" +#~ msgstr "\t\\E\tcarácter de escape" + +#~ msgid "\t\\f\tform feed" +#~ msgstr "\t\\f\talimentación de papel" + +#~ msgid "\t\\n\tnew line" +#~ msgstr "\t\\n\tnueva línea" + +#~ msgid "\t\\r\tcarriage return" +#~ msgstr "\t\\r\tretorno de carro" + +#~ msgid "\t\\t\thorizontal tab" +#~ msgstr "\t\\t\ttabulador horizontal" + +#~ msgid "\t\\v\tvertical tab" +#~ msgstr "\t\\v\ttabulador vertical" + +#~ msgid "\t\\\\\tbackslash" +#~ msgstr "\t\\\\\tbarra invertida" + +#~ msgid "\t\\num\tthe character whose ASCII code is NUM (octal)." +#~ msgstr "\t\\num\tel carácter cuyo código ASCII es NÚM (octal)." + +#~ msgid "" +#~ "You can explicitly turn off the interpretation of the above characters" +#~ msgstr "Puede desactivar explícitamente la interpretación de los siguientes" + +#~ msgid "with the -E option." +#~ msgstr "caracteres con la opción -E ." + +#~ msgid "Enable and disable builtin shell commands. This allows" +#~ msgstr "Activa y desactiva las órdenes internas del shell. Esto permite" + +#~ msgid "you to use a disk command which has the same name as a shell" +#~ msgstr "" +#~ "que use una orden del sistema que tenga el mismo nombre de una orden" + +#~ msgid "builtin. If -n is used, the NAMEs become disabled; otherwise" +#~ msgstr "interna. Si se usa -n , los NOMBREs se desactivan; de otra forma" + +#~ msgid "NAMEs are enabled. For example, to use the `test' found on your" +#~ msgstr "se activan los NOMBREs. Por ejemplo, para usar `test' de la" + +#~ msgid "path instead of the shell builtin version, type `enable -n test'." +#~ msgstr "" +#~ "ruta de acceso en lugar de la versión interna del shell, teclee\n" +#~ "`enable -n test'." + +# se puede usar. sv +#~ msgid "On systems supporting dynamic loading, the -f option may be used" +#~ msgstr "En sistemas que soportan carga dinámica, la opción -f se puede usar" + +#~ msgid "to load new builtins from the shared object FILENAME. The -d" +#~ msgstr "para cargar nuevas órdenes internas del objeto FICHERO compartido." + +#~ msgid "option will delete a builtin previously loaded with -f. If no" +#~ msgstr "La opción -d borrará una orden interna cargada con -f. Si no" + +#~ msgid "non-option names are given, or the -p option is supplied, a list" +#~ msgstr "" +#~ "se especifica ninguna opción, o se especifica la opción -p, se muestra " +#~ "una lista" + +# Se muestra una lista de órdenes internas. sv +# Hay muchos más mensajes que están en "pasiva" que quedarían mejor en +# forma "reflexiva". No comento más y te dejo que los mires despacio. +# Gracias por la observación. cfuga +#~ msgid "of builtins is printed. The -a option means to print every builtin" +#~ msgstr "" +#~ "de órdenes internas. La opción -a implica mostrar cada orden interno" + +#~ msgid "with an indication of whether or not it is enabled. The -s option" +#~ msgstr "con una indicación de si está activa o no. La opción -s impide" + +#~ msgid "restricts the output to the Posix.2 `special' builtins. The -n" +#~ msgstr "la salida a las órdenes internas `especiales' Posix.2. La opción -n" + +#~ msgid "option displays a list of all disabled builtins." +#~ msgstr "muestra una lista de todos las órdenes internas desactivadas." + +#~ msgid "Getopts is used by shell procedures to parse positional parameters." +#~ msgstr "" +#~ "Los procedimientos de shell usan getopts para decodificar parámetros\n" +#~ "de posición." + +# "a ser reconocidas" no está en español. +# Yo pondría "las letras de opción que se reconocen". sv +# De acuerdo. cfuga +#~ msgid "OPTSTRING contains the option letters to be recognized; if a letter" +#~ msgstr "" +#~ "La CADENA_OPCIONES contiene las letras de opción que se reconocen; si una" + +#~ msgid "is followed by a colon, the option is expected to have an argument," +#~ msgstr "" +#~ "letra es seguida de dos puntos, se espera que la opción tenga un " +#~ "argumento," + +#~ msgid "which should be separated from it by white space." +#~ msgstr "que debe estar separado por espacios." + +#~ msgid "Each time it is invoked, getopts will place the next option in the" +#~ msgstr "Cada vez que se llama, getopts colocará la siguiente opción en" + +#~ msgid "shell variable $name, initializing name if it does not exist, and" +#~ msgstr "" +#~ "la variable de shell $nombre, creando nombre si no existe, y el índice" + +#~ msgid "the index of the next argument to be processed into the shell" +#~ msgstr "" +#~ "del siguiente argumento para procesarse dentro de la variable del shell" + +#~ msgid "variable OPTIND. OPTIND is initialized to 1 each time the shell or" +#~ msgstr "OPTIND. OPTIND inicia con 1 cada vez que el shell o un guión de" + +#~ msgid "a shell script is invoked. When an option requires an argument," +#~ msgstr "shell es llamado. Cuando una opción requiere un argumento," + +#~ msgid "getopts places that argument into the shell variable OPTARG." +#~ msgstr "getopts coloca ese argumento en la variable de shell OPTARG." + +# en una de dos formas -> en una de las dos formas siguientes em+ +#~ msgid "getopts reports errors in one of two ways. If the first character" +#~ msgstr "" +#~ "getopts comunica errores en una de las dos formas siguientes. Si el " +#~ "primer carácter" + +#~ msgid "of OPTSTRING is a colon, getopts uses silent error reporting. In" +#~ msgstr "" +#~ "de OPTSTRING es dos puntos, getopts usa el aviso de error silencioso." + +#~ msgid "this mode, no error messages are printed. If an illegal option is" +#~ msgstr "" +#~ "En este modo, no se muestran mensajes de error. Si se encuentra una " +#~ "opción" + +#~ msgid "seen, getopts places the option character found into OPTARG. If a" +#~ msgstr "ilegal, getopts coloca el carácter de opción encontrado en OPTARG." + +#~ msgid "required argument is not found, getopts places a ':' into NAME and" +#~ msgstr "" +#~ "Si un argumento necesario no se encuentra, getopts coloca ':' en NOMBRE" + +#~ msgid "sets OPTARG to the option character found. If getopts is not in" +#~ msgstr "y establece a OPTARG con el carácter de opción encontrado. Si" + +#~ msgid "silent mode, and an illegal option is seen, getopts places '?' into" +#~ msgstr "" +#~ "getopts no está en modo silencioso, y se encuentra una opción ilegal," + +#~ msgid "NAME and unsets OPTARG. If a required option is not found, a '?'" +#~ msgstr "getopts coloca '?' en NOMBRE y borra OPTARG. Si no se encuentra" + +#~ msgid "is placed in NAME, OPTARG is unset, and a diagnostic message is" +#~ msgstr "una opción necesaria, se coloca un '?' en NOMBRE, se borra OPTARG," + +#~ msgid "If the shell variable OPTERR has the value 0, getopts disables the" +#~ msgstr "" +#~ "Si la variable de shell OPTERR tiene el valor 0, getopts deshabilita" + +#~ msgid "printing of error messages, even if the first character of" +#~ msgstr "la notificación de mensajes de error, aún si el primer carácter de" + +#~ msgid "OPTSTRING is not a colon. OPTERR has the value 1 by default." +#~ msgstr "OPTSTRING no es ':'. OPTERR tiene el valor de 1 por omisión." + +#~ msgid "Getopts normally parses the positional parameters ($0 - $9), but if" +#~ msgstr "" +#~ "Getopts normalmente compara los parámetros de posición ($0 - $9), pero" + +# dar argumentos -> especificar em+ +#~ msgid "more arguments are given, they are parsed instead." +#~ msgstr "" +#~ "si se especifican más argumentos, se comparan en lugar de los primeros." + +#~ msgid "Exec FILE, replacing this shell with the specified program." +#~ msgstr "" +#~ "Ejecuta el FICHERO, reemplazando este shell con el programa especificado." + +#~ msgid "If FILE is not specified, the redirections take effect in this" +#~ msgstr "" +#~ "Si no se especifica un FICHERO, las redirecciones toman efecto en este" + +#~ msgid "shell. If the first argument is `-l', then place a dash in the" +#~ msgstr "shell. Si el primer argumento es `-l', entonces coloca un guión en" + +#~ msgid "zeroth arg passed to FILE, as login does. If the `-c' option" +#~ msgstr "" +#~ "el argumento 0 pasado al FICHERO, como lo hace login. Si se especifica la " +#~ "opción" + +#~ msgid "is supplied, FILE is executed with a null environment. The `-a'" +#~ msgstr "`-c', el FICHERO se ejecuta en un entorno nulo. La opción `-a'" + +#~ msgid "option means to make set argv[0] of the executed process to NAME." +#~ msgstr "hace que cambie el argv[0] del proceso ejecutado a NOMBRE." + +#~ msgid "If the file cannot be executed and the shell is not interactive," +#~ msgstr "Si el fichero no se puede ejecutar y el shell no es interactivo," + +#~ msgid "then the shell exits, unless the variable \"no_exit_on_failed_exec\"" +#~ msgstr "entonces el shell termina, a menos que la variable" + +#~ msgid "is set." +#~ msgstr "\"no_exit_on_failed_exec\" esté activada." + +#~ msgid "is that of the last command executed." +#~ msgstr "es el del último comando ejecutado." + +#~ msgid "" +#~ "FIRST and LAST can be numbers specifying the range, or FIRST can be a" +#~ msgstr "" +#~ "PRIMERO y ÚLTIMO pueden ser números especificando el rango, o PRIMERO" + +#~ msgid "string, which means the most recent command beginning with that" +#~ msgstr "puede ser una cadena, que representa el comando más reciente que" + +#~ msgid "string." +#~ msgstr "comience con dicha cadena." + +#~ msgid "" +#~ " -e ENAME selects which editor to use. Default is FCEDIT, then EDITOR," +#~ msgstr "" +#~ " -e NOMBRE_E escoge qué editor emplear. Por omisión es FCEDIT, después" + +#~ msgid "" +#~ " then the editor which corresponds to the current readline editing" +#~ msgstr " EDITOR, después el editor que corresponde a la edición actual" + +#~ msgid " mode, then vi." +#~ msgstr " del modo de línea de comando, y finalmente vi." + +#~ msgid " -l means list lines instead of editing." +#~ msgstr " -l significa mostrar líneas en lugar de editarlas." + +#~ msgid " -n means no line numbers listed." +#~ msgstr " -n significa que no sean mostrados los números de línea." + +#~ msgid "" +#~ " -r means reverse the order of the lines (making it newest listed " +#~ "first)." +#~ msgstr "" +#~ " -r significa invertir el orden de las líneas (líneas nuevas primero)." + +#~ msgid "With the `fc -s [pat=rep ...] [command]' format, the command is" +#~ msgstr "Con el formato `fc -s [pat=rep ...] [orden]', la orden es" + +#~ msgid "re-executed after the substitution OLD=NEW is performed." +#~ msgstr "" +#~ "re-ejecutado después de que se realiza la sustitución ANTIGUA=NUEVA." + +#~ msgid "A useful alias to use with this is r='fc -s', so that typing `r cc'" +#~ msgstr "" +#~ "Un alias útil para usar con esto es r='fc -s', así que al teclear `r cc'" + +#~ msgid "runs the last command beginning with `cc' and typing `r' re-executes" +#~ msgstr "" +#~ "ejecuta la última orden que comenzó con `cc' y tecleando `r' re-ejecuta" + +#~ msgid "JOB_SPEC is not present, the shell's notion of the current job is" +#~ msgstr "" +#~ "Si el IDTRABAJO no se encuentra, se usa la noción del shell de trabajo" + +#~ msgid "used." +#~ msgstr "actual." + +#~ msgid "Place JOB_SPEC in the background, as if it had been started with" +#~ msgstr "" +#~ "Ubica al IDTRABAJO en el background, como si hubiera sido iniciado con" + +#~ msgid "`&'. If JOB_SPEC is not present, the shell's notion of the current" +#~ msgstr "`&'. Si el IDTRABAJO no se encuentra, se usa la noción del shell" + +#~ msgid "job is used." +#~ msgstr "de trabajo actual." + +#~ msgid "For each NAME, the full pathname of the command is determined and" +#~ msgstr "Para cada NOMBRE, se determina la ruta completa de la orden y se" + +#~ msgid "remembered. If the -p option is supplied, PATHNAME is used as the" +#~ msgstr "recuerda. Si se especifica la opción -p, se usa la RUTA_DE_ACCESO" + +#~ msgid "full pathname of NAME, and no path search is performed. The -r" +#~ msgstr "" +#~ "como la ruta completa de NOMBRE y no se realiza la búsqueda de ruta." + +#~ msgid "option causes the shell to forget all remembered locations. If no" +#~ msgstr "" +#~ " La opción -r hace que el shell olvide todas las ubicaciones recordadas." + +#~ msgid "" +#~ "arguments are given, information about remembered commands is displayed." +#~ msgstr "" +#~ " Si no se especifican argumentos, se muestra la información sobre las " +#~ "órdenes recordadas." + +#~ msgid "Display helpful information about builtin commands. If PATTERN is" +#~ msgstr "Muestra información de ayuda acerca de las órdenes internas. Si se" + +#~ msgid "specified, gives detailed help on all commands matching PATTERN," +#~ msgstr "" +#~ "especifica la PLANTILLA, da ayuda detallada de todas las órdenes que" + +#~ msgid "otherwise a list of the builtins is printed." +#~ msgstr "" +#~ "coinciden con la PLANTILLA, de otra forma se muestra una lista de las " +#~ "órdenes internas." + +#~ msgid "Display the history list with line numbers. Lines listed with" +#~ msgstr "" +#~ "Muestra la lista de la historia con números de línea. Las líneas " +#~ "mostradas" + +#~ msgid "with a `*' have been modified. Argument of N says to list only" +#~ msgstr "" +#~ "con un `*' han sido modificadas. Un argumento de N indica que solo se" + +#~ msgid "the last N lines. The -c option causes the history list to be" +#~ msgstr "" +#~ "muestren las últimas N líneas. La opción -c hace que la lista de la " +#~ "historia" + +#~ msgid "" +#~ "cleared by deleting all of the entries. The `-w' option writes out the" +#~ msgstr "" +#~ "sea borrada eliminando todas las entradas. La opción `-w' escribe la " +#~ "historia" + +#~ msgid "" +#~ "current history to the history file; `-r' means to read the file and" +#~ msgstr "" +#~ "actual al fichero de historia; `-r' al contrario, lee el fichero y agrega" + +#~ msgid "append the contents to the history list instead. `-a' means" +#~ msgstr "el contenido a la lista de la historia. `-a' agrega las" + +#~ msgid "to append history lines from this session to the history file." +#~ msgstr "líneas de la historia de esta sesión al fichero de historia." + +#~ msgid "Argument `-n' means to read all history lines not already read" +#~ msgstr "El argumento `-n' lee todas las líneas de historia que no han sido" + +#~ msgid "from the history file and append them to the history list. If" +#~ msgstr "" +#~ "leídas aún del fichero de historia y las agrega a la lista de historia." + +#~ msgid "FILENAME is given, then that is used as the history file else" +#~ msgstr "" +#~ " Si se especifica un FICHERO, entonces se usa como el fichero de historia" + +#~ msgid "if $HISTFILE has a value, that is used, else ~/.bash_history." +#~ msgstr "" +#~ "de otra manera si $HISTFILE tiene un valor, se utiliza, de otra forma se " +#~ "usa ~/.bash_history." + +#~ msgid "If the -s option is supplied, the non-option ARGs are appended to" +#~ msgstr "" +#~ "Si se especifica la opción -s, los ARGumentos que no son opciones se" + +#~ msgid "the history list as a single entry. The -p option means to perform" +#~ msgstr "" +#~ "agregan a la lista de historia como una sola entrada. La opción -p " +#~ "realiza" + +#~ msgid "" +#~ "history expansion on each ARG and display the result, without storing" +#~ msgstr "" +#~ "una expansión de historia en cada ARGumento y muestra el resultado, sin " +#~ "guardar" + +#~ msgid "anything in the history list." +#~ msgstr "nada en la lista de historia." + +#~ msgid "Lists the active jobs. The -l option lists process id's in addition" +#~ msgstr "" +#~ "Muestra los trabajos activos. La opción -l muestra los id's de los " +#~ "procesos además" + +#~ msgid "to the normal information; the -p option lists process id's only." +#~ msgstr "" +#~ "de la información normal; la opción -p solamente muestra los id's de los " +#~ "procesos." + +#~ msgid "" +#~ "If -n is given, only processes that have changed status since the last" +#~ msgstr "" +#~ "Si se especifica -n, solamente se muestran los procesos que han cambiado" + +#~ msgid "" +#~ "notification are printed. JOBSPEC restricts output to that job. The" +#~ msgstr "" +#~ "de estado desde la última notificación. IDJOB limita la salida a ese " +#~ "trabajo. Las" + +#~ msgid "-r and -s options restrict output to running and stopped jobs only," +#~ msgstr "" +#~ "opciones -r y -s limitan la salida a mostrar sólo trabajos corriendo y " +#~ "detenidos," + +#~ msgid "respectively. Without options, the status of all active jobs is" +#~ msgstr "respectivamente. Sin opciones, se muestra el estado de todos los" + +#~ msgid "" +#~ "printed. If -x is given, COMMAND is run after all job specifications" +#~ msgstr "" +#~ "trabajos activos. Si se especifica -x, la ORDEN se ejecuta después de " +#~ "que todas las especificaciones de trabajos" + +#~ msgid "" +#~ "that appear in ARGS have been replaced with the process ID of that job's" +#~ msgstr "que aparecen en ARGS han sido reemplazadas por el ID de proceso del" + +#~ msgid "process group leader." +#~ msgstr "líder del grupo de procesos de dicho trabajo." + +#~ msgid "Removes each JOBSPEC argument from the table of active jobs." +#~ msgstr "Elimina cada argumento IDJOBS de la tabla de trabajos activos." + +#~ msgid "Send the processes named by PID (or JOB) the signal SIGSPEC. If" +#~ msgstr "" +#~ "Manda a los procesos nombrados por PID (o TRABAJO) la señal SIGSPEC. Si" + +#~ msgid "" +#~ "SIGSPEC is not present, then SIGTERM is assumed. An argument of `-l'" +#~ msgstr "" +#~ "no se especifica SIGSPEC, entonces se asume SIGTERM. El argumento `-l'" + +#~ msgid "lists the signal names; if arguments follow `-l' they are assumed to" +#~ msgstr "" +#~ "muestra los nombres de señales; si hay argumentos después de `-l', se" + +#~ msgid "be signal numbers for which names should be listed. Kill is a shell" +#~ msgstr "" +#~ "asume que son números de señales cuyos nombres deben mostrarse. Kill es " +#~ "una orden" + +#~ msgid "builtin for two reasons: it allows job IDs to be used instead of" +#~ msgstr "" +#~ "interna de shell por dos razones: permite que los IDs de trabajos sean " +#~ "usados en lugar de " + +#~ msgid "process IDs, and, if you have reached the limit on processes that" +#~ msgstr "IDs de procesos, y, si ha alcanzado el límite de procesos que" + +#~ msgid "" +#~ "you can create, you don't have to start a process to kill another one." +#~ msgstr "puede crear, no tiene que iniciar un proceso para eliminar a otro." + +# "a ser evaluada" no está en español. sv +# Cierto. ¿Así está mejor? cfuga +#~ msgid "Each ARG is an arithmetic expression to be evaluated. Evaluation" +#~ msgstr "" +#~ "Cada ARGumento es una expresión aritmética para evaluarse. La evaluación" + +# overflow -> desbordamiento o sobrepasamiento. nunca lo he visto +# traducido como sobreflujo. sv +# Corregido. cfuga +#~ msgid "is done in long integers with no check for overflow, though division" +#~ msgstr "" +#~ "se hace en enteros long sin revisar desbordamientos, aunque la división" + +#~ msgid "by 0 is trapped and flagged as an error. The following list of" +#~ msgstr "por 0 es capturada y marcada como un error. La siguiente lista de" + +# No sé si existe precedencia en español, pero me suena fatal. +# Yo pondría simplemente "prioridad". sv +# Creo que si existe, pero tu sugerencia es mejor. cfuga +#~ msgid "operators is grouped into levels of equal-precedence operators." +#~ msgstr "" +#~ "operadores está agrupada en niveles de operadores de la misma prioridad." + +#~ msgid "The levels are listed in order of decreasing precedence." +#~ msgstr "Se muestran los niveles en orden de prioridad decreciente." + +#~ msgid "\t-, +\t\tunary minus, plus" +#~ msgstr "\t-, +\t\tmenos unario, más" + +#~ msgid "\t!, ~\t\tlogical and bitwise negation" +#~ msgstr "\t!, ~\t\tnegación lógica y basada en bits" + +#~ msgid "\t*, /, %\t\tmultiplication, division, remainder" +#~ msgstr "\t*, /, %\t\tmultiplicación, división, residuo" + +#~ msgid "\t+, -\t\taddition, subtraction" +#~ msgstr "\t+, -\t\tadición, sustracción" + +#~ msgid "\t<<, >>\t\tleft and right bitwise shifts" +#~ msgstr "\t<<, >>\t\tdesplazamientos de bits izquierdo y derecho" + +#~ msgid "\t<=, >=, <, >\tcomparison" +#~ msgstr "\t<=, >=, <, >\tcomparación" + +#~ msgid "\t==, !=\t\tequality, inequality" +#~ msgstr "\t==, !=\t\tequivalencia, inequivalencia" + +#~ msgid "\t&\t\tbitwise AND" +#~ msgstr "\t&\t\tAND de bits" + +#~ msgid "\t^\t\tbitwise XOR" +#~ msgstr "\t^\t\tXOR de bits" + +#~ msgid "\t|\t\tbitwise OR" +#~ msgstr "\t|\t\tOR de bits" + +#~ msgid "\t&&\t\tlogical AND" +#~ msgstr "\t&&\t\tAND lógico" + +#~ msgid "\t||\t\tlogical OR" +#~ msgstr "\t||\t\tOR lógico" + +#~ msgid "\texpr ? expr : expr" +#~ msgstr "\texpr ? expr : expr" + +#~ msgid "\t\t\tconditional expression" +#~ msgstr "\t\t\texpresión condicional" + +#~ msgid "\t=, *=, /=, %=," +#~ msgstr "\t=, *=, /=, %=," + +#~ msgid "\t+=, -=, <<=, >>=," +#~ msgstr "\t+=, -=, <<=, >>=," + +#~ msgid "\t&=, ^=, |=\tassignment" +#~ msgstr "asignaciones\t&=, ^=, |=" + +#~ msgid "is replaced by its value (coerced to a long integer) within" +#~ msgstr "de la variable por su valor (asignado a un entero long) dentro de" + +#~ msgid "an expression. The variable need not have its integer attribute" +#~ msgstr "una expresión. La variable no necesita tener activado su atributo" + +#~ msgid "turned on to be used in an expression." +#~ msgstr "entero para que se use en una expresión." + +#~ msgid "Operators are evaluated in order of precedence. Sub-expressions in" +#~ msgstr "" +#~ "Los operadores se evalúan en orden de prioridad. Se evalúan en primer" + +#~ msgid "parentheses are evaluated first and may override the precedence" +#~ msgstr "lugar las sub-expresiones en paréntesis y pueden sobrepasar las" + +#~ msgid "rules above." +#~ msgstr "reglas de prioridad anteriores." + +#~ msgid "If the last ARG evaluates to 0, let returns 1; 0 is returned" +#~ msgstr "Si el último ARGumento evalua a 0, let regresa 1; de otra manera" + +#~ msgid "otherwise." +#~ msgstr "se regresa 0." + +#~ msgid "One line is read from the standard input, and the first word is" +#~ msgstr "Una línea se lee de la entrada estándar, y la primera palabra se" + +#~ msgid "" +#~ "assigned to the first NAME, the second word to the second NAME, and so" +#~ msgstr "" +#~ "asigna al primer NOMBRE, la segunda palabra al segundo NOMBRE, y así" + +#~ msgid "" +#~ "on, with leftover words assigned to the last NAME. Only the characters" +#~ msgstr "" +#~ "con las palabras restantes asignadas al último NOMBRE. Solo los " +#~ "caracteres" + +#~ msgid "found in $IFS are recognized as word delimiters. The return code is" +#~ msgstr "" +#~ "que se encuentran en $IFS se reconocen como delimitadores de palabras. El" + +#~ msgid "" +#~ "zero, unless end-of-file is encountered. If no NAMEs are supplied, the" +#~ msgstr "" +#~ "código de retorno es cero, a menos que se encuentre un fin-de-fichero. " +#~ "Si no" + +#~ msgid "" +#~ "line read is stored in the REPLY variable. If the -r option is given," +#~ msgstr "" +#~ "se establece ningún NOMBRE, la línea leída se guarda en la variable " +#~ "REPLY. Si" + +#~ msgid "this signifies `raw' input, and backslash escaping is disabled. If" +#~ msgstr "" +#~ "se proporciona la opción -r, esto significa entrada `textual', y se " +#~ "desactiva" + +#~ msgid "the `-p' option is supplied, the string supplied as an argument is" +#~ msgstr "el escape de la barra invertida. Si se proporciona la opción `-p'," + +#~ msgid "" +#~ "output without a trailing newline before attempting to read. If -a is" +#~ msgstr "" +#~ "se muestra la cadena proporcionada como argumento sin un fín de línea " +#~ "terminal antes de intentar leerla." + +#~ msgid "" +#~ "supplied, the words read are assigned to sequential indices of ARRAY," +#~ msgstr "" +#~ "Si se da -a, se asignan las palabras leídas a índices secuenciales de " +#~ "MATRIZ" + +#~ msgid "starting at zero. If -e is supplied and the shell is interactive," +#~ msgstr "iniciando en cero. Si se da -e y el shell es interactivo," + +#~ msgid "readline is used to obtain the line." +#~ msgstr "se usa readline para obtener la línea." + +#~ msgid "is omitted, the return status is that of the last command." +#~ msgstr "se omite N, se utiliza el código de estado de la última orden." + +#~ msgid " -a Mark variables which are modified or created for export." +#~ msgstr "" +#~ " -a Marca las variables que se modifican o crean para exportación." + +#~ msgid " -b Notify of job termination immediately." +#~ msgstr " -b Notifica el término de trabajos inmediatamente." + +#~ msgid " -e Exit immediately if a command exits with a non-zero status." +#~ msgstr "" +#~ " -e Termina inmediatamente si una orden termina con un estado " +#~ "diferente a cero." + +#~ msgid " -f Disable file name generation (globbing)." +#~ msgstr "" +#~ " -f Desactiva la generación de nombres de ficheros (englobamiento)." + +#~ msgid " -h Remember the location of commands as they are looked up." +#~ msgstr "" +#~ " -h Recuerda la ubicación de las órdenes como fueron localizadas." + +#~ msgid "" +#~ " -i Force the shell to be an \"interactive\" one. Interactive shells" +#~ msgstr "" +#~ " -i Fuerza que el shell sea \"interactive\". Los shells interactivos" + +#~ msgid " always read `~/.bashrc' on startup." +#~ msgstr " siempre leen `~/.bashrc' al inicio." + +#~ msgid " -k All assignment arguments are placed in the environment for a" +#~ msgstr "" +#~ " -k Todos los argumentos de asignación se ubican en el ambiente para " +#~ "una" + +#~ msgid " command, not just those that precede the command name." +#~ msgstr "" +#~ " orden, no solamente aquéllos que preceden al nombre de la orden." + +#~ msgid " -m Job control is enabled." +#~ msgstr " -m Se activa el control de trabajos." + +#~ msgid " -n Read commands but do not execute them." +#~ msgstr " -n Lee órdenes pero no las ejecuta." + +#~ msgid " -o option-name" +#~ msgstr " -o nombre-opción" + +#~ msgid " Set the variable corresponding to option-name:" +#~ msgstr " Establece la variable correspondiente a nombre-opción:" + +#~ msgid " allexport same as -a" +#~ msgstr " allexport igual que -a" + +#~ msgid " braceexpand same as -B" +#~ msgstr " braceexpand igual que -B" + +#~ msgid " emacs use an emacs-style line editing interface" +#~ msgstr "" +#~ " emacs usa una interfaz de edición de línea estilo emacs" + +#~ msgid " errexit same as -e" +#~ msgstr " errexit igual que -e" + +#~ msgid " hashall same as -h" +#~ msgstr " hashall igual que -h" + +#~ msgid " histexpand same as -H" +#~ msgstr " histexpand igual que -H" + +#~ msgid " ignoreeof the shell will not exit upon reading EOF" +#~ msgstr " ignoreeof el shell no terminará después de leer EOF" + +#~ msgid " interactive-comments" +#~ msgstr " interactive-comments" + +#~ msgid "" +#~ " allow comments to appear in interactive commands" +#~ msgstr "" +#~ " permite que los comentarios se muestren en " +#~ "órdenes interactivas" + +#~ msgid " keyword same as -k" +#~ msgstr " keyword igual que -k" + +#~ msgid " monitor same as -m" +#~ msgstr " monitor igual que -m" + +#~ msgid " noclobber same as -C" +#~ msgstr " noclobber igual que -C" + +#~ msgid " noexec same as -n" +#~ msgstr " noexec igual que -n" + +#~ msgid " noglob same as -f" +#~ msgstr " noglob igual que -f" + +#~ msgid " notify save as -b" +#~ msgstr " notify igual que -b" + +#~ msgid " nounset same as -u" +#~ msgstr " nounset igual que -u" + +#~ msgid " onecmd same as -t" +#~ msgstr " onecmd same as -t" + +#~ msgid " physical same as -P" +#~ msgstr " physical same as -P" + +#~ msgid "" +#~ " posix change the behavior of bash where the default" +#~ msgstr "" +#~ " posix cambia la conducta de bash donde por omisión" + +#~ msgid "" +#~ " operation differs from the 1003.2 standard to" +#~ msgstr "" +#~ " la operación difiere del estándar 1003.2 para" + +#~ msgid " match the standard" +#~ msgstr " cumplir el estándar" + +#~ msgid " privileged same as -p" +#~ msgstr " privileged igual que -p" + +#~ msgid " verbose same as -v" +#~ msgstr " verbose igual que -v" + +#~ msgid " vi use a vi-style line editing interface" +#~ msgstr "" +#~ " vi usa una interfaz de edición de línea estilo vi" + +#~ msgid " xtrace same as -x" +#~ msgstr " xtrace igual que -x" + +#~ msgid "" +#~ " -p Turned on whenever the real and effective user ids do not match." +#~ msgstr "" +#~ " -p Se activa cada vez que los ids real y efectivo no coinciden." + +# FIXME: $ENV es variable, no fichero. cfuga +#~ msgid " Disables processing of the $ENV file and importing of shell" +#~ msgstr "" +#~ " Desactiva el procesamiento del fichero $ENV y la importación de " +#~ "funciones" + +#~ msgid "" +#~ " functions. Turning this option off causes the effective uid and" +#~ msgstr " de shell. Desactivar esta opción causa que el uid y el gid" + +#~ msgid " gid to be set to the real uid and gid." +#~ msgstr " efectivos sean iguales al uid y al gid reales." + +#~ msgid " -t Exit after reading and executing one command." +#~ msgstr " -t Terminar después de leer y ejecutar una orden." + +#~ msgid " -u Treat unset variables as an error when substituting." +#~ msgstr "" +#~ " -u Tratar las variables no establecidas como un error cuando se hace " +#~ "sustitución." + +#~ msgid " -v Print shell input lines as they are read." +#~ msgstr " -v Muestra las líneas de entrada del shell mientras se leen." + +#~ msgid " -x Print commands and their arguments as they are executed." +#~ msgstr " -x Muestra las órdenes y sus argumentos mientras se ejecutan." + +#~ msgid " -B the shell will perform brace expansion" +#~ msgstr " -B el shell hará expansión de llaves" + +#~ msgid " -H Enable ! style history substitution. This flag is on" +#~ msgstr "" +#~ " -H Activa el estilo ! de sustitución de la historia. Este indicador" + +#~ msgid " by default." +#~ msgstr " está activado por omisión." + +#~ msgid " -C If set, disallow existing regular files to be overwritten" +#~ msgstr "" +#~ " -C Si está establecido, evita que los ficheros regulares existentes " +#~ "sean sobreescritos" + +#~ msgid " by redirection of output." +#~ msgstr " por una redirección de salida." + +#~ msgid " -P If set, do not follow symbolic links when executing commands" +#~ msgstr "" +#~ " -P Si está establecido, no se siguen los enlaces simbólicos cuando " +#~ "se ejecutan órdenes" + +#~ msgid " such as cd which change the current directory." +#~ msgstr " como cuando cd cambia al directorio actual." + +#~ msgid "Using + rather than - causes these flags to be turned off. The" +#~ msgstr "" +#~ "Usar + en lugar de - causa que estos indicadores sean desactivados. Los" + +#~ msgid "flags can also be used upon invocation of the shell. The current" +#~ msgstr "" +#~ "indicadores también se pueden usar durante la invocación del shell. El " +#~ "conjunto" + +#~ msgid "" +#~ "set of flags may be found in $-. The remaining n ARGs are positional" +#~ msgstr "" +#~ "actual de indicadores se encuentra en $-. Los ARGumentos n restantes son " +#~ "parámetros" + +#~ msgid "parameters and are assigned, in order, to $1, $2, .. $n. If no" +#~ msgstr "posicionales y se asignan, en orden, a $1, $2, .. $n. Si no" + +#~ msgid "ARGs are given, all shell variables are printed." +#~ msgstr "" +#~ "se establecen ARGumentos, se muestran todas las variables del shell." + +#~ msgid "For each NAME, remove the corresponding variable or function. Given" +#~ msgstr "" +#~ "Para cada NOMBRE, se borra la variable o función correspondiente. Al usar" + +#~ msgid "the `-v', unset will only act on variables. Given the `-f' flag," +#~ msgstr "`-v', unset sólo actuará en variables. Al usar el indicador `-f'," + +#~ msgid "unset will only act on functions. With neither flag, unset first" +#~ msgstr "" +#~ "unset sólo actuará en funciones. Sin ningún indicador, unset primero" + +#~ msgid "tries to unset a variable, and if that fails, then tries to unset a" +#~ msgstr "" +#~ "intenta borrar una variable, y si eso falla, entonces intenta borrar una" + +#~ msgid "" +#~ "function. Some variables (such as PATH and IFS) cannot be unset; also" +#~ msgstr "" +#~ "función. Algunas variables (como PATH e IFS) no se pueden borrar; vea" + +#~ msgid "see readonly." +#~ msgstr "también readonly." + +#~ msgid "NAMEs are marked for automatic export to the environment of" +#~ msgstr "los NOMBREs se marcan para exportación automática al ambiente de" + +#~ msgid "subsequently executed commands. If the -f option is given," +#~ msgstr "" +#~ "las órdenes ejecutadas subsecuentemente. Si se establece el indicador -f," + +#~ msgid "the NAMEs refer to functions. If no NAMEs are given, or if `-p'" +#~ msgstr "" +#~ "los NOMBREs se refieren a funciones. Si no se establecen NOMBREs, o si `-" +#~ "p'" + +#~ msgid "is given, a list of all names that are exported in this shell is" +#~ msgstr "" +#~ "se establece, se muestra una lista de todos los nombres que se exportan" + +#~ msgid "printed. An argument of `-n' says to remove the export property" +#~ msgstr "" +#~ "en este shell. Un argumento `-n' indica que se borre la propiedad de " +#~ "exportación" + +#~ msgid "from subsequent NAMEs. An argument of `--' disables further option" +#~ msgstr "" +#~ "de NOMBREs subsecuentes. Un argumento `--' desactiva el procesamiento" + +#~ msgid "processing." +#~ msgstr "posterior de opciones." + +#~ msgid "" +#~ "The given NAMEs are marked readonly and the values of these NAMEs may" +#~ msgstr "" +#~ "Los NOMBREs dados se marcan como sólo-lectura y los valores de esos " +#~ "NOMBREs" + +#~ msgid "not be changed by subsequent assignment. If the -f option is given," +#~ msgstr "" +#~ "no se pueden cambiar por asignaciones posteriores. Si se establece el " +#~ "indicador -f," + +#~ msgid "then functions corresponding to the NAMEs are so marked. If no" +#~ msgstr "" +#~ "entonces también se marcan las funciones correspondientes a los NOMBREs. " +#~ "Si no" + +#~ msgid "" +#~ "arguments are given, or if `-p' is given, a list of all readonly names" +#~ msgstr "" +#~ "se establecen argumentos, o si se establece `-p', se muestra una lista de " +#~ "todos los nombres" + +#~ msgid "" +#~ "is printed. An argument of `-n' says to remove the readonly property" +#~ msgstr "" +#~ "de sólo-lectura. Un argumento `-n' indica que se borre la propiedad de " +#~ "sólo-lectura" + +#~ msgid "from subsequent NAMEs. The `-a' option means to treat each NAME as" +#~ msgstr "de los NOMBREs subsecuentes. La opción `-a' trata cada NOMBRE como" + +#~ msgid "an array variable. An argument of `--' disables further option" +#~ msgstr "" +#~ "una variable de matriz. Un argumento de `--' desactiva opciones " +#~ "posteriores" + +#~ msgid "not given, it is assumed to be 1." +#~ msgstr "establece N, se asume que es 1." + +#~ msgid "Read and execute commands from FILENAME and return. The pathnames" +#~ msgstr "Lee y ejecuta órdenes del FICHERO y regresa. Los nombres de ruta" + +#~ msgid "in $PATH are used to find the directory containing FILENAME." +#~ msgstr "" +#~ "en $PATH se utilizan para encontrar al directorio que contiene el FICHERO." + +#~ msgid "Suspend the execution of this shell until it receives a SIGCONT" +#~ msgstr "Suspende la ejecución de este shell hasta que recive una señal" + +#~ msgid "signal. The `-f' if specified says not to complain about this" +#~ msgstr "SIGCONT. Si se especifica `-f' indica que no se queje si" + +#~ msgid "being a login shell if it is; just suspend anyway." +#~ msgstr "es un shell de login; y solo suspender de cualquier forma." + +#~ msgid "Exits with a status of 0 (trueness) or 1 (falseness) depending on" +#~ msgstr "Termina con un estado de 0 (verdad) ó 1 (falsedad) dependiendo de" + +#~ msgid "the evaluation of EXPR. Expressions may be unary or binary. Unary" +#~ msgstr "" +#~ "la evaluación de EXPR. Las expresiones pueden ser unarias o binarias. " +#~ "Las expresiones" + +#~ msgid "expressions are often used to examine the status of a file. There" +#~ msgstr "" +#~ "unarias se utilizan con frecuencia para examinar el estado de un fichero." + +#~ msgid "are string operators as well, and numeric comparison operators." +#~ msgstr "" +#~ "Hay operadores de cadenas también, y operadores de comparación numérica." + +#~ msgid "File operators:" +#~ msgstr "Operadores de fichero:" + +#~ msgid " -b FILE True if file is block special." +#~ msgstr " -b FICHERO Verdadero si el fichero es especial de bloques." + +#~ msgid " -c FILE True if file is character special." +#~ msgstr "" +#~ " -c FICHERO Verdadero si el fichero es especial de caracteres." + +#~ msgid " -d FILE True if file is a directory." +#~ msgstr " -d FICHERO Verdadero si el fichero es un directorio." + +#~ msgid " -e FILE True if file exists." +#~ msgstr " -e FICHERO Verdadero si el fichero existe." + +#~ msgid " -f FILE True if file exists and is a regular file." +#~ msgstr "" +#~ " -f FICHERO Verdadero si el fichero existe y es un fichero regular." + +#~ msgid " -g FILE True if file is set-group-id." +#~ msgstr "" +#~ " -g FICHERO Verdadero si el fichero tiene activado el set-group-id." + +#~ msgid " -h FILE True if file is a symbolic link. Use \"-L\"." +#~ msgstr "" +#~ " -h FICHERO Verdadero si el fichero es un enlace simbólico. Use " +#~ "\"-L\"." + +#~ msgid " -L FILE True if file is a symbolic link." +#~ msgstr " -L FICHERO Verdadero si el fichero es un enlace simbólico." + +#~ msgid " -k FILE True if file has its \"sticky\" bit set." +#~ msgstr "" +#~ " -k FICHERO Verdadero si el fichero tiene el bit \"sticky\" " +#~ "activado." + +#~ msgid " -p FILE True if file is a named pipe." +#~ msgstr " -p FICHERO Verdadero si el fichero es una tubería nombrada." + +#~ msgid " -r FILE True if file is readable by you." +#~ msgstr " -r FICHERO Verdadero si usted puede leer el fichero." + +#~ msgid " -s FILE True if file exists and is not empty." +#~ msgstr " -s FICHERO Verdadero si el fichero existe y no está vacío." + +#~ msgid " -S FILE True if file is a socket." +#~ msgstr " -S FICHERO Verdadero si el fichero es un `socket'." + +#~ msgid " -t FD True if FD is opened on a terminal." +#~ msgstr " -t DF Verdadero si DF está abierto en una terminal." + +#~ msgid " -u FILE True if the file is set-user-id." +#~ msgstr "" +#~ " -u FICHERO Verdadero si el fichero tiene activado el set-user-id." + +#~ msgid " -w FILE True if the file is writable by you." +#~ msgstr " -w FICHERO Verdadero si usted puede modificar el fichero." + +#~ msgid " -x FILE True if the file is executable by you." +#~ msgstr " -x FICHERO Verdadero si usted puede ejecutar el fichero." + +#~ msgid " -O FILE True if the file is effectively owned by you." +#~ msgstr "" +#~ " -O FICHERO Verdadero si usted efectivamente posee el fichero." + +#~ msgid "" +#~ " -G FILE True if the file is effectively owned by your group." +#~ msgstr "" +#~ " -G FICHERO Verdadero si su grupo efectivamente posee el fichero." + +#~ msgid " FILE1 -nt FILE2 True if file1 is newer than (according to" +#~ msgstr "" +#~ " FICH1 -nt FICH2 Verdadero si fich1 es más nuevo que (de acuerdo a" + +#~ msgid " modification date) file2." +#~ msgstr " la fecha de modificación) el fich2." + +#~ msgid " FILE1 -ot FILE2 True if file1 is older than file2." +#~ msgstr " FICH1 -ot FICH2 Verdadero si fich1 es más viejo que fich2." + +#~ msgid " FILE1 -ef FILE2 True if file1 is a hard link to file2." +#~ msgstr " FICH1 -ef FICH2 Verdadero si fich1 es un enlace duro a fich2." + +#~ msgid "String operators:" +#~ msgstr "Operadores de cadenas:" + +#~ msgid " -z STRING True if string is empty." +#~ msgstr " -z CADENA Verdadero si la cadena está vacía." + +#~ msgid " -n STRING" +#~ msgstr " -n CADENA" + +#~ msgid " STRING True if string is not empty." +#~ msgstr " CADENA Verdadero si la cadena no está vacía." + +#~ msgid " STRING1 = STRING2" +#~ msgstr " CADENA1 = CADENA2" + +#~ msgid " True if the strings are equal." +#~ msgstr " Verdadero si las cadenas son iguales." + +#~ msgid " STRING1 != STRING2" +#~ msgstr " CADENA1 != CADENA2" + +#~ msgid " True if the strings are not equal." +#~ msgstr " Verdadero si las cadenas no son iguales." + +#~ msgid " STRING1 < STRING2" +#~ msgstr " CADENA1 < CADENA2" + +#~ msgid "" +#~ " True if STRING1 sorts before STRING2 lexicographically" +#~ msgstr "" +#~ " Verdadero si la CADENA1 se ordena antes que la CADENA2 " +#~ "lexicográficamente" + +#~ msgid " STRING1 > STRING2" +#~ msgstr " CADENA1 > CADENA2" + +#~ msgid "" +#~ " True if STRING1 sorts after STRING2 lexicographically" +#~ msgstr "" +#~ " Verdadero si la CADENA1 se ordena después que la " +#~ "CADENA2 lexicográficamente" + +#~ msgid "Other operators:" +#~ msgstr "Otros operadores:" + +#~ msgid " ! EXPR True if expr is false." +#~ msgstr " ! EXPR Verdadero si la expr es falsa" + +#~ msgid " EXPR1 -a EXPR2 True if both expr1 AND expr2 are true." +#~ msgstr " EXPR1 -a EXPR2 Verdadero si ambas expr1 Y expr2 son verdaderas." + +#~ msgid " EXPR1 -o EXPR2 True if either expr1 OR expr2 is true." +#~ msgstr "" +#~ " EXPR1 -o EXPR2 Verdadero si cualquiera de expr1 O expr2 es verdadera." + +#~ msgid " arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne," +#~ msgstr " arg1 OP arg2 Pruebas aritméticas. OP es uno de -eq, -ne," + +#~ msgid " -lt, -le, -gt, or -ge." +#~ msgstr " -lt, -le, -gt, ó -ge." + +#~ msgid "Arithmetic binary operators return true if ARG1 is equal, not-equal," +#~ msgstr "" +#~ "Los operadores binarios aritméticos devuelven verdadero si ARG1 es igual, " +#~ "no igual," + +#~ msgid "" +#~ "less-than, less-than-or-equal, greater-than, or greater-than-or-equal" +#~ msgstr "menor, menor o igual, mayor, ó mayor o igual" + +#~ msgid "than ARG2." +#~ msgstr "que ARG2." + +#~ msgid "This is a synonym for the \"test\" builtin, but the last" +#~ msgstr "Es un sinónimo para la orden interna \"test\", pero el último" + +#~ msgid "the shell." +#~ msgstr "ejecutados desde el shell." + +#~ msgid "The command ARG is to be read and executed when the shell receives" +#~ msgstr "La orden ARG se lee y ejecuta cuando el shell recibe la(s)" + +#~ msgid "signal(s) SIGNAL_SPEC. If ARG is absent all specified signals are" +#~ msgstr "" +#~ "señal(es) ID_SEÑAL. Si ARG no está, todas las señales especificadas son" + +#~ msgid "reset to their original values. If ARG is the null string each" +#~ msgstr "" +#~ "establecidas a sus valores originales. Si ARG es la cadena nula cada" + +#~ msgid "SIGNAL_SPEC is ignored by the shell and by the commands it invokes." +#~ msgstr "ID_SEÑAL es ignorada por el shell y por las órdenes que invoque." + +#~ msgid "If SIGNAL_SPEC is EXIT (0) the command ARG is executed on exit from" +#~ msgstr "Si ID_SEÑAL es EXIT (0) la orden ARG se ejecuta al terminar el" + +#~ msgid "the shell. If SIGNAL_SPEC is DEBUG, ARG is executed after every" +#~ msgstr "shell. Si ID_SEÑAL es DEBUG, ARG se ejecuta después de cada" + +#~ msgid "command. If ARG is `-p' then the trap commands associated with" +#~ msgstr "orden. Si ARG es `-p' entonces se muestran las órdenes de captura" + +#~ msgid "each SIGNAL_SPEC are displayed. If no arguments are supplied or if" +#~ msgstr "asociadas con cada ID_SEÑAL. Si no se proporcionan argumentos o si" + +#~ msgid "only `-p' is given, trap prints the list of commands associated with" +#~ msgstr "" +#~ "sólo se proporciona `-p', trap muestra la lista de órdenes asociadas" + +#~ msgid "" +#~ "each signal number. SIGNAL_SPEC is either a signal name in " +#~ msgstr "" +#~ "con cada número de señal. ID_SEÑAL es un nombre de señal en " + +#~ msgid "" +#~ "or a signal number. `trap -l' prints a list of signal names and their" +#~ msgstr "" +#~ "o un número de señal. `trap -l' muestra una lista de nombres de señal y " +#~ "sus" + +#~ msgid "corresponding numbers. Note that a signal can be sent to the shell" +#~ msgstr "" +#~ "números correspondientes. Note que una señal se puede enviar al shell" + +#~ msgid "with \"kill -signal $$\"." +#~ msgstr "con \"kill -signal $$\"." + +#~ msgid "For each NAME, indicate how it would be interpreted if used as a" +#~ msgstr "Para cada NOMBRE, indica cómo sería interpretada si se usara como" + +#~ msgid "If the -t option is used, returns a single word which is one of" +#~ msgstr "Si se usa la opción -t, regresa una sola palabra que es una de" + +#~ msgid "" +#~ "`alias', `keyword', `function', `builtin', `file' or `', if NAME is an" +#~ msgstr "" +#~ "`alias', `keyword', `function', `builtin', `file' ó `', si el NOMBRE es un" + +#~ msgid "" +#~ "alias, shell reserved word, shell function, shell builtin, disk file," +#~ msgstr "" +#~ "alias, palabra reservada del shell, función del shell, orden interna del " +#~ "shell, fichero del disco," + +#~ msgid "or unfound, respectively." +#~ msgstr "o no encontrada, respectivamente." + +#~ msgid "If the -p flag is used, either returns the name of the disk file" +#~ msgstr "" +#~ "Si se usa el indicador -p, regresa el nombre del fichero del sistema" + +#~ msgid "that would be executed, or nothing if -t would not return `file'." +#~ msgstr "que sería ejecutado, o nada si -t no regresa algún `fichero'." + +#~ msgid "If the -a flag is used, displays all of the places that contain an" +#~ msgstr "" +#~ "Si se usa el indicador -a, muestra todos los lugares que contienen un" + +#~ msgid "" +#~ "executable named `file'. This includes aliases and functions, if and" +#~ msgstr "" +#~ "ejecutable llamado `fichero' Esto incluye a aliases y funciones, si y" + +#~ msgid "only if the -p flag is not also used." +#~ msgstr "sólo si el indicador -p no se especifica también." + +#~ msgid "Type accepts -all, -path, and -type in place of -a, -p, and -t," +#~ msgstr "Type acepta -all, -path, y -type en lugar de -a, -p, y -t," + +#~ msgid "respectively." +#~ msgstr "respectivamente." + +#~ msgid "Ulimit provides control over the resources available to processes" +#~ msgstr "" +#~ "ulimit provee control sobre los recursos disponibles para los procesos" + +#~ msgid "started by the shell, on systems that allow such control. If an" +#~ msgstr "" +#~ "iniciados por el shell, en sistemas que permiten dicho control. Si se" + +#~ msgid "option is given, it is interpreted as follows:" +#~ msgstr "establece una opción, se interpreta como sigue:" + +#~ msgid " -S\tuse the `soft' resource limit" +#~ msgstr " -S\tusa el límite de recurso `suave'" + +#~ msgid " -H\tuse the `hard' resource limit" +#~ msgstr " -H\tusa el límite de recurso `duro'" + +#~ msgid " -a\tall current limits are reported" +#~ msgstr " -a\tse muestran todos los límites actuales" + +#~ msgid " -c\tthe maximum size of core files created" +#~ msgstr " -c\tel tamaño máximo de los ficheros `core' creados" + +#~ msgid " -d\tthe maximum size of a process's data segment" +#~ msgstr " -d\tel tamaño máximo del segmento de datos de un proceso" + +#~ msgid " -m\tthe maximum resident set size" +#~ msgstr " -m\tel tamaño máximo para las variables residentes" + +#~ msgid " -s\tthe maximum stack size" +#~ msgstr " -s\tel tamaño máximo de la pila" + +#~ msgid " -t\tthe maximum amount of cpu time in seconds" +#~ msgstr " -t\tla cantidad máxima de tiempo de cpu en segundos" + +#~ msgid " -f\tthe maximum size of files created by the shell" +#~ msgstr " -f\tel número máximo de ficheros creados por el shell" + +#~ msgid " -p\tthe pipe buffer size" +#~ msgstr " -p\tel tamaño del almacenamiento intermedio para tuberías" + +#~ msgid " -n\tthe maximum number of open file descriptors" +#~ msgstr " -n\tel número máximo de descriptores de fichero abiertos" + +#~ msgid " -u\tthe maximum number of user processes" +#~ msgstr " -u\tel número máximo de procesos de usuario" + +#~ msgid " -v\tthe size of virtual memory" +#~ msgstr " -v\tel tamaño de la memoria virtual" + +#~ msgid "If LIMIT is given, it is the new value of the specified resource." +#~ msgstr "" +#~ "Si se establece el LÍMITE, este es el nuevo valor del recurso " +#~ "especificado." + +#~ msgid "Otherwise, the current value of the specified resource is printed." +#~ msgstr "" +#~ "De otra forma, se muestra la lista actual de los recursos especificados." + +#~ msgid "If no option is given, then -f is assumed. Values are in 1k" +#~ msgstr "" +#~ "Si no se establece una opción, entonces se asume -f. Los valores son en " +#~ "incrementos" + +#~ msgid "increments, except for -t, which is in seconds, -p, which is in" +#~ msgstr "de 1k, excepto para -t, que es en segundos, -p, que es en" + +#~ msgid "increments of 512 bytes, and -u, which is an unscaled number of" +#~ msgstr "incrementos de 512 bytes, y -u, que es un número no escalado de" + +#~ msgid "processes." +#~ msgstr "procesos." + +#~ msgid "" +#~ "The user file-creation mask is set to MODE. If MODE is omitted, or if" +#~ msgstr "" +#~ "La máscara de creación de ficheros del usuario se establece a MODO. Si " +#~ "se omite el MODO, o si" + +#~ msgid "" +#~ "`-S' is supplied, the current value of the mask is printed. The `-S'" +#~ msgstr "" +#~ "se proporciona `-S', se muestra el valor actual de la máscara. La opción" + +#~ msgid "" +#~ "option makes the output symbolic; otherwise an octal number is output." +#~ msgstr "" +#~ "`-S' logra una salida simbólica; de otra forma la salida es un número " +#~ "octal." + +#~ msgid "If MODE begins with a digit, it is interpreted as an octal number," +#~ msgstr "" +#~ "Si el MODO comienza con un dígito, se interpreta como un número octal," + +#~ msgid "" +#~ "otherwise it is a symbolic mode string like that accepted by chmod(1)." +#~ msgstr "" +#~ "de otra forma es una cadena de modo simbólico como la aceptada por " +#~ "chmod(1)." + +#~ msgid "" +#~ "Wait for the specified process and report its termination status. If" +#~ msgstr "Espera al proceso especificado y reporta su estado final. Si no se" + +#~ msgid "N is not given, all currently active child processes are waited for," +#~ msgstr "" +#~ "proporciona N, espera a todos los procesos hijo activos actualmente," + +#~ msgid "and the return code is zero. N may be a process ID or a job" +#~ msgstr "" +#~ "y el código de regreso es cero. N puede ser un ID de proceso o una " +#~ "especificación" + +#~ msgid "specification; if a job spec is given, all processes in the job's" +#~ msgstr "" +#~ "de trabajo; si se proporciona una especificación de trabajo, se espera a " +#~ "todos los procesos en la" + +#~ msgid "pipeline are waited for." +#~ msgstr "línea de ejecución del trabajo." + +#~ msgid "and the return code is zero. N is a process ID; if it is not given," +#~ msgstr "" +#~ "y el código de regreso es cero. N es un ID de proceso; si no se " +#~ "proporcioan," + +#~ msgid "all child processes of the shell are waited for." +#~ msgstr "espera a todos los procesos hijos del shell." + +#~ msgid "The `for' loop executes a sequence of commands for each member in a" +#~ msgstr "" +#~ "El ciclo `for' ejecuta una secuencia de órdenes para cada miembro en una" + +#~ msgid "" +#~ "list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is" +#~ msgstr "" +#~ "lista de elementos. Si `in PALABRAS ...;' no se encuentra, entonces se " +#~ "asume" + +#~ msgid "" +#~ "assumed. For each element in WORDS, NAME is set to that element, and" +#~ msgstr "" +#~ "`in \"$@\"'. Para cada elemento en PALABRAS, se establece NOMBRE a ese " +#~ "elemento y" + +#~ msgid "the COMMANDS are executed." +#~ msgstr "se ejecutan las ÓRDENES." + +#~ msgid "The WORDS are expanded, generating a list of words. The" +#~ msgstr "Las PALABRAS se expanden, generando una lista de palabras. El" + +#~ msgid "set of expanded words is printed on the standard error, each" +#~ msgstr "" +#~ "conjunto de palabras expandidas se muestra en la salida de error estándar" + +#~ msgid "preceded by a number. If `in WORDS' is not present, `in \"$@\"'" +#~ msgstr "" +#~ "cada una precedida por un número. Si `in PALABRAS' no se encuentra, se " +#~ "asume" + +#~ msgid "is assumed. The PS3 prompt is then displayed and a line read" +#~ msgstr "`in \"$@\"'. El prompt PS3 se muestra y se lee una línea de" + +#~ msgid "from the standard input. If the line consists of the number" +#~ msgstr "la entrada estándar. Si la línea consiste del número" + +#~ msgid "corresponding to one of the displayed words, then NAME is set" +#~ msgstr "" +#~ "correspondiente a una de las palabras mostradas, entonces se establece " +#~ "NOMBRE" + +#~ msgid "to that word. If the line is empty, WORDS and the prompt are" +#~ msgstr "a esa palabra. Si la línea está vacía, se muestran de nuevo" + +#~ msgid "redisplayed. If EOF is read, the command completes. Any other" +#~ msgstr "" +#~ "las PALABRAS y el prompt. Si se lee EOF, la orden se completa. Cualquier " +#~ "otro" + +#~ msgid "value read causes NAME to be set to null. The line read is saved" +#~ msgstr "valor leído causa que NOMBRE sea nulo. La línea leída se salva en" + +#~ msgid "in the variable REPLY. COMMANDS are executed after each selection" +#~ msgstr "" +#~ "la variable REPLY. Las ÓRDENES se ejecutan después de cada selección" + +#~ msgid "until a break or return command is executed." +#~ msgstr "hasta que se ejecute una orden break ó return." + +#~ msgid "`|' is used to separate multiple patterns." +#~ msgstr "`|' se usa para separar plantillas múltiples." + +#~ msgid "" +#~ "The if COMMANDS are executed. If the exit status is zero, then the then" +#~ msgstr "" +#~ "Las ÓRDENES if se ejecutan. Si el código de regreso es cero, entonces " +#~ "las ÓRDENES" + +#~ msgid "" +#~ "COMMANDS are executed. Otherwise, each of the elif COMMANDS are executed" +#~ msgstr "" +#~ "then se ejecutan. De otra forma, cada uno de las ÓRDENES elif se ejecutan" + +#~ msgid "" +#~ "in turn, and if the exit status is zero, the corresponding then COMMANDS" +#~ msgstr "" +#~ "en turno, y si el código de regreso es cero, las ÓRDENES then " +#~ "correspondientes" + +#~ msgid "" +#~ "are executed and the if command completes. Otherwise, the else COMMANDS" +#~ msgstr "" +#~ "se ejecutan y la orden if se completa. De otra forma, las ÓRDENES else" + +#~ msgid "" +#~ "are executed, if present. The exit status is the exit status of the last" +#~ msgstr "" +#~ "se ejecutan, si se encuentran. El código de salida es el código de " +#~ "salida de la última" + +#~ msgid "command executed, or zero if no condition tested true." +#~ msgstr "orden ejecutada, o cero si ninguna condición probada fue verdadera." + +#~ msgid "`while' COMMANDS has an exit status of zero." +#~ msgstr "`while' tenga un código de salida de cero." + +#~ msgid "`until' COMMANDS has an exit status which is not zero." +#~ msgstr "`until' tenga un código de salida que no sea cero." + +#~ msgid "Create a simple command invoked by NAME which runs COMMANDS." +#~ msgstr "" +#~ "Crea un comando simple invocado por el NOMBRE que ejecuta las ÓRDENES." + +#~ msgid "Arguments on the command line along with NAME are passed to the" +#~ msgstr "" +#~ "Los argumentos en la línea de comando junto con el NOMBRE se pasan a la" + +#~ msgid "function as $0 .. $n." +#~ msgstr "función como $0 .. $n." + +#~ msgid "entire set of commands." +#~ msgstr "conjunto completo de órdenes" + +#~ msgid "This is similar to the `fg' command. Resume a stopped or background" +#~ msgstr "" +#~ "Esto es similar a la orden `fg'. Reinicia un trabajo detenido o en el" + +#~ msgid "job. If you specifiy DIGITS, then that job is used. If you specify" +#~ msgstr "" +#~ "background. Si especifica DÍGITOS, entonces se usa ese trabajo. Si " +#~ "proporciona" + +#~ msgid "" +#~ "WORD, then the job whose name begins with WORD is used. Following the" +#~ msgstr "" +#~ "una PALABRA, entonces se usa el trabajo cuyo nombre comience con PALABRA." + +#~ msgid "job specification with a `&' places the job in the background." +#~ msgstr "" +#~ "Al colocar una especificación de trabajo seguido de un `&', se coloca al " +#~ "trabajo en el background. " + +#~ msgid "BASH_VERSION The version numbers of this Bash." +#~ msgstr "BASH_VERSION Los números de versión de este Bash." + +#~ msgid "CDPATH A colon separated list of directories to search" +#~ msgstr "CDPATH Una lista separada por `:' de directorios a buscar" + +#~ msgid "\t\twhen the argument to `cd' is not found in the current" +#~ msgstr "\t\tcuando el argumento para `cd' no se encuentra en el directorio" + +#~ msgid "\t\tdirectory." +#~ msgstr "\t\tactual." + +#~ msgid "" +#~ "HISTFILE The name of the file where your command history is stored." +#~ msgstr "" +#~ "HISTFILE El nombre del fichero donde se guarda la historia de " +#~ "órdenes." + +#~ msgid "HISTFILESIZE The maximum number of lines this file can contain." +#~ msgstr "" +#~ "HISTFILESIZE El número máximo de líneas que este fichero puede " +#~ "contener." + +#~ msgid "HISTSIZE The maximum number of history lines that a running" +#~ msgstr "HISTSIZE El número máximo de líneas de historia que un shell" + +#~ msgid "\t\tshell can access." +#~ msgstr "\t\ten ejecución puede acceder." + +#~ msgid "HOME The complete pathname to your login directory." +#~ msgstr "" +#~ "HOME La ruta completa a su directorio de entrada (login)." + +#~ msgid "" +#~ "HOSTTYPE The type of CPU this version of Bash is running under." +#~ msgstr "" +#~ "HOSTTYPE El tipo de CPU bajo el cual esta versión de Bash corre." + +#~ msgid "" +#~ "IGNOREEOF Controls the action of the shell on receipt of an EOF" +#~ msgstr "" +#~ "IGNOREEOF Controla la acción del shell al recibir un carácter EOF" + +#~ msgid "\t\tcharacter as the sole input. If set, then the value" +#~ msgstr "\t\tcomo la única entrada. Si se establece, entonces el valor" + +#~ msgid "\t\tof it is the number of EOF characters that can be seen" +#~ msgstr "" +#~ "\t\tde esta variable es el número de caracteres EOF que se pueden recibir" + +#~ msgid "\t\tin a row on an empty line before the shell will exit" +#~ msgstr "" +#~ "\t\ten forma seguida en una línea vacía antes de que el shell termine" + +#~ msgid "\t\t(default 10). When unset, EOF signifies the end of input." +#~ msgstr "" +#~ "\t\t(10 por omisión). Cuando se desactiva, EOF significa el fin de la " +#~ "entrada." + +#~ msgid "MAILCHECK\tHow often, in seconds, Bash checks for new mail." +#~ msgstr "" +#~ "MAILCHECK\tQue tan seguido, en segundos, Bash revisa si hay correo nuevo." + +#~ msgid "MAILPATH\tA colon-separated list of filenames which Bash checks" +#~ msgstr "" +#~ "MAILPATH\tUna lista de nombres de fichero separados por dos puntos que " +#~ "Bash revisa" + +#~ msgid "\t\tfor new mail." +#~ msgstr "\t\tpor correo nuevo." + +#~ msgid "OSTYPE\t\tThe version of Unix this version of Bash is running on." +#~ msgstr "" +#~ "OSTYPE\t\tLa versión de Unix bajo la cual esta versión de Bash se ejecuta." + +#~ msgid "PATH A colon-separated list of directories to search when" +#~ msgstr "" +#~ "PATH Una lista de directorios separada por dos puntos para " +#~ "buscar" + +#~ msgid "\t\tlooking for commands." +#~ msgstr "\t\tcuando se requieren órdenes." + +#~ msgid "PROMPT_COMMAND A command to be executed before the printing of each" +#~ msgstr "PROMPT_COMMAND Una orden a ejecutar antes de mostrar cada" + +#~ msgid "\t\tprimary prompt." +#~ msgstr "\t\tprompt primario." + +#~ msgid "PS1 The primary prompt string." +#~ msgstr "PS1 La cadena primaria de prompt." + +#~ msgid "PS2 The secondary prompt string." +#~ msgstr "PS2 La cadena secundaria de prompt." + +#~ msgid "TERM The name of the current terminal type." +#~ msgstr "TERM El nombre del tipo de terminal actual." + +#~ msgid "auto_resume Non-null means a command word appearing on a line by" +#~ msgstr "" +#~ "auto_resume Si no es nulo significa que una palabra de orden que " +#~ "aparece en una línea" + +#~ msgid "\t\titself is first looked for in the list of currently" +#~ msgstr "\t\tpor sí mismo se busca primero en la lista de trabajos detenidos" + +#~ msgid "\t\tstopped jobs. If found there, that job is foregrounded." +#~ msgstr "" +#~ "\t\tactualmente. Si se encuentra ahí, ese trabajo se trae a primer plano." + +#~ msgid "\t\tA value of `exact' means that the command word must" +#~ msgstr "\t\tEl valor `exact' significa que la palabra de la orden debe" + +#~ msgid "\t\texactly match a command in the list of stopped jobs. A" +#~ msgstr "" +#~ "\t\tcoincidir exactamente con una orden en la lista de trabajos " +#~ "detenidos. El" + +#~ msgid "\t\tvalue of `substring' means that the command word must" +#~ msgstr "\t\tvalor `substring' significa que la palabra de la orden debe" + +#~ msgid "\t\tmatch a substring of the job. Any other value means that" +#~ msgstr "" +#~ "\t\tcoincidir con una subcadena del trabajo. Cualquier otro valor " +#~ "significa que" + +#~ msgid "\t\tthe command must be a prefix of a stopped job." +#~ msgstr "\t\tla orden debe ser un prefijo de un trabajo detenido." + +#~ msgid "command_oriented_history" +#~ msgstr "command_oriented_history" + +#~ msgid "" +#~ " Non-null means to save multiple-line commands together on" +#~ msgstr "" +#~ " Si no es nulo significa que debe guardar órdenes de " +#~ "varias líneas juntas en" + +#~ msgid " a single history line." +#~ msgstr " una sola línea de historia." + +#~ msgid "histchars Characters controlling history expansion and quick" +#~ msgstr "" +#~ "histchars Caracteres que controlan la expansión de la historia y la" + +#~ msgid "\t\tsubstitution. The first character is the history" +#~ msgstr "\t\tsustitución rápida. El primer carácter es el carácter de" + +#~ msgid "\t\tsubstitution character, usually `!'. The second is" +#~ msgstr "\t\tsustutución de historia, generalmente `!'. El segundo es" + +#~ msgid "\t\tthe `quick substitution' character, usually `^'. The" +#~ msgstr "\t\tel carácter de `sustitución rápida', generalmente `^'. El" + +#~ msgid "\t\tthird is the `history comment' character, usually `#'." +#~ msgstr "" +#~ "\t\ttercero es el carácter de `comentario de historia', generalmente `#'." + +#~ msgid "HISTCONTROL\tSet to a value of `ignorespace', it means don't enter" +#~ msgstr "" +#~ "HISTCONTROL\tEstablecido con el valor `ignorespace', significa que no " +#~ "agrega" + +#~ msgid "\t\tlines which begin with a space or tab on the history" +#~ msgstr "\t\tlíneas que inicien con un espacio o tabulador a la lista de" + +#~ msgid "\t\tlist. Set to a value of `ignoredups', it means don't" +#~ msgstr "\t\thistoria. Con el valor `ignoredups', significa que no agrega" + +#~ msgid "\t\tenter lines which match the last entered line. Set to" +#~ msgstr "\t\tlíneas que coincidan con la última línea introducida. Con" + +#~ msgid "\t\t`ignoreboth' means to combine the two options. Unset," +#~ msgstr "" +#~ "\t\t`ignoreboth' significa que combina las dos opciones. Sin establecer," + +#~ msgid "\t\tor set to any other value than those above means to save" +#~ msgstr "" +#~ "\t\to con cualquier otro valor diferente a los arriba mencionados " +#~ "significa" + +#~ msgid "\t\tall lines on the history list." +#~ msgstr "\t\tguardar todas las líneas en la lista de la historia." + +#~ msgid "Toggle the values of variables controlling optional behavior." +#~ msgstr "" +#~ "Cambia los valores de las variables que controlan conductas opcionales." + +#~ msgid "The -s flag means to enable (set) each OPTNAME; the -u flag" +#~ msgstr "" +#~ "El indicador -s significa establecer cada NOMBRE_OPCIÓN; el indicador -u" + +#~ msgid "unsets each OPTNAME. The -q flag suppresses output; the exit" +#~ msgstr "" +#~ "borra cada NOMBRE_OPCIÓN. El indicador -q suprime la salida; el estado" + +#~ msgid "status indicates whether each OPTNAME is set or unset. The -o" +#~ msgstr "de salida indica cuál NOMBRE_OPCIÓN está activado o no. La opción" + +#~ msgid "option restricts the OPTNAMEs to those defined for use with" +#~ msgstr "" +#~ "-o restringe a los NOMBRE_OPCIONes a aquéllos definidos para su uso con" + +#~ msgid "`set -o'. With no options, or with the -p option, a list of all" +#~ msgstr "" +#~ "`set -o'. Sin opciones, o con la opción -p, se muestra una lista de" + +#~ msgid "settable options is displayed, with an indication of whether or" +#~ msgstr "todas las opciones activables, con una indicación de si se puede" + +#~ msgid "not each is set." +#~ msgstr "o no activar cada una." diff --git a/po/et.gmo b/po/et.gmo new file mode 100644 index 0000000000000000000000000000000000000000..da10b86f328f0e18001cdc11d13b00faf46a22f9 GIT binary patch literal 12133 zcma)>dypkneaD-K1O||xBt~7dSs7>1y|XjBfb3=Exx28!vJ1PsU1$2<+jFPq_U*p( zV|GVkOo9j!HHl~lSc#R2Nl}Re4f!J}iKR(ZNEKCD1yU*hP*c{X@(?UiW}(X3NIu_l zPWSDZSsq<`=6n0}dHl}reSZ7Hx1Rh(kLMBE2HNu{d)~9)lc({A=hQPj@2%iz;Jd*M z;5p!>;ID!EK@IJLXM=aS{(Brg0-j6%*TJ*E?}Bdwe+0fA{28cqPJfHVjiA=w4vL-| z!1sXz@K?dlJA4$J=KY(X=z0OvI%lxSuY>Oe-v#afwf}9P_FV=yf)BX&$G~6V{oA0% zJp*c=7ag9$N1cBI*aEkJ8h?mC?*J3dPI&hsd!@!xXq&w|?bC!i0$;=cPZOYhr2 z(R~mUy#rA5?*k#hd&Ir}C8%-#0BWD_f!hCh@SWf(OoEl(d7#d*1r%L-LGf?s`o93` ze1GHcUqD#r{Sef+7r<@cIS?&+t_3BJ9{65x1r!~B44w}DEyxt_Ti_Ysv!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3cRiJ6jUzXZ~;jP z9&(6^I9%c;n2d`^a(7%_s|ph7F}H~TFXV1^gu0O85*4Ic@dwBF@5;?i1TrB*R#DfI zNMF}ilAMCtvWmGvdiilmNnDutKYL>1syAQtsfhoti6d@1RVIuwtsYg`=i2^33d2m* zWc7q*DXF)RWy-WaT+As7|dIJeO$Y^b2+ZA6s`a4 z=rVqW;?}OW1D(hU65|ebHt|vJfoI60exHh-Y@F?Y+d7?2TQhVi)Dc50AGo>no z>`LDdygUw$vhsYo8m+D, 2006. +# +msgid "" +msgstr "" +"Project-Id-Version: bash 3.2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-02-11 11:19-0500\n" +"PO-Revision-Date: 2006-11-11 16:38+0200\n" +"Last-Translator: Toomas Soome \n" +"Language-Team: Estonian \n" +"Language: et\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-15\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: arrayfunc.c:51 +msgid "bad array subscript" +msgstr "vigane massiivi indeks" + +#: arrayfunc.c:356 builtins/declare.def:566 +#, c-format +msgid "%s: cannot convert indexed to associative array" +msgstr "" + +#: arrayfunc.c:539 +#, fuzzy, c-format +msgid "%s: invalid associative array key" +msgstr "%s: vigane tegevuse nimi" + +#: arrayfunc.c:541 +#, c-format +msgid "%s: cannot assign to non-numeric index" +msgstr "%s: mitte-numbrilisele indeksile ei saa omistada" + +#: arrayfunc.c:586 +#, c-format +msgid "%s: %s: must use subscript when assigning associative array" +msgstr "" + +#: bashhist.c:388 +#, c-format +msgid "%s: cannot create: %s" +msgstr "%s: ei saa luua: %s" + +#: bashline.c:3982 +msgid "bash_execute_unix_command: cannot find keymap for command" +msgstr "" + +#: bashline.c:4069 +#, c-format +msgid "%s: first non-whitespace character is not `\"'" +msgstr "%s: esimine mitte-tühemik sümbol pole `\"'" + +#: bashline.c:4098 +#, c-format +msgid "no closing `%c' in %s" +msgstr "sulgev `%c' puudub %s sees" + +#: bashline.c:4132 +#, c-format +msgid "%s: missing colon separator" +msgstr "%s: puudub eraldav koolon" + +#: braces.c:321 +#, c-format +msgid "brace expansion: cannot allocate memory for %s" +msgstr "" + +#: braces.c:413 +#, c-format +msgid "brace expansion: failed to allocate memory for %d elements" +msgstr "" + +#: braces.c:452 +#, c-format +msgid "brace expansion: failed to allocate memory for `%s'" +msgstr "" + +#: builtins/alias.def:132 +#, fuzzy, c-format +msgid "`%s': invalid alias name" +msgstr "%s: vigane tegevuse nimi" + +#: builtins/bind.def:123 builtins/bind.def:126 +msgid "line editing not enabled" +msgstr "" + +#: builtins/bind.def:212 +#, c-format +msgid "`%s': invalid keymap name" +msgstr "" + +#: builtins/bind.def:251 +#, c-format +msgid "%s: cannot read: %s" +msgstr "%s: ei saa lugeda: %s" + +#: builtins/bind.def:266 +#, c-format +msgid "`%s': cannot unbind" +msgstr "`%s': ei saa lahti siduda" + +#: builtins/bind.def:304 builtins/bind.def:334 +#, c-format +msgid "`%s': unknown function name" +msgstr "`%s': tundmatu funktsiooni nimi" + +#: builtins/bind.def:312 +#, c-format +msgid "%s is not bound to any keys.\n" +msgstr "%s ei ole seotud ühegi klahviga.\n" + +#: builtins/bind.def:316 +#, c-format +msgid "%s can be invoked via " +msgstr "%s saab kasutada läbi " + +#: builtins/break.def:77 builtins/break.def:117 +msgid "loop count" +msgstr "" + +#: builtins/break.def:137 +msgid "only meaningful in a `for', `while', or `until' loop" +msgstr "omab mõtet ainult `for', `while' või `until' tsüklis" + +#: builtins/caller.def:134 +#, fuzzy +msgid "" +"Returns the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns " +msgstr "Tagastab jooksva alamprotseduuri konteksti." + +#: builtins/cd.def:319 +msgid "HOME not set" +msgstr "HOME pole seatud" + +#: builtins/cd.def:327 builtins/common.c:166 test.c:876 +msgid "too many arguments" +msgstr "liiga palju argumente" + +#: builtins/cd.def:338 +msgid "OLDPWD not set" +msgstr "OLDPWD pole seatud" + +#: builtins/common.c:101 +#, c-format +msgid "line %d: " +msgstr "" + +#: builtins/common.c:139 error.c:265 +#, fuzzy, c-format +msgid "warning: " +msgstr "%s: hoiatus: " + +#: builtins/common.c:153 +#, fuzzy, c-format +msgid "%s: usage: " +msgstr "%s: hoiatus: " + +#: builtins/common.c:191 shell.c:506 shell.c:788 +#, c-format +msgid "%s: option requires an argument" +msgstr "%s: võti nõuab argumenti" + +#: builtins/common.c:198 +#, c-format +msgid "%s: numeric argument required" +msgstr "%s: nõutakse numbrilist argumenti" + +#: builtins/common.c:205 +#, c-format +msgid "%s: not found" +msgstr "%s: ei leitud" + +#: builtins/common.c:214 shell.c:801 +#, c-format +msgid "%s: invalid option" +msgstr "%s: vigane võti" + +#: builtins/common.c:221 +#, c-format +msgid "%s: invalid option name" +msgstr "%s: vigane võtme nimi" + +#: builtins/common.c:228 general.c:235 general.c:240 +#, c-format +msgid "`%s': not a valid identifier" +msgstr "`%s': ei ole lubatud identifikaator" + +#: builtins/common.c:238 +#, fuzzy +msgid "invalid octal number" +msgstr "vigane signaali number" + +#: builtins/common.c:240 +#, fuzzy +msgid "invalid hex number" +msgstr "vigane number" + +#: builtins/common.c:242 expr.c:1470 +msgid "invalid number" +msgstr "vigane number" + +#: builtins/common.c:250 +#, c-format +msgid "%s: invalid signal specification" +msgstr "%s: vigane signaali spetsifikatsioon" + +#: builtins/common.c:257 +#, c-format +msgid "`%s': not a pid or valid job spec" +msgstr "`%s': ei ole pid ega korrektne töö spetsifikatsioon" + +#: builtins/common.c:264 error.c:488 +#, c-format +msgid "%s: readonly variable" +msgstr "%s: mittemuudetav muutuja" + +#: builtins/common.c:272 +#, c-format +msgid "%s: %s out of range" +msgstr "%s: %s on piiridest väljas" + +#: builtins/common.c:272 builtins/common.c:274 +msgid "argument" +msgstr "argument" + +#: builtins/common.c:274 +#, c-format +msgid "%s out of range" +msgstr "%s on piiridest väljas" + +#: builtins/common.c:282 +#, c-format +msgid "%s: no such job" +msgstr "%s: sellist tööd pole" + +#: builtins/common.c:290 +#, c-format +msgid "%s: no job control" +msgstr "%s: töökontroll puudub" + +#: builtins/common.c:292 +msgid "no job control" +msgstr "töökontroll puudub" + +#: builtins/common.c:302 +#, c-format +msgid "%s: restricted" +msgstr "%s: piiratud" + +#: builtins/common.c:304 +msgid "restricted" +msgstr "piiratud" + +#: builtins/common.c:312 +#, c-format +msgid "%s: not a shell builtin" +msgstr "%s: ei ole sisekäsk" + +#: builtins/common.c:321 +#, c-format +msgid "write error: %s" +msgstr "kirjutamise viga: %s" + +#: builtins/common.c:329 +#, c-format +msgid "error setting terminal attributes: %s" +msgstr "" + +#: builtins/common.c:331 +#, c-format +msgid "error getting terminal attributes: %s" +msgstr "" + +#: builtins/common.c:563 +#, c-format +msgid "%s: error retrieving current directory: %s: %s\n" +msgstr "" + +#: builtins/common.c:629 builtins/common.c:631 +#, c-format +msgid "%s: ambiguous job spec" +msgstr "%s: segane töö" + +#: builtins/complete.def:277 +#, c-format +msgid "%s: invalid action name" +msgstr "%s: vigane tegevuse nimi" + +#: builtins/complete.def:450 builtins/complete.def:645 +#: builtins/complete.def:855 +#, c-format +msgid "%s: no completion specification" +msgstr "" + +#: builtins/complete.def:697 +msgid "warning: -F option may not work as you expect" +msgstr "hoiatus: võti -F ei pruugi töötada nagu te ootate" + +#: builtins/complete.def:699 +msgid "warning: -C option may not work as you expect" +msgstr "hoiatus: võti -C ei pruugi töötada nagu te ootate" + +#: builtins/complete.def:828 +msgid "not currently executing completion function" +msgstr "" + +#: builtins/declare.def:126 +msgid "can only be used in a function" +msgstr "saab kasutada ainult funktsioonis" + +#: builtins/declare.def:315 builtins/declare.def:509 +#, c-format +msgid "%s: reference variable cannot be an array" +msgstr "" + +#: builtins/declare.def:324 +#, c-format +msgid "%s: nameref variable self references not allowed" +msgstr "" + +#: builtins/declare.def:398 +msgid "cannot use `-f' to make functions" +msgstr "võtit `-f' ei saa funktsiooni loomiseks kasutada" + +#: builtins/declare.def:410 execute_cmd.c:5361 +#, c-format +msgid "%s: readonly function" +msgstr "%s: funktsioon ei ole muudetav" + +#: builtins/declare.def:553 +#, c-format +msgid "%s: cannot destroy array variables in this way" +msgstr "%s: masiivi muutujaid ei saa nii kustutada" + +#: builtins/declare.def:560 builtins/read.def:733 +#, c-format +msgid "%s: cannot convert associative to indexed array" +msgstr "" + +#: builtins/enable.def:137 builtins/enable.def:145 +msgid "dynamic loading not available" +msgstr "dünaamilist laadimist et saa kasutada" + +#: builtins/enable.def:312 +#, c-format +msgid "cannot open shared object %s: %s" +msgstr "jagatud objekti %s ei saa avada: %s" + +#: builtins/enable.def:335 +#, c-format +msgid "cannot find %s in shared object %s: %s" +msgstr "%s puudub jagatud objektis %s: %s" + +#: builtins/enable.def:459 +#, c-format +msgid "%s: not dynamically loaded" +msgstr "%s: pole dünaamiliselt laetud" + +#: builtins/enable.def:474 +#, c-format +msgid "%s: cannot delete: %s" +msgstr "%s: ei saa kustutada: %s" + +#: builtins/evalfile.c:140 builtins/hash.def:171 execute_cmd.c:5208 +#: shell.c:1481 +#, c-format +msgid "%s: is a directory" +msgstr "%s: on kataloog" + +#: builtins/evalfile.c:146 +#, c-format +msgid "%s: not a regular file" +msgstr "%s: ei ole tavaline fail" + +#: builtins/evalfile.c:155 +#, c-format +msgid "%s: file is too large" +msgstr "%s: fail on liiga suur" + +#: builtins/evalfile.c:190 builtins/evalfile.c:208 shell.c:1491 +#, c-format +msgid "%s: cannot execute binary file" +msgstr "%s: kahendfaili ei õnnestu käivitada" + +#: builtins/exec.def:154 builtins/exec.def:156 builtins/exec.def:228 +#, c-format +msgid "%s: cannot execute: %s" +msgstr "%s: ei saa käivitada: %s" + +#: builtins/exit.def:65 +#, c-format +msgid "logout\n" +msgstr "" + +#: builtins/exit.def:88 +msgid "not login shell: use `exit'" +msgstr "pole login shell: kasutage `exit'" + +#: builtins/exit.def:120 +#, c-format +msgid "There are stopped jobs.\n" +msgstr "Teil on peatatud töid.\n" + +#: builtins/exit.def:122 +#, fuzzy, c-format +msgid "There are running jobs.\n" +msgstr "Teil on peatatud töid.\n" + +#: builtins/fc.def:262 +msgid "no command found" +msgstr "käsku ei ole" + +#: builtins/fc.def:320 builtins/fc.def:369 +msgid "history specification" +msgstr "" + +#: builtins/fc.def:390 +#, c-format +msgid "%s: cannot open temp file: %s" +msgstr "%s: ajutist faili ei saa avada: %s" + +#: builtins/fg_bg.def:149 builtins/jobs.def:282 +msgid "current" +msgstr "" + +#: builtins/fg_bg.def:158 +#, c-format +msgid "job %d started without job control" +msgstr "" + +#: builtins/getopt.c:110 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: lubamatu võti -- %c\n" + +#: builtins/getopt.c:111 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: võti nõuab argumenti -- %c\n" + +#: builtins/hash.def:92 +msgid "hashing disabled" +msgstr "" + +#: builtins/hash.def:138 +#, c-format +msgid "%s: hash table empty\n" +msgstr "" + +#: builtins/hash.def:245 +#, fuzzy, c-format +msgid "hits\tcommand\n" +msgstr "viimane käsklus: %s\n" + +#: builtins/help.def:130 +#, c-format +msgid "Shell commands matching keyword `" +msgid_plural "Shell commands matching keywords `" +msgstr[0] "" +msgstr[1] "" + +#: builtins/help.def:182 +#, c-format +msgid "" +"no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." +msgstr "" + +#: builtins/help.def:199 +#, c-format +msgid "%s: cannot open: %s" +msgstr "%s: ei saa avada: %s" + +#: builtins/help.def:485 +#, c-format +msgid "" +"These shell commands are defined internally. Type `help' to see this list.\n" +"Type `help name' to find out more about the function `name'.\n" +"Use `info bash' to find out more about the shell in general.\n" +"Use `man -k' or `info' to find out more about commands not in this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" +msgstr "" + +#: builtins/history.def:154 +msgid "cannot use more than one of -anrw" +msgstr "" + +#: builtins/history.def:186 +msgid "history position" +msgstr "" + +#: builtins/history.def:366 +#, c-format +msgid "%s: history expansion failed" +msgstr "" + +#: builtins/inlib.def:71 +#, fuzzy, c-format +msgid "%s: inlib failed" +msgstr "%s: vigane teenus" + +#: builtins/jobs.def:109 +msgid "no other options allowed with `-x'" +msgstr "" + +#: builtins/kill.def:200 +#, c-format +msgid "%s: arguments must be process or job IDs" +msgstr "" + +#: builtins/kill.def:263 +msgid "Unknown error" +msgstr "Tundmatu viga" + +#: builtins/let.def:95 builtins/let.def:120 expr.c:583 expr.c:598 +msgid "expression expected" +msgstr "oodati avaldist" + +#: builtins/mapfile.def:172 +#, fuzzy, c-format +msgid "%s: not an indexed array" +msgstr "%s: pole massiiv" + +#: builtins/mapfile.def:259 builtins/read.def:302 +#, c-format +msgid "%s: invalid file descriptor specification" +msgstr "" + +#: builtins/mapfile.def:267 builtins/read.def:309 +#, c-format +msgid "%d: invalid file descriptor: %s" +msgstr "" + +#: builtins/mapfile.def:276 builtins/mapfile.def:314 +#, fuzzy, c-format +msgid "%s: invalid line count" +msgstr "%s: vigane võti" + +#: builtins/mapfile.def:287 +#, fuzzy, c-format +msgid "%s: invalid array origin" +msgstr "%s: vigane võti" + +#: builtins/mapfile.def:304 +#, fuzzy, c-format +msgid "%s: invalid callback quantum" +msgstr "%s: vigane tegevuse nimi" + +#: builtins/mapfile.def:336 +#, fuzzy +msgid "empty array variable name" +msgstr "%s: pole massiiv" + +#: builtins/mapfile.def:357 +msgid "array variable support required" +msgstr "" + +#: builtins/printf.def:402 +#, c-format +msgid "`%s': missing format character" +msgstr "" + +#: builtins/printf.def:456 +#, fuzzy, c-format +msgid "`%c': invalid time format specification" +msgstr "%s: vigane signaali spetsifikatsioon" + +#: builtins/printf.def:658 +#, c-format +msgid "`%c': invalid format character" +msgstr "" + +#: builtins/printf.def:684 +#, fuzzy, c-format +msgid "warning: %s: %s" +msgstr "%s: hoiatus: " + +#: builtins/printf.def:768 +#, c-format +msgid "format parsing problem: %s" +msgstr "" + +#: builtins/printf.def:865 +msgid "missing hex digit for \\x" +msgstr "" + +#: builtins/printf.def:880 +#, c-format +msgid "missing unicode digit for \\%c" +msgstr "" + +#: builtins/pushd.def:195 +msgid "no other directory" +msgstr "teist kataloogi pole" + +#: builtins/pushd.def:354 +#, fuzzy, c-format +msgid "%s: invalid argument" +msgstr "%s: vigane number" + +#: builtins/pushd.def:468 +msgid "" +msgstr "" + +#: builtins/pushd.def:512 +msgid "directory stack empty" +msgstr "" + +#: builtins/pushd.def:514 +msgid "directory stack index" +msgstr "" + +#: builtins/pushd.def:689 +msgid "" +"Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +"\tdirs when invoked without options, starting with zero." +msgstr "" + +#: builtins/pushd.def:711 +msgid "" +"Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" + +#: builtins/pushd.def:736 +msgid "" +"Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" + +#: builtins/read.def:275 +#, c-format +msgid "%s: invalid timeout specification" +msgstr "" + +#: builtins/read.def:678 +#, c-format +msgid "read error: %d: %s" +msgstr "viga lugemisel: %d: %s" + +#: builtins/return.def:75 +msgid "can only `return' from a function or sourced script" +msgstr "" + +#: builtins/set.def:782 +msgid "cannot simultaneously unset a function and a variable" +msgstr "" + +#: builtins/set.def:826 +#, c-format +msgid "%s: cannot unset" +msgstr "%s: ei saa eemaldada" + +#: builtins/set.def:843 +#, c-format +msgid "%s: cannot unset: readonly %s" +msgstr "%s: ei saa eemaldada: %s on ainult lugemiseks" + +#: builtins/set.def:854 +#, c-format +msgid "%s: not an array variable" +msgstr "%s: pole massiiv" + +#: builtins/setattr.def:187 +#, c-format +msgid "%s: not a function" +msgstr "%s: ei ole funktsioon" + +#: builtins/shift.def:71 builtins/shift.def:77 +msgid "shift count" +msgstr "shift arv" + +#: builtins/shopt.def:279 +msgid "cannot set and unset shell options simultaneously" +msgstr "" + +#: builtins/shopt.def:346 +#, c-format +msgid "%s: invalid shell option name" +msgstr "" + +#: builtins/source.def:130 +msgid "filename argument required" +msgstr "" + +#: builtins/source.def:155 +#, c-format +msgid "%s: file not found" +msgstr "%s: faili ei ole" + +#: builtins/suspend.def:101 +msgid "cannot suspend" +msgstr "peatamine ei õnnestu" + +#: builtins/suspend.def:111 +msgid "cannot suspend a login shell" +msgstr "login shelli ei saa peatada" + +#: builtins/type.def:234 +#, c-format +msgid "%s is aliased to `%s'\n" +msgstr "" + +#: builtins/type.def:255 +#, c-format +msgid "%s is a shell keyword\n" +msgstr "%s on shelli võtmesõna\n" + +#: builtins/type.def:274 +#, c-format +msgid "%s is a function\n" +msgstr "%s: on funktsioon\n" + +#: builtins/type.def:296 +#, c-format +msgid "%s is a shell builtin\n" +msgstr "%s on shelli sisekäsk\n" + +#: builtins/type.def:317 builtins/type.def:393 +#, c-format +msgid "%s is %s\n" +msgstr "%s on %s\n" + +#: builtins/type.def:337 +#, c-format +msgid "%s is hashed (%s)\n" +msgstr "" + +#: builtins/ulimit.def:383 +#, c-format +msgid "%s: invalid limit argument" +msgstr "" + +#: builtins/ulimit.def:409 +#, c-format +msgid "`%c': bad command" +msgstr "`%c': halb käsklus" + +#: builtins/ulimit.def:438 +#, c-format +msgid "%s: cannot get limit: %s" +msgstr "%s: ei õnnestu lugeda piirangut: %s" + +#: builtins/ulimit.def:464 +msgid "limit" +msgstr "" + +#: builtins/ulimit.def:476 builtins/ulimit.def:776 +#, c-format +msgid "%s: cannot modify limit: %s" +msgstr "%s: ei õnnestu muuta piirangut: %s" + +#: builtins/umask.def:114 +msgid "octal number" +msgstr "kaheksandnumber" + +#: builtins/umask.def:227 +#, c-format +msgid "`%c': invalid symbolic mode operator" +msgstr "" + +#: builtins/umask.def:282 +#, c-format +msgid "`%c': invalid symbolic mode character" +msgstr "" + +#: error.c:90 error.c:325 error.c:327 error.c:329 +msgid " line " +msgstr "" + +#: error.c:165 +#, c-format +msgid "last command: %s\n" +msgstr "viimane käsklus: %s\n" + +#: error.c:173 +#, c-format +msgid "Aborting..." +msgstr "Katkestan..." + +#: error.c:440 +msgid "unknown command error" +msgstr "tundmatu viga käsus" + +#: error.c:441 +msgid "bad command type" +msgstr "" + +#: error.c:442 +msgid "bad connector" +msgstr "" + +#: error.c:443 +msgid "bad jump" +msgstr "" + +#: error.c:481 +#, c-format +msgid "%s: unbound variable" +msgstr "%s: sidumata muutuja" + +#: eval.c:189 +#, c-format +msgid "\atimed out waiting for input: auto-logout\n" +msgstr "" + +#: execute_cmd.c:512 +#, c-format +msgid "cannot redirect standard input from /dev/null: %s" +msgstr "" + +#: execute_cmd.c:1233 +#, c-format +msgid "TIMEFORMAT: `%c': invalid format character" +msgstr "" + +#: execute_cmd.c:2287 +#, fuzzy +msgid "pipe error" +msgstr "kirjutamise viga: %s" + +#: execute_cmd.c:4386 +#, c-format +msgid "%s: maximum function nesting level exceeded (%d)" +msgstr "" + +#: execute_cmd.c:4884 +#, c-format +msgid "%s: restricted: cannot specify `/' in command names" +msgstr "%s: piiratud: käskudes ei saa kasutada sümboleid `/'" + +#: execute_cmd.c:4973 +#, c-format +msgid "%s: command not found" +msgstr "%s: käsku ei ole" + +#: execute_cmd.c:5206 +#, fuzzy, c-format +msgid "%s: %s" +msgstr "%s on %s\n" + +#: execute_cmd.c:5243 +#, c-format +msgid "%s: %s: bad interpreter" +msgstr "%s: %s: halb interpretaator" + +#: execute_cmd.c:5280 +#, fuzzy, c-format +msgid "%s: cannot execute binary file: %s" +msgstr "%s: kahendfaili ei õnnestu käivitada" + +#: execute_cmd.c:5352 +#, fuzzy, c-format +msgid "`%s': is a special builtin" +msgstr "%s on shelli sisekäsk\n" + +#: execute_cmd.c:5404 +#, c-format +msgid "cannot duplicate fd %d to fd %d" +msgstr "" + +#: expr.c:259 +msgid "expression recursion level exceeded" +msgstr "avaldise rekursioon on liiga sügav" + +#: expr.c:283 +msgid "recursion stack underflow" +msgstr "" + +#: expr.c:431 +msgid "syntax error in expression" +msgstr "süntaksi viga avaldises" + +#: expr.c:475 +msgid "attempted assignment to non-variable" +msgstr "üritati omistada mitte-muutujale" + +#: expr.c:495 expr.c:858 +msgid "division by 0" +msgstr "nulliga jagamine" + +#: expr.c:542 +msgid "bug: bad expassign token" +msgstr "" + +#: expr.c:595 +msgid "`:' expected for conditional expression" +msgstr "" + +#: expr.c:919 +msgid "exponent less than 0" +msgstr "eksponent on väiksem kui 0" + +#: expr.c:976 +msgid "identifier expected after pre-increment or pre-decrement" +msgstr "" + +#: expr.c:1002 +msgid "missing `)'" +msgstr "puudub `)'" + +#: expr.c:1053 expr.c:1390 +msgid "syntax error: operand expected" +msgstr "süntaksi viga: oodati operandi" + +#: expr.c:1392 +msgid "syntax error: invalid arithmetic operator" +msgstr "süntaksi viga: vigane aritmeetiline operaator" + +#: expr.c:1416 +#, c-format +msgid "%s%s%s: %s (error token is \"%s\")" +msgstr "" + +#: expr.c:1474 +msgid "invalid arithmetic base" +msgstr "vigane aritmeetiline baas" + +#: expr.c:1494 +msgid "value too great for base" +msgstr "väärtus on baasiks liiga suur" + +#: expr.c:1543 +#, fuzzy, c-format +msgid "%s: expression error\n" +msgstr "%s: oodati täisarvude avaldist" + +#: general.c:62 +msgid "getcwd: cannot access parent directories" +msgstr "getcwd: vanemkataloogidele ei ole juurdepääsu" + +#: input.c:102 subst.c:5168 +#, c-format +msgid "cannot reset nodelay mode for fd %d" +msgstr "" + +#: input.c:271 +#, c-format +msgid "cannot allocate new file descriptor for bash input from fd %d" +msgstr "" + +#: input.c:279 +#, c-format +msgid "save_bash_input: buffer already exists for new fd %d" +msgstr "" + +#: jobs.c:471 +msgid "start_pipeline: pgrp pipe" +msgstr "" + +#: jobs.c:893 +#, c-format +msgid "forked pid %d appears in running job %d" +msgstr "" + +#: jobs.c:1012 +#, c-format +msgid "deleting stopped job %d with process group %ld" +msgstr "" + +#: jobs.c:1117 +#, c-format +msgid "add_process: process %5ld (%s) in the_pipeline" +msgstr "" + +#: jobs.c:1120 +#, c-format +msgid "add_process: pid %5ld (%s) marked as still alive" +msgstr "" + +#: jobs.c:1435 +#, c-format +msgid "describe_pid: %ld: no such pid" +msgstr "describe_pid: %ld: pid puudub" + +#: jobs.c:1450 +#, c-format +msgid "Signal %d" +msgstr "" + +#: jobs.c:1464 jobs.c:1489 +msgid "Done" +msgstr "" + +#: jobs.c:1469 siglist.c:123 +msgid "Stopped" +msgstr "" + +#: jobs.c:1473 +#, c-format +msgid "Stopped(%s)" +msgstr "" + +#: jobs.c:1477 +msgid "Running" +msgstr "" + +#: jobs.c:1491 +#, c-format +msgid "Done(%d)" +msgstr "" + +#: jobs.c:1493 +#, c-format +msgid "Exit %d" +msgstr "" + +#: jobs.c:1496 +msgid "Unknown status" +msgstr "" + +#: jobs.c:1583 +#, c-format +msgid "(core dumped) " +msgstr "" + +#: jobs.c:1602 +#, c-format +msgid " (wd: %s)" +msgstr "" + +#: jobs.c:1819 +#, c-format +msgid "child setpgid (%ld to %ld)" +msgstr "" + +#: jobs.c:2138 nojobs.c:605 +#, c-format +msgid "wait: pid %ld is not a child of this shell" +msgstr "" + +#: jobs.c:2385 +#, c-format +msgid "wait_for: No record of process %ld" +msgstr "" + +#: jobs.c:2694 +#, c-format +msgid "wait_for_job: job %d is stopped" +msgstr "wait_for_job: töö %d on peatatud" + +#: jobs.c:2986 +#, c-format +msgid "%s: job has terminated" +msgstr "%s: töö on lõpetatud" + +#: jobs.c:2995 +#, c-format +msgid "%s: job %d already in background" +msgstr "%s: töö %d on juba taustal" + +#: jobs.c:3220 +msgid "waitchld: turning on WNOHANG to avoid indefinite block" +msgstr "" + +#: jobs.c:3711 +#, fuzzy, c-format +msgid "%s: line %d: " +msgstr "%s: hoiatus: " + +#: jobs.c:3725 nojobs.c:843 +#, c-format +msgid " (core dumped)" +msgstr "" + +#: jobs.c:3737 jobs.c:3750 +#, c-format +msgid "(wd now: %s)\n" +msgstr "" + +#: jobs.c:3782 +msgid "initialize_job_control: getpgrp failed" +msgstr "" + +#: jobs.c:3843 +msgid "initialize_job_control: line discipline" +msgstr "" + +#: jobs.c:3853 +msgid "initialize_job_control: setpgid" +msgstr "" + +#: jobs.c:3874 jobs.c:3883 +#, c-format +msgid "cannot set terminal process group (%d)" +msgstr "" + +#: jobs.c:3888 +msgid "no job control in this shell" +msgstr "" + +#: lib/malloc/malloc.c:296 +#, c-format +msgid "malloc: failed assertion: %s\n" +msgstr "" + +#: lib/malloc/malloc.c:312 +#, c-format +msgid "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" +msgstr "" + +#: lib/malloc/malloc.c:313 +#, fuzzy +msgid "unknown" +msgstr "%s: tundmatu masin" + +#: lib/malloc/malloc.c:801 +msgid "malloc: block on free list clobbered" +msgstr "" + +#: lib/malloc/malloc.c:878 +msgid "free: called with already freed block argument" +msgstr "" + +#: lib/malloc/malloc.c:881 +msgid "free: called with unallocated block argument" +msgstr "" + +#: lib/malloc/malloc.c:900 +msgid "free: underflow detected; mh_nbytes out of range" +msgstr "" + +#: lib/malloc/malloc.c:906 +msgid "free: start and end chunk sizes differ" +msgstr "" + +#: lib/malloc/malloc.c:1005 +msgid "realloc: called with unallocated block argument" +msgstr "" + +#: lib/malloc/malloc.c:1020 +msgid "realloc: underflow detected; mh_nbytes out of range" +msgstr "" + +#: lib/malloc/malloc.c:1026 +msgid "realloc: start and end chunk sizes differ" +msgstr "" + +#: lib/malloc/table.c:194 +#, c-format +msgid "register_alloc: alloc table is full with FIND_ALLOC?\n" +msgstr "" + +#: lib/malloc/table.c:203 +#, c-format +msgid "register_alloc: %p already in table as allocated?\n" +msgstr "" + +#: lib/malloc/table.c:256 +#, c-format +msgid "register_free: %p already in table as free?\n" +msgstr "" + +#: lib/sh/fmtulong.c:102 +msgid "invalid base" +msgstr "vigane baas" + +#: lib/sh/netopen.c:168 +#, c-format +msgid "%s: host unknown" +msgstr "%s: tundmatu masin" + +#: lib/sh/netopen.c:175 +#, c-format +msgid "%s: invalid service" +msgstr "%s: vigane teenus" + +#: lib/sh/netopen.c:306 +#, c-format +msgid "%s: bad network path specification" +msgstr "" + +#: lib/sh/netopen.c:346 +msgid "network operations not supported" +msgstr "" + +#: locale.c:200 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s)" +msgstr "" + +#: locale.c:202 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s): %s" +msgstr "" + +#: locale.c:259 +#, c-format +msgid "setlocale: %s: cannot change locale (%s)" +msgstr "" + +#: locale.c:261 +#, c-format +msgid "setlocale: %s: cannot change locale (%s): %s" +msgstr "" + +#: mailcheck.c:439 +msgid "You have mail in $_" +msgstr "Teil on kiri kaustas $_" + +#: mailcheck.c:464 +msgid "You have new mail in $_" +msgstr "Teil on uus kiri kaustas $_" + +#: mailcheck.c:480 +#, c-format +msgid "The mail in %s has been read\n" +msgstr "Kiri kaustas %s on loetud\n" + +#: make_cmd.c:323 +msgid "syntax error: arithmetic expression required" +msgstr "süntaksi viga: nõutakse aritmeetilist avaldist" + +#: make_cmd.c:325 +msgid "syntax error: `;' unexpected" +msgstr "süntaksi viga: ootamatu `;'" + +#: make_cmd.c:326 +#, c-format +msgid "syntax error: `((%s))'" +msgstr "süntaksi viga: `((%s))'" + +#: make_cmd.c:578 +#, c-format +msgid "make_here_document: bad instruction type %d" +msgstr "" + +#: make_cmd.c:662 +#, c-format +msgid "here-document at line %d delimited by end-of-file (wanted `%s')" +msgstr "" + +#: make_cmd.c:759 +#, c-format +msgid "make_redirection: redirection instruction `%d' out of range" +msgstr "" + +#: parse.y:3278 parse.y:3561 +#, c-format +msgid "unexpected EOF while looking for matching `%c'" +msgstr "" + +#: parse.y:4170 +msgid "unexpected EOF while looking for `]]'" +msgstr "" + +#: parse.y:4175 +#, c-format +msgid "syntax error in conditional expression: unexpected token `%s'" +msgstr "" + +#: parse.y:4179 +msgid "syntax error in conditional expression" +msgstr "süntaksi viga tingimuslikus avaldises" + +#: parse.y:4257 +#, c-format +msgid "unexpected token `%s', expected `)'" +msgstr "ootamatu märk `%s', oodati `)'" + +#: parse.y:4261 +msgid "expected `)'" +msgstr "oodati `)'" + +#: parse.y:4289 +#, c-format +msgid "unexpected argument `%s' to conditional unary operator" +msgstr "" + +#: parse.y:4293 +msgid "unexpected argument to conditional unary operator" +msgstr "" + +#: parse.y:4339 +#, c-format +msgid "unexpected token `%s', conditional binary operator expected" +msgstr "" + +#: parse.y:4343 +msgid "conditional binary operator expected" +msgstr "" + +#: parse.y:4365 +#, c-format +msgid "unexpected argument `%s' to conditional binary operator" +msgstr "" + +#: parse.y:4369 +msgid "unexpected argument to conditional binary operator" +msgstr "" + +#: parse.y:4380 +#, c-format +msgid "unexpected token `%c' in conditional command" +msgstr "" + +#: parse.y:4383 +#, c-format +msgid "unexpected token `%s' in conditional command" +msgstr "" + +#: parse.y:4387 +#, c-format +msgid "unexpected token %d in conditional command" +msgstr "" + +#: parse.y:5737 +#, c-format +msgid "syntax error near unexpected token `%s'" +msgstr "" + +#: parse.y:5755 +#, c-format +msgid "syntax error near `%s'" +msgstr "süntaksi viga kohal `%s'" + +#: parse.y:5765 +msgid "syntax error: unexpected end of file" +msgstr "süntaksi viga: ootamatu faililõpp" + +#: parse.y:5765 +msgid "syntax error" +msgstr "süntaksi viga" + +#: parse.y:5827 +#, c-format +msgid "Use \"%s\" to leave the shell.\n" +msgstr "Käsuinterpretaatorist väljumiseks kasutage \"%s\".\n" + +#: parse.y:5989 +msgid "unexpected EOF while looking for matching `)'" +msgstr "" + +#: pcomplete.c:1094 +#, c-format +msgid "completion: function `%s' not found" +msgstr "" + +#: pcomplib.c:182 +#, c-format +msgid "progcomp_insert: %s: NULL COMPSPEC" +msgstr "" + +#: print_cmd.c:300 +#, c-format +msgid "print_command: bad connector `%d'" +msgstr "" + +#: print_cmd.c:373 +#, c-format +msgid "xtrace_set: %d: invalid file descriptor" +msgstr "" + +#: print_cmd.c:378 +msgid "xtrace_set: NULL file pointer" +msgstr "" + +#: print_cmd.c:382 +#, c-format +msgid "xtrace fd (%d) != fileno xtrace fp (%d)" +msgstr "" + +#: print_cmd.c:1518 +#, c-format +msgid "cprintf: `%c': invalid format character" +msgstr "" + +#: redir.c:123 redir.c:170 +msgid "file descriptor out of range" +msgstr "faili deskriptor on piiridest väljas" + +#: redir.c:177 +#, c-format +msgid "%s: ambiguous redirect" +msgstr "%s: segane ümbersuunamine" + +#: redir.c:181 +#, c-format +msgid "%s: cannot overwrite existing file" +msgstr "%s: fail on olemas, ei kirjuta üle" + +#: redir.c:186 +#, c-format +msgid "%s: restricted: cannot redirect output" +msgstr "%s: piiratud: väljundit ei saa ümber suunata" + +#: redir.c:191 +#, c-format +msgid "cannot create temp file for here-document: %s" +msgstr "" + +#: redir.c:195 +#, fuzzy, c-format +msgid "%s: cannot assign fd to variable" +msgstr "$%s: sedasi ei saa omistada" + +#: redir.c:582 +msgid "/dev/(tcp|udp)/host/port not supported without networking" +msgstr "" + +#: redir.c:861 redir.c:973 redir.c:1034 redir.c:1199 +msgid "redirection error: cannot duplicate fd" +msgstr "viga ümbersuunamisel: fd duplikaadi loomine ei õnnestu" + +#: shell.c:339 +msgid "could not find /tmp, please create!" +msgstr "/tmp puudub, palun looge see!" + +#: shell.c:343 +msgid "/tmp must be a valid directory name" +msgstr "/tmp peab olema kataloogi nimi" + +#: shell.c:890 +#, c-format +msgid "%c%c: invalid option" +msgstr "%c%c: vigane võti" + +#: shell.c:1682 +msgid "I have no name!" +msgstr "Mul ei ole nime!" + +#: shell.c:1827 +#, c-format +msgid "GNU bash, version %s-(%s)\n" +msgstr "" + +#: shell.c:1828 +#, c-format +msgid "" +"Usage:\t%s [GNU long option] [option] ...\n" +"\t%s [GNU long option] [option] script-file ...\n" +msgstr "" +"Kasuta:\t%s [GNU pikk võti] [võti] ...\n" +"\t%s [GNU pikk võti] [võti] skript-fail ...\n" + +#: shell.c:1830 +msgid "GNU long options:\n" +msgstr "GNU pikad võtmed:\n" + +#: shell.c:1834 +msgid "Shell options:\n" +msgstr "Käsuinterpretaatori võtmed:\n" + +#: shell.c:1835 +#, fuzzy +msgid "\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n" +msgstr "\t-irsD või -c käsklus või -O lühivõti\t\t(ainult käivitamine)\n" + +#: shell.c:1850 +#, c-format +msgid "\t-%s or -o option\n" +msgstr "\t-%s või -o võti\n" + +#: shell.c:1856 +#, c-format +msgid "Type `%s -c \"help set\"' for more information about shell options.\n" +msgstr "" + +#: shell.c:1857 +#, c-format +msgid "Type `%s -c help' for more information about shell builtin commands.\n" +msgstr "" + +#: shell.c:1858 +#, c-format +msgid "Use the `bashbug' command to report bugs.\n" +msgstr "Vigadest teatamiseks kasutage käsku `bashbug'.\n" + +#: sig.c:691 +#, c-format +msgid "sigprocmask: %d: invalid operation" +msgstr "sigprocmask: %d: vigane operatsioon" + +#: siglist.c:48 +msgid "Bogus signal" +msgstr "" + +#: siglist.c:51 +msgid "Hangup" +msgstr "" + +#: siglist.c:55 +msgid "Interrupt" +msgstr "" + +#: siglist.c:59 +msgid "Quit" +msgstr "" + +#: siglist.c:63 +msgid "Illegal instruction" +msgstr "" + +#: siglist.c:67 +msgid "BPT trace/trap" +msgstr "" + +#: siglist.c:75 +msgid "ABORT instruction" +msgstr "" + +#: siglist.c:79 +msgid "EMT instruction" +msgstr "" + +#: siglist.c:83 +msgid "Floating point exception" +msgstr "" + +#: siglist.c:87 +msgid "Killed" +msgstr "" + +#: siglist.c:91 +#, fuzzy +msgid "Bus error" +msgstr "süntaksi viga" + +#: siglist.c:95 +msgid "Segmentation fault" +msgstr "" + +#: siglist.c:99 +msgid "Bad system call" +msgstr "" + +#: siglist.c:103 +msgid "Broken pipe" +msgstr "" + +#: siglist.c:107 +msgid "Alarm clock" +msgstr "" + +#: siglist.c:111 +#, fuzzy +msgid "Terminated" +msgstr "piiratud" + +#: siglist.c:115 +msgid "Urgent IO condition" +msgstr "" + +#: siglist.c:119 +msgid "Stopped (signal)" +msgstr "" + +#: siglist.c:127 +msgid "Continue" +msgstr "" + +#: siglist.c:135 +msgid "Child death or stop" +msgstr "" + +#: siglist.c:139 +msgid "Stopped (tty input)" +msgstr "" + +#: siglist.c:143 +msgid "Stopped (tty output)" +msgstr "" + +#: siglist.c:147 +msgid "I/O ready" +msgstr "" + +#: siglist.c:151 +msgid "CPU limit" +msgstr "" + +#: siglist.c:155 +msgid "File limit" +msgstr "" + +#: siglist.c:159 +msgid "Alarm (virtual)" +msgstr "" + +#: siglist.c:163 +msgid "Alarm (profile)" +msgstr "" + +#: siglist.c:167 +msgid "Window changed" +msgstr "" + +#: siglist.c:171 +msgid "Record lock" +msgstr "" + +#: siglist.c:175 +msgid "User signal 1" +msgstr "" + +#: siglist.c:179 +msgid "User signal 2" +msgstr "" + +#: siglist.c:183 +msgid "HFT input data pending" +msgstr "" + +#: siglist.c:187 +msgid "power failure imminent" +msgstr "" + +#: siglist.c:191 +msgid "system crash imminent" +msgstr "" + +#: siglist.c:195 +msgid "migrate process to another CPU" +msgstr "" + +#: siglist.c:199 +msgid "programming error" +msgstr "" + +#: siglist.c:203 +msgid "HFT monitor mode granted" +msgstr "" + +#: siglist.c:207 +msgid "HFT monitor mode retracted" +msgstr "" + +#: siglist.c:211 +msgid "HFT sound sequence has completed" +msgstr "" + +#: siglist.c:215 +msgid "Information request" +msgstr "" + +#: siglist.c:223 +msgid "Unknown Signal #" +msgstr "" + +#: siglist.c:225 +#, c-format +msgid "Unknown Signal #%d" +msgstr "" + +#: subst.c:1362 subst.c:1520 +#, c-format +msgid "bad substitution: no closing `%s' in %s" +msgstr "" + +#: subst.c:2847 +#, c-format +msgid "%s: cannot assign list to array member" +msgstr "" + +#: subst.c:5065 subst.c:5081 +msgid "cannot make pipe for process substitution" +msgstr "" + +#: subst.c:5113 +msgid "cannot make child for process substitution" +msgstr "" + +#: subst.c:5158 +#, c-format +msgid "cannot open named pipe %s for reading" +msgstr "" + +#: subst.c:5160 +#, c-format +msgid "cannot open named pipe %s for writing" +msgstr "" + +#: subst.c:5178 +#, c-format +msgid "cannot duplicate named pipe %s as fd %d" +msgstr "" + +#: subst.c:5376 +msgid "cannot make pipe for command substitution" +msgstr "" + +#: subst.c:5414 +msgid "cannot make child for command substitution" +msgstr "" + +#: subst.c:5433 +msgid "command_substitute: cannot duplicate pipe as fd 1" +msgstr "" + +#: subst.c:5837 subst.c:8050 +#, c-format +msgid "%s: invalid variable name for name reference" +msgstr "" + +#: subst.c:6048 +#, c-format +msgid "%s: parameter null or not set" +msgstr "%s: parameeter on null või pole seatud" + +#: subst.c:6320 subst.c:6335 +#, c-format +msgid "%s: substring expression < 0" +msgstr "" + +#: subst.c:7506 +#, c-format +msgid "%s: bad substitution" +msgstr "%s: halb asendus" + +#: subst.c:7583 +#, c-format +msgid "$%s: cannot assign in this way" +msgstr "$%s: sedasi ei saa omistada" + +#: subst.c:7917 +msgid "" +"future versions of the shell will force evaluation as an arithmetic " +"substitution" +msgstr "" + +#: subst.c:8421 +#, fuzzy, c-format +msgid "bad substitution: no closing \"`\" in %s" +msgstr "sulgev `%c' puudub %s sees" + +#: subst.c:9322 +#, c-format +msgid "no match: %s" +msgstr "ei leitud: %s" + +#: test.c:147 +msgid "argument expected" +msgstr "oodati argumenti" + +#: test.c:156 +#, c-format +msgid "%s: integer expression expected" +msgstr "%s: oodati täisarvude avaldist" + +#: test.c:264 +msgid "`)' expected" +msgstr "oodati `)'" + +#: test.c:266 +#, c-format +msgid "`)' expected, found %s" +msgstr "oodati `)', saadi %s" + +#: test.c:281 test.c:742 test.c:745 +#, c-format +msgid "%s: unary operator expected" +msgstr "%s: eeldati unaarset operaatorit" + +#: test.c:468 test.c:785 +#, c-format +msgid "%s: binary operator expected" +msgstr "%s: eeldati binaarset operaatorit" + +#: test.c:860 +msgid "missing `]'" +msgstr "puudub `]'" + +#: trap.c:217 +msgid "invalid signal number" +msgstr "vigane signaali number" + +#: trap.c:371 +#, c-format +msgid "run_pending_traps: bad value in trap_list[%d]: %p" +msgstr "run_pending_traps: halb väärtus muutujas trap_list[%d]: %p" + +#: trap.c:375 +#, c-format +msgid "" +"run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" +msgstr "" +"run_pending_traps: signaali käsitleja on SIG_DFL, saadan %d (%s) iseendale" + +#: trap.c:428 +#, c-format +msgid "trap_handler: bad signal %d" +msgstr "trap_handler: vigane signaal %d" + +#: variables.c:382 +#, c-format +msgid "error importing function definition for `%s'" +msgstr "" + +#: variables.c:780 +#, c-format +msgid "shell level (%d) too high, resetting to 1" +msgstr "shelli tase (%d) on liiga kõrge, kasutan väärtust 1" + +#: variables.c:1865 +#, c-format +msgid "%s: circular name reference" +msgstr "" + +#: variables.c:2228 +msgid "make_local_variable: no function context at current scope" +msgstr "make_local_variable: praegune skoop pole funktsiooni kontekst" + +#: variables.c:2247 +#, fuzzy, c-format +msgid "%s: variable may not be assigned value" +msgstr "$%s: sedasi ei saa omistada" + +#: variables.c:3646 +msgid "all_local_variables: no function context at current scope" +msgstr "all_local_variables: praegune skoop pole funktsiooni kontekst" + +#: variables.c:3891 +#, fuzzy, c-format +msgid "%s has null exportstr" +msgstr "%s: parameeter on null või pole seatud" + +#: variables.c:3896 variables.c:3905 +#, c-format +msgid "invalid character %d in exportstr for %s" +msgstr "" + +#: variables.c:3911 +#, c-format +msgid "no `=' in exportstr for %s" +msgstr "" + +#: variables.c:4344 +msgid "pop_var_context: head of shell_variables not a function context" +msgstr "" + +#: variables.c:4357 +msgid "pop_var_context: no global_variables context" +msgstr "pop_var_context: pole global_variables kontekst" + +#: variables.c:4431 +msgid "pop_scope: head of shell_variables not a temporary environment scope" +msgstr "" + +#: variables.c:5257 +#, fuzzy, c-format +msgid "%s: %s: cannot open as FILE" +msgstr "%s: ei saa avada: %s" + +#: variables.c:5262 +#, c-format +msgid "%s: %s: invalid value for trace file descriptor" +msgstr "" + +#: variables.c:5307 +#, fuzzy, c-format +msgid "%s: %s: compatibility value out of range" +msgstr "%s: %s on piiridest väljas" + +#: version.c:46 +#, fuzzy +msgid "Copyright (C) 2013 Free Software Foundation, Inc." +msgstr "Autoriõigus © 2006 Free Software Foundation, Inc.\n" + +#: version.c:47 version2.c:47 +msgid "" +"License GPLv3+: GNU GPL version 3 or later \n" +msgstr "" + +#: version.c:86 version2.c:86 +#, c-format +msgid "GNU bash, version %s (%s)\n" +msgstr "" + +#: version.c:91 version2.c:91 +msgid "This is free software; you are free to change and redistribute it." +msgstr "" + +#: version.c:92 version2.c:92 +msgid "There is NO WARRANTY, to the extent permitted by law." +msgstr "" + +#: version2.c:46 +#, fuzzy +msgid "Copyright (C) 2012 Free Software Foundation, Inc." +msgstr "Autoriõigus © 2006 Free Software Foundation, Inc.\n" + +#: xmalloc.c:91 +#, c-format +msgid "%s: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "" + +#: xmalloc.c:93 +#, fuzzy, c-format +msgid "%s: cannot allocate %lu bytes" +msgstr "%s: ei saa luua: %s" + +#: xmalloc.c:163 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "" + +#: xmalloc.c:165 +#, fuzzy, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes" +msgstr "%s: ei saa luua: %s" + +#: builtins.c:43 +msgid "alias [-p] [name[=value] ... ]" +msgstr "" + +#: builtins.c:47 +msgid "unalias [-a] name [name ...]" +msgstr "" + +#: builtins.c:51 +msgid "" +"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-" +"x keyseq:shell-command] [keyseq:readline-function or readline-command]" +msgstr "" + +#: builtins.c:54 +msgid "break [n]" +msgstr "" + +#: builtins.c:56 +msgid "continue [n]" +msgstr "" + +#: builtins.c:58 +msgid "builtin [shell-builtin [arg ...]]" +msgstr "" + +#: builtins.c:61 +msgid "caller [expr]" +msgstr "" + +#: builtins.c:64 +msgid "cd [-L|[-P [-e]] [-@]] [dir]" +msgstr "" + +#: builtins.c:66 +msgid "pwd [-LP]" +msgstr "" + +#: builtins.c:68 +msgid ":" +msgstr "" + +#: builtins.c:70 +msgid "true" +msgstr "" + +#: builtins.c:72 +msgid "false" +msgstr "" + +#: builtins.c:74 +msgid "command [-pVv] command [arg ...]" +msgstr "" + +#: builtins.c:76 +msgid "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" +msgstr "" + +#: builtins.c:78 +msgid "typeset [-aAfFgilrtux] [-p] name[=value] ..." +msgstr "" + +#: builtins.c:80 +msgid "local [option] name[=value] ..." +msgstr "" + +#: builtins.c:83 +msgid "echo [-neE] [arg ...]" +msgstr "" + +#: builtins.c:87 +msgid "echo [-n] [arg ...]" +msgstr "" + +#: builtins.c:90 +msgid "enable [-a] [-dnps] [-f filename] [name ...]" +msgstr "" + +#: builtins.c:92 +msgid "eval [arg ...]" +msgstr "" + +#: builtins.c:94 +msgid "getopts optstring name [arg]" +msgstr "" + +#: builtins.c:96 +msgid "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" +msgstr "" + +#: builtins.c:98 +msgid "exit [n]" +msgstr "" + +#: builtins.c:100 +msgid "logout [n]" +msgstr "" + +#: builtins.c:103 +msgid "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" +msgstr "" + +#: builtins.c:107 +msgid "fg [job_spec]" +msgstr "" + +#: builtins.c:111 +msgid "bg [job_spec ...]" +msgstr "" + +#: builtins.c:114 +msgid "hash [-lr] [-p pathname] [-dt] [name ...]" +msgstr "" + +#: builtins.c:117 +msgid "help [-dms] [pattern ...]" +msgstr "" + +#: builtins.c:121 +msgid "" +"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg " +"[arg...]" +msgstr "" + +#: builtins.c:125 +msgid "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" +msgstr "" + +#: builtins.c:129 +msgid "disown [-h] [-ar] [jobspec ...]" +msgstr "" + +#: builtins.c:132 +msgid "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l " +"[sigspec]" +msgstr "" + +#: builtins.c:134 +msgid "let arg [arg ...]" +msgstr "" + +#: builtins.c:136 +msgid "" +"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p " +"prompt] [-t timeout] [-u fd] [name ...]" +msgstr "" + +#: builtins.c:138 +msgid "return [n]" +msgstr "" + +#: builtins.c:140 +msgid "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" +msgstr "" + +#: builtins.c:142 +msgid "unset [-f] [-v] [-n] [name ...]" +msgstr "" + +#: builtins.c:144 +msgid "export [-fn] [name[=value] ...] or export -p" +msgstr "" + +#: builtins.c:146 +msgid "readonly [-aAf] [name[=value] ...] or readonly -p" +msgstr "" + +#: builtins.c:148 +#, fuzzy +msgid "shift [n]" +msgstr "shift arv" + +#: builtins.c:150 +msgid "source filename [arguments]" +msgstr "" + +#: builtins.c:152 +#, fuzzy +msgid ". filename [arguments]" +msgstr "liiga palju argumente" + +#: builtins.c:155 +msgid "suspend [-f]" +msgstr "" + +#: builtins.c:158 +msgid "test [expr]" +msgstr "" + +#: builtins.c:160 +msgid "[ arg... ]" +msgstr "" + +#: builtins.c:162 +msgid "times" +msgstr "" + +#: builtins.c:164 +msgid "trap [-lp] [[arg] signal_spec ...]" +msgstr "" + +#: builtins.c:166 +msgid "type [-afptP] name [name ...]" +msgstr "" + +#: builtins.c:169 +msgid "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" +msgstr "" + +#: builtins.c:172 +msgid "umask [-p] [-S] [mode]" +msgstr "" + +#: builtins.c:175 +msgid "wait [-n] [id ...]" +msgstr "" + +#: builtins.c:179 +msgid "wait [pid ...]" +msgstr "" + +#: builtins.c:182 +msgid "for NAME [in WORDS ... ] ; do COMMANDS; done" +msgstr "" + +#: builtins.c:184 +msgid "for (( exp1; exp2; exp3 )); do COMMANDS; done" +msgstr "" + +#: builtins.c:186 +msgid "select NAME [in WORDS ... ;] do COMMANDS; done" +msgstr "" + +#: builtins.c:188 +msgid "time [-p] pipeline" +msgstr "" + +#: builtins.c:190 +msgid "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" +msgstr "" + +#: builtins.c:192 +msgid "" +"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else " +"COMMANDS; ] fi" +msgstr "" + +#: builtins.c:194 +msgid "while COMMANDS; do COMMANDS; done" +msgstr "" + +#: builtins.c:196 +msgid "until COMMANDS; do COMMANDS; done" +msgstr "" + +#: builtins.c:198 +msgid "coproc [NAME] command [redirections]" +msgstr "" + +#: builtins.c:200 +msgid "function name { COMMANDS ; } or name () { COMMANDS ; }" +msgstr "" + +#: builtins.c:202 +msgid "{ COMMANDS ; }" +msgstr "" + +#: builtins.c:204 +msgid "job_spec [&]" +msgstr "" + +#: builtins.c:206 +#, fuzzy +msgid "(( expression ))" +msgstr "oodati avaldist" + +#: builtins.c:208 +#, fuzzy +msgid "[[ expression ]]" +msgstr "oodati avaldist" + +#: builtins.c:210 +msgid "variables - Names and meanings of some shell variables" +msgstr "" + +#: builtins.c:213 +msgid "pushd [-n] [+N | -N | dir]" +msgstr "" + +#: builtins.c:217 +msgid "popd [-n] [+N | -N]" +msgstr "" + +#: builtins.c:221 +msgid "dirs [-clpv] [+N] [-N]" +msgstr "" + +#: builtins.c:224 +msgid "shopt [-pqsu] [-o] [optname ...]" +msgstr "" + +#: builtins.c:226 +msgid "printf [-v var] format [arguments]" +msgstr "" + +#: builtins.c:229 +msgid "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-" +"W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S " +"suffix] [name ...]" +msgstr "" + +#: builtins.c:233 +msgid "" +"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " +"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" +msgstr "" + +#: builtins.c:237 +msgid "compopt [-o|+o option] [-DE] [name ...]" +msgstr "" + +#: builtins.c:240 +msgid "" +"mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" + +#: builtins.c:242 +msgid "" +"readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" + +#: builtins.c:254 +msgid "" +"Define or display aliases.\n" +" \n" +" Without arguments, `alias' prints the list of aliases in the reusable\n" +" form `alias NAME=VALUE' on standard output.\n" +" \n" +" Otherwise, an alias is defined for each NAME whose VALUE is given.\n" +" A trailing space in VALUE causes the next word to be checked for\n" +" alias substitution when the alias is expanded.\n" +" \n" +" Options:\n" +" -p\tPrint all defined aliases in a reusable format\n" +" \n" +" Exit Status:\n" +" alias returns true unless a NAME is supplied for which no alias has " +"been\n" +" defined." +msgstr "" + +#: builtins.c:276 +msgid "" +"Remove each NAME from the list of defined aliases.\n" +" \n" +" Options:\n" +" -a\tremove all alias definitions.\n" +" \n" +" Return success unless a NAME is not an existing alias." +msgstr "" + +#: builtins.c:289 +msgid "" +"Set Readline key bindings and variables.\n" +" \n" +" Bind a key sequence to a Readline function or a macro, or set a\n" +" Readline variable. The non-option argument syntax is equivalent to\n" +" that found in ~/.inputrc, but must be passed as a single argument:\n" +" e.g., bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Options:\n" +" -m keymap Use KEYMAP as the keymap for the duration of this\n" +" command. Acceptable keymap names are emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" +"move,\n" +" vi-command, and vi-insert.\n" +" -l List names of functions.\n" +" -P List function names and bindings.\n" +" -p List functions and bindings in a form that can be\n" +" reused as input.\n" +" -S List key sequences that invoke macros and their " +"values\n" +" -s List key sequences that invoke macros and their " +"values\n" +" in a form that can be reused as input.\n" +" -V List variable names and values\n" +" -v List variable names and values in a form that can\n" +" be reused as input.\n" +" -q function-name Query about which keys invoke the named function.\n" +" -u function-name Unbind all keys which are bound to the named " +"function.\n" +" -r keyseq Remove the binding for KEYSEQ.\n" +" -f filename Read key bindings from FILENAME.\n" +" -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when\n" +" \t\t\t\tKEYSEQ is entered.\n" +" -X\t\t List key sequences bound with -x and associated commands\n" +" in a form that can be reused as input.\n" +" \n" +" Exit Status:\n" +" bind returns 0 unless an unrecognized option is given or an error occurs." +msgstr "" + +#: builtins.c:328 +msgid "" +"Exit for, while, or until loops.\n" +" \n" +" Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n" +" loops.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" + +#: builtins.c:340 +msgid "" +"Resume for, while, or until loops.\n" +" \n" +" Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n" +" If N is specified, resumes the Nth enclosing loop.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" + +#: builtins.c:352 +msgid "" +"Execute shell builtins.\n" +" \n" +" Execute SHELL-BUILTIN with arguments ARGs without performing command\n" +" lookup. This is useful when you wish to reimplement a shell builtin\n" +" as a shell function, but need to execute the builtin within the " +"function.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n" +" not a shell builtin.." +msgstr "" + +#: builtins.c:367 +msgid "" +"Return the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns \"$line $filename\". With EXPR, returns\n" +" \"$line $subroutine $filename\"; this extra information can be used to\n" +" provide a stack trace.\n" +" \n" +" The value of EXPR indicates how many call frames to go back before the\n" +" current one; the top frame is frame 0.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless the shell is not executing a shell function or EXPR\n" +" is invalid." +msgstr "" + +#: builtins.c:385 +msgid "" +"Change the shell working directory.\n" +" \n" +" Change the current directory to DIR. The default DIR is the value of " +"the\n" +" HOME shell variable.\n" +" \n" +" The variable CDPATH defines the search path for the directory " +"containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon " +"(:).\n" +" A null directory name is the same as the current directory. If DIR " +"begins\n" +" with a slash (/), then CDPATH is not used.\n" +" \n" +" If the directory is not found, and the shell option `cdable_vars' is " +"set,\n" +" the word is assumed to be a variable name. If that variable has a " +"value,\n" +" its value is used for DIR.\n" +" \n" +" Options:\n" +" -L\tforce symbolic links to be followed: resolve symbolic links in\n" +" \tDIR after processing instances of `..'\n" +" -P\tuse the physical directory structure without following symbolic\n" +" \tlinks: resolve symbolic links in DIR before processing instances\n" +" \tof `..'\n" +" -e\tif the -P option is supplied, and the current working directory\n" +" \tcannot be determined successfully, exit with a non-zero status\n" +" -@ on systems that support it, present a file with extended " +"attributes\n" +" as a directory containing the file attributes\n" +" \n" +" The default is to follow symbolic links, as if `-L' were specified.\n" +" `..' is processed by removing the immediately previous pathname " +"component\n" +" back to a slash or the beginning of DIR.\n" +" \n" +" Exit Status:\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully " +"when\n" +" -P is used; non-zero otherwise." +msgstr "" + +#: builtins.c:422 +msgid "" +"Print the name of the current working directory.\n" +" \n" +" Options:\n" +" -L\tprint the value of $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tprint the physical directory, without any symbolic links\n" +" \n" +" By default, `pwd' behaves as if `-L' were specified.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless an invalid option is given or the current directory\n" +" cannot be read." +msgstr "" + +#: builtins.c:439 +msgid "" +"Null command.\n" +" \n" +" No effect; the command does nothing.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" + +#: builtins.c:450 +msgid "" +"Return a successful result.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" + +#: builtins.c:459 +msgid "" +"Return an unsuccessful result.\n" +" \n" +" Exit Status:\n" +" Always fails." +msgstr "" + +#: builtins.c:468 +msgid "" +"Execute a simple command or display information about commands.\n" +" \n" +" Runs COMMAND with ARGS suppressing shell function lookup, or display\n" +" information about the specified COMMANDs. Can be used to invoke " +"commands\n" +" on disk when a function with the same name exists.\n" +" \n" +" Options:\n" +" -p\tuse a default value for PATH that is guaranteed to find all of\n" +" \tthe standard utilities\n" +" -v\tprint a description of COMMAND similar to the `type' builtin\n" +" -V\tprint a more verbose description of each COMMAND\n" +" \n" +" Exit Status:\n" +" Returns exit status of COMMAND, or failure if COMMAND is not found." +msgstr "" + +#: builtins.c:487 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Declare variables and give them attributes. If no NAMEs are given,\n" +" display the attributes and values of all variables.\n" +" \n" +" Options:\n" +" -f\trestrict action or display to function names and definitions\n" +" -F\trestrict display to function names only (plus line number and\n" +" \tsource file when debugging)\n" +" -g\tcreate global variables when used in a shell function; otherwise\n" +" \tignored\n" +" -p\tdisplay the attributes and value of each NAME\n" +" \n" +" Options which set attributes:\n" +" -a\tto make NAMEs indexed arrays (if supported)\n" +" -A\tto make NAMEs associative arrays (if supported)\n" +" -i\tto make NAMEs have the `integer' attribute\n" +" -l\tto convert NAMEs to lower case on assignment\n" +" -n\tmake NAME a reference to the variable named by its value\n" +" -r\tto make NAMEs readonly\n" +" -t\tto make NAMEs have the `trace' attribute\n" +" -u\tto convert NAMEs to upper case on assignment\n" +" -x\tto make NAMEs export\n" +" \n" +" Using `+' instead of `-' turns off the given attribute.\n" +" \n" +" Variables with the integer attribute have arithmetic evaluation (see\n" +" the `let' command) performed when the variable is assigned a value.\n" +" \n" +" When used in a function, `declare' makes NAMEs local, as with the " +"`local'\n" +" command. The `-g' option suppresses this behavior.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or a variable\n" +" assignment error occurs." +msgstr "" + +#: builtins.c:527 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Obsolete. See `help declare'." +msgstr "" + +#: builtins.c:535 +msgid "" +"Define local variables.\n" +" \n" +" Create a local variable called NAME, and give it VALUE. OPTION can\n" +" be any option accepted by `declare'.\n" +" \n" +" Local variables can only be used within a function; they are visible\n" +" only to the function where they are defined and its children.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied, a variable\n" +" assignment error occurs, or the shell is not executing a function." +msgstr "" + +#: builtins.c:552 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs, separated by a single space character and followed by " +"a\n" +" newline, on the standard output.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" -e\tenable interpretation of the following backslash escapes\n" +" -E\texplicitly suppress interpretation of backslash escapes\n" +" \n" +" `echo' interprets the following backslash-escaped characters:\n" +" \\a\talert (bell)\n" +" \\b\tbackspace\n" +" \\c\tsuppress further output\n" +" \\e\tescape character\n" +" \\E\tescape character\n" +" \\f\tform feed\n" +" \\n\tnew line\n" +" \\r\tcarriage return\n" +" \\t\thorizontal tab\n" +" \\v\tvertical tab\n" +" \\\\\tbackslash\n" +" \\0nnn\tthe character whose ASCII code is NNN (octal). NNN can be\n" +" \t0 to 3 octal digits\n" +" \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" +" \tcan be one or two hex digits\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" + +#: builtins.c:588 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs on the standard output followed by a newline.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" + +#: builtins.c:603 +msgid "" +"Enable and disable shell builtins.\n" +" \n" +" Enables and disables builtin shell commands. Disabling allows you to\n" +" execute a disk command which has the same name as a shell builtin\n" +" without using a full pathname.\n" +" \n" +" Options:\n" +" -a\tprint a list of builtins showing whether or not each is enabled\n" +" -n\tdisable each NAME or display a list of disabled builtins\n" +" -p\tprint the list of builtins in a reusable format\n" +" -s\tprint only the names of Posix `special' builtins\n" +" \n" +" Options controlling dynamic loading:\n" +" -f\tLoad builtin NAME from shared object FILENAME\n" +" -d\tRemove a builtin loaded with -f\n" +" \n" +" Without options, each NAME is enabled.\n" +" \n" +" To use the `test' found in $PATH instead of the shell builtin\n" +" version, type `enable -n test'.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not a shell builtin or an error occurs." +msgstr "" + +#: builtins.c:631 +msgid "" +"Execute arguments as a shell command.\n" +" \n" +" Combine ARGs into a single string, use the result as input to the " +"shell,\n" +" and execute the resulting commands.\n" +" \n" +" Exit Status:\n" +" Returns exit status of command or success if command is null." +msgstr "" + +#: builtins.c:643 +msgid "" +"Parse option arguments.\n" +" \n" +" Getopts is used by shell procedures to parse positional parameters\n" +" as options.\n" +" \n" +" OPTSTRING contains the option letters to be recognized; if a letter\n" +" is followed by a colon, the option is expected to have an argument,\n" +" which should be separated from it by white space.\n" +" \n" +" Each time it is invoked, getopts will place the next option in the\n" +" shell variable $name, initializing name if it does not exist, and\n" +" the index of the next argument to be processed into the shell\n" +" variable OPTIND. OPTIND is initialized to 1 each time the shell or\n" +" a shell script is invoked. When an option requires an argument,\n" +" getopts places that argument into the shell variable OPTARG.\n" +" \n" +" getopts reports errors in one of two ways. If the first character\n" +" of OPTSTRING is a colon, getopts uses silent error reporting. In\n" +" this mode, no error messages are printed. If an invalid option is\n" +" seen, getopts places the option character found into OPTARG. If a\n" +" required argument is not found, getopts places a ':' into NAME and\n" +" sets OPTARG to the option character found. If getopts is not in\n" +" silent mode, and an invalid option is seen, getopts places '?' into\n" +" NAME and unsets OPTARG. If a required argument is not found, a '?'\n" +" is placed in NAME, OPTARG is unset, and a diagnostic message is\n" +" printed.\n" +" \n" +" If the shell variable OPTERR has the value 0, getopts disables the\n" +" printing of error messages, even if the first character of\n" +" OPTSTRING is not a colon. OPTERR has the value 1 by default.\n" +" \n" +" Getopts normally parses the positional parameters ($0 - $9), but if\n" +" more arguments are given, they are parsed instead.\n" +" \n" +" Exit Status:\n" +" Returns success if an option is found; fails if the end of options is\n" +" encountered or an error occurs." +msgstr "" + +#: builtins.c:685 +msgid "" +"Replace the shell with the given command.\n" +" \n" +" Execute COMMAND, replacing this shell with the specified program.\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not " +"specified,\n" +" any redirections take effect in the current shell.\n" +" \n" +" Options:\n" +" -a name\tpass NAME as the zeroth argument to COMMAND\n" +" -c\t\texecute COMMAND with an empty environment\n" +" -l\t\tplace a dash in the zeroth argument to COMMAND\n" +" \n" +" If the command cannot be executed, a non-interactive shell exits, " +"unless\n" +" the shell option `execfail' is set.\n" +" \n" +" Exit Status:\n" +" Returns success unless COMMAND is not found or a redirection error " +"occurs." +msgstr "" + +#: builtins.c:706 +msgid "" +"Exit the shell.\n" +" \n" +" Exits the shell with a status of N. If N is omitted, the exit status\n" +" is that of the last command executed." +msgstr "" + +#: builtins.c:715 +msgid "" +"Exit a login shell.\n" +" \n" +" Exits a login shell with exit status N. Returns an error if not " +"executed\n" +" in a login shell." +msgstr "" + +#: builtins.c:725 +msgid "" +"Display or execute commands from the history list.\n" +" \n" +" fc is used to list or edit and re-execute commands from the history " +"list.\n" +" FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" +" string, which means the most recent command beginning with that\n" +" string.\n" +" \n" +" Options:\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then " +"EDITOR,\n" +" \t\tthen vi\n" +" -l \tlist lines instead of editing\n" +" -n\tomit line numbers when listing\n" +" -r\treverse the order of the lines (newest listed first)\n" +" \n" +" With the `fc -s [pat=rep ...] [command]' format, COMMAND is\n" +" re-executed after the substitution OLD=NEW is performed.\n" +" \n" +" A useful alias to use with this is r='fc -s', so that typing `r cc'\n" +" runs the last command beginning with `cc' and typing `r' re-executes\n" +" the last command.\n" +" \n" +" Exit Status:\n" +" Returns success or status of executed command; non-zero if an error " +"occurs." +msgstr "" + +#: builtins.c:755 +msgid "" +"Move job to the foreground.\n" +" \n" +" Place the job identified by JOB_SPEC in the foreground, making it the\n" +" current job. If JOB_SPEC is not present, the shell's notion of the\n" +" current job is used.\n" +" \n" +" Exit Status:\n" +" Status of command placed in foreground, or failure if an error occurs." +msgstr "" + +#: builtins.c:770 +msgid "" +"Move jobs to the background.\n" +" \n" +" Place the jobs identified by each JOB_SPEC in the background, as if " +"they\n" +" had been started with `&'. If JOB_SPEC is not present, the shell's " +"notion\n" +" of the current job is used.\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" + +#: builtins.c:784 +msgid "" +"Remember or display program locations.\n" +" \n" +" Determine and remember the full pathname of each command NAME. If\n" +" no arguments are given, information about remembered commands is " +"displayed.\n" +" \n" +" Options:\n" +" -d\t\tforget the remembered location of each NAME\n" +" -l\t\tdisplay in a format that may be reused as input\n" +" -p pathname\tuse PATHNAME as the full pathname of NAME\n" +" -r\t\tforget all remembered locations\n" +" -t\t\tprint the remembered location of each NAME, preceding\n" +" \t\teach location with the corresponding NAME if multiple\n" +" \t\tNAMEs are given\n" +" Arguments:\n" +" NAME\t\tEach NAME is searched for in $PATH and added to the list\n" +" \t\tof remembered commands.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not found or an invalid option is given." +msgstr "" + +#: builtins.c:809 +msgid "" +"Display information about builtin commands.\n" +" \n" +" Displays brief summaries of builtin commands. If PATTERN is\n" +" specified, gives detailed help on all commands matching PATTERN,\n" +" otherwise the list of help topics is printed.\n" +" \n" +" Options:\n" +" -d\toutput short description for each topic\n" +" -m\tdisplay usage in pseudo-manpage format\n" +" -s\toutput only a short usage synopsis for each topic matching\n" +" \tPATTERN\n" +" \n" +" Arguments:\n" +" PATTERN\tPattern specifiying a help topic\n" +" \n" +" Exit Status:\n" +" Returns success unless PATTERN is not found or an invalid option is " +"given." +msgstr "" + +#: builtins.c:833 +msgid "" +"Display or manipulate the history list.\n" +" \n" +" Display the history list with line numbers, prefixing each modified\n" +" entry with a `*'. An argument of N lists only the last N entries.\n" +" \n" +" Options:\n" +" -c\tclear the history list by deleting all of the entries\n" +" -d offset\tdelete the history entry at offset OFFSET.\n" +" \n" +" -a\tappend history lines from this session to the history file\n" +" -n\tread all history lines not already read from the history file\n" +" -r\tread the history file and append the contents to the history\n" +" \tlist\n" +" -w\twrite the current history to the history file\n" +" \tand append them to the history list\n" +" \n" +" -p\tperform history expansion on each ARG and display the result\n" +" \twithout storing it in the history list\n" +" -s\tappend the ARGs to the history list as a single entry\n" +" \n" +" If FILENAME is given, it is used as the history file. Otherwise,\n" +" if $HISTFILE has a value, that is used, else ~/.bash_history.\n" +" \n" +" If the $HISTTIMEFORMAT variable is set and not null, its value is used\n" +" as a format string for strftime(3) to print the time stamp associated\n" +" with each displayed history entry. No time stamps are printed " +"otherwise.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" + +#: builtins.c:869 +msgid "" +"Display status of jobs.\n" +" \n" +" Lists the active jobs. JOBSPEC restricts output to that job.\n" +" Without options, the status of all active jobs is displayed.\n" +" \n" +" Options:\n" +" -l\tlists process IDs in addition to the normal information\n" +" -n\tlists only processes that have changed status since the last\n" +" \tnotification\n" +" -p\tlists process IDs only\n" +" -r\trestrict output to running jobs\n" +" -s\trestrict output to stopped jobs\n" +" \n" +" If -x is supplied, COMMAND is run after all job specifications that\n" +" appear in ARGS have been replaced with the process ID of that job's\n" +" process group leader.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs.\n" +" If -x is used, returns the exit status of COMMAND." +msgstr "" + +#: builtins.c:896 +msgid "" +"Remove jobs from current shell.\n" +" \n" +" Removes each JOBSPEC argument from the table of active jobs. Without\n" +" any JOBSPECs, the shell uses its notion of the current job.\n" +" \n" +" Options:\n" +" -a\tremove all jobs if JOBSPEC is not supplied\n" +" -h\tmark each JOBSPEC so that SIGHUP is not sent to the job if the\n" +" \tshell receives a SIGHUP\n" +" -r\tremove only running jobs\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option or JOBSPEC is given." +msgstr "" + +#: builtins.c:915 +msgid "" +"Send a signal to a job.\n" +" \n" +" Send the processes identified by PID or JOBSPEC the signal named by\n" +" SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n" +" SIGTERM is assumed.\n" +" \n" +" Options:\n" +" -s sig\tSIG is a signal name\n" +" -n sig\tSIG is a signal number\n" +" -l\tlist the signal names; if arguments follow `-l' they are\n" +" \tassumed to be signal numbers for which names should be listed\n" +" \n" +" Kill is a shell builtin for two reasons: it allows job IDs to be used\n" +" instead of process IDs, and allows processes to be killed if the limit\n" +" on processes that you can create is reached.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" + +#: builtins.c:938 +msgid "" +"Evaluate arithmetic expressions.\n" +" \n" +" Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" +" fixed-width integers with no check for overflow, though division by 0\n" +" is trapped and flagged as an error. The following list of operators is\n" +" grouped into levels of equal-precedence operators. The levels are " +"listed\n" +" in order of decreasing precedence.\n" +" \n" +" \tid++, id--\tvariable post-increment, post-decrement\n" +" \t++id, --id\tvariable pre-increment, pre-decrement\n" +" \t-, +\t\tunary minus, plus\n" +" \t!, ~\t\tlogical and bitwise negation\n" +" \t**\t\texponentiation\n" +" \t*, /, %\t\tmultiplication, division, remainder\n" +" \t+, -\t\taddition, subtraction\n" +" \t<<, >>\t\tleft and right bitwise shifts\n" +" \t<=, >=, <, >\tcomparison\n" +" \t==, !=\t\tequality, inequality\n" +" \t&\t\tbitwise AND\n" +" \t^\t\tbitwise XOR\n" +" \t|\t\tbitwise OR\n" +" \t&&\t\tlogical AND\n" +" \t||\t\tlogical OR\n" +" \texpr ? expr : expr\n" +" \t\t\tconditional operator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tassignment\n" +" \n" +" Shell variables are allowed as operands. The name of the variable\n" +" is replaced by its value (coerced to a fixed-width integer) within\n" +" an expression. The variable need not have its integer attribute\n" +" turned on to be used in an expression.\n" +" \n" +" Operators are evaluated in order of precedence. Sub-expressions in\n" +" parentheses are evaluated first and may override the precedence\n" +" rules above.\n" +" \n" +" Exit Status:\n" +" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." +msgstr "" + +#: builtins.c:983 +msgid "" +"Read a line from the standard input and split it into fields.\n" +" \n" +" Reads a single line from the standard input, or from file descriptor FD\n" +" if the -u option is supplied. The line is split into fields as with " +"word\n" +" splitting, and the first word is assigned to the first NAME, the second\n" +" word to the second NAME, and so on, with any leftover words assigned to\n" +" the last NAME. Only the characters found in $IFS are recognized as " +"word\n" +" delimiters.\n" +" \n" +" If no NAMEs are supplied, the line read is stored in the REPLY " +"variable.\n" +" \n" +" Options:\n" +" -a array\tassign the words read to sequential indices of the array\n" +" \t\tvariable ARRAY, starting at zero\n" +" -d delim\tcontinue until the first character of DELIM is read, rather\n" +" \t\tthan newline\n" +" -e\t\tuse Readline to obtain the line in an interactive shell\n" +" -i text\tUse TEXT as the initial text for Readline\n" +" -n nchars\treturn after reading NCHARS characters rather than waiting\n" +" \t\tfor a newline, but honor a delimiter if fewer than NCHARS\n" +" \t\tcharacters are read before the delimiter\n" +" -N nchars\treturn only after reading exactly NCHARS characters, " +"unless\n" +" \t\tEOF is encountered or read times out, ignoring any delimiter\n" +" -p prompt\toutput the string PROMPT without a trailing newline before\n" +" \t\tattempting to read\n" +" -r\t\tdo not allow backslashes to escape any characters\n" +" -s\t\tdo not echo input coming from a terminal\n" +" -t timeout\ttime out and return failure if a complete line of input " +"is\n" +" \t\tnot read within TIMEOUT seconds. The value of the TMOUT\n" +" \t\tvariable is the default timeout. TIMEOUT may be a\n" +" \t\tfractional number. If TIMEOUT is 0, read returns immediately,\n" +" \t\twithout trying to read any data, returning success only if\n" +" \t\tinput is available on the specified file descriptor. The\n" +" \t\texit status is greater than 128 if the timeout is exceeded\n" +" -u fd\t\tread from file descriptor FD instead of the standard input\n" +" \n" +" Exit Status:\n" +" The return code is zero, unless end-of-file is encountered, read times " +"out\n" +" (in which case it's greater than 128), a variable assignment error " +"occurs,\n" +" or an invalid file descriptor is supplied as the argument to -u." +msgstr "" + +#: builtins.c:1028 +msgid "" +"Return from a shell function.\n" +" \n" +" Causes a function or sourced script to exit with the return value\n" +" specified by N. If N is omitted, the return status is that of the\n" +" last command executed within the function or script.\n" +" \n" +" Exit Status:\n" +" Returns N, or failure if the shell is not executing a function or script." +msgstr "" + +#: builtins.c:1041 +msgid "" +"Set or unset values of shell options and positional parameters.\n" +" \n" +" Change the value of shell attributes and positional parameters, or\n" +" display the names and values of shell variables.\n" +" \n" +" Options:\n" +" -a Mark variables which are modified or created for export.\n" +" -b Notify of job termination immediately.\n" +" -e Exit immediately if a command exits with a non-zero status.\n" +" -f Disable file name generation (globbing).\n" +" -h Remember the location of commands as they are looked up.\n" +" -k All assignment arguments are placed in the environment for a\n" +" command, not just those that precede the command name.\n" +" -m Job control is enabled.\n" +" -n Read commands but do not execute them.\n" +" -o option-name\n" +" Set the variable corresponding to option-name:\n" +" allexport same as -a\n" +" braceexpand same as -B\n" +" emacs use an emacs-style line editing interface\n" +" errexit same as -e\n" +" errtrace same as -E\n" +" functrace same as -T\n" +" hashall same as -h\n" +" histexpand same as -H\n" +" history enable command history\n" +" ignoreeof the shell will not exit upon reading EOF\n" +" interactive-comments\n" +" allow comments to appear in interactive commands\n" +" keyword same as -k\n" +" monitor same as -m\n" +" noclobber same as -C\n" +" noexec same as -n\n" +" noglob same as -f\n" +" nolog currently accepted but ignored\n" +" notify same as -b\n" +" nounset same as -u\n" +" onecmd same as -t\n" +" physical same as -P\n" +" pipefail the return value of a pipeline is the status of\n" +" the last command to exit with a non-zero status,\n" +" or zero if no command exited with a non-zero " +"status\n" +" posix change the behavior of bash where the default\n" +" operation differs from the Posix standard to\n" +" match the standard\n" +" privileged same as -p\n" +" verbose same as -v\n" +" vi use a vi-style line editing interface\n" +" xtrace same as -x\n" +" -p Turned on whenever the real and effective user ids do not match.\n" +" Disables processing of the $ENV file and importing of shell\n" +" functions. Turning this option off causes the effective uid and\n" +" gid to be set to the real uid and gid.\n" +" -t Exit after reading and executing one command.\n" +" -u Treat unset variables as an error when substituting.\n" +" -v Print shell input lines as they are read.\n" +" -x Print commands and their arguments as they are executed.\n" +" -B the shell will perform brace expansion\n" +" -C If set, disallow existing regular files to be overwritten\n" +" by redirection of output.\n" +" -E If set, the ERR trap is inherited by shell functions.\n" +" -H Enable ! style history substitution. This flag is on\n" +" by default when the shell is interactive.\n" +" -P If set, do not resolve symbolic links when executing commands\n" +" such as cd which change the current directory.\n" +" -T If set, the DEBUG trap is inherited by shell functions.\n" +" -- Assign any remaining arguments to the positional parameters.\n" +" If there are no remaining arguments, the positional parameters\n" +" are unset.\n" +" - Assign any remaining arguments to the positional parameters.\n" +" The -x and -v options are turned off.\n" +" \n" +" Using + rather than - causes these flags to be turned off. The\n" +" flags can also be used upon invocation of the shell. The current\n" +" set of flags may be found in $-. The remaining n ARGs are positional\n" +" parameters and are assigned, in order, to $1, $2, .. $n. If no\n" +" ARGs are given, all shell variables are printed.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given." +msgstr "" + +#: builtins.c:1126 +msgid "" +"Unset values and attributes of shell variables and functions.\n" +" \n" +" For each NAME, remove the corresponding variable or function.\n" +" \n" +" Options:\n" +" -f\ttreat each NAME as a shell function\n" +" -v\ttreat each NAME as a shell variable\n" +" -n\ttreat each NAME as a name reference and unset the variable itself\n" +" \trather than the variable it references\n" +" \n" +" Without options, unset first tries to unset a variable, and if that " +"fails,\n" +" tries to unset a function.\n" +" \n" +" Some variables cannot be unset; also see `readonly'.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a NAME is read-only." +msgstr "" + +#: builtins.c:1148 +msgid "" +"Set export attribute for shell variables.\n" +" \n" +" Marks each NAME for automatic export to the environment of subsequently\n" +" executed commands. If VALUE is supplied, assign VALUE before " +"exporting.\n" +" \n" +" Options:\n" +" -f\trefer to shell functions\n" +" -n\tremove the export property from each NAME\n" +" -p\tdisplay a list of all exported variables and functions\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" + +#: builtins.c:1167 +msgid "" +"Mark shell variables as unchangeable.\n" +" \n" +" Mark each NAME as read-only; the values of these NAMEs may not be\n" +" changed by subsequent assignment. If VALUE is supplied, assign VALUE\n" +" before marking as read-only.\n" +" \n" +" Options:\n" +" -a\trefer to indexed array variables\n" +" -A\trefer to associative array variables\n" +" -f\trefer to shell functions\n" +" -p\tdisplay a list of all readonly variables or functions, depending " +"on\n" +" whether or not the -f option is given\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" + +#: builtins.c:1189 +msgid "" +"Shift positional parameters.\n" +" \n" +" Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n" +" not given, it is assumed to be 1.\n" +" \n" +" Exit Status:\n" +" Returns success unless N is negative or greater than $#." +msgstr "" + +#: builtins.c:1201 builtins.c:1216 +msgid "" +"Execute commands from a file in the current shell.\n" +" \n" +" Read and execute commands from FILENAME in the current shell. The\n" +" entries in $PATH are used to find the directory containing FILENAME.\n" +" If any ARGUMENTS are supplied, they become the positional parameters\n" +" when FILENAME is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed in FILENAME; fails if\n" +" FILENAME cannot be read." +msgstr "" + +#: builtins.c:1232 +msgid "" +"Suspend shell execution.\n" +" \n" +" Suspend the execution of this shell until it receives a SIGCONT signal.\n" +" Unless forced, login shells cannot be suspended.\n" +" \n" +" Options:\n" +" -f\tforce the suspend, even if the shell is a login shell\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" + +#: builtins.c:1248 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" Exits with a status of 0 (true) or 1 (false) depending on\n" +" the evaluation of EXPR. Expressions may be unary or binary. Unary\n" +" expressions are often used to examine the status of a file. There\n" +" are string operators and numeric comparison operators as well.\n" +" \n" +" The behavior of test depends on the number of arguments. Read the\n" +" bash manual page for the complete specification.\n" +" \n" +" File operators:\n" +" \n" +" -a FILE True if file exists.\n" +" -b FILE True if file is block special.\n" +" -c FILE True if file is character special.\n" +" -d FILE True if file is a directory.\n" +" -e FILE True if file exists.\n" +" -f FILE True if file exists and is a regular file.\n" +" -g FILE True if file is set-group-id.\n" +" -h FILE True if file is a symbolic link.\n" +" -L FILE True if file is a symbolic link.\n" +" -k FILE True if file has its `sticky' bit set.\n" +" -p FILE True if file is a named pipe.\n" +" -r FILE True if file is readable by you.\n" +" -s FILE True if file exists and is not empty.\n" +" -S FILE True if file is a socket.\n" +" -t FD True if FD is opened on a terminal.\n" +" -u FILE True if the file is set-user-id.\n" +" -w FILE True if the file is writable by you.\n" +" -x FILE True if the file is executable by you.\n" +" -O FILE True if the file is effectively owned by you.\n" +" -G FILE True if the file is effectively owned by your group.\n" +" -N FILE True if the file has been modified since it was last " +"read.\n" +" \n" +" FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" +" modification date).\n" +" \n" +" FILE1 -ot FILE2 True if file1 is older than file2.\n" +" \n" +" FILE1 -ef FILE2 True if file1 is a hard link to file2.\n" +" \n" +" String operators:\n" +" \n" +" -z STRING True if string is empty.\n" +" \n" +" -n STRING\n" +" STRING True if string is not empty.\n" +" \n" +" STRING1 = STRING2\n" +" True if the strings are equal.\n" +" STRING1 != STRING2\n" +" True if the strings are not equal.\n" +" STRING1 < STRING2\n" +" True if STRING1 sorts before STRING2 " +"lexicographically.\n" +" STRING1 > STRING2\n" +" True if STRING1 sorts after STRING2 lexicographically.\n" +" \n" +" Other operators:\n" +" \n" +" -o OPTION True if the shell option OPTION is enabled.\n" +" -v VAR\t True if the shell variable VAR is set\n" +" -R VAR\t True if the shell variable VAR is set and is a name " +"reference.\n" +" ! EXPR True if expr is false.\n" +" EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n" +" EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n" +" \n" +" arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Arithmetic binary operators return true if ARG1 is equal, not-equal,\n" +" less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n" +" than ARG2.\n" +" \n" +" Exit Status:\n" +" Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n" +" false or an invalid argument is given." +msgstr "" + +#: builtins.c:1329 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" This is a synonym for the \"test\" builtin, but the last argument must\n" +" be a literal `]', to match the opening `['." +msgstr "" + +#: builtins.c:1338 +msgid "" +"Display process times.\n" +" \n" +" Prints the accumulated user and system times for the shell and all of " +"its\n" +" child processes.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" + +#: builtins.c:1350 +msgid "" +"Trap signals and other events.\n" +" \n" +" Defines and activates handlers to be run when the shell receives " +"signals\n" +" or other conditions.\n" +" \n" +" ARG is a command to be read and executed when the shell receives the\n" +" signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n" +" is supplied) or `-', each specified signal is reset to its original\n" +" value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" +" shell and by the commands it invokes.\n" +" \n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. " +"If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. " +"If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or " +"a\n" +" script run by the . or source builtins finishes executing. A " +"SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause " +"the\n" +" shell to exit when the -e option is enabled.\n" +" \n" +" If no arguments are supplied, trap prints the list of commands " +"associated\n" +" with each signal.\n" +" \n" +" Options:\n" +" -l\tprint a list of signal names and their corresponding numbers\n" +" -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" +" \n" +" Each SIGNAL_SPEC is either a signal name in or a signal " +"number.\n" +" Signal names are case insensitive and the SIG prefix is optional. A\n" +" signal may be sent to the shell with \"kill -signal $$\".\n" +" \n" +" Exit Status:\n" +" Returns success unless a SIGSPEC is invalid or an invalid option is " +"given." +msgstr "" + +#: builtins.c:1386 +msgid "" +"Display information about command type.\n" +" \n" +" For each NAME, indicate how it would be interpreted if used as a\n" +" command name.\n" +" \n" +" Options:\n" +" -a\tdisplay all locations containing an executable named NAME;\n" +" \tincludes aliases, builtins, and functions, if and only if\n" +" \tthe `-p' option is not also used\n" +" -f\tsuppress shell function lookup\n" +" -P\tforce a PATH search for each NAME, even if it is an alias,\n" +" \tbuiltin, or function, and returns the name of the disk file\n" +" \tthat would be executed\n" +" -p\treturns either the name of the disk file that would be executed,\n" +" \tor nothing if `type -t NAME' would not return `file'.\n" +" -t\toutput a single word which is one of `alias', `keyword',\n" +" \t`function', `builtin', `file' or `', if NAME is an alias, shell\n" +" \treserved word, shell function, shell builtin, disk file, or not\n" +" \tfound, respectively\n" +" \n" +" Arguments:\n" +" NAME\tCommand name to be interpreted.\n" +" \n" +" Exit Status:\n" +" Returns success if all of the NAMEs are found; fails if any are not " +"found." +msgstr "" + +#: builtins.c:1417 +msgid "" +"Modify shell resource limits.\n" +" \n" +" Provides control over the resources available to the shell and " +"processes\n" +" it creates, on systems that allow such control.\n" +" \n" +" Options:\n" +" -S\tuse the `soft' resource limit\n" +" -H\tuse the `hard' resource limit\n" +" -a\tall current limits are reported\n" +" -b\tthe socket buffer size\n" +" -c\tthe maximum size of core files created\n" +" -d\tthe maximum size of a process's data segment\n" +" -e\tthe maximum scheduling priority (`nice')\n" +" -f\tthe maximum size of files written by the shell and its children\n" +" -i\tthe maximum number of pending signals\n" +" -l\tthe maximum size a process may lock into memory\n" +" -m\tthe maximum resident set size\n" +" -n\tthe maximum number of open file descriptors\n" +" -p\tthe pipe buffer size\n" +" -q\tthe maximum number of bytes in POSIX message queues\n" +" -r\tthe maximum real-time scheduling priority\n" +" -s\tthe maximum stack size\n" +" -t\tthe maximum amount of cpu time in seconds\n" +" -u\tthe maximum number of user processes\n" +" -v\tthe size of virtual memory\n" +" -x\tthe maximum number of file locks\n" +" -T the maximum number of threads\n" +" \n" +" Not all options are available on all platforms.\n" +" \n" +" If LIMIT is given, it is the new value of the specified resource; the\n" +" special LIMIT values `soft', `hard', and `unlimited' stand for the\n" +" current soft limit, the current hard limit, and no limit, respectively.\n" +" Otherwise, the current value of the specified resource is printed. If\n" +" no option is given, then -f is assumed.\n" +" \n" +" Values are in 1024-byte increments, except for -t, which is in seconds,\n" +" -p, which is in increments of 512 bytes, and -u, which is an unscaled\n" +" number of processes.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1465 +msgid "" +"Display or set file mode mask.\n" +" \n" +" Sets the user file-creation mask to MODE. If MODE is omitted, prints\n" +" the current value of the mask.\n" +" \n" +" If MODE begins with a digit, it is interpreted as an octal number;\n" +" otherwise it is a symbolic mode string like that accepted by chmod(1).\n" +" \n" +" Options:\n" +" -p\tif MODE is omitted, output in a form that may be reused as input\n" +" -S\tmakes the output symbolic; otherwise an octal number is output\n" +" \n" +" Exit Status:\n" +" Returns success unless MODE is invalid or an invalid option is given." +msgstr "" + +#: builtins.c:1485 +msgid "" +"Wait for job completion and return exit status.\n" +" \n" +" Waits for each process identified by an ID, which may be a process ID or " +"a\n" +" job specification, and reports its termination status. If ID is not\n" +" given, waits for all currently active child processes, and the return\n" +" status is zero. If ID is a a job specification, waits for all " +"processes\n" +" in that job's pipeline.\n" +" \n" +" If the -n option is supplied, waits for the next job to terminate and\n" +" returns its exit status.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last ID; fails if ID is invalid or an invalid\n" +" option is given." +msgstr "" + +#: builtins.c:1506 +msgid "" +"Wait for process completion and return exit status.\n" +" \n" +" Waits for each process specified by a PID and reports its termination " +"status.\n" +" If PID is not given, waits for all currently active child processes,\n" +" and the return status is zero. PID must be a process ID.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last PID; fails if PID is invalid or an " +"invalid\n" +" option is given." +msgstr "" + +#: builtins.c:1521 +msgid "" +"Execute commands for each member in a list.\n" +" \n" +" The `for' loop executes a sequence of commands for each member in a\n" +" list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is\n" +" assumed. For each element in WORDS, NAME is set to that element, and\n" +" the COMMANDS are executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1535 +msgid "" +"Arithmetic for loop.\n" +" \n" +" Equivalent to\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n" +" omitted, it behaves as if it evaluates to 1.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1553 +msgid "" +"Select words from a list and execute commands.\n" +" \n" +" The WORDS are expanded, generating a list of words. The\n" +" set of expanded words is printed on the standard error, each\n" +" preceded by a number. If `in WORDS' is not present, `in \"$@\"'\n" +" is assumed. The PS3 prompt is then displayed and a line read\n" +" from the standard input. If the line consists of the number\n" +" corresponding to one of the displayed words, then NAME is set\n" +" to that word. If the line is empty, WORDS and the prompt are\n" +" redisplayed. If EOF is read, the command completes. Any other\n" +" value read causes NAME to be set to null. The line read is saved\n" +" in the variable REPLY. COMMANDS are executed after each selection\n" +" until a break command is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1574 +msgid "" +"Report time consumed by pipeline's execution.\n" +" \n" +" Execute PIPELINE and print a summary of the real time, user CPU time,\n" +" and system CPU time spent executing PIPELINE when it terminates.\n" +" \n" +" Options:\n" +" -p\tprint the timing summary in the portable Posix format\n" +" \n" +" The value of the TIMEFORMAT variable is used as the output format.\n" +" \n" +" Exit Status:\n" +" The return status is the return status of PIPELINE." +msgstr "" + +#: builtins.c:1591 +msgid "" +"Execute commands based on pattern matching.\n" +" \n" +" Selectively execute COMMANDS based upon WORD matching PATTERN. The\n" +" `|' is used to separate multiple patterns.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1603 +msgid "" +"Execute commands based on conditional.\n" +" \n" +" The `if COMMANDS' list is executed. If its exit status is zero, then " +"the\n" +" `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list " +"is\n" +" executed in turn, and if its exit status is zero, the corresponding\n" +" `then COMMANDS' list is executed and the if command completes. " +"Otherwise,\n" +" the `else COMMANDS' list is executed, if present. The exit status of " +"the\n" +" entire construct is the exit status of the last command executed, or " +"zero\n" +" if no condition tested true.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1620 +msgid "" +"Execute commands as long as a test succeeds.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `while' COMMANDS has an exit status of zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1632 +msgid "" +"Execute commands as long as a test does not succeed.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `until' COMMANDS has an exit status which is not zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1644 +msgid "" +"Create a coprocess named NAME.\n" +" \n" +" Execute COMMAND asynchronously, with the standard output and standard\n" +" input of the command connected via a pipe to file descriptors assigned\n" +" to indices 0 and 1 of an array variable NAME in the executing shell.\n" +" The default NAME is \"COPROC\".\n" +" \n" +" Exit Status:\n" +" Returns the exit status of COMMAND." +msgstr "" + +#: builtins.c:1658 +msgid "" +"Define shell function.\n" +" \n" +" Create a shell function named NAME. When invoked as a simple command,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is " +"invoked,\n" +" the arguments are passed to the function as $1...$n, and the function's\n" +" name is in $FUNCNAME.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is readonly." +msgstr "" + +#: builtins.c:1672 +msgid "" +"Group commands as a unit.\n" +" \n" +" Run a set of commands in a group. This is one way to redirect an\n" +" entire set of commands.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1684 +msgid "" +"Resume job in foreground.\n" +" \n" +" Equivalent to the JOB_SPEC argument to the `fg' command. Resume a\n" +" stopped or background job. JOB_SPEC can specify either a job name\n" +" or a job number. Following JOB_SPEC with a `&' places the job in\n" +" the background, as if the job specification had been supplied as an\n" +" argument to `bg'.\n" +" \n" +" Exit Status:\n" +" Returns the status of the resumed job." +msgstr "" + +#: builtins.c:1699 +msgid "" +"Evaluate arithmetic expression.\n" +" \n" +" The EXPRESSION is evaluated according to the rules for arithmetic\n" +" evaluation. Equivalent to \"let EXPRESSION\".\n" +" \n" +" Exit Status:\n" +" Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise." +msgstr "" + +#: builtins.c:1711 +msgid "" +"Execute conditional command.\n" +" \n" +" Returns a status of 0 or 1 depending on the evaluation of the " +"conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries " +"used\n" +" by the `test' builtin, and may be combined using the following " +"operators:\n" +" \n" +" ( EXPRESSION )\tReturns the value of EXPRESSION\n" +" ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" +" EXPR1 && EXPR2\tTrue if both EXPR1 and EXPR2 are true; else false\n" +" EXPR1 || EXPR2\tTrue if either EXPR1 or EXPR2 is true; else false\n" +" \n" +" When the `==' and `!=' operators are used, the string to the right of\n" +" the operator is used as a pattern and pattern matching is performed.\n" +" When the `=~' operator is used, the string to the right of the operator\n" +" is matched as a regular expression.\n" +" \n" +" The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n" +" determine the expression's value.\n" +" \n" +" Exit Status:\n" +" 0 or 1 depending on value of EXPRESSION." +msgstr "" + +#: builtins.c:1737 +msgid "" +"Common shell variable names and usage.\n" +" \n" +" BASH_VERSION\tVersion information for this Bash.\n" +" CDPATH\tA colon-separated list of directories to search\n" +" \t\tfor directories given as arguments to `cd'.\n" +" GLOBIGNORE\tA colon-separated list of patterns describing filenames to\n" +" \t\tbe ignored by pathname expansion.\n" +" HISTFILE\tThe name of the file where your command history is stored.\n" +" HISTFILESIZE\tThe maximum number of lines this file can contain.\n" +" HISTSIZE\tThe maximum number of history lines that a running\n" +" \t\tshell can access.\n" +" HOME\tThe complete pathname to your login directory.\n" +" HOSTNAME\tThe name of the current host.\n" +" HOSTTYPE\tThe type of CPU this version of Bash is running under.\n" +" IGNOREEOF\tControls the action of the shell on receipt of an EOF\n" +" \t\tcharacter as the sole input. If set, then the value\n" +" \t\tof it is the number of EOF characters that can be seen\n" +" \t\tin a row on an empty line before the shell will exit\n" +" \t\t(default 10). When unset, EOF signifies the end of input.\n" +" MACHTYPE\tA string describing the current system Bash is running on.\n" +" MAILCHECK\tHow often, in seconds, Bash checks for new mail.\n" +" MAILPATH\tA colon-separated list of filenames which Bash checks\n" +" \t\tfor new mail.\n" +" OSTYPE\tThe version of Unix this version of Bash is running on.\n" +" PATH\tA colon-separated list of directories to search when\n" +" \t\tlooking for commands.\n" +" PROMPT_COMMAND\tA command to be executed before the printing of each\n" +" \t\tprimary prompt.\n" +" PS1\t\tThe primary prompt string.\n" +" PS2\t\tThe secondary prompt string.\n" +" PWD\t\tThe full pathname of the current directory.\n" +" SHELLOPTS\tA colon-separated list of enabled shell options.\n" +" TERM\tThe name of the current terminal type.\n" +" TIMEFORMAT\tThe output format for timing statistics displayed by the\n" +" \t\t`time' reserved word.\n" +" auto_resume\tNon-null means a command word appearing on a line by\n" +" \t\titself is first looked for in the list of currently\n" +" \t\tstopped jobs. If found there, that job is foregrounded.\n" +" \t\tA value of `exact' means that the command word must\n" +" \t\texactly match a command in the list of stopped jobs. A\n" +" \t\tvalue of `substring' means that the command word must\n" +" \t\tmatch a substring of the job. Any other value means that\n" +" \t\tthe command must be a prefix of a stopped job.\n" +" histchars\tCharacters controlling history expansion and quick\n" +" \t\tsubstitution. The first character is the history\n" +" \t\tsubstitution character, usually `!'. The second is\n" +" \t\tthe `quick substitution' character, usually `^'. The\n" +" \t\tthird is the `history comment' character, usually `#'.\n" +" HISTIGNORE\tA colon-separated list of patterns used to decide which\n" +" \t\tcommands should be saved on the history list.\n" +msgstr "" + +#: builtins.c:1794 +msgid "" +"Add directories to stack.\n" +" \n" +" Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" + +#: builtins.c:1828 +msgid "" +"Remove directories from stack.\n" +" \n" +" Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" + +#: builtins.c:1858 +msgid "" +"Display directory stack.\n" +" \n" +" Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1887 +msgid "" +"Set and unset shell options.\n" +" \n" +" Change the setting of each shell option OPTNAME. Without any option\n" +" arguments, list all shell options with an indication of whether or not " +"each\n" +" is set.\n" +" \n" +" Options:\n" +" -o\trestrict OPTNAMEs to those defined for use with `set -o'\n" +" -p\tprint each shell option with an indication of its status\n" +" -q\tsuppress output\n" +" -s\tenable (set) each OPTNAME\n" +" -u\tdisable (unset) each OPTNAME\n" +" \n" +" Exit Status:\n" +" Returns success if OPTNAME is enabled; fails if an invalid option is\n" +" given or OPTNAME is disabled." +msgstr "" + +#: builtins.c:1908 +msgid "" +"Formats and prints ARGUMENTS under control of the FORMAT.\n" +" \n" +" Options:\n" +" -v var\tassign the output to shell variable VAR rather than\n" +" \t\tdisplay it on the standard output\n" +" \n" +" FORMAT is a character string which contains three types of objects: " +"plain\n" +" characters, which are simply copied to standard output; character " +"escape\n" +" sequences, which are converted and copied to the standard output; and\n" +" format specifications, each of which causes printing of the next " +"successive\n" +" argument.\n" +" \n" +" In addition to the standard format specifications described in " +"printf(1),\n" +" printf interprets:\n" +" \n" +" %b\texpand backslash escape sequences in the corresponding argument\n" +" %q\tquote the argument in a way that can be reused as shell input\n" +" %(fmt)T output the date-time string resulting from using FMT as a " +"format\n" +" string for strftime(3)\n" +" \n" +" The format is re-used as necessary to consume all of the arguments. If\n" +" there are fewer arguments than the format requires, extra format\n" +" specifications behave as if a zero value or null string, as " +"appropriate,\n" +" had been supplied.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a write or " +"assignment\n" +" error occurs." +msgstr "" + +#: builtins.c:1942 +msgid "" +"Specify how arguments are to be completed by Readline.\n" +" \n" +" For each NAME, specify how arguments are to be completed. If no " +"options\n" +" are supplied, existing completion specifications are printed in a way " +"that\n" +" allows them to be reused as input.\n" +" \n" +" Options:\n" +" -p\tprint existing completion specifications in a reusable format\n" +" -r\tremove a completion specification for each NAME, or, if no\n" +" \tNAMEs are supplied, all completion specifications\n" +" -D\tapply the completions and actions as the default for commands\n" +" \twithout any specific completion defined\n" +" -E\tapply the completions and actions to \"empty\" commands --\n" +" \tcompletion attempted on a blank line\n" +" \n" +" When completion is attempted, the actions are applied in the order the\n" +" uppercase-letter options are listed above. The -D option takes\n" +" precedence over -E.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1970 +msgid "" +"Display possible completions depending on the options.\n" +" \n" +" Intended to be used from within a shell function generating possible\n" +" completions. If the optional WORD argument is supplied, matches " +"against\n" +" WORD are generated.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1985 +msgid "" +"Modify or display completion options.\n" +" \n" +" Modify the completion options for each NAME, or, if no NAMEs are " +"supplied,\n" +" the completion currently being executed. If no OPTIONs are given, " +"print\n" +" the completion options for each NAME or the current completion " +"specification.\n" +" \n" +" Options:\n" +" \t-o option\tSet completion option OPTION for each NAME\n" +" \t-D\t\tChange options for the \"default\" command completion\n" +" \t-E\t\tChange options for the \"empty\" command completion\n" +" \n" +" Using `+o' instead of `-o' turns off the specified option.\n" +" \n" +" Arguments:\n" +" \n" +" Each NAME refers to a command for which a completion specification must\n" +" have previously been defined using the `complete' builtin. If no NAMEs\n" +" are supplied, compopt must be called by a function currently generating\n" +" completions, and the options for that currently-executing completion\n" +" generator are modified.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or NAME does not\n" +" have a completion specification defined." +msgstr "" + +#: builtins.c:2015 +msgid "" +"Read lines from the standard input into an indexed array variable.\n" +" \n" +" Read lines from the standard input into the indexed array variable " +"ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable " +"MAPFILE\n" +" is the default ARRAY.\n" +" \n" +" Options:\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are " +"copied.\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default " +"index is 0.\n" +" -s count \tDiscard the first COUNT lines read.\n" +" -t\t\tRemove a trailing newline from each line read.\n" +" -u fd\t\tRead lines from file descriptor FD instead of the standard " +"input.\n" +" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read.\n" +" -c quantum\tSpecify the number of lines read between each call to " +"CALLBACK.\n" +" \n" +" Arguments:\n" +" ARRAY\t\tArray variable name to use for file data.\n" +" \n" +" If -C is supplied without -c, the default quantum is 5000. When\n" +" CALLBACK is evaluated, it is supplied the index of the next array\n" +" element to be assigned and the line to be assigned to that element\n" +" as additional arguments.\n" +" \n" +" If not supplied with an explicit origin, mapfile will clear ARRAY " +"before\n" +" assigning to it.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or ARRAY is readonly " +"or\n" +" not an indexed array." +msgstr "" + +#: builtins.c:2049 +msgid "" +"Read lines from a file into an array variable.\n" +" \n" +" A synonym for `mapfile'." +msgstr "" + +#, fuzzy +#~ msgid "Copyright (C) 2009 Free Software Foundation, Inc.\n" +#~ msgstr "Autoriõigus © 2006 Free Software Foundation, Inc.\n" + +#~ msgid " " +#~ msgstr " " + +#~ msgid "freed" +#~ msgstr "vabastatud" diff --git a/po/fi.gmo b/po/fi.gmo new file mode 100644 index 0000000000000000000000000000000000000000..4390eac12c317d025b1cf4060c5584a7b2969237 GIT binary patch literal 102765 zcmeFa37i~Pb?;xpW?Eo2vx9M2mXL%sS}az{HXchOOIVs2G$R`$gr+sqGt-)$?shMd z2Fw})VJ8>}ge5?n0Ab$@gv9}~g`Kb@B!o32gb)Jng%?5|$@~7!xwopiXGRkI$>;z7 zygy@?eqB|!?sD!q=bm%!ty|x?%dK9V@b|reB)KoR>yAnCj9Vm0?S8tNB)_vhNge<` z6TA!fE^rO_32+toL+}pZzk#;_Z?hpu^yt~(UBQjudEgLucd!hWz?0ye!Ka4nFADg^ zfFA)>-q*l$!5@NDEm=inQt;m3Ip7ZP9^fdr1Dpj_&L0N+Q;@19Uj$c!KL=H>b1(Gv zUIgBs^U;9E!Ofh%GT>*yyK(-Dfah#Xl1-d%0M*V%fhz9=cu(+o;C;Z?fvWe-pz8T; zQ04zLoZoXWN$$k?Mo{T40aeZ+P~~46&R-MoJ)r3ES&;veZ-wi3pfc*WHK6hv0`CPL z2LzU4}K2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qP{?Dfr&JS{&mDvc=~A5mo`= z(3;=TyLpfa5pY0i_3PN61G!RFc(*vaJU<|fCykGx5P?0;FTm{PPey)N9pxw5${J2@I0*#0?isn#K#%7T(!RKIx8Bv~MR8c# z4ne$vBhGn+21~y3QWNI)W9-Z2#TbsZu*b}{TQ~3=Wym09q9SgkZl~)XM!T^RQ$bm8 zWElf^<#q@*(#MM~wt|llHgFDB4+4RgP6d-00lCCO6cg&d8G z^UEpz;9Mh_9L+DD?j?ZI@0&~Qm>4LKzwB({U3(pAM45^JPV1)|NTp>?9otIsR?v0N zCie1EcZNj0JAADT*V{hso-|wFN-yQIC9`Ht{ir*praV-p?>C$5=spY~>Db00__J$A z-Y8euBw>7)yG8Ual!6T{WpCI{35U4rziA|c7H&F#Dn*d*wE>B!w5%nd1~acOXySHR ze*0@fdfm7;y~e?rKEbE-j9BU^hR$nA{=VT~X^;-gHb4=XSJd^tmOUHd-G+RFXI%x4 zV?Psqu@&ea1Cb%7D!?13Z-55Lv{HSnMpa_;HugMQE)EferQ-@<-H-U~eIQ9;CHV(- z%QC-v*xn#dz;Ey4v8<1trsJ#-YuiYq)z$|E)X9bp*a=0{1i(7XDaYagS^8fyv!VY0 tmwsFjT#a>#Ly*}~xw@ESCru0EZ*KI$@M^nN5PeM+C^q||8v@nce*x~d25kTU literal 0 HcmV?d00001 diff --git a/po/fi.po b/po/fi.po new file mode 100644 index 0000000..81599a2 --- /dev/null +++ b/po/fi.po @@ -0,0 +1,5636 @@ +# Finnish translation for bash-4.0 +# Copyright (C) 2009 Free Software Foundation, Inc. +# This file is distributed under the same license as the bash-4.0 package. +# +# Pekka Niemi, 2009. +# Pekka Niemi , 2009. +# $Id: bash-4.0.fi.po 38 2009-05-09 12:21:42Z pen $ +msgid "" +msgstr "" +"Project-Id-Version: bash-4.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-02-11 11:19-0500\n" +"PO-Revision-Date: 2009-05-09 15:13+0300\n" +"Last-Translator: Pekka Niemi \n" +"Language-Team: Finnish \n" +"Language: fi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 0.3\n" + +#: arrayfunc.c:51 +msgid "bad array subscript" +msgstr "virheellinen taulukkoindeksi" + +#: arrayfunc.c:356 builtins/declare.def:566 +#, c-format +msgid "%s: cannot convert indexed to associative array" +msgstr "%s: indeksoitua taulukkoa ei voi muuttaa assosiatiiviseksi" + +#: arrayfunc.c:539 +#, c-format +msgid "%s: invalid associative array key" +msgstr "%s: virheellinen assosiatiivinen indeksi" + +#: arrayfunc.c:541 +#, c-format +msgid "%s: cannot assign to non-numeric index" +msgstr "%s: ei voida sijoittaa epänumeeriseen indeksiin" + +#: arrayfunc.c:586 +#, c-format +msgid "%s: %s: must use subscript when assigning associative array" +msgstr "" +"%s: %s: assosiatiiviseen taulukkoon sijoitettaessa täytyy käyttää " +"avainindeksiä" + +#: bashhist.c:388 +#, c-format +msgid "%s: cannot create: %s" +msgstr "%s: ei voida luoda: %s" + +#: bashline.c:3982 +msgid "bash_execute_unix_command: cannot find keymap for command" +msgstr "bash_execute_unix_command: komennolle ei löydy näppäinkarttaa" + +#: bashline.c:4069 +#, c-format +msgid "%s: first non-whitespace character is not `\"'" +msgstr "%s: ensimmäinen ei-tyhjä merkki ei ole ”\"”" + +#: bashline.c:4098 +#, c-format +msgid "no closing `%c' in %s" +msgstr "ei loppumerkkiä ”%c” rivissä %s" + +#: bashline.c:4132 +#, c-format +msgid "%s: missing colon separator" +msgstr "%s: puuttuva kaksoispiste-erotin" + +#: braces.c:321 +#, c-format +msgid "brace expansion: cannot allocate memory for %s" +msgstr "" + +#: braces.c:413 +#, c-format +msgid "brace expansion: failed to allocate memory for %d elements" +msgstr "" + +#: braces.c:452 +#, c-format +msgid "brace expansion: failed to allocate memory for `%s'" +msgstr "" + +#: builtins/alias.def:132 +#, fuzzy, c-format +msgid "`%s': invalid alias name" +msgstr "”%s”: virheellinen näppäinkartan nimi" + +#: builtins/bind.def:123 builtins/bind.def:126 +msgid "line editing not enabled" +msgstr "rivieditointi ei ole käytössä" + +#: builtins/bind.def:212 +#, c-format +msgid "`%s': invalid keymap name" +msgstr "”%s”: virheellinen näppäinkartan nimi" + +#: builtins/bind.def:251 +#, c-format +msgid "%s: cannot read: %s" +msgstr "%s: ei voida lukea: %s" + +#: builtins/bind.def:266 +#, c-format +msgid "`%s': cannot unbind" +msgstr "”%s”: ei voida irrottaa" + +#: builtins/bind.def:304 builtins/bind.def:334 +#, c-format +msgid "`%s': unknown function name" +msgstr "”%s”: tuntematon funktio" + +#: builtins/bind.def:312 +#, c-format +msgid "%s is not bound to any keys.\n" +msgstr "%s ei ole sidottu mihinkään näppäimeen.\n" + +#: builtins/bind.def:316 +#, c-format +msgid "%s can be invoked via " +msgstr "%s voidaan käynnistää näppäinkomennolla " + +#: builtins/break.def:77 builtins/break.def:117 +msgid "loop count" +msgstr "toistolaskuri" + +#: builtins/break.def:137 +msgid "only meaningful in a `for', `while', or `until' loop" +msgstr "voidaan käyttää vain ”for”-, ”while”- tai ”until”-silmukoissa" + +#: builtins/caller.def:134 +msgid "" +"Returns the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns " +msgstr "" +"Palauttaa nykyisen alirutiinikutsun kontekstin.\n" +" \n" +" Ilman LAUSEKETTA palauttaa" + +#: builtins/cd.def:319 +msgid "HOME not set" +msgstr "HOME-ympäristömuuttujaa ei ole asetettu" + +#: builtins/cd.def:327 builtins/common.c:166 test.c:876 +msgid "too many arguments" +msgstr "liian monta argumenttia" + +#: builtins/cd.def:338 +msgid "OLDPWD not set" +msgstr "OLDPWD-ympäristömuuttujaa ei ole asetettu" + +#: builtins/common.c:101 +#, c-format +msgid "line %d: " +msgstr "rivi %d: " + +#: builtins/common.c:139 error.c:265 +#, c-format +msgid "warning: " +msgstr "varoitus: " + +#: builtins/common.c:153 +#, c-format +msgid "%s: usage: " +msgstr "%s: käyttö: " + +#: builtins/common.c:191 shell.c:506 shell.c:788 +#, c-format +msgid "%s: option requires an argument" +msgstr "%s: valitsin vaatii argumentin" + +#: builtins/common.c:198 +#, c-format +msgid "%s: numeric argument required" +msgstr "%s: vaaditaan numeerinen argumentti" + +#: builtins/common.c:205 +#, c-format +msgid "%s: not found" +msgstr "%s: ei löytynyt" + +#: builtins/common.c:214 shell.c:801 +#, c-format +msgid "%s: invalid option" +msgstr "%s: virheellinen valitsin" + +#: builtins/common.c:221 +#, c-format +msgid "%s: invalid option name" +msgstr "%s: virheellinen valitsimen nimi" + +#: builtins/common.c:228 general.c:235 general.c:240 +#, c-format +msgid "`%s': not a valid identifier" +msgstr "”%s”: virheellinen tunniste" + +#: builtins/common.c:238 +msgid "invalid octal number" +msgstr "virheellinen oktaaliluku" + +#: builtins/common.c:240 +msgid "invalid hex number" +msgstr "virheellinen heksadesimaaliluku" + +#: builtins/common.c:242 expr.c:1470 +msgid "invalid number" +msgstr "virheellinen luku" + +#: builtins/common.c:250 +#, c-format +msgid "%s: invalid signal specification" +msgstr "%s: virheellinen signaalimääritys" + +#: builtins/common.c:257 +#, c-format +msgid "`%s': not a pid or valid job spec" +msgstr "”%s”: ei ole prosessitunnus eikä kelvollinen työtunniste" + +#: builtins/common.c:264 error.c:488 +#, c-format +msgid "%s: readonly variable" +msgstr "%s: kirjoitussuojattu muuttuja" + +#: builtins/common.c:272 +#, c-format +msgid "%s: %s out of range" +msgstr "%s: %s rajojen ulkopuolella" + +#: builtins/common.c:272 builtins/common.c:274 +msgid "argument" +msgstr "argumentti" + +#: builtins/common.c:274 +#, c-format +msgid "%s out of range" +msgstr "%s rajojen ulkopuolella" + +#: builtins/common.c:282 +#, c-format +msgid "%s: no such job" +msgstr "%s: työtä ei löydy" + +#: builtins/common.c:290 +#, c-format +msgid "%s: no job control" +msgstr "%s: ei työnohjausta" + +#: builtins/common.c:292 +msgid "no job control" +msgstr "ei työnohjausta" + +#: builtins/common.c:302 +#, c-format +msgid "%s: restricted" +msgstr "%s: rajoitettu" + +#: builtins/common.c:304 +msgid "restricted" +msgstr "rajoitettu" + +#: builtins/common.c:312 +#, c-format +msgid "%s: not a shell builtin" +msgstr "%s: ei ole komentotulkin sisäänrakennettu komento" + +#: builtins/common.c:321 +#, c-format +msgid "write error: %s" +msgstr "kirjoitusvirhe: %s" + +#: builtins/common.c:329 +#, c-format +msgid "error setting terminal attributes: %s" +msgstr "pääteasetuksia asetettaessa tapahtui virhe: %s" + +#: builtins/common.c:331 +#, c-format +msgid "error getting terminal attributes: %s" +msgstr "pääteasetuksia luettaessa tapahtui virhe: %s" + +#: builtins/common.c:563 +#, c-format +msgid "%s: error retrieving current directory: %s: %s\n" +msgstr "%s: nykyhakemistoa luettaessa tapahtui virhe: %s: %s\n" + +#: builtins/common.c:629 builtins/common.c:631 +#, c-format +msgid "%s: ambiguous job spec" +msgstr "%s: ei ole yksiselitteinen työtunniste" + +#: builtins/complete.def:277 +#, c-format +msgid "%s: invalid action name" +msgstr "%s: virheellinen toiminnon nimi" + +#: builtins/complete.def:450 builtins/complete.def:645 +#: builtins/complete.def:855 +#, c-format +msgid "%s: no completion specification" +msgstr "%s: ei lavennusmääritystä" + +#: builtins/complete.def:697 +msgid "warning: -F option may not work as you expect" +msgstr "varoitus: -F -valitsin ei ehkä toimi odotetusti" + +#: builtins/complete.def:699 +msgid "warning: -C option may not work as you expect" +msgstr "varoitus: -C -valitsin ei ehkä toimi odotetusti" + +#: builtins/complete.def:828 +msgid "not currently executing completion function" +msgstr "tällä hetkellä komennon lavennusfunktiota ei suoriteta" + +#: builtins/declare.def:126 +msgid "can only be used in a function" +msgstr "voidaan käyttää ainoastaan funktiossa" + +#: builtins/declare.def:315 builtins/declare.def:509 +#, c-format +msgid "%s: reference variable cannot be an array" +msgstr "" + +#: builtins/declare.def:324 +#, c-format +msgid "%s: nameref variable self references not allowed" +msgstr "" + +#: builtins/declare.def:398 +msgid "cannot use `-f' to make functions" +msgstr "”-f”:ää ei voida käyttää funktioiden luomiseen" + +#: builtins/declare.def:410 execute_cmd.c:5361 +#, c-format +msgid "%s: readonly function" +msgstr "%s: kirjoitussuojattu funktio" + +#: builtins/declare.def:553 +#, c-format +msgid "%s: cannot destroy array variables in this way" +msgstr "%s: taulukkomuuttujia ei voi tuhota näin" + +#: builtins/declare.def:560 builtins/read.def:733 +#, c-format +msgid "%s: cannot convert associative to indexed array" +msgstr "%s: assosiatiivista taulukkoa ei voi muuttaa indeksoiduksi" + +#: builtins/enable.def:137 builtins/enable.def:145 +msgid "dynamic loading not available" +msgstr "dynaaminen lataus ei ole käytettävissä" + +#: builtins/enable.def:312 +#, c-format +msgid "cannot open shared object %s: %s" +msgstr "jaettua objektia %s ei voida avata: %s" + +#: builtins/enable.def:335 +#, c-format +msgid "cannot find %s in shared object %s: %s" +msgstr "kohdetta %s ei löydy jaetusta objektista %s: %s" + +#: builtins/enable.def:459 +#, c-format +msgid "%s: not dynamically loaded" +msgstr "%s: ei dynaamisesti ladattu" + +#: builtins/enable.def:474 +#, c-format +msgid "%s: cannot delete: %s" +msgstr "%s: ei voida poistaa: %s" + +#: builtins/evalfile.c:140 builtins/hash.def:171 execute_cmd.c:5208 +#: shell.c:1481 +#, c-format +msgid "%s: is a directory" +msgstr "%s: on hakemisto" + +#: builtins/evalfile.c:146 +#, c-format +msgid "%s: not a regular file" +msgstr "%s: ei tavallinen tiedosto" + +#: builtins/evalfile.c:155 +#, c-format +msgid "%s: file is too large" +msgstr "%s: tiedosto on liian iso" + +#: builtins/evalfile.c:190 builtins/evalfile.c:208 shell.c:1491 +#, c-format +msgid "%s: cannot execute binary file" +msgstr "%s: binääritiedostoa ei voida suorittaa" + +#: builtins/exec.def:154 builtins/exec.def:156 builtins/exec.def:228 +#, c-format +msgid "%s: cannot execute: %s" +msgstr "%s: ei voida suorittaa: %s" + +#: builtins/exit.def:65 +#, c-format +msgid "logout\n" +msgstr "lopetus\n" + +#: builtins/exit.def:88 +msgid "not login shell: use `exit'" +msgstr "ei ole sisäänkirjautumiskomentotulkki: käytä komentoa ”exit”" + +#: builtins/exit.def:120 +#, c-format +msgid "There are stopped jobs.\n" +msgstr "Töitä on pysäytettynä.\n" + +#: builtins/exit.def:122 +#, c-format +msgid "There are running jobs.\n" +msgstr "Töitä on ajossa.\n" + +#: builtins/fc.def:262 +msgid "no command found" +msgstr "ei löytynyt komentoa" + +#: builtins/fc.def:320 builtins/fc.def:369 +msgid "history specification" +msgstr "komentohistoriamääritys" + +#: builtins/fc.def:390 +#, c-format +msgid "%s: cannot open temp file: %s" +msgstr "%s: väliaikaistiedostoa ei voitu avata: %s" + +#: builtins/fg_bg.def:149 builtins/jobs.def:282 +msgid "current" +msgstr "nykyinen" + +#: builtins/fg_bg.def:158 +#, c-format +msgid "job %d started without job control" +msgstr "työ %d käynnistyi ilman työnohjausta" + +#: builtins/getopt.c:110 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: virheellinen valitsin – %c\n" + +#: builtins/getopt.c:111 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: valitsin vaatii argumentin – %c\n" + +#: builtins/hash.def:92 +msgid "hashing disabled" +msgstr "hajautus kytketty pois" + +#: builtins/hash.def:138 +#, c-format +msgid "%s: hash table empty\n" +msgstr "%s: hajautustaulukko on tyhjä\n" + +#: builtins/hash.def:245 +#, c-format +msgid "hits\tcommand\n" +msgstr "osumia\tkomento\n" + +#: builtins/help.def:130 +#, c-format +msgid "Shell commands matching keyword `" +msgid_plural "Shell commands matching keywords `" +msgstr[0] "Sopivat komennot avainsanaan `" +msgstr[1] "Sopivat komennot avainsanoihin `" + +#: builtins/help.def:182 +#, c-format +msgid "" +"no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." +msgstr "" +"Ohjeita kohteelle ”%s” ei löydy. Kokeile ”help help”, ”man -k %s” tai \n" +"”info %s”." + +#: builtins/help.def:199 +#, c-format +msgid "%s: cannot open: %s" +msgstr "%s: ei voida avata: %s" + +#: builtins/help.def:485 +#, c-format +msgid "" +"These shell commands are defined internally. Type `help' to see this list.\n" +"Type `help name' to find out more about the function `name'.\n" +"Use `info bash' to find out more about the shell in general.\n" +"Use `man -k' or `info' to find out more about commands not in this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" +msgstr "" +"Nämä komennot on määritelty sisäisesti. Kirjoita ”help” nähdäksesi tämän " +"listan.\n" +"Kirjoita ”help name” saadaksesi lisätietoja funktiosta ”name”.\n" +"Komennolla ”info bash” saat lisää yleisiä tietoja komentotulkista.\n" +"Käytä komentoa ”man -k” tai ”info” saadaksesi lisätietoja komennoista, jotka " +"eivät ole tällä listalla.\n" +"\n" +"Asteriski (*) nimen vieressä tarkoittaa, että komennon käyttö on estetty.\n" +"\n" + +#: builtins/history.def:154 +msgid "cannot use more than one of -anrw" +msgstr "valitsimista -anrw voidaan käyttää vain yhtä" + +#: builtins/history.def:186 +msgid "history position" +msgstr "sijainti komentohistoriassa" + +#: builtins/history.def:366 +#, c-format +msgid "%s: history expansion failed" +msgstr "%s: historiaviittaus epäonnistui" + +#: builtins/inlib.def:71 +#, c-format +msgid "%s: inlib failed" +msgstr "%s: inlib epäonnistui" + +#: builtins/jobs.def:109 +msgid "no other options allowed with `-x'" +msgstr "”-x”:n kanssa ei voida käyttää muita valitsimia" + +#: builtins/kill.def:200 +#, c-format +msgid "%s: arguments must be process or job IDs" +msgstr "%s: argumenttien pitää olla prosessi- tai työtunnisteita" + +#: builtins/kill.def:263 +msgid "Unknown error" +msgstr "Tuntematon virhe" + +#: builtins/let.def:95 builtins/let.def:120 expr.c:583 expr.c:598 +msgid "expression expected" +msgstr "odotettiin lauseketta" + +#: builtins/mapfile.def:172 +#, fuzzy, c-format +msgid "%s: not an indexed array" +msgstr "%s: ei ole taulukkomuuttuja" + +#: builtins/mapfile.def:259 builtins/read.def:302 +#, c-format +msgid "%s: invalid file descriptor specification" +msgstr "%s: virheellinen tiedostokahvamääritys" + +#: builtins/mapfile.def:267 builtins/read.def:309 +#, c-format +msgid "%d: invalid file descriptor: %s" +msgstr "%d: virheellinen tiedostokahva: %s" + +#: builtins/mapfile.def:276 builtins/mapfile.def:314 +#, c-format +msgid "%s: invalid line count" +msgstr "%s: virheellinen rivimäärä" + +#: builtins/mapfile.def:287 +#, c-format +msgid "%s: invalid array origin" +msgstr "%s: virheellinen taulukkoindeksi" + +#: builtins/mapfile.def:304 +#, c-format +msgid "%s: invalid callback quantum" +msgstr "%s: virheellinen paluukutsumäärä" + +#: builtins/mapfile.def:336 +msgid "empty array variable name" +msgstr "tyhjä taulukkomuuttujan nimi" + +#: builtins/mapfile.def:357 +msgid "array variable support required" +msgstr "vaaditaan tukea taulukkomuuttujille" + +#: builtins/printf.def:402 +#, c-format +msgid "`%s': missing format character" +msgstr "”%s”: puuttuva muotoilumerkki" + +#: builtins/printf.def:456 +#, fuzzy, c-format +msgid "`%c': invalid time format specification" +msgstr "%s: virheellinen aikakatkaisumääritys" + +#: builtins/printf.def:658 +#, c-format +msgid "`%c': invalid format character" +msgstr "”%c”: virheellinen muotoilumerkki" + +#: builtins/printf.def:684 +#, c-format +msgid "warning: %s: %s" +msgstr "varoitus: %s: %s" + +#: builtins/printf.def:768 +#, c-format +msgid "format parsing problem: %s" +msgstr "" + +#: builtins/printf.def:865 +msgid "missing hex digit for \\x" +msgstr "\\x:stä puuttuu heksadesimaalinumero" + +#: builtins/printf.def:880 +#, fuzzy, c-format +msgid "missing unicode digit for \\%c" +msgstr "\\x:stä puuttuu heksadesimaalinumero" + +#: builtins/pushd.def:195 +msgid "no other directory" +msgstr "ei toista hakemistoa" + +#: builtins/pushd.def:354 +#, fuzzy, c-format +msgid "%s: invalid argument" +msgstr "%s: virheellinen rajoitusargumentti" + +#: builtins/pushd.def:468 +msgid "" +msgstr "" + +#: builtins/pushd.def:512 +msgid "directory stack empty" +msgstr "hakemistopino on tyhjä" + +#: builtins/pushd.def:514 +msgid "directory stack index" +msgstr "hakemistopinon indeksi" + +#: builtins/pushd.def:689 +msgid "" +"Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +"\tdirs when invoked without options, starting with zero." +msgstr "" +"Näyttää muistissa olevat hakemistot. Hakemistot\n" +" löytävät tiensä listaan ”pushd”-komennolla; voit\n" +" palata listan hakemistoihin ”popd”-komennolla.\n" +" \n" +" Valitsimet:\n" +" -c\ttyhjennä hakemistopino\n" +" -l\tälä tulosta tilde-alkuisia versioita hakemistoista jotka ovat\n" +" \tsuhteessa kotihakemistoosi\n" +" -p tulosta hakemistopino, hakemisto per rivi\n" +" -v tulosta hakemistopino, hakemisto per rivi, pinon " +"sijaintinumeroineen\n" +" \n" +" Argumentit:\n" +" +N\tNäyttää listan N:nnen alkion (laskien vasemmalta dirs-komennon \n" +" \tantamasta listasta). Valitsimetta kutsuttaessa aloitetaan nollasta.\n" +" \n" +" -N\tNäyttää listan N:nnen alkion (laskien oikealta dirs-komennon\n" +" \tantamasta listasta). Valitsimetta kutsuttaessa aloitetaan nollasta." + +#: builtins/pushd.def:711 +msgid "" +"Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Lisää hakemiston hakemistopinon ylimmäiseksi, tai kääntää pinon, \n" +" jolloin nykyhakemisto menee pinon huipulle. Ilman argumentteja \n" +" vaihtaa pinon kahden päällimmäisen hakemiston paikkoja.\n" +" \n" +" Valitsimet:\n" +" -n\tjättää hakemiston vaihtamatta, joten vain pinoa muutetaan\n" +" \n" +" Argumentit:\n" +" +N\tKääntää pinoa niin, että N:s hakemisto (laskien vasemmalta \"dirs" +"\"-\n" +" komennon antamasta listasta) on päällimmäisenä.\n" +" \n" +" -N\tKääntää pinoa niin, että N:s hakemisto (laskien oikealta \"dirs" +"\"-\n" +" komennon antamasta listasta) on päällimmäisenä.\n" +" \n" +" Sisäänrakennettu ”dirs”-komento näyttää hakemistopinon." + +#: builtins/pushd.def:736 +msgid "" +"Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Poistaa alkioita hakemistopinosta. Ilman argumenttia poistaa ylimmän\n" +" hakemiston, ja siirtää seuraavan ylimmäiseksi.\n" +" \n" +" Valitsimet:\n" +" -n\tEi siirrytä normaalisti pinosta poistettuun hakemistoon,\n" +" \tjoten vain pinoa muutetaan.\n" +" \n" +" Argumentit:\n" +" +N\tPoistaa N:nnen alkion (laskien vasemmalta ”dirs”-komennon\n" +" \tantamasta listasta, alkaen nollasta). Esimerkiksi ”popd +0”\n" +" \tpoistaa ensimmäisen hakemistot, ”popd +1” toisen.\n" +" \n" +" -N\tPoistaa N:nnen alkion (laskien oikealta ”dirs”-komennon \n" +" \tantamasta listasta, alkaen nollasta). Esimerkiksi: ”popd -0”\n" +" \tpoistaa viimeisen hakemiston, ”popd -1” sitä edellisen.\n" +" \n" +" Sisäänrakennettu ”dirs”-komento näyttää hakemistopinon sisällön." + +#: builtins/read.def:275 +#, c-format +msgid "%s: invalid timeout specification" +msgstr "%s: virheellinen aikakatkaisumääritys" + +#: builtins/read.def:678 +#, c-format +msgid "read error: %d: %s" +msgstr "lukuvirhe: %d: %s" + +#: builtins/return.def:75 +msgid "can only `return' from a function or sourced script" +msgstr "”return” on käytettävissä vain funktiossa tai ladatussa skriptissä" + +#: builtins/set.def:782 +msgid "cannot simultaneously unset a function and a variable" +msgstr "funktiota ja muuttujaa ei voi poistaa yhtä aikaa" + +#: builtins/set.def:826 +#, c-format +msgid "%s: cannot unset" +msgstr "%s: ei voida poistaa" + +#: builtins/set.def:843 +#, c-format +msgid "%s: cannot unset: readonly %s" +msgstr "%s: ei voida poistaa: kirjoitussuojattu %s" + +#: builtins/set.def:854 +#, c-format +msgid "%s: not an array variable" +msgstr "%s: ei ole taulukkomuuttuja" + +#: builtins/setattr.def:187 +#, c-format +msgid "%s: not a function" +msgstr "%s: ei ole funktio" + +#: builtins/shift.def:71 builtins/shift.def:77 +msgid "shift count" +msgstr "siirtolaskuri" + +#: builtins/shopt.def:279 +msgid "cannot set and unset shell options simultaneously" +msgstr "" +"komentotulkin valitsimia ei voida laittaa päällä ja ottaa pois päältä " +"samanaikaisesti" + +#: builtins/shopt.def:346 +#, c-format +msgid "%s: invalid shell option name" +msgstr "%s: virheellinen komentotulkin valitsimen nimi" + +#: builtins/source.def:130 +msgid "filename argument required" +msgstr "vaaditaan tiedostonimi argumentiksi" + +#: builtins/source.def:155 +#, c-format +msgid "%s: file not found" +msgstr "%s: tiedostoa ei löytynyt" + +#: builtins/suspend.def:101 +msgid "cannot suspend" +msgstr "ei voida keskeyttää" + +#: builtins/suspend.def:111 +msgid "cannot suspend a login shell" +msgstr "sisäänkirjautumiskomentotulkkia ei voi keskeyttää" + +#: builtins/type.def:234 +#, c-format +msgid "%s is aliased to `%s'\n" +msgstr "%s on aliasioitu ”%s”\n" + +#: builtins/type.def:255 +#, c-format +msgid "%s is a shell keyword\n" +msgstr "%s on komentotulkin avainsana\n" + +#: builtins/type.def:274 +#, c-format +msgid "%s is a function\n" +msgstr "%s on funktio\n" + +#: builtins/type.def:296 +#, c-format +msgid "%s is a shell builtin\n" +msgstr "%s on komentotulkin sisäänrakennettu komento\n" + +#: builtins/type.def:317 builtins/type.def:393 +#, c-format +msgid "%s is %s\n" +msgstr "%s on %s\n" + +#: builtins/type.def:337 +#, c-format +msgid "%s is hashed (%s)\n" +msgstr "%s on hajautettu (%s)\n" + +#: builtins/ulimit.def:383 +#, c-format +msgid "%s: invalid limit argument" +msgstr "%s: virheellinen rajoitusargumentti" + +#: builtins/ulimit.def:409 +#, c-format +msgid "`%c': bad command" +msgstr "”%c”: virheellinen komento" + +#: builtins/ulimit.def:438 +#, c-format +msgid "%s: cannot get limit: %s" +msgstr "%s: rajoitusta ei saada: %s" + +#: builtins/ulimit.def:464 +msgid "limit" +msgstr "rajoitus" + +#: builtins/ulimit.def:476 builtins/ulimit.def:776 +#, c-format +msgid "%s: cannot modify limit: %s" +msgstr "%s: rajoitusta ei voida muokata: %s" + +#: builtins/umask.def:114 +msgid "octal number" +msgstr "oktaaliluku" + +#: builtins/umask.def:227 +#, c-format +msgid "`%c': invalid symbolic mode operator" +msgstr "”%c”: virheellinen symbolisen tilan operaattori" + +#: builtins/umask.def:282 +#, c-format +msgid "`%c': invalid symbolic mode character" +msgstr "”%c”: virheellinen symbolisen tilan merkki" + +#: error.c:90 error.c:325 error.c:327 error.c:329 +msgid " line " +msgstr " rivi " + +#: error.c:165 +#, c-format +msgid "last command: %s\n" +msgstr "viimeinen komento: %s\n" + +#: error.c:173 +#, c-format +msgid "Aborting..." +msgstr "Keskeytetään..." + +#: error.c:440 +msgid "unknown command error" +msgstr "tuntematon komentovirhe" + +#: error.c:441 +msgid "bad command type" +msgstr "virheellinen komentotyyppi" + +#: error.c:442 +msgid "bad connector" +msgstr "virheellinen liittäjä" + +#: error.c:443 +msgid "bad jump" +msgstr "virheellinen hyppy" + +#: error.c:481 +#, c-format +msgid "%s: unbound variable" +msgstr "%s: sitomaton muuttuja" + +#: eval.c:189 +#, c-format +msgid "\atimed out waiting for input: auto-logout\n" +msgstr "\aaikakatkaisu: automaattinen uloskirjautuminen\n" + +#: execute_cmd.c:512 +#, c-format +msgid "cannot redirect standard input from /dev/null: %s" +msgstr "syötettä ei voida lukea tiedostosta /dev/null: %s" + +#: execute_cmd.c:1233 +#, c-format +msgid "TIMEFORMAT: `%c': invalid format character" +msgstr "AJAN MUOTOMÄÄRITYS: ”%c”: virheellinen muotoilumerkki" + +#: execute_cmd.c:2287 +msgid "pipe error" +msgstr "putkitusvirhe" + +#: execute_cmd.c:4386 +#, c-format +msgid "%s: maximum function nesting level exceeded (%d)" +msgstr "" + +#: execute_cmd.c:4884 +#, c-format +msgid "%s: restricted: cannot specify `/' in command names" +msgstr "%s: rajoitettu: komentojen nimissä ei voi käyttää ”/”-merkkiä" + +#: execute_cmd.c:4973 +#, c-format +msgid "%s: command not found" +msgstr "%s: komentoa ei löydy" + +#: execute_cmd.c:5206 +#, fuzzy, c-format +msgid "%s: %s" +msgstr "%s on %s\n" + +#: execute_cmd.c:5243 +#, c-format +msgid "%s: %s: bad interpreter" +msgstr "%s: %s: virheellinen tulkki" + +#: execute_cmd.c:5280 +#, fuzzy, c-format +msgid "%s: cannot execute binary file: %s" +msgstr "%s: binääritiedostoa ei voida suorittaa" + +#: execute_cmd.c:5352 +#, fuzzy, c-format +msgid "`%s': is a special builtin" +msgstr "%s on komentotulkin sisäänrakennettu komento\n" + +#: execute_cmd.c:5404 +#, c-format +msgid "cannot duplicate fd %d to fd %d" +msgstr "tiedostokahvaa %d ei voida kopioida kahvaksi %d" + +#: expr.c:259 +msgid "expression recursion level exceeded" +msgstr "lausekkeen rekursiomäärä ylittyi" + +#: expr.c:283 +msgid "recursion stack underflow" +msgstr "rekursiopinon alivuoto" + +#: expr.c:431 +msgid "syntax error in expression" +msgstr "lauseoppivirhe lausekkeessa" + +#: expr.c:475 +msgid "attempted assignment to non-variable" +msgstr "yritettiin sijoittaa objektiin, joka ei ole muuttuja" + +#: expr.c:495 expr.c:858 +msgid "division by 0" +msgstr "jako nollalla" + +#: expr.c:542 +msgid "bug: bad expassign token" +msgstr "bugi: virheellinen sijoitusavainsana" + +#: expr.c:595 +msgid "`:' expected for conditional expression" +msgstr "”:”:ttä odotettiin ehdolliseen lausekkeeseen" + +#: expr.c:919 +msgid "exponent less than 0" +msgstr "eksponentti on pienempi kuin 0" + +#: expr.c:976 +msgid "identifier expected after pre-increment or pre-decrement" +msgstr "odotettiin muuttujaa ++:n tai --:n jälkeen" + +#: expr.c:1002 +msgid "missing `)'" +msgstr "puuttuva ”)”" + +#: expr.c:1053 expr.c:1390 +msgid "syntax error: operand expected" +msgstr "lauseoppivirhe: odotettiin operandia" + +#: expr.c:1392 +msgid "syntax error: invalid arithmetic operator" +msgstr "lauseoppivirhe: virheellinen aritmetiikkaoperaattori" + +#: expr.c:1416 +#, c-format +msgid "%s%s%s: %s (error token is \"%s\")" +msgstr "%s%s%s: %s (virheellinen avainsana on ”%s”)" + +#: expr.c:1474 +msgid "invalid arithmetic base" +msgstr "virheellinen lukujärjestelmä" + +#: expr.c:1494 +msgid "value too great for base" +msgstr "liian iso luku lukujärjestelmälle" + +#: expr.c:1543 +#, c-format +msgid "%s: expression error\n" +msgstr "%s: virhe lausekkeessa\n" + +#: general.c:62 +msgid "getcwd: cannot access parent directories" +msgstr "getcwd: ylempiin hakemistoihin ei päästä" + +#: input.c:102 subst.c:5168 +#, c-format +msgid "cannot reset nodelay mode for fd %d" +msgstr "nodelay-tilaa ei voida asettaa tiedostokahvalle %d" + +#: input.c:271 +#, c-format +msgid "cannot allocate new file descriptor for bash input from fd %d" +msgstr "bashin syötteeksi ei voida avata uutta tiedostokahvaa kahvasta %d" + +#: input.c:279 +#, c-format +msgid "save_bash_input: buffer already exists for new fd %d" +msgstr "save_bash_input: uudella tiedostokahvalla %d on jo puskuri" + +#: jobs.c:471 +msgid "start_pipeline: pgrp pipe" +msgstr "start_pipeline: pgrp-putki" + +#: jobs.c:893 +#, c-format +msgid "forked pid %d appears in running job %d" +msgstr "haarautettu prosessi-id %d on ajossa olevalla työllä %d" + +#: jobs.c:1012 +#, c-format +msgid "deleting stopped job %d with process group %ld" +msgstr "poistetaan pysäytetty työ %d prosessiryhmästä %ld" + +#: jobs.c:1117 +#, c-format +msgid "add_process: process %5ld (%s) in the_pipeline" +msgstr "add_process: prosessi %5ld (%s) putkijonossa" + +#: jobs.c:1120 +#, c-format +msgid "add_process: pid %5ld (%s) marked as still alive" +msgstr "add_process: prosessi %5ld (%s) on merkattu vielä toimivaksi" + +#: jobs.c:1435 +#, c-format +msgid "describe_pid: %ld: no such pid" +msgstr "describe_pid: %ld: prosessitunnusta ei löydy." + +#: jobs.c:1450 +#, c-format +msgid "Signal %d" +msgstr "Signaali %d" + +#: jobs.c:1464 jobs.c:1489 +msgid "Done" +msgstr "Valmis" + +#: jobs.c:1469 siglist.c:123 +msgid "Stopped" +msgstr "Pysäytetty" + +#: jobs.c:1473 +#, c-format +msgid "Stopped(%s)" +msgstr "Pysäytetty(%s)" + +#: jobs.c:1477 +msgid "Running" +msgstr "Ajossa" + +#: jobs.c:1491 +#, c-format +msgid "Done(%d)" +msgstr "Valmis(%d)" + +#: jobs.c:1493 +#, c-format +msgid "Exit %d" +msgstr "Poistui %d" + +#: jobs.c:1496 +msgid "Unknown status" +msgstr "Tuntematon tila" + +#: jobs.c:1583 +#, c-format +msgid "(core dumped) " +msgstr "(luotiin core-tiedosto)" + +#: jobs.c:1602 +#, c-format +msgid " (wd: %s)" +msgstr " (työhakemisto: %s)" + +#: jobs.c:1819 +#, c-format +msgid "child setpgid (%ld to %ld)" +msgstr "lapsiprosessin setpgid (%ld => %ld)" + +#: jobs.c:2138 nojobs.c:605 +#, c-format +msgid "wait: pid %ld is not a child of this shell" +msgstr "wait: prosessi %ld ei ole tämän komentotulkin lapsiprosessi" + +#: jobs.c:2385 +#, c-format +msgid "wait_for: No record of process %ld" +msgstr "wait_for: Prosessista %ld ei ole tietoja" + +#: jobs.c:2694 +#, c-format +msgid "wait_for_job: job %d is stopped" +msgstr "wait_for_job: työ %d on pysäytetty" + +#: jobs.c:2986 +#, c-format +msgid "%s: job has terminated" +msgstr "%s: työ on lopetettu" + +#: jobs.c:2995 +#, c-format +msgid "%s: job %d already in background" +msgstr "%s: työ %d on jo taustalla" + +#: jobs.c:3220 +msgid "waitchld: turning on WNOHANG to avoid indefinite block" +msgstr "" + +#: jobs.c:3711 +#, c-format +msgid "%s: line %d: " +msgstr "%s: rivi %d:" + +#: jobs.c:3725 nojobs.c:843 +#, c-format +msgid " (core dumped)" +msgstr " (luotiin core-tiedosto)" + +#: jobs.c:3737 jobs.c:3750 +#, c-format +msgid "(wd now: %s)\n" +msgstr "(työhakemisto nyt: %s)\n" + +#: jobs.c:3782 +msgid "initialize_job_control: getpgrp failed" +msgstr "initialize_job_control: getpgrp epäonnistui" + +#: jobs.c:3843 +msgid "initialize_job_control: line discipline" +msgstr "initialize_job_control: vuonhallinta" + +#: jobs.c:3853 +msgid "initialize_job_control: setpgid" +msgstr "initialize_job_control: setpgid" + +#: jobs.c:3874 jobs.c:3883 +#, c-format +msgid "cannot set terminal process group (%d)" +msgstr "päätteen prosessiryhmää ei voitu asettaa (%d)" + +#: jobs.c:3888 +msgid "no job control in this shell" +msgstr "tällä komentotulkilla ei ole työnohjausta" + +#: lib/malloc/malloc.c:296 +#, c-format +msgid "malloc: failed assertion: %s\n" +msgstr "malloc: varmistus epäonnistui: %s\n" + +#: lib/malloc/malloc.c:312 +#, c-format +msgid "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" +msgstr "" +"\r\n" +"malloc: %s:%d: varmistus epäonnistui\r\n" + +#: lib/malloc/malloc.c:313 +msgid "unknown" +msgstr "tuntematon" + +#: lib/malloc/malloc.c:801 +msgid "malloc: block on free list clobbered" +msgstr "malloc: vapaitten listan lohko ylikirjoittui" + +#: lib/malloc/malloc.c:878 +msgid "free: called with already freed block argument" +msgstr "free: kutsuttiin argumenttina jo vapautettu lohko" + +#: lib/malloc/malloc.c:881 +msgid "free: called with unallocated block argument" +msgstr "free: kutsuttuun argumenttina varaamaton lohko" + +#: lib/malloc/malloc.c:900 +msgid "free: underflow detected; mh_nbytes out of range" +msgstr "free: havaittiin alivuoto; mh_nbytes rajojen ulkopuolella" + +#: lib/malloc/malloc.c:906 +msgid "free: start and end chunk sizes differ" +msgstr "free: alku- ja loppulohkojen koot eroavat" + +#: lib/malloc/malloc.c:1005 +msgid "realloc: called with unallocated block argument" +msgstr "realloc: kutsuargumentti on varaamaton lohko" + +#: lib/malloc/malloc.c:1020 +msgid "realloc: underflow detected; mh_nbytes out of range" +msgstr "realloc: havaittiin alivuoto; mh_nbytes rajojen ulkopuolella" + +#: lib/malloc/malloc.c:1026 +msgid "realloc: start and end chunk sizes differ" +msgstr "realloc: alku- ja loppulohkojen koot eroavat" + +#: lib/malloc/table.c:194 +#, c-format +msgid "register_alloc: alloc table is full with FIND_ALLOC?\n" +msgstr "register_alloc: varaustaulukko on täynnä FIND_ALLOCeja?\n" + +#: lib/malloc/table.c:203 +#, c-format +msgid "register_alloc: %p already in table as allocated?\n" +msgstr "register_alloc: %p on merkitty taulukossa jo varatuksi?\n" + +#: lib/malloc/table.c:256 +#, c-format +msgid "register_free: %p already in table as free?\n" +msgstr "register_free: %p on jo taulukossa vapaana?\n" + +#: lib/sh/fmtulong.c:102 +msgid "invalid base" +msgstr "virheellinen lukujärjestelmä" + +#: lib/sh/netopen.c:168 +#, c-format +msgid "%s: host unknown" +msgstr "%s: tuntematon palvelin" + +#: lib/sh/netopen.c:175 +#, c-format +msgid "%s: invalid service" +msgstr "%s: virheellinen palvelu" + +#: lib/sh/netopen.c:306 +#, c-format +msgid "%s: bad network path specification" +msgstr "%s: virheellinen verkkopolkumääritys" + +#: lib/sh/netopen.c:346 +msgid "network operations not supported" +msgstr "verkko-operaatioita ei ole tuettu" + +#: locale.c:200 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s)" +msgstr "" + +#: locale.c:202 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s): %s" +msgstr "" + +#: locale.c:259 +#, fuzzy, c-format +msgid "setlocale: %s: cannot change locale (%s)" +msgstr "xrealloc: %s:%d: ei voida varata %lu tavua" + +#: locale.c:261 +#, fuzzy, c-format +msgid "setlocale: %s: cannot change locale (%s): %s" +msgstr "xrealloc: %s:%d: ei voida varata %lu tavua" + +#: mailcheck.c:439 +msgid "You have mail in $_" +msgstr "Sinulle on postia laatikossa $_" + +#: mailcheck.c:464 +msgid "You have new mail in $_" +msgstr "Sinulla on uutta postia laatikossa $_" + +#: mailcheck.c:480 +#, c-format +msgid "The mail in %s has been read\n" +msgstr "Posti laatikossa %s on luettu\n" + +#: make_cmd.c:323 +msgid "syntax error: arithmetic expression required" +msgstr "lauseoppivirhe: vaaditaan aritmeettinen lauseke" + +#: make_cmd.c:325 +msgid "syntax error: `;' unexpected" +msgstr "lauseoppivirhe: odottamaton ”;”" + +#: make_cmd.c:326 +#, c-format +msgid "syntax error: `((%s))'" +msgstr "lauseoppivirhe: ”((%s))”" + +#: make_cmd.c:578 +#, c-format +msgid "make_here_document: bad instruction type %d" +msgstr "make_here_document: virheellinen käskytyyppi %d" + +#: make_cmd.c:662 +#, c-format +msgid "here-document at line %d delimited by end-of-file (wanted `%s')" +msgstr "" +"here-dokumentti rivillä %d päättyi tiedoston loppumiseen (haluttiin ”%s”)" + +#: make_cmd.c:759 +#, c-format +msgid "make_redirection: redirection instruction `%d' out of range" +msgstr "make_redirection: uudelleenohjaus ”%d” rajojen ulkopuolella" + +#: parse.y:3278 parse.y:3561 +#, c-format +msgid "unexpected EOF while looking for matching `%c'" +msgstr "odottamaton EOF (tiedostonloppu) odotettaessa sulkevaa ”%c”" + +#: parse.y:4170 +msgid "unexpected EOF while looking for `]]'" +msgstr "odottamaton EOF odotettaessa ”]]”" + +#: parse.y:4175 +#, c-format +msgid "syntax error in conditional expression: unexpected token `%s'" +msgstr "lauseoppivirhe ehdollisessa lausekkeessa: odottamaton avainsana ”%s”" + +#: parse.y:4179 +msgid "syntax error in conditional expression" +msgstr "lauseoppivirhe ehdollisessa lausekkeessa" + +#: parse.y:4257 +#, c-format +msgid "unexpected token `%s', expected `)'" +msgstr "odottamaton avainsana ”%s”, odotettiin ”)”" + +#: parse.y:4261 +msgid "expected `)'" +msgstr "odototettiin ”)”" + +#: parse.y:4289 +#, c-format +msgid "unexpected argument `%s' to conditional unary operator" +msgstr "odottamaton argumentti ”%s” ehdolliselle unaariselle operaattorille" + +#: parse.y:4293 +msgid "unexpected argument to conditional unary operator" +msgstr "odottamaton argumentti ehdolliselle unaariselle operaattorille" + +#: parse.y:4339 +#, c-format +msgid "unexpected token `%s', conditional binary operator expected" +msgstr "" +"odottamaton avainsana ”%s”, odotettiin ehdollista binääristä operaattoria" + +#: parse.y:4343 +msgid "conditional binary operator expected" +msgstr "odotettiin ehdollista binääristä operaattoria" + +#: parse.y:4365 +#, c-format +msgid "unexpected argument `%s' to conditional binary operator" +msgstr "odottamaton argumentti ”%s” ehdolliselle binääriselle operaattorille" + +#: parse.y:4369 +msgid "unexpected argument to conditional binary operator" +msgstr "odottamaton argumentti ehdolliselle binääriselle operaattorille" + +#: parse.y:4380 +#, c-format +msgid "unexpected token `%c' in conditional command" +msgstr "odottamaton avainsana ”%c” ehdollisessa komennossa" + +#: parse.y:4383 +#, c-format +msgid "unexpected token `%s' in conditional command" +msgstr "odottamaton avainsana ”%s” ehdollisessa komennossa" + +#: parse.y:4387 +#, c-format +msgid "unexpected token %d in conditional command" +msgstr "odottamaton avainsana %d ehdollisessa komennossa" + +#: parse.y:5737 +#, c-format +msgid "syntax error near unexpected token `%s'" +msgstr "lauseoppivirhe lähellä odottamatonta avainsanaa ”%s”" + +#: parse.y:5755 +#, c-format +msgid "syntax error near `%s'" +msgstr "lauseoppivirhe lähellä ”%s”" + +#: parse.y:5765 +msgid "syntax error: unexpected end of file" +msgstr "lauseoppivirhe: odottamaton tiedostonloppu" + +#: parse.y:5765 +msgid "syntax error" +msgstr "lauseoppivirhe" + +#: parse.y:5827 +#, c-format +msgid "Use \"%s\" to leave the shell.\n" +msgstr "Kirjoita ”%s” poistuaksesi komentotulkista.\n" + +#: parse.y:5989 +msgid "unexpected EOF while looking for matching `)'" +msgstr "Odottamaton EOF odotettaessa vastaavaa ”)”" + +#: pcomplete.c:1094 +#, c-format +msgid "completion: function `%s' not found" +msgstr "täydennys: funktiota ”%s” ei löytynyt" + +#: pcomplib.c:182 +#, c-format +msgid "progcomp_insert: %s: NULL COMPSPEC" +msgstr "progcomp_insert: %s: tyhjä COMPSPEC" + +#: print_cmd.c:300 +#, c-format +msgid "print_command: bad connector `%d'" +msgstr "print_command: virheellinen yhdistin ”%d”" + +#: print_cmd.c:373 +#, fuzzy, c-format +msgid "xtrace_set: %d: invalid file descriptor" +msgstr "%d: virheellinen tiedostokahva: %s" + +#: print_cmd.c:378 +msgid "xtrace_set: NULL file pointer" +msgstr "" + +#: print_cmd.c:382 +#, c-format +msgid "xtrace fd (%d) != fileno xtrace fp (%d)" +msgstr "" + +#: print_cmd.c:1518 +#, c-format +msgid "cprintf: `%c': invalid format character" +msgstr "cprintf: ”%c”: virheellinen muotoilumerkki" + +#: redir.c:123 redir.c:170 +msgid "file descriptor out of range" +msgstr "tiedostokahva rajojen ulkopuolella" + +#: redir.c:177 +#, c-format +msgid "%s: ambiguous redirect" +msgstr "%s: epämääräinen uudelleenohjaus" + +#: redir.c:181 +#, c-format +msgid "%s: cannot overwrite existing file" +msgstr "%s: olemassa olevan tiedoston päälle ei voida kirjoittaa" + +#: redir.c:186 +#, c-format +msgid "%s: restricted: cannot redirect output" +msgstr "%s: rajoitettu: tulostusta ei voida uudelleenohjata" + +#: redir.c:191 +#, c-format +msgid "cannot create temp file for here-document: %s" +msgstr "here-dokumentille ei voida luoda väliaikaistiedostoa: %s" + +#: redir.c:195 +#, fuzzy, c-format +msgid "%s: cannot assign fd to variable" +msgstr "%s: listaa ei voida sijoittaa taulukon alkioon" + +#: redir.c:582 +msgid "/dev/(tcp|udp)/host/port not supported without networking" +msgstr "/dev/(tcp|udp)/host/port-muotoa ei tueta ilman tietoliikennettä" + +#: redir.c:861 redir.c:973 redir.c:1034 redir.c:1199 +msgid "redirection error: cannot duplicate fd" +msgstr "virhe uudelleenohjauksessa: tiedostokahvaa ei voida kopioida" + +#: shell.c:339 +msgid "could not find /tmp, please create!" +msgstr "/tmp-hakemistoa ei löytynyt, luo se!" + +#: shell.c:343 +msgid "/tmp must be a valid directory name" +msgstr "/tmp:n pitää olla kelvollinen hakemiston nimi" + +#: shell.c:890 +#, c-format +msgid "%c%c: invalid option" +msgstr "%c%c: virheellinen valitsin" + +#: shell.c:1682 +msgid "I have no name!" +msgstr "Minulla ei ole nimeä!" + +#: shell.c:1827 +#, c-format +msgid "GNU bash, version %s-(%s)\n" +msgstr "GNU bash, versio %s-(%s)\n" + +#: shell.c:1828 +#, c-format +msgid "" +"Usage:\t%s [GNU long option] [option] ...\n" +"\t%s [GNU long option] [option] script-file ...\n" +msgstr "" +"Käyttö:\t%s[GNU:n pitkä valitsin] [valitsin] ...\n" +"\t%s [GNU:n pitkä valitsin] [valitsin] komentotiedosto ...\n" + +#: shell.c:1830 +msgid "GNU long options:\n" +msgstr "GNU:n pitkät valitsimet:\n" + +#: shell.c:1834 +msgid "Shell options:\n" +msgstr "Komentotulkin valitsimet:\n" + +#: shell.c:1835 +#, fuzzy +msgid "\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n" +msgstr "" +"\t-irsD tai -c komento tai -O shopt_option (ainoastaan käynnistettäessä)\n" + +#: shell.c:1850 +#, c-format +msgid "\t-%s or -o option\n" +msgstr "\t-%s tai -o -valitsin\n" + +#: shell.c:1856 +#, c-format +msgid "Type `%s -c \"help set\"' for more information about shell options.\n" +msgstr "" +"Kirjoita ”%s -c 'help set'” saadaksesi lisätietoja komentotulkin " +"valitsimista.\n" + +#: shell.c:1857 +#, c-format +msgid "Type `%s -c help' for more information about shell builtin commands.\n" +msgstr "" +"Kirjoita ”%s -c help” saadaksesi lisätietoja komentotulkin " +"sisäänrakennetuista komennoista.\n" + +#: shell.c:1858 +#, c-format +msgid "Use the `bashbug' command to report bugs.\n" +msgstr "Raportoi virheet komennolla ”bashbug”.\n" + +#: sig.c:691 +#, c-format +msgid "sigprocmask: %d: invalid operation" +msgstr "sigprocmask: %d: virheellinen operaatio" + +#: siglist.c:48 +msgid "Bogus signal" +msgstr "Väärä signaali" + +#: siglist.c:51 +msgid "Hangup" +msgstr "Linjankatkaisu" + +#: siglist.c:55 +msgid "Interrupt" +msgstr "Keskeytys" + +#: siglist.c:59 +msgid "Quit" +msgstr "Lopetettu" + +#: siglist.c:63 +msgid "Illegal instruction" +msgstr "Virheellinen käsky" + +#: siglist.c:67 +msgid "BPT trace/trap" +msgstr "Jäljitys/katkaisupisteansa" + +#: siglist.c:75 +msgid "ABORT instruction" +msgstr "ABORT-käsky" + +#: siglist.c:79 +msgid "EMT instruction" +msgstr "EMT-käsky" + +#: siglist.c:83 +msgid "Floating point exception" +msgstr "Liukulukupoikkeus" + +#: siglist.c:87 +msgid "Killed" +msgstr "Tapettu" + +#: siglist.c:91 +msgid "Bus error" +msgstr "Väylävirhe" + +#: siglist.c:95 +msgid "Segmentation fault" +msgstr "Muistialueen ylitys" + +#: siglist.c:99 +msgid "Bad system call" +msgstr "Virheellinen järjestelmäkutsu" + +#: siglist.c:103 +msgid "Broken pipe" +msgstr "Katkennut putki" + +#: siglist.c:107 +msgid "Alarm clock" +msgstr "Herätyskello" + +#: siglist.c:111 +msgid "Terminated" +msgstr "Päätetty" + +#: siglist.c:115 +msgid "Urgent IO condition" +msgstr "Kiireellinen I/O-ehto" + +#: siglist.c:119 +msgid "Stopped (signal)" +msgstr "Pysäytetty (signaali)" + +#: siglist.c:127 +msgid "Continue" +msgstr "Jatka" + +#: siglist.c:135 +msgid "Child death or stop" +msgstr "Lapsiprosessin kuolema tai pysähtyminen" + +#: siglist.c:139 +msgid "Stopped (tty input)" +msgstr "Pysäytetty (päätteen syöte)" + +#: siglist.c:143 +msgid "Stopped (tty output)" +msgstr "Pysäytetty (päätteen tuloste)" + +#: siglist.c:147 +msgid "I/O ready" +msgstr "I/O on valmis" + +#: siglist.c:151 +msgid "CPU limit" +msgstr "CPU-rajoitus" + +#: siglist.c:155 +msgid "File limit" +msgstr "Tiedostorajoitus" + +#: siglist.c:159 +msgid "Alarm (virtual)" +msgstr "Hälytys (virtuaalinen)" + +#: siglist.c:163 +msgid "Alarm (profile)" +msgstr "Hälytys (profiili)" + +#: siglist.c:167 +msgid "Window changed" +msgstr "Ikkuna vaihtunut" + +#: siglist.c:171 +msgid "Record lock" +msgstr "Tietuelukko" + +#: siglist.c:175 +msgid "User signal 1" +msgstr "Käyttäjän määrittelemä signaali 1" + +#: siglist.c:179 +msgid "User signal 2" +msgstr "Käyttäjän määrittelemä signaali 2" + +#: siglist.c:183 +msgid "HFT input data pending" +msgstr "HFT-syöte odottaa" + +#: siglist.c:187 +msgid "power failure imminent" +msgstr "sähkökatko lähellä" + +#: siglist.c:191 +msgid "system crash imminent" +msgstr "järjestelmän kaatuminen lähellä" + +#: siglist.c:195 +msgid "migrate process to another CPU" +msgstr "siirrä prosessi toiselle CPU:lle" + +#: siglist.c:199 +msgid "programming error" +msgstr "ohjelmointivirhe" + +#: siglist.c:203 +msgid "HFT monitor mode granted" +msgstr "HFT-monitorointitila käytössä" + +#: siglist.c:207 +msgid "HFT monitor mode retracted" +msgstr "HFT-monitorointitila peruttu" + +#: siglist.c:211 +msgid "HFT sound sequence has completed" +msgstr "HFT-äänisekvenssi on valmistunut" + +#: siglist.c:215 +msgid "Information request" +msgstr "Informaatiopyyntö" + +#: siglist.c:223 +msgid "Unknown Signal #" +msgstr "Tuntematon signaali #" + +#: siglist.c:225 +#, c-format +msgid "Unknown Signal #%d" +msgstr "Tuntematon signaali #%d" + +#: subst.c:1362 subst.c:1520 +#, c-format +msgid "bad substitution: no closing `%s' in %s" +msgstr "virheellinen korvaus: ei sulkevaa ”%s” jonossa %s" + +#: subst.c:2847 +#, c-format +msgid "%s: cannot assign list to array member" +msgstr "%s: listaa ei voida sijoittaa taulukon alkioon" + +#: subst.c:5065 subst.c:5081 +msgid "cannot make pipe for process substitution" +msgstr "putkea ei voida luoda prosessin korvaamista varten" + +#: subst.c:5113 +msgid "cannot make child for process substitution" +msgstr "lapsiprosessia ei voida luoda prosessin korvaamista varten" + +#: subst.c:5158 +#, c-format +msgid "cannot open named pipe %s for reading" +msgstr "nimettyä putkea %s ei voida avata lukemista varten" + +#: subst.c:5160 +#, c-format +msgid "cannot open named pipe %s for writing" +msgstr "nimettyä putkea %s ei voida avata kirjoitusta varten" + +#: subst.c:5178 +#, c-format +msgid "cannot duplicate named pipe %s as fd %d" +msgstr "nimettyä putkea %s ei voida kopioida tiedostokahvaksi %d" + +#: subst.c:5376 +msgid "cannot make pipe for command substitution" +msgstr "putkea ei voida luoda komennon korvaamista varten" + +#: subst.c:5414 +msgid "cannot make child for command substitution" +msgstr "ei voida luoda lapsiprosessia komennon korvaamista varten" + +#: subst.c:5433 +msgid "command_substitute: cannot duplicate pipe as fd 1" +msgstr "command_substitute: putkea ei voida kopioida tiedostokahvaksi 1" + +#: subst.c:5837 subst.c:8050 +#, fuzzy, c-format +msgid "%s: invalid variable name for name reference" +msgstr "%d: virheellinen tiedostokahva: %s" + +#: subst.c:6048 +#, c-format +msgid "%s: parameter null or not set" +msgstr "%s: parametria ei ole tai sitä ei ole asetettu" + +#: subst.c:6320 subst.c:6335 +#, c-format +msgid "%s: substring expression < 0" +msgstr "%s: alimerkkijonolauseke < 0" + +#: subst.c:7506 +#, c-format +msgid "%s: bad substitution" +msgstr "%s: virheellinen korvaus" + +#: subst.c:7583 +#, c-format +msgid "$%s: cannot assign in this way" +msgstr "$%s: ei voida asettaa näin" + +#: subst.c:7917 +msgid "" +"future versions of the shell will force evaluation as an arithmetic " +"substitution" +msgstr "" + +#: subst.c:8421 +#, c-format +msgid "bad substitution: no closing \"`\" in %s" +msgstr "virheellinen korvaus: ei sulkevaa ”`” jonossa %s" + +#: subst.c:9322 +#, c-format +msgid "no match: %s" +msgstr "ei osumia: %s" + +#: test.c:147 +msgid "argument expected" +msgstr "odotettiin argumenttia" + +#: test.c:156 +#, c-format +msgid "%s: integer expression expected" +msgstr "%s: odotettiin kokonaislukuilmaisua" + +#: test.c:264 +msgid "`)' expected" +msgstr "odotettiin ”)”" + +#: test.c:266 +#, c-format +msgid "`)' expected, found %s" +msgstr "odotettiin ”)”, löydettiin %s" + +#: test.c:281 test.c:742 test.c:745 +#, c-format +msgid "%s: unary operator expected" +msgstr "%s: odotettiin unaarista operaattoria" + +#: test.c:468 test.c:785 +#, c-format +msgid "%s: binary operator expected" +msgstr "%s: odotettiin binääristä operaattoria" + +#: test.c:860 +msgid "missing `]'" +msgstr "puuttuva ”]”" + +#: trap.c:217 +msgid "invalid signal number" +msgstr "virheellinen signaalinumero" + +#: trap.c:371 +#, c-format +msgid "run_pending_traps: bad value in trap_list[%d]: %p" +msgstr "run_pending_traps: virheellinen arvo trap_list[%d]: %p" + +#: trap.c:375 +#, c-format +msgid "" +"run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" +msgstr "" +"run_pending_traps: signaalikäsittelijä on SIG_DFL, lähetän %d (%s) uudelleen " +"itselleni" + +#: trap.c:428 +#, c-format +msgid "trap_handler: bad signal %d" +msgstr "trap_handler: virheellinen signaali %d" + +#: variables.c:382 +#, c-format +msgid "error importing function definition for `%s'" +msgstr "virhe tuotaessa ”%s”:n funktiomääritystä" + +#: variables.c:780 +#, c-format +msgid "shell level (%d) too high, resetting to 1" +msgstr "komentotulkkitaso (%d) liian korkea, palautetaan 1:ksi" + +#: variables.c:1865 +#, fuzzy, c-format +msgid "%s: circular name reference" +msgstr "%d: virheellinen tiedostokahva: %s" + +#: variables.c:2228 +msgid "make_local_variable: no function context at current scope" +msgstr "make_local_variable: ei funktiokontekstia nykytilassa" + +#: variables.c:2247 +#, fuzzy, c-format +msgid "%s: variable may not be assigned value" +msgstr "%s: listaa ei voida sijoittaa taulukon alkioon" + +#: variables.c:3646 +msgid "all_local_variables: no function context at current scope" +msgstr "all_local_variables: ei funktiokontekstia nykytilassa" + +#: variables.c:3891 +#, fuzzy, c-format +msgid "%s has null exportstr" +msgstr "%s: parametria ei ole tai sitä ei ole asetettu" + +#: variables.c:3896 variables.c:3905 +#, c-format +msgid "invalid character %d in exportstr for %s" +msgstr "virheellinen merkki %d %s:n exportstr:ssä" + +#: variables.c:3911 +#, c-format +msgid "no `=' in exportstr for %s" +msgstr "ei =:ä kohteen %s exportstr:ssä" + +#: variables.c:4344 +msgid "pop_var_context: head of shell_variables not a function context" +msgstr "pop_var_context: shell_variablesin alku ei ole funktiokonteksti" + +#: variables.c:4357 +msgid "pop_var_context: no global_variables context" +msgstr "pop_var_context: ei global_variables-kontekstia" + +#: variables.c:4431 +msgid "pop_scope: head of shell_variables not a temporary environment scope" +msgstr "" +"pop_scope: shell_variablesin alku ei väliaikaisten ympäristömuuttujien " +"ympäristössä" + +#: variables.c:5257 +#, fuzzy, c-format +msgid "%s: %s: cannot open as FILE" +msgstr "%s: ei voida avata: %s" + +#: variables.c:5262 +#, fuzzy, c-format +msgid "%s: %s: invalid value for trace file descriptor" +msgstr "%d: virheellinen tiedostokahva: %s" + +#: variables.c:5307 +#, fuzzy, c-format +msgid "%s: %s: compatibility value out of range" +msgstr "%s: %s rajojen ulkopuolella" + +#: version.c:46 +#, fuzzy +msgid "Copyright (C) 2013 Free Software Foundation, Inc." +msgstr "Copyright © 2009 Free Software Foundation, Inc." + +#: version.c:47 version2.c:47 +msgid "" +"License GPLv3+: GNU GPL version 3 or later \n" +msgstr "" +"Lisenssi GPLv3+: GNU GPL versio 3 tai uudempi \n" + +#: version.c:86 version2.c:86 +#, c-format +msgid "GNU bash, version %s (%s)\n" +msgstr "GNU bash, versio %s (%s)\n" + +#: version.c:91 version2.c:91 +#, fuzzy +msgid "This is free software; you are free to change and redistribute it." +msgstr "Tämä on vapaa ohjelma; saat muutella ja levittää sitä vapaasti.\n" + +#: version.c:92 version2.c:92 +#, fuzzy +msgid "There is NO WARRANTY, to the extent permitted by law." +msgstr "Takuuta ei ole lain määräämissä rajoissa.\n" + +#: version2.c:46 +#, fuzzy +msgid "Copyright (C) 2012 Free Software Foundation, Inc." +msgstr "Copyright © 2009 Free Software Foundation, Inc." + +#: xmalloc.c:91 +#, fuzzy, c-format +msgid "%s: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "xmalloc: ei voida varata %lu tavua (varattiin %lu tavua)" + +#: xmalloc.c:93 +#, fuzzy, c-format +msgid "%s: cannot allocate %lu bytes" +msgstr "xmalloc: ei voitu varata %lu tavua" + +#: xmalloc.c:163 +#, fuzzy, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "xmalloc: %s:%d: ei voida varata %lu tavua (varattiin %lu tavua)" + +#: xmalloc.c:165 +#, fuzzy, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes" +msgstr "xmalloc: %s:%d: ei voida varata %lu tavua" + +#: builtins.c:43 +msgid "alias [-p] [name[=value] ... ]" +msgstr "alias [-p] [nimi[=arvo] ... ]" + +#: builtins.c:47 +msgid "unalias [-a] name [name ...]" +msgstr "unalias [-a] nimi [nimi ...]" + +#: builtins.c:51 +#, fuzzy +msgid "" +"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-" +"x keyseq:shell-command] [keyseq:readline-function or readline-command]" +msgstr "" +"bind [-lpvsPVS] [-m näppäinkartta] [-f tiedostonimi] [-q nimi] [-u nimi] [-r " +"näppäinsarja] [-x näppäinsarja:komento] [näppäinsarja:readline-funktio tai " +"readline-komento]" + +#: builtins.c:54 +msgid "break [n]" +msgstr "break [n]" + +#: builtins.c:56 +msgid "continue [n]" +msgstr "continue [n]" + +#: builtins.c:58 +msgid "builtin [shell-builtin [arg ...]]" +msgstr "builtin [sisäänrakennettu komento [arg ...]]" + +#: builtins.c:61 +msgid "caller [expr]" +msgstr "caller [expr]" + +#: builtins.c:64 +#, fuzzy +msgid "cd [-L|[-P [-e]] [-@]] [dir]" +msgstr "cd [-L|-P] [dir]" + +#: builtins.c:66 +msgid "pwd [-LP]" +msgstr "pwd [-LP]" + +#: builtins.c:68 +msgid ":" +msgstr ":" + +#: builtins.c:70 +msgid "true" +msgstr "true" + +#: builtins.c:72 +msgid "false" +msgstr "false" + +#: builtins.c:74 +msgid "command [-pVv] command [arg ...]" +msgstr "command [-pVv] komento [arg ...]" + +#: builtins.c:76 +#, fuzzy +msgid "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" +msgstr "declare [-aAfFilrtux] [-p] [niemi[=arvo] ...]" + +#: builtins.c:78 +#, fuzzy +msgid "typeset [-aAfFgilrtux] [-p] name[=value] ..." +msgstr "typeset [-aAfFilrtux] [-p] nimi[=arvo] ..." + +#: builtins.c:80 +msgid "local [option] name[=value] ..." +msgstr "local [valitsin] nimi[=arvo] ..." + +#: builtins.c:83 +msgid "echo [-neE] [arg ...]" +msgstr "echo [-neE] [arg ...]" + +#: builtins.c:87 +msgid "echo [-n] [arg ...]" +msgstr "echo [-n] [arg ...]" + +#: builtins.c:90 +msgid "enable [-a] [-dnps] [-f filename] [name ...]" +msgstr "enable [-a] [-dnps] [-f tiedosto] [nimi ...]" + +#: builtins.c:92 +msgid "eval [arg ...]" +msgstr "eval [arg ...]" + +#: builtins.c:94 +msgid "getopts optstring name [arg]" +msgstr "getopts valitsinmerkit nimi [arg]" + +#: builtins.c:96 +msgid "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" +msgstr "exec [-cl] [-a nimi] [komento [argumentit ...]] [uudelleenohjaus ...]" + +#: builtins.c:98 +msgid "exit [n]" +msgstr "exit [n]" + +#: builtins.c:100 +msgid "logout [n]" +msgstr "lopetus [n]" + +#: builtins.c:103 +msgid "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" +msgstr "" +"fc [-e e-nimi] [-lnr] [ensimmäinen] [viimeinen] tai fc -s [pat=rep] [komento]" + +#: builtins.c:107 +msgid "fg [job_spec]" +msgstr "fg [työtunniste]" + +#: builtins.c:111 +msgid "bg [job_spec ...]" +msgstr "bg [työtunniste ...]" + +#: builtins.c:114 +msgid "hash [-lr] [-p pathname] [-dt] [name ...]" +msgstr "hash [-lr] [-p polku] [-dt] [nimi ...]" + +#: builtins.c:117 +#, fuzzy +msgid "help [-dms] [pattern ...]" +msgstr "help [-ds] [malline ...]" + +#: builtins.c:121 +msgid "" +"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg " +"[arg...]" +msgstr "" +"history [-c] [-d erotus] [n] tai history -anrw [tiedosto] or history -ps arg " +"[arg...]" + +#: builtins.c:125 +msgid "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" +msgstr "jobs [-lnprs] [työtunniste ...] tai jobs -x komento [args]" + +#: builtins.c:129 +msgid "disown [-h] [-ar] [jobspec ...]" +msgstr "disown [-h] [-ar] [työtunniste ...]" + +#: builtins.c:132 +msgid "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l " +"[sigspec]" +msgstr "" +"kill [-s signaalitunniste | -n signaalinumero | -signaalimäärite] prosessi-" +"id | työtunniste ... tai kill -l [signaalimäärite]" + +#: builtins.c:134 +msgid "let arg [arg ...]" +msgstr "let arg [arg ...]" + +#: builtins.c:136 +#, fuzzy +msgid "" +"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p " +"prompt] [-t timeout] [-u fd] [name ...]" +msgstr "" +"read [-ers] [-a taulukko] [-d erotin] [-i teksti] [-n lkm] [-p kehote] [-t " +"aikakatkaisu] [-u tiedostokahva] [nimi ...]" + +#: builtins.c:138 +msgid "return [n]" +msgstr "return [n]" + +#: builtins.c:140 +#, fuzzy +msgid "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" +msgstr "set [--abefhkmnptuvxBCHP] [-o valitsinnimi] [arg ...]" + +#: builtins.c:142 +#, fuzzy +msgid "unset [-f] [-v] [-n] [name ...]" +msgstr "unset [-f] [-v] [nimi ...]" + +#: builtins.c:144 +msgid "export [-fn] [name[=value] ...] or export -p" +msgstr "export [-fn] [nimi[=arvo] ...] tai export -p" + +#: builtins.c:146 +#, fuzzy +msgid "readonly [-aAf] [name[=value] ...] or readonly -p" +msgstr "readonly [-af] [nimi[=arvo] ...] tai readonly -p" + +#: builtins.c:148 +msgid "shift [n]" +msgstr "shift [n]" + +#: builtins.c:150 +msgid "source filename [arguments]" +msgstr "source tiedosto [argumentit]" + +#: builtins.c:152 +msgid ". filename [arguments]" +msgstr ". tiedosto [argumentit]" + +#: builtins.c:155 +msgid "suspend [-f]" +msgstr "suspend [-f]" + +#: builtins.c:158 +msgid "test [expr]" +msgstr "test [lauseke]" + +#: builtins.c:160 +msgid "[ arg... ]" +msgstr "[ arg... ]" + +#: builtins.c:162 +msgid "times" +msgstr "times" + +#: builtins.c:164 +msgid "trap [-lp] [[arg] signal_spec ...]" +msgstr "trap [-lp] [[arg] signaalimäärite ...]" + +#: builtins.c:166 +msgid "type [-afptP] name [name ...]" +msgstr "type [-afptP] nimi [nimi ...]" + +#: builtins.c:169 +#, fuzzy +msgid "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" +msgstr "ulimit [-SHacdefilmnpqrstuvx] [raja]" + +#: builtins.c:172 +msgid "umask [-p] [-S] [mode]" +msgstr "umask [-p] [-S] [tila]" + +#: builtins.c:175 +#, fuzzy +msgid "wait [-n] [id ...]" +msgstr "wait [id]" + +#: builtins.c:179 +#, fuzzy +msgid "wait [pid ...]" +msgstr "wait [id]" + +#: builtins.c:182 +msgid "for NAME [in WORDS ... ] ; do COMMANDS; done" +msgstr "for NIMI [in ARVOT ... ] ; do KOMENNOT; done" + +#: builtins.c:184 +msgid "for (( exp1; exp2; exp3 )); do COMMANDS; done" +msgstr "for (( lause1; lause2; lause3 )); do KOMENNOT; done" + +#: builtins.c:186 +msgid "select NAME [in WORDS ... ;] do COMMANDS; done" +msgstr "select NIMI [in ARVOT ... ;] do KOMENNOT; done" + +#: builtins.c:188 +msgid "time [-p] pipeline" +msgstr "time [-p] komentoputki" + +#: builtins.c:190 +msgid "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" +msgstr "case SANA in [MALLINE [| MALLINE]...) KOMENNOT ;;]... esac" + +#: builtins.c:192 +msgid "" +"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else " +"COMMANDS; ] fi" +msgstr "" +"if KOMENNOT; then KOMENNOT; [ elif KOMENNOT; then KOMENNOT; ]... [ else " +"KOMENNOT; ] fi" + +#: builtins.c:194 +msgid "while COMMANDS; do COMMANDS; done" +msgstr "while KOMENNOT; do KOMENNOT; done" + +#: builtins.c:196 +msgid "until COMMANDS; do COMMANDS; done" +msgstr "until KOMENNOT; do KOMENNOT; done" + +#: builtins.c:198 +msgid "coproc [NAME] command [redirections]" +msgstr "coproc [NIMI] komento [uudelleenohjaukset]" + +#: builtins.c:200 +msgid "function name { COMMANDS ; } or name () { COMMANDS ; }" +msgstr "function nimi { KOMENNOT ; } tai nimi () { KOMENNOT ; }" + +#: builtins.c:202 +msgid "{ COMMANDS ; }" +msgstr "{ KOMENNOT ; }" + +#: builtins.c:204 +msgid "job_spec [&]" +msgstr "työtunniste [&]" + +#: builtins.c:206 +msgid "(( expression ))" +msgstr "(( lauseke ))" + +#: builtins.c:208 +msgid "[[ expression ]]" +msgstr "[[ lauseke ]]" + +#: builtins.c:210 +msgid "variables - Names and meanings of some shell variables" +msgstr "muuttujat - eräiden komentotulkin muuttujien nimet ja merkitykset" + +#: builtins.c:213 +msgid "pushd [-n] [+N | -N | dir]" +msgstr "pushd [-n] [+N | -N | hakemisto]" + +#: builtins.c:217 +msgid "popd [-n] [+N | -N]" +msgstr "popd [-n] [+N | -N]" + +#: builtins.c:221 +msgid "dirs [-clpv] [+N] [-N]" +msgstr "dirs [-clpv] [+N] [-N]" + +#: builtins.c:224 +msgid "shopt [-pqsu] [-o] [optname ...]" +msgstr "shopt [-pqsu] [-o] [valitsinnimi ...]" + +#: builtins.c:226 +msgid "printf [-v var] format [arguments]" +msgstr "printf [-v muuttuja] muoto [argumentit]" + +#: builtins.c:229 +#, fuzzy +msgid "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-" +"W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S " +"suffix] [name ...]" +msgstr "" +"complete [-abcdefgjksuv] [-pr] [-o valitsin] [-A toimenpide] [-G " +"jokerimalline] [-W sanalista] [-F funktio] [-C komento] [-X " +"suodatinmalline] [-P prefiksi] [-S suffiksi] [nimi...]" + +#: builtins.c:233 +msgid "" +"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " +"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" +msgstr "" +"compgen [-abcdefgjksuv] [-o valitsin] [-A toimenpide] [-G jokerimalline] [-" +"W sanalista] [-F funktio] [-C komento] [-X suodatinmalline] [-P prefiksi] [-" +"S suffiksi] [sana]" + +#: builtins.c:237 +#, fuzzy +msgid "compopt [-o|+o option] [-DE] [name ...]" +msgstr "compopt [-o|+o valitsin] [nimi ...]" + +#: builtins.c:240 +msgid "" +"mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" +"mapfile [-n lukumäärä] [-O alkuperä] [-s laskuri] [-t] [-u tiedostokahva] \n" +"[-C paluukutsu] [-c määrä] [taulukko]" + +#: builtins.c:242 +msgid "" +"readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" +"readarray [-n lukumäärä] [-O alkuperä] [-s laskuri] [-t] [-u " +"tiedostokahva] \n" +"[-C paluukutsu] [-c määrä] [taulukko]" + +#: builtins.c:254 +msgid "" +"Define or display aliases.\n" +" \n" +" Without arguments, `alias' prints the list of aliases in the reusable\n" +" form `alias NAME=VALUE' on standard output.\n" +" \n" +" Otherwise, an alias is defined for each NAME whose VALUE is given.\n" +" A trailing space in VALUE causes the next word to be checked for\n" +" alias substitution when the alias is expanded.\n" +" \n" +" Options:\n" +" -p\tPrint all defined aliases in a reusable format\n" +" \n" +" Exit Status:\n" +" alias returns true unless a NAME is supplied for which no alias has " +"been\n" +" defined." +msgstr "" +"Näytä tai määrittele aliaksia.\n" +" \n" +" Ilman aliaksia ”alias” tulostaa vakiotulosteeseen listan aliaksista \n" +" hyödynnettävässä muodossa ”alias NIMI=ARVO”.\n" +" \n" +" Muussa tapauksessa luodaan uusi alias jokaiselle NIMELLE,\n" +" jonka ARVO on annettu. ARVON jälkeinen tyhjä tarkastetaan\n" +" alias-korvauksen varalta aliasta laajennettaessa.\n" +" \n" +" Valitsimet:\n" +" -p\ttulosta kaikki määritellyt aliakset hyödynnettävässä\n" +" \tmuodossa.\n" +" \n" +" Paluuarvo:\n" +" alias palauttaa arvon tosi, mikäli parametriksi on annettu NIMI jonka\n" +" aliasta ei ole määritelty." + +#: builtins.c:276 +msgid "" +"Remove each NAME from the list of defined aliases.\n" +" \n" +" Options:\n" +" -a\tremove all alias definitions.\n" +" \n" +" Return success unless a NAME is not an existing alias." +msgstr "" +"Poista kukin NIMI määriteltyjen aliasten listasta.\n" +" \n" +" Valitsimet:\n" +" -a\tpoista kaikki aliasmääritykset.\n" +" \n" +" Palauttaa arvon tosi paitsi jos NIMI-nimistä aliasta\n" +" ei ole." + +#: builtins.c:289 +#, fuzzy +msgid "" +"Set Readline key bindings and variables.\n" +" \n" +" Bind a key sequence to a Readline function or a macro, or set a\n" +" Readline variable. The non-option argument syntax is equivalent to\n" +" that found in ~/.inputrc, but must be passed as a single argument:\n" +" e.g., bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Options:\n" +" -m keymap Use KEYMAP as the keymap for the duration of this\n" +" command. Acceptable keymap names are emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" +"move,\n" +" vi-command, and vi-insert.\n" +" -l List names of functions.\n" +" -P List function names and bindings.\n" +" -p List functions and bindings in a form that can be\n" +" reused as input.\n" +" -S List key sequences that invoke macros and their " +"values\n" +" -s List key sequences that invoke macros and their " +"values\n" +" in a form that can be reused as input.\n" +" -V List variable names and values\n" +" -v List variable names and values in a form that can\n" +" be reused as input.\n" +" -q function-name Query about which keys invoke the named function.\n" +" -u function-name Unbind all keys which are bound to the named " +"function.\n" +" -r keyseq Remove the binding for KEYSEQ.\n" +" -f filename Read key bindings from FILENAME.\n" +" -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when\n" +" \t\t\t\tKEYSEQ is entered.\n" +" -X\t\t List key sequences bound with -x and associated commands\n" +" in a form that can be reused as input.\n" +" \n" +" Exit Status:\n" +" bind returns 0 unless an unrecognized option is given or an error occurs." +msgstr "" +"Aseta readlinen näppäimistösidonnat ja muuttujat.\n" +" \n" +" Sido näppäinyhdistelmä readlinen funktioon tai makroon, tai \n" +" aseta readlinen muuttuja. Valitsimeton argumenttisyntaksi vastaa\n" +" ~/.inputrc:n, mutta on annettava yhtenä argumenttina:\n" +" esimerkiksi, bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Valitsimet:\n" +" -m näppäinkartta käytä NÄPPÄINKARTTAA tämän komennon ajan.\n" +" Hyväksyttäviä näppäinkarttoja ovat emacs, emacs-" +"standard,\n" +" emacs-meta, emacs-cltx, vi, vi-move, vi-command ja " +"vi-insert.\n" +" -l Listaa funktioiden nimet\n" +" -P Listaa funktioiden nimet ja sidonnat.\n" +" -p Listaa funktioiden nimet ja sidonnat " +"hyödynnettävässä \n" +" muodossa.\n" +" -S Listaa makrot herättävät näppäinyhdistelmät ja " +"niiden \n" +" arvot\n" +" -s Listaa makrot herättävät näppäinyhdistelmät ja " +"niiden \n" +" arvot\n" +" hyödynnettävässä muodossa.\n" +" -q funktion-nimi Tarkista, mitkä näppäimet käynnistävät nimetyn \n" +" funktion.\n" +" -u funktion-nimi Poista nimettyyn funktioon tehdyt näppäinsidonnat.\n" +" -r näppäinyhdistelmä Poista NÄPPÄINYHDISTELMÄN sidonta.\n" +" -f tiedosto Lue näppäinsidonnat TIEDOSTOSTA.\n" +" -x näppäinyhdistelmä:komento\tkäynnistä KOMENTO \n" +" NÄPPÄINYHDISTELMÄLLÄ.\n" +" \n" +" Paluuarvo:\n" +" bind palauttaa 0 paitsi jos on annettu tunnistamaton valitsin tai " +"tapahtuu \n" +" virhe." + +#: builtins.c:328 +msgid "" +"Exit for, while, or until loops.\n" +" \n" +" Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n" +" loops.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Exit for, while- tai until-silmukoista\n" +" \n" +" Poistu FOR-, WHILE- tai UNTIL-silmukasta. Jos N on annettu, poistu\n" +" N:stä sisäkkäisestä silmukasta.\n" +" \n" +" Paluuarvo:\n" +" Paluuarvo on 0 jollei N ole suurempi tai yhtäsuuri kuin 1." + +#: builtins.c:340 +msgid "" +"Resume for, while, or until loops.\n" +" \n" +" Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n" +" If N is specified, resumes the Nth enclosing loop.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Jatko for-, while tai until-silmukoille.\n" +" \n" +" Jatkaa seuraavaa FOR-, WHILE- tai UNTIL-silmukan kierrosta.\n" +" Jos N on annettu, jatkaa N:ttä silmukkaa.\n" +" \n" +" Paluuarvo:\n" +" Paluuarvo on 0 ellei N ole suurempi tai yhtäsuuri kuin 1." + +#: builtins.c:352 +msgid "" +"Execute shell builtins.\n" +" \n" +" Execute SHELL-BUILTIN with arguments ARGs without performing command\n" +" lookup. This is useful when you wish to reimplement a shell builtin\n" +" as a shell function, but need to execute the builtin within the " +"function.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n" +" not a shell builtin.." +msgstr "" +"Suorita komentotulkin sisäänrakennettuja komentoja.\n" +" \n" +" Suorita KOMENTO argumentein ARGs ilman komennon etsimistä.\n" +" Tämä on hyödyllistä silloin, kun haluat tehdä komentotulkin komennosta\n" +" funktion, mutta haluat suorittaa komennon funktiosta käsin.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa KOMENNON paluuarvon, tai epätoden jos KOMENTO ei ole\n" +" sisäänrakennettu komento." + +#: builtins.c:367 +msgid "" +"Return the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns \"$line $filename\". With EXPR, returns\n" +" \"$line $subroutine $filename\"; this extra information can be used to\n" +" provide a stack trace.\n" +" \n" +" The value of EXPR indicates how many call frames to go back before the\n" +" current one; the top frame is frame 0.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless the shell is not executing a shell function or EXPR\n" +" is invalid." +msgstr "" +"Palauta tämänhetkisen alirutiinikutsun konteksti.\n" +" \n" +" Ilman parametria, palauttaa ”$line $filename”. Parametrilla palauttaa \n" +" ”$line $subroutine $filename”; saatua lisätietoa voidaan käyttää " +"kutsupinon\n" +" kuvaamiseksi.\n" +" \n" +" Parametrin arvo määrää, montako kutsukehystä taaksepäin siirrytään; \n" +" ylin kehys on numero 0.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa 0 ellei komentotulkki ole funktion ulkopuolella tai parametri\n" +" on virheellinen." + +#: builtins.c:385 +#, fuzzy +msgid "" +"Change the shell working directory.\n" +" \n" +" Change the current directory to DIR. The default DIR is the value of " +"the\n" +" HOME shell variable.\n" +" \n" +" The variable CDPATH defines the search path for the directory " +"containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon " +"(:).\n" +" A null directory name is the same as the current directory. If DIR " +"begins\n" +" with a slash (/), then CDPATH is not used.\n" +" \n" +" If the directory is not found, and the shell option `cdable_vars' is " +"set,\n" +" the word is assumed to be a variable name. If that variable has a " +"value,\n" +" its value is used for DIR.\n" +" \n" +" Options:\n" +" -L\tforce symbolic links to be followed: resolve symbolic links in\n" +" \tDIR after processing instances of `..'\n" +" -P\tuse the physical directory structure without following symbolic\n" +" \tlinks: resolve symbolic links in DIR before processing instances\n" +" \tof `..'\n" +" -e\tif the -P option is supplied, and the current working directory\n" +" \tcannot be determined successfully, exit with a non-zero status\n" +" -@ on systems that support it, present a file with extended " +"attributes\n" +" as a directory containing the file attributes\n" +" \n" +" The default is to follow symbolic links, as if `-L' were specified.\n" +" `..' is processed by removing the immediately previous pathname " +"component\n" +" back to a slash or the beginning of DIR.\n" +" \n" +" Exit Status:\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully " +"when\n" +" -P is used; non-zero otherwise." +msgstr "" +"Vaihtaa työhakemistoa.\n" +" \n" +" Siirry hakemistoon HAKEMISTO. HAKEMISTOn oletusarvo on HOME-\n" +" ympäristömuuttujan arvo.\n" +" \n" +" CDPATH-ympäristömuuttuja määrittelee hakupolun HAKEMISTOlle. Vaihto-\n" +" ehtoiset hakemistonimet erotetaan CDPAThissa kaksoispisteellä.\n" +" Tyhjä hakemisto tarkoittaa nykyistä hakemistoa. Jos HAKEMISTO ALKAA\n" +" kauttaviivalla, CDPATHia ei käytetä.\n" +" \n" +" Jos hakemistoa ei löydy, ja komentotulkin valitsin ”cdable_vars” on " +"asetettu,\n" +" oletetaan hakemiston olevan muuttuja. Jos kyseisellä muuttujalla on " +"arvo,\n" +" sitä käytetään HAKEMISTOksi.\n" +" \n" +" Valitsimet:\n" +" -L\tpakota seuraamaan symbolisia linkkejä\n" +" -P\tkäytä fyysistä hakemistorakennetta, älä seuraa symbolisia " +"linkkejä\n" +" \n" +" Oletus on seurata symbolisia linkkejä, kuten jos ”-L” olisi annettu.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa 0, jos hakemistoa vaihdettiin, nollasta poikkeavan muussa \n" +" tapauksessa." + +#: builtins.c:422 +msgid "" +"Print the name of the current working directory.\n" +" \n" +" Options:\n" +" -L\tprint the value of $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tprint the physical directory, without any symbolic links\n" +" \n" +" By default, `pwd' behaves as if `-L' were specified.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless an invalid option is given or the current directory\n" +" cannot be read." +msgstr "" +"Tulostaa tämänhetkisen työhakemiston.\n" +" \n" +" Valitsimet:\n" +" -L\ttulosta $PWD-ympäristömuuttujan arvo jos se sisältää\n" +" \tnykyisen työhakemiston nimen\n" +" -P\ttulosta fyysinen hakemisto ilman symbolisia linkkejä\n" +" \n" +" Oletusarvoisesti ”pwd” käyttäytyy kuin ”-L” olisi annettu.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa 0 ellei ole annettu virheellistä valitsinta tai nykyistä \n" +" hakemistoa ei voida lukea." + +#: builtins.c:439 +msgid "" +"Null command.\n" +" \n" +" No effect; the command does nothing.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Tyhjä komento.\n" +" \n" +" Ei vaikutusta; komento ei tee mitään.\n" +" \n" +" Paluuarvo:\n" +" Onnistuu aina." + +#: builtins.c:450 +msgid "" +"Return a successful result.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Palauttaa onnistuneen paluuarvon.\n" +" \n" +" Paluuarvo:\n" +" Onnistuu aina." + +#: builtins.c:459 +msgid "" +"Return an unsuccessful result.\n" +" \n" +" Exit Status:\n" +" Always fails." +msgstr "" +"Palauttaa epäonnistuneen paluuarvon.\n" +" \n" +" Paluuarvo:\n" +" Epäonnistuu aina." + +#: builtins.c:468 +msgid "" +"Execute a simple command or display information about commands.\n" +" \n" +" Runs COMMAND with ARGS suppressing shell function lookup, or display\n" +" information about the specified COMMANDs. Can be used to invoke " +"commands\n" +" on disk when a function with the same name exists.\n" +" \n" +" Options:\n" +" -p\tuse a default value for PATH that is guaranteed to find all of\n" +" \tthe standard utilities\n" +" -v\tprint a description of COMMAND similar to the `type' builtin\n" +" -V\tprint a more verbose description of each COMMAND\n" +" \n" +" Exit Status:\n" +" Returns exit status of COMMAND, or failure if COMMAND is not found." +msgstr "" +"Suorittaa yksinkertaisen komennon tai näyttää tietoja komennoista.\n" +" \n" +" Suorittaa KOMENNON PARAMETREIN ohittaen komentotulkin funktiohaun,\n" +" tai näyttää tietoja annetuista KOMENNOISTA. Voidaan käyttää \n" +" käynnistämään komentoja levyltä silloin, kun on olemassa samanniminen\n" +" funktio.\n" +" \n" +" Valitsimet:\n" +" -p\tkäytä PATHin oletusarvoa jonka taataan löytävän kaikki " +"vakiotyökalut\n" +" -v\ttulosta KOMENNON kuvaus (kuten sisäänrakennettu ”type”-komento)\n" +" -V\ttulosta KOMENTOJEN yksityiskohtaisemmat kuvaukset\n" +" \n" +" Paluuarvo:\n" +" Palauttaa KOMENNON paluuarvon, tai epäonnistumisen jos KOMENTOA ei \n" +" löytynyt." + +#: builtins.c:487 +#, fuzzy +msgid "" +"Set variable values and attributes.\n" +" \n" +" Declare variables and give them attributes. If no NAMEs are given,\n" +" display the attributes and values of all variables.\n" +" \n" +" Options:\n" +" -f\trestrict action or display to function names and definitions\n" +" -F\trestrict display to function names only (plus line number and\n" +" \tsource file when debugging)\n" +" -g\tcreate global variables when used in a shell function; otherwise\n" +" \tignored\n" +" -p\tdisplay the attributes and value of each NAME\n" +" \n" +" Options which set attributes:\n" +" -a\tto make NAMEs indexed arrays (if supported)\n" +" -A\tto make NAMEs associative arrays (if supported)\n" +" -i\tto make NAMEs have the `integer' attribute\n" +" -l\tto convert NAMEs to lower case on assignment\n" +" -n\tmake NAME a reference to the variable named by its value\n" +" -r\tto make NAMEs readonly\n" +" -t\tto make NAMEs have the `trace' attribute\n" +" -u\tto convert NAMEs to upper case on assignment\n" +" -x\tto make NAMEs export\n" +" \n" +" Using `+' instead of `-' turns off the given attribute.\n" +" \n" +" Variables with the integer attribute have arithmetic evaluation (see\n" +" the `let' command) performed when the variable is assigned a value.\n" +" \n" +" When used in a function, `declare' makes NAMEs local, as with the " +"`local'\n" +" command. The `-g' option suppresses this behavior.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or a variable\n" +" assignment error occurs." +msgstr "" +"Asettaa muuttujien arvot ja attribuutit.\n" +" \n" +" Määrittele muuttujat ja anna niille attribuutit. Jos NIMIÄ ei anneta,\n" +" näytä kaikkien muuttujien attribuutit ja arvot.\n" +" \n" +" Valitsimet:\n" +" -f\trajaa toiminto tai listaus funktioiden nimiin ja määrityksiin\n" +" -F\trajaa listaus ainoastaan funktioiden nimiin (plus rivinumeroon \n" +" \t ja lähdetiedostoon debugattaessa)\n" +" -p\tnäytä jokaisen NIMEN attribuutit ja arvo\n" +" \n" +" Attribuutteja muuttavat valitsimet:\n" +" -a\ttee NIMISTÄ indeksoidut taulukot (jos tuettu)\n" +" -A\ttee NIMISTÄ assosiatiiviset taulukot (jos tuettu)\n" +" -i\ttee NIMISTÄ kokonaislukuja\n" +" -l\tNIMIIN sijoitetut merkkijonot muutetaan pienaakkosiksi\n" +" -r\tkirjoitussuojaa NIMET\n" +" -t\taseta NIMIEN ”trace”-attribuutti\n" +" -u\tNIMIIN sijoitetut merkkijonot muutetaan suuraakkosiksi\n" +" -x\tNIMET viedään\n" +" \n" +" Käyttämällä ”+”:aa ”-”:n sijaan annettu attribuutti poistetaan.\n" +" \n" +" Muuttujille, joille on annettu kokonaislukuattribuutti, suoritetaan\n" +" aritmeettinen evaluointi silloin kun niille annetaan arvo (katso\n" +" ”let”-komento).\n" +" \n" +" Funktiossa käytettäessä ”declare” tekee NIMISTÄ paikallisia, kuten " +"”local”-\n" +" komento.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistumisen ellei ole annettu virheellistä valitsinta tai " +"tule \n" +" virhetilannetta." + +#: builtins.c:527 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Obsolete. See `help declare'." +msgstr "" +"Asettaa muuttujien arvoja ja attribuutteja.\n" +" \n" +" Vanhentunut. Katso ”help declare”." + +#: builtins.c:535 +#, fuzzy +msgid "" +"Define local variables.\n" +" \n" +" Create a local variable called NAME, and give it VALUE. OPTION can\n" +" be any option accepted by `declare'.\n" +" \n" +" Local variables can only be used within a function; they are visible\n" +" only to the function where they are defined and its children.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied, a variable\n" +" assignment error occurs, or the shell is not executing a function." +msgstr "" +"Määrittele paikallisia muuttujia.\n" +" \n" +" Luo paikallinen NIMI-niminen muuttuja, ja anna sille arvo ARVO. " +"VALITSIN\n" +" voi olla mikä tahansa komennon ”declare” hyväksymä.\n" +" \n" +" Paikallisia muuttujia voidaan käyttää ainoastaan funktiossa; ne ovat\n" +" näkyviä ainoastaan määritelleessä funktiossa ja sen lapsissa.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen, ellei ole annettu virheellistä valitsinta,\n" +" tapahtuu virhe tai komentotulkki ei ole suorittamassa funktiota." + +#: builtins.c:552 +#, fuzzy +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs, separated by a single space character and followed by " +"a\n" +" newline, on the standard output.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" -e\tenable interpretation of the following backslash escapes\n" +" -E\texplicitly suppress interpretation of backslash escapes\n" +" \n" +" `echo' interprets the following backslash-escaped characters:\n" +" \\a\talert (bell)\n" +" \\b\tbackspace\n" +" \\c\tsuppress further output\n" +" \\e\tescape character\n" +" \\E\tescape character\n" +" \\f\tform feed\n" +" \\n\tnew line\n" +" \\r\tcarriage return\n" +" \\t\thorizontal tab\n" +" \\v\tvertical tab\n" +" \\\\\tbackslash\n" +" \\0nnn\tthe character whose ASCII code is NNN (octal). NNN can be\n" +" \t0 to 3 octal digits\n" +" \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" +" \tcan be one or two hex digits\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Kirjoita argumentit vakiotulosteeseen.\n" +" \n" +" Tulosta ARGUMENTIT vakiotulosteeseen rivinvaihdoin.\n" +" \n" +" Valitsimet:\n" +" -n\tälä lisää rivinvaihtoa\n" +" -e\ttulkitse seuraavat kenoviivaohjaukset\n" +" -E\tohita kenoviivaohjausten tulkinta\n" +" \n" +" \"echo\" tulkitsee seuraavat kenoviivaohjausmerkit:\n" +" \\a\täänimerkki\n" +" \\b\tbackspace\n" +" \\c\tkeskeytä tulostus\n" +" \\e\tESC-merkki\n" +" \\f\tsivunvaihto\n" +" \\n\trivinvaihto\n" +" \\r\tpalautin\n" +" \\t\tsarkain\n" +" \\v\tvertikaalinen sarkain\n" +" \\\\\tkenoviiva\n" +" \\0nnn\tmerkki jonka ASCII-koodi oktaalina on NNN. NNN voi olla 0-3\n" +" \toktaalimerkkiä\n" +" \\xHH\tkahdeksanbittinen merkki jonka heksadesimaaliarvo on HH. HH " +"voi \n" +" \tolla 1-2 heksadesimaalimerkkiä\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen ellei tapahdu virhettä." + +#: builtins.c:588 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs on the standard output followed by a newline.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Tulosta argumentit vakiotulosteeseen.\n" +" \n" +" Tulosta ARGUMENTIT vakiotulosteeseen päättäen rivinvaihdolla.\n" +" \n" +" Valitsimet:\n" +" -n\tälä lisää rivinvaihtoa\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen ellei tapahdu virhettä." + +#: builtins.c:603 +msgid "" +"Enable and disable shell builtins.\n" +" \n" +" Enables and disables builtin shell commands. Disabling allows you to\n" +" execute a disk command which has the same name as a shell builtin\n" +" without using a full pathname.\n" +" \n" +" Options:\n" +" -a\tprint a list of builtins showing whether or not each is enabled\n" +" -n\tdisable each NAME or display a list of disabled builtins\n" +" -p\tprint the list of builtins in a reusable format\n" +" -s\tprint only the names of Posix `special' builtins\n" +" \n" +" Options controlling dynamic loading:\n" +" -f\tLoad builtin NAME from shared object FILENAME\n" +" -d\tRemove a builtin loaded with -f\n" +" \n" +" Without options, each NAME is enabled.\n" +" \n" +" To use the `test' found in $PATH instead of the shell builtin\n" +" version, type `enable -n test'.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not a shell builtin or an error occurs." +msgstr "" +"Ottaa käyttöön tai poistaa käytöstä komentotulkin sisäänrakennettuja " +"komentoja.\n" +" \n" +" Ottaa käyttöön tai poistaa komentotulkin sisäänrakennettuja komentoja\n" +" käytöstä. Käytöstäpoisto sallii sinun käyttävän sisäisen komennon " +"kanssa \n" +" samannimisiä, levyllä olevia komentoja käyttämättä koko polkua.\n" +" \n" +" Valitsimet:\n" +" -a\tlistaa komennot ja tiedot, mitkä on otettu käyttöön\n" +" -n\tpoistaa NIMET käytöstä tai näyttää listan poistetuista\n" +" -p\ttulosta lista komennoista hyödynnettävässä muodossa\n" +" -s\ttulosta ainoastaan Posix-komennot\n" +" \n" +" Valitsimet, jotka kontrolloivat dynaamista lataamista:\n" +" -f\tlataa komento NIMI jaetusta objektista TIEDOSTO\n" +" -d\tpoista -f:llä ladattu komento\n" +" \n" +" Jollei valitsimia anneta, kukin NIMI otetaan käyttöön.\n" +" \n" +" Jos haluat käyttää $PATHista löytyvää ”test”-komentoa sisäänrakennetun\n" +" sijaan, kirjoita ”enable -n test”.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen, paitsi jos NIMI ei ole komentotulkin " +"sisäänrakennettu\n" +" komento tai tapahtuu virhe." + +#: builtins.c:631 +msgid "" +"Execute arguments as a shell command.\n" +" \n" +" Combine ARGs into a single string, use the result as input to the " +"shell,\n" +" and execute the resulting commands.\n" +" \n" +" Exit Status:\n" +" Returns exit status of command or success if command is null." +msgstr "" +"Suorita argumentit komentotulkin komentona.\n" +" \n" +" Yhdistä ARGUMENTIT yhdeksi merkkijonoksi, käytä tulosta komentotulkin\n" +" syötteenä ja suorita saadut komennot.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa komennon paluuarvon tai onnistuneen jos komento on tyhjä." + +#: builtins.c:643 +msgid "" +"Parse option arguments.\n" +" \n" +" Getopts is used by shell procedures to parse positional parameters\n" +" as options.\n" +" \n" +" OPTSTRING contains the option letters to be recognized; if a letter\n" +" is followed by a colon, the option is expected to have an argument,\n" +" which should be separated from it by white space.\n" +" \n" +" Each time it is invoked, getopts will place the next option in the\n" +" shell variable $name, initializing name if it does not exist, and\n" +" the index of the next argument to be processed into the shell\n" +" variable OPTIND. OPTIND is initialized to 1 each time the shell or\n" +" a shell script is invoked. When an option requires an argument,\n" +" getopts places that argument into the shell variable OPTARG.\n" +" \n" +" getopts reports errors in one of two ways. If the first character\n" +" of OPTSTRING is a colon, getopts uses silent error reporting. In\n" +" this mode, no error messages are printed. If an invalid option is\n" +" seen, getopts places the option character found into OPTARG. If a\n" +" required argument is not found, getopts places a ':' into NAME and\n" +" sets OPTARG to the option character found. If getopts is not in\n" +" silent mode, and an invalid option is seen, getopts places '?' into\n" +" NAME and unsets OPTARG. If a required argument is not found, a '?'\n" +" is placed in NAME, OPTARG is unset, and a diagnostic message is\n" +" printed.\n" +" \n" +" If the shell variable OPTERR has the value 0, getopts disables the\n" +" printing of error messages, even if the first character of\n" +" OPTSTRING is not a colon. OPTERR has the value 1 by default.\n" +" \n" +" Getopts normally parses the positional parameters ($0 - $9), but if\n" +" more arguments are given, they are parsed instead.\n" +" \n" +" Exit Status:\n" +" Returns success if an option is found; fails if the end of options is\n" +" encountered or an error occurs." +msgstr "" +"Selaa valitsimien argumentit.\n" +" \n" +" Getoptsia käytetään komentotulkin proseduureissa käsiteltäessä\n" +" komentoriviparametreina annettuja valitsimia.\n" +" \n" +" OPTSTRING sisältää tunnistettavat valitsinkirjaimet; jos kirjainta\n" +" seuraa kaksoispiste, valitsimella odotetaan olevan argumentti, joka \n" +" pitäisi erottaa siitä tyhjämerkillä.\n" +" \n" +" Getopts sijoittaa joka kutsukerralla seuraavan valitsimen muuttujaan\n" +" $nimi, alustaen sen tarvittaessa, ja seuraavan käsiteltävän argumentin\n" +" OPTIND-ympäristömuuttujaan. OPTIND alustetaan 1:ksi jokaisella\n" +" komentotulkin tai komentotiedoston käynnistyskerralla. Kun valitsin\n" +" vaatii argumentin, getopts sijoittaa sen muuttujaan OPTARG.\n" +" \n" +" Getopts ilmoittaa virheistä jommallakummalla tavalla kahdesta. Jos\n" +" OPTSTRINGIN ensimmäinen merkki on kaksoispiste, getopts ilmoittaa\n" +" virheistä hiljaisesti. Tällöin ei tulosteta virheilmoitusta. Jos " +"löydetään\n" +" virheellinen valitsinmerkki, se sijoitetaan OPTARGIIN. Jos vaadittua\n" +" argumenttia ei löydetä, getopts sijoittaa ”:”:n NAMEEN ja asettaa\n" +" löydetyn optiomerkin OPTARGIIN. Jos getopts ei ole hiljaisessa tilassa\n" +" ja löydetään virheellinen valitsin, getopts sijoittaa ”?”:n NAMEEN ja\n" +" tyhjentää OPTARGIN. Jos vaadittua argumenttia ei löydetä, NAMEEN\n" +" sijoitetaan ”?”, OPTARG tyhjennetään ja tulostetaan virheilmoitus.\n" +" \n" +" Jos OPTERR-ympäristömuuttujassa on arvo 0, getopts jättää " +"virheilmoitukset\n" +" tulostamatta, vaikka OPTSTRINGIN ensimmäinen merkki ei ole " +"kaksoispiste.\n" +" OPTERRin oletusarvo on 1.\n" +" \n" +" Getopts selaa normaalisti positioparametrit ($0 - $9), mutta jos \n" +" argumentteja annetaan enemmän, ne selataan sen sijaan.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen jos valitsin löytyy; epäonnistuneen jos " +"valitsimet\n" +" loppuvat tai tapahtuu virhe." + +#: builtins.c:685 +msgid "" +"Replace the shell with the given command.\n" +" \n" +" Execute COMMAND, replacing this shell with the specified program.\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not " +"specified,\n" +" any redirections take effect in the current shell.\n" +" \n" +" Options:\n" +" -a name\tpass NAME as the zeroth argument to COMMAND\n" +" -c\t\texecute COMMAND with an empty environment\n" +" -l\t\tplace a dash in the zeroth argument to COMMAND\n" +" \n" +" If the command cannot be executed, a non-interactive shell exits, " +"unless\n" +" the shell option `execfail' is set.\n" +" \n" +" Exit Status:\n" +" Returns success unless COMMAND is not found or a redirection error " +"occurs." +msgstr "" +"Korvaa komentotulkki annetulla komennolla.\n" +" \n" +" Suorita KOMENTO, korvaten tämä komentotulkki annetulla ohjelmalla.\n" +" ARGUMENTEISTA tulee KOMENNON argumentteja. Jos KOMENTOA ei anneta,\n" +" kaikki uudelleenohjaukset tapahtuvat nykyisessä komentotulkissa.\n" +" \n" +" Valitsimet:\n" +" -a name\tanna NAME nollantena argumenttina KOMENNOLLE\n" +" -c\t\tsuorita KOMENTO tyhjässä ympäristössä\n" +" -l\t\tsijoita miinusmerkki KOMENNON nollanteen argumenttiin\n" +" \n" +" Jos komentoa ei voida suorittaa, ei-interaktiivinen komentotulkki " +"poistuu,\n" +" ellei tulkin valitsinta ”execfail” ole asetettu.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen paitsi jos KOMENTOA ei löydy tai " +"uudelleenohjauksessa\n" +" tapahtuu virhe." + +#: builtins.c:706 +msgid "" +"Exit the shell.\n" +" \n" +" Exits the shell with a status of N. If N is omitted, the exit status\n" +" is that of the last command executed." +msgstr "" +"Poistu komentotulkista.\n" +" \n" +" Poistuu komentotulkista paluuarvolla N. Jos N:ää ei anneta, paluuarvo\n" +" on viimeisen komennon paluuarvo." + +#: builtins.c:715 +msgid "" +"Exit a login shell.\n" +" \n" +" Exits a login shell with exit status N. Returns an error if not " +"executed\n" +" in a login shell." +msgstr "" +"Poistu sisäänkirjautumiskomentotulkista.\n" +" \n" +" Poistuu sisäänkirjautumiskomentotulkista paluuarvolla N. Palauttaa\n" +" virheen jos ei olla sisäänkirjautumiskomentotulkissa." + +#: builtins.c:725 +msgid "" +"Display or execute commands from the history list.\n" +" \n" +" fc is used to list or edit and re-execute commands from the history " +"list.\n" +" FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" +" string, which means the most recent command beginning with that\n" +" string.\n" +" \n" +" Options:\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then " +"EDITOR,\n" +" \t\tthen vi\n" +" -l \tlist lines instead of editing\n" +" -n\tomit line numbers when listing\n" +" -r\treverse the order of the lines (newest listed first)\n" +" \n" +" With the `fc -s [pat=rep ...] [command]' format, COMMAND is\n" +" re-executed after the substitution OLD=NEW is performed.\n" +" \n" +" A useful alias to use with this is r='fc -s', so that typing `r cc'\n" +" runs the last command beginning with `cc' and typing `r' re-executes\n" +" the last command.\n" +" \n" +" Exit Status:\n" +" Returns success or status of executed command; non-zero if an error " +"occurs." +msgstr "" +"Näytä tai suorita komentoja komentohistoriasta.\n" +" \n" +" Fc:tä käytetään historialistassa olevien komentojen tulostamiseen tai\n" +" muokkaamiseen ja uudelleensuoritukseen. ALKU ja LOPPU voivat olla\n" +" rajaavia numeroita, tai ALKU voi olla merkkijono, joka tarkoittaa " +"viimei-\n" +" sintä sillä alkavaa komentoa.\n" +" \n" +" Valitsimet:\n" +" -e ENIMI\tvalitse käytettävä editori. Oletus on FCEDIT, sitten EDITOR\n" +" \t\tsitten vi\n" +" -l\tlistaa rivit editoinnin sijaan\n" +" -r\tlistaa käänteisessä järjestyksessä\n" +" \n" +" Käytettäessä muotoa ”fc -s [malline=korvaus] [komento]”, komento\n" +" suoritetaan kun korvaus MALLINE=KORVAUS on suoritettu.\n" +" \n" +" Eräs käyttökelpoinen alias on r='fc -s', jolloin ”r cc” ajaa viimeisen " +"cc-\n" +" alkuisen komennon ja ”r” suorittaa viimeisen komennon.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen tai suoritetun komennon paluuarvon; nollasta\n" +" poikkeava virhetilanteessa." + +#: builtins.c:755 +msgid "" +"Move job to the foreground.\n" +" \n" +" Place the job identified by JOB_SPEC in the foreground, making it the\n" +" current job. If JOB_SPEC is not present, the shell's notion of the\n" +" current job is used.\n" +" \n" +" Exit Status:\n" +" Status of command placed in foreground, or failure if an error occurs." +msgstr "" +"Siirrä työ edustalle.\n" +" \n" +" Siirrä TYÖKUVAAJALLA tunnistettu työ edustalle, jolloin siitä tulee " +"nykyinen\n" +" työ. Jos TYÖKUVAAJAA ei ole annettu, käytetään komentotulkin käsitystä\n" +" tämänhetkisestä työstä.\n" +" \n" +" Paluuarvo:\n" +" Edustalle tuodun työn paluuarvo, tai epäonnistuminen virhetilanteessa." + +#: builtins.c:770 +msgid "" +"Move jobs to the background.\n" +" \n" +" Place the jobs identified by each JOB_SPEC in the background, as if " +"they\n" +" had been started with `&'. If JOB_SPEC is not present, the shell's " +"notion\n" +" of the current job is used.\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Siirtää työt taustalle.\n" +" \n" +" Siirtää kunkin TYÖNKUVAAJALLA tunnistetun työn taustalle, kuten jos ne " +"olisi\n" +" käynnistetty ”&”:llä. Jos TYÖNKUVAAJAA ei ole annettu, käytetään " +"komento-\n" +" tulkin käsitystä nykyisestä työstä.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen paitsi jos työnohjaus ei ole käytössä tai " +"tapahtuu\n" +" virhe." + +#: builtins.c:784 +#, fuzzy +msgid "" +"Remember or display program locations.\n" +" \n" +" Determine and remember the full pathname of each command NAME. If\n" +" no arguments are given, information about remembered commands is " +"displayed.\n" +" \n" +" Options:\n" +" -d\t\tforget the remembered location of each NAME\n" +" -l\t\tdisplay in a format that may be reused as input\n" +" -p pathname\tuse PATHNAME as the full pathname of NAME\n" +" -r\t\tforget all remembered locations\n" +" -t\t\tprint the remembered location of each NAME, preceding\n" +" \t\teach location with the corresponding NAME if multiple\n" +" \t\tNAMEs are given\n" +" Arguments:\n" +" NAME\t\tEach NAME is searched for in $PATH and added to the list\n" +" \t\tof remembered commands.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not found or an invalid option is given." +msgstr "" +"Muista tai näytä ohjelmien sijainnit.\n" +" \n" +" Selvitä ja muista jokaisen komennon NIMI täysi polkunimi. Jos " +"argumentteja\n" +" ei ole annettu, tulostetaan tiedot muistetuista komennoista.\n" +"\n" +" Valitsimet:\n" +" -d\t\tunohda jokaisen NIMEN sijainti\n" +" -l\t\tnäytä hyödynnettävässä muodossa\n" +" -p polku\tkäytä POLKUA NIMEN täytenä polkunimenä\n" +" -r\t\tunohda kaikki sijainnit\n" +" -t\t\ttulosta kaikkien NIMIEN muistetut sijainnit. Jos annetaan " +"useampi NIMI,\n" +" \t\tsijaintien eteen tulostetaan vastaava NIMI\n" +" Argumentit:\n" +" NIMI\t\tKukin NIMI etsitään $PATH-muuttujan hakupoluista ja lisätään\n" +" muistettujen komentojen listaan.\n" +"\n" +" Paluuarvo:\n" +" Palauttaa onnistuneen paitsi jos NIMEÄ ei löydy tai on annettu " +"virheellinen valitsin." + +#: builtins.c:809 +msgid "" +"Display information about builtin commands.\n" +" \n" +" Displays brief summaries of builtin commands. If PATTERN is\n" +" specified, gives detailed help on all commands matching PATTERN,\n" +" otherwise the list of help topics is printed.\n" +" \n" +" Options:\n" +" -d\toutput short description for each topic\n" +" -m\tdisplay usage in pseudo-manpage format\n" +" -s\toutput only a short usage synopsis for each topic matching\n" +" \tPATTERN\n" +" \n" +" Arguments:\n" +" PATTERN\tPattern specifiying a help topic\n" +" \n" +" Exit Status:\n" +" Returns success unless PATTERN is not found or an invalid option is " +"given." +msgstr "" +"Näyttää tietoja sisäänrakennetuista komennoista.\n" +" \n" +" Näyttää lyhyet tiivistelmät sisäänrakennetuista komennoista. Jos " +"MALLINE\n" +" on annettu, antaa yksityiskohtaisemman ohjeen kaikista MALLINEESEEN\n" +" sopivista komennoista, muuten tulostetaan lista ohjeotsikoista.\n" +" \n" +" Valitsimet:\n" +" -d\ttulosta kunkin aiheen lyhyt kuvaus\n" +" -m\tnäytä käyttöohje man-sivumaisessa muodossa\n" +" -s\ttulosta ainoastaan lyhyt käyttöohje kustakin MALLINEESEEN \n" +" \tsopivasta\n" +" \n" +" Argumentit:\n" +" MALLINE\tohjeotsikon hakumalline\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen paitsi jos MALLINETTA ei löydy tai valitsin on\n" +" virheellinen." + +#: builtins.c:833 +msgid "" +"Display or manipulate the history list.\n" +" \n" +" Display the history list with line numbers, prefixing each modified\n" +" entry with a `*'. An argument of N lists only the last N entries.\n" +" \n" +" Options:\n" +" -c\tclear the history list by deleting all of the entries\n" +" -d offset\tdelete the history entry at offset OFFSET.\n" +" \n" +" -a\tappend history lines from this session to the history file\n" +" -n\tread all history lines not already read from the history file\n" +" -r\tread the history file and append the contents to the history\n" +" \tlist\n" +" -w\twrite the current history to the history file\n" +" \tand append them to the history list\n" +" \n" +" -p\tperform history expansion on each ARG and display the result\n" +" \twithout storing it in the history list\n" +" -s\tappend the ARGs to the history list as a single entry\n" +" \n" +" If FILENAME is given, it is used as the history file. Otherwise,\n" +" if $HISTFILE has a value, that is used, else ~/.bash_history.\n" +" \n" +" If the $HISTTIMEFORMAT variable is set and not null, its value is used\n" +" as a format string for strftime(3) to print the time stamp associated\n" +" with each displayed history entry. No time stamps are printed " +"otherwise.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" +"Näyttää tai muokkaa komentohistoriaa.\n" +" \n" +" Näyttää (komento)historian rivinumeroin, sijoittaen asteriskin jokaisen\n" +" muokatun alkion eteen. Argumentilla N listataan vain N viimeistä " +"alkiota.\n" +" \n" +" Valitsimet:\n" +" -c\ttyhjennä historia poistamalla kaikki alkiot\n" +" -d sijainti\tpoista alkio kohdasta SIJAINTI\n" +" \n" +" -a\tlisää tämän istunnon historiarivit historiatiedostoon\n" +" -n\tlue kaikki rivit, joita ei jo ole luettu historiatiedostosta\n" +" -r\tlue historiatiedosto ja lisää sen sisältö historiaan\n" +" -w\tkirjoita nykyinen historia historiatiedostoon ja lisää ne " +"historiaan\n" +" \n" +" -p\tsuorita historialaajennos jokaiselle ARGUMENTILLE ja näytä tulos\n" +" \tlisäämättä sitä historiaan\n" +" -s\tliitä ARGUMENTIT historiaan yhtenä alkiona\n" +" \n" +" Jos TIEDOSTO on annettu, sitä käytetään historiatiedostona. Muuten,\n" +" jos $HISTFILE:llä on arvo, sitä käytetään, muuten ~/.bash_history.\n" +" \n" +" Jos $HISTTIMEFORMAT-muuttuja on asetettu ja se ei ole tyhjä, sen arvoa\n" +" käytetään strftime(3):n muotoilujonona tulostettaessa kunkin alkion " +"aikaleima.\n" +" Muussa tapauksessa aikaleimoja ei tulosteta.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen paitsi jos on annettu virheellinen valitsin " +"tai tapahtuu virhe." + +#: builtins.c:869 +#, fuzzy +msgid "" +"Display status of jobs.\n" +" \n" +" Lists the active jobs. JOBSPEC restricts output to that job.\n" +" Without options, the status of all active jobs is displayed.\n" +" \n" +" Options:\n" +" -l\tlists process IDs in addition to the normal information\n" +" -n\tlists only processes that have changed status since the last\n" +" \tnotification\n" +" -p\tlists process IDs only\n" +" -r\trestrict output to running jobs\n" +" -s\trestrict output to stopped jobs\n" +" \n" +" If -x is supplied, COMMAND is run after all job specifications that\n" +" appear in ARGS have been replaced with the process ID of that job's\n" +" process group leader.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs.\n" +" If -x is used, returns the exit status of COMMAND." +msgstr "" +"Näyttää töiden tilan.\n" +" \n" +" Listaa aktiiviset työt. TYÖMÄÄRITYS rajaa tulostuksen kyseiseen työhön.\n" +" Ilman valitsimia tulostetaan kaikkien aktiivisten töiden tila.\n" +" \n" +" Valitsimet:\n" +" -l\tlistaa prosessitunnukset (pid) muun tiedon lisäksi\n" +" -n\tlistaa ainoastaan prosessit joiden tila on muuttunut viimeisen\n" +" \tilmoituksen jälkeen\n" +" -p\tlistaa vain prosessitunnukset\n" +" -r\trajaa tulostus ajossa oleviin töihin\n" +" \n" +" Jos -x on annettu, KOMENTO suoritetaan kun kaikki ARGUMENTEISSA annetut\n" +" työmääritykset on korvattu kyseisen työn prosessiryhmän johtajan " +"prosessi-\n" +" tunnuksella.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen paitsi jos on annettu virheellinen valitsin tai \n" +" tapahtuu virhe. Jos -x:ää on käytetty, palauttaa KOMENNON paluuarvon." + +#: builtins.c:896 +msgid "" +"Remove jobs from current shell.\n" +" \n" +" Removes each JOBSPEC argument from the table of active jobs. Without\n" +" any JOBSPECs, the shell uses its notion of the current job.\n" +" \n" +" Options:\n" +" -a\tremove all jobs if JOBSPEC is not supplied\n" +" -h\tmark each JOBSPEC so that SIGHUP is not sent to the job if the\n" +" \tshell receives a SIGHUP\n" +" -r\tremove only running jobs\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option or JOBSPEC is given." +msgstr "" +"Poistaa töitä nykyisestä komentotulkista.\n" +" \n" +" Poistaa kunkin TYÖTUNNISTEEN aktiivisten töiden taulukosta. Ilman\n" +" TYÖTUNNISTEITA komentotulkki käyttää omaa arviotaan nykyisestä\n" +" työstä.\n" +" \n" +" Valitsimet:\n" +" -a\tpoista kaikki työt ellei TYÖTUNNISTETTA ole annettu\n" +" -h\tmerkitse kukin TYÖTUNNISTE siten, ettei niille lähetetä\n" +" \tSIGHUPia, jos komentotulkki vastaanottaa sellaisen\n" +" -r\tpoista ainoastaan ajossa olevat työt\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen paitsi jos jokin valitsin tai TYÖTUNNISTE on " +"virheellinen." + +#: builtins.c:915 +msgid "" +"Send a signal to a job.\n" +" \n" +" Send the processes identified by PID or JOBSPEC the signal named by\n" +" SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n" +" SIGTERM is assumed.\n" +" \n" +" Options:\n" +" -s sig\tSIG is a signal name\n" +" -n sig\tSIG is a signal number\n" +" -l\tlist the signal names; if arguments follow `-l' they are\n" +" \tassumed to be signal numbers for which names should be listed\n" +" \n" +" Kill is a shell builtin for two reasons: it allows job IDs to be used\n" +" instead of process IDs, and allows processes to be killed if the limit\n" +" on processes that you can create is reached.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" +"Lähetä työlle signaali.\n" +" \n" +" Lähettää PIDILLÄ tai TYÖTUNNISTEELLA tunnistetulle prosessille\n" +" SIGSPECILLÄ tai SIGNUMILLA annetun signaalin. Jos kumpaakaan\n" +" ei ole läsnä, käytetään SIGTERMIÄ.\n" +" \n" +" Valitsimet:\n" +" -s sig\tSIG on signaalin nimi\n" +" -n sig\tSIG on signaalin numero\n" +" -l\tlistaa signaalien nimet; ”-l”:n jälkeiset argumentit oletetaan\n" +" \tsignaalinumeroiksi, joiden nimet halutaan listata.\n" +" \n" +" Kill on sisäänrakennettu komento kahdesta syystä: se antaa käyttää\n" +" työtunnisteita prosessitunnusten sijaan, ja sallii prosessien " +"tappamisen\n" +" vaikka sallittujen prosessien lukumäärä olisikin ylitetty.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen paitsi jos on annettu virheellinen valitsin tai " +"tapahtuu virhe." + +#: builtins.c:938 +#, fuzzy +msgid "" +"Evaluate arithmetic expressions.\n" +" \n" +" Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" +" fixed-width integers with no check for overflow, though division by 0\n" +" is trapped and flagged as an error. The following list of operators is\n" +" grouped into levels of equal-precedence operators. The levels are " +"listed\n" +" in order of decreasing precedence.\n" +" \n" +" \tid++, id--\tvariable post-increment, post-decrement\n" +" \t++id, --id\tvariable pre-increment, pre-decrement\n" +" \t-, +\t\tunary minus, plus\n" +" \t!, ~\t\tlogical and bitwise negation\n" +" \t**\t\texponentiation\n" +" \t*, /, %\t\tmultiplication, division, remainder\n" +" \t+, -\t\taddition, subtraction\n" +" \t<<, >>\t\tleft and right bitwise shifts\n" +" \t<=, >=, <, >\tcomparison\n" +" \t==, !=\t\tequality, inequality\n" +" \t&\t\tbitwise AND\n" +" \t^\t\tbitwise XOR\n" +" \t|\t\tbitwise OR\n" +" \t&&\t\tlogical AND\n" +" \t||\t\tlogical OR\n" +" \texpr ? expr : expr\n" +" \t\t\tconditional operator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tassignment\n" +" \n" +" Shell variables are allowed as operands. The name of the variable\n" +" is replaced by its value (coerced to a fixed-width integer) within\n" +" an expression. The variable need not have its integer attribute\n" +" turned on to be used in an expression.\n" +" \n" +" Operators are evaluated in order of precedence. Sub-expressions in\n" +" parentheses are evaluated first and may override the precedence\n" +" rules above.\n" +" \n" +" Exit Status:\n" +" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." +msgstr "" +"Laskee matemaattiset lausekkeet.\n" +" \n" +" Laskee jokaisen ARGUMENTIN matemaattisena lausekkeena. Evaluointi\n" +" tehdään kiinteänmittaisina kokonaislukuina ilman ylivuodon " +"tarkistamista,\n" +" vaikkakin nollalla jako havaitaan ja ilmoitetaan virheenä. Seuraava \n" +" operaattorilista on ryhmitelty samanarvoisten operaattoreiden ryhmiin. \n" +" Evaluointijärjestys on laskeva.\n" +" \n" +" \tid++, id--\tmuuttujan jälkilisäys, jälkivähennys\n" +" \t++id, --id\toperaattorin etulisäys, etuvähennys\n" +" \t-, +\t\tunaarinen miinus, plus\n" +" \t!, ~\t\tlooginen ja bittitason negaatio\n" +" \t**\t\tpotenssiinkorotus\n" +" \t*, /, %\t\tkertominen, jakaminen, jakojäännös\n" +" \t+, -\t\tlisäys, vähennys\n" +" \t<<, >>\t\tbittisiirrot vasemmalle ja oikealle\n" +" \t<=, >=, <, >\tvertailu\n" +" \t==, !=\t\tyhtäläisyys, epäyhtäläisyys\n" +" \t&\t\tbittitason AND\n" +" \t^\t\tbittitason XOR\n" +" \t|\t\tbittitason OR\n" +" \t&&\t\tlooginen AND\n" +" \t||\t\tlooginen OR\n" +" \texpr ? expr : expr\n" +" \t\t\tehdollinen operaattori\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tsijoitus\n" +" \n" +" Ympäristömuuttujia voidaan käyttää operandeina. Lausekkeessa muuttujan \n" +" nimi korvataan sen arvolla (määrämittaiseksi kokonaisluvuksi " +"pakotettuna).\n" +" Muuttujan integer-attribuutin ei tarvitse olla asetettuna.\n" +" \n" +" Operaattorit evaluoidaan laskennallisessa järjestyksessä. Suluissa " +"olevat \n" +" alilausekkeet evaluoidaan ensin; suluilla voidaan myös muuttaa \n" +" edelläkuvattua laskentajärjestystä.\n" +" \n" +" Paluuarvo:\n" +" Jos viimeinen ARGUMENTTI evaluoituu nollaksi, let palauttaa 1, muussa\n" +" tapauksessa 0." + +#: builtins.c:983 +#, fuzzy +msgid "" +"Read a line from the standard input and split it into fields.\n" +" \n" +" Reads a single line from the standard input, or from file descriptor FD\n" +" if the -u option is supplied. The line is split into fields as with " +"word\n" +" splitting, and the first word is assigned to the first NAME, the second\n" +" word to the second NAME, and so on, with any leftover words assigned to\n" +" the last NAME. Only the characters found in $IFS are recognized as " +"word\n" +" delimiters.\n" +" \n" +" If no NAMEs are supplied, the line read is stored in the REPLY " +"variable.\n" +" \n" +" Options:\n" +" -a array\tassign the words read to sequential indices of the array\n" +" \t\tvariable ARRAY, starting at zero\n" +" -d delim\tcontinue until the first character of DELIM is read, rather\n" +" \t\tthan newline\n" +" -e\t\tuse Readline to obtain the line in an interactive shell\n" +" -i text\tUse TEXT as the initial text for Readline\n" +" -n nchars\treturn after reading NCHARS characters rather than waiting\n" +" \t\tfor a newline, but honor a delimiter if fewer than NCHARS\n" +" \t\tcharacters are read before the delimiter\n" +" -N nchars\treturn only after reading exactly NCHARS characters, " +"unless\n" +" \t\tEOF is encountered or read times out, ignoring any delimiter\n" +" -p prompt\toutput the string PROMPT without a trailing newline before\n" +" \t\tattempting to read\n" +" -r\t\tdo not allow backslashes to escape any characters\n" +" -s\t\tdo not echo input coming from a terminal\n" +" -t timeout\ttime out and return failure if a complete line of input " +"is\n" +" \t\tnot read within TIMEOUT seconds. The value of the TMOUT\n" +" \t\tvariable is the default timeout. TIMEOUT may be a\n" +" \t\tfractional number. If TIMEOUT is 0, read returns immediately,\n" +" \t\twithout trying to read any data, returning success only if\n" +" \t\tinput is available on the specified file descriptor. The\n" +" \t\texit status is greater than 128 if the timeout is exceeded\n" +" -u fd\t\tread from file descriptor FD instead of the standard input\n" +" \n" +" Exit Status:\n" +" The return code is zero, unless end-of-file is encountered, read times " +"out\n" +" (in which case it's greater than 128), a variable assignment error " +"occurs,\n" +" or an invalid file descriptor is supplied as the argument to -u." +msgstr "" +"Lukee rivin vakiosyötteestä ja jakaa sen kenttiin.\n" +" \n" +" Lukee yksittäisen rivin vakiosyötteestä tai tiedostokahvasta\n" +" FD jos käytetään -u -valitsinta. Rivi jaetaan kenttiin kuten sanatkin, " +"ja \n" +" ensimmäinen sana sijoitetaan ensimmäiseen NIMEEN, toinen TOISEEN, ja " +"niin \n" +" edelleen, ylijäävien sanojen sijoittuessa viimeiseen NIMEEN. Sanojen \n" +" erottimiksi hyväksytään vain $IFS-muuttujassa ilmoitetut.\n" +" \n" +" Jos NIMIÄ ei ole annettu, luettu rivi sijoitetaan REPLY-muuttujaan.\n" +" \n" +" Valitsimet:\n" +" -a taulukko\tsijoita sanat järjestyksessä taulukkoon TAULUKKO, alkaen\n" +" \t\tindeksistä nolla\n" +" -d erotin \tjatka kunnes ensimmäinen EROTTIMEN merkki on luettu, ei\n" +" \t\trivinvaihto\n" +" -e käytä readlinea rivin lukemiseksi " +"interaktiivisessa \n" +" \t\tkomentotulkissa\n" +" -i teksti\tkäytä TEKSTIÄ readlinen oletustekstinä\n" +" -n määrä\t\tpalaa, kun MÄÄRÄ merkkiä on luettu, sen sijaan että \n" +" \t\todotetaan rivinvaihtoa\n" +" -p kehote\ttulosta KEHOTE ilman rivinvaihtoa ennen lukua\n" +" -r\t\tälä salli kenoviivojen käyttöä\n" +" -s \t\tälä näytä päätteeltä näppäiltyjä merkkejä\n" +" -t aikaraja\tkeskeytä ja palauta epäonnistuminen jos kokonaista riviä\n" +" \t\tei saada luettua sekunneissa ilmoitetun AIKARAJAN puitteissa.\n" +" \t\tMuuttujan TMOUT arvo on oletusarvo. AIKARAJA voi olla \n" +" \t\treaaliluku.\n" +"\t\tJos AIKARAJA on 0, read palauttaa onnistumisen vain jos syöte on\n" +"\t\tvalmiina annetussa tiedostokahvassa. Paluuarvo on suurempi \n" +" \t\tkuin 128 jos aikaraja ylittyy\n" +" -u FD\t\tlue tiedostokahvasta FD vakiosyötetiedoston sijaan\n" +" \n" +" Paluuarvo:\n" +" Paluuarvo on nolla, ellei törmätä tiedoston loppumiseen, aikarajan\n" +" ylitykseen tai mikäli -u:lle annetaan virheellinen tiedostokahva." + +#: builtins.c:1028 +msgid "" +"Return from a shell function.\n" +" \n" +" Causes a function or sourced script to exit with the return value\n" +" specified by N. If N is omitted, the return status is that of the\n" +" last command executed within the function or script.\n" +" \n" +" Exit Status:\n" +" Returns N, or failure if the shell is not executing a function or script." +msgstr "" +"Palauttaa komentotulkin funktiosta.\n" +" \n" +" Aiheuttaa funktion tai luetun skriptin poistumisen annetulla " +"paluuarvolla N.\n" +" Jos N:ää ei ole annettu, palautetaan viimeisen funktiossa tai " +"skriptissä\n" +" suoritetun komennon paluuarvo.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa N:n, tai epäonnistuneen mikäli komentotulkki ei ole " +"suorittamassa\n" +" funktiota tai skriptiä." + +#: builtins.c:1041 +#, fuzzy +msgid "" +"Set or unset values of shell options and positional parameters.\n" +" \n" +" Change the value of shell attributes and positional parameters, or\n" +" display the names and values of shell variables.\n" +" \n" +" Options:\n" +" -a Mark variables which are modified or created for export.\n" +" -b Notify of job termination immediately.\n" +" -e Exit immediately if a command exits with a non-zero status.\n" +" -f Disable file name generation (globbing).\n" +" -h Remember the location of commands as they are looked up.\n" +" -k All assignment arguments are placed in the environment for a\n" +" command, not just those that precede the command name.\n" +" -m Job control is enabled.\n" +" -n Read commands but do not execute them.\n" +" -o option-name\n" +" Set the variable corresponding to option-name:\n" +" allexport same as -a\n" +" braceexpand same as -B\n" +" emacs use an emacs-style line editing interface\n" +" errexit same as -e\n" +" errtrace same as -E\n" +" functrace same as -T\n" +" hashall same as -h\n" +" histexpand same as -H\n" +" history enable command history\n" +" ignoreeof the shell will not exit upon reading EOF\n" +" interactive-comments\n" +" allow comments to appear in interactive commands\n" +" keyword same as -k\n" +" monitor same as -m\n" +" noclobber same as -C\n" +" noexec same as -n\n" +" noglob same as -f\n" +" nolog currently accepted but ignored\n" +" notify same as -b\n" +" nounset same as -u\n" +" onecmd same as -t\n" +" physical same as -P\n" +" pipefail the return value of a pipeline is the status of\n" +" the last command to exit with a non-zero status,\n" +" or zero if no command exited with a non-zero " +"status\n" +" posix change the behavior of bash where the default\n" +" operation differs from the Posix standard to\n" +" match the standard\n" +" privileged same as -p\n" +" verbose same as -v\n" +" vi use a vi-style line editing interface\n" +" xtrace same as -x\n" +" -p Turned on whenever the real and effective user ids do not match.\n" +" Disables processing of the $ENV file and importing of shell\n" +" functions. Turning this option off causes the effective uid and\n" +" gid to be set to the real uid and gid.\n" +" -t Exit after reading and executing one command.\n" +" -u Treat unset variables as an error when substituting.\n" +" -v Print shell input lines as they are read.\n" +" -x Print commands and their arguments as they are executed.\n" +" -B the shell will perform brace expansion\n" +" -C If set, disallow existing regular files to be overwritten\n" +" by redirection of output.\n" +" -E If set, the ERR trap is inherited by shell functions.\n" +" -H Enable ! style history substitution. This flag is on\n" +" by default when the shell is interactive.\n" +" -P If set, do not resolve symbolic links when executing commands\n" +" such as cd which change the current directory.\n" +" -T If set, the DEBUG trap is inherited by shell functions.\n" +" -- Assign any remaining arguments to the positional parameters.\n" +" If there are no remaining arguments, the positional parameters\n" +" are unset.\n" +" - Assign any remaining arguments to the positional parameters.\n" +" The -x and -v options are turned off.\n" +" \n" +" Using + rather than - causes these flags to be turned off. The\n" +" flags can also be used upon invocation of the shell. The current\n" +" set of flags may be found in $-. The remaining n ARGs are positional\n" +" parameters and are assigned, in order, to $1, $2, .. $n. If no\n" +" ARGs are given, all shell variables are printed.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given." +msgstr "" +"Asettaa tai poistaa komentotulkin valitsimia ja positionaalisia " +"parametreja.\n" +" \n" +" Muuttaa komentotulkin attribuutteja ja positionaalisia parametreja, tai\n" +" näyttää komentotulkin muuttujien nimet ja arvot.\n" +" \n" +" Valitsimet:\n" +" -a Merkitse luodut tai muutetut parametrit vientiä varten.\n" +" -b Ilmoita työn päättymisestä välittömästi.\n" +" -e Poistu välittömästi jos komento palauttaa nollasta poikkeavan " +"arvon.\n" +" -f Poista tiedostonimen lavennus käytöstä.\n" +" -h muista komentojen sijainti sitä mukaa kun niitä etsitään.\n" +" -k kaikki asetukset sijoitetaan komennon ympäristöön, ei vain ne,\n" +" jotka ovat ennen komennon nimeä.\n" +" -m Työnohjaus on käytössä.\n" +" -n Lue komennot mutta älä suorita niitä.\n" +" -o valitsimen nimi\n" +" Aseta muuttuja valitsimen nimen mukaan:\n" +" allexport\tsama kuin -a\n" +" braceexpand\tsama kuin -B\n" +" emacs\t\tkäytä emacs-tyylistä rivieditointia\n" +" errexit\t\tsama kuin -e\n" +" errtrace\t\tsama kuin -E\n" +" functrace\tsama kuin -T\n" +" hashall\t\tsama kuin -h\n" +" histexpand\tsama kuin -H\n" +" history\t\tota komentohistoria käyttöön\n" +" ignoreeof\tkomentotulkki ei poistu syötteen loppuessa\n" +" interactive-comments\n" +" sallii kommentit interaktiivisissa " +"komennoissa\n" +" keyword\t\tsama kuin -k\n" +" monitor\t\tsama kuin -m\n" +" noclobber\tsama kuin -C\n" +" noexec\t\tsama kuin -n\n" +" noglob\t\tsama kuin -f\n" +" nolog\t\ttällä hetkellä hyväksytty mutta ei huomioida\n" +" notify\t\tsama kuin -b\n" +" nounset\t\tsama kuin -u\n" +" onecmd\t\tsama kuin -t\n" +" physical\t\tsama kuin -P\n" +" pipefail\t\tkomentoputken paluuarvo on viimeisen nollasta\n" +" \t\t\tpoikkeavan komennon paluuarvo, tai nolla jos\n" +" \t\t\tmikään komento ei palauttanut nollasta \n" +" \t\t\tpoikkeavaa\n" +" posix\t\tmuuta bashin toiminta vastaamaan Posixia\n" +" privileged\tsama kuin -p\n" +" verbose\t\tsama kuin -v\n" +" vi\t\tkäytä vi-tyylistä komentorivieditointia\n" +" xtrace\t\tsama kuin -x\n" +" -p Asetetaan jos todellinen ja efektiivinen uid eivät täsmää.\n" +" Poistaa $ENV-tiedoston käsittelyn ja funktioiden tuonnin " +"käytöstä.\n" +" Tämän valitsimen poistaminen aiheuttaa efektiivisen uid:n ja gid:" +"n\n" +" (käyttäjä- ja ryhmätunnus) asettamisen todelliseksi uid:ksi ja \n" +" gid:ksi.\n" +" -t Poistu yhden komennon lukemisen ja suorittamisen jälkeen.\n" +" -u Kohtele asettamattomia muuttujia virheenä korvauksen yhteydessä.\n" +" -v Tulosta komentotulkin syöterivit lukemisen myötä.\n" +" -x Tulosta komennot argumentteineen niitä suoritettaessa.\n" +" -B Komentotulkki suorittaa aaltosulkeitten laajentamisen\n" +" -C Jos asetettu, estää tavallisten tiedostojen päällekirjoittamisen\n" +" uudelleenohjauksella.\n" +" -E Jos asetettu, ERR-kaappaus periytyy funktioihin\n" +" -H Ota !-tyylinen historian korvaus käyttöön. Tämä on " +"oletusarvoisesti\n" +" päällä, mikäli komentotulkki on interaktiivinen.\n" +" -P Jos asetettu, älä seuraa symbolisia linkkejä suoritettaessa\n" +" hakemistoa vaihtavia komentoja, kuten cd.\n" +" -T Jos asetettu, funktiot perivät DEBUG-kaappauksen\n" +" - Sijoita loput argumentit positionaalisiin parametreihin. -x - ja \n" +" -v -optiot poistetaan käytöstä.\n" +" \n" +" Mikäli käytetään ”+”-merkkiä ”-”:n sijaan, optiot otetaan pois päältä.\n" +" Valitsimet voidaan myös asettaa komentotulkin käynnistyksessä.\n" +" Asetetut valitsimet löytyvät muuttujasta $-. Loput N ARGUMENTTIA ovat\n" +" positionaalisia parametreja ja asetetaan järjestyksessä muuttujiin\n" +" $1, $2, .. $N. Jos argumentteja ei ole annettu, tulostetaan kaikki\n" +" ympäristömuuttujat.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistumisen ellei ole annettu virheellistä valitsinta." + +#: builtins.c:1126 +#, fuzzy +msgid "" +"Unset values and attributes of shell variables and functions.\n" +" \n" +" For each NAME, remove the corresponding variable or function.\n" +" \n" +" Options:\n" +" -f\ttreat each NAME as a shell function\n" +" -v\ttreat each NAME as a shell variable\n" +" -n\ttreat each NAME as a name reference and unset the variable itself\n" +" \trather than the variable it references\n" +" \n" +" Without options, unset first tries to unset a variable, and if that " +"fails,\n" +" tries to unset a function.\n" +" \n" +" Some variables cannot be unset; also see `readonly'.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a NAME is read-only." +msgstr "" +"Poista ympäristömuuttujien ja funktioiden arvoja ja attribuutteja.\n" +"\n" +" Poista jokaisen NIMI-niminen muuttuja tai funktio.\n" +"\n" +" Valitsimet:\n" +" -f\tkohtele jokaista NIMEÄ funktiona\n" +" -v\tkohtele jokaista NIMEÄ muuttujana\n" +" \n" +" Ilman valitsimia unset yrittää ensin poistaa muuttujan, ja mikäli se\n" +" epäonnistuu, yrittää poistaa funktion.\n" +" \n" +" Joitain muuttujia ei voi poistaa; katso myös ”readonly”.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen paitsi jos on annettu virheellinen valitsin\n" +" tai NIMI on kirjoitussuojattu." + +#: builtins.c:1148 +msgid "" +"Set export attribute for shell variables.\n" +" \n" +" Marks each NAME for automatic export to the environment of subsequently\n" +" executed commands. If VALUE is supplied, assign VALUE before " +"exporting.\n" +" \n" +" Options:\n" +" -f\trefer to shell functions\n" +" -n\tremove the export property from each NAME\n" +" -p\tdisplay a list of all exported variables and functions\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" +"Aseta ympäristömuuttujien vientiattribuutin.\n" +" \n" +" Merkitse kukin NIMI vietäväksi automaattisesti suoritettujen komentojen\n" +" ympäristöön. Jos ARVO on annettu, se sijoitetaan NIMEEN ennen vientiä.\n" +" \n" +" Valitsimet:\n" +" -f\tviittaa komentotulkin funktioihin\n" +" -n\tpoista jokaiselta NIMELTÄ vientiattribuutti\n" +" -p\tlistaa kaikki viedyt muuttujat ja funktiot\n" +" \n" +" ”--” argumenttina lopettaa valitsimien käsittelyn.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen paitsi jos on annettu virheellinen valitsin\n" +" tai NIMI on virheellinen." + +#: builtins.c:1167 +#, fuzzy +msgid "" +"Mark shell variables as unchangeable.\n" +" \n" +" Mark each NAME as read-only; the values of these NAMEs may not be\n" +" changed by subsequent assignment. If VALUE is supplied, assign VALUE\n" +" before marking as read-only.\n" +" \n" +" Options:\n" +" -a\trefer to indexed array variables\n" +" -A\trefer to associative array variables\n" +" -f\trefer to shell functions\n" +" -p\tdisplay a list of all readonly variables or functions, depending " +"on\n" +" whether or not the -f option is given\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" +"Merkitse ympäristömuuttujat kirjoitussuojatuiksi.\n" +" \n" +" Merkitse kukin NIMI kirjoitussuojatuksi; näiden NIMIEN arvoa ei voi\n" +" muuttaa. Jos ARVO on annettu, sijoita se NIMEEN ennen merkitsemistä\n" +" kirjoitussuojatuksi.\n" +" \n" +" Valitsimet:\n" +" -a\tviittaa indeksoidun taulukon muuttujiin\n" +" -A\tviittaa assosiatiivisen taulukon muuttujiin\n" +" -f\tviittaa funktioihin\n" +" -p\tnäytä lista kirjoitussuojatuista muuttujista ja funktioista\n" +" \n" +" Argumentti ”--” päättää valitsimien käsittelyn.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen paitsi jos on annettu virheellinen valitsin\n" +" tai NIMI on virheellinen." + +#: builtins.c:1189 +msgid "" +"Shift positional parameters.\n" +" \n" +" Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n" +" not given, it is assumed to be 1.\n" +" \n" +" Exit Status:\n" +" Returns success unless N is negative or greater than $#." +msgstr "" +"Siirrä positionaalisia parametreja.\n" +" \n" +" Siirrä positionaalisia parametreja $N+1, $N+2 ... parametreihin $1, " +"$2 ...\n" +" Jos N:ää ei ole annettu, sen oletetaan olevan 1.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen ellei N ole negatiivinen tai suurempi kuin $#." + +#: builtins.c:1201 builtins.c:1216 +msgid "" +"Execute commands from a file in the current shell.\n" +" \n" +" Read and execute commands from FILENAME in the current shell. The\n" +" entries in $PATH are used to find the directory containing FILENAME.\n" +" If any ARGUMENTS are supplied, they become the positional parameters\n" +" when FILENAME is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed in FILENAME; fails if\n" +" FILENAME cannot be read." +msgstr "" +"Suorittaa tiedoston komennot nykyisessä komentotulkissa.\n" +" \n" +" Lue ja suorita komennot TIEDOSTOSTA nykyisessä tulkissa. $PATH:in\n" +" komponentteja käytetään TIEDOSTON sisältävän hakemiston haussa.\n" +" Mahdolliset ARGUMENTIT sijoitetaan positionaalisiksi parametreiksi\n" +" TIEDOSTOA suoritettaessa.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa viimeisen TIEDOSTON suoritetun komennon paluuarvon; " +"epäonnistuu\n" +" mikäli TIEDOSTOA ei voida lukea." + +#: builtins.c:1232 +msgid "" +"Suspend shell execution.\n" +" \n" +" Suspend the execution of this shell until it receives a SIGCONT signal.\n" +" Unless forced, login shells cannot be suspended.\n" +" \n" +" Options:\n" +" -f\tforce the suspend, even if the shell is a login shell\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Keskeyttää komentotulkin suorituksen.\n" +" \n" +" Keskeyttää tämän tulkin suorituksen kunnes se saa SIGCONT-signaalin.\n" +" Sisäänkirjautumistulkkeja ei voi keskeyttää kuin väkisin.\n" +" \n" +" Valitsimet:\n" +" -f\tpakota keskeyttämään, vaikka tulkki olisi sisäänkirjautumis-\n" +" \ttulkki.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen paitsi jos työnohjaus ei ole käytössä tai " +"tapahtuu\n" +" virhe." + +#: builtins.c:1248 +#, fuzzy +msgid "" +"Evaluate conditional expression.\n" +" \n" +" Exits with a status of 0 (true) or 1 (false) depending on\n" +" the evaluation of EXPR. Expressions may be unary or binary. Unary\n" +" expressions are often used to examine the status of a file. There\n" +" are string operators and numeric comparison operators as well.\n" +" \n" +" The behavior of test depends on the number of arguments. Read the\n" +" bash manual page for the complete specification.\n" +" \n" +" File operators:\n" +" \n" +" -a FILE True if file exists.\n" +" -b FILE True if file is block special.\n" +" -c FILE True if file is character special.\n" +" -d FILE True if file is a directory.\n" +" -e FILE True if file exists.\n" +" -f FILE True if file exists and is a regular file.\n" +" -g FILE True if file is set-group-id.\n" +" -h FILE True if file is a symbolic link.\n" +" -L FILE True if file is a symbolic link.\n" +" -k FILE True if file has its `sticky' bit set.\n" +" -p FILE True if file is a named pipe.\n" +" -r FILE True if file is readable by you.\n" +" -s FILE True if file exists and is not empty.\n" +" -S FILE True if file is a socket.\n" +" -t FD True if FD is opened on a terminal.\n" +" -u FILE True if the file is set-user-id.\n" +" -w FILE True if the file is writable by you.\n" +" -x FILE True if the file is executable by you.\n" +" -O FILE True if the file is effectively owned by you.\n" +" -G FILE True if the file is effectively owned by your group.\n" +" -N FILE True if the file has been modified since it was last " +"read.\n" +" \n" +" FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" +" modification date).\n" +" \n" +" FILE1 -ot FILE2 True if file1 is older than file2.\n" +" \n" +" FILE1 -ef FILE2 True if file1 is a hard link to file2.\n" +" \n" +" String operators:\n" +" \n" +" -z STRING True if string is empty.\n" +" \n" +" -n STRING\n" +" STRING True if string is not empty.\n" +" \n" +" STRING1 = STRING2\n" +" True if the strings are equal.\n" +" STRING1 != STRING2\n" +" True if the strings are not equal.\n" +" STRING1 < STRING2\n" +" True if STRING1 sorts before STRING2 " +"lexicographically.\n" +" STRING1 > STRING2\n" +" True if STRING1 sorts after STRING2 lexicographically.\n" +" \n" +" Other operators:\n" +" \n" +" -o OPTION True if the shell option OPTION is enabled.\n" +" -v VAR\t True if the shell variable VAR is set\n" +" -R VAR\t True if the shell variable VAR is set and is a name " +"reference.\n" +" ! EXPR True if expr is false.\n" +" EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n" +" EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n" +" \n" +" arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Arithmetic binary operators return true if ARG1 is equal, not-equal,\n" +" less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n" +" than ARG2.\n" +" \n" +" Exit Status:\n" +" Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n" +" false or an invalid argument is given." +msgstr "" +"Evaluoi ehdollisen lausekkeen.\n" +" \n" +" Poistuu arvolla 0 (tosi) tai 1 (epätosi) riippuen LAUSEKKEEN " +"evaluoinnista.\n" +" Lausekkeen voivat olla unaarisia tai binäärisiä. Unaarisia lausekkeita\n" +" käytetään usein tarkistamaan tiedoston tila. On myös merkkijono-\n" +" operaattoreita, ja operaattoreita numeroiden vertailuun.\n" +" \n" +" Tiedosto-operaattorit:\n" +" \n" +" -a TIEDOSTO Tosi jos tiedosto on olemassa.\n" +" -b TIEDOSTO Tosi jos tiedosto on lohkolaite.\n" +" -c TIEDOSTO Tosi jos tiedosto on merkkilaite.\n" +" -d TIEDOSTO Tosi jos tiedosto on hakemisto.\n" +" -e TIEDOSTO Tosi jos tiedosto on olemassa.\n" +" -f TIEDOSTO Tosi jos tiedosto on olemassa ja on tavallinen " +"tiedosto.\n" +" -g TIEDOSTO Tosi jos tiedostolla on set-group-id -bitti.\n" +" -h TIEDOSTO Tosi jos tiedosto on symbolinen linkki.\n" +" -L TIEDOSTO Tosi jos tiedosto on symbolinen linkki.\n" +" -k TIEDOSTO Tosi jos tiedostolla on sticky-bitti.\n" +" -p TIEDOSTO Tosi jos tiedosto on nimetty putki.\n" +" -r TIEDOSTO Tosi jos sinulla on lukuoikeus tiedostoon.\n" +" -s TIEDOSTO Tosi jos tiedosto on olemassa eikä se ole tyhjä.\n" +" -S TIEDOSTO Tosi jos tiedosto on soketti.\n" +" -t FD Tosi jos FD on avattu päätteeseen.\n" +" -u TIEDOSTO Tosi jos tiedostolla on set-user-id -bitti.\n" +" -w TIEDOSTO Tosi jos sinulla on kirjoitusoikeus tiedostoon.\n" +" -x TIEDOSTO Tosi jos sinulla on tiedoston suoritusoikeus.\n" +" -O TIEDOSTO Tosi jos omistat tiedoston.\n" +" -G TIEDOSTO Tosi jos ryhmäsi omistaa tiedoston.\n" +" -N TIEDOSTO Tosi jos tiedostoa on muokattu viimeisen " +"lukukerran\n" +" jälkeen.\n" +" \n" +" TIEDOSTO1 -nt TIEDOSTO2 Tosi jos TIEDOSTO1 on uudempi kuin TIEDOSTO2\n" +" (muutospäivän perusteella).\n" +" \n" +" TIEDOSTO1 -ot TIEDOSTO2 Tosi jos TIEDOSTO1 on vanhempi kuin " +"TIEDOSTO2.\n" +" \n" +" TIEDOSTO1 -ef TIEDOSTO2 Tosi jos TIEDOSTO1 on kovolinkki TIEDOSTO2:" +"een.\n" +" \n" +" Merkkijono-operaattorit:\n" +" \n" +" -z JONO Tosi jos JONO on tyhjä.\n" +" \n" +" -n JONO\n" +" JONO Tosi jos JONO ei ole tyhjä.\n" +" \n" +" JONO1 = JONO2\n" +" Tosi jos JONOT ovat samat.\n" +" JONO1 != JONO2\n" +" Tosi jos JONOT eivät ole samat.\n" +" JONO1 < JONO2\n" +" Tosi jos JONO1 aakkostuu ennen JONO2:ta.\n" +" JONO1 > JONO2\n" +" Tosi jos JONO1 aakkostuu JONO2:n jälkeen.\n" +" \n" +" Muut operaattorit:\n" +" \n" +" -o VALITSIN Tosi jos tulkin VALITSIN on käytössä.\n" +" ! LAUSEKE Tosi jos LAUSEKE on epätosi.\n" +" LAUSEKE1 -a LAUSEKE2 \n" +" Tosi jos molemmat lausekkeet ovat tosia.\n" +" LAUSEKE1 -o LAUSEKE2 \n" +" Tosi jos jompikumpi lausekkeista on tosi.\n" +" \n" +" ARG1 OP ARG2 Aritmeettiset testit. OP on jokin seuraavista:\n" +" \t \t -eq, -ne, -lt, -le, -gt tai -ge.\n" +" \n" +" Binääriset aritmetiikkaoperaattorit palauttavat toden jos ARG1 on \n" +" yhtäsuuri, erisuuri, pienempi, pienempi tai yhtä suuri, suurempi\n" +" tahi suurempi tai yhtä suuri kuin ARG2.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistumisen jos LAUSEKE evaluoituu todeksi; epäonnistuu jos\n" +" LAUSEKE evaluoituu vääräksi tai on annettu virheellinen argumentti." + +#: builtins.c:1329 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" This is a synonym for the \"test\" builtin, but the last argument must\n" +" be a literal `]', to match the opening `['." +msgstr "" +"Evaluoi ehdollisen lausekkeen.\n" +" \n" +" Tämä on sisäänrakennetun ”test”-komennon synonyymi, mutta viimeisen\n" +" argumentin pitää olla ”]”, joka sulkee avaavan ”[”:n." + +#: builtins.c:1338 +msgid "" +"Display process times.\n" +" \n" +" Prints the accumulated user and system times for the shell and all of " +"its\n" +" child processes.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Näyttää prosessiajat.\n" +" \n" +" Tulostaa kumuloituneet käyttäjä- ja järjestelmäajat sekä " +"komentotulkille\n" +" että kaikille sen lapsiprosesseille.\n" +" \n" +" Paluuarvo:\n" +" Onnistuu aina." + +#: builtins.c:1350 +#, fuzzy +msgid "" +"Trap signals and other events.\n" +" \n" +" Defines and activates handlers to be run when the shell receives " +"signals\n" +" or other conditions.\n" +" \n" +" ARG is a command to be read and executed when the shell receives the\n" +" signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n" +" is supplied) or `-', each specified signal is reset to its original\n" +" value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" +" shell and by the commands it invokes.\n" +" \n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. " +"If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. " +"If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or " +"a\n" +" script run by the . or source builtins finishes executing. A " +"SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause " +"the\n" +" shell to exit when the -e option is enabled.\n" +" \n" +" If no arguments are supplied, trap prints the list of commands " +"associated\n" +" with each signal.\n" +" \n" +" Options:\n" +" -l\tprint a list of signal names and their corresponding numbers\n" +" -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" +" \n" +" Each SIGNAL_SPEC is either a signal name in or a signal " +"number.\n" +" Signal names are case insensitive and the SIG prefix is optional. A\n" +" signal may be sent to the shell with \"kill -signal $$\".\n" +" \n" +" Exit Status:\n" +" Returns success unless a SIGSPEC is invalid or an invalid option is " +"given." +msgstr "" +"Kaappaa signaalit ja muut poikkeamat.\n" +" \n" +" Määrittelee ja aktivoi käsittelijöitä, jotka suoritetaan kun " +"komentotulkki\n" +" saa signaalin tai muissa tilanteissa.\n" +" \n" +" ARGUMENTTI on luettava ja suoritettava komento kun tulkki saa \n" +" SIGNAALIissa määritellyn signaalin/signaalit. Jos ARGUMENTTI puuttuu\n" +" (ja vain yksittäinen SIGNAALI on annettu) tai on ”-”, kukin määrätty\n" +" signaali palautetaan oletusarvoonsa. Jos ARGUMENTTI on tyhjä " +"merkkijono,\n" +" tulkki ja sen käynnistämät komennot jättävät annetut signaalit " +"huomiotta.\n" +" \n" +" Jos SIGNAALI on EXIT (0), ARGUMENTTI suoritetaan tulkin poistuessa.\n" +" Jos SIGNAALI on DEBUG, ARGUMENTTI suoritetaan ennen jokaista " +"yksittäistä\n" +" komentoa.\n" +" \n" +" Jos argumentteja ei ole annettu, trap tulostaa kuhunkin signaaliin " +"liitetyt\n" +" komennot.\n" +" \n" +" Valitsimet:\n" +" -l\ttulostaa listan signaalien nimistä ja vastaavista numeroista\n" +" -p\ttulostaa kuhunkin signaaliin liitetyt kaappauskomennot\n" +" \n" +" Kukin SIGNAALI on joko signaalin nimi -tiedostossa tai " +"numero.\n" +" Signaalien nimet eivät ole aakkoslajillisia ja alkuosa SIG on " +"valinnainen.\n" +" Signaali lähetetään tulkille komennolla ”kill -signal $$”.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneet paitsi jos SIGNAALI on virheellinen tai on " +"annettu\n" +" virheellinen valitsin." + +#: builtins.c:1386 +msgid "" +"Display information about command type.\n" +" \n" +" For each NAME, indicate how it would be interpreted if used as a\n" +" command name.\n" +" \n" +" Options:\n" +" -a\tdisplay all locations containing an executable named NAME;\n" +" \tincludes aliases, builtins, and functions, if and only if\n" +" \tthe `-p' option is not also used\n" +" -f\tsuppress shell function lookup\n" +" -P\tforce a PATH search for each NAME, even if it is an alias,\n" +" \tbuiltin, or function, and returns the name of the disk file\n" +" \tthat would be executed\n" +" -p\treturns either the name of the disk file that would be executed,\n" +" \tor nothing if `type -t NAME' would not return `file'.\n" +" -t\toutput a single word which is one of `alias', `keyword',\n" +" \t`function', `builtin', `file' or `', if NAME is an alias, shell\n" +" \treserved word, shell function, shell builtin, disk file, or not\n" +" \tfound, respectively\n" +" \n" +" Arguments:\n" +" NAME\tCommand name to be interpreted.\n" +" \n" +" Exit Status:\n" +" Returns success if all of the NAMEs are found; fails if any are not " +"found." +msgstr "" +"Näyttää tietoja komentotyypistä.\n" +" \n" +" Näyttää, miten kukin NIMI tulkittaisiin, jos sitä käytettäisiin " +"komentona.\n" +" \n" +" Valitsimet:\n" +" -a\tnäyttää kaikki paikat, jossa on NIMI-niminen ohjelma; sisältää\n" +" \taliakset, sisäänrakennetut komennot ja funktiot, jos ja vain\n" +" \tjos -p -valitsinta ole käytetty\n" +" -f\testää funktiohaun\n" +" -P\tpakottaa hakemaan NIMET hakupolulta, vaikka se olisikin alias,\n" +" \tsisäänrakennettu komento, tai funktio, ja palauttaa \n" +" \tsuoritettavan levytiedoston nimen\n" +" -p\tpalauttaa joko suoritettavan levytiedoston nimen, tai ei mitään\n" +" \tjos ”type -t NIMI” ei palauttaisi ”file”.\n" +" -t\ttulosta sana, joka on ”alias”, ”keyword”, ”function”,\n" +" \t”builtin”, ”file” tai ””, jos NIMI on alias,\n" +" \tavainsana, funktio, sisäänrakennettu komento, levytiedosto tai\n" +" \tsitä ei löytynyt.\n" +" \n" +" Argumentit:\n" +" NIMI\tTulkittavan komennon nimi.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen mikäli kaikki NIMET löytyivät, muussa tapauksessa\n" +" epäonnistuu." + +#: builtins.c:1417 +#, fuzzy +msgid "" +"Modify shell resource limits.\n" +" \n" +" Provides control over the resources available to the shell and " +"processes\n" +" it creates, on systems that allow such control.\n" +" \n" +" Options:\n" +" -S\tuse the `soft' resource limit\n" +" -H\tuse the `hard' resource limit\n" +" -a\tall current limits are reported\n" +" -b\tthe socket buffer size\n" +" -c\tthe maximum size of core files created\n" +" -d\tthe maximum size of a process's data segment\n" +" -e\tthe maximum scheduling priority (`nice')\n" +" -f\tthe maximum size of files written by the shell and its children\n" +" -i\tthe maximum number of pending signals\n" +" -l\tthe maximum size a process may lock into memory\n" +" -m\tthe maximum resident set size\n" +" -n\tthe maximum number of open file descriptors\n" +" -p\tthe pipe buffer size\n" +" -q\tthe maximum number of bytes in POSIX message queues\n" +" -r\tthe maximum real-time scheduling priority\n" +" -s\tthe maximum stack size\n" +" -t\tthe maximum amount of cpu time in seconds\n" +" -u\tthe maximum number of user processes\n" +" -v\tthe size of virtual memory\n" +" -x\tthe maximum number of file locks\n" +" -T the maximum number of threads\n" +" \n" +" Not all options are available on all platforms.\n" +" \n" +" If LIMIT is given, it is the new value of the specified resource; the\n" +" special LIMIT values `soft', `hard', and `unlimited' stand for the\n" +" current soft limit, the current hard limit, and no limit, respectively.\n" +" Otherwise, the current value of the specified resource is printed. If\n" +" no option is given, then -f is assumed.\n" +" \n" +" Values are in 1024-byte increments, except for -t, which is in seconds,\n" +" -p, which is in increments of 512 bytes, and -u, which is an unscaled\n" +" number of processes.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Muuttaa komentotulkin resurssirajoituksia.\n" +" \n" +" Antaa kontrollin tulkin ja sen luomien prosessien resursseille \n" +" järjestelmissä, jossa se on mahdollista.\n" +" \n" +" Valitsimet:\n" +" -S\tkäytä ”pehmeää” resurssirajaa\n" +" -H\tkäytä ”kovaa” resurssirajaa\n" +" -a\traportoi nykyiset rajat\n" +" -b\tsoketin puskurikoko\n" +" -c\tluotujen core-tiedostojen maksimikoko\n" +" -d\tprosessin datasegmentin maksimikoko\n" +" -e\tylin skedulointiprioriteetti (”nice”-arvo)\n" +" -f\tkomentotulkin ja sen lapsiprosessien kirjoittamien tiedostojen\n" +" \tmaksimikoko\n" +" -i\todottavien signaalien maksimimäärä\n" +" -l\tprosessin lukitseman muistin maksimikoko\n" +" -m\tmuistinvaraisen joukon maksimikoko\n" +" -n\tavointen tiedostokahvojen maksimimäärä\n" +" -p\tputken puskurikoko\n" +" -q\tPOSIX-viestijonoissa olevien tavujen maksimi\n" +" -r\tsuurin reaaliaikaskedulointi-prioriteetti\n" +" -s\tpinon maksimikoko\n" +" -t\tenin CPU-aika sekunneissa\n" +" -u\tkäyttäjäprosessien maksimimäärä\n" +" -v\tvirtuaalimuistin koko\n" +" -x\ttiedostolukitusten maksimimäärä\n" +" \n" +" Jos RAJA on annettu, se on määrätyn resurssin uusi arvo; RAJAN " +"erikoisarvot\n" +" ”soft”, ”hard” ja ”unlimited” tarkoittavat nykyistä pehmeää, kovaa ja\n" +" rajatonta. Muussa tapauksessa tulostetaan annetun resurssin arvo. Jos\n" +" valitsimia ei ole annettu, oletetaan -f.\n" +" \n" +" Arvon ovat 1024 tavun monikertoja, paitsi -t:n, joka on sekuntteja,\n" +" -p, jota kasvatetaan 512 tavun osissa, ja -u, joka on prosessien \n" +" skaalaamaton määrä.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen paitsi jos on annettu virheellinen valitsin\n" +" tai tapahtuu virhe." + +#: builtins.c:1465 +msgid "" +"Display or set file mode mask.\n" +" \n" +" Sets the user file-creation mask to MODE. If MODE is omitted, prints\n" +" the current value of the mask.\n" +" \n" +" If MODE begins with a digit, it is interpreted as an octal number;\n" +" otherwise it is a symbolic mode string like that accepted by chmod(1).\n" +" \n" +" Options:\n" +" -p\tif MODE is omitted, output in a form that may be reused as input\n" +" -S\tmakes the output symbolic; otherwise an octal number is output\n" +" \n" +" Exit Status:\n" +" Returns success unless MODE is invalid or an invalid option is given." +msgstr "" +"Näyttää tai asettaa tiedoston tilamaskin.\n" +" \n" +" Asettaa käyttäjän tiedostonluontimaskin TILAKSI. Jos TILAA ei ole \n" +" annettu, tulostaa maskin nykyisen arvon.\n" +" \n" +" Jos TILA alkaa numerolla, se käsitellään oktaalinumerona; muussa\n" +" tapauksessa se on symbolinen tilamerkkijono jonka chmod(1) hyväksyy.\n" +" \n" +" Valitsimet:\n" +" -p\tjos TILAA ei ole annettu, tulostetaan hyödynnettävässä\n" +" \tmuodossa\n" +" -S\ttulostaa symbolisena; muussa tapauksessa tulostetaan\n" +" \toktaaliluku\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen ellei TILA ole virheellinen tai on annettu \n" +" virheellinen valitsin." + +#: builtins.c:1485 +#, fuzzy +msgid "" +"Wait for job completion and return exit status.\n" +" \n" +" Waits for each process identified by an ID, which may be a process ID or " +"a\n" +" job specification, and reports its termination status. If ID is not\n" +" given, waits for all currently active child processes, and the return\n" +" status is zero. If ID is a a job specification, waits for all " +"processes\n" +" in that job's pipeline.\n" +" \n" +" If the -n option is supplied, waits for the next job to terminate and\n" +" returns its exit status.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last ID; fails if ID is invalid or an invalid\n" +" option is given." +msgstr "" +"Odottaa työn valmistumista ja palauttaa paluuarvon.\n" +" \n" +" Odottaa ID:llä tunnistettua prosessia, joka (ID) voi olla " +"prosessitunnus\n" +" tai työtunniste, ja palauttaa sen paluuarvon. Jos ID:tä ei ole annettu,\n" +" odottaa kaikkia tällä hetkellä aktiivisia lapsiprosesseja, ja paluuarvo\n" +" on nolla. Jos ID on työtunniste, odottaa kaikkia prosesseja työn " +"komento-\n" +" putkessa.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa ID:n tilan; epäonnistuu jos ID on virheellinen tai on annettu\n" +" virheellinen valitsin." + +#: builtins.c:1506 +#, fuzzy +msgid "" +"Wait for process completion and return exit status.\n" +" \n" +" Waits for each process specified by a PID and reports its termination " +"status.\n" +" If PID is not given, waits for all currently active child processes,\n" +" and the return status is zero. PID must be a process ID.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last PID; fails if PID is invalid or an " +"invalid\n" +" option is given." +msgstr "" +"Odottaa työn valmistumista ja palauttaa paluuarvon.\n" +" \n" +" Odottaa annettua prosessia ja palauttaa sen paluuarvon. Jos prosessi-\n" +" tunnistetta (PID) ei ole annettu, odottaa kaikkia tällä hetkellä " +"aktiivisia \n" +" lapsiprosesseja, ja paluuarvo on nolla.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa ID:n tilan; epäonnistuu jos ID on virheellinen tai on annettu\n" +" virheellinen valitsin." + +#: builtins.c:1521 +msgid "" +"Execute commands for each member in a list.\n" +" \n" +" The `for' loop executes a sequence of commands for each member in a\n" +" list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is\n" +" assumed. For each element in WORDS, NAME is set to that element, and\n" +" the COMMANDS are executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Suorittaa komennot listan jokaiselle jäsenelle.\n" +" \n" +" ”For”-silmukka suorittaa komentoketjun listan jokaiselle alkiolle. Jos\n" +" ”in SANAT ...;” ei ole annettu, käytetään rakennetta ”in $@”. NIMI " +"asetetaan\n" +" vuorollaan jokaiseksi SANAT-listan alkioksi, ja KOMENNOT suoritetaan.\n" +" \n" +" Paluuarvo:\n" +" Viimeisen suoritetun komennon paluuarvo." + +#: builtins.c:1535 +msgid "" +"Arithmetic for loop.\n" +" \n" +" Equivalent to\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n" +" omitted, it behaves as if it evaluates to 1.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Aritmeettinen for-silmukka.\n" +" \n" +" Vastaa\n" +" \t(( LAUSEKE1))\n" +" \twhile (( LAUSEKE2 )); do\n" +" \t\tKOMENNOT\n" +" \t\t(( LAUSEKE3 ))\n" +" \tdone\n" +"\n" +" LAUSEKE1, LAUSEKE2 ja LAUSEKE3 ovat aritmeettisiä lausekkeita. Jos " +"jokin\n" +" lauseke on jätetty pois, se tulkitaan 1:ksi.\n" +" \n" +" Paluuarvo:\n" +" Viimeisen suoritetun komennon paluuarvo." + +#: builtins.c:1553 +msgid "" +"Select words from a list and execute commands.\n" +" \n" +" The WORDS are expanded, generating a list of words. The\n" +" set of expanded words is printed on the standard error, each\n" +" preceded by a number. If `in WORDS' is not present, `in \"$@\"'\n" +" is assumed. The PS3 prompt is then displayed and a line read\n" +" from the standard input. If the line consists of the number\n" +" corresponding to one of the displayed words, then NAME is set\n" +" to that word. If the line is empty, WORDS and the prompt are\n" +" redisplayed. If EOF is read, the command completes. Any other\n" +" value read causes NAME to be set to null. The line read is saved\n" +" in the variable REPLY. COMMANDS are executed after each selection\n" +" until a break command is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Valitsee sanat listasta ja suorittaa komennot.\n" +" \n" +" SANAT lavennetaan, jolloin saadaan sanalista. Lavennettujen sanojen " +"joukko\n" +" tulostetaan vakiovirhetulosteeseen juoksevasti numeroituna. Jos ”in " +"SANAT”\n" +" puuttuu, käytetään rakennetta ”in $@”. Tämän jälkeen tulostetaan \n" +" PS3-kehote ja vakiosyötteestä luetaan rivi. Mikäli rivi koostuu \n" +" numerosta joka vastaa jotakin tulostetuista sanoista, asetetaan NIMEN \n" +" arvoksi kyseinen sana. Jos rivi on tyhjä, SANAT ja kehote tulostetaan \n" +" uudelleen. Mikäli saadaan EOF (tiedoston loppu), komento päättyy.\n" +" Mikä tahansa muu luettu arvo aiheuttaa NIMEN tyhjäämisen. Luettu rivi \n" +" tallennetaan REPLY-muuttujaan. KOMENNOT suoritetaan kunkin valinnan \n" +" jälkeen kunnes suoritetaan break-komento.\n" +"\n" +" Paluuarvo:\n" +" Viimeisen suoritetun komennon paluuarvo." + +#: builtins.c:1574 +msgid "" +"Report time consumed by pipeline's execution.\n" +" \n" +" Execute PIPELINE and print a summary of the real time, user CPU time,\n" +" and system CPU time spent executing PIPELINE when it terminates.\n" +" \n" +" Options:\n" +" -p\tprint the timing summary in the portable Posix format\n" +" \n" +" The value of the TIMEFORMAT variable is used as the output format.\n" +" \n" +" Exit Status:\n" +" The return status is the return status of PIPELINE." +msgstr "" +"Raportoi komentoketjun suoritusajan.\n" +" \n" +" Suorita KOMENTOKETJU ja tulosta yhteenveto käytetystä ajasta, käyttäjän\n" +" CPU-ajasta ja järjestelmän CPU-ajasta KOMENTOKETJUA suoritettaessa sen\n" +" päätyttyä.\n" +" \n" +" Valitsimet:\n" +" -p\ttulosta ajastusyhteenveto siirrettävässä POSIX-muodossa.\n" +" \n" +" Tulosteen muotoilussa käytetään TIMEFORMAT-muuttujan arvoa.\n" +" \n" +" Paluuarvo:\n" +" KOMENTOKETJUN paluuarvo." + +#: builtins.c:1591 +msgid "" +"Execute commands based on pattern matching.\n" +" \n" +" Selectively execute COMMANDS based upon WORD matching PATTERN. The\n" +" `|' is used to separate multiple patterns.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Suorittaa komentoja tekstihaun perusteella.\n" +" \n" +" Suorittaa valikoiden KOMENTOJA perustuen SANAAN joka sopii " +"MALLINEESEEN.\n" +" ”|”:ea käytetään erottamaan mallineita.\n" +" \n" +" Paluuarvo:\n" +" Viimeisen suoritetun komennon paluuarvo." + +#: builtins.c:1603 +msgid "" +"Execute commands based on conditional.\n" +" \n" +" The `if COMMANDS' list is executed. If its exit status is zero, then " +"the\n" +" `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list " +"is\n" +" executed in turn, and if its exit status is zero, the corresponding\n" +" `then COMMANDS' list is executed and the if command completes. " +"Otherwise,\n" +" the `else COMMANDS' list is executed, if present. The exit status of " +"the\n" +" entire construct is the exit status of the last command executed, or " +"zero\n" +" if no condition tested true.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Suorittaa komentoja ehdollisesti.\n" +" \n" +" ”if KOMENNOT”-lista suoritetaan. Jos sen paluuarvo on nolla, " +"suoritetaan\n" +" ”then KOMENNOT”-lista. Muussa tapauksessa suoritetaan vuorollaan\n" +" kukin ”elif KOMENNOT”-lista, ja jos sen paluuarvo on nolla, suoritetaan\n" +" vastaava ”then KOMENNOT”-lista ja if-komento päätetään. Muutoin\n" +" suoritetaan ”else KOMENNOT”-lista, jos sellainen on. Koko rakenteen\n" +" paluuarvo on viimeisen komennon paluuarvo tai nolla, jos mikään ehto\n" +" ei toteutunut.\n" +"\n" +" Paluuarvo:\n" +" Viimeisen suoritetun komennon paluuarvo." + +#: builtins.c:1620 +msgid "" +"Execute commands as long as a test succeeds.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `while' COMMANDS has an exit status of zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Suorittaa komentoja niin kauan kun testi onnistuu.\n" +" \n" +" Laventaa ja suorittaa KOMENTOJA niin kauan kun viimeinen komento\n" +" ”while KOMENNOT” palauttaa nollan.\n" +" \n" +" Paluuarvo:\n" +" Viimeisen komennon paluuarvo." + +#: builtins.c:1632 +msgid "" +"Execute commands as long as a test does not succeed.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `until' COMMANDS has an exit status which is not zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Suorittaa komentoja niin kauan kun testi epäonnistuu.\n" +" \n" +" Laventaa ja suorittaa KOMENTOJA niin kauna kun viimeinen komento\n" +" ”until KOMENNOT” palauttaa nollasta poikkeavan paluuarvon.\n" +" \n" +" Paluuarvo:\n" +" Viimeisen suoritetun komennon paluuarvo." + +#: builtins.c:1644 +msgid "" +"Create a coprocess named NAME.\n" +" \n" +" Execute COMMAND asynchronously, with the standard output and standard\n" +" input of the command connected via a pipe to file descriptors assigned\n" +" to indices 0 and 1 of an array variable NAME in the executing shell.\n" +" The default NAME is \"COPROC\".\n" +" \n" +" Exit Status:\n" +" Returns the exit status of COMMAND." +msgstr "" +"Luo NIMI-nimisen rinnakkaisprosessin.\n" +" \n" +" Suorittaa KOMENNON asynkronisesti, vakiotuloste ja vakiosyöte\n" +" ohjattuna putken kautta tiedostokahvoihin suorittavan tulkin NIMI-" +"nimisen\n" +" taulukon indekseihin 0 ja 1. Oletus-NIMI on ”COPROC”.\n" +" \n" +" Paluuarvo:\n" +" KOMENNON paluuarvo." + +#: builtins.c:1658 +msgid "" +"Define shell function.\n" +" \n" +" Create a shell function named NAME. When invoked as a simple command,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is " +"invoked,\n" +" the arguments are passed to the function as $1...$n, and the function's\n" +" name is in $FUNCNAME.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is readonly." +msgstr "" +"Luo funktion.\n" +" \n" +" Luo komentotulkin funktion NIMI. Jos NIMI käynnistetään komentona,\n" +" KOMENNOT ajetaan kutsuvan tulkin ympäristössä. Kun NIMI käynnistetään,\n" +" sen argumentit välitetään parametreina $1...$n, ja funktion nimi\n" +" sijoitetaan muuttujaan $FUNCNAME.\n" +" \n" +" Paluuarvo:\n" +" Onnistuu, ellei NIMI ole kirjoitussuojattu." + +#: builtins.c:1672 +msgid "" +"Group commands as a unit.\n" +" \n" +" Run a set of commands in a group. This is one way to redirect an\n" +" entire set of commands.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Ryhmittää komennot.\n" +" \n" +" Suorittaa komennot ryhmässä. Tämä on eräs tapa uudelleenohjata " +"kokonaisen\n" +" komentojoukon tulosteet.\n" +" \n" +" Paluuarvo:\n" +" Viimeisen suoritetun komennon paluuarvo." + +#: builtins.c:1684 +msgid "" +"Resume job in foreground.\n" +" \n" +" Equivalent to the JOB_SPEC argument to the `fg' command. Resume a\n" +" stopped or background job. JOB_SPEC can specify either a job name\n" +" or a job number. Following JOB_SPEC with a `&' places the job in\n" +" the background, as if the job specification had been supplied as an\n" +" argument to `bg'.\n" +" \n" +" Exit Status:\n" +" Returns the status of the resumed job." +msgstr "" +"Siirtää komennon edustalle.\n" +" \n" +" Sama kuin ”fg”-komennon TYÖNKUVAAJA-argumentti. Jatkaa joko " +"keskeytettyä\n" +" tai taustatyötä. TYÖNKUVAAJA voi määritellä joko työn nimen tai " +"numeron.\n" +" Jos TYÖNKUVAAJAA seuraa ”&” siirretään työ taustalle, kuten jos " +"työnkuvaaja\n" +" olisi annettu ”bg”-komennon argumentiksi.\n" +" \n" +" Paluuarvo:\n" +" Työn tila." + +#: builtins.c:1699 +msgid "" +"Evaluate arithmetic expression.\n" +" \n" +" The EXPRESSION is evaluated according to the rules for arithmetic\n" +" evaluation. Equivalent to \"let EXPRESSION\".\n" +" \n" +" Exit Status:\n" +" Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise." +msgstr "" +"Evaluoi artimeettinen lauseke.\n" +" \n" +" LAUSEKKEEN arvo evaluoidaan laskentasääntöjen mukaisesti. Sama kuin\n" +" ”let LAUSEKE”.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa 1, jos LAUSEKKEEN arvo on 0; muuten palauttaa 0." + +#: builtins.c:1711 +msgid "" +"Execute conditional command.\n" +" \n" +" Returns a status of 0 or 1 depending on the evaluation of the " +"conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries " +"used\n" +" by the `test' builtin, and may be combined using the following " +"operators:\n" +" \n" +" ( EXPRESSION )\tReturns the value of EXPRESSION\n" +" ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" +" EXPR1 && EXPR2\tTrue if both EXPR1 and EXPR2 are true; else false\n" +" EXPR1 || EXPR2\tTrue if either EXPR1 or EXPR2 is true; else false\n" +" \n" +" When the `==' and `!=' operators are used, the string to the right of\n" +" the operator is used as a pattern and pattern matching is performed.\n" +" When the `=~' operator is used, the string to the right of the operator\n" +" is matched as a regular expression.\n" +" \n" +" The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n" +" determine the expression's value.\n" +" \n" +" Exit Status:\n" +" 0 or 1 depending on value of EXPRESSION." +msgstr "" +"Suorittaa ehdollisen komennon.\n" +" \n" +" Palauttaa 0 tai 1 riippuen ehdollisen LAUSEKKEEN tuloksesta. " +"Lausekkeissa\n" +" käytetään samoja primäärejä kuin sisäänrakennetussa ”test”-komennossa,\n" +" ja voidaan yhdistellä seuraavilla operaattoreilla:\n" +" \n" +" ( LAUSEKE )\tPalauttaa LAUSEKKEEN arvon\n" +" ! LAUSEKE\t\tTosi jos LAUSEKE on epätosi; muuten epätosi\n" +" LAUSEKE1 && LAUSEKE2\tTosi jos molemmat lausekkeet ovat tosia, muuten\n" +" \t\tepätosi\n" +" LAUSEKE1 || LAUSEKE2\tTosi jos jompikumpi lausekkeista on tosi,\n" +" \t\t\tmuuten epätosi\n" +" \n" +" Käytettäessä ”==”- ja ”!=”-operaattoreita oikeanpuoleista merkkijonoa \n" +" käytetään mallineena ja suoritetaan haku sen perusteella. Operaattoria\n" +" ”=~” käytettäessä oikeanpuoleinen merkkijonoa käsitellään kuten " +"säännöllistä\n" +" lauseketta.\n" +"\n" +" Operaattorit ”&&” ja ”||” eivät evaluoi LAUSEKETTA2 jos LAUSEKE1 " +"riittää\n" +" lausekkeen arvon päättelyyn.\n" +" \n" +" Paluuarvo:\n" +" 0 tai 1 riippuen LAUSEKKEEN arvosta." + +#: builtins.c:1737 +msgid "" +"Common shell variable names and usage.\n" +" \n" +" BASH_VERSION\tVersion information for this Bash.\n" +" CDPATH\tA colon-separated list of directories to search\n" +" \t\tfor directories given as arguments to `cd'.\n" +" GLOBIGNORE\tA colon-separated list of patterns describing filenames to\n" +" \t\tbe ignored by pathname expansion.\n" +" HISTFILE\tThe name of the file where your command history is stored.\n" +" HISTFILESIZE\tThe maximum number of lines this file can contain.\n" +" HISTSIZE\tThe maximum number of history lines that a running\n" +" \t\tshell can access.\n" +" HOME\tThe complete pathname to your login directory.\n" +" HOSTNAME\tThe name of the current host.\n" +" HOSTTYPE\tThe type of CPU this version of Bash is running under.\n" +" IGNOREEOF\tControls the action of the shell on receipt of an EOF\n" +" \t\tcharacter as the sole input. If set, then the value\n" +" \t\tof it is the number of EOF characters that can be seen\n" +" \t\tin a row on an empty line before the shell will exit\n" +" \t\t(default 10). When unset, EOF signifies the end of input.\n" +" MACHTYPE\tA string describing the current system Bash is running on.\n" +" MAILCHECK\tHow often, in seconds, Bash checks for new mail.\n" +" MAILPATH\tA colon-separated list of filenames which Bash checks\n" +" \t\tfor new mail.\n" +" OSTYPE\tThe version of Unix this version of Bash is running on.\n" +" PATH\tA colon-separated list of directories to search when\n" +" \t\tlooking for commands.\n" +" PROMPT_COMMAND\tA command to be executed before the printing of each\n" +" \t\tprimary prompt.\n" +" PS1\t\tThe primary prompt string.\n" +" PS2\t\tThe secondary prompt string.\n" +" PWD\t\tThe full pathname of the current directory.\n" +" SHELLOPTS\tA colon-separated list of enabled shell options.\n" +" TERM\tThe name of the current terminal type.\n" +" TIMEFORMAT\tThe output format for timing statistics displayed by the\n" +" \t\t`time' reserved word.\n" +" auto_resume\tNon-null means a command word appearing on a line by\n" +" \t\titself is first looked for in the list of currently\n" +" \t\tstopped jobs. If found there, that job is foregrounded.\n" +" \t\tA value of `exact' means that the command word must\n" +" \t\texactly match a command in the list of stopped jobs. A\n" +" \t\tvalue of `substring' means that the command word must\n" +" \t\tmatch a substring of the job. Any other value means that\n" +" \t\tthe command must be a prefix of a stopped job.\n" +" histchars\tCharacters controlling history expansion and quick\n" +" \t\tsubstitution. The first character is the history\n" +" \t\tsubstitution character, usually `!'. The second is\n" +" \t\tthe `quick substitution' character, usually `^'. The\n" +" \t\tthird is the `history comment' character, usually `#'.\n" +" HISTIGNORE\tA colon-separated list of patterns used to decide which\n" +" \t\tcommands should be saved on the history list.\n" +msgstr "" +"Yleisiä komentotulkin muuttujia ja niiden käyttö.\n" +" \n" +" BASH_VERSION\tTämän Bashin versiotiedot.\n" +" CDPATH\tKaksoispistein eroteltu lista hakemistoista, joista etsitään\n" +" \t\t”cd”-komennolle argumentiksi annettua hakemistoa.\n" +" GLOBIGNORE\tKaksoispistein eroteltu lista mallineista, joihin sopivat\n" +" \t\ttiedostonimet jätetään huomiotta polun laventamisessa.\n" +" HISTFILE\tTiedosto, johon komentohistoriasi tallennetaan.\n" +" HISTFILESIZE\tMaksimi rivimäärä tähän tiedostoon tallennetaan.\n" +" HISTSIZE\tTulkin käytettävissä olevien historiarivien maksimimäärä\n" +" HOME\tTäydellinen polku sisäänkirjautumishakemistoosi.\n" +" HOSTNAME\tNykyisen palvelimen nimi.\n" +" HOSTTYPE\tCPU-tyyppi, jonka alaisuudessa tämä Bash-versio on ajossa.\n" +" IGNOREEOF\tKontrolloi, miten tulkki toimii saadessaan syötteenä pelkän\n" +" \t\tEOF:n (tiedoston loppu). Jos asetettu, sen määrittelemä\n" +" \t\tlukumäärä EOF:iä voidaan lukea syötteenä peräkkäin ennenkuin\n" +" \t\ttulkki poistuu (oletuksena 10). Jos ei ole asetettu, EOF\n" +" \t\tmerkitsee syötteen loppua.\n" +" MACHTYPE\tJärjestelmää kuvaava merkkijono.\n" +" MAILCHECK\tMiten monen sekunnein välein Bash tarkistaa uudet postit.\n" +" MAILPATH\tKaksoispistein eroteltu lista tiedostoista joista Bash\n" +" \t\ttarkistaa uudet postit.\n" +" OSTYPE\tJärjestelmän Unix-versio.\n" +" PATH\tKaksoispistein eroteltu lista hakemistoista, joista etsitään\n" +" \t\tkomentoja.\n" +" PROMPT_COMMAND\tEnnen primäärin kehotteen tulostamista suoritettava\n" +" \t\tkomento.\n" +" PS1\t\tPrimääri komentokehote.\n" +" PS2\t\tSekundääri kehote.\n" +" PWD\t\tNykyisen hakemiston täydellinen polkunimi.\n" +" SHELLOPTS\tKaksoispistein eroteltu lista käytössä olevista tulkin\n" +" \t\tvalitsimista.\n" +" TERM\tKäytettävän päätetyypin nimi.\n" +" TIMEFORMAT\t”time”-käskyn tulosteen muotoilumalline.\n" +" auto_resume\tJos ei tyhjä, ensimmäistä rivillä olevaa komentosanaa " +"etsitään\n" +" \t\tkeskeytettyjen töiden listasta. Jos sana löydetään, kyseinen\n" +" \t\ttyö tuodaan esiin. ”exact”-arvo tarkoittaa, että komentosanan\n" +" \t\tpitää olla täysin sama kuin keskeytettyjen listalta löytyvä.\n" +" \t\tArvo ”substring” tarkoittaa että komentosanan pitää olla\n" +" \t\tosa työnimeä. Mikä tahansa muu tarkoittaa että komennon pitää\n" +" \t\tolla keskeytetyn työn nimen alkuosa.\n" +" histchars\tMerkit, jotka ohjaavat historialistasta hakua ja " +"pikakorvausta.\n" +" \t\tEnsimmäinen merkki on historiakorvausmerkki, tavallisesti ”!”.\n" +" \t\tToinen, pikakorvausmerkki, on yleensä ”^”. Kolmas merkki,\n" +" \t\ttavallisesti ”#”, on historiakommentti.\n" +" HISTIGNORE\tKaksoispistein eroteltu lista mallineista, joita käytetään\n" +" \t\tpäätettäessä komentojen tallentamisesta historialistaan.\n" + +#: builtins.c:1794 +msgid "" +"Add directories to stack.\n" +" \n" +" Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" +"Lisää hakemistoja pinoon.\n" +" \n" +" Lisää hakemiston hakemistopinon päällimmäiseksi, tai kierrättää pinoa,\n" +" jolloin nykyhakemisto siirretään pinon päällimmäiseksi. Ilman " +"argumentteja\n" +" vaihtaa pinon kaksi päällimmäistä keskenään.\n" +" \n" +" Valitsimet:\n" +" -n\tJättää normaalin hakemiston vaihdon tekemättä lisättäessä\n" +" \t\thakemistoja pinoon, joten ainoastaan pinoa muokataan.\n" +" \n" +" Argumentit:\n" +" +N\tKierrättää pinoa niin, että N:s hakemisto (laskien vasemmalta\n" +" \t\t”dirs”-komennon tuottamasta listasta, alkaen nollasta) on\n" +" \t\tpinon päällimmäisenä.\n" +" -N\tKierrättää pinoa niin, että N:s hakemisto (laskien oikealta\n" +" \t\t”dirs”-komennon tuottamasta listasta, alkaen nollasta) on\n" +" \t\tpinon päällimmäisenä.\n" +" HAKEM\tLisää HAKEMIN hakemistopinon päällimmäiseksi ja tekee \n" +" \t\tsiitä työhakemiston.\n" +" \n" +" Sisäänrakennettu ”dirs” näyttää hakemistopinon.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen, paitsi jos on annettu virheellinen argumentti " +"tai\n" +" hakemiston vaihtaminen epäonnistuu." + +#: builtins.c:1828 +msgid "" +"Remove directories from stack.\n" +" \n" +" Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" +"Poistaa hakemistoja pinosta.\n" +" \n" +" Poistaa alkioita hakemistopinosta. Ilman argumentteja poistaa\n" +" pinon päällimmäisen, ja siirtyy uuteen ylimpään hakemistoon.\n" +" \n" +" Valitsimet:\n" +" -n\tJättää normaalin hakemistoon siirtymisen suorittamatta,\n" +" \t\tjoten vain pinoa muokataan.\n" +" +N\tPoistaa N:nnen alkion (laskien vasemmalta ”dirs”-komennon\n" +" \t\ttuottamasta listasta, alkaen nollasta). Esimerkiksi ”popd +0”\n" +" \t\tpoistaa ensimmäisen hakemiston, ”popd +1” toisen.\n" +" -N\tPoistaa N:nnen alkion (laskien oikealta ”dirs”-komennon\n" +" \ttuottamasta listasta, alkaen nollasta). Esimerkiksi ”popd -0”\n" +" \tpoistaa viimeisen hakemiston, ”popd -1” toiseksi viimeisen.\n" +"\n" +" Sisäänrakennettu ”dirs”-komento listaa hakemistopinon.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen paitsi jos on annettu virheellinen argumentti tai\n" +" hakemiston vaihto epäonnistuu." + +#: builtins.c:1858 +msgid "" +"Display directory stack.\n" +" \n" +" Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Näyttää hakemistopinon.\n" +" \n" +" Näyttää listan tällä hetkellä muistetuista hakemistoista. Hakemistot\n" +" päätyvät listalle ”pushd”-komennolla; voit selata pinoa ”popd”-\n" +" komennolla.\n" +" \n" +" Valitsimet:\n" +" -c\tTyhjennä hakemistopino poistamalla kaikki alkiot\n" +" -l\tälä tulosta tilde-alkuisia versioita kotihakemistoon \n" +" \tsuhteutetuista hakemistoista\n" +" -p\ttulosta hakemistopuu hakemisto per rivi\n" +" -v\ttulosta hakemistopuu, hakemisto per rivi, numeroituina \n" +" \tpinoindeksin mukaan\n" +" \n" +" Argumentit:\n" +" +N\tNäyttää N:nnen alkion (”dirs”-komennon tuottamasta listasta\n" +" \tvasemmalta laskien) alkaen nollasta käynnistettäessä ilman\n" +" \toptioita.\n" +" -N\tNäyttää N:nnen alkion (”dirs”-komennon tuottamasta listasta\n" +" \toikealta laskien) alkaen nollasta käynnistettäessä ilman\n" +" \toptioita.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen paitsi jos on annettu virheellinen valitsin\n" +" tai tapahtuu virhe." + +#: builtins.c:1887 +msgid "" +"Set and unset shell options.\n" +" \n" +" Change the setting of each shell option OPTNAME. Without any option\n" +" arguments, list all shell options with an indication of whether or not " +"each\n" +" is set.\n" +" \n" +" Options:\n" +" -o\trestrict OPTNAMEs to those defined for use with `set -o'\n" +" -p\tprint each shell option with an indication of its status\n" +" -q\tsuppress output\n" +" -s\tenable (set) each OPTNAME\n" +" -u\tdisable (unset) each OPTNAME\n" +" \n" +" Exit Status:\n" +" Returns success if OPTNAME is enabled; fails if an invalid option is\n" +" given or OPTNAME is disabled." +msgstr "" +"Asettaa ja poistaa komentotulkin valitsimia.\n" +" \n" +" Muuttaa kunkin tulkin VALITSIMEN asetuksen. Ilman argumentteja\n" +" listaa kaikki tulkin valitsimet ja tiedon, onko valitsin voimassa \n" +" vai ei.\n" +" \n" +" Valitsimet:\n" +" -o\trajaa VALITSIMET niihin, jotka on määritelty käytettäväksi\n" +" \t”set -o”:lla\n" +" -p\ttulosta kukin tulkin valitsin ja sen tila\n" +" -q\tälä tulosta\n" +" -s\taseta kukin VALITSIN\n" +" -u\tpoista kukin VALITSIN\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen, mikäli VALITSIN on käytössä, epäonnistuu jos on\n" +" annettu virheellinen VALITSIN tai VALITSIN ei ole käytössä." + +#: builtins.c:1908 +#, fuzzy +msgid "" +"Formats and prints ARGUMENTS under control of the FORMAT.\n" +" \n" +" Options:\n" +" -v var\tassign the output to shell variable VAR rather than\n" +" \t\tdisplay it on the standard output\n" +" \n" +" FORMAT is a character string which contains three types of objects: " +"plain\n" +" characters, which are simply copied to standard output; character " +"escape\n" +" sequences, which are converted and copied to the standard output; and\n" +" format specifications, each of which causes printing of the next " +"successive\n" +" argument.\n" +" \n" +" In addition to the standard format specifications described in " +"printf(1),\n" +" printf interprets:\n" +" \n" +" %b\texpand backslash escape sequences in the corresponding argument\n" +" %q\tquote the argument in a way that can be reused as shell input\n" +" %(fmt)T output the date-time string resulting from using FMT as a " +"format\n" +" string for strftime(3)\n" +" \n" +" The format is re-used as necessary to consume all of the arguments. If\n" +" there are fewer arguments than the format requires, extra format\n" +" specifications behave as if a zero value or null string, as " +"appropriate,\n" +" had been supplied.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a write or " +"assignment\n" +" error occurs." +msgstr "" +"Muotoilee ja tulostaa ARGUMENTIT MUOTOILULLA muotoiltuna.\n" +" \n" +" Valitsimet:\n" +" -v muuttuja\tsijoita tuloste muuttujaan MUUTTUJA, älä tulosta\n" +" \n" +" MUOTOILU on merkkijono, joka koostuu kolmentyyppisistä alkioista:\n" +" tavallisista merkeistä, jotka vain kopioidaan vakiotulosteeseen;\n" +" escape-yhdistelmistä, jotka muunnetaan ja kopioidaan vakiotulosteeseen; " +"ja\n" +" muotoilumäärityksistä, joista jokainen aiheuttaa seuraavan vuorossa\n" +" olevan argumentin tulostamisen.\n" +"\n" +" Printf(1):n ja printf(3):n vakiomuotoilujen lisäksi printf tulkitsee:\n" +" %b\tlavenna escape-yhdistelmät vastaavassa argumentissa\n" +" %q\tkapseloi argumentti siten, että se voidaan käyttää tulkin\n" +" \tsyötteenä\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen paitsi jos on annettu virheellinen valitsin tai\n" +" tapahtuu kirjoitus- tai sijoitusvirhe." + +#: builtins.c:1942 +#, fuzzy +msgid "" +"Specify how arguments are to be completed by Readline.\n" +" \n" +" For each NAME, specify how arguments are to be completed. If no " +"options\n" +" are supplied, existing completion specifications are printed in a way " +"that\n" +" allows them to be reused as input.\n" +" \n" +" Options:\n" +" -p\tprint existing completion specifications in a reusable format\n" +" -r\tremove a completion specification for each NAME, or, if no\n" +" \tNAMEs are supplied, all completion specifications\n" +" -D\tapply the completions and actions as the default for commands\n" +" \twithout any specific completion defined\n" +" -E\tapply the completions and actions to \"empty\" commands --\n" +" \tcompletion attempted on a blank line\n" +" \n" +" When completion is attempted, the actions are applied in the order the\n" +" uppercase-letter options are listed above. The -D option takes\n" +" precedence over -E.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Määrittelee miten readline täydentää argumentit.\n" +" \n" +" Määrittelee, miten kukin NIMI täydennetään. Ilman valitsimia " +"tulostetaan\n" +" nykyiset täydennysmääritykset siten, että niitä voidaan käyttää \n" +" syötteenä.\n" +" \n" +" Valitsimet:\n" +" -p\ttulostaa olemassa olevat täydennysmääritykset \n" +" hyödynnettävässä muodossa\n" +" -r\tpoista täydennysmääritys kultakin NIMELTÄ, tai, jos NIMIÄ ei\n" +" \tole annettu, kaikki täydennysmääritykset\n" +" \n" +" Täydennystä yritettäessä toimenpiteen suoritetaan samassa " +"järjestyksessä\n" +" missä isoilla kirjoitetut valitsimet on edellä listattu.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen paitsi jos on annettu virheellinen valitsin tai \n" +" tapahtuu virhe." + +#: builtins.c:1970 +msgid "" +"Display possible completions depending on the options.\n" +" \n" +" Intended to be used from within a shell function generating possible\n" +" completions. If the optional WORD argument is supplied, matches " +"against\n" +" WORD are generated.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Näyttää mahdolliset täydenteet valitsimista riippuen.\n" +" \n" +" Tarkoitettu käytettäväksi komentotulkin funktiossa, joka luo " +"mahdollisia\n" +" täydenteitä. Jos valinnainen argumentti SANA on annettu, luodaan siihen\n" +" sopivat täydenteet.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen paitsi jos on annettu virheellinen valitsin tai\n" +" tapahtuu virhe." + +#: builtins.c:1985 +#, fuzzy +msgid "" +"Modify or display completion options.\n" +" \n" +" Modify the completion options for each NAME, or, if no NAMEs are " +"supplied,\n" +" the completion currently being executed. If no OPTIONs are given, " +"print\n" +" the completion options for each NAME or the current completion " +"specification.\n" +" \n" +" Options:\n" +" \t-o option\tSet completion option OPTION for each NAME\n" +" \t-D\t\tChange options for the \"default\" command completion\n" +" \t-E\t\tChange options for the \"empty\" command completion\n" +" \n" +" Using `+o' instead of `-o' turns off the specified option.\n" +" \n" +" Arguments:\n" +" \n" +" Each NAME refers to a command for which a completion specification must\n" +" have previously been defined using the `complete' builtin. If no NAMEs\n" +" are supplied, compopt must be called by a function currently generating\n" +" completions, and the options for that currently-executing completion\n" +" generator are modified.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or NAME does not\n" +" have a completion specification defined." +msgstr "" +"Muuttaa tai näyttää täydennysvalitsimet.\n" +" \n" +" Muuttaa kunkin NIMEN, tai jos NIMIÄ ei ole annettu, tämänhetkisen\n" +" täydennyksen täydennysvalitsimia. Jos VALITSIMIA ei ole annettu, \n" +" tulostaa kunkin NIMEN tai tämänhetkisen täydennyksen \n" +" täydennysvalitsimet.\n" +" \n" +" Valitsimet:\n" +" \t-o valitsin\taseta täydennysvalitsin VALITSIN kullekin NIMELLE\n" +" \n" +" Käyttämällä ”+o”:ta ”-o”:n sijaan kyseinen valitsin poistetaan.\n" +" \n" +" Argumentit:\n" +" \n" +" Kukin NIMI viittaa komentoon jolle täydennysmääritys on ollut pakko\n" +" määritellä aiemmin käyttämällä sisäänrakennettua komentoa ”complete”.\n" +" Jos NIMIÄ ei ole annettu, compoptia pitää kutsua tällä hetkellä\n" +" täydennyksiä tuottavasta funktiosta, ja sen valitsimia muutetaan.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen paitsi jos on annettu virheellinen valitsin tai\n" +" NIMELLE ei ole määritetty täydennysmääritystä." + +#: builtins.c:2015 +#, fuzzy +msgid "" +"Read lines from the standard input into an indexed array variable.\n" +" \n" +" Read lines from the standard input into the indexed array variable " +"ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable " +"MAPFILE\n" +" is the default ARRAY.\n" +" \n" +" Options:\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are " +"copied.\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default " +"index is 0.\n" +" -s count \tDiscard the first COUNT lines read.\n" +" -t\t\tRemove a trailing newline from each line read.\n" +" -u fd\t\tRead lines from file descriptor FD instead of the standard " +"input.\n" +" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read.\n" +" -c quantum\tSpecify the number of lines read between each call to " +"CALLBACK.\n" +" \n" +" Arguments:\n" +" ARRAY\t\tArray variable name to use for file data.\n" +" \n" +" If -C is supplied without -c, the default quantum is 5000. When\n" +" CALLBACK is evaluated, it is supplied the index of the next array\n" +" element to be assigned and the line to be assigned to that element\n" +" as additional arguments.\n" +" \n" +" If not supplied with an explicit origin, mapfile will clear ARRAY " +"before\n" +" assigning to it.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or ARRAY is readonly " +"or\n" +" not an indexed array." +msgstr "" +"Lukee rivejä vakiosyötteestä taulukkomuuttujaan.\n" +" \n" +" Lukee rivejä vakiosyötteestä taulukkomuuttujaan TAULUKKO, tai \n" +" tiedostokahvasta TK jos käytetään -u -valitsinta. Muuttuja MAPFILE\n" +" on oletus-TAULUKKO.\n" +" \n" +" Valitsimet:\n" +" -n laskuri\tKopioi korkeintaan LASKURI riviä. Jos LASKURI on 0,\n" +" \t\tkaikki rivit kopioidaan.\n" +" -O alku\t\tAloita sijoitus indeksistä ALKU. Oletusindeksi on 0.\n" +" -s laskuri\tHylkää LASKURI ensimmäistä luettua riviä.\n" +" -t\t\tPoista rivinloppumerkki jokaisesta luetusta rivistä.\n" +" -u TK\t\tLue rivit tiedostokahvasta TK.\n" +" -C paluukutsu\tSuorita PALUUKUTSU aina, kun MÄÄRÄ riviä on luettu.\n" +" -c määrä\t\tMäärittele, montako riviä luetaan ennen kutakin \n" +" \t\tPALUUKUTSUA.\n" +" \n" +" Argumentit:\n" +" TAULUKKO\t\tTaulukkomuuttuja, johon tiedot luetaan.\n" +"\n" +" Jos -C on annettu ilman -c:tä, oletusmäärä on 5000. Kun PALUUKUTSUA\n" +" evaluoidaan, sille annetaan indeksi seuraavaan sijoituspaikkaan\n" +" ylimääräisenä argumenttina.\n" +" \n" +" Jos ALKUA ei ole annettu, mapfile tyhjentää TAULUKON ennen siihen\n" +" sijoittamista.\n" +" \n" +" Paluuarvo:\n" +" Palauttaa onnistuneen paitsi jos on annettu virheellinen valitsin\n" +" tai TAULUKKO on kirjoitussuojattu." + +# Changed " characters into ”... +#: builtins.c:2049 +msgid "" +"Read lines from a file into an array variable.\n" +" \n" +" A synonym for `mapfile'." +msgstr "" +"Lukee rivit tiedostosta taulukkomuuttujaan.\n" +" \n" +" ”mapfile”:n synonyymi." + +#, fuzzy +#~ msgid "Copyright (C) 2009 Free Software Foundation, Inc.\n" +#~ msgstr "Copyright © 2009 Free Software Foundation, Inc." + +#, fuzzy +#~ msgid "" +#~ "License GPLv2+: GNU GPL version 2 or later \n" +#~ msgstr "" +#~ "Lisenssi GPLv3+: GNU GPL versio 3 tai uudempi \n" + +#~ msgid "wait [pid]" +#~ msgstr "wait [pid]" + +#~ msgid "xrealloc: cannot reallocate %lu bytes (%lu bytes allocated)" +#~ msgstr "xrealloc: ei voida uudelleenvarata %lu tavua (varattiin %lu tavua)" + +#~ msgid "xrealloc: cannot allocate %lu bytes" +#~ msgstr "xrealloc: ei voida varata %lu tavua" + +#~ msgid "xrealloc: %s:%d: cannot reallocate %lu bytes (%lu bytes allocated)" +#~ msgstr "" +#~ "xrealloc: %s:%d: ei voida uudelleenvarata %lu tavua (varattiin %lu tavua)" diff --git a/po/fr.gmo b/po/fr.gmo new file mode 100644 index 0000000000000000000000000000000000000000..95c30ea07cd68d73b020f4aca8230db2030850c3 GIT binary patch literal 126213 zcmeFa34C2wb?<)!AwgycLzoMkICf+c%R@qd$Z-b*@i#ud!P45 z$?@-=bN0CQ+H0-7_HaIbr_=r@;qQ!FB+2i96L(0GxAFUFsh%duW6w*H`+<)G?*zUE zTm`-ZTmgO=ygm3`@O1DO;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+BC+_ZVL0Ztj3> zh|C!nGyCz{#{DM~(pvhJvv3lQ1ZNaa*g4l9*s<7Ra;n!32nEv)M86_`C3F1vX7~FE zLW!kX@^Ur+@SySZLW*H%HgxTJ>)nuXeQnE8oincnQ-gT;?@7>WyT?a|8h_`;KFecS zBgJhiyFG<7&+n2w6F8o)KmNPRq)8J3T+z)^UY{qi5Tyj1)H}k1Imw0!52n zeYq_w=kW*FAP_i&wBlW)YF|Yy*eiLAp|0&vIk$c5_QqAQhfaIU=rqzg&2s!=?ZxZg zzL-xahnsIZ4}NfTf|VJ@BZUW2JaLUz0=Y6wmC21v6CfvKupEK;^vSAV4Gxc(=jnX^ z`EOnvoxD8%>g&&MetBP-yvjn{&~(K*`6)D4Mh9pak@s{PmgT`f-T8ZG9T3Id~?s_r=cHZ?q7}Vw8Rw z#Jww-r37GkyCNAvaH%V5?M`2|q8diA%dH|CvH(8j!z%WlbOPn<6*}~5qTx*^dNPrzA?j9KAj`S*(b>f8 zgN`Ty*kzm{}l)?*6-8Jh9% zg<2ccj&Toc6}pZy5TZht6|YL5PTCN|o5hf`!D3Ag>x+@~b(_$GO2ivb-W=m8PC03@(?1Twsizu>^uAm8|8|!E6)pfXyVk zj>CFG`7wDC@<6(oX?VKwD3ia@)owQAq?wV=)UPVdMdEwpX1j)j*(=&{&2MhY*RL?( z_!=CgY8HoV?D`n`jG<5fjWv4EQCahstyPQAJ>mn6J`gWb2ePGgKg` zzdk=ch&D~`)f8HC{, 2004 +# Christophe Combelles , 2008, 2009, 2010, 2011 +# +msgid "" +msgstr "" +"Project-Id-Version: bash-4.2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-02-11 11:19-0500\n" +"PO-Revision-Date: 2012-07-07 21:52+0100\n" +"Last-Translator: Christophe Combelles \n" +"Language-Team: French \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: arrayfunc.c:51 +msgid "bad array subscript" +msgstr "mauvais indice de tableau" + +#: arrayfunc.c:356 builtins/declare.def:566 +#, c-format +msgid "%s: cannot convert indexed to associative array" +msgstr "%s : impossible de convertir un tableau indexé en associatif" + +#: arrayfunc.c:539 +#, c-format +msgid "%s: invalid associative array key" +msgstr "%s : clé non valable pour le tableau associatif" + +#: arrayfunc.c:541 +#, c-format +msgid "%s: cannot assign to non-numeric index" +msgstr "%s : impossible d'assigner à un index non numérique" + +#: arrayfunc.c:586 +#, c-format +msgid "%s: %s: must use subscript when assigning associative array" +msgstr "" +"%s : %s : l'assignation d'un tableau associatif doit se faire avec un indice" + +#: bashhist.c:388 +#, c-format +msgid "%s: cannot create: %s" +msgstr "%s : impossible de créer : %s" + +#: bashline.c:3982 +msgid "bash_execute_unix_command: cannot find keymap for command" +msgstr "" +"bash_execute_unix_command : impossible de trouver le mappage clavier pour la " +"commande" + +#: bashline.c:4069 +#, c-format +msgid "%s: first non-whitespace character is not `\"'" +msgstr "%s : le premier caractère non vide n'est pas « \" »" + +#: bashline.c:4098 +#, c-format +msgid "no closing `%c' in %s" +msgstr "pas de « %c » de fermeture dans %s" + +#: bashline.c:4132 +#, c-format +msgid "%s: missing colon separator" +msgstr "%s : virgule de séparation manquante" + +#: braces.c:321 +#, c-format +msgid "brace expansion: cannot allocate memory for %s" +msgstr "" + +#: braces.c:413 +#, c-format +msgid "brace expansion: failed to allocate memory for %d elements" +msgstr "" + +#: braces.c:452 +#, c-format +msgid "brace expansion: failed to allocate memory for `%s'" +msgstr "" + +#: builtins/alias.def:132 +#, c-format +msgid "`%s': invalid alias name" +msgstr "« %s » : nom d'alias non valable" + +#: builtins/bind.def:123 builtins/bind.def:126 +msgid "line editing not enabled" +msgstr "édition de ligne non activée" + +#: builtins/bind.def:212 +#, c-format +msgid "`%s': invalid keymap name" +msgstr "« %s » : nom du mappage clavier invalide" + +#: builtins/bind.def:251 +#, c-format +msgid "%s: cannot read: %s" +msgstr "%s : impossible de lire : %s" + +#: builtins/bind.def:266 +#, c-format +msgid "`%s': cannot unbind" +msgstr "%s : impossible à délier" + +#: builtins/bind.def:304 builtins/bind.def:334 +#, c-format +msgid "`%s': unknown function name" +msgstr "%s : nom de fonction inconnu" + +#: builtins/bind.def:312 +#, c-format +msgid "%s is not bound to any keys.\n" +msgstr "%s n'est lié à aucune touche.\n" + +#: builtins/bind.def:316 +#, c-format +msgid "%s can be invoked via " +msgstr "%s peut être appelé via " + +#: builtins/break.def:77 builtins/break.def:117 +msgid "loop count" +msgstr "nombre de boucles" + +#: builtins/break.def:137 +msgid "only meaningful in a `for', `while', or `until' loop" +msgstr "ceci n'a un sens que dans une boucle « for », « while » ou « until »" + +#: builtins/caller.def:134 +msgid "" +"Returns the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns " +msgstr "" +"Renvoie le contexte de l'appel de sous-routine actuel.\n" +" \n" +" Sans EXPR, renvoie" + +#: builtins/cd.def:319 +msgid "HOME not set" +msgstr "« HOME » non défini" + +#: builtins/cd.def:327 builtins/common.c:166 test.c:876 +msgid "too many arguments" +msgstr "trop d'arguments" + +#: builtins/cd.def:338 +msgid "OLDPWD not set" +msgstr "« OLDPWD » non défini" + +#: builtins/common.c:101 +#, c-format +msgid "line %d: " +msgstr "ligne %d : " + +#: builtins/common.c:139 error.c:265 +#, c-format +msgid "warning: " +msgstr "avertissement :" + +#: builtins/common.c:153 +#, c-format +msgid "%s: usage: " +msgstr "%s : utilisation :" + +#: builtins/common.c:191 shell.c:506 shell.c:788 +#, c-format +msgid "%s: option requires an argument" +msgstr "%s : l'option nécessite un argument" + +#: builtins/common.c:198 +#, c-format +msgid "%s: numeric argument required" +msgstr "%s : argument numérique nécessaire" + +#: builtins/common.c:205 +#, c-format +msgid "%s: not found" +msgstr "%s : non trouvé" + +#: builtins/common.c:214 shell.c:801 +#, c-format +msgid "%s: invalid option" +msgstr "%s : option non valable" + +#: builtins/common.c:221 +#, c-format +msgid "%s: invalid option name" +msgstr "%s : nom d'option non valable" + +#: builtins/common.c:228 general.c:235 general.c:240 +#, c-format +msgid "`%s': not a valid identifier" +msgstr "« %s » : identifiant non valable" + +#: builtins/common.c:238 +msgid "invalid octal number" +msgstr "nombre octal non valable" + +#: builtins/common.c:240 +msgid "invalid hex number" +msgstr "nombre hexadécimal non valable" + +#: builtins/common.c:242 expr.c:1470 +msgid "invalid number" +msgstr "nombre non valable" + +#: builtins/common.c:250 +#, c-format +msgid "%s: invalid signal specification" +msgstr "%s : indication de signal non valable" + +#: builtins/common.c:257 +#, c-format +msgid "`%s': not a pid or valid job spec" +msgstr "" +"« %s » : ce n'est pas un n° de processus ou une spécification de tâche " +"valable" + +#: builtins/common.c:264 error.c:488 +#, c-format +msgid "%s: readonly variable" +msgstr "%s : variable en lecture seule" + +#: builtins/common.c:272 +#, c-format +msgid "%s: %s out of range" +msgstr "%s : %s hors plage" + +#: builtins/common.c:272 builtins/common.c:274 +msgid "argument" +msgstr "argument" + +#: builtins/common.c:274 +#, c-format +msgid "%s out of range" +msgstr "%s hors plage" + +#: builtins/common.c:282 +#, c-format +msgid "%s: no such job" +msgstr "%s : tâche inexistante" + +#: builtins/common.c:290 +#, c-format +msgid "%s: no job control" +msgstr "%s : pas de contrôle de tâche" + +#: builtins/common.c:292 +msgid "no job control" +msgstr "pas de contrôle de tâche" + +#: builtins/common.c:302 +#, c-format +msgid "%s: restricted" +msgstr "%s : restreint" + +#: builtins/common.c:304 +msgid "restricted" +msgstr "restreint" + +#: builtins/common.c:312 +#, c-format +msgid "%s: not a shell builtin" +msgstr "%s : ceci n'est pas une primitive du shell" + +#: builtins/common.c:321 +#, c-format +msgid "write error: %s" +msgstr "erreur d'écriture : %s" + +#: builtins/common.c:329 +#, c-format +msgid "error setting terminal attributes: %s" +msgstr "erreur lors de la définition de l'attribut du terminal %s" + +#: builtins/common.c:331 +#, c-format +msgid "error getting terminal attributes: %s" +msgstr "erreur lors de la récupération de l'attribut du terminal : %s" + +#: builtins/common.c:563 +#, c-format +msgid "%s: error retrieving current directory: %s: %s\n" +msgstr "%s : erreur de détermination du répertoire actuel : %s : %s\n" + +#: builtins/common.c:629 builtins/common.c:631 +#, c-format +msgid "%s: ambiguous job spec" +msgstr "%s : spécification de tâche ambiguë" + +#: builtins/complete.def:277 +#, c-format +msgid "%s: invalid action name" +msgstr "%s : nom d'action non valable" + +#: builtins/complete.def:450 builtins/complete.def:645 +#: builtins/complete.def:855 +#, c-format +msgid "%s: no completion specification" +msgstr "%s : pas d'indication de complètement" + +#: builtins/complete.def:697 +msgid "warning: -F option may not work as you expect" +msgstr "" +"avertissement : l'option « -F » peut fonctionner différemment de ce à quoi " +"vous vous attendez" + +#: builtins/complete.def:699 +msgid "warning: -C option may not work as you expect" +msgstr "" +"avertissement : l'option « -C » peut fonctionner différemment de ce à quoi " +"vous vous attendez" + +#: builtins/complete.def:828 +msgid "not currently executing completion function" +msgstr "fonction de completion actuellement non en cours d'exécution" + +#: builtins/declare.def:126 +msgid "can only be used in a function" +msgstr "utilisable seulement dans une fonction" + +#: builtins/declare.def:315 builtins/declare.def:509 +#, c-format +msgid "%s: reference variable cannot be an array" +msgstr "" + +#: builtins/declare.def:324 +#, c-format +msgid "%s: nameref variable self references not allowed" +msgstr "" + +#: builtins/declare.def:398 +msgid "cannot use `-f' to make functions" +msgstr "« -f » ne peut pas être utilisé pour fabriquer des fonctions" + +#: builtins/declare.def:410 execute_cmd.c:5361 +#, c-format +msgid "%s: readonly function" +msgstr "%s : fonction en lecture seule" + +#: builtins/declare.def:553 +#, c-format +msgid "%s: cannot destroy array variables in this way" +msgstr "%s : impossible de détruire des variables tableaux de cette façon" + +#: builtins/declare.def:560 builtins/read.def:733 +#, c-format +msgid "%s: cannot convert associative to indexed array" +msgstr "%s : impossible de convertir un tableau indexé en tableau associatif" + +#: builtins/enable.def:137 builtins/enable.def:145 +msgid "dynamic loading not available" +msgstr "chargement dynamique non disponible" + +#: builtins/enable.def:312 +#, c-format +msgid "cannot open shared object %s: %s" +msgstr "impossible d'ouvrir l'objet partagé %s : %s" + +#: builtins/enable.def:335 +#, c-format +msgid "cannot find %s in shared object %s: %s" +msgstr "impossible de trouver %s dans l'objet partagé %s : %s" + +#: builtins/enable.def:459 +#, c-format +msgid "%s: not dynamically loaded" +msgstr "%s : non chargé dynamiquement" + +#: builtins/enable.def:474 +#, c-format +msgid "%s: cannot delete: %s" +msgstr "%s : impossible d'effacer : %s" + +#: builtins/evalfile.c:140 builtins/hash.def:171 execute_cmd.c:5208 +#: shell.c:1481 +#, c-format +msgid "%s: is a directory" +msgstr "%s : ceci est un répertoire" + +#: builtins/evalfile.c:146 +#, c-format +msgid "%s: not a regular file" +msgstr "%s : ceci n'est pas un fichier régulier" + +#: builtins/evalfile.c:155 +#, c-format +msgid "%s: file is too large" +msgstr "%s : le fichier est trop grand" + +#: builtins/evalfile.c:190 builtins/evalfile.c:208 shell.c:1491 +#, c-format +msgid "%s: cannot execute binary file" +msgstr "%s : fichier binaire impossible à lancer" + +#: builtins/exec.def:154 builtins/exec.def:156 builtins/exec.def:228 +#, c-format +msgid "%s: cannot execute: %s" +msgstr "%s : impossible d'exécuter : %s" + +#: builtins/exit.def:65 +#, c-format +msgid "logout\n" +msgstr "déconnexion\n" + +#: builtins/exit.def:88 +msgid "not login shell: use `exit'" +msgstr "ce n'est pas un shell de connexion : utilisez « exit »" + +#: builtins/exit.def:120 +#, c-format +msgid "There are stopped jobs.\n" +msgstr "Il y a des tâches stoppées.\n" + +#: builtins/exit.def:122 +#, c-format +msgid "There are running jobs.\n" +msgstr "Il y a des tâches en cours d'exécution.\n" + +#: builtins/fc.def:262 +msgid "no command found" +msgstr "aucune commande trouvée" + +#: builtins/fc.def:320 builtins/fc.def:369 +msgid "history specification" +msgstr "indication d'historique" + +#: builtins/fc.def:390 +#, c-format +msgid "%s: cannot open temp file: %s" +msgstr "%s : impossible d'ouvrir le fichier temporaire : %s" + +#: builtins/fg_bg.def:149 builtins/jobs.def:282 +msgid "current" +msgstr "courant" + +#: builtins/fg_bg.def:158 +#, c-format +msgid "job %d started without job control" +msgstr "tâche %d démarrée sans contrôle de tâche" + +#: builtins/getopt.c:110 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s : option non permise -- %c\n" + +#: builtins/getopt.c:111 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s : l'option nécessite un argument -- %c\n" + +#: builtins/hash.def:92 +msgid "hashing disabled" +msgstr "hachage désactivé" + +#: builtins/hash.def:138 +#, c-format +msgid "%s: hash table empty\n" +msgstr "%s : table de hachage vide\n" + +#: builtins/hash.def:245 +#, c-format +msgid "hits\tcommand\n" +msgstr "touche la commande\n" + +#: builtins/help.def:130 +#, c-format +msgid "Shell commands matching keyword `" +msgid_plural "Shell commands matching keywords `" +msgstr[0] "Commandes du shell correspondant au mot-clé « " +msgstr[1] "Commandes du shell correspondant aux mots-clés « " + +#: builtins/help.def:182 +#, c-format +msgid "" +"no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." +msgstr "" +"Aucune rubrique d'aide ne correspond à « %s ». Essayez « help help », « man -" +"k %s » ou « info %s »." + +#: builtins/help.def:199 +#, c-format +msgid "%s: cannot open: %s" +msgstr "%s : impossible d'ouvrir : %s" + +#: builtins/help.def:485 +#, c-format +msgid "" +"These shell commands are defined internally. Type `help' to see this list.\n" +"Type `help name' to find out more about the function `name'.\n" +"Use `info bash' to find out more about the shell in general.\n" +"Use `man -k' or `info' to find out more about commands not in this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" +msgstr "" +"Ces commandes de shell sont définies de manière interne. Saisissez « help » " +"pour voir cette liste.\n" +"Tapez « help nom » pour en savoir plus sur la fonction qui s'appelle « nom " +"».\n" +"Utilisez « info bash » pour en savoir plus sur le shell en général.\n" +"Utilisez « man -k » ou « info » pour en savoir plus sur les commandes qui\n" +"ne font pas partie de cette liste.\n" +"\n" +"Une astérisque (*) à côté d'un nom signifie que la commande est désactivée.\n" +"\n" + +#: builtins/history.def:154 +msgid "cannot use more than one of -anrw" +msgstr "impossible d'utiliser plus d'une option parmi « -anrw »" + +#: builtins/history.def:186 +msgid "history position" +msgstr "position dans l'historique" + +#: builtins/history.def:366 +#, c-format +msgid "%s: history expansion failed" +msgstr "%s : l'expansion de l'historique a échoué" + +#: builtins/inlib.def:71 +#, c-format +msgid "%s: inlib failed" +msgstr "%s : « inlib » a échoué" + +#: builtins/jobs.def:109 +msgid "no other options allowed with `-x'" +msgstr "pas d'autre option permise avec « -x »" + +#: builtins/kill.def:200 +#, c-format +msgid "%s: arguments must be process or job IDs" +msgstr "" +"%s : les arguments doivent être des identifiants de tâche ou de processus" + +#: builtins/kill.def:263 +msgid "Unknown error" +msgstr "Erreur inconnue" + +#: builtins/let.def:95 builtins/let.def:120 expr.c:583 expr.c:598 +msgid "expression expected" +msgstr "une expression est attendue" + +#: builtins/mapfile.def:172 +#, c-format +msgid "%s: not an indexed array" +msgstr "%s : n'est pas un tableau indexé" + +#: builtins/mapfile.def:259 builtins/read.def:302 +#, c-format +msgid "%s: invalid file descriptor specification" +msgstr "%s : spécification de descripteur de fichier non valable" + +#: builtins/mapfile.def:267 builtins/read.def:309 +#, c-format +msgid "%d: invalid file descriptor: %s" +msgstr "%d : descripteur de fichier non valable : %s" + +#: builtins/mapfile.def:276 builtins/mapfile.def:314 +#, c-format +msgid "%s: invalid line count" +msgstr "%s : nombre de lignes non valable" + +#: builtins/mapfile.def:287 +#, c-format +msgid "%s: invalid array origin" +msgstr "%s : origine de tableau non valable" + +#: builtins/mapfile.def:304 +#, c-format +msgid "%s: invalid callback quantum" +msgstr "%s : quantum de callback non valable" + +#: builtins/mapfile.def:336 +msgid "empty array variable name" +msgstr "nom de variable tableau vide" + +#: builtins/mapfile.def:357 +msgid "array variable support required" +msgstr "nécessité de prise en charge des variables tableaux" + +#: builtins/printf.def:402 +#, c-format +msgid "`%s': missing format character" +msgstr "« %s » : caractère de format manquant" + +#: builtins/printf.def:456 +#, c-format +msgid "`%c': invalid time format specification" +msgstr "`%c' : spécification de format d'heure incorrecte" + +#: builtins/printf.def:658 +#, c-format +msgid "`%c': invalid format character" +msgstr "« %c » : caractère de format non permis" + +#: builtins/printf.def:684 +#, c-format +msgid "warning: %s: %s" +msgstr "avertissement : %s: %s" + +#: builtins/printf.def:768 +#, c-format +msgid "format parsing problem: %s" +msgstr "" + +#: builtins/printf.def:865 +msgid "missing hex digit for \\x" +msgstr "chiffre hexadécimal manquant pour \\x" + +#: builtins/printf.def:880 +#, c-format +msgid "missing unicode digit for \\%c" +msgstr "chiffre unicode manquant pour \\%c" + +#: builtins/pushd.def:195 +msgid "no other directory" +msgstr "pas d'autre répertoire" + +#: builtins/pushd.def:354 +#, fuzzy, c-format +msgid "%s: invalid argument" +msgstr "%s : argument de limite non valable" + +#: builtins/pushd.def:468 +msgid "" +msgstr "" + +#: builtins/pushd.def:512 +msgid "directory stack empty" +msgstr "pile de répertoire vide" + +#: builtins/pushd.def:514 +msgid "directory stack index" +msgstr "indice de pile de répertoire" + +#: builtins/pushd.def:689 +msgid "" +"Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +"\tdirs when invoked without options, starting with zero." +msgstr "" +"Affiche la liste des répertoires actuellement mémorisés. Les répertoires\n" +" sont insérés dans la liste avec la commande « pushd ». Vous pouvez " +"remonter\n" +" dans la liste en enlevant des éléments avec la commande « popd ».\n" +" \n" +" Options :\n" +" -c\tefface la pile des répertoires en enlevant tous les éléments.\n" +" -l\tne pas afficher les versions raccourcies (avec ~) des répertoires\n" +" \trelativement à votre répertoire personnel\n" +" -p\tafficher la pile des répertoires avec un élément par ligne\n" +" -v\tafficher la pile des répertoires avec un élément par ligne\n" +" \tavec la position dans la pile\n" +" \n" +" Arguments :\n" +" +N\t affiche le Nième élément en comptant de zéro depuis la gauche de " +"la\n" +" liste affichée par « dirs » lorsque celle-ci est appelée sans option.\n" +" \n" +" -N\t affiche le Nième élément en comptant de zéro depuis la droite de " +"la\n" +" liste affichée par « dirs » lorsque celle-ci est appelée sans option." + +#: builtins/pushd.def:711 +msgid "" +"Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Ajoute un répertoire en haut de la pile des répertoires, ou permute\n" +" la pile de façon que le répertoire en haut de la pile devienne\n" +" le nouveau répertoire de travail. S'il n'y a pas d'argument, les deux\n" +" répertoires en haut de la pile sont échangés.\n" +" \n" +" Options :\n" +" -n\tne pas changer de répertoire de travail lorsque des répertoires\n" +" \tsont ajoutés à la pile, de façon que seule la pile soit manipulée\n" +" \n" +" Arguments :\n" +" +N\tPermute la pile de façon que le Nième répertoire se place en haut,\n" +" \ten comptant de zéro depuis la gauche de la liste fournie par « dirs " +"».\n" +" \n" +" -N\tPermute la pile de façon que le Nième répertoire se place en haut,\n" +" \ten comptant de zéro depuis la droite de la liste fournie par « dirs " +"».\n" +" \n" +" dir\tajoute le répertoire DIR en haut de la pile, et en fait le " +"nouveau\n" +" \trépertoire de travail.\n" +" \n" +" Vous pouvez voir la pile des répertoires avec la commande « dirs »." + +#: builtins/pushd.def:736 +msgid "" +"Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Enlève des éléments de la pile des répertoires. S'il n'y a pas\n" +" d'argument, le répertoire en haut de la pile est enlevé,\n" +" et le nouveau sommet de la pile devient le répertoire de travail.\n" +" \n" +" Options :\n" +" -n\tne pas changer de répertoire de travail lorsque des répertoires\n" +" \tsont enlevés de la pile, de façon que seule la pile soit manipulée\n" +" \n" +" Arguments :\n" +" +N\tEnlève le Nième répertoire, en comptant de zéro depuis la gauche\n" +" \tde la liste fournie par « dirs ». Par exemple : « popd +0 »\n" +" \tenlève le premier répertoire, « popd +1 » le deuxième. \n" +" \n" +" -N\tEnlève le Nième répertoire, en comptant de zéro depuis la droite\n" +" \tde la liste fournie par « dirs ». Par exemple : « popd -0 »\n" +" \tenlève le dernier répertoire, « popd -1 » l'avant-dernier. \n" +" \n" +" Vous pouvez voir la pile des répertoires avec la commande « dirs »." + +#: builtins/read.def:275 +#, c-format +msgid "%s: invalid timeout specification" +msgstr "%s : spécification de délai d'expiration non valable" + +#: builtins/read.def:678 +#, c-format +msgid "read error: %d: %s" +msgstr "Erreur de lecture : %d : %s" + +#: builtins/return.def:75 +msgid "can only `return' from a function or sourced script" +msgstr "" +"« return » n'est possible que depuis une fonction ou depuis un script " +"exécuté par « source »" + +#: builtins/set.def:782 +msgid "cannot simultaneously unset a function and a variable" +msgstr "" +"« unset » ne peut pas s'appliquer simultanément à une fonction et à une " +"variable" + +#: builtins/set.def:826 +#, c-format +msgid "%s: cannot unset" +msgstr "%s : « unset » impossible" + +#: builtins/set.def:843 +#, c-format +msgid "%s: cannot unset: readonly %s" +msgstr "%s : « unset » impossible : %s est en lecture seule" + +#: builtins/set.def:854 +#, c-format +msgid "%s: not an array variable" +msgstr "%s : n'est pas une variable tableau" + +#: builtins/setattr.def:187 +#, c-format +msgid "%s: not a function" +msgstr "%s : n'est pas une fonction" + +#: builtins/shift.def:71 builtins/shift.def:77 +msgid "shift count" +msgstr "nombre de « shift »" + +#: builtins/shopt.def:279 +msgid "cannot set and unset shell options simultaneously" +msgstr "" +"les options du shell ne peuvent pas être simultanément activées et " +"désactivées" + +#: builtins/shopt.def:346 +#, c-format +msgid "%s: invalid shell option name" +msgstr "%s : nom d'option du shell non valable" + +#: builtins/source.def:130 +msgid "filename argument required" +msgstr "nom de fichier nécessaire en argument" + +#: builtins/source.def:155 +#, c-format +msgid "%s: file not found" +msgstr "%s : fichier introuvable" + +#: builtins/suspend.def:101 +msgid "cannot suspend" +msgstr "suspension impossible" + +#: builtins/suspend.def:111 +msgid "cannot suspend a login shell" +msgstr "un shell de connexion ne peut pas être suspendu" + +#: builtins/type.def:234 +#, c-format +msgid "%s is aliased to `%s'\n" +msgstr "%s est un alias vers « %s »\n" + +#: builtins/type.def:255 +#, c-format +msgid "%s is a shell keyword\n" +msgstr "%s est un mot-clé du shell\n" + +#: builtins/type.def:274 +#, c-format +msgid "%s is a function\n" +msgstr "%s est une fonction\n" + +#: builtins/type.def:296 +#, c-format +msgid "%s is a shell builtin\n" +msgstr "%s est une primitive du shell\n" + +#: builtins/type.def:317 builtins/type.def:393 +#, c-format +msgid "%s is %s\n" +msgstr "%s est %s\n" + +#: builtins/type.def:337 +#, c-format +msgid "%s is hashed (%s)\n" +msgstr "%s est haché (%s)\n" + +#: builtins/ulimit.def:383 +#, c-format +msgid "%s: invalid limit argument" +msgstr "%s : argument de limite non valable" + +#: builtins/ulimit.def:409 +#, c-format +msgid "`%c': bad command" +msgstr "« %c » : mauvaise commande" + +#: builtins/ulimit.def:438 +#, c-format +msgid "%s: cannot get limit: %s" +msgstr "%s : impossible d'obtenir la limite : %s" + +#: builtins/ulimit.def:464 +msgid "limit" +msgstr "limite" + +#: builtins/ulimit.def:476 builtins/ulimit.def:776 +#, c-format +msgid "%s: cannot modify limit: %s" +msgstr "%s : impossible de modifier la limite : %s" + +#: builtins/umask.def:114 +msgid "octal number" +msgstr "nombre octal" + +#: builtins/umask.def:227 +#, c-format +msgid "`%c': invalid symbolic mode operator" +msgstr "« %c » : opérateur de mode symbolique non valable" + +#: builtins/umask.def:282 +#, c-format +msgid "`%c': invalid symbolic mode character" +msgstr "« %c » : caractère de mode symbolique non valable" + +#: error.c:90 error.c:325 error.c:327 error.c:329 +msgid " line " +msgstr " ligne " + +#: error.c:165 +#, c-format +msgid "last command: %s\n" +msgstr "dernière commande : %s\n" + +#: error.c:173 +#, c-format +msgid "Aborting..." +msgstr "Annulation..." + +#: error.c:440 +msgid "unknown command error" +msgstr "erreur de commande inconnue" + +#: error.c:441 +msgid "bad command type" +msgstr "mauvais type de commande" + +#: error.c:442 +msgid "bad connector" +msgstr "mauvais connecteur" + +#: error.c:443 +msgid "bad jump" +msgstr "mauvais saut" + +#: error.c:481 +#, c-format +msgid "%s: unbound variable" +msgstr "%s : variable sans liaison" + +#: eval.c:189 +#, c-format +msgid "\atimed out waiting for input: auto-logout\n" +msgstr "\aattente de données expirée : déconnexion automatique\n" + +#: execute_cmd.c:512 +#, c-format +msgid "cannot redirect standard input from /dev/null: %s" +msgstr "l'entrée standard ne peut pas être redirigée depuis /dev/null : %s" + +#: execute_cmd.c:1233 +#, c-format +msgid "TIMEFORMAT: `%c': invalid format character" +msgstr "TIMEFORMAT : « %c » : caractère de format non valable" + +#: execute_cmd.c:2287 +msgid "pipe error" +msgstr "erreur de tube" + +#: execute_cmd.c:4386 +#, c-format +msgid "%s: maximum function nesting level exceeded (%d)" +msgstr "" + +#: execute_cmd.c:4884 +#, c-format +msgid "%s: restricted: cannot specify `/' in command names" +msgstr "" +"%s : restriction : « / » ne peut pas être spécifié dans un nom de commande" + +#: execute_cmd.c:4973 +#, c-format +msgid "%s: command not found" +msgstr "%s : commande introuvable" + +#: execute_cmd.c:5206 +#, c-format +msgid "%s: %s" +msgstr "%s : %s" + +#: execute_cmd.c:5243 +#, c-format +msgid "%s: %s: bad interpreter" +msgstr "%s : %s : mauvais interpréteur" + +#: execute_cmd.c:5280 +#, fuzzy, c-format +msgid "%s: cannot execute binary file: %s" +msgstr "%s : fichier binaire impossible à lancer" + +#: execute_cmd.c:5352 +#, fuzzy, c-format +msgid "`%s': is a special builtin" +msgstr "%s est une primitive du shell\n" + +#: execute_cmd.c:5404 +#, c-format +msgid "cannot duplicate fd %d to fd %d" +msgstr "impossible de dupliquer le fd %d vers le fd %d" + +#: expr.c:259 +msgid "expression recursion level exceeded" +msgstr "dépassement du niveau de récursivité dans l'expression" + +#: expr.c:283 +msgid "recursion stack underflow" +msgstr "débordement négatif de la pile de récursivité" + +#: expr.c:431 +msgid "syntax error in expression" +msgstr "erreur de syntaxe dans l'expression" + +#: expr.c:475 +msgid "attempted assignment to non-variable" +msgstr "tentative d'affectation à une non-variable" + +#: expr.c:495 expr.c:858 +msgid "division by 0" +msgstr "division par 0" + +#: expr.c:542 +msgid "bug: bad expassign token" +msgstr "bogue : mauvais symbole pour expassign" + +#: expr.c:595 +msgid "`:' expected for conditional expression" +msgstr "« : » attendu pour une expression conditionnelle." + +#: expr.c:919 +msgid "exponent less than 0" +msgstr "exposant négatif" + +#: expr.c:976 +msgid "identifier expected after pre-increment or pre-decrement" +msgstr "identifiant attendu après un pré-incrément ou un pré-décrément" + +#: expr.c:1002 +msgid "missing `)'" +msgstr "« ) » manquante" + +#: expr.c:1053 expr.c:1390 +msgid "syntax error: operand expected" +msgstr "erreur de syntaxe : opérande attendue" + +#: expr.c:1392 +msgid "syntax error: invalid arithmetic operator" +msgstr "erreur de syntaxe : opérateur arithmétique non valable" + +#: expr.c:1416 +#, c-format +msgid "%s%s%s: %s (error token is \"%s\")" +msgstr "%s%s%s : %s (le symbole erroné est \"%s\")" + +#: expr.c:1474 +msgid "invalid arithmetic base" +msgstr "base arithmétique non valable" + +#: expr.c:1494 +msgid "value too great for base" +msgstr "valeur trop grande pour la base" + +#: expr.c:1543 +#, c-format +msgid "%s: expression error\n" +msgstr "%s : erreur d'expression\n" + +#: general.c:62 +msgid "getcwd: cannot access parent directories" +msgstr "getcwd : ne peut accéder aux répertoires parents" + +#: input.c:102 subst.c:5168 +#, c-format +msgid "cannot reset nodelay mode for fd %d" +msgstr "Impossible de réinitialiser le mode « nodelay » pour le fd %d" + +#: input.c:271 +#, c-format +msgid "cannot allocate new file descriptor for bash input from fd %d" +msgstr "" +"impossible d'allouer un nouveau descripteur de fichier pour l'entrée de bash " +"depuis le fd %d" + +#: input.c:279 +#, c-format +msgid "save_bash_input: buffer already exists for new fd %d" +msgstr "save_bash_input : le tampon existe déjà pour le nouveau fd %d" + +#: jobs.c:471 +msgid "start_pipeline: pgrp pipe" +msgstr "start_pipeline : pgrp pipe" + +#: jobs.c:893 +#, c-format +msgid "forked pid %d appears in running job %d" +msgstr "le processus cloné n°%d apparaît dans la tâche en fonctionnement %d" + +#: jobs.c:1012 +#, c-format +msgid "deleting stopped job %d with process group %ld" +msgstr "suppression de la tâche stoppée %d avec le groupe de processus %ld" + +#: jobs.c:1117 +#, c-format +msgid "add_process: process %5ld (%s) in the_pipeline" +msgstr "add_process : processus %5ld (%s) dans le_pipeline" + +#: jobs.c:1120 +#, c-format +msgid "add_process: pid %5ld (%s) marked as still alive" +msgstr "add_process : pid %5ld (%s) signalé toujours en vie" + +#: jobs.c:1435 +#, c-format +msgid "describe_pid: %ld: no such pid" +msgstr "describe_pid : %ld : n° de processus inexistant" + +#: jobs.c:1450 +#, c-format +msgid "Signal %d" +msgstr "Signal %d" + +#: jobs.c:1464 jobs.c:1489 +msgid "Done" +msgstr "Fini" + +#: jobs.c:1469 siglist.c:123 +msgid "Stopped" +msgstr "Stoppé" + +#: jobs.c:1473 +#, c-format +msgid "Stopped(%s)" +msgstr "Stoppé(%s)" + +#: jobs.c:1477 +msgid "Running" +msgstr "En cours d'exécution" + +#: jobs.c:1491 +#, c-format +msgid "Done(%d)" +msgstr "Fini(%d)" + +#: jobs.c:1493 +#, c-format +msgid "Exit %d" +msgstr "Termine %d" + +#: jobs.c:1496 +msgid "Unknown status" +msgstr "État inconnu" + +#: jobs.c:1583 +#, c-format +msgid "(core dumped) " +msgstr "(core dumped)" + +#: jobs.c:1602 +#, c-format +msgid " (wd: %s)" +msgstr " (wd : %s)" + +#: jobs.c:1819 +#, c-format +msgid "child setpgid (%ld to %ld)" +msgstr "fils setpgid (%ld à %ld)" + +#: jobs.c:2138 nojobs.c:605 +#, c-format +msgid "wait: pid %ld is not a child of this shell" +msgstr "wait : le processus n°%ld n'est pas un fils de ce shell." + +#: jobs.c:2385 +#, c-format +msgid "wait_for: No record of process %ld" +msgstr "wait_for : aucun enregistrement du processus n°%ld" + +#: jobs.c:2694 +#, c-format +msgid "wait_for_job: job %d is stopped" +msgstr "wait_for_job : la tâche %d est stoppée" + +#: jobs.c:2986 +#, c-format +msgid "%s: job has terminated" +msgstr "%s : la tâche s'est terminée" + +#: jobs.c:2995 +#, c-format +msgid "%s: job %d already in background" +msgstr "%s : la tâche %d est déjà en arrière plan" + +#: jobs.c:3220 +msgid "waitchld: turning on WNOHANG to avoid indefinite block" +msgstr "waitchld : activation de WNOHANG pour éviter un blocage définitif" + +#: jobs.c:3711 +#, c-format +msgid "%s: line %d: " +msgstr "%s : ligne %d : " + +#: jobs.c:3725 nojobs.c:843 +#, c-format +msgid " (core dumped)" +msgstr " (core dumped)" + +#: jobs.c:3737 jobs.c:3750 +#, c-format +msgid "(wd now: %s)\n" +msgstr "(maintenant, wd : %s)\n" + +#: jobs.c:3782 +msgid "initialize_job_control: getpgrp failed" +msgstr "initialize_job_control : getpgrp a échoué" + +#: jobs.c:3843 +msgid "initialize_job_control: line discipline" +msgstr "initialize_job_control : discipline de ligne" + +#: jobs.c:3853 +msgid "initialize_job_control: setpgid" +msgstr "initialize_job_control : setpgid" + +#: jobs.c:3874 jobs.c:3883 +#, c-format +msgid "cannot set terminal process group (%d)" +msgstr "impossible de régler le groupe de processus du terminlal (%d)" + +#: jobs.c:3888 +msgid "no job control in this shell" +msgstr "pas de contrôle de tâche dans ce shell" + +#: lib/malloc/malloc.c:296 +#, c-format +msgid "malloc: failed assertion: %s\n" +msgstr "malloc : échec de l'assertion : %s\n" + +#: lib/malloc/malloc.c:312 +#, c-format +msgid "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" +msgstr "" +"\r\n" +"malloc : %s:%d : assertion manquée\r\n" + +#: lib/malloc/malloc.c:313 +msgid "unknown" +msgstr "inconnu" + +#: lib/malloc/malloc.c:801 +msgid "malloc: block on free list clobbered" +msgstr "malloc : bloc écrasé sur liste libre" + +#: lib/malloc/malloc.c:878 +msgid "free: called with already freed block argument" +msgstr "free : appelé avec un bloc déjà libéré comme argument" + +#: lib/malloc/malloc.c:881 +msgid "free: called with unallocated block argument" +msgstr "free : appelé avec un bloc non alloué comme argument" + +#: lib/malloc/malloc.c:900 +msgid "free: underflow detected; mh_nbytes out of range" +msgstr "free : débordement négatif détecté ; « mh_nbytes » est hors plage" + +#: lib/malloc/malloc.c:906 +msgid "free: start and end chunk sizes differ" +msgstr "free : les tailles de fragment au début et à la fin sont différentes" + +#: lib/malloc/malloc.c:1005 +msgid "realloc: called with unallocated block argument" +msgstr "realloc : appelé avec un bloc non alloué comme argument" + +#: lib/malloc/malloc.c:1020 +msgid "realloc: underflow detected; mh_nbytes out of range" +msgstr "realloc : débordement négatif détecté ; « mh_nbytes » est hors plage" + +#: lib/malloc/malloc.c:1026 +msgid "realloc: start and end chunk sizes differ" +msgstr "" +"realloc : les tailles de fragment au début et à la fin sont différentes" + +#: lib/malloc/table.c:194 +#, c-format +msgid "register_alloc: alloc table is full with FIND_ALLOC?\n" +msgstr "register_alloc : la table d'allocation est pleine avec FIND_ALLOC ?\n" + +#: lib/malloc/table.c:203 +#, c-format +msgid "register_alloc: %p already in table as allocated?\n" +msgstr "register_alloc : %p déjà alloué selon la table ?\n" + +#: lib/malloc/table.c:256 +#, c-format +msgid "register_free: %p already in table as free?\n" +msgstr "register_free : %p déjà libre selon la table ?\n" + +#: lib/sh/fmtulong.c:102 +msgid "invalid base" +msgstr "base non valable" + +#: lib/sh/netopen.c:168 +#, c-format +msgid "%s: host unknown" +msgstr "%s : hôte inconnu" + +#: lib/sh/netopen.c:175 +#, c-format +msgid "%s: invalid service" +msgstr "%s: service non valable" + +#: lib/sh/netopen.c:306 +#, c-format +msgid "%s: bad network path specification" +msgstr "%s : mauvaise spécification de chemin réseau" + +#: lib/sh/netopen.c:346 +msgid "network operations not supported" +msgstr "opérations sur le réseau non prises en charge" + +#: locale.c:200 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s)" +msgstr "setlocale : LC_ALL : impossible de changer le paramètre de langue (%s)" + +#: locale.c:202 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s): %s" +msgstr "" +"setlocale : LC_ALL : impossible de changer le paramètre de langue (%s) : %s" + +#: locale.c:259 +#, c-format +msgid "setlocale: %s: cannot change locale (%s)" +msgstr "setlocale : %s : impossible de changer le paramètre de langue (%s)" + +#: locale.c:261 +#, c-format +msgid "setlocale: %s: cannot change locale (%s): %s" +msgstr "" +"setlocale : %s : impossible de changer le paramètre de langue (%s) : %s" + +#: mailcheck.c:439 +msgid "You have mail in $_" +msgstr "Vous avez du courrier dans $_" + +#: mailcheck.c:464 +msgid "You have new mail in $_" +msgstr "Vous avez du nouveau courrier dans $_" + +#: mailcheck.c:480 +#, c-format +msgid "The mail in %s has been read\n" +msgstr "Le courrier dans %s a été lu.\n" + +#: make_cmd.c:323 +msgid "syntax error: arithmetic expression required" +msgstr "erreur de syntaxe : expression arithmétique nécessaire" + +#: make_cmd.c:325 +msgid "syntax error: `;' unexpected" +msgstr "erreur de syntaxe : « ; » non attendu" + +#: make_cmd.c:326 +#, c-format +msgid "syntax error: `((%s))'" +msgstr "erreur de syntaxe : « ((%s)) »" + +#: make_cmd.c:578 +#, c-format +msgid "make_here_document: bad instruction type %d" +msgstr "make_here_document : le type d'instruction %d est incorrect" + +#: make_cmd.c:662 +#, c-format +msgid "here-document at line %d delimited by end-of-file (wanted `%s')" +msgstr "" +"« here-document » à la ligne %d délimité par la fin du fichier (au lieu de « " +"%s »)" + +#: make_cmd.c:759 +#, c-format +msgid "make_redirection: redirection instruction `%d' out of range" +msgstr "make_redirection : l'instruction de redirection « %d » est hors plage" + +#: parse.y:3278 parse.y:3561 +#, c-format +msgid "unexpected EOF while looking for matching `%c'" +msgstr "" +"caractère de fin de fichier (EOF) prématuré lors de la recherche du « %c » " +"correspondant" + +#: parse.y:4170 +msgid "unexpected EOF while looking for `]]'" +msgstr "" +"caractère de fin de fichier (EOF) prématuré lors de la recherche de « ]] »" + +#: parse.y:4175 +#, c-format +msgid "syntax error in conditional expression: unexpected token `%s'" +msgstr "" +"erreur de syntaxe dans une expression conditionnelle : symbole « %s » " +"inattendu" + +#: parse.y:4179 +msgid "syntax error in conditional expression" +msgstr "erreur de syntaxe dans une expression conditionnelle" + +#: parse.y:4257 +#, c-format +msgid "unexpected token `%s', expected `)'" +msgstr "symbole inattendu « %s » au lieu de « ) »" + +#: parse.y:4261 +msgid "expected `)'" +msgstr "« ) » attendu" + +#: parse.y:4289 +#, c-format +msgid "unexpected argument `%s' to conditional unary operator" +msgstr "argument inattendu « %s » pour l'opérateur conditionnel à un argument" + +#: parse.y:4293 +msgid "unexpected argument to conditional unary operator" +msgstr "argument inattendu pour l'opérateur conditionnel à un argument" + +#: parse.y:4339 +#, c-format +msgid "unexpected token `%s', conditional binary operator expected" +msgstr "symbole « %s » trouvé à la place d'un opérateur binaire conditionnel" + +#: parse.y:4343 +msgid "conditional binary operator expected" +msgstr "opérateur binaire conditionnel attendu" + +#: parse.y:4365 +#, c-format +msgid "unexpected argument `%s' to conditional binary operator" +msgstr "argument « %s » inattendu pour l'opérateur binaire conditionnel" + +#: parse.y:4369 +msgid "unexpected argument to conditional binary operator" +msgstr "argument inattendu pour l'opérateur binaire conditionnel" + +#: parse.y:4380 +#, c-format +msgid "unexpected token `%c' in conditional command" +msgstr "symbole « %c » inattendu dans la commande conditionnelle" + +#: parse.y:4383 +#, c-format +msgid "unexpected token `%s' in conditional command" +msgstr "symbole « %s » inattendu dans la commande conditionnelle" + +#: parse.y:4387 +#, c-format +msgid "unexpected token %d in conditional command" +msgstr "symbole « %d » inattendu dans la commande conditionnelle" + +#: parse.y:5737 +#, c-format +msgid "syntax error near unexpected token `%s'" +msgstr "erreur de syntaxe près du symbole inattendu « %s »" + +#: parse.y:5755 +#, c-format +msgid "syntax error near `%s'" +msgstr "erreur de syntaxe près de « %s »" + +#: parse.y:5765 +msgid "syntax error: unexpected end of file" +msgstr "erreur de syntaxe : fin de fichier prématurée" + +#: parse.y:5765 +msgid "syntax error" +msgstr "erreur de syntaxe" + +#: parse.y:5827 +#, c-format +msgid "Use \"%s\" to leave the shell.\n" +msgstr "Utilisez « %s » pour quitter le shell.\n" + +#: parse.y:5989 +msgid "unexpected EOF while looking for matching `)'" +msgstr "" +"caractère de fin de fichier (EOF) prématuré lors de la recherche d'un « ) » " +"correspondant" + +#: pcomplete.c:1094 +#, c-format +msgid "completion: function `%s' not found" +msgstr "complètement : fonction « %s » non trouvée" + +#: pcomplib.c:182 +#, c-format +msgid "progcomp_insert: %s: NULL COMPSPEC" +msgstr "progcomp_insert : %s : NULL COMPSPEC" + +#: print_cmd.c:300 +#, c-format +msgid "print_command: bad connector `%d'" +msgstr "print_command : mauvais connecteur « %d »" + +#: print_cmd.c:373 +#, c-format +msgid "xtrace_set: %d: invalid file descriptor" +msgstr "xtrace_set : %d : descripteur de fichier non valable" + +#: print_cmd.c:378 +msgid "xtrace_set: NULL file pointer" +msgstr "xtrace_set : pointeur de fichier NULL" + +#: print_cmd.c:382 +#, c-format +msgid "xtrace fd (%d) != fileno xtrace fp (%d)" +msgstr "xtrace fd (%d) != fileno xtrace fp (%d)" + +#: print_cmd.c:1518 +#, c-format +msgid "cprintf: `%c': invalid format character" +msgstr "cprintf : « %c » : caractère de format invalide" + +#: redir.c:123 redir.c:170 +msgid "file descriptor out of range" +msgstr "descripteur de fichier hors plage" + +#: redir.c:177 +#, c-format +msgid "%s: ambiguous redirect" +msgstr "%s : redirection ambiguë" + +#: redir.c:181 +#, c-format +msgid "%s: cannot overwrite existing file" +msgstr "%s : impossible d'écraser le fichier existant" + +#: redir.c:186 +#, c-format +msgid "%s: restricted: cannot redirect output" +msgstr "%s : restreint : impossible de rediriger la sortie" + +#: redir.c:191 +#, c-format +msgid "cannot create temp file for here-document: %s" +msgstr "" +"impossible de créer un fichier temporaire pour le « here-document » : %s" + +#: redir.c:195 +#, c-format +msgid "%s: cannot assign fd to variable" +msgstr "%s : impossible d'affecter le descripteur de fichier à la variable" + +#: redir.c:582 +msgid "/dev/(tcp|udp)/host/port not supported without networking" +msgstr "/dev/(tcp|udp)/host/port non pris en charge sans réseau" + +#: redir.c:861 redir.c:973 redir.c:1034 redir.c:1199 +msgid "redirection error: cannot duplicate fd" +msgstr "" +"erreur de redirection : impossible de dupliquer le descripteur de fichier" + +#: shell.c:339 +msgid "could not find /tmp, please create!" +msgstr "« /tmp » introuvable, veuillez le créer !" + +#: shell.c:343 +msgid "/tmp must be a valid directory name" +msgstr "« /tmp » doit être un nom de répertoire correct" + +#: shell.c:890 +#, c-format +msgid "%c%c: invalid option" +msgstr "%c%c : option non valable" + +#: shell.c:1682 +msgid "I have no name!" +msgstr "Je n'ai pas de nom !" + +#: shell.c:1827 +#, c-format +msgid "GNU bash, version %s-(%s)\n" +msgstr "GNU bash, version %s-(%s)\n" + +#: shell.c:1828 +#, c-format +msgid "" +"Usage:\t%s [GNU long option] [option] ...\n" +"\t%s [GNU long option] [option] script-file ...\n" +msgstr "" +"Utilisation :\t%s [option longue GNU] [option] ...\n" +"\t%s [option longue GNU] [option] fichier-script ...\n" + +#: shell.c:1830 +msgid "GNU long options:\n" +msgstr "Options longues GNU :\n" + +#: shell.c:1834 +msgid "Shell options:\n" +msgstr "Options du shell :\n" + +#: shell.c:1835 +#, fuzzy +msgid "\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n" +msgstr "\t-irsD ou -c commande ou -O shopt_option\t\t(invocation seulement)\n" + +#: shell.c:1850 +#, c-format +msgid "\t-%s or -o option\n" +msgstr "\t-%s ou -o option\n" + +#: shell.c:1856 +#, c-format +msgid "Type `%s -c \"help set\"' for more information about shell options.\n" +msgstr "" +"Pour en savoir plus sur les options du shell, saisissez « %s -c \"help set\" " +"».\n" + +#: shell.c:1857 +#, c-format +msgid "Type `%s -c help' for more information about shell builtin commands.\n" +msgstr "" +"Pour en savoir plus sur les primitives du shell, saisissez « %s -c help ».\n" + +#: shell.c:1858 +#, c-format +msgid "Use the `bashbug' command to report bugs.\n" +msgstr "Utilisez la commande « bashbug » pour faire un rapport de bogue.\n" + +#: sig.c:691 +#, c-format +msgid "sigprocmask: %d: invalid operation" +msgstr "sigprocmask : %d : operation non valable" + +#: siglist.c:48 +msgid "Bogus signal" +msgstr "Signal falsifié" + +#: siglist.c:51 +msgid "Hangup" +msgstr "Raccroche" + +#: siglist.c:55 +msgid "Interrupt" +msgstr "Interrompt" + +#: siglist.c:59 +msgid "Quit" +msgstr "Quitte" + +#: siglist.c:63 +msgid "Illegal instruction" +msgstr "Instruction incorrecte" + +#: siglist.c:67 +msgid "BPT trace/trap" +msgstr "trace/trap BPT" + +#: siglist.c:75 +msgid "ABORT instruction" +msgstr "Instruction ABORT" + +#: siglist.c:79 +msgid "EMT instruction" +msgstr "Instruction EMT" + +#: siglist.c:83 +msgid "Floating point exception" +msgstr "Exception en virgule flottante" + +#: siglist.c:87 +msgid "Killed" +msgstr "Tué" + +#: siglist.c:91 +msgid "Bus error" +msgstr "Erreur de bus" + +#: siglist.c:95 +msgid "Segmentation fault" +msgstr "Erreur de segmentation" + +#: siglist.c:99 +msgid "Bad system call" +msgstr "Mauvais appel système" + +#: siglist.c:103 +msgid "Broken pipe" +msgstr "Tube brisé" + +#: siglist.c:107 +msgid "Alarm clock" +msgstr "Horloge d'alarme" + +#: siglist.c:111 +msgid "Terminated" +msgstr "Terminé" + +#: siglist.c:115 +msgid "Urgent IO condition" +msgstr "Condition d'E/S urgente" + +#: siglist.c:119 +msgid "Stopped (signal)" +msgstr "Stoppé (signal)" + +#: siglist.c:127 +msgid "Continue" +msgstr "Continue" + +#: siglist.c:135 +msgid "Child death or stop" +msgstr "Mort ou arrêt du fils" + +#: siglist.c:139 +msgid "Stopped (tty input)" +msgstr "Stoppé (entrée tty)" + +#: siglist.c:143 +msgid "Stopped (tty output)" +msgstr "Stoppé (sortie tty)" + +#: siglist.c:147 +msgid "I/O ready" +msgstr "E/S prête" + +#: siglist.c:151 +msgid "CPU limit" +msgstr "Limite CPU" + +#: siglist.c:155 +msgid "File limit" +msgstr "Limite fichier" + +#: siglist.c:159 +msgid "Alarm (virtual)" +msgstr "Alarme (virtual)" + +#: siglist.c:163 +msgid "Alarm (profile)" +msgstr "Alarme (profile)" + +#: siglist.c:167 +msgid "Window changed" +msgstr "Fenêtre changée" + +#: siglist.c:171 +msgid "Record lock" +msgstr "Verrou d'enregistrement" + +#: siglist.c:175 +msgid "User signal 1" +msgstr "Signal utilisateur 1" + +#: siglist.c:179 +msgid "User signal 2" +msgstr "Signal utilisateur 2" + +#: siglist.c:183 +msgid "HFT input data pending" +msgstr "données d'entrée HFT en attente" + +#: siglist.c:187 +msgid "power failure imminent" +msgstr "coupure d'alimentation imminente" + +#: siglist.c:191 +msgid "system crash imminent" +msgstr "panne système imminente" + +#: siglist.c:195 +msgid "migrate process to another CPU" +msgstr "migration processus vers un autre CPU" + +#: siglist.c:199 +msgid "programming error" +msgstr "Erreur de programmation" + +#: siglist.c:203 +msgid "HFT monitor mode granted" +msgstr "Mode de surveillance HFT accordé" + +#: siglist.c:207 +msgid "HFT monitor mode retracted" +msgstr "Mode de surveillance HFT rétracté" + +#: siglist.c:211 +msgid "HFT sound sequence has completed" +msgstr "Séquence de son HFT terminée" + +#: siglist.c:215 +msgid "Information request" +msgstr "Demande d'information" + +#: siglist.c:223 +msgid "Unknown Signal #" +msgstr "N° de signal inconnu" + +#: siglist.c:225 +#, c-format +msgid "Unknown Signal #%d" +msgstr "Signal n°%d inconnu" + +#: subst.c:1362 subst.c:1520 +#, c-format +msgid "bad substitution: no closing `%s' in %s" +msgstr "Mauvaise substitution : pas de « %s » de fermeture dans %s" + +#: subst.c:2847 +#, c-format +msgid "%s: cannot assign list to array member" +msgstr "%s : impossible d'affecter une liste à un élément de tableau" + +#: subst.c:5065 subst.c:5081 +msgid "cannot make pipe for process substitution" +msgstr "impossible de fabriquer un tube pour une substitution de processus" + +#: subst.c:5113 +msgid "cannot make child for process substitution" +msgstr "impossible de fabriquer un fils pour une substitution de processus" + +#: subst.c:5158 +#, c-format +msgid "cannot open named pipe %s for reading" +msgstr "impossible d'ouvrir le tube nommé « %s » en lecture" + +#: subst.c:5160 +#, c-format +msgid "cannot open named pipe %s for writing" +msgstr "impossible d'ouvrir le tube nommé « %s » en écriture" + +#: subst.c:5178 +#, c-format +msgid "cannot duplicate named pipe %s as fd %d" +msgstr "impossible de dupliquer le tube nommé « %s » vers le fd %d" + +#: subst.c:5376 +msgid "cannot make pipe for command substitution" +msgstr "impossible de fabriquer un tube pour une substitution de commande" + +#: subst.c:5414 +msgid "cannot make child for command substitution" +msgstr "" +"impossible de fabriquer un processus fils pour une substitution de commande" + +#: subst.c:5433 +msgid "command_substitute: cannot duplicate pipe as fd 1" +msgstr "command_substitute : impossible de dupliquer le tube vers le fd 1" + +#: subst.c:5837 subst.c:8050 +#, fuzzy, c-format +msgid "%s: invalid variable name for name reference" +msgstr "%s : %s : valeur non valable pour un descripteur de fichier de trace" + +#: subst.c:6048 +#, c-format +msgid "%s: parameter null or not set" +msgstr "%s : paramètre vide ou non défini" + +#: subst.c:6320 subst.c:6335 +#, c-format +msgid "%s: substring expression < 0" +msgstr "%s : expression de sous-chaîne négative" + +#: subst.c:7506 +#, c-format +msgid "%s: bad substitution" +msgstr "%s : mauvaise substitution" + +#: subst.c:7583 +#, c-format +msgid "$%s: cannot assign in this way" +msgstr "$%s : affectation impossible de cette façon" + +#: subst.c:7917 +msgid "" +"future versions of the shell will force evaluation as an arithmetic " +"substitution" +msgstr "" +"Les versions futures du shell forceront l'évaluation comme une substitution " +"arithmétique" + +#: subst.c:8421 +#, c-format +msgid "bad substitution: no closing \"`\" in %s" +msgstr "Mauvais remplacement : pas de « ` » de fermeture dans %s" + +#: subst.c:9322 +#, c-format +msgid "no match: %s" +msgstr "pas de correspondance : %s" + +#: test.c:147 +msgid "argument expected" +msgstr "argument attendu" + +#: test.c:156 +#, c-format +msgid "%s: integer expression expected" +msgstr "%s : nombre entier attendu comme expression" + +#: test.c:264 +msgid "`)' expected" +msgstr "« ) » attendue" + +#: test.c:266 +#, c-format +msgid "`)' expected, found %s" +msgstr "« ) » attendu au lieu de %s" + +#: test.c:281 test.c:742 test.c:745 +#, c-format +msgid "%s: unary operator expected" +msgstr "%s : opérateur unaire attendu" + +#: test.c:468 test.c:785 +#, c-format +msgid "%s: binary operator expected" +msgstr "%s : opérateur binaire attendu" + +#: test.c:860 +msgid "missing `]'" +msgstr "« ] » manquant" + +#: trap.c:217 +msgid "invalid signal number" +msgstr "numéro de signal non valable" + +#: trap.c:371 +#, c-format +msgid "run_pending_traps: bad value in trap_list[%d]: %p" +msgstr "run_pending_traps : mauvaise valeur dans trap_list[%d] : %p" + +#: trap.c:375 +#, c-format +msgid "" +"run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" +msgstr "" +"run_pending_traps : le gestionnaire de signal est SIG_DFL, %d (%s) renvoyé à " +"moi-même" + +#: trap.c:428 +#, c-format +msgid "trap_handler: bad signal %d" +msgstr "trap_handler : mauvais signal %d" + +#: variables.c:382 +#, c-format +msgid "error importing function definition for `%s'" +msgstr "erreur lors de l'import de la définition de fonction pour « %s »" + +#: variables.c:780 +#, c-format +msgid "shell level (%d) too high, resetting to 1" +msgstr "niveau de shell trop élevé (%d), initialisation à 1" + +#: variables.c:1865 +#, fuzzy, c-format +msgid "%s: circular name reference" +msgstr "%s : %s : valeur non valable pour un descripteur de fichier de trace" + +#: variables.c:2228 +msgid "make_local_variable: no function context at current scope" +msgstr "" +"make_local_variable : aucun contexte de fonction dans le champ d'application " +"actuel" + +#: variables.c:2247 +#, fuzzy, c-format +msgid "%s: variable may not be assigned value" +msgstr "%s : impossible d'affecter le descripteur de fichier à la variable" + +#: variables.c:3646 +msgid "all_local_variables: no function context at current scope" +msgstr "" +"all_local_variables : aucun contexte de fonction dans le champ d'application " +"actuel" + +#: variables.c:3891 +#, c-format +msgid "%s has null exportstr" +msgstr "%s a un « exportstr » vide" + +#: variables.c:3896 variables.c:3905 +#, c-format +msgid "invalid character %d in exportstr for %s" +msgstr "caractère %d non valable dans « exportstr » pour %s" + +#: variables.c:3911 +#, c-format +msgid "no `=' in exportstr for %s" +msgstr "Pas de « = » dans « exportstr » pour %s" + +#: variables.c:4344 +msgid "pop_var_context: head of shell_variables not a function context" +msgstr "" +"pop_var_context : le début de « shell_variables » n'est pas un contexte de " +"fonction" + +#: variables.c:4357 +msgid "pop_var_context: no global_variables context" +msgstr "pop_var_context : aucun contexte à « global_variables »" + +#: variables.c:4431 +msgid "pop_scope: head of shell_variables not a temporary environment scope" +msgstr "" +"pop_scope : le début de « shell_variables » n'est pas un champ d'application " +"temporaire d'environnement" + +#: variables.c:5257 +#, c-format +msgid "%s: %s: cannot open as FILE" +msgstr "%s : %s : impossible d'ouvrir comme FILE" + +#: variables.c:5262 +#, c-format +msgid "%s: %s: invalid value for trace file descriptor" +msgstr "%s : %s : valeur non valable pour un descripteur de fichier de trace" + +#: variables.c:5307 +#, fuzzy, c-format +msgid "%s: %s: compatibility value out of range" +msgstr "%s : %s hors plage" + +#: version.c:46 +#, fuzzy +msgid "Copyright (C) 2013 Free Software Foundation, Inc." +msgstr "Copyright (C) 2011 Free Software Foundation, Inc." + +#: version.c:47 version2.c:47 +msgid "" +"License GPLv3+: GNU GPL version 3 or later \n" +msgstr "" +"Licence GPLv3+ : GNU GPL version 3 ou ultérieure \n" + +#: version.c:86 version2.c:86 +#, c-format +msgid "GNU bash, version %s (%s)\n" +msgstr "GNU bash, version %s (%s)\n" + +#: version.c:91 version2.c:91 +#, fuzzy +msgid "This is free software; you are free to change and redistribute it." +msgstr "" +"Ceci est un logiciel libre ; vous être libre de le modifier et de le " +"redistribuer.\n" + +#: version.c:92 version2.c:92 +#, fuzzy +msgid "There is NO WARRANTY, to the extent permitted by law." +msgstr "" +"Aucune garantie n'est fournie, dans la mesure de ce que la loi autorise.\n" + +#: version2.c:46 +#, fuzzy +msgid "Copyright (C) 2012 Free Software Foundation, Inc." +msgstr "Copyright (C) 2011 Free Software Foundation, Inc." + +#: xmalloc.c:91 +#, c-format +msgid "%s: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "%s : impossible d'allouer %lu octets (%lu octets alloués)" + +#: xmalloc.c:93 +#, c-format +msgid "%s: cannot allocate %lu bytes" +msgstr "%s : impossible d'allouer %lu octets" + +#: xmalloc.c:163 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "%s : %s:%d : impossible d'allouer %lu octets (%lu octets alloués)" + +#: xmalloc.c:165 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes" +msgstr "%s : %s:%d : impossible d'allouer %lu octets" + +#: builtins.c:43 +msgid "alias [-p] [name[=value] ... ]" +msgstr "alias [-p] [nom[=valeur] ... ]" + +#: builtins.c:47 +msgid "unalias [-a] name [name ...]" +msgstr "unalias [-a] nom [nom ...]" + +#: builtins.c:51 +#, fuzzy +msgid "" +"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-" +"x keyseq:shell-command] [keyseq:readline-function or readline-command]" +msgstr "" +"bind [-lpvsPVS] [-m keymap] [-f nomfichier] [-q nom] [-u nom] [-r seqtouche] " +"[-x seqtouche:commande-shell] [seqtouche:fonction-readline ou commande-" +"readline]" + +#: builtins.c:54 +msgid "break [n]" +msgstr "break [n]" + +#: builtins.c:56 +msgid "continue [n]" +msgstr "continue [n]" + +#: builtins.c:58 +msgid "builtin [shell-builtin [arg ...]]" +msgstr "builtin [shell-builtin [arg ...]]" + +#: builtins.c:61 +msgid "caller [expr]" +msgstr "caller [expr]" + +#: builtins.c:64 +#, fuzzy +msgid "cd [-L|[-P [-e]] [-@]] [dir]" +msgstr "cd [-L|[-P [-e]]] [rép]" + +#: builtins.c:66 +msgid "pwd [-LP]" +msgstr "pwd [-LP]" + +#: builtins.c:68 +msgid ":" +msgstr ":" + +#: builtins.c:70 +msgid "true" +msgstr "true" + +#: builtins.c:72 +msgid "false" +msgstr "false" + +#: builtins.c:74 +msgid "command [-pVv] command [arg ...]" +msgstr "command [-pVv] commande [arg ...]" + +#: builtins.c:76 +#, fuzzy +msgid "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" +msgstr "declare [-aAfFgilrtux] [-p] [nom[=valeur] ...]" + +#: builtins.c:78 +msgid "typeset [-aAfFgilrtux] [-p] name[=value] ..." +msgstr "typeset [-aAfFgilrtux] [-p] nom[=valeur] ..." + +#: builtins.c:80 +msgid "local [option] name[=value] ..." +msgstr "local [option] nom[=valeur] ..." + +#: builtins.c:83 +msgid "echo [-neE] [arg ...]" +msgstr "echo [-neE] [arg ...]" + +#: builtins.c:87 +msgid "echo [-n] [arg ...]" +msgstr "echo [-n] [arg ...]" + +#: builtins.c:90 +msgid "enable [-a] [-dnps] [-f filename] [name ...]" +msgstr "enable [-a] [-dnps] [-f nomfichier] [nom ...]" + +#: builtins.c:92 +msgid "eval [arg ...]" +msgstr "eval [arg ...]" + +#: builtins.c:94 +msgid "getopts optstring name [arg]" +msgstr "getopts chaineopts nom [arg]" + +#: builtins.c:96 +msgid "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" +msgstr "exec [-cl] [-a nom] [commande [arguments ...]] [redirection ...]" + +#: builtins.c:98 +msgid "exit [n]" +msgstr "exit [n]" + +#: builtins.c:100 +msgid "logout [n]" +msgstr "logout [n]" + +#: builtins.c:103 +msgid "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" +msgstr "" +"fc [-e ename] [-lnr] [premier] [dernier] ou fc -s [ancien=nouveau] [commande]" + +#: builtins.c:107 +msgid "fg [job_spec]" +msgstr "fg [job_spec]" + +#: builtins.c:111 +msgid "bg [job_spec ...]" +msgstr "bg [job_spec ...]" + +#: builtins.c:114 +msgid "hash [-lr] [-p pathname] [-dt] [name ...]" +msgstr "hash [-lr] [-p nomchemin] [-dt] [nom ...]" + +#: builtins.c:117 +msgid "help [-dms] [pattern ...]" +msgstr "help [-dms] [motif ...]" + +#: builtins.c:121 +msgid "" +"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg " +"[arg...]" +msgstr "" +"history [-c] [-d décalage] [n] ou history -anrw [nomfichier] ou history -ps " +"arg [arg...]" + +#: builtins.c:125 +msgid "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" +msgstr "jobs [-lnprs] [jobspec ...] ou jobs -x commande [args]" + +#: builtins.c:129 +msgid "disown [-h] [-ar] [jobspec ...]" +msgstr "disown [-h] [-ar] [jobspec ...]" + +#: builtins.c:132 +msgid "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l " +"[sigspec]" +msgstr "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... ou kill -l " +"[sigspec]" + +#: builtins.c:134 +msgid "let arg [arg ...]" +msgstr "let arg [arg ...]" + +#: builtins.c:136 +msgid "" +"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p " +"prompt] [-t timeout] [-u fd] [name ...]" +msgstr "" +"read [-ers] [-a tableau] [-d delim] [-i texte] [-n nchars] [-N nchars] [-p " +"prompt] [-t timeout] [-u fd] [nom ...]" + +#: builtins.c:138 +msgid "return [n]" +msgstr "return [n]" + +#: builtins.c:140 +msgid "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" +msgstr "set [-abefhkmnptuvxBCHP] [-o nom-option] [--] [arg ...]" + +#: builtins.c:142 +#, fuzzy +msgid "unset [-f] [-v] [-n] [name ...]" +msgstr "unset [-f] [-v] [nom ...]" + +#: builtins.c:144 +msgid "export [-fn] [name[=value] ...] or export -p" +msgstr "export [-fn] [nom[=valeur] ...] ou export -p" + +#: builtins.c:146 +msgid "readonly [-aAf] [name[=value] ...] or readonly -p" +msgstr "readonly [-aAf] [nom[=valeur] ...] ou readonly -p" + +#: builtins.c:148 +msgid "shift [n]" +msgstr "shift [n]" + +#: builtins.c:150 +msgid "source filename [arguments]" +msgstr "source nom_fichier [arguments]" + +#: builtins.c:152 +msgid ". filename [arguments]" +msgstr ". nom_fichier [arguments]" + +#: builtins.c:155 +msgid "suspend [-f]" +msgstr "suspend [-f]" + +#: builtins.c:158 +msgid "test [expr]" +msgstr "test [expr]" + +#: builtins.c:160 +msgid "[ arg... ]" +msgstr "[ arg... ]" + +#: builtins.c:162 +msgid "times" +msgstr "times" + +#: builtins.c:164 +msgid "trap [-lp] [[arg] signal_spec ...]" +msgstr "trap [-lp] [[arg] signal_spec ...]" + +#: builtins.c:166 +msgid "type [-afptP] name [name ...]" +msgstr "type [-afptP] nom [nom ...]" + +#: builtins.c:169 +#, fuzzy +msgid "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" +msgstr "ulimit [-SHacdefilmnpqrstuvx] [limite]" + +#: builtins.c:172 +msgid "umask [-p] [-S] [mode]" +msgstr "umask [-p] [-S] [mode]" + +#: builtins.c:175 +#, fuzzy +msgid "wait [-n] [id ...]" +msgstr "wait [id]" + +#: builtins.c:179 +#, fuzzy +msgid "wait [pid ...]" +msgstr "wait [pid]" + +#: builtins.c:182 +msgid "for NAME [in WORDS ... ] ; do COMMANDS; done" +msgstr "for NOM [in MOTS ... ] ; do COMMANDES; done" + +#: builtins.c:184 +msgid "for (( exp1; exp2; exp3 )); do COMMANDS; done" +msgstr "for (( exp1; exp2; exp3 )); do COMMANDES; done" + +#: builtins.c:186 +msgid "select NAME [in WORDS ... ;] do COMMANDS; done" +msgstr "select NOM [in MOTS ... ;] do COMMANDES; done" + +#: builtins.c:188 +msgid "time [-p] pipeline" +msgstr "time [-p] pipeline" + +#: builtins.c:190 +msgid "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" +msgstr "case MOT in [MOTIF [| MOTIF]...) COMMANDES ;;]... esac" + +#: builtins.c:192 +msgid "" +"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else " +"COMMANDS; ] fi" +msgstr "" +"if COMMANDES; then COMMANDES; [ elif COMMANDES; then COMMANDES; ]... [ else " +"COMMANDES; ] fi" + +#: builtins.c:194 +msgid "while COMMANDS; do COMMANDS; done" +msgstr "while COMMANDES; do COMMANDES; done" + +#: builtins.c:196 +msgid "until COMMANDS; do COMMANDS; done" +msgstr "until COMMANDES; do COMMANDES; done" + +#: builtins.c:198 +msgid "coproc [NAME] command [redirections]" +msgstr "coproc [NOM] commande [redirections]" + +#: builtins.c:200 +msgid "function name { COMMANDS ; } or name () { COMMANDS ; }" +msgstr "function nom { COMMANDES ; } ou nom () { COMMANDES ; }" + +#: builtins.c:202 +msgid "{ COMMANDS ; }" +msgstr "{ COMMANDES ; }" + +#: builtins.c:204 +msgid "job_spec [&]" +msgstr "job_spec [&]" + +#: builtins.c:206 +msgid "(( expression ))" +msgstr "(( expression ))" + +#: builtins.c:208 +msgid "[[ expression ]]" +msgstr "[[ expression ]]" + +#: builtins.c:210 +msgid "variables - Names and meanings of some shell variables" +msgstr "variables - Nom et signification de certaines variables du shell" + +#: builtins.c:213 +msgid "pushd [-n] [+N | -N | dir]" +msgstr "pushd [-n] [+N | -N | rép]" + +#: builtins.c:217 +msgid "popd [-n] [+N | -N]" +msgstr "popd [-n] [+N | -N]" + +#: builtins.c:221 +msgid "dirs [-clpv] [+N] [-N]" +msgstr "dirs [-clpv] [+N] [-N]" + +#: builtins.c:224 +msgid "shopt [-pqsu] [-o] [optname ...]" +msgstr "shopt [-pqsu] [-o] [nom_opt ...]" + +#: builtins.c:226 +msgid "printf [-v var] format [arguments]" +msgstr "printf [-v var] format [arguments]" + +#: builtins.c:229 +msgid "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-" +"W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S " +"suffix] [name ...]" +msgstr "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G motif_glob] " +"[-W liste_mots] [-F fonction] [-C commande] [-X motif_filtre] [-P prefixe] " +"[-S suffixe] [nom ...]" + +#: builtins.c:233 +msgid "" +"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " +"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" +msgstr "" +"compgen [-abcdefgjksuv] [-o option] [-A action] [-G motif_glob] [-W " +"liste_mots] [-F fonction] [-C commande] [-X motif_filtre] [-P prefixe] [-S " +"suffixe] [mot]" + +#: builtins.c:237 +msgid "compopt [-o|+o option] [-DE] [name ...]" +msgstr "compopt [-o|+o option] [-DE] [nom ...]" + +#: builtins.c:240 +msgid "" +"mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" +"mapfile [-n nombre] [-O origine] [-s nombre] [-t] [-u fd] [-C callback] [-c " +"quantum] [tableau]" + +#: builtins.c:242 +msgid "" +"readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" +"readarray [-n nombre] [-O origine] [-s nombre] [-t] [-u fd] [-C callback] [-" +"c quantum] [tableau]" + +#: builtins.c:254 +msgid "" +"Define or display aliases.\n" +" \n" +" Without arguments, `alias' prints the list of aliases in the reusable\n" +" form `alias NAME=VALUE' on standard output.\n" +" \n" +" Otherwise, an alias is defined for each NAME whose VALUE is given.\n" +" A trailing space in VALUE causes the next word to be checked for\n" +" alias substitution when the alias is expanded.\n" +" \n" +" Options:\n" +" -p\tPrint all defined aliases in a reusable format\n" +" \n" +" Exit Status:\n" +" alias returns true unless a NAME is supplied for which no alias has " +"been\n" +" defined." +msgstr "" +"Définit ou affiche des alias.\n" +" \n" +" Sans argument, « alias » affiche la liste des alias avec le format " +"réutilisable\n" +" « alias NOM=VALEUR » sur la sortie standard.\n" +" \n" +" Sinon, un alias est défini pour chaque NOM dont la VALEUR est donnée.\n" +" Une espace à la fin de la VALEUR entraine le remplacement d'alias dans " +"le mot\n" +" suivant, lorsque l'alias est développé.\n" +" \n" +" Options :\n" +" -p\tAfficher tous les alias actuels dans un format réutilisable\n" +" \n" +" Code de sortie :\n" +" « alias » renvoie la valeur vraie à moins que NOM ne soit fourni et que " +"celui-ci n'aie\n" +" pas d'alias." + +#: builtins.c:276 +msgid "" +"Remove each NAME from the list of defined aliases.\n" +" \n" +" Options:\n" +" -a\tremove all alias definitions.\n" +" \n" +" Return success unless a NAME is not an existing alias." +msgstr "" +"Enlève chaque NOM de la liste des alias actuels.\n" +" \n" +" Options :\n" +" -a\tretire toutes les définitions d'alias.\n" +" \n" +" Renvoie le code de succès à moins que NOM ne soit pas un alias existant." + +#: builtins.c:289 +#, fuzzy +msgid "" +"Set Readline key bindings and variables.\n" +" \n" +" Bind a key sequence to a Readline function or a macro, or set a\n" +" Readline variable. The non-option argument syntax is equivalent to\n" +" that found in ~/.inputrc, but must be passed as a single argument:\n" +" e.g., bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Options:\n" +" -m keymap Use KEYMAP as the keymap for the duration of this\n" +" command. Acceptable keymap names are emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" +"move,\n" +" vi-command, and vi-insert.\n" +" -l List names of functions.\n" +" -P List function names and bindings.\n" +" -p List functions and bindings in a form that can be\n" +" reused as input.\n" +" -S List key sequences that invoke macros and their " +"values\n" +" -s List key sequences that invoke macros and their " +"values\n" +" in a form that can be reused as input.\n" +" -V List variable names and values\n" +" -v List variable names and values in a form that can\n" +" be reused as input.\n" +" -q function-name Query about which keys invoke the named function.\n" +" -u function-name Unbind all keys which are bound to the named " +"function.\n" +" -r keyseq Remove the binding for KEYSEQ.\n" +" -f filename Read key bindings from FILENAME.\n" +" -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when\n" +" \t\t\t\tKEYSEQ is entered.\n" +" -X\t\t List key sequences bound with -x and associated commands\n" +" in a form that can be reused as input.\n" +" \n" +" Exit Status:\n" +" bind returns 0 unless an unrecognized option is given or an error occurs." +msgstr "" +"Définit les associations de touches et les variables de « Readline ».\n" +" \n" +" Associe une séquence de touches à une fonction « Readline » ou définit " +"une\n" +" variable « Readline ». Les arguments non-options suivent une syntaxe " +"équivalente à celle\n" +" du fichier ~/.inputrc, mais doivent être transmis comme arguments " +"uniques :\n" +" ex : bind '\"\\C-x\\C-r\" : re-read-init-file'.\n" +" Options :\n" +" -m keymap Utilise KEYMAP comme mappage clavier pendant la\n" +" durée de cette commande. Des noms de mappage " +"valables sont « emacs », « emacs-standard », « emacs-" +"meta », \n" +" « emacs-ctlx », « vi », « vi-move », « vi-command » " +"et\n" +" « vi-insert ».\n" +" -l Affiche les noms de fonctions.\n" +" -P Affiche les noms et associations des fonctions.\n" +" -p Affiche les fonctions et associations dans une " +"forme qui\n" +" peut être réutilisée comme entrée.\n" +" -S Affiche les séquences de touches qui invoquent des " +"macros,\n" +" et leurs valeurs.\n" +" -s Affiche les séquences de touches qui invoquent des " +"macros,\n" +" et leurs valeurs sous une forme qui peut être " +"utilisée comme entrée. -r seqtouche Enlève l'association pour " +"« seqtouche ».\n" +" -V Affiche les noms et valeurs des variables\n" +" -v Affiche les noms et valeurs des variables dans une " +"forme qui peut\n" +" être réutilisée comme entrée.\n" +" -q nom-fonction Permet de savoir quelles touches appellent la " +"fonction.\n" +" -u nom-fonction Enlève toutes les associations de touches liée à la " +"fonction.\n" +" -r seqtouches Supprime l'association pour SEQTOUCHES.\n" +" -f nomfichier Lit l'association de touches depuis NOMFICHIER.\n" +" -x seqtouche:commande-shell\tEntraîne l'exécution de la commande-" +"shell\n" +" \t\t\t\tlorsque « seqtouche » est entrée.\n" +" \n" +" Code de sortie :\n" +" « bind » renvoie 0 à moins qu'une option non reconnue ne soit donnée " +"ou qu'une erreur ne survienne." + +#: builtins.c:328 +msgid "" +"Exit for, while, or until loops.\n" +" \n" +" Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n" +" loops.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Sort des boucles for, while, ou until.\n" +" \n" +" Sort d'une boucle FOR, WHILE ou UNTIL. Si N est spécifié, sort de N " +"boucles\n" +" imbriquées.\n" +" \n" +" Code de retour :\n" +" Le code de retour est 0 à moins que N ne soit pas supérieur ou égal à 1." + +#: builtins.c:340 +msgid "" +"Resume for, while, or until loops.\n" +" \n" +" Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n" +" If N is specified, resumes the Nth enclosing loop.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Reprend l'exécution des boucles for, while ou until.\n" +" \n" +" Reprend l'itération suivante de la boucle FOR, WHILE ou UNTIL de niveau " +"supérieur.\n" +" Si N est précisé, reprend à N-ième boucle supérieure.\n" +" \n" +" Code de sortie :\n" +" Le code de sortie est 0 à moins que N ne soit pas supérieur ou égale à 1." + +#: builtins.c:352 +msgid "" +"Execute shell builtins.\n" +" \n" +" Execute SHELL-BUILTIN with arguments ARGs without performing command\n" +" lookup. This is useful when you wish to reimplement a shell builtin\n" +" as a shell function, but need to execute the builtin within the " +"function.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n" +" not a shell builtin.." +msgstr "" +"Exécute des commandes shell intégrées.\n" +" \n" +" Exécute SHELL-BUILTIN avec les arguments ARGs sans effectuer de " +"recherche\n" +" de commande. Ceci est utile lorsque vous souhaitez remplacer une " +"commande\n" +" intégrée par une fonction shell, mais nécessite d'exécuter la commande " +"intégrée\n" +" dans la fonction.\n" +" \n" +" Code de retour :\n" +" Renvoie le code de retour de SHELL-BUILTIN, ou false si SHELL-BUILTIN " +"n'est\n" +" pas une commande intégrée.." + +#: builtins.c:367 +msgid "" +"Return the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns \"$line $filename\". With EXPR, returns\n" +" \"$line $subroutine $filename\"; this extra information can be used to\n" +" provide a stack trace.\n" +" \n" +" The value of EXPR indicates how many call frames to go back before the\n" +" current one; the top frame is frame 0.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless the shell is not executing a shell function or EXPR\n" +" is invalid." +msgstr "" +"Renvoie le contexte de l'appel de sous-routine actuel.\n" +" \n" +" Sans EXPR, renvoie « $ligne $nomfichier ». Avec EXPR,\n" +" renvoie « $ligne $sousroutine $nomfichier »; ces informations " +"supplémentaires\n" +" peuvent être utilisées pour fournir une trace de la pile.\n" +" \n" +" La valeur de EXPR indique le nombre de cadres d'appels duquel il faut " +"revenir en arrière\n" +" avant le cadre actuel ; le cadre supérieur est le cadre 0.\n" +" \n" +" Code de sortie :\n" +" Renvoie 0 à moins que le shell ne soit pas en train d'exécuter une " +"fonction ou que EXPR\n" +" ne soit pas valable." + +#: builtins.c:385 +#, fuzzy +msgid "" +"Change the shell working directory.\n" +" \n" +" Change the current directory to DIR. The default DIR is the value of " +"the\n" +" HOME shell variable.\n" +" \n" +" The variable CDPATH defines the search path for the directory " +"containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon " +"(:).\n" +" A null directory name is the same as the current directory. If DIR " +"begins\n" +" with a slash (/), then CDPATH is not used.\n" +" \n" +" If the directory is not found, and the shell option `cdable_vars' is " +"set,\n" +" the word is assumed to be a variable name. If that variable has a " +"value,\n" +" its value is used for DIR.\n" +" \n" +" Options:\n" +" -L\tforce symbolic links to be followed: resolve symbolic links in\n" +" \tDIR after processing instances of `..'\n" +" -P\tuse the physical directory structure without following symbolic\n" +" \tlinks: resolve symbolic links in DIR before processing instances\n" +" \tof `..'\n" +" -e\tif the -P option is supplied, and the current working directory\n" +" \tcannot be determined successfully, exit with a non-zero status\n" +" -@ on systems that support it, present a file with extended " +"attributes\n" +" as a directory containing the file attributes\n" +" \n" +" The default is to follow symbolic links, as if `-L' were specified.\n" +" `..' is processed by removing the immediately previous pathname " +"component\n" +" back to a slash or the beginning of DIR.\n" +" \n" +" Exit Status:\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully " +"when\n" +" -P is used; non-zero otherwise." +msgstr "" +"Change le répertoire de travail du shell.\n" +" \n" +" Change le répertoire actuel vers DIR. Le répertoire DIR par défaut\n" +" est donné par la variable « $HOME ». \n" +" La variable CDPATH définit le chemin de recherche du répertoire " +"contenant\n" +" DIR. Les noms de répertoires alternatifs dans CDPATH sont séparés par un " +"deux-point « : ».\n" +" Un nom de répertoire vide est identique au répertoire actuel. Si DIR " +"commence\n" +" avec une barre oblique « / », alors CDPATH n'est pas utilisé.\n" +" \n" +" Si le répertoire n'est pas trouvé et que l'option « cdable_vars » du " +"shell est définie,\n" +" alors le mot est essayé comme nom de variable. Si la variable possède " +"une valeur,\n" +" alors cette valeur est utilisée pour DIR.\n" +" \n" +" Options :\n" +" -L\tforcer le suivi des liens symboliques.\n" +" -P\tutiliser la structure physique des répertoires sans suivre\n" +" les liens symboliques\n" +" -e\tsi l'option -P est fournie et que le répertoire de travail " +"actuel ne peut pas\n" +" \têtre déterminé avec succès, alors sortir avec un code de retour non " +"nul\n" +" \n" +" Le comportement par défaut est de suivre les liens symboliques, comme si " +"« -L » était précisé.\n" +" \n" +" Code de sortie :\n" +" Renvoie 0 si le répertoire est changé et si $PWD est correctement " +"défini\n" +" quand -P est utilisé ; sinon autre chose que 0." + +#: builtins.c:422 +msgid "" +"Print the name of the current working directory.\n" +" \n" +" Options:\n" +" -L\tprint the value of $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tprint the physical directory, without any symbolic links\n" +" \n" +" By default, `pwd' behaves as if `-L' were specified.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless an invalid option is given or the current directory\n" +" cannot be read." +msgstr "" +"Affiche le nom du répertoire de travail courant.\n" +" \n" +" Options :\n" +" -L\taffiche la valeur de $PWD s'il nomme le répertoire de travail " +"courant\n" +" \t\n" +" -P\taffiche le répertoire physique, sans aucun lien symbolique\n" +" \n" +" Par défaut, « pwd » se comporte comme si « -L » était spécifié.\n" +" \n" +" Code de retour :\n" +" Renvoie 0 à moins qu'une option non valable ne soit donnée ou que le " +"répertoire\n" +" courant ne peut pas être lu." + +#: builtins.c:439 +msgid "" +"Null command.\n" +" \n" +" No effect; the command does nothing.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Commande vide.\n" +" \n" +" Sans effet : la commande ne fait rien.\n" +" \n" +" Code de retour :\n" +" Renvoie toujours le code de succès." + +#: builtins.c:450 +msgid "" +"Return a successful result.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Renvoie un résultat de succès.\n" +" \n" +" Code de retour :\n" +" Succès." + +#: builtins.c:459 +msgid "" +"Return an unsuccessful result.\n" +" \n" +" Exit Status:\n" +" Always fails." +msgstr "" +"Renvoie un résultat d'échec.\n" +" \n" +" Code de sortie :\n" +" Toujours l'échec." + +#: builtins.c:468 +msgid "" +"Execute a simple command or display information about commands.\n" +" \n" +" Runs COMMAND with ARGS suppressing shell function lookup, or display\n" +" information about the specified COMMANDs. Can be used to invoke " +"commands\n" +" on disk when a function with the same name exists.\n" +" \n" +" Options:\n" +" -p\tuse a default value for PATH that is guaranteed to find all of\n" +" \tthe standard utilities\n" +" -v\tprint a description of COMMAND similar to the `type' builtin\n" +" -V\tprint a more verbose description of each COMMAND\n" +" \n" +" Exit Status:\n" +" Returns exit status of COMMAND, or failure if COMMAND is not found." +msgstr "" +"Exécute une simple commande ou affiche des informations sur les commandes.\n" +" \n" +" Lance la COMMANDE avec des ARGS en court-circuitant la recherche de " +"commande, ou affiche\n" +" des informations sur les COMMANDEs spécifiées. Ceci peut être utilisé " +"pour invoquer des commandes\n" +" sur le disque lorsqu'il y a conflit avec une fonction portant le même " +"nom.\n" +" \n" +" Options :\n" +" -p\tutilise une valeur par défaut pour CHEMIN qui garantit de trouver\n" +" \ttous les utilitaires standards\n" +" -v\taffiche une description de la COMMANDE similaire à la commande " +"intégrée « type »\n" +" -V\taffiche une description plus détaillées de chaque COMMANDE\n" +" \n" +" Code de retour :\n" +" Renvoie le code de sortie de la COMMANDE, ou le code d'échec si la " +"COMMANDE est introuvable." + +#: builtins.c:487 +#, fuzzy +msgid "" +"Set variable values and attributes.\n" +" \n" +" Declare variables and give them attributes. If no NAMEs are given,\n" +" display the attributes and values of all variables.\n" +" \n" +" Options:\n" +" -f\trestrict action or display to function names and definitions\n" +" -F\trestrict display to function names only (plus line number and\n" +" \tsource file when debugging)\n" +" -g\tcreate global variables when used in a shell function; otherwise\n" +" \tignored\n" +" -p\tdisplay the attributes and value of each NAME\n" +" \n" +" Options which set attributes:\n" +" -a\tto make NAMEs indexed arrays (if supported)\n" +" -A\tto make NAMEs associative arrays (if supported)\n" +" -i\tto make NAMEs have the `integer' attribute\n" +" -l\tto convert NAMEs to lower case on assignment\n" +" -n\tmake NAME a reference to the variable named by its value\n" +" -r\tto make NAMEs readonly\n" +" -t\tto make NAMEs have the `trace' attribute\n" +" -u\tto convert NAMEs to upper case on assignment\n" +" -x\tto make NAMEs export\n" +" \n" +" Using `+' instead of `-' turns off the given attribute.\n" +" \n" +" Variables with the integer attribute have arithmetic evaluation (see\n" +" the `let' command) performed when the variable is assigned a value.\n" +" \n" +" When used in a function, `declare' makes NAMEs local, as with the " +"`local'\n" +" command. The `-g' option suppresses this behavior.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or a variable\n" +" assignment error occurs." +msgstr "" +"Définit les valeurs et les attributs des variables.\n" +" \n" +" Permet de déclarer des variables et de leur donner des attributs. Si " +"aucun NOM n'est donné,\n" +" affiche les attributs et les valeurs de toutes les variables.\n" +" \n" +" Options :\n" +" -f\trestreint l'action ou l'affichage aux noms et définitions de " +"fonctions\n" +" -F\trestreint l'affichage aux noms des fonctions uniquement (avec le " +"numéro de ligne\n" +" \tet le fichier source lors du débogage)\n" +" -g\tcrée des variables globales lorsqu'utilisée dans une fonction " +"shell ; ignoré sinon\n" +" -p\taffiche les attributs et la valeur de chaque NOM\n" +" \n" +" Options qui définissent des attributs :\n" +" -a\tpour faire de NOMs des tableaux indexés (si pris en charge)\n" +" -A\tpour faire de NOMs des tableaux associatifs (si pris en charge)\n" +" -i\tpour permettre aux NOMs d'avoir l'attribut « integer »\n" +" -l\tpour convertir les NOMs an minuscule lors de l'affectation\n" +" -r\tpour mettre les NOMs en lecture seule\n" +" -t\tpour permettre aux NOMs d'avoir l'attribut « trace »\n" +" -u\tpour convertir les NOMs en majuscule lors de l'affectation\n" +" -x\tpour permettre aux NOMs de s'exporter\n" +" \n" +" Utiliser « + » au lieu de « - » permet de désactiver l'attribut donné.\n" +" \n" +" Les variables avec l'attribut « integer » ont une évaluation " +"arithmétique (voir\n" +" la commande « let ») effectuée lorsqu'un valeur est affectée à la " +"variable.\n" +" \n" +" Lorsqu'utilisée dans une fonction, « declare » permet aux NOMs d'être " +"locaux,\n" +" comme avec la commande « local ». L'option « -g » supprime ce " +"comportement.\n" +" \n" +" Code de retour :\n" +" Renvoie le code de succès à moins qu'un option non valable soit fournie " +"ou qu'une erreur ne survienne." + +#: builtins.c:527 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Obsolete. See `help declare'." +msgstr "" +"Définit des valeurs ou des attributs de variables.\n" +" \n" +" Obsolète. Essayez « help declare »." + +#: builtins.c:535 +#, fuzzy +msgid "" +"Define local variables.\n" +" \n" +" Create a local variable called NAME, and give it VALUE. OPTION can\n" +" be any option accepted by `declare'.\n" +" \n" +" Local variables can only be used within a function; they are visible\n" +" only to the function where they are defined and its children.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied, a variable\n" +" assignment error occurs, or the shell is not executing a function." +msgstr "" +"Définit des variables locales.\n" +" \n" +" Crée une variable locale nommée NOM, avec une valeur VALEUR. OPTION " +"peut\n" +" être n'importe quelle option acceptée par « declare ».\n" +" \n" +" Les variables locales peut seulement être utilisée à l'intérieur d'une " +"fonction; elles ne sont visibles\n" +" que des fonctions où elles ont été définies et dans ses fonctions " +"filles.\n" +" \n" +" Code de retour :\n" +" Renvoie le code de succès à moins qu'une option non valable ne soit " +"fournie, qu'une erreur ne survienne,\n" +" ou que l'inteprète ne soit pas dans une fonction." + +#: builtins.c:552 +#, fuzzy +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs, separated by a single space character and followed by " +"a\n" +" newline, on the standard output.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" -e\tenable interpretation of the following backslash escapes\n" +" -E\texplicitly suppress interpretation of backslash escapes\n" +" \n" +" `echo' interprets the following backslash-escaped characters:\n" +" \\a\talert (bell)\n" +" \\b\tbackspace\n" +" \\c\tsuppress further output\n" +" \\e\tescape character\n" +" \\E\tescape character\n" +" \\f\tform feed\n" +" \\n\tnew line\n" +" \\r\tcarriage return\n" +" \\t\thorizontal tab\n" +" \\v\tvertical tab\n" +" \\\\\tbackslash\n" +" \\0nnn\tthe character whose ASCII code is NNN (octal). NNN can be\n" +" \t0 to 3 octal digits\n" +" \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" +" \tcan be one or two hex digits\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Écrit les arguments sur la sortie standard.\n" +" \n" +" Affiche les ARGs sur la sortie standard, suivis d'un retour à la ligne.\n" +" \n" +" Options :\n" +" -n\tne pas ajouter de saut de ligne\n" +" -e\tactive l'interpretation des barres contre-obliques d'échappement " +"ci-dessous\n" +" -E\tsupprime explicitement l'interpretation des barres contre-obliques " +"d'échappement\n" +" \n" +" « echo » interprète les caractères suivants comme des séquences " +"d'échappement :\n" +" \\a\talerte (cloche)\n" +" \\b\tretour arrière\n" +" \\c\tsupprime caractère suivant\n" +" \\e\tcaractère Échap.\n" +" \\f\tsaut de page\n" +" \\n\tsaut de ligne\n" +" \\r\tretour chariot\n" +" \\t\ttabulation horizontale\n" +" \\v\ttabulation verticale\n" +" \\\\\tbarre contre-oblique\n" +" \\0nnn\tle caractère dont le code ASCII est NNN (en octal). NNN peut " +"être\n" +" \tlong de 0 à 3 chiffres octaux\n" +" \\xHH\tle caractère à 8 bits dont la valeur est HH (hexadecimal). HH\n" +" \tpeut être long de 1 ou 2 chiffres hexadécimaux\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de succès à moins qu'une erreur ne survienne." + +#: builtins.c:588 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs on the standard output followed by a newline.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Écrit des arguments sur la sortie standard.\n" +" \n" +" Affiche les ARGs sur la sortie standard, suivis d'un retour à la ligne.\n" +" \n" +" Options :\n" +" -n\tpas de retour à la ligne\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de succès à moins qu'une erreur ne survienne." + +#: builtins.c:603 +msgid "" +"Enable and disable shell builtins.\n" +" \n" +" Enables and disables builtin shell commands. Disabling allows you to\n" +" execute a disk command which has the same name as a shell builtin\n" +" without using a full pathname.\n" +" \n" +" Options:\n" +" -a\tprint a list of builtins showing whether or not each is enabled\n" +" -n\tdisable each NAME or display a list of disabled builtins\n" +" -p\tprint the list of builtins in a reusable format\n" +" -s\tprint only the names of Posix `special' builtins\n" +" \n" +" Options controlling dynamic loading:\n" +" -f\tLoad builtin NAME from shared object FILENAME\n" +" -d\tRemove a builtin loaded with -f\n" +" \n" +" Without options, each NAME is enabled.\n" +" \n" +" To use the `test' found in $PATH instead of the shell builtin\n" +" version, type `enable -n test'.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not a shell builtin or an error occurs." +msgstr "" +"Active et désactive les commandes intégrées.\n" +" \n" +" Active et désactive les commandes intégrées du shell. Les désactiver " +"vous permet\n" +" d'exécuter une commande du disque ayant le même nom qu'une commande du " +"shell\n" +" sans utiliser le chemin compler vers le fichier.\n" +" \n" +" Options :\n" +" -a\taffiche la liste des commandes intégrées et leur état " +"d'activation\n" +" -n\tdésactive chaque NOM ou affiche la liste des commandes " +"désactivées\n" +" -p\taffiche la liste des commandes dans un format réutilisable\n" +" -s\taffiche seulement les noms des commandes Posix de type « special " +"»\n" +" \n" +" Options contrôlant le chargement dynamique :\n" +" -f\tCharge la commande intégrée NOM depuis la bibliothèque partagée " +"FILENAME\n" +" -d\tDécharge une commande chargée avec « -f »\n" +" \n" +" S'il n'y a pas d'option, chaque commande NOM est activée.\n" +" \n" +" Pour utiliser le « test » trouvé dans $PATH au lieu de celui intégré au " +"shell,\n" +" saisissez « enable -n test ».\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de succès à moins que NOM ne soit pas une commande " +"intégrée ou qu'une erreur ne survienne." + +#: builtins.c:631 +msgid "" +"Execute arguments as a shell command.\n" +" \n" +" Combine ARGs into a single string, use the result as input to the " +"shell,\n" +" and execute the resulting commands.\n" +" \n" +" Exit Status:\n" +" Returns exit status of command or success if command is null." +msgstr "" +"Exécute des arguments comme s'ils étaient une commande du shell.\n" +" \n" +" Combine des ARGs en une chaîne unique, utilise le résultat comme entrée " +"du shell,\n" +" puis exécute la commande résultante.\n" +" \n" +" Code de sortie :\n" +" Renvoie le même code de sortie que la commande, ou le code de succès si " +"la commande est vide." + +#: builtins.c:643 +msgid "" +"Parse option arguments.\n" +" \n" +" Getopts is used by shell procedures to parse positional parameters\n" +" as options.\n" +" \n" +" OPTSTRING contains the option letters to be recognized; if a letter\n" +" is followed by a colon, the option is expected to have an argument,\n" +" which should be separated from it by white space.\n" +" \n" +" Each time it is invoked, getopts will place the next option in the\n" +" shell variable $name, initializing name if it does not exist, and\n" +" the index of the next argument to be processed into the shell\n" +" variable OPTIND. OPTIND is initialized to 1 each time the shell or\n" +" a shell script is invoked. When an option requires an argument,\n" +" getopts places that argument into the shell variable OPTARG.\n" +" \n" +" getopts reports errors in one of two ways. If the first character\n" +" of OPTSTRING is a colon, getopts uses silent error reporting. In\n" +" this mode, no error messages are printed. If an invalid option is\n" +" seen, getopts places the option character found into OPTARG. If a\n" +" required argument is not found, getopts places a ':' into NAME and\n" +" sets OPTARG to the option character found. If getopts is not in\n" +" silent mode, and an invalid option is seen, getopts places '?' into\n" +" NAME and unsets OPTARG. If a required argument is not found, a '?'\n" +" is placed in NAME, OPTARG is unset, and a diagnostic message is\n" +" printed.\n" +" \n" +" If the shell variable OPTERR has the value 0, getopts disables the\n" +" printing of error messages, even if the first character of\n" +" OPTSTRING is not a colon. OPTERR has the value 1 by default.\n" +" \n" +" Getopts normally parses the positional parameters ($0 - $9), but if\n" +" more arguments are given, they are parsed instead.\n" +" \n" +" Exit Status:\n" +" Returns success if an option is found; fails if the end of options is\n" +" encountered or an error occurs." +msgstr "" +"Analyse les options en arguments.\n" +" \n" +" « getopts » est utilisé par les procédures du shell pour analyser les \n" +" paramètres de position.\n" +" \n" +" OPTSTRING contient les lettres d'options qui devront être reconnues ;\n" +" si une lettre est suivie par un deux-points, elle devra posséder un\n" +" argument séparé d'elle par une espace.\n" +" \n" +" À chaque fois qu'elle est appelée, « getopts » place l'option suivante\n" +" dans la variable de shell « $nom », en l'initialisant si elle n'existe " +"pas,\n" +" et place l'index de l'argument suivant dans la variable de shell " +"OPTIND.\n" +" OPTIND est initialisé à 1 à chaque fois que le shell ou qu'un script " +"shell\n" +" est appelé. Lorsqu'une option nécessite un argument, « getopts » place " +"cet\n" +" argument dans la variable de shell OPTARG.\n" +" \n" +" « getopts » signale les erreurs d'une façon parmi deux. Si le premier " +"caractère\n" +" d'OPTSTRING est un deux-points, « getopts » utilise un signalement " +"d'erreur\n" +" silencieux. Dans ce mode aucun message d'erreur n'est affiché. Si une " +"option\n" +" incorrecte est rencontrée, « getopts » place dans OPTARG le caractère " +"d'option\n" +" trouvé. Si un argument nécessaire n'est pas trouvé, « getopts » place un " +"« : »\n" +" dans NOM et place dans OPTARG le caractère d'option trouvé. Si « " +"getopts »\n" +" n'est pas en mode silencieux et qu'une option incorrecte est rencontrée, " +"il\n" +" place « ? » dans NAME et efface OPTARG. Si un argument nécessaire n'est " +"pas\n" +" trouvé, un « ? » est placé dans NAME, OPTARG est effacé et un message de " +"diagnostic\n" +" est affiché.\n" +" \n" +" Si la variable de shell OPTERR possède la valeur 0, « getopts » " +"désactive\n" +" l'affichage des messages d'erreur, même si le premier caractère " +"d'OPTSTRING\n" +" n'est pas un deux-points. OPTERR possède la valeur 1 par défaut.\n" +" \n" +" « getopts » analyse habituellement les paramètres de position ($0 - $9), " +"mais\n" +" si plus d'argument sont données, ils sont analysés à la place.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de succès si une option est trouvée, le code d'échec si " +"la fin des options\n" +" est rencontrée ou si une erreur survient." + +#: builtins.c:685 +msgid "" +"Replace the shell with the given command.\n" +" \n" +" Execute COMMAND, replacing this shell with the specified program.\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not " +"specified,\n" +" any redirections take effect in the current shell.\n" +" \n" +" Options:\n" +" -a name\tpass NAME as the zeroth argument to COMMAND\n" +" -c\t\texecute COMMAND with an empty environment\n" +" -l\t\tplace a dash in the zeroth argument to COMMAND\n" +" \n" +" If the command cannot be executed, a non-interactive shell exits, " +"unless\n" +" the shell option `execfail' is set.\n" +" \n" +" Exit Status:\n" +" Returns success unless COMMAND is not found or a redirection error " +"occurs." +msgstr "" +"Remplace le shell par la commande fournie.\n" +" \n" +" Exécute la COMMANDE, en remplaçant ce shell par le programme spécifiée.\n" +" Les ARGUMENTS deviennent ceux de la COMMANDE. Si la COMMANDE n'est pas " +"fournie,\n" +" les redirections prennent effet dans le shell courant.\n" +" \n" +" Options :\n" +" -a nom\tpasse NOM comme argument numéro 0 à la COMMANDE\n" +" -c\t\texécute la COMMANDE avec un environnement vide\n" +" -l\t\tplace un tiret comme argument numéro 0 de la COMMANDE\n" +" \n" +" Si la commande ne peut pas être exécutée, un shell non-interactif se " +"termine, à moins\n" +" que l'option « execfail » ne soit définie.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de succès à moins que la COMMANDE ne soit pas trouvée ou " +"qu'une erreur de redirection ne survienne." + +#: builtins.c:706 +msgid "" +"Exit the shell.\n" +" \n" +" Exits the shell with a status of N. If N is omitted, the exit status\n" +" is that of the last command executed." +msgstr "" +"Termine le shell.\n" +" \n" +" Termine le shell avec le code de retour « N ». Si N est omis, le code\n" +" de retour est celui de la dernière commande exécutée." + +#: builtins.c:715 +msgid "" +"Exit a login shell.\n" +" \n" +" Exits a login shell with exit status N. Returns an error if not " +"executed\n" +" in a login shell." +msgstr "" +"Termine un shell de connexion.\n" +" \n" +" Termine un shell de connexion avec le code de sortie N. Renvoie une " +"erreur s'il n'est pas exécuté\n" +" dans un shell de connexion." + +#: builtins.c:725 +msgid "" +"Display or execute commands from the history list.\n" +" \n" +" fc is used to list or edit and re-execute commands from the history " +"list.\n" +" FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" +" string, which means the most recent command beginning with that\n" +" string.\n" +" \n" +" Options:\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then " +"EDITOR,\n" +" \t\tthen vi\n" +" -l \tlist lines instead of editing\n" +" -n\tomit line numbers when listing\n" +" -r\treverse the order of the lines (newest listed first)\n" +" \n" +" With the `fc -s [pat=rep ...] [command]' format, COMMAND is\n" +" re-executed after the substitution OLD=NEW is performed.\n" +" \n" +" A useful alias to use with this is r='fc -s', so that typing `r cc'\n" +" runs the last command beginning with `cc' and typing `r' re-executes\n" +" the last command.\n" +" \n" +" Exit Status:\n" +" Returns success or status of executed command; non-zero if an error " +"occurs." +msgstr "" +"Affiche ou exécute des commandes issues de l'historique.\n" +" \n" +" « fc » est utilisé pour afficher ou modifier puis ré-exécuter les " +"commandes\n" +" de l'historique des commandes. PREMIER et DERNIER peuvent être des " +"nombres\n" +" indiquant la plage ou PREMIER peut être une chaîne donnant le début de la\n" +" commande la plus récente recherchée.\n" +" \n" +" Options :\n" +" -e ENAME définit quel éditeur utiliser. Par défaut il s'agit de « " +"FCEDIT »\n" +" puis « EDITOR », puis « vi ».\n" +" \n" +" -l affiche les les lignes au lieu de les éditer.\n" +" -n n'affiche pas les numéros de ligne.\n" +" -r inverse l'ordre des lignes (les plus récentes en premier).\n" +" \n" +" En tapant « fc -s [ancien=nouveau ...] [commande] », la commande est ré-" +"exécutée\n" +" après avoir effectué le remplacement ANCIEN=NOUVEAU.\n" +" \n" +" Un alias utile est « r='fc -s' » de sorte qu'en tapant « r cc »,\n" +" la dernière commande commençant par « cc » est ré-exécutée et avec « r " +"», la\n" +" dernière commande est ré-exécutée.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de succès ou le code de sortie de la commande exécutée ; " +"autre chose que 0 si une erreur survient." + +#: builtins.c:755 +msgid "" +"Move job to the foreground.\n" +" \n" +" Place the job identified by JOB_SPEC in the foreground, making it the\n" +" current job. If JOB_SPEC is not present, the shell's notion of the\n" +" current job is used.\n" +" \n" +" Exit Status:\n" +" Status of command placed in foreground, or failure if an error occurs." +msgstr "" +"Déplace une tâche au premier plan.\n" +" \n" +" Place JOB_SPEC au premier plan et en fait la tâche actuelle. Si\n" +" JOB_SPEC n'est pas fourni, le shell utilise sa propre notion\n" +" de tâche actuelle.\n" +" \n" +" Code de sortie :\n" +" celui de la commande placée au premier plan ou le code d'échec si une " +"erreur survient." + +#: builtins.c:770 +msgid "" +"Move jobs to the background.\n" +" \n" +" Place the jobs identified by each JOB_SPEC in the background, as if " +"they\n" +" had been started with `&'. If JOB_SPEC is not present, the shell's " +"notion\n" +" of the current job is used.\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Déplace des tâches vers l'arrière plan.\n" +" \n" +" Place chaque JOB_SPEC en arrière plan comme s'il avait été démarré avec " +"« & ».\n" +" Si JOB_SPEC n'est pas fourni, le shell utilise sa propre notion\n" +" de tâche actuelle.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de succès à moins que le contrôle de tâche ne soit pas " +"activé ou qu'une erreur ne survienne." + +#: builtins.c:784 +#, fuzzy +msgid "" +"Remember or display program locations.\n" +" \n" +" Determine and remember the full pathname of each command NAME. If\n" +" no arguments are given, information about remembered commands is " +"displayed.\n" +" \n" +" Options:\n" +" -d\t\tforget the remembered location of each NAME\n" +" -l\t\tdisplay in a format that may be reused as input\n" +" -p pathname\tuse PATHNAME as the full pathname of NAME\n" +" -r\t\tforget all remembered locations\n" +" -t\t\tprint the remembered location of each NAME, preceding\n" +" \t\teach location with the corresponding NAME if multiple\n" +" \t\tNAMEs are given\n" +" Arguments:\n" +" NAME\t\tEach NAME is searched for in $PATH and added to the list\n" +" \t\tof remembered commands.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not found or an invalid option is given." +msgstr "" +"Mémorise ou affiche l'emplacement des programmes.\n" +" \n" +" Détermine et mémorise le chemin complet de chaque commande NOM. Si\n" +" aucun argument n'est donné, une information sur les commandes mémorisées " +"est affichée.\n" +" \n" +" Options :\n" +" -d\t\toublier l'emplacement mémorisé de chaque NOM\n" +" -l\t\tafficher dans un format qui peut être réutilisé comme entrée\n" +" -p nomchemin\tutiliser NOMCHEMIN comme le chemin complet de NOM\n" +" -r\t\toublier tous les emplacements mémorisés\n" +" -t\t\tafficher l'emplacement mémorisé de chaque NOM, en précédant\n" +" \t\tchaque emplacement du NOM correspondant si plusieurs NOMS\n" +" \t\tsont donnés\n" +" Arguments :\n" +" NOM\t\tChaque NOM est recherché dans $PATH et ajouté à la liste\n" +" \t\tdes commandes mémorisée.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de succès à moins que le NOM ne soit pas trouvé ou " +"qu'une option non valable ne soit donnée." + +#: builtins.c:809 +msgid "" +"Display information about builtin commands.\n" +" \n" +" Displays brief summaries of builtin commands. If PATTERN is\n" +" specified, gives detailed help on all commands matching PATTERN,\n" +" otherwise the list of help topics is printed.\n" +" \n" +" Options:\n" +" -d\toutput short description for each topic\n" +" -m\tdisplay usage in pseudo-manpage format\n" +" -s\toutput only a short usage synopsis for each topic matching\n" +" \tPATTERN\n" +" \n" +" Arguments:\n" +" PATTERN\tPattern specifiying a help topic\n" +" \n" +" Exit Status:\n" +" Returns success unless PATTERN is not found or an invalid option is " +"given." +msgstr "" +"Affiche des informations sur les commandes intégrées.\n" +" \n" +" Affiche de courts résumés des commandes intégrées. Si MOTIF est\n" +" spécifié, une aide détaillée de toutes les commandes correspondantes\n" +" au MOTIF est affichée, sinon la liste des sujets d'aide est affichée.\n" +" \n" +" Options :\n" +" -d\tafficher une courte description pour chaque sujet\n" +" -m\tafficher l'aide dans un format proche des pages de man(uel)\n" +" -s\tn'afficher qu'une courte aide pour chaque sujet correspondant au\n" +" \t\tMOTIF\n" +" \n" +" Arguments :\n" +" MOTIF\tMotif spécifiant un sujet d'aide\n" +" \n" +" Code de retour :\n" +" Renvoie le code de succès à moins que le MOTIF ne soit pas trouvé ou " +"qu'une\n" +" option non valable ne soit donnée." + +#: builtins.c:833 +msgid "" +"Display or manipulate the history list.\n" +" \n" +" Display the history list with line numbers, prefixing each modified\n" +" entry with a `*'. An argument of N lists only the last N entries.\n" +" \n" +" Options:\n" +" -c\tclear the history list by deleting all of the entries\n" +" -d offset\tdelete the history entry at offset OFFSET.\n" +" \n" +" -a\tappend history lines from this session to the history file\n" +" -n\tread all history lines not already read from the history file\n" +" -r\tread the history file and append the contents to the history\n" +" \tlist\n" +" -w\twrite the current history to the history file\n" +" \tand append them to the history list\n" +" \n" +" -p\tperform history expansion on each ARG and display the result\n" +" \twithout storing it in the history list\n" +" -s\tappend the ARGs to the history list as a single entry\n" +" \n" +" If FILENAME is given, it is used as the history file. Otherwise,\n" +" if $HISTFILE has a value, that is used, else ~/.bash_history.\n" +" \n" +" If the $HISTTIMEFORMAT variable is set and not null, its value is used\n" +" as a format string for strftime(3) to print the time stamp associated\n" +" with each displayed history entry. No time stamps are printed " +"otherwise.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" +"Affiche ou manipule l''historique.\n" +" \n" +" Affiche l'historique avec les numéros de lignes en préfixant chaque " +"élément\n" +" modifié d'un « * ». Un argument égal à N limite la liste aux N derniers " +"éléments.\n" +" \n" +" Options :\n" +" -c\tefface la liste d'historique en effaçant tous les éléments\n" +" -d offset\tefface l'élément d'historique à l'emplacement OFFSET.\n" +" \n" +" -a\tajouter les lignes d'historique de cette session au fichier " +"d'historique\n" +" -n\tlire toutes les lignes d'historique non déjà lues depuis le " +"fichier d'historique\n" +" -r\tlire le fichier d'historique et ajouter le contenu à la liste " +"d'historique\n" +" -w\técrire l'historique actuel dans le fichier d'historique\n" +" \tet l'ajoute à la liste d'historique\n" +" \n" +" -p\teffectuer un développement de l'historique sur chaque ARG et " +"afficher le résultat\n" +" \tsans le stocker dans la liste d'historique\n" +" -s\tajoute les ARGs à la liste d'historique comme entrée unique\n" +" \n" +" Si NOMFICHIER est donné, il est utilisé comme fichier d'historique. " +"Sinon,\n" +" si $HISTFILE contient une valeur, celle-ci est utilisée, sinon ~/." +"bash_history.\n" +" \n" +" Si la variable $HISTTIMEFORMAT est définie et n'est pas vide, sa valeur " +"est utillisée\n" +" comme chaîne de format pour que strftime(3) affiche l'horodatage " +"associé\n" +" à chaque entrée d'historique. Sinin, aucun horodatage n'est affiché.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de succès à moins qu'une option non valable soit donnée " +"ou qu'une erreur ne survienne." + +#: builtins.c:869 +#, fuzzy +msgid "" +"Display status of jobs.\n" +" \n" +" Lists the active jobs. JOBSPEC restricts output to that job.\n" +" Without options, the status of all active jobs is displayed.\n" +" \n" +" Options:\n" +" -l\tlists process IDs in addition to the normal information\n" +" -n\tlists only processes that have changed status since the last\n" +" \tnotification\n" +" -p\tlists process IDs only\n" +" -r\trestrict output to running jobs\n" +" -s\trestrict output to stopped jobs\n" +" \n" +" If -x is supplied, COMMAND is run after all job specifications that\n" +" appear in ARGS have been replaced with the process ID of that job's\n" +" process group leader.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs.\n" +" If -x is used, returns the exit status of COMMAND." +msgstr "" +"Affiche l'état des tâches.\n" +" \n" +" Affiche la liste des tâches actives. JOBSPEC restreint l'affichage à " +"cette tâche.\n" +" S'il n'y a pas d'option, l'état de toutes les tâches actives est " +"affiché.\n" +" \n" +" Options :\n" +" -l\tafficher les IDs de processus en plus des informations normales\n" +" -n\tafficher seulement les processus dont l'état a changé depuis la " +"dernière\n" +" \tnotification\n" +" -p\tafficher seulement les IDs de processus\n" +" -r\trestreindre l'affichage aux tâches en cours d'exécution\n" +" -s\trestreindre l'affichage aux tâches stoppées\n" +" \n" +" Si « -x » est fournie, la COMMANDE est lancée après que toutes les " +"spécifications\n" +" qui apparaissent dans ARGs ont été remplacées par l'ID de processus du " +"leader de groupe\n" +" de processus de cette tâche.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de succès à moins qu'une option non valable ne soit " +"donnée ou qu'une erreur ne survienne.\n" +" Si « -x » est utilisée, le code de sortie de la COMMANDE est renvoyé." + +#: builtins.c:896 +msgid "" +"Remove jobs from current shell.\n" +" \n" +" Removes each JOBSPEC argument from the table of active jobs. Without\n" +" any JOBSPECs, the shell uses its notion of the current job.\n" +" \n" +" Options:\n" +" -a\tremove all jobs if JOBSPEC is not supplied\n" +" -h\tmark each JOBSPEC so that SIGHUP is not sent to the job if the\n" +" \tshell receives a SIGHUP\n" +" -r\tremove only running jobs\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option or JOBSPEC is given." +msgstr "" +"Retire des tâches du shell courant.\n" +" \n" +" Retire chaque argument JOBSPEC de la table des tâches actives. Sans\n" +" JOBSPEC, le shell utilise sa propre notion de tâche courante.\n" +" \n" +" Options :\n" +" -a\tretirer toutes lestâches si JOBSPEC n'est pas fourni\n" +" -h\tmarque chaque JOBSPEC de façon que SIGHUP ne soit pas envoyé à la " +"tâche\n" +" \tsi le shell reçoit un SIGHUP\n" +" -r\tretire seulement les tâches en cours de fonctionnement\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de succès à moins qu'une option ou un JOBSPEC non " +"valable ne soit donné." + +#: builtins.c:915 +msgid "" +"Send a signal to a job.\n" +" \n" +" Send the processes identified by PID or JOBSPEC the signal named by\n" +" SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n" +" SIGTERM is assumed.\n" +" \n" +" Options:\n" +" -s sig\tSIG is a signal name\n" +" -n sig\tSIG is a signal number\n" +" -l\tlist the signal names; if arguments follow `-l' they are\n" +" \tassumed to be signal numbers for which names should be listed\n" +" \n" +" Kill is a shell builtin for two reasons: it allows job IDs to be used\n" +" instead of process IDs, and allows processes to be killed if the limit\n" +" on processes that you can create is reached.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" +"Envoie un signal à une tâche.\n" +" \n" +" Envoie le signal nommé par SIGSPEC ou SIGNUM au processus identifié par " +"PID ou JOBSPEC.\n" +" Si SIGSPEC et SIGNUM ne sont pas donnés, alors SIGTERM est envoyé.\n" +" \n" +" Options :\n" +" -s sig\tSIG est un nom de signal\n" +" -n sig\tSIG est un numéro de signal\n" +" -l\tafficher la liste des noms de signaux ; si des arguments suivent « " +"-l », ils sont supposés être\n" +" \tdes numéro de signaux pour lesquels les noms doivent être affichés\n" +" \n" +" « kill » est une commande intégrée pour deux raisons : elle permet aux " +"IDs de tâches d'être utilisées\n" +" à la place des IDs de processus et elle permet aux processus d'être tués " +"si la limite du nombre de processus\n" +" que vous pouvez créer est atteinte.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de succès à moins qu'une option non valable soit donnée " +"ou qu'une erreur ne survienne." + +#: builtins.c:938 +msgid "" +"Evaluate arithmetic expressions.\n" +" \n" +" Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" +" fixed-width integers with no check for overflow, though division by 0\n" +" is trapped and flagged as an error. The following list of operators is\n" +" grouped into levels of equal-precedence operators. The levels are " +"listed\n" +" in order of decreasing precedence.\n" +" \n" +" \tid++, id--\tvariable post-increment, post-decrement\n" +" \t++id, --id\tvariable pre-increment, pre-decrement\n" +" \t-, +\t\tunary minus, plus\n" +" \t!, ~\t\tlogical and bitwise negation\n" +" \t**\t\texponentiation\n" +" \t*, /, %\t\tmultiplication, division, remainder\n" +" \t+, -\t\taddition, subtraction\n" +" \t<<, >>\t\tleft and right bitwise shifts\n" +" \t<=, >=, <, >\tcomparison\n" +" \t==, !=\t\tequality, inequality\n" +" \t&\t\tbitwise AND\n" +" \t^\t\tbitwise XOR\n" +" \t|\t\tbitwise OR\n" +" \t&&\t\tlogical AND\n" +" \t||\t\tlogical OR\n" +" \texpr ? expr : expr\n" +" \t\t\tconditional operator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tassignment\n" +" \n" +" Shell variables are allowed as operands. The name of the variable\n" +" is replaced by its value (coerced to a fixed-width integer) within\n" +" an expression. The variable need not have its integer attribute\n" +" turned on to be used in an expression.\n" +" \n" +" Operators are evaluated in order of precedence. Sub-expressions in\n" +" parentheses are evaluated first and may override the precedence\n" +" rules above.\n" +" \n" +" Exit Status:\n" +" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." +msgstr "" +"Évalue des expressions arithmétiques.\n" +" \n" +" Chaque ARG est une expression arithmétique à évaluer. L'évaluation\n" +" est faite avec des entiers de largeur fixe sans vérification de\n" +" dépassement, mais la division par zéro est interceptée et\n" +" signalée comme une erreur. La liste suivante d'opérateurs\n" +" est groupée par niveau d'égale priorité. Les niveaux sont listés\n" +" par priorité décroissante.\n" +" \n" +" \tid++, id--\tpost-incrément ou post-décrément de variable\n" +" \t++id, --id\tpré-incrément ou pré-décrément de variable\n" +" \t-, +\t\tmoins unaire, plus unaire\n" +" \t!, ~\t\tnégations logique et binaire\n" +" \t**\t\tmise en exposant\n" +" \t*, /, %\t\tmultiplication, division, reste de la division\n" +" \t+, -\t\taddition, soustraction\n" +" \t<<, >>\t\tdécalage binaire à gauche et à droite\n" +" \t<=, >=, <, >\tcomparaison\n" +" \t==, !=\t\tégalité, inégalité\n" +" \t&\t\tET binaire\n" +" \t^\t\tOU binaire exclusif\n" +" \t|\t\tOU binaire\n" +" \t&&\t\tET logique\n" +" \t||\t\tOU logique\n" +" \texpr ? expr : expr\n" +" \t\t\topérateur de condition\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\taffectation\n" +" \n" +" Les variables de shell sont autorisées comme opérandes. Le nom de la\n" +" variable est remplacé par sa valeur (contrainte à un entier de largeur " +"fixe)\n" +" à l'intérieur d'une expression. La variable n'a pas besoin d'avoir son " +"attribut\n" +" d'entier activé pour être utilisée dans une expression.\n" +" \n" +" Les opérateurs sont évalués dans leur ordre de priorité. Les sous-" +"expressions entre\n" +" parenthèses sont évaluées en premier et peuvent être prioritaires sur " +"les règles\n" +" ci-dessus.\n" +" \n" +" Code de sortie :\n" +" Si le dernier ARG est évalué à 0, « let » renvoie 1, sinon 0 est renvoyé." + +#: builtins.c:983 +#, fuzzy +msgid "" +"Read a line from the standard input and split it into fields.\n" +" \n" +" Reads a single line from the standard input, or from file descriptor FD\n" +" if the -u option is supplied. The line is split into fields as with " +"word\n" +" splitting, and the first word is assigned to the first NAME, the second\n" +" word to the second NAME, and so on, with any leftover words assigned to\n" +" the last NAME. Only the characters found in $IFS are recognized as " +"word\n" +" delimiters.\n" +" \n" +" If no NAMEs are supplied, the line read is stored in the REPLY " +"variable.\n" +" \n" +" Options:\n" +" -a array\tassign the words read to sequential indices of the array\n" +" \t\tvariable ARRAY, starting at zero\n" +" -d delim\tcontinue until the first character of DELIM is read, rather\n" +" \t\tthan newline\n" +" -e\t\tuse Readline to obtain the line in an interactive shell\n" +" -i text\tUse TEXT as the initial text for Readline\n" +" -n nchars\treturn after reading NCHARS characters rather than waiting\n" +" \t\tfor a newline, but honor a delimiter if fewer than NCHARS\n" +" \t\tcharacters are read before the delimiter\n" +" -N nchars\treturn only after reading exactly NCHARS characters, " +"unless\n" +" \t\tEOF is encountered or read times out, ignoring any delimiter\n" +" -p prompt\toutput the string PROMPT without a trailing newline before\n" +" \t\tattempting to read\n" +" -r\t\tdo not allow backslashes to escape any characters\n" +" -s\t\tdo not echo input coming from a terminal\n" +" -t timeout\ttime out and return failure if a complete line of input " +"is\n" +" \t\tnot read within TIMEOUT seconds. The value of the TMOUT\n" +" \t\tvariable is the default timeout. TIMEOUT may be a\n" +" \t\tfractional number. If TIMEOUT is 0, read returns immediately,\n" +" \t\twithout trying to read any data, returning success only if\n" +" \t\tinput is available on the specified file descriptor. The\n" +" \t\texit status is greater than 128 if the timeout is exceeded\n" +" -u fd\t\tread from file descriptor FD instead of the standard input\n" +" \n" +" Exit Status:\n" +" The return code is zero, unless end-of-file is encountered, read times " +"out\n" +" (in which case it's greater than 128), a variable assignment error " +"occurs,\n" +" or an invalid file descriptor is supplied as the argument to -u." +msgstr "" +"Lit une ligne depuis l'entrée standard et la découper en morceaux.\n" +" \n" +" Lit une simple ligne depuis l'entrée standard ou depuis le descripteur " +"de fichier FD\n" +" si l'option « -u » est fournie. La ligne est découpée en morceaux comme " +"des mots,\n" +" et le premier mot est assigné au premier NOM, le deuxième mot au " +"deuxième NOM,\n" +" et ainsi de suite, le dernier NOM récupérant la liste des mots " +"restants.\n" +" Seul les caractères trouvés dans $IFS sont reconnus comme délimiteurs\n" +" de mots\n" +" \n" +" Si aucun NOM n'est fourni, la ligne lue est stockée dans la variable " +"REPLY.\n" +" \n" +" Options :\n" +" -a tableau\taffecter les indices de la variable tableau " +"séquentiellement aux mots lus,\n" +" \t\ten commançant à 0\n" +" -d délim\tcontinuer jusqu'à ce que le premier caractère de DELIM soit " +"lu,\n" +" \t\tau lieu du retour à la ligne\n" +" -e\t\tutiliser « Readline » pour obtenir la ligne dans un shell " +"interactif\n" +" -i texte\tUtiliser TEXTE comme texte initial pour « Readline »\n" +" -n n\tterminer après avoir lu N caractères plutôt que d'attendre\n" +" \t\tun retour à la ligne, mais obéir à un délimiteur si moins de N " +"caractères\n" +" \t\tsont lus avant le délimiteur\n" +" -N n\ttermine seulement après avoir lu exactement N caractères, à " +"moins\n" +" \t\tque le caractère EOF soit recontré ou que le délai de lecture " +"n'expire, en ignorant tout délimiteur\n" +" -p prompt\taffiche la chaîne PROMPT sans retour à la ligne final, " +"avant de tenter une\n" +" \t\tlecture\n" +" -r\t\tne pas permettre aux barres obliques inverses de se comporter " +"comme des caractères d'échappement\n" +" -s\t\tne pas répéter l'entrée provenant d'un terminal\n" +" -t timeout\texpire et renvoie un code d'échec si une ligne d'entrée " +"complète n'est pas\n" +" \t\tlue en moins de TIMEOUT secondes. La valeur de la variable TIMEOUT\n" +" \t\test le délai d'expiration par défaut. TIMEOUT peut être un nombre à " +"virgule\n" +" \t\tSi TIMEOUT est à, la lecture renvoie un code de succès seulement\n" +" \t\tsi l'entrée est disponible sur le descripteut de fichier. Le code\n" +" \t\tde sortie est supérieur à 128 si le délai a expiré\n" +" -u fd\t\tlire depuis le descripteur de fichier FD plutôt que l'entrée " +"standard\n" +" \n" +" Code de sortie :\n" +" Le code de retour est 0, à moins qu'une fin de fichier ne survienne, que " +"le délai expire,\n" +" ou qu'un descripteur de fichier non valable ne soit fourni comme " +"argument à « -u »." + +#: builtins.c:1028 +msgid "" +"Return from a shell function.\n" +" \n" +" Causes a function or sourced script to exit with the return value\n" +" specified by N. If N is omitted, the return status is that of the\n" +" last command executed within the function or script.\n" +" \n" +" Exit Status:\n" +" Returns N, or failure if the shell is not executing a function or script." +msgstr "" +"Termine depuis une fonction du shell.\n" +" \n" +" Entraine l'arrêt d'une fonction ou d'un script sourcé, avec le code de " +"retour spécifié par N.\n" +" Si N est omis, le code de retour est celui de la dernière commande " +"exécutée\n" +" à l'intérieur de la fonction ou du script\n" +" \n" +" Code de retour :\n" +" Renvoie N ou le code d'échec si le shell n'est pas en train d'exécuter " +"une fonction ou un script." + +#: builtins.c:1041 +#, fuzzy +msgid "" +"Set or unset values of shell options and positional parameters.\n" +" \n" +" Change the value of shell attributes and positional parameters, or\n" +" display the names and values of shell variables.\n" +" \n" +" Options:\n" +" -a Mark variables which are modified or created for export.\n" +" -b Notify of job termination immediately.\n" +" -e Exit immediately if a command exits with a non-zero status.\n" +" -f Disable file name generation (globbing).\n" +" -h Remember the location of commands as they are looked up.\n" +" -k All assignment arguments are placed in the environment for a\n" +" command, not just those that precede the command name.\n" +" -m Job control is enabled.\n" +" -n Read commands but do not execute them.\n" +" -o option-name\n" +" Set the variable corresponding to option-name:\n" +" allexport same as -a\n" +" braceexpand same as -B\n" +" emacs use an emacs-style line editing interface\n" +" errexit same as -e\n" +" errtrace same as -E\n" +" functrace same as -T\n" +" hashall same as -h\n" +" histexpand same as -H\n" +" history enable command history\n" +" ignoreeof the shell will not exit upon reading EOF\n" +" interactive-comments\n" +" allow comments to appear in interactive commands\n" +" keyword same as -k\n" +" monitor same as -m\n" +" noclobber same as -C\n" +" noexec same as -n\n" +" noglob same as -f\n" +" nolog currently accepted but ignored\n" +" notify same as -b\n" +" nounset same as -u\n" +" onecmd same as -t\n" +" physical same as -P\n" +" pipefail the return value of a pipeline is the status of\n" +" the last command to exit with a non-zero status,\n" +" or zero if no command exited with a non-zero " +"status\n" +" posix change the behavior of bash where the default\n" +" operation differs from the Posix standard to\n" +" match the standard\n" +" privileged same as -p\n" +" verbose same as -v\n" +" vi use a vi-style line editing interface\n" +" xtrace same as -x\n" +" -p Turned on whenever the real and effective user ids do not match.\n" +" Disables processing of the $ENV file and importing of shell\n" +" functions. Turning this option off causes the effective uid and\n" +" gid to be set to the real uid and gid.\n" +" -t Exit after reading and executing one command.\n" +" -u Treat unset variables as an error when substituting.\n" +" -v Print shell input lines as they are read.\n" +" -x Print commands and their arguments as they are executed.\n" +" -B the shell will perform brace expansion\n" +" -C If set, disallow existing regular files to be overwritten\n" +" by redirection of output.\n" +" -E If set, the ERR trap is inherited by shell functions.\n" +" -H Enable ! style history substitution. This flag is on\n" +" by default when the shell is interactive.\n" +" -P If set, do not resolve symbolic links when executing commands\n" +" such as cd which change the current directory.\n" +" -T If set, the DEBUG trap is inherited by shell functions.\n" +" -- Assign any remaining arguments to the positional parameters.\n" +" If there are no remaining arguments, the positional parameters\n" +" are unset.\n" +" - Assign any remaining arguments to the positional parameters.\n" +" The -x and -v options are turned off.\n" +" \n" +" Using + rather than - causes these flags to be turned off. The\n" +" flags can also be used upon invocation of the shell. The current\n" +" set of flags may be found in $-. The remaining n ARGs are positional\n" +" parameters and are assigned, in order, to $1, $2, .. $n. If no\n" +" ARGs are given, all shell variables are printed.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given." +msgstr "" +"Définit ou invalide des valeurs d'options et des paramètres de position du " +"shell.\n" +" \n" +" Change la valeur des attributs du shell et des paramètres de position, " +"ou\n" +" affiche les noms et valeurs des variables du shell.\n" +" \n" +" Options :\n" +" -a Marquer pour l'export toutes les variables qui sont modifiées ou " +"créées.\n" +" -b Avertir immédiatement de la fin d'une tâche.\n" +" -e Terminer immédiatement si une commande s'arrête avec un code de " +"retour non nul.\n" +" -f Désactiver la génération de nom de fichier (globbing).\n" +" -h Mémoriser l'emplacement des commandes après leur recherche.\n" +" -k Placer dans l'environnement tous les arguments d'affectation " +"pour une commande,\n" +" pas seulement ceux qui précèdent le nom de la commande.\n" +" -m Activer le contrôle de tâche.\n" +" -n Lire les commandes, mais ne pas les exécuter.\n" +" -o nom-option\n" +" Définir la variable correspondant à nom-option :\n" +" allexport identique à -a\n" +" braceexpand identique à -B\n" +" emacs utiliser une édition de ligne façon « emacs »\n" +" errexit identique à -e\n" +" errtrace identique à -E\n" +" functrace identique à -T\n" +" hashall identique à -h\n" +" histexpand identique à -H\n" +" history activer l'historique des commandes\n" +" ignoreeof ne pas terminer le shell à la lecture d'un « " +"EOF »\n" +" interactive-comments\n" +" permet aux commentaires d'apparaître dans les " +"commandes interactives\n" +" keyword identique à -k\n" +" monitor identique à -m\n" +" noclobber identique à -C\n" +" noexec identique à -n\n" +" noglob identique à -f\n" +" nolog actuellement accepté mais ignoré\n" +" notify identique à -b\n" +" nounset identique à -u\n" +" onecmd identique à -t\n" +" physical identique à -P\n" +" pipefail le code de retour d'un tube est celui de la " +"dernière commande\n" +" qui s'est terminée avec un code non nul,\n" +" ou zéro si aucune commande ne s'est arrêtée " +"avec un code non nul.\n" +" posix modifie le comportement de « bash » pour qu'il " +"se comporte comme\n" +" le standard 1003.2 aux endroits où il diffère " +"par défaut.\n" +" privileged identique à -p\n" +" verbose identique à -v\n" +" vi utiliser une édition de ligne façon « vi »\n" +" xtrace identique à -x\n" +" -p Option activée lorsque les n° d'identifiants utilisateurs réels " +"et effectifs ne\n" +" sont pas les mêmes. Désactive le traitement du fichier $ENV et " +"l'import des\n" +" fonctions du shell. Désactiver cette option permet de définir " +"les uid et gid\n" +" effectifs à la valeur des uid et gid réels.\n" +" -t Terminer après la lecture et l'exécution d'une commande.\n" +" -u Traiter les variables non définies comme des erreurs lors de la " +"substitution.\n" +" -v Afficher les lignes d'entrée du shell à leur lecture.\n" +" -x Afficher les commandes et leurs arguments au moment de leur " +"exécution.\n" +" -B Effectuer l'expansion des accolades\n" +" -C Si définit, empêche les fichiers réguliers existants d'être " +"écrasés par une\n" +" redirection de la sortie.\n" +" -E Si définit, l'interception ERR est héritée par les fonctions du " +"shell.\n" +" -H Activer la substitution d'historique façon « ! ». Ceci est actif " +"par défaut\n" +" lorsque le shell est interactif.\n" +" -P Si définit, les liens symboliques ne sont pas suivis lors de " +"l'exécution des\n" +" commandes telles que « cd » qui changent le répertoire courant.\n" +" -T Si définit, l'interception DEBUG est héritée par les fonctions " +"du shell.\n" +" -- Affecte tous les arguments restants aux paramètres de position.\n" +" S'il n'y a plus d'argument, les paramètres de position sont " +"indéfinis.\n" +" - Affecter tous les arguments restants aux paramètres de " +"position.\n" +" Les options « -x » et « -v » sont désactivées.\n" +" \n" +" Ces indicateurs peuvent être désactivés en utilisant « + » plutôt que « " +"- ». Ils peuvent\n" +" être utilisés lors de l'appel au shell. Le jeu d'indicateurs actuel peut " +"être trouvé\n" +" dans « $- ». Les n ARGs restants sont des paramètres de position et " +"sont affectés,\n" +" dans l'ordre, à $1, $2, .. $n. Si aucun ARG n'est donné, toutes les " +"variables du shell\n" +" sont affichées. \n" +" Code de sortie :\n" +" Renvoie le code de succès à moins qu'une option non valable ne soit " +"donnée." + +#: builtins.c:1126 +#, fuzzy +msgid "" +"Unset values and attributes of shell variables and functions.\n" +" \n" +" For each NAME, remove the corresponding variable or function.\n" +" \n" +" Options:\n" +" -f\ttreat each NAME as a shell function\n" +" -v\ttreat each NAME as a shell variable\n" +" -n\ttreat each NAME as a name reference and unset the variable itself\n" +" \trather than the variable it references\n" +" \n" +" Without options, unset first tries to unset a variable, and if that " +"fails,\n" +" tries to unset a function.\n" +" \n" +" Some variables cannot be unset; also see `readonly'.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a NAME is read-only." +msgstr "" +"Annule des valeurs ou des attributs de variables et de fonctions du shell.\n" +" \n" +" Pour chaque NOM, annule la variable ou fonction correspondante.\n" +" \n" +" Options :\n" +" -f\ttraite chaque NOM comme une fonction du shell\n" +" -v\ttraite chaque NOM comme une variable du shell\n" +" \n" +" Sans option, « unset » essaye d'abord d'annuler une variable et, \n" +" en cas d'échec, essaye d'annuler la fonction.\n" +" \n" +" Certaines variables ne peuvent pas être annulées ; consultez aussi « " +"readonly ».\n" +" \n" +" Code de retour :\n" +" Renvoie le code de succès à moins qu'une option non valable ne soit " +"donnée ou que NOM soit en lecture seule." + +#: builtins.c:1148 +msgid "" +"Set export attribute for shell variables.\n" +" \n" +" Marks each NAME for automatic export to the environment of subsequently\n" +" executed commands. If VALUE is supplied, assign VALUE before " +"exporting.\n" +" \n" +" Options:\n" +" -f\trefer to shell functions\n" +" -n\tremove the export property from each NAME\n" +" -p\tdisplay a list of all exported variables and functions\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" +"Définit l'attribut « export » pour des variables du shell.\n" +" \n" +" Marque chaque NOM pour export automatique vers l'environnement des " +"commandes\n" +" exécutées ultérieurement. Si VALEUR est fournie, affecte la VALEUR " +"avant l'export.\n" +" \n" +" Options :\n" +" -f\tse référer aux fonctions du shell\n" +" -n\tenlève la propriété d'export de chaque NOM\n" +" -p\taffiche une liste de toutes les variables et fonctions exportées\n" +" \n" +" L'argument « -- » désactive tout traitement postérieur d'options.\n" +" \n" +" Code de retour :\n" +" Renvoie le code de succès à moins qu'une option non valable ne soit " +"données ou que NOM ne soit pas valable." + +#: builtins.c:1167 +#, fuzzy +msgid "" +"Mark shell variables as unchangeable.\n" +" \n" +" Mark each NAME as read-only; the values of these NAMEs may not be\n" +" changed by subsequent assignment. If VALUE is supplied, assign VALUE\n" +" before marking as read-only.\n" +" \n" +" Options:\n" +" -a\trefer to indexed array variables\n" +" -A\trefer to associative array variables\n" +" -f\trefer to shell functions\n" +" -p\tdisplay a list of all readonly variables or functions, depending " +"on\n" +" whether or not the -f option is given\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" +"Marque des variables du shell comme non modifiables.\n" +" \n" +" Marque chaque NOM comme étant en lecture seule ; les valeurs de ces NOMs " +"ne peuvent plus\n" +" être modifiées par des affectations ultérieures. Si VALEUR est founie, " +"lui affecter la VALEUR avant le\n" +" passage en lecture seule.\n" +" \n" +" Options :\n" +" -a\tse référer à des variables étant des tableaux indexés\n" +" -A\tse référer à des variables étant des tableaux associatifs\n" +" -f\tse référer à des fonctions du shell\n" +" -p\tafficher une liste des toutes les fonctions et variables en " +"lecture seule\n" +" \n" +" Un argument « -- » désactive tout traitement postérieur d'options.\n" +" \n" +" Code de retour :\n" +" Renvoie le code de succès à moins qu'une options non valable ne soit " +"données ou que NOM ne soit pas valable." + +#: builtins.c:1189 +msgid "" +"Shift positional parameters.\n" +" \n" +" Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n" +" not given, it is assumed to be 1.\n" +" \n" +" Exit Status:\n" +" Returns success unless N is negative or greater than $#." +msgstr "" +"Décale des paramètres de position.\n" +" \n" +" Renomme les paramètres de position $N+1,$N+2 ... à $1,$2 ... Si N n'est " +"pas\n" +" donné, il est supposé égal à 1.\n" +" \n" +" Code de retour :\n" +" Renvoie le code de succès à moins que N soit négatif ou supérieur à $#." + +#: builtins.c:1201 builtins.c:1216 +msgid "" +"Execute commands from a file in the current shell.\n" +" \n" +" Read and execute commands from FILENAME in the current shell. The\n" +" entries in $PATH are used to find the directory containing FILENAME.\n" +" If any ARGUMENTS are supplied, they become the positional parameters\n" +" when FILENAME is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed in FILENAME; fails if\n" +" FILENAME cannot be read." +msgstr "" +"Execute des commandes depuis un fichier dans le shell actuel.\n" +" \n" +" Lit et exécute des commandes depuis NOMFICHIER dans le shell actuel. " +"Les\n" +" éléments dans $PATH sont utilisés pour trouver le répertoire contenant " +"NOMFICHIER.\n" +" Si des ARGUMENTS sont fournis, ils deviennent les paramètres de " +"position\n" +" lorsque NOMFICHIER est exécuté.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de la dernière commande exécutée dans NOMFICHIER, ou le " +"code\n" +" d'échec si NOMFICHIER ne peut pas être lu." + +#: builtins.c:1232 +msgid "" +"Suspend shell execution.\n" +" \n" +" Suspend the execution of this shell until it receives a SIGCONT signal.\n" +" Unless forced, login shells cannot be suspended.\n" +" \n" +" Options:\n" +" -f\tforce the suspend, even if the shell is a login shell\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Suspend l'exécution du shell.\n" +" \n" +" Suspend l'exécution de ce shell jusqu'à qu'il reçoive un signal " +"SIGCONT.\n" +" À moins que ce soit forcé, les shell de connexion ne peuvent pas être " +"suspendus.\n" +" \n" +" Options :\n" +" -f\tforce la suspension, même si le shell est un shell de connexion\n" +" \n" +" Code de retour :\n" +" Renvoie le code de succès à moins que le contrôle de tâche ne soit pas " +"activé ou qu'une erreur survienne." + +#: builtins.c:1248 +#, fuzzy +msgid "" +"Evaluate conditional expression.\n" +" \n" +" Exits with a status of 0 (true) or 1 (false) depending on\n" +" the evaluation of EXPR. Expressions may be unary or binary. Unary\n" +" expressions are often used to examine the status of a file. There\n" +" are string operators and numeric comparison operators as well.\n" +" \n" +" The behavior of test depends on the number of arguments. Read the\n" +" bash manual page for the complete specification.\n" +" \n" +" File operators:\n" +" \n" +" -a FILE True if file exists.\n" +" -b FILE True if file is block special.\n" +" -c FILE True if file is character special.\n" +" -d FILE True if file is a directory.\n" +" -e FILE True if file exists.\n" +" -f FILE True if file exists and is a regular file.\n" +" -g FILE True if file is set-group-id.\n" +" -h FILE True if file is a symbolic link.\n" +" -L FILE True if file is a symbolic link.\n" +" -k FILE True if file has its `sticky' bit set.\n" +" -p FILE True if file is a named pipe.\n" +" -r FILE True if file is readable by you.\n" +" -s FILE True if file exists and is not empty.\n" +" -S FILE True if file is a socket.\n" +" -t FD True if FD is opened on a terminal.\n" +" -u FILE True if the file is set-user-id.\n" +" -w FILE True if the file is writable by you.\n" +" -x FILE True if the file is executable by you.\n" +" -O FILE True if the file is effectively owned by you.\n" +" -G FILE True if the file is effectively owned by your group.\n" +" -N FILE True if the file has been modified since it was last " +"read.\n" +" \n" +" FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" +" modification date).\n" +" \n" +" FILE1 -ot FILE2 True if file1 is older than file2.\n" +" \n" +" FILE1 -ef FILE2 True if file1 is a hard link to file2.\n" +" \n" +" String operators:\n" +" \n" +" -z STRING True if string is empty.\n" +" \n" +" -n STRING\n" +" STRING True if string is not empty.\n" +" \n" +" STRING1 = STRING2\n" +" True if the strings are equal.\n" +" STRING1 != STRING2\n" +" True if the strings are not equal.\n" +" STRING1 < STRING2\n" +" True if STRING1 sorts before STRING2 " +"lexicographically.\n" +" STRING1 > STRING2\n" +" True if STRING1 sorts after STRING2 lexicographically.\n" +" \n" +" Other operators:\n" +" \n" +" -o OPTION True if the shell option OPTION is enabled.\n" +" -v VAR\t True if the shell variable VAR is set\n" +" -R VAR\t True if the shell variable VAR is set and is a name " +"reference.\n" +" ! EXPR True if expr is false.\n" +" EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n" +" EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n" +" \n" +" arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Arithmetic binary operators return true if ARG1 is equal, not-equal,\n" +" less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n" +" than ARG2.\n" +" \n" +" Exit Status:\n" +" Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n" +" false or an invalid argument is given." +msgstr "" +"Évalue une expression conditionnelle.\n" +" \n" +" Se termine avec le code de retour 0 (vrai) ou 1 (faux) selon\n" +" le résultat de l'évaluation de EXPR. Les expressions peuvent être\n" +" unaires ou binaires. Les expressions unaires sont souvent utilisées\n" +" pour examiner l'état d'un fichier. Il existe aussi des opérateurs de\n" +" chaîne, ainsi que des opérateurs de comparaison numériques.\n" +" \n" +" Le comportement de test dépend du nombre d'arguments. Consultez la " +"page\n" +" de manuel de bash pour connaître les spécifications complètes.\n" +". \n" +" Opérateurs sur des fichiers : \n" +" \n" +" -a FICHIER Vrai si le fichier existe.\n" +" -b FICHIER Vrai si le fichier est un fichier spécial de bloc\n" +" -c FICHIER Vrai si le fichier est un fichier spécial de " +"caractères\n" +" -d FICHIER Vrai si le fichier est un répertoire.\n" +" -e FICHIER Vrai si le fichier existe\n" +" -f FICHIER Vrai si le fichier existe et est un fichier régulier\n" +" -g FICHIER Vrai si le fichier est « set-group-id »\n" +" -h FICHIER Vrai si le fichier est un lien symbolique\n" +" -L FICHIER Vrai si le fichier est un lien symbolique\n" +" -k FICHIER Vrai si le fichier a son bit « sticky » défini\n" +" -p FICHIER Vrai si le fichier est un tube nommé\n" +" -r FICHIER Vrai si le fichier est lisible par vous\n" +" -s FICHIER Vrai si le fichier existe et n'est pas vide\n" +" -S FICHIER Vrai si le fichier est un socket\n" +" -t FD Vrai si FD est ouvert sur un terminal\n" +" -u FICHIER Vrai si le fichier est « set-user-id »\n" +" -w FICHIER Vrai si le fichier peut être écrit par vous\n" +" -x FICHIER Vrai si le fichier est exécutable par vous\n" +" -O FICHIER Vrai si le fichier est effectivement possédé par " +"vous\n" +" -G FICHIER Vrai si le fichier est effectivement possédé par " +"votre groupe\n" +" -N FICHIER Vrai si le fichier a été modifié depuis la dernière " +"fois qu'il a été lu\n" +"\n" +" FICHIER1 -nt FICHIER2 Vrai si le fichier1 est plus récent que le " +"fichier2 (selon la date de modification)\n" +" FICHIER1 -ot FICHIER2 Vrai si le fichier1 est plus vieux que le " +"fichier2\n" +" FICHIER1 -ef FICHIER2 Vrai si le fichier1 est un lien physique vers " +"le fichier2\n" +" \n" +" Opérateurs sur des chaînes :\n" +" \n" +" -z CHAÎNE Vrai si la chaîne est vide\n" +" -n CHAÎNE\n" +" CHAÎNE Vrai si la chaîne n'est pas vide\n" +" \n" +" CHAÎNE1 = CHAÎNE2\n" +" Vrai si les chaînes sont égales\n" +" CHAÎNE1 != CHAÎNE2\n" +" Vrai si les chaînes ne sont pas égales\n" +" CHAÎNE1 < CHAÎNE2\n" +" Vrai si le tri lexicographique place la chaîne1 en " +"premier\n" +" CHAÎNE1 > CHAÎNE2\n" +" Vrai si le tri lexicographique place la chaîne1 en " +"deuxième\n" +" \n" +" Autres opérateurs :\n" +" \n" +" -o OPTION Vrai si l'OPTION du shell est activée\n" +" -v VAR\t Vrai si la variable de shell VAR est définie\n" +" ! EXPR Vrai si l'EXPRession est fausse\n" +" EXPR1 -a EXPR2 Vrai si les deux expressions sont vraies\n" +" EXPR1 -o EXPR2 Vrai si l'une des deux expressions est vraie\n" +" \n" +" arg1 OP arg2 Tests arithmétiques. OP peut être -eq, -ne,\n" +" -lt, -le, -gt ou -ge.\n" +" \n" +" Les opérateurs arithmétiques binaires renvoient « vrai » si ARG1 est " +"égal,\n" +" non-égal, inférieur, inférieur ou égal, supérieur, supérieur ou égal à " +"ARG2. \n" +" Code de sortie :\n" +" Renvoie le code de succès si EXPR est vraie, le code d'échec si EXPR est " +"fausse ou si\n" +" un argument non valable est donné." + +#: builtins.c:1329 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" This is a synonym for the \"test\" builtin, but the last argument must\n" +" be a literal `]', to match the opening `['." +msgstr "" +"Évalue une expression conditionnelle.\n" +" \n" +" Ceci est un synonyme de la primitive « test », mais le dernier argument\n" +" doit être le caractère « ] », pour fermer le « [ » correspondant." + +#: builtins.c:1338 +msgid "" +"Display process times.\n" +" \n" +" Prints the accumulated user and system times for the shell and all of " +"its\n" +" child processes.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Affiche les temps des processus.\n" +" \n" +" Affiche le cumul des temps utilisateur et système pour le shell et\n" +" tous ses processus fils.\n" +" \n" +" Code de retour :\n" +" Toujours le code de succès." + +#: builtins.c:1350 +msgid "" +"Trap signals and other events.\n" +" \n" +" Defines and activates handlers to be run when the shell receives " +"signals\n" +" or other conditions.\n" +" \n" +" ARG is a command to be read and executed when the shell receives the\n" +" signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n" +" is supplied) or `-', each specified signal is reset to its original\n" +" value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" +" shell and by the commands it invokes.\n" +" \n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. " +"If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. " +"If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or " +"a\n" +" script run by the . or source builtins finishes executing. A " +"SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause " +"the\n" +" shell to exit when the -e option is enabled.\n" +" \n" +" If no arguments are supplied, trap prints the list of commands " +"associated\n" +" with each signal.\n" +" \n" +" Options:\n" +" -l\tprint a list of signal names and their corresponding numbers\n" +" -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" +" \n" +" Each SIGNAL_SPEC is either a signal name in or a signal " +"number.\n" +" Signal names are case insensitive and the SIG prefix is optional. A\n" +" signal may be sent to the shell with \"kill -signal $$\".\n" +" \n" +" Exit Status:\n" +" Returns success unless a SIGSPEC is invalid or an invalid option is " +"given." +msgstr "" +"Intercepter des signaux et d'autres événements.\n" +" \n" +" Définit et active des gestionnaires à lancer lorsque le shell reçoit des " +"signaux\n" +" ou sous d'autres conditions.\n" +" \n" +" La commande ARG doit être lue et exécutée lorsque le shell reçoit le\n" +" signal SIGNAL_SPEC. Si ARG est absent (et qu'un unique SIGNAL_SPEC)\n" +" est fourni) ou égal à « - », tous les signaux spécifié sont remis\n" +" à leur valeur d'origine. Si ARG est une chaîne vide, tous les " +"SIGNAL_SPEC\n" +" sont ignorés par le shell et les commandes qu'il appelle.\n" +" \n" +" Si SIGNAL_SPEC est EXIT (0), la commande ARG est exécutée à la sortie du " +"shell. Si un\n" +" SIGNAL_SPEC est DEBUG, ARG est exécuté après chaque commande simple. Si\n" +" un SIGNAL_SPEC est RETURN, ARG est exécuté à chaque fois qu'une fonction " +"shell ou\n" +" qu'un script lancé avec . ou source se termine. Un SIGNAL_SPEC\n" +" valant ERR permet d'exécuter ARG à chaque fois qu'un échec d'une " +"commande engendrerait\n" +" la sortie du shell lorsque l'option -e est activée.\n" +" \n" +" Si aucun argument n'est fourni, « trap » affiche la liste des commandes " +"associées\n" +" à chaque signal.\n" +" \n" +" Options :\n" +" -l\taffiche la liste des noms de signaux et leur numéro correspondant\n" +" -p\taffiche les commandes de « trap » associées à chaque SIGNAL_SPEC\n" +" \n" +" Chaque SIGNAL_SPEC est soit un nom de signal dans \n" +" ou un numéro de signal. Les noms de signaux sont insensibles à la casse " +"et\n" +" le préfixe « SIG » est facultatif. Un signal peut être envoyé au\n" +" shell avec « kill -signal $$ ».\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de succès à moins que SIGSPEC ne soit pas valable ou " +"qu'une option non valable ne soit donnée." + +#: builtins.c:1386 +msgid "" +"Display information about command type.\n" +" \n" +" For each NAME, indicate how it would be interpreted if used as a\n" +" command name.\n" +" \n" +" Options:\n" +" -a\tdisplay all locations containing an executable named NAME;\n" +" \tincludes aliases, builtins, and functions, if and only if\n" +" \tthe `-p' option is not also used\n" +" -f\tsuppress shell function lookup\n" +" -P\tforce a PATH search for each NAME, even if it is an alias,\n" +" \tbuiltin, or function, and returns the name of the disk file\n" +" \tthat would be executed\n" +" -p\treturns either the name of the disk file that would be executed,\n" +" \tor nothing if `type -t NAME' would not return `file'.\n" +" -t\toutput a single word which is one of `alias', `keyword',\n" +" \t`function', `builtin', `file' or `', if NAME is an alias, shell\n" +" \treserved word, shell function, shell builtin, disk file, or not\n" +" \tfound, respectively\n" +" \n" +" Arguments:\n" +" NAME\tCommand name to be interpreted.\n" +" \n" +" Exit Status:\n" +" Returns success if all of the NAMEs are found; fails if any are not " +"found." +msgstr "" +"Affiche des informations sur le type de commande.\n" +" \n" +" Pour chaque NOM, indique comment il serait interprêté s'il était\n" +" utilisé comme un nom de commande.\n" +" \n" +" Options :\n" +" -a\taffiche tous les emplacements contenant un exécutable nommé NOM;\n" +" \tinclut les alias, les commandes intégrées et les fonctions si et " +"seulement si\n" +" \tl'option n'est pas « -p » n'est pas utilisée\n" +" -f\tdésactive la recherche de fonctions du shell\n" +" -P\tforce une recherche de CHEMIN pour chaque NOM, même si c'est un " +"alias,\n" +" \tune commande intégrée ou une fonction et renvoie le nom du fichier du " +"disque\n" +" \tqui serait exécuté\n" +" -p\trenvoie soir le nom du fichier du disque qui serait exécuté,\n" +" \tsoit rien si « type -t NOM » ne renvoyait pas « file ».\n" +" -t\taffiche un mot unique parmi « alias », « keyword »,\n" +" \t« function », « builtin », « file » or « », si NOM est respectivement " +"un alias,\n" +" \tun mot réservé du shell, une fonction du shell, une commande " +"intégrée,\n" +" \tun fichier du disque ou un nom inconnu\n" +" \n" +" Arguments :\n" +" NOM\tNom de commande à interpréter.\n" +" \n" +" Code de retour :\n" +" Renvoie le code de succès si tous les NOMs sont trouvés, le code d'échec " +"si l'un d'entre eux n'est pas trouvé." + +#: builtins.c:1417 +#, fuzzy +msgid "" +"Modify shell resource limits.\n" +" \n" +" Provides control over the resources available to the shell and " +"processes\n" +" it creates, on systems that allow such control.\n" +" \n" +" Options:\n" +" -S\tuse the `soft' resource limit\n" +" -H\tuse the `hard' resource limit\n" +" -a\tall current limits are reported\n" +" -b\tthe socket buffer size\n" +" -c\tthe maximum size of core files created\n" +" -d\tthe maximum size of a process's data segment\n" +" -e\tthe maximum scheduling priority (`nice')\n" +" -f\tthe maximum size of files written by the shell and its children\n" +" -i\tthe maximum number of pending signals\n" +" -l\tthe maximum size a process may lock into memory\n" +" -m\tthe maximum resident set size\n" +" -n\tthe maximum number of open file descriptors\n" +" -p\tthe pipe buffer size\n" +" -q\tthe maximum number of bytes in POSIX message queues\n" +" -r\tthe maximum real-time scheduling priority\n" +" -s\tthe maximum stack size\n" +" -t\tthe maximum amount of cpu time in seconds\n" +" -u\tthe maximum number of user processes\n" +" -v\tthe size of virtual memory\n" +" -x\tthe maximum number of file locks\n" +" -T the maximum number of threads\n" +" \n" +" Not all options are available on all platforms.\n" +" \n" +" If LIMIT is given, it is the new value of the specified resource; the\n" +" special LIMIT values `soft', `hard', and `unlimited' stand for the\n" +" current soft limit, the current hard limit, and no limit, respectively.\n" +" Otherwise, the current value of the specified resource is printed. If\n" +" no option is given, then -f is assumed.\n" +" \n" +" Values are in 1024-byte increments, except for -t, which is in seconds,\n" +" -p, which is in increments of 512 bytes, and -u, which is an unscaled\n" +" number of processes.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Modifie les limites de ressources du shell.\n" +" \n" +" Fournit un contrôle sur les ressources disponibles au shell et aux " +"processus\n" +" qu'il crée, sur les systèmes qui permettent un tel contrôle. \n" +" \n" +" Options :\n" +" -S\tutiliser la limite de ressources « soft »\n" +" -H\tutiliser la limite de ressources « hard »\n" +" -a\ttoutes les limites actuelles sont présentées\n" +" -b\tla taille du tampon de socket\n" +" -c\ttaille maximale des fichiers « core » créés\n" +" -d\ttaille maximale du segment de données d'un processus\n" +" -e\tla priorité maximale d'ordonnancement (« nice »)\n" +" -f\tla taille maximale des fichiers écrits par le shell et ses fils\n" +" -i\tle nombre maximal de signaux en attente\n" +" -l\tla taille maximale qu'un processus peut verrouiller en mémoire\n" +" -m\tla taille maximale de « set » résident\n" +" -n\tle nombre maximal de descripteurs de fichiers ouverts\n" +" -p\tla taille du tampon pour les tubes\n" +" -q\tle nombre maximal d'octets dans les queues de messages POSIX\n" +" -r\tla priorité maximale pour l'ordonnancement temps-réel\n" +" -s\tla taille maximale de la pile\n" +" -t\tla quantité maximale de temps processeur en secondes\n" +" -u\tle nombre maximal de processus utilisateurs\n" +" -v\tla taille de la mémoire virtuelle\n" +" -x\tle nombre maximal de verrous de fichiers\n" +" \n" +" Si LIMIT est fournie, elle est utilisée comme nouvelle valeur de " +"ressource\n" +" Les valeurs spéciales de LIMIT « soft », « hard » et « unlimited » " +"correspondent\n" +" respectivement aux valeurs actuelles de la limite souple, de la limite " +"dure,\n" +" ou à une absence de limite. Sinon la valeur actuelle de la limite est " +"affichée\n" +" Si aucune option n'est donnée, « -f » est supposée.\n" +" \n" +" Les valeurs sont des multiples de 1024 octets, sauf pour « -t » qui " +"prend des secondes,\n" +" « -p » qui prend un multiple de 512 octets et « -u » qui prend un " +"nombre\n" +" de processus sans unité.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de succès à moins qu'une option non valable ne soit " +"fournie ou qu'une erreur ne survienne." + +#: builtins.c:1465 +msgid "" +"Display or set file mode mask.\n" +" \n" +" Sets the user file-creation mask to MODE. If MODE is omitted, prints\n" +" the current value of the mask.\n" +" \n" +" If MODE begins with a digit, it is interpreted as an octal number;\n" +" otherwise it is a symbolic mode string like that accepted by chmod(1).\n" +" \n" +" Options:\n" +" -p\tif MODE is omitted, output in a form that may be reused as input\n" +" -S\tmakes the output symbolic; otherwise an octal number is output\n" +" \n" +" Exit Status:\n" +" Returns success unless MODE is invalid or an invalid option is given." +msgstr "" +"Affiche ou définit le masque de mode de fichier.\n" +" \n" +" Définit le masque de création de fichier comme étant MODE. Si MODE est " +"omis, affiche\n" +" la valeur courante du MASQUE.\n" +" \n" +" Si MODE commence par un chiffre, il est interprété comme un nombre " +"octal ;\n" +" sinon comme une chaîne de symboles de mode comme ceux acceptés par " +"chmod(1).\n" +" \n" +" Options :\n" +" -p\tsi MODE est omis, afficher sous une forme réutilisable comme une " +"entrée\n" +" -S\tafficher sous forme symbolique, sinon la sortie octale est " +"utilisée\n" +" \n" +" Code de retour :\n" +" Renvoie le code de succès à moins que MODE ne soit pas valable ou qu'une " +"option non valable ne soit donnée." + +#: builtins.c:1485 +#, fuzzy +msgid "" +"Wait for job completion and return exit status.\n" +" \n" +" Waits for each process identified by an ID, which may be a process ID or " +"a\n" +" job specification, and reports its termination status. If ID is not\n" +" given, waits for all currently active child processes, and the return\n" +" status is zero. If ID is a a job specification, waits for all " +"processes\n" +" in that job's pipeline.\n" +" \n" +" If the -n option is supplied, waits for the next job to terminate and\n" +" returns its exit status.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last ID; fails if ID is invalid or an invalid\n" +" option is given." +msgstr "" +"Attend la fin d'une tâche et renvoie le code de retour.\n" +" \n" +" Attend que le processus identifié par ID, qui peut être un ID de " +"processus ou\n" +" une spécification de tâche et renvoie son code de retour. Si ID n'est " +"pas\n" +" donné, la commande attend tous les processus actifs en cours et le code " +"de retour\n" +" est zéro. Si ID est une spécification de tâche, la commande attend tous " +"les processus\n" +" dans le pipeline de la tâche.\n" +" \n" +" Code de retour :\n" +" Renvoie le même code que celui d'ID, ou le code d'échec si ID n'est pas " +"valable ou en cas d'option non valable." + +#: builtins.c:1506 +#, fuzzy +msgid "" +"Wait for process completion and return exit status.\n" +" \n" +" Waits for each process specified by a PID and reports its termination " +"status.\n" +" If PID is not given, waits for all currently active child processes,\n" +" and the return status is zero. PID must be a process ID.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last PID; fails if PID is invalid or an " +"invalid\n" +" option is given." +msgstr "" +"Attend la fin d'un processus et renvoie le code de sortie.\n" +" \n" +" Attend le processus spécifié et donne son code de retour. Si PID n'est\n" +" pas donné, tous les processus fils actuellement actifs sont attendus\n" +" et le code de retour est zéro. PID doit être un ID de processus.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de ID, l'échec si ID n'est pas valable ou si une option " +"non valable\n" +" est donnée." + +#: builtins.c:1521 +msgid "" +"Execute commands for each member in a list.\n" +" \n" +" The `for' loop executes a sequence of commands for each member in a\n" +" list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is\n" +" assumed. For each element in WORDS, NAME is set to that element, and\n" +" the COMMANDS are executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Exécute des commandes pour chaque membre d'une liste.\n" +" \n" +" La boucle « for » exécute une suite de commandes pour chaque membre " +"d'une\n" +" liste d'éléments. Si « in MOTS ...; » n'est pas fourni, « in \"$@\" » " +"est\n" +" utilisé. Pour chaque élément dans MOTS, NOM est défini à cet élément,\n" +" et les COMMANDES sont exécutées.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de la dernière commande exécutée." + +#: builtins.c:1535 +msgid "" +"Arithmetic for loop.\n" +" \n" +" Equivalent to\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n" +" omitted, it behaves as if it evaluates to 1.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Boucle « for » arithmétique.\n" +" \n" +" Équivalent à\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 sont des expressions arithmétiques. Si une " +"expression\n" +" omise, elle se comporte comme si elle s'évaluait à 1.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de la dernière commande exécutée." + +#: builtins.c:1553 +msgid "" +"Select words from a list and execute commands.\n" +" \n" +" The WORDS are expanded, generating a list of words. The\n" +" set of expanded words is printed on the standard error, each\n" +" preceded by a number. If `in WORDS' is not present, `in \"$@\"'\n" +" is assumed. The PS3 prompt is then displayed and a line read\n" +" from the standard input. If the line consists of the number\n" +" corresponding to one of the displayed words, then NAME is set\n" +" to that word. If the line is empty, WORDS and the prompt are\n" +" redisplayed. If EOF is read, the command completes. Any other\n" +" value read causes NAME to be set to null. The line read is saved\n" +" in the variable REPLY. COMMANDS are executed after each selection\n" +" until a break command is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Sélectionne des mots d'une liste et exécute des commandes.\n" +" \n" +" Les mots WORDS subissent une expansion et génèrent une liste de mots.\n" +" L'ensemble de ces mots est affiché dans la sortie d'erreur, chacun\n" +" étant précédé d'un nombre. Si « in WORDS » n'est pas fourni, \n" +" « in \"$@\" » est utilisé. L'invite PS3 est ensuite affichée et une\n" +" ligne est lue depuis l'entrée standard. Si la ligne consiste en\n" +" le numéro d'un des mots affichés, alors ce mot est affecté à NAME.\n" +" Si la ligne est vide, WORDS et l'invite sont réaffichés. Si un EOF\n" +" est lu, la commande se termine. Toute autre valeur lue a pour effet\n" +" de vider NAME. La ligne lue est conservée dans la variable REPLY.\n" +" Les COMMANDS sont exécutées après chaque sélection jusqu'à ce qu'une\n" +" commande « break » soit exécutée.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de la dernière commande exécutée." + +#: builtins.c:1574 +msgid "" +"Report time consumed by pipeline's execution.\n" +" \n" +" Execute PIPELINE and print a summary of the real time, user CPU time,\n" +" and system CPU time spent executing PIPELINE when it terminates.\n" +" \n" +" Options:\n" +" -p\tprint the timing summary in the portable Posix format\n" +" \n" +" The value of the TIMEFORMAT variable is used as the output format.\n" +" \n" +" Exit Status:\n" +" The return status is the return status of PIPELINE." +msgstr "" +"Signale le temps passé pendant l'exécution d'un tube de commandes.\n" +" \n" +" Exécute PIPELINE et affiche un résumé du temps réel, du temps " +"processeur\n" +" utilisateur, et du temps processeur système passés à exécuter PIPELINE\n" +" lorsque celui-ci se termine.\n" +" \n" +" Options :\n" +" -p\taffiche le résumé dans le format portable Posix.\n" +" \n" +" La valeur de la variable TIMEFORMAT est utilisée comme format de " +"sortie.\n" +" \n" +" Code de sortie :\n" +" Le code de retour est celui du PIPELINE." + +#: builtins.c:1591 +msgid "" +"Execute commands based on pattern matching.\n" +" \n" +" Selectively execute COMMANDS based upon WORD matching PATTERN. The\n" +" `|' is used to separate multiple patterns.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Exécute des commandes selon une correspondance de motif.\n" +" \n" +" Exécute de manière sélective les COMMANDES selon la correspondance du " +"MOT\n" +" au MOTIF. Le caractère « | » est utilisé pour séparer les différents " +"motifs.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de la dernière commande exécutée." + +#: builtins.c:1603 +msgid "" +"Execute commands based on conditional.\n" +" \n" +" The `if COMMANDS' list is executed. If its exit status is zero, then " +"the\n" +" `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list " +"is\n" +" executed in turn, and if its exit status is zero, the corresponding\n" +" `then COMMANDS' list is executed and the if command completes. " +"Otherwise,\n" +" the `else COMMANDS' list is executed, if present. The exit status of " +"the\n" +" entire construct is the exit status of the last command executed, or " +"zero\n" +" if no condition tested true.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Exécute des commandes selon une condition.\n" +" \n" +" La liste « if COMMANDES » est exécutée. Si elle se termine avec un code " +"de zéro,\n" +" alors la liste « then COMMANDES » est exécutée. Sinon, chaque liste\n" +" « elif COMMANDES » est exécutée à son tour et si son code de retour est " +"zéro,\n" +" la liste « then COMMANDES » correspondante est exécutée et la commande « " +"if »\n" +" se termine. Sinon, la list « else COMMANDES » est exécutée si elle " +"existe.\n" +" Le code de retour de l'ensemble est celui de la dernière commande " +"exécutée\n" +" ou zéro si aucune condition n'était vraie.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de la dernière commande exécutée." + +#: builtins.c:1620 +msgid "" +"Execute commands as long as a test succeeds.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `while' COMMANDS has an exit status of zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Exécute des commandes aussi longtemps qu'elle réussissent.\n" +" \n" +" Effectue une expansion et exécute les COMMANDES aussi longtemps\n" +" que la commande finale parmi celles situées dans « while » se termine " +"avec un\n" +" code de retour de zéro.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de la dernière commande exécutée." + +#: builtins.c:1632 +msgid "" +"Execute commands as long as a test does not succeed.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `until' COMMANDS has an exit status which is not zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Exécute des commandes aussi longtemps qu'un test échoue.\n" +" \n" +" Effectue une expansion et exécute les commandes « COMMANDES » aussi " +"longtemps\n" +" que les commandes de « until » se terminent avec un code de retour\n" +" différent de zéro.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de la dernière commande exécutée." + +#: builtins.c:1644 +msgid "" +"Create a coprocess named NAME.\n" +" \n" +" Execute COMMAND asynchronously, with the standard output and standard\n" +" input of the command connected via a pipe to file descriptors assigned\n" +" to indices 0 and 1 of an array variable NAME in the executing shell.\n" +" The default NAME is \"COPROC\".\n" +" \n" +" Exit Status:\n" +" Returns the exit status of COMMAND." +msgstr "" +"Crée un coprocessus nommé NOM.\n" +" \n" +" Exécute la COMMANDE de manière asynchrone, en connectant la sortie et " +"l'entrée standard\n" +" de la commande par un tube aux decripteurs de fichier affectés aux " +"indices 0 et 1\n" +" d'une variable tableau NOM dans le shell en cours d'exécution.\n" +" Le NOM par défaut est « COPROC ».\n" +" \n" +" Code de retour :\n" +" Renvoie le même code de retour que la COMMANDE." + +#: builtins.c:1658 +msgid "" +"Define shell function.\n" +" \n" +" Create a shell function named NAME. When invoked as a simple command,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is " +"invoked,\n" +" the arguments are passed to the function as $1...$n, and the function's\n" +" name is in $FUNCNAME.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is readonly." +msgstr "" +"Définit une fonction du shell.\n" +" \n" +" Crée une fonction du shell nommée NOM. Lorsqu'appelée comme une simple " +"commande,\n" +" NOM lance la COMMANDE dans le contexte du shell qui l'appelle. Lorsque " +"NOM est appelé,\n" +" les arguments sont transmis à la fonction comme $1...$n, et le nom de la " +"fonction\n" +" est $FUNCNAME.\n" +" \n" +" Code de retour :\n" +" Renvoie le code de succès à moins que NOM ne soit en lecture seule." + +#: builtins.c:1672 +msgid "" +"Group commands as a unit.\n" +" \n" +" Run a set of commands in a group. This is one way to redirect an\n" +" entire set of commands.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Groupe plusieurs commandes en une seule.\n" +" \n" +" Lance un ensemble de commandes d'un groupe. Ceci est une façon de\n" +" rediriger tout un ensemble de commandes.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de la dernière commande exécutée." + +#: builtins.c:1684 +msgid "" +"Resume job in foreground.\n" +" \n" +" Equivalent to the JOB_SPEC argument to the `fg' command. Resume a\n" +" stopped or background job. JOB_SPEC can specify either a job name\n" +" or a job number. Following JOB_SPEC with a `&' places the job in\n" +" the background, as if the job specification had been supplied as an\n" +" argument to `bg'.\n" +" \n" +" Exit Status:\n" +" Returns the status of the resumed job." +msgstr "" +"Reprend une tâche en arrière plan.\n" +" \n" +" Équivalent à l'argument JOB_SPEC de la commande « fg ». Reprend " +"l'exécution\n" +" d'une tâche stoppée ou en tâche de fond. JOB_SPEC peut spécifier soit\n" +" un nom soit un numéro de tâche. Faire suivre JOB_SPEC de « & » permet " +"de\n" +" placer la tâche en arrière plan, comme si la spécification de tâche " +"avait\n" +" été fournie comme argument de « bg ».\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de la commande reprise." + +#: builtins.c:1699 +msgid "" +"Evaluate arithmetic expression.\n" +" \n" +" The EXPRESSION is evaluated according to the rules for arithmetic\n" +" evaluation. Equivalent to \"let EXPRESSION\".\n" +" \n" +" Exit Status:\n" +" Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise." +msgstr "" +"Évalue une expression arithmétique.\n" +" \n" +" L'EXPRESSION est évaluée selon les règles de l'évaluation arithmétique.\n" +" C'est équivalent à « let EXPRESSION ».\n" +" \n" +" Code de sortie :\n" +" Renvoie 1 si EXPRESSION est évaluée à 0, sinon renvoie 0." + +#: builtins.c:1711 +msgid "" +"Execute conditional command.\n" +" \n" +" Returns a status of 0 or 1 depending on the evaluation of the " +"conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries " +"used\n" +" by the `test' builtin, and may be combined using the following " +"operators:\n" +" \n" +" ( EXPRESSION )\tReturns the value of EXPRESSION\n" +" ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" +" EXPR1 && EXPR2\tTrue if both EXPR1 and EXPR2 are true; else false\n" +" EXPR1 || EXPR2\tTrue if either EXPR1 or EXPR2 is true; else false\n" +" \n" +" When the `==' and `!=' operators are used, the string to the right of\n" +" the operator is used as a pattern and pattern matching is performed.\n" +" When the `=~' operator is used, the string to the right of the operator\n" +" is matched as a regular expression.\n" +" \n" +" The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n" +" determine the expression's value.\n" +" \n" +" Exit Status:\n" +" 0 or 1 depending on value of EXPRESSION." +msgstr "" +"Exécute une commande conditionnelle.\n" +" \n" +" Renvoie un code de retour de 0 ou 1 dépendant de l'évaluation de " +"l'EXPRESSION\n" +" conditionnelle. Les expressions sont formées de la même façon que pour " +"la\n" +" primitive « test », et peuvent être combinées avec les opérateurs " +"suivants :\n" +" \n" +" \t( EXPRESSION )\tRenvoie la valeur de l'EXPRESSION\n" +" \t! EXPRESSION\tVrai si l'EXPRESSION est fausse, sinon vrai\n" +" \tEXPR1 && EXPR2\tVrai si EXPR1 et EXPR2 sont vraies, faux sinon\n" +" \tEXPR1 || EXPR2\tVrai si EXPR1 ou EXPR2 est vraie, faux sinon\n" +" \n" +" Lorsque les opérateurs « == » et « != » sont utilisés, la chaîne à " +"droite de l'opérateur\n" +" est utilisée comme motif, et une mise en correspondance est effectuée.\n" +" Lorsque l'opérateur « =~ » est utilisé, la chaîne à droite de " +"l'opérateur\n" +" est mise en correspondance comme une expression rationnelle.\n" +" \n" +" Les opérateurs « && » et « || » n'évaluent pas EXPR2 si\n" +" EXPR1 est suffisant pour déterminer la valeur de l'expression.\n" +" \n" +" Code de sortie :\n" +" 0 ou 1 selon la valeur de l'EXPRESSION." + +#: builtins.c:1737 +msgid "" +"Common shell variable names and usage.\n" +" \n" +" BASH_VERSION\tVersion information for this Bash.\n" +" CDPATH\tA colon-separated list of directories to search\n" +" \t\tfor directories given as arguments to `cd'.\n" +" GLOBIGNORE\tA colon-separated list of patterns describing filenames to\n" +" \t\tbe ignored by pathname expansion.\n" +" HISTFILE\tThe name of the file where your command history is stored.\n" +" HISTFILESIZE\tThe maximum number of lines this file can contain.\n" +" HISTSIZE\tThe maximum number of history lines that a running\n" +" \t\tshell can access.\n" +" HOME\tThe complete pathname to your login directory.\n" +" HOSTNAME\tThe name of the current host.\n" +" HOSTTYPE\tThe type of CPU this version of Bash is running under.\n" +" IGNOREEOF\tControls the action of the shell on receipt of an EOF\n" +" \t\tcharacter as the sole input. If set, then the value\n" +" \t\tof it is the number of EOF characters that can be seen\n" +" \t\tin a row on an empty line before the shell will exit\n" +" \t\t(default 10). When unset, EOF signifies the end of input.\n" +" MACHTYPE\tA string describing the current system Bash is running on.\n" +" MAILCHECK\tHow often, in seconds, Bash checks for new mail.\n" +" MAILPATH\tA colon-separated list of filenames which Bash checks\n" +" \t\tfor new mail.\n" +" OSTYPE\tThe version of Unix this version of Bash is running on.\n" +" PATH\tA colon-separated list of directories to search when\n" +" \t\tlooking for commands.\n" +" PROMPT_COMMAND\tA command to be executed before the printing of each\n" +" \t\tprimary prompt.\n" +" PS1\t\tThe primary prompt string.\n" +" PS2\t\tThe secondary prompt string.\n" +" PWD\t\tThe full pathname of the current directory.\n" +" SHELLOPTS\tA colon-separated list of enabled shell options.\n" +" TERM\tThe name of the current terminal type.\n" +" TIMEFORMAT\tThe output format for timing statistics displayed by the\n" +" \t\t`time' reserved word.\n" +" auto_resume\tNon-null means a command word appearing on a line by\n" +" \t\titself is first looked for in the list of currently\n" +" \t\tstopped jobs. If found there, that job is foregrounded.\n" +" \t\tA value of `exact' means that the command word must\n" +" \t\texactly match a command in the list of stopped jobs. A\n" +" \t\tvalue of `substring' means that the command word must\n" +" \t\tmatch a substring of the job. Any other value means that\n" +" \t\tthe command must be a prefix of a stopped job.\n" +" histchars\tCharacters controlling history expansion and quick\n" +" \t\tsubstitution. The first character is the history\n" +" \t\tsubstitution character, usually `!'. The second is\n" +" \t\tthe `quick substitution' character, usually `^'. The\n" +" \t\tthird is the `history comment' character, usually `#'.\n" +" HISTIGNORE\tA colon-separated list of patterns used to decide which\n" +" \t\tcommands should be saved on the history list.\n" +msgstr "" +"Nom et usage de variable shell courantes.\n" +" \n" +" BASH_VERSION\tNuméro de version de ce Bash.\n" +" CDPATH\tUne liste de répertoires, séparés par un deux-points, utilisés\n" +" \t\tpar « cd » pour la recherche de répertoires.\n" +" GLOBIGNORE\tUne liste de motifs séparés par un deux-points, décrivant " +"les\n" +" \t\tnoms de fichier à ignorer lors de l'expansion des chemins.\n" +" HISTFILE\tLe nom du fichier où votre historique des commandes est " +"stocké.\n" +" HISTFILESIZE\tLe nombre maximal de lignes que ce fichier peut contenir.\n" +" HISTSIZE\tLe nombre maximal de lignes d'historique auquel un shell en\n" +" \t\tfonctionnement peut accéder.\n" +" HOME\tLe chemin complet vers votre répertoire de connexion.\n" +" HOSTNAME\tLe nom de la machine actuelle.\n" +" HOSTTYPE\tLe type de processeur sur laquelle cette version de Bash " +"fonctionne.\n" +" IGNOREEOF\tContrôle l'action du shell à la réception d'un caractère « " +"EOF »\n" +" \t\tcomme seule entrée. Si défini, sa valeur est le nombre de " +"caractères\n" +" \t\t« EOF » qui peuvent être rencontrés à la suite sur une ligne vide\n" +" \t\tavant que le shell ne se termine (10 par défaut).\n" +" \t\tS'il n'est pas défini, « EOF » signifie la fin de l'entrée.\n" +" MACHTYPE\tUne chaîne décrivant le système actuel sur lequel fonctionne " +"Bash.\n" +" MAILCHECK\tLe nombre de secondes séparant deux vérifications du courrier " +"par Bash.\n" +" MAILPATH\tUne liste de fichiers séparés par un deux-points, que Bash " +"utilise\n" +" \t\tpour vérifier les nouveaux courriers.\n" +" OSTYPE\tLa version d'Unix sur laquelle cette version de Bash " +"fonctionne.\n" +" PATH\tUne liste de répertoires séparés par un deux-points, utilisés\n" +" \t\tpour la recherche des commandes.\n" +" PROMPT_COMMAND\tUne commande à exécuter avant d'afficher chaque invite\n" +" \t\tde commande principale.\n" +" PS1\t\tL'invite de commande principale.\n" +" PS2\t\tL'invite secondaire.\n" +" PWD\t\tLe chemin complet vers le répertoire actuel.\n" +" SHELLOPTS\tLa liste des options activées du shell, séparées par un deux-" +"points.\n" +" TERM\tLe nom du type actuel du terminal.\n" +" TIMEFORMAT\tLe format de sortie pour les statistiques de temps " +"affichées\n" +" \t\tpar le mot réservé « time ».\n" +" auto_resume\tNon-vide signifie qu'un mot de commande apparaissant\n" +" \t\tde lui-même sur une ligne est d'abord recherché dans la liste des\n" +" \t\ttâches stoppées. Si elle est trouvée, la tâche est remise en avant-" +"plan.\n" +" \t\tUne valeur de « exact » signifie que le mot de commande doit " +"correspondre\n" +" \t\texactement à la commande dans la liste des tâches stoppées. Une " +"valeur\n" +" \t\tde « substring » signifie que le mot de commande\n" +" \t\tcorrespondre à une sous-chaîne de la tâche. Une autre valeur " +"signifie\n" +" \t\tque la commande doit être un préfixe d'une tâche stoppée.\n" +" histchars\tCaractères contrôlant l'expansion d'historique et la " +"substitution\n" +" \t\trapide. Le premier caractère est le caractère de substitution " +"d'historique,\n" +" \t\thabituellement « ! ». Le deuxième est le caractère de substitution " +"rapide,\n" +" \t\thabituellement « ^ ». Le troisième est le caractère de commentaire\n" +" \t\td'historique, habituellement « # ».\n" +" HISTIGNORE\tUne liste de motifs séparés par un deux-points, utilisés " +"pour\n" +" \t\tdécider quelles commandes doivent être conservées dans la liste " +"d'historique.\n" + +#: builtins.c:1794 +msgid "" +"Add directories to stack.\n" +" \n" +" Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" +"Ajoute un répertoire à la pile.\n" +" \n" +" Ajoute un répertoire en haut de la pile des répertoires, ou permute\n" +" la pile, de façon que le répertoire en haut de la pile devienne\n" +" le nouveau répertoire de travail. S'il n'y a pas d'argument, les deux\n" +" répertoires en haut de la pile sont échangés.\n" +" \n" +" Options :\n" +" -n\tne pas changer de répertoire de travail lorsque des répertoires\n" +" \tsont ajoutés à la pile, de façon que seule la pile soit manipulée\n" +" \n" +" Arguments :\n" +" +N\tPermuter la pile de façon que le Nième répertoire se place en haut,\n" +" \ten comptant de zéro depuis la gauche de la liste fournie par « dirs " +"».\n" +" \n" +" -N\tPermuter la pile de façon que le Nième répertoire se place en haut,\n" +" \ten comptant de zéro depuis la droite de la liste fournie par « dirs " +"».\n" +" \n" +" dir\tajouter le répertoire DIR en haut de la pile, et en faire le " +"nouveau\n" +" \trépertoire de travail.\n" +" \n" +" Vous pouvez voir la pile des répertoires avec la commande « dirs ».\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de succès à moins qu'un argument non valable ne soit " +"fourni\n" +" ou que le changement de répertoire n'échoue." + +#: builtins.c:1828 +msgid "" +"Remove directories from stack.\n" +" \n" +" Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" +"Enlève des répertoires de la pile.\n" +" \n" +" Enlève des éléments de la pile des répertoires. S'il n'y a pas\n" +" d'argument, le répertoire en haut de la pile est enlevé,\n" +" et le nouveau sommet de la pile devient le répertoire de travail.\n" +" \n" +" Options :\n" +" -n\tne change pas de répertoire de travail lorsque des répertoires\n" +" \tsont enlevés de la pile, de façon que seule la pile soit manipulée\n" +" \n" +" Arguments :\n" +" +N\tEnlève le Nième répertoire, en comptant de zéro depuis la gauche\n" +" \tde la liste fournie par « dirs ». Par exemple : « popd +0 »\n" +" \tenlève le premier répertoire, « popd +1 » le deuxième. \n" +" -N\tEnlève le Nième répertoire, en comptant de zéro depuis la droite\n" +" \tde la liste fournie par « dirs ». Par exemple : « popd -0 »\n" +" \tenlève le dernier répertoire, « popd -1 » l'avant-dernier.\n" +" Vous pouvez voir la pile des répertoires avec la commande « dirs ».\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de succès à moins qu'un argument non valable ne soit " +"donné\n" +" ou que le changement de répertoire n'échoue." + +#: builtins.c:1858 +msgid "" +"Display directory stack.\n" +" \n" +" Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Affiche la pile de répertoire.\n" +" \n" +" Affiche la liste des répertoires actuellement mémorisés. Les " +"répertoires\n" +" sont insérés dans la liste avec la commande « pushd ». Vous pouvez " +"remonter\n" +" dans la liste en enlevant des éléments avec la commande « popd ».\n" +" \n" +" Options:\n" +" -c\teffacer la pile des répertoires en effaçant tous les éléments\n" +" -l\tne pas afficher la version raccourcie (avec ~) des répertoires\n" +" \trelativement à votre dossier personnel\n" +" -p\tafficher la pile des répertoires avec un élément par ligne\n" +" -v\tafficher la pile des répertoires avec un élément par ligne,\n" +" \ten préfixant avec sa position dans la pile\n" +" \n" +" Arguments :\n" +" +N\t affiche le Nième élément en comptant de zéro depuis la gauche de " +"la\n" +" liste affichée par « dirs » lorsque celle-ci est appelée sans option.\n" +" \n" +" -N\t affiche le Nième élément en comptant de zéro depuis la droite de " +"la\n" +" liste affichée par « dirs » lorsque celle-ci est appelée sans option.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de succès à moins qu'une option non valable ne soit " +"fournie ou qu'une erreur ne survienne." + +#: builtins.c:1887 +msgid "" +"Set and unset shell options.\n" +" \n" +" Change the setting of each shell option OPTNAME. Without any option\n" +" arguments, list all shell options with an indication of whether or not " +"each\n" +" is set.\n" +" \n" +" Options:\n" +" -o\trestrict OPTNAMEs to those defined for use with `set -o'\n" +" -p\tprint each shell option with an indication of its status\n" +" -q\tsuppress output\n" +" -s\tenable (set) each OPTNAME\n" +" -u\tdisable (unset) each OPTNAME\n" +" \n" +" Exit Status:\n" +" Returns success if OPTNAME is enabled; fails if an invalid option is\n" +" given or OPTNAME is disabled." +msgstr "" +"Active ou désactive des options du shell.\n" +" \n" +" Change la valeur de chaque option du shell NOMOPT. S'il n'y a pas " +"d'argument à l'option\n" +" la commande liste toutes les options du shell en indiquant si elles sont " +"actives\n" +" ou non.\n" +" \n" +" Options :\n" +" -o\trestreint les NOMOPT à ceux définis pour être utilisés avec « set -" +"o »\n" +" -p\taffiche chaque option du shell en indiquant son état\n" +" -q\tsupprime l'affichage\n" +" -s\tactive (set) chaque NOMOPT\n" +" -u\tdésactive (unset) chaque NOMOPT\n" +" \n" +" Code de retour :\n" +" Renvoie le code de succès si NOMOPT est active ; échec si une option non " +"valable\n" +" est donnée ou si NOMOPT est inactive." + +#: builtins.c:1908 +#, fuzzy +msgid "" +"Formats and prints ARGUMENTS under control of the FORMAT.\n" +" \n" +" Options:\n" +" -v var\tassign the output to shell variable VAR rather than\n" +" \t\tdisplay it on the standard output\n" +" \n" +" FORMAT is a character string which contains three types of objects: " +"plain\n" +" characters, which are simply copied to standard output; character " +"escape\n" +" sequences, which are converted and copied to the standard output; and\n" +" format specifications, each of which causes printing of the next " +"successive\n" +" argument.\n" +" \n" +" In addition to the standard format specifications described in " +"printf(1),\n" +" printf interprets:\n" +" \n" +" %b\texpand backslash escape sequences in the corresponding argument\n" +" %q\tquote the argument in a way that can be reused as shell input\n" +" %(fmt)T output the date-time string resulting from using FMT as a " +"format\n" +" string for strftime(3)\n" +" \n" +" The format is re-used as necessary to consume all of the arguments. If\n" +" there are fewer arguments than the format requires, extra format\n" +" specifications behave as if a zero value or null string, as " +"appropriate,\n" +" had been supplied.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a write or " +"assignment\n" +" error occurs." +msgstr "" +"Formatte et affiche des ARGUMENTS en contrôlant le FORMAT.\n" +" \n" +" Options :\n" +" -v var\taffecte la sortie à la variable VAR du shell plutôt que de " +"l'afficher\n" +" \t\tsur la sortie standard\n" +" \n" +" Le FORMAT est une chaîne de caractères qui contient trois types " +"d'objets : des caractères\n" +" normaux qui sont simplement copiés vers la sortie standard, des " +"séquences d'échappement\n" +" qui sont converties et copiées vers la sortie standard et des " +"spécifications de\n" +" format, chacun entraînant l'affichage de l'argument suivant.\n" +" \n" +" En plus des formats standards décrits dans printf(1) et printf(3), « " +"printf » interprète :\n" +" \n" +" %b\tdéveloppe les séquences d'échappement à contre-oblique dans " +"l'argument correspondant\n" +" %q\tprotège les arguments par guillemets de façon qu'ils puissent être " +"réutilisés\n" +" comme entrée du shell.\n" +" %(fmt)T renvoie la chaîne date-heure résultant de l'utilisation de FMT " +"comme une\n" +" chaîne de format pour strftime(3)\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de succès à moins qu'une option non valable ne soit " +"donnée ou qu'une\n" +" erreur d'écriture ou d'affectation ne survienne." + +#: builtins.c:1942 +msgid "" +"Specify how arguments are to be completed by Readline.\n" +" \n" +" For each NAME, specify how arguments are to be completed. If no " +"options\n" +" are supplied, existing completion specifications are printed in a way " +"that\n" +" allows them to be reused as input.\n" +" \n" +" Options:\n" +" -p\tprint existing completion specifications in a reusable format\n" +" -r\tremove a completion specification for each NAME, or, if no\n" +" \tNAMEs are supplied, all completion specifications\n" +" -D\tapply the completions and actions as the default for commands\n" +" \twithout any specific completion defined\n" +" -E\tapply the completions and actions to \"empty\" commands --\n" +" \tcompletion attempted on a blank line\n" +" \n" +" When completion is attempted, the actions are applied in the order the\n" +" uppercase-letter options are listed above. The -D option takes\n" +" precedence over -E.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Spécifie la façon dont Readline complète les arguments.\n" +" \n" +" Pour chaque NOM, la commande spécifie la façon dont les arguments son " +"complétés\n" +" S'il n'y a pas d'option, le réglage actuel est affiché d'une manièré " +"réutilisable comme\n" +" une entrée.\n" +" \n" +" Options :\n" +" -p\taffiche le réglage d'auto-complètement actuel dans un format " +"réutilisable\n" +" -r\tretire un réglage d'auto-complètement à chaque NOM ou, si aucun " +"NOM\n" +" \tn'est fourni, retire tous les réglages\n" +" -D\tapplique les auto-complètements et actions comme valeurs par " +"défaut aux commandes\n" +" \tne possédant aucun auto-complètement spécifique\n" +" -E\tapplique les auto-complètements et actions aux commandes vides (\n" +" \tauto-complètement tenté sur une ligne vide)\n" +" \n" +" Lorsqu'un auto-complètement est tenté, les actions sont appliquées dans " +"l'ordre\n" +" dans lequel les options en majuscule ci-dessus sont listées. L'option « " +"-D » est prioritaire\n" +" sur « -E ».\n" +" \n" +" Code de retour :\n" +" Renvoie le code de succès à moins qu'une option non valable ne soit " +"fournie ou qu'une erreur ne survienne." + +#: builtins.c:1970 +msgid "" +"Display possible completions depending on the options.\n" +" \n" +" Intended to be used from within a shell function generating possible\n" +" completions. If the optional WORD argument is supplied, matches " +"against\n" +" WORD are generated.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Affiche les possibilités de complètement dépendant des options.\n" +" \n" +" Ceci est destiné à être utilisé depuis une fonction de shell générant\n" +" des auto-complètements possibles. Si le MOT optionnel est fourni,\n" +" des correspondances avec « WORD » sont générées.\n" +" \n" +" Code de sortie :\n" +" Renvoie le code de succès à moins qu'une option non valable ne soit " +"fournie ou qu'une erreur ne survienne." + +#: builtins.c:1985 +msgid "" +"Modify or display completion options.\n" +" \n" +" Modify the completion options for each NAME, or, if no NAMEs are " +"supplied,\n" +" the completion currently being executed. If no OPTIONs are given, " +"print\n" +" the completion options for each NAME or the current completion " +"specification.\n" +" \n" +" Options:\n" +" \t-o option\tSet completion option OPTION for each NAME\n" +" \t-D\t\tChange options for the \"default\" command completion\n" +" \t-E\t\tChange options for the \"empty\" command completion\n" +" \n" +" Using `+o' instead of `-o' turns off the specified option.\n" +" \n" +" Arguments:\n" +" \n" +" Each NAME refers to a command for which a completion specification must\n" +" have previously been defined using the `complete' builtin. If no NAMEs\n" +" are supplied, compopt must be called by a function currently generating\n" +" completions, and the options for that currently-executing completion\n" +" generator are modified.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or NAME does not\n" +" have a completion specification defined." +msgstr "" +"Modifie ou affiche les options d'auto-complètement.\n" +" \n" +" Modifie les options d'auto-complètement pour chaque NOM ou, si aucun NOM " +"n'est fourni,\n" +" pour l'auto-complètement actuellement exécuté. si aucune OPTION n'est " +"donnée, affiche\n" +" les options d'auto-complètement de chaque NOM ou le réglage actuel " +"d'auto-complètement.\n" +" \n" +" Options :\n" +" \t-o option\tDéfinir l'option d'auto-complètement OPTION pour chaque " +"NOM\n" +" \t-D\t\tChanger les options pour l'auto-complètement de commande par " +"défaut\n" +" \t-E\t\tChanger les options pour l'auto-complètement de commande vide\n" +" \n" +" Utiliser « +o » au lieu de « -o » désactive l'option spécifiée.\n" +" \n" +" Arguments :\n" +" \n" +" Chaque NOM correspond à une commande pour laquelle un réglage d'auto-" +"complètement\n" +" doit déjà avoir été défini grâce à la commande intégrée « complete ». " +"Si aucun NOM\n" +" n'est fourni, « compopt » doit être appelée par une fonction générant " +"actuellement\n" +" des auto-complètements ; ainsi les options de ce générateur d'auto-" +"complètement en cours d'exécution\n" +" seront modifiées.\n" +" \n" +" Code de retour :\n" +" Renvoie le code de succès à moins qu'une option non valable ne soit " +"fournie\n" +" ou que NOM n'ait aucun réglage d'auto-complètement." + +#: builtins.c:2015 +msgid "" +"Read lines from the standard input into an indexed array variable.\n" +" \n" +" Read lines from the standard input into the indexed array variable " +"ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable " +"MAPFILE\n" +" is the default ARRAY.\n" +" \n" +" Options:\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are " +"copied.\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default " +"index is 0.\n" +" -s count \tDiscard the first COUNT lines read.\n" +" -t\t\tRemove a trailing newline from each line read.\n" +" -u fd\t\tRead lines from file descriptor FD instead of the standard " +"input.\n" +" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read.\n" +" -c quantum\tSpecify the number of lines read between each call to " +"CALLBACK.\n" +" \n" +" Arguments:\n" +" ARRAY\t\tArray variable name to use for file data.\n" +" \n" +" If -C is supplied without -c, the default quantum is 5000. When\n" +" CALLBACK is evaluated, it is supplied the index of the next array\n" +" element to be assigned and the line to be assigned to that element\n" +" as additional arguments.\n" +" \n" +" If not supplied with an explicit origin, mapfile will clear ARRAY " +"before\n" +" assigning to it.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or ARRAY is readonly " +"or\n" +" not an indexed array." +msgstr "" +"Lit des lignes depuis l'entrée standard vers une variable tableau indexé.\n" +" \n" +" Lit des lignes depuis l'entrée standard vers la variable tableau indexé " +"TABLEAU ou\n" +" depuis le descripteur de fichier FD si l'option « -u » est utilisée. La " +"variable MAPFILE\n" +" est le TABLEAU par défaut.\n" +" \n" +" Options :\n" +" -n nombre\tCopie au maximum NOMBRE lignes. Si NOMBRE est 0, toutes " +"les lignes sont copiées.\n" +" -O origine\tCommence l'affectation au TABLEAU à l'indice ORIGINE. " +"L'indice par défaut est 0.\n" +" -s nombre\tSaute les NOMBRE premières lignes lues.\n" +" -t\t\tRetire les retours à la ligne de chaque ligne lue.\n" +" -u fd\t\tLit les lignes depuis le descripteur de fichier FD au lieu de " +"l'entrée standard.\n" +" -C callback\tÉvalue le CALLBACK à chaque fois que QUANTUM lignes sont " +"lues.\n" +" -c quantum\tIndique le nombre de lignes lues entre chaque appel au " +"CALLBACK.\n" +" \n" +" Arguments :\n" +" TABLEAU\t\tNom de la variable tableau à utiliser pour les données.\n" +" \n" +" Si l'option « -C » est fournie sans option « -c », le quantum par défaut " +"est 5000. Lorsque\n" +" CALLBACK est évalué, l'indice du prochain élément de tableau qui sera " +"affecté\n" +" lui est transmis comme argument additionnel.\n" +" \n" +" Si la commande « mapfile » n'est pas fournie avec une origine explicite, " +"le tableau est vidé\n" +" avant affectation.\n" +" \n" +" code de retour :\n" +" Renvoie le code de succès à moins qu'une option non valable ne soit " +"donnée ou que\n" +" le TABLEAU soit en lecture seule ou ne soit pas un tableau indexé." + +#: builtins.c:2049 +msgid "" +"Read lines from a file into an array variable.\n" +" \n" +" A synonym for `mapfile'." +msgstr "" +"Lit des lignes depuis un fichier vers une variable tableau.\n" +" \n" +" Synonyme de « mapfile »." + +#~ msgid "Copyright (C) 2009 Free Software Foundation, Inc.\n" +#~ msgstr "Copyright (C) 2009 Free Software Foundation, Inc.\n" + +#~ msgid "" +#~ "License GPLv2+: GNU GPL version 2 or later \n" +#~ msgstr "" +#~ "Licence GPLv2+ : GNU GPL version 2 ou ultérieure \n" + +#~ msgid "" +#~ ". With EXPR, returns\n" +#~ " " +#~ msgstr "" +#~ ". Avec EXPR, renvoie\n" +#~ " " + +#~ msgid "" +#~ "; this extra information can be used to\n" +#~ " provide a stack trace.\n" +#~ " \n" +#~ " The value of EXPR indicates how many call frames to go back before " +#~ "the\n" +#~ " current one; the top frame is frame 0." +#~ msgstr "" +#~ "; ces informations supplémentaires peuvent être utilisées pour\n" +#~ " fournir une trace d'appels\n" +#~ " \n" +#~ " La valeur de EXPR indique le nombre de cadres d'appels duquel il faut " +#~ "revenir en arrière\n" +#~ " avant le cadre actuel ; le cadre supérieur est le cadre 0." + +#~ msgid " " +#~ msgstr " " + +#~ msgid "Without EXPR, returns returns \"$line $filename\". With EXPR," +#~ msgstr "Sans « EXPR », renvoie « $ligne $nomfichier ». Avec « EXPR »," + +#~ msgid "returns \"$line $subroutine $filename\"; this extra information" +#~ msgstr "" +#~ "renvoie « $ligne $sousroutine $nomfichier » ; cette information " +#~ "supplémentaire" + +#~ msgid "can be used used to provide a stack trace." +#~ msgstr "peut être utilisée pour fournir une trace de la pile" + +#~ msgid "" +#~ "The value of EXPR indicates how many call frames to go back before the" +#~ msgstr "" +#~ "La valeur de « EXPR » indique le nombre de cadres d'appel dont il faut " +#~ "reculer" + +#~ msgid "current one; the top frame is frame 0." +#~ msgstr "par rapport à l'actuel ; le cadre supérieur est le cadre 0." + +#~ msgid "%s: invalid number" +#~ msgstr "%s : nombre non valable" + +#~ msgid "Shell commands matching keywords `" +#~ msgstr "Commandes du shell correspondant aux mots-clés « " + +#~ msgid "Display the list of currently remembered directories. Directories" +#~ msgstr "" +#~ "Affiche la liste des répertoires actuellement mémorisés. Les répertoires" + +#~ msgid "find their way onto the list with the `pushd' command; you can get" +#~ msgstr "sont insérés dans la pile avec la commande « pushd » ; vous pouvez" + +#~ msgid "back up through the list with the `popd' command." +#~ msgstr "" +#~ "remonter dans la pile en enlevant des éléments avec la commande « popd »." + +#~ msgid "" +#~ "The -l flag specifies that `dirs' should not print shorthand versions" +#~ msgstr "" +#~ "L'option « -l » demande à « dirs » de ne pas afficher sous forme abrégée" + +#~ msgid "" +#~ "of directories which are relative to your home directory. This means" +#~ msgstr "" +#~ "les répertoires relatifs à votre répertoire personnel. Cela signifie que" + +#~ msgid "that `~/bin' might be displayed as `/homes/bfox/bin'. The -v flag" +#~ msgstr "" +#~ "le répertoire « ~/bin » pourra être affiché « /homes/bfox/bin ». L'option " +#~ "« -v »" + +#~ msgid "causes `dirs' to print the directory stack with one entry per line," +#~ msgstr "demande à « dirs » d'afficher un répertoire de la pile par ligne," + +#~ msgid "" +#~ "prepending the directory name with its position in the stack. The -p" +#~ msgstr "" +#~ "en le précédant de sa position dans la pile. L'option « -p » fait la " +#~ "même chose" + +#~ msgid "flag does the same thing, but the stack position is not prepended." +#~ msgstr "sans afficher le numéro d'emplacement dans la pile." + +#~ msgid "" +#~ "The -c flag clears the directory stack by deleting all of the elements." +#~ msgstr "" +#~ "L'option « -c » vide la pile des répertoires en retirant tous ses " +#~ "éléments." + +#~ msgid "" +#~ "+N displays the Nth entry counting from the left of the list shown by" +#~ msgstr "" +#~ "+N affiche la Nième entrée à partir de la gauche de la liste fournie par" + +#~ msgid " dirs when invoked without options, starting with zero." +#~ msgstr "" +#~ " « dirs » lorsqu'elle est appelée sans option, la première entrée " +#~ "étant zéro." + +#~ msgid "" +#~ "-N displays the Nth entry counting from the right of the list shown by" +#~ msgstr "" +#~ "+N affiche la Nième entrée à partir de la droite de la liste fournie par" + +#~ msgid "Adds a directory to the top of the directory stack, or rotates" +#~ msgstr "" +#~ "Ajoute un répertoire au dessus de la pile des répertoires ou effectue une" + +#~ msgid "the stack, making the new top of the stack the current working" +#~ msgstr "" +#~ "rotation de la pile en plaçant le répertoire supérieur comme répertoire " +#~ "courant." + +#~ msgid "directory. With no arguments, exchanges the top two directories." +#~ msgstr "" +#~ "Sans paramètre, les deux répertoires supérieurs de la pile sont échangés." + +#~ msgid "+N Rotates the stack so that the Nth directory (counting" +#~ msgstr "" +#~ "+N effectue une rotation de la pile de façon que le Nième répertoire " +#~ "soit" + +#~ msgid " from the left of the list shown by `dirs', starting with" +#~ msgstr "" +#~ "placé au dessus (N commençant à zéro et en partant à gauche de la liste" + +#~ msgid " zero) is at the top." +#~ msgstr " fournie par « dirs »)." + +#~ msgid "-N Rotates the stack so that the Nth directory (counting" +#~ msgstr "" +#~ "+N effectue une rotation de la pile de façon que le Nième répertoire " +#~ "soit" + +#~ msgid " from the right of the list shown by `dirs', starting with" +#~ msgstr "" +#~ "placé au dessus (N commençant à zéro et en partant à gauche de la liste" + +#~ msgid "-n suppress the normal change of directory when adding directories" +#~ msgstr "" +#~ "-n inhibe le changement de répertoire lors d'un ajout de répertoire " + +#~ msgid " to the stack, so only the stack is manipulated." +#~ msgstr " à la liste. Seule la pile est manipulée." + +#~ msgid "dir adds DIR to the directory stack at the top, making it the" +#~ msgstr "" +#~ "dir ajoute « DIR » au dessus de la pile des répertoires, en faisant de " +#~ "lui" + +#~ msgid " new current working directory." +#~ msgstr " le nouveau répertoire courant." + +#~ msgid "You can see the directory stack with the `dirs' command." +#~ msgstr "" +#~ "Vous pouvez voir le contenu de la pile des répertoires avec la commande « " +#~ "dirs »." + +#~ msgid "Removes entries from the directory stack. With no arguments," +#~ msgstr "Enlève des éléments de la pile des répertoires. Sans paramètre," + +#~ msgid "removes the top directory from the stack, and cd's to the new" +#~ msgstr "le répertoire supérieur de la pile est enlevé et un changement de" + +#~ msgid "top directory." +#~ msgstr "de répertoire se fait vers le nouveau répertoire supérieur." + +#~ msgid "+N removes the Nth entry counting from the left of the list" +#~ msgstr "+N enlève le Nième élément en commençant à zéro à gauche" + +#~ msgid " shown by `dirs', starting with zero. For example: `popd +0'" +#~ msgstr "de la liste affichée par « dirs ». Par exemple, « popd +0 »" + +#~ msgid " removes the first directory, `popd +1' the second." +#~ msgstr " enlève le premier répertoire, « popd +1 » le second." + +#~ msgid "-N removes the Nth entry counting from the right of the list" +#~ msgstr "+N enlève la Nième entrée en commençant à zéro à droite" + +#~ msgid " shown by `dirs', starting with zero. For example: `popd -0'" +#~ msgstr "de la liste affichée par « dirs ». Par exemple, « popd -0 »" + +#~ msgid " removes the last directory, `popd -1' the next to last." +#~ msgstr " enlève le dernier répertoire, « popd -1 » l'avant-dernier." + +#~ msgid "" +#~ "-n suppress the normal change of directory when removing directories" +#~ msgstr "" +#~ "-n inhibe le changement de répertoire lors de l'enlèvement d'un " +#~ "répertoire" + +#~ msgid " from the stack, so only the stack is manipulated." +#~ msgstr " de la liste. Seule la pile est manipulée." + +#~ msgid "allocated" +#~ msgstr "alloué" + +#~ msgid "freed" +#~ msgstr "libéré" + +#~ msgid "requesting resize" +#~ msgstr "demande de redimensionnement" + +#~ msgid "just resized" +#~ msgstr "redimensionné à l'instant" + +#~ msgid "bug: unknown operation" +#~ msgstr "bogue : opération inconnue" + +#~ msgid "malloc: watch alert: %p %s " +#~ msgstr "malloc : alerte de « watch » : %p %s " + +#~ msgid "xrealloc: cannot reallocate %lu bytes (%lu bytes allocated)" +#~ msgstr "xrealloc : impossible de réallouer %lu octets (%lu octets alloués)" + +#~ msgid "xrealloc: cannot allocate %lu bytes" +#~ msgstr "xrealloc : impossible d'allouer %lu octets" + +#~ msgid "xrealloc: %s:%d: cannot reallocate %lu bytes (%lu bytes allocated)" +#~ msgstr "" +#~ "xrealloc : %s:%d : impossible de réallouer %lu octets (%lu octets alloués)" + +#~ msgid "" +#~ "Exit from within a FOR, WHILE or UNTIL loop. If N is specified,\n" +#~ " break N levels." +#~ msgstr "" +#~ "Permet de sortir d'une boucle FOR, WHILE ou UNTIL. Si N est précisé,\n" +#~ " la sortie de boucle se fait sur N niveaux." + +#~ msgid "" +#~ "Run a shell builtin. This is useful when you wish to rename a\n" +#~ " shell builtin to be a function, but need the functionality of the\n" +#~ " builtin within the function itself." +#~ msgstr "" +#~ "Lance une primitive du shell. Ceci est utile lorsque vous souhaitez " +#~ "nommer une fonction comme\n" +#~ " une primitive, mais que vous avez besoin d'utiliser la primitive dans " +#~ "la fonction elle-même." + +#~ msgid "" +#~ "Print the current working directory. With the -P option, pwd prints\n" +#~ " the physical directory, without any symbolic links; the -L option\n" +#~ " makes pwd follow symbolic links." +#~ msgstr "" +#~ "Affiche le répertoire de travail actuel. Avec l'option « -P », « pwd » " +#~ "affiche\n" +#~ " le répertoire physique, sans lien symbolique ; l'option « -L »\n" +#~ " demande à « pwd » de suivre les liens symboliques." + +#~ msgid "Return a successful result." +#~ msgstr "Renvoie un résultat de succès" + +#~ msgid "" +#~ "Runs COMMAND with ARGS ignoring shell functions. If you have a shell\n" +#~ " function called `ls', and you wish to call the command `ls', you can\n" +#~ " say \"command ls\". If the -p option is given, a default value is " +#~ "used\n" +#~ " for PATH that is guaranteed to find all of the standard utilities. " +#~ "If\n" +#~ " the -V or -v option is given, a string is printed describing " +#~ "COMMAND.\n" +#~ " The -V option produces a more verbose description." +#~ msgstr "" +#~ "Lance la commande COMMAND avec les ARGS en ignorant les fonctions du " +#~ "shell. Si vous\n" +#~ " avez défini une fonction de shell appelée « ls » et que vous voulez " +#~ "appeler\n" +#~ " la commande « ls », vous pouvez faire « command ls ». Si l'option « -" +#~ "p » est\n" +#~ " donnée, une valeur par défaut est utilisée pour le PATH garantissant " +#~ "que tous\n" +#~ " les utilitaires standards seront trouvés. Si l'option « -V » ou « -v " +#~ "» est\n" +#~ " donnée, une description de la commande s'affiche. L'option « -V » " +#~ "fournit plus\n" +#~ " d'informations." + +#~ msgid "" +#~ "Declare variables and/or give them attributes. If no NAMEs are\n" +#~ " given, then display the values of variables instead. The -p option\n" +#~ " will display the attributes and values of each NAME.\n" +#~ " \n" +#~ " The flags are:\n" +#~ " \n" +#~ " -a\tto make NAMEs arrays (if supported)\n" +#~ " -f\tto select from among function names only\n" +#~ " -F\tto display function names (and line number and source file name " +#~ "if\n" +#~ " \tdebugging) without definitions\n" +#~ " -i\tto make NAMEs have the `integer' attribute\n" +#~ " -r\tto make NAMEs readonly\n" +#~ " -t\tto make NAMEs have the `trace' attribute\n" +#~ " -x\tto make NAMEs export\n" +#~ " \n" +#~ " Variables with the integer attribute have arithmetic evaluation (see\n" +#~ " `let') done when the variable is assigned to.\n" +#~ " \n" +#~ " When displaying values of variables, -f displays a function's name\n" +#~ " and definition. The -F option restricts the display to function\n" +#~ " name only.\n" +#~ " \n" +#~ " Using `+' instead of `-' turns off the given attribute instead. " +#~ "When\n" +#~ " used in a function, makes NAMEs local, as with the `local' command." +#~ msgstr "" +#~ "Déclare des variables ou ajoute des attributs aux variables. Si aucun " +#~ "nom\n" +#~ " n'est donné, affiche plutôt les valeurs des variables. L'option « -p " +#~ "»\n" +#~ " permet d'afficher les attributs et les valeurs de chaque NAME.\n" +#~ " \n" +#~ " Les options sont :\n" +#~ " \n" +#~ " -a\tpour faire des tableaux de NAME (si pris en charge)\n" +#~ " -f\tpour choisir uniquement parmi les noms de fonctions\n" +#~ " -F\tpour afficher les noms de fonctions (et les numéros de ligne et " +#~ "le\n" +#~ " \tfichier source si le mode de débogage est activé\n" +#~ " -i\tpour que les NAME aient l'attribut « integer »\n" +#~ " -r\tpour que les NAME soient en lecture seule\n" +#~ " -t\tpour que les NAME aient l'attribut « trace »\n" +#~ " -x\tpour faire un export des NAME\n" +#~ " \n" +#~ " L'évaluation arithmétique des variables ayant l'attribut « integer » " +#~ "est\n" +#~ " effectuée au moment de l'affectation (voir « let »).\n" +#~ " \n" +#~ " Lors de l'affichage des valeurs de variables, -f affiche le nom de la " +#~ "fonction\n" +#~ " et sa définition. L'option -F permet de n'afficher que le nom.\n" +#~ " \n" +#~ " Un attribut peut être désactivé en utilisant « + » au lieu de « - ». " +#~ "Dans une\n" +#~ " fonction, ceci a pour effet de rendre les NAME locaux, comme avec la " +#~ "commande «local »." + +#~ msgid "Obsolete. See `declare'." +#~ msgstr "Obsolète. Consulter « declare »." + +#~ msgid "" +#~ "Create a local variable called NAME, and give it VALUE. LOCAL\n" +#~ " can only be used within a function; it makes the variable NAME\n" +#~ " have a visible scope restricted to that function and its children." +#~ msgstr "" +#~ "Permet de créer une variable locale appelée NAME, et de lui affecter une " +#~ "VALUE.\n" +#~ " LOCAL peut seulement être utilisé à l'intérieur d'une fonction ; il " +#~ "rend le nom de\n" +#~ " variable NAME visible uniquement à l'intérieur de la fonction et de " +#~ "ses filles." + +#~ msgid "" +#~ "Output the ARGs. If -n is specified, the trailing newline is suppressed." +#~ msgstr "Affiche les ARGs. L'option « -n » supprime le saut de ligne final." + +#~ msgid "" +#~ "Enable and disable builtin shell commands. This allows\n" +#~ " you to use a disk command which has the same name as a shell\n" +#~ " builtin without specifying a full pathname. If -n is used, the\n" +#~ " NAMEs become disabled; otherwise NAMEs are enabled. For example,\n" +#~ " to use the `test' found in $PATH instead of the shell builtin\n" +#~ " version, type `enable -n test'. On systems supporting dynamic\n" +#~ " loading, the -f option may be used to load new builtins from the\n" +#~ " shared object FILENAME. The -d option will delete a builtin\n" +#~ " previously loaded with -f. If no non-option names are given, or\n" +#~ " the -p option is supplied, a list of builtins is printed. The\n" +#~ " -a option means to print every builtin with an indication of whether\n" +#~ " or not it is enabled. The -s option restricts the output to the " +#~ "POSIX.2\n" +#~ " `special' builtins. The -n option displays a list of all disabled " +#~ "builtins." +#~ msgstr "" +#~ "Active et désactive les primitives du shell. Ceci permet\n" +#~ " d'utiliser une commande du disque qui a le même nom qu'une commande " +#~ "intégrée\n" +#~ " sans devoir spécifier un chemin complet. Si « -n » est utilisé, les\n" +#~ " noms NAME sont désactivés ; sinon, les noms NAME sont activés. Par " +#~ "exemple,\n" +#~ " pour utiliser « test » trouvé dans $PATH au lieu de la primitive du\n" +#~ " même nom, tapez « enable -n test ». Sur les systèmes permettant le " +#~ "chargement\n" +#~ " dynamique, l'option « -f » peut être utilisée pour charger de " +#~ "nouvelles primitives\n" +#~ " depuis l'objet partagé FILENAME. L'option « -d » efface une " +#~ "primitive précédemment\n" +#~ " chargée avec « -f ». Si aucun nom (n'étant pas une option) n'est " +#~ "donné, ou si l'option\n" +#~ " « -p » est spécifiée, une liste de primitive est affichée. L'option " +#~ "« -a » permet d'afficher\n" +#~ " toutes les primitives en précisant si elles sont activées ou non. " +#~ "L'option « -s » restreint\n" +#~ " la sortie aux primitives « special » POSIX.2. L'option « -n » affiche " +#~ "une liste de toutes les\n" +#~ " primitives désactivées." + +#~ msgid "" +#~ "Read ARGs as input to the shell and execute the resulting command(s)." +#~ msgstr "" +#~ "Lit les ARGs comme une entrée du shell et exécute les commandes " +#~ "résultantes." + +#~ msgid "" +#~ "Exec FILE, replacing this shell with the specified program.\n" +#~ " If FILE is not specified, the redirections take effect in this\n" +#~ " shell. If the first argument is `-l', then place a dash in the\n" +#~ " zeroth arg passed to FILE, as login does. If the `-c' option\n" +#~ " is supplied, FILE is executed with a null environment. The `-a'\n" +#~ " option means to make set argv[0] of the executed process to NAME.\n" +#~ " If the file cannot be executed and the shell is not interactive,\n" +#~ " then the shell exits, unless the shell option `execfail' is set." +#~ msgstr "" +#~ "Exécute le fichier FILE en remplaçant ce shell par le programme " +#~ "spécifié.\n" +#~ " Si FILE n'est pas spécifié, les redirections prennent effet dans\n" +#~ " ce shell. Si le premier argument est « -l », un tiret est placé dans\n" +#~ " l'argument n°0 transmis à FILE, comme le fait « login ». Si l'option\n" +#~ " « -c » est fournie, FILE est exécuté avec un environnement vide.\n" +#~ " L'option « -a » indique de définir « argv[0] » du processus exécuté\n" +#~ " à NAME. Si le fichier ne peut pas être exécuté et que le shell n'est\n" +#~ " pas interactif, alors le shell se termine, à moins que l'option « " +#~ "execfail »\n" +#~ " ne soit définie." + +#~ msgid "Logout of a login shell." +#~ msgstr "Fermer un shell de connexion" + +#~ msgid "" +#~ "For each NAME, the full pathname of the command is determined and\n" +#~ " remembered. If the -p option is supplied, PATHNAME is used as the\n" +#~ " full pathname of NAME, and no path search is performed. The -r\n" +#~ " option causes the shell to forget all remembered locations. The -d\n" +#~ " option causes the shell to forget the remembered location of each " +#~ "NAME.\n" +#~ " If the -t option is supplied the full pathname to which each NAME\n" +#~ " corresponds is printed. If multiple NAME arguments are supplied " +#~ "with\n" +#~ " -t, the NAME is printed before the hashed full pathname. The -l " +#~ "option\n" +#~ " causes output to be displayed in a format that may be reused as " +#~ "input.\n" +#~ " If no arguments are given, information about remembered commands is " +#~ "displayed." +#~ msgstr "" +#~ "Pour chaque NAME, le chemin complet de la commande est déterminé puis " +#~ "mémorisé.\n" +#~ " Si l'option « -p » est fournie, le CHEMIN est utilisé comme chemin " +#~ "complet\n" +#~ " pour NAME, et aucune recherche n'est effectuée. L'option « -r » " +#~ "demande au shell\n" +#~ " d'oublier tous les chemins mémorisés. L'option « -d » demande au " +#~ "shell d'oublier\n" +#~ " les chemins mémorisés pour le NAME. Si l'option « -t » est fournie, " +#~ "le chemin\n" +#~ " complet auquel correspond chaque NAME est affiché. Si plusieurs NAME " +#~ "sont fournis\n" +#~ " à l'option « -t », le NAME est affiché avant chemin complet haché. " +#~ "L'option\n" +#~ " « -l » permet d'utiliser un format de sortie qui peut être réutilisé " +#~ "comme entrée.\n" +#~ " Si aucun argument n'est donné, des informations sur les commandes " +#~ "mémorisées sont\n" +#~ " affichées." + +#~ msgid "" +#~ "Display helpful information about builtin commands. If PATTERN is\n" +#~ " specified, gives detailed help on all commands matching PATTERN,\n" +#~ " otherwise a list of the builtins is printed. The -s option\n" +#~ " restricts the output for each builtin command matching PATTERN to\n" +#~ " a short usage synopsis." +#~ msgstr "" +#~ "Affiche des informations utiles sur les commandes intégrées. Si MOTIF\n" +#~ " est précisé, une aide détaillée sur toutes les commandes " +#~ "correspondant\n" +#~ " au MOTIF sont affichées, sinon une liste des commandes intégrées est\n" +#~ " fournie. L'option « -s » restreint l'affichage de chaque commande\n" +#~ " correspondant au MOTIF à une courte description sur l'utilisation." + +#~ msgid "" +#~ "By default, removes each JOBSPEC argument from the table of active jobs.\n" +#~ " If the -h option is given, the job is not removed from the table, but " +#~ "is\n" +#~ " marked so that SIGHUP is not sent to the job if the shell receives a\n" +#~ " SIGHUP. The -a option, when JOBSPEC is not supplied, means to remove " +#~ "all\n" +#~ " jobs from the job table; the -r option means to remove only running " +#~ "jobs." +#~ msgstr "" +#~ "Par défaut, enlève tous les arguments JOBSPEC de la table des tâches " +#~ "actives.\n" +#~ " Si l'option « -h » est fournie, la tâche n'est pas retirée de la " +#~ "table mais\n" +#~ " est marquée de telle sorte que le signal SIGHUP ne lui soit pas " +#~ "envoyé quand\n" +#~ " le shell reçoit un SIGHUP. Lorsque JOBSPEC n'est pas fournie, " +#~ "l'option « -a »,\n" +#~ " permet d'enlever toutes les tâches de la table des tâches. L'option « " +#~ "-r »\n" +#~ " indique de ne retirer que les tâches en cours de fonctionnement." + +#~ msgid "" +#~ "One line is read from the standard input, or from file descriptor FD if " +#~ "the\n" +#~ " -u option is supplied, and the first word is assigned to the first " +#~ "NAME,\n" +#~ " the second word to the second NAME, and so on, with leftover words " +#~ "assigned\n" +#~ " to the last NAME. Only the characters found in $IFS are recognized " +#~ "as word\n" +#~ " delimiters. If no NAMEs are supplied, the line read is stored in the " +#~ "REPLY\n" +#~ " variable. If the -r option is given, this signifies `raw' input, " +#~ "and\n" +#~ " backslash escaping is disabled. The -d option causes read to " +#~ "continue\n" +#~ " until the first character of DELIM is read, rather than newline. If " +#~ "the -p\n" +#~ " option is supplied, the string PROMPT is output without a trailing " +#~ "newline\n" +#~ " before attempting to read. If -a is supplied, the words read are " +#~ "assigned\n" +#~ " to sequential indices of ARRAY, starting at zero. If -e is supplied " +#~ "and\n" +#~ " the shell is interactive, readline is used to obtain the line. If -n " +#~ "is\n" +#~ " supplied with a non-zero NCHARS argument, read returns after NCHARS\n" +#~ " characters have been read. The -s option causes input coming from a\n" +#~ " terminal to not be echoed.\n" +#~ " \n" +#~ " The -t option causes read to time out and return failure if a " +#~ "complete line\n" +#~ " of input is not read within TIMEOUT seconds. If the TMOUT variable " +#~ "is set,\n" +#~ " its value is the default timeout. The return code is zero, unless " +#~ "end-of-file\n" +#~ " is encountered, read times out, or an invalid file descriptor is " +#~ "supplied as\n" +#~ " the argument to -u." +#~ msgstr "" +#~ "Une ligne est lue depuis l'entrée standard ou depuis le descripteur de " +#~ "fichier\n" +#~ " FD si l'option « -u » est fournie. Le premier mot est affecté au " +#~ "premier NAME,\n" +#~ " le second mot au second NAME, et ainsi de suite, les mots restants " +#~ "étant affectés\n" +#~ " au dernier NAME. Seuls les caractères situés dans « $IFS » sont " +#~ "reconnus comme\n" +#~ " étant des délimiteurs de mots. Si aucun NAME n'est fourni, la ligne " +#~ "est conservée\n" +#~ " dans la variable REPLY. L'option « -r » signifie « entrée brute » et " +#~ "la neutralisation \n" +#~ " par barre oblique inverse est désactivée. L'option « -d » indique de " +#~ "continuer\" la lecture jusqu'à ce que le premier caractère de DELIM " +#~ "soit lu plutôt que\n" +#~ " le retour à la ligne. Si « -p » est fourni, la chaîne PROMPT est " +#~ "affichée\n" +#~ " sans retour à la ligne final avant la tentative de lecture. Si « -a » " +#~ "est fourni,\n" +#~ " les mots lus sont affectés en séquence aux indices du TABLEAU, en " +#~ "commençant\n" +#~ " à zéro. Si « -e » est fourni et que le shell est interactif, « " +#~ "readline » est\n" +#~ " utilisé pour obtenir la ligne. Si « -n » est fourni avec un argument " +#~ "NCHARS non nul,\n" +#~ " « read » se termine après que NCHARS caractères ont été lus. L'option " +#~ "« -s »\n" +#~ " permet aux données venant d'un terminal de ne pas être répétées.\n" +#~ " \n" +#~ " L'option « -t » permet à « read » de se terminer avec une erreur si " +#~ "une ligne\n" +#~ " entière de données ne lui a pas été fournie avant le DÉLAI " +#~ "d'expiration. Si la\n" +#~ " variable TMOUT est définie, sa valeur est le délai d'expiration par " +#~ "défaut. Le code\n" +#~ " de retour est zéro à moins qu'une fin de fichier ne soit rencontrée, " +#~ "que « read »\n" +#~ " atteigne le délai d'expiration ou qu'un descripteur de fichier " +#~ "incorrect ne soit\n" +#~ " fourni pour l'argument « -u »." + +#~ msgid "" +#~ "Causes a function to exit with the return value specified by N. If N\n" +#~ " is omitted, the return status is that of the last command." +#~ msgstr "" +#~ "Permet à une fonction de se terminer avec le code de retour spécifié par " +#~ "N.\n" +#~ " Si N est omis, le code de retour est celui de la dernière commande." + +#~ msgid "" +#~ "For each NAME, remove the corresponding variable or function. Given\n" +#~ " the `-v', unset will only act on variables. Given the `-f' flag,\n" +#~ " unset will only act on functions. With neither flag, unset first\n" +#~ " tries to unset a variable, and if that fails, then tries to unset a\n" +#~ " function. Some variables cannot be unset; also see readonly." +#~ msgstr "" +#~ "Pour chaque NAME, supprime la variable ou la fonction correspondante.\n" +#~ " En spécifiant « -v », « unset » agira seulement sur les variables.\n" +#~ " Avec l'option « -f », « unset » n'agit que sur les fonctions. Sans " +#~ "option,\n" +#~ " « unset » essaye d'abord de supprimer une variable et, s'il échoue, " +#~ "essaye\n" +#~ " de supprimer une fonction. Certaines variables ne peuvent pas être " +#~ "supprimées.\n" +#~ " Consultez aussi « readonly ». " + +#~ msgid "" +#~ "NAMEs are marked for automatic export to the environment of\n" +#~ " subsequently executed commands. If the -f option is given,\n" +#~ " the NAMEs refer to functions. If no NAMEs are given, or if `-p'\n" +#~ " is given, a list of all names that are exported in this shell is\n" +#~ " printed. An argument of `-n' says to remove the export property\n" +#~ " from subsequent NAMEs. An argument of `--' disables further option\n" +#~ " processing." +#~ msgstr "" +#~ "Les NAME sont marqués pour export automatique vers l'environnement des\n" +#~ " prochaines commandes exécutées. si l'option « -f » est donnée, les " +#~ "NAME\n" +#~ " se rapportent à des fonctions. Si aucun NAME n'est donné ou si « -p " +#~ "»\n" +#~ " est fourni, la liste de tous les NAME exportés dans ce shell " +#~ "s'affiche.\n" +#~ " L'argument « -n » permet de supprimer la propriété d'export des NAME " +#~ "qui\n" +#~ " suivent. L'argument « -- » désactive le traitement des options " +#~ "suivantes." + +#~ msgid "" +#~ "The given NAMEs are marked readonly and the values of these NAMEs may\n" +#~ " not be changed by subsequent assignment. If the -f option is given,\n" +#~ " then functions corresponding to the NAMEs are so marked. If no\n" +#~ " arguments are given, or if `-p' is given, a list of all readonly " +#~ "names\n" +#~ " is printed. The `-a' option means to treat each NAME as\n" +#~ " an array variable. An argument of `--' disables further option\n" +#~ " processing." +#~ msgstr "" +#~ "Les NAME donnés sont marqués pour lecture seule et les valeurs de ces " +#~ "NAME\n" +#~ " ne peuvent plus être changés par affection. Si l'option « -f » est " +#~ "donnée,\n" +#~ " les fonctions correspondant aux NAME sont marquées de la sorte. Si " +#~ "aucun\n" +#~ " argument n'est donné ou si « -p » est fourni, la liste de tous les " +#~ "noms\n" +#~ " en lecture seule est affichée. L'option « -a » indique de traiter " +#~ "tous les\n" +#~ " NAME comme des variables tableaux. L'argument « -- » désactive le " +#~ "traitement\n" +#~ " des option suivantes." + +#~ msgid "" +#~ "The positional parameters from $N+1 ... are renamed to $1 ... If N is\n" +#~ " not given, it is assumed to be 1." +#~ msgstr "" +#~ "Les paramètres de position depuis $N+1 ... sont renommés en $1 ...\n" +#~ " Si N n'est pas fourni, il est supposé égal à 1." + +#~ msgid "" +#~ "Suspend the execution of this shell until it receives a SIGCONT\n" +#~ " signal. The `-f' if specified says not to complain about this\n" +#~ " being a login shell if it is; just suspend anyway." +#~ msgstr "" +#~ "Suspend l'exécution de ce shell jusqu'à ce qu'il reçoive le signal " +#~ "SIGCONT.\n" +#~ " Si « -f » est spécifié, il indique de ne pas se plaindre s'il s'agit " +#~ "d'un \n" +#~ " shell de connexion, mais de suspendre quand-même." + +#~ msgid "" +#~ "Print the accumulated user and system times for processes run from\n" +#~ " the shell." +#~ msgstr "" +#~ "Affiche les temps utilisateur et système accumulés pour les processus\n" +#~ " lancés depuis le shell." + +#~ msgid "" +#~ "For each NAME, indicate how it would be interpreted if used as a\n" +#~ " command name.\n" +#~ " \n" +#~ " If the -t option is used, `type' outputs a single word which is one " +#~ "of\n" +#~ " `alias', `keyword', `function', `builtin', `file' or `', if NAME is " +#~ "an\n" +#~ " alias, shell reserved word, shell function, shell builtin, disk " +#~ "file,\n" +#~ " or unfound, respectively.\n" +#~ " \n" +#~ " If the -p flag is used, `type' either returns the name of the disk\n" +#~ " file that would be executed, or nothing if `type -t NAME' would not\n" +#~ " return `file'.\n" +#~ " \n" +#~ " If the -a flag is used, `type' displays all of the places that " +#~ "contain\n" +#~ " an executable named `file'. This includes aliases, builtins, and\n" +#~ " functions, if and only if the -p flag is not also used.\n" +#~ " \n" +#~ " The -f flag suppresses shell function lookup.\n" +#~ " \n" +#~ " The -P flag forces a PATH search for each NAME, even if it is an " +#~ "alias,\n" +#~ " builtin, or function, and returns the name of the disk file that " +#~ "would\n" +#~ " be executed." +#~ msgstr "" +#~ "Indique comment chaque NAME serait interprété s'il était utilisé comme " +#~ "un\n" +#~ " nom de commande.\n" +#~ " \n" +#~ " Si l'option « -t » est utilisée, « type » affiche un simple mot " +#~ "parmi\n" +#~ " « alias », « keyword », « function », « builtin », « file » ou « », " +#~ "si\n" +#~ " NAME est respectivement un alias, un mot réservé du shell, une " +#~ "fonction\n" +#~ " du shell, une primitive, un fichier du disque, ou s'il est inconnu.\n" +#~ " \n" +#~ " Si l'indicateur « -p » est utilisé, « type » renvoie soit le nom du " +#~ "fichier\n" +#~ " du disque qui serait exécuté, soit rien si « type -t NAME » ne " +#~ "retourne pas\n" +#~ " « file ».\n" +#~ " \n" +#~ " Si « -a » est utilisé, « type » affiche tous les emplacements qui " +#~ "contiennent\n" +#~ " un exécutable nommé « file ». Ceci inclut les alias, les primitives " +#~ "et les\n" +#~ " fonctions si, et seulement si « -p » n'est pas également utilisé.\n" +#~ " \n" +#~ " L'indicateur « -P » force une recherche dans PATH pour chaque NAME " +#~ "même\n" +#~ " si c'est un alias, une primitive ou une fonction et renvoie le nom " +#~ "du\n" +#~ " fichier du disque qui serait exécuté." + +#~ msgid "" +#~ "The user file-creation mask is set to MODE. If MODE is omitted, or if\n" +#~ " `-S' is supplied, the current value of the mask is printed. The `-" +#~ "S'\n" +#~ " option makes the output symbolic; otherwise an octal number is " +#~ "output.\n" +#~ " If `-p' is supplied, and MODE is omitted, the output is in a form\n" +#~ " that may be used as input. If MODE begins with a digit, it is\n" +#~ " interpreted as an octal number, otherwise it is a symbolic mode " +#~ "string\n" +#~ " like that accepted by chmod(1)." +#~ msgstr "" +#~ "Le masque de création des fichiers utilisateurs est réglé à MODE. Si " +#~ "MODE\n" +#~ " est omis ou si « -S » est fourni, la valeur actuelle du masque est " +#~ "affichée\n" +#~ " L'option « -S » rend la sortie symbolique, sinon une valeur octale " +#~ "est\n" +#~ " est utilisée. Si « -p » est fourni et que MODE est omis, la sortie se " +#~ "fait\n" +#~ " dans un format qui peut être réutilisé comme entrée. Si MODE commence " +#~ "par\n" +#~ " un chiffre, il est interprété comme un nombre octal, sinon comme une " +#~ "chaîne\n" +#~ " symbolique de mode comme celle utilisée par « chmod(1) »." + +#~ msgid "" +#~ "Wait for the specified process and report its termination status. If\n" +#~ " N is not given, all currently active child processes are waited for,\n" +#~ " and the return code is zero. N is a process ID; if it is not given,\n" +#~ " all child processes of the shell are waited for." +#~ msgstr "" +#~ "Attend le processus spécifié et donne son code de retour. Si N n'est\n" +#~ " pas donné, tous les processus fils actuellement actifs sont attendus\n" +#~ " et le code de retour est zéro. N est un n° de processus. S'il n'est\n" +#~ " pas fourni, tous les processus du shell sont attendus." + +#~ msgid "" +#~ "Create a simple command invoked by NAME which runs COMMANDS.\n" +#~ " Arguments on the command line along with NAME are passed to the\n" +#~ " function as $0 .. $n." +#~ msgstr "" +#~ "Crée une simple commande invoquée avec NAME, et qui lance les\n" +#~ " commandes COMMANDS. Les arguments fournis avec NAME sur la\n" +#~ " ligne de commande sont transmis à la fonction en tant que $0 .. $n." + +#~ msgid "" +#~ "Toggle the values of variables controlling optional behavior.\n" +#~ " The -s flag means to enable (set) each OPTNAME; the -u flag\n" +#~ " unsets each OPTNAME. The -q flag suppresses output; the exit\n" +#~ " status indicates whether each OPTNAME is set or unset. The -o\n" +#~ " option restricts the OPTNAMEs to those defined for use with\n" +#~ " `set -o'. With no options, or with the -p option, a list of all\n" +#~ " settable options is displayed, with an indication of whether or\n" +#~ " not each is set." +#~ msgstr "" +#~ "Commute la valeur des variables qui contrôlent les comportements " +#~ "optionnels.\n" +#~ " L'option « -s » indique d'activer chaque option nommée OPTNAME. " +#~ "L'option\n" +#~ " « -u » désactive l'option OPTNAME. L'option « -q » rend la sortie " +#~ "silencieuse.\n" +#~ " Le code de retour indique si chaque OPTNAME est activée ou " +#~ "désactivée.\n" +#~ " L'option « -o » restreint les options OPTNAME à celles qui peuvent " +#~ "être utilisées avec\n" +#~ " « set -o ». Sans option ou avec l'option « -p », une liste de toutes " +#~ "les\n" +#~ " options modifiables est affichée, avec une indication sur l'état de " +#~ "chacune." + +#~ msgid "" +#~ "For each NAME, specify how arguments are to be completed.\n" +#~ " If the -p option is supplied, or if no options are supplied, " +#~ "existing\n" +#~ " completion specifications are printed in a way that allows them to " +#~ "be\n" +#~ " reused as input. The -r option removes a completion specification " +#~ "for\n" +#~ " each NAME, or, if no NAMEs are supplied, all completion " +#~ "specifications." +#~ msgstr "" +#~ "Pour chaque NAME, spécifie comment les arguments doivent être complétés.\n" +#~ " Si l'option « -p » est fournie ou si aucune option n'est fournie, les " +#~ "spécifications\n" +#~ " de complètement actuelles sont affichées de manière à pouvoir être " +#~ "réutilisées\n" +#~ " comme entrée. L'option « -r » enlève la spécification de complètement " +#~ "pour chaque\n" +#~ " NAME ou, si aucun NAME n'est fourni, toutes les spécifications de " +#~ "complètement." diff --git a/po/ga.gmo b/po/ga.gmo new file mode 100644 index 0000000000000000000000000000000000000000..eb114a3e7e267793d421bd65ead8dc0a5eec1d26 GIT binary patch literal 58471 zcmch=37i~Pb?;w*u^9noF$QC7QyyEEWUI%LWn(k4Fr&>LkVZlp*(UO!>FMs7X}hPp z>F&`2HiRW+PXY$Q8l!|Hc0gB>^{s zdfzj_bHN(;2=L`#3cd+E1N;d1IPi<$M({hJ-gCif$6=8FlV|YHAov_m<$5cqD!vb- zD9INC{ug*D=jX0*+zFn^`E3F30Ealg8&p027S#KG2%ZI=4zZp9t^!r=EuhL-1oi&; zaQ+7Hk(|F1RJxCWde7HDz5fT{{QOJ&`jw#Qu@fwSli~WWf~v>cLFM-;@bTbZg!Au$ zq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Translator: Séamus Ó Ciardhuáin \n" +"Language-Team: Irish \n" +"Language: ga\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;\n" + +#: arrayfunc.c:51 +msgid "bad array subscript" +msgstr "droch-fhoscript eagair" + +#: arrayfunc.c:356 builtins/declare.def:566 +#, c-format +msgid "%s: cannot convert indexed to associative array" +msgstr "" +"%s: ní féidir eagar innéacsaithe a thiontú go heagar comhthiomsaitheach" + +#: arrayfunc.c:539 +#, c-format +msgid "%s: invalid associative array key" +msgstr "%s: eochair neamhbhailí eagair chomhthiomsaithigh" + +#: arrayfunc.c:541 +#, c-format +msgid "%s: cannot assign to non-numeric index" +msgstr "%s: ní féidir sannadh go hinnéacs neamhuimhriúil." + +#: arrayfunc.c:586 +#, c-format +msgid "%s: %s: must use subscript when assigning associative array" +msgstr "" +"%s: %s: caithfear foscript a úsáid le sannadh chuig eagar comhthiomsaitheach" + +#: bashhist.c:388 +#, c-format +msgid "%s: cannot create: %s" +msgstr "%s: ní féidir cruthú: %s" + +#: bashline.c:3982 +msgid "bash_execute_unix_command: cannot find keymap for command" +msgstr "" +"bash_execute_unix_command: ní féidir mapa eochrach an ordaithe a aimsiú" + +#: bashline.c:4069 +#, c-format +msgid "%s: first non-whitespace character is not `\"'" +msgstr "%s: ní \" é an chéad charachtar nach spás bán é." + +#: bashline.c:4098 +#, c-format +msgid "no closing `%c' in %s" +msgstr "Níl \"%c\" dúnta i %s" + +#: bashline.c:4132 +#, c-format +msgid "%s: missing colon separator" +msgstr "%s: deighilteoir idirstaid ar iarraidh" + +#: braces.c:321 +#, c-format +msgid "brace expansion: cannot allocate memory for %s" +msgstr "" + +#: braces.c:413 +#, c-format +msgid "brace expansion: failed to allocate memory for %d elements" +msgstr "" + +#: braces.c:452 +#, c-format +msgid "brace expansion: failed to allocate memory for `%s'" +msgstr "" + +#: builtins/alias.def:132 +#, fuzzy, c-format +msgid "`%s': invalid alias name" +msgstr "\"%s\": ainm neamhbhailí ar mhapa eochrach " + +#: builtins/bind.def:123 builtins/bind.def:126 +msgid "line editing not enabled" +msgstr "níl eagarthóireacht líne cumasaithe" + +#: builtins/bind.def:212 +#, c-format +msgid "`%s': invalid keymap name" +msgstr "\"%s\": ainm neamhbhailí ar mhapa eochrach " + +#: builtins/bind.def:251 +#, c-format +msgid "%s: cannot read: %s" +msgstr "%s: ní féidir léamh: %s" + +#: builtins/bind.def:266 +#, c-format +msgid "`%s': cannot unbind" +msgstr "\"%s\": ní féidir dícheangail" + +#: builtins/bind.def:304 builtins/bind.def:334 +#, c-format +msgid "`%s': unknown function name" +msgstr "\"%s\": ainm feidhme neamhaithnid" + +#: builtins/bind.def:312 +#, c-format +msgid "%s is not bound to any keys.\n" +msgstr "Níl %s ceangailte le heochair ar bith.\n" + +#: builtins/bind.def:316 +#, c-format +msgid "%s can be invoked via " +msgstr "Is féidir %s a ghlaoigh trí " + +#: builtins/break.def:77 builtins/break.def:117 +msgid "loop count" +msgstr "comhaireamh lúibe" + +#: builtins/break.def:137 +msgid "only meaningful in a `for', `while', or `until' loop" +msgstr "Gan chiall ach i lúb \"for\", \"while\" nó \"until\"" + +#: builtins/caller.def:134 +msgid "" +"Returns the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns " +msgstr "" +"Aischuir comhthéacs an ghlaoigh reatha fhoghnáthaimh.\n" +" \n" +" Gan SLONN, aischuirtear " + +#: builtins/cd.def:319 +msgid "HOME not set" +msgstr "Níl HOME socruithe" + +#: builtins/cd.def:327 builtins/common.c:166 test.c:876 +msgid "too many arguments" +msgstr "An iomarca argóintí" + +#: builtins/cd.def:338 +msgid "OLDPWD not set" +msgstr "Níl OLDPWD socruithe" + +#: builtins/common.c:101 +#, c-format +msgid "line %d: " +msgstr "líne %d: " + +#: builtins/common.c:139 error.c:265 +#, c-format +msgid "warning: " +msgstr "rabhadh: " + +#: builtins/common.c:153 +#, c-format +msgid "%s: usage: " +msgstr "%s: úsáid: " + +#: builtins/common.c:191 shell.c:506 shell.c:788 +#, c-format +msgid "%s: option requires an argument" +msgstr "%s: tá argóint riachtanach don rogha" + +#: builtins/common.c:198 +#, c-format +msgid "%s: numeric argument required" +msgstr "%s: argóint uimhriúil de dhíth" + +#: builtins/common.c:205 +#, c-format +msgid "%s: not found" +msgstr "%s: gan aimsiú" + +#: builtins/common.c:214 shell.c:801 +#, c-format +msgid "%s: invalid option" +msgstr "%s: rogha neamhbhailí" + +#: builtins/common.c:221 +#, c-format +msgid "%s: invalid option name" +msgstr "%s: ainm neamhbhailí rogha" + +#: builtins/common.c:228 general.c:235 general.c:240 +#, c-format +msgid "`%s': not a valid identifier" +msgstr "\"%s\": ní aitheantóir bailí é" + +#: builtins/common.c:238 +msgid "invalid octal number" +msgstr "uimhir ochtnártha neamhbhailí" + +#: builtins/common.c:240 +msgid "invalid hex number" +msgstr "uimhir heicsidheachúlach neamhbhailí" + +#: builtins/common.c:242 expr.c:1470 +msgid "invalid number" +msgstr "uimhir neamhbhailí" + +#: builtins/common.c:250 +#, c-format +msgid "%s: invalid signal specification" +msgstr "%s: sonrú neamhbhailí comhartha" + +#: builtins/common.c:257 +#, c-format +msgid "`%s': not a pid or valid job spec" +msgstr "\"%s\": ní aitheantas próisis nó sonrú jab bailí é" + +#: builtins/common.c:264 error.c:488 +#, c-format +msgid "%s: readonly variable" +msgstr "%s: athróg inléite amháin" + +#: builtins/common.c:272 +#, c-format +msgid "%s: %s out of range" +msgstr "%s: %s as raon" + +#: builtins/common.c:272 builtins/common.c:274 +msgid "argument" +msgstr "argóint" + +#: builtins/common.c:274 +#, c-format +msgid "%s out of range" +msgstr "%s as raon" + +#: builtins/common.c:282 +#, c-format +msgid "%s: no such job" +msgstr "%s: níl a léithéid de jab ann." + +#: builtins/common.c:290 +#, c-format +msgid "%s: no job control" +msgstr "%s: gan rialú jabanna." + +#: builtins/common.c:292 +msgid "no job control" +msgstr "Gan rialú jabanna." + +#: builtins/common.c:302 +#, c-format +msgid "%s: restricted" +msgstr "%s: srianta" + +#: builtins/common.c:304 +msgid "restricted" +msgstr "srianta" + +#: builtins/common.c:312 +#, c-format +msgid "%s: not a shell builtin" +msgstr "%s: ní ordú ionsuite blaoisce é." + +#: builtins/common.c:321 +#, c-format +msgid "write error: %s" +msgstr "earráid scríofa: %s" + +#: builtins/common.c:329 +#, c-format +msgid "error setting terminal attributes: %s" +msgstr "earráid agus airíonna teirminéil á socrú: %s" + +#: builtins/common.c:331 +#, c-format +msgid "error getting terminal attributes: %s" +msgstr "earráid agus airíonna teirminéil á fáil: %s" + +#: builtins/common.c:563 +#, c-format +msgid "%s: error retrieving current directory: %s: %s\n" +msgstr "%s: earráid ag fáil na comhadlainne reatha: %s: %s\n" + +#: builtins/common.c:629 builtins/common.c:631 +#, c-format +msgid "%s: ambiguous job spec" +msgstr "%s: sonrú jab athbhríoch" + +#: builtins/complete.def:277 +#, c-format +msgid "%s: invalid action name" +msgstr "%s: ainm neamhbhailí gnímh" + +#: builtins/complete.def:450 builtins/complete.def:645 +#: builtins/complete.def:855 +#, c-format +msgid "%s: no completion specification" +msgstr "%s: níl sonrú iomlánaithe ann." + +#: builtins/complete.def:697 +msgid "warning: -F option may not work as you expect" +msgstr "" +"Rabhadh: b'fhéidir nach n-oibríonn an rogha -F mar a bheifeá ag súil leis." + +#: builtins/complete.def:699 +msgid "warning: -C option may not work as you expect" +msgstr "" +"Rabhadh: b'fhéidir nach n-oibríonn an rogha -C mar a bheifeá ag súil leis." + +#: builtins/complete.def:828 +msgid "not currently executing completion function" +msgstr "níl an fheidhm chomhlánaithe á rith faoi láthair" + +#: builtins/declare.def:126 +msgid "can only be used in a function" +msgstr "Inúsáidte i bhfeidhmeanna amháin. " + +#: builtins/declare.def:315 builtins/declare.def:509 +#, c-format +msgid "%s: reference variable cannot be an array" +msgstr "" + +#: builtins/declare.def:324 +#, c-format +msgid "%s: nameref variable self references not allowed" +msgstr "" + +#: builtins/declare.def:398 +msgid "cannot use `-f' to make functions" +msgstr "Ní féidir \"-f\" a úsáid chun feidhmeanna a dhéanamh" + +#: builtins/declare.def:410 execute_cmd.c:5361 +#, c-format +msgid "%s: readonly function" +msgstr "%s: feidhm inléite amháin" + +#: builtins/declare.def:553 +#, c-format +msgid "%s: cannot destroy array variables in this way" +msgstr "%s: ní féidir athróga eagair a scrios mar seo." + +#: builtins/declare.def:560 builtins/read.def:733 +#, c-format +msgid "%s: cannot convert associative to indexed array" +msgstr "" +"%s: ní féidir eagar comhthiomsaitheach a thiontú go heagar innéacsaithe" + +#: builtins/enable.def:137 builtins/enable.def:145 +msgid "dynamic loading not available" +msgstr "Níl luchtú dinimiciúil ar fáil" + +#: builtins/enable.def:312 +#, c-format +msgid "cannot open shared object %s: %s" +msgstr "Ní féidir an réad comhroinnte %s a oscailt: %s" + +#: builtins/enable.def:335 +#, c-format +msgid "cannot find %s in shared object %s: %s" +msgstr "Ní féidir %s a aimsiú sa réad comhroinnte %s: %s" + +#: builtins/enable.def:459 +#, c-format +msgid "%s: not dynamically loaded" +msgstr "%s: níl sé luchtaithe go dinimiciúil" + +#: builtins/enable.def:474 +#, c-format +msgid "%s: cannot delete: %s" +msgstr "%s: ní féidir scrios: %s" + +#: builtins/evalfile.c:140 builtins/hash.def:171 execute_cmd.c:5208 +#: shell.c:1481 +#, c-format +msgid "%s: is a directory" +msgstr "%s: is comhadlann é" + +#: builtins/evalfile.c:146 +#, c-format +msgid "%s: not a regular file" +msgstr "%s: ní gnáthchomhad é" + +#: builtins/evalfile.c:155 +#, c-format +msgid "%s: file is too large" +msgstr "%s: tá an comhad ró-mhór" + +#: builtins/evalfile.c:190 builtins/evalfile.c:208 shell.c:1491 +#, c-format +msgid "%s: cannot execute binary file" +msgstr "%s: ní féidir comhad dénártha a rith" + +#: builtins/exec.def:154 builtins/exec.def:156 builtins/exec.def:228 +#, c-format +msgid "%s: cannot execute: %s" +msgstr "%s: ní féidir rith: %s" + +#: builtins/exit.def:65 +#, c-format +msgid "logout\n" +msgstr "logout\n" + +#: builtins/exit.def:88 +msgid "not login shell: use `exit'" +msgstr "Ní blaosc logála isteach é seo: úsáid \"exit\"" + +#: builtins/exit.def:120 +#, c-format +msgid "There are stopped jobs.\n" +msgstr "Tá jabanna stoptha ann.\n" + +#: builtins/exit.def:122 +#, c-format +msgid "There are running jobs.\n" +msgstr "Tá jabanna ag rith.\n" + +#: builtins/fc.def:262 +msgid "no command found" +msgstr "Níor aimsíodh ordú" + +#: builtins/fc.def:320 builtins/fc.def:369 +msgid "history specification" +msgstr "Sonrú staire" + +#: builtins/fc.def:390 +#, c-format +msgid "%s: cannot open temp file: %s" +msgstr "%s: ní féidir comhad sealadach a oscailt: %s" + +#: builtins/fg_bg.def:149 builtins/jobs.def:282 +msgid "current" +msgstr "reatha" + +#: builtins/fg_bg.def:158 +#, c-format +msgid "job %d started without job control" +msgstr "Thosaigh jab %d gan rialú jabanna." + +#: builtins/getopt.c:110 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: rogha neamhdhleathach -- %c\n" + +#: builtins/getopt.c:111 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: tá argóint riachtanach don rogha -- %c\n" + +#: builtins/hash.def:92 +msgid "hashing disabled" +msgstr "Tá haiseáil díchumasaithe." + +#: builtins/hash.def:138 +#, c-format +msgid "%s: hash table empty\n" +msgstr "%s: tá an tábla haiseála folamh.\n" + +#: builtins/hash.def:245 +#, c-format +msgid "hits\tcommand\n" +msgstr "amais\tordú\n" + +#: builtins/help.def:130 +#, c-format +msgid "Shell commands matching keyword `" +msgid_plural "Shell commands matching keywords `" +msgstr[0] "Ordaithe blaoisce a mheaitseálann an lorgfhocal \"" +msgstr[1] "Ordaithe blaoisce a mheaitseálann na lorgfhocail \"" +msgstr[2] "Ordaithe blaoisce a mheaitseálann na lorgfhocail '" + +#: builtins/help.def:182 +#, c-format +msgid "" +"no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." +msgstr "" +"Ní mheaitseálann ábhar cabhrach ar bith \"%s\". Bain triail as \"help help\" " +"nó \"man -k %s\" nó \"info %s\"." + +#: builtins/help.def:199 +#, c-format +msgid "%s: cannot open: %s" +msgstr "%s: ní féidir oscailt: %s" + +#: builtins/help.def:485 +#, c-format +msgid "" +"These shell commands are defined internally. Type `help' to see this list.\n" +"Type `help name' to find out more about the function `name'.\n" +"Use `info bash' to find out more about the shell in general.\n" +"Use `man -k' or `info' to find out more about commands not in this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" +msgstr "" +"Tá na horduithe blaoisce seo sainmhínithe go hinmheánach.\n" +"Usáid \"help\" leis an liosta seo a thaispeáint.\n" +"Úsáid \"help ainm\" chun tuilleadh eolais a fháil faoin bhfeidhm \"ainm\".\n" +"Úsáid \"info bash\" chun tuilleadh eolais a fháil faoin mblaosc féin.\n" +"Úsáid \"man -k\" nó \"info\" chun tuilleadh eolais a fháil faoi ordaithe " +"nach bhfuil sa liosta seo.\n" +"Ciallaíonn réalt (*) ar ainm go bhfuil an t-ordú díchumasaithe.\n" +"\n" + +#: builtins/history.def:154 +msgid "cannot use more than one of -anrw" +msgstr "Ní féidir níos mó ná ceann amháin as -anrw a úsáid." + +#: builtins/history.def:186 +msgid "history position" +msgstr "suíomh staire" + +#: builtins/history.def:366 +#, c-format +msgid "%s: history expansion failed" +msgstr "%s: theip ar fhairsingiú staire." + +#: builtins/inlib.def:71 +#, c-format +msgid "%s: inlib failed" +msgstr "%s: theip ar inlib" + +#: builtins/jobs.def:109 +msgid "no other options allowed with `-x'" +msgstr "Níl roghanna eile ceadaithe le \"-x\"" + +#: builtins/kill.def:200 +#, c-format +msgid "%s: arguments must be process or job IDs" +msgstr "%s: is gá le argóintí bheith ina aitheantais phróisis nó jab" + +#: builtins/kill.def:263 +msgid "Unknown error" +msgstr "Earráid neamhaithnid" + +#: builtins/let.def:95 builtins/let.def:120 expr.c:583 expr.c:598 +msgid "expression expected" +msgstr "Ag súil le slonn" + +#: builtins/mapfile.def:172 +#, fuzzy, c-format +msgid "%s: not an indexed array" +msgstr "%s: ní athróg eagair é" + +#: builtins/mapfile.def:259 builtins/read.def:302 +#, c-format +msgid "%s: invalid file descriptor specification" +msgstr "%s: sonrú neamhbhailí tuairisceora comhaid" + +#: builtins/mapfile.def:267 builtins/read.def:309 +#, c-format +msgid "%d: invalid file descriptor: %s" +msgstr "%d: tuairisceoir comhaid neamhbhailí: %s" + +#: builtins/mapfile.def:276 builtins/mapfile.def:314 +#, c-format +msgid "%s: invalid line count" +msgstr "%s: comhaireamh neamhbhailí línte" + +#: builtins/mapfile.def:287 +#, c-format +msgid "%s: invalid array origin" +msgstr "%s: bunphointe neamhbhailí eagair" + +#: builtins/mapfile.def:304 +#, c-format +msgid "%s: invalid callback quantum" +msgstr "%s: candam neamhbhailí aisghlaoigh" + +#: builtins/mapfile.def:336 +msgid "empty array variable name" +msgstr "ainm folamh athróga eagair" + +#: builtins/mapfile.def:357 +msgid "array variable support required" +msgstr "tacaíocht le hathróga eagair de dhíth" + +#: builtins/printf.def:402 +#, c-format +msgid "`%s': missing format character" +msgstr "\"%s\": carachtar formáide ar iarraidh." + +#: builtins/printf.def:456 +#, fuzzy, c-format +msgid "`%c': invalid time format specification" +msgstr "%s: sonrú neamhbhailí teorann ama" + +#: builtins/printf.def:658 +#, c-format +msgid "`%c': invalid format character" +msgstr "\"%c\": carachtar formáide neamhbhailí." + +#: builtins/printf.def:684 +#, c-format +msgid "warning: %s: %s" +msgstr "rabhadh: %s: %s" + +#: builtins/printf.def:768 +#, c-format +msgid "format parsing problem: %s" +msgstr "" + +#: builtins/printf.def:865 +msgid "missing hex digit for \\x" +msgstr "digit heicsidheachúlach ar iarraidh le haghaidh \\x" + +#: builtins/printf.def:880 +#, fuzzy, c-format +msgid "missing unicode digit for \\%c" +msgstr "digit heicsidheachúlach ar iarraidh le haghaidh \\x" + +#: builtins/pushd.def:195 +msgid "no other directory" +msgstr "Níl comhadlann eile ann" + +#: builtins/pushd.def:354 +#, fuzzy, c-format +msgid "%s: invalid argument" +msgstr "%s: argóint teorann neamhbhailí" + +#: builtins/pushd.def:468 +msgid "" +msgstr "" + +#: builtins/pushd.def:512 +msgid "directory stack empty" +msgstr "cruach fholamh chomhadlainne" + +#: builtins/pushd.def:514 +msgid "directory stack index" +msgstr "innéacs cruaiche comhadlainne" + +#: builtins/pushd.def:689 +msgid "" +"Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +"\tdirs when invoked without options, starting with zero." +msgstr "" + +#: builtins/pushd.def:711 +msgid "" +"Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" + +#: builtins/pushd.def:736 +msgid "" +"Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" + +#: builtins/read.def:275 +#, c-format +msgid "%s: invalid timeout specification" +msgstr "%s: sonrú neamhbhailí teorann ama" + +#: builtins/read.def:678 +#, c-format +msgid "read error: %d: %s" +msgstr "earráid léite: %d: %s" + +#: builtins/return.def:75 +msgid "can only `return' from a function or sourced script" +msgstr "" +"ní féidir \"return\" a dhéanamh ach ó fheidhm nó ó script rite le \"source\"" + +#: builtins/set.def:782 +msgid "cannot simultaneously unset a function and a variable" +msgstr "Ní féidir feidhm agus athróg a dhíshocrú ag an am céanna." + +#: builtins/set.def:826 +#, c-format +msgid "%s: cannot unset" +msgstr "%s: ní féidir díshocrú" + +#: builtins/set.def:843 +#, c-format +msgid "%s: cannot unset: readonly %s" +msgstr "%s: ní féidir díshocrú: %s inléite amháin" + +#: builtins/set.def:854 +#, c-format +msgid "%s: not an array variable" +msgstr "%s: ní athróg eagair é" + +#: builtins/setattr.def:187 +#, c-format +msgid "%s: not a function" +msgstr "%s: ní feidhm é." + +#: builtins/shift.def:71 builtins/shift.def:77 +msgid "shift count" +msgstr "comhaireamh iomlaoide" + +#: builtins/shopt.def:279 +msgid "cannot set and unset shell options simultaneously" +msgstr "Ní féidir roghanna blaoisce a shocrú agus a dhíshocrú ag an am céanna." + +#: builtins/shopt.def:346 +#, c-format +msgid "%s: invalid shell option name" +msgstr "%s: ainm neamhbhailí ar rogha blaoisce" + +#: builtins/source.def:130 +msgid "filename argument required" +msgstr "Is gá don argóint bheith ina ainm comhaid." + +#: builtins/source.def:155 +#, c-format +msgid "%s: file not found" +msgstr "%s: níor aimsíodh an comhad" + +#: builtins/suspend.def:101 +msgid "cannot suspend" +msgstr "Ní féidir cur ar fionraí." + +#: builtins/suspend.def:111 +msgid "cannot suspend a login shell" +msgstr "Ní féidir blaosc logála isteach a chur ar fionraí." + +#: builtins/type.def:234 +#, c-format +msgid "%s is aliased to `%s'\n" +msgstr "Tá %s ailiasáilte go \"%s\".\n" + +#: builtins/type.def:255 +#, c-format +msgid "%s is a shell keyword\n" +msgstr "Is eochairfhocal blaoisce é %s.\n" + +#: builtins/type.def:274 +#, c-format +msgid "%s is a function\n" +msgstr "Is feidhm é %s.\n" + +#: builtins/type.def:296 +#, c-format +msgid "%s is a shell builtin\n" +msgstr "Is ordú ionsuite blaoisce é %s\n" + +#: builtins/type.def:317 builtins/type.def:393 +#, c-format +msgid "%s is %s\n" +msgstr "Tá %s %s\n" + +#: builtins/type.def:337 +#, c-format +msgid "%s is hashed (%s)\n" +msgstr "Tá %s haiseáilte (%s)\n" + +#: builtins/ulimit.def:383 +#, c-format +msgid "%s: invalid limit argument" +msgstr "%s: argóint teorann neamhbhailí" + +#: builtins/ulimit.def:409 +#, c-format +msgid "`%c': bad command" +msgstr "\"%c\": droch-ordú" + +#: builtins/ulimit.def:438 +#, c-format +msgid "%s: cannot get limit: %s" +msgstr "%s: ní féidir teorainn a fháil: %s" + +#: builtins/ulimit.def:464 +msgid "limit" +msgstr "teorainn" + +#: builtins/ulimit.def:476 builtins/ulimit.def:776 +#, c-format +msgid "%s: cannot modify limit: %s" +msgstr "%s: ní féidir teorainn a athrú: %s" + +#: builtins/umask.def:114 +msgid "octal number" +msgstr "uimhir ochtnártha" + +#: builtins/umask.def:227 +#, c-format +msgid "`%c': invalid symbolic mode operator" +msgstr "\"%c\": oibreoir neamhbhailí móid shiombalaigh" + +#: builtins/umask.def:282 +#, c-format +msgid "`%c': invalid symbolic mode character" +msgstr "\"%c\": carachtar neamhbhailí móid shiombalaigh" + +#: error.c:90 error.c:325 error.c:327 error.c:329 +msgid " line " +msgstr " líne " + +#: error.c:165 +#, c-format +msgid "last command: %s\n" +msgstr "Ordú deireanach: %s\n" + +#: error.c:173 +#, c-format +msgid "Aborting..." +msgstr "Ag tobscor..." + +#: error.c:440 +msgid "unknown command error" +msgstr "earráid ordaithe neamhaithnid" + +#: error.c:441 +msgid "bad command type" +msgstr "droch-chineál ordaithe" + +#: error.c:442 +msgid "bad connector" +msgstr "drochnascóir" + +#: error.c:443 +msgid "bad jump" +msgstr "drochléim" + +#: error.c:481 +#, c-format +msgid "%s: unbound variable" +msgstr "%s: athróg neamhcheangailte" + +#: eval.c:189 +#, c-format +msgid "\atimed out waiting for input: auto-logout\n" +msgstr "\aimithe thar am ag feitheamh le hionchur: logáil amach uathoibríoch\n" + +#: execute_cmd.c:512 +#, c-format +msgid "cannot redirect standard input from /dev/null: %s" +msgstr "Ní féidir an ionchur caighdeánach a atreorú ó /dev/null: %s" + +#: execute_cmd.c:1233 +#, c-format +msgid "TIMEFORMAT: `%c': invalid format character" +msgstr "FORMÁID_AMA: \"%c\": carachtar formáide neamhbhaií." + +#: execute_cmd.c:2287 +msgid "pipe error" +msgstr "earráid phíopa" + +#: execute_cmd.c:4386 +#, c-format +msgid "%s: maximum function nesting level exceeded (%d)" +msgstr "" + +#: execute_cmd.c:4884 +#, c-format +msgid "%s: restricted: cannot specify `/' in command names" +msgstr "%s: srianta: ní féidir \"/\" a shonrú in ainmneacha ordaithe" + +#: execute_cmd.c:4973 +#, c-format +msgid "%s: command not found" +msgstr "%s: níor aimsíodh an t-ordú" + +#: execute_cmd.c:5206 +#, fuzzy, c-format +msgid "%s: %s" +msgstr "Tá %s %s\n" + +#: execute_cmd.c:5243 +#, c-format +msgid "%s: %s: bad interpreter" +msgstr "%s: %s: drochléirmhínitheoir" + +#: execute_cmd.c:5280 +#, fuzzy, c-format +msgid "%s: cannot execute binary file: %s" +msgstr "%s: ní féidir comhad dénártha a rith" + +#: execute_cmd.c:5352 +#, fuzzy, c-format +msgid "`%s': is a special builtin" +msgstr "Is ordú ionsuite blaoisce é %s\n" + +#: execute_cmd.c:5404 +#, c-format +msgid "cannot duplicate fd %d to fd %d" +msgstr "" +"Ní féidir an tuairisceoir comhaid %d a dhúbailt mar thuairisceoir comhaid %d." + +#: expr.c:259 +msgid "expression recursion level exceeded" +msgstr "imithe thar leibhéal athchursála sloinn" + +#: expr.c:283 +msgid "recursion stack underflow" +msgstr "gannsreabhadh na cruaiche athchúrsála" + +#: expr.c:431 +msgid "syntax error in expression" +msgstr "Earráid chomhréire sa slonn." + +#: expr.c:475 +msgid "attempted assignment to non-variable" +msgstr "Deineadh iarracht sannadh go rud nach athróg é." + +#: expr.c:495 expr.c:858 +msgid "division by 0" +msgstr "roinnt ar 0" + +#: expr.c:542 +msgid "bug: bad expassign token" +msgstr "fabht: droch-chomhartha expassign" + +#: expr.c:595 +msgid "`:' expected for conditional expression" +msgstr "Bhíothas ag súil le \":\" le haghaidh sloinn choinníollaigh." + +#: expr.c:919 +msgid "exponent less than 0" +msgstr "Easpónant níos lú ná 0." + +#: expr.c:976 +msgid "identifier expected after pre-increment or pre-decrement" +msgstr "ag súil le aitheantóir tar éis réamhincriminte nó réamhdeicriminte" + +#: expr.c:1002 +msgid "missing `)'" +msgstr "\")\" ar iarraidh" + +#: expr.c:1053 expr.c:1390 +msgid "syntax error: operand expected" +msgstr "Earráid chomhréire: bhíothas ag súil le hoibreann." + +#: expr.c:1392 +msgid "syntax error: invalid arithmetic operator" +msgstr "earráid chomhréire: oibreoir neamhbhailí uimhríochta" + +#: expr.c:1416 +#, c-format +msgid "%s%s%s: %s (error token is \"%s\")" +msgstr "%s%s%s: %s (comhartha earráide \"%s\")" + +#: expr.c:1474 +msgid "invalid arithmetic base" +msgstr "Bonnuimhir uimhríochtúil neamhbhailí." + +#: expr.c:1494 +msgid "value too great for base" +msgstr "Tá an luach rómhór don bhonnuimhir." + +#: expr.c:1543 +#, c-format +msgid "%s: expression error\n" +msgstr "%s: earráid sloinn\n" + +#: general.c:62 +msgid "getcwd: cannot access parent directories" +msgstr "getcwd: ní féidir na máthairchomhadlanna a rochtain." + +#: input.c:102 subst.c:5168 +#, c-format +msgid "cannot reset nodelay mode for fd %d" +msgstr "" +"ní féidir an mód gan mhoill a athshocrú le haghaidh an tuairisceora chomhaid " +"%d" + +#: input.c:271 +#, c-format +msgid "cannot allocate new file descriptor for bash input from fd %d" +msgstr "" +"Ní féidir tuairisceoir comhaid nua a leithdháileadh le haghaidh ionchur bash " +"ón tuairisceoir comhaid %d." + +#: input.c:279 +#, c-format +msgid "save_bash_input: buffer already exists for new fd %d" +msgstr "" +"save_bash_input: tá an maolán ann cheana le haghaidh an tuairisceoir comhaid " +"nua %d" + +#: jobs.c:471 +msgid "start_pipeline: pgrp pipe" +msgstr "start_pipeline: pgrp píopa" + +#: jobs.c:893 +#, c-format +msgid "forked pid %d appears in running job %d" +msgstr "tá an aitheantas an phróisis ghabhlaithe %d sa jab %d atá ag rith" + +#: jobs.c:1012 +#, c-format +msgid "deleting stopped job %d with process group %ld" +msgstr "Tá an jab stoptha %d leis an ngrúpa próisis %ld á scrios." + +#: jobs.c:1117 +#, c-format +msgid "add_process: process %5ld (%s) in the_pipeline" +msgstr "add_process: próiseas %5ld (%s) sa phíblíne" + +#: jobs.c:1120 +#, c-format +msgid "add_process: pid %5ld (%s) marked as still alive" +msgstr "add_process: próiseas %5ld (%s) marcáilte mar fós beo" + +#: jobs.c:1435 +#, c-format +msgid "describe_pid: %ld: no such pid" +msgstr "describe_pid: %ld: níl an aitheantóir próisis sin ann." + +#: jobs.c:1450 +#, c-format +msgid "Signal %d" +msgstr "Comhartha %d" + +#: jobs.c:1464 jobs.c:1489 +msgid "Done" +msgstr "Déanta" + +#: jobs.c:1469 siglist.c:123 +msgid "Stopped" +msgstr "Stoptha" + +#: jobs.c:1473 +#, c-format +msgid "Stopped(%s)" +msgstr "Stoptha(%s)" + +#: jobs.c:1477 +msgid "Running" +msgstr "Ag Rith" + +#: jobs.c:1491 +#, c-format +msgid "Done(%d)" +msgstr "Déanta(%d)" + +#: jobs.c:1493 +#, c-format +msgid "Exit %d" +msgstr "Scoir %d" + +#: jobs.c:1496 +msgid "Unknown status" +msgstr "Stádas neamhaithnid" + +#: jobs.c:1583 +#, c-format +msgid "(core dumped) " +msgstr "(cuimhne dumpáilte)" + +#: jobs.c:1602 +#, c-format +msgid " (wd: %s)" +msgstr " (comhadlann oibre: %s)" + +#: jobs.c:1819 +#, c-format +msgid "child setpgid (%ld to %ld)" +msgstr "setpgid macphróisis (%ld go %ld)" + +#: jobs.c:2138 nojobs.c:605 +#, c-format +msgid "wait: pid %ld is not a child of this shell" +msgstr "wait: níl an próiseas %ld ina mhacphróiseas den bhlaosc seo." + +#: jobs.c:2385 +#, c-format +msgid "wait_for: No record of process %ld" +msgstr "wait_for: níl taifead den phróiseas %ld" + +#: jobs.c:2694 +#, c-format +msgid "wait_for_job: job %d is stopped" +msgstr "wait_for_job: tá an jab %d stoptha." + +#: jobs.c:2986 +#, c-format +msgid "%s: job has terminated" +msgstr "%s: tá an jab críochnaithe." + +#: jobs.c:2995 +#, c-format +msgid "%s: job %d already in background" +msgstr "%s: tá an jab %d sa chúlra cheana." + +#: jobs.c:3220 +msgid "waitchld: turning on WNOHANG to avoid indefinite block" +msgstr "" + +#: jobs.c:3711 +#, c-format +msgid "%s: line %d: " +msgstr "%s: líne %d: " + +#: jobs.c:3725 nojobs.c:843 +#, c-format +msgid " (core dumped)" +msgstr " (cuimhne dumpáilte)" + +#: jobs.c:3737 jobs.c:3750 +#, c-format +msgid "(wd now: %s)\n" +msgstr "(comhadlann oibre anois: %s)\n" + +#: jobs.c:3782 +msgid "initialize_job_control: getpgrp failed" +msgstr "initialize_job_control: theip ar getpgrp" + +#: jobs.c:3843 +msgid "initialize_job_control: line discipline" +msgstr "initialize_job_control: araíonacht líne" + +#: jobs.c:3853 +msgid "initialize_job_control: setpgid" +msgstr "initialize_job_control: setpgid" + +#: jobs.c:3874 jobs.c:3883 +#, c-format +msgid "cannot set terminal process group (%d)" +msgstr "ní féidir grúpa próisis teirminéil a shocrú (%d)" + +#: jobs.c:3888 +msgid "no job control in this shell" +msgstr "Níl rialú jabanna sa bhlaosc seo." + +#: lib/malloc/malloc.c:296 +#, c-format +msgid "malloc: failed assertion: %s\n" +msgstr "malloc: dearbhú teipthe: %s\n" + +#: lib/malloc/malloc.c:312 +#, c-format +msgid "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" +msgstr "" +"\r\n" +"malloc: %s:%d: dearbhú ina phraiseach\r\n" + +#: lib/malloc/malloc.c:313 +msgid "unknown" +msgstr "neamhaithnid" + +#: lib/malloc/malloc.c:801 +msgid "malloc: block on free list clobbered" +msgstr "malloc: bloc ar an liosta saor scriosta" + +#: lib/malloc/malloc.c:878 +msgid "free: called with already freed block argument" +msgstr "free: glaoite le argóint bhloic á saoradh cheana" + +#: lib/malloc/malloc.c:881 +msgid "free: called with unallocated block argument" +msgstr "free: glaoite le argóint bhloic nár leithdháileadh" + +#: lib/malloc/malloc.c:900 +msgid "free: underflow detected; mh_nbytes out of range" +msgstr "free: gannsreabhadh; tá mh_nbytes as raon" + +#: lib/malloc/malloc.c:906 +msgid "free: start and end chunk sizes differ" +msgstr "free: ní ionann méid na smután túis agus deiridh" + +#: lib/malloc/malloc.c:1005 +msgid "realloc: called with unallocated block argument" +msgstr "realloc: glaoite le argóint bhloic nár leithdháileadh" + +#: lib/malloc/malloc.c:1020 +msgid "realloc: underflow detected; mh_nbytes out of range" +msgstr "realloc: gannsreabhadh; tá mh_nbytes as raon" + +#: lib/malloc/malloc.c:1026 +msgid "realloc: start and end chunk sizes differ" +msgstr "realloc: ní ionann méideanna na smután túis agus deiridh" + +#: lib/malloc/table.c:194 +#, c-format +msgid "register_alloc: alloc table is full with FIND_ALLOC?\n" +msgstr "register_alloc: an bhfuil an tábla leithdháilte lán le FIND_ALLOC?\n" + +#: lib/malloc/table.c:203 +#, c-format +msgid "register_alloc: %p already in table as allocated?\n" +msgstr "" +"register_alloc: an bhfuil %p sa tábla mar atá sé leithdháilte cheana?\n" + +#: lib/malloc/table.c:256 +#, c-format +msgid "register_free: %p already in table as free?\n" +msgstr "register_free: an bhfuil %p sa tábla cheana mar ceann saor?\n" + +#: lib/sh/fmtulong.c:102 +msgid "invalid base" +msgstr "Bonn neamhbhailí" + +#: lib/sh/netopen.c:168 +#, c-format +msgid "%s: host unknown" +msgstr "%s: óstríomhaire neamhaithnid" + +#: lib/sh/netopen.c:175 +#, c-format +msgid "%s: invalid service" +msgstr "%s: seirbhís neamhbhailí" + +#: lib/sh/netopen.c:306 +#, c-format +msgid "%s: bad network path specification" +msgstr "%s: drochshonrú conaire líonra" + +#: lib/sh/netopen.c:346 +msgid "network operations not supported" +msgstr "Ní thacaítear le oibríochtaí líonra." + +#: locale.c:200 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s)" +msgstr "" + +#: locale.c:202 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s): %s" +msgstr "" + +#: locale.c:259 +#, fuzzy, c-format +msgid "setlocale: %s: cannot change locale (%s)" +msgstr "xrealloc: %s:%d: ní féidir %lu beart a leithdháileadh" + +#: locale.c:261 +#, fuzzy, c-format +msgid "setlocale: %s: cannot change locale (%s): %s" +msgstr "xrealloc: %s:%d: ní féidir %lu beart a leithdháileadh" + +#: mailcheck.c:439 +msgid "You have mail in $_" +msgstr "Tá ríomhphost agat i $_" + +#: mailcheck.c:464 +msgid "You have new mail in $_" +msgstr "Tá ríomhphost nua agat i $_" + +#: mailcheck.c:480 +#, c-format +msgid "The mail in %s has been read\n" +msgstr "Tá an ríomhphost i %s léite\n" + +#: make_cmd.c:323 +msgid "syntax error: arithmetic expression required" +msgstr "Earráid chomhréire: tá slonn uimhríochtúil de dhith." + +#: make_cmd.c:325 +msgid "syntax error: `;' unexpected" +msgstr "Earráid chomhréire: \";\" gan súil leis." + +#: make_cmd.c:326 +#, c-format +msgid "syntax error: `((%s))'" +msgstr "Earráid chomhréire: \"((%s))\"" + +#: make_cmd.c:578 +#, c-format +msgid "make_here_document: bad instruction type %d" +msgstr "make_here_document: drochchineál ordaithe %d" + +#: make_cmd.c:662 +#, c-format +msgid "here-document at line %d delimited by end-of-file (wanted `%s')" +msgstr "" +"cáipéis leabaithe ag líne %d teormharcáilte le deireadh comhaid (\"%s\" á " +"lorg)" + +#: make_cmd.c:759 +#, c-format +msgid "make_redirection: redirection instruction `%d' out of range" +msgstr "make_redirection: ordú atreoraithe \"%d\" as raon." + +#: parse.y:3278 parse.y:3561 +#, c-format +msgid "unexpected EOF while looking for matching `%c'" +msgstr "Deireadh comhaid gan súil leis agus \"%c\" a mheaitseálann á lorg." + +#: parse.y:4170 +msgid "unexpected EOF while looking for `]]'" +msgstr "Deireadh comhaid gan súil leis agus \"]]\" á lorg." + +#: parse.y:4175 +#, c-format +msgid "syntax error in conditional expression: unexpected token `%s'" +msgstr "" +"Earráid chomhréire i slonn coinníollach: comhartha \"%s\" gan suil leis." + +#: parse.y:4179 +msgid "syntax error in conditional expression" +msgstr "Earráid chomhréire i slonn coinníollach." + +#: parse.y:4257 +#, c-format +msgid "unexpected token `%s', expected `)'" +msgstr "Comhartha \"%s\" gan súil leis; ag súil le \")\"." + +#: parse.y:4261 +msgid "expected `)'" +msgstr "Ag súil le \")\"" + +#: parse.y:4289 +#, c-format +msgid "unexpected argument `%s' to conditional unary operator" +msgstr "Argóint \"%s\" gan súil lei go hoibreoir aonártha coinníollach." + +#: parse.y:4293 +msgid "unexpected argument to conditional unary operator" +msgstr "Argóint gan súil lei go hoibreoir coinníollach aonártha ." + +#: parse.y:4339 +#, c-format +msgid "unexpected token `%s', conditional binary operator expected" +msgstr "" +"Comhartha \"%s\" gan súil leis. Bhíothas ag súil le hoibreoir coinníollach " +"dénártha." + +#: parse.y:4343 +msgid "conditional binary operator expected" +msgstr "Bhíothas ag súil le hoibreoir coinníollach dénártha." + +#: parse.y:4365 +#, c-format +msgid "unexpected argument `%s' to conditional binary operator" +msgstr "Argóint \"%s\" gan súil lei go hoibreoir dénártha coinníollach." + +#: parse.y:4369 +msgid "unexpected argument to conditional binary operator" +msgstr "Argóint gan súil lei go hoibreoir dénártha coinníollach." + +#: parse.y:4380 +#, c-format +msgid "unexpected token `%c' in conditional command" +msgstr "Comhartha \"%c\" gan súil leis in ordú coinníollach." + +#: parse.y:4383 +#, c-format +msgid "unexpected token `%s' in conditional command" +msgstr "Comhartha \"%s\" gan súil leis in ordú coinníollach." + +#: parse.y:4387 +#, c-format +msgid "unexpected token %d in conditional command" +msgstr "Comhartha %d gan súil leis in ordú coinníollach." + +#: parse.y:5737 +#, c-format +msgid "syntax error near unexpected token `%s'" +msgstr "" +"Earráid chomhréire in aice comhartha \"%s\" nach rabhthas ag súil leis." + +#: parse.y:5755 +#, c-format +msgid "syntax error near `%s'" +msgstr "Earráid chomhréire in aice \"%s\"" + +#: parse.y:5765 +msgid "syntax error: unexpected end of file" +msgstr "Earráid chomhréire: deireadh comhaid gan súil leis." + +#: parse.y:5765 +msgid "syntax error" +msgstr "Earráid chomhréire" + +#: parse.y:5827 +#, c-format +msgid "Use \"%s\" to leave the shell.\n" +msgstr "Úsáid \"%s\" le scoir den mblaosc.\n" + +#: parse.y:5989 +msgid "unexpected EOF while looking for matching `)'" +msgstr "Deireadh comhaid gan súil leis agus \")\" á lorg le meaitseáil." + +#: pcomplete.c:1094 +#, c-format +msgid "completion: function `%s' not found" +msgstr "Iomlánú: níor aimsíodh an fheidhm \"%s\"." + +#: pcomplib.c:182 +#, c-format +msgid "progcomp_insert: %s: NULL COMPSPEC" +msgstr "progcomp_insert: %s: tá COMPSPEC neamhnitheach" + +#: print_cmd.c:300 +#, c-format +msgid "print_command: bad connector `%d'" +msgstr "print_command: drochnascóir \"%d\"" + +#: print_cmd.c:373 +#, fuzzy, c-format +msgid "xtrace_set: %d: invalid file descriptor" +msgstr "%d: tuairisceoir comhaid neamhbhailí: %s" + +#: print_cmd.c:378 +msgid "xtrace_set: NULL file pointer" +msgstr "" + +#: print_cmd.c:382 +#, c-format +msgid "xtrace fd (%d) != fileno xtrace fp (%d)" +msgstr "" + +#: print_cmd.c:1518 +#, c-format +msgid "cprintf: `%c': invalid format character" +msgstr "cprintf: \"%c\": carachtar formáide neamhbhailí" + +#: redir.c:123 redir.c:170 +msgid "file descriptor out of range" +msgstr "tuairisceoir comhaid as raon" + +#: redir.c:177 +#, c-format +msgid "%s: ambiguous redirect" +msgstr "%s: atreorú athbhríoch" + +#: redir.c:181 +#, c-format +msgid "%s: cannot overwrite existing file" +msgstr "%s: ní féidir comhad atá ann cheana a fhorscríobh." + +#: redir.c:186 +#, c-format +msgid "%s: restricted: cannot redirect output" +msgstr "%s: srianta: ní féidir aschur a atreorú." + +#: redir.c:191 +#, c-format +msgid "cannot create temp file for here-document: %s" +msgstr "ní féidir cáipéis shealadach a chruthú don cháipéis leabaithe: %s" + +#: redir.c:195 +#, fuzzy, c-format +msgid "%s: cannot assign fd to variable" +msgstr "%s: ní féidir liosta a shannadh go ball eagair." + +#: redir.c:582 +msgid "/dev/(tcp|udp)/host/port not supported without networking" +msgstr "Ní thacaítear le /dev/(tcp|udp)/óstríomhaire/port gan líonrú." + +#: redir.c:861 redir.c:973 redir.c:1034 redir.c:1199 +msgid "redirection error: cannot duplicate fd" +msgstr "Earráid atreoraithe: ní féidir an tuairisceoir comhaid a dhúbailt." + +#: shell.c:339 +msgid "could not find /tmp, please create!" +msgstr "Níorbh fhéidir /tmp a aimsiú. Cruthaigh é le do thoil!" + +#: shell.c:343 +msgid "/tmp must be a valid directory name" +msgstr "Caithfidh /tmp bheith ina ainm comhadlainne bailí." + +#: shell.c:890 +#, c-format +msgid "%c%c: invalid option" +msgstr "%c%c: rogha neamhbhailí" + +#: shell.c:1682 +msgid "I have no name!" +msgstr "Níl ainm orm!" + +#: shell.c:1827 +#, c-format +msgid "GNU bash, version %s-(%s)\n" +msgstr "GNU bash, leagan %s-(%s)\n" + +#: shell.c:1828 +#, c-format +msgid "" +"Usage:\t%s [GNU long option] [option] ...\n" +"\t%s [GNU long option] [option] script-file ...\n" +msgstr "" +"Úsáid:\t%s [rogha fada GNU] [rogha] ...\n" +"\t%s [rogha fada GNU] [rogha] comhad_scripte ...\n" + +#: shell.c:1830 +msgid "GNU long options:\n" +msgstr "Roghanna fada GNU:\n" + +#: shell.c:1834 +msgid "Shell options:\n" +msgstr "Roghanna blaoisce:\n" + +#: shell.c:1835 +#, fuzzy +msgid "\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n" +msgstr "\t-irsD nó -c ordú nó -O rogha_shopt\t\t(glaoch amháin)\n" + +#: shell.c:1850 +#, c-format +msgid "\t-%s or -o option\n" +msgstr "\t-%s nó -o rogha\n" + +#: shell.c:1856 +#, c-format +msgid "Type `%s -c \"help set\"' for more information about shell options.\n" +msgstr "" +"Úsáid %s -c \"help set\" le haghaidh tuilleadh eolais faoi roghanna " +"blaoisce.\n" + +#: shell.c:1857 +#, c-format +msgid "Type `%s -c help' for more information about shell builtin commands.\n" +msgstr "" +"Úsáid \"%s -c help\" le haghaidh tuilleadh eolais faoi orduithe ionsuite " +"blaoisce.\n" + +#: shell.c:1858 +#, c-format +msgid "Use the `bashbug' command to report bugs.\n" +msgstr "Úsáid an t-ordú \"bashbug\" le tuarascáil a sheoladh faoi fhabht.\n" + +#: sig.c:691 +#, c-format +msgid "sigprocmask: %d: invalid operation" +msgstr "sigprocmask: %d: oibríocht neamhbhailí" + +#: siglist.c:48 +msgid "Bogus signal" +msgstr "Droch-chomhartha" + +#: siglist.c:51 +msgid "Hangup" +msgstr "Crochadh" + +#: siglist.c:55 +msgid "Interrupt" +msgstr "Idirbhriseadh" + +#: siglist.c:59 +msgid "Quit" +msgstr "Scoir" + +#: siglist.c:63 +msgid "Illegal instruction" +msgstr "Treoir mídhleathach" + +#: siglist.c:67 +msgid "BPT trace/trap" +msgstr "Rianú/gaistiú brisphointe" + +#: siglist.c:75 +msgid "ABORT instruction" +msgstr "Treoir ABORT" + +#: siglist.c:79 +msgid "EMT instruction" +msgstr "Treoir EMT" + +#: siglist.c:83 +msgid "Floating point exception" +msgstr "Eisceacht snámhphointe" + +#: siglist.c:87 +msgid "Killed" +msgstr "Maraithe" + +#: siglist.c:91 +msgid "Bus error" +msgstr "Earráid bhus" + +#: siglist.c:95 +msgid "Segmentation fault" +msgstr "Fabht deighilte" + +#: siglist.c:99 +msgid "Bad system call" +msgstr "Droch-ghlaoch córais" + +#: siglist.c:103 +msgid "Broken pipe" +msgstr "Píopa briste" + +#: siglist.c:107 +msgid "Alarm clock" +msgstr "Clog aláraim" + +#: siglist.c:111 +msgid "Terminated" +msgstr "Críochnaithe" + +#: siglist.c:115 +msgid "Urgent IO condition" +msgstr "Staid phráinneach I/A" + +#: siglist.c:119 +msgid "Stopped (signal)" +msgstr "Stoptha (comhartha)" + +#: siglist.c:127 +msgid "Continue" +msgstr "Lean ar aghaidh" + +#: siglist.c:135 +msgid "Child death or stop" +msgstr "Bás macphróisis nó stopadh" + +#: siglist.c:139 +msgid "Stopped (tty input)" +msgstr "Stoptha (ionchur teirminéil)" + +#: siglist.c:143 +msgid "Stopped (tty output)" +msgstr "Stoptha (aschur teirminéil)" + +#: siglist.c:147 +msgid "I/O ready" +msgstr "I/A ullamh" + +#: siglist.c:151 +msgid "CPU limit" +msgstr "Teorainn LAP" + +#: siglist.c:155 +msgid "File limit" +msgstr "Teorainn chomhad" + +#: siglist.c:159 +msgid "Alarm (virtual)" +msgstr "Aláram (fíorúil)" + +#: siglist.c:163 +msgid "Alarm (profile)" +msgstr "Aláram (próifíl)" + +#: siglist.c:167 +msgid "Window changed" +msgstr "Fuinneog athraithe" + +#: siglist.c:171 +msgid "Record lock" +msgstr "Glas taifid" + +#: siglist.c:175 +msgid "User signal 1" +msgstr "Comhartha úsáideora 1" + +#: siglist.c:179 +msgid "User signal 2" +msgstr "Comhartha úsáideora 2" + +#: siglist.c:183 +msgid "HFT input data pending" +msgstr "sonraí ionchuir HFT ar feitheamh" + +#: siglist.c:187 +msgid "power failure imminent" +msgstr "teip chumhachta ar tí tarlú" + +#: siglist.c:191 +msgid "system crash imminent" +msgstr "cliseadh córais ar tí tarlú" + +#: siglist.c:195 +msgid "migrate process to another CPU" +msgstr "bog próiseas go LAP eile" + +#: siglist.c:199 +msgid "programming error" +msgstr "earráid ríomhchláraithe" + +#: siglist.c:203 +msgid "HFT monitor mode granted" +msgstr "mód monatóireachta HFT ceadaithe" + +#: siglist.c:207 +msgid "HFT monitor mode retracted" +msgstr "mód monatóireachta HFT cealaithe" + +#: siglist.c:211 +msgid "HFT sound sequence has completed" +msgstr "seicheamh fuaime HFT críochnaithe" + +#: siglist.c:215 +msgid "Information request" +msgstr "Iarratas faisnéise" + +#: siglist.c:223 +msgid "Unknown Signal #" +msgstr "Comhartha neamhaithnid #" + +#: siglist.c:225 +#, c-format +msgid "Unknown Signal #%d" +msgstr "Comhartha neamhaithnid #%d" + +#: subst.c:1362 subst.c:1520 +#, c-format +msgid "bad substitution: no closing `%s' in %s" +msgstr "Drochionadú: níl \"%s\" dúnta i %s" + +#: subst.c:2847 +#, c-format +msgid "%s: cannot assign list to array member" +msgstr "%s: ní féidir liosta a shannadh go ball eagair." + +#: subst.c:5065 subst.c:5081 +msgid "cannot make pipe for process substitution" +msgstr "Ní féidir píopa a dhéanamh le haghaidh ionadaíocht próisis." + +#: subst.c:5113 +msgid "cannot make child for process substitution" +msgstr "Ní féidir macphróiseas a dhéanamh le haghaidh ionadaíocht próisis." + +#: subst.c:5158 +#, c-format +msgid "cannot open named pipe %s for reading" +msgstr "Ní féidir píopa ainmnithe %s a oscailt le haghaidh léamh." + +#: subst.c:5160 +#, c-format +msgid "cannot open named pipe %s for writing" +msgstr "Ní féidir píopa ainmnithe %s a oscailt le haghaidh scríofa." + +#: subst.c:5178 +#, c-format +msgid "cannot duplicate named pipe %s as fd %d" +msgstr "" +"Ní féidir an píopa ainmnithe %s a dhúbailt mar thuairisceoir comhaid %d." + +#: subst.c:5376 +msgid "cannot make pipe for command substitution" +msgstr "Ní féidir píopa a dhéanamh le haghaidh ionadú ordaithe." + +#: subst.c:5414 +msgid "cannot make child for command substitution" +msgstr "Ní féidir macphróiseas a dhéanamh le haghaidh ionadú ordaithe." + +#: subst.c:5433 +msgid "command_substitute: cannot duplicate pipe as fd 1" +msgstr "" +"command_substitute: ní feidir an píopa a dhúbailt mar thuairisceoir comhaid " +"1." + +#: subst.c:5837 subst.c:8050 +#, fuzzy, c-format +msgid "%s: invalid variable name for name reference" +msgstr "%d: tuairisceoir comhaid neamhbhailí: %s" + +#: subst.c:6048 +#, c-format +msgid "%s: parameter null or not set" +msgstr "%s: paraiméadar neamhnitheach nó gan socrú." + +#: subst.c:6320 subst.c:6335 +#, c-format +msgid "%s: substring expression < 0" +msgstr "%s: slonn fotheaghráin < 0" + +#: subst.c:7506 +#, c-format +msgid "%s: bad substitution" +msgstr "%s: drochionadú" + +#: subst.c:7583 +#, c-format +msgid "$%s: cannot assign in this way" +msgstr "$%s: ní féidir sannadh mar seo." + +#: subst.c:7917 +msgid "" +"future versions of the shell will force evaluation as an arithmetic " +"substitution" +msgstr "" + +#: subst.c:8421 +#, c-format +msgid "bad substitution: no closing \"`\" in %s" +msgstr "drochionadú: níl \"`\" dúnta i %s" + +#: subst.c:9322 +#, c-format +msgid "no match: %s" +msgstr "gan meaitseáil: %s" + +#: test.c:147 +msgid "argument expected" +msgstr "Bhíothas ag súil le hargóint." + +#: test.c:156 +#, c-format +msgid "%s: integer expression expected" +msgstr "%s: ag súil le slonn slánuimhreach." + +#: test.c:264 +msgid "`)' expected" +msgstr "Ag súil le \")\"" + +#: test.c:266 +#, c-format +msgid "`)' expected, found %s" +msgstr "Ag súil le \")\", ach fuarthas %s." + +#: test.c:281 test.c:742 test.c:745 +#, c-format +msgid "%s: unary operator expected" +msgstr "%s: ag súil le hoibreoir aonártha." + +#: test.c:468 test.c:785 +#, c-format +msgid "%s: binary operator expected" +msgstr "%s: ag súil le hoibreoir dénártha." + +#: test.c:860 +msgid "missing `]'" +msgstr "\"]\" ar iarraidh" + +#: trap.c:217 +msgid "invalid signal number" +msgstr "Uimhir chomhartha neamhbhailí" + +#: trap.c:371 +#, c-format +msgid "run_pending_traps: bad value in trap_list[%d]: %p" +msgstr "run_pending_traps: drochluach sa liosta_gaistí[%d]: %p" + +#: trap.c:375 +#, c-format +msgid "" +"run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" +msgstr "" +"run_pending_traps: is SIG_DFL an láimhseálaí comharthaí; %d (%s) á " +"athsheoladh chugam féin." + +#: trap.c:428 +#, c-format +msgid "trap_handler: bad signal %d" +msgstr "trap_handler: droch-chomhartha %d" + +#: variables.c:382 +#, c-format +msgid "error importing function definition for `%s'" +msgstr "Earráid agus sainmhíniú na feidhme \"%s\" á iompórtáil." + +#: variables.c:780 +#, c-format +msgid "shell level (%d) too high, resetting to 1" +msgstr "Tá an leibhéal blaoisce (%d) ró-ard; á athshocrú go 1." + +#: variables.c:1865 +#, fuzzy, c-format +msgid "%s: circular name reference" +msgstr "%d: tuairisceoir comhaid neamhbhailí: %s" + +#: variables.c:2228 +msgid "make_local_variable: no function context at current scope" +msgstr "make_local_variable: níl comhthéacs feidhme sa scóip reatha." + +#: variables.c:2247 +#, fuzzy, c-format +msgid "%s: variable may not be assigned value" +msgstr "%s: ní féidir liosta a shannadh go ball eagair." + +#: variables.c:3646 +msgid "all_local_variables: no function context at current scope" +msgstr "all_local_variables: níl comhthéacs feidhme sa scóip reatha" + +#: variables.c:3891 +#, fuzzy, c-format +msgid "%s has null exportstr" +msgstr "%s: paraiméadar neamhnitheach nó gan socrú." + +#: variables.c:3896 variables.c:3905 +#, c-format +msgid "invalid character %d in exportstr for %s" +msgstr "Carachtar neamhbhailí %d sa teaghrán easpórtála le haghaidh %s." + +#: variables.c:3911 +#, c-format +msgid "no `=' in exportstr for %s" +msgstr "Níl \"=\" sa teaghrán easpórtála le haghaidh %s." + +#: variables.c:4344 +msgid "pop_var_context: head of shell_variables not a function context" +msgstr "pop_var_context: ní comhthéacs feidhme é ceann shell_variables" + +#: variables.c:4357 +msgid "pop_var_context: no global_variables context" +msgstr "pop_var_context: níl comhthéacs global_variables ann" + +#: variables.c:4431 +msgid "pop_scope: head of shell_variables not a temporary environment scope" +msgstr "pop_scope: ní scóip shealadach thimpeallachta é ceann shell_variables" + +#: variables.c:5257 +#, fuzzy, c-format +msgid "%s: %s: cannot open as FILE" +msgstr "%s: ní féidir oscailt: %s" + +#: variables.c:5262 +#, fuzzy, c-format +msgid "%s: %s: invalid value for trace file descriptor" +msgstr "%d: tuairisceoir comhaid neamhbhailí: %s" + +#: variables.c:5307 +#, fuzzy, c-format +msgid "%s: %s: compatibility value out of range" +msgstr "%s: %s as raon" + +#: version.c:46 +#, fuzzy +msgid "Copyright (C) 2013 Free Software Foundation, Inc." +msgstr "Cóipcheart © 2009 Free Software Foundation, Inc." + +#: version.c:47 version2.c:47 +msgid "" +"License GPLv3+: GNU GPL version 3 or later \n" +msgstr "" +"Ceadúnas GPLv3+: GNU GPL leagan 3 nó níos déanaí \n" + +#: version.c:86 version2.c:86 +#, c-format +msgid "GNU bash, version %s (%s)\n" +msgstr "GNU bash, leagan %s (%s)\n" + +#: version.c:91 version2.c:91 +#, fuzzy +msgid "This is free software; you are free to change and redistribute it." +msgstr "Is saorbhogearra é seo; tá cead agat é a athrú agus a dháileadh.\n" + +#: version.c:92 version2.c:92 +#, fuzzy +msgid "There is NO WARRANTY, to the extent permitted by law." +msgstr "" +"Ní ghabhann baránta ar bith leis, sa mhéid is atá sin ceadaithe de réir " +"dlí.\n" + +#: version2.c:46 +#, fuzzy +msgid "Copyright (C) 2012 Free Software Foundation, Inc." +msgstr "Cóipcheart © 2009 Free Software Foundation, Inc." + +#: xmalloc.c:91 +#, fuzzy, c-format +msgid "%s: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "xmalloc: ní féidir %lu beart a leithdháileadh (%lu beart leithdháilte)" + +#: xmalloc.c:93 +#, fuzzy, c-format +msgid "%s: cannot allocate %lu bytes" +msgstr "xmalloc: ní féidir %lu beart a leithdháileadh" + +#: xmalloc.c:163 +#, fuzzy, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "" +"xmalloc: %s:%d: ní féidir %lu beart a leithdháileadh (%lu beart leithdháilte)" + +#: xmalloc.c:165 +#, fuzzy, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes" +msgstr "xmalloc: %s:%d: ní féidir %lu beart a leithdháileadh" + +#: builtins.c:43 +msgid "alias [-p] [name[=value] ... ]" +msgstr "alias [-p] [ainm[=luach] ... ]" + +#: builtins.c:47 +msgid "unalias [-a] name [name ...]" +msgstr "unalias [-a] ainm [ainm ...]" + +#: builtins.c:51 +msgid "" +"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-" +"x keyseq:shell-command] [keyseq:readline-function or readline-command]" +msgstr "" + +#: builtins.c:54 +msgid "break [n]" +msgstr "break [N]" + +#: builtins.c:56 +msgid "continue [n]" +msgstr "continue [N]" + +#: builtins.c:58 +msgid "builtin [shell-builtin [arg ...]]" +msgstr "builtin [ORDÚ-IONSUITE-BLAOISCE [ARGÓINT ...]]" + +#: builtins.c:61 +msgid "caller [expr]" +msgstr "caller [SLONN]" + +#: builtins.c:64 +#, fuzzy +msgid "cd [-L|[-P [-e]] [-@]] [dir]" +msgstr "cd [-L|-P] [comhadlann]" + +#: builtins.c:66 +msgid "pwd [-LP]" +msgstr "pwd [-LP]" + +#: builtins.c:68 +msgid ":" +msgstr ":" + +#: builtins.c:70 +msgid "true" +msgstr "true" + +#: builtins.c:72 +msgid "false" +msgstr "false" + +#: builtins.c:74 +msgid "command [-pVv] command [arg ...]" +msgstr "command [-pVv] ORDÚ [ARGÓINT ...]" + +#: builtins.c:76 +#, fuzzy +msgid "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" +msgstr "declare [-aAfFilrtux] [-p] [ainm[=luach] ...]" + +#: builtins.c:78 +#, fuzzy +msgid "typeset [-aAfFgilrtux] [-p] name[=value] ..." +msgstr "typeset [-aAfFilrtux] [-p] ainm[=luach] ..." + +#: builtins.c:80 +msgid "local [option] name[=value] ..." +msgstr "local [ROGHA] AINM[=LUACH] ..." + +#: builtins.c:83 +msgid "echo [-neE] [arg ...]" +msgstr "echo [-neE] [ARGÓINT ...]" + +#: builtins.c:87 +msgid "echo [-n] [arg ...]" +msgstr "echo [-n] [ARGÓINT ...]" + +#: builtins.c:90 +msgid "enable [-a] [-dnps] [-f filename] [name ...]" +msgstr "enable [-a] [-dnps] [-f comhadainm] [ainm ...]" + +#: builtins.c:92 +msgid "eval [arg ...]" +msgstr "eval [argóint ...]" + +#: builtins.c:94 +msgid "getopts optstring name [arg]" +msgstr "getopts teaghrán_roghanna ainm [argóint]" + +#: builtins.c:96 +msgid "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" +msgstr "exec [-cl] [-a ainm] [ordú [argóintí ...]] [atreorú ...]" + +#: builtins.c:98 +msgid "exit [n]" +msgstr "exit [N]" + +#: builtins.c:100 +msgid "logout [n]" +msgstr "logout [n]" + +#: builtins.c:103 +msgid "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" +msgstr "" +"fc [-e AINM_E] [-lnr] [CÉAD] [DEIREANACH] nó fc -s [PATRÚN=IONADAÍ] [ORDÚ]" + +#: builtins.c:107 +msgid "fg [job_spec]" +msgstr "fg [SONRÚ_JAB]" + +#: builtins.c:111 +msgid "bg [job_spec ...]" +msgstr "bg [SONRÚ_JAB ...]" + +#: builtins.c:114 +msgid "hash [-lr] [-p pathname] [-dt] [name ...]" +msgstr "hash [-lr] [-p CONAIR] [-dt] [AINM ...]" + +#: builtins.c:117 +#, fuzzy +msgid "help [-dms] [pattern ...]" +msgstr "help [-ds] [PATRÚN ...]" + +#: builtins.c:121 +msgid "" +"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg " +"[arg...]" +msgstr "" +"history [-c] [-d SEACH_CHUR] [n] nó history -anrw [COMHADAINM] nó history -" +"ps ARGÓINT [ARGÓINT...]" + +#: builtins.c:125 +msgid "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" +msgstr "jobs [-lnprs] [SONRÚ_JAB ...] nó jobs -x ORDÚ [ARGÓINTÍ]" + +#: builtins.c:129 +msgid "disown [-h] [-ar] [jobspec ...]" +msgstr "disown [-h] [-ar] [SONRÚ_JAB ...]" + +#: builtins.c:132 +msgid "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l " +"[sigspec]" +msgstr "" +"kill [-s sonrú_comhartha | -n uimhir_chomhartha | -sonrú_comhartha] " +"aitheantóir_próisis | sonrú_jab ... nó kill -l [sonrú_comhartha]" + +#: builtins.c:134 +msgid "let arg [arg ...]" +msgstr "let argóint [argóint ...]" + +#: builtins.c:136 +#, fuzzy +msgid "" +"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p " +"prompt] [-t timeout] [-u fd] [name ...]" +msgstr "" +"read [-ers] [-a eagar] [-d teormharcóir] [-i téacs] [-n líon_carachtar] [-p " +"leid] [-t teorainn_ama] [-u tuairisceoir_comhaid] [ainm ...]" + +#: builtins.c:138 +msgid "return [n]" +msgstr "return [n]" + +#: builtins.c:140 +#, fuzzy +msgid "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" +msgstr "set [--abefhkmnptuvxBCHP] [-o ainm-rogha] [argóint ...]" + +#: builtins.c:142 +#, fuzzy +msgid "unset [-f] [-v] [-n] [name ...]" +msgstr "unset [-f] [-v] [ainm ...]" + +#: builtins.c:144 +msgid "export [-fn] [name[=value] ...] or export -p" +msgstr "export [-fn] [ainm[=luach] ...] nó export -p" + +#: builtins.c:146 +#, fuzzy +msgid "readonly [-aAf] [name[=value] ...] or readonly -p" +msgstr "readonly [-af] [ainm[=luach] ...] nó readonly -p" + +#: builtins.c:148 +msgid "shift [n]" +msgstr "shift [n]" + +#: builtins.c:150 +msgid "source filename [arguments]" +msgstr "source comhadainm [argóintí]" + +#: builtins.c:152 +msgid ". filename [arguments]" +msgstr ". comhadainm [argóintí]" + +#: builtins.c:155 +msgid "suspend [-f]" +msgstr "suspend [-f]" + +#: builtins.c:158 +msgid "test [expr]" +msgstr "test [slonn]" + +#: builtins.c:160 +msgid "[ arg... ]" +msgstr "[ argóint... ]" + +#: builtins.c:162 +msgid "times" +msgstr "times" + +#: builtins.c:164 +msgid "trap [-lp] [[arg] signal_spec ...]" +msgstr "trap [-lp] [[argóint] sonrú_comhartha ...]" + +#: builtins.c:166 +msgid "type [-afptP] name [name ...]" +msgstr "type [-afptP] ainm [ainm ...]" + +#: builtins.c:169 +#, fuzzy +msgid "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" +msgstr "ulimit [-SHacdefilmnpqrstuvx] [teorainn]" + +#: builtins.c:172 +msgid "umask [-p] [-S] [mode]" +msgstr "umask [-p] [-S] [mód]" + +#: builtins.c:175 +#, fuzzy +msgid "wait [-n] [id ...]" +msgstr "wait [aitheantas]" + +#: builtins.c:179 +#, fuzzy +msgid "wait [pid ...]" +msgstr "wait [aitheantas]" + +#: builtins.c:182 +msgid "for NAME [in WORDS ... ] ; do COMMANDS; done" +msgstr "for AINM [in FOCAIL ... ] ; do ORDUITHE; done" + +#: builtins.c:184 +msgid "for (( exp1; exp2; exp3 )); do COMMANDS; done" +msgstr "for (( slonn1; slonn2; slonn3 )); do ORDUITHE; done" + +#: builtins.c:186 +msgid "select NAME [in WORDS ... ;] do COMMANDS; done" +msgstr "select AINM [in FOCAIL ... ;] do ORDUITHE; done" + +#: builtins.c:188 +msgid "time [-p] pipeline" +msgstr "time [-p] píblíne" + +#: builtins.c:190 +msgid "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" +msgstr "case FOCAL in [PATRÚN [| PATRÚN]...) ORDUITHE ;;]... esac" + +#: builtins.c:192 +msgid "" +"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else " +"COMMANDS; ] fi" +msgstr "" +"if ORDUITHE; then ORDUITHE; [ elif ORDUITHE; then ORDUITHE; ]... [ else " +"ORDUITHE; ] fi" + +#: builtins.c:194 +msgid "while COMMANDS; do COMMANDS; done" +msgstr "while ORDUITHE; do ORDUITHE; done" + +#: builtins.c:196 +msgid "until COMMANDS; do COMMANDS; done" +msgstr "until ORDUITHE; do ORDUITHE; done" + +#: builtins.c:198 +msgid "coproc [NAME] command [redirections]" +msgstr "coproc [AINM] ordú [atreoruithe]" + +#: builtins.c:200 +msgid "function name { COMMANDS ; } or name () { COMMANDS ; }" +msgstr "function AINM { ORDUITHE ; } nó AINM () { ORDUITHE ; }" + +#: builtins.c:202 +msgid "{ COMMANDS ; }" +msgstr "{ ORDUITHE ; }" + +#: builtins.c:204 +msgid "job_spec [&]" +msgstr "sonrú_jab [&]" + +#: builtins.c:206 +msgid "(( expression ))" +msgstr "(( slonn ))" + +#: builtins.c:208 +msgid "[[ expression ]]" +msgstr "[[ slonn ]]" + +#: builtins.c:210 +msgid "variables - Names and meanings of some shell variables" +msgstr "Athróga - ainmneacha agus mínithe ar fathróga áirithe blaoisce" + +#: builtins.c:213 +msgid "pushd [-n] [+N | -N | dir]" +msgstr "pushd [-n] [+N | -N | comhadlann]" + +#: builtins.c:217 +msgid "popd [-n] [+N | -N]" +msgstr "popd [-n] [+N | -N]" + +#: builtins.c:221 +msgid "dirs [-clpv] [+N] [-N]" +msgstr "dirs [-clpv] [+N] [-N]" + +#: builtins.c:224 +msgid "shopt [-pqsu] [-o] [optname ...]" +msgstr "shopt [-pqsu] [-o] [ainm_rogha ...]" + +#: builtins.c:226 +msgid "printf [-v var] format [arguments]" +msgstr "printf [-v athróg] formáid [argóintí]" + +#: builtins.c:229 +#, fuzzy +msgid "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-" +"W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S " +"suffix] [name ...]" +msgstr "" +"complete [-abcdefgjksuv] [-pr] [-o rogha] [-A gníomh] [-G patrún] [-W " +"liosta_focal] [-F feidhm] [-C ordú] [-X patrún_scagaire] [-P réimír] [-S " +"iarmhír] [ainm ...]" + +#: builtins.c:233 +msgid "" +"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " +"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" +msgstr "" +"compgen [-abcdefgjksuv] [-o rogha] [-A gníomh] [-G patrún] [-W " +"liosta_focal] [-F feidhm] [-C ordú] [-X patrún_scagaire] [-P réimír] [-S " +"iarmhír] [FOCAL]" + +#: builtins.c:237 +#, fuzzy +msgid "compopt [-o|+o option] [-DE] [name ...]" +msgstr "compopt [-o|+o rogha] [ainm ...]" + +#: builtins.c:240 +msgid "" +"mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "a" + +#: builtins.c:242 +msgid "" +"readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "t" + +#: builtins.c:254 +msgid "" +"Define or display aliases.\n" +" \n" +" Without arguments, `alias' prints the list of aliases in the reusable\n" +" form `alias NAME=VALUE' on standard output.\n" +" \n" +" Otherwise, an alias is defined for each NAME whose VALUE is given.\n" +" A trailing space in VALUE causes the next word to be checked for\n" +" alias substitution when the alias is expanded.\n" +" \n" +" Options:\n" +" -p\tPrint all defined aliases in a reusable format\n" +" \n" +" Exit Status:\n" +" alias returns true unless a NAME is supplied for which no alias has " +"been\n" +" defined." +msgstr "" +"Sainigh nó taispeáin ailiasanna.\n" +" \n" +" Gan argóintí, priontálann \"alias\" an liosta ailiasanna san fhoirm\n" +" \"alias LUACH=VALUE\" ar an ngnáth-aschur.\n" +" \n" +" I ngach cás eile, sainítear ailias do gach AINM a thugtar LUACH dó.\n" +" Má tá spás chun deiridh LUACH, déantar an chéad fhocal eile a sheiceáil\n" +" le haghaidh ionadú ailias nuair a fhairsingítear an ailias.\n" +" \n" +" Roghanna:\n" +" -p\tPriontáil gach ailias sainithe i bhfoirm inathúsáidte.\n" +" \n" +" Stádas Scortha:\n" +" Aischuirtear an luach true mura thugtar AINM nach bhfuil\n" +" ailias sainithe dó." + +#: builtins.c:276 +msgid "" +"Remove each NAME from the list of defined aliases.\n" +" \n" +" Options:\n" +" -a\tremove all alias definitions.\n" +" \n" +" Return success unless a NAME is not an existing alias." +msgstr "" +"Bain gach AINM de liosta na n-ailiasanna sainithe.\n" +" \n" +" Roghanna:\n" +" -a\tbain gach sainiú ailias.\n" +" \n" +" Aischuirtear rath ach sa chás nach bhfuil AINM ann." + +#: builtins.c:289 +msgid "" +"Set Readline key bindings and variables.\n" +" \n" +" Bind a key sequence to a Readline function or a macro, or set a\n" +" Readline variable. The non-option argument syntax is equivalent to\n" +" that found in ~/.inputrc, but must be passed as a single argument:\n" +" e.g., bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Options:\n" +" -m keymap Use KEYMAP as the keymap for the duration of this\n" +" command. Acceptable keymap names are emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" +"move,\n" +" vi-command, and vi-insert.\n" +" -l List names of functions.\n" +" -P List function names and bindings.\n" +" -p List functions and bindings in a form that can be\n" +" reused as input.\n" +" -S List key sequences that invoke macros and their " +"values\n" +" -s List key sequences that invoke macros and their " +"values\n" +" in a form that can be reused as input.\n" +" -V List variable names and values\n" +" -v List variable names and values in a form that can\n" +" be reused as input.\n" +" -q function-name Query about which keys invoke the named function.\n" +" -u function-name Unbind all keys which are bound to the named " +"function.\n" +" -r keyseq Remove the binding for KEYSEQ.\n" +" -f filename Read key bindings from FILENAME.\n" +" -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when\n" +" \t\t\t\tKEYSEQ is entered.\n" +" -X\t\t List key sequences bound with -x and associated commands\n" +" in a form that can be reused as input.\n" +" \n" +" Exit Status:\n" +" bind returns 0 unless an unrecognized option is given or an error occurs." +msgstr "" + +#: builtins.c:328 +msgid "" +"Exit for, while, or until loops.\n" +" \n" +" Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n" +" loops.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Scoir de lúba for, while nó until.\n" +" \n" +" Scoir de lúb \"for\", \"while\" \"nó \"until\". Má shonraítear N, scoir\n" +" de N lúb mhórthimpeall.\n" +" \n" +" Stádas Scortha:\n" +" Is é 0 an stádas scortha mura bhfuil N níos lú ná 1." + +#: builtins.c:340 +msgid "" +"Resume for, while, or until loops.\n" +" \n" +" Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n" +" If N is specified, resumes the Nth enclosing loop.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Lean ar aghaidh le lúba for, while nó until.\n" +" \n" +" Tosaigh an chéad atriall eile den lúb mhórthimpeall \"for\", \"while\" " +"nó \"until\".\n" +" Má shonraítear N, tosaigh an Nú lúb mhórthimpeall.\n" +" \n" +" Stádas Scortha:\n" +" Is é 0 an stádas scortha mura bhfuil N níos lú ná 1." + +#: builtins.c:352 +msgid "" +"Execute shell builtins.\n" +" \n" +" Execute SHELL-BUILTIN with arguments ARGs without performing command\n" +" lookup. This is useful when you wish to reimplement a shell builtin\n" +" as a shell function, but need to execute the builtin within the " +"function.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n" +" not a shell builtin.." +msgstr "" +"Rith orduithe ionsuite na blaoisce.\n" +" \n" +" Rith ORDÚ-IONSUITE-BLAOISCE leis na hargóintí ARGÓINTÍ gan cuardach\n" +" ordaithe a dhéanamh. Tá sé seo úsáideach más mian leat ordú blaoisce a\n" +" athshainiú mar fheidhm bhlaoisce agus gur ghá an t-ordú ionsuite a rith\n" +" laistigh den fheidhm.\n" +" \n" +" Stádas Scortha:\n" +" Aischuirtear stádas scortha ORDÚ-IONSUITE-BLAOISCE, nó falsa mura " +"bhfuil\n" +" ORDÚ-IONSUITE-BLAOISCE ina ordú ionsuite blaoisce." + +#: builtins.c:367 +msgid "" +"Return the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns \"$line $filename\". With EXPR, returns\n" +" \"$line $subroutine $filename\"; this extra information can be used to\n" +" provide a stack trace.\n" +" \n" +" The value of EXPR indicates how many call frames to go back before the\n" +" current one; the top frame is frame 0.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless the shell is not executing a shell function or EXPR\n" +" is invalid." +msgstr "" +"Aischuir comhthéacs an ghlaoigh reatha fhoghnáthaimh.\n" +" \n" +" Gan SLONN, aischuirtear \"$line $filename\". Le SLONN, aischuirtear\n" +" \"$line $subroutine $filename\"; is féidir lorg cruaiche a sholáthar " +"leis an\n" +" fhaisnéis bhreise seo.\n" +" \n" +" Taispeánann an luach atá ag SLONN an méis frámaí glaoigh le dul siar\n" +" roimh an ceann reatha; fráma 0 an ceann atá ar barr.\n" +" \n" +" Stádas Scortha:\n" +" Aischuirtear 0 ach sa chás nach bhfuil an bhlaosc ag rith feidhme " +"blaoisce, nó\n" +" sa chás go bhfuil SLONN neamhbhailí." + +#: builtins.c:385 +msgid "" +"Change the shell working directory.\n" +" \n" +" Change the current directory to DIR. The default DIR is the value of " +"the\n" +" HOME shell variable.\n" +" \n" +" The variable CDPATH defines the search path for the directory " +"containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon " +"(:).\n" +" A null directory name is the same as the current directory. If DIR " +"begins\n" +" with a slash (/), then CDPATH is not used.\n" +" \n" +" If the directory is not found, and the shell option `cdable_vars' is " +"set,\n" +" the word is assumed to be a variable name. If that variable has a " +"value,\n" +" its value is used for DIR.\n" +" \n" +" Options:\n" +" -L\tforce symbolic links to be followed: resolve symbolic links in\n" +" \tDIR after processing instances of `..'\n" +" -P\tuse the physical directory structure without following symbolic\n" +" \tlinks: resolve symbolic links in DIR before processing instances\n" +" \tof `..'\n" +" -e\tif the -P option is supplied, and the current working directory\n" +" \tcannot be determined successfully, exit with a non-zero status\n" +" -@ on systems that support it, present a file with extended " +"attributes\n" +" as a directory containing the file attributes\n" +" \n" +" The default is to follow symbolic links, as if `-L' were specified.\n" +" `..' is processed by removing the immediately previous pathname " +"component\n" +" back to a slash or the beginning of DIR.\n" +" \n" +" Exit Status:\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully " +"when\n" +" -P is used; non-zero otherwise." +msgstr "" + +#: builtins.c:422 +msgid "" +"Print the name of the current working directory.\n" +" \n" +" Options:\n" +" -L\tprint the value of $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tprint the physical directory, without any symbolic links\n" +" \n" +" By default, `pwd' behaves as if `-L' were specified.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless an invalid option is given or the current directory\n" +" cannot be read." +msgstr "" +"Priontáil ainm na comhadlainne oibre reatha.\n" +" \n" +" Roghanna:\n" +" -L\tpriontáil luach $PWD má thugann sé ainm na comhadlainne\n" +" \toibre reatha. -P\tpriontáil an chomhadlann fhisiciúil, gan naisc " +"shiombalacha\n" +" \n" +" Mar réamhshocrú, oibríonn \"pwd\" faoi mar a bheadh \"-L\" sonraithe.\n" +" \n" +" Stádas Scortha:\n" +" Aischuirtear luach de 0 mura thugtar rogha neamhbhailí nó mura féidir\n" +" an chomhadlann reatha a léamh." + +#: builtins.c:439 +msgid "" +"Null command.\n" +" \n" +" No effect; the command does nothing.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Ordú neamhnitheach.\n" +" \n" +" Gan éifeacht; ní dhéanann an t-ordú faic.\n" +" \n" +" Stadas Scortha:\n" +" Éiríonn leis i gcónaí." + +#: builtins.c:450 +msgid "" +"Return a successful result.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Aischuir toradh rathúil.\n" +" \n" +" Stádas Scortha:\n" +" Éiríonn leis i gcónaí." + +#: builtins.c:459 +msgid "" +"Return an unsuccessful result.\n" +" \n" +" Exit Status:\n" +" Always fails." +msgstr "" +"Aischuir toradh neamhrathúil.\n" +" \n" +" Stádas Scortha:\n" +" Teipeann air i gcónaí." + +#: builtins.c:468 +msgid "" +"Execute a simple command or display information about commands.\n" +" \n" +" Runs COMMAND with ARGS suppressing shell function lookup, or display\n" +" information about the specified COMMANDs. Can be used to invoke " +"commands\n" +" on disk when a function with the same name exists.\n" +" \n" +" Options:\n" +" -p\tuse a default value for PATH that is guaranteed to find all of\n" +" \tthe standard utilities\n" +" -v\tprint a description of COMMAND similar to the `type' builtin\n" +" -V\tprint a more verbose description of each COMMAND\n" +" \n" +" Exit Status:\n" +" Returns exit status of COMMAND, or failure if COMMAND is not found." +msgstr "" +"Rith ordú simplí nó taispeáin eolas maidir le horduithe.\n" +" \n" +" Ritheann ORDÚ le hARGÓINTÍ gan cuardach feidhme blaoisce, nó " +"taispeánann\n" +" eolas maidir leis na horduithe sonraithe. Is féidir é seo a úsáid chun " +"orduithe ar\n" +" diosca a rith má tá feidhm leis an ainm céanna ann.\n" +" \n" +" Roghanna:\n" +" -p\túsáid luach réamhshocraithe le haghaidh CONAIR a aimseoidh go " +"cinnte\n" +" \tgach ceann de na gnáthríomhchláir áirge.\n" +" -v\ttaispeáin cur síos ar ORDÚ cosúil leis an ordú ionsuite \"type\"\n" +" -V\ttaispeáin cur síos níos faide de gach ORDÚ\n" +" \n" +" Stádas Scortha:\n" +" Aischuirtear an stádas scortha ó ORDÚ, nó teip mura aimsítear ORDÚ." + +#: builtins.c:487 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Declare variables and give them attributes. If no NAMEs are given,\n" +" display the attributes and values of all variables.\n" +" \n" +" Options:\n" +" -f\trestrict action or display to function names and definitions\n" +" -F\trestrict display to function names only (plus line number and\n" +" \tsource file when debugging)\n" +" -g\tcreate global variables when used in a shell function; otherwise\n" +" \tignored\n" +" -p\tdisplay the attributes and value of each NAME\n" +" \n" +" Options which set attributes:\n" +" -a\tto make NAMEs indexed arrays (if supported)\n" +" -A\tto make NAMEs associative arrays (if supported)\n" +" -i\tto make NAMEs have the `integer' attribute\n" +" -l\tto convert NAMEs to lower case on assignment\n" +" -n\tmake NAME a reference to the variable named by its value\n" +" -r\tto make NAMEs readonly\n" +" -t\tto make NAMEs have the `trace' attribute\n" +" -u\tto convert NAMEs to upper case on assignment\n" +" -x\tto make NAMEs export\n" +" \n" +" Using `+' instead of `-' turns off the given attribute.\n" +" \n" +" Variables with the integer attribute have arithmetic evaluation (see\n" +" the `let' command) performed when the variable is assigned a value.\n" +" \n" +" When used in a function, `declare' makes NAMEs local, as with the " +"`local'\n" +" command. The `-g' option suppresses this behavior.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or a variable\n" +" assignment error occurs." +msgstr "" + +#: builtins.c:527 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Obsolete. See `help declare'." +msgstr "" +"Socraigh luachanna agus airíonna athróg.\n" +" \n" +" Imithe i léig. Feic \"help declare\"." + +#: builtins.c:535 +#, fuzzy +msgid "" +"Define local variables.\n" +" \n" +" Create a local variable called NAME, and give it VALUE. OPTION can\n" +" be any option accepted by `declare'.\n" +" \n" +" Local variables can only be used within a function; they are visible\n" +" only to the function where they are defined and its children.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied, a variable\n" +" assignment error occurs, or the shell is not executing a function." +msgstr "" +"Sainigh athróga logánta.\n" +" \n" +" Cruthaítear athróg logánta darbh ainm AINM, agus cuirtear LUACH leis. " +"Is\n" +" féidir le ROGHA a bheith ceann ar bith de na roghanna a ghlacann " +"\"declare\" leo.\n" +" \n" +" Ní féidir athróga logánta a úsáid ach laistigh de fheidhm. Tá siad " +"infheicthe\n" +" san fheidhm ina shainítear iad agus a mic amháin.\n" +" \n" +" Stádas Scortha:\n" +" Aischuirtear rath mura thugtar rogha neamhbhailí, nó mura tharlaíonn " +"earráid,\n" +" nó mura bhfuil an bhlaosc ag rith feidhme." + +#: builtins.c:552 +#, fuzzy +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs, separated by a single space character and followed by " +"a\n" +" newline, on the standard output.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" -e\tenable interpretation of the following backslash escapes\n" +" -E\texplicitly suppress interpretation of backslash escapes\n" +" \n" +" `echo' interprets the following backslash-escaped characters:\n" +" \\a\talert (bell)\n" +" \\b\tbackspace\n" +" \\c\tsuppress further output\n" +" \\e\tescape character\n" +" \\E\tescape character\n" +" \\f\tform feed\n" +" \\n\tnew line\n" +" \\r\tcarriage return\n" +" \\t\thorizontal tab\n" +" \\v\tvertical tab\n" +" \\\\\tbackslash\n" +" \\0nnn\tthe character whose ASCII code is NNN (octal). NNN can be\n" +" \t0 to 3 octal digits\n" +" \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" +" \tcan be one or two hex digits\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Scríobh na hargóintí ar an ngnáthaschur.\n" +" \n" +" Taispeáin na hARGÓINTÍ ar an ngnáthaschur agus líne nua ina ndiadh.\n" +" \n" +" Roghanna:\n" +" -n\tná hiarcheangail líne nua\n" +" -n\tcumasaigh na héaluithe cúlslaise -E\tdíchumasaigh na " +"héaluithe cúlslaise \n" +" Tuigeann \"echo\" na carachtair éalaithe le cúlslais seo a leanas:\n" +" \\a\tairdeall (clog)\n" +" \\b\tcúlspás\n" +" \\c\tcur deireadh le aschur\n" +" \\e\tcaractar éalaithe\n" +" \\f\tfotha foirme\n" +" \\n\tlíne nua\n" +" \\r\taisfhilleadh carráiste\n" +" \\t\ttáib chothrománach\n" +" \\v\ttáib ingearach\n" +" \\\\\tcúlslais\n" +" \\0nnn\tan carachtar leis an gcód ASCII NNN (ochtnártha). Is féidir le " +"NNN\n" +" \tbheith 0 go 3 digit ochtnártha ar fhad\n" +" \\xHH\tan carachtar ocht ngiotán leis an luach HH (heicsidheachúlach). " +"Is\n" +" \tféidir le HH bheith 1 nó 2 digit heicsidheachúlach ar fhad.\n" +" \n" +" Stádas Scortha:\n" +" Aischuirtear rath ach i gcás earráide scríofa." + +#: builtins.c:588 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs on the standard output followed by a newline.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" +"Scríobh na hargóintí ar an ngnáthaschur.\n" +" \n" +" Taispeáin na hARGÓINTÍ ar an ngnáthaschur agus líne nua ina ndiaidh.\n" +" \n" +" Roghanna:\n" +" -n\tná hiarcheangail líne nua\n" +" \n" +" Stádas Scortha:\n" +" Aischuirtear rath ach i gcás earráide scríofa." + +#: builtins.c:603 +msgid "" +"Enable and disable shell builtins.\n" +" \n" +" Enables and disables builtin shell commands. Disabling allows you to\n" +" execute a disk command which has the same name as a shell builtin\n" +" without using a full pathname.\n" +" \n" +" Options:\n" +" -a\tprint a list of builtins showing whether or not each is enabled\n" +" -n\tdisable each NAME or display a list of disabled builtins\n" +" -p\tprint the list of builtins in a reusable format\n" +" -s\tprint only the names of Posix `special' builtins\n" +" \n" +" Options controlling dynamic loading:\n" +" -f\tLoad builtin NAME from shared object FILENAME\n" +" -d\tRemove a builtin loaded with -f\n" +" \n" +" Without options, each NAME is enabled.\n" +" \n" +" To use the `test' found in $PATH instead of the shell builtin\n" +" version, type `enable -n test'.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not a shell builtin or an error occurs." +msgstr "" + +#: builtins.c:631 +msgid "" +"Execute arguments as a shell command.\n" +" \n" +" Combine ARGs into a single string, use the result as input to the " +"shell,\n" +" and execute the resulting commands.\n" +" \n" +" Exit Status:\n" +" Returns exit status of command or success if command is null." +msgstr "" +"Rith argóintí mar ordú blaoisce.\n" +" \n" +" Cuir ARGÓINTÍ i dteaghrán amháin, úsáid an toradh mar ionchur go dtí\n" +" an bhlaosc, agus rith na horduithe toraidh.\n" +" \n" +" Stádas Scortha:\n" +" Aischuirtear stádas scortha an ordaithe, nó rath más ordú neamhnitheach " +"é." + +#: builtins.c:643 +msgid "" +"Parse option arguments.\n" +" \n" +" Getopts is used by shell procedures to parse positional parameters\n" +" as options.\n" +" \n" +" OPTSTRING contains the option letters to be recognized; if a letter\n" +" is followed by a colon, the option is expected to have an argument,\n" +" which should be separated from it by white space.\n" +" \n" +" Each time it is invoked, getopts will place the next option in the\n" +" shell variable $name, initializing name if it does not exist, and\n" +" the index of the next argument to be processed into the shell\n" +" variable OPTIND. OPTIND is initialized to 1 each time the shell or\n" +" a shell script is invoked. When an option requires an argument,\n" +" getopts places that argument into the shell variable OPTARG.\n" +" \n" +" getopts reports errors in one of two ways. If the first character\n" +" of OPTSTRING is a colon, getopts uses silent error reporting. In\n" +" this mode, no error messages are printed. If an invalid option is\n" +" seen, getopts places the option character found into OPTARG. If a\n" +" required argument is not found, getopts places a ':' into NAME and\n" +" sets OPTARG to the option character found. If getopts is not in\n" +" silent mode, and an invalid option is seen, getopts places '?' into\n" +" NAME and unsets OPTARG. If a required argument is not found, a '?'\n" +" is placed in NAME, OPTARG is unset, and a diagnostic message is\n" +" printed.\n" +" \n" +" If the shell variable OPTERR has the value 0, getopts disables the\n" +" printing of error messages, even if the first character of\n" +" OPTSTRING is not a colon. OPTERR has the value 1 by default.\n" +" \n" +" Getopts normally parses the positional parameters ($0 - $9), but if\n" +" more arguments are given, they are parsed instead.\n" +" \n" +" Exit Status:\n" +" Returns success if an option is found; fails if the end of options is\n" +" encountered or an error occurs." +msgstr "" + +#: builtins.c:685 +msgid "" +"Replace the shell with the given command.\n" +" \n" +" Execute COMMAND, replacing this shell with the specified program.\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not " +"specified,\n" +" any redirections take effect in the current shell.\n" +" \n" +" Options:\n" +" -a name\tpass NAME as the zeroth argument to COMMAND\n" +" -c\t\texecute COMMAND with an empty environment\n" +" -l\t\tplace a dash in the zeroth argument to COMMAND\n" +" \n" +" If the command cannot be executed, a non-interactive shell exits, " +"unless\n" +" the shell option `execfail' is set.\n" +" \n" +" Exit Status:\n" +" Returns success unless COMMAND is not found or a redirection error " +"occurs." +msgstr "" + +#: builtins.c:706 +msgid "" +"Exit the shell.\n" +" \n" +" Exits the shell with a status of N. If N is omitted, the exit status\n" +" is that of the last command executed." +msgstr "" +"Scoir den bhlaosc.\n" +" \n" +" Scoireann den bhlaosc le stádas N. Má fhágtar N ar lár, is é stádas\n" +" an chéad ordaithe deireanaigh an stádas scortha." + +#: builtins.c:715 +msgid "" +"Exit a login shell.\n" +" \n" +" Exits a login shell with exit status N. Returns an error if not " +"executed\n" +" in a login shell." +msgstr "" +"Scoir de bhlaosc logála isteach.\n" +" \n" +" Scoireann de bhlaosc logála isteach le stádas scortha N. Aischuirtear\n" +" earráid má ritear é i mblaosc nach blaosc logála isteach í." + +#: builtins.c:725 +msgid "" +"Display or execute commands from the history list.\n" +" \n" +" fc is used to list or edit and re-execute commands from the history " +"list.\n" +" FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" +" string, which means the most recent command beginning with that\n" +" string.\n" +" \n" +" Options:\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then " +"EDITOR,\n" +" \t\tthen vi\n" +" -l \tlist lines instead of editing\n" +" -n\tomit line numbers when listing\n" +" -r\treverse the order of the lines (newest listed first)\n" +" \n" +" With the `fc -s [pat=rep ...] [command]' format, COMMAND is\n" +" re-executed after the substitution OLD=NEW is performed.\n" +" \n" +" A useful alias to use with this is r='fc -s', so that typing `r cc'\n" +" runs the last command beginning with `cc' and typing `r' re-executes\n" +" the last command.\n" +" \n" +" Exit Status:\n" +" Returns success or status of executed command; non-zero if an error " +"occurs." +msgstr "" +"Taispeáin nó rith orduithe ón liosta staire.\n" +" \n" +" Úsáidtear fc chun orduithe ón liosta staire a liostú, a chur in eagar, " +"nó a ath-rith.\n" +" Más uimhreacha iad CÉAD agus DEIREANACH, sonraíonn siad an raon, nó is\n" +" féidir le CÉAD bheith ina theaghrán, rud a chiallaíonn an t-ordú is " +"deireanaí a\n" +" thosaíonn leis an teaghrán sin.\n" +" \n" +" Roghanna:\n" +" -e AINM_E\troghnaigh an clár eagarthóra atá le húsáid. FCEDIT an " +"réamhshocrú,\n" +" \tansin EDITOR, agus ansin vi.\n" +" -n\tfág uimhreacha na línte ar lár agus liosta á thaispeáint\n" +" -r\taisiompaigh ord na línte (.i. liostaigh an ceann is nuaí ar dtús)\n" +" \n" +" San fhormáid \"fc -s [PATRÚN=IONADAÍ ...] [ORDÚ]\", ath-ritear ORDÚ\n" +" tar éis an t-ionadú SEAN=NUA a dhéanamh.\n" +" \n" +" Ailias úsáideach is ea r='fc -s', sa chaoi go ritheann \"r cc\" an t-" +"ordú is deireanaí\n" +" a thosaíonn le \"cc\", agus ath-ritheann \"r\" an t-ordú is deireanaí.\n" +" \n" +" Stádas Scortha:n\\ Aischuirtear rath nó stádas an ordaithe rite; " +"neamh-nialas má tharlaíonn earráid." + +#: builtins.c:755 +msgid "" +"Move job to the foreground.\n" +" \n" +" Place the job identified by JOB_SPEC in the foreground, making it the\n" +" current job. If JOB_SPEC is not present, the shell's notion of the\n" +" current job is used.\n" +" \n" +" Exit Status:\n" +" Status of command placed in foreground, or failure if an error occurs." +msgstr "" +"Bog jab go dtí an tulra.\n" +" \n" +" Cuir an jab a shonraítear le SONRÚ_JAB sa tulra agus é mar an jab " +"reatha.\n" +" Mura bhfuil SONRÚ_JAB ann, úsáidtear cibé jab atá reatha de réir na " +"blaoisce.\n" +" \n" +" Stádas Scortha:\n" +" Stádas an ordaithe curtha sa tulra, nó teip má tharlaíonn earráid." + +#: builtins.c:770 +msgid "" +"Move jobs to the background.\n" +" \n" +" Place the jobs identified by each JOB_SPEC in the background, as if " +"they\n" +" had been started with `&'. If JOB_SPEC is not present, the shell's " +"notion\n" +" of the current job is used.\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Bog jabanna go dtí an cúlra.\n" +" \n" +" Cuir an jab a shonraítear le SONRÚ_JAB sa chúlra cosúil le é a thosú le " +"\"&\".\n" +" Mura bhfuil SONRÚ_JAB ann, úsáidtear cibé jab atá reatha de réir na " +"blaoisce.\n" +" \n" +" Stádas Scortha:\n" +" Aischuirtear rath ach má tharlaíonn earráid nó mura bhfuil\n" +" rialú jabanna cumasaithe." + +#: builtins.c:784 +msgid "" +"Remember or display program locations.\n" +" \n" +" Determine and remember the full pathname of each command NAME. If\n" +" no arguments are given, information about remembered commands is " +"displayed.\n" +" \n" +" Options:\n" +" -d\t\tforget the remembered location of each NAME\n" +" -l\t\tdisplay in a format that may be reused as input\n" +" -p pathname\tuse PATHNAME as the full pathname of NAME\n" +" -r\t\tforget all remembered locations\n" +" -t\t\tprint the remembered location of each NAME, preceding\n" +" \t\teach location with the corresponding NAME if multiple\n" +" \t\tNAMEs are given\n" +" Arguments:\n" +" NAME\t\tEach NAME is searched for in $PATH and added to the list\n" +" \t\tof remembered commands.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not found or an invalid option is given." +msgstr "" + +#: builtins.c:809 +msgid "" +"Display information about builtin commands.\n" +" \n" +" Displays brief summaries of builtin commands. If PATTERN is\n" +" specified, gives detailed help on all commands matching PATTERN,\n" +" otherwise the list of help topics is printed.\n" +" \n" +" Options:\n" +" -d\toutput short description for each topic\n" +" -m\tdisplay usage in pseudo-manpage format\n" +" -s\toutput only a short usage synopsis for each topic matching\n" +" \tPATTERN\n" +" \n" +" Arguments:\n" +" PATTERN\tPattern specifiying a help topic\n" +" \n" +" Exit Status:\n" +" Returns success unless PATTERN is not found or an invalid option is " +"given." +msgstr "" +"Taispeáin eolas maidir le horduithe ionsuite.\n" +" \n" +" Taispeántar achoimrí na n-orduithe ionsuite. Má shonraítear PATRÚN,\n" +" taispeántar cabhair chuimsitheach faoi gach ordú a mheaitseálann " +"PATRÚN;\n" +" i gcásanna eile taispeántar liosta na n-ábhar cabhrach.\n" +" \n" +" Roghanna:\n" +" -d\ttaispeáin cur síos gairid ar gach ábhar\n" +" -m\ttaispeáin úsáid i bhformáid cosúil leis an lámhleabhar man(1)\n" +" -s\tná taispeáin ach achoimre gairid úsáide le haghaidh gach ábhair a\n" +" \tmheatseálann PATRÚN\n" +" \n" +" Argóintí:\n" +" PATRÚN\tpatrún a shonraíonn ábhar cabhrach\n" +" \n" +" Stádas Scortha:\n" +" Aischuirtear rath ach sa chás nach n-aimsítear PATRÚN nó go dtugtar\n" +" rogha neamhbhailí." + +#: builtins.c:833 +msgid "" +"Display or manipulate the history list.\n" +" \n" +" Display the history list with line numbers, prefixing each modified\n" +" entry with a `*'. An argument of N lists only the last N entries.\n" +" \n" +" Options:\n" +" -c\tclear the history list by deleting all of the entries\n" +" -d offset\tdelete the history entry at offset OFFSET.\n" +" \n" +" -a\tappend history lines from this session to the history file\n" +" -n\tread all history lines not already read from the history file\n" +" -r\tread the history file and append the contents to the history\n" +" \tlist\n" +" -w\twrite the current history to the history file\n" +" \tand append them to the history list\n" +" \n" +" -p\tperform history expansion on each ARG and display the result\n" +" \twithout storing it in the history list\n" +" -s\tappend the ARGs to the history list as a single entry\n" +" \n" +" If FILENAME is given, it is used as the history file. Otherwise,\n" +" if $HISTFILE has a value, that is used, else ~/.bash_history.\n" +" \n" +" If the $HISTTIMEFORMAT variable is set and not null, its value is used\n" +" as a format string for strftime(3) to print the time stamp associated\n" +" with each displayed history entry. No time stamps are printed " +"otherwise.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" + +#: builtins.c:869 +msgid "" +"Display status of jobs.\n" +" \n" +" Lists the active jobs. JOBSPEC restricts output to that job.\n" +" Without options, the status of all active jobs is displayed.\n" +" \n" +" Options:\n" +" -l\tlists process IDs in addition to the normal information\n" +" -n\tlists only processes that have changed status since the last\n" +" \tnotification\n" +" -p\tlists process IDs only\n" +" -r\trestrict output to running jobs\n" +" -s\trestrict output to stopped jobs\n" +" \n" +" If -x is supplied, COMMAND is run after all job specifications that\n" +" appear in ARGS have been replaced with the process ID of that job's\n" +" process group leader.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs.\n" +" If -x is used, returns the exit status of COMMAND." +msgstr "" + +#: builtins.c:896 +msgid "" +"Remove jobs from current shell.\n" +" \n" +" Removes each JOBSPEC argument from the table of active jobs. Without\n" +" any JOBSPECs, the shell uses its notion of the current job.\n" +" \n" +" Options:\n" +" -a\tremove all jobs if JOBSPEC is not supplied\n" +" -h\tmark each JOBSPEC so that SIGHUP is not sent to the job if the\n" +" \tshell receives a SIGHUP\n" +" -r\tremove only running jobs\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option or JOBSPEC is given." +msgstr "" +"Bain jabanna den mblaosc reatha.\n" +" \n" +" Baintear gach SONRÚ_JAB den tábla de jabanna gníomhacha. Gan\n" +" SONRÚ_JAB ar bith úsáidtear an jab atá reatha dar leis an mblaosc.\n" +" \n" +" Roghanna:\n" +" -a\tbain gach jab mura sholáraítear SONRÚ_JAB\n" +" -h\tmarcáil gach SONRÚ_JAB sa chaoi nach seolfar SIGHUP chuige má\n" +" \tfhaigheann an bhlaosc féin SIGHUP\n" +" -r\tná bain ach jabanna atá ag rith\n" +" \n" +" Stádas Scortha:\n" +" Aischuirtear rath ach sa chás go dtugtar rogha neamhbhailí\n" +" nó SONRÚ_JAB neamhbhailí." + +#: builtins.c:915 +msgid "" +"Send a signal to a job.\n" +" \n" +" Send the processes identified by PID or JOBSPEC the signal named by\n" +" SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n" +" SIGTERM is assumed.\n" +" \n" +" Options:\n" +" -s sig\tSIG is a signal name\n" +" -n sig\tSIG is a signal number\n" +" -l\tlist the signal names; if arguments follow `-l' they are\n" +" \tassumed to be signal numbers for which names should be listed\n" +" \n" +" Kill is a shell builtin for two reasons: it allows job IDs to be used\n" +" instead of process IDs, and allows processes to be killed if the limit\n" +" on processes that you can create is reached.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" + +#: builtins.c:938 +msgid "" +"Evaluate arithmetic expressions.\n" +" \n" +" Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" +" fixed-width integers with no check for overflow, though division by 0\n" +" is trapped and flagged as an error. The following list of operators is\n" +" grouped into levels of equal-precedence operators. The levels are " +"listed\n" +" in order of decreasing precedence.\n" +" \n" +" \tid++, id--\tvariable post-increment, post-decrement\n" +" \t++id, --id\tvariable pre-increment, pre-decrement\n" +" \t-, +\t\tunary minus, plus\n" +" \t!, ~\t\tlogical and bitwise negation\n" +" \t**\t\texponentiation\n" +" \t*, /, %\t\tmultiplication, division, remainder\n" +" \t+, -\t\taddition, subtraction\n" +" \t<<, >>\t\tleft and right bitwise shifts\n" +" \t<=, >=, <, >\tcomparison\n" +" \t==, !=\t\tequality, inequality\n" +" \t&\t\tbitwise AND\n" +" \t^\t\tbitwise XOR\n" +" \t|\t\tbitwise OR\n" +" \t&&\t\tlogical AND\n" +" \t||\t\tlogical OR\n" +" \texpr ? expr : expr\n" +" \t\t\tconditional operator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tassignment\n" +" \n" +" Shell variables are allowed as operands. The name of the variable\n" +" is replaced by its value (coerced to a fixed-width integer) within\n" +" an expression. The variable need not have its integer attribute\n" +" turned on to be used in an expression.\n" +" \n" +" Operators are evaluated in order of precedence. Sub-expressions in\n" +" parentheses are evaluated first and may override the precedence\n" +" rules above.\n" +" \n" +" Exit Status:\n" +" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." +msgstr "" + +#: builtins.c:983 +msgid "" +"Read a line from the standard input and split it into fields.\n" +" \n" +" Reads a single line from the standard input, or from file descriptor FD\n" +" if the -u option is supplied. The line is split into fields as with " +"word\n" +" splitting, and the first word is assigned to the first NAME, the second\n" +" word to the second NAME, and so on, with any leftover words assigned to\n" +" the last NAME. Only the characters found in $IFS are recognized as " +"word\n" +" delimiters.\n" +" \n" +" If no NAMEs are supplied, the line read is stored in the REPLY " +"variable.\n" +" \n" +" Options:\n" +" -a array\tassign the words read to sequential indices of the array\n" +" \t\tvariable ARRAY, starting at zero\n" +" -d delim\tcontinue until the first character of DELIM is read, rather\n" +" \t\tthan newline\n" +" -e\t\tuse Readline to obtain the line in an interactive shell\n" +" -i text\tUse TEXT as the initial text for Readline\n" +" -n nchars\treturn after reading NCHARS characters rather than waiting\n" +" \t\tfor a newline, but honor a delimiter if fewer than NCHARS\n" +" \t\tcharacters are read before the delimiter\n" +" -N nchars\treturn only after reading exactly NCHARS characters, " +"unless\n" +" \t\tEOF is encountered or read times out, ignoring any delimiter\n" +" -p prompt\toutput the string PROMPT without a trailing newline before\n" +" \t\tattempting to read\n" +" -r\t\tdo not allow backslashes to escape any characters\n" +" -s\t\tdo not echo input coming from a terminal\n" +" -t timeout\ttime out and return failure if a complete line of input " +"is\n" +" \t\tnot read within TIMEOUT seconds. The value of the TMOUT\n" +" \t\tvariable is the default timeout. TIMEOUT may be a\n" +" \t\tfractional number. If TIMEOUT is 0, read returns immediately,\n" +" \t\twithout trying to read any data, returning success only if\n" +" \t\tinput is available on the specified file descriptor. The\n" +" \t\texit status is greater than 128 if the timeout is exceeded\n" +" -u fd\t\tread from file descriptor FD instead of the standard input\n" +" \n" +" Exit Status:\n" +" The return code is zero, unless end-of-file is encountered, read times " +"out\n" +" (in which case it's greater than 128), a variable assignment error " +"occurs,\n" +" or an invalid file descriptor is supplied as the argument to -u." +msgstr "" + +#: builtins.c:1028 +msgid "" +"Return from a shell function.\n" +" \n" +" Causes a function or sourced script to exit with the return value\n" +" specified by N. If N is omitted, the return status is that of the\n" +" last command executed within the function or script.\n" +" \n" +" Exit Status:\n" +" Returns N, or failure if the shell is not executing a function or script." +msgstr "" +"Fill ó fheidhm bhlaoisce.\n" +" \n" +" Filltear ó fheidhm nó ó script léite as comhad leis an luach scortha\n" +" a shonraítear i N. Má fhágtar N ar lár, is é an stádas scortha ná " +"stadas\n" +" an orduithe dheireanaigh a ritheadh laistigh den fheidhm nó script.\n" +" \n" +" Stádas Scortha:\n" +" Aischuirtear N, nó teip sa chás nach bhfuil an bhlaosc ag rith feidhme " +"nó scripte." + +#: builtins.c:1041 +msgid "" +"Set or unset values of shell options and positional parameters.\n" +" \n" +" Change the value of shell attributes and positional parameters, or\n" +" display the names and values of shell variables.\n" +" \n" +" Options:\n" +" -a Mark variables which are modified or created for export.\n" +" -b Notify of job termination immediately.\n" +" -e Exit immediately if a command exits with a non-zero status.\n" +" -f Disable file name generation (globbing).\n" +" -h Remember the location of commands as they are looked up.\n" +" -k All assignment arguments are placed in the environment for a\n" +" command, not just those that precede the command name.\n" +" -m Job control is enabled.\n" +" -n Read commands but do not execute them.\n" +" -o option-name\n" +" Set the variable corresponding to option-name:\n" +" allexport same as -a\n" +" braceexpand same as -B\n" +" emacs use an emacs-style line editing interface\n" +" errexit same as -e\n" +" errtrace same as -E\n" +" functrace same as -T\n" +" hashall same as -h\n" +" histexpand same as -H\n" +" history enable command history\n" +" ignoreeof the shell will not exit upon reading EOF\n" +" interactive-comments\n" +" allow comments to appear in interactive commands\n" +" keyword same as -k\n" +" monitor same as -m\n" +" noclobber same as -C\n" +" noexec same as -n\n" +" noglob same as -f\n" +" nolog currently accepted but ignored\n" +" notify same as -b\n" +" nounset same as -u\n" +" onecmd same as -t\n" +" physical same as -P\n" +" pipefail the return value of a pipeline is the status of\n" +" the last command to exit with a non-zero status,\n" +" or zero if no command exited with a non-zero " +"status\n" +" posix change the behavior of bash where the default\n" +" operation differs from the Posix standard to\n" +" match the standard\n" +" privileged same as -p\n" +" verbose same as -v\n" +" vi use a vi-style line editing interface\n" +" xtrace same as -x\n" +" -p Turned on whenever the real and effective user ids do not match.\n" +" Disables processing of the $ENV file and importing of shell\n" +" functions. Turning this option off causes the effective uid and\n" +" gid to be set to the real uid and gid.\n" +" -t Exit after reading and executing one command.\n" +" -u Treat unset variables as an error when substituting.\n" +" -v Print shell input lines as they are read.\n" +" -x Print commands and their arguments as they are executed.\n" +" -B the shell will perform brace expansion\n" +" -C If set, disallow existing regular files to be overwritten\n" +" by redirection of output.\n" +" -E If set, the ERR trap is inherited by shell functions.\n" +" -H Enable ! style history substitution. This flag is on\n" +" by default when the shell is interactive.\n" +" -P If set, do not resolve symbolic links when executing commands\n" +" such as cd which change the current directory.\n" +" -T If set, the DEBUG trap is inherited by shell functions.\n" +" -- Assign any remaining arguments to the positional parameters.\n" +" If there are no remaining arguments, the positional parameters\n" +" are unset.\n" +" - Assign any remaining arguments to the positional parameters.\n" +" The -x and -v options are turned off.\n" +" \n" +" Using + rather than - causes these flags to be turned off. The\n" +" flags can also be used upon invocation of the shell. The current\n" +" set of flags may be found in $-. The remaining n ARGs are positional\n" +" parameters and are assigned, in order, to $1, $2, .. $n. If no\n" +" ARGs are given, all shell variables are printed.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given." +msgstr "" + +#: builtins.c:1126 +msgid "" +"Unset values and attributes of shell variables and functions.\n" +" \n" +" For each NAME, remove the corresponding variable or function.\n" +" \n" +" Options:\n" +" -f\ttreat each NAME as a shell function\n" +" -v\ttreat each NAME as a shell variable\n" +" -n\ttreat each NAME as a name reference and unset the variable itself\n" +" \trather than the variable it references\n" +" \n" +" Without options, unset first tries to unset a variable, and if that " +"fails,\n" +" tries to unset a function.\n" +" \n" +" Some variables cannot be unset; also see `readonly'.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a NAME is read-only." +msgstr "" + +#: builtins.c:1148 +msgid "" +"Set export attribute for shell variables.\n" +" \n" +" Marks each NAME for automatic export to the environment of subsequently\n" +" executed commands. If VALUE is supplied, assign VALUE before " +"exporting.\n" +" \n" +" Options:\n" +" -f\trefer to shell functions\n" +" -n\tremove the export property from each NAME\n" +" -p\tdisplay a list of all exported variables and functions\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" + +#: builtins.c:1167 +msgid "" +"Mark shell variables as unchangeable.\n" +" \n" +" Mark each NAME as read-only; the values of these NAMEs may not be\n" +" changed by subsequent assignment. If VALUE is supplied, assign VALUE\n" +" before marking as read-only.\n" +" \n" +" Options:\n" +" -a\trefer to indexed array variables\n" +" -A\trefer to associative array variables\n" +" -f\trefer to shell functions\n" +" -p\tdisplay a list of all readonly variables or functions, depending " +"on\n" +" whether or not the -f option is given\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" + +#: builtins.c:1189 +msgid "" +"Shift positional parameters.\n" +" \n" +" Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n" +" not given, it is assumed to be 1.\n" +" \n" +" Exit Status:\n" +" Returns success unless N is negative or greater than $#." +msgstr "" + +#: builtins.c:1201 builtins.c:1216 +msgid "" +"Execute commands from a file in the current shell.\n" +" \n" +" Read and execute commands from FILENAME in the current shell. The\n" +" entries in $PATH are used to find the directory containing FILENAME.\n" +" If any ARGUMENTS are supplied, they become the positional parameters\n" +" when FILENAME is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed in FILENAME; fails if\n" +" FILENAME cannot be read." +msgstr "" + +#: builtins.c:1232 +msgid "" +"Suspend shell execution.\n" +" \n" +" Suspend the execution of this shell until it receives a SIGCONT signal.\n" +" Unless forced, login shells cannot be suspended.\n" +" \n" +" Options:\n" +" -f\tforce the suspend, even if the shell is a login shell\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" + +#: builtins.c:1248 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" Exits with a status of 0 (true) or 1 (false) depending on\n" +" the evaluation of EXPR. Expressions may be unary or binary. Unary\n" +" expressions are often used to examine the status of a file. There\n" +" are string operators and numeric comparison operators as well.\n" +" \n" +" The behavior of test depends on the number of arguments. Read the\n" +" bash manual page for the complete specification.\n" +" \n" +" File operators:\n" +" \n" +" -a FILE True if file exists.\n" +" -b FILE True if file is block special.\n" +" -c FILE True if file is character special.\n" +" -d FILE True if file is a directory.\n" +" -e FILE True if file exists.\n" +" -f FILE True if file exists and is a regular file.\n" +" -g FILE True if file is set-group-id.\n" +" -h FILE True if file is a symbolic link.\n" +" -L FILE True if file is a symbolic link.\n" +" -k FILE True if file has its `sticky' bit set.\n" +" -p FILE True if file is a named pipe.\n" +" -r FILE True if file is readable by you.\n" +" -s FILE True if file exists and is not empty.\n" +" -S FILE True if file is a socket.\n" +" -t FD True if FD is opened on a terminal.\n" +" -u FILE True if the file is set-user-id.\n" +" -w FILE True if the file is writable by you.\n" +" -x FILE True if the file is executable by you.\n" +" -O FILE True if the file is effectively owned by you.\n" +" -G FILE True if the file is effectively owned by your group.\n" +" -N FILE True if the file has been modified since it was last " +"read.\n" +" \n" +" FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" +" modification date).\n" +" \n" +" FILE1 -ot FILE2 True if file1 is older than file2.\n" +" \n" +" FILE1 -ef FILE2 True if file1 is a hard link to file2.\n" +" \n" +" String operators:\n" +" \n" +" -z STRING True if string is empty.\n" +" \n" +" -n STRING\n" +" STRING True if string is not empty.\n" +" \n" +" STRING1 = STRING2\n" +" True if the strings are equal.\n" +" STRING1 != STRING2\n" +" True if the strings are not equal.\n" +" STRING1 < STRING2\n" +" True if STRING1 sorts before STRING2 " +"lexicographically.\n" +" STRING1 > STRING2\n" +" True if STRING1 sorts after STRING2 lexicographically.\n" +" \n" +" Other operators:\n" +" \n" +" -o OPTION True if the shell option OPTION is enabled.\n" +" -v VAR\t True if the shell variable VAR is set\n" +" -R VAR\t True if the shell variable VAR is set and is a name " +"reference.\n" +" ! EXPR True if expr is false.\n" +" EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n" +" EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n" +" \n" +" arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Arithmetic binary operators return true if ARG1 is equal, not-equal,\n" +" less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n" +" than ARG2.\n" +" \n" +" Exit Status:\n" +" Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n" +" false or an invalid argument is given." +msgstr "" + +#: builtins.c:1329 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" This is a synonym for the \"test\" builtin, but the last argument must\n" +" be a literal `]', to match the opening `['." +msgstr "" +"Luacháil slonn coinníollach.\n" +" \n" +" Leasainm é seo ar an ordú blaoisce ionsuite \"test\", ach\n" +" caithfear \"]\" go díreach a bheith ann mar an argóint\n" +" dheireanach, le bheith comhoiriúnach leis an \"[\" ag an tús." + +#: builtins.c:1338 +msgid "" +"Display process times.\n" +" \n" +" Prints the accumulated user and system times for the shell and all of " +"its\n" +" child processes.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Taispeáin amanna próisis.\n" +" \n" +" \n" +"Taispeántar amanna carntha úsáideora agus córais na blaoisce agus a\n" +" macphróiseas.\n" +" \n" +" Stádas Scortha:\n" +" Éiríonn leis i gcónaí." + +#: builtins.c:1350 +msgid "" +"Trap signals and other events.\n" +" \n" +" Defines and activates handlers to be run when the shell receives " +"signals\n" +" or other conditions.\n" +" \n" +" ARG is a command to be read and executed when the shell receives the\n" +" signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n" +" is supplied) or `-', each specified signal is reset to its original\n" +" value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" +" shell and by the commands it invokes.\n" +" \n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. " +"If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. " +"If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or " +"a\n" +" script run by the . or source builtins finishes executing. A " +"SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause " +"the\n" +" shell to exit when the -e option is enabled.\n" +" \n" +" If no arguments are supplied, trap prints the list of commands " +"associated\n" +" with each signal.\n" +" \n" +" Options:\n" +" -l\tprint a list of signal names and their corresponding numbers\n" +" -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" +" \n" +" Each SIGNAL_SPEC is either a signal name in or a signal " +"number.\n" +" Signal names are case insensitive and the SIG prefix is optional. A\n" +" signal may be sent to the shell with \"kill -signal $$\".\n" +" \n" +" Exit Status:\n" +" Returns success unless a SIGSPEC is invalid or an invalid option is " +"given." +msgstr "" + +#: builtins.c:1386 +msgid "" +"Display information about command type.\n" +" \n" +" For each NAME, indicate how it would be interpreted if used as a\n" +" command name.\n" +" \n" +" Options:\n" +" -a\tdisplay all locations containing an executable named NAME;\n" +" \tincludes aliases, builtins, and functions, if and only if\n" +" \tthe `-p' option is not also used\n" +" -f\tsuppress shell function lookup\n" +" -P\tforce a PATH search for each NAME, even if it is an alias,\n" +" \tbuiltin, or function, and returns the name of the disk file\n" +" \tthat would be executed\n" +" -p\treturns either the name of the disk file that would be executed,\n" +" \tor nothing if `type -t NAME' would not return `file'.\n" +" -t\toutput a single word which is one of `alias', `keyword',\n" +" \t`function', `builtin', `file' or `', if NAME is an alias, shell\n" +" \treserved word, shell function, shell builtin, disk file, or not\n" +" \tfound, respectively\n" +" \n" +" Arguments:\n" +" NAME\tCommand name to be interpreted.\n" +" \n" +" Exit Status:\n" +" Returns success if all of the NAMEs are found; fails if any are not " +"found." +msgstr "" + +#: builtins.c:1417 +msgid "" +"Modify shell resource limits.\n" +" \n" +" Provides control over the resources available to the shell and " +"processes\n" +" it creates, on systems that allow such control.\n" +" \n" +" Options:\n" +" -S\tuse the `soft' resource limit\n" +" -H\tuse the `hard' resource limit\n" +" -a\tall current limits are reported\n" +" -b\tthe socket buffer size\n" +" -c\tthe maximum size of core files created\n" +" -d\tthe maximum size of a process's data segment\n" +" -e\tthe maximum scheduling priority (`nice')\n" +" -f\tthe maximum size of files written by the shell and its children\n" +" -i\tthe maximum number of pending signals\n" +" -l\tthe maximum size a process may lock into memory\n" +" -m\tthe maximum resident set size\n" +" -n\tthe maximum number of open file descriptors\n" +" -p\tthe pipe buffer size\n" +" -q\tthe maximum number of bytes in POSIX message queues\n" +" -r\tthe maximum real-time scheduling priority\n" +" -s\tthe maximum stack size\n" +" -t\tthe maximum amount of cpu time in seconds\n" +" -u\tthe maximum number of user processes\n" +" -v\tthe size of virtual memory\n" +" -x\tthe maximum number of file locks\n" +" -T the maximum number of threads\n" +" \n" +" Not all options are available on all platforms.\n" +" \n" +" If LIMIT is given, it is the new value of the specified resource; the\n" +" special LIMIT values `soft', `hard', and `unlimited' stand for the\n" +" current soft limit, the current hard limit, and no limit, respectively.\n" +" Otherwise, the current value of the specified resource is printed. If\n" +" no option is given, then -f is assumed.\n" +" \n" +" Values are in 1024-byte increments, except for -t, which is in seconds,\n" +" -p, which is in increments of 512 bytes, and -u, which is an unscaled\n" +" number of processes.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1465 +msgid "" +"Display or set file mode mask.\n" +" \n" +" Sets the user file-creation mask to MODE. If MODE is omitted, prints\n" +" the current value of the mask.\n" +" \n" +" If MODE begins with a digit, it is interpreted as an octal number;\n" +" otherwise it is a symbolic mode string like that accepted by chmod(1).\n" +" \n" +" Options:\n" +" -p\tif MODE is omitted, output in a form that may be reused as input\n" +" -S\tmakes the output symbolic; otherwise an octal number is output\n" +" \n" +" Exit Status:\n" +" Returns success unless MODE is invalid or an invalid option is given." +msgstr "" + +#: builtins.c:1485 +msgid "" +"Wait for job completion and return exit status.\n" +" \n" +" Waits for each process identified by an ID, which may be a process ID or " +"a\n" +" job specification, and reports its termination status. If ID is not\n" +" given, waits for all currently active child processes, and the return\n" +" status is zero. If ID is a a job specification, waits for all " +"processes\n" +" in that job's pipeline.\n" +" \n" +" If the -n option is supplied, waits for the next job to terminate and\n" +" returns its exit status.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last ID; fails if ID is invalid or an invalid\n" +" option is given." +msgstr "" + +#: builtins.c:1506 +msgid "" +"Wait for process completion and return exit status.\n" +" \n" +" Waits for each process specified by a PID and reports its termination " +"status.\n" +" If PID is not given, waits for all currently active child processes,\n" +" and the return status is zero. PID must be a process ID.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last PID; fails if PID is invalid or an " +"invalid\n" +" option is given." +msgstr "" + +#: builtins.c:1521 +msgid "" +"Execute commands for each member in a list.\n" +" \n" +" The `for' loop executes a sequence of commands for each member in a\n" +" list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is\n" +" assumed. For each element in WORDS, NAME is set to that element, and\n" +" the COMMANDS are executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1535 +msgid "" +"Arithmetic for loop.\n" +" \n" +" Equivalent to\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n" +" omitted, it behaves as if it evaluates to 1.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Lúib for uimhriochtúil.\n" +" \n" +" Mar an gcéanna le\n" +" \t(( SLONN1 ))\n" +" \twhile (( SLONN2 )); do\n" +" \t\tORDAITHE\n" +" \t\t(( SLONN3 ))\n" +" \tdone\n" +" Is sloinn uimhreachtúla iad SLONN1, SLONN2 agus SLONN3.\n" +" Má fhágtar slonn ar bith ar lár, oibríonn an lúib mar a bheadh luach de " +"1 air.\n" +" \n" +" Stádas Scortha:\n" +" Aischuirtear stádas an ordaithe dheireanaigh a ritheadh." + +#: builtins.c:1553 +msgid "" +"Select words from a list and execute commands.\n" +" \n" +" The WORDS are expanded, generating a list of words. The\n" +" set of expanded words is printed on the standard error, each\n" +" preceded by a number. If `in WORDS' is not present, `in \"$@\"'\n" +" is assumed. The PS3 prompt is then displayed and a line read\n" +" from the standard input. If the line consists of the number\n" +" corresponding to one of the displayed words, then NAME is set\n" +" to that word. If the line is empty, WORDS and the prompt are\n" +" redisplayed. If EOF is read, the command completes. Any other\n" +" value read causes NAME to be set to null. The line read is saved\n" +" in the variable REPLY. COMMANDS are executed after each selection\n" +" until a break command is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1574 +msgid "" +"Report time consumed by pipeline's execution.\n" +" \n" +" Execute PIPELINE and print a summary of the real time, user CPU time,\n" +" and system CPU time spent executing PIPELINE when it terminates.\n" +" \n" +" Options:\n" +" -p\tprint the timing summary in the portable Posix format\n" +" \n" +" The value of the TIMEFORMAT variable is used as the output format.\n" +" \n" +" Exit Status:\n" +" The return status is the return status of PIPELINE." +msgstr "" + +#: builtins.c:1591 +msgid "" +"Execute commands based on pattern matching.\n" +" \n" +" Selectively execute COMMANDS based upon WORD matching PATTERN. The\n" +" `|' is used to separate multiple patterns.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1603 +msgid "" +"Execute commands based on conditional.\n" +" \n" +" The `if COMMANDS' list is executed. If its exit status is zero, then " +"the\n" +" `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list " +"is\n" +" executed in turn, and if its exit status is zero, the corresponding\n" +" `then COMMANDS' list is executed and the if command completes. " +"Otherwise,\n" +" the `else COMMANDS' list is executed, if present. The exit status of " +"the\n" +" entire construct is the exit status of the last command executed, or " +"zero\n" +" if no condition tested true.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1620 +msgid "" +"Execute commands as long as a test succeeds.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `while' COMMANDS has an exit status of zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1632 +msgid "" +"Execute commands as long as a test does not succeed.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `until' COMMANDS has an exit status which is not zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1644 +msgid "" +"Create a coprocess named NAME.\n" +" \n" +" Execute COMMAND asynchronously, with the standard output and standard\n" +" input of the command connected via a pipe to file descriptors assigned\n" +" to indices 0 and 1 of an array variable NAME in the executing shell.\n" +" The default NAME is \"COPROC\".\n" +" \n" +" Exit Status:\n" +" Returns the exit status of COMMAND." +msgstr "" + +#: builtins.c:1658 +msgid "" +"Define shell function.\n" +" \n" +" Create a shell function named NAME. When invoked as a simple command,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is " +"invoked,\n" +" the arguments are passed to the function as $1...$n, and the function's\n" +" name is in $FUNCNAME.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is readonly." +msgstr "" +"Sainigh feidhm bhlaoisce.\n" +" \n" +" Cruthaíonn feidhm bhlaoisce darbh ainm AINM. Nuair a úsáidtear mar ordú\n" +" simplí é, ritheann AINM na hORDUITHE i gcomhthéacs na blaoisce glaoigh.\n" +" Nuair a ghlaoitear AINM, tugtar na hargóintí don fheidhm mar $0 ... $n, " +"agus\n" +" tá ainm na feidhme i $FUNCNAME.\n" +" \n" +" Stádas Scortha:\n" +" Aischuirtear rath mura bhfuil AINM inléite amháin." + +#: builtins.c:1672 +msgid "" +"Group commands as a unit.\n" +" \n" +" Run a set of commands in a group. This is one way to redirect an\n" +" entire set of commands.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Grúpáil orduithe mar aonad.\n" +" \n" +" Rith tacar orduithe i ngrúpa. Seo bealach amháin chun tacar iomlán\n" +" orduithe a atreorú.\n" +" \n" +" Stádas Scortha:\n" +" Aischuirtear stádas an ordaithe dheireanaigh a ritheadh." + +#: builtins.c:1684 +msgid "" +"Resume job in foreground.\n" +" \n" +" Equivalent to the JOB_SPEC argument to the `fg' command. Resume a\n" +" stopped or background job. JOB_SPEC can specify either a job name\n" +" or a job number. Following JOB_SPEC with a `&' places the job in\n" +" the background, as if the job specification had been supplied as an\n" +" argument to `bg'.\n" +" \n" +" Exit Status:\n" +" Returns the status of the resumed job." +msgstr "" + +#: builtins.c:1699 +msgid "" +"Evaluate arithmetic expression.\n" +" \n" +" The EXPRESSION is evaluated according to the rules for arithmetic\n" +" evaluation. Equivalent to \"let EXPRESSION\".\n" +" \n" +" Exit Status:\n" +" Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise." +msgstr "" + +#: builtins.c:1711 +msgid "" +"Execute conditional command.\n" +" \n" +" Returns a status of 0 or 1 depending on the evaluation of the " +"conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries " +"used\n" +" by the `test' builtin, and may be combined using the following " +"operators:\n" +" \n" +" ( EXPRESSION )\tReturns the value of EXPRESSION\n" +" ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" +" EXPR1 && EXPR2\tTrue if both EXPR1 and EXPR2 are true; else false\n" +" EXPR1 || EXPR2\tTrue if either EXPR1 or EXPR2 is true; else false\n" +" \n" +" When the `==' and `!=' operators are used, the string to the right of\n" +" the operator is used as a pattern and pattern matching is performed.\n" +" When the `=~' operator is used, the string to the right of the operator\n" +" is matched as a regular expression.\n" +" \n" +" The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n" +" determine the expression's value.\n" +" \n" +" Exit Status:\n" +" 0 or 1 depending on value of EXPRESSION." +msgstr "" + +#: builtins.c:1737 +msgid "" +"Common shell variable names and usage.\n" +" \n" +" BASH_VERSION\tVersion information for this Bash.\n" +" CDPATH\tA colon-separated list of directories to search\n" +" \t\tfor directories given as arguments to `cd'.\n" +" GLOBIGNORE\tA colon-separated list of patterns describing filenames to\n" +" \t\tbe ignored by pathname expansion.\n" +" HISTFILE\tThe name of the file where your command history is stored.\n" +" HISTFILESIZE\tThe maximum number of lines this file can contain.\n" +" HISTSIZE\tThe maximum number of history lines that a running\n" +" \t\tshell can access.\n" +" HOME\tThe complete pathname to your login directory.\n" +" HOSTNAME\tThe name of the current host.\n" +" HOSTTYPE\tThe type of CPU this version of Bash is running under.\n" +" IGNOREEOF\tControls the action of the shell on receipt of an EOF\n" +" \t\tcharacter as the sole input. If set, then the value\n" +" \t\tof it is the number of EOF characters that can be seen\n" +" \t\tin a row on an empty line before the shell will exit\n" +" \t\t(default 10). When unset, EOF signifies the end of input.\n" +" MACHTYPE\tA string describing the current system Bash is running on.\n" +" MAILCHECK\tHow often, in seconds, Bash checks for new mail.\n" +" MAILPATH\tA colon-separated list of filenames which Bash checks\n" +" \t\tfor new mail.\n" +" OSTYPE\tThe version of Unix this version of Bash is running on.\n" +" PATH\tA colon-separated list of directories to search when\n" +" \t\tlooking for commands.\n" +" PROMPT_COMMAND\tA command to be executed before the printing of each\n" +" \t\tprimary prompt.\n" +" PS1\t\tThe primary prompt string.\n" +" PS2\t\tThe secondary prompt string.\n" +" PWD\t\tThe full pathname of the current directory.\n" +" SHELLOPTS\tA colon-separated list of enabled shell options.\n" +" TERM\tThe name of the current terminal type.\n" +" TIMEFORMAT\tThe output format for timing statistics displayed by the\n" +" \t\t`time' reserved word.\n" +" auto_resume\tNon-null means a command word appearing on a line by\n" +" \t\titself is first looked for in the list of currently\n" +" \t\tstopped jobs. If found there, that job is foregrounded.\n" +" \t\tA value of `exact' means that the command word must\n" +" \t\texactly match a command in the list of stopped jobs. A\n" +" \t\tvalue of `substring' means that the command word must\n" +" \t\tmatch a substring of the job. Any other value means that\n" +" \t\tthe command must be a prefix of a stopped job.\n" +" histchars\tCharacters controlling history expansion and quick\n" +" \t\tsubstitution. The first character is the history\n" +" \t\tsubstitution character, usually `!'. The second is\n" +" \t\tthe `quick substitution' character, usually `^'. The\n" +" \t\tthird is the `history comment' character, usually `#'.\n" +" HISTIGNORE\tA colon-separated list of patterns used to decide which\n" +" \t\tcommands should be saved on the history list.\n" +msgstr "" + +#: builtins.c:1794 +msgid "" +"Add directories to stack.\n" +" \n" +" Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" + +#: builtins.c:1828 +msgid "" +"Remove directories from stack.\n" +" \n" +" Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" + +#: builtins.c:1858 +msgid "" +"Display directory stack.\n" +" \n" +" Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1887 +msgid "" +"Set and unset shell options.\n" +" \n" +" Change the setting of each shell option OPTNAME. Without any option\n" +" arguments, list all shell options with an indication of whether or not " +"each\n" +" is set.\n" +" \n" +" Options:\n" +" -o\trestrict OPTNAMEs to those defined for use with `set -o'\n" +" -p\tprint each shell option with an indication of its status\n" +" -q\tsuppress output\n" +" -s\tenable (set) each OPTNAME\n" +" -u\tdisable (unset) each OPTNAME\n" +" \n" +" Exit Status:\n" +" Returns success if OPTNAME is enabled; fails if an invalid option is\n" +" given or OPTNAME is disabled." +msgstr "" + +#: builtins.c:1908 +msgid "" +"Formats and prints ARGUMENTS under control of the FORMAT.\n" +" \n" +" Options:\n" +" -v var\tassign the output to shell variable VAR rather than\n" +" \t\tdisplay it on the standard output\n" +" \n" +" FORMAT is a character string which contains three types of objects: " +"plain\n" +" characters, which are simply copied to standard output; character " +"escape\n" +" sequences, which are converted and copied to the standard output; and\n" +" format specifications, each of which causes printing of the next " +"successive\n" +" argument.\n" +" \n" +" In addition to the standard format specifications described in " +"printf(1),\n" +" printf interprets:\n" +" \n" +" %b\texpand backslash escape sequences in the corresponding argument\n" +" %q\tquote the argument in a way that can be reused as shell input\n" +" %(fmt)T output the date-time string resulting from using FMT as a " +"format\n" +" string for strftime(3)\n" +" \n" +" The format is re-used as necessary to consume all of the arguments. If\n" +" there are fewer arguments than the format requires, extra format\n" +" specifications behave as if a zero value or null string, as " +"appropriate,\n" +" had been supplied.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a write or " +"assignment\n" +" error occurs." +msgstr "" + +#: builtins.c:1942 +msgid "" +"Specify how arguments are to be completed by Readline.\n" +" \n" +" For each NAME, specify how arguments are to be completed. If no " +"options\n" +" are supplied, existing completion specifications are printed in a way " +"that\n" +" allows them to be reused as input.\n" +" \n" +" Options:\n" +" -p\tprint existing completion specifications in a reusable format\n" +" -r\tremove a completion specification for each NAME, or, if no\n" +" \tNAMEs are supplied, all completion specifications\n" +" -D\tapply the completions and actions as the default for commands\n" +" \twithout any specific completion defined\n" +" -E\tapply the completions and actions to \"empty\" commands --\n" +" \tcompletion attempted on a blank line\n" +" \n" +" When completion is attempted, the actions are applied in the order the\n" +" uppercase-letter options are listed above. The -D option takes\n" +" precedence over -E.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1970 +msgid "" +"Display possible completions depending on the options.\n" +" \n" +" Intended to be used from within a shell function generating possible\n" +" completions. If the optional WORD argument is supplied, matches " +"against\n" +" WORD are generated.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Taispeáin na hiomlánaithe atá ar fáil de réir na roghanna.\n" +" \n" +" Tá sé seo ceaptha le húsáid i bhfeidmeanna blaoisce a chruthaíonn " +"iomlánaithe.\n" +" Má thugtar an argóint roghnach FOCAL, cruthaítear iomlánaithe\n" +" atá comhoiriúnach le FOCAL.\n" +" \n" +" Stádas Scortha:\n" +" Aischuirtear rath mura thugtar rogha neamhbhailí agus mura tharlaíonn " +"earráid." + +#: builtins.c:1985 +msgid "" +"Modify or display completion options.\n" +" \n" +" Modify the completion options for each NAME, or, if no NAMEs are " +"supplied,\n" +" the completion currently being executed. If no OPTIONs are given, " +"print\n" +" the completion options for each NAME or the current completion " +"specification.\n" +" \n" +" Options:\n" +" \t-o option\tSet completion option OPTION for each NAME\n" +" \t-D\t\tChange options for the \"default\" command completion\n" +" \t-E\t\tChange options for the \"empty\" command completion\n" +" \n" +" Using `+o' instead of `-o' turns off the specified option.\n" +" \n" +" Arguments:\n" +" \n" +" Each NAME refers to a command for which a completion specification must\n" +" have previously been defined using the `complete' builtin. If no NAMEs\n" +" are supplied, compopt must be called by a function currently generating\n" +" completions, and the options for that currently-executing completion\n" +" generator are modified.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or NAME does not\n" +" have a completion specification defined." +msgstr "" + +#: builtins.c:2015 +msgid "" +"Read lines from the standard input into an indexed array variable.\n" +" \n" +" Read lines from the standard input into the indexed array variable " +"ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable " +"MAPFILE\n" +" is the default ARRAY.\n" +" \n" +" Options:\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are " +"copied.\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default " +"index is 0.\n" +" -s count \tDiscard the first COUNT lines read.\n" +" -t\t\tRemove a trailing newline from each line read.\n" +" -u fd\t\tRead lines from file descriptor FD instead of the standard " +"input.\n" +" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read.\n" +" -c quantum\tSpecify the number of lines read between each call to " +"CALLBACK.\n" +" \n" +" Arguments:\n" +" ARRAY\t\tArray variable name to use for file data.\n" +" \n" +" If -C is supplied without -c, the default quantum is 5000. When\n" +" CALLBACK is evaluated, it is supplied the index of the next array\n" +" element to be assigned and the line to be assigned to that element\n" +" as additional arguments.\n" +" \n" +" If not supplied with an explicit origin, mapfile will clear ARRAY " +"before\n" +" assigning to it.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or ARRAY is readonly " +"or\n" +" not an indexed array." +msgstr "" + +#: builtins.c:2049 +msgid "" +"Read lines from a file into an array variable.\n" +" \n" +" A synonym for `mapfile'." +msgstr "" +"Léigh línte ó chomhad agus cuir in athróg eagair iad.\n" +" \n" +" Comhchiallach le \"mapfile\"." + +#, fuzzy +#~ msgid "Copyright (C) 2009 Free Software Foundation, Inc.\n" +#~ msgstr "Cóipcheart © 2009 Free Software Foundation, Inc." + +#, fuzzy +#~ msgid "" +#~ "License GPLv2+: GNU GPL version 2 or later \n" +#~ msgstr "" +#~ "Ceadúnas GPLv3+: GNU GPL leagan 3 nó níos déanaí \n" + +#~ msgid "wait [pid]" +#~ msgstr "wait [aitheantas_próisis]" + +#~ msgid "xrealloc: cannot reallocate %lu bytes (%lu bytes allocated)" +#~ msgstr "" +#~ "xrealloc: ní féidir %lu beart a athleithdháileadh (%lu beart leithdháilte)" + +#~ msgid "xrealloc: cannot allocate %lu bytes" +#~ msgstr "xrealloc: ní féidir %lu beart a leithdháileadh" + +#~ msgid "xrealloc: %s:%d: cannot reallocate %lu bytes (%lu bytes allocated)" +#~ msgstr "" +#~ "xrealloc: %s:%d: ní féidir %lu beart a athleithdháileadh (%lu beart " +#~ "leithdháilte)" diff --git a/po/gl.gmo b/po/gl.gmo new file mode 100644 index 0000000000000000000000000000000000000000..a0e98882faf4ead4c298fb45dfc570a69dcafb44 GIT binary patch literal 63233 zcmch=2Y_8ib^m`c#jISw#-P*5<&>wG5iur+Ao0+68@j>IWza(S5}h2zyI1--*@kw znLBgl%sFSywC|mKpVuV({p4Or@%ddN_kly;=fIP|uY!92qk#Vv@PT|> z-(3uz2Cf0gVsa&zg43YB`$F(R;LE{>fNujI0e&1@0e%Zy3*P@M&;JH+4fj=0-+f!a zkAV~|`8v1|{BKa@c+@hd&uUQl*aof!>tG7L1$+!R7x14zefOkc#}QEFz9!)F!R6e) z5fr_?1S%gt1s@6?!%OA=5um>J1W@JM1u9?FaQ_nUf!x0tRJdC~edn)0egCd-e=0Y6 zeikTtj(~hB*%_Wc3sn8T7F2p41Rn-|F5LeBR6YJHDEgkX((}0#Je~V>pyHQ7sxEmZ z_;B!MQ04j@sPBFkRQ!JdRi68=@_auMOu1hJD!tvH!e1YrzZ_ILw}K~tp9e*sZ-UC# zzkv#W^4ZQGi$L9<11jF7puW2oRJjg-qVp?2<@4R3()}zbI(`GR@`9?@lc;PxKNl1o zFArD)Pvrhtpu)WZLFKm%o(H}d zJOlhJcrWlD!~36tCvktwIiB7r;HCG5hTsEuUOm_G5UB6H5ZpupuL1SF?~u5{{S-VN z{BKaU;NDPhEkhfNuhi-H;@|1m6MPn{?i^5gz0IEt@>tt1n5C4$q%|DRl<^ z&t~HAzVio3avgX*_)YNF;0wU7ZE?AD)n#7474YFae_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yKb+bTctj} zYWeU}?{JyT-LhY9(0J&bu^8hbC`2S+@Ds7JCM?cLN^EngP1FO1$wuL>Xe-M*0n>$r zO1OPgUK8p#|)Nu0$zSJ9_~xY v`6Hc;Cyr`XXNxCZP!%d%)Ir75^k(5X_MpY8btR&oIysNS@{Id5M3ek~OI#(a literal 0 HcmV?d00001 diff --git a/po/gl.po b/po/gl.po new file mode 100644 index 0000000..2b9e530 --- /dev/null +++ b/po/gl.po @@ -0,0 +1,4488 @@ +# Galician translation for bash package. +# Copyright (C) 2011 Free Software Foundation, Inc. +# This file is distributed under the same license as the bash package. +# +# Leandro Regueiro , 2011. +# Francisco Diéguez , 2012. +# Fran Dieguez , 2012. +# +# Proxecto Trasno - Adaptación do software libre á lingua galega: Se desexas +# colaborar connosco, podes atopar máis información en +# +msgid "" +msgstr "" +"Project-Id-Version: bash 4.2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-02-11 11:19-0500\n" +"PO-Revision-Date: 2012-02-23 14:38+0100\n" +"Last-Translator: Leandro Regueiro \n" +"Language-Team: Galician \n" +"Language: gl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n" + +#: arrayfunc.c:51 +msgid "bad array subscript" +msgstr "subíndice de matriz incorrecto" + +#: arrayfunc.c:356 builtins/declare.def:566 +#, c-format +msgid "%s: cannot convert indexed to associative array" +msgstr "%s: non é posíbel converter a matriz de indizada a asociativa" + +#: arrayfunc.c:539 +#, c-format +msgid "%s: invalid associative array key" +msgstr "%s: índice de matriz asociativa non válido" + +#: arrayfunc.c:541 +#, c-format +msgid "%s: cannot assign to non-numeric index" +msgstr "%s: non é posíbel asignar a un índice que non é numérico" + +#: arrayfunc.c:586 +#, c-format +msgid "%s: %s: must use subscript when assigning associative array" +msgstr "%s: %s: se debe usar un subíndice ao asignar a unha matriz asociativa" + +#: bashhist.c:388 +#, c-format +msgid "%s: cannot create: %s" +msgstr "%s: non foi posíbel crear: %s" + +#: bashline.c:3982 +msgid "bash_execute_unix_command: cannot find keymap for command" +msgstr "" +"bash_execute_unix_command: non foi posíbel atopar a combinación de teclas " +"para a orde" + +#: bashline.c:4069 +#, c-format +msgid "%s: first non-whitespace character is not `\"'" +msgstr "%s: o primeiro carácter que non é espazo en branco non é `\"'" + +#: bashline.c:4098 +#, c-format +msgid "no closing `%c' in %s" +msgstr "no hai un `%c' que peche en %s" + +#: bashline.c:4132 +#, c-format +msgid "%s: missing colon separator" +msgstr "%s: falta un `:' separador" + +#: braces.c:321 +#, c-format +msgid "brace expansion: cannot allocate memory for %s" +msgstr "" + +#: braces.c:413 +#, c-format +msgid "brace expansion: failed to allocate memory for %d elements" +msgstr "" + +#: braces.c:452 +#, c-format +msgid "brace expansion: failed to allocate memory for `%s'" +msgstr "" + +#: builtins/alias.def:132 +#, c-format +msgid "`%s': invalid alias name" +msgstr "`%s': nome de alias non válido" + +#: builtins/bind.def:123 builtins/bind.def:126 +msgid "line editing not enabled" +msgstr "no se activó a edición de liña" + +#: builtins/bind.def:212 +#, c-format +msgid "`%s': invalid keymap name" +msgstr "`%s': nome de combinación de teclas non válido" + +#: builtins/bind.def:251 +#, c-format +msgid "%s: cannot read: %s" +msgstr "%s: non se pode leer: %s" + +#: builtins/bind.def:266 +#, c-format +msgid "`%s': cannot unbind" +msgstr "%s: non se pode borrar a asignación" + +#: builtins/bind.def:304 builtins/bind.def:334 +#, c-format +msgid "`%s': unknown function name" +msgstr "`%s': nome de función descoñecido" + +#: builtins/bind.def:312 +#, c-format +msgid "%s is not bound to any keys.\n" +msgstr "%s non está asignado a ningunha tecla.\n" + +#: builtins/bind.def:316 +#, c-format +msgid "%s can be invoked via " +msgstr "%s pódese invocar a través de " + +#: builtins/break.def:77 builtins/break.def:117 +msgid "loop count" +msgstr "contía de ciclo" + +#: builtins/break.def:137 +msgid "only meaningful in a `for', `while', or `until' loop" +msgstr "só ten significado nun ciclo `for', `while' ou `until'" + +#: builtins/caller.def:134 +msgid "" +"Returns the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns " +msgstr "" +"Devolve o contexto da chamada a subrutina actual.\n" +" \n" +" Sen EXPR, devovle " + +#: builtins/cd.def:319 +msgid "HOME not set" +msgstr "HOME non está definido" + +#: builtins/cd.def:327 builtins/common.c:166 test.c:876 +msgid "too many arguments" +msgstr "demasiados argumentos" + +#: builtins/cd.def:338 +msgid "OLDPWD not set" +msgstr "OLDPWD non está definido" + +#: builtins/common.c:101 +#, c-format +msgid "line %d: " +msgstr "liña %d: " + +#: builtins/common.c:139 error.c:265 +#, c-format +msgid "warning: " +msgstr "aviso: " + +#: builtins/common.c:153 +#, c-format +msgid "%s: usage: " +msgstr "%s: uso: " + +#: builtins/common.c:191 shell.c:506 shell.c:788 +#, c-format +msgid "%s: option requires an argument" +msgstr "%s: a opción require un argumento" + +#: builtins/common.c:198 +#, c-format +msgid "%s: numeric argument required" +msgstr "%s: requírese un argumento numérico" + +#: builtins/common.c:205 +#, c-format +msgid "%s: not found" +msgstr "%s: non se atopou" + +#: builtins/common.c:214 shell.c:801 +#, c-format +msgid "%s: invalid option" +msgstr "%s: opción non válida" + +#: builtins/common.c:221 +#, c-format +msgid "%s: invalid option name" +msgstr "%s: nome de opción non válido" + +#: builtins/common.c:228 general.c:235 general.c:240 +#, c-format +msgid "`%s': not a valid identifier" +msgstr "`%s': non é un identificador válido" + +#: builtins/common.c:238 +msgid "invalid octal number" +msgstr "número octal non válido" + +#: builtins/common.c:240 +msgid "invalid hex number" +msgstr "número hexadecimal non válido" + +#: builtins/common.c:242 expr.c:1470 +msgid "invalid number" +msgstr "número non válido" + +#: builtins/common.c:250 +#, c-format +msgid "%s: invalid signal specification" +msgstr "%s: especificación de sinal non válida" + +#: builtins/common.c:257 +#, c-format +msgid "`%s': not a pid or valid job spec" +msgstr "`%s': no é un pid ou unha especificación válida de traballo" + +#: builtins/common.c:264 error.c:488 +#, c-format +msgid "%s: readonly variable" +msgstr "%s: variábel de só lectura" + +#: builtins/common.c:272 +#, c-format +msgid "%s: %s out of range" +msgstr "%s: %s fóra de rango" + +#: builtins/common.c:272 builtins/common.c:274 +msgid "argument" +msgstr "argumento" + +#: builtins/common.c:274 +#, c-format +msgid "%s out of range" +msgstr "%s fóra de rango" + +#: builtins/common.c:282 +#, c-format +msgid "%s: no such job" +msgstr "%s: non existe ese traballo" + +#: builtins/common.c:290 +#, c-format +msgid "%s: no job control" +msgstr "%s: no hai control de traballos" + +#: builtins/common.c:292 +msgid "no job control" +msgstr "no ha control de traballos" + +#: builtins/common.c:302 +#, c-format +msgid "%s: restricted" +msgstr "%s: restrinxido" + +#: builtins/common.c:304 +msgid "restricted" +msgstr "restrinxido" + +#: builtins/common.c:312 +#, c-format +msgid "%s: not a shell builtin" +msgstr "%s: no é una orde interna do shell" + +#: builtins/common.c:321 +#, c-format +msgid "write error: %s" +msgstr "erro de escritura: %s" + +#: builtins/common.c:329 +#, c-format +msgid "error setting terminal attributes: %s" +msgstr "erro ao estabelecer os atributos da terminal: %s" + +#: builtins/common.c:331 +#, c-format +msgid "error getting terminal attributes: %s" +msgstr "erro ao obtener os atributos da terminal: %s" + +#: builtins/common.c:563 +#, c-format +msgid "%s: error retrieving current directory: %s: %s\n" +msgstr "%s: erro ao obtener o directorio actual: %s: %s\n" + +#: builtins/common.c:629 builtins/common.c:631 +#, c-format +msgid "%s: ambiguous job spec" +msgstr "%s: especificación de traballo ambigüa" + +#: builtins/complete.def:277 +#, c-format +msgid "%s: invalid action name" +msgstr "%s: nome de acción non válido" + +#: builtins/complete.def:450 builtins/complete.def:645 +#: builtins/complete.def:855 +#, c-format +msgid "%s: no completion specification" +msgstr "%s: non hai completado de especificación" + +#: builtins/complete.def:697 +msgid "warning: -F option may not work as you expect" +msgstr "aviso: é posíbel que a opción -F non funcione como se espera" + +#: builtins/complete.def:699 +msgid "warning: -C option may not work as you expect" +msgstr "aviso: é posíbel que a opción -C non funcione como se espera" + +#: builtins/complete.def:828 +msgid "not currently executing completion function" +msgstr "non se está executando a función de completado" + +#: builtins/declare.def:126 +msgid "can only be used in a function" +msgstr "só se pode usar dentro dunha función" + +#: builtins/declare.def:315 builtins/declare.def:509 +#, c-format +msgid "%s: reference variable cannot be an array" +msgstr "" + +#: builtins/declare.def:324 +#, c-format +msgid "%s: nameref variable self references not allowed" +msgstr "" + +#: builtins/declare.def:398 +msgid "cannot use `-f' to make functions" +msgstr "non se pode use `-f' para facer funcións" + +#: builtins/declare.def:410 execute_cmd.c:5361 +#, c-format +msgid "%s: readonly function" +msgstr "%s: función de só lectura" + +#: builtins/declare.def:553 +#, c-format +msgid "%s: cannot destroy array variables in this way" +msgstr "%s: non é posíbel destruír variábeis de matriz desta forma" + +#: builtins/declare.def:560 builtins/read.def:733 +#, c-format +msgid "%s: cannot convert associative to indexed array" +msgstr "%s: non é posíbel converter unha matriz asociativa a indizada" + +#: builtins/enable.def:137 builtins/enable.def:145 +msgid "dynamic loading not available" +msgstr "a carga dinámica non está dispoñíbel" + +#: builtins/enable.def:312 +#, c-format +msgid "cannot open shared object %s: %s" +msgstr "non é posíbel abrir o obxecto compartido %s: %s" + +#: builtins/enable.def:335 +#, c-format +msgid "cannot find %s in shared object %s: %s" +msgstr "non é posíbel atopar %s no obxecto compartido %s: %s" + +#: builtins/enable.def:459 +#, c-format +msgid "%s: not dynamically loaded" +msgstr "%s: non foi cargado dinamicamente" + +#: builtins/enable.def:474 +#, c-format +msgid "%s: cannot delete: %s" +msgstr "%s: non foi posíbel eliminar: %s" + +#: builtins/evalfile.c:140 builtins/hash.def:171 execute_cmd.c:5208 +#: shell.c:1481 +#, c-format +msgid "%s: is a directory" +msgstr "%s: é un directorio" + +#: builtins/evalfile.c:146 +#, c-format +msgid "%s: not a regular file" +msgstr "%s: non é un ficheiro regular" + +#: builtins/evalfile.c:155 +#, c-format +msgid "%s: file is too large" +msgstr "%s: o ficheiro é demasiado grande" + +#: builtins/evalfile.c:190 builtins/evalfile.c:208 shell.c:1491 +#, c-format +msgid "%s: cannot execute binary file" +msgstr "%s: non é posíbel executar o ficheiro binario" + +#: builtins/exec.def:154 builtins/exec.def:156 builtins/exec.def:228 +#, c-format +msgid "%s: cannot execute: %s" +msgstr "%s: non foi posíbel executar: %s" + +#: builtins/exit.def:65 +#, c-format +msgid "logout\n" +msgstr "logout\n" + +#: builtins/exit.def:88 +msgid "not login shell: use `exit'" +msgstr "non é un shell de entrada: use `exit'" + +#: builtins/exit.def:120 +#, c-format +msgid "There are stopped jobs.\n" +msgstr "Hai traballos pendentes.\n" + +#: builtins/exit.def:122 +#, c-format +msgid "There are running jobs.\n" +msgstr "Hay traballos en execución.\n" + +#: builtins/fc.def:262 +msgid "no command found" +msgstr "non foi posíbel atopar a orde" + +#: builtins/fc.def:320 builtins/fc.def:369 +msgid "history specification" +msgstr "especificación de historial" + +#: builtins/fc.def:390 +#, c-format +msgid "%s: cannot open temp file: %s" +msgstr "%s: non é posíbel abrir o ficheiro temporal: %s" + +#: builtins/fg_bg.def:149 builtins/jobs.def:282 +msgid "current" +msgstr "actual" + +#: builtins/fg_bg.def:158 +#, c-format +msgid "job %d started without job control" +msgstr "o traballo %d iniciou sen control de traballo" + +#: builtins/getopt.c:110 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: opción ilegal -- %c\n" + +#: builtins/getopt.c:111 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: a opción require un argumento -- %c\n" + +#: builtins/hash.def:92 +msgid "hashing disabled" +msgstr "asociación desactivada" + +#: builtins/hash.def:138 +#, c-format +msgid "%s: hash table empty\n" +msgstr "%s: táboa de asociación baleira\n" + +#: builtins/hash.def:245 +#, c-format +msgid "hits\tcommand\n" +msgstr "coinc\torde\n" + +#: builtins/help.def:130 +#, c-format +msgid "Shell commands matching keyword `" +msgid_plural "Shell commands matching keywords `" +msgstr[0] "Orde do shell que coincide coa palabra `" +msgstr[1] "Orde do shell que coincide coas palabras `" + +#: builtins/help.def:182 +#, c-format +msgid "" +"no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." +msgstr "" +"non hai temas de axuda que coincidan con «%s». Probe «help help» ou «man -k " +"%s» ou «info %s»" + +#: builtins/help.def:199 +#, c-format +msgid "%s: cannot open: %s" +msgstr "%s: non foi posíbel abrir: %s" + +#: builtins/help.def:485 +#, c-format +msgid "" +"These shell commands are defined internally. Type `help' to see this list.\n" +"Type `help name' to find out more about the function `name'.\n" +"Use `info bash' to find out more about the shell in general.\n" +"Use `man -k' or `info' to find out more about commands not in this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" +msgstr "" +"Estas ordes do shell están definidas internamente. Teclee `help' para\n" +"ver esta lista.\n" +"Teclee `help nome' para saber máis sobre a función `nome'.\n" +"Use `info bash' para saber máis sobre o shell en xeral.\n" +"Use `man -k' o `info' para saber máis sobre as órdenes que non están nesta " +"lista.\n" +"\n" +"Un asterisco (*) xunto a un nome significa que a orde está desactivada.\n" +"\n" + +#: builtins/history.def:154 +msgid "cannot use more than one of -anrw" +msgstr "non foi posíbel usar máis dun de -anrw" + +#: builtins/history.def:186 +msgid "history position" +msgstr "posición no historial" + +#: builtins/history.def:366 +#, c-format +msgid "%s: history expansion failed" +msgstr "%s: fallou a expansión do historial" + +#: builtins/inlib.def:71 +#, c-format +msgid "%s: inlib failed" +msgstr "%s: fallou inlib" + +#: builtins/jobs.def:109 +msgid "no other options allowed with `-x'" +msgstr "non se permiten outras opcións con «-x»" + +#: builtins/kill.def:200 +#, c-format +msgid "%s: arguments must be process or job IDs" +msgstr "%s: os argumentos deben ser procesos ou IDs de traballos" + +#: builtins/kill.def:263 +msgid "Unknown error" +msgstr "Erro descoñecido" + +#: builtins/let.def:95 builtins/let.def:120 expr.c:583 expr.c:598 +msgid "expression expected" +msgstr "agardábase unha expresión" + +#: builtins/mapfile.def:172 +#, c-format +msgid "%s: not an indexed array" +msgstr "%s: non é unha matriz indizada" + +#: builtins/mapfile.def:259 builtins/read.def:302 +#, c-format +msgid "%s: invalid file descriptor specification" +msgstr "%s: especificación de descritor de ficheiro non válida" + +#: builtins/mapfile.def:267 builtins/read.def:309 +#, c-format +msgid "%d: invalid file descriptor: %s" +msgstr "%d: descritor de ficheiro non válido: %s" + +#: builtins/mapfile.def:276 builtins/mapfile.def:314 +#, c-format +msgid "%s: invalid line count" +msgstr "%s: conta de liñas non válida" + +#: builtins/mapfile.def:287 +#, c-format +msgid "%s: invalid array origin" +msgstr "%s: orixe de matriz non válido" + +#: builtins/mapfile.def:304 +#, c-format +msgid "%s: invalid callback quantum" +msgstr "%s: quantum de chamada non válido" + +#: builtins/mapfile.def:336 +msgid "empty array variable name" +msgstr "nome de variábel de matriz baleiro" + +#: builtins/mapfile.def:357 +msgid "array variable support required" +msgstr "requírese a compatibilidade de variábel de matriz" + +#: builtins/printf.def:402 +#, c-format +msgid "`%s': missing format character" +msgstr "`%s': falta o carácter de formato" + +#: builtins/printf.def:456 +#, c-format +msgid "`%c': invalid time format specification" +msgstr "`%c': especificación de formato de tempo non válida" + +#: builtins/printf.def:658 +#, c-format +msgid "`%c': invalid format character" +msgstr "`%c': carácter de formato non válido" + +#: builtins/printf.def:684 +#, c-format +msgid "warning: %s: %s" +msgstr "aviso: %s: %s" + +#: builtins/printf.def:768 +#, c-format +msgid "format parsing problem: %s" +msgstr "" + +#: builtins/printf.def:865 +msgid "missing hex digit for \\x" +msgstr "falta o díxito hexadecimal para \\x" + +#: builtins/printf.def:880 +#, c-format +msgid "missing unicode digit for \\%c" +msgstr "falta o díxito unicode para \\%c" + +#: builtins/pushd.def:195 +msgid "no other directory" +msgstr "non hai outro directorio" + +#: builtins/pushd.def:354 +#, fuzzy, c-format +msgid "%s: invalid argument" +msgstr "%s: límite de argumento non válido" + +#: builtins/pushd.def:468 +msgid "" +msgstr "" + +#: builtins/pushd.def:512 +msgid "directory stack empty" +msgstr "a pila de directorios está baleira" + +#: builtins/pushd.def:514 +msgid "directory stack index" +msgstr "índice da pila de directorios" + +#: builtins/pushd.def:689 +msgid "" +"Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +"\tdirs when invoked without options, starting with zero." +msgstr "" +"Mostra a lista de directorios actualmente gravados. Os directorios\n" +" gárdanse na lista coa orde `pushd'; pode ir saíndo da\n" +" lista coa orde `popd'.\n" +" \n" +" Opcións:\n" +" -c\tlimpa a pila de directorios, eliminando todos os elementos\n" +" -l\tnon mostra as versións con prefixo de til dos directorios\n" +" \trelativos ao seu directorio inicial\n" +" -p\tmostra a pila de directorios cunha entrada por liña\n" +" -v\tmuestra a pila de directorios cunha entrada por liña coa\n" +" \tsúa posición na pila como prefixo\n" +" \n" +" Argumentos:\n" +" +N\tMostra a N-ésima entrada contando desde a esquerda da\n" +" \tlista mostrada por dirs cando se chama sen opcións,\n" +" \tcomezando desde cero.\n" +" \n" +" -N\tMostra a N-ésima entrada contando desde a dereita da\n" +"\tlista mostrada por dirs cando se chama sen opcións,\n" +"\tcomezando desde cero." + +#: builtins/pushd.def:711 +msgid "" +"Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Engade un directorio ao tope da rima de directorios, ou rota\n" +" a pila, facendo que o novo tope da rima sexa o\n" +" directorio de trabajo actual. Sen argumentos, intercambia\n" +" os dous directorios do tope.\n" +" \n" +" Argumentos:\n" +" +N\tRota a pila para que o N-ésimo directorio (contando\n" +" \tda izquierda da lista mostrada por `dirs',\n" +" \tcomezando desde cero) estea no tope.\n" +" -N\tRota a pila para que o N-ésimo directorio (contando\n" +" \tda derecha da lista mostrada por `dirs',\n" +" \tcomezando desde cero) estea no tope.\n" +" \n" +" dir\tagrega DIR á rima de directorios no tope,\n" +" \tfacéndoo o novo directorio de traballo actual.\n" +" \n" +" A orde interna `dirs' mostra a rima de directorios." + +#: builtins/pushd.def:736 +msgid "" +"Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" +"Borra entradas da pila de directorios. Sen argumentos, borra\n" +" directorio do tope da pila, e cambia ao novo directorio tope.\n" +" \n" +" Opcións:\n" +" -n\tsuprime o cambio normal de directorio cando se borra\n" +" \tdirectorios da pila, así só se manipula a pila.\n" +" \n" +" Argumentos:\n" +" +N\tBorra a N-ésima entrada contando da esquerda da\n" +" \tlista mostrada por `dirs', comenzando desde cero.\n" +" \tPor exemplo: `popd +0' borra o primeiro directorio, `popd +1'\n" +" \to segundo.\n" +" \n" +" -N\tBorra a N-ésima entrada contando da derecha da\n" +" \tlista mostrada por `dirs', comezando desde cero.\n" +" \tPor exemplo: `popd -0' borra o último directorio, `popd -1'\n" +" \to penúltimo.\n" +" \n" +" A orde interna `dirs' mostra a pila de directorios." + +#: builtins/read.def:275 +#, c-format +msgid "%s: invalid timeout specification" +msgstr "%s: especificación de tempo de expiración non válida" + +#: builtins/read.def:678 +#, c-format +msgid "read error: %d: %s" +msgstr "erro de lectura: %d: %s" + +#: builtins/return.def:75 +msgid "can only `return' from a function or sourced script" +msgstr "só se pode usar «return» nunha función ou guión lido con «source»" + +#: builtins/set.def:782 +msgid "cannot simultaneously unset a function and a variable" +msgstr "non é posíbel borrar ao mesmo tempo unha función e unha variábel" + +#: builtins/set.def:826 +#, c-format +msgid "%s: cannot unset" +msgstr "%s: non é posíbel borrar" + +#: builtins/set.def:843 +#, c-format +msgid "%s: cannot unset: readonly %s" +msgstr "%s: non é posíbel borrar: %s é de só lectura" + +#: builtins/set.def:854 +#, c-format +msgid "%s: not an array variable" +msgstr "%s: non é unha variábel de matriz" + +#: builtins/setattr.def:187 +#, c-format +msgid "%s: not a function" +msgstr "%s: non é unha función" + +#: builtins/shift.def:71 builtins/shift.def:77 +msgid "shift count" +msgstr "conta de shift" + +#: builtins/shopt.def:279 +msgid "cannot set and unset shell options simultaneously" +msgstr "non é posíbel activar e desactivar opcións do shell simultaneamente" + +#: builtins/shopt.def:346 +#, c-format +msgid "%s: invalid shell option name" +msgstr "%s: nome de opción do shell non válido" + +#: builtins/source.def:130 +msgid "filename argument required" +msgstr "requírese un argumento de nome de ficheiro" + +#: builtins/source.def:155 +#, c-format +msgid "%s: file not found" +msgstr "%s: non se atopou o ficheiro" + +#: builtins/suspend.def:101 +msgid "cannot suspend" +msgstr "non é posíbel suspender" + +#: builtins/suspend.def:111 +msgid "cannot suspend a login shell" +msgstr "non é posíbel suspender un shell de entrada" + +#: builtins/type.def:234 +#, c-format +msgid "%s is aliased to `%s'\n" +msgstr "%s é un alias de `%s'\n" + +#: builtins/type.def:255 +#, c-format +msgid "%s is a shell keyword\n" +msgstr "%s é unha palabra chave do shell\n" + +#: builtins/type.def:274 +#, c-format +msgid "%s is a function\n" +msgstr "%s é unha función\n" + +#: builtins/type.def:296 +#, c-format +msgid "%s is a shell builtin\n" +msgstr "%s é unha orde interna do shell\n" + +#: builtins/type.def:317 builtins/type.def:393 +#, c-format +msgid "%s is %s\n" +msgstr "%s é %s\n" + +#: builtins/type.def:337 +#, c-format +msgid "%s is hashed (%s)\n" +msgstr "%s está asociado (%s)\n" + +#: builtins/ulimit.def:383 +#, c-format +msgid "%s: invalid limit argument" +msgstr "%s: límite de argumento non válido" + +#: builtins/ulimit.def:409 +#, c-format +msgid "`%c': bad command" +msgstr "`%c': orde errónea" + +#: builtins/ulimit.def:438 +#, c-format +msgid "%s: cannot get limit: %s" +msgstr "%s: non é posíbel obter o límite: %s" + +#: builtins/ulimit.def:464 +msgid "limit" +msgstr "límite" + +#: builtins/ulimit.def:476 builtins/ulimit.def:776 +#, c-format +msgid "%s: cannot modify limit: %s" +msgstr "%s: non é posíbel modificar o límite: %s" + +#: builtins/umask.def:114 +msgid "octal number" +msgstr "número octal" + +#: builtins/umask.def:227 +#, c-format +msgid "`%c': invalid symbolic mode operator" +msgstr "`%c': operador de modo simbólico non válido" + +#: builtins/umask.def:282 +#, c-format +msgid "`%c': invalid symbolic mode character" +msgstr "`%c': carácter de modo simbólico non válido" + +#: error.c:90 error.c:325 error.c:327 error.c:329 +msgid " line " +msgstr " liña " + +#: error.c:165 +#, c-format +msgid "last command: %s\n" +msgstr "última orde: %s\n" + +#: error.c:173 +#, c-format +msgid "Aborting..." +msgstr "Abortando…" + +#: error.c:440 +msgid "unknown command error" +msgstr "erro de orde descoñecido" + +#: error.c:441 +msgid "bad command type" +msgstr "tipo de orde erróneo" + +#: error.c:442 +msgid "bad connector" +msgstr "conector erróneo" + +#: error.c:443 +msgid "bad jump" +msgstr "salto erróneo" + +#: error.c:481 +#, c-format +msgid "%s: unbound variable" +msgstr "%s: variable sen asignar" + +#: eval.c:189 +#, c-format +msgid "\atimed out waiting for input: auto-logout\n" +msgstr "\aexpirou mentres agardaba algunha entrada: auto-logout\n" + +#: execute_cmd.c:512 +#, c-format +msgid "cannot redirect standard input from /dev/null: %s" +msgstr "non é posíbel redirixir a saída estándar desde /dev/null: %s" + +#: execute_cmd.c:1233 +#, c-format +msgid "TIMEFORMAT: `%c': invalid format character" +msgstr "TIMEFORMAT: `%c': carácter de formato non válido" + +#: execute_cmd.c:2287 +msgid "pipe error" +msgstr "erro de canalización" + +#: execute_cmd.c:4386 +#, c-format +msgid "%s: maximum function nesting level exceeded (%d)" +msgstr "" + +#: execute_cmd.c:4884 +#, c-format +msgid "%s: restricted: cannot specify `/' in command names" +msgstr "%s: restrinxido: non se pode especificar `/' en nomes de ordes" + +#: execute_cmd.c:4973 +#, c-format +msgid "%s: command not found" +msgstr "%s: non se atopou a orde" + +#: execute_cmd.c:5206 +#, c-format +msgid "%s: %s" +msgstr "%s: %s" + +#: execute_cmd.c:5243 +#, c-format +msgid "%s: %s: bad interpreter" +msgstr "%s: %s: intérprete erróneo" + +#: execute_cmd.c:5280 +#, fuzzy, c-format +msgid "%s: cannot execute binary file: %s" +msgstr "%s: non é posíbel executar o ficheiro binario" + +#: execute_cmd.c:5352 +#, fuzzy, c-format +msgid "`%s': is a special builtin" +msgstr "%s é unha orde interna do shell\n" + +#: execute_cmd.c:5404 +#, c-format +msgid "cannot duplicate fd %d to fd %d" +msgstr "no se pode duplicar o df %d ao df %d" + +#: expr.c:259 +msgid "expression recursion level exceeded" +msgstr "excedeuse o nivel de recursión da expresión" + +#: expr.c:283 +msgid "recursion stack underflow" +msgstr "desbordamento da base da pila de recursión" + +#: expr.c:431 +msgid "syntax error in expression" +msgstr "erro de sintaxe na expresión" + +#: expr.c:475 +msgid "attempted assignment to non-variable" +msgstr "tentouse asignar a algo que non é unha variábel" + +#: expr.c:495 expr.c:858 +msgid "division by 0" +msgstr "división entre 0" + +#: expr.c:542 +msgid "bug: bad expassign token" +msgstr "erro: elemento de asignación de expresión erróneo" + +#: expr.c:595 +msgid "`:' expected for conditional expression" +msgstr "agardábase `:' para a expresión condicional" + +#: expr.c:919 +msgid "exponent less than 0" +msgstr "expoñente menor que 0" + +#: expr.c:976 +msgid "identifier expected after pre-increment or pre-decrement" +msgstr "" +"agardábase un identificador despois do pre-incremento ou pre-decremento" + +#: expr.c:1002 +msgid "missing `)'" +msgstr "falta un `)'" + +#: expr.c:1053 expr.c:1390 +msgid "syntax error: operand expected" +msgstr "erro de sintaxe: agardábase un operando" + +#: expr.c:1392 +msgid "syntax error: invalid arithmetic operator" +msgstr "erro de sintaxe: operador aritmético non válido" + +#: expr.c:1416 +#, c-format +msgid "%s%s%s: %s (error token is \"%s\")" +msgstr "%s%s%s: %s (o elemento de erro é \"%s\")" + +#: expr.c:1474 +msgid "invalid arithmetic base" +msgstr "base aritmética non válida" + +#: expr.c:1494 +msgid "value too great for base" +msgstr "valor demasiado grande para a base" + +#: expr.c:1543 +#, c-format +msgid "%s: expression error\n" +msgstr "%s: erro de expresión\n" + +#: general.c:62 +msgid "getcwd: cannot access parent directories" +msgstr "getcwd: non é posíbel acceder aos directorios pai" + +#: input.c:102 subst.c:5168 +#, c-format +msgid "cannot reset nodelay mode for fd %d" +msgstr "non é posíbel restabelecer o modo nodelay para o df %d" + +#: input.c:271 +#, c-format +msgid "cannot allocate new file descriptor for bash input from fd %d" +msgstr "" +"non é posíbel asignar un novo descritor de ficheiros para a entrada de bash " +"desde o fd %d" + +#: input.c:279 +#, c-format +msgid "save_bash_input: buffer already exists for new fd %d" +msgstr "" +"save_bash_input: o almacenamento intermedio xa existe para o novo fd %d" + +#: jobs.c:471 +msgid "start_pipeline: pgrp pipe" +msgstr "start_pipeline: tubería de pgrp" + +#: jobs.c:893 +#, c-format +msgid "forked pid %d appears in running job %d" +msgstr "o pid `forked' %d aparece no traballo en execución %d" + +#: jobs.c:1012 +#, c-format +msgid "deleting stopped job %d with process group %ld" +msgstr "borrando o trabajo detido %d con grupo de proceso %ld" + +#: jobs.c:1117 +#, c-format +msgid "add_process: process %5ld (%s) in the_pipeline" +msgstr "add_process: o proceso %5ld (%s) en the_pipeline" + +#: jobs.c:1120 +#, c-format +msgid "add_process: pid %5ld (%s) marked as still alive" +msgstr "add_process: pid %5ld (%s) márcase como vivo aínda" + +#: jobs.c:1435 +#, c-format +msgid "describe_pid: %ld: no such pid" +msgstr "describe_pid: %ld: non existe tal pid" + +#: jobs.c:1450 +#, c-format +msgid "Signal %d" +msgstr "Sinal %d" + +#: jobs.c:1464 jobs.c:1489 +msgid "Done" +msgstr "Feito" + +#: jobs.c:1469 siglist.c:123 +msgid "Stopped" +msgstr "Detido" + +#: jobs.c:1473 +#, c-format +msgid "Stopped(%s)" +msgstr "Detido(%s)" + +#: jobs.c:1477 +msgid "Running" +msgstr "En execución" + +#: jobs.c:1491 +#, c-format +msgid "Done(%d)" +msgstr "Feito(%d)" + +#: jobs.c:1493 +#, c-format +msgid "Exit %d" +msgstr "Saída %d" + +#: jobs.c:1496 +msgid "Unknown status" +msgstr "Estado descoñecido" + +#: jobs.c:1583 +#, c-format +msgid "(core dumped) " +msgstr "(«core» xerado) " + +#: jobs.c:1602 +#, c-format +msgid " (wd: %s)" +msgstr " (dir agora: %s)" + +#: jobs.c:1819 +#, c-format +msgid "child setpgid (%ld to %ld)" +msgstr "setpgid fillo (%ld a %ld)" + +#: jobs.c:2138 nojobs.c:605 +#, c-format +msgid "wait: pid %ld is not a child of this shell" +msgstr "wait: pid %ld non é un proceso fillo desta shell" + +#: jobs.c:2385 +#, c-format +msgid "wait_for: No record of process %ld" +msgstr "wait_for: Non hai un rexistro do proceso %ld" + +#: jobs.c:2694 +#, c-format +msgid "wait_for_job: job %d is stopped" +msgstr "wait_for_job: o traballo %d está detido" + +#: jobs.c:2986 +#, c-format +msgid "%s: job has terminated" +msgstr "%s: o traballo rematou" + +#: jobs.c:2995 +#, c-format +msgid "%s: job %d already in background" +msgstr "%s: o trabajo %d xa está en segundo plano" + +#: jobs.c:3220 +msgid "waitchld: turning on WNOHANG to avoid indefinite block" +msgstr "waitchld: actívase WNOHANG para evitar o bloque indefinido" + +#: jobs.c:3711 +#, c-format +msgid "%s: line %d: " +msgstr "%s: liña %d: " + +#: jobs.c:3725 nojobs.c:843 +#, c-format +msgid " (core dumped)" +msgstr " («core» generado)" + +#: jobs.c:3737 jobs.c:3750 +#, c-format +msgid "(wd now: %s)\n" +msgstr "(dir agora: %s)\n" + +#: jobs.c:3782 +msgid "initialize_job_control: getpgrp failed" +msgstr "initialize_jobs_control: fallou getpgrp" + +#: jobs.c:3843 +msgid "initialize_job_control: line discipline" +msgstr "initialize_jobs_control: disciplina de liña" + +#: jobs.c:3853 +msgid "initialize_job_control: setpgid" +msgstr "initialize_jobs_control: setpgid" + +#: jobs.c:3874 jobs.c:3883 +#, c-format +msgid "cannot set terminal process group (%d)" +msgstr "non é posíbel estabelecer o grupo de procesos de terminal (%d)" + +#: jobs.c:3888 +msgid "no job control in this shell" +msgstr "non hai control de trabalos nesta shell" + +#: lib/malloc/malloc.c:296 +#, c-format +msgid "malloc: failed assertion: %s\n" +msgstr "malloc: fallou a aserción: %s\n" + +#: lib/malloc/malloc.c:312 +#, c-format +msgid "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" +msgstr "" +"\r\n" +"malloc: %s:%d: aserción arruinada\r\n" + +#: lib/malloc/malloc.c:313 +msgid "unknown" +msgstr "descoñecido" + +#: lib/malloc/malloc.c:801 +msgid "malloc: block on free list clobbered" +msgstr "malloc: bloque na lista libre sobreescrito" + +#: lib/malloc/malloc.c:878 +msgid "free: called with already freed block argument" +msgstr "free: chamouse cun argumento de bloque previamente liberado" + +#: lib/malloc/malloc.c:881 +msgid "free: called with unallocated block argument" +msgstr "free: chamouse cun argumento de bloque sen asignar" + +#: lib/malloc/malloc.c:900 +msgid "free: underflow detected; mh_nbytes out of range" +msgstr "free: detectouse un desbordamento por embaixo; mh_nbytes fóra de rango" + +#: lib/malloc/malloc.c:906 +msgid "free: start and end chunk sizes differ" +msgstr "free: os tamaños dos anacos de inicio e fin son diferentes" + +#: lib/malloc/malloc.c:1005 +msgid "realloc: called with unallocated block argument" +msgstr "realloc: chamouse cun argumento de bloque sen asignar" + +#: lib/malloc/malloc.c:1020 +msgid "realloc: underflow detected; mh_nbytes out of range" +msgstr "" +"realloc: detectouse un desbordamento por embaixo; mh_nbytes fóra de rango" + +#: lib/malloc/malloc.c:1026 +msgid "realloc: start and end chunk sizes differ" +msgstr "realloc: os tamaños dos anacos de inicio e fin son diferentes" + +#: lib/malloc/table.c:194 +#, c-format +msgid "register_alloc: alloc table is full with FIND_ALLOC?\n" +msgstr "register_alloc: a táboa alloc está chea con FIND_ALLOC?\n" + +#: lib/malloc/table.c:203 +#, c-format +msgid "register_alloc: %p already in table as allocated?\n" +msgstr "register_alloc: %p xa está na táboa como asignado?\n" + +#: lib/malloc/table.c:256 +#, c-format +msgid "register_free: %p already in table as free?\n" +msgstr "register_free: %p xa está na táboa como libre?\n" + +#: lib/sh/fmtulong.c:102 +msgid "invalid base" +msgstr "base non válida" + +#: lib/sh/netopen.c:168 +#, c-format +msgid "%s: host unknown" +msgstr "%s: anfitrión descoñecido" + +#: lib/sh/netopen.c:175 +#, c-format +msgid "%s: invalid service" +msgstr "%s: servizo non válido" + +#: lib/sh/netopen.c:306 +#, c-format +msgid "%s: bad network path specification" +msgstr "%s: especificación de ruta de rede errónea" + +#: lib/sh/netopen.c:346 +msgid "network operations not supported" +msgstr "non hai compatibilidade para operacións de rede" + +#: locale.c:200 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s)" +msgstr "setlocale: LC_ALL non se pode cambiar a configuración rexional (%s)" + +#: locale.c:202 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s): %s" +msgstr "" +"setlocale: LC_ALL: non se pode cambiar a configuración rexional (%s): %s" + +#: locale.c:259 +#, c-format +msgid "setlocale: %s: cannot change locale (%s)" +msgstr "setlocale: %s: non se pode cambiar a configuración rexional (%s)" + +#: locale.c:261 +#, c-format +msgid "setlocale: %s: cannot change locale (%s): %s" +msgstr "setlocale: %s: non se pode cambiar a configuración rexional (%s): %s" + +#: mailcheck.c:439 +msgid "You have mail in $_" +msgstr "Ten mensaxes en $_" + +#: mailcheck.c:464 +msgid "You have new mail in $_" +msgstr "Ten unha nova mensaxe en $_" + +#: mailcheck.c:480 +#, c-format +msgid "The mail in %s has been read\n" +msgstr "O correo en %s foi lido\n" + +#: make_cmd.c:323 +msgid "syntax error: arithmetic expression required" +msgstr "error de sintaxe: requírese unha expresión aritmética" + +#: make_cmd.c:325 +msgid "syntax error: `;' unexpected" +msgstr "error sintáctico: `;' non esperado" + +#: make_cmd.c:326 +#, c-format +msgid "syntax error: `((%s))'" +msgstr "erro de sintaxe: `((%s))'" + +#: make_cmd.c:578 +#, c-format +msgid "make_here_document: bad instruction type %d" +msgstr "make_here_document: tipo de instrución %d erróneo" + +#: make_cmd.c:662 +#, c-format +msgid "here-document at line %d delimited by end-of-file (wanted `%s')" +msgstr "" +"o documento-aquí na liña %d está delimitado por fin-de-fichero (agardábase `" +"%s')" + +#: make_cmd.c:759 +#, c-format +msgid "make_redirection: redirection instruction `%d' out of range" +msgstr "make_redirection: a instrucción de redirección `%d' está fóra de rango" + +#: parse.y:3278 parse.y:3561 +#, c-format +msgid "unexpected EOF while looking for matching `%c'" +msgstr "EOF inesperado mentres se buscaba un `%c' coincidente" + +#: parse.y:4170 +msgid "unexpected EOF while looking for `]]'" +msgstr "EOF inesperado mentres se buscaba `]]'" + +#: parse.y:4175 +#, c-format +msgid "syntax error in conditional expression: unexpected token `%s'" +msgstr "error de sintaxe na expresión condicional: elemento inesperado `%s'" + +#: parse.y:4179 +msgid "syntax error in conditional expression" +msgstr "error sintáctico na expresión condicional" + +#: parse.y:4257 +#, c-format +msgid "unexpected token `%s', expected `)'" +msgstr "elemento inesperado `%s', agardábase `)'" + +#: parse.y:4261 +msgid "expected `)'" +msgstr "agardábase `)'" + +#: parse.y:4289 +#, c-format +msgid "unexpected argument `%s' to conditional unary operator" +msgstr "argumento inesperado `%s' para o operador unario condicional" + +#: parse.y:4293 +msgid "unexpected argument to conditional unary operator" +msgstr "argumento inesperado para o operador unario condicional" + +#: parse.y:4339 +#, c-format +msgid "unexpected token `%s', conditional binary operator expected" +msgstr "elemento inesperado `%s', agardábase un operador binario condicional" + +#: parse.y:4343 +msgid "conditional binary operator expected" +msgstr "agardábase un operador binario condicional" + +#: parse.y:4365 +#, c-format +msgid "unexpected argument `%s' to conditional binary operator" +msgstr "argumento inesperado `%s' para o operador binario condicional" + +#: parse.y:4369 +msgid "unexpected argument to conditional binary operator" +msgstr "argumento inesperado para o operador binario condicional" + +#: parse.y:4380 +#, c-format +msgid "unexpected token `%c' in conditional command" +msgstr "elemento inesperado `%c' na orde condicional" + +#: parse.y:4383 +#, c-format +msgid "unexpected token `%s' in conditional command" +msgstr "elemento inesperado `%s' na orde condicional" + +#: parse.y:4387 +#, c-format +msgid "unexpected token %d in conditional command" +msgstr "elemento inesperado %d na orde condicional" + +#: parse.y:5737 +#, c-format +msgid "syntax error near unexpected token `%s'" +msgstr "error de sintaxe perto do elemento inesperado `%s'" + +#: parse.y:5755 +#, c-format +msgid "syntax error near `%s'" +msgstr "erro de sintaxe cerca de «%s»" + +#: parse.y:5765 +msgid "syntax error: unexpected end of file" +msgstr "error de sintaxe: non se agardaba o final do fichero" + +#: parse.y:5765 +msgid "syntax error" +msgstr "erro de sintaxe" + +#: parse.y:5827 +#, c-format +msgid "Use \"%s\" to leave the shell.\n" +msgstr "Use «%s» para deixar o shell.\n" + +#: parse.y:5989 +msgid "unexpected EOF while looking for matching `)'" +msgstr "EOF non agardado mentres se buscaba un «)» coincidente" + +#: pcomplete.c:1094 +#, c-format +msgid "completion: function `%s' not found" +msgstr "completion: non se atopa a función `%s'" + +#: pcomplib.c:182 +#, c-format +msgid "progcomp_insert: %s: NULL COMPSPEC" +msgstr "progcomp_insert: %s: COMPSPEC nulo" + +#: print_cmd.c:300 +#, c-format +msgid "print_command: bad connector `%d'" +msgstr "print_command: conector erróneo `%d'" + +#: print_cmd.c:373 +#, c-format +msgid "xtrace_set: %d: invalid file descriptor" +msgstr "xtrace_set: %d: descriptor de fichero non válido" + +#: print_cmd.c:378 +msgid "xtrace_set: NULL file pointer" +msgstr "xtrace_set: punteiro a ficheiro NULL" + +#: print_cmd.c:382 +#, c-format +msgid "xtrace fd (%d) != fileno xtrace fp (%d)" +msgstr "xtrace fd (%d) != numfich xtrace fp (%d)" + +#: print_cmd.c:1518 +#, c-format +msgid "cprintf: `%c': invalid format character" +msgstr "cprintf: `%c': carácter de formato non válido" + +#: redir.c:123 redir.c:170 +msgid "file descriptor out of range" +msgstr "descritor de ficheiro fóra de rango" + +#: redir.c:177 +#, c-format +msgid "%s: ambiguous redirect" +msgstr "%s: redireccionamento ambigüo" + +#: redir.c:181 +#, c-format +msgid "%s: cannot overwrite existing file" +msgstr "%s: non se pode sobreescribir un fichero existente" + +#: redir.c:186 +#, c-format +msgid "%s: restricted: cannot redirect output" +msgstr "%s: restrinxido: no se pode redirixir a saída" + +#: redir.c:191 +#, c-format +msgid "cannot create temp file for here-document: %s" +msgstr "non se pode crear un fichero temporal para o documento-aquí: %s" + +#: redir.c:195 +#, c-format +msgid "%s: cannot assign fd to variable" +msgstr "%s: non é posíbel asignar o gd á variábel" + +#: redir.c:582 +msgid "/dev/(tcp|udp)/host/port not supported without networking" +msgstr "non se admite /dev/(tcp|udp)/anfitrion/porto sen rede" + +#: redir.c:861 redir.c:973 redir.c:1034 redir.c:1199 +msgid "redirection error: cannot duplicate fd" +msgstr "erro de redirección: non é posíbel duplicar o fd" + +#: shell.c:339 +msgid "could not find /tmp, please create!" +msgstr "non é posíbel atopar /tmp, por favor creeo!" + +#: shell.c:343 +msgid "/tmp must be a valid directory name" +msgstr "/tmp debe ser un nome de directorio válido" + +#: shell.c:890 +#, c-format +msgid "%c%c: invalid option" +msgstr "%c%c: opción non válida" + +#: shell.c:1682 +msgid "I have no name!" +msgstr "Non teño nome!" + +#: shell.c:1827 +#, c-format +msgid "GNU bash, version %s-(%s)\n" +msgstr "GNU bash, versión %s-(%s)\n" + +#: shell.c:1828 +#, c-format +msgid "" +"Usage:\t%s [GNU long option] [option] ...\n" +"\t%s [GNU long option] [option] script-file ...\n" +msgstr "" +"Uso:\t%s [opción GNU longa] [opción] ...\n" +"\t%s [opción GNU longa] [opción] guión-do-shell\n" + +#: shell.c:1830 +msgid "GNU long options:\n" +msgstr "Opcións GNU longas:\n" + +#: shell.c:1834 +msgid "Shell options:\n" +msgstr "Opcións do shell:\n" + +#: shell.c:1835 +#, fuzzy +msgid "\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n" +msgstr "\t-irsD o -c orde ou -O opcion_shopt\t\t(só invocación)\n" + +#: shell.c:1850 +#, c-format +msgid "\t-%s or -o option\n" +msgstr "\t-%s ou -o opción\n" + +#: shell.c:1856 +#, c-format +msgid "Type `%s -c \"help set\"' for more information about shell options.\n" +msgstr "" +"Escriba `%s -c \"help set\"' para máis información sobre as opcións do " +"shell.\n" + +#: shell.c:1857 +#, c-format +msgid "Type `%s -c help' for more information about shell builtin commands.\n" +msgstr "" +"Escriba `%s -c help' para máis información sobre as ordes internas do " +"shell.\n" + +#: shell.c:1858 +#, c-format +msgid "Use the `bashbug' command to report bugs.\n" +msgstr "Use a orden `bashbug' para reportar erros.\n" + +#: sig.c:691 +#, c-format +msgid "sigprocmask: %d: invalid operation" +msgstr "sigprocmask: %d: operación non válida" + +#: siglist.c:48 +msgid "Bogus signal" +msgstr "Sinal ambigüa" + +#: siglist.c:51 +msgid "Hangup" +msgstr "Colgar" + +#: siglist.c:55 +msgid "Interrupt" +msgstr "Interromper" + +#: siglist.c:59 +msgid "Quit" +msgstr "Saír" + +#: siglist.c:63 +msgid "Illegal instruction" +msgstr "Instrución ilegal" + +#: siglist.c:67 +msgid "BPT trace/trap" +msgstr "BPT rastreo/captura" + +#: siglist.c:75 +msgid "ABORT instruction" +msgstr "instrución ABORT" + +#: siglist.c:79 +msgid "EMT instruction" +msgstr "instrución EMT" + +#: siglist.c:83 +msgid "Floating point exception" +msgstr "Excepción de coma flotante" + +#: siglist.c:87 +msgid "Killed" +msgstr "Matado" + +#: siglist.c:91 +msgid "Bus error" +msgstr "Erro no bus" + +#: siglist.c:95 +msgid "Segmentation fault" +msgstr "Violación de segmento" + +#: siglist.c:99 +msgid "Bad system call" +msgstr "Chamada ao sistema errónea" + +#: siglist.c:103 +msgid "Broken pipe" +msgstr "Tubería rota" + +#: siglist.c:107 +msgid "Alarm clock" +msgstr "Temporizador" + +#: siglist.c:111 +msgid "Terminated" +msgstr "Rematado" + +#: siglist.c:115 +msgid "Urgent IO condition" +msgstr "Condicón de E/s urxente" + +#: siglist.c:119 +msgid "Stopped (signal)" +msgstr "Detido (sinal)" + +#: siglist.c:127 +msgid "Continue" +msgstr "Continúa" + +#: siglist.c:135 +msgid "Child death or stop" +msgstr "O proceso fillo morreu ou está parado" + +#: siglist.c:139 +msgid "Stopped (tty input)" +msgstr "Detido (entrada pola terminal)" + +#: siglist.c:143 +msgid "Stopped (tty output)" +msgstr "Detido (saída pola terminal)" + +#: siglist.c:147 +msgid "I/O ready" +msgstr "E/S listas" + +#: siglist.c:151 +msgid "CPU limit" +msgstr "Límite de CPU" + +#: siglist.c:155 +msgid "File limit" +msgstr "Límite de ficheiros" + +#: siglist.c:159 +msgid "Alarm (virtual)" +msgstr "Alarma (virtual)" + +#: siglist.c:163 +msgid "Alarm (profile)" +msgstr "Alarma (contorno)" + +#: siglist.c:167 +msgid "Window changed" +msgstr "Xanela cambiada" + +#: siglist.c:171 +msgid "Record lock" +msgstr "Bloqueo de gravación" + +#: siglist.c:175 +msgid "User signal 1" +msgstr "Sinal de usuario 1" + +#: siglist.c:179 +msgid "User signal 2" +msgstr "Sinal de usuario 2" + +#: siglist.c:183 +msgid "HFT input data pending" +msgstr "entrada de datos HFT pendente" + +#: siglist.c:187 +msgid "power failure imminent" +msgstr "fallo de enerxía inminente" + +#: siglist.c:191 +msgid "system crash imminent" +msgstr "caída do sistema inminente" + +#: siglist.c:195 +msgid "migrate process to another CPU" +msgstr "migrando o proceso a outra CPU" + +#: siglist.c:199 +msgid "programming error" +msgstr "erro de programación" + +#: siglist.c:203 +msgid "HFT monitor mode granted" +msgstr "o modo monitor HFT foi concedido" + +#: siglist.c:207 +msgid "HFT monitor mode retracted" +msgstr "o modo monitor HTF foi retirado" + +#: siglist.c:211 +msgid "HFT sound sequence has completed" +msgstr "a secuencia de son HFT foi completada" + +#: siglist.c:215 +msgid "Information request" +msgstr "Solicitude de información" + +#: siglist.c:223 +msgid "Unknown Signal #" +msgstr "Sinal descoñecido #" + +#: siglist.c:225 +#, c-format +msgid "Unknown Signal #%d" +msgstr "Sinal descoñecido #%d" + +#: subst.c:1362 subst.c:1520 +#, c-format +msgid "bad substitution: no closing `%s' in %s" +msgstr "susbtitución errónea: non hai un `%s' que peche en %s" + +#: subst.c:2847 +#, c-format +msgid "%s: cannot assign list to array member" +msgstr "%s: no é posíbel asignar unha lista a un membro da matriz" + +#: subst.c:5065 subst.c:5081 +msgid "cannot make pipe for process substitution" +msgstr "non é posíbel crear a tubería para a sustitución do proceso" + +#: subst.c:5113 +msgid "cannot make child for process substitution" +msgstr "non é posíbel crear un proceso fillo para a substitución do proceso" + +#: subst.c:5158 +#, c-format +msgid "cannot open named pipe %s for reading" +msgstr "non é posíbel abrir a tubería chamada %s para lectura" + +#: subst.c:5160 +#, c-format +msgid "cannot open named pipe %s for writing" +msgstr "non é posíbel abrir a tubería chamada %s para escritura" + +#: subst.c:5178 +#, c-format +msgid "cannot duplicate named pipe %s as fd %d" +msgstr "non é posíbel duplicar a tubería chamada %s como df %d" + +#: subst.c:5376 +msgid "cannot make pipe for command substitution" +msgstr "non é posíble crear a tubería para a substitución da orde" + +#: subst.c:5414 +msgid "cannot make child for command substitution" +msgstr "non é posíbel crear un proceso fillo para a substitución da orde" + +#: subst.c:5433 +msgid "command_substitute: cannot duplicate pipe as fd 1" +msgstr "command_substitute: non é posíbel duplicar a tubería como fd 1" + +#: subst.c:5837 subst.c:8050 +#, fuzzy, c-format +msgid "%s: invalid variable name for name reference" +msgstr "%s: %s: valor non válido para o descitor de ficheiro de rastreo" + +#: subst.c:6048 +#, c-format +msgid "%s: parameter null or not set" +msgstr "%s: parámetro nulo ou non estabelecido" + +#: subst.c:6320 subst.c:6335 +#, c-format +msgid "%s: substring expression < 0" +msgstr "%s: expresión de subcadea < 0" + +#: subst.c:7506 +#, c-format +msgid "%s: bad substitution" +msgstr "%s: substitución errónea" + +#: subst.c:7583 +#, c-format +msgid "$%s: cannot assign in this way" +msgstr "$%s: non é posíbel asignar de esta forma" + +#: subst.c:7917 +msgid "" +"future versions of the shell will force evaluation as an arithmetic " +"substitution" +msgstr "" +"versiones futuras do intérprete obligarán a evaluación como unha " +"substitución aritmética" + +#: subst.c:8421 +#, c-format +msgid "bad substitution: no closing \"`\" in %s" +msgstr "substitución errónea: non hai unha \"`\" que peche en %s" + +#: subst.c:9322 +#, c-format +msgid "no match: %s" +msgstr "non hai concidencia: %s" + +#: test.c:147 +msgid "argument expected" +msgstr "agardábase un argumento" + +#: test.c:156 +#, c-format +msgid "%s: integer expression expected" +msgstr "%s: agardábase unha expresión enteira" + +#: test.c:264 +msgid "`)' expected" +msgstr "agardábase `)'" + +#: test.c:266 +#, c-format +msgid "`)' expected, found %s" +msgstr "`)' agardábase, atopouse %s" + +#: test.c:281 test.c:742 test.c:745 +#, c-format +msgid "%s: unary operator expected" +msgstr "%s: agardábase un operador unario" + +#: test.c:468 test.c:785 +#, c-format +msgid "%s: binary operator expected" +msgstr "%s: agardábase un operador binario" + +#: test.c:860 +msgid "missing `]'" +msgstr "falta un «]»" + +#: trap.c:217 +msgid "invalid signal number" +msgstr "número de sinal non válido" + +#: trap.c:371 +#, c-format +msgid "run_pending_traps: bad value in trap_list[%d]: %p" +msgstr "run_pending_traps: valor erróneo en trap_list[%d]: %p" + +#: trap.c:375 +#, c-format +msgid "" +"run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" +msgstr "" +"run_pending_traps: o manexador de sinal é SIG_DFL, reenviando %d (%s) a sí " +"mesmo" + +#: trap.c:428 +#, c-format +msgid "trap_handler: bad signal %d" +msgstr "trap_handler: sinal errónea %d" + +#: variables.c:382 +#, c-format +msgid "error importing function definition for `%s'" +msgstr "erro ao importar a definición da función para «%s»" + +#: variables.c:780 +#, c-format +msgid "shell level (%d) too high, resetting to 1" +msgstr "o nivel de shell (%d) é demasiado alto, restabelécese a 1" + +#: variables.c:1865 +#, fuzzy, c-format +msgid "%s: circular name reference" +msgstr "%s: %s: valor non válido para o descitor de ficheiro de rastreo" + +#: variables.c:2228 +msgid "make_local_variable: no function context at current scope" +msgstr "make_local_variable: non hai contexto de función no ámbito actual" + +#: variables.c:2247 +#, fuzzy, c-format +msgid "%s: variable may not be assigned value" +msgstr "%s: non é posíbel asignar o gd á variábel" + +#: variables.c:3646 +msgid "all_local_variables: no function context at current scope" +msgstr "all_local_variables: non hai contexto de función no ámbito actual" + +#: variables.c:3891 +#, c-format +msgid "%s has null exportstr" +msgstr "%s ten exportstr nulo" + +#: variables.c:3896 variables.c:3905 +#, c-format +msgid "invalid character %d in exportstr for %s" +msgstr "carácter non válido %d en exportsrt para %s" + +#: variables.c:3911 +#, c-format +msgid "no `=' in exportstr for %s" +msgstr "non hai «=» en exportstr para %s" + +#: variables.c:4344 +msgid "pop_var_context: head of shell_variables not a function context" +msgstr "" +"pop_var_context: a cabezak de shell_variables non é un contexto de función" + +#: variables.c:4357 +msgid "pop_var_context: no global_variables context" +msgstr "pop_var_context: non é un contexto global_variables " + +#: variables.c:4431 +msgid "pop_scope: head of shell_variables not a temporary environment scope" +msgstr "" +"pop_scope: a cabeza de shell_variables non é un ámbito de ambiente temporal" + +#: variables.c:5257 +#, c-format +msgid "%s: %s: cannot open as FILE" +msgstr "%s: %s: non é posíbel abrir como FICHEIRO" + +#: variables.c:5262 +#, c-format +msgid "%s: %s: invalid value for trace file descriptor" +msgstr "%s: %s: valor non válido para o descitor de ficheiro de rastreo" + +#: variables.c:5307 +#, fuzzy, c-format +msgid "%s: %s: compatibility value out of range" +msgstr "%s: %s fóra de rango" + +#: version.c:46 +#, fuzzy +msgid "Copyright (C) 2013 Free Software Foundation, Inc." +msgstr "Copyright (C) 2011 Free Software Foundation, Inc." + +#: version.c:47 version2.c:47 +msgid "" +"License GPLv3+: GNU GPL version 3 or later \n" +msgstr "" +"Licenza GPLv3+: GPL de GNU versión 3 ou posterior \n" + +#: version.c:86 version2.c:86 +#, c-format +msgid "GNU bash, version %s (%s)\n" +msgstr "GNU bash, versión %s (%s)\n" + +#: version.c:91 version2.c:91 +#, fuzzy +msgid "This is free software; you are free to change and redistribute it." +msgstr "Isto é software libre; vostede é libre de cambialo e redistribuilo.\n" + +#: version.c:92 version2.c:92 +#, fuzzy +msgid "There is NO WARRANTY, to the extent permitted by law." +msgstr "Non hai GARANTÍA, á extensión permitida pola ley.\n" + +#: version2.c:46 +#, fuzzy +msgid "Copyright (C) 2012 Free Software Foundation, Inc." +msgstr "Copyright (C) 2011 Free Software Foundation, Inc." + +#: xmalloc.c:91 +#, c-format +msgid "%s: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "%s: non é posíbel asignar %lu bytes (%lu bytes asignados)" + +#: xmalloc.c:93 +#, c-format +msgid "%s: cannot allocate %lu bytes" +msgstr "%s: non é posíbel asignar %lu bytes" + +#: xmalloc.c:163 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "%s: %s:%d: non é posíbel asignar %lu bytes (%lu bytes asignados)" + +#: xmalloc.c:165 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes" +msgstr "%s: %s:%d: non é posíbel asignar %lu bytes" + +#: builtins.c:43 +msgid "alias [-p] [name[=value] ... ]" +msgstr "alias [-p] [nome[=valor] ... ]" + +#: builtins.c:47 +msgid "unalias [-a] name [name ...]" +msgstr "unalias [-a] nome [nome ...]" + +#: builtins.c:51 +#, fuzzy +msgid "" +"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-" +"x keyseq:shell-command] [keyseq:readline-function or readline-command]" +msgstr "" +"bind [-lpvsPVS] [-m comb_teclas] [-f ficheiro] [-q nome] [-u nome] [-r " +"secteclas] [-x secteclas:orde-shell] [keyseq:función-readline ou función-" +"readline]" + +#: builtins.c:54 +msgid "break [n]" +msgstr "break [n]" + +#: builtins.c:56 +msgid "continue [n]" +msgstr "continue [n]" + +#: builtins.c:58 +msgid "builtin [shell-builtin [arg ...]]" +msgstr "builtin [orde-interna-shell [arg ...]]" + +#: builtins.c:61 +msgid "caller [expr]" +msgstr "caller [expresión]" + +#: builtins.c:64 +#, fuzzy +msgid "cd [-L|[-P [-e]] [-@]] [dir]" +msgstr "cd [-L|[-P [-e]]] [directorio]" + +#: builtins.c:66 +msgid "pwd [-LP]" +msgstr "pwd [-LP]" + +#: builtins.c:68 +msgid ":" +msgstr ":" + +#: builtins.c:70 +msgid "true" +msgstr "true" + +#: builtins.c:72 +msgid "false" +msgstr "false" + +#: builtins.c:74 +msgid "command [-pVv] command [arg ...]" +msgstr "command [-pVv] orde [arg ...]" + +#: builtins.c:76 +#, fuzzy +msgid "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" +msgstr "declare [-aAfFgilrtux] [-p] [nome[=valor] ...]" + +#: builtins.c:78 +msgid "typeset [-aAfFgilrtux] [-p] name[=value] ..." +msgstr "typeset [-aAfFgilrtux] [-p] nome[=valor] ..." + +#: builtins.c:80 +msgid "local [option] name[=value] ..." +msgstr "local [option] nome[=valor] ..." + +#: builtins.c:83 +msgid "echo [-neE] [arg ...]" +msgstr "echo [-neE] [arg ...]" + +#: builtins.c:87 +msgid "echo [-n] [arg ...]" +msgstr "echo [-n] [arg ...]" + +#: builtins.c:90 +msgid "enable [-a] [-dnps] [-f filename] [name ...]" +msgstr "enable [-a] [-dnps] [-f nomeficheiro] [nome ...]" + +#: builtins.c:92 +msgid "eval [arg ...]" +msgstr "eval [arg ...]" + +#: builtins.c:94 +msgid "getopts optstring name [arg]" +msgstr "getopts cadena_opcións nome [arg]" + +#: builtins.c:96 +msgid "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" +msgstr "exec [-cl] [-a ome] [orde [argumentos ...]] [redirección ...]" + +#: builtins.c:98 +msgid "exit [n]" +msgstr "exit [n]" + +#: builtins.c:100 +msgid "logout [n]" +msgstr "logout [n]" + +#: builtins.c:103 +msgid "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" +msgstr "fc [-e nome_e] [-lnr] [primeiro] [último] ou fc -s [pat=rep] [orde]" + +#: builtins.c:107 +msgid "fg [job_spec]" +msgstr "fg [id_traballo]" + +#: builtins.c:111 +msgid "bg [job_spec ...]" +msgstr "bg [id_traballo ...]" + +#: builtins.c:114 +msgid "hash [-lr] [-p pathname] [-dt] [name ...]" +msgstr "hash [-lr] [-p ruta] [-dt] [nome ...]" + +#: builtins.c:117 +msgid "help [-dms] [pattern ...]" +msgstr "help [-dms] [patrón ...]" + +#: builtins.c:121 +msgid "" +"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg " +"[arg...]" +msgstr "" +"history [-c] [-d desprazamento] [n] ou history -anrw [ficheiro] ou history -" +"ps arg [arg...]" + +#: builtins.c:125 +msgid "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" +msgstr "jobs [-lnprs] [idtraballo ...] ou jobs -x orde [args]" + +#: builtins.c:129 +msgid "disown [-h] [-ar] [jobspec ...]" +msgstr "disown [-h] [-ar] [id_traballo ...]" + +#: builtins.c:132 +msgid "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l " +"[sigspec]" +msgstr "" +"kill [-s id_sinal | -n num_sinal | -id_sinal] pid | id_traballo ... ou kill -" +"l [id_sinal]" + +#: builtins.c:134 +msgid "let arg [arg ...]" +msgstr "let arg [arg ...]" + +#: builtins.c:136 +msgid "" +"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p " +"prompt] [-t timeout] [-u fd] [name ...]" +msgstr "" +"read [-ers] [-a matriz] [-d delim] [-i texto] [-n ncars] [-N ncars] [-p " +"prompt] [-t timeout] [-u fd] [nome ...]" + +#: builtins.c:138 +msgid "return [n]" +msgstr "return [n]" + +#: builtins.c:140 +msgid "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" +msgstr "set [-abefhkmnptuvxBCHP] [-o nome-opción] [--] [arg ...]" + +#: builtins.c:142 +#, fuzzy +msgid "unset [-f] [-v] [-n] [name ...]" +msgstr "unset [-f] [-v] [nome ...]" + +#: builtins.c:144 +msgid "export [-fn] [name[=value] ...] or export -p" +msgstr "export [-fn] [nome[=valor] ...] ou export -p" + +#: builtins.c:146 +msgid "readonly [-aAf] [name[=value] ...] or readonly -p" +msgstr "readonly [-aAf] [nome[=valor] ...] ou readonly -p" + +#: builtins.c:148 +msgid "shift [n]" +msgstr "shift [n]" + +#: builtins.c:150 +msgid "source filename [arguments]" +msgstr "source ficheiro [arguments]" + +#: builtins.c:152 +msgid ". filename [arguments]" +msgstr ". ficheiro [argumentos]" + +#: builtins.c:155 +msgid "suspend [-f]" +msgstr "suspend [-f]" + +#: builtins.c:158 +msgid "test [expr]" +msgstr "test [expresión]" + +#: builtins.c:160 +msgid "[ arg... ]" +msgstr "[ arg... ]" + +#: builtins.c:162 +msgid "times" +msgstr "times" + +#: builtins.c:164 +msgid "trap [-lp] [[arg] signal_spec ...]" +msgstr "trap [-lp] [[arg] id_sinal ...]" + +#: builtins.c:166 +msgid "type [-afptP] name [name ...]" +msgstr "type [-afptP] nome [nome ...]" + +#: builtins.c:169 +#, fuzzy +msgid "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" +msgstr "ulimit [-SHacdefilmnpqrstuvx] [límite]" + +#: builtins.c:172 +msgid "umask [-p] [-S] [mode]" +msgstr "umask [-p] [-S] [modo]" + +#: builtins.c:175 +#, fuzzy +msgid "wait [-n] [id ...]" +msgstr "wait [id]" + +#: builtins.c:179 +#, fuzzy +msgid "wait [pid ...]" +msgstr "wait [id]" + +#: builtins.c:182 +msgid "for NAME [in WORDS ... ] ; do COMMANDS; done" +msgstr "for NOME [in PALABRAS ... ] ; do ORDES; done" + +#: builtins.c:184 +msgid "for (( exp1; exp2; exp3 )); do COMMANDS; done" +msgstr "for (( exp1; exp2; exp3 )); do ORDES; done" + +#: builtins.c:186 +msgid "select NAME [in WORDS ... ;] do COMMANDS; done" +msgstr "select NOME [in PALABRAS ... ;] do ORDES; done" + +#: builtins.c:188 +msgid "time [-p] pipeline" +msgstr "time [-p] pipeline" + +#: builtins.c:190 +msgid "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" +msgstr "case PALABRA in [PATRÓN [| PATRÓN]...) ORDES ;;]... esac" + +#: builtins.c:192 +msgid "" +"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else " +"COMMANDS; ] fi" +msgstr "if ORDES; then ORDES; [ elif ORDES; then ORDES; ]...[ else ORDES; ] fi" + +#: builtins.c:194 +msgid "while COMMANDS; do COMMANDS; done" +msgstr "while ORDES; do ORDES; done" + +#: builtins.c:196 +msgid "until COMMANDS; do COMMANDS; done" +msgstr "until ORDES; do ORDES; done" + +#: builtins.c:198 +msgid "coproc [NAME] command [redirections]" +msgstr "coproc [NOME] orden [redireccións]" + +#: builtins.c:200 +msgid "function name { COMMANDS ; } or name () { COMMANDS ; }" +msgstr "function nome { ORDES ; } ou nome () { ORDES ; }" + +#: builtins.c:202 +msgid "{ COMMANDS ; }" +msgstr "{ ORDES ; }" + +#: builtins.c:204 +msgid "job_spec [&]" +msgstr "job_spec [&]" + +#: builtins.c:206 +msgid "(( expression ))" +msgstr "(( expresión ))" + +#: builtins.c:208 +msgid "[[ expression ]]" +msgstr "[[ expresión ]]" + +#: builtins.c:210 +msgid "variables - Names and meanings of some shell variables" +msgstr "variables - Nomes e significados de algunhas variábeis de shell" + +#: builtins.c:213 +msgid "pushd [-n] [+N | -N | dir]" +msgstr "pushd [-n] [+N | -N | dir]" + +#: builtins.c:217 +msgid "popd [-n] [+N | -N]" +msgstr "popd [-n] [+N | -N]" + +#: builtins.c:221 +msgid "dirs [-clpv] [+N] [-N]" +msgstr "dirs [-clpv] [+N] [-N]" + +#: builtins.c:224 +msgid "shopt [-pqsu] [-o] [optname ...]" +msgstr "shopt [-pqsu] [-o] [nome_opción ...]" + +#: builtins.c:226 +msgid "printf [-v var] format [arguments]" +msgstr "printf [-v var] formato [argumentos]" + +#: builtins.c:229 +msgid "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-" +"W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S " +"suffix] [name ...]" +msgstr "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o opción] [-A acción] [-G patglob] [-" +"W listapalabras] [-F función] [-C orde] [-X patfiltro] [-P prefixo] [-S " +"sufixo] [nome ...]" + +#: builtins.c:233 +msgid "" +"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " +"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" +msgstr "" +"compgen [-abcdefgjksuv] [-o opción] [-A acción] [-G patglob] [-W " +"listapalabras] [-F función] [-C orde] [-X patfiltro] [-P prefixo] [-S " +"sufixo] [palabra]" + +#: builtins.c:237 +msgid "compopt [-o|+o option] [-DE] [name ...]" +msgstr "compopt [-o|+o opción] [-DE] [nome ...]" + +#: builtins.c:240 +msgid "" +"mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" +"mapfile [-n conta] [-O orixe] [-s conta] [-t] [-u df] [-C chamada] [-c " +"quantum] [matriz]" + +#: builtins.c:242 +msgid "" +"readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" +"readarray [-n conta] [-O orixe] [-s conta] [-t] [-u df] [-C chamada] [-c " +"quantum] [matriz]" + +#: builtins.c:254 +msgid "" +"Define or display aliases.\n" +" \n" +" Without arguments, `alias' prints the list of aliases in the reusable\n" +" form `alias NAME=VALUE' on standard output.\n" +" \n" +" Otherwise, an alias is defined for each NAME whose VALUE is given.\n" +" A trailing space in VALUE causes the next word to be checked for\n" +" alias substitution when the alias is expanded.\n" +" \n" +" Options:\n" +" -p\tPrint all defined aliases in a reusable format\n" +" \n" +" Exit Status:\n" +" alias returns true unless a NAME is supplied for which no alias has " +"been\n" +" defined." +msgstr "" +"Define ou mostra aliases.\n" +" \n" +" `alias' sen argumentos mostra a lista de aliases na forma\n" +" reutilizábel `alias NOMBRE=VALOR' na saída estándar.\n" +" \n" +" De outra maneira, defínese un alias por cada NOME cuxo VALOR se\n" +" forneza. Un espazo final en VALOR causa que se revise\n" +" a seguinte palabra para substitución de alias cando se expande\n" +" o alias.\n" +" \n" +" Opciones:\n" +" -p\tMuestra todos los aliases definidos en un formato reusable\n" +" \n" +" Estado de salida:\n" +" alias devuelve verdadero a menos que se de un NOMBRE para el cual\n" +" no se haya definido ningún alias." + +#: builtins.c:276 +msgid "" +"Remove each NAME from the list of defined aliases.\n" +" \n" +" Options:\n" +" -a\tremove all alias definitions.\n" +" \n" +" Return success unless a NAME is not an existing alias." +msgstr "" +"Borra cada NOME da lista de alias definidos.\n" +" \n" +" Opcións:\n" +" -a\telimina todas as definicións de alias.\n" +" Devovle verdadero a menos que un NOME non sexa un alias existente." + +#: builtins.c:289 +#, fuzzy +msgid "" +"Set Readline key bindings and variables.\n" +" \n" +" Bind a key sequence to a Readline function or a macro, or set a\n" +" Readline variable. The non-option argument syntax is equivalent to\n" +" that found in ~/.inputrc, but must be passed as a single argument:\n" +" e.g., bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Options:\n" +" -m keymap Use KEYMAP as the keymap for the duration of this\n" +" command. Acceptable keymap names are emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" +"move,\n" +" vi-command, and vi-insert.\n" +" -l List names of functions.\n" +" -P List function names and bindings.\n" +" -p List functions and bindings in a form that can be\n" +" reused as input.\n" +" -S List key sequences that invoke macros and their " +"values\n" +" -s List key sequences that invoke macros and their " +"values\n" +" in a form that can be reused as input.\n" +" -V List variable names and values\n" +" -v List variable names and values in a form that can\n" +" be reused as input.\n" +" -q function-name Query about which keys invoke the named function.\n" +" -u function-name Unbind all keys which are bound to the named " +"function.\n" +" -r keyseq Remove the binding for KEYSEQ.\n" +" -f filename Read key bindings from FILENAME.\n" +" -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when\n" +" \t\t\t\tKEYSEQ is entered.\n" +" -X\t\t List key sequences bound with -x and associated commands\n" +" in a form that can be reused as input.\n" +" \n" +" Exit Status:\n" +" bind returns 0 unless an unrecognized option is given or an error occurs." +msgstr "" +"Estabelece secuencias de teclas Readline e variábeis.\n" +"\n" +" Asigna unha secuencia de teclas a unha función Readline ou a unha macro, " +"ou\n" +" estabelece unha variábel Readline. A sintaxe dos argumentos que\n" +" non son opcións é equivalente á que se encontra en ~/.inputrc,\n" +" pero débese pasar como un só argumento:\n" +" p.e., bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" opcións:\n" +" \n" +" -m comb_teclas Usa COMB_TECLAS como a combinación de teclas pola\n" +" duración desta orde. Os nomes de combinacións\n" +" de teclas aceptábeis son emacs, emacs-standard,\n" +" emacs-meta, emacs-ctlx, vi, vi-move, vi-command e\n" +" vi-insert.\n" +" -l Enlista os nomes das funcións.\n" +" -P Enlista os nomes das funcións e asignacións.\n" +" -p Enlista as funcións e asignacións nunha forma que\n" +" se pode reusar como entrada.\n" +" -S Enlista as secuencias de teclas que invocan macros\n" +" e os seus valores.\n" +" -s Enlista as secuencias de teclas que invocan macros\n" +" e os seus valores nunha forma que se poden reusar " +"como\n" +" entrada.\n" +" -V Enlista os nomes de variábeis e valores.\n" +" -v Enlista os nomes de variábeis e valores nunha\n" +" forma que se pode reusar como entrada.\n" +" -q nome-funcion Pregunta qué teclas invocan a función nomeada.\n" +" -u nome-función Borra todas as teclas que están ligadas\n" +" á función nomeada.\n" +" -r secteclas Borra a asignación para a SECTECLAS.\n" +" -f fichero Lee as asignacións de teclas do FICHERO.\n" +" -x secteclas:orde-shell\tCausa que se execute a ORDE-SHELL cando\n" +" \t\t\t\tse introduce a SECTECLAS.\n" +" \n" +" Estado de saída:\n" +" bind devolve 0 a menos que se presente unha opción descoñecida ou se\n" +" se produza un erro." + +#: builtins.c:328 +msgid "" +"Exit for, while, or until loops.\n" +" \n" +" Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n" +" loops.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Termina ciclos for, while o until.\n" +" \n" +" Termina un ciclo FOR, WHILE o UNTIL. Se se especifica N, remata\n" +" N ciclos anidados.\n" +" \n" +" Estado de saída:\n" +" O estado de saída é 0 a menos que N non sexa maior ou igual a 1." + +#: builtins.c:340 +msgid "" +"Resume for, while, or until loops.\n" +" \n" +" Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n" +" If N is specified, resumes the Nth enclosing loop.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" +"Continúa iteracións for, while o until\n" +" \n" +" Continúa a seguinte iteración do ciclo FOR, WHILE ou UNTIL\n" +" circundante. Se se especifica N, retoma no N-ésimo ciclo circundante.\n" +" \n" +" Estado de Saída:\n" +" O estado de salida é 0 a menos que N non sexa maior ou igual a 1." + +#: builtins.c:352 +msgid "" +"Execute shell builtins.\n" +" \n" +" Execute SHELL-BUILTIN with arguments ARGs without performing command\n" +" lookup. This is useful when you wish to reimplement a shell builtin\n" +" as a shell function, but need to execute the builtin within the " +"function.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n" +" not a shell builtin.." +msgstr "" +"Executa ordes internas do shell\n" +" \n" +" Executa a ORDEN-INTERNA-SHELL cos argumentos ARGs sen realizar\n" +" a busca interna de ordes. Isto é útil cando desexa reimplementar\n" +" unha orde interna do shell como unha función de shell, pero necesita\n" +" executar a orde interna dentro da función.\n" +" \n" +" Estado de Saída:\n" +" Devolve o estado de saída da ORDE-INTERNA-SHELL, ou falso se a\n" +" ORDE-INTERNA-SHELL non é unha orde interna de shell." + +#: builtins.c:367 +msgid "" +"Return the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns \"$line $filename\". With EXPR, returns\n" +" \"$line $subroutine $filename\"; this extra information can be used to\n" +" provide a stack trace.\n" +" \n" +" The value of EXPR indicates how many call frames to go back before the\n" +" current one; the top frame is frame 0.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless the shell is not executing a shell function or EXPR\n" +" is invalid." +msgstr "" +"Devolve o contexto da chamada a subrutina actual.\n" +" \n" +" Sen EXPR, devolve \"$liña $nomeficheiro\". Con EXPR, devolve\n" +" \"$liña $subrutina $nomeficheiro\"; esta información adicional\n" +" pódese usar para fornecer un volcado de pila.\n" +" \n" +" O valor de EXPR indica cantos marcos de chamada se debe retroceder\n" +" antes do actual; o marco inicial é o marco 0.\n" +" \n" +" Estado de Saída:\n" +" Devolve 0 a menos que o shell non estea executando unha función de " +"shell\n" +" ou EXPR sexa non válida." + +#: builtins.c:385 +msgid "" +"Change the shell working directory.\n" +" \n" +" Change the current directory to DIR. The default DIR is the value of " +"the\n" +" HOME shell variable.\n" +" \n" +" The variable CDPATH defines the search path for the directory " +"containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon " +"(:).\n" +" A null directory name is the same as the current directory. If DIR " +"begins\n" +" with a slash (/), then CDPATH is not used.\n" +" \n" +" If the directory is not found, and the shell option `cdable_vars' is " +"set,\n" +" the word is assumed to be a variable name. If that variable has a " +"value,\n" +" its value is used for DIR.\n" +" \n" +" Options:\n" +" -L\tforce symbolic links to be followed: resolve symbolic links in\n" +" \tDIR after processing instances of `..'\n" +" -P\tuse the physical directory structure without following symbolic\n" +" \tlinks: resolve symbolic links in DIR before processing instances\n" +" \tof `..'\n" +" -e\tif the -P option is supplied, and the current working directory\n" +" \tcannot be determined successfully, exit with a non-zero status\n" +" -@ on systems that support it, present a file with extended " +"attributes\n" +" as a directory containing the file attributes\n" +" \n" +" The default is to follow symbolic links, as if `-L' were specified.\n" +" `..' is processed by removing the immediately previous pathname " +"component\n" +" back to a slash or the beginning of DIR.\n" +" \n" +" Exit Status:\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully " +"when\n" +" -P is used; non-zero otherwise." +msgstr "" + +#: builtins.c:422 +msgid "" +"Print the name of the current working directory.\n" +" \n" +" Options:\n" +" -L\tprint the value of $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tprint the physical directory, without any symbolic links\n" +" \n" +" By default, `pwd' behaves as if `-L' were specified.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless an invalid option is given or the current directory\n" +" cannot be read." +msgstr "" +"Mostra o nome do directorio de traballo actual.\n" +" \n" +" Opcións:\n" +" -L\tmostra o valor de $PWD se nomea ao directorio de\n" +" \ttraballo actual\n" +" -P\tmostra o directorio físico, sen ligazóns simbólicas\n" +" \n" +" Por defecto, `pwd' comportase como se se especificara `-L'.\n" +" \n" +" Estado de Saída:\n" +" Devolve 0 a menos que se dea unha opción non válida ou non se poida " +"leer\n" +" o directorio actual." + +#: builtins.c:439 +msgid "" +"Null command.\n" +" \n" +" No effect; the command does nothing.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Orde nula.\n" +" \n" +" Sen efecto; a orde non fai nada.\n" +" \n" +" Estado de Saída:\n" +" Sempre con éxito." + +#: builtins.c:450 +msgid "" +"Return a successful result.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Devolve un resultado con éxito.\n" +" \n" +" Estado de salida:\n" +" Sempre con éxito." + +#: builtins.c:459 +msgid "" +"Return an unsuccessful result.\n" +" \n" +" Exit Status:\n" +" Always fails." +msgstr "" +"Devolve un resultado sen éxito.\n" +" \n" +" Estado de saída:\n" +" Sempre falla." + +#: builtins.c:468 +msgid "" +"Execute a simple command or display information about commands.\n" +" \n" +" Runs COMMAND with ARGS suppressing shell function lookup, or display\n" +" information about the specified COMMANDs. Can be used to invoke " +"commands\n" +" on disk when a function with the same name exists.\n" +" \n" +" Options:\n" +" -p\tuse a default value for PATH that is guaranteed to find all of\n" +" \tthe standard utilities\n" +" -v\tprint a description of COMMAND similar to the `type' builtin\n" +" -V\tprint a more verbose description of each COMMAND\n" +" \n" +" Exit Status:\n" +" Returns exit status of COMMAND, or failure if COMMAND is not found." +msgstr "" + +#: builtins.c:487 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Declare variables and give them attributes. If no NAMEs are given,\n" +" display the attributes and values of all variables.\n" +" \n" +" Options:\n" +" -f\trestrict action or display to function names and definitions\n" +" -F\trestrict display to function names only (plus line number and\n" +" \tsource file when debugging)\n" +" -g\tcreate global variables when used in a shell function; otherwise\n" +" \tignored\n" +" -p\tdisplay the attributes and value of each NAME\n" +" \n" +" Options which set attributes:\n" +" -a\tto make NAMEs indexed arrays (if supported)\n" +" -A\tto make NAMEs associative arrays (if supported)\n" +" -i\tto make NAMEs have the `integer' attribute\n" +" -l\tto convert NAMEs to lower case on assignment\n" +" -n\tmake NAME a reference to the variable named by its value\n" +" -r\tto make NAMEs readonly\n" +" -t\tto make NAMEs have the `trace' attribute\n" +" -u\tto convert NAMEs to upper case on assignment\n" +" -x\tto make NAMEs export\n" +" \n" +" Using `+' instead of `-' turns off the given attribute.\n" +" \n" +" Variables with the integer attribute have arithmetic evaluation (see\n" +" the `let' command) performed when the variable is assigned a value.\n" +" \n" +" When used in a function, `declare' makes NAMEs local, as with the " +"`local'\n" +" command. The `-g' option suppresses this behavior.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or a variable\n" +" assignment error occurs." +msgstr "" + +#: builtins.c:527 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Obsolete. See `help declare'." +msgstr "" +"Estabelece valores de variábeis e atributos.\n" +" \n" +" Obsoleto. Consulte `help declare'." + +#: builtins.c:535 +#, fuzzy +msgid "" +"Define local variables.\n" +" \n" +" Create a local variable called NAME, and give it VALUE. OPTION can\n" +" be any option accepted by `declare'.\n" +" \n" +" Local variables can only be used within a function; they are visible\n" +" only to the function where they are defined and its children.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied, a variable\n" +" assignment error occurs, or the shell is not executing a function." +msgstr "" +"Define variábeis locais.\n" +" \n" +" Crea unha variábel local chamada NOME, e dalle un VALOR. OPCIÓN pode\n" +" ser calquera opción aceptada por `declare'.\n" +" \n" +" As variábeis locais só se pueden usar nunha función; son visibles\n" +" só na función onde se definen e os seus fillos.\n" +" \n" +" Estado de Saída:\n" +" Devolve con éxito a menos que se dea unha opción non válida, se produza\n" +" un erro, ou o shell non estea executando unha función." + +#: builtins.c:552 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs, separated by a single space character and followed by " +"a\n" +" newline, on the standard output.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" -e\tenable interpretation of the following backslash escapes\n" +" -E\texplicitly suppress interpretation of backslash escapes\n" +" \n" +" `echo' interprets the following backslash-escaped characters:\n" +" \\a\talert (bell)\n" +" \\b\tbackspace\n" +" \\c\tsuppress further output\n" +" \\e\tescape character\n" +" \\E\tescape character\n" +" \\f\tform feed\n" +" \\n\tnew line\n" +" \\r\tcarriage return\n" +" \\t\thorizontal tab\n" +" \\v\tvertical tab\n" +" \\\\\tbackslash\n" +" \\0nnn\tthe character whose ASCII code is NNN (octal). NNN can be\n" +" \t0 to 3 octal digits\n" +" \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" +" \tcan be one or two hex digits\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" + +#: builtins.c:588 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs on the standard output followed by a newline.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" + +#: builtins.c:603 +msgid "" +"Enable and disable shell builtins.\n" +" \n" +" Enables and disables builtin shell commands. Disabling allows you to\n" +" execute a disk command which has the same name as a shell builtin\n" +" without using a full pathname.\n" +" \n" +" Options:\n" +" -a\tprint a list of builtins showing whether or not each is enabled\n" +" -n\tdisable each NAME or display a list of disabled builtins\n" +" -p\tprint the list of builtins in a reusable format\n" +" -s\tprint only the names of Posix `special' builtins\n" +" \n" +" Options controlling dynamic loading:\n" +" -f\tLoad builtin NAME from shared object FILENAME\n" +" -d\tRemove a builtin loaded with -f\n" +" \n" +" Without options, each NAME is enabled.\n" +" \n" +" To use the `test' found in $PATH instead of the shell builtin\n" +" version, type `enable -n test'.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not a shell builtin or an error occurs." +msgstr "" + +#: builtins.c:631 +msgid "" +"Execute arguments as a shell command.\n" +" \n" +" Combine ARGs into a single string, use the result as input to the " +"shell,\n" +" and execute the resulting commands.\n" +" \n" +" Exit Status:\n" +" Returns exit status of command or success if command is null." +msgstr "" +"Executa argumentos como unha orde de shell.\n" +" \n" +" Combina os ARGumentos nunha soa cadena, usa o resultado como entrada\n" +" para o shell, e executa as órdenes resultantes.\n" +" \n" +" Estado de saída:\n" +" Devolve o estado de saida da orde ou éxito se a orde é nula." + +#: builtins.c:643 +msgid "" +"Parse option arguments.\n" +" \n" +" Getopts is used by shell procedures to parse positional parameters\n" +" as options.\n" +" \n" +" OPTSTRING contains the option letters to be recognized; if a letter\n" +" is followed by a colon, the option is expected to have an argument,\n" +" which should be separated from it by white space.\n" +" \n" +" Each time it is invoked, getopts will place the next option in the\n" +" shell variable $name, initializing name if it does not exist, and\n" +" the index of the next argument to be processed into the shell\n" +" variable OPTIND. OPTIND is initialized to 1 each time the shell or\n" +" a shell script is invoked. When an option requires an argument,\n" +" getopts places that argument into the shell variable OPTARG.\n" +" \n" +" getopts reports errors in one of two ways. If the first character\n" +" of OPTSTRING is a colon, getopts uses silent error reporting. In\n" +" this mode, no error messages are printed. If an invalid option is\n" +" seen, getopts places the option character found into OPTARG. If a\n" +" required argument is not found, getopts places a ':' into NAME and\n" +" sets OPTARG to the option character found. If getopts is not in\n" +" silent mode, and an invalid option is seen, getopts places '?' into\n" +" NAME and unsets OPTARG. If a required argument is not found, a '?'\n" +" is placed in NAME, OPTARG is unset, and a diagnostic message is\n" +" printed.\n" +" \n" +" If the shell variable OPTERR has the value 0, getopts disables the\n" +" printing of error messages, even if the first character of\n" +" OPTSTRING is not a colon. OPTERR has the value 1 by default.\n" +" \n" +" Getopts normally parses the positional parameters ($0 - $9), but if\n" +" more arguments are given, they are parsed instead.\n" +" \n" +" Exit Status:\n" +" Returns success if an option is found; fails if the end of options is\n" +" encountered or an error occurs." +msgstr "" + +#: builtins.c:685 +msgid "" +"Replace the shell with the given command.\n" +" \n" +" Execute COMMAND, replacing this shell with the specified program.\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not " +"specified,\n" +" any redirections take effect in the current shell.\n" +" \n" +" Options:\n" +" -a name\tpass NAME as the zeroth argument to COMMAND\n" +" -c\t\texecute COMMAND with an empty environment\n" +" -l\t\tplace a dash in the zeroth argument to COMMAND\n" +" \n" +" If the command cannot be executed, a non-interactive shell exits, " +"unless\n" +" the shell option `execfail' is set.\n" +" \n" +" Exit Status:\n" +" Returns success unless COMMAND is not found or a redirection error " +"occurs." +msgstr "" + +#: builtins.c:706 +msgid "" +"Exit the shell.\n" +" \n" +" Exits the shell with a status of N. If N is omitted, the exit status\n" +" is that of the last command executed." +msgstr "" +"Remata a shell.\n" +" \n" +" Termina o shell cun estado de N. Se se omite N, o estado de saída\n" +" é o mismo da última orde executada." + +#: builtins.c:715 +msgid "" +"Exit a login shell.\n" +" \n" +" Exits a login shell with exit status N. Returns an error if not " +"executed\n" +" in a login shell." +msgstr "" +"Termina un shell de entrada.\n" +" \n" +" Termina un shell de entrada cun estado de saída de N. Devolve un\n" +" erro se non se executa nunha shell de entrada." + +#: builtins.c:725 +msgid "" +"Display or execute commands from the history list.\n" +" \n" +" fc is used to list or edit and re-execute commands from the history " +"list.\n" +" FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" +" string, which means the most recent command beginning with that\n" +" string.\n" +" \n" +" Options:\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then " +"EDITOR,\n" +" \t\tthen vi\n" +" -l \tlist lines instead of editing\n" +" -n\tomit line numbers when listing\n" +" -r\treverse the order of the lines (newest listed first)\n" +" \n" +" With the `fc -s [pat=rep ...] [command]' format, COMMAND is\n" +" re-executed after the substitution OLD=NEW is performed.\n" +" \n" +" A useful alias to use with this is r='fc -s', so that typing `r cc'\n" +" runs the last command beginning with `cc' and typing `r' re-executes\n" +" the last command.\n" +" \n" +" Exit Status:\n" +" Returns success or status of executed command; non-zero if an error " +"occurs." +msgstr "" + +#: builtins.c:755 +msgid "" +"Move job to the foreground.\n" +" \n" +" Place the job identified by JOB_SPEC in the foreground, making it the\n" +" current job. If JOB_SPEC is not present, the shell's notion of the\n" +" current job is used.\n" +" \n" +" Exit Status:\n" +" Status of command placed in foreground, or failure if an error occurs." +msgstr "" +"Move o trabañño ao primeiro plano.\n" +" \n" +" Localiza o traballo identificado con IDTRABALLO no primeiro plano, e\n" +" faino o traballo actual. Se IDTRABALLO non está presente, úsase\n" +" a noción do shell do traballo actual.\n" +" \n" +" Estado de Saída:\n" +" O estado da orde localizada en primeiro plano, ou falla se sucede un " +"erro." + +#: builtins.c:770 +msgid "" +"Move jobs to the background.\n" +" \n" +" Place the jobs identified by each JOB_SPEC in the background, as if " +"they\n" +" had been started with `&'. If JOB_SPEC is not present, the shell's " +"notion\n" +" of the current job is used.\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" + +#: builtins.c:784 +msgid "" +"Remember or display program locations.\n" +" \n" +" Determine and remember the full pathname of each command NAME. If\n" +" no arguments are given, information about remembered commands is " +"displayed.\n" +" \n" +" Options:\n" +" -d\t\tforget the remembered location of each NAME\n" +" -l\t\tdisplay in a format that may be reused as input\n" +" -p pathname\tuse PATHNAME as the full pathname of NAME\n" +" -r\t\tforget all remembered locations\n" +" -t\t\tprint the remembered location of each NAME, preceding\n" +" \t\teach location with the corresponding NAME if multiple\n" +" \t\tNAMEs are given\n" +" Arguments:\n" +" NAME\t\tEach NAME is searched for in $PATH and added to the list\n" +" \t\tof remembered commands.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not found or an invalid option is given." +msgstr "" + +#: builtins.c:809 +msgid "" +"Display information about builtin commands.\n" +" \n" +" Displays brief summaries of builtin commands. If PATTERN is\n" +" specified, gives detailed help on all commands matching PATTERN,\n" +" otherwise the list of help topics is printed.\n" +" \n" +" Options:\n" +" -d\toutput short description for each topic\n" +" -m\tdisplay usage in pseudo-manpage format\n" +" -s\toutput only a short usage synopsis for each topic matching\n" +" \tPATTERN\n" +" \n" +" Arguments:\n" +" PATTERN\tPattern specifiying a help topic\n" +" \n" +" Exit Status:\n" +" Returns success unless PATTERN is not found or an invalid option is " +"given." +msgstr "" + +#: builtins.c:833 +msgid "" +"Display or manipulate the history list.\n" +" \n" +" Display the history list with line numbers, prefixing each modified\n" +" entry with a `*'. An argument of N lists only the last N entries.\n" +" \n" +" Options:\n" +" -c\tclear the history list by deleting all of the entries\n" +" -d offset\tdelete the history entry at offset OFFSET.\n" +" \n" +" -a\tappend history lines from this session to the history file\n" +" -n\tread all history lines not already read from the history file\n" +" -r\tread the history file and append the contents to the history\n" +" \tlist\n" +" -w\twrite the current history to the history file\n" +" \tand append them to the history list\n" +" \n" +" -p\tperform history expansion on each ARG and display the result\n" +" \twithout storing it in the history list\n" +" -s\tappend the ARGs to the history list as a single entry\n" +" \n" +" If FILENAME is given, it is used as the history file. Otherwise,\n" +" if $HISTFILE has a value, that is used, else ~/.bash_history.\n" +" \n" +" If the $HISTTIMEFORMAT variable is set and not null, its value is used\n" +" as a format string for strftime(3) to print the time stamp associated\n" +" with each displayed history entry. No time stamps are printed " +"otherwise.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" + +#: builtins.c:869 +msgid "" +"Display status of jobs.\n" +" \n" +" Lists the active jobs. JOBSPEC restricts output to that job.\n" +" Without options, the status of all active jobs is displayed.\n" +" \n" +" Options:\n" +" -l\tlists process IDs in addition to the normal information\n" +" -n\tlists only processes that have changed status since the last\n" +" \tnotification\n" +" -p\tlists process IDs only\n" +" -r\trestrict output to running jobs\n" +" -s\trestrict output to stopped jobs\n" +" \n" +" If -x is supplied, COMMAND is run after all job specifications that\n" +" appear in ARGS have been replaced with the process ID of that job's\n" +" process group leader.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs.\n" +" If -x is used, returns the exit status of COMMAND." +msgstr "" + +#: builtins.c:896 +msgid "" +"Remove jobs from current shell.\n" +" \n" +" Removes each JOBSPEC argument from the table of active jobs. Without\n" +" any JOBSPECs, the shell uses its notion of the current job.\n" +" \n" +" Options:\n" +" -a\tremove all jobs if JOBSPEC is not supplied\n" +" -h\tmark each JOBSPEC so that SIGHUP is not sent to the job if the\n" +" \tshell receives a SIGHUP\n" +" -r\tremove only running jobs\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option or JOBSPEC is given." +msgstr "" + +#: builtins.c:915 +msgid "" +"Send a signal to a job.\n" +" \n" +" Send the processes identified by PID or JOBSPEC the signal named by\n" +" SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n" +" SIGTERM is assumed.\n" +" \n" +" Options:\n" +" -s sig\tSIG is a signal name\n" +" -n sig\tSIG is a signal number\n" +" -l\tlist the signal names; if arguments follow `-l' they are\n" +" \tassumed to be signal numbers for which names should be listed\n" +" \n" +" Kill is a shell builtin for two reasons: it allows job IDs to be used\n" +" instead of process IDs, and allows processes to be killed if the limit\n" +" on processes that you can create is reached.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" + +#: builtins.c:938 +msgid "" +"Evaluate arithmetic expressions.\n" +" \n" +" Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" +" fixed-width integers with no check for overflow, though division by 0\n" +" is trapped and flagged as an error. The following list of operators is\n" +" grouped into levels of equal-precedence operators. The levels are " +"listed\n" +" in order of decreasing precedence.\n" +" \n" +" \tid++, id--\tvariable post-increment, post-decrement\n" +" \t++id, --id\tvariable pre-increment, pre-decrement\n" +" \t-, +\t\tunary minus, plus\n" +" \t!, ~\t\tlogical and bitwise negation\n" +" \t**\t\texponentiation\n" +" \t*, /, %\t\tmultiplication, division, remainder\n" +" \t+, -\t\taddition, subtraction\n" +" \t<<, >>\t\tleft and right bitwise shifts\n" +" \t<=, >=, <, >\tcomparison\n" +" \t==, !=\t\tequality, inequality\n" +" \t&\t\tbitwise AND\n" +" \t^\t\tbitwise XOR\n" +" \t|\t\tbitwise OR\n" +" \t&&\t\tlogical AND\n" +" \t||\t\tlogical OR\n" +" \texpr ? expr : expr\n" +" \t\t\tconditional operator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tassignment\n" +" \n" +" Shell variables are allowed as operands. The name of the variable\n" +" is replaced by its value (coerced to a fixed-width integer) within\n" +" an expression. The variable need not have its integer attribute\n" +" turned on to be used in an expression.\n" +" \n" +" Operators are evaluated in order of precedence. Sub-expressions in\n" +" parentheses are evaluated first and may override the precedence\n" +" rules above.\n" +" \n" +" Exit Status:\n" +" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." +msgstr "" + +#: builtins.c:983 +msgid "" +"Read a line from the standard input and split it into fields.\n" +" \n" +" Reads a single line from the standard input, or from file descriptor FD\n" +" if the -u option is supplied. The line is split into fields as with " +"word\n" +" splitting, and the first word is assigned to the first NAME, the second\n" +" word to the second NAME, and so on, with any leftover words assigned to\n" +" the last NAME. Only the characters found in $IFS are recognized as " +"word\n" +" delimiters.\n" +" \n" +" If no NAMEs are supplied, the line read is stored in the REPLY " +"variable.\n" +" \n" +" Options:\n" +" -a array\tassign the words read to sequential indices of the array\n" +" \t\tvariable ARRAY, starting at zero\n" +" -d delim\tcontinue until the first character of DELIM is read, rather\n" +" \t\tthan newline\n" +" -e\t\tuse Readline to obtain the line in an interactive shell\n" +" -i text\tUse TEXT as the initial text for Readline\n" +" -n nchars\treturn after reading NCHARS characters rather than waiting\n" +" \t\tfor a newline, but honor a delimiter if fewer than NCHARS\n" +" \t\tcharacters are read before the delimiter\n" +" -N nchars\treturn only after reading exactly NCHARS characters, " +"unless\n" +" \t\tEOF is encountered or read times out, ignoring any delimiter\n" +" -p prompt\toutput the string PROMPT without a trailing newline before\n" +" \t\tattempting to read\n" +" -r\t\tdo not allow backslashes to escape any characters\n" +" -s\t\tdo not echo input coming from a terminal\n" +" -t timeout\ttime out and return failure if a complete line of input " +"is\n" +" \t\tnot read within TIMEOUT seconds. The value of the TMOUT\n" +" \t\tvariable is the default timeout. TIMEOUT may be a\n" +" \t\tfractional number. If TIMEOUT is 0, read returns immediately,\n" +" \t\twithout trying to read any data, returning success only if\n" +" \t\tinput is available on the specified file descriptor. The\n" +" \t\texit status is greater than 128 if the timeout is exceeded\n" +" -u fd\t\tread from file descriptor FD instead of the standard input\n" +" \n" +" Exit Status:\n" +" The return code is zero, unless end-of-file is encountered, read times " +"out\n" +" (in which case it's greater than 128), a variable assignment error " +"occurs,\n" +" or an invalid file descriptor is supplied as the argument to -u." +msgstr "" + +#: builtins.c:1028 +msgid "" +"Return from a shell function.\n" +" \n" +" Causes a function or sourced script to exit with the return value\n" +" specified by N. If N is omitted, the return status is that of the\n" +" last command executed within the function or script.\n" +" \n" +" Exit Status:\n" +" Returns N, or failure if the shell is not executing a function or script." +msgstr "" + +#: builtins.c:1041 +msgid "" +"Set or unset values of shell options and positional parameters.\n" +" \n" +" Change the value of shell attributes and positional parameters, or\n" +" display the names and values of shell variables.\n" +" \n" +" Options:\n" +" -a Mark variables which are modified or created for export.\n" +" -b Notify of job termination immediately.\n" +" -e Exit immediately if a command exits with a non-zero status.\n" +" -f Disable file name generation (globbing).\n" +" -h Remember the location of commands as they are looked up.\n" +" -k All assignment arguments are placed in the environment for a\n" +" command, not just those that precede the command name.\n" +" -m Job control is enabled.\n" +" -n Read commands but do not execute them.\n" +" -o option-name\n" +" Set the variable corresponding to option-name:\n" +" allexport same as -a\n" +" braceexpand same as -B\n" +" emacs use an emacs-style line editing interface\n" +" errexit same as -e\n" +" errtrace same as -E\n" +" functrace same as -T\n" +" hashall same as -h\n" +" histexpand same as -H\n" +" history enable command history\n" +" ignoreeof the shell will not exit upon reading EOF\n" +" interactive-comments\n" +" allow comments to appear in interactive commands\n" +" keyword same as -k\n" +" monitor same as -m\n" +" noclobber same as -C\n" +" noexec same as -n\n" +" noglob same as -f\n" +" nolog currently accepted but ignored\n" +" notify same as -b\n" +" nounset same as -u\n" +" onecmd same as -t\n" +" physical same as -P\n" +" pipefail the return value of a pipeline is the status of\n" +" the last command to exit with a non-zero status,\n" +" or zero if no command exited with a non-zero " +"status\n" +" posix change the behavior of bash where the default\n" +" operation differs from the Posix standard to\n" +" match the standard\n" +" privileged same as -p\n" +" verbose same as -v\n" +" vi use a vi-style line editing interface\n" +" xtrace same as -x\n" +" -p Turned on whenever the real and effective user ids do not match.\n" +" Disables processing of the $ENV file and importing of shell\n" +" functions. Turning this option off causes the effective uid and\n" +" gid to be set to the real uid and gid.\n" +" -t Exit after reading and executing one command.\n" +" -u Treat unset variables as an error when substituting.\n" +" -v Print shell input lines as they are read.\n" +" -x Print commands and their arguments as they are executed.\n" +" -B the shell will perform brace expansion\n" +" -C If set, disallow existing regular files to be overwritten\n" +" by redirection of output.\n" +" -E If set, the ERR trap is inherited by shell functions.\n" +" -H Enable ! style history substitution. This flag is on\n" +" by default when the shell is interactive.\n" +" -P If set, do not resolve symbolic links when executing commands\n" +" such as cd which change the current directory.\n" +" -T If set, the DEBUG trap is inherited by shell functions.\n" +" -- Assign any remaining arguments to the positional parameters.\n" +" If there are no remaining arguments, the positional parameters\n" +" are unset.\n" +" - Assign any remaining arguments to the positional parameters.\n" +" The -x and -v options are turned off.\n" +" \n" +" Using + rather than - causes these flags to be turned off. The\n" +" flags can also be used upon invocation of the shell. The current\n" +" set of flags may be found in $-. The remaining n ARGs are positional\n" +" parameters and are assigned, in order, to $1, $2, .. $n. If no\n" +" ARGs are given, all shell variables are printed.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given." +msgstr "" + +#: builtins.c:1126 +msgid "" +"Unset values and attributes of shell variables and functions.\n" +" \n" +" For each NAME, remove the corresponding variable or function.\n" +" \n" +" Options:\n" +" -f\ttreat each NAME as a shell function\n" +" -v\ttreat each NAME as a shell variable\n" +" -n\ttreat each NAME as a name reference and unset the variable itself\n" +" \trather than the variable it references\n" +" \n" +" Without options, unset first tries to unset a variable, and if that " +"fails,\n" +" tries to unset a function.\n" +" \n" +" Some variables cannot be unset; also see `readonly'.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a NAME is read-only." +msgstr "" + +#: builtins.c:1148 +msgid "" +"Set export attribute for shell variables.\n" +" \n" +" Marks each NAME for automatic export to the environment of subsequently\n" +" executed commands. If VALUE is supplied, assign VALUE before " +"exporting.\n" +" \n" +" Options:\n" +" -f\trefer to shell functions\n" +" -n\tremove the export property from each NAME\n" +" -p\tdisplay a list of all exported variables and functions\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" + +#: builtins.c:1167 +msgid "" +"Mark shell variables as unchangeable.\n" +" \n" +" Mark each NAME as read-only; the values of these NAMEs may not be\n" +" changed by subsequent assignment. If VALUE is supplied, assign VALUE\n" +" before marking as read-only.\n" +" \n" +" Options:\n" +" -a\trefer to indexed array variables\n" +" -A\trefer to associative array variables\n" +" -f\trefer to shell functions\n" +" -p\tdisplay a list of all readonly variables or functions, depending " +"on\n" +" whether or not the -f option is given\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" + +#: builtins.c:1189 +msgid "" +"Shift positional parameters.\n" +" \n" +" Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n" +" not given, it is assumed to be 1.\n" +" \n" +" Exit Status:\n" +" Returns success unless N is negative or greater than $#." +msgstr "" + +#: builtins.c:1201 builtins.c:1216 +msgid "" +"Execute commands from a file in the current shell.\n" +" \n" +" Read and execute commands from FILENAME in the current shell. The\n" +" entries in $PATH are used to find the directory containing FILENAME.\n" +" If any ARGUMENTS are supplied, they become the positional parameters\n" +" when FILENAME is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed in FILENAME; fails if\n" +" FILENAME cannot be read." +msgstr "" + +#: builtins.c:1232 +msgid "" +"Suspend shell execution.\n" +" \n" +" Suspend the execution of this shell until it receives a SIGCONT signal.\n" +" Unless forced, login shells cannot be suspended.\n" +" \n" +" Options:\n" +" -f\tforce the suspend, even if the shell is a login shell\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" +"Suspende a execución do shell.\n" +" \n" +" Suspende a execución deste shell até que recibe un sinal SIGCONT.\n" +" Os shells de entrada non se poden suspender, a menos que sexan " +"forzados.\n" +" \n" +" Opcións:\n" +" -f\tforza a suspensión, aínda se o shell é un shell de entrada\n" +" \n" +" Estado de Saída:\n" +" Devolve con éxito a menos que non estea activo o control de traballos o\n" +" se produza un erro." + +#: builtins.c:1248 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" Exits with a status of 0 (true) or 1 (false) depending on\n" +" the evaluation of EXPR. Expressions may be unary or binary. Unary\n" +" expressions are often used to examine the status of a file. There\n" +" are string operators and numeric comparison operators as well.\n" +" \n" +" The behavior of test depends on the number of arguments. Read the\n" +" bash manual page for the complete specification.\n" +" \n" +" File operators:\n" +" \n" +" -a FILE True if file exists.\n" +" -b FILE True if file is block special.\n" +" -c FILE True if file is character special.\n" +" -d FILE True if file is a directory.\n" +" -e FILE True if file exists.\n" +" -f FILE True if file exists and is a regular file.\n" +" -g FILE True if file is set-group-id.\n" +" -h FILE True if file is a symbolic link.\n" +" -L FILE True if file is a symbolic link.\n" +" -k FILE True if file has its `sticky' bit set.\n" +" -p FILE True if file is a named pipe.\n" +" -r FILE True if file is readable by you.\n" +" -s FILE True if file exists and is not empty.\n" +" -S FILE True if file is a socket.\n" +" -t FD True if FD is opened on a terminal.\n" +" -u FILE True if the file is set-user-id.\n" +" -w FILE True if the file is writable by you.\n" +" -x FILE True if the file is executable by you.\n" +" -O FILE True if the file is effectively owned by you.\n" +" -G FILE True if the file is effectively owned by your group.\n" +" -N FILE True if the file has been modified since it was last " +"read.\n" +" \n" +" FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" +" modification date).\n" +" \n" +" FILE1 -ot FILE2 True if file1 is older than file2.\n" +" \n" +" FILE1 -ef FILE2 True if file1 is a hard link to file2.\n" +" \n" +" String operators:\n" +" \n" +" -z STRING True if string is empty.\n" +" \n" +" -n STRING\n" +" STRING True if string is not empty.\n" +" \n" +" STRING1 = STRING2\n" +" True if the strings are equal.\n" +" STRING1 != STRING2\n" +" True if the strings are not equal.\n" +" STRING1 < STRING2\n" +" True if STRING1 sorts before STRING2 " +"lexicographically.\n" +" STRING1 > STRING2\n" +" True if STRING1 sorts after STRING2 lexicographically.\n" +" \n" +" Other operators:\n" +" \n" +" -o OPTION True if the shell option OPTION is enabled.\n" +" -v VAR\t True if the shell variable VAR is set\n" +" -R VAR\t True if the shell variable VAR is set and is a name " +"reference.\n" +" ! EXPR True if expr is false.\n" +" EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n" +" EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n" +" \n" +" arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Arithmetic binary operators return true if ARG1 is equal, not-equal,\n" +" less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n" +" than ARG2.\n" +" \n" +" Exit Status:\n" +" Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n" +" false or an invalid argument is given." +msgstr "" + +#: builtins.c:1329 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" This is a synonym for the \"test\" builtin, but the last argument must\n" +" be a literal `]', to match the opening `['." +msgstr "" +"Evalúa unha expresión condicional.\n" +" \n" +" Este é un sinónimo para a orde interna \"test\", pero o último\n" +" argumento debe ser un `]' literal, que coincida co `[' inicial." + +#: builtins.c:1338 +msgid "" +"Display process times.\n" +" \n" +" Prints the accumulated user and system times for the shell and all of " +"its\n" +" child processes.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Mostra os tempos de proceso.\n" +" \n" +" Mostra os tempos de usuario e sistema acumulados polo shell e todos\n" +" os seus procesos fillos.\n" +" \n" +" Estado de saída:\n" +" Sempre con éxito." + +#: builtins.c:1350 +msgid "" +"Trap signals and other events.\n" +" \n" +" Defines and activates handlers to be run when the shell receives " +"signals\n" +" or other conditions.\n" +" \n" +" ARG is a command to be read and executed when the shell receives the\n" +" signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n" +" is supplied) or `-', each specified signal is reset to its original\n" +" value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" +" shell and by the commands it invokes.\n" +" \n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. " +"If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. " +"If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or " +"a\n" +" script run by the . or source builtins finishes executing. A " +"SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause " +"the\n" +" shell to exit when the -e option is enabled.\n" +" \n" +" If no arguments are supplied, trap prints the list of commands " +"associated\n" +" with each signal.\n" +" \n" +" Options:\n" +" -l\tprint a list of signal names and their corresponding numbers\n" +" -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" +" \n" +" Each SIGNAL_SPEC is either a signal name in or a signal " +"number.\n" +" Signal names are case insensitive and the SIG prefix is optional. A\n" +" signal may be sent to the shell with \"kill -signal $$\".\n" +" \n" +" Exit Status:\n" +" Returns success unless a SIGSPEC is invalid or an invalid option is " +"given." +msgstr "" + +#: builtins.c:1386 +msgid "" +"Display information about command type.\n" +" \n" +" For each NAME, indicate how it would be interpreted if used as a\n" +" command name.\n" +" \n" +" Options:\n" +" -a\tdisplay all locations containing an executable named NAME;\n" +" \tincludes aliases, builtins, and functions, if and only if\n" +" \tthe `-p' option is not also used\n" +" -f\tsuppress shell function lookup\n" +" -P\tforce a PATH search for each NAME, even if it is an alias,\n" +" \tbuiltin, or function, and returns the name of the disk file\n" +" \tthat would be executed\n" +" -p\treturns either the name of the disk file that would be executed,\n" +" \tor nothing if `type -t NAME' would not return `file'.\n" +" -t\toutput a single word which is one of `alias', `keyword',\n" +" \t`function', `builtin', `file' or `', if NAME is an alias, shell\n" +" \treserved word, shell function, shell builtin, disk file, or not\n" +" \tfound, respectively\n" +" \n" +" Arguments:\n" +" NAME\tCommand name to be interpreted.\n" +" \n" +" Exit Status:\n" +" Returns success if all of the NAMEs are found; fails if any are not " +"found." +msgstr "" + +#: builtins.c:1417 +msgid "" +"Modify shell resource limits.\n" +" \n" +" Provides control over the resources available to the shell and " +"processes\n" +" it creates, on systems that allow such control.\n" +" \n" +" Options:\n" +" -S\tuse the `soft' resource limit\n" +" -H\tuse the `hard' resource limit\n" +" -a\tall current limits are reported\n" +" -b\tthe socket buffer size\n" +" -c\tthe maximum size of core files created\n" +" -d\tthe maximum size of a process's data segment\n" +" -e\tthe maximum scheduling priority (`nice')\n" +" -f\tthe maximum size of files written by the shell and its children\n" +" -i\tthe maximum number of pending signals\n" +" -l\tthe maximum size a process may lock into memory\n" +" -m\tthe maximum resident set size\n" +" -n\tthe maximum number of open file descriptors\n" +" -p\tthe pipe buffer size\n" +" -q\tthe maximum number of bytes in POSIX message queues\n" +" -r\tthe maximum real-time scheduling priority\n" +" -s\tthe maximum stack size\n" +" -t\tthe maximum amount of cpu time in seconds\n" +" -u\tthe maximum number of user processes\n" +" -v\tthe size of virtual memory\n" +" -x\tthe maximum number of file locks\n" +" -T the maximum number of threads\n" +" \n" +" Not all options are available on all platforms.\n" +" \n" +" If LIMIT is given, it is the new value of the specified resource; the\n" +" special LIMIT values `soft', `hard', and `unlimited' stand for the\n" +" current soft limit, the current hard limit, and no limit, respectively.\n" +" Otherwise, the current value of the specified resource is printed. If\n" +" no option is given, then -f is assumed.\n" +" \n" +" Values are in 1024-byte increments, except for -t, which is in seconds,\n" +" -p, which is in increments of 512 bytes, and -u, which is an unscaled\n" +" number of processes.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1465 +msgid "" +"Display or set file mode mask.\n" +" \n" +" Sets the user file-creation mask to MODE. If MODE is omitted, prints\n" +" the current value of the mask.\n" +" \n" +" If MODE begins with a digit, it is interpreted as an octal number;\n" +" otherwise it is a symbolic mode string like that accepted by chmod(1).\n" +" \n" +" Options:\n" +" -p\tif MODE is omitted, output in a form that may be reused as input\n" +" -S\tmakes the output symbolic; otherwise an octal number is output\n" +" \n" +" Exit Status:\n" +" Returns success unless MODE is invalid or an invalid option is given." +msgstr "" + +#: builtins.c:1485 +#, fuzzy +msgid "" +"Wait for job completion and return exit status.\n" +" \n" +" Waits for each process identified by an ID, which may be a process ID or " +"a\n" +" job specification, and reports its termination status. If ID is not\n" +" given, waits for all currently active child processes, and the return\n" +" status is zero. If ID is a a job specification, waits for all " +"processes\n" +" in that job's pipeline.\n" +" \n" +" If the -n option is supplied, waits for the next job to terminate and\n" +" returns its exit status.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last ID; fails if ID is invalid or an invalid\n" +" option is given." +msgstr "" +"Agarda a terminación do traballo e devolve o estado de saída.\n" +" \n" +" Espera ao proceso especificado e reporta o seu estado de saída. Se\n" +" non se fornece un PID, agarda a todos os procesos fillo activos,\n" +" e o código de devolución é cero. PID debe ser un ID de proceso.\n" +" \n" +" Estado de Saída:\n" +" Devolve o estado de ID; falla se ID non é válido ou se se fornece unha\n" +" opción non válida." + +#: builtins.c:1506 +#, fuzzy +msgid "" +"Wait for process completion and return exit status.\n" +" \n" +" Waits for each process specified by a PID and reports its termination " +"status.\n" +" If PID is not given, waits for all currently active child processes,\n" +" and the return status is zero. PID must be a process ID.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last PID; fails if PID is invalid or an " +"invalid\n" +" option is given." +msgstr "" +"Agarda a terminación do traballo e devolve o estado de saída.\n" +" \n" +" Espera ao proceso especificado e reporta o seu estado de saída. Se\n" +" non se fornece un PID, agarda a todos os procesos fillo activos,\n" +" e o código de devolución é cero. PID debe ser un ID de proceso.\n" +" \n" +" Estado de Saída:\n" +" Devolve o estado de ID; falla se ID non é válido ou se se fornece unha\n" +" opción non válida." + +#: builtins.c:1521 +msgid "" +"Execute commands for each member in a list.\n" +" \n" +" The `for' loop executes a sequence of commands for each member in a\n" +" list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is\n" +" assumed. For each element in WORDS, NAME is set to that element, and\n" +" the COMMANDS are executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Executa ordes por cada membro nunha lista.\n" +" \n" +" O ciclo `for' executa unha secuencia de ordes para cada membro nunha\n" +" lista de elementos. Se `in PALABRAS ...;' non está presente,\n" +" entón asúmese `in \"$@\"'. Para cada elemento en PALABRAS,\n" +" defínese NOME como ese elemento, e execútanse as ÓRDENES.\n" +" \n" +" Estado de Saída:\n" +" Devuelve o estado da última orden executada." + +#: builtins.c:1535 +msgid "" +"Arithmetic for loop.\n" +" \n" +" Equivalent to\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n" +" omitted, it behaves as if it evaluates to 1.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Aritmética para un ciclo.\n" +" \n" +" Equivalente a\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tORDES\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, e EXP3 son expresións aritméticas. Se se omite\n" +" calquera expresión, compórtase como se se evaluara a 1.\n" +" \n" +" Estado de saída:\n" +" Devolve o estado da última orde executada." + +#: builtins.c:1553 +msgid "" +"Select words from a list and execute commands.\n" +" \n" +" The WORDS are expanded, generating a list of words. The\n" +" set of expanded words is printed on the standard error, each\n" +" preceded by a number. If `in WORDS' is not present, `in \"$@\"'\n" +" is assumed. The PS3 prompt is then displayed and a line read\n" +" from the standard input. If the line consists of the number\n" +" corresponding to one of the displayed words, then NAME is set\n" +" to that word. If the line is empty, WORDS and the prompt are\n" +" redisplayed. If EOF is read, the command completes. Any other\n" +" value read causes NAME to be set to null. The line read is saved\n" +" in the variable REPLY. COMMANDS are executed after each selection\n" +" until a break command is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1574 +msgid "" +"Report time consumed by pipeline's execution.\n" +" \n" +" Execute PIPELINE and print a summary of the real time, user CPU time,\n" +" and system CPU time spent executing PIPELINE when it terminates.\n" +" \n" +" Options:\n" +" -p\tprint the timing summary in the portable Posix format\n" +" \n" +" The value of the TIMEFORMAT variable is used as the output format.\n" +" \n" +" Exit Status:\n" +" The return status is the return status of PIPELINE." +msgstr "" + +#: builtins.c:1591 +msgid "" +"Execute commands based on pattern matching.\n" +" \n" +" Selectively execute COMMANDS based upon WORD matching PATTERN. The\n" +" `|' is used to separate multiple patterns.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Executa ordes en base á coincidencia de patróns.\n" +" \n" +" Executa ÓRDENES selectivamente baseado en coincidencias da PALABRA\n" +" co PATRÓN. Emprégase `|' para separar patróns múltiples.\n" +" \n" +" Estado de Saída:\n" +" Devolve o estado da última orde executada." + +#: builtins.c:1603 +msgid "" +"Execute commands based on conditional.\n" +" \n" +" The `if COMMANDS' list is executed. If its exit status is zero, then " +"the\n" +" `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list " +"is\n" +" executed in turn, and if its exit status is zero, the corresponding\n" +" `then COMMANDS' list is executed and the if command completes. " +"Otherwise,\n" +" the `else COMMANDS' list is executed, if present. The exit status of " +"the\n" +" entire construct is the exit status of the last command executed, or " +"zero\n" +" if no condition tested true.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1620 +msgid "" +"Execute commands as long as a test succeeds.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `while' COMMANDS has an exit status of zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Ejecuta ordes mentres unha proba teña éxito.\n" +" \n" +" Expande e executa ORDES mentres a orde final nas ÓRDENES\n" +" `while' teña un estado de saída de cero.\n" +" \n" +" Estado de Saída:\n" +" Devolve o estado da última orde executada." + +#: builtins.c:1632 +msgid "" +"Execute commands as long as a test does not succeed.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `until' COMMANDS has an exit status which is not zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Executa ordes mentres unha proba non teña éxito.\n" +" \n" +" Expande e executa ORDES mentres a orde final nas ORDES\n" +" `until' teña un estado de saída que non sexa cero.\n" +" \n" +" Estado de Saída:\n" +" Devolve o estado da última orde executada." + +#: builtins.c:1644 +msgid "" +"Create a coprocess named NAME.\n" +" \n" +" Execute COMMAND asynchronously, with the standard output and standard\n" +" input of the command connected via a pipe to file descriptors assigned\n" +" to indices 0 and 1 of an array variable NAME in the executing shell.\n" +" The default NAME is \"COPROC\".\n" +" \n" +" Exit Status:\n" +" Returns the exit status of COMMAND." +msgstr "" +"Crea un coproceso chamado NOME.\n" +" \n" +" Executa a ORDE asíncronamente, coa saída estándar e a entrada\n" +" estándar da orde contectada a través dunha tubería aos descritores\n" +" de ficheiro asignados aos índices 0 e 1 dunha variábel de matriz NOME\n" +" no shell en execución. O nome por omisión é \"COPROC\".\n" +" \n" +" Estado de Saída:\n" +" Devolve o estado de saída da ORDE." + +#: builtins.c:1658 +msgid "" +"Define shell function.\n" +" \n" +" Create a shell function named NAME. When invoked as a simple command,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is " +"invoked,\n" +" the arguments are passed to the function as $1...$n, and the function's\n" +" name is in $FUNCNAME.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is readonly." +msgstr "" + +#: builtins.c:1672 +msgid "" +"Group commands as a unit.\n" +" \n" +" Run a set of commands in a group. This is one way to redirect an\n" +" entire set of commands.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" +"Agrupa ordes como unha unidade.\n" +" \n" +" Executa un conxunto de ordes nun grupo. Esta é unha forma de\n" +" redirixir un conxunto completo de ordes.\n" +" \n" +" Estado de Saída:\n" +" Devolve o estado da última orde executada." + +#: builtins.c:1684 +msgid "" +"Resume job in foreground.\n" +" \n" +" Equivalent to the JOB_SPEC argument to the `fg' command. Resume a\n" +" stopped or background job. JOB_SPEC can specify either a job name\n" +" or a job number. Following JOB_SPEC with a `&' places the job in\n" +" the background, as if the job specification had been supplied as an\n" +" argument to `bg'.\n" +" \n" +" Exit Status:\n" +" Returns the status of the resumed job." +msgstr "" + +#: builtins.c:1699 +msgid "" +"Evaluate arithmetic expression.\n" +" \n" +" The EXPRESSION is evaluated according to the rules for arithmetic\n" +" evaluation. Equivalent to \"let EXPRESSION\".\n" +" \n" +" Exit Status:\n" +" Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise." +msgstr "" +"Avalí unha expresión aritmética.\n" +" \n" +" Avalíase a EXPRESIÓN de acordo ás regras de evaluación\n" +" aritmética. Equivalente a \"let EXPRESIÓN\".\n" +" \n" +" Estado de Saída:\n" +" Devolve 1 se a EXPRESIÓN avalía a 0; devovle 0 de outra maneira." + +#: builtins.c:1711 +msgid "" +"Execute conditional command.\n" +" \n" +" Returns a status of 0 or 1 depending on the evaluation of the " +"conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries " +"used\n" +" by the `test' builtin, and may be combined using the following " +"operators:\n" +" \n" +" ( EXPRESSION )\tReturns the value of EXPRESSION\n" +" ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" +" EXPR1 && EXPR2\tTrue if both EXPR1 and EXPR2 are true; else false\n" +" EXPR1 || EXPR2\tTrue if either EXPR1 or EXPR2 is true; else false\n" +" \n" +" When the `==' and `!=' operators are used, the string to the right of\n" +" the operator is used as a pattern and pattern matching is performed.\n" +" When the `=~' operator is used, the string to the right of the operator\n" +" is matched as a regular expression.\n" +" \n" +" The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n" +" determine the expression's value.\n" +" \n" +" Exit Status:\n" +" 0 or 1 depending on value of EXPRESSION." +msgstr "" + +#: builtins.c:1737 +msgid "" +"Common shell variable names and usage.\n" +" \n" +" BASH_VERSION\tVersion information for this Bash.\n" +" CDPATH\tA colon-separated list of directories to search\n" +" \t\tfor directories given as arguments to `cd'.\n" +" GLOBIGNORE\tA colon-separated list of patterns describing filenames to\n" +" \t\tbe ignored by pathname expansion.\n" +" HISTFILE\tThe name of the file where your command history is stored.\n" +" HISTFILESIZE\tThe maximum number of lines this file can contain.\n" +" HISTSIZE\tThe maximum number of history lines that a running\n" +" \t\tshell can access.\n" +" HOME\tThe complete pathname to your login directory.\n" +" HOSTNAME\tThe name of the current host.\n" +" HOSTTYPE\tThe type of CPU this version of Bash is running under.\n" +" IGNOREEOF\tControls the action of the shell on receipt of an EOF\n" +" \t\tcharacter as the sole input. If set, then the value\n" +" \t\tof it is the number of EOF characters that can be seen\n" +" \t\tin a row on an empty line before the shell will exit\n" +" \t\t(default 10). When unset, EOF signifies the end of input.\n" +" MACHTYPE\tA string describing the current system Bash is running on.\n" +" MAILCHECK\tHow often, in seconds, Bash checks for new mail.\n" +" MAILPATH\tA colon-separated list of filenames which Bash checks\n" +" \t\tfor new mail.\n" +" OSTYPE\tThe version of Unix this version of Bash is running on.\n" +" PATH\tA colon-separated list of directories to search when\n" +" \t\tlooking for commands.\n" +" PROMPT_COMMAND\tA command to be executed before the printing of each\n" +" \t\tprimary prompt.\n" +" PS1\t\tThe primary prompt string.\n" +" PS2\t\tThe secondary prompt string.\n" +" PWD\t\tThe full pathname of the current directory.\n" +" SHELLOPTS\tA colon-separated list of enabled shell options.\n" +" TERM\tThe name of the current terminal type.\n" +" TIMEFORMAT\tThe output format for timing statistics displayed by the\n" +" \t\t`time' reserved word.\n" +" auto_resume\tNon-null means a command word appearing on a line by\n" +" \t\titself is first looked for in the list of currently\n" +" \t\tstopped jobs. If found there, that job is foregrounded.\n" +" \t\tA value of `exact' means that the command word must\n" +" \t\texactly match a command in the list of stopped jobs. A\n" +" \t\tvalue of `substring' means that the command word must\n" +" \t\tmatch a substring of the job. Any other value means that\n" +" \t\tthe command must be a prefix of a stopped job.\n" +" histchars\tCharacters controlling history expansion and quick\n" +" \t\tsubstitution. The first character is the history\n" +" \t\tsubstitution character, usually `!'. The second is\n" +" \t\tthe `quick substitution' character, usually `^'. The\n" +" \t\tthird is the `history comment' character, usually `#'.\n" +" HISTIGNORE\tA colon-separated list of patterns used to decide which\n" +" \t\tcommands should be saved on the history list.\n" +msgstr "" + +#: builtins.c:1794 +msgid "" +"Add directories to stack.\n" +" \n" +" Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" + +#: builtins.c:1828 +msgid "" +"Remove directories from stack.\n" +" \n" +" Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" + +#: builtins.c:1858 +msgid "" +"Display directory stack.\n" +" \n" +" Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1887 +msgid "" +"Set and unset shell options.\n" +" \n" +" Change the setting of each shell option OPTNAME. Without any option\n" +" arguments, list all shell options with an indication of whether or not " +"each\n" +" is set.\n" +" \n" +" Options:\n" +" -o\trestrict OPTNAMEs to those defined for use with `set -o'\n" +" -p\tprint each shell option with an indication of its status\n" +" -q\tsuppress output\n" +" -s\tenable (set) each OPTNAME\n" +" -u\tdisable (unset) each OPTNAME\n" +" \n" +" Exit Status:\n" +" Returns success if OPTNAME is enabled; fails if an invalid option is\n" +" given or OPTNAME is disabled." +msgstr "" +"Activa e desactiva opcións de shell.\n" +" \n" +" Cambia a configuración de cada opción de shell NOME_OPCIÓN. Sen\n" +" algunha opción como argumento, mostra todas as opcións de shell cunha\n" +" indicación se está activa ou non.\n" +" \n" +" Opcións:\n" +" -o\trestrinxe NOME_OPCIÓN a aqueles definidos con `set -o'\n" +" -p\tmostra cada opción de shell cun indicador do seu estado\n" +" -q\tsuprime a saída\n" +" -s\tactiva (estabelece) cada NOME_OPCIÓN\n" +" -u\tdesactiva (borra) cada NOME_OPCIÓN\n" +" \n" +" Estado de Saída:\n" +" Devolve con éxito se se activa NOME_OPCIÓN; falla se se fornece\n" +" unha opción non válida ou NOME_OPCIÓN está desactivado." + +#: builtins.c:1908 +msgid "" +"Formats and prints ARGUMENTS under control of the FORMAT.\n" +" \n" +" Options:\n" +" -v var\tassign the output to shell variable VAR rather than\n" +" \t\tdisplay it on the standard output\n" +" \n" +" FORMAT is a character string which contains three types of objects: " +"plain\n" +" characters, which are simply copied to standard output; character " +"escape\n" +" sequences, which are converted and copied to the standard output; and\n" +" format specifications, each of which causes printing of the next " +"successive\n" +" argument.\n" +" \n" +" In addition to the standard format specifications described in " +"printf(1),\n" +" printf interprets:\n" +" \n" +" %b\texpand backslash escape sequences in the corresponding argument\n" +" %q\tquote the argument in a way that can be reused as shell input\n" +" %(fmt)T output the date-time string resulting from using FMT as a " +"format\n" +" string for strftime(3)\n" +" \n" +" The format is re-used as necessary to consume all of the arguments. If\n" +" there are fewer arguments than the format requires, extra format\n" +" specifications behave as if a zero value or null string, as " +"appropriate,\n" +" had been supplied.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a write or " +"assignment\n" +" error occurs." +msgstr "" + +#: builtins.c:1942 +msgid "" +"Specify how arguments are to be completed by Readline.\n" +" \n" +" For each NAME, specify how arguments are to be completed. If no " +"options\n" +" are supplied, existing completion specifications are printed in a way " +"that\n" +" allows them to be reused as input.\n" +" \n" +" Options:\n" +" -p\tprint existing completion specifications in a reusable format\n" +" -r\tremove a completion specification for each NAME, or, if no\n" +" \tNAMEs are supplied, all completion specifications\n" +" -D\tapply the completions and actions as the default for commands\n" +" \twithout any specific completion defined\n" +" -E\tapply the completions and actions to \"empty\" commands --\n" +" \tcompletion attempted on a blank line\n" +" \n" +" When completion is attempted, the actions are applied in the order the\n" +" uppercase-letter options are listed above. The -D option takes\n" +" precedence over -E.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1970 +msgid "" +"Display possible completions depending on the options.\n" +" \n" +" Intended to be used from within a shell function generating possible\n" +" completions. If the optional WORD argument is supplied, matches " +"against\n" +" WORD are generated.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" +"Mostra os posíbeis completados dependendo das opcións.\n" +" \n" +" Serve para usarse desde unha función de shell que xere completados\n" +" posíbeis. Se se fornece o argumento opcional PALABRA, xéranse\n" +" as coincidencias contra PALABRA.\n" +" \n" +" Estado de Saída:\n" +" Devolve con éxito a menos que se forneza unha opción non válida o\n" +" se produza un erro." + +#: builtins.c:1985 +msgid "" +"Modify or display completion options.\n" +" \n" +" Modify the completion options for each NAME, or, if no NAMEs are " +"supplied,\n" +" the completion currently being executed. If no OPTIONs are given, " +"print\n" +" the completion options for each NAME or the current completion " +"specification.\n" +" \n" +" Options:\n" +" \t-o option\tSet completion option OPTION for each NAME\n" +" \t-D\t\tChange options for the \"default\" command completion\n" +" \t-E\t\tChange options for the \"empty\" command completion\n" +" \n" +" Using `+o' instead of `-o' turns off the specified option.\n" +" \n" +" Arguments:\n" +" \n" +" Each NAME refers to a command for which a completion specification must\n" +" have previously been defined using the `complete' builtin. If no NAMEs\n" +" are supplied, compopt must be called by a function currently generating\n" +" completions, and the options for that currently-executing completion\n" +" generator are modified.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or NAME does not\n" +" have a completion specification defined." +msgstr "" + +#: builtins.c:2015 +msgid "" +"Read lines from the standard input into an indexed array variable.\n" +" \n" +" Read lines from the standard input into the indexed array variable " +"ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable " +"MAPFILE\n" +" is the default ARRAY.\n" +" \n" +" Options:\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are " +"copied.\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default " +"index is 0.\n" +" -s count \tDiscard the first COUNT lines read.\n" +" -t\t\tRemove a trailing newline from each line read.\n" +" -u fd\t\tRead lines from file descriptor FD instead of the standard " +"input.\n" +" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read.\n" +" -c quantum\tSpecify the number of lines read between each call to " +"CALLBACK.\n" +" \n" +" Arguments:\n" +" ARRAY\t\tArray variable name to use for file data.\n" +" \n" +" If -C is supplied without -c, the default quantum is 5000. When\n" +" CALLBACK is evaluated, it is supplied the index of the next array\n" +" element to be assigned and the line to be assigned to that element\n" +" as additional arguments.\n" +" \n" +" If not supplied with an explicit origin, mapfile will clear ARRAY " +"before\n" +" assigning to it.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or ARRAY is readonly " +"or\n" +" not an indexed array." +msgstr "" + +#: builtins.c:2049 +msgid "" +"Read lines from a file into an array variable.\n" +" \n" +" A synonym for `mapfile'." +msgstr "" +"Lee liñas dun fichero nunha variábel de matriz.\n" +" \n" +" Un sinónimo de `mapfile'." + +#~ msgid "Copyright (C) 2009 Free Software Foundation, Inc.\n" +#~ msgstr "Copyright (C) 2009 Free Software Foundation, Inc.\n" + +#~ msgid "" +#~ "License GPLv2+: GNU GPL version 2 or later \n" +#~ msgstr "" +#~ "Licenza GPLv2+: GPL de GNU versión 2 ou posterior \n" + +#~ msgid "wait [pid]" +#~ msgstr "wait [pid]" diff --git a/po/hr.gmo b/po/hr.gmo new file mode 100644 index 0000000000000000000000000000000000000000..40d6910fae0366a164d102c12bc8917547a56d76 GIT binary patch literal 34075 zcmbuH34k0&dGFgCwzc3J-^Ol9UQ4nytCeIMdnMV{X$k8>hY!iJws)s@w|8fzhneY> zR`>;TJp&Ju*fD_@a1s*&dC5!cyd>}l;NT!bE)pPINeBc87(##~fb)O=`TgtY?wMU3 z@W!tFcURZ>)mPv5)mK&e{JGD0Q^2owN)TKI-ut{Dc$(+WU7*+?IDB~!Tn)~Eec(I5 zGr`BeQ^6-d{tuqw&kMkR0g8e9e530?_43=V|>0k{CX z4OIIZpy==_Q1$;BxDtE<48eZ~uL92_lW+)J21X7a1l8Xs9exHJ;QgDR=ycga+m2P> zMZE6<)$S=!_1zDuU%vs8C3vrU{~UNW@Ba!a-6?cV^;`j}{_EU(?C@ov==dO50pH=` zKLM(LUjtR%bNd-1@B&cpgCHah)`FsI1gf1gAYBh00+s&{z$M_v!Arm&f}-yQ5JmM? zK;^#$RDbRS)$SS?g0BZv-fx3S|4|qJkD$sqWl<2E0bT@(K39Qi*E&$?M?mpK=H6ce zD&Jc`)%zHzetiT~`@aaPoj(9o?)eP9+OrTe{ROEyh+O<@LDBb}4&M)o?>_-5-4{Xe z#pw`1^jHn5op*uaqYPv!1+NE1*Ixpa|6QQ!e>Zp|cobwvgCB#ZfD4#x>c^F!=E*8h zc>f)T?*TOqPlBg|p8{`wb`X3Xd=BrI!=#E| z2&$f?;A!A$@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qh&AJ#%Ky0T(KjD{_SlOM_W=jE7v^=PV14##l;|ME(A3}VEZ=vY0*YRgV0jkv;C zdr~#>otgvXOjIM=<}Bfug->BS9w()v$Yj+cXo9{D$riBlVq6H>8|FRf>s?P zU4E*nWHNYf-JHed&cv<^`Ko7*JcZS4QZ-nI^bS&2dznev1@KmI!0iam%}H+B6E$L+ zT%wuP2A5|@;_X`wgdo?;xAMG_mnUuR%Xu=p_v??jnpYZ*B-G_Rtv)D{b5>fbK>Gtu zua|gacDiC?4hz@#=FEmvaDw8yvZ*q&Ch5xLE%}_U3LdxXP?+5hiB|5VW*#T2IsA1J zIrI5+(skuIPEduLXT}%i^5`~GZ}r$)&=H%U62#<8x=Yt;nB4 z?^^NC-N4=giXlY{>Wnd6vroAkbDfTZ!hx?yrcMbV# zdfeobRp(U<9xXNt(IPnJunuS4=PQ};%(s#|BH-8`+e4a>vd2p=&UsjlatAWG=O-s^ z6~$)Gxa%|ndTWYR5^jF%>rUKNlFzp3#M!*5VLf!#EG*yUJHchC+4uffu&}J3##oak Ja#AP@{tIZ#UE2Tv literal 0 HcmV?d00001 diff --git a/po/hr.po b/po/hr.po new file mode 100644 index 0000000..99f2d67 --- /dev/null +++ b/po/hr.po @@ -0,0 +1,4125 @@ +# Translation of bash to Croatian. +# Copyright © 2012 Free Software Foundation, Inc. +# This file is distributed under the same license as the bash package. +# Tomislav Krznar , 2012, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: bash 4.2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-02-11 11:19-0500\n" +"PO-Revision-Date: 2013-04-18 01:00+0200\n" +"Last-Translator: Tomislav Krznar \n" +"Language-Team: Croatian \n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Gtranslator 2.91.6\n" + +#: arrayfunc.c:51 +msgid "bad array subscript" +msgstr "neispravan indeks polja" + +#: arrayfunc.c:356 builtins/declare.def:566 +#, c-format +msgid "%s: cannot convert indexed to associative array" +msgstr "%s: ne mogu pretvoriti indeksirano u asocijativno polje" + +#: arrayfunc.c:539 +#, c-format +msgid "%s: invalid associative array key" +msgstr "%s: neispravan ključ asocijativnog polja" + +#: arrayfunc.c:541 +#, c-format +msgid "%s: cannot assign to non-numeric index" +msgstr "%s: ne mogu pridružiti nenumeričkom indeksu" + +#: arrayfunc.c:586 +#, c-format +msgid "%s: %s: must use subscript when assigning associative array" +msgstr "%s: %s: mora koristiti indeks pri pridruživanju asocijativnog polja" + +#: bashhist.c:388 +#, c-format +msgid "%s: cannot create: %s" +msgstr "%s: ne mogu napraviti: %s" + +#: bashline.c:3982 +msgid "bash_execute_unix_command: cannot find keymap for command" +msgstr "bash_execute_unix_command: ne mogu pronaći tipkovničku mapu za naredbu" + +#: bashline.c:4069 +#, c-format +msgid "%s: first non-whitespace character is not `\"'" +msgstr "%s: prvi znak različit od praznine nije „\"”" + +#: bashline.c:4098 +#, c-format +msgid "no closing `%c' in %s" +msgstr "nema zatvorene „%c” u %s" + +#: bashline.c:4132 +#, c-format +msgid "%s: missing colon separator" +msgstr "%s: nedostaje dvotočje za razdvajanje" + +#: braces.c:321 +#, c-format +msgid "brace expansion: cannot allocate memory for %s" +msgstr "" + +#: braces.c:413 +#, c-format +msgid "brace expansion: failed to allocate memory for %d elements" +msgstr "" + +#: braces.c:452 +#, c-format +msgid "brace expansion: failed to allocate memory for `%s'" +msgstr "" + +#: builtins/alias.def:132 +#, c-format +msgid "`%s': invalid alias name" +msgstr "„%s”: neispravno drugo ime" + +#: builtins/bind.def:123 builtins/bind.def:126 +msgid "line editing not enabled" +msgstr "uređivanje redaka nije omogućeno" + +#: builtins/bind.def:212 +#, c-format +msgid "`%s': invalid keymap name" +msgstr "„%s”: neispravno ime tipkovničke mape" + +#: builtins/bind.def:251 +#, c-format +msgid "%s: cannot read: %s" +msgstr "%s: ne mogu čitati: %s" + +#: builtins/bind.def:266 +#, c-format +msgid "`%s': cannot unbind" +msgstr "„%s”: ne mogu ukloniti vezu" + +#: builtins/bind.def:304 builtins/bind.def:334 +#, c-format +msgid "`%s': unknown function name" +msgstr "„%s”: nepoznato ime funkcije" + +#: builtins/bind.def:312 +#, c-format +msgid "%s is not bound to any keys.\n" +msgstr "%s nije pridružen nijednoj tipki.\n" + +#: builtins/bind.def:316 +#, c-format +msgid "%s can be invoked via " +msgstr "%s se može pozvati pomoću " + +#: builtins/break.def:77 builtins/break.def:117 +msgid "loop count" +msgstr "broj ponavljanja" + +#: builtins/break.def:137 +msgid "only meaningful in a `for', `while', or `until' loop" +msgstr "ima značenje samo u petljama „for”, „while” ili „until”" + +#: builtins/caller.def:134 +msgid "" +"Returns the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns " +msgstr "" +"Vraća kontekst poziva trenutnog potprograma.\n" +" \n" +" Bez IZRAZA vraća " + +#: builtins/cd.def:319 +msgid "HOME not set" +msgstr "HOME nije postavljen" + +#: builtins/cd.def:327 builtins/common.c:166 test.c:876 +msgid "too many arguments" +msgstr "previše argumenata" + +#: builtins/cd.def:338 +msgid "OLDPWD not set" +msgstr "OLDPWD nije postavljen" + +#: builtins/common.c:101 +#, c-format +msgid "line %d: " +msgstr "redak %d: " + +#: builtins/common.c:139 error.c:265 +#, c-format +msgid "warning: " +msgstr "upozorenje: " + +#: builtins/common.c:153 +#, c-format +msgid "%s: usage: " +msgstr "%s: uporaba: " + +#: builtins/common.c:191 shell.c:506 shell.c:788 +#, c-format +msgid "%s: option requires an argument" +msgstr "%s: opcija zahtijeva argument" + +#: builtins/common.c:198 +#, c-format +msgid "%s: numeric argument required" +msgstr "%s: potreban je numerički argument" + +#: builtins/common.c:205 +#, c-format +msgid "%s: not found" +msgstr "%s: nije pronađen" + +#: builtins/common.c:214 shell.c:801 +#, c-format +msgid "%s: invalid option" +msgstr "%s: neispravna opcija" + +#: builtins/common.c:221 +#, c-format +msgid "%s: invalid option name" +msgstr "%s: neispravno ime opcije" + +#: builtins/common.c:228 general.c:235 general.c:240 +#, c-format +msgid "`%s': not a valid identifier" +msgstr "„%s”: nije ispravan identifikator" + +#: builtins/common.c:238 +msgid "invalid octal number" +msgstr "neispravan oktalni broj" + +#: builtins/common.c:240 +msgid "invalid hex number" +msgstr "neispravan heksadekadski broj" + +#: builtins/common.c:242 expr.c:1470 +msgid "invalid number" +msgstr "neispravan broj" + +#: builtins/common.c:250 +#, c-format +msgid "%s: invalid signal specification" +msgstr "%s: neispravno naveden signal" + +#: builtins/common.c:257 +#, c-format +msgid "`%s': not a pid or valid job spec" +msgstr "„%s”: nije pid ili ispravno naveden zadatak" + +#: builtins/common.c:264 error.c:488 +#, c-format +msgid "%s: readonly variable" +msgstr "%s: varijabla samo za čitanje" + +#: builtins/common.c:272 +#, c-format +msgid "%s: %s out of range" +msgstr "%s: %s je izvan granica" + +#: builtins/common.c:272 builtins/common.c:274 +msgid "argument" +msgstr "argument" + +#: builtins/common.c:274 +#, c-format +msgid "%s out of range" +msgstr "%s je izvan granica" + +#: builtins/common.c:282 +#, c-format +msgid "%s: no such job" +msgstr "%s: nema takvog zadatka" + +#: builtins/common.c:290 +#, c-format +msgid "%s: no job control" +msgstr "%s: nema kontrole zadataka" + +#: builtins/common.c:292 +msgid "no job control" +msgstr "nema kontrole zadataka" + +#: builtins/common.c:302 +#, c-format +msgid "%s: restricted" +msgstr "%s: ograničeno" + +#: builtins/common.c:304 +msgid "restricted" +msgstr "ograničeno" + +#: builtins/common.c:312 +#, c-format +msgid "%s: not a shell builtin" +msgstr "%s: nije ugrađen u ljusku" + +#: builtins/common.c:321 +#, c-format +msgid "write error: %s" +msgstr "greška pisanja: %s" + +#: builtins/common.c:329 +#, c-format +msgid "error setting terminal attributes: %s" +msgstr "greška pri postavljanju svojstava terminala: %s" + +#: builtins/common.c:331 +#, c-format +msgid "error getting terminal attributes: %s" +msgstr "greška pri preuzimanju svojstava terminala: %s" + +#: builtins/common.c:563 +#, c-format +msgid "%s: error retrieving current directory: %s: %s\n" +msgstr "%s: greška pri otkrivanju trenutnog direktorija: %s: %s\n" + +#: builtins/common.c:629 builtins/common.c:631 +#, c-format +msgid "%s: ambiguous job spec" +msgstr "%s: višeznačan navod zadatka" + +#: builtins/complete.def:277 +#, c-format +msgid "%s: invalid action name" +msgstr "%s: neispravno ime radnje" + +#: builtins/complete.def:450 builtins/complete.def:645 +#: builtins/complete.def:855 +#, c-format +msgid "%s: no completion specification" +msgstr "%s: nije navedeno nadopunjavanje" + +#: builtins/complete.def:697 +msgid "warning: -F option may not work as you expect" +msgstr "upozorenje: opcija -F možda neće raditi kako želite" + +#: builtins/complete.def:699 +msgid "warning: -C option may not work as you expect" +msgstr "upozorenje: opcija -C možda neće raditi kako želite" + +#: builtins/complete.def:828 +msgid "not currently executing completion function" +msgstr "trenutno ne izvršavam funkciju nadopunjavanja" + +#: builtins/declare.def:126 +msgid "can only be used in a function" +msgstr "može se koristiti samo u funkciji" + +#: builtins/declare.def:315 builtins/declare.def:509 +#, c-format +msgid "%s: reference variable cannot be an array" +msgstr "" + +#: builtins/declare.def:324 +#, c-format +msgid "%s: nameref variable self references not allowed" +msgstr "" + +#: builtins/declare.def:398 +msgid "cannot use `-f' to make functions" +msgstr "ne mogu koristiti „-f” za izradu funkcija" + +#: builtins/declare.def:410 execute_cmd.c:5361 +#, c-format +msgid "%s: readonly function" +msgstr "%s: funkcija samo za čitanje" + +#: builtins/declare.def:553 +#, c-format +msgid "%s: cannot destroy array variables in this way" +msgstr "%s: ne mogu uništiti varijable polja na ovaj način" + +#: builtins/declare.def:560 builtins/read.def:733 +#, c-format +msgid "%s: cannot convert associative to indexed array" +msgstr "%s: ne mogu pretvoriti asocijativno u indeksirano polje" + +#: builtins/enable.def:137 builtins/enable.def:145 +msgid "dynamic loading not available" +msgstr "dinamičko učitavanje nije dostupno" + +#: builtins/enable.def:312 +#, c-format +msgid "cannot open shared object %s: %s" +msgstr "ne mogu otvoriti dijeljeni objekt %s: %s" + +#: builtins/enable.def:335 +#, c-format +msgid "cannot find %s in shared object %s: %s" +msgstr "ne mogu pronaći %s u dijeljenom objektu %s: %s" + +#: builtins/enable.def:459 +#, c-format +msgid "%s: not dynamically loaded" +msgstr "%s: nije dinamički učitan" + +#: builtins/enable.def:474 +#, c-format +msgid "%s: cannot delete: %s" +msgstr "%s: ne mogu ukloniti: %s" + +#: builtins/evalfile.c:140 builtins/hash.def:171 execute_cmd.c:5208 +#: shell.c:1481 +#, c-format +msgid "%s: is a directory" +msgstr "%s: to je direktorij" + +#: builtins/evalfile.c:146 +#, c-format +msgid "%s: not a regular file" +msgstr "%s: nije obična datoteka" + +#: builtins/evalfile.c:155 +#, c-format +msgid "%s: file is too large" +msgstr "%s: datoteka je prevelika" + +#: builtins/evalfile.c:190 builtins/evalfile.c:208 shell.c:1491 +#, c-format +msgid "%s: cannot execute binary file" +msgstr "%s: ne mogu izvršiti binarnu datoteku" + +#: builtins/exec.def:154 builtins/exec.def:156 builtins/exec.def:228 +#, c-format +msgid "%s: cannot execute: %s" +msgstr "%s: ne mogu izvršiti: %s" + +#: builtins/exit.def:65 +#, c-format +msgid "logout\n" +msgstr "odjava\n" + +#: builtins/exit.def:88 +msgid "not login shell: use `exit'" +msgstr "nije prijavna ljuska: koristite „exit”" + +#: builtins/exit.def:120 +#, c-format +msgid "There are stopped jobs.\n" +msgstr "Ima zaustavljenih zadataka.\n" + +#: builtins/exit.def:122 +#, c-format +msgid "There are running jobs.\n" +msgstr "Ima pokrenutih zadataka.\n" + +#: builtins/fc.def:262 +msgid "no command found" +msgstr "naredba nije pronađena" + +#: builtins/fc.def:320 builtins/fc.def:369 +msgid "history specification" +msgstr "specifikacija povijesti" + +#: builtins/fc.def:390 +#, c-format +msgid "%s: cannot open temp file: %s" +msgstr "%s: ne mogu otvoriti privremenu datoteku: %s" + +#: builtins/fg_bg.def:149 builtins/jobs.def:282 +msgid "current" +msgstr "trenutno" + +#: builtins/fg_bg.def:158 +#, c-format +msgid "job %d started without job control" +msgstr "zadatak %d pokrenut bez kontrole zadataka" + +#: builtins/getopt.c:110 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: nedozvoljena opcija -- %c\n" + +#: builtins/getopt.c:111 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: opcija zahtijeva argument -- %c\n" + +#: builtins/hash.def:92 +msgid "hashing disabled" +msgstr "raspršivanje onemogućeno" + +#: builtins/hash.def:138 +#, c-format +msgid "%s: hash table empty\n" +msgstr "%s: tablica raspršivanja prazna\n" + +#: builtins/hash.def:245 +#, c-format +msgid "hits\tcommand\n" +msgstr "pogoci\tnaredba\n" + +#: builtins/help.def:130 +#, c-format +msgid "Shell commands matching keyword `" +msgid_plural "Shell commands matching keywords `" +msgstr[0] "Naredbe ljuske koje odgovaraju ključnoj riječi „" +msgstr[1] "Naredbe ljuske koje odgovaraju ključnim riječima „" +msgstr[2] "Naredbe ljuske koje odgovaraju ključnim riječima „" + +#: builtins/help.def:182 +#, c-format +msgid "" +"no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'." +msgstr "" +"nisu pronađene teme pomoći za „%s”. Pokušajte „help help”, „man -k %s” ili " +"„info %s”." + +#: builtins/help.def:199 +#, c-format +msgid "%s: cannot open: %s" +msgstr "%s: ne mogu otvoriti: %s" + +#: builtins/help.def:485 +#, c-format +msgid "" +"These shell commands are defined internally. Type `help' to see this list.\n" +"Type `help name' to find out more about the function `name'.\n" +"Use `info bash' to find out more about the shell in general.\n" +"Use `man -k' or `info' to find out more about commands not in this list.\n" +"\n" +"A star (*) next to a name means that the command is disabled.\n" +"\n" +msgstr "" +"Ove naredbe ljuske su interno definirane. Upišite „help” za prikaz popisa.\n" +"Upišite „help ime” za više podataka o funkciji „ime”.\n" +"Koristite „info bash” za više općenitih podataka o ljusci.\n" +"Koristite „man -k” ili „info” za više podataka o naredbama izvan ovog " +"popisa.\n" +"\n" +"Zvjezdica (*) pokraj imena označava onemogućenu naredbu.\n" +"\n" + +#: builtins/history.def:154 +msgid "cannot use more than one of -anrw" +msgstr "ne mogu koristiti više od jedne od opcija -anrw" + +#: builtins/history.def:186 +msgid "history position" +msgstr "mjesto u povijesti" + +#: builtins/history.def:366 +#, c-format +msgid "%s: history expansion failed" +msgstr "%s: proširenje povijesti nije uspjelo" + +#: builtins/inlib.def:71 +#, c-format +msgid "%s: inlib failed" +msgstr "%s: inlib nije uspio" + +#: builtins/jobs.def:109 +msgid "no other options allowed with `-x'" +msgstr "nisu dozvoljene druge opcije uz „-x”" + +#: builtins/kill.def:200 +#, c-format +msgid "%s: arguments must be process or job IDs" +msgstr "%s: argumenti moraju biti identifikatori procesa ili zadataka" + +#: builtins/kill.def:263 +msgid "Unknown error" +msgstr "Nepoznata greška" + +#: builtins/let.def:95 builtins/let.def:120 expr.c:583 expr.c:598 +msgid "expression expected" +msgstr "očekujem izraz" + +#: builtins/mapfile.def:172 +#, c-format +msgid "%s: not an indexed array" +msgstr "%s: nije indeksirano polje" + +#: builtins/mapfile.def:259 builtins/read.def:302 +#, c-format +msgid "%s: invalid file descriptor specification" +msgstr "%s: neispravno naveden opisnik datoteke" + +#: builtins/mapfile.def:267 builtins/read.def:309 +#, c-format +msgid "%d: invalid file descriptor: %s" +msgstr "%d: neispravan opisnik datoteke: %s" + +#: builtins/mapfile.def:276 builtins/mapfile.def:314 +#, c-format +msgid "%s: invalid line count" +msgstr "%s: neispravan broj redaka" + +#: builtins/mapfile.def:287 +#, c-format +msgid "%s: invalid array origin" +msgstr "%s: neispravan izvor polja" + +#: builtins/mapfile.def:304 +#, c-format +msgid "%s: invalid callback quantum" +msgstr "%s: neispravan element povratnog poziva" + +#: builtins/mapfile.def:336 +msgid "empty array variable name" +msgstr "prazno ime varijable polja" + +#: builtins/mapfile.def:357 +msgid "array variable support required" +msgstr "potrebna je podrška varijable polja" + +#: builtins/printf.def:402 +#, c-format +msgid "`%s': missing format character" +msgstr "„%s”: nedostaje znak oblika" + +#: builtins/printf.def:456 +#, c-format +msgid "`%c': invalid time format specification" +msgstr "„%c”: neispravno naveden oblik vremena" + +#: builtins/printf.def:658 +#, c-format +msgid "`%c': invalid format character" +msgstr "„%c”: neispravan znak oblika" + +#: builtins/printf.def:684 +#, c-format +msgid "warning: %s: %s" +msgstr "upozorenje: %s: %s" + +#: builtins/printf.def:768 +#, c-format +msgid "format parsing problem: %s" +msgstr "" + +#: builtins/printf.def:865 +msgid "missing hex digit for \\x" +msgstr "nedostaje heksadekadska znamenka za \\x" + +#: builtins/printf.def:880 +#, c-format +msgid "missing unicode digit for \\%c" +msgstr "nedostaje unicode znamenka za \\%c" + +#: builtins/pushd.def:195 +msgid "no other directory" +msgstr "nema drugog direktorija" + +#: builtins/pushd.def:354 +#, fuzzy, c-format +msgid "%s: invalid argument" +msgstr "%s: neispravan argument ograničenja" + +#: builtins/pushd.def:468 +msgid "" +msgstr "" + +#: builtins/pushd.def:512 +msgid "directory stack empty" +msgstr "stog direktorija je prazan" + +#: builtins/pushd.def:514 +msgid "directory stack index" +msgstr "indeks stoga direktorija" + +#: builtins/pushd.def:689 +msgid "" +"Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +"\tdirs when invoked without options, starting with zero." +msgstr "" +"Prikaži popis trenutno zapamćenih direktorija. Direktoriji se dodaju\n" +" na popis naredbom „pushd”, kroz popis se možete vraćati naredbom\n" +" „popd”.\n" +" \n" +" Opcije:\n" +" -c\točisti stog direktorija uklanjanjem svih elemenata\n" +" -l\tne ispisuj tildom prefiksirane inačice direktorija\n" +" \trelativno u odnosu na početni direktorij\n" +" -p\tispiši stog direktorija jednu stavku po retku\n" +" -v\tispiši stog direktorija jednu stavku po retku\n" +" \tprefiksiranu položajem u stogu\n" +" \n" +" Argumenti:\n" +" +N\tPrikazuje N-tu stavku s lijeve strane popisa koju prikazuje " +"naredba\n" +" \t„dirs” pozvana bez opcija, počevši od nule.\n" +" \n" +" -N\tPrikazuje N-tu stavku s desne strane popisa koju prikazuje " +"naredba\n" +"\t„dirs” pozvana bez opcija, počevši od nule." + +#: builtins/pushd.def:711 +msgid "" +"Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" + +#: builtins/pushd.def:736 +msgid "" +"Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack." +msgstr "" + +#: builtins/read.def:275 +#, c-format +msgid "%s: invalid timeout specification" +msgstr "%s: neispravno navedeno vremensko ograničenje" + +#: builtins/read.def:678 +#, c-format +msgid "read error: %d: %s" +msgstr "greška čitanja: %d: %s" + +#: builtins/return.def:75 +msgid "can only `return' from a function or sourced script" +msgstr "pozivanje „return” je moguće samo iz funkcije ili pokrenute skripte" + +#: builtins/set.def:782 +msgid "cannot simultaneously unset a function and a variable" +msgstr "ne mogu istovremeno poništiti funkciju i varijablu" + +#: builtins/set.def:826 +#, c-format +msgid "%s: cannot unset" +msgstr "%s: ne mogu poništiti" + +#: builtins/set.def:843 +#, c-format +msgid "%s: cannot unset: readonly %s" +msgstr "%s: ne mogu poništiti: %s je samo za čitanje" + +#: builtins/set.def:854 +#, c-format +msgid "%s: not an array variable" +msgstr "%s: nije varijabla polja" + +#: builtins/setattr.def:187 +#, c-format +msgid "%s: not a function" +msgstr "%s: nije funkcija" + +#: builtins/shift.def:71 builtins/shift.def:77 +msgid "shift count" +msgstr "broj pomaka" + +#: builtins/shopt.def:279 +msgid "cannot set and unset shell options simultaneously" +msgstr "ne mogu istovremeno postaviti i poništiti opcije ljuske" + +#: builtins/shopt.def:346 +#, c-format +msgid "%s: invalid shell option name" +msgstr "%s: neispravno ime opcije ljuske" + +#: builtins/source.def:130 +msgid "filename argument required" +msgstr "potrebno je ime datoteke kao argument" + +#: builtins/source.def:155 +#, c-format +msgid "%s: file not found" +msgstr "%s: datoteka nije pronađena" + +#: builtins/suspend.def:101 +msgid "cannot suspend" +msgstr "ne mogu zaustaviti" + +#: builtins/suspend.def:111 +msgid "cannot suspend a login shell" +msgstr "ne mogu zaustaviti prijavnu ljusku" + +#: builtins/type.def:234 +#, c-format +msgid "%s is aliased to `%s'\n" +msgstr "%s je drugo ime za „%s”\n" + +#: builtins/type.def:255 +#, c-format +msgid "%s is a shell keyword\n" +msgstr "%s je ključna riječ ljuske\n" + +#: builtins/type.def:274 +#, c-format +msgid "%s is a function\n" +msgstr "%s je funkcija\n" + +#: builtins/type.def:296 +#, c-format +msgid "%s is a shell builtin\n" +msgstr "%s je ugrađen u ljusku\n" + +#: builtins/type.def:317 builtins/type.def:393 +#, c-format +msgid "%s is %s\n" +msgstr "%s je %s\n" + +#: builtins/type.def:337 +#, c-format +msgid "%s is hashed (%s)\n" +msgstr "%s je raspršen (%s)\n" + +#: builtins/ulimit.def:383 +#, c-format +msgid "%s: invalid limit argument" +msgstr "%s: neispravan argument ograničenja" + +#: builtins/ulimit.def:409 +#, c-format +msgid "`%c': bad command" +msgstr "„%c”: neispravna naredba" + +#: builtins/ulimit.def:438 +#, c-format +msgid "%s: cannot get limit: %s" +msgstr "%s: ne mogu otkriti ograničenje: %s" + +#: builtins/ulimit.def:464 +msgid "limit" +msgstr "ograničenje" + +#: builtins/ulimit.def:476 builtins/ulimit.def:776 +#, c-format +msgid "%s: cannot modify limit: %s" +msgstr "%s: ne mogu urediti ograničenje: %s" + +#: builtins/umask.def:114 +msgid "octal number" +msgstr "oktalni broj" + +#: builtins/umask.def:227 +#, c-format +msgid "`%c': invalid symbolic mode operator" +msgstr "„%c”: neispravan operator simboličkog načina" + +#: builtins/umask.def:282 +#, c-format +msgid "`%c': invalid symbolic mode character" +msgstr "„%c”: neispravan znak simboličkog načina" + +#: error.c:90 error.c:325 error.c:327 error.c:329 +msgid " line " +msgstr " redak " + +#: error.c:165 +#, c-format +msgid "last command: %s\n" +msgstr "posljednja naredba: %s\n" + +#: error.c:173 +#, c-format +msgid "Aborting..." +msgstr "Prekidam..." + +#: error.c:440 +msgid "unknown command error" +msgstr "nepoznata greška naredbe" + +#: error.c:441 +msgid "bad command type" +msgstr "neispravna vrsta naredbe" + +#: error.c:442 +msgid "bad connector" +msgstr "neispravno spajanje" + +#: error.c:443 +msgid "bad jump" +msgstr "neispravan skok" + +#: error.c:481 +#, c-format +msgid "%s: unbound variable" +msgstr "%s: nepovezana varijabla" + +#: eval.c:189 +#, c-format +msgid "\atimed out waiting for input: auto-logout\n" +msgstr "\avrijeme čekanja ulaza je isteklo: automatska-odjava\n" + +#: execute_cmd.c:512 +#, c-format +msgid "cannot redirect standard input from /dev/null: %s" +msgstr "ne mogu preusmjeriti standardni ulaz iz /dev/null: %s" + +#: execute_cmd.c:1233 +#, c-format +msgid "TIMEFORMAT: `%c': invalid format character" +msgstr "TIMEFORMAT: „%c”: neispravan znak oblika" + +#: execute_cmd.c:2287 +msgid "pipe error" +msgstr "greška cjevovoda" + +#: execute_cmd.c:4386 +#, c-format +msgid "%s: maximum function nesting level exceeded (%d)" +msgstr "" + +#: execute_cmd.c:4884 +#, c-format +msgid "%s: restricted: cannot specify `/' in command names" +msgstr "%s: ograničeno: ne možete navesti „/” u imenu naredbe" + +#: execute_cmd.c:4973 +#, c-format +msgid "%s: command not found" +msgstr "%s: naredba nije pronađena" + +#: execute_cmd.c:5206 +#, c-format +msgid "%s: %s" +msgstr "%s: %s" + +#: execute_cmd.c:5243 +#, c-format +msgid "%s: %s: bad interpreter" +msgstr "%s: %s: neispravan tumač" + +#: execute_cmd.c:5280 +#, fuzzy, c-format +msgid "%s: cannot execute binary file: %s" +msgstr "%s: ne mogu izvršiti binarnu datoteku" + +#: execute_cmd.c:5352 +#, fuzzy, c-format +msgid "`%s': is a special builtin" +msgstr "%s je ugrađen u ljusku\n" + +#: execute_cmd.c:5404 +#, c-format +msgid "cannot duplicate fd %d to fd %d" +msgstr "ne mogu udvostručiti opisnik datoteke %d u opisnik datoteke %d" + +#: expr.c:259 +msgid "expression recursion level exceeded" +msgstr "razina rekurzije izraza je prekoračena" + +#: expr.c:283 +msgid "recursion stack underflow" +msgstr "podljev stoga rekurzije" + +#: expr.c:431 +msgid "syntax error in expression" +msgstr "sintaksna greška u izrazu" + +#: expr.c:475 +msgid "attempted assignment to non-variable" +msgstr "pokušaj pridruživanja ne-varijabli" + +#: expr.c:495 expr.c:858 +msgid "division by 0" +msgstr "dijeljenje s 0" + +#: expr.c:542 +msgid "bug: bad expassign token" +msgstr "greška: neispravan simbol expassign" + +#: expr.c:595 +msgid "`:' expected for conditional expression" +msgstr "očekujem „:” za uvjetni izraz" + +#: expr.c:919 +msgid "exponent less than 0" +msgstr "eksponent je manji od 0" + +#: expr.c:976 +msgid "identifier expected after pre-increment or pre-decrement" +msgstr "očekujem identifikator nakon pred-povećanja ili pred-smanjenja" + +#: expr.c:1002 +msgid "missing `)'" +msgstr "nedostaje „)”" + +#: expr.c:1053 expr.c:1390 +msgid "syntax error: operand expected" +msgstr "sintaksna greška: očekujem operand" + +#: expr.c:1392 +msgid "syntax error: invalid arithmetic operator" +msgstr "sintaksna greška: neispravan aritmetički operator" + +#: expr.c:1416 +#, c-format +msgid "%s%s%s: %s (error token is \"%s\")" +msgstr "%s%s%s: %s (simbol greške je „%s”)" + +#: expr.c:1474 +msgid "invalid arithmetic base" +msgstr "neispravna aritmetička baza" + +#: expr.c:1494 +msgid "value too great for base" +msgstr "vrijednost baze je prevelika" + +#: expr.c:1543 +#, c-format +msgid "%s: expression error\n" +msgstr "%s: greška izraza\n" + +#: general.c:62 +msgid "getcwd: cannot access parent directories" +msgstr "getcwd: ne mogu pristupiti nadređenim direktorijima" + +#: input.c:102 subst.c:5168 +#, c-format +msgid "cannot reset nodelay mode for fd %d" +msgstr "" + +#: input.c:271 +#, c-format +msgid "cannot allocate new file descriptor for bash input from fd %d" +msgstr "ne mogu alocirati novi datotečni opisnik za bash ulaz iz fd %d" + +#: input.c:279 +#, c-format +msgid "save_bash_input: buffer already exists for new fd %d" +msgstr "save_bash_input: međuspremnik već postoji za novi fd %d" + +#: jobs.c:471 +msgid "start_pipeline: pgrp pipe" +msgstr "start_pipeline: pgrp pipe" + +#: jobs.c:893 +#, c-format +msgid "forked pid %d appears in running job %d" +msgstr "razdvojen pid %d se javlja u pokrenutom zadatku %d" + +#: jobs.c:1012 +#, c-format +msgid "deleting stopped job %d with process group %ld" +msgstr "uklanjam zaustavljeni zadatak %d s grupom procesa %ld" + +#: jobs.c:1117 +#, c-format +msgid "add_process: process %5ld (%s) in the_pipeline" +msgstr "add_process: proces %5ld (%s) u the_pipeline" + +#: jobs.c:1120 +#, c-format +msgid "add_process: pid %5ld (%s) marked as still alive" +msgstr "add_process: pid %5ld (%s) označen kao još živ" + +#: jobs.c:1435 +#, c-format +msgid "describe_pid: %ld: no such pid" +msgstr "describe_pid: %ld: ne postoji takav pid" + +#: jobs.c:1450 +#, c-format +msgid "Signal %d" +msgstr "Signal %d" + +#: jobs.c:1464 jobs.c:1489 +msgid "Done" +msgstr "Gotovo" + +#: jobs.c:1469 siglist.c:123 +msgid "Stopped" +msgstr "Zaustavljen" + +#: jobs.c:1473 +#, c-format +msgid "Stopped(%s)" +msgstr "Zaustavljen(%s)" + +#: jobs.c:1477 +msgid "Running" +msgstr "Pokrenut" + +#: jobs.c:1491 +#, c-format +msgid "Done(%d)" +msgstr "Gotovo(%d)" + +#: jobs.c:1493 +#, c-format +msgid "Exit %d" +msgstr "Izlaz %d" + +#: jobs.c:1496 +msgid "Unknown status" +msgstr "Nepoznato stanje" + +#: jobs.c:1583 +#, c-format +msgid "(core dumped) " +msgstr "(jezgra izbačena) " + +#: jobs.c:1602 +#, c-format +msgid " (wd: %s)" +msgstr " (wd: %s)" + +#: jobs.c:1819 +#, c-format +msgid "child setpgid (%ld to %ld)" +msgstr "" + +#: jobs.c:2138 nojobs.c:605 +#, c-format +msgid "wait: pid %ld is not a child of this shell" +msgstr "wait: pid %ld nije dijete ove ljuske" + +#: jobs.c:2385 +#, c-format +msgid "wait_for: No record of process %ld" +msgstr "wait_for: Ne postoji zapis o procesu %ld" + +#: jobs.c:2694 +#, c-format +msgid "wait_for_job: job %d is stopped" +msgstr "wait_for_job: zadatak %d je zaustavljen" + +#: jobs.c:2986 +#, c-format +msgid "%s: job has terminated" +msgstr "%s: zadatak je dovršen" + +#: jobs.c:2995 +#, c-format +msgid "%s: job %d already in background" +msgstr "%s: zadatak %d je već u pozadini" + +#: jobs.c:3220 +msgid "waitchld: turning on WNOHANG to avoid indefinite block" +msgstr "" + +#: jobs.c:3711 +#, c-format +msgid "%s: line %d: " +msgstr "%s: redak %d: " + +#: jobs.c:3725 nojobs.c:843 +#, c-format +msgid " (core dumped)" +msgstr " (jezgra izbačena)" + +#: jobs.c:3737 jobs.c:3750 +#, c-format +msgid "(wd now: %s)\n" +msgstr "(sadašnji wd: %s)\n" + +#: jobs.c:3782 +msgid "initialize_job_control: getpgrp failed" +msgstr "initialize_job_control: getpgrp nije uspio" + +#: jobs.c:3843 +msgid "initialize_job_control: line discipline" +msgstr "" + +#: jobs.c:3853 +msgid "initialize_job_control: setpgid" +msgstr "initialize_job_control: setpgid" + +#: jobs.c:3874 jobs.c:3883 +#, c-format +msgid "cannot set terminal process group (%d)" +msgstr "ne mogu postaviti grupu procesa terminala (%d)" + +#: jobs.c:3888 +msgid "no job control in this shell" +msgstr "nema kontrole zadataka u ovoj ljusci" + +#: lib/malloc/malloc.c:296 +#, c-format +msgid "malloc: failed assertion: %s\n" +msgstr "" + +#: lib/malloc/malloc.c:312 +#, c-format +msgid "" +"\r\n" +"malloc: %s:%d: assertion botched\r\n" +msgstr "" + +#: lib/malloc/malloc.c:313 +msgid "unknown" +msgstr "nepoznato" + +#: lib/malloc/malloc.c:801 +msgid "malloc: block on free list clobbered" +msgstr "" + +#: lib/malloc/malloc.c:878 +msgid "free: called with already freed block argument" +msgstr "free: pozvan s argumentom već oslobođenog bloka" + +#: lib/malloc/malloc.c:881 +msgid "free: called with unallocated block argument" +msgstr "free: pozvan s argumentom nealociranog bloka" + +#: lib/malloc/malloc.c:900 +msgid "free: underflow detected; mh_nbytes out of range" +msgstr "free: otkriven podljev, mh_nbytes izvan granica" + +#: lib/malloc/malloc.c:906 +msgid "free: start and end chunk sizes differ" +msgstr "" + +#: lib/malloc/malloc.c:1005 +msgid "realloc: called with unallocated block argument" +msgstr "realloc: pozvan s argumentom nealociranog bloka" + +#: lib/malloc/malloc.c:1020 +msgid "realloc: underflow detected; mh_nbytes out of range" +msgstr "realloc: otkriven podljev, mh_nbytes izvan granica" + +#: lib/malloc/malloc.c:1026 +msgid "realloc: start and end chunk sizes differ" +msgstr "" + +#: lib/malloc/table.c:194 +#, c-format +msgid "register_alloc: alloc table is full with FIND_ALLOC?\n" +msgstr "" + +#: lib/malloc/table.c:203 +#, c-format +msgid "register_alloc: %p already in table as allocated?\n" +msgstr "" + +#: lib/malloc/table.c:256 +#, c-format +msgid "register_free: %p already in table as free?\n" +msgstr "register_free: %p već u tablici kao oslobođen?\n" + +#: lib/sh/fmtulong.c:102 +msgid "invalid base" +msgstr "neispravna baza" + +#: lib/sh/netopen.c:168 +#, c-format +msgid "%s: host unknown" +msgstr "%s: nepoznato računalo" + +#: lib/sh/netopen.c:175 +#, c-format +msgid "%s: invalid service" +msgstr "%s: neispravna usluga" + +#: lib/sh/netopen.c:306 +#, c-format +msgid "%s: bad network path specification" +msgstr "%s: neispravno navedena mrežna putanja" + +#: lib/sh/netopen.c:346 +msgid "network operations not supported" +msgstr "mrežne operacije nisu podržane" + +#: locale.c:200 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s)" +msgstr "setlocale: LC_ALL: ne mogu promijeniti lokal (%s)" + +#: locale.c:202 +#, c-format +msgid "setlocale: LC_ALL: cannot change locale (%s): %s" +msgstr "setlocale: LC_ALL: ne mogu promijeniti lokal (%s): %s" + +#: locale.c:259 +#, c-format +msgid "setlocale: %s: cannot change locale (%s)" +msgstr "setlocale: %s: ne mogu promijeniti lokal (%s)" + +#: locale.c:261 +#, c-format +msgid "setlocale: %s: cannot change locale (%s): %s" +msgstr "setlocale: %s: ne mogu promijeniti lokal (%s): %s" + +#: mailcheck.c:439 +msgid "You have mail in $_" +msgstr "Imate poštu u $_" + +#: mailcheck.c:464 +msgid "You have new mail in $_" +msgstr "Imate novu poštu u $_" + +#: mailcheck.c:480 +#, c-format +msgid "The mail in %s has been read\n" +msgstr "Pošta u %s je pročitana\n" + +#: make_cmd.c:323 +msgid "syntax error: arithmetic expression required" +msgstr "sintaksna greška: potreban aritmetički izraz" + +#: make_cmd.c:325 +msgid "syntax error: `;' unexpected" +msgstr "sintaksna greška: neočekivana „;”" + +#: make_cmd.c:326 +#, c-format +msgid "syntax error: `((%s))'" +msgstr "sintaksna greška: „((%s))”" + +#: make_cmd.c:578 +#, c-format +msgid "make_here_document: bad instruction type %d" +msgstr "make_here_document: neispravna vrsta instrukcije %d" + +#: make_cmd.c:662 +#, c-format +msgid "here-document at line %d delimited by end-of-file (wanted `%s')" +msgstr "" + +#: make_cmd.c:759 +#, c-format +msgid "make_redirection: redirection instruction `%d' out of range" +msgstr "" + +#: parse.y:3278 parse.y:3561 +#, c-format +msgid "unexpected EOF while looking for matching `%c'" +msgstr "neočekivani EOF pri traženju odgovarajućeg „%c”" + +#: parse.y:4170 +msgid "unexpected EOF while looking for `]]'" +msgstr "neočekivani EOF pri traženju „]]”" + +#: parse.y:4175 +#, c-format +msgid "syntax error in conditional expression: unexpected token `%s'" +msgstr "sintaksna greška u uvjetnom izrazu: neočekivani simbol „%s”" + +#: parse.y:4179 +msgid "syntax error in conditional expression" +msgstr "sintaksna greška u uvjetnom izrazu" + +#: parse.y:4257 +#, c-format +msgid "unexpected token `%s', expected `)'" +msgstr "neočekivani simbol „%s”, očekujem „)”" + +#: parse.y:4261 +msgid "expected `)'" +msgstr "očekujem „)”" + +#: parse.y:4289 +#, c-format +msgid "unexpected argument `%s' to conditional unary operator" +msgstr "neočekivani argument „%s” uvjetnom unarnom operatoru" + +#: parse.y:4293 +msgid "unexpected argument to conditional unary operator" +msgstr "neočekivani argument uvjetnom unarnom operatoru" + +#: parse.y:4339 +#, c-format +msgid "unexpected token `%s', conditional binary operator expected" +msgstr "neočekivani simbol „%s”, očekujem uvjetni binarni operator" + +#: parse.y:4343 +msgid "conditional binary operator expected" +msgstr "očekujem uvjetni binarni operator" + +#: parse.y:4365 +#, c-format +msgid "unexpected argument `%s' to conditional binary operator" +msgstr "neočekivani argument „%s” uvjetnom binarnom operatoru" + +#: parse.y:4369 +msgid "unexpected argument to conditional binary operator" +msgstr "neočekivani argument uvjetnom binarnom operatoru" + +#: parse.y:4380 +#, c-format +msgid "unexpected token `%c' in conditional command" +msgstr "neočekivani simbol „%c” u uvjetnoj naredbi" + +#: parse.y:4383 +#, c-format +msgid "unexpected token `%s' in conditional command" +msgstr "neočekivani simbol „%s” u uvjetnoj naredbi" + +#: parse.y:4387 +#, c-format +msgid "unexpected token %d in conditional command" +msgstr "neočekivani simbol %d u uvjetnoj naredbi" + +#: parse.y:5737 +#, c-format +msgid "syntax error near unexpected token `%s'" +msgstr "sintaksna greška kod neočekivanog simbola „%s”" + +#: parse.y:5755 +#, c-format +msgid "syntax error near `%s'" +msgstr "sintaksna greška kod „%s”" + +#: parse.y:5765 +msgid "syntax error: unexpected end of file" +msgstr "sintaksna greška: neočekivani kraj datoteke" + +#: parse.y:5765 +msgid "syntax error" +msgstr "sintaksna greška" + +#: parse.y:5827 +#, c-format +msgid "Use \"%s\" to leave the shell.\n" +msgstr "Koristite „%s” za napuštanje ljuske.\n" + +#: parse.y:5989 +msgid "unexpected EOF while looking for matching `)'" +msgstr "neočekivani EOF pri traženju odgovarajuće „)”" + +#: pcomplete.c:1094 +#, c-format +msgid "completion: function `%s' not found" +msgstr "completion: funkcija „%s” nije pronađena" + +#: pcomplib.c:182 +#, c-format +msgid "progcomp_insert: %s: NULL COMPSPEC" +msgstr "progcomp_insert: %s: NULL COMPSPEC" + +#: print_cmd.c:300 +#, c-format +msgid "print_command: bad connector `%d'" +msgstr "" + +#: print_cmd.c:373 +#, c-format +msgid "xtrace_set: %d: invalid file descriptor" +msgstr "xtrace_set: %d: neispravan opisnik datoteke" + +#: print_cmd.c:378 +msgid "xtrace_set: NULL file pointer" +msgstr "xtrace_set: NULL pokazivač na datoteku" + +#: print_cmd.c:382 +#, c-format +msgid "xtrace fd (%d) != fileno xtrace fp (%d)" +msgstr "" + +#: print_cmd.c:1518 +#, c-format +msgid "cprintf: `%c': invalid format character" +msgstr "" + +#: redir.c:123 redir.c:170 +msgid "file descriptor out of range" +msgstr "opisnik datoteke izvan granica" + +#: redir.c:177 +#, c-format +msgid "%s: ambiguous redirect" +msgstr "%s: višeznačno preusmjeravanje" + +#: redir.c:181 +#, c-format +msgid "%s: cannot overwrite existing file" +msgstr "%s: ne mogu pisati preko postojeće datoteke" + +#: redir.c:186 +#, c-format +msgid "%s: restricted: cannot redirect output" +msgstr "%s: ograničeno: ne mogu preusmjeriti izlaz" + +#: redir.c:191 +#, c-format +msgid "cannot create temp file for here-document: %s" +msgstr "ne mogu napraviti privremenu datoteku za here-document: %s" + +#: redir.c:195 +#, c-format +msgid "%s: cannot assign fd to variable" +msgstr "%s: ne mogu pridružiti opisnik datoteke varijabli" + +#: redir.c:582 +msgid "/dev/(tcp|udp)/host/port not supported without networking" +msgstr "/dev/(tcp|udp)/host/port nije podržan bez umrežavanja" + +#: redir.c:861 redir.c:973 redir.c:1034 redir.c:1199 +msgid "redirection error: cannot duplicate fd" +msgstr "greška preusmjeravanja: ne mogu udvostručiti opisnik datoteke" + +#: shell.c:339 +msgid "could not find /tmp, please create!" +msgstr "ne mogu pronaći /tmp, molim, napravite ga!" + +#: shell.c:343 +msgid "/tmp must be a valid directory name" +msgstr "/tmp mora biti ispravno ime direktorija" + +#: shell.c:890 +#, c-format +msgid "%c%c: invalid option" +msgstr "%c%c: neispravna opcija" + +#: shell.c:1682 +msgid "I have no name!" +msgstr "Nemam ime!" + +#: shell.c:1827 +#, c-format +msgid "GNU bash, version %s-(%s)\n" +msgstr "GNU bash, inačica %s-(%s)\n" + +#: shell.c:1828 +#, c-format +msgid "" +"Usage:\t%s [GNU long option] [option] ...\n" +"\t%s [GNU long option] [option] script-file ...\n" +msgstr "" +"Uporaba: %s [GNU dugačka opcija] [opcija] ...\n" +"\t %s [GNU dugačka opcija] [opcija] skripta ...\n" + +#: shell.c:1830 +msgid "GNU long options:\n" +msgstr "GNU dugačke opcije:\n" + +#: shell.c:1834 +msgid "Shell options:\n" +msgstr "Opcije ljuske:\n" + +#: shell.c:1835 +msgid "\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n" +msgstr "" + +#: shell.c:1850 +#, c-format +msgid "\t-%s or -o option\n" +msgstr "" + +#: shell.c:1856 +#, c-format +msgid "Type `%s -c \"help set\"' for more information about shell options.\n" +msgstr "" + +#: shell.c:1857 +#, c-format +msgid "Type `%s -c help' for more information about shell builtin commands.\n" +msgstr "" + +#: shell.c:1858 +#, c-format +msgid "Use the `bashbug' command to report bugs.\n" +msgstr "Koristite naredbu „bashbug” za prijavljivanje grešaka.\n" + +#: sig.c:691 +#, c-format +msgid "sigprocmask: %d: invalid operation" +msgstr "" + +#: siglist.c:48 +msgid "Bogus signal" +msgstr "Lažan signal" + +#: siglist.c:51 +msgid "Hangup" +msgstr "Završetak" + +#: siglist.c:55 +msgid "Interrupt" +msgstr "Prekid" + +#: siglist.c:59 +msgid "Quit" +msgstr "Izlaz" + +#: siglist.c:63 +msgid "Illegal instruction" +msgstr "Nedozvoljena instrukcija" + +#: siglist.c:67 +msgid "BPT trace/trap" +msgstr "BPT praćenje/zamka" + +#: siglist.c:75 +msgid "ABORT instruction" +msgstr "ABORT instrukcija" + +#: siglist.c:79 +msgid "EMT instruction" +msgstr "EMT instrukcija" + +#: siglist.c:83 +msgid "Floating point exception" +msgstr "Iznimka pomičnog zareza" + +#: siglist.c:87 +msgid "Killed" +msgstr "Prekinut" + +#: siglist.c:91 +msgid "Bus error" +msgstr "Sabirnička greška" + +#: siglist.c:95 +msgid "Segmentation fault" +msgstr "Segmentacijska greška" + +#: siglist.c:99 +msgid "Bad system call" +msgstr "Neispravan poziv sustava" + +#: siglist.c:103 +msgid "Broken pipe" +msgstr "Prekinut cjevovod" + +#: siglist.c:107 +msgid "Alarm clock" +msgstr "Budilica" + +#: siglist.c:111 +msgid "Terminated" +msgstr "Završen" + +#: siglist.c:115 +msgid "Urgent IO condition" +msgstr "Hitno U/I stanje" + +#: siglist.c:119 +msgid "Stopped (signal)" +msgstr "Zaustavljen (signalom)" + +#: siglist.c:127 +msgid "Continue" +msgstr "Nastavi" + +#: siglist.c:135 +msgid "Child death or stop" +msgstr "Dijete je umrlo ili zaustavljeno" + +#: siglist.c:139 +msgid "Stopped (tty input)" +msgstr "Zaustavljen (tty ulaz)" + +#: siglist.c:143 +msgid "Stopped (tty output)" +msgstr "Zaustavljen (tty izlaz)" + +#: siglist.c:147 +msgid "I/O ready" +msgstr "U/I spreman" + +#: siglist.c:151 +msgid "CPU limit" +msgstr "Ograničenje procesora" + +#: siglist.c:155 +msgid "File limit" +msgstr "Ograničenje datoteke" + +#: siglist.c:159 +msgid "Alarm (virtual)" +msgstr "Budilica (virtualna)" + +#: siglist.c:163 +msgid "Alarm (profile)" +msgstr "" + +#: siglist.c:167 +msgid "Window changed" +msgstr "Promijenjen prozor" + +#: siglist.c:171 +msgid "Record lock" +msgstr "" + +#: siglist.c:175 +msgid "User signal 1" +msgstr "Korisnički signal 1" + +#: siglist.c:179 +msgid "User signal 2" +msgstr "Korisnički signal 2" + +#: siglist.c:183 +msgid "HFT input data pending" +msgstr "" + +#: siglist.c:187 +msgid "power failure imminent" +msgstr "prekid napajanja je neizbježan" + +#: siglist.c:191 +msgid "system crash imminent" +msgstr "rušenje sustava je neizbježno" + +#: siglist.c:195 +msgid "migrate process to another CPU" +msgstr "preseli proces na drugi procesor" + +#: siglist.c:199 +msgid "programming error" +msgstr "greška programiranja" + +#: siglist.c:203 +msgid "HFT monitor mode granted" +msgstr "" + +#: siglist.c:207 +msgid "HFT monitor mode retracted" +msgstr "" + +#: siglist.c:211 +msgid "HFT sound sequence has completed" +msgstr "" + +#: siglist.c:215 +msgid "Information request" +msgstr "Zahtjev za informacijom" + +#: siglist.c:223 +msgid "Unknown Signal #" +msgstr "Nepoznat signal #" + +#: siglist.c:225 +#, c-format +msgid "Unknown Signal #%d" +msgstr "Nepoznat signal #%d" + +#: subst.c:1362 subst.c:1520 +#, c-format +msgid "bad substitution: no closing `%s' in %s" +msgstr "neispravna zamjena: nema zatvorene „%s” u %s" + +#: subst.c:2847 +#, c-format +msgid "%s: cannot assign list to array member" +msgstr "%s: ne mogu pridružiti popis elementu polja" + +#: subst.c:5065 subst.c:5081 +msgid "cannot make pipe for process substitution" +msgstr "ne mogu napraviti cjevovod za zamjenu procesa" + +#: subst.c:5113 +msgid "cannot make child for process substitution" +msgstr "ne mogu napraviti dijete za zamjenu procesa" + +#: subst.c:5158 +#, c-format +msgid "cannot open named pipe %s for reading" +msgstr "ne mogu otvoriti imenovani cjevovod %s za čitanje" + +#: subst.c:5160 +#, c-format +msgid "cannot open named pipe %s for writing" +msgstr "ne mogu otvoriti imenovani cjevovod %s za pisanje" + +#: subst.c:5178 +#, c-format +msgid "cannot duplicate named pipe %s as fd %d" +msgstr "ne mogu udvostručiti imenovani cjevovod %s kao opisnik datoteke %d" + +#: subst.c:5376 +msgid "cannot make pipe for command substitution" +msgstr "ne mogu napraviti cjevovod za zamjenu naredbi" + +#: subst.c:5414 +msgid "cannot make child for command substitution" +msgstr "ne mogu napraviti dijete za zamjenu naredbi" + +#: subst.c:5433 +msgid "command_substitute: cannot duplicate pipe as fd 1" +msgstr "" +"command_substitute: ne mogu udvostručiti cjevovod kao opisnik datoteke 1" + +#: subst.c:5837 subst.c:8050 +#, c-format +msgid "%s: invalid variable name for name reference" +msgstr "" + +#: subst.c:6048 +#, c-format +msgid "%s: parameter null or not set" +msgstr "%s: parametar prazan ili nije postavljen" + +#: subst.c:6320 subst.c:6335 +#, c-format +msgid "%s: substring expression < 0" +msgstr "%s: izraz podniza < 0" + +#: subst.c:7506 +#, c-format +msgid "%s: bad substitution" +msgstr "%s: neispravna zamjena" + +#: subst.c:7583 +#, c-format +msgid "$%s: cannot assign in this way" +msgstr "$%s: ne mogu pridružiti na ovaj način" + +#: subst.c:7917 +msgid "" +"future versions of the shell will force evaluation as an arithmetic " +"substitution" +msgstr "buduće inačice ljuske će prisiliti procjenu kao aritmetičku zamjenu" + +#: subst.c:8421 +#, c-format +msgid "bad substitution: no closing \"`\" in %s" +msgstr "neispravna zamjena: nema zatvorenog „`” u %s" + +#: subst.c:9322 +#, c-format +msgid "no match: %s" +msgstr "nema podudaranja: %s" + +#: test.c:147 +msgid "argument expected" +msgstr "očekujem argument" + +#: test.c:156 +#, c-format +msgid "%s: integer expression expected" +msgstr "%s: očekujem cjelobrojni izraz" + +#: test.c:264 +msgid "`)' expected" +msgstr "očekujem „)”" + +#: test.c:266 +#, c-format +msgid "`)' expected, found %s" +msgstr "očekujem „)”, našao %s" + +#: test.c:281 test.c:742 test.c:745 +#, c-format +msgid "%s: unary operator expected" +msgstr "%s: očekujem unarni operator" + +#: test.c:468 test.c:785 +#, c-format +msgid "%s: binary operator expected" +msgstr "%s: očekujem binarni operator" + +#: test.c:860 +msgid "missing `]'" +msgstr "nedostaje „]”" + +#: trap.c:217 +msgid "invalid signal number" +msgstr "neispravan broj signala" + +#: trap.c:371 +#, c-format +msgid "run_pending_traps: bad value in trap_list[%d]: %p" +msgstr "" + +#: trap.c:375 +#, c-format +msgid "" +"run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself" +msgstr "" + +#: trap.c:428 +#, c-format +msgid "trap_handler: bad signal %d" +msgstr "trap_handler: neispravan signal %d" + +#: variables.c:382 +#, c-format +msgid "error importing function definition for `%s'" +msgstr "greška pri uvozu definicije funkcije za „%s”" + +#: variables.c:780 +#, c-format +msgid "shell level (%d) too high, resetting to 1" +msgstr "razina ljuske (%d) je previsoka, vraćam na 1" + +#: variables.c:1865 +#, c-format +msgid "%s: circular name reference" +msgstr "" + +#: variables.c:2228 +msgid "make_local_variable: no function context at current scope" +msgstr "" + +#: variables.c:2247 +#, fuzzy, c-format +msgid "%s: variable may not be assigned value" +msgstr "%s: ne mogu pridružiti opisnik datoteke varijabli" + +#: variables.c:3646 +msgid "all_local_variables: no function context at current scope" +msgstr "" + +#: variables.c:3891 +#, c-format +msgid "%s has null exportstr" +msgstr "%s ima prazan exportstr" + +#: variables.c:3896 variables.c:3905 +#, c-format +msgid "invalid character %d in exportstr for %s" +msgstr "" + +#: variables.c:3911 +#, c-format +msgid "no `=' in exportstr for %s" +msgstr "" + +#: variables.c:4344 +msgid "pop_var_context: head of shell_variables not a function context" +msgstr "" + +#: variables.c:4357 +msgid "pop_var_context: no global_variables context" +msgstr "" + +#: variables.c:4431 +msgid "pop_scope: head of shell_variables not a temporary environment scope" +msgstr "" + +#: variables.c:5257 +#, c-format +msgid "%s: %s: cannot open as FILE" +msgstr "%s: %s: ne mogu otvoriti kao DATOTEKU" + +#: variables.c:5262 +#, c-format +msgid "%s: %s: invalid value for trace file descriptor" +msgstr "" + +#: variables.c:5307 +#, fuzzy, c-format +msgid "%s: %s: compatibility value out of range" +msgstr "%s: %s je izvan granica" + +#: version.c:46 +#, fuzzy +msgid "Copyright (C) 2013 Free Software Foundation, Inc." +msgstr "Copyright © 2011 Free Software Foundation, Inc." + +#: version.c:47 version2.c:47 +msgid "" +"License GPLv3+: GNU GPL version 3 or later \n" +msgstr "" +"Licenca GPLv3+: GNU GPL inačica 3 ili novija \n" + +#: version.c:86 version2.c:86 +#, c-format +msgid "GNU bash, version %s (%s)\n" +msgstr "GNU bash, inačica %s (%s)\n" + +#: version.c:91 version2.c:91 +#, fuzzy +msgid "This is free software; you are free to change and redistribute it." +msgstr "Ovo je slobodan softver, slobodno ga smijete mijenjati i dijeliti.\n" + +#: version.c:92 version2.c:92 +#, fuzzy +msgid "There is NO WARRANTY, to the extent permitted by law." +msgstr "NEMA JAMSTAVA, do krajnje mjere dozvoljene zakonom.\n" + +#: version2.c:46 +#, fuzzy +msgid "Copyright (C) 2012 Free Software Foundation, Inc." +msgstr "Copyright © 2011 Free Software Foundation, Inc." + +#: xmalloc.c:91 +#, c-format +msgid "%s: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "%s: ne mogu alocirati %lu bajtova (alocirano %lu bajtova)" + +#: xmalloc.c:93 +#, c-format +msgid "%s: cannot allocate %lu bytes" +msgstr "%s: ne mogu alocirati %lu bajtova" + +#: xmalloc.c:163 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)" +msgstr "%s: %s:%d: ne mogu alocirati %lu bajtova (alocirano %lu bajtova)" + +#: xmalloc.c:165 +#, c-format +msgid "%s: %s:%d: cannot allocate %lu bytes" +msgstr "%s: %s:%d: ne mogu alocirati %lu bajtova" + +#: builtins.c:43 +msgid "alias [-p] [name[=value] ... ]" +msgstr "alias [-p] [ime[=vrijednost] ... ]" + +#: builtins.c:47 +msgid "unalias [-a] name [name ...]" +msgstr "unalias [-a] ime [ime ...]" + +#: builtins.c:51 +msgid "" +"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-" +"x keyseq:shell-command] [keyseq:readline-function or readline-command]" +msgstr "" + +#: builtins.c:54 +msgid "break [n]" +msgstr "" + +#: builtins.c:56 +msgid "continue [n]" +msgstr "" + +#: builtins.c:58 +msgid "builtin [shell-builtin [arg ...]]" +msgstr "" + +#: builtins.c:61 +msgid "caller [expr]" +msgstr "" + +#: builtins.c:64 +msgid "cd [-L|[-P [-e]] [-@]] [dir]" +msgstr "" + +#: builtins.c:66 +msgid "pwd [-LP]" +msgstr "pwd [-LP]" + +#: builtins.c:68 +msgid ":" +msgstr ":" + +#: builtins.c:70 +msgid "true" +msgstr "" + +#: builtins.c:72 +msgid "false" +msgstr "" + +#: builtins.c:74 +msgid "command [-pVv] command [arg ...]" +msgstr "" + +#: builtins.c:76 +#, fuzzy +msgid "declare [-aAfFgilnrtux] [-p] [name[=value] ...]" +msgstr "alias [-p] [ime[=vrijednost] ... ]" + +#: builtins.c:78 +msgid "typeset [-aAfFgilrtux] [-p] name[=value] ..." +msgstr "" + +#: builtins.c:80 +msgid "local [option] name[=value] ..." +msgstr "" + +#: builtins.c:83 +msgid "echo [-neE] [arg ...]" +msgstr "" + +#: builtins.c:87 +msgid "echo [-n] [arg ...]" +msgstr "" + +#: builtins.c:90 +msgid "enable [-a] [-dnps] [-f filename] [name ...]" +msgstr "" + +#: builtins.c:92 +msgid "eval [arg ...]" +msgstr "" + +#: builtins.c:94 +msgid "getopts optstring name [arg]" +msgstr "" + +#: builtins.c:96 +msgid "exec [-cl] [-a name] [command [arguments ...]] [redirection ...]" +msgstr "" + +#: builtins.c:98 +msgid "exit [n]" +msgstr "" + +#: builtins.c:100 +msgid "logout [n]" +msgstr "" + +#: builtins.c:103 +msgid "fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]" +msgstr "" + +#: builtins.c:107 +msgid "fg [job_spec]" +msgstr "" + +#: builtins.c:111 +msgid "bg [job_spec ...]" +msgstr "" + +#: builtins.c:114 +msgid "hash [-lr] [-p pathname] [-dt] [name ...]" +msgstr "" + +#: builtins.c:117 +msgid "help [-dms] [pattern ...]" +msgstr "" + +#: builtins.c:121 +msgid "" +"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg " +"[arg...]" +msgstr "" + +#: builtins.c:125 +msgid "jobs [-lnprs] [jobspec ...] or jobs -x command [args]" +msgstr "" + +#: builtins.c:129 +msgid "disown [-h] [-ar] [jobspec ...]" +msgstr "" + +#: builtins.c:132 +msgid "" +"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l " +"[sigspec]" +msgstr "" + +#: builtins.c:134 +msgid "let arg [arg ...]" +msgstr "" + +#: builtins.c:136 +msgid "" +"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p " +"prompt] [-t timeout] [-u fd] [name ...]" +msgstr "" + +#: builtins.c:138 +msgid "return [n]" +msgstr "" + +#: builtins.c:140 +msgid "set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]" +msgstr "" + +#: builtins.c:142 +#, fuzzy +msgid "unset [-f] [-v] [-n] [name ...]" +msgstr "unalias [-a] ime [ime ...]" + +#: builtins.c:144 +msgid "export [-fn] [name[=value] ...] or export -p" +msgstr "" + +#: builtins.c:146 +msgid "readonly [-aAf] [name[=value] ...] or readonly -p" +msgstr "" + +#: builtins.c:148 +msgid "shift [n]" +msgstr "" + +#: builtins.c:150 +msgid "source filename [arguments]" +msgstr "" + +#: builtins.c:152 +msgid ". filename [arguments]" +msgstr "" + +#: builtins.c:155 +msgid "suspend [-f]" +msgstr "" + +#: builtins.c:158 +msgid "test [expr]" +msgstr "" + +#: builtins.c:160 +msgid "[ arg... ]" +msgstr "" + +#: builtins.c:162 +msgid "times" +msgstr "" + +#: builtins.c:164 +msgid "trap [-lp] [[arg] signal_spec ...]" +msgstr "" + +#: builtins.c:166 +msgid "type [-afptP] name [name ...]" +msgstr "" + +#: builtins.c:169 +msgid "ulimit [-SHabcdefilmnpqrstuvxT] [limit]" +msgstr "" + +#: builtins.c:172 +msgid "umask [-p] [-S] [mode]" +msgstr "" + +#: builtins.c:175 +msgid "wait [-n] [id ...]" +msgstr "" + +#: builtins.c:179 +msgid "wait [pid ...]" +msgstr "" + +#: builtins.c:182 +msgid "for NAME [in WORDS ... ] ; do COMMANDS; done" +msgstr "" + +#: builtins.c:184 +msgid "for (( exp1; exp2; exp3 )); do COMMANDS; done" +msgstr "" + +#: builtins.c:186 +msgid "select NAME [in WORDS ... ;] do COMMANDS; done" +msgstr "" + +#: builtins.c:188 +msgid "time [-p] pipeline" +msgstr "" + +#: builtins.c:190 +msgid "case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac" +msgstr "" + +#: builtins.c:192 +msgid "" +"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else " +"COMMANDS; ] fi" +msgstr "" + +#: builtins.c:194 +msgid "while COMMANDS; do COMMANDS; done" +msgstr "" + +#: builtins.c:196 +msgid "until COMMANDS; do COMMANDS; done" +msgstr "" + +#: builtins.c:198 +msgid "coproc [NAME] command [redirections]" +msgstr "" + +#: builtins.c:200 +msgid "function name { COMMANDS ; } or name () { COMMANDS ; }" +msgstr "" + +#: builtins.c:202 +msgid "{ COMMANDS ; }" +msgstr "" + +#: builtins.c:204 +msgid "job_spec [&]" +msgstr "" + +#: builtins.c:206 +msgid "(( expression ))" +msgstr "(( izraz ))" + +#: builtins.c:208 +msgid "[[ expression ]]" +msgstr "[[ izraz ]]" + +#: builtins.c:210 +msgid "variables - Names and meanings of some shell variables" +msgstr "" + +#: builtins.c:213 +msgid "pushd [-n] [+N | -N | dir]" +msgstr "pushd [-n] [+N | -N | direktorij]" + +#: builtins.c:217 +msgid "popd [-n] [+N | -N]" +msgstr "popd [-n] [+N | -N]" + +#: builtins.c:221 +msgid "dirs [-clpv] [+N] [-N]" +msgstr "" + +#: builtins.c:224 +msgid "shopt [-pqsu] [-o] [optname ...]" +msgstr "" + +#: builtins.c:226 +msgid "printf [-v var] format [arguments]" +msgstr "" + +#: builtins.c:229 +msgid "" +"complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-" +"W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S " +"suffix] [name ...]" +msgstr "" + +#: builtins.c:233 +msgid "" +"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] " +"[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]" +msgstr "" + +#: builtins.c:237 +msgid "compopt [-o|+o option] [-DE] [name ...]" +msgstr "" + +#: builtins.c:240 +msgid "" +"mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" + +#: builtins.c:242 +msgid "" +"readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c " +"quantum] [array]" +msgstr "" + +#: builtins.c:254 +msgid "" +"Define or display aliases.\n" +" \n" +" Without arguments, `alias' prints the list of aliases in the reusable\n" +" form `alias NAME=VALUE' on standard output.\n" +" \n" +" Otherwise, an alias is defined for each NAME whose VALUE is given.\n" +" A trailing space in VALUE causes the next word to be checked for\n" +" alias substitution when the alias is expanded.\n" +" \n" +" Options:\n" +" -p\tPrint all defined aliases in a reusable format\n" +" \n" +" Exit Status:\n" +" alias returns true unless a NAME is supplied for which no alias has " +"been\n" +" defined." +msgstr "" + +#: builtins.c:276 +msgid "" +"Remove each NAME from the list of defined aliases.\n" +" \n" +" Options:\n" +" -a\tremove all alias definitions.\n" +" \n" +" Return success unless a NAME is not an existing alias." +msgstr "" + +#: builtins.c:289 +msgid "" +"Set Readline key bindings and variables.\n" +" \n" +" Bind a key sequence to a Readline function or a macro, or set a\n" +" Readline variable. The non-option argument syntax is equivalent to\n" +" that found in ~/.inputrc, but must be passed as a single argument:\n" +" e.g., bind '\"\\C-x\\C-r\": re-read-init-file'.\n" +" \n" +" Options:\n" +" -m keymap Use KEYMAP as the keymap for the duration of this\n" +" command. Acceptable keymap names are emacs,\n" +" emacs-standard, emacs-meta, emacs-ctlx, vi, vi-" +"move,\n" +" vi-command, and vi-insert.\n" +" -l List names of functions.\n" +" -P List function names and bindings.\n" +" -p List functions and bindings in a form that can be\n" +" reused as input.\n" +" -S List key sequences that invoke macros and their " +"values\n" +" -s List key sequences that invoke macros and their " +"values\n" +" in a form that can be reused as input.\n" +" -V List variable names and values\n" +" -v List variable names and values in a form that can\n" +" be reused as input.\n" +" -q function-name Query about which keys invoke the named function.\n" +" -u function-name Unbind all keys which are bound to the named " +"function.\n" +" -r keyseq Remove the binding for KEYSEQ.\n" +" -f filename Read key bindings from FILENAME.\n" +" -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when\n" +" \t\t\t\tKEYSEQ is entered.\n" +" -X\t\t List key sequences bound with -x and associated commands\n" +" in a form that can be reused as input.\n" +" \n" +" Exit Status:\n" +" bind returns 0 unless an unrecognized option is given or an error occurs." +msgstr "" + +#: builtins.c:328 +msgid "" +"Exit for, while, or until loops.\n" +" \n" +" Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n" +" loops.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" + +#: builtins.c:340 +msgid "" +"Resume for, while, or until loops.\n" +" \n" +" Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n" +" If N is specified, resumes the Nth enclosing loop.\n" +" \n" +" Exit Status:\n" +" The exit status is 0 unless N is not greater than or equal to 1." +msgstr "" + +#: builtins.c:352 +msgid "" +"Execute shell builtins.\n" +" \n" +" Execute SHELL-BUILTIN with arguments ARGs without performing command\n" +" lookup. This is useful when you wish to reimplement a shell builtin\n" +" as a shell function, but need to execute the builtin within the " +"function.\n" +" \n" +" Exit Status:\n" +" Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n" +" not a shell builtin.." +msgstr "" + +#: builtins.c:367 +msgid "" +"Return the context of the current subroutine call.\n" +" \n" +" Without EXPR, returns \"$line $filename\". With EXPR, returns\n" +" \"$line $subroutine $filename\"; this extra information can be used to\n" +" provide a stack trace.\n" +" \n" +" The value of EXPR indicates how many call frames to go back before the\n" +" current one; the top frame is frame 0.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless the shell is not executing a shell function or EXPR\n" +" is invalid." +msgstr "" + +#: builtins.c:385 +msgid "" +"Change the shell working directory.\n" +" \n" +" Change the current directory to DIR. The default DIR is the value of " +"the\n" +" HOME shell variable.\n" +" \n" +" The variable CDPATH defines the search path for the directory " +"containing\n" +" DIR. Alternative directory names in CDPATH are separated by a colon " +"(:).\n" +" A null directory name is the same as the current directory. If DIR " +"begins\n" +" with a slash (/), then CDPATH is not used.\n" +" \n" +" If the directory is not found, and the shell option `cdable_vars' is " +"set,\n" +" the word is assumed to be a variable name. If that variable has a " +"value,\n" +" its value is used for DIR.\n" +" \n" +" Options:\n" +" -L\tforce symbolic links to be followed: resolve symbolic links in\n" +" \tDIR after processing instances of `..'\n" +" -P\tuse the physical directory structure without following symbolic\n" +" \tlinks: resolve symbolic links in DIR before processing instances\n" +" \tof `..'\n" +" -e\tif the -P option is supplied, and the current working directory\n" +" \tcannot be determined successfully, exit with a non-zero status\n" +" -@ on systems that support it, present a file with extended " +"attributes\n" +" as a directory containing the file attributes\n" +" \n" +" The default is to follow symbolic links, as if `-L' were specified.\n" +" `..' is processed by removing the immediately previous pathname " +"component\n" +" back to a slash or the beginning of DIR.\n" +" \n" +" Exit Status:\n" +" Returns 0 if the directory is changed, and if $PWD is set successfully " +"when\n" +" -P is used; non-zero otherwise." +msgstr "" + +#: builtins.c:422 +msgid "" +"Print the name of the current working directory.\n" +" \n" +" Options:\n" +" -L\tprint the value of $PWD if it names the current working\n" +" \tdirectory\n" +" -P\tprint the physical directory, without any symbolic links\n" +" \n" +" By default, `pwd' behaves as if `-L' were specified.\n" +" \n" +" Exit Status:\n" +" Returns 0 unless an invalid option is given or the current directory\n" +" cannot be read." +msgstr "" + +#: builtins.c:439 +msgid "" +"Null command.\n" +" \n" +" No effect; the command does nothing.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Prazna naredba.\n" +" \n" +" Nema efekta, ova naredba ne radi ništa.\n" +" \n" +" Izlazno stanje:\n" +" Uvijek uspješno." + +#: builtins.c:450 +msgid "" +"Return a successful result.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" +"Vrati uspješan rezultat.\n" +" \n" +" Izlazno stanje:\n" +" Uvijek uspješno." + +#: builtins.c:459 +msgid "" +"Return an unsuccessful result.\n" +" \n" +" Exit Status:\n" +" Always fails." +msgstr "" +"Vrati neuspješan rezultat.\n" +" \n" +" Izlazno stanje:\n" +" Uvijek neuspješno." + +#: builtins.c:468 +msgid "" +"Execute a simple command or display information about commands.\n" +" \n" +" Runs COMMAND with ARGS suppressing shell function lookup, or display\n" +" information about the specified COMMANDs. Can be used to invoke " +"commands\n" +" on disk when a function with the same name exists.\n" +" \n" +" Options:\n" +" -p\tuse a default value for PATH that is guaranteed to find all of\n" +" \tthe standard utilities\n" +" -v\tprint a description of COMMAND similar to the `type' builtin\n" +" -V\tprint a more verbose description of each COMMAND\n" +" \n" +" Exit Status:\n" +" Returns exit status of COMMAND, or failure if COMMAND is not found." +msgstr "" + +#: builtins.c:487 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Declare variables and give them attributes. If no NAMEs are given,\n" +" display the attributes and values of all variables.\n" +" \n" +" Options:\n" +" -f\trestrict action or display to function names and definitions\n" +" -F\trestrict display to function names only (plus line number and\n" +" \tsource file when debugging)\n" +" -g\tcreate global variables when used in a shell function; otherwise\n" +" \tignored\n" +" -p\tdisplay the attributes and value of each NAME\n" +" \n" +" Options which set attributes:\n" +" -a\tto make NAMEs indexed arrays (if supported)\n" +" -A\tto make NAMEs associative arrays (if supported)\n" +" -i\tto make NAMEs have the `integer' attribute\n" +" -l\tto convert NAMEs to lower case on assignment\n" +" -n\tmake NAME a reference to the variable named by its value\n" +" -r\tto make NAMEs readonly\n" +" -t\tto make NAMEs have the `trace' attribute\n" +" -u\tto convert NAMEs to upper case on assignment\n" +" -x\tto make NAMEs export\n" +" \n" +" Using `+' instead of `-' turns off the given attribute.\n" +" \n" +" Variables with the integer attribute have arithmetic evaluation (see\n" +" the `let' command) performed when the variable is assigned a value.\n" +" \n" +" When used in a function, `declare' makes NAMEs local, as with the " +"`local'\n" +" command. The `-g' option suppresses this behavior.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or a variable\n" +" assignment error occurs." +msgstr "" + +#: builtins.c:527 +msgid "" +"Set variable values and attributes.\n" +" \n" +" Obsolete. See `help declare'." +msgstr "" +"Postavi vrijednosti i svojstva varijabli.\n" +" \n" +" Zastarjelo. Pogledajte „help declare”." + +#: builtins.c:535 +msgid "" +"Define local variables.\n" +" \n" +" Create a local variable called NAME, and give it VALUE. OPTION can\n" +" be any option accepted by `declare'.\n" +" \n" +" Local variables can only be used within a function; they are visible\n" +" only to the function where they are defined and its children.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied, a variable\n" +" assignment error occurs, or the shell is not executing a function." +msgstr "" + +#: builtins.c:552 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs, separated by a single space character and followed by " +"a\n" +" newline, on the standard output.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" -e\tenable interpretation of the following backslash escapes\n" +" -E\texplicitly suppress interpretation of backslash escapes\n" +" \n" +" `echo' interprets the following backslash-escaped characters:\n" +" \\a\talert (bell)\n" +" \\b\tbackspace\n" +" \\c\tsuppress further output\n" +" \\e\tescape character\n" +" \\E\tescape character\n" +" \\f\tform feed\n" +" \\n\tnew line\n" +" \\r\tcarriage return\n" +" \\t\thorizontal tab\n" +" \\v\tvertical tab\n" +" \\\\\tbackslash\n" +" \\0nnn\tthe character whose ASCII code is NNN (octal). NNN can be\n" +" \t0 to 3 octal digits\n" +" \\xHH\tthe eight-bit character whose value is HH (hexadecimal). HH\n" +" \tcan be one or two hex digits\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" + +#: builtins.c:588 +msgid "" +"Write arguments to the standard output.\n" +" \n" +" Display the ARGs on the standard output followed by a newline.\n" +" \n" +" Options:\n" +" -n\tdo not append a newline\n" +" \n" +" Exit Status:\n" +" Returns success unless a write error occurs." +msgstr "" + +#: builtins.c:603 +msgid "" +"Enable and disable shell builtins.\n" +" \n" +" Enables and disables builtin shell commands. Disabling allows you to\n" +" execute a disk command which has the same name as a shell builtin\n" +" without using a full pathname.\n" +" \n" +" Options:\n" +" -a\tprint a list of builtins showing whether or not each is enabled\n" +" -n\tdisable each NAME or display a list of disabled builtins\n" +" -p\tprint the list of builtins in a reusable format\n" +" -s\tprint only the names of Posix `special' builtins\n" +" \n" +" Options controlling dynamic loading:\n" +" -f\tLoad builtin NAME from shared object FILENAME\n" +" -d\tRemove a builtin loaded with -f\n" +" \n" +" Without options, each NAME is enabled.\n" +" \n" +" To use the `test' found in $PATH instead of the shell builtin\n" +" version, type `enable -n test'.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not a shell builtin or an error occurs." +msgstr "" + +#: builtins.c:631 +msgid "" +"Execute arguments as a shell command.\n" +" \n" +" Combine ARGs into a single string, use the result as input to the " +"shell,\n" +" and execute the resulting commands.\n" +" \n" +" Exit Status:\n" +" Returns exit status of command or success if command is null." +msgstr "" + +#: builtins.c:643 +msgid "" +"Parse option arguments.\n" +" \n" +" Getopts is used by shell procedures to parse positional parameters\n" +" as options.\n" +" \n" +" OPTSTRING contains the option letters to be recognized; if a letter\n" +" is followed by a colon, the option is expected to have an argument,\n" +" which should be separated from it by white space.\n" +" \n" +" Each time it is invoked, getopts will place the next option in the\n" +" shell variable $name, initializing name if it does not exist, and\n" +" the index of the next argument to be processed into the shell\n" +" variable OPTIND. OPTIND is initialized to 1 each time the shell or\n" +" a shell script is invoked. When an option requires an argument,\n" +" getopts places that argument into the shell variable OPTARG.\n" +" \n" +" getopts reports errors in one of two ways. If the first character\n" +" of OPTSTRING is a colon, getopts uses silent error reporting. In\n" +" this mode, no error messages are printed. If an invalid option is\n" +" seen, getopts places the option character found into OPTARG. If a\n" +" required argument is not found, getopts places a ':' into NAME and\n" +" sets OPTARG to the option character found. If getopts is not in\n" +" silent mode, and an invalid option is seen, getopts places '?' into\n" +" NAME and unsets OPTARG. If a required argument is not found, a '?'\n" +" is placed in NAME, OPTARG is unset, and a diagnostic message is\n" +" printed.\n" +" \n" +" If the shell variable OPTERR has the value 0, getopts disables the\n" +" printing of error messages, even if the first character of\n" +" OPTSTRING is not a colon. OPTERR has the value 1 by default.\n" +" \n" +" Getopts normally parses the positional parameters ($0 - $9), but if\n" +" more arguments are given, they are parsed instead.\n" +" \n" +" Exit Status:\n" +" Returns success if an option is found; fails if the end of options is\n" +" encountered or an error occurs." +msgstr "" + +#: builtins.c:685 +msgid "" +"Replace the shell with the given command.\n" +" \n" +" Execute COMMAND, replacing this shell with the specified program.\n" +" ARGUMENTS become the arguments to COMMAND. If COMMAND is not " +"specified,\n" +" any redirections take effect in the current shell.\n" +" \n" +" Options:\n" +" -a name\tpass NAME as the zeroth argument to COMMAND\n" +" -c\t\texecute COMMAND with an empty environment\n" +" -l\t\tplace a dash in the zeroth argument to COMMAND\n" +" \n" +" If the command cannot be executed, a non-interactive shell exits, " +"unless\n" +" the shell option `execfail' is set.\n" +" \n" +" Exit Status:\n" +" Returns success unless COMMAND is not found or a redirection error " +"occurs." +msgstr "" + +#: builtins.c:706 +msgid "" +"Exit the shell.\n" +" \n" +" Exits the shell with a status of N. If N is omitted, the exit status\n" +" is that of the last command executed." +msgstr "" +"Izađi iz ljuske.\n" +" \n" +" Izlazi iz ljuske sa stanjem N. Ako N nije naveden, izlazno stanje je\n" +" isto kao i stanje zadnje izvršene naredbe." + +#: builtins.c:715 +msgid "" +"Exit a login shell.\n" +" \n" +" Exits a login shell with exit status N. Returns an error if not " +"executed\n" +" in a login shell." +msgstr "" +"Izađi iz prijavne ljuske.\n" +" \n" +" Izlazi iz prijavne ljuske s izlaznim stanjem N. Vraća grešku ako nije\n" +" izvršeno u prijavnoj ljusci." + +#: builtins.c:725 +msgid "" +"Display or execute commands from the history list.\n" +" \n" +" fc is used to list or edit and re-execute commands from the history " +"list.\n" +" FIRST and LAST can be numbers specifying the range, or FIRST can be a\n" +" string, which means the most recent command beginning with that\n" +" string.\n" +" \n" +" Options:\n" +" -e ENAME\tselect which editor to use. Default is FCEDIT, then " +"EDITOR,\n" +" \t\tthen vi\n" +" -l \tlist lines instead of editing\n" +" -n\tomit line numbers when listing\n" +" -r\treverse the order of the lines (newest listed first)\n" +" \n" +" With the `fc -s [pat=rep ...] [command]' format, COMMAND is\n" +" re-executed after the substitution OLD=NEW is performed.\n" +" \n" +" A useful alias to use with this is r='fc -s', so that typing `r cc'\n" +" runs the last command beginning with `cc' and typing `r' re-executes\n" +" the last command.\n" +" \n" +" Exit Status:\n" +" Returns success or status of executed command; non-zero if an error " +"occurs." +msgstr "" + +#: builtins.c:755 +msgid "" +"Move job to the foreground.\n" +" \n" +" Place the job identified by JOB_SPEC in the foreground, making it the\n" +" current job. If JOB_SPEC is not present, the shell's notion of the\n" +" current job is used.\n" +" \n" +" Exit Status:\n" +" Status of command placed in foreground, or failure if an error occurs." +msgstr "" + +#: builtins.c:770 +msgid "" +"Move jobs to the background.\n" +" \n" +" Place the jobs identified by each JOB_SPEC in the background, as if " +"they\n" +" had been started with `&'. If JOB_SPEC is not present, the shell's " +"notion\n" +" of the current job is used.\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" + +#: builtins.c:784 +msgid "" +"Remember or display program locations.\n" +" \n" +" Determine and remember the full pathname of each command NAME. If\n" +" no arguments are given, information about remembered commands is " +"displayed.\n" +" \n" +" Options:\n" +" -d\t\tforget the remembered location of each NAME\n" +" -l\t\tdisplay in a format that may be reused as input\n" +" -p pathname\tuse PATHNAME as the full pathname of NAME\n" +" -r\t\tforget all remembered locations\n" +" -t\t\tprint the remembered location of each NAME, preceding\n" +" \t\teach location with the corresponding NAME if multiple\n" +" \t\tNAMEs are given\n" +" Arguments:\n" +" NAME\t\tEach NAME is searched for in $PATH and added to the list\n" +" \t\tof remembered commands.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is not found or an invalid option is given." +msgstr "" + +#: builtins.c:809 +msgid "" +"Display information about builtin commands.\n" +" \n" +" Displays brief summaries of builtin commands. If PATTERN is\n" +" specified, gives detailed help on all commands matching PATTERN,\n" +" otherwise the list of help topics is printed.\n" +" \n" +" Options:\n" +" -d\toutput short description for each topic\n" +" -m\tdisplay usage in pseudo-manpage format\n" +" -s\toutput only a short usage synopsis for each topic matching\n" +" \tPATTERN\n" +" \n" +" Arguments:\n" +" PATTERN\tPattern specifiying a help topic\n" +" \n" +" Exit Status:\n" +" Returns success unless PATTERN is not found or an invalid option is " +"given." +msgstr "" + +#: builtins.c:833 +msgid "" +"Display or manipulate the history list.\n" +" \n" +" Display the history list with line numbers, prefixing each modified\n" +" entry with a `*'. An argument of N lists only the last N entries.\n" +" \n" +" Options:\n" +" -c\tclear the history list by deleting all of the entries\n" +" -d offset\tdelete the history entry at offset OFFSET.\n" +" \n" +" -a\tappend history lines from this session to the history file\n" +" -n\tread all history lines not already read from the history file\n" +" -r\tread the history file and append the contents to the history\n" +" \tlist\n" +" -w\twrite the current history to the history file\n" +" \tand append them to the history list\n" +" \n" +" -p\tperform history expansion on each ARG and display the result\n" +" \twithout storing it in the history list\n" +" -s\tappend the ARGs to the history list as a single entry\n" +" \n" +" If FILENAME is given, it is used as the history file. Otherwise,\n" +" if $HISTFILE has a value, that is used, else ~/.bash_history.\n" +" \n" +" If the $HISTTIMEFORMAT variable is set and not null, its value is used\n" +" as a format string for strftime(3) to print the time stamp associated\n" +" with each displayed history entry. No time stamps are printed " +"otherwise.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" + +#: builtins.c:869 +msgid "" +"Display status of jobs.\n" +" \n" +" Lists the active jobs. JOBSPEC restricts output to that job.\n" +" Without options, the status of all active jobs is displayed.\n" +" \n" +" Options:\n" +" -l\tlists process IDs in addition to the normal information\n" +" -n\tlists only processes that have changed status since the last\n" +" \tnotification\n" +" -p\tlists process IDs only\n" +" -r\trestrict output to running jobs\n" +" -s\trestrict output to stopped jobs\n" +" \n" +" If -x is supplied, COMMAND is run after all job specifications that\n" +" appear in ARGS have been replaced with the process ID of that job's\n" +" process group leader.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs.\n" +" If -x is used, returns the exit status of COMMAND." +msgstr "" + +#: builtins.c:896 +msgid "" +"Remove jobs from current shell.\n" +" \n" +" Removes each JOBSPEC argument from the table of active jobs. Without\n" +" any JOBSPECs, the shell uses its notion of the current job.\n" +" \n" +" Options:\n" +" -a\tremove all jobs if JOBSPEC is not supplied\n" +" -h\tmark each JOBSPEC so that SIGHUP is not sent to the job if the\n" +" \tshell receives a SIGHUP\n" +" -r\tremove only running jobs\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option or JOBSPEC is given." +msgstr "" + +#: builtins.c:915 +msgid "" +"Send a signal to a job.\n" +" \n" +" Send the processes identified by PID or JOBSPEC the signal named by\n" +" SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n" +" SIGTERM is assumed.\n" +" \n" +" Options:\n" +" -s sig\tSIG is a signal name\n" +" -n sig\tSIG is a signal number\n" +" -l\tlist the signal names; if arguments follow `-l' they are\n" +" \tassumed to be signal numbers for which names should be listed\n" +" \n" +" Kill is a shell builtin for two reasons: it allows job IDs to be used\n" +" instead of process IDs, and allows processes to be killed if the limit\n" +" on processes that you can create is reached.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or an error occurs." +msgstr "" + +#: builtins.c:938 +msgid "" +"Evaluate arithmetic expressions.\n" +" \n" +" Evaluate each ARG as an arithmetic expression. Evaluation is done in\n" +" fixed-width integers with no check for overflow, though division by 0\n" +" is trapped and flagged as an error. The following list of operators is\n" +" grouped into levels of equal-precedence operators. The levels are " +"listed\n" +" in order of decreasing precedence.\n" +" \n" +" \tid++, id--\tvariable post-increment, post-decrement\n" +" \t++id, --id\tvariable pre-increment, pre-decrement\n" +" \t-, +\t\tunary minus, plus\n" +" \t!, ~\t\tlogical and bitwise negation\n" +" \t**\t\texponentiation\n" +" \t*, /, %\t\tmultiplication, division, remainder\n" +" \t+, -\t\taddition, subtraction\n" +" \t<<, >>\t\tleft and right bitwise shifts\n" +" \t<=, >=, <, >\tcomparison\n" +" \t==, !=\t\tequality, inequality\n" +" \t&\t\tbitwise AND\n" +" \t^\t\tbitwise XOR\n" +" \t|\t\tbitwise OR\n" +" \t&&\t\tlogical AND\n" +" \t||\t\tlogical OR\n" +" \texpr ? expr : expr\n" +" \t\t\tconditional operator\n" +" \t=, *=, /=, %=,\n" +" \t+=, -=, <<=, >>=,\n" +" \t&=, ^=, |=\tassignment\n" +" \n" +" Shell variables are allowed as operands. The name of the variable\n" +" is replaced by its value (coerced to a fixed-width integer) within\n" +" an expression. The variable need not have its integer attribute\n" +" turned on to be used in an expression.\n" +" \n" +" Operators are evaluated in order of precedence. Sub-expressions in\n" +" parentheses are evaluated first and may override the precedence\n" +" rules above.\n" +" \n" +" Exit Status:\n" +" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise." +msgstr "" + +#: builtins.c:983 +msgid "" +"Read a line from the standard input and split it into fields.\n" +" \n" +" Reads a single line from the standard input, or from file descriptor FD\n" +" if the -u option is supplied. The line is split into fields as with " +"word\n" +" splitting, and the first word is assigned to the first NAME, the second\n" +" word to the second NAME, and so on, with any leftover words assigned to\n" +" the last NAME. Only the characters found in $IFS are recognized as " +"word\n" +" delimiters.\n" +" \n" +" If no NAMEs are supplied, the line read is stored in the REPLY " +"variable.\n" +" \n" +" Options:\n" +" -a array\tassign the words read to sequential indices of the array\n" +" \t\tvariable ARRAY, starting at zero\n" +" -d delim\tcontinue until the first character of DELIM is read, rather\n" +" \t\tthan newline\n" +" -e\t\tuse Readline to obtain the line in an interactive shell\n" +" -i text\tUse TEXT as the initial text for Readline\n" +" -n nchars\treturn after reading NCHARS characters rather than waiting\n" +" \t\tfor a newline, but honor a delimiter if fewer than NCHARS\n" +" \t\tcharacters are read before the delimiter\n" +" -N nchars\treturn only after reading exactly NCHARS characters, " +"unless\n" +" \t\tEOF is encountered or read times out, ignoring any delimiter\n" +" -p prompt\toutput the string PROMPT without a trailing newline before\n" +" \t\tattempting to read\n" +" -r\t\tdo not allow backslashes to escape any characters\n" +" -s\t\tdo not echo input coming from a terminal\n" +" -t timeout\ttime out and return failure if a complete line of input " +"is\n" +" \t\tnot read within TIMEOUT seconds. The value of the TMOUT\n" +" \t\tvariable is the default timeout. TIMEOUT may be a\n" +" \t\tfractional number. If TIMEOUT is 0, read returns immediately,\n" +" \t\twithout trying to read any data, returning success only if\n" +" \t\tinput is available on the specified file descriptor. The\n" +" \t\texit status is greater than 128 if the timeout is exceeded\n" +" -u fd\t\tread from file descriptor FD instead of the standard input\n" +" \n" +" Exit Status:\n" +" The return code is zero, unless end-of-file is encountered, read times " +"out\n" +" (in which case it's greater than 128), a variable assignment error " +"occurs,\n" +" or an invalid file descriptor is supplied as the argument to -u." +msgstr "" + +#: builtins.c:1028 +msgid "" +"Return from a shell function.\n" +" \n" +" Causes a function or sourced script to exit with the return value\n" +" specified by N. If N is omitted, the return status is that of the\n" +" last command executed within the function or script.\n" +" \n" +" Exit Status:\n" +" Returns N, or failure if the shell is not executing a function or script." +msgstr "" + +#: builtins.c:1041 +msgid "" +"Set or unset values of shell options and positional parameters.\n" +" \n" +" Change the value of shell attributes and positional parameters, or\n" +" display the names and values of shell variables.\n" +" \n" +" Options:\n" +" -a Mark variables which are modified or created for export.\n" +" -b Notify of job termination immediately.\n" +" -e Exit immediately if a command exits with a non-zero status.\n" +" -f Disable file name generation (globbing).\n" +" -h Remember the location of commands as they are looked up.\n" +" -k All assignment arguments are placed in the environment for a\n" +" command, not just those that precede the command name.\n" +" -m Job control is enabled.\n" +" -n Read commands but do not execute them.\n" +" -o option-name\n" +" Set the variable corresponding to option-name:\n" +" allexport same as -a\n" +" braceexpand same as -B\n" +" emacs use an emacs-style line editing interface\n" +" errexit same as -e\n" +" errtrace same as -E\n" +" functrace same as -T\n" +" hashall same as -h\n" +" histexpand same as -H\n" +" history enable command history\n" +" ignoreeof the shell will not exit upon reading EOF\n" +" interactive-comments\n" +" allow comments to appear in interactive commands\n" +" keyword same as -k\n" +" monitor same as -m\n" +" noclobber same as -C\n" +" noexec same as -n\n" +" noglob same as -f\n" +" nolog currently accepted but ignored\n" +" notify same as -b\n" +" nounset same as -u\n" +" onecmd same as -t\n" +" physical same as -P\n" +" pipefail the return value of a pipeline is the status of\n" +" the last command to exit with a non-zero status,\n" +" or zero if no command exited with a non-zero " +"status\n" +" posix change the behavior of bash where the default\n" +" operation differs from the Posix standard to\n" +" match the standard\n" +" privileged same as -p\n" +" verbose same as -v\n" +" vi use a vi-style line editing interface\n" +" xtrace same as -x\n" +" -p Turned on whenever the real and effective user ids do not match.\n" +" Disables processing of the $ENV file and importing of shell\n" +" functions. Turning this option off causes the effective uid and\n" +" gid to be set to the real uid and gid.\n" +" -t Exit after reading and executing one command.\n" +" -u Treat unset variables as an error when substituting.\n" +" -v Print shell input lines as they are read.\n" +" -x Print commands and their arguments as they are executed.\n" +" -B the shell will perform brace expansion\n" +" -C If set, disallow existing regular files to be overwritten\n" +" by redirection of output.\n" +" -E If set, the ERR trap is inherited by shell functions.\n" +" -H Enable ! style history substitution. This flag is on\n" +" by default when the shell is interactive.\n" +" -P If set, do not resolve symbolic links when executing commands\n" +" such as cd which change the current directory.\n" +" -T If set, the DEBUG trap is inherited by shell functions.\n" +" -- Assign any remaining arguments to the positional parameters.\n" +" If there are no remaining arguments, the positional parameters\n" +" are unset.\n" +" - Assign any remaining arguments to the positional parameters.\n" +" The -x and -v options are turned off.\n" +" \n" +" Using + rather than - causes these flags to be turned off. The\n" +" flags can also be used upon invocation of the shell. The current\n" +" set of flags may be found in $-. The remaining n ARGs are positional\n" +" parameters and are assigned, in order, to $1, $2, .. $n. If no\n" +" ARGs are given, all shell variables are printed.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given." +msgstr "" + +#: builtins.c:1126 +msgid "" +"Unset values and attributes of shell variables and functions.\n" +" \n" +" For each NAME, remove the corresponding variable or function.\n" +" \n" +" Options:\n" +" -f\ttreat each NAME as a shell function\n" +" -v\ttreat each NAME as a shell variable\n" +" -n\ttreat each NAME as a name reference and unset the variable itself\n" +" \trather than the variable it references\n" +" \n" +" Without options, unset first tries to unset a variable, and if that " +"fails,\n" +" tries to unset a function.\n" +" \n" +" Some variables cannot be unset; also see `readonly'.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a NAME is read-only." +msgstr "" + +#: builtins.c:1148 +msgid "" +"Set export attribute for shell variables.\n" +" \n" +" Marks each NAME for automatic export to the environment of subsequently\n" +" executed commands. If VALUE is supplied, assign VALUE before " +"exporting.\n" +" \n" +" Options:\n" +" -f\trefer to shell functions\n" +" -n\tremove the export property from each NAME\n" +" -p\tdisplay a list of all exported variables and functions\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" + +#: builtins.c:1167 +msgid "" +"Mark shell variables as unchangeable.\n" +" \n" +" Mark each NAME as read-only; the values of these NAMEs may not be\n" +" changed by subsequent assignment. If VALUE is supplied, assign VALUE\n" +" before marking as read-only.\n" +" \n" +" Options:\n" +" -a\trefer to indexed array variables\n" +" -A\trefer to associative array variables\n" +" -f\trefer to shell functions\n" +" -p\tdisplay a list of all readonly variables or functions, depending " +"on\n" +" whether or not the -f option is given\n" +" \n" +" An argument of `--' disables further option processing.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or NAME is invalid." +msgstr "" + +#: builtins.c:1189 +msgid "" +"Shift positional parameters.\n" +" \n" +" Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n" +" not given, it is assumed to be 1.\n" +" \n" +" Exit Status:\n" +" Returns success unless N is negative or greater than $#." +msgstr "" + +#: builtins.c:1201 builtins.c:1216 +msgid "" +"Execute commands from a file in the current shell.\n" +" \n" +" Read and execute commands from FILENAME in the current shell. The\n" +" entries in $PATH are used to find the directory containing FILENAME.\n" +" If any ARGUMENTS are supplied, they become the positional parameters\n" +" when FILENAME is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed in FILENAME; fails if\n" +" FILENAME cannot be read." +msgstr "" + +#: builtins.c:1232 +msgid "" +"Suspend shell execution.\n" +" \n" +" Suspend the execution of this shell until it receives a SIGCONT signal.\n" +" Unless forced, login shells cannot be suspended.\n" +" \n" +" Options:\n" +" -f\tforce the suspend, even if the shell is a login shell\n" +" \n" +" Exit Status:\n" +" Returns success unless job control is not enabled or an error occurs." +msgstr "" + +#: builtins.c:1248 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" Exits with a status of 0 (true) or 1 (false) depending on\n" +" the evaluation of EXPR. Expressions may be unary or binary. Unary\n" +" expressions are often used to examine the status of a file. There\n" +" are string operators and numeric comparison operators as well.\n" +" \n" +" The behavior of test depends on the number of arguments. Read the\n" +" bash manual page for the complete specification.\n" +" \n" +" File operators:\n" +" \n" +" -a FILE True if file exists.\n" +" -b FILE True if file is block special.\n" +" -c FILE True if file is character special.\n" +" -d FILE True if file is a directory.\n" +" -e FILE True if file exists.\n" +" -f FILE True if file exists and is a regular file.\n" +" -g FILE True if file is set-group-id.\n" +" -h FILE True if file is a symbolic link.\n" +" -L FILE True if file is a symbolic link.\n" +" -k FILE True if file has its `sticky' bit set.\n" +" -p FILE True if file is a named pipe.\n" +" -r FILE True if file is readable by you.\n" +" -s FILE True if file exists and is not empty.\n" +" -S FILE True if file is a socket.\n" +" -t FD True if FD is opened on a terminal.\n" +" -u FILE True if the file is set-user-id.\n" +" -w FILE True if the file is writable by you.\n" +" -x FILE True if the file is executable by you.\n" +" -O FILE True if the file is effectively owned by you.\n" +" -G FILE True if the file is effectively owned by your group.\n" +" -N FILE True if the file has been modified since it was last " +"read.\n" +" \n" +" FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n" +" modification date).\n" +" \n" +" FILE1 -ot FILE2 True if file1 is older than file2.\n" +" \n" +" FILE1 -ef FILE2 True if file1 is a hard link to file2.\n" +" \n" +" String operators:\n" +" \n" +" -z STRING True if string is empty.\n" +" \n" +" -n STRING\n" +" STRING True if string is not empty.\n" +" \n" +" STRING1 = STRING2\n" +" True if the strings are equal.\n" +" STRING1 != STRING2\n" +" True if the strings are not equal.\n" +" STRING1 < STRING2\n" +" True if STRING1 sorts before STRING2 " +"lexicographically.\n" +" STRING1 > STRING2\n" +" True if STRING1 sorts after STRING2 lexicographically.\n" +" \n" +" Other operators:\n" +" \n" +" -o OPTION True if the shell option OPTION is enabled.\n" +" -v VAR\t True if the shell variable VAR is set\n" +" -R VAR\t True if the shell variable VAR is set and is a name " +"reference.\n" +" ! EXPR True if expr is false.\n" +" EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n" +" EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n" +" \n" +" arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n" +" -lt, -le, -gt, or -ge.\n" +" \n" +" Arithmetic binary operators return true if ARG1 is equal, not-equal,\n" +" less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n" +" than ARG2.\n" +" \n" +" Exit Status:\n" +" Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n" +" false or an invalid argument is given." +msgstr "" + +#: builtins.c:1329 +msgid "" +"Evaluate conditional expression.\n" +" \n" +" This is a synonym for the \"test\" builtin, but the last argument must\n" +" be a literal `]', to match the opening `['." +msgstr "" + +#: builtins.c:1338 +msgid "" +"Display process times.\n" +" \n" +" Prints the accumulated user and system times for the shell and all of " +"its\n" +" child processes.\n" +" \n" +" Exit Status:\n" +" Always succeeds." +msgstr "" + +#: builtins.c:1350 +msgid "" +"Trap signals and other events.\n" +" \n" +" Defines and activates handlers to be run when the shell receives " +"signals\n" +" or other conditions.\n" +" \n" +" ARG is a command to be read and executed when the shell receives the\n" +" signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n" +" is supplied) or `-', each specified signal is reset to its original\n" +" value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n" +" shell and by the commands it invokes.\n" +" \n" +" If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. " +"If\n" +" a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. " +"If\n" +" a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or " +"a\n" +" script run by the . or source builtins finishes executing. A " +"SIGNAL_SPEC\n" +" of ERR means to execute ARG each time a command's failure would cause " +"the\n" +" shell to exit when the -e option is enabled.\n" +" \n" +" If no arguments are supplied, trap prints the list of commands " +"associated\n" +" with each signal.\n" +" \n" +" Options:\n" +" -l\tprint a list of signal names and their corresponding numbers\n" +" -p\tdisplay the trap commands associated with each SIGNAL_SPEC\n" +" \n" +" Each SIGNAL_SPEC is either a signal name in or a signal " +"number.\n" +" Signal names are case insensitive and the SIG prefix is optional. A\n" +" signal may be sent to the shell with \"kill -signal $$\".\n" +" \n" +" Exit Status:\n" +" Returns success unless a SIGSPEC is invalid or an invalid option is " +"given." +msgstr "" + +#: builtins.c:1386 +msgid "" +"Display information about command type.\n" +" \n" +" For each NAME, indicate how it would be interpreted if used as a\n" +" command name.\n" +" \n" +" Options:\n" +" -a\tdisplay all locations containing an executable named NAME;\n" +" \tincludes aliases, builtins, and functions, if and only if\n" +" \tthe `-p' option is not also used\n" +" -f\tsuppress shell function lookup\n" +" -P\tforce a PATH search for each NAME, even if it is an alias,\n" +" \tbuiltin, or function, and returns the name of the disk file\n" +" \tthat would be executed\n" +" -p\treturns either the name of the disk file that would be executed,\n" +" \tor nothing if `type -t NAME' would not return `file'.\n" +" -t\toutput a single word which is one of `alias', `keyword',\n" +" \t`function', `builtin', `file' or `', if NAME is an alias, shell\n" +" \treserved word, shell function, shell builtin, disk file, or not\n" +" \tfound, respectively\n" +" \n" +" Arguments:\n" +" NAME\tCommand name to be interpreted.\n" +" \n" +" Exit Status:\n" +" Returns success if all of the NAMEs are found; fails if any are not " +"found." +msgstr "" + +#: builtins.c:1417 +msgid "" +"Modify shell resource limits.\n" +" \n" +" Provides control over the resources available to the shell and " +"processes\n" +" it creates, on systems that allow such control.\n" +" \n" +" Options:\n" +" -S\tuse the `soft' resource limit\n" +" -H\tuse the `hard' resource limit\n" +" -a\tall current limits are reported\n" +" -b\tthe socket buffer size\n" +" -c\tthe maximum size of core files created\n" +" -d\tthe maximum size of a process's data segment\n" +" -e\tthe maximum scheduling priority (`nice')\n" +" -f\tthe maximum size of files written by the shell and its children\n" +" -i\tthe maximum number of pending signals\n" +" -l\tthe maximum size a process may lock into memory\n" +" -m\tthe maximum resident set size\n" +" -n\tthe maximum number of open file descriptors\n" +" -p\tthe pipe buffer size\n" +" -q\tthe maximum number of bytes in POSIX message queues\n" +" -r\tthe maximum real-time scheduling priority\n" +" -s\tthe maximum stack size\n" +" -t\tthe maximum amount of cpu time in seconds\n" +" -u\tthe maximum number of user processes\n" +" -v\tthe size of virtual memory\n" +" -x\tthe maximum number of file locks\n" +" -T the maximum number of threads\n" +" \n" +" Not all options are available on all platforms.\n" +" \n" +" If LIMIT is given, it is the new value of the specified resource; the\n" +" special LIMIT values `soft', `hard', and `unlimited' stand for the\n" +" current soft limit, the current hard limit, and no limit, respectively.\n" +" Otherwise, the current value of the specified resource is printed. If\n" +" no option is given, then -f is assumed.\n" +" \n" +" Values are in 1024-byte increments, except for -t, which is in seconds,\n" +" -p, which is in increments of 512 bytes, and -u, which is an unscaled\n" +" number of processes.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1465 +msgid "" +"Display or set file mode mask.\n" +" \n" +" Sets the user file-creation mask to MODE. If MODE is omitted, prints\n" +" the current value of the mask.\n" +" \n" +" If MODE begins with a digit, it is interpreted as an octal number;\n" +" otherwise it is a symbolic mode string like that accepted by chmod(1).\n" +" \n" +" Options:\n" +" -p\tif MODE is omitted, output in a form that may be reused as input\n" +" -S\tmakes the output symbolic; otherwise an octal number is output\n" +" \n" +" Exit Status:\n" +" Returns success unless MODE is invalid or an invalid option is given." +msgstr "" + +#: builtins.c:1485 +msgid "" +"Wait for job completion and return exit status.\n" +" \n" +" Waits for each process identified by an ID, which may be a process ID or " +"a\n" +" job specification, and reports its termination status. If ID is not\n" +" given, waits for all currently active child processes, and the return\n" +" status is zero. If ID is a a job specification, waits for all " +"processes\n" +" in that job's pipeline.\n" +" \n" +" If the -n option is supplied, waits for the next job to terminate and\n" +" returns its exit status.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last ID; fails if ID is invalid or an invalid\n" +" option is given." +msgstr "" + +#: builtins.c:1506 +msgid "" +"Wait for process completion and return exit status.\n" +" \n" +" Waits for each process specified by a PID and reports its termination " +"status.\n" +" If PID is not given, waits for all currently active child processes,\n" +" and the return status is zero. PID must be a process ID.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last PID; fails if PID is invalid or an " +"invalid\n" +" option is given." +msgstr "" + +#: builtins.c:1521 +msgid "" +"Execute commands for each member in a list.\n" +" \n" +" The `for' loop executes a sequence of commands for each member in a\n" +" list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is\n" +" assumed. For each element in WORDS, NAME is set to that element, and\n" +" the COMMANDS are executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1535 +msgid "" +"Arithmetic for loop.\n" +" \n" +" Equivalent to\n" +" \t(( EXP1 ))\n" +" \twhile (( EXP2 )); do\n" +" \t\tCOMMANDS\n" +" \t\t(( EXP3 ))\n" +" \tdone\n" +" EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n" +" omitted, it behaves as if it evaluates to 1.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1553 +msgid "" +"Select words from a list and execute commands.\n" +" \n" +" The WORDS are expanded, generating a list of words. The\n" +" set of expanded words is printed on the standard error, each\n" +" preceded by a number. If `in WORDS' is not present, `in \"$@\"'\n" +" is assumed. The PS3 prompt is then displayed and a line read\n" +" from the standard input. If the line consists of the number\n" +" corresponding to one of the displayed words, then NAME is set\n" +" to that word. If the line is empty, WORDS and the prompt are\n" +" redisplayed. If EOF is read, the command completes. Any other\n" +" value read causes NAME to be set to null. The line read is saved\n" +" in the variable REPLY. COMMANDS are executed after each selection\n" +" until a break command is executed.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1574 +msgid "" +"Report time consumed by pipeline's execution.\n" +" \n" +" Execute PIPELINE and print a summary of the real time, user CPU time,\n" +" and system CPU time spent executing PIPELINE when it terminates.\n" +" \n" +" Options:\n" +" -p\tprint the timing summary in the portable Posix format\n" +" \n" +" The value of the TIMEFORMAT variable is used as the output format.\n" +" \n" +" Exit Status:\n" +" The return status is the return status of PIPELINE." +msgstr "" + +#: builtins.c:1591 +msgid "" +"Execute commands based on pattern matching.\n" +" \n" +" Selectively execute COMMANDS based upon WORD matching PATTERN. The\n" +" `|' is used to separate multiple patterns.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1603 +msgid "" +"Execute commands based on conditional.\n" +" \n" +" The `if COMMANDS' list is executed. If its exit status is zero, then " +"the\n" +" `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list " +"is\n" +" executed in turn, and if its exit status is zero, the corresponding\n" +" `then COMMANDS' list is executed and the if command completes. " +"Otherwise,\n" +" the `else COMMANDS' list is executed, if present. The exit status of " +"the\n" +" entire construct is the exit status of the last command executed, or " +"zero\n" +" if no condition tested true.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1620 +msgid "" +"Execute commands as long as a test succeeds.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `while' COMMANDS has an exit status of zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1632 +msgid "" +"Execute commands as long as a test does not succeed.\n" +" \n" +" Expand and execute COMMANDS as long as the final command in the\n" +" `until' COMMANDS has an exit status which is not zero.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1644 +msgid "" +"Create a coprocess named NAME.\n" +" \n" +" Execute COMMAND asynchronously, with the standard output and standard\n" +" input of the command connected via a pipe to file descriptors assigned\n" +" to indices 0 and 1 of an array variable NAME in the executing shell.\n" +" The default NAME is \"COPROC\".\n" +" \n" +" Exit Status:\n" +" Returns the exit status of COMMAND." +msgstr "" + +#: builtins.c:1658 +msgid "" +"Define shell function.\n" +" \n" +" Create a shell function named NAME. When invoked as a simple command,\n" +" NAME runs COMMANDs in the calling shell's context. When NAME is " +"invoked,\n" +" the arguments are passed to the function as $1...$n, and the function's\n" +" name is in $FUNCNAME.\n" +" \n" +" Exit Status:\n" +" Returns success unless NAME is readonly." +msgstr "" + +#: builtins.c:1672 +msgid "" +"Group commands as a unit.\n" +" \n" +" Run a set of commands in a group. This is one way to redirect an\n" +" entire set of commands.\n" +" \n" +" Exit Status:\n" +" Returns the status of the last command executed." +msgstr "" + +#: builtins.c:1684 +msgid "" +"Resume job in foreground.\n" +" \n" +" Equivalent to the JOB_SPEC argument to the `fg' command. Resume a\n" +" stopped or background job. JOB_SPEC can specify either a job name\n" +" or a job number. Following JOB_SPEC with a `&' places the job in\n" +" the background, as if the job specification had been supplied as an\n" +" argument to `bg'.\n" +" \n" +" Exit Status:\n" +" Returns the status of the resumed job." +msgstr "" + +#: builtins.c:1699 +msgid "" +"Evaluate arithmetic expression.\n" +" \n" +" The EXPRESSION is evaluated according to the rules for arithmetic\n" +" evaluation. Equivalent to \"let EXPRESSION\".\n" +" \n" +" Exit Status:\n" +" Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise." +msgstr "" + +#: builtins.c:1711 +msgid "" +"Execute conditional command.\n" +" \n" +" Returns a status of 0 or 1 depending on the evaluation of the " +"conditional\n" +" expression EXPRESSION. Expressions are composed of the same primaries " +"used\n" +" by the `test' builtin, and may be combined using the following " +"operators:\n" +" \n" +" ( EXPRESSION )\tReturns the value of EXPRESSION\n" +" ! EXPRESSION\t\tTrue if EXPRESSION is false; else false\n" +" EXPR1 && EXPR2\tTrue if both EXPR1 and EXPR2 are true; else false\n" +" EXPR1 || EXPR2\tTrue if either EXPR1 or EXPR2 is true; else false\n" +" \n" +" When the `==' and `!=' operators are used, the string to the right of\n" +" the operator is used as a pattern and pattern matching is performed.\n" +" When the `=~' operator is used, the string to the right of the operator\n" +" is matched as a regular expression.\n" +" \n" +" The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n" +" determine the expression's value.\n" +" \n" +" Exit Status:\n" +" 0 or 1 depending on value of EXPRESSION." +msgstr "" + +#: builtins.c:1737 +msgid "" +"Common shell variable names and usage.\n" +" \n" +" BASH_VERSION\tVersion information for this Bash.\n" +" CDPATH\tA colon-separated list of directories to search\n" +" \t\tfor directories given as arguments to `cd'.\n" +" GLOBIGNORE\tA colon-separated list of patterns describing filenames to\n" +" \t\tbe ignored by pathname expansion.\n" +" HISTFILE\tThe name of the file where your command history is stored.\n" +" HISTFILESIZE\tThe maximum number of lines this file can contain.\n" +" HISTSIZE\tThe maximum number of history lines that a running\n" +" \t\tshell can access.\n" +" HOME\tThe complete pathname to your login directory.\n" +" HOSTNAME\tThe name of the current host.\n" +" HOSTTYPE\tThe type of CPU this version of Bash is running under.\n" +" IGNOREEOF\tControls the action of the shell on receipt of an EOF\n" +" \t\tcharacter as the sole input. If set, then the value\n" +" \t\tof it is the number of EOF characters that can be seen\n" +" \t\tin a row on an empty line before the shell will exit\n" +" \t\t(default 10). When unset, EOF signifies the end of input.\n" +" MACHTYPE\tA string describing the current system Bash is running on.\n" +" MAILCHECK\tHow often, in seconds, Bash checks for new mail.\n" +" MAILPATH\tA colon-separated list of filenames which Bash checks\n" +" \t\tfor new mail.\n" +" OSTYPE\tThe version of Unix this version of Bash is running on.\n" +" PATH\tA colon-separated list of directories to search when\n" +" \t\tlooking for commands.\n" +" PROMPT_COMMAND\tA command to be executed before the printing of each\n" +" \t\tprimary prompt.\n" +" PS1\t\tThe primary prompt string.\n" +" PS2\t\tThe secondary prompt string.\n" +" PWD\t\tThe full pathname of the current directory.\n" +" SHELLOPTS\tA colon-separated list of enabled shell options.\n" +" TERM\tThe name of the current terminal type.\n" +" TIMEFORMAT\tThe output format for timing statistics displayed by the\n" +" \t\t`time' reserved word.\n" +" auto_resume\tNon-null means a command word appearing on a line by\n" +" \t\titself is first looked for in the list of currently\n" +" \t\tstopped jobs. If found there, that job is foregrounded.\n" +" \t\tA value of `exact' means that the command word must\n" +" \t\texactly match a command in the list of stopped jobs. A\n" +" \t\tvalue of `substring' means that the command word must\n" +" \t\tmatch a substring of the job. Any other value means that\n" +" \t\tthe command must be a prefix of a stopped job.\n" +" histchars\tCharacters controlling history expansion and quick\n" +" \t\tsubstitution. The first character is the history\n" +" \t\tsubstitution character, usually `!'. The second is\n" +" \t\tthe `quick substitution' character, usually `^'. The\n" +" \t\tthird is the `history comment' character, usually `#'.\n" +" HISTIGNORE\tA colon-separated list of patterns used to decide which\n" +" \t\tcommands should be saved on the history list.\n" +msgstr "" + +#: builtins.c:1794 +msgid "" +"Add directories to stack.\n" +" \n" +" Adds a directory to the top of the directory stack, or rotates\n" +" the stack, making the new top of the stack the current working\n" +" directory. With no arguments, exchanges the top two directories.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when adding\n" +" \tdirectories to the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the left of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" -N\tRotates the stack so that the Nth directory (counting\n" +" \tfrom the right of the list shown by `dirs', starting with\n" +" \tzero) is at the top.\n" +" \n" +" dir\tAdds DIR to the directory stack at the top, making it the\n" +" \tnew current working directory.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" + +#: builtins.c:1828 +msgid "" +"Remove directories from stack.\n" +" \n" +" Removes entries from the directory stack. With no arguments, removes\n" +" the top directory from the stack, and changes to the new top directory.\n" +" \n" +" Options:\n" +" -n\tSuppresses the normal change of directory when removing\n" +" \tdirectories from the stack, so only the stack is manipulated.\n" +" \n" +" Arguments:\n" +" +N\tRemoves the Nth entry counting from the left of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd +0'\n" +" \tremoves the first directory, `popd +1' the second.\n" +" \n" +" -N\tRemoves the Nth entry counting from the right of the list\n" +" \tshown by `dirs', starting with zero. For example: `popd -0'\n" +" \tremoves the last directory, `popd -1' the next to last.\n" +" \n" +" The `dirs' builtin displays the directory stack.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid argument is supplied or the directory\n" +" change fails." +msgstr "" + +#: builtins.c:1858 +msgid "" +"Display directory stack.\n" +" \n" +" Display the list of currently remembered directories. Directories\n" +" find their way onto the list with the `pushd' command; you can get\n" +" back up through the list with the `popd' command.\n" +" \n" +" Options:\n" +" -c\tclear the directory stack by deleting all of the elements\n" +" -l\tdo not print tilde-prefixed versions of directories relative\n" +" \tto your home directory\n" +" -p\tprint the directory stack with one entry per line\n" +" -v\tprint the directory stack with one entry per line prefixed\n" +" \twith its position in the stack\n" +" \n" +" Arguments:\n" +" +N\tDisplays the Nth entry counting from the left of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" -N\tDisplays the Nth entry counting from the right of the list shown " +"by\n" +" \tdirs when invoked without options, starting with zero.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1887 +msgid "" +"Set and unset shell options.\n" +" \n" +" Change the setting of each shell option OPTNAME. Without any option\n" +" arguments, list all shell options with an indication of whether or not " +"each\n" +" is set.\n" +" \n" +" Options:\n" +" -o\trestrict OPTNAMEs to those defined for use with `set -o'\n" +" -p\tprint each shell option with an indication of its status\n" +" -q\tsuppress output\n" +" -s\tenable (set) each OPTNAME\n" +" -u\tdisable (unset) each OPTNAME\n" +" \n" +" Exit Status:\n" +" Returns success if OPTNAME is enabled; fails if an invalid option is\n" +" given or OPTNAME is disabled." +msgstr "" + +#: builtins.c:1908 +msgid "" +"Formats and prints ARGUMENTS under control of the FORMAT.\n" +" \n" +" Options:\n" +" -v var\tassign the output to shell variable VAR rather than\n" +" \t\tdisplay it on the standard output\n" +" \n" +" FORMAT is a character string which contains three types of objects: " +"plain\n" +" characters, which are simply copied to standard output; character " +"escape\n" +" sequences, which are converted and copied to the standard output; and\n" +" format specifications, each of which causes printing of the next " +"successive\n" +" argument.\n" +" \n" +" In addition to the standard format specifications described in " +"printf(1),\n" +" printf interprets:\n" +" \n" +" %b\texpand backslash escape sequences in the corresponding argument\n" +" %q\tquote the argument in a way that can be reused as shell input\n" +" %(fmt)T output the date-time string resulting from using FMT as a " +"format\n" +" string for strftime(3)\n" +" \n" +" The format is re-used as necessary to consume all of the arguments. If\n" +" there are fewer arguments than the format requires, extra format\n" +" specifications behave as if a zero value or null string, as " +"appropriate,\n" +" had been supplied.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or a write or " +"assignment\n" +" error occurs." +msgstr "" + +#: builtins.c:1942 +msgid "" +"Specify how arguments are to be completed by Readline.\n" +" \n" +" For each NAME, specify how arguments are to be completed. If no " +"options\n" +" are supplied, existing completion specifications are printed in a way " +"that\n" +" allows them to be reused as input.\n" +" \n" +" Options:\n" +" -p\tprint existing completion specifications in a reusable format\n" +" -r\tremove a completion specification for each NAME, or, if no\n" +" \tNAMEs are supplied, all completion specifications\n" +" -D\tapply the completions and actions as the default for commands\n" +" \twithout any specific completion defined\n" +" -E\tapply the completions and actions to \"empty\" commands --\n" +" \tcompletion attempted on a blank line\n" +" \n" +" When completion is attempted, the actions are applied in the order the\n" +" uppercase-letter options are listed above. The -D option takes\n" +" precedence over -E.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1970 +msgid "" +"Display possible completions depending on the options.\n" +" \n" +" Intended to be used from within a shell function generating possible\n" +" completions. If the optional WORD argument is supplied, matches " +"against\n" +" WORD are generated.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or an error occurs." +msgstr "" + +#: builtins.c:1985 +msgid "" +"Modify or display completion options.\n" +" \n" +" Modify the completion options for each NAME, or, if no NAMEs are " +"supplied,\n" +" the completion currently being executed. If no OPTIONs are given, " +"print\n" +" the completion options for each NAME or the current completion " +"specification.\n" +" \n" +" Options:\n" +" \t-o option\tSet completion option OPTION for each NAME\n" +" \t-D\t\tChange options for the \"default\" command completion\n" +" \t-E\t\tChange options for the \"empty\" command completion\n" +" \n" +" Using `+o' instead of `-o' turns off the specified option.\n" +" \n" +" Arguments:\n" +" \n" +" Each NAME refers to a command for which a completion specification must\n" +" have previously been defined using the `complete' builtin. If no NAMEs\n" +" are supplied, compopt must be called by a function currently generating\n" +" completions, and the options for that currently-executing completion\n" +" generator are modified.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is supplied or NAME does not\n" +" have a completion specification defined." +msgstr "" + +#: builtins.c:2015 +msgid "" +"Read lines from the standard input into an indexed array variable.\n" +" \n" +" Read lines from the standard input into the indexed array variable " +"ARRAY, or\n" +" from file descriptor FD if the -u option is supplied. The variable " +"MAPFILE\n" +" is the default ARRAY.\n" +" \n" +" Options:\n" +" -n count\tCopy at most COUNT lines. If COUNT is 0, all lines are " +"copied.\n" +" -O origin\tBegin assigning to ARRAY at index ORIGIN. The default " +"index is 0.\n" +" -s count \tDiscard the first COUNT lines read.\n" +" -t\t\tRemove a trailing newline from each line read.\n" +" -u fd\t\tRead lines from file descriptor FD instead of the standard " +"input.\n" +" -C callback\tEvaluate CALLBACK each time QUANTUM lines are read.\n" +" -c quantum\tSpecify the number of lines read between each call to " +"CALLBACK.\n" +" \n" +" Arguments:\n" +" ARRAY\t\tArray variable name to use for file data.\n" +" \n" +" If -C is supplied without -c, the default quantum is 5000. When\n" +" CALLBACK is evaluated, it is supplied the index of the next array\n" +" element to be assigned and the line to be assigned to that element\n" +" as additional arguments.\n" +" \n" +" If not supplied with an explicit origin, mapfile will clear ARRAY " +"before\n" +" assigning to it.\n" +" \n" +" Exit Status:\n" +" Returns success unless an invalid option is given or ARRAY is readonly " +"or\n" +" not an indexed array." +msgstr "" + +#: builtins.c:2049 +msgid "" +"Read lines from a file into an array variable.\n" +" \n" +" A synonym for `mapfile'." +msgstr "" +"Učitaj retke iz datoteke u varijablu polja.\n" +" \n" +" Sinonim za „mapfile”." + +#~ msgid "Copyright (C) 2009 Free Software Foundation, Inc.\n" +#~ msgstr "Copyright © 2009 Free Software Foundation, Inc.\n" + +#~ msgid "" +#~ "License GPLv2+: GNU GPL version 2 or later \n" +#~ msgstr "" +#~ "Licenca GPLv2+: GNU GPL inačica 2 ili novija \n" diff --git a/po/hu.gmo b/po/hu.gmo new file mode 100644 index 0000000000000000000000000000000000000000..9309181afbdb91117aea40d237e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4OkQkup}Nqw<+?mCv~uM+%h<_1HM0i9 z*x0eCP7#>ZC*@6jesg|zOS#s$w%*`-laZ!3Q*o!v$;d+4QqImOZN!XwCJqM%l|+Qq zc|~bKnAfVIq&sHUVb(O?Y@eo2wrM7W+p~{w#}XF1faD|m@L7ELs)Q*{>6zBE60W;I{!s5$&?aP?SR^KSl#Dl{Bb)<9^4CA<$c~;*%^3ObwSUf-!TK+Q zbk>SW<@JWJ>(|vcZOYanDC0RKc?W+VEV~tX_V=?y$F@~c1 z1tIG6%#h;nv$NL;Iyd03cI`n8#d-szo=TOWCAfN?Qg?g+Lcw%(3rFWuexn0^!7%j{ zcZ5D#Nsc;(cB8exxfc3)4P8MRaIv*w2McH;MnL@$!qlhL0BIU1GVdu9$0-s?K92u; z5^NVpBgGq$+p%u~F;nF|dSrFBZ#@$@ZLY6BPe08Sq@ofNrvPcew?oKL3?RJ~=Ad++ z6yMd^R~;}6wy9h1t!&W3eeu)P)wN{&Hgo2t2_Bl#_HL#P$71yl4 zY~(oxf9bH34p27QX|~$G$DT*bv!=8dNGGg9$0afRoNqwu6psG?QdJoLCnOpJE9-x_ z-Pc;yjvJx~KRdei_}MdO1&f^@r18P@7W_mB;)yPtcrX=(

    \n"); +} + +print "# end of pass 1\n" if $T2H_VERBOSE; + +SetDocumentLanguage('en') unless ($T2H_LANG); +#+++############################################################################ +# # +# Stuff related to Index generation # +# # +#---############################################################################ + +sub EnterIndexEntry +{ + my $prefix = shift; + my $key = shift; + my $docu_doc = shift; + my $section = shift; + my $lines = shift; + local $_; + + warn "$ERROR Undefined index command: $_", next + unless (exists ($index_properties->{$prefix})); + $key =~ s/\s+$//; + $_ = $key; + &protect_texi; + $key = $_; + $_ = &protect_html($_); + my $html_key = substitute_style($_); + my $id; + $key = remove_style($key); + $key = remove_things($key); + $_ = $key; + &unprotect_texi; + $key = $_; + while (exists $index->{$prefix}->{$key}) {$key .= ' '}; + if ($lines->[$#lines] =~ /^$/) + { + $id = $1; + } + else + { + $id = 'IDX' . ++$idx_num; + push(@$lines, &t2h_anchor($id, '', $T2H_INVISIBLE_MARK, !$in_pre)); + } + $index->{$prefix}->{$key}->{html_key} = $html_key; + $index->{$prefix}->{$key}->{section} = $section; + $index->{$prefix}->{$key}->{href} = "$docu_doc#$id"; + print "# found ${prefix}index for '$key' with id $id\n" + if $T2H_DEBUG & $DEBUG_INDEX; +} + +sub IndexName2Prefix +{ + my $name = shift; + my $prefix; + + for $prefix (keys %$index_properties) + { + return $prefix if ($index_properties->{$prefix}->{name} eq $name); + } + return undef; +} + +sub GetIndexEntries +{ + my $normal = shift; + my $code = shift; + my ($entries, $prefix, $key) = ({}); + + for $prefix (keys %$normal) + { + for $key (keys %{$index->{$prefix}}) + { + $entries->{$key} = {%{$index->{$prefix}->{$key}}}; + } + } + + if (defined($code)) + { + for $prefix (keys %$code) + { + unless (exists $normal->{$keys}) + { + for $key (keys %{$index->{$prefix}}) + { + $entries->{$key} = {%{$index->{$prefix}->{$key}}}; + $entries->{$key}->{html_key} = "$entries->{$key}->{html_key}"; + } + } + } + } + return $entries; +} + +sub byAlpha +{ + if ($a =~ /^[A-Za-z]/) + { + if ($b =~ /^[A-Za-z]/) + { + return lc($a) cmp lc($b); + } + else + { + return 1; + } + } + elsif ($b =~ /^[A-Za-z]/) + { + return -1; + } + else + { + return lc($a) cmp lc($b); + } +} + +sub GetIndexPages +{ + my $entries = shift; + my (@Letters, $key); + my ($EntriesByLetter, $Pages, $page) = ({}, [], {}); + my @keys = sort byAlpha keys %$entries; + + for $key (@keys) + { + push @{$EntriesByLetter->{uc(substr($key,0, 1))}} , $entries->{$key}; + } + @Letters = sort byAlpha keys %$EntriesByLetter; + + $T2H_SPLIT_INDEX = 0 unless ($T2H_SPLIT); + + unless ($T2H_SPLIT_INDEX) + { + $page->{First} = $Letters[0]; + $page->{Last} = $Letters[$#Letters]; + $page->{Letters} = \@Letters; + $page->{EntriesByLetter} = $EntriesByLetter; + push @$Pages, $page; + return $Pages; + } + + if ($T2H_SPLIT_INDEX =~ /^\d+$/) + { + my $i = 0; + my ($prev_letter, $letter); + $page->{First} = $Letters[0]; + for $letter (@Letters) + { + if ($i > $T2H_SPLIT_INDEX) + { + $page->{Last} = $prev_letter; + push @$Pages, {%$page}; + $page->{Letters} = []; + $page->{EntriesByLetter} = {}; + $page->{First} = $letter; + $i=0; + } + push @{$page->{Letters}}, $letter; + $page->{EntriesByLetter}->{$letter} = [@{$EntriesByLetter->{$letter}}]; + $i += scalar(@{$EntriesByLetter->{$letter}}); + $prev_letter = $letter; + } + $page->{Last} = $Letters[$#Letters]; + push @$Pages, {%$page}; + } + return $Pages; +} + +sub GetIndexSummary +{ + my $first_page = shift; + my $Pages = shift; + my $name = shift; + my ($page, $letter, $summary, $i, $l1, $l2, $l); + + $i = 0; + $summary = '
    Jump to:   '; + + for $page ($first_page, @$Pages) + { + for $letter (@{$page->{Letters}}) + { + $l = t2h_anchor('', "$page->{href}#${name}_$letter", "$letter", + 0, 'style="text-decoration:none"') . "\n   \n"; + + if ($letter =~ /^[A-Za-z]/) + { + $l2 .= $l; + } + else + { + $l1 .= $l; + } + } + } + $summary .= $l1 . "
    \n" if ($l1); + $summary .= $l2 . '

    '; + return $summary; +} + +sub PrintIndexPage +{ + my $lines = shift; + my $summary = shift; + my $page = shift; + my $name = shift; + + push @$lines, $summary; + + push @$lines , <

    + + + +EOT + + for $letter (@{$page->{Letters}}) + { + push @$lines, "\n"; + for $entry (@{$page->{EntriesByLetter}->{$letter}}) + { + push @$lines, + "\n"; + } + push @$lines, "\n"; + } + push @$lines, "
    Index Entry Section

    $letter
    " . + t2h_anchor('', $entry->{href}, $entry->{html_key}) . + "" . + t2h_anchor('', sec_href($entry->{section}), clean_name($entry->{section})) . + "

    "; + push @$lines, $summary; +} + +sub PrintIndex +{ + my $lines = shift; + my $name = shift; + my $section = shift; + $section = 'Top' unless $section; + my $prefix = IndexName2Prefix($name); + + warn ("$ERROR printindex: bad index name: $name"), return + unless $prefix; + + if ($index_properties->{$prefix}->{code}) + { + $index_properties->{$prefix}->{from_code}->{$prefix} = 1; + } + else + { + $index_properties->{$prefix}->{from}->{$prefix}= 1; + } + + my $Entries = GetIndexEntries($index_properties->{$prefix}->{from}, + $index_properties->{$prefix}->{from_code}); + return unless %$Entries; + + if ($T2H_IDX_SUMMARY) + { + my $key; + open(FHIDX, ">$docu_rdir$docu_name" . "_$name.idx") + || die "Can't open > $docu_rdir$docu_name" . "_$name.idx for writing: $!\n"; + print "# writing $name index summary in $docu_rdir$docu_name" . "_$name.idx...\n" if $T2H_VERBOSE; + + for $key (sort keys %$Entries) + { + print FHIDX "$key\t$Entries->{$key}->{href}\n"; + } + } + + my $Pages = GetIndexPages($Entries); + my $page; + my $first_page = shift @$Pages; + my $sec_name = $section; + # remove section number + $sec_name =~ s/.*? // if $sec_name =~ /^([A-Z]|\d+)\./; + + ($first_page->{href} = sec_href($section)) =~ s/\#.*$//; + # Update tree structure of document + if (@$Pages) + { + my $sec; + my @after; + + while (@sections && $sections[$#sections] ne $section) + { + unshift @after, pop @sections; + } + + for $page (@$Pages) + { + my $node = ($page->{First} ne $page->{Last} ? + "$sec_name: $page->{First} -- $page->{Last}" : + "$sec_name: $page->{First}"); + push @sections, $node; + $node2sec{$node} = $node; + $sec2node{$node} = $node; + $node2up{$node} = $section; + $page->{href} = next_doc(); + $page->{name} = $node; + $node2href{$node} = $page->{href}; + if ($prev_node) + { + $node2next{$prev_node} = $node; + $node2prev{$node} = $prev_node; + } + $prev_node = $node; + } + push @sections, @after; + } + + my $summary = GetIndexSummary($first_page, $Pages, $name); + PrintIndexPage($lines, $summary, $first_page, $name); + for $page (@$Pages) + { + push @$lines, ($T2H_SPLIT eq 'chapter' ? $CHAPTEREND : $SECTIONEND); + push @$lines, "

    $page->{name}

    \n"; + PrintIndexPage($lines, $summary, $page, $name); + } +} + + +#+++############################################################################ +# # +# Pass 2/3: handle style, menu, index, cross-reference # +# # +#---############################################################################ + +@lines2 = (); # whole document (2nd pass) +@lines3 = (); # whole document (3rd pass) +$in_menu = 0; # am I inside a menu + +while (@lines) { + $_ = shift(@lines); + # + # special case (protected sections) + # + if (/^$PROTECTTAG/o) { + push(@lines2, $_); + next; + } + # + # menu + # + if (/^\@menu\b/) + { + $in_menu = 1; + $in_menu_listing = 1; + push(@lines2, &debug("
    \n", __LINE__)); + next; + } + if (/^\@end\s+menu\b/) + { + if ($in_menu_listing) + { + push(@lines2, &debug("
    \n", __LINE__)); + } + else + { + push(@lines2, &debug("\n", __LINE__)); + } + $in_menu = 0; + $in_menu_listing = 0; + next; + } + if ($in_menu) + { + my ($node, $name, $descr); + if (/^\*\s+($NODERE)::/o) + { + $node = $1; + $descr = $'; + } + elsif (/^\*\s+(.+):\s+([^\t,\.\n]+)[\t,\.\n]/) + { + $name = $1; + $node = $2; + $descr = $'; + } + elsif (/^\*/) + { + warn "$ERROR Bad menu line: $_"; + } + else + { + if ($in_menu_listing) + { + $in_menu_listing = 0; + push(@lines2, &debug("\n", __LINE__)); + } + # should be like verbatim -- preseve spaces, etc + s/ /\ /g; + $_ .= "
    \n"; + push(@lines2, $_); + } + if ($node) + { + if (! $in_menu_listing) + { + $in_menu_listing = 1; + push(@lines2, &debug("\n", __LINE__)); + } + # look for continuation + while ($lines[0] =~ /^\s+\w+/) + { + $descr .= shift(@lines); + } + &menu_entry($node, $name, $descr); + } + next; + } + # + # printindex + # + PrintIndex(\@lines2, $2, $1), next + if (/^\@printindex\s+(\w+)/); + # + # simple style substitutions + # + $_ = &substitute_style($_); + # + # xref + # + while (/\@(x|px|info|)ref{([^{}]+)(}?)/) { + # note: Texinfo may accept other characters + ($type, $nodes, $full) = ($1, $2, $3); + ($before, $after) = ($`, $'); + if (! $full && $after) { + warn "$ERROR Bad xref (no ending } on line): $_"; + $_ = "$before$;0${type}ref\{$nodes$after"; + next; # while xref + } + if ($type eq 'x') { + $type = "$T2H_WORDS->{$T2H_LANG}->{'See'} "; + } elsif ($type eq 'px') { + $type = "$T2H_WORDS->{$T2H_LANG}->{'see'} "; + } elsif ($type eq 'info') { + $type = "$T2H_WORDS->{$T2H_LANG}->{'See'} Info"; + } else { + $type = ''; + } + unless ($full) { + $next = shift(@lines); + $next = &substitute_style($next); + chop($nodes); # remove final newline + if ($next =~ /\}/) { # split on 2 lines + $nodes .= " $`"; + $after = $'; + } else { + $nodes .= " $next"; + $next = shift(@lines); + $next = &substitute_style($next); + chop($nodes); + if ($next =~ /\}/) { # split on 3 lines + $nodes .= " $`"; + $after = $'; + } else { + warn "$ERROR Bad xref (no ending }): $_"; + $_ = "$before$;0xref\{$nodes$after"; + unshift(@lines, $next); + next; # while xref + } + } + } + $nodes =~ s/\s+/ /g; # remove useless spaces + @args = split(/\s*,\s*/, $nodes); + $node = $args[0]; # the node is always the first arg + $node = &normalise_node($node); + $sec = $args[2] || $args[1] || $node2sec{$node}; + $href = $node2href{$node}; + if (@args == 5) { # reference to another manual + $sec = $args[2] || $node; + $man = $args[4] || $args[3]; + $_ = "${before}${type}$T2H_WORDS->{$T2H_LANG}->{'section'} `$sec' in \@cite{$man}$after"; + } elsif ($type =~ /Info/) { # inforef + warn "$ERROR Wrong number of arguments: $_" unless @args == 3; + ($nn, $_, $in) = @args; + $_ = "${before}${type} file `$in', node `$nn'$after"; + } elsif ($sec && $href && ! $T2H_SHORT_REF) { + $_ = "${before}${type}"; + $_ .= "$T2H_WORDS->{$T2H_LANG}->{'section'} " if ${type}; + $_ .= &t2h_anchor('', $href, $sec) . $after; + } + elsif ($href) + { + $_ = "${before}${type} " . + &t2h_anchor('', $href, $args[2] || $args[1] || $node) . + $after; + } + else { + warn "$ERROR Undefined node ($node): $_"; + $_ = "$before$;0xref{$nodes}$after"; + } + } + + # replace images + s[\@image\s*{(.+?)}] + { + my @args = split (/\s*,\s*/, $1); + my $base = $args[0]; + my $image = + LocateIncludeFile("$base.png") || + LocateIncludeFile("$base.jpg") || + LocateIncludeFile("$base.gif"); + warn "$ERROR no image file for $base: $_" unless ($image && -e $image); + "\"$base\""; + ($T2H_CENTER_IMAGE ? + "
    \"$base\"
    " : + "\"$base\""); + }eg; + + # + # try to guess bibliography references or glossary terms + # + unless (/^/) { + $done .= $pre . &t2h_anchor('', $href, $what); + } else { + $done .= "$pre$what"; + } + $_ = $post; + } + $_ = $done . $_; + } + if ($T2H_USE_GLOSSARY) { + $done = ''; + while (/\b\w+\b/) { + ($pre, $what, $post) = ($`, $&, $'); + $entry = $what; + $entry =~ tr/A-Z/a-z/ unless $entry =~ /^[A-Z\s]+$/; + $href = $gloss2href{$entry}; + if (defined($href) && $post !~ /^[^<]*<\/A>/) { + $done .= $pre . &t2h_anchor('', $href, $what); + } else { + $done .= "$pre$what"; + } + $_ = $post; + } + $_ = $done . $_; + } + } + # otherwise + push(@lines2, $_); +} +print "# end of pass 2\n" if $T2H_VERBOSE; + +# +# split style substitutions +# +while (@lines2) { + $_ = shift(@lines2); + # + # special case (protected sections) + # + if (/^$PROTECTTAG/o) { + push(@lines3, $_); + next; + } + # + # split style substitutions + # + $old = ''; + while ($old ne $_) { + $old = $_; + if (/\@(\w+)\{/) { + ($before, $style, $after) = ($`, $1, $'); + if (defined($style_map{$style})) { + $_ = $after; + $text = ''; + $after = ''; + $failed = 1; + while (@lines2) { + if (/\}/) { + $text .= $`; + $after = $'; + $failed = 0; + last; + } else { + $text .= $_; + $_ = shift(@lines2); + } + } + if ($failed) { + die "* Bad syntax (\@$style) after: $before\n"; + } else { + $text = &apply_style($style, $text); + $_ = "$before$text$after"; + } + } + } + } + # otherwise + push(@lines3, $_); +} +print "# end of pass 3\n" if $T2H_VERBOSE; + +#+++############################################################################ +# # +# Pass 4: foot notes, final cleanup # +# # +#---############################################################################ + +@foot_lines = (); # footnotes +@doc_lines = (); # final document +$end_of_para = 0; # true if last line is

    + +while (@lines3) { + $_ = shift(@lines3); + # + # special case (protected sections) + # + if (/^$PROTECTTAG/o) { + push(@doc_lines, $_); + $end_of_para = 0; + next; + } + # + # footnotes + # + while (/\@footnote([^\{\s]+)\{/) { + ($before, $d, $after) = ($`, $1, $'); + $_ = $after; + $text = ''; + $after = ''; + $failed = 1; + while (@lines3) { + if (/\}/) { + $text .= $`; + $after = $'; + $failed = 0; + last; + } else { + $text .= $_; + $_ = shift(@lines3); + } + } + if ($failed) { + die "* Bad syntax (\@footnote) after: $before\n"; + } else { + $foot_num++; + $docid = "DOCF$foot_num"; + $footid = "FOOT$foot_num"; + $foot = "($foot_num)"; + push(@foot_lines, "

    " . &t2h_anchor($footid, "$d#$docid", $foot) . "

    \n"); + $text = "

    $text" unless $text =~ /^\s*

    /; + push(@foot_lines, "$text\n"); + $_ = $before . &t2h_anchor($docid, "$docu_foot#$footid", $foot) . $after; + } + } + # + # remove unnecessary

    + # + if (/^\s*

    \s*$/) { + next if $end_of_para++; + } else { + $end_of_para = 0; + } + # otherwise + push(@doc_lines, $_); +} + +print "# end of pass 4\n" if $T2H_VERBOSE; + +#+++############################################################################ +# # +# Pass 5: print things # +# # +#---############################################################################ + +$T2H_L2H = &l2h_FinishToLatex if ($T2H_L2H); +$T2H_L2H = &l2h_ToHtml if ($T2H_L2H); +$T2H_L2H = &l2h_InitFromHtml if ($T2H_L2H); + +# fix node2up, node2prev, node2next, if desired +if ($has_top_command) +{ + for $section (keys %sec2number) + { + $node = $sec2node{$section}; + $node2up{$node} = Sec2UpNode($section) unless $node2up{$node}; + $node2prev{$node} = Sec2PrevNode($section) unless $node2prev{$node}; + $node2next{$node} = Sec2NextNode($section) unless $node2next{$node}; + } +} + +# prepare %T2H_THISDOC +$T2H_THISDOC{fulltitle} = $value{'_title'} || $value{'_settitle'} || "Untitled Document"; +$T2H_THISDOC{title} = $value{'_settitle'} || $T2H_THISDOC{fulltitle}; +$T2H_THISDOC{author} = $value{'_author'}; +$T2H_THISDOC{subtitle} = $value{'_subtitle'}; +$T2H_THISDOC{shorttitle} = $value{'_shorttitle'}; +for $key (keys %T2H_THISDOC) +{ + $_ = &substitute_style($T2H_THISDOC{$key}); + &unprotect_texi; + s/\s*$//; + $T2H_THISDOC{$key} = $_; +} + +# if no sections, then simply print document as is +unless (@sections) +{ + print "# Writing content into $docu_top_file \n" if $T2H_VERBOSE; + open(FILE, "> $docu_top_file") + || die "$ERROR: Can't open $docu_top_file for writing: $!\n"; + + &$T2H_print_page_head(\*FILE); + $T2H_THIS_SECTION = \@doc_lines; + t2h_print_lines(\*FILE); + &$T2H_print_foot_navigation(\*FILE); + &$T2H_print_page_foot(\*FILE); + close(FILE); + goto Finish; +} + +# initialize $T2H_HREF, $T2H_NAME +%T2H_HREF = + ( + 'First' , sec_href($sections[0]), + 'Last', sec_href($sections[$#sections]), + 'About', $docu_about. '#SEC_About', + ); + +# prepare TOC, OVERVIEW, TOP +$T2H_TOC = \@toc_lines; +$T2H_OVERVIEW = \@stoc_lines; +if ($has_top) +{ + while (1) + { + $_ = shift @doc_lines; + last if /$TOPEND/; + push @$T2H_TOP, $_; + } + $T2H_HREF{'Top'} = $docu_top . '#SEC_Top'; +} +else +{ + $T2H_HREF{'Top'} = $T2H_HREF{First}; +} + +$node2href{Top} = $T2H_HREF{Top}; +$T2H_HREF{Contents} = $docu_toc.'#SEC_Contents' if @toc_lines; +$T2H_HREF{Overview} = $docu_stoc.'#SEC_OVERVIEW' if @stoc_lines; + +# settle on index +if ($T2H_INDEX_CHAPTER) +{ + $T2H_HREF{Index} = $node2href{normalise_node($T2H_INDEX_CHAPTER)}; + warn "$ERROR T2H_INDEX_CHAPTER '$T2H_INDEX_CHAPTER' not found\n" + unless $T2H_HREF{Index}; +} +if (! $T2H_HREF{Index} && $first_index_chapter) +{ + $T2H_INDEX_CHAPTER = $first_index_chapter; + $T2H_HREF{Index} = $node2href{$T2H_INDEX_CHAPTER}; +} + +print "# Using '" . clean_name($T2H_INDEX_CHAPTER) . "' as index page\n" + if ($T2H_VERBOSE && $T2H_HREF{Index}); + +%T2H_NAME = + ( + 'First', clean_name($sec2node{$sections[0]}), + 'Last', clean_name($sec2node{$sections[$#sections]}), + 'About', $T2H_WORDS->{$T2H_LANG}->{'About_Title'}, + 'Contents', $T2H_WORDS->{$T2H_LANG}->{'ToC_Title'}, + 'Overview', $T2H_WORDS->{$T2H_LANG}->{'Overview_Title'}, + 'Index' , clean_name($T2H_INDEX_CHAPTER), + 'Top', clean_name($T2H_TOP_HEADING || $T2H_THISDOC{'title'} || $T2H_THISDOC{'shorttitle'}), + ); + +############################################################################# +# print frame and frame toc file +# +if ( $T2H_FRAMES ) +{ + open(FILE, "> $docu_frame_file") + || die "$ERROR: Can't open $docu_frame_file for writing: $!\n"; + print "# Creating frame in $docu_frame_file ...\n" if $T2H_VERBOSE; + &$T2H_print_frame(\*FILE); + close(FILE); + + open(FILE, "> $docu_toc_frame_file") + || die "$ERROR: Can't open $docu_toc_frame_file for writing: $!\n"; + print "# Creating toc frame in $docu_frame_file ...\n" if $T2H_VERBOSE; + &$T2H_print_toc_frame(\*FILE); + close(FILE); +} + + +############################################################################# +# print Top +# +open(FILE, "> $docu_top_file") + || die "$ERROR: Can't open $docu_top_file for writing: $!\n"; +&$T2H_print_page_head(\*FILE) unless ($T2H_SPLIT); + +if ($has_top) +{ + print "# Creating Top in $docu_top_file ...\n" if $T2H_VERBOSE; + $T2H_THIS_SECTION = $T2H_TOP; + $T2H_HREF{This} = $T2H_HREF{Top}; + $T2H_NAME{This} = $T2H_NAME{Top}; + &$T2H_print_Top(\*FILE); +} + +close(FILE) if $T2H_SPLIT; + +############################################################################# +# Print sections +# +$T2H_NODE{Forward} = $sec2node{$sections[0]}; +$T2H_NAME{Forward} = &clean_name($sec2node{$sections[0]}); +$T2H_HREF{Forward} = sec_href($sections[0]); +$T2H_NODE{This} = 'Top'; +$T2H_NAME{This} = $T2H_NAME{Top}; +$T2H_HREF{This} = $T2H_HREF{Top}; +if ($T2H_SPLIT) +{ + print "# writing " . scalar(@sections) . + " sections in $docu_rdir$docu_name"."_[1..$doc_num]" + if $T2H_VERBOSE; + $previous = ($T2H_SPLIT eq 'chapter' ? $CHAPTEREND : $SECTIONEND); + undef $FH; + $doc_num = 0; +} +else +{ + print "# writing " . scalar(@sections) . " sections in $docu_top_file ..." + if $T2H_VERBOSE; + $FH = \*FILE; + $previous = ''; +} + +$counter = 0; +# loop through sections +while ($section = shift(@sections)) +{ + if ($T2H_SPLIT && ($T2H_SPLIT eq 'section' || $previous eq $CHAPTEREND)) + { + if ($FH) + { + #close previous page + &$T2H_print_chapter_footer($FH) if $T2H_SPLIT eq 'chapter'; + &$T2H_print_page_foot($FH); + close($FH); + undef $FH; + } + } + $T2H_NAME{Back} = $T2H_NAME{This}; + $T2H_HREF{Back} = $T2H_HREF{This}; + $T2H_NODE{Back} = $T2H_NODE{This}; + $T2H_NAME{This} = $T2H_NAME{Forward}; + $T2H_HREF{This} = $T2H_HREF{Forward}; + $T2H_NODE{This} = $T2H_NODE{Forward}; + if ($sections[0]) + { + $T2H_NODE{Forward} = $sec2node{$sections[0]}; + $T2H_NAME{Forward} = &clean_name($T2H_NODE{Forward}); + $T2H_HREF{Forward} = sec_href($sections[0]); + } + else + { + undef $T2H_HREF{Forward}, $T2H_NODE{Forward}, $T2H_NAME{Forward}; + } + + $node = $node2up{$T2H_NODE{This}}; + $T2H_HREF{Up} = $node2href{$node}; + if ($T2H_HREF{Up} eq $T2H_HREF{This} || ! $T2H_HREF{Up}) + { + $T2H_NAME{Up} = $T2H_NAME{Top}; + $T2H_HREF{Up} = $T2H_HREF{Top}; + $T2H_NODE{Up} = 'Up'; + } + else + { + $T2H_NAME{Up} = &clean_name($node); + $T2H_NODE{Up} = $node; + } + + $node = $T2H_NODE{This}; + $node = $node2prev{$node}; + $T2H_NAME{Prev} = &clean_name($node); + $T2H_HREF{Prev} = $node2href{$node}; + $T2H_NODE{Prev} = $node; + + $node = $T2H_NODE{This}; + if ($node2up{$node} && $node2up{$node} ne 'Top'&& + ($node2prev{$node} eq $T2H_NODE{Back} || ! $node2prev{$node})) + { + $node = $node2up{$node}; + while ($node && $node ne $node2up{$node} && ! $node2prev{$node}) + { + $node = $node2up{$node}; + } + $node = $node2prev{$node} + unless $node2up{$node} eq 'Top' || ! $node2up{$node}; + } + else + { + $node = $node2prev{$node}; + } + $T2H_NAME{FastBack} = &clean_name($node); + $T2H_HREF{FastBack} = $node2href{$node}; + $T2H_NODE{FastBack} = $node; + + $node = $T2H_NODE{This}; + $node = $node2next{$node}; + $T2H_NAME{Next} = &clean_name($node); + $T2H_HREF{Next} = $node2href{$node}; + $T2H_NODE{Next} = $node; + + $node = $T2H_NODE{This}; + if ($node2up{$node} && $node2up{$node} ne 'Top'&& + ($node2next{$node} eq $T2H_NODE{Forward} || ! $node2next{$node})) + { + $node = $node2up{$node}; + while ($node && $node ne $node2up{$node} && ! $node2next{$node}) + { + $node = $node2up{$node}; + } + } + $node = $node2next{$node}; + $T2H_NAME{FastForward} = &clean_name($node); + $T2H_HREF{FastForward} = $node2href{$node}; + $T2H_NODE{FastForward} = $node; + + if (! defined($FH)) + { + my $file = $T2H_HREF{This}; + $file =~ s/\#.*$//; + open(FILE, "> $docu_rdir$file") || + die "$ERROR: Can't open $docu_rdir$file for writing: $!\n"; + $FH = \*FILE; + &$T2H_print_page_head($FH); + t2h_print_label($FH); + &$T2H_print_chapter_header($FH) if $T2H_SPLIT eq 'chapter'; + } + else + { + t2h_print_label($FH); + } + + $T2H_THIS_SECTION = []; + while (@doc_lines) { + $_ = shift(@doc_lines); + last if ($_ eq $SECTIONEND || $_ eq $CHAPTEREND); + push(@$T2H_THIS_SECTION, $_); + } + $previous = $_; + &$T2H_print_section($FH); + + if ($T2H_VERBOSE) + { + $counter++; + print "." if $counter =~ /00$/; + } +} +if ($T2H_SPLIT) +{ + &$T2H_print_chapter_footer($FH) if $T2H_SPLIT eq 'chapter'; + &$T2H_print_page_foot($FH); + close($FH); +} +print "\n" if $T2H_VERBOSE; + +############################################################################# +# Print ToC, Overview, Footnotes +# +undef $T2H_HREF{Prev}; +undef $T2H_HREF{Next}; +undef $T2H_HREF{Back}; +undef $T2H_HREF{Forward}; +undef $T2H_HREF{Up}; + +if (@foot_lines) +{ + print "# writing Footnotes in $docu_foot_file...\n" if $T2H_VERBOSE; + open (FILE, "> $docu_foot_file") || die "$ERROR: Can't open $docu_foot_file for writing: $!\n" + if $T2H_SPLIT; + $T2H_HREF{This} = $docu_foot; + $T2H_NAME{This} = $T2H_WORDS->{$T2H_LANG}->{'Footnotes_Title'}; + $T2H_THIS_SECTION = \@foot_lines; + &$T2H_print_Footnotes(\*FILE); + close(FILE) if $T2H_SPLIT; +} + +if (@toc_lines) +{ + print "# writing Toc in $docu_toc_file...\n" if $T2H_VERBOSE; + open (FILE, "> $docu_toc_file") || die "$ERROR: Can't open $docu_toc_file for writing: $!\n" + if $T2H_SPLIT; + $T2H_HREF{This} = $T2H_HREF{Contents}; + $T2H_NAME{This} = $T2H_NAME{Contents}; + $T2H_THIS_SECTION = \@toc_lines; + &$T2H_print_Toc(\*FILE); + close(FILE) if $T2H_SPLIT; +} + +if (@stoc_lines) +{ + print "# writing Overview in $docu_stoc_file...\n" if $T2H_VERBOSE; + open (FILE, "> $docu_stoc_file") || die "$ERROR: Can't open $docu_stoc_file for writing: $!\n" + if $T2H_SPLIT; + + $T2H_HREF{This} = $T2H_HREF{Overview}; + $T2H_NAME{This} = $T2H_NAME{Overview}; + $T2H_THIS_SECTION = \@stoc_lines; + unshift @$T2H_THIS_SECTION, "

    \n"; + push @$T2H_THIS_SECTION, "\n
    \n"; + &$T2H_print_Overview(\*FILE); + close(FILE) if $T2H_SPLIT; +} + +if ($about_body = &$T2H_about_body()) +{ + print "# writing About in $docu_about_file...\n" if $T2H_VERBOSE; + open (FILE, "> $docu_about_file") || die "$ERROR: Can't open $docu_about_file for writing: $!\n" + if $T2H_SPLIT; + + $T2H_HREF{This} = $T2H_HREF{About}; + $T2H_NAME{This} = $T2H_NAME{About}; + $T2H_THIS_SECTION = [$about_body]; + &$T2H_print_About(\*FILE); + close(FILE) if $T2H_SPLIT; +} + +unless ($T2H_SPLIT) +{ + &$T2H_print_page_foot(\*FILE); + close (FILE); +} + +Finish: +&l2h_FinishFromHtml if ($T2H_L2H); +&l2h_Finish if($T2H_L2H); +print "# that's all folks\n" if $T2H_VERBOSE; + +exit(0); + +#+++############################################################################ +# # +# Low level functions # +# # +#---############################################################################ + +sub LocateIncludeFile +{ + my $file = shift; + my $dir; + + return $file if (-e $file && -r $file); + foreach $dir (@T2H_INCLUDE_DIRS) + { + return "$dir/$file" if (-e "$dir/$file" && -r "$dir/$file"); + } + return undef; +} + +sub clean_name +{ + local ($_); + $_ = &remove_style($_[0]); + &unprotect_texi; + return $_; +} + +sub update_sec_num { + local($name, $level) = @_; + my $ret; + + $level--; # here we start at 0 + if ($name =~ /^appendix/ || defined(@appendix_sec_num)) { + # appendix style + if (defined(@appendix_sec_num)) { + &incr_sec_num($level, @appendix_sec_num); + } else { + @appendix_sec_num = ('A', 0, 0, 0); + } + $ret = join('.', @appendix_sec_num[0..$level]); + } else { + # normal style + if (defined(@normal_sec_num)) + { + &incr_sec_num($level, @normal_sec_num); + } + else + { + @normal_sec_num = (1, 0, 0, 0); + } + $ret = join('.', @normal_sec_num[0..$level]); + } + + $ret .= "." if $level == 0; + return $ret; +} + +sub incr_sec_num { + local($level, $l); + $level = shift(@_); + $_[$level]++; + foreach $l ($level+1 .. 3) { + $_[$l] = 0; + } +} + +sub Sec2UpNode +{ + my $sec = shift; + my $num = $sec2number{$sec}; + + return '' unless $num; + return 'Top' unless $num =~ /\.\d+/; + $num =~ s/\.[^\.]*$//; + $num = $num . '.' unless $num =~ /\./; + return $sec2node{$number2sec{$num}}; +} + +sub Sec2PrevNode +{ + my $sec = shift; + my $num = $sec2number{$sec}; + my ($i, $post); + + if ($num =~ /(\w+)(\.$|$)/) + { + $num = $`; + $i = $1; + $post = $2; + if ($i eq 'A') + { + $i = $normal_sec_num[0]; + } + elsif ($i ne '1') + { + # unfortunately, -- operator is not magical + $i = chr(ord($i) + 1); + } + else + { + return ''; + } + return $sec2node{$number2sec{$num . $i . $post}} + } + return ''; +} + +sub Sec2NextNode +{ + my $sec = shift; + my $num = $sec2number{$sec}; + my $i; + + if ($num =~ /(\w+)(\.$|$)/) + { + $num = $`; + $i = $1; + $post = $2; + if ($post eq '.' && $i eq $normal_sec_num[0]) + { + $i = 'A'; + } + else + { + $i++; + } + return $sec2node{$number2sec{$num . $i . $post}} + } + return ''; +} + +sub check { + local($_, %seen, %context, $before, $match, $after); + + while (<>) { + if (/\@(\*|\.|\:|\@|\{|\})/) { + $seen{$&}++; + $context{$&} .= "> $_" if $T2H_VERBOSE; + $_ = "$`XX$'"; + redo; + } + if (/\@(\w+)/) { + ($before, $match, $after) = ($`, $&, $'); + if ($before =~ /\b[\w-]+$/ && $after =~ /^[\w-.]*\b/) { # e-mail address + $seen{'e-mail address'}++; + $context{'e-mail address'} .= "> $_" if $T2H_VERBOSE; + } else { + $seen{$match}++; + $context{$match} .= "> $_" if $T2H_VERBOSE; + } + $match =~ s/^\@/X/; + $_ = "$before$match$after"; + redo; + } + } + + foreach (sort(keys(%seen))) { + if ($T2H_VERBOSE) { + print "$_\n"; + print $context{$_}; + } else { + print "$_ ($seen{$_})\n"; + } + } +} + +sub open { + local($name) = @_; + + ++$fh_name; + if (open($fh_name, $name)) { + unshift(@fhs, $fh_name); + } else { + warn "$ERROR Can't read file $name: $!\n"; + } +} + +sub init_input { + @fhs = (); # hold the file handles to read + @input_spool = (); # spooled lines to read + $fh_name = 'FH000'; + &open($docu); +} + +sub next_line { + local($fh, $line); + + if (@input_spool) { + $line = shift(@input_spool); + return($line); + } + while (@fhs) { + $fh = $fhs[0]; + $line = <$fh>; + return($line) if $line; + close($fh); + shift(@fhs); + } + return(undef); +} + +# used in pass 1, use &next_line +sub skip_until { + local($tag) = @_; + local($_); + + while ($_ = &next_line) { + return if /^\@end\s+$tag\s*$/; + } + die "* Failed to find '$tag' after: " . $lines[$#lines]; +} + +# used in pass 1 for l2h use &next_line +sub string_until { + local($tag) = @_; + local($_, $string); + + while ($_ = &next_line) { + return $string if /^\@end\s+$tag\s*$/; +# $_ =~ s/hbox/mbox/g; + $string = $string.$_; + } + die "* Failed to find '$tag' after: " . $lines[$#lines]; +} + +# +# HTML stacking to have a better HTML output +# + +sub html_reset { + @html_stack = ('html'); + $html_element = 'body'; +} + +sub html_push { + local($what) = @_; + push(@html_stack, $html_element); + $html_element = $what; +} + +sub html_push_if { + local($what) = @_; + push(@html_stack, $html_element) + if ($html_element && $html_element ne 'P'); + $html_element = $what; +} + +sub html_pop { + $html_element = pop(@html_stack); +} + +sub html_pop_if { + local($elt); + + if (@_) { + foreach $elt (@_) { + if ($elt eq $html_element) { + $html_element = pop(@html_stack) if @html_stack; + last; + } + } + } else { + $html_element = pop(@html_stack) if @html_stack; + } +} + +sub html_debug { + local($what, $line) = @_; + if ($T2H_DEBUG & $DEBUG_HTML) + { + $what = "\n" unless $what; + return("$what") + } + return($what); +} + +# to debug the output... +sub debug { + local($what, $line) = @_; + return("$what") + if $T2H_DEBUG & $DEBUG_HTML; + return($what); +} + +sub SimpleTexi2Html +{ + local $_ = $_[0]; + &protect_texi; + &protect_html; + $_ = substitute_style($_); + $_[0] = $_; +} + +sub normalise_node { + local $_ = $_[0]; + s/\s+/ /g; + s/ $//; + s/^ //; + &protect_texi; + &protect_html; + $_ = substitute_style($_); + $_[0] = $_; +} + +sub menu_entry +{ + my ($node, $name, $descr) = @_; + my ($href, $entry); + + &normalise_node($node); + $href = $node2href{$node}; + if ($href) + { + $descr =~ s/^\s+//; + $descr =~ s/\s*$//; + $descr = SimpleTexi2Html($descr); + if ($T2H_NUMBER_SECTIONS && !$T2H_NODE_NAME_IN_MENU && $node2sec{$node}) + { + $entry = $node2sec{$node}; + $name = ''; + } + else + { + &normalise_node($name); + $entry = ($name && ($name ne $node || ! $T2H_AVOID_MENU_REDUNDANCY) + ? "$name : $node" : $node); + } + + if ($T2H_AVOID_MENU_REDUNDANCY && $descr) + { + my $clean_entry = $entry; + $clean_entry =~ s/^.*? // if ($clean_entry =~ /^([A-Z]|\d+)\.[\d\.]* /); + $clean_entry =~ s/[^\w]//g; + my $clean_descr = $descr; + $clean_descr =~ s/[^\w]//g; + $descr = '' if ($clean_entry eq $clean_descr) + } + push(@lines2,&debug('
    \n", __LINE__)); + } + elsif ($node =~ /^\(.*\)\w+/) + { + push(@lines2,&debug('\n", __LINE__)) + } + else + { + warn "$ERROR Undefined node of menu_entry ($node): $_"; + } +} + +sub do_ctrl { "^$_[0]" } + +sub do_email { + local($addr, $text) = split(/,\s*/, $_[0]); + + $text = $addr unless $text; + &t2h_anchor('', "mailto:$addr", $text); +} + +sub do_sc +{ + # l2h does this much better + return &l2h_ToLatex("{\\sc ".&unprotect_html($_[0])."}") if ($T2H_L2H); + return "\U$_[0]\E"; +} + +sub do_math +{ + return &l2h_ToLatex("\$".&unprotect_html($_[0])."\$") if ($T2H_L2H); + return "".$text.""; +} + +sub do_uref { + local($url, $text, $only_text) = split(/,\s*/, $_[0]); + + $text = $only_text if $only_text; + $text = $url unless $text; + &t2h_anchor('', $url, $text); +} + +sub do_url { &t2h_anchor('', $_[0], $_[0]) } + +sub do_acronym +{ + return '' . $_[0] . ''; +} + +sub do_accent +{ + return "&$_[0]acute;" if $_[1] eq 'H'; + return "$_[0]." if $_[1] eq 'dotaccent'; + return "$_[0]*" if $_[1] eq 'ringaccent'; + return "$_[0]".'[' if $_[1] eq 'tieaccent'; + return "$_[0]".'(' if $_[1] eq 'u'; + return "$_[0]_" if $_[1] eq 'ubaraccent'; + return ".$_[0]" if $_[1] eq 'udotaccent'; + return "$_[0]<" if $_[1] eq 'v'; + return "&$_[0]cedil;" if $_[1] eq ','; + return "$_[0]" if $_[1] eq 'dotless'; + return undef; +} + +sub apply_style { + local($texi_style, $text) = @_; + local($style); + + $style = $style_map{$texi_style}; + if (defined($style)) { # known style + if ($style =~ /^\"/) { # add quotes + $style = $'; + $text = "\`$text\'"; + } + if ($style =~ /^\&/) { # custom + $style = $'; + $text = &$style($text, $texi_style); + } elsif ($style) { # good style + $text = "<$style>$text"; + } else { # no style + } + } else { # unknown style + $text = undef; + } + return($text); +} + +# remove Texinfo styles +sub remove_style { + local($_) = @_; + 1 while(s/\@\w+{([^\{\}]+)}/$1/g); + return($_); +} + +sub remove_things +{ + local ($_) = @_; + s|\@(\w+)\{\}|$1|g; + return $_; +} + +sub substitute_style { + local($_) = @_; + local($changed, $done, $style, $text); + + &simple_substitutions; + $changed = 1; + while ($changed) { + $changed = 0; + $done = ''; + while (/\@(\w+){([^\{\}]+)}/ || /\@(,){([^\{\}]+)}/) { + $text = &apply_style($1, $2); + if ($text) { + $_ = "$`$text$'"; + $changed = 1; + } else { + $done .= "$`\@$1"; + $_ = "{$2}$'"; + } + } + $_ = $done . $_; + } + return($_); +} + +sub t2h_anchor { + local($name, $href, $text, $newline, $extra_attribs) = @_; + local($result); + + $result = " + $what =~ s/\&/\&\#38;/g; + $what =~ s/\/\&\#62;/g; + # restore anything in quotes + # this fixes my problem where I had: + # < IMG SRC="leftarrow.gif" ALT="<--" > but what if I wanted < in my ALT text ?? + # maybe byte stuffing or some other technique should be used. + $what =~ s/\"([^\&]+)\&\#60;(.*)\"/"$1<$2"/g; + $what =~ s/\"([^\&]+)\&\#62;(.*)\"/"$1>$2"/g; + $what =~ s/\"([^\&]+)\&\#38;(.*)\"/"$1&$2"/g; + # but recognize some HTML things + $what =~ s/\&\#60;\/A\&\#62;/<\/A>/g; # + $what =~ s/\&\#60;A ([^\&]+)\&\#62;//g; # + $what =~ s/\&\#60;IMG ([^\&]+)\&\#62;//g; # + return($what); +} + +sub unprotect_texi { + s/$;0/\@/go; + s/$;1/\{/go; + s/$;2/\}/go; + s/$;3/\`/go; + s/$;4/\'/go; +} + +sub Unprotect_texi +{ + local $_ = shift; + &unprotect_texi; + return($_); +} + +sub unprotect_html { + local($what) = @_; + $what =~ s/\&\#38;/\&/g; + $what =~ s/\&\#60;/\/g; + return($what); +} + +sub t2h_print_label +{ + my $fh = shift; + my $href = shift || $T2H_HREF{This}; + $href =~ s/.*#(.*)$/$1/; + print $fh qq{\n}; +} + +############################################################################## + + # These next few lines are legal in both Perl and nroff. + +.00 ; # finish .ig + +'di \" finish diversion--previous line must be blank +.nr nl 0-1 \" fake up transition to first page again +.nr % 0 \" start at page 1 +'; __END__ ############# From here on it's a standard manual page ############ +.so /usr/local/man/man1/texi2html.1 diff --git a/support/xcase.c b/support/xcase.c new file mode 100644 index 0000000..6796e06 --- /dev/null +++ b/support/xcase.c @@ -0,0 +1,96 @@ +/* xcase - change uppercase characters to lowercase or vice versa. */ + +/* Copyright (C) 2008,2009 Free Software Foundation, Inc. + + This file is part of GNU Bash. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#if HAVE_UNISTD_H +#include +#endif + +#include "bashansi.h" +#include + +#ifndef errno +extern int errno; +#endif + +#define LOWER 1 +#define UPPER 2 + +int +main(ac, av) +int ac; +char **av; +{ + int c, x; + int op; + FILE *inf; + + op = 0; + while ((c = getopt(ac, av, "lnu")) != EOF) { + switch (c) { + case 'n': + setbuf (stdout, (char *)NULL); + break; + case 'u': + op = UPPER; + break; + case 'l': + op = LOWER; + break; + default: + fprintf(stderr, "casemod: usage: casemod [-lnu] [file]\n"); + exit(2); + } + } + av += optind; + ac -= optind; + + if (av[0] && (av[0][0] != '-' || av[0][1])) { + inf = fopen(av[0], "r"); + if (inf == 0) { + fprintf(stderr, "casemod: %s: cannot open: %s\n", av[0], strerror(errno)); + exit(1); + } + } else + inf = stdin; + + while ((c = getc(inf)) != EOF) { + switch (op) { + case UPPER: + x = islower(c) ? toupper(c) : c; + break; + case LOWER: + x = isupper(c) ? tolower(c) : c; + break; + default: + x = c; + break; + } + putchar(x); + } + + exit(0); +} diff --git a/support/xenix-link.sh b/support/xenix-link.sh new file mode 100755 index 0000000..4d82e00 --- /dev/null +++ b/support/xenix-link.sh @@ -0,0 +1,84 @@ +: +# link bash for Xenix under SCO Unix +# +# For xenix 2.2: +# CC="cc -xenix -lx" ./configure +# edit config.h: +# comment out the define for HAVE_DIRENT_H +# enable the define for HAVE_SYS_NDIR_H to 1 +# make +# CC="cc -xenix -lx" ./link.sh +# +# For xenix 2.3: +# CC="cc -x2.3" ./configure +# make +# CC="cc -x2.3" ./link.sh + +# Copyright (C) 1989-2002 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +set -x + +rm -f bash + +if [ -z "$CC" ] +then + if [ -f /unix ] && [ ! -f /xenix ] + then + CC="cc -xenix" + else + CC=gcc + fi +fi + +try_dir=no +try_23=no +try_x=yes + +case "$CC" in +*-ldir*) try_dir=yes ;; +esac + +case "$CC" in +*-lx*) try_23=no ; try_x=yes ;; +esac + +case "$CC" in +*-x2.3*|*-l2.3*) try_23=yes ; try_dir=yes ;; +esac + +libs= +try="socket" +if [ $try_dir = yes ] ; then try="$try dir" ; fi +if [ $try_23 = yes ] ; then try="$try 2.3" ; fi +if [ $try_x = yes ] ; then try="$try x" ; fi +for name in $try +do + if [ -r "/lib/386/Slib${name}.a" ] ; then libs="$libs -l$name" ; fi +done + +$CC -o bash shell.o eval.o y.tab.o \ +general.o make_cmd.o print_cmd.o dispose_cmd.o execute_cmd.o variables.o \ +copy_cmd.o error.o expr.o flags.o nojobs.o subst.o hashcmd.o hashlib.o \ +mailcheck.o trap.o input.o unwind_prot.o pathexp.o sig.o test.o \ +version.o alias.o array.o braces.o bracecomp.o bashhist.o bashline.o \ +getcwd.o siglist.o vprint.o oslib.o list.o stringlib.o locale.o \ +xmalloc.o builtins/libbuiltins.a \ +lib/readline/libreadline.a lib/readline/libhistory.a \ +-ltermcap lib/glob/libglob.a lib/tilde/libtilde.a lib/malloc/libmalloc.a \ +$libs + +ls -l bash diff --git a/support/zecho.c b/support/zecho.c new file mode 100644 index 0000000..f3a4fe0 --- /dev/null +++ b/support/zecho.c @@ -0,0 +1,43 @@ +/* zecho - bare-bones echo */ + +/* Copyright (C) 1996-2002 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include "bashansi.h" +#include + +int +main(argc, argv) +int argc; +char **argv; +{ + argv++; + + while (*argv) { + (void)printf("%s", *argv); + if (*++argv) + putchar(' '); + } + + putchar('\n'); + exit(0); +} diff --git a/syntax.h b/syntax.h new file mode 100644 index 0000000..e01110e --- /dev/null +++ b/syntax.h @@ -0,0 +1,104 @@ +/* syntax.h -- Syntax definitions for the shell */ + +/* Copyright (C) 2000, 2001, 2005, 2008,2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _SYNTAX_H_ +#define _SYNTAX_H_ + +/* Defines for use by mksyntax.c */ + +#define slashify_in_quotes "\\`$\"\n" +#define slashify_in_here_document "\\`$" + +#define shell_meta_chars "()<>;&|" +#define shell_break_chars "()<>;&| \t\n" + +#define shell_quote_chars "\"`'" + +#if defined (PROCESS_SUBSTITUTION) +# define shell_exp_chars "$<>" +#else +# define shell_exp_chars "$" +#endif + +#if defined (EXTENDED_GLOB) +# define ext_glob_chars "@*+?!" +#else +# define ext_glob_chars "" +#endif +#define shell_glob_chars "*?[]^" + +/* Defines shared by mksyntax.c and the rest of the shell code. */ + +/* Values for character flags in syntax tables */ + +#define CWORD 0x0000 /* nothing special; an ordinary character */ +#define CSHMETA 0x0001 /* shell meta character */ +#define CSHBRK 0x0002 /* shell break character */ +#define CBACKQ 0x0004 /* back quote */ +#define CQUOTE 0x0008 /* shell quote character */ +#define CSPECL 0x0010 /* special character that needs quoting */ +#define CEXP 0x0020 /* shell expansion character */ +#define CBSDQUOTE 0x0040 /* characters escaped by backslash in double quotes */ +#define CBSHDOC 0x0080 /* characters escaped by backslash in here doc */ +#define CGLOB 0x0100 /* globbing characters */ +#define CXGLOB 0x0200 /* extended globbing characters */ +#define CXQUOTE 0x0400 /* cquote + backslash */ +#define CSPECVAR 0x0800 /* single-character shell variable name */ +#define CSUBSTOP 0x1000 /* values of OP for ${word[:]OPstuff} */ +#define CBLANK 0x2000 /* whitespace (blank) character */ + +/* Defines for use by the rest of the shell. */ +extern int sh_syntaxtab[]; +extern int sh_syntabsiz; + +#define shellmeta(c) (sh_syntaxtab[(unsigned char)(c)] & CSHMETA) +#define shellbreak(c) (sh_syntaxtab[(unsigned char)(c)] & CSHBRK) +#define shellquote(c) (sh_syntaxtab[(unsigned char)(c)] & CQUOTE) +#define shellxquote(c) (sh_syntaxtab[(unsigned char)(c)] & CXQUOTE) + +#define shellblank(c) (sh_syntaxtab[(unsigned char)(c)] & CBLANK) + +#define issyntype(c, t) ((sh_syntaxtab[(unsigned char)(c)] & (t)) != 0) +#define notsyntype(c,t) ((sh_syntaxtab[(unsigned char)(c)] & (t)) == 0) + +#if defined (PROCESS_SUBSTITUTION) +# define shellexp(c) ((c) == '$' || (c) == '<' || (c) == '>') +#else +# define shellexp(c) ((c) == '$') +#endif + +#if defined (EXTENDED_GLOB) +# define PATTERN_CHAR(c) \ + ((c) == '@' || (c) == '*' || (c) == '+' || (c) == '?' || (c) == '!') +#else +# define PATTERN_CHAR(c) 0 +#endif + +#define GLOB_CHAR(c) \ + ((c) == '*' || (c) == '?' || (c) == '[' || (c) == ']' || (c) == '^') + +#define CTLESC '\001' +#define CTLNUL '\177' + +#if !defined (HAVE_ISBLANK) && !defined (isblank) +# define isblank(x) ((x) == ' ' || (x) == '\t') +#endif + +#endif /* _SYNTAX_H_ */ diff --git a/test.c b/test.c new file mode 100644 index 0000000..ab7bec7 --- /dev/null +++ b/test.c @@ -0,0 +1,880 @@ +/* test.c - GNU test program (ksb and mjb) */ + +/* Modified to run with the GNU shell Apr 25, 1988 by bfox. */ + +/* Copyright (C) 1987-2010 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* Define PATTERN_MATCHING to get the csh-like =~ and !~ pattern-matching + binary operators. */ +/* #define PATTERN_MATCHING */ + +#if defined (HAVE_CONFIG_H) +# include +#endif + +#include + +#include "bashtypes.h" + +#if !defined (HAVE_LIMITS_H) && defined (HAVE_SYS_PARAM_H) +# include +#endif + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +#if !defined (_POSIX_VERSION) && defined (HAVE_SYS_FILE_H) +# include +#endif /* !_POSIX_VERSION */ +#include "posixstat.h" +#include "filecntl.h" +#include "stat-time.h" + +#include "bashintl.h" + +#include "shell.h" +#include "pathexp.h" +#include "test.h" +#include "builtins/common.h" + +#include + +#if !defined (STRLEN) +# define STRLEN(s) ((s)[0] ? ((s)[1] ? ((s)[2] ? strlen(s) : 2) : 1) : 0) +#endif + +#if !defined (STREQ) +# define STREQ(a, b) ((a)[0] == (b)[0] && strcmp ((a), (b)) == 0) +#endif /* !STREQ */ +#define STRCOLLEQ(a, b) ((a)[0] == (b)[0] && strcoll ((a), (b)) == 0) + +#if !defined (R_OK) +#define R_OK 4 +#define W_OK 2 +#define X_OK 1 +#define F_OK 0 +#endif /* R_OK */ + +#define EQ 0 +#define NE 1 +#define LT 2 +#define GT 3 +#define LE 4 +#define GE 5 + +#define NT 0 +#define OT 1 +#define EF 2 + +/* The following few defines control the truth and false output of each stage. + TRUE and FALSE are what we use to compute the final output value. + SHELL_BOOLEAN is the form which returns truth or falseness in shell terms. + Default is TRUE = 1, FALSE = 0, SHELL_BOOLEAN = (!value). */ +#define TRUE 1 +#define FALSE 0 +#define SHELL_BOOLEAN(value) (!(value)) + +#define TEST_ERREXIT_STATUS 2 + +static procenv_t test_exit_buf; +static int test_error_return; +#define test_exit(val) \ + do { test_error_return = val; longjmp (test_exit_buf, 1); } while (0) + +extern int sh_stat __P((const char *, struct stat *)); + +static int pos; /* The offset of the current argument in ARGV. */ +static int argc; /* The number of arguments present in ARGV. */ +static char **argv; /* The argument list. */ +static int noeval; + +static void test_syntax_error __P((char *, char *)) __attribute__((__noreturn__)); +static void beyond __P((void)) __attribute__((__noreturn__)); +static void integer_expected_error __P((char *)) __attribute__((__noreturn__)); + +static int unary_operator __P((void)); +static int binary_operator __P((void)); +static int two_arguments __P((void)); +static int three_arguments __P((void)); +static int posixtest __P((void)); + +static int expr __P((void)); +static int term __P((void)); +static int and __P((void)); +static int or __P((void)); + +static int filecomp __P((char *, char *, int)); +static int arithcomp __P((char *, char *, int, int)); +static int patcomp __P((char *, char *, int)); + +static void +test_syntax_error (format, arg) + char *format, *arg; +{ + builtin_error (format, arg); + test_exit (TEST_ERREXIT_STATUS); +} + +/* + * beyond - call when we're beyond the end of the argument list (an + * error condition) + */ +static void +beyond () +{ + test_syntax_error (_("argument expected"), (char *)NULL); +} + +/* Syntax error for when an integer argument was expected, but + something else was found. */ +static void +integer_expected_error (pch) + char *pch; +{ + test_syntax_error (_("%s: integer expression expected"), pch); +} + +/* Increment our position in the argument list. Check that we're not + past the end of the argument list. This check is suppressed if the + argument is FALSE. Made a macro for efficiency. */ +#define advance(f) do { ++pos; if (f && pos >= argc) beyond (); } while (0) +#define unary_advance() do { advance (1); ++pos; } while (0) + +/* + * expr: + * or + */ +static int +expr () +{ + if (pos >= argc) + beyond (); + + return (FALSE ^ or ()); /* Same with this. */ +} + +/* + * or: + * and + * and '-o' or + */ +static int +or () +{ + int value, v2; + + value = and (); + if (pos < argc && argv[pos][0] == '-' && argv[pos][1] == 'o' && !argv[pos][2]) + { + advance (0); + v2 = or (); + return (value || v2); + } + + return (value); +} + +/* + * and: + * term + * term '-a' and + */ +static int +and () +{ + int value, v2; + + value = term (); + if (pos < argc && argv[pos][0] == '-' && argv[pos][1] == 'a' && !argv[pos][2]) + { + advance (0); + v2 = and (); + return (value && v2); + } + return (value); +} + +/* + * term - parse a term and return 1 or 0 depending on whether the term + * evaluates to true or false, respectively. + * + * term ::= + * '-'('a'|'b'|'c'|'d'|'e'|'f'|'g'|'h'|'k'|'p'|'r'|'s'|'u'|'w'|'x') filename + * '-'('G'|'L'|'O'|'S'|'N') filename + * '-t' [int] + * '-'('z'|'n') string + * '-o' option + * string + * string ('!='|'='|'==') string + * '-'(eq|ne|le|lt|ge|gt) + * file '-'(nt|ot|ef) file + * '(' ')' + * int ::= + * positive and negative integers + */ +static int +term () +{ + int value; + + if (pos >= argc) + beyond (); + + /* Deal with leading `not's. */ + if (argv[pos][0] == '!' && argv[pos][1] == '\0') + { + value = 0; + while (pos < argc && argv[pos][0] == '!' && argv[pos][1] == '\0') + { + advance (1); + value = 1 - value; + } + + return (value ? !term() : term()); + } + + /* A paren-bracketed argument. */ + if (argv[pos][0] == '(' && argv[pos][1] == '\0') /* ) */ + { + advance (1); + value = expr (); + if (argv[pos] == 0) /* ( */ + test_syntax_error (_("`)' expected"), (char *)NULL); + else if (argv[pos][0] != ')' || argv[pos][1]) /* ( */ + test_syntax_error (_("`)' expected, found %s"), argv[pos]); + advance (0); + return (value); + } + + /* are there enough arguments left that this could be dyadic? */ + if ((pos + 3 <= argc) && test_binop (argv[pos + 1])) + value = binary_operator (); + + /* Might be a switch type argument */ + else if (argv[pos][0] == '-' && argv[pos][2] == '\0') + { + if (test_unop (argv[pos])) + value = unary_operator (); + else + test_syntax_error (_("%s: unary operator expected"), argv[pos]); + } + else + { + value = argv[pos][0] != '\0'; + advance (0); + } + + return (value); +} + +static int +stat_mtime (fn, st, ts) + char *fn; + struct stat *st; + struct timespec *ts; +{ + int r; + + r = sh_stat (fn, st); + if (r < 0) + return r; + *ts = get_stat_mtime (st); + return 0; +} + +static int +filecomp (s, t, op) + char *s, *t; + int op; +{ + struct stat st1, st2; + struct timespec ts1, ts2; + int r1, r2; + + if ((r1 = stat_mtime (s, &st1, &ts1)) < 0) + { + if (op == EF) + return (FALSE); + } + if ((r2 = stat_mtime (t, &st2, &ts2)) < 0) + { + if (op == EF) + return (FALSE); + } + + switch (op) + { + case OT: return (r1 < r2 || (r2 == 0 && timespec_cmp (ts1, ts2) < 0)); + case NT: return (r1 > r2 || (r1 == 0 && timespec_cmp (ts1, ts2) > 0)); + case EF: return (same_file (s, t, &st1, &st2)); + } + return (FALSE); +} + +static int +arithcomp (s, t, op, flags) + char *s, *t; + int op, flags; +{ + intmax_t l, r; + int expok; + + if (flags & TEST_ARITHEXP) + { + l = evalexp (s, &expok); + if (expok == 0) + return (FALSE); /* should probably longjmp here */ + r = evalexp (t, &expok); + if (expok == 0) + return (FALSE); /* ditto */ + } + else + { + if (legal_number (s, &l) == 0) + integer_expected_error (s); + if (legal_number (t, &r) == 0) + integer_expected_error (t); + } + + switch (op) + { + case EQ: return (l == r); + case NE: return (l != r); + case LT: return (l < r); + case GT: return (l > r); + case LE: return (l <= r); + case GE: return (l >= r); + } + + return (FALSE); +} + +static int +patcomp (string, pat, op) + char *string, *pat; + int op; +{ + int m; + + m = strmatch (pat, string, FNMATCH_EXTFLAG|FNMATCH_IGNCASE); + return ((op == EQ) ? (m == 0) : (m != 0)); +} + +int +binary_test (op, arg1, arg2, flags) + char *op, *arg1, *arg2; + int flags; +{ + int patmatch; + + patmatch = (flags & TEST_PATMATCH); + + if (op[0] == '=' && (op[1] == '\0' || (op[1] == '=' && op[2] == '\0'))) + return (patmatch ? patcomp (arg1, arg2, EQ) : STREQ (arg1, arg2)); + else if ((op[0] == '>' || op[0] == '<') && op[1] == '\0') + { +#if defined (HAVE_STRCOLL) + if (shell_compatibility_level > 40 && flags & TEST_LOCALE) + return ((op[0] == '>') ? (strcoll (arg1, arg2) > 0) : (strcoll (arg1, arg2) < 0)); + else +#endif + return ((op[0] == '>') ? (strcmp (arg1, arg2) > 0) : (strcmp (arg1, arg2) < 0)); + } + else if (op[0] == '!' && op[1] == '=' && op[2] == '\0') + return (patmatch ? patcomp (arg1, arg2, NE) : (STREQ (arg1, arg2) == 0)); + + + else if (op[2] == 't') + { + switch (op[1]) + { + case 'n': return (filecomp (arg1, arg2, NT)); /* -nt */ + case 'o': return (filecomp (arg1, arg2, OT)); /* -ot */ + case 'l': return (arithcomp (arg1, arg2, LT, flags)); /* -lt */ + case 'g': return (arithcomp (arg1, arg2, GT, flags)); /* -gt */ + } + } + else if (op[1] == 'e') + { + switch (op[2]) + { + case 'f': return (filecomp (arg1, arg2, EF)); /* -ef */ + case 'q': return (arithcomp (arg1, arg2, EQ, flags)); /* -eq */ + } + } + else if (op[2] == 'e') + { + switch (op[1]) + { + case 'n': return (arithcomp (arg1, arg2, NE, flags)); /* -ne */ + case 'g': return (arithcomp (arg1, arg2, GE, flags)); /* -ge */ + case 'l': return (arithcomp (arg1, arg2, LE, flags)); /* -le */ + } + } + + return (FALSE); /* should never get here */ +} + + +static int +binary_operator () +{ + int value; + char *w; + + w = argv[pos + 1]; + if ((w[0] == '=' && (w[1] == '\0' || (w[1] == '=' && w[2] == '\0'))) || /* =, == */ + ((w[0] == '>' || w[0] == '<') && w[1] == '\0') || /* <, > */ + (w[0] == '!' && w[1] == '=' && w[2] == '\0')) /* != */ + { + value = binary_test (w, argv[pos], argv[pos + 2], 0); + pos += 3; + return (value); + } + +#if defined (PATTERN_MATCHING) + if ((w[0] == '=' || w[0] == '!') && w[1] == '~' && w[2] == '\0') + { + value = patcomp (argv[pos], argv[pos + 2], w[0] == '=' ? EQ : NE); + pos += 3; + return (value); + } +#endif + + if ((w[0] != '-' || w[3] != '\0') || test_binop (w) == 0) + { + test_syntax_error (_("%s: binary operator expected"), w); + /* NOTREACHED */ + return (FALSE); + } + + value = binary_test (w, argv[pos], argv[pos + 2], 0); + pos += 3; + return value; +} + +static int +unary_operator () +{ + char *op; + intmax_t r; + + op = argv[pos]; + if (test_unop (op) == 0) + return (FALSE); + + /* the only tricky case is `-t', which may or may not take an argument. */ + if (op[1] == 't') + { + advance (0); + if (pos < argc) + { + if (legal_number (argv[pos], &r)) + { + advance (0); + return (unary_test (op, argv[pos - 1])); + } + else + return (FALSE); + } + else + return (unary_test (op, "1")); + } + + /* All of the unary operators take an argument, so we first call + unary_advance (), which checks to make sure that there is an + argument, and then advances pos right past it. This means that + pos - 1 is the location of the argument. */ + unary_advance (); + return (unary_test (op, argv[pos - 1])); +} + +int +unary_test (op, arg) + char *op, *arg; +{ + intmax_t r; + struct stat stat_buf; + SHELL_VAR *v; + + switch (op[1]) + { + case 'a': /* file exists in the file system? */ + case 'e': + return (sh_stat (arg, &stat_buf) == 0); + + case 'r': /* file is readable? */ + return (sh_eaccess (arg, R_OK) == 0); + + case 'w': /* File is writeable? */ + return (sh_eaccess (arg, W_OK) == 0); + + case 'x': /* File is executable? */ + return (sh_eaccess (arg, X_OK) == 0); + + case 'O': /* File is owned by you? */ + return (sh_stat (arg, &stat_buf) == 0 && + (uid_t) current_user.euid == (uid_t) stat_buf.st_uid); + + case 'G': /* File is owned by your group? */ + return (sh_stat (arg, &stat_buf) == 0 && + (gid_t) current_user.egid == (gid_t) stat_buf.st_gid); + + case 'N': + return (sh_stat (arg, &stat_buf) == 0 && + stat_buf.st_atime <= stat_buf.st_mtime); + + case 'f': /* File is a file? */ + if (sh_stat (arg, &stat_buf) < 0) + return (FALSE); + + /* -f is true if the given file exists and is a regular file. */ +#if defined (S_IFMT) + return (S_ISREG (stat_buf.st_mode) || (stat_buf.st_mode & S_IFMT) == 0); +#else + return (S_ISREG (stat_buf.st_mode)); +#endif /* !S_IFMT */ + + case 'd': /* File is a directory? */ + return (sh_stat (arg, &stat_buf) == 0 && (S_ISDIR (stat_buf.st_mode))); + + case 's': /* File has something in it? */ + return (sh_stat (arg, &stat_buf) == 0 && stat_buf.st_size > (off_t) 0); + + case 'S': /* File is a socket? */ +#if !defined (S_ISSOCK) + return (FALSE); +#else + return (sh_stat (arg, &stat_buf) == 0 && S_ISSOCK (stat_buf.st_mode)); +#endif /* S_ISSOCK */ + + case 'c': /* File is character special? */ + return (sh_stat (arg, &stat_buf) == 0 && S_ISCHR (stat_buf.st_mode)); + + case 'b': /* File is block special? */ + return (sh_stat (arg, &stat_buf) == 0 && S_ISBLK (stat_buf.st_mode)); + + case 'p': /* File is a named pipe? */ +#ifndef S_ISFIFO + return (FALSE); +#else + return (sh_stat (arg, &stat_buf) == 0 && S_ISFIFO (stat_buf.st_mode)); +#endif /* S_ISFIFO */ + + case 'L': /* Same as -h */ + case 'h': /* File is a symbolic link? */ +#if !defined (S_ISLNK) || !defined (HAVE_LSTAT) + return (FALSE); +#else + return ((arg[0] != '\0') && + (lstat (arg, &stat_buf) == 0) && S_ISLNK (stat_buf.st_mode)); +#endif /* S_IFLNK && HAVE_LSTAT */ + + case 'u': /* File is setuid? */ + return (sh_stat (arg, &stat_buf) == 0 && (stat_buf.st_mode & S_ISUID) != 0); + + case 'g': /* File is setgid? */ + return (sh_stat (arg, &stat_buf) == 0 && (stat_buf.st_mode & S_ISGID) != 0); + + case 'k': /* File has sticky bit set? */ +#if !defined (S_ISVTX) + /* This is not Posix, and is not defined on some Posix systems. */ + return (FALSE); +#else + return (sh_stat (arg, &stat_buf) == 0 && (stat_buf.st_mode & S_ISVTX) != 0); +#endif + + case 't': /* File fd is a terminal? */ + if (legal_number (arg, &r) == 0) + return (FALSE); + return ((r == (int)r) && isatty ((int)r)); + + case 'n': /* True if arg has some length. */ + return (arg[0] != '\0'); + + case 'z': /* True if arg has no length. */ + return (arg[0] == '\0'); + + case 'o': /* True if option `arg' is set. */ + return (minus_o_option_value (arg) == 1); + + case 'v': + v = find_variable (arg); +#if defined (ARRAY_VARS) + if (v == 0 && valid_array_reference (arg)) + { + char *t; + t = array_value (arg, 0, 0, (int *)0, (arrayind_t *)0); + return (t ? TRUE : FALSE); + } + else if (v && invisible_p (v) == 0 && array_p (v)) + { + char *t; + /* [[ -v foo ]] == [[ -v foo[0] ]] */ + t = array_reference (array_cell (v), 0); + return (t ? TRUE : FALSE); + } + else if (v && invisible_p (v) == 0 && assoc_p (v)) + { + char *t; + t = assoc_reference (assoc_cell (v), "0"); + return (t ? TRUE : FALSE); + } +#endif + return (v && invisible_p (v) == 0 && var_isset (v) ? TRUE : FALSE); + + case 'R': + v = find_variable_noref (arg); + return ((v && invisible_p (v) == 0 && var_isset (v) && nameref_p (v)) ? TRUE : FALSE); + } + + /* We can't actually get here, but this shuts up gcc. */ + return (FALSE); +} + +/* Return TRUE if OP is one of the test command's binary operators. */ +int +test_binop (op) + char *op; +{ + if (op[0] == '=' && op[1] == '\0') + return (1); /* '=' */ + else if ((op[0] == '<' || op[0] == '>') && op[1] == '\0') /* string <, > */ + return (1); + else if ((op[0] == '=' || op[0] == '!') && op[1] == '=' && op[2] == '\0') + return (1); /* `==' and `!=' */ +#if defined (PATTERN_MATCHING) + else if (op[2] == '\0' && op[1] == '~' && (op[0] == '=' || op[0] == '!')) + return (1); +#endif + else if (op[0] != '-' || op[2] == '\0' || op[3] != '\0') + return (0); + else + { + if (op[2] == 't') + switch (op[1]) + { + case 'n': /* -nt */ + case 'o': /* -ot */ + case 'l': /* -lt */ + case 'g': /* -gt */ + return (1); + default: + return (0); + } + else if (op[1] == 'e') + switch (op[2]) + { + case 'q': /* -eq */ + case 'f': /* -ef */ + return (1); + default: + return (0); + } + else if (op[2] == 'e') + switch (op[1]) + { + case 'n': /* -ne */ + case 'g': /* -ge */ + case 'l': /* -le */ + return (1); + default: + return (0); + } + else + return (0); + } +} + +/* Return non-zero if OP is one of the test command's unary operators. */ +int +test_unop (op) + char *op; +{ + if (op[0] != '-' || op[2] != 0) + return (0); + + switch (op[1]) + { + case 'a': case 'b': case 'c': case 'd': case 'e': + case 'f': case 'g': case 'h': case 'k': case 'n': + case 'o': case 'p': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': case 'z': + case 'G': case 'L': case 'O': case 'S': case 'N': + case 'R': + return (1); + } + + return (0); +} + +static int +two_arguments () +{ + if (argv[pos][0] == '!' && argv[pos][1] == '\0') + return (argv[pos + 1][0] == '\0'); + else if (argv[pos][0] == '-' && argv[pos][2] == '\0') + { + if (test_unop (argv[pos])) + return (unary_operator ()); + else + test_syntax_error (_("%s: unary operator expected"), argv[pos]); + } + else + test_syntax_error (_("%s: unary operator expected"), argv[pos]); + + return (0); +} + +#define ANDOR(s) (s[0] == '-' && !s[2] && (s[1] == 'a' || s[1] == 'o')) + +/* This could be augmented to handle `-t' as equivalent to `-t 1', but + POSIX requires that `-t' be given an argument. */ +#define ONE_ARG_TEST(s) ((s)[0] != '\0') + +static int +three_arguments () +{ + int value; + + if (test_binop (argv[pos+1])) + { + value = binary_operator (); + pos = argc; + } + else if (ANDOR (argv[pos+1])) + { + if (argv[pos+1][1] == 'a') + value = ONE_ARG_TEST(argv[pos]) && ONE_ARG_TEST(argv[pos+2]); + else + value = ONE_ARG_TEST(argv[pos]) || ONE_ARG_TEST(argv[pos+2]); + pos = argc; + } + else if (argv[pos][0] == '!' && argv[pos][1] == '\0') + { + advance (1); + value = !two_arguments (); + } + else if (argv[pos][0] == '(' && argv[pos+2][0] == ')') + { + value = ONE_ARG_TEST(argv[pos+1]); + pos = argc; + } + else + test_syntax_error (_("%s: binary operator expected"), argv[pos+1]); + + return (value); +} + +/* This is an implementation of a Posix.2 proposal by David Korn. */ +static int +posixtest () +{ + int value; + + switch (argc - 1) /* one extra passed in */ + { + case 0: + value = FALSE; + pos = argc; + break; + + case 1: + value = ONE_ARG_TEST(argv[1]); + pos = argc; + break; + + case 2: + value = two_arguments (); + pos = argc; + break; + + case 3: + value = three_arguments (); + break; + + case 4: + if (argv[pos][0] == '!' && argv[pos][1] == '\0') + { + advance (1); + value = !three_arguments (); + break; + } + /* FALLTHROUGH */ + default: + value = expr (); + } + + return (value); +} + +/* + * [: + * '[' expr ']' + * test: + * test expr + */ +int +test_command (margc, margv) + int margc; + char **margv; +{ + int value; + int code; + + USE_VAR(margc); + + code = setjmp_nosigs (test_exit_buf); + + if (code) + return (test_error_return); + + argv = margv; + + if (margv[0] && margv[0][0] == '[' && margv[0][1] == '\0') + { + --margc; + + if (margv[margc] && (margv[margc][0] != ']' || margv[margc][1])) + test_syntax_error (_("missing `]'"), (char *)NULL); + + if (margc < 2) + test_exit (SHELL_BOOLEAN (FALSE)); + } + + argc = margc; + pos = 1; + + if (pos >= argc) + test_exit (SHELL_BOOLEAN (FALSE)); + + noeval = 0; + value = posixtest (); + + if (pos != argc) + test_syntax_error (_("too many arguments"), (char *)NULL); + + test_exit (SHELL_BOOLEAN (value)); +} diff --git a/test.h b/test.h new file mode 100644 index 0000000..626edc4 --- /dev/null +++ b/test.h @@ -0,0 +1,39 @@ +/* test.h -- external interface to the conditional command code. */ + +/* Copyright (C) 1997-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#ifndef _TEST_H_ +#define _TEST_H_ + +#include "stdc.h" + +/* Values for the flags argument to binary_test */ +#define TEST_PATMATCH 0x01 +#define TEST_ARITHEXP 0x02 +#define TEST_LOCALE 0x04 + +extern int test_unop __P((char *)); +extern int test_binop __P((char *)); + +extern int unary_test __P((char *, char *)); +extern int binary_test __P((char *, char *, char *, int)); + +extern int test_command __P((int, char **)); + +#endif /* _TEST_H_ */ diff --git a/tests/COPYRIGHT b/tests/COPYRIGHT new file mode 100644 index 0000000..43b39df --- /dev/null +++ b/tests/COPYRIGHT @@ -0,0 +1,9 @@ +Unless otherwise stated, all files in this directory are Copyright (C) +1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003, +2004,2005,2006,2007,2008,2009,2010,2011 +Free Software Foundation, Inc. + +See the file COPYING in the bash distribution root directory for copying +and usage restrictions. + +The file ifs-posix.tests is Copyright (C) 2005 Glen Fowler. diff --git a/tests/README b/tests/README new file mode 100644 index 0000000..b023ef6 --- /dev/null +++ b/tests/README @@ -0,0 +1,3 @@ +Type `sh run-all'. + +Read COPYRIGHT for copyright information. diff --git a/tests/alias.right b/tests/alias.right new file mode 100644 index 0000000..a37080c --- /dev/null +++ b/tests/alias.right @@ -0,0 +1,12 @@ +alias: 0 +alias: 0 +./alias.tests: line 25: qfoo: command not found +quux +bar +value +bar +value +OK +OK +OK +OK diff --git a/tests/alias.tests b/tests/alias.tests new file mode 100644 index 0000000..a97d5ff --- /dev/null +++ b/tests/alias.tests @@ -0,0 +1,39 @@ +# place holder for future alias testing +shopt -s expand_aliases + +# alias/unalias tests originally in builtins.tests + +unalias -a +# this should return success, according to POSIX.2 +alias +echo alias: $? +alias foo=bar +unalias foo +# this had better return success, according to POSIX.2 +alias +echo alias: $? + +# bug in all versions through bash-2.05b + +unalias qfoo qbar qbaz quux 2>/dev/null + +alias qfoo=qbar +alias qbar=qbaz +alias qbaz=quux +alias quux=qfoo + +qfoo + +unalias qfoo qbar qbaz quux + +unalias -a + +alias foo='echo ' +alias bar=baz +alias baz=quux + +foo bar + +unalias foo bar baz + +${THIS_SH} ./alias1.sub diff --git a/tests/alias1.sub b/tests/alias1.sub new file mode 100644 index 0000000..ed03031 --- /dev/null +++ b/tests/alias1.sub @@ -0,0 +1,20 @@ +shopt -s expand_aliases + +alias foo=echo + +< /dev/null foo bar + +< /dev/null x=value +echo $x + +< /dev/null x=newvalue foo bar +echo $x + +# problem reported by Vincent Lefevre +alias a="echo OK >&2" +a +> /dev/null a + +${THIS_SH} -c 'shopt -s expand_aliases; alias a="echo OK >&2" + a + > /dev/null a' diff --git a/tests/appendop.right b/tests/appendop.right new file mode 100644 index 0000000..9c86792 --- /dev/null +++ b/tests/appendop.right @@ -0,0 +1,28 @@ +14 +1 2 3 4 5 6 +1 2 3 4 51 6 +145 +14 +7 +42 +1 2 3 4 12 +18 +1 2 3 4 18 +1 2 7 4 5 +1 2 7 13 5 9 +14 +9 +4 +9 +16 +./appendop.tests: line 84: x: readonly variable +declare -A foo='([one]="bar" [two]="baz" [three]="quux" )' +declare -A foo='([one]="bar" [two]="baz" [0]="zero" [three]="quux" )' +declare -A foo='([four]="four" [one]="bar" [two]="baz" [0]="zero" [three]="quux" )' +declare -ai iarr='([0]="3" [1]="2" [2]="3")' +declare -ai iarr='([0]="3" [1]="2" [2]="3" [3]="4" [4]="5" [5]="6")' +25 25 +7 7 +14 +145 +145 145 diff --git a/tests/appendop.tests b/tests/appendop.tests new file mode 100644 index 0000000..e4e52c2 --- /dev/null +++ b/tests/appendop.tests @@ -0,0 +1,87 @@ +# basic cases +a=1 +a+=4 +echo $a + +x=(1 2 3) +x+=(4 5 6) + +echo ${x[@]} + +x[4]+=1 +echo ${x[@]} + +# trickier cases +# post-bash-4.2: bash understands += in environment assignments preceding +# command names +a+=5 printenv a +echo $a + +# if the integer flag is set, ksh93 appears to do arithmetic += and evaluate +# old value as an arithmetic expression +a= +typeset -i a +a+=7 +echo $a + +b=4+1 +typeset -i b +b+=37 + +echo $b + +unset x +x=(1 2 3 4 5) + +typeset -i x + +x[4]+=7 + +echo ${x[@]} + +unset x +typeset -i x + +x=([0]=7+11) +echo ${x[@]} + +unset x +x=(1 2 3 4 5) + +typeset -i x + +#x[4]=7+11 + +x=(1 2 3 4 [4]=7+11 ) +echo ${x[@]} + +x=( 1 2 [2]+=7 4 5 ) +echo ${x[@]} + +x+=( [3]+=9 [5]=9 ) +echo ${x[@]} + +unset a +a=1 +export a+=4 +printenv a +printenv a+ + +unset x +typeset -i x=4+5 +echo $x + +unset x +typeset x+=4 +echo $x + +typeset -i x+=5 +echo $x + +readonly x+=7 +echo $x + +x+=5 + +${THIS_SH} ./appendop1.sub +${THIS_SH} ./appendop2.sub diff --git a/tests/appendop1.sub b/tests/appendop1.sub new file mode 100644 index 0000000..7101d0c --- /dev/null +++ b/tests/appendop1.sub @@ -0,0 +1,15 @@ +typeset -A foo=([one]=bar [two]=baz [three]=quux) +typeset -p foo + +foo+=zero +typeset -p foo + +foo+=([four]=four) +typeset -p foo + +typeset -ia iarr=(2 2 3) +iarr+=1 +typeset -p iarr + +iarr+=(4 5 6) +typeset -p iarr diff --git a/tests/appendop2.sub b/tests/appendop2.sub new file mode 100644 index 0000000..4225ba3 --- /dev/null +++ b/tests/appendop2.sub @@ -0,0 +1,18 @@ +POSIXLY_CORRECT=1 +x=2 +x+=5 eval printf '"$x "' +echo "$x" + +unset x +typeset -i x=2 +x+=5 eval printf '"$x "' +echo "$x" + +a=1 +a+=4 +echo $a + +# idiotically, ksh93 makes these two cases differ (?) +a+=5 printenv a +a+=5 eval printf '"$a "' +echo $a diff --git a/tests/arith-for.right b/tests/arith-for.right new file mode 100644 index 0000000..5b25c5e --- /dev/null +++ b/tests/arith-for.right @@ -0,0 +1,86 @@ +0 +1 +2 +0 +1 +2 +0 +1 +2 +0 +2 +4 +fx is a function +fx () +{ + i=0; + for ((1; i < 3; i++ )) + do + echo $i; + done; + for ((i=0; 1; i++ )) + do + if (( i >= 3 )); then + break; + fi; + echo $i; + done; + for ((i=0; i<3; 1)) + do + echo $i; + (( i++ )); + done; + i=0; + for ((1; 1; 1)) + do + if (( i > 2 )); then + break; + fi; + echo $i; + (( i++ )); + done; + i=0; + for ((1; 1; 1)) + do + if (( i > 2 )); then + break; + fi; + echo $i; + (( i++ )); + done +} +0 +1 +2 +0 +1 +2 +0 +1 +2 +0 +1 +2 +0 +1 +2 +./arith-for.tests: line 77: syntax error: arithmetic expression required +./arith-for.tests: line 77: syntax error: `(( i=0; "i < 3" ))' +2 +./arith-for.tests: line 83: syntax error: `;' unexpected +./arith-for.tests: line 83: syntax error: `(( i=0; i < 3; i++; 7 ))' +2 +20 +20 +12345678 987654321 012345678 987654321 012345678 987654321 012345678 987654321 012345678 987654321 012345678 +12345678 987654321 012345678 987654321 012345678 987654321 012345678 987654321 012345678 987654321 012345678 +4 +3 +2 +1 +0 +4 +3 +2 +1 +0 diff --git a/tests/arith-for.tests b/tests/arith-for.tests new file mode 100644 index 0000000..00e2d4a --- /dev/null +++ b/tests/arith-for.tests @@ -0,0 +1,113 @@ +fx() +{ +i=0 +for (( ; i < 3; i++ )) +do + echo $i +done + +for (( i=0; ; i++ )) +do + if (( i >= 3 )); then + break; + fi + echo $i +done + +for (( i=0; i<3; )) +do + echo $i + (( i++ )) +done + +i=0 +for (( ; ; )) +do + if (( i > 2 )); then + break; + fi + echo $i; + (( i++ )) +done + +i=0 +for ((;;)) +do + if (( i > 2 )); then + break; + fi + echo $i; + (( i++ )) +done +} + +for (( i=0; "i < 3" ; i++ )) +do + echo $i +done + +i=0 +for (( ; "i < 3"; i++ )) +do + echo $i +done + +for (( i=0; ; i++ )) +do + if (( i >= 3 )); then + break; + fi + echo $i +done + +for ((i = 0; ;i++ )) +do + echo $i + if (( i < 3 )); then + (( i++ )) + continue; + fi + break +done + +type fx +fx + +# errors +for (( i=0; "i < 3" )) +do + echo $i +done +echo $? + +for (( i=0; i < 3; i++; 7 )) +do + echo $i +done +echo $? + +# one-liners added in post-bash-2.04 +for ((i=0; i < 20; i++)) do : ; done +echo $i + +for ((i=0; i < 20; i++)) { : ; } +echo $i + +# added post-bash-4.2 +for (( i = j = k = 1; i % 9 || (j *= -1, $( ((i%9)) || printf " " >&2; echo 0), k++ <= 10); i += j )) +do +printf "$i" +done + +echo + +( for (( i = j = k = 1; i % 9 || (j *= -1, $( ((i%9)) || printf " " >&2; echo 0), k++ <= 10); i += j )) +do +printf "$i" +done ) + +echo + +for (( i = 4; ;i--)) ; do echo $i; if (( $i == 0 )); then break; fi; done + +for (( i = 4;;i--)) ; do echo $i; if (( $i == 0 )); then break; fi; done diff --git a/tests/arith.right b/tests/arith.right new file mode 100644 index 0000000..680d9a9 --- /dev/null +++ b/tests/arith.right @@ -0,0 +1,247 @@ +163 +166 +4 +16 +8 +2 +4 +2 +2 +1 +0 +0 +0 +1 +1 +2 +-3 +-2 +1 +0 +2 +131072 +29 +33 +49 +1 +1 +0 +0 +1 +1 +1 +2 +3 +1 +58 +2 +60 +1 +256 +16 +62 +4 +29 +5 +-4 +4 +1 +32 +32 +1 +1 +32 +4 +20 +1,i+=2 +30 +1,j+=2 +20 +1,i+=2 +30 +1,j+=2 +./arith.tests: line 114: 1 ? 20 : x+=2: attempted assignment to non-variable (error token is "+=2") +20 +6 +6,5,3 +263 +255 +255 +127 +36 +40 +10 +10 +10 +10 +10 +10 +36 +36 +62 +63 +./arith.tests: line 149: 3425#56: invalid arithmetic base (error token is "3425#56") +0 +./arith.tests: line 155: 7 = 43 : attempted assignment to non-variable (error token is "= 43 ") +./arith.tests: line 156: 2#44: value too great for base (error token is "2#44") +./arith.tests: line 157: 44 / 0 : division by 0 (error token is "0 ") +./arith.tests: line 158: let: jv += $iv: syntax error: operand expected (error token is "$iv") +./arith.tests: line 159: jv += $iv : syntax error: operand expected (error token is "$iv ") +./arith.tests: line 160: let: rv = 7 + (43 * 6: missing `)' (error token is "6") +./arith.tests: line 164: 0#4: invalid number (error token is "0#4") +./arith.tests: line 165: 2#110#11: invalid number (error token is "2#110#11") +abc +def +ghi +ok +6 +1 +0 +./arith.tests: line 183: 4 + : syntax error: operand expected (error token is "+ ") +16 +./arith.tests: line 188: 4 ? : 3 + 5 : expression expected (error token is ": 3 + 5 ") +./arith.tests: line 189: 1 ? 20 : `:' expected for conditional expression (error token is "20 ") +./arith.tests: line 190: 4 ? 20 : : expression expected (error token is ": ") +9 +./arith.tests: line 196: 0 && B=42 : attempted assignment to non-variable (error token is "=42 ") +9 +./arith.tests: line 199: 1 || B=88 : attempted assignment to non-variable (error token is "=88 ") +9 +0 +9 +0 +9 +1 +9 +7 +7 +4 +32767 +32768 +131072 +2147483647 +1 +4 +4 +5 +5 +4 +3 +3 +4 +4 +7 +./arith.tests: line 247: 7-- : syntax error: operand expected (error token is "- ") +./arith.tests: line 249: --x=7 : attempted assignment to non-variable (error token is "=7 ") +./arith.tests: line 250: ++x=7 : attempted assignment to non-variable (error token is "=7 ") +./arith.tests: line 252: x++=7 : attempted assignment to non-variable (error token is "=7 ") +./arith.tests: line 253: x--=7 : attempted assignment to non-variable (error token is "=7 ") +4 +7 +-7 +7 +7 +./arith1.sub: line 2: 4-- : syntax error: operand expected (error token is "- ") +./arith1.sub: line 3: 4++ : syntax error: operand expected (error token is "+ ") +./arith1.sub: line 4: 4 -- : syntax error: operand expected (error token is "- ") +./arith1.sub: line 5: 4 ++ : syntax error: operand expected (error token is "+ ") +1 +2 +1 +2 +6 +3 +7 +4 +0 +3 +7 +2 +-2 +1 +./arith1.sub: line 35: ((: ++ : syntax error: operand expected (error token is "+ ") +7 +7 +./arith1.sub: line 38: ((: -- : syntax error: operand expected (error token is "- ") +7 +7 +7 +7 +1 +2 +1 +2 +1 +0 +5 +1 +6 +2 +3 +1 +4 +0 +./arith2.sub: line 33: ((: -- : syntax error: operand expected (error token is "- ") +-7 +-7 +./arith2.sub: line 37: ((: ++ : syntax error: operand expected (error token is "+ ") +7 +7 +-7 +-7 +7 +7 +1 +1 +4 +5 +-3 +2 +4 +5000 +5000 +1 +0 +0 +1 +2147483649 +0 +0 +0 +0 +0 +0 +-9223372036854775808 +-9223372036854775808 +-9223372036854775808 +-9223372036854775808 +-9223372036854775808 +-9223372036854775808 +-9223372036854775808 +-9223372036854775808 +-9223372036854775808 +-9223372036854775808 +9223372036854775805 9223372036854775806 9223372036854775807 +123 456 +123 456 +123 456 +123 456 +123 456 +123 456 +1 +1 2 3 4 5 6 7 +0 1 2 3 4 5 6 7 +0 +0, 0 +0, 1 +8 12 +./arith.tests: line 286: ((: x=9 y=41 : syntax error in expression (error token is "y=41 ") +./arith.tests: line 290: a b: syntax error in expression (error token is "b") +./arith.tests: line 291: ((: a b: syntax error in expression (error token is "b") +42 +42 +42 +42 +42 +42 +./arith.tests: line 302: b[c]d: syntax error in expression (error token is "d") diff --git a/tests/arith.tests b/tests/arith.tests new file mode 100644 index 0000000..7dcc36d --- /dev/null +++ b/tests/arith.tests @@ -0,0 +1,302 @@ +set +o posix +declare -i iv jv + +iv=$(( 3 + 5 * 32 )) +echo $iv +iv=iv+3 +echo $iv +iv=2 +jv=iv + +let "jv *= 2" +echo $jv +jv=$(( $jv << 2 )) +echo $jv + +let jv="$jv / 2" +echo $jv +jv="jv >> 2" +echo $jv + +iv=$((iv+ $jv)) +echo $iv +echo $((iv -= jv)) +echo $iv +echo $(( iv == jv )) +echo $(( iv != $jv )) +echo $(( iv < jv )) +echo $(( $iv > $jv )) +echo $(( iv <= $jv )) +echo $(( $iv >= jv )) + +echo $jv +echo $(( ~$jv )) +echo $(( ~1 )) +echo $(( ! 0 )) + +echo $(( jv % 2 )) +echo $(( $iv % 4 )) + +echo $(( iv <<= 16 )) +echo $(( iv %= 33 )) + +echo $(( 33 & 55 )) +echo $(( 33 | 17 )) + +echo $(( iv && $jv )) +echo $(( $iv || jv )) + +echo $(( iv && 0 )) +echo $(( iv & 0 )) +echo $(( iv && 1 )) +echo $(( iv & 1 )) + +echo $(( $jv || 0 )) +echo $(( jv | 0 )) +echo $(( jv | 1 )) +echo $(( $jv || 1 )) + +let 'iv *= jv' +echo $iv +echo $jv +let "jv += $iv" +echo $jv + +echo $(( jv /= iv )) +echo $(( jv <<= 8 )) +echo $(( jv >>= 4 )) + +echo $(( iv |= 4 )) +echo $(( iv &= 4 )) + +echo $(( iv += (jv + 9))) +echo $(( (iv + 4) % 7 )) + +# unary plus, minus +echo $(( +4 - 8 )) +echo $(( -4 + 8 )) + +# conditional expressions +echo $(( 4<5 ? 1 : 32)) +echo $(( 4>5 ? 1 : 32)) +echo $(( 4>(2+3) ? 1 : 32)) +echo $(( 4<(2+3) ? 1 : 32)) +echo $(( (2+2)<(2+3) ? 1 : 32)) +echo $(( (2+2)>(2+3) ? 1 : 32)) + +# bug in bash versions through bash-3.2 +S=105 +W=$((S>99?4:S>9?3:S>0?2:0)) +echo $W +unset W S + +# check that the unevaluated part of the ternary operator does not do +# evaluation or assignment +x=i+=2 +y=j+=2 +declare -i i=1 j=1 +echo $((1 ? 20 : (x+=2))) +echo $i,$x +echo $((0 ? (y+=2) : 30)) +echo $j,$y + +x=i+=2 +y=j+=2 +declare -i i=1 j=1 +echo $((1 ? 20 : (x+=2))) +echo $i,$x +echo $((0 ? (y+=2) : 30)) +echo $i,$y + +# check precedence of assignment vs. conditional operator +# should be an error +declare -i x=2 +y=$((1 ? 20 : x+=2)) + +# check precedence of assignment vs. conditional operator +declare -i x=2 +echo $((0 ? x+=2 : 20)) + +# associativity of assignment-operator operator +declare -i i=1 j=2 k=3 +echo $((i += j += k)) +echo $i,$j,$k + +# octal, hex +echo $(( 0x100 | 007 )) +echo $(( 0xff )) +echo $(( 16#ff )) +echo $(( 16#FF/2 )) +echo $(( 8#44 )) + +echo $(( 8 ^ 32 )) + +# other bases +echo $(( 16#a )) +echo $(( 32#a )) +echo $(( 56#a )) +echo $(( 64#a )) + +echo $(( 16#A )) +echo $(( 32#A )) +echo $(( 56#A )) +echo $(( 64#A )) + +echo $(( 64#@ )) +echo $(( 64#_ )) + +# weird bases +echo $(( 3425#56 )) + +# missing number after base +echo $(( 2# )) + +# these should generate errors +echo $(( 7 = 43 )) +echo $(( 2#44 )) +echo $(( 44 / 0 )) +let 'jv += $iv' +echo $(( jv += \$iv )) +let 'rv = 7 + (43 * 6' + +# more errors +declare -i i +i=0#4 +i=2#110#11 + +((echo abc; echo def;); echo ghi) + +if (((4+4) + (4 + 7))); then + echo ok +fi + +(()) # make sure the null expression works OK + +a=(0 2 4 6) +echo $(( a[1] + a[2] )) +echo $(( (a[1] + a[2]) == a[3] )) +(( (a[1] + a[2]) == a[3] )) ; echo $? + +# test pushing and popping the expression stack +unset A +A="4 + " +echo $(( ( 4 + A ) + 4 )) +A="3 + 5" +echo $(( ( 4 + A ) + 4 )) + +# badly-formed conditional expressions +echo $(( 4 ? : $A )) +echo $(( 1 ? 20 )) +echo $(( 4 ? 20 : )) + +# precedence and short-circuit evaluation +B=9 +echo $B + +echo $(( 0 && B=42 )) +echo $B + +echo $(( 1 || B=88 )) +echo $B + +echo $(( 0 && (B=42) )) +echo $B + +echo $(( (${$} - $$) && (B=42) )) +echo $B + +echo $(( 1 || (B=88) )) +echo $B + +# until command with (( )) command +x=7 + +echo $x +until (( x == 4 )) +do + echo $x + x=4 +done + +echo $x + +# exponentiation +echo $(( 2**15 - 1)) +echo $(( 2**(16-1))) +echo $(( 2**16*2 )) +echo $(( 2**31-1)) +echo $(( 2**0 )) + +# {pre,post}-{inc,dec}rement and associated errors + +x=4 + +echo $x +echo $(( x++ )) +echo $x +echo $(( x-- )) +echo $x + +echo $(( --x )) +echo $x + +echo $(( ++x )) +echo $x + +echo $(( ++7 )) +echo $(( 7-- )) + +echo $(( --x=7 )) +echo $(( ++x=7 )) + +echo $(( x++=7 )) +echo $(( x--=7 )) + +echo $x + +echo $(( +7 )) +echo $(( -7 )) + +echo $(( ++7 )) +echo $(( --7 )) + +${THIS_SH} ./arith1.sub +${THIS_SH} ./arith2.sub +${THIS_SH} ./arith3.sub +${THIS_SH} ./arith4.sub + +# make sure arithmetic expansion handles ints > 2**31 - 1 using intmax_t +echo $(( 2147483645 + 4 )) + +# other tests using INTMAX_MIN and INTMAX_MAX that cause exceptions if not +# handled correctly -- problem through bash-4.2 +${THIS_SH} ./arith5.sub + +# problems with suppressing evaluation present through bash-4.2 +${THIS_SH} ./arith6.sub + +x=4 +y=7 + +(( x=8 , y=12 )) + +echo $x $y + +# should be an error +(( x=9 y=41 )) + +# These are errors +unset b +echo $((a b)) +((a b)) + +n=42 +printf "%d\n" $n +printf "%i\n" $n +echo $(( 8#$(printf "%o\n" $n) )) +printf "%u\n" $n +echo $(( 16#$(printf "%x\n" $n) )) +echo $(( 16#$(printf "%X\n" $n) )) + +# causes longjmp botches through bash-2.05b +a[b[c]d]=e diff --git a/tests/arith1.sub b/tests/arith1.sub new file mode 100644 index 0000000..43cae80 --- /dev/null +++ b/tests/arith1.sub @@ -0,0 +1,38 @@ +# test of redone post-increment and post-decrement code +echo $(( 4-- )) +echo $(( 4++ )) +echo $(( 4 -- )) +echo $(( 4 ++ )) + +(( array[0]++ )) +echo ${array} + +(( array[0] ++ )) +echo ${array} + +(( a++ )) +echo $a +(( a ++ )) +echo $a + +echo $(( a ++ + 4 )) +echo $a + +echo $(( a+++4 )) +echo $a + +echo $(( a---4 )) +echo $a + +echo $(( a -- + 4 )) +echo $a + +echo $(( a -- - 4 )) +echo $a + +(( ++ + 7 )) + +(( ++ )) +echo $(( +++7 )) +echo $(( ++ + 7 )) +(( -- )) diff --git a/tests/arith2.sub b/tests/arith2.sub new file mode 100644 index 0000000..7eac952 --- /dev/null +++ b/tests/arith2.sub @@ -0,0 +1,45 @@ +echo $(( --7 )) +echo $(( ++7 )) +echo $(( -- 7 )) +echo $(( ++ 7 )) + +((++array[0] )) +echo $array +(( ++ array[0] )) +echo $array + +(( ++a )) +echo $a +(( ++ a )) +echo $a + +(( --a )) +echo $a +(( -- a )) +echo $a + +echo $(( 4 + ++a )) +echo $a + +echo $(( 4+++a )) +echo $a + +echo $(( 4---a )) +echo $a + +echo $(( 4 - -- a )) +echo $a + +(( -- )) +echo $(( ---7 )) +echo $(( -- - 7 )) + +(( ++ )) +echo $(( ++7 )) +echo $(( ++ + 7 )) + +echo $(( ++-7 )) +echo $(( ++ - 7 )) + +echo $(( +--7 )) +echo $(( -- + 7 )) diff --git a/tests/arith3.sub b/tests/arith3.sub new file mode 100644 index 0000000..a510c73 --- /dev/null +++ b/tests/arith3.sub @@ -0,0 +1,45 @@ +RANDOM=42 +(( dice[RANDOM%6+1 + RANDOM%6+1]++ )) +echo ${dice[5]} + +(( ++dice[RANDOM%6+1 + RANDOM%6+1] )) +echo ${dice[6]} + +v=4 +DIND=20 + +(( dice[DIND%6 + 1]=v )) +echo ${dice[3]} + +RANDOM=42 + +(( dice[RANDOM%6+1 + RANDOM%6+1]+=v )) +echo ${dice[5]} + +(( dice[RANDOM%6+1 + RANDOM%6+1]-=v )) +echo ${dice[6]} + +(( dice[RANDOM%6+1 + RANDOM%6+1]+=2 )) +echo ${dice[11]} + +(( dice[RANDOM%6+1 + RANDOM%6+1]*=2 )) +echo ${dice[11]} + +unset dice1 dice2 +RANDOM=42 + +for i in {1..5000}; do ((dice1[$RANDOM%6+1 + $RANDOM%6+1]++)); done; +unset t; for i in ${dice1[@]}; do ((t+=i)); done; echo $t + +foo="${dice1[@]}" + +RANDOM=42 + +for i in {1..5000}; do ((dice2[RANDOM%6+1 + RANDOM%6+1]++)); done; +unset t; for i in ${dice2[@]}; do ((t+=i)); done; echo $t + +bar="${dice2[@]}" + +if [ "$foo" != "$bar" ]; then + echo "random sequences differ" +fi diff --git a/tests/arith4.sub b/tests/arith4.sub new file mode 100644 index 0000000..d74defa --- /dev/null +++ b/tests/arith4.sub @@ -0,0 +1,10 @@ +x=$(( !!1 )) +echo $x + +x=$(( -!+1 )) +echo $x + +x=$(( +--+!!0 )) +echo $x + +echo $(( !!+-+-~0 )) diff --git a/tests/arith5.sub b/tests/arith5.sub new file mode 100644 index 0000000..c8fdb5a --- /dev/null +++ b/tests/arith5.sub @@ -0,0 +1,56 @@ +intmax_max=$((2**63 - 1)) +intmax_min1=$((2**63)) +intmax_min2=$((-2**63)) + +case $intmax_max in +9223372036854775807) ;; +*) echo "warning: your machine does not support 64-bit arithmetic using intmax_t" 2>&1 ;; +esac + +# these are actually the same +echo $(( $intmax_min1 % -1 )) +echo $(( $intmax_min2 % -1 )) + +echo $(( $intmax_max % -1 )) + +lvalue=$intmax_min1 +(( lvalue%= -1 )) +echo $lvalue + +lvalue=$intmax_min2 +(( lvalue%= -1 )) +echo $lvalue + +lvalue=$intmax_max +(( lvalue%= -1 )) +echo $lvalue + +# and these +echo $(( $intmax_min1 / -1 )) +echo $(( $intmax_min2 / -1 )) + +lvalue=$intmax_min1 +(( lvalue /= -1 )) +echo $lvalue + +lvalue=$intmax_min2 +(( lvalue /= -1 )) +echo $lvalue + +echo $(( $intmax_min1 * -1 )) +echo $(( $intmax_min2 * -1 )) + +lvalue=$intmax_min1 +(( lvalue *= -1 )) +echo $lvalue + +lvalue=$intmax_min2 +(( lvalue *= -1 )) +echo $lvalue + +echo $(( -${intmax_min1} )) +echo $(( -${intmax_min2} )) + +foo1=$(( $intmax_max - 2 )) + +eval echo \{${foo1}..${intmax_max}\} diff --git a/tests/arith6.sub b/tests/arith6.sub new file mode 100644 index 0000000..630e917 --- /dev/null +++ b/tests/arith6.sub @@ -0,0 +1,52 @@ +function reorder +{ + (( x[1] < x && (x=x[1], x[1]=$x) )) + echo "${x[@]}" +} + +x=(123 456) +reorder +x=(456 123) +reorder + +unset x +unset -f reorder + +function reorder +{ + (( x[1] < x[0] && (x=x[1], x[1]=$x) )) + echo "${x[@]}" +} + +x=(123 456) +reorder +x=(456 123) +reorder + +unset x +unset -f reorder + +function reorder +{ + (( x[1] < x[0] && (x[0]=x[1], x[1]=$x) )) + echo "${x[@]}" +} + +x=(123 456) +reorder +x=(456 123) +reorder + +unset -f reorder + +n=0 ; (( (a[n]=++n)<7&&a[0])); echo "${a[@]:1}" + +n=0 a="(a[n]=++n)<7&&a[0]"; ((a[0])); echo "${a[@]:1}" + +n=0 a="(a[n]=n++)<7&&a"; ((a)); echo "${a[@]:1}" + +# bugs with lvalue caching and pointer aliasing through bash-4.2 +echo $(( a=(y[0] + y[1]) & 0xff, b=(y[2] + y[3]) & 0xff, a << 8 | b)) +echo $a, $b +((a = y[0], b = 1 )) +echo $a, $b diff --git a/tests/array-at-star b/tests/array-at-star new file mode 100755 index 0000000..80f039d --- /dev/null +++ b/tests/array-at-star @@ -0,0 +1,120 @@ +# test the expansion of ${array[@]} and ${array[*]}, both quoted and +# unquoted. the expansions should be exactly analogous to the +# expansions of $@ and $* quoted and unquoted +A=(a b) + +recho "${A[*]}" + +# If IFS is null, the parameters are joined without separators +IFS='' +recho "${A[*]}" + +# If IFS is unset, the parameters are separated by spaces +unset IFS +recho "${A[*]}" + +recho "${A[@]}" +recho ${A[@]} + +IFS='/' +A=(bob 'tom dick harry' joe) +set ${A[*]} +recho $# +recho $1 +recho $2 +recho $3 + +A=(bob 'tom dick harry' joe) +set ${A[*]} +recho $# +recho $1 +recho $2 +recho $3 + +A=(bob 'tom dick harry' joe) +set ${A[@]} +recho $# +recho $1 +recho $2 +recho $3 + +A=(bob 'tom dick harry' joe) +set ${A[@]} +recho $# +recho $1 +recho $2 +recho $3 + +# according to POSIX.2, unquoted $* should expand to multiple words if +# $IFS is null, just like unquoted $@ +IFS='' +A=(bob 'tom dick harry' joe) +set "${A[*]}" +recho $# +recho $1 +recho $2 +recho $3 + +A=(bob 'tom dick harry' joe) +set ${A[*]} +recho $# +recho $1 +recho $2 +recho $3 + +A=(bob 'tom dick harry' joe) +set ${A[@]} +recho $# +recho $1 +recho $2 +recho $3 + +# if IFS is unset, the individual positional parameters are split on +# " \t\n" if $* or $@ are unquoted +unset IFS +A=(bob 'tom dick harry' joe) +set ${A[*]} +recho $# +recho $1 +recho $2 +recho $3 + +A=(bob 'tom dick harry' joe) +set ${A[@]} +recho $# +recho $1 +recho $2 +recho $3 + +# but not for "$@" or "$*" +A=(bob 'tom dick harry' joe) +set "${A[*]}" +recho $# +recho $1 +recho $2 +recho $3 + +A=(bob 'tom dick harry' joe) +set "${A[@]}" +recho $# +recho $1 +recho $2 +recho $3 + +# these should both expand the value of A to multiple words +A=(a b c d e) +IFS="" +recho ${A[@]} +recho "${A[@]}" + +# this example is straight from the POSIX.2 rationale and adapted to arrays +A=(foo bar bam) + +recho "${A[@]}" +recho "${A[*]}" + +unset IFS + +recho "${A[@]}" +recho ${A[@]} +recho "${A[*]}" diff --git a/tests/array.right b/tests/array.right new file mode 100644 index 0000000..0307d6b --- /dev/null +++ b/tests/array.right @@ -0,0 +1,390 @@ + +./array.tests: line 15: syntax error near unexpected token `&' +./array.tests: line 15: `test=(first & second)' +1 +abcde +abcde +abcde bdef +abcde bdef +declare -a BASH_ARGC='()' +declare -a BASH_ARGV='()' +declare -a BASH_LINENO='([0]="0")' +declare -a BASH_SOURCE='([0]="./array.tests")' +declare -a DIRSTACK='()' +declare -a FUNCNAME='([0]="main")' +declare -a a='([0]="abcde" [1]="" [2]="bdef")' +declare -a b='()' +declare -ar c='()' +abcde bdef +abcde bdef +abcde +abcde +abcde + +bdef +hello world +11 +3 +bdef hello world test expression test 2 +./array.tests: line 76: readonly: `a[5]': not a valid identifier +declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression" [15]="test 2")' +declare -ar c='()' +declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression" [15]="test 2")' +declare -ar c='()' +readonly -a a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression" [15]="test 2")' +readonly -a c='()' +a test +declare -a BASH_ARGC='()' +declare -a BASH_ARGV='()' +declare -a BASH_LINENO='([0]="0")' +declare -a BASH_SOURCE='([0]="./array.tests")' +declare -a DIRSTACK='()' +declare -a FUNCNAME='([0]="main")' +declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression" [15]="test 2")' +declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")' +declare -ar c='()' +declare -a d='([1]="" [2]="bdef" [5]="hello world" [6]="test" [9]="ninth element")' +declare -a e='([0]="test")' +declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")' +./array.tests: line 100: a: readonly variable +./array.tests: line 102: b[]: bad array subscript +./array.tests: line 103: b[*]: bad array subscript +./array.tests: line 104: ${b[ ]}: bad substitution +./array.tests: line 106: c[-2]: bad array subscript +./array.tests: line 107: c: bad array subscript + +./array.tests: line 109: d[7]: cannot assign list to array member +./array.tests: line 111: []=abcde: bad array subscript +./array.tests: line 111: [*]=last: cannot assign to non-numeric index +./array.tests: line 111: [-65]=negative: bad array subscript +declare -a BASH_ARGC='()' +declare -a BASH_ARGV='()' +declare -a BASH_LINENO='([0]="0")' +declare -a BASH_SOURCE='([0]="./array.tests")' +declare -a DIRSTACK='()' +declare -a FUNCNAME='([0]="main")' +declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression" [15]="test 2")' +declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")' +declare -ar c='()' +declare -a d='([1]="test test")' +declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")' +./array.tests: line 119: unset: ps1: not an array variable +./array.tests: line 123: declare: c: cannot destroy array variables in this way +this of +this is a test of read using arrays +this test +this is a test of arrays +declare -a BASH_ARGC='()' +declare -a BASH_ARGV='()' +declare -a BASH_LINENO='([0]="0")' +declare -a BASH_SOURCE='([0]="./array.tests")' +declare -a DIRSTACK='()' +declare -a FUNCNAME='([0]="main")' +declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression" [15]="test 2")' +declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")' +declare -ar c='()' +declare -a d='([1]="test test")' +declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")' +declare -a rv='([0]="this" [1]="is" [2]="a" [3]="test" [4]="of" [5]="read" [6]="using" [7]="arrays")' +abde +abde +bbb +efgh +wxyz +wxyz +./array.tests +a +b c +d +e f g +h +./array.tests +a +b c +d +e f g +h +/bin /usr/bin /usr/ucb /usr/local/bin . /sbin /usr/sbin +bin bin ucb bin . sbin sbin +bin +/ / / / / / +/ +argv[1] = +argv[1] = +argv[1] = +argv[1] = +\bin \usr/bin \usr/ucb \usr/local/bin . \sbin \usr/sbin +\bin \usr\bin \usr\ucb \usr\local\bin . \sbin \usr\sbin +\bin \usr\bin \usr\ucb \usr\local\bin . \sbin \usr\sbin +4 -- 4 +7 -- 7 +55 +49 +6 -- 6 +42 14 44 +grep [ 123 ] * +6 7 9 +6 7 9 5 +length = 3 +value = new1 new2 new3 +./array.tests: line 239: narray: unbound variable +./array1.sub: line 1: syntax error near unexpected token `(' +./array1.sub: line 1: `printf "%s\n" -a a=(a 'b c')' +./array2.sub: line 1: declare: `[]=asdf': not a valid identifier +./array2.sub: line 2: a[]: bad array subscript +./array2.sub: line 4: syntax error near unexpected token `(' +./array2.sub: line 4: `declare -a ''=(a 'b c')' +9 +9 + + +7 8 9 +8 11 +8 11 +6 +6 +nordholz +8 +8 +8 + +a b c d e f g +for case if then else +<> < > ! +12 14 16 18 20 +4414758999202 +aaa bbb +./array.tests: line 289: syntax error near unexpected token `<>' +./array.tests: line 289: `metas=( <> < > ! )' +./array.tests: line 290: syntax error near unexpected token `<>' +./array.tests: line 290: `metas=( [1]=<> [2]=< [3]=> [4]=! )' +abc 3 +case 4 +abc case if then else 5 +abc case if then else 5 +0 +case 4 +case if then else 5 +case if then else 5 +argv[1] = <0> +argv[2] = <1> +argv[3] = <4> +argv[4] = <10> +argv[1] = <0> +argv[2] = <1> +argv[3] = <4> +argv[4] = <10> +argv[1] = <0> +argv[2] = <1> +argv[3] = <4> +argv[4] = <10> +argv[1] = <0 1 4 10> +include null element -- expect one +one +include unset element -- expect three five +three five +start at unset element -- expect five seven +five seven +too many elements -- expect three five seven +three five seven +positive offset - expect five seven +five seven +negative offset to unset element - expect seven +seven +positive offset 2 - expect seven +seven +negative offset 2 - expect seven +seven +out-of-range offset + +e +4 +1 4 7 10 +'b +b c +$0 +t +[3]=abcde r s t u v +e +9 +2 +a b c +argv[1] = <-iname 'a> +argv[2] = <-iname 'b> +argv[3] = <-iname 'c> +'hey' +hey +''hey +'hey' +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = <-iname 'abc> +argv[2] = <-iname 'def> +argv[1] = <-iname 'abc> +argv[2] = <-iname 'def> +argv[1] = <-iname> +argv[2] = +argv[1] = <-iname 'abc> +argv[2] = <-iname 'def> +argv[1] = <-iname> +argv[2] = +argv[1] = <-iname 'abc> +argv[2] = <-iname 'def> +argv[1] = <-iname 'abc> +argv[2] = <-iname 'def> +argv[1] = <-iname> +argv[2] = +*.* OK +1 +a1 2 3c +argv[1] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[3] = +2 +argv[1] = +argv[2] = +argv[1] = +argv[2] = +nord!olz + +rdholz + +rdholz +rdho + + +argv[1] = +argv[1] = +argv[2] = <> +argv[3] = +argv[4] = <> +argv[1] = +argv[1] = +argv[2] = <> +argv[3] = +argv[4] = <> +argv[1] = +argv[1] = +argv[2] = <> +argv[3] = +argv[4] = <> +argv[1] = +argv[1] = +argv[2] = <> +argv[3] = +argv[4] = <> +argv[1] = +argv[1] = +argv[2] = <> +argv[3] = +argv[4] = <> +126 +127 +128 +argv[1] = <€> +argv[1] = <~> +argv[2] = <^?> +argv[3] = <€> +argv[1] = <~> +argv[2] = <^?> +argv[3] = <€> +argv[1] = <~> +argv[2] = <^?> +argv[3] = <€> +Monday Tuesday Wednesday Thursday Friday Saturday Sunday +Monday +Monday +Tuesday +Monday +Monday +Tuesday +Monday +Tuesday +Wednesday +Monday +Tuesday +Wednesday +monday, monday, tuesday +wednesday, wednesday, thursday +monday, monday, tuesday +Wednesday, Wednesday, Thursday +nday +esday +dnesday +nday +esday +dnesday +onday +uesday +ednesday +onday +uesday +ednesday +version[agent] +version.agent +version[agent] +version.agent +version[agent] foo[bar] +version.agent bowl +foobar] foo foo[bar] +bleh bbb bleh +ab] +bar +1 +1 +1 +1 +1 +1 +main main +function function +function function +declare -a x='([0]="0" [1]="1" [2]="2" [3]="3" [4]="4" [5]="5")' +declare -a x='([0]="0" [1]="1" [2]="2" [3]="3" [4]="4")' +declare -a x='([0]="0" [1]="1" [2]="2" [4]="4")' +./array14.sub: line 11: [-10]: bad array subscript +declare -a x='([0]="0" [1]="1" [2]="2" [3]="3" [4]="4")' +declare -a x='([0]="0" [1]="1" [2]="2" [3]="3" [4]="4" [5]="five")' +declare -a x='([0]="0" [1]="1" [2]="2" [3]="3" [4]="4" [5]="5")' +declare -a x='([0]="0" [1]="1" [2]="2" [3]="3" [4]="4" [5]="5foo")' +declare -a x='([0]="0" [1]="1" [2]="2" [3]="3" [4]="4" [5]="5")' +declare -a x='([0]="0" [1]="1" [2]="2" [3]="3" [4]="4four" [5]="5")' +strlen(4four) = 5 +1 2 xx 3 +1 2 0 3 +1 2 xx 3 +1 2 0 3 +1 2 xx 3 +foo index 1: ok +foo index 2: ok +foo: implicit reference to element 0: ok +foo: arithmetic evaluation: ok +bar: array with element zero unset: ok +bar: element zero: ok +qux: unset array: ok +qux: unset array element 0: ok diff --git a/tests/array.tests b/tests/array.tests new file mode 100644 index 0000000..4c17651 --- /dev/null +++ b/tests/array.tests @@ -0,0 +1,402 @@ +# this is needed so that the bad assignments (b[]=bcde, for example) do not +# cause fatal shell errors when in posix mode +set +o posix + +set +a +# The calls to egrep -v are to filter out builtin array variables that are +# automatically set and possibly contain values that vary. + +# first make sure we handle the basics +x=() +echo ${x[@]} +unset x + +# this should be an error +test=(first & second) +echo $? +unset test + +# make sure declare -a converts an existing variable to an array +unset a +a=abcde +declare -a a +echo ${a[0]} + +unset a +a=abcde +a[2]=bdef + +unset b +declare -a b[256] + +unset c[2] +unset c[*] + +a[1]= + +_ENV=/bin/true +x=${_ENV[(_$-=0)+(_=1)-_${-%%*i*}]} + +declare -r c[100] + +echo ${a[0]} ${a[4]} +echo ${a[@]} + +echo ${a[*]} + +# this should print out values, too +declare -a | egrep -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)' + +unset a[7] +echo ${a[*]} + +unset a[4] +echo ${a[*]} + +echo ${a} +echo "${a}" +echo $a + +unset a[0] +echo ${a} + +echo ${a[@]} + +a[5]="hello world" +echo ${a[5]} +echo ${#a[5]} + +echo ${#a[@]} + +a[4+5/2]="test expression" +declare a["7 + 8"]="test 2" +a[7 + 8]="test 2" +echo ${a[@]} + +readonly a[5] +readonly a +# these two lines should output `declare' commands +readonly -a | egrep -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)' +declare -ar | egrep -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)' +# this line should output `readonly' commands, even for arrays +set -o posix +readonly -a | egrep -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)' +set +o posix + +declare -a d='([1]="" [2]="bdef" [5]="hello world" "test")' +d[9]="ninth element" + +declare -a e[10]=test # this works in post-bash-2.05 versions +declare -a e[10]='(test)' + +pass=/etc/passwd +declare -a f='("${d[@]}")' +b=([0]=this [1]=is [2]=a [3]=test [4]="$PS1" [5]=$pass) + +echo ${b[@]:2:3} + +declare -pa | egrep -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)' + +a[3]="this is a test" + +b[]=bcde +b[*]=aaa +echo ${b[ ]} + +c[-2]=4 +echo ${c[-4]} + +d[7]=(abdedfegeee) + +d=([]=abcde [1]="test test" [*]=last [-65]=negative ) + +unset d[12] +unset e[*] + +declare -a | egrep -v '(BASH_VERSINFO|PIPESTATUS|GROUPS)' + +ps1='hello' +unset ps1[2] +unset ${ps1[2]} + +declare +a ps1 +declare +a c + +# the prompt should not print when using a here doc +read -p "array test: " -a rv <' [2]='<' [3]='>' [4]='!' ) +echo ${foo[@]} + +# numbers are just words when not in a redirection context +foo=( 12 14 16 18 20 ) +echo ${foo[@]} + +foo=( 4414758999202 ) +echo ${foo[@]} + +# this was a bug in all versions of bash 2.x up to and including bash-2.04 +declare -a ddd=(aaa +bbb) +echo ${ddd[@]} + +# errors until post-bash-2.05a; now reserved words are OK +foo=(a b c for case if then else) + +foo=(for case if then else) + +# errors +metas=( <> < > ! ) +metas=( [1]=<> [2]=< [3]=> [4]=! ) + +# various expansions that didn't really work right until post-bash-2.04 +foo='abc' +echo ${foo[0]} ${#foo[0]} +echo ${foo[1]} ${#foo[1]} +echo ${foo[@]} ${#foo[@]} +echo ${foo[*]} ${#foo[*]} + +foo='' +echo ${foo[0]} ${#foo[0]} +echo ${foo[1]} ${#foo[1]} +echo ${foo[@]} ${#foo[@]} +echo ${foo[*]} ${#foo[*]} + +# new expansions added after bash-2.05b +x[0]=zero +x[1]=one +x[4]=four +x[10]=ten + +recho ${!x[@]} +recho "${!x[@]}" +recho ${!x[*]} +recho "${!x[*]}" + +# sparse array tests for code fixed in bash-3.0 +unset av +av[1]='one' +av[2]='' + +av[3]=three +av[5]=five +av[7]=seven + +echo include null element -- expect one +echo ${av[@]:1:2} # what happens when we include a null element? +echo include unset element -- expect three five +echo ${av[@]:3:2} # what happens when we include an unset element? +echo start at unset element -- expect five seven +echo ${av[@]:4:2} # what happens when we start at an unset element? + +echo too many elements -- expect three five seven +echo ${av[@]:3:5} # how about too many elements? + +echo positive offset - expect five seven +echo ${av[@]:5:2} +echo negative offset to unset element - expect seven +echo ${av[@]: -2:2} + +echo positive offset 2 - expect seven +echo ${av[@]: 6:2} +echo negative offset 2 - expect seven +echo ${av[@]: -1:2} + +echo out-of-range offset +echo ${av[@]:12} + +# parsing problems and other inconsistencies not fixed until post bash-3.0 +unset x +declare -a x=(')' $$) +[ ${x[1]} -eq $$ ] || echo bad + +unset x +declare -a x=(a b c d e) +echo ${x[4]} + +z=([1]=one [4]=four [7]=seven [10]=ten) + +echo ${#z[@]} + +echo ${!z[@]} + +unset x +declare -a x=(a \'b c\') + +echo "${x[1]}" + +unset x +declare -a x=(a 'b c') + +echo "${x[1]}" + +unset x +declare -a x=($0) +[ "${x[@]}" = $0 ] || echo double expansion of \$0 +declare -a x=(\$0) +echo "${x[@]}" + +# tests for bash-3.1 problems +${THIS_SH} ./array5.sub + +# tests for post-bash-3.2 problems, most fixed in bash-3.2 patches +${THIS_SH} ./array6.sub +${THIS_SH} ./array7.sub + +${THIS_SH} ./array8.sub + +${THIS_SH} ./array9.sub + +${THIS_SH} ./array10.sub + +${THIS_SH} ./array11.sub + +${THIS_SH} ./array12.sub + +${THIS_SH} ./array13.sub + +${THIS_SH} ./array14.sub + +${THIS_SH} ./array15.sub + +${THIS_SH} ./array16.sub diff --git a/tests/array1.sub b/tests/array1.sub new file mode 100644 index 0000000..86e9332 --- /dev/null +++ b/tests/array1.sub @@ -0,0 +1 @@ +printf "%s\n" -a a=(a 'b c') diff --git a/tests/array10.sub b/tests/array10.sub new file mode 100644 index 0000000..6d5a94c --- /dev/null +++ b/tests/array10.sub @@ -0,0 +1,52 @@ +days=({Mon,Tues,Wednes,Thurs,Fri,Satur,Sun}day) +echo ${days[@]} + +typeset -i count + +count=0 +echo ${days[${count}]} +echo ${days[$((count++))]} +echo ${days[$((count++))]} + +count=0 +echo ${days[count]} +echo ${days[count++]} +echo ${days[count++]} + +count=0 +echo ${days[$((count++))]/foo/bar} +echo ${days[$((count++))]/foo/bar} +echo ${days[$((count++))]/foo/bar} + +count=0 +echo ${days[count++]/foo/bar} +echo ${days[count++]/foo/bar} +echo ${days[count++]/foo/bar} + +count=0 +echo "${days[${count}],,}, ${days[$((count++))],,}, ${days[$((count++))],,}" +echo "${days[${count}],,}, ${days[$((count++))],,}, ${days[$((count++))],,}" + +count=0 +echo "${days[${count}],,}, ${days[$((count++))],,}, ${days[$((count++))],,}" +echo "${days[${count}]/foo/bar}, ${days[$((count++))]/foo/bar}, ${days[$((count++))]/foo/bar}" + +count=0 +echo ${days[$((count++))]:2} +echo ${days[$((count++))]:2} +echo ${days[$((count++))]:2} + +count=0 +echo ${days[count++]:2} +echo ${days[count++]:2} +echo ${days[count++]:2} + +count=0 +echo ${days[$((count++))]#?} +echo ${days[$((count++))]#?} +echo ${days[$((count++))]#?} + +count=0 +echo ${days[count++]#?} +echo ${days[count++]#?} +echo ${days[count++]#?} diff --git a/tests/array11.sub b/tests/array11.sub new file mode 100644 index 0000000..c4f8cad --- /dev/null +++ b/tests/array11.sub @@ -0,0 +1,35 @@ +# problems with associative array keys with ] and unbalanced [ ] +# fixed after bash-4.2 + +declare -A foo + +foo=(["version[agent]"]=version.agent) + +echo ${!foo[@]} +echo ${foo[@]} + +unset foo +declare -A foo +foo["version[agent]"]=version.agent + +echo ${!foo[@]} +echo ${foo[@]} + +declare foo["foo[bar]"]=bowl + +echo ${!foo[@]} +echo ${foo[@]} + +declare -A array2["foo[bar]"]=bleh + +array2["foobar]"]=bleh +array2["foo"]=bbb + +echo ${!array2[@]} +echo ${array2[@]} + +declare -A foo +foo=( ['ab]']=bar ) + +echo ${!foo[@]} +echo ${foo[@]} diff --git a/tests/array12.sub b/tests/array12.sub new file mode 100644 index 0000000..6571138 --- /dev/null +++ b/tests/array12.sub @@ -0,0 +1,21 @@ +# problems with fix for posix interp 217 introduced in bash-4.2 + +declare -ax array +array[$(( $( echo -n 1001 ) - 1001 ))]=1 + +echo ${array[0]} +echo ${array[@]} + +unset 'array[0]' +array[$( echo -n 1001 ) - 1001 ]=1 +echo ${array[0]} + +unset 'array[0]' +array[$(( 1001 - $( echo -n 1001 ) ))]=1 +echo ${array[0]} +array[$(( 1001 - $( echo -n 1001 ) ))]=1 +echo ${array[0]} + +unset 'array[0]' +array[1001 - $( echo -n 1001 )]=1 +echo ${array[0]} diff --git a/tests/array13.sub b/tests/array13.sub new file mode 100644 index 0000000..736f210 --- /dev/null +++ b/tests/array13.sub @@ -0,0 +1,13 @@ +#!/bin/bash + +func1(){ +declare -g variable='function' +declare -g -a array=(function) +echo ${variable} ${array[@]} +} + +declare -g variable='main' +declare -g -a array=(main) +echo ${variable} ${array[@]} +func1 +echo ${variable} ${array[@]} diff --git a/tests/array14.sub b/tests/array14.sub new file mode 100644 index 0000000..7715169 --- /dev/null +++ b/tests/array14.sub @@ -0,0 +1,30 @@ +# start at a test suite for negative indexed array subscripts -- post bash-4.2 +x=( 0 1 2 3 4 5) +declare -p x + +unset 'x[-1]' +declare -p x + +unset 'x[-2]' +declare -p x + +unset 'x[-10]' + +x[-2]=3 +declare -p x + +x+=( five ) +declare -p x +x[-1]=5 +declare -p x + +x+=( [-1]=foo ) +declare -p x + +x[-1]=5 +declare -p x + +x[-2]+=four +declare -p x + +echo "strlen(${x[-2]})" = ${#x[-2]} diff --git a/tests/array15.sub b/tests/array15.sub new file mode 100644 index 0000000..b056ccb --- /dev/null +++ b/tests/array15.sub @@ -0,0 +1,24 @@ +# fixes for make_internal_declare not handling integer attribute for arrays +declare -ai -g foo=(1 2 xx 3) +echo "${foo[@]}" + +unset foo +declare -ai -g foo='(1 2 xx 3)' +echo "${foo[@]}" + +unset foo +declare -ia -g foo=(1 2 xx 3) +echo "${foo[@]}" + +unset foo +declare -ia -g foo='(1 2 xx 3)' +echo "${foo[@]}" + +unset foo +func() +{ + declare -ai -g foo=(1 2 xx 3) +} + +func +echo "${foo[@]}" diff --git a/tests/array16.sub b/tests/array16.sub new file mode 100644 index 0000000..10024bc --- /dev/null +++ b/tests/array16.sub @@ -0,0 +1,21 @@ +foo[0]=a +foo[1]=b + +[[ -v foo[1] ]] && echo foo index 1: ok +[[ -v foo[2] ]] || echo foo index 2: ok + +[[ -v foo ]] && echo foo: implicit reference to element 0: ok + +typeset -i foo + +[[ -v foo[1] ]] && echo foo: arithmetic evaluation: ok + +typeset -a bar +bar[1]=set + +[[ -v bar ]] || echo bar: array with element zero unset: ok +[[ -v bar[0] ]] || echo bar: element zero: ok + +typeset -a qux +[[ -v qux ]] || echo qux: unset array: ok +[[ -v qux[0] ]] || echo qux: unset array element 0: ok diff --git a/tests/array2.right b/tests/array2.right new file mode 100644 index 0000000..b5145c2 --- /dev/null +++ b/tests/array2.right @@ -0,0 +1,74 @@ +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = <3> +argv[1] = +argv[1] = +argv[1] = +argv[1] = <3> +argv[1] = +argv[1] = +argv[1] = +argv[1] = <3> +argv[1] = +argv[1] = +argv[1] = +argv[1] = <3> +argv[1] = +argv[1] = +argv[1] = +argv[1] = <1> +argv[1] = +argv[1] = <3> +argv[1] = +argv[1] = +argv[1] = +argv[1] = <3> +argv[1] = +argv[1] = +argv[1] = +argv[1] = <5> +argv[1] = +argv[1] = +argv[1] = +argv[1] = <5> +argv[1] = +argv[1] = +argv[1] = +argv[1] = <1> +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[1] = <3> +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = diff --git a/tests/array2.sub b/tests/array2.sub new file mode 100644 index 0000000..44bb7c5 --- /dev/null +++ b/tests/array2.sub @@ -0,0 +1,4 @@ +declare -r []=asdf +declare -r a[]=asdf + +declare -a ''=(a 'b c') diff --git a/tests/array3.sub b/tests/array3.sub new file mode 100644 index 0000000..579b42b --- /dev/null +++ b/tests/array3.sub @@ -0,0 +1,9 @@ +a=(0 1 2 3 4 5 6 7 8 9) + +echo ${a[@]: -1} + +echo ${a[@]:9} +echo ${a[@]:10} +echo ${a[@]:11} + +echo ${a[@]:7:3} diff --git a/tests/array4.sub b/tests/array4.sub new file mode 100644 index 0000000..97c766d --- /dev/null +++ b/tests/array4.sub @@ -0,0 +1,32 @@ +# compound assignment parsing problems in bash-3.1-release +func() +{ + local -a x=() y=() +} + +a=() b=() +eval foo=() +eval foo=() bar=() qux=( "bash" ) + +foo=( "bash" ) +eval foo=( "bash" ) +eval bar=( "bash" ) bax=( "bash" ) + +let a=(5 + 3) b=(4 + 7) +echo $a $b + +typeset -i a b +a=(5+3) b=(4+7) +echo $a $b + +let a=(4*3)/2 +echo $a +a=(4*3)/2 +echo $a + +LNAME=nordholz +echo ${LNAME} +echo ${#LNAME} + +echo ${#LNAME[$(( 0 ))]} +echo ${#LNAME[$(( 0+0 ))]} diff --git a/tests/array5.sub b/tests/array5.sub new file mode 100644 index 0000000..778a28d --- /dev/null +++ b/tests/array5.sub @@ -0,0 +1,34 @@ + +: ${TMPDIR:=/tmp} + +mkdir $TMPDIR/bash-test-$$ +cd $TMPDIR/bash-test-$$ + +trap "cd / ; rm -rf $TMPDIR/bash-test-$$" 0 1 2 3 6 15 + +touch '[3]=abcde' + +touch r s t u v + +declare -a x=(*) + +echo ${x[3]} +echo ${x[@]} + +unset x +x=(a b c d e) + +echo ${x[*]: -1} + +unset x[4] +unset x[2] + +x[9]='9' + +echo ${x[*]: -1} + +TOOLKIT=(1 2 3 4 5 6 7 8 9 10) +ARRAY="1" +echo ${TOOLKIT["$ARRAY"]} + +exit 0 diff --git a/tests/array6.sub b/tests/array6.sub new file mode 100644 index 0000000..0017f4c --- /dev/null +++ b/tests/array6.sub @@ -0,0 +1,115 @@ +# test cases for array quoting and escaping fixed post bash-3.2-release + +oIFS="$IFS" + +a=(a b c) +echo ${a[@]} + +a2=("${a[@]/#/"-iname '"}") +recho "${a2[@]}" + +echo "${dbg-"'hey'"}" +echo "${dbg-"hey"}" +echo "${dbg-'"'hey}" +echo "${dbg-'"hey'}" + +unset a a2 + +IFS= +a2=(${a[@]/#/"-iname '"}) +recho "${a2[@]}" + +IFS="$oIFS" +unset a a2 + +a=('a b' 'c d' 'e f') + +recho ${a[@]:1:2} +recho "${a[@]:1:2}" + +IFS= +recho ${a[@]:1:2} +recho "${a[@]:1:2}" + +IFS="$oIFS" +unset a a2 + +a=(abc def) + +# Prevent word splitting +#IFS= + +a2=("${a[@]/#/"-iname '"}") +recho "${a2[@]}" + +eval a2=("${a[@]/#/\"-iname \'\"}") +recho "${a2[@]}" + +eval a2=("${a[@]/#/"-iname '"}") +recho "${a2[@]}" + +a2=("${a[@]/#/-iname \'}") +recho "${a2[@]}" + +eval a2=("${a[@]/#/-iname \'}") +recho "${a2[@]}" + +set -- abc def + +a2=("${@/#/"-iname '"}") +recho "${a2[@]}" + +eval a2=("${@/#/\"-iname \'\"}") +recho "${a2[@]}" + +eval a2=("${@/#/"-iname '"}") +recho "${a2[@]}" + +unset a a2 + +IFS= +pat=('*.*') +case $(ls ${pat[@]} 2>/dev/null) in +'') echo '*.* BAD' ;; +*) echo '*.* OK' ;; +esac + +IFS="$oIFS" +unset a a2 pat + +IFS= + +s='abc' + +set - ${s/b/1 2 3} +echo $# +echo "$1" + +IFS="$oIFS" +unset s + +set -- ab cd ef +foo="var with spaces" + +IFS= +recho $foo +recho "$foo" + +recho ${foo}"$@" +recho ${foo}$@ + +array=(ab cd ef) +recho ${foo}"${array[@]}" +recho ${foo}${array[@]} + +recho $(echo $foo)"$@" +recho $(echo $foo)$@ + +a=('word1 with spaces' 'word2 with spaces') +set - ${a[@]/word/element} +echo $# +recho "$@" +recho $@ + +IFS="$oIFS" +unset a a2 array foo diff --git a/tests/array7.sub b/tests/array7.sub new file mode 100644 index 0000000..8935cc2 --- /dev/null +++ b/tests/array7.sub @@ -0,0 +1,14 @@ +# these didn't work in versions of bash before bash-4.0 + +LNAME=nordholz + +echo ${LNAME[$(( 0 ))]//h/!} +echo ${LNAME[$(( 2 ))]//h/!} + +echo ${LNAME[$(( 0 ))]##??} +echo ${LNAME[$(( 2 ))]##??} + +echo ${LNAME[$(( 0 ))]:2} +echo ${LNAME[$(( 0 ))]:2:4} +echo ${LNAME[$(( 2 ))]:2} +echo ${LNAME[$(( 2 ))]:2:4} diff --git a/tests/array8.sub b/tests/array8.sub new file mode 100644 index 0000000..481ccdb --- /dev/null +++ b/tests/array8.sub @@ -0,0 +1,23 @@ +IFS=/ +declare -a i + +i[0]=fooq +i[1]= +i[2]=barq +i[3]= +recho "${i[*]:0}" +recho "${i[@]:0}" + +recho "${i[*]/q/!}" +recho "${i[@]/q/!}" + +recho "${i[*]#?}" +recho "${i[@]#?}" + +# Need to complete this with case-modifying expansion examples +recho "${i[*]^?}" +recho "${i[@]^?}" + +recho "${i[*]^^?}" +recho "${i[@]^^?}" + diff --git a/tests/array9.sub b/tests/array9.sub new file mode 100644 index 0000000..444247f --- /dev/null +++ b/tests/array9.sub @@ -0,0 +1,27 @@ +echo $(( 0x7e )) +echo $(( 0x7f )) +echo $(( 0x80 )) + +a=$'\x80' +recho "$a" + +a=( $'\x7e' $'\x7f' $'\x80' ) + +recho "${a[@]}" + +unset a +a[0]=$'\x7e' +a[1]=$'\x7f' +a[2]=$'\x80' + +recho "${a[@]}" + +b1=$'\x7e' +b2=$'\x7f' +b3=$'\x80' + +unset a +a=( "$b1" "$b2" "$b3" ) + +recho "${a[@]}" + diff --git a/tests/assoc.right b/tests/assoc.right new file mode 100644 index 0000000..b9fd001 --- /dev/null +++ b/tests/assoc.right @@ -0,0 +1,192 @@ +declare -A BASH_ALIASES='()' +declare -A BASH_CMDS='()' +declare -A fluff='()' +declare -A BASH_ALIASES='()' +declare -A BASH_CMDS='()' +declare -A fluff='([bar]="two" [foo]="one" )' +declare -A fluff='([bar]="two" [foo]="one" )' +declare -A fluff='([bar]="two" )' +declare -A fluff='([bar]="newval" [qux]="assigned" )' +./assoc.tests: line 26: chaff: four: must use subscript when assigning associative array +declare -A BASH_ALIASES='()' +declare -A BASH_CMDS='()' +declare -Ai chaff='([one]="10" [zero]="5" )' +declare -Ar waste='([version]="4.0-devel" [source]="./assoc.tests" [lineno]="28" [pid]="42134" )' +declare -A wheat='([one]="a" [zero]="0" [two]="b" [three]="c" )' +declare -A chaff='([one]="10" ["hello world"]="flip" [zero]="5" )' +./assoc.tests: line 38: unset: waste: cannot unset: readonly variable +./assoc.tests: line 39: chaff[*]: bad array subscript +./assoc.tests: line 40: [*]=12: invalid associative array key +declare -A chaff='([one]="a" ["hello world"]="flip" )' +flip +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[1] = +./assoc.tests: line 57: declare: chaff: cannot destroy array variables in this way +./assoc.tests: line 59: chaff[*]: bad array subscript +./assoc.tests: line 60: [*]=12: invalid associative array key +declare -A wheat='([six]="6" ["foo bar"]="qux qix" )' +argv[1] = +argv[2] = +argv[1] = +declare -A wheat='([six]="6" ["foo bar"]="qux qix" )' +argv[1] = <2> +argv[1] = <7> +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[1] = <16> +argv[1] = <16> +argv[1] = +argv[2] = <6> +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +8 +/usr/local/bin . /bin /sbin /usr/sbin /usr/bin /bin /usr/ucb +bin . bin sbin sbin bin bin ucb +bin +/ / / / / / / +/ +argv[1] = +argv[1] = +argv[1] = +argv[1] = +8 +/usr/local/bin . /bin /sbin /usr/sbin /usr/bin /bin /usr/ucb +bin . bin sbin sbin bin bin ucb +/ / / / / / / +8 +4 -- /bin +^usr^local^bin . ^bin ^sbin ^usr^sbin ^usr^bin ^bin ^usr^ucb +^usr^local^bin . ^bin ^sbin ^usr^sbin ^usr^bin ^bin ^usr^ucb +\usr/local/bin . \bin \sbin \usr/sbin \usr/bin \bin \usr/ucb +\usr\local\bin . \bin \sbin \usr\sbin \usr\bin \bin \usr\ucb +\usr\local\bin . \bin \sbin \usr\sbin \usr\bin \bin \usr\ucb +([a]=1) + +qux foo +/usr/local/bin/qux /usr/sbin/foo +hits command + 0 /sbin/blat + 0 /usr/local/bin/qux + 0 /bin/sh + 0 /usr/sbin/foo +blat qux sh foo +/sbin/blat /usr/local/bin/qux /bin/sh /usr/sbin/foo + +foo qux +argv[1] = +argv[2] = +argv[3] = <-l> +alias blat='cd /blat ; echo $PWD' +alias foo='/usr/sbin/foo' +alias qux='/usr/local/bin/qux -l' +alias sh='/bin/bash --login -o posix' +sh foo blat qux +argv[1] = +argv[2] = +argv[3] = +argv[4] = +outside: outside +declare -A BASH_ALIASES='()' +declare -A BASH_CMDS='()' +declare -A afoo='([six]="six" ["foo bar"]="foo quux" )' +argv[1] = +argv[2] = +argv[3] = +outside 2: outside +argv[1] = +argv[1] = +argv[2] = <> +argv[3] = +argv[4] = <> +argv[1] = +argv[1] = +argv[2] = <> +argv[3] = +argv[4] = <> +argv[1] = +argv[1] = +argv[2] = <> +argv[3] = +argv[4] = <> +argv[1] = +argv[1] = +argv[2] = <> +argv[3] = +argv[4] = <> +argv[1] = +argv[1] = +argv[2] = <> +argv[3] = +argv[4] = <> +abc +def +def +./assoc5.sub: line 13: declare: `myarray[foo[bar]=bleh': not a valid identifier +abc def bleh +myarray=(["a]a"]="abc" ["]"]="def" ["a]=test1;#a"]="123" [foo]="bleh" ) + +123 +myarray=(["a]a"]="abc" ["a]=test2;#a"]="def" ["]"]="def" ["a]=test1;#a"]="123" [foo]="bleh" ) +bar"bie +doll +declare -A foo='(["bar\"bie"]="doll" )' +bar"bie +doll +declare -A foo='(["bar\"bie"]="doll" )' +bar"bie +doll +declare -A foo='(["bar\"bie"]="doll" )' +bar"bie +doll +declare -A foo='(["bar\"bie"]="doll" )' +bar"bie +doll +declare -A foo='(["bar\"bie"]="doll" )' +bar'bie +doll +declare -A foo='(["bar'\''bie"]="doll" )' +bar'bie +doll +declare -A foo='(["bar'\''bie"]="doll" )' +bar'bie +doll +declare -A foo='(["bar'\''bie"]="doll" )' +bar'bie +doll +declare -A foo='(["bar'\''bie"]="doll" )' +bar'bie +doll +declare -A foo='(["bar'\''bie"]="doll" )' +bar$bie +doll +declare -A foo='(["bar\$bie"]="doll" )' +bar[bie +doll +declare -A foo='(["bar[bie"]="doll" )' +bar`bie +doll +declare -A foo='(["bar\`bie"]="doll" )' +bar\]bie +doll +declare -A foo='(["bar\\]bie"]="doll" )' +bar${foo}bie +doll +declare -A foo='(["bar\${foo}bie"]="doll" )' +bar +after printf +after use: 0 diff --git a/tests/assoc.tests b/tests/assoc.tests new file mode 100644 index 0000000..c3fb18e --- /dev/null +++ b/tests/assoc.tests @@ -0,0 +1,188 @@ +# TEST - basic declaration and assignment +typeset -A fluff +declare -A + +fluff[foo]=one +fluff[bar]=two + +declare -A +declare -p fluff + +unset fluff[foo] +declare -p fluff + +fluff[bar]=newval +declare fluff[qux]=assigned + +declare -p fluff + +unset fluff + +# TEST - compount assignment and variable attributes +declare -A wheat chaff +wheat=( [zero]=0 [one]=a [two]=b [three]=c ) + +declare -i chaff +chaff=( [zero]=1+4 [one]=3+7 four ) + +declare -A waste=( [pid]=42134 [version]=4.0-devel [source]=$0 [lineno]=$LINENO ) +declare -r waste + +declare -A + +declare +i chaff +chaff[hello world]=flip +declare -p chaff + +# TEST - errors +unset waste +chaff[*]=12 +chaff=( [one]=a [*]=12 ) + +# TEST - key expansion -- no word splitting +chaff[hello world]=flip +declare -p chaff +echo ${chaff[hello world]} + +chaff[box]="multiple words" + +recho ${chaff[@]} +recho "${chaff[@]}" + +recho ${chaff[*]} +recho "${chaff[*]}" + +unset chaff +declare -A chaff[200] +declare +A chaff + +chaff[*]=12 +chaff=( [one]=a [*]=12 ) + +# TEST - keys and values containing spaces +unset wheat +declare -A wheat +wheat=([six]=6 [foo bar]="qux qix" ) + +declare -p wheat + +unset wheat +declare -A wheat=([six]=6 [foo bar]="qux qix" ) + +recho ${wheat[foo bar]} +recho "${wheat[foo bar]}" + +declare -p wheat + +# TEST - basic expansions: number of elements and value length +unset wheat +typeset -A wheat +wheat=([six]=6 [foo bar]="qux qix" ) + +recho ${#wheat[@]} + +recho ${#wheat[foo bar]} + +# TEST - appending assignment operator +unset wheat +typeset -A wheat +wheat=([six]=6 [foo bar]="qux qix" ) + +wheat[foo bar]+=' blat' + +recho ${wheat[foo bar]} +recho "${wheat[foo bar]}" +unset wheat + +flix=9 +typeset -Ai wheat +wheat=([six]=6 [foo bar]=flix ) + +wheat[foo bar]+=7 + +recho ${wheat[foo bar]} +recho "${wheat[foo bar]}" +unset flix wheat + +# TEST - index expansion: no word splitting or globbing +typeset -A wheat +cd /tmp +touch '[sfiri]' +wheat=([s*]=6 [foo bar]=flix ) + +recho ${wheat[@]} +rm '[sfiri]' +cd $OLDPWD + +# TEST -- associative array keys expansion +unset wheat +typeset -A wheat + +wheat=([six]=6 [foo bar]=flix ) + +recho ${!wheat[@]} +recho "${!wheat[@]}" + +# TEST -- associative array pattern removal +unset xpath +typeset -A xpath + +xpath=( [0]=/bin [one]=/bin [two]=/usr/bin [three]=/usr/ucb [four]=/usr/local/bin) +xpath+=( [five]=/sbin [six]=/usr/sbin [seven]=. ) + +echo ${#xpath[@]} + +echo ${xpath[@]} +echo ${xpath[@]##*/} +echo ${xpath[0]##*/} +echo ${xpath[@]%%[!/]*} +echo ${xpath[0]%%[!/]*} +recho ${xpath##*/} +recho ${xpath%%[!/]*} +recho ${xpath[five]##*/} +recho ${xpath[five]%%[!/]*} + +echo ${#xpath[*]} + +echo ${xpath[*]} +echo ${xpath[*]##*/} +echo ${xpath[*]%%[!/]*} + +# TEST -- associative array pattern substitution +unset xpath +typeset -A xpath + +xpath=( [0]=/bin [one]=/bin [two]=/usr/bin [three]=/usr/ucb [four]=/usr/local/bin) +xpath+=( [five]=/sbin [six]=/usr/sbin [seven]=. ) + +echo ${#xpath[@]} +# default element is "0" (as a string) +echo ${#xpath} -- ${xpath["0"]} + +echo ${xpath[@]//\//^} +echo "${xpath[@]//\//^}" | cat -v + +zecho "${xpath[@]/\//\\}" +zecho "${xpath[@]//\//\\}" +zecho "${xpath[@]//[\/]/\\}" + +# test assignment to key "0" +unset T +declare -A T +T='([a]=1)' +echo "${T[@]}" +unset T + +${THIS_SH} ./assoc1.sub + +${THIS_SH} ./assoc2.sub + +${THIS_SH} ./assoc3.sub + +${THIS_SH} ./assoc4.sub + +${THIS_SH} ./assoc5.sub + +${THIS_SH} ./assoc6.sub + +${THIS_SH} ./assoc7.sub diff --git a/tests/assoc1.sub b/tests/assoc1.sub new file mode 100644 index 0000000..a045bde --- /dev/null +++ b/tests/assoc1.sub @@ -0,0 +1,16 @@ +hash -r +echo ${BASH_CMDS[@]} + +hash -p /usr/sbin/foo foo +hash -p /usr/local/bin/qux qux + +echo ${!BASH_CMDS[@]} +echo ${BASH_CMDS[@]} + +BASH_CMDS[blat]=/sbin/blat +BASH_CMDS[sh]=/bin/sh + +hash + +echo ${!BASH_CMDS[@]} +echo "${BASH_CMDS[@]}" diff --git a/tests/assoc2.sub b/tests/assoc2.sub new file mode 100644 index 0000000..396b87a --- /dev/null +++ b/tests/assoc2.sub @@ -0,0 +1,15 @@ +echo ${BASH_ALIASES[@]} + +alias foo=/usr/sbin/foo +alias qux='/usr/local/bin/qux -l' + +echo ${!BASH_ALIASES[@]} +recho ${BASH_ALIASES[@]} + +BASH_ALIASES[blat]='cd /blat ; echo $PWD' +BASH_ALIASES[sh]='/bin/bash --login -o posix' + +alias -p + +echo ${!BASH_ALIASES[@]} +recho "${BASH_ALIASES[@]}" diff --git a/tests/assoc3.sub b/tests/assoc3.sub new file mode 100644 index 0000000..9129ef1 --- /dev/null +++ b/tests/assoc3.sub @@ -0,0 +1,15 @@ +foo() +{ + declare -A afoo=([six]="six" [foo bar]="foo quux") + + declare -A + recho inside: "${afoo[@]}" +} + +declare -A afoo=([main]=outside) +echo outside: "${afoo[@]}" + +foo + +echo outside 2: "${afoo[@]}" + diff --git a/tests/assoc4.sub b/tests/assoc4.sub new file mode 100644 index 0000000..1516dc5 --- /dev/null +++ b/tests/assoc4.sub @@ -0,0 +1,22 @@ +IFS=/ +declare -A i + +i[0]=fooq +i[1]= +i[2]=barq +i[3]= + +recho "${i[*]:0}" +recho "${i[@]:0}" + +recho "${i[*]/q/!}" +recho "${i[@]/q/!}" + +recho "${i[*]#?}" +recho "${i[@]#?}" + +# Need to complete this with case-modifying expansion examples +recho "${i[*]^?}" +recho "${i[@]^?}" +recho "${i[*]^^?}" +recho "${i[@]^^?}" diff --git a/tests/assoc5.sub b/tests/assoc5.sub new file mode 100644 index 0000000..400f3d3 --- /dev/null +++ b/tests/assoc5.sub @@ -0,0 +1,27 @@ +declare -A myarray + +# this needs fixes to skipsubscript +myarray["a]a"]="abc" + +echo ${myarray["a]a"]} + +myarray[$(echo ])]=def + +echo ${myarray[']']} +echo ${myarray[\]]} + +declare myarray["foo[bar"]=bleh +myarray["foo"]=bleh + +echo "${myarray[@]}" + +bar='a]=test1;#a' +myarray[$bar]=123 + +set | grep ^myarray= +echo ${myarray[a]} + +echo "${myarray['a]=test1;#a']}" +myarray['a]=test2;#a']="def" + +set | grep ^myarray= diff --git a/tests/assoc6.sub b/tests/assoc6.sub new file mode 100644 index 0000000..54112ee --- /dev/null +++ b/tests/assoc6.sub @@ -0,0 +1,146 @@ +declare -A foo + +foo=([bar\"bie]=doll) + +echo ${!foo[@]} +echo ${foo[@]} + +declare -p foo + +unset foo +declare -A foo=(["bar\"bie"]="doll") + +echo ${!foo[@]} +echo ${foo[@]} + +declare -p foo + +unset foo +declare -A foo + +foo=(["bar\"bie"]="doll") + +echo ${!foo[@]} +echo ${foo[@]} + +declare -p foo + +unset foo +declare -A foo + +foo["bar\"bie"]="doll" + +echo ${!foo[@]} +echo ${foo[@]} + +declare -p foo + +unset foo +declare -A foo + +foo[bar\"bie]="doll" + +echo ${!foo[@]} +echo ${foo[@]} + +declare -p foo + +unset foo +declare -A foo + +foo=([bar\'bie]=doll) + +echo ${!foo[@]} +echo ${foo[@]} + +declare -p foo + +unset foo +declare -A foo=(["bar'bie"]="doll") + +echo ${!foo[@]} +echo ${foo[@]} + +declare -p foo + +unset foo +declare -A foo + +foo=(["bar'bie"]="doll") + +echo ${!foo[@]} +echo ${foo[@]} + +declare -p foo + +unset foo +declare -A foo + +foo["bar'bie"]="doll" + +echo ${!foo[@]} +echo ${foo[@]} + +declare -p foo + +unset foo +declare -A foo + +foo[bar\'bie]="doll" + +echo ${!foo[@]} +echo ${foo[@]} + +declare -p foo + +unset foo +declare -A foo + +foo=([bar\$bie]=doll) + +echo ${!foo[@]} +echo ${foo[@]} + +declare -p foo + +unset foo +declare -A foo=(["bar[bie"]="doll") + +echo ${!foo[@]} +echo ${foo[@]} + +declare -p foo + +unset foo +declare -A foo + +foo=(["bar\`bie"]="doll") + +echo ${!foo[@]} +echo ${foo[@]} + +declare -p foo + +unset foo +declare -A foo + +# this doesn't work right without the backslash +foo["bar\]bie"]="doll" + +echo ${!foo[@]} +echo ${foo[@]} + +declare -p foo + +unset foo +declare -A foo + +foo[bar\${foo}bie]="doll" + +echo ${!foo[@]} +echo ${foo[@]} + +declare -p foo + +unset foo +declare -A foo diff --git a/tests/assoc7.sub b/tests/assoc7.sub new file mode 100644 index 0000000..5bc5150 --- /dev/null +++ b/tests/assoc7.sub @@ -0,0 +1,16 @@ +# problem with bash versions through bash-4.2 +foo() +{ + declare -A hash + declare hash[baz]=bar #bash crashes here + + echo ${hash[@]} +} + +foo + +declare -a ary +printf -v ary[0] "%b" "" +echo "after printf" +x="${ary[*]}" # segfaults here +echo "after use: $?" diff --git a/tests/braces.right b/tests/braces.right new file mode 100644 index 0000000..4017546 --- /dev/null +++ b/tests/braces.right @@ -0,0 +1,77 @@ +ffc ffb ffa +fdg feg ffg +lxyz nxyz mxyz +{abc,def} +{abc} +{a,b,c,d,e} +x} y} {a} b} c} +x,y {abc} trie +/usr/ucb/ex /usr/ucb/edit /usr/lib/ex /usr/lib/how_ex +XXXX{a,b,c} +XXXXa XXXXb XXXXc +{} +{ } +} +{ +abcd{efgh +foo 1 2 bar +foo 1 2 bar +foo 1 2 bar +foobar foobaz. +foobar foobaz +bazx bazy +vx vy +bazx bazy +1 2 3 4 5 6 7 8 9 10 +0..10 braces +0 1 2 3 4 5 6 7 8 9 10 braces +x0y x1y x2y x3y x4y x5y x6y x7y x8y x9y x10y xbracesy +3 +x3y +10 9 8 7 6 5 4 3 2 1 +10y 9y 8y 7y 6y 5y 4y 3y 2y 1y +x10y x9y x8y x7y x6y x5y x4y x3y x2y x1y +a b c d e f +f e d c b a +a ` _ ^ ] [ Z Y X W V U T S R Q P O N M L K J I H G F E D C B A +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 [ ] ^ _ ` a +f +{1..f} +{f..1} +01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 +-1 -2 -3 -4 -5 -6 -7 -8 -9 -10 +-20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 +a-{bd}-c a-{be}-c +a-{bdef-g-c a-{bdef-i-c +{klklkl}1 {klklkl}2 {klklkl}3 +{x,x} +1 3 5 7 9 +-1 -3 -5 -7 -9 +-1 -3 -5 -7 -9 +10 8 6 4 2 +10 8 6 4 2 +1 3 5 7 9 11 13 15 17 19 +1 +100 95 90 85 80 75 70 65 60 55 50 45 40 35 30 25 20 15 10 5 0 +100 95 90 85 80 75 70 65 60 55 50 45 40 35 30 25 20 15 10 5 0 +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 +a c e g i k m o q s u w y +z x v t r p n l j h f d b +2147483645 2147483646 2147483647 2147483648 2147483649 +10 8 6 4 2 0 +10 8 6 4 2 0 +-50 -45 -40 -35 -30 -25 -20 -15 -10 -5 0 +{1..10.f} +{1..ff} +{1..10..ff} +{1.20..2} +{1..20..f2} +{1..20..2f} +{1..2f..2} +{1..ff..2} +{1..ff} +{1..f} +{1..0f} +{1..10f} +{1..10.f} +{1..10.f} diff --git a/tests/braces.tests b/tests/braces.tests new file mode 100644 index 0000000..a80cf45 --- /dev/null +++ b/tests/braces.tests @@ -0,0 +1,119 @@ +echo ff{c,b,a} +echo f{d,e,f}g +echo {l,n,m}xyz +echo {abc\,def} +echo {abc} + +echo \{a,b,c,d,e} +echo {x,y,\{a,b,c}} +echo {x\,y,\{abc\},trie} + +echo /usr/{ucb/{ex,edit},lib/{ex,how_ex}} + +echo XXXX\{`echo a b c | tr ' ' ','`\} +eval echo XXXX\{`echo a b c | tr ' ' ','`\} + +echo {} +echo { } +echo } +echo { +echo abcd{efgh + +echo foo {1,2} bar +echo `zecho foo {1,2} bar` +echo $(zecho foo {1,2} bar) + +var=baz +varx=vx +vary=vy + +echo foo{bar,${var}.} +echo foo{bar,${var}} + +echo "${var}"{x,y} +echo $var{x,y} +echo ${var}{x,y} + +unset var varx vary + +# new sequence brace operators +echo {1..10} + +# this doesn't work yet +echo {0..10,braces} +# but this does +echo {{0..10},braces} +echo x{{0..10},braces}y + +echo {3..3} +echo x{3..3}y +echo {10..1} +echo {10..1}y +echo x{10..1}y + +echo {a..f} +echo {f..a} + +echo {a..A} +echo {A..a} + +echo {f..f} + +# mixes are incorrectly-formed brace expansions +echo {1..f} +echo {f..1} + +echo 0{1..9} {10..20} + +# do negative numbers work? +echo {-1..-10} +echo {-20..0} + +# weirdly-formed brace expansions -- fixed in post-bash-3.1 +echo a-{b{d,e}}-c + +echo a-{bdef-{g,i}-c + +echo {"klklkl"}{1,2,3} +echo {"x,x"} + +echo {1..10..2} +echo {-1..-10..2} +echo {-1..-10..-2} + +echo {10..1..-2} +echo {10..1..2} + +echo {1..20..2} +echo {1..20..20} + +echo {100..0..5} +echo {100..0..-5} + +echo {a..z} +echo {a..z..2} +echo {z..a..-2} + +# make sure brace expansion handles ints > 2**31 - 1 using intmax_t +echo {2147483645..2147483649} + +# unwanted zero-padding -- fixed post-bash-4.0 +echo {10..0..2} +echo {10..0..-2} +echo {-50..-0..5} + +# bad +echo {1..10.f} +echo {1..ff} +echo {1..10..ff} +echo {1.20..2} +echo {1..20..f2} +echo {1..20..2f} +echo {1..2f..2} +echo {1..ff..2} +echo {1..ff} +echo {1..f} +echo {1..0f} +echo {1..10f} +echo {1..10.f} +echo {1..10.f} diff --git a/tests/builtins.right b/tests/builtins.right new file mode 100644 index 0000000..bafc53f --- /dev/null +++ b/tests/builtins.right @@ -0,0 +1,171 @@ +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 test worked +specialname +-specialname +FOO=BAR +FOO=BAR +hash: hash table empty +0 +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 10: /tmp/source-notthere: No such file or directory +after bad source 1 +./source5.sub: line 17: /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 +AVAR +foo +foo +AVAR +foo +foo +AVAR +foo +declare -x foo="" +declare -x FOO="\$\$" +./builtins.tests: line 213: declare: FOO: not found +declare -x FOO="\$\$" +ok +ok +./builtins.tests: line 245: kill: 4096: invalid signal specification +1 +a\n\n\nb +a + + +b +before: f = 4 +inside +after: f = 8 bar = 4 +./builtins4.sub: line 2: declare: c: not found +./builtins4.sub: line 5: declare: d: not found +declare -a c='([0]="4")' +declare -A c='([0]="4" )' +declare -a c='([0]="1" [1]="2" [2]="3")' +declare -A c='([one]="1" [two]="2" [three]="3" )' +declare -a c='([0]="1" [1]="2" [2]="3")' +declare -a c='([0]="1" [1]="2" [2]="3")' +unset +unset +./builtins.tests: line 260: exit: status: numeric argument required diff --git a/tests/builtins.tests b/tests/builtins.tests new file mode 100644 index 0000000..9d77520 --- /dev/null +++ b/tests/builtins.tests @@ -0,0 +1,262 @@ +# tests for miscellaneous builtins not tested elsewhere +set +p +set +o posix + +ulimit -c 0 2>/dev/null + +# check that break breaks loops +for i in a b c; do echo $i; break; echo bad-$i; done +echo end-1 +for i in a b c; do echo $i; break 1; echo bad-$i; done +echo end-2 +for i in a b c; do + for j in x y z; do + echo $i:$j + break + echo bad-$i + done + echo end-$i +done +echo end-3 + +# check that break breaks nested loops +for i in a b c; do + for j in x y z; do + echo $i:$j + break 2 + echo bad-$i + done + echo end-$i +done +echo end + +# check that continue continues loops +for i in a b c; do echo $i; continue; echo bad-$i ; done +echo end-1 +for i in a b c; do echo $i; continue 1; echo bad-$i; done +echo end-2 +for i in a b c; do + for j in x y z; do + echo $i:$j + continue + echo bad-$i-$j + done + echo end-$i +done +echo end-3 + +# check that continue breaks out of nested loops +for i in a b c; do + for j in x y z; do + echo $i:$j + continue 2 + echo bad-$i-$j + done + echo end-$i +done +echo end + +# check that `eval' re-evaluates arguments, but `builtin' and `command' do not +AVAR='$BVAR' +BVAR=foo + +echo $AVAR +builtin echo $AVAR +command echo $AVAR +eval echo \$AVAR +eval echo $AVAR + +# test out eval with a temp environment +AVAR=bar eval echo \$AVAR +BVAR=xxx eval echo $AVAR + +unset -v AVAR BVAR + +# test umask +mask=$(umask) +umask 022 +umask +umask -S +umask -S u=rwx,g=rwx,o=rx >/dev/null # 002 +umask +umask -S +umask -p +umask -p -S +umask 0 +umask -S +umask ${mask} # restore original mask + +# builtin/command without arguments should do nothing. maybe someday they will +builtin +command + +# test enable +enable -ps + +enable -aps ; enable -nps + +enable -n test +case "$(type -t test)" in +builtin) echo oops -- enable -n test failed ;; +*) echo enable -n test worked ;; +esac + +enable test +case "$(type -t test)" in +builtin) echo enable test worked ;; +*) echo oops -- enable test failed ;; +esac + +# test options to exec +(exec -a specialname ${THIS_SH} -c 'echo $0' ) +(exec -l -a specialname ${THIS_SH} -c 'echo $0' ) +# test `clean' environment. if /bin/sh is bash, and the script version of +# printenv is run, there will be variables in the environment that bash +# sets on startup. Also test code that prefixes argv[0] with a dash. +(export FOO=BAR ; exec -c -l printenv ) | grep FOO +(FOO=BAR exec -c printenv ) | grep FOO + +(export FOO=BAR ; exec printenv ) | grep FOO +(FOO=BAR exec printenv ) | grep FOO + +# ok, forget everything about hashed commands +hash -r +hash + +# this had better succeed, since command -p guarantees we will find the +# standard utilties +command -p hash rm + +# check out source/. + +# sourcing a zero-length-file had better not be an error +rm -f /tmp/zero-length-file +cp /dev/null /tmp/zero-length-file +. /tmp/zero-length-file +echo $? +rm /tmp/zero-length-file + +AVAR=AVAR + +. ./source1.sub +AVAR=foo . ./source1.sub + +. ./source2.sub +echo $? + +set -- a b c +. ./source3.sub + +# make sure source with arguments does not change the shell's positional +# parameters, but that the sourced file sees the arguments as its +# positional parameters +echo "$@" +. ./source3.sub x y z +echo "$@" + +# but if the sourced script sets the positional parameters explicitly, they +# should be reflected in the calling shell's positional parameters. this +# also tests one of the shopt options that controls source using $PATH to +# find the script +echo "$@" +shopt -u sourcepath +. source4.sub +echo "$@" + +# this is complicated when the sourced scripts gets its own positional +# parameters from arguments to `.' +set -- a b c +echo "$@" +. source4.sub x y z +echo "$@" + +# test out cd and $CDPATH +${THIS_SH} ./builtins1.sub + +# test behavior of `.' when given a non-existant file argument +${THIS_SH} ./source5.sub + +# test bugs in sourcing non-regular files, fixed post-bash-3.2 +${THIS_SH} ./source6.sub + +# test bugs with source called from multiline aliases and other contexts +${THIS_SH} ./source7.sub + +# in posix mode, assignment statements preceding special builtins are +# reflected in the shell environment. `.' and `eval' need special-case +# code. +set -o posix +echo $AVAR +AVAR=foo . ./source1.sub +echo $AVAR + +AVAR=AVAR +echo $AVAR +AVAR=foo eval echo \$AVAR +echo $AVAR + +AVAR=AVAR +echo $AVAR +AVAR=foo : +echo $AVAR +set +o posix + +# but assignment statements preceding `export' are always reflected in +# the environment +foo="" export foo +declare -p foo +unset foo + +# assignment statements preceding `declare' should be displayed correctly, +# but not persist after the command +FOO='$$' declare -p FOO +declare -p FOO +unset FOO + +# except for `declare -x', which should be equivalent to `export' +FOO='$$' declare -x FOO +declare -p FOO +unset FOO + +# test out kill -l. bash versions prior to 2.01 did `kill -l num' wrong +sigone=$(kill -l | sed -n 's:^ 1) *\([^ ]*\)[ ].*$:\1:p') + +case "$(kill -l 1)" in +${sigone/SIG/}) echo ok;; +*) echo oops -- kill -l failure;; +esac + +# kill -l and trap -l should display exactly the same output +sigonea=$(trap -l | sed -n 's:^ 1) *\([^ ]*\)[ ].*$:\1:p') + +if [ "$sigone" != "$sigonea" ]; then + echo oops -- kill -l and trap -l differ +fi + +# POSIX.2 says that exit statuses > 128 are mapped to signal names by +# subtracting 128 so you can find out what signal killed a process +case "$(kill -l $(( 128 + 1)) )" in +${sigone/SIG/}) echo ok;; +*) echo oops -- kill -l 129 failure;; +esac + +# out-of-range signal numbers should report the argument in the error +# message, not 128 less than the argument +kill -l 4096 + +# kill -l NAME should return the signal number +kill -l ${sigone/SIG/} + +# test behavior of shopt xpg_echo +${THIS_SH} ./builtins2.sub + +# test behavior of declare -g +${THIS_SH} ./builtins3.sub + +# test behavior of using declare to create variables without assigning values +${THIS_SH} ./builtins4.sub + +# this must be last -- it is a fatal error +exit status + +echo after bad exit diff --git a/tests/builtins1.sub b/tests/builtins1.sub new file mode 100644 index 0000000..52185b5 --- /dev/null +++ b/tests/builtins1.sub @@ -0,0 +1,14 @@ +unset CDPATH + +MYDIR=$(pwd -P) +FULLDIR=/tmp/bash-dir-a +DIR=${FULLDIR##*/} + +mkdir $FULLDIR +CDPATH=.:/tmp +cd $DIR +pwd +echo $PWD + +cd "$MYDIR" +rmdir $FULLDIR diff --git a/tests/builtins2.sub b/tests/builtins2.sub new file mode 100644 index 0000000..e4cb32a --- /dev/null +++ b/tests/builtins2.sub @@ -0,0 +1,10 @@ +# test behavior of shopt xpg_echo + +USG_ECHO=off +shopt -q xpg_echo && USG_ECHO=on + +shopt -u xpg_echo +echo 'a\n\n\nb' + +shopt -s xpg_echo +echo 'a\n\n\nb' diff --git a/tests/builtins3.sub b/tests/builtins3.sub new file mode 100644 index 0000000..5596c56 --- /dev/null +++ b/tests/builtins3.sub @@ -0,0 +1,14 @@ +# declare -g added in bash-4.2 +f=4 + +foo() +{ + declare -g f=8 + declare -g bar=4 + + echo inside +} + +echo before: f = $f +foo +echo after: f = $f bar = $bar diff --git a/tests/builtins4.sub b/tests/builtins4.sub new file mode 100644 index 0000000..b7d0c0c --- /dev/null +++ b/tests/builtins4.sub @@ -0,0 +1,44 @@ +declare -a c +declare -p c + +declare -A d +declare -p d +unset c d + +declare -a c +c=4 +declare -p c +unset c + +declare -A c +c=4 +declare -p c +unset c + +declare -a c +c=(1 2 3) +declare -p c +unset c + +declare -A c +c=([one]=1 [two]=2 [three]=3) +declare -p c +unset c + +declare -a c +read -a c < <(echo 1 2 3) +declare -p c +unset c + +declare -a c +mapfile -t c < <(echo 1$'\n'2$'\n'3) +declare -p c +unset c + +unset foo +declare -A foo +echo ${foo-unset} + +unset foo +declare -a foo +echo ${foo-unset} diff --git a/tests/case.right b/tests/case.right new file mode 100644 index 0000000..58ab2a4 --- /dev/null +++ b/tests/case.right @@ -0,0 +1,20 @@ +fallthrough +to here +and here +retest +and match +no more clauses +1.0 +./case.tests: line 29: xx: readonly variable +1.1 +ok 1 +ok 2 +ok 3 +ok 4 +ok 5 +ok 6 +ok 7 +ok 8 +ok 9 +mysterious 1 +mysterious 2 diff --git a/tests/case.tests b/tests/case.tests new file mode 100644 index 0000000..547e8cc --- /dev/null +++ b/tests/case.tests @@ -0,0 +1,33 @@ +case foo in +bar) echo skip ;; +foo) echo fallthrough ;& +bax) echo to here ;& +qux) echo and here;; +fop) echo but not here;; +esac + +case foobar in +bar) echo skip ;; +foo*) echo retest ;;& +*bar) echo and match ;;& +qux) echo but not this ;; +esac + +case a in +a) echo no more clauses;& +esac + +x=0 y=1 +case 1 in + $((y=0)) ) ;; + $((x=1)) ) ;& + $((x=2)) ) echo $x.$y ;; +esac + +unset x +readonly xx=1 +case 1 in $((xx++)) ) echo hi1 ;; *) echo hi2; esac +echo ${xx}.$? + +# tests of quote removal and pattern matching +${THIS_SH} ./case1.sub diff --git a/tests/case1.sub b/tests/case1.sub new file mode 100644 index 0000000..7db09ab --- /dev/null +++ b/tests/case1.sub @@ -0,0 +1,64 @@ +x='\x' + +case x in +\x) echo ok 1;; +*) echo bad 1;; +esac + +case x in +$x) echo ok 2;; +*) echo bad 2;; +esac + +case $x in +\x) echo bad 3;; +\\x) echo ok 3 ;; +*) echo bad 3.1 ;; +esac + +case $x in +\\$x) echo ok 4 ;; +x) echo bad 4;; +$x) echo bad 4.1 ;; +*) echo bad 4.2;; +esac + +case x in +\\x) echo bad 5;; +\x) echo ok 5;; +*) echo bad 5.1;; +esac + +case x in +\\x) echo bad 6;; +x) echo ok 6;; +*) echo bad 6.1;; +esac + +case x in +$x) echo ok 7 ;; +\\$x) echo bad 7 ;; +*) echo bad 7.1 ;; +esac + +case x in +\x) echo ok 8 ;; +\\x) echo bad 8 ;; +*) echo bad 8.1 ;; +esac + +case \x in +\x) echo ok 9 ;; +\\x) echo bad 9 ;; +*) echo bad 9.1 ;; +esac + +case $x in +$x) echo oops 1 ;; +*) echo mysterious 1 ;; +esac + +case \x in +\x) echo mysterious 2 ;; +*) echo oops 2 ;; +esac diff --git a/tests/casemod.right b/tests/casemod.right new file mode 100644 index 0000000..958b28d --- /dev/null +++ b/tests/casemod.right @@ -0,0 +1,45 @@ +Acknowledgement +ACKNOWLEDGEMENT +Oenophile +OEnOphIlE +aCKNOWLEDGEMENT +acknowledgement +oENOPHILE +oENOPHILE +oeNoPHiLe +Acknowledgement Oenophile +AcknOwlEdgEmEnt OEnOphIlE +aCKNOWLEDGEMENT oENOPHILE +aCKNoWLeDGeMeNT oeNoPHiLe +aCKNOWLEDGEMENT oENOPHILE +acknowledgement oenophile +Acknowledgement Oenophile +ACKNOWLEDGEMENT OENOPHILE +Acknowledgement Oenophile +AcknOwlEdgEmEnt OEnOphIlE +oENOPHILE aCKNOWLEDGEMENT +oenophile acknowledgement +oENOPHILE aCKNOWLEDGEMENT +oeNoPHiLe aCKNoWLeDGeMeNT +Acknowledgement Oenophile +ACKNOWLEDGEMENT OENOPHILE +acknowledgement oenophile +ackNowLEdgEmENT oENophiLE +acknowledgement oenophile +ackNowLEdgEmENT oENophiLE +acknowledgement oenophile +acknowledgement oenophile +acknowledgement oenophile +acknowledgement oenophile +Acknowledgement Oenophile +ACKNOWLEDGEMENT OENOPHILE +BE CONSERVATIVE IN WHAT YOU SEND AND LIBERAL IN WHAT YOU ACCEPT +be conservative in what you send and liberal in what you accept +Be conservative in what you send and liberal in what you accept +Be conservative in what you send and liberal in what you accept +be Conservative in what you send and Liberal in what you accept +be conservative in what you send and liberal in what you accept +Be Conservative in what you send and Liberal in what you accept +BE CONSERVATIVE IN WHAT YOU SEND AND LIBERAL IN WHAT YOU ACCEPT +Be conservative in what you send and liberal in what you accept +BE CONSERVATIVE IN WHAT YOU SEND AND LIBERAL IN WHAT YOU ACCEPT diff --git a/tests/casemod.tests b/tests/casemod.tests new file mode 100644 index 0000000..3c7ad23 --- /dev/null +++ b/tests/casemod.tests @@ -0,0 +1,99 @@ +S1=acknowledgement +S2=oenophile + +echo ${S1^} +echo ${S1^^} + +echo ${S2^[aeiou]} +echo ${S2^^[aeiou]} + +U1=${S1^^} +U2=${S2^^} + +echo ${U1,} +echo ${U1,,} + +echo ${U2,} +echo ${U2,[AEIOU]} +echo ${U2,,[AEIOU]} + +A1=( $S1 $S2 ) + +echo ${A1[@]^[aeiou]} +echo ${A1[@]^^[aeiou]} + +A2=( $U1 $U2 ) + +echo ${A2[@],[AEIOU]} +echo ${A2[@],,[AEIOU]} + +echo ${A2[@],?} +echo ${A2[@],,?} + +declare -A AA1 AA2 + +AA1[ack]=$S1 +AA1[oen]=$S2 + +echo ${AA1[@]^} +echo ${AA1[@]^^} + +echo ${AA1[@]^[aeiou]} +echo ${AA1[@]^^[aeiou]} + +AA2[ACK]=$U1 +AA2[OEN]=$U2 + +echo ${AA2[@],} +echo ${AA2[@],,} + +echo ${AA2[@],[AEIOU]} +echo ${AA2[@],,[AEIOU]} + +set -- $S1 $S2 + +echo ${@^} +echo ${@^^} + + +echo ${S1^[rstlne]} ${S2^[rstlne]} +echo ${S1^^[rstlne]} ${S2^^[rstlne]} + +echo ${@^[rstlne]} +echo ${@^^[rstlne]} + +echo ${S1,[rstlne]} ${S2,[rstlne]} +echo ${S1,,[rstlne]} ${S2,,[rstlne]} + +echo ${@,[rstlne]} +echo ${@,,[rstlne]} + +echo ${@^?} +echo ${@^^?} + +# make sure that multiple words in the string are handled as other expansions +TEXT="Be Conservative in what you send and Liberal in what you accept" +TEXT2="be conservative in what you send and liberal in what you accept" + +declare -u foo +foo=$TEXT +echo $foo + +declare -l bar +bar=$TEXT +echo $bar + +declare -c qux +qux=$TEXT +echo $qux +qux=$TEXT2 +echo $qux + +echo ${TEXT,} +echo ${TEXT,,} + +echo ${TEXT^} +echo ${TEXT^^} + +echo ${TEXT2^} +echo ${TEXT2^^} diff --git a/tests/comsub-eof.right b/tests/comsub-eof.right new file mode 100644 index 0000000..452a9c5 --- /dev/null +++ b/tests/comsub-eof.right @@ -0,0 +1,13 @@ +./comsub-eof0.sub: line 1: unexpected EOF while looking for matching `)' +./comsub-eof0.sub: line 5: syntax error: unexpected end of file +hi +./comsub-eof2.sub: line 2: warning: here-document at line 1 delimited by end-of-file (wanted `EOF') +hi +./comsub-eof3.sub: line 1: unexpected EOF while looking for matching `)' +./comsub-eof3.sub: line 5: syntax error: unexpected end of file +./comsub-eof4.sub: line 6: warning: here-document at line 4 delimited by end-of-file (wanted `EOF') +contents +./comsub-eof5.sub: line 8: warning: here-document at line 6 delimited by end-of-file (wanted `)') +hi +./comsub-eof5.sub: line 13: warning: here-document at line 11 delimited by end-of-file (wanted `EOF') +hi diff --git a/tests/comsub-eof.tests b/tests/comsub-eof.tests new file mode 100644 index 0000000..f96aeee --- /dev/null +++ b/tests/comsub-eof.tests @@ -0,0 +1,11 @@ +${THIS_SH} ./comsub-eof0.sub + +${THIS_SH} ./comsub-eof1.sub + +${THIS_SH} ./comsub-eof2.sub + +${THIS_SH} ./comsub-eof3.sub + +${THIS_SH} ./comsub-eof4.sub + +${THIS_SH} ./comsub-eof5.sub diff --git a/tests/comsub-eof0.sub b/tests/comsub-eof0.sub new file mode 100644 index 0000000..7b0775f --- /dev/null +++ b/tests/comsub-eof0.sub @@ -0,0 +1,4 @@ +foo=$(cat < +abcdefoo +argv[1] = +argv[2] = +argv[1] = +argv[1] = +' +after 1 +' +after 2 +' +after 3 +` +after 4 +hello +after 5 +' +after 6 +x +x +quoted ) +comment +here-doc with ) +here-doc terminated with a parenthesis +' # or a single back- or doublequote +./comsub-posix1.sub: command substitution: line 2: syntax error near unexpected token `)' +./comsub-posix1.sub: command substitution: line 2: ` if x; then echo foo )' +after +swap32_posix is a function +swap32_posix () +{ + local funcname=swap32_posix; + local arg; + for arg in "$@"; + do + echo $(( + ($arg & 4278190080) >> 24 | + ($arg & 16711680) >> 8 | + ($arg & 65280) << 8 | + ($arg & 255) << 24 + )); + done +} +yes diff --git a/tests/comsub-posix.tests b/tests/comsub-posix.tests new file mode 100644 index 0000000..bcfeede --- /dev/null +++ b/tests/comsub-posix.tests @@ -0,0 +1,219 @@ + +# works right +echo ab$(echo mnop)yz +# works right +echo ab$(echo mnop +)yz +# +# works right +echo $(echo ab + ) +# works right +echo $( +) +echo $() +echo ab$()cd + +echo $(case a in (a) echo sh_352.26ax; esac ) +echo $(case a in (a) echo sh_352.26ay; esac) + +echo $((echo sh_352.25a);(echo sh_352.25b)) + +echo $(echo sh_352.27 ')' ")" \) + # ) comment + ) + +echo $( +echo abc # a comment with ) +) + +echo $( +cat <> 24 | + ($arg & 16711680) >> 8 | + ($arg & 65280) << 8 | + ($arg & 255) << 24 + )) + done +} + +type swap32_posix diff --git a/tests/comsub-posix3.sub b/tests/comsub-posix3.sub new file mode 100644 index 0000000..3a0e39a --- /dev/null +++ b/tests/comsub-posix3.sub @@ -0,0 +1,22 @@ +# parsing errors before bash-4.2 + +a=$(/bin/cat << EOF | wc -l +a +b +c +EOF +) + +a=$(cat << EOF | wc -l +a +b +c +EOF +) + +a=$(/bin/cat << EOF +a +b +c +EOF +) diff --git a/tests/comsub.right b/tests/comsub.right new file mode 100644 index 0000000..9894529 --- /dev/null +++ b/tests/comsub.right @@ -0,0 +1,29 @@ +./comsub.tests: line 7: hijkl: command not found +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[1] = +argv[2] = +argv[1] = <$> +argv[2] = +argv[1] = <`> +argv[2] = +argv[1] = <\> +argv[2] = +argv[1] = +argv[1] = +argv[1] = argv[2] = <-e> argv[3] = +argv[1] = argv[2] = <-e> argv[3] = +argv[1] = +argv[1] = +argv[1] = +#esac +a +ok 1 +ok 2 +ok 3 +ok 4 +ok 5 +ok 6 diff --git a/tests/comsub.tests b/tests/comsub.tests new file mode 100644 index 0000000..493bbda --- /dev/null +++ b/tests/comsub.tests @@ -0,0 +1,44 @@ +# command substution parsing tests + +TABSIZE=`grep -v '^[ #]' $CAPS %d\n' "$c" "$r" "$?"; + done; + printf %s\\n --- +done + +# try again with literals + +[[ '' =~ $'' ]] ; echo $? +[[ '' =~ '\' ]] ; echo $? +[[ '' =~ '\[]' ]] ; echo $? + +[[ '' =~ '' ]] ; echo $? +[[ '' =~ '\' ]] ; echo $? +[[ '' =~ '\[]' ]] ; echo $? + +[[ '' =~ $'' ]] ; echo $? +[[ '' =~ '\' ]] ; echo $? +[[ '' =~ '\[]' ]] ; echo $? + +# more expansions, but with literal non-special characters +[[ x =~ \x ]] ; echo $? +[[ x =~ \\x ]] ; echo $? + +bs='\' +[[ x =~ ${bs}x ]] ; echo $? + +[[ x =~ $'\\'x ]] ; echo $? +[[ x =~ '\'x ]] ; echo $? + +v='a\-b' +[[ a-b =~ ${v} ]] ; echo $? +[[ a-b =~ a\-b ]]; echo $? +[[ a-b =~ a${bs}-b ]]; echo $? +[[ a-b =~ a\\-b ]] ; echo $? +[[ a-b =~ "a\-b" ]] ; echo $? + +c=$'\001' + +recho $c "$c" + +[[ $c == $c ]] && echo ok 1 +[[ $c =~ $c ]] && echo ok 2 +[[ $c =~ \\$c ]] || echo ok 3 +[[ $c =~ \\"$c" ]] || echo ok 4 + +[[ $c =~ "\\"$c ]] || echo ok 5 +[[ $c =~ '\'$c ]] || echo ok 6 + +[[ $c =~ "\\""$c" ]] || echo ok 7 +[[ $c =~ '\'"$c" ]] || echo ok 8 diff --git a/tests/cond.right b/tests/cond.right new file mode 100644 index 0000000..80bb5ce --- /dev/null +++ b/tests/cond.right @@ -0,0 +1,131 @@ +returns: 0 +returns: 0 +returns: 1 +returns: 0 +returns: 0 +returns: 0 +returns: 0 +returns: 0 +returns: 1 +returns: 0 +returns: 0 +returns: 1 +returns: 1 +returns: 1 +returns: 1 +returns: 0 +returns: 0 +returns: 0 +returns: 1 +returns: 0 +returns: 1 +returns: 0 +returns: 1 +returns: 1 +returns: 0 +./cond.tests: line 101: [[: 4+: syntax error: operand expected (error token is "+") +returns: 1 +returns: 0 +returns: 0 +returns: 1 +returns: 0 +returns: 0 +returns: 1 +returns: 0 +ok +jbig2dec + +found 1 +libc +found 2 +libc +ok 42 +ok 43 +match 1 +match 2 +match 3 +match 4 +match 5 +match 6 +yes 1 +yes 2 +yes 3 +yes 4 +yes 5 +yes 6 +Dog 01 is Wiggles +Dog 01 is Wiggles +rematch 1 +matches 7 +matches 8 +matches 9 +unquoted matches +match control-a 1 +match control-a 2 +match control-a 3 +match control-a 4 +match control-a 5 +ok 1 +ok 2 +ok 3 +ok 4 +ok 4a +ok 5 +ok 6 +ok 7 -- d +ok 8 -- o +ok 9 +ok 10 +ok 11 +ok 12 +argv[1] = <\^?> +0 +1 +1 +0 +1 +1 +0 +1 +1 +[[ $'\001' =~ $'\001' ]] -> 0 +[[ $'\001' =~ $'\\\001' ]] -> 0 +[[ $'\001' =~ $'\\[\001]' ]] -> 1 +--- +[[ $'\a' =~ $'\a' ]] -> 0 +[[ $'\a' =~ $'\\\a' ]] -> 0 +[[ $'\a' =~ $'\\[\a]' ]] -> 1 +--- +[[ $'\177' =~ $'\177' ]] -> 0 +[[ $'\177' =~ $'\\\177' ]] -> 0 +[[ $'\177' =~ $'\\[\177]' ]] -> 1 +--- +0 +1 +1 +0 +1 +1 +0 +1 +1 +0 +1 +0 +1 +1 +0 +0 +0 +1 +1 +argv[1] = <^A> +argv[2] = <^A> +ok 1 +ok 2 +ok 3 +ok 4 +ok 5 +ok 6 +ok 7 +ok 8 diff --git a/tests/cond.tests b/tests/cond.tests new file mode 100755 index 0000000..d91dddd --- /dev/null +++ b/tests/cond.tests @@ -0,0 +1,187 @@ +# +# the test/[ code is tested elsewhere, and the [[...]] just uses the same +# code. this tests the special features of [[...]] +# +TDIR=/usr/homes/chet + +# this one is straight out of the ksh88 book +[[ foo > bar && $PWD -ef . ]] +echo returns: $? + +# [[ x ]] is equivalent to [[ -n x ]] +[[ x ]] +echo returns: $? + +# [[ ! x ]] is equivalent to [[ ! -n x ]] +[[ ! x ]] +echo returns: $? + +# ! binds tighter than test/[ -- it binds to a term, not an expression +[[ ! x || x ]] +echo returns: $? + +# parenthesized terms didn't work right until post-2.04 +[[ a ]] +echo returns: $? + +[[ (a) ]] +echo returns: $? + +[[ -n a ]] +echo returns: $? + +[[ (-n a) ]] +echo returns: $? + +# unset variables don't need to be quoted +[[ -n $UNSET ]] +echo returns: $? + +[[ -z $UNSET ]] +echo returns: $? + +# the ==/= and != operators do pattern matching +[[ $TDIR == /usr/homes/* ]] +echo returns: $? + +# ...but you can quote any part of the pattern to have it matched as a string +[[ $TDIR == /usr/homes/\* ]] +echo returns: $? + +[[ $TDIR == '/usr/homes/*' ]] +echo returns: $? + +# if the first part of && fails, the second is not executed +[[ -n $UNSET && $UNSET == foo ]] +echo returns: $? + +[[ -z $UNSET && $UNSET == foo ]] +echo returns: $? + +# if the first part of || succeeds, the second is not executed +[[ -z $UNSET || -d $PWD ]] +echo returns: $? + +# if the rhs were executed, it would be an error +[[ -n $TDIR || $HOME -ef ${H*} ]] +echo returns: $? + +[[ -n $TDIR && -z $UNSET || $HOME -ef ${H*} ]] +echo returns: $? + +# && has a higher parsing precedence than || +[[ -n $TDIR && -n $UNSET || $TDIR -ef . ]] +echo returns: $? + +# ...but expressions in parentheses may be used to override precedence rules +[[ -n $TDIR || -n $UNSET && $PWD -ef xyz ]] +echo returns: $? + +[[ ( -n $TDIR || -n $UNSET ) && $PWD -ef xyz ]] +echo returns: $? + +# some arithmetic tests for completeness -- see what happens with missing +# operands, bad expressions, makes sure arguments are evaluated as +# arithmetic expressions, etc. + +unset IVAR A +[[ 7 -gt $IVAR ]] +echo returns: $? + +[[ $IVAR -gt 7 ]] +echo returns: $? + +IVAR=4 +[[ $IVAR -gt 7 ]] +echo returns: $? + +[[ 7 -eq 4+3 ]] +echo returns: $? + +[[ 7 -eq 4+ ]] +echo returns: $? + +IVAR=4+3 +[[ $IVAR -eq 7 ]] +echo returns: $? + +A=7 +[[ $IVAR -eq A ]] +echo returns: $? + +unset IVAR A + +# more pattern matching tests + +[[ $filename == *.c ]] +echo returns: $? + +filename=patmatch.c + +[[ $filename == *.c ]] +echo returns: $? + +# the extended globbing features may be used when matching patterns +shopt -s extglob + +arg=-7 + +[[ $arg == -+([0-9]) ]] +echo returns: $? + +arg=-H + +[[ $arg == -+([0-9]) ]] +echo returns: $? + +arg=+4 +[[ $arg == ++([0-9]) ]] +echo returns: $? + +# make sure the null string is never matched if the string is not null +STR=file.c +PAT= + +if [[ $STR = $PAT ]]; then + echo oops +fi + +# but that if the string is null, a null pattern is matched correctly +STR= +PAT= + +if [[ $STR = $PAT ]]; then + echo ok +fi + +# test the regular expression conditional operator +[[ jbig2dec-0.9-i586-001.tgz =~ ([^-]+)-([^-]+)-([^-]+)-0*([1-9][0-9]*)\.tgz ]] +echo ${BASH_REMATCH[1]} + +# this shouldn't echo anything +[[ jbig2dec-0.9-i586-001.tgz =~ \([^-]+\)-\([^-]+\)-\([^-]+\)-0*\([1-9][0-9]*\)\.tgz ]] +echo ${BASH_REMATCH[1]} + +LDD_BASH=" linux-gate.so.1 => (0xffffe000) + libreadline.so.5 => /lib/libreadline.so.5 (0xb7f91000) + libhistory.so.5 => /lib/libhistory.so.5 (0xb7f8a000) + libncurses.so.5 => /lib/libncurses.so.5 (0xb7f55000) + libdl.so.2 => /lib/libdl.so.2 (0xb7f51000) + libc.so.6 => /lib/libc.so.6 (0xb7e34000) + /lib/ld-linux.so.2 (0xb7fd0000)" + +[[ "$LDD_BASH" =~ "libc" ]] && echo "found 1" +echo ${BASH_REMATCH[@]} + +[[ "$LDD_BASH" =~ libc ]] && echo "found 2" +echo ${BASH_REMATCH[@]} + +# bug in all versions up to and including bash-2.05b +if [[ "123abc" == *?(a)bc ]]; then echo ok 42; else echo bad 42; fi +if [[ "123abc" == *?(a)bc ]]; then echo ok 43; else echo bad 43; fi + +${THIS_SH} ./cond-regexp1.sub + +${THIS_SH} ./cond-regexp2.sub + +${THIS_SH} ./cond-regexp3.sub diff --git a/tests/coproc.right b/tests/coproc.right new file mode 100644 index 0000000..6d9deaa --- /dev/null +++ b/tests/coproc.right @@ -0,0 +1,13 @@ +84575 +63 60 +a b c +84577 +63 60 +flop +./coproc.tests: line 22: 84577 Terminated coproc REFLECT { cat -; } +84579 +63 60 +FOO +63 60 +root +-1 -1 diff --git a/tests/coproc.tests b/tests/coproc.tests new file mode 100644 index 0000000..8be3563 --- /dev/null +++ b/tests/coproc.tests @@ -0,0 +1,45 @@ +coproc { echo a b c; sleep 2; } + +echo $COPROC_PID +echo ${COPROC[@]} + +read LINE <&${COPROC[0]} +echo $LINE + +wait $COPROC_PID + +coproc REFLECT { cat - ; } + +echo $REFLECT_PID +echo ${REFLECT[@]} + +echo flop >&${REFLECT[1]} +read LINE <&${REFLECT[0]} + +echo $LINE + +kill $REFLECT_PID +wait $REFLECT_PID + +coproc xcase -n -u + +echo $COPROC_PID +echo ${COPROC[@]} + +echo foo >&${COPROC[1]} +read <&${COPROC[0]} + +echo $REPLY +echo ${COPROC[@]} + +cat /etc/passwd | grep root | awk -F: '{print $1;}' | sed 1q + +exec 4<&${COPROC[0]}- +exec >&${COPROC[1]}- + +echo ${COPROC[@]} + +read foo <&4 +echo $foo >&2 + +exit 0 diff --git a/tests/cprint.right b/tests/cprint.right new file mode 100644 index 0000000..2000072 --- /dev/null +++ b/tests/cprint.right @@ -0,0 +1,72 @@ +tf is a function +tf () +{ + echo this is ${0##*/} > /dev/null; + echo a | cat - > /dev/null; + test -f ${0##*/} && echo ${0##*/} is a regular file; + test -d ${0##*/} || echo ${0##*/} is not a directory; + echo a; + echo b; + echo c; + echo background > /dev/null & ( exit 1 ); + echo $?; + { + echo a + }; + i=0; + while (( i < 3 )); do + test -r /dev/fd/$i; + i=$(( i + 1 )); + done; + [[ -r /dev/fd/0 && -w /dev/fd/1 ]] || echo oops > /dev/null; + for name in $( echo 1 2 3 ); + do + test -r /dev/fd/$name; + done; + if [[ -r /dev/fd/0 && -w /dev/fd/1 ]]; then + echo ok > /dev/null; + else + if (( 7 > 40 )); then + echo oops; + else + echo done; + fi; + fi > /dev/null; + case $PATH in + *$PWD*) + echo \$PWD in \$PATH + ;; + *) + echo \$PWD not in \$PATH + ;; + esac > /dev/null; + while false; do + echo z; + done > /dev/null; + until true; do + echo z; + done > /dev/null; + echo \&\|'()' \{ echo abcde \; \}; + eval fu\%nc'()' \{ echo abcde \; \}; + type fu\%nc +} +tf2 is a function +tf2 () +{ + ( { + time -p echo a | cat - > /dev/null + } ) 2>&1 +} +cprint.tests is a regular file +cprint.tests is not a directory +a +b +c +1 +a +&|() { echo abcde ; } +fu%nc is a function +fu%nc () +{ + echo abcde +} diff --git a/tests/cprint.tests b/tests/cprint.tests new file mode 100644 index 0000000..08ff1eb --- /dev/null +++ b/tests/cprint.tests @@ -0,0 +1,67 @@ +# +# a nonsense script and shell function to test out the command printing code +# +tf() +{ + # simple command with redir + echo this is ${0##*/} > /dev/null + + # pipeline + echo a | cat - > /dev/null + + test -f ${0##*/} && echo ${0##*/} is a regular file + test -d ${0##*/} || echo ${0##*/} is not a directory + + echo a ; echo b ; echo c + + echo background >/dev/null & + + ( exit 1 ) + echo $? + + { echo a ; } + + i=0 + while (( i < 3 )); do + test -r /dev/fd/$i + i=$(( i + 1 )) + done + + [[ -r /dev/fd/0 && -w /dev/fd/1 ]] || echo oops > /dev/null + + for name in $( echo 1 2 3 ); do + test -r /dev/fd/$name + done + + if [[ -r /dev/fd/0 && -w /dev/fd/1 ]] ; then + echo ok > /dev/null + elif (( 7 > 40 )) ; then + echo oops + else + echo done + fi > /dev/null + + case $PATH in + *$PWD*) echo \$PWD in \$PATH ;; + *) echo \$PWD not in \$PATH ;; + esac > /dev/null + + while false; do echo z; done > /dev/null + + until true; do echo z ; done > /dev/null + + echo \&\|'()' \{ echo abcde \; \} + # when not in POSIX mode, we can have weirdly-named functions + eval fu\%nc'()' \{ echo abcde \; \} + type fu\%nc +} + +tf2() +{ + ( { time -p echo a | cat - > /dev/null ; } ) 2>&1 +} + +type tf +type tf2 + +tf diff --git a/tests/dbg-support.right b/tests/dbg-support.right new file mode 100644 index 0000000..c4a1609 --- /dev/null +++ b/tests/dbg-support.right @@ -0,0 +1,371 @@ +debug lineno: 63 main +debug lineno: 66 main +FUNCNAME main +debug lineno: 70 main +debug lineno: 17 fn1 +debug lineno: 18 fn1 +LINENO 18 +debug lineno: 19 fn1 +LINENO 19 +debug lineno: 20 fn1 +BASH_SOURCE[0] ./dbg-support.tests +debug lineno: 21 fn1 +FUNCNAME[0] fn1 +debug lineno: 22 fn1 +debug lineno: 22 fn1 70 ./dbg-support.tests +debug lineno: 23 fn1 +debug lineno: 23 fn1 70 main ./dbg-support.tests +debug lineno: 24 fn1 +debug lineno: 24 fn1 +debug lineno: 25 fn1 +./dbg-support.tests: line 25: caller: foo: invalid number +caller: usage: caller [expr] +debug lineno: 25 fn1 +debug lineno: 17 fn1 +debug lineno: 12 print_return_trap +debug lineno: 13 print_return_trap +return lineno: 17 fn1 +debug lineno: 14 print_return_trap +debug lineno: 71 main +debug lineno: 28 fn2 +debug lineno: 29 fn2 +fn2 here. Calling fn1... +debug lineno: 30 fn2 +debug lineno: 17 fn1 +debug lineno: 18 fn1 +LINENO 18 +debug lineno: 19 fn1 +LINENO 19 +debug lineno: 20 fn1 +BASH_SOURCE[0] ./dbg-support.tests +debug lineno: 21 fn1 +FUNCNAME[0] fn1 +debug lineno: 22 fn1 +debug lineno: 22 fn1 30 ./dbg-support.tests +debug lineno: 23 fn1 +debug lineno: 23 fn1 30 fn2 ./dbg-support.tests +debug lineno: 24 fn1 +debug lineno: 24 fn1 71 main ./dbg-support.tests +debug lineno: 25 fn1 +./dbg-support.tests: line 25: caller: foo: invalid number +caller: usage: caller [expr] +debug lineno: 25 fn1 +debug lineno: 17 fn1 +debug lineno: 12 print_return_trap +debug lineno: 13 print_return_trap +return lineno: 17 fn1 +debug lineno: 14 print_return_trap +debug lineno: 28 fn2 +debug lineno: 12 print_return_trap +debug lineno: 13 print_return_trap +return lineno: 28 fn2 +debug lineno: 14 print_return_trap +debug lineno: 72 main +debug lineno: 33 fn3 +debug lineno: 34 fn3 +LINENO 34 +debug lineno: 35 fn3 +BASH_SOURCE[0] ./dbg-support.tests +debug lineno: 38 fn3 +debug lineno: 39 fn3 +debug lineno: 40 fn3 +debug lineno: 40 fn3 +debug lineno: 41 fn3 +debug lineno: 42 fn3 +debug lineno: 43 fn3 +fn3 called from file `./dbg-support.tests' at line 0 +debug lineno: 40 fn3 +debug lineno: 40 fn3 +debug lineno: 41 fn3 +debug lineno: 42 fn3 +debug lineno: 42 fn3 +debug lineno: 43 fn3 +main called from file `./dbg-support.tests' at line 0 +debug lineno: 40 fn3 +debug lineno: 40 fn3 +debug lineno: 46 fn3 +debug lineno: 18 source +SOURCED LINENO 18 +debug lineno: 19 source +SOURCED BASH_SOURCE[0] ./dbg-support.sub +debug lineno: 20 source +debug lineno: 3 sourced_fn +debug lineno: 4 sourced_fn +debug lineno: 5 sourced_fn +SOURCED FN LINENO 5 +debug lineno: 8 sourced_fn +debug lineno: 9 sourced_fn +debug lineno: 10 sourced_fn +debug lineno: 10 sourced_fn +debug lineno: 11 sourced_fn +debug lineno: 12 sourced_fn +debug lineno: 13 sourced_fn +FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 20 +debug lineno: 10 sourced_fn +debug lineno: 10 sourced_fn +debug lineno: 11 sourced_fn +debug lineno: 12 sourced_fn +debug lineno: 13 sourced_fn +FUNCNAME[1]: source called from ./dbg-support.tests at line 46 +debug lineno: 10 sourced_fn +debug lineno: 10 sourced_fn +debug lineno: 11 sourced_fn +debug lineno: 12 sourced_fn +debug lineno: 13 sourced_fn +FUNCNAME[2]: fn3 called from ./dbg-support.tests at line 72 +debug lineno: 10 sourced_fn +debug lineno: 10 sourced_fn +debug lineno: 11 sourced_fn +debug lineno: 12 sourced_fn +debug lineno: 12 sourced_fn +debug lineno: 13 sourced_fn +FUNCNAME[3]: main called from ./dbg-support.tests at line 0 +debug lineno: 10 sourced_fn +debug lineno: 10 sourced_fn +debug lineno: 3 sourced_fn +debug lineno: 12 print_return_trap +debug lineno: 13 print_return_trap +return lineno: 3 sourced_fn +debug lineno: 14 print_return_trap +debug lineno: 46 fn3 +debug lineno: 12 print_return_trap +debug lineno: 13 print_return_trap +return lineno: 46 fn3 +debug lineno: 14 print_return_trap +debug lineno: 33 fn3 +debug lineno: 12 print_return_trap +debug lineno: 13 print_return_trap +return lineno: 33 fn3 +debug lineno: 14 print_return_trap +debug lineno: 73 main +debug lineno: 18 source +SOURCED LINENO 18 +debug lineno: 19 source +SOURCED BASH_SOURCE[0] ./dbg-support.sub +debug lineno: 20 source +debug lineno: 3 sourced_fn +debug lineno: 4 sourced_fn +debug lineno: 5 sourced_fn +SOURCED FN LINENO 5 +debug lineno: 8 sourced_fn +debug lineno: 9 sourced_fn +debug lineno: 10 sourced_fn +debug lineno: 10 sourced_fn +debug lineno: 11 sourced_fn +debug lineno: 12 sourced_fn +debug lineno: 13 sourced_fn +FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 20 +debug lineno: 10 sourced_fn +debug lineno: 10 sourced_fn +debug lineno: 11 sourced_fn +debug lineno: 12 sourced_fn +debug lineno: 13 sourced_fn +FUNCNAME[1]: source called from ./dbg-support.tests at line 73 +debug lineno: 10 sourced_fn +debug lineno: 10 sourced_fn +debug lineno: 11 sourced_fn +debug lineno: 12 sourced_fn +debug lineno: 12 sourced_fn +debug lineno: 13 sourced_fn +FUNCNAME[2]: main called from ./dbg-support.tests at line 0 +debug lineno: 10 sourced_fn +debug lineno: 10 sourced_fn +debug lineno: 3 sourced_fn +debug lineno: 12 print_return_trap +debug lineno: 13 print_return_trap +return lineno: 3 sourced_fn +debug lineno: 14 print_return_trap +debug lineno: 73 main +debug lineno: 12 print_return_trap +debug lineno: 13 print_return_trap +return lineno: 73 main +debug lineno: 14 print_return_trap +debug lineno: 76 main +debug lineno: 79 main +LINENO 18 +LINENO 19 +BASH_SOURCE[0] ./dbg-support.tests +FUNCNAME[0] fn1 +79 ./dbg-support.tests +79 main ./dbg-support.tests + +./dbg-support.tests: line 25: caller: foo: invalid number +caller: usage: caller [expr] + +debug lineno: 80 main +fn2 here. Calling fn1... +LINENO 18 +LINENO 19 +BASH_SOURCE[0] ./dbg-support.tests +FUNCNAME[0] fn1 +30 ./dbg-support.tests +30 fn2 ./dbg-support.tests +80 main ./dbg-support.tests +./dbg-support.tests: line 25: caller: foo: invalid number +caller: usage: caller [expr] + +debug lineno: 81 main +LINENO 34 +BASH_SOURCE[0] ./dbg-support.tests +fn3 called from file `./dbg-support.tests' at line 0 +main called from file `./dbg-support.tests' at line 0 +SOURCED LINENO 18 +SOURCED BASH_SOURCE[0] ./dbg-support.sub +SOURCED FN LINENO 5 +FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 20 +FUNCNAME[1]: source called from ./dbg-support.tests at line 46 +FUNCNAME[2]: fn3 called from ./dbg-support.tests at line 81 +FUNCNAME[3]: main called from ./dbg-support.tests at line 0 +debug lineno: 82 main +fn4 here. Calling fn3... +LINENO 34 +BASH_SOURCE[0] ./dbg-support.tests +fn3 called from file `./dbg-support.tests' at line 82 +fn4 called from file `./dbg-support.tests' at line 0 +main called from file `./dbg-support.tests' at line 0 +SOURCED LINENO 18 +SOURCED BASH_SOURCE[0] ./dbg-support.sub +SOURCED FN LINENO 5 +FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 20 +FUNCNAME[1]: source called from ./dbg-support.tests at line 46 +FUNCNAME[2]: fn3 called from ./dbg-support.tests at line 51 +FUNCNAME[3]: fn4 called from ./dbg-support.tests at line 82 +FUNCNAME[4]: main called from ./dbg-support.tests at line 0 +debug lineno: 83 main +SOURCED LINENO 18 +SOURCED BASH_SOURCE[0] ./dbg-support.sub +SOURCED FN LINENO 5 +FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 20 +FUNCNAME[1]: source called from ./dbg-support.tests at line 83 +FUNCNAME[2]: main called from ./dbg-support.tests at line 0 +return lineno: 83 main +debug lineno: 86 main +debug lineno: 89 main +debug lineno: 18 source +SOURCED LINENO 18 +debug lineno: 19 source +SOURCED BASH_SOURCE[0] ./dbg-support.sub +debug lineno: 20 source +debug lineno: 3 sourced_fn +debug lineno: 4 sourced_fn +debug lineno: 5 sourced_fn +SOURCED FN LINENO 5 +debug lineno: 8 sourced_fn +debug lineno: 9 sourced_fn +debug lineno: 10 sourced_fn +debug lineno: 10 sourced_fn +debug lineno: 11 sourced_fn +debug lineno: 12 sourced_fn +debug lineno: 13 sourced_fn +FUNCNAME[0]: sourced_fn called from ./dbg-support.sub at line 20 +debug lineno: 10 sourced_fn +debug lineno: 10 sourced_fn +debug lineno: 11 sourced_fn +debug lineno: 12 sourced_fn +debug lineno: 13 sourced_fn +FUNCNAME[1]: source called from ./dbg-support.tests at line 89 +debug lineno: 10 sourced_fn +debug lineno: 10 sourced_fn +debug lineno: 11 sourced_fn +debug lineno: 12 sourced_fn +debug lineno: 12 sourced_fn +debug lineno: 13 sourced_fn +FUNCNAME[2]: main called from ./dbg-support.tests at line 0 +debug lineno: 10 sourced_fn +debug lineno: 10 sourced_fn +debug lineno: 3 sourced_fn +debug lineno: 12 print_return_trap +debug lineno: 13 print_return_trap +return lineno: 3 sourced_fn +debug lineno: 14 print_return_trap +debug lineno: 89 main +debug lineno: 12 print_return_trap +debug lineno: 13 print_return_trap +return lineno: 89 main +debug lineno: 14 print_return_trap +debug lineno: 90 main +debug lineno: 93 main +debug lineno: 93 main +debug lineno: 94 main +debug lineno: 97 main +debug lineno: 93 main +debug lineno: 93 main +debug lineno: 94 main +debug lineno: 97 main +debug lineno: 93 main +debug lineno: 93 main +debug lineno: 94 main +debug lineno: 95 main +Hit 2 +debug lineno: 97 main +debug lineno: 93 main +debug lineno: 93 main +debug lineno: 103 main +SOURCED FN LINENO 5 FUNCNAME[0]: sourced_fn called from ./dbg-support.tests at line 103 FUNCNAME[1]: main called from ./dbg-support.tests at line 0 +debug lineno: 104 main +SOURCED FN LINENO 5 FUNCNAME[0]: sourced_fn called from ./dbg-support.tests at line 104 FUNCNAME[1]: main called from ./dbg-support.tests at line 0 +debug lineno: 105 main +debug lineno: 106 main +SOURCED FN LINENO 5 +FUNCNAME[0]: sourced_fn called from ./dbg-support.tests at line 106 +FUNCNAME[1]: main called from ./dbg-support.tests at line 0 +debug lineno: 110 main +debug lineno: 111 main +debug lineno: 3 sourced_fn +debug lineno: 4 sourced_fn +debug lineno: 5 sourced_fn +SOURCED FN LINENO 5 +debug lineno: 8 sourced_fn +debug lineno: 9 sourced_fn +debug lineno: 10 sourced_fn +debug lineno: 10 sourced_fn +debug lineno: 11 sourced_fn +debug lineno: 12 sourced_fn +debug lineno: 13 sourced_fn +FUNCNAME[0]: sourced_fn called from ./dbg-support.tests at line 111 +debug lineno: 10 sourced_fn +debug lineno: 10 sourced_fn +debug lineno: 11 sourced_fn +debug lineno: 12 sourced_fn +debug lineno: 12 sourced_fn +debug lineno: 13 sourced_fn +FUNCNAME[1]: main called from ./dbg-support.tests at line 0 +debug lineno: 10 sourced_fn +debug lineno: 10 sourced_fn +debug lineno: 3 sourced_fn +debug lineno: 12 print_return_trap +debug lineno: 13 print_return_trap +return lineno: 3 sourced_fn +debug lineno: 14 print_return_trap +debug lineno: 114 main +debug lineno: 119 main +debug lineno: 123 main +got it +debug lineno: 131 main +debug lineno: 132 main +debug lineno: 133 main +debug lineno: 132 main +debug lineno: 133 main +debug lineno: 131 main +debug lineno: 132 main +debug lineno: 133 main +debug lineno: 132 main +debug lineno: 133 main +debug lineno: 137 main +main: calling f1 +f1: calling f2 +f2: calling f3 +f3: calling callstack +deep 6 +0 z +1 3 +2 y +3 2 +4 x +5 1 +FUNCNAME stack: f3 f2 f1 main +26 f2 ./dbg-support3.sub +f3: returning +f2: return from f3 +f1: return from f2 +main: f1 returns diff --git a/tests/dbg-support.sub b/tests/dbg-support.sub new file mode 100644 index 0000000..f68f8d9 --- /dev/null +++ b/tests/dbg-support.sub @@ -0,0 +1,26 @@ +# This file is intended to be sourced from one of the bashdb test programs + +sourced_fn() { + name="fn2" + echo "SOURCED FN LINENO $LINENO" + + # Print a stack trace + declare -i n + n=${#FUNCNAME[@]} + for (( i=0 ; (( i < $n )) ; i++ )) ; do + local -i j=i+1 + [ $j -eq $n ] && j=i # main()'s file is the same as the first caller + echo "FUNCNAME[$i]: ${FUNCNAME[$i]} called from ${BASH_SOURCE[$j]}" \ + "at line ${BASH_LINENO[$i]}" + done +} + +echo "SOURCED LINENO $LINENO" +echo "SOURCED BASH_SOURCE[0]" ${BASH_SOURCE[0]} +sourced_fn + +#;;; Local Variables: *** +#;;; mode:shell-script *** +#;;; eval: (sh-set-shell "bash") *** +#;;; End: *** + diff --git a/tests/dbg-support.tests b/tests/dbg-support.tests new file mode 100755 index 0000000..ad06d01 --- /dev/null +++ b/tests/dbg-support.tests @@ -0,0 +1,142 @@ +#!../bash +# +# Test correct functioning bash debug support not via the bashdb +# debugger but merely by printing via print_trap() +# $Id: dbg-support.tests,v 1.13 2003/02/17 22:02:25 rockyb Exp $ +shopt -s extdebug +print_debug_trap() { + echo "debug lineno: $1 ${FUNCNAME[1]}" + return +} + +print_return_trap() { + echo "return lineno: $1 ${FUNCNAME[1]}" + return +} + +fn1() { + echo "LINENO $LINENO" + echo "LINENO $LINENO" + echo "BASH_SOURCE[0]" ${BASH_SOURCE[0]} + echo "FUNCNAME[0]" ${FUNCNAME[0]} + echo `caller` + echo `caller 0` + echo `caller 1` + echo `caller foo` +} + +fn2() { + echo "fn2 here. Calling fn1..." + fn1 +} + +fn3() { + echo "LINENO $LINENO" + echo "BASH_SOURCE[0]" ${BASH_SOURCE[0]} + + # Print a stack trace + declare -i n + n=${#FUNCNAME[@]} + for (( i=0 ; (( i < $n )) ; i++ )) ; do + local -i j=i+1 + [ $j -eq $n ] && j=i # main()'s file is the same as the first caller + echo "${FUNCNAME[$i]} called from file " \ + "\`${BASH_SOURCE[$j]}' at line ${BASH_LINENO[$j]}" + done + source ./dbg-support.sub +} + +fn4() { + echo "fn4 here. Calling fn3..." + fn3 +} + + +#!../bash +# +# Test of support for debugging facilities in bash +# +# Test debugger set option functrace - set on. Not in vanilla Bash 2.05 +# +set -o functrace +trap 'print_debug_trap $LINENO' DEBUG +trap 'print_return_trap $LINENO' RETURN + +# Funcname is now an array, but you still can't see it outside a function +echo "FUNCNAME" ${FUNCNAME[0]:-main} + +# We should trace into the below. +# Start easy with a simple function. +fn1 +fn2 +fn3 +source ./dbg-support.sub + +# Test debugger set option functrace - set off +set +T + +# We should not trace into this. +fn1 +fn2 +fn3 +fn4 +source ./dbg-support.sub + +# Another way to say: set -o functrace +set -T + +# We should trace into this. +source ./dbg-support.sub +set +T + +# Test that the line numbers in the presence of conditionals are correct. +for (( i=0 ; (( i <= 2 )) ; i++ )) ; do + if [ $i -eq 2 ] ; then + echo "Hit 2" + fi + j=4 +done + +# +# Check line numbers in command substitution +# +echo $(sourced_fn) +echo `sourced_fn` +x=$((sourced_fn)) +x={ sourced_fn } + +# Make sure we step into sourced_fn as a comand when we request to do so. +# Vanilla bash 2.0 doesn't do. +set -o functrace +x={ sourced_fn } + +# Should see line number of xyzzy below. Vanilla bash 2.05b doesn't do +case xyzzy in + a ) + x=5 + ;; + xyzz? ) + case 3 in + 2 ) + x=6 ;; + 3 ) + echo "got it" ;; + * ) echo "no good" ;; + esac + ;; + * ) +esac + +# Should see line numbers for initial for lines. +for i in 0 1 ; do + for j in 3 4 ; do + ((x=i+j)) + done +done + +${THIS_SH} ./dbg-support3.sub + +#;;; Local Variables: *** +#;;; mode:shell-script *** +#;;; eval: (sh-set-shell "bash") *** +#;;; End: *** diff --git a/tests/dbg-support2.right b/tests/dbg-support2.right new file mode 100644 index 0000000..c9d884e --- /dev/null +++ b/tests/dbg-support2.right @@ -0,0 +1,7 @@ +lineno: 17 (6) main +lineno: 18 (6) main +x is 1 +lineno: 19 (6) main +lineno: 20 (6) main +lineno: 21 (6) main +x is 1 diff --git a/tests/dbg-support2.tests b/tests/dbg-support2.tests new file mode 100755 index 0000000..fdc0f31 --- /dev/null +++ b/tests/dbg-support2.tests @@ -0,0 +1,26 @@ +#!../bash +# +# Test correct trap return codes = 2 means skip execution. +shopt -s extdebug +print_trap() { + echo "lineno: $1 ($LINENO) ${FUNCNAME[1]}" + if [[ $debug_exit == 2 ]] ; then + debug_exit=0 + return 2 + fi + return 0 +} + +debug_exit=0 +trap 'print_trap $LINENO' DEBUG + +x=1 +echo "x is $x" +debug_exit=2 +x=2 +echo "x is $x" + +#;;; Local Variables: *** +#;;; mode:shell-script *** +#;;; eval: (sh-set-shell "bash") *** +#;;; End: *** diff --git a/tests/dbg-support3.sub b/tests/dbg-support3.sub new file mode 100644 index 0000000..cc52c65 --- /dev/null +++ b/tests/dbg-support3.sub @@ -0,0 +1,39 @@ +shopt -s extdebug + +callstack(){ + deep=${#BASH_ARGV[*]} + echo "deep $deep" + i=0 + for ff in ${BASH_ARGV[@]} + do + echo "$i $ff" + i=$(($i+1)) + done +} + +f3() +{ + echo $FUNCNAME: calling callstack + callstack + echo FUNCNAME stack: ${FUNCNAME[@]} + caller 0 + echo $FUNCNAME: returning +} + +f2() +{ + echo $FUNCNAME: calling f3 + f3 3 z + echo $FUNCNAME: return from f3 +} + +f1() +{ + echo $FUNCNAME: calling f2 + f2 2 y + echo $FUNCNAME: return from f2 +} + +echo main: calling f1 +f1 1 x +echo main: f1 returns diff --git a/tests/dollar-at-star b/tests/dollar-at-star new file mode 100755 index 0000000..9a5d402 --- /dev/null +++ b/tests/dollar-at-star @@ -0,0 +1,260 @@ +# first, let's start with the basics + +recho "$@" +recho "$*" + +recho $@ +recho $* + +set a b + +recho "$*" + +# If IFS is null, the parameters are joined without separators +IFS='' +recho "$*" + +# If IFS is unset, the parameters are separated by spaces +unset IFS +recho "${*}" + +recho "$@" +recho $@ + +IFS='/' +set bob 'tom dick harry' joe +set $* +recho $# +recho $1 +recho $2 +recho $3 + +set bob 'tom dick harry' joe +set ${*} +recho $# +recho $1 +recho $2 +recho $3 + +set bob 'tom dick harry' joe +set $@ +recho $# +recho $1 +recho $2 +recho $3 + +set bob 'tom dick harry' joe +set ${@} +recho $# +recho $1 +recho $2 +recho $3 + +# according to POSIX.2, unquoted $* should expand to multiple words if +# $IFS is null, just like unquoted $@ +IFS='' +set bob 'tom dick harry' joe +set $* +recho $# +recho $1 +recho $2 +recho $3 + +set bob 'tom dick harry' joe +set $@ +recho $# +recho $1 +recho $2 +recho $3 + +# if IFS is unset, the individual positional parameters are split on +# " \t\n" if $* or $@ are unquoted +unset IFS +set bob 'tom dick harry' joe +set $* +recho $# +recho $1 +recho $2 +recho $3 + +set bob 'tom dick harry' joe +set $@ +recho $# +recho $1 +recho $2 +recho $3 + +# but not for "$@" or "$*" +set bob 'tom dick harry' joe +set "$*" +recho $# +recho $1 +recho $2 +recho $3 + +set bob 'tom dick harry' joe +set "$@" +recho $# +recho $1 +recho $2 +recho $3 + +# POSIX.2 says these should both expand the positional parameters +# to multiple words +set a b c d e +IFS="" +recho $@ +recho "$@" + +# this example is straight from the POSIX.2 rationale +set foo bar bam + +recho "$@" +recho "$*" + +unset IFS + +recho "$@" +recho $@ +recho "$*" + +IFS=: + +# special variables +set -- 1 2 3 4 5 6 7 8 9 10 + +bar=${*} +foo=$* +echo foo = "$foo" +echo bar = "$bar" + +foo1=$@ +bar1=${@} + +echo foo1 = "$foo1" +echo bar1 = "$bar1" + +foo2="$*" +bar2="${*}" + +echo foo2 = "$foo2" +echo bar2 = "$bar2" + +eval foo3='$*' bar3='${*}' +echo foo3 = "$foo3" +echo bar3 = "$bar3" + +case $* in +*\:*) echo ok 1;; +*) echo bad 1;; +esac + +case $@ in +*\:*) echo bad 2;; +*) echo ok 2;; +esac + +case "$*" in +*\:*) echo ok 3;; +*) echo bad 3;; +esac + +case "$@" in +*\:*) echo bad 4;; +*) echo ok 4;; +esac + +IFS=$' \t\n' + +bar=${*} +foo=$* +echo foo = "$foo" +echo bar = "$bar" + +foo1=$@ +bar1=${@} + +echo foo1 = "$foo1" +echo bar1 = "$bar1" + +foo2="$*" +bar2="${*}" + +echo foo2 = "$foo2" +echo bar2 = "$bar2" + +eval foo3='$*' bar3='${*}' +echo foo3 = "$foo3" +echo bar3 = "$bar3" + +case $* in +*\ *) echo ok 1;; +*) echo bad 1;; +esac + +case $@ in +*\ *) echo ok 2;; +*) echo bad 2;; +esac + +case "$*" in +*\ *) echo ok 3;; +*) echo bad 3;; +esac + +case "$@" in +*\ *) echo ok 4;; +*) echo bad 4;; +esac + +# tests for the effect of quoting $* and $@ in an assignment context (plus +# arrays) -- bugs through bash 4.2 +${THIS_SH} ./dollar-at-star1.sub + +# tests for special expansion of "$*" and "${array[*]}" when used with other +# expansions -- bugs through bash-2.05b +${THIS_SH} ./dollar-star1.sub + +# tests for expansion of "$@" on rhs of things like ${param:+word}. Bugs +# though bash-2.05b +${THIS_SH} ./dollar-at1.sub + +# tests for expansion of other variables in double-quoted strings containing +# $@. Bugs through bash-2.05b +${THIS_SH} ./dollar-at2.sub + +# tests for various expansions of $* in different contexts -- word split, +# no splitting, etc. when $IFS is NUL +${THIS_SH} ./dollar-star2.sub + +# tests for expansions of "${array[*]}" and "${array[@]}" when $IFS is not the +# default and the array contains null elements +${THIS_SH} ./dollar-star3.sub + +# test for set -u and expansions of $@ when there are no positional parameters +${THIS_SH} ./dollar-at3.sub +# test for set -u and expansions of $* when there are no positional parameters +${THIS_SH} ./dollar-star4.sub + +# tests for expansions of $* when IFS is null +${THIS_SH} ./dollar-star5.sub + +# tests for inappropriate word splitting through bash-4.2 +${THIS_SH} ./dollar-at4.sub + +# tests for problems with "$@" preceded and followed by other quoted expansions +# through bash-4.2 +${THIS_SH} ./dollar-at5.sub + +# tests for problems with "${@:1}" and other expansions with null entries +# in positional parameters +${THIS_SH} ./dollar-at6.sub + +# tests for expansions of $* when $1 == ""; problem through bash-4.2 +${THIS_SH} ./dollar-star6.sub + +# tests for expansions of $* (unquoted) when IFS changes (e.g., ${IFS:=-}) +# problem through bash-4.2 +${THIS_SH} ./dollar-star7.sub + +exit 0 diff --git a/tests/dollar-at-star1.sub b/tests/dollar-at-star1.sub new file mode 100644 index 0000000..0036915 --- /dev/null +++ b/tests/dollar-at-star1.sub @@ -0,0 +1,23 @@ +# from dan douglas +expassign() +{ + typeset -a a + a=("$@") + typeset var asn + + while IFS= read -r asn; do + IFS=: command eval "$asn" + printf '%-14s... %s\n' "$asn" "$var" + done <<\EOF +var=${a[*]} +var="${a[*]}" +var=$* +var="$*" +var=${a[@]} +var="${a[@]}" +var=$@ +var="$@" +EOF +} + +expassign one:::two three:::four diff --git a/tests/dollar-at1.sub b/tests/dollar-at1.sub new file mode 100644 index 0000000..6d40786 --- /dev/null +++ b/tests/dollar-at1.sub @@ -0,0 +1,29 @@ +echo_argc() +{ + echo $# +} + +a() +{ + shift + echo_argc "$@" + echo_argc ${1:+"$@"} + echo_argc "${1:+$@}" + echo_argc 1 2 3 +} + +b() +{ + _IFS="$IFS" + IFS="$1" + shift + echo_argc "$@" + echo_argc ${1:+"$@"} + echo_argc "${1:+$@}" + echo_argc 1 2 3 + IFS="$_IFS" +} + +a "X" foo bar hoge + +b "X" foo bar hoge diff --git a/tests/dollar-at2.sub b/tests/dollar-at2.sub new file mode 100644 index 0000000..c079a29 --- /dev/null +++ b/tests/dollar-at2.sub @@ -0,0 +1,19 @@ +t1() +{ + xxx="echo $@" + + recho "$xxx ; echo $@" +} + +t2() +{ + xxx="echo $@" + + recho "${xxx} ; echo $@" +} + +t1 1 +t1 1 2 + +t2 1 +t2 1 2 diff --git a/tests/dollar-at3.sub b/tests/dollar-at3.sub new file mode 100644 index 0000000..76a65c1 --- /dev/null +++ b/tests/dollar-at3.sub @@ -0,0 +1,9 @@ +set -u + +echo ${#@} +echo ${@:-bar} + +echo $@ +echo after 1 +echo ${@} +echo after 2 diff --git a/tests/dollar-at4.sub b/tests/dollar-at4.sub new file mode 100644 index 0000000..c8de866 --- /dev/null +++ b/tests/dollar-at4.sub @@ -0,0 +1,10 @@ +set 'a b' 'c d' + +recho "$@" +recho $@ + +quoted="$@" +unquoted=$@ + +recho "$quoted" +recho "$unquoted" diff --git a/tests/dollar-at5.sub b/tests/dollar-at5.sub new file mode 100644 index 0000000..75e2249 --- /dev/null +++ b/tests/dollar-at5.sub @@ -0,0 +1,82 @@ +args() { printf '<%s> ' "$@"; echo; } + +set -- 1 2 3 4 5 + +args "${@} ${1}" +args "${1} ${@}" +args "${1}${@}${1}" +args "${1} ${@} ${1}" +args ${1}"$@"${1} +args "$@"${1} +args ${1}"$@" + +args "$@""${1}" +args "${1}""$@" + +args "${@}foo" +args ${@}${1} +args ${@}foo + +IFS= +args "$@""${1}" +args "${1}""$@" + +args ${@}${1} +args ${1}${@} +args ${@}foo + +echo second set: +IFS=$' \t\n' +set -- '1 2' 3 4 5 + +args "${@} ${1}" +args "${1} ${@}" + +args "${1}${@}${1}" +args "${1} ${@} ${1}" +args ${1}"$@"${1} +args "$@"${1} +args ${1}"$@" + +args "$@""${1}" +args "${1}""$@" + +args "${@}foo" +args ${@}${1} +args ${@}foo + +IFS= + +args "$@""${1}" +args "${1}""$@" + +args ${@}${1} +args ${1}${@} +args ${@}foo + +echo third set: +IFS=$' \t\n' + +alias declare=typeset + +a(){ echo + echo '"${@:2}a3 a2" a$1 #works as long as $1 and 3 are swapped' + echo "${@:2}a3 a2" a$1 + "${@:2}a3 a2" a$1 + echo $? + a=("${@}");} +b(){ echo + echo '"${@:2}b$1 b2" b3 #fails! why?' + echo "${@:2}b$1 b2" b3 + "${@:2}b$1 b2" b3 + echo $? + b=("${@}");} +c(){ echo + echo '${@:2}c$1 c2 c3 #works as long as quoting omitted' + echo ${@:2}c$1 c2 c3 + ${@:2}c$1 c2 c3 + echo $? + c=("${@}");} +a x set y z;declare -p a +b x set y z;declare -p b +c x set y z;declare -p c diff --git a/tests/dollar-at6.sub b/tests/dollar-at6.sub new file mode 100644 index 0000000..039e11f --- /dev/null +++ b/tests/dollar-at6.sub @@ -0,0 +1,30 @@ +set -- ''; + +recho "${@}" x +recho "${@:1}" x + +set -- "${@:1}" +echo "$#" + +set -- '' '' + +recho "${@:1}" x +recho "${@:1:1}" x + +typeset -a A # ksh93 needs this +A=('' '') +recho "${A[@]:0}" x + +recho "${A[@]:0:1}" x + +recho "${A[@]:1}" x + +set -- '' + +recho "${@/foo/bar}" +recho "${@^^[abcde]}" + +A=( '' ) + +recho "${A[@]/foo/bar}" +recho "${A[@],,[abcde]}" diff --git a/tests/dollar-star1.sub b/tests/dollar-star1.sub new file mode 100644 index 0000000..63a9ef8 --- /dev/null +++ b/tests/dollar-star1.sub @@ -0,0 +1,31 @@ +set -- a b c +x=(a b c); IFS='|' + +echo "${*/#/x}" +echo "${x[*]/#/x}" + +echo "$*" +echo "${x[*]}" + +echo "$@" +echo "${x[@]}" + +echo "${@/#/x}" +echo "${x[@]/#/x}" + +echo "${*:1:2}" +echo "${x[*]:1:2}" + +echo "${@:1:2}" +echo "${x[@]:1:2}" + +IFS=$' \t\n' +set -- xa xb xc +x=(xa xb xc) +IFS='|' + +echo "${*#x}" +echo "${x[*]#x}" + +echo "$*" +echo "${x[*]}" diff --git a/tests/dollar-star2.sub b/tests/dollar-star2.sub new file mode 100644 index 0000000..844a297 --- /dev/null +++ b/tests/dollar-star2.sub @@ -0,0 +1,26 @@ +set A B + +IFS= + +x=$* +y="$*" + +recho "$x" +recho "$y" + +IFS=$' \t\n' + +set 'A B' 'C D' + +IFS= + +x=$* +y="$*" + +recho "$x" +recho "$y" + +recho $x +recho $* +recho $y +recho "$*" diff --git a/tests/dollar-star3.sub b/tests/dollar-star3.sub new file mode 100644 index 0000000..8cf4bb2 --- /dev/null +++ b/tests/dollar-star3.sub @@ -0,0 +1,18 @@ +IFS=/ +#file=/mnt/cdrom/RedHat/RPMS +#recho "${file[*]:0:3}" + +i[0]=fooq +i[1]= +i[2]=barq +i[3]= +recho "${i[*]:0}" +recho "${i[@]:0}" + +recho "${i[*]/q/!}" +recho "${i[@]/q/!}" + +recho "${i[*]#?}" +recho "${i[@]#?}" + +# Need to complete this with case-modifying expansion examples diff --git a/tests/dollar-star4.sub b/tests/dollar-star4.sub new file mode 100644 index 0000000..1b551f2 --- /dev/null +++ b/tests/dollar-star4.sub @@ -0,0 +1,9 @@ +set -u + +echo ${#*} +echo ${*:-bar} + +echo $* +echo after 1 +echo ${*} +echo after 2 diff --git a/tests/dollar-star5.sub b/tests/dollar-star5.sub new file mode 100644 index 0000000..8448bf3 --- /dev/null +++ b/tests/dollar-star5.sub @@ -0,0 +1,16 @@ +set -- a b +IFS= + +echo $* +echo "$*" + +a=abcd +echo "${a#$*}" + +case ab in +$*) echo ok 1;; +esac + +case $* in +ab) echo ok 2 ;; +esac diff --git a/tests/dollar-star6.sub b/tests/dollar-star6.sub new file mode 100644 index 0000000..dbd59ec --- /dev/null +++ b/tests/dollar-star6.sub @@ -0,0 +1,19 @@ +recho "A${*:-w}R" +recho "A${*-w}R" +recho "A${*}R" + +set -- "" + +recho "A${*:-w}R" +recho "A${*-w}R" +recho "A${*}R" + +set -- $'\177' + +recho "A${*:+w}R" +recho "A${*+w}R" +recho "A${*}R" + +recho A${*:+w}R +recho A${*+w}R +recho A${*}R diff --git a/tests/dollar-star7.sub b/tests/dollar-star7.sub new file mode 100644 index 0000000..72d6c24 --- /dev/null +++ b/tests/dollar-star7.sub @@ -0,0 +1,30 @@ +# if IFS side effects in ${IFS=} assignments take place, how do you cope with +# later changes to IFS in the same set of expansions? You've already +# committed to using the first character of the (old) IFS to expand $* in +# the previous expansions, and changing it to not include ' ', for instance, +# results in the first couple of ${*} below not being split at all + +set -f -- a b c + +unset -v IFS +printf '<%s> ' ${*}${IFS=}${*}${IFS:=-}"${*}" +echo +printf "after 1: IFS " +echo "${IFS-unset}" +recho "$*" + +set -f -- a 'b c' d +unset -v IFS +printf '<%s> ' ${*}${IFS=}${*}${IFS:=-}"${*}" +echo +printf "after 2: IFS " +echo "${IFS-unset}" +recho "$*" + +unset -v IFS +recho $* +recho "$*" + +IFS=' ' +recho $* +recho "$*" diff --git a/tests/dollar.right b/tests/dollar.right new file mode 100644 index 0000000..6af02b1 --- /dev/null +++ b/tests/dollar.right @@ -0,0 +1,284 @@ +argv[1] = <> +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = <3> +argv[1] = +argv[1] = +argv[1] = +argv[1] = <3> +argv[1] = +argv[1] = +argv[1] = +argv[1] = <3> +argv[1] = +argv[1] = +argv[1] = +argv[1] = <3> +argv[1] = +argv[1] = +argv[1] = +argv[1] = <3> +argv[1] = +argv[1] = +argv[1] = +argv[1] = <3> +argv[1] = +argv[1] = +argv[1] = +argv[1] = <5> +argv[1] = +argv[1] = +argv[1] = +argv[1] = <5> +argv[1] = +argv[1] = +argv[1] = +argv[1] = <1> +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[1] = <3> +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +foo = 1:2:3:4:5:6:7:8:9:10 +bar = 1:2:3:4:5:6:7:8:9:10 +foo1 = 1 2 3 4 5 6 7 8 9 10 +bar1 = 1 2 3 4 5 6 7 8 9 10 +foo2 = 1:2:3:4:5:6:7:8:9:10 +bar2 = 1:2:3:4:5:6:7:8:9:10 +foo3 = 1:2:3:4:5:6:7:8:9:10 +bar3 = 1:2:3:4:5:6:7:8:9:10 +ok 1 +ok 2 +ok 3 +ok 4 +foo = 1 2 3 4 5 6 7 8 9 10 +bar = 1 2 3 4 5 6 7 8 9 10 +foo1 = 1 2 3 4 5 6 7 8 9 10 +bar1 = 1 2 3 4 5 6 7 8 9 10 +foo2 = 1 2 3 4 5 6 7 8 9 10 +bar2 = 1 2 3 4 5 6 7 8 9 10 +foo3 = 1 2 3 4 5 6 7 8 9 10 +bar3 = 1 2 3 4 5 6 7 8 9 10 +ok 1 +ok 2 +ok 3 +ok 4 +var=${a[*]} ... one:::two:three:::four +var="${a[*]}" ... one:::two:three:::four +var=$* ... one:::two:three:::four +var="$*" ... one:::two:three:::four +var=${a[@]} ... one:::two three:::four +var="${a[@]}" ... one:::two three:::four +var=$@ ... one:::two three:::four +var="$@" ... one:::two three:::four +xa|xb|xc +xa|xb|xc +a|b|c +a|b|c +a b c +a b c +xa xb xc +xa xb xc +a|b +b|c +a b +b c +a|b|c +a|b|c +xa|xb|xc +xa|xb|xc +3 +3 +3 +3 +3 +3 +3 +3 +argv[1] = +argv[1] = +argv[2] = <2> +argv[1] = +argv[1] = +argv[2] = <2> +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = <> +argv[3] = +argv[4] = <> +argv[1] = +argv[1] = +argv[2] = <> +argv[3] = +argv[4] = <> +argv[1] = +argv[1] = +argv[2] = <> +argv[3] = +argv[4] = <> +0 +bar + +after 1 + +after 2 +0 +bar + +after 1 + +after 2 +a b +ab +cd +ok 1 +ok 2 +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[1] = +argv[1] = +<1> <2> <3> <4> <5 1> +<1 1> <2> <3> <4> <5> +<11> <2> <3> <4> <51> +<1 1> <2> <3> <4> <5 1> +<11> <2> <3> <4> <51> +<1> <2> <3> <4> <51> +<11> <2> <3> <4> <5> +<1> <2> <3> <4> <51> +<11> <2> <3> <4> <5> +<1> <2> <3> <4> <5foo> +<1> <2> <3> <4> <51> +<1> <2> <3> <4> <5foo> +<1> <2> <3> <4> <51> +<11> <2> <3> <4> <5> +<1> <2> <3> <4> <51> +<11> <2> <3> <4> <5> +<1> <2> <3> <4> <5foo> +second set: +<1 2> <3> <4> <5 1 2> +<1 2 1 2> <3> <4> <5> +<1 21 2> <3> <4> <51 2> +<1 2 1 2> <3> <4> <5 1 2> +<1> <21 2> <3> <4> <51> <2> +<1 2> <3> <4> <51> <2> +<1> <21 2> <3> <4> <5> +<1 2> <3> <4> <51 2> +<1 21 2> <3> <4> <5> +<1 2> <3> <4> <5foo> +<1> <2> <3> <4> <51> <2> +<1> <2> <3> <4> <5foo> +<1 2> <3> <4> <51 2> +<1 21 2> <3> <4> <5> +<1 2> <3> <4> <51 2> +<1 21 2> <3> <4> <5> +<1 2> <3> <4> <5foo> +third set: + +"${@:2}a3 a2" a$1 #works as long as $1 and 3 are swapped +set y za3 a2 ax +0 +declare -a a='([0]="y" [1]="za3 a2" [2]="ax")' + +"${@:2}b$1 b2" b3 #fails! why? +set y zbx b2 b3 +0 +declare -a b='([0]="y" [1]="zbx b2" [2]="b3")' + +${@:2}c$1 c2 c3 #works as long as quoting omitted +set y zcx c2 c3 +0 +declare -a c='([0]="y" [1]="zcx" [2]="c2" [3]="c3")' +argv[1] = <> +argv[2] = +argv[1] = <> +argv[2] = +1 +argv[1] = <> +argv[2] = <> +argv[3] = +argv[1] = <> +argv[2] = +argv[1] = <> +argv[2] = <> +argv[3] = +argv[1] = <> +argv[2] = +argv[1] = <> +argv[2] = +argv[1] = <> +argv[1] = <> +argv[1] = <> +argv[1] = <> +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = + +after 1: IFS - +argv[1] = + +after 2: IFS - +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[1] = diff --git a/tests/dstack.right b/tests/dstack.right new file mode 100644 index 0000000..8f27d28 --- /dev/null +++ b/tests/dstack.right @@ -0,0 +1,55 @@ +./dstack.tests: line 6: pushd: /tmp/xxx-notthere: No such file or directory +./dstack.tests: line 9: pushd: no other directory +./dstack.tests: line 10: popd: directory stack empty +./dstack.tests: line 13: pushd: -m: invalid number +pushd: usage: pushd [-n] [+N | -N | dir] +./dstack.tests: line 14: popd: -m: invalid number +popd: usage: popd [-n] [+N | -N] +./dstack.tests: line 15: dirs: -m: invalid number +dirs: usage: dirs [-clpv] [+N] [-N] +./dstack.tests: line 16: dirs: 7: invalid option +dirs: usage: dirs [-clpv] [+N] [-N] +/ +ok +/usr / +/usr / +/usr / +/usr / +/usr / +/ +/usr / +/etc /usr / +/etc /usr / +/etc /usr / + 0 /etc + 1 /usr + 2 / +/usr /etc / +/etc /usr / +/tmp /etc /usr / +/tmp +/tmp +/usr +/usr +./dstack.tests: line 58: dirs: 9: directory stack index out of range +./dstack.tests: line 58: dirs: 9: directory stack index out of range +./dstack.tests: line 59: pushd: +9: directory stack index out of range +./dstack.tests: line 59: pushd: -9: directory stack index out of range +./dstack.tests: line 60: popd: +9: directory stack index out of range +./dstack.tests: line 60: popd: -9: directory stack index out of range +/tmp /etc / +/tmp /etc / +/tmp /etc / +/tmp /usr /etc / +/tmp +/tmp /usr /etc / +/tmp /usr /etc / +/tmp +/tmp /bin /etc / +/tmp +/tmp /bin / +/tmp +/bin / /tmp +/bin / /tmp +/bin +/bin diff --git a/tests/dstack.tests b/tests/dstack.tests new file mode 100644 index 0000000..49b97d3 --- /dev/null +++ b/tests/dstack.tests @@ -0,0 +1,87 @@ +export LC_ALL=C +export LANG=C + +dirs -c +# error -- nonexistant directory +pushd /tmp/xxx-notthere + +# errors -- empty stack +pushd +popd + +# errors -- bad numeric arguments -- should not cause the script to exit +pushd -m +popd -m +dirs -m +dirs 7 + +MYDIR=$PWD +unalias cd 2>/dev/null + +unalias -a + +command cd -P / +command pwd -P # better be `/' + +case "$OLDPWD" in +$MYDIR) echo ok ;; +*) echo oops -- bad \$OLDPWD ;; +esac + +pushd /usr +echo $PWD $OLDPWD +dirs +echo ${DIRSTACK[@]} + +# this should not change the directory stack at all +pushd -n +0 +dirs + +popd +pushd /usr + +pushd /etc +dirs +dirs -l +dirs -v + +# two consecutive `pushd's should swap the top two stack elements, then +# swap them back, leaving the stack intact +pushd +pushd + +pushd /tmp +echo ${DIRSTACK[0]} ; dirs +0 +echo ${DIRSTACK[2]} ; dirs +2 + +# these should be errors, but not affect the directory stack +dirs +9; dirs -9 +pushd +9 ; pushd -9 +popd +9 ; popd -9 + +popd -n +2 +dirs +echo ${DIRSTACK[@]} + +pushd -n /usr +echo $PWD +dirs +echo ${DIRSTACK[@]} + +builtin pwd + +DIRSTACK[1]=/bin +dirs + +builtin pwd +popd +2 +builtin pwd -L +pushd -1 +dirs +echo ${DIRSTACK[0]} + +dirs -c +dirs + +# this is for the benefit of pure coverage +cd "$MYDIR" diff --git a/tests/dstack2.right b/tests/dstack2.right new file mode 100644 index 0000000..d682a27 --- /dev/null +++ b/tests/dstack2.right @@ -0,0 +1,24 @@ +expect ~1 +~1 +/usr / +/tmp /usr / +/tmp /usr / +these lines should be the same +/tmp +/tmp /tmp +these lines should be the same +/usr +/usr /usr +these lines should be the same +/ +/ / +these lines should be the same +/tmp +/tmp /tmp +these lines should be the same +/usr +/usr /usr + 1 /usr +these lines should be the same +/ +/ / diff --git a/tests/dstack2.tests b/tests/dstack2.tests new file mode 100644 index 0000000..d902bff --- /dev/null +++ b/tests/dstack2.tests @@ -0,0 +1,33 @@ +cd / + +echo expect '~1' +echo ~1 + +pushd /usr +pushd /tmp +dirs + +echo these lines should be the same +dirs +0 +echo ~0 ${DIRSTACK[0]} +echo these lines should be the same +dirs +1 +echo ~1 ${DIRSTACK[1]} +echo these lines should be the same +dirs +2 +echo ~2 ${DIRSTACK[2]} + +NDIRS=$(( ${#DIRSTACK[@]} - 1 )) + +echo these lines should be the same +dirs -2 +echo ~-2 ${DIRSTACK[NDIRS-2]} + +echo these lines should be the same +dirs -1 +echo ~-1 ${DIRSTACK[NDIRS-1]} +dirs -v -1 + +echo these lines should be the same +dirs -0 +echo ~-0 ${DIRSTACK[NDIRS]} diff --git a/tests/errors.right b/tests/errors.right new file mode 100644 index 0000000..63d6b7e --- /dev/null +++ b/tests/errors.right @@ -0,0 +1,113 @@ +./errors.tests: line 17: alias: -x: invalid option +alias: usage: alias [-p] [name[=value] ... ] +./errors.tests: line 18: unalias: -x: invalid option +unalias: usage: unalias [-a] name [name ...] +./errors.tests: line 19: alias: hoowah: not found +./errors.tests: line 20: unalias: hoowah: not found +./errors.tests: line 23: `1': not a valid identifier +declare -fr func +./errors.tests: line 36: func: readonly function +./errors.tests: line 39: unset: -x: invalid option +unset: usage: unset [-f] [-v] [-n] [name ...] +./errors.tests: line 42: unset: func: cannot unset: readonly function +./errors.tests: line 45: declare: func: readonly function +./errors.tests: line 49: unset: XPATH: cannot unset: readonly variable +./errors.tests: line 52: unset: `/bin/sh': not a valid identifier +./errors.tests: line 55: unset: cannot simultaneously unset a function and a variable +./errors.tests: line 58: declare: -z: invalid option +declare: usage: declare [-aAfFgilnrtux] [-p] [name[=value] ...] +./errors.tests: line 60: declare: `-z': not a valid identifier +./errors.tests: line 61: declare: `/bin/sh': not a valid identifier +./errors.tests: line 65: declare: cannot use `-f' to make functions +./errors.tests: line 68: exec: -i: invalid option +exec: usage: exec [-cl] [-a name] [command [arguments ...]] [redirection ...] +./errors.tests: line 72: export: XPATH: not a function +./errors.tests: line 75: break: only meaningful in a `for', `while', or `until' loop +./errors.tests: line 76: continue: only meaningful in a `for', `while', or `until' loop +./errors.tests: line 79: shift: label: numeric argument required +./errors.tests: line 84: shift: too many arguments +./errors.tests: line 90: let: expression expected +./errors.tests: line 93: local: can only be used in a function +./errors.tests: line 96: logout: not login shell: use `exit' +./errors.tests: line 99: hash: notthere: not found +./errors.tests: line 102: hash: -v: invalid option +hash: usage: hash [-lr] [-p pathname] [-dt] [name ...] +./errors.tests: line 106: hash: hashing disabled +./errors.tests: line 109: export: `AA[4]': not a valid identifier +./errors.tests: line 110: readonly: `AA[4]': not a valid identifier +./errors.tests: line 113: [-2]: bad array subscript +./errors.tests: line 117: AA: readonly variable +./errors.tests: line 121: AA: readonly variable +./errors.tests: line 129: shift: 5: shift count out of range +./errors.tests: line 130: shift: -2: shift count out of range +./errors.tests: line 133: shopt: no_such_option: invalid shell option name +./errors.tests: line 134: shopt: no_such_option: invalid shell option name +./errors.tests: line 137: umask: 09: octal number out of range +./errors.tests: line 138: umask: `:': invalid symbolic mode character +./errors.tests: line 139: umask: `:': invalid symbolic mode operator +./errors.tests: line 142: umask: -i: invalid option +umask: usage: umask [-p] [-S] [mode] +./errors.tests: line 146: umask: `u': invalid symbolic mode character +./errors.tests: line 155: VAR: readonly variable +./errors.tests: line 158: declare: VAR: readonly variable +./errors.tests: line 159: declare: VAR: readonly variable +./errors.tests: line 161: declare: unset: not found +./errors.tests: line 164: VAR: readonly variable +./errors.tests: command substitution: line 168: syntax error near unexpected token `)' +./errors.tests: command substitution: line 168: ` for z in 1 2 3; do )' +./errors.tests: command substitution: line 169: syntax error near unexpected token `done' +./errors.tests: command substitution: line 169: ` for z in 1 2 3; done )' +./errors.tests: line 171: cd: HOME not set +./errors.tests: line 172: cd: /tmp/xyz.bash: No such file or directory +./errors.tests: line 174: cd: OLDPWD not set +./errors.tests: line 175: cd: /bin/sh: Not a directory +./errors.tests: line 177: cd: /tmp/cd-notthere: No such file or directory +./errors.tests: line 180: .: filename argument required +.: usage: . filename [arguments] +./errors.tests: line 181: source: filename argument required +source: usage: source filename [arguments] +./errors.tests: line 184: .: -i: invalid option +.: usage: . filename [arguments] +./errors.tests: line 187: set: -q: invalid option +set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...] +./errors.tests: line 190: enable: sh: not a shell builtin +./errors.tests: line 190: enable: bash: not a shell builtin +./errors.tests: line 193: shopt: cannot set and unset shell options simultaneously +./errors.tests: line 196: read: var: invalid timeout specification +./errors.tests: line 199: read: `/bin/sh': not a valid identifier +./errors.tests: line 202: VAR: readonly variable +./errors.tests: line 205: readonly: -x: invalid option +readonly: usage: readonly [-aAf] [name[=value] ...] or readonly -p +./errors.tests: line 208: eval: -i: invalid option +eval: usage: eval [arg ...] +./errors.tests: line 209: command: -i: invalid option +command: usage: command [-pVv] command [arg ...] +./errors.tests: line 212: /bin/sh + 0: syntax error: operand expected (error token is "/bin/sh + 0") +./errors.tests: line 213: /bin/sh + 0: syntax error: operand expected (error token is "/bin/sh + 0") +./errors.tests: line 216: trap: NOSIG: invalid signal specification +./errors.tests: line 219: trap: -s: invalid option +trap: usage: trap [-lp] [[arg] signal_spec ...] +./errors.tests: line 225: return: can only `return' from a function or sourced script +./errors.tests: line 229: break: 0: loop count out of range +./errors.tests: line 233: continue: 0: loop count out of range +./errors.tests: line 238: builtin: bash: not a shell builtin +./errors.tests: line 242: bg: no job control +./errors.tests: line 243: fg: no job control +./errors.tests: line 246: kill: -s: option requires an argument +./errors.tests: line 248: kill: S: invalid signal specification +./errors.tests: line 250: kill: `': not a pid or valid job spec +kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec] +./errors.tests: line 255: set: trackall: invalid option name +./errors.tests: line 259: xx: readonly variable +1 +./errors1.sub: line 1: .: -i: invalid option +.: usage: . filename [arguments] +./errors1.sub: line 9: shift: -4: shift count out of range +./errors1.sub: line 14: break: -1: loop count out of range +after f +./errors2.sub: line 3: ${$NO_SUCH_VAR}: bad substitution +1 +./errors3.sub: line 5: no_such_file: No such file or directory +TEST +./errors3.sub: line 7: no_such_file: No such file or directory +./errors.tests: line 271: `!!': not a valid identifier diff --git a/tests/errors.tests b/tests/errors.tests new file mode 100644 index 0000000..14eeb08 --- /dev/null +++ b/tests/errors.tests @@ -0,0 +1,274 @@ +# These should all be safe +LC_ALL=C +LC_CTYPE=C +LC_COLLATE=C +LC_MESSAGES=C + +# these tests should all generate errors + +# make sure we don't exit prematurely +set +e +set +o posix + +# various alias/unalias errors + +# at some point, this may mean to `export' an alias, like ksh, but +# for now it is an error +alias -x foo=barz +unalias -x fooaha +alias hoowah +unalias hoowah + +# the iteration variable must be a valid identifier +for 1 in a b c; do echo $1; done + +# try to rebind a read-only function +func() +{ + echo func +} +readonly -f func +# make sure `readonly' and `declare' play well together +declare -Fr +func() +{ + echo bar +} + +# bad option +unset -x func + +# cannot unset readonly functions or variables +unset -f func +# or make them not readonly +declare -fr func +declare -f +r func + +XPATH=$PATH +declare -r XPATH +unset -v XPATH + +# cannot unset invalid identifiers +unset /bin/sh + +# cannot unset function and variable at the same time +unset -f -v SHELL + +# bad option +declare -z +# cannot declare invalid identifiers +declare -- -z +declare /bin/sh + +# this is the syntax used to export functions in the environment, but +# it cannot be used with `declare' +declare -f func='() { echo "this is func"; }' + +# bad option to exec -- this should not exit the script +exec -i /bin/sh + +# try to export -f something that is not a function -- this should be +# an error, not create an `invisible function' +export -f XPATH + +# this depends on the setting of BREAK_COMPLAINS in config.h.in +break +continue + +# this should not exit the shell; it did in versions before 2.01 +shift label + +# other shells do not complain about the extra arguments; maybe someday +# we won't either +set -- a b c +shift $# label +# and get rid of the positional parameters +shift $# + +# let without an expression is an error, though maybe it should just return +# success +let + +# local outside a function is an error +local + +# logout of a non-login shell is an error +logout + +# try to hash a non-existant command +hash notthere + +# bad option to hash, although it may mean `verbose' at some future point +hash -v + +# turn off hashing, then try to hash something +set +o hashall +hash -p ${THIS_SH} ${THIS_SH##*/} + +# bad identifiers to declare/readonly/export +export AA[4] +readonly AA[4] + +declare -a AA +unset AA[-2] + +# try to assign to a readonly array +declare -r AA +AA=( one two three ) + +# make sure `readonly -n' doesn't turn off readonly status +readonly -n AA +AA=(one two three) + +# try to assign a readonly array with bad assignment syntax +# NOTE: this works in post-bash-2.05 (at least when I write this) +# readonly -a ZZZ=bbb + +# bad counts to `shift' +shopt -s shift_verbose +shift $(( $# + 5 )) +shift -2 + +# bad shell options +shopt -s no_such_option +shopt no_such_option + +# non-octal digits for umask and other errors +umask 09 +umask -S u=rwx:g=rwx:o=rx >/dev/null # 002 +umask -S u:rwx,g:rwx,o:rx >/dev/null # 002 + +# at some point, this may mean `invert', but for now it is an error +umask -i + +# bad assignments shouldn't change the umask +mask=$(umask) +umask g=u +mask2=$(umask) +if [ "$mask" != "$mask2" ]; then + echo "umask errors change process umask" +fi + +# assignment to a readonly variable in environment +VAR=4 +readonly VAR +VAR=7 : + +# more readonly variable tests +declare VAR=88 +declare +r VAR + +declare -p unset + +# iteration variable in a for statement being readonly +for VAR in 1 2 3 ; do echo $VAR; done + +# parser errors +: $( for z in 1 2 3; do ) +: $( for z in 1 2 3; done ) + +# various `cd' errors +( unset HOME ; cd ) +( HOME=/tmp/xyz.bash ; cd ) +# errors from cd +cd - +cd /bin/sh # error - not a directory +OLDPWD=/tmp/cd-notthere +cd - + +# various `source/.' errors +. +source + +# maybe someday this will work like in rc +. -i /dev/tty + +# make sure that this gives an error rather than setting $1 +set -q + +# enable non-builtins +enable sh bash + +# try to set and unset shell options simultaneously +shopt -s -u checkhash + +# this is an error -- bad timeout spec +read -t var < /dev/null + +# try to read into an invalid identifier +read /bin/sh < /dev/null + +# try to read into a readonly variable +read VAR < /dev/null + +# bad option to readonly/export +readonly -x foo + +# someday these may mean something, but for now they're errors +eval -i "echo $-" +command -i "echo $-" + +# this caused a core dump in bash-2.01 (fixed in bash-2.01.1) +eval echo \$[/bin/sh + 0] +eval echo '$((/bin/sh + 0))' + +# error to list trap for an unknown signal +trap -p NOSIG + +# maybe someday trap will take a -s argument like kill, but not now +trap -p -s NOSIG + +# we have a ksh-like ERR trap, post-bash-2.05 +#trap 'echo [$LINENO] -- error' ERR + +# can only return from a function or sourced script +return 2 + +# break and continue with arguments <= 0 +for z in 1 2 3; do + break 0 + echo $x +done +for z in 1 2 3; do + continue 0 + echo $x +done + +# builtin with non-builtin +builtin bash + +# maybe someday you will be able to use fg/bg when job control is not really +# active, but for now they are errors +bg +fg + +# argument required +kill -s +# bad argument +kill -S +# null argument +kill -INT '' +# argument required +kill -INT + +# bad shell option names +set -o trackall # bash is not ksh + +# problem with versions through bash-4.2 +readonly xx=5 +echo $((xx=5)) +echo $? + +${THIS_SH} ./errors1.sub +${THIS_SH} ./errors2.sub +${THIS_SH} ./errors3.sub + +# this must be last! +# in posix mode, a function name must be a valid identifier +# this can't go in posix2.tests, since it causes the shell to exit +# immediately +set -o posix +function !! () { fc -s "$@" ; } +set +o posix + +echo end diff --git a/tests/errors1.sub b/tests/errors1.sub new file mode 100644 index 0000000..8e7440b --- /dev/null +++ b/tests/errors1.sub @@ -0,0 +1,27 @@ +. -i /dev/tty + +f() +{ + return -1 +} + +set -- a b c +shift -4 + +f + +for f in 1 2 3; do + break -1 +done + + +f() +{ + return -25 +} + +f +echo after f +exit -25 + +exit -56 diff --git a/tests/errors2.sub b/tests/errors2.sub new file mode 100644 index 0000000..79ef333 --- /dev/null +++ b/tests/errors2.sub @@ -0,0 +1,3 @@ +set -e +trap 'echo $?' EXIT +echo ${$NO_SUCH_VAR} # Bad substitution expected here diff --git a/tests/errors3.sub b/tests/errors3.sub new file mode 100644 index 0000000..b2ae3d7 --- /dev/null +++ b/tests/errors3.sub @@ -0,0 +1,7 @@ +# redirection errors with special builtins should exit the shell when in +# Posix mode, not otherwise; being on the LHS of || or && should not make +# a difference + +exec 9 /dev/null 2>&1 ) +echo $? +( ! ls > /dev/null 2>&1 ) +echo $? + +touch /tmp/notwrite +chmod 400 /tmp/notwrite + +# make sure redirection failures in commands whose exit status is inverted +# are handled correctly + +( ls > /tmp/notwrite ) 2>/dev/null +echo $? + +( ! ls > /tmp/notwrite ) 2>/dev/null +echo $? + +# now add exit traps, true and false for commands with and without exit +# status inversion + +(trap 'false' 0 ; ! ls > /tmp/notwrite ) 2>/dev/null +echo $? + +(trap 'false' 0 ; ls > /tmp/notwrite ) 2>/dev/null +echo $? + +(trap 'true' 0 ; ! ls > /tmp/notwrite ) 2>/dev/null +echo $? + +(trap 'true' 0 ; ls > /tmp/notwrite ) 2>/dev/null +echo $? + +rm -f /tmp/notwrite diff --git a/tests/exec7.sub b/tests/exec7.sub new file mode 100644 index 0000000..ea2fd06 --- /dev/null +++ b/tests/exec7.sub @@ -0,0 +1,20 @@ +# make sure that bash really checks the right things when deciding what +# constitutes an executable file + +[ $UID -eq 0 ] && { echo "exec7.sub: the test suite should not be run as root" >&2 ; } + +: ${TMPDIR:=/tmp} + +cd $TMPDIR || { echo "cannot cd to $TMPDIR" >&2 ; exit 2; } + +mkdir testa testb + +echo 'echo "testa"' > testa/foo +echo 'echo "testb"' > testb/foo + +chmod 655 testa/foo +chmod 755 testb/foo + +PATH=$TMPDIR/testa:$TMPDIR/testb $THIS_SH -c foo + +rm -rf testa testb diff --git a/tests/exec8.sub b/tests/exec8.sub new file mode 100644 index 0000000..014726d --- /dev/null +++ b/tests/exec8.sub @@ -0,0 +1 @@ +shopt expand_aliases diff --git a/tests/exec9.sub b/tests/exec9.sub new file mode 100644 index 0000000..b8d20b4 --- /dev/null +++ b/tests/exec9.sub @@ -0,0 +1,20 @@ +# make sure commands before the last one in the pipeline can't change $? +false +false | echo $? +false +(false) | echo $? + +false +true | echo $? +false +(true) | echo $? + +true +false | echo $? +true +(false) | echo $? + +true +true | echo $? +true +(true) | echo $? diff --git a/tests/execscript b/tests/execscript new file mode 100644 index 0000000..5a4e903 --- /dev/null +++ b/tests/execscript @@ -0,0 +1,127 @@ +export LC_ALL=C +export LANG=C + +if [ $UID -eq 0 ]; then + echo "execscript: the test suite should not be run as root" >&2 +fi + +set -- one two three +echo before exec1.sub: "$@" +echo calling exec1.sub +./exec1.sub aa bb cc dd ee +echo after exec1.sub with args: $? +./exec1.sub +echo after exec1.sub without args: $? +echo after exec1.sub: "$@" + +# set up a fixed path so we know notthere will not be found +PATH=/usr/bin:/bin:/usr/local/bin: +export PATH + +notthere +echo $? + +# this is iffy, since the error messages may vary from system to system +# and /tmp might not exist +ln -s ${THIS_SH} /tmp/bash 2>/dev/null +if [ -f /tmp/bash ]; then + /tmp/bash notthere +else + ${THIS_SH} notthere +fi +echo $? +rm -f /tmp/bash + +# /bin/sh should be there on all systems +${THIS_SH} /bin/sh +echo $? + +# try executing a directory +/ +echo $? + +${THIS_SH} / +echo $? + +# try sourcing a directory +. / +echo $? + +# try sourcing a binary file -- post-2.04 versions don't do the binary file +# check, and will probably fail with `command not found', or status 127 +# bash-4.1 and later check for 256 NUL characters and fail as binary files +# if there are more than that, it's probably binary +. ${THIS_SH} 2>/dev/null +echo $? + +# post-bash-2.05 versions allow sourcing non-regular files +. /dev/null +echo $? + +# kill two birds with one test -- test out the BASH_ENV code +echo echo this is bashenv > /tmp/bashenv +export BASH_ENV=/tmp/bashenv +${THIS_SH} ./exec3.sub +rm -f /tmp/bashenv +unset BASH_ENV + +# we're resetting the $PATH to empty, so this should be last +PATH= + +notthere +echo $? + +command notthere +echo $? + +command -p notthere +echo $? + +# but -p should guarantee that we find all the standard utilities, even +# with an empty or unset $PATH +command -p sh -c 'echo this is $0' +unset PATH +command -p sh -c 'echo this is $0' + +# a bug in bash before bash-2.01 caused PATH to be set to the empty string +# when command -p was run with PATH unset +echo ${PATH-unset} + +echo "echo ok" | ${THIS_SH} -t + +${THIS_SH} ./exec2.sub +echo $? + +${THIS_SH} ./exec4.sub + +# try exec'ing a command that cannot be found in $PATH +${THIS_SH} ./exec5.sub + +# this was a bug in bash versions before bash-2.04 +${THIS_SH} -c 'cat /dev/null' >&- + +# checks for proper return values in subshell commands with inverted return +# values + +${THIS_SH} ./exec6.sub + +# checks for properly deciding what constitutes an executable file +${THIS_SH} ./exec7.sub + +${THIS_SH} -i ./exec8.sub + +${THIS_SH} ./exec9.sub + +true | `echo true` & + +echo after + +# Problem with bash at least back to version 3.0 +${THIS_SH} -c 'VAR=0; VAR=1 command exec; exit ${VAR}' + +# problem with bash through bash-4.1 +( + exec /var/empty/nosuch + echo bad +) 2>/dev/null +[ $? = 127 ] || echo FAIL: bad exit status $? at $LINENO diff --git a/tests/exp.right b/tests/exp.right new file mode 100644 index 0000000..c027036 --- /dev/null +++ b/tests/exp.right @@ -0,0 +1,207 @@ +argv[1] = <^A> +argv[1] = <^A> +argv[1] = <^?> +argv[1] = <^?> +argv[1] = <^A> +argv[1] = <^?> +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = < > +argv[1] = <--> +argv[1] = <> +argv[1] = <> +argv[1] = <> +argv[1] = <> +argv[1] = <> +argv[1] = <> +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = <^A> +argv[1] = <^?> +argv[1] = <^A> +argv[1] = <^?> +argv[1] = <^A> +argv[1] = <^?> +argv[1] = <> +argv[1] = <> +argv[1] = <> +argv[1] = +argv[1] = <`> +argv[1] = <"> +argv[1] = <\^A> +argv[1] = <\$> +argv[1] = <\\> +argv[1] = +argv[2] = +argv[1] = <^A> +argv[2] = <^?> +argv[1] = <**> +argv[1] = <\.\./*/> +argv[1] = <^A^?^A^?> +argv[1] = <^A^A> +argv[1] = <^A^?> +argv[1] = <^A^A^?> +argv[1] = < abc> +argv[2] = +argv[3] = +argv[4] = +argv[1] = < abc> +argv[2] = +argv[3] = +argv[4] = +argv[1] = <--abc> +argv[2] = +argv[3] = +argv[4] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[1] = < > +argv[1] = < - > +argv[1] = +argv[1] = +argv[1] = +argv[2] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = <10> +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = <\$x> +argv[1] = <$x> +argv[1] = <\$x> +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[1] = +argv[1] = +argv[2] = <> +argv[3] = +argv[4] = <> +argv[5] = +argv[1] = <$foo> +argv[1] = <10> +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = <5> +argv[2] = <5> +argv[1] = <3> +argv[1] = <1> +argv[1] = <1> +argv[1] = <5> +argv[1] = <5> +argv[1] = <5> +argv[1] = <5> +argv[1] = <42> +argv[1] = <26> +argv[1] = <\> +argv[1] = <~> +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +a?b?c +a b c +argv[1] = <^?> +argv[1] = <^?> +argv[1] = <^?> +argv[1] = <^?> +argv[1] = <^?> +argv[1] = <^?> +argv[1] = <^A> +argv[2] = <^?> +argv[1] = <^A^?> +argv[1] = <^A^?^A^?> +argv[1] = <^A^A^?> +0.net +0.net0 + +0.net +0.net +0.net +graph +yes +a +a + val +val + val +no arg passed +hello +[0;31m\] +] +[hello +\[\e[0;31m\] + +hello +eo +argv[1] = +argv[1] = +argv[1] = <^?> +argv[1] = <^?b> +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = <> +argv[1] = +argv[2] = <> +argv[1] = +argv[2] = <> +argv[1] = +argv[2] = <> +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = diff --git a/tests/exp.tests b/tests/exp.tests new file mode 100644 index 0000000..9f77a7f --- /dev/null +++ b/tests/exp.tests @@ -0,0 +1,392 @@ +# +# A suite of tests for bash word expansions +# +# This tests parameter and variable expansion, with an empahsis on +# proper quoting behavior. +# +# Chet Ramey + +# +# If you comment out the body of this function, you can do a diff against +# `expansion-tests.right' to see if the shell is behaving correctly +# +expect() +{ + echo expect "$@" +} + +# Test the substitution quoting characters (CTLESC and CTLNUL) in different +# combinations + +expect "<^A>" +recho `echo ''` +expect "<^A>" +recho `echo ""` +expect "<^?>" +recho `echo ''` +expect "<^?>" +recho `echo ""` +expect "<^A>" +recho `echo ` +expect "<^?>" +recho `echo ` + +# Test null strings without variable expansion +expect "" +recho abcd""efgh +expect "" +recho abcd''efgh +expect "" +recho ""abcdefgh +expect "" +recho ''abcdefgh +expect "" +recho abcd"" +expect "" +recho abcd'' + +# Test the quirky behavior of $@ in "" +expect nothing +recho "$@" +expect "< >" +recho " $@" +expect "<-->" +recho "-${@}-" + +# Test null strings with variable expansion that fails +expect '<>' +recho $xxx"" +expect '<>' +recho ""$xxx +expect '<>' +recho $xxx'' +expect '<>' +recho ''$xxx +expect '<>' +recho $xxx""$yyy +expect '<>' +recho $xxx''$yyy + +# Test null strings with variable expansion that succeeds +xxx=abc +yyy=def + +expect '' +recho $xxx"" +expect '' +recho ""$xxx +expect '' +recho $xxx'' +expect '' +recho ''$xxx +expect '' +recho $xxx""$yyy +expect '' +recho $xxx''$yyy + +unset xxx yyy + +# Test the unquoted special quoting characters +expect "<^A>" +recho  +expect "<^?>" +recho  +expect "<^A>" +recho "" +expect "<^?>" +recho "" +expect "<^A>" +recho '' +expect "<^?>" +recho '' + +# Test expansion of a variable that is unset +expect nothing +recho $xxx +expect '<>' +recho "$xxx" + +expect nothing +recho "$xxx${@}" + +# Test empty string expansion +expect '<>' +recho "" +expect '<>' +recho '' + +# Test command substitution with (disabled) history substitution +expect '' +# set +H +recho "`echo \"Hello world!\"`" + +# Test some shell special characters +expect '<`>' +recho "\`" +expect '<">' +recho "\"" +expect '<\^A>' +recho "\" + +expect '<\$>' +recho "\\$" + +expect '<\\>' +recho "\\\\" + +# This should give argv[1] = a argv[2] = b +expect ' ' +FOO=`echo 'a b' | tr ' ' '\012'` +recho $FOO + +# This should give argv[1] = ^A argv[2] = ^? +expect '<^A> <^?>' +FOO=`echo ' ' | tr ' ' '\012'` +recho $FOO + +# Test quoted and unquoted globbing characters +expect '<**>' +recho "*"* + +expect '<\.\./*/>' +recho "\.\./*/" + +# Test patterns that come up when the shell quotes funny character +# combinations +expect '<^A^?^A^?>' +recho '' +expect '<^A^A>' +recho '' +expect '<^A^?>' +recho '' +expect '<^A^A^?>' +recho '' + +# More tests of "$@" +set abc def ghi jkl +expect '< abc> ' +recho " $@ " +expect '< abc> ' +recho "${1+ $@ }" + +set abc def ghi jkl +expect '<--abc> ' +recho "--$@--" + +set "a b" cd ef gh +expect ' ' +recho ${1+"$@"} +expect ' ' +recho ${foo:-"$@"} +expect ' ' +recho "${@}" + +expect '< >' +recho " " +expect '< - >' +recho " - " + +# Test combinations of different types of quoting in a fully-quoted string +# (so the WHOLLY_QUOTED tests fail and it doesn't get set) +expect '' +recho "/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*"'$'"/\1/" + +# Test the various Posix parameter expansions + +expect '' +recho "${x:-$(echo "foo bar")}" +expect ' ' +recho ${x:-$(echo "foo bar")} + +unset X +expect '' +recho ${X:=abc} +expect '' +recho $X + +set a b c +expect '' +recho ${3:+posix} + +POSIX=/usr/posix +expect '<10>' +recho ${#POSIX} + +# remove shortest trailing match +x=file.c +expect '' +recho ${x%.c}.o + +# remove longest trailing match +x=posix/src/std +expect '' +recho ${x%%/*} + +# remove shortest leading pattern +x=$HOME/src/cmd +expect '' +recho ${x#$HOME} + +# remove longest leading pattern +x=/one/two/three +expect '' +recho ${x##*/} + +# pattern removal of patterns that don't match +z=abcdef + +expect '' +recho ${z#xyz} +expect '' +recho ${z##xyz} + +expect '' +recho ${z%xyz} +expect '' +recho ${z%%xyz} + +# Command substitution and the quirky differences between `` and $() + +expect '<\$x>' +recho '\$x' + +expect '<$x>' +recho `echo '\$x'` + +expect '<\$x>' +recho $(echo '\$x') + +# The difference between $* "$*" and "$@" + +set "abc" "def ghi" "jkl" + +expect ' ' +recho $* + +expect '' +recho "$*" + +OIFS="$IFS" +IFS=":$IFS" + +# The special behavior of "$*", using the first character of $IFS as separator +expect '' +recho "$*" + +IFS="$OIFS" + +expect ' ' +recho "$@" + +expect ' ' +recho "xx$@yy" + +expect ' ' +recho "$@$@" + +foo=abc +bar=def + +expect '' +recho "$foo""$bar" + +unset foo +set $foo bar '' xyz "$foo" abc + +expect ' <> <> ' +recho "$@" + +# More tests of quoting and deferred evaluation + +foo=10 x=foo +y='$'$x +expect '<$foo>' +recho $y +eval y='$'$x +expect '<10>' +recho $y + +# case statements + +NL=' +' +x='ab +cd' + +expect '' +case "$x" in +*$NL*) recho "newline expected" ;; +esac + +expect '' +case \? in +*"?"*) recho "got it" ;; +esac + +expect '' +case \? in +*\?*) recho "got it" ;; +esac + +set one two three four five +expect ' ' +recho $1 $3 ${5} $8 ${9} + +# length tests on positional parameters and some special parameters + +expect '<5> <5>' +recho $# ${#} +expect '<3>' +recho ${#1} +expect '<1>' +recho ${##} +expect '<1>' +recho ${#?} +expect '<5>' +recho ${#@} +expect '<5>' +recho ${#*} +expect '<5>' +recho "${#@}" +expect '<5>' +recho "${#*}" + +expect '<42>' +recho $((28 + 14)) +expect '<26>' +recho $[ 13 * 2 ] + +expect '<\>' +recho `echo \\\\` + +expect '<~>' +recho '~' + +expect nothing +recho $! +expect nothing +recho ${!} + +# test word splitting of assignment statements not preceding a command +a="a b c d e" +declare b=$a +expect ' ' +recho $b + +a="a?b?c" + +echo ${a//\\?/ } + +echo ${a//\?/ } + +${THIS_SH} ./exp1.sub + +${THIS_SH} ./exp2.sub + +${THIS_SH} ./exp3.sub + +${THIS_SH} ./exp4.sub + +${THIS_SH} ./exp5.sub + +${THIS_SH} ./exp6.sub diff --git a/tests/exp1.sub b/tests/exp1.sub new file mode 100644 index 0000000..3e40f2a --- /dev/null +++ b/tests/exp1.sub @@ -0,0 +1,21 @@ +# Test the substitution quoting characters (CTLESC and CTLNUL) in different +# combinations + +recho `echo ''` +recho `echo ""` +recho `echo ` + +# Test the unquoted special quoting characters +recho  +recho "" +recho '' + +# This should give argv[1] = ^A argv[2] = ^? +FOO=`echo ' ' | tr ' ' '\012'` +recho $FOO + +# Test patterns that come up when the shell quotes funny character +# combinations +recho '' +recho '' +recho '' diff --git a/tests/exp2.sub b/tests/exp2.sub new file mode 100644 index 0000000..a70179e --- /dev/null +++ b/tests/exp2.sub @@ -0,0 +1,12 @@ +K=dvb0.net A=${K#dvb} eval echo \$A +unset K A +x=${K:=dvb0.net0} A=${K#dvb} eval echo \$A + +unset K A +K=dvb0.net A=${K#dvb} echo "$A" +unset K A +K=dvb0.net A=${K#dvb} ; echo "$A" +unset K A +K=dvb0.net A=${K#dvb} eval echo '$A' +unset K A +K=dvb0.net A=${K#dvb} eval echo \$A diff --git a/tests/exp3.sub b/tests/exp3.sub new file mode 100644 index 0000000..212d579 --- /dev/null +++ b/tests/exp3.sub @@ -0,0 +1,7 @@ +IFS=: + +case A in ([[:graph:]]) echo graph;; *) echo non-graph;; esac +[[ A == [[:graph:]] ]] && echo yes || echo no + +IFS="~"; read a b <<< a~q; echo $a +IFS=':'; read a b <<< a:q; echo $a diff --git a/tests/exp4.sub b/tests/exp4.sub new file mode 100644 index 0000000..d022ceb --- /dev/null +++ b/tests/exp4.sub @@ -0,0 +1,10 @@ +f=" val" e= +echo "$e"$f +echo $e$f +echo "$e""$f" + +if [[ "$1"x == x ]] ; then + echo "no arg passed" + exit 1 +fi +echo "$1"x | cat -v diff --git a/tests/exp5.sub b/tests/exp5.sub new file mode 100644 index 0000000..9346b57 --- /dev/null +++ b/tests/exp5.sub @@ -0,0 +1,22 @@ +# expansions involving patterns + +var='[hello' +echo "${var//[/}" + +red='\[\e[0;31m\]' +echo "${red//\\[\\e/}" + +foo="${red//\\[\\e/}" + +# foo == [0;31m\] +echo "${foo//[0;31m\\/}" + +echo "${var//[]/}" +echo "${red//[]/}" + +v=hello +foo='[:alpha:]' + +echo ${v//[[:alpha:]]/} +echo ${v//[[:alpha]]/} +echo ${v//[[:alpha]/} diff --git a/tests/exp6.sub b/tests/exp6.sub new file mode 100644 index 0000000..a1c9fe6 --- /dev/null +++ b/tests/exp6.sub @@ -0,0 +1,30 @@ +recho """"a +recho a"""" + +recho """" + +recho """"b +recho b"""" + +recho """"""c +recho c"""""" + +recho """"""c"""" +recho """"c"""""" + +recho """"""""c +recho c"""""""" + +# BASH BUG: spurious DEL characters appear on empty variable interpolation. +# BASH 4.2.8(1)-release + +a='' + +recho correct "$a" # correct empty output line +recho correct "$a""$a" # correct empty output line +recho correct "$a""$a""$a" # correct empty output line +recho XwrongX "$a""$a""$a""$a" # spurious two DEL chars appear at line end +recho correct a"$a" # correct single "a" on line +recho XwrongX a"$a""$a" # spurious DEL char appears at line end +recho correct a"$a$a" # correct single "a" on line +recho correct a"$a$a$a$a" # correct single "a" on line diff --git a/tests/extglob.right b/tests/extglob.right new file mode 100644 index 0000000..837ccc2 --- /dev/null +++ b/tests/extglob.right @@ -0,0 +1,94 @@ +ok 1 +ok 2 +ok 3 +ok 4 +ok 5 +ok 6 +ok 7 +ok 8 +ok 9 +ok 10 +ok 11 +ok 12 +ok 13 +ok 14 +ok 15 +ok 16 +ok 17 +ok 18 +ok 19 +ok 20 +ok 21 +ok 22 +ok 23 +ok 24 +ok 25 +ok 26 +ok 27 +ok 28 +ok 29 +ok 30 +ok 31 +ok 32 +ok 33 +ok 34 +ok 35 +ok 36 +!([*)* ++(a|b[)* +[a*(]*)z ++()c ++()x +abc ++(*)x +abc +no-file+(a|b)stuff +no-file+(a*(c)|b)stuff +abd acd +acd +abd +no +yes +yes +1: bcdef +2: def +3: abcde +4: abc +5: ef +6: ef +7: abcdef +ab abef +abcfef abef +abcdef +ab abcdef abcfef abef +abcdef abcfef abef +ok 37 +ok 38 +ok 39 +ok 40 +ok 41 +ok 42 +a b a,b a-b a.b a:b a;b a_b +a b a,b a-b a.b a:b a;b a_b +a b a,b a-b a.b a:b a;b a_b +a b a,b a-b a.b a:b a;b a_b +a.b +a b a,b a-b a:b a;b a_b +a b a,b a-b a.b a:b a;b a_b +a b a,b a-b a.b a:b a;b a_b +a b a,b a-b a.b a:b a;b a_b +argv[1] = +a,b +a.c +a.c +a.c +a.c +a.c +a.c +ok 1 +ok 2 +ok 3 +a ab +a ab +a ab +a diff --git a/tests/extglob.tests b/tests/extglob.tests new file mode 100644 index 0000000..0fa310a --- /dev/null +++ b/tests/extglob.tests @@ -0,0 +1,373 @@ +# test the ksh-like extended globbing features: [!@*?+](patlist) + +shopt -s extglob + +expect() +{ + echo expect "$@" +} + +case "/dev/udp/129.22.8.102/45" in +/dev/@(tcp|udp)/*/*) echo ok 1;; +*) echo bad 1;; +esac + +# valid numbers +case 12 in +0|[1-9]*([0-9])) echo ok 2;; +*) echo bad 2;; +esac + +case 12abc in +0|[1-9]*([0-9])) echo bad 3;; +*) echo ok 3;; +esac + +case 1 in +0|[1-9]*([0-9])) echo ok 4;; +*) echo bad 4;; +esac + +# octal numbers +case 07 in ++([0-7])) echo ok 5;; +*) echo bad 5;; +esac + +case 0377 in ++([0-7])) echo ok 6;; +*) echo bad 6;; +esac + +case 09 in ++([0-7])) echo bad 7;; +*) echo ok 7;; +esac + +# stuff from korn's book +case paragraph in +para@(chute|graph)) echo ok 8;; +*) echo bad 8;; +esac + +case paramour in +para@(chute|graph)) echo bad 9;; +*) echo ok 9;; +esac + +case para991 in +para?([345]|99)1) echo ok 10;; +*) echo bad 10;; +esac + +case para381 in +para?([345]|99)1) echo bad 11;; +*) echo ok 11;; +esac + +case paragraph in +para*([0-9])) echo bad 12;; +*) echo ok 12;; +esac + +case para in +para*([0-9])) echo ok 13;; +*) echo bad 13;; +esac + +case para13829383746592 in +para*([0-9])) echo ok 14;; +*) echo bad 14;; +esac + +case paragraph in +para*([0-9])) echo bad 15;; +*) echo ok 15;; +esac + +case para in +para+([0-9])) echo bad 16;; +*) echo ok 16;; +esac + +case para987346523 in +para+([0-9])) echo ok 17;; +*) echo bad 17;; +esac + +case paragraph in +para!(*.[0-9])) echo ok 18;; +*) echo bad 18;; +esac + +case para.38 in +para!(*.[0-9])) echo ok 19;; +*) echo bad 19;; +esac + +case para.graph in +para!(*.[0-9])) echo ok 20;; +*) echo bad 20;; +esac + +case para39 in +para!(*.[0-9])) echo ok 21;; +*) echo bad 21;; +esac + +# tests derived from those in rosenblatt's korn shell book + +case "" in +*(0|1|3|5|7|9)) echo ok 22;; +*) echo bad 22; +esac + +case 137577991 in +*(0|1|3|5|7|9)) echo ok 23;; +*) echo bad 23; +esac + +case 2468 in +*(0|1|3|5|7|9)) echo bad 24;; +*) echo ok 24; +esac + +case file.c in +*.c?(c)) echo ok 25;; +*) echo bad 25;; +esac + +case file.C in +*.c?(c)) echo bad 26;; +*) echo ok 26;; +esac + +case file.cc in +*.c?(c)) echo ok 27;; +*) echo bad 27;; +esac + +case file.ccc in +*.c?(c)) echo bad 28;; +*) echo ok 28;; +esac + +case parse.y in +!(*.c|*.h|Makefile.in|config*|README)) echo ok 29;; +*) echo bad 29;; +esac + +case shell.c in +!(*.c|*.h|Makefile.in|config*|README)) echo bad 30;; +*) echo ok 30;; +esac + +case Makefile in +!(*.c|*.h|Makefile.in|config*|README)) echo ok 31;; +*) echo bad 31;; +esac + +case "VMS.FILE;1" in +*\;[1-9]*([0-9])) echo ok 32;; +*) echo bad 32;; +esac + +case "VMS.FILE;0" in +*\;[1-9]*([0-9])) echo bad 33;; +*) echo ok 33;; +esac +case "VMS.FILE;" in +*\;[1-9]*([0-9])) echo bad 34;; +*) echo ok 34;; +esac +case "VMS.FILE;139" in +*\;[1-9]*([0-9])) echo ok 35;; +*) echo bad 35;; +esac +case "VMS.FILE;1N" in +*\;[1-9]*([0-9])) echo bad 36;; +*) echo ok 36;; +esac + +# tests derived from the pd-ksh test suite + +MYDIR=$PWD # save where we are + +: ${TMPDIR:=/var/tmp} +TESTDIR=$TMPDIR/eglob-test-$$ +mkdir $TESTDIR +builtin cd $TESTDIR || { echo $0: cannot cd to $TESTDIR >&2 ; exit 1; } +rm -rf * + +touch abcx abcz bbc +expect '!([*)*' +echo !([*)* + +expect '+(a|b[)*' +echo +(a|b[)* + +expect '[a*(]*z' +echo [a*(]*)z + +rm -f abcx abcz bbc + +touch abc + +expect '+()c' +echo +()c +expect '+()x' +echo +()x +expect abc +echo +(*)c +expect '+(*)x' +echo +(*)x + +# extended globbing should not be performed on the output of substitutions +x='@(*)' +expect '@(*)' +echo $x + +expect 'no-file+(a|b)stuff' +echo no-file+(a|b)stuff +expect 'no-file+(a*(c)|b)stuff' +echo no-file+(a*(c)|b)stuff + +touch abd acd + +expect 'abd acd' +echo a+(b|c)d + +expect 'acd' +echo a!(@(b|B))d + +expect 'abd' +echo a[b*(foo|bar)]d + +# simple kleene star tests +expect no +case foo in *(a|b[)) echo yes;; *) echo no;; esac + +expect yes +case foo in *(a|b[)|f*) echo yes;; *) echo no;; esac + +# this doesn't work right yet; it is an incorrectly formed pattern +expect yes +case '*(a|b[)' in *(a|b[)) echo yes;; *) echo no;; esac + +# check extended globbing in pattern removal -- these don't work right yet +x=abcdef + +expect '1: bcdef' +echo 1: ${x#+(a|abc)} +expect '2: def' +echo 2: ${x##+(a|abc)} +expect '3: abcde' +echo 3: ${x%+(def|f)} +expect '4: abc' +echo 4: ${x%%+(f|def)} + +# these work ok + +expect '5: ef' +echo 5: ${x#*(a|b)cd} +expect '6: ef' +echo 6: "${x#*(a|b)cd}" +expect '7: abcdef' +echo 7: ${x#"*(a|b)cd"} + +# More tests derived from a bug report concerning extended glob patterns +# following a * +builtin cd $TESTDIR || { echo $0: cannot cd to $TESTDIR >&2 ; exit 1; } +rm -rf * + +touch ab abcdef abef abcfef + +expect 'ab abef' +echo ab*(e|f) + +expect 'abcfef abef' +echo ab?*(e|f) + +expect abcdef +echo ab*d+(e|f) + +expect 'ab abcdef abcfef abef' +echo ab**(e|f) + +expect 'abcdef abcfef abef' +echo ab*+(e|f) + +case 'abcfefg' in +ab**(e|f)) echo ok 37;; +*) echo bad 37;; +esac + +case 'abcfefg' in +ab**(e|f)g) echo ok 38;; +*a) echo bad 38;; +esac + +case ab in +ab*+(e|f)) echo bad 39;; +*) echo ok 39;; +esac + +case abef in +ab***ef) echo ok 40;; +*) echo bad 40;; +esac + +case abef in +ab**) echo ok 41;; +*) echo bad 41;; +esac + +# bug in all versions up to and including bash-2.05b +case "123abc" in +*?(a)bc) echo ok 42;; +*) echo bad 42;; +esac + +# clean up and do the next one + +builtin cd / +rm -rf $TESTDIR + +mkdir $TESTDIR +builtin cd $TESTDIR + +LC_COLLATE=C # have to set this; it affects the sorting +touch a.b a,b a:b a-b a\;b a\ b a_b + +echo a[^[:alnum:]]b +echo a[-.,:\;\ _]b + +echo a@([^[:alnum:]])b +echo a@([-.,:; _])b +echo a@([.])b +echo a@([^.])b +echo a@([^x])b +echo a+([^[:alnum:]])b + +echo a@(.|[^[:alnum:]])b + +builtin cd / +rm -rf $TESTDIR + +x=abcdef +recho "${x#*(a|b)cd}" + +TEST='a , b' +shopt -s globstar +echo ${TEST//*([[:space:]]),*([[:space:]])/,} +shopt -u globstar + +# this is for the benefit of pure coverage, so it writes the pcv file +# in the right place +builtin cd "$MYDIR" + +${THIS_SH} ./extglob1.sub + +${THIS_SH} ./extglob1a.sub + +exit 0 diff --git a/tests/extglob1.sub b/tests/extglob1.sub new file mode 100644 index 0000000..bf65a9e --- /dev/null +++ b/tests/extglob1.sub @@ -0,0 +1,37 @@ +MYDIR=$PWD + +: ${TMPDIR:=/tmp} +GDIR=$TMPDIR/gtest-$$ + +shopt -s extglob + +mkdir $GDIR || exit 1 +cd $GDIR || exit 1 + +touch a.c + +echo +([[:alpha:].]) +echo +([[:alpha:].])+([[:alpha:].]) +echo *([[:alpha:].]) +echo *([[:alpha:].])*([[:alpha:].]) + +echo ?([[:alpha:].])?([[:alpha:].])?([[:alpha:].]) +echo @([[:alpha:].])@([[:alpha:].])@([[:alpha:].]) + +case . in +!([[:alpha:].]) ) echo bad 1;; +*) echo ok 1;; +esac + +case . in +?([[:alpha:].]) ) echo ok 2;; +*) echo bad 2;; +esac + +case . in +@([[:alpha:].]) ) echo ok 3;; +*) echo bad 3;; +esac + +cd "$MYDIR" +rm -rf $GDIR diff --git a/tests/extglob1a.sub b/tests/extglob1a.sub new file mode 100644 index 0000000..e029ea4 --- /dev/null +++ b/tests/extglob1a.sub @@ -0,0 +1,16 @@ +shopt -s extglob + +TESTDIR=${TMPDIR:-/tmp}/eglob-test-$$ +mkdir $TESTDIR +builtin cd $TESTDIR || { echo $0: cannot cd to $TESTDIR >&2 ; exit 1; } +rm -rf * + +touch a ab ba + +echo a*!(x) +echo a!(x) +echo a*?(x) +echo a?(x) + +builtin cd / +rm -rf $TESTDIR diff --git a/tests/extglob2.right b/tests/extglob2.right new file mode 100644 index 0000000..f8a09df --- /dev/null +++ b/tests/extglob2.right @@ -0,0 +1,70 @@ +0: [[ fofo = *(f*(o)) ]] +0: [[ ffo = *(f*(o)) ]] +0: [[ foooofo = *(f*(o)) ]] +0: [[ foooofof = *(f*(o)) ]] +0: [[ fooofoofofooo = *(f*(o)) ]] +1: [[ foooofof = *(f+(o)) ]] +1: [[ xfoooofof = *(f*(o)) ]] +1: [[ foooofofx = *(f*(o)) ]] +0: [[ ofxoofxo = *(*(of*(o)x)o) ]] +1: [[ ofooofoofofooo = *(f*(o)) ]] +0: [[ foooxfooxfoxfooox = *(f*(o)x) ]] +1: [[ foooxfooxofoxfooox = *(f*(o)x) ]] +0: [[ foooxfooxfxfooox = *(f*(o)x) ]] +0: [[ ofxoofxo = *(*(of*(o)x)o) ]] +0: [[ ofoooxoofxo = *(*(of*(o)x)o) ]] +0: [[ ofoooxoofxoofoooxoofxo = *(*(of*(o)x)o) ]] +0: [[ ofoooxoofxoofoooxoofxoo = *(*(of*(o)x)o) ]] +1: [[ ofoooxoofxoofoooxoofxofo = *(*(of*(o)x)o) ]] +0: [[ ofoooxoofxoofoooxoofxooofxofxo = *(*(of*(o)x)o) ]] +0: [[ aac = *(@(a))a@(c) ]] +0: [[ ac = *(@(a))a@(c) ]] +1: [[ c = *(@(a))a@(c) ]] +0: [[ aaac = *(@(a))a@(c) ]] +1: [[ baaac = *(@(a))a@(c) ]] +0: [[ abcd = ?@(a|b)*@(c)d ]] +0: [[ abcd = @(ab|a*@(b))*(c)d ]] +0: [[ acd = @(ab|a*(b))*(c)d ]] +0: [[ abbcd = @(ab|a*(b))*(c)d ]] +0: [[ effgz = @(b+(c)d|e*(f)g?|?(h)i@(j|k)) ]] +0: [[ efgz = @(b+(c)d|e*(f)g?|?(h)i@(j|k)) ]] +0: [[ egz = @(b+(c)d|e*(f)g?|?(h)i@(j|k)) ]] +0: [[ egzefffgzbcdij = *(b+(c)d|e*(f)g?|?(h)i@(j|k)) ]] +1: [[ egz = @(b+(c)d|e+(f)g?|?(h)i@(j|k)) ]] +0: [[ ofoofo = *(of+(o)) ]] +0: [[ oxfoxoxfox = *(oxf+(ox)) ]] +1: [[ oxfoxfox = *(oxf+(ox)) ]] +0: [[ ofoofo = *(of+(o)|f) ]] +0: [[ foofoofo = @(foo|f|fo)*(f|of+(o)) ]] +0: [[ oofooofo = *(of|oof+(o)) ]] +0: [[ fffooofoooooffoofffooofff = *(*(f)*(o)) ]] +0: [[ fofoofoofofoo = *(fo|foo) ]] +0: [[ foo = !(x) ]] +0: [[ foo = !(x)* ]] +1: [[ foo = !(foo) ]] +0: [[ foo = !(foo)* ]] +0: [[ foobar = !(foo) ]] +0: [[ foobar = !(foo)* ]] +0: [[ moo.cow = !(*.*).!(*.*) ]] +1: [[ mad.moo.cow = !(*.*).!(*.*) ]] +1: [[ mucca.pazza = mu!(*(c))?.pa!(*(z))? ]] +0: [[ fff = !(f) ]] +0: [[ fff = *(!(f)) ]] +0: [[ fff = +(!(f)) ]] +0: [[ ooo = !(f) ]] +0: [[ ooo = *(!(f)) ]] +0: [[ ooo = +(!(f)) ]] +0: [[ foo = !(f) ]] +0: [[ foo = *(!(f)) ]] +0: [[ foo = +(!(f)) ]] +1: [[ f = !(f) ]] +1: [[ f = *(!(f)) ]] +1: [[ f = +(!(f)) ]] +0: [[ foot = @(!(z*)|*x) ]] +1: [[ zoot = @(!(z*)|*x) ]] +0: [[ foox = @(!(z*)|*x) ]] +0: [[ zoox = @(!(z*)|*x) ]] +0: [[ foo = *(!(foo)) ]] +1: [[ foob = !(foo)b* ]] +0: [[ foobb = !(foo)b* ]] +0 tests failed. diff --git a/tests/extglob2.tests b/tests/extglob2.tests new file mode 100755 index 0000000..f35c3e8 --- /dev/null +++ b/tests/extglob2.tests @@ -0,0 +1,90 @@ +# +# More ksh-like extended globbing tests, cribbed from zsh-3.1.5 +# +shopt -s extglob + +failed=0 +while read res str pat; do + [[ $res = '#' ]] && continue + [[ $str = ${pat} ]] + ts=$? + [[ $1 = -q ]] || echo "$ts: [[ $str = $pat ]]" + if [[ ( $ts -gt 0 && $res = t) || ($ts -eq 0 && $res = f) ]]; then + echo "Test failed: [[ $str = $pat ]]" + (( failed += 1 )) + fi +done <&2 +subshell +f is a function +f () +{ + echo f-x; + echo f-y +} 1>&2 +f2 is a function +f2 () +{ + echo f2-a; + function f3 () + { + echo f3-a; + echo f3-b + } 1>&2; + f3 +} +subshell +f2 is a function +f2 () +{ + echo f2-a; + function f3 () + { + echo f3-a; + echo f3-b + } 1>&2; + f3 +} +f4 is a function +f4 () +{ + echo f4-a; + function f5 () + { + echo f5-a; + echo f5-b + } 1>&2; + f5 +} 2>&1 +subshell +f4 is a function +f4 () +{ + echo f4-a; + function f5 () + { + echo f5-a; + echo f5-b + } 1>&2; + f5 +} 2>&1 +testgrp is a function +testgrp () +{ + echo testgrp-a; + { + echo tg-x; + echo tg-y + } 1>&2; + echo testgrp-b +} +subshell +testgrp is a function +testgrp () +{ + echo testgrp-a; + { + echo tg-x; + echo tg-y + } 1>&2; + echo testgrp-b +} +funca is a function +funca () +{ + ( echo func-a ) +} +funcb is a function +funcb () +{ + ( echo func-b ) +} +funcc is a function +funcc () +{ + ( echo func-c ) 2>&1 +} +func-a +func-b +func-c +foo-bar +foo-bar () +{ + : +} +expect 5 10 +5 10 +expect 20 +20 +expect 5 20 +5 20 +expect 5 30 +5 30 +expect 2 40 +2 40 +expect 5 20 +5 20 +./func4.sub: line 10: foo: maximum function nesting level exceeded (100) +1 +after: f = 100 +./func4.sub: line 10: foo: maximum function nesting level exceeded (100) +1 +after: f = 100 +7 +after FUNCNEST reset: f = 201 +7 +after FUNCNEST unset: f = 201 +./func4.sub: line 10: foo: maximum function nesting level exceeded (20) +1 +after FUNCNEST assign: f = 38 +5 diff --git a/tests/func.tests b/tests/func.tests new file mode 100644 index 0000000..8701c2a --- /dev/null +++ b/tests/func.tests @@ -0,0 +1,179 @@ +a() +{ + x=$((x - 1)) + return 5 +} + +b() +{ + x=$((x - 1)) + a + echo a returns $? + return 4 +} + +c() +{ + x=$((x - 1)) + b + echo b returns $? + return 3 +} + +d() +{ + x=$((x - 1)) + c + echo c returns $? + return 2 +} + +e() +{ + d + echo d returns $? + echo in e + x=$((x - 1)) + return $x +} + +f() +{ + e + echo e returned $? + echo x is $x + return 0 +} + +x=30 +f + +# make sure unsetting a local variable preserves the `local' attribute +f1() +{ + local zz + zz=abcde + echo $zz + unset zz + zz=defghi + echo $zz +} + +zz=ZZ +echo $zz +f1 +echo $zz + +unset -f f1 +f1() +{ + return 5 +} + +( f1 ) +echo $? + +unset -f f1 +f1() +{ + sleep 5 + return 5 +} + +f1 & +wait +echo $? + +unset -f f1 + +f1() +{ + echo $AVAR + printenv AVAR +} + +AVAR=AVAR +echo $AVAR +f1 +AVAR=foo f1 +echo $AVAR + +unset -f f1 +# make sure subshells can do a `return' if we're executing in a function +f1() +{ + ( return 5 ) + status=$? + echo $status + return $status +} + +f1 +echo $? + +declare -F f1 # should print just the name +declare -f f1 # should print the definition, too + +# no functions should be exported, right? +declare -xF +declare -xf + +# FUNCNAME tests +func2() +{ + echo FUNCNAME = $FUNCNAME +} + +func() +{ + echo before: FUNCNAME = $FUNCNAME + func2 + echo after: FUNCNAME = $FUNCNAME +} + +echo before: try to assign to FUNCNAME +FUNCNAME=7 + +echo outside: FUNCNAME = $FUNCNAME +func +echo outside2: FUNCNAME = $FUNCNAME + +# test exported functions (and cached exportstr) +zf() +{ + echo this is zf +} +export -f zf + +${THIS_SH} -c 'type -t zf' +${THIS_SH} -c 'type zf' + +${THIS_SH} ./func1.sub + +# tests for functions whose bodies are not group commands, with and without +# attached redirections +${THIS_SH} ./func2.sub + +# test for some posix-specific function behavior +${THIS_SH} ./func3.sub + +# FUNCNEST testing +${THIS_SH} ./func4.sub + +unset -f myfunction +myfunction() { + echo "bad shell function redirection" +} >> /dev/null + +myfunction +myfunction | cat + +segv() +{ + echo foo | return 5 +} + +segv +echo $? + +exit 0 diff --git a/tests/func1.sub b/tests/func1.sub new file mode 100644 index 0000000..345645f --- /dev/null +++ b/tests/func1.sub @@ -0,0 +1,55 @@ +# +# Test that redirections attached to shell functions are printed correctly. +# This was a bug in all bash versions before bash-2.04. +# +f() +{ + echo f-x + echo f-y +} >&2 + +type f +export -f f +${THIS_SH} -c 'echo subshell; type f' + +f2() +{ + echo f2-a + f3() + { + echo f3-a + echo f3-b + } >&2 + f3 +} + +type f2 + +export -f f2 +${THIS_SH} -c 'echo subshell; type f2' + +f4() +{ + echo f4-a + f5() + { + echo f5-a + echo f5-b + } >&2 + f5 +} 2>&1 + +type f4 +export -f f4 +${THIS_SH} -c 'echo subshell; type f4' + +testgrp() +{ + echo testgrp-a + { echo tg-x; echo tg-y; } >&2 + echo testgrp-b +} +type testgrp + +export -f testgrp +${THIS_SH} -c 'echo subshell; type testgrp' diff --git a/tests/func2.sub b/tests/func2.sub new file mode 100644 index 0000000..41a3844 --- /dev/null +++ b/tests/func2.sub @@ -0,0 +1,27 @@ +funca() ( + echo func-a +) + +funcb() ( echo func-b ) + +funcc() ( + echo func-c +) 2>&1 + +type funca +type funcb +type funcc + +funca +funcb +funcc + +# when not in posix mode, bash allows non-identifiers as function names +set +o posix +foo-bar() +{ + :; +} + +declare -F foo-bar +declare -f foo-bar diff --git a/tests/func3.sub b/tests/func3.sub new file mode 100644 index 0000000..9d3d069 --- /dev/null +++ b/tests/func3.sub @@ -0,0 +1,54 @@ +# +# test some posix-mode-specific function behavior +# +set -o posix +func() +{ + return 5 +} + +myfunction () { + var=20 return +} +var=10 +echo expect 5 10 +func +echo $? $var + +myfunction +echo expect 20 +echo $var + +echo expect 5 20 +func +echo $? $var + +echo expect 5 30 +var=30 func +echo $? $var + +: ${TMPDIR:=/tmp} +TMPFILE=$TMPDIR/func3.sub.$$ + +rm -f $TMPFILE +echo 'var=40 return 2' > $TMPFILE + +# test the behavior of `return' and preceding variable assignments here +# because it's convenient +var=10 +echo expect 2 40 +. $TMPFILE +echo $? $var + +rm -f $TMPFILE + +#set -o posix +var=0 +func() +{ + var=20 return 5 +} + +echo expect 5 20 +var=30 func +echo $? $var diff --git a/tests/func4.sub b/tests/func4.sub new file mode 100644 index 0000000..9c9c1b4 --- /dev/null +++ b/tests/func4.sub @@ -0,0 +1,39 @@ +# test FUNCNEST functionality -- bash-4.2 +FUNCNEST=100 + +foo() +{ + (( f++ )) + if (( f > 200 )); then + return 7 + fi + foo +} + +f=0 +foo +echo $? +echo after: f = $f + +f=0 +foo +echo $? +echo after: f = $f + +f=0 +FUNCNEST=0 +foo +echo $? +echo after FUNCNEST reset: f = $f + +f=0 +unset FUNCNEST +foo +echo $? +echo after FUNCNEST unset: f = $f + +FUNCNEST=20 +f=$(( FUNCNEST - 2 )) +foo +echo $? +echo after FUNCNEST assign: f = $f diff --git a/tests/getopts.right b/tests/getopts.right new file mode 100644 index 0000000..9226103 --- /dev/null +++ b/tests/getopts.right @@ -0,0 +1,56 @@ +getopts: usage: getopts optstring name [arg] +2 +getopts: usage: getopts optstring name [arg] +2 +./getopts.tests: line 10: getopts: -a: invalid option +getopts: usage: getopts optstring name [arg] +-a specified +-b bval specified +remaining args: one two three +-a specified +-b bval specified +remaining args: one two three four five six seven eight nine ten eleven twelve +./getopts1.sub: option requires an argument -- b +Usage: ./getopts1.sub [-a] [-b value] args +-a specified +-c cval specified +-d specified +-a specified +-b 3 specified +remaining args: one two three four five +-a specified +-b bval specified +remaining args: one two three +-a specified +-b bval specified +remaining args: one two three +./getopts4.sub: error: option `b' requires an argument +Usage: ./getopts4.sub [-a] [-b value] args +./getopts4.sub: error: illegal option character `c' +Usage: ./getopts4.sub [-a] [-b value] args +-a specified +remaining args: -b bval one two three +OPTERR=0 +a here +something else here +OPTIND=3 +getop: OPTERR=1 +a here +./getopts5.sub: illegal option -- c +something else here +./getopts5.sub: illegal option -- d +something else here +./getopts5.sub: illegal option -- e +something else here +getop: OPTIND=5 +OPTIND=3 +OPTERR=0 +-a specified +remaining args: +-a specified +remaining args: +-a specified +remaining args: +0 +./getopts7.sub: line 4: getopts: `opt-var': not a valid identifier +remaining args: diff --git a/tests/getopts.tests b/tests/getopts.tests new file mode 100644 index 0000000..1814d78 --- /dev/null +++ b/tests/getopts.tests @@ -0,0 +1,38 @@ +# getopts tests +# this should fail +getopts +echo $? +getopts opts +echo $? + +# maybe someday we will have a ksh93-like -a argument to set the name +# used in error messages, but not yet +getopts -a opts name + +${THIS_SH} ./getopts1.sub -a -b bval one two three +# make sure getopts works when there are more than 9 positional parameters +${THIS_SH} ./getopts1.sub -a -b bval one two three four five six seven eight nine ten eleven twelve +${THIS_SH} ./getopts1.sub -a -b + +${THIS_SH} ./getopts2.sub -ad -c cval three four five + +${THIS_SH} ./getopts3.sub + +# make sure that `-b bval' and `-bbval' are equivalent +${THIS_SH} ./getopts4.sub -a -b bval one two three +${THIS_SH} ./getopts4.sub -a -bbval one two three +# this tests `silent' error reporting +${THIS_SH} ./getopts4.sub -a -b +${THIS_SH} ./getopts4.sub -a -c + +# make sure that `--' can be used to end the list of options +${THIS_SH} ./getopts4.sub -a -- -b bval one two three + +${THIS_SH} ./getopts5.sub -a -c + +${THIS_SH} ./getopts6.sub -a +${THIS_SH} ./getopts6.sub -a -c +${THIS_SH} ./getopts6.sub -ac +echo $? # this should be 2 + +${THIS_SH} ./getopts7.sub -a diff --git a/tests/getopts1.sub b/tests/getopts1.sub new file mode 100644 index 0000000..df0a342 --- /dev/null +++ b/tests/getopts1.sub @@ -0,0 +1,26 @@ +aflag= +bflag= + +while getopts ab: name +do + case $name in + a) aflag=1 ;; + b) bflag=1 + bval=$OPTARG;; + ?) echo Usage: $0 [-a] [-b value] args + exit 2;; + esac + +done + +if [ ! -z "$aflag" ] ; then echo -a specified ; fi +if [ ! -z "$bflag" ] ; then echo -b $bval specified ; fi + +if [ "$OPTIND" -gt 1 ] +then + shift $(( $OPTIND - 1 )) +fi + +echo remaining args: "$*" + +exit 0 diff --git a/tests/getopts2.sub b/tests/getopts2.sub new file mode 100644 index 0000000..d91fd26 --- /dev/null +++ b/tests/getopts2.sub @@ -0,0 +1,26 @@ +aflag= +bflag= + +while getopts ab:c:de name "$@" +do + case $name in + a) aflag=1 ;; + b) bflag=1 + bval=$OPTARG;; + c) cflag=1 + cval=$OPTARG ;; + d) dflag=1 ;; + e) eflag=1;; + ?) echo Usage: $0 [-a] [-b value] [-c value] -[de] args + exit 2;; + esac + +done + +[ ! -z "$aflag" ] && echo -a specified +[ ! -z "$bflag" ] && echo -b $bval specified +[ ! -z "$cflag" ] && echo -c $cval specified +[ ! -z "$dflag" ] && echo -d specified +[ ! -z "$eflag" ] && { echo -n - ; echo e specified; } + +exit 0 diff --git a/tests/getopts3.sub b/tests/getopts3.sub new file mode 100644 index 0000000..2d8b316 --- /dev/null +++ b/tests/getopts3.sub @@ -0,0 +1,27 @@ +aflag= +bflag= + +while getopts ab: name -a -b 1 -a -a -a -b 5 -b 3 -a one two three four five +do + case $name in + a) aflag=1 ;; + b) bflag=1 + bval=$OPTARG;; + ?) echo Usage: $0 [-a] [-b value] args + exit 2;; + esac + +done + +if [ ! -z "$aflag" ] ; then echo -a specified ; fi +if [ ! -z "$bflag" ] ; then echo -b $bval specified ; fi + +set -- -a -b 1 -a -a -a -b 5 -b 3 -a one two three four five +if [ "$OPTIND" -gt 1 ] +then + shift $(( $OPTIND - 1 )) +fi + +echo remaining args: "$*" + +exit 0 diff --git a/tests/getopts4.sub b/tests/getopts4.sub new file mode 100644 index 0000000..9cd5aef --- /dev/null +++ b/tests/getopts4.sub @@ -0,0 +1,30 @@ +aflag= +bflag= + +while getopts :ab: name "$@" +do + case $name in + a) aflag=1 ;; + b) bflag=1 + bval=$OPTARG;; + :) echo $0: error: option \`$OPTARG\' requires an argument + echo Usage: $0 [-a] [-b value] args + exit 2;; + ?) echo $0: error: illegal option character \`$OPTARG\' + echo Usage: $0 [-a] [-b value] args + exit 2;; + esac + +done + +if [ ! -z "$aflag" ] ; then echo -a specified ; fi +if [ ! -z "$bflag" ] ; then echo -b $bval specified ; fi + +if [ "$OPTIND" -gt 1 ] +then + shift $(( $OPTIND - 1 )) +fi + +echo remaining args: "$*" + +exit 0 diff --git a/tests/getopts5.sub b/tests/getopts5.sub new file mode 100644 index 0000000..c6e3888 --- /dev/null +++ b/tests/getopts5.sub @@ -0,0 +1,50 @@ +#!/local/bin/bash +#Time-stamp: <95/06/07 07:40:40 hrue@imf.unit.no> + +getop () { + + local OPTIND + local OPTERR=1 + + echo getop: OPTERR=$OPTERR + while getopts ab arg "$@"; do + case $arg in + a) + echo a here + ;; + b) + echo b here + ;; + :|?|*) + echo something else here + ;; + esac + done + echo getop: OPTIND=$OPTIND +} + +OPTIND= +OPTERR=0 + +echo OPTERR=$OPTERR +while getopts ab arg; do + case $arg in + a) + echo a here + ;; + b) + echo b here + ;; + :|?|*) + + echo something else here + ;; + esac +done + +echo OPTIND=$OPTIND + +getop "$@" -d -e + +echo OPTIND=$OPTIND +echo OPTERR=$OPTERR diff --git a/tests/getopts6.sub b/tests/getopts6.sub new file mode 100644 index 0000000..75d768c --- /dev/null +++ b/tests/getopts6.sub @@ -0,0 +1,27 @@ +aflag= +bflag= + +while getopts :ac name "$@" +do + case $name in + a) aflag=1 ;; + c) cflag=1 ;; + ?) exit 2;; + esac + + # this came in in a bug report -- it's really a usage error + # but it shouldn't cause the shell to crash + shift +done + +if [ ! -z "$aflag" ] ; then echo -a specified ; fi +if [ ! -z "$cflag" ] ; then echo -c specified ; fi + +if [ "$OPTIND" -gt 1 ] +then + shift $(( $OPTIND - 1 )) +fi + +echo remaining args: "$*" + +exit 0 diff --git a/tests/getopts7.sub b/tests/getopts7.sub new file mode 100644 index 0000000..a20a6df --- /dev/null +++ b/tests/getopts7.sub @@ -0,0 +1,30 @@ +aflag= +bflag= + +while getopts :ab: opt-var "$@" +do + case $name in + a) aflag=1 ;; + b) bflag=1 + bval=$OPTARG;; + :) echo $0: error: option \`$OPTARG\' requires an argument + echo Usage: $0 [-a] [-b value] args + exit 2;; + ?) echo $0: error: illegal option character \`$OPTARG\' + echo Usage: $0 [-a] [-b value] args + exit 2;; + esac + +done + +if [ ! -z "$aflag" ] ; then echo -a specified ; fi +if [ ! -z "$bflag" ] ; then echo -b $bval specified ; fi + +if [ "$OPTIND" -gt 1 ] +then + shift $(( $OPTIND - 1 )) +fi + +echo remaining args: "$*" + +exit 0 diff --git a/tests/glob.right b/tests/glob.right new file mode 100644 index 0000000..04a0fd5 --- /dev/null +++ b/tests/glob.right @@ -0,0 +1,135 @@ +foo/bar foobar/bar +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +tmp/l1 tmp/l2 tmp/*4 tmp/l3 +./glob.tests: line 44: no match: tmp/*4 +argv[1] = +argv[1] = <*> +argv[1] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = <*q*> +argv[1] = <**> +argv[1] = <**> +argv[1] = <\.\./*/> +argv[1] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[8] =
    +argv[9] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[3] =
    +argv[4] = +argv[1] = +argv[1] = +no match +not there +argv[1] = +argv[1] = +argv[1] = +argv[1] = +match 1 +match 2 +ok 1 +ok 2 +ok 3 +ok 4 +ok 5 +argv[1] = +argv[1] = +argv[1] = +ok 1 +ok 2 +ok 3 +ok 4 +ok 5 +ok 6 +ok 7 +ok 8 +ok 9 +ok 10 +ok 11 +ok 20 +ok 21 +ok 22 +ok 23 +ok 24 +ok 25 +ok 26 +ok 27 +ok 28 +ok 29 +ok 30 +ok 31 +ok 32 +ok 33 +ok 34 +ok 35 +ok 36 +ok 37 +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[1] = <*> +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[8] = +argv[9] = +argv[10] =
    ' +recho [a-y]*[^c] + +expect ' ' +recho a*[^c] + +touch a-b aXb +expect ' ' +recho a[X-]b + +touch .x .y +expect '
    ' +recho [^a-c]* + +# Make sure that filenames with embedded globbing characters are handled +# properly +mkdir a\*b +> a\*b/ooo + +expect '' +recho a\*b/* + +expect '' +recho a\*?/* + +expect '' +cmd='echo !7' +case "$cmd" in +*\\!*) echo match ;; +*) echo no match ;; +esac + +expect '' +file='r.*' +case $file in +*.\*) echo not there ;; +*) echo there ;; +esac + +# examples from the Posix.2 spec (d11.2, p. 243) +expect '' +recho a[b]c + +expect '' +recho a["b"]c + +expect '' +recho a[\b]c + +expect '' +recho a?c + +expect '' +case abc in +a"b"c) echo 'match 1' ;; +*) echo 'BAD match 1' ;; +esac + +expect '' +case abc in +a*c) echo 'match 2' ;; +*) echo 'BAD match 2' ;; +esac + +expect '' +case abc in +"a?c") echo 'bad 1' ;; +*) echo 'ok 1' ;; +esac + +expect '' +case abc in +a\*c) echo 'bad 2' ;; +*) echo 'ok 2' ;; +esac + +expect '' +case abc in +a\[b]c) echo 'bad 3' ;; +*) echo 'ok 3' ;; +esac + +expect '' +case "$nosuchvar" in +"") echo 'ok 4' ;; +*) echo 'bad 4' ;; +esac + +# This is very odd, but sh and ksh seem to agree +expect '' +case abc in +a["\b"]c) echo 'ok 5' ;; +*) echo 'bad 5' ;; +esac + +mkdir man +mkdir man/man1 +touch man/man1/bash.1 +expect '' +recho */man*/bash.* +expect '' +recho $(echo */man*/bash.*) +expect '' +recho "$(echo */man*/bash.*)" + +# tests with multiple `*'s +case abc in +a***c) echo ok 1;; +esac + +case abc in +a*****?c) echo ok 2;; +esac + +case abc in +?*****??) echo ok 3;; +esac + +case abc in +*****??) echo ok 4;; +esac + +case abc in +*****??c) echo ok 5;; +esac + +case abc in +?*****?c) echo ok 6;; +esac + +case abc in +?***?****c) echo ok 7;; +esac + +case abc in +?***?****?) echo ok 8;; +esac + +case abc in +?***?****) echo ok 9;; +esac + +case abc in +*******c) echo ok 10;; +esac + +case abc in +*******?) echo ok 11;; +esac + +case abcdecdhjk in +a*cd**?**??k) echo ok 20;; +esac + +case abcdecdhjk in +a**?**cd**?**??k) echo ok 21;; +esac + +case abcdecdhjk in +a**?**cd**?**??k***) echo ok 22;; +esac + +case abcdecdhjk in +a**?**cd**?**??***k) echo ok 23;; +esac + +case abcdecdhjk in +a**?**cd**?**??***k**) echo ok 24;; +esac + +case abcdecdhjk in +a****c**?**??*****) echo ok 25;; +esac + +case '-' in +[-abc]) echo ok 26 ;; +esac + +case '-' in +[abc-]) echo ok 27 ;; +esac + +case '\' in +\\) echo ok 28 ;; +esac + +case '\' in +[\\]) echo ok 29 ;; +esac + +case '\' in +'\') echo ok 30 ;; +esac + +case '[' in +[[]) echo ok 31 ;; +esac + +# a `[' without a closing `]' is just another character to match, in the +# bash implementation +case '[' in +[) echo ok 32 ;; +esac + +case '[abc' in +[*) echo 'ok 33';; +esac + +# a right bracket shall lose its special meaning and represent itself in +# a bracket expression if it occurs first in the list. -- POSIX.2 2.8.3.2 +case ']' in +[]]) echo ok 34 ;; +esac + +case '-' in +[]-]) echo ok 35 ;; +esac + +# a backslash should just escape the next character in this context +case p in +[a-\z]) echo ok 36 ;; +esac + +# this was a bug in all versions up to bash-2.04-release +case "/tmp" in +[/\\]*) echo ok 37 ;; +esac + +# none of these should output anything + +case abc in +??**********?****?) echo bad 1;; +esac + +case abc in +??**********?****c) echo bad 2;; +esac + +case abc in +?************c****?****) echo bad 3;; +esac + +case abc in +*c*?**) echo bad 4;; +esac + +case abc in +a*****c*?**) echo bad 5;; +esac + +case abc in +a********???*******) echo bad 6;; +esac + +case 'a' in +[]) echo bad 7 ;; +esac + +case '[' in +[abc) echo bad 8;; +esac + +# let's start testing the case-insensitive globbing code +recho b* + +shopt -s nocaseglob +recho b* + +recho [b]* +shopt -u nocaseglob + +# make sure set -f works right +set -f +recho * +set +f + +# test out the GLOBIGNORE code +GLOBIGNORE='.*:*c:*e:?' +recho * + +GLOBIGNORE='.*:*b:*d:?' +recho * + +# see if GLOBIGNORE can substitute for `set -f' +GLOBIGNORE='.*:*' +recho * + +unset GLOBIGNORE +expect '' +recho */man*/bash.* + +# make sure null values for GLOBIGNORE have no effect +GLOBIGNORE= +expect '' +recho */man*/bash.* + +# this is for the benefit of pure coverage, so it writes the pcv file +# in the right place, and for gprof +builtin cd $MYDIR + +rm -rf $TESTDIR + +exit 0 diff --git a/tests/glob1.sub b/tests/glob1.sub new file mode 100644 index 0000000..8745cd9 --- /dev/null +++ b/tests/glob1.sub @@ -0,0 +1,14 @@ +# bash-2.01.1 failed this test +FN=/tmp/bash-glob.$$ +mkdir $FN +cd $FN +mkdir foo +mkdir foobar +touch foo/bar +touch foobar/bar +chmod 311 foo foobar +echo f*/bar + +chmod 777 foo foobar +cd / +rm -rf $FN diff --git a/tests/globstar.right b/tests/globstar.right new file mode 100644 index 0000000..c104fd3 --- /dev/null +++ b/tests/globstar.right @@ -0,0 +1,585 @@ +lib/glob/glob.o +lib/glob/smatch.o +lib/glob/strmatch.o +lib/readline/bind.o +lib/readline/callback.o +lib/readline/compat.o +lib/readline/complete.o +lib/readline/display.o +lib/sh/casemod.o +lib/sh/clktck.o +lib/sh/clock.o +lib/sh/eaccess.o +lib/sh/fdprintf.o +lib/sh/fmtullong.o +lib/sh/fmtulong.o +lib/sh/fmtumax.o +lib/sh/fpurge.o +lib/sh/getenv.o +lib/sh/input_avail.o +lib/sh/itos.o + +lib/: +glob +readline +sh + +lib/glob: +glob.o +smatch.o +strmatch.o + +lib/readline: +bind.o +callback.o +compat.o +complete.o +display.o + +lib/sh: +casemod.o +clktck.o +clock.o +eaccess.o +fdprintf.o +fmtullong.o +fmtulong.o +fmtumax.o +fpurge.o +getenv.o +input_avail.o +itos.o +lib/glob/glob.o +lib/glob/smatch.o +lib/glob/strmatch.o +lib/readline/bind.o +lib/readline/callback.o +lib/readline/compat.o +lib/readline/complete.o +lib/readline/display.o +lib/sh/casemod.o +lib/sh/clktck.o +lib/sh/clock.o +lib/sh/eaccess.o +lib/sh/fdprintf.o +lib/sh/fmtullong.o +lib/sh/fmtulong.o +lib/sh/fmtumax.o +lib/sh/fpurge.o +lib/sh/getenv.o +lib/sh/input_avail.o +lib/sh/itos.o +alias.o builtins/history.o builtins/jobs.o builtins/kill.o builtins/let.o builtins/mapfile.o lib/glob/glob.o lib/glob/smatch.o lib/glob/strmatch.o lib/readline/bind.o lib/readline/callback.o lib/readline/compat.o lib/readline/complete.o lib/readline/display.o lib/sh/casemod.o lib/sh/clktck.o lib/sh/clock.o lib/sh/eaccess.o lib/sh/fdprintf.o lib/sh/fmtullong.o lib/sh/fmtulong.o lib/sh/fmtumax.o lib/sh/fpurge.o lib/sh/getenv.o lib/sh/input_avail.o lib/sh/itos.o pcomplib.o print_cmd.o redir.o shell.o sig.o stringlib.o subst.o syntax.o test.o trap.o unwind_prot.o variables.o version.o xmalloc.o y.tab.o +alias.o +builtins/history.o +builtins/jobs.o +builtins/kill.o +builtins/let.o +builtins/mapfile.o +lib/glob/glob.o +lib/glob/smatch.o +lib/glob/strmatch.o +lib/readline/bind.o +lib/readline/callback.o +lib/readline/compat.o +lib/readline/complete.o +lib/readline/display.o +lib/sh/casemod.o +lib/sh/clktck.o +lib/sh/clock.o +lib/sh/eaccess.o +lib/sh/fdprintf.o +lib/sh/fmtullong.o +lib/sh/fmtulong.o +lib/sh/fmtumax.o +lib/sh/fpurge.o +lib/sh/getenv.o +lib/sh/input_avail.o +lib/sh/itos.o +pcomplib.o +print_cmd.o +redir.o +shell.o +sig.o +stringlib.o +subst.o +syntax.o +test.o +trap.o +unwind_prot.o +variables.o +version.o +xmalloc.o +y.tab.o + +builtins: +history.o +jobs.o +kill.o +let.o +mapfile.o + +lib: +glob +readline +sh + +lib/glob: +glob.o +smatch.o +strmatch.o + +lib/readline: +bind.o +callback.o +compat.o +complete.o +display.o + +lib/sh: +casemod.o +clktck.o +clock.o +eaccess.o +fdprintf.o +fmtullong.o +fmtulong.o +fmtumax.o +fpurge.o +getenv.o +input_avail.o +itos.o +alias.o builtins builtins/history.o builtins/jobs.o builtins/kill.o builtins/let.o builtins/mapfile.o lib lib/glob lib/glob/glob.o lib/glob/smatch.o lib/glob/strmatch.o lib/readline lib/readline/bind.o lib/readline/callback.o lib/readline/compat.o lib/readline/complete.o lib/readline/display.o lib/sh lib/sh/casemod.o lib/sh/clktck.o lib/sh/clock.o lib/sh/eaccess.o lib/sh/fdprintf.o lib/sh/fmtullong.o lib/sh/fmtulong.o lib/sh/fmtumax.o lib/sh/fpurge.o lib/sh/getenv.o lib/sh/input_avail.o lib/sh/itos.o pcomplib.o print_cmd.o redir.o shell.o sig.o stringlib.o subst.o syntax.o test.o trap.o unwind_prot.o variables.o version.o xmalloc.o y.tab.o +bar/foo foo +bar/foo/ foo/ +bar/foo/e bar/foo/f foo/a foo/b + + + + + + + + + +== <**/a> == + + + + + + + + + + + + + + + +== == + + + + + + + + + + + + + + + +== <**> == + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +== <**/**> == + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +== <**/**/**> == + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +== <**/**/**/**/**> == + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +== <**/**/a> == + + + + + + + + + + + + + + + +== == + + + + + + + + + + + + + + + +== == + + + + + + + + + + + + + + + +== == + + + + + + + + + + + + + + + +== <**/a/**> == + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +== <**/a/**/**> == + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +== <**/a/**/**/**> == + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +== <**/**/a/**> == + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/tmp/empty diff --git a/tests/globstar.tests b/tests/globstar.tests new file mode 100644 index 0000000..f7efbd1 --- /dev/null +++ b/tests/globstar.tests @@ -0,0 +1,42 @@ +: ${TMPDIR:=/var/tmp} +dir=$PWD + +shopt -s globstar + +export LANG=C LC_ALL=C LC_COLLATE=C + +GDIR=$TMPDIR/globstar-$$ + +mkdir $GDIR || exit 1 +cd $GDIR || exit 1 + +mkdir lib builtins +mkdir lib/glob lib/readline lib/sh + +touch builtins/history.o builtins/jobs.o builtins/kill.o builtins/let.o builtins/mapfile.o +touch lib/glob/glob.o lib/glob/smatch.o lib/glob/strmatch.o +touch lib/readline/bind.o lib/readline/callback.o lib/readline/compat.o lib/readline/complete.o lib/readline/display.o + +touch lib/sh/casemod.o lib/sh/clktck.o lib/sh/clock.o lib/sh/eaccess.o +touch lib/sh/fdprintf.o lib/sh/fmtullong.o lib/sh/fmtulong.o lib/sh/fmtumax.o +touch lib/sh/fpurge.o lib/sh/getenv.o lib/sh/input_avail.o lib/sh/itos.o + +touch alias.o +touch pcomplib.o print_cmd.o redir.o shell.o sig.o stringlib.o subst.o syntax.o +touch test.o trap.o unwind_prot.o variables.o version.o xmalloc.o y.tab.o + +ls lib/** + +ls lib/**/*.o + +echo **/*.o + +ls ** + +echo ** + +cd $dir +rm -rf $GDIR + +${THIS_SH} ./globstar1.sub +${THIS_SH} ./globstar2.sub diff --git a/tests/globstar1.sub b/tests/globstar1.sub new file mode 100644 index 0000000..8b9e36d --- /dev/null +++ b/tests/globstar1.sub @@ -0,0 +1,21 @@ +shopt -s globstar +wdir=$PWD + +: ${TMPDIR:=/var/tmp} +DIR=$TMPDIR/globstar-$$ +mkdir -p $DIR +cd $DIR || { + echo "$DIR: cannot cd" >&2 + exit 1 +} +mkdir -p foo/{a,b} bar/{c,d,foo/{e,f}} baz/{g,h} + + +echo **/foo* + +echo **/foo*/ + +echo **/foo*/* + +cd $wdir +rm -rf $DIR diff --git a/tests/globstar2.sub b/tests/globstar2.sub new file mode 100644 index 0000000..844d312 --- /dev/null +++ b/tests/globstar2.sub @@ -0,0 +1,80 @@ +shopt -s globstar +s() +{ + printf '== <%s> ==\n' "$@" +} +p() +{ + printf '<%q>\n' "$@" +} + +mkdir -p /tmp/empty/a/a/a +cd /tmp/empty + +# good +p ** +p **/** +p **/**/** + +rm -rf a +mkdir -p /tmp/empty/{a,b}/{a,b}/{a,b}/{a,b} +cd /tmp/empty + +# good +s '**/a' +p **/a + +# good +s 'a/**' +p a/** + +# good +s '**' +p ** + +# good +s '**/**' +p **/** + +# good +s '**/**/**' +p **/**/** + +# good +s '**/**/**/**/**' +p **/**/**/**/** + +# good +s '**/**/a' +p **/**/a + +# good +s 'a/**/**' +p a/**/** + +# good +s 'a/**/**/**' +p a/**/**/** + +# good +s 'a/**/**/**/**' +p a/**/**/**/** + +# same as ksh93 +s '**/a/**' +p **/a/** + +# same as ksh93 +s '**/a/**/**' +p **/a/**/** + +# same as ksh93 +s '**/a/**/**/**' +p **/a/**/**/** + +# good +s '**/**/a/**' +p **/**/a/** + +cd - +rm -rf /tmp/empty diff --git a/tests/heredoc.right b/tests/heredoc.right new file mode 100644 index 0000000..6abaa1f --- /dev/null +++ b/tests/heredoc.right @@ -0,0 +1,91 @@ +there +one - alpha +two - beta +three - gamma +hi\ +there$a +stuff +hi\ +there +EO\ +F +hi +hi +tab 1 +tab 2 +tab 3 +abc +def ghi +jkl mno +fff is a function +fff () +{ + ed /tmp/foo > /dev/null < /dev/null <\END +./heredoc3.sub: line 74: warning: here-document at line 72 delimited by end-of-file (wanted `EOF') +./heredoc3.sub: line 75: syntax error: unexpected end of file +comsub here-string +./heredoc.tests: line 105: warning: here-document at line 103 delimited by end-of-file (wanted `EOF') +hi +there diff --git a/tests/heredoc.tests b/tests/heredoc.tests new file mode 100644 index 0000000..ebc770a --- /dev/null +++ b/tests/heredoc.tests @@ -0,0 +1,105 @@ +# check order and content of multiple here docs + +cat << EOF1 << EOF2 +hi +EOF1 +there +EOF2 + +while read line1; do + read line2 <&3 + echo $line1 - $line2 +done < /tmp/bash-zzz << EOF +abc +EOF +cat >> /tmp/bash-zzz << EOF +def ghi +jkl mno +EOF +cat /tmp/bash-zzz +rm -f /tmp/bash-zzz + +# make sure command printing puts the here-document as the last redirection +# on the line, and the function export code preserves syntactic correctness +fff() +{ + ed /tmp/foo </dev/null +/^name/d +w +q +ENDOFINPUT +aa=1 +} + +type fff +export -f fff +${THIS_SH} -c 'type fff' + +${THIS_SH} ./heredoc1.sub + +# test heredocs in command substitutions +${THIS_SH} ./heredoc2.sub + +${THIS_SH} ./heredoc3.sub + +echo $( + cat <<< "comsub here-string" +) + +# check that end of file delimits a here-document +# THIS MUST BE LAST! + +cat << EOF +hi +there diff --git a/tests/heredoc1.sub b/tests/heredoc1.sub new file mode 100644 index 0000000..3f85ead --- /dev/null +++ b/tests/heredoc1.sub @@ -0,0 +1,16 @@ +foo() +{ + echo + cat <\END' + +# this has to be last -- results in a syntax error +# doesn't currently parse because EOF is not on a line by itself -- should it? +(cat <0 +# are the number of tests where IFS=": " produced different results +# than IFS=" :". If a test fails the same way for IFS=": " and +# IFS=" :" then the second output line is suppressed. + +TESTS=6856 + +ksh_read=0 +echo 1 | read ksh_read +ksh_arith=0 +eval '((ksh_arith+=1))' 2>/dev/null + +failed=0 +ordered=0 +passed=0 + +split() +{ + i=$1 s=$2 r=$3 S='' R='' + for ifs in ': ' ' :' + do IFS=$ifs + set x $i + shift + IFS=' ' + g="[$#]" + while : + do case $# in + 0) break ;; + esac + g="$g($1)" + shift + done + case $g in + "$s") case $ksh_arith in + 1) ((passed+=1)) ;; + *) passed=`expr $passed + 1` ;; + esac + case $S in + '') S=$g + ;; + "$g") ;; + *) case $ksh_arith in + 1) ((ordered+=1)) ;; + *) ordered=`expr $ordered + 1` ;; + esac + ;; + esac + ;; + "$S") case $ksh_arith in + 1) ((failed+=1)) ;; + *) failed=`expr $failed + 1` ;; + esac + ;; + *) case $ksh_arith in + 1) ((failed+=1)) ;; + *) failed=`expr $failed + 1` ;; + esac + case $s in + "$S") ;; + ?0*) echo "IFS=\"$ifs\"; x=\"$i\"; set x \$x; shift; echo \"[\$#]\" # expected \"$s\" got \"$g\"" ;; + ?1*) echo "IFS=\"$ifs\"; x=\"$i\"; set x \$x; shift; echo \"[\$#](\$1)\" # expected \"$s\" got \"$g\"" ;; + ?2*) echo "IFS=\"$ifs\"; x=\"$i\"; set x \$x; shift; echo \"[\$#](\$1)(\$2)\" # expected \"$s\" got \"$g\"" ;; + ?3*) echo "IFS=\"$ifs\"; x=\"$i\"; set x \$x; shift; echo \"[\$#](\$1)(\$2)(\$3)\" # expected \"$s\" got \"$g\"" ;; + *) echo TEST ERROR i="'$i'" s="'$s'" ;; + esac + case $S in + '') S=$g + ;; + "$g") ;; + *) case $ksh_arith in + 1) ((ordered+=1)) ;; + *) ordered=`expr $ordered + 1` ;; + esac + ;; + esac + esac + case $ksh_read in + 1) echo "$i" | IFS=$ifs read x y; g="($x)($y)" ;; + *) g=`export ifs; echo "$i" | ( IFS=$ifs; read x y; echo "($x)($y)" )` ;; + esac + case $g in + "$r") case $ksh_arith in + 1) ((passed+=1)) ;; + *) passed=`expr $passed + 1` ;; + esac + case $R in + '') R=$g + ;; + "$g") ;; + *) case $ksh_arith in + 1) ((ordered+=1)) ;; + *) ordered=`expr $ordered + 1` ;; + esac + ;; + esac + ;; + "$R") case $ksh_arith in + 1) ((failed+=1)) ;; + *) failed=`expr $failed + 1` ;; + esac + ;; + *) case $ksh_arith in + 1) ((failed+=1)) ;; + *) failed=`expr $failed + 1` ;; + esac + case $r in + "$R") ;; + *) echo "echo \"$i\" | ( IFS=\"$ifs\" read x y; echo \"(\$x)(\$y)\" ) # expected \"$r\" got \"$g\"" ;; + esac + case $R in + '') R=$g + ;; + "$g") ;; + *) case $ksh_arith in + 1) ((ordered+=1)) ;; + *) ordered=`expr $ordered + 1` ;; + esac + ;; + esac + ;; + esac + done +} + +for str in \ + '-' \ + 'a' \ + '- -' \ + '- a' \ + 'a -' \ + 'a b' \ + '- - -' \ + '- - a' \ + '- a -' \ + '- a b' \ + 'a - -' \ + 'a - b' \ + 'a b -' \ + 'a b c' \ + +do + IFS=' ' + set x $str + + shift + case $# in + 0) continue ;; + esac + + f1=$1 + case $f1 in + '-') f1='' ;; + esac + + shift + case $# in + 0) for d0 in '' ' ' + do + for d1 in '' ' ' ':' ' :' ': ' ' : ' + do + case $f1$d1 in + '') split "$d0$f1$d1" "[0]" "()()" ;; + ' ') ;; + *) split "$d0$f1$d1" "[1]($f1)" "($f1)()" ;; + esac + done + done + continue + ;; + esac + f2=$1 + case $f2 in + '-') f2='' ;; + esac + + shift + case $# in + 0) for d0 in '' ' ' + do + for d1 in ' ' ':' ' :' ': ' ' : ' + do + case ' ' in + $f1$d1|$d1$f2) continue ;; + esac + for d2 in '' ' ' ':' ' :' ': ' ' : ' + do + case $f2$d2 in + '') split "$d0$f1$d1$f2$d2" "[1]($f1)" "($f1)()" ;; + ' ') ;; + *) split "$d0$f1$d1$f2$d2" "[2]($f1)($f2)" "($f1)($f2)" ;; + esac + done + done + done + continue + ;; + esac + f3=$1 + case $f3 in + '-') f3='' ;; + esac + + shift + case $# in + 0) for d0 in '' ' ' + do + for d1 in ':' ' :' ': ' ' : ' + do + case ' ' in + $f1$d1|$d1$f2) continue ;; + esac + for d2 in ' ' ':' ' :' ': ' ' : ' + do + case $f2$d2 in + ' ') continue ;; + esac + case ' ' in + $f2$d2|$d2$f3) continue ;; + esac + for d3 in '' ' ' ':' ' :' ': ' ' : ' + do + case $f3$d3 in + '') split "$d0$f1$d1$f2$d2$f3$d3" "[2]($f1)($f2)" "($f1)($f2)" ;; + ' ') ;; + *) x=$f2$d2$f3$d3 + x=${x#' '} + x=${x%' '} + split "$d0$f1$d1$f2$d2$f3$d3" "[3]($f1)($f2)($f3)" "($f1)($x)" + ;; + esac + done + done + done + done + continue + ;; + esac +done +case $ksh_arith in +1) ((tests=passed+failed)) ;; +*) tests=`expr $passed + $failed` ;; +esac +case $ordered in +0) ordered="" ;; +*) ordered=" ordered $ordered" ;; +esac +case $tests in +$TESTS) fatal="" ;; +*) fatal=" -- fundamental IFS error -- $TESTS tests expected" +esac +echo "# tests $tests passed $passed failed $failed$ordered$fatal" diff --git a/tests/ifs.right b/tests/ifs.right new file mode 100644 index 0000000..512f6ee --- /dev/null +++ b/tests/ifs.right @@ -0,0 +1,10 @@ +a:b:c +a:b:c +a:b:c +a b c d e +a:b:c:d:e +a b c d e +a:b:c:d:e +a:b:c:d:e +a b c d e +a b c d e diff --git a/tests/ifs.tests b/tests/ifs.tests new file mode 100644 index 0000000..763e2a0 --- /dev/null +++ b/tests/ifs.tests @@ -0,0 +1,61 @@ +OIFS="$IFS" +IFS=":$IFS" +eval foo="a:b:c" +IFS="$OIFS" +echo $foo + +OIFS=$IFS +IFS=":$IFS" +foo=$(echo a:b:c) +IFS=$OIFS + +for i in $foo +do + echo $i +done + +OIFS=$IFS +IFS=":$IFS" +foo=`echo a:b:c` +IFS=$OIFS + +for i in $foo +do + echo $i +done + +DEFIFS=$' \t\n' + +# local copy of IFS that shadows global version +function f +{ + typeset IFS=: + + echo $1 +} + +function ff +{ + echo $1 +} + +f a:b:c:d:e +x=a:b:c:d:e +echo $x + +IFS=: ff a:b:c:d:e +echo $x + +# doesn't get word split +IFS=$DEFIFS +# variable assignment doesn't use new value for word splitting +IFS=: echo $x +# but does this time because of the eval +IFS=: eval echo \$x + +# in posix mode, assignments preceding special builtins and functions are global +set -o posix +IFS=: export x +echo $x + +IFS="$DEFIFS" diff --git a/tests/input-line.sh b/tests/input-line.sh new file mode 100644 index 0000000..3f66c81 --- /dev/null +++ b/tests/input-line.sh @@ -0,0 +1,4 @@ +echo before calling input-line.sub +${THIS_SH} ./input-line.sub +this line for input-line.sub +echo finished with input-line.sub diff --git a/tests/input-line.sub b/tests/input-line.sub new file mode 100644 index 0000000..7bc8df2 --- /dev/null +++ b/tests/input-line.sub @@ -0,0 +1,2 @@ +read line +echo line read by $0 was \`$line\' diff --git a/tests/input.right b/tests/input.right new file mode 100644 index 0000000..8733feb --- /dev/null +++ b/tests/input.right @@ -0,0 +1,3 @@ +before calling input-line.sub +line read by ./input-line.sub was `this line for input-line.sub' +finished with input-line.sub diff --git a/tests/intl.right b/tests/intl.right new file mode 100644 index 0000000..acf108a --- /dev/null +++ b/tests/intl.right @@ -0,0 +1,51 @@ +é +1 +AéB +B +B +ok 1 +ok 2 +aéb +0000000 141 303 251 142 +0000004 +-абвгдежзиклмноп - 16 +-абвгдежзиклмноп- 15 +-абвгд- 5 +1,0000 +1.0000 +1.0000 +1.0000 +1.0000 +1,0000 +Passed all 1378 Unicode tests +0000000 303 277 012 +0000003 +0000000 303 277 012 +0000003 +0000000 303 277 012 +0000003 +0000000 303 277 012 +0000003 +0000000 357 277 277 012 +0000004 +0000000 357 277 277 012 +0000004 +0000000 012 +0000001 +0000000 012 +0000001 +0000000 012 +0000001 +0000000 012 +0000001 +0000000 303 277 012 +0000003 +0000000 303 277 012 +0000003 +0000000 303 277 012 +0000003 +0000000 101 040 302 243 040 305 222 012 +0000010 +./unicode3.sub: line 2: 5§@3™+ÆS8Ÿ¢ê³: command not found +5§@3™+ÆS8Ÿ¢ê³ ++ : $'5\247@3\231+\306S8\237\242\352\263' diff --git a/tests/intl.tests b/tests/intl.tests new file mode 100644 index 0000000..3844fa8 --- /dev/null +++ b/tests/intl.tests @@ -0,0 +1,50 @@ +export LC_ALL=en_US.UTF-8 + +a=$'\303\251' + +echo "$a" + +echo ${#a} + +b=$'A\303\251B' + +echo "$b" + +echo ${b: -1} + +c=AeB + +echo ${c: -1} + +unset a +a=$(printf '%b' 'A\303\251B') +IFS=$(printf '%b' '\303\251') + +case "$a" in +"A${IFS}B") echo ok 1 ;; +*) echo bad 1 ;; +esac + +set $a + +case $1 in +A) echo ok 2 ;; +*) echo bad 2 ;; +esac + +set a b + +printf '%s\n' "$*" +# squeeze out blanks to avoid white space differences in od implementations +printf '%s' "$*" | od -b | ( IFS=$' \t\n' ; while read line; do echo $line; done; ) + +# display differences make this problematic +${THIS_SH} ./intl1.sub + +# this tests both international handling in printf and temporary environments +${THIS_SH} ./intl2.sub + +${THIS_SH} ./unicode1.sub 2>/dev/null +${THIS_SH} ./unicode2.sub + +${THIS_SH} ./unicode3.sub 2>&1 diff --git a/tests/intl1.sub b/tests/intl1.sub new file mode 100644 index 0000000..a03648f --- /dev/null +++ b/tests/intl1.sub @@ -0,0 +1,11 @@ +LC_ALL=en_US.UTF-8 +LANG=en_US.UTF-8 + +var='абвгдежзиклмноп ' +echo -"$var"- ${#var} + +read foo <<< "$var" +echo -"$foo"- ${#foo} + +read -n 5 foo <<< "$var" +echo -"$foo"- ${#foo} diff --git a/tests/intl2.sub b/tests/intl2.sub new file mode 100644 index 0000000..64961bc --- /dev/null +++ b/tests/intl2.sub @@ -0,0 +1,11 @@ +unset LC_ALL LC_NUMERIC +export LANG=de_DE.UTF-8 +printf '%.4f\n' 1 + +LANG=C printf '%.4f\n' 1 +LANG=C /usr/bin/printf '%.4f\n' 1 + +env LANG=C printf '%.4f\n' 1 +(LANG=C; printf '%.4f\n' 1) + +printf '%.4f\n' 1 diff --git a/tests/invert.right b/tests/invert.right new file mode 100644 index 0000000..5a9239a --- /dev/null +++ b/tests/invert.right @@ -0,0 +1,10 @@ +1 +1 +1 +0 +0 +1 +0 +1 +0 +1 diff --git a/tests/invert.tests b/tests/invert.tests new file mode 100644 index 0000000..8393d95 --- /dev/null +++ b/tests/invert.tests @@ -0,0 +1,19 @@ +# tests of return value inversion +# placeholder for future expansion + +# user subshells (...) did this wrong in bash versions before 2.04 + +! ( echo hello | grep h >/dev/null 2>&1 ); echo $? +! echo hello | grep h >/dev/null 2>&1 ; echo $? + +! true ; echo $? +! false; echo $? + +! (false) ; echo $? +! (true); echo $? + +! true | false ; echo $? +! false | true ; echo $? + +! (true | false) ; echo $? +! (false | true) ; echo $? diff --git a/tests/iquote.right b/tests/iquote.right new file mode 100644 index 0000000..9476128 --- /dev/null +++ b/tests/iquote.right @@ -0,0 +1,92 @@ +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = <--> +argv[1] = <-^?-> +argv[1] = <> +argv[1] = <> +argv[1] = <^?> +argv[1] = <^?yy> +0x7f +0x7f +0x7f +argv[1] = <^?> +argv[1] = <^?@> +argv[1] = <@^?@> +argv[1] = <@^?> +argv[1] = <^?> +argv[1] = <^?@> +argv[1] = <@^?@> +argv[1] = <@^?> +argv[1] = <1> +argv[2] = <^?> +argv[3] = <^?> +argv[1] = <2> +argv[2] = <^?a> +argv[3] = <^?a> +argv[1] = <2> +argv[2] = <^?a> +argv[3] = <^?a> +argv[1] = <3> +argv[2] = <^?aa> +argv[3] = <^?aa> +argv[1] = <> +argv[1] = <--> +argv[1] = <--> +argv[1] = <^?> +argv[1] = <-^?-> +argv[1] = <^?> +argv[1] = <-^?-> +ok +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = <> +argv[1] = <> +argv[1] = <> +argv[1] = <> +argv[1] = <> +argv[1] = <> +argv[1] = <^?> +argv[1] = <^? > +argv[1] = < ^?> +argv[1] = < ^?> +argv[1] = < ^?> +argv[1] = < ^?> +argv[1] = < ^?> +argv[1] = < ^?> +argv[1] = < ^?> +argv[1] = < ^?> +argv[1] = < ^?> +argv[1] = < ^?x> +argv[1] = < ^?> +argv[1] = < ^?> +argv[1] = < ^?> +argv[1] = < ^?x> +argv[1] = <^?x> +argv[1] = <^?> +argv[1] = < ^? x> +argv[1] = <^? x> +argv[1] = <^? > diff --git a/tests/iquote.tests b/tests/iquote.tests new file mode 100644 index 0000000..a1e6362 --- /dev/null +++ b/tests/iquote.tests @@ -0,0 +1,145 @@ +# bug in bash up to and including bash-3.0 (including patches) +# +# problem is conflict between CTLNUL used internally to denote quoted null +# characters and its value (0x7f) appearing in the expansion of a variable +# +unset x +recho "xxx${x}yyy" + +y=$'\177' +recho "xxx${y}yyy" + +unset y + +unset undef + +set "" +recho ${undef-"x$*y"} + +set $'\177' +recho ${undef-"x$*y"} + +shift $# + +f() +{ + recho "-${*-x}-" +} + +f '' +f $'\177' + +unset -f f + +x=12345 + +recho "${x:6:1}" + +x= +recho "${x:0:1}" + +y=$'\177' +recho "${y:0:1}" + +y=xxx$'\177'yyy +recho "${y:3:3}" + +unset x y + +eval tmp=`printf "$'\\\\\x%x'\n" 127` +printf "%#1x\n" "'$tmp" + +x=$'\177' +printf "%#1x\n" "'$x" + +a=127 +eval c=\$\'\\$(printf '%o' $a)\' +printf "%#1x\n" "'$c" + +recho "$c" +recho "$c"@ +recho @"$c"@ +recho @"$c" + +recho "$c" +recho "$c@" +recho "@$c@" +recho "@$c" + +unset tmp x a c + +qtest() +{ + recho ${#q} "${q}" ${q} +} + +q=$'\x7f' +qtest + +q=${q}a +qtest + +q=$'\x7fa' +qtest + +q="${q}a" +qtest + +unset -f qtest +unset q + +set -- '' +recho "${*:1}" +recho ${*:1} +recho -${*:1}- +recho -"${*:1}"- + +set $'\177' +recho "${*:1}" +recho "-${*:1}-" + +recho ${*:1} +recho -${*:1}- + +shift $# + +DEL=`awk 'END{printf("%c", 0+127)}' &2 +exec 2>/dev/null +kill -n 9 $pid +wait # make sure we reap the processes while stderr is still redirected +exec 2>&5 + +echo wait-for-pid +sleep 10 & +wait $! + +echo wait-errors +wait 1-1 +wait -- -4 + +echo wait-for-background-pids +sleep 5 & +sleep 8 & +wait + +echo async list wait-for-background-pids +sleep 5 & sleep 8 & +wait + +echo async list wait for child +sleep 5 & echo forked +wait + +echo wait-when-no-children +wait + +set -m + +echo wait-for-job +sleep 5 & +wait %2 # this should be a no-such-job error +echo $? +wait %1 + +echo async list wait-for-job +sleep 5 & echo forked +wait %1 + +echo fg-bg 1 +sleep 5 & +%1 + +echo fg-bg 2 +sleep 5 & +fg %% + +echo fg-bg 3 +sleep 5 & +fg %s + +echo fg-bg 4 +sleep 5 & +fg %?ee + +# these next two are error cases +echo fg-bg 5 +sleep 15 & +fg %2 # this should be a no-such-job error +bg %1 # this should be a `bg background job?' error +wait + +# these may someday mean to start the jobs, but not print the line +# describing the status, but for now they are errors +echo fg-bg 6 +sleep 5 & +fg -s %1 +bg -s %1 +wait + +# someday this may mean to disown all stopped jobs, but for now it is +# an error +disown -s + +# this is an error -- the job with the pid that is the value of $! is +# retained only until a `wait' is performed +disown %1 + +# this, however, is an error +disown %2 + +echo wait-for-non-child +wait 1 +echo $? + +exit 1 | exit 2 | exit 3 +echo $? -- ${PIPESTATUS[@]} -- ${PIPESTATUS[0]} - ${PIPESTATUS[1]} - ${PIPESTATUS[2]} + +sleep 300 & +sleep300pid=$! +sleep 350 & +sleep 400 & + +jobs + +echo running jobs: +jobs -r + +# should be an error +kill -n 1 %4 +# should be an error +jobs %4 +echo current job: +jobs %+ +echo previous job: +jobs %- + +kill -STOP %2 +sleep 5 # give time for the shell to get the stop notification +echo after kill -STOP +echo running jobs: +jobs -r +echo stopped jobs: +jobs -s + +disown %1 + +echo after disown +jobs +echo running jobs: +jobs -r +echo stopped jobs: +jobs -s + +kill -s CONT %2 +echo after kill -s CONT +echo running jobs: +jobs -r +echo stopped jobs: +jobs -s + +kill -STOP %3 +sleep 5 # give time for the shell to get the stop notification +echo after kill -STOP, backgrounding %3: +bg %3 + +disown -h %2 + +# make sure the killed processes don't cause a message +exec 5>&2 +exec 2>/dev/null + +echo killing... +kill -n 9 $sleep300pid +kill -n 9 %2 %3 +wait # make sure we reap the processes while stderr is still redirected +echo done + +exec 2>&5 + +sleep 10 & +kill -STOP %1 +sleep 5 # give time for the shell to get the stop notification +echo after KILL -STOP, foregrounding %1 +fg %1 + +echo done diff --git a/tests/jobs1.sub b/tests/jobs1.sub new file mode 100644 index 0000000..aa9a372 --- /dev/null +++ b/tests/jobs1.sub @@ -0,0 +1,17 @@ +# make sure that jobs -p, %+, and $! all agree +set -m +sleep 60 & + +FN=/tmp/jobs-pid.$$ + +pid1=$! +jobs -p %+ > $FN +pid2=$(< $FN) +rm $FN + +if [ $pid1 -ne $pid2 ]; then + echo 'oops - $! and jobs -p %+ disagree!' +fi + +exec 2>/dev/null +kill -9 $pid1 diff --git a/tests/jobs2.sub b/tests/jobs2.sub new file mode 100644 index 0000000..496519b --- /dev/null +++ b/tests/jobs2.sub @@ -0,0 +1,13 @@ +# make sure fg and bg don't work on jobs started without job control, +# even if they are executed when job control is active +set +o monitor + +sleep 30 & +pid=$! + +set -m +fg %1 +echo fg: $? + +exec 2>/dev/null +kill -9 $pid diff --git a/tests/jobs3.sub b/tests/jobs3.sub new file mode 100644 index 0000000..6efd58b --- /dev/null +++ b/tests/jobs3.sub @@ -0,0 +1,26 @@ +#! /bin/bash +NJOB=8 +i=0 + +while [ $i -lt $NJOB ] +do + /bin/sh -c "sleep 4; exit 0" & + rv=$? + pid=$! + eval bg_pid_$i=$pid +# echo $$: Job $i: pid is $pid rv=$rv + i=$((i + 1)) +done + + + +i=0 +while [ $i -lt $NJOB ] +do + eval wpid=\$bg_pid_$i + echo Waiting for job $i #'('pid $wpid')' + wait $wpid + rv=$? + echo job $i returns $rv + i=$((i + 1)) +done diff --git a/tests/jobs4.sub b/tests/jobs4.sub new file mode 100644 index 0000000..2eb4197 --- /dev/null +++ b/tests/jobs4.sub @@ -0,0 +1,24 @@ +# test being able to use job control notation in jobs/kill/wait without +# job control active, as the SUS requires + +sleep 5 & + +sleep 5 & +sleep 5 & +sleep 5 & +(sleep 5 ; exit 4) & + +jobs + +wait %% +echo $? + +wait %1 +echo $? + +wait + +# the sleep is intended to give the kill time to execute before the job +# exits +(sleep 1 ; cat ) & +kill -1 %% && echo i killed it || echo could not kill it diff --git a/tests/jobs5.sub b/tests/jobs5.sub new file mode 100644 index 0000000..35d3981 --- /dev/null +++ b/tests/jobs5.sub @@ -0,0 +1,12 @@ +# framework to test new `wait -n' option that waits for any job to finish + +set -m + +sleep 20 & +{ sleep 5; exit 12; } & +sleep 20 & + +wait -n +echo $? + +jobs diff --git a/tests/lastpipe.right b/tests/lastpipe.right new file mode 100644 index 0000000..23fe089 --- /dev/null +++ b/tests/lastpipe.right @@ -0,0 +1,10 @@ +after 1: foo = a b c +after 2: tot = 6 +after: 7 +last = c +1 -- 142 1 +0 -- 0 1 0 +1 -- 0 0 1 +1 -- 0 0 1 +1 -- 0 1 0 +lastpipe1.sub returns 14 diff --git a/tests/lastpipe.tests b/tests/lastpipe.tests new file mode 100644 index 0000000..13fa214 --- /dev/null +++ b/tests/lastpipe.tests @@ -0,0 +1,58 @@ +binfalse() +{ + $binfalse || return 1 # normalize return value +} + +if [ -x /usr/bin/true ]; then + bintrue=/usr/bin/true +elif [ -x /bin/true ]; then + bintrue=/bin/true +else + bintrue=true +fi +if [ -x /usr/bin/false ]; then + binfalse=/usr/bin/false +elif [ -x /bin/false ]; then + binfalse=/bin/false +else + binfalse=true +fi + +shopt -s lastpipe + +unset foo bar +echo a b c | read foo +echo after 1: foo = $foo + +unset tot +declare -i tot +printf "%d\n" 1 2 3 | while read foo; do tot+=$foo; done +echo after 2: tot = $tot + +unset bar +echo g h i | bar=7 +echo after: $bar + +unset foo last +printf "%s\n" a b c | while read foo; do last=$foo; done +echo last = $last + +exit 142 | false +echo $? -- ${PIPESTATUS[@]} + +true | false | $bintrue +echo $? -- ${PIPESTATUS[@]} + +true | $bintrue | false +echo $? -- ${PIPESTATUS[@]} + +set -o pipefail +true | $bintrue | false +echo $? -- ${PIPESTATUS[@]} + +true | binfalse | true +echo $? -- ${PIPESTATUS[@]} +set +o pipefail + +${THIS_SH} ./lastpipe1.sub +echo lastpipe1.sub returns $? diff --git a/tests/lastpipe1.sub b/tests/lastpipe1.sub new file mode 100644 index 0000000..43711e3 --- /dev/null +++ b/tests/lastpipe1.sub @@ -0,0 +1,5 @@ +# with lastpipe set, exit at the end of a pipeline exits +# the calling shell +shopt -s lastpipe +exit 142 | exit 14 +echo after: $? diff --git a/tests/mapfile.data b/tests/mapfile.data new file mode 100644 index 0000000..4f1d3ce --- /dev/null +++ b/tests/mapfile.data @@ -0,0 +1,17 @@ +[0] Abcdefghijklmnop +[1] aBcdefghijklmnop +[2] abCdefghijklmnop +[3] abcDefghijklmnop +[4] abcdEfghijklmnop +[5] abcdeFghijklmnop +[6] abcdefGhijklmnop +[7] abcdefgHijklmnop +[8] abcdefghIjklmnop +[9] abcdefghiJklmnop +[a] abcdefghijKlmnop +[b] abcdefghijkLmnop +[c] abcdefghijklMnop +[d] abcdefghijklmNop +[e] abcdefghijklmnOp +[f] abcdefghijklmnoP +a \ No newline at end of file diff --git a/tests/mapfile.right b/tests/mapfile.right new file mode 100644 index 0000000..9fd4bb5 --- /dev/null +++ b/tests/mapfile.right @@ -0,0 +1,164 @@ +[0] Abcdefghijklmnop +[1] aBcdefghijklmnop +[2] abCdefghijklmnop +[3] abcDefghijklmnop +[4] abcdEfghijklmnop +[5] abcdeFghijklmnop +[6] abcdefGhijklmnop +[7] abcdefgHijklmnop +[8] abcdefghIjklmnop +[9] abcdefghiJklmnop +[a] abcdefghijKlmnop +[b] abcdefghijkLmnop +[c] abcdefghijklMnop +[d] abcdefghijklmNop +[e] abcdefghijklmnOp +[f] abcdefghijklmnoP +a[0] Abcdefghijklmnop +[1] aBcdefghijklmnop +[2] abCdefghijklmnop +[3] abcDefghijklmnop +[4] abcdEfghijklmnop +[5] abcdeFghijklmnop +[6] abcdefGhijklmnop +[7] abcdefgHijklmnop +[8] abcdefghIjklmnop +[9] abcdefghiJklmnop +[a] abcdefghijKlmnop +[b] abcdefghijkLmnop +[c] abcdefghijklMnop +[d] abcdefghijklmNop +[e] abcdefghijklmnOp +[f] abcdefghijklmnoP +a +0 [0] Abcdefghijklmnop + +1 [1] aBcdefghijklmnop + +2 [2] abCdefghijklmnop + +3 [3] abcDefghijklmnop + +4 [4] abcdEfghijklmnop + +5 [5] abcdeFghijklmnop + +6 [6] abcdefGhijklmnop + +7 [7] abcdefgHijklmnop + +8 [8] abcdefghIjklmnop + +9 [9] abcdefghiJklmnop + +10 [a] abcdefghijKlmnop + +11 [b] abcdefghijkLmnop + +12 [c] abcdefghijklMnop + +13 [d] abcdefghijklmNop + +14 [e] abcdefghijklmnOp + +15 [f] abcdefghijklmnoP + +16 a +2 [2] abCdefghijklmnop + +5 [5] abcdeFghijklmnop + +8 [8] abcdefghIjklmnop + +11 [b] abcdefghijkLmnop + +14 [e] abcdefghijklmnOp + +[0] Abcdefghijklmnop +[1] aBcdefghijklmnop +[2] abCdefghijklmnop +[3] abcDefghijklmnop +[4] abcdEfghijklmnop +[5] abcdeFghijklmnop +[6] abcdefGhijklmnop +[7] abcdefgHijklmnop +[8] abcdefghIjklmnop +[9] abcdefghiJklmnop +[a] abcdefghijKlmnop +[b] abcdefghijkLmnop +[c] abcdefghijklMnop +[d] abcdefghijklmNop +[e] abcdefghijklmnOp +[f] abcdefghijklmnoP +a +[0] aaa +[1] aaa +[2] aaa +[3] aaa +[4] aaa +[5] aaa +[6] aaa +[7] aaa +[8] aaa +[9] aaa +[0] Abcdefghijklmnop +[1] aBcdefghijklmnop +[2] abCdefghijklmnop +[3] abcDefghijklmnop +[4] abcdEfghijklmnop +[5] abcdeFghijklmnop +[6] abcdefGhijklmnop +[7] abcdefgHijklmnop +[8] abcdefghIjklmnop +[9] abcdefghiJklmnop +[a] abcdefghijKlmnop +[b] abcdefghijkLmnop +[c] abcdefghijklMnop +[d] abcdefghijklmNop +[e] abcdefghijklmnOp +[f] abcdefghijklmnoP +a +[27] aaa +[28] aaa +[29] aaa +[0] aaa +[1] aaa +[2] aaa +[3] aaa +[4] aaa +[5] aaa +[6] aaa +[7] aaa +[8] aaa +[9] aaa +[0] Abcdefghijklmnop +[1] aBcdefghijklmnop +[2] abCdefghijklmnop +[3] abcDefghijklmnop +[4] abcdEfghijklmnop +[15] aaa +[16] aaa +[17] aaa +[18] aaa +[19] aaa +[20] aaa +[21] aaa +[22] aaa +[23] aaa +[24] aaa +[25] aaa +[26] aaa +[27] aaa +[28] aaa +[29] aaa +1 2 3 4 5 +foo 0 1 + +foo 1 2 + +foo 2 3 + +foo 3 4 + +foo 4 5 + diff --git a/tests/mapfile.tests b/tests/mapfile.tests new file mode 100644 index 0000000..a9170c1 --- /dev/null +++ b/tests/mapfile.tests @@ -0,0 +1,42 @@ +declare -a A +mapfile A < mapfile.data +for (( i = 0 ; i < ${#A[@]} ; i++ )); do + echo -n "${A[${i}]}" +done + +declare -a B +mapfile -t B < mapfile.data +for (( i = 0 ; i < ${#B[@]} ; i++ )); do + echo "${B[${i}]}" +done + +mapfile -C "echo" -c 1 A < mapfile.data +mapfile -C "echo" -c 3 A < mapfile.data +mapfile -C "echo" -c 19 A < mapfile.data + +declare -a C +mapfile -t -u 3 C 3< mapfile.data < mapfile.tests +for (( i = 0 ; i < ${#C[@]} ; i++ )); do + echo "${C[${i}]}" +done + + +declare -a D +for (( i = 0 ; i < 30; i++ )); do + D[${i}]="[$i] aaa" +done +mapfile -O 10 -t D < mapfile.data +for (( i = 0 ; i < ${#D[@]} ; i++ )); do + echo "${D[${i}]}" +done + +declare -a E +for (( i = 0 ; i < 30; i++ )); do + E[${i}]="[$i] aaa" +done +mapfile -O 10 -n 5 -t E < mapfile.data +for (( i = 0 ; i < ${#E[@]} ; i++ )); do + echo "${E[${i}]}" +done + +${THIS_SH} ./mapfile1.sub diff --git a/tests/mapfile1.sub b/tests/mapfile1.sub new file mode 100644 index 0000000..b3d77f9 --- /dev/null +++ b/tests/mapfile1.sub @@ -0,0 +1,11 @@ +: ${TMPDIR:=/tmp} +FILE=$TMPDIR/file + +trap 'rm -f $FILE' 0 1 2 3 6 15 +printf "%d\n" {1..20} > $FILE + +mapfile -n 5 array < $FILE +echo ${array[@]} + +mapfile -n 5 -c 1 -C "echo foo" array < $FILE +mapfile -n 5 -c 1 -C "echo foo" array < /dev/null diff --git a/tests/misc/dev-tcp.tests b/tests/misc/dev-tcp.tests new file mode 100644 index 0000000..0f3a228 --- /dev/null +++ b/tests/misc/dev-tcp.tests @@ -0,0 +1,16 @@ +exec 9<>/dev/tcp/129.22.8.162/25 + +read banner <&9 +echo "$banner" + +echo quit >&9 + +read msg <&9 +echo "$msg" + +exec 9<&- + +# nifty date command that queries the date/time server +cat < /dev/tcp/129.22.8.102/13 + +exit 0 diff --git a/tests/misc/perf-script b/tests/misc/perf-script new file mode 100644 index 0000000..e1172a9 --- /dev/null +++ b/tests/misc/perf-script @@ -0,0 +1,81 @@ +#!/bin/bash + +typeset -i m2 m1 M n2 n1 N m n +typeset -i MM=5 NN=5 + +case $# in + 0) : + ;; + 1) MM=$1; NN=$1 + ;; + 2) MM=$1; NN=$2 + ;; + *) echo 1>&2 "Usage: $0 [m [n]]" + ;; +esac + +EMPTYLINE=: # echo +echo 'a = { ' # mathematica + +let "M=1" # for (M=1; M<=MM; M++) +while let "M <= MM"; do + let "N=1" # for (N=1; N<=NN; N++) + while let "N <= NN"; do + + let "m1 = M - 1" + let "m2 = M + 1" + let "n1 = N - 1" + let "n2 = N + 1" + + + echo -n '{ ' # math + let "m=1" # for(m=1; m<=MM; m++) + while let "m <= MM"; do + let "n=1" # for(n=1; n<=NN; n++) + while let "n <= NN"; do + + let "x = (m-m1)*(m-M)*(m-m2)" + let "y = (n-n1)*(n-N)*(n-n2)" + + if let "(x*x + (n-N)*(n-N)) * ((m-M)*(m-M) + y*y)"; then + echo -n "0," + else # neighbour + echo -n "1," + fi + + let "n=n+1" + done + echo -n " "; let "m=m+1" # ". " + done + echo '},' + + + let "N=N+1" + $EMPTYLINE + done + $EMPTYLINE + let "M=M+1" +done + +echo '}' + + + +echo -n 'o = { ' +let "m=1" +while let "m <= MM"; do + let "n=1" + while let "n <= NN"; do + echo -n "1," + let "n=n+1" + done + let "m=m+1" +done +echo " }" + + +echo 'x = LinearSolve[a,o] ' + +exit 0 + + diff --git a/tests/misc/perftest b/tests/misc/perftest new file mode 100644 index 0000000..ee3f2c6 --- /dev/null +++ b/tests/misc/perftest @@ -0,0 +1,10 @@ +# originally from Mike Haertel +foo() { case $1 in a*) ;; *) ;; esac ;} +bar() { case $1 in [abc]*) ;; *);; esac ;} +baz() { case $1 in xyzzy) ;; *) ;; esac ;} +for x in /usr/lib/*/* +do + foo $x + bar $x + baz $x +done diff --git a/tests/misc/read-nchars.tests b/tests/misc/read-nchars.tests new file mode 100644 index 0000000..40b1f98 --- /dev/null +++ b/tests/misc/read-nchars.tests @@ -0,0 +1,11 @@ +# interactive + +# from tty +read -n 3 -p 'enter three chars: ' xyz +echo +echo $xyz + +# using readline +read -p 'enter 3 chars: ' -e -n 3 abc +# readline outputs a newline for us, so we don't need the extra echo +echo $abc diff --git a/tests/misc/redir-t2.sh b/tests/misc/redir-t2.sh new file mode 100644 index 0000000..44b2624 --- /dev/null +++ b/tests/misc/redir-t2.sh @@ -0,0 +1,17 @@ +read line1 + +echo read line 1 \"$line1\" + +exec 4<&0 + +exec 0 +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[1] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[1] = +argv[1] = <~> +argv[1] = <~> +argv[1] = <\~> +argv[1] = <\ \~> +argv[1] = <\ \ \~> +argv[1] = +argv[1] = +argv[1] = +argv[1] = <$HOME> +argv[1] = <\ $HOME> +argv[1] = <\ \ $HOME> +argv[1] = <'bar'> +argv[1] = <'bar'> +argv[1] = <*@> +argv[1] = <*@> +argv[1] = <*@> +argv[1] = <*@> +argv[1] = <*@*> +argv[1] = <*@*> +argv[1] = <*@*> +argv[1] = <*@*> +argv[1] = +argv[1] = +argv[1] = <4> +argv[2] = <2> +argv[1] = <1> +argv[1] = +argv[1] = <2> +argv[1] = +argv[1] = <2> +argv[1] = <4> +argv[1] = <--\> +argv[2] = <--> +argv[1] = <--\^J--> +argv[1] = <--+\> +argv[2] = <+--> +argv[1] = <--+\^J+--> +argv[1] = <-+\> +argv[2] = <+-\> +argv[3] = <-> +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = <> +argv[1] = <> +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = <> +argv[1] = <> +argv[1] = +argv[1] = +argv[1] = <> +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = <^?> +argv[1] = <^?> +argv[1] = +argv[1] = +argv[1] = <> +argv[2] = +argv[3] = +argv[1] = <> +argv[2] = +argv[3] = <> +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +./more-exp.tests: line 272: abc=def: command not found +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[1] = +argv[1] = +argv[1] = <\a> +argv[1] = <\a> +argv[1] = <\a> +argv[1] = <\a> +argv[1] = <\\a> +argv[1] = +argv[1] = <\a> +argv[1] = <\a> +argv[1] = <\a> +argv[1] = <\a> +argv[1] = <\\a> +argv[1] = +argv[1] = +argv[1] = <\a> +argv[1] = <\a> +argv[1] = <\a> +argv[1] = <\a> +argv[1] = <$a> +argv[1] = <\foo> +argv[1] = <$a> +argv[1] = <\foo> +argv[1] = <\$a> +argv[1] = <\\$a> +argv[1] = +argv[1] = +argv[1] = <\a> +argv[1] = <\a> +argv[1] = <\a> +argv[1] = <\a> +argv[1] = +argv[2] = <{> +argv[3] = +argv[4] = +argv[5] = <}> +argv[1] = +argv[2] = +argv[3] = <}> +argv[1] = +Number of args: 0 +<${*-x}>: +<${@-x}>: +Number of args: 1 +<${*-x}>: <> +<${@-x}>: <> +Number of args: 2 +<${*-x}>: < > +<${@-x}>: < > +argv[1] = <5> +argv[1] = <5> +argv[1] = <5> +argv[1] = <5> +argv[1] = <5> +argv[1] = <0> +argv[1] = <0> +argv[1] = <0> +argv[1] = <0> +argv[1] = <0> +argv[1] = <0> +argv[1] = +argv[1] = +argv[1] = <2> +argv[1] = <0> +argv[1] = <0> +argv[1] = <1> +argv[1] = <5> +argv[1] = <5> +argv[1] = <0> +./more-exp.tests: line 423: ${#:}: bad substitution +./more-exp.tests: line 425: ${#/}: bad substitution +./more-exp.tests: line 427: ${#%}: bad substitution +./more-exp.tests: line 429: ${#=}: bad substitution +./more-exp.tests: line 431: ${#+}: bad substitution +./more-exp.tests: line 433: ${#1xyz}: bad substitution +./more-exp.tests: line 436: #: %: syntax error: operand expected (error token is "%") +argv[1] = <0> +argv[1] = +argv[1] = <+> +argv[1] = <+> +argv[1] = <+> +argv[1] = +argv[2] = +argv[3] = <}> +argv[1] = +argv[2] = +argv[3] = <}> +argv[1] = +argv[2] = +1 +argv[1] = <> +argv[1] = <> +argv[1] = <> +argv[1] = <:a:> +argv[1] = <:b:> +argv[1] = <> +argv[1] = <> diff --git a/tests/more-exp.tests b/tests/more-exp.tests new file mode 100644 index 0000000..4a3cb7f --- /dev/null +++ b/tests/more-exp.tests @@ -0,0 +1,504 @@ +expect() +{ + echo expect "$@" +} + +tool_var() { + eval $1=\"\${$1:-$2}\" + export $1 +} + +A="aaa bbb ccc" + +unset B + +tool_var B ${B:-"$A"} + +expect '' +recho "$A" +expect '' +recho "$B" + +eto_prepend() { + eval $1=\'$2\''${'$1':+":"${'$1'}}'; export $1 +} + +foo=bar; export foo +eto_prepend foo baz +expect '' +recho $foo +expect '' +recho ${foo-"bar"} + +aa='aaa bbb ccc' + +expect '' +recho ${zzz-"$aa"} +expect '' +recho ${zzz:-"bar"} +expect '' +recho "${zzz:-bar}" +expect '' +recho "${zzz:-"bar"}" + +var=abcde +expect '' +recho "${var:-xyz}" +expect '' +recho "${var:=xyz}" +expect '' +recho "${var:+xyz}" + +set 'a b' c d e f +expect ' ' +recho ${1+"$@"} +expect '' +recho "${1-"$@"}" +expect ' ' +recho ${1-"$@"} +expect ' ' +recho "${1+$@}" +expect ' ' +recho "${1+"$@"}" + +HOME=/usr/homes/chet +somevar= +expect "<$HOME>" +recho ${somevar:-~} +# This changed after bash-3.0, when the tilde implementation was redone. It's +# not backward compatible, but it's very hard to be backward-compatible here, +# and I think the old behavior was a bug +expect '<~>' +recho "${somevar:-~}" +expect '<~>' +recho "${somevar:-"~"}" +expect '<\~>' +recho "${somevar:-\~}" +expect '<\ \~>' +recho "${somevar:-\ \~}" +expect '<\ \ \~>' +recho "${somevar:-\ \ \~}" + +expect "<$HOME>" +recho ${somevar:-$HOME} +expect "<$HOME>" +recho "${somevar:-$HOME}" +expect "<$HOME>" +recho "${somevar:-"$HOME"}" +expect '<$HOME>' +recho "${somevar:-\$HOME}" +expect '<\ $HOME>' +recho "${somevar:-\ \$HOME}" +expect '<\ \ $HOME>' +recho "${somevar:-\ \ \$HOME}" + +foo=bar +expect "<'bar'>" +recho "${foo+'$foo'}" +expect "<'bar'>" +recho "${fox='$foo'}" + +P='*@*' +expect '<*@>' +recho "${P%"*"}" +expect '<*@>' +recho "${P%'*'}" + +expect '<*@>' +recho ${P%"*"} +expect '<*@>' +recho ${P%'*'} + +expect '<*@*>' +recho ${P%""} +expect '<*@*>' +recho ${P#""} + +expect '<*@*>' +recho ${P#"$foobar"} +expect '<*@*>' +recho ${P%"$foobar"} + +s1=abcdefghijkl +s2=efgh + +first=${s1/$s2*/} +expect '' +recho $first + +last=${s1##$first} +expect '' +recho $last + +shift $# +UNAME_RELEASE=${1:-4.2MP} + +RELEASE=`expr "$UNAME_RELEASE" : '[^0-9]*\([0-9]*\)'` # 4 +case "$RELEASE" in +"") RELEASE=0 ;; +*) RELEASE=`expr "$RELEASE" + 0` ;; +esac +REL_LEVEL=`expr "$UNAME_RELEASE" : '[^0-9]*[0-9]*.\([0-9]*\)'` # 1 +REL_SUBLEVEL=`expr "$UNAME_RELEASE" : '[^0-9]*[0-9]*.[0-9]*.\([0-9]*\)'` # 2 + +expect '<4> <2>' +recho $RELEASE $REL_LEVEL $REL_SUBLEVEL + +b1() +{ + b2 ${1+"$@"} +} + +b2() +{ + recho $* + recho $# +} + +expect '<1>' +b1 '' + +expect ' <2>' +b1 bar '' + +expect ' <2>' +b1 '' bar + +expect '<4>' +b1 '' '' '' '' + +NL="\\ +" + +NNL="+$NL+" + +expect '<--\> <-->' +recho --$NL-- +expect '<--\^J-->' +recho "--$NL--" + +expect '<--+\> <+-->' +recho --$NNL-- +expect '<--+\^J+-->' +recho "--$NNL--" + +expect '<-+\> <+-\> <->' +recho -$NNL-$NL- + +set '' +expect '' +recho "$*xy" +expect '' +recho "x$*y" +expect '' +recho "xy$*" +expect '' +recho x"$*"y +expect '' +recho xy"$*" +expect '' +recho "$*"xy +expect '<>' +recho "$*" +expect nothing +recho $* + +unset undef ; set "" + +expect '<>' +recho ${undef-"$*"} +expect '' +recho ${undef-"x$*y"} +expect '' +recho ${undef-"$*xy"} +expect '' +recho ${undef-"xy$*"} +expect '' +recho ${undef-x"$*"y} +expect '' +recho ${undef-xy"$*"} +expect '' +recho ${undef-"$*"xy} +expect '<>' +recho "${undef-$*}" +expect nothing +recho ${undef-$*} + +expect '<>' +recho ${undef-"$zzz"} +expect '' +recho x${undef-"$zzz"} +expect '' +recho x${undef-"$@"} +expect nothing +recho ${undef-"$@"} +expect '' +recho ${undef-"$zzz"}x +expect '' +recho ${undef-"$@"}x +expect '' +recho "$@"x +expect '' +recho "$zzz"x +expect '<^?>' +recho ${undef-} +expect '<^?>' +recho ${undef-""} + +yyy="" +recho "$xxx"x +recho "$yyy"x + +set "" "abd" "" +recho "$@"x +recho "$@"$xxx + +OIFS="$IFS" + +arg=a,b,c,d,e,f + +IFS=, + +export z=$arg + +eval z1=\"$arg\" + +IFS="$OIFS" + +recho $z +recho $z1 + +# should give an error +abc\=def + +zz="a b c d e" +declare a=$zz + +recho "$a" +recho $a + +recho $(echo "foo$(echo ")")") + +# test backslash escapes + +recho \a +recho \\a + +recho "\a" +recho "\\a" + +recho '\a' +recho '\\a' + +recho $(zecho \a) +recho $(zecho \\a) + +recho $(zecho "\a") +recho $(zecho "\\a") + +recho $(zecho '\a') +recho $(zecho '\\a') + +recho `zecho \a` +recho `zecho \\a` + +recho `zecho "\a"` +recho `zecho "\\a"` + +recho `zecho '\a'` +recho `zecho '\\a'` + +a=foo + +recho \$a +recho \\$a + +recho "\$a" +recho "\\$a" + +recho '\$a' +recho '\\$a' + +recho $(zecho `zecho \a`) +recho $(zecho `zecho \\a`) + +recho $(zecho `zecho "\a"`) +recho $(zecho `zecho "\\a"`) + +recho $(zecho `zecho '\a'`) +recho $(zecho `zecho '\\a'`) + +# should echo G { I K } +recho ${abc:-G { I } K } + +abc=hi + +# should echo hi K } +recho ${abc:-G { I } K } + +# should echo a* +unset foo +recho "${foo:-"a"}*" + +f () +{ + echo "Number of args: $#" + echo "<\${*-x}>: <${*-x}>" + echo "<\${@-x}>: <${@-x}>" +} + +f +f '' +f '' '' + +set 1 2 3 4 5 + +expect '<5>' +recho ${#} +expect '<5>' +recho ${#:foo} +expect '<5>' +recho ${#:-foo} +expect '<5>' +recho ${#-posparams} +expect '<5>' +recho ${#:-posparams} + +expect '<0>' +recho ${#!} + +expect nothing +recho $! +expect nothing +recho ${!} + +expect nothing +recho $8 +expect nothing +recho ${8} + +shift $# + +expect '<0>' +recho ${#} +expect '<0>' +recho ${#:foo} +expect '<0>' +recho ${#:-foo} +expect '<0>' +recho ${#-posparams} +expect '<0>' +recho ${#:-posparams} + +expect '' +recho ${!-posparams} +expect '' +recho ${!:-posparams} + +expect '<2>' +recho ${#-} + +expect '<0>' +recho ${#-posparams} + +expect '<0>' +recho ${#?:-xyz} + +expect '<1>' +recho ${#?} + +set a b c d e + +expect '<5>' +recho ${#} +expect '<5>' +recho ${#?:-xyz} + +shift $# + +expect '<0>' +recho ${#:-foo} + +expect a bad substitution error +recho ${#:} +expect a bad substitution error +recho ${#/} +expect a bad substitution error +recho ${#%} +expect a bad substitution error +recho ${#=} +expect a bad substitution error +recho ${#+} +expect a bad substitution error +recho ${#1xyz} + +expect a math syntax error +recho ${#:%} + +expect '<0>' +recho ${#:-} + +set -- +unset a b + +x=a +y=b + +IFS=+ + +expect '' +recho $x+$y +expect '<+>' +recho $a+$b + +expect '<+>' +recho + "$@" +expect '<+>' +recho +"$@" + +# variants of nested curly braces inside ${...} expressions + +# IFS is not the standard one + +expect '' '' '<}>' +recho ${gik:-G { I } K } + +abc=hi + +expect '' '' '<}>' +recho ${abc:-G { I } K } + +# reset IFS to the default +IFS=' +' + +# nested ${...} inside ${...} are handled specially +unset XXX FOO BAR +expect '' '' +XXX=xxx +FOO=${BAR:-${XXX} yyy} +recho $FOO + +# this was a bug in versions of bash prior to bash-2.04-release +set -- '' +expect 1 +echo $# +expect '<>' +recho "${@}" +expect '<>' +recho "${@-}" +expect '<>' +recho "${@:-}" + +# this was a bug in bash-2.04, fixed in 2.05 +set -- a b +expect '<:a:>' '<:b:>' +for i in "${@-}"; do recho :$i:; done + +# I believe that ksh93 does these wrong -- we're using the rhs, so shouldn't +# it behave the same as ""? +set -- +expect '<>' +recho "${@-}" +expect '<>' +recho "${@:-}" diff --git a/tests/nameref.right b/tests/nameref.right new file mode 100644 index 0000000..5321534 --- /dev/null +++ b/tests/nameref.right @@ -0,0 +1,129 @@ +one +two +three +declare -n fee="flip" +declare -n foo="bar" +turning off nameref attribute on foo +bar +after +n foo bar = other +one +two +one +expect +argv[1] = +expect +argv[1] = +expect +one +expect +one +expect +argv[1] = +changevar: expect +argv[1] = +expect +argv[1] = +changevar: expect +argv[1] = +expect +argv[1] = +./nameref.tests: line 93: bar: readonly variable +./nameref.tests: line 94: foo: readonly variable +one +one +./nameref.tests: line 106: foo: readonly variable +./nameref.tests: line 103: foo: readonly variable +one +one +bar + +./nameref2.sub: line 5: foo: readonly variable + +expect +argv[1] = +expect +argv[1] = +expect +argv[1] = +expect +argv[1] = +./nameref3.sub: line 21: unset: bar: cannot unset: readonly variable +expect +two +expect +two +three +unset +four +0 +expect +a b +expect +foo +1 3 5 7 9 +9 +1 3 42 7 9 +1 3 42 7 9 +9 +1 3 44 7 9 +unset +expect +argv[1] = +expect +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +16 +expect <4> +4 +expect <4> +4 +expect <4> +4 +expect +one +expect +one +expect +one +expect +four +errors = 0 +1 +2 +v1: 1 +v2: 2 +ref -> first, value: I am first +ref -> second, value: I am in the middle +ref -> third, value: I am last +final state: ref -> third, value: I am last +ref -> one, value: 1 +ref -> two, value: 2 +ref -> three, value: 3 +final state: ref -> three, value: 3 +./nameref5.sub: line 43: unset: three: cannot unset: readonly variable +ref -> one, value: 1 +ref -> two, value: 2 +ref -> three, value: 3 +final state: ref -> three, value: 3 +./nameref6.sub: line 2: typeset: x: nameref variable self references not allowed +./nameref6.sub: line 12: typeset: x: reference variable cannot be an array +the -- 1 +42 -- 0 +y -- 0 +2 -- 0 +2 -- 0 +y -- 0 +bar +unset +inside +inside: two +outside: +foo +local +./nameref8.sub: line 47: typeset: v: nameref variable self references not allowed +./nameref8.sub: line 54: warning: x: circular name reference +./nameref8.sub: line 55: warning: x: circular name reference +x = diff --git a/tests/nameref.tests b/tests/nameref.tests new file mode 100644 index 0000000..438133c --- /dev/null +++ b/tests/nameref.tests @@ -0,0 +1,118 @@ +# basic nameref tests +bar=one +flow=two +flip=three + +foo=bar +typeset -n foo + +typeset -n fee=flow + +echo ${foo} +echo ${fee} + +typeset -n fee=flip +echo ${fee} + +typeset -n + +echo turning off nameref attribute on foo +typeset +n foo=other +echo ${foo} +echo after +n foo bar = $bar + +unset foo bar fee + +bar=one + +foo=bar +typeset -n foo + +foo=two printf "%s\n" $foo +foo=two eval 'printf "%s\n" $foo' + +foo=two echo $foo + +unset foo bar +# other basic assignment tests +bar=one + +echo "expect " +recho ${bar} +typeset -n foo=bar +foo=two + +echo "expect " +recho ${bar} + +# this appears to be a ksh93 bug; it doesn't unset foo here and messes up +# later +unset foo bar + +# initial tests of working inside shell functions +echoval() +{ + typeset -n ref=$1 + printf "%s\n" $ref +} + +foo=bar +bar=one +echo "expect <$foo>" +echoval foo +echo "expect <$bar>" +echoval bar + +unset foo bar +changevar() +{ + typeset -n v=$1 + + shift + v="$@" + echo "changevar: expect <$@>" + recho "$v" +} + +bar=one + +echo "expect " +recho ${bar} +changevar bar two +echo "expect " +recho $bar + +changevar bar three four five +echo "expect " +recho "$bar" + +unset foo bar +unset -n foo bar +readonly foo=one +typeset -n bar=foo +bar=4 +foo=4 + +echo $foo +echo $bar + +assignvar() +{ + typeset -n ref=$1 + shift + ref="$@" +} + +readonly foo=one + +assignvar foo two three four +echo $foo + +${THIS_SH} ./nameref1.sub +${THIS_SH} ./nameref2.sub +${THIS_SH} ./nameref3.sub +${THIS_SH} ./nameref4.sub +${THIS_SH} ./nameref5.sub +${THIS_SH} ./nameref6.sub +${THIS_SH} ./nameref7.sub +${THIS_SH} ./nameref8.sub diff --git a/tests/nameref1.sub b/tests/nameref1.sub new file mode 100644 index 0000000..50bb25d --- /dev/null +++ b/tests/nameref1.sub @@ -0,0 +1,13 @@ +# indirect referencing of a nameref returns the variable name it references +unset foo bar + +bar=one +foo=bar + +typeset -n foo + +echo ${foo} +echo ${!foo} + +# this is a current incompatibility +echo ${!foo[0]} diff --git a/tests/nameref2.sub b/tests/nameref2.sub new file mode 100644 index 0000000..547cc19 --- /dev/null +++ b/tests/nameref2.sub @@ -0,0 +1,7 @@ +# test readonly nameref variables +# ksh93 allows this but not typeset -rn ref=foo? +typeset -n ref=foo +readonly ref +foo=4 + +echo $ref diff --git a/tests/nameref3.sub b/tests/nameref3.sub new file mode 100644 index 0000000..5790291 --- /dev/null +++ b/tests/nameref3.sub @@ -0,0 +1,37 @@ +# nameref requires changes to unset +bar=one +typeset -n foo=bar + +# normal unset unsets only variable nameref references +# need unset -n to unset nameref itself +unset foo +echo "expect " +recho ${bar-unset} +echo "expect " +recho ${foo-unset} +echo "expect " +recho ${!foo} +unset -n foo +echo "expect " +recho "${!foo-unset}" + +readonly bar=two +typeset -n foo=bar + +unset foo # this should fail because bar is readonly + +echo "expect " +echo ${bar-unset} +echo "expect " +echo ${foo-unset} + +# one question is what happens when you unset the underlying variable +qux=three +typeset -n ref +ref=qux + +echo $ref +unset qux +echo ${ref-unset} +qux=four +echo ${ref-unset} diff --git a/tests/nameref4.sub b/tests/nameref4.sub new file mode 100644 index 0000000..f1e2aef --- /dev/null +++ b/tests/nameref4.sub @@ -0,0 +1,212 @@ +# test suite cribbed from ksh93 nameref tests +typeset -i errors=0 +ckval() +{ + typeset -n one=$1 + + if [[ $one != $2 ]]; then + echo "one=$one != 2=$2" + (( errors++ )) + fi +} + +ckref() +{ + typeset -n one=$1 two=$2 + + if [[ $one != $two ]]; then + echo "one=$one != two=$two" + (( errors++ )) + fi +} + +name=first + +ckref name name + +func1() +{ + typeset -n color=$1 + func2 color +} + +func2() +{ + typeset color=$1 + set -- ${color[@]} + printf "<%s>" "$@" + echo +} + +typeset -A color +color[apple]=red +color[grape]=purple +color[banana]=yellow + +# XXX +#func1 color + +unset foo bar +export bar=foo +typeset -n foo=bar +ckval foo foo + +# XXX - need to see if we can do checks for self-referencing at assignment +# time +command typeset -n xx=yy +command typeset -n yy=xx +echo $? + +unset foo bar +unset -n foo bar +set foo +typeset -n bar=$1 +foo=hello +ckval bar hello + +# XXX -- another self-referencing error? +# ksh93 makes this another invalid self-reference +unset foo bar +bar=123 +foobar() +{ + typeset -n foo=bar + typeset -n foo=bar + + ckval foo 123 +} + +typeset -n short=long +short=( a b ) +echo "expect " +echo ${long[@]} +unset short long + +# assignment to a previously-unset variable +typeset -n short=long +short=foo +echo "expect " +echo ${long} +unset short long + +unset foo bar + +# simple array references and assignments +typeset -n foo=bar +bar=( 1 3 5 7 9) +echo ${foo[@]} +echo ${foo[4]} +foo[2]=42 +echo ${bar[@]} + +barfunc() +{ + typeset -n v=$1 + echo ${v[@]} + echo ${v[4]} + v[2]=44 + echo ${bar[@]} +} +barfunc bar + +unset -f foobar +unset foo bar + +# should ref at global scope survive call to foobar()? +unset ref x +typeset -n ref +x=42 +foobar() +{ + local xxx=3 + ref=xxx + return 0 +} +echo ${ref-unset} +ref=x +foobar +ckval ref xxx +ckval x xxx + +# assignment in a function to something possibly out of scope +assignvar() +{ + typeset -n v=$1 + shift + v="$@" +} + +assignvar lex a b c d e +echo "expect " +recho "${lex}" + +unset foo bar short long + +typeset -n foo='x[2]' + +x=(zero one two three four) +foo=seven + +echo "expect " +recho "${x[@]}" + +unset ref x +typeset -n ref +ref=x +# make sure nameref to a previously-unset variable creates the variable +ref=42 +ckval x 42 + +# make sure they work inside arithmetic expressions +unset foo bar ref x xxx +typeset -i ivar +typeset -n iref=ivar + +ivar=4+3 +ckval ivar 7 +iref+=5 +ckval ivar 12 +echo $(( iref+4 )) +(( iref=17 )) +ckval ivar 17 + +typeset +n iref +unset iref ivar + +typeset +n foo bar +unset foo bar + +# should the reference do immediate evaluation or deferred? +set -- one two three four +bar=4 +# XXX - what does foo get set to here? +typeset -n foo='bar[0]' +echo "expect <4>" +echo ${bar[0]} +echo "expect <4>" +echo ${foo} +echo "expect <4>" +echo $foo +ckval foo $bar + +# Need to add code and tests for nameref to array subscripts +bar=(one two three four) + +typeset -n foo='bar[0]' +typeset -n qux='bar[3]' +echo "expect " +echo ${bar[0]} +echo "expect " +echo ${foo} +echo "expect " +echo $foo +ckval foo $bar + +echo "expect " +echo $qux +ckval qux ${bar[3]} + +# Need to add code and tests for `for' loop nameref variables + +echo errors = $errors +exit $errors diff --git a/tests/nameref5.sub b/tests/nameref5.sub new file mode 100644 index 0000000..2c67a94 --- /dev/null +++ b/tests/nameref5.sub @@ -0,0 +1,50 @@ +# nameref variables as for loop index variables are special +v1=1 +v2=2 + +# simple for loop +for v in v1 v2 +do + typeset -n ref=$v + echo $ref +done +unset v + +set -- first second third fourth fifth + +# unless you put a ${!v} in the for loop, ksh93 misbehaves +typeset -n v=v1 +for v in v1 v2; do + echo "${!v}: $v" +done +unset v + +# example cribbed from ksh93 o'reilly book +first="I am first" +second="I am in the middle" +third="I am last" + +typeset -n ref=first +for ref in first second third ; do + echo "ref -> ${!ref}, value: $ref" +done +echo final state: "ref -> ${!ref}, value: $ref" + +readonly one=1 +readonly two=2 +readonly three=3 + +typeset -n ref=one +for ref in one two three; do + echo "ref -> ${!ref}, value: $ref" +done +echo final state: "ref -> ${!ref}, value: $ref" + +unset ref +typeset -n ref=one +readonly ref + +for ref in one two three; do + echo "ref -> ${!ref}, value: $ref" +done +echo final state: "ref -> ${!ref}, value: $ref" diff --git a/tests/nameref6.sub b/tests/nameref6.sub new file mode 100644 index 0000000..cf70d41 --- /dev/null +++ b/tests/nameref6.sub @@ -0,0 +1,44 @@ +# these should be errors +typeset -n x=x +#echo $x -- $? + +typeset -n x[3]=x +#echo $x -- $? + +x=(the browns suck) +y=(one two three) +# should be an error but not disturb the current contents of x +# maybe rethink that later +typeset -n x=y +echo $x -- $? + +typeset -n + +unset x y + +y=42 +typeset -i x=1 + +# the integer attribute causes arithmetic eval to be done +# we should not allow namerefs to non-identifiers +typeset -n x=y +echo $x -- $? + +typeset +n x +echo $x -- $? + +# same kind of thing + +unset -n x +unset y + +set -- first second third +y=2 +typeset -i x=1 + +typeset -n x=y +echo $x -- $? +echo ${x} -- $? + +typeset +n x +echo $x -- $? diff --git a/tests/nameref7.sub b/tests/nameref7.sub new file mode 100644 index 0000000..19bdc98 --- /dev/null +++ b/tests/nameref7.sub @@ -0,0 +1,18 @@ +fn () +{ + declare -n var=foo; var=bar +} + +unset foo +fn +echo ${foo:-unset} + +unset -f fn +unset foo +fn() +{ + declare -n var; var=foo +} + +fn +echo ${foo:-unset} diff --git a/tests/nameref8.sub b/tests/nameref8.sub new file mode 100644 index 0000000..6837f6f --- /dev/null +++ b/tests/nameref8.sub @@ -0,0 +1,57 @@ +function f1 +{ + typeset -n v=$1 + + v=inside +} + +v=global +f1 v +echo $v + +unset v +unset -f f1 + +function foo +{ + typeset x=one + + typeset -n y=$1 + y=two + echo inside: $x +} + +foo x +echo outside: $x + +function foo2 +{ + typeset -n x=$1 + + x=foo +} + +foo2 x +echo $x + +unset -f foo +function foo { typeset -n v=$1; v=local; } + +v=global +foo v +echo $v + +unset v + +# invalid self reference at global scope +typeset -n v=v + +# can we catch a circular self-reference? +typeset -n v=w +typeset -n w=x +typeset -n x=v + +x=4 +echo x = $x + +unset -n v w x diff --git a/tests/new-exp.right b/tests/new-exp.right new file mode 100644 index 0000000..3243d05 --- /dev/null +++ b/tests/new-exp.right @@ -0,0 +1,575 @@ +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +./new-exp.tests: line 24: HOME: }: syntax error: operand expected (error token is "}") +unset +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = <*@> +argv[1] = <*@> +argv[1] = <@*> +argv[1] = <)> +argv[1] = <")"> +argv[1] = <-abcd> +argv[2] = <-> +argv[1] = <-abcd> +argv[2] = <-> +argv[1] = <-abcd-> +bar foo +bar foo +bar foo +barfoo +barfoo +\x +argv[1] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = <4> +argv[1] = +argv[1] = +argv[1] = +./new-exp.tests: line 172: ABX: unbound variable +./new-exp.tests: line 176: $6: cannot assign in this way +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = + +This +string +has +multiple +lines. +This-string-has-multiple-lines. +this is a test of proc subst +this is test 2 +./new-exp2.sub: line 31: /tmp/bashtmp.x*: No such file or directory +./new-exp2.sub: line 35: /tmp/redir-notthere: No such file or directory +1 + +./new-exp2.sub: line 42: 1111111111111111111111: command not found + +argv[1] = <6> +./new-exp.tests: line 277: ${#:}: bad substitution +argv[1] = <'> +argv[1] = <"> +argv[1] = <"hello"> +argv[1] = <> +argv[1] = <> +argv[1] = <> +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[1] = <> +argv[1] = <> +argv[1] = <> +argv[1] = <> +argv[1] = <> +argv[1] = <> +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = <"2 3"> +argv[1] = <"2:3"> +argv[1] = <"34"> +argv[1] = <"3456"> +argv[1] = <"3456"> +argv[1] = <"3456"> +argv[1] = <^A> +argv[2] = <^B> +argv[3] = <^?> +argv[1] = <^A> +argv[2] = <^B> +argv[3] = <^?> +argv[1] = <^A> +argv[2] = <^B> +argv[3] = <^?> +argv[1] = <^A> +argv[2] = <^B> +argv[3] = <^?> +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[8] = +argv[9] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[8] = +argv[9] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[8] = +argv[9] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[8] = +argv[9] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[8] = +argv[9] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[8] = +argv[9] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[8] = +argv[9] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[8] = +argv[9] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[8] = +argv[9] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[8] = +argv[9] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[8] = +argv[9] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[8] = +argv[9] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[8] = +argv[9] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[8] = +argv[9] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[8] = +argv[9] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[8] = +argv[9] = +./new-exp.tests: line 482: $9: unbound variable +./new-exp.tests: line 483: 9: unbound variable +./new-exp.tests: line 484: UNSET: unbound variable +./new-exp.tests: line 485: UNSET: unbound variable +./new-exp.tests: line 486: UNSET: unbound variable +./new-exp.tests: line 487: UNSET: unbound variable +./new-exp.tests: line 488: UNSET: unbound variable +argv[1] = <5> +argv[1] = <#> +argv[1] = <#> +argv[1] = <> +argv[1] = <_QUANTITY> +argv[2] = <_QUART> +argv[3] = <_QUEST> +argv[4] = <_QUILL> +argv[5] = <_QUOTA> +argv[6] = <_QUOTE> +argv[1] = <_QUANTITY> +argv[2] = <_QUART> +argv[3] = <_QUEST> +argv[4] = <_QUILL> +argv[5] = <_QUOTA> +argv[6] = <_QUOTE> +argv[1] = <_QUANTITY-_QUART-_QUEST-_QUILL-_QUOTA-_QUOTE> +./new-exp3.sub: line 19: ${!_Q* }: bad substitution +./new-exp3.sub: line 24: ${!1*}: bad substitution +./new-exp3.sub: line 26: ${!@*}: bad substitution +Case01---3---A:B:C--- +Case02---1---A B C::--- +Case03---3---A:B:C--- +Case04---3---A:B:C--- +Case05---3---A:B:C--- +Case06---1---A B C::--- +Case07---3---A:B:C--- +Case08---3---A:B:C--- +./new-exp.tests: line 508: ${$(($#-1))}: bad substitution +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[1] = +argv[1] = +argv[2] = +argv[1] = <> +./new-exp.tests: line 527: $(($# - 2)): substring expression < 0 +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = <.> +argv[6] = +argv[7] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = <.> +argv[6] = +argv[7] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = <.> +argv[6] = +argv[7] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +two +one +ne +one + +one +one +one +1 2 3 4 5 6 7 8 9 +9 +9 +0 +9 +8 9 +123456789 +9 +9 +4, A B C D +2, C D +h +h +--blah +--blah +lah +lah +abcde abcfg abchi +foode foofg foohi +argv[1] = <> +argv[1] = <+> +argv[1] = <+^?> +argv[1] = <+> +argv[1] = <^?2> +argv[1] = <^?2> +argv[1] = <^?> +argv[1] = <^?> +argv[1] = <> +argv[1] = <> +argv[1] = <> +argv[1] = <> +argv[1] = <12> +argv[1] = <> +argv[1] = <> +argv[1] = +foo is a function +foo () +{ + echo < <(cat x1) +} +foo () +{ + echo < <(cat x1) +} +bar () { echo < <(cat x1) } +bar is a function +bar () +{ + echo < <(cat x1) +} +start;ing0;ing1;ing2;ing3;ing4;ing5;ing6;ing7;ing8;ing9;ing10;ing11;ing12;ing13;ing14;ing15;ing16;ing17;ing18;ing19;ing20;ing21;ing22;ing23;ing24;ing25;ing26;ing27;ing28;ing29;ing30;ing31;ing32;ing33;ing34;ing35;ing36;ing37;ing38;ing39;ing40;ing41;ing42;ing43;ing44;ing45;ing46;ing47;ing48;ing49;ing50;ing51;ing52;ing53;ing54;ing55;ing56;ing57;ing58;ing59;ing60;ing61;ing62;ing63;ing64;ing65;ing66;ing67;ing68;ing69;ing70;ing71;ing72;ing73;ing74;ing75;ing76;ing77;ing78;ing79;ing80;ing81;ing82;ing83;ing84;ing85;ing86;ing87;ing88;ing89;ing90;ing91;ing92;ing93;ing94;ing95;ing96;ing97;ing98;ing99;ing100;ing101;ing102;ing103;ing104;ing105;ing106;ing107;ing108;ing109;ing110;ing111;ing112;ing113;ing114;ing115;ing116;ing117;ing118;ing119;ing120;ing121;ing122;ing123;ing124;ing125;ing126;ing127;ing128;ing129;ing130;ing131;ing132;ing133;ing134;ing135;ing136;ing137;ing138;ing139;ing140;ing141;ing142;ing143;ing144;ing145;ing146;ing147;ing148;ing149;ing150;ing151;ing152;ing153;ing154;ing155;ing156;ing157;ing158;ing159;ing160;ing161;ing162;ing163;ing164;ing165;ing166;ing167;ing168;ing169;ing170;ing171;ing172;ing173;ing174;ing175;ing176;ing177;ing178;ing179;ing180;ing181;ing182;ing183;ing184;ing185;ing186;ing187;ing188;ing189;ing190;ing191;ing192;ing193;ing194;ing195;ing196;ing197;ing198;ing199;ing200;ing201;ing202;ing203;ing204;ing205;ing206;ing207;ing208;ing209;ing210;ing211;ing212;ing213;ing214;ing215;ing216;ing217;ing218;ing219;ing220;ing221;ing222;ing223;ing224;ing225;ing226;ing227;ing228;ing229;ing230;ing231;ing232;ing233;ing234;ing235;ing236;ing237;ing238;ing239;ing240;ing241;ing242;ing243;ing244;ing245;ing246;ing247;ing248;ing249;ing250;ing251;ing252;ing253;ing254;ing255;ing256;ing257;ing258;ing259;ing260;ing261;ing262;ing263;ing264;ing265;ing266;ing267;ing268;ing269;ing270;ing271;ing272;ing273;ing274;ing275;ing276;ing277;ing278;ing279;ing280;ing281;ing282;ing283;ing284;ing285;ing286;ing287;ing288;ing289;ing290;ing291;ing292;ing293;ing294;ing295;ing296;ing297;ing298;ing299;ing300;ing301;ing302;ing303;ing304;ing305;ing306;ing307;ing308;ing309;ing310;ing311;ing312;ing313;ing314;ing315;ing316;ing317;ing318;ing319;ing320;ing321;ing322;ing323;ing324;ing325;ing326;ing327;ing328;ing329;ing330;ing331;ing332;ing333;ing334;ing335;ing336;ing337;ing338;ing339;ing340;ing341;ing342;ing343;ing344;ing345;ing346;ing347;ing348;ing349;ing350;ing351;ing352;ing353;ing354;ing355;ing356;ing357;ing358;ing359;ing360;ing361;ing362;ing363;ing364;ing365;ing366;ing367;ing368;ing369;ing370;ing371;ing372;ing373;ing374;ing375;ing376;ing377;ing378;ing379;ing380;ing381;ing382;ing383;ing384;ing385;ing386;ing387;ing388;ing389;ing390;ing391;ing392;ing393;ing394;ing395;ing396;ing397;ing398;ing399;ing400;ing401;ing402;ing403;ing404;ing405;ing406;ing407;ing408;ing409;ing410;ing411;ing412;ing413;ing414;ing415;ing416;ing417;ing418;ing419;ing420;ing421;ing422;ing423;ing424;ing425;ing426;ing427;ing428;ing429;ing430;ing431;ing432;ing433;ing434;ing435;ing436;ing437;ing438;ing439;ing440;ing441;ing442;ing443;ing444;ing445;ing446;ing447;ing448;ing449;ing450;ing451;ing452;ing453;ing454;ing455;ing456;ing457;ing458;ing459;ing460;ing461;ing462;ing463;ing464;ing465;ing466;ing467;ing468;ing469;ing470;ing471;ing472;ing473;ing474;ing475;ing476;ing477;ing478;ing479;ing480;ing481;ing482;ing483;ing484;ing485;ing486;ing487;ing488;ing489;ing490;ing491;ing492;ing493;ing494;ing495;ing496;ing497;ing498;ing499;ing500;ing501;ing502;ing503;ing504;ing505;ing506;ing507;ing508;ing509;ing510;ing511;ing512;ing513;ing514;ing515;ing516;ing517;ing518;ing519;ing520;ing521;ing522;ing523;ing524;ing525;ing526;ing527;ing528;ing529;ing530;ing531;ing532;ing533;ing534;ing535;ing536;ing537;ing538;ing539;ing540;ing541;ing542;ing543;ing544;ing545;ing546;ing547;ing548;ing549;ing550;ing551;ing552;ing553;ing554;ing555;ing556;ing557;ing558;ing559;ing560;ing561;ing562;ing563;ing564;ing565;ing566;ing567;ing568;ing569;ing570;ing571;ing572;ing573;ing574;ing575;ing576;ing577;ing578;ing579;ing580;ing581;ing582;ing583;ing584;ing585;ing586;ing587;ing588;ing589;ing590;ing591;ing592;ing593;ing594;ing595;ing596;ing597;ing598;ing599;ing600;ing601;ing602;ing603;ing604;ing605;ing606;ing607;ing608;ing609;ing610;ing611;ing612;ing613;ing614;ing615;ing616;ing617;ing618;ing619;ing620;ing621;ing622;ing623;ing624;ing625;ing626;ing627;ing628;ing629;ing630;ing631;ing632;ing633;ing634;ing635;ing636;ing637;ing638;ing639;ing640;ing641;ing642;ing643;ing644;ing645;ing646;ing647;ing648;ing649;ing650;ing651;ing652;ing653;ing654;ing655;ing656;ing657;ing658;ing659;ing660;ing661;ing662;ing663;ing664;ing665;ing666;ing667;ing668;ing669;ing670;ing671;ing672;ing673;ing674;ing675;ing676;ing677;ing678;ing679;ing680;ing681;ing682;ing683;ing684;ing685;ing686;ing687;ing688;ing689;ing690;ing691;ing692;ing693;ing694;ing695;ing696;ing697;ing698;ing699;ing700;ing701;ing702;ing703;ing704;ing705;ing706;ing707;ing708;ing709;ing710;ing711;ing712;ing713;ing714;ing715;ing716;ing717;ing718;ing719;ing720;ing721;ing722;ing723;ing724;ing725;ing726;ing727;ing728;ing729;ing730;ing731;ing732;ing733;ing734;ing735;ing736;ing737;ing738;ing739;ing740;ing741;ing742;ing743;ing744;ing745;ing746;ing747;ing748;ing749;ing750;ing751;ing752;ing753;ing754;ing755;ing756;ing757;ing758;ing759;ing760;ing761;ing762;ing763;ing764;ing765;ing766;ing767;ing768;ing769;ing770;ing771;ing772;ing773;ing774;ing775;ing776;ing777;ing778;ing779;ing780;ing781;ing782;ing783;ing784;ing785;ing786;ing787;ing788;ing789;ing790;ing791;ing792;ing793;ing794;ing795;ing796;ing797;ing798;ing799;ing800;ing801;ing802;ing803;ing804;ing805;ing806;ing807;ing808;ing809;ing810;ing811;ing812;ing813;ing814;ing815;ing816;ing817;ing818;ing819;ing820;ing821;ing822;ing823;ing824;ing825;ing826;ing827;ing828;ing829;ing830;ing831;ing832;ing833;ing834;ing835;ing836;ing837;ing838;ing839;ing840;ing841;ing842;ing843;ing844;ing845;ing846;ing847;ing848;ing849;ing850;ing851;ing852;ing853;ing854;ing855;ing856;ing857;ing858;ing859;ing860;ing861;ing862;ing863;ing864;ing865;ing866;ing867;ing868;ing869;ing870;ing871;ing872;ing873;ing874;ing875;ing876;ing877;ing878;ing879;ing880;ing881;ing882;ing883;ing884;ing885;ing886;ing887;ing888;ing889;ing890;ing891;ing892;ing893;ing894;ing895;ing896;ing897;ing898;ing899;ing900;ing901;ing902;ing903;ing904;ing905;ing906;ing907;ing908;ing909;ing910;ing911;ing912;ing913;ing914;ing915;ing916;ing917;ing918;ing919;ing920;ing921;ing922;ing923;ing924;ing925;ing926;ing927;ing928;ing929;ing930;ing931;ing932;ing933;ing934;ing935;ing936;ing937;ing938;ing939;ing940;ing941;ing942;ing943;ing944;ing945;ing946;ing947;ing948;ing949;ing950;ing951;ing952;ing953;ing954;ing955;ing956;ing957;ing958;ing959;ing960;ing961;ing962;ing963;ing964;ing965;ing966;ing967;ing968;ing969;ing970;ing971;ing972;ing973;ing974;ing975;ing976;ing977;ing978;ing979;ing980;ing981;ing982;ing983;ing984;ing985;ing986;ing987;ing988;ing989;ing990;ing991;ing992;ing993;ing994;ing995;ing996;ing997;ing998;ing999 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +start;string0;string1;string2;string3;string4;string5;string6;string7;string8;string9;string10;string11;string12;string13;string14;string15;string16;string17;string18;string19;string20;string21;string22;string23;string24;string25;string26;string27;string28;string29;string30;string31;string32;string33;string34;string35;string36;string37;string38;string39;string40;string41;string42;string43;string44;string45;string46;string47;string48;string49;string50;string51;string52;string53;string54;string55;string56;string57;string58;string59;string60;string61;string62;string63;string64;string65;string66;string67;string68;string69;string70;string71;string72;string73;string74;string75;string76;string77;string78;string79;string80;string81;string82;string83;string84;string85;string86;string87;string88;string89;string90;string91;string92;string93;string94;string95;string96;string97;string98;string99;string100;string101;string102;string103;string104;string105;string106;string107;string108;string109;string110;string111;string112;string113;string114;string115;string116;string117;string118;string119;string120;string121;string122;string123;string124;string125;string126;string127;string128;string129;string130;string131;string132;string133;string134;string135;string136;string137;string138;string139;string140;string141;string142;string143;string144;string145;string146;string147;string148;string149;string150;string151;string152;string153;string154;string155;string156;string157;string158;string159;string160;string161;string162;string163;string164;string165;string166;string167;string168;string169;string170;string171;string172;string173;string174;string175;string176;string177;string178;string179;string180;string181;string182;string183;string184;string185;string186;string187;string188;string189;string190;string191;string192;string193;string194;string195;string196;string197;string198;string199;string200;string201;string202;string203;string204;string205;string206;string207;string208;string209;string210;string211;string212;string213;string214;string215;string216;string217;string218;string219;string220;string221;string222;string223;string224;string225;string226;string227;string228;string229;string230;string231;string232;string233;string234;string235;string236;string237;string238;string239;string240;string241;string242;string243;string244;string245;string246;string247;string248;string249;string250;string251;string252;string253;string254;string255;string256;string257;string258;string259;string260;string261;string262;string263;string264;string265;string266;string267;string268;string269;string270;string271;string272;string273;string274;string275;string276;string277;string278;string279;string280;string281;string282;string283;string284;string285;string286;string287;string288;string289;string290;string291;string292;string293;string294;string295;string296;string297;string298;string299;string300;string301;string302;string303;string304;string305;string306;string307;string308;string309;string310;string311;string312;string313;string314;string315;string316;string317;string318;string319;string320;string321;string322;string323;string324;string325;string326;string327;string328;string329;string330;string331;string332;string333;string334;string335;string336;string337;string338;string339;string340;string341;string342;string343;string344;string345;string346;string347;string348;string349;string350;string351;string352;string353;string354;string355;string356;string357;string358;string359;string360;string361;string362;string363;string364;string365;string366;string367;string368;string369;string370;string371;string372;string373;string374;string375;string376;string377;string378;string379;string380;string381;string382;string383;string384;string385;string386;string387;string388;string389;string390;string391;string392;string393;string394;string395;string396;string397;string398;string399;string400;string401;string402;string403;string404;string405;string406;string407;string408;string409;string410;string411;string412;string413;string414;string415;string416;string417;string418;string419;string420;string421;string422;string423;string424;string425;string426;string427;string428;string429;string430;string431;string432;string433;string434;string435;string436;string437;string438;string439;string440;string441;string442;string443;string444;string445;string446;string447;string448;string449;string450;string451;string452;string453;string454;string455;string456;string457;string458;string459;string460;string461;string462;string463;string464;string465;string466;string467;string468;string469;string470;string471;string472;string473;string474;string475;string476;string477;string478;string479;string480;string481;string482;string483;string484;string485;string486;string487;string488;string489;string490;string491;string492;string493;string494;string495;string496;string497;string498;string499;string500;string501;string502;string503;string504;string505;string506;string507;string508;string509;string510;string511;string512;string513;string514;string515;string516;string517;string518;string519;string520;string521;string522;string523;string524;string525;string526;string527;string528;string529;string530;string531;string532;string533;string534;string535;string536;string537;string538;string539;string540;string541;string542;string543;string544;string545;string546;string547;string548;string549;string550;string551;string552;string553;string554;string555;string556;string557;string558;string559;string560;string561;string562;string563;string564;string565;string566;string567;string568;string569;string570;string571;string572;string573;string574;string575;string576;string577;string578;string579;string580;string581;string582;string583;string584;string585;string586;string587;string588;string589;string590;string591;string592;string593;string594;string595;string596;string597;string598;string599;string600;string601;string602;string603;string604;string605;string606;string607;string608;string609;string610;string611;string612;string613;string614;string615;string616;string617;string618;string619;string620;string621;string622;string623;string624;string625;string626;string627;string628;string629;string630;string631;string632;string633;string634;string635;string636;string637;string638;string639;string640;string641;string642;string643;string644;string645;string646;string647;string648;string649;string650;string651;string652;string653;string654;string655;string656;string657;string658;string659;string660;string661;string662;string663;string664;string665;string666;string667;string668;string669;string670;string671;string672;string673;string674;string675;string676;string677;string678;string679;string680;string681;string682;string683;string684;string685;string686;string687;string688;string689;string690;string691;string692;string693;string694;string695;string696;string697;string698;string699;string700;string701;string702;string703;string704;string705;string706;string707;string708;string709;string710;string711;string712;string713;string714;string715;string716;string717;string718;string719;string720;string721;string722;string723;string724;string725;string726;string727;string728;string729;string730;string731;string732;string733;string734;string735;string736;string737;string738;string739;string740;string741;string742;string743;string744;string745;string746;string747;string748;string749;string750;string751;string752;string753;string754;string755;string756;string757;string758;string759;string760;string761;string762;string763;string764;string765;string766;string767;string768;string769;string770;string771;string772;string773;string774;string775;string776;string777;string778;string779;string780;string781;string782;string783;string784;string785;string786;string787;string788;string789;string790;string791;string792;string793;string794;string795;string796;string797;string798;string799;string800;string801;string802;string803;string804;string805;string806;string807;string808;string809;string810;string811;string812;string813;string814;string815;string816;string817;string818;string819;string820;string821;string822;string823;string824;string825;string826;string827;string828;string829;string830;string831;string832;string833;string834;string835;string836;string837;string838;string839;string840;string841;string842;string843;string844;string845;string846;string847;string848;string849;string850;string851;string852;string853;string854;string855;string856;string857;string858;string859;string860;string861;string862;string863;string864;string865;string866;string867;string868;string869;string870;string871;string872;string873;string874;string875;string876;string877;string878;string879;string880;string881;string882;string883;string884;string885;string886;string887;string888;string889;string890;string891;string892;string893;string894;string895;string896;string897;string898;string899;string900;string901;string902;string903;string904;string905;string906;string907;string908;string909;string910;string911;string912;string913;string914;string915;string916;string917;string918;string919;string920;string921;string922;string923;string924;string925;string926;string927;string928;string929;string930;string931;string932;string933;string934;string935;string936;string937;string938;string939;string940;string941;string942;string943;string944;string945;string946;string947;string948;string949;string950;string951;string952;string953;string954;string955;string956;string957;string958;string959;string960;string961;string962;string963;string964;string965;string966;string967;string968;string969;string970;string971;string972;string973;string974;string975;string976;string977;string978;string979;string980;string981;string982;string983;string984;string985;string986;string987;string988;string989;string990;string991;string992;string993;string994;string995;string996;string997;string998;string999 +start;ing0;ing1;ing2;ing3;ing4;ing5;ing6;ing7;ing8;ing9;ing10;ing11;ing12;ing13;ing14;ing15;ing16;ing17;ing18;ing19;ing20;ing21;ing22;ing23;ing24;ing25;ing26;ing27;ing28;ing29;ing30;ing31;ing32;ing33;ing34;ing35;ing36;ing37;ing38;ing39;ing40;ing41;ing42;ing43;ing44;ing45;ing46;ing47;ing48;ing49;ing50;ing51;ing52;ing53;ing54;ing55;ing56;ing57;ing58;ing59;ing60;ing61;ing62;ing63;ing64;ing65;ing66;ing67;ing68;ing69;ing70;ing71;ing72;ing73;ing74;ing75;ing76;ing77;ing78;ing79;ing80;ing81;ing82;ing83;ing84;ing85;ing86;ing87;ing88;ing89;ing90;ing91;ing92;ing93;ing94;ing95;ing96;ing97;ing98;ing99;ing100;ing101;ing102;ing103;ing104;ing105;ing106;ing107;ing108;ing109;ing110;ing111;ing112;ing113;ing114;ing115;ing116;ing117;ing118;ing119;ing120;ing121;ing122;ing123;ing124;ing125;ing126;ing127;ing128;ing129;ing130;ing131;ing132;ing133;ing134;ing135;ing136;ing137;ing138;ing139;ing140;ing141;ing142;ing143;ing144;ing145;ing146;ing147;ing148;ing149;ing150;ing151;ing152;ing153;ing154;ing155;ing156;ing157;ing158;ing159;ing160;ing161;ing162;ing163;ing164;ing165;ing166;ing167;ing168;ing169;ing170;ing171;ing172;ing173;ing174;ing175;ing176;ing177;ing178;ing179;ing180;ing181;ing182;ing183;ing184;ing185;ing186;ing187;ing188;ing189;ing190;ing191;ing192;ing193;ing194;ing195;ing196;ing197;ing198;ing199;ing200;ing201;ing202;ing203;ing204;ing205;ing206;ing207;ing208;ing209;ing210;ing211;ing212;ing213;ing214;ing215;ing216;ing217;ing218;ing219;ing220;ing221;ing222;ing223;ing224;ing225;ing226;ing227;ing228;ing229;ing230;ing231;ing232;ing233;ing234;ing235;ing236;ing237;ing238;ing239;ing240;ing241;ing242;ing243;ing244;ing245;ing246;ing247;ing248;ing249;ing250;ing251;ing252;ing253;ing254;ing255;ing256;ing257;ing258;ing259;ing260;ing261;ing262;ing263;ing264;ing265;ing266;ing267;ing268;ing269;ing270;ing271;ing272;ing273;ing274;ing275;ing276;ing277;ing278;ing279;ing280;ing281;ing282;ing283;ing284;ing285;ing286;ing287;ing288;ing289;ing290;ing291;ing292;ing293;ing294;ing295;ing296;ing297;ing298;ing299;ing300;ing301;ing302;ing303;ing304;ing305;ing306;ing307;ing308;ing309;ing310;ing311;ing312;ing313;ing314;ing315;ing316;ing317;ing318;ing319;ing320;ing321;ing322;ing323;ing324;ing325;ing326;ing327;ing328;ing329;ing330;ing331;ing332;ing333;ing334;ing335;ing336;ing337;ing338;ing339;ing340;ing341;ing342;ing343;ing344;ing345;ing346;ing347;ing348;ing349;ing350;ing351;ing352;ing353;ing354;ing355;ing356;ing357;ing358;ing359;ing360;ing361;ing362;ing363;ing364;ing365;ing366;ing367;ing368;ing369;ing370;ing371;ing372;ing373;ing374;ing375;ing376;ing377;ing378;ing379;ing380;ing381;ing382;ing383;ing384;ing385;ing386;ing387;ing388;ing389;ing390;ing391;ing392;ing393;ing394;ing395;ing396;ing397;ing398;ing399;ing400;ing401;ing402;ing403;ing404;ing405;ing406;ing407;ing408;ing409;ing410;ing411;ing412;ing413;ing414;ing415;ing416;ing417;ing418;ing419;ing420;ing421;ing422;ing423;ing424;ing425;ing426;ing427;ing428;ing429;ing430;ing431;ing432;ing433;ing434;ing435;ing436;ing437;ing438;ing439;ing440;ing441;ing442;ing443;ing444;ing445;ing446;ing447;ing448;ing449;ing450;ing451;ing452;ing453;ing454;ing455;ing456;ing457;ing458;ing459;ing460;ing461;ing462;ing463;ing464;ing465;ing466;ing467;ing468;ing469;ing470;ing471;ing472;ing473;ing474;ing475;ing476;ing477;ing478;ing479;ing480;ing481;ing482;ing483;ing484;ing485;ing486;ing487;ing488;ing489;ing490;ing491;ing492;ing493;ing494;ing495;ing496;ing497;ing498;ing499;ing500;ing501;ing502;ing503;ing504;ing505;ing506;ing507;ing508;ing509;ing510;ing511;ing512;ing513;ing514;ing515;ing516;ing517;ing518;ing519;ing520;ing521;ing522;ing523;ing524;ing525;ing526;ing527;ing528;ing529;ing530;ing531;ing532;ing533;ing534;ing535;ing536;ing537;ing538;ing539;ing540;ing541;ing542;ing543;ing544;ing545;ing546;ing547;ing548;ing549;ing550;ing551;ing552;ing553;ing554;ing555;ing556;ing557;ing558;ing559;ing560;ing561;ing562;ing563;ing564;ing565;ing566;ing567;ing568;ing569;ing570;ing571;ing572;ing573;ing574;ing575;ing576;ing577;ing578;ing579;ing580;ing581;ing582;ing583;ing584;ing585;ing586;ing587;ing588;ing589;ing590;ing591;ing592;ing593;ing594;ing595;ing596;ing597;ing598;ing599;ing600;ing601;ing602;ing603;ing604;ing605;ing606;ing607;ing608;ing609;ing610;ing611;ing612;ing613;ing614;ing615;ing616;ing617;ing618;ing619;ing620;ing621;ing622;ing623;ing624;ing625;ing626;ing627;ing628;ing629;ing630;ing631;ing632;ing633;ing634;ing635;ing636;ing637;ing638;ing639;ing640;ing641;ing642;ing643;ing644;ing645;ing646;ing647;ing648;ing649;ing650;ing651;ing652;ing653;ing654;ing655;ing656;ing657;ing658;ing659;ing660;ing661;ing662;ing663;ing664;ing665;ing666;ing667;ing668;ing669;ing670;ing671;ing672;ing673;ing674;ing675;ing676;ing677;ing678;ing679;ing680;ing681;ing682;ing683;ing684;ing685;ing686;ing687;ing688;ing689;ing690;ing691;ing692;ing693;ing694;ing695;ing696;ing697;ing698;ing699;ing700;ing701;ing702;ing703;ing704;ing705;ing706;ing707;ing708;ing709;ing710;ing711;ing712;ing713;ing714;ing715;ing716;ing717;ing718;ing719;ing720;ing721;ing722;ing723;ing724;ing725;ing726;ing727;ing728;ing729;ing730;ing731;ing732;ing733;ing734;ing735;ing736;ing737;ing738;ing739;ing740;ing741;ing742;ing743;ing744;ing745;ing746;ing747;ing748;ing749;ing750;ing751;ing752;ing753;ing754;ing755;ing756;ing757;ing758;ing759;ing760;ing761;ing762;ing763;ing764;ing765;ing766;ing767;ing768;ing769;ing770;ing771;ing772;ing773;ing774;ing775;ing776;ing777;ing778;ing779;ing780;ing781;ing782;ing783;ing784;ing785;ing786;ing787;ing788;ing789;ing790;ing791;ing792;ing793;ing794;ing795;ing796;ing797;ing798;ing799;ing800;ing801;ing802;ing803;ing804;ing805;ing806;ing807;ing808;ing809;ing810;ing811;ing812;ing813;ing814;ing815;ing816;ing817;ing818;ing819;ing820;ing821;ing822;ing823;ing824;ing825;ing826;ing827;ing828;ing829;ing830;ing831;ing832;ing833;ing834;ing835;ing836;ing837;ing838;ing839;ing840;ing841;ing842;ing843;ing844;ing845;ing846;ing847;ing848;ing849;ing850;ing851;ing852;ing853;ing854;ing855;ing856;ing857;ing858;ing859;ing860;ing861;ing862;ing863;ing864;ing865;ing866;ing867;ing868;ing869;ing870;ing871;ing872;ing873;ing874;ing875;ing876;ing877;ing878;ing879;ing880;ing881;ing882;ing883;ing884;ing885;ing886;ing887;ing888;ing889;ing890;ing891;ing892;ing893;ing894;ing895;ing896;ing897;ing898;ing899;ing900;ing901;ing902;ing903;ing904;ing905;ing906;ing907;ing908;ing909;ing910;ing911;ing912;ing913;ing914;ing915;ing916;ing917;ing918;ing919;ing920;ing921;ing922;ing923;ing924;ing925;ing926;ing927;ing928;ing929;ing930;ing931;ing932;ing933;ing934;ing935;ing936;ing937;ing938;ing939;ing940;ing941;ing942;ing943;ing944;ing945;ing946;ing947;ing948;ing949;ing950;ing951;ing952;ing953;ing954;ing955;ing956;ing957;ing958;ing959;ing960;ing961;ing962;ing963;ing964;ing965;ing966;ing967;ing968;ing969;ing970;ing971;ing972;ing973;ing974;ing975;ing976;ing977;ing978;ing979;ing980;ing981;ing982;ing983;ing984;ing985;ing986;ing987;ing988;ing989;ing990;ing991;ing992;ing993;ing994;ing995;ing996;ing997;ing998;ing999 +start;string0;string1;string2;string3;string4;string5;string6;string7;string8;string9;string10;string11;string12;string13;string14;string15;string16;string17;string18;string19;string20;string21;string22;string23;string24;string25;string26;string27;string28;string29;string30;string31;string32;string33;string34;string35;string36;string37;string38;string39;string40;string41;string42;string43;string44;string45;string46;string47;string48;string49;string50;string51;string52;string53;string54;string55;string56;string57;string58;string59;string60;string61;string62;string63;string64;string65;string66;string67;string68;string69;string70;string71;string72;string73;string74;string75;string76;string77;string78;string79;string80;string81;string82;string83;string84;string85;string86;string87;string88;string89;string90;string91;string92;string93;string94;string95;string96;string97;string98;string99;string100;string101;string102;string103;string104;string105;string106;string107;string108;string109;string110;string111;string112;string113;string114;string115;string116;string117;string118;string119;string120;string121;string122;string123;string124;string125;string126;string127;string128;string129;string130;string131;string132;string133;string134;string135;string136;string137;string138;string139;string140;string141;string142;string143;string144;string145;string146;string147;string148;string149;string150;string151;string152;string153;string154;string155;string156;string157;string158;string159;string160;string161;string162;string163;string164;string165;string166;string167;string168;string169;string170;string171;string172;string173;string174;string175;string176;string177;string178;string179;string180;string181;string182;string183;string184;string185;string186;string187;string188;string189;string190;string191;string192;string193;string194;string195;string196;string197;string198;string199;string200;string201;string202;string203;string204;string205;string206;string207;string208;string209;string210;string211;string212;string213;string214;string215;string216;string217;string218;string219;string220;string221;string222;string223;string224;string225;string226;string227;string228;string229;string230;string231;string232;string233;string234;string235;string236;string237;string238;string239;string240;string241;string242;string243;string244;string245;string246;string247;string248;string249;string250;string251;string252;string253;string254;string255;string256;string257;string258;string259;string260;string261;string262;string263;string264;string265;string266;string267;string268;string269;string270;string271;string272;string273;string274;string275;string276;string277;string278;string279;string280;string281;string282;string283;string284;string285;string286;string287;string288;string289;string290;string291;string292;string293;string294;string295;string296;string297;string298;string299;string300;string301;string302;string303;string304;string305;string306;string307;string308;string309;string310;string311;string312;string313;string314;string315;string316;string317;string318;string319;string320;string321;string322;string323;string324;string325;string326;string327;string328;string329;string330;string331;string332;string333;string334;string335;string336;string337;string338;string339;string340;string341;string342;string343;string344;string345;string346;string347;string348;string349;string350;string351;string352;string353;string354;string355;string356;string357;string358;string359;string360;string361;string362;string363;string364;string365;string366;string367;string368;string369;string370;string371;string372;string373;string374;string375;string376;string377;string378;string379;string380;string381;string382;string383;string384;string385;string386;string387;string388;string389;string390;string391;string392;string393;string394;string395;string396;string397;string398;string399;string400;string401;string402;string403;string404;string405;string406;string407;string408;string409;string410;string411;string412;string413;string414;string415;string416;string417;string418;string419;string420;string421;string422;string423;string424;string425;string426;string427;string428;string429;string430;string431;string432;string433;string434;string435;string436;string437;string438;string439;string440;string441;string442;string443;string444;string445;string446;string447;string448;string449;string450;string451;string452;string453;string454;string455;string456;string457;string458;string459;string460;string461;string462;string463;string464;string465;string466;string467;string468;string469;string470;string471;string472;string473;string474;string475;string476;string477;string478;string479;string480;string481;string482;string483;string484;string485;string486;string487;string488;string489;string490;string491;string492;string493;string494;string495;string496;string497;string498;string499;string500;string501;string502;string503;string504;string505;string506;string507;string508;string509;string510;string511;string512;string513;string514;string515;string516;string517;string518;string519;string520;string521;string522;string523;string524;string525;string526;string527;string528;string529;string530;string531;string532;string533;string534;string535;string536;string537;string538;string539;string540;string541;string542;string543;string544;string545;string546;string547;string548;string549;string550;string551;string552;string553;string554;string555;string556;string557;string558;string559;string560;string561;string562;string563;string564;string565;string566;string567;string568;string569;string570;string571;string572;string573;string574;string575;string576;string577;string578;string579;string580;string581;string582;string583;string584;string585;string586;string587;string588;string589;string590;string591;string592;string593;string594;string595;string596;string597;string598;string599;string600;string601;string602;string603;string604;string605;string606;string607;string608;string609;string610;string611;string612;string613;string614;string615;string616;string617;string618;string619;string620;string621;string622;string623;string624;string625;string626;string627;string628;string629;string630;string631;string632;string633;string634;string635;string636;string637;string638;string639;string640;string641;string642;string643;string644;string645;string646;string647;string648;string649;string650;string651;string652;string653;string654;string655;string656;string657;string658;string659;string660;string661;string662;string663;string664;string665;string666;string667;string668;string669;string670;string671;string672;string673;string674;string675;string676;string677;string678;string679;string680;string681;string682;string683;string684;string685;string686;string687;string688;string689;string690;string691;string692;string693;string694;string695;string696;string697;string698;string699;string700;string701;string702;string703;string704;string705;string706;string707;string708;string709;string710;string711;string712;string713;string714;string715;string716;string717;string718;string719;string720;string721;string722;string723;string724;string725;string726;string727;string728;string729;string730;string731;string732;string733;string734;string735;string736;string737;string738;string739;string740;string741;string742;string743;string744;string745;string746;string747;string748;string749;string750;string751;string752;string753;string754;string755;string756;string757;string758;string759;string760;string761;string762;string763;string764;string765;string766;string767;string768;string769;string770;string771;string772;string773;string774;string775;string776;string777;string778;string779;string780;string781;string782;string783;string784;string785;string786;string787;string788;string789;string790;string791;string792;string793;string794;string795;string796;string797;string798;string799;string800;string801;string802;string803;string804;string805;string806;string807;string808;string809;string810;string811;string812;string813;string814;string815;string816;string817;string818;string819;string820;string821;string822;string823;string824;string825;string826;string827;string828;string829;string830;string831;string832;string833;string834;string835;string836;string837;string838;string839;string840;string841;string842;string843;string844;string845;string846;string847;string848;string849;string850;string851;string852;string853;string854;string855;string856;string857;string858;string859;string860;string861;string862;string863;string864;string865;string866;string867;string868;string869;string870;string871;string872;string873;string874;string875;string876;string877;string878;string879;string880;string881;string882;string883;string884;string885;string886;string887;string888;string889;string890;string891;string892;string893;string894;string895;string896;string897;string898;string899;string900;string901;string902;string903;string904;string905;string906;string907;string908;string909;string910;string911;string912;string913;string914;string915;string916;string917;string918;string919;string920;string921;string922;string923;string924;string925;string926;string927;string928;string929;string930;string931;string932;string933;string934;string935;string936;string937;string938;string939;string940;string941;string942;string943;string944;string945;string946;string947;string948;string949;string950;string951;string952;string953;string954;string955;string956;string957;string958;string959;string960;string961;string962;string963;string964;string965;string966;string967;string968;string969;string970;string971;string972;string973;string974;string975;string976;string977;string978;string979;string980;string981;string982;string983;string984;string985;string986;string987;string988;string989;string990;string991;string992;string993;string994;string995;string996;string997;string998;string999 +start;string0;string1;string2;string3;string4;string5;string6;string7;string8;string9;string10;string11;string12;string13;string14;string15;string16;string17;string18;string19;string20;string21;string22;string23;string24;string25;string26;string27;string28;string29;string30;string31;string32;string33;string34;string35;string36;string37;string38;string39;string40;string41;string42;string43;string44;string45;string46;string47;string48;string49;string50;string51;string52;string53;string54;string55;string56;string57;string58;string59;string60;string61;string62;string63;string64;string65;string66;string67;string68;string69;string70;string71;string72;string73;string74;string75;string76;string77;string78;string79;string80;string81;string82;string83;string84;string85;string86;string87;string88;string89;string90;string91;string92;string93;string94;string95;string96;string97;string98;string99;string100;string101;string102;string103;string104;string105;string106;string107;string108;string109;string110;string111;string112;string113;string114;string115;string116;string117;string118;string119;string120;string121;string122;string123;string124;string125;string126;string127;string128;string129;string130;string131;string132;string133;string134;string135;string136;string137;string138;string139;string140;string141;string142;string143;string144;string145;string146;string147;string148;string149;string150;string151;string152;string153;string154;string155;string156;string157;string158;string159;string160;string161;string162;string163;string164;string165;string166;string167;string168;string169;string170;string171;string172;string173;string174;string175;string176;string177;string178;string179;string180;string181;string182;string183;string184;string185;string186;string187;string188;string189;string190;string191;string192;string193;string194;string195;string196;string197;string198;string199;string200;string201;string202;string203;string204;string205;string206;string207;string208;string209;string210;string211;string212;string213;string214;string215;string216;string217;string218;string219;string220;string221;string222;string223;string224;string225;string226;string227;string228;string229;string230;string231;string232;string233;string234;string235;string236;string237;string238;string239;string240;string241;string242;string243;string244;string245;string246;string247;string248;string249;string250;string251;string252;string253;string254;string255;string256;string257;string258;string259;string260;string261;string262;string263;string264;string265;string266;string267;string268;string269;string270;string271;string272;string273;string274;string275;string276;string277;string278;string279;string280;string281;string282;string283;string284;string285;string286;string287;string288;string289;string290;string291;string292;string293;string294;string295;string296;string297;string298;string299;string300;string301;string302;string303;string304;string305;string306;string307;string308;string309;string310;string311;string312;string313;string314;string315;string316;string317;string318;string319;string320;string321;string322;string323;string324;string325;string326;string327;string328;string329;string330;string331;string332;string333;string334;string335;string336;string337;string338;string339;string340;string341;string342;string343;string344;string345;string346;string347;string348;string349;string350;string351;string352;string353;string354;string355;string356;string357;string358;string359;string360;string361;string362;string363;string364;string365;string366;string367;string368;string369;string370;string371;string372;string373;string374;string375;string376;string377;string378;string379;string380;string381;string382;string383;string384;string385;string386;string387;string388;string389;string390;string391;string392;string393;string394;string395;string396;string397;string398;string399;string400;string401;string402;string403;string404;string405;string406;string407;string408;string409;string410;string411;string412;string413;string414;string415;string416;string417;string418;string419;string420;string421;string422;string423;string424;string425;string426;string427;string428;string429;string430;string431;string432;string433;string434;string435;string436;string437;string438;string439;string440;string441;string442;string443;string444;string445;string446;string447;string448;string449;string450;string451;string452;string453;string454;string455;string456;string457;string458;string459;string460;string461;string462;string463;string464;string465;string466;string467;string468;string469;string470;string471;string472;string473;string474;string475;string476;string477;string478;string479;string480;string481;string482;string483;string484;string485;string486;string487;string488;string489;string490;string491;string492;string493;string494;string495;string496;string497;string498;string499;string500;string501;string502;string503;string504;string505;string506;string507;string508;string509;string510;string511;string512;string513;string514;string515;string516;string517;string518;string519;string520;string521;string522;string523;string524;string525;string526;string527;string528;string529;string530;string531;string532;string533;string534;string535;string536;string537;string538;string539;string540;string541;string542;string543;string544;string545;string546;string547;string548;string549;string550;string551;string552;string553;string554;string555;string556;string557;string558;string559;string560;string561;string562;string563;string564;string565;string566;string567;string568;string569;string570;string571;string572;string573;string574;string575;string576;string577;string578;string579;string580;string581;string582;string583;string584;string585;string586;string587;string588;string589;string590;string591;string592;string593;string594;string595;string596;string597;string598;string599;string600;string601;string602;string603;string604;string605;string606;string607;string608;string609;string610;string611;string612;string613;string614;string615;string616;string617;string618;string619;string620;string621;string622;string623;string624;string625;string626;string627;string628;string629;string630;string631;string632;string633;string634;string635;string636;string637;string638;string639;string640;string641;string642;string643;string644;string645;string646;string647;string648;string649;string650;string651;string652;string653;string654;string655;string656;string657;string658;string659;string660;string661;string662;string663;string664;string665;string666;string667;string668;string669;string670;string671;string672;string673;string674;string675;string676;string677;string678;string679;string680;string681;string682;string683;string684;string685;string686;string687;string688;string689;string690;string691;string692;string693;string694;string695;string696;string697;string698;string699;string700;string701;string702;string703;string704;string705;string706;string707;string708;string709;string710;string711;string712;string713;string714;string715;string716;string717;string718;string719;string720;string721;string722;string723;string724;string725;string726;string727;string728;string729;string730;string731;string732;string733;string734;string735;string736;string737;string738;string739;string740;string741;string742;string743;string744;string745;string746;string747;string748;string749;string750;string751;string752;string753;string754;string755;string756;string757;string758;string759;string760;string761;string762;string763;string764;string765;string766;string767;string768;string769;string770;string771;string772;string773;string774;string775;string776;string777;string778;string779;string780;string781;string782;string783;string784;string785;string786;string787;string788;string789;string790;string791;string792;string793;string794;string795;string796;string797;string798;string799;string800;string801;string802;string803;string804;string805;string806;string807;string808;string809;string810;string811;string812;string813;string814;string815;string816;string817;string818;string819;string820;string821;string822;string823;string824;string825;string826;string827;string828;string829;string830;string831;string832;string833;string834;string835;string836;string837;string838;string839;string840;string841;string842;string843;string844;string845;string846;string847;string848;string849;string850;string851;string852;string853;string854;string855;string856;string857;string858;string859;string860;string861;string862;string863;string864;string865;string866;string867;string868;string869;string870;string871;string872;string873;string874;string875;string876;string877;string878;string879;string880;string881;string882;string883;string884;string885;string886;string887;string888;string889;string890;string891;string892;string893;string894;string895;string896;string897;string898;string899;string900;string901;string902;string903;string904;string905;string906;string907;string908;string909;string910;string911;string912;string913;string914;string915;string916;string917;string918;string919;string920;string921;string922;string923;string924;string925;string926;string927;string928;string929;string930;string931;string932;string933;string934;string935;string936;string937;string938;string939;string940;string941;string942;string943;string944;string945;string946;string947;string948;string949;string950;string951;string952;string953;string954;string955;string956;string957;string958;string959;string960;string961;string962;string963;string964;string965;string966;string967;string968;string969;string970;string971;string972;string973;string974;string975;string976;string977;string978;string979;string980;string981;string982;string983;string984;string985;string986;string987;string988;string989;string990;string991;string992;string993;string994;string995;string996;string997;string998;string999 +ing999 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +art;string0;string1;string2;string3;string4;string5;string6;string7;string8;string9;string10;string11;string12;string13;string14;string15;string16;string17;string18;string19;string20;string21;string22;string23;string24;string25;string26;string27;string28;string29;string30;string31;string32;string33;string34;string35;string36;string37;string38;string39;string40;string41;string42;string43;string44;string45;string46;string47;string48;string49;string50;string51;string52;string53;string54;string55;string56;string57;string58;string59;string60;string61;string62;string63;string64;string65;string66;string67;string68;string69;string70;string71;string72;string73;string74;string75;string76;string77;string78;string79;string80;string81;string82;string83;string84;string85;string86;string87;string88;string89;string90;string91;string92;string93;string94;string95;string96;string97;string98;string99;string100;string101;string102;string103;string104;string105;string106;string107;string108;string109;string110;string111;string112;string113;string114;string115;string116;string117;string118;string119;string120;string121;string122;string123;string124;string125;string126;string127;string128;string129;string130;string131;string132;string133;string134;string135;string136;string137;string138;string139;string140;string141;string142;string143;string144;string145;string146;string147;string148;string149;string150;string151;string152;string153;string154;string155;string156;string157;string158;string159;string160;string161;string162;string163;string164;string165;string166;string167;string168;string169;string170;string171;string172;string173;string174;string175;string176;string177;string178;string179;string180;string181;string182;string183;string184;string185;string186;string187;string188;string189;string190;string191;string192;string193;string194;string195;string196;string197;string198;string199;string200;string201;string202;string203;string204;string205;string206;string207;string208;string209;string210;string211;string212;string213;string214;string215;string216;string217;string218;string219;string220;string221;string222;string223;string224;string225;string226;string227;string228;string229;string230;string231;string232;string233;string234;string235;string236;string237;string238;string239;string240;string241;string242;string243;string244;string245;string246;string247;string248;string249;string250;string251;string252;string253;string254;string255;string256;string257;string258;string259;string260;string261;string262;string263;string264;string265;string266;string267;string268;string269;string270;string271;string272;string273;string274;string275;string276;string277;string278;string279;string280;string281;string282;string283;string284;string285;string286;string287;string288;string289;string290;string291;string292;string293;string294;string295;string296;string297;string298;string299;string300;string301;string302;string303;string304;string305;string306;string307;string308;string309;string310;string311;string312;string313;string314;string315;string316;string317;string318;string319;string320;string321;string322;string323;string324;string325;string326;string327;string328;string329;string330;string331;string332;string333;string334;string335;string336;string337;string338;string339;string340;string341;string342;string343;string344;string345;string346;string347;string348;string349;string350;string351;string352;string353;string354;string355;string356;string357;string358;string359;string360;string361;string362;string363;string364;string365;string366;string367;string368;string369;string370;string371;string372;string373;string374;string375;string376;string377;string378;string379;string380;string381;string382;string383;string384;string385;string386;string387;string388;string389;string390;string391;string392;string393;string394;string395;string396;string397;string398;string399;string400;string401;string402;string403;string404;string405;string406;string407;string408;string409;string410;string411;string412;string413;string414;string415;string416;string417;string418;string419;string420;string421;string422;string423;string424;string425;string426;string427;string428;string429;string430;string431;string432;string433;string434;string435;string436;string437;string438;string439;string440;string441;string442;string443;string444;string445;string446;string447;string448;string449;string450;string451;string452;string453;string454;string455;string456;string457;string458;string459;string460;string461;string462;string463;string464;string465;string466;string467;string468;string469;string470;string471;string472;string473;string474;string475;string476;string477;string478;string479;string480;string481;string482;string483;string484;string485;string486;string487;string488;string489;string490;string491;string492;string493;string494;string495;string496;string497;string498;string499;string500;string501;string502;string503;string504;string505;string506;string507;string508;string509;string510;string511;string512;string513;string514;string515;string516;string517;string518;string519;string520;string521;string522;string523;string524;string525;string526;string527;string528;string529;string530;string531;string532;string533;string534;string535;string536;string537;string538;string539;string540;string541;string542;string543;string544;string545;string546;string547;string548;string549;string550;string551;string552;string553;string554;string555;string556;string557;string558;string559;string560;string561;string562;string563;string564;string565;string566;string567;string568;string569;string570;string571;string572;string573;string574;string575;string576;string577;string578;string579;string580;string581;string582;string583;string584;string585;string586;string587;string588;string589;string590;string591;string592;string593;string594;string595;string596;string597;string598;string599;string600;string601;string602;string603;string604;string605;string606;string607;string608;string609;string610;string611;string612;string613;string614;string615;string616;string617;string618;string619;string620;string621;string622;string623;string624;string625;string626;string627;string628;string629;string630;string631;string632;string633;string634;string635;string636;string637;string638;string639;string640;string641;string642;string643;string644;string645;string646;string647;string648;string649;string650;string651;string652;string653;string654;string655;string656;string657;string658;string659;string660;string661;string662;string663;string664;string665;string666;string667;string668;string669;string670;string671;string672;string673;string674;string675;string676;string677;string678;string679;string680;string681;string682;string683;string684;string685;string686;string687;string688;string689;string690;string691;string692;string693;string694;string695;string696;string697;string698;string699;string700;string701;string702;string703;string704;string705;string706;string707;string708;string709;string710;string711;string712;string713;string714;string715;string716;string717;string718;string719;string720;string721;string722;string723;string724;string725;string726;string727;string728;string729;string730;string731;string732;string733;string734;string735;string736;string737;string738;string739;string740;string741;string742;string743;string744;string745;string746;string747;string748;string749;string750;string751;string752;string753;string754;string755;string756;string757;string758;string759;string760;string761;string762;string763;string764;string765;string766;string767;string768;string769;string770;string771;string772;string773;string774;string775;string776;string777;string778;string779;string780;string781;string782;string783;string784;string785;string786;string787;string788;string789;string790;string791;string792;string793;string794;string795;string796;string797;string798;string799;string800;string801;string802;string803;string804;string805;string806;string807;string808;string809;string810;string811;string812;string813;string814;string815;string816;string817;string818;string819;string820;string821;string822;string823;string824;string825;string826;string827;string828;string829;string830;string831;string832;string833;string834;string835;string836;string837;string838;string839;string840;string841;string842;string843;string844;string845;string846;string847;string848;string849;string850;string851;string852;string853;string854;string855;string856;string857;string858;string859;string860;string861;string862;string863;string864;string865;string866;string867;string868;string869;string870;string871;string872;string873;string874;string875;string876;string877;string878;string879;string880;string881;string882;string883;string884;string885;string886;string887;string888;string889;string890;string891;string892;string893;string894;string895;string896;string897;string898;string899;string900;string901;string902;string903;string904;string905;string906;string907;string908;string909;string910;string911;string912;string913;string914;string915;string916;string917;string918;string919;string920;string921;string922;string923;string924;string925;string926;string927;string928;string929;string930;string931;string932;string933;string934;string935;string936;string937;string938;string939;string940;string941;string942;string943;string944;string945;string946;string947;string948;string949;string950;string951;string952;string953;string954;string955;string956;string957;string958;string959;string960;string961;string962;string963;string964;string965;string966;string967;string968;string969;string970;string971;string972;string973;string974;string975;string976;string977;string978;string979;string980;string981;string982;string983;string984;string985;string986;string987;string988;string989;string990;string991;string992;string993;string994;string995;string996;string997;string998;string999 +start;string0;string1;string2;string3;string4;string5;string6;string7;string8;string9;string10;string11;string12;string13;string14;string15;string16;string17;string18;string19;string20;string21;string22;string23;string24;string25;string26;string27;string28;string29;string30;string31;string32;string33;string34;string35;string36;string37;string38;string39;string40;string41;string42;string43;string44;string45;string46;string47;string48;string49;string50;string51;string52;string53;string54;string55;string56;string57;string58;string59;string60;string61;string62;string63;string64;string65;string66;string67;string68;string69;string70;string71;string72;string73;string74;string75;string76;string77;string78;string79;string80;string81;string82;string83;string84;string85;string86;string87;string88;string89;string90;string91;string92;string93;string94;string95;string96;string97;string98;string99;string100;string101;string102;string103;string104;string105;string106;string107;string108;string109;string110;string111;string112;string113;string114;string115;string116;string117;string118;string119;string120;string121;string122;string123;string124;string125;string126;string127;string128;string129;string130;string131;string132;string133;string134;string135;string136;string137;string138;string139;string140;string141;string142;string143;string144;string145;string146;string147;string148;string149;string150;string151;string152;string153;string154;string155;string156;string157;string158;string159;string160;string161;string162;string163;string164;string165;string166;string167;string168;string169;string170;string171;string172;string173;string174;string175;string176;string177;string178;string179;string180;string181;string182;string183;string184;string185;string186;string187;string188;string189;string190;string191;string192;string193;string194;string195;string196;string197;string198;string199;string200;string201;string202;string203;string204;string205;string206;string207;string208;string209;string210;string211;string212;string213;string214;string215;string216;string217;string218;string219;string220;string221;string222;string223;string224;string225;string226;string227;string228;string229;string230;string231;string232;string233;string234;string235;string236;string237;string238;string239;string240;string241;string242;string243;string244;string245;string246;string247;string248;string249;string250;string251;string252;string253;string254;string255;string256;string257;string258;string259;string260;string261;string262;string263;string264;string265;string266;string267;string268;string269;string270;string271;string272;string273;string274;string275;string276;string277;string278;string279;string280;string281;string282;string283;string284;string285;string286;string287;string288;string289;string290;string291;string292;string293;string294;string295;string296;string297;string298;string299;string300;string301;string302;string303;string304;string305;string306;string307;string308;string309;string310;string311;string312;string313;string314;string315;string316;string317;string318;string319;string320;string321;string322;string323;string324;string325;string326;string327;string328;string329;string330;string331;string332;string333;string334;string335;string336;string337;string338;string339;string340;string341;string342;string343;string344;string345;string346;string347;string348;string349;string350;string351;string352;string353;string354;string355;string356;string357;string358;string359;string360;string361;string362;string363;string364;string365;string366;string367;string368;string369;string370;string371;string372;string373;string374;string375;string376;string377;string378;string379;string380;string381;string382;string383;string384;string385;string386;string387;string388;string389;string390;string391;string392;string393;string394;string395;string396;string397;string398;string399;string400;string401;string402;string403;string404;string405;string406;string407;string408;string409;string410;string411;string412;string413;string414;string415;string416;string417;string418;string419;string420;string421;string422;string423;string424;string425;string426;string427;string428;string429;string430;string431;string432;string433;string434;string435;string436;string437;string438;string439;string440;string441;string442;string443;string444;string445;string446;string447;string448;string449;string450;string451;string452;string453;string454;string455;string456;string457;string458;string459;string460;string461;string462;string463;string464;string465;string466;string467;string468;string469;string470;string471;string472;string473;string474;string475;string476;string477;string478;string479;string480;string481;string482;string483;string484;string485;string486;string487;string488;string489;string490;string491;string492;string493;string494;string495;string496;string497;string498;string499;string500;string501;string502;string503;string504;string505;string506;string507;string508;string509;string510;string511;string512;string513;string514;string515;string516;string517;string518;string519;string520;string521;string522;string523;string524;string525;string526;string527;string528;string529;string530;string531;string532;string533;string534;string535;string536;string537;string538;string539;string540;string541;string542;string543;string544;string545;string546;string547;string548;string549;string550;string551;string552;string553;string554;string555;string556;string557;string558;string559;string560;string561;string562;string563;string564;string565;string566;string567;string568;string569;string570;string571;string572;string573;string574;string575;string576;string577;string578;string579;string580;string581;string582;string583;string584;string585;string586;string587;string588;string589;string590;string591;string592;string593;string594;string595;string596;string597;string598;string599;string600;string601;string602;string603;string604;string605;string606;string607;string608;string609;string610;string611;string612;string613;string614;string615;string616;string617;string618;string619;string620;string621;string622;string623;string624;string625;string626;string627;string628;string629;string630;string631;string632;string633;string634;string635;string636;string637;string638;string639;string640;string641;string642;string643;string644;string645;string646;string647;string648;string649;string650;string651;string652;string653;string654;string655;string656;string657;string658;string659;string660;string661;string662;string663;string664;string665;string666;string667;string668;string669;string670;string671;string672;string673;string674;string675;string676;string677;string678;string679;string680;string681;string682;string683;string684;string685;string686;string687;string688;string689;string690;string691;string692;string693;string694;string695;string696;string697;string698;string699;string700;string701;string702;string703;string704;string705;string706;string707;string708;string709;string710;string711;string712;string713;string714;string715;string716;string717;string718;string719;string720;string721;string722;string723;string724;string725;string726;string727;string728;string729;string730;string731;string732;string733;string734;string735;string736;string737;string738;string739;string740;string741;string742;string743;string744;string745;string746;string747;string748;string749;string750;string751;string752;string753;string754;string755;string756;string757;string758;string759;string760;string761;string762;string763;string764;string765;string766;string767;string768;string769;string770;string771;string772;string773;string774;string775;string776;string777;string778;string779;string780;string781;string782;string783;string784;string785;string786;string787;string788;string789;string790;string791;string792;string793;string794;string795;string796;string797;string798;string799;string800;string801;string802;string803;string804;string805;string806;string807;string808;string809;string810;string811;string812;string813;string814;string815;string816;string817;string818;string819;string820;string821;string822;string823;string824;string825;string826;string827;string828;string829;string830;string831;string832;string833;string834;string835;string836;string837;string838;string839;string840;string841;string842;string843;string844;string845;string846;string847;string848;string849;string850;string851;string852;string853;string854;string855;string856;string857;string858;string859;string860;string861;string862;string863;string864;string865;string866;string867;string868;string869;string870;string871;string872;string873;string874;string875;string876;string877;string878;string879;string880;string881;string882;string883;string884;string885;string886;string887;string888;string889;string890;string891;string892;string893;string894;string895;string896;string897;string898;string899;string900;string901;string902;string903;string904;string905;string906;string907;string908;string909;string910;string911;string912;string913;string914;string915;string916;string917;string918;string919;string920;string921;string922;string923;string924;string925;string926;string927;string928;string929;string930;string931;string932;string933;string934;string935;string936;string937;string938;string939;string940;string941;string942;string943;string944;string945;string946;string947;string948;string949;string950;string951;string952;string953;string954;string955;string956;string957;string958;string959;string960;string961;string962;string963;string964;string965;string966;string967;string968;string969;string970;string971;string972;string973;string974;string975;string976;string977;string978;string979;string980;string981;string982;string983;string984;string985;string986;string987;string988;string989;string990;string991;string992;string993;string994;string995;string996;string997;string998;string9 +start;ing0;ing1;ing2;ing3;ing4;ing5;ing6;ing7;ing8;ing9;ing10;ing11;ing12;ing13;ing14;ing15;ing16;ing17;ing18;ing19;ing20;ing21;ing22;ing23;ing24;ing25;ing26;ing27;ing28;ing29;ing30;ing31;ing32;ing33;ing34;ing35;ing36;ing37;ing38;ing39;ing40;ing41;ing42;ing43;ing44;ing45;ing46;ing47;ing48;ing49;ing50;ing51;ing52;ing53;ing54;ing55;ing56;ing57;ing58;ing59;ing60;ing61;ing62;ing63;ing64;ing65;ing66;ing67;ing68;ing69;ing70;ing71;ing72;ing73;ing74;ing75;ing76;ing77;ing78;ing79;ing80;ing81;ing82;ing83;ing84;ing85;ing86;ing87;ing88;ing89;ing90;ing91;ing92;ing93;ing94;ing95;ing96;ing97;ing98;ing99;ing100;ing101;ing102;ing103;ing104;ing105;ing106;ing107;ing108;ing109;ing110;ing111;ing112;ing113;ing114;ing115;ing116;ing117;ing118;ing119;ing120;ing121;ing122;ing123;ing124;ing125;ing126;ing127;ing128;ing129;ing130;ing131;ing132;ing133;ing134;ing135;ing136;ing137;ing138;ing139;ing140;ing141;ing142;ing143;ing144;ing145;ing146;ing147;ing148;ing149;ing150;ing151;ing152;ing153;ing154;ing155;ing156;ing157;ing158;ing159;ing160;ing161;ing162;ing163;ing164;ing165;ing166;ing167;ing168;ing169;ing170;ing171;ing172;ing173;ing174;ing175;ing176;ing177;ing178;ing179;ing180;ing181;ing182;ing183;ing184;ing185;ing186;ing187;ing188;ing189;ing190;ing191;ing192;ing193;ing194;ing195;ing196;ing197;ing198;ing199;ing200;ing201;ing202;ing203;ing204;ing205;ing206;ing207;ing208;ing209;ing210;ing211;ing212;ing213;ing214;ing215;ing216;ing217;ing218;ing219;ing220;ing221;ing222;ing223;ing224;ing225;ing226;ing227;ing228;ing229;ing230;ing231;ing232;ing233;ing234;ing235;ing236;ing237;ing238;ing239;ing240;ing241;ing242;ing243;ing244;ing245;ing246;ing247;ing248;ing249;ing250;ing251;ing252;ing253;ing254;ing255;ing256;ing257;ing258;ing259;ing260;ing261;ing262;ing263;ing264;ing265;ing266;ing267;ing268;ing269;ing270;ing271;ing272;ing273;ing274;ing275;ing276;ing277;ing278;ing279;ing280;ing281;ing282;ing283;ing284;ing285;ing286;ing287;ing288;ing289;ing290;ing291;ing292;ing293;ing294;ing295;ing296;ing297;ing298;ing299;ing300;ing301;ing302;ing303;ing304;ing305;ing306;ing307;ing308;ing309;ing310;ing311;ing312;ing313;ing314;ing315;ing316;ing317;ing318;ing319;ing320;ing321;ing322;ing323;ing324;ing325;ing326;ing327;ing328;ing329;ing330;ing331;ing332;ing333;ing334;ing335;ing336;ing337;ing338;ing339;ing340;ing341;ing342;ing343;ing344;ing345;ing346;ing347;ing348;ing349;ing350;ing351;ing352;ing353;ing354;ing355;ing356;ing357;ing358;ing359;ing360;ing361;ing362;ing363;ing364;ing365;ing366;ing367;ing368;ing369;ing370;ing371;ing372;ing373;ing374;ing375;ing376;ing377;ing378;ing379;ing380;ing381;ing382;ing383;ing384;ing385;ing386;ing387;ing388;ing389;ing390;ing391;ing392;ing393;ing394;ing395;ing396;ing397;ing398;ing399;ing400;ing401;ing402;ing403;ing404;ing405;ing406;ing407;ing408;ing409;ing410;ing411;ing412;ing413;ing414;ing415;ing416;ing417;ing418;ing419;ing420;ing421;ing422;ing423;ing424;ing425;ing426;ing427;ing428;ing429;ing430;ing431;ing432;ing433;ing434;ing435;ing436;ing437;ing438;ing439;ing440;ing441;ing442;ing443;ing444;ing445;ing446;ing447;ing448;ing449;ing450;ing451;ing452;ing453;ing454;ing455;ing456;ing457;ing458;ing459;ing460;ing461;ing462;ing463;ing464;ing465;ing466;ing467;ing468;ing469;ing470;ing471;ing472;ing473;ing474;ing475;ing476;ing477;ing478;ing479;ing480;ing481;ing482;ing483;ing484;ing485;ing486;ing487;ing488;ing489;ing490;ing491;ing492;ing493;ing494;ing495;ing496;ing497;ing498;ing499;ing500;ing501;ing502;ing503;ing504;ing505;ing506;ing507;ing508;ing509;ing510;ing511;ing512;ing513;ing514;ing515;ing516;ing517;ing518;ing519;ing520;ing521;ing522;ing523;ing524;ing525;ing526;ing527;ing528;ing529;ing530;ing531;ing532;ing533;ing534;ing535;ing536;ing537;ing538;ing539;ing540;ing541;ing542;ing543;ing544;ing545;ing546;ing547;ing548;ing549;ing550;ing551;ing552;ing553;ing554;ing555;ing556;ing557;ing558;ing559;ing560;ing561;ing562;ing563;ing564;ing565;ing566;ing567;ing568;ing569;ing570;ing571;ing572;ing573;ing574;ing575;ing576;ing577;ing578;ing579;ing580;ing581;ing582;ing583;ing584;ing585;ing586;ing587;ing588;ing589;ing590;ing591;ing592;ing593;ing594;ing595;ing596;ing597;ing598;ing599;ing600;ing601;ing602;ing603;ing604;ing605;ing606;ing607;ing608;ing609;ing610;ing611;ing612;ing613;ing614;ing615;ing616;ing617;ing618;ing619;ing620;ing621;ing622;ing623;ing624;ing625;ing626;ing627;ing628;ing629;ing630;ing631;ing632;ing633;ing634;ing635;ing636;ing637;ing638;ing639;ing640;ing641;ing642;ing643;ing644;ing645;ing646;ing647;ing648;ing649;ing650;ing651;ing652;ing653;ing654;ing655;ing656;ing657;ing658;ing659;ing660;ing661;ing662;ing663;ing664;ing665;ing666;ing667;ing668;ing669;ing670;ing671;ing672;ing673;ing674;ing675;ing676;ing677;ing678;ing679;ing680;ing681;ing682;ing683;ing684;ing685;ing686;ing687;ing688;ing689;ing690;ing691;ing692;ing693;ing694;ing695;ing696;ing697;ing698;ing699;ing700;ing701;ing702;ing703;ing704;ing705;ing706;ing707;ing708;ing709;ing710;ing711;ing712;ing713;ing714;ing715;ing716;ing717;ing718;ing719;ing720;ing721;ing722;ing723;ing724;ing725;ing726;ing727;ing728;ing729;ing730;ing731;ing732;ing733;ing734;ing735;ing736;ing737;ing738;ing739;ing740;ing741;ing742;ing743;ing744;ing745;ing746;ing747;ing748;ing749;ing750;ing751;ing752;ing753;ing754;ing755;ing756;ing757;ing758;ing759;ing760;ing761;ing762;ing763;ing764;ing765;ing766;ing767;ing768;ing769;ing770;ing771;ing772;ing773;ing774;ing775;ing776;ing777;ing778;ing779;ing780;ing781;ing782;ing783;ing784;ing785;ing786;ing787;ing788;ing789;ing790;ing791;ing792;ing793;ing794;ing795;ing796;ing797;ing798;ing799;ing800;ing801;ing802;ing803;ing804;ing805;ing806;ing807;ing808;ing809;ing810;ing811;ing812;ing813;ing814;ing815;ing816;ing817;ing818;ing819;ing820;ing821;ing822;ing823;ing824;ing825;ing826;ing827;ing828;ing829;ing830;ing831;ing832;ing833;ing834;ing835;ing836;ing837;ing838;ing839;ing840;ing841;ing842;ing843;ing844;ing845;ing846;ing847;ing848;ing849;ing850;ing851;ing852;ing853;ing854;ing855;ing856;ing857;ing858;ing859;ing860;ing861;ing862;ing863;ing864;ing865;ing866;ing867;ing868;ing869;ing870;ing871;ing872;ing873;ing874;ing875;ing876;ing877;ing878;ing879;ing880;ing881;ing882;ing883;ing884;ing885;ing886;ing887;ing888;ing889;ing890;ing891;ing892;ing893;ing894;ing895;ing896;ing897;ing898;ing899;ing900;ing901;ing902;ing903;ing904;ing905;ing906;ing907;ing908;ing909;ing910;ing911;ing912;ing913;ing914;ing915;ing916;ing917;ing918;ing919;ing920;ing921;ing922;ing923;ing924;ing925;ing926;ing927;ing928;ing929;ing930;ing931;ing932;ing933;ing934;ing935;ing936;ing937;ing938;ing939;ing940;ing941;ing942;ing943;ing944;ing945;ing946;ing947;ing948;ing949;ing950;ing951;ing952;ing953;ing954;ing955;ing956;ing957;ing958;ing959;ing960;ing961;ing962;ing963;ing964;ing965;ing966;ing967;ing968;ing969;ing970;ing971;ing972;ing973;ing974;ing975;ing976;ing977;ing978;ing979;ing980;ing981;ing982;ing983;ing984;ing985;ing986;ing987;ing988;ing989;ing990;ing991;ing992;ing993;ing994;ing995;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9;string10;string11;string12;string13;string14;string15;string16;string17;string18;string19;string20;string21;string22;string23;string24;string25;string26;string27;string28;string29;string30;string31;string32;string33;string34;string35;string36;string37;string38;string39;string40;string41;string42;string43;string44;string45;string46;string47;string48;string49;string50;string51;string52;string53;string54;string55;string56;string57;string58;string59;string60;string61;string62;string63;string64;string65;string66;string67;string68;string69;string70;string71;string72;string73;string74;string75;string76;string77;string78;string79;string80;string81;string82;string83;string84;string85;string86;string87;string88;string89;string90;string91;string92;string93;string94;string95;string96;string97;string98;string99;string100;string101;string102;string103;string104;string105;string106;string107;string108;string109;string110;string111;string112;string113;string114;string115;string116;string117;string118;string119;string120;string121;string122;string123;string124;string125;string126;string127;string128;string129;string130;string131;string132;string133;string134;string135;string136;string137;string138;string139;string140;string141;string142;string143;string144;string145;string146;string147;string148;string149;string150;string151;string152;string153;string154;string155;string156;string157;string158;string159;string160;string161;string162;string163;string164;string165;string166;string167;string168;string169;string170;string171;string172;string173;string174;string175;string176;string177;string178;string179;string180;string181;string182;string183;string184;string185;string186;string187;string188;string189;string190;string191;string192;string193;string194;string195;string196;string197;string198;string199;string200;string201;string202;string203;string204;string205;string206;string207;string208;string209;string210;string211;string212;string213;string214;string215;string216;string217;string218;string219;string220;string221;string222;string223;string224;string225;string226;string227;string228;string229;string230;string231;string232;string233;string234;string235;string236;string237;string238;string239;string240;string241;string242;string243;string244;string245;string246;string247;string248;string249;string250;string251;string252;string253;string254;string255;string256;string257;string258;string259;string260;string261;string262;string263;string264;string265;string266;string267;string268;string269;string270;string271;string272;string273;string274;string275;string276;string277;string278;string279;string280;string281;string282;string283;string284;string285;string286;string287;string288;string289;string290;string291;string292;string293;string294;string295;string296;string297;string298;string299;string300;string301;string302;string303;string304;string305;string306;string307;string308;string309;string310;string311;string312;string313;string314;string315;string316;string317;string318;string319;string320;string321;string322;string323;string324;string325;string326;string327;string328;string329;string330;string331;string332;string333;string334;string335;string336;string337;string338;string339;string340;string341;string342;string343;string344;string345;string346;string347;string348;string349;string350;string351;string352;string353;string354;string355;string356;string357;string358;string359;string360;string361;string362;string363;string364;string365;string366;string367;string368;string369;string370;string371;string372;string373;string374;string375;string376;string377;string378;string379;string380;string381;string382;string383;string384;string385;string386;string387;string388;string389;string390;string391;string392;string393;string394;string395;string396;string397;string398;string399;string400;string401;string402;string403;string404;string405;string406;string407;string408;string409;string410;string411;string412;string413;string414;string415;string416;string417;string418;string419;string420;string421;string422;string423;string424;string425;string426;string427;string428;string429;string430;string431;string432;string433;string434;string435;string436;string437;string438;string439;string440;string441;string442;string443;string444;string445;string446;string447;string448;string449;string450;string451;string452;string453;string454;string455;string456;string457;string458;string459;string460;string461;string462;string463;string464;string465;string466;string467;string468;string469;string470;string471;string472;string473;string474;string475;string476;string477;string478;string479;string480;string481;string482;string483;string484;string485;string486;string487;string488;string489;string490;string491;string492;string493;string494;string495;string496;string497;string498;string499;string500;string501;string502;string503;string504;string505;string506;string507;string508;string509;string510;string511;string512;string513;string514;string515;string516;string517;string518;string519;string520;string521;string522;string523;string524;string525;string526;string527;string528;string529;string530;string531;string532;string533;string534;string535;string536;string537;string538;string539;string540;string541;string542;string543;string544;string545;string546;string547;string548;string549;string550;string551;string552;string553;string554;string555;string556;string557;string558;string559;string560;string561;string562;string563;string564;string565;string566;string567;string568;string569;string570;string571;string572;string573;string574;string575;string576;string577;string578;string579;string580;string581;string582;string583;string584;string585;string586;string587;string588;string589;string590;string591;string592;string593;string594;string595;string596;string597;string598;string599;string600;string601;string602;string603;string604;string605;string606;string607;string608;string609;string610;string611;string612;string613;string614;string615;string616;string617;string618;string619;string620;string621;string622;string623;string624;string625;string626;string627;string628;string629;string630;string631;string632;string633;string634;string635;string636;string637;string638;string639;string640;string641;string642;string643;string644;string645;string646;string647;string648;string649;string650;string651;string652;string653;string654;string655;string656;string657;string658;string659;string660;string661;string662;string663;string664;string665;string666;string667;string668;string669;string670;string671;string672;string673;string674;string675;string676;string677;string678;string679;string680;string681;string682;string683;string684;string685;string686;string687;string688;string689;string690;string691;string692;string693;string694;string695;string696;string697;string698;string699;string700;string701;string702;string703;string704;string705;string706;string707;string708;string709;string710;string711;string712;string713;string714;string715;string716;string717;string718;string719;string720;string721;string722;string723;string724;string725;string726;string727;string728;string729;string730;string731;string732;string733;string734;string735;string736;string737;string738;string739;string740;string741;string742;string743;string744;string745;string746;string747;string748;string749;string750;string751;string752;string753;string754;string755;string756;string757;string758;string759;string760;string761;string762;string763;string764;string765;string766;string767;string768;string769;string770;string771;string772;string773;string774;string775;string776;string777;string778;string779;string780;string781;string782;string783;string784;string785;string786;string787;string788;string789;string790;string791;string792;string793;string794;string795;string796;string797;string798;string799;string800;string801;string802;string803;string804;string805;string806;string807;string808;string809;string810;string811;string812;string813;string814;string815;string816;string817;string818;string819;string820;string821;string822;string823;string824;string825;string826;string827;string828;string829;string830;string831;string832;string833;string834;string835;string836;string837;string838;string839;string840;string841;string842;string843;string844;string845;string846;string847;string848;string849;string850;string851;string852;string853;string854;string855;string856;string857;string858;string859;string860;string861;string862;string863;string864;string865;string866;string867;string868;string869;string870;string871;string872;string873;string874;string875;string876;string877;string878;string879;string880;string881;string882;string883;string884;string885;string886;string887;string888;string889;string890;string891;string892;string893;string894;string895;string896;string897;string898;string899;string900;string901;string902;string903;string904;string905;string906;string907;string908;string909;string910;string911;string912;string913;string914;string915;string916;string917;string918;string919;string920;string921;string922;string923;string924;string925;string926;string927;string928;string929;string930;string931;string932;string933;string934;string935;string936;string937;string938;string939;string940;string941;string942;string943;string944;string945;string946;string947;string948;string949;string950;string951;string952;string953;string954;string955;string956;string957;string958;string959;string960;string961;string962;string963;string964;string965;string966;string967;string968;string969;string970;string971;string972;string973;string974;string975;string976;string977;string978;string979;string980;string981;string982;string983;string984;string985;string986;string987;string988;string989;string990;string991;string992;string993;string994;string995;string996;string997;string998;string999 +start;ing0;ing1;ing2;ing3;ing4;ing5;ing6;ing7;ing8;ing9;ing10;ing11;ing12;ing13;ing14;ing15;ing16;ing17;ing18;ing19;ing20;ing21;ing22;ing23;ing24;ing25;ing26;ing27;ing28;ing29;ing30;ing31;ing32;ing33;ing34;ing35;ing36;ing37;ing38;ing39;ing40;ing41;ing42;ing43;ing44;ing45;ing46;ing47;ing48;ing49;ing50;ing51;ing52;ing53;ing54;ing55;ing56;ing57;ing58;ing59;ing60;ing61;ing62;ing63;ing64;ing65;ing66;ing67;ing68;ing69;ing70;ing71;ing72;ing73;ing74;ing75;ing76;ing77;ing78;ing79;ing80;ing81;ing82;ing83;ing84;ing85;ing86;ing87;ing88;ing89;ing90;ing91;ing92;ing93;ing94;ing95;ing96;ing97;ing98;ing99;ing100;ing101;ing102;ing103;ing104;ing105;ing106;ing107;ing108;ing109;ing110;ing111;ing112;ing113;ing114;ing115;ing116;ing117;ing118;ing119;ing120;ing121;ing122;ing123;ing124;ing125;ing126;ing127;ing128;ing129;ing130;ing131;ing132;ing133;ing134;ing135;ing136;ing137;ing138;ing139;ing140;ing141;ing142;ing143;ing144;ing145;ing146;ing147;ing148;ing149;ing150;ing151;ing152;ing153;ing154;ing155;ing156;ing157;ing158;ing159;ing160;ing161;ing162;ing163;ing164;ing165;ing166;ing167;ing168;ing169;ing170;ing171;ing172;ing173;ing174;ing175;ing176;ing177;ing178;ing179;ing180;ing181;ing182;ing183;ing184;ing185;ing186;ing187;ing188;ing189;ing190;ing191;ing192;ing193;ing194;ing195;ing196;ing197;ing198;ing199;ing200;ing201;ing202;ing203;ing204;ing205;ing206;ing207;ing208;ing209;ing210;ing211;ing212;ing213;ing214;ing215;ing216;ing217;ing218;ing219;ing220;ing221;ing222;ing223;ing224;ing225;ing226;ing227;ing228;ing229;ing230;ing231;ing232;ing233;ing234;ing235;ing236;ing237;ing238;ing239;ing240;ing241;ing242;ing243;ing244;ing245;ing246;ing247;ing248;ing249;ing250;ing251;ing252;ing253;ing254;ing255;ing256;ing257;ing258;ing259;ing260;ing261;ing262;ing263;ing264;ing265;ing266;ing267;ing268;ing269;ing270;ing271;ing272;ing273;ing274;ing275;ing276;ing277;ing278;ing279;ing280;ing281;ing282;ing283;ing284;ing285;ing286;ing287;ing288;ing289;ing290;ing291;ing292;ing293;ing294;ing295;ing296;ing297;ing298;ing299;ing300;ing301;ing302;ing303;ing304;ing305;ing306;ing307;ing308;ing309;ing310;ing311;ing312;ing313;ing314;ing315;ing316;ing317;ing318;ing319;ing320;ing321;ing322;ing323;ing324;ing325;ing326;ing327;ing328;ing329;ing330;ing331;ing332;ing333;ing334;ing335;ing336;ing337;ing338;ing339;ing340;ing341;ing342;ing343;ing344;ing345;ing346;ing347;ing348;ing349;ing350;ing351;ing352;ing353;ing354;ing355;ing356;ing357;ing358;ing359;ing360;ing361;ing362;ing363;ing364;ing365;ing366;ing367;ing368;ing369;ing370;ing371;ing372;ing373;ing374;ing375;ing376;ing377;ing378;ing379;ing380;ing381;ing382;ing383;ing384;ing385;ing386;ing387;ing388;ing389;ing390;ing391;ing392;ing393;ing394;ing395;ing396;ing397;ing398;ing399;ing400;ing401;ing402;ing403;ing404;ing405;ing406;ing407;ing408;ing409;ing410;ing411;ing412;ing413;ing414;ing415;ing416;ing417;ing418;ing419;ing420;ing421;ing422;ing423;ing424;ing425;ing426;ing427;ing428;ing429;ing430;ing431;ing432;ing433;ing434;ing435;ing436;ing437;ing438;ing439;ing440;ing441;ing442;ing443;ing444;ing445;ing446;ing447;ing448;ing449;ing450;ing451;ing452;ing453;ing454;ing455;ing456;ing457;ing458;ing459;ing460;ing461;ing462;ing463;ing464;ing465;ing466;ing467;ing468;ing469;ing470;ing471;ing472;ing473;ing474;ing475;ing476;ing477;ing478;ing479;ing480;ing481;ing482;ing483;ing484;ing485;ing486;ing487;ing488;ing489;ing490;ing491;ing492;ing493;ing494;ing495;ing496;ing497;ing498;ing499;ing500;ing501;ing502;ing503;ing504;ing505;ing506;ing507;ing508;ing509;ing510;ing511;ing512;ing513;ing514;ing515;ing516;ing517;ing518;ing519;ing520;ing521;ing522;ing523;ing524;ing525;ing526;ing527;ing528;ing529;ing530;ing531;ing532;ing533;ing534;ing535;ing536;ing537;ing538;ing539;ing540;ing541;ing542;ing543;ing544;ing545;ing546;ing547;ing548;ing549;ing550;ing551;ing552;ing553;ing554;ing555;ing556;ing557;ing558;ing559;ing560;ing561;ing562;ing563;ing564;ing565;ing566;ing567;ing568;ing569;ing570;ing571;ing572;ing573;ing574;ing575;ing576;ing577;ing578;ing579;ing580;ing581;ing582;ing583;ing584;ing585;ing586;ing587;ing588;ing589;ing590;ing591;ing592;ing593;ing594;ing595;ing596;ing597;ing598;ing599;ing600;ing601;ing602;ing603;ing604;ing605;ing606;ing607;ing608;ing609;ing610;ing611;ing612;ing613;ing614;ing615;ing616;ing617;ing618;ing619;ing620;ing621;ing622;ing623;ing624;ing625;ing626;ing627;ing628;ing629;ing630;ing631;ing632;ing633;ing634;ing635;ing636;ing637;ing638;ing639;ing640;ing641;ing642;ing643;ing644;ing645;ing646;ing647;ing648;ing649;ing650;ing651;ing652;ing653;ing654;ing655;ing656;ing657;ing658;ing659;ing660;ing661;ing662;ing663;ing664;ing665;ing666;ing667;ing668;ing669;ing670;ing671;ing672;ing673;ing674;ing675;ing676;ing677;ing678;ing679;ing680;ing681;ing682;ing683;ing684;ing685;ing686;ing687;ing688;ing689;ing690;ing691;ing692;ing693;ing694;ing695;ing696;ing697;ing698;ing699;ing700;ing701;ing702;ing703;ing704;ing705;ing706;ing707;ing708;ing709;ing710;ing711;ing712;ing713;ing714;ing715;ing716;ing717;ing718;ing719;ing720;ing721;ing722;ing723;ing724;ing725;ing726;ing727;ing728;ing729;ing730;ing731;ing732;ing733;ing734;ing735;ing736;ing737;ing738;ing739;ing740;ing741;ing742;ing743;ing744;ing745;ing746;ing747;ing748;ing749;ing750;ing751;ing752;ing753;ing754;ing755;ing756;ing757;ing758;ing759;ing760;ing761;ing762;ing763;ing764;ing765;ing766;ing767;ing768;ing769;ing770;ing771;ing772;ing773;ing774;ing775;ing776;ing777;ing778;ing779;ing780;ing781;ing782;ing783;ing784;ing785;ing786;ing787;ing788;ing789;ing790;ing791;ing792;ing793;ing794;ing795;ing796;ing797;ing798;ing799;ing800;ing801;ing802;ing803;ing804;ing805;ing806;ing807;ing808;ing809;ing810;ing811;ing812;ing813;ing814;ing815;ing816;ing817;ing818;ing819;ing820;ing821;ing822;ing823;ing824;ing825;ing826;ing827;ing828;ing829;ing830;ing831;ing832;ing833;ing834;ing835;ing836;ing837;ing838;ing839;ing840;ing841;ing842;ing843;ing844;ing845;ing846;ing847;ing848;ing849;ing850;ing851;ing852;ing853;ing854;ing855;ing856;ing857;ing858;ing859;ing860;ing861;ing862;ing863;ing864;ing865;ing866;ing867;ing868;ing869;ing870;ing871;ing872;ing873;ing874;ing875;ing876;ing877;ing878;ing879;ing880;ing881;ing882;ing883;ing884;ing885;ing886;ing887;ing888;ing889;ing890;ing891;ing892;ing893;ing894;ing895;ing896;ing897;ing898;ing899;ing900;ing901;ing902;ing903;ing904;ing905;ing906;ing907;ing908;ing909;ing910;ing911;ing912;ing913;ing914;ing915;ing916;ing917;ing918;ing919;ing920;ing921;ing922;ing923;ing924;ing925;ing926;ing927;ing928;ing929;ing930;ing931;ing932;ing933;ing934;ing935;ing936;ing937;ing938;ing939;ing940;ing941;ing942;ing943;ing944;ing945;ing946;ing947;ing948;ing949;ing950;ing951;ing952;ing953;ing954;ing955;ing956;ing957;ing958;ing959;ing960;ing961;ing962;ing963;ing964;ing965;ing966;ing967;ing968;ing969;ing970;ing971;ing972;ing973;ing974;ing975;ing976;ing977;ing978;ing979;ing980;ing981;ing982;ing983;ing984;ing985;ing986;ing987;ing988;ing989;ing990;ing991;ing992;ing993;ing994;ing995;ing996;ing997;ing998;ing999 +start;string0;string1;string2;string3;string4;string5;string6;string7;string8;string9;string10;string11;string12;string13;string14;string15;string16;string17;string18;string19;string20;string21;string22;string23;string24;string25;string26;string27;string28;string29;string30;string31;string32;string33;string34;string35;string36;string37;string38;string39;string40;string41;string42;string43;string44;string45;string46;string47;string48;string49;string50;string51;string52;string53;string54;string55;string56;string57;string58;string59;string60;string61;string62;string63;string64;string65;string66;string67;string68;string69;string70;string71;string72;string73;string74;string75;string76;string77;string78;string79;string80;string81;string82;string83;string84;string85;string86;string87;string88;string89;string90;string91;string92;string93;string94;string95;string96;string97;string98;string99;string100;string101;string102;string103;string104;string105;string106;string107;string108;string109;string110;string111;string112;string113;string114;string115;string116;string117;string118;string119;string120;string121;string122;string123;string124;string125;string126;string127;string128;string129;string130;string131;string132;string133;string134;string135;string136;string137;string138;string139;string140;string141;string142;string143;string144;string145;string146;string147;string148;string149;string150;string151;string152;string153;string154;string155;string156;string157;string158;string159;string160;string161;string162;string163;string164;string165;string166;string167;string168;string169;string170;string171;string172;string173;string174;string175;string176;string177;string178;string179;string180;string181;string182;string183;string184;string185;string186;string187;string188;string189;string190;string191;string192;string193;string194;string195;string196;string197;string198;string199;string200;string201;string202;string203;string204;string205;string206;string207;string208;string209;string210;string211;string212;string213;string214;string215;string216;string217;string218;string219;string220;string221;string222;string223;string224;string225;string226;string227;string228;string229;string230;string231;string232;string233;string234;string235;string236;string237;string238;string239;string240;string241;string242;string243;string244;string245;string246;string247;string248;string249;string250;string251;string252;string253;string254;string255;string256;string257;string258;string259;string260;string261;string262;string263;string264;string265;string266;string267;string268;string269;string270;string271;string272;string273;string274;string275;string276;string277;string278;string279;string280;string281;string282;string283;string284;string285;string286;string287;string288;string289;string290;string291;string292;string293;string294;string295;string296;string297;string298;string299;string300;string301;string302;string303;string304;string305;string306;string307;string308;string309;string310;string311;string312;string313;string314;string315;string316;string317;string318;string319;string320;string321;string322;string323;string324;string325;string326;string327;string328;string329;string330;string331;string332;string333;string334;string335;string336;string337;string338;string339;string340;string341;string342;string343;string344;string345;string346;string347;string348;string349;string350;string351;string352;string353;string354;string355;string356;string357;string358;string359;string360;string361;string362;string363;string364;string365;string366;string367;string368;string369;string370;string371;string372;string373;string374;string375;string376;string377;string378;string379;string380;string381;string382;string383;string384;string385;string386;string387;string388;string389;string390;string391;string392;string393;string394;string395;string396;string397;string398;string399;string400;string401;string402;string403;string404;string405;string406;string407;string408;string409;string410;string411;string412;string413;string414;string415;string416;string417;string418;string419;string420;string421;string422;string423;string424;string425;string426;string427;string428;string429;string430;string431;string432;string433;string434;string435;string436;string437;string438;string439;string440;string441;string442;string443;string444;string445;string446;string447;string448;string449;string450;string451;string452;string453;string454;string455;string456;string457;string458;string459;string460;string461;string462;string463;string464;string465;string466;string467;string468;string469;string470;string471;string472;string473;string474;string475;string476;string477;string478;string479;string480;string481;string482;string483;string484;string485;string486;string487;string488;string489;string490;string491;string492;string493;string494;string495;string496;string497;string498;string499;string500;string501;string502;string503;string504;string505;string506;string507;string508;string509;string510;string511;string512;string513;string514;string515;string516;string517;string518;string519;string520;string521;string522;string523;string524;string525;string526;string527;string528;string529;string530;string531;string532;string533;string534;string535;string536;string537;string538;string539;string540;string541;string542;string543;string544;string545;string546;string547;string548;string549;string550;string551;string552;string553;string554;string555;string556;string557;string558;string559;string560;string561;string562;string563;string564;string565;string566;string567;string568;string569;string570;string571;string572;string573;string574;string575;string576;string577;string578;string579;string580;string581;string582;string583;string584;string585;string586;string587;string588;string589;string590;string591;string592;string593;string594;string595;string596;string597;string598;string599;string600;string601;string602;string603;string604;string605;string606;string607;string608;string609;string610;string611;string612;string613;string614;string615;string616;string617;string618;string619;string620;string621;string622;string623;string624;string625;string626;string627;string628;string629;string630;string631;string632;string633;string634;string635;string636;string637;string638;string639;string640;string641;string642;string643;string644;string645;string646;string647;string648;string649;string650;string651;string652;string653;string654;string655;string656;string657;string658;string659;string660;string661;string662;string663;string664;string665;string666;string667;string668;string669;string670;string671;string672;string673;string674;string675;string676;string677;string678;string679;string680;string681;string682;string683;string684;string685;string686;string687;string688;string689;string690;string691;string692;string693;string694;string695;string696;string697;string698;string699;string700;string701;string702;string703;string704;string705;string706;string707;string708;string709;string710;string711;string712;string713;string714;string715;string716;string717;string718;string719;string720;string721;string722;string723;string724;string725;string726;string727;string728;string729;string730;string731;string732;string733;string734;string735;string736;string737;string738;string739;string740;string741;string742;string743;string744;string745;string746;string747;string748;string749;string750;string751;string752;string753;string754;string755;string756;string757;string758;string759;string760;string761;string762;string763;string764;string765;string766;string767;string768;string769;string770;string771;string772;string773;string774;string775;string776;string777;string778;string779;string780;string781;string782;string783;string784;string785;string786;string787;string788;string789;string790;string791;string792;string793;string794;string795;string796;string797;string798;string799;string800;string801;string802;string803;string804;string805;string806;string807;string808;string809;string810;string811;string812;string813;string814;string815;string816;string817;string818;string819;string820;string821;string822;string823;string824;string825;string826;string827;string828;string829;string830;string831;string832;string833;string834;string835;string836;string837;string838;string839;string840;string841;string842;string843;string844;string845;string846;string847;string848;string849;string850;string851;string852;string853;string854;string855;string856;string857;string858;string859;string860;string861;string862;string863;string864;string865;string866;string867;string868;string869;string870;string871;string872;string873;string874;string875;string876;string877;string878;string879;string880;string881;string882;string883;string884;string885;string886;string887;string888;string889;string890;string891;string892;string893;string894;string895;string896;string897;string898;string899;string900;string901;string902;string903;string904;string905;string906;string907;string908;string909;string910;string911;string912;string913;string914;string915;string916;string917;string918;string919;string920;string921;string922;string923;string924;string925;string926;string927;string928;string929;string930;string931;string932;string933;string934;string935;string936;string937;string938;string939;string940;string941;string942;string943;string944;string945;string946;string947;string948;string949;string950;string951;string952;string953;string954;string955;string956;string957;string958;string959;string960;string961;string962;string963;string964;string965;string966;string967;string968;string969;string970;string971;string972;string973;string974;string975;string976;string977;string978;string979;string980;string981;string982;string983;string984;string985;string986;string987;string988;string989;string990;string991;string992;string993;string994;string995;string996;string997;string998;string999 +start;string0;string1;string2;string3;string4;string5;string6;string7;string8;string9;string10;string11;string12;string13;string14;string15;string16;string17;string18;string19;string20;string21;string22;string23;string24;string25;string26;string27;string28;string29;string30;string31;string32;string33;string34;string35;string36;string37;string38;string39;string40;string41;string42;string43;string44;string45;string46;string47;string48;string49;string50;string51;string52;string53;string54;string55;string56;string57;string58;string59;string60;string61;string62;string63;string64;string65;string66;string67;string68;string69;string70;string71;string72;string73;string74;string75;string76;string77;string78;string79;string80;string81;string82;string83;string84;string85;string86;string87;string88;string89;string90;string91;string92;string93;string94;string95;string96;string97;string98;string99;string100;string101;string102;string103;string104;string105;string106;string107;string108;string109;string110;string111;string112;string113;string114;string115;string116;string117;string118;string119;string120;string121;string122;string123;string124;string125;string126;string127;string128;string129;string130;string131;string132;string133;string134;string135;string136;string137;string138;string139;string140;string141;string142;string143;string144;string145;string146;string147;string148;string149;string150;string151;string152;string153;string154;string155;string156;string157;string158;string159;string160;string161;string162;string163;string164;string165;string166;string167;string168;string169;string170;string171;string172;string173;string174;string175;string176;string177;string178;string179;string180;string181;string182;string183;string184;string185;string186;string187;string188;string189;string190;string191;string192;string193;string194;string195;string196;string197;string198;string199;string200;string201;string202;string203;string204;string205;string206;string207;string208;string209;string210;string211;string212;string213;string214;string215;string216;string217;string218;string219;string220;string221;string222;string223;string224;string225;string226;string227;string228;string229;string230;string231;string232;string233;string234;string235;string236;string237;string238;string239;string240;string241;string242;string243;string244;string245;string246;string247;string248;string249;string250;string251;string252;string253;string254;string255;string256;string257;string258;string259;string260;string261;string262;string263;string264;string265;string266;string267;string268;string269;string270;string271;string272;string273;string274;string275;string276;string277;string278;string279;string280;string281;string282;string283;string284;string285;string286;string287;string288;string289;string290;string291;string292;string293;string294;string295;string296;string297;string298;string299;string300;string301;string302;string303;string304;string305;string306;string307;string308;string309;string310;string311;string312;string313;string314;string315;string316;string317;string318;string319;string320;string321;string322;string323;string324;string325;string326;string327;string328;string329;string330;string331;string332;string333;string334;string335;string336;string337;string338;string339;string340;string341;string342;string343;string344;string345;string346;string347;string348;string349;string350;string351;string352;string353;string354;string355;string356;string357;string358;string359;string360;string361;string362;string363;string364;string365;string366;string367;string368;string369;string370;string371;string372;string373;string374;string375;string376;string377;string378;string379;string380;string381;string382;string383;string384;string385;string386;string387;string388;string389;string390;string391;string392;string393;string394;string395;string396;string397;string398;string399;string400;string401;string402;string403;string404;string405;string406;string407;string408;string409;string410;string411;string412;string413;string414;string415;string416;string417;string418;string419;string420;string421;string422;string423;string424;string425;string426;string427;string428;string429;string430;string431;string432;string433;string434;string435;string436;string437;string438;string439;string440;string441;string442;string443;string444;string445;string446;string447;string448;string449;string450;string451;string452;string453;string454;string455;string456;string457;string458;string459;string460;string461;string462;string463;string464;string465;string466;string467;string468;string469;string470;string471;string472;string473;string474;string475;string476;string477;string478;string479;string480;string481;string482;string483;string484;string485;string486;string487;string488;string489;string490;string491;string492;string493;string494;string495;string496;string497;string498;string499;string500;string501;string502;string503;string504;string505;string506;string507;string508;string509;string510;string511;string512;string513;string514;string515;string516;string517;string518;string519;string520;string521;string522;string523;string524;string525;string526;string527;string528;string529;string530;string531;string532;string533;string534;string535;string536;string537;string538;string539;string540;string541;string542;string543;string544;string545;string546;string547;string548;string549;string550;string551;string552;string553;string554;string555;string556;string557;string558;string559;string560;string561;string562;string563;string564;string565;string566;string567;string568;string569;string570;string571;string572;string573;string574;string575;string576;string577;string578;string579;string580;string581;string582;string583;string584;string585;string586;string587;string588;string589;string590;string591;string592;string593;string594;string595;string596;string597;string598;string599;string600;string601;string602;string603;string604;string605;string606;string607;string608;string609;string610;string611;string612;string613;string614;string615;string616;string617;string618;string619;string620;string621;string622;string623;string624;string625;string626;string627;string628;string629;string630;string631;string632;string633;string634;string635;string636;string637;string638;string639;string640;string641;string642;string643;string644;string645;string646;string647;string648;string649;string650;string651;string652;string653;string654;string655;string656;string657;string658;string659;string660;string661;string662;string663;string664;string665;string666;string667;string668;string669;string670;string671;string672;string673;string674;string675;string676;string677;string678;string679;string680;string681;string682;string683;string684;string685;string686;string687;string688;string689;string690;string691;string692;string693;string694;string695;string696;string697;string698;string699;string700;string701;string702;string703;string704;string705;string706;string707;string708;string709;string710;string711;string712;string713;string714;string715;string716;string717;string718;string719;string720;string721;string722;string723;string724;string725;string726;string727;string728;string729;string730;string731;string732;string733;string734;string735;string736;string737;string738;string739;string740;string741;string742;string743;string744;string745;string746;string747;string748;string749;string750;string751;string752;string753;string754;string755;string756;string757;string758;string759;string760;string761;string762;string763;string764;string765;string766;string767;string768;string769;string770;string771;string772;string773;string774;string775;string776;string777;string778;string779;string780;string781;string782;string783;string784;string785;string786;string787;string788;string789;string790;string791;string792;string793;string794;string795;string796;string797;string798;string799;string800;string801;string802;string803;string804;string805;string806;string807;string808;string809;string810;string811;string812;string813;string814;string815;string816;string817;string818;string819;string820;string821;string822;string823;string824;string825;string826;string827;string828;string829;string830;string831;string832;string833;string834;string835;string836;string837;string838;string839;string840;string841;string842;string843;string844;string845;string846;string847;string848;string849;string850;string851;string852;string853;string854;string855;string856;string857;string858;string859;string860;string861;string862;string863;string864;string865;string866;string867;string868;string869;string870;string871;string872;string873;string874;string875;string876;string877;string878;string879;string880;string881;string882;string883;string884;string885;string886;string887;string888;string889;string890;string891;string892;string893;string894;string895;string896;string897;string898;string899;string900;string901;string902;string903;string904;string905;string906;string907;string908;string909;string910;string911;string912;string913;string914;string915;string916;string917;string918;string919;string920;string921;string922;string923;string924;string925;string926;string927;string928;string929;string930;string931;string932;string933;string934;string935;string936;string937;string938;string939;string940;string941;string942;string943;string944;string945;string946;string947;string948;string949;string950;string951;string952;string953;string954;string955;string956;string957;string958;string959;string960;string961;string962;string963;string964;string965;string966;string967;string968;string969;string970;string971;string972;string973;string974;string975;string976;string977;string978;string979;string980;string981;string982;string983;string984;string985;string986;string987;string988;string989;string990;string991;string992;string993;string994;string995;string996;string997;string998;string999 +ing999 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +art;string0;string1;string2;string3;string4;string5;string6;string7;string8;string9;string10;string11;string12;string13;string14;string15;string16;string17;string18;string19;string20;string21;string22;string23;string24;string25;string26;string27;string28;string29;string30;string31;string32;string33;string34;string35;string36;string37;string38;string39;string40;string41;string42;string43;string44;string45;string46;string47;string48;string49;string50;string51;string52;string53;string54;string55;string56;string57;string58;string59;string60;string61;string62;string63;string64;string65;string66;string67;string68;string69;string70;string71;string72;string73;string74;string75;string76;string77;string78;string79;string80;string81;string82;string83;string84;string85;string86;string87;string88;string89;string90;string91;string92;string93;string94;string95;string96;string97;string98;string99;string100;string101;string102;string103;string104;string105;string106;string107;string108;string109;string110;string111;string112;string113;string114;string115;string116;string117;string118;string119;string120;string121;string122;string123;string124;string125;string126;string127;string128;string129;string130;string131;string132;string133;string134;string135;string136;string137;string138;string139;string140;string141;string142;string143;string144;string145;string146;string147;string148;string149;string150;string151;string152;string153;string154;string155;string156;string157;string158;string159;string160;string161;string162;string163;string164;string165;string166;string167;string168;string169;string170;string171;string172;string173;string174;string175;string176;string177;string178;string179;string180;string181;string182;string183;string184;string185;string186;string187;string188;string189;string190;string191;string192;string193;string194;string195;string196;string197;string198;string199;string200;string201;string202;string203;string204;string205;string206;string207;string208;string209;string210;string211;string212;string213;string214;string215;string216;string217;string218;string219;string220;string221;string222;string223;string224;string225;string226;string227;string228;string229;string230;string231;string232;string233;string234;string235;string236;string237;string238;string239;string240;string241;string242;string243;string244;string245;string246;string247;string248;string249;string250;string251;string252;string253;string254;string255;string256;string257;string258;string259;string260;string261;string262;string263;string264;string265;string266;string267;string268;string269;string270;string271;string272;string273;string274;string275;string276;string277;string278;string279;string280;string281;string282;string283;string284;string285;string286;string287;string288;string289;string290;string291;string292;string293;string294;string295;string296;string297;string298;string299;string300;string301;string302;string303;string304;string305;string306;string307;string308;string309;string310;string311;string312;string313;string314;string315;string316;string317;string318;string319;string320;string321;string322;string323;string324;string325;string326;string327;string328;string329;string330;string331;string332;string333;string334;string335;string336;string337;string338;string339;string340;string341;string342;string343;string344;string345;string346;string347;string348;string349;string350;string351;string352;string353;string354;string355;string356;string357;string358;string359;string360;string361;string362;string363;string364;string365;string366;string367;string368;string369;string370;string371;string372;string373;string374;string375;string376;string377;string378;string379;string380;string381;string382;string383;string384;string385;string386;string387;string388;string389;string390;string391;string392;string393;string394;string395;string396;string397;string398;string399;string400;string401;string402;string403;string404;string405;string406;string407;string408;string409;string410;string411;string412;string413;string414;string415;string416;string417;string418;string419;string420;string421;string422;string423;string424;string425;string426;string427;string428;string429;string430;string431;string432;string433;string434;string435;string436;string437;string438;string439;string440;string441;string442;string443;string444;string445;string446;string447;string448;string449;string450;string451;string452;string453;string454;string455;string456;string457;string458;string459;string460;string461;string462;string463;string464;string465;string466;string467;string468;string469;string470;string471;string472;string473;string474;string475;string476;string477;string478;string479;string480;string481;string482;string483;string484;string485;string486;string487;string488;string489;string490;string491;string492;string493;string494;string495;string496;string497;string498;string499;string500;string501;string502;string503;string504;string505;string506;string507;string508;string509;string510;string511;string512;string513;string514;string515;string516;string517;string518;string519;string520;string521;string522;string523;string524;string525;string526;string527;string528;string529;string530;string531;string532;string533;string534;string535;string536;string537;string538;string539;string540;string541;string542;string543;string544;string545;string546;string547;string548;string549;string550;string551;string552;string553;string554;string555;string556;string557;string558;string559;string560;string561;string562;string563;string564;string565;string566;string567;string568;string569;string570;string571;string572;string573;string574;string575;string576;string577;string578;string579;string580;string581;string582;string583;string584;string585;string586;string587;string588;string589;string590;string591;string592;string593;string594;string595;string596;string597;string598;string599;string600;string601;string602;string603;string604;string605;string606;string607;string608;string609;string610;string611;string612;string613;string614;string615;string616;string617;string618;string619;string620;string621;string622;string623;string624;string625;string626;string627;string628;string629;string630;string631;string632;string633;string634;string635;string636;string637;string638;string639;string640;string641;string642;string643;string644;string645;string646;string647;string648;string649;string650;string651;string652;string653;string654;string655;string656;string657;string658;string659;string660;string661;string662;string663;string664;string665;string666;string667;string668;string669;string670;string671;string672;string673;string674;string675;string676;string677;string678;string679;string680;string681;string682;string683;string684;string685;string686;string687;string688;string689;string690;string691;string692;string693;string694;string695;string696;string697;string698;string699;string700;string701;string702;string703;string704;string705;string706;string707;string708;string709;string710;string711;string712;string713;string714;string715;string716;string717;string718;string719;string720;string721;string722;string723;string724;string725;string726;string727;string728;string729;string730;string731;string732;string733;string734;string735;string736;string737;string738;string739;string740;string741;string742;string743;string744;string745;string746;string747;string748;string749;string750;string751;string752;string753;string754;string755;string756;string757;string758;string759;string760;string761;string762;string763;string764;string765;string766;string767;string768;string769;string770;string771;string772;string773;string774;string775;string776;string777;string778;string779;string780;string781;string782;string783;string784;string785;string786;string787;string788;string789;string790;string791;string792;string793;string794;string795;string796;string797;string798;string799;string800;string801;string802;string803;string804;string805;string806;string807;string808;string809;string810;string811;string812;string813;string814;string815;string816;string817;string818;string819;string820;string821;string822;string823;string824;string825;string826;string827;string828;string829;string830;string831;string832;string833;string834;string835;string836;string837;string838;string839;string840;string841;string842;string843;string844;string845;string846;string847;string848;string849;string850;string851;string852;string853;string854;string855;string856;string857;string858;string859;string860;string861;string862;string863;string864;string865;string866;string867;string868;string869;string870;string871;string872;string873;string874;string875;string876;string877;string878;string879;string880;string881;string882;string883;string884;string885;string886;string887;string888;string889;string890;string891;string892;string893;string894;string895;string896;string897;string898;string899;string900;string901;string902;string903;string904;string905;string906;string907;string908;string909;string910;string911;string912;string913;string914;string915;string916;string917;string918;string919;string920;string921;string922;string923;string924;string925;string926;string927;string928;string929;string930;string931;string932;string933;string934;string935;string936;string937;string938;string939;string940;string941;string942;string943;string944;string945;string946;string947;string948;string949;string950;string951;string952;string953;string954;string955;string956;string957;string958;string959;string960;string961;string962;string963;string964;string965;string966;string967;string968;string969;string970;string971;string972;string973;string974;string975;string976;string977;string978;string979;string980;string981;string982;string983;string984;string985;string986;string987;string988;string989;string990;string991;string992;string993;string994;string995;string996;string997;string998;string999 +start;string0;string1;string2;string3;string4;string5;string6;string7;string8;string9;string10;string11;string12;string13;string14;string15;string16;string17;string18;string19;string20;string21;string22;string23;string24;string25;string26;string27;string28;string29;string30;string31;string32;string33;string34;string35;string36;string37;string38;string39;string40;string41;string42;string43;string44;string45;string46;string47;string48;string49;string50;string51;string52;string53;string54;string55;string56;string57;string58;string59;string60;string61;string62;string63;string64;string65;string66;string67;string68;string69;string70;string71;string72;string73;string74;string75;string76;string77;string78;string79;string80;string81;string82;string83;string84;string85;string86;string87;string88;string89;string90;string91;string92;string93;string94;string95;string96;string97;string98;string99;string100;string101;string102;string103;string104;string105;string106;string107;string108;string109;string110;string111;string112;string113;string114;string115;string116;string117;string118;string119;string120;string121;string122;string123;string124;string125;string126;string127;string128;string129;string130;string131;string132;string133;string134;string135;string136;string137;string138;string139;string140;string141;string142;string143;string144;string145;string146;string147;string148;string149;string150;string151;string152;string153;string154;string155;string156;string157;string158;string159;string160;string161;string162;string163;string164;string165;string166;string167;string168;string169;string170;string171;string172;string173;string174;string175;string176;string177;string178;string179;string180;string181;string182;string183;string184;string185;string186;string187;string188;string189;string190;string191;string192;string193;string194;string195;string196;string197;string198;string199;string200;string201;string202;string203;string204;string205;string206;string207;string208;string209;string210;string211;string212;string213;string214;string215;string216;string217;string218;string219;string220;string221;string222;string223;string224;string225;string226;string227;string228;string229;string230;string231;string232;string233;string234;string235;string236;string237;string238;string239;string240;string241;string242;string243;string244;string245;string246;string247;string248;string249;string250;string251;string252;string253;string254;string255;string256;string257;string258;string259;string260;string261;string262;string263;string264;string265;string266;string267;string268;string269;string270;string271;string272;string273;string274;string275;string276;string277;string278;string279;string280;string281;string282;string283;string284;string285;string286;string287;string288;string289;string290;string291;string292;string293;string294;string295;string296;string297;string298;string299;string300;string301;string302;string303;string304;string305;string306;string307;string308;string309;string310;string311;string312;string313;string314;string315;string316;string317;string318;string319;string320;string321;string322;string323;string324;string325;string326;string327;string328;string329;string330;string331;string332;string333;string334;string335;string336;string337;string338;string339;string340;string341;string342;string343;string344;string345;string346;string347;string348;string349;string350;string351;string352;string353;string354;string355;string356;string357;string358;string359;string360;string361;string362;string363;string364;string365;string366;string367;string368;string369;string370;string371;string372;string373;string374;string375;string376;string377;string378;string379;string380;string381;string382;string383;string384;string385;string386;string387;string388;string389;string390;string391;string392;string393;string394;string395;string396;string397;string398;string399;string400;string401;string402;string403;string404;string405;string406;string407;string408;string409;string410;string411;string412;string413;string414;string415;string416;string417;string418;string419;string420;string421;string422;string423;string424;string425;string426;string427;string428;string429;string430;string431;string432;string433;string434;string435;string436;string437;string438;string439;string440;string441;string442;string443;string444;string445;string446;string447;string448;string449;string450;string451;string452;string453;string454;string455;string456;string457;string458;string459;string460;string461;string462;string463;string464;string465;string466;string467;string468;string469;string470;string471;string472;string473;string474;string475;string476;string477;string478;string479;string480;string481;string482;string483;string484;string485;string486;string487;string488;string489;string490;string491;string492;string493;string494;string495;string496;string497;string498;string499;string500;string501;string502;string503;string504;string505;string506;string507;string508;string509;string510;string511;string512;string513;string514;string515;string516;string517;string518;string519;string520;string521;string522;string523;string524;string525;string526;string527;string528;string529;string530;string531;string532;string533;string534;string535;string536;string537;string538;string539;string540;string541;string542;string543;string544;string545;string546;string547;string548;string549;string550;string551;string552;string553;string554;string555;string556;string557;string558;string559;string560;string561;string562;string563;string564;string565;string566;string567;string568;string569;string570;string571;string572;string573;string574;string575;string576;string577;string578;string579;string580;string581;string582;string583;string584;string585;string586;string587;string588;string589;string590;string591;string592;string593;string594;string595;string596;string597;string598;string599;string600;string601;string602;string603;string604;string605;string606;string607;string608;string609;string610;string611;string612;string613;string614;string615;string616;string617;string618;string619;string620;string621;string622;string623;string624;string625;string626;string627;string628;string629;string630;string631;string632;string633;string634;string635;string636;string637;string638;string639;string640;string641;string642;string643;string644;string645;string646;string647;string648;string649;string650;string651;string652;string653;string654;string655;string656;string657;string658;string659;string660;string661;string662;string663;string664;string665;string666;string667;string668;string669;string670;string671;string672;string673;string674;string675;string676;string677;string678;string679;string680;string681;string682;string683;string684;string685;string686;string687;string688;string689;string690;string691;string692;string693;string694;string695;string696;string697;string698;string699;string700;string701;string702;string703;string704;string705;string706;string707;string708;string709;string710;string711;string712;string713;string714;string715;string716;string717;string718;string719;string720;string721;string722;string723;string724;string725;string726;string727;string728;string729;string730;string731;string732;string733;string734;string735;string736;string737;string738;string739;string740;string741;string742;string743;string744;string745;string746;string747;string748;string749;string750;string751;string752;string753;string754;string755;string756;string757;string758;string759;string760;string761;string762;string763;string764;string765;string766;string767;string768;string769;string770;string771;string772;string773;string774;string775;string776;string777;string778;string779;string780;string781;string782;string783;string784;string785;string786;string787;string788;string789;string790;string791;string792;string793;string794;string795;string796;string797;string798;string799;string800;string801;string802;string803;string804;string805;string806;string807;string808;string809;string810;string811;string812;string813;string814;string815;string816;string817;string818;string819;string820;string821;string822;string823;string824;string825;string826;string827;string828;string829;string830;string831;string832;string833;string834;string835;string836;string837;string838;string839;string840;string841;string842;string843;string844;string845;string846;string847;string848;string849;string850;string851;string852;string853;string854;string855;string856;string857;string858;string859;string860;string861;string862;string863;string864;string865;string866;string867;string868;string869;string870;string871;string872;string873;string874;string875;string876;string877;string878;string879;string880;string881;string882;string883;string884;string885;string886;string887;string888;string889;string890;string891;string892;string893;string894;string895;string896;string897;string898;string899;string900;string901;string902;string903;string904;string905;string906;string907;string908;string909;string910;string911;string912;string913;string914;string915;string916;string917;string918;string919;string920;string921;string922;string923;string924;string925;string926;string927;string928;string929;string930;string931;string932;string933;string934;string935;string936;string937;string938;string939;string940;string941;string942;string943;string944;string945;string946;string947;string948;string949;string950;string951;string952;string953;string954;string955;string956;string957;string958;string959;string960;string961;string962;string963;string964;string965;string966;string967;string968;string969;string970;string971;string972;string973;string974;string975;string976;string977;string978;string979;string980;string981;string982;string983;string984;string985;string986;string987;string988;string989;string990;string991;string992;string993;string994;string995;string996;string997;string998;string9 +a Value = 1 2 3 4 5 +a Sub = 0 1 2 3 4 +b Value = a b c d e +b Sub = 0 1 2 3 4 +c Value = 10 20 40 80 +c Sub = 0 2 4 8 +<1> <2> <3> <4> <5> +<10> <20> <40> <80> +argv[1] = +argv[1] = +./new-exp.tests: line 584: ABXD: parameter unset diff --git a/tests/new-exp.tests b/tests/new-exp.tests new file mode 100644 index 0000000..e48ac3d --- /dev/null +++ b/tests/new-exp.tests @@ -0,0 +1,584 @@ +# must do this because posix mode causes process substitution to be disabled +# and flagged as a syntax error, which causes the shell to exit +set +o posix + +expect() +{ + echo expect "$@" +} + +HOME=/usr/homes/chet # to make the check against new-exp.right work +expect '' +recho "${undef-"foo bar"}" # should be foo bar +expect '' +recho "${und="foo"}" # should be foo + +expect "<$HOME>" +recho ${HOME-"}"} +expect "<$HOME>" +recho "${HOME-'}'}" +expect "<$HOME>" +recho "${HOME-"}"}" + +expect $0: 'HOME: }: syntax error: operand expected (error token is "}")' +recho "${HOME:`echo }`}" # should be a math error -- bad substring substitution + +expect unset +_ENV=oops +x=${_ENV[(_$-=0)+(_=1)-_${-%%*i*}]} +echo ${x:-unset} + +expect "<$HOME>" +recho ${HOME} +expect "<$HOME>" +recho ${HOME:-`echo }`} +expect "<$HOME>" +recho ${HOME:-`echo "}"`} +expect "<$HOME>" +recho "${HOME:-`echo "}"`}" +expect "<$HOME>" +recho "$(echo "${HOME}")" +expect "<$HOME>" +recho "$(echo "$(echo ${HOME})")" +expect "<$HOME>" +recho "$(echo "$(echo "${HOME}")")" + +P=*@* +expect '<*@>' +recho "${P%"*"}" # +expect '<*@>' +recho "${P%'*'}" # +expect '<@*>' +recho "${P#\*}" # should be @* + +expect '<)>' +recho "$(echo ")")" # should be ) +expect '<")">' +recho "$(echo "\")\"")" # should be ")" + +foo='abcd ' +expect '<-abcd> <->' +recho -${foo}- # should be -abcd - +expect '<-abcd> <->' +recho -${foo% *}- # should be -abcd - +expect '<-abcd->' +recho -${foo%% *}- # should be -abcd- + +foo=bar +expect '' +echo -n $foo' ' ; echo foo + +expect '' +echo -n $foo" " ; echo foo + +expect '' +echo -n "$foo " ; echo foo + +expect '' +echo -e "$foo\c " ; echo foo + +expect '' +echo -e $foo"\c " ; echo foo + +# make sure backslashes are preserved in front of characters that are not +# valid backslash escapes +expect '<\x>' +echo -e '\x' + +# substring tests +z=abcdefghijklmnop +expect '' +recho ${z:0:4} + +expect ' ' +recho ${z:4:3} ${z:${#z}-3:3} + +expect ' ' +recho ${z:4:3} ${z: -3:3} + +expect '' +recho ${z:7:30} + +expect '' +recho ${z:0:100} + +expect '' +recho ${z:0:${#z}} + +set 'ab cd' 'ef' 'gh ij' 'kl mn' 'op' +expect ' ' +recho "${@:1:2}" + +expect ' ' +recho "${@:3:2}" + +expect ' ' +recho "${@:3:4}" + +expect ' ' +recho "${@:1:$#}" + +# code to ad-hoc parse arithmetic expressions in substring expansions was +# broken until post-2.04 +base=/home/chet/foo//bar +string1=$base/abcabcabc +x=1 j=4 + +expect '' +recho ${string1:0} + +expect '' +recho ${string1:1} + +expect '' +recho ${string1:(j?1:0):j} + +expect '' +recho ${string1:j?1:0:j} + +expect '' +recho ${string1:(j?(x?1:0):0):j} + +expect '' +recho ${string1:j?(x?1:0):0:j} + +unset base string1 x j + +# indirect variable references +expect '' +recho ${!9:-$z} + +ef=4 +expect '<4>' +recho ${!2} + +expect '' +recho ${!#} + +set a b c d e +a= +expect '' +recho ${a:-$z} +expect '' +recho ${!1:-$z} + +expect nothing +recho ${a-$z} +expect nothing +recho ${!1-$z} + +set -u +expect $0: ABX: unbound variable +( recho ${ABX} ) +set +u + +expect $0: '$6: cannot assign in this way' +recho ${6="arg6"} + +v=abcde + +# sed-like variable substitution +expect '' +recho ${v/a[a-z]/xx} +expect '' +recho ${v/a??/axx} +expect '' +recho ${v/c??/xyz} +expect '' +recho ${v/#a/ab} +expect '' +recho ${v/#d/ab} +expect '' +recho ${v/d/ab} +expect '' +recho ${v/%?/last} +expect '' +recho ${v/%x/last} + +av=(abcd efgh ijkl mnop qrst uvwx) + +expect '' +recho ${av/??/xx} +expect '' +recho ${av/%??/xx} +expect '' +recho ${av[1]/??/xx} +expect '' +recho ${av[1]/%ab/xx} +expect '' +recho ${av[1]/#?/xx} +expect '' +recho ${av[1]/??/za} +expect '' +recho ${av[1]//??/za} +expect '' +recho ${av[1]/#??/za} +expect '' +recho ${av[1]/%??/za} + +expect ' ' +recho ${av[@]/*/yyy} +expect ' ' +recho ${av[@]/#*/yyy} +expect ' ' +recho ${av[@]/%*/yyy} +expect ' ' +recho ${av[@]/a*/yyy} +expect ' ' +recho ${av[@]/%??/xx} + +set abcd efgh ijkl mnop qrst uvwx + +expect '' +recho ${1/??/xx} +expect ' ' +recho ${@/??/xx} +expect ' ' +recho ${@/%??/xx} +expect '' +recho ${3//??/za} +expect '' +recho ${3/%??/za} +expect ' ' +recho ${@//??/za} +expect ' ' +recho ${@/#??/za} +expect ' ' +recho ${@//*/yyy} +expect ' ' +recho ${@//a*/yyy} +expect ' ' +recho ${@/%x*/yyy} + +expect a newline +echo $abmcde + +# sneaky way to replace a newline in a variable value with something else +AVAR=$'This\nstring\nhas\nmultiple\nlines.' +echo "${AVAR}" + +eval BVAR=\"\${AVAR//$'\n'/-}\" +echo "$BVAR" + +unset AVAR BVAR + +# run process substitution tests in a subshell so that syntax errors +# caused by a shell not implementing process substitution (e.g., one +# built on a NeXT) will not cause the whole test to exit prematurely +${THIS_SH} ./new-exp1.sub + +# run the tests of $(' +recho ${#:-foo} +expect $0: '${#:}: bad substitution' +echo ${#:} + +expect "<'>" +recho "'" +expect '<">' +recho '"' +expect '<"hello">' +recho "\"hello\"" + +shift $# +unset foo +z=abcdef +z1='abc def' + +expect '<>' +recho ${foo:-""} +expect nothing +recho ${foo:-"$@"} +expect '<>' +recho "${foo:-$@}" + +# unset var +expect '<>' +recho ${foo:-"$zbcd"} +expect nothing +recho ${foo:-$zbcd} + +# set var +expect '' +recho ${foo:-"$z"} +expect '' +recho ${foo:-"$z1"} + +expect '' +recho ${foo:-$z} +expect ' ' +recho ${foo:-$z1} + +expect '' +recho "${foo:-$z}" +expect '' +recho "${foo:-$z1}" + +expect '' +recho "${foo:-"$z"}" +# this disagrees with sh and ksh, but I think it is right according +# to posix.2. +expect '' +recho "${foo:-"$z1"}" + +set ab cd ef gh +expect ' ' +recho ${foo:-"$@"} +expect ' ' +recho "${foo:-$@}" +expect ' ' +recho "${foo:-"$@"}" + +shift $# +expect nothing +recho $xxx"$@" +expect nothing +recho ${foo:-$xxx"$@"} +expect '<>' +recho "${foo:-$xxx$@}" +expect '<>' +recho "${foo:-$xxx"$@"}" + +expect nothing +recho $xxx"$@" +expect nothing +recho "$xxx$@" +expect nothing +recho "$@"$xxx + +expect '<>' +recho $xxx"" +expect '<>' +recho $xxx'' +expect '<>' +recho ''$xxx +expect '<>' +recho ""$xxx + +AB='abcdefghijklmnopqrstuvwxyz' + +recho ${AB:7:15} +recho ${AB:15:7} + +recho ${AB:20} + +recho ${AB:0} +recho ${AB:0:20} + +recho ${AB:10:7} +recho ${AB:10:3+4} +recho ${AB:20/2:3+4} + +set 1 2 3 4 5 6 +recho \""${*:2:2}"\" + +IFS=: +recho \""${*:2:2}"\" + +IFS=$' \t\n' + +z=123456 + +recho \""${z:2:2}"\" +recho \""${z:2}"\" +recho \""${z:2:4}"\" +recho \""${z:2:6}"\" + +set $'\1' $'\2' $'\177' + +recho $* +recho $@ + +recho ${*} +recho ${@} + +xx=one/two/two +recho ${xx%/*} +recho ${xx/\/two} + +yy=oneonetwo +recho ${yy//one} +recho ${yy/\/one} + +xx=oneonetwo + +recho ${xx/one} +recho ${xx//one} +recho ${xx/\/one} + +# out-of-range substrings +var=abc +c=${var:3} +expect nothing +recho $c +c=${var:4} +expect nothing +recho $c +# as of bash-4.2, negative LENGTH means offset from the end +c=${var:0:-2} +expect '' +recho $c + +var=abcdefghi +c=${var:3:12} +recho $c +c=${var:4:20} +recho $c + +# make sure null patterns work +xxx=endocrine +yyy=n +unset zzz + +recho ${xxx/$yyy/*} +recho ${xxx//$yyy/*} + +recho ${xxx/$zzz/*} +recho ${xxx//$zzz/*} + +recho ${xxx//%${zzz}/} +recho ${xxx//%${zzz}} +recho ${xxx//#${zzz}/} +recho ${xxx//#${zzz}} + +# another case that caused a core dump in bash-2.0 +XPATH=/usr/bin:/bin:/usr/local/bin:/usr/gnu/bin::/usr/bin/X11:/sbin:/usr/sbin + +recho ${XPATH//:/ } + +xx=(ar as at au av aw ax ay az) + +recho ${xx[@]/a/} +recho ${xx[@]//a/} + +recho ${xx[*]/a/} +recho ${xx[*]//a/} + +recho ${xx[@]%?} +recho ${xx[*]%?} + +recho ${xx[@]#?} +recho ${xx[*]#?} + +set -- ar as at au av aw ax ay az + +recho ${@/a/} +recho ${@//a/} + +recho ${*/a/} +recho ${*//a/} + +recho ${@%?} +recho ${*%?} + +recho ${@#?} +recho ${*#?} + +shift $# +set -u +( recho $9 ; echo after 1) +( recho ${9} ; echo after 2) +( recho $UNSET ; echo after 3) +( recho ${UNSET} ; echo after 4) +( recho "$UNSET" ; echo after 5) +( recho "${UNSET}" ; echo after 6) +( recho "${#UNSET}" ; echo after 7) +set +u + +RECEIVED="12345" +recho "${RECEIVED:$((${#RECEIVED}-1)):1}" +RECEIVED="12345#" +recho "${RECEIVED:$((${#RECEIVED}-1)):1}" +RECEIVED="#" +recho "${RECEIVED:$((${#RECEIVED}-1)):1}" +RECEIVED="" +recho "${RECEIVED:$((${#RECEIVED}-1)):1}" + +# tests of new prefix expansion ${!prefix*} +${THIS_SH} ./new-exp3.sub + +# bug with indirect expansion through bash-2.05b +${THIS_SH} ./new-exp4.sub + +# these caused errors and core dumps in versions before bash-2.04 +c="" +echo ${c//${$(($#-1))}/x/} + +set a b c d e f g +recho "$@" + +set -- ${@:1:$(($# - 2))} +recho "$@" + +set a b +recho ${@:1:$(($# - 2))} + +recho ${@:1:0} +recho ${@:1:1} +recho ${@:1:2} + +recho "${*:1:0}" + +# this is an error -- negative expression +set a +recho ${@:1:$(($# - 2))} + +XPATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:.:/sbin:/usr/sbin +set $( IFS=: ; echo $XPATH ) + +recho ${@##*/} +recho ${@%%[!/]*} + +recho ${@#/*} +recho ${@%*/} + +set /full/path/to/x16 /another/full/path + +recho ${1%/*} +recho ${1%%[!/]*} +recho ${1#*/} +recho ${1##*/} + +${THIS_SH} ./new-exp5.sub + +unset var +var=blah + +# these had better agree +echo ${var[@]:3} +echo ${var:3} +echo ${var[@]/#/--} +echo ${var/#/--} +echo ${var[@]##?} +echo ${var##?} + +unset var +var=(abcde abcfg abchi) + +# problems with anchoring pattern replacements +echo ${var[*]//#abc/foo} +echo ${var[*]/#abc/foo} +unset var + +${THIS_SH} ./new-exp6.sub + +${THIS_SH} ./new-exp7.sub + +${THIS_SH} ./new-exp8.sub + +# tests to check whether things like indirect expansion of a variable whose +# value is 'anothervar[@]' stop working +${THIS_SH} ./new-exp9.sub + +# problems with stray CTLNUL in bash-4.0-alpha +unset a +a=/a +recho "/${a%/*}" +recho "/${a///a/}" + +# this must be last! +expect $0: 'ABXD: parameter unset' +recho ${ABXD:?"parameter unset"} diff --git a/tests/new-exp1.sub b/tests/new-exp1.sub new file mode 100644 index 0000000..c015c22 --- /dev/null +++ b/tests/new-exp1.sub @@ -0,0 +1,11 @@ +expect() +{ + echo expect "$@" +} + +expect this is a test of proc subst +cat <(echo this is a test of proc subst) +echo this is test 2 > /tmp/x +expect this is test 2 +cat <(cat /tmp/x) +rm -f /tmp/x diff --git a/tests/new-exp2.sub b/tests/new-exp2.sub new file mode 100644 index 0000000..e837779 --- /dev/null +++ b/tests/new-exp2.sub @@ -0,0 +1,42 @@ +export LC_ALL=C +export LANG=C + +# test out the new $(< filename) code +# it should be exactly equivalent to $(cat filename) + +FILENAME=/tmp/bashtmp.x$$ + +trap 'rm -f $FILENAME' 0 + +cat >$FILENAME << EOF +line 1 +line 2 +line 3 +EOF + +LINES1=$(cat $FILENAME) +LINES2=$(< $FILENAME) + +if [[ $LINES1 != $LINES2 ]]; then + echo 'whoops: $(< filename) failed' +fi + +LINES2=$(< /tmp/bashtmp.x*) +if [[ $LINES1 != $LINES2 ]]; then + echo 'whoops: $(< filename) with glob expansion failed' +fi + +# but the glob expansion in the redirection should fail in posix mode +set -o posix +LINES2=$(< /tmp/bashtmp.x*) +set +o posix + +# now see what happens when we try it with a non-existant file +LINES3=$(< /tmp/redir-notthere) +echo $? + +# These were bugs through bash-4.2 +{ : "$({xxxxxxxxxxxxxxxxxxxx} " "${!tmp}"; echo # Iterate whole array. + +ref=c +tmp="$ref[@]" +printf "<%s> " "${!tmp}"; echo # Iterate whole array. diff --git a/tests/nquote.right b/tests/nquote.right new file mode 100644 index 0000000..9d1290e --- /dev/null +++ b/tests/nquote.right @@ -0,0 +1,58 @@ +argv[1] = <^J^J^J> +argv[1] = <++^J++> +argv[1] = <> +argv[1] = <^J^I > +argv[1] = +argv[1] = <^M^[^Gabc> +argv[1] = +argv[2] = +argv[1] = +argv[1] = <> +argv[1] = <$hello, world> +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = <$hello, chet> +argv[1] = +ok +'abcd' +'abcd' +\'abcd\' +\'abcd\' +argv[1] = +argv[1] = +argv[1] = +A\CB +A\CB +A\CB +argv[1] = +argv[1] = +argv[1] = +argv[1] = +1 +1 +;foo +argv[1] = <^I> +argv[1] = <'A^IB'> +hello' world +hello world! +hello' world! +' | ' +' | ' +x | x +x | x +' | ' +' | ' +' | ' +' | ' +' | ' +' | ' +x | x +' +$'\'' +' +'abcd' +$'\'abcd\'' +' +1 diff --git a/tests/nquote.tests b/tests/nquote.tests new file mode 100644 index 0000000..aa0a9d8 --- /dev/null +++ b/tests/nquote.tests @@ -0,0 +1,119 @@ +expect() +{ + echo expect "$@" +} + +expect '<^J^J^J>' +recho $'\n\n\n' + +expect '<++^J++>' +f=$'\n' +recho "++$f++" +unset f + +z1=$'' +expect '<>' +recho "$z1" + +ZIFS=$'\n'$'\t'$' ' + +expect '<^J^I >' +recho "$ZIFS" + +expect '' +recho $'abc' + +expect '<^M^[^Gabc>' +recho $'\r\e\aabc' + +D=$"hello"," "$"world" + +expect ' ' +recho $D + +expect '' +recho "$D" + +D=$"" +expect '<>' +recho "$D" + +world=chet + +expect '<$hello, world>' +recho \$"hello, world" + +expect '' +recho $"hello, \$world" + +expect '' +recho $"hello, \"world\"" + +expect '' +recho $"hello"', $"world"' + +expect '' +recho $'hello, $"world"' + +expect '<$hello, chet>' +recho \$"hello, $world" + +expect '' +recho $"hello, $world" + +z=$'\v\f\a\b' +case "$z" in +$'\v\f\a\b') echo ok;; +*) echo bad;; +esac + +# Dave Korn says this should be allowed and echo 'abcd' +echo $'\'abcd\'' + +# printf translates \' to ' ... +printf "\'abcd\'\n" + +# but echo -e doesn't +echo -e "\'abcd\'" +echo -e "\\'abcd\\'" + +# and what do we do about unrecognized escape sequences? + +shopt -s xpg_echo + +recho $'A\CB' + +recho "A\CB" + +cde=c +recho $'ab$cde' + +printf "%b\n" 'A\CB' +printf 'A\CB\n' + +echo 'A\CB' + +world=chet + +recho $'hello, $"world"' +recho $'hello, \$"world"' +recho $'hello, $\"world"' + +recho "hello, $"world"" + +# ansi quoting inside double-quoted command subst - bash-3.1 bug +echo $(set -- $'a b'; echo $#) +echo "$(set -- $'a b'; echo $#)" + +echo "$(echo $';foo')" + +args () +{ + for a in "$@";do echo "'$a'";done +} +unset mytab +recho "${mytab:-$'\t'}" +recho "$( args $'A\tB' )" + +${THIS_SH} ./nquote1.sub +${THIS_SH} ./nquote2.sub diff --git a/tests/nquote1.right b/tests/nquote1.right new file mode 100644 index 0000000..26e16b9 --- /dev/null +++ b/tests/nquote1.right @@ -0,0 +1,121 @@ +argv[1] = +argv[2] = +argv[3] = <3> +argv[1] = <1> +argv[2] = +argv[3] = <3> +argv[1] = +argv[2] = +argv[3] = <3> +argv[1] = +argv[2] = +argv[3] = <3> +argv[1] = +argv[2] = +argv[3] = <3> +argv[1] = +argv[2] = +argv[3] = <3> +argv[1] = <1> +argv[2] = +argv[3] = <3> +argv[1] = +argv[2] = +argv[3] = <3> +argv[1] = +argv[2] = +argv[3] = <3> +argv[1] = +argv[2] = +argv[3] = <3> +argv[1] = +argv[2] = +argv[3] = <3> +argv[1] = <1> +argv[2] = +argv[3] = <3> +argv[1] = +argv[2] = +argv[3] = <3> +argv[1] = +argv[2] = +argv[3] = <3> +argv[1] = +argv[2] = +argv[3] = <3> +argv[1] = +argv[2] = +argv[3] = <3> +argv[1] = <1> +argv[2] = +argv[3] = <3> +argv[1] = +argv[2] = +argv[3] = <3> +argv[1] = +argv[2] = +argv[3] = <3> +argv[1] = +argv[2] = +argv[3] = <3> +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[1] = +argv[1] = +argv[1] = +^A +^A +^B +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = <^Aw> +argv[1] = +argv[2] = <^Aw> +argv[1] = <@1> +argv[2] = +argv[3] = +argv[1] = <@2> +argv[2] = +argv[3] = diff --git a/tests/nquote1.sub b/tests/nquote1.sub new file mode 100644 index 0000000..b3bc0db --- /dev/null +++ b/tests/nquote1.sub @@ -0,0 +1,6 @@ +set -o history +set -H + +echo $'hello\' world' +echo $'hello world!' +echo $'hello\' world!' diff --git a/tests/nquote1.tests b/tests/nquote1.tests new file mode 100644 index 0000000..0970e77 --- /dev/null +++ b/tests/nquote1.tests @@ -0,0 +1,97 @@ +a=$'a\001b' + +set $a + +b=$a +c=$1 +d="$1" + +e=$'uv\001\001wx' + +recho a $a ${#a} +recho 1 $1 ${#1} +recho b $b ${#b} +recho c $c ${#c} +recho d $d ${#d} + +recho a ${a} ${#a} +recho 1 ${1} ${#1} +recho b ${b} ${#b} +recho c ${c} ${#c} +recho d ${d} ${#d} + +recho a "$a" ${#a} +recho 1 "$1" ${#1} +recho b "$b" ${#b} +recho c "$c" ${#c} +recho d "$d" ${#d} + +recho a "${a}" ${#a} +recho 1 "${1}" ${#1} +recho b "${b}" ${#b} +recho c "${c}" ${#c} +recho d "${d}" ${#d} + +set $e + +recho e1 ${e:1:3} +recho e2 "${e:1:3}" +recho e3 ${1:1:3} +recho e4 "${1:1:3}" + +arr[0]=$e +arr[1]=$e + +recho a1 ${arr:0:4} +recho a2 "${arr:0:4}" + +recho a3 ${arr[@]:0:2} +recho a4 "${arr[@]:0:2}" + +set $e $e + +recho p1 ${@:1:2} +recho p2 "${@:1:2}" + +recho p1 ${*:1:2} +recho p2 "${*:1:2}" + +recho $e + +recho 'uvwx' + +f='uvwx' + +recho $f + +echo -en "\01" | cat -v +echo + +huhu() { echo "$1"; }; + +huhu $(echo -en "\01") | cat -v +huhu $(echo -en "\02") | cat -v + +f=$'uv\001w\001xy' + +set $f $f + +recho f1 ${f:1:3} +recho f2 "${f:1:3}" + +arr[0]=$f +arr[1]=$f + +recho a1 ${arr:0:4} +recho a2 "${arr:0:4}" +recho a3 ${arr[0]:0:4} +recho a4 "${arr[0]:0:4}" + +recho e1 ${f:0:4} +recho e2 "${f:0:4}" + +recho d1 ${1:2:2} +recho d2 "${1:2:2}" + +recho @1 ${@:1:2} +recho @2 "${@:1:2}" diff --git a/tests/nquote2.right b/tests/nquote2.right new file mode 100644 index 0000000..e7fb21e --- /dev/null +++ b/tests/nquote2.right @@ -0,0 +1,76 @@ +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = diff --git a/tests/nquote2.sub b/tests/nquote2.sub new file mode 100644 index 0000000..d3325f1 --- /dev/null +++ b/tests/nquote2.sub @@ -0,0 +1,29 @@ +t() { + printf '%s | %s\n' "$1" "$2" + } + v="'" # v <- ' + + #-- + t "${v/$'\''/$'\''}" "'" + t ${v/$'\''/$'\''} "'" + t "${v/$'\''/x}" "x" + t ${v/$'\''/x} "x" + t "${v/x/$'\''}" "'" + t ${v/x/$'\''} "'" + t "${v/x/$'\x5c\''}" "'" + t ${v/x/$'\x5c\''} "'" + t "${v/\'/\'}" "'" + t ${v/\'/\'} "'" + t ${v/\'/x} "x" + +echo "'" +echo "$'\''" + +echo $'\'' + +echo $'\'abcd\'' +echo "$'\'abcd\''" + +v=1 +echo ${v/1/\'} +echo ${v/\'/2} diff --git a/tests/nquote2.tests b/tests/nquote2.tests new file mode 100644 index 0000000..c07bd9b --- /dev/null +++ b/tests/nquote2.tests @@ -0,0 +1,82 @@ +a=$'a\001b' + +e=$'uv\001\001wx' + +recho $a +recho $e + +recho ${a/$'\001'/A} +recho "${a/$'\001'/A}" +recho ${e/$'\001'/A} +recho "${e/$'\001'/A}" + +recho ${a/b/B} +recho "${a/b/B}" +recho ${e/w/W} +recho "${e/w/W}" + +recho ${a//$'\001'/A} +recho "${a//$'\001'/A}" +recho ${e//$'\001'/A} +recho "${e//$'\001'/A}" + +recho ${a//b/B} +recho "${a//b/B}" +recho ${e//w/W} +recho "${e//w/W}" + +# pos params pat subst + +set $e $e + +recho ${@/$'\001'/A} +recho "${@/$'\001'/A}" +recho ${@/w/W} +recho "${@/w/W}" + +recho ${@//$'\001'/A} +recho "${@//$'\001'/A}" +recho ${@//w/W} +recho "${@//w/W}" + +arr[0]=$a +arr[1]=$e + +recho ${arr[0]} +recho ${arr[1]} + +recho ${arr[0]/$'\001'/A} +recho "${arr[0]/$'\001'/A}" +recho ${arr[1]/$'\001'/A} +recho "${arr[1]/$'\001'/A}" + +recho ${arr[0]/b/B} +recho "${arr[0]/b/B}" +recho ${arr[1]/w/W} +recho "${arr[1]/w/W}" + +recho ${arr[0]//$'\001'/A} +recho "${arr[0]//$'\001'/A}" +recho ${arr[1]//$'\001'/A} +recho "${arr[1]//$'\001'/A}" + +recho ${arr[0]//b/B} +recho "${arr[0]//b/B}" +recho ${arr[1]//w/W} +recho "${arr[1]//w/W}" + +recho ${arr[@]/$'\001'/A} +recho "${arr[@]/$'\001'/A}" + +recho ${arr[@]/b/B} +recho "${arr[@]/b/B}" +recho ${arr[@]/w/W} +recho "${arr[@]/w/W}" + +recho ${arr[@]//$'\001'/A} +recho "${arr[@]//$'\001'/A}" + +recho ${arr[@]//b/B} +recho "${arr[@]//b/B}" +recho ${arr[@]//w/W} +recho "${arr[@]//w/W}" diff --git a/tests/nquote3.right b/tests/nquote3.right new file mode 100644 index 0000000..d01eecc --- /dev/null +++ b/tests/nquote3.right @@ -0,0 +1,60 @@ +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = <^Ab> +argv[1] = <^Ab> +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = <^Awx> +argv[1] = <^Awx> +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = <^Awx> +argv[1] = <^Awx> +argv[1] = +argv[1] = +argv[1] = <^Awx> +argv[1] = <^Awx> +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = <^Awx> +argv[1] = <^Awx> +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = <^Awx> +argv[2] = +argv[1] = <^Awx> +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = +argv[1] = <^Awx> +argv[2] = +argv[1] = <^Awx> +argv[2] = +argv[1] = +argv[2] = +argv[1] = +argv[2] = diff --git a/tests/nquote3.tests b/tests/nquote3.tests new file mode 100644 index 0000000..a83ff56 --- /dev/null +++ b/tests/nquote3.tests @@ -0,0 +1,85 @@ +a=$'a\001b' + +set $a + +b=$a +c=$1 +d="$1" + +e=$'uv\001\001wx' +f=$'uv\001w\001xy' + +set $e $e + +recho ${e%%??} +recho "${e%%??}" + +recho ${e%%???} +recho "${e%%???}" + +recho ${a#?} +recho "${a#?}" + +# simple variables + +recho ${f##*$'\001'} +recho "${f##*$'\001'}" +recho ${f##*''} # literal ^A +recho "${f##*'^A'}" # two characters, `^' and `A' + +recho ${e%$'\001'*} +recho "${e%$'\001'*}" +recho ${e#*$'\001'} +recho "${e#*$'\001'}" + +# array members + +arr[0]=$e +arr[1]=$f + +recho ${arr[1]##*$'\001'} +recho "${arr[1]##*$'\001'}" +recho ${arr[1]##*''} # literal ^A +recho "${arr[1]##*'^A'}" # two characters, `^' and `A' + +recho ${arr[0]%$'\001'*} +recho "${arr[0]%$'\001'*}" +recho ${arr[0]#*$'\001'} +recho "${arr[0]#*$'\001'}" + +recho ${arr%$'\001'*} +recho "${arr%$'\001'*}" +recho ${arr#*$'\001'} +recho "${arr#*$'\001'}" + +# positional parameters + +set $e $f + +recho ${2##*$'\001'} +recho "${2##*$'\001'}" +recho ${2##*''} # literal ^A +recho "${2##*''}" # literal ^A +recho ${2##*'^A'} # two characters, `^' and `A' +recho "${2##*'^A'}" # two characters, `^' and `A' + +recho ${1%$'\001'*} +recho "${1%$'\001'*}" +recho ${1#*$'\001'} +recho "${1#*$'\001'}" + +recho ${@%$'\001'*} +recho "${@%$'\001'*}" +recho ${@#*$'\001'} +recho "${@#*$'\001'}" +recho ${@##*''} # literal ^A +recho "${@##*'^A'}" # two characters, `^' and `A' + +# arrays treated as a whole + +recho ${arr[@]%$'\001'*} +recho "${arr[@]%$'\001'*}" +recho ${arr[@]#*$'\001'} +recho "${arr[@]#*$'\001'}" +recho ${arr[@]##*''} # literal ^A +recho "${arr[@]##*'^A'}" # two characters, `^' and `A' diff --git a/tests/nquote4.right b/tests/nquote4.right new file mode 100644 index 0000000..1f7ae17 --- /dev/null +++ b/tests/nquote4.right @@ -0,0 +1,18 @@ +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = <¼X> +argv[1] = <«cX> +argv[1] = <> +argv[1] = <> +argv[1] = +argv[1] = +argv[1] = <> +argv[1] = <^Abcd> +argv[1] = <Þ> diff --git a/tests/nquote4.tests b/tests/nquote4.tests new file mode 100644 index 0000000..ed73467 --- /dev/null +++ b/tests/nquote4.tests @@ -0,0 +1,24 @@ +recho $'ab\x{}cd' +recho $'ab\x{41}cd' +recho $'ab\x41cd' + +recho $'ab\x{4}cd' +recho $'ab\x4cd' + +recho $'ab\x{cde' + +recho $'ab\x{cde' +recho $'ab\x{cd}e' +recho $'ab\x{c}de' + +recho $'\x{abcX' +recho $'\x{ab}cX' +recho $'\x{}X' +recho $'\x{X' +recho $'\x{01234567X' + +recho $'\x{41}b' +recho $'\x{}bc' +recho $'\x{1}bcd' + +recho $'\x{bde' diff --git a/tests/nquote5.right b/tests/nquote5.right new file mode 100644 index 0000000..a893329 --- /dev/null +++ b/tests/nquote5.right @@ -0,0 +1,86 @@ +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = <> +argv[2] = +argv[1] = +argv[2] = <--> +argv[3] = +argv[4] = <--> +argv[5] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = <--> +argv[3] = +argv[4] = <--> +argv[5] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = <--> +argv[3] = +argv[4] = <--> +argv[5] = +argv[6] = <--> +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[2] = <--> +argv[3] = +argv[4] = <--> +argv[5] = +argv[6] = <--> +argv[7] = <> +argv[1] = +argv[2] = <--> +argv[3] = +argv[4] = <--> +argv[5] = +argv[6] = <--> +argv[7] = <> diff --git a/tests/nquote5.tests b/tests/nquote5.tests new file mode 100644 index 0000000..85a2ff6 --- /dev/null +++ b/tests/nquote5.tests @@ -0,0 +1,63 @@ +a=$'ab\001cd\001ef' +IFS=$'\001' + +recho $a +recho ${a} +recho xx${a}yy +recho "$a" + +recho $(echo $a) +recho $(echo "$a") + +recho ${a%%??} +recho "${a%%??}" + +recho ${a/f/} +recho "${a/f/}" + +a1=("$a") +recho ${a1[0]} +recho ${a1} + +recho ${a:2:2} + +set -- $a +recho $1 -- $2 -- $3 + +set -- "$a" +recho $1 +recho ${1} + +echo "$a" | { IFS=$'\001' read x y z; recho $x -- $y -- $z ; } +unset x y z +b=$'uv\177wx\177yz' + +recho $b + +recho "ab${x}y${a}z" +recho ab${x}y${a}z + +recho "ab${b}y${a}z" +recho ab${b}y${a}z + +echo "ab${b}y${a}z" | { IFS=$'\001' read l m n o ; recho $l -- $m -- $n -- $o; } +unset l m n o + +a=$'ab\001cd\001ef' +b=$'uv\177wx\177yz' + +IFS=$'\177' + +recho $a +recho $b + +recho "ab${x}y${b}z" +recho ab${x}y${b}z + +recho "ab${b}y${a}z" +recho ab${b}y${a}z + +echo "ab${b}y${a}z" | { IFS=$'\001' read l m n o ; recho "$l" -- "$m" -- "$n" -- "$o"; } +unset l m n o +echo "ab${b}y${a}z" | { IFS=$'\177' read l m n o ; recho "$l" -- "$m" -- "$n" -- "$o"; } +unset l m n o diff --git a/tests/posix2.right b/tests/posix2.right new file mode 100644 index 0000000..df30c4f --- /dev/null +++ b/tests/posix2.right @@ -0,0 +1,2 @@ +Testing for POSIX.2 conformance +All tests passed diff --git a/tests/posix2.tests b/tests/posix2.tests new file mode 100644 index 0000000..d0fb46c --- /dev/null +++ b/tests/posix2.tests @@ -0,0 +1,179 @@ +#! /bin/sh +# posix-2.sh - Simple identification tests for POSIX.2 features +# commonly missing or incorrectly implemented. +# Time-stamp: <96/04/10 16:43:48 gildea> +# By Stephen Gildea March 1995 +# +# Copyright (c) 1995 Stephen Gildea +# Permission is hereby granted to deal in this Software without restriction. +# THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. +# +# MODIFIED BY chet@po.cwru.edu to make part of the bash test suite. +# last change: Wed Jun 19 12:24:24 EDT 1996 +# +# some of the tests: +# +# shell functions (do we care?) +# var=${var:-val} +# unset +# set -- +# IFS parsing +## not exiting with -e and failed "if", the way Ultrix does (Ultrix 4.2?) +# "$@" expands to zero arguments if passed zero arguments +# $SHELL -c 'echo $1' bad good +# test -x +# positional parameters greater than 9 +# arithmetic expansion $(( ... )) +# getopts + +# For some tests we must run a sub-shell; $TESTSHELL says what to use. +# If set, TESTSHELL must be an absolute pathname. +# For example, on HP-UX 9, /bin/posix/sh is the supposedly-compliant shell. +TESTSHELL=${THIS_SH:-$PWD/../bash} + +# these tests create temp files with names $TMPDIR/conf* +: ${TMPDIR:=/tmp} + +exitval=0 +numtests=0 + +echo "Testing for POSIX.2 conformance" + +newtest() +{ + numtests=$(($numtests + 1)) +} + +testfail() +{ + echo "$1 test failed" + exitval=$(($exitval + 1)) +} + +newtest +empty="" +test "${empty:-ok}" = ok || testfail "empty var colon" +newtest +test "${empty-bad}" = "" || testfail "got \"${empty-bad}\": empty var nocolon" +newtest +test "${unsetvar-ok}" = ok || testfail "unset var" +newtest +unset empty +test "${empty-ok}" = ok || testfail "unset" + +newtest +set -- -Z +test "x$1" = x-Z || testfail '\"set -- arg\"' +# this should empty the argument list +newtest +set -- +test $# = 0 || testfail "still $# args: \"set --\"" + +# IFS parsing: +newtest +names=one/good/three +saved_ifs="$IFS" +IFS=/ +set $names lose +test "$2" = good || testfail "got \"$2\": IFS parsing" +IFS="$saved_ifs" + +# "$@" with 0 arguments should expand to 0 arguments +newtest +cat > $TMPDIR/conftest1 << EOF +$TMPDIR/conftest2 "\$@" +EOF +cat > $TMPDIR/conftest2 << "EOF" +#! /bin/sh +echo $# +EOF +chmod +x $TMPDIR/conftest1 $TMPDIR/conftest2 +numargs=$($TESTSHELL $TMPDIR/conftest1) +if [ "$?" != 0 ]; then + testfail 'running $@' +else + test "$numargs" = 0 || testfail '"$@" got '"$numargs args: expansion w 0 args" +fi +rm -f $TMPDIR/conftest1 $TMPDIR/conftest2 + +newtest +val=$("$TESTSHELL" -c 'echo $1' csh good) +test "$val" = good || testfail "got \"$val\": sh -c" + +newtest +# do these tests in a sub-shell because failure will exit +val=$("$TESTSHELL" -c 'echo ${10}' 0 1 2 3 4 5 6 7 8 9 ten 11 2> /dev/null) +test "$val" = ten || testfail "accessing more than 9 positional params" + +a=abc_def_ghi +export a +newtest; val=`"$TESTSHELL" -c 'echo "${a%_*}"' 2> /dev/null` +test "$val" = abc_def || testfail "parameter % op" +newtest; val=`"$TESTSHELL" -c 'echo "${a%%_*}"' 2> /dev/null` +test "$val" = abc || testfail "parameter %% op" +newtest; val=`"$TESTSHELL" -c 'echo "${a#*_}"' 2> /dev/null` +test "$val" = def_ghi || testfail "parameter # op" +newtest; val=`"$TESTSHELL" -c 'echo "${a##*_}"' 2> /dev/null` +test "$val" = ghi || testfail "parameter ## op" + +newtest +"$TESTSHELL" -c 'export a=value' 2> /dev/null || testfail "export with value" + +newtest +a=5; test "$(( ($a+1)/2 ))" = 3 || testfail "arithmetic expansion" + +# does "test" support the -x switch? +newtest +touch $TMPDIR/conftest +chmod -x $TMPDIR/conftest +test -x $TMPDIR/conftest && testfail "negative test -x" +chmod +x $TMPDIR/conftest +test -x $TMPDIR/conftest || testfail "positive test -x" +rm -f $TMPDIR/conftest + +newtest +test "$OPTIND" = 1 || testfail "OPTIND initial value" + +newtest +getopts a: store -a aoptval +if [ "$OPTIND" != 3 ] || [ "$store" != a ] || [ "$OPTARG" != aoptval ]; then + testfail "getopts" +fi + +# if I change the default quoting style for variable values, these +# next four must change + +newtest +SQUOTE="'" +val1=$(set | sed -n 's:^SQUOTE=::p') +if [ "$val1" != "\'" ]; then + testfail "variable quoting 1" +fi + +newtest +VTILDE='~' +val1=$(set | sed -n 's:^VTILDE=::p') +if [ "$val1" != "'~'" ]; then + testfail "variable quoting 2" +fi + +newtest +VHASH=ab#cd +val1=$(set | sed -n 's:^VHASH=::p') +if [ "$val1" != "ab#cd" ]; then + testfail "variable quoting 3" +fi + +newtest +VHASH2=#abcd +val1=$(set | sed -n 's:^VHASH2=::p') +if [ "$val1" != "'#abcd'" ]; then + testfail "variable quoting 4" +fi + +if [ $exitval = 0 ]; then + echo "All tests passed" +else + echo "$exitval of $numtests tests failed" +fi +exit $exitval diff --git a/tests/posixexp.right b/tests/posixexp.right new file mode 100644 index 0000000..0ba6555 --- /dev/null +++ b/tests/posixexp.right @@ -0,0 +1,41 @@ +a +b +a b +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[1] = +argv[2] = +argv[3] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = <}> +argv[3] = +argv[1] = <'foo'> +argv[1] = <'foo'> +argv[1] = <$a> +argv[1] = <'foo'> +argv[1] = +argv[1] = +argv[1] = +argv[1] = +<.> <.> <> <.> <.> + <.> <.> <.> <.> + <.> <.> <.> <.> + <.> <.> <.> <.> +<.> <.> <> <.> <.> +<.> <.> <> <.> <.> + <.> <.> <.> <.> + <.> <.> <.> <.> + <.> <.> <.> <.> + <.> <.> <.> <.> +argv[1] = <'bar> +argv[1] = +argv[1] = <}z> +argv[1] = <''z}> +./posixexp.tests: line 77: unexpected EOF while looking for matching `}' +./posixexp.tests: line 78: syntax error: unexpected end of file diff --git a/tests/posixexp.tests b/tests/posixexp.tests new file mode 100644 index 0000000..60be1c7 --- /dev/null +++ b/tests/posixexp.tests @@ -0,0 +1,77 @@ +unset a +printf "%s\n" ${a:=a\ b} +echo "$a" + +unset v +recho ${v=a\ b} x ${v=c\ d} + +unset v +recho "${v=a\ b}" x "${v=c\ d}" + +unset a v + +recho "foo ${IFS+'bar'} baz" +recho "a ${IFS+b c} d" + +recho "a ${IFS+"b c"} d" + +u=x +recho "foo ${IFS+a$u{{{\}b} c ${IFS+d{}} bar" ${IFS-e{}} baz + +a=foo +recho "${IFS+'$a'}" +recho "${IFS+"'$a'"}" + +recho ${IFS+'$a'} +recho ${IFS+"'$a'"} + +unset a u +x='foo*bar' + +recho "${x##"}"}" +recho "${x##'}'}" +recho "${x##'}" + +recho "${x:-'}'}" + +foo="x'a'y" +recho "${foo%*'a'*}" +unset x + +unset u +v=w +printf '<%s> ' ${u+x} . ${v+x} . "${u+x}" . "${v+x}" .; echo +printf '<%s> ' ${u-x} . ${v-x} . "${u-x}" . "${v-x}" .; echo +printf '<%s> ' ${u=x} . ${v=x} . "${u=x}" . "${v=x}" .; echo +printf '<%s> ' ${u?x} . ${v?x} . "${u?x}" . "${v?x}" .; echo +printf '<%s> ' ${u#x} . ${v#x} . "${u#x}" . "${v#x}" .; echo +printf '<%s> ' ${u%x} . ${v%x} . "${u%x}" . "${v%x}" .; echo +printf '<%s> ' ${u:+x} . ${v:+x} . "${u:+x}" . "${v:+x}" .; echo +printf '<%s> ' ${u:-x} . ${v:-x} . "${u:-x}" . "${v:-x}" .; echo +printf '<%s> ' ${u:=x} . ${v:=x} . "${u:=x}" . "${v:=x}" .; echo +printf '<%s> ' ${u:?x} . ${v:?x} . "${u:?x}" . "${v:?x}" .; echo +# these are invalid substitution operators +#printf '<%s> ' ${u:#x} . ${v:#x} . "${u:#x}" . "${v:#x}" .; echo +#printf '<%s> ' ${u:%x} . ${v:%x} . "${u:%x}" . "${v:%x}" .; echo + +unset foo +set -o posix + +recho "${IFS+'bar}" +recho "foo ${IFS+'bar} baz" + +recho ${IFS+'}'z} +recho "${IFS+'}'z}" + +: ${TMPDIR:=/var/tmp} +rm -f $TMPDIR/sh +cp ${THIS_SH} $TMPDIR/sh +THIS_SH=$TMPDIR/sh ${THIS_SH} ./posixexp1.sub || echo "sh posixexp1.sub: test $? failed" +${THIS_SH} ./posixexp1.sub || echo "bash posixexp1.sub: test $? failed" + +THIS_SH=$TMPDIR/sh ${THIS_SH} ./posixexp2.sub || echo "sh posixexp2.sub: test $? failed" +rm -f $TMPDIR/sh + +# this will be an error +foo=bar +echo "${foo:-"a}" diff --git a/tests/posixexp1.sub b/tests/posixexp1.sub new file mode 100644 index 0000000..ce0b29d --- /dev/null +++ b/tests/posixexp1.sub @@ -0,0 +1,30 @@ +# $FreeBSD: src/tools/regression/bin/sh/expansion/set-u1.0,v 1.2 2010/10/12 18:20:38 obrien Exp $ + +${THIS_SH} -uc 'unset foo; echo ${foo}' 2>/dev/null && exit 1 +${THIS_SH} -uc 'unset foo; echo $foo' 2>/dev/null && exit 1 +${THIS_SH} -uc 'foo=; echo $foo' >/dev/null || exit 2 +${THIS_SH} -uc 'foo=1; echo $foo' >/dev/null || exit 3 +# -/+/= are unaffected by set -u +${THIS_SH} -uc 'unset foo; echo ${foo-}' >/dev/null || exit 4 +${THIS_SH} -uc 'unset foo; echo ${foo+}' >/dev/null || exit 5 +${THIS_SH} -uc 'unset foo; echo ${foo=}' >/dev/null || exit 6 +# length/trimming are affected +${THIS_SH} -uc 'unset foo; echo ${#foo}' 2>/dev/null && exit 7 +${THIS_SH} -uc 'foo=; echo ${#foo}' >/dev/null || exit 8 +${THIS_SH} -uc 'unset foo; echo ${foo#?}' 2>/dev/null && exit 9 +${THIS_SH} -uc 'foo=1; echo ${foo#?}' >/dev/null || exit 10 +${THIS_SH} -uc 'unset foo; echo ${foo##?}' 2>/dev/null && exit 11 +${THIS_SH} -uc 'foo=1; echo ${foo##?}' >/dev/null || exit 12 +${THIS_SH} -uc 'unset foo; echo ${foo%?}' 2>/dev/null && exit 13 +${THIS_SH} -uc 'foo=1; echo ${foo%?}' >/dev/null || exit 14 +${THIS_SH} -uc 'unset foo; echo ${foo%%?}' 2>/dev/null && exit 15 +${THIS_SH} -uc 'foo=1; echo ${foo%%?}' >/dev/null || exit 16 + +${THIS_SH} -uc 'echo $!' 2>/dev/null && exit 17 +${THIS_SH} -uc ':& echo $!' >/dev/null || exit 18 +${THIS_SH} -uc 'echo $#' >/dev/null || exit 19 +${THIS_SH} -uc 'echo $1' 2>/dev/null && exit 20 +${THIS_SH} -uc 'echo $1' ${THIS_SH} xnotthere >/dev/null || exit 21 +${THIS_SH} -uc 'echo $2' ${THIS_SH} xnotthere 2>/dev/null && exit 22 +${THIS_SH} -uc 'echo $2' ${THIS_SH} xnotthere ynotthere >/dev/null || exit 23 +exit 0 diff --git a/tests/posixexp2.right b/tests/posixexp2.right new file mode 100644 index 0000000..08d3901 --- /dev/null +++ b/tests/posixexp2.right @@ -0,0 +1,40 @@ +1 }z +2 ''z} +3 foo 'bar baz +4 foo b c baz +5 foo b c baz +6 }z +7 }z +8 ""z} +9 "}"z +10 foo bar} baz +11 ''z} +12 }z +13 }z +14 }z +15 <}> . +16 hi there +17 hi there +18 hi there +19 hi there +20 hi there +21 hi there +22 hi there +23 hi there +24 'value' +25 'value' +26 $key +27 'value' +28 'x ~ x''x}"x}" # +29 <{}b> <}> . +30 . +32 . +33 . +34 . +35 . +36 . +37 . +38 xay / x'a'y . +39 x' / x' . +40 < b c> . diff --git a/tests/posixexp2.sub b/tests/posixexp2.sub new file mode 100644 index 0000000..f48d088 --- /dev/null +++ b/tests/posixexp2.sub @@ -0,0 +1,21 @@ + +x=a\ b +[ "$x" = "${x?}" ] || exit 1 +set -- ${x?} +{ [ "$#" = 2 ] && [ "$1" = a ] && [ "$2" = b ]; } || exit 1 +unset x +(echo ${x?abcdefg}) 2>&1 | grep abcdefg >/dev/null || exit 1 +${THIS_SH} -c 'unset foo; echo ${foo?}' 2>/dev/null && exit 2 +${THIS_SH} -c 'foo=; echo ${foo:?}' 2>/dev/null && exit 3 +${THIS_SH} -c 'foo=; echo ${foo?}' >/dev/null || exit 4 +${THIS_SH} -c 'foo=1; echo ${foo:?}' >/dev/null || exit 5 +${THIS_SH} -c 'echo ${!?}' 2>/dev/null && exit 6 +${THIS_SH} -c ':& echo ${!?}' >/dev/null || exit 7 +${THIS_SH} -c 'echo ${#?}' >/dev/null || exit 8 +${THIS_SH} -c 'echo ${*?}' 2>/dev/null && exit 9 +${THIS_SH} -c 'echo ${*?}' ${THIS_SH} x >/dev/null || exit 10 +${THIS_SH} -c 'echo ${1?}' 2>/dev/null && exit 11 +${THIS_SH} -c 'echo ${1?}' ${THIS_SH} x >/dev/null || exit 12 +${THIS_SH} -c 'echo ${2?}' ${THIS_SH} x 2>/dev/null && exit 13 +${THIS_SH} -c 'echo ${2?}' ${THIS_SH} x y >/dev/null || exit 14 +exit 0 diff --git a/tests/posixexp2.tests b/tests/posixexp2.tests new file mode 100644 index 0000000..57dd767 --- /dev/null +++ b/tests/posixexp2.tests @@ -0,0 +1,47 @@ +# From mksh + +set -o posix + +(echo 1 ${IFS+'}'z}) 2>&- || echo failed in 1 +(echo 2 "${IFS+'}'z}") 2>&- || echo failed in 2 +(echo 3 "foo ${IFS+'bar} baz") 2>&- || echo failed in 3 +(echo -n '4 '; printf '%s\n' "foo ${IFS+"b c"} baz") 2>&- || echo failed in 4 +(echo -n '5 '; printf '%s\n' "foo ${IFS+b c} baz") 2>&- || echo failed in 5 +(echo 6 ${IFS+"}"z}) 2>&- || echo failed in 6 +(echo 7 "${IFS+"}"z}") 2>&- || echo failed in 7 +(echo 8 "${IFS+\"}\"z}") 2>&- || echo failed in 8 +(echo 9 "${IFS+\"\}\"z}") 2>&- || echo failed in 9 +(echo 10 foo ${IFS+'bar} baz'}) 2>&- || echo failed in 10 +(echo 11 "$(echo "${IFS+'}'z}")") 2>&- || echo failed in 11 +(echo 12 "$(echo ${IFS+'}'z})") 2>&- || echo failed in 12 +(echo 13 ${IFS+\}z}) 2>&- || echo failed in 13 +(echo 14 "${IFS+\}z}") 2>&- || echo failed in 14 +u=x; (echo -n '15 '; printf '<%s> ' "foo ${IFS+a"b$u{ {"{{\}b} c ${IFS+d{}} bar" ${IFS-e{}} baz; echo .) 2>&- || echo failed in 15 +l=t; (echo 16 ${IFS+h`echo -n i ${IFS+$l}h`ere}) 2>&- || echo failed in 16 +l=t; (echo 17 ${IFS+h$(echo -n i ${IFS+$l}h)ere}) 2>&- || echo failed in 17 +l=t; (echo 18 "${IFS+h`echo -n i ${IFS+$l}h`ere}") 2>&- || echo failed in 18 +l=t; (echo 19 "${IFS+h$(echo -n i ${IFS+$l}h)ere}") 2>&- || echo failed in 19 +l=t; (echo 20 ${IFS+h`echo -n i "${IFS+$l}"h`ere}) 2>&- || echo failed in 20 +l=t; (echo 21 ${IFS+h$(echo -n i "${IFS+$l}"h)ere}) 2>&- || echo failed in 21 +l=t; (echo 22 "${IFS+h`echo -n i "${IFS+$l}"h`ere}") 2>&- || echo failed in 22 +l=t; (echo 23 "${IFS+h$(echo -n i "${IFS+$l}"h)ere}") 2>&- || echo failed in 23 +key=value; (echo -n '24 '; printf '%s\n' "${IFS+'$key'}") 2>&- || echo failed in 24 +key=value; (echo -n '25 '; printf '%s\n' "${IFS+"'$key'"}") 2>&- || echo failed in 25 # ksh93: “'$key'” +key=value; (echo -n '26 '; printf '%s\n' ${IFS+'$key'}) 2>&- || echo failed in 26 +key=value; (echo -n '27 '; printf '%s\n' ${IFS+"'$key'"}) 2>&- || echo failed in 27 +(echo -n '28 '; printf '%s\n' "${IFS+"'"x ~ x'}'x"'}"x}" #') 2>&- || echo failed in 28 +u=x; (echo -n '29 '; printf '<%s> ' foo ${IFS+a"b$u{ {"{ {\}b} c ${IFS+d{}} bar ${IFS-e{}} baz; echo .) 2>&- || echo failed in 29 +(echo -n '30 '; printf '<%s> ' ${IFS+foo 'b\ +ar' baz}; echo .) 2>&- || (echo failed in 30; echo failed in 31) +(echo -n '32 '; printf '<%s> ' ${IFS+foo "b\ +ar" baz}; echo .) 2>&- || echo failed in 32 +(echo -n '33 '; printf '<%s> ' "${IFS+foo 'b\ +ar' baz}"; echo .) 2>&- || echo failed in 33 +(echo -n '34 '; printf '<%s> ' "${IFS+foo "b\ +ar" baz}"; echo .) 2>&- || echo failed in 34 +(echo -n '35 '; printf '<%s> ' ${v=a\ b} x ${v=c\ d}; echo .) 2>&- || echo failed in 35 +(echo -n '36 '; printf '<%s> ' "${v=a\ b}" x "${v=c\ d}"; echo .) 2>&- || echo failed in 36 +(echo -n '37 '; printf '<%s> ' ${v-a\ b} x ${v-c\ d}; echo .) 2>&- || echo failed in 37 +(echo 38 ${IFS+x'a'y} / "${IFS+x'a'y}" .) 2>&- || echo failed in 38 +foo="x'a'y"; (echo 39 ${foo%*'a'*} / "${foo%*'a'*}" .) 2>&- || echo failed in 39 +foo="a b c"; (echo -n '40 '; printf '<%s> ' "${foo#a}"; echo .) 2>&- || echo failed in 40 diff --git a/tests/posixpat.right b/tests/posixpat.right new file mode 100644 index 0000000..deb01bf --- /dev/null +++ b/tests/posixpat.right @@ -0,0 +1,42 @@ +ok 1 +ok 2 +ok 3 +ok 4 +ok 5 +ok 6 +ok 7 +ok 8 +ok 9 +ok 10 +ok 11 +ok 12 +ok 13 +ok 14 +ok 15 +ok 16 +ok 17 +ok 18 +ok 19 +ok 20 +ok 21 +ok -- space +ok -- blank +ok 1 +ok 2 +ok 3 +ok 4 +ok 5 +ok 6 +ok 7 +ok 8 +ok 9 +ok 10 +ok 11 +ok 12 +ok 13 +ok 14 +ok 15 +ok 16 +ok 1 +ok 2 +ok 3 diff --git a/tests/posixpat.tests b/tests/posixpat.tests new file mode 100644 index 0000000..91fac3b --- /dev/null +++ b/tests/posixpat.tests @@ -0,0 +1,233 @@ +# A test suite for the POSIX.2 (BRE) pattern matching code +LC_ALL=C +LANG=C + +# First, test POSIX.2 character classes + +case e in +[[:xdigit:]]) echo ok 1;; +esac + +case a in +[[:alpha:]123]) echo ok 2;; +esac + +case 1 in +[[:alpha:]123]) echo ok 3;; +esac + +case 9 in +[![:alpha:]]) echo ok 4;; +esac + +# invalid character class expressions are just characters to be matched +case a in +[:al:]) echo ok 5;; +esac + +case a in +[[:al:]) echo ok 6;; +esac + +case '!' in +[abc[:punct:][0-9]) echo ok 7;; +esac + +# let's try to match the start of a valid sh identifier +case 'PATH' in +[_[:alpha:]]*) echo ok 8;; +esac + +# let's try to match the first two characters of a valid sh identifier +case PATH in +[_[:alpha:]][_[:alnum:]]*) echo ok 9;; +esac + +# is ^C a cntrl character? +case $'\003' in +[[:cntrl:]]) echo ok 10;; +esac + +# how about A? +case A in +[[:cntrl:]]) echo oops -- cntrl ;; +*) echo ok 11;; +esac + +case 9 in +[[:digit:]]) echo ok 12;; +esac + +case X in +[[:digit:]]) echo oops -- digit;; +*) echo ok 13;; +esac + +case $'\033' in +[[:graph:]]) echo oops -- graph;; +*) echo ok 14;; +esac + +case $'\040' in +[[:graph:]]) echo oops -- graph 2;; +*) echo ok 15;; +esac + +case ' ' in +[[:graph:]]) echo oops -- graph 3;; +*) echo ok 16;; +esac + +case 'aB' in +[[:lower:]][[:upper:]]) echo ok 17;; +esac + +case $'\040' in +[[:print:]]) echo ok 18;; +*) echo oops -- print;; +esac + +case PS3 in +[_[:alpha:]][_[:alnum:]][_[:alnum:]]*) echo ok 19;; +esac + +case a in +[[:alpha:][:digit:]]) echo ok 20;; +*) echo oops - skip brackpat ;; +esac + +case a in +[[:alpha:]\]) echo oops -- dangling backslash in brackpat ;; +*) echo ok 21 ;; +esac + +# what's a newline? is it a blank? a space? +case $'\n' in +[[:blank:]]) echo ok -- blank ;; +[[:space:]]) echo ok -- space ;; +*) echo oops newline ;; +esac + +# OK, what's a tab? is it a blank? a space? +case $'\t' in +[[:blank:]]) echo ok -- blank ;; +[[:space:]]) echo ok -- space ;; +*) echo oops newline ;; +esac + +# let's check out characters in the ASCII range +case $'\377' in +[[:ascii:]]) echo oops -- ascii\?;; +esac + +case 9 in +[1[:alpha:]123]) echo oops 1;; +esac + +# however, an unterminated brace expression containing a valid char class +# that matches had better fail +case a in +[[:alpha:]) echo oops 2;; +esac + +case $'\b' in +[[:graph:]]) echo oops 3;; +esac + +case $'\b' in +[[:print:]]) echo oops 4;; +esac + +case $' ' in +[[:punct:]]) echo oops 5;; +esac + +# Next, test POSIX.2 collating symbols + +case 'a' in +[[.a.]]) echo ok 1;; +esac + +case '-' in +[[.hyphen.]-9]) echo ok 2;; +esac + +case 'p' in +[[.a.]-[.z.]]) echo ok 3;; +esac + +case '-' in +[[.-.]]) echo ok 4;; +esac + +case ' ' in +[[.space.]]) echo ok 5;; +esac + +case ' ' in +[[.grave-accent.]]) echo oops - grave;; +*) echo ok 6;; +esac + +case '4' in +[[.-.]-9]) echo ok 7;; +esac + +# an invalid collating symbol cannot be the first part of a range +case 'c' in +[[.yyz.]-[.z.]]) echo oops - yyz;; +*) echo ok 8;; +esac + +case 'c' in +[[.yyz.][.a.]-z]) echo ok 9;; +esac + +# but when not part of a range is not an error +case 'c' in +[[.yyz.][.a.]-[.z.]]) echo ok 10 ;; +esac + +case 'p' in +[[.a.]-[.Z.]]) echo oops -- bad range ;; +*) echo ok 11;; +esac + +case p in +[[.a.]-[.zz.]p]) echo ok 12;; +*) echo oops -- bad range 2;; +esac + +case p in +[[.aa.]-[.z.]p]) echo ok 13;; +*) echo oops -- bad range 3;; +esac + +case c in +[[.yyz.]cde]) echo ok 14;; +esac + +case abc in +[[.cb.]a-Za]*) echo ok 15;; +esac + +case $'\t' in +[[.space.][.tab.][.newline.]]) echo ok 16;; +esac + +# and finally, test POSIX.2 equivalence classes + +case "abc" in +[[:alpha:]][[=b=]][[:ascii:]]) echo ok 1;; +esac + +case "abc" in +[[:alpha:]][[=B=]][[:ascii:]]) echo oops -- =B=;; +*) echo ok 2 ;; +esac + +case a in +[[=b=]) echo oops;; # an incomplete equiv class is just a string +*) echo ok 3;; +esac + diff --git a/tests/posixpipe.right b/tests/posixpipe.right new file mode 100644 index 0000000..8f6c9cb --- /dev/null +++ b/tests/posixpipe.right @@ -0,0 +1,41 @@ +1 +0 +a +real 0.00 +user 0.00 +sys 0.00 +1 +a +real 0.00 +user 0.00 +sys 0.00 +1 +tfunc is a function +tfunc () +{ + time +} +1 +0 +1 +a +real 0.00 +user 0.00 +sys 0.00 +0 +a +real 0.00 +user 0.00 +sys 0.00 +0 +a +real 0.00 +user 0.00 +sys 0.00 +0 +1 +0 +a +real 0.00 +user 0.00 +sys 0.00 diff --git a/tests/posixpipe.tests b/tests/posixpipe.tests new file mode 100644 index 0000000..a2f047a --- /dev/null +++ b/tests/posixpipe.tests @@ -0,0 +1,43 @@ +# Test timed and negated pipelines in bash-4.2 and later +export TIMEFORMAT=$'real %2R\nuser %2U\nsys %2S' + +! +echo $? + +! ! +echo $? + +time ! echo a +echo $? + +! time echo a +echo $? + +tfunc() +{ + time +} + +type tfunc + +! true +echo $? +! ! true +echo $? +! ! ! true +echo $? + +time time echo a +echo $? + +time time -p echo a +echo $? +time -p time echo a +echo $? + +! +echo $? +! ! +echo $? + +time -p -- echo a diff --git a/tests/prec.right b/tests/prec.right new file mode 100644 index 0000000..e6af552 --- /dev/null +++ b/tests/prec.right @@ -0,0 +1,28 @@ +`Say' echos its argument. Its return value is of no interest. +`Truth' echos its argument and returns a TRUE result. +`False' echos its argument and returns a FALSE result. + + Truth 1 && Truth 2 || Say 3 output=12 +( Truth 1 && Truth 2 ) || Say 3 output=12 + + Truth 1 && False 2 || Say 3 output=123 +( Truth 1 && False 2 ) || Say 3 output=123 + + False 1 && Truth 2 || Say 3 output=13 +( False 1 && Truth 2 ) || Say 3 output=13 + + False 1 && False 2 || Say 3 output=13 +( False 1 && False 2 ) || Say 3 output=13 + +Truth 1 || Truth 2 && Say 3 output=13 +Truth 1 || ( Truth 2 && Say 3 ) output=1 + +Truth 1 || False 2 && Say 3 output=13 +Truth 1 || ( False 2 && Say 3 ) output=1 + +False 1 || Truth 2 && Say 3 output=123 +False 1 || ( Truth 2 && Say 3 ) output=123 + +False 1 || False 2 && Say 3 output=12 +False 1 || ( False 2 && Say 3 ) output=12 + diff --git a/tests/precedence b/tests/precedence new file mode 100755 index 0000000..9bbdb97 --- /dev/null +++ b/tests/precedence @@ -0,0 +1,75 @@ +# @(#)precedence_test 1.0 91/07/24 Maarten Litmaath +# test of relative precedences for `&&' and `||' operators + +echo "\`Say' echos its argument. Its return value is of no interest." +case `echo -n` in + '') Say () { echo -n "$*" ; } ;; + *) Say () { echo "$*\c" ; } ;; +esac + +echo "\`Truth' echos its argument and returns a TRUE result." +Truth () { + Say $1; + return 0; +} + +echo "\`False' echos its argument and returns a FALSE result." +False () { + Say $1; + return 1; +} + +echo "" + +cmd1='$open $test1 && $test2 $close || $test3' +cmd2='$test1 || $open $test2 && $test3 $close' + +grouping_sh= +grouping_C='( )' + +test3='Say 3' + +for i in 1 2 +do + eval proto=\$cmd$i + + for test1 in 'Truth 1' 'False 1' + do + for test2 in 'Truth 2' 'False 2' + do + for precedence in sh C + do + eval set x \$grouping_$precedence + shift + open=${1-' '} + close=${2-' '} + eval cmd=\""$proto"\" + Say "$cmd output=" + output=`eval "$cmd"` + Say "$output" + read correct || { echo 'Input fubar. Abort.' >&2; exit 1; } + test "X$output" = "X$correct" || echo " correct=$correct" + echo '' + done + + echo '' + done + done +done << EOF +12 +12 +123 +123 +13 +13 +13 +13 +13 +1 +13 +1 +123 +123 +12 +12 +EOF diff --git a/tests/printf.right b/tests/printf.right new file mode 100644 index 0000000..ae34a89 --- /dev/null +++ b/tests/printf.right @@ -0,0 +1,297 @@ +printf: usage: printf [-v var] format [arguments] +printf: usage: printf [-v var] format [arguments] +10 + one +one\ctwo +4\.2 +no newline now newline +% +% +%d +A +unquoted +unquoted quoted +unquoted quoted +this\&that +1 2 3 4 5 +onestring 0 0 0 +onestring 0 0 0.00 +--4.2 -- +--4.2 -- +-- +^@81-- +-- A-- +-- A-- +A7 +A7 +A7 +A7 +A7 +--\"abcd\"-- +--\'abcd\'-- +--a\x-- +./printf.tests: line 82: printf: missing hex digit for \x +--\x-- +---- +---- +--4.2 +--4\.2-- +--\-- + + + 4.4BSD + 4.4BSD + 4.4BSD + 4.4BSD +4.4BSD +4.4BSD + 4.4BSD +--4.4BSD -- + 4. +4.4 +--4.4BSD -- +255 255 255 0377 0xff 0xFF +255 255 255 0377 0xff 0XFF +255 255 255 0377 0xff 0xFF +255 255 255 0377 0xff 0XFF + 42 + -42 + 42 + -42 +4.20 +4.20 + 4.2 +4.20 +4.20 + 4.2 +4.200000E+00 +4.200000e+00 +4.2E+00 +4.2e+00 +4.2 +4.2 + 4.2 + 4.2 +115 +115 +0163 +0163 +0x73 +0X73 +115.00 +115.00 +-- abcd-- +-- abcd-- +-- abcdefghij-- +-- abcdefghij-- +'abcd' +\'abcd\' +\abcd\ +\abcd\ +26 +26 +26 +./printf.tests: line 206: printf: `%10': missing format character +./printf.tests: line 207: printf: `M': invalid format character +ab./printf.tests: line 210: printf: `y': invalid format character +./printf.tests: line 213: printf: GNU: invalid number +0 +./printf.tests: line 214: printf: GNU: invalid number +0 +- +(foo )(bar ) +0 + ab cd ef +13 +^G +^G +^@7 +^Ge +"? +00001 +00001 + 1 +1 +0 +0 + 0 + 0 +4 +4 + 4 + 4 +0.000000 +0.000000 +0.00 +0.00 +4.000000 +4.000000 +4.00 +4.00 +0.000000E+00 +0.000000e+00 +0.00E+00 +0.00e+00 +4.000000E+00 +4.000000e+00 +4.00E+00 +4.00e+00 +9B3A59A5 +q +'' +'' +s + + +b + + +xx +xx + one +one\ctwo +4\.2 +no newline now newline +% +% +%d +A +unquoted +unquoted quoted +unquoted quoted +this\&that +1 2 3 4 5 +onestring 0 0 0 +onestring 0 0 0.00 +--4.2 -- +--4.2 -- +-- A-- +-- A-- +A7 +A7 +A7 +--\"abcd\"-- +--\'abcd\'-- +--a\x-- +./printf1.sub: line 94: printf: missing hex digit for \x +--\x-- +---- +---- +--4.2 +--4\.2-- +--\-- + + + 4.4BSD + 4.4BSD + 4.4BSD + 4.4BSD +4.4BSD +4.4BSD + 4.4BSD +--4.4BSD -- + 4. +4.4 +--4.4BSD -- +255 255 255 0377 0xff 0xFF +255 255 255 0377 0xff 0XFF +255 255 255 0377 0xff 0xFF +255 255 255 0377 0xff 0XFF + 42 + -42 + 42 + -42 +4.20 +4.20 + 4.2 +4.20 +4.20 + 4.2 +4.200000E+00 +4.200000e+00 +4.2E+00 +4.2e+00 +4.2 +4.2 + 4.2 + 4.2 +115 +115 +0163 +0163 +0x73 +0X73 +115.00 +115.00 +-- abcd-- +-- abcd-- +-- abcdefghij-- +-- abcdefghij-- +'abcd' +\'abcd\' +\abcd\ +\abcd\ +26 +26 +26 +./printf1.sub: line 280: printf: `%10': missing format character +./printf1.sub: line 281: printf: `M': invalid format character +./printf1.sub: line 284: printf: `y': invalid format character +./printf1.sub: line 287: printf: GNU: invalid number +0 +./printf1.sub: line 289: printf: GNU: invalid number +0 +- +(foo )(bar ) +0 + ab cd ef +13 +^G +^G +^Ge +"? +16:09:15 +./printf3.sub: line 14: printf: warning: `Z': invalid time format specification +%(abde)Z +30-May-2010 16:09:15 +05/30/10 15:09:15 +current time: 2010-05-30 04:09:15 PM +epoch time: 1969-12-31 07:00:00 PM -0500 +random time: 2010-05-30 04:09:15 PM -0400 +local time: Sun May 30 16:09:15 EDT 2010 +Sun May 30 16:09:15 EDT 2010 date-style time +05/30/10 (foo) 16:09:15 date-style time +x 123x +x 123x +x 123x +x 123x +x 123x +x 123x +x 123.00x +x 123.00x +x 123.00x +x 123.00x +x123 x +x123 x +x+00001e+02x +x+00001e+02x +x+000000123x +x+000000123x +x+00001e+02x +x+00001e+02x +x +123x +x +123x +x +123x +x +123x +x 7bx +x 7bx +x+123 x +x+123 x +x+123 x +x+123 x +-123.000000 +-123.000000 +x +123x +x +123x +x +123x +x +123x diff --git a/tests/printf.tests b/tests/printf.tests new file mode 100644 index 0000000..e72f5c8 --- /dev/null +++ b/tests/printf.tests @@ -0,0 +1,319 @@ +LC_ALL=C +LC_NUMERIC=C + +# these should output error messages -- the format is required +printf +printf -- + +# these should output nothing +printf "" +printf -- "" + +# in the future this may mean to put the output into VAR, but for +# now it is an error +# 2005-03-15 no longer an error +unset var +printf -v var "%10d" $RANDOM +echo ${#var} + +# this should expand escape sequences in the format string, nothing else +printf "\tone\n" + +# this should not cut off output after the \c +printf "one\ctwo\n" + +# and unrecognized backslash escapes should have the backslash preserverd +printf "4\.2\n" + +printf "no newline " ; printf "now newline\n" + +# %% -> % +printf "%%\n" + +# this was a bug caused by pre-processing the string for backslash escapes +# before doing the `%' format processing -- all versions before bash-2.04 +printf "\045" ; echo +printf "\045d\n" + +# simple character output +printf "%c\n" ABCD + +# test simple string output +printf "%s\n" unquoted + +# test quoted string output +printf "%s %q\n" unquoted quoted +printf "%s%10q\n" unquoted quoted + +printf "%q\n" 'this&that' + +# make sure the format string is reused to use up arguments +printf "%d " 1 2 3 4 5; printf "\n" + +# make sure that extra format characters get null arguments +printf "%s %d %d %d\n" onestring + +printf "%s %d %u %4.2f\n" onestring + +printf -- "--%s %s--\n" 4.2 '' +printf -- "--%s %s--\n" 4.2 + +# test %b escapes + +# 8 is a non-octal digit, so the `81' should be output +printf -- "--%b--\n" '\n\081' + +printf -- "--%b--\n" '\t\0101' +printf -- "--%b--\n" '\t\101' + +# these should all display `A7' +echo -e "\01017" +echo -e "\x417" + +printf "%b\n" '\01017' +printf "%b\n" '\1017' +printf "%b\n" '\x417' + +printf -- "--%b--\n" '\"abcd\"' +printf -- "--%b--\n" "\'abcd\'" + +printf -- "--%b--\n" 'a\\x' + +printf -- "--%b--\n" '\x' + +Z1=$(printf -- "%b\n" '\a\b\e\f\r\v') +Z2=$'\a\b\e\f\r\v' + +if [ "$Z1" != "$Z2" ]; then + echo "whoops: printf %b and $'' differ" >&2 +fi +unset Z1 Z2 + +printf -- "--%b--\n" '' +printf -- "--%b--\n" + +# the stuff following the \c should be ignored, as well as the rest +# of the format string +printf -- "--%b--\n" '4.2\c5.4\n'; printf "\n" + +# unrecognized escape sequences should by displayed unchanged +printf -- "--%b--\n" '4\.2' + +# a bare \ should not be processed as an escape sequence +printf -- "--%b--\n" '\' + +# make sure extra arguments are ignored if the format string doesn't +# actually use them +printf "\n" 4.4 BSD +printf " " 4.4 BSD ; printf "\n" + +# make sure that a fieldwidth and precision of `*' are handled right +printf "%10.8s\n" 4.4BSD +printf "%*.*s\n" 10 8 4.4BSD + +printf "%10.8q\n" 4.4BSD +printf "%*.*q\n" 10 8 4.4BSD + +printf "%6b\n" 4.4BSD +printf "%*b\n" 6 4.4BSD + +# we handle this crap with homemade code in printf.def +printf "%10b\n" 4.4BSD +printf -- "--%-10b--\n" 4.4BSD +printf "%4.2b\n" 4.4BSD +printf "%.3b\n" 4.4BSD +printf -- "--%-8b--\n" 4.4BSD + +# test numeric conversions -- these four lines should echo identically +printf "%d %u %i 0%o 0x%x 0x%X\n" 255 255 255 255 255 255 +printf "%d %u %i %#o %#x %#X\n" 255 255 255 255 255 255 + +printf "%ld %lu %li 0%o 0x%x 0x%X\n" 255 255 255 255 255 255 +printf "%ld %lu %li %#o %#x %#X\n" 255 255 255 255 255 255 + +printf "%10d\n" 42 +printf "%10d\n" -42 + +printf "%*d\n" 10 42 +printf "%*d\n" 10 -42 + +# test some simple floating point formats +printf "%4.2f\n" 4.2 +printf "%#4.2f\n" 4.2 +printf "%#4.1f\n" 4.2 + +printf "%*.*f\n" 4 2 4.2 +printf "%#*.*f\n" 4 2 4.2 +printf "%#*.*f\n" 4 1 4.2 + +printf "%E\n" 4.2 +printf "%e\n" 4.2 +printf "%6.1E\n" 4.2 +printf "%6.1e\n" 4.2 + +printf "%G\n" 4.2 +printf "%g\n" 4.2 +printf "%6.2G\n" 4.2 +printf "%6.2g\n" 4.2 + +# test some of the more esoteric features of POSIX.1 printf +printf "%d\n" "'string'" +printf "%d\n" '"string"' + +printf "%#o\n" "'string'" +printf "%#o\n" '"string"' + +printf "%#x\n" "'string'" +printf "%#X\n" '"string"' + +printf "%6.2f\n" "'string'" +printf "%6.2f\n" '"string"' + +# output from these two lines had better be the same +printf -- "--%6.4s--\n" abcdefghijklmnopqrstuvwxyz +printf -- "--%6.4b--\n" abcdefghijklmnopqrstuvwxyz + +# and these two also +printf -- "--%12.10s--\n" abcdefghijklmnopqrstuvwxyz +printf -- "--%12.10b--\n" abcdefghijklmnopqrstuvwxyz + +# tests for translating \' to ' and \\ to \ +# printf translates \' to ' in the format string... +printf "\'abcd\'\n" + +# but not when the %b format specification is used +printf "%b\n" \\\'abcd\\\' + +# but both translate \\ to \ +printf '\\abcd\\\n' +printf "%b\n" '\\abcd\\' + +# this was reported as a bug in bash-2.03 +# these three lines should all echo `26' +printf "%d\n" 0x1a +printf "%d\n" 032 +printf "%d\n" 26 + +# error messages + +# this should be an overflow, but error messages vary between systems +# printf "%lu\n" 4294967296 + +# ...but we cannot use this because some systems (SunOS4, for example), +# happily ignore overflow conditions in strtol(3) +#printf "%ld\n" 4294967296 + +printf "%10" +printf "ab%Mcd\n" + +# this caused an infinite loop in older versions of printf +printf "%y" 0 + +# these should print a warning and `0', according to POSIX.2 +printf "%d\n" GNU +printf "%o\n" GNU + +# failures in all bash versions through bash-2.05 +printf "%.0s" foo +printf "%.*s" 0 foo + +printf '%.0b-%.0s\n' foo bar +printf '(%*b)(%*s)\n' -4 foo -4 bar + +format='%'`printf '%0100384d' 0`'d\n' +printf $format 0 + +# failures in all bash versions through bash-3.0 - undercounted characters +unset vv +printf " %s %s %s \n%n" ab cd ef vv +echo "$vv" + +# this doesn't work with printf(3) on all systems +#printf "%'s\n" foo + +# test cases from an austin-group list discussion +# prints ^G as an extension +printf '%b\n' '\7' + +# prints ^G +printf '%b\n' '\0007' + +# prints NUL then 7 +printf '\0007\n' + +# prints no more than two hex digits +printf '\x07e\n' + +# additional backslash escapes +printf '\"\?\n' + +# failures with decimal precisions until after bash-3.1 +printf '%0.5d\n' 1 + +printf '%05d\n' 1 +printf '%5d\n' 1 +printf '%0d\n' 1 + +# failures with various floating point formats and 0 after bash-3.2 + +printf "%G\n" 0 +printf "%g\n" 0 +printf "%4.2G\n" 0 +printf "%4.2g\n" 0 + +printf "%G\n" 4 +printf "%g\n" 4 +printf "%4.2G\n" 4 +printf "%4.2g\n" 4 + +printf "%F\n" 0 +printf "%f\n" 0 +printf "%4.2F\n" 0 +printf "%4.2f\n" 0 + +printf "%F\n" 4 +printf "%f\n" 4 +printf "%4.2F\n" 4 +printf "%4.2f\n" 4 + +printf "%E\n" 0 +printf "%e\n" 0 +printf "%4.2E\n" 0 +printf "%4.2e\n" 0 + +printf "%E\n" 4 +printf "%e\n" 4 +printf "%4.2E\n" 4 +printf "%4.2e\n" 4 + +printf "%08X\n" 2604292517 + +# make sure these format specifiers all output '' for empty string arguments +echo q +printf "%q\n" "" +printf "%q\n" + +echo s +printf "%s\n" '' +printf "%s\n" + +echo b +printf "%b\n" '' +printf "%b\n" + +# bug in bash versions up to and including bash-3.2 +v=yyy +printf -v var "%s" '/current/working/directory/*.@(m3|i3|ig|mg)' +shopt -s nullglob extglob +echo "x$(printf "%b" @(hugo))x" +printf -v var "%b" @(hugo); echo "x${var}x" + +# tests variable assignment with -v +${THIS_SH} ./printf1.sub + +${THIS_SH} ./printf2.sub + +${THIS_SH} ./printf3.sub + +${THIS_SH} ./printf4.sub + diff --git a/tests/printf1.sub b/tests/printf1.sub new file mode 100644 index 0000000..52612d5 --- /dev/null +++ b/tests/printf1.sub @@ -0,0 +1,335 @@ +LC_ALL=C +LC_NUMERIC=C + +unset vv + +# this should expand escape sequences in the format string, nothing else +printf -v vv "\tone\n" +printf "%s" "$vv" + +# this should not cut off output after the \c +printf -v vv "one\ctwo\n" +printf "%s" "$vv" + +# and unrecognized backslash escapes should have the backslash preserverd +printf -v vv "4\.2\n" +printf "%s" "$vv" + +printf -v vv "no newline " ; printf "%s" "$vv" ; printf -v vv "now newline\n" +printf "%s" "$vv" + +# %% -> % +printf -v vv "%%\n" +printf "%s" "$vv" + +# this was a bug caused by pre-processing the string for backslash escapes +# before doing the `%' format processing -- all versions before bash-2.04 +printf -v vv "\045" +printf "%s" "$vv" +echo +printf -v vv "\045d\n" +printf "%s" "$vv" + +# simple character output +printf -v vv "%c\n" ABCD +printf "%s" "$vv" + +# test simple string output +printf -v vv "%s\n" unquoted +printf "%s" "$vv" + +# test quoted string output +printf -v vv "%s %q\n" unquoted quoted +printf "%s" "$vv" +printf -v vv "%s%10q\n" unquoted quoted +printf "%s" "$vv" + +printf -v vv "%q\n" 'this&that' +printf "%s" "$vv" + +# make sure the format string is reused to use up arguments +printf -v vv "%d " 1 2 3 4 5 +printf "%s" "$vv" +echo + +# make sure that extra format characters get null arguments +printf -v vv "%s %d %d %d\n" onestring +printf "%s" "$vv" + +printf -v vv "%s %d %u %4.2f\n" onestring +printf "%s" "$vv" + +printf -v vv -- "--%s %s--\n" 4.2 '' +printf "%s" "$vv" +printf -v vv -- "--%s %s--\n" 4.2 +printf "%s" "$vv" + +# test %b escapes + +# 8 is a non-octal digit, so the `81' should be output +#printf -v vv -- "--%b--\n" '\n\081' +#printf "%s" "$vv" + +printf -v vv -- "--%b--\n" '\t\0101' +printf "%s" "$vv" +printf -v vv -- "--%b--\n" '\t\101' +printf "%s" "$vv" + +# these should all display `A7' +printf -v vv "%b\n" '\01017' +printf "%s" "$vv" +printf -v vv "%b\n" '\1017' +printf "%s" "$vv" +printf -v vv "%b\n" '\x417' +printf "%s" "$vv" + +printf -v vv -- "--%b--\n" '\"abcd\"' +printf "%s" "$vv" +printf -v vv -- "--%b--\n" "\'abcd\'" +printf "%s" "$vv" + +printf -v vv -- "--%b--\n" 'a\\x' +printf "%s" "$vv" + +printf -v vv -- "--%b--\n" '\x' +printf "%s" "$vv" + +Z1=$(printf -- "%b\n" '\a\b\e\f\r\v') +Z2=$'\a\b\e\f\r\v' + +if [ "$Z1" != "$Z2" ]; then + printf "%s" "whoops: printf -v vv %b and $'' differ" >&2 +fi +unset Z1 Z2 + +printf -v vv -- "--%b--\n" '' +printf "%s" "$vv" +printf -v vv -- "--%b--\n" +printf "%s" "$vv" + +# the stuff following the \c should be ignored, as well as the rest +# of the format string +printf -v vv -- "--%b--\n" '4.2\c5.4\n' +printf "%s" "$vv" +echo + +# unrecognized escape sequences should by displayed unchanged +printf -v vv -- "--%b--\n" '4\.2' +printf "%s" "$vv" + +# a bare \ should not be processed as an escape sequence +printf -v vv -- "--%b--\n" '\' +printf "%s" "$vv" + +# make sure extra arguments are ignored if the format string doesn't +# actually use them +printf -v vv "\n" 4.4 BSD +printf "%s" "$vv" +printf -v vv " " 4.4 BSD +printf "%s" "$vv" +echo + +# make sure that a fieldwidth and precision of `*' are handled right +printf -v vv "%10.8s\n" 4.4BSD +printf "%s" "$vv" +printf -v vv "%*.*s\n" 10 8 4.4BSD +printf "%s" "$vv" + +printf -v vv "%10.8q\n" 4.4BSD +printf "%s" "$vv" +printf -v vv "%*.*q\n" 10 8 4.4BSD +printf "%s" "$vv" + +printf -v vv "%6b\n" 4.4BSD +printf "%s" "$vv" +printf -v vv "%*b\n" 6 4.4BSD +printf "%s" "$vv" + +# we handle this crap with homemade code in printf -v vv.def +printf -v vv "%10b\n" 4.4BSD +printf "%s" "$vv" +printf -v vv -- "--%-10b--\n" 4.4BSD +printf "%s" "$vv" +printf -v vv "%4.2b\n" 4.4BSD +printf "%s" "$vv" +printf -v vv "%.3b\n" 4.4BSD +printf "%s" "$vv" +printf -v vv -- "--%-8b--\n" 4.4BSD +printf "%s" "$vv" + +# test numeric conversions -- these four lines should printf "%s" identically +printf -v vv "%d %u %i 0%o 0x%x 0x%X\n" 255 255 255 255 255 255 +printf "%s" "$vv" +printf -v vv "%d %u %i %#o %#x %#X\n" 255 255 255 255 255 255 +printf "%s" "$vv" + +printf -v vv "%ld %lu %li 0%o 0x%x 0x%X\n" 255 255 255 255 255 255 +printf "%s" "$vv" +printf -v vv "%ld %lu %li %#o %#x %#X\n" 255 255 255 255 255 255 +printf "%s" "$vv" + +printf -v vv "%10d\n" 42 +printf "%s" "$vv" +printf -v vv "%10d\n" -42 +printf "%s" "$vv" + +printf -v vv "%*d\n" 10 42 +printf "%s" "$vv" +printf -v vv "%*d\n" 10 -42 +printf "%s" "$vv" + +# test some simple floating point formats +printf -v vv "%4.2f\n" 4.2 +printf "%s" "$vv" +printf -v vv "%#4.2f\n" 4.2 +printf "%s" "$vv" +printf -v vv "%#4.1f\n" 4.2 +printf "%s" "$vv" + +printf -v vv "%*.*f\n" 4 2 4.2 +printf "%s" "$vv" +printf -v vv "%#*.*f\n" 4 2 4.2 +printf "%s" "$vv" +printf -v vv "%#*.*f\n" 4 1 4.2 +printf "%s" "$vv" + +printf -v vv "%E\n" 4.2 +printf "%s" "$vv" +printf -v vv "%e\n" 4.2 +printf "%s" "$vv" +printf -v vv "%6.1E\n" 4.2 +printf "%s" "$vv" +printf -v vv "%6.1e\n" 4.2 +printf "%s" "$vv" + +printf -v vv "%G\n" 4.2 +printf "%s" "$vv" +printf -v vv "%g\n" 4.2 +printf "%s" "$vv" +printf -v vv "%6.2G\n" 4.2 +printf "%s" "$vv" +printf -v vv "%6.2g\n" 4.2 +printf "%s" "$vv" + +# test some of the more esoteric features of POSIX.1 printf -v vv +printf -v vv "%d\n" "'string'" +printf "%s" "$vv" +printf -v vv "%d\n" '"string"' +printf "%s" "$vv" + +printf -v vv "%#o\n" "'string'" +printf "%s" "$vv" +printf -v vv "%#o\n" '"string"' +printf "%s" "$vv" + +printf -v vv "%#x\n" "'string'" +printf "%s" "$vv" +printf -v vv "%#X\n" '"string"' +printf "%s" "$vv" + +printf -v vv "%6.2f\n" "'string'" +printf "%s" "$vv" +printf -v vv "%6.2f\n" '"string"' +printf "%s" "$vv" + +# output from these two lines had better be the same +printf -v vv -- "--%6.4s--\n" abcdefghijklmnopqrstuvwxyz +printf "%s" "$vv" +printf -v vv -- "--%6.4b--\n" abcdefghijklmnopqrstuvwxyz +printf "%s" "$vv" + +# and these two also +printf -v vv -- "--%12.10s--\n" abcdefghijklmnopqrstuvwxyz +printf "%s" "$vv" +printf -v vv -- "--%12.10b--\n" abcdefghijklmnopqrstuvwxyz +printf "%s" "$vv" + +# tests for translating \' to ' and \\ to \ +# printf -v vv translates \' to ' in the format string... +printf -v vv "\'abcd\'\n" +printf "%s" "$vv" + +# but not when the %b format specification is used +printf -v vv "%b\n" \\\'abcd\\\' +printf "%s" "$vv" + +# but both translate \\ to \ +printf -v vv '\\abcd\\\n' +printf "%s" "$vv" +printf -v vv "%b\n" '\\abcd\\' +printf "%s" "$vv" + +# this was reported as a bug in bash-2.03 +# these three lines should all printf "%s" `26' +printf -v vv "%d\n" 0x1a +printf "%s" "$vv" +printf -v vv "%d\n" 032 +printf "%s" "$vv" +printf -v vv "%d\n" 26 +printf "%s" "$vv" + +# error messages + +# this should be an overflow, but error messages vary between systems +# printf -v vv "%lu\n" 4294967296 + +# ...but we cannot use this because some systems (SunOS4, for example), +# happily ignore overflow conditions in strtol(3) +#printf -v vv "%ld\n" 4294967296 + +printf -v vv "%10" +printf -v vv "ab%Mcd\n" + +# this caused an infinite loop in older versions of printf -v vv +printf -v vv "%y" 0 + +# these should print a warning and `0', according to POSIX.2 +printf -v vv "%d\n" GNU +printf "%s" "$vv" +printf -v vv "%o\n" GNU +printf "%s" "$vv" + +# failures in all bash versions through bash-2.05 +printf -v vv "%.0s" foo +printf "%s" "$vv" +printf -v vv "%.*s" 0 foo +printf "%s" "$vv" + +printf -v vv '%.0b-%.0s\n' foo bar +printf "%s" "$vv" +printf -v vv '(%*b)(%*s)\n' -4 foo -4 bar +printf "%s" "$vv" + +format='%'`printf '%0100384d' 0`'d\n' +printf -v vv $format 0 +printf "%s" "$vv" + +# failures in all bash versions through bash-3.0 - undercounted characters +unset vv +printf -v vv " %s %s %s \n%n" ab cd ef vvv +printf "%s" "$vv" +echo $vvv + +# this doesn't work with printf -v vv(3) on all systems +#printf -v vv "%'s\n" foo + +# test cases from an austin-group list discussion +# prints ^G as an extension +printf -v vv '%b\n' '\7' +printf "%s" "$vv" + +# prints ^G +printf -v vv '%b\n' '\0007' +printf "%s" "$vv" + +# prints NUL then 7 +#printf -v vv '\0007\n' +#printf "%s" "$vv" + +# prints no more than two hex digits +printf -v vv '\x07e\n' +printf "%s" "$vv" + +# additional backslash escapes +printf -v vv '\"\?\n' +printf "%s" "$vv" diff --git a/tests/printf2.sub b/tests/printf2.sub new file mode 100644 index 0000000..45c48d4 --- /dev/null +++ b/tests/printf2.sub @@ -0,0 +1,7 @@ +unset LC_ALL LC_CTYPE +export LANG=en_US.UTF-8 + +case $(printf %d\\n \'À) in +192) exit 0;; +*) echo "printf2.sub: multibyte character conversion failed" >&2 ; exit 2 ;; +esac diff --git a/tests/printf3.sub b/tests/printf3.sub new file mode 100644 index 0000000..ec14fa3 --- /dev/null +++ b/tests/printf3.sub @@ -0,0 +1,62 @@ +LC_ALL=C +LANG=C + +SHELLSTART=$(date +%s) +SECS=1275250155 +export TZ=EST5EDT + +case $SHELLSTART in +*s*) SHELLSTART=$(perl -e 'print time') ; DATESECS=false ;; # take a shot +*) DATESECS=true ;; +esac + +printf "%()T\n" $SECS +printf "%(abde)Z\n" -1 + +printf "%(%e-%b-%Y %T)T\n" $SECS + +printf -v v1 "%(%e-%b-%Y %T)T\n" $( $DATESECS && date +%s || perl -e 'print time') +printf -v v2 "%(%e-%b-%Y %T)T\n" -1 + +case $v1 in +$v2) ;; +*) echo "current time and -1 possible mismatch|$v1|$v2|" >&2 ;; +esac +unset v1 v2 + +v1=$(date +%s) +printf -v v2 "%(%s)T" -1 + +case $v1 in +$v2) ;; +*) echo "current time mismatch:$v1|$v2|" >&2 ;; +esac +unset v1 v2 + +printf "%(%x %X)T\n" $(( $SECS - 3600 )) + +printf -v v1 "%(%F %r)T\n" $SHELLSTART +printf -v v2 "%(%F %r)T\n" -2 + +case $v1 in +$v2) ;; +*) echo "shell start time and -2 possible mismatch|$v1|$v2|" >&2 ;; +esac +unset v1 v2 + +printf "current time: %(%F %r)T\n" $SECS + +printf "epoch time: %(%F %r %z)T\n" 0 +printf "random time: %(%F %r %z)T\n" $SECS + +printf "local time: %(%a %b %e %H:%M:%S %Z %Y)T\n" $SECS + +# test fieldwidth, justification, precision +printf "%-40.50(%a %b %e %H:%M:%S %Z %Y)T date-style time\n" $SECS + +# test fieldwidth, justification, precision, embedded parens +printf "%-40.50(%x (foo) %X)T date-style time\n" $SECS + +# problem introduced in bash-4.2 patch 5 +unset TZ +printf '%(%Y-%m-%d %H:%M:%S %Z)T\n' >/dev/null diff --git a/tests/printf4.sub b/tests/printf4.sub new file mode 100644 index 0000000..2ffd997 --- /dev/null +++ b/tests/printf4.sub @@ -0,0 +1,69 @@ +# Problems with padding, field widths, and `+' through bash-4.2 + +printf "x%10.0fx\n" 123 +printf -v foo "x%10.0fx" 123 +echo "$foo" + +printf "x%10.0fx\n" 123 +printf -v foo "x%10.0fx" 123 +echo "$foo" + +printf "x%10.fx\n" 123 +printf -v foo "x%10.fx" 123 +echo "$foo" + +printf "x%10.2fx\n" 123 +printf -v foo "x%10.2fx" 123 +echo "$foo" + +printf "x%10.02fx\n" 123 +printf -v foo "x%10.02fx" 123 +echo "$foo" + +printf "x%-010.0fx\n" 123 +printf -v foo "x%-010.0fx" 123 +echo "$foo" + +printf "x%+010.0ex\n" 123 +printf -v foo "x%+010.0ex" 123 +echo "$foo" + +printf "x%+010.0fx\n" 123 +printf -v foo "x%+010.0fx" 123 +echo "$foo" + +printf "x%+010.0gx\n" 123 +printf -v foo "x%+010.0gx" 123 +echo "$foo" + +printf "x%+010.0dx\n" 123 +printf -v foo "x%+010.0dx" 123 +echo "$foo" + +printf "x%+010.0ldx\n" 123 +printf -v foo "x%+010.0ldx" 123 +echo "$foo" + +printf "x%+010.0xx\n" 123 +printf -v foo "x%+010.0xx" 123 +echo "$foo" + +printf "x%-+10.0fx\n" 123 +printf -v foo "x%-+10.0fx" 123 +echo "$foo" + +printf "x%-+10.0dx\n" 123 +printf -v foo "x%-+10.0dx" 123 +echo "$foo" + +printf "%f\n" -123 +printf -v foo "%f" -123 +echo "$foo" + +printf "x%+10.0fx\n" 123 +printf -v foo "x%+10.0fx" 123 +echo "$foo" + +printf "x%+10.0dx\n" 123 +printf -v foo "x%+10.0dx" 123 +echo "$foo" diff --git a/tests/quote.right b/tests/quote.right new file mode 100644 index 0000000..00b55c6 --- /dev/null +++ b/tests/quote.right @@ -0,0 +1,82 @@ +Single Quote +foo +bar +foo +bar +foo\ +bar +Double Quote +foo +bar +foo +bar +foobar +Backslash Single Quote +foo bar +foo bar +foobar +Backslash Double Quote +foo bar +foo bar +foobar +Double Quote Backslash Single Quote +foo +bar +foo +bar +foobar +Dollar Paren Single Quote +foo bar +foo bar +foo\ bar +Dollar Paren Double Quote +foo bar +foo bar +foobar +Double Quote Dollar Paren Single Quote +foo +bar +foo +bar +foo\ +bar +argv[1] = +argv[1] = +argv[1] = argv[2] = <-e> argv[3] = +argv[1] = argv[2] = <-e> argv[3] = +argv[1] = +argv[1] = +argv[1] = +b +a +b +c +argv[1] = +argv[2] = +argv[1] = <$> +argv[2] = +argv[1] = <$foo> +argv[2] = +argv[1] = <$foo> +argv[2] = +argv[1] = <`> +argv[2] = +argv[1] = <\> +argv[2] = +${ +argv[1] = <(")> +argv[1] = <(")> +'weferfds'\''dsfsdf' +'weferfdsdsfsdf' +'weferfds'\''dsfsdf' +'weferfds'\\dsfsdf' +testdd ddtest +testdd '\''ddtest +testdddding +testdddding +test'ing +test'ing +test'string +a'b'c +foo b c baz +foo 'bar baz diff --git a/tests/quote.tests b/tests/quote.tests new file mode 100644 index 0000000..0c55293 --- /dev/null +++ b/tests/quote.tests @@ -0,0 +1,112 @@ +echo "Single Quote" +echo 'foo +bar' +echo 'foo +bar' +echo 'foo\ +bar' + +echo "Double Quote" +echo "foo +bar" +echo "foo +bar" +echo "foo\ +bar" + +echo "Backslash Single Quote" +echo `echo 'foo +bar'` +echo `echo 'foo +bar'` +echo `echo 'foo\ +bar'` + +echo "Backslash Double Quote" +echo `echo "foo +bar"` +echo `echo "foo +bar"` +echo `echo "foo\ +bar"` + +echo "Double Quote Backslash Single Quote" +echo "`echo 'foo +bar'`" +echo "`echo 'foo +bar'`" +echo "`echo 'foo\ +bar'`" + +echo "Dollar Paren Single Quote" +echo $(echo 'foo +bar') +echo $(echo 'foo +bar') +echo $(echo 'foo\ +bar') + +echo "Dollar Paren Double Quote" +echo $(echo "foo +bar") +echo $(echo "foo +bar") +echo $(echo "foo\ +bar") + +echo "Double Quote Dollar Paren Single Quote" +echo "$(echo 'foo +bar')" +echo "$(echo 'foo +bar')" +echo "$(echo 'foo\ +bar')" + +# old-style command substitution parsing compatibility tests -- post bash-3.1 +recho 'foo \\ +bar' + +recho 'foo \ +bar' + +echo `recho sed -e 's/[ :]/\\ +/g'` + +echo `recho sed -e 's/[ :]/\ +/g'` + +echo `recho 'foo\\ +bar'` + +echo `recho 'foo\ +bar'` + +echo $(recho 'foo\ +bar') + +a=`echo 'a b c' | sed 's/ /\\ +/g' | grep 'b'` +echo $a +a=`echo 'a b c' | sed 's/ /\\ +/g'` +echo "$a" + +recho `echo 'a\' b` + +recho `echo '\$' bab` +recho `echo '\$foo' bab` +recho `echo '$foo' bab` + +recho `echo '\`' ab` + +recho `echo '\\' ab` + +echo `echo '${'` + +recho `echo "(\\")"` +# produces no output +: `: "\\""` +# ultimate workaround +recho `echo "(\")"` + +${THIS_SH} ./quote1.sub diff --git a/tests/quote1.sub b/tests/quote1.sub new file mode 100644 index 0000000..c83e64a --- /dev/null +++ b/tests/quote1.sub @@ -0,0 +1,49 @@ +# inconsistency with quoted pattern substitution patterns through bash-4.2 +# fixed in a ksh93-compatible (and Posix-compatible, in general) way +# NOT backwards compatible + +test="weferfds'dsfsdf" + +# why does this work, this list was born of frustration, I tried +# everything I could think of. +echo \'${test//"'"/\'\\\'\'}\'" " + +#but none of the following + +echo "'${test//"'"/}'" + +echo "'${test//"'"/"'\\''"}'" + +echo "'${test//"'"/\'\\'\'}'" + +#echo "'${test//'/}'" # hangs waiting for ' +#echo "'${test//"'"/'\\''}'" # hangs waiting for ' + +unset test +test=teststrtest +echo "${test//str/"dd dd"}" +echo ${test//str/"dd '\''dd"} + +unset test +test=teststring + +echo "${test//str/"dddd"}" + +echo ${test//str/"dddd"} + +echo ${test//str/"'"} + +echo "${test//str/"'"}" + +#echo "${test//str/'}" # hangs + +test=test\'string +echo "${test//"'"/"'"}" + +x="a'b'c"; echo "${x//\'/\'}" + +printf '%s\n' "foo ${IFS+"b c"} baz" + +# this is where the default behavior differs from posix +set -o posix +echo "foo ${IFS+'bar} baz" diff --git a/tests/read.right b/tests/read.right new file mode 100644 index 0000000..73cb704 --- /dev/null +++ b/tests/read.right @@ -0,0 +1,66 @@ +a. +-a-b- +-a-b - +-a b- +-a b- +-a-b\- +-a b\- +-\-a b\- +-\ a b\- +-\-a b\- +-\ a b\- +argv[1] = <^A> +argv[1] = <^A> +argv[1] = <^?> +argv[1] = <^?> +argv[1] = +1: x[A] y[B] z[] +1a: +2: x[A B] +[A B ] +[ A B ] +==aa== +==== +==== +argv[1] = < foo> +argv[1] = < foo> +argv[1] = +argv[1] = < foo> +argv[1] = +argv[1] = +argv[1] = < foo> +a = abcdefg +a = xyz +a = -xyz 123- +a = abc +timeout 1: ok + +timeout 2: ok + +./read2.sub: line 23: read: -3: invalid timeout specification +1 + +abcde +./read3.sub: line 4: read: -1: invalid number +abc +ab +abc +# +while read -u 3 var +do +echo "$var" +done 3<$0 +argv[1] = <> +argv[1] = <> +argv[1] = <> +FOO +argv[1] = <> +argv[1] = <3> +argv[1] = <> +argv[2] = <> +argv[3] = <> +FOO +0 0 0 +0 +0 +1 diff --git a/tests/read.tests b/tests/read.tests new file mode 100644 index 0000000..fe27dae --- /dev/null +++ b/tests/read.tests @@ -0,0 +1,98 @@ +echo " a " | (read x; echo "$x.") + +echo " a b " | ( read x y ; echo -"$x"-"$y"- ) +echo " a b\ " | ( read x y ; echo -"$x"-"$y"- ) +echo " a b " | ( read x ; echo -"$x"- ) +echo " a b\ " | ( read x ; echo -"$x"- ) + +echo " a b\ " | ( read -r x y ; echo -"$x"-"$y"- ) +echo " a b\ " | ( read -r x ; echo -"$x"- ) + +echo "\ a b\ " | ( read -r x y ; echo -"$x"-"$y"- ) +echo "\ a b\ " | ( read -r x ; echo -"$x"- ) +echo " \ a b\ " | ( read -r x y ; echo -"$x"-"$y"- ) +echo " \ a b\ " | ( read -r x ; echo -"$x"- ) + +# make sure that CTLESC and CTLNUL are passed through correctly +echo $'\001' | ( read var ; recho "$var" ) +echo $'\001' | ( read ; recho "$REPLY" ) + +echo $'\177' | ( read var ; recho "$var" ) +echo $'\177' | ( read ; recho "$REPLY" ) + +# make sure a backslash-quoted \\n still disappears from the input when +# we're not reading in `raw' mode, and no stray CTLESC chars are left in +# the input stream +echo $'ab\\\ncd' | ( read ; recho "$REPLY" ) + +echo "A B " > /tmp/IN +unset x y z +read x y z < /tmp/IN +echo 1: "x[$x] y[$y] z[$z]" +echo 1a: ${z-z not set} +read x < /tmp/IN +echo 2: "x[$x]" +rm /tmp/IN + +# this is where the bash `read' behavior with respect to $REPLY differs +# from ksh93 +echo "A B " > /tmp/IN + +read < /tmp/IN +echo "[$REPLY]" + +rm /tmp/IN + +echo " A B " > /tmp/IN + +read < /tmp/IN +echo "[$REPLY]" + +rm /tmp/IN + +# make sure that read with more variables than words sets the extra +# variables to the empty string + +bvar=bvar +cvar=cvar +echo aa > /tmp/IN +read avar bvar cvar < /tmp/IN +echo =="$avar"== +echo =="$bvar"== +echo =="$cvar"== + +rm /tmp/IN + +# test behavior of read with various settings of IFS + +echo " foo" | { IFS= read line; recho "$line"; } + +echo " foo" | { IFS= ; read line; recho "$line"; } + +echo " foo" | { unset IFS ; read line; recho "$line"; } + +echo " foo" | { IFS=$'\n' ; read line; recho "$line"; } + +echo " foo" | { IFS=$' \n' ; read line; recho "$line"; } + +echo " foo" | { IFS=$' \t\n' ; read line; recho "$line"; } + +echo " foo" | { IFS=$':' ; read line; recho "$line"; } + +# test read -d delim behavior +${THIS_SH} ./read1.sub + +# test read -t timeout behavior +${THIS_SH} ./read2.sub + +# test read -n nchars behavior +${THIS_SH} ./read3.sub + +# test read -u fd behavior +${THIS_SH} ./read4.sub + +# test behavior when IFS is not the default -- bug through bash-2.05b +${THIS_SH} ./read5.sub + +# test behavior of read -t 0 +${THIS_SH} ./read6.sub diff --git a/tests/read1.sub b/tests/read1.sub new file mode 100644 index 0000000..2a36449 --- /dev/null +++ b/tests/read1.sub @@ -0,0 +1,23 @@ +a=7 +echo 'abcdefg|xyz' | { + read -d '|' a + echo a = "${a-unset}" +} + +echo xyz 123 | { + read -d ' ' a + echo a = "${a-unset}" +} + +echo xyz 123 | { + read -d $'\n' a + echo a = -"${a-unset}"- +} + +a=44 +echo abcd | { + read -d d a + echo a = $a +} + +exit 0 diff --git a/tests/read2.sub b/tests/read2.sub new file mode 100644 index 0000000..c4a1f77 --- /dev/null +++ b/tests/read2.sub @@ -0,0 +1,32 @@ +a=4 + +read -t 2 a < /dev/tty +estat=$? +if [ $estat -gt 128 ]; then + echo timeout 1: ok +else + echo $estat +fi + +echo $a + +sleep 5 | read -t 1 a +estat=$? +if [ $estat -gt 128 ]; then + echo timeout 2: ok +else + echo $estat +fi + +echo $a + +read -t -3 a < /dev/tty +echo $? + +echo $a + +# the above should all time out +echo abcde | { + read -t 2 a + echo $a +} diff --git a/tests/read3.sub b/tests/read3.sub new file mode 100644 index 0000000..af41e3f --- /dev/null +++ b/tests/read3.sub @@ -0,0 +1,24 @@ +# non-interactive + +# error +read -n -1 + +# from pipe -- should work, but doesn't change tty attributes +echo abcdefg | { + read -n 3 xyz + echo $xyz +} + +# fewer chars than specified +echo ab | { + read -n 3 xyz + echo $xyz +} + +echo abc | { + read -N 4 -d$'\n' foo + echo $foo +} + +read -n 1 < $0 +echo "$REPLY" diff --git a/tests/read4.sub b/tests/read4.sub new file mode 100644 index 0000000..80bc9fc --- /dev/null +++ b/tests/read4.sub @@ -0,0 +1,4 @@ +while read -u 3 var +do + echo "$var" +done 3<$0 diff --git a/tests/read5.sub b/tests/read5.sub new file mode 100644 index 0000000..e35674e --- /dev/null +++ b/tests/read5.sub @@ -0,0 +1,35 @@ +IFS=: read x y z << EOF +::: +EOF +recho $x +recho "$x" +recho $y +recho "$y" +recho $z +recho "$z" + +if [ -z "$x" ]; then + echo FOO +else + echo BAR +fi + +IFS=: read -a A << EOF +::: +EOF + +recho ${A[0]} +recho "${A[0]}" + +recho ${#A[@]} + +recho "${A[@]}" + +if [ -z "${A[0]}" ]; then + echo FOO +else + echo BAR +fi + +echo -n ${A[0]} | cat -vet +echo -n ${A[0]} | wc | ( IFS=$' \t\n' ; while read line; do echo $line; done; ) diff --git a/tests/read6.sub b/tests/read6.sub new file mode 100644 index 0000000..abfe89d --- /dev/null +++ b/tests/read6.sub @@ -0,0 +1,10 @@ +# test read with a timeout of 0 -- input polling +# sleep with fractional seconds argument is not universal +echo abcde | { sleep 0.25 2>/dev/null ; read -t 0; } +echo $? + +read -t 0 < $0 +echo $? + +read -t 0 +echo $? diff --git a/tests/redir.right b/tests/redir.right new file mode 100644 index 0000000..f461e65 --- /dev/null +++ b/tests/redir.right @@ -0,0 +1,142 @@ +abc +./redir.tests: line 15: /tmp/redir-test: cannot overwrite existing file +abc +def +def +./redir.tests: line 31: $z: ambiguous redirect +Point 1 +Point 2 +to a +to b +Point 3 +to a +to a +to b +to b +Point 4 +to c +Point 5 +this is redir1.sub +this is redir2.sub +read line1 "ab" +read line2 "root" +read line3 "cd" +read line4 "daemon" +from stdin: aa +to stdout +./redir4.sub: line 32: $fd: ambiguous redirect +./redir4.sub: line 33: $fd: ambiguous redirect +/tmp/err-and-out: +to stdout +to stderr +/tmp/err-and-out: +to stdout +to stderr +0 -- 3 0 +0 -- 4 0 +ab +cd +ef +gh +ij +kl +0 +ab +cd +cd +./redir.tests: line 154: redir1.*: No such file or directory +# tests of ksh93-like dup-and-close redirection operators +exec 9<$0 + +f() +{ +exec 5<$0 + +exec 0<&5- + +while read line; do +echo "$line" +done +} + +f + +typeset -f f + +# make sure it was closed +read -u 5 foo +echo after read + +exec 5<&0 + +exec <&- + +read abcde + +exec 0<&9- +read line +echo $line +f () +{ + exec 5< $0; + exec 0<&5-; + while read line; do + echo "$line"; + done +} +./redir5.sub: line 20: read: 5: invalid file descriptor: Bad file descriptor +after read +./redir5.sub: line 27: read: read error: 0: Bad file descriptor +# tests of ksh93-like dup-and-close redirection operators +/ +/ +/ +0 +0 +0 +before block +after block +c1 is 1 +c2 is 2 +c3 is 3 +c4 is 4 +fd 10 +fd 8 +fd 10 +fd 8 +1 +2 +3 +4 +1 +2 +3 +4 +cat /tmp/foo +whatsis +hey +to stdout +to stderr + +to stdout +to stderr + +to stderr +to stdout + +to stderr +hey +to stdout +logfunc is a function +logfunc () +{ + echo "$@" &>> $TMPDIR/log +} +foo +bix is a function +bix () +{ + echo foo 2>&1 | cat +} +foo +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: diff --git a/tests/redir.tests b/tests/redir.tests new file mode 100644 index 0000000..c2e4866 --- /dev/null +++ b/tests/redir.tests @@ -0,0 +1,191 @@ +: ${TMPDIR:=/tmp} + +export LC_ALL=C +export LANG=C + +# catch-all for remaining untested redirection stuff +set +o posix + +echo abc > /tmp/redir-test +cat /tmp/redir-test + +set -o noclobber + +#this should be an error +echo def > /tmp/redir-test +cat /tmp/redir-test + +# but this should succeed +echo def > /tmp/redir-test-2 +cat /tmp/redir-test-2 + +# and so should this +echo def >| /tmp/redir-test +cat /tmp/redir-test + +set +o noclobber +rm /tmp/redir-test /tmp/redir-test-2 + +# this should be an error +z="a b" +cat < $z + +echo "Point 1" + +exec 3$TMPDIR/bash-a +exec 5>$TMPDIR/bash-b +echo "Point 2" + +echo to a 1>&4 +echo to b 1>&5 +cat $TMPDIR/bash-a +cat $TMPDIR/bash-b +exec 11&4 +echo to b 1>&5 +cat $TMPDIR/bash-a +cat $TMPDIR/bash-b + +exec 11<&- +echo "Point 4" + +exec 6<>$TMPDIR/bash-c +echo to c 1>&6 +cat $TMPDIR/bash-c +echo "Point 5" + +rm -f $TMPDIR/bash-a $TMPDIR/bash-b $TMPDIR/bash-c + +# +# Test the effect of input buffering on the shell's input +# +${THIS_SH} < redir1.sub + +# more open, close, duplicate file descriptors +${THIS_SH} ./redir3.sub < ./redir3.in1 + +# still more redirections +${THIS_SH} ./redir4.sub < redir4.in1 + +# various forms of null redirection +testf() +{ + if [ -f "$1" ]; then + rm -f "$1" + else + echo oops -- $1 not found + fi +} + +> $TMPDIR/null-redir-a +testf $TMPDIR/null-redir-a + +$EXIT > $TMPDIR/null-redir-b +testf $TMPDIR/null-redir-b + +( > $TMPDIR/null-redir-c ) +testf $TMPDIR/null-redir-c + +$EXIT > $TMPDIR/null-redir-d & +wait +testf $TMPDIR/null-redir-d + +exit 3 | $EXIT > $TMPDIR/null-redir-e +echo $? -- ${PIPESTATUS[@]} +testf $TMPDIR/null-redir-e + +exit 4 | > $TMPDIR/null-redir-f +echo $? -- ${PIPESTATUS[@]} +testf $TMPDIR/null-redir-f + +> $TMPDIR/null-redir-g & +wait +testf $TMPDIR/null-redir-g + +exec >$TMPDIR/null-redir-h & +wait +testf $TMPDIR/null-redir-h + +# make sure async commands don't get /dev/null as stdin when an explicit +# input redirection is supplied +for x in 1 2 3; do + { read line ; echo $line ; } & + wait + { read line ; echo $line ; } & + wait +done << EOF +ab +cd +ef +gh +ij +kl +EOF + +# make sure async commands get /dev/null as stdin in the absence of any +# input redirection +/bin/cat & +wait +echo $? + +# make sure that loops work OK with here documents and are not run in +# subshells +while read line; do + echo $line + l2=$line +done << EOF +ab +cd +EOF +echo $l2 + +# These should not echo anything -- bug in versions before 2.04 +( ( echo hello 1>&3 ) 3>&1 ) >/dev/null 2>&1 + +( ( echo hello 1>&3 ) 3>&1 ) >/dev/null 2>&1 | cat + +# in posix mode, non-interactive shells are not allowed to perform +# filename expansion on input redirections, even if they expand to +# a single filename +set -o posix +cat < redir1.* + +# test ksh93 dup-and-close (move fd) redirections +${THIS_SH} ./redir5.sub + +# test behavior after a write error with a builtin command +${THIS_SH} ./redir6.sub + +# problem with redirections using fds bash uses internally +: ${TMPDIR:=$TMPDIR} + +trap 'rm -f $TMPDIR/bash-redir-$$' 0 1 2 3 6 15 + +echo before block +{ + echo before redir + exec 10>&1 + echo after redir +} > $TMPDIR/bash-redir-$$ + +echo after block + +${THIS_SH} ./redir7.sub + +${THIS_SH} ./redir8.sub + +exec 9>&2 +command exec 2>$TMPDIR/foo-$$ +echo whatsis >&2 +echo cat /tmp/foo +cat $TMPDIR/foo-$$ +rm -f $TMPDIR/foo-$$ +exec 2>&9 +exec 9>&- + +${THIS_SH} ./redir9.sub + +${THIS_SH} ./redir10.sub diff --git a/tests/redir1.sub b/tests/redir1.sub new file mode 100644 index 0000000..f1082e9 --- /dev/null +++ b/tests/redir1.sub @@ -0,0 +1,8 @@ +# +# Test the effect of input buffering on the shell's input +# +echo this is redir1.sub + +exec 0< redir2.sub + +echo BUG: after exec in redir1.sub diff --git a/tests/redir10.sub b/tests/redir10.sub new file mode 100644 index 0000000..27c48e8 --- /dev/null +++ b/tests/redir10.sub @@ -0,0 +1,25 @@ +#!/bin/bash +# +# Out of file descriptors, because it forgets to close redirection. Only +# happens in a shell function. Problem through bash-4.2. + +ulimit -n 128 + +bug() +{ +c=`ulimit -n` +let c+=100 +while let c-- +do + while read -ru3 x + do + echo -n : + done 3< <(echo x) + +done +} + +bug +echo + +exit 0 diff --git a/tests/redir2.sub b/tests/redir2.sub new file mode 100644 index 0000000..0820f70 --- /dev/null +++ b/tests/redir2.sub @@ -0,0 +1 @@ +echo this is redir2.sub diff --git a/tests/redir3.in1 b/tests/redir3.in1 new file mode 100644 index 0000000..dbd1fc3 --- /dev/null +++ b/tests/redir3.in1 @@ -0,0 +1,2 @@ +ab +cd diff --git a/tests/redir3.in2 b/tests/redir3.in2 new file mode 100644 index 0000000..5a1c32b --- /dev/null +++ b/tests/redir3.in2 @@ -0,0 +1,2 @@ +root +daemon diff --git a/tests/redir3.sub b/tests/redir3.sub new file mode 100644 index 0000000..c486253 --- /dev/null +++ b/tests/redir3.sub @@ -0,0 +1,26 @@ +read line1 + +echo read line1 \"$line1\" + +exec 4<./redir3.in2 + +exec 5<&0 +exec 0<&4 + +read line2 + +echo read line2 \"$line2\" + +exec 0<&5 + +read line3 + +echo read line3 \"$line3\" + +exec 0<&4 + +read line4 + +echo read line4 \"$line4\" + +exec 4<&- diff --git a/tests/redir4.in1 b/tests/redir4.in1 new file mode 100644 index 0000000..e61ef7b --- /dev/null +++ b/tests/redir4.in1 @@ -0,0 +1 @@ +aa diff --git a/tests/redir4.sub b/tests/redir4.sub new file mode 100644 index 0000000..4734455 --- /dev/null +++ b/tests/redir4.sub @@ -0,0 +1,56 @@ +minus=- + +# standard input +fd=0 + +exec 3<&$fd + +read line <&3 +echo from stdin: $line + +# close fd 3 +exec 3<&${minus} + +# should give `bad fd', but exact error messages vary +# read line <&3 + +# standard output +fd=1 + +exec 4>&$fd + +echo to stdout >&4 + +exec 4>&$minus + +# should give `bad fd', but exact error messages vary +# echo to stdout >&4 + +unset fd + +# these are ambiguous redirects +exec 3<&$fd +exec 4>&$fd + +exec 3>&1 4>&2 + +exec >&/tmp/err-and-out +echo to stdout +echo to stderr >&2 + +exec 1>&3 2>&4 +echo /tmp/err-and-out: +cat /tmp/err-and-out + +rm /tmp/err-and-out + +fd=/tmp/err-and-out +exec >&$fd +echo to stdout +echo to stderr >&2 + +exec 1>&3 2>&4 +echo /tmp/err-and-out: +cat /tmp/err-and-out + +rm /tmp/err-and-out diff --git a/tests/redir5.sub b/tests/redir5.sub new file mode 100644 index 0000000..5d59d39 --- /dev/null +++ b/tests/redir5.sub @@ -0,0 +1,31 @@ +# tests of ksh93-like dup-and-close redirection operators +exec 9<$0 + +f() +{ +exec 5<$0 + +exec 0<&5- + +while read line; do + echo "$line" +done +} + +f + +typeset -f f + +# make sure it was closed +read -u 5 foo +echo after read + +exec 5<&0 + +exec <&- + +read abcde + +exec 0<&9- +read line +echo $line diff --git a/tests/redir6.sub b/tests/redir6.sub new file mode 100644 index 0000000..60cc68b --- /dev/null +++ b/tests/redir6.sub @@ -0,0 +1,8 @@ +cd / +pwd +help >&- +pwd +pwd +echo $? +echo $? +echo $? diff --git a/tests/redir7.sub b/tests/redir7.sub new file mode 100644 index 0000000..3fd371c --- /dev/null +++ b/tests/redir7.sub @@ -0,0 +1,69 @@ +# weird redirections that caused trouble and were fixed in post-3.0 bash +stuff() +{ + c=1 + ( sleep 5 < /dev/null >/dev/null 2>&1 & ) & +} + +exec 3>&1 +eval ` +exec 4>&1 >&3 3>&- +{ + stuff 4>&- + echo "c=$c" >&4 +}` +echo c1 is $c + +unset -f stuff + +stuff() +{ + c=2 + ( sleep 5 < /dev/null >/dev/null 2>&1 & ) +} + +exec 3>&1 +eval ` +exec 4>&1 >&3 3>&- +{ + stuff 4>&- + echo "c=$c" >&4 +}` +echo c2 is $c + +unset -f stuff + +stuff() +{ + c=3 + { sleep 5 < /dev/null >/dev/null 2>&1 & } & +} + +exec 3>&1 +eval ` +exec 4>&1 >&3 3>&- +{ + stuff 4>&- + echo "c=$c" >&4 +}` +echo c3 is $c + +unset -f stuff + +stuff() +{ + c=4 + { sleep 5 < /dev/null >/dev/null 2>&1 & } +} + +exec 3>&1 +eval ` +exec 4>&1 >&3 3>&- +{ + stuff 4>&- + echo "c=$c" >&4 +}` +echo c4 is $c + +# fixed in bash-3.1 +echo 'exec <&3' | ${THIS_SH} 3<&0 diff --git a/tests/redir8.sub b/tests/redir8.sub new file mode 100644 index 0000000..5f972a1 --- /dev/null +++ b/tests/redir8.sub @@ -0,0 +1,59 @@ +cd ${TMPDIR:=/var/tmp} +rm -f u + +${THIS_SH} -c 'exec 10>&1; echo fd 10 >&10' 10>u +cat u +rm -f u + +${THIS_SH} -c 'exec 8>&1; echo fd 8 >&8' 8>u +cat u +rm -f u + +exec 10>u +exec 10>&1; echo 'fd 10' >&10 +cat u +rm -f u +exec 10>&- + +exec 8>u +exec 8>&1; echo 'fd 8' >&8 +cat u +rm -f u +exec 8>&- + +rm -f infile +cat > infile <&2 +} + +TMPFN=$TMPDIR/foo-$$ + +rm -f $TMPFN + +echo hey > $TMPFN +func &>> $TMPFN + +cat $TMPFN + +echo +func &> $TMPFN + +cat $TMPFN + +echo +func >$TMPFN +cat $TMPFN + +echo +echo hey > $TMPFN +func >> $TMPFN +cat $TMPFN + +rm -f $TMPFN + +logfunc() +{ + echo "$@" &>> $TMPDIR/log +} + +type logfunc + +echo foo 2>&1 + +bix() +{ +echo foo |& cat +} + +type bix + +bix diff --git a/tests/rhs-exp.right b/tests/rhs-exp.right new file mode 100644 index 0000000..4ce6743 --- /dev/null +++ b/tests/rhs-exp.right @@ -0,0 +1,105 @@ +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = <=> +argv[3] = <-DSELECT_VECS=$selvecs> +argv[1] = +argv[2] = <=> +argv[3] = <-DSELECT_VECS='&m68kcoff_vec'> +argv[1] = +argv[2] = <=> +argv[3] = <-DSELECT_VECS=&m68kcoff_vec> +argv[1] = +argv[2] = <=> +argv[3] = <-DSELECT_VECS="&m68kcoff_vec"> +argv[1] = +argv[2] = <=> +argv[3] = <-DSELECT_VECS=\&m68kcoff_vec\> +argv[1] = +argv[2] = <=> +argv[3] = <-DSELECT_VECS=&m68kcoff_vec> +argv[1] = +argv[2] = <=> +argv[3] = <-DSELECT_VECS=$selvecs> +argv[1] = +argv[2] = <=> +argv[3] = <-DSELECT_VECS=$selvecs> +argv[1] = +argv[2] = <=> +argv[3] = <-DSELECT_VECS=$selvecs> +argv[1] = +argv[2] = <=> +argv[3] = <-DSELECT_VECS=\&m68kcoff_vec> +argv[1] = +argv[2] = <=> +argv[3] = <-DSELECT_VECS=\'&m68kcoff_vec\'> +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[2] = <=> +argv[3] = <-DSELECT_VECS=\'> +a*b +ab +a?b +ab +a/b +ab +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = +argv[1] = <> +argv[1] = +argv[1] = <''> +argv[1] = <> +good 1 +good 2 +good 3 +good 4 +good 5 +ok 1 +ok 2 +ok 3 +ok 4 +ok 5 +ok 6 +ok 7 diff --git a/tests/rhs-exp.tests b/tests/rhs-exp.tests new file mode 100644 index 0000000..a28d7f0 --- /dev/null +++ b/tests/rhs-exp.tests @@ -0,0 +1,51 @@ +selvecs='&m68kcoff_vec' +recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS='$selvecs'}" +recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS=\'$selvecs\'}" +recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS="$selvecs"}" +recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS=\"$selvecs\"}" +recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS=\\$selvecs\\}" +recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS=$selvecs}" +recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS=\$selvecs}" +recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS="\$selvecs"}" +recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS='$selvecs'"$null"}" +recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS="\\$selvecs"}" +recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS="\'$selvecs\'"}" + +recho TDEFAULTS = ${selvecs:+-DSELECT_VECS='$selvecs'} +recho TDEFAULTS = ${selvecs:+-DSELECT_VECS=\'$selvecs\'} +recho TDEFAULTS = ${selvecs:+-DSELECT_VECS="$selvecs"} +recho TDEFAULTS = ${selvecs:+-DSELECT_VECS=\"$selvecs\"} +recho TDEFAULTS = ${selvecs:+-DSELECT_VECS=\\$selvecs\\} +recho TDEFAULTS = ${selvecs:+-DSELECT_VECS=$selvecs} +recho TDEFAULTS = ${selvecs:+-DSELECT_VECS=\$selvecs} +recho TDEFAULTS = ${selvecs:+-DSELECT_VECS="\$selvecs"} +recho TDEFAULTS = ${selvecs:+-DSELECT_VECS='$selvecs'"$null"} +recho TDEFAULTS = ${selvecs:+-DSELECT_VECS="\\$selvecs"} +recho TDEFAULTS = ${selvecs:+-DSELECT_VECS="\'$selvecs\'"} + +recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS="\p"}" +recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS=\p}" +recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS="\\"}" +recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS=\\}" +recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS=\'}" +recho "TDEFAULTS = ${selvecs:+-DSELECT_VECS="\'"}" + +recho TDEFAULTS = ${selvecs:+-DSELECT_VECS="\p"} +recho TDEFAULTS = ${selvecs:+-DSELECT_VECS=\p} +recho TDEFAULTS = ${selvecs:+-DSELECT_VECS="\\"} +recho TDEFAULTS = ${selvecs:+-DSELECT_VECS=\\} +recho TDEFAULTS = ${selvecs:+-DSELECT_VECS=\'} +recho TDEFAULTS = ${selvecs:+-DSELECT_VECS="\'"} + +# more tests for bash-3.0 behavior + +var="a*b" ; echo "${var//\\*/}" +var="a*b" ; echo "${var//\*/}" + +var="a?b" ; echo "${var//\\?/}" +var="a?b" ; echo "${var//\?/}" + +var="a/b" ; echo "${var//\\//}" +var="a/b" ; echo "${var//\//}" + +${THIS_SH} ./rhs-exp1.sub diff --git a/tests/rhs-exp1.sub b/tests/rhs-exp1.sub new file mode 100644 index 0000000..5631ea5 --- /dev/null +++ b/tests/rhs-exp1.sub @@ -0,0 +1,103 @@ +# fixes for bugs in bash-4.2 regarding empty strings in expand_string_for_rhs + +f=abc +recho ${f##""a} +recho ${f##"$v"a} + +recho ${f%%""c} +recho ${f%%"$v"c} + +recho ${f//""a} +recho ${f//"$v"a} + +recho ${f/""a""b/} +recho ${f/""c/} +recho ${f/"$v"c/} + +unset foo empty +foo=aabbcc + +recho ${foo/bb/} +recho ${foo/bb/$empty} + +recho ${foo/} +recho ${empty/} + +recho ${foo/ } +recho ${empty/ } +unset foo empty + +S2=oenophile + +recho ${S2^"$v"[aeiou]} +recho ${S2^^"$v"[aeiou]} + +recho ${foo:-""} +recho ${foo:-""abc} + +recho "${foo:-''}" +recho "${foo:-}" + +if [[ $var == "" ]]; then + echo good 1 +fi + +if [[ "$var"X == ""X ]]; then + echo good 2 +fi + +if [ "$var"X == ""X"" ]; then + echo good 3 +fi + +if [ X"" == X ]; then + echo good 4 +fi + +if [[ X"" == X ]]; then + echo good 5 +fi + +case x"" in + x) echo 'ok 1' + ;; + x??) echo 'this would be really odd' + ;; + x?) echo 'does this prove anything?' + echo x""x + ;; + *) echo 'no match' + ;; +esac + +if [[ x"" == x ]]; then + echo ok 2 +fi + +if [[ x"" == x"" ]]; then + echo ok 3 +else + echo bad 3 +fi + +case x"" in +x"") echo ok 4 ;; +*) echo bad 4;; +esac + +if [[ x"" == x"" ]]; then + echo ok 5 +else + echo bad 5 +fi + +case x"" in +"x") echo ok 6 ;; +*) echo bad 6;; +esac + +case x"" in +"x") echo CTLNUL 7 ;; +x) echo ok 7 ;; +*) echo bad 7 ;; +esac diff --git a/tests/rsh.right b/tests/rsh.right new file mode 100644 index 0000000..022b2ca --- /dev/null +++ b/tests/rsh.right @@ -0,0 +1,13 @@ +./rsh.tests: line 9: cd: restricted +./rsh.tests: line 10: PATH: readonly variable +./rsh.tests: line 11: SHELL: readonly variable +./rsh.tests: line 12: /bin/sh: restricted: cannot specify `/' in command names +./rsh.tests: line 14: .: ./source.sub3: restricted +./rsh.tests: line 17: /tmp/restricted: restricted: cannot redirect output +./rsh.tests: line 21: /tmp/restricted: restricted: cannot redirect output +./rsh.tests: line 26: command: -p: restricted +./rsh.tests: line 28: set: +r: invalid option +set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...] +./rsh.tests: line 29: set: restricted: invalid option name +./rsh.tests: line 31: exec: restricted +./rsh.tests: after exec diff --git a/tests/rsh.tests b/tests/rsh.tests new file mode 100644 index 0000000..ffdf6e5 --- /dev/null +++ b/tests/rsh.tests @@ -0,0 +1,33 @@ +# test restricted shell mode -- these should all be errors +# +# things not tested for: +# adding builtins dynamically with enable -f +# importing function definitions from environment + +set -r + +cd / +PATH=$PATH:/usr/local/bin +SHELL=/bin/sh +/bin/sh -c 'echo /bin/sh executed' + +. ./source.sub3 + +rm -f /tmp/restricted +echo abc > /tmp/restricted +if [ -f /tmp/restricted ]; then + echo oops 1 -- output +fi +echo abc >> /tmp/restricted +if [ -f /tmp/restricted ]; then + echo oops 2 -- append +fi + +command -p date + +set +r +set +o restricted + +exec /bin/date + +echo $0: after exec diff --git a/tests/run-alias b/tests/run-alias new file mode 100644 index 0000000..6a20b06 --- /dev/null +++ b/tests/run-alias @@ -0,0 +1,2 @@ +${THIS_SH} ./alias.tests > /tmp/xx 2>&1 +diff /tmp/xx alias.right && rm -f /tmp/xx diff --git a/tests/run-all b/tests/run-all new file mode 100644 index 0000000..d3f3a0e --- /dev/null +++ b/tests/run-all @@ -0,0 +1,29 @@ +#! /bin/sh + +PATH=.:$PATH # just to get recho/zecho/printenv if not run via `make tests' +export PATH + +# unset BASH_ENV only if it is set +[ "${BASH_ENV+set}" = "set" ] && unset BASH_ENV +# ditto for SHELLOPTS +#[ "${SHELLOPTS+set}" = "set" ] && unset SHELLOPTS + +: ${THIS_SH:=../bash} +export THIS_SH + +${THIS_SH} ./version + +rm -f /tmp/xx + +echo Any output from any test, unless otherwise noted, indicates a possible anomaly + +for x in run-* +do + case $x in + $0|run-minimal|run-gprof) ;; + *.orig|*~) ;; + *) echo $x ; sh $x ;; + esac +done + +exit 0 diff --git a/tests/run-appendop b/tests/run-appendop new file mode 100644 index 0000000..c5bffbc --- /dev/null +++ b/tests/run-appendop @@ -0,0 +1,2 @@ +${THIS_SH} ./appendop.tests > /tmp/xx 2>&1 +diff /tmp/xx appendop.right && rm -f /tmp/xx diff --git a/tests/run-arith b/tests/run-arith new file mode 100644 index 0000000..f9f573c --- /dev/null +++ b/tests/run-arith @@ -0,0 +1,2 @@ +${THIS_SH} ./arith.tests > /tmp/xx 2>&1 +diff /tmp/xx arith.right && rm -f /tmp/xx diff --git a/tests/run-arith-for b/tests/run-arith-for new file mode 100644 index 0000000..1d13075 --- /dev/null +++ b/tests/run-arith-for @@ -0,0 +1,2 @@ +${THIS_SH} ./arith-for.tests > /tmp/xx 2>&1 +diff /tmp/xx arith-for.right && rm -f /tmp/xx diff --git a/tests/run-array b/tests/run-array new file mode 100644 index 0000000..6fdbae4 --- /dev/null +++ b/tests/run-array @@ -0,0 +1,6 @@ +echo "warning: all of these tests will fail if arrays have not" >&2 +echo "warning: been compiled into the shell" >&2 +echo "warning: the BASH_ARGC and BASH_ARGV tests will fail if debugging support" >&2 +echo "warning: has not been compiled into the shell" >&2 +${THIS_SH} ./array.tests > /tmp/xx 2>&1 +diff /tmp/xx array.right && rm -f /tmp/xx diff --git a/tests/run-array2 b/tests/run-array2 new file mode 100644 index 0000000..dd94ec8 --- /dev/null +++ b/tests/run-array2 @@ -0,0 +1,4 @@ +echo "warning: all of these tests will fail if arrays have not" >&2 +echo "warning: been compiled into the shell" >&2 +${THIS_SH} ./array-at-star > /tmp/xx 2>&1 +diff /tmp/xx array2.right && rm -f /tmp/xx diff --git a/tests/run-assoc b/tests/run-assoc new file mode 100644 index 0000000..18c3a9c --- /dev/null +++ b/tests/run-assoc @@ -0,0 +1,4 @@ +echo "warning: all of these tests will fail if arrays have not" >&2 +echo "warning: been compiled into the shell" >&2 +${THIS_SH} ./assoc.tests > /tmp/xx 2>&1 +diff /tmp/xx assoc.right && rm -f /tmp/xx diff --git a/tests/run-braces b/tests/run-braces new file mode 100644 index 0000000..53d4f1b --- /dev/null +++ b/tests/run-braces @@ -0,0 +1,2 @@ +${THIS_SH} ./braces.tests > /tmp/xx +diff /tmp/xx braces.right && rm -f /tmp/xx diff --git a/tests/run-builtins b/tests/run-builtins new file mode 100644 index 0000000..db88c8c --- /dev/null +++ b/tests/run-builtins @@ -0,0 +1,6 @@ +echo "warning: some of these tests may fail if process substitution has not" >&2 +echo "warning: been compiled into the shell or if the OS does not provide" >&2 +echo "warning: /dev/fd." >&2 + +${THIS_SH} ./builtins.tests > /tmp/xx 2>&1 +diff /tmp/xx builtins.right && rm -f /tmp/xx diff --git a/tests/run-case b/tests/run-case new file mode 100644 index 0000000..71d9b83 --- /dev/null +++ b/tests/run-case @@ -0,0 +1,2 @@ +${THIS_SH} ./case.tests > /tmp/xx 2>&1 +diff /tmp/xx case.right && rm -f /tmp/xx diff --git a/tests/run-casemod b/tests/run-casemod new file mode 100644 index 0000000..83c1b5a --- /dev/null +++ b/tests/run-casemod @@ -0,0 +1,2 @@ +${THIS_SH} ./casemod.tests > /tmp/xx 2>&1 +diff /tmp/xx casemod.right && rm -f /tmp/xx diff --git a/tests/run-comsub b/tests/run-comsub new file mode 100644 index 0000000..0bbcad5 --- /dev/null +++ b/tests/run-comsub @@ -0,0 +1,2 @@ +${THIS_SH} ./comsub.tests > /tmp/xx 2>&1 +diff /tmp/xx comsub.right && rm -f /tmp/xx diff --git a/tests/run-comsub-eof b/tests/run-comsub-eof new file mode 100644 index 0000000..5c006be --- /dev/null +++ b/tests/run-comsub-eof @@ -0,0 +1,2 @@ +${THIS_SH} ./comsub-eof.tests > /tmp/xx 2>&1 +diff /tmp/xx comsub-eof.right && rm -f /tmp/xx diff --git a/tests/run-comsub-posix b/tests/run-comsub-posix new file mode 100644 index 0000000..38bf8ee --- /dev/null +++ b/tests/run-comsub-posix @@ -0,0 +1,2 @@ +${THIS_SH} ./comsub-posix.tests > /tmp/xx 2>&1 +diff /tmp/xx comsub-posix.right && rm -f /tmp/xx diff --git a/tests/run-cond b/tests/run-cond new file mode 100644 index 0000000..6b119a6 --- /dev/null +++ b/tests/run-cond @@ -0,0 +1,7 @@ +echo "warning: all of these tests will fail if the conditional command has not" >&2 +echo "warning: been compiled into the shell" >&2 +echo "warning: some of these tests will fail if extended pattern matching has not" >&2 +echo "warning: been compiled into the shell" >&2 + +${THIS_SH} ./cond.tests > /tmp/xx 2>&1 +diff /tmp/xx cond.right && rm -f /tmp/xx diff --git a/tests/run-coproc b/tests/run-coproc new file mode 100644 index 0000000..ce62474 --- /dev/null +++ b/tests/run-coproc @@ -0,0 +1,4 @@ +echo "warning: the process IDs printed will differ on every run" >&2 +echo "warning: and generate diffs" >&2 +${THIS_SH} ./coproc.tests > /tmp/xx 2>&1 +diff /tmp/xx coproc.right && rm -f /tmp/xx diff --git a/tests/run-cprint b/tests/run-cprint new file mode 100644 index 0000000..5f202e4 --- /dev/null +++ b/tests/run-cprint @@ -0,0 +1,2 @@ +${THIS_SH} ./cprint.tests > /tmp/xx 2>&1 +diff /tmp/xx cprint.right && rm -f /tmp/xx diff --git a/tests/run-dbg-support b/tests/run-dbg-support new file mode 100755 index 0000000..9e9c649 --- /dev/null +++ b/tests/run-dbg-support @@ -0,0 +1,11 @@ +#!../bash +#$Id: run-dbg-support,v 1.5 2002/11/14 06:08:16 rockyb Exp $ + +TEST_NAME='dbg-support' +TEST_FILE="/tmp/${TEST_NAME}.check" +${THIS_SH} ./${TEST_NAME}.tests > $TEST_FILE 2>&1 < /dev/null +set -f +diff $TEST_FILE ${TEST_NAME}.right && rm -f $TEST_FILE + +# Return code tells testing mechanism whether passed or not. +exit $? diff --git a/tests/run-dbg-support2 b/tests/run-dbg-support2 new file mode 100755 index 0000000..f62583f --- /dev/null +++ b/tests/run-dbg-support2 @@ -0,0 +1,16 @@ +#!../bash +#$Id: run-dbg-support2,v 1.3 2002/11/14 06:08:16 rockyb Exp $ + +TEST_NAME='dbg-support2' +TEST_FILE="/tmp/${TEST_NAME}.check" +${THIS_SH} ./${TEST_NAME}.tests > $TEST_FILE 2>&1 < /dev/null +set -f +diff $TEST_FILE ${TEST_NAME}.right && rm -f $TEST_FILE + +# Return code tells testing mechanism whether passed or not. +exit $? + +#;;; Local Variables: *** +#;;; mode:shell-script *** +#;;; eval: (sh-set-shell "bash") *** +#;;; End: *** diff --git a/tests/run-dirstack b/tests/run-dirstack new file mode 100644 index 0000000..6390d1b --- /dev/null +++ b/tests/run-dirstack @@ -0,0 +1,5 @@ +${THIS_SH} ./dstack.tests > /tmp/xx 2>&1 +diff /tmp/xx dstack.right && rm -f /tmp/xx + +${THIS_SH} ./dstack2.tests > /tmp/xx 2>&1 +diff /tmp/xx dstack2.right && rm -f /tmp/xx diff --git a/tests/run-dollars b/tests/run-dollars new file mode 100644 index 0000000..0ced414 --- /dev/null +++ b/tests/run-dollars @@ -0,0 +1,2 @@ +${THIS_SH} ./dollar-at-star > /tmp/xx 2>&1 +diff /tmp/xx dollar.right && rm -f /tmp/xx diff --git a/tests/run-errors b/tests/run-errors new file mode 100644 index 0000000..6be4e0c --- /dev/null +++ b/tests/run-errors @@ -0,0 +1,2 @@ +${THIS_SH} ./errors.tests > /tmp/xx 2>&1 +diff /tmp/xx errors.right && rm -f /tmp/xx diff --git a/tests/run-execscript b/tests/run-execscript new file mode 100644 index 0000000..f97ab21 --- /dev/null +++ b/tests/run-execscript @@ -0,0 +1,9 @@ +echo "warning: the text of a system error message may vary between systems and" >&2 +echo "warning: produce diff output." >&2 +echo "warning: if the text of the error messages concerning \`notthere' or" >&2 +echo "warning: \`/tmp/bash-notthere' not being found or \`/' being a directory" >&2 +echo "warning: produce diff output, please do not consider this a test failure" >&2 +echo "warning: if diff output differing only in the location of the bash" >&2 +echo "warning: binary appears, please do not consider this a test failure" >&2 +${THIS_SH} ./execscript > /tmp/xx 2>&1 +diff /tmp/xx exec.right && rm -f /tmp/xx diff --git a/tests/run-exp-tests b/tests/run-exp-tests new file mode 100644 index 0000000..cbabace --- /dev/null +++ b/tests/run-exp-tests @@ -0,0 +1,2 @@ +${THIS_SH} ./exp.tests | grep -v '^expect' > /tmp/xx +diff /tmp/xx exp.right && rm -f /tmp/xx diff --git a/tests/run-extglob b/tests/run-extglob new file mode 100644 index 0000000..06316ad --- /dev/null +++ b/tests/run-extglob @@ -0,0 +1,4 @@ +PATH=$PATH:`pwd` +export PATH +${THIS_SH} ./extglob.tests | grep -v '^expect' > /tmp/xx +diff /tmp/xx extglob.right && rm -f /tmp/xx diff --git a/tests/run-extglob2 b/tests/run-extglob2 new file mode 100644 index 0000000..0a6f728 --- /dev/null +++ b/tests/run-extglob2 @@ -0,0 +1,4 @@ +PATH=$PATH:`pwd` +export PATH +${THIS_SH} ./extglob2.tests | grep -v '^expect' > /tmp/xx +diff /tmp/xx extglob2.right && rm -f /tmp/xx diff --git a/tests/run-extglob3 b/tests/run-extglob3 new file mode 100644 index 0000000..2675196 --- /dev/null +++ b/tests/run-extglob3 @@ -0,0 +1,4 @@ +PATH=$PATH:`pwd` +export PATH +${THIS_SH} ./extglob3.tests > /tmp/xx +diff /tmp/xx extglob3.right && rm -f /tmp/xx diff --git a/tests/run-func b/tests/run-func new file mode 100644 index 0000000..f449eb8 --- /dev/null +++ b/tests/run-func @@ -0,0 +1,5 @@ +echo "warning: if you have exported functions defined in your environment," >&2 +echo "warning: they may show up as diff output." >&2 +echo "warning: if so, please do not consider this a test failure" >&2 +${THIS_SH} ./func.tests > /tmp/xx 2>&1 +diff /tmp/xx func.right && rm -f /tmp/xx diff --git a/tests/run-getopts b/tests/run-getopts new file mode 100644 index 0000000..1e8b5fb --- /dev/null +++ b/tests/run-getopts @@ -0,0 +1,2 @@ +${THIS_SH} ./getopts.tests > /tmp/xx 2>&1 +diff /tmp/xx getopts.right && rm -f /tmp/xx diff --git a/tests/run-glob-test b/tests/run-glob-test new file mode 100644 index 0000000..7a12343 --- /dev/null +++ b/tests/run-glob-test @@ -0,0 +1,4 @@ +PATH=$PATH:`pwd` +export PATH +${THIS_SH} ./glob.tests 2>&1 | grep -v '^expect' > /tmp/xx +diff /tmp/xx glob.right && rm -f /tmp/xx diff --git a/tests/run-globstar b/tests/run-globstar new file mode 100644 index 0000000..d12cce9 --- /dev/null +++ b/tests/run-globstar @@ -0,0 +1,4 @@ +PATH=$PATH:`pwd` +export PATH +${THIS_SH} ./globstar.tests > /tmp/xx 2>&1 +diff /tmp/xx globstar.right && rm -f /tmp/xx diff --git a/tests/run-heredoc b/tests/run-heredoc new file mode 100644 index 0000000..456453a --- /dev/null +++ b/tests/run-heredoc @@ -0,0 +1,6 @@ +echo "warning: UNIX versions number signals and schedule processes differently." >&2 +echo "warning: If output differing only in line numbers is produced, please" >&2 +echo "warning: do not consider this a test failure." >&2 + +${THIS_SH} ./heredoc.tests > /tmp/xx 2>&1 +diff /tmp/xx heredoc.right && rm -f /tmp/xx diff --git a/tests/run-herestr b/tests/run-herestr new file mode 100644 index 0000000..8c5b36d --- /dev/null +++ b/tests/run-herestr @@ -0,0 +1,2 @@ +${THIS_SH} ./herestr.tests > /tmp/xx 2>&1 +diff /tmp/xx herestr.right && rm -f /tmp/xx diff --git a/tests/run-histexpand b/tests/run-histexpand new file mode 100644 index 0000000..06a415b --- /dev/null +++ b/tests/run-histexpand @@ -0,0 +1,4 @@ +echo "warning: all of these tests will fail if history has not been compiled" >&2 +echo "warning: into the shell" >&2 +${THIS_SH} ./histexp.tests > /tmp/xx 2>&1 +diff /tmp/xx histexp.right && rm -f /tmp/xx diff --git a/tests/run-history b/tests/run-history new file mode 100644 index 0000000..ea356b1 --- /dev/null +++ b/tests/run-history @@ -0,0 +1,4 @@ +echo "warning: all of these tests will fail if history has not been compiled" >&2 +echo "warning: into the shell" >&2 +${THIS_SH} ./history.tests > /tmp/xx 2>&1 +diff /tmp/xx history.right && rm -f /tmp/xx diff --git a/tests/run-ifs b/tests/run-ifs new file mode 100644 index 0000000..3f9d820 --- /dev/null +++ b/tests/run-ifs @@ -0,0 +1,2 @@ +${THIS_SH} ./ifs.tests > /tmp/xx 2>&1 +diff /tmp/xx ifs.right && rm -f /tmp/xx diff --git a/tests/run-ifs-posix b/tests/run-ifs-posix new file mode 100644 index 0000000..e578e8d --- /dev/null +++ b/tests/run-ifs-posix @@ -0,0 +1,2 @@ +${THIS_SH} ./ifs-posix.tests > /tmp/xx 2>&1 +diff /tmp/xx ifs-posix.right && rm -f /tmp/xx diff --git a/tests/run-input-test b/tests/run-input-test new file mode 100644 index 0000000..aaa5d35 --- /dev/null +++ b/tests/run-input-test @@ -0,0 +1,2 @@ +${THIS_SH} < ./input-line.sh > /tmp/xx +diff /tmp/xx input.right && rm -f /tmp/xx diff --git a/tests/run-intl b/tests/run-intl new file mode 100644 index 0000000..6a9234a --- /dev/null +++ b/tests/run-intl @@ -0,0 +1,8 @@ +# See whether or not we can use `diff -a' +( diff -a ./intl.right ./intl.right >/dev/null 2>&1 ) && AFLAG=-a + +echo "warning: some of these tests will fail if you do not have UTF-8" >&2 +echo "warning: locales installed on your system." >&2 +echo "warning: please ignore any differences consisting only of white space" >&2 +${THIS_SH} ./intl.tests > /tmp/xx +diff $AFLAG /tmp/xx intl.right && rm -f /tmp/xx diff --git a/tests/run-invert b/tests/run-invert new file mode 100644 index 0000000..4949307 --- /dev/null +++ b/tests/run-invert @@ -0,0 +1,2 @@ +${THIS_SH} ./invert.tests 2>&1 | grep -v '^expect' > /tmp/xx +diff /tmp/xx invert.right && rm -f /tmp/xx diff --git a/tests/run-iquote b/tests/run-iquote new file mode 100644 index 0000000..61a8aa7 --- /dev/null +++ b/tests/run-iquote @@ -0,0 +1,2 @@ +${THIS_SH} ./iquote.tests >/tmp/xx 2>&1 +diff /tmp/xx iquote.right && rm -f /tmp/xx diff --git a/tests/run-jobs b/tests/run-jobs new file mode 100644 index 0000000..bfd4fa0 --- /dev/null +++ b/tests/run-jobs @@ -0,0 +1,7 @@ +echo "warning: some of these tests may fail if job control has not been compiled" >&2 +echo "warning: into the shell" >&2 +echo "warning: there may be a message regarding a cat process dying due to a" >&2 +echo "warning: SIGHUP. Please disregard." >&2 + +${THIS_SH} ./jobs.tests > /tmp/xx 2>&1 +diff /tmp/xx jobs.right && rm -f /tmp/xx diff --git a/tests/run-lastpipe b/tests/run-lastpipe new file mode 100644 index 0000000..92ac030 --- /dev/null +++ b/tests/run-lastpipe @@ -0,0 +1,2 @@ +${THIS_SH} ./lastpipe.tests > /tmp/xx 2>&1 +diff /tmp/xx lastpipe.right && rm -f /tmp/xx diff --git a/tests/run-mapfile b/tests/run-mapfile new file mode 100644 index 0000000..a207f09 --- /dev/null +++ b/tests/run-mapfile @@ -0,0 +1,2 @@ +${THIS_SH} ./mapfile.tests > /tmp/xx 2>&1 +diff /tmp/xx mapfile.right && rm -f /tmp/xx diff --git a/tests/run-minimal b/tests/run-minimal new file mode 100644 index 0000000..de98344 --- /dev/null +++ b/tests/run-minimal @@ -0,0 +1,36 @@ +#! /bin/sh +# +# run-minimal - a version of run-all for shells configured with +# --enable-minimal-config +# +PATH=.:$PATH # just to get the right version of printenv +export PATH + +# unset BASH_ENV only if it is set +[ "${BASH_ENV+set}" = "set" ] && unset BASH_ENV +# ditto for SHELLOPTS +#[ "${SHELLOPTS+set}" = "set" ] && unset SHELLOPTS + +: ${THIS_SH:=../bash} +export THIS_SH + +${THIS_SH} ./version.mini + +rm -f /tmp/xx + +echo Testing ${THIS_SH} +echo Any output from any test, unless otherwise noted, indicates a possible anomaly +for x in run-* +do + case $x in + $0) ;; + *.orig|*~) ;; + run-dollars|run-execscript|run-func|run-getopts|run-heredoc) echo $x ; sh $x ;; + run-ifs-tests|run-input-test|run-invert|run-more-exp|run-nquote) echo $x ; sh $x ;; + run-ifs-posix|run-posix2|run-posixpat|run-posixpipe) echo $x ; sh $x ;; + run-precedence|run-quote|run-read|run-rhs-exp|run-strip|run-tilde) echo $x ; sh $x ;; + *) ;; + esac +done + +exit 0 diff --git a/tests/run-more-exp b/tests/run-more-exp new file mode 100644 index 0000000..60f55cb --- /dev/null +++ b/tests/run-more-exp @@ -0,0 +1,2 @@ +${THIS_SH} ./more-exp.tests 2>&1 | grep -v '^expect' > /tmp/xx +diff /tmp/xx more-exp.right && rm -f /tmp/xx diff --git a/tests/run-nameref b/tests/run-nameref new file mode 100644 index 0000000..40f00d5 --- /dev/null +++ b/tests/run-nameref @@ -0,0 +1,4 @@ +echo "warning: some of these tests will fail if arrays have not" >&2 +echo "warning: been compiled into the shell" >&2 +${THIS_SH} ./nameref.tests > /tmp/xx 2>&1 +diff /tmp/xx nameref.right && rm -f /tmp/xx diff --git a/tests/run-new-exp b/tests/run-new-exp new file mode 100644 index 0000000..2e3d7c9 --- /dev/null +++ b/tests/run-new-exp @@ -0,0 +1,10 @@ +echo "warning: two of these tests will fail if your OS does not support" >&2 +echo "warning: named pipes or the /dev/fd filesystem. If the tests of the" >&2 +echo "warning: process substitution mechanism fail, please do not consider" >&2 +echo "warning: this a test failure" >&2 +echo "warning: if you have exported variables beginning with the string _Q," >&2 +echo "warning: diff output may be generated. If so, please do not consider" >&2 +echo "warning: this a test failure" >&2 + +${THIS_SH} ./new-exp.tests 2>&1 | grep -v '^expect' > /tmp/xx +diff /tmp/xx new-exp.right && rm -f /tmp/xx diff --git a/tests/run-nquote b/tests/run-nquote new file mode 100644 index 0000000..006872c --- /dev/null +++ b/tests/run-nquote @@ -0,0 +1,2 @@ +${THIS_SH} ./nquote.tests 2>&1 | grep -v '^expect' > /tmp/xx +diff /tmp/xx nquote.right && rm -f /tmp/xx diff --git a/tests/run-nquote1 b/tests/run-nquote1 new file mode 100644 index 0000000..a71740f --- /dev/null +++ b/tests/run-nquote1 @@ -0,0 +1,4 @@ +echo "warning: several of these tests will fail if arrays have not" >&2 +echo "warning: been compiled into the shell." >&2 +${THIS_SH} ./nquote1.tests 2>&1 | grep -v '^expect' > /tmp/xx +diff /tmp/xx nquote1.right && rm -f /tmp/xx diff --git a/tests/run-nquote2 b/tests/run-nquote2 new file mode 100644 index 0000000..80d1a8d --- /dev/null +++ b/tests/run-nquote2 @@ -0,0 +1,4 @@ +echo "warning: several of these tests will fail if arrays have not" >&2 +echo "warning: been compiled into the shell." >&2 +${THIS_SH} ./nquote2.tests 2>&1 | grep -v '^expect' > /tmp/xx +diff /tmp/xx nquote2.right && rm -f /tmp/xx diff --git a/tests/run-nquote3 b/tests/run-nquote3 new file mode 100644 index 0000000..45ba5f7 --- /dev/null +++ b/tests/run-nquote3 @@ -0,0 +1,4 @@ +echo "warning: several of these tests will fail if arrays have not" >&2 +echo "warning: been compiled into the shell." >&2 +${THIS_SH} ./nquote3.tests 2>&1 | grep -v '^expect' > /tmp/xx +diff /tmp/xx nquote3.right && rm -f /tmp/xx diff --git a/tests/run-nquote4 b/tests/run-nquote4 new file mode 100644 index 0000000..493f4aa --- /dev/null +++ b/tests/run-nquote4 @@ -0,0 +1,4 @@ +echo warning: some of these tests will fail if you do not have UTF-8 >&2 +echo warning: locales installed on your system >&2 +${THIS_SH} ./nquote4.tests 2>&1 | grep -v '^expect' > /tmp/xx +diff /tmp/xx nquote4.right && rm -f /tmp/xx diff --git a/tests/run-nquote5 b/tests/run-nquote5 new file mode 100644 index 0000000..14cef64 --- /dev/null +++ b/tests/run-nquote5 @@ -0,0 +1,2 @@ +${THIS_SH} ./nquote5.tests 2>&1 | grep -v '^expect' > /tmp/xx +diff /tmp/xx nquote5.right && rm -f /tmp/xx diff --git a/tests/run-posix2 b/tests/run-posix2 new file mode 100644 index 0000000..52eea2f --- /dev/null +++ b/tests/run-posix2 @@ -0,0 +1,2 @@ +${THIS_SH} ./posix2.tests 2>&1 | grep -v '^expect' > /tmp/xx +diff /tmp/xx posix2.right && rm -f /tmp/xx diff --git a/tests/run-posixexp b/tests/run-posixexp new file mode 100644 index 0000000..e5a1c3e --- /dev/null +++ b/tests/run-posixexp @@ -0,0 +1,2 @@ +${THIS_SH} ./posixexp.tests > /tmp/xx 2>&1 +diff /tmp/xx posixexp.right && rm -f /tmp/xx diff --git a/tests/run-posixexp2 b/tests/run-posixexp2 new file mode 100644 index 0000000..9a2890f --- /dev/null +++ b/tests/run-posixexp2 @@ -0,0 +1,2 @@ +${THIS_SH} ./posixexp2.tests > /tmp/xx 2>&1 +diff /tmp/xx posixexp2.right && rm -f /tmp/xx diff --git a/tests/run-posixpat b/tests/run-posixpat new file mode 100644 index 0000000..ef2b140 --- /dev/null +++ b/tests/run-posixpat @@ -0,0 +1,2 @@ +${THIS_SH} ./posixpat.tests > /tmp/xx +diff /tmp/xx posixpat.right && rm -f /tmp/xx diff --git a/tests/run-posixpipe b/tests/run-posixpipe new file mode 100644 index 0000000..c574535 --- /dev/null +++ b/tests/run-posixpipe @@ -0,0 +1,2 @@ +${THIS_SH} ./posixpipe.tests > /tmp/xx 2>&1 +diff /tmp/xx posixpipe.right && rm -f /tmp/xx diff --git a/tests/run-precedence b/tests/run-precedence new file mode 100644 index 0000000..d81a868 --- /dev/null +++ b/tests/run-precedence @@ -0,0 +1,2 @@ +${THIS_SH} ./precedence > /tmp/xx +diff /tmp/xx prec.right && rm -f /tmp/xx diff --git a/tests/run-printf b/tests/run-printf new file mode 100644 index 0000000..7b152a1 --- /dev/null +++ b/tests/run-printf @@ -0,0 +1,7 @@ +# See whether or not we can use `diff -a' +#( diff -a ./printf.tests ./printf.tests >/dev/null 2>&1 ) && AFLAG=-a + +# use cat -v (and assume it's there) to make control chars visible +${THIS_SH} ./printf.tests 2>&1 | cat -v > /tmp/xx +#diff $AFLAG /tmp/xx printf.right && rm -f /tmp/xx +diff /tmp/xx printf.right && rm -f /tmp/xx diff --git a/tests/run-quote b/tests/run-quote new file mode 100644 index 0000000..6905042 --- /dev/null +++ b/tests/run-quote @@ -0,0 +1,2 @@ +${THIS_SH} ./quote.tests >/tmp/xx 2>&1 +diff /tmp/xx quote.right && rm -f /tmp/xx diff --git a/tests/run-read b/tests/run-read new file mode 100644 index 0000000..47e4188 --- /dev/null +++ b/tests/run-read @@ -0,0 +1,4 @@ +echo "warning: please do not consider output differing only in the amount of" >&2 +echo "warning: white space to be an error." >&2 +${THIS_SH} ./read.tests > /tmp/xx 2>&1 +diff /tmp/xx read.right && rm -f /tmp/xx diff --git a/tests/run-redir b/tests/run-redir new file mode 100644 index 0000000..2be45dd --- /dev/null +++ b/tests/run-redir @@ -0,0 +1,7 @@ +echo "warning: the text of a system error message may vary between systems and" >&2 +echo "warning: produce diff output." >&2 +echo "warning: if the text of an error message concerning \`redir1.*' not being" >&2 +echo "warning: found or messages concerning bad file descriptors produce diff" >&2 +echo "warning: output, please do not consider it a test failure" >&2 +${THIS_SH} ./redir.tests > /tmp/xx 2>&1 +diff /tmp/xx redir.right && rm -f /tmp/xx diff --git a/tests/run-rhs-exp b/tests/run-rhs-exp new file mode 100644 index 0000000..1f89d0b --- /dev/null +++ b/tests/run-rhs-exp @@ -0,0 +1,2 @@ +${THIS_SH} ./rhs-exp.tests 2>&1 > /tmp/xx +diff /tmp/xx rhs-exp.right && rm -f /tmp/xx diff --git a/tests/run-rsh b/tests/run-rsh new file mode 100644 index 0000000..ef23583 --- /dev/null +++ b/tests/run-rsh @@ -0,0 +1,2 @@ +${THIS_SH} ./rsh.tests > /tmp/xx 2>&1 +diff /tmp/xx rsh.right && rm -f /tmp/xx diff --git a/tests/run-set-e b/tests/run-set-e new file mode 100644 index 0000000..3389f11 --- /dev/null +++ b/tests/run-set-e @@ -0,0 +1,2 @@ +${THIS_SH} ./set-e.tests > /tmp/xx +diff /tmp/xx set-e.right && rm -f /tmp/xx diff --git a/tests/run-set-x b/tests/run-set-x new file mode 100755 index 0000000..b999e69 --- /dev/null +++ b/tests/run-set-x @@ -0,0 +1,11 @@ +#!../bash +#$Id: run-set-x,v 1.1 2002/12/09 13:12:37 rockyb Exp $ + +TEST_NAME='set-x' +TEST_FILE="/tmp/${TEST_NAME}.check" +${THIS_SH} ./${TEST_NAME}.tests > $TEST_FILE 2>&1 < /dev/null +set -f +diff $TEST_FILE ${TEST_NAME}.right && rm -f $TEST_FILE + +# Return code tells testing mechanism whether passed or not. +exit $? diff --git a/tests/run-shopt b/tests/run-shopt new file mode 100644 index 0000000..100a3de --- /dev/null +++ b/tests/run-shopt @@ -0,0 +1,2 @@ +${THIS_SH} ./shopt.tests > /tmp/xx 2>&1 +diff /tmp/xx shopt.right && rm -f /tmp/xx diff --git a/tests/run-strip b/tests/run-strip new file mode 100644 index 0000000..0d32115 --- /dev/null +++ b/tests/run-strip @@ -0,0 +1,2 @@ +${THIS_SH} ./strip.tests > /tmp/xx +diff /tmp/xx strip.right && rm -f /tmp/xx diff --git a/tests/run-test b/tests/run-test new file mode 100644 index 0000000..b2482c3 --- /dev/null +++ b/tests/run-test @@ -0,0 +1,4 @@ +unset GROUPS UID 2>/dev/null + +${THIS_SH} ./test.tests >/tmp/xx 2>&1 +diff /tmp/xx test.right && rm -f /tmp/xx diff --git a/tests/run-tilde b/tests/run-tilde new file mode 100644 index 0000000..b8569c1 --- /dev/null +++ b/tests/run-tilde @@ -0,0 +1,2 @@ +${THIS_SH} ./tilde.tests > /tmp/xx +diff /tmp/xx tilde.right && rm -f /tmp/xx diff --git a/tests/run-tilde2 b/tests/run-tilde2 new file mode 100644 index 0000000..4446989 --- /dev/null +++ b/tests/run-tilde2 @@ -0,0 +1,2 @@ +${THIS_SH} ./tilde2.tests > /tmp/xx +diff /tmp/xx tilde2.right && rm -f /tmp/xx diff --git a/tests/run-trap b/tests/run-trap new file mode 100644 index 0000000..14f6874 --- /dev/null +++ b/tests/run-trap @@ -0,0 +1,6 @@ +echo "warning: UNIX versions number signals and schedule processes differently." >&2 +echo "warning: If output differing only in line numbers is produced, please" >&2 +echo "warning: do not consider this a test failure." >&2 + +${THIS_SH} ./trap.tests > /tmp/xx 2>&1 +diff /tmp/xx trap.right && rm -f /tmp/xx diff --git a/tests/run-type b/tests/run-type new file mode 100644 index 0000000..4d195b0 --- /dev/null +++ b/tests/run-type @@ -0,0 +1,2 @@ +${THIS_SH} ./type.tests > /tmp/xx 2>&1 +diff /tmp/xx type.right && rm -f /tmp/xx diff --git a/tests/run-varenv b/tests/run-varenv new file mode 100644 index 0000000..f0ce195 --- /dev/null +++ b/tests/run-varenv @@ -0,0 +1,2 @@ +${THIS_SH} ./varenv.sh | grep -v '^expect' > /tmp/xx +diff /tmp/xx varenv.right && rm -f /tmp/xx diff --git a/tests/run-vredir b/tests/run-vredir new file mode 100644 index 0000000..9a96377 --- /dev/null +++ b/tests/run-vredir @@ -0,0 +1,2 @@ +${THIS_SH} ./vredir.tests > /tmp/xx 2>&1 +diff /tmp/xx vredir.right && rm -f /tmp/xx diff --git a/tests/set-e.right b/tests/set-e.right new file mode 100644 index 0000000..e2a9f2c --- /dev/null +++ b/tests/set-e.right @@ -0,0 +1,72 @@ +95 +96 +97 +98 +99 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +1 +1 +ok +hi +while succeeded +until succeeded: 4 +if succeeded +AND list succeeded +OR list succeeded +! succeeded +eval succeeded +! eval succeeded -- 1 +! eval succeeded -- 2 +a +0 +b +0 +after 1 +a +0 +non-posix foo +after brace group failure: 1 +A 1 +B 0 +C 0 +D 0 +D 1 +A 1 +B 0 +C 0 +D 0 +D 1 +A 1 +B 0 +C 0 +A 1 +B 1 +C 0 +B 0 +C 0 +after negation 1: 0 +after negation 2: 0 +after negation 3: 1 +after negation 4: 0 +after brace pipeline +foo +after failure 1 +after failure 2 +after failure 3 +true || false no exit +false || true no exit +false && false no exit +A: +B: +ehB +C: +D: diff --git a/tests/set-e.tests b/tests/set-e.tests new file mode 100644 index 0000000..d38edf6 --- /dev/null +++ b/tests/set-e.tests @@ -0,0 +1,111 @@ +if : ; then + set -e + N=95 + while :; do + # expr returns 1 if expression is null or 0 + set +e + N_MOD_100=`expr $N % 100` + set -e + echo $N_MOD_100 + N=`expr $N + 1` + if [ $N -eq 110 ]; then + break + fi + done + set +e +fi + +( +set -e +false +echo bad +) +echo $? + +x=$( +set -e +false +echo bad +) +echo $? $x + +# command subst should not inherit -e +set -e +echo $(false; echo ok) + +if set +e +then + false +fi +echo hi + +set -e + +# a failing command in the compound list following a while, until, or +# if should not cause the shell to exit + +while false; do + echo hi +done +echo while succeeded + +x=1 +until (( x == 4 )); do + x=4 +done +echo until succeeded: $x + +if false; then + echo oops +fi +echo if succeeded + +# failing commands that are part of an AND or OR list should not +# cause the shell to exit +false && echo AND list failed +echo AND list succeeded + +false || echo OR list succeeded + +! false +echo ! succeeded + +# make sure eval preserves the state of the -e flag and `!' reserved word +set -e +if eval false; then + echo oops +fi +echo eval succeeded + +! eval false +echo ! eval succeeded -- 1 + +! eval '(exit 5)' +echo ! eval succeeded -- 2 + +set -e +until builtin false; do echo a; break; done +echo $? + +until eval false; do echo b; break; done +echo $? + +: ${TMPDIR:=/tmp} +FN=$TMPDIR/set-e-$$ +cat > $FN << EOF +false +echo after 1 +false +EOF + +set -e +until . $FN; do echo a; break; done +echo $? + +rm -f $FN + +set +e + +${THIS_SH} ./set-e1.sub +${THIS_SH} ./set-e2.sub +${THIS_SH} ./set-e3.sub diff --git a/tests/set-e1.sub b/tests/set-e1.sub new file mode 100644 index 0000000..a800560 --- /dev/null +++ b/tests/set-e1.sub @@ -0,0 +1,59 @@ +# subshell failure should cause the shell to exit silently +${THIS_SH} -ce '(exit 17) ; echo "after (exit 17): $?"' + +# pipeline failure should cause shell to exit silently +${THIS_SH} -c 'set -e ; false | echo foo | while read x ; do ( exit 17 ) ; done; echo after pipeline subshell;' + +# should be silent in posix mode +${THIS_SH} -c 'set -o posix; set -e ; z=$(false;echo posix foo) ; echo $z' +# but echo foo in non-posix +${THIS_SH} -c 'set -e ; z=$(false;echo non-posix foo) ; echo $z' + +${THIS_SH} -ce 'x=$(false) ; echo "x=\$(false) does not exit"' + +${THIS_SH} -ce '{ false; echo false in brace group does not exit; }' +echo after brace group failure: $? + +${THIS_SH} -ce '(false ; echo A $?) && echo B $?; echo C $?'; echo D $? + +${THIS_SH} -ce '(false ; echo A $?) ; echo B $?; echo C $?'; echo D $? + +${THIS_SH} -ce 'f() (false ; echo A $?); f && echo B $?; echo C $?'; echo D $? + +${THIS_SH} -ce 'f() (false ; echo A $?) ; f; echo B $?; echo C $?'; echo D $? + +${THIS_SH} -ce 'if false; echo A $?; then echo B $?; fi'; echo C $? + +${THIS_SH} -ce '! { false; echo A $?; } | cat; echo B $?'; echo C $? + +${THIS_SH} -ce '{ false; echo A $?; } | cat ; echo B $?'; echo C $? + +set -e + +! false +echo after negation 1: $? + +! false | false +echo after negation 2: $? + +! true +echo after negation 3: $? + +! (false) +echo after negation 4: $? + +{ false ; echo foo; } | cat +echo after brace pipeline + +false | echo foo | cat +echo after failure 1 + +false | (echo foo; false) | true +echo after failure 2 + +false | echo foo | while read x ; do ( exit 17 ) ; done | true +echo after failure 3 + +# this pipeline failure should cause the shell to exit +false | echo foo | false +echo after failure 4 diff --git a/tests/set-e2.sub b/tests/set-e2.sub new file mode 100644 index 0000000..de04e99 --- /dev/null +++ b/tests/set-e2.sub @@ -0,0 +1,10 @@ +${THIS_SH} -ce 'true || false ; echo "true || false no exit"' +${THIS_SH} -ce 'false || false ; echo "false || false no exit"' +${THIS_SH} -ce 'false || true ; echo "false || true no exit"' + +${THIS_SH} -ce 'false && false ; echo "false && false no exit"' +${THIS_SH} -ce 'true && false ; echo "true && false no exit"' + +${THIS_SH} -ce 'true && (exit 1) ; echo "true && (exit 1) no exit"' +${THIS_SH} -ce 'true && true|false ; echo "true && true|false no exit"' +${THIS_SH} -ce 'true && true|(false) ; echo "true && true|(false) no exit"' diff --git a/tests/set-e3.sub b/tests/set-e3.sub new file mode 100644 index 0000000..db176b1 --- /dev/null +++ b/tests/set-e3.sub @@ -0,0 +1,10 @@ +foo() +{ + echo A: + . ./set-e3a.sub + echo D: +} + +# should run all the way through; foo being called in a context where set -e +# is ignored means that that condition persists through sourcing the file +foo && true diff --git a/tests/set-e3a.sub b/tests/set-e3a.sub new file mode 100644 index 0000000..5d008e7 --- /dev/null +++ b/tests/set-e3a.sub @@ -0,0 +1,7 @@ +echo B: + +set -e +echo $- +false + +echo C: diff --git a/tests/set-x.right b/tests/set-x.right new file mode 100644 index 0000000..a41a382 --- /dev/null +++ b/tests/set-x.right @@ -0,0 +1,56 @@ ++ (( i=0 )) ++ (( i<=5 )) ++ x=0 ++ (( i++ )) ++ (( i<=5 )) ++ x=0 ++ (( i++ )) ++ (( i<=5 )) ++ x=0 ++ (( i++ )) ++ (( i<=5 )) ++ x=0 ++ (( i++ )) ++ (( i<=5 )) ++ x=0 ++ (( i++ )) ++ (( i<=5 )) ++ x=0 ++ (( i++ )) ++ (( i<=5 )) ++ for i in 0 1 2 ++ x=i ++ for i in 0 1 2 ++ x=i ++ for i in 0 1 2 ++ x=i ++ case x in ++ x=i ++ set +x +1 +2 +3 +4 ++ for f in a b c d e ++ echo a +a ++ for f in a b c d e ++ echo b +b ++ for f in a b c d e ++ echo c +c ++ for f in a b c d e ++ echo d +d ++ for f in a b c d e ++ echo e +e ++ set +x +TRACEFILE: ++ echo 1 ++ echo 2 ++ echo 3 ++ echo 4 ++ unset BASH_XTRACEFD +===== diff --git a/tests/set-x.tests b/tests/set-x.tests new file mode 100755 index 0000000..648f0a9 --- /dev/null +++ b/tests/set-x.tests @@ -0,0 +1,20 @@ +#!../bash +# $Id: set-x.tests,v 1.1 2002/12/09 13:12:37 rockyb Exp $ +# +# Test that "set -x" shows what we think it should. +# +set -x +for ((i=0; i<=5; i++ )) ; do + x=0 +done +for i in 0 1 2 ; do + x=i +done +case x in + 0) x=i ;; + *) x=i ;; +esac +set +x + +# test BASH_XTRACEFD +${THIS_SH} ./set-x1.sub diff --git a/tests/set-x1.sub b/tests/set-x1.sub new file mode 100644 index 0000000..b2aa216 --- /dev/null +++ b/tests/set-x1.sub @@ -0,0 +1,25 @@ +: ${TMPDIR:=/var/tmp} +TRACEFILE=$TMPDIR/bash-trace-$$ +trap 'rm -f $TRACEFILE' 0 1 2 3 6 15 + +exec 4>$TRACEFILE +BASH_XTRACEFD=4 + +set -x + +echo 1 +echo 2 +echo 3 +echo 4 + +unset BASH_XTRACEFD + +for f in a b c d e; do echo $f ; done + +set +x + +echo TRACEFILE: +cat $TRACEFILE +echo ===== + +exit 0 diff --git a/tests/shopt.right b/tests/shopt.right new file mode 100644 index 0000000..0a7edfb --- /dev/null +++ b/tests/shopt.right @@ -0,0 +1,276 @@ +./shopt.tests: line 2: shopt: -z: invalid option +shopt: usage: shopt [-pqsu] [-o] [optname ...] +-- +shopt -u autocd +shopt -u cdable_vars +shopt -s cdspell +shopt -u checkhash +shopt -u checkjobs +shopt -u checkwinsize +shopt -s cmdhist +shopt -u compat31 +shopt -u compat32 +shopt -u compat40 +shopt -u compat41 +shopt -u compat42 +shopt -s complete_fullquote +shopt -u direxpand +shopt -u dirspell +shopt -u dotglob +shopt -u execfail +shopt -s expand_aliases +shopt -u extdebug +shopt -u extglob +shopt -s extquote +shopt -u failglob +shopt -s force_fignore +shopt -u globstar +shopt -u globasciiranges +shopt -u gnu_errfmt +shopt -u histappend +shopt -u histreedit +shopt -u histverify +shopt -s hostcomplete +shopt -u huponexit +shopt -s interactive_comments +shopt -u lastpipe +shopt -u lithist +shopt -u login_shell +shopt -u mailwarn +shopt -u no_empty_cmd_completion +shopt -u nocaseglob +shopt -u nocasematch +shopt -u nullglob +shopt -s progcomp +shopt -s promptvars +shopt -u restricted_shell +shopt -u shift_verbose +shopt -s sourcepath +shopt -u xpg_echo +-- +shopt -u huponexit +shopt -u checkwinsize +shopt -s sourcepath +-- +shopt -s cdspell +shopt -s cmdhist +shopt -s complete_fullquote +shopt -s expand_aliases +shopt -s extquote +shopt -s force_fignore +shopt -s hostcomplete +shopt -s interactive_comments +shopt -s progcomp +shopt -s promptvars +shopt -s sourcepath +-- +shopt -u autocd +shopt -u cdable_vars +shopt -u checkhash +shopt -u checkjobs +shopt -u checkwinsize +shopt -u compat31 +shopt -u compat32 +shopt -u compat40 +shopt -u compat41 +shopt -u compat42 +shopt -u direxpand +shopt -u dirspell +shopt -u dotglob +shopt -u execfail +shopt -u extdebug +shopt -u extglob +shopt -u failglob +shopt -u globstar +shopt -u globasciiranges +shopt -u gnu_errfmt +shopt -u histappend +shopt -u histreedit +shopt -u histverify +shopt -u huponexit +shopt -u lastpipe +shopt -u lithist +shopt -u login_shell +shopt -u mailwarn +shopt -u no_empty_cmd_completion +shopt -u nocaseglob +shopt -u nocasematch +shopt -u nullglob +shopt -u restricted_shell +shopt -u shift_verbose +shopt -u xpg_echo +-- +autocd off +cdable_vars off +checkhash off +checkjobs off +checkwinsize off +compat31 off +compat32 off +compat40 off +compat41 off +compat42 off +direxpand off +dirspell off +dotglob off +execfail off +extdebug off +extglob off +failglob off +globstar off +globasciiranges off +gnu_errfmt off +histappend off +histreedit off +histverify off +huponexit off +lastpipe off +lithist off +login_shell off +mailwarn off +no_empty_cmd_completion off +nocaseglob off +nocasematch off +nullglob off +restricted_shell off +shift_verbose off +xpg_echo off +-- +set +o allexport +set -o braceexpand +set -o emacs +set +o errexit +set +o errtrace +set +o functrace +set -o hashall +set -o histexpand +set -o history +set +o ignoreeof +set -o interactive-comments +set +o keyword +set -o monitor +set +o noclobber +set +o noexec +set +o noglob +set +o nolog +set +o notify +set +o nounset +set +o onecmd +set +o physical +set +o pipefail +set +o posix +set -o privileged +set +o verbose +set +o vi +set +o xtrace +-- +allexport off +braceexpand on +emacs on +errexit off +errtrace off +functrace off +hashall on +histexpand on +history on +ignoreeof off +interactive-comments on +keyword off +monitor on +noclobber off +noexec off +noglob off +nolog off +notify off +nounset off +onecmd off +physical off +pipefail off +posix off +privileged on +verbose off +vi off +xtrace off +-- +set +o allexport +set -o braceexpand +set -o emacs +set +o errexit +set +o errtrace +set +o functrace +set -o hashall +set -o histexpand +set -o history +set +o ignoreeof +set -o interactive-comments +set +o keyword +set -o monitor +set +o noclobber +set +o noexec +set +o noglob +set +o nolog +set +o notify +set +o nounset +set +o onecmd +set +o physical +set +o pipefail +set +o posix +set -o privileged +set +o verbose +set +o vi +set +o xtrace +-- +set -o history +set +o verbose +-- +set -o braceexpand +set -o emacs +set -o hashall +set -o histexpand +set -o history +set -o interactive-comments +set -o monitor +set -o privileged +-- +set +o allexport +set +o errexit +set +o errtrace +set +o functrace +set +o ignoreeof +set +o keyword +set +o noclobber +set +o noexec +set +o noglob +set +o nolog +set +o notify +set +o nounset +set +o onecmd +set +o physical +set +o pipefail +set +o posix +set +o verbose +set +o vi +set +o xtrace +-- +allexport off +errexit off +errtrace off +functrace off +ignoreeof off +keyword off +noclobber off +noexec off +noglob off +nolog off +notify off +nounset off +onecmd off +physical off +pipefail off +posix off +verbose off +vi off +xtrace off +-- +./shopt.tests: line 93: shopt: xyz1: invalid shell option name +./shopt.tests: line 94: shopt: xyz1: invalid option name diff --git a/tests/shopt.tests b/tests/shopt.tests new file mode 100644 index 0000000..d4f2a8b --- /dev/null +++ b/tests/shopt.tests @@ -0,0 +1,94 @@ +# let's try an error message first +shopt -z + +# first, set up a known environment +shopt -u cdable_vars +shopt -s cdspell +shopt -u checkhash +shopt -u checkwinsize +shopt -s cmdhist +shopt -u dotglob +shopt -u execfail +shopt -s expand_aliases +shopt -u extglob +shopt -u histreedit +shopt -u histappend +shopt -u histverify +shopt -s hostcomplete +shopt -u huponexit +shopt -s interactive_comments +shopt -u lithist +shopt -u mailwarn +shopt -u nocaseglob +shopt -u nullglob +shopt -s promptvars +shopt -u shift_verbose +shopt -s sourcepath +shopt -u xpg_echo + +# Now, start checking the output +builtin printf -- "--\n" +shopt -p # list 'em all +builtin printf -- "--\n" +# test specific variables +shopt -p huponexit +shopt -p checkwinsize +shopt -p sourcepath + +builtin printf -- "--\n" +shopt -s -p +builtin printf -- "--\n" +shopt -u -p +builtin printf -- "--\n" +shopt -u + +# Now set up another known environment +set +o allexport +set -o braceexpand +set +o errexit +set -o hashall +set -o histexpand +set +o keyword +set -o monitor +set +o noclobber +set +o noexec +set +o noglob +set +o notify +set +o nounset +set +o onecmd +set +o physical +set -o privileged +set +o verbose +set +o xtrace +set -o history +set +o ignoreeof +set -o interactive-comments +set +o posix +set -o emacs +set +o vi + +# list 'em all +builtin printf -- "--\n" +shopt -o -p + +builtin printf -- "--\n" +set -o +builtin printf -- "--\n" +set +o + +# test specific variables +builtin printf -- "--\n" +shopt -p -o history +shopt -p -o verbose + +builtin printf -- "--\n" +shopt -s -p -o +builtin printf -- "--\n" +shopt -u -p -o +builtin printf -- "--\n" +shopt -u -o + +# errors +builtin printf -- "--\n" +shopt -p xyz1 +shopt -o -p xyz1 diff --git a/tests/source1.sub b/tests/source1.sub new file mode 100644 index 0000000..8b8586f --- /dev/null +++ b/tests/source1.sub @@ -0,0 +1 @@ +echo $AVAR diff --git a/tests/source2.sub b/tests/source2.sub new file mode 100644 index 0000000..7a031a1 --- /dev/null +++ b/tests/source2.sub @@ -0,0 +1,5 @@ +echo in source.sub2, calling return + +return 5 + +echo oops -- return in source.sub2 failed diff --git a/tests/source3.sub b/tests/source3.sub new file mode 100644 index 0000000..4a12501 --- /dev/null +++ b/tests/source3.sub @@ -0,0 +1 @@ +echo "$@" diff --git a/tests/source4.sub b/tests/source4.sub new file mode 100644 index 0000000..717c1ab --- /dev/null +++ b/tests/source4.sub @@ -0,0 +1 @@ +set -- m n o p diff --git a/tests/source5.sub b/tests/source5.sub new file mode 100644 index 0000000..e618809 --- /dev/null +++ b/tests/source5.sub @@ -0,0 +1,19 @@ +LC_ALL=en_US.UTF-8 +unset LC_ALL +unset LANG +export LC_ALL=C +export LANG=C + +set +o posix + +# attempting to source a non-existant file is not an error... +. /tmp/source-notthere + +echo after bad source 1 + +set -o posix + +# ...unless you're in posix mode +. /tmp/source-notthere + +echo after bad source 2 diff --git a/tests/source6.sub b/tests/source6.sub new file mode 100644 index 0000000..9e1cb64 --- /dev/null +++ b/tests/source6.sub @@ -0,0 +1,31 @@ +# tests sourcing non-regular files, fixed post-3.2 + +: ${TMPDIR:=/tmp} + +TMPFN=$TMPDIR/foo-$$ + +rm -f $TMPFN +echo "echo one - OK" > $TMPFN +. $TMPFN +echo $? +rm -f $TMPFN + +# non-regular readable file +. /dev/null +echo $? + +# FIFO or pipe via /dev/fd +. <(echo "echo two - OK") +echo $? + +# pipe +echo "echo three - OK" | . /dev/stdin +echo $? + +# FIFO +mkfifo $TMPDIR/fifo-$$ +echo "echo four - OK" > $TMPDIR/fifo-$$ & +sleep 1 # allow the child echo to execute +. $TMPDIR/fifo-$$ +echo $? +rm -f $TMPDIR/fifo-$$ diff --git a/tests/source7.sub b/tests/source7.sub new file mode 100644 index 0000000..8ca0aef --- /dev/null +++ b/tests/source7.sub @@ -0,0 +1,40 @@ +shopt -s expand_aliases + +: ${TMPDIR:=/var/tmp} + +echo '((echo abc; echo def;); echo ghi)' > $TMPDIR/x28-$$ +. $TMPDIR/x28-$$ +rm -f $TMPDIR/x28-$$ + +echo after + +TMPFILE=$TMPDIR/x29-$$ + +echo "#! ${THIS_SH}" >$TMPFILE +cat >> $TMPFILE << \EOF + +(echo -n "$1 "; echo subshell) +EOF +chmod 755 $TMPFILE + +alias foo1='$TMPFILE one.1; source $TMPFILE two.1; source $TMPFILE three.1; $TMPFILE four.1' +alias foo2='$TMPFILE one.2; +source $TMPFILE two.2; +source $TMPFILE three.2; +$TMPFILE four.2; +' + +foo1 +foo2 + +echo x29 - done +rm -f $TMPFILE + +# this is also treated similarly to an alias expansion internally +((echo abc; echo def;); echo ghi) + +if (((4+4) + (4 + 7))); then + echo ok +fi + +(()) # make sure the null expression works OK diff --git a/tests/strip.right b/tests/strip.right new file mode 100644 index 0000000..dfab897 --- /dev/null +++ b/tests/strip.right @@ -0,0 +1,12 @@ +'' +' ab ' +' ' +'' +'' +'' +'ababababababab' +'ababababababab ' +'ababababababab ' +'abababa +bababab ' +'' diff --git a/tests/strip.tests b/tests/strip.tests new file mode 100644 index 0000000..b669b52 --- /dev/null +++ b/tests/strip.tests @@ -0,0 +1,22 @@ +v=`echo "" ; echo "" ; echo ""` +echo "'$v'" +v=`echo -n " ab "` +echo "'$v'" +v=`echo -n " "` +echo "'$v'" +v=`echo -n ""` +echo "'$v'" +v=`echo ""` +echo "'$v'" +v=`echo` +echo "'$v'" +v=`echo ababababababab` +echo "'$v'" +v=`echo "ababababababab "` +echo "'$v'" +v=`echo -n "ababababababab "` +echo "'$v'" +v=`echo -ne "abababa\nbababab "` +echo "'$v'" +v="`echo -e '\n\n\n\n'`" +echo "'$v'" diff --git a/tests/test.right b/tests/test.right new file mode 100644 index 0000000..7fcd996 --- /dev/null +++ b/tests/test.right @@ -0,0 +1,291 @@ +t -a noexist +1 +t -a run-all +0 +t -b run-all +1 +t -b /dev/jb1a +1 +t -c run-all +1 +t -c /dev/tty +0 +t -d run-all +1 +t -d /etc +0 +t -d "" +1 +b -d "" +1 +t -e noexist +1 +t -e run-all +0 +t -f noexist +1 +t -f /dev/tty +1 +t -f run-all +0 +t -g run-all +1 +t -g /tmp/test.setgid +0 +t -k run-all +1 +t -n "" +1 +t -n "hello" +0 +t -p run-all +1 +t -r noexist +1 +t -r /tmp/test.noread +1 +t -r run-all +0 +t -s noexist +1 +t -s /dev/null +1 +t -s run-all +0 +t -t 20 +1 +t -t 0 +0 +t -u noexist +1 +t -u run-all +1 +t -u /tmp/test.setuid +0 +t -w noexist +1 +t -w /tmp/test.nowrite +1 +t -w /dev/null +0 +t -x noexist +1 +t -x /tmp/test.exec +0 +t -x /tmp/test.noexec +1 +t -z "" +0 +t -z "foo" +1 +t "foo" +0 +t "" +1 +t -O /tmp/test.owner +0 +t -S /tmp/test.socket +1 +t -N /tmp/test.newer +0 +t "hello" = "hello" +0 +t "hello" = "goodbye" +1 +t "hello" == "hello" +0 +t "hello" == "goodbye" +1 +t "hello" != "hello" +1 +t "hello" != "goodbye" +0 +t "hello" < "goodbye" +1 +t "hello" > "goodbye" +0 +t ! "hello" > "goodbye" +1 +t 200 -eq 200 +0 +t 34 -eq 222 +1 +t -32 -eq 32 +1 +t 200 -ne 200 +1 +t 34 -ne 222 +0 +t 200 -gt 200 +1 +t 340 -gt 222 +0 +t 200 -ge 200 +0 +t 34 -ge 222 +1 +t 200 -lt 200 +1 +t 34 -lt 222 +0 +t 200 -le 200 +0 +t 340 -le 222 +1 +t 700 -le 1000 -a -n "1" -a "20" = "20" +0 +t ! \( 700 -le 1000 -a -n "1" -a "20" = "20" \) +1 +t /tmp/abc -nt /tmp/def +1 +t /tmp/abc -ot /tmp/def +0 +t /tmp/def -nt /tmp/abc +0 +t /tmp/def -ot /tmp/abc +1 +t /tmp/abc -ef /tmp/def +1 +t /tmp/abc -ef /tmp/ghi +0 +t -r /dev/fd/0 +0 +t -w /dev/fd/1 +0 +t -w /dev/fd/2 +0 +t -r /dev/stdin +0 +t -w /dev/stdout +0 +t -w /dev/stderr +0 +t +1 +b +1 +t 12 -eq 34 +1 +t ! 12 -eq 34 +0 +t -n abcd -o aaa +0 +t -n abcd -o -z aaa +0 +t -n abcd -a aaa +0 +t -n abcd -a -z aaa +1 +t -o allexport +1 +t ! -o allexport +0 +t -v unset +1 +t -v set +0 +t -v set +0 +t xx -a yy +0 +t xx -o "" +0 +t xx -a "" +1 +t -X -a -X +0 +t -X -o -X +0 +t -X -o "" +0 +t -X -a "" +1 +t "" -a -X +1 +t "" -o -X +0 +t "" -a "" +1 +t "" -o "" +1 +t true -o -X +0 +t true -a -X +0 +t ( -E ) +0 +t ( "" ) +1 +t ! -z "$z" +0 +t ! -n "$z" +1 +t "$zero" +1 +t ! "$zero" +0 +b "$zero" +1 +b ! "$zero" +0 +t -G /tmp/test.group +0 +t -h /tmp/test.symlink +0 +t 4+3 -eq 7 +./test.tests: line 13: test: 4+3: integer expression expected +2 +b 4-5 -eq 7 +./test.tests: line 7: [: 4+3: integer expression expected +2 +t 9 -eq 4+5 +./test.tests: line 13: test: 4+5: integer expression expected +2 +b 9 -eq 4+5 +./test.tests: line 7: [: 4+5: integer expression expected +2 +t A -eq 7 +./test.tests: line 13: test: A: integer expression expected +2 +b A -eq 7 +./test.tests: line 7: [: A: integer expression expected +2 +t 9 -eq B +./test.tests: line 13: test: B: integer expression expected +2 +b 9 -eq B +./test.tests: line 7: [: B: integer expression expected +2 +t ( 1 = 2 +./test.tests: line 13: test: `)' expected +2 +b ( 1 = 2 +./test.tests: line 7: [: `)' expected, found ] +2 +./test.tests: line 13: test: a: unary operator expected +2 +./test.tests: line 13: test: b: binary operator expected +2 +./test.tests: line 13: test: -A: unary operator expected +2 +./test.tests: line 13: test: too many arguments +2 +./test.tests: line 13: test: too many arguments +2 +./test.tests: line 418: [: missing `]' +2 +./test.tests: line 13: test: (: unary operator expected +2 +t -t a +1 +t -t addsds +1 +t -t 42 +1 +t -t /dev/tty +1 +t -t /dev/tty4 +1 +t -t /dev/tty4444444... +1 +1 diff --git a/tests/test.tests b/tests/test.tests new file mode 100644 index 0000000..47eef35 --- /dev/null +++ b/tests/test.tests @@ -0,0 +1,438 @@ +if (( $UID == 0 )); then + echo "test-tests: the test suite should not be run as root" >&2 +fi + +b() +{ + [ "$@" ] + echo $? +} + +t() +{ + test "$@" + echo $? +} + +echo 't -a noexist' +t -a noexist +echo 't -a run-all' +t -a run-all + +echo 't -b run-all' +t -b run-all +echo 't -b /dev/jb1a' +t -b /dev/jb1a + +echo 't -c run-all' +t -c run-all +echo 't -c /dev/tty' +t -c /dev/tty + +echo 't -d run-all' +t -d run-all +echo 't -d /etc' +t -d /etc +echo 't -d ""' +t -d "" +echo 'b -d ""' +b -d "" + +echo 't -e noexist' +t -e noexist +echo 't -e run-all' +t -e run-all + +echo 't -f noexist' +t -f noexist +echo 't -f /dev/tty' +t -f /dev/tty +echo 't -f run-all' +t -f run-all + +echo 't -g run-all' +t -g run-all + +touch /tmp/test.setgid +chgrp ${GROUPS[0]} /tmp/test.setgid +chmod ug+x /tmp/test.setgid +chmod g+s /tmp/test.setgid +echo 't -g /tmp/test.setgid' +t -g /tmp/test.setgid +rm -f /tmp/test.setgid + +echo 't -k run-all' +t -k run-all + +echo 't -n ""' +t -n "" +echo 't -n "hello"' +t -n "hello" + +echo 't -p run-all' +t -p run-all + +echo 't -r noexist' +t -r noexist + +if (( $UID != 0 )); then + touch /tmp/test.noread + chmod a-r /tmp/test.noread + echo 't -r /tmp/test.noread' + t -r /tmp/test.noread + rm -f /tmp/test.noread +else + echo 't -r /tmp/test.noread' + echo 1 +fi + +echo 't -r run-all' +t -r run-all + +echo 't -s noexist' +t -s noexist +echo 't -s /dev/null' +t -s /dev/null +echo 't -s run-all' +t -s run-all + +echo 't -t 20' +t -t 20 +echo 't -t 0' +t -t 0 < /dev/tty + +echo 't -u noexist' +t -u noexist + +echo 't -u run-all' +t -u run-all + +touch /tmp/test.setuid +chmod u+x /tmp/test.setuid # some systems require this to turn on setuid bit +chmod u+s /tmp/test.setuid +echo 't -u /tmp/test.setuid' +t -u /tmp/test.setuid +rm -f /tmp/test.setuid + +echo 't -w noexist' +t -w noexist + +if (( $UID != 0 )); then + touch /tmp/test.nowrite + chmod a-w /tmp/test.nowrite + echo 't -w /tmp/test.nowrite' + t -w /tmp/test.nowrite + rm -f /tmp/test.nowrite +else + echo 't -w /tmp/test.nowrite' + echo 1 +fi + +echo 't -w /dev/null' +t -w /dev/null + +echo 't -x noexist' +t -x noexist + +touch /tmp/test.exec +chmod u+x /tmp/test.exec +echo 't -x /tmp/test.exec' +t -x /tmp/test.exec +rm -f /tmp/test.exec + +touch /tmp/test.noexec +chmod u-x /tmp/test.noexec +echo 't -x /tmp/test.noexec' +t -x /tmp/test.noexec +rm -f /tmp/test.noexec + +echo 't -z ""' +t -z "" +echo 't -z "foo"' +t -z "foo" + +echo 't "foo"' +t "foo" +echo 't ""' +t "" + +touch /tmp/test.owner +echo 't -O /tmp/test.owner' +t -O /tmp/test.owner +rm -f /tmp/test.owner + +touch /tmp/test.socket +echo 't -S /tmp/test.socket' +t -S /tmp/test.socket # false +rm -f /tmp/test.socket + +touch /tmp/test.newer +echo 't -N /tmp/test.newer' +t -N /tmp/test.newer +rm -f /tmp/test.newer + +echo 't "hello" = "hello"' +t "hello" = "hello" +echo 't "hello" = "goodbye"' +t "hello" = "goodbye" + +echo 't "hello" == "hello"' +t "hello" == "hello" +echo 't "hello" == "goodbye"' +t "hello" == "goodbye" + +echo 't "hello" != "hello"' +t "hello" != "hello" +echo 't "hello" != "goodbye"' +t "hello" != "goodbye" + +echo 't "hello" < "goodbye"' +t "hello" \< "goodbye" +echo 't "hello" > "goodbye"' +t "hello" \> "goodbye" + +echo 't ! "hello" > "goodbye"' +t "! hello" \> "goodbye" + +echo 't 200 -eq 200' +t 200 -eq 200 +echo 't 34 -eq 222' +t 34 -eq 222 +echo 't -32 -eq 32' +t -32 -eq 32 + +echo 't 200 -ne 200' +t 200 -ne 200 +echo 't 34 -ne 222' +t 34 -ne 222 + +echo 't 200 -gt 200' +t 200 -gt 200 +echo 't 340 -gt 222' +t 340 -gt 222 + +echo 't 200 -ge 200' +t 200 -ge 200 +echo 't 34 -ge 222' +t 34 -ge 222 + +echo 't 200 -lt 200' +t 200 -lt 200 +echo 't 34 -lt 222' +t 34 -lt 222 + +echo 't 200 -le 200' +t 200 -le 200 +echo 't 340 -le 222' +t 340 -le 222 + +echo 't 700 -le 1000 -a -n "1" -a "20" = "20"' +t 700 -le 1000 -a -n "1" -a "20" = "20" +echo 't ! \( 700 -le 1000 -a -n "1" -a "20" = "20" \)' +t ! \( 700 -le 1000 -a -n "1" -a "20" = "20" \) + +touch /tmp/abc +sleep 2 +touch /tmp/def + +echo 't /tmp/abc -nt /tmp/def' +t /tmp/abc -nt /tmp/def +echo 't /tmp/abc -ot /tmp/def' +t /tmp/abc -ot /tmp/def +echo 't /tmp/def -nt /tmp/abc' +t /tmp/def -nt /tmp/abc +echo 't /tmp/def -ot /tmp/abc' +t /tmp/def -ot /tmp/abc + +echo 't /tmp/abc -ef /tmp/def' +t /tmp/abc -ef /tmp/def +ln /tmp/abc /tmp/ghi +echo 't /tmp/abc -ef /tmp/ghi' +t /tmp/abc -ef /tmp/ghi + +rm /tmp/abc /tmp/def /tmp/ghi + +echo 't -r /dev/fd/0' +t -r /dev/fd/0 +echo 't -w /dev/fd/1' +t -w /dev/fd/1 +echo 't -w /dev/fd/2' +t -w /dev/fd/2 + +echo 't -r /dev/stdin' +t -r /dev/stdin +echo 't -w /dev/stdout' +t -w /dev/stdout +echo 't -w /dev/stderr' +t -w /dev/stderr + +echo 't' +t +echo 'b' +b + +echo 't 12 -eq 34' +t 12 -eq 34 +echo 't ! 12 -eq 34' +t ! 12 -eq 34 + +echo 't -n abcd -o aaa' +t -n abcd -o aaa +echo 't -n abcd -o -z aaa' +t -n abcd -o -z aaa + +echo 't -n abcd -a aaa' +t -n abcd -a aaa +echo 't -n abcd -a -z aaa' +t -n abcd -a -z aaa + +# test set or unset shell options +set +o allexport +echo 't -o allexport' +t -o allexport +echo 't ! -o allexport' +t ! -o allexport + +#test set or unset shell variables +unset unset +echo 't -v unset' +t -v unset +set= +echo 't -v set' +t -v set +set=set +echo 't -v set' +t -v set + +echo 't xx -a yy' +t xx -a yy +echo 't xx -o ""' +t xx -o "" +echo 't xx -a ""' +t xx -a "" + +echo 't -X -a -X' +t -X -a -X +echo 't -X -o -X' +t -X -o -X +echo 't -X -o ""' +t -X -o "" +echo 't -X -a ""' +t -X -a "" +echo 't "" -a -X' +t "" -a -X +echo 't "" -o -X' +t "" -o -X +echo 't "" -a ""' +t "" -a "" +echo 't "" -o ""' +t "" -o "" +echo 't true -o -X' +t true -o -X +echo 't true -a -X' +t true -a -X + +echo 't ( -E )' +t \( -E \) +echo 't ( "" )' +t \( "" \) + +z=42 + +echo 't ! -z "$z"' +t ! -z "$z" + +echo 't ! -n "$z"' +t ! -n "$z" + +zero= +echo 't "$zero"' +t "$zero" +echo 't ! "$zero"' +t ! "$zero" +echo 'b "$zero"' +b "$zero" +echo 'b ! "$zero"' +b ! "$zero" + +touch /tmp/test.group +chgrp ${GROUPS[0]} /tmp/test.group +echo 't -G /tmp/test.group' +t -G /tmp/test.group +rm /tmp/test.group + +case "${THIS_SH}" in +/*) SHNAME=${THIS_SH} ;; +*) SHNAME=${PWD}/${THIS_SH} ;; +esac + +if ln -s ${SHNAME} /tmp/test.symlink 2>/dev/null; then + chgrp ${GROUPS[0]} /tmp/test.symlink 2>/dev/null + echo 't -h /tmp/test.symlink' + t -h /tmp/test.symlink + # some systems don't let you remove this + rm -f /tmp/test.symlink 2>/dev/null +else + echo 't -h /tmp/test.symlink' + echo 0 +fi + +# arithmetic constant errors +echo "t 4+3 -eq 7" +t 4+3 -eq 7 +echo "b 4-5 -eq 7" +b 4+3 -eq 7 + +echo "t 9 -eq 4+5" +t 9 -eq 4+5 +echo "b 9 -eq 4+5" +b 9 -eq 4+5 + +A=7 +echo "t A -eq 7" +t A -eq 7 +echo "b A -eq 7" +b A -eq 7 + +B=9 +echo "t 9 -eq B" +t 9 -eq B +echo "b 9 -eq B" +b 9 -eq B + +# badly formed expressions +echo 't ( 1 = 2' +t \( 1 = 2 +echo 'b ( 1 = 2' +b \( 1 = 2 + +# more errors +t a b +t a b c +t -A v +# too many arguments -- argument expected is also reasonable +t 4 -eq 4 -a 2 -ne 5 -a 4 -ne +# too many arguments +t 4 -eq 4 -a 3 4 + +[ +echo $? + +t \( \) + +# non-numeric arguments to `test -t' should return failure -- fix in 2.05 +echo 't -t a' +t -t a +echo 't -t addsds' +t -t addsds +echo 't -t 42' +t -t 42 +echo 't -t /dev/tty' +t -t /dev/tty +echo 't -t /dev/tty4' +t -t /dev/tty4 +echo 't -t /dev/tty4444444...' +t -t /dev/tty4444444... + +# fixed in bash-4.0-beta +t -t ' ' diff --git a/tests/tilde.right b/tests/tilde.right new file mode 100644 index 0000000..49549b4 --- /dev/null +++ b/tests/tilde.right @@ -0,0 +1,26 @@ +~chet +/usr/xyz/foo +~chet/foo +~chet/foo +~chet/bar +~chet/bar +~chet/bar +:~chet/ +abcd~chet +SHELL=~/bash +/usr/xyz/bash +abcd:~chet +/usr/ucb:/bin:/usr/xyz/bin:/usr/xyz/tmp/bin:/usr/bin +/usr +/tmp +/bin:/usr/bin:.:/usr/xyz/bin +/bin:/usr/bin:.:~/bin +/bin:/usr/bin:.:/usr/xyz/bin +/bin:/usr/bin:.:/usr/xyz/bin +/bin:/usr/bin:.:~/bin +/bin:/usr/bin:.:~/bin +\~ +ok 1 +ok 2 +ok 3 +~root diff --git a/tests/tilde.tests b/tests/tilde.tests new file mode 100644 index 0000000..50f19e9 --- /dev/null +++ b/tests/tilde.tests @@ -0,0 +1,71 @@ +# this is needed because posix mode restricts tilde expansion to assignment +# statements preceding a command, instead of the default of expanding all +# assignment statements on the line (e.g., after `export'). Without this, +# the next-to-last test fails +set +o posix + +HOME=/usr/xyz +SHELL=~/bash +echo ~ch\et +echo ~/"foo" +echo "~chet"/"foo" +echo \~chet/"foo" +echo \~chet/bar +echo ~\chet/bar +echo ~chet""/bar +echo ":~chet/" +echo abcd~chet +echo "SHELL=~/bash" +echo $SHELL +echo abcd:~chet +path=/usr/ucb:/bin:~/bin:~/tmp/bin:/usr/bin +echo $path + +cd /usr +cd /tmp +echo ~- +echo ~+ + +XPATH=/bin:/usr/bin:. + +# yes tilde expansion +PPATH=$XPATH:~/bin +echo "$PPATH" + +# no tilde expansion +PPATH="$XPATH:~/bin" +echo "$PPATH" + +# yes tilde expansion +export PPATH=$XPATH:~/bin +echo "$PPATH" +declare -x PPATH=$XPATH:~/bin +echo "$PPATH" + +# no tilde expansion +export PPATH="$XPATH:~/bin" +echo "$PPATH" +declare -x PPATH="$XPATH:~/bin" +echo "$PPATH" + +printf "%q\n" '~' + +# more tests of tilde expansion when executing case commands +case ~ in +$HOME) echo ok 1;; +*) echo bad 1 ;; +esac + +case ~ in +~) echo ok 2 ;; +\~) echo bad 2a ;; +*) echo bad 2b ;; +esac + +case $unset in +"") echo ok 3 ;; +*) echo bad 3 ;; +esac + +USER=root # should exist just about everywhere +echo ~$USER diff --git a/tests/tilde2.right b/tests/tilde2.right new file mode 100644 index 0000000..fce0468 --- /dev/null +++ b/tests/tilde2.right @@ -0,0 +1,24 @@ +PATH=~/bin:/bin:/usr/bin:. +/usr/xyz/bin:~/bin2:/bin:/usr/bin:. +PATH=~/bin:~/bin2:/bin:/usr/bin:. +~/bin +~ +/usr/xyz +~ +~ +~ +argv[1] = <\a> +argv[1] = <\a> +/usr/xyz/bash +ok +~ +~ +make -k FOO=/usr/xyz/mumble +/usr/xyz/mumble +HOME=~ +HOME=~ +/usr/$x/abc +HOME=~ +/usr/$x/abc +HOME=/usr/$x/abc +/usr/$x/abc diff --git a/tests/tilde2.tests b/tests/tilde2.tests new file mode 100644 index 0000000..ff6c76f --- /dev/null +++ b/tests/tilde2.tests @@ -0,0 +1,70 @@ +HOME=/usr/xyz +XPATH=/bin:/usr/bin:. + +ADDPATH=PATH=~/bin:$XPATH + +echo $ADDPATH + +unset ADDPATH +: ${ADDPATH:=~/bin:~/bin2:$XPATH} +echo $ADDPATH + +unset ADDPATH +: ${ADDPATH:=PATH=~/bin:~/bin2:$XPATH} +echo $ADDPATH + +cat << ! +~/bin +! + +echo "~" + +echo ${TPATH:-~} +echo "${TPATH:-~}" +echo "${TPATH:-"~"}" + +echo "${XPATH+~}" + +recho "\a" +recho "${TPATH:-\a}" + +SHELL=~/bash +echo $SHELL + +case $SHELL in +~/bash) echo ok;; +*) echo bad;; +esac + +somevar= +echo "${somevar:-~}" +echo "${somevar:-"~"}" + +echo make -k FOO=~/mumble + +typeset FOO=~/mumble +echo "$FOO" + +h=HOME=~ +echo $h + +export h=HOME=~ +echo $h + +x=1234 +HOME='/usr/$x/abc' + +echo ~ + +# behavior differs here in posix mode +set -o posix + +eval echo $h +eval $h +echo $HOME + +set +o posix + +eval echo $h +eval $h +echo $HOME diff --git a/tests/trap.right b/tests/trap.right new file mode 100644 index 0000000..b361564 --- /dev/null +++ b/tests/trap.right @@ -0,0 +1,104 @@ +subshell exit +trap -- 'echo exiting' EXIT +trap -- 'echo aborting' SIGHUP +trap -- 'echo aborting' SIGINT +trap -- 'echo aborting' SIGQUIT +trap -- 'echo aborting' SIGABRT +trap -- 'echo aborting' SIGTERM +[20] debug +debug line +[22] debug +trap -- 'echo exiting' EXIT +trap -- 'echo aborting' SIGHUP +trap -- 'echo aborting' SIGINT +trap -- 'echo aborting' SIGQUIT +trap -- 'echo aborting' SIGABRT +trap -- 'echo aborting' SIGTERM +trap -- 'echo [$LINENO] debug' DEBUG +[24] debug +func[16] funcdebug +funcdebug line +[26] debug +trap -- 'echo exiting' EXIT +trap -- 'echo aborting' SIGHUP +trap -- 'echo aborting' SIGINT +trap -- 'echo aborting' SIGQUIT +trap -- 'echo aborting' SIGABRT +trap -- 'echo aborting' SIGTERM +trap -- 'echo [$LINENO] debug' DEBUG +[28] debug +./trap.tests[33] debug +./trap.tests[34] debug +func2[30] debug +func2[31] debug +func2debug line +./trap.tests[36] debug +./trap.tests[38] debug +trap -- 'echo exiting' EXIT +trap -- 'echo aborting' SIGHUP +trap -- 'echo aborting' SIGINT +trap -- 'echo aborting' SIGQUIT +trap -- 'echo aborting' SIGABRT +trap -- 'echo aborting' SIGTERM +trap -- '' DEBUG +trap -- 'echo exiting' EXIT +trap -- 'echo aborting' SIGHUP +trap -- 'echo aborting' SIGINT +trap -- 'echo aborting' SIGQUIT +trap -- 'echo aborting' SIGABRT +trap -- 'echo aborting' SIGTERM +trap -- 'echo exiting' EXIT +trap -- '' SIGINT +trap -- 'echo aborting' SIGQUIT +trap -- 'echo aborting' SIGABRT +trap -- 'echo aborting' SIGTERM +0 +trap -- '' SIGUSR2 +ERRTRAP +ERRTRAP +ERRTRAP +after falses +if negation ok +after negation +after while +before false in trap2a.sub +after false in trap2a.sub +command substitution ++[6] echo 1 +1 ++[7] echo 2 +2 ++[8] echo 3 ++[8] cat ++[8] false +++[8] echo trap: 8 +trap: 8 ++[9] echo 4 +4 +exit subshell 1 +current shell +exit subshell 2 +current shell +current shell +current shell +outside 1 +outside 2 +outside 3 +outside 4 +sleep 2 +wait $! +exit +in trap EXIT +sleep 2 +wait $! +exit +in trap EXIT +caught a child death +caught a child death +caught a child death +trap -- 'echo caught a child death' SIGCHLD +trap -- 'echo exiting' EXIT +trap -- 'echo aborting' SIGABRT +trap -- 'echo caught a child death' SIGCHLD +trap -- '' SIGUSR2 +exiting diff --git a/tests/trap.tests b/tests/trap.tests new file mode 100644 index 0000000..5d8b06c --- /dev/null +++ b/tests/trap.tests @@ -0,0 +1,97 @@ +# test the trap code + +trap 'echo exiting' 0 +trap 'echo aborting' 1 2 3 6 15 + +# make sure a user-specified subshell runs the exit trap, but does not +# inherit the exit trap from a parent shell +( trap 'echo subshell exit' 0; exit 0 ) +( exit 0 ) + +trap + +func() +{ + trap 'echo ${FUNCNAME:-$0}[$LINENO] funcdebug' DEBUG + echo funcdebug line +} + +trap 'echo [$LINENO] debug' DEBUG +echo debug line + +trap + +func + +trap + +trap 'echo ${FUNCNAME:-$0}[$LINENO] debug' DEBUG +func2() +{ + echo func2debug line +} +declare -ft func2 +func2 + +unset -f func2 + +trap '' DEBUG + +trap + +trap - debug + +trap + +trap - HUP +trap hup +trap '' INT +trap '' int + +trap + +# exit 0 in exit trap should set exit status +( +set -e +trap 'exit 0' EXIT +false +echo bad +) +echo $? + +# hmmm...should this set the handling to SIG_IGN for children, too? +trap '' USR2 +./trap1.sub + +# test ERR trap +./trap2.sub + +${THIS_SH} ./trap3.sub + +${THIS_SH} ./trap4.sub + +# This doesn't work right on all Unix versions +#${THIS_SH} ./trap5.sub + +# +# show that setting a trap on SIGCHLD is not disastrous. +# +set -o monitor + +trap 'echo caught a child death' SIGCHLD + +sleep 7 & sleep 6 & sleep 5 & + +# this will only catch the first, since there's a trap on SIGCHLD +wait + +trap -p SIGCHLD + +# Now reset some of the signals the shell handles specially back to +# their default values (with or without the SIG prefix) +trap - SIGINT QUIT TERM + +trap + +trap - SIGCHLD +wait diff --git a/tests/trap1.sub b/tests/trap1.sub new file mode 100755 index 0000000..48f8530 --- /dev/null +++ b/tests/trap1.sub @@ -0,0 +1,4 @@ +# signals ignored at shell startup cannot be trapped or reset +trap 'echo USR2' USR2 + +trap -p USR2 diff --git a/tests/trap2.sub b/tests/trap2.sub new file mode 100755 index 0000000..73357df --- /dev/null +++ b/tests/trap2.sub @@ -0,0 +1,25 @@ +set +e +trap 'echo ERRTRAP' ERR + +false +false +false + +echo after falses + +if ! false; then + echo if negation ok +fi + +! false +echo after negation + +while false; do + echo while negation ok +done + +echo after while + +./trap2a.sub + +echo $(false ; echo command substitution) diff --git a/tests/trap2a.sub b/tests/trap2a.sub new file mode 100755 index 0000000..44d6b50 --- /dev/null +++ b/tests/trap2a.sub @@ -0,0 +1,3 @@ +echo before false in trap2a.sub +false +echo after false in trap2a.sub diff --git a/tests/trap3.sub b/tests/trap3.sub new file mode 100644 index 0000000..0df4455 --- /dev/null +++ b/tests/trap3.sub @@ -0,0 +1,9 @@ +PS4='+[$LINENO] ' +trap 'echo trap: $LINENO' ERR + +set -x + +echo 1 +echo 2 +echo 3 | cat | false +echo 4 diff --git a/tests/trap4.sub b/tests/trap4.sub new file mode 100644 index 0000000..ab5ca3e --- /dev/null +++ b/tests/trap4.sub @@ -0,0 +1,42 @@ +# make sure subshells at the end of pipelines run any exit traps they set + +: | { trap 'echo exit subshell 1' EXIT; exit; }; echo current shell + +: | { trap 'echo exit subshell 2' EXIT; exit; }; echo current shell + +: | { trap 'echo exit subshell 3' EXIT; exit; } | : ; echo current shell + +: | { trap 'echo exit subshell 4' EXIT; exit; } | : ; echo current shell + +trap 'echo inherited exit trap' EXIT +: | { exit; } ; echo outside 1 +: | ( exit; ) ; echo outside 2 +: | { exit; } | : ; echo outside 3 +: | ( exit; ) | : ; echo outside 4 + +trap - EXIT + +# make sure group commands that are not at the beginning or end of pipelines +# run an EXIT trap, with and without the exit builtin +echo ignored | +{ + trap 'echo "in trap EXIT">&2' EXIT + sleep 4 & + echo 'sleep 2'>&2 + sleep 2 + echo 'wait $!'>&2 + wait $! + echo 'exit'>&2 + exit +} | cat + +echo ignored | +{ + trap 'echo "in trap EXIT">&2' EXIT + sleep 4 & + echo 'sleep 2'>&2 + sleep 2 + echo 'wait $!'>&2 + wait $! + echo 'exit'>&2 +} | cat diff --git a/tests/trap5.sub b/tests/trap5.sub new file mode 100644 index 0000000..7f3380b --- /dev/null +++ b/tests/trap5.sub @@ -0,0 +1,18 @@ +# make sure process substitution runs the exit trap +[[ -n $(< <(trap "cat /dev/fd/0" EXIT)) ]] <<> ${f} <<-EOF +file +EOF + + done + grep . a b c +} +a:file +b:file +c:file +bb is a function +bb () +{ + ( cat </dev/null +func() { echo this is func; } + +type -t func +type -t while +type -t builtin +type -t /bin/sh +type -t ${THIS_SH} +type -t mv + +type func +# the following two should produce identical output +type while +type -a while +type builtin +type /bin/sh + +command -v func +command -V func +command -v while +command -V while + +# the following two lines should produce the same output +# post-3.0 patch makes command -v silent, as posix specifies +# first test with alias expansion off (should all fail or produce no output) +type -t m +type m +command -v m +alias -p +alias m + +# then test with alias expansion on +shopt -s expand_aliases +type m +type -t m +command -v m +alias -p +alias m + +command -V m +shopt -u expand_aliases + +command -v builtin +command -V builtin +command -v /bin/sh +command -V /bin/sh + +unset -f func +type func +unalias m +type m + +hash -r + +hash -p /bin/sh sh +type -p sh + +SHBASE=${THIS_SH##*/} +hash -p /tmp/$SHBASE $SHBASE +type -p $SHBASE +type $SHBASE + +type -t $SHBASE + +# make sure the hash table looks right +hash + +# bug in versions of bash up to and including bash-3.2 +f() { + v=$'\001' + } + +type f | cat -v + +${THIS_SH} type1.sub + +${THIS_SH} type2.sub + +${THIS_SH} type3.sub + +${THIS_SH} type4.sub diff --git a/tests/type1.sub b/tests/type1.sub new file mode 100644 index 0000000..95f96ae --- /dev/null +++ b/tests/type1.sub @@ -0,0 +1,10 @@ +foo() +{ + echo $(> ${f} + file + EOF + done + grep . a b c +} + +type foo + +eval "$(type foo | sed 1d)" +foo + +rm -f a b c diff --git a/tests/type4.sub b/tests/type4.sub new file mode 100644 index 0000000..ed5bcf6 --- /dev/null +++ b/tests/type4.sub @@ -0,0 +1,43 @@ +bb() +{ + ( + cat << EOF +foo +bar +EOF + ) + echo after subshell +} + +type bb + + +mkcoprocs() +{ + coproc a { cat </dev/null + if [ "${EChar}" != "${RChar}" ]; then + let ErrorCnt+=1 + printf "${TargetCharset}: Error Encoding U+%08X to ${TL} [ \"%q\" != \"%q\" ]\n" "${x}" "${EChar}" "${RChar}" + fi + fi + done +} + + +#for ((x=1;x<255;x++)); do printf ' [0x%04x]=$'\''\%03o'\' $x $x ; [ $(($x%5)) = 0 ] && echo; done +fr_FR_ISO_8859_1=( + [0x0001]=$'\001' [0x0002]=$'\002' [0x0003]=$'\003' [0x0004]=$'\004' [0x0005]=$'\005' + [0x0006]=$'\006' [0x0007]=$'\007' [0x0008]=$'\010' [0x0009]=$'\011' [0x000a]=$'\012' + [0x000b]=$'\013' [0x000c]=$'\014' [0x000d]=$'\015' [0x000e]=$'\016' [0x000f]=$'\017' + [0x0010]=$'\020' [0x0011]=$'\021' [0x0012]=$'\022' [0x0013]=$'\023' [0x0014]=$'\024' + [0x0015]=$'\025' [0x0016]=$'\026' [0x0017]=$'\027' [0x0018]=$'\030' [0x0019]=$'\031' + [0x001a]=$'\032' [0x001b]=$'\033' [0x001c]=$'\034' [0x001d]=$'\035' [0x001e]=$'\036' + [0x001f]=$'\037' [0x0020]=$'\040' [0x0021]=$'\041' [0x0022]=$'\042' [0x0023]=$'\043' + [0x0024]=$'\044' [0x0025]=$'\045' [0x0026]=$'\046' [0x0027]=$'\047' [0x0028]=$'\050' + [0x0029]=$'\051' [0x002a]=$'\052' [0x002b]=$'\053' [0x002c]=$'\054' [0x002d]=$'\055' + [0x002e]=$'\056' [0x002f]=$'\057' [0x0030]=$'\060' [0x0031]=$'\061' [0x0032]=$'\062' + [0x0033]=$'\063' [0x0034]=$'\064' [0x0035]=$'\065' [0x0036]=$'\066' [0x0037]=$'\067' + [0x0038]=$'\070' [0x0039]=$'\071' [0x003a]=$'\072' [0x003b]=$'\073' [0x003c]=$'\074' + [0x003d]=$'\075' [0x003e]=$'\076' [0x003f]=$'\077' [0x0040]=$'\100' [0x0041]=$'\101' + [0x0042]=$'\102' [0x0043]=$'\103' [0x0044]=$'\104' [0x0045]=$'\105' [0x0046]=$'\106' + [0x0047]=$'\107' [0x0048]=$'\110' [0x0049]=$'\111' [0x004a]=$'\112' [0x004b]=$'\113' + [0x004c]=$'\114' [0x004d]=$'\115' [0x004e]=$'\116' [0x004f]=$'\117' [0x0050]=$'\120' + [0x0051]=$'\121' [0x0052]=$'\122' [0x0053]=$'\123' [0x0054]=$'\124' [0x0055]=$'\125' + [0x0056]=$'\126' [0x0057]=$'\127' [0x0058]=$'\130' [0x0059]=$'\131' [0x005a]=$'\132' + [0x005b]=$'\133' [0x005c]=$'\134' [0x005d]=$'\135' [0x005e]=$'\136' [0x005f]=$'\137' + [0x0060]=$'\140' [0x0061]=$'\141' [0x0062]=$'\142' [0x0063]=$'\143' [0x0064]=$'\144' + [0x0065]=$'\145' [0x0066]=$'\146' [0x0067]=$'\147' [0x0068]=$'\150' [0x0069]=$'\151' + [0x006a]=$'\152' [0x006b]=$'\153' [0x006c]=$'\154' [0x006d]=$'\155' [0x006e]=$'\156' + [0x006f]=$'\157' [0x0070]=$'\160' [0x0071]=$'\161' [0x0072]=$'\162' [0x0073]=$'\163' + [0x0074]=$'\164' [0x0075]=$'\165' [0x0076]=$'\166' [0x0077]=$'\167' [0x0078]=$'\170' + [0x0079]=$'\171' [0x007a]=$'\172' [0x007b]=$'\173' [0x007c]=$'\174' [0x007d]=$'\175' + [0x007e]=$'\176' [0x007f]=$'\177' [0x0080]=$'\200' [0x0081]=$'\201' [0x0082]=$'\202' + [0x0083]=$'\203' [0x0084]=$'\204' [0x0085]=$'\205' [0x0086]=$'\206' [0x0087]=$'\207' + [0x0088]=$'\210' [0x0089]=$'\211' [0x008a]=$'\212' [0x008b]=$'\213' [0x008c]=$'\214' + [0x008d]=$'\215' [0x008e]=$'\216' [0x008f]=$'\217' [0x0090]=$'\220' [0x0091]=$'\221' + [0x0092]=$'\222' [0x0093]=$'\223' [0x0094]=$'\224' [0x0095]=$'\225' [0x0096]=$'\226' + [0x0097]=$'\227' [0x0098]=$'\230' [0x0099]=$'\231' [0x009a]=$'\232' [0x009b]=$'\233' + [0x009c]=$'\234' [0x009d]=$'\235' [0x009e]=$'\236' [0x009f]=$'\237' [0x00a0]=$'\240' + [0x00a1]=$'\241' [0x00a2]=$'\242' [0x00a3]=$'\243' [0x00a4]=$'\244' [0x00a5]=$'\245' + [0x00a6]=$'\246' [0x00a7]=$'\247' [0x00a8]=$'\250' [0x00a9]=$'\251' [0x00aa]=$'\252' + [0x00ab]=$'\253' [0x00ac]=$'\254' [0x00ad]=$'\255' [0x00ae]=$'\256' [0x00af]=$'\257' + [0x00b0]=$'\260' [0x00b1]=$'\261' [0x00b2]=$'\262' [0x00b3]=$'\263' [0x00b4]=$'\264' + [0x00b5]=$'\265' [0x00b6]=$'\266' [0x00b7]=$'\267' [0x00b8]=$'\270' [0x00b9]=$'\271' + [0x00ba]=$'\272' [0x00bb]=$'\273' [0x00bc]=$'\274' [0x00bd]=$'\275' [0x00be]=$'\276' + [0x00bf]=$'\277' [0x00c0]=$'\300' [0x00c1]=$'\301' [0x00c2]=$'\302' [0x00c3]=$'\303' + [0x00c4]=$'\304' [0x00c5]=$'\305' [0x00c6]=$'\306' [0x00c7]=$'\307' [0x00c8]=$'\310' + [0x00c9]=$'\311' [0x00ca]=$'\312' [0x00cb]=$'\313' [0x00cc]=$'\314' [0x00cd]=$'\315' + [0x00ce]=$'\316' [0x00cf]=$'\317' [0x00d0]=$'\320' [0x00d1]=$'\321' [0x00d2]=$'\322' + [0x00d3]=$'\323' [0x00d4]=$'\324' [0x00d5]=$'\325' [0x00d6]=$'\326' [0x00d7]=$'\327' + [0x00d8]=$'\330' [0x00d9]=$'\331' [0x00da]=$'\332' [0x00db]=$'\333' [0x00dc]=$'\334' + [0x00dd]=$'\335' [0x00de]=$'\336' [0x00df]=$'\337' [0x00e0]=$'\340' [0x00e1]=$'\341' + [0x00e2]=$'\342' [0x00e3]=$'\343' [0x00e4]=$'\344' [0x00e5]=$'\345' [0x00e6]=$'\346' + [0x00e7]=$'\347' [0x00e8]=$'\350' [0x00e9]=$'\351' [0x00ea]=$'\352' [0x00eb]=$'\353' + [0x00ec]=$'\354' [0x00ed]=$'\355' [0x00ee]=$'\356' [0x00ef]=$'\357' [0x00f0]=$'\360' + [0x00f1]=$'\361' [0x00f2]=$'\362' [0x00f3]=$'\363' [0x00f4]=$'\364' [0x00f5]=$'\365' + [0x00f6]=$'\366' [0x00f7]=$'\367' [0x00f8]=$'\370' [0x00f9]=$'\371' [0x00fa]=$'\372' + [0x00fb]=$'\373' [0x00fc]=$'\374' [0x00fd]=$'\375' [0x00fe]=$'\376' +) + +TestCodePage fr_FR.ISO8859-1 fr_FR_ISO_8859_1 + +zh_TW_BIG5=( + [0x00f6]=$'\366' [0x00f7]=$'\367' [0x00f8]=$'\370' [0x00f9]=$'\371' [0x00fa]=$'\372' + [0x00fb]=$'\373' [0x00fc]=$'\374' [0x00fd]=$'\375' [0x00fe]=$'\376' +) +TestCodePage zh_TW.BIG5 zh_TW_BIG5 + +jp_JP_SHIFT_JIS=( + [0x0001]=$'\x01' # START OF HEADING + [0x0002]=$'\x02' # START OF TEXT + [0x0003]=$'\x03' # END OF TEXT + [0x0004]=$'\x04' # END OF TRANSMISSION + [0x0005]=$'\x05' # ENQUIRY + [0x0006]=$'\x06' # ACKNOWLEDGE + [0x0007]=$'\x07' # BELL + [0x0008]=$'\x08' # BACKSPACE + [0x0009]=$'\x09' # HORIZONTAL TABULATION + [0x000A]=$'\x0A' # LINE FEED + [0x000B]=$'\x0B' # VERTICAL TABULATION + [0x000C]=$'\x0C' # FORM FEED + [0x000D]=$'\x0D' # CARRIAGE RETURN + [0x000E]=$'\x0E' # SHIFT OUT + [0x000F]=$'\x0F' # SHIFT IN + [0x0010]=$'\x10' # DATA LINK ESCAPE + [0x0011]=$'\x11' # DEVICE CONTROL ONE + [0x0012]=$'\x12' # DEVICE CONTROL TWO + [0x0013]=$'\x13' # DEVICE CONTROL THREE + [0x0014]=$'\x14' # DEVICE CONTROL FOUR + [0x0015]=$'\x15' # NEGATIVE ACKNOWLEDGE + [0x0016]=$'\x16' # SYNCHRONOUS IDLE + [0x0017]=$'\x17' # END OF TRANSMISSION BLOCK + [0x0018]=$'\x18' # CANCEL + [0x0019]=$'\x19' # END OF MEDIUM + [0x001A]=$'\x1A' # SUBSTITUTE + [0x001B]=$'\x1B' # ESCAPE + [0x001C]=$'\x1C' # FILE SEPARATOR + [0x001D]=$'\x1D' # GROUP SEPARATOR + [0x001E]=$'\x1E' # RECORD SEPARATOR + [0x001F]=$'\x1F' # UNIT SEPARATOR + [0x0020]=$'\x20' # SPACE + [0x0021]=$'\x21' # EXCLAMATION MARK + [0x0022]=$'\x22' # QUOTATION MARK + [0x0023]=$'\x23' # NUMBER SIGN + [0x0024]=$'\x24' # DOLLAR SIGN + [0x0025]=$'\x25' # PERCENT SIGN + [0x0026]=$'\x26' # AMPERSAND + [0x0027]=$'\x27' # APOSTROPHE + [0x0028]=$'\x28' # LEFT PARENTHESIS + [0x0029]=$'\x29' # RIGHT PARENTHESIS + [0x002A]=$'\x2A' # ASTERISK + [0x002B]=$'\x2B' # PLUS SIGN + [0x002C]=$'\x2C' # COMMA + [0x002D]=$'\x2D' # HYPHEN-MINUS + [0x002E]=$'\x2E' # FULL STOP + [0x002F]=$'\x2F' # SOLIDUS + [0x0030]=$'\x30' # DIGIT ZERO + [0x0031]=$'\x31' # DIGIT ONE + [0x0032]=$'\x32' # DIGIT TWO + [0x0033]=$'\x33' # DIGIT THREE + [0x0034]=$'\x34' # DIGIT FOUR + [0x0035]=$'\x35' # DIGIT FIVE + [0x0036]=$'\x36' # DIGIT SIX + [0x0037]=$'\x37' # DIGIT SEVEN + [0x0038]=$'\x38' # DIGIT EIGHT + [0x0039]=$'\x39' # DIGIT NINE + [0x003A]=$'\x3A' # COLON + [0x003B]=$'\x3B' # SEMICOLON + [0x003C]=$'\x3C' # LESS-THAN SIGN + [0x003D]=$'\x3D' # EQUALS SIGN + [0x003E]=$'\x3E' # GREATER-THAN SIGN + [0x003F]=$'\x3F' # QUESTION MARK + [0x0040]=$'\x40' # COMMERCIAL AT + [0x0041]=$'\x41' # LATIN CAPITAL LETTER A + [0x0042]=$'\x42' # LATIN CAPITAL LETTER B + [0x0043]=$'\x43' # LATIN CAPITAL LETTER C + [0x0044]=$'\x44' # LATIN CAPITAL LETTER D + [0x0045]=$'\x45' # LATIN CAPITAL LETTER E + [0x0046]=$'\x46' # LATIN CAPITAL LETTER F + [0x0047]=$'\x47' # LATIN CAPITAL LETTER G + [0x0048]=$'\x48' # LATIN CAPITAL LETTER H + [0x0049]=$'\x49' # LATIN CAPITAL LETTER I + [0x004A]=$'\x4A' # LATIN CAPITAL LETTER J + [0x004B]=$'\x4B' # LATIN CAPITAL LETTER K + [0x004C]=$'\x4C' # LATIN CAPITAL LETTER L + [0x004D]=$'\x4D' # LATIN CAPITAL LETTER M + [0x004E]=$'\x4E' # LATIN CAPITAL LETTER N + [0x004F]=$'\x4F' # LATIN CAPITAL LETTER O + [0x0050]=$'\x50' # LATIN CAPITAL LETTER P + [0x0051]=$'\x51' # LATIN CAPITAL LETTER Q + [0x0052]=$'\x52' # LATIN CAPITAL LETTER R + [0x0053]=$'\x53' # LATIN CAPITAL LETTER S + [0x0054]=$'\x54' # LATIN CAPITAL LETTER T + [0x0055]=$'\x55' # LATIN CAPITAL LETTER U + [0x0056]=$'\x56' # LATIN CAPITAL LETTER V + [0x0057]=$'\x57' # LATIN CAPITAL LETTER W + [0x0058]=$'\x58' # LATIN CAPITAL LETTER X + [0x0059]=$'\x59' # LATIN CAPITAL LETTER Y + [0x005A]=$'\x5A' # LATIN CAPITAL LETTER Z + [0x005B]=$'\x5B' # LEFT SQUARE BRACKET + [0x005C]=$'\x5C' # REVERSE SOLIDUS (YEN SIGN) + [0x005D]=$'\x5D' # RIGHT SQUARE BRACKET + [0x005E]=$'\x5E' # CIRCUMFLEX ACCENT + [0x005F]=$'\x5F' # LOW LINE + [0x0060]=$'\x60' # GRAVE ACCENT + [0x0061]=$'\x61' # LATIN SMALL LETTER A + [0x0062]=$'\x62' # LATIN SMALL LETTER B + [0x0063]=$'\x63' # LATIN SMALL LETTER C + [0x0064]=$'\x64' # LATIN SMALL LETTER D + [0x0065]=$'\x65' # LATIN SMALL LETTER E + [0x0066]=$'\x66' # LATIN SMALL LETTER F + [0x0067]=$'\x67' # LATIN SMALL LETTER G + [0x0068]=$'\x68' # LATIN SMALL LETTER H + [0x0069]=$'\x69' # LATIN SMALL LETTER I + [0x006A]=$'\x6A' # LATIN SMALL LETTER J + [0x006B]=$'\x6B' # LATIN SMALL LETTER K + [0x006C]=$'\x6C' # LATIN SMALL LETTER L + [0x006D]=$'\x6D' # LATIN SMALL LETTER M + [0x006E]=$'\x6E' # LATIN SMALL LETTER N + [0x006F]=$'\x6F' # LATIN SMALL LETTER O + [0x0070]=$'\x70' # LATIN SMALL LETTER P + [0x0071]=$'\x71' # LATIN SMALL LETTER Q + [0x0072]=$'\x72' # LATIN SMALL LETTER R + [0x0073]=$'\x73' # LATIN SMALL LETTER S + [0x0074]=$'\x74' # LATIN SMALL LETTER T + [0x0075]=$'\x75' # LATIN SMALL LETTER U + [0x0076]=$'\x76' # LATIN SMALL LETTER V + [0x0077]=$'\x77' # LATIN SMALL LETTER W + [0x0078]=$'\x78' # LATIN SMALL LETTER X + [0x0079]=$'\x79' # LATIN SMALL LETTER Y + [0x007A]=$'\x7A' # LATIN SMALL LETTER Z + [0x007B]=$'\x7B' # LEFT CURLY BRACKET + [0x007C]=$'\x7C' # VERTICAL LINE + [0x007D]=$'\x7D' # RIGHT CURLY BRACKET + [0x007E]=$'\x7E' # TILDE + [0x007F]=$'\x7F' # DELETE + [0xFF61]=$'\xA1' # HALFWIDTH IDEOGRAPHIC FULL STOP + [0xFF62]=$'\xA2' # HALFWIDTH LEFT CORNER BRACKET + [0xFF63]=$'\xA3' # HALFWIDTH RIGHT CORNER BRACKET + [0xFF64]=$'\xA4' # HALFWIDTH IDEOGRAPHIC COMMA + [0xFF65]=$'\xA5' # HALFWIDTH KATAKANA MIDDLE DOT + [0xFF66]=$'\xA6' # HALFWIDTH KATAKANA LETTER WO + [0xFF67]=$'\xA7' # HALFWIDTH KATAKANA LETTER SMALL A + [0xFF68]=$'\xA8' # HALFWIDTH KATAKANA LETTER SMALL I + [0xFF69]=$'\xA9' # HALFWIDTH KATAKANA LETTER SMALL U + [0xFF6A]=$'\xAA' # HALFWIDTH KATAKANA LETTER SMALL E + [0xFF6B]=$'\xAB' # HALFWIDTH KATAKANA LETTER SMALL O + [0xFF6C]=$'\xAC' # HALFWIDTH KATAKANA LETTER SMALL YA + [0xFF6D]=$'\xAD' # HALFWIDTH KATAKANA LETTER SMALL YU + [0xFF6E]=$'\xAE' # HALFWIDTH KATAKANA LETTER SMALL YO + [0xFF6F]=$'\xAF' # HALFWIDTH KATAKANA LETTER SMALL TU + [0xFF70]=$'\xB0' # HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK + [0xFF71]=$'\xB1' # HALFWIDTH KATAKANA LETTER A + [0xFF72]=$'\xB2' # HALFWIDTH KATAKANA LETTER I + [0xFF73]=$'\xB3' # HALFWIDTH KATAKANA LETTER U + [0xFF74]=$'\xB4' # HALFWIDTH KATAKANA LETTER E + [0xFF75]=$'\xB5' # HALFWIDTH KATAKANA LETTER O + [0xFF76]=$'\xB6' # HALFWIDTH KATAKANA LETTER KA + [0xFF77]=$'\xB7' # HALFWIDTH KATAKANA LETTER KI + [0xFF78]=$'\xB8' # HALFWIDTH KATAKANA LETTER KU + [0xFF79]=$'\xB9' # HALFWIDTH KATAKANA LETTER KE + [0xFF7A]=$'\xBA' # HALFWIDTH KATAKANA LETTER KO + [0xFF7B]=$'\xBB' # HALFWIDTH KATAKANA LETTER SA + [0xFF7C]=$'\xBC' # HALFWIDTH KATAKANA LETTER SI + [0xFF7D]=$'\xBD' # HALFWIDTH KATAKANA LETTER SU + [0xFF7E]=$'\xBE' # HALFWIDTH KATAKANA LETTER SE + [0xFF7F]=$'\xBF' # HALFWIDTH KATAKANA LETTER SO + [0xFF80]=$'\xC0' # HALFWIDTH KATAKANA LETTER TA + [0xFF81]=$'\xC1' # HALFWIDTH KATAKANA LETTER TI + [0xFF82]=$'\xC2' # HALFWIDTH KATAKANA LETTER TU + [0xFF83]=$'\xC3' # HALFWIDTH KATAKANA LETTER TE + [0xFF84]=$'\xC4' # HALFWIDTH KATAKANA LETTER TO + [0xFF85]=$'\xC5' # HALFWIDTH KATAKANA LETTER NA + [0xFF86]=$'\xC6' # HALFWIDTH KATAKANA LETTER NI + [0xFF87]=$'\xC7' # HALFWIDTH KATAKANA LETTER NU + [0xFF88]=$'\xC8' # HALFWIDTH KATAKANA LETTER NE + [0xFF89]=$'\xC9' # HALFWIDTH KATAKANA LETTER NO + [0xFF8A]=$'\xCA' # HALFWIDTH KATAKANA LETTER HA + [0xFF8B]=$'\xCB' # HALFWIDTH KATAKANA LETTER HI + [0xFF8C]=$'\xCC' # HALFWIDTH KATAKANA LETTER HU + [0xFF8D]=$'\xCD' # HALFWIDTH KATAKANA LETTER HE + [0xFF8E]=$'\xCE' # HALFWIDTH KATAKANA LETTER HO + [0xFF8F]=$'\xCF' # HALFWIDTH KATAKANA LETTER MA + [0xFF90]=$'\xD0' # HALFWIDTH KATAKANA LETTER MI + [0xFF91]=$'\xD1' # HALFWIDTH KATAKANA LETTER MU + [0xFF92]=$'\xD2' # HALFWIDTH KATAKANA LETTER ME + [0xFF93]=$'\xD3' # HALFWIDTH KATAKANA LETTER MO + [0xFF94]=$'\xD4' # HALFWIDTH KATAKANA LETTER YA + [0xFF95]=$'\xD5' # HALFWIDTH KATAKANA LETTER YU + [0xFF96]=$'\xD6' # HALFWIDTH KATAKANA LETTER YO + [0xFF97]=$'\xD7' # HALFWIDTH KATAKANA LETTER RA + [0xFF98]=$'\xD8' # HALFWIDTH KATAKANA LETTER RI + [0xFF99]=$'\xD9' # HALFWIDTH KATAKANA LETTER RU + [0xFF9A]=$'\xDA' # HALFWIDTH KATAKANA LETTER RE + [0xFF9B]=$'\xDB' # HALFWIDTH KATAKANA LETTER RO + [0xFF9C]=$'\xDC' # HALFWIDTH KATAKANA LETTER WA + [0xFF9D]=$'\xDD' # HALFWIDTH KATAKANA LETTER N + [0xFF9E]=$'\xDE' # HALFWIDTH KATAKANA VOICED SOUND MARK + [0xFF9F]=$'\xDF' # HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK +) +#TestCodePage ja_JP.SHIFT_JIS jp_JP_SHIFT_JIS +TestCodePage ja_JP.SJIS jp_JP_SHIFT_JIS + +#for ((x=1;x<1000;x++)); do printf ' [0x%04x]=%-11q' "$x" "$(printf "$(printf '\\U%08x' $x)")" ; [ $(($x%5)) = 0 ] && echo; done +C_UTF_8=( + [0x0001]=$'\001' [0x0002]=$'\002' [0x0003]=$'\003' [0x0004]=$'\004' [0x0005]=$'\005' + [0x0006]=$'\006' [0x0007]=$'\a' [0x0008]=$'\b' [0x0009]=$'\t' [0x000a]='' + [0x000b]=$'\v' [0x000c]=$'\f' [0x000d]=$'\r' [0x000e]=$'\016' [0x000f]=$'\017' + [0x0010]=$'\020' [0x0011]=$'\021' [0x0012]=$'\022' [0x0013]=$'\023' [0x0014]=$'\024' + [0x0015]=$'\025' [0x0016]=$'\026' [0x0017]=$'\027' [0x0018]=$'\030' [0x0019]=$'\031' + [0x001a]=$'\032' [0x001b]=$'\E' [0x001c]=$'\034' [0x001d]=$'\035' [0x001e]=$'\036' + [0x001f]=$'\037' [0x0020]=\ [0x0021]=\! [0x0022]=\" [0x0023]=\# + [0x0024]=\$ [0x0025]=% [0x0026]=\& [0x0027]=\' [0x0028]=\( + [0x0029]=\) [0x002a]=\* [0x002b]=+ [0x002c]=\, [0x002d]=- + [0x002e]=. [0x002f]=/ [0x0030]=0 [0x0031]=1 [0x0032]=2 + [0x0033]=3 [0x0034]=4 [0x0035]=5 [0x0036]=6 [0x0037]=7 + [0x0038]=8 [0x0039]=9 [0x003a]=: [0x003b]=\; [0x003c]=\< + [0x003d]== [0x003e]=\> [0x003f]=\? [0x0040]=@ [0x0041]=A + [0x0042]=B [0x0043]=C [0x0044]=D [0x0045]=E [0x0046]=F + [0x0047]=G [0x0048]=H [0x0049]=I [0x004a]=J [0x004b]=K + [0x004c]=L [0x004d]=M [0x004e]=N [0x004f]=O [0x0050]=P + [0x0051]=Q [0x0052]=R [0x0053]=S [0x0054]=T [0x0055]=U + [0x0056]=V [0x0057]=W [0x0058]=X [0x0059]=Y [0x005a]=Z + [0x005b]=\[ [0x005c]=\\ [0x005d]=\] [0x005e]=\^ [0x005f]=_ + [0x0060]=\` [0x0061]=a [0x0062]=b [0x0063]=c [0x0064]=d + [0x0065]=e [0x0066]=f [0x0067]=g [0x0068]=h [0x0069]=i + [0x006a]=j [0x006b]=k [0x006c]=l [0x006d]=m [0x006e]=n + [0x006f]=o [0x0070]=p [0x0071]=q [0x0072]=r [0x0073]=s + [0x0074]=t [0x0075]=u [0x0076]=v [0x0077]=w [0x0078]=x + [0x0079]=y [0x007a]=z [0x007b]=\{ [0x007c]=\| [0x007d]=\} + [0x007e]="~" [0x007f]=$'\177' [0x0080]=$'\302\200' [0x0081]=$'\302\201' [0x0082]=$'\302\202' + [0x0083]=$'\302\203' [0x0084]=$'\302\204' [0x0085]=$'\302\205' [0x0086]=$'\302\206' [0x0087]=$'\302\207' + [0x0088]=$'\302\210' [0x0089]=$'\302\211' [0x008a]=$'\302\212' [0x008b]=$'\302\213' [0x008c]=$'\302\214' + [0x008d]=$'\302\215' [0x008e]=$'\302\216' [0x008f]=$'\302\217' [0x0090]=$'\302\220' [0x0091]=$'\302\221' + [0x0092]=$'\302\222' [0x0093]=$'\302\223' [0x0094]=$'\302\224' [0x0095]=$'\302\225' [0x0096]=$'\302\226' + [0x0097]=$'\302\227' [0x0098]=$'\302\230' [0x0099]=$'\302\231' [0x009a]=$'\302\232' [0x009b]=$'\302\233' + [0x009c]=$'\302\234' [0x009d]=$'\302\235' [0x009e]=$'\302\236' [0x009f]=$'\302\237' [0x00a0]=$'\302\240' + [0x00a1]=$'\302\241' [0x00a2]=$'\302\242' [0x00a3]=$'\302\243' [0x00a4]=$'\302\244' [0x00a5]=$'\302\245' + [0x00a6]=$'\302\246' [0x00a7]=$'\302\247' [0x00a8]=$'\302\250' [0x00a9]=$'\302\251' [0x00aa]=$'\302\252' + [0x00ab]=$'\302\253' [0x00ac]=$'\302\254' [0x00ad]=$'\302\255' [0x00ae]=$'\302\256' [0x00af]=$'\302\257' + [0x00b0]=$'\302\260' [0x00b1]=$'\302\261' [0x00b2]=$'\302\262' [0x00b3]=$'\302\263' [0x00b4]=$'\302\264' + [0x00b5]=$'\302\265' [0x00b6]=$'\302\266' [0x00b7]=$'\302\267' [0x00b8]=$'\302\270' [0x00b9]=$'\302\271' + [0x00ba]=$'\302\272' [0x00bb]=$'\302\273' [0x00bc]=$'\302\274' [0x00bd]=$'\302\275' [0x00be]=$'\302\276' + [0x00bf]=$'\302\277' [0x00c0]=$'\303\200' [0x00c1]=$'\303\201' [0x00c2]=$'\303\202' [0x00c3]=$'\303\203' + [0x00c4]=$'\303\204' [0x00c5]=$'\303\205' [0x00c6]=$'\303\206' [0x00c7]=$'\303\207' [0x00c8]=$'\303\210' + [0x00c9]=$'\303\211' [0x00ca]=$'\303\212' [0x00cb]=$'\303\213' [0x00cc]=$'\303\214' [0x00cd]=$'\303\215' + [0x00ce]=$'\303\216' [0x00cf]=$'\303\217' [0x00d0]=$'\303\220' [0x00d1]=$'\303\221' [0x00d2]=$'\303\222' + [0x00d3]=$'\303\223' [0x00d4]=$'\303\224' [0x00d5]=$'\303\225' [0x00d6]=$'\303\226' [0x00d7]=$'\303\227' + [0x00d8]=$'\303\230' [0x00d9]=$'\303\231' [0x00da]=$'\303\232' [0x00db]=$'\303\233' [0x00dc]=$'\303\234' + [0x00dd]=$'\303\235' [0x00de]=$'\303\236' [0x00df]=$'\303\237' [0x00e0]=$'\303\240' [0x00e1]=$'\303\241' + [0x00e2]=$'\303\242' [0x00e3]=$'\303\243' [0x00e4]=$'\303\244' [0x00e5]=$'\303\245' [0x00e6]=$'\303\246' + [0x00e7]=$'\303\247' [0x00e8]=$'\303\250' [0x00e9]=$'\303\251' [0x00ea]=$'\303\252' [0x00eb]=$'\303\253' + [0x00ec]=$'\303\254' [0x00ed]=$'\303\255' [0x00ee]=$'\303\256' [0x00ef]=$'\303\257' [0x00f0]=$'\303\260' + [0x00f1]=$'\303\261' [0x00f2]=$'\303\262' [0x00f3]=$'\303\263' [0x00f4]=$'\303\264' [0x00f5]=$'\303\265' + [0x00f6]=$'\303\266' [0x00f7]=$'\303\267' [0x00f8]=$'\303\270' [0x00f9]=$'\303\271' [0x00fa]=$'\303\272' + [0x00fb]=$'\303\273' [0x00fc]=$'\303\274' [0x00fd]=$'\303\275' [0x00fe]=$'\303\276' [0x00ff]=$'\303\277' + [0x0100]=$'\304\200' [0x0101]=$'\304\201' [0x0102]=$'\304\202' [0x0103]=$'\304\203' [0x0104]=$'\304\204' + [0x0105]=$'\304\205' [0x0106]=$'\304\206' [0x0107]=$'\304\207' [0x0108]=$'\304\210' [0x0109]=$'\304\211' + [0x010a]=$'\304\212' [0x010b]=$'\304\213' [0x010c]=$'\304\214' [0x010d]=$'\304\215' [0x010e]=$'\304\216' + [0x010f]=$'\304\217' [0x0110]=$'\304\220' [0x0111]=$'\304\221' [0x0112]=$'\304\222' [0x0113]=$'\304\223' + [0x0114]=$'\304\224' [0x0115]=$'\304\225' [0x0116]=$'\304\226' [0x0117]=$'\304\227' [0x0118]=$'\304\230' + [0x0119]=$'\304\231' [0x011a]=$'\304\232' [0x011b]=$'\304\233' [0x011c]=$'\304\234' [0x011d]=$'\304\235' + [0x011e]=$'\304\236' [0x011f]=$'\304\237' [0x0120]=$'\304\240' [0x0121]=$'\304\241' [0x0122]=$'\304\242' + [0x0123]=$'\304\243' [0x0124]=$'\304\244' [0x0125]=$'\304\245' [0x0126]=$'\304\246' [0x0127]=$'\304\247' + [0x0128]=$'\304\250' [0x0129]=$'\304\251' [0x012a]=$'\304\252' [0x012b]=$'\304\253' [0x012c]=$'\304\254' + [0x012d]=$'\304\255' [0x012e]=$'\304\256' [0x012f]=$'\304\257' [0x0130]=$'\304\260' [0x0131]=$'\304\261' + [0x0132]=$'\304\262' [0x0133]=$'\304\263' [0x0134]=$'\304\264' [0x0135]=$'\304\265' [0x0136]=$'\304\266' + [0x0137]=$'\304\267' [0x0138]=$'\304\270' [0x0139]=$'\304\271' [0x013a]=$'\304\272' [0x013b]=$'\304\273' + [0x013c]=$'\304\274' [0x013d]=$'\304\275' [0x013e]=$'\304\276' [0x013f]=$'\304\277' [0x0140]=$'\305\200' + [0x0141]=$'\305\201' [0x0142]=$'\305\202' [0x0143]=$'\305\203' [0x0144]=$'\305\204' [0x0145]=$'\305\205' + [0x0146]=$'\305\206' [0x0147]=$'\305\207' [0x0148]=$'\305\210' [0x0149]=$'\305\211' [0x014a]=$'\305\212' + [0x014b]=$'\305\213' [0x014c]=$'\305\214' [0x014d]=$'\305\215' [0x014e]=$'\305\216' [0x014f]=$'\305\217' + [0x0150]=$'\305\220' [0x0151]=$'\305\221' [0x0152]=$'\305\222' [0x0153]=$'\305\223' [0x0154]=$'\305\224' + [0x0155]=$'\305\225' [0x0156]=$'\305\226' [0x0157]=$'\305\227' [0x0158]=$'\305\230' [0x0159]=$'\305\231' + [0x015a]=$'\305\232' [0x015b]=$'\305\233' [0x015c]=$'\305\234' [0x015d]=$'\305\235' [0x015e]=$'\305\236' + [0x015f]=$'\305\237' [0x0160]=$'\305\240' [0x0161]=$'\305\241' [0x0162]=$'\305\242' [0x0163]=$'\305\243' + [0x0164]=$'\305\244' [0x0165]=$'\305\245' [0x0166]=$'\305\246' [0x0167]=$'\305\247' [0x0168]=$'\305\250' + [0x0169]=$'\305\251' [0x016a]=$'\305\252' [0x016b]=$'\305\253' [0x016c]=$'\305\254' [0x016d]=$'\305\255' + [0x016e]=$'\305\256' [0x016f]=$'\305\257' [0x0170]=$'\305\260' [0x0171]=$'\305\261' [0x0172]=$'\305\262' + [0x0173]=$'\305\263' [0x0174]=$'\305\264' [0x0175]=$'\305\265' [0x0176]=$'\305\266' [0x0177]=$'\305\267' + [0x0178]=$'\305\270' [0x0179]=$'\305\271' [0x017a]=$'\305\272' [0x017b]=$'\305\273' [0x017c]=$'\305\274' + [0x017d]=$'\305\275' [0x017e]=$'\305\276' [0x017f]=$'\305\277' [0x0180]=$'\306\200' [0x0181]=$'\306\201' + [0x0182]=$'\306\202' [0x0183]=$'\306\203' [0x0184]=$'\306\204' [0x0185]=$'\306\205' [0x0186]=$'\306\206' + [0x0187]=$'\306\207' [0x0188]=$'\306\210' [0x0189]=$'\306\211' [0x018a]=$'\306\212' [0x018b]=$'\306\213' + [0x018c]=$'\306\214' [0x018d]=$'\306\215' [0x018e]=$'\306\216' [0x018f]=$'\306\217' [0x0190]=$'\306\220' + [0x0191]=$'\306\221' [0x0192]=$'\306\222' [0x0193]=$'\306\223' [0x0194]=$'\306\224' [0x0195]=$'\306\225' + [0x0196]=$'\306\226' [0x0197]=$'\306\227' [0x0198]=$'\306\230' [0x0199]=$'\306\231' [0x019a]=$'\306\232' + [0x019b]=$'\306\233' [0x019c]=$'\306\234' [0x019d]=$'\306\235' [0x019e]=$'\306\236' [0x019f]=$'\306\237' + [0x01a0]=$'\306\240' [0x01a1]=$'\306\241' [0x01a2]=$'\306\242' [0x01a3]=$'\306\243' [0x01a4]=$'\306\244' + [0x01a5]=$'\306\245' [0x01a6]=$'\306\246' [0x01a7]=$'\306\247' [0x01a8]=$'\306\250' [0x01a9]=$'\306\251' + [0x01aa]=$'\306\252' [0x01ab]=$'\306\253' [0x01ac]=$'\306\254' [0x01ad]=$'\306\255' [0x01ae]=$'\306\256' + [0x01af]=$'\306\257' [0x01b0]=$'\306\260' [0x01b1]=$'\306\261' [0x01b2]=$'\306\262' [0x01b3]=$'\306\263' + [0x01b4]=$'\306\264' [0x01b5]=$'\306\265' [0x01b6]=$'\306\266' [0x01b7]=$'\306\267' [0x01b8]=$'\306\270' + [0x01b9]=$'\306\271' [0x01ba]=$'\306\272' [0x01bb]=$'\306\273' [0x01bc]=$'\306\274' [0x01bd]=$'\306\275' + [0x01be]=$'\306\276' [0x01bf]=$'\306\277' [0x01c0]=$'\307\200' [0x01c1]=$'\307\201' [0x01c2]=$'\307\202' + [0x01c3]=$'\307\203' [0x01c4]=$'\307\204' [0x01c5]=$'\307\205' [0x01c6]=$'\307\206' [0x01c7]=$'\307\207' + [0x01c8]=$'\307\210' [0x01c9]=$'\307\211' [0x01ca]=$'\307\212' [0x01cb]=$'\307\213' [0x01cc]=$'\307\214' + [0x01cd]=$'\307\215' [0x01ce]=$'\307\216' [0x01cf]=$'\307\217' [0x01d0]=$'\307\220' [0x01d1]=$'\307\221' + [0x01d2]=$'\307\222' [0x01d3]=$'\307\223' [0x01d4]=$'\307\224' [0x01d5]=$'\307\225' [0x01d6]=$'\307\226' + [0x01d7]=$'\307\227' [0x01d8]=$'\307\230' [0x01d9]=$'\307\231' [0x01da]=$'\307\232' [0x01db]=$'\307\233' + [0x01dc]=$'\307\234' [0x01dd]=$'\307\235' [0x01de]=$'\307\236' [0x01df]=$'\307\237' [0x01e0]=$'\307\240' + [0x01e1]=$'\307\241' [0x01e2]=$'\307\242' [0x01e3]=$'\307\243' [0x01e4]=$'\307\244' [0x01e5]=$'\307\245' + [0x01e6]=$'\307\246' [0x01e7]=$'\307\247' [0x01e8]=$'\307\250' [0x01e9]=$'\307\251' [0x01ea]=$'\307\252' + [0x01eb]=$'\307\253' [0x01ec]=$'\307\254' [0x01ed]=$'\307\255' [0x01ee]=$'\307\256' [0x01ef]=$'\307\257' + [0x01f0]=$'\307\260' [0x01f1]=$'\307\261' [0x01f2]=$'\307\262' [0x01f3]=$'\307\263' [0x01f4]=$'\307\264' + [0x01f5]=$'\307\265' [0x01f6]=$'\307\266' [0x01f7]=$'\307\267' [0x01f8]=$'\307\270' [0x01f9]=$'\307\271' + [0x01fa]=$'\307\272' [0x01fb]=$'\307\273' [0x01fc]=$'\307\274' [0x01fd]=$'\307\275' [0x01fe]=$'\307\276' + [0x01ff]=$'\307\277' [0x0200]=$'\310\200' [0x0201]=$'\310\201' [0x0202]=$'\310\202' [0x0203]=$'\310\203' + [0x0204]=$'\310\204' [0x0205]=$'\310\205' [0x0206]=$'\310\206' [0x0207]=$'\310\207' [0x0208]=$'\310\210' + [0x0209]=$'\310\211' [0x020a]=$'\310\212' [0x020b]=$'\310\213' [0x020c]=$'\310\214' [0x020d]=$'\310\215' + [0x020e]=$'\310\216' [0x020f]=$'\310\217' [0x0210]=$'\310\220' [0x0211]=$'\310\221' [0x0212]=$'\310\222' + [0x0213]=$'\310\223' [0x0214]=$'\310\224' [0x0215]=$'\310\225' [0x0216]=$'\310\226' [0x0217]=$'\310\227' + [0x0218]=$'\310\230' [0x0219]=$'\310\231' [0x021a]=$'\310\232' [0x021b]=$'\310\233' [0x021c]=$'\310\234' + [0x021d]=$'\310\235' [0x021e]=$'\310\236' [0x021f]=$'\310\237' [0x0220]=$'\310\240' [0x0221]=$'\310\241' + [0x0222]=$'\310\242' [0x0223]=$'\310\243' [0x0224]=$'\310\244' [0x0225]=$'\310\245' [0x0226]=$'\310\246' + [0x0227]=$'\310\247' [0x0228]=$'\310\250' [0x0229]=$'\310\251' [0x022a]=$'\310\252' [0x022b]=$'\310\253' + [0x022c]=$'\310\254' [0x022d]=$'\310\255' [0x022e]=$'\310\256' [0x022f]=$'\310\257' [0x0230]=$'\310\260' + [0x0231]=$'\310\261' [0x0232]=$'\310\262' [0x0233]=$'\310\263' [0x0234]=$'\310\264' [0x0235]=$'\310\265' + [0x0236]=$'\310\266' [0x0237]=$'\310\267' [0x0238]=$'\310\270' [0x0239]=$'\310\271' [0x023a]=$'\310\272' + [0x023b]=$'\310\273' [0x023c]=$'\310\274' [0x023d]=$'\310\275' [0x023e]=$'\310\276' [0x023f]=$'\310\277' + [0x0240]=$'\311\200' [0x0241]=$'\311\201' [0x0242]=$'\311\202' [0x0243]=$'\311\203' [0x0244]=$'\311\204' + [0x0245]=$'\311\205' [0x0246]=$'\311\206' [0x0247]=$'\311\207' [0x0248]=$'\311\210' [0x0249]=$'\311\211' + [0x024a]=$'\311\212' [0x024b]=$'\311\213' [0x024c]=$'\311\214' [0x024d]=$'\311\215' [0x024e]=$'\311\216' + [0x024f]=$'\311\217' [0x0250]=$'\311\220' [0x0251]=$'\311\221' [0x0252]=$'\311\222' [0x0253]=$'\311\223' + [0x0254]=$'\311\224' [0x0255]=$'\311\225' [0x0256]=$'\311\226' [0x0257]=$'\311\227' [0x0258]=$'\311\230' + [0x0259]=$'\311\231' [0x025a]=$'\311\232' [0x025b]=$'\311\233' [0x025c]=$'\311\234' [0x025d]=$'\311\235' + [0x025e]=$'\311\236' [0x025f]=$'\311\237' [0x0260]=$'\311\240' [0x0261]=$'\311\241' [0x0262]=$'\311\242' + [0x0263]=$'\311\243' [0x0264]=$'\311\244' [0x0265]=$'\311\245' [0x0266]=$'\311\246' [0x0267]=$'\311\247' + [0x0268]=$'\311\250' [0x0269]=$'\311\251' [0x026a]=$'\311\252' [0x026b]=$'\311\253' [0x026c]=$'\311\254' + [0x026d]=$'\311\255' [0x026e]=$'\311\256' [0x026f]=$'\311\257' [0x0270]=$'\311\260' [0x0271]=$'\311\261' + [0x0272]=$'\311\262' [0x0273]=$'\311\263' [0x0274]=$'\311\264' [0x0275]=$'\311\265' [0x0276]=$'\311\266' + [0x0277]=$'\311\267' [0x0278]=$'\311\270' [0x0279]=$'\311\271' [0x027a]=$'\311\272' [0x027b]=$'\311\273' + [0x027c]=$'\311\274' [0x027d]=$'\311\275' [0x027e]=$'\311\276' [0x027f]=$'\311\277' [0x0280]=$'\312\200' + [0x0281]=$'\312\201' [0x0282]=$'\312\202' [0x0283]=$'\312\203' [0x0284]=$'\312\204' [0x0285]=$'\312\205' + [0x0286]=$'\312\206' [0x0287]=$'\312\207' [0x0288]=$'\312\210' [0x0289]=$'\312\211' [0x028a]=$'\312\212' + [0x028b]=$'\312\213' [0x028c]=$'\312\214' [0x028d]=$'\312\215' [0x028e]=$'\312\216' [0x028f]=$'\312\217' + [0x0290]=$'\312\220' [0x0291]=$'\312\221' [0x0292]=$'\312\222' [0x0293]=$'\312\223' [0x0294]=$'\312\224' + [0x0295]=$'\312\225' [0x0296]=$'\312\226' [0x0297]=$'\312\227' [0x0298]=$'\312\230' [0x0299]=$'\312\231' + [0x029a]=$'\312\232' [0x029b]=$'\312\233' [0x029c]=$'\312\234' [0x029d]=$'\312\235' [0x029e]=$'\312\236' + [0x029f]=$'\312\237' [0x02a0]=$'\312\240' [0x02a1]=$'\312\241' [0x02a2]=$'\312\242' [0x02a3]=$'\312\243' + [0x02a4]=$'\312\244' [0x02a5]=$'\312\245' [0x02a6]=$'\312\246' [0x02a7]=$'\312\247' [0x02a8]=$'\312\250' + [0x02a9]=$'\312\251' [0x02aa]=$'\312\252' [0x02ab]=$'\312\253' [0x02ac]=$'\312\254' [0x02ad]=$'\312\255' + [0x02ae]=$'\312\256' [0x02af]=$'\312\257' [0x02b0]=$'\312\260' [0x02b1]=$'\312\261' [0x02b2]=$'\312\262' + [0x02b3]=$'\312\263' [0x02b4]=$'\312\264' [0x02b5]=$'\312\265' [0x02b6]=$'\312\266' [0x02b7]=$'\312\267' + [0x02b8]=$'\312\270' [0x02b9]=$'\312\271' [0x02ba]=$'\312\272' [0x02bb]=$'\312\273' [0x02bc]=$'\312\274' + [0x02bd]=$'\312\275' [0x02be]=$'\312\276' [0x02bf]=$'\312\277' [0x02c0]=$'\313\200' [0x02c1]=$'\313\201' + [0x02c2]=$'\313\202' [0x02c3]=$'\313\203' [0x02c4]=$'\313\204' [0x02c5]=$'\313\205' [0x02c6]=$'\313\206' + [0x02c7]=$'\313\207' [0x02c8]=$'\313\210' [0x02c9]=$'\313\211' [0x02ca]=$'\313\212' [0x02cb]=$'\313\213' + [0x02cc]=$'\313\214' [0x02cd]=$'\313\215' [0x02ce]=$'\313\216' [0x02cf]=$'\313\217' [0x02d0]=$'\313\220' + [0x02d1]=$'\313\221' [0x02d2]=$'\313\222' [0x02d3]=$'\313\223' [0x02d4]=$'\313\224' [0x02d5]=$'\313\225' + [0x02d6]=$'\313\226' [0x02d7]=$'\313\227' [0x02d8]=$'\313\230' [0x02d9]=$'\313\231' [0x02da]=$'\313\232' + [0x02db]=$'\313\233' [0x02dc]=$'\313\234' [0x02dd]=$'\313\235' [0x02de]=$'\313\236' [0x02df]=$'\313\237' + [0x02e0]=$'\313\240' [0x02e1]=$'\313\241' [0x02e2]=$'\313\242' [0x02e3]=$'\313\243' [0x02e4]=$'\313\244' + [0x02e5]=$'\313\245' [0x02e6]=$'\313\246' [0x02e7]=$'\313\247' [0x02e8]=$'\313\250' [0x02e9]=$'\313\251' + [0x02ea]=$'\313\252' [0x02eb]=$'\313\253' [0x02ec]=$'\313\254' [0x02ed]=$'\313\255' [0x02ee]=$'\313\256' + [0x02ef]=$'\313\257' [0x02f0]=$'\313\260' [0x02f1]=$'\313\261' [0x02f2]=$'\313\262' [0x02f3]=$'\313\263' + [0x02f4]=$'\313\264' [0x02f5]=$'\313\265' [0x02f6]=$'\313\266' [0x02f7]=$'\313\267' [0x02f8]=$'\313\270' + [0x02f9]=$'\313\271' [0x02fa]=$'\313\272' [0x02fb]=$'\313\273' [0x02fc]=$'\313\274' [0x02fd]=$'\313\275' + [0x02fe]=$'\313\276' [0x02ff]=$'\313\277' [0x0300]=$'\314\200' [0x0301]=$'\314\201' [0x0302]=$'\314\202' + [0x0303]=$'\314\203' [0x0304]=$'\314\204' [0x0305]=$'\314\205' [0x0306]=$'\314\206' [0x0307]=$'\314\207' + [0x0308]=$'\314\210' [0x0309]=$'\314\211' [0x030a]=$'\314\212' [0x030b]=$'\314\213' [0x030c]=$'\314\214' + [0x030d]=$'\314\215' [0x030e]=$'\314\216' [0x030f]=$'\314\217' [0x0310]=$'\314\220' [0x0311]=$'\314\221' + [0x0312]=$'\314\222' [0x0313]=$'\314\223' [0x0314]=$'\314\224' [0x0315]=$'\314\225' [0x0316]=$'\314\226' + [0x0317]=$'\314\227' [0x0318]=$'\314\230' [0x0319]=$'\314\231' [0x031a]=$'\314\232' [0x031b]=$'\314\233' + [0x031c]=$'\314\234' [0x031d]=$'\314\235' [0x031e]=$'\314\236' [0x031f]=$'\314\237' [0x0320]=$'\314\240' + [0x0321]=$'\314\241' [0x0322]=$'\314\242' [0x0323]=$'\314\243' [0x0324]=$'\314\244' [0x0325]=$'\314\245' + [0x0326]=$'\314\246' [0x0327]=$'\314\247' [0x0328]=$'\314\250' [0x0329]=$'\314\251' [0x032a]=$'\314\252' + [0x032b]=$'\314\253' [0x032c]=$'\314\254' [0x032d]=$'\314\255' [0x032e]=$'\314\256' [0x032f]=$'\314\257' + [0x0330]=$'\314\260' [0x0331]=$'\314\261' [0x0332]=$'\314\262' [0x0333]=$'\314\263' [0x0334]=$'\314\264' + [0x0335]=$'\314\265' [0x0336]=$'\314\266' [0x0337]=$'\314\267' [0x0338]=$'\314\270' [0x0339]=$'\314\271' + [0x033a]=$'\314\272' [0x033b]=$'\314\273' [0x033c]=$'\314\274' [0x033d]=$'\314\275' [0x033e]=$'\314\276' + [0x033f]=$'\314\277' [0x0340]=$'\315\200' [0x0341]=$'\315\201' [0x0342]=$'\315\202' [0x0343]=$'\315\203' + [0x0344]=$'\315\204' [0x0345]=$'\315\205' [0x0346]=$'\315\206' [0x0347]=$'\315\207' [0x0348]=$'\315\210' + [0x0349]=$'\315\211' [0x034a]=$'\315\212' [0x034b]=$'\315\213' [0x034c]=$'\315\214' [0x034d]=$'\315\215' + [0x034e]=$'\315\216' [0x034f]=$'\315\217' [0x0350]=$'\315\220' [0x0351]=$'\315\221' [0x0352]=$'\315\222' + [0x0353]=$'\315\223' [0x0354]=$'\315\224' [0x0355]=$'\315\225' [0x0356]=$'\315\226' [0x0357]=$'\315\227' + [0x0358]=$'\315\230' [0x0359]=$'\315\231' [0x035a]=$'\315\232' [0x035b]=$'\315\233' [0x035c]=$'\315\234' + [0x035d]=$'\315\235' [0x035e]=$'\315\236' [0x035f]=$'\315\237' [0x0360]=$'\315\240' [0x0361]=$'\315\241' + [0x0362]=$'\315\242' [0x0363]=$'\315\243' [0x0364]=$'\315\244' [0x0365]=$'\315\245' [0x0366]=$'\315\246' + [0x0367]=$'\315\247' [0x0368]=$'\315\250' [0x0369]=$'\315\251' [0x036a]=$'\315\252' [0x036b]=$'\315\253' + [0x036c]=$'\315\254' [0x036d]=$'\315\255' [0x036e]=$'\315\256' [0x036f]=$'\315\257' [0x0370]=$'\315\260' + [0x0371]=$'\315\261' [0x0372]=$'\315\262' [0x0373]=$'\315\263' [0x0374]=$'\315\264' [0x0375]=$'\315\265' + [0x0376]=$'\315\266' [0x0377]=$'\315\267' [0x0378]=$'\315\270' [0x0379]=$'\315\271' [0x037a]=$'\315\272' + [0x037b]=$'\315\273' [0x037c]=$'\315\274' [0x037d]=$'\315\275' [0x037e]=$'\315\276' [0x037f]=$'\315\277' + [0x0380]=$'\316\200' [0x0381]=$'\316\201' [0x0382]=$'\316\202' [0x0383]=$'\316\203' [0x0384]=$'\316\204' + [0x0385]=$'\316\205' [0x0386]=$'\316\206' [0x0387]=$'\316\207' [0x0388]=$'\316\210' [0x0389]=$'\316\211' + [0x038a]=$'\316\212' [0x038b]=$'\316\213' [0x038c]=$'\316\214' [0x038d]=$'\316\215' [0x038e]=$'\316\216' + [0x038f]=$'\316\217' [0x0390]=$'\316\220' [0x0391]=$'\316\221' [0x0392]=$'\316\222' [0x0393]=$'\316\223' + [0x0394]=$'\316\224' [0x0395]=$'\316\225' [0x0396]=$'\316\226' [0x0397]=$'\316\227' [0x0398]=$'\316\230' + [0x0399]=$'\316\231' [0x039a]=$'\316\232' [0x039b]=$'\316\233' [0x039c]=$'\316\234' [0x039d]=$'\316\235' + [0x039e]=$'\316\236' [0x039f]=$'\316\237' [0x03a0]=$'\316\240' [0x03a1]=$'\316\241' [0x03a2]=$'\316\242' + [0x03a3]=$'\316\243' [0x03a4]=$'\316\244' [0x03a5]=$'\316\245' [0x03a6]=$'\316\246' [0x03a7]=$'\316\247' + [0x03a8]=$'\316\250' [0x03a9]=$'\316\251' [0x03aa]=$'\316\252' [0x03ab]=$'\316\253' [0x03ac]=$'\316\254' + [0x03ad]=$'\316\255' [0x03ae]=$'\316\256' [0x03af]=$'\316\257' [0x03b0]=$'\316\260' [0x03b1]=$'\316\261' + [0x03b2]=$'\316\262' [0x03b3]=$'\316\263' [0x03b4]=$'\316\264' [0x03b5]=$'\316\265' [0x03b6]=$'\316\266' + [0x03b7]=$'\316\267' [0x03b8]=$'\316\270' [0x03b9]=$'\316\271' [0x03ba]=$'\316\272' [0x03bb]=$'\316\273' + [0x03bc]=$'\316\274' [0x03bd]=$'\316\275' [0x03be]=$'\316\276' [0x03bf]=$'\316\277' [0x03c0]=$'\317\200' + [0x03c1]=$'\317\201' [0x03c2]=$'\317\202' [0x03c3]=$'\317\203' [0x03c4]=$'\317\204' [0x03c5]=$'\317\205' + [0x03c6]=$'\317\206' [0x03c7]=$'\317\207' [0x03c8]=$'\317\210' [0x03c9]=$'\317\211' [0x03ca]=$'\317\212' + [0x03cb]=$'\317\213' [0x03cc]=$'\317\214' [0x03cd]=$'\317\215' [0x03ce]=$'\317\216' [0x03cf]=$'\317\217' + [0x03d0]=$'\317\220' [0x03d1]=$'\317\221' [0x03d2]=$'\317\222' [0x03d3]=$'\317\223' [0x03d4]=$'\317\224' + [0x03d5]=$'\317\225' [0x03d6]=$'\317\226' [0x03d7]=$'\317\227' [0x03d8]=$'\317\230' [0x03d9]=$'\317\231' + [0x03da]=$'\317\232' [0x03db]=$'\317\233' [0x03dc]=$'\317\234' [0x03dd]=$'\317\235' [0x03de]=$'\317\236' + [0x03df]=$'\317\237' [0x03e0]=$'\317\240' [0x03e1]=$'\317\241' [0x03e2]=$'\317\242' [0x03e3]=$'\317\243' + [0x03e4]=$'\317\244' [0x03e5]=$'\317\245' [0x03e6]=$'\317\246' [0x03e7]=$'\317\247' + + + [0x1000]=$'\341\200\200' [0x1001]=$'\341\200\201' [0x1002]=$'\341\200\202' [0x1003]=$'\341\200\203' [0x1004]=$'\341\200\204' + [0x1005]=$'\341\200\205' [0x1006]=$'\341\200\206' [0x1007]=$'\341\200\207' [0x1008]=$'\341\200\210' [0x1009]=$'\341\200\211' + [0x100a]=$'\341\200\212' [0x100b]=$'\341\200\213' [0x100c]=$'\341\200\214' [0x100d]=$'\341\200\215' [0x100e]=$'\341\200\216' + [0x100f]=$'\341\200\217' [0x1010]=$'\341\200\220' [0x1011]=$'\341\200\221' [0x1012]=$'\341\200\222' [0x1013]=$'\341\200\223' + [0x1014]=$'\341\200\224' [0x1015]=$'\341\200\225' [0x1016]=$'\341\200\226' [0x1017]=$'\341\200\227' [0x1018]=$'\341\200\230' + [0x1019]=$'\341\200\231' [0x101a]=$'\341\200\232' [0x101b]=$'\341\200\233' [0x101c]=$'\341\200\234' [0x101d]=$'\341\200\235' + [0x101e]=$'\341\200\236' [0x101f]=$'\341\200\237' [0x1020]=$'\341\200\240' [0x1021]=$'\341\200\241' [0x1022]=$'\341\200\242' + [0x1023]=$'\341\200\243' [0x1024]=$'\341\200\244' [0x1025]=$'\341\200\245' [0x1026]=$'\341\200\246' [0x1027]=$'\341\200\247' + [0x1028]=$'\341\200\250' [0x1029]=$'\341\200\251' [0x102a]=$'\341\200\252' [0x102b]=$'\341\200\253' [0x102c]=$'\341\200\254' + [0x102d]=$'\341\200\255' [0x102e]=$'\341\200\256' [0x102f]=$'\341\200\257' [0x1030]=$'\341\200\260' [0x1031]=$'\341\200\261' + [0x1032]=$'\341\200\262' [0x1033]=$'\341\200\263' [0x1034]=$'\341\200\264' [0x1035]=$'\341\200\265' [0x1036]=$'\341\200\266' + [0x1037]=$'\341\200\267' [0x1038]=$'\341\200\270' [0x1039]=$'\341\200\271' [0x103a]=$'\341\200\272' [0x103b]=$'\341\200\273' + [0x103c]=$'\341\200\274' [0x103d]=$'\341\200\275' [0x103e]=$'\341\200\276' [0x103f]=$'\341\200\277' [0x1040]=$'\341\201\200' + [0x1041]=$'\341\201\201' [0x1042]=$'\341\201\202' [0x1043]=$'\341\201\203' [0x1044]=$'\341\201\204' [0x1045]=$'\341\201\205' + [0x1046]=$'\341\201\206' [0x1047]=$'\341\201\207' [0x1048]=$'\341\201\210' [0x1049]=$'\341\201\211' [0x104a]=$'\341\201\212' + [0x104b]=$'\341\201\213' [0x104c]=$'\341\201\214' [0x104d]=$'\341\201\215' [0x104e]=$'\341\201\216' [0x104f]=$'\341\201\217' + + [0x10000]=$'\360\220\200\200' [0x10001]=$'\360\220\200\201' [0x10002]=$'\360\220\200\202' [0x10003]=$'\360\220\200\203' [0x10004]=$'\360\220\200\204' + [0x10005]=$'\360\220\200\205' [0x10006]=$'\360\220\200\206' [0x10007]=$'\360\220\200\207' [0x10008]=$'\360\220\200\210' [0x10009]=$'\360\220\200\211' + [0x1000a]=$'\360\220\200\212' [0x1000b]=$'\360\220\200\213' [0x1000c]=$'\360\220\200\214' [0x1000d]=$'\360\220\200\215' [0x1000e]=$'\360\220\200\216' + [0x1000f]=$'\360\220\200\217' [0x10010]=$'\360\220\200\220' [0x10011]=$'\360\220\200\221' [0x10012]=$'\360\220\200\222' [0x10013]=$'\360\220\200\223' + [0x10014]=$'\360\220\200\224' [0x10015]=$'\360\220\200\225' [0x10016]=$'\360\220\200\226' [0x10017]=$'\360\220\200\227' [0x10018]=$'\360\220\200\230' + [0x10019]=$'\360\220\200\231' [0x1001a]=$'\360\220\200\232' [0x1001b]=$'\360\220\200\233' [0x1001c]=$'\360\220\200\234' [0x1001d]=$'\360\220\200\235' + [0x1001e]=$'\360\220\200\236' [0x1001f]=$'\360\220\200\237' [0x10020]=$'\360\220\200\240' [0x10021]=$'\360\220\200\241' [0x10022]=$'\360\220\200\242' + [0x10023]=$'\360\220\200\243' [0x10024]=$'\360\220\200\244' [0x10025]=$'\360\220\200\245' [0x10026]=$'\360\220\200\246' [0x10027]=$'\360\220\200\247' + [0x10028]=$'\360\220\200\250' [0x10029]=$'\360\220\200\251' [0x1002a]=$'\360\220\200\252' [0x1002b]=$'\360\220\200\253' [0x1002c]=$'\360\220\200\254' + [0x1002d]=$'\360\220\200\255' [0x1002e]=$'\360\220\200\256' [0x1002f]=$'\360\220\200\257' [0x10030]=$'\360\220\200\260' [0x10031]=$'\360\220\200\261' + [0x10032]=$'\360\220\200\262' [0x10033]=$'\360\220\200\263' [0x10034]=$'\360\220\200\264' [0x10035]=$'\360\220\200\265' [0x10036]=$'\360\220\200\266' + [0x10037]=$'\360\220\200\267' [0x10038]=$'\360\220\200\270' [0x10039]=$'\360\220\200\271' [0x1003a]=$'\360\220\200\272' [0x1003b]=$'\360\220\200\273' + [0x1003c]=$'\360\220\200\274' [0x1003d]=$'\360\220\200\275' [0x1003e]=$'\360\220\200\276' [0x1003f]=$'\360\220\200\277' [0x10040]=$'\360\220\201\200' + [0x10041]=$'\360\220\201\201' [0x10042]=$'\360\220\201\202' [0x10043]=$'\360\220\201\203' [0x10044]=$'\360\220\201\204' [0x10045]=$'\360\220\201\205' + [0x10046]=$'\360\220\201\206' [0x10047]=$'\360\220\201\207' [0x10048]=$'\360\220\201\210' [0x10049]=$'\360\220\201\211' [0x1004a]=$'\360\220\201\212' + [0x1004b]=$'\360\220\201\213' [0x1004c]=$'\360\220\201\214' [0x1004d]=$'\360\220\201\215' [0x1004e]=$'\360\220\201\216' [0x1004f]=$'\360\220\201\217' + + [0x1000000]=$'\371\200\200\200\200' [0x1000001]=$'\371\200\200\200\201' [0x1000002]=$'\371\200\200\200\202' [0x1000003]=$'\371\200\200\200\203' [0x1000004]=$'\371\200\200\200\204' + [0x1000005]=$'\371\200\200\200\205' [0x1000006]=$'\371\200\200\200\206' [0x1000007]=$'\371\200\200\200\207' [0x1000008]=$'\371\200\200\200\210' [0x1000009]=$'\371\200\200\200\211' + [0x100000a]=$'\371\200\200\200\212' [0x100000b]=$'\371\200\200\200\213' [0x100000c]=$'\371\200\200\200\214' [0x100000d]=$'\371\200\200\200\215' [0x100000e]=$'\371\200\200\200\216' + [0x100000f]=$'\371\200\200\200\217' [0x1000010]=$'\371\200\200\200\220' [0x1000011]=$'\371\200\200\200\221' [0x1000012]=$'\371\200\200\200\222' [0x1000013]=$'\371\200\200\200\223' + [0x1000014]=$'\371\200\200\200\224' [0x1000015]=$'\371\200\200\200\225' [0x1000016]=$'\371\200\200\200\226' [0x1000017]=$'\371\200\200\200\227' [0x1000018]=$'\371\200\200\200\230' + [0x1000019]=$'\371\200\200\200\231' [0x100001a]=$'\371\200\200\200\232' [0x100001b]=$'\371\200\200\200\233' [0x100001c]=$'\371\200\200\200\234' [0x100001d]=$'\371\200\200\200\235' + [0x100001e]=$'\371\200\200\200\236' [0x100001f]=$'\371\200\200\200\237' [0x1000020]=$'\371\200\200\200\240' [0x1000021]=$'\371\200\200\200\241' [0x1000022]=$'\371\200\200\200\242' + [0x1000023]=$'\371\200\200\200\243' [0x1000024]=$'\371\200\200\200\244' [0x1000025]=$'\371\200\200\200\245' [0x1000026]=$'\371\200\200\200\246' [0x1000027]=$'\371\200\200\200\247' + [0x1000028]=$'\371\200\200\200\250' [0x1000029]=$'\371\200\200\200\251' [0x100002a]=$'\371\200\200\200\252' [0x100002b]=$'\371\200\200\200\253' [0x100002c]=$'\371\200\200\200\254' + [0x100002d]=$'\371\200\200\200\255' [0x100002e]=$'\371\200\200\200\256' [0x100002f]=$'\371\200\200\200\257' [0x1000030]=$'\371\200\200\200\260' [0x1000031]=$'\371\200\200\200\261' + [0x1000032]=$'\371\200\200\200\262' [0x1000033]=$'\371\200\200\200\263' [0x1000034]=$'\371\200\200\200\264' [0x1000035]=$'\371\200\200\200\265' [0x1000036]=$'\371\200\200\200\266' + [0x1000037]=$'\371\200\200\200\267' [0x1000038]=$'\371\200\200\200\270' [0x1000039]=$'\371\200\200\200\271' [0x100003a]=$'\371\200\200\200\272' [0x100003b]=$'\371\200\200\200\273' + [0x100003c]=$'\371\200\200\200\274' [0x100003d]=$'\371\200\200\200\275' [0x100003e]=$'\371\200\200\200\276' [0x100003f]=$'\371\200\200\200\277' [0x1000040]=$'\371\200\200\201\200' + [0x1000041]=$'\371\200\200\201\201' [0x1000042]=$'\371\200\200\201\202' [0x1000043]=$'\371\200\200\201\203' [0x1000044]=$'\371\200\200\201\204' [0x1000045]=$'\371\200\200\201\205' + [0x1000046]=$'\371\200\200\201\206' [0x1000047]=$'\371\200\200\201\207' [0x1000048]=$'\371\200\200\201\210' [0x1000049]=$'\371\200\200\201\211' [0x100004a]=$'\371\200\200\201\212' + [0x100004b]=$'\371\200\200\201\213' [0x100004c]=$'\371\200\200\201\214' [0x100004d]=$'\371\200\200\201\215' [0x100004e]=$'\371\200\200\201\216' [0x100004f]=$'\371\200\200\201\217' + + [0x70000000]=$'\375\260\200\200\200\200' [0x70000001]=$'\375\260\200\200\200\201' [0x70000002]=$'\375\260\200\200\200\202' [0x70000003]=$'\375\260\200\200\200\203' + [0x70000004]=$'\375\260\200\200\200\204' [0x70000005]=$'\375\260\200\200\200\205' [0x70000006]=$'\375\260\200\200\200\206' [0x70000007]=$'\375\260\200\200\200\207' [0x70000008]=$'\375\260\200\200\200\210' + [0x70000009]=$'\375\260\200\200\200\211' [0x7000000a]=$'\375\260\200\200\200\212' [0x7000000b]=$'\375\260\200\200\200\213' [0x7000000c]=$'\375\260\200\200\200\214' [0x7000000d]=$'\375\260\200\200\200\215' + [0x7000000e]=$'\375\260\200\200\200\216' [0x7000000f]=$'\375\260\200\200\200\217' [0x70000010]=$'\375\260\200\200\200\220' [0x70000011]=$'\375\260\200\200\200\221' [0x70000012]=$'\375\260\200\200\200\222' + [0x70000013]=$'\375\260\200\200\200\223' [0x70000014]=$'\375\260\200\200\200\224' [0x70000015]=$'\375\260\200\200\200\225' [0x70000016]=$'\375\260\200\200\200\226' [0x70000017]=$'\375\260\200\200\200\227' + [0x70000018]=$'\375\260\200\200\200\230' [0x70000019]=$'\375\260\200\200\200\231' [0x7000001a]=$'\375\260\200\200\200\232' [0x7000001b]=$'\375\260\200\200\200\233' [0x7000001c]=$'\375\260\200\200\200\234' + [0x7000001d]=$'\375\260\200\200\200\235' [0x7000001e]=$'\375\260\200\200\200\236' [0x7000001f]=$'\375\260\200\200\200\237' [0x70000020]=$'\375\260\200\200\200\240' [0x70000021]=$'\375\260\200\200\200\241' + [0x70000022]=$'\375\260\200\200\200\242' [0x70000023]=$'\375\260\200\200\200\243' [0x70000024]=$'\375\260\200\200\200\244' [0x70000025]=$'\375\260\200\200\200\245' [0x70000026]=$'\375\260\200\200\200\246' + [0x70000027]=$'\375\260\200\200\200\247' [0x70000028]=$'\375\260\200\200\200\250' [0x70000029]=$'\375\260\200\200\200\251' [0x7000002a]=$'\375\260\200\200\200\252' [0x7000002b]=$'\375\260\200\200\200\253' + [0x7000002c]=$'\375\260\200\200\200\254' [0x7000002d]=$'\375\260\200\200\200\255' [0x7000002e]=$'\375\260\200\200\200\256' [0x7000002f]=$'\375\260\200\200\200\257' [0x70000030]=$'\375\260\200\200\200\260' + [0x70000031]=$'\375\260\200\200\200\261' [0x70000032]=$'\375\260\200\200\200\262' [0x70000033]=$'\375\260\200\200\200\263' [0x70000034]=$'\375\260\200\200\200\264' [0x70000035]=$'\375\260\200\200\200\265' + [0x70000036]=$'\375\260\200\200\200\266' [0x70000037]=$'\375\260\200\200\200\267' [0x70000038]=$'\375\260\200\200\200\270' [0x70000039]=$'\375\260\200\200\200\271' [0x7000003a]=$'\375\260\200\200\200\272' + [0x7000003b]=$'\375\260\200\200\200\273' [0x7000003c]=$'\375\260\200\200\200\274' [0x7000003d]=$'\375\260\200\200\200\275' [0x7000003e]=$'\375\260\200\200\200\276' [0x7000003f]=$'\375\260\200\200\200\277' + [0x70000040]=$'\375\260\200\200\201\200' [0x70000041]=$'\375\260\200\200\201\201' [0x70000042]=$'\375\260\200\200\201\202' [0x70000043]=$'\375\260\200\200\201\203' [0x70000044]=$'\375\260\200\200\201\204' + [0x70000045]=$'\375\260\200\200\201\205' [0x70000046]=$'\375\260\200\200\201\206' [0x70000047]=$'\375\260\200\200\201\207' [0x70000048]=$'\375\260\200\200\201\210' [0x70000049]=$'\375\260\200\200\201\211' + [0x7000004a]=$'\375\260\200\200\201\212' [0x7000004b]=$'\375\260\200\200\201\213' [0x7000004c]=$'\375\260\200\200\201\214' [0x7000004d]=$'\375\260\200\200\201\215' [0x7000004e]=$'\375\260\200\200\201\216' + + + + ) +TestCodePage en_US.UTF-8 C_UTF_8 + +if [ ${ErrorCnt} -gt 0 ]; then + echo "Failed ${ErrorCnt} of ${TestCnt} Unicode tests" +else + echo "Passed all ${TestCnt} Unicode tests" +fi diff --git a/tests/unicode2.sub b/tests/unicode2.sub new file mode 100644 index 0000000..f10cdec --- /dev/null +++ b/tests/unicode2.sub @@ -0,0 +1,22 @@ +export LANG=en_US.UTF-8 + +printf '%s\n' "$(printf '\uff')" | od -b +printf '%s\n' $'\uff' | od -b + +printf '\uff'\\n | od -b +echo $'\uff' | od -b + +printf '\uffff'\\n | od -b +echo $'\uffff' | od -b + +printf '\Ufffffffe'\\n | od -b +echo $'\Ufffffffe' | od -b + +printf '\Uffffffff'\\n | od -b +echo $'\Uffffffff' | od -b + +LC_CTYPE=C printf '\uff'\\n | od -b +LC_CTYPE=ru_RU.CP1251 printf '\uff'\\n | od -b +LC_CTYPE=en_US.UTF-8 printf '\uff'\\n | od -b + +echo -e '\u0041 \u00a3 \u0152' | od -b diff --git a/tests/unicode3.sub b/tests/unicode3.sub new file mode 100644 index 0000000..f79871f --- /dev/null +++ b/tests/unicode3.sub @@ -0,0 +1,7 @@ +payload=$'\065\247\100\063\231\053\306\123\070\237\242\352\263' +"$payload" + +printf %q "$payload" +echo + +set -x ; : "$payload" diff --git a/tests/varenv.right b/tests/varenv.right new file mode 100644 index 0000000..2d98b22 --- /dev/null +++ b/tests/varenv.right @@ -0,0 +1,71 @@ +3 4 +5 6 7 8 9 +7 8 9 +/usr/chet +/usr/chet +/usr/chet +/a/b/c +/usr/chet +/usr/chet 7 +/a/b/c 9 /a/b/c +/a/b/c 9 /a/b/c +/a/b/c /a/b/c +1 2 +1 1 +unset +toronto airport +AVAR +song by rush +BVAR +toronto airport +AVAR +AVAR +42 +/bin:/usr/bin:/usr/local/bin:. +avar=([0]="/bin:/usr/bin:/usr/local/bin:.") +z=yy +42 +declare -i ivar="10" +unset +declare -x ivar="42" +hB +braceexpand:hashall:interactive-comments +hBP +braceexpand:hashall:interactive-comments:physical +declare -r SHELLOPTS="braceexpand:hashall:interactive-comments:physical" +abcde +20 +30 +40 +50 +|0|10| +10 +|0|10| +10 +|0|10| +10 +|4| +4 +|0|11| +after fff3: x=4 +|0|12| +|y| +|y| +a:b:c:d +a-b-c-d +a:b:c:d +g: , +f: , +FIN: asdf fdsa, asdf fdsa +g: v = , w = +f: v = , w = +FIN: v = two, w = one +declare -Ar FOOBAR='([foo]="bar" )' +declare -Ar FOOBAR='([foo]="bar" )' +declare -ar FOOBAR2='([0]="bar")' +declare -ar FOOBAR2='([0]="bar")' +F OUTSIDE +F OUTSIDE +a=z +a=b +a=z diff --git a/tests/varenv.sh b/tests/varenv.sh new file mode 100644 index 0000000..6576282 --- /dev/null +++ b/tests/varenv.sh @@ -0,0 +1,219 @@ +# +# varenv.sh +# +# Test the behavior of the shell with respect to variable and environment +# assignments +# +expect() +{ + echo expect "$@" +} + +a=1 +b=2 +c=3 +d=4 +e=5 +f=6 g=7 h=8 + +a=3 b=4 $CHMOD $MODE $FN + +# This should echo "3 4" according to Posix.2 +expect "3 4" +echo $a $b + +set -k + +# Assignment statements made when no words are left affect the shell's +# environment +a=5 b=6 $CHMOD c=7 $MODE d=8 $FN e=9 + +expect "5 6 7 8 9" +echo $a $b $c $d $e + +$CHMOD f=7 $MODE g=8 $FN h=9 +expect "7 8 9" +echo $f $g $h + +set +k + +# The temporary environment does not affect variable expansion, only the +# environment given to the command + +export HOME=/usr/chet +expect $HOME +echo $HOME + +expect $HOME +HOME=/a/b/c /bin/echo $HOME + +expect $HOME +echo $HOME + +# This should echo /a/b/c +expect /a/b/c +HOME=/a/b/c printenv HOME + +set -k + +# This should echo $HOME 9, NOT /a/b/c 9 + +expect "$HOME" +HOME=/a/b/c /bin/echo $HOME c=9 +expect "$HOME 7" +echo $HOME $c + +# I claim the next two echo calls should give identical output. +# ksh agrees, the System V.3 sh does not + +expect "/a/b/c 9 /a/b/c" +HOME=/a/b/c $ECHO a=$HOME c=9 +echo $HOME $c $a + +expect "/a/b/c 9 /a/b/c" +HOME=/a/b/c a=$HOME c=9 +echo $HOME $c $a +set +k + +# How do assignment statements affect subsequent assignments on the same +# line? +expect "/a/b/c /a/b/c" +HOME=/a/b/c a=$HOME +echo $HOME $a + +# The system V.3 sh does this wrong; the last echo should output "1 1", +# but the system V.3 sh has it output "2 2". Posix.2 says the assignment +# statements are processed left-to-right. bash and ksh output the right +# thing +c=1 +d=2 +expect "1 2" +echo $c $d +d=$c c=$d +expect "1 1" +echo $c $d + +# just for completeness +unset d c +expect unset +echo ${d-unset} + +# no output +export a +a=bcde +export a +/bin/true 2>/dev/null + +func() +{ + local YYZ + + YYZ="song by rush" + echo $YYZ + echo $A +} + +YYZ="toronto airport" +A="AVAR" +echo $YYZ +echo $A +A=BVAR func +echo $YYZ +echo $A + +export A +# Make sure expansion doesn't use assignment statements preceding a builtin +A=ZVAR echo $A + +XPATH=/bin:/usr/bin:/usr/local/bin:. +func2() +{ + local z=yy + local -a avar=( ${XPATH//: } ) + echo ${avar[@]} + local +} + +avar=42 +echo $avar +func2 +echo $avar + +# try to set an attribute for an unset variable; make sure it persists +# when the variable is assigned a value +declare -i ivar + +ivar=10 + +declare -p ivar +unset ivar + +# export an unset variable, make sure it is not suddenly set, but make +# sure the export attribute persists when the variable is assigned a +# value +export ivar +echo ${ivar-unset} + +ivar=42 +declare -p ivar + +# make sure set [-+]o ignoreeof and $IGNOREEOF are reflected +unset IGNOREEOF +set +o ignoreeof +set -o ignoreeof +if [ "$IGNOREEOF" -ne 10 ]; then + echo "./varenv.sh: set -o ignoreeof is not reflected in IGNOREEOF" >&2 +fi +unset IGNOREEOF +set +o ignoreeof + +# older versions of bash used to not reset RANDOM in subshells correctly +[[ $RANDOM -eq $(echo $RANDOM) ]] && echo "RANDOM: problem with subshells" + +# make sure that shopt -o is reflected in $SHELLOPTS +# first, get rid of things that might be set automatically via shell +# variables +set +o posix +set +o ignoreeof +set +o monitor +echo $- +echo ${SHELLOPTS} +shopt -so physical +echo $- +echo ${SHELLOPTS} + +# and make sure it is readonly +readonly -p | grep SHELLOPTS + +# This was an error in bash versions prior to bash-2.04. The `set -a' +# should cause the assignment statement that's an argument to typeset +# to create an exported variable +unset FOOFOO +FOOFOO=bar +set -a +typeset FOOFOO=abcde + +printenv FOOFOO + +# test out export behavior of variable assignments preceding builtins and +# functions +$THIS_SH ./varenv1.sub + +# more tests; bugs in bash up to version 2.05a +$THIS_SH ./varenv2.sub + +# more tests; bugs in bash IFS scoping up through version 4.2 +$THIS_SH ./varenv3.sub + +# scoping problems with declare -g through bash-4.2 +${THIS_SH} ./varenv4.sub + +# more scoping and declaration problems with -g and arrays through bash-4.2 +${THIS_SH} ./varenv5.sub + +# variable scoping in the presence of nameref +${THIS_SH} ./varenv6.sub + +# make sure variable scoping is done right +tt() { typeset a=b;echo a=$a; };a=z;echo a=$a;tt;echo a=$a + diff --git a/tests/varenv1.sub b/tests/varenv1.sub new file mode 100644 index 0000000..168f87b --- /dev/null +++ b/tests/varenv1.sub @@ -0,0 +1,28 @@ +# test out the export behavior of variable assignments preceding `eval', `.' +# and shell functions + +func() +{ + printenv var +} + +export var=10 +echo expect 20 +var=20 eval printenv var + +: ${TMPDIR:=/tmp} +TMPFILE=$TMPDIR/evalsub.$$ + +rm -f $TMPFILE +echo 'printenv var' > $TMPFILE + +echo expect 30 +var=30 . $TMPFILE + +rm -f $TMPFILE + +echo expect 40 +var=40 func + +echo expect 50 +var=50 command printenv var diff --git a/tests/varenv2.sub b/tests/varenv2.sub new file mode 100644 index 0000000..b293572 --- /dev/null +++ b/tests/varenv2.sub @@ -0,0 +1,44 @@ +fff() +{ + typeset i=0 x=10 + echo "|$i|$x|" + export x + printenv x +} + +fff2() +{ + echo "|$x|" + export x + printenv x +} + +fff3() +{ + typeset i=0 x="${x-10}" + echo "|$i|$x|" +} + +fff4() +{ + typeset i=0 x + x="${x-10}" + echo "|$i|$x|" +} + +fff5() +{ + z=y typeset z + echo "|$z|" +} + +fff +x=10 fff +x=1 fff +x=4 fff2 +x=11 fff3 +echo after fff3: x=$x +x=12 fff4 + +fff5 +z=42 fff5 diff --git a/tests/varenv3.sub b/tests/varenv3.sub new file mode 100644 index 0000000..1384fcb --- /dev/null +++ b/tests/varenv3.sub @@ -0,0 +1,32 @@ +#!/bin/bash + +oifs=$IFS + +inner () { +#recho inner: "$IFS" >&2 + echo a/b/c/d + exit 0 +} + +outer() { +#recho outer: "$IFS" >&2 +for i in 1; do + IFS=/ read m v k a < <(IFS=$oifs inner) + +echo $m:$v:$k:$a +done +} + +outer +unset m k v a b c d + +for j in 1; do + IFS=: read a b c d +done < <(outer) + +echo $a-$b-$c-$d +unset m k v a b c d + +IFS=: read a b c d < <(outer) + +echo $a:$b:$c:$d diff --git a/tests/varenv4.sub b/tests/varenv4.sub new file mode 100644 index 0000000..4852ad6 --- /dev/null +++ b/tests/varenv4.sub @@ -0,0 +1,44 @@ +f() +{ + local -a v + local -a w + + g + echo "f: ${v[@]}, ${w[@]}" +} + +g() +{ + aux=v + declare -ga "$aux=( asdf fdsa )" + declare -ga w=( asdf fdsa ) + + echo "g: ${v[@]}, ${w[@]}" +} + +f +echo "FIN: ${v[@]}, ${w[@]}" + +unset v w +unset -f f g + +f() +{ + local v + local w + + g + echo f: v = $v, w = $w +} + +g() +{ + aux=v + declare -g w=one + declare -g "$aux=two" + + echo g: v = $v, w = $w +} + +f +echo FIN: v = $v, w = $w diff --git a/tests/varenv5.sub b/tests/varenv5.sub new file mode 100644 index 0000000..8ebfa36 --- /dev/null +++ b/tests/varenv5.sub @@ -0,0 +1,16 @@ +function foobar { + declare -rgA FOOBAR=([foo]=bar) + declare -p FOOBAR +} +foobar +declare -p FOOBAR + +unset -f foobar + +foobar() { + declare -rga FOOBAR2=([foo]=bar) + declare -p FOOBAR2 +} + +foobar +declare -p FOOBAR2 diff --git a/tests/varenv6.sub b/tests/varenv6.sub new file mode 100644 index 0000000..d0269fb --- /dev/null +++ b/tests/varenv6.sub @@ -0,0 +1,28 @@ +f() +{ + local str=F + g str +} + +g() +{ + local -n ref=$1 + printf "%s " "$ref" + ref=G +} + +str=OUTSIDE; +f + +printf "%s\n" "$str" + +unset -f f g +unset str + +f() { local -a arr=(F); g arr; }; + +g() { local -n ref=$1; printf "%s " "${ref[0]}"; ref=(G); }; + +arr=(OUTSIDE); +f; +printf "%s\n" "${arr[0]}" diff --git a/tests/version b/tests/version new file mode 100644 index 0000000..bd74020 --- /dev/null +++ b/tests/version @@ -0,0 +1,8 @@ +echo Testing ${THIS_SH} + +echo version: $BASH_VERSION +echo versinfo: ${BASH_VERSINFO[@]} + +echo HOSTTYPE = $HOSTTYPE +echo OSTYPE = $OSTYPE +echo MACHTYPE = $MACHTYPE diff --git a/tests/version.mini b/tests/version.mini new file mode 100644 index 0000000..72e4bf9 --- /dev/null +++ b/tests/version.mini @@ -0,0 +1,8 @@ +echo Testing ${THIS_SH} + +echo version: $BASH_VERSION +#echo versinfo: ${BASH_VERSINFO[@]} + +echo HOSTTYPE = $HOSTTYPE +echo OSTYPE = $OSTYPE +echo MACHTYPE = $MACHTYPE diff --git a/tests/vredir.right b/tests/vredir.right new file mode 100644 index 0000000..07e02a7 --- /dev/null +++ b/tests/vredir.right @@ -0,0 +1,92 @@ +10 +foo 1 +foo 2 +foo 3 +bar is a function +bar () +{ + exec {v}> $TMPFILE; + echo $v +} +./vredir.tests: line 6: v: readonly variable +./vredir.tests: line 6: v: cannot assign fd to variable +42 +./vredir.tests: line 25: $v: Bad file descriptor +./vredir.tests: line 26: $v: Bad file descriptor +./vredir.tests: line 27: $v: Bad file descriptor +bar is a function +bar () +{ + exec {v}> $TMPFILE; + echo $v +} +10 +line 1 +line 2 +line 3 +bar is a function +bar () +{ + exec {v}<&- +} +iclosev is a function +iclosev () +{ + exec {v}>&- +} +/bin/bash +/bin/csh +/bin/ksh +/bin/sh +/bin/tcsh +/bin/zsh +./vredir3.sub: line 4: v: ambiguous redirect +after +10 11 +a +a +swizzle is a function +swizzle () +{ + fd0=0; + fd1=1; + exec {stdin}<&$fd0; + exec {stdout}>&$fd1 +} +12 10 +a +a +swizzle is a function +swizzle () +{ + exec {fd0}<&0; + exec {fd1}>&1; + exec {stdin}<&$fd0-; + exec {stdout}>&$fd1- +} +ok 1 +./vredir6.sub: redirection error: cannot duplicate fd: Invalid argument +./vredir6.sub: line 13: v: Invalid argument +unset diff --git a/tests/vredir.tests b/tests/vredir.tests new file mode 100644 index 0000000..5158fe3 --- /dev/null +++ b/tests/vredir.tests @@ -0,0 +1,46 @@ +: ${TMPDIR:=/var/tmp} +TMPFILE=$TMPDIR/foo + +bar() +{ +exec {v}>$TMPFILE +echo $v +} + +bar + +echo foo 1 >&$v +echo foo 2 >&$v +echo foo 3 >&$v + +cat $TMPFILE +rm -f $TMPFILE + +type bar +exec {v}>&- + +readonly v=42 +bar + +echo foo 1 >&$v +echo foo 2 >&$v +echo foo 3 >&$v + +cat $TMPFILE +rm -f $TMPFILE + +type bar + +${THIS_SH} ./vredir1.sub + +${THIS_SH} ./vredir2.sub + +${THIS_SH} ./vredir3.sub + +${THIS_SH} ./vredir4.sub + +${THIS_SH} ./vredir5.sub + +${THIS_SH} ./vredir6.sub + +exit 0 diff --git a/tests/vredir1.sub b/tests/vredir1.sub new file mode 100644 index 0000000..403734c --- /dev/null +++ b/tests/vredir1.sub @@ -0,0 +1,17 @@ +bar() +{ +exec {v}< $TMPDIR/shells-$$ <&- +} + +iclosev() +{ +exec {v}<&- +} + +exec {v}>&1 +echo $v + +echo foo 1 >&$v +echo foo 2 >&$v +echo foo 3 >&$v + +oclosev + +exec {v}<$SHELLSFILE +echo $v + +while read line <&$v +do + echo $line +done + +iclosev + +type oclosev +type iclosev + +while read -r -u ${fd} +do + echo $REPLY +done {fd}<$SHELLSFILE + +rm -f $SHELLSFILE + +exit 0 diff --git a/tests/vredir3.sub b/tests/vredir3.sub new file mode 100644 index 0000000..358ded2 --- /dev/null +++ b/tests/vredir3.sub @@ -0,0 +1,8 @@ +# Right now, the {varname} mechanism does not honor set -u for compatibility +unset v +set -u +exec {v}>&- + +echo after + +exit 0 diff --git a/tests/vredir4.sub b/tests/vredir4.sub new file mode 100644 index 0000000..e1cef05 --- /dev/null +++ b/tests/vredir4.sub @@ -0,0 +1,22 @@ +swizzle() +{ +fd0=0 +fd1=1 + +exec {stdin}<&$fd0 +exec {stdout}>&$fd1 +} + +swizzle +echo $stdin $stdout + +read line <&$stdin <&$stdout + +type swizzle + +exit 0 diff --git a/tests/vredir5.sub b/tests/vredir5.sub new file mode 100644 index 0000000..d1531e9 --- /dev/null +++ b/tests/vredir5.sub @@ -0,0 +1,23 @@ +swizzle() +{ +exec {fd0}<&0 +exec {fd1}>&1 + +exec {stdin}<&$fd0- +exec {stdout}>&$fd1- +} + +swizzle + +echo $stdin $stdout + +read line <&$stdin <&$stdout + +type swizzle + +exit 0 diff --git a/tests/vredir6.sub b/tests/vredir6.sub new file mode 100644 index 0000000..224b96a --- /dev/null +++ b/tests/vredir6.sub @@ -0,0 +1,14 @@ +unset v +exec {v}= 10 )); then echo ok 1; else echo bad 1; fi + +exec {v}<&- + +ulimit -n 6 + +exec . +*/ + +#include "config.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashtypes.h" +#include "bashansi.h" + +#include +#include + +#include "bashintl.h" + +#include + +#include "trap.h" + +#include "shell.h" +#include "flags.h" +#include "input.h" /* for save_token_state, restore_token_state */ +#include "jobs.h" +#include "signames.h" +#include "builtins.h" +#include "builtins/common.h" +#include "builtins/builtext.h" + +#if defined (READLINE) +# include +# include "bashline.h" +#endif + +#ifndef errno +extern int errno; +#endif + +/* Flags which describe the current handling state of a signal. */ +#define SIG_INHERITED 0x0 /* Value inherited from parent. */ +#define SIG_TRAPPED 0x1 /* Currently trapped. */ +#define SIG_HARD_IGNORE 0x2 /* Signal was ignored on shell entry. */ +#define SIG_SPECIAL 0x4 /* Treat this signal specially. */ +#define SIG_NO_TRAP 0x8 /* Signal cannot be trapped. */ +#define SIG_INPROGRESS 0x10 /* Signal handler currently executing. */ +#define SIG_CHANGED 0x20 /* Trap value changed in trap handler. */ +#define SIG_IGNORED 0x40 /* The signal is currently being ignored. */ + +#define SPECIAL_TRAP(s) ((s) == EXIT_TRAP || (s) == DEBUG_TRAP || (s) == ERROR_TRAP || (s) == RETURN_TRAP) + +/* An array of such flags, one for each signal, describing what the + shell will do with a signal. DEBUG_TRAP == NSIG; some code below + assumes this. */ +static int sigmodes[BASH_NSIG]; + +static void free_trap_command __P((int)); +static void change_signal __P((int, char *)); + +static int _run_trap_internal __P((int, char *)); + +static void free_trap_string __P((int)); +static void reset_signal __P((int)); +static void restore_signal __P((int)); +static void reset_or_restore_signal_handlers __P((sh_resetsig_func_t *)); + +/* Variables used here but defined in other files. */ +extern int last_command_exit_value; +extern int line_number; + +extern int sigalrm_seen; +extern procenv_t alrmbuf; + +extern char *this_command_name; +extern sh_builtin_func_t *this_shell_builtin; +extern procenv_t wait_intr_buf; +extern int return_catch_flag, return_catch_value; +extern int subshell_level; +extern WORD_LIST *subst_assign_varlist; + +/* The list of things to do originally, before we started trapping. */ +SigHandler *original_signals[NSIG]; + +/* For each signal, a slot for a string, which is a command to be + executed when that signal is received. The slot can also contain + DEFAULT_SIG, which means do whatever you were going to do before + you were so rudely interrupted, or IGNORE_SIG, which says ignore + this signal. */ +char *trap_list[BASH_NSIG]; + +/* A bitmap of signals received for which we have trap handlers. */ +int pending_traps[NSIG]; + +/* Set to the number of the signal we're running the trap for + 1. + Used in execute_cmd.c and builtins/common.c to clean up when + parse_and_execute does not return normally after executing the + trap command (e.g., when `return' is executed in the trap command). */ +int running_trap; + +/* Set to last_command_exit_value before running a trap. */ +int trap_saved_exit_value; + +/* The (trapped) signal received while executing in the `wait' builtin */ +int wait_signal_received; + +int trapped_signal_received; + +#define GETORIGSIG(sig) \ + do { \ + original_signals[sig] = (SigHandler *)set_signal_handler (sig, SIG_DFL); \ + set_signal_handler (sig, original_signals[sig]); \ + if (original_signals[sig] == SIG_IGN) \ + sigmodes[sig] |= SIG_HARD_IGNORE; \ + } while (0) + +#define SETORIGSIG(sig,handler) \ + do { \ + original_signals[sig] = handler; \ + if (original_signals[sig] == SIG_IGN) \ + sigmodes[sig] |= SIG_HARD_IGNORE; \ + } while (0) + +#define GET_ORIGINAL_SIGNAL(sig) \ + if (sig && sig < NSIG && original_signals[sig] == IMPOSSIBLE_TRAP_HANDLER) \ + GETORIGSIG(sig) + +void +initialize_traps () +{ + register int i; + + initialize_signames(); + + trap_list[EXIT_TRAP] = trap_list[DEBUG_TRAP] = trap_list[ERROR_TRAP] = trap_list[RETURN_TRAP] = (char *)NULL; + sigmodes[EXIT_TRAP] = sigmodes[DEBUG_TRAP] = sigmodes[ERROR_TRAP] = sigmodes[RETURN_TRAP] = SIG_INHERITED; + original_signals[EXIT_TRAP] = IMPOSSIBLE_TRAP_HANDLER; + + for (i = 1; i < NSIG; i++) + { + pending_traps[i] = 0; + trap_list[i] = (char *)DEFAULT_SIG; + sigmodes[i] = SIG_INHERITED; /* XXX - only set, not used */ + original_signals[i] = IMPOSSIBLE_TRAP_HANDLER; + } + + /* Show which signals are treated specially by the shell. */ +#if defined (SIGCHLD) + GETORIGSIG (SIGCHLD); + sigmodes[SIGCHLD] |= (SIG_SPECIAL | SIG_NO_TRAP); +#endif /* SIGCHLD */ + + GETORIGSIG (SIGINT); + sigmodes[SIGINT] |= SIG_SPECIAL; + +#if defined (__BEOS__) + /* BeOS sets SIGINT to SIG_IGN! */ + original_signals[SIGINT] = SIG_DFL; + sigmodes[SIGINT] &= ~SIG_HARD_IGNORE; +#endif + + GETORIGSIG (SIGQUIT); + sigmodes[SIGQUIT] |= SIG_SPECIAL; + + if (interactive) + { + GETORIGSIG (SIGTERM); + sigmodes[SIGTERM] |= SIG_SPECIAL; + } +} + +#ifdef DEBUG +/* Return a printable representation of the trap handler for SIG. */ +static char * +trap_handler_string (sig) + int sig; +{ + if (trap_list[sig] == (char *)DEFAULT_SIG) + return "DEFAULT_SIG"; + else if (trap_list[sig] == (char *)IGNORE_SIG) + return "IGNORE_SIG"; + else if (trap_list[sig] == (char *)IMPOSSIBLE_TRAP_HANDLER) + return "IMPOSSIBLE_TRAP_HANDLER"; + else if (trap_list[sig]) + return trap_list[sig]; + else + return "NULL"; +} +#endif + +/* Return the print name of this signal. */ +char * +signal_name (sig) + int sig; +{ + char *ret; + + /* on cygwin32, signal_names[sig] could be null */ + ret = (sig >= BASH_NSIG || sig < 0 || signal_names[sig] == NULL) + ? _("invalid signal number") + : signal_names[sig]; + + return ret; +} + +/* Turn a string into a signal number, or a number into + a signal number. If STRING is "2", "SIGINT", or "INT", + then (int)2 is returned. Return NO_SIG if STRING doesn't + contain a valid signal descriptor. */ +int +decode_signal (string, flags) + char *string; + int flags; +{ + intmax_t sig; + char *name; + + if (legal_number (string, &sig)) + return ((sig >= 0 && sig < NSIG) ? (int)sig : NO_SIG); + + /* A leading `SIG' may be omitted. */ + for (sig = 0; sig < BASH_NSIG; sig++) + { + name = signal_names[sig]; + if (name == 0 || name[0] == '\0') + continue; + + /* Check name without the SIG prefix first case sensitively or + insensitively depending on whether flags includes DSIG_NOCASE */ + if (STREQN (name, "SIG", 3)) + { + name += 3; + + if ((flags & DSIG_NOCASE) && strcasecmp (string, name) == 0) + return ((int)sig); + else if ((flags & DSIG_NOCASE) == 0 && strcmp (string, name) == 0) + return ((int)sig); + /* If we can't use the `SIG' prefix to match, punt on this + name now. */ + else if ((flags & DSIG_SIGPREFIX) == 0) + continue; + } + + /* Check name with SIG prefix case sensitively or insensitively + depending on whether flags includes DSIG_NOCASE */ + name = signal_names[sig]; + if ((flags & DSIG_NOCASE) && strcasecmp (string, name) == 0) + return ((int)sig); + else if ((flags & DSIG_NOCASE) == 0 && strcmp (string, name) == 0) + return ((int)sig); + } + + return (NO_SIG); +} + +/* Non-zero when we catch a trapped signal. */ +static int catch_flag; + +void +run_pending_traps () +{ + register int sig; + int old_exit_value; + WORD_LIST *save_subst_varlist; + sh_parser_state_t pstate; +#if defined (ARRAY_VARS) + ARRAY *ps; +#endif + + if (catch_flag == 0) /* simple optimization */ + return; + + if (running_trap > 0) + { +#if defined (DEBUG) + internal_warning ("run_pending_traps: recursive invocation while running trap for signal %d", running_trap-1); +#endif +#if 0 + return; /* no recursive trap invocations */ +#else + ; +#endif + } + + catch_flag = trapped_signal_received = 0; + + /* Preserve $? when running trap. */ + old_exit_value = last_command_exit_value; +#if defined (ARRAY_VARS) + ps = save_pipestatus_array (); +#endif + + for (sig = 1; sig < NSIG; sig++) + { + /* XXX this could be made into a counter by using + while (pending_traps[sig]--) instead of the if statement. */ + if (pending_traps[sig]) + { + if (running_trap == sig+1) + /*continue*/; + + running_trap = sig + 1; + + if (sig == SIGINT) + { + pending_traps[sig] = 0; /* XXX */ + run_interrupt_trap (); + CLRINTERRUPT; + } +#if defined (JOB_CONTROL) && defined (SIGCHLD) + else if (sig == SIGCHLD && + trap_list[SIGCHLD] != (char *)IMPOSSIBLE_TRAP_HANDLER && + (sigmodes[SIGCHLD] & SIG_INPROGRESS) == 0) + { + sigmodes[SIGCHLD] |= SIG_INPROGRESS; + run_sigchld_trap (pending_traps[sig]); /* use as counter */ + sigmodes[SIGCHLD] &= ~SIG_INPROGRESS; + } + else if (sig == SIGCHLD && + trap_list[SIGCHLD] == (char *)IMPOSSIBLE_TRAP_HANDLER && + (sigmodes[SIGCHLD] & SIG_INPROGRESS) != 0) + { + /* This can happen when run_pending_traps is called while + running a SIGCHLD trap handler. */ + running_trap = 0; + /* want to leave pending_traps[SIGCHLD] alone here */ + continue; /* XXX */ + } + else if (sig == SIGCHLD && (sigmodes[SIGCHLD] & SIG_INPROGRESS)) + { + /* whoops -- print warning? */ + running_trap = 0; /* XXX */ + /* want to leave pending_traps[SIGCHLD] alone here */ + continue; + } +#endif + else if (trap_list[sig] == (char *)DEFAULT_SIG || + trap_list[sig] == (char *)IGNORE_SIG || + trap_list[sig] == (char *)IMPOSSIBLE_TRAP_HANDLER) + { + /* This is possible due to a race condition. Say a bash + process has SIGTERM trapped. A subshell is spawned + using { list; } & and the parent does something and kills + the subshell with SIGTERM. It's possible for the subshell + to set pending_traps[SIGTERM] to 1 before the code in + execute_cmd.c eventually calls restore_original_signals + to reset the SIGTERM signal handler in the subshell. The + next time run_pending_traps is called, pending_traps[SIGTERM] + will be 1, but the trap handler in trap_list[SIGTERM] will + be invalid (probably DEFAULT_SIG, but it could be IGNORE_SIG). + Unless we catch this, the subshell will dump core when + trap_list[SIGTERM] == DEFAULT_SIG, because DEFAULT_SIG is + usually 0x0. */ + internal_warning (_("run_pending_traps: bad value in trap_list[%d]: %p"), + sig, trap_list[sig]); + if (trap_list[sig] == (char *)DEFAULT_SIG) + { + internal_warning (_("run_pending_traps: signal handler is SIG_DFL, resending %d (%s) to myself"), sig, signal_name (sig)); + kill (getpid (), sig); + } + } + else + { + /* XXX - should we use save_parser_state/restore_parser_state? */ + save_parser_state (&pstate); + save_subst_varlist = subst_assign_varlist; + subst_assign_varlist = 0; + +#if defined (JOB_CONTROL) + save_pipeline (1); /* XXX only provides one save level */ +#endif + /* XXX - set pending_traps[sig] = 0 here? */ + pending_traps[sig] = 0; + evalstring (savestring (trap_list[sig]), "trap", SEVAL_NONINT|SEVAL_NOHIST|SEVAL_RESETLINE); +#if defined (JOB_CONTROL) + restore_pipeline (1); +#endif + + subst_assign_varlist = save_subst_varlist; + restore_parser_state (&pstate); + } + + pending_traps[sig] = 0; /* XXX - move before evalstring? */ + running_trap = 0; + } + } + +#if defined (ARRAY_VARS) + restore_pipestatus_array (ps); +#endif + last_command_exit_value = old_exit_value; +} + +sighandler +trap_handler (sig) + int sig; +{ + int oerrno; + + if ((sigmodes[sig] & SIG_TRAPPED) == 0) + { +#if defined (DEBUG) + internal_warning ("trap_handler: signal %d: signal not trapped", sig); +#endif + SIGRETURN (0); + } + + if ((sig >= NSIG) || + (trap_list[sig] == (char *)DEFAULT_SIG) || + (trap_list[sig] == (char *)IGNORE_SIG)) + programming_error (_("trap_handler: bad signal %d"), sig); + else + { + oerrno = errno; +#if defined (MUST_REINSTALL_SIGHANDLERS) +# if defined (JOB_CONTROL) && defined (SIGCHLD) + if (sig != SIGCHLD) +# endif /* JOB_CONTROL && SIGCHLD */ + set_signal_handler (sig, trap_handler); +#endif /* MUST_REINSTALL_SIGHANDLERS */ + + catch_flag = 1; + pending_traps[sig]++; + + trapped_signal_received = sig; + + if (this_shell_builtin && (this_shell_builtin == wait_builtin)) + { + wait_signal_received = sig; + if (interrupt_immediately) + longjmp (wait_intr_buf, 1); + } + +#if defined (READLINE) + /* Set the event hook so readline will call it after the signal handlers + finish executing, so if this interrupted character input we can get + quick response. */ + if (RL_ISSTATE (RL_STATE_SIGHANDLER) && interrupt_immediately == 0) + bashline_set_event_hook (); +#endif + + if (interrupt_immediately) + run_pending_traps (); + + errno = oerrno; + } + + SIGRETURN (0); +} + +int +first_pending_trap () +{ + register int i; + + for (i = 1; i < NSIG; i++) + if (pending_traps[i]) + return i; + return -1; +} + +int +any_signals_trapped () +{ + register int i; + + for (i = 1; i < NSIG; i++) + if (sigmodes[i] & SIG_TRAPPED) + return i; + return -1; +} + +void +check_signals () +{ + CHECK_ALRM; /* set by the read builtin */ + QUIT; +} + +/* Convenience functions the rest of the shell can use */ +void +check_signals_and_traps () +{ + check_signals (); + + run_pending_traps (); +} + +#if defined (JOB_CONTROL) && defined (SIGCHLD) + +#ifdef INCLUDE_UNUSED +/* Make COMMAND_STRING be executed when SIGCHLD is caught. */ +void +set_sigchld_trap (command_string) + char *command_string; +{ + set_signal (SIGCHLD, command_string); +} +#endif + +/* Make COMMAND_STRING be executed when SIGCHLD is caught iff SIGCHLD + is not already trapped. IMPOSSIBLE_TRAP_HANDLER is used as a sentinel + to make sure that a SIGCHLD trap handler run via run_sigchld_trap can + reset the disposition to the default and not have the original signal + accidentally restored, undoing the user's command. */ +void +maybe_set_sigchld_trap (command_string) + char *command_string; +{ + if ((sigmodes[SIGCHLD] & SIG_TRAPPED) == 0 && trap_list[SIGCHLD] == (char *)IMPOSSIBLE_TRAP_HANDLER) + set_signal (SIGCHLD, command_string); +} + +/* Temporarily set the SIGCHLD trap string to IMPOSSIBLE_TRAP_HANDLER. Used + as a sentinel in run_sigchld_trap and maybe_set_sigchld_trap to see whether + or not a SIGCHLD trap handler reset SIGCHLD disposition to the default. */ +void +set_impossible_sigchld_trap () +{ + restore_default_signal (SIGCHLD); + change_signal (SIGCHLD, (char *)IMPOSSIBLE_TRAP_HANDLER); + sigmodes[SIGCHLD] &= ~SIG_TRAPPED; /* maybe_set_sigchld_trap checks this */ +} + +/* Act as if we received SIGCHLD NCHILD times and increment + pending_traps[SIGCHLD] by that amount. This allows us to still run the + SIGCHLD trap once for each exited child. */ +void +queue_sigchld_trap (nchild) + int nchild; +{ + if (nchild > 0) + { + catch_flag = 1; + pending_traps[SIGCHLD] += nchild; + trapped_signal_received = SIGCHLD; + } +} +#endif /* JOB_CONTROL && SIGCHLD */ + +void +set_debug_trap (command) + char *command; +{ + set_signal (DEBUG_TRAP, command); +} + +void +set_error_trap (command) + char *command; +{ + set_signal (ERROR_TRAP, command); +} + +void +set_return_trap (command) + char *command; +{ + set_signal (RETURN_TRAP, command); +} + +#ifdef INCLUDE_UNUSED +void +set_sigint_trap (command) + char *command; +{ + set_signal (SIGINT, command); +} +#endif + +/* Reset the SIGINT handler so that subshells that are doing `shellsy' + things, like waiting for command substitution or executing commands + in explicit subshells ( ( cmd ) ), can catch interrupts properly. */ +SigHandler * +set_sigint_handler () +{ + if (sigmodes[SIGINT] & SIG_HARD_IGNORE) + return ((SigHandler *)SIG_IGN); + + else if (sigmodes[SIGINT] & SIG_IGNORED) + return ((SigHandler *)set_signal_handler (SIGINT, SIG_IGN)); /* XXX */ + + else if (sigmodes[SIGINT] & SIG_TRAPPED) + return ((SigHandler *)set_signal_handler (SIGINT, trap_handler)); + + /* The signal is not trapped, so set the handler to the shell's special + interrupt handler. */ + else if (interactive) /* XXX - was interactive_shell */ + return (set_signal_handler (SIGINT, sigint_sighandler)); + else + return (set_signal_handler (SIGINT, termsig_sighandler)); +} + +/* Return the correct handler for signal SIG according to the values in + sigmodes[SIG]. */ +SigHandler * +trap_to_sighandler (sig) + int sig; +{ + if (sigmodes[sig] & (SIG_IGNORED|SIG_HARD_IGNORE)) + return (SIG_IGN); + else if (sigmodes[sig] & SIG_TRAPPED) + return (trap_handler); + else + return (SIG_DFL); +} + +/* Set SIG to call STRING as a command. */ +void +set_signal (sig, string) + int sig; + char *string; +{ + sigset_t set, oset; + + if (SPECIAL_TRAP (sig)) + { + change_signal (sig, savestring (string)); + if (sig == EXIT_TRAP && interactive == 0) + initialize_terminating_signals (); + return; + } + + /* A signal ignored on entry to the shell cannot be trapped or reset, but + no error is reported when attempting to do so. -- Posix.2 */ + if (sigmodes[sig] & SIG_HARD_IGNORE) + return; + + /* Make sure we have original_signals[sig] if the signal has not yet + been trapped. */ + if ((sigmodes[sig] & SIG_TRAPPED) == 0) + { + /* If we aren't sure of the original value, check it. */ + if (original_signals[sig] == IMPOSSIBLE_TRAP_HANDLER) + GETORIGSIG (sig); + if (original_signals[sig] == SIG_IGN) + return; + } + + /* Only change the system signal handler if SIG_NO_TRAP is not set. + The trap command string is changed in either case. The shell signal + handlers for SIGINT and SIGCHLD run the user specified traps in an + environment in which it is safe to do so. */ + if ((sigmodes[sig] & SIG_NO_TRAP) == 0) + { + BLOCK_SIGNAL (sig, set, oset); + change_signal (sig, savestring (string)); + set_signal_handler (sig, trap_handler); + UNBLOCK_SIGNAL (oset); + } + else + change_signal (sig, savestring (string)); +} + +static void +free_trap_command (sig) + int sig; +{ + if ((sigmodes[sig] & SIG_TRAPPED) && trap_list[sig] && + (trap_list[sig] != (char *)IGNORE_SIG) && + (trap_list[sig] != (char *)DEFAULT_SIG) && + (trap_list[sig] != (char *)IMPOSSIBLE_TRAP_HANDLER)) + free (trap_list[sig]); +} + +/* If SIG has a string assigned to it, get rid of it. Then give it + VALUE. */ +static void +change_signal (sig, value) + int sig; + char *value; +{ + if ((sigmodes[sig] & SIG_INPROGRESS) == 0) + free_trap_command (sig); + trap_list[sig] = value; + + sigmodes[sig] |= SIG_TRAPPED; + if (value == (char *)IGNORE_SIG) + sigmodes[sig] |= SIG_IGNORED; + else + sigmodes[sig] &= ~SIG_IGNORED; + if (sigmodes[sig] & SIG_INPROGRESS) + sigmodes[sig] |= SIG_CHANGED; +} + +void +get_original_signal (sig) + int sig; +{ + /* If we aren't sure the of the original value, then get it. */ + if (sig > 0 && sig < NSIG && original_signals[sig] == (SigHandler *)IMPOSSIBLE_TRAP_HANDLER) + GETORIGSIG (sig); +} + +void +get_all_original_signals () +{ + register int i; + + for (i = 1; i < NSIG; i++) + GET_ORIGINAL_SIGNAL (i); +} + +void +set_original_signal (sig, handler) + int sig; + SigHandler *handler; +{ + if (sig > 0 && sig < NSIG && original_signals[sig] == (SigHandler *)IMPOSSIBLE_TRAP_HANDLER) + SETORIGSIG (sig, handler); +} + +/* Restore the default action for SIG; i.e., the action the shell + would have taken before you used the trap command. This is called + from trap_builtin (), which takes care to restore the handlers for + the signals the shell treats specially. */ +void +restore_default_signal (sig) + int sig; +{ + if (SPECIAL_TRAP (sig)) + { + if ((sig != DEBUG_TRAP && sig != ERROR_TRAP && sig != RETURN_TRAP) || + (sigmodes[sig] & SIG_INPROGRESS) == 0) + free_trap_command (sig); + trap_list[sig] = (char *)NULL; + sigmodes[sig] &= ~SIG_TRAPPED; + if (sigmodes[sig] & SIG_INPROGRESS) + sigmodes[sig] |= SIG_CHANGED; + return; + } + + GET_ORIGINAL_SIGNAL (sig); + + /* A signal ignored on entry to the shell cannot be trapped or reset, but + no error is reported when attempting to do so. Thanks Posix.2. */ + if (sigmodes[sig] & SIG_HARD_IGNORE) + return; + + /* If we aren't trapping this signal, don't bother doing anything else. */ + /* We special-case SIGCHLD and IMPOSSIBLE_TRAP_HANDLER (see above) as a + sentinel to determine whether or not disposition is reset to the default + while the trap handler is executing. */ + if (((sigmodes[sig] & SIG_TRAPPED) == 0) && + (sig != SIGCHLD || (sigmodes[sig] & SIG_INPROGRESS) == 0 || trap_list[sig] != (char *)IMPOSSIBLE_TRAP_HANDLER)) + return; + + /* Only change the signal handler for SIG if it allows it. */ + if ((sigmodes[sig] & SIG_NO_TRAP) == 0) + set_signal_handler (sig, original_signals[sig]); + + /* Change the trap command in either case. */ + change_signal (sig, (char *)DEFAULT_SIG); + + /* Mark the signal as no longer trapped. */ + sigmodes[sig] &= ~SIG_TRAPPED; +} + +/* Make this signal be ignored. */ +void +ignore_signal (sig) + int sig; +{ + if (SPECIAL_TRAP (sig) && ((sigmodes[sig] & SIG_IGNORED) == 0)) + { + change_signal (sig, (char *)IGNORE_SIG); + return; + } + + GET_ORIGINAL_SIGNAL (sig); + + /* A signal ignored on entry to the shell cannot be trapped or reset. + No error is reported when the user attempts to do so. */ + if (sigmodes[sig] & SIG_HARD_IGNORE) + return; + + /* If already trapped and ignored, no change necessary. */ + if (sigmodes[sig] & SIG_IGNORED) + return; + + /* Only change the signal handler for SIG if it allows it. */ + if ((sigmodes[sig] & SIG_NO_TRAP) == 0) + set_signal_handler (sig, SIG_IGN); + + /* Change the trap command in either case. */ + change_signal (sig, (char *)IGNORE_SIG); +} + +/* Handle the calling of "trap 0". The only sticky situation is when + the command to be executed includes an "exit". This is why we have + to provide our own place for top_level to jump to. */ +int +run_exit_trap () +{ + char *trap_command; + int code, function_code, retval; +#if defined (ARRAY_VARS) + ARRAY *ps; +#endif + + trap_saved_exit_value = last_command_exit_value; +#if defined (ARRAY_VARS) + ps = save_pipestatus_array (); +#endif + function_code = 0; + + /* Run the trap only if signal 0 is trapped and not ignored, and we are not + currently running in the trap handler (call to exit in the list of + commands given to trap 0). */ + if ((sigmodes[EXIT_TRAP] & SIG_TRAPPED) && + (sigmodes[EXIT_TRAP] & (SIG_IGNORED|SIG_INPROGRESS)) == 0) + { + trap_command = savestring (trap_list[EXIT_TRAP]); + sigmodes[EXIT_TRAP] &= ~SIG_TRAPPED; + sigmodes[EXIT_TRAP] |= SIG_INPROGRESS; + + retval = trap_saved_exit_value; + running_trap = 1; + + code = setjmp_nosigs (top_level); + + /* If we're in a function, make sure return longjmps come here, too. */ + if (return_catch_flag) + function_code = setjmp_nosigs (return_catch); + + if (code == 0 && function_code == 0) + { + reset_parser (); + parse_and_execute (trap_command, "exit trap", SEVAL_NONINT|SEVAL_NOHIST|SEVAL_RESETLINE); + } + else if (code == ERREXIT) + retval = last_command_exit_value; + else if (code == EXITPROG) + retval = last_command_exit_value; + else if (function_code != 0) + retval = return_catch_value; + else + retval = trap_saved_exit_value; + + running_trap = 0; + return retval; + } + +#if defined (ARRAY_VARS) + restore_pipestatus_array (ps); +#endif + return (trap_saved_exit_value); +} + +void +run_trap_cleanup (sig) + int sig; +{ + sigmodes[sig] &= ~(SIG_INPROGRESS|SIG_CHANGED); +} + +#define RECURSIVE_SIG(s) (SPECIAL_TRAP(s) == 0) + +/* Run a trap command for SIG. SIG is one of the signals the shell treats + specially. Returns the exit status of the executed trap command list. */ +static int +_run_trap_internal (sig, tag) + int sig; + char *tag; +{ + char *trap_command, *old_trap; + int trap_exit_value, *token_state; + volatile int save_return_catch_flag, function_code; + int flags; + procenv_t save_return_catch; + WORD_LIST *save_subst_varlist; + sh_parser_state_t pstate; +#if defined (ARRAY_VARS) + ARRAY *ps; +#endif + + trap_exit_value = function_code = 0; + /* Run the trap only if SIG is trapped and not ignored, and we are not + currently executing in the trap handler. */ + if ((sigmodes[sig] & SIG_TRAPPED) && ((sigmodes[sig] & SIG_IGNORED) == 0) && + (trap_list[sig] != (char *)IMPOSSIBLE_TRAP_HANDLER) && +#if 0 + /* Uncomment this to allow some special signals to recursively execute + trap handlers. */ + (RECURSIVE_SIG (sig) || (sigmodes[sig] & SIG_INPROGRESS) == 0)) +#else + ((sigmodes[sig] & SIG_INPROGRESS) == 0)) +#endif + { + old_trap = trap_list[sig]; + sigmodes[sig] |= SIG_INPROGRESS; + sigmodes[sig] &= ~SIG_CHANGED; /* just to be sure */ + trap_command = savestring (old_trap); + + running_trap = sig + 1; + +#if defined (ARRAY_VARS) + ps = save_pipestatus_array (); +#endif + + save_parser_state (&pstate); + save_subst_varlist = subst_assign_varlist; + subst_assign_varlist = 0; + +#if defined (JOB_CONTROL) + if (sig != DEBUG_TRAP) /* run_debug_trap does this */ + save_pipeline (1); /* XXX only provides one save level */ +#endif + + /* If we're in a function, make sure return longjmps come here, too. */ + save_return_catch_flag = return_catch_flag; + if (return_catch_flag) + { + COPY_PROCENV (return_catch, save_return_catch); + function_code = setjmp_nosigs (return_catch); + } + + flags = SEVAL_NONINT|SEVAL_NOHIST; + if (sig != DEBUG_TRAP && sig != RETURN_TRAP && sig != ERROR_TRAP) + flags |= SEVAL_RESETLINE; + if (function_code == 0) + parse_and_execute (trap_command, tag, flags); + + trap_exit_value = last_command_exit_value; + +#if defined (JOB_CONTROL) + if (sig != DEBUG_TRAP) /* run_debug_trap does this */ + restore_pipeline (1); +#endif + + subst_assign_varlist = save_subst_varlist; + restore_parser_state (&pstate); + +#if defined (ARRAY_VARS) + restore_pipestatus_array (ps); +#endif + running_trap = 0; + + sigmodes[sig] &= ~SIG_INPROGRESS; + + if (sigmodes[sig] & SIG_CHANGED) + { +#if 0 + /* Special traps like EXIT, DEBUG, RETURN are handled explicitly in + the places where they can be changed using unwind-protects. For + example, look at execute_cmd.c:execute_function(). */ + if (SPECIAL_TRAP (sig) == 0) +#endif + free (old_trap); + sigmodes[sig] &= ~SIG_CHANGED; + } + + if (save_return_catch_flag) + { + return_catch_flag = save_return_catch_flag; + return_catch_value = trap_exit_value; + COPY_PROCENV (save_return_catch, return_catch); + if (function_code) + longjmp (return_catch, 1); + } + } + + return trap_exit_value; +} + +int +run_debug_trap () +{ + int trap_exit_value; + pid_t save_pgrp; + int save_pipe[2]; + + /* XXX - question: should the DEBUG trap inherit the RETURN trap? */ + trap_exit_value = 0; + if ((sigmodes[DEBUG_TRAP] & SIG_TRAPPED) && ((sigmodes[DEBUG_TRAP] & SIG_IGNORED) == 0) && ((sigmodes[DEBUG_TRAP] & SIG_INPROGRESS) == 0)) + { +#if defined (JOB_CONTROL) + save_pgrp = pipeline_pgrp; + pipeline_pgrp = 0; + save_pipeline (1); +# if defined (PGRP_PIPE) + save_pgrp_pipe (save_pipe, 1); +# endif + stop_making_children (); +#endif + + trap_exit_value = _run_trap_internal (DEBUG_TRAP, "debug trap"); + +#if defined (JOB_CONTROL) + pipeline_pgrp = save_pgrp; + restore_pipeline (1); +# if defined (PGRP_PIPE) + close_pgrp_pipe (); + restore_pgrp_pipe (save_pipe); +# endif + if (pipeline_pgrp > 0) + give_terminal_to (pipeline_pgrp, 1); + notify_and_cleanup (); +#endif + +#if defined (DEBUGGER) + /* If we're in the debugger and the DEBUG trap returns 2 while we're in + a function or sourced script, we force a `return'. */ + if (debugging_mode && trap_exit_value == 2 && return_catch_flag) + { + return_catch_value = trap_exit_value; + longjmp (return_catch, 1); + } +#endif + } + return trap_exit_value; +} + +void +run_error_trap () +{ + if ((sigmodes[ERROR_TRAP] & SIG_TRAPPED) && ((sigmodes[ERROR_TRAP] & SIG_IGNORED) == 0) && (sigmodes[ERROR_TRAP] & SIG_INPROGRESS) == 0) + _run_trap_internal (ERROR_TRAP, "error trap"); +} + +void +run_return_trap () +{ + int old_exit_value; + +#if 0 + if ((sigmodes[DEBUG_TRAP] & SIG_TRAPPED) && (sigmodes[DEBUG_TRAP] & SIG_INPROGRESS)) + return; +#endif + + if ((sigmodes[RETURN_TRAP] & SIG_TRAPPED) && ((sigmodes[RETURN_TRAP] & SIG_IGNORED) == 0) && (sigmodes[RETURN_TRAP] & SIG_INPROGRESS) == 0) + { + old_exit_value = last_command_exit_value; + _run_trap_internal (RETURN_TRAP, "return trap"); + last_command_exit_value = old_exit_value; + } +} + +/* Run a trap set on SIGINT. This is called from throw_to_top_level (), and + declared here to localize the trap functions. */ +void +run_interrupt_trap () +{ + _run_trap_internal (SIGINT, "interrupt trap"); +} + +/* Free all the allocated strings in the list of traps and reset the trap + values to the default. Intended to be called from subshells that want + to complete work done by reset_signal_handlers upon execution of a + subsequent `trap' command that changes a signal's disposition. We need + to make sure that we duplicate the behavior of + reset_or_restore_signal_handlers and not change the disposition of signals + that are set to be ignored. */ +void +free_trap_strings () +{ + register int i; + + for (i = 0; i < BASH_NSIG; i++) + { + if (trap_list[i] != (char *)IGNORE_SIG) + free_trap_string (i); + } + trap_list[DEBUG_TRAP] = trap_list[EXIT_TRAP] = trap_list[ERROR_TRAP] = trap_list[RETURN_TRAP] = (char *)NULL; +} + +/* Free a trap command string associated with SIG without changing signal + disposition. Intended to be called from free_trap_strings() */ +static void +free_trap_string (sig) + int sig; +{ + change_signal (sig, (char *)DEFAULT_SIG); + sigmodes[sig] &= ~SIG_TRAPPED; +} + +/* Reset the handler for SIG to the original value but leave the trap string + in place. */ +static void +reset_signal (sig) + int sig; +{ + set_signal_handler (sig, original_signals[sig]); + sigmodes[sig] &= ~SIG_TRAPPED; +} + +/* Set the handler signal SIG to the original and free any trap + command associated with it. */ +static void +restore_signal (sig) + int sig; +{ + set_signal_handler (sig, original_signals[sig]); + change_signal (sig, (char *)DEFAULT_SIG); + sigmodes[sig] &= ~SIG_TRAPPED; +} + +static void +reset_or_restore_signal_handlers (reset) + sh_resetsig_func_t *reset; +{ + register int i; + + /* Take care of the exit trap first */ + if (sigmodes[EXIT_TRAP] & SIG_TRAPPED) + { + sigmodes[EXIT_TRAP] &= ~SIG_TRAPPED; + if (reset != reset_signal) + { + free_trap_command (EXIT_TRAP); + trap_list[EXIT_TRAP] = (char *)NULL; + } + } + + for (i = 1; i < NSIG; i++) + { + if (sigmodes[i] & SIG_TRAPPED) + { + if (trap_list[i] == (char *)IGNORE_SIG) + set_signal_handler (i, SIG_IGN); + else + (*reset) (i); + } + else if (sigmodes[i] & SIG_SPECIAL) + (*reset) (i); + } + + /* Command substitution and other child processes don't inherit the + debug, error, or return traps. If we're in the debugger, and the + `functrace' or `errtrace' options have been set, then let command + substitutions inherit them. Let command substitution inherit the + RETURN trap if we're in the debugger and tracing functions. */ + if (function_trace_mode == 0) + { + sigmodes[DEBUG_TRAP] &= ~SIG_TRAPPED; + sigmodes[RETURN_TRAP] &= ~SIG_TRAPPED; + } + if (error_trace_mode == 0) + sigmodes[ERROR_TRAP] &= ~SIG_TRAPPED; +} + +/* Reset trapped signals to their original values, but don't free the + trap strings. Called by the command substitution code and other places + that create a "subshell environment". */ +void +reset_signal_handlers () +{ + reset_or_restore_signal_handlers (reset_signal); +} + +/* Reset all trapped signals to their original values. Signals set to be + ignored with trap '' SIGNAL should be ignored, so we make sure that they + are. Called by child processes after they are forked. */ +void +restore_original_signals () +{ + reset_or_restore_signal_handlers (restore_signal); +} + +/* If a trap handler exists for signal SIG, then call it; otherwise just + return failure. Returns 1 if it called the trap handler. */ +int +maybe_call_trap_handler (sig) + int sig; +{ + /* Call the trap handler for SIG if the signal is trapped and not ignored. */ + if ((sigmodes[sig] & SIG_TRAPPED) && ((sigmodes[sig] & SIG_IGNORED) == 0)) + { + switch (sig) + { + case SIGINT: + run_interrupt_trap (); + break; + case EXIT_TRAP: + run_exit_trap (); + break; + case DEBUG_TRAP: + run_debug_trap (); + break; + case ERROR_TRAP: + run_error_trap (); + break; + default: + trap_handler (sig); + break; + } + return (1); + } + else + return (0); +} + +int +signal_is_trapped (sig) + int sig; +{ + return (sigmodes[sig] & SIG_TRAPPED); +} + +int +signal_is_pending (sig) + int sig; +{ + return (pending_traps[sig]); +} + +int +signal_is_special (sig) + int sig; +{ + return (sigmodes[sig] & SIG_SPECIAL); +} + +int +signal_is_ignored (sig) + int sig; +{ + return (sigmodes[sig] & SIG_IGNORED); +} + +int +signal_is_hard_ignored (sig) + int sig; +{ + return (sigmodes[sig] & SIG_HARD_IGNORE); +} + +void +set_signal_hard_ignored (sig) + int sig; +{ + sigmodes[sig] |= SIG_HARD_IGNORE; + original_signals[sig] = SIG_IGN; +} + +void +set_signal_ignored (sig) + int sig; +{ + original_signals[sig] = SIG_IGN; +} + +int +signal_in_progress (sig) + int sig; +{ + return (sigmodes[sig] & SIG_INPROGRESS); +} diff --git a/trap.h b/trap.h new file mode 100644 index 0000000..34a05c4 --- /dev/null +++ b/trap.h @@ -0,0 +1,113 @@ +/* trap.h -- data structures used in the trap mechanism. */ + +/* Copyright (C) 1993-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_TRAP_H_) +#define _TRAP_H_ + +#include "stdc.h" + +#if !defined (SIG_DFL) +#include "bashtypes.h" +#include +#endif /* SIG_DFL */ + +#if !defined (NSIG) +#define NSIG 64 +#endif /* !NSIG */ + +#define NO_SIG -1 +#define DEFAULT_SIG SIG_DFL +#define IGNORE_SIG SIG_IGN + +/* Special shell trap names. */ +#define DEBUG_TRAP NSIG +#define ERROR_TRAP NSIG+1 +#define RETURN_TRAP NSIG+2 +#define EXIT_TRAP 0 + +/* system signals plus special bash traps */ +#define BASH_NSIG NSIG+3 + +/* Flags values for decode_signal() */ +#define DSIG_SIGPREFIX 0x01 /* don't allow `SIG' PREFIX */ +#define DSIG_NOCASE 0x02 /* case-insensitive comparison */ + +/* A value which can never be the target of a trap handler. */ +#define IMPOSSIBLE_TRAP_HANDLER (SigHandler *)initialize_traps + +#define signal_object_p(x,f) (decode_signal (x,f) != NO_SIG) + +#define TRAP_STRING(s) \ + (signal_is_trapped (s) && signal_is_ignored (s) == 0) ? trap_list[s] \ + : (char *)NULL + +extern char *trap_list[]; + +/* Externally-visible functions declared in trap.c. */ +extern void initialize_traps __P((void)); + +extern void run_pending_traps __P((void)); + +extern void queue_sigchld_trap __P((int)); +extern void maybe_set_sigchld_trap __P((char *)); +extern void set_impossible_sigchld_trap __P((void)); +extern void set_sigchld_trap __P((char *)); + +extern void set_debug_trap __P((char *)); +extern void set_error_trap __P((char *)); +extern void set_return_trap __P((char *)); + +extern void set_sigint_trap __P((char *)); +extern void set_signal __P((int, char *)); + +extern void restore_default_signal __P((int)); +extern void ignore_signal __P((int)); +extern int run_exit_trap __P((void)); +extern void run_trap_cleanup __P((int)); +extern int run_debug_trap __P((void)); +extern void run_error_trap __P((void)); +extern void run_return_trap __P((void)); + +extern void free_trap_strings __P((void)); +extern void reset_signal_handlers __P((void)); +extern void restore_original_signals __P((void)); + +extern void get_original_signal __P((int)); +extern void get_all_original_signals __P((void)); + +extern char *signal_name __P((int)); + +extern int decode_signal __P((char *, int)); +extern void run_interrupt_trap __P((void)); +extern int maybe_call_trap_handler __P((int)); +extern int signal_is_special __P((int)); +extern int signal_is_trapped __P((int)); +extern int signal_is_pending __P((int)); +extern int signal_is_ignored __P((int)); +extern int signal_is_hard_ignored __P((int)); +extern void set_signal_hard_ignored __P((int)); +extern void set_signal_ignored __P((int)); +extern int signal_in_progress __P((int)); + +extern int first_pending_trap __P((void)); +extern int any_signals_trapped __P((void)); +extern void check_signals_and_traps __P((void)); + +#endif /* _TRAP_H_ */ diff --git a/unwind_prot.c b/unwind_prot.c new file mode 100644 index 0000000..85a10b5 --- /dev/null +++ b/unwind_prot.c @@ -0,0 +1,357 @@ +/* unwind_prot.c - a simple unwind-protect system for internal variables */ + +/* I can't stand it anymore! Please can't we just write the + whole Unix system in lisp or something? */ + +/* Copyright (C) 1987-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +/* **************************************************************** */ +/* */ +/* Unwind Protection Scheme for Bash */ +/* */ +/* **************************************************************** */ +#include "config.h" + +#include "bashtypes.h" +#include "bashansi.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if STDC_HEADERS +# include +#endif + +#ifndef offsetof +# define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +#endif + +#include "command.h" +#include "general.h" +#include "unwind_prot.h" +#include "sig.h" +#include "quit.h" +#include "error.h" /* for internal_warning */ + +/* Structure describing a saved variable and the value to restore it to. */ +typedef struct { + char *variable; + int size; + char desired_setting[1]; /* actual size is `size' */ +} SAVED_VAR; + +/* If HEAD.CLEANUP is null, then ARG.V contains a tag to throw back to. + If HEAD.CLEANUP is restore_variable, then SV.V contains the saved + variable. Otherwise, call HEAD.CLEANUP (ARG.V) to clean up. */ +typedef union uwp { + struct uwp_head { + union uwp *next; + Function *cleanup; + } head; + struct { + struct uwp_head uwp_head; + char *v; + } arg; + struct { + struct uwp_head uwp_head; + SAVED_VAR v; + } sv; +} UNWIND_ELT; + + +static void without_interrupts __P((VFunction *, char *, char *)); +static void unwind_frame_discard_internal __P((char *, char *)); +static void unwind_frame_run_internal __P((char *, char *)); +static void add_unwind_protect_internal __P((Function *, char *)); +static void remove_unwind_protect_internal __P((char *, char *)); +static void run_unwind_protects_internal __P((char *, char *)); +static void clear_unwind_protects_internal __P((char *, char *)); +static inline void restore_variable __P((SAVED_VAR *)); +static void unwind_protect_mem_internal __P((char *, char *)); + +static UNWIND_ELT *unwind_protect_list = (UNWIND_ELT *)NULL; + +#define uwpalloc(elt) (elt) = (UNWIND_ELT *)xmalloc (sizeof (UNWIND_ELT)) +#define uwpfree(elt) free(elt) + +/* Run a function without interrupts. This relies on the fact that the + FUNCTION cannot change the value of interrupt_immediately. (I.e., does + not call QUIT (). */ +static void +without_interrupts (function, arg1, arg2) + VFunction *function; + char *arg1, *arg2; +{ + int old_interrupt_immediately; + + old_interrupt_immediately = interrupt_immediately; + interrupt_immediately = 0; + + (*function)(arg1, arg2); + + interrupt_immediately = old_interrupt_immediately; +} + +/* Start the beginning of a region. */ +void +begin_unwind_frame (tag) + char *tag; +{ + add_unwind_protect ((Function *)NULL, tag); +} + +/* Discard the unwind protects back to TAG. */ +void +discard_unwind_frame (tag) + char *tag; +{ + if (unwind_protect_list) + without_interrupts (unwind_frame_discard_internal, tag, (char *)NULL); +} + +/* Run the unwind protects back to TAG. */ +void +run_unwind_frame (tag) + char *tag; +{ + if (unwind_protect_list) + without_interrupts (unwind_frame_run_internal, tag, (char *)NULL); +} + +/* Add the function CLEANUP with ARG to the list of unwindable things. */ +void +add_unwind_protect (cleanup, arg) + Function *cleanup; + char *arg; +{ + without_interrupts (add_unwind_protect_internal, (char *)cleanup, arg); +} + +/* Remove the top unwind protect from the list. */ +void +remove_unwind_protect () +{ + if (unwind_protect_list) + without_interrupts + (remove_unwind_protect_internal, (char *)NULL, (char *)NULL); +} + +/* Run the list of cleanup functions in unwind_protect_list. */ +void +run_unwind_protects () +{ + if (unwind_protect_list) + without_interrupts + (run_unwind_protects_internal, (char *)NULL, (char *)NULL); +} + +/* Erase the unwind-protect list. If flags is 1, free the elements. */ +void +clear_unwind_protect_list (flags) + int flags; +{ + char *flag; + + if (unwind_protect_list) + { + flag = flags ? "" : (char *)NULL; + without_interrupts + (clear_unwind_protects_internal, flag, (char *)NULL); + } +} + +int +have_unwind_protects () +{ + return (unwind_protect_list != 0); +} + +/* **************************************************************** */ +/* */ +/* The Actual Functions */ +/* */ +/* **************************************************************** */ + +static void +add_unwind_protect_internal (cleanup, arg) + Function *cleanup; + char *arg; +{ + UNWIND_ELT *elt; + + uwpalloc (elt); + elt->head.next = unwind_protect_list; + elt->head.cleanup = cleanup; + elt->arg.v = arg; + unwind_protect_list = elt; +} + +static void +remove_unwind_protect_internal (ignore1, ignore2) + char *ignore1, *ignore2; +{ + UNWIND_ELT *elt; + + elt = unwind_protect_list; + if (elt) + { + unwind_protect_list = unwind_protect_list->head.next; + uwpfree (elt); + } +} + +static void +run_unwind_protects_internal (ignore1, ignore2) + char *ignore1, *ignore2; +{ + unwind_frame_run_internal ((char *) NULL, (char *) NULL); +} + +static void +clear_unwind_protects_internal (flag, ignore) + char *flag, *ignore; +{ + if (flag) + { + while (unwind_protect_list) + remove_unwind_protect_internal ((char *)NULL, (char *)NULL); + } + unwind_protect_list = (UNWIND_ELT *)NULL; +} + +static void +unwind_frame_discard_internal (tag, ignore) + char *tag, *ignore; +{ + UNWIND_ELT *elt; + int found; + + found = 0; + while (elt = unwind_protect_list) + { + unwind_protect_list = unwind_protect_list->head.next; + if (elt->head.cleanup == 0 && (STREQ (elt->arg.v, tag))) + { + uwpfree (elt); + found = 1; + break; + } + else + uwpfree (elt); + } + + if (found == 0) + internal_warning ("unwind_frame_discard: %s: frame not found", tag); +} + +/* Restore the value of a variable, based on the contents of SV. + sv->desired_setting is a block of memory SIZE bytes long holding the + value itself. This block of memory is copied back into the variable. */ +static inline void +restore_variable (sv) + SAVED_VAR *sv; +{ + FASTCOPY (sv->desired_setting, sv->variable, sv->size); +} + +static void +unwind_frame_run_internal (tag, ignore) + char *tag, *ignore; +{ + UNWIND_ELT *elt; + int found; + + found = 0; + while (elt = unwind_protect_list) + { + unwind_protect_list = elt->head.next; + + /* If tag, then compare. */ + if (elt->head.cleanup == 0) + { + if (tag && STREQ (elt->arg.v, tag)) + { + uwpfree (elt); + found = 1; + break; + } + } + else + { + if (elt->head.cleanup == (Function *) restore_variable) + restore_variable (&elt->sv.v); + else + (*(elt->head.cleanup)) (elt->arg.v); + } + + uwpfree (elt); + } + if (tag && found == 0) + internal_warning ("unwind_frame_run: %s: frame not found", tag); +} + +static void +unwind_protect_mem_internal (var, psize) + char *var; + char *psize; +{ + int size, allocated; + UNWIND_ELT *elt; + + size = *(int *) psize; + allocated = size + offsetof (UNWIND_ELT, sv.v.desired_setting[0]); + elt = (UNWIND_ELT *)xmalloc (allocated); + elt->head.next = unwind_protect_list; + elt->head.cleanup = (Function *) restore_variable; + elt->sv.v.variable = var; + elt->sv.v.size = size; + FASTCOPY (var, elt->sv.v.desired_setting, size); + unwind_protect_list = elt; +} + +/* Save the value of a variable so it will be restored when unwind-protects + are run. VAR is a pointer to the variable. SIZE is the size in + bytes of VAR. */ +void +unwind_protect_mem (var, size) + char *var; + int size; +{ + without_interrupts (unwind_protect_mem_internal, var, (char *) &size); +} + +#if defined (DEBUG) +#include + +void +print_unwind_protect_tags () +{ + UNWIND_ELT *elt; + + elt = unwind_protect_list; + while (elt) + { + unwind_protect_list = unwind_protect_list->head.next; + if (elt->head.cleanup == 0) + fprintf(stderr, "tag: %s\n", elt->arg.v); + elt = unwind_protect_list; + } +} +#endif diff --git a/unwind_prot.h b/unwind_prot.h new file mode 100644 index 0000000..cc556f7 --- /dev/null +++ b/unwind_prot.h @@ -0,0 +1,49 @@ +/* unwind_prot.h - Macros and functions for hacking unwind protection. */ + +/* Copyright (C) 1993-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_UNWIND_PROT_H) +#define _UNWIND_PROT_H + +/* Run a function without interrupts. */ +extern void begin_unwind_frame __P((char *)); +extern void discard_unwind_frame __P((char *)); +extern void run_unwind_frame __P((char *)); +extern void add_unwind_protect (); /* Not portable to arbitrary C99 hosts. */ +extern void remove_unwind_protect __P((void)); +extern void run_unwind_protects __P((void)); +extern void clear_unwind_protect_list __P((int)); +extern int have_unwind_protects __P((void)); +extern void uwp_init __P((void)); + +/* Define for people who like their code to look a certain way. */ +#define end_unwind_frame() + +/* How to protect a variable. */ +#define unwind_protect_var(X) unwind_protect_mem ((char *)&(X), sizeof (X)) +extern void unwind_protect_mem __P((char *, int)); + +/* Backwards compatibility */ +#define unwind_protect_int unwind_protect_var +#define unwind_protect_short unwind_protect_var +#define unwind_protect_string unwind_protect_var +#define unwind_protect_pointer unwind_protect_var +#define unwind_protect_jmp_buf unwind_protect_var + +#endif /* _UNWIND_PROT_H */ diff --git a/variables.c b/variables.c new file mode 100644 index 0000000..92a5a10 --- /dev/null +++ b/variables.c @@ -0,0 +1,5325 @@ +/* variables.c -- Functions for hacking shell variables. */ + +/* Copyright (C) 1987-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include "config.h" + +#include "bashtypes.h" +#include "posixstat.h" +#include "posixtime.h" + +#if defined (__QNX__) +# if defined (__QNXNTO__) +# include +# else +# include +# endif /* !__QNXNTO__ */ +#endif /* __QNX__ */ + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include +#include "chartypes.h" +#if defined (HAVE_PWD_H) +# include +#endif +#include "bashansi.h" +#include "bashintl.h" + +#define NEED_XTRACE_SET_DECL + +#include "shell.h" +#include "flags.h" +#include "execute_cmd.h" +#include "findcmd.h" +#include "mailcheck.h" +#include "input.h" +#include "hashcmd.h" +#include "pathexp.h" +#include "alias.h" +#include "jobs.h" + +#include "version.h" + +#include "builtins/getopt.h" +#include "builtins/common.h" +#include "builtins/builtext.h" + +#if defined (READLINE) +# include "bashline.h" +# include +#else +# include +#endif + +#if defined (HISTORY) +# include "bashhist.h" +# include +#endif /* HISTORY */ + +#if defined (PROGRAMMABLE_COMPLETION) +# include "pcomplete.h" +#endif + +#define TEMPENV_HASH_BUCKETS 4 /* must be power of two */ + +#define ifsname(s) ((s)[0] == 'I' && (s)[1] == 'F' && (s)[2] == 'S' && (s)[3] == '\0') + +extern char **environ; + +/* Variables used here and defined in other files. */ +extern int posixly_correct; +extern int line_number, line_number_base; +extern int subshell_environment, indirection_level, subshell_level; +extern int build_version, patch_level; +extern int expanding_redir; +extern int last_command_exit_value; +extern char *dist_version, *release_status; +extern char *shell_name; +extern char *primary_prompt, *secondary_prompt; +extern char *current_host_name; +extern sh_builtin_func_t *this_shell_builtin; +extern SHELL_VAR *this_shell_function; +extern char *the_printed_command_except_trap; +extern char *this_command_name; +extern char *command_execution_string; +extern time_t shell_start_time; +extern int assigning_in_environment; +extern int executing_builtin; +extern int funcnest_max; + +#if defined (READLINE) +extern int no_line_editing; +extern int perform_hostname_completion; +#endif + +/* The list of shell variables that the user has created at the global + scope, or that came from the environment. */ +VAR_CONTEXT *global_variables = (VAR_CONTEXT *)NULL; + +/* The current list of shell variables, including function scopes */ +VAR_CONTEXT *shell_variables = (VAR_CONTEXT *)NULL; + +/* The list of shell functions that the user has created, or that came from + the environment. */ +HASH_TABLE *shell_functions = (HASH_TABLE *)NULL; + +#if defined (DEBUGGER) +/* The table of shell function definitions that the user defined or that + came from the environment. */ +HASH_TABLE *shell_function_defs = (HASH_TABLE *)NULL; +#endif + +/* The current variable context. This is really a count of how deep into + executing functions we are. */ +int variable_context = 0; + +/* The set of shell assignments which are made only in the environment + for a single command. */ +HASH_TABLE *temporary_env = (HASH_TABLE *)NULL; + +/* Set to non-zero if an assignment error occurs while putting variables + into the temporary environment. */ +int tempenv_assign_error; + +/* Some funky variables which are known about specially. Here is where + "$*", "$1", and all the cruft is kept. */ +char *dollar_vars[10]; +WORD_LIST *rest_of_args = (WORD_LIST *)NULL; + +/* The value of $$. */ +pid_t dollar_dollar_pid; + +/* Non-zero means that we have to remake EXPORT_ENV. */ +int array_needs_making = 1; + +/* The number of times BASH has been executed. This is set + by initialize_variables (). */ +int shell_level = 0; + +/* An array which is passed to commands as their environment. It is + manufactured from the union of the initial environment and the + shell variables that are marked for export. */ +char **export_env = (char **)NULL; +static int export_env_index; +static int export_env_size; + +#if defined (READLINE) +static int winsize_assignment; /* currently assigning to LINES or COLUMNS */ +#endif + +static HASH_TABLE *last_table_searched; /* hash_lookup sets this */ + +/* Some forward declarations. */ +static void create_variable_tables __P((void)); + +static void set_machine_vars __P((void)); +static void set_home_var __P((void)); +static void set_shell_var __P((void)); +static char *get_bash_name __P((void)); +static void initialize_shell_level __P((void)); +static void uidset __P((void)); +#if defined (ARRAY_VARS) +static void make_vers_array __P((void)); +#endif + +static SHELL_VAR *null_assign __P((SHELL_VAR *, char *, arrayind_t, char *)); +#if defined (ARRAY_VARS) +static SHELL_VAR *null_array_assign __P((SHELL_VAR *, char *, arrayind_t, char *)); +#endif +static SHELL_VAR *get_self __P((SHELL_VAR *)); + +#if defined (ARRAY_VARS) +static SHELL_VAR *init_dynamic_array_var __P((char *, sh_var_value_func_t *, sh_var_assign_func_t *, int)); +static SHELL_VAR *init_dynamic_assoc_var __P((char *, sh_var_value_func_t *, sh_var_assign_func_t *, int)); +#endif + +static SHELL_VAR *assign_seconds __P((SHELL_VAR *, char *, arrayind_t, char *)); +static SHELL_VAR *get_seconds __P((SHELL_VAR *)); +static SHELL_VAR *init_seconds_var __P((void)); + +static int brand __P((void)); +static void sbrand __P((unsigned long)); /* set bash random number generator. */ +static void seedrand __P((void)); /* seed generator randomly */ +static SHELL_VAR *assign_random __P((SHELL_VAR *, char *, arrayind_t, char *)); +static SHELL_VAR *get_random __P((SHELL_VAR *)); + +static SHELL_VAR *assign_lineno __P((SHELL_VAR *, char *, arrayind_t, char *)); +static SHELL_VAR *get_lineno __P((SHELL_VAR *)); + +static SHELL_VAR *assign_subshell __P((SHELL_VAR *, char *, arrayind_t, char *)); +static SHELL_VAR *get_subshell __P((SHELL_VAR *)); + +static SHELL_VAR *get_bashpid __P((SHELL_VAR *)); + +#if defined (HISTORY) +static SHELL_VAR *get_histcmd __P((SHELL_VAR *)); +#endif + +#if defined (READLINE) +static SHELL_VAR *get_comp_wordbreaks __P((SHELL_VAR *)); +static SHELL_VAR *assign_comp_wordbreaks __P((SHELL_VAR *, char *, arrayind_t, char *)); +#endif + +#if defined (PUSHD_AND_POPD) && defined (ARRAY_VARS) +static SHELL_VAR *assign_dirstack __P((SHELL_VAR *, char *, arrayind_t, char *)); +static SHELL_VAR *get_dirstack __P((SHELL_VAR *)); +#endif + +#if defined (ARRAY_VARS) +static SHELL_VAR *get_groupset __P((SHELL_VAR *)); + +static SHELL_VAR *build_hashcmd __P((SHELL_VAR *)); +static SHELL_VAR *get_hashcmd __P((SHELL_VAR *)); +static SHELL_VAR *assign_hashcmd __P((SHELL_VAR *, char *, arrayind_t, char *)); +# if defined (ALIAS) +static SHELL_VAR *build_aliasvar __P((SHELL_VAR *)); +static SHELL_VAR *get_aliasvar __P((SHELL_VAR *)); +static SHELL_VAR *assign_aliasvar __P((SHELL_VAR *, char *, arrayind_t, char *)); +# endif +#endif + +static SHELL_VAR *get_funcname __P((SHELL_VAR *)); +static SHELL_VAR *init_funcname_var __P((void)); + +static void initialize_dynamic_variables __P((void)); + +static SHELL_VAR *hash_lookup __P((const char *, HASH_TABLE *)); +static SHELL_VAR *new_shell_variable __P((const char *)); +static SHELL_VAR *make_new_variable __P((const char *, HASH_TABLE *)); +static SHELL_VAR *bind_variable_internal __P((const char *, char *, HASH_TABLE *, int, int)); + +static void dispose_variable_value __P((SHELL_VAR *)); +static void free_variable_hash_data __P((PTR_T)); + +static VARLIST *vlist_alloc __P((int)); +static VARLIST *vlist_realloc __P((VARLIST *, int)); +static void vlist_add __P((VARLIST *, SHELL_VAR *, int)); + +static void flatten __P((HASH_TABLE *, sh_var_map_func_t *, VARLIST *, int)); + +static int qsort_var_comp __P((SHELL_VAR **, SHELL_VAR **)); + +static SHELL_VAR **vapply __P((sh_var_map_func_t *)); +static SHELL_VAR **fapply __P((sh_var_map_func_t *)); + +static int visible_var __P((SHELL_VAR *)); +static int visible_and_exported __P((SHELL_VAR *)); +static int export_environment_candidate __P((SHELL_VAR *)); +static int local_and_exported __P((SHELL_VAR *)); +static int variable_in_context __P((SHELL_VAR *)); +#if defined (ARRAY_VARS) +static int visible_array_vars __P((SHELL_VAR *)); +#endif + +static SHELL_VAR *find_nameref_at_context __P((SHELL_VAR *, VAR_CONTEXT *)); +static SHELL_VAR *find_variable_nameref_context __P((SHELL_VAR *, VAR_CONTEXT *, VAR_CONTEXT **)); +static SHELL_VAR *find_variable_last_nameref_context __P((SHELL_VAR *, VAR_CONTEXT *, VAR_CONTEXT **)); + +static SHELL_VAR *bind_tempenv_variable __P((const char *, char *)); +static void push_temp_var __P((PTR_T)); +static void propagate_temp_var __P((PTR_T)); +static void dispose_temporary_env __P((sh_free_func_t *)); + +static inline char *mk_env_string __P((const char *, const char *)); +static char **make_env_array_from_var_list __P((SHELL_VAR **)); +static char **make_var_export_array __P((VAR_CONTEXT *)); +static char **make_func_export_array __P((void)); +static void add_temp_array_to_env __P((char **, int, int)); + +static int n_shell_variables __P((void)); +static int set_context __P((SHELL_VAR *)); + +static void push_func_var __P((PTR_T)); +static void push_exported_var __P((PTR_T)); + +static inline int find_special_var __P((const char *)); + +static void +create_variable_tables () +{ + if (shell_variables == 0) + { + shell_variables = global_variables = new_var_context ((char *)NULL, 0); + shell_variables->scope = 0; + shell_variables->table = hash_create (0); + } + + if (shell_functions == 0) + shell_functions = hash_create (0); + +#if defined (DEBUGGER) + if (shell_function_defs == 0) + shell_function_defs = hash_create (0); +#endif +} + +/* Initialize the shell variables from the current environment. + If PRIVMODE is nonzero, don't import functions from ENV or + parse $SHELLOPTS. */ +void +initialize_shell_variables (env, privmode) + char **env; + int privmode; +{ + char *name, *string, *temp_string; + int c, char_index, string_index, string_length, ro; + SHELL_VAR *temp_var; + + create_variable_tables (); + + for (string_index = 0; string = env[string_index++]; ) + { + char_index = 0; + name = string; + while ((c = *string++) && c != '=') + ; + if (string[-1] == '=') + char_index = string - name - 1; + + /* If there are weird things in the environment, like `=xxx' or a + string without an `=', just skip them. */ + if (char_index == 0) + continue; + + /* ASSERT(name[char_index] == '=') */ + name[char_index] = '\0'; + /* Now, name = env variable name, string = env variable value, and + char_index == strlen (name) */ + + temp_var = (SHELL_VAR *)NULL; + + /* If exported function, define it now. Don't import functions from + the environment in privileged mode. */ + if (privmode == 0 && read_but_dont_execute == 0 && STREQN ("() {", string, 4)) + { + string_length = strlen (string); + temp_string = (char *)xmalloc (3 + string_length + char_index); + + strcpy (temp_string, name); + temp_string[char_index] = ' '; + strcpy (temp_string + char_index + 1, string); + + /* Don't import function names that are invalid identifiers from the + environment, though we still allow them to be defined as shell + variables. */ + if (legal_identifier (name)) + parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD); + + if (temp_var = find_function (name)) + { + VSETATTR (temp_var, (att_exported|att_imported)); + array_needs_making = 1; + } + else + { + if (temp_var = bind_variable (name, string, 0)) + { + VSETATTR (temp_var, (att_exported | att_imported | att_invisible)); + array_needs_making = 1; + } + last_command_exit_value = 1; + report_error (_("error importing function definition for `%s'"), name); + } + } +#if defined (ARRAY_VARS) +# if ARRAY_EXPORT + /* Array variables may not yet be exported. */ + else if (*string == '(' && string[1] == '[' && string[strlen (string) - 1] == ')') + { + string_length = 1; + temp_string = extract_array_assignment_list (string, &string_length); + temp_var = assign_array_from_string (name, temp_string); + FREE (temp_string); + VSETATTR (temp_var, (att_exported | att_imported)); + array_needs_making = 1; + } +# endif /* ARRAY_EXPORT */ +#endif +#if 0 + else if (legal_identifier (name)) +#else + else +#endif + { + ro = 0; + if (posixly_correct && STREQ (name, "SHELLOPTS")) + { + temp_var = find_variable ("SHELLOPTS"); + ro = temp_var && readonly_p (temp_var); + if (temp_var) + VUNSETATTR (temp_var, att_readonly); + } + temp_var = bind_variable (name, string, 0); + if (temp_var) + { + if (legal_identifier (name)) + VSETATTR (temp_var, (att_exported | att_imported)); + else + VSETATTR (temp_var, (att_exported | att_imported | att_invisible)); + if (ro) + VSETATTR (temp_var, att_readonly); + array_needs_making = 1; + } + } + + name[char_index] = '='; + /* temp_var can be NULL if it was an exported function with a syntax + error (a different bug, but it still shouldn't dump core). */ + if (temp_var && function_p (temp_var) == 0) /* XXX not yet */ + { + CACHE_IMPORTSTR (temp_var, name); + } + } + + set_pwd (); + + /* Set up initial value of $_ */ + temp_var = set_if_not ("_", dollar_vars[0]); + + /* Remember this pid. */ + dollar_dollar_pid = getpid (); + + /* Now make our own defaults in case the vars that we think are + important are missing. */ + temp_var = set_if_not ("PATH", DEFAULT_PATH_VALUE); +#if 0 + set_auto_export (temp_var); /* XXX */ +#endif + + temp_var = set_if_not ("TERM", "dumb"); +#if 0 + set_auto_export (temp_var); /* XXX */ +#endif + +#if defined (__QNX__) + /* set node id -- don't import it from the environment */ + { + char node_name[22]; +# if defined (__QNXNTO__) + netmgr_ndtostr(ND2S_LOCAL_STR, ND_LOCAL_NODE, node_name, sizeof(node_name)); +# else + qnx_nidtostr (getnid (), node_name, sizeof (node_name)); +# endif + temp_var = bind_variable ("NODE", node_name, 0); + set_auto_export (temp_var); + } +#endif + + /* set up the prompts. */ + if (interactive_shell) + { +#if defined (PROMPT_STRING_DECODE) + set_if_not ("PS1", primary_prompt); +#else + if (current_user.uid == -1) + get_current_user_info (); + set_if_not ("PS1", current_user.euid == 0 ? "# " : primary_prompt); +#endif + set_if_not ("PS2", secondary_prompt); + } + set_if_not ("PS4", "+ "); + + /* Don't allow IFS to be imported from the environment. */ + temp_var = bind_variable ("IFS", " \t\n", 0); + setifs (temp_var); + + /* Magic machine types. Pretty convenient. */ + set_machine_vars (); + + /* Default MAILCHECK for interactive shells. Defer the creation of a + default MAILPATH until the startup files are read, because MAIL + names a mail file if MAILPATH is not set, and we should provide a + default only if neither is set. */ + if (interactive_shell) + { + temp_var = set_if_not ("MAILCHECK", posixly_correct ? "600" : "60"); + VSETATTR (temp_var, att_integer); + } + + /* Do some things with shell level. */ + initialize_shell_level (); + + set_ppid (); + + /* Initialize the `getopts' stuff. */ + temp_var = bind_variable ("OPTIND", "1", 0); + VSETATTR (temp_var, att_integer); + getopts_reset (0); + bind_variable ("OPTERR", "1", 0); + sh_opterr = 1; + + if (login_shell == 1 && posixly_correct == 0) + set_home_var (); + + /* Get the full pathname to THIS shell, and set the BASH variable + to it. */ + name = get_bash_name (); + temp_var = bind_variable ("BASH", name, 0); + free (name); + + /* Make the exported environment variable SHELL be the user's login + shell. Note that the `tset' command looks at this variable + to determine what style of commands to output; if it ends in "csh", + then C-shell commands are output, else Bourne shell commands. */ + set_shell_var (); + + /* Make a variable called BASH_VERSION which contains the version info. */ + bind_variable ("BASH_VERSION", shell_version_string (), 0); +#if defined (ARRAY_VARS) + make_vers_array (); +#endif + + if (command_execution_string) + bind_variable ("BASH_EXECUTION_STRING", command_execution_string, 0); + + /* Find out if we're supposed to be in Posix.2 mode via an + environment variable. */ + temp_var = find_variable ("POSIXLY_CORRECT"); + if (!temp_var) + temp_var = find_variable ("POSIX_PEDANTIC"); + if (temp_var && imported_p (temp_var)) + sv_strict_posix (temp_var->name); + +#if defined (HISTORY) + /* Set history variables to defaults, and then do whatever we would + do if the variable had just been set. Do this only in the case + that we are remembering commands on the history list. */ + if (remember_on_history) + { + name = bash_tilde_expand (posixly_correct ? "~/.sh_history" : "~/.bash_history", 0); + + set_if_not ("HISTFILE", name); + free (name); + } +#endif /* HISTORY */ + + /* Seed the random number generator. */ + seedrand (); + + /* Handle some "special" variables that we may have inherited from a + parent shell. */ + if (interactive_shell) + { + temp_var = find_variable ("IGNOREEOF"); + if (!temp_var) + temp_var = find_variable ("ignoreeof"); + if (temp_var && imported_p (temp_var)) + sv_ignoreeof (temp_var->name); + } + +#if defined (HISTORY) + if (interactive_shell && remember_on_history) + { + sv_history_control ("HISTCONTROL"); + sv_histignore ("HISTIGNORE"); + sv_histtimefmt ("HISTTIMEFORMAT"); + } +#endif /* HISTORY */ + +#if defined (READLINE) && defined (STRICT_POSIX) + /* POSIXLY_CORRECT will only be 1 here if the shell was compiled + -DSTRICT_POSIX */ + if (interactive_shell && posixly_correct && no_line_editing == 0) + rl_prefer_env_winsize = 1; +#endif /* READLINE && STRICT_POSIX */ + + /* + * 24 October 2001 + * + * I'm tired of the arguing and bug reports. Bash now leaves SSH_CLIENT + * and SSH2_CLIENT alone. I'm going to rely on the shell_level check in + * isnetconn() to avoid running the startup files more often than wanted. + * That will, of course, only work if the user's login shell is bash, so + * I've made that behavior conditional on SSH_SOURCE_BASHRC being defined + * in config-top.h. + */ +#if 0 + temp_var = find_variable ("SSH_CLIENT"); + if (temp_var && imported_p (temp_var)) + { + VUNSETATTR (temp_var, att_exported); + array_needs_making = 1; + } + temp_var = find_variable ("SSH2_CLIENT"); + if (temp_var && imported_p (temp_var)) + { + VUNSETATTR (temp_var, att_exported); + array_needs_making = 1; + } +#endif + + /* Get the user's real and effective user ids. */ + uidset (); + + temp_var = find_variable ("BASH_XTRACEFD"); + if (temp_var && imported_p (temp_var)) + sv_xtracefd (temp_var->name); + + /* Initialize the dynamic variables, and seed their values. */ + initialize_dynamic_variables (); +} + +/* **************************************************************** */ +/* */ +/* Setting values for special shell variables */ +/* */ +/* **************************************************************** */ + +static void +set_machine_vars () +{ + SHELL_VAR *temp_var; + + temp_var = set_if_not ("HOSTTYPE", HOSTTYPE); + temp_var = set_if_not ("OSTYPE", OSTYPE); + temp_var = set_if_not ("MACHTYPE", MACHTYPE); + + temp_var = set_if_not ("HOSTNAME", current_host_name); +} + +/* Set $HOME to the information in the password file if we didn't get + it from the environment. */ + +/* This function is not static so the tilde and readline libraries can + use it. */ +char * +sh_get_home_dir () +{ + if (current_user.home_dir == 0) + get_current_user_info (); + return current_user.home_dir; +} + +static void +set_home_var () +{ + SHELL_VAR *temp_var; + + temp_var = find_variable ("HOME"); + if (temp_var == 0) + temp_var = bind_variable ("HOME", sh_get_home_dir (), 0); +#if 0 + VSETATTR (temp_var, att_exported); +#endif +} + +/* Set $SHELL to the user's login shell if it is not already set. Call + get_current_user_info if we haven't already fetched the shell. */ +static void +set_shell_var () +{ + SHELL_VAR *temp_var; + + temp_var = find_variable ("SHELL"); + if (temp_var == 0) + { + if (current_user.shell == 0) + get_current_user_info (); + temp_var = bind_variable ("SHELL", current_user.shell, 0); + } +#if 0 + VSETATTR (temp_var, att_exported); +#endif +} + +static char * +get_bash_name () +{ + char *name; + + if ((login_shell == 1) && RELPATH(shell_name)) + { + if (current_user.shell == 0) + get_current_user_info (); + name = savestring (current_user.shell); + } + else if (ABSPATH(shell_name)) + name = savestring (shell_name); + else if (shell_name[0] == '.' && shell_name[1] == '/') + { + /* Fast path for common case. */ + char *cdir; + int len; + + cdir = get_string_value ("PWD"); + if (cdir) + { + len = strlen (cdir); + name = (char *)xmalloc (len + strlen (shell_name) + 1); + strcpy (name, cdir); + strcpy (name + len, shell_name + 1); + } + else + name = savestring (shell_name); + } + else + { + char *tname; + int s; + + tname = find_user_command (shell_name); + + if (tname == 0) + { + /* Try the current directory. If there is not an executable + there, just punt and use the login shell. */ + s = file_status (shell_name); + if (s & FS_EXECABLE) + { + tname = make_absolute (shell_name, get_string_value ("PWD")); + if (*shell_name == '.') + { + name = sh_canonpath (tname, PATH_CHECKDOTDOT|PATH_CHECKEXISTS); + if (name == 0) + name = tname; + else + free (tname); + } + else + name = tname; + } + else + { + if (current_user.shell == 0) + get_current_user_info (); + name = savestring (current_user.shell); + } + } + else + { + name = full_pathname (tname); + free (tname); + } + } + + return (name); +} + +void +adjust_shell_level (change) + int change; +{ + char new_level[5], *old_SHLVL; + intmax_t old_level; + SHELL_VAR *temp_var; + + old_SHLVL = get_string_value ("SHLVL"); + if (old_SHLVL == 0 || *old_SHLVL == '\0' || legal_number (old_SHLVL, &old_level) == 0) + old_level = 0; + + shell_level = old_level + change; + if (shell_level < 0) + shell_level = 0; + else if (shell_level > 1000) + { + internal_warning (_("shell level (%d) too high, resetting to 1"), shell_level); + shell_level = 1; + } + + /* We don't need the full generality of itos here. */ + if (shell_level < 10) + { + new_level[0] = shell_level + '0'; + new_level[1] = '\0'; + } + else if (shell_level < 100) + { + new_level[0] = (shell_level / 10) + '0'; + new_level[1] = (shell_level % 10) + '0'; + new_level[2] = '\0'; + } + else if (shell_level < 1000) + { + new_level[0] = (shell_level / 100) + '0'; + old_level = shell_level % 100; + new_level[1] = (old_level / 10) + '0'; + new_level[2] = (old_level % 10) + '0'; + new_level[3] = '\0'; + } + + temp_var = bind_variable ("SHLVL", new_level, 0); + set_auto_export (temp_var); +} + +static void +initialize_shell_level () +{ + adjust_shell_level (1); +} + +/* If we got PWD from the environment, update our idea of the current + working directory. In any case, make sure that PWD exists before + checking it. It is possible for getcwd () to fail on shell startup, + and in that case, PWD would be undefined. If this is an interactive + login shell, see if $HOME is the current working directory, and if + that's not the same string as $PWD, set PWD=$HOME. */ + +void +set_pwd () +{ + SHELL_VAR *temp_var, *home_var; + char *temp_string, *home_string; + + home_var = find_variable ("HOME"); + home_string = home_var ? value_cell (home_var) : (char *)NULL; + + temp_var = find_variable ("PWD"); + if (temp_var && imported_p (temp_var) && + (temp_string = value_cell (temp_var)) && + same_file (temp_string, ".", (struct stat *)NULL, (struct stat *)NULL)) + set_working_directory (temp_string); + else if (home_string && interactive_shell && login_shell && + same_file (home_string, ".", (struct stat *)NULL, (struct stat *)NULL)) + { + set_working_directory (home_string); + temp_var = bind_variable ("PWD", home_string, 0); + set_auto_export (temp_var); + } + else + { + temp_string = get_working_directory ("shell-init"); + if (temp_string) + { + temp_var = bind_variable ("PWD", temp_string, 0); + set_auto_export (temp_var); + free (temp_string); + } + } + + /* According to the Single Unix Specification, v2, $OLDPWD is an + `environment variable' and therefore should be auto-exported. + Make a dummy invisible variable for OLDPWD, and mark it as exported. */ + temp_var = bind_variable ("OLDPWD", (char *)NULL, 0); + VSETATTR (temp_var, (att_exported | att_invisible)); +} + +/* Make a variable $PPID, which holds the pid of the shell's parent. */ +void +set_ppid () +{ + char namebuf[INT_STRLEN_BOUND(pid_t) + 1], *name; + SHELL_VAR *temp_var; + + name = inttostr (getppid (), namebuf, sizeof(namebuf)); + temp_var = find_variable ("PPID"); + if (temp_var) + VUNSETATTR (temp_var, (att_readonly | att_exported)); + temp_var = bind_variable ("PPID", name, 0); + VSETATTR (temp_var, (att_readonly | att_integer)); +} + +static void +uidset () +{ + char buff[INT_STRLEN_BOUND(uid_t) + 1], *b; + register SHELL_VAR *v; + + b = inttostr (current_user.uid, buff, sizeof (buff)); + v = find_variable ("UID"); + if (v == 0) + { + v = bind_variable ("UID", b, 0); + VSETATTR (v, (att_readonly | att_integer)); + } + + if (current_user.euid != current_user.uid) + b = inttostr (current_user.euid, buff, sizeof (buff)); + + v = find_variable ("EUID"); + if (v == 0) + { + v = bind_variable ("EUID", b, 0); + VSETATTR (v, (att_readonly | att_integer)); + } +} + +#if defined (ARRAY_VARS) +static void +make_vers_array () +{ + SHELL_VAR *vv; + ARRAY *av; + char *s, d[32], b[INT_STRLEN_BOUND(int) + 1]; + + unbind_variable ("BASH_VERSINFO"); + + vv = make_new_array_variable ("BASH_VERSINFO"); + av = array_cell (vv); + strcpy (d, dist_version); + s = strchr (d, '.'); + if (s) + *s++ = '\0'; + array_insert (av, 0, d); + array_insert (av, 1, s); + s = inttostr (patch_level, b, sizeof (b)); + array_insert (av, 2, s); + s = inttostr (build_version, b, sizeof (b)); + array_insert (av, 3, s); + array_insert (av, 4, release_status); + array_insert (av, 5, MACHTYPE); + + VSETATTR (vv, att_readonly); +} +#endif /* ARRAY_VARS */ + +/* Set the environment variables $LINES and $COLUMNS in response to + a window size change. */ +void +sh_set_lines_and_columns (lines, cols) + int lines, cols; +{ + char val[INT_STRLEN_BOUND(int) + 1], *v; + +#if defined (READLINE) + /* If we are currently assigning to LINES or COLUMNS, don't do anything. */ + if (winsize_assignment) + return; +#endif + + v = inttostr (lines, val, sizeof (val)); + bind_variable ("LINES", v, 0); + + v = inttostr (cols, val, sizeof (val)); + bind_variable ("COLUMNS", v, 0); +} + +/* **************************************************************** */ +/* */ +/* Printing variables and values */ +/* */ +/* **************************************************************** */ + +/* Print LIST (a list of shell variables) to stdout in such a way that + they can be read back in. */ +void +print_var_list (list) + register SHELL_VAR **list; +{ + register int i; + register SHELL_VAR *var; + + for (i = 0; list && (var = list[i]); i++) + if (invisible_p (var) == 0) + print_assignment (var); +} + +/* Print LIST (a list of shell functions) to stdout in such a way that + they can be read back in. */ +void +print_func_list (list) + register SHELL_VAR **list; +{ + register int i; + register SHELL_VAR *var; + + for (i = 0; list && (var = list[i]); i++) + { + printf ("%s ", var->name); + print_var_function (var); + printf ("\n"); + } +} + +/* Print the value of a single SHELL_VAR. No newline is + output, but the variable is printed in such a way that + it can be read back in. */ +void +print_assignment (var) + SHELL_VAR *var; +{ + if (var_isset (var) == 0) + return; + + if (function_p (var)) + { + printf ("%s", var->name); + print_var_function (var); + printf ("\n"); + } +#if defined (ARRAY_VARS) + else if (array_p (var)) + print_array_assignment (var, 0); + else if (assoc_p (var)) + print_assoc_assignment (var, 0); +#endif /* ARRAY_VARS */ + else + { + printf ("%s=", var->name); + print_var_value (var, 1); + printf ("\n"); + } +} + +/* Print the value cell of VAR, a shell variable. Do not print + the name, nor leading/trailing newline. If QUOTE is non-zero, + and the value contains shell metacharacters, quote the value + in such a way that it can be read back in. */ +void +print_var_value (var, quote) + SHELL_VAR *var; + int quote; +{ + char *t; + + if (var_isset (var) == 0) + return; + + if (quote && posixly_correct == 0 && ansic_shouldquote (value_cell (var))) + { + t = ansic_quote (value_cell (var), 0, (int *)0); + printf ("%s", t); + free (t); + } + else if (quote && sh_contains_shell_metas (value_cell (var))) + { + t = sh_single_quote (value_cell (var)); + printf ("%s", t); + free (t); + } + else + printf ("%s", value_cell (var)); +} + +/* Print the function cell of VAR, a shell variable. Do not + print the name, nor leading/trailing newline. */ +void +print_var_function (var) + SHELL_VAR *var; +{ + char *x; + + if (function_p (var) && var_isset (var)) + { + x = named_function_string ((char *)NULL, function_cell(var), FUNC_MULTILINE|FUNC_EXTERNAL); + printf ("%s", x); + } +} + +/* **************************************************************** */ +/* */ +/* Dynamic Variables */ +/* */ +/* **************************************************************** */ + +/* DYNAMIC VARIABLES + + These are variables whose values are generated anew each time they are + referenced. These are implemented using a pair of function pointers + in the struct variable: assign_func, which is called from bind_variable + and, if arrays are compiled into the shell, some of the functions in + arrayfunc.c, and dynamic_value, which is called from find_variable. + + assign_func is called from bind_variable_internal, if + bind_variable_internal discovers that the variable being assigned to + has such a function. The function is called as + SHELL_VAR *temp = (*(entry->assign_func)) (entry, value, ind) + and the (SHELL_VAR *)temp is returned as the value of bind_variable. It + is usually ENTRY (self). IND is an index for an array variable, and + unused otherwise. + + dynamic_value is called from find_variable_internal to return a `new' + value for the specified dynamic varible. If this function is NULL, + the variable is treated as a `normal' shell variable. If it is not, + however, then this function is called like this: + tempvar = (*(var->dynamic_value)) (var); + + Sometimes `tempvar' will replace the value of `var'. Other times, the + shell will simply use the string value. Pretty object-oriented, huh? + + Be warned, though: if you `unset' a special variable, it loses its + special meaning, even if you subsequently set it. + + The special assignment code would probably have been better put in + subst.c: do_assignment_internal, in the same style as + stupidly_hack_special_variables, but I wanted the changes as + localized as possible. */ + +#define INIT_DYNAMIC_VAR(var, val, gfunc, afunc) \ + do \ + { \ + v = bind_variable (var, (val), 0); \ + v->dynamic_value = gfunc; \ + v->assign_func = afunc; \ + } \ + while (0) + +#define INIT_DYNAMIC_ARRAY_VAR(var, gfunc, afunc) \ + do \ + { \ + v = make_new_array_variable (var); \ + v->dynamic_value = gfunc; \ + v->assign_func = afunc; \ + } \ + while (0) + +#define INIT_DYNAMIC_ASSOC_VAR(var, gfunc, afunc) \ + do \ + { \ + v = make_new_assoc_variable (var); \ + v->dynamic_value = gfunc; \ + v->assign_func = afunc; \ + } \ + while (0) + +static SHELL_VAR * +null_assign (self, value, unused, key) + SHELL_VAR *self; + char *value; + arrayind_t unused; + char *key; +{ + return (self); +} + +#if defined (ARRAY_VARS) +static SHELL_VAR * +null_array_assign (self, value, ind, key) + SHELL_VAR *self; + char *value; + arrayind_t ind; + char *key; +{ + return (self); +} +#endif + +/* Degenerate `dynamic_value' function; just returns what's passed without + manipulation. */ +static SHELL_VAR * +get_self (self) + SHELL_VAR *self; +{ + return (self); +} + +#if defined (ARRAY_VARS) +/* A generic dynamic array variable initializer. Initialize array variable + NAME with dynamic value function GETFUNC and assignment function SETFUNC. */ +static SHELL_VAR * +init_dynamic_array_var (name, getfunc, setfunc, attrs) + char *name; + sh_var_value_func_t *getfunc; + sh_var_assign_func_t *setfunc; + int attrs; +{ + SHELL_VAR *v; + + v = find_variable (name); + if (v) + return (v); + INIT_DYNAMIC_ARRAY_VAR (name, getfunc, setfunc); + if (attrs) + VSETATTR (v, attrs); + return v; +} + +static SHELL_VAR * +init_dynamic_assoc_var (name, getfunc, setfunc, attrs) + char *name; + sh_var_value_func_t *getfunc; + sh_var_assign_func_t *setfunc; + int attrs; +{ + SHELL_VAR *v; + + v = find_variable (name); + if (v) + return (v); + INIT_DYNAMIC_ASSOC_VAR (name, getfunc, setfunc); + if (attrs) + VSETATTR (v, attrs); + return v; +} +#endif + +/* The value of $SECONDS. This is the number of seconds since shell + invocation, or, the number of seconds since the last assignment + the + value of the last assignment. */ +static intmax_t seconds_value_assigned; + +static SHELL_VAR * +assign_seconds (self, value, unused, key) + SHELL_VAR *self; + char *value; + arrayind_t unused; + char *key; +{ + if (legal_number (value, &seconds_value_assigned) == 0) + seconds_value_assigned = 0; + shell_start_time = NOW; + return (self); +} + +static SHELL_VAR * +get_seconds (var) + SHELL_VAR *var; +{ + time_t time_since_start; + char *p; + + time_since_start = NOW - shell_start_time; + p = itos(seconds_value_assigned + time_since_start); + + FREE (value_cell (var)); + + VSETATTR (var, att_integer); + var_setvalue (var, p); + return (var); +} + +static SHELL_VAR * +init_seconds_var () +{ + SHELL_VAR *v; + + v = find_variable ("SECONDS"); + if (v) + { + if (legal_number (value_cell(v), &seconds_value_assigned) == 0) + seconds_value_assigned = 0; + } + INIT_DYNAMIC_VAR ("SECONDS", (v ? value_cell (v) : (char *)NULL), get_seconds, assign_seconds); + return v; +} + +/* The random number seed. You can change this by setting RANDOM. */ +static unsigned long rseed = 1; +static int last_random_value; +static int seeded_subshell = 0; + +/* A linear congruential random number generator based on the example + one in the ANSI C standard. This one isn't very good, but a more + complicated one is overkill. */ + +/* Returns a pseudo-random number between 0 and 32767. */ +static int +brand () +{ + /* From "Random number generators: good ones are hard to find", + Park and Miller, Communications of the ACM, vol. 31, no. 10, + October 1988, p. 1195. filtered through FreeBSD */ + long h, l; + + /* Can't seed with 0. */ + if (rseed == 0) + rseed = 123459876; + h = rseed / 127773; + l = rseed % 127773; + rseed = 16807 * l - 2836 * h; +#if 0 + if (rseed < 0) + rseed += 0x7fffffff; +#endif + return ((unsigned int)(rseed & 32767)); /* was % 32768 */ +} + +/* Set the random number generator seed to SEED. */ +static void +sbrand (seed) + unsigned long seed; +{ + rseed = seed; + last_random_value = 0; +} + +static void +seedrand () +{ + struct timeval tv; + + gettimeofday (&tv, NULL); + sbrand (tv.tv_sec ^ tv.tv_usec ^ getpid ()); +} + +static SHELL_VAR * +assign_random (self, value, unused, key) + SHELL_VAR *self; + char *value; + arrayind_t unused; + char *key; +{ + sbrand (strtoul (value, (char **)NULL, 10)); + if (subshell_environment) + seeded_subshell = getpid (); + return (self); +} + +int +get_random_number () +{ + int rv, pid; + + /* Reset for command and process substitution. */ + pid = getpid (); + if (subshell_environment && seeded_subshell != pid) + { + seedrand (); + seeded_subshell = pid; + } + + do + rv = brand (); + while (rv == last_random_value); + return rv; +} + +static SHELL_VAR * +get_random (var) + SHELL_VAR *var; +{ + int rv; + char *p; + + rv = get_random_number (); + last_random_value = rv; + p = itos (rv); + + FREE (value_cell (var)); + + VSETATTR (var, att_integer); + var_setvalue (var, p); + return (var); +} + +static SHELL_VAR * +assign_lineno (var, value, unused, key) + SHELL_VAR *var; + char *value; + arrayind_t unused; + char *key; +{ + intmax_t new_value; + + if (value == 0 || *value == '\0' || legal_number (value, &new_value) == 0) + new_value = 0; + line_number = line_number_base = new_value; + return var; +} + +/* Function which returns the current line number. */ +static SHELL_VAR * +get_lineno (var) + SHELL_VAR *var; +{ + char *p; + int ln; + + ln = executing_line_number (); + p = itos (ln); + FREE (value_cell (var)); + var_setvalue (var, p); + return (var); +} + +static SHELL_VAR * +assign_subshell (var, value, unused, key) + SHELL_VAR *var; + char *value; + arrayind_t unused; + char *key; +{ + intmax_t new_value; + + if (value == 0 || *value == '\0' || legal_number (value, &new_value) == 0) + new_value = 0; + subshell_level = new_value; + return var; +} + +static SHELL_VAR * +get_subshell (var) + SHELL_VAR *var; +{ + char *p; + + p = itos (subshell_level); + FREE (value_cell (var)); + var_setvalue (var, p); + return (var); +} + +static SHELL_VAR * +get_bashpid (var) + SHELL_VAR *var; +{ + int pid; + char *p; + + pid = getpid (); + p = itos (pid); + + FREE (value_cell (var)); + VSETATTR (var, att_integer|att_readonly); + var_setvalue (var, p); + return (var); +} + +static SHELL_VAR * +get_bash_command (var) + SHELL_VAR *var; +{ + char *p; + + if (the_printed_command_except_trap) + p = savestring (the_printed_command_except_trap); + else + { + p = (char *)xmalloc (1); + p[0] = '\0'; + } + FREE (value_cell (var)); + var_setvalue (var, p); + return (var); +} + +#if defined (HISTORY) +static SHELL_VAR * +get_histcmd (var) + SHELL_VAR *var; +{ + char *p; + + p = itos (history_number ()); + FREE (value_cell (var)); + var_setvalue (var, p); + return (var); +} +#endif + +#if defined (READLINE) +/* When this function returns, VAR->value points to malloced memory. */ +static SHELL_VAR * +get_comp_wordbreaks (var) + SHELL_VAR *var; +{ + /* If we don't have anything yet, assign a default value. */ + if (rl_completer_word_break_characters == 0 && bash_readline_initialized == 0) + enable_hostname_completion (perform_hostname_completion); + + FREE (value_cell (var)); + var_setvalue (var, savestring (rl_completer_word_break_characters)); + + return (var); +} + +/* When this function returns, rl_completer_word_break_characters points to + malloced memory. */ +static SHELL_VAR * +assign_comp_wordbreaks (self, value, unused, key) + SHELL_VAR *self; + char *value; + arrayind_t unused; + char *key; +{ + if (rl_completer_word_break_characters && + rl_completer_word_break_characters != rl_basic_word_break_characters) + free (rl_completer_word_break_characters); + + rl_completer_word_break_characters = savestring (value); + return self; +} +#endif /* READLINE */ + +#if defined (PUSHD_AND_POPD) && defined (ARRAY_VARS) +static SHELL_VAR * +assign_dirstack (self, value, ind, key) + SHELL_VAR *self; + char *value; + arrayind_t ind; + char *key; +{ + set_dirstack_element (ind, 1, value); + return self; +} + +static SHELL_VAR * +get_dirstack (self) + SHELL_VAR *self; +{ + ARRAY *a; + WORD_LIST *l; + + l = get_directory_stack (0); + a = array_from_word_list (l); + array_dispose (array_cell (self)); + dispose_words (l); + var_setarray (self, a); + return self; +} +#endif /* PUSHD AND POPD && ARRAY_VARS */ + +#if defined (ARRAY_VARS) +/* We don't want to initialize the group set with a call to getgroups() + unless we're asked to, but we only want to do it once. */ +static SHELL_VAR * +get_groupset (self) + SHELL_VAR *self; +{ + register int i; + int ng; + ARRAY *a; + static char **group_set = (char **)NULL; + + if (group_set == 0) + { + group_set = get_group_list (&ng); + a = array_cell (self); + for (i = 0; i < ng; i++) + array_insert (a, i, group_set[i]); + } + return (self); +} + +static SHELL_VAR * +build_hashcmd (self) + SHELL_VAR *self; +{ + HASH_TABLE *h; + int i; + char *k, *v; + BUCKET_CONTENTS *item; + + h = assoc_cell (self); + if (h) + assoc_dispose (h); + + if (hashed_filenames == 0 || HASH_ENTRIES (hashed_filenames) == 0) + { + var_setvalue (self, (char *)NULL); + return self; + } + + h = assoc_create (hashed_filenames->nbuckets); + for (i = 0; i < hashed_filenames->nbuckets; i++) + { + for (item = hash_items (i, hashed_filenames); item; item = item->next) + { + k = savestring (item->key); + v = pathdata(item)->path; + assoc_insert (h, k, v); + } + } + + var_setvalue (self, (char *)h); + return self; +} + +static SHELL_VAR * +get_hashcmd (self) + SHELL_VAR *self; +{ + build_hashcmd (self); + return (self); +} + +static SHELL_VAR * +assign_hashcmd (self, value, ind, key) + SHELL_VAR *self; + char *value; + arrayind_t ind; + char *key; +{ + phash_insert (key, value, 0, 0); + return (build_hashcmd (self)); +} + +#if defined (ALIAS) +static SHELL_VAR * +build_aliasvar (self) + SHELL_VAR *self; +{ + HASH_TABLE *h; + int i; + char *k, *v; + BUCKET_CONTENTS *item; + + h = assoc_cell (self); + if (h) + assoc_dispose (h); + + if (aliases == 0 || HASH_ENTRIES (aliases) == 0) + { + var_setvalue (self, (char *)NULL); + return self; + } + + h = assoc_create (aliases->nbuckets); + for (i = 0; i < aliases->nbuckets; i++) + { + for (item = hash_items (i, aliases); item; item = item->next) + { + k = savestring (item->key); + v = ((alias_t *)(item->data))->value; + assoc_insert (h, k, v); + } + } + + var_setvalue (self, (char *)h); + return self; +} + +static SHELL_VAR * +get_aliasvar (self) + SHELL_VAR *self; +{ + build_aliasvar (self); + return (self); +} + +static SHELL_VAR * +assign_aliasvar (self, value, ind, key) + SHELL_VAR *self; + char *value; + arrayind_t ind; + char *key; +{ + add_alias (key, value); + return (build_aliasvar (self)); +} +#endif /* ALIAS */ + +#endif /* ARRAY_VARS */ + +/* If ARRAY_VARS is not defined, this just returns the name of any + currently-executing function. If we have arrays, it's a call stack. */ +static SHELL_VAR * +get_funcname (self) + SHELL_VAR *self; +{ +#if ! defined (ARRAY_VARS) + char *t; + if (variable_context && this_shell_function) + { + FREE (value_cell (self)); + t = savestring (this_shell_function->name); + var_setvalue (self, t); + } +#endif + return (self); +} + +void +make_funcname_visible (on_or_off) + int on_or_off; +{ + SHELL_VAR *v; + + v = find_variable ("FUNCNAME"); + if (v == 0 || v->dynamic_value == 0) + return; + + if (on_or_off) + VUNSETATTR (v, att_invisible); + else + VSETATTR (v, att_invisible); +} + +static SHELL_VAR * +init_funcname_var () +{ + SHELL_VAR *v; + + v = find_variable ("FUNCNAME"); + if (v) + return v; +#if defined (ARRAY_VARS) + INIT_DYNAMIC_ARRAY_VAR ("FUNCNAME", get_funcname, null_array_assign); +#else + INIT_DYNAMIC_VAR ("FUNCNAME", (char *)NULL, get_funcname, null_assign); +#endif + VSETATTR (v, att_invisible|att_noassign); + return v; +} + +static void +initialize_dynamic_variables () +{ + SHELL_VAR *v; + + v = init_seconds_var (); + + INIT_DYNAMIC_VAR ("BASH_COMMAND", (char *)NULL, get_bash_command, (sh_var_assign_func_t *)NULL); + INIT_DYNAMIC_VAR ("BASH_SUBSHELL", (char *)NULL, get_subshell, assign_subshell); + + INIT_DYNAMIC_VAR ("RANDOM", (char *)NULL, get_random, assign_random); + VSETATTR (v, att_integer); + INIT_DYNAMIC_VAR ("LINENO", (char *)NULL, get_lineno, assign_lineno); + VSETATTR (v, att_integer); + + INIT_DYNAMIC_VAR ("BASHPID", (char *)NULL, get_bashpid, null_assign); + VSETATTR (v, att_integer|att_readonly); + +#if defined (HISTORY) + INIT_DYNAMIC_VAR ("HISTCMD", (char *)NULL, get_histcmd, (sh_var_assign_func_t *)NULL); + VSETATTR (v, att_integer); +#endif + +#if defined (READLINE) + INIT_DYNAMIC_VAR ("COMP_WORDBREAKS", (char *)NULL, get_comp_wordbreaks, assign_comp_wordbreaks); +#endif + +#if defined (PUSHD_AND_POPD) && defined (ARRAY_VARS) + v = init_dynamic_array_var ("DIRSTACK", get_dirstack, assign_dirstack, 0); +#endif /* PUSHD_AND_POPD && ARRAY_VARS */ + +#if defined (ARRAY_VARS) + v = init_dynamic_array_var ("GROUPS", get_groupset, null_array_assign, att_noassign); + +# if defined (DEBUGGER) + v = init_dynamic_array_var ("BASH_ARGC", get_self, null_array_assign, att_noassign|att_nounset); + v = init_dynamic_array_var ("BASH_ARGV", get_self, null_array_assign, att_noassign|att_nounset); +# endif /* DEBUGGER */ + v = init_dynamic_array_var ("BASH_SOURCE", get_self, null_array_assign, att_noassign|att_nounset); + v = init_dynamic_array_var ("BASH_LINENO", get_self, null_array_assign, att_noassign|att_nounset); + + v = init_dynamic_assoc_var ("BASH_CMDS", get_hashcmd, assign_hashcmd, att_nofree); +# if defined (ALIAS) + v = init_dynamic_assoc_var ("BASH_ALIASES", get_aliasvar, assign_aliasvar, att_nofree); +# endif +#endif + + v = init_funcname_var (); +} + +/* **************************************************************** */ +/* */ +/* Retrieving variables and values */ +/* */ +/* **************************************************************** */ + +/* How to get a pointer to the shell variable or function named NAME. + HASHED_VARS is a pointer to the hash table containing the list + of interest (either variables or functions). */ + +static SHELL_VAR * +hash_lookup (name, hashed_vars) + const char *name; + HASH_TABLE *hashed_vars; +{ + BUCKET_CONTENTS *bucket; + + bucket = hash_search (name, hashed_vars, 0); + /* If we find the name in HASHED_VARS, set LAST_TABLE_SEARCHED to that + table. */ + if (bucket) + last_table_searched = hashed_vars; + return (bucket ? (SHELL_VAR *)bucket->data : (SHELL_VAR *)NULL); +} + +SHELL_VAR * +var_lookup (name, vcontext) + const char *name; + VAR_CONTEXT *vcontext; +{ + VAR_CONTEXT *vc; + SHELL_VAR *v; + + v = (SHELL_VAR *)NULL; + for (vc = vcontext; vc; vc = vc->down) + if (v = hash_lookup (name, vc->table)) + break; + + return v; +} + +/* Look up the variable entry named NAME. If SEARCH_TEMPENV is non-zero, + then also search the temporarily built list of exported variables. + The lookup order is: + temporary_env + shell_variables list +*/ + +SHELL_VAR * +find_variable_internal (name, force_tempenv) + const char *name; + int force_tempenv; +{ + SHELL_VAR *var; + int search_tempenv; + VAR_CONTEXT *vc; + + var = (SHELL_VAR *)NULL; + + /* If explicitly requested, first look in the temporary environment for + the variable. This allows constructs such as "foo=x eval 'echo $foo'" + to get the `exported' value of $foo. This happens if we are executing + a function or builtin, or if we are looking up a variable in a + "subshell environment". */ + search_tempenv = force_tempenv || (expanding_redir == 0 && subshell_environment); + + if (search_tempenv && temporary_env) + var = hash_lookup (name, temporary_env); + + vc = shell_variables; +#if 0 +if (search_tempenv == 0 && /* (subshell_environment & SUBSHELL_COMSUB) && */ + expanding_redir && + (this_shell_builtin == eval_builtin || this_shell_builtin == command_builtin)) + { + itrace("find_variable_internal: search_tempenv == 0: skipping VC_BLTNENV"); + while (vc && (vc->flags & VC_BLTNENV)) + vc = vc->down; + if (vc == 0) + vc = shell_variables; + } +#endif + + if (var == 0) + var = var_lookup (name, vc); + + if (var == 0) + return ((SHELL_VAR *)NULL); + + return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var); +} + +/* Look up and resolve the chain of nameref variables starting at V all the + way to NULL or non-nameref. */ +SHELL_VAR * +find_variable_nameref (v) + SHELL_VAR *v; +{ + int level; + char *newname; + SHELL_VAR *orig, *oldv; + + level = 0; + orig = v; + while (v && nameref_p (v)) + { + level++; + if (level > NAMEREF_MAX) + return ((SHELL_VAR *)0); /* error message here? */ + newname = nameref_cell (v); + if (newname == 0 || *newname == '\0') + return ((SHELL_VAR *)0); + oldv = v; + v = find_variable_internal (newname, (expanding_redir == 0 && (assigning_in_environment || executing_builtin))); + if (v == orig || v == oldv) + { + internal_warning (_("%s: circular name reference"), orig->name); + return ((SHELL_VAR *)0); + } + } + return v; +} + +/* Resolve the chain of nameref variables for NAME. XXX - could change later */ +SHELL_VAR * +find_variable_last_nameref (name) + const char *name; +{ + SHELL_VAR *v, *nv; + char *newname; + int level; + + nv = v = find_variable_noref (name); + level = 0; + while (v && nameref_p (v)) + { + level++; + if (level > NAMEREF_MAX) + return ((SHELL_VAR *)0); /* error message here? */ + newname = nameref_cell (v); + if (newname == 0 || *newname == '\0') + return ((SHELL_VAR *)0); + nv = v; + v = find_variable_internal (newname, (expanding_redir == 0 && (assigning_in_environment || executing_builtin))); + } + return nv; +} + +/* Resolve the chain of nameref variables for NAME. XXX - could change later */ +SHELL_VAR * +find_global_variable_last_nameref (name) + const char *name; +{ + SHELL_VAR *v, *nv; + char *newname; + int level; + + nv = v = find_global_variable_noref (name); + level = 0; + while (v && nameref_p (v)) + { + level++; + if (level > NAMEREF_MAX) + return ((SHELL_VAR *)0); /* error message here? */ + newname = nameref_cell (v); + if (newname == 0 || *newname == '\0') + return ((SHELL_VAR *)0); + nv = v; + v = find_global_variable_noref (newname); + } + return nv; +} + +static SHELL_VAR * +find_nameref_at_context (v, vc) + SHELL_VAR *v; + VAR_CONTEXT *vc; +{ + SHELL_VAR *nv, *nv2; + VAR_CONTEXT *nvc; + char *newname; + int level; + + nv = v; + level = 1; + while (nv && nameref_p (nv)) + { + level++; + if (level > NAMEREF_MAX) + return ((SHELL_VAR *)NULL); + newname = nameref_cell (nv); + if (newname == 0 || *newname == '\0') + return ((SHELL_VAR *)NULL); + nv2 = hash_lookup (newname, vc->table); + if (nv2 == 0) + break; + nv = nv2; + } + return nv; +} + +/* Do nameref resolution from the VC, which is the local context for some + function or builtin, `up' the chain to the global variables context. If + NVCP is not NULL, return the variable context where we finally ended the + nameref resolution (so the bind_variable_internal can use the correct + variable context and hash table). */ +static SHELL_VAR * +find_variable_nameref_context (v, vc, nvcp) + SHELL_VAR *v; + VAR_CONTEXT *vc; + VAR_CONTEXT **nvcp; +{ + SHELL_VAR *nv, *nv2; + VAR_CONTEXT *nvc; + + /* Look starting at the current context all the way `up' */ + for (nv = v, nvc = vc; nvc; nvc = nvc->down) + { + nv2 = find_nameref_at_context (nv, nvc); + if (nv2 == 0) + continue; + nv = nv2; + if (*nvcp) + *nvcp = nvc; + if (nameref_p (nv) == 0) + break; + } + return (nameref_p (nv) ? (SHELL_VAR *)NULL : nv); +} + +/* Do nameref resolution from the VC, which is the local context for some + function or builtin, `up' the chain to the global variables context. If + NVCP is not NULL, return the variable context where we finally ended the + nameref resolution (so the bind_variable_internal can use the correct + variable context and hash table). */ +static SHELL_VAR * +find_variable_last_nameref_context (v, vc, nvcp) + SHELL_VAR *v; + VAR_CONTEXT *vc; + VAR_CONTEXT **nvcp; +{ + SHELL_VAR *nv, *nv2; + VAR_CONTEXT *nvc; + + /* Look starting at the current context all the way `up' */ + for (nv = v, nvc = vc; nvc; nvc = nvc->down) + { + nv2 = find_nameref_at_context (nv, nvc); + if (nv2 == 0) + continue; + nv = nv2; + if (*nvcp) + *nvcp = nvc; + } + return (nameref_p (nv) ? nv : (SHELL_VAR *)NULL); +} + +/* Find a variable, forcing a search of the temporary environment first */ +SHELL_VAR * +find_variable_tempenv (name) + const char *name; +{ + SHELL_VAR *var; + + var = find_variable_internal (name, 1); + if (var && nameref_p (var)) + var = find_variable_nameref (var); + return (var); +} + +/* Find a variable, not forcing a search of the temporary environment first */ +SHELL_VAR * +find_variable_notempenv (name) + const char *name; +{ + SHELL_VAR *var; + + var = find_variable_internal (name, 0); + if (var && nameref_p (var)) + var = find_variable_nameref (var); + return (var); +} + +SHELL_VAR * +find_global_variable (name) + const char *name; +{ + SHELL_VAR *var; + + var = var_lookup (name, global_variables); + if (var && nameref_p (var)) + var = find_variable_nameref (var); + + if (var == 0) + return ((SHELL_VAR *)NULL); + + return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var); +} + +SHELL_VAR * +find_global_variable_noref (name) + const char *name; +{ + SHELL_VAR *var; + + var = var_lookup (name, global_variables); + + if (var == 0) + return ((SHELL_VAR *)NULL); + + return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var); +} + +SHELL_VAR * +find_shell_variable (name) + const char *name; +{ + SHELL_VAR *var; + + var = var_lookup (name, shell_variables); + if (var && nameref_p (var)) + var = find_variable_nameref (var); + + if (var == 0) + return ((SHELL_VAR *)NULL); + + return (var->dynamic_value ? (*(var->dynamic_value)) (var) : var); +} + +/* Look up the variable entry named NAME. Returns the entry or NULL. */ +SHELL_VAR * +find_variable (name) + const char *name; +{ + SHELL_VAR *v; + + last_table_searched = 0; + v = find_variable_internal (name, (expanding_redir == 0 && (assigning_in_environment || executing_builtin))); + if (v && nameref_p (v)) + v = find_variable_nameref (v); + return v; +} + +SHELL_VAR * +find_variable_noref (name) + const char *name; +{ + SHELL_VAR *v; + + v = find_variable_internal (name, (expanding_redir == 0 && (assigning_in_environment || executing_builtin))); + return v; +} + +/* Look up the function entry whose name matches STRING. + Returns the entry or NULL. */ +SHELL_VAR * +find_function (name) + const char *name; +{ + return (hash_lookup (name, shell_functions)); +} + +/* Find the function definition for the shell function named NAME. Returns + the entry or NULL. */ +FUNCTION_DEF * +find_function_def (name) + const char *name; +{ +#if defined (DEBUGGER) + return ((FUNCTION_DEF *)hash_lookup (name, shell_function_defs)); +#else + return ((FUNCTION_DEF *)0); +#endif +} + +/* Return the value of VAR. VAR is assumed to have been the result of a + lookup without any subscript, if arrays are compiled into the shell. */ +char * +get_variable_value (var) + SHELL_VAR *var; +{ + if (var == 0) + return ((char *)NULL); +#if defined (ARRAY_VARS) + else if (array_p (var)) + return (array_reference (array_cell (var), 0)); + else if (assoc_p (var)) + return (assoc_reference (assoc_cell (var), "0")); +#endif + else + return (value_cell (var)); +} + +/* Return the string value of a variable. Return NULL if the variable + doesn't exist. Don't cons a new string. This is a potential memory + leak if the variable is found in the temporary environment. Since + functions and variables have separate name spaces, returns NULL if + var_name is a shell function only. */ +char * +get_string_value (var_name) + const char *var_name; +{ + SHELL_VAR *var; + + var = find_variable (var_name); + return ((var) ? get_variable_value (var) : (char *)NULL); +} + +/* This is present for use by the tilde and readline libraries. */ +char * +sh_get_env_value (v) + const char *v; +{ + return get_string_value (v); +} + +/* **************************************************************** */ +/* */ +/* Creating and setting variables */ +/* */ +/* **************************************************************** */ + +/* Set NAME to VALUE if NAME has no value. */ +SHELL_VAR * +set_if_not (name, value) + char *name, *value; +{ + SHELL_VAR *v; + + if (shell_variables == 0) + create_variable_tables (); + + v = find_variable (name); + if (v == 0) + v = bind_variable_internal (name, value, global_variables->table, HASH_NOSRCH, 0); + return (v); +} + +/* Create a local variable referenced by NAME. */ +SHELL_VAR * +make_local_variable (name) + const char *name; +{ + SHELL_VAR *new_var, *old_var; + VAR_CONTEXT *vc; + int was_tmpvar; + char *tmp_value; + + /* local foo; local foo; is a no-op. */ + old_var = find_variable (name); + if (old_var && local_p (old_var) && old_var->context == variable_context) + return (old_var); + + was_tmpvar = old_var && tempvar_p (old_var); + /* If we're making a local variable in a shell function, the temporary env + has already been merged into the function's variable context stack. We + can assume that a temporary var in the same context appears in the same + VAR_CONTEXT and can safely be returned without creating a new variable + (which results in duplicate names in the same VAR_CONTEXT->table */ + /* We can't just test tmpvar_p because variables in the temporary env given + to a shell function appear in the function's local variable VAR_CONTEXT + but retain their tempvar attribute. We want temporary variables that are + found in temporary_env, hence the test for last_table_searched, which is + set in hash_lookup and only (so far) checked here. */ + if (was_tmpvar && old_var->context == variable_context && last_table_searched != temporary_env) + { + VUNSETATTR (old_var, att_invisible); + return (old_var); + } + if (was_tmpvar) + tmp_value = value_cell (old_var); + + for (vc = shell_variables; vc; vc = vc->down) + if (vc_isfuncenv (vc) && vc->scope == variable_context) + break; + + if (vc == 0) + { + internal_error (_("make_local_variable: no function context at current scope")); + return ((SHELL_VAR *)NULL); + } + else if (vc->table == 0) + vc->table = hash_create (TEMPENV_HASH_BUCKETS); + + /* Since this is called only from the local/declare/typeset code, we can + call builtin_error here without worry (of course, it will also work + for anything that sets this_command_name). Variables with the `noassign' + attribute may not be made local. The test against old_var's context + level is to disallow local copies of readonly global variables (since I + believe that this could be a security hole). Readonly copies of calling + function local variables are OK. */ + if (old_var && (noassign_p (old_var) || + (readonly_p (old_var) && old_var->context == 0))) + { + if (readonly_p (old_var)) + sh_readonly (name); + else if (noassign_p (old_var)) + builtin_error (_("%s: variable may not be assigned value"), name); +#if 0 + /* Let noassign variables through with a warning */ + if (readonly_p (old_var)) +#endif + return ((SHELL_VAR *)NULL); + } + + if (old_var == 0) + new_var = make_new_variable (name, vc->table); + else + { + new_var = make_new_variable (name, vc->table); + + /* If we found this variable in one of the temporary environments, + inherit its value. Watch to see if this causes problems with + things like `x=4 local x'. XXX - see above for temporary env + variables with the same context level as variable_context */ + /* XXX - we should only do this if the variable is not an array. */ + if (was_tmpvar) + var_setvalue (new_var, savestring (tmp_value)); + + new_var->attributes = exported_p (old_var) ? att_exported : 0; + } + + vc->flags |= VC_HASLOCAL; + + new_var->context = variable_context; + VSETATTR (new_var, att_local); + + if (ifsname (name)) + setifs (new_var); + + if (was_tmpvar == 0) + VSETATTR (new_var, att_invisible); /* XXX */ + return (new_var); +} + +/* Create a new shell variable with name NAME. */ +static SHELL_VAR * +new_shell_variable (name) + const char *name; +{ + SHELL_VAR *entry; + + entry = (SHELL_VAR *)xmalloc (sizeof (SHELL_VAR)); + + entry->name = savestring (name); + var_setvalue (entry, (char *)NULL); + CLEAR_EXPORTSTR (entry); + + entry->dynamic_value = (sh_var_value_func_t *)NULL; + entry->assign_func = (sh_var_assign_func_t *)NULL; + + entry->attributes = 0; + + /* Always assume variables are to be made at toplevel! + make_local_variable has the responsibility of changing the + variable context. */ + entry->context = 0; + + return (entry); +} + +/* Create a new shell variable with name NAME and add it to the hash table + TABLE. */ +static SHELL_VAR * +make_new_variable (name, table) + const char *name; + HASH_TABLE *table; +{ + SHELL_VAR *entry; + BUCKET_CONTENTS *elt; + + entry = new_shell_variable (name); + + /* Make sure we have a shell_variables hash table to add to. */ + if (shell_variables == 0) + create_variable_tables (); + + elt = hash_insert (savestring (name), table, HASH_NOSRCH); + elt->data = (PTR_T)entry; + + return entry; +} + +#if defined (ARRAY_VARS) +SHELL_VAR * +make_new_array_variable (name) + char *name; +{ + SHELL_VAR *entry; + ARRAY *array; + + entry = make_new_variable (name, global_variables->table); + array = array_create (); + + var_setarray (entry, array); + VSETATTR (entry, att_array); + return entry; +} + +SHELL_VAR * +make_local_array_variable (name, assoc_ok) + char *name; + int assoc_ok; +{ + SHELL_VAR *var; + ARRAY *array; + + var = make_local_variable (name); + if (var == 0 || array_p (var) || (assoc_ok && assoc_p (var))) + return var; + + array = array_create (); + + dispose_variable_value (var); + var_setarray (var, array); + VSETATTR (var, att_array); + return var; +} + +SHELL_VAR * +make_new_assoc_variable (name) + char *name; +{ + SHELL_VAR *entry; + HASH_TABLE *hash; + + entry = make_new_variable (name, global_variables->table); + hash = assoc_create (0); + + var_setassoc (entry, hash); + VSETATTR (entry, att_assoc); + return entry; +} + +SHELL_VAR * +make_local_assoc_variable (name) + char *name; +{ + SHELL_VAR *var; + HASH_TABLE *hash; + + var = make_local_variable (name); + if (var == 0 || assoc_p (var)) + return var; + + dispose_variable_value (var); + hash = assoc_create (0); + + var_setassoc (var, hash); + VSETATTR (var, att_assoc); + return var; +} +#endif + +char * +make_variable_value (var, value, flags) + SHELL_VAR *var; + char *value; + int flags; +{ + char *retval, *oval; + intmax_t lval, rval; + int expok, olen, op; + + /* If this variable has had its type set to integer (via `declare -i'), + then do expression evaluation on it and store the result. The + functions in expr.c (evalexp()) and bind_int_variable() are responsible + for turning off the integer flag if they don't want further + evaluation done. */ + if (integer_p (var)) + { + if (flags & ASS_APPEND) + { + oval = value_cell (var); + lval = evalexp (oval, &expok); /* ksh93 seems to do this */ + if (expok == 0) + { + top_level_cleanup (); + jump_to_top_level (DISCARD); + } + } + rval = evalexp (value, &expok); + if (expok == 0) + { + top_level_cleanup (); + jump_to_top_level (DISCARD); + } + /* This can be fooled if the variable's value changes while evaluating + `rval'. We can change it if we move the evaluation of lval to here. */ + if (flags & ASS_APPEND) + rval += lval; + retval = itos (rval); + } +#if defined (CASEMOD_ATTRS) + else if (capcase_p (var) || uppercase_p (var) || lowercase_p (var)) + { + if (flags & ASS_APPEND) + { + oval = get_variable_value (var); + if (oval == 0) /* paranoia */ + oval = ""; + olen = STRLEN (oval); + retval = (char *)xmalloc (olen + (value ? STRLEN (value) : 0) + 1); + strcpy (retval, oval); + if (value) + strcpy (retval+olen, value); + } + else if (*value) + retval = savestring (value); + else + { + retval = (char *)xmalloc (1); + retval[0] = '\0'; + } + op = capcase_p (var) ? CASE_CAPITALIZE + : (uppercase_p (var) ? CASE_UPPER : CASE_LOWER); + oval = sh_modcase (retval, (char *)0, op); + free (retval); + retval = oval; + } +#endif /* CASEMOD_ATTRS */ + else if (value) + { + if (flags & ASS_APPEND) + { + oval = get_variable_value (var); + if (oval == 0) /* paranoia */ + oval = ""; + olen = STRLEN (oval); + retval = (char *)xmalloc (olen + (value ? STRLEN (value) : 0) + 1); + strcpy (retval, oval); + if (value) + strcpy (retval+olen, value); + } + else if (*value) + retval = savestring (value); + else + { + retval = (char *)xmalloc (1); + retval[0] = '\0'; + } + } + else + retval = (char *)NULL; + + return retval; +} + +/* Bind a variable NAME to VALUE in the HASH_TABLE TABLE, which may be the + temporary environment (but usually is not). */ +static SHELL_VAR * +bind_variable_internal (name, value, table, hflags, aflags) + const char *name; + char *value; + HASH_TABLE *table; + int hflags, aflags; +{ + char *newval; + SHELL_VAR *entry; + + entry = (hflags & HASH_NOSRCH) ? (SHELL_VAR *)NULL : hash_lookup (name, table); + /* Follow the nameref chain here if this is the global variables table */ + if (entry && nameref_p (entry) && (invisible_p (entry) == 0) && table == global_variables->table) + { + entry = find_global_variable (entry->name); + /* Let's see if we have a nameref referencing a variable that hasn't yet + been created. */ + if (entry == 0) + entry = find_variable_last_nameref (name); /* XXX */ + if (entry == 0) /* just in case */ + return (entry); + } + + /* The first clause handles `declare -n ref; ref=x;' */ + if (entry && invisible_p (entry) && nameref_p (entry)) + goto assign_value; + else if (entry && nameref_p (entry)) + { + newval = nameref_cell (entry); +#if defined (ARRAY_VARS) + /* declare -n foo=x[2] */ + if (valid_array_reference (newval)) + /* XXX - should it be aflags? */ + entry = assign_array_element (newval, make_variable_value (entry, value, 0), aflags); + else +#endif + { + entry = make_new_variable (newval, table); + var_setvalue (entry, make_variable_value (entry, value, 0)); + } + } + else if (entry == 0) + { + entry = make_new_variable (name, table); + var_setvalue (entry, make_variable_value (entry, value, 0)); /* XXX */ + } + else if (entry->assign_func) /* array vars have assign functions now */ + { + INVALIDATE_EXPORTSTR (entry); + newval = (aflags & ASS_APPEND) ? make_variable_value (entry, value, aflags) : value; + if (assoc_p (entry)) + entry = (*(entry->assign_func)) (entry, newval, -1, savestring ("0")); + else if (array_p (entry)) + entry = (*(entry->assign_func)) (entry, newval, 0, 0); + else + entry = (*(entry->assign_func)) (entry, newval, -1, 0); + if (newval != value) + free (newval); + return (entry); + } + else + { +assign_value: + if (readonly_p (entry) || noassign_p (entry)) + { + if (readonly_p (entry)) + err_readonly (name); + return (entry); + } + + /* Variables which are bound are visible. */ + VUNSETATTR (entry, att_invisible); + +#if defined (ARRAY_VARS) + if (assoc_p (entry) || array_p (entry)) + newval = make_array_variable_value (entry, 0, "0", value, aflags); + else +#endif + + newval = make_variable_value (entry, value, aflags); /* XXX */ + + /* Invalidate any cached export string */ + INVALIDATE_EXPORTSTR (entry); + +#if defined (ARRAY_VARS) + /* XXX -- this bears looking at again -- XXX */ + /* If an existing array variable x is being assigned to with x=b or + `read x' or something of that nature, silently convert it to + x[0]=b or `read x[0]'. */ + if (assoc_p (entry)) + { + assoc_insert (assoc_cell (entry), savestring ("0"), newval); + free (newval); + } + else if (array_p (entry)) + { + array_insert (array_cell (entry), 0, newval); + free (newval); + } + else +#endif + { + FREE (value_cell (entry)); + var_setvalue (entry, newval); + } + } + + if (mark_modified_vars) + VSETATTR (entry, att_exported); + + if (exported_p (entry)) + array_needs_making = 1; + + return (entry); +} + +/* Bind a variable NAME to VALUE. This conses up the name + and value strings. If we have a temporary environment, we bind there + first, then we bind into shell_variables. */ + +SHELL_VAR * +bind_variable (name, value, flags) + const char *name; + char *value; + int flags; +{ + SHELL_VAR *v, *nv; + VAR_CONTEXT *vc, *nvc; + int level; + + if (shell_variables == 0) + create_variable_tables (); + + /* If we have a temporary environment, look there first for the variable, + and, if found, modify the value there before modifying it in the + shell_variables table. This allows sourced scripts to modify values + given to them in a temporary environment while modifying the variable + value that the caller sees. */ + if (temporary_env) + bind_tempenv_variable (name, value); + + /* XXX -- handle local variables here. */ + for (vc = shell_variables; vc; vc = vc->down) + { + if (vc_isfuncenv (vc) || vc_isbltnenv (vc)) + { + v = hash_lookup (name, vc->table); + nvc = vc; + if (v && nameref_p (v)) + { + nv = find_variable_nameref_context (v, vc, &nvc); + if (nv == 0) + { + nv = find_variable_last_nameref_context (v, vc, &nvc); + if (nv && nameref_p (nv)) + { + /* If this nameref variable doesn't have a value yet, + set the value. Otherwise, assign using the value as + normal. */ + if (nameref_cell (nv) == 0) + return (bind_variable_internal (nv->name, value, nvc->table, 0, flags)); + return (bind_variable_internal (nameref_cell (nv), value, nvc->table, 0, flags)); + } + else + v = nv; + } + else + v = nv; + } + if (v) + return (bind_variable_internal (v->name, value, nvc->table, 0, flags)); + } + } + /* bind_variable_internal will handle nameref resolution in this case */ + return (bind_variable_internal (name, value, global_variables->table, 0, flags)); +} + +SHELL_VAR * +bind_global_variable (name, value, flags) + const char *name; + char *value; + int flags; +{ + SHELL_VAR *v, *nv; + VAR_CONTEXT *vc, *nvc; + int level; + + if (shell_variables == 0) + create_variable_tables (); + + /* bind_variable_internal will handle nameref resolution in this case */ + return (bind_variable_internal (name, value, global_variables->table, 0, flags)); +} + +/* Make VAR, a simple shell variable, have value VALUE. Once assigned a + value, variables are no longer invisible. This is a duplicate of part + of the internals of bind_variable. If the variable is exported, or + all modified variables should be exported, mark the variable for export + and note that the export environment needs to be recreated. */ +SHELL_VAR * +bind_variable_value (var, value, aflags) + SHELL_VAR *var; + char *value; + int aflags; +{ + char *t; + int invis; + + invis = invisible_p (var); + VUNSETATTR (var, att_invisible); + + if (var->assign_func) + { + /* If we're appending, we need the old value, so use + make_variable_value */ + t = (aflags & ASS_APPEND) ? make_variable_value (var, value, aflags) : value; + (*(var->assign_func)) (var, t, -1, 0); + if (t != value && t) + free (t); + } + else + { + t = make_variable_value (var, value, aflags); +#if defined (ARRAY_VARS) + if ((aflags & ASS_NAMEREF) && (t == 0 || *t == 0 || (legal_identifier (t) == 0 && valid_array_reference (t) == 0))) +#else + if ((aflags & ASS_NAMEREF) && (t == 0 || *t == 0 || legal_identifier (t) == 0)) +#endif + { + free (t); + if (invis) + VSETATTR (var, att_invisible); /* XXX */ + return ((SHELL_VAR *)NULL); + } + FREE (value_cell (var)); + var_setvalue (var, t); + } + + INVALIDATE_EXPORTSTR (var); + + if (mark_modified_vars) + VSETATTR (var, att_exported); + + if (exported_p (var)) + array_needs_making = 1; + + return (var); +} + +/* Bind/create a shell variable with the name LHS to the RHS. + This creates or modifies a variable such that it is an integer. + + This used to be in expr.c, but it is here so that all of the + variable binding stuff is localized. Since we don't want any + recursive evaluation from bind_variable() (possible without this code, + since bind_variable() calls the evaluator for variables with the integer + attribute set), we temporarily turn off the integer attribute for each + variable we set here, then turn it back on after binding as necessary. */ + +SHELL_VAR * +bind_int_variable (lhs, rhs) + char *lhs, *rhs; +{ + register SHELL_VAR *v; + int isint, isarr, implicitarray; + + isint = isarr = implicitarray = 0; +#if defined (ARRAY_VARS) + if (valid_array_reference (lhs)) + { + isarr = 1; + v = array_variable_part (lhs, (char **)0, (int *)0); + } + else +#endif + v = find_variable (lhs); + + if (v) + { + isint = integer_p (v); + VUNSETATTR (v, att_integer); +#if defined (ARRAY_VARS) + if (array_p (v) && isarr == 0) + implicitarray = 1; +#endif + } + +#if defined (ARRAY_VARS) + if (isarr) + v = assign_array_element (lhs, rhs, 0); + else if (implicitarray) + v = bind_array_variable (lhs, 0, rhs, 0); + else +#endif + v = bind_variable (lhs, rhs, 0); + + if (v && isint) + VSETATTR (v, att_integer); + + VUNSETATTR (v, att_invisible); + + return (v); +} + +SHELL_VAR * +bind_var_to_int (var, val) + char *var; + intmax_t val; +{ + char ibuf[INT_STRLEN_BOUND (intmax_t) + 1], *p; + + p = fmtulong (val, 10, ibuf, sizeof (ibuf), 0); + return (bind_int_variable (var, p)); +} + +/* Do a function binding to a variable. You pass the name and + the command to bind to. This conses the name and command. */ +SHELL_VAR * +bind_function (name, value) + const char *name; + COMMAND *value; +{ + SHELL_VAR *entry; + + entry = find_function (name); + if (entry == 0) + { + BUCKET_CONTENTS *elt; + + elt = hash_insert (savestring (name), shell_functions, HASH_NOSRCH); + entry = new_shell_variable (name); + elt->data = (PTR_T)entry; + } + else + INVALIDATE_EXPORTSTR (entry); + + if (var_isset (entry)) + dispose_command (function_cell (entry)); + + if (value) + var_setfunc (entry, copy_command (value)); + else + var_setfunc (entry, 0); + + VSETATTR (entry, att_function); + + if (mark_modified_vars) + VSETATTR (entry, att_exported); + + VUNSETATTR (entry, att_invisible); /* Just to be sure */ + + if (exported_p (entry)) + array_needs_making = 1; + +#if defined (PROGRAMMABLE_COMPLETION) + set_itemlist_dirty (&it_functions); +#endif + + return (entry); +} + +#if defined (DEBUGGER) +/* Bind a function definition, which includes source file and line number + information in addition to the command, into the FUNCTION_DEF hash table.*/ +void +bind_function_def (name, value) + const char *name; + FUNCTION_DEF *value; +{ + FUNCTION_DEF *entry; + BUCKET_CONTENTS *elt; + COMMAND *cmd; + + entry = find_function_def (name); + if (entry) + { + dispose_function_def_contents (entry); + entry = copy_function_def_contents (value, entry); + } + else + { + cmd = value->command; + value->command = 0; + entry = copy_function_def (value); + value->command = cmd; + + elt = hash_insert (savestring (name), shell_function_defs, HASH_NOSRCH); + elt->data = (PTR_T *)entry; + } +} +#endif /* DEBUGGER */ + +/* Add STRING, which is of the form foo=bar, to the temporary environment + HASH_TABLE (temporary_env). The functions in execute_cmd.c are + responsible for moving the main temporary env to one of the other + temporary environments. The expansion code in subst.c calls this. */ +int +assign_in_env (word, flags) + WORD_DESC *word; + int flags; +{ + int offset, aflags; + char *name, *temp, *value; + SHELL_VAR *var; + const char *string; + + string = word->word; + + aflags = 0; + offset = assignment (string, 0); + name = savestring (string); + value = (char *)NULL; + + if (name[offset] == '=') + { + name[offset] = 0; + + /* don't ignore the `+' when assigning temporary environment */ + if (name[offset - 1] == '+') + { + name[offset - 1] = '\0'; + aflags |= ASS_APPEND; + } + + var = find_variable (name); + if (var && (readonly_p (var) || noassign_p (var))) + { + if (readonly_p (var)) + err_readonly (name); + free (name); + return (0); + } + + temp = name + offset + 1; + value = expand_assignment_string_to_string (temp, 0); + + if (var && (aflags & ASS_APPEND)) + { + temp = make_variable_value (var, value, aflags); + FREE (value); + value = temp; + } + } + + if (temporary_env == 0) + temporary_env = hash_create (TEMPENV_HASH_BUCKETS); + + var = hash_lookup (name, temporary_env); + if (var == 0) + var = make_new_variable (name, temporary_env); + else + FREE (value_cell (var)); + + if (value == 0) + { + value = (char *)xmalloc (1); /* like do_assignment_internal */ + value[0] = '\0'; + } + + var_setvalue (var, value); + var->attributes |= (att_exported|att_tempvar); + var->context = variable_context; /* XXX */ + + INVALIDATE_EXPORTSTR (var); + var->exportstr = mk_env_string (name, value); + + array_needs_making = 1; + + if (flags) + stupidly_hack_special_variables (name); + + if (echo_command_at_execute) + /* The Korn shell prints the `+ ' in front of assignment statements, + so we do too. */ + xtrace_print_assignment (name, value, 0, 1); + + free (name); + return 1; +} + +/* **************************************************************** */ +/* */ +/* Copying variables */ +/* */ +/* **************************************************************** */ + +#ifdef INCLUDE_UNUSED +/* Copy VAR to a new data structure and return that structure. */ +SHELL_VAR * +copy_variable (var) + SHELL_VAR *var; +{ + SHELL_VAR *copy = (SHELL_VAR *)NULL; + + if (var) + { + copy = (SHELL_VAR *)xmalloc (sizeof (SHELL_VAR)); + + copy->attributes = var->attributes; + copy->name = savestring (var->name); + + if (function_p (var)) + var_setfunc (copy, copy_command (function_cell (var))); +#if defined (ARRAY_VARS) + else if (array_p (var)) + var_setarray (copy, array_copy (array_cell (var))); + else if (assoc_p (var)) + var_setassoc (copy, assoc_copy (assoc_cell (var))); +#endif + else if (nameref_cell (var)) /* XXX - nameref */ + var_setref (copy, savestring (nameref_cell (var))); + else if (value_cell (var)) /* XXX - nameref */ + var_setvalue (copy, savestring (value_cell (var))); + else + var_setvalue (copy, (char *)NULL); + + copy->dynamic_value = var->dynamic_value; + copy->assign_func = var->assign_func; + + copy->exportstr = COPY_EXPORTSTR (var); + + copy->context = var->context; + } + return (copy); +} +#endif + +/* **************************************************************** */ +/* */ +/* Deleting and unsetting variables */ +/* */ +/* **************************************************************** */ + +/* Dispose of the information attached to VAR. */ +static void +dispose_variable_value (var) + SHELL_VAR *var; +{ + if (function_p (var)) + dispose_command (function_cell (var)); +#if defined (ARRAY_VARS) + else if (array_p (var)) + array_dispose (array_cell (var)); + else if (assoc_p (var)) + assoc_dispose (assoc_cell (var)); +#endif + else if (nameref_p (var)) + FREE (nameref_cell (var)); + else + FREE (value_cell (var)); +} + +void +dispose_variable (var) + SHELL_VAR *var; +{ + if (var == 0) + return; + + if (nofree_p (var) == 0) + dispose_variable_value (var); + + FREE_EXPORTSTR (var); + + free (var->name); + + if (exported_p (var)) + array_needs_making = 1; + + free (var); +} + +/* Unset the shell variable referenced by NAME. Unsetting a nameref variable + unsets the variable it resolves to but leaves the nameref alone. */ +int +unbind_variable (name) + const char *name; +{ + SHELL_VAR *v, *nv; + int r; + + v = var_lookup (name, shell_variables); + nv = (v && nameref_p (v)) ? find_variable_nameref (v) : (SHELL_VAR *)NULL; + + r = nv ? makunbound (nv->name, shell_variables) : makunbound (name, shell_variables); + return r; +} + +/* Unbind NAME, where NAME is assumed to be a nameref variable */ +int +unbind_nameref (name) + const char *name; +{ + SHELL_VAR *v; + + v = var_lookup (name, shell_variables); + if (v && nameref_p (v)) + return makunbound (name, shell_variables); + return 0; +} + +/* Unset the shell function named NAME. */ +int +unbind_func (name) + const char *name; +{ + BUCKET_CONTENTS *elt; + SHELL_VAR *func; + + elt = hash_remove (name, shell_functions, 0); + + if (elt == 0) + return -1; + +#if defined (PROGRAMMABLE_COMPLETION) + set_itemlist_dirty (&it_functions); +#endif + + func = (SHELL_VAR *)elt->data; + if (func) + { + if (exported_p (func)) + array_needs_making++; + dispose_variable (func); + } + + free (elt->key); + free (elt); + + return 0; +} + +#if defined (DEBUGGER) +int +unbind_function_def (name) + const char *name; +{ + BUCKET_CONTENTS *elt; + FUNCTION_DEF *funcdef; + + elt = hash_remove (name, shell_function_defs, 0); + + if (elt == 0) + return -1; + + funcdef = (FUNCTION_DEF *)elt->data; + if (funcdef) + dispose_function_def (funcdef); + + free (elt->key); + free (elt); + + return 0; +} +#endif /* DEBUGGER */ + +int +delete_var (name, vc) + const char *name; + VAR_CONTEXT *vc; +{ + BUCKET_CONTENTS *elt; + SHELL_VAR *old_var; + VAR_CONTEXT *v; + + for (elt = (BUCKET_CONTENTS *)NULL, v = vc; v; v = v->down) + if (elt = hash_remove (name, v->table, 0)) + break; + + if (elt == 0) + return (-1); + + old_var = (SHELL_VAR *)elt->data; + free (elt->key); + free (elt); + + dispose_variable (old_var); + return (0); +} + +/* Make the variable associated with NAME go away. HASH_LIST is the + hash table from which this variable should be deleted (either + shell_variables or shell_functions). + Returns non-zero if the variable couldn't be found. */ +int +makunbound (name, vc) + const char *name; + VAR_CONTEXT *vc; +{ + BUCKET_CONTENTS *elt, *new_elt; + SHELL_VAR *old_var; + VAR_CONTEXT *v; + char *t; + + for (elt = (BUCKET_CONTENTS *)NULL, v = vc; v; v = v->down) + if (elt = hash_remove (name, v->table, 0)) + break; + + if (elt == 0) + return (-1); + + old_var = (SHELL_VAR *)elt->data; + + if (old_var && exported_p (old_var)) + array_needs_making++; + + /* If we're unsetting a local variable and we're still executing inside + the function, just mark the variable as invisible. The function + eventually called by pop_var_context() will clean it up later. This + must be done so that if the variable is subsequently assigned a new + value inside the function, the `local' attribute is still present. + We also need to add it back into the correct hash table. */ + if (old_var && local_p (old_var) && variable_context == old_var->context) + { + if (nofree_p (old_var)) + var_setvalue (old_var, (char *)NULL); +#if defined (ARRAY_VARS) + else if (array_p (old_var)) + array_dispose (array_cell (old_var)); + else if (assoc_p (old_var)) + assoc_dispose (assoc_cell (old_var)); +#endif + else if (nameref_p (old_var)) + FREE (nameref_cell (old_var)); + else + FREE (value_cell (old_var)); + /* Reset the attributes. Preserve the export attribute if the variable + came from a temporary environment. Make sure it stays local, and + make it invisible. */ + old_var->attributes = (exported_p (old_var) && tempvar_p (old_var)) ? att_exported : 0; + VSETATTR (old_var, att_local); + VSETATTR (old_var, att_invisible); + var_setvalue (old_var, (char *)NULL); + INVALIDATE_EXPORTSTR (old_var); + + new_elt = hash_insert (savestring (old_var->name), v->table, 0); + new_elt->data = (PTR_T)old_var; + stupidly_hack_special_variables (old_var->name); + + free (elt->key); + free (elt); + return (0); + } + + /* Have to save a copy of name here, because it might refer to + old_var->name. If so, stupidly_hack_special_variables will + reference freed memory. */ + t = savestring (name); + + free (elt->key); + free (elt); + + dispose_variable (old_var); + stupidly_hack_special_variables (t); + free (t); + + return (0); +} + +/* Get rid of all of the variables in the current context. */ +void +kill_all_local_variables () +{ + VAR_CONTEXT *vc; + + for (vc = shell_variables; vc; vc = vc->down) + if (vc_isfuncenv (vc) && vc->scope == variable_context) + break; + if (vc == 0) + return; /* XXX */ + + if (vc->table && vc_haslocals (vc)) + { + delete_all_variables (vc->table); + hash_dispose (vc->table); + } + vc->table = (HASH_TABLE *)NULL; +} + +static void +free_variable_hash_data (data) + PTR_T data; +{ + SHELL_VAR *var; + + var = (SHELL_VAR *)data; + dispose_variable (var); +} + +/* Delete the entire contents of the hash table. */ +void +delete_all_variables (hashed_vars) + HASH_TABLE *hashed_vars; +{ + hash_flush (hashed_vars, free_variable_hash_data); +} + +/* **************************************************************** */ +/* */ +/* Setting variable attributes */ +/* */ +/* **************************************************************** */ + +#define FIND_OR_MAKE_VARIABLE(name, entry) \ + do \ + { \ + entry = find_variable (name); \ + if (!entry) \ + { \ + entry = bind_variable (name, "", 0); \ + if (!no_invisible_vars && entry) entry->attributes |= att_invisible; \ + } \ + } \ + while (0) + +/* Make the variable associated with NAME be readonly. + If NAME does not exist yet, create it. */ +void +set_var_read_only (name) + char *name; +{ + SHELL_VAR *entry; + + FIND_OR_MAKE_VARIABLE (name, entry); + VSETATTR (entry, att_readonly); +} + +#ifdef INCLUDE_UNUSED +/* Make the function associated with NAME be readonly. + If NAME does not exist, we just punt, like auto_export code below. */ +void +set_func_read_only (name) + const char *name; +{ + SHELL_VAR *entry; + + entry = find_function (name); + if (entry) + VSETATTR (entry, att_readonly); +} + +/* Make the variable associated with NAME be auto-exported. + If NAME does not exist yet, create it. */ +void +set_var_auto_export (name) + char *name; +{ + SHELL_VAR *entry; + + FIND_OR_MAKE_VARIABLE (name, entry); + set_auto_export (entry); +} + +/* Make the function associated with NAME be auto-exported. */ +void +set_func_auto_export (name) + const char *name; +{ + SHELL_VAR *entry; + + entry = find_function (name); + if (entry) + set_auto_export (entry); +} +#endif + +/* **************************************************************** */ +/* */ +/* Creating lists of variables */ +/* */ +/* **************************************************************** */ + +static VARLIST * +vlist_alloc (nentries) + int nentries; +{ + VARLIST *vlist; + + vlist = (VARLIST *)xmalloc (sizeof (VARLIST)); + vlist->list = (SHELL_VAR **)xmalloc ((nentries + 1) * sizeof (SHELL_VAR *)); + vlist->list_size = nentries; + vlist->list_len = 0; + vlist->list[0] = (SHELL_VAR *)NULL; + + return vlist; +} + +static VARLIST * +vlist_realloc (vlist, n) + VARLIST *vlist; + int n; +{ + if (vlist == 0) + return (vlist = vlist_alloc (n)); + if (n > vlist->list_size) + { + vlist->list_size = n; + vlist->list = (SHELL_VAR **)xrealloc (vlist->list, (vlist->list_size + 1) * sizeof (SHELL_VAR *)); + } + return vlist; +} + +static void +vlist_add (vlist, var, flags) + VARLIST *vlist; + SHELL_VAR *var; + int flags; +{ + register int i; + + for (i = 0; i < vlist->list_len; i++) + if (STREQ (var->name, vlist->list[i]->name)) + break; + if (i < vlist->list_len) + return; + + if (i >= vlist->list_size) + vlist = vlist_realloc (vlist, vlist->list_size + 16); + + vlist->list[vlist->list_len++] = var; + vlist->list[vlist->list_len] = (SHELL_VAR *)NULL; +} + +/* Map FUNCTION over the variables in VAR_HASH_TABLE. Return an array of the + variables for which FUNCTION returns a non-zero value. A NULL value + for FUNCTION means to use all variables. */ +SHELL_VAR ** +map_over (function, vc) + sh_var_map_func_t *function; + VAR_CONTEXT *vc; +{ + VAR_CONTEXT *v; + VARLIST *vlist; + SHELL_VAR **ret; + int nentries; + + for (nentries = 0, v = vc; v; v = v->down) + nentries += HASH_ENTRIES (v->table); + + if (nentries == 0) + return (SHELL_VAR **)NULL; + + vlist = vlist_alloc (nentries); + + for (v = vc; v; v = v->down) + flatten (v->table, function, vlist, 0); + + ret = vlist->list; + free (vlist); + return ret; +} + +SHELL_VAR ** +map_over_funcs (function) + sh_var_map_func_t *function; +{ + VARLIST *vlist; + SHELL_VAR **ret; + + if (shell_functions == 0 || HASH_ENTRIES (shell_functions) == 0) + return ((SHELL_VAR **)NULL); + + vlist = vlist_alloc (HASH_ENTRIES (shell_functions)); + + flatten (shell_functions, function, vlist, 0); + + ret = vlist->list; + free (vlist); + return ret; +} + +/* Flatten VAR_HASH_TABLE, applying FUNC to each member and adding those + elements for which FUNC succeeds to VLIST->list. FLAGS is reserved + for future use. Only unique names are added to VLIST. If FUNC is + NULL, each variable in VAR_HASH_TABLE is added to VLIST. If VLIST is + NULL, FUNC is applied to each SHELL_VAR in VAR_HASH_TABLE. If VLIST + and FUNC are both NULL, nothing happens. */ +static void +flatten (var_hash_table, func, vlist, flags) + HASH_TABLE *var_hash_table; + sh_var_map_func_t *func; + VARLIST *vlist; + int flags; +{ + register int i; + register BUCKET_CONTENTS *tlist; + int r; + SHELL_VAR *var; + + if (var_hash_table == 0 || (HASH_ENTRIES (var_hash_table) == 0) || (vlist == 0 && func == 0)) + return; + + for (i = 0; i < var_hash_table->nbuckets; i++) + { + for (tlist = hash_items (i, var_hash_table); tlist; tlist = tlist->next) + { + var = (SHELL_VAR *)tlist->data; + + r = func ? (*func) (var) : 1; + if (r && vlist) + vlist_add (vlist, var, flags); + } + } +} + +void +sort_variables (array) + SHELL_VAR **array; +{ + qsort (array, strvec_len ((char **)array), sizeof (SHELL_VAR *), (QSFUNC *)qsort_var_comp); +} + +static int +qsort_var_comp (var1, var2) + SHELL_VAR **var1, **var2; +{ + int result; + + if ((result = (*var1)->name[0] - (*var2)->name[0]) == 0) + result = strcmp ((*var1)->name, (*var2)->name); + + return (result); +} + +/* Apply FUNC to each variable in SHELL_VARIABLES, adding each one for + which FUNC succeeds to an array of SHELL_VAR *s. Returns the array. */ +static SHELL_VAR ** +vapply (func) + sh_var_map_func_t *func; +{ + SHELL_VAR **list; + + list = map_over (func, shell_variables); + if (list /* && posixly_correct */) + sort_variables (list); + return (list); +} + +/* Apply FUNC to each variable in SHELL_FUNCTIONS, adding each one for + which FUNC succeeds to an array of SHELL_VAR *s. Returns the array. */ +static SHELL_VAR ** +fapply (func) + sh_var_map_func_t *func; +{ + SHELL_VAR **list; + + list = map_over_funcs (func); + if (list /* && posixly_correct */) + sort_variables (list); + return (list); +} + +/* Create a NULL terminated array of all the shell variables. */ +SHELL_VAR ** +all_shell_variables () +{ + return (vapply ((sh_var_map_func_t *)NULL)); +} + +/* Create a NULL terminated array of all the shell functions. */ +SHELL_VAR ** +all_shell_functions () +{ + return (fapply ((sh_var_map_func_t *)NULL)); +} + +static int +visible_var (var) + SHELL_VAR *var; +{ + return (invisible_p (var) == 0); +} + +SHELL_VAR ** +all_visible_functions () +{ + return (fapply (visible_var)); +} + +SHELL_VAR ** +all_visible_variables () +{ + return (vapply (visible_var)); +} + +/* Return non-zero if the variable VAR is visible and exported. Array + variables cannot be exported. */ +static int +visible_and_exported (var) + SHELL_VAR *var; +{ + return (invisible_p (var) == 0 && exported_p (var)); +} + +/* Candidate variables for the export environment are either valid variables + with the export attribute or invalid variables inherited from the initial + environment and simply passed through. */ +static int +export_environment_candidate (var) + SHELL_VAR *var; +{ + return (exported_p (var) && (invisible_p (var) == 0 || imported_p (var))); +} + +/* Return non-zero if VAR is a local variable in the current context and + is exported. */ +static int +local_and_exported (var) + SHELL_VAR *var; +{ + return (invisible_p (var) == 0 && local_p (var) && var->context == variable_context && exported_p (var)); +} + +SHELL_VAR ** +all_exported_variables () +{ + return (vapply (visible_and_exported)); +} + +SHELL_VAR ** +local_exported_variables () +{ + return (vapply (local_and_exported)); +} + +static int +variable_in_context (var) + SHELL_VAR *var; +{ + return (invisible_p (var) == 0 && local_p (var) && var->context == variable_context); +} + +SHELL_VAR ** +all_local_variables () +{ + VARLIST *vlist; + SHELL_VAR **ret; + VAR_CONTEXT *vc; + + vc = shell_variables; + for (vc = shell_variables; vc; vc = vc->down) + if (vc_isfuncenv (vc) && vc->scope == variable_context) + break; + + if (vc == 0) + { + internal_error (_("all_local_variables: no function context at current scope")); + return (SHELL_VAR **)NULL; + } + if (vc->table == 0 || HASH_ENTRIES (vc->table) == 0 || vc_haslocals (vc) == 0) + return (SHELL_VAR **)NULL; + + vlist = vlist_alloc (HASH_ENTRIES (vc->table)); + + flatten (vc->table, variable_in_context, vlist, 0); + + ret = vlist->list; + free (vlist); + if (ret) + sort_variables (ret); + return ret; +} + +#if defined (ARRAY_VARS) +/* Return non-zero if the variable VAR is visible and an array. */ +static int +visible_array_vars (var) + SHELL_VAR *var; +{ + return (invisible_p (var) == 0 && array_p (var)); +} + +SHELL_VAR ** +all_array_variables () +{ + return (vapply (visible_array_vars)); +} +#endif /* ARRAY_VARS */ + +char ** +all_variables_matching_prefix (prefix) + const char *prefix; +{ + SHELL_VAR **varlist; + char **rlist; + int vind, rind, plen; + + plen = STRLEN (prefix); + varlist = all_visible_variables (); + for (vind = 0; varlist && varlist[vind]; vind++) + ; + if (varlist == 0 || vind == 0) + return ((char **)NULL); + rlist = strvec_create (vind + 1); + for (vind = rind = 0; varlist[vind]; vind++) + { + if (plen == 0 || STREQN (prefix, varlist[vind]->name, plen)) + rlist[rind++] = savestring (varlist[vind]->name); + } + rlist[rind] = (char *)0; + free (varlist); + + return rlist; +} + +/* **************************************************************** */ +/* */ +/* Managing temporary variable scopes */ +/* */ +/* **************************************************************** */ + +/* Make variable NAME have VALUE in the temporary environment. */ +static SHELL_VAR * +bind_tempenv_variable (name, value) + const char *name; + char *value; +{ + SHELL_VAR *var; + + var = temporary_env ? hash_lookup (name, temporary_env) : (SHELL_VAR *)NULL; + + if (var) + { + FREE (value_cell (var)); + var_setvalue (var, savestring (value)); + INVALIDATE_EXPORTSTR (var); + } + + return (var); +} + +/* Find a variable in the temporary environment that is named NAME. + Return the SHELL_VAR *, or NULL if not found. */ +SHELL_VAR * +find_tempenv_variable (name) + const char *name; +{ + return (temporary_env ? hash_lookup (name, temporary_env) : (SHELL_VAR *)NULL); +} + +char **tempvar_list; +int tvlist_ind; + +/* Push the variable described by (SHELL_VAR *)DATA down to the next + variable context from the temporary environment. */ +static void +push_temp_var (data) + PTR_T data; +{ + SHELL_VAR *var, *v; + HASH_TABLE *binding_table; + + var = (SHELL_VAR *)data; + + binding_table = shell_variables->table; + if (binding_table == 0) + { + if (shell_variables == global_variables) + /* shouldn't happen */ + binding_table = shell_variables->table = global_variables->table = hash_create (0); + else + binding_table = shell_variables->table = hash_create (TEMPENV_HASH_BUCKETS); + } + + v = bind_variable_internal (var->name, value_cell (var), binding_table, 0, 0); + + /* XXX - should we set the context here? It shouldn't matter because of how + assign_in_env works, but might want to check. */ + if (binding_table == global_variables->table) /* XXX */ + var->attributes &= ~(att_tempvar|att_propagate); + else + { + var->attributes |= att_propagate; + if (binding_table == shell_variables->table) + shell_variables->flags |= VC_HASTMPVAR; + } + v->attributes |= var->attributes; + + if (find_special_var (var->name) >= 0) + tempvar_list[tvlist_ind++] = savestring (var->name); + + dispose_variable (var); +} + +static void +propagate_temp_var (data) + PTR_T data; +{ + SHELL_VAR *var; + + var = (SHELL_VAR *)data; + if (tempvar_p (var) && (var->attributes & att_propagate)) + push_temp_var (data); + else + { + if (find_special_var (var->name) >= 0) + tempvar_list[tvlist_ind++] = savestring (var->name); + dispose_variable (var); + } +} + +/* Free the storage used in the hash table for temporary + environment variables. PUSHF is a function to be called + to free each hash table entry. It takes care of pushing variables + to previous scopes if appropriate. PUSHF stores names of variables + that require special handling (e.g., IFS) on tempvar_list, so this + function can call stupidly_hack_special_variables on all the + variables in the list when the temporary hash table is destroyed. */ +static void +dispose_temporary_env (pushf) + sh_free_func_t *pushf; +{ + int i; + + tempvar_list = strvec_create (HASH_ENTRIES (temporary_env) + 1); + tempvar_list[tvlist_ind = 0] = 0; + + hash_flush (temporary_env, pushf); + hash_dispose (temporary_env); + temporary_env = (HASH_TABLE *)NULL; + + tempvar_list[tvlist_ind] = 0; + + array_needs_making = 1; + +#if 0 + sv_ifs ("IFS"); /* XXX here for now -- check setifs in assign_in_env */ +#endif + for (i = 0; i < tvlist_ind; i++) + stupidly_hack_special_variables (tempvar_list[i]); + + strvec_dispose (tempvar_list); + tempvar_list = 0; + tvlist_ind = 0; +} + +void +dispose_used_env_vars () +{ + if (temporary_env) + { + dispose_temporary_env (propagate_temp_var); + maybe_make_export_env (); + } +} + +/* Take all of the shell variables in the temporary environment HASH_TABLE + and make shell variables from them at the current variable context. */ +void +merge_temporary_env () +{ + if (temporary_env) + dispose_temporary_env (push_temp_var); +} + +/* **************************************************************** */ +/* */ +/* Creating and manipulating the environment */ +/* */ +/* **************************************************************** */ + +static inline char * +mk_env_string (name, value) + const char *name, *value; +{ + int name_len, value_len; + char *p; + + name_len = strlen (name); + value_len = STRLEN (value); + p = (char *)xmalloc (2 + name_len + value_len); + strcpy (p, name); + p[name_len] = '='; + if (value && *value) + strcpy (p + name_len + 1, value); + else + p[name_len + 1] = '\0'; + return (p); +} + +#ifdef DEBUG +/* Debugging */ +static int +valid_exportstr (v) + SHELL_VAR *v; +{ + char *s; + + s = v->exportstr; + if (s == 0) + { + internal_error (_("%s has null exportstr"), v->name); + return (0); + } + if (legal_variable_starter ((unsigned char)*s) == 0) + { + internal_error (_("invalid character %d in exportstr for %s"), *s, v->name); + return (0); + } + for (s = v->exportstr + 1; s && *s; s++) + { + if (*s == '=') + break; + if (legal_variable_char ((unsigned char)*s) == 0) + { + internal_error (_("invalid character %d in exportstr for %s"), *s, v->name); + return (0); + } + } + if (*s != '=') + { + internal_error (_("no `=' in exportstr for %s"), v->name); + return (0); + } + return (1); +} +#endif + +static char ** +make_env_array_from_var_list (vars) + SHELL_VAR **vars; +{ + register int i, list_index; + register SHELL_VAR *var; + char **list, *value; + + list = strvec_create ((1 + strvec_len ((char **)vars))); + +#define USE_EXPORTSTR (value == var->exportstr) + + for (i = 0, list_index = 0; var = vars[i]; i++) + { +#if defined (__CYGWIN__) + /* We don't use the exportstr stuff on Cygwin at all. */ + INVALIDATE_EXPORTSTR (var); +#endif + if (var->exportstr) + value = var->exportstr; + else if (function_p (var)) + value = named_function_string ((char *)NULL, function_cell (var), 0); +#if defined (ARRAY_VARS) + else if (array_p (var)) +# if ARRAY_EXPORT + value = array_to_assignment_string (array_cell (var)); +# else + continue; /* XXX array vars cannot yet be exported */ +# endif /* ARRAY_EXPORT */ + else if (assoc_p (var)) +# if 0 + value = assoc_to_assignment_string (assoc_cell (var)); +# else + continue; /* XXX associative array vars cannot yet be exported */ +# endif +#endif + else + value = value_cell (var); + + if (value) + { + /* Gee, I'd like to get away with not using savestring() if we're + using the cached exportstr... */ + list[list_index] = USE_EXPORTSTR ? savestring (value) + : mk_env_string (var->name, value); + + if (USE_EXPORTSTR == 0) + SAVE_EXPORTSTR (var, list[list_index]); + + list_index++; +#undef USE_EXPORTSTR + +#if 0 /* not yet */ +#if defined (ARRAY_VARS) + if (array_p (var) || assoc_p (var)) + free (value); +#endif +#endif + } + } + + list[list_index] = (char *)NULL; + return (list); +} + +/* Make an array of assignment statements from the hash table + HASHED_VARS which contains SHELL_VARs. Only visible, exported + variables are eligible. */ +static char ** +make_var_export_array (vcxt) + VAR_CONTEXT *vcxt; +{ + char **list; + SHELL_VAR **vars; + +#if 0 + vars = map_over (visible_and_exported, vcxt); +#else + vars = map_over (export_environment_candidate, vcxt); +#endif + + if (vars == 0) + return (char **)NULL; + + list = make_env_array_from_var_list (vars); + + free (vars); + return (list); +} + +static char ** +make_func_export_array () +{ + char **list; + SHELL_VAR **vars; + + vars = map_over_funcs (visible_and_exported); + if (vars == 0) + return (char **)NULL; + + list = make_env_array_from_var_list (vars); + + free (vars); + return (list); +} + +/* Add ENVSTR to the end of the exported environment, EXPORT_ENV. */ +#define add_to_export_env(envstr,do_alloc) \ +do \ + { \ + if (export_env_index >= (export_env_size - 1)) \ + { \ + export_env_size += 16; \ + export_env = strvec_resize (export_env, export_env_size); \ + environ = export_env; \ + } \ + export_env[export_env_index++] = (do_alloc) ? savestring (envstr) : envstr; \ + export_env[export_env_index] = (char *)NULL; \ + } while (0) + +/* Add ASSIGN to EXPORT_ENV, or supercede a previous assignment in the + array with the same left-hand side. Return the new EXPORT_ENV. */ +char ** +add_or_supercede_exported_var (assign, do_alloc) + char *assign; + int do_alloc; +{ + register int i; + int equal_offset; + + equal_offset = assignment (assign, 0); + if (equal_offset == 0) + return (export_env); + + /* If this is a function, then only supersede the function definition. + We do this by including the `=() {' in the comparison, like + initialize_shell_variables does. */ + if (assign[equal_offset + 1] == '(' && + strncmp (assign + equal_offset + 2, ") {", 3) == 0) /* } */ + equal_offset += 4; + + for (i = 0; i < export_env_index; i++) + { + if (STREQN (assign, export_env[i], equal_offset + 1)) + { + free (export_env[i]); + export_env[i] = do_alloc ? savestring (assign) : assign; + return (export_env); + } + } + add_to_export_env (assign, do_alloc); + return (export_env); +} + +static void +add_temp_array_to_env (temp_array, do_alloc, do_supercede) + char **temp_array; + int do_alloc, do_supercede; +{ + register int i; + + if (temp_array == 0) + return; + + for (i = 0; temp_array[i]; i++) + { + if (do_supercede) + export_env = add_or_supercede_exported_var (temp_array[i], do_alloc); + else + add_to_export_env (temp_array[i], do_alloc); + } + + free (temp_array); +} + +/* Make the environment array for the command about to be executed, if the + array needs making. Otherwise, do nothing. If a shell action could + change the array that commands receive for their environment, then the + code should `array_needs_making++'. + + The order to add to the array is: + temporary_env + list of var contexts whose head is shell_variables + shell_functions + + This is the shell variable lookup order. We add only new variable + names at each step, which allows local variables and variables in + the temporary environments to shadow variables in the global (or + any previous) scope. +*/ + +static int +n_shell_variables () +{ + VAR_CONTEXT *vc; + int n; + + for (n = 0, vc = shell_variables; vc; vc = vc->down) + n += HASH_ENTRIES (vc->table); + return n; +} + +int +chkexport (name) + char *name; +{ + SHELL_VAR *v; + + v = find_variable (name); + if (v && exported_p (v)) + { + array_needs_making = 1; + maybe_make_export_env (); + return 1; + } + return 0; +} + +void +maybe_make_export_env () +{ + register char **temp_array; + int new_size; + VAR_CONTEXT *tcxt; + + if (array_needs_making) + { + if (export_env) + strvec_flush (export_env); + + /* Make a guess based on how many shell variables and functions we + have. Since there will always be array variables, and array + variables are not (yet) exported, this will always be big enough + for the exported variables and functions. */ + new_size = n_shell_variables () + HASH_ENTRIES (shell_functions) + 1 + + HASH_ENTRIES (temporary_env); + if (new_size > export_env_size) + { + export_env_size = new_size; + export_env = strvec_resize (export_env, export_env_size); + environ = export_env; + } + export_env[export_env_index = 0] = (char *)NULL; + + /* Make a dummy variable context from the temporary_env, stick it on + the front of shell_variables, call make_var_export_array on the + whole thing to flatten it, and convert the list of SHELL_VAR *s + to the form needed by the environment. */ + if (temporary_env) + { + tcxt = new_var_context ((char *)NULL, 0); + tcxt->table = temporary_env; + tcxt->down = shell_variables; + } + else + tcxt = shell_variables; + + temp_array = make_var_export_array (tcxt); + if (temp_array) + add_temp_array_to_env (temp_array, 0, 0); + + if (tcxt != shell_variables) + free (tcxt); + +#if defined (RESTRICTED_SHELL) + /* Restricted shells may not export shell functions. */ + temp_array = restricted ? (char **)0 : make_func_export_array (); +#else + temp_array = make_func_export_array (); +#endif + if (temp_array) + add_temp_array_to_env (temp_array, 0, 0); + + array_needs_making = 0; + } +} + +/* This is an efficiency hack. PWD and OLDPWD are auto-exported, so + we will need to remake the exported environment every time we + change directories. `_' is always put into the environment for + every external command, so without special treatment it will always + cause the environment to be remade. + + If there is no other reason to make the exported environment, we can + just update the variables in place and mark the exported environment + as no longer needing a remake. */ +void +update_export_env_inplace (env_prefix, preflen, value) + char *env_prefix; + int preflen; + char *value; +{ + char *evar; + + evar = (char *)xmalloc (STRLEN (value) + preflen + 1); + strcpy (evar, env_prefix); + if (value) + strcpy (evar + preflen, value); + export_env = add_or_supercede_exported_var (evar, 0); +} + +/* We always put _ in the environment as the name of this command. */ +void +put_command_name_into_env (command_name) + char *command_name; +{ + update_export_env_inplace ("_=", 2, command_name); +} + +/* **************************************************************** */ +/* */ +/* Managing variable contexts */ +/* */ +/* **************************************************************** */ + +/* Allocate and return a new variable context with NAME and FLAGS. + NAME can be NULL. */ + +VAR_CONTEXT * +new_var_context (name, flags) + char *name; + int flags; +{ + VAR_CONTEXT *vc; + + vc = (VAR_CONTEXT *)xmalloc (sizeof (VAR_CONTEXT)); + vc->name = name ? savestring (name) : (char *)NULL; + vc->scope = variable_context; + vc->flags = flags; + + vc->up = vc->down = (VAR_CONTEXT *)NULL; + vc->table = (HASH_TABLE *)NULL; + + return vc; +} + +/* Free a variable context and its data, including the hash table. Dispose + all of the variables. */ +void +dispose_var_context (vc) + VAR_CONTEXT *vc; +{ + FREE (vc->name); + + if (vc->table) + { + delete_all_variables (vc->table); + hash_dispose (vc->table); + } + + free (vc); +} + +/* Set VAR's scope level to the current variable context. */ +static int +set_context (var) + SHELL_VAR *var; +{ + return (var->context = variable_context); +} + +/* Make a new variable context with NAME and FLAGS and a HASH_TABLE of + temporary variables, and push it onto shell_variables. This is + for shell functions. */ +VAR_CONTEXT * +push_var_context (name, flags, tempvars) + char *name; + int flags; + HASH_TABLE *tempvars; +{ + VAR_CONTEXT *vc; + + vc = new_var_context (name, flags); + vc->table = tempvars; + if (tempvars) + { + /* Have to do this because the temp environment was created before + variable_context was incremented. */ + flatten (tempvars, set_context, (VARLIST *)NULL, 0); + vc->flags |= VC_HASTMPVAR; + } + vc->down = shell_variables; + shell_variables->up = vc; + + return (shell_variables = vc); +} + +static void +push_func_var (data) + PTR_T data; +{ + SHELL_VAR *var, *v; + + var = (SHELL_VAR *)data; + + if (tempvar_p (var) && (posixly_correct || (var->attributes & att_propagate))) + { + /* Make sure we have a hash table to store the variable in while it is + being propagated down to the global variables table. Create one if + we have to */ + if ((vc_isfuncenv (shell_variables) || vc_istempenv (shell_variables)) && shell_variables->table == 0) + shell_variables->table = hash_create (0); + /* XXX - should we set v->context here? */ + v = bind_variable_internal (var->name, value_cell (var), shell_variables->table, 0, 0); + if (shell_variables == global_variables) + var->attributes &= ~(att_tempvar|att_propagate); + else + shell_variables->flags |= VC_HASTMPVAR; + v->attributes |= var->attributes; + } + else + stupidly_hack_special_variables (var->name); /* XXX */ + + dispose_variable (var); +} + +/* Pop the top context off of VCXT and dispose of it, returning the rest of + the stack. */ +void +pop_var_context () +{ + VAR_CONTEXT *ret, *vcxt; + + vcxt = shell_variables; + if (vc_isfuncenv (vcxt) == 0) + { + internal_error (_("pop_var_context: head of shell_variables not a function context")); + return; + } + + if (ret = vcxt->down) + { + ret->up = (VAR_CONTEXT *)NULL; + shell_variables = ret; + if (vcxt->table) + hash_flush (vcxt->table, push_func_var); + dispose_var_context (vcxt); + } + else + internal_error (_("pop_var_context: no global_variables context")); +} + +/* Delete the HASH_TABLEs for all variable contexts beginning at VCXT, and + all of the VAR_CONTEXTs except GLOBAL_VARIABLES. */ +void +delete_all_contexts (vcxt) + VAR_CONTEXT *vcxt; +{ + VAR_CONTEXT *v, *t; + + for (v = vcxt; v != global_variables; v = t) + { + t = v->down; + dispose_var_context (v); + } + + delete_all_variables (global_variables->table); + shell_variables = global_variables; +} + +/* **************************************************************** */ +/* */ +/* Pushing and Popping temporary variable scopes */ +/* */ +/* **************************************************************** */ + +VAR_CONTEXT * +push_scope (flags, tmpvars) + int flags; + HASH_TABLE *tmpvars; +{ + return (push_var_context ((char *)NULL, flags, tmpvars)); +} + +static void +push_exported_var (data) + PTR_T data; +{ + SHELL_VAR *var, *v; + + var = (SHELL_VAR *)data; + + /* If a temp var had its export attribute set, or it's marked to be + propagated, bind it in the previous scope before disposing it. */ + /* XXX - This isn't exactly right, because all tempenv variables have the + export attribute set. */ +#if 0 + if (exported_p (var) || (var->attributes & att_propagate)) +#else + if (tempvar_p (var) && exported_p (var) && (var->attributes & att_propagate)) +#endif + { + var->attributes &= ~att_tempvar; /* XXX */ + v = bind_variable_internal (var->name, value_cell (var), shell_variables->table, 0, 0); + if (shell_variables == global_variables) + var->attributes &= ~att_propagate; + v->attributes |= var->attributes; + } + else + stupidly_hack_special_variables (var->name); /* XXX */ + + dispose_variable (var); +} + +void +pop_scope (is_special) + int is_special; +{ + VAR_CONTEXT *vcxt, *ret; + + vcxt = shell_variables; + if (vc_istempscope (vcxt) == 0) + { + internal_error (_("pop_scope: head of shell_variables not a temporary environment scope")); + return; + } + + ret = vcxt->down; + if (ret) + ret->up = (VAR_CONTEXT *)NULL; + + shell_variables = ret; + + /* Now we can take care of merging variables in VCXT into set of scopes + whose head is RET (shell_variables). */ + FREE (vcxt->name); + if (vcxt->table) + { + if (is_special) + hash_flush (vcxt->table, push_func_var); + else + hash_flush (vcxt->table, push_exported_var); + hash_dispose (vcxt->table); + } + free (vcxt); + + sv_ifs ("IFS"); /* XXX here for now */ +} + +/* **************************************************************** */ +/* */ +/* Pushing and Popping function contexts */ +/* */ +/* **************************************************************** */ + +static WORD_LIST **dollar_arg_stack = (WORD_LIST **)NULL; +static int dollar_arg_stack_slots; +static int dollar_arg_stack_index; + +/* XXX - we might want to consider pushing and popping the `getopts' state + when we modify the positional parameters. */ +void +push_context (name, is_subshell, tempvars) + char *name; /* function name */ + int is_subshell; + HASH_TABLE *tempvars; +{ + if (is_subshell == 0) + push_dollar_vars (); + variable_context++; + push_var_context (name, VC_FUNCENV, tempvars); +} + +/* Only called when subshell == 0, so we don't need to check, and can + unconditionally pop the dollar vars off the stack. */ +void +pop_context () +{ + pop_dollar_vars (); + variable_context--; + pop_var_context (); + + sv_ifs ("IFS"); /* XXX here for now */ +} + +/* Save the existing positional parameters on a stack. */ +void +push_dollar_vars () +{ + if (dollar_arg_stack_index + 2 > dollar_arg_stack_slots) + { + dollar_arg_stack = (WORD_LIST **) + xrealloc (dollar_arg_stack, (dollar_arg_stack_slots += 10) + * sizeof (WORD_LIST *)); + } + dollar_arg_stack[dollar_arg_stack_index++] = list_rest_of_args (); + dollar_arg_stack[dollar_arg_stack_index] = (WORD_LIST *)NULL; +} + +/* Restore the positional parameters from our stack. */ +void +pop_dollar_vars () +{ + if (!dollar_arg_stack || dollar_arg_stack_index == 0) + return; + + remember_args (dollar_arg_stack[--dollar_arg_stack_index], 1); + dispose_words (dollar_arg_stack[dollar_arg_stack_index]); + dollar_arg_stack[dollar_arg_stack_index] = (WORD_LIST *)NULL; + set_dollar_vars_unchanged (); +} + +void +dispose_saved_dollar_vars () +{ + if (!dollar_arg_stack || dollar_arg_stack_index == 0) + return; + + dispose_words (dollar_arg_stack[dollar_arg_stack_index]); + dollar_arg_stack[dollar_arg_stack_index] = (WORD_LIST *)NULL; +} + +/* Manipulate the special BASH_ARGV and BASH_ARGC variables. */ + +void +push_args (list) + WORD_LIST *list; +{ +#if defined (ARRAY_VARS) && defined (DEBUGGER) + SHELL_VAR *bash_argv_v, *bash_argc_v; + ARRAY *bash_argv_a, *bash_argc_a; + WORD_LIST *l; + arrayind_t i; + char *t; + + GET_ARRAY_FROM_VAR ("BASH_ARGV", bash_argv_v, bash_argv_a); + GET_ARRAY_FROM_VAR ("BASH_ARGC", bash_argc_v, bash_argc_a); + + for (l = list, i = 0; l; l = l->next, i++) + array_push (bash_argv_a, l->word->word); + + t = itos (i); + array_push (bash_argc_a, t); + free (t); +#endif /* ARRAY_VARS && DEBUGGER */ +} + +/* Remove arguments from BASH_ARGV array. Pop top element off BASH_ARGC + array and use that value as the count of elements to remove from + BASH_ARGV. */ +void +pop_args () +{ +#if defined (ARRAY_VARS) && defined (DEBUGGER) + SHELL_VAR *bash_argv_v, *bash_argc_v; + ARRAY *bash_argv_a, *bash_argc_a; + ARRAY_ELEMENT *ce; + intmax_t i; + + GET_ARRAY_FROM_VAR ("BASH_ARGV", bash_argv_v, bash_argv_a); + GET_ARRAY_FROM_VAR ("BASH_ARGC", bash_argc_v, bash_argc_a); + + ce = array_shift (bash_argc_a, 1, 0); + if (ce == 0 || legal_number (element_value (ce), &i) == 0) + i = 0; + + for ( ; i > 0; i--) + array_pop (bash_argv_a); + array_dispose_element (ce); +#endif /* ARRAY_VARS && DEBUGGER */ +} + +/************************************************* + * * + * Functions to manage special variables * + * * + *************************************************/ + +/* Extern declarations for variables this code has to manage. */ +extern int eof_encountered, eof_encountered_limit, ignoreeof; + +#if defined (READLINE) +extern int hostname_list_initialized; +#endif + +/* An alist of name.function for each special variable. Most of the + functions don't do much, and in fact, this would be faster with a + switch statement, but by the end of this file, I am sick of switch + statements. */ + +#define SET_INT_VAR(name, intvar) intvar = find_variable (name) != 0 + +/* This table will be sorted with qsort() the first time it's accessed. */ +struct name_and_function { + char *name; + sh_sv_func_t *function; +}; + +static struct name_and_function special_vars[] = { + { "BASH_COMPAT", sv_shcompat }, + { "BASH_XTRACEFD", sv_xtracefd }, + +#if defined (JOB_CONTROL) + { "CHILD_MAX", sv_childmax }, +#endif + +#if defined (READLINE) +# if defined (STRICT_POSIX) + { "COLUMNS", sv_winsize }, +# endif + { "COMP_WORDBREAKS", sv_comp_wordbreaks }, +#endif + + { "FUNCNEST", sv_funcnest }, + + { "GLOBIGNORE", sv_globignore }, + +#if defined (HISTORY) + { "HISTCONTROL", sv_history_control }, + { "HISTFILESIZE", sv_histsize }, + { "HISTIGNORE", sv_histignore }, + { "HISTSIZE", sv_histsize }, + { "HISTTIMEFORMAT", sv_histtimefmt }, +#endif + +#if defined (__CYGWIN__) + { "HOME", sv_home }, +#endif + +#if defined (READLINE) + { "HOSTFILE", sv_hostfile }, +#endif + + { "IFS", sv_ifs }, + { "IGNOREEOF", sv_ignoreeof }, + + { "LANG", sv_locale }, + { "LC_ALL", sv_locale }, + { "LC_COLLATE", sv_locale }, + { "LC_CTYPE", sv_locale }, + { "LC_MESSAGES", sv_locale }, + { "LC_NUMERIC", sv_locale }, + { "LC_TIME", sv_locale }, + +#if defined (READLINE) && defined (STRICT_POSIX) + { "LINES", sv_winsize }, +#endif + + { "MAIL", sv_mail }, + { "MAILCHECK", sv_mail }, + { "MAILPATH", sv_mail }, + + { "OPTERR", sv_opterr }, + { "OPTIND", sv_optind }, + + { "PATH", sv_path }, + { "POSIXLY_CORRECT", sv_strict_posix }, + +#if defined (READLINE) + { "TERM", sv_terminal }, + { "TERMCAP", sv_terminal }, + { "TERMINFO", sv_terminal }, +#endif /* READLINE */ + + { "TEXTDOMAIN", sv_locale }, + { "TEXTDOMAINDIR", sv_locale }, + +#if defined (HAVE_TZSET) + { "TZ", sv_tz }, +#endif + +#if defined (HISTORY) && defined (BANG_HISTORY) + { "histchars", sv_histchars }, +#endif /* HISTORY && BANG_HISTORY */ + + { "ignoreeof", sv_ignoreeof }, + + { (char *)0, (sh_sv_func_t *)0 } +}; + +#define N_SPECIAL_VARS (sizeof (special_vars) / sizeof (special_vars[0]) - 1) + +static int +sv_compare (sv1, sv2) + struct name_and_function *sv1, *sv2; +{ + int r; + + if ((r = sv1->name[0] - sv2->name[0]) == 0) + r = strcmp (sv1->name, sv2->name); + return r; +} + +static inline int +find_special_var (name) + const char *name; +{ + register int i, r; + + for (i = 0; special_vars[i].name; i++) + { + r = special_vars[i].name[0] - name[0]; + if (r == 0) + r = strcmp (special_vars[i].name, name); + if (r == 0) + return i; + else if (r > 0) + /* Can't match any of rest of elements in sorted list. Take this out + if it causes problems in certain environments. */ + break; + } + return -1; +} + +/* The variable in NAME has just had its state changed. Check to see if it + is one of the special ones where something special happens. */ +void +stupidly_hack_special_variables (name) + char *name; +{ + static int sv_sorted = 0; + int i; + + if (sv_sorted == 0) /* shouldn't need, but it's fairly cheap. */ + { + qsort (special_vars, N_SPECIAL_VARS, sizeof (special_vars[0]), + (QSFUNC *)sv_compare); + sv_sorted = 1; + } + + i = find_special_var (name); + if (i != -1) + (*(special_vars[i].function)) (name); +} + +/* Special variables that need hooks to be run when they are unset as part + of shell reinitialization should have their sv_ functions run here. */ +void +reinit_special_variables () +{ +#if defined (READLINE) + sv_comp_wordbreaks ("COMP_WORDBREAKS"); +#endif + sv_globignore ("GLOBIGNORE"); + sv_opterr ("OPTERR"); +} + +void +sv_ifs (name) + char *name; +{ + SHELL_VAR *v; + + v = find_variable ("IFS"); + setifs (v); +} + +/* What to do just after the PATH variable has changed. */ +void +sv_path (name) + char *name; +{ + /* hash -r */ + phash_flush (); +} + +/* What to do just after one of the MAILxxxx variables has changed. NAME + is the name of the variable. This is called with NAME set to one of + MAIL, MAILCHECK, or MAILPATH. */ +void +sv_mail (name) + char *name; +{ + /* If the time interval for checking the files has changed, then + reset the mail timer. Otherwise, one of the pathname vars + to the users mailbox has changed, so rebuild the array of + filenames. */ + if (name[4] == 'C') /* if (strcmp (name, "MAILCHECK") == 0) */ + reset_mail_timer (); + else + { + free_mail_files (); + remember_mail_dates (); + } +} + +void +sv_funcnest (name) + char *name; +{ + SHELL_VAR *v; + intmax_t num; + + v = find_variable (name); + if (v == 0) + funcnest_max = 0; + else if (legal_number (value_cell (v), &num) == 0) + funcnest_max = 0; + else + funcnest_max = num; +} + +/* What to do when GLOBIGNORE changes. */ +void +sv_globignore (name) + char *name; +{ + if (privileged_mode == 0) + setup_glob_ignore (name); +} + +#if defined (READLINE) +void +sv_comp_wordbreaks (name) + char *name; +{ + SHELL_VAR *sv; + + sv = find_variable (name); + if (sv == 0) + reset_completer_word_break_chars (); +} + +/* What to do just after one of the TERMxxx variables has changed. + If we are an interactive shell, then try to reset the terminal + information in readline. */ +void +sv_terminal (name) + char *name; +{ + if (interactive_shell && no_line_editing == 0) + rl_reset_terminal (get_string_value ("TERM")); +} + +void +sv_hostfile (name) + char *name; +{ + SHELL_VAR *v; + + v = find_variable (name); + if (v == 0) + clear_hostname_list (); + else + hostname_list_initialized = 0; +} + +#if defined (STRICT_POSIX) +/* In strict posix mode, we allow assignments to LINES and COLUMNS (and values + found in the initial environment) to override the terminal size reported by + the kernel. */ +void +sv_winsize (name) + char *name; +{ + SHELL_VAR *v; + intmax_t xd; + int d; + + if (posixly_correct == 0 || interactive_shell == 0 || no_line_editing) + return; + + v = find_variable (name); + if (v == 0 || var_isnull (v)) + rl_reset_screen_size (); + else + { + if (legal_number (value_cell (v), &xd) == 0) + return; + winsize_assignment = 1; + d = xd; /* truncate */ + if (name[0] == 'L') /* LINES */ + rl_set_screen_size (d, -1); + else /* COLUMNS */ + rl_set_screen_size (-1, d); + winsize_assignment = 0; + } +} +#endif /* STRICT_POSIX */ +#endif /* READLINE */ + +/* Update the value of HOME in the export environment so tilde expansion will + work on cygwin. */ +#if defined (__CYGWIN__) +sv_home (name) + char *name; +{ + array_needs_making = 1; + maybe_make_export_env (); +} +#endif + +#if defined (HISTORY) +/* What to do after the HISTSIZE or HISTFILESIZE variables change. + If there is a value for this HISTSIZE (and it is numeric), then stifle + the history. Otherwise, if there is NO value for this variable, + unstifle the history. If name is HISTFILESIZE, and its value is + numeric, truncate the history file to hold no more than that many + lines. */ +void +sv_histsize (name) + char *name; +{ + char *temp; + intmax_t num; + int hmax; + + temp = get_string_value (name); + + if (temp && *temp) + { + if (legal_number (temp, &num)) + { + hmax = num; + if (hmax < 0 && name[4] == 'S') + unstifle_history (); /* unstifle history if HISTSIZE < 0 */ + else if (name[4] == 'S') + { + stifle_history (hmax); + hmax = where_history (); + if (history_lines_this_session > hmax) + history_lines_this_session = hmax; + } + else if (hmax >= 0) /* truncate HISTFILE if HISTFILESIZE >= 0 */ + { + history_truncate_file (get_string_value ("HISTFILE"), hmax); + if (hmax <= history_lines_in_file) + history_lines_in_file = hmax; + } + } + } + else if (name[4] == 'S') + unstifle_history (); +} + +/* What to do after the HISTIGNORE variable changes. */ +void +sv_histignore (name) + char *name; +{ + setup_history_ignore (name); +} + +/* What to do after the HISTCONTROL variable changes. */ +void +sv_history_control (name) + char *name; +{ + char *temp; + char *val; + int tptr; + + history_control = 0; + temp = get_string_value (name); + + if (temp == 0 || *temp == 0) + return; + + tptr = 0; + while (val = extract_colon_unit (temp, &tptr)) + { + if (STREQ (val, "ignorespace")) + history_control |= HC_IGNSPACE; + else if (STREQ (val, "ignoredups")) + history_control |= HC_IGNDUPS; + else if (STREQ (val, "ignoreboth")) + history_control |= HC_IGNBOTH; + else if (STREQ (val, "erasedups")) + history_control |= HC_ERASEDUPS; + + free (val); + } +} + +#if defined (BANG_HISTORY) +/* Setting/unsetting of the history expansion character. */ +void +sv_histchars (name) + char *name; +{ + char *temp; + + temp = get_string_value (name); + if (temp) + { + history_expansion_char = *temp; + if (temp[0] && temp[1]) + { + history_subst_char = temp[1]; + if (temp[2]) + history_comment_char = temp[2]; + } + } + else + { + history_expansion_char = '!'; + history_subst_char = '^'; + history_comment_char = '#'; + } +} +#endif /* BANG_HISTORY */ + +void +sv_histtimefmt (name) + char *name; +{ + SHELL_VAR *v; + + if (v = find_variable (name)) + { + if (history_comment_char == 0) + history_comment_char = '#'; + } + history_write_timestamps = (v != 0); +} +#endif /* HISTORY */ + +#if defined (HAVE_TZSET) +void +sv_tz (name) + char *name; +{ + if (chkexport (name)) + tzset (); +} +#endif + +/* If the variable exists, then the value of it can be the number + of times we actually ignore the EOF. The default is small, + (smaller than csh, anyway). */ +void +sv_ignoreeof (name) + char *name; +{ + SHELL_VAR *tmp_var; + char *temp; + + eof_encountered = 0; + + tmp_var = find_variable (name); + ignoreeof = tmp_var != 0; + temp = tmp_var ? value_cell (tmp_var) : (char *)NULL; + if (temp) + eof_encountered_limit = (*temp && all_digits (temp)) ? atoi (temp) : 10; + set_shellopts (); /* make sure `ignoreeof' is/is not in $SHELLOPTS */ +} + +void +sv_optind (name) + char *name; +{ + char *tt; + int s; + + tt = get_string_value ("OPTIND"); + if (tt && *tt) + { + s = atoi (tt); + + /* According to POSIX, setting OPTIND=1 resets the internal state + of getopt (). */ + if (s < 0 || s == 1) + s = 0; + } + else + s = 0; + getopts_reset (s); +} + +void +sv_opterr (name) + char *name; +{ + char *tt; + + tt = get_string_value ("OPTERR"); + sh_opterr = (tt && *tt) ? atoi (tt) : 1; +} + +void +sv_strict_posix (name) + char *name; +{ + SET_INT_VAR (name, posixly_correct); + posix_initialize (posixly_correct); +#if defined (READLINE) + if (interactive_shell) + posix_readline_initialize (posixly_correct); +#endif /* READLINE */ + set_shellopts (); /* make sure `posix' is/is not in $SHELLOPTS */ +} + +void +sv_locale (name) + char *name; +{ + char *v; + int r; + + v = get_string_value (name); + if (name[0] == 'L' && name[1] == 'A') /* LANG */ + r = set_lang (name, v); + else + r = set_locale_var (name, v); /* LC_*, TEXTDOMAIN* */ + +#if 1 + if (r == 0 && posixly_correct) + last_command_exit_value = 1; +#endif +} + +#if defined (ARRAY_VARS) +void +set_pipestatus_array (ps, nproc) + int *ps; + int nproc; +{ + SHELL_VAR *v; + ARRAY *a; + ARRAY_ELEMENT *ae; + register int i; + char *t, tbuf[INT_STRLEN_BOUND(int) + 1]; + + v = find_variable ("PIPESTATUS"); + if (v == 0) + v = make_new_array_variable ("PIPESTATUS"); + if (array_p (v) == 0) + return; /* Do nothing if not an array variable. */ + a = array_cell (v); + + if (a == 0 || array_num_elements (a) == 0) + { + for (i = 0; i < nproc; i++) /* was ps[i] != -1, not i < nproc */ + { + t = inttostr (ps[i], tbuf, sizeof (tbuf)); + array_insert (a, i, t); + } + return; + } + + /* Fast case */ + if (array_num_elements (a) == nproc && nproc == 1) + { + ae = element_forw (a->head); + free (element_value (ae)); + ae->value = itos (ps[0]); + } + else if (array_num_elements (a) <= nproc) + { + /* modify in array_num_elements members in place, then add */ + ae = a->head; + for (i = 0; i < array_num_elements (a); i++) + { + ae = element_forw (ae); + free (element_value (ae)); + ae->value = itos (ps[i]); + } + /* add any more */ + for ( ; i < nproc; i++) + { + t = inttostr (ps[i], tbuf, sizeof (tbuf)); + array_insert (a, i, t); + } + } + else + { + /* deleting elements. it's faster to rebuild the array. */ + array_flush (a); + for (i = 0; ps[i] != -1; i++) + { + t = inttostr (ps[i], tbuf, sizeof (tbuf)); + array_insert (a, i, t); + } + } +} + +ARRAY * +save_pipestatus_array () +{ + SHELL_VAR *v; + ARRAY *a, *a2; + + v = find_variable ("PIPESTATUS"); + if (v == 0 || array_p (v) == 0 || array_cell (v) == 0) + return ((ARRAY *)NULL); + + a = array_cell (v); + a2 = array_copy (array_cell (v)); + + return a2; +} + +void +restore_pipestatus_array (a) + ARRAY *a; +{ + SHELL_VAR *v; + ARRAY *a2; + + v = find_variable ("PIPESTATUS"); + /* XXX - should we still assign even if existing value is NULL? */ + if (v == 0 || array_p (v) == 0 || array_cell (v) == 0) + return; + + a2 = array_cell (v); + var_setarray (v, a); + + array_dispose (a2); +} +#endif + +void +set_pipestatus_from_exit (s) + int s; +{ +#if defined (ARRAY_VARS) + static int v[2] = { 0, -1 }; + + v[0] = s; + set_pipestatus_array (v, 1); +#endif +} + +void +sv_xtracefd (name) + char *name; +{ + SHELL_VAR *v; + char *t, *e; + int fd; + FILE *fp; + + v = find_variable (name); + if (v == 0) + { + xtrace_reset (); + return; + } + + t = value_cell (v); + if (t == 0 || *t == 0) + xtrace_reset (); + else + { + fd = (int)strtol (t, &e, 10); + if (e != t && *e == '\0' && sh_validfd (fd)) + { + fp = fdopen (fd, "w"); + if (fp == 0) + internal_error (_("%s: %s: cannot open as FILE"), name, value_cell (v)); + else + xtrace_set (fd, fp); + } + else + internal_error (_("%s: %s: invalid value for trace file descriptor"), name, value_cell (v)); + } +} + +#define MIN_COMPAT_LEVEL 31 + +void +sv_shcompat (name) + char *name; +{ + SHELL_VAR *v; + char *val; + int tens, ones, compatval; + + v = find_variable (name); + if (v == 0) + { + shell_compatibility_level = DEFAULT_COMPAT_LEVEL; + set_compatibility_opts (); + return; + } + val = value_cell (v); + if (val == 0 || *val == '\0') + { + shell_compatibility_level = DEFAULT_COMPAT_LEVEL; + set_compatibility_opts (); + return; + } + /* Handle decimal-like compatibility version specifications: 4.2 */ + if (isdigit (val[0]) && val[1] == '.' && isdigit (val[2]) && val[3] == 0) + { + tens = val[0] - '0'; + ones = val[2] - '0'; + compatval = tens*10 + ones; + } + /* Handle integer-like compatibility version specifications: 42 */ + else if (isdigit (val[0]) && isdigit (val[1]) && val[2] == 0) + { + tens = val[0] - '0'; + ones = val[1] - '0'; + compatval = tens*10 + ones; + } + else + { +compat_error: + internal_error (_("%s: %s: compatibility value out of range"), name, val); + shell_compatibility_level = DEFAULT_COMPAT_LEVEL; + set_compatibility_opts (); + return; + } + + if (compatval < MIN_COMPAT_LEVEL || compatval > DEFAULT_COMPAT_LEVEL) + goto compat_error; + + shell_compatibility_level = compatval; + set_compatibility_opts (); +} + +#if defined (JOB_CONTROL) +void +sv_childmax (name) + char *name; +{ + char *tt; + int s; + + tt = get_string_value (name); + s = (tt && *tt) ? atoi (tt) : 0; + set_maxchild (s); +} +#endif diff --git a/variables.h b/variables.h new file mode 100644 index 0000000..1a783b9 --- /dev/null +++ b/variables.h @@ -0,0 +1,413 @@ +/* variables.h -- data structures for shell variables. */ + +/* Copyright (C) 1987-2012 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_VARIABLES_H_) +#define _VARIABLES_H_ + +#include "stdc.h" +#include "array.h" +#include "assoc.h" + +/* Shell variables and functions are stored in hash tables. */ +#include "hashlib.h" + +#include "conftypes.h" + +/* A variable context. */ +typedef struct var_context { + char *name; /* empty or NULL means global context */ + int scope; /* 0 means global context */ + int flags; + struct var_context *up; /* previous function calls */ + struct var_context *down; /* down towards global context */ + HASH_TABLE *table; /* variables at this scope */ +} VAR_CONTEXT; + +/* Flags for var_context->flags */ +#define VC_HASLOCAL 0x01 +#define VC_HASTMPVAR 0x02 +#define VC_FUNCENV 0x04 /* also function if name != NULL */ +#define VC_BLTNENV 0x08 /* builtin_env */ +#define VC_TEMPENV 0x10 /* temporary_env */ + +#define VC_TEMPFLAGS (VC_FUNCENV|VC_BLTNENV|VC_TEMPENV) + +/* Accessing macros */ +#define vc_isfuncenv(vc) (((vc)->flags & VC_FUNCENV) != 0) +#define vc_isbltnenv(vc) (((vc)->flags & VC_BLTNENV) != 0) +#define vc_istempenv(vc) (((vc)->flags & (VC_TEMPFLAGS)) == VC_TEMPENV) + +#define vc_istempscope(vc) (((vc)->flags & (VC_TEMPENV|VC_BLTNENV)) != 0) + +#define vc_haslocals(vc) (((vc)->flags & VC_HASLOCAL) != 0) +#define vc_hastmpvars(vc) (((vc)->flags & VC_HASTMPVAR) != 0) + +/* What a shell variable looks like. */ + +typedef struct variable *sh_var_value_func_t __P((struct variable *)); +typedef struct variable *sh_var_assign_func_t __P((struct variable *, char *, arrayind_t, char *)); + +/* For the future */ +union _value { + char *s; /* string value */ + intmax_t i; /* int value */ + COMMAND *f; /* function */ + ARRAY *a; /* array */ + HASH_TABLE *h; /* associative array */ + double d; /* floating point number */ +#if defined (HAVE_LONG_DOUBLE) + long double ld; /* long double */ +#endif + struct variable *v; /* possible indirect variable use */ + void *opaque; /* opaque data for future use */ +}; + +typedef struct variable { + char *name; /* Symbol that the user types. */ + char *value; /* Value that is returned. */ + char *exportstr; /* String for the environment. */ + sh_var_value_func_t *dynamic_value; /* Function called to return a `dynamic' + value for a variable, like $SECONDS + or $RANDOM. */ + sh_var_assign_func_t *assign_func; /* Function called when this `special + variable' is assigned a value in + bind_variable. */ + int attributes; /* export, readonly, array, invisible... */ + int context; /* Which context this variable belongs to. */ +} SHELL_VAR; + +typedef struct _vlist { + SHELL_VAR **list; + int list_size; /* allocated size */ + int list_len; /* current number of entries */ +} VARLIST; + +/* The various attributes that a given variable can have. */ +/* First, the user-visible attributes */ +#define att_exported 0x0000001 /* export to environment */ +#define att_readonly 0x0000002 /* cannot change */ +#define att_array 0x0000004 /* value is an array */ +#define att_function 0x0000008 /* value is a function */ +#define att_integer 0x0000010 /* internal representation is int */ +#define att_local 0x0000020 /* variable is local to a function */ +#define att_assoc 0x0000040 /* variable is an associative array */ +#define att_trace 0x0000080 /* function is traced with DEBUG trap */ +#define att_uppercase 0x0000100 /* word converted to uppercase on assignment */ +#define att_lowercase 0x0000200 /* word converted to lowercase on assignment */ +#define att_capcase 0x0000400 /* word capitalized on assignment */ +#define att_nameref 0x0000800 /* word is a name reference */ + +#define user_attrs (att_exported|att_readonly|att_integer|att_local|att_trace|att_uppercase|att_lowercase|att_capcase|att_nameref) + +#define attmask_user 0x0000fff + +/* Internal attributes used for bookkeeping */ +#define att_invisible 0x0001000 /* cannot see */ +#define att_nounset 0x0002000 /* cannot unset */ +#define att_noassign 0x0004000 /* assignment not allowed */ +#define att_imported 0x0008000 /* came from environment */ +#define att_special 0x0010000 /* requires special handling */ +#define att_nofree 0x0020000 /* do not free value on unset */ + +#define attmask_int 0x00ff000 + +/* Internal attributes used for variable scoping. */ +#define att_tempvar 0x0100000 /* variable came from the temp environment */ +#define att_propagate 0x0200000 /* propagate to previous scope */ + +#define attmask_scope 0x0f00000 + +#define exported_p(var) ((((var)->attributes) & (att_exported))) +#define readonly_p(var) ((((var)->attributes) & (att_readonly))) +#define array_p(var) ((((var)->attributes) & (att_array))) +#define function_p(var) ((((var)->attributes) & (att_function))) +#define integer_p(var) ((((var)->attributes) & (att_integer))) +#define local_p(var) ((((var)->attributes) & (att_local))) +#define assoc_p(var) ((((var)->attributes) & (att_assoc))) +#define trace_p(var) ((((var)->attributes) & (att_trace))) +#define uppercase_p(var) ((((var)->attributes) & (att_uppercase))) +#define lowercase_p(var) ((((var)->attributes) & (att_lowercase))) +#define capcase_p(var) ((((var)->attributes) & (att_capcase))) +#define nameref_p(var) ((((var)->attributes) & (att_nameref))) + +#define invisible_p(var) ((((var)->attributes) & (att_invisible))) +#define non_unsettable_p(var) ((((var)->attributes) & (att_nounset))) +#define noassign_p(var) ((((var)->attributes) & (att_noassign))) +#define imported_p(var) ((((var)->attributes) & (att_imported))) +#define specialvar_p(var) ((((var)->attributes) & (att_special))) +#define nofree_p(var) ((((var)->attributes) & (att_nofree))) + +#define tempvar_p(var) ((((var)->attributes) & (att_tempvar))) + +/* Acessing variable values: rvalues */ +#define value_cell(var) ((var)->value) +#define function_cell(var) (COMMAND *)((var)->value) +#define array_cell(var) (ARRAY *)((var)->value) +#define assoc_cell(var) (HASH_TABLE *)((var)->value) +#define nameref_cell(var) ((var)->value) /* so it can change later */ + +#define NAMEREF_MAX 8 /* only 8 levels of nameref indirection */ + +#define var_isnull(var) ((var)->value == 0) +#define var_isset(var) ((var)->value != 0) + +/* Assigning variable values: lvalues */ +#define var_setvalue(var, str) ((var)->value = (str)) +#define var_setfunc(var, func) ((var)->value = (char *)(func)) +#define var_setarray(var, arr) ((var)->value = (char *)(arr)) +#define var_setassoc(var, arr) ((var)->value = (char *)(arr)) +#define var_setref(var, str) ((var)->value = (str)) + +/* Make VAR be auto-exported. */ +#define set_auto_export(var) \ + do { (var)->attributes |= att_exported; array_needs_making = 1; } while (0) + +#define SETVARATTR(var, attr, undo) \ + ((undo == 0) ? ((var)->attributes |= (attr)) \ + : ((var)->attributes &= ~(attr))) + +#define VSETATTR(var, attr) ((var)->attributes |= (attr)) +#define VUNSETATTR(var, attr) ((var)->attributes &= ~(attr)) + +#define VGETFLAGS(var) ((var)->attributes) + +#define VSETFLAGS(var, flags) ((var)->attributes = (flags)) +#define VCLRFLAGS(var) ((var)->attributes = 0) + +/* Macros to perform various operations on `exportstr' member of a SHELL_VAR. */ +#define CLEAR_EXPORTSTR(var) (var)->exportstr = (char *)NULL +#define COPY_EXPORTSTR(var) ((var)->exportstr) ? savestring ((var)->exportstr) : (char *)NULL +#define SET_EXPORTSTR(var, value) (var)->exportstr = (value) +#define SAVE_EXPORTSTR(var, value) (var)->exportstr = (value) ? savestring (value) : (char *)NULL + +#define FREE_EXPORTSTR(var) \ + do { if ((var)->exportstr) free ((var)->exportstr); } while (0) + +#define CACHE_IMPORTSTR(var, value) \ + (var)->exportstr = savestring (value) + +#define INVALIDATE_EXPORTSTR(var) \ + do { \ + if ((var)->exportstr) \ + { \ + free ((var)->exportstr); \ + (var)->exportstr = (char *)NULL; \ + } \ + } while (0) + +/* Stuff for hacking variables. */ +typedef int sh_var_map_func_t __P((SHELL_VAR *)); + +/* Where we keep the variables and functions */ +extern VAR_CONTEXT *global_variables; +extern VAR_CONTEXT *shell_variables; + +extern HASH_TABLE *shell_functions; +extern HASH_TABLE *temporary_env; + +extern int variable_context; +extern char *dollar_vars[]; +extern char **export_env; + +extern void initialize_shell_variables __P((char **, int)); +extern SHELL_VAR *set_if_not __P((char *, char *)); + +extern void sh_set_lines_and_columns __P((int, int)); +extern void set_pwd __P((void)); +extern void set_ppid __P((void)); +extern void make_funcname_visible __P((int)); + +extern SHELL_VAR *var_lookup __P((const char *, VAR_CONTEXT *)); + +extern SHELL_VAR *find_function __P((const char *)); +extern FUNCTION_DEF *find_function_def __P((const char *)); +extern SHELL_VAR *find_variable __P((const char *)); +extern SHELL_VAR *find_variable_noref __P((const char *)); +extern SHELL_VAR *find_variable_last_nameref __P((const char *)); +extern SHELL_VAR *find_global_variable_last_nameref __P((const char *)); +extern SHELL_VAR *find_variable_nameref __P((SHELL_VAR *)); +extern SHELL_VAR *find_variable_internal __P((const char *, int)); +extern SHELL_VAR *find_variable_tempenv __P((const char *)); +extern SHELL_VAR *find_variable_notempenv __P((const char *)); +extern SHELL_VAR *find_global_variable __P((const char *)); +extern SHELL_VAR *find_global_variable_noref __P((const char *)); +extern SHELL_VAR *find_shell_variable __P((const char *)); +extern SHELL_VAR *find_tempenv_variable __P((const char *)); +extern SHELL_VAR *copy_variable __P((SHELL_VAR *)); +extern SHELL_VAR *make_local_variable __P((const char *)); +extern SHELL_VAR *bind_variable __P((const char *, char *, int)); +extern SHELL_VAR *bind_global_variable __P((const char *, char *, int)); +extern SHELL_VAR *bind_function __P((const char *, COMMAND *)); + +extern void bind_function_def __P((const char *, FUNCTION_DEF *)); + +extern SHELL_VAR **map_over __P((sh_var_map_func_t *, VAR_CONTEXT *)); +SHELL_VAR **map_over_funcs __P((sh_var_map_func_t *)); + +extern SHELL_VAR **all_shell_variables __P((void)); +extern SHELL_VAR **all_shell_functions __P((void)); +extern SHELL_VAR **all_visible_variables __P((void)); +extern SHELL_VAR **all_visible_functions __P((void)); +extern SHELL_VAR **all_exported_variables __P((void)); +extern SHELL_VAR **local_exported_variables __P((void)); +extern SHELL_VAR **all_local_variables __P((void)); +#if defined (ARRAY_VARS) +extern SHELL_VAR **all_array_variables __P((void)); +#endif +extern char **all_variables_matching_prefix __P((const char *)); + +extern char **make_var_array __P((HASH_TABLE *)); +extern char **add_or_supercede_exported_var __P((char *, int)); + +extern char *get_variable_value __P((SHELL_VAR *)); +extern char *get_string_value __P((const char *)); +extern char *sh_get_env_value __P((const char *)); +extern char *make_variable_value __P((SHELL_VAR *, char *, int)); + +extern SHELL_VAR *bind_variable_value __P((SHELL_VAR *, char *, int)); +extern SHELL_VAR *bind_int_variable __P((char *, char *)); +extern SHELL_VAR *bind_var_to_int __P((char *, intmax_t)); + +extern int assign_in_env __P((WORD_DESC *, int)); + +extern int unbind_variable __P((const char *)); +extern int unbind_nameref __P((const char *)); +extern int unbind_func __P((const char *)); +extern int unbind_function_def __P((const char *)); +extern int delete_var __P((const char *, VAR_CONTEXT *)); +extern int makunbound __P((const char *, VAR_CONTEXT *)); +extern int kill_local_variable __P((const char *)); +extern void delete_all_variables __P((HASH_TABLE *)); +extern void delete_all_contexts __P((VAR_CONTEXT *)); + +extern VAR_CONTEXT *new_var_context __P((char *, int)); +extern void dispose_var_context __P((VAR_CONTEXT *)); +extern VAR_CONTEXT *push_var_context __P((char *, int, HASH_TABLE *)); +extern void pop_var_context __P((void)); +extern VAR_CONTEXT *push_scope __P((int, HASH_TABLE *)); +extern void pop_scope __P((int)); + +extern void push_context __P((char *, int, HASH_TABLE *)); +extern void pop_context __P((void)); +extern void push_dollar_vars __P((void)); +extern void pop_dollar_vars __P((void)); +extern void dispose_saved_dollar_vars __P((void)); + +extern void push_args __P((WORD_LIST *)); +extern void pop_args __P((void)); + +extern void adjust_shell_level __P((int)); +extern void non_unsettable __P((char *)); +extern void dispose_variable __P((SHELL_VAR *)); +extern void dispose_used_env_vars __P((void)); +extern void dispose_function_env __P((void)); +extern void dispose_builtin_env __P((void)); +extern void merge_temporary_env __P((void)); +extern void merge_builtin_env __P((void)); +extern void kill_all_local_variables __P((void)); + +extern void set_var_read_only __P((char *)); +extern void set_func_read_only __P((const char *)); +extern void set_var_auto_export __P((char *)); +extern void set_func_auto_export __P((const char *)); + +extern void sort_variables __P((SHELL_VAR **)); + +extern int chkexport __P((char *)); +extern void maybe_make_export_env __P((void)); +extern void update_export_env_inplace __P((char *, int, char *)); +extern void put_command_name_into_env __P((char *)); +extern void put_gnu_argv_flags_into_env __P((intmax_t, char *)); + +extern void print_var_list __P((SHELL_VAR **)); +extern void print_func_list __P((SHELL_VAR **)); +extern void print_assignment __P((SHELL_VAR *)); +extern void print_var_value __P((SHELL_VAR *, int)); +extern void print_var_function __P((SHELL_VAR *)); + +#if defined (ARRAY_VARS) +extern SHELL_VAR *make_new_array_variable __P((char *)); +extern SHELL_VAR *make_local_array_variable __P((char *, int)); + +extern SHELL_VAR *make_new_assoc_variable __P((char *)); +extern SHELL_VAR *make_local_assoc_variable __P((char *)); + +extern void set_pipestatus_array __P((int *, int)); +extern ARRAY *save_pipestatus_array __P((void)); +extern void restore_pipestatus_array __P((ARRAY *)); +#endif + +extern void set_pipestatus_from_exit __P((int)); + +/* The variable in NAME has just had its state changed. Check to see if it + is one of the special ones where something special happens. */ +extern void stupidly_hack_special_variables __P((char *)); + +/* Reinitialize some special variables that have external effects upon unset + when the shell reinitializes itself. */ +extern void reinit_special_variables __P((void)); + +extern int get_random_number __P((void)); + +/* The `special variable' functions that get called when a particular + variable is set. */ +extern void sv_ifs __P((char *)); +extern void sv_path __P((char *)); +extern void sv_mail __P((char *)); +extern void sv_funcnest __P((char *)); +extern void sv_globignore __P((char *)); +extern void sv_ignoreeof __P((char *)); +extern void sv_strict_posix __P((char *)); +extern void sv_optind __P((char *)); +extern void sv_opterr __P((char *)); +extern void sv_locale __P((char *)); +extern void sv_xtracefd __P((char *)); +extern void sv_shcompat __P((char *)); + +#if defined (READLINE) +extern void sv_comp_wordbreaks __P((char *)); +extern void sv_terminal __P((char *)); +extern void sv_hostfile __P((char *)); +extern void sv_winsize __P((char *)); +#endif + +#if defined (__CYGWIN__) +extern void sv_home __P((char *)); +#endif + +#if defined (HISTORY) +extern void sv_histsize __P((char *)); +extern void sv_histignore __P((char *)); +extern void sv_history_control __P((char *)); +# if defined (BANG_HISTORY) +extern void sv_histchars __P((char *)); +# endif +extern void sv_histtimefmt __P((char *)); +#endif /* HISTORY */ + +#if defined (HAVE_TZSET) +extern void sv_tz __P((char *)); +#endif + +#if defined (JOB_CONTROL) +extern void sv_childmax __P((char *)); +#endif + +#endif /* !_VARIABLES_H_ */ diff --git a/version.c b/version.c new file mode 100644 index 0000000..3fa4aeb --- /dev/null +++ b/version.c @@ -0,0 +1,94 @@ +/* version.c -- distribution and version numbers. */ + +/* Copyright (C) 1989-2013 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#include + +#include + +#include "stdc.h" + +#include "version.h" +#include "patchlevel.h" +#include "conftypes.h" + +#include "bashintl.h" + +extern char *shell_name; + +/* Defines from version.h */ +const char * const dist_version = DISTVERSION; +const int patch_level = PATCHLEVEL; +const int build_version = BUILDVERSION; +#ifdef RELSTATUS +const char * const release_status = RELSTATUS; +#else +const char * const release_status = (char *)0; +#endif +const char * const sccs_version = SCCSVERSION; + +const char * const bash_copyright = N_("Copyright (C) 2013 Free Software Foundation, Inc."); +const char * const bash_license = N_("License GPLv3+: GNU GPL version 3 or later \n"); + +/* If == 31, shell compatible with bash-3.1, == 32 with bash-3.2, and so on */ +int shell_compatibility_level = DEFAULT_COMPAT_LEVEL; + +/* Functions for getting, setting, and displaying the shell version. */ + +/* Forward declarations so we don't have to include externs.h */ +extern char *shell_version_string __P((void)); +extern void show_shell_version __P((int)); + +/* Give version information about this shell. */ +char * +shell_version_string () +{ + static char tt[32] = { '\0' }; + + if (tt[0] == '\0') + { + if (release_status) +#if defined (HAVE_SNPRINTF) + snprintf (tt, sizeof (tt), "%s.%d(%d)-%s", dist_version, patch_level, build_version, release_status); +#else + sprintf (tt, "%s.%d(%d)-%s", dist_version, patch_level, build_version, release_status); +#endif + else +#if defined (HAVE_SNPRINTF) + snprintf (tt, sizeof (tt), "%s.%d(%d)", dist_version, patch_level, build_version); +#else + sprintf (tt, "%s.%d(%d)", dist_version, patch_level, build_version); +#endif + } + return tt; +} + +void +show_shell_version (extended) + int extended; +{ + printf (_("GNU bash, version %s (%s)\n"), shell_version_string (), MACHTYPE); + if (extended) + { + printf ("%s\n", _(bash_copyright)); + printf ("%s\n", _(bash_license)); + printf ("%s\n", _("This is free software; you are free to change and redistribute it.")); + printf ("%s\n", _("There is NO WARRANTY, to the extent permitted by law.")); + } +} diff --git a/xmalloc.c b/xmalloc.c new file mode 100644 index 0000000..2344d2d --- /dev/null +++ b/xmalloc.c @@ -0,0 +1,223 @@ +/* xmalloc.c -- safe versions of malloc and realloc */ + +/* Copyright (C) 1991-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the GNU Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if defined (HAVE_CONFIG_H) +#include +#endif + +#include "bashtypes.h" +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (HAVE_STDLIB_H) +# include +#else +# include "ansi_stdlib.h" +#endif /* HAVE_STDLIB_H */ + +#include "error.h" + +#include "bashintl.h" + +#if !defined (PTR_T) +# if defined (__STDC__) +# define PTR_T void * +# else +# define PTR_T char * +# endif /* !__STDC__ */ +#endif /* !PTR_T */ + +#if defined (HAVE_SBRK) && !HAVE_DECL_SBRK +extern char *sbrk(); +#endif + +static PTR_T lbreak; +static int brkfound; +static size_t allocated; + +/* **************************************************************** */ +/* */ +/* Memory Allocation and Deallocation. */ +/* */ +/* **************************************************************** */ + +#if defined (HAVE_SBRK) +#define FINDBRK() \ +do { \ + if (brkfound == 0) \ + { \ + lbreak = (PTR_T)sbrk (0); \ + brkfound++; \ + } \ +} while (0) + +static size_t +findbrk () +{ + FINDBRK(); + return (char *)sbrk (0) - (char *)lbreak; +} +#else +#define FINDBRK() +#endif + +static void +allocerr (func, bytes) + const char *func; + size_t bytes; +{ +#if defined (HAVE_SBRK) + allocated = findbrk (); + fatal_error (_("%s: cannot allocate %lu bytes (%lu bytes allocated)"), func, (unsigned long)bytes, (unsigned long)allocated); +#else + fatal_error (_("%s: cannot allocate %lu bytes"), func, (unsigned long)bytes); +#endif /* !HAVE_SBRK */ +} + +/* Return a pointer to free()able block of memory large enough + to hold BYTES number of bytes. If the memory cannot be allocated, + print an error message and abort. */ +PTR_T +xmalloc (bytes) + size_t bytes; +{ + PTR_T temp; + +#if defined (DEBUG) + if (bytes == 0) + internal_warning("xmalloc: size argument is 0"); +#endif + + FINDBRK(); + temp = malloc (bytes); + + if (temp == 0) + allocerr ("xmalloc", bytes); + + return (temp); +} + +PTR_T +xrealloc (pointer, bytes) + PTR_T pointer; + size_t bytes; +{ + PTR_T temp; + +#if defined (DEBUG) + if (bytes == 0) + internal_warning("xrealloc: size argument is 0"); +#endif + + FINDBRK(); + temp = pointer ? realloc (pointer, bytes) : malloc (bytes); + + if (temp == 0) + allocerr ("xrealloc", bytes); + + return (temp); +} + +/* Use this as the function to call when adding unwind protects so we + don't need to know what free() returns. */ +void +xfree (string) + PTR_T string; +{ + if (string) + free (string); +} + +#ifdef USING_BASH_MALLOC +#include + +static void +sh_allocerr (func, bytes, file, line) + const char *func; + size_t bytes; + char *file; + int line; +{ +#if defined (HAVE_SBRK) + allocated = findbrk (); + fatal_error (_("%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)"), func, file, line, (unsigned long)bytes, (unsigned long)allocated); +#else + fatal_error (_("%s: %s:%d: cannot allocate %lu bytes"), func, file, line, (unsigned long)bytes); +#endif /* !HAVE_SBRK */ +} + +PTR_T +sh_xmalloc (bytes, file, line) + size_t bytes; + char *file; + int line; +{ + PTR_T temp; + +#if defined (DEBUG) + if (bytes == 0) + internal_warning("xmalloc: %s:%d: size argument is 0", file, line); +#endif + + FINDBRK(); + temp = sh_malloc (bytes, file, line); + + if (temp == 0) + sh_allocerr ("xmalloc", bytes, file, line); + + return (temp); +} + +PTR_T +sh_xrealloc (pointer, bytes, file, line) + PTR_T pointer; + size_t bytes; + char *file; + int line; +{ + PTR_T temp; + +#if defined (DEBUG) + if (bytes == 0) + internal_warning("xrealloc: %s:%d: size argument is 0", file, line); +#endif + + FINDBRK(); + temp = pointer ? sh_realloc (pointer, bytes, file, line) : sh_malloc (bytes, file, line); + + if (temp == 0) + sh_allocerr ("xrealloc", bytes, file, line); + + return (temp); +} + +void +sh_xfree (string, file, line) + PTR_T string; + char *file; + int line; +{ + if (string) + sh_free (string, file, line); +} +#endif diff --git a/xmalloc.h b/xmalloc.h new file mode 100644 index 0000000..bea71fd --- /dev/null +++ b/xmalloc.h @@ -0,0 +1,58 @@ +/* xmalloc.h -- defines for the `x' memory allocation functions */ + +/* Copyright (C) 2001-2009 Free Software Foundation, Inc. + + This file is part of GNU Bash, the Bourne Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see . +*/ + +#if !defined (_XMALLOC_H_) +#define _XMALLOC_H_ + +#include "stdc.h" +#include "bashansi.h" + +/* Generic pointer type. */ +#ifndef PTR_T + +#if defined (__STDC__) +# define PTR_T void * +#else +# define PTR_T char * +#endif + +#endif /* PTR_T */ + +/* Allocation functions in xmalloc.c */ +extern PTR_T xmalloc __P((size_t)); +extern PTR_T xrealloc __P((void *, size_t)); +extern void xfree __P((void *)); + +#if defined(USING_BASH_MALLOC) && !defined (DISABLE_MALLOC_WRAPPERS) +extern PTR_T sh_xmalloc __P((size_t, const char *, int)); +extern PTR_T sh_xrealloc __P((void *, size_t, const char *, int)); +extern void sh_xfree __P((void *, const char *, int)); + +#define xmalloc(x) sh_xmalloc((x), __FILE__, __LINE__) +#define xrealloc(x, n) sh_xrealloc((x), (n), __FILE__, __LINE__) +#define xfree(x) sh_xfree((x), __FILE__, __LINE__) + +#ifdef free +#undef free +#endif +#define free(x) sh_xfree((x), __FILE__, __LINE__) +#endif /* USING_BASH_MALLOC */ + +#endif /* _XMALLOC_H_ */ diff --git a/y.tab.c b/y.tab.c new file mode 100644 index 0000000..8f7f96e --- /dev/null +++ b/y.tab.c @@ -0,0 +1,8542 @@ +/* A Bison parser, made by GNU Bison 2.3. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.3" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + IF = 258, + THEN = 259, + ELSE = 260, + ELIF = 261, + FI = 262, + CASE = 263, + ESAC = 264, + FOR = 265, + SELECT = 266, + WHILE = 267, + UNTIL = 268, + DO = 269, + DONE = 270, + FUNCTION = 271, + COPROC = 272, + COND_START = 273, + COND_END = 274, + COND_ERROR = 275, + IN = 276, + BANG = 277, + TIME = 278, + TIMEOPT = 279, + TIMEIGN = 280, + WORD = 281, + ASSIGNMENT_WORD = 282, + REDIR_WORD = 283, + NUMBER = 284, + ARITH_CMD = 285, + ARITH_FOR_EXPRS = 286, + COND_CMD = 287, + AND_AND = 288, + OR_OR = 289, + GREATER_GREATER = 290, + LESS_LESS = 291, + LESS_AND = 292, + LESS_LESS_LESS = 293, + GREATER_AND = 294, + SEMI_SEMI = 295, + SEMI_AND = 296, + SEMI_SEMI_AND = 297, + LESS_LESS_MINUS = 298, + AND_GREATER = 299, + AND_GREATER_GREATER = 300, + LESS_GREATER = 301, + GREATER_BAR = 302, + BAR_AND = 303, + yacc_EOF = 304 + }; +#endif +/* Tokens. */ +#define IF 258 +#define THEN 259 +#define ELSE 260 +#define ELIF 261 +#define FI 262 +#define CASE 263 +#define ESAC 264 +#define FOR 265 +#define SELECT 266 +#define WHILE 267 +#define UNTIL 268 +#define DO 269 +#define DONE 270 +#define FUNCTION 271 +#define COPROC 272 +#define COND_START 273 +#define COND_END 274 +#define COND_ERROR 275 +#define IN 276 +#define BANG 277 +#define TIME 278 +#define TIMEOPT 279 +#define TIMEIGN 280 +#define WORD 281 +#define ASSIGNMENT_WORD 282 +#define REDIR_WORD 283 +#define NUMBER 284 +#define ARITH_CMD 285 +#define ARITH_FOR_EXPRS 286 +#define COND_CMD 287 +#define AND_AND 288 +#define OR_OR 289 +#define GREATER_GREATER 290 +#define LESS_LESS 291 +#define LESS_AND 292 +#define LESS_LESS_LESS 293 +#define GREATER_AND 294 +#define SEMI_SEMI 295 +#define SEMI_AND 296 +#define SEMI_SEMI_AND 297 +#define LESS_LESS_MINUS 298 +#define AND_GREATER 299 +#define AND_GREATER_GREATER 300 +#define LESS_GREATER 301 +#define GREATER_BAR 302 +#define BAR_AND 303 +#define yacc_EOF 304 + + + + +/* Copy the first part of user declarations. */ +#line 21 "/usr/homes/chet/src/bash/src/parse.y" + +#include "config.h" + +#include "bashtypes.h" +#include "bashansi.h" + +#include "filecntl.h" + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#if defined (HAVE_LOCALE_H) +# include +#endif + +#include +#include "chartypes.h" +#include + +#include "memalloc.h" + +#include "bashintl.h" + +#define NEED_STRFTIME_DECL /* used in externs.h */ + +#include "shell.h" +#include "typemax.h" /* SIZE_MAX if needed */ +#include "trap.h" +#include "flags.h" +#include "parser.h" +#include "mailcheck.h" +#include "test.h" +#include "builtins.h" +#include "builtins/common.h" +#include "builtins/builtext.h" + +#include "shmbutil.h" + +#if defined (READLINE) +# include "bashline.h" +# include +#endif /* READLINE */ + +#if defined (HISTORY) +# include "bashhist.h" +# include +#endif /* HISTORY */ + +#if defined (JOB_CONTROL) +# include "jobs.h" +#endif /* JOB_CONTROL */ + +#if defined (ALIAS) +# include "alias.h" +#else +typedef void *alias_t; +#endif /* ALIAS */ + +#if defined (PROMPT_STRING_DECODE) +# ifndef _MINIX +# include +# endif +# include +# if defined (TM_IN_SYS_TIME) +# include +# include +# endif /* TM_IN_SYS_TIME */ +# include "maxpath.h" +#endif /* PROMPT_STRING_DECODE */ + +#define RE_READ_TOKEN -99 +#define NO_EXPANSION -100 + +#ifdef DEBUG +# define YYDEBUG 1 +#else +# define YYDEBUG 0 +#endif + +#if defined (HANDLE_MULTIBYTE) +# define last_shell_getc_is_singlebyte \ + ((shell_input_line_index > 1) \ + ? shell_input_line_property[shell_input_line_index - 1] \ + : 1) +# define MBTEST(x) ((x) && last_shell_getc_is_singlebyte) +#else +# define last_shell_getc_is_singlebyte 1 +# define MBTEST(x) ((x)) +#endif + +#if defined (EXTENDED_GLOB) +extern int extended_glob; +#endif + +extern int eof_encountered; +extern int no_line_editing, running_under_emacs; +extern int current_command_number; +extern int sourcelevel, parse_and_execute_level; +extern int posixly_correct; +extern int last_command_exit_value; +extern pid_t last_command_subst_pid; +extern char *shell_name, *current_host_name; +extern char *dist_version; +extern int patch_level; +extern int dump_translatable_strings, dump_po_strings; +extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin; +#if defined (BUFFERED_INPUT) +extern int bash_input_fd_changed; +#endif + +extern int errno; +/* **************************************************************** */ +/* */ +/* "Forward" declarations */ +/* */ +/* **************************************************************** */ + +#ifdef DEBUG +static void debug_parser __P((int)); +#endif + +static int yy_getc __P((void)); +static int yy_ungetc __P((int)); + +#if defined (READLINE) +static int yy_readline_get __P((void)); +static int yy_readline_unget __P((int)); +#endif + +static int yy_string_get __P((void)); +static int yy_string_unget __P((int)); +static void rewind_input_string __P((void)); +static int yy_stream_get __P((void)); +static int yy_stream_unget __P((int)); + +static int shell_getc __P((int)); +static void shell_ungetc __P((int)); +static void discard_until __P((int)); + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) +static void push_string __P((char *, int, alias_t *)); +static void pop_string __P((void)); +static void free_string_list __P((void)); +#endif + +static char *read_a_line __P((int)); + +static int reserved_word_acceptable __P((int)); +static int yylex __P((void)); +static int alias_expand_token __P((char *)); +static int time_command_acceptable __P((void)); +static int special_case_tokens __P((char *)); +static int read_token __P((int)); +static char *parse_matched_pair __P((int, int, int, int *, int)); +static char *parse_comsub __P((int, int, int, int *, int)); +#if defined (ARRAY_VARS) +static char *parse_compound_assignment __P((int *)); +#endif +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) +static int parse_dparen __P((int)); +static int parse_arith_cmd __P((char **, int)); +#endif +#if defined (COND_COMMAND) +static void cond_error __P((void)); +static COND_COM *cond_expr __P((void)); +static COND_COM *cond_or __P((void)); +static COND_COM *cond_and __P((void)); +static COND_COM *cond_term __P((void)); +static int cond_skip_newlines __P((void)); +static COMMAND *parse_cond_command __P((void)); +#endif +#if defined (ARRAY_VARS) +static int token_is_assignment __P((char *, int)); +static int token_is_ident __P((char *, int)); +#endif +static int read_token_word __P((int)); +static void discard_parser_constructs __P((int)); + +static char *error_token_from_token __P((int)); +static char *error_token_from_text __P((void)); +static void print_offending_line __P((void)); +static void report_syntax_error __P((char *)); + +static void handle_eof_input_unit __P((void)); +static void prompt_again __P((void)); +#if 0 +static void reset_readline_prompt __P((void)); +#endif +static void print_prompt __P((void)); + +#if defined (HANDLE_MULTIBYTE) +static void set_line_mbstate __P((void)); +static char *shell_input_line_property = NULL; +#else +# define set_line_mbstate() +#endif + +extern int yyerror __P((const char *)); + +#ifdef DEBUG +extern int yydebug; +#endif + +/* Default prompt strings */ +char *primary_prompt = PPROMPT; +char *secondary_prompt = SPROMPT; + +/* PROMPT_STRING_POINTER points to one of these, never to an actual string. */ +char *ps1_prompt, *ps2_prompt; + +/* Handle on the current prompt string. Indirectly points through + ps1_ or ps2_prompt. */ +char **prompt_string_pointer = (char **)NULL; +char *current_prompt_string; + +/* Non-zero means we expand aliases in commands. */ +int expand_aliases = 0; + +/* If non-zero, the decoded prompt string undergoes parameter and + variable substitution, command substitution, arithmetic substitution, + string expansion, process substitution, and quote removal in + decode_prompt_string. */ +int promptvars = 1; + +/* If non-zero, $'...' and $"..." are expanded when they appear within + a ${...} expansion, even when the expansion appears within double + quotes. */ +int extended_quote = 1; + +/* The number of lines read from input while creating the current command. */ +int current_command_line_count; + +/* The number of lines in a command saved while we run parse_and_execute */ +int saved_command_line_count; + +/* The token that currently denotes the end of parse. */ +int shell_eof_token; + +/* The token currently being read. */ +int current_token; + +/* The current parser state. */ +int parser_state; + +/* Variables to manage the task of reading here documents, because we need to + defer the reading until after a complete command has been collected. */ +static REDIRECT *redir_stack[10]; +int need_here_doc; + +/* Where shell input comes from. History expansion is performed on each + line when the shell is interactive. */ +static char *shell_input_line = (char *)NULL; +static size_t shell_input_line_index; +static size_t shell_input_line_size; /* Amount allocated for shell_input_line. */ +static size_t shell_input_line_len; /* strlen (shell_input_line) */ + +/* Either zero or EOF. */ +static int shell_input_line_terminator; + +/* The line number in a script on which a function definition starts. */ +static int function_dstart; + +/* The line number in a script on which a function body starts. */ +static int function_bstart; + +/* The line number in a script at which an arithmetic for command starts. */ +static int arith_for_lineno; + +/* The decoded prompt string. Used if READLINE is not defined or if + editing is turned off. Analogous to current_readline_prompt. */ +static char *current_decoded_prompt; + +/* The last read token, or NULL. read_token () uses this for context + checking. */ +static int last_read_token; + +/* The token read prior to last_read_token. */ +static int token_before_that; + +/* The token read prior to token_before_that. */ +static int two_tokens_ago; + +static int global_extglob; + +/* The line number in a script where the word in a `case WORD', `select WORD' + or `for WORD' begins. This is a nested command maximum, since the array + index is decremented after a case, select, or for command is parsed. */ +#define MAX_CASE_NEST 128 +static int word_lineno[MAX_CASE_NEST]; +static int word_top = -1; + +/* If non-zero, it is the token that we want read_token to return + regardless of what text is (or isn't) present to be read. This + is reset by read_token. If token_to_read == WORD or + ASSIGNMENT_WORD, yylval.word should be set to word_desc_to_read. */ +static int token_to_read; +static WORD_DESC *word_desc_to_read; + +static REDIRECTEE source; +static REDIRECTEE redir; + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 324 "/usr/homes/chet/src/bash/src/parse.y" +{ + WORD_DESC *word; /* the word that we read. */ + int number; /* the number that we read. */ + WORD_LIST *word_list; + COMMAND *command; + REDIRECT *redirect; + ELEMENT element; + PATTERN_LIST *pattern; +} +/* Line 193 of yacc.c. */ +#line 507 "y.tab.c" + YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + + + +/* Copy the second part of user declarations. */ + + +/* Line 216 of yacc.c. */ +#line 520 "y.tab.c" + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss; + YYSTYPE yyvs; + }; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 116 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 659 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 61 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 38 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 167 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 342 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 304 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 51, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 49, 2, + 59, 60, 2, 2, 2, 56, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 50, + 55, 2, 54, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 57, 53, 58, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 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, 52 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 6, 8, 11, 13, 15, 18, 21, + 24, 28, 32, 36, 40, 43, 47, 51, 54, 58, + 62, 65, 69, 73, 76, 80, 84, 87, 91, 95, + 98, 102, 106, 109, 113, 117, 120, 124, 128, 131, + 135, 139, 142, 146, 150, 153, 157, 161, 164, 168, + 172, 175, 178, 180, 182, 184, 186, 189, 191, 194, + 196, 198, 201, 203, 205, 207, 209, 215, 221, 223, + 225, 227, 229, 231, 233, 235, 242, 249, 257, 265, + 276, 287, 297, 307, 315, 323, 329, 335, 342, 349, + 357, 365, 376, 387, 394, 402, 409, 415, 422, 427, + 429, 432, 436, 439, 443, 447, 452, 455, 461, 469, + 476, 480, 482, 486, 491, 498, 504, 506, 509, 514, + 519, 525, 531, 534, 538, 541, 545, 548, 552, 554, + 558, 561, 563, 566, 570, 574, 578, 583, 588, 593, + 598, 603, 605, 607, 609, 611, 613, 615, 616, 619, + 621, 624, 627, 632, 637, 641, 645, 647, 649, 652, + 655, 658, 661, 666, 671, 673, 675, 678 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int8 yyrhs[] = +{ + 62, 0, -1, 94, 91, -1, 51, -1, 1, 51, + -1, 52, -1, 26, -1, 63, 26, -1, 54, 26, + -1, 55, 26, -1, 29, 54, 26, -1, 29, 55, + 26, -1, 28, 54, 26, -1, 28, 55, 26, -1, + 35, 26, -1, 29, 35, 26, -1, 28, 35, 26, + -1, 47, 26, -1, 29, 47, 26, -1, 28, 47, + 26, -1, 46, 26, -1, 29, 46, 26, -1, 28, + 46, 26, -1, 36, 26, -1, 29, 36, 26, -1, + 28, 36, 26, -1, 43, 26, -1, 29, 43, 26, + -1, 28, 43, 26, -1, 38, 26, -1, 29, 38, + 26, -1, 28, 38, 26, -1, 37, 29, -1, 29, + 37, 29, -1, 28, 37, 29, -1, 39, 29, -1, + 29, 39, 29, -1, 28, 39, 29, -1, 37, 26, + -1, 29, 37, 26, -1, 28, 37, 26, -1, 39, + 26, -1, 29, 39, 26, -1, 28, 39, 26, -1, + 39, 56, -1, 29, 39, 56, -1, 28, 39, 56, + -1, 37, 56, -1, 29, 37, 56, -1, 28, 37, + 56, -1, 44, 26, -1, 45, 26, -1, 26, -1, + 27, -1, 64, -1, 64, -1, 66, 64, -1, 65, + -1, 67, 65, -1, 67, -1, 69, -1, 69, 66, + -1, 74, -1, 77, -1, 70, -1, 73, -1, 12, + 88, 14, 88, 15, -1, 13, 88, 14, 88, 15, + -1, 72, -1, 78, -1, 76, -1, 79, -1, 80, + -1, 81, -1, 71, -1, 10, 26, 93, 14, 88, + 15, -1, 10, 26, 93, 57, 88, 58, -1, 10, + 26, 50, 93, 14, 88, 15, -1, 10, 26, 50, + 93, 57, 88, 58, -1, 10, 26, 93, 21, 63, + 92, 93, 14, 88, 15, -1, 10, 26, 93, 21, + 63, 92, 93, 57, 88, 58, -1, 10, 26, 93, + 21, 92, 93, 14, 88, 15, -1, 10, 26, 93, + 21, 92, 93, 57, 88, 58, -1, 10, 31, 92, + 93, 14, 88, 15, -1, 10, 31, 92, 93, 57, + 88, 58, -1, 10, 31, 14, 88, 15, -1, 10, + 31, 57, 88, 58, -1, 11, 26, 93, 14, 87, + 15, -1, 11, 26, 93, 57, 87, 58, -1, 11, + 26, 50, 93, 14, 87, 15, -1, 11, 26, 50, + 93, 57, 87, 58, -1, 11, 26, 93, 21, 63, + 92, 93, 14, 87, 15, -1, 11, 26, 93, 21, + 63, 92, 93, 57, 87, 58, -1, 8, 26, 93, + 21, 93, 9, -1, 8, 26, 93, 21, 85, 93, + 9, -1, 8, 26, 93, 21, 83, 9, -1, 26, + 59, 60, 93, 75, -1, 16, 26, 59, 60, 93, + 75, -1, 16, 26, 93, 75, -1, 69, -1, 69, + 66, -1, 59, 88, 60, -1, 17, 69, -1, 17, + 69, 66, -1, 17, 26, 69, -1, 17, 26, 69, + 66, -1, 17, 67, -1, 3, 88, 4, 88, 7, + -1, 3, 88, 4, 88, 5, 88, 7, -1, 3, + 88, 4, 88, 82, 7, -1, 57, 88, 58, -1, + 30, -1, 18, 32, 19, -1, 6, 88, 4, 88, + -1, 6, 88, 4, 88, 5, 88, -1, 6, 88, + 4, 88, 82, -1, 84, -1, 85, 84, -1, 93, + 86, 60, 88, -1, 93, 86, 60, 93, -1, 93, + 59, 86, 60, 88, -1, 93, 59, 86, 60, 93, + -1, 84, 40, -1, 85, 84, 40, -1, 84, 41, + -1, 85, 84, 41, -1, 84, 42, -1, 85, 84, + 42, -1, 26, -1, 86, 53, 26, -1, 93, 89, + -1, 87, -1, 93, 90, -1, 90, 51, 93, -1, + 90, 49, 93, -1, 90, 50, 93, -1, 90, 33, + 93, 90, -1, 90, 34, 93, 90, -1, 90, 49, + 93, 90, -1, 90, 50, 93, 90, -1, 90, 51, + 93, 90, -1, 96, -1, 51, -1, 52, -1, 51, + -1, 50, -1, 52, -1, -1, 93, 51, -1, 95, + -1, 95, 49, -1, 95, 50, -1, 95, 33, 93, + 95, -1, 95, 34, 93, 95, -1, 95, 49, 95, + -1, 95, 50, 95, -1, 96, -1, 97, -1, 22, + 96, -1, 98, 96, -1, 98, 92, -1, 22, 92, + -1, 97, 53, 93, 97, -1, 97, 48, 93, 97, + -1, 68, -1, 23, -1, 23, 24, -1, 23, 24, + 25, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 377, 377, 388, 397, 412, 422, 424, 428, 434, + 440, 446, 452, 458, 464, 470, 476, 482, 488, 494, + 500, 506, 512, 518, 525, 532, 539, 546, 553, 560, + 566, 572, 578, 584, 590, 596, 602, 608, 614, 620, + 626, 632, 638, 644, 650, 656, 662, 668, 674, 680, + 686, 692, 700, 702, 704, 708, 712, 723, 725, 729, + 731, 733, 749, 751, 755, 757, 759, 761, 763, 765, + 767, 769, 771, 773, 775, 779, 784, 789, 794, 799, + 804, 809, 814, 821, 826, 831, 836, 843, 848, 853, + 858, 863, 868, 875, 880, 885, 892, 895, 898, 902, + 904, 935, 942, 947, 964, 969, 986, 993, 995, 997, + 1002, 1006, 1010, 1014, 1016, 1018, 1022, 1023, 1027, 1029, + 1031, 1033, 1037, 1039, 1041, 1043, 1045, 1047, 1051, 1053, + 1062, 1070, 1071, 1077, 1078, 1085, 1089, 1091, 1093, 1100, + 1102, 1104, 1108, 1109, 1112, 1114, 1116, 1120, 1121, 1130, + 1143, 1159, 1174, 1176, 1178, 1185, 1188, 1192, 1194, 1200, + 1206, 1223, 1243, 1245, 1268, 1272, 1274, 1276 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "IF", "THEN", "ELSE", "ELIF", "FI", + "CASE", "ESAC", "FOR", "SELECT", "WHILE", "UNTIL", "DO", "DONE", + "FUNCTION", "COPROC", "COND_START", "COND_END", "COND_ERROR", "IN", + "BANG", "TIME", "TIMEOPT", "TIMEIGN", "WORD", "ASSIGNMENT_WORD", + "REDIR_WORD", "NUMBER", "ARITH_CMD", "ARITH_FOR_EXPRS", "COND_CMD", + "AND_AND", "OR_OR", "GREATER_GREATER", "LESS_LESS", "LESS_AND", + "LESS_LESS_LESS", "GREATER_AND", "SEMI_SEMI", "SEMI_AND", + "SEMI_SEMI_AND", "LESS_LESS_MINUS", "AND_GREATER", "AND_GREATER_GREATER", + "LESS_GREATER", "GREATER_BAR", "BAR_AND", "'&'", "';'", "'\\n'", + "yacc_EOF", "'|'", "'>'", "'<'", "'-'", "'{'", "'}'", "'('", "')'", + "$accept", "inputunit", "word_list", "redirection", + "simple_command_element", "redirection_list", "simple_command", + "command", "shell_command", "for_command", "arith_for_command", + "select_command", "case_command", "function_def", "function_body", + "subshell", "coproc", "if_command", "group_command", "arith_command", + "cond_command", "elif_clause", "case_clause", "pattern_list", + "case_clause_sequence", "pattern", "list", "compound_list", "list0", + "list1", "simple_list_terminator", "list_terminator", "newline_list", + "simple_list", "simple_list1", "pipeline_command", "pipeline", + "timespec", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 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, 38, + 59, 10, 304, 124, 62, 60, 45, 123, 125, 40, + 41 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 61, 62, 62, 62, 62, 63, 63, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 65, 65, 65, 66, 66, 67, 67, 68, + 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, + 70, 70, 70, 71, 71, 71, 71, 72, 72, 72, + 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, + 75, 76, 77, 77, 77, 77, 77, 78, 78, 78, + 79, 80, 81, 82, 82, 82, 83, 83, 84, 84, + 84, 84, 85, 85, 85, 85, 85, 85, 86, 86, + 87, 88, 88, 89, 89, 89, 90, 90, 90, 90, + 90, 90, 91, 91, 92, 92, 92, 93, 93, 94, + 94, 94, 95, 95, 95, 95, 95, 96, 96, 96, + 96, 96, 97, 97, 97, 98, 98, 98 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 2, 1, 2, 1, 1, 2, 2, 2, + 3, 3, 3, 3, 2, 3, 3, 2, 3, 3, + 2, 3, 3, 2, 3, 3, 2, 3, 3, 2, + 3, 3, 2, 3, 3, 2, 3, 3, 2, 3, + 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, + 2, 2, 1, 1, 1, 1, 2, 1, 2, 1, + 1, 2, 1, 1, 1, 1, 5, 5, 1, 1, + 1, 1, 1, 1, 1, 6, 6, 7, 7, 10, + 10, 9, 9, 7, 7, 5, 5, 6, 6, 7, + 7, 10, 10, 6, 7, 6, 5, 6, 4, 1, + 2, 3, 2, 3, 3, 4, 2, 5, 7, 6, + 3, 1, 3, 4, 6, 5, 1, 2, 4, 4, + 5, 5, 2, 3, 2, 3, 2, 3, 1, 3, + 2, 1, 2, 3, 3, 3, 4, 4, 4, 4, + 4, 1, 1, 1, 1, 1, 1, 0, 2, 1, + 2, 2, 4, 4, 3, 3, 1, 1, 2, 2, + 2, 2, 4, 4, 1, 1, 2, 3 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 0, 0, 147, 0, 0, 0, 147, 147, 0, 0, + 0, 0, 165, 52, 53, 0, 0, 111, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, + 0, 0, 147, 147, 0, 54, 57, 59, 164, 60, + 64, 74, 68, 65, 62, 70, 63, 69, 71, 72, + 73, 0, 149, 156, 157, 0, 4, 131, 0, 0, + 147, 147, 0, 147, 0, 0, 147, 52, 106, 102, + 0, 145, 144, 146, 161, 158, 166, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 14, 23, + 38, 32, 47, 29, 41, 35, 44, 26, 50, 51, + 20, 17, 8, 9, 0, 0, 1, 52, 58, 55, + 61, 142, 143, 2, 147, 147, 150, 151, 147, 147, + 160, 159, 147, 148, 130, 132, 141, 0, 147, 0, + 147, 147, 147, 147, 0, 147, 147, 0, 0, 104, + 103, 112, 167, 147, 16, 25, 40, 34, 49, 31, + 43, 37, 46, 28, 22, 19, 12, 13, 15, 24, + 39, 33, 48, 30, 42, 36, 45, 27, 21, 18, + 10, 11, 110, 101, 56, 0, 0, 154, 155, 0, + 0, 0, 147, 147, 147, 147, 147, 147, 0, 147, + 0, 147, 0, 0, 0, 0, 147, 0, 147, 0, + 0, 147, 99, 98, 105, 0, 152, 153, 0, 0, + 163, 162, 147, 147, 107, 0, 0, 0, 134, 135, + 133, 0, 116, 147, 0, 147, 147, 0, 6, 0, + 147, 0, 85, 86, 147, 147, 147, 147, 0, 0, + 0, 0, 66, 67, 0, 100, 96, 0, 0, 109, + 136, 137, 138, 139, 140, 95, 122, 124, 126, 117, + 0, 93, 128, 0, 0, 0, 0, 75, 7, 147, + 0, 76, 0, 0, 0, 0, 87, 0, 147, 88, + 97, 108, 147, 147, 147, 147, 123, 125, 127, 94, + 0, 0, 147, 77, 78, 0, 147, 147, 83, 84, + 89, 90, 0, 113, 0, 0, 0, 147, 129, 118, + 119, 147, 147, 0, 0, 147, 147, 147, 115, 120, + 121, 0, 0, 81, 82, 0, 0, 114, 79, 80, + 91, 92 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 34, 239, 35, 36, 120, 37, 38, 39, 40, + 41, 42, 43, 44, 213, 45, 46, 47, 48, 49, + 50, 225, 231, 232, 233, 274, 57, 58, 134, 135, + 123, 74, 59, 51, 187, 136, 54, 55 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -208 +static const yytype_int16 yypact[] = +{ + 296, -35, -208, -2, 38, 10, -208, -208, 24, 546, + 31, 346, 51, 47, -208, 591, 604, -208, 56, 71, + -18, 112, 130, 115, 128, 136, 143, 154, -208, -208, + 157, 170, -208, -208, 111, -208, -208, 229, -208, 578, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -12, -3, -208, 48, 346, -208, -208, 208, 396, + -208, 73, 15, 163, 190, 201, 160, 107, 229, 578, + 204, -208, -208, -208, -208, -208, 195, 165, 202, 215, + 152, 216, 153, 222, 227, 236, 237, 244, 245, 253, + 158, 254, 171, 255, 256, 259, 261, 262, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, 231, 230, -208, -208, -208, -208, + 578, -208, -208, -208, -208, -208, 446, 446, -208, -208, + -208, -208, -208, -208, -208, 210, -208, 4, -208, 65, + -208, -208, -208, -208, 70, -208, -208, 232, 41, 578, + 578, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, -208, -208, 396, 396, 23, 23, 496, + 496, 97, -208, -208, -208, -208, -208, -208, 85, -208, + 185, -208, 276, 235, 100, 110, -208, 268, -208, 280, + 283, -208, 578, -208, 578, 41, -208, -208, 446, 446, + 48, 48, -208, -208, -208, 295, 396, 396, 396, 396, + 396, 294, 161, -208, 19, -208, -208, 290, -208, 200, + -208, 252, -208, -208, -208, -208, -208, -208, 302, 396, + 200, 269, -208, -208, 41, 578, -208, 313, 324, -208, + -208, -208, 55, 55, 55, -208, -208, -208, -208, 192, + 34, -208, -208, 303, -19, 315, 278, -208, -208, -208, + 114, -208, 322, 286, 323, 287, -208, 210, -208, -208, + -208, -208, -208, -208, -208, -208, -208, -208, -208, -208, + 8, 320, -208, -208, -208, 117, -208, -208, -208, -208, + -208, -208, 119, 167, 396, 396, 396, -208, -208, -208, + 396, -208, -208, 337, 307, -208, -208, -208, -208, -208, + 396, 345, 308, -208, -208, 352, 312, -208, -208, -208, + -208, -208 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -208, -208, 164, -37, -31, -62, 368, -208, -5, -208, + -208, -208, -208, -208, -206, -208, -208, -208, -208, -208, + -208, 66, -208, 145, -208, 88, -173, -6, -208, -207, + -208, -45, -48, -208, 5, 3, 17, -208 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -1 +static const yytype_uint16 yytable[] = +{ + 64, 65, 119, 53, 69, 52, 118, 150, 100, 256, + 130, 101, 137, 139, 75, 144, 56, 142, 148, 260, + 261, 262, 263, 264, 60, 197, 114, 115, 271, 140, + 124, 125, 119, 248, 301, 251, 63, 118, 102, 121, + 122, 302, 287, 299, 2, 272, 126, 127, 290, 3, + 66, 4, 5, 6, 7, 133, 124, 125, 131, 10, + 272, 301, 149, 70, 61, 71, 72, 73, 317, 62, + 133, 17, 141, 284, 285, 76, 185, 186, 273, 199, + 189, 190, 98, 184, 206, 133, 200, 214, 192, 193, + 198, 207, 133, 273, 204, 205, 128, 99, 32, 235, + 33, 129, 222, 223, 224, 215, 77, 262, 263, 264, + 2, 116, 119, 184, 244, 3, 133, 4, 5, 6, + 7, 133, 201, 138, 246, 10, 191, 208, 306, 53, + 53, 321, 188, 325, 202, 203, 133, 17, 103, 209, + 210, 107, 236, 212, 226, 227, 228, 229, 230, 234, + 255, 133, 335, 336, 108, 240, 104, 245, 249, 105, + 249, 133, 109, 254, 32, 133, 33, 247, 133, 110, + 133, 307, 327, 223, 322, 119, 326, 184, 156, 160, + 111, 157, 161, 112, 170, 270, 106, 171, 53, 53, + 216, 217, 280, 237, 279, 241, 113, 174, 249, 249, + 175, 266, 267, 268, 145, 288, 220, 221, 158, 162, + 212, 238, 132, 143, 172, 146, 257, 258, 184, 147, + 152, 53, 53, 151, 188, 153, 278, 176, 154, 275, + 276, 305, 296, 297, 298, 71, 72, 73, 282, 283, + 312, 155, 159, 192, 193, 314, 315, 316, 163, 212, + 71, 72, 73, 164, 320, 117, 14, 15, 16, 194, + 195, 196, 165, 166, 18, 19, 20, 21, 22, 330, + 167, 168, 23, 24, 25, 26, 27, 249, 249, 169, + 173, 177, 178, 30, 31, 179, 313, 180, 181, 182, + 183, 242, 211, 243, 238, 252, 319, 1, 253, 2, + 323, 324, 259, 265, 3, 277, 4, 5, 6, 7, + 281, 329, 8, 9, 10, 331, 332, 286, 11, 12, + 291, 337, 13, 14, 15, 16, 17, 289, 292, 272, + 303, 18, 19, 20, 21, 22, 304, 308, 310, 23, + 24, 25, 26, 27, 309, 311, 318, 28, 29, 2, + 30, 31, 333, 32, 3, 33, 4, 5, 6, 7, + 338, 300, 8, 9, 10, 334, 339, 340, 11, 12, + 341, 250, 13, 14, 15, 16, 17, 68, 269, 328, + 0, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 27, 0, 0, 71, 72, 73, 2, + 30, 31, 0, 32, 3, 33, 4, 5, 6, 7, + 0, 0, 8, 9, 10, 0, 0, 0, 11, 12, + 0, 0, 13, 14, 15, 16, 17, 0, 0, 0, + 0, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 27, 0, 0, 0, 133, 0, 2, + 30, 31, 0, 32, 3, 33, 4, 5, 6, 7, + 0, 0, 8, 9, 10, 0, 0, 0, 11, 12, + 0, 0, 13, 14, 15, 16, 17, 0, 0, 0, + 0, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 27, 0, 0, 0, 0, 0, 2, + 30, 31, 0, 32, 3, 33, 4, 5, 6, 7, + 0, 0, 8, 9, 10, 0, 0, 0, 0, 0, + 0, 0, 13, 14, 15, 16, 17, 0, 0, 0, + 0, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 27, 0, 0, 0, 133, 0, 2, + 30, 31, 0, 32, 3, 33, 4, 5, 6, 7, + 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, + 0, 0, 67, 14, 15, 16, 17, 0, 0, 0, + 0, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 27, 0, 0, 0, 0, 0, 0, + 30, 31, 0, 32, 0, 33, 15, 16, 0, 0, + 0, 0, 0, 18, 19, 20, 21, 22, 0, 0, + 0, 23, 24, 25, 26, 27, 78, 79, 80, 81, + 82, 0, 30, 31, 83, 0, 0, 84, 85, 88, + 89, 90, 91, 92, 0, 86, 87, 93, 0, 0, + 94, 95, 0, 0, 0, 0, 0, 0, 96, 97 +}; + +static const yytype_int16 yycheck[] = +{ + 6, 7, 39, 0, 9, 0, 37, 69, 26, 215, + 55, 29, 60, 61, 11, 63, 51, 62, 66, 226, + 227, 228, 229, 230, 26, 21, 32, 33, 9, 14, + 33, 34, 69, 206, 53, 208, 26, 68, 56, 51, + 52, 60, 249, 9, 3, 26, 49, 50, 254, 8, + 26, 10, 11, 12, 13, 51, 33, 34, 55, 18, + 26, 53, 67, 32, 26, 50, 51, 52, 60, 31, + 51, 30, 57, 246, 247, 24, 124, 125, 59, 14, + 128, 129, 26, 120, 14, 51, 21, 149, 33, 34, + 138, 21, 51, 59, 142, 143, 48, 26, 57, 14, + 59, 53, 5, 6, 7, 153, 59, 314, 315, 316, + 3, 0, 149, 150, 14, 8, 51, 10, 11, 12, + 13, 51, 57, 50, 14, 18, 132, 57, 14, 126, + 127, 14, 127, 14, 140, 141, 51, 30, 26, 145, + 146, 26, 57, 148, 192, 193, 194, 195, 196, 197, + 212, 51, 325, 326, 26, 200, 26, 57, 206, 29, + 208, 51, 26, 211, 57, 51, 59, 57, 51, 26, + 51, 57, 5, 6, 57, 212, 57, 214, 26, 26, + 26, 29, 29, 26, 26, 233, 56, 29, 185, 186, + 185, 186, 240, 199, 239, 201, 26, 26, 246, 247, + 29, 40, 41, 42, 14, 250, 189, 190, 56, 56, + 215, 26, 4, 50, 56, 14, 222, 223, 255, 59, + 25, 218, 219, 19, 219, 60, 26, 56, 26, 235, + 236, 279, 40, 41, 42, 50, 51, 52, 244, 245, + 288, 26, 26, 33, 34, 293, 294, 295, 26, 254, + 50, 51, 52, 26, 302, 26, 27, 28, 29, 49, + 50, 51, 26, 26, 35, 36, 37, 38, 39, 317, + 26, 26, 43, 44, 45, 46, 47, 325, 326, 26, + 26, 26, 26, 54, 55, 26, 292, 26, 26, 58, + 60, 15, 60, 58, 26, 15, 302, 1, 15, 3, + 306, 307, 7, 9, 8, 15, 10, 11, 12, 13, + 58, 317, 16, 17, 18, 321, 322, 15, 22, 23, + 7, 327, 26, 27, 28, 29, 30, 58, 4, 26, + 15, 35, 36, 37, 38, 39, 58, 15, 15, 43, + 44, 45, 46, 47, 58, 58, 26, 51, 52, 3, + 54, 55, 15, 57, 8, 59, 10, 11, 12, 13, + 15, 273, 16, 17, 18, 58, 58, 15, 22, 23, + 58, 207, 26, 27, 28, 29, 30, 9, 233, 313, + -1, 35, 36, 37, 38, 39, -1, -1, -1, 43, + 44, 45, 46, 47, -1, -1, 50, 51, 52, 3, + 54, 55, -1, 57, 8, 59, 10, 11, 12, 13, + -1, -1, 16, 17, 18, -1, -1, -1, 22, 23, + -1, -1, 26, 27, 28, 29, 30, -1, -1, -1, + -1, 35, 36, 37, 38, 39, -1, -1, -1, 43, + 44, 45, 46, 47, -1, -1, -1, 51, -1, 3, + 54, 55, -1, 57, 8, 59, 10, 11, 12, 13, + -1, -1, 16, 17, 18, -1, -1, -1, 22, 23, + -1, -1, 26, 27, 28, 29, 30, -1, -1, -1, + -1, 35, 36, 37, 38, 39, -1, -1, -1, 43, + 44, 45, 46, 47, -1, -1, -1, -1, -1, 3, + 54, 55, -1, 57, 8, 59, 10, 11, 12, 13, + -1, -1, 16, 17, 18, -1, -1, -1, -1, -1, + -1, -1, 26, 27, 28, 29, 30, -1, -1, -1, + -1, 35, 36, 37, 38, 39, -1, -1, -1, 43, + 44, 45, 46, 47, -1, -1, -1, 51, -1, 3, + 54, 55, -1, 57, 8, 59, 10, 11, 12, 13, + -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, + -1, -1, 26, 27, 28, 29, 30, -1, -1, -1, + -1, 35, 36, 37, 38, 39, -1, -1, -1, 43, + 44, 45, 46, 47, -1, -1, -1, -1, -1, -1, + 54, 55, -1, 57, -1, 59, 28, 29, -1, -1, + -1, -1, -1, 35, 36, 37, 38, 39, -1, -1, + -1, 43, 44, 45, 46, 47, 35, 36, 37, 38, + 39, -1, 54, 55, 43, -1, -1, 46, 47, 35, + 36, 37, 38, 39, -1, 54, 55, 43, -1, -1, + 46, 47, -1, -1, -1, -1, -1, -1, 54, 55 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 1, 3, 8, 10, 11, 12, 13, 16, 17, + 18, 22, 23, 26, 27, 28, 29, 30, 35, 36, + 37, 38, 39, 43, 44, 45, 46, 47, 51, 52, + 54, 55, 57, 59, 62, 64, 65, 67, 68, 69, + 70, 71, 72, 73, 74, 76, 77, 78, 79, 80, + 81, 94, 95, 96, 97, 98, 51, 87, 88, 93, + 26, 26, 31, 26, 88, 88, 26, 26, 67, 69, + 32, 50, 51, 52, 92, 96, 24, 59, 35, 36, + 37, 38, 39, 43, 46, 47, 54, 55, 35, 36, + 37, 38, 39, 43, 46, 47, 54, 55, 26, 26, + 26, 29, 56, 26, 26, 29, 56, 26, 26, 26, + 26, 26, 26, 26, 88, 88, 0, 26, 65, 64, + 66, 51, 52, 91, 33, 34, 49, 50, 48, 53, + 92, 96, 4, 51, 89, 90, 96, 93, 50, 93, + 14, 57, 92, 50, 93, 14, 14, 59, 93, 69, + 66, 19, 25, 60, 26, 26, 26, 29, 56, 26, + 26, 29, 56, 26, 26, 26, 26, 26, 26, 26, + 26, 29, 56, 26, 26, 29, 56, 26, 26, 26, + 26, 26, 58, 60, 64, 93, 93, 95, 95, 93, + 93, 88, 33, 34, 49, 50, 51, 21, 93, 14, + 21, 57, 88, 88, 93, 93, 14, 21, 57, 88, + 88, 60, 69, 75, 66, 93, 95, 95, 49, 50, + 97, 97, 5, 6, 7, 82, 93, 93, 93, 93, + 93, 83, 84, 85, 93, 14, 57, 88, 26, 63, + 92, 88, 15, 58, 14, 57, 14, 57, 87, 93, + 63, 87, 15, 15, 93, 66, 75, 88, 88, 7, + 90, 90, 90, 90, 90, 9, 40, 41, 42, 84, + 93, 9, 26, 59, 86, 88, 88, 15, 26, 92, + 93, 58, 88, 88, 87, 87, 15, 90, 92, 58, + 75, 7, 4, 49, 50, 51, 40, 41, 42, 9, + 86, 53, 60, 15, 58, 93, 14, 57, 15, 58, + 15, 58, 93, 88, 93, 93, 93, 60, 26, 88, + 93, 14, 57, 88, 88, 14, 57, 5, 82, 88, + 93, 88, 88, 15, 58, 87, 87, 88, 15, 58, + 15, 58 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +#else +static void +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; +#endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + fprintf (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) +{ + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } +} +#endif /* YYERROR_VERBOSE */ + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + YYUSE (yyvaluep); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} + + +/* Prevent warnings from -Wmissing-prototypes. */ + +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + + +/* The look-ahead symbol. */ +int yychar; + +/* The semantic value of the look-ahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void) +#else +int +yyparse () + +#endif +#endif +{ + + int yystate; + int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to look-ahead token. */ + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a look-ahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + if (yyn == YYFINAL) + YYACCEPT; + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + yystate = yyn; + *++yyvsp = yylval; + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: +#line 378 "/usr/homes/chet/src/bash/src/parse.y" + { + /* Case of regular command. Discard the error + safety net,and return the command just parsed. */ + global_command = (yyvsp[(1) - (2)].command); + eof_encountered = 0; + /* discard_parser_constructs (0); */ + if (parser_state & PST_CMDSUBST) + parser_state |= PST_EOFTOKEN; + YYACCEPT; + } + break; + + case 3: +#line 389 "/usr/homes/chet/src/bash/src/parse.y" + { + /* Case of regular command, but not a very + interesting one. Return a NULL command. */ + global_command = (COMMAND *)NULL; + if (parser_state & PST_CMDSUBST) + parser_state |= PST_EOFTOKEN; + YYACCEPT; + } + break; + + case 4: +#line 398 "/usr/homes/chet/src/bash/src/parse.y" + { + /* Error during parsing. Return NULL command. */ + global_command = (COMMAND *)NULL; + eof_encountered = 0; + /* discard_parser_constructs (1); */ + if (interactive && parse_and_execute_level == 0) + { + YYACCEPT; + } + else + { + YYABORT; + } + } + break; + + case 5: +#line 413 "/usr/homes/chet/src/bash/src/parse.y" + { + /* Case of EOF seen by itself. Do ignoreeof or + not. */ + global_command = (COMMAND *)NULL; + handle_eof_input_unit (); + YYACCEPT; + } + break; + + case 6: +#line 423 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); } + break; + + case 7: +#line 425 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(2) - (2)].word), (yyvsp[(1) - (2)].word_list)); } + break; + + case 8: +#line 429 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_output_direction, redir, 0); + } + break; + + case 9: +#line 435 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_input_direction, redir, 0); + } + break; + + case 10: +#line 441 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_output_direction, redir, 0); + } + break; + + case 11: +#line 447 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_input_direction, redir, 0); + } + break; + + case 12: +#line 453 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_output_direction, redir, REDIR_VARASSIGN); + } + break; + + case 13: +#line 459 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_input_direction, redir, REDIR_VARASSIGN); + } + break; + + case 14: +#line 465 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_appending_to, redir, 0); + } + break; + + case 15: +#line 471 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_appending_to, redir, 0); + } + break; + + case 16: +#line 477 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_appending_to, redir, REDIR_VARASSIGN); + } + break; + + case 17: +#line 483 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_output_force, redir, 0); + } + break; + + case 18: +#line 489 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_output_force, redir, 0); + } + break; + + case 19: +#line 495 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_output_force, redir, REDIR_VARASSIGN); + } + break; + + case 20: +#line 501 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_input_output, redir, 0); + } + break; + + case 21: +#line 507 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_input_output, redir, 0); + } + break; + + case 22: +#line 513 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_input_output, redir, REDIR_VARASSIGN); + } + break; + + case 23: +#line 519 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_reading_until, redir, 0); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 24: +#line 526 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_reading_until, redir, 0); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 25: +#line 533 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 26: +#line 540 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, 0); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 27: +#line 547 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, 0); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 28: +#line 554 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN); + redir_stack[need_here_doc++] = (yyval.redirect); + } + break; + + case 29: +#line 561 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_reading_string, redir, 0); + } + break; + + case 30: +#line 567 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_reading_string, redir, 0); + } + break; + + case 31: +#line 573 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_reading_string, redir, REDIR_VARASSIGN); + } + break; + + case 32: +#line 579 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.dest = (yyvsp[(2) - (2)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_input, redir, 0); + } + break; + + case 33: +#line 585 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = (yyvsp[(3) - (3)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_input, redir, 0); + } + break; + + case 34: +#line 591 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = (yyvsp[(3) - (3)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_input, redir, REDIR_VARASSIGN); + } + break; + + case 35: +#line 597 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.dest = (yyvsp[(2) - (2)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_output, redir, 0); + } + break; + + case 36: +#line 603 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = (yyvsp[(3) - (3)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_output, redir, 0); + } + break; + + case 37: +#line 609 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = (yyvsp[(3) - (3)].number); + (yyval.redirect) = make_redirection (source, r_duplicating_output, redir, REDIR_VARASSIGN); + } + break; + + case 38: +#line 615 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_input_word, redir, 0); + } + break; + + case 39: +#line 621 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_input_word, redir, 0); + } + break; + + case 40: +#line 627 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_input_word, redir, REDIR_VARASSIGN); + } + break; + + case 41: +#line 633 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_output_word, redir, 0); + } + break; + + case 42: +#line 639 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_output_word, redir, 0); + } + break; + + case 43: +#line 645 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_duplicating_output_word, redir, REDIR_VARASSIGN); + } + break; + + case 44: +#line 651 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, 0); + } + break; + + case 45: +#line 657 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, 0); + } + break; + + case 46: +#line 663 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, REDIR_VARASSIGN); + } + break; + + case 47: +#line 669 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 0; + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, 0); + } + break; + + case 48: +#line 675 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, 0); + } + break; + + case 49: +#line 681 "/usr/homes/chet/src/bash/src/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = 0; + (yyval.redirect) = make_redirection (source, r_close_this, redir, REDIR_VARASSIGN); + } + break; + + case 50: +#line 687 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_err_and_out, redir, 0); + } + break; + + case 51: +#line 693 "/usr/homes/chet/src/bash/src/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_append_err_and_out, redir, 0); + } + break; + + case 52: +#line 701 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; } + break; + + case 53: +#line 703 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; } + break; + + case 54: +#line 705 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.element).redirect = (yyvsp[(1) - (1)].redirect); (yyval.element).word = 0; } + break; + + case 55: +#line 709 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.redirect) = (yyvsp[(1) - (1)].redirect); + } + break; + + case 56: +#line 713 "/usr/homes/chet/src/bash/src/parse.y" + { + register REDIRECT *t; + + for (t = (yyvsp[(1) - (2)].redirect); t->next; t = t->next) + ; + t->next = (yyvsp[(2) - (2)].redirect); + (yyval.redirect) = (yyvsp[(1) - (2)].redirect); + } + break; + + case 57: +#line 724 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_simple_command ((yyvsp[(1) - (1)].element), (COMMAND *)NULL); } + break; + + case 58: +#line 726 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_simple_command ((yyvsp[(2) - (2)].element), (yyvsp[(1) - (2)].command)); } + break; + + case 59: +#line 730 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = clean_simple_command ((yyvsp[(1) - (1)].command)); } + break; + + case 60: +#line 732 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 61: +#line 734 "/usr/homes/chet/src/bash/src/parse.y" + { + COMMAND *tc; + + tc = (yyvsp[(1) - (2)].command); + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = (yyvsp[(2) - (2)].redirect); + } + else + tc->redirects = (yyvsp[(2) - (2)].redirect); + (yyval.command) = (yyvsp[(1) - (2)].command); + } + break; + + case 62: +#line 750 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 63: +#line 752 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 64: +#line 756 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 65: +#line 758 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 66: +#line 760 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_while_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); } + break; + + case 67: +#line 762 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_until_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); } + break; + + case 68: +#line 764 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 69: +#line 766 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 70: +#line 768 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 71: +#line 770 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 72: +#line 772 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 73: +#line 774 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 74: +#line 776 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 75: +#line 780 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 76: +#line 785 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 77: +#line 790 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 78: +#line 795 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 79: +#line 800 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 80: +#line 805 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 81: +#line 810 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 82: +#line 815 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 83: +#line 822 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno); + if (word_top > 0) word_top--; + } + break; + + case 84: +#line 827 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno); + if (word_top > 0) word_top--; + } + break; + + case 85: +#line 832 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno); + if (word_top > 0) word_top--; + } + break; + + case 86: +#line 837 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno); + if (word_top > 0) word_top--; + } + break; + + case 87: +#line 844 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 88: +#line 849 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 89: +#line 854 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 90: +#line 859 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 91: +#line 864 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 92: +#line 869 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 93: +#line 876 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (PATTERN_LIST *)NULL, word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 94: +#line 881 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_case_command ((yyvsp[(2) - (7)].word), (yyvsp[(5) - (7)].pattern), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 95: +#line 886 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (yyvsp[(5) - (6)].pattern), word_lineno[word_top]); + if (word_top > 0) word_top--; + } + break; + + case 96: +#line 893 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_function_def ((yyvsp[(1) - (5)].word), (yyvsp[(5) - (5)].command), function_dstart, function_bstart); } + break; + + case 97: +#line 896 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_function_def ((yyvsp[(2) - (6)].word), (yyvsp[(6) - (6)].command), function_dstart, function_bstart); } + break; + + case 98: +#line 899 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_function_def ((yyvsp[(2) - (4)].word), (yyvsp[(4) - (4)].command), function_dstart, function_bstart); } + break; + + case 99: +#line 903 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 100: +#line 905 "/usr/homes/chet/src/bash/src/parse.y" + { + COMMAND *tc; + + tc = (yyvsp[(1) - (2)].command); + /* According to Posix.2 3.9.5, redirections + specified after the body of a function should + be attached to the function and performed when + the function is executed, not as part of the + function definition command. */ + /* XXX - I don't think it matters, but we might + want to change this in the future to avoid + problems differentiating between a function + definition with a redirection and a function + definition containing a single command with a + redirection. The two are semantically equivalent, + though -- the only difference is in how the + command printing code displays the redirections. */ + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = (yyvsp[(2) - (2)].redirect); + } + else + tc->redirects = (yyvsp[(2) - (2)].redirect); + (yyval.command) = (yyvsp[(1) - (2)].command); + } + break; + + case 101: +#line 936 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_subshell_command ((yyvsp[(2) - (3)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL; + } + break; + + case 102: +#line 943 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_coproc_command ("COPROC", (yyvsp[(2) - (2)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + break; + + case 103: +#line 948 "/usr/homes/chet/src/bash/src/parse.y" + { + COMMAND *tc; + + tc = (yyvsp[(2) - (3)].command); + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = (yyvsp[(3) - (3)].redirect); + } + else + tc->redirects = (yyvsp[(3) - (3)].redirect); + (yyval.command) = make_coproc_command ("COPROC", (yyvsp[(2) - (3)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + break; + + case 104: +#line 965 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_coproc_command ((yyvsp[(2) - (3)].word)->word, (yyvsp[(3) - (3)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + break; + + case 105: +#line 970 "/usr/homes/chet/src/bash/src/parse.y" + { + COMMAND *tc; + + tc = (yyvsp[(3) - (4)].command); + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = (yyvsp[(4) - (4)].redirect); + } + else + tc->redirects = (yyvsp[(4) - (4)].redirect); + (yyval.command) = make_coproc_command ((yyvsp[(2) - (4)].word)->word, (yyvsp[(3) - (4)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + break; + + case 106: +#line 987 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = make_coproc_command ("COPROC", clean_simple_command ((yyvsp[(2) - (2)].command))); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; + } + break; + + case 107: +#line 994 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (COMMAND *)NULL); } + break; + + case 108: +#line 996 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (7)].command), (yyvsp[(4) - (7)].command), (yyvsp[(6) - (7)].command)); } + break; + + case 109: +#line 998 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(5) - (6)].command)); } + break; + + case 110: +#line 1003 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_group_command ((yyvsp[(2) - (3)].command)); } + break; + + case 111: +#line 1007 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_arith_command ((yyvsp[(1) - (1)].word_list)); } + break; + + case 112: +#line 1011 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(2) - (3)].command); } + break; + + case 113: +#line 1015 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (4)].command), (yyvsp[(4) - (4)].command), (COMMAND *)NULL); } + break; + + case 114: +#line 1017 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(6) - (6)].command)); } + break; + + case 115: +#line 1019 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (yyvsp[(5) - (5)].command)); } + break; + + case 117: +#line 1024 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(2) - (2)].pattern)->next = (yyvsp[(1) - (2)].pattern); (yyval.pattern) = (yyvsp[(2) - (2)].pattern); } + break; + + case 118: +#line 1028 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (yyvsp[(4) - (4)].command)); } + break; + + case 119: +#line 1030 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (COMMAND *)NULL); } + break; + + case 120: +#line 1032 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (yyvsp[(5) - (5)].command)); } + break; + + case 121: +#line 1034 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (COMMAND *)NULL); } + break; + + case 122: +#line 1038 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.pattern) = (yyvsp[(1) - (2)].pattern); } + break; + + case 123: +#line 1040 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); } + break; + + case 124: +#line 1042 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); } + break; + + case 125: +#line 1044 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); } + break; + + case 126: +#line 1046 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_TESTNEXT; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); } + break; + + case 127: +#line 1048 "/usr/homes/chet/src/bash/src/parse.y" + { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_TESTNEXT; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); } + break; + + case 128: +#line 1052 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); } + break; + + case 129: +#line 1054 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(3) - (3)].word), (yyvsp[(1) - (3)].word_list)); } + break; + + case 130: +#line 1063 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = (yyvsp[(2) - (2)].command); + if (need_here_doc) + gather_here_documents (); + } + break; + + case 132: +#line 1072 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = (yyvsp[(2) - (2)].command); + } + break; + + case 134: +#line 1079 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(1) - (3)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (3)].command), (COMMAND *)NULL, '&'); + else + (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (COMMAND *)NULL, '&'); + } + break; + + case 136: +#line 1090 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); } + break; + + case 137: +#line 1092 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); } + break; + + case 138: +#line 1094 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(1) - (4)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '&'); + else + (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '&'); + } + break; + + case 139: +#line 1101 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); } + break; + + case 140: +#line 1103 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); } + break; + + case 141: +#line 1105 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 144: +#line 1113 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = '\n'; } + break; + + case 145: +#line 1115 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = ';'; } + break; + + case 146: +#line 1117 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = yacc_EOF; } + break; + + case 149: +#line 1131 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = (yyvsp[(1) - (1)].command); + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = (yyvsp[(1) - (1)].command); + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + break; + + case 150: +#line 1144 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(1) - (2)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (2)].command), (COMMAND *)NULL, '&'); + else + (yyval.command) = command_connect ((yyvsp[(1) - (2)].command), (COMMAND *)NULL, '&'); + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = (yyvsp[(1) - (2)].command); + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + break; + + case 151: +#line 1160 "/usr/homes/chet/src/bash/src/parse.y" + { + (yyval.command) = (yyvsp[(1) - (2)].command); + if (need_here_doc) + gather_here_documents (); + if ((parser_state & PST_CMDSUBST) && current_token == shell_eof_token) + { + global_command = (yyvsp[(1) - (2)].command); + eof_encountered = 0; + rewind_input_string (); + YYACCEPT; + } + } + break; + + case 152: +#line 1175 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); } + break; + + case 153: +#line 1177 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); } + break; + + case 154: +#line 1179 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(1) - (3)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), '&'); + else + (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), '&'); + } + break; + + case 155: +#line 1186 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), ';'); } + break; + + case 156: +#line 1189 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 157: +#line 1193 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 158: +#line 1195 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(2) - (2)].command)) + (yyvsp[(2) - (2)].command)->flags ^= CMD_INVERT_RETURN; /* toggle */ + (yyval.command) = (yyvsp[(2) - (2)].command); + } + break; + + case 159: +#line 1201 "/usr/homes/chet/src/bash/src/parse.y" + { + if ((yyvsp[(2) - (2)].command)) + (yyvsp[(2) - (2)].command)->flags |= (yyvsp[(1) - (2)].number); + (yyval.command) = (yyvsp[(2) - (2)].command); + } + break; + + case 160: +#line 1207 "/usr/homes/chet/src/bash/src/parse.y" + { + ELEMENT x; + + /* Boy, this is unclean. `time' by itself can + time a null command. We cheat and push a + newline back if the list_terminator was a newline + to avoid the double-newline problem (one to + terminate this, one to terminate the command) */ + x.word = 0; + x.redirect = 0; + (yyval.command) = make_simple_command (x, (COMMAND *)NULL); + (yyval.command)->flags |= (yyvsp[(1) - (2)].number); + /* XXX - let's cheat and push a newline back */ + if ((yyvsp[(2) - (2)].number) == '\n') + token_to_read = '\n'; + } + break; + + case 161: +#line 1224 "/usr/homes/chet/src/bash/src/parse.y" + { + ELEMENT x; + + /* This is just as unclean. Posix says that `!' + by itself should be equivalent to `false'. + We cheat and push a + newline back if the list_terminator was a newline + to avoid the double-newline problem (one to + terminate this, one to terminate the command) */ + x.word = 0; + x.redirect = 0; + (yyval.command) = make_simple_command (x, (COMMAND *)NULL); + (yyval.command)->flags |= CMD_INVERT_RETURN; + /* XXX - let's cheat and push a newline back */ + if ((yyvsp[(2) - (2)].number) == '\n') + token_to_read = '\n'; + } + break; + + case 162: +#line 1244 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '|'); } + break; + + case 163: +#line 1246 "/usr/homes/chet/src/bash/src/parse.y" + { + /* Make cmd1 |& cmd2 equivalent to cmd1 2>&1 | cmd2 */ + COMMAND *tc; + REDIRECTEE rd, sd; + REDIRECT *r; + + tc = (yyvsp[(1) - (4)].command)->type == cm_simple ? (COMMAND *)(yyvsp[(1) - (4)].command)->value.Simple : (yyvsp[(1) - (4)].command); + sd.dest = 2; + rd.dest = 1; + r = make_redirection (sd, r_duplicating_output, rd, 0); + if (tc->redirects) + { + register REDIRECT *t; + for (t = tc->redirects; t->next; t = t->next) + ; + t->next = r; + } + else + tc->redirects = r; + + (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '|'); + } + break; + + case 164: +#line 1269 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 165: +#line 1273 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = CMD_TIME_PIPELINE; } + break; + + case 166: +#line 1275 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } + break; + + case 167: +#line 1277 "/usr/homes/chet/src/bash/src/parse.y" + { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } + break; + + +/* Line 1267 of yacc.c. */ +#line 3377 "y.tab.c" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse look-ahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse look-ahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + if (yyn == YYFINAL) + YYACCEPT; + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#ifndef yyoverflow +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); +} + + +#line 1279 "/usr/homes/chet/src/bash/src/parse.y" + + +/* Initial size to allocate for tokens, and the + amount to grow them by. */ +#define TOKEN_DEFAULT_INITIAL_SIZE 496 +#define TOKEN_DEFAULT_GROW_SIZE 512 + +/* Should we call prompt_again? */ +#define SHOULD_PROMPT() \ + (interactive && (bash_input.type == st_stdin || bash_input.type == st_stream)) + +#if defined (ALIAS) +# define expanding_alias() (pushed_string_list && pushed_string_list->expander) +#else +# define expanding_alias() 0 +#endif + +/* Global var is non-zero when end of file has been reached. */ +int EOF_Reached = 0; + +#ifdef DEBUG +static void +debug_parser (i) + int i; +{ +#if YYDEBUG != 0 + yydebug = i; +#endif +} +#endif + +/* yy_getc () returns the next available character from input or EOF. + yy_ungetc (c) makes `c' the next character to read. + init_yy_io (get, unget, type, location) makes the function GET the + installed function for getting the next character, makes UNGET the + installed function for un-getting a character, sets the type of stream + (either string or file) from TYPE, and makes LOCATION point to where + the input is coming from. */ + +/* Unconditionally returns end-of-file. */ +int +return_EOF () +{ + return (EOF); +} + +/* Variable containing the current get and unget functions. + See ./input.h for a clearer description. */ +BASH_INPUT bash_input; + +/* Set all of the fields in BASH_INPUT to NULL. Free bash_input.name if it + is non-null, avoiding a memory leak. */ +void +initialize_bash_input () +{ + bash_input.type = st_none; + FREE (bash_input.name); + bash_input.name = (char *)NULL; + bash_input.location.file = (FILE *)NULL; + bash_input.location.string = (char *)NULL; + bash_input.getter = (sh_cget_func_t *)NULL; + bash_input.ungetter = (sh_cunget_func_t *)NULL; +} + +/* Set the contents of the current bash input stream from + GET, UNGET, TYPE, NAME, and LOCATION. */ +void +init_yy_io (get, unget, type, name, location) + sh_cget_func_t *get; + sh_cunget_func_t *unget; + enum stream_type type; + const char *name; + INPUT_STREAM location; +{ + bash_input.type = type; + FREE (bash_input.name); + bash_input.name = name ? savestring (name) : (char *)NULL; + + /* XXX */ +#if defined (CRAY) + memcpy((char *)&bash_input.location.string, (char *)&location.string, sizeof(location)); +#else + bash_input.location = location; +#endif + bash_input.getter = get; + bash_input.ungetter = unget; +} + +char * +yy_input_name () +{ + return (bash_input.name ? bash_input.name : "stdin"); +} + +/* Call this to get the next character of input. */ +static int +yy_getc () +{ + return (*(bash_input.getter)) (); +} + +/* Call this to unget C. That is, to make C the next character + to be read. */ +static int +yy_ungetc (c) + int c; +{ + return (*(bash_input.ungetter)) (c); +} + +#if defined (BUFFERED_INPUT) +#ifdef INCLUDE_UNUSED +int +input_file_descriptor () +{ + switch (bash_input.type) + { + case st_stream: + return (fileno (bash_input.location.file)); + case st_bstream: + return (bash_input.location.buffered_fd); + case st_stdin: + default: + return (fileno (stdin)); + } +} +#endif +#endif /* BUFFERED_INPUT */ + +/* **************************************************************** */ +/* */ +/* Let input be read from readline (). */ +/* */ +/* **************************************************************** */ + +#if defined (READLINE) +char *current_readline_prompt = (char *)NULL; +char *current_readline_line = (char *)NULL; +int current_readline_line_index = 0; + +static int +yy_readline_get () +{ + SigHandler *old_sigint; + int line_len; + unsigned char c; + + if (!current_readline_line) + { + if (!bash_readline_initialized) + initialize_readline (); + +#if defined (JOB_CONTROL) + if (job_control) + give_terminal_to (shell_pgrp, 0); +#endif /* JOB_CONTROL */ + + old_sigint = (SigHandler *)IMPOSSIBLE_TRAP_HANDLER; + if (signal_is_ignored (SIGINT) == 0) + { + /* interrupt_immediately++; */ + old_sigint = (SigHandler *)set_signal_handler (SIGINT, sigint_sighandler); + } + + current_readline_line = readline (current_readline_prompt ? + current_readline_prompt : ""); + + CHECK_TERMSIG; + if (signal_is_ignored (SIGINT) == 0) + { + /* interrupt_immediately--; */ + if (old_sigint != IMPOSSIBLE_TRAP_HANDLER) + set_signal_handler (SIGINT, old_sigint); + } + +#if 0 + /* Reset the prompt to the decoded value of prompt_string_pointer. */ + reset_readline_prompt (); +#endif + + if (current_readline_line == 0) + return (EOF); + + current_readline_line_index = 0; + line_len = strlen (current_readline_line); + + current_readline_line = (char *)xrealloc (current_readline_line, 2 + line_len); + current_readline_line[line_len++] = '\n'; + current_readline_line[line_len] = '\0'; + } + + if (current_readline_line[current_readline_line_index] == 0) + { + free (current_readline_line); + current_readline_line = (char *)NULL; + return (yy_readline_get ()); + } + else + { + c = current_readline_line[current_readline_line_index++]; + return (c); + } +} + +static int +yy_readline_unget (c) + int c; +{ + if (current_readline_line_index && current_readline_line) + current_readline_line[--current_readline_line_index] = c; + return (c); +} + +void +with_input_from_stdin () +{ + INPUT_STREAM location; + + if (bash_input.type != st_stdin && stream_on_stack (st_stdin) == 0) + { + location.string = current_readline_line; + init_yy_io (yy_readline_get, yy_readline_unget, + st_stdin, "readline stdin", location); + } +} + +#else /* !READLINE */ + +void +with_input_from_stdin () +{ + with_input_from_stream (stdin, "stdin"); +} +#endif /* !READLINE */ + +/* **************************************************************** */ +/* */ +/* Let input come from STRING. STRING is zero terminated. */ +/* */ +/* **************************************************************** */ + +static int +yy_string_get () +{ + register char *string; + register unsigned char c; + + string = bash_input.location.string; + + /* If the string doesn't exist, or is empty, EOF found. */ + if (string && *string) + { + c = *string++; + bash_input.location.string = string; + return (c); + } + else + return (EOF); +} + +static int +yy_string_unget (c) + int c; +{ + *(--bash_input.location.string) = c; + return (c); +} + +void +with_input_from_string (string, name) + char *string; + const char *name; +{ + INPUT_STREAM location; + + location.string = string; + init_yy_io (yy_string_get, yy_string_unget, st_string, name, location); +} + +/* Count the number of characters we've consumed from bash_input.location.string + and read into shell_input_line, but have not returned from shell_getc. + That is the true input location. Rewind bash_input.location.string by + that number of characters, so it points to the last character actually + consumed by the parser. */ +static void +rewind_input_string () +{ + int xchars; + + /* number of unconsumed characters in the input -- XXX need to take newlines + into account, e.g., $(...\n) */ + xchars = shell_input_line_len - shell_input_line_index; + if (bash_input.location.string[-1] == '\n') + xchars++; + + /* XXX - how to reflect bash_input.location.string back to string passed to + parse_and_execute or xparse_dolparen? xparse_dolparen needs to know how + far into the string we parsed. parse_and_execute knows where bash_input. + location.string is, and how far from orig_string that is -- that's the + number of characters the command consumed. */ + + /* bash_input.location.string - xchars should be where we parsed to */ + /* need to do more validation on xchars value for sanity -- test cases. */ + bash_input.location.string -= xchars; +} + +/* **************************************************************** */ +/* */ +/* Let input come from STREAM. */ +/* */ +/* **************************************************************** */ + +/* These two functions used to test the value of the HAVE_RESTARTABLE_SYSCALLS + define, and just use getc/ungetc if it was defined, but since bash + installs its signal handlers without the SA_RESTART flag, some signals + (like SIGCHLD, SIGWINCH, etc.) received during a read(2) will not cause + the read to be restarted. We need to restart it ourselves. */ + +static int +yy_stream_get () +{ + int result; + + result = EOF; + if (bash_input.location.file) + { +#if 0 + if (interactive) + interrupt_immediately++; +#endif + + /* XXX - don't need terminate_immediately; getc_with_restart checks + for terminating signals itself if read returns < 0 */ + result = getc_with_restart (bash_input.location.file); + +#if 0 + if (interactive) + interrupt_immediately--; +#endif + } + return (result); +} + +static int +yy_stream_unget (c) + int c; +{ + return (ungetc_with_restart (c, bash_input.location.file)); +} + +void +with_input_from_stream (stream, name) + FILE *stream; + const char *name; +{ + INPUT_STREAM location; + + location.file = stream; + init_yy_io (yy_stream_get, yy_stream_unget, st_stream, name, location); +} + +typedef struct stream_saver { + struct stream_saver *next; + BASH_INPUT bash_input; + int line; +#if defined (BUFFERED_INPUT) + BUFFERED_STREAM *bstream; +#endif /* BUFFERED_INPUT */ +} STREAM_SAVER; + +/* The globally known line number. */ +int line_number = 0; + +/* The line number offset set by assigning to LINENO. Not currently used. */ +int line_number_base = 0; + +#if defined (COND_COMMAND) +static int cond_lineno; +static int cond_token; +#endif + +STREAM_SAVER *stream_list = (STREAM_SAVER *)NULL; + +void +push_stream (reset_lineno) + int reset_lineno; +{ + STREAM_SAVER *saver = (STREAM_SAVER *)xmalloc (sizeof (STREAM_SAVER)); + + xbcopy ((char *)&bash_input, (char *)&(saver->bash_input), sizeof (BASH_INPUT)); + +#if defined (BUFFERED_INPUT) + saver->bstream = (BUFFERED_STREAM *)NULL; + /* If we have a buffered stream, clear out buffers[fd]. */ + if (bash_input.type == st_bstream && bash_input.location.buffered_fd >= 0) + saver->bstream = set_buffered_stream (bash_input.location.buffered_fd, + (BUFFERED_STREAM *)NULL); +#endif /* BUFFERED_INPUT */ + + saver->line = line_number; + bash_input.name = (char *)NULL; + saver->next = stream_list; + stream_list = saver; + EOF_Reached = 0; + if (reset_lineno) + line_number = 0; +} + +void +pop_stream () +{ + if (!stream_list) + EOF_Reached = 1; + else + { + STREAM_SAVER *saver = stream_list; + + EOF_Reached = 0; + stream_list = stream_list->next; + + init_yy_io (saver->bash_input.getter, + saver->bash_input.ungetter, + saver->bash_input.type, + saver->bash_input.name, + saver->bash_input.location); + +#if defined (BUFFERED_INPUT) + /* If we have a buffered stream, restore buffers[fd]. */ + /* If the input file descriptor was changed while this was on the + save stack, update the buffered fd to the new file descriptor and + re-establish the buffer <-> bash_input fd correspondence. */ + if (bash_input.type == st_bstream && bash_input.location.buffered_fd >= 0) + { + if (bash_input_fd_changed) + { + bash_input_fd_changed = 0; + if (default_buffered_input >= 0) + { + bash_input.location.buffered_fd = default_buffered_input; + saver->bstream->b_fd = default_buffered_input; + SET_CLOSE_ON_EXEC (default_buffered_input); + } + } + /* XXX could free buffered stream returned as result here. */ + set_buffered_stream (bash_input.location.buffered_fd, saver->bstream); + } +#endif /* BUFFERED_INPUT */ + + line_number = saver->line; + + FREE (saver->bash_input.name); + free (saver); + } +} + +/* Return 1 if a stream of type TYPE is saved on the stack. */ +int +stream_on_stack (type) + enum stream_type type; +{ + register STREAM_SAVER *s; + + for (s = stream_list; s; s = s->next) + if (s->bash_input.type == type) + return 1; + return 0; +} + +/* Save the current token state and return it in a malloced array. */ +int * +save_token_state () +{ + int *ret; + + ret = (int *)xmalloc (4 * sizeof (int)); + ret[0] = last_read_token; + ret[1] = token_before_that; + ret[2] = two_tokens_ago; + ret[3] = current_token; + return ret; +} + +void +restore_token_state (ts) + int *ts; +{ + if (ts == 0) + return; + last_read_token = ts[0]; + token_before_that = ts[1]; + two_tokens_ago = ts[2]; + current_token = ts[3]; +} + +/* + * This is used to inhibit alias expansion and reserved word recognition + * inside case statement pattern lists. A `case statement pattern list' is: + * + * everything between the `in' in a `case word in' and the next ')' + * or `esac' + * everything between a `;;' and the next `)' or `esac' + */ + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + +#define END_OF_ALIAS 0 + +/* + * Pseudo-global variables used in implementing token-wise alias expansion. + */ + +/* + * Pushing and popping strings. This works together with shell_getc to + * implement alias expansion on a per-token basis. + */ + +#define PSH_ALIAS 0x01 +#define PSH_DPAREN 0x02 +#define PSH_SOURCE 0x04 + +typedef struct string_saver { + struct string_saver *next; + int expand_alias; /* Value to set expand_alias to when string is popped. */ + char *saved_line; +#if defined (ALIAS) + alias_t *expander; /* alias that caused this line to be pushed. */ +#endif + size_t saved_line_size, saved_line_index; + int saved_line_terminator; + int flags; +} STRING_SAVER; + +STRING_SAVER *pushed_string_list = (STRING_SAVER *)NULL; + +/* + * Push the current shell_input_line onto a stack of such lines and make S + * the current input. Used when expanding aliases. EXPAND is used to set + * the value of expand_next_token when the string is popped, so that the + * word after the alias in the original line is handled correctly when the + * alias expands to multiple words. TOKEN is the token that was expanded + * into S; it is saved and used to prevent infinite recursive expansion. + */ +static void +push_string (s, expand, ap) + char *s; + int expand; + alias_t *ap; +{ + STRING_SAVER *temp = (STRING_SAVER *)xmalloc (sizeof (STRING_SAVER)); + + temp->expand_alias = expand; + temp->saved_line = shell_input_line; + temp->saved_line_size = shell_input_line_size; + temp->saved_line_index = shell_input_line_index; + temp->saved_line_terminator = shell_input_line_terminator; + temp->flags = 0; +#if defined (ALIAS) + temp->expander = ap; + if (ap) + temp->flags = PSH_ALIAS; +#endif + temp->next = pushed_string_list; + pushed_string_list = temp; + +#if defined (ALIAS) + if (ap) + ap->flags |= AL_BEINGEXPANDED; +#endif + + shell_input_line = s; + shell_input_line_size = STRLEN (s); + shell_input_line_index = 0; + shell_input_line_terminator = '\0'; +#if 0 + parser_state &= ~PST_ALEXPNEXT; /* XXX */ +#endif + + set_line_mbstate (); +} + +/* + * Make the top of the pushed_string stack be the current shell input. + * Only called when there is something on the stack. Called from shell_getc + * when it thinks it has consumed the string generated by an alias expansion + * and needs to return to the original input line. + */ +static void +pop_string () +{ + STRING_SAVER *t; + + FREE (shell_input_line); + shell_input_line = pushed_string_list->saved_line; + shell_input_line_index = pushed_string_list->saved_line_index; + shell_input_line_size = pushed_string_list->saved_line_size; + shell_input_line_terminator = pushed_string_list->saved_line_terminator; + + if (pushed_string_list->expand_alias) + parser_state |= PST_ALEXPNEXT; + else + parser_state &= ~PST_ALEXPNEXT; + + t = pushed_string_list; + pushed_string_list = pushed_string_list->next; + +#if defined (ALIAS) + if (t->expander) + t->expander->flags &= ~AL_BEINGEXPANDED; +#endif + + free ((char *)t); + + set_line_mbstate (); +} + +static void +free_string_list () +{ + register STRING_SAVER *t, *t1; + + for (t = pushed_string_list; t; ) + { + t1 = t->next; + FREE (t->saved_line); +#if defined (ALIAS) + if (t->expander) + t->expander->flags &= ~AL_BEINGEXPANDED; +#endif + free ((char *)t); + t = t1; + } + pushed_string_list = (STRING_SAVER *)NULL; +} + +#endif /* ALIAS || DPAREN_ARITHMETIC */ + +void +free_pushed_string_input () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + free_string_list (); +#endif +} + +int +parser_expanding_alias () +{ + return (expanding_alias ()); +} + +void +parser_save_alias () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + push_string ((char *)NULL, 0, (alias_t *)NULL); + pushed_string_list->flags = PSH_SOURCE; /* XXX - for now */ +#else + ; +#endif +} + +void +parser_restore_alias () +{ +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + if (pushed_string_list) + pop_string (); +#else + ; +#endif +} + +/* Return a line of text, taken from wherever yylex () reads input. + If there is no more input, then we return NULL. If REMOVE_QUOTED_NEWLINE + is non-zero, we remove unquoted \ pairs. This is used by + read_secondary_line to read here documents. */ +static char * +read_a_line (remove_quoted_newline) + int remove_quoted_newline; +{ + static char *line_buffer = (char *)NULL; + static int buffer_size = 0; + int indx, c, peekc, pass_next; + +#if defined (READLINE) + if (no_line_editing && SHOULD_PROMPT ()) +#else + if (SHOULD_PROMPT ()) +#endif + print_prompt (); + + pass_next = indx = 0; + while (1) + { + /* Allow immediate exit if interrupted during input. */ + QUIT; + + c = yy_getc (); + + /* Ignore null bytes in input. */ + if (c == 0) + { +#if 0 + internal_warning ("read_a_line: ignored null byte in input"); +#endif + continue; + } + + /* If there is no more input, then we return NULL. */ + if (c == EOF) + { + if (interactive && bash_input.type == st_stream) + clearerr (stdin); + if (indx == 0) + return ((char *)NULL); + c = '\n'; + } + + /* `+2' in case the final character in the buffer is a newline. */ + RESIZE_MALLOCED_BUFFER (line_buffer, indx, 2, buffer_size, 128); + + /* IF REMOVE_QUOTED_NEWLINES is non-zero, we are reading a + here document with an unquoted delimiter. In this case, + the line will be expanded as if it were in double quotes. + We allow a backslash to escape the next character, but we + need to treat the backslash specially only if a backslash + quoting a backslash-newline pair appears in the line. */ + if (pass_next) + { + line_buffer[indx++] = c; + pass_next = 0; + } + else if (c == '\\' && remove_quoted_newline) + { + QUIT; + peekc = yy_getc (); + if (peekc == '\n') + { + line_number++; + continue; /* Make the unquoted \ pair disappear. */ + } + else + { + yy_ungetc (peekc); + pass_next = 1; + line_buffer[indx++] = c; /* Preserve the backslash. */ + } + } + else + line_buffer[indx++] = c; + + if (c == '\n') + { + line_buffer[indx] = '\0'; + return (line_buffer); + } + } +} + +/* Return a line as in read_a_line (), but insure that the prompt is + the secondary prompt. This is used to read the lines of a here + document. REMOVE_QUOTED_NEWLINE is non-zero if we should remove + newlines quoted with backslashes while reading the line. It is + non-zero unless the delimiter of the here document was quoted. */ +char * +read_secondary_line (remove_quoted_newline) + int remove_quoted_newline; +{ + char *ret; + int n, c; + + prompt_string_pointer = &ps2_prompt; + if (SHOULD_PROMPT()) + prompt_again (); + ret = read_a_line (remove_quoted_newline); +#if defined (HISTORY) + if (ret && remember_on_history && (parser_state & PST_HEREDOC)) + { + /* To make adding the the here-document body right, we need to rely + on history_delimiting_chars() returning \n for the first line of + the here-document body and the null string for the second and + subsequent lines, so we avoid double newlines. + current_command_line_count == 2 for the first line of the body. */ + + current_command_line_count++; + maybe_add_history (ret); + } +#endif /* HISTORY */ + return ret; +} + +/* **************************************************************** */ +/* */ +/* YYLEX () */ +/* */ +/* **************************************************************** */ + +/* Reserved words. These are only recognized as the first word of a + command. */ +STRING_INT_ALIST word_token_alist[] = { + { "if", IF }, + { "then", THEN }, + { "else", ELSE }, + { "elif", ELIF }, + { "fi", FI }, + { "case", CASE }, + { "esac", ESAC }, + { "for", FOR }, +#if defined (SELECT_COMMAND) + { "select", SELECT }, +#endif + { "while", WHILE }, + { "until", UNTIL }, + { "do", DO }, + { "done", DONE }, + { "in", IN }, + { "function", FUNCTION }, +#if defined (COMMAND_TIMING) + { "time", TIME }, +#endif + { "{", '{' }, + { "}", '}' }, + { "!", BANG }, +#if defined (COND_COMMAND) + { "[[", COND_START }, + { "]]", COND_END }, +#endif +#if defined (COPROCESS_SUPPORT) + { "coproc", COPROC }, +#endif + { (char *)NULL, 0} +}; + +/* other tokens that can be returned by read_token() */ +STRING_INT_ALIST other_token_alist[] = { + /* Multiple-character tokens with special values */ + { "--", TIMEIGN }, + { "-p", TIMEOPT }, + { "&&", AND_AND }, + { "||", OR_OR }, + { ">>", GREATER_GREATER }, + { "<<", LESS_LESS }, + { "<&", LESS_AND }, + { ">&", GREATER_AND }, + { ";;", SEMI_SEMI }, + { ";&", SEMI_AND }, + { ";;&", SEMI_SEMI_AND }, + { "<<-", LESS_LESS_MINUS }, + { "<<<", LESS_LESS_LESS }, + { "&>", AND_GREATER }, + { "&>>", AND_GREATER_GREATER }, + { "<>", LESS_GREATER }, + { ">|", GREATER_BAR }, + { "|&", BAR_AND }, + { "EOF", yacc_EOF }, + /* Tokens whose value is the character itself */ + { ">", '>' }, + { "<", '<' }, + { "-", '-' }, + { "{", '{' }, + { "}", '}' }, + { ";", ';' }, + { "(", '(' }, + { ")", ')' }, + { "|", '|' }, + { "&", '&' }, + { "newline", '\n' }, + { (char *)NULL, 0} +}; + +/* others not listed here: + WORD look at yylval.word + ASSIGNMENT_WORD look at yylval.word + NUMBER look at yylval.number + ARITH_CMD look at yylval.word_list + ARITH_FOR_EXPRS look at yylval.word_list + COND_CMD look at yylval.command +*/ + +/* These are used by read_token_word, but appear up here so that shell_getc + can use them to decide when to add otherwise blank lines to the history. */ + +/* The primary delimiter stack. */ +struct dstack dstack = { (char *)NULL, 0, 0 }; + +/* A temporary delimiter stack to be used when decoding prompt strings. + This is needed because command substitutions in prompt strings (e.g., PS2) + can screw up the parser's quoting state. */ +static struct dstack temp_dstack = { (char *)NULL, 0, 0 }; + +/* Macro for accessing the top delimiter on the stack. Returns the + delimiter or zero if none. */ +#define current_delimiter(ds) \ + (ds.delimiter_depth ? ds.delimiters[ds.delimiter_depth - 1] : 0) + +#define push_delimiter(ds, character) \ + do \ + { \ + if (ds.delimiter_depth + 2 > ds.delimiter_space) \ + ds.delimiters = (char *)xrealloc \ + (ds.delimiters, (ds.delimiter_space += 10) * sizeof (char)); \ + ds.delimiters[ds.delimiter_depth] = character; \ + ds.delimiter_depth++; \ + } \ + while (0) + +#define pop_delimiter(ds) ds.delimiter_depth-- + +/* Return the next shell input character. This always reads characters + from shell_input_line; when that line is exhausted, it is time to + read the next line. This is called by read_token when the shell is + processing normal command input. */ + +/* This implements one-character lookahead/lookbehind across physical input + lines, to avoid something being lost because it's pushed back with + shell_ungetc when we're at the start of a line. */ +static int eol_ungetc_lookahead = 0; + +static int +shell_getc (remove_quoted_newline) + int remove_quoted_newline; +{ + register int i; + int c, truncating; + unsigned char uc; + + QUIT; + + if (sigwinch_received) + { + sigwinch_received = 0; + get_new_window_size (0, (int *)0, (int *)0); + } + + if (eol_ungetc_lookahead) + { + c = eol_ungetc_lookahead; + eol_ungetc_lookahead = 0; + return (c); + } + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* If shell_input_line[shell_input_line_index] == 0, but there is + something on the pushed list of strings, then we don't want to go + off and get another line. We let the code down below handle it. */ + + if (!shell_input_line || ((!shell_input_line[shell_input_line_index]) && + (pushed_string_list == (STRING_SAVER *)NULL))) +#else /* !ALIAS && !DPAREN_ARITHMETIC */ + if (!shell_input_line || !shell_input_line[shell_input_line_index]) +#endif /* !ALIAS && !DPAREN_ARITHMETIC */ + { + line_number++; + + /* Let's not let one really really long line blow up memory allocation */ + if (shell_input_line && shell_input_line_size >= 32768) + { + free (shell_input_line); + shell_input_line = 0; + shell_input_line_size = 0; + } + + restart_read: + + /* Allow immediate exit if interrupted during input. */ + QUIT; + + i = truncating = 0; + shell_input_line_terminator = 0; + + /* If the shell is interatctive, but not currently printing a prompt + (interactive_shell && interactive == 0), we don't want to print + notifies or cleanup the jobs -- we want to defer it until we do + print the next prompt. */ + if (interactive_shell == 0 || SHOULD_PROMPT()) + { +#if defined (JOB_CONTROL) + /* This can cause a problem when reading a command as the result + of a trap, when the trap is called from flush_child. This call + had better not cause jobs to disappear from the job table in + that case, or we will have big trouble. */ + notify_and_cleanup (); +#else /* !JOB_CONTROL */ + cleanup_dead_jobs (); +#endif /* !JOB_CONTROL */ + } + +#if defined (READLINE) + if (no_line_editing && SHOULD_PROMPT()) +#else + if (SHOULD_PROMPT()) +#endif + print_prompt (); + + if (bash_input.type == st_stream) + clearerr (stdin); + + while (1) + { + c = yy_getc (); + + /* Allow immediate exit if interrupted during input. */ + QUIT; + + if (c == '\0') + { +#if 0 + internal_warning ("shell_getc: ignored null byte in input"); +#endif + continue; + } + + /* Theoretical overflow */ + /* If we can't put 256 bytes more into the buffer, allocate + everything we can and fill it as full as we can. */ + /* XXX - we ignore rest of line using `truncating' flag */ + if (shell_input_line_size > (SIZE_MAX - 256)) + { + size_t n; + + n = SIZE_MAX - i; /* how much more can we put into the buffer? */ + if (n <= 2) /* we have to save 1 for the newline added below */ + { + if (truncating == 0) + internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%llu): line truncated", shell_input_line_size, SIZE_MAX); + shell_input_line[i] = '\0'; + truncating = 1; + } + if (shell_input_line_size < SIZE_MAX) + { + shell_input_line_size = SIZE_MAX; + shell_input_line = xrealloc (shell_input_line, shell_input_line_size); + } + } + else + RESIZE_MALLOCED_BUFFER (shell_input_line, i, 2, shell_input_line_size, 256); + + if (c == EOF) + { + if (bash_input.type == st_stream) + clearerr (stdin); + + if (i == 0) + shell_input_line_terminator = EOF; + + shell_input_line[i] = '\0'; + break; + } + + if (truncating == 0 || c == '\n') + shell_input_line[i++] = c; + + if (c == '\n') + { + shell_input_line[--i] = '\0'; + current_command_line_count++; + break; + } + } + + shell_input_line_index = 0; + shell_input_line_len = i; /* == strlen (shell_input_line) */ + + set_line_mbstate (); + +#if defined (HISTORY) + if (remember_on_history && shell_input_line && shell_input_line[0]) + { + char *expansions; +# if defined (BANG_HISTORY) + int old_hist; + + /* If the current delimiter is a single quote, we should not be + performing history expansion, even if we're on a different + line from the original single quote. */ + old_hist = history_expansion_inhibited; + if (current_delimiter (dstack) == '\'') + history_expansion_inhibited = 1; +# endif + expansions = pre_process_line (shell_input_line, 1, 1); +# if defined (BANG_HISTORY) + history_expansion_inhibited = old_hist; +# endif + if (expansions != shell_input_line) + { + free (shell_input_line); + shell_input_line = expansions; + shell_input_line_len = shell_input_line ? + strlen (shell_input_line) : 0; + if (shell_input_line_len == 0) + current_command_line_count--; + + /* We have to force the xrealloc below because we don't know + the true allocated size of shell_input_line anymore. */ + shell_input_line_size = shell_input_line_len; + + set_line_mbstate (); + } + } + /* Try to do something intelligent with blank lines encountered while + entering multi-line commands. XXX - this is grotesque */ + else if (remember_on_history && shell_input_line && + shell_input_line[0] == '\0' && + current_command_line_count > 1) + { + if (current_delimiter (dstack)) + /* We know shell_input_line[0] == 0 and we're reading some sort of + quoted string. This means we've got a line consisting of only + a newline in a quoted string. We want to make sure this line + gets added to the history. */ + maybe_add_history (shell_input_line); + else + { + char *hdcs; + hdcs = history_delimiting_chars (shell_input_line); + if (hdcs && hdcs[0] == ';') + maybe_add_history (shell_input_line); + } + } + +#endif /* HISTORY */ + + if (shell_input_line) + { + /* Lines that signify the end of the shell's input should not be + echoed. We should not echo lines while parsing command + substitutions with recursive calls into the parsing engine; those + should only be echoed once when we read the word. That is the + reason for the test against shell_eof_token, which is set to a + right paren when parsing the contents of command substitutions. */ + if (echo_input_at_read && (shell_input_line[0] || + shell_input_line_terminator != EOF) && + shell_eof_token == 0) + fprintf (stderr, "%s\n", shell_input_line); + } + else + { + shell_input_line_size = 0; + prompt_string_pointer = ¤t_prompt_string; + if (SHOULD_PROMPT ()) + prompt_again (); + goto restart_read; + } + + /* Add the newline to the end of this string, iff the string does + not already end in an EOF character. */ + if (shell_input_line_terminator != EOF) + { + if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size)) + shell_input_line = (char *)xrealloc (shell_input_line, + 1 + (shell_input_line_size += 2)); + + shell_input_line[shell_input_line_len] = '\n'; + shell_input_line[shell_input_line_len + 1] = '\0'; + + set_line_mbstate (); + } + } + +next_alias_char: + uc = shell_input_line[shell_input_line_index]; + + if (uc) + shell_input_line_index++; + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* If UC is NULL, we have reached the end of the current input string. If + pushed_string_list is non-empty, it's time to pop to the previous string + because we have fully consumed the result of the last alias expansion. + Do it transparently; just return the next character of the string popped + to. */ + /* If pushed_string_list != 0 but pushed_string_list->expander == 0 (not + currently tested) and the flags value is not PSH_SOURCE, we are not + parsing an alias, we have just saved one (push_string, when called by + the parse_dparen code) In this case, just go on as well. The PSH_SOURCE + case is handled below. */ +pop_alias: + if (uc == 0 && pushed_string_list && pushed_string_list->flags != PSH_SOURCE) + { + pop_string (); + uc = shell_input_line[shell_input_line_index]; + if (uc) + shell_input_line_index++; + } +#endif /* ALIAS || DPAREN_ARITHMETIC */ + + if MBTEST(uc == '\\' && remove_quoted_newline && shell_input_line[shell_input_line_index] == '\n') + { + if (SHOULD_PROMPT ()) + prompt_again (); + line_number++; + /* What do we do here if we're expanding an alias whose definition + includes an escaped newline? If that's the last character in the + alias expansion, we just pop the pushed string list (recall that + we inhibit the appending of a space in mk_alexpansion() if newline + is the last character). If it's not the last character, we need + to consume the quoted newline and move to the next character in + the expansion. */ +#if defined (ALIAS) + if (expanding_alias () && shell_input_line[shell_input_line_index+1] == '\0') + { + uc = 0; + goto pop_alias; + } + else if (expanding_alias () && shell_input_line[shell_input_line_index+1] != '\0') + { + shell_input_line_index++; /* skip newline */ + goto next_alias_char; /* and get next character */ + } + else +#endif + goto restart_read; + } + + if (uc == 0 && shell_input_line_terminator == EOF) + return ((shell_input_line_index != 0) ? '\n' : EOF); + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + /* We already know that we are not parsing an alias expansion because of the + check for expanding_alias() above. This knows how parse_and_execute + handles switching to st_string input while an alias is being expanded, + hence the check for pushed_string_list without pushed_string_list->expander + and the check for PSH_SOURCE as pushed_string_list->flags. + parse_and_execute and parse_string both change the input type to st_string + and place the string to be parsed and executed into location.string, so + we should not stop reading that until the pointer is '\0'. + The check for shell_input_line_terminator may be superfluous. + + This solves the problem of `.' inside a multi-line alias with embedded + newlines executing things out of order. */ + if (uc == 0 && bash_input.type == st_string && *bash_input.location.string && + pushed_string_list && pushed_string_list->flags == PSH_SOURCE && + shell_input_line_terminator == 0) + { + shell_input_line_index = 0; + goto restart_read; + } +#endif + + return (uc); +} + +/* Put C back into the input for the shell. This might need changes for + HANDLE_MULTIBYTE around EOLs. Since we (currently) never push back a + character different than we read, shell_input_line_property doesn't need + to change when manipulating shell_input_line. The define for + last_shell_getc_is_singlebyte should take care of it, though. */ +static void +shell_ungetc (c) + int c; +{ + if (shell_input_line && shell_input_line_index) + shell_input_line[--shell_input_line_index] = c; + else + eol_ungetc_lookahead = c; +} + +#ifdef INCLUDE_UNUSED +/* Back the input pointer up by one, effectively `ungetting' a character. */ +static void +shell_ungetchar () +{ + if (shell_input_line && shell_input_line_index) + shell_input_line_index--; +} +#endif + +/* Discard input until CHARACTER is seen, then push that character back + onto the input stream. */ +static void +discard_until (character) + int character; +{ + int c; + + while ((c = shell_getc (0)) != EOF && c != character) + ; + + if (c != EOF) + shell_ungetc (c); +} + +void +execute_variable_command (command, vname) + char *command, *vname; +{ + char *last_lastarg; + sh_parser_state_t ps; + + save_parser_state (&ps); + last_lastarg = get_string_value ("_"); + if (last_lastarg) + last_lastarg = savestring (last_lastarg); + + parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEVAL_NOHIST); + + restore_parser_state (&ps); + bind_variable ("_", last_lastarg, 0); + FREE (last_lastarg); + + if (token_to_read == '\n') /* reset_parser was called */ + token_to_read = 0; +} + +/* Place to remember the token. We try to keep the buffer + at a reasonable size, but it can grow. */ +static char *token = (char *)NULL; + +/* Current size of the token buffer. */ +static int token_buffer_size; + +/* Command to read_token () explaining what we want it to do. */ +#define READ 0 +#define RESET 1 +#define prompt_is_ps1 \ + (!prompt_string_pointer || prompt_string_pointer == &ps1_prompt) + +/* Function for yyparse to call. yylex keeps track of + the last two tokens read, and calls read_token. */ +static int +yylex () +{ + if (interactive && (current_token == 0 || current_token == '\n')) + { + /* Before we print a prompt, we might have to check mailboxes. + We do this only if it is time to do so. Notice that only here + is the mail alarm reset; nothing takes place in check_mail () + except the checking of mail. Please don't change this. */ + if (prompt_is_ps1 && parse_and_execute_level == 0 && time_to_check_mail ()) + { + check_mail (); + reset_mail_timer (); + } + + /* Avoid printing a prompt if we're not going to read anything, e.g. + after resetting the parser with read_token (RESET). */ + if (token_to_read == 0 && SHOULD_PROMPT ()) + prompt_again (); + } + + two_tokens_ago = token_before_that; + token_before_that = last_read_token; + last_read_token = current_token; + current_token = read_token (READ); + + if ((parser_state & PST_EOFTOKEN) && current_token == shell_eof_token) + { + current_token = yacc_EOF; + if (bash_input.type == st_string) + rewind_input_string (); + } + parser_state &= ~PST_EOFTOKEN; + + return (current_token); +} + +/* When non-zero, we have read the required tokens + which allow ESAC to be the next one read. */ +static int esacs_needed_count; + +void +gather_here_documents () +{ + int r; + + r = 0; + while (need_here_doc > 0) + { + parser_state |= PST_HEREDOC; + make_here_document (redir_stack[r++], line_number); + parser_state &= ~PST_HEREDOC; + need_here_doc--; + } +} + +/* When non-zero, an open-brace used to create a group is awaiting a close + brace partner. */ +static int open_brace_count; + +#define command_token_position(token) \ + (((token) == ASSIGNMENT_WORD) || (parser_state&PST_REDIRLIST) || \ + ((token) != SEMI_SEMI && (token) != SEMI_AND && (token) != SEMI_SEMI_AND && reserved_word_acceptable(token))) + +#define assignment_acceptable(token) \ + (command_token_position(token) && ((parser_state & PST_CASEPAT) == 0)) + +/* Check to see if TOKEN is a reserved word and return the token + value if it is. */ +#define CHECK_FOR_RESERVED_WORD(tok) \ + do { \ + if (!dollar_present && !quoted && \ + reserved_word_acceptable (last_read_token)) \ + { \ + int i; \ + for (i = 0; word_token_alist[i].word != (char *)NULL; i++) \ + if (STREQ (tok, word_token_alist[i].word)) \ + { \ + if ((parser_state & PST_CASEPAT) && (word_token_alist[i].token != ESAC)) \ + break; \ + if (word_token_alist[i].token == TIME && time_command_acceptable () == 0) \ + break; \ + if (word_token_alist[i].token == ESAC) \ + parser_state &= ~(PST_CASEPAT|PST_CASESTMT); \ + else if (word_token_alist[i].token == CASE) \ + parser_state |= PST_CASESTMT; \ + else if (word_token_alist[i].token == COND_END) \ + parser_state &= ~(PST_CONDCMD|PST_CONDEXPR); \ + else if (word_token_alist[i].token == COND_START) \ + parser_state |= PST_CONDCMD; \ + else if (word_token_alist[i].token == '{') \ + open_brace_count++; \ + else if (word_token_alist[i].token == '}' && open_brace_count) \ + open_brace_count--; \ + return (word_token_alist[i].token); \ + } \ + } \ + } while (0) + +#if defined (ALIAS) + + /* OK, we have a token. Let's try to alias expand it, if (and only if) + it's eligible. + + It is eligible for expansion if EXPAND_ALIASES is set, and + the token is unquoted and the last token read was a command + separator (or expand_next_token is set), and we are currently + processing an alias (pushed_string_list is non-empty) and this + token is not the same as the current or any previously + processed alias. + + Special cases that disqualify: + In a pattern list in a case statement (parser_state & PST_CASEPAT). */ + +static char * +mk_alexpansion (s) + char *s; +{ + int l; + char *r; + + l = strlen (s); + r = xmalloc (l + 2); + strcpy (r, s); + /* If the last character in the alias is a newline, don't add a trailing + space to the expansion. Works with shell_getc above. */ + if (r[l - 1] != ' ' && r[l - 1] != '\n') + r[l++] = ' '; + r[l] = '\0'; + return r; +} + +static int +alias_expand_token (tokstr) + char *tokstr; +{ + char *expanded; + alias_t *ap; + + if (((parser_state & PST_ALEXPNEXT) || command_token_position (last_read_token)) && + (parser_state & PST_CASEPAT) == 0) + { + ap = find_alias (tokstr); + + /* Currently expanding this token. */ + if (ap && (ap->flags & AL_BEINGEXPANDED)) + return (NO_EXPANSION); + + /* mk_alexpansion puts an extra space on the end of the alias expansion, + so the lookahead by the parser works right. If this gets changed, + make sure the code in shell_getc that deals with reaching the end of + an expanded alias is changed with it. */ + expanded = ap ? mk_alexpansion (ap->value) : (char *)NULL; + + if (expanded) + { + push_string (expanded, ap->flags & AL_EXPANDNEXT, ap); + return (RE_READ_TOKEN); + } + else + /* This is an eligible token that does not have an expansion. */ + return (NO_EXPANSION); + } + return (NO_EXPANSION); +} +#endif /* ALIAS */ + +static int +time_command_acceptable () +{ +#if defined (COMMAND_TIMING) + int i; + + if (posixly_correct && shell_compatibility_level > 41) + { + /* Quick check of the rest of the line to find the next token. If it + begins with a `-', Posix says to not return `time' as the token. + This was interp 267. */ + i = shell_input_line_index; + while (i < shell_input_line_len && (shell_input_line[i] == ' ' || shell_input_line[i] == '\t')) + i++; + if (shell_input_line[i] == '-') + return 0; + } + + switch (last_read_token) + { + case 0: + case ';': + case '\n': + case AND_AND: + case OR_OR: + case '&': + case DO: + case THEN: + case ELSE: + case '{': /* } */ + case '(': /* ) */ + case BANG: /* ! time pipeline */ + case TIME: /* time time pipeline */ + case TIMEOPT: /* time -p time pipeline */ + case TIMEIGN: /* time -p -- ... */ + return 1; + default: + return 0; + } +#else + return 0; +#endif /* COMMAND_TIMING */ +} + +/* Handle special cases of token recognition: + IN is recognized if the last token was WORD and the token + before that was FOR or CASE or SELECT. + + DO is recognized if the last token was WORD and the token + before that was FOR or SELECT. + + ESAC is recognized if the last token caused `esacs_needed_count' + to be set + + `{' is recognized if the last token as WORD and the token + before that was FUNCTION, or if we just parsed an arithmetic + `for' command. + + `}' is recognized if there is an unclosed `{' present. + + `-p' is returned as TIMEOPT if the last read token was TIME. + `--' is returned as TIMEIGN if the last read token was TIMEOPT. + + ']]' is returned as COND_END if the parser is currently parsing + a conditional expression ((parser_state & PST_CONDEXPR) != 0) + + `time' is returned as TIME if and only if it is immediately + preceded by one of `;', `\n', `||', `&&', or `&'. +*/ + +static int +special_case_tokens (tokstr) + char *tokstr; +{ + if ((last_read_token == WORD) && +#if defined (SELECT_COMMAND) + ((token_before_that == FOR) || (token_before_that == CASE) || (token_before_that == SELECT)) && +#else + ((token_before_that == FOR) || (token_before_that == CASE)) && +#endif + (tokstr[0] == 'i' && tokstr[1] == 'n' && tokstr[2] == 0)) + { + if (token_before_that == CASE) + { + parser_state |= PST_CASEPAT; + esacs_needed_count++; + } + return (IN); + } + + if (last_read_token == WORD && +#if defined (SELECT_COMMAND) + (token_before_that == FOR || token_before_that == SELECT) && +#else + (token_before_that == FOR) && +#endif + (tokstr[0] == 'd' && tokstr[1] == 'o' && tokstr[2] == '\0')) + return (DO); + + /* Ditto for ESAC in the CASE case. + Specifically, this handles "case word in esac", which is a legal + construct, certainly because someone will pass an empty arg to the + case construct, and we don't want it to barf. Of course, we should + insist that the case construct has at least one pattern in it, but + the designers disagree. */ + if (esacs_needed_count) + { + esacs_needed_count--; + if (STREQ (tokstr, "esac")) + { + parser_state &= ~PST_CASEPAT; + return (ESAC); + } + } + + /* The start of a shell function definition. */ + if (parser_state & PST_ALLOWOPNBRC) + { + parser_state &= ~PST_ALLOWOPNBRC; + if (tokstr[0] == '{' && tokstr[1] == '\0') /* } */ + { + open_brace_count++; + function_bstart = line_number; + return ('{'); /* } */ + } + } + + /* We allow a `do' after a for ((...)) without an intervening + list_terminator */ + if (last_read_token == ARITH_FOR_EXPRS && tokstr[0] == 'd' && tokstr[1] == 'o' && !tokstr[2]) + return (DO); + if (last_read_token == ARITH_FOR_EXPRS && tokstr[0] == '{' && tokstr[1] == '\0') /* } */ + { + open_brace_count++; + return ('{'); /* } */ + } + + if (open_brace_count && reserved_word_acceptable (last_read_token) && tokstr[0] == '}' && !tokstr[1]) + { + open_brace_count--; /* { */ + return ('}'); + } + +#if defined (COMMAND_TIMING) + /* Handle -p after `time'. */ + if (last_read_token == TIME && tokstr[0] == '-' && tokstr[1] == 'p' && !tokstr[2]) + return (TIMEOPT); + /* Handle -- after `time -p'. */ + if (last_read_token == TIMEOPT && tokstr[0] == '-' && tokstr[1] == '-' && !tokstr[2]) + return (TIMEIGN); +#endif + +#if defined (COND_COMMAND) /* [[ */ + if ((parser_state & PST_CONDEXPR) && tokstr[0] == ']' && tokstr[1] == ']' && tokstr[2] == '\0') + return (COND_END); +#endif + + return (-1); +} + +/* Called from shell.c when Control-C is typed at top level. Or + by the error rule at top level. */ +void +reset_parser () +{ + dstack.delimiter_depth = 0; /* No delimiters found so far. */ + open_brace_count = 0; + +#if defined (EXTENDED_GLOB) + /* Reset to global value of extended glob */ + if (parser_state & PST_EXTPAT) + extended_glob = global_extglob; +#endif + + parser_state = 0; + +#if defined (ALIAS) || defined (DPAREN_ARITHMETIC) + if (pushed_string_list) + free_string_list (); +#endif /* ALIAS || DPAREN_ARITHMETIC */ + + if (shell_input_line) + { + free (shell_input_line); + shell_input_line = (char *)NULL; + shell_input_line_size = shell_input_line_index = 0; + } + + FREE (word_desc_to_read); + word_desc_to_read = (WORD_DESC *)NULL; + + current_token = '\n'; /* XXX */ + last_read_token = '\n'; + token_to_read = '\n'; +} + +/* Read the next token. Command can be READ (normal operation) or + RESET (to normalize state). */ +static int +read_token (command) + int command; +{ + int character; /* Current character. */ + int peek_char; /* Temporary look-ahead character. */ + int result; /* The thing to return. */ + + if (command == RESET) + { + reset_parser (); + return ('\n'); + } + + if (token_to_read) + { + result = token_to_read; + if (token_to_read == WORD || token_to_read == ASSIGNMENT_WORD) + { + yylval.word = word_desc_to_read; + word_desc_to_read = (WORD_DESC *)NULL; + } + token_to_read = 0; + return (result); + } + +#if defined (COND_COMMAND) + if ((parser_state & (PST_CONDCMD|PST_CONDEXPR)) == PST_CONDCMD) + { + cond_lineno = line_number; + parser_state |= PST_CONDEXPR; + yylval.command = parse_cond_command (); + if (cond_token != COND_END) + { + cond_error (); + return (-1); + } + token_to_read = COND_END; + parser_state &= ~(PST_CONDEXPR|PST_CONDCMD); + return (COND_CMD); + } +#endif + +#if defined (ALIAS) + /* This is a place to jump back to once we have successfully expanded a + token with an alias and pushed the string with push_string () */ + re_read_token: +#endif /* ALIAS */ + + /* Read a single word from input. Start by skipping blanks. */ + while ((character = shell_getc (1)) != EOF && shellblank (character)) + ; + + if (character == EOF) + { + EOF_Reached = 1; + return (yacc_EOF); + } + + if MBTEST(character == '#' && (!interactive || interactive_comments)) + { + /* A comment. Discard until EOL or EOF, and then return a newline. */ + discard_until ('\n'); + shell_getc (0); + character = '\n'; /* this will take the next if statement and return. */ + } + + if (character == '\n') + { + /* If we're about to return an unquoted newline, we can go and collect + the text of any pending here document. */ + if (need_here_doc) + gather_here_documents (); + +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + parser_state &= ~PST_ASSIGNOK; + + return (character); + } + + if (parser_state & PST_REGEXP) + goto tokword; + + /* Shell meta-characters. */ + if MBTEST(shellmeta (character) && ((parser_state & PST_DBLPAREN) == 0)) + { +#if defined (ALIAS) + /* Turn off alias tokenization iff this character sequence would + not leave us ready to read a command. */ + if (character == '<' || character == '>') + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + parser_state &= ~PST_ASSIGNOK; + + peek_char = shell_getc (1); + if (character == peek_char) + { + switch (character) + { + case '<': + /* If '<' then we could be at "<<" or at "<<-". We have to + look ahead one more character. */ + peek_char = shell_getc (1); + if MBTEST(peek_char == '-') + return (LESS_LESS_MINUS); + else if MBTEST(peek_char == '<') + return (LESS_LESS_LESS); + else + { + shell_ungetc (peek_char); + return (LESS_LESS); + } + + case '>': + return (GREATER_GREATER); + + case ';': + parser_state |= PST_CASEPAT; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + + peek_char = shell_getc (1); + if MBTEST(peek_char == '&') + return (SEMI_SEMI_AND); + else + { + shell_ungetc (peek_char); + return (SEMI_SEMI); + } + + case '&': + return (AND_AND); + + case '|': + return (OR_OR); + +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) + case '(': /* ) */ + result = parse_dparen (character); + if (result == -2) + break; + else + return result; +#endif + } + } + else if MBTEST(character == '<' && peek_char == '&') + return (LESS_AND); + else if MBTEST(character == '>' && peek_char == '&') + return (GREATER_AND); + else if MBTEST(character == '<' && peek_char == '>') + return (LESS_GREATER); + else if MBTEST(character == '>' && peek_char == '|') + return (GREATER_BAR); + else if MBTEST(character == '&' && peek_char == '>') + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '>') + return (AND_GREATER_GREATER); + else + { + shell_ungetc (peek_char); + return (AND_GREATER); + } + } + else if MBTEST(character == '|' && peek_char == '&') + return (BAR_AND); + else if MBTEST(character == ';' && peek_char == '&') + { + parser_state |= PST_CASEPAT; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + return (SEMI_AND); + } + + shell_ungetc (peek_char); + + /* If we look like we are reading the start of a function + definition, then let the reader know about it so that + we will do the right thing with `{'. */ + if MBTEST(character == ')' && last_read_token == '(' && token_before_that == WORD) + { + parser_state |= PST_ALLOWOPNBRC; +#if defined (ALIAS) + parser_state &= ~PST_ALEXPNEXT; +#endif /* ALIAS */ + function_dstart = line_number; + } + + /* case pattern lists may be preceded by an optional left paren. If + we're not trying to parse a case pattern list, the left paren + indicates a subshell. */ + if MBTEST(character == '(' && (parser_state & PST_CASEPAT) == 0) /* ) */ + parser_state |= PST_SUBSHELL; + /*(*/ + else if MBTEST((parser_state & PST_CASEPAT) && character == ')') + parser_state &= ~PST_CASEPAT; + /*(*/ + else if MBTEST((parser_state & PST_SUBSHELL) && character == ')') + parser_state &= ~PST_SUBSHELL; + +#if defined (PROCESS_SUBSTITUTION) + /* Check for the constructs which introduce process substitution. + Shells running in `posix mode' don't do process substitution. */ + if MBTEST(posixly_correct || ((character != '>' && character != '<') || peek_char != '(')) /*)*/ +#endif /* PROCESS_SUBSTITUTION */ + return (character); + } + + /* Hack <&- (close stdin) case. Also <&N- (dup and close). */ + if MBTEST(character == '-' && (last_read_token == LESS_AND || last_read_token == GREATER_AND)) + return (character); + +tokword: + /* Okay, if we got this far, we have to read a word. Read one, + and then check it against the known ones. */ + result = read_token_word (character); +#if defined (ALIAS) + if (result == RE_READ_TOKEN) + goto re_read_token; +#endif + return result; +} + +/* + * Match a $(...) or other grouping construct. This has to handle embedded + * quoted strings ('', ``, "") and nested constructs. It also must handle + * reprompting the user, if necessary, after reading a newline, and returning + * correct error values if it reads EOF. + */ +#define P_FIRSTCLOSE 0x0001 +#define P_ALLOWESC 0x0002 +#define P_DQUOTE 0x0004 +#define P_COMMAND 0x0008 /* parsing a command, so look for comments */ +#define P_BACKQUOTE 0x0010 /* parsing a backquoted command substitution */ +#define P_ARRAYSUB 0x0020 /* parsing a [...] array subscript for assignment */ +#define P_DOLBRACE 0x0040 /* parsing a ${...} construct */ + +/* Lexical state while parsing a grouping construct or $(...). */ +#define LEX_WASDOL 0x001 +#define LEX_CKCOMMENT 0x002 +#define LEX_INCOMMENT 0x004 +#define LEX_PASSNEXT 0x008 +#define LEX_RESWDOK 0x010 +#define LEX_CKCASE 0x020 +#define LEX_INCASE 0x040 +#define LEX_INHEREDOC 0x080 +#define LEX_HEREDELIM 0x100 /* reading here-doc delimiter */ +#define LEX_STRIPDOC 0x200 /* <<- strip tabs from here doc delim */ +#define LEX_INWORD 0x400 + +#define COMSUB_META(ch) ((ch) == ';' || (ch) == '&' || (ch) == '|') + +#define CHECK_NESTRET_ERROR() \ + do { \ + if (nestret == &matched_pair_error) \ + { \ + free (ret); \ + return &matched_pair_error; \ + } \ + } while (0) + +#define APPEND_NESTRET() \ + do { \ + if (nestlen) \ + { \ + RESIZE_MALLOCED_BUFFER (ret, retind, nestlen, retsize, 64); \ + strcpy (ret + retind, nestret); \ + retind += nestlen; \ + } \ + } while (0) + +static char matched_pair_error; + +static char * +parse_matched_pair (qc, open, close, lenp, flags) + int qc; /* `"' if this construct is within double quotes */ + int open, close; + int *lenp, flags; +{ + int count, ch, tflags; + int nestlen, ttranslen, start_lineno; + char *ret, *nestret, *ttrans; + int retind, retsize, rflags; + int dolbrace_state; + + dolbrace_state = (flags & P_DOLBRACE) ? DOLBRACE_PARAM : 0; + +/*itrace("parse_matched_pair[%d]: open = %c close = %c flags = %d", line_number, open, close, flags);*/ + count = 1; + tflags = 0; + + if ((flags & P_COMMAND) && qc != '`' && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0) + tflags |= LEX_CKCOMMENT; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ + rflags = (qc == '"') ? P_DQUOTE : (flags & P_DQUOTE); + + ret = (char *)xmalloc (retsize = 64); + retind = 0; + + start_lineno = line_number; + while (count) + { + ch = shell_getc (qc != '\'' && (tflags & (LEX_PASSNEXT)) == 0); + + if (ch == EOF) + { + free (ret); + parser_error (start_lineno, _("unexpected EOF while looking for matching `%c'"), close); + EOF_Reached = 1; /* XXX */ + return (&matched_pair_error); + } + + /* Possible reprompting. */ + if (ch == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* Don't bother counting parens or doing anything else if in a comment + or part of a case statement */ + if (tflags & LEX_INCOMMENT) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + if (ch == '\n') + tflags &= ~LEX_INCOMMENT; + + continue; + } + + /* Not exactly right yet, should handle shell metacharacters, too. If + any changes are made to this test, make analogous changes to subst.c: + extract_delimited_string(). */ + else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || shellblank (ret[retind - 1]))) + tflags |= LEX_INCOMMENT; + + if (tflags & LEX_PASSNEXT) /* last char was backslash */ + { + tflags &= ~LEX_PASSNEXT; + if (qc != '\'' && ch == '\n') /* double-quoted \ disappears. */ + { + if (retind > 0) + retind--; /* swallow previously-added backslash */ + continue; + } + + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + if MBTEST(ch == CTLESC) + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + /* If we're reparsing the input (e.g., from parse_string_to_word_list), + we've already prepended CTLESC to single-quoted results of $'...'. + We may want to do this for other CTLESC-quoted characters in + reparse, too. */ + else if MBTEST((parser_state & PST_REPARSE) && open == '\'' && (ch == CTLESC || ch == CTLNUL)) + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + continue; + } + else if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + else if MBTEST(ch == close) /* ending delimiter */ + count--; + /* handle nested ${...} specially. */ + else if MBTEST(open != close && (tflags & LEX_WASDOL) && open == '{' && ch == open) /* } */ + count++; + else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && ch == open) /* nested begin */ + count++; + + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + /* If we just read the ending character, don't bother continuing. */ + if (count == 0) + break; + + if (open == '\'') /* '' inside grouping construct */ + { + if MBTEST((flags & P_ALLOWESC) && ch == '\\') + tflags |= LEX_PASSNEXT; + continue; + } + + if MBTEST(ch == '\\') /* backslashes */ + tflags |= LEX_PASSNEXT; + + /* Based on which dolstate is currently in (param, op, or word), + decide what the op is. We're really only concerned if it's % or + #, so we can turn on a flag that says whether or not we should + treat single quotes as special when inside a double-quoted + ${...}. This logic must agree with subst.c:extract_dollar_brace_string + since they share the same defines. */ + /* FLAG POSIX INTERP 221 */ + if (flags & P_DOLBRACE) + { + /* ${param%[%]word} */ + if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '%' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param#[#]word} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '#' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param/[/]pat/rep} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '/' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE2; /* XXX */ + /* ${param^[^]pat} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '^' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + /* ${param,[,]pat} */ + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == ',' && retind > 1) + dolbrace_state = DOLBRACE_QUOTE; + else if MBTEST(dolbrace_state == DOLBRACE_PARAM && strchr ("#%^,~:-=?+/", ch) != 0) + dolbrace_state = DOLBRACE_OP; + else if MBTEST(dolbrace_state == DOLBRACE_OP && strchr ("#%^,~:-=?+/", ch) == 0) + dolbrace_state = DOLBRACE_WORD; + } + + /* The big hammer. Single quotes aren't special in double quotes. The + problem is that Posix used to say the single quotes are semi-special: + within a double-quoted ${...} construct "an even number of + unescaped double-quotes or single-quotes, if any, shall occur." */ + /* This was changed in Austin Group Interp 221 */ + if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'') + continue; + + /* Could also check open == '`' if we want to parse grouping constructs + inside old-style command substitution. */ + if (open != close) /* a grouping construct */ + { + if MBTEST(shellquote (ch)) + { + /* '', ``, or "" inside $(...) or other grouping construct. */ + push_delimiter (dstack, ch); + if MBTEST((tflags & LEX_WASDOL) && ch == '\'') /* $'...' inside group */ + nestret = parse_matched_pair (ch, ch, ch, &nestlen, P_ALLOWESC|rflags); + else + nestret = parse_matched_pair (ch, ch, ch, &nestlen, rflags); + pop_delimiter (dstack); + CHECK_NESTRET_ERROR (); + + if MBTEST((tflags & LEX_WASDOL) && ch == '\'' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Translate $'...' here. */ + ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen); + xfree (nestret); + + /* If we're parsing a double-quoted brace expansion and we are + not in a place where single quotes are treated specially, + make sure we single-quote the results of the ansi + expansion because quote removal should remove them later */ + /* FLAG POSIX INTERP 221 */ + if ((shell_compatibility_level > 42) && (rflags & P_DQUOTE) && (dolbrace_state == DOLBRACE_QUOTE2) && (flags & P_DOLBRACE)) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else if ((rflags & P_DQUOTE) == 0) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else + { + nestret = ttrans; + nestlen = ttranslen; + } + retind -= 2; /* back up before the $' */ + } + else if MBTEST((tflags & LEX_WASDOL) && ch == '"' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Locale expand $"..." here. */ + ttrans = localeexpand (nestret, 0, nestlen - 1, start_lineno, &ttranslen); + xfree (nestret); + + nestret = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + nestlen = ttranslen + 2; + retind -= 2; /* back up before the $" */ + } + + APPEND_NESTRET (); + FREE (nestret); + } + else if ((flags & P_ARRAYSUB) && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + goto parse_dollar_word; + } + /* Parse an old-style command substitution within double quotes as a + single word. */ + /* XXX - sh and ksh93 don't do this - XXX */ + else if MBTEST(open == '"' && ch == '`') + { + nestret = parse_matched_pair (0, '`', '`', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + else if MBTEST(open != '`' && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + /* check for $(), $[], or ${} inside quoted string. */ + { +parse_dollar_word: + if (open == ch) /* undo previous increment */ + count--; + if (ch == '(') /* ) */ + nestret = parse_comsub (0, '(', ')', &nestlen, (rflags|P_COMMAND) & ~P_DQUOTE); + else if (ch == '{') /* } */ + nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|P_DOLBRACE|rflags); + else if (ch == '[') /* ] */ + nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + if MBTEST(ch == '$') + tflags |= LEX_WASDOL; + else + tflags &= ~LEX_WASDOL; + } + + ret[retind] = '\0'; + if (lenp) + *lenp = retind; +/*itrace("parse_matched_pair[%d]: returning %s", line_number, ret);*/ + return ret; +} + +/* Parse a $(...) command substitution. This is messier than I'd like, and + reproduces a lot more of the token-reading code than I'd like. */ +static char * +parse_comsub (qc, open, close, lenp, flags) + int qc; /* `"' if this construct is within double quotes */ + int open, close; + int *lenp, flags; +{ + int count, ch, peekc, tflags, lex_rwlen, lex_wlen, lex_firstind; + int nestlen, ttranslen, start_lineno; + char *ret, *nestret, *ttrans, *heredelim; + int retind, retsize, rflags, hdlen; + + /* Posix interp 217 says arithmetic expressions have precedence, so + assume $(( introduces arithmetic expansion and parse accordingly. */ + peekc = shell_getc (0); + shell_ungetc (peekc); + if (peekc == '(') + return (parse_matched_pair (qc, open, close, lenp, 0)); + +/*itrace("parse_comsub: qc = `%c' open = %c close = %c", qc, open, close);*/ + count = 1; + tflags = LEX_RESWDOK; + + if ((flags & P_COMMAND) && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0) + tflags |= LEX_CKCASE; + if ((tflags & LEX_CKCASE) && (interactive == 0 || interactive_comments)) + tflags |= LEX_CKCOMMENT; + + /* RFLAGS is the set of flags we want to pass to recursive calls. */ + rflags = (flags & P_DQUOTE); + + ret = (char *)xmalloc (retsize = 64); + retind = 0; + + start_lineno = line_number; + lex_rwlen = lex_wlen = 0; + + heredelim = 0; + lex_firstind = -1; + + while (count) + { +comsub_readchar: + ch = shell_getc (qc != '\'' && (tflags & (LEX_INCOMMENT|LEX_PASSNEXT)) == 0); + + if (ch == EOF) + { +eof_error: + free (ret); + FREE (heredelim); + parser_error (start_lineno, _("unexpected EOF while looking for matching `%c'"), close); + EOF_Reached = 1; /* XXX */ + return (&matched_pair_error); + } + + /* If we hit the end of a line and are reading the contents of a here + document, and it's not the same line that the document starts on, + check for this line being the here doc delimiter. Otherwise, if + we're in a here document, mark the next character as the beginning + of a line. */ + if (ch == '\n') + { + if ((tflags & LEX_HEREDELIM) && heredelim) + { + tflags &= ~LEX_HEREDELIM; + tflags |= LEX_INHEREDOC; + lex_firstind = retind + 1; + } + else if (tflags & LEX_INHEREDOC) + { + int tind; + tind = lex_firstind; + while ((tflags & LEX_STRIPDOC) && ret[tind] == '\t') + tind++; + if (STREQN (ret + tind, heredelim, hdlen)) + { + tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC); +/*itrace("parse_comsub:%d: found here doc end `%s'", line_number, ret + tind);*/ + free (heredelim); + heredelim = 0; + lex_firstind = -1; + } + else + lex_firstind = retind + 1; + } + } + + /* Possible reprompting. */ + if (ch == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* XXX -- possibly allow here doc to be delimited by ending right + paren. */ + if ((tflags & LEX_INHEREDOC) && ch == close && count == 1) + { + int tind; +/*itrace("parse_comsub: in here doc, ch == close, retind - firstind = %d hdlen = %d retind = %d", retind-lex_firstind, hdlen, retind);*/ + tind = lex_firstind; + while ((tflags & LEX_STRIPDOC) && ret[tind] == '\t') + tind++; + if (retind-tind == hdlen && STREQN (ret + tind, heredelim, hdlen)) + { + tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC); +/*itrace("parse_comsub:%d: found here doc end `%s'", line_number, ret + tind);*/ + free (heredelim); + heredelim = 0; + lex_firstind = -1; + } + } + + /* Don't bother counting parens or doing anything else if in a comment */ + if (tflags & (LEX_INCOMMENT|LEX_INHEREDOC)) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + if ((tflags & LEX_INCOMMENT) && ch == '\n') + { +/*itrace("parse_comsub:%d: lex_incomment -> 0 ch = `%c'", line_number, ch);*/ + tflags &= ~LEX_INCOMMENT; + } + + continue; + } + + if (tflags & LEX_PASSNEXT) /* last char was backslash */ + { +/*itrace("parse_comsub:%d: lex_passnext -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + tflags &= ~LEX_PASSNEXT; + if (qc != '\'' && ch == '\n') /* double-quoted \ disappears. */ + { + if (retind > 0) + retind--; /* swallow previously-added backslash */ + continue; + } + + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + if MBTEST(ch == CTLESC) + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } + + /* If this is a shell break character, we are not in a word. If not, + we either start or continue a word. */ + if MBTEST(shellbreak (ch)) + { + tflags &= ~LEX_INWORD; +/*itrace("parse_comsub:%d: lex_inword -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + } + else + { + if (tflags & LEX_INWORD) + { + lex_wlen++; +/*itrace("parse_comsub:%d: lex_inword == 1 ch = `%c' lex_wlen = %d (%d)", line_number, ch, lex_wlen, __LINE__);*/ + } + else + { +/*itrace("parse_comsub:%d: lex_inword -> 1 ch = `%c' (%d)", line_number, ch, __LINE__);*/ + tflags |= LEX_INWORD; + lex_wlen = 0; + } + } + + /* Skip whitespace */ + if MBTEST(shellblank (ch) && (tflags & LEX_HEREDELIM) == 0 && lex_rwlen == 0) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + continue; + } + + /* Either we are looking for the start of the here-doc delimiter + (lex_firstind == -1) or we are reading one (lex_firstind >= 0). + If this character is a shell break character and we are reading + the delimiter, save it and note that we are now reading a here + document. If we've found the start of the delimiter, note it by + setting lex_firstind. Backslashes can quote shell metacharacters + in here-doc delimiters. */ + if (tflags & LEX_HEREDELIM) + { + if (lex_firstind == -1 && shellbreak (ch) == 0) + lex_firstind = retind; +#if 0 + else if (heredelim && (tflags & LEX_PASSNEXT) == 0 && ch == '\n') + { + tflags |= LEX_INHEREDOC; + tflags &= ~LEX_HEREDELIM; + lex_firstind = retind + 1; + } +#endif + else if (lex_firstind >= 0 && (tflags & LEX_PASSNEXT) == 0 && shellbreak (ch)) + { + if (heredelim == 0) + { + nestret = substring (ret, lex_firstind, retind); + heredelim = string_quote_removal (nestret, 0); + free (nestret); + hdlen = STRLEN(heredelim); +/*itrace("parse_comsub:%d: found here doc delimiter `%s' (%d)", line_number, heredelim, hdlen);*/ + } + if (ch == '\n') + { + tflags |= LEX_INHEREDOC; + tflags &= ~LEX_HEREDELIM; + lex_firstind = retind + 1; + } + else + lex_firstind = -1; + } + } + + /* Meta-characters that can introduce a reserved word. Not perfect yet. */ + if MBTEST((tflags & LEX_RESWDOK) == 0 && (tflags & LEX_CKCASE) && (tflags & LEX_INCOMMENT) == 0 && (shellmeta(ch) || ch == '\n')) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + peekc = shell_getc (1); + if (ch == peekc && (ch == '&' || ch == '|' || ch == ';')) /* two-character tokens */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; +/*itrace("parse_comsub:%d: set lex_reswordok = 1, ch = `%c'", line_number, ch);*/ + tflags |= LEX_RESWDOK; + lex_rwlen = 0; + continue; + } + else if (ch == '\n' || COMSUB_META(ch)) + { + shell_ungetc (peekc); +/*itrace("parse_comsub:%d: set lex_reswordok = 1, ch = `%c'", line_number, ch);*/ + tflags |= LEX_RESWDOK; + lex_rwlen = 0; + continue; + } + else if (ch == EOF) + goto eof_error; + else + { + /* `unget' the character we just added and fall through */ + retind--; + shell_ungetc (peekc); + } + } + + /* If we can read a reserved word, try to read one. */ + if (tflags & LEX_RESWDOK) + { + if MBTEST(islower (ch)) + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + lex_rwlen++; + continue; + } + else if MBTEST(lex_rwlen == 4 && shellbreak (ch)) + { + if (STREQN (ret + retind - 4, "case", 4)) + { + tflags |= LEX_INCASE; +/*itrace("parse_comsub:%d: found `case', lex_incase -> 1 lex_reswdok -> 0", line_number);*/ + } + else if (STREQN (ret + retind - 4, "esac", 4)) + { + tflags &= ~LEX_INCASE; +/*itrace("parse_comsub:%d: found `esac', lex_incase -> 0 lex_reswdok -> 0", line_number);*/ + } + tflags &= ~LEX_RESWDOK; + } + else if MBTEST((tflags & LEX_CKCOMMENT) && ch == '#' && (lex_rwlen == 0 || ((tflags & LEX_INWORD) && lex_wlen == 0))) + ; /* don't modify LEX_RESWDOK if we're starting a comment */ + /* Allow `do' followed by space, tab, or newline to preserve the + RESWDOK flag, but reset the reserved word length counter so we + can read another one. */ + else if MBTEST(((tflags & LEX_INCASE) == 0) && + (isblank(ch) || ch == '\n') && + lex_rwlen == 2 && + STREQN (ret + retind - 2, "do", 2)) + { +/*itrace("parse_comsub:%d: lex_incase == 1 found `%c', found \"do\"", line_number, ch);*/ + lex_rwlen = 0; + } + else if MBTEST((tflags & LEX_INCASE) && ch != '\n') + /* If we can read a reserved word and we're in case, we're at the + point where we can read a new pattern list or an esac. We + handle the esac case above. If we read a newline, we want to + leave LEX_RESWDOK alone. If we read anything else, we want to + turn off LEX_RESWDOK, since we're going to read a pattern list. */ + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: lex_incase == 1 found `%c', lex_reswordok -> 0", line_number, ch);*/ + } + else if MBTEST(shellbreak (ch) == 0) + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/ + } +#if 0 + /* If we find a space or tab but have read something and it's not + `do', turn off the reserved-word-ok flag */ + else if MBTEST(isblank (ch) && lex_rwlen > 0) + { + tflags &= ~LEX_RESWDOK; +/*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/ + } +#endif + } + + /* Might be the start of a here-doc delimiter */ + if MBTEST((tflags & LEX_INCOMMENT) == 0 && (tflags & LEX_CKCASE) && ch == '<') + { + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + peekc = shell_getc (1); + if (peekc == EOF) + goto eof_error; + if (peekc == ch) + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; + peekc = shell_getc (1); + if (peekc == EOF) + goto eof_error; + if (peekc == '-') + { + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = peekc; + tflags |= LEX_STRIPDOC; + } + else + shell_ungetc (peekc); + if (peekc != '<') + { + tflags |= LEX_HEREDELIM; + lex_firstind = -1; + } + continue; + } + else + ch = peekc; /* fall through and continue XXX */ + } + else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (((tflags & LEX_RESWDOK) && lex_rwlen == 0) || ((tflags & LEX_INWORD) && lex_wlen == 0))) + { +/*itrace("parse_comsub:%d: lex_incomment -> 1 (%d)", line_number, __LINE__);*/ + tflags |= LEX_INCOMMENT; + } + + if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */ + { + RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); + ret[retind++] = CTLESC; + ret[retind++] = ch; + continue; + } +#if 0 + else if MBTEST((tflags & LEX_INCASE) && ch == close && close == ')') + tflags &= ~LEX_INCASE; /* XXX */ +#endif + else if MBTEST(ch == close && (tflags & LEX_INCASE) == 0) /* ending delimiter */ + { + count--; +/*itrace("parse_comsub:%d: found close: count = %d", line_number, count);*/ + } + else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && (tflags & LEX_INCASE) == 0 && ch == open) /* nested begin */ + { + count++; +/*itrace("parse_comsub:%d: found open: count = %d", line_number, count);*/ + } + + /* Add this character. */ + RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64); + ret[retind++] = ch; + + /* If we just read the ending character, don't bother continuing. */ + if (count == 0) + break; + + if MBTEST(ch == '\\') /* backslashes */ + tflags |= LEX_PASSNEXT; + + if MBTEST(shellquote (ch)) + { + /* '', ``, or "" inside $(...). */ + push_delimiter (dstack, ch); + if MBTEST((tflags & LEX_WASDOL) && ch == '\'') /* $'...' inside group */ + nestret = parse_matched_pair (ch, ch, ch, &nestlen, P_ALLOWESC|rflags); + else + nestret = parse_matched_pair (ch, ch, ch, &nestlen, rflags); + pop_delimiter (dstack); + CHECK_NESTRET_ERROR (); + + if MBTEST((tflags & LEX_WASDOL) && ch == '\'' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Translate $'...' here. */ + ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen); + xfree (nestret); + + if ((rflags & P_DQUOTE) == 0) + { + nestret = sh_single_quote (ttrans); + free (ttrans); + nestlen = strlen (nestret); + } + else + { + nestret = ttrans; + nestlen = ttranslen; + } + retind -= 2; /* back up before the $' */ + } + else if MBTEST((tflags & LEX_WASDOL) && ch == '"' && (extended_quote || (rflags & P_DQUOTE) == 0)) + { + /* Locale expand $"..." here. */ + ttrans = localeexpand (nestret, 0, nestlen - 1, start_lineno, &ttranslen); + xfree (nestret); + + nestret = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + nestlen = ttranslen + 2; + retind -= 2; /* back up before the $" */ + } + + APPEND_NESTRET (); + FREE (nestret); + } + else if MBTEST((tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ + /* check for $(), $[], or ${} inside command substitution. */ + { + if ((tflags & LEX_INCASE) == 0 && open == ch) /* undo previous increment */ + count--; + if (ch == '(') /* ) */ + nestret = parse_comsub (0, '(', ')', &nestlen, (rflags|P_COMMAND) & ~P_DQUOTE); + else if (ch == '{') /* } */ + nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|P_DOLBRACE|rflags); + else if (ch == '[') /* ] */ + nestret = parse_matched_pair (0, '[', ']', &nestlen, rflags); + + CHECK_NESTRET_ERROR (); + APPEND_NESTRET (); + + FREE (nestret); + } + if MBTEST(ch == '$') + tflags |= LEX_WASDOL; + else + tflags &= ~LEX_WASDOL; + } + + FREE (heredelim); + ret[retind] = '\0'; + if (lenp) + *lenp = retind; +/*itrace("parse_comsub:%d: returning `%s'", line_number, ret);*/ + return ret; +} + +/* Recursively call the parser to parse a $(...) command substitution. */ +char * +xparse_dolparen (base, string, indp, flags) + char *base; + char *string; + int *indp; + int flags; +{ + sh_parser_state_t ps; + sh_input_line_state_t ls; + int orig_ind, nc, sflags, orig_eof_token; + char *ret, *s, *ep, *ostring; + + /*yydebug = 1;*/ + orig_ind = *indp; + ostring = string; + +/*itrace("xparse_dolparen: size = %d shell_input_line = `%s'", shell_input_line_size, shell_input_line);*/ + sflags = SEVAL_NONINT|SEVAL_NOHIST|SEVAL_NOFREE; + if (flags & SX_NOLONGJMP) + sflags |= SEVAL_NOLONGJMP; + save_parser_state (&ps); + save_input_line_state (&ls); + orig_eof_token = shell_eof_token; + + /*(*/ + parser_state |= PST_CMDSUBST|PST_EOFTOKEN; /* allow instant ')' */ /*(*/ + shell_eof_token = ')'; + parse_string (string, "command substitution", sflags, &ep); + + shell_eof_token = orig_eof_token; + restore_parser_state (&ps); + reset_parser (); + /* reset_parser clears shell_input_line and associated variables */ + restore_input_line_state (&ls); + if (interactive) + token_to_read = 0; + + /* Need to find how many characters parse_and_execute consumed, update + *indp, if flags != 0, copy the portion of the string parsed into RET + and return it. If flags & 1 (EX_NOALLOC) we can return NULL. */ + + /*(*/ + if (ep[-1] != ')') + { +#if DEBUG + if (ep[-1] != '\n') + itrace("xparse_dolparen:%d: ep[-1] != RPAREN (%d), ep = `%s'", line_number, ep[-1], ep); +#endif + while (ep > ostring && ep[-1] == '\n') ep--; + } + + nc = ep - ostring; + *indp = ep - base - 1; + + /*(*/ +#if DEBUG + if (base[*indp] != ')') + itrace("xparse_dolparen:%d: base[%d] != RPAREN (%d), base = `%s'", line_number, *indp, base[*indp], base); +#endif + + if (flags & SX_NOALLOC) + return (char *)NULL; + + if (nc == 0) + { + ret = xmalloc (1); + ret[0] = '\0'; + } + else + ret = substring (ostring, 0, nc - 1); + + return ret; +} + +#if defined (DPAREN_ARITHMETIC) || defined (ARITH_FOR_COMMAND) +/* Parse a double-paren construct. It can be either an arithmetic + command, an arithmetic `for' command, or a nested subshell. Returns + the parsed token, -1 on error, or -2 if we didn't do anything and + should just go on. */ +static int +parse_dparen (c) + int c; +{ + int cmdtyp, sline; + char *wval; + WORD_DESC *wd; + +#if defined (ARITH_FOR_COMMAND) + if (last_read_token == FOR) + { + arith_for_lineno = line_number; + cmdtyp = parse_arith_cmd (&wval, 0); + if (cmdtyp == 1) + { + wd = alloc_word_desc (); + wd->word = wval; + yylval.word_list = make_word_list (wd, (WORD_LIST *)NULL); + return (ARITH_FOR_EXPRS); + } + else + return -1; /* ERROR */ + } +#endif + +#if defined (DPAREN_ARITHMETIC) + if (reserved_word_acceptable (last_read_token)) + { + sline = line_number; + + cmdtyp = parse_arith_cmd (&wval, 0); + if (cmdtyp == 1) /* arithmetic command */ + { + wd = alloc_word_desc (); + wd->word = wval; + wd->flags = W_QUOTED|W_NOSPLIT|W_NOGLOB|W_DQUOTE; + yylval.word_list = make_word_list (wd, (WORD_LIST *)NULL); + return (ARITH_CMD); + } + else if (cmdtyp == 0) /* nested subshell */ + { + push_string (wval, 0, (alias_t *)NULL); + pushed_string_list->flags = PSH_DPAREN; + if ((parser_state & PST_CASEPAT) == 0) + parser_state |= PST_SUBSHELL; + return (c); + } + else /* ERROR */ + return -1; + } +#endif + + return -2; /* XXX */ +} + +/* We've seen a `(('. Look for the matching `))'. If we get it, return 1. + If not, assume it's a nested subshell for backwards compatibility and + return 0. In any case, put the characters we've consumed into a locally- + allocated buffer and make *ep point to that buffer. Return -1 on an + error, for example EOF. */ +static int +parse_arith_cmd (ep, adddq) + char **ep; + int adddq; +{ + int exp_lineno, rval, c; + char *ttok, *tokstr; + int ttoklen; + + exp_lineno = line_number; + ttok = parse_matched_pair (0, '(', ')', &ttoklen, 0); + rval = 1; + if (ttok == &matched_pair_error) + return -1; + /* Check that the next character is the closing right paren. If + not, this is a syntax error. ( */ + c = shell_getc (0); + if MBTEST(c != ')') + rval = 0; + + tokstr = (char *)xmalloc (ttoklen + 4); + + /* if ADDDQ != 0 then (( ... )) -> "..." */ + if (rval == 1 && adddq) /* arith cmd, add double quotes */ + { + tokstr[0] = '"'; + strncpy (tokstr + 1, ttok, ttoklen - 1); + tokstr[ttoklen] = '"'; + tokstr[ttoklen+1] = '\0'; + } + else if (rval == 1) /* arith cmd, don't add double quotes */ + { + strncpy (tokstr, ttok, ttoklen - 1); + tokstr[ttoklen-1] = '\0'; + } + else /* nested subshell */ + { + tokstr[0] = '('; + strncpy (tokstr + 1, ttok, ttoklen - 1); + tokstr[ttoklen] = ')'; + tokstr[ttoklen+1] = c; + tokstr[ttoklen+2] = '\0'; + } + + *ep = tokstr; + FREE (ttok); + return rval; +} +#endif /* DPAREN_ARITHMETIC || ARITH_FOR_COMMAND */ + +#if defined (COND_COMMAND) +static void +cond_error () +{ + char *etext; + + if (EOF_Reached && cond_token != COND_ERROR) /* [[ */ + parser_error (cond_lineno, _("unexpected EOF while looking for `]]'")); + else if (cond_token != COND_ERROR) + { + if (etext = error_token_from_token (cond_token)) + { + parser_error (cond_lineno, _("syntax error in conditional expression: unexpected token `%s'"), etext); + free (etext); + } + else + parser_error (cond_lineno, _("syntax error in conditional expression")); + } +} + +static COND_COM * +cond_expr () +{ + return (cond_or ()); +} + +static COND_COM * +cond_or () +{ + COND_COM *l, *r; + + l = cond_and (); + if (cond_token == OR_OR) + { + r = cond_or (); + l = make_cond_node (COND_OR, (WORD_DESC *)NULL, l, r); + } + return l; +} + +static COND_COM * +cond_and () +{ + COND_COM *l, *r; + + l = cond_term (); + if (cond_token == AND_AND) + { + r = cond_and (); + l = make_cond_node (COND_AND, (WORD_DESC *)NULL, l, r); + } + return l; +} + +static int +cond_skip_newlines () +{ + while ((cond_token = read_token (READ)) == '\n') + { + if (SHOULD_PROMPT ()) + prompt_again (); + } + return (cond_token); +} + +#define COND_RETURN_ERROR() \ + do { cond_token = COND_ERROR; return ((COND_COM *)NULL); } while (0) + +static COND_COM * +cond_term () +{ + WORD_DESC *op; + COND_COM *term, *tleft, *tright; + int tok, lineno; + char *etext; + + /* Read a token. It can be a left paren, a `!', a unary operator, or a + word that should be the first argument of a binary operator. Start by + skipping newlines, since this is a compound command. */ + tok = cond_skip_newlines (); + lineno = line_number; + if (tok == COND_END) + { + COND_RETURN_ERROR (); + } + else if (tok == '(') + { + term = cond_expr (); + if (cond_token != ')') + { + if (term) + dispose_cond_node (term); /* ( */ + if (etext = error_token_from_token (cond_token)) + { + parser_error (lineno, _("unexpected token `%s', expected `)'"), etext); + free (etext); + } + else + parser_error (lineno, _("expected `)'")); + COND_RETURN_ERROR (); + } + term = make_cond_node (COND_EXPR, (WORD_DESC *)NULL, term, (COND_COM *)NULL); + (void)cond_skip_newlines (); + } + else if (tok == BANG || (tok == WORD && (yylval.word->word[0] == '!' && yylval.word->word[1] == '\0'))) + { + if (tok == WORD) + dispose_word (yylval.word); /* not needed */ + term = cond_term (); + if (term) + term->flags |= CMD_INVERT_RETURN; + } + else if (tok == WORD && yylval.word->word[0] == '-' && yylval.word->word[2] == 0 && test_unop (yylval.word->word)) + { + op = yylval.word; + tok = read_token (READ); + if (tok == WORD) + { + tleft = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + term = make_cond_node (COND_UNARY, op, tleft, (COND_COM *)NULL); + } + else + { + dispose_word (op); + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected argument `%s' to conditional unary operator"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected argument to conditional unary operator")); + COND_RETURN_ERROR (); + } + + (void)cond_skip_newlines (); + } + else if (tok == WORD) /* left argument to binary operator */ + { + /* lhs */ + tleft = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + + /* binop */ + tok = read_token (READ); + if (tok == WORD && test_binop (yylval.word->word)) + { + op = yylval.word; + if (op->word[0] == '=' && (op->word[1] == '\0' || (op->word[1] == '=' && op->word[2] == '\0'))) + parser_state |= PST_EXTPAT; + else if (op->word[0] == '!' && op->word[1] == '=' && op->word[2] == '\0') + parser_state |= PST_EXTPAT; + } +#if defined (COND_REGEXP) + else if (tok == WORD && STREQ (yylval.word->word, "=~")) + { + op = yylval.word; + parser_state |= PST_REGEXP; + } +#endif + else if (tok == '<' || tok == '>') + op = make_word_from_token (tok); /* ( */ + /* There should be a check before blindly accepting the `)' that we have + seen the opening `('. */ + else if (tok == COND_END || tok == AND_AND || tok == OR_OR || tok == ')') + { + /* Special case. [[ x ]] is equivalent to [[ -n x ]], just like + the test command. Similarly for [[ x && expr ]] or + [[ x || expr ]] or [[ (x) ]]. */ + op = make_word ("-n"); + term = make_cond_node (COND_UNARY, op, tleft, (COND_COM *)NULL); + cond_token = tok; + return (term); + } + else + { + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected token `%s', conditional binary operator expected"), etext); + free (etext); + } + else + parser_error (line_number, _("conditional binary operator expected")); + dispose_cond_node (tleft); + COND_RETURN_ERROR (); + } + + /* rhs */ + if (parser_state & PST_EXTPAT) + extended_glob = 1; + tok = read_token (READ); + if (parser_state & PST_EXTPAT) + extended_glob = global_extglob; + parser_state &= ~(PST_REGEXP|PST_EXTPAT); + + if (tok == WORD) + { + tright = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); + term = make_cond_node (COND_BINARY, op, tleft, tright); + } + else + { + if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected argument `%s' to conditional binary operator"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected argument to conditional binary operator")); + dispose_cond_node (tleft); + dispose_word (op); + COND_RETURN_ERROR (); + } + + (void)cond_skip_newlines (); + } + else + { + if (tok < 256) + parser_error (line_number, _("unexpected token `%c' in conditional command"), tok); + else if (etext = error_token_from_token (tok)) + { + parser_error (line_number, _("unexpected token `%s' in conditional command"), etext); + free (etext); + } + else + parser_error (line_number, _("unexpected token %d in conditional command"), tok); + COND_RETURN_ERROR (); + } + return (term); +} + +/* This is kind of bogus -- we slip a mini recursive-descent parser in + here to handle the conditional statement syntax. */ +static COMMAND * +parse_cond_command () +{ + COND_COM *cexp; + + global_extglob = extended_glob; + cexp = cond_expr (); + return (make_cond_command (cexp)); +} +#endif + +#if defined (ARRAY_VARS) +/* When this is called, it's guaranteed that we don't care about anything + in t beyond i. We do save and restore the chars, though. */ +static int +token_is_assignment (t, i) + char *t; + int i; +{ + unsigned char c, c1; + int r; + + c = t[i]; c1 = t[i+1]; + t[i] = '='; t[i+1] = '\0'; + r = assignment (t, (parser_state & PST_COMPASSIGN) != 0); + t[i] = c; t[i+1] = c1; + return r; +} + +/* XXX - possible changes here for `+=' */ +static int +token_is_ident (t, i) + char *t; + int i; +{ + unsigned char c; + int r; + + c = t[i]; + t[i] = '\0'; + r = legal_identifier (t); + t[i] = c; + return r; +} +#endif + +static int +read_token_word (character) + int character; +{ + /* The value for YYLVAL when a WORD is read. */ + WORD_DESC *the_word; + + /* Index into the token that we are building. */ + int token_index; + + /* ALL_DIGITS becomes zero when we see a non-digit. */ + int all_digit_token; + + /* DOLLAR_PRESENT becomes non-zero if we see a `$'. */ + int dollar_present; + + /* COMPOUND_ASSIGNMENT becomes non-zero if we are parsing a compound + assignment. */ + int compound_assignment; + + /* QUOTED becomes non-zero if we see one of ("), ('), (`), or (\). */ + int quoted; + + /* Non-zero means to ignore the value of the next character, and just + to add it no matter what. */ + int pass_next_character; + + /* The current delimiting character. */ + int cd; + int result, peek_char; + char *ttok, *ttrans; + int ttoklen, ttranslen; + intmax_t lvalue; + + if (token_buffer_size < TOKEN_DEFAULT_INITIAL_SIZE) + token = (char *)xrealloc (token, token_buffer_size = TOKEN_DEFAULT_INITIAL_SIZE); + + token_index = 0; + all_digit_token = DIGIT (character); + dollar_present = quoted = pass_next_character = compound_assignment = 0; + + for (;;) + { + if (character == EOF) + goto got_token; + + if (pass_next_character) + { + pass_next_character = 0; + goto got_escaped_character; + } + + cd = current_delimiter (dstack); + + /* Handle backslashes. Quote lots of things when not inside of + double-quotes, quote some things inside of double-quotes. */ + if MBTEST(character == '\\') + { + peek_char = shell_getc (0); + + /* Backslash-newline is ignored in all cases except + when quoted with single quotes. */ + if (peek_char == '\n') + { + character = '\n'; + goto next_character; + } + else + { + shell_ungetc (peek_char); + + /* If the next character is to be quoted, note it now. */ + if (cd == 0 || cd == '`' || + (cd == '"' && peek_char >= 0 && (sh_syntaxtab[peek_char] & CBSDQUOTE))) + pass_next_character++; + + quoted = 1; + goto got_character; + } + } + + /* Parse a matched pair of quote characters. */ + if MBTEST(shellquote (character)) + { + push_delimiter (dstack, character); + ttok = parse_matched_pair (character, character, character, &ttoklen, (character == '`') ? P_COMMAND : 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + all_digit_token = 0; + quoted = 1; + dollar_present |= (character == '"' && strchr (ttok, '$') != 0); + FREE (ttok); + goto next_character; + } + +#ifdef COND_REGEXP + /* When parsing a regexp as a single word inside a conditional command, + we need to special-case characters special to both the shell and + regular expressions. Right now, that is only '(' and '|'. */ /*)*/ + if MBTEST((parser_state & PST_REGEXP) && (character == '(' || character == '|')) /*)*/ + { + if (character == '|') + goto got_character; + + push_delimiter (dstack, character); + ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = all_digit_token = 0; + goto next_character; + } +#endif /* COND_REGEXP */ + +#ifdef EXTENDED_GLOB + /* Parse a ksh-style extended pattern matching specification. */ + if MBTEST(extended_glob && PATTERN_CHAR (character)) + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '(') /* ) */ + { + push_delimiter (dstack, peek_char); + ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + token[token_index++] = peek_char; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = all_digit_token = 0; + goto next_character; + } + else + shell_ungetc (peek_char); + } +#endif /* EXTENDED_GLOB */ + + /* If the delimiter character is not single quote, parse some of + the shell expansions that must be read as a single word. */ + if (shellexp (character)) + { + peek_char = shell_getc (1); + /* $(...), <(...), >(...), $((...)), ${...}, and $[...] constructs */ + if MBTEST(peek_char == '(' || + ((peek_char == '{' || peek_char == '[') && character == '$')) /* ) ] } */ + { + if (peek_char == '{') /* } */ + ttok = parse_matched_pair (cd, '{', '}', &ttoklen, P_FIRSTCLOSE|P_DOLBRACE); + else if (peek_char == '(') /* ) */ + { + /* XXX - push and pop the `(' as a delimiter for use by + the command-oriented-history code. This way newlines + appearing in the $(...) string get added to the + history literally rather than causing a possibly- + incorrect `;' to be added. ) */ + push_delimiter (dstack, peek_char); + ttok = parse_comsub (cd, '(', ')', &ttoklen, P_COMMAND); + pop_delimiter (dstack); + } + else + ttok = parse_matched_pair (cd, '[', ']', &ttoklen, 0); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + token[token_index++] = peek_char; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + dollar_present = 1; + all_digit_token = 0; + goto next_character; + } + /* This handles $'...' and $"..." new-style quoted strings. */ + else if MBTEST(character == '$' && (peek_char == '\'' || peek_char == '"')) + { + int first_line; + + first_line = line_number; + push_delimiter (dstack, peek_char); + ttok = parse_matched_pair (peek_char, peek_char, peek_char, + &ttoklen, + (peek_char == '\'') ? P_ALLOWESC : 0); + pop_delimiter (dstack); + if (ttok == &matched_pair_error) + return -1; + if (peek_char == '\'') + { + ttrans = ansiexpand (ttok, 0, ttoklen - 1, &ttranslen); + free (ttok); + + /* Insert the single quotes and correctly quote any + embedded single quotes (allowed because P_ALLOWESC was + passed to parse_matched_pair). */ + ttok = sh_single_quote (ttrans); + free (ttrans); + ttranslen = strlen (ttok); + ttrans = ttok; + } + else + { + /* Try to locale-expand the converted string. */ + ttrans = localeexpand (ttok, 0, ttoklen - 1, first_line, &ttranslen); + free (ttok); + + /* Add the double quotes back */ + ttok = sh_mkdoublequoted (ttrans, ttranslen, 0); + free (ttrans); + ttranslen += 2; + ttrans = ttok; + } + + RESIZE_MALLOCED_BUFFER (token, token_index, ttranslen + 1, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + strcpy (token + token_index, ttrans); + token_index += ttranslen; + FREE (ttrans); + quoted = 1; + all_digit_token = 0; + goto next_character; + } + /* This could eventually be extended to recognize all of the + shell's single-character parameter expansions, and set flags.*/ + else if MBTEST(character == '$' && peek_char == '$') + { + RESIZE_MALLOCED_BUFFER (token, token_index, 3, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = '$'; + token[token_index++] = peek_char; + dollar_present = 1; + all_digit_token = 0; + goto next_character; + } + else + shell_ungetc (peek_char); + } + +#if defined (ARRAY_VARS) + /* Identify possible array subscript assignment; match [...]. If + parser_state&PST_COMPASSIGN, we need to parse [sub]=words treating + `sub' as if it were enclosed in double quotes. */ + else if MBTEST(character == '[' && /* ] */ + ((token_index > 0 && assignment_acceptable (last_read_token) && token_is_ident (token, token_index)) || + (token_index == 0 && (parser_state&PST_COMPASSIGN)))) + { + ttok = parse_matched_pair (cd, '[', ']', &ttoklen, P_ARRAYSUB); + if (ttok == &matched_pair_error) + return -1; /* Bail immediately. */ + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = character; + strcpy (token + token_index, ttok); + token_index += ttoklen; + FREE (ttok); + all_digit_token = 0; + goto next_character; + } + /* Identify possible compound array variable assignment. */ + else if MBTEST(character == '=' && token_index > 0 && (assignment_acceptable (last_read_token) || (parser_state & PST_ASSIGNOK)) && token_is_assignment (token, token_index)) + { + peek_char = shell_getc (1); + if MBTEST(peek_char == '(') /* ) */ + { + ttok = parse_compound_assignment (&ttoklen); + + RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 4, + token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + + token[token_index++] = '='; + token[token_index++] = '('; + if (ttok) + { + strcpy (token + token_index, ttok); + token_index += ttoklen; + } + token[token_index++] = ')'; + FREE (ttok); + all_digit_token = 0; + compound_assignment = 1; +#if 1 + goto next_character; +#else + goto got_token; /* ksh93 seems to do this */ +#endif + } + else + shell_ungetc (peek_char); + } +#endif + + /* When not parsing a multi-character word construct, shell meta- + characters break words. */ + if MBTEST(shellbreak (character)) + { + shell_ungetc (character); + goto got_token; + } + +got_character: + + if (character == CTLESC || character == CTLNUL) + { + RESIZE_MALLOCED_BUFFER (token, token_index, 2, token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + token[token_index++] = CTLESC; + } + else +got_escaped_character: + RESIZE_MALLOCED_BUFFER (token, token_index, 1, token_buffer_size, + TOKEN_DEFAULT_GROW_SIZE); + + token[token_index++] = character; + + all_digit_token &= DIGIT (character); + dollar_present |= character == '$'; + + next_character: + if (character == '\n' && SHOULD_PROMPT ()) + prompt_again (); + + /* We want to remove quoted newlines (that is, a \ pair) + unless we are within single quotes or pass_next_character is + set (the shell equivalent of literal-next). */ + cd = current_delimiter (dstack); + character = shell_getc (cd != '\'' && pass_next_character == 0); + } /* end for (;;) */ + +got_token: + + /* Calls to RESIZE_MALLOCED_BUFFER ensure there is sufficient room. */ + token[token_index] = '\0'; + + /* Check to see what thing we should return. If the last_read_token + is a `<', or a `&', or the character which ended this token is + a '>' or '<', then, and ONLY then, is this input token a NUMBER. + Otherwise, it is just a word, and should be returned as such. */ + if MBTEST(all_digit_token && (character == '<' || character == '>' || + last_read_token == LESS_AND || + last_read_token == GREATER_AND)) + { + if (legal_number (token, &lvalue) && (int)lvalue == lvalue) + { + yylval.number = lvalue; + return (NUMBER); + } + } + + /* Check for special case tokens. */ + result = (last_shell_getc_is_singlebyte) ? special_case_tokens (token) : -1; + if (result >= 0) + return result; + +#if defined (ALIAS) + /* Posix.2 does not allow reserved words to be aliased, so check for all + of them, including special cases, before expanding the current token + as an alias. */ + if MBTEST(posixly_correct) + CHECK_FOR_RESERVED_WORD (token); + + /* Aliases are expanded iff EXPAND_ALIASES is non-zero, and quoting + inhibits alias expansion. */ + if (expand_aliases && quoted == 0) + { + result = alias_expand_token (token); + if (result == RE_READ_TOKEN) + return (RE_READ_TOKEN); + else if (result == NO_EXPANSION) + parser_state &= ~PST_ALEXPNEXT; + } + + /* If not in Posix.2 mode, check for reserved words after alias + expansion. */ + if MBTEST(posixly_correct == 0) +#endif + CHECK_FOR_RESERVED_WORD (token); + + the_word = (WORD_DESC *)xmalloc (sizeof (WORD_DESC)); + the_word->word = (char *)xmalloc (1 + token_index); + the_word->flags = 0; + strcpy (the_word->word, token); + if (dollar_present) + the_word->flags |= W_HASDOLLAR; + if (quoted) + the_word->flags |= W_QUOTED; /*(*/ + if (compound_assignment && token[token_index-1] == ')') + the_word->flags |= W_COMPASSIGN; + /* A word is an assignment if it appears at the beginning of a + simple command, or after another assignment word. This is + context-dependent, so it cannot be handled in the grammar. */ + if (assignment (token, (parser_state & PST_COMPASSIGN) != 0)) + { + the_word->flags |= W_ASSIGNMENT; + /* Don't perform word splitting on assignment statements. */ + if (assignment_acceptable (last_read_token) || (parser_state & PST_COMPASSIGN) != 0) + { + the_word->flags |= W_NOSPLIT; + if (parser_state & PST_COMPASSIGN) + the_word->flags |= W_NOGLOB; /* XXX - W_NOBRACE? */ + } + } + + if (command_token_position (last_read_token)) + { + struct builtin *b; + b = builtin_address_internal (token, 0); + if (b && (b->flags & ASSIGNMENT_BUILTIN)) + parser_state |= PST_ASSIGNOK; + else if (STREQ (token, "eval") || STREQ (token, "let")) + parser_state |= PST_ASSIGNOK; + } + + yylval.word = the_word; + + if (token[0] == '{' && token[token_index-1] == '}' && + (character == '<' || character == '>')) + { + /* can use token; already copied to the_word */ + token[token_index-1] = '\0'; +#if defined (ARRAY_VARS) + if (legal_identifier (token+1) || valid_array_reference (token+1)) +#else + if (legal_identifier (token+1)) +#endif + { + strcpy (the_word->word, token+1); +/*itrace("read_token_word: returning REDIR_WORD for %s", the_word->word);*/ + return (REDIR_WORD); + } + } + + result = ((the_word->flags & (W_ASSIGNMENT|W_NOSPLIT)) == (W_ASSIGNMENT|W_NOSPLIT)) + ? ASSIGNMENT_WORD : WORD; + + switch (last_read_token) + { + case FUNCTION: + parser_state |= PST_ALLOWOPNBRC; + function_dstart = line_number; + break; + case CASE: + case SELECT: + case FOR: + if (word_top < MAX_CASE_NEST) + word_top++; + word_lineno[word_top] = line_number; + break; + } + + return (result); +} + +/* Return 1 if TOKSYM is a token that after being read would allow + a reserved word to be seen, else 0. */ +static int +reserved_word_acceptable (toksym) + int toksym; +{ + switch (toksym) + { + case '\n': + case ';': + case '(': + case ')': + case '|': + case '&': + case '{': + case '}': /* XXX */ + case AND_AND: + case BANG: + case BAR_AND: + case DO: + case DONE: + case ELIF: + case ELSE: + case ESAC: + case FI: + case IF: + case OR_OR: + case SEMI_SEMI: + case SEMI_AND: + case SEMI_SEMI_AND: + case THEN: + case TIME: + case TIMEOPT: + case TIMEIGN: + case COPROC: + case UNTIL: + case WHILE: + case 0: + return 1; + default: +#if defined (COPROCESS_SUPPORT) + if (last_read_token == WORD && token_before_that == COPROC) + return 1; +#endif + if (last_read_token == WORD && token_before_that == FUNCTION) + return 1; + return 0; + } +} + +/* Return the index of TOKEN in the alist of reserved words, or -1 if + TOKEN is not a shell reserved word. */ +int +find_reserved_word (tokstr) + char *tokstr; +{ + int i; + for (i = 0; word_token_alist[i].word; i++) + if (STREQ (tokstr, word_token_alist[i].word)) + return i; + return -1; +} + +/* An interface to let the rest of the shell (primarily the completion + system) know what the parser is expecting. */ +int +parser_in_command_position () +{ + return (command_token_position (last_read_token)); +} + +#if 0 +#if defined (READLINE) +/* Called after each time readline is called. This insures that whatever + the new prompt string is gets propagated to readline's local prompt + variable. */ +static void +reset_readline_prompt () +{ + char *temp_prompt; + + if (prompt_string_pointer) + { + temp_prompt = (*prompt_string_pointer) + ? decode_prompt_string (*prompt_string_pointer) + : (char *)NULL; + + if (temp_prompt == 0) + { + temp_prompt = (char *)xmalloc (1); + temp_prompt[0] = '\0'; + } + + FREE (current_readline_prompt); + current_readline_prompt = temp_prompt; + } +} +#endif /* READLINE */ +#endif /* 0 */ + +#if defined (HISTORY) +/* A list of tokens which can be followed by newlines, but not by + semi-colons. When concatenating multiple lines of history, the + newline separator for such tokens is replaced with a space. */ +static const int no_semi_successors[] = { + '\n', '{', '(', ')', ';', '&', '|', + CASE, DO, ELSE, IF, SEMI_SEMI, SEMI_AND, SEMI_SEMI_AND, THEN, UNTIL, + WHILE, AND_AND, OR_OR, IN, + 0 +}; + +/* If we are not within a delimited expression, try to be smart + about which separators can be semi-colons and which must be + newlines. Returns the string that should be added into the + history entry. LINE is the line we're about to add; it helps + make some more intelligent decisions in certain cases. */ +char * +history_delimiting_chars (line) + const char *line; +{ + static int last_was_heredoc = 0; /* was the last entry the start of a here document? */ + register int i; + + if ((parser_state & PST_HEREDOC) == 0) + last_was_heredoc = 0; + + if (dstack.delimiter_depth != 0) + return ("\n"); + + /* We look for current_command_line_count == 2 because we are looking to + add the first line of the body of the here document (the second line + of the command). We also keep LAST_WAS_HEREDOC as a private sentinel + variable to note when we think we added the first line of a here doc + (the one with a "<<" somewhere in it) */ + if (parser_state & PST_HEREDOC) + { + if (last_was_heredoc) + { + last_was_heredoc = 0; + return "\n"; + } + return (current_command_line_count == 2 ? "\n" : ""); + } + + if (parser_state & PST_COMPASSIGN) + return (" "); + + /* First, handle some special cases. */ + /*(*/ + /* If we just read `()', assume it's a function definition, and don't + add a semicolon. If the token before the `)' was not `(', and we're + not in the midst of parsing a case statement, assume it's a + parenthesized command and add the semicolon. */ + /*)(*/ + if (token_before_that == ')') + { + if (two_tokens_ago == '(') /*)*/ /* function def */ + return " "; + /* This does not work for subshells inside case statement + command lists. It's a suboptimal solution. */ + else if (parser_state & PST_CASESTMT) /* case statement pattern */ + return " "; + else + return "; "; /* (...) subshell */ + } + else if (token_before_that == WORD && two_tokens_ago == FUNCTION) + return " "; /* function def using `function name' without `()' */ + + /* If we're not in a here document, but we think we're about to parse one, + and we would otherwise return a `;', return a newline to delimit the + line with the here-doc delimiter */ + else if ((parser_state & PST_HEREDOC) == 0 && current_command_line_count > 1 && last_read_token == '\n' && strstr (line, "<<")) + { + last_was_heredoc = 1; + return "\n"; + } + + else if (token_before_that == WORD && two_tokens_ago == FOR) + { + /* Tricky. `for i\nin ...' should not have a semicolon, but + `for i\ndo ...' should. We do what we can. */ + for (i = shell_input_line_index; whitespace (shell_input_line[i]); i++) + ; + if (shell_input_line[i] && shell_input_line[i] == 'i' && shell_input_line[i+1] == 'n') + return " "; + return ";"; + } + else if (two_tokens_ago == CASE && token_before_that == WORD && (parser_state & PST_CASESTMT)) + return " "; + + for (i = 0; no_semi_successors[i]; i++) + { + if (token_before_that == no_semi_successors[i]) + return (" "); + } + + return ("; "); +} +#endif /* HISTORY */ + +/* Issue a prompt, or prepare to issue a prompt when the next character + is read. */ +static void +prompt_again () +{ + char *temp_prompt; + + if (interactive == 0 || expanding_alias ()) /* XXX */ + return; + + ps1_prompt = get_string_value ("PS1"); + ps2_prompt = get_string_value ("PS2"); + + if (!prompt_string_pointer) + prompt_string_pointer = &ps1_prompt; + + temp_prompt = *prompt_string_pointer + ? decode_prompt_string (*prompt_string_pointer) + : (char *)NULL; + + if (temp_prompt == 0) + { + temp_prompt = (char *)xmalloc (1); + temp_prompt[0] = '\0'; + } + + current_prompt_string = *prompt_string_pointer; + prompt_string_pointer = &ps2_prompt; + +#if defined (READLINE) + if (!no_line_editing) + { + FREE (current_readline_prompt); + current_readline_prompt = temp_prompt; + } + else +#endif /* READLINE */ + { + FREE (current_decoded_prompt); + current_decoded_prompt = temp_prompt; + } +} + +int +get_current_prompt_level () +{ + return ((current_prompt_string && current_prompt_string == ps2_prompt) ? 2 : 1); +} + +void +set_current_prompt_level (x) + int x; +{ + prompt_string_pointer = (x == 2) ? &ps2_prompt : &ps1_prompt; + current_prompt_string = *prompt_string_pointer; +} + +static void +print_prompt () +{ + fprintf (stderr, "%s", current_decoded_prompt); + fflush (stderr); +} + +/* Return a string which will be printed as a prompt. The string + may contain special characters which are decoded as follows: + + \a bell (ascii 07) + \d the date in Day Mon Date format + \e escape (ascii 033) + \h the hostname up to the first `.' + \H the hostname + \j the number of active jobs + \l the basename of the shell's tty device name + \n CRLF + \r CR + \s the name of the shell + \t the time in 24-hour hh:mm:ss format + \T the time in 12-hour hh:mm:ss format + \@ the time in 12-hour hh:mm am/pm format + \A the time in 24-hour hh:mm format + \D{fmt} the result of passing FMT to strftime(3) + \u your username + \v the version of bash (e.g., 2.00) + \V the release of bash, version + patchlevel (e.g., 2.00.0) + \w the current working directory + \W the last element of $PWD + \! the history number of this command + \# the command number of this command + \$ a $ or a # if you are root + \nnn character code nnn in octal + \\ a backslash + \[ begin a sequence of non-printing chars + \] end a sequence of non-printing chars +*/ +#define PROMPT_GROWTH 48 +char * +decode_prompt_string (string) + char *string; +{ + WORD_LIST *list; + char *result, *t; + struct dstack save_dstack; + int last_exit_value, last_comsub_pid; +#if defined (PROMPT_STRING_DECODE) + int result_size, result_index; + int c, n, i; + char *temp, octal_string[4]; + struct tm *tm; + time_t the_time; + char timebuf[128]; + char *timefmt; + + result = (char *)xmalloc (result_size = PROMPT_GROWTH); + result[result_index = 0] = 0; + temp = (char *)NULL; + + while (c = *string++) + { + if (posixly_correct && c == '!') + { + if (*string == '!') + { + temp = savestring ("!"); + goto add_string; + } + else + { +#if !defined (HISTORY) + temp = savestring ("1"); +#else /* HISTORY */ + temp = itos (history_number ()); +#endif /* HISTORY */ + string--; /* add_string increments string again. */ + goto add_string; + } + } + if (c == '\\') + { + c = *string; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + strncpy (octal_string, string, 3); + octal_string[3] = '\0'; + + n = read_octal (octal_string); + temp = (char *)xmalloc (3); + + if (n == CTLESC || n == CTLNUL) + { + temp[0] = CTLESC; + temp[1] = n; + temp[2] = '\0'; + } + else if (n == -1) + { + temp[0] = '\\'; + temp[1] = '\0'; + } + else + { + temp[0] = n; + temp[1] = '\0'; + } + + for (c = 0; n != -1 && c < 3 && ISOCTAL (*string); c++) + string++; + + c = 0; /* tested at add_string: */ + goto add_string; + + case 'd': + case 't': + case 'T': + case '@': + case 'A': + /* Make the current time/date into a string. */ + (void) time (&the_time); +#if defined (HAVE_TZSET) + sv_tz ("TZ"); /* XXX -- just make sure */ +#endif + tm = localtime (&the_time); + + if (c == 'd') + n = strftime (timebuf, sizeof (timebuf), "%a %b %d", tm); + else if (c == 't') + n = strftime (timebuf, sizeof (timebuf), "%H:%M:%S", tm); + else if (c == 'T') + n = strftime (timebuf, sizeof (timebuf), "%I:%M:%S", tm); + else if (c == '@') + n = strftime (timebuf, sizeof (timebuf), "%I:%M %p", tm); + else if (c == 'A') + n = strftime (timebuf, sizeof (timebuf), "%H:%M", tm); + + if (n == 0) + timebuf[0] = '\0'; + else + timebuf[sizeof(timebuf) - 1] = '\0'; + + temp = savestring (timebuf); + goto add_string; + + case 'D': /* strftime format */ + if (string[1] != '{') /* } */ + goto not_escape; + + (void) time (&the_time); + tm = localtime (&the_time); + string += 2; /* skip { */ + timefmt = xmalloc (strlen (string) + 3); + for (t = timefmt; *string && *string != '}'; ) + *t++ = *string++; + *t = '\0'; + c = *string; /* tested at add_string */ + if (timefmt[0] == '\0') + { + timefmt[0] = '%'; + timefmt[1] = 'X'; /* locale-specific current time */ + timefmt[2] = '\0'; + } + n = strftime (timebuf, sizeof (timebuf), timefmt, tm); + free (timefmt); + + if (n == 0) + timebuf[0] = '\0'; + else + timebuf[sizeof(timebuf) - 1] = '\0'; + + if (promptvars || posixly_correct) + /* Make sure that expand_prompt_string is called with a + second argument of Q_DOUBLE_QUOTES if we use this + function here. */ + temp = sh_backslash_quote_for_double_quotes (timebuf); + else + temp = savestring (timebuf); + goto add_string; + + case 'n': + temp = (char *)xmalloc (3); + temp[0] = no_line_editing ? '\n' : '\r'; + temp[1] = no_line_editing ? '\0' : '\n'; + temp[2] = '\0'; + goto add_string; + + case 's': + temp = base_pathname (shell_name); + temp = savestring (temp); + goto add_string; + + case 'v': + case 'V': + temp = (char *)xmalloc (16); + if (c == 'v') + strcpy (temp, dist_version); + else + sprintf (temp, "%s.%d", dist_version, patch_level); + goto add_string; + + case 'w': + case 'W': + { + /* Use the value of PWD because it is much more efficient. */ + char t_string[PATH_MAX]; + int tlen; + + temp = get_string_value ("PWD"); + + if (temp == 0) + { + if (getcwd (t_string, sizeof(t_string)) == 0) + { + t_string[0] = '.'; + tlen = 1; + } + else + tlen = strlen (t_string); + } + else + { + tlen = sizeof (t_string) - 1; + strncpy (t_string, temp, tlen); + } + t_string[tlen] = '\0'; + +#if defined (MACOSX) + /* Convert from "fs" format to "input" format */ + temp = fnx_fromfs (t_string, strlen (t_string)); + if (temp != t_string) + strcpy (t_string, temp); +#endif + +#define ROOT_PATH(x) ((x)[0] == '/' && (x)[1] == 0) +#define DOUBLE_SLASH_ROOT(x) ((x)[0] == '/' && (x)[1] == '/' && (x)[2] == 0) + /* Abbreviate \W as ~ if $PWD == $HOME */ + if (c == 'W' && (((t = get_string_value ("HOME")) == 0) || STREQ (t, t_string) == 0)) + { + if (ROOT_PATH (t_string) == 0 && DOUBLE_SLASH_ROOT (t_string) == 0) + { + t = strrchr (t_string, '/'); + if (t) + memmove (t_string, t + 1, strlen (t)); /* strlen(t) to copy NULL */ + } + } +#undef ROOT_PATH +#undef DOUBLE_SLASH_ROOT + else + { + /* polite_directory_format is guaranteed to return a string + no longer than PATH_MAX - 1 characters. */ + temp = polite_directory_format (t_string); + if (temp != t_string) + strcpy (t_string, temp); + } + + temp = trim_pathname (t_string, PATH_MAX - 1); + /* If we're going to be expanding the prompt string later, + quote the directory name. */ + if (promptvars || posixly_correct) + /* Make sure that expand_prompt_string is called with a + second argument of Q_DOUBLE_QUOTES if we use this + function here. */ + temp = sh_backslash_quote_for_double_quotes (t_string); + else + temp = savestring (t_string); + + goto add_string; + } + + case 'u': + if (current_user.user_name == 0) + get_current_user_info (); + temp = savestring (current_user.user_name); + goto add_string; + + case 'h': + case 'H': + temp = savestring (current_host_name); + if (c == 'h' && (t = (char *)strchr (temp, '.'))) + *t = '\0'; + goto add_string; + + case '#': + temp = itos (current_command_number); + goto add_string; + + case '!': +#if !defined (HISTORY) + temp = savestring ("1"); +#else /* HISTORY */ + temp = itos (history_number ()); +#endif /* HISTORY */ + goto add_string; + + case '$': + t = temp = (char *)xmalloc (3); + if ((promptvars || posixly_correct) && (current_user.euid != 0)) + *t++ = '\\'; + *t++ = current_user.euid == 0 ? '#' : '$'; + *t = '\0'; + goto add_string; + + case 'j': + temp = itos (count_all_jobs ()); + goto add_string; + + case 'l': +#if defined (HAVE_TTYNAME) + temp = (char *)ttyname (fileno (stdin)); + t = temp ? base_pathname (temp) : "tty"; + temp = savestring (t); +#else + temp = savestring ("tty"); +#endif /* !HAVE_TTYNAME */ + goto add_string; + +#if defined (READLINE) + case '[': + case ']': + if (no_line_editing) + { + string++; + break; + } + temp = (char *)xmalloc (3); + n = (c == '[') ? RL_PROMPT_START_IGNORE : RL_PROMPT_END_IGNORE; + i = 0; + if (n == CTLESC || n == CTLNUL) + temp[i++] = CTLESC; + temp[i++] = n; + temp[i] = '\0'; + goto add_string; +#endif /* READLINE */ + + case '\\': + case 'a': + case 'e': + case 'r': + temp = (char *)xmalloc (2); + if (c == 'a') + temp[0] = '\07'; + else if (c == 'e') + temp[0] = '\033'; + else if (c == 'r') + temp[0] = '\r'; + else /* (c == '\\') */ + temp[0] = c; + temp[1] = '\0'; + goto add_string; + + default: +not_escape: + temp = (char *)xmalloc (3); + temp[0] = '\\'; + temp[1] = c; + temp[2] = '\0'; + + add_string: + if (c) + string++; + result = + sub_append_string (temp, result, &result_index, &result_size); + temp = (char *)NULL; /* Freed in sub_append_string (). */ + result[result_index] = '\0'; + break; + } + } + else + { + RESIZE_MALLOCED_BUFFER (result, result_index, 3, result_size, PROMPT_GROWTH); + result[result_index++] = c; + result[result_index] = '\0'; + } + } +#else /* !PROMPT_STRING_DECODE */ + result = savestring (string); +#endif /* !PROMPT_STRING_DECODE */ + + /* Save the delimiter stack and point `dstack' to temp space so any + command substitutions in the prompt string won't result in screwing + up the parser's quoting state. */ + save_dstack = dstack; + dstack = temp_dstack; + dstack.delimiter_depth = 0; + + /* Perform variable and parameter expansion and command substitution on + the prompt string. */ + if (promptvars || posixly_correct) + { + last_exit_value = last_command_exit_value; + last_comsub_pid = last_command_subst_pid; + list = expand_prompt_string (result, Q_DOUBLE_QUOTES, 0); + free (result); + result = string_list (list); + dispose_words (list); + last_command_exit_value = last_exit_value; + last_command_subst_pid = last_comsub_pid; + } + else + { + t = dequote_string (result); + free (result); + result = t; + } + + dstack = save_dstack; + + return (result); +} + +/************************************************ + * * + * ERROR HANDLING * + * * + ************************************************/ + +/* Report a syntax error, and restart the parser. Call here for fatal + errors. */ +int +yyerror (msg) + const char *msg; +{ + report_syntax_error ((char *)NULL); + reset_parser (); + return (0); +} + +static char * +error_token_from_token (tok) + int tok; +{ + char *t; + + if (t = find_token_in_alist (tok, word_token_alist, 0)) + return t; + + if (t = find_token_in_alist (tok, other_token_alist, 0)) + return t; + + t = (char *)NULL; + /* This stuff is dicy and needs closer inspection */ + switch (current_token) + { + case WORD: + case ASSIGNMENT_WORD: + if (yylval.word) + t = savestring (yylval.word->word); + break; + case NUMBER: + t = itos (yylval.number); + break; + case ARITH_CMD: + if (yylval.word_list) + t = string_list (yylval.word_list); + break; + case ARITH_FOR_EXPRS: + if (yylval.word_list) + t = string_list_internal (yylval.word_list, " ; "); + break; + case COND_CMD: + t = (char *)NULL; /* punt */ + break; + } + + return t; +} + +static char * +error_token_from_text () +{ + char *msg, *t; + int token_end, i; + + t = shell_input_line; + i = shell_input_line_index; + token_end = 0; + msg = (char *)NULL; + + if (i && t[i] == '\0') + i--; + + while (i && (whitespace (t[i]) || t[i] == '\n')) + i--; + + if (i) + token_end = i + 1; + + while (i && (member (t[i], " \n\t;|&") == 0)) + i--; + + while (i != token_end && (whitespace (t[i]) || t[i] == '\n')) + i++; + + /* Return our idea of the offending token. */ + if (token_end || (i == 0 && token_end == 0)) + { + if (token_end) + msg = substring (t, i, token_end); + else /* one-character token */ + { + msg = (char *)xmalloc (2); + msg[0] = t[i]; + msg[1] = '\0'; + } + } + + return (msg); +} + +static void +print_offending_line () +{ + char *msg; + int token_end; + + msg = savestring (shell_input_line); + token_end = strlen (msg); + while (token_end && msg[token_end - 1] == '\n') + msg[--token_end] = '\0'; + + parser_error (line_number, "`%s'", msg); + free (msg); +} + +/* Report a syntax error with line numbers, etc. + Call here for recoverable errors. If you have a message to print, + then place it in MESSAGE, otherwise pass NULL and this will figure + out an appropriate message for you. */ +static void +report_syntax_error (message) + char *message; +{ + char *msg, *p; + + if (message) + { + parser_error (line_number, "%s", message); + if (interactive && EOF_Reached) + EOF_Reached = 0; + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; + return; + } + + /* If the line of input we're reading is not null, try to find the + objectionable token. First, try to figure out what token the + parser's complaining about by looking at current_token. */ + if (current_token != 0 && EOF_Reached == 0 && (msg = error_token_from_token (current_token))) + { + if (ansic_shouldquote (msg)) + { + p = ansic_quote (msg, 0, NULL); + free (msg); + msg = p; + } + parser_error (line_number, _("syntax error near unexpected token `%s'"), msg); + free (msg); + + if (interactive == 0) + print_offending_line (); + + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; + return; + } + + /* If looking at the current token doesn't prove fruitful, try to find the + offending token by analyzing the text of the input line near the current + input line index and report what we find. */ + if (shell_input_line && *shell_input_line) + { + msg = error_token_from_text (); + if (msg) + { + parser_error (line_number, _("syntax error near `%s'"), msg); + free (msg); + } + + /* If not interactive, print the line containing the error. */ + if (interactive == 0) + print_offending_line (); + } + else + { + msg = EOF_Reached ? _("syntax error: unexpected end of file") : _("syntax error"); + parser_error (line_number, "%s", msg); + /* When the shell is interactive, this file uses EOF_Reached + only for error reporting. Other mechanisms are used to + decide whether or not to exit. */ + if (interactive && EOF_Reached) + EOF_Reached = 0; + } + + last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE; +} + +/* ??? Needed function. ??? We have to be able to discard the constructs + created during parsing. In the case of error, we want to return + allocated objects to the memory pool. In the case of no error, we want + to throw away the information about where the allocated objects live. + (dispose_command () will actually free the command.) */ +static void +discard_parser_constructs (error_p) + int error_p; +{ +} + +/************************************************ + * * + * EOF HANDLING * + * * + ************************************************/ + +/* Do that silly `type "bye" to exit' stuff. You know, "ignoreeof". */ + +/* A flag denoting whether or not ignoreeof is set. */ +int ignoreeof = 0; + +/* The number of times that we have encountered an EOF character without + another character intervening. When this gets above the limit, the + shell terminates. */ +int eof_encountered = 0; + +/* The limit for eof_encountered. */ +int eof_encountered_limit = 10; + +/* If we have EOF as the only input unit, this user wants to leave + the shell. If the shell is not interactive, then just leave. + Otherwise, if ignoreeof is set, and we haven't done this the + required number of times in a row, print a message. */ +static void +handle_eof_input_unit () +{ + if (interactive) + { + /* shell.c may use this to decide whether or not to write out the + history, among other things. We use it only for error reporting + in this file. */ + if (EOF_Reached) + EOF_Reached = 0; + + /* If the user wants to "ignore" eof, then let her do so, kind of. */ + if (ignoreeof) + { + if (eof_encountered < eof_encountered_limit) + { + fprintf (stderr, _("Use \"%s\" to leave the shell.\n"), + login_shell ? "logout" : "exit"); + eof_encountered++; + /* Reset the parsing state. */ + last_read_token = current_token = '\n'; + /* Reset the prompt string to be $PS1. */ + prompt_string_pointer = (char **)NULL; + prompt_again (); + return; + } + } + + /* In this case EOF should exit the shell. Do it now. */ + reset_parser (); + exit_builtin ((WORD_LIST *)NULL); + } + else + { + /* We don't write history files, etc., for non-interactive shells. */ + EOF_Reached = 1; + } +} + +/************************************************ + * * + * STRING PARSING FUNCTIONS * + * * + ************************************************/ + +/* It's very important that these two functions treat the characters + between ( and ) identically. */ + +static WORD_LIST parse_string_error; + +/* Take a string and run it through the shell parser, returning the + resultant word list. Used by compound array assignment. */ +WORD_LIST * +parse_string_to_word_list (s, flags, whom) + char *s; + int flags; + const char *whom; +{ + WORD_LIST *wl; + int tok, orig_current_token, orig_line_number, orig_input_terminator; + int orig_line_count; + int old_echo_input, old_expand_aliases; +#if defined (HISTORY) + int old_remember_on_history, old_history_expansion_inhibited; +#endif + +#if defined (HISTORY) + old_remember_on_history = remember_on_history; +# if defined (BANG_HISTORY) + old_history_expansion_inhibited = history_expansion_inhibited; +# endif + bash_history_disable (); +#endif + + orig_line_number = line_number; + orig_line_count = current_command_line_count; + orig_input_terminator = shell_input_line_terminator; + old_echo_input = echo_input_at_read; + old_expand_aliases = expand_aliases; + + push_stream (1); + last_read_token = WORD; /* WORD to allow reserved words here */ + current_command_line_count = 0; + echo_input_at_read = expand_aliases = 0; + + with_input_from_string (s, whom); + wl = (WORD_LIST *)NULL; + + if (flags & 1) + parser_state |= PST_COMPASSIGN|PST_REPARSE; + + while ((tok = read_token (READ)) != yacc_EOF) + { + if (tok == '\n' && *bash_input.location.string == '\0') + break; + if (tok == '\n') /* Allow newlines in compound assignments */ + continue; + if (tok != WORD && tok != ASSIGNMENT_WORD) + { + line_number = orig_line_number + line_number - 1; + orig_current_token = current_token; + current_token = tok; + yyerror (NULL); /* does the right thing */ + current_token = orig_current_token; + if (wl) + dispose_words (wl); + wl = &parse_string_error; + break; + } + wl = make_word_list (yylval.word, wl); + } + + last_read_token = '\n'; + pop_stream (); + +#if defined (HISTORY) + remember_on_history = old_remember_on_history; +# if defined (BANG_HISTORY) + history_expansion_inhibited = old_history_expansion_inhibited; +# endif /* BANG_HISTORY */ +#endif /* HISTORY */ + + echo_input_at_read = old_echo_input; + expand_aliases = old_expand_aliases; + + current_command_line_count = orig_line_count; + shell_input_line_terminator = orig_input_terminator; + + if (flags & 1) + parser_state &= ~(PST_COMPASSIGN|PST_REPARSE); + + if (wl == &parse_string_error) + { + last_command_exit_value = EXECUTION_FAILURE; + if (interactive_shell == 0 && posixly_correct) + jump_to_top_level (FORCE_EOF); + else + jump_to_top_level (DISCARD); + } + + return (REVERSE_LIST (wl, WORD_LIST *)); +} + +static char * +parse_compound_assignment (retlenp) + int *retlenp; +{ + WORD_LIST *wl, *rl; + int tok, orig_line_number, orig_token_size, orig_last_token, assignok; + char *saved_token, *ret; + + saved_token = token; + orig_token_size = token_buffer_size; + orig_line_number = line_number; + orig_last_token = last_read_token; + + last_read_token = WORD; /* WORD to allow reserved words here */ + + token = (char *)NULL; + token_buffer_size = 0; + + assignok = parser_state&PST_ASSIGNOK; /* XXX */ + + wl = (WORD_LIST *)NULL; /* ( */ + parser_state |= PST_COMPASSIGN; + + while ((tok = read_token (READ)) != ')') + { + if (tok == '\n') /* Allow newlines in compound assignments */ + { + if (SHOULD_PROMPT ()) + prompt_again (); + continue; + } + if (tok != WORD && tok != ASSIGNMENT_WORD) + { + current_token = tok; /* for error reporting */ + if (tok == yacc_EOF) /* ( */ + parser_error (orig_line_number, _("unexpected EOF while looking for matching `)'")); + else + yyerror(NULL); /* does the right thing */ + if (wl) + dispose_words (wl); + wl = &parse_string_error; + break; + } + wl = make_word_list (yylval.word, wl); + } + + FREE (token); + token = saved_token; + token_buffer_size = orig_token_size; + + parser_state &= ~PST_COMPASSIGN; + + if (wl == &parse_string_error) + { + last_command_exit_value = EXECUTION_FAILURE; + last_read_token = '\n'; /* XXX */ + if (interactive_shell == 0 && posixly_correct) + jump_to_top_level (FORCE_EOF); + else + jump_to_top_level (DISCARD); + } + + last_read_token = orig_last_token; /* XXX - was WORD? */ + + if (wl) + { + rl = REVERSE_LIST (wl, WORD_LIST *); + ret = string_list (rl); + dispose_words (rl); + } + else + ret = (char *)NULL; + + if (retlenp) + *retlenp = (ret && *ret) ? strlen (ret) : 0; + + if (assignok) + parser_state |= PST_ASSIGNOK; + + return ret; +} + +/************************************************ + * * + * SAVING AND RESTORING PARTIAL PARSE STATE * + * * + ************************************************/ + +sh_parser_state_t * +save_parser_state (ps) + sh_parser_state_t *ps; +{ + if (ps == 0) + ps = (sh_parser_state_t *)xmalloc (sizeof (sh_parser_state_t)); + if (ps == 0) + return ((sh_parser_state_t *)NULL); + + ps->parser_state = parser_state; + ps->token_state = save_token_state (); + + ps->input_line_terminator = shell_input_line_terminator; + ps->eof_encountered = eof_encountered; + + ps->prompt_string_pointer = prompt_string_pointer; + + ps->current_command_line_count = current_command_line_count; + +#if defined (HISTORY) + ps->remember_on_history = remember_on_history; +# if defined (BANG_HISTORY) + ps->history_expansion_inhibited = history_expansion_inhibited; +# endif +#endif + + ps->last_command_exit_value = last_command_exit_value; +#if defined (ARRAY_VARS) + ps->pipestatus = save_pipestatus_array (); +#endif + + ps->last_shell_builtin = last_shell_builtin; + ps->this_shell_builtin = this_shell_builtin; + + ps->expand_aliases = expand_aliases; + ps->echo_input_at_read = echo_input_at_read; + ps->need_here_doc = need_here_doc; + + ps->token = token; + ps->token_buffer_size = token_buffer_size; + /* Force reallocation on next call to read_token_word */ + token = 0; + token_buffer_size = 0; + + return (ps); +} + +void +restore_parser_state (ps) + sh_parser_state_t *ps; +{ + if (ps == 0) + return; + + parser_state = ps->parser_state; + if (ps->token_state) + { + restore_token_state (ps->token_state); + free (ps->token_state); + } + + shell_input_line_terminator = ps->input_line_terminator; + eof_encountered = ps->eof_encountered; + + prompt_string_pointer = ps->prompt_string_pointer; + + current_command_line_count = ps->current_command_line_count; + +#if defined (HISTORY) + remember_on_history = ps->remember_on_history; +# if defined (BANG_HISTORY) + history_expansion_inhibited = ps->history_expansion_inhibited; +# endif +#endif + + last_command_exit_value = ps->last_command_exit_value; +#if defined (ARRAY_VARS) + restore_pipestatus_array (ps->pipestatus); +#endif + + last_shell_builtin = ps->last_shell_builtin; + this_shell_builtin = ps->this_shell_builtin; + + expand_aliases = ps->expand_aliases; + echo_input_at_read = ps->echo_input_at_read; + need_here_doc = ps->need_here_doc; + + FREE (token); + token = ps->token; + token_buffer_size = ps->token_buffer_size; +} + +sh_input_line_state_t * +save_input_line_state (ls) + sh_input_line_state_t *ls; +{ + if (ls == 0) + ls = (sh_input_line_state_t *)xmalloc (sizeof (sh_input_line_state_t)); + if (ls == 0) + return ((sh_input_line_state_t *)NULL); + + ls->input_line = shell_input_line; + ls->input_line_size = shell_input_line_size; + ls->input_line_len = shell_input_line_len; + ls->input_line_index = shell_input_line_index; + + /* force reallocation */ + shell_input_line = 0; + shell_input_line_size = shell_input_line_len = shell_input_line_index = 0; + + return ls; +} + +void +restore_input_line_state (ls) + sh_input_line_state_t *ls; +{ + FREE (shell_input_line); + shell_input_line = ls->input_line; + shell_input_line_size = ls->input_line_size; + shell_input_line_len = ls->input_line_len; + shell_input_line_index = ls->input_line_index; + + set_line_mbstate (); +} + +/************************************************ + * * + * MULTIBYTE CHARACTER HANDLING * + * * + ************************************************/ + +#if defined (HANDLE_MULTIBYTE) +static void +set_line_mbstate () +{ + int c; + size_t i, previ, len; + mbstate_t mbs, prevs; + size_t mbclen; + + if (shell_input_line == NULL) + return; + len = strlen (shell_input_line); /* XXX - shell_input_line_len ? */ + FREE (shell_input_line_property); + shell_input_line_property = (char *)xmalloc (len + 1); + + memset (&prevs, '\0', sizeof (mbstate_t)); + for (i = previ = 0; i < len; i++) + { + mbs = prevs; + + c = shell_input_line[i]; + if (c == EOF) + { + size_t j; + for (j = i; j < len; j++) + shell_input_line_property[j] = 1; + break; + } + + mbclen = mbrlen (shell_input_line + previ, i - previ + 1, &mbs); + if (mbclen == 1 || mbclen == (size_t)-1) + { + mbclen = 1; + previ = i + 1; + } + else if (mbclen == (size_t)-2) + mbclen = 0; + else if (mbclen > 1) + { + mbclen = 0; + previ = i + 1; + prevs = mbs; + } + else + { + /* XXX - what to do if mbrlen returns 0? (null wide character) */ + size_t j; + for (j = i; j < len; j++) + shell_input_line_property[j] = 1; + break; + } + + shell_input_line_property[i] = mbclen; + } +} +#endif /* HANDLE_MULTIBYTE */ + diff --git a/y.tab.h b/y.tab.h new file mode 100644 index 0000000..b280e40 --- /dev/null +++ b/y.tab.h @@ -0,0 +1,164 @@ +/* A Bison parser, made by GNU Bison 2.3. */ + +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + IF = 258, + THEN = 259, + ELSE = 260, + ELIF = 261, + FI = 262, + CASE = 263, + ESAC = 264, + FOR = 265, + SELECT = 266, + WHILE = 267, + UNTIL = 268, + DO = 269, + DONE = 270, + FUNCTION = 271, + COPROC = 272, + COND_START = 273, + COND_END = 274, + COND_ERROR = 275, + IN = 276, + BANG = 277, + TIME = 278, + TIMEOPT = 279, + TIMEIGN = 280, + WORD = 281, + ASSIGNMENT_WORD = 282, + REDIR_WORD = 283, + NUMBER = 284, + ARITH_CMD = 285, + ARITH_FOR_EXPRS = 286, + COND_CMD = 287, + AND_AND = 288, + OR_OR = 289, + GREATER_GREATER = 290, + LESS_LESS = 291, + LESS_AND = 292, + LESS_LESS_LESS = 293, + GREATER_AND = 294, + SEMI_SEMI = 295, + SEMI_AND = 296, + SEMI_SEMI_AND = 297, + LESS_LESS_MINUS = 298, + AND_GREATER = 299, + AND_GREATER_GREATER = 300, + LESS_GREATER = 301, + GREATER_BAR = 302, + BAR_AND = 303, + yacc_EOF = 304 + }; +#endif +/* Tokens. */ +#define IF 258 +#define THEN 259 +#define ELSE 260 +#define ELIF 261 +#define FI 262 +#define CASE 263 +#define ESAC 264 +#define FOR 265 +#define SELECT 266 +#define WHILE 267 +#define UNTIL 268 +#define DO 269 +#define DONE 270 +#define FUNCTION 271 +#define COPROC 272 +#define COND_START 273 +#define COND_END 274 +#define COND_ERROR 275 +#define IN 276 +#define BANG 277 +#define TIME 278 +#define TIMEOPT 279 +#define TIMEIGN 280 +#define WORD 281 +#define ASSIGNMENT_WORD 282 +#define REDIR_WORD 283 +#define NUMBER 284 +#define ARITH_CMD 285 +#define ARITH_FOR_EXPRS 286 +#define COND_CMD 287 +#define AND_AND 288 +#define OR_OR 289 +#define GREATER_GREATER 290 +#define LESS_LESS 291 +#define LESS_AND 292 +#define LESS_LESS_LESS 293 +#define GREATER_AND 294 +#define SEMI_SEMI 295 +#define SEMI_AND 296 +#define SEMI_SEMI_AND 297 +#define LESS_LESS_MINUS 298 +#define AND_GREATER 299 +#define AND_GREATER_GREATER 300 +#define LESS_GREATER 301 +#define GREATER_BAR 302 +#define BAR_AND 303 +#define yacc_EOF 304 + + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 324 "/usr/homes/chet/src/bash/src/parse.y" +{ + WORD_DESC *word; /* the word that we read. */ + int number; /* the number that we read. */ + WORD_LIST *word_list; + COMMAND *command; + REDIRECT *redirect; + ELEMENT element; + PATTERN_LIST *pattern; +} +/* Line 1529 of yacc.c. */ +#line 157 "y.tab.h" + YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + +extern YYSTYPE yylval; + -- 2.30.2
    +argv[11] = +argv[1] = +argv[2] = +argv[3] = +argv[4] = +argv[5] = +argv[6] = +argv[7] = +argv[1] = <*> +argv[1] = +argv[1] = diff --git a/tests/glob.tests b/tests/glob.tests new file mode 100644 index 0000000..d32988b --- /dev/null +++ b/tests/glob.tests @@ -0,0 +1,388 @@ +export LC_COLLATE=C +# +# test the shell globbing +# +expect() +{ + echo expect "$@" +} + +# First, a test that bash-2.01.1 fails +${THIS_SH} ./glob1.sub + +MYDIR=$PWD # save where we are + +TESTDIR=/tmp/glob-test +mkdir $TESTDIR +builtin cd $TESTDIR || { echo $0: cannot cd to $TESTDIR >&2 ; exit 1; } +rm -rf * + +touch a b c d abc abd abe bb bcd ca cb dd de Beware +mkdir bdir + +# see if `regular' globbing works right +expect ' ' +recho a* X* + +expect ' ' +recho \a* + +# see if null glob expansion works +shopt -s nullglob + +expect ' ' +recho a* X* + +shopt -u nullglob + +# see if the failglob option works + +mkdir tmp +touch tmp/l1 tmp/l2 tmp/l3 +builtin echo tmp/l[12] tmp/*4 tmp/*3 +shopt -s failglob +builtin echo tmp/l[12] tmp/*4 tmp/*3 +rm -r tmp +shopt -u failglob + +# see if the code that expands directories only works +expect '' +recho b*/ + +# Test quoted and unquoted globbing characters +expect '<*>' +recho \* + +expect '' +recho 'a*' + +expect '' +recho a\* + +expect ' <*q*>' +recho c* a\* *q* + +expect '<**>' +recho "*"* + +expect '<**>' +recho \** + +expect '<\.\./*/>' +recho "\.\./*/" + +expect '' +recho 's/\..*//' + +# Pattern from Larry Wall's Configure that caused bash to blow up +expect '' +recho "/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*"'$'"/\1/" + +# Make sure character classes work properly + +expect ' ' +recho [a-c]b* + +expect '
    ' . + &t2h_anchor('', $href, $entry) . + '  ' . + $descr . + "
    ' . + $entry . + '' . $descr . + "